From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 01:27:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E09C211; Sun, 23 Feb 2014 01:27:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 08A4E11CA; Sun, 23 Feb 2014 01:27:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1N1RMTg052543; Sun, 23 Feb 2014 01:27:22 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1N1RMoX052542; Sun, 23 Feb 2014 01:27:22 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201402230127.s1N1RMoX052542@svn.freebsd.org> From: Craig Rodrigues Date: Sun, 23 Feb 2014 01:27:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262351 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 01:27:23 -0000 Author: rodrigc Date: Sun Feb 23 01:27:22 2014 New Revision: 262351 URL: http://svnweb.freebsd.org/changeset/base/262351 Log: Remove KASSERT from in6p_lookup_mcast_ifp(). When the devel/jenkins port, version 1.551 was started, the kernel would panic if INVARIANTS was enabled in the kernel config. Suggested by: bms Modified: head/sys/netinet6/in6_mcast.c Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Sun Feb 23 00:46:05 2014 (r262350) +++ head/sys/netinet6/in6_mcast.c Sun Feb 23 01:27:22 2014 (r262351) @@ -1781,8 +1781,6 @@ in6p_lookup_mcast_ifp(const struct inpcb ("%s: not INP_IPV6 inpcb", __func__)); KASSERT(gsin6->sin6_family == AF_INET6, ("%s: not AF_INET6 group", __func__)); - KASSERT(IN6_IS_ADDR_MULTICAST(&gsin6->sin6_addr), - ("%s: not multicast", __func__)); ifp = NULL; memset(&ro6, 0, sizeof(struct route_in6)); From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 01:37:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E332A75C; Sun, 23 Feb 2014 01:37:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CF151129B; Sun, 23 Feb 2014 01:37:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1N1bT94056635; Sun, 23 Feb 2014 01:37:29 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1N1bT1K056634; Sun, 23 Feb 2014 01:37:29 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402230137.s1N1bT1K056634@svn.freebsd.org> From: Ian Lepore Date: Sun, 23 Feb 2014 01:37:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262353 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 01:37:30 -0000 Author: ian Date: Sun Feb 23 01:37:29 2014 New Revision: 262353 URL: http://svnweb.freebsd.org/changeset/base/262353 Log: Add the FREEBSD_BOOT_LOADER option so that a loaded DTB passed in from ubldr will actually get used. Modified: head/sys/arm/conf/WANDBOARD.common Modified: head/sys/arm/conf/WANDBOARD.common ============================================================================== --- head/sys/arm/conf/WANDBOARD.common Sun Feb 23 01:34:40 2014 (r262352) +++ head/sys/arm/conf/WANDBOARD.common Sun Feb 23 01:37:29 2014 (r262353) @@ -153,3 +153,5 @@ device mmcsd # SDCard disk device device ffec # Freescale Fast Ethernet Controller +options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) + From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 01:48:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D63CA2A; Sun, 23 Feb 2014 01:48:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 57DEE1355; Sun, 23 Feb 2014 01:48:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1N1m8wh060542; Sun, 23 Feb 2014 01:48:08 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1N1m8KD060541; Sun, 23 Feb 2014 01:48:08 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402230148.s1N1m8KD060541@svn.freebsd.org> From: Ian Lepore Date: Sun, 23 Feb 2014 01:48:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262354 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 01:48:08 -0000 Author: ian Date: Sun Feb 23 01:48:07 2014 New Revision: 262354 URL: http://svnweb.freebsd.org/changeset/base/262354 Log: Create a generic IMX6 kernel config. This is based on the existing WANDBOARD.common config, but with the freescale-specific optons and devices all together at the bottom now. In addition to reformatting and shuffling lines around, two new options are added because they're now known to work, VFP and FREEBSD_BOOT_LOADER. This config does not include any static DTB, it requires that u-boot provide a DTB (or a custom kernel config can compile one in). This will supercede all the existing WANDBOARD* configs, but those will be left around for a while to help people transition their customized configs to include this new one instead. Added: head/sys/arm/conf/IMX6 - copied, changed from r262304, head/sys/arm/conf/WANDBOARD.common Copied and modified: head/sys/arm/conf/IMX6 (from r262304, head/sys/arm/conf/WANDBOARD.common) ============================================================================== --- head/sys/arm/conf/WANDBOARD.common Fri Feb 21 21:02:19 2014 (r262304, copy source) +++ head/sys/arm/conf/IMX6 Sun Feb 23 01:48:07 2014 (r262354) @@ -65,73 +65,70 @@ options ALT_BREAK_TO_DEBUGGER # Use Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1ADF0C49; Sun, 23 Feb 2014 01:49:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 06AE21363; Sun, 23 Feb 2014 01:49:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1N1n1jl060751; Sun, 23 Feb 2014 01:49:01 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1N1n1mj060750; Sun, 23 Feb 2014 01:49:01 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402230149.s1N1n1mj060750@svn.freebsd.org> From: Ian Lepore Date: Sun, 23 Feb 2014 01:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262355 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 01:49:02 -0000 Author: ian Date: Sun Feb 23 01:49:01 2014 New Revision: 262355 URL: http://svnweb.freebsd.org/changeset/base/262355 Log: Don't force bootverbose on anymore, it can be set from ubldr now. Modified: head/sys/arm/freescale/imx/imx6_machdep.c Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Sun Feb 23 01:48:07 2014 (r262354) +++ head/sys/arm/freescale/imx/imx6_machdep.c Sun Feb 23 01:49:01 2014 (r262355) @@ -55,9 +55,6 @@ void initarm_early_init(void) { - /* XXX - Get rid of this stuff soon. */ - boothowto |= RB_VERBOSE|RB_MULTIPLE; - bootverbose = 1; } void From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 08:05:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 139C152C; Sun, 23 Feb 2014 08:05:32 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 832DA1464; Sun, 23 Feb 2014 08:05:30 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s1N85Rl7001305 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 23 Feb 2014 12:05:27 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s1N85RqO001304; Sun, 23 Feb 2014 12:05:27 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 23 Feb 2014 12:05:27 +0400 From: Gleb Smirnoff To: Craig Rodrigues Subject: Re: svn commit: r262196 - head/sys/netpfil/pf Message-ID: <20140223080527.GL86937@FreeBSD.org> References: <201402182217.s1IMHCeM077356@svn.freebsd.org> <20140219101736.GX63039@glebius.int.ru> <20140219140123.Horde.zrXx5GqkiiaAfGIetc98KQ1@mail.vx.sk> <20140219153215.GD63039@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Nikos Vassiliadis , src-committers@freebsd.org, Martin Matuska X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 08:05:32 -0000 On Sat, Feb 22, 2014 at 03:28:38PM -0800, Craig Rodrigues wrote: C> Much thanks to you and Nicos for working on pf + VIMAGE. C> I work on FreeNAS at iXsystems, and in FreeNAS we enable C> VIMAGE, because we use jails quiet heavily. C> C> I encouraged Martin to go with his patch, because C> it seemed to solve some problems we had with pf + VIMAGE kernel panics C> such as this one: C> C> https://bugs.freenas.org/issues/4153 C> C> Do you have a rough idea when you and Nicos will be ready to merge your C> projects/pf branch to HEAD? C> Would you be open to forking the https://github.com/trueos repository on C> github C> and putting your pf + VIMAGE patches in there? C> C> We could make special builds of FreeNAS and aggressively test your VIMAGE C> patches. FreeNAS isn't based on FreeBSD CURRENT/FreeBSD 10 yet..... C> we have some work to do to get up to there. Current plan is that mm@ commits his changes to projects/pf, taking into account comment from trociny@. Then after few days of testing, he merges projects/pf to head. It was kept diverged for too long time. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 18:07:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EBF40AE0; Sun, 23 Feb 2014 18:07:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D5C6B164F; Sun, 23 Feb 2014 18:07:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NI7HCG057185; Sun, 23 Feb 2014 18:07:17 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NI7H0V057183; Sun, 23 Feb 2014 18:07:17 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201402231807.s1NI7H0V057183@svn.freebsd.org> From: Hiren Panchasara Date: Sun, 23 Feb 2014 18:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262375 - in head/sys/dev/ath/ath_hal: . ah_regdomain X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 18:07:18 -0000 Author: hiren Date: Sun Feb 23 18:07:17 2014 New Revision: 262375 URL: http://svnweb.freebsd.org/changeset/base/262375 Log: PicoStation M2HP presents reg domain 0x2a which is not found in atheros or linux reference code. Add this workaround for now. Reviewed by: adrian Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_regenum.h Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_regdomain.c Sun Feb 23 17:37:24 2014 (r262374) +++ head/sys/dev/ath/ath_hal/ah_regdomain.c Sun Feb 23 18:07:17 2014 (r262375) @@ -169,6 +169,11 @@ isEepromValid(struct ath_hal *ah) if (regDomainPairs[i].regDmnEnum == rd) return AH_TRUE; } + + if (rd == FCC_UBNT) { + return AH_TRUE; + } + HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, "%s: invalid regulatory domain/country code 0x%x\n", __func__, rd); return AH_FALSE; Modified: head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_regenum.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_regenum.h Sun Feb 23 17:37:24 2014 (r262374) +++ head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_regenum.h Sun Feb 23 18:07:17 2014 (r262375) @@ -51,6 +51,7 @@ enum { FCC2_FCCA = 0x20, /* Canada */ FCC2_WORLD = 0x21, /* Australia & HK */ FCC2_ETSIC = 0x22, + FCC_UBNT = 0x2A, /* Ubiquity PicoStation M2HP */ FRANCE_RES = 0x31, /* Legacy France for OEM */ FCC3_FCCA = 0x3A, /* USA & Canada w/5470 band, 11h, DFS enabled */ FCC3_WORLD = 0x3B, /* USA & Canada w/5470 band, 11h, DFS enabled */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 21:13:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BD7456F; Sun, 23 Feb 2014 21:13:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 75FC61663; Sun, 23 Feb 2014 21:13:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NLD5Xq034197; Sun, 23 Feb 2014 21:13:05 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NLD5wX034196; Sun, 23 Feb 2014 21:13:05 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402232113.s1NLD5wX034196@svn.freebsd.org> From: Ian Lepore Date: Sun, 23 Feb 2014 21:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262393 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 21:13:05 -0000 Author: ian Date: Sun Feb 23 21:13:04 2014 New Revision: 262393 URL: http://svnweb.freebsd.org/changeset/base/262393 Log: Fix a typo _IMX51_TZICRREG_H_ -> _IMX51_TZICREG_H_ (extra R) Modified: head/sys/arm/freescale/imx/imx51_tzicreg.h Modified: head/sys/arm/freescale/imx/imx51_tzicreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx51_tzicreg.h Sun Feb 23 21:08:48 2014 (r262392) +++ head/sys/arm/freescale/imx/imx51_tzicreg.h Sun Feb 23 21:13:04 2014 (r262393) @@ -57,7 +57,7 @@ */ #ifndef _IMX51_TZICREG_H_ -#define _IMX51_TZICRREG_H_ +#define _IMX51_TZICREG_H_ #include From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 21:13:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 625A9570; Sun, 23 Feb 2014 21:13:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3EA221664; Sun, 23 Feb 2014 21:13:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NLD8vu034243; Sun, 23 Feb 2014 21:13:08 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NLD8O8034241; Sun, 23 Feb 2014 21:13:08 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201402232113.s1NLD8O8034241@svn.freebsd.org> From: David Chisnall Date: Sun, 23 Feb 2014 21:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262394 - head/usr.bin/dtc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 21:13:08 -0000 Author: theraven Date: Sun Feb 23 21:13:07 2014 New Revision: 262394 URL: http://svnweb.freebsd.org/changeset/base/262394 Log: Fix parsing multiple roots with whitespace between them. Patch by: Patrick Wildt Modified: head/usr.bin/dtc/fdt.cc Modified: head/usr.bin/dtc/fdt.cc ============================================================================== --- head/usr.bin/dtc/fdt.cc Sun Feb 23 21:13:04 2014 (r262393) +++ head/usr.bin/dtc/fdt.cc Sun Feb 23 21:13:07 2014 (r262394) @@ -1059,6 +1059,7 @@ device_tree::parse_roots(input_buffer &i { valid = false; } + input.next_token(); } } From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 21:43:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFB182DC; Sun, 23 Feb 2014 21:43:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BB8ED18D4; Sun, 23 Feb 2014 21:43:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NLhFmu046271; Sun, 23 Feb 2014 21:43:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NLhFki046270; Sun, 23 Feb 2014 21:43:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402232143.s1NLhFki046270@svn.freebsd.org> From: Adrian Chadd Date: Sun, 23 Feb 2014 21:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262397 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 21:43:15 -0000 Author: adrian Date: Sun Feb 23 21:43:15 2014 New Revision: 262397 URL: http://svnweb.freebsd.org/changeset/base/262397 Log: Fix indentation. Modified: head/sys/dev/iwn/if_iwnreg.h Modified: head/sys/dev/iwn/if_iwnreg.h ============================================================================== --- head/sys/dev/iwn/if_iwnreg.h Sun Feb 23 21:29:13 2014 (r262396) +++ head/sys/dev/iwn/if_iwnreg.h Sun Feb 23 21:43:15 2014 (r262397) @@ -1610,7 +1610,7 @@ struct iwn_fw_tlv { #define IWN_FW_TLV_INIT_DATA 4 #define IWN_FW_TLV_BOOT_TEXT 5 #define IWN_FW_TLV_PBREQ_MAXLEN 6 -#define IWN_FW_TLV_PAN 7 +#define IWN_FW_TLV_PAN 7 #define IWN_FW_TLV_RUNT_EVTLOG_PTR 8 #define IWN_FW_TLV_RUNT_EVTLOG_SIZE 9 #define IWN_FW_TLV_RUNT_ERRLOG_PTR 10 @@ -1621,7 +1621,7 @@ struct iwn_fw_tlv { #define IWN_FW_TLV_PHY_CALIB 15 #define IWN_FW_TLV_WOWLAN_INST 16 #define IWN_FW_TLV_WOWLAN_DATA 17 -#define IWN_FW_TLV_FLAGS 18 +#define IWN_FW_TLV_FLAGS 18 uint16_t alt; uint32_t len; From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 21:49:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0AE9550A; Sun, 23 Feb 2014 21:49:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E662C1901; Sun, 23 Feb 2014 21:49:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NLnMBW047047; Sun, 23 Feb 2014 21:49:22 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NLnMK6047039; Sun, 23 Feb 2014 21:49:22 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402232149.s1NLnMK6047039@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 23 Feb 2014 21:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262398 - in head: contrib/libucl contrib/libucl/doc contrib/libucl/include contrib/libucl/src contrib/libucl/tests contrib/libucl/uthash contrib/libucl/utils lib/libucl share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 21:49:23 -0000 Author: bapt Date: Sun Feb 23 21:49:21 2014 New Revision: 262398 URL: http://svnweb.freebsd.org/changeset/base/262398 Log: Import libucl into head UCL is heavily infused by nginx configuration as the example of a convenient configuration system. However, UCL is fully compatible with JSON format and is able to parse json files. UCL is used by pkg(8) for its configuration file as well for the manifest format in packages, it will be used in base for the pkg boostrap (signature checking and configuration file parsing.) libucl has been developped and is maintained by vsevolod@ Added: head/contrib/libucl/ - copied from r262396, vendor/libucl/dist/ head/lib/libucl/ head/lib/libucl/Makefile (contents, props changed) Replaced: head/contrib/libucl/.gitignore - copied unchanged from r262396, vendor/libucl/dist/.gitignore head/contrib/libucl/Makefile - copied unchanged from r262396, vendor/libucl/dist/Makefile head/contrib/libucl/README.md - copied unchanged from r262396, vendor/libucl/dist/README.md head/contrib/libucl/doc/ - copied from r262396, vendor/libucl/dist/doc/ head/contrib/libucl/doc/api.md - copied unchanged from r262396, vendor/libucl/dist/doc/api.md head/contrib/libucl/include/ - copied from r262396, vendor/libucl/dist/include/ head/contrib/libucl/include/ucl.h - copied unchanged from r262396, vendor/libucl/dist/include/ucl.h head/contrib/libucl/src/ - copied from r262396, vendor/libucl/dist/src/ head/contrib/libucl/src/ucl_chartable.h - copied unchanged from r262396, vendor/libucl/dist/src/ucl_chartable.h head/contrib/libucl/src/ucl_emitter.c - copied unchanged from r262396, vendor/libucl/dist/src/ucl_emitter.c head/contrib/libucl/src/ucl_hash.c - copied unchanged from r262396, vendor/libucl/dist/src/ucl_hash.c head/contrib/libucl/src/ucl_hash.h - copied unchanged from r262396, vendor/libucl/dist/src/ucl_hash.h head/contrib/libucl/src/ucl_internal.h - copied unchanged from r262396, vendor/libucl/dist/src/ucl_internal.h head/contrib/libucl/src/ucl_parser.c - copied unchanged from r262396, vendor/libucl/dist/src/ucl_parser.c head/contrib/libucl/src/ucl_util.c - copied unchanged from r262396, vendor/libucl/dist/src/ucl_util.c head/contrib/libucl/src/xxhash.c - copied unchanged from r262396, vendor/libucl/dist/src/xxhash.c head/contrib/libucl/src/xxhash.h - copied unchanged from r262396, vendor/libucl/dist/src/xxhash.h head/contrib/libucl/tests/ - copied from r262396, vendor/libucl/dist/tests/ head/contrib/libucl/tests/1.in - copied unchanged from r262396, vendor/libucl/dist/tests/1.in head/contrib/libucl/tests/1.res - copied unchanged from r262396, vendor/libucl/dist/tests/1.res head/contrib/libucl/tests/2.in - copied unchanged from r262396, vendor/libucl/dist/tests/2.in head/contrib/libucl/tests/2.res - copied unchanged from r262396, vendor/libucl/dist/tests/2.res head/contrib/libucl/tests/3.in - copied unchanged from r262396, vendor/libucl/dist/tests/3.in head/contrib/libucl/tests/3.res - copied unchanged from r262396, vendor/libucl/dist/tests/3.res head/contrib/libucl/tests/4.in - copied unchanged from r262396, vendor/libucl/dist/tests/4.in head/contrib/libucl/tests/4.res - copied unchanged from r262396, vendor/libucl/dist/tests/4.res head/contrib/libucl/tests/5.in - copied unchanged from r262396, vendor/libucl/dist/tests/5.in head/contrib/libucl/tests/5.res - copied unchanged from r262396, vendor/libucl/dist/tests/5.res head/contrib/libucl/tests/6.in - copied unchanged from r262396, vendor/libucl/dist/tests/6.in head/contrib/libucl/tests/6.res - copied unchanged from r262396, vendor/libucl/dist/tests/6.res head/contrib/libucl/tests/7.in - copied unchanged from r262396, vendor/libucl/dist/tests/7.in head/contrib/libucl/tests/7.res - copied unchanged from r262396, vendor/libucl/dist/tests/7.res head/contrib/libucl/tests/8.in - copied unchanged from r262396, vendor/libucl/dist/tests/8.in head/contrib/libucl/tests/8.res - copied unchanged from r262396, vendor/libucl/dist/tests/8.res head/contrib/libucl/tests/9-comment.inc - copied unchanged from r262396, vendor/libucl/dist/tests/9-comment.inc head/contrib/libucl/tests/9-empty.inc - copied unchanged from r262396, vendor/libucl/dist/tests/9-empty.inc head/contrib/libucl/tests/9.in - copied unchanged from r262396, vendor/libucl/dist/tests/9.in head/contrib/libucl/tests/9.inc - copied unchanged from r262396, vendor/libucl/dist/tests/9.inc head/contrib/libucl/tests/9.res - copied unchanged from r262396, vendor/libucl/dist/tests/9.res head/contrib/libucl/tests/generate.res - copied unchanged from r262396, vendor/libucl/dist/tests/generate.res head/contrib/libucl/tests/run_tests.sh - copied unchanged from r262396, vendor/libucl/dist/tests/run_tests.sh head/contrib/libucl/tests/test_basic.c - copied unchanged from r262396, vendor/libucl/dist/tests/test_basic.c head/contrib/libucl/tests/test_generate.c - copied unchanged from r262396, vendor/libucl/dist/tests/test_generate.c head/contrib/libucl/tests/test_speed.c - copied unchanged from r262396, vendor/libucl/dist/tests/test_speed.c head/contrib/libucl/uthash/ - copied from r262396, vendor/libucl/dist/uthash/ head/contrib/libucl/uthash/uthash.h - copied unchanged from r262396, vendor/libucl/dist/uthash/uthash.h head/contrib/libucl/uthash/utlist.h - copied unchanged from r262396, vendor/libucl/dist/uthash/utlist.h head/contrib/libucl/uthash/utstring.h - copied unchanged from r262396, vendor/libucl/dist/uthash/utstring.h head/contrib/libucl/utils/ - copied from r262396, vendor/libucl/dist/utils/ head/contrib/libucl/utils/chargen.c - copied unchanged from r262396, vendor/libucl/dist/utils/chargen.c head/contrib/libucl/utils/objdump.c - copied unchanged from r262396, vendor/libucl/dist/utils/objdump.c Modified: head/share/mk/bsd.libnames.mk Copied: head/contrib/libucl/.gitignore (from r262396, vendor/libucl/dist/.gitignore) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libucl/.gitignore Sun Feb 23 21:49:21 2014 (r262398, copy of r262396, vendor/libucl/dist/.gitignore) @@ -0,0 +1,3 @@ +.cproject +.project +.settings Copied: head/contrib/libucl/Makefile (from r262396, vendor/libucl/dist/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libucl/Makefile Sun Feb 23 21:49:21 2014 (r262398, copy of r262396, vendor/libucl/dist/Makefile) @@ -0,0 +1,79 @@ +CC ?= gcc +DESTDIR ?= /usr/local +LD ?= gcc +C_COMMON_FLAGS ?= -fPIC -Wall -W -Wno-unused-parameter -Wno-pointer-sign -I./include -I./uthash -I./src +MAJOR_VERSION = 0 +MINOR_VERSION = 2 +PATCH_VERSION = 8 +VERSION = "$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)" +SONAME = libucl.so +SONAME_FULL = $(SONAME).$(MAJOR_VERSION) +OBJDIR ?= .obj +TESTDIR ?= tests +SRCDIR ?= src +INCLUDEDIR ?= include +MKDIR ?= mkdir +INSTALL ?= install +RM ?= rm +RMDIR ?= rmdir +LN ?= ln +LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) -shared -lm +LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl +LD_ADD ?= -lrt +COPT_FLAGS ?= -g -O0 +HDEPS = $(SRCDIR)/ucl_hash.h $(SRCDIR)/ucl_chartable.h $(SRCDIR)/ucl_internal.h $(INCLUDEDIR)/ucl.h $(SRCDIR)/xxhash.h +OBJECTS = $(OBJDIR)/ucl_hash.o $(OBJDIR)/ucl_util.o $(OBJDIR)/ucl_parser.o $(OBJDIR)/ucl_emitter.o $(OBJDIR)/xxhash.o + +all: $(OBJDIR) $(OBJDIR)/$(SONAME) + +$(OBJDIR)/$(SONAME): $(OBJDIR)/$(SONAME_FULL) + $(LN) -sf $(SONAME_FULL) $(OBJDIR)/$(SONAME) + +$(OBJDIR)/$(SONAME_FULL): $(OBJECTS) + $(CC) -o $(OBJDIR)/$(SONAME_FULL) $(OBJECTS) $(LD_SHARED_FLAGS) $(LDFLAGS) $(SSL_LIBS) $(FETCH_LIBS) + +$(OBJDIR): + @$(MKDIR) -p $(OBJDIR) + +# Compile rules +$(OBJDIR)/ucl_util.o: $(SRCDIR)/ucl_util.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_util.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_util.c +$(OBJDIR)/ucl_parser.o: $(SRCDIR)/ucl_parser.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_parser.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_parser.c +$(OBJDIR)/ucl_emitter.o: $(SRCDIR)/ucl_emitter.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_emitter.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter.c +$(OBJDIR)/ucl_hash.o: $(SRCDIR)/ucl_hash.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_hash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_hash.c +$(OBJDIR)/xxhash.o: $(SRCDIR)/xxhash.c $(HDEPS) + $(CC) -o $(OBJDIR)/xxhash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/xxhash.c + +clean: + $(RM) $(OBJDIR)/*.o $(OBJDIR)/$(SONAME_FULL) $(OBJDIR)/$(SONAME) $(OBJDIR)/chargen $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/objdump $(OBJDIR)/test_generate + $(RMDIR) $(OBJDIR) + +# Utils + +chargen: utils/chargen.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/chargen $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/chargen.c +objdump: utils/objdump.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/objdump $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/objdump.c $(LD_UCL_FLAGS) + +# Tests + +test: $(OBJDIR) $(OBJDIR)/$(SONAME) $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate + +run-test: test + TEST_DIR=$(TESTDIR) $(TESTDIR)/run_tests.sh $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate + +$(OBJDIR)/test_basic: $(TESTDIR)/test_basic.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/test_basic $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_basic.c $(LD_UCL_FLAGS) +$(OBJDIR)/test_speed: $(TESTDIR)/test_speed.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/test_speed $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_speed.c $(LD_UCL_FLAGS) $(LD_ADD) +$(OBJDIR)/test_generate: $(TESTDIR)/test_generate.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/test_generate $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_generate.c $(LD_UCL_FLAGS) $(LD_ADD) + +install: $(OBJDIR)/$(SONAME) + $(INSTALL) -m0755 $(SONAME) $(DESTDIR)/lib/$(SONAME) + $(INSTALL) -m0644 include/ucl.h $(DESTDIR)/include/ucl.h + +.PHONY: clean $(OBJDIR) Copied: head/contrib/libucl/README.md (from r262396, vendor/libucl/dist/README.md) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libucl/README.md Sun Feb 23 21:49:21 2014 (r262398, copy of r262396, vendor/libucl/dist/README.md) @@ -0,0 +1,300 @@ +## Introduction + +This document describes the main features and principles of the configuration +language called `UCL` - universal configuration language. + +If you are looking for the libucl API documentation you can find it at [this page](doc/api.md). + +## Basic structure + +UCL is heavily infused by `nginx` configuration as the example of a convenient configuration +system. However, UCL is fully compatible with `JSON` format and is able to parse json files. +For example, you can write the same configuration in the following ways: + +* in nginx like: + +```nginx +param = value; +section { + param = value; + param1 = value1; + flag = true; + number = 10k; + time = 0.2s; + string = "something"; + subsection { + host = { + host = "hostname"; + port = 900; + } + host = { + host = "hostname"; + port = 901; + } + } +} +``` + +* or in JSON: + +```json +{ + "param": "value", + "param1": "value1", + "flag": true, + "subsection": { + "host": [ + { + "host": "hostname", + "port": 900 + }, + { + "host": "hostname", + "port": 901 + } + ] + } +} +``` + +## Improvements to the json notation. + +There are various things that make ucl configuration more convenient for editing than strict json: + +### General syntax sugar + +* Braces are not necessary to enclose a top object: it is automatically treated as an object: + +```json +"key": "value" +``` +is equal to: +```json +{"key": "value"} +``` + +* There is no requirement of quotes for strings and keys, moreover, `:` may be replaced `=` or even be skipped for objects: + +```nginx +key = value; +section { + key = value; +} +``` +is equal to: +```json +{ + "key": "value", + "section": { + "key": "value" + } +} +``` + +* No commas mess: you can safely place a comma or semicolon for the last element in an array or an object: + +```json +{ + "key1": "value", + "key2": "value", +} +``` +### Automatic arrays creation + +* Non-unique keys in an object are allowed and are automatically converted to the arrays internally: + +```json +{ + "key": "value1", + "key": "value2" +} +``` +is converted to: +```json +{ + "key": ["value1", "value2"] +} +``` + +### Named keys hierarchy + +UCL accepts named keys and organize them into objects hierarchy internally. Here is an example of this process: +```nginx +section "blah" { + key = value; +} +section foo { + key = value; +} +``` + +is converted to the following object: + +```nginx +section { + blah { + key = value; + } + foo { + key = value; + } +} +``` + +Plain definitions may be more complex and contain more than a single level of nested objects: + +```nginx +section "blah" "foo" { + key = value; +} +``` + +is presented as: + +```nginx +section { + blah { + foo { + key = value; + } + } +} +``` + +### Convenient numbers and booleans + +* Numbers can have suffixes to specify standard multipliers: + + `[kKmMgG]` - standard 10 base multipliers (so `1k` is translated to 1000) + + `[kKmMgG]b` - 2 power multipliers (so `1kb` is translated to 1024) + + `[s|min|d|w|y]` - time multipliers, all time values are translated to float number of seconds, for example `10min` is translated to 600.0 and `10ms` is translated to 0.01 +* Hexadecimal integers can be used by `0x` prefix, for example `key = 0xff`. However, floating point values can use decimal base only. +* Booleans can be specified as `true` or `yes` or `on` and `false` or `no` or `off`. +* It is still possible to treat numbers and booleans as strings by enclosing them in double quotes. + +## General improvements + +### Commments + +UCL supports different style of comments: + +* single line: `#` +* multiline: `/* ... */` + +Multiline comments may be nested: +```c +# Sample single line comment +/* + some comment + /* nested comment */ + end of comment +*/ +``` + +### Macros support + +UCL supports external macros both multiline and single line ones: +```nginx +.macro "sometext"; +.macro { + Some long text + .... +}; +``` +There are two internal macros provided by UCL: + +* `include` - read a file `/path/to/file` or an url `http://example.com/file` and include it to the current place of +UCL configuration; +* `try\_include` - try to read a file or url and include it but do not create a fatal error if a file or url is not accessible; +* `includes` - read a file or an url like the previous macro, but fetch and check the signature file (which is obtained +by `.sig` suffix appending). + +Public keys which are used for the last command are specified by the concrete UCL user. + +### Variables support + +UCL supports variables in input. Variables are registered by a user of the UCL parser and can be presented in the following forms: + +* `${VARIABLE}` +* `$VARIABLE` + +UCL currently does not support nested variables. To escape variables one could use double dollar signs: + +* `$${VARIABLE}` is converted to `${VARIABLE}` +* `$$VARIABLE` is converted to `$VARIABLE` + +However, if no valid variables are found in a string, no expansion will be performed (and `$$` thus remains unchanged). This may be a subject +to change in future libucl releases. + +### Multiline strings + +UCL can handle multiline strings as well as single line ones. It uses shell/perl like notation for such objects: +``` +key = <` + +Description +=========== + +Libucl is a parser and `C` API to parse and generate `ucl` objects. Libucl consist of several groups of functions: + +### Parser functions +Used to parse `ucl` files and provide interface to extract `ucl` object + +### Emitting functions +Convert `ucl` objects to some textual or binary representation. + +### Conversion functions +Help to convert `ucl` objects to C types + +### Generation functions +Allow creating of `ucl` objects from C types + +### Iteration functions +Iterate over `ucl` objects + +### Utility functions +Provide basic utilities to manage `ucl` objects + +# Parser functions + +Parser functions operates with `struct ucl_parser`. + +### ucl_parser_new + +~~~C +struct ucl_parser* ucl_parser_new (int flags); +~~~ + +Creates new parser with the specified flags: + +- `UCL_PARSER_KEY_LOWERCASE` - lowercase keys parsed +- `UCL_PARSER_ZEROCOPY` - try to use zero-copy mode when reading files (in zero-copy mode text chunk being parsed without copying strings so it should exist till any object parsed is used) + +### ucl_parser_register_macro + +~~~C +void ucl_parser_register_macro (struct ucl_parser *parser, + const char *macro, ucl_macro_handler handler, void* ud); +~~~ + +Register new macro with name .`macro` parsed by handler `handler` that accepts opaque data pointer `ud`. Macro handler should be of the following type: + +~~~C +bool (*ucl_macro_handler) (const unsigned char *data, + size_t len, void* ud);` +~~~ + +Handler function accepts macro text `data` of length `len` and the opaque pointer `ud`. If macro is parsed successfully the handler should return `true`. `false` indicates parsing failure and the parser can be terminated. + +### ucl_parser_register_variable + +~~~C +void ucl_parser_register_variable (struct ucl_parser *parser, + const char *var, const char *value); +~~~ + +Register new variable $`var` that should be replaced by the parser to the `value` string. + +### ucl_parser_add_chunk + +~~~C +bool ucl_parser_add_chunk (struct ucl_parser *parser, + const unsigned char *data, size_t len); +~~~ + +Add new text chunk with `data` of length `len` to the parser. At the moment, `libucl` parser is not a streamlined parser and chunk *must* contain the *valid* ucl object. For example, this object should be valid: + +~~~json +{ "var": "value" } +~~~ + +while this one won't be parsed correctly: + +~~~json +{ "var": +~~~ + +This limitation may possible be removed in future. + +### ucl_parser_add_file + +~~~C +bool ucl_parser_add_file (struct ucl_parser *parser, + const char *filename); +~~~ + +Load file `filename` and parse it with the specified `parser`. This function uses `mmap` call to load file, therefore, it should not be `shrinked` during parsing. Otherwise, `libucl` can cause memory corruption and terminate the calling application. This function is also used by the internal handler of `include` macro, hence, this macro has the same limitation. + +### ucl_parser_get_object + +~~~C +ucl_object_t* ucl_parser_get_object (struct ucl_parser *parser); +~~~ + +If the `ucl` data has been parsed correctly this function returns the top object for the parser. Otherwise, this function returns the `NULL` pointer. The reference count for `ucl` object returned is increased by one, therefore, a caller should decrease reference by using `ucl_object_unref` to free object after usage. + +### ucl_parser_get_error + +~~~C +const char *ucl_parser_get_error(struct ucl_parser *parser); +~~~ + +Returns the constant error string for the parser object. If no error occurred during parsing a `NULL` object is returned. A caller should not try to free or modify this string. + +### ucl_parser_free + +~~~C +void ucl_parser_free (struct ucl_parser *parser); +~~~ + +Frees memory occupied by the parser object. The reference count for top object is decreased as well, however if the function `ucl_parser_get_object` was called previously then the top object won't be freed. + +### ucl_pubkey_add + +~~~C +bool ucl_pubkey_add (struct ucl_parser *parser, + const unsigned char *key, size_t len); +~~~ + +This function adds a public key from text blob `key` of length `len` to the `parser` object. This public key should be in the `PEM` format and can be used by `.includes` macro for checking signatures of files included. `Openssl` support should be enabled to make this function working. If a key cannot be added (e.g. due to format error) or `openssl` was not linked to `libucl` then this function returns `false`. + +### ucl_parser_set_filevars + +~~~C +bool ucl_parser_set_filevars (struct ucl_parser *parser, + const char *filename, bool need_expand); +~~~ + +Add the standard file variables to the `parser` based on the `filename` specified: + +- `$FILENAME` - a filename of `ucl` input +- `$CURDIR` - a current directory of the input + +For example, if a `filename` param is `../something.conf` then the variables will have the following values: + +- `$FILENAME` - "../something.conf" +- `$CURDIR` - ".." + +if `need_expand` parameter is `true` then all relative paths are expanded using `realpath` call. In this example if `..` is `/etc/dir` then variables will have these values: + +- `$FILENAME` - "/etc/something.conf" +- `$CURDIR` - "/etc" + +## Parser usage example + +The following example loads, parses and extracts `ucl` object from stdin using `libucl` parser functions (the length of input is limited to 8K): + +~~~C +char inbuf[8192]; +struct ucl_parser *parser = NULL; +int ret = 0, r = 0; +ucl_object_t *obj = NULL; +FILE *in; + +in = stdin; +parser = ucl_parser_new (0); +while (!feof (in) && r < (int)sizeof (inbuf)) { + r += fread (inbuf + r, 1, sizeof (inbuf) - r, in); +} +ucl_parser_add_chunk (parser, inbuf, r); +fclose (in); + +if (ucl_parser_get_error (parser)) { + printf ("Error occured: %s\n", ucl_parser_get_error (parser)); + ret = 1; +} +else { + obj = ucl_parser_get_object (parser); +} + +if (parser != NULL) { + ucl_parser_free (parser); +} +if (obj != NULL) { + ucl_object_unref (obj); +} +return ret; +~~~ + +# Emitting functions + +Libucl can transform UCL objects to a number of tectual formats: + +- configuration (`UCL_EMIT_CONFIG`) - nginx like human readable configuration file where implicit arrays are transformed to the duplicate keys +- compact json: `UCL_EMIT_JSON_COMPACT` - single line valid json without spaces +- formatted json: `UCL_EMIT_JSON` - pretty formatted JSON with newlines and spaces +- compact yaml: `UCL_EMIT_YAML` - compact YAML output + +Moreover, libucl API allows to select a custom set of emitting functions allowing +efficent and zero-copy output of libucl objects. Libucl uses the following structure to support this feature: + +~~~C +struct ucl_emitter_functions { + /** Append a single character */ + int (*ucl_emitter_append_character) (unsigned char c, size_t nchars, void *ud); + /** Append a string of a specified length */ + int (*ucl_emitter_append_len) (unsigned const char *str, size_t len, void *ud); + /** Append a 64 bit integer */ + int (*ucl_emitter_append_int) (int64_t elt, void *ud); + /** Append floating point element */ + int (*ucl_emitter_append_double) (double elt, void *ud); + /** Opaque userdata pointer */ + void *ud; +}; +~~~ + +This structure defines the following callbacks: + +- `ucl_emitter_append_character` - a function that is called to append `nchars` characters equal to `c` +- `ucl_emitter_append_len` - used to append a string of length `len` starting from pointer `str` +- `ucl_emitter_append_int` - this function applies to integer numbers +- `ucl_emitter_append_double` - this function is intended to output floating point variable + +The set of these functions could be used to output text formats of `UCL` objects to different structures or streams. + +Libucl provides the following functions for emitting UCL objects: + +### ucl_object_emit + +~~~C +unsigned char *ucl_object_emit (ucl_object_t *obj, enum ucl_emitter emit_type); +~~~ + +Allocate a string that is suitable to fit the underlying UCL object `obj` and fill it with the textual representation of the object `obj` according to style `emit_type`. The caller should free the returned string after using. + +### ucl_object_emit_full + +~~~C +bool ucl_object_emit_full (ucl_object_t *obj, enum ucl_emitter emit_type, + struct ucl_emitter_functions *emitter); +~~~ + +This function is similar to the previous with the exception that it accepts the additional argument `emitter` that defines the concrete set of output functions. This emit function could be useful for custom structures or streams emitters (including C++ ones, for example). + +# Conversion functions + +Conversion functions are used to convert UCL objects to primitive types, such as strings, numbers or boolean values. There are two types of conversion functions: + +- safe: try to convert an ucl object to a primitive type and fail if such a conversion is not possible +- unsafe: return primitive type without additional checks, if the object cannot be converted then some reasonable default is returned (NULL for strings and 0 for numbers) + +Also there is a single `ucl_object_tostring_forced` function that converts any UCL object (including compound types - arrays and objects) to a string representation. For compound and numeric types this function performs emitting to a compact json format actually. + +Here is a list of all conversion functions: + +- `ucl_object_toint` - returns `int64_t` of UCL object +- `ucl_object_todouble` - returns `double` of UCL object +- `ucl_object_toboolean` - returns `bool` of UCL object +- `ucl_object_tostring` - returns `const char *` of UCL object (this string is NULL terminated) +- `ucl_object_tolstring` - returns `const char *` and `size_t` len of UCL object (string can be not NULL terminated) +- `ucl_object_tostring_forced` - returns string representation of any UCL object + +Strings returned by these pointers are associated with the UCL object and exist over its lifetime. A caller should not free this memory. \ No newline at end of file Copied: head/contrib/libucl/include/ucl.h (from r262396, vendor/libucl/dist/include/ucl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libucl/include/ucl.h Sun Feb 23 21:49:21 2014 (r262398, copy of r262396, vendor/libucl/dist/include/ucl.h) @@ -0,0 +1,1045 @@ +/* Copyright (c) 2013, Vsevolod Stakhov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UCL_H_ +#define UCL_H_ + +#include +#include +#include +#include +#include +#include +#include + +/** + * @mainpage + * This is a reference manual for UCL API. You may find the description of UCL format by following this + * [github repository](https://github.com/vstakhov/libucl). + * + * This manual has several main sections: + * - @ref structures + * - @ref utils + * - @ref parser + * - @ref emitter + */ + +/** + * @file ucl.h + * @brief UCL parsing and emitting functions + * + * UCL is universal configuration language, which is a form of + * JSON with less strict rules that make it more comfortable for + * using as a configuration language + */ +#ifdef __cplusplus +extern "C" { +#endif +/* + * Memory allocation utilities + * UCL_ALLOC(size) - allocate memory for UCL + * UCL_FREE(size, ptr) - free memory of specified size at ptr + * Default: malloc and free + */ +#ifndef UCL_ALLOC +#define UCL_ALLOC(size) malloc(size) +#endif +#ifndef UCL_FREE +#define UCL_FREE(size, ptr) free(ptr) +#endif + +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +#define UCL_WARN_UNUSED_RESULT \ + __attribute__((warn_unused_result)) +#else +#define UCL_WARN_UNUSED_RESULT +#endif + +/** + * @defgroup structures Structures and types + * UCL defines several enumeration types used for error reporting or specifying flags and attributes. + * + * @{ + */ + +/** + * The common error codes returned by ucl parser + */ +typedef enum ucl_error { + UCL_EOK = 0, /**< No error */ + UCL_ESYNTAX, /**< Syntax error occurred during parsing */ + UCL_EIO, /**< IO error occurred during parsing */ + UCL_ESTATE, /**< Invalid state machine state */ + UCL_ENESTED, /**< Input has too many recursion levels */ + UCL_EMACRO, /**< Error processing a macro */ + UCL_EINTERNAL, /**< Internal unclassified error */ + UCL_ESSL /**< SSL error */ +} ucl_error_t; + +/** + * #ucl_object_t may have one of specified types, some types are compatible with each other and some are not. + * For example, you can always convert #UCL_TIME to #UCL_FLOAT. Also you can convert #UCL_FLOAT to #UCL_INTEGER + * by loosing floating point. Every object may be converted to a string by #ucl_object_tostring_forced() function. + * + */ +typedef enum ucl_type { + UCL_OBJECT = 0, /**< UCL object - key/value pairs */ + UCL_ARRAY, /**< UCL array */ + UCL_INT, /**< Integer number */ + UCL_FLOAT, /**< Floating point number */ + UCL_STRING, /**< Null terminated string */ + UCL_BOOLEAN, /**< Boolean value */ + UCL_TIME, /**< Time value (floating point number of seconds) */ + UCL_USERDATA, /**< Opaque userdata pointer (may be used in macros) */ + UCL_NULL /**< Null value */ +} ucl_type_t; + +/** + * You can use one of these types to serialise #ucl_object_t by using ucl_object_emit(). + */ +typedef enum ucl_emitter { + UCL_EMIT_JSON = 0, /**< Emit fine formatted JSON */ + UCL_EMIT_JSON_COMPACT, /**< Emit compacted JSON */ + UCL_EMIT_CONFIG, /**< Emit human readable config format */ + UCL_EMIT_YAML /**< Emit embedded YAML format */ +} ucl_emitter_t; + +/** + * These flags defines parser behaviour. If you specify #UCL_PARSER_ZEROCOPY you must ensure + * that the input memory is not freed if an object is in use. Moreover, if you want to use + * zero-terminated keys and string values then you should not use zero-copy mode, as in this case + * UCL still has to perform copying implicitly. + */ +typedef enum ucl_parser_flags { + UCL_PARSER_KEY_LOWERCASE = 0x1, /**< Convert all keys to lower case */ + UCL_PARSER_ZEROCOPY = 0x2 /**< Parse input in zero-copy mode if possible */ +} ucl_parser_flags_t; + +/** + * String conversion flags, that are used in #ucl_object_fromstring_common function. + */ +typedef enum ucl_string_flags { + UCL_STRING_ESCAPE = 0x1, /**< Perform JSON escape */ + UCL_STRING_TRIM = 0x2, /**< Trim leading and trailing whitespaces */ + UCL_STRING_PARSE_BOOLEAN = 0x4, /**< Parse passed string and detect boolean */ + UCL_STRING_PARSE_INT = 0x8, /**< Parse passed string and detect integer number */ + UCL_STRING_PARSE_DOUBLE = 0x10, /**< Parse passed string and detect integer or float number */ + UCL_STRING_PARSE_NUMBER = UCL_STRING_PARSE_INT|UCL_STRING_PARSE_DOUBLE , /**< + Parse passed string and detect number */ + UCL_STRING_PARSE = UCL_STRING_PARSE_BOOLEAN|UCL_STRING_PARSE_NUMBER, /**< + Parse passed string (and detect booleans and numbers) */ + UCL_STRING_PARSE_BYTES = 0x20 /**< Treat numbers as bytes */ +} ucl_string_flags_t; + +/** + * Basic flags for an object + */ +typedef enum ucl_object_flags { + UCL_OBJECT_ALLOCATED_KEY = 1, /**< An object has key allocated internally */ + UCL_OBJECT_ALLOCATED_VALUE = 2, /**< An object has a string value allocated internally */ + UCL_OBJECT_NEED_KEY_ESCAPE = 4 /**< The key of an object need to be escaped on output */ +} ucl_object_flags_t; + +/** + * UCL object structure. Please mention that the most of fields should not be touched by + * UCL users. In future, this structure may be converted to private one. + */ +typedef struct ucl_object_s { + /** + * Variant value type + */ + union { + int64_t iv; /**< Int value of an object */ + const char *sv; /**< String value of an object */ + double dv; /**< Double value of an object */ + struct ucl_object_s *av; /**< Array */ + void *ov; /**< Object */ + void* ud; /**< Opaque user data */ + } value; + const char *key; /**< Key of an object */ + struct ucl_object_s *next; /**< Array handle */ + struct ucl_object_s *prev; /**< Array handle */ + unsigned char* trash_stack[2]; /**< Pointer to allocated chunks */ + unsigned keylen; /**< Lenght of a key */ + unsigned len; /**< Size of an object */ + enum ucl_type type; /**< Real type */ + uint16_t ref; /**< Reference count */ + uint16_t flags; /**< Object flags */ +} ucl_object_t; + +/** @} */ + +/** + * @defgroup utils Utility functions + * A number of utility functions simplify handling of UCL objects + * + * @{ + */ +/** + * Copy and return a key of an object, returned key is zero-terminated + * @param obj CL object + * @return zero terminated key + */ +char* ucl_copy_key_trash (ucl_object_t *obj); + +/** + * Copy and return a string value of an object, returned key is zero-terminated + * @param obj CL object + * @return zero terminated string representation of object value + */ +char* ucl_copy_value_trash (ucl_object_t *obj); + +/** + * Creates a new object + * @return new object + */ +static inline ucl_object_t* ucl_object_new (void) UCL_WARN_UNUSED_RESULT; +static inline ucl_object_t * +ucl_object_new (void) +{ + ucl_object_t *new; + new = malloc (sizeof (ucl_object_t)); + if (new != NULL) { + memset (new, 0, sizeof (ucl_object_t)); + new->ref = 1; + new->type = UCL_NULL; + } + return new; +} + +/** + * Create new object with type specified + * @param type type of a new object + * @return new object + */ +static inline ucl_object_t* ucl_object_typed_new (unsigned int type) UCL_WARN_UNUSED_RESULT; +static inline ucl_object_t * +ucl_object_typed_new (unsigned int type) +{ + ucl_object_t *new; + new = malloc (sizeof (ucl_object_t)); + if (new != NULL) { + memset (new, 0, sizeof (ucl_object_t)); + new->ref = 1; + new->type = (type <= UCL_NULL ? type : UCL_NULL); + } + return new; +} + +/** + * Convert any string to an ucl object making the specified transformations + * @param str fixed size or NULL terminated string + * @param len length (if len is zero, than str is treated as NULL terminated) + * @param flags conversion flags + * @return new object + */ +ucl_object_t * ucl_object_fromstring_common (const char *str, size_t len, + enum ucl_string_flags flags) UCL_WARN_UNUSED_RESULT; + +/** + * Create a UCL object from the specified string + * @param str NULL terminated string, will be json escaped + * @return new object + */ +static inline ucl_object_t * +ucl_object_fromstring (const char *str) +{ + return ucl_object_fromstring_common (str, 0, UCL_STRING_ESCAPE); +} + +/** + * Create a UCL object from the specified string + * @param str fixed size string, will be json escaped + * @param len length of a string + * @return new object + */ +static inline ucl_object_t * +ucl_object_fromlstring (const char *str, size_t len) +{ + return ucl_object_fromstring_common (str, len, UCL_STRING_ESCAPE); +} + +/** + * Create an object from an integer number + * @param iv number + * @return new object + */ +static inline ucl_object_t * +ucl_object_fromint (int64_t iv) +{ + ucl_object_t *obj; + + obj = ucl_object_new (); + if (obj != NULL) { + obj->type = UCL_INT; + obj->value.iv = iv; + } + + return obj; +} + +/** + * Create an object from a float number + * @param dv number + * @return new object + */ +static inline ucl_object_t * +ucl_object_fromdouble (double dv) +{ + ucl_object_t *obj; + + obj = ucl_object_new (); + if (obj != NULL) { + obj->type = UCL_FLOAT; + obj->value.dv = dv; + } + + return obj; +} + +/** + * Create an object from a boolean + * @param bv bool value + * @return new object + */ +static inline ucl_object_t * +ucl_object_frombool (bool bv) +{ + ucl_object_t *obj; + + obj = ucl_object_new (); + if (obj != NULL) { + obj->type = UCL_BOOLEAN; + obj->value.iv = bv; + } + + return obj; +} + +/** *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 21:50:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9533650; Sun, 23 Feb 2014 21:50:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 88690190B; Sun, 23 Feb 2014 21:50:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NLoBdq047236; Sun, 23 Feb 2014 21:50:11 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NLoBED047235; Sun, 23 Feb 2014 21:50:11 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402232150.s1NLoBED047235@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 23 Feb 2014 21:50:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262399 - head/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 21:50:11 -0000 Author: bapt Date: Sun Feb 23 21:50:11 2014 New Revision: 262399 URL: http://svnweb.freebsd.org/changeset/base/262399 Log: Branch libucl to the build Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sun Feb 23 21:49:21 2014 (r262398) +++ head/lib/Makefile Sun Feb 23 21:50:11 2014 (r262399) @@ -119,6 +119,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libtelnet} \ ${_libthr} \ libthread_db \ + libucl \ libufs \ libugidfw \ libulog \ From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 21:55:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA2907D6; Sun, 23 Feb 2014 21:55:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 99DB61999; Sun, 23 Feb 2014 21:55:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NLt8nt050531; Sun, 23 Feb 2014 21:55:08 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NLt8ED050528; Sun, 23 Feb 2014 21:55:08 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402232155.s1NLt8ED050528@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 23 Feb 2014 21:55:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262400 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 21:55:08 -0000 Author: bapt Date: Sun Feb 23 21:55:07 2014 New Revision: 262400 URL: http://svnweb.freebsd.org/changeset/base/262400 Log: Switch pkg(7) from libyaml to libucl Modified: head/usr.sbin/pkg/Makefile head/usr.sbin/pkg/config.c head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/Makefile ============================================================================== --- head/usr.sbin/pkg/Makefile Sun Feb 23 21:50:11 2014 (r262399) +++ head/usr.sbin/pkg/Makefile Sun Feb 23 21:55:07 2014 (r262400) @@ -4,11 +4,11 @@ PROG= pkg SRCS= pkg.c dns_utils.c config.c MAN= pkg.7 -CFLAGS+=-I${.CURDIR}/../../contrib/libyaml/include -.PATH: ${.CURDIR}/../../contrib/libyaml/include -DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBYAML} ${LIBSBUF} ${LIBSSL} \ +CFLAGS+=-I${.CURDIR}/../../contrib/libucl/include +.PATH: ${.CURDIR}/../../contrib/libucl/include +DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBUCL} ${LIBSBUF} ${LIBSSL} \ ${LIBCRYPTO} -LDADD= -larchive -lelf -lfetch -lyaml -lsbuf -lssl -lcrypto -USEPRIVATELIB= yaml +LDADD= -larchive -lelf -lfetch -lucl -lsbuf -lssl -lcrypto +USEPRIVATELIB= ucl .include Modified: head/usr.sbin/pkg/config.c ============================================================================== --- head/usr.sbin/pkg/config.c Sun Feb 23 21:50:11 2014 (r262399) +++ head/usr.sbin/pkg/config.c Sun Feb 23 21:55:07 2014 (r262400) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include @@ -509,76 +509,45 @@ boolstr_to_bool(const char *str) } static void -config_parse(yaml_document_t *doc, yaml_node_t *node, pkg_conf_file_t conftype) +config_parse(ucl_object_t *obj, pkg_conf_file_t conftype) { - yaml_node_item_t *item; - yaml_node_pair_t *pair; - yaml_node_t *key, *val, *item_val; struct sbuf *buf = sbuf_new_auto(); + ucl_object_t *cur, *seq; + ucl_object_iter_t it = NULL, itseq = NULL; struct config_entry *temp_config; struct config_value *cv; + const char *key; int i; size_t j; - pair = node->data.mapping.pairs.start; - /* Temporary config for configs that may be disabled. */ temp_config = calloc(CONFIG_SIZE, sizeof(struct config_entry)); - while (pair < node->data.mapping.pairs.top) { - key = yaml_document_get_node(doc, pair->key); - val = yaml_document_get_node(doc, pair->value); - - /* - * ignoring silently empty keys can be empty lines - * or user mistakes - */ - if (key->data.scalar.length <= 0) { - ++pair; - continue; - } - - /* - * silently skip on purpose to allow user to leave - * empty lines without complaining - */ - if (val->type == YAML_NO_NODE || - (val->type == YAML_SCALAR_NODE && - val->data.scalar.length <= 0)) { - ++pair; + while ((cur = ucl_iterate_object(obj, &it, true))) { + key = ucl_object_key(cur); + if (key == NULL) continue; - } - sbuf_clear(buf); if (conftype == CONFFILE_PKG) { - for (j = 0; j < strlen(key->data.scalar.value); ++j) - sbuf_putc(buf, - toupper(key->data.scalar.value[j])); + for (j = 0; j < strlen(key); ++j) + sbuf_putc(buf, key[j]); sbuf_finish(buf); } else if (conftype == CONFFILE_REPO) { - /* The CONFFILE_REPO type is more restrictive. Only - parse known elements. */ - if (strcasecmp(key->data.scalar.value, "url") == 0) + if (strcasecmp(key, "url") == 0) sbuf_cpy(buf, "PACKAGESITE"); - else if (strcasecmp(key->data.scalar.value, - "mirror_type") == 0) + else if (strcasecmp(key, "mirror_type") == 0) sbuf_cpy(buf, "MIRROR_TYPE"); - else if (strcasecmp(key->data.scalar.value, - "signature_type") == 0) + else if (strcasecmp(key, "signature_type") == 0) sbuf_cpy(buf, "SIGNATURE_TYPE"); - else if (strcasecmp(key->data.scalar.value, - "fingerprints") == 0) + else if (strcasecmp(key, "fingerprints") == 0) sbuf_cpy(buf, "FINGERPRINTS"); - else if (strcasecmp(key->data.scalar.value, - "enabled") == 0) { - /* Skip disabled repos. */ - if (!boolstr_to_bool(val->data.scalar.value)) + else if (strcasecmp(key, "enabled") == 0) { + if ((cur->type != UCL_BOOLEAN) || + !ucl_object_toboolean(cur)) goto cleanup; - } else { /* Skip unknown entries for future use. */ - ++pair; + } else continue; - } sbuf_finish(buf); } @@ -588,51 +557,40 @@ config_parse(yaml_document_t *doc, yaml_ } /* Silently skip unknown keys to be future compatible. */ - if (i == CONFIG_SIZE) { - ++pair; + if (i == CONFIG_SIZE) continue; - } /* env has priority over config file */ - if (c[i].envset) { - ++pair; + if (c[i].envset) continue; - } /* Parse sequence value ["item1", "item2"] */ switch (c[i].type) { case PKG_CONFIG_LIST: - if (val->type != YAML_SEQUENCE_NODE) { - fprintf(stderr, "Skipping invalid array " + if (cur->type != UCL_ARRAY) { + warnx("Skipping invalid array " "value for %s.\n", c[i].key); - ++pair; continue; } - item = val->data.sequence.items.start; temp_config[i].list = malloc(sizeof(*temp_config[i].list)); STAILQ_INIT(temp_config[i].list); - while (item < val->data.sequence.items.top) { - item_val = yaml_document_get_node(doc, *item); - if (item_val->type != YAML_SCALAR_NODE) { - ++item; + while ((seq = ucl_iterate_object(cur, &itseq, true))) { + if (seq->type != UCL_STRING) continue; - } cv = malloc(sizeof(struct config_value)); cv->value = - strdup(item_val->data.scalar.value); + strdup(ucl_object_tostring(seq)); STAILQ_INSERT_TAIL(temp_config[i].list, cv, next); - ++item; } break; default: /* Normal string value. */ - temp_config[i].value = strdup(val->data.scalar.value); + temp_config[i].value = strdup(ucl_object_tostring(cur)); break; } - ++pair; } /* Repo is enabled, copy over all settings from temp_config. */ @@ -662,27 +620,22 @@ cleanup: * etc... */ static void -parse_repo_file(yaml_document_t *doc, yaml_node_t *node) +parse_repo_file(ucl_object_t *obj) { - yaml_node_pair_t *pair; + ucl_object_iter_t it = NULL; + ucl_object_t *cur; + const char *key; - pair = node->data.mapping.pairs.start; - while (pair < node->data.mapping.pairs.top) { - yaml_node_t *key = yaml_document_get_node(doc, pair->key); - yaml_node_t *val = yaml_document_get_node(doc, pair->value); + while ((cur = ucl_iterate_object(obj, &it, true))) { + key = ucl_object_key(cur); - if (key->data.scalar.length <= 0) { - ++pair; + if (key == NULL) continue; - } - if (val->type != YAML_MAPPING_NODE) { - ++pair; + if (cur->type != UCL_OBJECT) continue; - } - config_parse(doc, val, CONFFILE_REPO); - ++pair; + config_parse(cur, CONFFILE_REPO); } } @@ -690,37 +643,33 @@ parse_repo_file(yaml_document_t *doc, ya static int read_conf_file(const char *confpath, pkg_conf_file_t conftype) { - FILE *fp; - yaml_parser_t parser; - yaml_document_t doc; - yaml_node_t *node; + struct ucl_parser *p; + ucl_object_t *obj = NULL; - if ((fp = fopen(confpath, "r")) == NULL) { + p = ucl_parser_new(0); + + if (!ucl_parser_add_file(p, confpath)) { if (errno != ENOENT) - err(EXIT_FAILURE, "Unable to open configuration " - "file %s", confpath); + errx(EXIT_FAILURE, "Unable to parse configuration " + "file %s: %s", confpath, ucl_parser_get_error(p)); + ucl_parser_free(p); /* no configuration present */ return (1); } - yaml_parser_initialize(&parser); - yaml_parser_set_input_file(&parser, fp); - yaml_parser_load(&parser, &doc); - - node = yaml_document_get_root_node(&doc); - - if (node == NULL || node->type != YAML_MAPPING_NODE) + obj = ucl_parser_get_object(p); + if (obj->type != UCL_OBJECT) warnx("Invalid configuration format, ignoring the " "configuration file %s", confpath); else { if (conftype == CONFFILE_PKG) - config_parse(&doc, node, conftype); + config_parse(obj, conftype); else if (conftype == CONFFILE_REPO) - parse_repo_file(&doc, node); + parse_repo_file(obj); } - yaml_document_delete(&doc); - yaml_parser_delete(&parser); + ucl_object_free(obj); + ucl_parser_free(p); return (0); } Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Sun Feb 23 21:50:11 2014 (r262399) +++ head/usr.sbin/pkg/pkg.c Sun Feb 23 21:55:07 2014 (r262400) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include @@ -268,38 +268,28 @@ cleanup: } static struct fingerprint * -parse_fingerprint(yaml_document_t *doc, yaml_node_t *node) +parse_fingerprint(ucl_object_t *obj) { - yaml_node_pair_t *pair; - yaml_char_t *function, *fp; + ucl_object_t *cur; + ucl_object_iter_t it = NULL; + const char *function, *fp, *key; struct fingerprint *f; hash_t fct = HASH_UNKNOWN; function = fp = NULL; - pair = node->data.mapping.pairs.start; - while (pair < node->data.mapping.pairs.top) { - yaml_node_t *key = yaml_document_get_node(doc, pair->key); - yaml_node_t *val = yaml_document_get_node(doc, pair->value); - - if (key->data.scalar.length <= 0) { - ++pair; + while ((cur = ucl_iterate_object(obj, &it, true))) { + key = ucl_object_key(cur); + if (cur->type != UCL_STRING) + continue; + if (strcasecmp(key, "function") == 0) { + function = ucl_object_tostring(cur); continue; } - - if (val->type != YAML_SCALAR_NODE) { - ++pair; + if (strcasecmp(key, "fingerprint") == 0) { + fp = ucl_object_tostring(cur); continue; } - - if (strcasecmp(key->data.scalar.value, "function") == 0) - function = val->data.scalar.value; - else if (strcasecmp(key->data.scalar.value, "fingerprint") - == 0) - fp = val->data.scalar.value; - - ++pair; - continue; } if (fp == NULL || function == NULL) @@ -309,7 +299,7 @@ parse_fingerprint(yaml_document_t *doc, fct = HASH_SHA256; if (fct == HASH_UNKNOWN) { - fprintf(stderr, "Unsupported hashing function: %s\n", function); + warnx("Unsupported hashing function: %s\n", function); return (NULL); } @@ -335,10 +325,8 @@ free_fingerprint_list(struct fingerprint static struct fingerprint * load_fingerprint(const char *dir, const char *filename) { - yaml_parser_t parser; - yaml_document_t doc; - yaml_node_t *node; - FILE *fp; + ucl_object_t *obj = NULL; + struct ucl_parser *p = NULL; struct fingerprint *f; char path[MAXPATHLEN]; @@ -346,24 +334,23 @@ load_fingerprint(const char *dir, const snprintf(path, MAXPATHLEN, "%s/%s", dir, filename); - if ((fp = fopen(path, "r")) == NULL) + p = ucl_parser_new(0); + if (!ucl_parser_add_file(p, path)) { + warnx("%s: %s", path, ucl_parser_get_error(p)); + ucl_parser_free(p); return (NULL); + } - yaml_parser_initialize(&parser); - yaml_parser_set_input_file(&parser, fp); - yaml_parser_load(&parser, &doc); - - node = yaml_document_get_root_node(&doc); - if (node == NULL || node->type != YAML_MAPPING_NODE) - goto out; - - f = parse_fingerprint(&doc, node); - f->name = strdup(filename); - -out: - yaml_document_delete(&doc); - yaml_parser_delete(&parser); - fclose(fp); + obj = ucl_parser_get_object(p); + + if (obj->type == UCL_OBJECT) + f = parse_fingerprint(obj); + + if (f != NULL) + f->name = strdup(filename); + + ucl_object_free(obj); + ucl_parser_free(p); return (f); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 22:04:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 826769E2; Sun, 23 Feb 2014 22:04:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6B59E1A5F; Sun, 23 Feb 2014 22:04:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NM44dB054507; Sun, 23 Feb 2014 22:04:04 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NM44vQ054503; Sun, 23 Feb 2014 22:04:04 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402232204.s1NM44vQ054503@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 23 Feb 2014 22:04:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262401 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 22:04:04 -0000 Author: bapt Date: Sun Feb 23 22:04:03 2014 New Revision: 262401 URL: http://svnweb.freebsd.org/changeset/base/262401 Log: Update my copyright Modified: head/usr.sbin/pkg/config.c head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/config.c ============================================================================== --- head/usr.sbin/pkg/config.c Sun Feb 23 21:55:07 2014 (r262400) +++ head/usr.sbin/pkg/config.c Sun Feb 23 22:04:03 2014 (r262401) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Baptiste Daroussin + * Copyright (c) 2014 Baptiste Daroussin * Copyright (c) 2013 Bryan Drewery * All rights reserved. * Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Sun Feb 23 21:55:07 2014 (r262400) +++ head/usr.sbin/pkg/pkg.c Sun Feb 23 22:04:03 2014 (r262401) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2013 Baptiste Daroussin + * Copyright (c) 2012-2014 Baptiste Daroussin * Copyright (c) 2013 Bryan Drewery * All rights reserved. * From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 22:10:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 942A0DF9; Sun, 23 Feb 2014 22:10:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 62B4E1A9A; Sun, 23 Feb 2014 22:10:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NMAQDL055685; Sun, 23 Feb 2014 22:10:26 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NMAQun055683; Sun, 23 Feb 2014 22:10:26 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201402232210.s1NMAQun055683@svn.freebsd.org> From: Robert Watson Date: Sun, 23 Feb 2014 22:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262402 - in head/sys/boot/ficl: . mips64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 22:10:26 -0000 Author: rwatson Date: Sun Feb 23 22:10:25 2014 New Revision: 262402 URL: http://svnweb.freebsd.org/changeset/base/262402 Log: Give mips64 its own ficl configuration that sizes pointers/etc suitably for a 64-bit architecture, rather than trying to share the 32-bit MIPS ficl configuration. When building ficl on MIPS, don't conflate 32-bit and 64-bit ISAs -- unlike x86, we don't want a 32-bit loader on a 64-bit CPU. Use quite conservative code generation -- e.g., softfloat, no GOT, etc -- suitable for early boot. MFC after: 3 weeks Sponsored by: DARPA, AFRL Added: head/sys/boot/ficl/mips64/ - copied from r262374, head/sys/boot/ficl/mips/ Modified: head/sys/boot/ficl/Makefile head/sys/boot/ficl/mips64/sysdep.h Modified: head/sys/boot/ficl/Makefile ============================================================================== --- head/sys/boot/ficl/Makefile Sun Feb 23 22:04:03 2014 (r262401) +++ head/sys/boot/ficl/Makefile Sun Feb 23 22:10:25 2014 (r262402) @@ -5,6 +5,8 @@ FICLDIR?= ${.CURDIR} .if !defined(FICL64) .PATH: ${FICLDIR}/${MACHINE_CPUARCH:S/amd64/i386/} +.elif ${MACHINE_ARCH} == "mips64" +.PATH: ${FICLDIR}/${MACHINE_ARCH} .else .PATH: ${FICLDIR}/${MACHINE_CPUARCH} .endif @@ -21,12 +23,15 @@ CFLAGS.gcc+= -mpreferred-stack-boundary= .endif CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float .endif -.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" +.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" CFLAGS+= -msoft-float .endif .if ${MACHINE} == "pc98" CFLAGS+= -Os -DPC98 .endif +.if ${MACHINE_CPUARCH} == "mips" +CFLAGS+= -G0 -fno-pic -mno-abicalls +.endif .if HAVE_PNP CFLAGS+= -DHAVE_PNP .endif Modified: head/sys/boot/ficl/mips64/sysdep.h ============================================================================== --- head/sys/boot/ficl/mips/sysdep.h Sun Feb 23 17:37:24 2014 (r262374) +++ head/sys/boot/ficl/mips64/sysdep.h Sun Feb 23 22:10:25 2014 (r262402) @@ -105,11 +105,11 @@ ** (11/2000: same for FICL_FLOAT) */ #if !defined FICL_INT -#define FICL_INT INT32 +#define FICL_INT long #endif #if !defined FICL_UNS -#define FICL_UNS UNS32 +#define FICL_UNS unsigned long #endif #if !defined FICL_FLOAT @@ -120,7 +120,7 @@ ** Ficl presently supports values of 32 and 64 for BITS_PER_CELL */ #if !defined BITS_PER_CELL -#define BITS_PER_CELL 32 +#define BITS_PER_CELL 64 #endif #if ((BITS_PER_CELL != 32) && (BITS_PER_CELL != 64)) @@ -366,7 +366,7 @@ typedef struct ** machine. 3 would be appropriate for a 64 bit machine. */ #if !defined FICL_ALIGN -#define FICL_ALIGN 2 +#define FICL_ALIGN 3 #define FICL_ALIGN_ADD ((1 << FICL_ALIGN) - 1) #endif From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 22:11:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D22CF37; Sun, 23 Feb 2014 22:11:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 185F01B00; Sun, 23 Feb 2014 22:11:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NMBQPu058660; Sun, 23 Feb 2014 22:11:26 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NMBQaI058659; Sun, 23 Feb 2014 22:11:26 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201402232211.s1NMBQaI058659@svn.freebsd.org> From: Robert Watson Date: Sun, 23 Feb 2014 22:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262403 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 22:11:27 -0000 Author: rwatson Date: Sun Feb 23 22:11:26 2014 New Revision: 262403 URL: http://svnweb.freebsd.org/changeset/base/262403 Log: On mips64, built 64-bit ELF support. MFC after: 3 weeks Sponsored by: DARPA, AFRL Modified: head/sys/boot/common/Makefile.inc Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Sun Feb 23 22:10:25 2014 (r262402) +++ head/sys/boot/common/Makefile.inc Sun Feb 23 22:11:26 2014 (r262403) @@ -18,6 +18,8 @@ SRCS+= load_elf32.c reloc_elf32.c SRCS+= load_elf64.c reloc_elf64.c .elif ${MACHINE_CPUARCH} == "sparc64" SRCS+= load_elf64.c reloc_elf64.c +.elif ${MACHINE_ARCH} == "mips64" +SRCS+= load_elf64.c reloc_elf64.c .endif .if defined(LOADER_NET_SUPPORT) From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 22:12:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45F0AF4; Sun, 23 Feb 2014 22:12:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2FCAF1B07; Sun, 23 Feb 2014 22:12:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NMCQh8059537; Sun, 23 Feb 2014 22:12:26 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NMCQKW059536; Sun, 23 Feb 2014 22:12:26 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201402232212.s1NMCQKW059536@svn.freebsd.org> From: Robert Watson Date: Sun, 23 Feb 2014 22:12:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262404 - head/sys/boot/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 22:12:26 -0000 Author: rwatson Date: Sun Feb 23 22:12:25 2014 New Revision: 262404 URL: http://svnweb.freebsd.org/changeset/base/262404 Log: When building FDT on MIPS, use softfloat. MFC after: 3 weeks Sponsored by: DARPA, AFRL Modified: head/sys/boot/fdt/Makefile Modified: head/sys/boot/fdt/Makefile ============================================================================== --- head/sys/boot/fdt/Makefile Sun Feb 23 22:11:26 2014 (r262403) +++ head/sys/boot/fdt/Makefile Sun Feb 23 22:12:25 2014 (r262404) @@ -16,7 +16,7 @@ CFLAGS+= -I${.CURDIR}/../../contrib/libf CFLAGS+= -ffreestanding -.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" +.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" CFLAGS+= -msoft-float .endif From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 22:13:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31C61322; Sun, 23 Feb 2014 22:13:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1E2971B17; Sun, 23 Feb 2014 22:13:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NMDG8E059702; Sun, 23 Feb 2014 22:13:16 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NMDGG0059701; Sun, 23 Feb 2014 22:13:16 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201402232213.s1NMDGG0059701@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 23 Feb 2014 22:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262405 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 22:13:17 -0000 Author: pjd Date: Sun Feb 23 22:13:16 2014 New Revision: 262405 URL: http://svnweb.freebsd.org/changeset/base/262405 Log: Capability rights are held by descriptors, not processes. Reported by: jonathan Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Sun Feb 23 22:12:25 2014 (r262404) +++ head/usr.bin/kdump/kdump.c Sun Feb 23 22:13:16 2014 (r262405) @@ -1877,7 +1877,7 @@ ktrcapfail(struct ktr_cap_fail *ktr) /* operation on fd with insufficient capabilities */ printf("operation requires "); capname(&ktr->cap_needed); - printf(", process holds "); + printf(", descriptor holds "); capname(&ktr->cap_held); break; case CAPFAIL_INCREASE: From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 22:20:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A9197F8; Sun, 23 Feb 2014 22:20:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E9DCA1BFC; Sun, 23 Feb 2014 22:20:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NMKqeI062702; Sun, 23 Feb 2014 22:20:52 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NMKqoO062701; Sun, 23 Feb 2014 22:20:52 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201402232220.s1NMKqoO062701@svn.freebsd.org> From: Robert Watson Date: Sun, 23 Feb 2014 22:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262406 - head/sys/boot/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 22:20:53 -0000 Author: rwatson Date: Sun Feb 23 22:20:52 2014 New Revision: 262406 URL: http://svnweb.freebsd.org/changeset/base/262406 Log: Build the BERI boot loader on 64-bit MIPS (but not 32-bit MIPS). While these binaries aren't immediately useful on other MIPSes, still build them as part of mips64 world in order to expose them to tinderbox. MFC after: 3 weeks Sponsored by: DARPA, AFRL Modified: head/sys/boot/mips/Makefile Modified: head/sys/boot/mips/Makefile ============================================================================== --- head/sys/boot/mips/Makefile Sun Feb 23 22:13:16 2014 (r262405) +++ head/sys/boot/mips/Makefile Sun Feb 23 22:20:52 2014 (r262406) @@ -1,6 +1,11 @@ # $FreeBSD$ -.if 0 +# +# The BERI boot loader port works only on 64-bit MIPS; not a hard port to +# 32-bit if someone is interested. Build on all 64-bit MIPS platforms to +# ensure it gets adequate build-test coverage. +# +.if ${MACHINE_ARCH} == "mips64" SUBDIR= beri .endif From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 22:27:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93F67A69; Sun, 23 Feb 2014 22:27:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7DFF71C34; Sun, 23 Feb 2014 22:27:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NMRFo8064511; Sun, 23 Feb 2014 22:27:15 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NMRECn064508; Sun, 23 Feb 2014 22:27:14 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402232227.s1NMRECn064508@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 23 Feb 2014 22:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262407 - in head: . contrib/libyaml lib lib/libyaml share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 22:27:15 -0000 Author: bapt Date: Sun Feb 23 22:27:14 2014 New Revision: 262407 URL: http://svnweb.freebsd.org/changeset/base/262407 Log: Remove libyaml, it has been replaced by libucl Deleted: head/contrib/libyaml/ head/lib/libyaml/ Modified: head/ObsoleteFiles.inc head/lib/Makefile head/share/mk/bsd.libnames.mk Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Feb 23 22:20:52 2014 (r262406) +++ head/ObsoleteFiles.inc Sun Feb 23 22:27:14 2014 (r262407) @@ -38,6 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20140223: Remove libyaml +OLD_FILES+=usr/lib/private/libyaml.a +OLD_FILES+=usr/lib/private/libyaml.so +OLD_FILES+=usr/lib/private/libyaml.so.1 +OLD_FILES+=usr/lib/private/libyaml_p.a # 20140216: new clang import which bumps version from 3.3 to 3.4. OLD_FILES+=usr/bin/llvm-prof OLD_FILES+=usr/bin/llvm-ranlib Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sun Feb 23 22:20:52 2014 (r262406) +++ head/lib/Makefile Sun Feb 23 22:27:14 2014 (r262407) @@ -130,7 +130,6 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libvmmapi} \ libwrap \ liby \ - libyaml \ libz \ ${_atf} \ ${_clang} \ Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Sun Feb 23 22:20:52 2014 (r262406) +++ head/share/mk/bsd.libnames.mk Sun Feb 23 22:27:14 2014 (r262407) @@ -169,7 +169,6 @@ LIBWIND?= ${DESTDIR}${LIBDIR}/libwind.a LIBWRAP?= ${DESTDIR}${LIBDIR}/libwrap.a LIBXPG4?= ${DESTDIR}${LIBDIR}/libxpg4.a LIBY?= ${DESTDIR}${LIBDIR}/liby.a -LIBYAML?= ${DESTDIR}${LIBPRIVATEDIR}/libyaml.a LIBYPCLNT?= ${DESTDIR}${LIBDIR}/libypclnt.a LIBZ?= ${DESTDIR}${LIBDIR}/libz.a LIBZFS?= ${DESTDIR}${LIBDIR}/libzfs.a From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 22:29:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A23D9BC0; Sun, 23 Feb 2014 22:29:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8D3FE1C43; Sun, 23 Feb 2014 22:29:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NMTxjS064802; Sun, 23 Feb 2014 22:29:59 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NMTxRd064801; Sun, 23 Feb 2014 22:29:59 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402232229.s1NMTxRd064801@svn.freebsd.org> From: Ian Lepore Date: Sun, 23 Feb 2014 22:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262408 - head/sys/arm/ti/twl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 22:29:59 -0000 Author: ian Date: Sun Feb 23 22:29:59 2014 New Revision: 262408 URL: http://svnweb.freebsd.org/changeset/base/262408 Log: Eliminate an unused-var warning by wrapping #if 0 around some tables of values that were probably entered "for completeness" from a datasheet, and for all I know may be useful/necessary some day. Modified: head/sys/arm/ti/twl/twl_vreg.c Modified: head/sys/arm/ti/twl/twl_vreg.c ============================================================================== --- head/sys/arm/ti/twl/twl_vreg.c Sun Feb 23 22:27:14 2014 (r262407) +++ head/sys/arm/ti/twl/twl_vreg.c Sun Feb 23 22:29:59 2014 (r262408) @@ -138,6 +138,7 @@ static const uint16_t twl4030_vsim_volta static const uint16_t twl4030_vdac_voltages[] = { 1200, 1300, 1800, 1800 }; +#if 0 /* vdd1, vdd2, vdio, not currently used. */ static const uint16_t twl4030_vdd1_voltages[] = { 800, 1450 }; @@ -147,6 +148,7 @@ static const uint16_t twl4030_vdd2_volta static const uint16_t twl4030_vio_voltages[] = { 1800, 1850 }; +#endif static const uint16_t twl4030_vintana2_voltages[] = { 2500, 2750 }; From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 22:35:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7626BEAE; Sun, 23 Feb 2014 22:35:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 472B21CE5; Sun, 23 Feb 2014 22:35:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NMZJhi068299; Sun, 23 Feb 2014 22:35:19 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NMZIwk068294; Sun, 23 Feb 2014 22:35:18 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402232235.s1NMZIwk068294@svn.freebsd.org> From: Ian Lepore Date: Sun, 23 Feb 2014 22:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262409 - in head/sys/arm: include mv/armadaxp samsung/exynos ti/omap4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 22:35:19 -0000 Author: ian Date: Sun Feb 23 22:35:18 2014 New Revision: 262409 URL: http://svnweb.freebsd.org/changeset/base/262409 Log: Move the declaration for mpentry() into a header file instead of pasting it into a bunch of different .c files. Remove declarations for the unused mptramp() function from everywhere except AramadaXP (and I think it's really not used there either, because the code that references it appears to be insanely does-nothing in nature). Modified: head/sys/arm/include/smp.h head/sys/arm/mv/armadaxp/armadaxp_mp.c head/sys/arm/samsung/exynos/exynos5_mp.c head/sys/arm/ti/omap4/omap4_mp.c Modified: head/sys/arm/include/smp.h ============================================================================== --- head/sys/arm/include/smp.h Sun Feb 23 22:29:59 2014 (r262408) +++ head/sys/arm/include/smp.h Sun Feb 23 22:35:18 2014 (r262409) @@ -15,6 +15,7 @@ #define IPI_TLB 7 void init_secondary(int cpu); +void mpentry(void); void ipi_all_but_self(u_int ipi); void ipi_cpu(int cpu, u_int ipi); Modified: head/sys/arm/mv/armadaxp/armadaxp_mp.c ============================================================================== --- head/sys/arm/mv/armadaxp/armadaxp_mp.c Sun Feb 23 22:29:59 2014 (r262408) +++ head/sys/arm/mv/armadaxp/armadaxp_mp.c Sun Feb 23 22:35:18 2014 (r262409) @@ -96,7 +96,6 @@ platform_mp_init_secondary(void) { } -void mpentry(void); void mptramp(void); Modified: head/sys/arm/samsung/exynos/exynos5_mp.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_mp.c Sun Feb 23 22:29:59 2014 (r262408) +++ head/sys/arm/samsung/exynos/exynos5_mp.c Sun Feb 23 22:35:18 2014 (r262409) @@ -39,9 +39,6 @@ __FBSDID("$FreeBSD$"); #define EXYNOS_SYSRAM 0x02020000 -void mpentry(void); -void mptramp(void); - void platform_mp_init_secondary(void) { Modified: head/sys/arm/ti/omap4/omap4_mp.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_mp.c Sun Feb 23 22:29:59 2014 (r262408) +++ head/sys/arm/ti/omap4/omap4_mp.c Sun Feb 23 22:35:18 2014 (r262409) @@ -38,9 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -void mpentry(void); -void mptramp(void); - void platform_mp_init_secondary(void) { From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 22:50:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C14B1ED; Sun, 23 Feb 2014 22:50:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0DB8E1D92; Sun, 23 Feb 2014 22:50:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NMoMd1073016; Sun, 23 Feb 2014 22:50:22 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NMoMA2073015; Sun, 23 Feb 2014 22:50:22 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402232250.s1NMoMA2073015@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 23 Feb 2014 22:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262410 - head/lib/libucl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 22:50:23 -0000 Author: bapt Date: Sun Feb 23 22:50:22 2014 New Revision: 262410 URL: http://svnweb.freebsd.org/changeset/base/262410 Log: Lower the level of WARNS to fix build with gcc Modified: head/lib/libucl/Makefile Modified: head/lib/libucl/Makefile ============================================================================== --- head/lib/libucl/Makefile Sun Feb 23 22:35:18 2014 (r262409) +++ head/lib/libucl/Makefile Sun Feb 23 22:50:22 2014 (r262410) @@ -13,7 +13,7 @@ SRCS= ucl_emitter.c \ .PATH: ${LIBUCL}/src -WARNS= 2 +WARNS= 1 CFLAGS+= -I${LIBUCL}/include \ -I${LIBUCL}/src \ -I${LIBUCL}/uthash From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 22:52:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E205C359; Sun, 23 Feb 2014 22:52:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CE0B81E18; Sun, 23 Feb 2014 22:52:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NMqm21075702; Sun, 23 Feb 2014 22:52:48 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NMqmI5075701; Sun, 23 Feb 2014 22:52:48 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402232252.s1NMqmI5075701@svn.freebsd.org> From: Ian Lepore Date: Sun, 23 Feb 2014 22:52:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262411 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 22:52:49 -0000 Author: ian Date: Sun Feb 23 22:52:48 2014 New Revision: 262411 URL: http://svnweb.freebsd.org/changeset/base/262411 Log: If the L2 cache type is PIPT, pass a physical address for a flush. While this is technically more correct, I don't think it much matters, because the only thing in the tree that calls cpu_flush_dcache() is md(4) and I'm > 99% sure it's bogus that it does so; md has no ability to do anything that can perturb data cache coherency. Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sun Feb 23 22:50:22 2014 (r262410) +++ head/sys/arm/arm/machdep.c Sun Feb 23 22:52:48 2014 (r262411) @@ -410,7 +410,11 @@ cpu_flush_dcache(void *ptr, size_t len) { cpu_dcache_wb_range((uintptr_t)ptr, len); +#ifdef ARM_L2_PIPT + cpu_l2cache_wb_range((uintptr_t)vtophys(ptr), len); +#else cpu_l2cache_wb_range((uintptr_t)ptr, len); +#endif } /* Get current clock frequency for the given cpu id. */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 22:56:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 986785FA; Sun, 23 Feb 2014 22:56:12 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB111E3B; Sun, 23 Feb 2014 22:56:12 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 6C44A25D38A5; Sun, 23 Feb 2014 22:56:10 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 94583C22B93; Sun, 23 Feb 2014 22:56:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id ARPQKx8FO4td; Sun, 23 Feb 2014 22:56:07 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:f0bf:19b6:d9c0:f42b] (unknown [IPv6:fde9:577b:c1a9:4410:f0bf:19b6:d9c0:f42b]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 67FEEC22BD0; Sun, 23 Feb 2014 22:56:06 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r262351 - head/sys/netinet6 From: "Bjoern A. Zeeb" In-Reply-To: <201402230127.s1N1RMoX052542@svn.freebsd.org> Date: Sun, 23 Feb 2014 22:56:02 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201402230127.s1N1RMoX052542@svn.freebsd.org> To: Craig Rodrigues X-Mailer: Apple Mail (2.1827) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 22:56:12 -0000 On 23 Feb 2014, at 01:27 , Craig Rodrigues wrote: > Author: rodrigc > Date: Sun Feb 23 01:27:22 2014 > New Revision: 262351 > URL: http://svnweb.freebsd.org/changeset/base/262351 >=20 > Log: > Remove KASSERT from in6p_lookup_mcast_ifp(). >=20 > When the devel/jenkins port, version 1.551 was started, > the kernel would panic if INVARIANTS was enabled in the kernel = config. >=20 > Suggested by: bms This reads to me =93we hit the assert, bms suggested to remove it=94. = Great! Caught a bug! Where is it? In no way the commit message tells = me why? Why did we not hit the assert in the last n years? What has = changed that we hit it now? Was the assert wrong from the beginning? = Did we hit a real bug elsewhere and now lost the tracking for it? Could you please at least for the archives explain? >=20 > Modified: > head/sys/netinet6/in6_mcast.c >=20 > Modified: head/sys/netinet6/in6_mcast.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/netinet6/in6_mcast.c Sun Feb 23 00:46:05 2014 = (r262350) > +++ head/sys/netinet6/in6_mcast.c Sun Feb 23 01:27:22 2014 = (r262351) > @@ -1781,8 +1781,6 @@ in6p_lookup_mcast_ifp(const struct inpcb > ("%s: not INP_IPV6 inpcb", __func__)); > KASSERT(gsin6->sin6_family =3D=3D AF_INET6, > ("%s: not AF_INET6 group", __func__)); > - KASSERT(IN6_IS_ADDR_MULTICAST(&gsin6->sin6_addr), > - ("%s: not multicast", __func__)); >=20 > ifp =3D NULL; > memset(&ro6, 0, sizeof(struct route_in6)); =97=20 Bjoern A. Zeeb ????????? ??? ??????? ??????: '??? ??? ???? ?????? ??????? ?? ?? ??????? ??????? ??? ????? ????? ???? ?????? ?? ????? ????', ????????? ?????????, "??? ????? ?? ?????", ?.??? From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 23:06:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65926791; Sun, 23 Feb 2014 23:06:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 50C0B1FDA; Sun, 23 Feb 2014 23:06:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NN6pTO080379; Sun, 23 Feb 2014 23:06:51 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NN6pIs080378; Sun, 23 Feb 2014 23:06:51 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402232306.s1NN6pIs080378@svn.freebsd.org> From: Ian Lepore Date: Sun, 23 Feb 2014 23:06:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262413 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 23:06:51 -0000 Author: ian Date: Sun Feb 23 23:06:50 2014 New Revision: 262413 URL: http://svnweb.freebsd.org/changeset/base/262413 Log: Actually set the proper bit to indicate TTB shared memory. Submitted by: Juergan Weiss Modified: head/sys/arm/arm/locore.S Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Sun Feb 23 22:55:07 2014 (r262412) +++ head/sys/arm/arm/locore.S Sun Feb 23 23:06:50 2014 (r262413) @@ -425,7 +425,7 @@ Ltag: orr r0, r0, #PHYSADDR ldr r0, [r0] #if defined(SMP) - orr r0, r0, #0 /* Set TTB shared memory flag */ + orr r0, r0, #2 /* Set TTB shared memory flag */ #endif mcr p15, 0, r0, c2, c0, 0 /* Set TTB */ mcr p15, 0, r0, c8, c7, 0 /* Flush TLB */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 23:13:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D329ABC; Sun, 23 Feb 2014 23:13:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7662D109B; Sun, 23 Feb 2014 23:13:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NNDsrQ084322; Sun, 23 Feb 2014 23:13:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NNDs8i084321; Sun, 23 Feb 2014 23:13:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402232313.s1NNDs8i084321@svn.freebsd.org> From: Adrian Chadd Date: Sun, 23 Feb 2014 23:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262414 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 23:13:54 -0000 Author: adrian Date: Sun Feb 23 23:13:53 2014 New Revision: 262414 URL: http://svnweb.freebsd.org/changeset/base/262414 Log: Fix a typo. Modified: head/sys/dev/iwn/if_iwnreg.h Modified: head/sys/dev/iwn/if_iwnreg.h ============================================================================== --- head/sys/dev/iwn/if_iwnreg.h Sun Feb 23 23:06:50 2014 (r262413) +++ head/sys/dev/iwn/if_iwnreg.h Sun Feb 23 23:13:53 2014 (r262414) @@ -1530,7 +1530,7 @@ struct iwn_tx_stats { uint32_t exp_ack; uint32_t ack; uint32_t msdu; - uint32_t busrt_err1; + uint32_t burst_err1; uint32_t burst_err2; uint32_t cts_collision; uint32_t ack_collision; From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 23:36:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CCCAF192; Sun, 23 Feb 2014 23:36:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B5C941225; Sun, 23 Feb 2014 23:36:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NNaWFq092658; Sun, 23 Feb 2014 23:36:32 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NNaWsX092656; Sun, 23 Feb 2014 23:36:32 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402232336.s1NNaWsX092656@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 23 Feb 2014 23:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262417 - in head: share/man/man4 sys/dev/usb/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 23:36:32 -0000 Author: hselasky Date: Sun Feb 23 23:36:32 2014 New Revision: 262417 URL: http://svnweb.freebsd.org/changeset/base/262417 Log: Update ATP driver: - Support for double-tap and drag. - Support for 2-finger horizontal scrolling which translates to page-back/forward events. - Single finger tap is equivalent to a left-button press. - Two-finger taps are mapped to the right-button click. - Three fingers are mapped to middle button. - Add sysctl to disable single finger tapping. - Fix for multiple open of /dev/atp0 - Enhanced support for the Fountain/Geyser family by adding Geyser4. - Update manual page. Submitted by: Rohit Grover MFC after: 2 weeks Modified: head/share/man/man4/atp.4 head/sys/dev/usb/input/atp.c Modified: head/share/man/man4/atp.4 ============================================================================== --- head/share/man/man4/atp.4 Sun Feb 23 23:33:11 2014 (r262416) +++ head/share/man/man4/atp.4 Sun Feb 23 23:36:32 2014 (r262417) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2009 Rohit Grover . +.\" Copyright (c) 2014 Rohit Grover . .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 7, 2014 +.Dd February 23, 2014 .Dt ATP 4 .Os .Sh NAME @@ -41,8 +41,7 @@ your kernel configuration file: .Cd "device usb" .Ed .Pp -Alternatively, to load the driver as a -module at boot time, place the following line in +Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent atp_load="YES" @@ -50,24 +49,20 @@ atp_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for the Apple Internal Trackpad -device found in many Apple laptops. +driver provides support for the Apple Internal Trackpad device found in many +Apple laptops. Older (Fountain/Geyser) and the newer (Wellspring) trackpad +families are all supported through a unified driver. +.Pp +The driver simulates a three\-button mouse using multi\-finger tap detection. +Single finger tap generates a left\-button click; two\-finger tap maps to the +middle button; whereas a three\-finger tap gets treated as a right button +click. +.Pp +There is support for 2-finger horizontal scrolling, which translates to +page\-back/forward events. .Pp -The driver simulates a three\-button mouse using multi\-finger tap -detection. -. -A single\-finger tap generates a left button click; -two\-finger tap maps to the middle button; whereas a three\-finger tap -gets treated as a right button click. -. A double\-tap followed by a drag is treated as a selection gesture; a virtual left\-button click is assumed for the lifespan of the drag. -. -.Nm -attempts to filter away activity at the horizontal edges of the -trackpad\-\-this is to keep unintentional palm movement from being -considered as user input. -. .Pp .Nm supports dynamic reconfiguration using @@ -76,6 +71,28 @@ through nodes under .Nm hw.usb.atp . Pointer sensitivity can be controlled using the sysctl tunable .Nm hw.usb.atp.scale_factor . +Smaller values of +.Fa scale_factor +result in faster movement. +. +A simple high-pass filter is used to reduce contributions +from small movements; the threshold for this filter may be controlled by +.Nm hw.usb.atp.small_movement . +. +The maximum tolerable duration of a touch gesture is controlled by +.Nm hw.usb.atp.touch_timeout +(in microseconds); beyond this period, touches are considered to be slides. +(This conversion also happens when a finger stroke accumulates at least +.Nm hw.usb.atp.slide_min_movement +movement (in mickeys). +. +The maximum time (in microseconds) to allow an association between a double- +tap and drag gesture may be controlled by +.Nm hw.usb.atp.double_tap_threshold . +. +Should one want to disable tap detection and rely only upon physical button +presses, set the following sysctl to a value of 2 +.Nm hw.usb.atp.tap_minimum . . .Sh HARDWARE The @@ -84,6 +101,8 @@ driver provides support for the followin .Pp .Bl -bullet -compact .It +PowerBooks, iBooks (IDs: 0x020e, 0x020f, 0x0210, 0x0214, 0x0215, 0x0216) +.It Core Duo MacBook & MacBook Pro (IDs: 0x0217, 0x0218, 0x0219) .It Core2 Duo MacBook & MacBook Pro (IDs: 0x021a, 0x021b, 0x021c) @@ -95,6 +114,14 @@ Core2 Duo MacBook3,1 (IDs: 0x0229, 0x022 15 inch PowerBook (IDs: 0x020e, 0x020f, 0x0215) .It 17 inch PowerBook (ID: 0x020d) +.It +Almost all recent Macbook-Pros and Airs (IDs: 0x0223, 0x0223, 0x0224, 0x0224, +0x0225, 0x0225, 0x0230, 0x0230, 0x0231, 0x0231, 0x0232, 0x0232, 0x0236, +0x0236, 0x0237, 0x0237, 0x0238, 0x0238, 0x023f, 0x023f, 0x0240, 0x0241, +0x0242, 0x0243, 0x0244, 0x0245, 0x0246, 0x0247, 0x0249, 0x024a, 0x024b, +0x024c, 0x024d, 0x024e, 0x0252, 0x0252, 0x0253, 0x0253, 0x0254, 0x0254, +0x0259, 0x025a, 0x025b, 0x0262, 0x0262, 0x0263, 0x0264, 0x0290, 0x0291, +0x0292) .El .Pp To discover the product\-id of a touchpad, search for 'Trackpad' in the Modified: head/sys/dev/usb/input/atp.c ============================================================================== --- head/sys/dev/usb/input/atp.c Sun Feb 23 23:33:11 2014 (r262416) +++ head/sys/dev/usb/input/atp.c Sun Feb 23 23:36:32 2014 (r262417) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009 Rohit Grover + * Copyright (c) 2014 Rohit Grover * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,29 +24,64 @@ * SUCH DAMAGE. */ +/* + * Some tables, structures, definitions and constant values for the + * touchpad protocol has been copied from Linux's + * "drivers/input/mouse/bcm5974.c" which has the following copyright + * holders under GPLv2. All device specific code in this driver has + * been written from scratch. The decoding algorithm is based on + * output from FreeBSD's usbdump. + * + * Copyright (C) 2008 Henrik Rydberg (rydberg@euromail.se) + * Copyright (C) 2008 Scott Shawcroft (scott.shawcroft@gmail.com) + * Copyright (C) 2001-2004 Greg Kroah-Hartman (greg@kroah.com) + * Copyright (C) 2005 Johannes Berg (johannes@sipsolutions.net) + * Copyright (C) 2005 Stelian Pop (stelian@popies.net) + * Copyright (C) 2005 Frank Arnold (frank@scirocco-5v-turbo.de) + * Copyright (C) 2005 Peter Osterlund (petero2@telia.com) + * Copyright (C) 2005 Michael Hanselmann (linux-kernel@hansmi.ch) + * Copyright (C) 2006 Nicolas Boichat (nicolas@boichat.ch) + */ + +/* + * Author's note: 'atp' supports two distinct families of Apple trackpad + * products: the older Fountain/Geyser and the latest Wellspring trackpads. + * The first version made its appearance with FreeBSD 8 and worked only with + * the Fountain/Geyser hardware. A fork of this driver for Wellspring was + * contributed by Huang Wen Hui. This driver unifies the Wellspring effort + * and also improves upon the original work. + * + * I'm grateful to Stephan Scheunig, Angela Naegele, and Nokia IT-support + * for helping me with access to hardware. Thanks also go to Nokia for + * giving me an opportunity to do this work. + */ + #include __FBSDID("$FreeBSD$"); +#include +#include #include +#include #include #include -#include +#include #include #include #include -#include +#include +#include #include #include #include #include #include -#include -#include #include #include #include #include + #include "usbdevs.h" #define USB_DEBUG_VAR atp_debug @@ -61,17 +96,35 @@ __FBSDID("$FreeBSD$"); * `options' statements in the kernel configuration file. */ -/* The multiplier used to translate sensor reported positions to mickeys. */ +/* The divisor used to translate sensor reported positions to mickeys. */ #ifndef ATP_SCALE_FACTOR -#define ATP_SCALE_FACTOR 48 +#define ATP_SCALE_FACTOR 16 +#endif + +/* Threshold for small movement noise (in mickeys) */ +#ifndef ATP_SMALL_MOVEMENT_THRESHOLD +#define ATP_SMALL_MOVEMENT_THRESHOLD 30 +#endif + +/* Threshold of instantaneous deltas beyond which movement is considered fast.*/ +#ifndef ATP_FAST_MOVEMENT_TRESHOLD +#define ATP_FAST_MOVEMENT_TRESHOLD 150 #endif /* - * This is the age (in microseconds) beyond which a touch is - * considered to be a slide; and therefore a tap event isn't registered. + * This is the age in microseconds beyond which a touch is considered + * to be a slide; and therefore a tap event isn't registered. */ #ifndef ATP_TOUCH_TIMEOUT -#define ATP_TOUCH_TIMEOUT 125000 +#define ATP_TOUCH_TIMEOUT 125000 +#endif + +#ifndef ATP_IDLENESS_THRESHOLD +#define ATP_IDLENESS_THRESHOLD 10 +#endif + +#ifndef FG_SENSOR_NOISE_THRESHOLD +#define FG_SENSOR_NOISE_THRESHOLD 2 #endif /* @@ -82,39 +135,40 @@ __FBSDID("$FreeBSD$"); * tap events preceding the slide for such a gesture. */ #ifndef ATP_DOUBLE_TAP_N_DRAG_THRESHOLD -#define ATP_DOUBLE_TAP_N_DRAG_THRESHOLD 200000 +#define ATP_DOUBLE_TAP_N_DRAG_THRESHOLD 200000 #endif /* - * The device provides us only with pressure readings from an array of - * X and Y sensors; for our algorithms, we need to interpret groups - * (typically pairs) of X and Y readings as being related to a single - * finger stroke. We can relate X and Y readings based on their times - * of incidence. The coincidence window should be at least 10000us - * since it is used against values from getmicrotime(), which has a - * precision of around 10ms. - */ -#ifndef ATP_COINCIDENCE_THRESHOLD -#define ATP_COINCIDENCE_THRESHOLD 40000 /* unit: microseconds */ -#if ATP_COINCIDENCE_THRESHOLD > 100000 -#error "ATP_COINCIDENCE_THRESHOLD too large" -#endif -#endif /* #ifndef ATP_COINCIDENCE_THRESHOLD */ + * The wait duration in ticks after losing a touch contact before + * zombied strokes are reaped and turned into button events. + */ +#define ATP_ZOMBIE_STROKE_REAP_INTERVAL (hz / 20) /* 50 ms */ + +/* The multiplier used to translate sensor reported positions to mickeys. */ +#define FG_SCALE_FACTOR 380 /* - * The wait duration (in microseconds) after losing a touch contact - * before zombied strokes are reaped and turned into button events. + * The movement threshold for a stroke; this is the maximum difference + * in position which will be resolved as a continuation of a stroke + * component. */ -#define ATP_ZOMBIE_STROKE_REAP_WINDOW 50000 -#if ATP_ZOMBIE_STROKE_REAP_WINDOW > 100000 -#error "ATP_ZOMBIE_STROKE_REAP_WINDOW too large" +#define FG_MAX_DELTA_MICKEYS ((3 * (FG_SCALE_FACTOR)) >> 1) + +/* Distance-squared threshold for matching a finger with a known stroke */ +#ifndef WSP_MAX_ALLOWED_MATCH_DISTANCE_SQ +#define WSP_MAX_ALLOWED_MATCH_DISTANCE_SQ 1000000 #endif -/* end of driver specific options */ +/* Ignore pressure spans with cumulative press. below this value. */ +#define FG_PSPAN_MIN_CUM_PRESSURE 10 + +/* Maximum allowed width for pressure-spans.*/ +#define FG_PSPAN_MAX_WIDTH 4 +/* end of driver specific options */ /* Tunables */ -static SYSCTL_NODE(_hw_usb, OID_AUTO, atp, CTLFLAG_RW, 0, "USB atp"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, atp, CTLFLAG_RW, 0, "USB ATP"); #ifdef USB_DEBUG enum atp_log_level { @@ -130,12 +184,13 @@ SYSCTL_INT(_hw_usb_atp, OID_AUTO, debug, static u_int atp_touch_timeout = ATP_TOUCH_TIMEOUT; SYSCTL_UINT(_hw_usb_atp, OID_AUTO, touch_timeout, CTLFLAG_RW, - &atp_touch_timeout, 125000, "age threshold (in micros) for a touch"); + &atp_touch_timeout, 125000, "age threshold in microseconds for a touch"); static u_int atp_double_tap_threshold = ATP_DOUBLE_TAP_N_DRAG_THRESHOLD; SYSCTL_UINT(_hw_usb_atp, OID_AUTO, double_tap_threshold, CTLFLAG_RW, &atp_double_tap_threshold, ATP_DOUBLE_TAP_N_DRAG_THRESHOLD, - "maximum time (in micros) between a double-tap"); + "maximum time in microseconds to allow association between a double-tap and " + "drag gesture"); static u_int atp_mickeys_scale_factor = ATP_SCALE_FACTOR; static int atp_sysctl_scale_factor_handler(SYSCTL_HANDLER_ARGS); @@ -143,264 +198,538 @@ SYSCTL_PROC(_hw_usb_atp, OID_AUTO, scale &atp_mickeys_scale_factor, sizeof(atp_mickeys_scale_factor), atp_sysctl_scale_factor_handler, "IU", "movement scale factor"); -static u_int atp_small_movement_threshold = ATP_SCALE_FACTOR >> 3; +static u_int atp_small_movement_threshold = ATP_SMALL_MOVEMENT_THRESHOLD; SYSCTL_UINT(_hw_usb_atp, OID_AUTO, small_movement, CTLFLAG_RW, - &atp_small_movement_threshold, ATP_SCALE_FACTOR >> 3, + &atp_small_movement_threshold, ATP_SMALL_MOVEMENT_THRESHOLD, "the small movement black-hole for filtering noise"); -/* - * The movement threshold for a stroke; this is the maximum difference - * in position which will be resolved as a continuation of a stroke - * component. - */ -static u_int atp_max_delta_mickeys = ((3 * ATP_SCALE_FACTOR) >> 1); -SYSCTL_UINT(_hw_usb_atp, OID_AUTO, max_delta_mickeys, CTLFLAG_RW, - &atp_max_delta_mickeys, ((3 * ATP_SCALE_FACTOR) >> 1), - "max. mickeys-delta which will match against an existing stroke"); + +static u_int atp_tap_minimum = 1; +SYSCTL_UINT(_hw_usb_atp, OID_AUTO, tap_minimum, CTLFLAG_RW, + &atp_tap_minimum, 1, "Minimum number of taps before detection"); + /* * Strokes which accumulate at least this amount of absolute movement * from the aggregate of their components are considered as * slides. Unit: mickeys. */ -static u_int atp_slide_min_movement = (ATP_SCALE_FACTOR >> 3); +static u_int atp_slide_min_movement = 2 * ATP_SMALL_MOVEMENT_THRESHOLD; SYSCTL_UINT(_hw_usb_atp, OID_AUTO, slide_min_movement, CTLFLAG_RW, - &atp_slide_min_movement, (ATP_SCALE_FACTOR >> 3), + &atp_slide_min_movement, 2 * ATP_SMALL_MOVEMENT_THRESHOLD, "strokes with at least this amt. of movement are considered slides"); /* * The minimum age of a stroke for it to be considered mature; this * helps filter movements (noise) from immature strokes. Units: interrupts. */ -static u_int atp_stroke_maturity_threshold = 2; +static u_int atp_stroke_maturity_threshold = 4; SYSCTL_UINT(_hw_usb_atp, OID_AUTO, stroke_maturity_threshold, CTLFLAG_RW, - &atp_stroke_maturity_threshold, 2, + &atp_stroke_maturity_threshold, 4, "the minimum age of a stroke for it to be considered mature"); -/* Accept pressure readings from sensors only if above this value. */ -static u_int atp_sensor_noise_threshold = 2; -SYSCTL_UINT(_hw_usb_atp, OID_AUTO, sensor_noise_threshold, CTLFLAG_RW, - &atp_sensor_noise_threshold, 2, - "accept pressure readings from sensors only if above this value"); +typedef enum atp_trackpad_family { + TRACKPAD_FAMILY_FOUNTAIN_GEYSER, + TRACKPAD_FAMILY_WELLSPRING, + TRACKPAD_FAMILY_MAX /* keep this at the tail end of the enumeration */ +} trackpad_family_t; + +enum fountain_geyser_product { + FOUNTAIN, + GEYSER1, + GEYSER1_17inch, + GEYSER2, + GEYSER3, + GEYSER4, + FOUNTAIN_GEYSER_PRODUCT_MAX /* keep this at the end */ +}; -/* Ignore pressure spans with cumulative press. below this value. */ -static u_int atp_pspan_min_cum_pressure = 10; -SYSCTL_UINT(_hw_usb_atp, OID_AUTO, pspan_min_cum_pressure, CTLFLAG_RW, - &atp_pspan_min_cum_pressure, 10, - "ignore pressure spans with cumulative press. below this value"); +enum wellspring_product { + WELLSPRING1, + WELLSPRING2, + WELLSPRING3, + WELLSPRING4, + WELLSPRING4A, + WELLSPRING5, + WELLSPRING6A, + WELLSPRING6, + WELLSPRING5A, + WELLSPRING7, + WELLSPRING7A, + WELLSPRING8, + WELLSPRING_PRODUCT_MAX /* keep this at the end of the enumeration */ +}; -/* Maximum allowed width for pressure-spans.*/ -static u_int atp_pspan_max_width = 4; -SYSCTL_UINT(_hw_usb_atp, OID_AUTO, pspan_max_width, CTLFLAG_RW, - &atp_pspan_max_width, 4, - "maximum allowed width (in sensors) for pressure-spans"); - -/* We support three payload protocols */ -typedef enum { - ATP_PROT_GEYSER1, - ATP_PROT_GEYSER2, - ATP_PROT_GEYSER3, -} atp_protocol; +/* trackpad header types */ +enum fountain_geyser_trackpad_type { + FG_TRACKPAD_TYPE_GEYSER1, + FG_TRACKPAD_TYPE_GEYSER2, + FG_TRACKPAD_TYPE_GEYSER3, + FG_TRACKPAD_TYPE_GEYSER4, +}; +enum wellspring_trackpad_type { + WSP_TRACKPAD_TYPE1, /* plain trackpad */ + WSP_TRACKPAD_TYPE2, /* button integrated in trackpad */ + WSP_TRACKPAD_TYPE3 /* additional header fields since June 2013 */ +}; -/* Define the various flavours of devices supported by this driver. */ -enum { - ATP_DEV_PARAMS_0, - ATP_DEV_PARAMS_PBOOK, - ATP_DEV_PARAMS_PBOOK_15A, - ATP_DEV_PARAMS_PBOOK_17, - ATP_N_DEV_PARAMS +/* + * Trackpad family and product and family are encoded together in the + * driver_info value associated with a trackpad product. + */ +#define N_PROD_BITS 8 /* Number of bits used to encode product */ +#define ENCODE_DRIVER_INFO(FAMILY, PROD) \ + (((FAMILY) << N_PROD_BITS) | (PROD)) +#define DECODE_FAMILY_FROM_DRIVER_INFO(INFO) ((INFO) >> N_PROD_BITS) +#define DECODE_PRODUCT_FROM_DRIVER_INFO(INFO) \ + ((INFO) & ((1 << N_PROD_BITS) - 1)) + +#define FG_DRIVER_INFO(PRODUCT) \ + ENCODE_DRIVER_INFO(TRACKPAD_FAMILY_FOUNTAIN_GEYSER, PRODUCT) +#define WELLSPRING_DRIVER_INFO(PRODUCT) \ + ENCODE_DRIVER_INFO(TRACKPAD_FAMILY_WELLSPRING, PRODUCT) + +/* + * The following structure captures the state of a pressure span along + * an axis. Each contact with the touchpad results in separate + * pressure spans along the two axes. + */ +typedef struct fg_pspan { + u_int width; /* in units of sensors */ + u_int cum; /* cumulative compression (from all sensors) */ + u_int cog; /* center of gravity */ + u_int loc; /* location (scaled using the mickeys factor) */ + boolean_t matched; /* to track pspans as they match against strokes. */ +} fg_pspan; + +#define FG_MAX_PSPANS_PER_AXIS 3 +#define FG_MAX_STROKES (2 * FG_MAX_PSPANS_PER_AXIS) + +#define WELLSPRING_INTERFACE_INDEX 1 + +/* trackpad finger data offsets, le16-aligned */ +#define WSP_TYPE1_FINGER_DATA_OFFSET (13 * 2) +#define WSP_TYPE2_FINGER_DATA_OFFSET (15 * 2) +#define WSP_TYPE3_FINGER_DATA_OFFSET (19 * 2) + +/* trackpad button data offsets */ +#define WSP_TYPE2_BUTTON_DATA_OFFSET 15 +#define WSP_TYPE3_BUTTON_DATA_OFFSET 23 + +/* list of device capability bits */ +#define HAS_INTEGRATED_BUTTON 1 + +/* trackpad finger structure - little endian */ +struct wsp_finger_sensor_data { + int16_t origin; /* zero when switching track finger */ + int16_t abs_x; /* absolute x coordinate */ + int16_t abs_y; /* absolute y coordinate */ + int16_t rel_x; /* relative x coordinate */ + int16_t rel_y; /* relative y coordinate */ + int16_t tool_major; /* tool area, major axis */ + int16_t tool_minor; /* tool area, minor axis */ + int16_t orientation; /* 16384 when point, else 15 bit angle */ + int16_t touch_major; /* touch area, major axis */ + int16_t touch_minor; /* touch area, minor axis */ + int16_t unused[3]; /* zeros */ + int16_t multi; /* one finger: varies, more fingers: constant */ +} __packed; + +typedef struct wsp_finger { + /* to track fingers as they match against strokes. */ + boolean_t matched; + + /* location (scaled using the mickeys factor) */ + int x; + int y; +} wsp_finger_t; + +#define WSP_MAX_FINGERS 16 +#define WSP_SIZEOF_FINGER_SENSOR_DATA sizeof(struct wsp_finger_sensor_data) +#define WSP_SIZEOF_ALL_FINGER_DATA (WSP_MAX_FINGERS * \ + WSP_SIZEOF_FINGER_SENSOR_DATA) +#define WSP_MAX_FINGER_ORIENTATION 16384 + +#define ATP_SENSOR_DATA_BUF_MAX 1024 +#if (ATP_SENSOR_DATA_BUF_MAX < ((WSP_MAX_FINGERS * 14 * 2) + \ + WSP_TYPE3_FINGER_DATA_OFFSET)) +/* note: 14 * 2 in the above is based on sizeof(struct wsp_finger_sensor_data)*/ +#error "ATP_SENSOR_DATA_BUF_MAX is too small" +#endif + +#define ATP_MAX_STROKES MAX(WSP_MAX_FINGERS, FG_MAX_STROKES) + +#define FG_MAX_XSENSORS 26 +#define FG_MAX_YSENSORS 16 + +/* device-specific configuration */ +struct fg_dev_params { + u_int data_len; /* for sensor data */ + u_int n_xsensors; + u_int n_ysensors; + enum fountain_geyser_trackpad_type prot; }; -struct atp_dev_params { - u_int data_len; /* for sensor data */ - u_int n_xsensors; - u_int n_ysensors; - atp_protocol prot; -} atp_dev_params[ATP_N_DEV_PARAMS] = { - [ATP_DEV_PARAMS_0] = { - .data_len = 64, - .n_xsensors = 20, - .n_ysensors = 10, - .prot = ATP_PROT_GEYSER3 +struct wsp_dev_params { + uint8_t caps; /* device capability bitmask */ + uint8_t tp_type; /* type of trackpad interface */ + uint8_t finger_data_offset; /* offset to trackpad finger data */ +}; + +static const struct fg_dev_params fg_dev_params[FOUNTAIN_GEYSER_PRODUCT_MAX] = { + [FOUNTAIN] = { + .data_len = 81, + .n_xsensors = 16, + .n_ysensors = 16, + .prot = FG_TRACKPAD_TYPE_GEYSER1 }, - [ATP_DEV_PARAMS_PBOOK] = { + [GEYSER1] = { .data_len = 81, .n_xsensors = 16, .n_ysensors = 16, - .prot = ATP_PROT_GEYSER1 + .prot = FG_TRACKPAD_TYPE_GEYSER1 }, - [ATP_DEV_PARAMS_PBOOK_15A] = { + [GEYSER1_17inch] = { + .data_len = 81, + .n_xsensors = 26, + .n_ysensors = 16, + .prot = FG_TRACKPAD_TYPE_GEYSER1 + }, + [GEYSER2] = { .data_len = 64, .n_xsensors = 15, .n_ysensors = 9, - .prot = ATP_PROT_GEYSER2 + .prot = FG_TRACKPAD_TYPE_GEYSER2 }, - [ATP_DEV_PARAMS_PBOOK_17] = { - .data_len = 81, - .n_xsensors = 26, - .n_ysensors = 16, - .prot = ATP_PROT_GEYSER1 + [GEYSER3] = { + .data_len = 64, + .n_xsensors = 20, + .n_ysensors = 10, + .prot = FG_TRACKPAD_TYPE_GEYSER3 }, + [GEYSER4] = { + .data_len = 64, + .n_xsensors = 20, + .n_ysensors = 10, + .prot = FG_TRACKPAD_TYPE_GEYSER4 + } }; -static const STRUCT_USB_HOST_ID atp_devs[] = { +static const STRUCT_USB_HOST_ID fg_devs[] = { + /* PowerBooks Feb 2005, iBooks G4 */ + { USB_VPI(USB_VENDOR_APPLE, 0x020e, FG_DRIVER_INFO(FOUNTAIN)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x020f, FG_DRIVER_INFO(FOUNTAIN)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x0210, FG_DRIVER_INFO(FOUNTAIN)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x030a, FG_DRIVER_INFO(FOUNTAIN)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x030b, FG_DRIVER_INFO(GEYSER1)) }, + + /* PowerBooks Oct 2005 */ + { USB_VPI(USB_VENDOR_APPLE, 0x0214, FG_DRIVER_INFO(GEYSER2)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x0215, FG_DRIVER_INFO(GEYSER2)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x0216, FG_DRIVER_INFO(GEYSER2)) }, + /* Core Duo MacBook & MacBook Pro */ - { USB_VPI(USB_VENDOR_APPLE, 0x0217, ATP_DEV_PARAMS_0) }, - { USB_VPI(USB_VENDOR_APPLE, 0x0218, ATP_DEV_PARAMS_0) }, - { USB_VPI(USB_VENDOR_APPLE, 0x0219, ATP_DEV_PARAMS_0) }, + { USB_VPI(USB_VENDOR_APPLE, 0x0217, FG_DRIVER_INFO(GEYSER3)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x0218, FG_DRIVER_INFO(GEYSER3)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x0219, FG_DRIVER_INFO(GEYSER3)) }, /* Core2 Duo MacBook & MacBook Pro */ - { USB_VPI(USB_VENDOR_APPLE, 0x021a, ATP_DEV_PARAMS_0) }, - { USB_VPI(USB_VENDOR_APPLE, 0x021b, ATP_DEV_PARAMS_0) }, - { USB_VPI(USB_VENDOR_APPLE, 0x021c, ATP_DEV_PARAMS_0) }, + { USB_VPI(USB_VENDOR_APPLE, 0x021a, FG_DRIVER_INFO(GEYSER4)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x021b, FG_DRIVER_INFO(GEYSER4)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x021c, FG_DRIVER_INFO(GEYSER4)) }, /* Core2 Duo MacBook3,1 */ - { USB_VPI(USB_VENDOR_APPLE, 0x0229, ATP_DEV_PARAMS_0) }, - { USB_VPI(USB_VENDOR_APPLE, 0x022a, ATP_DEV_PARAMS_0) }, - { USB_VPI(USB_VENDOR_APPLE, 0x022b, ATP_DEV_PARAMS_0) }, - - /* 12 inch PowerBook and iBook */ - { USB_VPI(USB_VENDOR_APPLE, 0x030a, ATP_DEV_PARAMS_PBOOK) }, - { USB_VPI(USB_VENDOR_APPLE, 0x030b, ATP_DEV_PARAMS_PBOOK) }, - - /* 15 inch PowerBook */ - { USB_VPI(USB_VENDOR_APPLE, 0x020e, ATP_DEV_PARAMS_PBOOK) }, - { USB_VPI(USB_VENDOR_APPLE, 0x020f, ATP_DEV_PARAMS_PBOOK) }, - { USB_VPI(USB_VENDOR_APPLE, 0x0215, ATP_DEV_PARAMS_PBOOK_15A) }, + { USB_VPI(USB_VENDOR_APPLE, 0x0229, FG_DRIVER_INFO(GEYSER4)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x022a, FG_DRIVER_INFO(GEYSER4)) }, + { USB_VPI(USB_VENDOR_APPLE, 0x022b, FG_DRIVER_INFO(GEYSER4)) }, /* 17 inch PowerBook */ - { USB_VPI(USB_VENDOR_APPLE, 0x020d, ATP_DEV_PARAMS_PBOOK_17) }, + { USB_VPI(USB_VENDOR_APPLE, 0x020d, FG_DRIVER_INFO(GEYSER1_17inch)) }, +}; +static const struct wsp_dev_params wsp_dev_params[WELLSPRING_PRODUCT_MAX] = { + [WELLSPRING1] = { + .caps = 0, + .tp_type = WSP_TRACKPAD_TYPE1, + .finger_data_offset = WSP_TYPE1_FINGER_DATA_OFFSET, + }, + [WELLSPRING2] = { + .caps = 0, + .tp_type = WSP_TRACKPAD_TYPE1, + .finger_data_offset = WSP_TYPE1_FINGER_DATA_OFFSET, + }, + [WELLSPRING3] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE2, + .finger_data_offset = WSP_TYPE2_FINGER_DATA_OFFSET, + }, + [WELLSPRING4] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE2, + .finger_data_offset = WSP_TYPE2_FINGER_DATA_OFFSET, + }, + [WELLSPRING4A] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE2, + .finger_data_offset = WSP_TYPE2_FINGER_DATA_OFFSET, + }, + [WELLSPRING5] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE2, + .finger_data_offset = WSP_TYPE2_FINGER_DATA_OFFSET, + }, + [WELLSPRING6] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE2, + .finger_data_offset = WSP_TYPE2_FINGER_DATA_OFFSET, + }, + [WELLSPRING5A] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE2, + .finger_data_offset = WSP_TYPE2_FINGER_DATA_OFFSET, + }, + [WELLSPRING6A] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE2, + .finger_data_offset = WSP_TYPE2_FINGER_DATA_OFFSET, + }, + [WELLSPRING7] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE2, + .finger_data_offset = WSP_TYPE2_FINGER_DATA_OFFSET, + }, + [WELLSPRING7A] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE2, + .finger_data_offset = WSP_TYPE2_FINGER_DATA_OFFSET, + }, + [WELLSPRING8] = { + .caps = HAS_INTEGRATED_BUTTON, + .tp_type = WSP_TRACKPAD_TYPE3, + .finger_data_offset = WSP_TYPE3_FINGER_DATA_OFFSET, + }, }; -/* - * The following structure captures the state of a pressure span along - * an axis. Each contact with the touchpad results in separate - * pressure spans along the two axes. - */ -typedef struct atp_pspan { - u_int width; /* in units of sensors */ - u_int cum; /* cumulative compression (from all sensors) */ - u_int cog; /* center of gravity */ - u_int loc; /* location (scaled using the mickeys factor) */ - boolean_t matched; /* to track pspans as they match against strokes. */ -} atp_pspan; +#define ATP_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } + +static const STRUCT_USB_HOST_ID wsp_devs[] = { + /* MacbookAir1.1 */ + ATP_DEV(APPLE, WELLSPRING_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING1)), + ATP_DEV(APPLE, WELLSPRING_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING1)), + ATP_DEV(APPLE, WELLSPRING_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING1)), + + /* MacbookProPenryn, aka wellspring2 */ + ATP_DEV(APPLE, WELLSPRING2_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING2)), + ATP_DEV(APPLE, WELLSPRING2_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING2)), + ATP_DEV(APPLE, WELLSPRING2_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING2)), + + /* Macbook5,1 (unibody), aka wellspring3 */ + ATP_DEV(APPLE, WELLSPRING3_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING3)), + ATP_DEV(APPLE, WELLSPRING3_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING3)), + ATP_DEV(APPLE, WELLSPRING3_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING3)), + + /* MacbookAir3,2 (unibody), aka wellspring4 */ + ATP_DEV(APPLE, WELLSPRING4_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING4)), + ATP_DEV(APPLE, WELLSPRING4_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING4)), + ATP_DEV(APPLE, WELLSPRING4_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING4)), + + /* MacbookAir3,1 (unibody), aka wellspring4 */ + ATP_DEV(APPLE, WELLSPRING4A_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING4A)), + ATP_DEV(APPLE, WELLSPRING4A_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING4A)), + ATP_DEV(APPLE, WELLSPRING4A_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING4A)), + + /* Macbook8 (unibody, March 2011) */ + ATP_DEV(APPLE, WELLSPRING5_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING5)), + ATP_DEV(APPLE, WELLSPRING5_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING5)), + ATP_DEV(APPLE, WELLSPRING5_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING5)), + + /* MacbookAir4,1 (unibody, July 2011) */ + ATP_DEV(APPLE, WELLSPRING6A_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING6A)), + ATP_DEV(APPLE, WELLSPRING6A_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING6A)), + ATP_DEV(APPLE, WELLSPRING6A_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING6A)), + + /* MacbookAir4,2 (unibody, July 2011) */ + ATP_DEV(APPLE, WELLSPRING6_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING6)), + ATP_DEV(APPLE, WELLSPRING6_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING6)), + ATP_DEV(APPLE, WELLSPRING6_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING6)), + + /* Macbook8,2 (unibody) */ + ATP_DEV(APPLE, WELLSPRING5A_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING5A)), + ATP_DEV(APPLE, WELLSPRING5A_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING5A)), + ATP_DEV(APPLE, WELLSPRING5A_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING5A)), + + /* MacbookPro10,1 (unibody, June 2012) */ + /* MacbookPro11,? (unibody, June 2013) */ + ATP_DEV(APPLE, WELLSPRING7_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING7)), + ATP_DEV(APPLE, WELLSPRING7_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING7)), + ATP_DEV(APPLE, WELLSPRING7_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING7)), + + /* MacbookPro10,2 (unibody, October 2012) */ + ATP_DEV(APPLE, WELLSPRING7A_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING7A)), + ATP_DEV(APPLE, WELLSPRING7A_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING7A)), + ATP_DEV(APPLE, WELLSPRING7A_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING7A)), + + /* MacbookAir6,2 (unibody, June 2013) */ + ATP_DEV(APPLE, WELLSPRING8_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING8)), + ATP_DEV(APPLE, WELLSPRING8_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING8)), + ATP_DEV(APPLE, WELLSPRING8_JIS, WELLSPRING_DRIVER_INFO(WELLSPRING8)), +}; typedef enum atp_stroke_type { ATP_STROKE_TOUCH, ATP_STROKE_SLIDE, } atp_stroke_type; -#define ATP_MAX_PSPANS_PER_AXIS 3 +typedef enum atp_axis { + X = 0, + Y = 1, + NUM_AXES +} atp_axis; + +#define ATP_FIFO_BUF_SIZE 8 /* bytes */ +#define ATP_FIFO_QUEUE_MAXLEN 50 /* units */ + +enum { + ATP_INTR_DT, + ATP_RESET, + ATP_N_TRANSFER, +}; -typedef struct atp_stroke_component { +typedef struct fg_stroke_component { /* Fields encapsulating the pressure-span. */ u_int loc; /* location (scaled) */ u_int cum_pressure; /* cumulative compression */ u_int max_cum_pressure; /* max cumulative compression */ boolean_t matched; /*to track components as they match against pspans.*/ - /* Fields containing information about movement. */ int delta_mickeys; /* change in location (un-smoothened movement)*/ - int pending; /* cum. of pending short movements */ - int movement; /* current smoothened movement */ -} atp_stroke_component; - -typedef enum atp_axis { - X = 0, - Y = 1 -} atp_axis; - -#define ATP_MAX_STROKES (2 * ATP_MAX_PSPANS_PER_AXIS) +} fg_stroke_component_t; /* * The following structure captures a finger contact with the * touchpad. A stroke comprises two p-span components and some state. */ typedef struct atp_stroke { - atp_stroke_type type; - struct timeval ctime; /* create time; for coincident siblings. */ - u_int age; /* - * Unit: interrupts; we maintain - * this value in addition to - * 'ctime' in order to avoid the - * expensive call to microtime() - * at every interrupt. - */ - - atp_stroke_component components[2]; - u_int velocity_squared; /* - * Average magnitude (squared) - * of recent velocity. - */ - u_int cum_movement; /* cum. absolute movement so far */ - - uint32_t flags; /* the state of this stroke */ -#define ATSF_ZOMBIE 0x1 -} atp_stroke; + TAILQ_ENTRY(atp_stroke) entry; -#define ATP_FIFO_BUF_SIZE 8 /* bytes */ -#define ATP_FIFO_QUEUE_MAXLEN 50 /* units */ + atp_stroke_type type; + uint32_t flags; /* the state of this stroke */ +#define ATSF_ZOMBIE 0x1 + boolean_t matched; /* to track match against fingers.*/ -enum { - ATP_INTR_DT, - ATP_RESET, - ATP_N_TRANSFER, -}; + struct timeval ctime; /* create time; for coincident siblings. */ + + /* + * Unit: interrupts; we maintain this value in + * addition to 'ctime' in order to avoid the + * expensive call to microtime() at every + * interrupt. + */ + uint32_t age; + + /* Location */ + int x; + int y; + + /* Fields containing information about movement. */ + int instantaneous_dx; /* curr. change in X location (un-smoothened) */ + int instantaneous_dy; /* curr. change in Y location (un-smoothened) */ + int pending_dx; /* cum. of pending short movements */ + int pending_dy; /* cum. of pending short movements */ + int movement_dx; /* interpreted smoothened movement */ + int movement_dy; /* interpreted smoothened movement */ + int cum_movement_x; /* cum. horizontal movement */ + int cum_movement_y; /* cum. vertical movement */ + + /* + * The following member is relevant only for fountain-geyser trackpads. + * For these, there is the need to track pressure-spans and cumulative + * pressures for stroke components. + */ + fg_stroke_component_t components[NUM_AXES]; +} atp_stroke_t; + +struct atp_softc; /* forward declaration */ +typedef void (*sensor_data_interpreter_t)(struct atp_softc *sc, u_int len); struct atp_softc { - device_t sc_dev; - struct usb_device *sc_usb_device; -#define MODE_LENGTH 8 - char sc_mode_bytes[MODE_LENGTH]; /* device mode */ - struct mtx sc_mutex; /* for synchronization */ - struct usb_xfer *sc_xfer[ATP_N_TRANSFER]; - struct usb_fifo_sc sc_fifo; - - struct atp_dev_params *sc_params; - - mousehw_t sc_hw; - mousemode_t sc_mode; - u_int sc_pollrate; - mousestatus_t sc_status; - u_int sc_state; -#define ATP_ENABLED 0x01 -#define ATP_ZOMBIES_EXIST 0x02 -#define ATP_DOUBLE_TAP_DRAG 0x04 -#define ATP_VALID 0x08 - - u_int sc_left_margin; - u_int sc_right_margin; - - atp_stroke sc_strokes[ATP_MAX_STROKES]; - u_int sc_n_strokes; - - int8_t *sensor_data; /* from interrupt packet */ - int *base_x; /* base sensor readings */ - int *base_y; - int *cur_x; /* current sensor readings */ - int *cur_y; - int *pressure_x; /* computed pressures */ - int *pressure_y; + device_t sc_dev; + struct usb_device *sc_usb_device; + struct mtx sc_mutex; /* for synchronization */ + struct usb_fifo_sc sc_fifo; + +#define MODE_LENGTH 8 + char sc_mode_bytes[MODE_LENGTH]; /* device mode */ + + trackpad_family_t sc_family; + const void *sc_params; /* device configuration */ + sensor_data_interpreter_t sensor_data_interpreter; + + mousehw_t sc_hw; + mousemode_t sc_mode; + mousestatus_t sc_status; + + u_int sc_state; +#define ATP_ENABLED 0x01 +#define ATP_ZOMBIES_EXIST 0x02 +#define ATP_DOUBLE_TAP_DRAG 0x04 +#define ATP_VALID 0x08 + + struct usb_xfer *sc_xfer[ATP_N_TRANSFER]; + + u_int sc_pollrate; + int sc_fflags; + + atp_stroke_t sc_strokes_data[ATP_MAX_STROKES]; + TAILQ_HEAD(,atp_stroke) sc_stroke_free; + TAILQ_HEAD(,atp_stroke) sc_stroke_used; + u_int sc_n_strokes; - u_int sc_idlecount; /* preceding idle interrupts */ -#define ATP_IDLENESS_THRESHOLD 10 + struct callout sc_callout; - struct timeval sc_reap_time; - struct timeval sc_reap_ctime; /*ctime of siblings to be reaped*/ + /* + * button status. Set to non-zero if the mouse-button is physically + * pressed. This state variable is exposed through softc to allow + * reap_sibling_zombies to avoid registering taps while the trackpad + * button is pressed. + */ + uint8_t sc_ibtn; + + /* + * Time when touch zombies were last reaped; useful for detecting + * double-touch-n-drag. + */ + struct timeval sc_touch_reap_time; + + u_int sc_idlecount; + + /* Regarding the data transferred from t-pad in USB INTR packets. */ + u_int sc_expected_sensor_data_len; + uint8_t sc_sensor_data[ATP_SENSOR_DATA_BUF_MAX] __aligned(4); + + int sc_cur_x[FG_MAX_XSENSORS]; /* current sensor readings */ + int sc_cur_y[FG_MAX_YSENSORS]; + int sc_base_x[FG_MAX_XSENSORS]; /* base sensor readings */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Feb 23 23:49:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4C0237F; Sun, 23 Feb 2014 23:49:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C11AB12D6; Sun, 23 Feb 2014 23:49:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1NNnApU096758; Sun, 23 Feb 2014 23:49:10 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1NNnAtg096757; Sun, 23 Feb 2014 23:49:10 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201402232349.s1NNnAtg096757@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 23 Feb 2014 23:49:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262418 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2014 23:49:10 -0000 Author: bapt Date: Sun Feb 23 23:49:10 2014 New Revision: 262418 URL: http://svnweb.freebsd.org/changeset/base/262418 Log: Remove a useless newline, warnx already appends a newline Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c ============================================================================== --- head/usr.sbin/pkg/pkg.c Sun Feb 23 23:36:32 2014 (r262417) +++ head/usr.sbin/pkg/pkg.c Sun Feb 23 23:49:10 2014 (r262418) @@ -299,7 +299,7 @@ parse_fingerprint(ucl_object_t *obj) fct = HASH_SHA256; if (fct == HASH_UNKNOWN) { - warnx("Unsupported hashing function: %s\n", function); + warnx("Unsupported hashing function: %s", function); return (NULL); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 01:17:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0733FB8; Mon, 24 Feb 2014 01:17:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C0E211973; Mon, 24 Feb 2014 01:17:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1O1HNbp033641; Mon, 24 Feb 2014 01:17:23 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1O1HN2o033640; Mon, 24 Feb 2014 01:17:23 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402240117.s1O1HN2o033640@svn.freebsd.org> From: Ian Lepore Date: Mon, 24 Feb 2014 01:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262419 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 01:17:24 -0000 Author: ian Date: Mon Feb 24 01:17:23 2014 New Revision: 262419 URL: http://svnweb.freebsd.org/changeset/base/262419 Log: Add an ident line. Modified: head/sys/arm/conf/IMX6 Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Sun Feb 23 23:49:10 2014 (r262418) +++ head/sys/arm/conf/IMX6 Mon Feb 24 01:17:23 2014 (r262419) @@ -17,6 +17,7 @@ # # $FreeBSD$ +ident IMX6 include "../freescale/imx/std.imx6" options HZ=250 # Scheduling quantum is 4 milliseconds. From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 01:41:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7747C421; Mon, 24 Feb 2014 01:41:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 603EA1B86; Mon, 24 Feb 2014 01:41:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1O1fxH8043725; Mon, 24 Feb 2014 01:41:59 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1O1fw7I043720; Mon, 24 Feb 2014 01:41:58 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402240141.s1O1fw7I043720@svn.freebsd.org> From: Ian Lepore Date: Mon, 24 Feb 2014 01:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262420 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 01:41:59 -0000 Author: ian Date: Mon Feb 24 01:41:58 2014 New Revision: 262420 URL: http://svnweb.freebsd.org/changeset/base/262420 Log: Add a new cache maintenance function, idcache_inv_all, to the table, and implementations for each of the chips we support. Most chips up through armv6 can use the armv4 implementation which has a single coprocessor opcode for this operation. The rather more complex armv7 implementation comes from netbsd. Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/arm/cpufunc_asm_armv4.S head/sys/arm/arm/cpufunc_asm_armv6.S head/sys/arm/arm/cpufunc_asm_armv7.S head/sys/arm/include/cpufunc.h Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Mon Feb 24 01:17:23 2014 (r262419) +++ head/sys/arm/arm/cpufunc.c Mon Feb 24 01:41:58 2014 (r262420) @@ -146,6 +146,7 @@ struct cpu_functions arm7tdmi_cpufuncs = (void *)arm7tdmi_cache_flushID, /* dcache_inv_range */ (void *)cpufunc_nullop, /* dcache_wb_range */ + cpufunc_nullop, /* idcache_inv_all */ arm7tdmi_cache_flushID, /* idcache_wbinv_all */ (void *)arm7tdmi_cache_flushID, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all */ @@ -208,6 +209,7 @@ struct cpu_functions arm8_cpufuncs = { /*XXX*/ (void *)arm8_cache_purgeID, /* dcache_inv_range */ (void *)arm8_cache_cleanID, /* dcache_wb_range */ + cpufunc_nullop, /* idcache_inv_all */ arm8_cache_purgeID, /* idcache_wbinv_all */ (void *)arm8_cache_purgeID, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all */ @@ -269,6 +271,7 @@ struct cpu_functions arm9_cpufuncs = { arm9_dcache_inv_range, /* dcache_inv_range */ arm9_dcache_wb_range, /* dcache_wb_range */ + armv4_idcache_inv_all, /* idcache_inv_all */ arm9_idcache_wbinv_all, /* idcache_wbinv_all */ arm9_idcache_wbinv_range, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all */ @@ -331,6 +334,7 @@ struct cpu_functions armv5_ec_cpufuncs = armv5_ec_dcache_inv_range, /* dcache_inv_range */ armv5_ec_dcache_wb_range, /* dcache_wb_range */ + armv4_idcache_inv_all, /* idcache_inv_all */ armv5_ec_idcache_wbinv_all, /* idcache_wbinv_all */ armv5_ec_idcache_wbinv_range, /* idcache_wbinv_range */ @@ -392,6 +396,7 @@ struct cpu_functions sheeva_cpufuncs = { sheeva_dcache_inv_range, /* dcache_inv_range */ sheeva_dcache_wb_range, /* dcache_wb_range */ + armv4_idcache_inv_all, /* idcache_inv_all */ armv5_ec_idcache_wbinv_all, /* idcache_wbinv_all */ sheeva_idcache_wbinv_range, /* idcache_wbinv_all */ @@ -454,6 +459,7 @@ struct cpu_functions arm10_cpufuncs = { arm10_dcache_inv_range, /* dcache_inv_range */ arm10_dcache_wb_range, /* dcache_wb_range */ + armv4_idcache_inv_all, /* idcache_inv_all */ arm10_idcache_wbinv_all, /* idcache_wbinv_all */ arm10_idcache_wbinv_range, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all */ @@ -515,6 +521,7 @@ struct cpu_functions pj4bv7_cpufuncs = { armv7_dcache_inv_range, /* dcache_inv_range */ armv7_dcache_wb_range, /* dcache_wb_range */ + armv7_idcache_inv_all, /* idcache_inv_all */ armv7_idcache_wbinv_all, /* idcache_wbinv_all */ armv7_idcache_wbinv_range, /* idcache_wbinv_all */ @@ -577,6 +584,7 @@ struct cpu_functions sa110_cpufuncs = { /*XXX*/ sa1_cache_purgeD_rng, /* dcache_inv_range */ sa1_cache_cleanD_rng, /* dcache_wb_range */ + sa1_cache_flushID, /* idcache_inv_all */ sa1_cache_purgeID, /* idcache_wbinv_all */ sa1_cache_purgeID_rng, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all */ @@ -638,6 +646,7 @@ struct cpu_functions sa11x0_cpufuncs = { /*XXX*/ sa1_cache_purgeD_rng, /* dcache_inv_range */ sa1_cache_cleanD_rng, /* dcache_wb_range */ + sa1_cache_flushID, /* idcache_inv_all */ sa1_cache_purgeID, /* idcache_wbinv_all */ sa1_cache_purgeID_rng, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all */ @@ -699,6 +708,7 @@ struct cpu_functions ixp12x0_cpufuncs = /*XXX*/ sa1_cache_purgeD_rng, /* dcache_inv_range */ sa1_cache_cleanD_rng, /* dcache_wb_range */ + sa1_cache_flushID, /* idcache_inv_all */ sa1_cache_purgeID, /* idcache_wbinv_all */ sa1_cache_purgeID_rng, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all */ @@ -763,6 +773,7 @@ struct cpu_functions xscale_cpufuncs = { xscale_cache_flushD_rng, /* dcache_inv_range */ xscale_cache_cleanD_rng, /* dcache_wb_range */ + xscale_cache_flushID, /* idcache_inv_all */ xscale_cache_purgeID, /* idcache_wbinv_all */ xscale_cache_purgeID_rng, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all */ @@ -826,6 +837,7 @@ struct cpu_functions xscalec3_cpufuncs = xscale_cache_flushD_rng, /* dcache_inv_range */ xscalec3_cache_cleanD_rng, /* dcache_wb_range */ + xscale_cache_flushID, /* idcache_inv_all */ xscalec3_cache_purgeID, /* idcache_wbinv_all */ xscalec3_cache_purgeID_rng, /* idcache_wbinv_range */ xscalec3_l2cache_purge, /* l2cache_wbinv_all */ @@ -888,6 +900,7 @@ struct cpu_functions fa526_cpufuncs = { fa526_dcache_inv_range, /* dcache_inv_range */ fa526_dcache_wb_range, /* dcache_wb_range */ + armv4_idcache_inv_all, /* idcache_inv_all */ fa526_idcache_wbinv_all, /* idcache_wbinv_all */ fa526_idcache_wbinv_range, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all */ @@ -949,6 +962,7 @@ struct cpu_functions arm1136_cpufuncs = armv6_dcache_inv_range, /* dcache_inv_range */ armv6_dcache_wb_range, /* dcache_wb_range */ + armv6_idcache_inv_all, /* idcache_inv_all */ arm11x6_idcache_wbinv_all, /* idcache_wbinv_all */ arm11x6_idcache_wbinv_range, /* idcache_wbinv_range */ @@ -1010,6 +1024,7 @@ struct cpu_functions arm1176_cpufuncs = armv6_dcache_inv_range, /* dcache_inv_range */ armv6_dcache_wb_range, /* dcache_wb_range */ + armv6_idcache_inv_all, /* idcache_inv_all */ arm11x6_idcache_wbinv_all, /* idcache_wbinv_all */ arm11x6_idcache_wbinv_range, /* idcache_wbinv_range */ @@ -1072,6 +1087,7 @@ struct cpu_functions cortexa_cpufuncs = armv7_dcache_inv_range, /* dcache_inv_range */ armv7_dcache_wb_range, /* dcache_wb_range */ + armv7_idcache_inv_all, /* idcache_inv_all */ armv7_idcache_wbinv_all, /* idcache_wbinv_all */ armv7_idcache_wbinv_range, /* idcache_wbinv_range */ Modified: head/sys/arm/arm/cpufunc_asm_armv4.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_armv4.S Mon Feb 24 01:17:23 2014 (r262419) +++ head/sys/arm/arm/cpufunc_asm_armv4.S Mon Feb 24 01:41:58 2014 (r262420) @@ -71,3 +71,9 @@ ENTRY(armv4_drain_writebuf) RET END(armv4_drain_writebuf) +ENTRY(armv4_idcache_inv_all) + mov r0, #0 + mcr p15, 0, r0, c7, c7, 0 /* invalidate all I+D cache */ + RET +END(armv4_drain_writebuf) + Modified: head/sys/arm/arm/cpufunc_asm_armv6.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_armv6.S Mon Feb 24 01:17:23 2014 (r262419) +++ head/sys/arm/arm/cpufunc_asm_armv6.S Mon Feb 24 01:41:58 2014 (r262420) @@ -148,3 +148,9 @@ ENTRY(armv6_dcache_wbinv_all) END(armv6_idcache_wbinv_all) END(armv6_dcache_wbinv_all) +ENTRY(armv6_idcache_inv_all) + mov r0, #0 + mcr p15, 0, r0, c7, c7, 0 /* invalidate all I+D cache */ + RET +END(armv6_idcache_inv_all) + Modified: head/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_armv7.S Mon Feb 24 01:17:23 2014 (r262419) +++ head/sys/arm/arm/cpufunc_asm_armv7.S Mon Feb 24 01:41:58 2014 (r262420) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2010 Per Odlund * Copyright (C) 2011 MARVELL INTERNATIONAL LTD. * All rights reserved. * @@ -305,3 +306,40 @@ ENTRY(armv7_auxctrl) RET END(armv7_auxctrl) +ENTRY(armv7_idcache_inv_all) + mov r0, #0 + mcr p15, 2, r0, c0, c0, 0 @ set cache level to L1 + mrc p15, 1, r0, c0, c0, 0 @ read CCSIDR + + ubfx r2, r0, #13, #15 @ get num sets - 1 from CCSIDR + ubfx r3, r0, #3, #10 @ get numways - 1 from CCSIDR + clz r1, r3 @ number of bits to MSB of way + lsl r3, r3, r1 @ shift into position + mov ip, #1 @ + lsl ip, ip, r1 @ ip now contains the way decr + + ubfx r0, r0, #0, #3 @ get linesize from CCSIDR + add r0, r0, #4 @ apply bias + lsl r2, r2, r0 @ shift sets by log2(linesize) + add r3, r3, r2 @ merge numsets - 1 with numways - 1 + sub ip, ip, r2 @ subtract numsets - 1 from way decr + mov r1, #1 + lsl r1, r1, r0 @ r1 now contains the set decr + mov r2, ip @ r2 now contains set way decr + + /* r3 = ways/sets, r2 = way decr, r1 = set decr, r0 and ip are free */ +1: mcr p15, 0, r3, c7, c6, 2 @ invalidate line + movs r0, r3 @ get current way/set + beq 2f @ at 0 means we are done. + movs r0, r0, lsl #10 @ clear way bits leaving only set bits + subne r3, r3, r1 @ non-zero?, decrement set # + subeq r3, r3, r2 @ zero?, decrement way # and restore set count + b 1b + +2: dsb @ wait for stores to finish + mov r0, #0 @ and ... + mcr p15, 0, r0, c7, c5, 0 @ invalidate instruction+branch cache + isb @ instruction sync barrier + bx lr @ return +END(armv7_l1cache_inv_all) + Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Mon Feb 24 01:17:23 2014 (r262419) +++ head/sys/arm/include/cpufunc.h Mon Feb 24 01:41:58 2014 (r262420) @@ -104,6 +104,12 @@ struct cpu_functions { * * There are some rules that must be followed: * + * ID-cache Invalidate All: + * Unlike other functions, this one must never write back. + * It is used to intialize the MMU when it is in an unknown + * state (such as when it may have lines tagged as valid + * that belong to a previous set of mappings). + * * I-cache Synch (all or range): * The goal is to synchronize the instruction stream, * so you may beed to write-back dirty D-cache blocks @@ -138,6 +144,7 @@ struct cpu_functions { void (*cf_dcache_inv_range) (vm_offset_t, vm_size_t); void (*cf_dcache_wb_range) (vm_offset_t, vm_size_t); + void (*cf_idcache_inv_all) (void); void (*cf_idcache_wbinv_all) (void); void (*cf_idcache_wbinv_range) (vm_offset_t, vm_size_t); void (*cf_l2cache_wbinv_all) (void); @@ -238,6 +245,7 @@ void tlb_broadcast(int); #define cpu_dcache_inv_range(a, s) cpufuncs.cf_dcache_inv_range((a), (s)) #define cpu_dcache_wb_range(a, s) cpufuncs.cf_dcache_wb_range((a), (s)) +#define cpu_idcache_inv_all() cpufuncs.cf_idcache_inv_all() #define cpu_idcache_wbinv_all() cpufuncs.cf_idcache_wbinv_all() #define cpu_idcache_wbinv_range(a, s) cpufuncs.cf_idcache_wbinv_range((a), (s)) #define cpu_l2cache_wbinv_all() cpufuncs.cf_l2cache_wbinv_all() @@ -495,6 +503,7 @@ void armv6_dcache_wbinv_range (vm_offset void armv6_dcache_inv_range (vm_offset_t, vm_size_t); void armv6_dcache_wb_range (vm_offset_t, vm_size_t); +void armv6_idcache_inv_all (void); void armv6_idcache_wbinv_all (void); void armv6_idcache_wbinv_range (vm_offset_t, vm_size_t); @@ -503,6 +512,7 @@ void armv7_tlb_flushID (void); void armv7_tlb_flushID_SE (u_int); void armv7_icache_sync_range (vm_offset_t, vm_size_t); void armv7_idcache_wbinv_range (vm_offset_t, vm_size_t); +void armv7_idcache_inv_all (void); void armv7_dcache_wbinv_all (void); void armv7_idcache_wbinv_all (void); void armv7_dcache_wbinv_range (vm_offset_t, vm_size_t); @@ -587,6 +597,7 @@ void armv4_tlb_flushD (void); void armv4_tlb_flushD_SE (u_int va); void armv4_drain_writebuf (void); +void armv4_idcache_inv_all (void); #endif #if defined(CPU_IXP12X0) From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 02:13:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5751A6FE; Mon, 24 Feb 2014 02:13:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3D70F1D53; Mon, 24 Feb 2014 02:13:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1O2DLuh056280; Mon, 24 Feb 2014 02:13:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1O2DL0X056279; Mon, 24 Feb 2014 02:13:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402240213.s1O2DL0X056279@svn.freebsd.org> From: Adrian Chadd Date: Mon, 24 Feb 2014 02:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262421 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 02:13:21 -0000 Author: adrian Date: Mon Feb 24 02:13:20 2014 New Revision: 262421 URL: http://svnweb.freebsd.org/changeset/base/262421 Log: Reserve a bit for statistics debugging. I'll hopefully use it soon. Modified: head/sys/dev/iwn/if_iwn_debug.h Modified: head/sys/dev/iwn/if_iwn_debug.h ============================================================================== --- head/sys/dev/iwn/if_iwn_debug.h Mon Feb 24 01:41:58 2014 (r262420) +++ head/sys/dev/iwn/if_iwn_debug.h Mon Feb 24 02:13:20 2014 (r262421) @@ -43,6 +43,7 @@ enum { IWN_DEBUG_TXRATE = 0x00002000, /* TX rate debugging */ IWN_DEBUG_PWRSAVE = 0x00004000, /* Power save operations */ IWN_DEBUG_SCAN = 0x00008000, /* Scan related operations */ + IWN_DEBUG_STATS = 0x00010000, /* Statistics updates */ IWN_DEBUG_REGISTER = 0x20000000, /* print chipset register */ IWN_DEBUG_TRACE = 0x40000000, /* Print begin and start driver function */ IWN_DEBUG_FATAL = 0x80000000, /* fatal errors */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 02:37:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD4C5BA2; Mon, 24 Feb 2014 02:37:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B5E361FF7; Mon, 24 Feb 2014 02:37:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1O2b5Dc064633; Mon, 24 Feb 2014 02:37:05 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1O2b5fF064630; Mon, 24 Feb 2014 02:37:05 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402240237.s1O2b5fF064630@svn.freebsd.org> From: Adrian Chadd Date: Mon, 24 Feb 2014 02:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262422 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 02:37:05 -0000 Author: adrian Date: Mon Feb 24 02:37:04 2014 New Revision: 262422 URL: http://svnweb.freebsd.org/changeset/base/262422 Log: Track and expose the latest statistics from the firmware. Tested: * Intel Centrino 6205 Added: head/sys/dev/iwn/if_iwn_ioctl.h (contents, props changed) Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnvar.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Mon Feb 24 02:13:20 2014 (r262421) +++ head/sys/dev/iwn/if_iwn.c Mon Feb 24 02:37:04 2014 (r262422) @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include struct iwn_ident { uint16_t vendor; @@ -3140,6 +3141,16 @@ iwn5000_rx_calib_results(struct iwn_soft memcpy(sc->calibcmd[idx].buf, calib, len); } +static void +iwn_stats_update(struct iwn_softc *sc, struct iwn_calib_state *calib, + struct iwn_stats *stats) +{ + + /* XXX lock assert */ + memcpy(&sc->last_stat, stats, sizeof(struct iwn_stats)); + sc->last_stat_valid = 1; +} + /* * Process an RX_STATISTICS or BEACON_STATISTICS firmware notification. * The latter is sent by the firmware after each received beacon. @@ -3172,6 +3183,9 @@ iwn_rx_statistics(struct iwn_softc *sc, __func__, desc->type); sc->calib_cnt = 0; /* Reset TX power calibration timeout. */ + /* Collect/track general statistics for reporting */ + iwn_stats_update(sc, calib, stats); + /* Test if temperature has changed. */ if (stats->general.temp != sc->rawtemp) { /* Convert "raw" temperature to degC. */ @@ -4712,6 +4726,19 @@ iwn_ioctl(struct ifnet *ifp, u_long cmd, case SIOCGIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &ic->ic_media, cmd); break; + case SIOCGIWNSTATS: + IWN_LOCK(sc); + /* XXX validate permissions/memory/etc? */ + error = copyout(&sc->last_stat, ifr->ifr_data, + sizeof(struct iwn_stats)); + IWN_UNLOCK(sc); + break; + case SIOCZIWNSTATS: + IWN_LOCK(sc); + memset(&sc->last_stat, 0, sizeof(struct iwn_stats)); + IWN_UNLOCK(sc); + error = 0; + break; default: error = EINVAL; break; Added: head/sys/dev/iwn/if_iwn_ioctl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iwn/if_iwn_ioctl.h Mon Feb 24 02:37:04 2014 (r262422) @@ -0,0 +1,25 @@ +/*- + * Copyright (c) 2014 Adrian Chadd + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ +#ifndef __IF_IWN_IOCTL_H__ +#define __IF_IWN_IOCTL_H__ + +/* XXX how should I pick appropriate ioctl numbers? */ +#define SIOCGIWNSTATS _IOWR('i', 145, struct ifreq) +#define SIOCZIWNSTATS _IOWR('i', 146, struct ifreq) + +#endif /* __IF_IWN_IOCTL_H__ */ Modified: head/sys/dev/iwn/if_iwnvar.h ============================================================================== --- head/sys/dev/iwn/if_iwnvar.h Mon Feb 24 02:13:20 2014 (r262421) +++ head/sys/dev/iwn/if_iwnvar.h Mon Feb 24 02:37:04 2014 (r262422) @@ -328,6 +328,22 @@ struct iwn_softc { int ctx; struct ieee80211vap *ivap[IWN_NUM_RXON_CTX]; + /* General statistics */ + /* + * The statistics are reset after each channel + * change. So it may be zeroed after things like + * a background scan. + * + * So for now, this is just a cheap hack to + * expose the last received statistics dump + * via an ioctl(). Later versions of this + * could expose the last 'n' messages, or just + * provide a pipeline for the firmware responses + * via something like BPF. + */ + struct iwn_stats last_stat; + int last_stat_valid; + uint8_t uc_scan_progress; uint32_t rawtemp; int temp; From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 02:38:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 308A9CE6; Mon, 24 Feb 2014 02:38:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 199332000; Mon, 24 Feb 2014 02:38:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1O2cjuJ064844; Mon, 24 Feb 2014 02:38:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1O2ciSF064838; Mon, 24 Feb 2014 02:38:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402240238.s1O2ciSF064838@svn.freebsd.org> From: Adrian Chadd Date: Mon, 24 Feb 2014 02:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262423 - in head/tools/tools/iwn: . iwnstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 02:38:45 -0000 Author: adrian Date: Mon Feb 24 02:38:43 2014 New Revision: 262423 URL: http://svnweb.freebsd.org/changeset/base/262423 Log: Add a very basic and totally hacked up iwnstats program. This just extracts the current statistics out from the NIC via the new ioctl API and displays them. It runs every 100ms to hopefully grab the latest statistics. I may eventually teach this to use libstatfoo like what has been done for athstats and such; but this is good enough for now for people to do some basic investigation. Tested: * Intel Centrino 6205 Added: head/tools/tools/iwn/ head/tools/tools/iwn/Makefile (contents, props changed) head/tools/tools/iwn/iwnstats/ head/tools/tools/iwn/iwnstats/Makefile (contents, props changed) head/tools/tools/iwn/iwnstats/iwn_ioctl.c (contents, props changed) head/tools/tools/iwn/iwnstats/iwn_ioctl.h (contents, props changed) head/tools/tools/iwn/iwnstats/iwnstats.h (contents, props changed) head/tools/tools/iwn/iwnstats/main.c (contents, props changed) Added: head/tools/tools/iwn/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/iwn/Makefile Mon Feb 24 02:38:43 2014 (r262423) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR= iwnstats + +.include Added: head/tools/tools/iwn/iwnstats/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/iwn/iwnstats/Makefile Mon Feb 24 02:38:43 2014 (r262423) @@ -0,0 +1,22 @@ +# $FreeBSD$ + +NO_MAN=1 + +.include + +.PATH: ${.CURDIR}/../../../../sys/dev/iwn/ + +CFLAGS+=-I${.CURDIR}/../../../../sys/dev/iwn/ +CFLAGS+=-I${.CURDIR}/../../../../sys/ + +PROG= iwnstats + +# Because of a clang preprocessor parser limitation causing this +# to not compile, use gcc for now. +#CC= gcc + +SRCS= main.c iwn_ioctl.c + +# CFLAGS.clang+= -fbracket-depth=512 + +.include Added: head/tools/tools/iwn/iwnstats/iwn_ioctl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/iwn/iwnstats/iwn_ioctl.c Mon Feb 24 02:38:43 2014 (r262423) @@ -0,0 +1,91 @@ +/*- + * Copyright (c) 2014 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ + +/* + * iwn ioctl API. + */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + + +#include "net80211/ieee80211_ioctl.h" +#include "net80211/ieee80211_radiotap.h" + +#include "if_iwn_ioctl.h" + +/* + * This contains the register definitions for iwn; including + * the statistics definitions. + */ +#include "if_iwnreg.h" + +#include "iwnstats.h" + +#include "iwn_ioctl.h" + +void +iwn_setifname(struct iwnstats *is, const char *ifname) +{ + + strncpy(is->ifr.ifr_name, ifname, sizeof (is->ifr.ifr_name)); +} + +void +iwn_zerostats(struct iwnstats *is) +{ + + if (ioctl(is->s, SIOCZIWNSTATS, &is->ifr) < 0) + err(-1, "ioctl: %s", is->ifr.ifr_name); +} + +int +iwn_collect(struct iwnstats *is) +{ + int err; + + is->ifr.ifr_data = (caddr_t) &is->st; + err = ioctl(is->s, SIOCGIWNSTATS, &is->ifr); + if (err < 0) + warn("ioctl: %s", is->ifr.ifr_name); + return (err); +} Added: head/tools/tools/iwn/iwnstats/iwn_ioctl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/iwn/iwnstats/iwn_ioctl.h Mon Feb 24 02:38:43 2014 (r262423) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2014 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ +#ifndef __IWN_IOCTL_H__ +#define __IWN_IOCTL_H__ + +extern void iwn_setifname(struct iwnstats *is, const char *ifname); +extern void iwn_zerostats(struct iwnstats *is); +extern int iwn_collect(struct iwnstats *is); + +#endif /* __IWN_IOCTL_H__ */ Added: head/tools/tools/iwn/iwnstats/iwnstats.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/iwn/iwnstats/iwnstats.h Mon Feb 24 02:38:43 2014 (r262423) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2014 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ +#ifndef __IWNSTATS_H__ +#define __IWNSTATS_H__ + +struct iwnstats { + int s; + struct ifreq ifr; + struct iwn_stats st; +}; + +#endif /* __IWNSTATS_H__ */ Added: head/tools/tools/iwn/iwnstats/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/iwn/iwnstats/main.c Mon Feb 24 02:38:43 2014 (r262423) @@ -0,0 +1,282 @@ +/*- + * Copyright (c) 2014 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "net80211/ieee80211_ioctl.h" +#include "net80211/ieee80211_radiotap.h" + +#include "if_iwn_ioctl.h" +#include "if_iwnreg.h" +#include "iwnstats.h" +#include "iwn_ioctl.h" + +#define IWN_DEFAULT_IF "iwn0" + +struct iwnstats * +iwnstats_new(const char *ifname) +{ + struct iwnstats *is; + + is = calloc(1, sizeof(struct iwnstats)); + if (is == NULL) + return (NULL); + + is->s = socket(AF_INET, SOCK_DGRAM, 0); + if (is->s < 0) + err(1, "socket"); + + iwn_setifname(is, ifname); + return (is); +} + +static void +iwn_stats_phy_print(struct iwnstats *is, struct iwn_rx_phy_stats *rxphy, + const char *prefix) +{ + + printf("%s: %s: ina=%d, fina=%d, bad_plcp=%d, bad_crc32=%d, overrun=%d, eoverrun=%d\n", + __func__, + prefix, + le32toh(rxphy->ina), + le32toh(rxphy->fina), + le32toh(rxphy->bad_plcp), + le32toh(rxphy->bad_crc32), + le32toh(rxphy->overrun), + le32toh(rxphy->eoverrun)); + + printf("%s: %s: fa=%d, bad_fina_sync=%d, sfd_timeout=%d, fina_timeout=%d, no_rts_ack=%d\n", + __func__, + prefix, + le32toh(rxphy->fa), + le32toh(rxphy->bad_fina_sync), + le32toh(rxphy->sfd_timeout), + le32toh(rxphy->fina_timeout), + le32toh(rxphy->no_rts_ack)); + + printf("%s: %s: rxe_limit=%d, ack=%d, cts=%d, ba_resp=%d, dsp_kill=%d, bad_mh=%d, rssi_sum=%d\n", + __func__, + prefix, + le32toh(rxphy->rxe_limit), + le32toh(rxphy->ack), + le32toh(rxphy->cts), + le32toh(rxphy->ba_resp), + le32toh(rxphy->dsp_kill), + le32toh(rxphy->bad_mh), + le32toh(rxphy->rssi_sum)); +} + +static void +iwn_stats_rx_general_print(struct iwnstats *is, struct iwn_rx_general_stats *g) +{ + + printf("%s: bad_cts=%d, bad_ack=%d, not_bss=%d, filtered=%d, bad_chan=%d, beacons=%d\n", + __func__, + le32toh(g->bad_cts), + le32toh(g->bad_ack), + le32toh(g->not_bss), + le32toh(g->filtered), + le32toh(g->bad_chan), + le32toh(g->beacons)); + + /* XXX it'd be nice to have adc/ina saturated as a % of time */ + printf("%s: missed_beacons=%d, adc_saturated=%d, ina_searched=%d\n", + __func__, + le32toh(g->missed_beacons), + le32toh(g->adc_saturated), + le32toh(g->ina_searched)); + + printf("%s: noise=[%d, %d, %d] flags=0x%08x, load=%d, fa=%d\n", + __func__, + le32toh(g->noise[0]), + le32toh(g->noise[1]), + le32toh(g->noise[2]), + le32toh(g->flags), + le32toh(g->load), + le32toh(g->fa)); + + printf("%s: rssi=[%d, %d, %d] energy=[%d %d %d]\n", + __func__, + le32toh(g->rssi[0]), + le32toh(g->rssi[1]), + le32toh(g->rssi[2]), + le32toh(g->energy[0]), + le32toh(g->energy[1]), + le32toh(g->energy[2])); +} + +static void +iwn_stats_tx_print(struct iwnstats *is, struct iwn_tx_stats *tx) +{ + + printf("%s: preamble=%d, rx_detected=%d, bt_defer=%d, bt_kill=%d, short_len=%d\n", + __func__, + le32toh(tx->preamble), + le32toh(tx->rx_detected), + le32toh(tx->bt_defer), + le32toh(tx->bt_kill), + le32toh(tx->short_len)); + + printf("%s: cts_timeout=%d, ack_timeout=%d, exp_ack=%d, ack=%d, msdu=%d\n", + __func__, + le32toh(tx->cts_timeout), + le32toh(tx->ack_timeout), + le32toh(tx->exp_ack), + le32toh(tx->ack), + le32toh(tx->msdu)); + + printf("%s: burst_err1=%d, burst_err2=%d, cts_collision=%d, ack_collision=%d\n", + __func__, + le32toh(tx->burst_err1), + le32toh(tx->burst_err2), + le32toh(tx->cts_collision), + le32toh(tx->ack_collision)); + + printf("%s: ba_timeout=%d, ba_resched=%d, query_ampdu=%d, query=%d, query_ampdu_frag=%d\n", + __func__, + le32toh(tx->ba_timeout), + le32toh(tx->ba_resched), + le32toh(tx->query_ampdu), + le32toh(tx->query), + le32toh(tx->query_ampdu_frag)); + + printf("%s: query_mismatch=%d, not_ready=%d, underrun=%d, bt_ht_kill=%d, rx_ba_resp=%d\n", + __func__, + le32toh(tx->query_mismatch), + le32toh(tx->not_ready), + le32toh(tx->underrun), + le32toh(tx->bt_ht_kill), + le32toh(tx->rx_ba_resp)); +} + +static void +iwn_stats_ht_phy_print(struct iwnstats *is, struct iwn_rx_ht_phy_stats *ht) +{ + + printf("%s: bad_plcp=%d, overrun=%d, eoverrun=%d, good_crc32=%d, bad_crc32=%d\n", + __func__, + le32toh(ht->bad_plcp), + le32toh(ht->overrun), + le32toh(ht->eoverrun), + le32toh(ht->good_crc32), + le32toh(ht->bad_crc32)); + + printf("%s: bad_mh=%d, good_ampdu_crc32=%d, ampdu=%d, fragment=%d\n", + __func__, + le32toh(ht->bad_plcp), + le32toh(ht->good_ampdu_crc32), + le32toh(ht->ampdu), + le32toh(ht->fragment)); +} + + +static void +iwn_stats_general_print(struct iwnstats *is, struct iwn_stats *stats) +{ + + /* General */ + printf("%s: temp=%d, temp_m=%d, burst_check=%d, burst=%d, sleep=%d, slot_out=%d, slot_idle=%d\n", + __func__, + le32toh(stats->general.temp), + le32toh(stats->general.temp_m), + le32toh(stats->general.burst_check), + le32toh(stats->general.burst), + le32toh(stats->general.sleep), + le32toh(stats->general.slot_out), + le32toh(stats->general.slot_idle)); + printf("%s: slot_out=%d, ttl_tstamp=0x%08x, tx_ant_a=%d, tx_ant_b=%d, exec=%d, probe=%d\n", + __func__, + le32toh(stats->general.slot_out), + le32toh(stats->general.ttl_tstamp), + le32toh(stats->general.tx_ant_a), + le32toh(stats->general.tx_ant_b), + le32toh(stats->general.exec), + le32toh(stats->general.probe)); + printf("%s: rx_enabled=%d\n", + __func__, + le32toh(stats->general.rx_enabled)); +} + +static void +iwn_print(struct iwnstats *is) +{ + struct iwn_stats *s; + + s = &is->st; + + iwn_stats_general_print(is, s); + + /* RX */ + iwn_stats_phy_print(is, &s->rx.ofdm, "ofdm"); + iwn_stats_phy_print(is, &s->rx.cck, "cck"); + iwn_stats_ht_phy_print(is, &s->rx.ht); + iwn_stats_rx_general_print(is, &s->rx.general); + + /* TX */ + iwn_stats_tx_print(is, &s->tx); + printf("--\n"); +} + +int +main(int argc, const char *argv[]) +{ + struct iwnstats *is; + + is = iwnstats_new(IWN_DEFAULT_IF); + + if (is == NULL) { + fprintf(stderr, "%s: couldn't allocate new stats structure\n", + argv[0]); + exit(127); + } + + /* begin fetching data */ + while (1) { + if (iwn_collect(is) != 0) { + fprintf(stderr, "%s: fetch failed\n", argv[0]); + goto next; + } + + iwn_print(is); + + next: + usleep(100 * 1000); + } + + exit(0); +} From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 02:44:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36A66E67; Mon, 24 Feb 2014 02:44:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 16B0010B6; Mon, 24 Feb 2014 02:44:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1O2hxAG068209; Mon, 24 Feb 2014 02:43:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1O2hwVb068203; Mon, 24 Feb 2014 02:43:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402240243.s1O2hwVb068203@svn.freebsd.org> From: Adrian Chadd Date: Mon, 24 Feb 2014 02:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262424 - head/usr.sbin/pmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 02:44:00 -0000 Author: adrian Date: Mon Feb 24 02:43:58 2014 New Revision: 262424 URL: http://svnweb.freebsd.org/changeset/base/262424 Log: Add a new option - 'a ' - which spits out annotated callgraphs. '-m ' spits out the given stream into (eg, /dev/stdout). However, it only resolves the first symbol; it doesn't parse the entire callgraph. If it fails to lookup then it doesn't print anything. '-a' instead does a symbol and file:line lookup for each address in each callgraph and will happily print the address itself with no lookup information if it couldn't look things up. This makes it much easier to pull out individual records from a pmc data file and look at the callgraph information without having to hand-decode the addresses. Sponsored by: Netflix, Inc. Added: head/usr.sbin/pmcstat/pmcpl_annotate_cg.c (contents, props changed) head/usr.sbin/pmcstat/pmcpl_annotate_cg.h (contents, props changed) Modified: head/usr.sbin/pmcstat/Makefile head/usr.sbin/pmcstat/pmcstat.c head/usr.sbin/pmcstat/pmcstat.h head/usr.sbin/pmcstat/pmcstat_log.c Modified: head/usr.sbin/pmcstat/Makefile ============================================================================== --- head/usr.sbin/pmcstat/Makefile Mon Feb 24 02:38:43 2014 (r262423) +++ head/usr.sbin/pmcstat/Makefile Mon Feb 24 02:43:58 2014 (r262424) @@ -9,6 +9,7 @@ DPADD= ${LIBELF} ${LIBKVM} ${LIBPMC} ${L LDADD= -lelf -lkvm -lpmc -lm -lncurses SRCS= pmcstat.c pmcstat.h pmcstat_log.c \ -pmcpl_callgraph.c pmcpl_gprof.c pmcpl_annotate.c pmcpl_calltree.c +pmcpl_callgraph.c pmcpl_gprof.c pmcpl_annotate.c \ +pmcpl_annotate_cg.c pmcpl_calltree.c .include Added: head/usr.sbin/pmcstat/pmcpl_annotate_cg.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pmcstat/pmcpl_annotate_cg.c Mon Feb 24 02:43:58 2014 (r262424) @@ -0,0 +1,126 @@ +/*- + * Copyright (c) 2005-2007, Joseph Koshy + * Copyright (c) 2007 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by A. Joseph Koshy under + * sponsorship from the FreeBSD Foundation and Google, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Transform a hwpmc(4) log into human readable form, and into + * gprof(1) compatible profiles. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pmcstat.h" +#include "pmcstat_log.h" +#include "pmcpl_annotate_cg.h" + +/* + * Record a callchain. + */ + +void +pmcpl_annotate_cg_process(struct pmcstat_process *pp, struct pmcstat_pmcrecord *pmcr, + uint32_t nsamples, uintfptr_t *cc, int usermode, uint32_t cpu) +{ + struct pmcstat_pcmap *map; + struct pmcstat_symbol *sym; + uintfptr_t newpc; + struct pmcstat_image *image; + int i; + char filename[PATH_MAX], funcname[PATH_MAX]; + unsigned sline; + + (void) pmcr; (void) nsamples; (void) usermode; (void) cpu; + + for (i = 0; i < (int) nsamples; i++) { + map = NULL; + sym = NULL; + image = NULL; + filename[0] = '\0'; + funcname[0] = '\0'; + sline = 0; + + map = pmcstat_process_find_map(usermode ? pp : pmcstat_kernproc, cc[i]); + if (map != NULL) { + assert(cc[i] >= map->ppm_lowpc && cc[i] < map->ppm_highpc); + image = map->ppm_image; + newpc = cc[i] - (map->ppm_lowpc + + (image->pi_vaddr - image->pi_start)); + sym = pmcstat_symbol_search(image, newpc); + } + + if (map != NULL && image != NULL && sym != NULL) { + (void) pmcstat_image_addr2line(image, cc[i], + filename, sizeof(filename), &sline, funcname, sizeof(funcname)); + } + + if (map != NULL && sym != NULL) { + fprintf(args.pa_graphfile, "%p %s %s:%d\n", + (void *)cc[i], + funcname, + filename, + sline); + } else { + fprintf(args.pa_graphfile, "%p ??:0\n", + (void *) cc[i]); + } + } + fprintf(args.pa_graphfile, "--\n"); +} Added: head/usr.sbin/pmcstat/pmcpl_annotate_cg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pmcstat/pmcpl_annotate_cg.h Mon Feb 24 02:43:58 2014 (r262424) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2005-2007, Joseph Koshy + * Copyright (c) 2007 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by A. Joseph Koshy under + * sponsorship from the FreeBSD Foundation and Google, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _PMCSTAT_PL_ANNOTATE_CG_H_ +#define _PMCSTAT_PL_ANNOTATE_CG_H_ + +/* Function prototypes */ +void pmcpl_annotate_cg_process( + struct pmcstat_process *pp, struct pmcstat_pmcrecord *pmcr, + uint32_t nsamples, uintfptr_t *cc, int usermode, uint32_t cpu); + +#endif /* _PMCSTAT_PL_ANNOTATE_CG_H_ */ Modified: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Mon Feb 24 02:38:43 2014 (r262423) +++ head/usr.sbin/pmcstat/pmcstat.c Mon Feb 24 02:43:58 2014 (r262424) @@ -503,6 +503,7 @@ pmcstat_show_usage(void) "\t -S spec\t allocate a system-wide sampling PMC\n" "\t -T\t\t start in top mode\n" "\t -W\t\t (toggle) show counts per context switch\n" + "\t -a \t print sampled PCs and callgraph to \"file\"\n" "\t -c cpu-list\t set cpus for subsequent system-wide PMCs\n" "\t -d\t\t (toggle) track descendants\n" "\t -f spec\t pass \"spec\" to as plugin option\n" @@ -617,8 +618,14 @@ main(int argc, char **argv) CPU_SET(hcpu, &cpumask); while ((option = getopt(argc, argv, - "CD:EF:G:M:NO:P:R:S:TWc:df:gk:m:n:o:p:qr:s:t:vw:z:")) != -1) + "CD:EF:G:M:NO:P:R:S:TWa:c:df:gk:m:n:o:p:qr:s:t:vw:z:")) != -1) switch (option) { + case 'a': /* Annotate + callgraph */ + args.pa_flags |= FLAG_DO_ANNOTATE; + args.pa_plugin = PMCSTAT_PL_ANNOTATE_CG; + graphfilename = optarg; + break; + case 'C': /* cumulative values */ use_cumulative_counts = !use_cumulative_counts; args.pa_required |= FLAG_HAS_COUNTING_PMCS; @@ -917,7 +924,8 @@ main(int argc, char **argv) /* -m option is allowed with -R only. */ if (args.pa_flags & FLAG_DO_ANNOTATE && args.pa_inputpath == NULL) - errx(EX_USAGE, "ERROR: option -m requires an input file"); + errx(EX_USAGE, "ERROR: option %s requires an input file", + args.pa_plugin == PMCSTAT_PL_ANNOTATE ? "-m" : "-a"); /* -m option is not allowed combined with -g or -G. */ if (args.pa_flags & FLAG_DO_ANNOTATE && Modified: head/usr.sbin/pmcstat/pmcstat.h ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.h Mon Feb 24 02:38:43 2014 (r262423) +++ head/usr.sbin/pmcstat/pmcstat.h Mon Feb 24 02:43:58 2014 (r262424) @@ -91,6 +91,7 @@ #define PMCSTAT_PL_GPROF 2 #define PMCSTAT_PL_ANNOTATE 3 #define PMCSTAT_PL_CALLTREE 4 +#define PMCSTAT_PL_ANNOTATE_CG 5 #define PMCSTAT_TOP_DELTA 0 #define PMCSTAT_TOP_ACCUM 1 Modified: head/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat_log.c Mon Feb 24 02:38:43 2014 (r262423) +++ head/usr.sbin/pmcstat/pmcstat_log.c Mon Feb 24 02:43:58 2014 (r262424) @@ -149,6 +149,7 @@ struct pmcstat_process *pmcstat_kernproc #include "pmcpl_gprof.h" #include "pmcpl_callgraph.h" #include "pmcpl_annotate.h" +#include "pmcpl_annotate_cg.h" #include "pmcpl_calltree.h" static struct pmc_plugins { @@ -214,6 +215,11 @@ static struct pmc_plugins { .pl_topdisplay = pmcpl_ct_topdisplay }, { + .pl_name = "annotate_cg", + .pl_process = pmcpl_annotate_cg_process + }, + + { .pl_name = NULL } }; From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 02:47:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45BCBFC6; Mon, 24 Feb 2014 02:47:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3207810C9; Mon, 24 Feb 2014 02:47:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1O2lmCp068748; Mon, 24 Feb 2014 02:47:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1O2llbu068746; Mon, 24 Feb 2014 02:47:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402240247.s1O2llbu068746@svn.freebsd.org> From: Adrian Chadd Date: Mon, 24 Feb 2014 02:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262425 - head/usr.sbin/pmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 02:47:48 -0000 Author: adrian Date: Mon Feb 24 02:47:47 2014 New Revision: 262425 URL: http://svnweb.freebsd.org/changeset/base/262425 Log: Add correct attributions. Sponsored by: Netflix, Inc. Modified: head/usr.sbin/pmcstat/pmcpl_annotate_cg.c head/usr.sbin/pmcstat/pmcpl_annotate_cg.h Modified: head/usr.sbin/pmcstat/pmcpl_annotate_cg.c ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_annotate_cg.c Mon Feb 24 02:43:58 2014 (r262424) +++ head/usr.sbin/pmcstat/pmcpl_annotate_cg.c Mon Feb 24 02:47:47 2014 (r262425) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2005-2007, Joseph Koshy * Copyright (c) 2007 The FreeBSD Foundation + * Copyright (c) 2014, Adrian Chadd, Netflix Inc. * All rights reserved. * * Portions of this software were developed by A. Joseph Koshy under Modified: head/usr.sbin/pmcstat/pmcpl_annotate_cg.h ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_annotate_cg.h Mon Feb 24 02:43:58 2014 (r262424) +++ head/usr.sbin/pmcstat/pmcpl_annotate_cg.h Mon Feb 24 02:47:47 2014 (r262425) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2005-2007, Joseph Koshy * Copyright (c) 2007 The FreeBSD Foundation + * Copyright (c) 2014, Adrian Chadd, Netflix Inc. * All rights reserved. * * Portions of this software were developed by A. Joseph Koshy under From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 03:47:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6389CEC; Mon, 24 Feb 2014 03:47:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C21AF19F1; Mon, 24 Feb 2014 03:47:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1O3ldkx093537; Mon, 24 Feb 2014 03:47:39 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1O3ldtt093536; Mon, 24 Feb 2014 03:47:39 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402240347.s1O3ldtt093536@svn.freebsd.org> From: Ian Lepore Date: Mon, 24 Feb 2014 03:47:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262426 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 03:47:39 -0000 Author: ian Date: Mon Feb 24 03:47:39 2014 New Revision: 262426 URL: http://svnweb.freebsd.org/changeset/base/262426 Log: Invalidate caches immediately upon entry to init_secondary(). Also set the Bufferable bit in the PDE entries of the secondary processor startup pagetables. The caches really need to be invalidated even earlier than this, but this is a big step in the right direction. The invalidate needs to happen before the MMU is enabled, which means it has to be called from asm code that's running with physical addressing. Fixing that will be handled in a future change. Modified: head/sys/arm/arm/mp_machdep.c Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Mon Feb 24 02:47:47 2014 (r262425) +++ head/sys/arm/arm/mp_machdep.c Mon Feb 24 03:47:39 2014 (r262426) @@ -128,10 +128,10 @@ cpu_mp_start(void) bzero((void *)temp_pagetable_va, L1_TABLE_SIZE); for (addr = arm_physmem_kernaddr; addr <= addr_end; addr += L1_S_SIZE) { ((int *)(temp_pagetable_va))[addr >> L1_S_SHIFT] = - L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)|L1_S_DOM(PMAP_DOMAIN_KERNEL)|addr; + L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_B|L1_S_AP(AP_KRW)|L1_S_DOM(PMAP_DOMAIN_KERNEL)|addr; ((int *)(temp_pagetable_va))[(addr - arm_physmem_kernaddr + KERNVIRTADDR) >> L1_S_SHIFT] = - L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)|L1_S_DOM(PMAP_DOMAIN_KERNEL)|addr; + L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_B|L1_S_AP(AP_KRW)|L1_S_DOM(PMAP_DOMAIN_KERNEL)|addr; } #if defined(CPU_MV_PJ4B) @@ -173,6 +173,8 @@ init_secondary(int cpu) uint32_t loop_counter; int start = 0, end = 0; + cpu_idcache_inv_all(); + cpu_setup(NULL); setttb(pmap_pa); cpu_tlb_flushID(); From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 03:51:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 211D1E78; Mon, 24 Feb 2014 03:51:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0AA5D1A74; Mon, 24 Feb 2014 03:51:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1O3pVu0096724; Mon, 24 Feb 2014 03:51:31 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1O3pVIO096718; Mon, 24 Feb 2014 03:51:31 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402240351.s1O3pVIO096718@svn.freebsd.org> From: Ian Lepore Date: Mon, 24 Feb 2014 03:51:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262427 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 03:51:32 -0000 Author: ian Date: Mon Feb 24 03:51:31 2014 New Revision: 262427 URL: http://svnweb.freebsd.org/changeset/base/262427 Log: Add the bits needed to run SMP on imx6. The 'option SMP' isn't added to the kernel config yet; people wanting to test this have to opt-in for now. Added: head/sys/arm/freescale/imx/imx6_mp.c (contents, props changed) Modified: head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/imx/std.imx6 Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Mon Feb 24 03:47:39 2014 (r262426) +++ head/sys/arm/freescale/imx/files.imx6 Mon Feb 24 03:51:31 2014 (r262427) @@ -22,6 +22,7 @@ arm/freescale/imx/common.c standard arm/freescale/imx/imx6_anatop.c standard arm/freescale/imx/imx6_ccm.c standard arm/freescale/imx/imx6_machdep.c standard +arm/freescale/imx/imx6_mp.c optional smp arm/freescale/imx/imx6_pl310.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx_gpt.c standard Added: head/sys/arm/freescale/imx/imx6_mp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_mp.c Mon Feb 24 03:51:31 2014 (r262427) @@ -0,0 +1,166 @@ +/*- + * Copyright (c) 2014 Juergen Weiss + * Copyright (c) 2014 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define SCU_PHYSBASE 0x00a00000 +#define SCU_SIZE 0x00001000 + +#define SCU_CONTROL_REG 0x00 +#define SCU_CONTROL_ENABLE (1 << 0) +#define SCU_CONFIG_REG 0x04 +#define SCU_CONFIG_REG_NCPU_MASK 0x03 +#define SCU_CPUPOWER_REG 0x08 +#define SCU_INV_TAGS_REG 0x0c +#define SCU_DIAG_CONTROL 0x30 +#define SCU_DIAG_DISABLE_MIGBIT (1 << 0) +#define SCU_FILTER_START_REG 0x40 +#define SCU_FILTER_END_REG 0x44 +#define SCU_SECURE_ACCESS_REG 0x50 +#define SCU_NONSECURE_ACCESS_REG 0x54 + +#define SRC_PHYSBASE 0x020d8000 +#define SRC_SIZE 0x4000 +#define SRC_CONTROL_REG 0x00 +#define SRC_CONTROL_C1ENA_SHIFT 22 /* Bit for Core 1 enable */ +#define SRC_CONTROL_C1RST_SHIFT 14 /* Bit for Core 1 reset */ +#define SRC_GPR0_C1FUNC 0x20 /* Register for Core 1 entry func */ +#define SRC_GPR1_C1ARG 0x24 /* Register for Core 1 entry arg */ + +void +platform_mp_init_secondary(void) +{ + + gic_init_secondary(); +} + +void +platform_mp_setmaxid(void) +{ + bus_space_handle_t scu; + uint32_t val; + + /* If we've already set the global vars don't bother to do it again. */ + if (mp_ncpus != 0) + return; + + if (bus_space_map(fdtbus_bs_tag, SCU_PHYSBASE, SCU_SIZE, 0, &scu) != 0) + panic("Couldn't map the SCU\n"); + val = bus_space_read_4(fdtbus_bs_tag, scu, SCU_CONFIG_REG); + bus_space_unmap(fdtbus_bs_tag, scu, SCU_SIZE); + + mp_maxid = (val & SCU_CONFIG_REG_NCPU_MASK); + mp_ncpus = mp_maxid + 1; +} + +int +platform_mp_probe(void) +{ + + /* I think platform_mp_setmaxid must get called first, but be safe. */ + if (mp_ncpus == 0) + platform_mp_setmaxid(); + + return (mp_ncpus > 1); +} + +void +platform_mp_start_ap(void) +{ + bus_space_handle_t scu; + bus_space_handle_t src; + + uint32_t val; + int i; + + if (bus_space_map(fdtbus_bs_tag, SCU_PHYSBASE, SCU_SIZE, 0, &scu) != 0) + panic("Couldn't map the SCU\n"); + if (bus_space_map(fdtbus_bs_tag, SRC_PHYSBASE, SRC_SIZE, 0, &src) != 0) + panic("Couldn't map the system reset controller (SRC)\n"); + + /* + * Invalidate SCU cache tags. The 0x0000fff0 constant invalidates all + * ways on all cores 1-3 (leaving core 0 alone). Per the ARM docs, it's + * harmless to write to the bits for cores that are not present. + */ + bus_space_write_4(fdtbus_bs_tag, scu, SCU_INV_TAGS_REG, 0x0000fff0); + + /* + * Erratum ARM/MP: 764369 (problems with cache maintenance). + * Setting the "disable-migratory bit" in the undocumented SCU + * Diagnostic Control Register helps work around the problem. + */ + val = bus_space_read_4(fdtbus_bs_tag, scu, SCU_DIAG_CONTROL); + bus_space_write_4(fdtbus_bs_tag, scu, SCU_DIAG_CONTROL, + val | SCU_DIAG_DISABLE_MIGBIT); + + /* Enable the SCU. */ + val = bus_space_read_4(fdtbus_bs_tag, scu, SCU_CONTROL_REG); + bus_space_write_4(fdtbus_bs_tag, scu, SCU_CONTROL_REG, + val | SCU_CONTROL_ENABLE); + + cpu_idcache_wbinv_all(); + cpu_l2cache_wbinv_all(); + + /* + * For each AP core, set the entry point address and argument registers, + * and set the core-enable and core-reset bits in the control register. + */ + val = bus_space_read_4(fdtbus_bs_tag, src, SRC_CONTROL_REG); + for (i=1; i < mp_ncpus; i++) { + bus_space_write_4(fdtbus_bs_tag, src, SRC_GPR0_C1FUNC + 8*i, + pmap_kextract((vm_offset_t)mpentry)); + bus_space_write_4(fdtbus_bs_tag, src, SRC_GPR1_C1ARG + 8*i, 0); + + val |= ((1 << (SRC_CONTROL_C1ENA_SHIFT - 1 + i )) | + ( 1 << (SRC_CONTROL_C1RST_SHIFT - 1 + i))); + + } + bus_space_write_4(fdtbus_bs_tag, src, 0, val); + + armv7_sev(); + + bus_space_unmap(fdtbus_bs_tag, scu, SCU_SIZE); + bus_space_unmap(fdtbus_bs_tag, src, SRC_SIZE); +} + +void +platform_ipi_send(cpuset_t cpus, u_int ipi) +{ + + pic_ipi_send(cpus, ipi); +} Modified: head/sys/arm/freescale/imx/std.imx6 ============================================================================== --- head/sys/arm/freescale/imx/std.imx6 Mon Feb 24 03:47:39 2014 (r262426) +++ head/sys/arm/freescale/imx/std.imx6 Mon Feb 24 03:51:31 2014 (r262427) @@ -10,5 +10,8 @@ options KERNPHYSADDR = 0x12000000 makeoptions KERNPHYSADDR = 0x12000000 options PHYSADDR = 0x10000000 +options IPI_IRQ_START=0 +options IPI_IRQ_END=15 + files "../freescale/imx/files.imx6" From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 04:43:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DA967BA; Mon, 24 Feb 2014 04:43:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D40701FC5; Mon, 24 Feb 2014 04:43:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1O4hNdI016843; Mon, 24 Feb 2014 04:43:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1O4hNaJ016842; Mon, 24 Feb 2014 04:43:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402240443.s1O4hNaJ016842@svn.freebsd.org> From: Adrian Chadd Date: Mon, 24 Feb 2014 04:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262428 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 04:43:24 -0000 Author: adrian Date: Mon Feb 24 04:43:23 2014 New Revision: 262428 URL: http://svnweb.freebsd.org/changeset/base/262428 Log: * Ensure enough ports/phys are available for both the AR8327 and previous switches. * Add some new VLAN HAL methods that will be used by the VLAN configuration code. The AR933x and later switches use slightly different register layouts (even though the driver currently doesn't support it.) Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Mon Feb 24 03:51:31 2014 (r262427) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Mon Feb 24 04:43:23 2014 (r262428) @@ -45,6 +45,9 @@ typedef enum { #define AR8X16_IS_SWITCH(_sc, _type) \ (!!((_sc)->sc_switchtype == AR8X16_SWITCH_ ## _type)) +#define ARSWITCH_NUM_PORTS MAX(AR8327_NUM_PORTS, AR8X16_NUM_PORTS) +#define ARSWITCH_NUM_PHYS MAX(AR8327_NUM_PHYS, AR8X16_NUM_PHYS) + struct arswitch_softc { struct mtx sc_mtx; /* serialize access to softc */ device_t sc_dev; @@ -59,9 +62,10 @@ struct arswitch_softc { int chip_rev; int mii_lo_first; ar8x16_switch_type sc_switchtype; - char *ifname[AR8X16_NUM_PHYS]; - device_t miibus[AR8X16_NUM_PHYS]; - struct ifnet *ifp[AR8X16_NUM_PHYS]; + /* should be the max of both pre-AR8327 and AR8327 ports */ + char *ifname[ARSWITCH_NUM_PHYS]; + device_t miibus[ARSWITCH_NUM_PHYS]; + struct ifnet *ifp[ARSWITCH_NUM_PHYS]; struct callout callout_tick; etherswitch_info_t info; @@ -82,6 +86,15 @@ struct arswitch_softc { etherswitch_port_t *); int (* arswitch_port_vlan_get) (struct arswitch_softc *, etherswitch_port_t *); + void (* arswitch_vlan_init_hw) (struct arswitch_softc *); + int (* arswitch_vlan_getvgroup) (struct arswitch_softc *, + etherswitch_vlangroup_t *); + int (* arswitch_vlan_setvgroup) (struct arswitch_softc *, + etherswitch_vlangroup_t *); + int (* arswitch_vlan_get_pvid) (struct arswitch_softc *, int, + int *); + int (* arswitch_vlan_set_pvid) (struct arswitch_softc *, int, + int); } hal; }; From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 04:44:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A9D990E; Mon, 24 Feb 2014 04:44:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 176F11FD5; Mon, 24 Feb 2014 04:44:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1O4iSZO017038; Mon, 24 Feb 2014 04:44:28 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1O4iSJG017035; Mon, 24 Feb 2014 04:44:28 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402240444.s1O4iSJG017035@svn.freebsd.org> From: Adrian Chadd Date: Mon, 24 Feb 2014 04:44:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262429 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 04:44:29 -0000 Author: adrian Date: Mon Feb 24 04:44:28 2014 New Revision: 262429 URL: http://svnweb.freebsd.org/changeset/base/262429 Log: Methodize the arswitch VLAN routines. These differ per chipset family in subtle and evil ways. It becomes very noticable on the AR8327 where the layout is just plain wrong. Modified: head/sys/dev/etherswitch/arswitch/arswitch.c head/sys/dev/etherswitch/arswitch/arswitch_vlans.c head/sys/dev/etherswitch/arswitch/arswitch_vlans.h Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Mon Feb 24 04:43:23 2014 (r262428) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Mon Feb 24 04:44:28 2014 (r262429) @@ -222,7 +222,7 @@ arswitch_set_vlan_mode(struct arswitch_s }; /* Reset VLANs. */ - arswitch_reset_vlans(sc); + sc->hal.arswitch_vlan_init_hw(sc); return (0); } @@ -274,6 +274,11 @@ arswitch_attach(device_t dev) sc->hal.arswitch_port_init = ar8xxx_port_init; sc->hal.arswitch_port_vlan_setup = ar8xxx_port_vlan_setup; sc->hal.arswitch_port_vlan_get = ar8xxx_port_vlan_get; + sc->hal.arswitch_vlan_init_hw = ar8xxx_reset_vlans; + sc->hal.arswitch_vlan_getvgroup = ar8xxx_getvgroup; + sc->hal.arswitch_vlan_setvgroup = ar8xxx_setvgroup; + sc->hal.arswitch_vlan_get_pvid = ar8xxx_get_pvid; + sc->hal.arswitch_vlan_set_pvid = ar8xxx_set_pvid; /* * Attach switch related functions @@ -538,7 +543,7 @@ ar8xxx_port_vlan_get(struct arswitch_sof ARSWITCH_LOCK(sc); /* Retrieve the PVID. */ - arswitch_get_pvid(sc, p->es_port, &p->es_pvid); + sc->hal.arswitch_vlan_get_pvid(sc, p->es_port, &p->es_pvid); /* Port flags. */ reg = arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(p->es_port)); @@ -602,7 +607,7 @@ ar8xxx_port_vlan_setup(struct arswitch_s /* Set the PVID. */ if (p->es_pvid != 0) - arswitch_set_pvid(sc, p->es_port, p->es_pvid); + sc->hal.arswitch_vlan_set_pvid(sc, p->es_port, p->es_pvid); /* Mutually exclusive. */ if (p->es_flags & ETHERSWITCH_PORT_ADDTAG && @@ -730,6 +735,22 @@ arswitch_setconf(device_t dev, etherswit return (0); } +static int +arswitch_getvgroup(device_t dev, etherswitch_vlangroup_t *e) +{ + struct arswitch_softc *sc = device_get_softc(dev); + + return (sc->hal.arswitch_vlan_getvgroup(sc, e)); +} + +static int +arswitch_setvgroup(device_t dev, etherswitch_vlangroup_t *e) +{ + struct arswitch_softc *sc = device_get_softc(dev); + + return (sc->hal.arswitch_vlan_setvgroup(sc, e)); +} + static device_method_t arswitch_methods[] = { /* Device interface */ DEVMETHOD(device_probe, arswitch_probe), Modified: head/sys/dev/etherswitch/arswitch/arswitch_vlans.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_vlans.c Mon Feb 24 04:43:23 2014 (r262428) +++ head/sys/dev/etherswitch/arswitch/arswitch_vlans.c Mon Feb 24 04:44:28 2014 (r262429) @@ -171,7 +171,7 @@ arswitch_set_port_vlan(struct arswitch_s * Reset vlans to default state. */ void -arswitch_reset_vlans(struct arswitch_softc *sc) +ar8xxx_reset_vlans(struct arswitch_softc *sc) { uint32_t ports; int i, j; @@ -220,7 +220,7 @@ arswitch_reset_vlans(struct arswitch_sof sc->vid[0] = 1; /* Set PVID for everyone. */ for (i = 0; i <= sc->numphys; i++) - arswitch_set_pvid(sc, i, sc->vid[0]); + sc->hal.arswitch_vlan_set_pvid(sc, i, sc->vid[0]); ports = 0; for (i = 0; i <= sc->numphys; i++) ports |= (1 << i); @@ -259,12 +259,10 @@ arswitch_reset_vlans(struct arswitch_sof } int -arswitch_getvgroup(device_t dev, etherswitch_vlangroup_t *vg) +ar8xxx_getvgroup(struct arswitch_softc *sc, etherswitch_vlangroup_t *vg) { - struct arswitch_softc *sc; int err; - sc = device_get_softc(dev); ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); if (vg->es_vlangroup > sc->info.es_nvlangroups) @@ -305,12 +303,10 @@ arswitch_getvgroup(device_t dev, ethersw } int -arswitch_setvgroup(device_t dev, etherswitch_vlangroup_t *vg) +ar8xxx_setvgroup(struct arswitch_softc *sc, etherswitch_vlangroup_t *vg) { - struct arswitch_softc *sc; int err, vid; - sc = device_get_softc(dev); ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); /* Check VLAN mode. */ @@ -362,7 +358,7 @@ arswitch_setvgroup(device_t dev, ethersw } int -arswitch_get_pvid(struct arswitch_softc *sc, int port, int *pvid) +ar8xxx_get_pvid(struct arswitch_softc *sc, int port, int *pvid) { uint32_t reg; @@ -373,7 +369,7 @@ arswitch_get_pvid(struct arswitch_softc } int -arswitch_set_pvid(struct arswitch_softc *sc, int port, int pvid) +ar8xxx_set_pvid(struct arswitch_softc *sc, int port, int pvid) { ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); Modified: head/sys/dev/etherswitch/arswitch/arswitch_vlans.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_vlans.h Mon Feb 24 04:43:23 2014 (r262428) +++ head/sys/dev/etherswitch/arswitch/arswitch_vlans.h Mon Feb 24 04:44:28 2014 (r262429) @@ -29,10 +29,10 @@ #ifndef __ARSWITCH_VLANS_H__ #define __ARSWITCH_VLANS_H__ -void arswitch_reset_vlans(struct arswitch_softc *); -int arswitch_getvgroup(device_t, etherswitch_vlangroup_t *); -int arswitch_setvgroup(device_t, etherswitch_vlangroup_t *); -int arswitch_get_pvid(struct arswitch_softc *, int, int *); -int arswitch_set_pvid(struct arswitch_softc *, int, int); +void ar8xxx_reset_vlans(struct arswitch_softc *); +int ar8xxx_getvgroup(struct arswitch_softc *, etherswitch_vlangroup_t *); +int ar8xxx_setvgroup(struct arswitch_softc *, etherswitch_vlangroup_t *); +int ar8xxx_get_pvid(struct arswitch_softc *, int, int *); +int ar8xxx_set_pvid(struct arswitch_softc *, int, int); #endif /* __ARSWITCH_VLANS_H__ */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 04:47:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BEE25A65; Mon, 24 Feb 2014 04:47:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A91E81FE4; Mon, 24 Feb 2014 04:47:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1O4lHgW017389; Mon, 24 Feb 2014 04:47:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1O4lHO7017386; Mon, 24 Feb 2014 04:47:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402240447.s1O4lHO7017386@svn.freebsd.org> From: Adrian Chadd Date: Mon, 24 Feb 2014 04:47:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262430 - in head/sys: conf dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 04:47:17 -0000 Author: adrian Date: Mon Feb 24 04:47:16 2014 New Revision: 262430 URL: http://svnweb.freebsd.org/changeset/base/262430 Log: Add initial AR8327 support. This is (almost!) enough to actually probe, attach, configure a default port group and do some basic work. It's also totally hard-coded for the Qualcomm Atheros DB120 board - it doesn't yet have any of the code from OpenWRT which parses extra configuration data to know how to program the switch. The LED stuff is also missing. But, it's enough to facilitate board, PHY, switch and VLAN bringup, so I am committing it now. Tested: * Qualcomm Atheros DB120 Obtained from: OpenWRT Added: head/sys/dev/etherswitch/arswitch/arswitch_8327.c (contents, props changed) head/sys/dev/etherswitch/arswitch/arswitch_8327.h (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Feb 24 04:44:28 2014 (r262429) +++ head/sys/conf/files Mon Feb 24 04:47:16 2014 (r262430) @@ -1343,6 +1343,7 @@ dev/etherswitch/arswitch/arswitch_phy.c dev/etherswitch/arswitch/arswitch_8216.c optional arswitch dev/etherswitch/arswitch/arswitch_8226.c optional arswitch dev/etherswitch/arswitch/arswitch_8316.c optional arswitch +dev/etherswitch/arswitch/arswitch_8327.c optional arswitch dev/etherswitch/arswitch/arswitch_7240.c optional arswitch dev/etherswitch/arswitch/arswitch_9340.c optional arswitch dev/etherswitch/arswitch/arswitch_vlans.c optional arswitch Added: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Mon Feb 24 04:47:16 2014 (r262430) @@ -0,0 +1,473 @@ +/*- + * Copyright (c) 2011-2012 Stefan Bethke. + * Copyright (c) 2014 Adrian Chadd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include "mdio_if.h" +#include "miibus_if.h" +#include "etherswitch_if.h" + +static void +ar8327_phy_fixup(struct arswitch_softc *sc, int phy) +{ + + switch (sc->chip_rev) { + case 1: + /* For 100M waveform */ + arswitch_writedbg(sc->sc_dev, phy, 0, 0x02ea); + /* Turn on Gigabit clock */ + arswitch_writedbg(sc->sc_dev, phy, 0x3d, 0x68a0); + break; + + case 2: + arswitch_writemmd(sc->sc_dev, phy, 0x7, 0x3c); + arswitch_writemmd(sc->sc_dev, phy, 0x4007, 0x0); + /* fallthrough */ + case 4: + arswitch_writemmd(sc->sc_dev, phy, 0x3, 0x800d); + arswitch_writemmd(sc->sc_dev, phy, 0x4003, 0x803f); + + arswitch_writedbg(sc->sc_dev, phy, 0x3d, 0x6860); + arswitch_writedbg(sc->sc_dev, phy, 0x5, 0x2c46); + arswitch_writedbg(sc->sc_dev, phy, 0x3c, 0x6000); + break; + } +} + +static uint32_t +ar8327_get_pad_cfg(struct ar8327_pad_cfg *cfg) +{ + uint32_t t; + + if (!cfg) + return (0); + + t = 0; + switch (cfg->mode) { + case AR8327_PAD_NC: + break; + + case AR8327_PAD_MAC2MAC_MII: + t = AR8327_PAD_MAC_MII_EN; + if (cfg->rxclk_sel) + t |= AR8327_PAD_MAC_MII_RXCLK_SEL; + if (cfg->txclk_sel) + t |= AR8327_PAD_MAC_MII_TXCLK_SEL; + break; + + case AR8327_PAD_MAC2MAC_GMII: + t = AR8327_PAD_MAC_GMII_EN; + if (cfg->rxclk_sel) + t |= AR8327_PAD_MAC_GMII_RXCLK_SEL; + if (cfg->txclk_sel) + t |= AR8327_PAD_MAC_GMII_TXCLK_SEL; + break; + + case AR8327_PAD_MAC_SGMII: + t = AR8327_PAD_SGMII_EN; + + /* + * WAR for the QUalcomm Atheros AP136 board. + * It seems that RGMII TX/RX delay settings needs to be + * applied for SGMII mode as well, The ethernet is not + * reliable without this. + */ + t |= cfg->txclk_delay_sel << AR8327_PAD_RGMII_TXCLK_DELAY_SEL_S; + t |= cfg->rxclk_delay_sel << AR8327_PAD_RGMII_RXCLK_DELAY_SEL_S; + if (cfg->rxclk_delay_en) + t |= AR8327_PAD_RGMII_RXCLK_DELAY_EN; + if (cfg->txclk_delay_en) + t |= AR8327_PAD_RGMII_TXCLK_DELAY_EN; + + if (cfg->sgmii_delay_en) + t |= AR8327_PAD_SGMII_DELAY_EN; + + break; + + case AR8327_PAD_MAC2PHY_MII: + t = AR8327_PAD_PHY_MII_EN; + if (cfg->rxclk_sel) + t |= AR8327_PAD_PHY_MII_RXCLK_SEL; + if (cfg->txclk_sel) + t |= AR8327_PAD_PHY_MII_TXCLK_SEL; + break; + + case AR8327_PAD_MAC2PHY_GMII: + t = AR8327_PAD_PHY_GMII_EN; + if (cfg->pipe_rxclk_sel) + t |= AR8327_PAD_PHY_GMII_PIPE_RXCLK_SEL; + if (cfg->rxclk_sel) + t |= AR8327_PAD_PHY_GMII_RXCLK_SEL; + if (cfg->txclk_sel) + t |= AR8327_PAD_PHY_GMII_TXCLK_SEL; + break; + + case AR8327_PAD_MAC_RGMII: + t = AR8327_PAD_RGMII_EN; + t |= cfg->txclk_delay_sel << AR8327_PAD_RGMII_TXCLK_DELAY_SEL_S; + t |= cfg->rxclk_delay_sel << AR8327_PAD_RGMII_RXCLK_DELAY_SEL_S; + if (cfg->rxclk_delay_en) + t |= AR8327_PAD_RGMII_RXCLK_DELAY_EN; + if (cfg->txclk_delay_en) + t |= AR8327_PAD_RGMII_TXCLK_DELAY_EN; + break; + + case AR8327_PAD_PHY_GMII: + t = AR8327_PAD_PHYX_GMII_EN; + break; + + case AR8327_PAD_PHY_RGMII: + t = AR8327_PAD_PHYX_RGMII_EN; + break; + + case AR8327_PAD_PHY_MII: + t = AR8327_PAD_PHYX_MII_EN; + break; + } + + return (t); +} +/* + * Initialise the ar8327 specific hardware features from + * the hints provided in the boot environment. + */ +static int +ar8327_init_pdata(struct arswitch_softc *sc) +{ + struct ar8327_pad_cfg pc; + uint32_t t; + + /* XXX hard-coded DB120 defaults for now! */ + + /* Port 0 - rgmii; 1000/full */ + + /* Port 6 - ignore */ + + /* Pad 0 */ + bzero(&pc, sizeof(pc)); + pc.mode = AR8327_PAD_MAC_RGMII, + pc.txclk_delay_en = true, + pc.rxclk_delay_en = true, + pc.txclk_delay_sel = AR8327_CLK_DELAY_SEL1, + pc.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2, + + t = ar8327_get_pad_cfg(&pc); +#if 0 + if (AR8X16_IS_SWITCH(sc, AR8337)) + t |= AR8337_PAD_MAC06_EXCHANGE_EN; +#endif + arswitch_writereg(sc->sc_dev, AR8327_REG_PAD0_MODE, t); + + /* Pad 5 */ + bzero(&pc, sizeof(pc)); + t = ar8327_get_pad_cfg(&pc); + arswitch_writereg(sc->sc_dev, AR8327_REG_PAD5_MODE, t); + + /* Pad 6 */ + bzero(&pc, sizeof(pc)); + t = ar8327_get_pad_cfg(&pc); + arswitch_writereg(sc->sc_dev, AR8327_REG_PAD6_MODE, t); + + /* LED config */ + + /* SGMII config */ + return (0); +} + +#if 0 +/* + * Map the hard-coded port config from the switch setup to + * the chipset port config (status, duplex, flow, etc.) + */ +static uint32_t +ar8327_get_port_init_status(struct ar8327_port_cfg *cfg) +{ + uint32_t t; + + if (!cfg->force_link) + return (AR8X16_PORT_STS_LINK_AUTO); + + t = AR8X16_PORT_STS_TXMAC | AR8X16_PORT_STS_RXMAC; + t |= cfg->duplex ? AR8X16_PORT_STS_DUPLEX : 0; + t |= cfg->rxpause ? AR8X16_PORT_STS_RXFLOW : 0; + t |= cfg->txpause ? AR8X16_PORT_STS_TXFLOW : 0; + + switch (cfg->speed) { + case AR8327_PORT_SPEED_10: + t |= AR8X16_PORT_STS_SPEED_10; + break; + case AR8327_PORT_SPEED_100: + t |= AR8X16_PORT_STS_SPEED_100; + break; + case AR8327_PORT_SPEED_1000: + t |= AR8X16_PORT_STS_SPEED_1000; + break; + } + + return (t); +} +#endif + +static int +ar8327_hw_setup(struct arswitch_softc *sc) +{ + int i; + int err; + + /* pdata fetch and setup */ + err = ar8327_init_pdata(sc); + if (err != 0) + return (err); + + /* XXX init leds */ + + for (i = 0; i < AR8327_NUM_PHYS; i++) { + /* phy fixup */ + ar8327_phy_fixup(sc, i); + + /* start PHY autonegotiation? */ + /* XXX is this done as part of the normal PHY setup? */ + + }; + + /* Let things settle */ + DELAY(1000); + + return (0); +} + +/* + * Initialise other global values, for the AR8327. + */ +static int +ar8327_hw_global_setup(struct arswitch_softc *sc) +{ + uint32_t t; + + /* enable CPU port and disable mirror port */ + t = AR8327_FWD_CTRL0_CPU_PORT_EN | + AR8327_FWD_CTRL0_MIRROR_PORT; + arswitch_writereg(sc->sc_dev, AR8327_REG_FWD_CTRL0, t); + + /* forward multicast and broadcast frames to CPU */ + t = (AR8327_PORTS_ALL << AR8327_FWD_CTRL1_UC_FLOOD_S) | + (AR8327_PORTS_ALL << AR8327_FWD_CTRL1_MC_FLOOD_S) | + (AR8327_PORTS_ALL << AR8327_FWD_CTRL1_BC_FLOOD_S); + arswitch_writereg(sc->sc_dev, AR8327_REG_FWD_CTRL1, t); + + /* enable jumbo frames */ + /* XXX need to macro-shift the value! */ + arswitch_modifyreg(sc->sc_dev, AR8327_REG_MAX_FRAME_SIZE, + AR8327_MAX_FRAME_SIZE_MTU, 9018 + 8 + 2); + + /* Enable MIB counters */ + arswitch_modifyreg(sc->sc_dev, AR8327_REG_MODULE_EN, + AR8327_MODULE_EN_MIB, AR8327_MODULE_EN_MIB); + + return (0); +} + +/* + * Port setup. + */ +static void +ar8327_port_init(struct arswitch_softc *sc, int port) +{ + uint32_t t; + + /* XXX TODO: need to initialise port0/port6 status in pdata */ + +#if 0 + if (port == AR8216_PORT_CPU) + t = sc->chip_data.ar8327.port0_status; + else if (port == 6) + t = sc->chip_data.ar8327.port6_status; + else +#endif + /* XXX DB120 - hard-code port0 to 1000/full */ + if (port == 0) { + t = AR8X16_PORT_STS_SPEED_1000; + t |= AR8X16_PORT_STS_TXMAC | AR8X16_PORT_STS_RXMAC; + t |= AR8X16_PORT_STS_DUPLEX; + t |= AR8X16_PORT_STS_RXFLOW; + t |= AR8X16_PORT_STS_TXFLOW; + } else + t = AR8X16_PORT_STS_LINK_AUTO; + + arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_STATUS(port), t); + arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_HEADER(port), 0); + + t = 1 << AR8327_PORT_VLAN0_DEF_SVID_S; + t |= 1 << AR8327_PORT_VLAN0_DEF_CVID_S; + arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_VLAN0(port), t); + + t = AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH << AR8327_PORT_VLAN1_OUT_MODE_S; + arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_VLAN1(port), t); + + t = AR8327_PORT_LOOKUP_LEARN; + t |= AR8X16_PORT_CTRL_STATE_FORWARD << AR8327_PORT_LOOKUP_STATE_S; + arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_LOOKUP(port), t); +} + +static int +ar8327_port_vlan_setup(struct arswitch_softc *sc, etherswitch_port_t *p) +{ + + /* XXX stub for now */ + device_printf(sc->sc_dev, "%s: called\n", __func__); + return (0); +} + +static int +ar8327_port_vlan_get(struct arswitch_softc *sc, etherswitch_port_t *p) +{ + + /* XXX stub for now */ + device_printf(sc->sc_dev, "%s: called\n", __func__); + return (0); +} + +static void +ar8327_reset_vlans(struct arswitch_softc *sc) +{ + int i; + uint32_t mode, t; + + /* + * For now, let's default to one portgroup, just so traffic + * flows. All ports can see other ports. + */ + for (i = 0; i < AR8327_NUM_PORTS; i++) { + /* set pvid = i */ + t = i << AR8327_PORT_VLAN0_DEF_SVID_S; + t |= i << AR8327_PORT_VLAN0_DEF_CVID_S; + arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_VLAN0(i), t); + + /* set egress == out_keep */ + mode = AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH; + + t = AR8327_PORT_VLAN1_PORT_VLAN_PROP; + t |= mode << AR8327_PORT_VLAN1_OUT_MODE_S; + arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_VLAN1(i), t); + + /* Set ingress = out_keep; members = 0x3f for all ports */ + + t = 0x3f; /* all ports */ + t |= AR8327_PORT_LOOKUP_LEARN; + + /* in_port_only, forward */ + t |= AR8X16_PORT_VLAN_MODE_PORT_ONLY << AR8327_PORT_LOOKUP_IN_MODE_S; + t |= AR8X16_PORT_CTRL_STATE_FORWARD << AR8327_PORT_LOOKUP_STATE_S; + arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_LOOKUP(i), t); + } +} + +static int +ar8327_vlan_getvgroup(struct arswitch_softc *sc, etherswitch_vlangroup_t *vg) +{ + device_printf(sc->sc_dev, "%s: called\n", __func__); + return (0); +} + +static int +ar8327_vlan_setvgroup(struct arswitch_softc *sc, etherswitch_vlangroup_t *vg) +{ + + device_printf(sc->sc_dev, "%s: called\n", __func__); + return (0); +} + +static int +ar8327_get_pvid(struct arswitch_softc *sc, int port, int *pvid) +{ + + device_printf(sc->sc_dev, "%s: called\n", __func__); + return (0); +} + +static int +ar8327_set_pvid(struct arswitch_softc *sc, int port, int pvid) +{ + + device_printf(sc->sc_dev, "%s: called\n", __func__); + return (0); +} + +void +ar8327_attach(struct arswitch_softc *sc) +{ + + sc->hal.arswitch_hw_setup = ar8327_hw_setup; + sc->hal.arswitch_hw_global_setup = ar8327_hw_global_setup; + + sc->hal.arswitch_port_init = ar8327_port_init; + sc->hal.arswitch_port_vlan_setup = ar8327_port_vlan_setup; + sc->hal.arswitch_port_vlan_get = ar8327_port_vlan_get; + + sc->hal.arswitch_vlan_init_hw = ar8327_reset_vlans; + sc->hal.arswitch_vlan_getvgroup = ar8327_vlan_getvgroup; + sc->hal.arswitch_vlan_setvgroup = ar8327_vlan_setvgroup; + sc->hal.arswitch_vlan_get_pvid = ar8327_get_pvid; + sc->hal.arswitch_vlan_set_pvid = ar8327_set_pvid; + + /* Set the switch vlan capabilities. */ + sc->info.es_vlan_caps = ETHERSWITCH_VLAN_DOT1Q | + ETHERSWITCH_VLAN_PORT | ETHERSWITCH_VLAN_DOUBLE_TAG; + sc->info.es_nvlangroups = AR8X16_MAX_VLANS; +} Added: head/sys/dev/etherswitch/arswitch/arswitch_8327.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.h Mon Feb 24 04:47:16 2014 (r262430) @@ -0,0 +1,91 @@ +/*- + * Copyright (c) 2014 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef __ARSWITCH_8327_H__ +#define __ARSWITCH_8327_H__ + +enum ar8327_pad_mode { + AR8327_PAD_NC = 0, + AR8327_PAD_MAC2MAC_MII, + AR8327_PAD_MAC2MAC_GMII, + AR8327_PAD_MAC_SGMII, + AR8327_PAD_MAC2PHY_MII, + AR8327_PAD_MAC2PHY_GMII, + AR8327_PAD_MAC_RGMII, + AR8327_PAD_PHY_GMII, + AR8327_PAD_PHY_RGMII, + AR8327_PAD_PHY_MII, +}; + +enum ar8327_clk_delay_sel { + AR8327_CLK_DELAY_SEL0 = 0, + AR8327_CLK_DELAY_SEL1, + AR8327_CLK_DELAY_SEL2, + AR8327_CLK_DELAY_SEL3, +}; + +/* XXX update the field types */ +struct ar8327_pad_cfg { + uint32_t mode; + uint32_t rxclk_sel; + uint32_t txclk_sel; + uint32_t txclk_delay_sel; + uint32_t rxclk_delay_sel; + uint32_t txclk_delay_en; + uint32_t rxclk_delay_en; + uint32_t sgmii_delay_en; + uint32_t pipe_rxclk_sel; +}; + +struct ar8327_sgmii_cfg { + uint32_t sgmii_ctrl; + uint32_t serdes_aen; +}; + +struct ar8327_led_cfg { + uint32_t led_ctrl0; + uint32_t led_ctrl1; + uint32_t led_ctrl2; + uint32_t led_ctrl3; + uint32_t open_drain; +}; + +struct ar8327_port_cfg { +#define AR8327_PORT_SPEED_10 1 +#define AR8327_PORT_SPEED_100 2 +#define AR8327_PORT_SPEED_1000 3 + uint32_t speed; + uint32_t force_link; + uint32_t duplex; + uint32_t txpause; + uint32_t rxpause; +}; + +extern void ar8327_attach(struct arswitch_softc *sc); + +#endif /* __ARSWITCH_8327_H__ */ + From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 04:47:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92DCFB98; Mon, 24 Feb 2014 04:47:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7CDA11FE5; Mon, 24 Feb 2014 04:47:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1O4lRFI017446; Mon, 24 Feb 2014 04:47:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1O4lRdB017445; Mon, 24 Feb 2014 04:47:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402240447.s1O4lRdB017445@svn.freebsd.org> From: Adrian Chadd Date: Mon, 24 Feb 2014 04:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262431 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 04:47:27 -0000 Author: adrian Date: Mon Feb 24 04:47:27 2014 New Revision: 262431 URL: http://svnweb.freebsd.org/changeset/base/262431 Log: Link the AR8327 to the build. Modified: head/sys/dev/etherswitch/arswitch/arswitch.c Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Mon Feb 24 04:47:16 2014 (r262430) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Mon Feb 24 04:47:27 2014 (r262431) @@ -66,6 +66,7 @@ #include #include #include +#include #include #include "mdio_if.h" @@ -293,6 +294,8 @@ arswitch_attach(device_t dev) ar8226_attach(sc); else if (AR8X16_IS_SWITCH(sc, AR8316)) ar8316_attach(sc); + else if (AR8X16_IS_SWITCH(sc, AR8327)) + ar8327_attach(sc); else return (ENXIO); From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 04:48:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3CABD06; Mon, 24 Feb 2014 04:48:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A3B181FF4; Mon, 24 Feb 2014 04:48:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1O4mkKq017617; Mon, 24 Feb 2014 04:48:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1O4mk0Z017616; Mon, 24 Feb 2014 04:48:46 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402240448.s1O4mk0Z017616@svn.freebsd.org> From: Adrian Chadd Date: Mon, 24 Feb 2014 04:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262432 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 04:48:46 -0000 Author: adrian Date: Mon Feb 24 04:48:46 2014 New Revision: 262432 URL: http://svnweb.freebsd.org/changeset/base/262432 Log: Add the AR8327 bits to the DB120 config file. There's plenty of hints that I haven't yet fleshed out and are hardcoded in arswitch_8327.c. They're listed here (from OpenWRT) for completeness. This is enough to get the thing up, running and pinging. Note that the mdiobus for the on-switch switch changes - the AR8327 probes first, which exposes mdio1, and thus the arge1 mdiobus will probe and attach as mdio2. That is what the AR9344 on-chip switch has to attach to. Tested: * Qualcomm Atheros DB120 Modified: head/sys/mips/conf/DB120.hints Modified: head/sys/mips/conf/DB120.hints ============================================================================== --- head/sys/mips/conf/DB120.hints Mon Feb 24 04:47:27 2014 (r262431) +++ head/sys/mips/conf/DB120.hints Mon Feb 24 04:48:46 2014 (r262432) @@ -14,13 +14,37 @@ hint.argemdio.0.order=0 hint.ar934x_gmac.0.gmac_cfg=0x41 # GMAC0 here - connected to an AR8327 -#hint.arswitch.0.at="mdio0" -#hint.arswitch.0.is_7240=0 -#hint.arswitch.0.is_9340=0 # not the internal switch! -#hint.arswitch.0.numphys=5 -#hint.arswitch.0.phy4cpu=0 -#hint.arswitch.0.is_rgmii=1 -#hint.arswitch.0.is_gmii=0 +hint.arswitch.0.at="mdio0" +hint.arswitch.0.is_7240=0 +hint.arswitch.0.is_9340=0 # not the internal switch! +hint.arswitch.0.numphys=5 +hint.arswitch.0.phy4cpu=0 +hint.arswitch.0.is_rgmii=1 +hint.arswitch.0.is_gmii=0 +# XXX other AR8327 configuration parameters + +# pad0 cfg: +# .mode = AR8327_PAD_MAC_RGMII, +# .txclk_delay_en = true, +# .rxclk_delay_en = true, +# .txclk_delay_sel = AR8327_CLK_DELAY_SEL1, +# .rxclk_delay_sel = AR8327_CLK_DELAY_SEL2, + +# .led_ctrl0 = 0x00000000, +# .led_ctrl1 = 0xc737c737, +# .led_ctrl2 = 0x00000000, +# .led_ctrl3 = 0x00c30c00, +# .open_drain = true, + +# .port0_cfg = { +# .force_link = 1, +# .speed = AR8327_PORT_SPEED_1000, +# .duplex = 1, +# .txpause = 1, +# .rxpause = 1, +# }, + +# port6 cfg? # XXX OpenWRT DB120 BSP doesn't have media/duplex set? hint.arge.0.phymask=0x0 @@ -36,7 +60,9 @@ hint.argemdio.1.msize=0x1000 hint.argemdio.1.order=0 # Embedded switch on the AR9344 -hint.arswitch.1.at="mdio1" +# mdio1 is actually created as the AR8327 internal bus; so +# this pops up as mdio2. +hint.arswitch.1.at="mdio2" hint.arswitch.1.is_7240=0 hint.arswitch.1.is_9340=1 hint.arswitch.1.numphys=4 From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 05:55:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C2656BE; Mon, 24 Feb 2014 05:55:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ECA7E157C; Mon, 24 Feb 2014 05:55:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1O5t08k044838; Mon, 24 Feb 2014 05:55:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1O5t0ZQ044834; Mon, 24 Feb 2014 05:55:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402240555.s1O5t0ZQ044834@svn.freebsd.org> From: Adrian Chadd Date: Mon, 24 Feb 2014 05:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262433 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 05:55:01 -0000 Author: adrian Date: Mon Feb 24 05:55:00 2014 New Revision: 262433 URL: http://svnweb.freebsd.org/changeset/base/262433 Log: Add in port0/port6 configuration as part of the platform data code path. It's still hardcoded (for db120) but it is now hardcoded in all the same place (ie, the pdata path.) The port config/status code now checks port0/port6 as appropriate to configure things. Tested: * Qualcomm Atheros DB120, AR8327 switch. Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Mon Feb 24 04:48:46 2014 (r262432) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Mon Feb 24 05:55:00 2014 (r262433) @@ -123,7 +123,7 @@ ar8327_get_pad_cfg(struct ar8327_pad_cfg t = AR8327_PAD_SGMII_EN; /* - * WAR for the QUalcomm Atheros AP136 board. + * WAR for the Qualcomm Atheros AP136 board. * It seems that RGMII TX/RX delay settings needs to be * applied for SGMII mode as well, The ethernet is not * reliable without this. @@ -183,6 +183,39 @@ ar8327_get_pad_cfg(struct ar8327_pad_cfg return (t); } + +/* + * Map the hard-coded port config from the switch setup to + * the chipset port config (status, duplex, flow, etc.) + */ +static uint32_t +ar8327_get_port_init_status(struct ar8327_port_cfg *cfg) +{ + uint32_t t; + + if (!cfg->force_link) + return (AR8X16_PORT_STS_LINK_AUTO); + + t = AR8X16_PORT_STS_TXMAC | AR8X16_PORT_STS_RXMAC; + t |= cfg->duplex ? AR8X16_PORT_STS_DUPLEX : 0; + t |= cfg->rxpause ? AR8X16_PORT_STS_RXFLOW : 0; + t |= cfg->txpause ? AR8X16_PORT_STS_TXFLOW : 0; + + switch (cfg->speed) { + case AR8327_PORT_SPEED_10: + t |= AR8X16_PORT_STS_SPEED_10; + break; + case AR8327_PORT_SPEED_100: + t |= AR8X16_PORT_STS_SPEED_100; + break; + case AR8327_PORT_SPEED_1000: + t |= AR8X16_PORT_STS_SPEED_1000; + break; + } + + return (t); +} + /* * Initialise the ar8327 specific hardware features from * the hints provided in the boot environment. @@ -191,13 +224,23 @@ static int ar8327_init_pdata(struct arswitch_softc *sc) { struct ar8327_pad_cfg pc; + struct ar8327_port_cfg port_cfg; uint32_t t; /* XXX hard-coded DB120 defaults for now! */ /* Port 0 - rgmii; 1000/full */ + bzero(&port_cfg, sizeof(port_cfg)); + port_cfg.speed = AR8327_PORT_SPEED_1000; + port_cfg.duplex = 1; + port_cfg.rxpause = 1; + port_cfg.txpause = 1; + port_cfg.force_link = 1; + sc->ar8327.port0_status = ar8327_get_port_init_status(&port_cfg); /* Port 6 - ignore */ + bzero(&port_cfg, sizeof(port_cfg)); + sc->ar8327.port6_status = ar8327_get_port_init_status(&port_cfg); /* Pad 0 */ bzero(&pc, sizeof(pc)); @@ -224,45 +267,12 @@ ar8327_init_pdata(struct arswitch_softc t = ar8327_get_pad_cfg(&pc); arswitch_writereg(sc->sc_dev, AR8327_REG_PAD6_MODE, t); - /* LED config */ + /* XXX LED config */ - /* SGMII config */ - return (0); -} + /* XXX SGMII config */ -#if 0 -/* - * Map the hard-coded port config from the switch setup to - * the chipset port config (status, duplex, flow, etc.) - */ -static uint32_t -ar8327_get_port_init_status(struct ar8327_port_cfg *cfg) -{ - uint32_t t; - - if (!cfg->force_link) - return (AR8X16_PORT_STS_LINK_AUTO); - - t = AR8X16_PORT_STS_TXMAC | AR8X16_PORT_STS_RXMAC; - t |= cfg->duplex ? AR8X16_PORT_STS_DUPLEX : 0; - t |= cfg->rxpause ? AR8X16_PORT_STS_RXFLOW : 0; - t |= cfg->txpause ? AR8X16_PORT_STS_TXFLOW : 0; - - switch (cfg->speed) { - case AR8327_PORT_SPEED_10: - t |= AR8X16_PORT_STS_SPEED_10; - break; - case AR8327_PORT_SPEED_100: - t |= AR8X16_PORT_STS_SPEED_100; - break; - case AR8327_PORT_SPEED_1000: - t |= AR8X16_PORT_STS_SPEED_1000; - break; - } - - return (t); + return (0); } -#endif static int ar8327_hw_setup(struct arswitch_softc *sc) @@ -331,15 +341,12 @@ ar8327_port_init(struct arswitch_softc * { uint32_t t; - /* XXX TODO: need to initialise port0/port6 status in pdata */ - -#if 0 - if (port == AR8216_PORT_CPU) - t = sc->chip_data.ar8327.port0_status; - else if (port == 6) - t = sc->chip_data.ar8327.port6_status; + if (port == AR8X16_PORT_CPU) + t = sc->ar8327.port0_status; + else if (port == 6) + t = sc->ar8327.port6_status; else -#endif +#if 0 /* XXX DB120 - hard-code port0 to 1000/full */ if (port == 0) { t = AR8X16_PORT_STS_SPEED_1000; @@ -348,6 +355,7 @@ ar8327_port_init(struct arswitch_softc * t |= AR8X16_PORT_STS_RXFLOW; t |= AR8X16_PORT_STS_TXFLOW; } else +#endif t = AR8X16_PORT_STS_LINK_AUTO; arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_STATUS(port), t); Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Mon Feb 24 04:48:46 2014 (r262432) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Mon Feb 24 05:55:00 2014 (r262433) @@ -96,6 +96,12 @@ struct arswitch_softc { int (* arswitch_vlan_set_pvid) (struct arswitch_softc *, int, int); } hal; + + struct { + uint32_t port0_status; + uint32_t port5_status; + uint32_t port6_status; + } ar8327; }; #define ARSWITCH_LOCK(_sc) \ From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 08:34:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23CEE531; Mon, 24 Feb 2014 08:34:33 +0000 (UTC) Received: from mail-la0-x22f.google.com (mail-la0-x22f.google.com [IPv6:2a00:1450:4010:c03::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1796E175E; Mon, 24 Feb 2014 08:34:31 +0000 (UTC) Received: by mail-la0-f47.google.com with SMTP id y1so853964lam.20 for ; Mon, 24 Feb 2014 00:34:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=yksMyufAW8Z0X2dVXzVUQxA4CpU8KoSJ8B6STmGKiT4=; b=xFgXFLOdvMAkDeMKSjchIx2UfT0RysJFRMP+Mq9en2NdlpBa5gy4onHaWmW/zd2Opn A9Pykyue/rwzMxRdWL4UIyqYw/yMvlhLpa8uyfovMHhYIWzc6NL0SUbNYKWIb/tKka2a tZVT3KtES6YYaHNxeOGBwgFyGYEe2yhlxpPdnap6UV0hR+YHpcaW0S0vwNGOXz5Cysd2 5leIWhJ/W1L+IhRmrTQ686Nzm5cqVRyg4thAcv48NWdRMhGYVZM4yn2/JpCt1e7YgqKg 2DXVzFcsE48HLct6gFKzxG/LvUPvzNoXn377+wzZnXCrehQGMpMFmlDuZNmFJU2cGdVn fHaA== MIME-Version: 1.0 X-Received: by 10.113.3.43 with SMTP id bt11mr10861255lbd.92.1393230868404; Mon, 24 Feb 2014 00:34:28 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.30.211 with HTTP; Mon, 24 Feb 2014 00:34:28 -0800 (PST) Received: by 10.112.30.211 with HTTP; Mon, 24 Feb 2014 00:34:28 -0800 (PST) In-Reply-To: References: <201402230127.s1N1RMoX052542@svn.freebsd.org> Date: Mon, 24 Feb 2014 00:34:28 -0800 X-Google-Sender-Auth: wfZ2jNtBsB5rH7nehHzd-obP4cc Message-ID: Subject: Re: svn commit: r262351 - head/sys/netinet6 From: Craig Rodrigues To: "Bjoern A. Zeeb" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 08:34:33 -0000 On Feb 23, 2014 2:56 PM, "Bjoern A. Zeeb" wrote: > > > On 23 Feb 2014, at 01:27 , Craig Rodrigues wrote: > > > Author: rodrigc > > Date: Sun Feb 23 01:27:22 2014 > > New Revision: 262351 > > URL: http://svnweb.freebsd.org/changeset/base/262351 > > > > Log: > > Remove KASSERT from in6p_lookup_mcast_ifp(). > > > > When the devel/jenkins port, version 1.551 was started, > > the kernel would panic if INVARIANTS was enabled in the kernel config. > > > > Suggested by: bms > > This reads to me "we hit the assert, bms suggested to remove it". Great! Caught a bug! Where is it? In no way the commit message tells me why? Why did we not hit the assert in the last n years? What has changed that we hit it now? Was the assert wrong from the beginning? Did we hit a real bug elsewhere and now lost the tracking for it? > > Could you please at least for the archives explain? Bruce suggested that I remove the KASSERT here: http://lists.freebsd.org/pipermail/freebsd-net/2013-October/036806.html -- Craig From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 09:50:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C517CFA0; Mon, 24 Feb 2014 09:50:56 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 4AB9084F; Mon, 24 Feb 2014 09:50:55 +0000 (UTC) Message-ID: <530B15F1.5050300@FreeBSD.org> Date: Mon, 24 Feb 2014 13:50:41 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Craig Rodrigues , "Bjoern A. Zeeb" Subject: Re: svn commit: r262351 - head/sys/netinet6 References: <201402230127.s1N1RMoX052542@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 09:50:56 -0000 On 24.02.2014 12:34, Craig Rodrigues wrote: > > On Feb 23, 2014 2:56 PM, "Bjoern A. Zeeb" > wrote: >> >> >> On 23 Feb 2014, at 01:27 , Craig Rodrigues wrote: >> >> > Author: rodrigc >> > Date: Sun Feb 23 01:27:22 2014 >> > New Revision: 262351 >> > URL: http://svnweb.freebsd.org/changeset/base/262351 >> > >> > Log: >> > Remove KASSERT from in6p_lookup_mcast_ifp(). >> > >> > When the devel/jenkins port, version 1.551 was started, >> > the kernel would panic if INVARIANTS was enabled in the kernel config. >> > >> > Suggested by: bms >> >> This reads to me “we hit the assert, bms suggested to remove it”. > Great! Caught a bug! Where is it? In no way the commit message tells > me why? Why did we not hit the assert in the last n years? What has > changed that we hit it now? Was the assert wrong from the beginning? > Did we hit a real bug elsewhere and now lost the tracking for it? >> >> Could you please at least for the archives explain? > > Bruce suggested that I remove the KASSERT here: > > http://lists.freebsd.org/pipermail/freebsd-net/2013-October/036806.html There was my analysis: http://lists.freebsd.org/pipermail/freebsd-net/2013-August/036545.html I think it is safe to remove this KASSERT. -- WBR, Andrey V. Elsukov From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 10:44:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 064E4D6D; Mon, 24 Feb 2014 10:44:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CB8DA136E; Mon, 24 Feb 2014 10:44:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1OAigkO062969; Mon, 24 Feb 2014 10:44:42 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1OAig7H062968; Mon, 24 Feb 2014 10:44:42 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402241044.s1OAig7H062968@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 24 Feb 2014 10:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262439 - head/sys/dev/usb/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 10:44:43 -0000 Author: hselasky Date: Mon Feb 24 10:44:42 2014 New Revision: 262439 URL: http://svnweb.freebsd.org/changeset/base/262439 Log: Update ATP driver: - Add support for emulating a mouse wheel, Z-axis. Submitted by: Rohit Grover MFC after: 2 weeks Modified: head/sys/dev/usb/input/atp.c Modified: head/sys/dev/usb/input/atp.c ============================================================================== --- head/sys/dev/usb/input/atp.c Mon Feb 24 09:40:03 2014 (r262438) +++ head/sys/dev/usb/input/atp.c Mon Feb 24 10:44:42 2014 (r262439) @@ -2075,18 +2075,16 @@ atp_reap_sibling_zombies(void *arg) break; default: /* we handle taps of only up to 3 fingers */ - break; + return; } atp_add_to_queue(sc, 0, 0, 0, 0); /* button release */ - } else if (n_slides_reaped == 2) { - if (n_horizontal_scrolls == 2) { - if (horizontal_scroll < 0) - atp_add_to_queue(sc, 0, 0, 0, MOUSE_BUTTON4DOWN); - else - atp_add_to_queue(sc, 0, 0, 0, MOUSE_BUTTON5DOWN); - atp_add_to_queue(sc, 0, 0, 0, 0); /* button release */ - } + } else if ((n_slides_reaped == 2) && (n_horizontal_scrolls == 2)) { + if (horizontal_scroll < 0) + atp_add_to_queue(sc, 0, 0, 0, MOUSE_BUTTON4DOWN); + else + atp_add_to_queue(sc, 0, 0, 0, MOUSE_BUTTON5DOWN); + atp_add_to_queue(sc, 0, 0, 0, 0); /* button release */ } } @@ -2369,8 +2367,12 @@ atp_intr(struct usb_xfer *xfer, usb_erro u_int8_t n_movements = 0; int dx = 0; int dy = 0; + int dz = 0; TAILQ_FOREACH(strokep, &sc->sc_stroke_used, entry) { + if (strokep->flags & ATSF_ZOMBIE) + continue; + dx += strokep->movement_dx; dy += strokep->movement_dy; if (strokep->movement_dx || @@ -2384,9 +2386,26 @@ atp_intr(struct usb_xfer *xfer, usb_erro dy /= (int)n_movements; } + /* detect multi-finger vertical scrolls */ + if (n_movements >= 2) { + boolean_t all_vertical_scrolls = true; + TAILQ_FOREACH(strokep, &sc->sc_stroke_used, entry) { + if (strokep->flags & ATSF_ZOMBIE) + continue; + + if (!atp_is_vertical_scroll(strokep)) + all_vertical_scrolls = false; + } + if (all_vertical_scrolls) { + dz = dy; + dy = dx = 0; + } + } + sc->sc_status.dx += dx; sc->sc_status.dy += dy; - atp_add_to_queue(sc, dx, -dy, 0, sc->sc_status.button); + sc->sc_status.dz += dz; + atp_add_to_queue(sc, dx, -dy, -dz, sc->sc_status.button); } case USB_ST_SETUP: From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 11:06:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C6B485E; Mon, 24 Feb 2014 11:06:21 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1EE1D15CE; Mon, 24 Feb 2014 11:06:20 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s1OB6Jbk008101 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 24 Feb 2014 15:06:19 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s1OB6IeC008100; Mon, 24 Feb 2014 15:06:18 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 24 Feb 2014 15:06:18 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r262424 - head/usr.sbin/pmcstat Message-ID: <20140224110618.GP86937@FreeBSD.org> References: <201402240243.s1O2hwVb068203@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201402240243.s1O2hwVb068203@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 11:06:21 -0000 Adrian, On Mon, Feb 24, 2014 at 02:43:58AM +0000, Adrian Chadd wrote: A> Log: A> Add a new option - 'a ' - which spits out annotated callgraphs. A> A> '-m ' spits out the given stream into (eg, /dev/stdout). A> However, it only resolves the first symbol; it doesn't parse the entire A> callgraph. If it fails to lookup then it doesn't print anything. A> A> '-a' instead does a symbol and file:line lookup for each address in each A> callgraph and will happily print the address itself with no lookup A> information if it couldn't look things up. A> A> This makes it much easier to pull out individual records from a A> pmc data file and look at the callgraph information without having to A> hand-decode the addresses. A> A> Sponsored by: Netflix, Inc. Is it possible to spend 5 minutes and document new features in pmcstat(8)? Please! -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 12:45:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92756799; Mon, 24 Feb 2014 12:45:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6433B119E; Mon, 24 Feb 2014 12:45:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1OCj4AD011595; Mon, 24 Feb 2014 12:45:04 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1OCj4fK011590; Mon, 24 Feb 2014 12:45:04 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201402241245.s1OCj4fK011590@svn.freebsd.org> From: Luiz Otavio O Souza Date: Mon, 24 Feb 2014 12:45:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262440 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 12:45:04 -0000 Author: loos Date: Mon Feb 24 12:45:03 2014 New Revision: 262440 URL: http://svnweb.freebsd.org/changeset/base/262440 Log: Enable the second and the third I2C controllers on Beaglebone-black. The first I2C controller is only used to manage the on-board devices (PMIC and HDMI framer) and its bus is not exposed on the expasion headers. With this change the following pins on the P9 expansion headers are now reserved as I2C pins: Pin 17 - I2C1 SCL Pin 18 - I2C1 SDA Pin 19 - I2C2 SCL Pin 20 - I2C2 SDA The I2C2 is the bus that should be used to read the contents of cape eeproms. Approved by: adrian (mentor, implicit) Modified: head/sys/boot/fdt/dts/am335x.dtsi head/sys/boot/fdt/dts/beaglebone-black.dts Modified: head/sys/boot/fdt/dts/am335x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/am335x.dtsi Mon Feb 24 10:44:42 2014 (r262439) +++ head/sys/boot/fdt/dts/am335x.dtsi Mon Feb 24 12:45:03 2014 (r262440) @@ -210,6 +210,26 @@ i2c-device-id = <0>; }; + i2c1: i2c@4802a000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "ti,i2c"; + reg =< 0x4802a000 0x1000 >; + interrupts = <71>; + interrupt-parent = <&AINTC>; + i2c-device-id = <1>; + }; + + i2c2: i2c@4819c000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "ti,i2c"; + reg =< 0x4819c000 0x1000 >; + interrupts = <30>; + interrupt-parent = <&AINTC>; + i2c-device-id = <2>; + }; + pwm@48300000 { compatible = "ti,am335x-pwm"; #address-cells = <1>; Modified: head/sys/boot/fdt/dts/beaglebone-black.dts ============================================================================== --- head/sys/boot/fdt/dts/beaglebone-black.dts Mon Feb 24 10:44:42 2014 (r262439) +++ head/sys/boot/fdt/dts/beaglebone-black.dts Mon Feb 24 12:45:03 2014 (r262440) @@ -52,6 +52,12 @@ /* I2C0 */ "I2C0_SDA", "I2C0_SDA","i2c", "I2C0_SCL", "I2C0_SCL","i2c", + /* I2C1 */ + "SPI0_D1", "I2C1_SDA", "i2c", + "SPI0_CS0", "I2C1_SCL", "i2c", + /* I2C2 */ + "UART1_CTSn", "I2C2_SDA", "i2c", + "UART1_RTSn", "I2C2_SCL", "i2c", /* Ethernet */ "MII1_RX_ER", "gmii1_rxerr", "input_pulldown", "MII1_TX_EN", "gmii1_txen", "output", From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 13:33:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39664206; Mon, 24 Feb 2014 13:33:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 19BCC1676; Mon, 24 Feb 2014 13:33:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1ODXL13032478; Mon, 24 Feb 2014 13:33:21 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1ODXLUN032474; Mon, 24 Feb 2014 13:33:21 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201402241333.s1ODXLUN032474@svn.freebsd.org> From: Tijl Coosemans Date: Mon, 24 Feb 2014 13:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262441 - in head/lib: libc/iconv libiconv_modules/BIG5 libiconv_modules/HZ X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 13:33:22 -0000 Author: tijl Date: Mon Feb 24 13:33:20 2014 New Revision: 262441 URL: http://svnweb.freebsd.org/changeset/base/262441 Log: Consistently pass around context information using a simple pointer. This fixes some dereferencing bugs in Chinese character set conversions. PR: 185964 MFC after: 5 days Modified: head/lib/libc/iconv/citrus_prop.c head/lib/libc/iconv/citrus_prop.h head/lib/libiconv_modules/BIG5/citrus_big5.c head/lib/libiconv_modules/HZ/citrus_hz.c Modified: head/lib/libc/iconv/citrus_prop.c ============================================================================== --- head/lib/libc/iconv/citrus_prop.c Mon Feb 24 12:45:03 2014 (r262440) +++ head/lib/libc/iconv/citrus_prop.c Mon Feb 24 13:33:20 2014 (r262441) @@ -339,7 +339,7 @@ name_found: static int _citrus_prop_parse_element(struct _memstream * __restrict ms, - const _citrus_prop_hint_t * __restrict hints, void ** __restrict context) + const _citrus_prop_hint_t * __restrict hints, void * __restrict context) { int ch, errnum; #define _CITRUS_PROP_HINT_NAME_LEN_MAX 255 @@ -435,8 +435,7 @@ _citrus_prop_parse_variable(const _citru if (ch == EOF || ch == '\0') break; _memstream_ungetc(&ms, ch); - errnum = _citrus_prop_parse_element( - &ms, hints, (void ** __restrict)context); + errnum = _citrus_prop_parse_element(&ms, hints, context); if (errnum != 0) return (errnum); } Modified: head/lib/libc/iconv/citrus_prop.h ============================================================================== --- head/lib/libc/iconv/citrus_prop.h Mon Feb 24 12:45:03 2014 (r262440) +++ head/lib/libc/iconv/citrus_prop.h Mon Feb 24 13:33:20 2014 (r262441) @@ -42,7 +42,7 @@ typedef struct _citrus_prop_hint_t _citr #define _CITRUS_PROP_CB0_T(_func_, _type_) \ typedef int (*_citrus_prop_##_func_##_cb_func_t) \ - (void ** __restrict, const char *, _type_); \ + (void * __restrict, const char *, _type_); \ typedef struct { \ _citrus_prop_##_func_##_cb_func_t func; \ } _citrus_prop_##_func_##_cb_t; @@ -52,7 +52,7 @@ _CITRUS_PROP_CB0_T(str, const char *) #define _CITRUS_PROP_CB1_T(_func_, _type_) \ typedef int (*_citrus_prop_##_func_##_cb_func_t) \ - (void ** __restrict, const char *, _type_, _type_); \ + (void * __restrict, const char *, _type_, _type_); \ typedef struct { \ _citrus_prop_##_func_##_cb_func_t func; \ } _citrus_prop_##_func_##_cb_t; Modified: head/lib/libiconv_modules/BIG5/citrus_big5.c ============================================================================== --- head/lib/libiconv_modules/BIG5/citrus_big5.c Mon Feb 24 12:45:03 2014 (r262440) +++ head/lib/libiconv_modules/BIG5/citrus_big5.c Mon Feb 24 13:33:20 2014 (r262441) @@ -172,7 +172,7 @@ _citrus_BIG5_check_excludes(_BIG5Encodin } static int -_citrus_BIG5_fill_rowcol(void ** __restrict ctx, const char * __restrict s, +_citrus_BIG5_fill_rowcol(void * __restrict ctx, const char * __restrict s, uint64_t start, uint64_t end) { _BIG5EncodingInfo *ei; @@ -191,7 +191,7 @@ _citrus_BIG5_fill_rowcol(void ** __restr static int /*ARGSUSED*/ -_citrus_BIG5_fill_excludes(void ** __restrict ctx, +_citrus_BIG5_fill_excludes(void * __restrict ctx, const char * __restrict s __unused, uint64_t start, uint64_t end) { _BIG5EncodingInfo *ei; @@ -237,7 +237,6 @@ static int _citrus_BIG5_encoding_module_init(_BIG5EncodingInfo * __restrict ei, const void * __restrict var, size_t lenvar) { - void *ctx = (void *)ei; const char *s; int err; @@ -259,9 +258,9 @@ _citrus_BIG5_encoding_module_init(_BIG5E } /* fallback Big5-1984, for backward compatibility. */ - _citrus_BIG5_fill_rowcol((void **)&ctx, "row", 0xA1, 0xFE); - _citrus_BIG5_fill_rowcol((void **)&ctx, "col", 0x40, 0x7E); - _citrus_BIG5_fill_rowcol((void **)&ctx, "col", 0xA1, 0xFE); + _citrus_BIG5_fill_rowcol(ei, "row", 0xA1, 0xFE); + _citrus_BIG5_fill_rowcol(ei, "col", 0x40, 0x7E); + _citrus_BIG5_fill_rowcol(ei, "col", 0xA1, 0xFE); return (0); } Modified: head/lib/libiconv_modules/HZ/citrus_hz.c ============================================================================== --- head/lib/libiconv_modules/HZ/citrus_hz.c Mon Feb 24 12:45:03 2014 (r262440) +++ head/lib/libiconv_modules/HZ/citrus_hz.c Mon Feb 24 13:33:20 2014 (r262441) @@ -505,12 +505,12 @@ _citrus_HZ_encoding_module_uninit(_HZEnc } static int -_citrus_HZ_parse_char(void **context, const char *name __unused, const char *s) +_citrus_HZ_parse_char(void *context, const char *name __unused, const char *s) { escape_t *escape; void **p; - p = (void **)*context; + p = (void **)context; escape = (escape_t *)p[0]; if (escape->ch != '\0') return (EINVAL); @@ -522,14 +522,14 @@ _citrus_HZ_parse_char(void **context, co } static int -_citrus_HZ_parse_graphic(void **context, const char *name, const char *s) +_citrus_HZ_parse_graphic(void *context, const char *name, const char *s) { _HZEncodingInfo *ei; escape_t *escape; graphic_t *graphic; void **p; - p = (void **)*context; + p = (void **)context; escape = (escape_t *)p[0]; ei = (_HZEncodingInfo *)p[1]; graphic = malloc(sizeof(*graphic)); @@ -591,13 +591,13 @@ _CITRUS_PROP_HINT_END }; static int -_citrus_HZ_parse_escape(void **context, const char *name, const char *s) +_citrus_HZ_parse_escape(void *context, const char *name, const char *s) { _HZEncodingInfo *ei; escape_t *escape; void *p[2]; - ei = (_HZEncodingInfo *)*context; + ei = (_HZEncodingInfo *)context; escape = malloc(sizeof(*escape)); if (escape == NULL) return (EINVAL); From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 13:43:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0291BAE3; Mon, 24 Feb 2014 13:43:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E31731774; Mon, 24 Feb 2014 13:43:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1ODhBre036447; Mon, 24 Feb 2014 13:43:11 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1ODhBGZ036445; Mon, 24 Feb 2014 13:43:11 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201402241343.s1ODhBGZ036445@svn.freebsd.org> From: Tijl Coosemans Date: Mon, 24 Feb 2014 13:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262442 - head/lib/libiconv_modules/HZ X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 13:43:12 -0000 Author: tijl Date: Mon Feb 24 13:43:11 2014 New Revision: 262442 URL: http://svnweb.freebsd.org/changeset/base/262442 Log: Fix Simplified Chinese character set conversions by switching around the fields of an internal struct so it corresponds with the way variables of this type are initialised. PR: 185964 Submitted by: Manuel Mausz MFC after: 5 days Modified: head/lib/libiconv_modules/HZ/citrus_hz.c Modified: head/lib/libiconv_modules/HZ/citrus_hz.c ============================================================================== --- head/lib/libiconv_modules/HZ/citrus_hz.c Mon Feb 24 13:33:20 2014 (r262441) +++ head/lib/libiconv_modules/HZ/citrus_hz.c Mon Feb 24 13:43:11 2014 (r262442) @@ -65,8 +65,8 @@ typedef enum { } charset_t; typedef struct { - int end; int start; + int end; int width; } range_t; From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 14:40:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84011E50; Mon, 24 Feb 2014 14:40:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6B2791DB5; Mon, 24 Feb 2014 14:40:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1OEeTKs058877; Mon, 24 Feb 2014 14:40:29 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1OEeTtL058876; Mon, 24 Feb 2014 14:40:29 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201402241440.s1OEeTtL058876@svn.freebsd.org> From: Tijl Coosemans Date: Mon, 24 Feb 2014 14:40:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262447 - head/lib/libiconv_modules/VIQR X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 14:40:29 -0000 Author: tijl Date: Mon Feb 24 14:40:28 2014 New Revision: 262447 URL: http://svnweb.freebsd.org/changeset/base/262447 Log: Fix an array index out of bounds bug in iconv VIQR (Vietnamese) module. PR: 185964 Submitted by: Manuel Mausz MFC after: 5 days Modified: head/lib/libiconv_modules/VIQR/citrus_viqr.c Modified: head/lib/libiconv_modules/VIQR/citrus_viqr.c ============================================================================== --- head/lib/libiconv_modules/VIQR/citrus_viqr.c Mon Feb 24 13:59:23 2014 (r262446) +++ head/lib/libiconv_modules/VIQR/citrus_viqr.c Mon Feb 24 14:40:28 2014 (r262447) @@ -457,7 +457,7 @@ _citrus_VIQR_encoding_module_init(_VIQRE return (errnum); } } - for (i = 0;; ++i) { + for (i = 0; i < mnemonic_ext_size; ++i) { p = &mnemonic_ext[i]; n = strlen(p->name); if (ei->mb_cur_max < n) From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 15:54:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7781C705; Mon, 24 Feb 2014 15:54:52 +0000 (UTC) Received: from mail-qc0-x22f.google.com (mail-qc0-x22f.google.com [IPv6:2607:f8b0:400d:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F1F9C1687; Mon, 24 Feb 2014 15:54:51 +0000 (UTC) Received: by mail-qc0-f175.google.com with SMTP id e16so2206578qcx.34 for ; Mon, 24 Feb 2014 07:54:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=LbNFLCqPM53vjZkL2MK2MIVlZjhhjdAKlHNsK+Sd5EE=; b=ElK2KyfFg4ukU2P0J4DlaY2DQm77wRafyhahP4hJyQAEiUH/LsAOri0QvmiRAEirsX EmMjX3jKnzGCv2M+UoIiJLXQDQo0wtoh2oFRWzn8XzsYRKpYcOANPMK3BoVICqL/FqGC ie0eFSGFP4vAvFfS++1f9J1CDiU7ld152jVVXV/pMXc6h5+gWqZbar9Ytf5dak8k7GZR iqO66XxOrJxOgNxj3TYi2dlAV692LFFtQxtZ2AdZFCBoPD9sJmUfHtQ8Q2lktrNHwMLc O1c3u3t5CT+JGXYAsrJlW2mgXp2Ugs1+SufLPDAbVLrh2IOPJDEpaQ9BFSH8shLrKHxn Vy3g== MIME-Version: 1.0 X-Received: by 10.140.98.203 with SMTP id o69mr28895872qge.102.1393257290993; Mon, 24 Feb 2014 07:54:50 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.16.10 with HTTP; Mon, 24 Feb 2014 07:54:50 -0800 (PST) In-Reply-To: <20140224110618.GP86937@FreeBSD.org> References: <201402240243.s1O2hwVb068203@svn.freebsd.org> <20140224110618.GP86937@FreeBSD.org> Date: Mon, 24 Feb 2014 07:54:50 -0800 X-Google-Sender-Auth: BZsh1ohKubUTnV8eprnnZB4roNY Message-ID: Subject: Re: svn commit: r262424 - head/usr.sbin/pmcstat From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 15:54:52 -0000 I'll sit down with a docs person and get the manpage markup done. It was on my todo list; I just wanted to get the code committed now. Thanks, -a On 24 February 2014 03:06, Gleb Smirnoff wrote: > Adrian, > > On Mon, Feb 24, 2014 at 02:43:58AM +0000, Adrian Chadd wrote: > A> Log: > A> Add a new option - 'a ' - which spits out annotated callgraphs. > A> > A> '-m ' spits out the given stream into (eg, /dev/stdout). > A> However, it only resolves the first symbol; it doesn't parse the entire > A> callgraph. If it fails to lookup then it doesn't print anything. > A> > A> '-a' instead does a symbol and file:line lookup for each address in each > A> callgraph and will happily print the address itself with no lookup > A> information if it couldn't look things up. > A> > A> This makes it much easier to pull out individual records from a > A> pmc data file and look at the callgraph information without having to > A> hand-decode the addresses. > A> > A> Sponsored by: Netflix, Inc. > > Is it possible to spend 5 minutes and document new features in pmcstat(8)? > Please! > > -- > Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 17:14:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE1071CE; Mon, 24 Feb 2014 17:14:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D63D31E0E; Mon, 24 Feb 2014 17:14:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1OHE8hO022548; Mon, 24 Feb 2014 17:14:08 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1OHE8Pd022547; Mon, 24 Feb 2014 17:14:08 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402241714.s1OHE8Pd022547@svn.freebsd.org> From: Eitan Adler Date: Mon, 24 Feb 2014 17:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262451 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 17:14:09 -0000 Author: eadler Date: Mon Feb 24 17:14:08 2014 New Revision: 262451 URL: http://svnweb.freebsd.org/changeset/base/262451 Log: hier(7): Add /usr/lib/private Requested by: theraven MFC After: 3 days Modified: head/share/man/man7/hier.7 Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Mon Feb 24 17:03:02 2014 (r262450) +++ head/share/man/man7/hier.7 Mon Feb 24 17:14:08 2014 (r262451) @@ -383,6 +383,9 @@ a.out backward compatibility libraries DTrace library scripts .It Pa engines/ OpenSSL (Cryptography/SSL toolkit) dynamically loadable engines +.It Pa private/ +Private system libraries not for use by third-party programs. +ABI and API stability are not guaranteed. .El .Pp .It Pa libdata/ From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 18:44:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35CA94D6; Mon, 24 Feb 2014 18:44:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 224F5183D; Mon, 24 Feb 2014 18:44:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1OIi47q058741; Mon, 24 Feb 2014 18:44:04 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1OIi3kg058740; Mon, 24 Feb 2014 18:44:03 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201402241844.s1OIi3kg058740@svn.freebsd.org> From: Robert Watson Date: Mon, 24 Feb 2014 18:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262452 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 18:44:04 -0000 Author: rwatson Date: Mon Feb 24 18:44:03 2014 New Revision: 262452 URL: http://svnweb.freebsd.org/changeset/base/262452 Log: Build 64-bit ELF support into little-endian 64-bit MIPS boot-loader fragments; while this won't actually be used for anything (yet), it doesn't hurt to ensure it is exposed to the tinderbox. Requested by: imp, jmallett MFC after: 3 weeks Modified: head/sys/boot/common/Makefile.inc Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Mon Feb 24 17:14:08 2014 (r262451) +++ head/sys/boot/common/Makefile.inc Mon Feb 24 18:44:03 2014 (r262452) @@ -18,7 +18,7 @@ SRCS+= load_elf32.c reloc_elf32.c SRCS+= load_elf64.c reloc_elf64.c .elif ${MACHINE_CPUARCH} == "sparc64" SRCS+= load_elf64.c reloc_elf64.c -.elif ${MACHINE_ARCH} == "mips64" +.elif ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "mips64el" SRCS+= load_elf64.c reloc_elf64.c .endif From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 18:44:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A383E6C0; Mon, 24 Feb 2014 18:44:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A1E2A1844; Mon, 24 Feb 2014 18:44:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1OIiMa1058889; Mon, 24 Feb 2014 18:44:22 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1OIiMYp058888; Mon, 24 Feb 2014 18:44:22 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201402241844.s1OIiMYp058888@svn.freebsd.org> From: Robert Watson Date: Mon, 24 Feb 2014 18:44:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262453 - head/sys/boot/ficl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 18:44:23 -0000 Author: rwatson Date: Mon Feb 24 18:44:22 2014 New Revision: 262453 URL: http://svnweb.freebsd.org/changeset/base/262453 Log: Build FICL support into little-endian 64-bit MIPS boot-loader fragments; while this won't actually be used for anything (yet), it doesn't hurt to ensure it is exposed to the tinderbox. Requested by: imp, jmallett MFC after: 3 weeks Modified: head/sys/boot/ficl/Makefile Modified: head/sys/boot/ficl/Makefile ============================================================================== --- head/sys/boot/ficl/Makefile Mon Feb 24 18:44:03 2014 (r262452) +++ head/sys/boot/ficl/Makefile Mon Feb 24 18:44:22 2014 (r262453) @@ -5,7 +5,7 @@ FICLDIR?= ${.CURDIR} .if !defined(FICL64) .PATH: ${FICLDIR}/${MACHINE_CPUARCH:S/amd64/i386/} -.elif ${MACHINE_ARCH} == "mips64" +.elif ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "mips64el" .PATH: ${FICLDIR}/${MACHINE_ARCH} .else .PATH: ${FICLDIR}/${MACHINE_CPUARCH} From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 19:06:06 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1325A623; Mon, 24 Feb 2014 19:06:06 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C2CD21A8B; Mon, 24 Feb 2014 19:06:05 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s1OJ64uk000506 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 24 Feb 2014 11:06:05 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s1OJ64uF000505; Mon, 24 Feb 2014 11:06:04 -0800 (PST) (envelope-from jmg) Date: Mon, 24 Feb 2014 11:06:04 -0800 From: John-Mark Gurney To: Adrian Chadd Subject: Re: svn commit: r262424 - head/usr.sbin/pmcstat Message-ID: <20140224190604.GB92037@funkthat.com> References: <201402240243.s1O2hwVb068203@svn.freebsd.org> <20140224110618.GP86937@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Mon, 24 Feb 2014 11:06:05 -0800 (PST) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Gleb Smirnoff , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 19:06:06 -0000 Adrian Chadd wrote this message on Mon, Feb 24, 2014 at 07:54 -0800: > I'll sit down with a docs person and get the manpage markup done. It > was on my todo list; I just wanted to get the code committed now. Also, don't forget to document EVFILT_SENDFILE too! > On 24 February 2014 03:06, Gleb Smirnoff wrote: > > Adrian, > > > > On Mon, Feb 24, 2014 at 02:43:58AM +0000, Adrian Chadd wrote: > > A> Log: > > A> Add a new option - 'a ' - which spits out annotated callgraphs. > > A> > > A> '-m ' spits out the given stream into (eg, /dev/stdout). > > A> However, it only resolves the first symbol; it doesn't parse the entire > > A> callgraph. If it fails to lookup then it doesn't print anything. > > A> > > A> '-a' instead does a symbol and file:line lookup for each address in each > > A> callgraph and will happily print the address itself with no lookup > > A> information if it couldn't look things up. > > A> > > A> This makes it much easier to pull out individual records from a > > A> pmc data file and look at the callgraph information without having to > > A> hand-decode the addresses. > > A> > > A> Sponsored by: Netflix, Inc. > > > > Is it possible to spend 5 minutes and document new features in pmcstat(8)? > > Please! -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 19:19:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65FF8BB2; Mon, 24 Feb 2014 19:19:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 513EE1BB9; Mon, 24 Feb 2014 19:19:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1OJJarP071966; Mon, 24 Feb 2014 19:19:36 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1OJJaBi071965; Mon, 24 Feb 2014 19:19:36 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402241919.s1OJJaBi071965@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 24 Feb 2014 19:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262454 - head/sys/dev/usb/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 19:19:36 -0000 Author: hselasky Date: Mon Feb 24 19:19:35 2014 New Revision: 262454 URL: http://svnweb.freebsd.org/changeset/base/262454 Log: Fix compiler warning. Reported by: David Wolfskill MFC after: 2 weeks Modified: head/sys/dev/usb/input/atp.c Modified: head/sys/dev/usb/input/atp.c ============================================================================== --- head/sys/dev/usb/input/atp.c Mon Feb 24 18:44:22 2014 (r262453) +++ head/sys/dev/usb/input/atp.c Mon Feb 24 19:19:35 2014 (r262454) @@ -794,11 +794,6 @@ static void atp_convert_to_slide(st static void atp_reset_buf(struct atp_softc *); static void atp_add_to_queue(struct atp_softc *, int, int, int, uint32_t); -static const sensor_data_interpreter_t atp_sensor_data_interpreters[TRACKPAD_FAMILY_MAX] = { - [TRACKPAD_FAMILY_FOUNTAIN_GEYSER] = fg_interpret_sensor_data, - [TRACKPAD_FAMILY_WELLSPRING] = wsp_interpret_sensor_data, -}; - /* Device methods. */ static device_probe_t atp_probe; static device_attach_t atp_attach; From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 19:27:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 197D0E14; Mon, 24 Feb 2014 19:27:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 03E481C62; Mon, 24 Feb 2014 19:27:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1OJRQ8F075615; Mon, 24 Feb 2014 19:27:26 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1OJRQYs075614; Mon, 24 Feb 2014 19:27:26 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402241927.s1OJRQYs075614@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 24 Feb 2014 19:27:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262455 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 19:27:27 -0000 Author: hselasky Date: Mon Feb 24 19:27:26 2014 New Revision: 262455 URL: http://svnweb.freebsd.org/changeset/base/262455 Log: Update ATP manual page. Submitted by: Rohit Grover MFC after: 2 weeks Modified: head/share/man/man4/atp.4 Modified: head/share/man/man4/atp.4 ============================================================================== --- head/share/man/man4/atp.4 Mon Feb 24 19:19:35 2014 (r262454) +++ head/share/man/man4/atp.4 Mon Feb 24 19:27:26 2014 (r262455) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 23, 2014 +.Dd February 24, 2014 .Dt ATP 4 .Os .Sh NAME @@ -58,8 +58,9 @@ Single finger tap generates a left\-butt middle button; whereas a three\-finger tap gets treated as a right button click. .Pp -There is support for 2-finger horizontal scrolling, which translates to -page\-back/forward events. +There is support for 2\-finger horizontal scrolling, which translates to +page\-back/forward events; vertical multi\-finger scrolling emulates the mouse +wheel. .Pp A double\-tap followed by a drag is treated as a selection gesture; a virtual left\-button click is assumed for the lifespan of the drag. From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 19:32:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42A3F1AD; Mon, 24 Feb 2014 19:32:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2D86C1D2E; Mon, 24 Feb 2014 19:32:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1OJWGvn078999; Mon, 24 Feb 2014 19:32:16 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1OJWFng078996; Mon, 24 Feb 2014 19:32:15 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201402241932.s1OJWFng078996@svn.freebsd.org> From: Ruslan Bukin Date: Mon, 24 Feb 2014 19:32:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262456 - in head/sys: arm/conf boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 19:32:16 -0000 Author: br Date: Mon Feb 24 19:32:15 2014 New Revision: 262456 URL: http://svnweb.freebsd.org/changeset/base/262456 Log: Add support for Quartz Module. Quartz is a tiny module utilized Freescale VF6xx system-on-chip and development kit produced by Device Solutions. Quartz is available in a form of LGA (38x38x2mm) or as a module with high-density connectors. Sponsored by: Device Solutions Added: head/sys/arm/conf/QUARTZ (contents, props changed) head/sys/boot/fdt/dts/vybrid-quartz.dts (contents, props changed) Added: head/sys/arm/conf/QUARTZ ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/QUARTZ Mon Feb 24 19:32:15 2014 (r262456) @@ -0,0 +1,26 @@ +# Kernel configuration for Device Solutions Quartz Module. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include "VYBRID.common" +ident QUARTZ + +#FDT +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=vybrid-quartz.dts Added: head/sys/boot/fdt/dts/vybrid-quartz.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/vybrid-quartz.dts Mon Feb 24 19:32:15 2014 (r262456) @@ -0,0 +1,65 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/include/ "vybrid.dtsi" + +/ { + model = "Device Solutions Quartz Module"; + + memory { + device_type = "memory"; + reg = < 0x80000000 0x10000000 >; /* 256MB RAM */ + }; + + SOC: vybrid { + serial0: serial@40027000 { + status = "okay"; + }; + + fec1: ethernet@400D1000 { + status = "okay"; + iomux_config = < 54 0x1 55 0x1 + 56 0x1 57 0x1 + 58 0x1 59 0x1 + 60 0x1 61 0x1 + 62 0x1 0 0x2 >; + }; + + edma1: edma@40098000 { + status = "okay"; + }; + }; + + chosen { + bootargs = "-v"; + stdin = "serial0"; + stdout = "serial0"; + }; +}; From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 23:49:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 352CEDED; Mon, 24 Feb 2014 23:49:50 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 035FF1613; Mon, 24 Feb 2014 23:49:49 +0000 (UTC) Received: from glenbarber.us (nucleus.glenbarber.us [IPv6:2001:470:8:1205:2:2:ff:100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id C24702317E; Mon, 24 Feb 2014 23:49:42 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us C24702317E Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Mon, 24 Feb 2014 18:49:40 -0500 From: Glen Barber To: Tijl Coosemans Subject: Re: svn commit: r262447 - head/lib/libiconv_modules/VIQR Message-ID: <20140224234940.GZ76814@glenbarber.us> References: <201402241440.s1OEeTtL058876@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="W1uEbMXJ1Mj4g6TI" Content-Disposition: inline In-Reply-To: <201402241440.s1OEeTtL058876@svn.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 23:49:50 -0000 --W1uEbMXJ1Mj4g6TI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 24, 2014 at 02:40:29PM +0000, Tijl Coosemans wrote: > Author: tijl > Date: Mon Feb 24 14:40:28 2014 > New Revision: 262447 > URL: http://svnweb.freebsd.org/changeset/base/262447 >=20 > Log: > Fix an array index out of bounds bug in iconv VIQR (Vietnamese) module. > =20 This breaks gcc build. http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-ia64-ia64.full Glen --W1uEbMXJ1Mj4g6TI Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTC9qUAAoJELls3eqvi17Q3fYQAImRIzSwGjPzx49Wu9MyGV8P oqALEtAJm1kNjYeO+u8zLe1/7AyULAPb+5JbjbESmolsnWQ6eWbPRRTrIzQ0cT/w iNVErzzCewqMqlH1NNsWHuWKCwPCTNIUMk38IlA+tTSwow5P/DCddlMuzby5mhyg qf9vOKVVpdO+iJN5rKch1Z/wSAk0qMybFD+mz0twTho4WooDNxwH/Gx2pLX69EbM 1PF/8TuYNaEZXTJBZCL4VfGOruy9xa6buEawdUxhQy1f4YVRMDfhvDZqp1QWZE3S sTzf6+dONZVWTNAKCLsEbiVFN++5EZ8MyXTYeqb/ThKEf1Fp1yEfVQENHK94ln2m HP6qY4yrgl6mkeU1dxeZnMF7c4ophi1c/+HoFTd1oR4LsBd52jhnECM0w+oZjPnl /V8QawRT9+92seJeIjRiHQfGj0z4BDuzbytcM1qZN2C5mMrv/TbUmysjkyS2IJJg AmWWtNnjDysO3OPriyqFwNorikffui13ezaekGv8IdZ60zgAHpUJP//Au4Ab8kv0 x1wC8xF6RscLab/6qm7GcIeYGlLkNRVlRqeWWC5U9xK7UwECV6MgX3qBpcmns3zO 7NaIz6sW6X+aqGxRhm6YWkofarNuyyv1YhXi4l0FFrrQpLnzLpJFX0l0nJoHInsq tpihAwT/N0qjhBYL5QHj =3fQe -----END PGP SIGNATURE----- --W1uEbMXJ1Mj4g6TI-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 23:56:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2359171; Mon, 24 Feb 2014 23:56:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8F2AE1699; Mon, 24 Feb 2014 23:56:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1ONu9jH084861; Mon, 24 Feb 2014 23:56:09 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1ONu9F6084860; Mon, 24 Feb 2014 23:56:09 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402242356.s1ONu9F6084860@svn.freebsd.org> From: Xin LI Date: Mon, 24 Feb 2014 23:56:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262461 - head/lib/libiconv_modules/VIQR X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 23:56:09 -0000 Author: delphij Date: Mon Feb 24 23:56:09 2014 New Revision: 262461 URL: http://svnweb.freebsd.org/changeset/base/262461 Log: Patch 1/2: Pet gcc: enclose the for loop that currently do nothing with an if. Reviewed by: sha256(1) X-MFC-With: r262447 Modified: head/lib/libiconv_modules/VIQR/citrus_viqr.c Modified: head/lib/libiconv_modules/VIQR/citrus_viqr.c ============================================================================== --- head/lib/libiconv_modules/VIQR/citrus_viqr.c Mon Feb 24 21:48:03 2014 (r262460) +++ head/lib/libiconv_modules/VIQR/citrus_viqr.c Mon Feb 24 23:56:09 2014 (r262461) @@ -457,6 +457,7 @@ _citrus_VIQR_encoding_module_init(_VIQRE return (errnum); } } + if (mnemonic_ext > 0) { for (i = 0; i < mnemonic_ext_size; ++i) { p = &mnemonic_ext[i]; n = strlen(p->name); @@ -469,6 +470,7 @@ _citrus_VIQR_encoding_module_init(_VIQRE return (errnum); } } + } return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 24 23:58:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF3062C8; Mon, 24 Feb 2014 23:58:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CC1F116AC; Mon, 24 Feb 2014 23:58:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1ONw7b3085100; Mon, 24 Feb 2014 23:58:07 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1ONw7Zf085099; Mon, 24 Feb 2014 23:58:07 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402242358.s1ONw7Zf085099@svn.freebsd.org> From: Xin LI Date: Mon, 24 Feb 2014 23:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262462 - head/lib/libiconv_modules/VIQR X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 23:58:08 -0000 Author: delphij Date: Mon Feb 24 23:58:07 2014 New Revision: 262462 URL: http://svnweb.freebsd.org/changeset/base/262462 Log: Patch 2/2: Reindent the code after previous change. X-MFC-With: r262447 Modified: head/lib/libiconv_modules/VIQR/citrus_viqr.c Modified: head/lib/libiconv_modules/VIQR/citrus_viqr.c ============================================================================== --- head/lib/libiconv_modules/VIQR/citrus_viqr.c Mon Feb 24 23:56:09 2014 (r262461) +++ head/lib/libiconv_modules/VIQR/citrus_viqr.c Mon Feb 24 23:58:07 2014 (r262462) @@ -458,19 +458,19 @@ _citrus_VIQR_encoding_module_init(_VIQRE } } if (mnemonic_ext > 0) { - for (i = 0; i < mnemonic_ext_size; ++i) { - p = &mnemonic_ext[i]; - n = strlen(p->name); - if (ei->mb_cur_max < n) - ei->mb_cur_max = n; - errnum = mnemonic_append_child(ei->mroot, - p->name, p->value, ei->invalid); - if (errnum != 0) { - _citrus_VIQR_encoding_module_uninit(ei); - return (errnum); + for (i = 0; i < mnemonic_ext_size; ++i) { + p = &mnemonic_ext[i]; + n = strlen(p->name); + if (ei->mb_cur_max < n) + ei->mb_cur_max = n; + errnum = mnemonic_append_child(ei->mroot, + p->name, p->value, ei->invalid); + if (errnum != 0) { + _citrus_VIQR_encoding_module_uninit(ei); + return (errnum); + } } } - } return (0); } From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 00:57:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49854322; Tue, 25 Feb 2014 00:57:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 32AE11B18; Tue, 25 Feb 2014 00:57:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1P0v7P3011875; Tue, 25 Feb 2014 00:57:07 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1P0v7Ku011874; Tue, 25 Feb 2014 00:57:07 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402250057.s1P0v7Ku011874@svn.freebsd.org> From: Xin LI Date: Tue, 25 Feb 2014 00:57:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262463 - head/lib/libiconv_modules/VIQR X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 00:57:07 -0000 Author: delphij Date: Tue Feb 25 00:57:06 2014 New Revision: 262463 URL: http://svnweb.freebsd.org/changeset/base/262463 Log: Revert 262462 and 262461, they didn't solve the problem, in fact I should actually waited the build to be finished before committing. A proper fix would be committed once my test build passes. Pointy hat to: delphij Modified: head/lib/libiconv_modules/VIQR/citrus_viqr.c Modified: head/lib/libiconv_modules/VIQR/citrus_viqr.c ============================================================================== --- head/lib/libiconv_modules/VIQR/citrus_viqr.c Mon Feb 24 23:58:07 2014 (r262462) +++ head/lib/libiconv_modules/VIQR/citrus_viqr.c Tue Feb 25 00:57:06 2014 (r262463) @@ -457,18 +457,16 @@ _citrus_VIQR_encoding_module_init(_VIQRE return (errnum); } } - if (mnemonic_ext > 0) { - for (i = 0; i < mnemonic_ext_size; ++i) { - p = &mnemonic_ext[i]; - n = strlen(p->name); - if (ei->mb_cur_max < n) - ei->mb_cur_max = n; - errnum = mnemonic_append_child(ei->mroot, - p->name, p->value, ei->invalid); - if (errnum != 0) { - _citrus_VIQR_encoding_module_uninit(ei); - return (errnum); - } + for (i = 0; i < mnemonic_ext_size; ++i) { + p = &mnemonic_ext[i]; + n = strlen(p->name); + if (ei->mb_cur_max < n) + ei->mb_cur_max = n; + errnum = mnemonic_append_child(ei->mroot, + p->name, p->value, ei->invalid); + if (errnum != 0) { + _citrus_VIQR_encoding_module_uninit(ei); + return (errnum); } } From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 01:11:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F8F866B; Tue, 25 Feb 2014 01:11:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 295641C7E; Tue, 25 Feb 2014 01:11:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1P1B68H017557; Tue, 25 Feb 2014 01:11:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1P1B6NN017555; Tue, 25 Feb 2014 01:11:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402250111.s1P1B6NN017555@svn.freebsd.org> From: Xin LI Date: Tue, 25 Feb 2014 01:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262464 - head/lib/libiconv_modules/VIQR X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 01:11:06 -0000 Author: delphij Date: Tue Feb 25 01:11:05 2014 New Revision: 262464 URL: http://svnweb.freebsd.org/changeset/base/262464 Log: Wrap for loop in #if block testing the size is actually greater than 0. This silences gcc warning. Reviewed by: sha256(1) with clang X-MFC-With: r262447 Modified: head/lib/libiconv_modules/VIQR/citrus_viqr.c Modified: head/lib/libiconv_modules/VIQR/citrus_viqr.c ============================================================================== --- head/lib/libiconv_modules/VIQR/citrus_viqr.c Tue Feb 25 00:57:06 2014 (r262463) +++ head/lib/libiconv_modules/VIQR/citrus_viqr.c Tue Feb 25 01:11:05 2014 (r262464) @@ -433,7 +433,6 @@ static int _citrus_VIQR_encoding_module_init(_VIQREncodingInfo * __restrict ei, const void * __restrict var __unused, size_t lenvar __unused) { - const mnemonic_def_t *p; const char *s; size_t i, n; int errnum; @@ -457,7 +456,10 @@ _citrus_VIQR_encoding_module_init(_VIQRE return (errnum); } } +#if mnemonic_ext_size > 0 for (i = 0; i < mnemonic_ext_size; ++i) { + const mnemonic_def_t *p; + p = &mnemonic_ext[i]; n = strlen(p->name); if (ei->mb_cur_max < n) @@ -469,6 +471,7 @@ _citrus_VIQR_encoding_module_init(_VIQRE return (errnum); } } +#endif return (0); } From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 01:42:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27252BFF; Tue, 25 Feb 2014 01:42:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EF0E21FC8; Tue, 25 Feb 2014 01:42:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1P1g28i031425; Tue, 25 Feb 2014 01:42:02 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1P1g2gW031423; Tue, 25 Feb 2014 01:42:02 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201402250142.s1P1g2gW031423@svn.freebsd.org> From: Kevin Lo Date: Tue, 25 Feb 2014 01:42:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262465 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 01:42:03 -0000 Author: kevlo Date: Tue Feb 25 01:42:02 2014 New Revision: 262465 URL: http://svnweb.freebsd.org/changeset/base/262465 Log: Add a flag to run's device list which uses a standard scsi eject. The flag indicates that the mcu doesn't need to load firmware. Tested by: Alex Deiter , myself Tested on: ASUS USB-N66 Modified: head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_runvar.h Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Tue Feb 25 01:11:05 2014 (r262464) +++ head/sys/dev/usb/wlan/if_run.c Tue Feb 25 01:42:02 2014 (r262465) @@ -100,7 +100,8 @@ SYSCTL_INT(_hw_usb_run, OID_AUTO, debug, static const STRUCT_USB_HOST_ID run_devs[] = { #define RUN_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } #define RUN_DEV_EJECT(v,p) \ - { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, 0) } + { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, RUN_EJECT) } +#define RUN_EJECT 1 RUN_DEV(ABOCOM, RT2770), RUN_DEV(ABOCOM, RT2870), RUN_DEV(ABOCOM, RT3070), @@ -315,7 +316,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(ZINWELL, RT3072_2), RUN_DEV(ZYXEL, RT2870_1), RUN_DEV(ZYXEL, RT2870_2), - RUN_DEV(ZYXEL, NWD2705), + RUN_DEV_EJECT(ZYXEL, NWD2705), RUN_DEV_EJECT(RALINK, RT_STOR), #undef RUN_DEV_EJECT #undef RUN_DEV @@ -707,6 +708,8 @@ run_attach(device_t self) device_set_usb_desc(self); sc->sc_udev = uaa->device; sc->sc_dev = self; + if (USB_GET_DRIVER_INFO(uaa) != RUN_EJECT) + sc->sc_flags |= RUN_FLAG_FWLOAD_NEEDED; mtx_init(&sc->sc_mtx, device_get_nameunit(sc->sc_dev), MTX_NETWORK_LOCK, MTX_DEF); @@ -1151,7 +1154,7 @@ run_load_microcode(struct run_softc *sc) } /* write microcode image */ - if (sc->mac_ver != 0x3593) { + if (sc->sc_flags & RUN_FLAG_FWLOAD_NEEDED) { run_write_region_1(sc, RT2870_FW_BASE, base, 4096); run_write(sc, RT2860_H2M_MAILBOX_CID, 0xffffffff); run_write(sc, RT2860_H2M_MAILBOX_STATUS, 0xffffffff); Modified: head/sys/dev/usb/wlan/if_runvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_runvar.h Tue Feb 25 01:11:05 2014 (r262464) +++ head/sys/dev/usb/wlan/if_runvar.h Tue Feb 25 01:42:02 2014 (r262465) @@ -154,6 +154,11 @@ struct run_softc { device_t sc_dev; struct usb_device *sc_udev; struct ifnet *sc_ifp; + int sc_need_fwload; + + int sc_flags; +#define RUN_FLAG_FWLOAD_NEEDED 0x01 + uint16_t wcid_stats[RT2870_WCID_MAX + 1][3]; #define RUN_TXCNT 0 #define RUN_SUCCESS 1 From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 02:58:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 617073AC; Tue, 25 Feb 2014 02:58:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4CE6615C3; Tue, 25 Feb 2014 02:58:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1P2wCPN060660; Tue, 25 Feb 2014 02:58:12 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1P2wCDd060659; Tue, 25 Feb 2014 02:58:12 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402250258.s1P2wCDd060659@svn.freebsd.org> From: Mark Johnston Date: Tue, 25 Feb 2014 02:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262466 - head/sys/cddl/dev/systrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 02:58:12 -0000 Author: markj Date: Tue Feb 25 02:58:11 2014 New Revision: 262466 URL: http://svnweb.freebsd.org/changeset/base/262466 Log: Make all 8 syscall arguments available to syscall probes in the same way that this is done for SDT probes. This fixes the syscall/tst.args.d test, which was failing because mmap(2)'s sixth argument wasn't available to the probe. MFC after: 2 weeks Modified: head/sys/cddl/dev/systrace/systrace.c Modified: head/sys/cddl/dev/systrace/systrace.c ============================================================================== --- head/sys/cddl/dev/systrace/systrace.c Tue Feb 25 01:42:02 2014 (r262465) +++ head/sys/cddl/dev/systrace/systrace.c Tue Feb 25 02:58:11 2014 (r262466) @@ -168,6 +168,9 @@ static dtrace_pops_t systrace_pops = { static struct cdev *systrace_cdev; static dtrace_provider_id_t systrace_id; +typedef void (*systrace_dtrace_probe)(dtrace_id_t, uintptr_t, uintptr_t, + uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); + #if !defined(LINUX_SYSTRACE) /* * Probe callback function. @@ -211,7 +214,8 @@ systrace_probe(u_int32_t id, int sysnum, } /* Process the probe using the converted argments. */ - dtrace_probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4]); + ((systrace_dtrace_probe)(dtrace_probe))(id, uargs[0], uargs[1], + uargs[2], uargs[3], uargs[4], uargs[5], uargs[6], uargs[7]); } #endif From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 03:05:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02D787D4; Tue, 25 Feb 2014 03:05:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D57291722; Tue, 25 Feb 2014 03:05:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1P35hdG065455; Tue, 25 Feb 2014 03:05:43 GMT (envelope-from daichi@svn.freebsd.org) Received: (from daichi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1P35hsI065453; Tue, 25 Feb 2014 03:05:43 GMT (envelope-from daichi@svn.freebsd.org) Message-Id: <201402250305.s1P35hsI065453@svn.freebsd.org> From: Daichi GOTO Date: Tue, 25 Feb 2014 03:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262467 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 03:05:44 -0000 Author: daichi (ports committer) Date: Tue Feb 25 03:05:43 2014 New Revision: 262467 URL: http://svnweb.freebsd.org/changeset/base/262467 Log: sh: Add -h option to SYNOPSIS Reviewed by: jilles MFC after: soon Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Tue Feb 25 02:58:11 2014 (r262466) +++ head/bin/sh/sh.1 Tue Feb 25 03:05:43 2014 (r262467) @@ -40,14 +40,14 @@ .Nd command interpreter (shell) .Sh SYNOPSIS .Nm -.Op Fl /+abCEefIimnPpTuVvx +.Op Fl /+abCEefhIimnPpTuVvx .Op Fl /+o Ar longname .Oo .Ar script .Op Ar arg ... .Oc .Nm -.Op Fl /+abCEefIimnPpTuVvx +.Op Fl /+abCEefhIimnPpTuVvx .Op Fl /+o Ar longname .Fl c Ar string .Oo @@ -55,7 +55,7 @@ .Op Ar arg ... .Oc .Nm -.Op Fl /+abCEefIimnPpTuVvx +.Op Fl /+abCEefhIimnPpTuVvx .Op Fl /+o Ar longname .Fl s .Op Ar arg ... From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 03:08:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF0F3A3B for ; Tue, 25 Feb 2014 03:08:31 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B37101751 for ; Tue, 25 Feb 2014 03:08:31 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id s1P38VuM048480 for ; Tue, 25 Feb 2014 03:08:31 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s1P38Vw3048478 for svn-src-head@freebsd.org; Tue, 25 Feb 2014 03:08:31 GMT (envelope-from bdrewery) Received: (qmail 5613 invoked from network); 24 Feb 2014 21:08:27 -0600 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 24 Feb 2014 21:08:27 -0600 Message-ID: <530C091E.1030207@FreeBSD.org> Date: Mon, 24 Feb 2014 21:08:14 -0600 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Daichi GOTO , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r262467 - head/bin/sh References: <201402250305.s1P35hsI065453@svn.freebsd.org> In-Reply-To: <201402250305.s1P35hsI065453@svn.freebsd.org> X-Enigmail-Version: 1.6 OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fpDAaSPVU1DV8GUDaa5uuuQ70RWdDuRtL" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 03:08:32 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --fpDAaSPVU1DV8GUDaa5uuuQ70RWdDuRtL Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2/24/2014 9:05 PM, Daichi GOTO wrote: > Author: daichi (ports committer) > Date: Tue Feb 25 03:05:43 2014 > New Revision: 262467 > URL: http://svnweb.freebsd.org/changeset/base/262467 >=20 > Log: > sh: Add -h option to SYNOPSIS > =20 > Reviewed by: jilles > MFC after: soon >=20 > Modified: > head/bin/sh/sh.1 >=20 > Modified: head/bin/sh/sh.1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/bin/sh/sh.1 Tue Feb 25 02:58:11 2014 (r262466) > +++ head/bin/sh/sh.1 Tue Feb 25 03:05:43 2014 (r262467) > @@ -40,14 +40,14 @@ > .Nd command interpreter (shell) > .Sh SYNOPSIS > .Nm > -.Op Fl /+abCEefIimnPpTuVvx > +.Op Fl /+abCEefhIimnPpTuVvx > .Op Fl /+o Ar longname > .Oo > .Ar script > .Op Ar arg ... > .Oc > .Nm > -.Op Fl /+abCEefIimnPpTuVvx > +.Op Fl /+abCEefhIimnPpTuVvx > .Op Fl /+o Ar longname > .Fl c Ar string > .Oo > @@ -55,7 +55,7 @@ > .Op Ar arg ... > .Oc > .Nm > -.Op Fl /+abCEefIimnPpTuVvx > +.Op Fl /+abCEefhIimnPpTuVvx > .Op Fl /+o Ar longname > .Fl s > .Op Ar arg ... >=20 =2EDd bump is needed too. --=20 Regards, Bryan Drewery --fpDAaSPVU1DV8GUDaa5uuuQ70RWdDuRtL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJTDAkeAAoJEDXXcbtuRpfPN7UIAJV+OAijw38c10FTvCMD3Pg4 dI8EPXZzaoxCtI89UARvPA33RvG6XOeuRVvIplvYMmYGsLMwR2Zo0QUTvu/m4dhW WjwjUTUaZYPkfMvNOtSJjasjt9LC1UKRrwjZ5E2mIR6Kw6pEM+DPNw4u3u+3Dcf5 5w/AdJr/Wv7lXmKF3KeIEUwUDexIx+trlXmJTuujBnwy7cVo3rl69hvRXEFwZyuX y0cqcdUKI0xEoEHYuAqnzqiQ7gaRSOubNSTDjKQE5yDBuYPhgHv/C38SgNxG5cXT sdHTmY/9tMVPke3cs4mNfiD4EyIoph4qSfacLa+o4Gu/jREfA8vqLkRikJnPK2I= =WR2X -----END PGP SIGNATURE----- --fpDAaSPVU1DV8GUDaa5uuuQ70RWdDuRtL-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 03:11:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77597C09; Tue, 25 Feb 2014 03:11:50 +0000 (UTC) Received: from natial.ongs.co.jp (natial.ongs.co.jp [202.216.246.90]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 417E217ED; Tue, 25 Feb 2014 03:11:49 +0000 (UTC) Received: from [192.168.1.106] (dullmdaler.ongs.co.jp [202.216.246.94]) by natial.ongs.co.jp (Postfix) with ESMTPSA id B960212543C; Tue, 25 Feb 2014 12:11:37 +0900 (JST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r262467 - head/bin/sh From: Daichi GOTO In-Reply-To: <530C091E.1030207@FreeBSD.org> Date: Tue, 25 Feb 2014 12:11:36 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: <2BEF4677-F0F9-4A97-8029-9F4D6476DBA3@ongs.co.jp> References: <201402250305.s1P35hsI065453@svn.freebsd.org> <530C091E.1030207@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.1827) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Daichi GOTO , src-committers@freebsd.org, jilles@stack.nl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 03:11:50 -0000 Hi Bryan, Yeah you are right. But it seems not very important for a change=20 like this for .Dd bump. Even so should I update .Dd ? 2014/02/25 12:08=E3=80=81Bryan Drewery : > On 2/24/2014 9:05 PM, Daichi GOTO wrote: >> Author: daichi (ports committer) >> Date: Tue Feb 25 03:05:43 2014 >> New Revision: 262467 >> URL: http://svnweb.freebsd.org/changeset/base/262467 >>=20 >> Log: >> sh: Add -h option to SYNOPSIS >>=20 >> Reviewed by: jilles >> MFC after: soon >>=20 >> Modified: >> head/bin/sh/sh.1 >>=20 >> Modified: head/bin/sh/sh.1 >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/bin/sh/sh.1 Tue Feb 25 02:58:11 2014 (r262466) >> +++ head/bin/sh/sh.1 Tue Feb 25 03:05:43 2014 (r262467) >> @@ -40,14 +40,14 @@ >> .Nd command interpreter (shell) >> .Sh SYNOPSIS >> .Nm >> -.Op Fl /+abCEefIimnPpTuVvx >> +.Op Fl /+abCEefhIimnPpTuVvx >> .Op Fl /+o Ar longname >> .Oo >> .Ar script >> .Op Ar arg ... >> .Oc >> .Nm >> -.Op Fl /+abCEefIimnPpTuVvx >> +.Op Fl /+abCEefhIimnPpTuVvx >> .Op Fl /+o Ar longname >> .Fl c Ar string >> .Oo >> @@ -55,7 +55,7 @@ >> .Op Ar arg ... >> .Oc >> .Nm >> -.Op Fl /+abCEefIimnPpTuVvx >> +.Op Fl /+abCEefhIimnPpTuVvx >> .Op Fl /+o Ar longname >> .Fl s >> .Op Ar arg ... >>=20 >=20 > .Dd bump is needed too. >=20 > --=20 > Regards, > Bryan Drewery >=20 -- Daichi GOTO CEO | ONGS Inc. 81-42-316-7945 | daichi@ongs.co.jp | http://www.ongs.co.jp LinkedIn: http://linkedin.com/in/daichigoto From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 06:22:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DE2F91F; Tue, 25 Feb 2014 06:22:31 +0000 (UTC) Received: from vps.rulingia.com (vps.rulingia.com [103.243.244.15]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BBC012F82; Tue, 25 Feb 2014 06:22:30 +0000 (UTC) Received: from server.rulingia.com (c220-239-232-212.belrs5.nsw.optusnet.com.au [220.239.232.212]) by vps.rulingia.com (8.14.7/8.14.7) with ESMTP id s1P6MSnP025989 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 25 Feb 2014 17:22:28 +1100 (EST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.14.7/8.14.7) with ESMTP id s1P6MMdL085263 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 25 Feb 2014 17:22:22 +1100 (EST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.7/8.14.7/Submit) id s1P6MMqc085262; Tue, 25 Feb 2014 17:22:22 +1100 (EST) (envelope-from peter) Date: Tue, 25 Feb 2014 17:22:22 +1100 From: Peter Jeremy To: Baptiste Daroussin Subject: Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... Message-ID: <20140225062222.GB2705@server.rulingia.com> References: <201402210726.s1L7QnBP007144@svn.freebsd.org> <20140222082350.GA2705@server.rulingia.com> <20140222121438.GO1699@ithaqua.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TakKZr9L6Hm6aLOc" Content-Disposition: inline In-Reply-To: <20140222121438.GO1699@ithaqua.etoilebsd.net> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 06:22:31 -0000 --TakKZr9L6Hm6aLOc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2014-Feb-22 13:14:38 +0100, Baptiste Daroussin wrote: >On Sat, Feb 22, 2014 at 07:23:50PM +1100, Peter Jeremy wrote: >> I'd also query the reason for including Debian-specific code in the >> FreeBSD base. >Where have you seen debian specific code? /usr/src/contrib/dma/debian - as far as I can tell, this directory is Debion specific. I thought we stripped out irrelevant code from third party imports but looking wider, there is similarly irrelevant code in a variety of other contrib imports. I'll withdraw that objection. --=20 Peter Jeremy --TakKZr9L6Hm6aLOc Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iKYEARECAGYFAlMMNp5fFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl bnBncC5maWZ0aGhvcnNlbWFuLm5ldDBCRjc3QTcyNTg5NEVCRTY0RjREN0VFRUZF OEE0N0JGRjAwRkI4ODcACgkQ/opHv/APuIcxlgCgl2wtt+WtgWFE2E5uiffw7lJe WxoAn2cqFe7NSAw4pbhP4vUXkboWbAJg =onbG -----END PGP SIGNATURE----- --TakKZr9L6Hm6aLOc-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 07:28:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A914157A; Tue, 25 Feb 2014 07:28:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 94A1E1542; Tue, 25 Feb 2014 07:28:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1P7SpK7071809; Tue, 25 Feb 2014 07:28:51 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1P7SpOo071808; Tue, 25 Feb 2014 07:28:51 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402250728.s1P7SpOo071808@svn.freebsd.org> From: Dimitry Andric Date: Tue, 25 Feb 2014 07:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262471 - head/sys/sparc64/sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 07:28:51 -0000 Author: dim Date: Tue Feb 25 07:28:51 2014 New Revision: 262471 URL: http://svnweb.freebsd.org/changeset/base/262471 Log: In sys/sparc64/sparc64/spitfire.c, prevent signed shift overflow by casting to the appropriate type. (Note this fix cannot be done in sys/sparc64/sparc64/spitfire.c, since that file is also included by assembly source files.) Reviewed by: marius MFC after: 3 days Modified: head/sys/sparc64/sparc64/spitfire.c Modified: head/sys/sparc64/sparc64/spitfire.c ============================================================================== --- head/sys/sparc64/sparc64/spitfire.c Tue Feb 25 06:29:56 2014 (r262470) +++ head/sys/sparc64/sparc64/spitfire.c Tue Feb 25 07:28:51 2014 (r262471) @@ -130,7 +130,7 @@ spitfire_icache_page_inval(vm_paddr_t pa : "=r" (tag) : "r" (addr), "n" (ASI_ICACHE_TAG)); if (((tag >> IC_VALID_SHIFT) & IC_VALID_MASK) == 0) continue; - tag &= IC_TAG_MASK << IC_TAG_SHIFT; + tag &= (u_long)IC_TAG_MASK << IC_TAG_SHIFT; if (tag == target) { PMAP_STATS_INC(spitfire_icache_npage_inval_match); stxa_sync(addr, ASI_ICACHE_TAG, tag); From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 07:33:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD34679E; Tue, 25 Feb 2014 07:33:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A97BD1634; Tue, 25 Feb 2014 07:33:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1P7XSj1075201; Tue, 25 Feb 2014 07:33:28 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1P7XSbL075200; Tue, 25 Feb 2014 07:33:28 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402250733.s1P7XSbL075200@svn.freebsd.org> From: Dimitry Andric Date: Tue, 25 Feb 2014 07:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262472 - head/sys/sparc64/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 07:33:28 -0000 Author: dim Date: Tue Feb 25 07:33:28 2014 New Revision: 262472 URL: http://svnweb.freebsd.org/changeset/base/262472 Log: Make sure a for loop in fire_alloc_msix() terminates, by making the loop counter signed. Reviewed by: marius MFC after: 3 days Modified: head/sys/sparc64/pci/fire.c Modified: head/sys/sparc64/pci/fire.c ============================================================================== --- head/sys/sparc64/pci/fire.c Tue Feb 25 07:28:51 2014 (r262471) +++ head/sys/sparc64/pci/fire.c Tue Feb 25 07:33:28 2014 (r262472) @@ -1688,7 +1688,7 @@ static int fire_alloc_msix(device_t dev, device_t child, int *irq) { struct fire_softc *sc; - u_int i, msiq; + int i, msiq; sc = device_get_softc(dev); if ((sc->sc_flags & FIRE_MSIX) == 0) From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 07:52:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E886BCCC; Tue, 25 Feb 2014 07:52:26 +0000 (UTC) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 27907180A; Tue, 25 Feb 2014 07:52:26 +0000 (UTC) Received: by mail-wi0-f178.google.com with SMTP id cc10so286757wib.5 for ; Mon, 24 Feb 2014 23:52:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=lVYCHb+bX6J3+flv40w3YEqhPPvVgfp4KxpZVLu9W9Y=; b=qu1pcSyJUrDCwdLhAm96YxoU9Z52m4+j3KeaFtP36e5DkFizmJzXF4QeUgjzMAsB9B xDING55lQt/3hs/2ep+HV6DoE3MJp/cfLjJHkdq3s6+96sZilw+y2C95tFVI6oMQgjYC 7psCvLkgOpmPdgbK3COPNmaL4yGL3Bn0Wpz4YACQy7FHTWNnxarapXdnrewXIZEK6mjU 5Am9UdIV0xC0xRZlBZz8hn76NHIPCz9gYL5mFf6Zz15Yx+5ift0dRpKbUZG0DHfMcbIl wvOHWQXV4qqq8y7wtIjgm5w51QDTRlfU8JRM7yYzn8yoJRACeCDx7aUaJT0OCnR0qJE9 aKfA== X-Received: by 10.180.149.206 with SMTP id uc14mr1338320wib.10.1393314744462; Mon, 24 Feb 2014 23:52:24 -0800 (PST) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPSA id fm3sm31541537wib.8.2014.02.24.23.52.22 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 24 Feb 2014 23:52:22 -0800 (PST) Sender: Baptiste Daroussin Date: Tue, 25 Feb 2014 08:52:20 +0100 From: Baptiste Daroussin To: Peter Jeremy Subject: Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... Message-ID: <20140225075220.GF83610@ithaqua.etoilebsd.net> References: <201402210726.s1L7QnBP007144@svn.freebsd.org> <20140222082350.GA2705@server.rulingia.com> <20140222121438.GO1699@ithaqua.etoilebsd.net> <20140225062222.GB2705@server.rulingia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="R6sEYoIZpp9JErk7" Content-Disposition: inline In-Reply-To: <20140225062222.GB2705@server.rulingia.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 07:52:27 -0000 --R6sEYoIZpp9JErk7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 25, 2014 at 05:22:22PM +1100, Peter Jeremy wrote: > On 2014-Feb-22 13:14:38 +0100, Baptiste Daroussin wrot= e: > >On Sat, Feb 22, 2014 at 07:23:50PM +1100, Peter Jeremy wrote: > >> I'd also query the reason for including Debian-specific code in the > >> FreeBSD base. >=20 > >Where have you seen debian specific code? >=20 > /usr/src/contrib/dma/debian - as far as I can tell, this directory is > Debion specific. I thought we stripped out irrelevant code from third > party imports but looking wider, there is similarly irrelevant code in > a variety of other contrib imports. I'll withdraw that objection. >=20 > --=20 > Peter Jeremy Have you already looked at how contrib works? who cares FYI you can also fi= nd some win32 specific code in there, debian packaging code, rpm spec files et= c. regards, Bapt --R6sEYoIZpp9JErk7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (FreeBSD) iEYEARECAAYFAlMMS7QACgkQ8kTtMUmk6Ew0SACgjwYl+oRLW4xjgVkDlF6aUpep 23cAn1XUn3RqeEMxtvmzNcctAhQ3NM58 =fKsd -----END PGP SIGNATURE----- --R6sEYoIZpp9JErk7-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 08:37:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65624F9F; Tue, 25 Feb 2014 08:37:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 455FE1BF7; Tue, 25 Feb 2014 08:37:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1P8b7ZI000560; Tue, 25 Feb 2014 08:37:07 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1P8b7lr000559; Tue, 25 Feb 2014 08:37:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402250837.s1P8b7lr000559@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 25 Feb 2014 08:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262477 - head/sys/dev/usb/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 08:37:07 -0000 Author: hselasky Date: Tue Feb 25 08:37:06 2014 New Revision: 262477 URL: http://svnweb.freebsd.org/changeset/base/262477 Log: Updates for WSP driver: 1) Add support for page back/forward. 2) While doing HOR scrolling, disable VER scrolling. 3) Checking dx_sum and dy_sum before emulate right button, this can avoids unexpected right button press. 4) Fix stable pointer operation when emulating middle button. Submitted by: Huang Wen Hui MFC after: 2 weeks Modified: head/sys/dev/usb/input/wsp.c Modified: head/sys/dev/usb/input/wsp.c ============================================================================== --- head/sys/dev/usb/input/wsp.c Tue Feb 25 07:59:33 2014 (r262476) +++ head/sys/dev/usb/input/wsp.c Tue Feb 25 08:37:06 2014 (r262477) @@ -94,8 +94,8 @@ static struct wsp_tuning { .z_factor = 5, .pressure_touch_threshold = 50, .pressure_untouch_threshold = 10, - .pressure_tap_threshold = 120, - .scr_hor_threshold = 50, + .pressure_tap_threshold = 100, + .scr_hor_threshold = 10, }; static void @@ -791,9 +791,13 @@ wsp_intr_callback(struct usb_xfer *xfer, } break; case 2: - if (sc->distance < MAX_DISTANCE) + DPRINTFN(WSP_LLEVEL_INFO, "sum_x=%5d, sum_y=%5d\n", + sc->dx_sum, sc->dy_sum); + if (sc->distance < MAX_DISTANCE && abs(sc->dx_sum) < 5 && + abs(sc->dy_sum) < 5) { wsp_add_to_queue(sc, 0, 0, 0, MOUSE_BUTTON3DOWN); - DPRINTFN(WSP_LLEVEL_INFO, "RIGHT CLICK!\n"); + DPRINTFN(WSP_LLEVEL_INFO, "RIGHT CLICK!\n"); + } break; case 3: wsp_add_to_queue(sc, 0, 0, 0, MOUSE_BUTTON2DOWN); @@ -804,8 +808,7 @@ wsp_intr_callback(struct usb_xfer *xfer, } wsp_add_to_queue(sc, 0, 0, 0, 0); /* button release */ } - if (sc->intr_count >= WSP_TAP_MAX_COUNT && - (sc->dt_sum / tun.scr_hor_threshold) != 0 && + if ((sc->dt_sum / tun.scr_hor_threshold) != 0 && sc->ntaps == 2 && sc->scr_mode == WSP_SCR_HOR) { /* @@ -903,7 +906,7 @@ wsp_intr_callback(struct usb_xfer *xfer, if (ntouch == 2 && sc->sc_status.button == 0) { if (sc->scr_mode == WSP_SCR_NONE && - abs(sc->dx_sum) + abs(sc->dy_sum) > 50) + abs(sc->dx_sum) + abs(sc->dy_sum) > tun.scr_hor_threshold) sc->scr_mode = abs(sc->dx_sum) > abs(sc->dy_sum) ? WSP_SCR_HOR : WSP_SCR_VER; @@ -918,10 +921,16 @@ wsp_intr_callback(struct usb_xfer *xfer, dy = 0; if (sc->dz_count == 0) dz = sc->dz_sum / tun.z_factor; - if (abs(sc->pos_x[0] - sc->pos_x[1]) > MAX_DISTANCE || + if (sc->scr_mode == WSP_SCR_HOR || + abs(sc->pos_x[0] - sc->pos_x[1]) > MAX_DISTANCE || abs(sc->pos_y[0] - sc->pos_y[1]) > MAX_DISTANCE) dz = 0; } + if (ntouch == 3) { + dx = 0; + dy = 0; + dz = 0; + } if (sc->intr_count < WSP_TAP_MAX_COUNT && abs(dx) < 3 && abs(dy) < 3 && abs(dz) < 3) { dx = dy = dz = 0; From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 08:50:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24E47596; Tue, 25 Feb 2014 08:50:01 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E28EB1CE7; Tue, 25 Feb 2014 08:50:00 +0000 (UTC) Received: from [192.168.0.7] (cpc28-cmbg15-2-0-cust64.5-4.cable.virginm.net [86.27.189.65]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.5) with ESMTP id s1P8nrT2069813 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 25 Feb 2014 08:49:55 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... From: David Chisnall In-Reply-To: <20140225075220.GF83610@ithaqua.etoilebsd.net> Date: Tue, 25 Feb 2014 08:49:47 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201402210726.s1L7QnBP007144@svn.freebsd.org> <20140222082350.GA2705@server.rulingia.com> <20140222121438.GO1699@ithaqua.etoilebsd.net> <20140225062222.GB2705@server.rulingia.com> <20140225075220.GF83610@ithaqua.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.1827) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Peter Jeremy X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 08:50:01 -0000 On 25 Feb 2014, at 07:52, Baptiste Daroussin wrote: > On Tue, Feb 25, 2014 at 05:22:22PM +1100, Peter Jeremy wrote: >> On 2014-Feb-22 13:14:38 +0100, Baptiste Daroussin = wrote: >>> On Sat, Feb 22, 2014 at 07:23:50PM +1100, Peter Jeremy wrote: >>>> I'd also query the reason for including Debian-specific code in the >>>> FreeBSD base. >>=20 >>> Where have you seen debian specific code? >>=20 >> /usr/src/contrib/dma/debian - as far as I can tell, this directory is >> Debion specific. I thought we stripped out irrelevant code from = third >> party imports but looking wider, there is similarly irrelevant code = in >> a variety of other contrib imports. I'll withdraw that objection. >>=20 >> --=20 >> Peter Jeremy >=20 > Have you already looked at how contrib works? who cares FYI you can = also find > some win32 specific code in there, debian packaging code, rpm spec = files etc. For the libc++ imports, we strip out the support directory, which = contains Solaris and Win32-specific stuff. If we end up with a = support/freebsd, then we'll bring that in, but not support/solaris and = support/win32. That stuff is in the vendor branch, but it just seems = polite not to make people who check out head get files that are never = used when building FreeBSD in any configuration. David From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 09:34:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD95F21A; Tue, 25 Feb 2014 09:34:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 96EC21319; Tue, 25 Feb 2014 09:34:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1P9YUZp025906; Tue, 25 Feb 2014 09:34:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1P9YU0V025905; Tue, 25 Feb 2014 09:34:30 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402250934.s1P9YU0V025905@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 25 Feb 2014 09:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262478 - head/sys/dev/usb/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 09:34:30 -0000 Author: hselasky Date: Tue Feb 25 09:34:30 2014 New Revision: 262478 URL: http://svnweb.freebsd.org/changeset/base/262478 Log: Don't generate devd rules for WSP device ID's found in the ATP driver yet. MFC after: 2 weeks Modified: head/sys/dev/usb/input/atp.c Modified: head/sys/dev/usb/input/atp.c ============================================================================== --- head/sys/dev/usb/input/atp.c Tue Feb 25 08:37:06 2014 (r262477) +++ head/sys/dev/usb/input/atp.c Tue Feb 25 09:34:30 2014 (r262478) @@ -509,7 +509,8 @@ static const struct wsp_dev_params wsp_d #define ATP_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } -static const STRUCT_USB_HOST_ID wsp_devs[] = { +/* TODO: STRUCT_USB_HOST_ID */ +static const struct usb_device_id wsp_devs[] = { /* MacbookAir1.1 */ ATP_DEV(APPLE, WELLSPRING_ANSI, WELLSPRING_DRIVER_INFO(WELLSPRING1)), ATP_DEV(APPLE, WELLSPRING_ISO, WELLSPRING_DRIVER_INFO(WELLSPRING1)), From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 10:29:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 579A799; Tue, 25 Feb 2014 10:29:07 +0000 (UTC) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 68AF01834; Tue, 25 Feb 2014 10:29:06 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id hi5so4086570wib.1 for ; Tue, 25 Feb 2014 02:29:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=8Ggi7MPMTAgrfg6Ms61U7JDH0qC996AmYuMnYmbeE3w=; b=DggzAlalD7r4CMe1jlylXTyDp/ADiLXvpEMBpIxouah606fAH9y//ZD8pIQt5pHuNc lgQJPsNtJLWgypPjLO4j/+Irw/5vrShOwRx7Qgr5vxN0+UtSLsRWRYALuFHD1nV8NAAH feuBpqrwOZr41uPR4UlxARUJ/ubcZ/ZSu/hMeclkTXAQS9cI3EMAZMKmbK1zARSp5moY QAU8e6RXtPo/qvj1ttYwaJt3fByR1ld9cMG7fksfus956dvaKna5bI5y9XuA996VZ5Ha KvtgKW1HyRYAR7WXe4afsPKjB1s5BXODxJfppU2+lpfd/+z1UZqaWIE7MQ/LjLLZ212x WjQA== X-Received: by 10.194.93.193 with SMTP id cw1mr926963wjb.72.1393324142330; Tue, 25 Feb 2014 02:29:02 -0800 (PST) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPSA id t6sm32716070wix.4.2014.02.25.02.29.00 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 25 Feb 2014 02:29:00 -0800 (PST) Sender: Baptiste Daroussin Date: Tue, 25 Feb 2014 11:28:58 +0100 From: Baptiste Daroussin To: David Chisnall Subject: Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... Message-ID: <20140225102858.GG83610@ithaqua.etoilebsd.net> References: <201402210726.s1L7QnBP007144@svn.freebsd.org> <20140222082350.GA2705@server.rulingia.com> <20140222121438.GO1699@ithaqua.etoilebsd.net> <20140225062222.GB2705@server.rulingia.com> <20140225075220.GF83610@ithaqua.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RDS4xtyBfx+7DiaI" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Peter Jeremy X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 10:29:07 -0000 --RDS4xtyBfx+7DiaI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 25, 2014 at 08:49:47AM +0000, David Chisnall wrote: > On 25 Feb 2014, at 07:52, Baptiste Daroussin wrote: >=20 > > On Tue, Feb 25, 2014 at 05:22:22PM +1100, Peter Jeremy wrote: > >> On 2014-Feb-22 13:14:38 +0100, Baptiste Daroussin w= rote: > >>> On Sat, Feb 22, 2014 at 07:23:50PM +1100, Peter Jeremy wrote: > >>>> I'd also query the reason for including Debian-specific code in the > >>>> FreeBSD base. > >>=20 > >>> Where have you seen debian specific code? > >>=20 > >> /usr/src/contrib/dma/debian - as far as I can tell, this directory is > >> Debion specific. I thought we stripped out irrelevant code from third > >> party imports but looking wider, there is similarly irrelevant code in > >> a variety of other contrib imports. I'll withdraw that objection. > >>=20 > >> --=20 > >> Peter Jeremy > >=20 > > Have you already looked at how contrib works? who cares FYI you can als= o find > > some win32 specific code in there, debian packaging code, rpm spec file= s etc. >=20 > For the libc++ imports, we strip out the support directory, which contain= s Solaris and Win32-specific stuff. If we end up with a support/freebsd, t= hen we'll bring that in, but not support/solaris and support/win32. That s= tuff is in the vendor branch, but it just seems polite not to make people w= ho check out head get files that are never used when building FreeBSD in an= y configuration. >=20 > David Last time I asked about those (iirc when importing byacc) I have been told = that as long as they are not huge (aka take long to checkout) we do not care abo= ut them anymore and that simplifies mergeing from vendor. regards, Bapt --RDS4xtyBfx+7DiaI Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (FreeBSD) iEYEARECAAYFAlMMcGkACgkQ8kTtMUmk6EzZyACfX3+0aK1aMHeUZFPZux8hbMoO fzUAn06XnPsz1BWAznXX2Y2qO3UHw7tf =NdMt -----END PGP SIGNATURE----- --RDS4xtyBfx+7DiaI-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 13:48:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1774DE76; Tue, 25 Feb 2014 13:48:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 042531ADF; Tue, 25 Feb 2014 13:48:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1PDm5L2030181; Tue, 25 Feb 2014 13:48:05 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1PDm5Zp030180; Tue, 25 Feb 2014 13:48:05 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201402251348.s1PDm5Zp030180@svn.freebsd.org> From: Julio Merino Date: Tue, 25 Feb 2014 13:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262480 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 13:48:06 -0000 Author: jmmv Date: Tue Feb 25 13:48:05 2014 New Revision: 262480 URL: http://svnweb.freebsd.org/changeset/base/262480 Log: Increase maximum number of columns to support 1980x1200 displays. In my specific case, this fixes the problem of my PowerMac G5 displaying a 4:3 console on a 16:10 display with black bars on the left and right. PR: kern/180558 Reviewed by: nwhitehorn MFC after: 5 days Modified: head/sys/dev/syscons/syscons.h Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Tue Feb 25 12:13:11 2014 (r262479) +++ head/sys/dev/syscons/syscons.h Tue Feb 25 13:48:05 2014 (r262480) @@ -145,9 +145,9 @@ /* The following #defines are hard-coded for a maximum text resolution corresponding to a maximum framebuffer - resolution of 1600x1200 with an 8x8 font... + resolution of 1980x1200 with an 8x8 font... */ -#define COL 200 +#define COL 240 #define ROW 150 #define PCBURST 128 From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 14:30:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9BEF7C56; Tue, 25 Feb 2014 14:30:10 +0000 (UTC) Received: from mail-vc0-x22a.google.com (mail-vc0-x22a.google.com [IPv6:2607:f8b0:400c:c03::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1ECF01F8C; Tue, 25 Feb 2014 14:30:10 +0000 (UTC) Received: by mail-vc0-f170.google.com with SMTP id hu8so7353369vcb.15 for ; Tue, 25 Feb 2014 06:30:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=vI0+eI1L1eiL0xYhMP8EfNXxs0KGvz/RKXCixl1Q2QQ=; b=eASGqi+S2uSjUFP2GGMRj4n5xUf2iSKWyOuYJpnb1XK5BOpnxwp0YPaM+au9eeBXNG GGeEKYgqnC5iNZChilXBI0PbRrQdHI7K0acfpeNW5oeuMJZwsCp9QHENgx/M4IkRXxN6 NJ92ENS91q4pPRyfMM1GfdsWSZgnvDtCb55K598mYHSjLua9gb0K7Ri16mDRQ6FE/kFC xk6Vyu4xE8lfuk88xfb6ydjGDk0hWMcHadko9p2zg8yyBP6Bg7PWhflm9X4HpagZNUBC hz3Lwsb7ExqaDYfbDZPMzMv7i6bR34sHMcb1+jZ2WuIjpQBWWbCEE3DQzJ2syMGXP7n4 7TlQ== MIME-Version: 1.0 X-Received: by 10.52.109.3 with SMTP id ho3mr15859vdb.76.1393338609182; Tue, 25 Feb 2014 06:30:09 -0800 (PST) Received: by 10.220.168.135 with HTTP; Tue, 25 Feb 2014 06:30:09 -0800 (PST) In-Reply-To: <201402251348.s1PDm5Zp030180@svn.freebsd.org> References: <201402251348.s1PDm5Zp030180@svn.freebsd.org> Date: Tue, 25 Feb 2014 09:30:09 -0500 Message-ID: Subject: Re: svn commit: r262480 - head/sys/dev/syscons From: Thomas Hoffmann To: svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: Julio Merino X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 14:30:10 -0000 On Tue, Feb 25, 2014 at 8:48 AM, Julio Merino wrote: > Author: jmmv > Date: Tue Feb 25 13:48:05 2014 > New Revision: 262480 > URL: http://svnweb.freebsd.org/changeset/base/262480 > > Log: > Increase maximum number of columns to support 1980x1200 displays. > > In my specific case, this fixes the problem of my PowerMac G5 displaying > a > 4:3 console on a 16:10 display with black bars on the left and right. > > PR: kern/180558 > Reviewed by: nwhitehorn > MFC after: 5 days > > Modified: > head/sys/dev/syscons/syscons.h > > Modified: head/sys/dev/syscons/syscons.h > > ============================================================================== > --- head/sys/dev/syscons/syscons.h Tue Feb 25 12:13:11 2014 > (r262479) > +++ head/sys/dev/syscons/syscons.h Tue Feb 25 13:48:05 2014 > (r262480) > @@ -145,9 +145,9 @@ > /* > The following #defines are hard-coded for a maximum text > resolution corresponding to a maximum framebuffer > - resolution of 1600x1200 with an 8x8 font... > + resolution of 1980x1200 with an 8x8 font... > */ > -#define COL 200 > +#define COL 240 > #define ROW 150 > > #define PCBURST 128 > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > The math works out OK for COL 240, but the comment has it wrong. Should be 1920x1200. From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 15:22:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C2E917F; Tue, 25 Feb 2014 15:22:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2D9AB15B4; Tue, 25 Feb 2014 15:22:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1PFMfJ5071386; Tue, 25 Feb 2014 15:22:41 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1PFMfHr071385; Tue, 25 Feb 2014 15:22:41 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402251522.s1PFMfHr071385@svn.freebsd.org> From: Ian Lepore Date: Tue, 25 Feb 2014 15:22:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262482 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 15:22:41 -0000 Author: ian Date: Tue Feb 25 15:22:40 2014 New Revision: 262482 URL: http://svnweb.freebsd.org/changeset/base/262482 Log: Invalidate the SCU cache tag ram on all 4 cores, not just 1-3. I misread Juergen's original code, it was doing all 4 cores. Also remove the L2 cache invalidate operation, this code runs before L2 is activated. Modified: head/sys/arm/freescale/imx/imx6_mp.c Modified: head/sys/arm/freescale/imx/imx6_mp.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_mp.c Tue Feb 25 14:47:34 2014 (r262481) +++ head/sys/arm/freescale/imx/imx6_mp.c Tue Feb 25 15:22:40 2014 (r262482) @@ -113,11 +113,11 @@ platform_mp_start_ap(void) panic("Couldn't map the system reset controller (SRC)\n"); /* - * Invalidate SCU cache tags. The 0x0000fff0 constant invalidates all - * ways on all cores 1-3 (leaving core 0 alone). Per the ARM docs, it's - * harmless to write to the bits for cores that are not present. + * Invalidate SCU cache tags. The 0x0000ffff constant invalidates all + * ways on all cores 0-3. Per the ARM docs, it's harmless to write to + * the bits for cores that are not present. */ - bus_space_write_4(fdtbus_bs_tag, scu, SCU_INV_TAGS_REG, 0x0000fff0); + bus_space_write_4(fdtbus_bs_tag, scu, SCU_INV_TAGS_REG, 0x0000ffff); /* * Erratum ARM/MP: 764369 (problems with cache maintenance). @@ -128,13 +128,17 @@ platform_mp_start_ap(void) bus_space_write_4(fdtbus_bs_tag, scu, SCU_DIAG_CONTROL, val | SCU_DIAG_DISABLE_MIGBIT); - /* Enable the SCU. */ + /* + * Enable the SCU, then clean the cache on this core. After these two + * operations the cache tag ram in the SCU is coherent with the contents + * of the cache on this core. The other cores aren't running yet so + * their caches can't contain valid data yet, but we've initialized + * their SCU tag ram above, so they will be coherent from startup. + */ val = bus_space_read_4(fdtbus_bs_tag, scu, SCU_CONTROL_REG); bus_space_write_4(fdtbus_bs_tag, scu, SCU_CONTROL_REG, val | SCU_CONTROL_ENABLE); - cpu_idcache_wbinv_all(); - cpu_l2cache_wbinv_all(); /* * For each AP core, set the entry point address and argument registers, From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 17:02:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82A4DE50; Tue, 25 Feb 2014 17:02:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6CECE1FD6; Tue, 25 Feb 2014 17:02:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1PH2DHZ013779; Tue, 25 Feb 2014 17:02:13 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1PH2C6R013768; Tue, 25 Feb 2014 17:02:12 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201402251702.s1PH2C6R013768@svn.freebsd.org> From: Ruslan Bukin Date: Tue, 25 Feb 2014 17:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262483 - in head/sys: arm/freescale/vybrid boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 17:02:13 -0000 Author: br Date: Tue Feb 25 17:02:11 2014 New Revision: 262483 URL: http://svnweb.freebsd.org/changeset/base/262483 Log: - Pin configuration is a complete iomux register now and includes drive strength, pull mode, mux mode, speed, etc. - Add i2c devices to the tree - Add IPG clock Modified: head/sys/arm/freescale/vybrid/vf_ccm.c head/sys/arm/freescale/vybrid/vf_iomuxc.c head/sys/boot/fdt/dts/vybrid-colibri-vf50.dts head/sys/boot/fdt/dts/vybrid-cosmic.dts head/sys/boot/fdt/dts/vybrid-quartz.dts head/sys/boot/fdt/dts/vybrid.dtsi Modified: head/sys/arm/freescale/vybrid/vf_ccm.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_ccm.c Tue Feb 25 15:22:40 2014 (r262482) +++ head/sys/arm/freescale/vybrid/vf_ccm.c Tue Feb 25 17:02:11 2014 (r262483) @@ -164,6 +164,18 @@ struct clk { uint32_t sel_val; }; +static struct clk ipg_clk = { + .reg = CCM_CACRR, + .enable_reg = 0, + .div_mask = IPG_CLK_DIV_MASK, + .div_shift = IPG_CLK_DIV_SHIFT, + .div_val = 1, /* Divide by 2 */ + .sel_reg = 0, + .sel_mask = 0, + .sel_shift = 0, + .sel_val = 0, +}; + /* PLL4 clock divider (before switching the clocks should be gated) 000 Divide by 1 (only if PLL frequency less than or equal to 650 MHz) @@ -310,6 +322,7 @@ struct clock_entry { }; static struct clock_entry clock_map[] = { + {"ipg", &ipg_clk}, {"pll4", &pll4_clk}, {"sai3", &sai3_clk}, {"cko1", &cko1_clk}, Modified: head/sys/arm/freescale/vybrid/vf_iomuxc.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_iomuxc.c Tue Feb 25 15:22:40 2014 (r262482) +++ head/sys/arm/freescale/vybrid/vf_iomuxc.c Tue Feb 25 17:02:11 2014 (r262483) @@ -56,21 +56,42 @@ __FBSDID("$FreeBSD$"); #include #include -#define IBE (1 << 0) /* Input Buffer Enable Field */ -#define OBE (1 << 1) /* Output Buffer Enable Field. */ -#define PUE (1 << 2) /* Pull / Keep Select Field. */ -#define PKE (1 << 3) /* Pull / Keep Enable Field. */ -#define PUS_MASK (3 << 4) /* Pull Up / Down Config Field. */ -#define DSE_MASK (7 << 6) /* Drive Strength Field. */ -#define HYS (1 << 9) /* Hysteresis Enable Field */ - #define MUX_MODE_MASK 7 #define MUX_MODE_SHIFT 20 #define MUX_MODE_GPIO 0 #define MUX_MODE_VBUS_EN_OTG 2 -#define PUS_22_KOHM_PULL_UP (3 << 4) -#define DSE_25_OHM (6 << 6) +#define IBE (1 << 0) /* Input Buffer Enable Field */ +#define OBE (1 << 1) /* Output Buffer Enable Field. */ +#define PUE (1 << 2) /* Pull / Keep Select Field. */ +#define PKE (1 << 3) /* Pull / Keep Enable Field. */ +#define HYS (1 << 9) /* Hysteresis Enable Field */ +#define ODE (1 << 10) /* Open Drain Enable Field. */ +#define SRE (1 << 11) /* Slew Rate Field. */ + +#define SPEED_SHIFT 12 +#define SPEED_MASK 0x3 +#define SPEED_LOW 0 /* 50 MHz */ +#define SPEED_MEDIUM 0x1 /* 100 MHz */ +#define SPEED_HIGH 0x3 /* 200 MHz */ + +#define PUS_SHIFT 4 /* Pull Up / Down Config Field Shift */ +#define PUS_MASK 0x3 +#define PUS_100_KOHM_PULL_DOWN 0 +#define PUS_47_KOHM_PULL_UP 0x1 +#define PUS_100_KOHM_PULL_UP 0x2 +#define PUS_22_KOHM_PULL_UP 0x3 + +#define DSE_SHIFT 6 /* Drive Strength Field Shift */ +#define DSE_MASK 0x7 +#define DSE_DISABLED 0 /* Output driver disabled */ +#define DSE_150_OHM 0x1 +#define DSE_75_OHM 0x2 +#define DSE_50_OHM 0x3 +#define DSE_37_OHM 0x4 +#define DSE_30_OHM 0x5 +#define DSE_25_OHM 0x6 +#define DSE_20_OHM 0x7 #define MAX_MUX_LEN 1024 @@ -101,19 +122,6 @@ iomuxc_probe(device_t dev) } static int -configure_pad(struct iomuxc_softc *sc, int pad, int mux_mode) -{ - int reg; - - reg = READ4(sc, pad); - reg &= ~(MUX_MODE_MASK << MUX_MODE_SHIFT); - reg |= (mux_mode << MUX_MODE_SHIFT); - WRITE4(sc, pad, reg); - - return (0); -} - -static int pinmux_set(struct iomuxc_softc *sc) { phandle_t child, parent, root; @@ -121,7 +129,7 @@ pinmux_set(struct iomuxc_softc *sc) int len; int values; int pin; - int mux_mode; + int pin_cfg; int i; root = OF_finddevice("/"); @@ -146,12 +154,12 @@ pinmux_set(struct iomuxc_softc *sc) values = len / (sizeof(uint32_t)); for (i = 0; i < values; i += 2) { pin = fdt32_to_cpu(iomux_config[i]); - mux_mode = fdt32_to_cpu(iomux_config[i+1]); + pin_cfg = fdt32_to_cpu(iomux_config[i+1]); #if 0 - device_printf(sc->dev, "Set pin %d to ALT%d\n", - pin, mux_mode); + device_printf(sc->dev, "Set pin %d to 0x%08x\n", + pin, pin_cfg); #endif - configure_pad(sc, IOMUXC(pin), mux_mode); + WRITE4(sc, IOMUXC(pin), pin_cfg); } } @@ -169,7 +177,6 @@ static int iomuxc_attach(device_t dev) { struct iomuxc_softc *sc; - int reg; sc = device_get_softc(dev); sc->dev = dev; @@ -183,11 +190,6 @@ iomuxc_attach(device_t dev) sc->bst = rman_get_bustag(sc->tmr_res[0]); sc->bsh = rman_get_bushandle(sc->tmr_res[0]); - /* USB */ - configure_pad(sc, IOMUXC_PTA17, MUX_MODE_VBUS_EN_OTG); - reg = (PKE | PUE | PUS_22_KOHM_PULL_UP | DSE_25_OHM | OBE); - WRITE4(sc, IOMUXC_PTA7, reg); - pinmux_set(sc); return (0); Modified: head/sys/boot/fdt/dts/vybrid-colibri-vf50.dts ============================================================================== --- head/sys/boot/fdt/dts/vybrid-colibri-vf50.dts Tue Feb 25 15:22:40 2014 (r262482) +++ head/sys/boot/fdt/dts/vybrid-colibri-vf50.dts Tue Feb 25 17:02:11 2014 (r262483) @@ -45,17 +45,26 @@ fec1: ethernet@400D1000 { status = "okay"; - iomux_config = < 54 0x1 55 0x1 - 56 0x1 57 0x1 - 58 0x1 59 0x1 - 60 0x1 61 0x1 - 62 0x1 0 0x1 >; + iomux_config = < 54 0x103192 + 55 0x103193 + 56 0x103191 + 57 0x103191 + 58 0x103191 + 59 0x103191 + 60 0x103192 + 61 0x103192 + 62 0x103192 + 0 0x103191 >; }; sai3: sai@40032000 { status = "okay"; }; + i2c0: i2c@40066000 { + status = "okay"; + }; + adc0: adc@4003B000 { status = "okay"; }; Modified: head/sys/boot/fdt/dts/vybrid-cosmic.dts ============================================================================== --- head/sys/boot/fdt/dts/vybrid-cosmic.dts Tue Feb 25 15:22:40 2014 (r262482) +++ head/sys/boot/fdt/dts/vybrid-cosmic.dts Tue Feb 25 17:02:11 2014 (r262483) @@ -45,11 +45,16 @@ fec1: ethernet@400D1000 { status = "okay"; - iomux_config = < 54 0x1 55 0x1 - 56 0x1 57 0x1 - 58 0x1 59 0x1 - 60 0x1 61 0x1 - 62 0x1 0 0x2 >; + iomux_config = < 54 0x103192 + 55 0x103193 + 56 0x103191 + 57 0x103191 + 58 0x103191 + 59 0x103191 + 60 0x103192 + 61 0x103192 + 62 0x103192 + 0 0x203191 >; }; esai: esai@40062000 { Modified: head/sys/boot/fdt/dts/vybrid-quartz.dts ============================================================================== --- head/sys/boot/fdt/dts/vybrid-quartz.dts Tue Feb 25 15:22:40 2014 (r262482) +++ head/sys/boot/fdt/dts/vybrid-quartz.dts Tue Feb 25 17:02:11 2014 (r262483) @@ -45,11 +45,16 @@ fec1: ethernet@400D1000 { status = "okay"; - iomux_config = < 54 0x1 55 0x1 - 56 0x1 57 0x1 - 58 0x1 59 0x1 - 60 0x1 61 0x1 - 62 0x1 0 0x2 >; + iomux_config = < 54 0x103192 + 55 0x103193 + 56 0x103191 + 57 0x103191 + 58 0x103191 + 59 0x103191 + 60 0x103192 + 61 0x103192 + 62 0x103192 + 0 0x203191 >; }; edma1: edma@40098000 { Modified: head/sys/boot/fdt/dts/vybrid.dtsi ============================================================================== --- head/sys/boot/fdt/dts/vybrid.dtsi Tue Feb 25 15:22:40 2014 (r262482) +++ head/sys/boot/fdt/dts/vybrid.dtsi Tue Feb 25 17:02:11 2014 (r262483) @@ -205,9 +205,12 @@ clock-frequency = <50000000>; status = "disabled"; clock_names = "esdhc1"; - iomux_config = < 14 0x5 15 0x5 - 16 0x5 17 0x5 - 18 0x5 19 0x5 >; + iomux_config = < 14 0x500060 + 15 0x500060 + 16 0x500060 + 17 0x500060 + 18 0x500060 + 19 0x500060 >; }; serial0: serial@40027000 { @@ -237,6 +240,8 @@ < 0x40050800 0x100 >; /* phy */ interrupts = < 107 >; interrupt-parent = <&GIC>; + iomux_config = < 134 0x0001be + 7 0x200060 >; }; usb@400b4000 { @@ -246,6 +251,8 @@ < 0x40050C00 0x100 >; /* phy */ interrupts = < 108 >; interrupt-parent = <&GIC>; + iomux_config = < 134 0x0001be + 7 0x200060 >; }; fec0: ethernet@400D0000 { @@ -257,11 +264,15 @@ phy-disable-preamble; status = "disabled"; clock_names = "enet"; - iomux_config = < 45 0x1 46 0x1 - 47 0x1 48 0x1 - 49 0x1 50 0x1 - 51 0x1 52 0x1 - 53 0x1 >; + iomux_config = < 45 0x100061 + 46 0x100061 + 47 0x100061 + 48 0x100060 + 49 0x100060 + 50 0x100060 + 51 0x100060 + 52 0x100060 + 53 0x100060 >; }; fec1: ethernet@400D1000 { @@ -273,11 +284,15 @@ phy-disable-preamble; status = "disabled"; clock_names = "enet"; - iomux_config = < 54 0x1 55 0x1 - 56 0x1 57 0x1 - 58 0x1 59 0x1 - 60 0x1 61 0x1 - 62 0x1 >; + iomux_config = < 54 0x103192 + 55 0x103193 + 56 0x103191 + 57 0x103191 + 58 0x103191 + 59 0x103191 + 60 0x103192 + 61 0x103192 + 62 0x103192 >; }; sai0: sai@4002F000 { @@ -315,10 +330,10 @@ edma-src-transmit = < 9 >; edma-mux-group = < 1 >; clock_names = "sai3", "cko1"; - iomux_config = < 16 0x2 - 19 0x2 - 21 0x2 - 40 0x4 >; /* CKO1 */ + iomux_config = < 16 0x200060 + 19 0x200060 + 21 0x200060 + 40 0x400061 >; /* CKO1 */ }; esai: esai@40062000 { @@ -328,11 +343,16 @@ interrupt-parent = <&GIC>; status = "disabled"; clock_names = "esai"; - iomux_config = < 45 0x4 46 0x4 - 47 0x4 48 0x4 - 49 0x4 50 0x4 - 51 0x4 52 0x4 - 78 0x3 40 0x4>; + iomux_config = < 45 0x400061 + 46 0x400061 + 47 0x400061 + 48 0x400060 + 49 0x400060 + 50 0x400060 + 51 0x400060 + 52 0x400060 + 78 0x3038df + 40 0x400061 >; }; spi0: spi@4002C000 { @@ -341,9 +361,11 @@ interrupts = < 99 >; interrupt-parent = <&GIC>; status = "disabled"; - iomux_config = < 40 0x1 41 0x1 - 42 0x1 43 0x1 - 44 0x1 >; + iomux_config = < 40 0x100061 + 41 0x100061 + 42 0x100060 + 43 0x100060 + 44 0x100061 >; }; spi1: spi@4002D000 { @@ -370,6 +392,43 @@ status = "disabled"; }; + i2c0: i2c@40066000 { + compatible = "fsl,mvf600-i2c"; + reg = <0x40066000 0x1000>; + interrupts = < 103 >; + interrupt-parent = <&GIC>; + status = "disabled"; + clock_names = "ipg"; + iomux_config = < 36 0x2034d3 + 37 0x2034d3 + 207 0x1 + 208 0x1 >; + }; + + i2c1: i2c@40067000 { + compatible = "fsl,mvf600-i2c"; + reg = <0x40067000 0x1000>; + interrupts = < 104 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + + i2c2: i2c@400E6000 { + compatible = "fsl,mvf600-i2c"; + reg = <0x400E6000 0x1000>; + interrupts = < 105 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + + i2c3: i2c@400E7000 { + compatible = "fsl,mvf600-i2c"; + reg = <0x400E7000 0x1000>; + interrupts = < 106 >; + interrupt-parent = <&GIC>; + status = "disabled"; + }; + adc0: adc@4003B000 { compatible = "fsl,mvf600-adc"; reg = <0x4003B000 0x1000>; @@ -399,21 +458,35 @@ interrupt-parent = <&GIC>; status = "disabled"; clock_names = "dcu0"; - iomux_config = < 105 0x1 106 0x1 - 107 0x1 108 0x1 - 109 0x1 110 0x1 - 111 0x1 112 0x1 - 113 0x1 114 0x1 - 115 0x1 116 0x1 - 117 0x1 118 0x1 - 119 0x1 120 0x1 - 121 0x1 122 0x1 - 123 0x1 124 0x1 - 125 0x1 126 0x1 - 127 0x1 128 0x1 - 129 0x1 130 0x1 - 131 0x1 132 0x1 - 133 0x1 >; + iomux_config = < 105 0x100044 + 106 0x100044 + 107 0x100060 + 108 0x100060 + 109 0x100060 + 110 0x100060 + 111 0x100060 + 112 0x100060 + 113 0x100060 + 114 0x100060 + 115 0x100060 + 116 0x100060 + 117 0x100060 + 118 0x100060 + 119 0x100060 + 120 0x100060 + 121 0x100060 + 122 0x100060 + 123 0x100060 + 124 0x100060 + 125 0x100060 + 126 0x100060 + 127 0x100060 + 128 0x100060 + 129 0x100060 + 130 0x100060 + 131 0x100060 + 132 0x100060 + 133 0x100060 >; }; }; }; From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 17:03:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EDD41FC2; Tue, 25 Feb 2014 17:03:39 +0000 (UTC) Received: from mail-pd0-x230.google.com (mail-pd0-x230.google.com [IPv6:2607:f8b0:400e:c02::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC1131FE8; Tue, 25 Feb 2014 17:03:39 +0000 (UTC) Received: by mail-pd0-f176.google.com with SMTP id r10so927295pdi.7 for ; Tue, 25 Feb 2014 09:03:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=wjAQr8J9ljJOzfpB37xThQbyn0t+lCH+A43qyRsYu9k=; b=GiU1MgDwAq3ARj4PJsBNPAfw/N3ej57keirWxxXomEr1Ncv246fF89INWYp4i4j/mF b2goElqQmRsSgFsym8MpHjKXeMVCC7qHKH7WzlvN/fYuLEsv/E5rEyp1XiRviFz/zPAt cG5c9VCV1vvQYRBMjvj1VQjB6X8apPCzLWbhJ81uKfaxkcBA90HOx8ftQEFrh+KSVIEy U7qfxcse04bIY1YpCwNLw8cRibUKCdUuX1zy1JTY4OsuFfoqFZ81xNRDirRQTl1qXI5A O2iXhphtfgWC+x48CeYVXg34samyk6MyBWAnpPhH124XwwXUtesXHwThkLGIfmu3A5D+ vHRg== X-Received: by 10.66.150.69 with SMTP id ug5mr2737246pab.55.1393347819315; Tue, 25 Feb 2014 09:03:39 -0800 (PST) Received: from bsdimp.corp.netflix.com ([69.53.237.72]) by mx.google.com with ESMTPSA id tu3sm147143375pab.1.2014.02.25.09.03.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Feb 2014 09:03:38 -0800 (PST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... From: Warner Losh In-Reply-To: <20140225075220.GF83610@ithaqua.etoilebsd.net> Date: Tue, 25 Feb 2014 09:03:35 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201402210726.s1L7QnBP007144@svn.freebsd.org> <20140222082350.GA2705@server.rulingia.com> <20140222121438.GO1699@ithaqua.etoilebsd.net> <20140225062222.GB2705@server.rulingia.com> <20140225075220.GF83610@ithaqua.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.1827) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Peter Jeremy X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 17:03:40 -0000 On Feb 24, 2014, at 11:52 PM, Baptiste Daroussin = wrote: > On Tue, Feb 25, 2014 at 05:22:22PM +1100, Peter Jeremy wrote: >> On 2014-Feb-22 13:14:38 +0100, Baptiste Daroussin = wrote: >>> On Sat, Feb 22, 2014 at 07:23:50PM +1100, Peter Jeremy wrote: >>>> I'd also query the reason for including Debian-specific code in the >>>> FreeBSD base. >>=20 >>> Where have you seen debian specific code? >>=20 >> /usr/src/contrib/dma/debian - as far as I can tell, this directory is >> Debion specific. I thought we stripped out irrelevant code from = third >> party imports but looking wider, there is similarly irrelevant code = in >> a variety of other contrib imports. I'll withdraw that objection. >>=20 >> --=20 >> Peter Jeremy >=20 > Have you already looked at how contrib works? who cares FYI you can = also find > some win32 specific code in there, debian packaging code, rpm spec = files etc. Historically we import everything into the vendor branch, but then only = import the FreeBSD specific stuff into src/contrib. Sure, there are some mistakes in this, = but the mistakes don=92t prove the point. Warner From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 17:13:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2F9A246; Tue, 25 Feb 2014 17:13:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BD86710E5; Tue, 25 Feb 2014 17:13:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1PHDgEX018209; Tue, 25 Feb 2014 17:13:42 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1PHDgEY018208; Tue, 25 Feb 2014 17:13:42 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402251713.s1PHDgEY018208@svn.freebsd.org> From: Christian Brueffer Date: Tue, 25 Feb 2014 17:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262484 - head/usr.sbin/btxld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 17:13:42 -0000 Author: brueffer Date: Tue Feb 25 17:13:42 2014 New Revision: 262484 URL: http://svnweb.freebsd.org/changeset/base/262484 Log: In puthdr(), start the ELF .data section on a new page, as this is what btxldr expects (.set MEM_DATA,start+0x1000 in btxldr.S). This makes resulting ELF binaries bootable with grub, gptboot and boot2. PR: 153801 Submitted by: Gleb Kurtsou Tested by: Ruben Kerkhof Glanced at by: jhb, peter MFC after: 1 month Modified: head/usr.sbin/btxld/btxld.c Modified: head/usr.sbin/btxld/btxld.c ============================================================================== --- head/usr.sbin/btxld/btxld.c Tue Feb 25 17:02:11 2014 (r262483) +++ head/usr.sbin/btxld/btxld.c Tue Feb 25 17:13:42 2014 (r262484) @@ -426,7 +426,7 @@ puthdr(int fd, struct hdr *hdr) le32toh(eh.p[0].p_filesz)); eh.p[1].p_vaddr = eh.p[1].p_paddr = htole32(align(le32toh(eh.p[0].p_paddr) + le32toh(eh.p[0].p_memsz), - 4)); + 4096)); eh.p[1].p_filesz = eh.p[1].p_memsz = htole32(hdr->data); eh.sh[2].sh_addr = eh.p[0].p_vaddr; eh.sh[2].sh_offset = eh.p[0].p_offset; From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 18:00:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 272F7717; Tue, 25 Feb 2014 18:00:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 12C211574; Tue, 25 Feb 2014 18:00:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1PI0tpN036412; Tue, 25 Feb 2014 18:00:55 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1PI0tJP036411; Tue, 25 Feb 2014 18:00:55 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201402251800.s1PI0tJP036411@svn.freebsd.org> From: Sean Bruno Date: Tue, 25 Feb 2014 18:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262487 - head/sys/boot/userboot/userboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 18:00:56 -0000 Author: sbruno Date: Tue Feb 25 18:00:55 2014 New Revision: 262487 URL: http://svnweb.freebsd.org/changeset/base/262487 Log: Teach userboot to comply with WITHOUT_CDDL/WITHOUT_ZFS Apparently, LIBZFS is set to a non-empty string when WITHOUT_CDDL/WITHOUT_ZFS are set, I think this is a bug, but work around this feature for now. Reviewed by: grehan Modified: head/sys/boot/userboot/userboot/Makefile Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Tue Feb 25 17:51:41 2014 (r262486) +++ head/sys/boot/userboot/userboot/Makefile Tue Feb 25 18:00:55 2014 (r262487) @@ -51,10 +51,12 @@ LIBFICL= ${.OBJDIR}/../ficl/libficl.a LIBSTAND= ${.OBJDIR}/../libstand/libstand.a .endif +.if ${MK_CDDL} != "no" .if ${MK_ZFS} != "no" CFLAGS+= -DUSERBOOT_ZFS_SUPPORT LIBZFS= ${.OBJDIR}/../zfs/libzfsboot.a .endif +.endif # Always add MI sources .PATH: ${.CURDIR}/../../common From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 18:25:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2889D64; Tue, 25 Feb 2014 18:25:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BE21C18D4; Tue, 25 Feb 2014 18:25:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1PIPRIf047194; Tue, 25 Feb 2014 18:25:27 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1PIPRfS047192; Tue, 25 Feb 2014 18:25:27 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201402251825.s1PIPRfS047192@svn.freebsd.org> From: Kirk McKusick Date: Tue, 25 Feb 2014 18:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262488 - head/sbin/fsck_ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 18:25:27 -0000 Author: mckusick Date: Tue Feb 25 18:25:27 2014 New Revision: 262488 URL: http://svnweb.freebsd.org/changeset/base/262488 Log: Arguments for malloc and calloc should be size_t, not int. Use proper bounds check when trying to free cached memory. Spotted by: Xin Li Tested by: Dmitry Sivachenko MFC after: 2 weeks Modified: head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/fsutil.c Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Tue Feb 25 18:00:55 2014 (r262487) +++ head/sbin/fsck_ffs/fsck.h Tue Feb 25 18:25:27 2014 (r262488) @@ -369,7 +369,7 @@ int flushentry(void); * to get space. */ static inline void* -Malloc(int size) +Malloc(size_t size) { void *retval; @@ -384,7 +384,7 @@ Malloc(int size) * to get space. */ static inline void* -Calloc(int cnt, int size) +Calloc(size_t cnt, size_t size) { void *retval; Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Tue Feb 25 18:00:55 2014 (r262487) +++ head/sbin/fsck_ffs/fsutil.c Tue Feb 25 18:25:27 2014 (r262488) @@ -225,7 +225,7 @@ cgget(int cg) struct cg *cgp; if (cgbufs == NULL) { - cgbufs = Calloc(sblock.fs_ncg, sizeof(struct bufarea)); + cgbufs = calloc(sblock.fs_ncg, sizeof(struct bufarea)); if (cgbufs == NULL) errx(EEXIT, "cannot allocate cylinder group buffers"); } @@ -254,6 +254,8 @@ flushentry(void) { struct bufarea *cgbp; + if (flushtries == sblock.fs_ncg || cgbufs == NULL) + return (0); cgbp = &cgbufs[flushtries++]; if (cgbp->b_un.b_cg == NULL) return (0); From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 18:44:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF60496D; Tue, 25 Feb 2014 18:44:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9A8F31AC8; Tue, 25 Feb 2014 18:44:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1PIiavI055311; Tue, 25 Feb 2014 18:44:36 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1PIiYh9055297; Tue, 25 Feb 2014 18:44:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402251844.s1PIiYh9055297@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Feb 2014 18:44:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262489 - in head/sys: net netinet netinet6 netipsec sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 18:44:36 -0000 Author: jhb Date: Tue Feb 25 18:44:33 2014 New Revision: 262489 URL: http://svnweb.freebsd.org/changeset/base/262489 Log: Remove more constants related to static sysctl nodes. The MAXID constants were primarily used to size the sysctl name list macros that were removed in r254295. A few other constants either did not have an associated sysctl node, or the associated node used OID_AUTO instead. PR: ports/184525 (exp-run) Modified: head/sys/net/if_pfsync.h head/sys/netinet/icmp_var.h head/sys/netinet/igmp_var.h head/sys/netinet/in.h head/sys/netinet/pim_var.h head/sys/netinet/tcp_var.h head/sys/netinet/udp_var.h head/sys/netinet6/pim6_var.h head/sys/netipsec/ipsec.h head/sys/netipsec/key_var.h head/sys/sys/socket.h head/sys/sys/sysctl.h Modified: head/sys/net/if_pfsync.h ============================================================================== --- head/sys/net/if_pfsync.h Tue Feb 25 18:25:27 2014 (r262488) +++ head/sys/net/if_pfsync.h Tue Feb 25 18:44:33 2014 (r262489) @@ -205,12 +205,6 @@ struct pfsync_tdb { #define PFSYNC_HDRLEN sizeof(struct pfsync_header) -/* - * Names for PFSYNC sysctl objects - */ -#define PFSYNCCTL_STATS 1 /* PFSYNC stats */ -#define PFSYNCCTL_MAXID 2 - struct pfsyncstats { u_int64_t pfsyncs_ipackets; /* total input packets, IPv4 */ u_int64_t pfsyncs_ipackets6; /* total input packets, IPv6 */ Modified: head/sys/netinet/icmp_var.h ============================================================================== --- head/sys/netinet/icmp_var.h Tue Feb 25 18:25:27 2014 (r262488) +++ head/sys/netinet/icmp_var.h Tue Feb 25 18:44:33 2014 (r262489) @@ -78,12 +78,11 @@ void kmod_icmpstat_inc(int statnum); #endif /* - * Names for ICMP sysctl objects + * Identifiers for ICMP sysctl nodes */ #define ICMPCTL_MASKREPL 1 /* allow replies to netmask requests */ #define ICMPCTL_STATS 2 /* statistics (read-only) */ #define ICMPCTL_ICMPLIM 3 -#define ICMPCTL_MAXID 4 #ifdef _KERNEL SYSCTL_DECL(_net_inet_icmp); Modified: head/sys/netinet/igmp_var.h ============================================================================== --- head/sys/netinet/igmp_var.h Tue Feb 25 18:25:27 2014 (r262488) +++ head/sys/netinet/igmp_var.h Tue Feb 25 18:44:33 2014 (r262489) @@ -213,9 +213,8 @@ SYSCTL_DECL(_net_inet_igmp); #endif /* _KERNEL */ /* - * Names for IGMP sysctl objects + * Identifiers for IGMP sysctl nodes */ #define IGMPCTL_STATS 1 /* statistics (read-only) */ -#define IGMPCTL_MAXID 2 #endif Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Tue Feb 25 18:25:27 2014 (r262488) +++ head/sys/netinet/in.h Tue Feb 25 18:44:33 2014 (r262489) @@ -602,14 +602,7 @@ int getsourcefilter(int, uint32_t, struc #define IP_PORTRANGE_LOW 2 /* "low" - vouchsafe security */ /* - * Definitions for inet sysctl operations. - * - * Third level is protocol number. - * Fourth level is desired variable within that protocol. - */ - -/* - * Names for IP sysctl objects + * Identifiers for IP sysctl nodes */ #define IPCTL_FORWARDING 1 /* act as router */ #define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */ @@ -629,7 +622,6 @@ int getsourcefilter(int, uint32_t, struc #define IPCTL_FASTFORWARDING 14 /* use fast IP forwarding code */ #define IPCTL_KEEPFAITH 15 /* FAITH IPv4->IPv6 translater ctl */ #define IPCTL_GIF_TTL 16 /* default TTL for gif encap packet */ -#define IPCTL_MAXID 17 #endif /* __BSD_VISIBLE */ Modified: head/sys/netinet/pim_var.h ============================================================================== --- head/sys/netinet/pim_var.h Tue Feb 25 18:25:27 2014 (r262488) +++ head/sys/netinet/pim_var.h Tue Feb 25 18:44:33 2014 (r262489) @@ -66,10 +66,9 @@ struct pimstat { #endif /* - * Names for PIM sysctl objects + * Identifiers for PIM sysctl nodes */ #define PIMCTL_STATS 1 /* statistics (read-only) */ -#define PIMCTL_MAXID 2 #ifdef _KERNEL Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Tue Feb 25 18:25:27 2014 (r262488) +++ head/sys/netinet/tcp_var.h Tue Feb 25 18:44:33 2014 (r262489) @@ -576,7 +576,7 @@ struct xtcpcb { #endif /* - * Names for TCP sysctl objects + * Identifiers for TCP sysctl nodes */ #define TCPCTL_DO_RFC1323 1 /* use RFC-1323 extensions */ #define TCPCTL_MSSDFLT 3 /* MSS default */ @@ -592,8 +592,6 @@ struct xtcpcb { #define TCPCTL_V6MSSDFLT 13 /* MSS default for IPv6 */ #define TCPCTL_SACK 14 /* Selective Acknowledgement,rfc 2018 */ #define TCPCTL_DROP 15 /* drop tcp connection */ -#define TCPCTL_MAXID 16 -#define TCPCTL_FINWAIT2_TIMEOUT 17 #ifdef _KERNEL #ifdef SYSCTL_DECL Modified: head/sys/netinet/udp_var.h ============================================================================== --- head/sys/netinet/udp_var.h Tue Feb 25 18:25:27 2014 (r262488) +++ head/sys/netinet/udp_var.h Tue Feb 25 18:44:33 2014 (r262489) @@ -115,14 +115,13 @@ void kmod_udpstat_inc(int statnum); #endif /* - * Names for UDP sysctl objects. + * Identifiers for UDP sysctl nodes. */ #define UDPCTL_CHECKSUM 1 /* checksum UDP packets */ #define UDPCTL_STATS 2 /* statistics (read-only) */ #define UDPCTL_MAXDGRAM 3 /* max datagram size */ #define UDPCTL_RECVSPACE 4 /* default receive buffer space */ #define UDPCTL_PCBLIST 5 /* list of PCBs for UDP sockets */ -#define UDPCTL_MAXID 6 #ifdef _KERNEL SYSCTL_DECL(_net_inet_udp); Modified: head/sys/netinet6/pim6_var.h ============================================================================== --- head/sys/netinet6/pim6_var.h Tue Feb 25 18:25:27 2014 (r262488) +++ head/sys/netinet6/pim6_var.h Tue Feb 25 18:44:33 2014 (r262489) @@ -56,9 +56,8 @@ int pim6_input(struct mbuf **, int*, int #endif /* KERNEL */ /* - * Names for PIM sysctl objects + * Identifiers for PIM sysctl nodes */ #define PIM6CTL_STATS 1 /* statistics (read-only) */ -#define PIM6CTL_MAXID 2 #endif /* _NETINET6_PIM6_VAR_H_ */ Modified: head/sys/netipsec/ipsec.h ============================================================================== --- head/sys/netipsec/ipsec.h Tue Feb 25 18:25:27 2014 (r262488) +++ head/sys/netipsec/ipsec.h Tue Feb 25 18:44:33 2014 (r262489) @@ -244,9 +244,6 @@ struct ipsecstat { /* * Definitions for IPsec & Key sysctl operations. */ -/* - * Names for IPsec & Key sysctl objects - */ #define IPSECCTL_STATS 1 /* stats */ #define IPSECCTL_DEF_POLICY 2 #define IPSECCTL_DEF_ESP_TRANSLEV 3 /* int; ESP transport mode */ @@ -262,7 +259,6 @@ struct ipsecstat { #define IPSECCTL_ECN 11 #define IPSECCTL_DEBUG 12 #define IPSECCTL_ESP_RANDPAD 13 -#define IPSECCTL_MAXID 14 #ifdef _KERNEL #include Modified: head/sys/netipsec/key_var.h ============================================================================== --- head/sys/netipsec/key_var.h Tue Feb 25 18:25:27 2014 (r262488) +++ head/sys/netipsec/key_var.h Tue Feb 25 18:44:33 2014 (r262489) @@ -46,7 +46,6 @@ #define KEYCTL_ESP_AUTH 10 #define KEYCTL_AH_KEYMIN 11 #define KEYCTL_PREFERED_OLDSA 12 -#define KEYCTL_MAXID 13 #ifdef _KERNEL #define _ARRAYLEN(p) (sizeof(p)/sizeof(p[0])) Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Tue Feb 25 18:25:27 2014 (r262488) +++ head/sys/sys/socket.h Tue Feb 25 18:44:33 2014 (r262489) @@ -376,9 +376,8 @@ struct sockproto { * Second level is protocol family. * Third level is protocol number. * - * Further levels are defined by the individual families below. + * Further levels are defined by the individual families. */ -#define NET_MAXID AF_MAX /* * PF_ROUTE - Routing table @@ -394,8 +393,6 @@ struct sockproto { #define NET_RT_IFMALIST 4 /* return multicast address list */ #define NET_RT_IFLISTL 5 /* Survey interface list, using 'l'en * versions of msghdr structs. */ -#define NET_RT_MAXID 6 - #endif /* __BSD_VISIBLE */ /* Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Tue Feb 25 18:25:27 2014 (r262488) +++ head/sys/sys/sysctl.h Tue Feb 25 18:44:33 2014 (r262489) @@ -481,7 +481,6 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a #define CTL_MACHDEP 7 /* machine dependent */ #define CTL_USER 8 /* user-level */ #define CTL_P1003_1B 9 /* POSIX 1003.1B */ -#define CTL_MAXID 10 /* number of valid top-level ids */ /* * CTL_KERN identifiers @@ -523,7 +522,6 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a #define KERN_IOV_MAX 35 /* int: value of UIO_MAXIOV */ #define KERN_HOSTUUID 36 /* string: host UUID identifier */ #define KERN_ARND 37 /* int: from arc4rand() */ -#define KERN_MAXID 38 /* number of valid kern ids */ /* * KERN_PROC subtypes */ @@ -585,7 +583,6 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a #define HW_FLOATINGPT 10 /* int: has HW floating point? */ #define HW_MACHINE_ARCH 11 /* string: machine architecture */ #define HW_REALMEM 12 /* int: 'real' memory */ -#define HW_MAXID 13 /* number of valid hw ids */ /* * CTL_USER definitions @@ -610,7 +607,6 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a #define USER_POSIX2_UPE 18 /* int: POSIX2_UPE */ #define USER_STREAM_MAX 19 /* int: POSIX2_STREAM_MAX */ #define USER_TZNAME_MAX 20 /* int: POSIX2_TZNAME_MAX */ -#define USER_MAXID 21 /* number of valid user ids */ #define CTL_P1003_1B_ASYNCHRONOUS_IO 1 /* boolean */ #define CTL_P1003_1B_MAPPED_FILES 2 /* boolean */ From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 18:47:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACC2EB04; Tue, 25 Feb 2014 18:47:22 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8267B1AED; Tue, 25 Feb 2014 18:47:22 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6053EB917; Tue, 25 Feb 2014 13:47:20 -0500 (EST) From: John Baldwin To: Mateusz Guzik Subject: Re: svn commit: r262309 - head/sys/kern Date: Tue, 25 Feb 2014 13:08:43 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201402212229.s1LMT9BF093587@svn.freebsd.org> In-Reply-To: <201402212229.s1LMT9BF093587@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201402251308.43875.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 25 Feb 2014 13:47:20 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 18:47:22 -0000 On Friday, February 21, 2014 5:29:09 pm Mateusz Guzik wrote: > Author: mjg > Date: Fri Feb 21 22:29:09 2014 > New Revision: 262309 > URL: http://svnweb.freebsd.org/changeset/base/262309 > > Log: > Fix a race between kern_proc_{o,}filedesc_out and fdescfree leading > to use-after-free. > > fdescfree proceeds to free file pointers once fd_refcnt reaches 0, but > kern_proc_{o,}filedesc_out only checked for hold count. Can you describe the race in more detail? The kern_* routines hold FILEDESC_SLOCK() while they read the file which should prevent fdescfree() from free'ing any files. Note that fdfree() (called under FILEDESC_XLOCK() clears the file pointer to NULL via the bzero(), so the sysctl handler should only see non-NULL pointers for files that are not yet free'd. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 21:01:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82DCFFFF; Tue, 25 Feb 2014 21:01:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 610B51935; Tue, 25 Feb 2014 21:01:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1PL1u9Z015927; Tue, 25 Feb 2014 21:01:56 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1PL1umL015926; Tue, 25 Feb 2014 21:01:56 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402252101.s1PL1umL015926@svn.freebsd.org> From: Christian Brueffer Date: Tue, 25 Feb 2014 21:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262494 - head/usr.sbin/bsnmpd/tools/bsnmptools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 21:01:56 -0000 Author: brueffer Date: Tue Feb 25 21:01:55 2014 New Revision: 262494 URL: http://svnweb.freebsd.org/changeset/base/262494 Log: Rough cleanup (new sentence -> new line, grammar, spelling, mdoc). This could use more work. PR: 187035 (in part) Submitted by: Bjorn Heidotting MFC after: 1 week Modified: head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 Modified: head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 ============================================================================== --- head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 Tue Feb 25 20:27:51 2014 (r262493) +++ head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 Tue Feb 25 21:01:55 2014 (r262494) @@ -106,18 +106,18 @@ management information to a Simple Netwo .Pp Depending on the options .Nm bsnmpget -constructs either a SMNP GetRequest, GetNextRequest +constructs either a SNMP GetRequest, GetNextRequest or a GetBulkRequest packet, fills in the object identifiers (OIDs) of the objects whose values will be retrieved, waits for a response and prints it if received successfully. .Pp .Nm Bsnmpwalk -queries an agent with ether SMNP GetNextRequest or GetBulkRequest packets, +queries an agent with ether SNMP GetNextRequest or GetBulkRequest packets, asking for values of OID instances that are a part of the object subtree rooted at the provided OIDs. .Pp .Nm Bsnmpset -constructs a SMNP SetRequest packet, fills in the OIDs (object identifiers), +constructs a SNMP SetRequest packet, fills in the OIDs (object identifiers), syntaxes and values of the objects whose values are to be set and waits for a response from server. .Sh OPTIONS @@ -151,7 +151,8 @@ The context to query with SNMPv3 PDUs. The context name. Default is "" (empty). .It Cm context-engine=engine-id The SNMP Engine ID of the context to query with SNMPv3 PDUs, represented as -binary octet string. By default, this is set to the Engine ID of the SNMP agent. +binary octet string. +By default, this is set to the Engine ID of the SNMP agent. .El .It Fl D Perform SNMP USM Engine Discovery, rather than sending a request for the value @@ -177,7 +178,8 @@ Specifies the initial OID that was cut b .Xr gensnmpdef 1 when producing the MIB description file. The default value is .iso(1).org(3).dod(6) which is what should have been -used for all the files installed under /usr/share/snmp/defs. +used for all the files installed under +.Pa /usr/share/snmp/defs . Use this only if you generated your own files, providing a .Fl c option to @@ -198,7 +200,8 @@ If using spaces make sure the entire opt example using quotes. .It Fl i Ar filelist List of MIB description files produced by -.Xr gensnmpdef 1 which +.Xr gensnmpdef 1 +which .Nm bsnmpget , .Nm bsnmpwalk or @@ -207,12 +210,13 @@ will search to translate numerical OIDs Multiple files can be provided either giving this option multiple times or a comma separated list of file names. If a filename begins with a letter the default directory, -/usr/share/snmp/defs, +.Pa /usr/share/snmp/defs , will be searched. .It Fl K Calculate and display the localized authentication and privacy keys -corresponding to a plain text password. The password is obtain via the -environment. Additionally, if one or more OIDs are specified, the calculated +corresponding to a plain text password. +The password is obtained via the environment. +Additionally, if one or more OIDs are specified, the calculated keys are used when processing the SNMPv3 requests. .It Fl l Ar filename The path of the posix local (unix domain) socket if local @@ -242,9 +246,9 @@ In addition to the short output verbose Privacy options to use with SNMPv3 PDUs .Bl -tag -width \& .It Cm proto=[aes|des] -The protocol to use when encypting/decrypting SNMPv3 PDU data. +The protocol to use when encrypting/decrypting SNMPv3 PDU data. .It Cm key=privkey -A binary localized privacy key to use when encypting/decrypting SNMPv3 PDU data. +A binary localized privacy key to use when encrypting/decrypting SNMPv3 PDU data. .El .Pp By default plain text SNMPv3 PDUs are sent. @@ -267,14 +271,14 @@ not respond after the first try. Default is 3. .It Fl s Ar [trans::] Ns Ar [community@] Ns Ar [server] Ns Ar [:port] Each of the server specification components is optional but at least one -has to be provided if +has to be provided if the .Ar s option is used. The server specification is constructed in the following manner: .Bl -tag -width \& .It Cm trans:: Transport type may be one of udp, stream or dgram. -If this option is not provided an udp inet/inet6 socket will be used, which +If this option is not provided an UDP inet/inet6 socket will be used, which is the most common. Stream stands for a posix local stream socket and a posix local datagram socket will be used if dgram is specified. @@ -317,11 +321,13 @@ The value of the snmpEngineTime of the S If any of the above is not specified, SNMP USM Engine Discovery is attempted. This is also the default behavior. .It Cm name=username -The USM user name to include in the SNMPv3 PDUs. By default, the user name is -obtain via the environment +The USM user name to include in the SNMPv3 PDUs. +By default, the user name is +obtained via the environment. .El .It Fl v Ar version -The SNMP protocol version to use when sending requests. SNMP versions 1, 2 and +The SNMP protocol version to use when sending requests. +SNMP versions 1, 2 and 3 are supported. If no version option is provided .Nm bsnmpget , @@ -330,7 +336,7 @@ and .Nm bsnmpset will use version 2. Note that GetBulkRequest-PDUs were introduced in SNMPv2 thus setting the -version to 1 is incompatiable with sending a GetBulk PDU. +version to 1 is incompatible with sending a GetBulk PDU. .It OID The object identifier whose value to retrieve. At least one OID should be provided for @@ -355,7 +361,7 @@ is valid as input OID: .It ifRcvAddressStatus.2.6.255.255.255.255.255.255 .It ifRcvAddressType[2,ff:ff:ff:ff:ff:ff] .It ifRcvAddressStatus[Integer:1,OctetString:ff:ff:ff:ff:ff:ff] -(requires +(requires the .Fl o Ar verbose option) .El @@ -373,14 +379,14 @@ to be able to send a request. .It Cm OID OID may be input as a string, a string followed by a random number of integers (suboids) separated by dots, a sequence of integers separated by dots - that is -if +if the .Ar n -options is used - and in such case a syntax is required for every value, +option is used - and in such case a syntax is required for every value, or a string followed by square brackets (used to denote an entry's indexes) and corresponding indexes. -Any of formats used to print a single variable by -.Nm bsnmpset is -valid for inpit OID as well: +Any of the formats used to print a single variable by +.Nm bsnmpset +is valid as input OID as well: .Bl -tag -width \& .It 1.3.6.1.2.1.25.1.1.0=TimeTicks:537615486 .It sysLocation=OctetString:"@ Home" (with Fl o Ar verbose No option) @@ -389,17 +395,17 @@ valid for inpit OID as well: .It ifPhysAddress.1="00:02:b3:1d:1c:a3" .It ifRcvAddressStatus.1.6.255.255.255.255.255.255=1 .It "ifRcvAddressStatus[Integer:1,OctetString:ff:ff:ff:ff:ff:ff]=Integer:1" -(with +(with the .Fl o Ar verbose option) .El .It Cm syntax -where syntax string is one of: +where the syntax string is one of: Integer, OctetString, OID, IpAddress, Counter32, Gauge, TimeTicks, Counter64. .It Cm value The value to be set - IP address in form of u.u.u.u - for example 1.3.1.6.1.2.0=IpAddress:192.168.0.1, strings require inverted-commas if they -contain any special characters or spaces, all other numeric types don't. +contain any special characters or spaces, all other numeric types do not. .El .El .Sh ENVIRONMENT @@ -417,8 +423,9 @@ Specifies a default SNMP USM privacy pro Specifies a default SNMP USM user name. .It Ev SNMPPASSWD Specifies the SNMP USM plain text password to use when calculating localized -authentication and privacy keys. If this variable exists in the environment, -SMNPv3 is the default version to use for outgoing requests. +authentication and privacy keys. +If this variable exists in the environment, +SNMPv3 is the default version to use for outgoing requests. .El .Sh SEE ALSO .Xr gensnmpdef 1 From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 21:07:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04A483E6; Tue, 25 Feb 2014 21:07:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E464019A8; Tue, 25 Feb 2014 21:07:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1PL7I6K016857; Tue, 25 Feb 2014 21:07:18 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1PL7IP6016856; Tue, 25 Feb 2014 21:07:18 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201402252107.s1PL7IP6016856@svn.freebsd.org> From: Sean Bruno Date: Tue, 25 Feb 2014 21:07:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262495 - head/sys/boot/userboot/userboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 21:07:19 -0000 Author: sbruno Date: Tue Feb 25 21:07:18 2014 New Revision: 262495 URL: http://svnweb.freebsd.org/changeset/base/262495 Log: Slightly better revision of teaching userboot how to respect MK_CDDL Reviewed by: grehan Modified: head/sys/boot/userboot/userboot/Makefile Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Tue Feb 25 21:01:55 2014 (r262494) +++ head/sys/boot/userboot/userboot/Makefile Tue Feb 25 21:07:18 2014 (r262495) @@ -51,11 +51,11 @@ LIBFICL= ${.OBJDIR}/../ficl/libficl.a LIBSTAND= ${.OBJDIR}/../libstand/libstand.a .endif -.if ${MK_CDDL} != "no" .if ${MK_ZFS} != "no" CFLAGS+= -DUSERBOOT_ZFS_SUPPORT LIBZFS= ${.OBJDIR}/../zfs/libzfsboot.a -.endif +DPADD= ${LIBZFS} +LDADD= ${LIBZFS} .endif # Always add MI sources @@ -63,7 +63,7 @@ LIBZFS= ${.OBJDIR}/../zfs/libzfsboot.a .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -DPADD= ${LIBFICL} ${LIBZFS} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBZFS} ${LIBSTAND} +DPADD+= ${LIBFICL} ${LIBSTAND} +LDADD+= ${LIBFICL} ${LIBSTAND} .include From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 21:18:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC56796B; Tue, 25 Feb 2014 21:18:46 +0000 (UTC) Received: from mail-qc0-x231.google.com (mail-qc0-x231.google.com [IPv6:2607:f8b0:400d:c01::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 57F4E1AEE; Tue, 25 Feb 2014 21:18:46 +0000 (UTC) Received: by mail-qc0-f177.google.com with SMTP id m20so3023178qcx.36 for ; Tue, 25 Feb 2014 13:18:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=YV4HssKNAgwKCl9Dt+1ut2tpCu1eDK3YXNNxEW6Kr7o=; b=mZLSVg4dH4DHUnHt+lwHNtWIe0YCZIANAVxC5OLv0pgBD/LRZiyumGmcuxS3eyspnk qF9KUqkuzF8pTSTOwvqBYFgDOGdHPq+GCYBfQIy77gnhsUN+8xPdxIOfM4OG4+9+aqsN qb0xF0O6+I4cmR+VHb7TVF4dIQDMtl0lfy+f0eXhZQ+yeVAs6yWCQNc3Rdn4QSa7QyHi JEoP0qdN6tZ4Tn7hD0HG2apAPLZdZ1Ay6ffK4J9chCUlVo7o366RXtmIN9p+Fhvj0fXs L3aixt9pqIypIxdknj5G496qLjg9SUMT3po9zRx8JVuUdEkPqyW8YznN3Rtm7WhsbhX4 +Evg== MIME-Version: 1.0 X-Received: by 10.140.31.9 with SMTP id e9mr2998290qge.76.1393363125575; Tue, 25 Feb 2014 13:18:45 -0800 (PST) Sender: carpeddiem@gmail.com Received: by 10.140.31.68 with HTTP; Tue, 25 Feb 2014 13:18:45 -0800 (PST) In-Reply-To: References: <201402210726.s1L7QnBP007144@svn.freebsd.org> <20140222082350.GA2705@server.rulingia.com> <20140222121438.GO1699@ithaqua.etoilebsd.net> <20140225062222.GB2705@server.rulingia.com> <20140225075220.GF83610@ithaqua.etoilebsd.net> Date: Tue, 25 Feb 2014 16:18:45 -0500 X-Google-Sender-Auth: 2Ni6IdeCw2nqM8xQkrgUTSrr288 Message-ID: Subject: Re: svn commit: r262282 - in head: contrib/dma contrib/dma/debian contrib/dma/debian/migrate contrib/dma/debian/source contrib/dma/test etc/mtree libexec libexec/dma share/mk tools/build/mk tools/build... From: Ed Maste To: David Chisnall Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , Baptiste Daroussin , "src-committers@freebsd.org" , Peter Jeremy , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 21:18:47 -0000 On 25 February 2014 03:49, David Chisnall wrote: > > For the libc++ imports, we strip out the support directory, which contain= s Solaris and Win32-specific stuff. If we end up with a support/freebsd, t= hen we'll bring that in, but not support/solaris and support/win32. That s= tuff is in the vendor branch, but it just seems polite not to make people w= ho check out head get files that are never used when building FreeBSD in an= y configuration. And, this is the process documented in the subversion primer in the committers guide: >> Unlike in CVS where only the needed parts were imported into the vendor = tree to avoid bloating the main tree, Subversion is able to store a full di= stribution in the vendor tree. So, import everything, but merge only what i= s required. We should probably drop the "Unlike in CVS" bit, as differences vs. the process used in 2008 become increasingly less relevant. Some additional advice or examples on how to "merge only what is required" will be useful too -- for instance, identifying and excluding files added since the last vendor import that are not desired in HEAD. That said, for the LLDB imports to date I stripped the tree before the import to vendor/. When I do another import after the current work is merged to HEAD I'll import everything in vendor/, and take notes as I do the merge to HEAD in order to update the committer's guide. From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 22:13:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7336DC59; Tue, 25 Feb 2014 22:13:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5E92D11A5; Tue, 25 Feb 2014 22:13:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1PMDnv1044750; Tue, 25 Feb 2014 22:13:49 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1PMDmws044745; Tue, 25 Feb 2014 22:13:48 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201402252213.s1PMDmws044745@svn.freebsd.org> From: Glen Barber Date: Tue, 25 Feb 2014 22:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262499 - in head: release share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 22:13:49 -0000 Author: gjb Date: Tue Feb 25 22:13:48 2014 New Revision: 262499 URL: http://svnweb.freebsd.org/changeset/base/262499 Log: release.sh: - Add a VCSCMD variable that defaults to 'svn checkout', and update places 'svn co' is used directly. - After sourcing a configuration file, prefix SRCBRANCH, PORTBRANCH, and DOCBRANCH with the SVNROOT. - Properly capitalize 'FreeBSD.org' in the default SVNROOT. - Update Copyright. release.conf.sample: - Add an example to use git instead of svn, by nullifying SVNROOT, and setting SRCBRANCH, DOCBRANCH, and PORTBRANCH to the URL fo a git repository. release.7: - Document VCSCMD. Submitted by: Rick Miller (based on) Sponsored by: The FreeBSD Foundation Modified: head/release/release.conf.sample head/release/release.sh head/share/man/man7/release.7 Modified: head/release/release.conf.sample ============================================================================== --- head/release/release.conf.sample Tue Feb 25 21:43:46 2014 (r262498) +++ head/release/release.conf.sample Tue Feb 25 22:13:48 2014 (r262499) @@ -7,7 +7,7 @@ CHROOTDIR="/scratch" ## Set the svn host. -SVNROOT="svn://svn.FreeBSD.org" +SVNROOT="svn://svn.FreeBSD.org/" ## Set the src/, ports/, and doc/ branches or tags. SRCBRANCH="base/head@rHEAD" @@ -17,6 +17,13 @@ PORTBRANCH="ports/head@rHEAD" ## Run svn co --force for src checkout. #SRC_FORCE_CHECKOUT=yes +## Sample configuration for using git instead of svn. +#VCSCMD="/usr/local/bin/git clone --branch master" +#SVNROOT="" +#SRCBRANCH="https://github.com/freebsd/freebsd" +#DOCBRANCH="https://github.com/freebsd/freebsd-doc" +#PORTBRANCH="https://github.com/freebsd/freebsd-ports" + ## Set to override the default target architecture. #TARGET="amd64" #TARGET_ARCH="amd64" Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Tue Feb 25 21:43:46 2014 (r262498) +++ head/release/release.sh Tue Feb 25 22:13:48 2014 (r262499) @@ -1,9 +1,13 @@ #!/bin/sh #- +# Copyright (c) 2013, 2014 The FreeBSD Foundation # Copyright (c) 2013 Glen Barber # Copyright (c) 2011 Nathan Whitehorn # All rights reserved. # +# Portions of this software were developed by Glen Barber +# under sponsorship from the FreeBSD Foundation. +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: @@ -38,9 +42,12 @@ export PATH # The directory within which the release will be built. CHROOTDIR="/scratch" +# The default version control system command to obtain the sources. +VCSCMD="svn checkout" + # The default svn checkout server, and svn branches for src/, doc/, # and ports/. -SVNROOT="svn://svn.freebsd.org" +SVNROOT="svn://svn.FreeBSD.org/" SRCBRANCH="base/head@rHEAD" DOCBRANCH="doc/head@rHEAD" PORTBRANCH="ports/head@rHEAD" @@ -98,6 +105,11 @@ while getopts c: opt; do done shift $(($OPTIND - 1)) +# Prefix the branches with the SVNROOT for the full checkout URL. +SRCBRANCH="${SVNROOT}${SRCBRANCH}" +DOCBRANCH="${SVNROOT}${DOCBRANCH}" +PORTBRANCH="${SVNROOT}${PORTBRANCH}" + # If PORTS is set and NODOC is unset, force NODOC=yes because the ports tree # is required to build the documentation set. if [ "x${NOPORTS}" != "x" ] && [ "x${NODOC}" = "x" ]; then @@ -155,12 +167,12 @@ set -e # Everything must succeed mkdir -p ${CHROOTDIR}/usr -svn co ${FORCE_SRC_KEY} ${SVNROOT}/${SRCBRANCH} ${CHROOTDIR}/usr/src +${VCSCMD} ${FORCE_SRC_KEY} ${SRCBRANCH} ${CHROOTDIR}/usr/src if [ "x${NODOC}" = "x" ]; then - svn co ${SVNROOT}/${DOCBRANCH} ${CHROOTDIR}/usr/doc + ${VCSCMD} ${DOCBRANCH} ${CHROOTDIR}/usr/doc fi if [ "x${NOPORTS}" = "x" ]; then - svn co ${SVNROOT}/${PORTBRANCH} ${CHROOTDIR}/usr/ports + ${VCSCMD} ${PORTBRANCH} ${CHROOTDIR}/usr/ports fi cd ${CHROOTDIR}/usr/src Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Tue Feb 25 21:43:46 2014 (r262498) +++ head/share/man/man7/release.7 Tue Feb 25 22:13:48 2014 (r262499) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2013 +.Dd February 25, 2014 .Dt RELEASE 7 .Os .Sh NAME @@ -245,6 +245,10 @@ Setting this also sets Set to a non-empty value to include the .Cm dvdrom target. +.It Va VCSCMD +The command run to obtain the source trees. +Defaults to +.Qq Cm svn checkout . .El .Sh MAKEFILE TARGETS The release makefile From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 23:03:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C856804; Tue, 25 Feb 2014 23:03:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 16F0E15E2; Tue, 25 Feb 2014 23:03:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1PN3mth064683; Tue, 25 Feb 2014 23:03:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1PN3mJd064682; Tue, 25 Feb 2014 23:03:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402252303.s1PN3mJd064682@svn.freebsd.org> From: Xin LI Date: Tue, 25 Feb 2014 23:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262501 - head/secure/lib/libcrypt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 23:03:49 -0000 Author: delphij Date: Tue Feb 25 23:03:48 2014 New Revision: 262501 URL: http://svnweb.freebsd.org/changeset/base/262501 Log: Refresh our implementation of OpenBSD's Blowfish password format. Notable changes: - Support of $2b$ password format to address a problem where very long passwords (more than 256 characters, when an integer overflow would happen and cause the length to wrap at 256). - Updated pseudo code in comments to reflect the reality. - Removed our local shortcut of processing magic string and rely on the centralized and tigntened validation. - Diff reduction from upstream. For now we are still generating the older $02a$ format of password but we will migrate to the new format once the format is formally finalized. MFC after: 1 month Modified: head/secure/lib/libcrypt/crypt-blowfish.c Modified: head/secure/lib/libcrypt/crypt-blowfish.c ============================================================================== --- head/secure/lib/libcrypt/crypt-blowfish.c Tue Feb 25 22:13:51 2014 (r262500) +++ head/secure/lib/libcrypt/crypt-blowfish.c Tue Feb 25 23:03:48 2014 (r262501) @@ -1,3 +1,5 @@ +/* $OpenBSD: bcrypt.c,v 1.29 2014/02/24 19:45:43 tedu Exp $ */ + /* * Copyright 1997 Niels Provos * All rights reserved. @@ -35,10 +37,10 @@ __FBSDID("$FreeBSD$"); * and works as follows: * * 1. state := InitState () - * 2. state := ExpandKey (state, salt, password) 3. - * REPEAT rounds: + * 2. state := ExpandKey (state, salt, password) + * 3. REPEAT rounds: + * state := ExpandKey (state, 0, password) * state := ExpandKey (state, 0, salt) - * state := ExpandKey(state, 0, password) * 4. ctext := "OrpheanBeholderScryDoubt" * 5. REPEAT 64: * ctext := Encrypt_ECB (state, ctext); @@ -48,6 +50,7 @@ __FBSDID("$FreeBSD$"); /* * FreeBSD implementation by Paul Herman + * and updated by Xin Li */ #include @@ -66,18 +69,18 @@ __FBSDID("$FreeBSD$"); #define BCRYPT_VERSION '2' #define BCRYPT_MAXSALT 16 /* Precomputation is just so nice */ #define BCRYPT_BLOCKS 6 /* Ciphertext blocks */ -#define BCRYPT_MINROUNDS 16 /* we have log2(rounds) in salt */ +#define BCRYPT_MINLOGROUNDS 4 /* we have log2(rounds) in salt */ + static void encode_base64(u_int8_t *, u_int8_t *, u_int16_t); static void decode_base64(u_int8_t *, u_int16_t, const u_int8_t *); static char encrypted[_PASSWORD_LEN]; -static const u_int8_t Base64Code[] = +const static u_int8_t Base64Code[] = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; -static const u_int8_t index_64[128] = -{ +const static u_int8_t index_64[128] = { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, @@ -108,7 +111,7 @@ decode_base64(u_int8_t *buffer, u_int16_ if (c1 == 255 || c2 == 255) break; - *bp++ = (u_int8_t)((c1 << 2) | ((c2 & 0x30) >> 4)); + *bp++ = (c1 << 2) | ((c2 & 0x30) >> 4); if (bp >= buffer + len) break; @@ -138,23 +141,19 @@ crypt_blowfish(const char *key, const ch blf_ctx state; u_int32_t rounds, i, k; u_int16_t j; - u_int8_t key_len, salt_len, logr, minr; + size_t key_len; + u_int8_t salt_len, logr, minr; u_int8_t ciphertext[4 * BCRYPT_BLOCKS] = "OrpheanBeholderScryDoubt"; u_int8_t csalt[BCRYPT_MAXSALT]; u_int32_t cdata[BCRYPT_BLOCKS]; - static const char *magic = "$2a$04$"; - - /* Defaults */ - minr = 'a'; - logr = 4; - rounds = 1 << logr; + char arounds[3]; - /* If it starts with the magic string, then skip that */ - if(!strncmp(salt, magic, strlen(magic))) { - salt += strlen(magic); - } - else if (*salt == '$') { + /* Defaults */ + minr = 'a'; + logr = BCRYPT_MINLOGROUNDS; + rounds = 1U << logr; + if (*salt == '$') { /* Discard "$" identifier */ salt++; @@ -166,9 +165,9 @@ crypt_blowfish(const char *key, const ch /* Check for minor versions */ if (salt[1] != '$') { switch (salt[1]) { - case 'a': - /* 'ab' should not yield the same as 'abab' */ - minr = (u_int8_t)salt[1]; + case 'a': /* 'ab' should not yield the same as 'abab' */ + case 'b': /* cap input length at 72 bytes */ + minr = salt[1]; salt++; break; default: @@ -184,21 +183,38 @@ crypt_blowfish(const char *key, const ch /* Out of sync with passwd entry */ return NULL; - /* Computer power doesnt increase linear, 2^x should be fine */ - logr = (u_int8_t)atoi(salt); - rounds = 1 << logr; - if (rounds < BCRYPT_MINROUNDS) + memcpy(arounds, salt, sizeof(arounds)); + if (arounds[sizeof(arounds) - 1] != '$') + return NULL; + arounds[sizeof(arounds) - 1] = 0; + logr = strtonum(arounds, BCRYPT_MINLOGROUNDS, 31, NULL); + if (logr == 0) return NULL; + /* Computer power doesn't increase linearly, 2^x should be fine */ + rounds = 1U << logr; /* Discard num rounds + "$" identifier */ salt += 3; } + if (strlen(salt) * 3 / 4 < BCRYPT_MAXSALT) + return NULL; /* We dont want the base64 salt but the raw data */ - decode_base64(csalt, BCRYPT_MAXSALT, (const u_int8_t *)salt); + decode_base64(csalt, BCRYPT_MAXSALT, (const u_int8_t *) salt); salt_len = BCRYPT_MAXSALT; - key_len = (u_int8_t)(strlen(key) + (minr >= 'a' ? 1 : 0)); + if (minr <= 'a') + key_len = (u_int8_t)(strlen(key) + (minr >= 'a' ? 1 : 0)); + else { + /* strlen() returns a size_t, but the function calls + * below result in implicit casts to a narrower integer + * type, so cap key_len at the actual maximum supported + * length here to avoid integer wraparound */ + key_len = strlen(key); + if (key_len > 72) + key_len = 72; + key_len++; /* include the NUL */ + } /* Setting up S-Boxes and Subkeys */ Blowfish_initstate(&state); @@ -233,7 +249,7 @@ crypt_blowfish(const char *key, const ch encrypted[i++] = '$'; encrypted[i++] = BCRYPT_VERSION; if (minr) - encrypted[i++] = (int8_t)minr; + encrypted[i++] = minr; encrypted[i++] = '$'; snprintf(encrypted + i, 4, "%2.2u$", logr); @@ -241,6 +257,10 @@ crypt_blowfish(const char *key, const ch encode_base64((u_int8_t *) encrypted + i + 3, csalt, BCRYPT_MAXSALT); encode_base64((u_int8_t *) encrypted + strlen(encrypted), ciphertext, 4 * BCRYPT_BLOCKS - 1); + memset(&state, 0, sizeof(state)); + memset(ciphertext, 0, sizeof(ciphertext)); + memset(csalt, 0, sizeof(csalt)); + memset(cdata, 0, sizeof(cdata)); return encrypted; } @@ -273,7 +293,6 @@ encode_base64(u_int8_t *buffer, u_int8_t } *bp = '\0'; } - #if 0 void main() @@ -288,11 +307,11 @@ main() snprintf(salt + 3, 4, "%2.2u$", 5); printf("24 bytes of salt: "); - fgets(salt + 6, 94, stdin); + fgets(salt + 6, sizeof(salt) - 6, stdin); salt[99] = 0; printf("72 bytes of password: "); fpurge(stdin); - fgets(blubber, 73, stdin); + fgets(blubber, sizeof(blubber), stdin); blubber[72] = 0; p = crypt(blubber, salt); From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 23:04:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7BBE7A34; Tue, 25 Feb 2014 23:04:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 671D215F3; Tue, 25 Feb 2014 23:04:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1PN4ej9064949; Tue, 25 Feb 2014 23:04:40 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1PN4eKx064948; Tue, 25 Feb 2014 23:04:40 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201402252304.s1PN4eKx064948@svn.freebsd.org> From: Julio Merino Date: Tue, 25 Feb 2014 23:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262502 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 23:04:40 -0000 Author: jmmv Date: Tue Feb 25 23:04:39 2014 New Revision: 262502 URL: http://svnweb.freebsd.org/changeset/base/262502 Log: Fix comment introduced in r262480: it's 1920x1200, not 1980x1200. PR: kern/180558 MFC after: 5 days Modified: head/sys/dev/syscons/syscons.h Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Tue Feb 25 23:03:48 2014 (r262501) +++ head/sys/dev/syscons/syscons.h Tue Feb 25 23:04:39 2014 (r262502) @@ -145,7 +145,7 @@ /* The following #defines are hard-coded for a maximum text resolution corresponding to a maximum framebuffer - resolution of 1980x1200 with an 8x8 font... + resolution of 1920x1200 with an 8x8 font... */ #define COL 240 #define ROW 150 From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 23:05:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1BB8B7E for ; Tue, 25 Feb 2014 23:05:17 +0000 (UTC) Received: from mail-qa0-f52.google.com (mail-qa0-f52.google.com [209.85.216.52]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8BF7F15FC for ; Tue, 25 Feb 2014 23:05:17 +0000 (UTC) Received: by mail-qa0-f52.google.com with SMTP id j15so1272398qaq.11 for ; Tue, 25 Feb 2014 15:05:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=Ni6mgikfCep6m0E/lguU4ToO+uM3NdS6nvDiiJ9IHLY=; b=HxyYVWd8EMhRsG9+JToi66OstdLgYPyyTOOtRYHocn9rGlqZ0WywLrQuNu15roiz7X aaK+pzHUuUOazBK4JXWvX80f+aWuB+vHNANY0tNZ+8mjRdVPxVNH5iDgEy4wS9um1IuV aBe9bL9T+b9olXONCKWU7xgFhJ5tPU87KyR815zfcwyiXaTsiEteiyNSwdwEU8EshxZJ rzC8C+I86HHFVwCWrV45FU8fRD1UTJcgYeJefCidT7n7yUzeBytz3PtdN2jqrZn6tkiH 2WTgRJfPEug1JZlxapIdNlUnnUoxk9g3AdaVXWBaNiNupxfGv3DM2H46eEB6hY9GbS32 PyyQ== X-Gm-Message-State: ALoCoQm1OE8Ulol+bzav17ASpZ4iVlz8Wp/GqZzTtnvJh3sSKpmIocN/OeAPc3kMGtRIZcx+ZAdh X-Received: by 10.140.38.75 with SMTP id s69mr3537910qgs.62.1393369510181; Tue, 25 Feb 2014 15:05:10 -0800 (PST) MIME-Version: 1.0 Sender: jmmv@meroh.net Received: by 10.96.83.102 with HTTP; Tue, 25 Feb 2014 15:04:49 -0800 (PST) X-Originating-IP: [2620:0:1003:1021:4caa:3bed:7f9b:5e2d] In-Reply-To: References: <201402251348.s1PDm5Zp030180@svn.freebsd.org> From: Julio Merino Date: Tue, 25 Feb 2014 18:04:49 -0500 X-Google-Sender-Auth: fiYFhB_UDeNBnpAwf9j7QBgj1JE Message-ID: Subject: Re: svn commit: r262480 - head/sys/dev/syscons To: Thomas Hoffmann Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 23:05:17 -0000 On Tue, Feb 25, 2014 at 9:30 AM, Thomas Hoffmann wrote: > > The math works out OK for COL 240, but the comment has it wrong. Should be > 1920x1200. > Doh, of course. Fixed in r262502. From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 23:16:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9FCBFDFC; Tue, 25 Feb 2014 23:16:24 +0000 (UTC) Received: from mail-vc0-x232.google.com (mail-vc0-x232.google.com [IPv6:2607:f8b0:400c:c03::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1FAA516BF; Tue, 25 Feb 2014 23:16:24 +0000 (UTC) Received: by mail-vc0-f178.google.com with SMTP id ik5so110871vcb.37 for ; Tue, 25 Feb 2014 15:16:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=0xDW8k8ZRQwjy6R0l0TQnSsI/uOfBemFsgj4YrNu8MU=; b=BL4bEvXW1QRRVT3Mzb9xRr0ePc71gw/BlrOJnyX9HKYTjz8pw9DHnRRwexvvj8Yjab OdB+G83V94UE/WEYMtgiIvsd+vg+AYbm4XZ6zkjkSz/RylgNtMM1Kq6HykAGiPXDmsrY iEPsL/Q9p/MiBj6oqpKHjRV2SNKaZTZkGStgaZ5SQUpK2SYUPxCH+Hv7MMu5f84Q8/X5 2rltn4uuHjSYJpOG8E8WcgBzx7yoav9COcLrPH24CRNjdDo0jtCzpIfFwmPG7vkeuGg/ 4Mk2f8+NKFq6AsNCxGYRpqYcNrcM/bB0+WyLeN/zhXiGoS15YsfUauoqsvxsGKJ5NG4p Dqzw== MIME-Version: 1.0 X-Received: by 10.220.188.10 with SMTP id cy10mr223713vcb.36.1393370183261; Tue, 25 Feb 2014 15:16:23 -0800 (PST) Received: by 10.220.168.135 with HTTP; Tue, 25 Feb 2014 15:16:23 -0800 (PST) In-Reply-To: References: <201402251348.s1PDm5Zp030180@svn.freebsd.org> Date: Tue, 25 Feb 2014 18:16:23 -0500 Message-ID: Subject: Re: svn commit: r262480 - head/sys/dev/syscons From: Thomas Hoffmann To: Julio Merino Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 23:16:24 -0000 On Tue, Feb 25, 2014 at 6:04 PM, Julio Merino wrote: > On Tue, Feb 25, 2014 at 9:30 AM, Thomas Hoffmann wrote: >> >> The math works out OK for COL 240, but the comment has it wrong. Should >> be 1920x1200. >> > > Doh, of course. Fixed in r262502. > Thanks for this patch to ./sys/dev/syscons. I've got an iMac running at 1920x1200 that I'm itching to move to vt(9) when I get a suitable block of free time. I was not looking forward to having a 1600x1200 limitation. -Tom From owner-svn-src-head@FreeBSD.ORG Tue Feb 25 23:17:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44867F54; Tue, 25 Feb 2014 23:17:59 +0000 (UTC) Received: from mail-ee0-x229.google.com (mail-ee0-x229.google.com [IPv6:2a00:1450:4013:c00::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5C8D616CF; Tue, 25 Feb 2014 23:17:58 +0000 (UTC) Received: by mail-ee0-f41.google.com with SMTP id b15so48139eek.0 for ; Tue, 25 Feb 2014 15:17:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=z1USaGKsGki1ByAogjuM8RuX6H0TWzPq32iz2PXngQI=; b=NwBHdUjs6v2uFPIRVmeLdzQP0RKAj8TLVwSJrfxp2EK0jOuqYN7iktgXN17JM8OK4E D6mVlGlRkToa05e/Ddfj5PjXtbbXAzFx0M02G8msPQVw7dRShv53eqYMoXlTov+EE0fo +kk8pEfXZ6JBhmWjDFXI9+5WR2kw5VaoYIz8S7fDjIpArfS+8oUUgZFIGuwVxUQbytKY Kg/VXpo0JMnoaKZK0PrtSvVYZp2q6xGw/CQ1g0EU40/aZNzTd2FTHLLvee70zuVEK8Fk DIYqXrfRNDnfIwG+N6JJOvfwBi0/1RPE6ylmpmIXVYQKHuDyKXOTWbODHeICu10n3sh7 +Vmg== MIME-Version: 1.0 X-Received: by 10.204.102.199 with SMTP id h7mr2496220bko.15.1393370276754; Tue, 25 Feb 2014 15:17:56 -0800 (PST) Sender: chmeeedalf@gmail.com Received: by 10.205.21.68 with HTTP; Tue, 25 Feb 2014 15:17:56 -0800 (PST) In-Reply-To: <201402250258.s1P2wCDd060659@svn.freebsd.org> References: <201402250258.s1P2wCDd060659@svn.freebsd.org> Date: Tue, 25 Feb 2014 15:17:56 -0800 X-Google-Sender-Auth: MjaRaKjgkPASA2Lc5k4wDsMCDR8 Message-ID: Subject: Re: svn commit: r262466 - head/sys/cddl/dev/systrace From: Justin Hibbits To: Mark Johnston Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Feb 2014 23:17:59 -0000 I think this broke powerpc building. I see the following build failure: cc1: warnings being treated as errors /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c: In function 'systrace_probe': /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c:218: warning: function called through a non-compatible type /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c:218: note: if this code is reached, the program will abort - Justin On Mon, Feb 24, 2014 at 6:58 PM, Mark Johnston wrote: > Author: markj > Date: Tue Feb 25 02:58:11 2014 > New Revision: 262466 > URL: http://svnweb.freebsd.org/changeset/base/262466 > > Log: > Make all 8 syscall arguments available to syscall probes in the same way > that this is done for SDT probes. This fixes the syscall/tst.args.d test, > which was failing because mmap(2)'s sixth argument wasn't available to the > probe. > > MFC after: 2 weeks > > Modified: > head/sys/cddl/dev/systrace/systrace.c > > Modified: head/sys/cddl/dev/systrace/systrace.c > ============================================================================== > --- head/sys/cddl/dev/systrace/systrace.c Tue Feb 25 01:42:02 2014 (r262465) > +++ head/sys/cddl/dev/systrace/systrace.c Tue Feb 25 02:58:11 2014 (r262466) > @@ -168,6 +168,9 @@ static dtrace_pops_t systrace_pops = { > static struct cdev *systrace_cdev; > static dtrace_provider_id_t systrace_id; > > +typedef void (*systrace_dtrace_probe)(dtrace_id_t, uintptr_t, uintptr_t, > + uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); > + > #if !defined(LINUX_SYSTRACE) > /* > * Probe callback function. > @@ -211,7 +214,8 @@ systrace_probe(u_int32_t id, int sysnum, > } > > /* Process the probe using the converted argments. */ > - dtrace_probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4]); > + ((systrace_dtrace_probe)(dtrace_probe))(id, uargs[0], uargs[1], > + uargs[2], uargs[3], uargs[4], uargs[5], uargs[6], uargs[7]); > } > > #endif > From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 00:52:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3271691A; Wed, 26 Feb 2014 00:52:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B31D21FDE; Wed, 26 Feb 2014 00:52:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1Q0q77A009467; Wed, 26 Feb 2014 00:52:07 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1Q0q5qC009454; Wed, 26 Feb 2014 00:52:05 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201402260052.s1Q0q5qC009454@svn.freebsd.org> From: Neel Natu Date: Wed, 26 Feb 2014 00:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262506 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/amd sys/amd64/vmm/intel usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 00:52:08 -0000 Author: neel Date: Wed Feb 26 00:52:05 2014 New Revision: 262506 URL: http://svnweb.freebsd.org/changeset/base/262506 Log: Queue pending exceptions in the 'struct vcpu' instead of directly updating the processor-specific VMCS or VMCB. The pending exception will be delivered right before entering the guest. The order of event injection into the guest is: - hardware exception - NMI - maskable interrupt In the Intel VT-x case, a pending NMI or interrupt will enable the interrupt window-exiting and inject it as soon as possible after the hardware exception is injected. Also since interrupts are inherently asynchronous, injecting them after the hardware exception should not affect correctness from the guest perspective. Rename the unused ioctl VM_INJECT_EVENT to VM_INJECT_EXCEPTION and restrict it to only deliver x86 hardware exceptions. This new ioctl is now used to inject a protection fault when the guest accesses an unimplemented MSR. Discussed with: grehan, jhb Reviewed by: jhb Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/amd/amdv.c head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/intel/vmx.h head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_dev.c head/usr.sbin/bhyve/bhyverun.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Wed Feb 26 00:52:01 2014 (r262505) +++ head/lib/libvmmapi/vmmapi.c Wed Feb 26 00:52:05 2014 (r262506) @@ -343,35 +343,32 @@ vm_run(struct vmctx *ctx, int vcpu, uint } static int -vm_inject_event_real(struct vmctx *ctx, int vcpu, enum vm_event_type type, - int vector, int error_code, int error_code_valid) +vm_inject_exception_real(struct vmctx *ctx, int vcpu, int vector, + int error_code, int error_code_valid) { - struct vm_event ev; + struct vm_exception exc; - bzero(&ev, sizeof(ev)); - ev.cpuid = vcpu; - ev.type = type; - ev.vector = vector; - ev.error_code = error_code; - ev.error_code_valid = error_code_valid; + bzero(&exc, sizeof(exc)); + exc.cpuid = vcpu; + exc.vector = vector; + exc.error_code = error_code; + exc.error_code_valid = error_code_valid; - return (ioctl(ctx->fd, VM_INJECT_EVENT, &ev)); + return (ioctl(ctx->fd, VM_INJECT_EXCEPTION, &exc)); } int -vm_inject_event(struct vmctx *ctx, int vcpu, enum vm_event_type type, - int vector) +vm_inject_exception(struct vmctx *ctx, int vcpu, int vector) { - return (vm_inject_event_real(ctx, vcpu, type, vector, 0, 0)); + return (vm_inject_exception_real(ctx, vcpu, vector, 0, 0)); } int -vm_inject_event2(struct vmctx *ctx, int vcpu, enum vm_event_type type, - int vector, int error_code) +vm_inject_exception2(struct vmctx *ctx, int vcpu, int vector, int errcode) { - return (vm_inject_event_real(ctx, vcpu, type, vector, error_code, 1)); + return (vm_inject_exception_real(ctx, vcpu, vector, errcode, 1)); } int Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Wed Feb 26 00:52:01 2014 (r262505) +++ head/lib/libvmmapi/vmmapi.h Wed Feb 26 00:52:05 2014 (r262506) @@ -62,10 +62,8 @@ int vm_get_register(struct vmctx *ctx, i int vm_run(struct vmctx *ctx, int vcpu, uint64_t rip, struct vm_exit *ret_vmexit); int vm_apicid2vcpu(struct vmctx *ctx, int apicid); -int vm_inject_event(struct vmctx *ctx, int vcpu, enum vm_event_type type, - int vector); -int vm_inject_event2(struct vmctx *ctx, int vcpu, enum vm_event_type type, - int vector, int error_code); +int vm_inject_exception(struct vmctx *ctx, int vcpu, int vec); +int vm_inject_exception2(struct vmctx *ctx, int vcpu, int vec, int errcode); int vm_lapic_irq(struct vmctx *ctx, int vcpu, int vector); int vm_lapic_local_irq(struct vmctx *ctx, int vcpu, int vector); int vm_lapic_msi(struct vmctx *ctx, uint64_t addr, uint64_t msg); Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Wed Feb 26 00:52:01 2014 (r262505) +++ head/sys/amd64/include/vmm.h Wed Feb 26 00:52:05 2014 (r262506) @@ -34,6 +34,7 @@ #define VM_MAX_NAMELEN 32 struct vm; +struct vm_exception; struct vm_memory_segment; struct seg_desc; struct vm_exit; @@ -62,9 +63,6 @@ typedef int (*vmi_get_desc_t)(void *vmi, struct seg_desc *desc); typedef int (*vmi_set_desc_t)(void *vmi, int vcpu, int num, struct seg_desc *desc); -typedef int (*vmi_inject_event_t)(void *vmi, int vcpu, - int type, int vector, - uint32_t code, int code_valid); typedef int (*vmi_get_cap_t)(void *vmi, int vcpu, int num, int *retval); typedef int (*vmi_set_cap_t)(void *vmi, int vcpu, int num, int val); typedef struct vmspace * (*vmi_vmspace_alloc)(vm_offset_t min, vm_offset_t max); @@ -84,7 +82,6 @@ struct vmm_ops { vmi_set_register_t vmsetreg; vmi_get_desc_t vmgetdesc; vmi_set_desc_t vmsetdesc; - vmi_inject_event_t vminject; vmi_get_cap_t vmgetcap; vmi_set_cap_t vmsetcap; vmi_vmspace_alloc vmspace_alloc; @@ -117,8 +114,6 @@ int vm_get_seg_desc(struct vm *vm, int v int vm_set_seg_desc(struct vm *vm, int vcpu, int reg, struct seg_desc *desc); int vm_run(struct vm *vm, struct vm_run *vmrun); -int vm_inject_event(struct vm *vm, int vcpu, int type, - int vector, uint32_t error_code, int error_code_valid); int vm_inject_nmi(struct vm *vm, int vcpu); int vm_nmi_pending(struct vm *vm, int vcpuid); void vm_nmi_clear(struct vm *vm, int vcpuid); @@ -192,6 +187,33 @@ void vcpu_notify_event(struct vm *vm, in struct vmspace *vm_get_vmspace(struct vm *vm); int vm_assign_pptdev(struct vm *vm, int bus, int slot, int func); int vm_unassign_pptdev(struct vm *vm, int bus, int slot, int func); + +/* + * Inject exception 'vme' into the guest vcpu. This function returns 0 on + * success and non-zero on failure. + * + * Wrapper functions like 'vm_inject_gp()' should be preferred to calling + * this function directly because they enforce the trap-like or fault-like + * behavior of an exception. + * + * This function should only be called in the context of the thread that is + * executing this vcpu. + */ +int vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *vme); + +/* + * Returns 0 if there is no exception pending for this vcpu. Returns 1 if an + * exception is pending and also updates 'vme'. The pending exception is + * cleared when this function returns. + * + * This function should only be called in the context of the thread that is + * executing this vcpu. + */ +int vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *vme); + +void vm_inject_gp(struct vm *vm, int vcpuid); /* general protection fault */ +void vm_inject_ud(struct vm *vm, int vcpuid); /* undefined instruction fault */ + #endif /* KERNEL */ #include @@ -199,20 +221,6 @@ int vm_unassign_pptdev(struct vm *vm, in #define VM_MAXCPU 16 /* maximum virtual cpus */ /* - * Identifiers for events that can be injected into the VM - */ -enum vm_event_type { - VM_EVENT_NONE, - VM_HW_INTR, - VM_NMI, - VM_HW_EXCEPTION, - VM_SW_INTR, - VM_PRIV_SW_EXCEPTION, - VM_SW_EXCEPTION, - VM_EVENT_MAX -}; - -/* * Identifiers for architecturally defined registers. */ enum vm_reg_name { Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Wed Feb 26 00:52:01 2014 (r262505) +++ head/sys/amd64/include/vmm_dev.h Wed Feb 26 00:52:05 2014 (r262506) @@ -58,9 +58,8 @@ struct vm_run { struct vm_exit vm_exit; }; -struct vm_event { +struct vm_exception { int cpuid; - enum vm_event_type type; int vector; uint32_t error_code; int error_code_valid; @@ -174,7 +173,7 @@ enum { IOCNUM_GET_SEGMENT_DESCRIPTOR = 23, /* interrupt injection */ - IOCNUM_INJECT_EVENT = 30, + IOCNUM_INJECT_EXCEPTION = 30, IOCNUM_LAPIC_IRQ = 31, IOCNUM_INJECT_NMI = 32, IOCNUM_IOAPIC_ASSERT_IRQ = 33, @@ -215,8 +214,8 @@ enum { _IOW('v', IOCNUM_SET_SEGMENT_DESCRIPTOR, struct vm_seg_desc) #define VM_GET_SEGMENT_DESCRIPTOR \ _IOWR('v', IOCNUM_GET_SEGMENT_DESCRIPTOR, struct vm_seg_desc) -#define VM_INJECT_EVENT \ - _IOW('v', IOCNUM_INJECT_EVENT, struct vm_event) +#define VM_INJECT_EXCEPTION \ + _IOW('v', IOCNUM_INJECT_EXCEPTION, struct vm_exception) #define VM_LAPIC_IRQ \ _IOW('v', IOCNUM_LAPIC_IRQ, struct vm_lapic_irq) #define VM_LAPIC_LOCAL_IRQ \ Modified: head/sys/amd64/vmm/amd/amdv.c ============================================================================== --- head/sys/amd64/vmm/amd/amdv.c Wed Feb 26 00:52:01 2014 (r262505) +++ head/sys/amd64/vmm/amd/amdv.c Wed Feb 26 00:52:05 2014 (r262506) @@ -115,15 +115,6 @@ amdv_setdesc(void *vmi, int vcpu, int nu } static int -amdv_inject_event(void *vmi, int vcpu, int type, int vector, - uint32_t error_code, int error_code_valid) -{ - - printf("amdv_inject_event: not implemented\n"); - return (EINVAL); -} - -static int amdv_getcap(void *arg, int vcpu, int type, int *retval) { @@ -180,7 +171,6 @@ struct vmm_ops vmm_ops_amd = { amdv_setreg, amdv_getdesc, amdv_setdesc, - amdv_inject_event, amdv_getcap, amdv_setcap, amdv_vmspace_alloc, Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Wed Feb 26 00:52:01 2014 (r262505) +++ head/sys/amd64/vmm/intel/vmx.c Wed Feb 26 00:52:05 2014 (r262506) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "vmm_host.h" #include "vmm_ipi.h" #include "vmm_msr.h" @@ -935,7 +936,6 @@ vmx_vminit(struct vm *vm, pmap_t pmap) vmx->state[i].lastcpu = -1; vmx->state[i].vpid = vpid[i]; - vmx->state[i].user_event.intr_info = 0; msr_save_area_init(vmx->guest_msrs[i], &guest_msr_count); @@ -1114,66 +1114,6 @@ vmx_clear_nmi_window_exiting(struct vmx VMCS_INTERRUPTIBILITY_MOVSS_BLOCKING) static void -vmx_inject_user_event(struct vmx *vmx, int vcpu) -{ - struct vmxevent *user_event; - uint32_t info; - - user_event = &vmx->state[vcpu].user_event; - - info = vmcs_read(VMCS_ENTRY_INTR_INFO); - KASSERT((info & VMCS_INTR_VALID) == 0, ("vmx_inject_user_event: invalid " - "VM-entry interruption information %#x", info)); - - vmcs_write(VMCS_ENTRY_INTR_INFO, user_event->intr_info); - if (user_event->intr_info & VMCS_INTR_DEL_ERRCODE) - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, user_event->error_code); - user_event->intr_info = 0; -} - -static void -vmx_inject_exception(struct vmx *vmx, int vcpu, struct vm_exit *vmexit, - int fault, int errvalid, int errcode) -{ - uint32_t info; - - info = vmcs_read(VMCS_ENTRY_INTR_INFO); - KASSERT((info & VMCS_INTR_VALID) == 0, ("vmx_inject_exception: invalid " - "VM-entry interruption information %#x", info)); - - /* - * Although INTR_T_HWEXCEPTION does not advance %rip, vmx_run() - * always advances it, so we clear the instruction length to zero - * explicitly. - */ - vmexit->inst_length = 0; - info = fault | VMCS_INTR_T_HWEXCEPTION | VMCS_INTR_VALID; - if (errvalid) { - info |= VMCS_INTR_DEL_ERRCODE; - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, errcode); - } - vmcs_write(VMCS_ENTRY_INTR_INFO, info); - - VCPU_CTR2(vmx->vm, vcpu, "Injecting fault %d (errcode %d)", fault, - errcode); -} - -/* All GP# faults VMM injects use an error code of 0. */ -static void -vmx_inject_gp(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) -{ - - vmx_inject_exception(vmx, vcpu, vmexit, IDT_GP, 1, 0); -} - -static void -vmx_inject_ud(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) -{ - - vmx_inject_exception(vmx, vcpu, vmexit, IDT_UD, 0, 0); -} - -static void vmx_inject_nmi(struct vmx *vmx, int vcpu) { uint32_t gi, info; @@ -1202,10 +1142,27 @@ vmx_inject_nmi(struct vmx *vmx, int vcpu static void vmx_inject_interrupts(struct vmx *vmx, int vcpu, struct vlapic *vlapic) { + struct vm_exception exc; int vector, need_nmi_exiting; uint64_t rflags; uint32_t gi, info; + if (vm_exception_pending(vmx->vm, vcpu, &exc)) { + KASSERT(exc.vector >= 0 && exc.vector < 32, + ("%s: invalid exception vector %d", __func__, exc.vector)); + + info = vmcs_read(VMCS_ENTRY_INTR_INFO); + KASSERT((info & VMCS_INTR_VALID) == 0, ("%s: cannot inject " + "pending exception %d: %#x", __func__, exc.vector, info)); + + info = exc.vector | VMCS_INTR_T_HWEXCEPTION | VMCS_INTR_VALID; + if (exc.error_code_valid) { + info |= VMCS_INTR_DEL_ERRCODE; + vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, exc.error_code); + } + vmcs_write(VMCS_ENTRY_INTR_INFO, info); + } + if (vm_nmi_pending(vmx->vm, vcpu)) { /* * If there are no conditions blocking NMI injection then @@ -1238,24 +1195,6 @@ vmx_inject_interrupts(struct vmx *vmx, i vmx_set_nmi_window_exiting(vmx, vcpu); } - /* - * If there is a user injection event pending and there isn't - * an interrupt queued already, inject the user event. - */ - if (vmx->state[vcpu].user_event.intr_info & VMCS_INTR_VALID) { - info = vmcs_read(VMCS_ENTRY_INTR_INFO); - if ((info & VMCS_INTR_VALID) == 0) { - vmx_inject_user_event(vmx, vcpu); - } else { - /* - * XXX: Do we need to force an exit so this can - * be injected? - */ - VCPU_CTR1(vmx->vm, vcpu, "Cannot inject user event " - "due to VM-entry intr info %#x", info); - } - } - if (virtual_interrupt_delivery) { vmx_inject_pir(vlapic); return; @@ -1299,6 +1238,7 @@ vmx_inject_interrupts(struct vmx *vmx, i * This is expected and could happen for multiple reasons: * - A vectoring VM-entry was aborted due to astpending * - A VM-exit happened during event injection. + * - An exception was injected above. * - An NMI was injected above or after "NMI window exiting" */ VCPU_CTR2(vmx->vm, vcpu, "Cannot inject vector %d due to " @@ -1375,30 +1315,30 @@ vmx_emulate_xsetbv(struct vmx *vmx, int /* Only xcr0 is supported. */ if (vmxctx->guest_rcx != 0) { - vmx_inject_gp(vmx, vcpu, vmexit); + vm_inject_gp(vmx->vm, vcpu); return (HANDLED); } /* We only handle xcr0 if both the host and guest have XSAVE enabled. */ if (!limits->xsave_enabled || !(vmcs_read(VMCS_GUEST_CR4) & CR4_XSAVE)) { - vmx_inject_ud(vmx, vcpu, vmexit); + vm_inject_ud(vmx->vm, vcpu); return (HANDLED); } xcrval = vmxctx->guest_rdx << 32 | (vmxctx->guest_rax & 0xffffffff); if ((xcrval & ~limits->xcr0_allowed) != 0) { - vmx_inject_gp(vmx, vcpu, vmexit); + vm_inject_gp(vmx->vm, vcpu); return (HANDLED); } if (!(xcrval & XFEATURE_ENABLED_X87)) { - vmx_inject_gp(vmx, vcpu, vmexit); + vm_inject_gp(vmx->vm, vcpu); return (HANDLED); } if ((xcrval & (XFEATURE_ENABLED_AVX | XFEATURE_ENABLED_SSE)) == XFEATURE_ENABLED_AVX) { - vmx_inject_gp(vmx, vcpu, vmexit); + vm_inject_gp(vmx->vm, vcpu); return (HANDLED); } @@ -2423,38 +2363,6 @@ vmx_setdesc(void *arg, int vcpu, int reg } static int -vmx_inject(void *arg, int vcpu, int type, int vector, uint32_t code, - int code_valid) -{ - struct vmx *vmx = arg; - struct vmxevent *user_event = &vmx->state[vcpu].user_event; - - static uint32_t type_map[VM_EVENT_MAX] = { - 0x1, /* VM_EVENT_NONE */ - 0x0, /* VM_HW_INTR */ - 0x2, /* VM_NMI */ - 0x3, /* VM_HW_EXCEPTION */ - 0x4, /* VM_SW_INTR */ - 0x5, /* VM_PRIV_SW_EXCEPTION */ - 0x6, /* VM_SW_EXCEPTION */ - }; - - /* - * If there is already an exception pending to be delivered to the - * vcpu then just return. - */ - if (user_event->intr_info & VMCS_INTR_VALID) - return (EAGAIN); - - user_event->intr_info = vector | (type_map[type] << 8) | VMCS_INTR_VALID; - if (code_valid) { - user_event->intr_info |= VMCS_INTR_DEL_ERRCODE; - user_event->error_code = code; - } - return (0); -} - -static int vmx_getcap(void *arg, int vcpu, int type, int *retval) { struct vmx *vmx = arg; @@ -2900,7 +2808,6 @@ struct vmm_ops vmm_ops_intel = { vmx_setreg, vmx_getdesc, vmx_setdesc, - vmx_inject, vmx_getcap, vmx_setcap, ept_vmspace_alloc, Modified: head/sys/amd64/vmm/intel/vmx.h ============================================================================== --- head/sys/amd64/vmm/intel/vmx.h Wed Feb 26 00:52:01 2014 (r262505) +++ head/sys/amd64/vmm/intel/vmx.h Wed Feb 26 00:52:05 2014 (r262506) @@ -80,15 +80,9 @@ struct vmxcap { uint32_t proc_ctls2; }; -struct vmxevent { - uint32_t intr_info; - uint32_t error_code; -}; - struct vmxstate { int lastcpu; /* host cpu that this 'vcpu' last ran on */ uint16_t vpid; - struct vmxevent user_event; }; struct apic_page { Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Wed Feb 26 00:52:01 2014 (r262505) +++ head/sys/amd64/vmm/vmm.c Wed Feb 26 00:52:05 2014 (r262506) @@ -94,6 +94,8 @@ struct vcpu { struct vm_exit exitinfo; enum x2apic_state x2apic_state; int nmi_pending; + struct vm_exception exception; + int exception_pending; }; #define vcpu_lock_init(v) mtx_init(&((v)->mtx), "vcpu lock", 0, MTX_SPIN) @@ -157,8 +159,6 @@ static struct vmm_ops *ops; (ops != NULL ? (*ops->vmgetdesc)(vmi, vcpu, num, desc) : ENXIO) #define VMSETDESC(vmi, vcpu, num, desc) \ (ops != NULL ? (*ops->vmsetdesc)(vmi, vcpu, num, desc) : ENXIO) -#define VMINJECT(vmi, vcpu, type, vec, ec, ecv) \ - (ops != NULL ? (*ops->vminject)(vmi, vcpu, type, vec, ec, ecv) : ENXIO) #define VMGETCAP(vmi, vcpu, num, retval) \ (ops != NULL ? (*ops->vmgetcap)(vmi, vcpu, num, retval) : ENXIO) #define VMSETCAP(vmi, vcpu, num, val) \ @@ -1202,19 +1202,91 @@ restart: } int -vm_inject_event(struct vm *vm, int vcpuid, int type, - int vector, uint32_t code, int code_valid) +vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *exception) { + struct vcpu *vcpu; + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) return (EINVAL); - if ((type > VM_EVENT_NONE && type < VM_EVENT_MAX) == 0) + if (exception->vector < 0 || exception->vector >= 32) return (EINVAL); - if (vector < 0 || vector > 255) - return (EINVAL); + vcpu = &vm->vcpu[vcpuid]; + + if (vcpu->exception_pending) { + VCPU_CTR2(vm, vcpuid, "Unable to inject exception %d due to " + "pending exception %d", exception->vector, + vcpu->exception.vector); + return (EBUSY); + } + + vcpu->exception_pending = 1; + vcpu->exception = *exception; + VCPU_CTR1(vm, vcpuid, "Exception %d pending", exception->vector); + return (0); +} + +int +vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *exception) +{ + struct vcpu *vcpu; + int pending; + + KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); + + vcpu = &vm->vcpu[vcpuid]; + pending = vcpu->exception_pending; + if (pending) { + vcpu->exception_pending = 0; + *exception = vcpu->exception; + VCPU_CTR1(vm, vcpuid, "Exception %d delivered", + exception->vector); + } + return (pending); +} + +static void +vm_inject_fault(struct vm *vm, int vcpuid, struct vm_exception *exception) +{ + struct vm_exit *vmexit; + int error; + + error = vm_inject_exception(vm, vcpuid, exception); + KASSERT(error == 0, ("vm_inject_exception error %d", error)); + + /* + * A fault-like exception allows the instruction to be restarted + * after the exception handler returns. + * + * By setting the inst_length to 0 we ensure that the instruction + * pointer remains at the faulting instruction. + */ + vmexit = vm_exitinfo(vm, vcpuid); + vmexit->inst_length = 0; +} + +void +vm_inject_gp(struct vm *vm, int vcpuid) +{ + struct vm_exception gpf = { + .vector = IDT_GP, + .error_code_valid = 1, + .error_code = 0 + }; + + vm_inject_fault(vm, vcpuid, &gpf); +} + +void +vm_inject_ud(struct vm *vm, int vcpuid) +{ + struct vm_exception udf = { + .vector = IDT_UD, + .error_code_valid = 0 + }; - return (VMINJECT(vm->cookie, vcpuid, type, vector, code, code_valid)); + vm_inject_fault(vm, vcpuid, &udf); } static VMM_STAT(VCPU_NMI_COUNT, "number of NMIs delivered to vcpu"); Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Wed Feb 26 00:52:01 2014 (r262505) +++ head/sys/amd64/vmm/vmm_dev.c Wed Feb 26 00:52:05 2014 (r262506) @@ -150,7 +150,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c struct vm_register *vmreg; struct vm_seg_desc *vmsegdesc; struct vm_run *vmrun; - struct vm_event *vmevent; + struct vm_exception *vmexc; struct vm_lapic_irq *vmirq; struct vm_lapic_msi *vmmsi; struct vm_ioapic_irq *ioapic_irq; @@ -181,7 +181,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c case VM_SET_REGISTER: case VM_GET_SEGMENT_DESCRIPTOR: case VM_SET_SEGMENT_DESCRIPTOR: - case VM_INJECT_EVENT: + case VM_INJECT_EXCEPTION: case VM_GET_CAPABILITY: case VM_SET_CAPABILITY: case VM_PPTDEV_MSI: @@ -282,12 +282,9 @@ vmmdev_ioctl(struct cdev *cdev, u_long c error = vm_unassign_pptdev(sc->vm, pptdev->bus, pptdev->slot, pptdev->func); break; - case VM_INJECT_EVENT: - vmevent = (struct vm_event *)data; - error = vm_inject_event(sc->vm, vmevent->cpuid, vmevent->type, - vmevent->vector, - vmevent->error_code, - vmevent->error_code_valid); + case VM_INJECT_EXCEPTION: + vmexc = (struct vm_exception *)data; + error = vm_inject_exception(sc->vm, vmexc->cpuid, vmexc); break; case VM_INJECT_NMI: vmnmi = (struct vm_nmi *)data; Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Wed Feb 26 00:52:01 2014 (r262505) +++ head/usr.sbin/bhyve/bhyverun.c Wed Feb 26 00:52:05 2014 (r262506) @@ -321,8 +321,11 @@ vmexit_rdmsr(struct vmctx *ctx, struct v if (error != 0) { fprintf(stderr, "rdmsr to register %#x on vcpu %d\n", vme->u.msr.code, *pvcpu); - if (strictmsr) - return (VMEXIT_ABORT); + if (strictmsr) { + error = vm_inject_exception2(ctx, *pvcpu, IDT_GP, 0); + assert(error == 0); + return (VMEXIT_RESTART); + } } eax = val; @@ -345,8 +348,11 @@ vmexit_wrmsr(struct vmctx *ctx, struct v if (error != 0) { fprintf(stderr, "wrmsr to register %#x(%#lx) on vcpu %d\n", vme->u.msr.code, vme->u.msr.wval, *pvcpu); - if (strictmsr) - return (VMEXIT_ABORT); + if (strictmsr) { + error = vm_inject_exception2(ctx, *pvcpu, IDT_GP, 0); + assert(error == 0); + return (VMEXIT_RESTART); + } } return (VMEXIT_CONTINUE); } From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 00:52:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4645E84F; Wed, 26 Feb 2014 00:52:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 321001FDD; Wed, 26 Feb 2014 00:52:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1Q0q2xq009404; Wed, 26 Feb 2014 00:52:02 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1Q0q2rt009403; Wed, 26 Feb 2014 00:52:02 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201402260052.s1Q0q2rt009403@svn.freebsd.org> From: Glen Barber Date: Wed, 26 Feb 2014 00:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262505 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 00:52:02 -0000 Author: gjb Date: Wed Feb 26 00:52:01 2014 New Revision: 262505 URL: http://svnweb.freebsd.org/changeset/base/262505 Log: In release/Makefile, remove exclusion of CVS directories in the src/ and ports/ distributions. While I am thinking about it, exclude .git directories for src/ and ports/, as somewhat of a followup to r262499. Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Wed Feb 26 00:26:40 2014 (r262504) +++ head/release/Makefile Wed Feb 26 00:52:01 2014 (r262505) @@ -119,13 +119,13 @@ src.txz: mkdir -p ${DISTDIR}/usr ln -fs ${WORLDDIR} ${DISTDIR}/usr/src cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/src.txz --exclude .svn --exclude .zfs \ - --exclude CVS --exclude @ --exclude usr/src/release/dist usr/src + --exclude .git --exclude @ --exclude usr/src/release/dist usr/src ports.txz: mkdir -p ${DISTDIR}/usr ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz \ - --exclude CVS --exclude .svn \ + --exclude .git --exclude .svn \ --exclude usr/ports/distfiles --exclude usr/ports/packages \ --exclude 'usr/ports/INDEX*' --exclude work usr/ports From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 00:55:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51991AFA; Wed, 26 Feb 2014 00:55:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3C8AA1FF6; Wed, 26 Feb 2014 00:55:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1Q0t0iB009848; Wed, 26 Feb 2014 00:55:00 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1Q0t0T0009846; Wed, 26 Feb 2014 00:55:00 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201402260055.s1Q0t0T0009846@svn.freebsd.org> From: Glen Barber Date: Wed, 26 Feb 2014 00:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262507 - head/release/picobsd/build X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 00:55:00 -0000 Author: gjb Date: Wed Feb 26 00:54:59 2014 New Revision: 262507 URL: http://svnweb.freebsd.org/changeset/base/262507 Log: Chase r262505, and remove CVS exclusion from picobsd builds. Sponsored by: The FreeBSD Foundation Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Wed Feb 26 00:52:05 2014 (r262506) +++ head/release/picobsd/build/picobsd Wed Feb 26 00:54:59 2014 (r262507) @@ -475,7 +475,7 @@ populate_floppy_fs() { # OK for FLOPPY_TREE in ${PICO_TREE}/floppy.tree ${MY_TREE}/floppy.tree \ ${MY_TREE}/floppy.tree.${SITE} ; do if [ -d ${FLOPPY_TREE} ] ; then - (cd ${FLOPPY_TREE} ; tar -cf - --exclude CVS \ + (cd ${FLOPPY_TREE} ; tar -cf - \ --exclude .svn ${excl} . ) | \ (cd ${dst} ; tar x${o_tarv}f - ) log "Copied from ${FLOPPY_TREE}" @@ -733,7 +733,7 @@ populate_mfs_tree() { for MFS_TREE in ${PICO_TREE}/mfs_tree ${MY_TREE}/mfs_tree ; do if [ -d ${MFS_TREE} ] ; then log "Copy ${MFS_TREE} ..." - (cd ${MFS_TREE} ; tar -cf - --exclude CVS --exclude .svn . ) | \ + (cd ${MFS_TREE} ; tar -cf - --exclude .svn . ) | \ (cd ${dst} ; tar x${o_tarv}f - ) fi done From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 01:00:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C730D3A; Wed, 26 Feb 2014 01:00:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 487011022; Wed, 26 Feb 2014 01:00:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1Q101qH010625; Wed, 26 Feb 2014 01:00:01 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1Q1018J010622; Wed, 26 Feb 2014 01:00:01 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402260100.s1Q1018J010622@svn.freebsd.org> From: Mark Johnston Date: Wed, 26 Feb 2014 01:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262508 - head/sys/cddl/dev/systrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 01:00:01 -0000 Author: markj Date: Wed Feb 26 01:00:00 2014 New Revision: 262508 URL: http://svnweb.freebsd.org/changeset/base/262508 Log: Revert r262466, as it does not compile on PowerPC. Reported by: jhibbits Modified: head/sys/cddl/dev/systrace/systrace.c Modified: head/sys/cddl/dev/systrace/systrace.c ============================================================================== --- head/sys/cddl/dev/systrace/systrace.c Wed Feb 26 00:54:59 2014 (r262507) +++ head/sys/cddl/dev/systrace/systrace.c Wed Feb 26 01:00:00 2014 (r262508) @@ -168,9 +168,6 @@ static dtrace_pops_t systrace_pops = { static struct cdev *systrace_cdev; static dtrace_provider_id_t systrace_id; -typedef void (*systrace_dtrace_probe)(dtrace_id_t, uintptr_t, uintptr_t, - uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); - #if !defined(LINUX_SYSTRACE) /* * Probe callback function. @@ -214,8 +211,7 @@ systrace_probe(u_int32_t id, int sysnum, } /* Process the probe using the converted argments. */ - ((systrace_dtrace_probe)(dtrace_probe))(id, uargs[0], uargs[1], - uargs[2], uargs[3], uargs[4], uargs[5], uargs[6], uargs[7]); + dtrace_probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4]); } #endif From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 01:06:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9ED4ADD; Wed, 26 Feb 2014 01:06:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A31F10FE; Wed, 26 Feb 2014 01:06:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1Q16fTY014391; Wed, 26 Feb 2014 01:06:41 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1Q16fxZ014390; Wed, 26 Feb 2014 01:06:41 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201402260106.s1Q16fxZ014390@svn.freebsd.org> From: Glen Barber Date: Wed, 26 Feb 2014 01:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262509 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 01:06:41 -0000 Author: gjb Date: Wed Feb 26 01:06:41 2014 New Revision: 262509 URL: http://svnweb.freebsd.org/changeset/base/262509 Log: Rework how WORLD_FLAGS and KERNEL_FLAGS are set, to remove an unnecessary expr(1) call. Inspired by: hrs (a few months ago) MFC after: 1 week X-MFC-With: r262499, r262505 Sponsored by: The FreeBSD Foundation Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Wed Feb 26 01:00:00 2014 (r262508) +++ head/release/release.sh Wed Feb 26 01:06:41 2014 (r262509) @@ -64,11 +64,9 @@ SRC_CONF="/dev/null" # The number of make(1) jobs, defaults to the number of CPUs available for # buildworld, and half of number of CPUs available for buildkernel. -NCPU=$(sysctl -n hw.ncpu) -if [ ${NCPU} -gt 1 ]; then - WORLD_FLAGS="-j${NCPU}" - KERNEL_FLAGS="-j$(expr ${NCPU} / 2)" -fi +WORLD_FLAGS="-j$(sysctl -n hw.ncpu)" +KERNEL_FLAGS="-j$(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2))" + MAKE_FLAGS="-s" # The name of the kernel to build, defaults to GENERIC. From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 01:19:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7320E6EE; Wed, 26 Feb 2014 01:19:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5DA9811DB; Wed, 26 Feb 2014 01:19:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1Q1Jr5E019198; Wed, 26 Feb 2014 01:19:53 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1Q1Jr4m019197; Wed, 26 Feb 2014 01:19:53 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201402260119.s1Q1Jr4m019197@svn.freebsd.org> From: Glen Barber Date: Wed, 26 Feb 2014 01:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262513 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 01:19:53 -0000 Author: gjb Date: Wed Feb 26 01:19:52 2014 New Revision: 262513 URL: http://svnweb.freebsd.org/changeset/base/262513 Log: Update release/release.conf.sample to reflect changes in r262509. MFC after: 1 week X-MFC-With: r262509 Sponsored by: The FreeBSD Foundation Modified: head/release/release.conf.sample Modified: head/release/release.conf.sample ============================================================================== --- head/release/release.conf.sample Wed Feb 26 01:16:07 2014 (r262512) +++ head/release/release.conf.sample Wed Feb 26 01:19:52 2014 (r262513) @@ -40,7 +40,7 @@ PORTBRANCH="ports/head@rHEAD" ## Set to use world- and kernel-specific make(1) flags. #WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -#KERNEL_FLAGS="-j $(expr $(sysctl -n hw.ncpu) / 2)" +#KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" ## Set miscellaneous 'make release' settings. #NODOC= From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 01:32:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64E01F15; Wed, 26 Feb 2014 01:32:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3687113AA; Wed, 26 Feb 2014 01:32:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1Q1WSgj026245; Wed, 26 Feb 2014 01:32:28 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1Q1WSuc026244; Wed, 26 Feb 2014 01:32:28 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402260132.s1Q1WSuc026244@svn.freebsd.org> From: Adrian Chadd Date: Wed, 26 Feb 2014 01:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262515 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 01:32:28 -0000 Author: adrian Date: Wed Feb 26 01:32:27 2014 New Revision: 262515 URL: http://svnweb.freebsd.org/changeset/base/262515 Log: Add the DB120 specific hints for the AR8327. Tested: * DB120 Modified: head/sys/mips/conf/DB120.hints Modified: head/sys/mips/conf/DB120.hints ============================================================================== --- head/sys/mips/conf/DB120.hints Wed Feb 26 01:32:06 2014 (r262514) +++ head/sys/mips/conf/DB120.hints Wed Feb 26 01:32:27 2014 (r262515) @@ -21,30 +21,32 @@ hint.arswitch.0.numphys=5 hint.arswitch.0.phy4cpu=0 hint.arswitch.0.is_rgmii=1 hint.arswitch.0.is_gmii=0 -# XXX other AR8327 configuration parameters -# pad0 cfg: -# .mode = AR8327_PAD_MAC_RGMII, -# .txclk_delay_en = true, -# .rxclk_delay_en = true, -# .txclk_delay_sel = AR8327_CLK_DELAY_SEL1, -# .rxclk_delay_sel = AR8327_CLK_DELAY_SEL2, - -# .led_ctrl0 = 0x00000000, -# .led_ctrl1 = 0xc737c737, -# .led_ctrl2 = 0x00000000, -# .led_ctrl3 = 0x00c30c00, -# .open_drain = true, - -# .port0_cfg = { -# .force_link = 1, -# .speed = AR8327_PORT_SPEED_1000, -# .duplex = 1, -# .txpause = 1, -# .rxpause = 1, -# }, +# Other AR8327 configuration parameters -# port6 cfg? +# AR8327_PAD_MAC_RGMII +hint.arswitch.0.pad.0.mode=6 +hint.arswitch.0.pad.0.txclk_delay_en=1 +hint.arswitch.0.pad.0.rxclk_delay_en=1 +# AR8327_CLK_DELAY_SEL1 +hint.arswitch.0.pad.0.txclk_delay_sel=1 +# AR8327_CLK_DELAY_SEL2 +hint.arswitch.0.pad.0.rxclk_delay_sel=2 + +# XXX there's no LED management just yet! +hint.arswitch.0.led.ctrl0=0x00000000 +hint.arswitch.0.led.ctrl1=0xc737c737 +hint.arswitch.0.led.ctrl2=0x00000000 +hint.arswitch.0.led.ctrl3=0x00c30c00 +hint.arswitch.0.led.open_drain=1 + +# force_link=1 is required for the rest of the parameters +# to be configured. +hint.arswitch.0.port.0.force_link=1 +hint.arswitch.0.port.0.speed=1000 +hint.arswitch.0.port.0.duplex=1 +hint.arswitch.0.port.0.txpause=1 +hint.arswitch.0.port.0.rxpause=1 # XXX OpenWRT DB120 BSP doesn't have media/duplex set? hint.arge.0.phymask=0x0 From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 01:32:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BD7DE11; Wed, 26 Feb 2014 01:32:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 69CBA13A4; Wed, 26 Feb 2014 01:32:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1Q1W7aH026169; Wed, 26 Feb 2014 01:32:07 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1Q1W7mf026168; Wed, 26 Feb 2014 01:32:07 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402260132.s1Q1W7mf026168@svn.freebsd.org> From: Adrian Chadd Date: Wed, 26 Feb 2014 01:32:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262514 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 01:32:07 -0000 Author: adrian Date: Wed Feb 26 01:32:06 2014 New Revision: 262514 URL: http://svnweb.freebsd.org/changeset/base/262514 Log: Undo the DB120 hard-coded values in the AR8327 code and fetch it from the hints environment. Tested: * DB120 Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Wed Feb 26 01:19:52 2014 (r262513) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Wed Feb 26 01:32:06 2014 (r262514) @@ -217,6 +217,196 @@ ar8327_get_port_init_status(struct ar832 } /* + * Fetch the port data for the given port. + * + * This goes and does dirty things with the hints space + * to determine what the configuration parameters should be. + * + * Returns 1 if the structure was successfully parsed and + * the contents are valid; 0 otherwise. + */ +static int +ar8327_fetch_pdata_port(struct arswitch_softc *sc, + struct ar8327_port_cfg *pcfg, + int port) +{ + int val; + char sbuf[128]; + + /* Check if force_link exists */ + val = 0; + snprintf(sbuf, 128, "port.%d.force_link", port); + (void) resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + sbuf, &val); + if (val != 1) + return (0); + pcfg->force_link = 1; + + /* force_link is set; let's parse the rest of the fields */ + snprintf(sbuf, 128, "port.%d.speed", port); + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + sbuf, &val) == 0) { + switch (val) { + case 10: + pcfg->speed = AR8327_PORT_SPEED_10; + break; + case 100: + pcfg->speed = AR8327_PORT_SPEED_100; + break; + case 1000: + pcfg->speed = AR8327_PORT_SPEED_1000; + break; + default: + device_printf(sc->sc_dev, + "%s: invalid port %d duplex value (%d)\n", + __func__, + port, + val); + return (0); + } + } + + snprintf(sbuf, 128, "port.%d.duplex", port); + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + sbuf, &val) == 0) + pcfg->duplex = val; + + snprintf(sbuf, 128, "port.%d.txpause", port); + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + sbuf, &val) == 0) + pcfg->txpause = val; + + snprintf(sbuf, 128, "port.%d.rxpause", port); + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + sbuf, &val) == 0) + pcfg->rxpause = val; + +#if 0 + device_printf(sc->sc_dev, + "%s: port %d: speed=%d, duplex=%d, txpause=%d, rxpause=%d\n", + __func__, + port, + pcfg->speed, + pcfg->duplex, + pcfg->txpause, + pcfg->rxpause); +#endif + + return (1); +} + +/* + * Parse the pad configuration from the boot hints. + * + * The (mostly optional) fields are: + * + * uint32_t mode; + * uint32_t rxclk_sel; + * uint32_t txclk_sel; + * uint32_t txclk_delay_sel; + * uint32_t rxclk_delay_sel; + * uint32_t txclk_delay_en; + * uint32_t rxclk_delay_en; + * uint32_t sgmii_delay_en; + * uint32_t pipe_rxclk_sel; + * + * If mode isn't in the hints, 0 is returned. + * Else the structure is fleshed out and 1 is returned. + */ +static int +ar8327_fetch_pdata_pad(struct arswitch_softc *sc, + struct ar8327_pad_cfg *pc, + int pad) +{ + int val; + char sbuf[128]; + + /* Check if mode exists */ + val = 0; + snprintf(sbuf, 128, "pad.%d.mode", pad); + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + sbuf, &val) != 0) + return (0); + + /* assume that 'mode' exists and was found */ + pc->mode = val; + + snprintf(sbuf, 128, "pad.%d.rxclk_sel", pad); + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + sbuf, &val) == 0) + pc->rxclk_sel = val; + + snprintf(sbuf, 128, "pad.%d.txclk_sel", pad); + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + sbuf, &val) == 0) + pc->txclk_sel = val; + + snprintf(sbuf, 128, "pad.%d.txclk_delay_sel", pad); + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + sbuf, &val) == 0) + pc->txclk_delay_sel = val; + + snprintf(sbuf, 128, "pad.%d.rxclk_delay_sel", pad); + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + sbuf, &val) == 0) + pc->rxclk_delay_sel = val; + + snprintf(sbuf, 128, "pad.%d.txclk_delay_en", pad); + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + sbuf, &val) == 0) + pc->txclk_delay_en = val; + + snprintf(sbuf, 128, "pad.%d.rxclk_delay_en", pad); + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + sbuf, &val) == 0) + pc->rxclk_delay_en = val; + + snprintf(sbuf, 128, "pad.%d.sgmii_delay_en", pad); + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + sbuf, &val) == 0) + pc->sgmii_delay_en = val; + + snprintf(sbuf, 128, "pad.%d.pipe_rxclk_sel", pad); + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + sbuf, &val) == 0) + pc->pipe_rxclk_sel = val; + +#if 0 + device_printf(sc->sc_dev, + "%s: pad %d: mode=%d, rxclk_sel=%d, txclk_sel=%d, " + "txclk_delay_sel=%d, rxclk_delay_sel=%d, txclk_delay_en=%d, " + "rxclk_enable_en=%d, sgmii_delay_en=%d, pipe_rxclk_sel=%d\n", + __func__, + pad, + pc->mode, + pc->rxclk_sel, + pc->txclk_sel, + pc->txclk_delay_sel, + pc->rxclk_delay_sel, + pc->txclk_delay_en, + pc->rxclk_delay_en, + pc->sgmii_delay_en, + pc->pipe_rxclk_sel); +#endif + + return (1); +} + +/* * Initialise the ar8327 specific hardware features from * the hints provided in the boot environment. */ @@ -227,44 +417,41 @@ ar8327_init_pdata(struct arswitch_softc struct ar8327_port_cfg port_cfg; uint32_t t; - /* XXX hard-coded DB120 defaults for now! */ - - /* Port 0 - rgmii; 1000/full */ + /* Port 0 */ bzero(&port_cfg, sizeof(port_cfg)); - port_cfg.speed = AR8327_PORT_SPEED_1000; - port_cfg.duplex = 1; - port_cfg.rxpause = 1; - port_cfg.txpause = 1; - port_cfg.force_link = 1; - sc->ar8327.port0_status = ar8327_get_port_init_status(&port_cfg); + sc->ar8327.port0_status = 0; + if (ar8327_fetch_pdata_port(sc, &port_cfg, 0)) + sc->ar8327.port0_status = ar8327_get_port_init_status(&port_cfg); - /* Port 6 - ignore */ + /* Port 6 */ bzero(&port_cfg, sizeof(port_cfg)); - sc->ar8327.port6_status = ar8327_get_port_init_status(&port_cfg); + sc->ar8327.port6_status = 0; + if (ar8327_fetch_pdata_port(sc, &port_cfg, 6)) + sc->ar8327.port6_status = ar8327_get_port_init_status(&port_cfg); /* Pad 0 */ bzero(&pc, sizeof(pc)); - pc.mode = AR8327_PAD_MAC_RGMII, - pc.txclk_delay_en = true, - pc.rxclk_delay_en = true, - pc.txclk_delay_sel = AR8327_CLK_DELAY_SEL1, - pc.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2, - - t = ar8327_get_pad_cfg(&pc); + t = 0; + if (ar8327_fetch_pdata_pad(sc, &pc, 0)) + t = ar8327_get_pad_cfg(&pc); #if 0 - if (AR8X16_IS_SWITCH(sc, AR8337)) - t |= AR8337_PAD_MAC06_EXCHANGE_EN; + if (AR8X16_IS_SWITCH(sc, AR8337)) + t |= AR8337_PAD_MAC06_EXCHANGE_EN; #endif arswitch_writereg(sc->sc_dev, AR8327_REG_PAD0_MODE, t); /* Pad 5 */ bzero(&pc, sizeof(pc)); - t = ar8327_get_pad_cfg(&pc); + t = 0; + if (ar8327_fetch_pdata_pad(sc, &pc, 5)) + t = ar8327_get_pad_cfg(&pc); arswitch_writereg(sc->sc_dev, AR8327_REG_PAD5_MODE, t); /* Pad 6 */ bzero(&pc, sizeof(pc)); - t = ar8327_get_pad_cfg(&pc); + t = 0; + if (ar8327_fetch_pdata_pad(sc, &pc, 6)) + t = ar8327_get_pad_cfg(&pc); arswitch_writereg(sc->sc_dev, AR8327_REG_PAD6_MODE, t); /* XXX LED config */ From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 01:35:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 131B827D; Wed, 26 Feb 2014 01:35:58 +0000 (UTC) Received: from mail-ig0-x22c.google.com (mail-ig0-x22c.google.com [IPv6:2607:f8b0:4001:c05::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D0A01464; Wed, 26 Feb 2014 01:35:57 +0000 (UTC) Received: by mail-ig0-f172.google.com with SMTP id h3so8937493igd.5 for ; Tue, 25 Feb 2014 17:35:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=mN3BJeLNM8+YOX2Pf7DSEi1JUtejn6sPkLdqP6j0Yag=; b=AOa5RNNIk63x5sP9sopEBz8rfL0jjc58wRJvLoS5MJGqaWggj+77t70TiBmA2kfnz/ TkOK+ubGpMdZ1z7UoJGk9eWPId9SCvPvIMIZYQeNjauRo69wYZ3yc8NQrEiavo+Vesrd ZFI+JHKOr/nc0kuuEJjcsla1PYNKpohHTtlIRgPGYWVzaMofhvtStr+KtmtoMSKET/bj wAZvTKoXab0tBEW9RayF38erphKyHK3RAwamS6WhciIMEjuOEl+sIy28yFpVcr2/AA1F Czgrmd7k3kdOpj/BKSbr/S1I5EDcpJz9S8Ysy8RZUp/2MI2pFt3lccOjvx6m8fviiJLr 4NcA== X-Received: by 10.42.129.9 with SMTP id o9mr3029768ics.38.1393378556936; Tue, 25 Feb 2014 17:35:56 -0800 (PST) Received: from raichu (198-84-185-216.cpe.teksavvy.com. [198.84.185.216]) by mx.google.com with ESMTPSA id gd5sm778738igd.5.2014.02.25.17.35.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Feb 2014 17:35:56 -0800 (PST) Sender: Mark Johnston Date: Tue, 25 Feb 2014 20:35:50 -0500 From: Mark Johnston To: Justin Hibbits Subject: Re: svn commit: r262466 - head/sys/cddl/dev/systrace Message-ID: <20140226013550.GA16841@raichu> References: <201402250258.s1P2wCDd060659@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 01:35:58 -0000 On Tue, Feb 25, 2014 at 03:17:56PM -0800, Justin Hibbits wrote: > I think this broke powerpc building. I see the following build failure: > > cc1: warnings being treated as errors > /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c: > In function 'systrace_probe': > /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c:218: > warning: function called through a non-compatible type > /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c:218: > note: if this code is reached, the program will abort > Hi Justin, Sorry about this. I've reverted the commit. I realize that the change introduced undefined behaviour, but a similar trick is used elsewhere in the DTrace code to pass extra arguments at a probe site. Calling dtrace_probe() through a function pointer (patch below) makes the warning go away, but I don't really understand why. clang doesn't emit warnings in either case. Thanks, -Mark diff --git a/sys/cddl/dev/systrace/systrace.c b/sys/cddl/dev/systrace/systrace.c index 83f0793..5f4b82f 100644 --- a/sys/cddl/dev/systrace/systrace.c +++ b/sys/cddl/dev/systrace/systrace.c @@ -168,8 +168,8 @@ static dtrace_pops_t systrace_pops = { static struct cdev *systrace_cdev; static dtrace_provider_id_t systrace_id; -typedef void (*systrace_dtrace_probe)(dtrace_id_t, uintptr_t, uintptr_t, - uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); +typedef void (*systrace_probe_t)(dtrace_id_t, uintptr_t, uintptr_t, uintptr_t, + uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); #if !defined(LINUX_SYSTRACE) /* @@ -214,8 +214,9 @@ systrace_probe(u_int32_t id, int sysnum, struct sysent *sysent, void *params, } /* Process the probe using the converted argments. */ - ((systrace_dtrace_probe)(dtrace_probe))(id, uargs[0], uargs[1], - uargs[2], uargs[3], uargs[4], uargs[5], uargs[6], uargs[7]); + systrace_probe_t probe = (systrace_probe_t)dtrace_probe; + probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4], + uargs[5], uargs[6], uargs[7]); } #endif From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 01:46:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1705B26; Wed, 26 Feb 2014 01:46:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 81B1515DA; Wed, 26 Feb 2014 01:46:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1Q1kgnc030714; Wed, 26 Feb 2014 01:46:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1Q1kg7V030713; Wed, 26 Feb 2014 01:46:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402260146.s1Q1kg7V030713@svn.freebsd.org> From: Adrian Chadd Date: Wed, 26 Feb 2014 01:46:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262517 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 01:46:42 -0000 Author: adrian Date: Wed Feb 26 01:46:42 2014 New Revision: 262517 URL: http://svnweb.freebsd.org/changeset/base/262517 Log: Add in the SGMII configuration code. The DB120 doesn't use it, so I have no way to evaluate it. Obtained from: OpenWRT Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Wed Feb 26 01:36:02 2014 (r262516) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Wed Feb 26 01:46:42 2014 (r262517) @@ -407,6 +407,34 @@ ar8327_fetch_pdata_pad(struct arswitch_s } /* + * Fetch the SGMII configuration block from the boot hints. + */ +static int +ar8327_fetch_pdata_sgmii(struct arswitch_softc *sc, + struct ar8327_sgmii_cfg *scfg) +{ + int val; + + /* sgmii_ctrl */ + val = 0; + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + "sgmii.ctrl", &val) != 0) + return (0); + scfg->sgmii_ctrl = val; + + /* serdes_aen */ + val = 0; + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + "sgmii.serdes_aen", &val) != 0) + return (0); + scfg->serdes_aen = val; + + return (1); +} + +/* * Initialise the ar8327 specific hardware features from * the hints provided in the boot environment. */ @@ -415,7 +443,8 @@ ar8327_init_pdata(struct arswitch_softc { struct ar8327_pad_cfg pc; struct ar8327_port_cfg port_cfg; - uint32_t t; + struct ar8327_sgmii_cfg scfg; + uint32_t t, new_pos, pos; /* Port 0 */ bzero(&port_cfg, sizeof(port_cfg)); @@ -454,9 +483,33 @@ ar8327_init_pdata(struct arswitch_softc t = ar8327_get_pad_cfg(&pc); arswitch_writereg(sc->sc_dev, AR8327_REG_PAD6_MODE, t); + pos = arswitch_readreg(sc->sc_dev, AR8327_REG_POWER_ON_STRIP); + new_pos = pos; + /* XXX LED config */ - /* XXX SGMII config */ + /* SGMII config */ + bzero(&scfg, sizeof(scfg)); + if (ar8327_fetch_pdata_sgmii(sc, &scfg)) { + t = scfg.sgmii_ctrl; + if (sc->chip_rev == 1) + t |= AR8327_SGMII_CTRL_EN_PLL | + AR8327_SGMII_CTRL_EN_RX | + AR8327_SGMII_CTRL_EN_TX; + else + t &= ~(AR8327_SGMII_CTRL_EN_PLL | + AR8327_SGMII_CTRL_EN_RX | + AR8327_SGMII_CTRL_EN_TX); + + arswitch_writereg(sc->sc_dev, AR8327_REG_SGMII_CTRL, t); + + if (scfg.serdes_aen) + new_pos &= ~AR8327_POWER_ON_STRIP_SERDES_AEN; + else + new_pos |= AR8327_POWER_ON_STRIP_SERDES_AEN; + } + + arswitch_writereg(sc->sc_dev, AR8327_REG_POWER_ON_STRIP, new_pos); return (0); } From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 02:00:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB3EF73C; Wed, 26 Feb 2014 02:00:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ACC5E18ED; Wed, 26 Feb 2014 02:00:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1Q20bL2035252; Wed, 26 Feb 2014 02:00:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1Q20bMB035251; Wed, 26 Feb 2014 02:00:37 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201402260200.s1Q20bMB035251@svn.freebsd.org> From: Adrian Chadd Date: Wed, 26 Feb 2014 02:00:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262519 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 02:00:37 -0000 Author: adrian Date: Wed Feb 26 02:00:37 2014 New Revision: 262519 URL: http://svnweb.freebsd.org/changeset/base/262519 Log: Add LED setup support for the AR8327. Tested: * DB120 Obtained from: OpenWRT Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Wed Feb 26 01:57:55 2014 (r262518) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Wed Feb 26 02:00:37 2014 (r262519) @@ -435,6 +435,53 @@ ar8327_fetch_pdata_sgmii(struct arswitch } /* + * Fetch the LED configuration from the boot hints. + */ +static int +ar8327_fetch_pdata_led(struct arswitch_softc *sc, + struct ar8327_led_cfg *lcfg) +{ + int val; + + val = 0; + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + "led.ctrl0", &val) != 0) + return (0); + lcfg->led_ctrl0 = val; + + val = 0; + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + "led.ctrl1", &val) != 0) + return (0); + lcfg->led_ctrl1 = val; + + val = 0; + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + "led.ctrl2", &val) != 0) + return (0); + lcfg->led_ctrl2 = val; + + val = 0; + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + "led.ctrl3", &val) != 0) + return (0); + lcfg->led_ctrl3 = val; + + val = 0; + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), + "led.open_drain", &val) != 0) + return (0); + lcfg->open_drain = val; + + return (1); +} + +/* * Initialise the ar8327 specific hardware features from * the hints provided in the boot environment. */ @@ -444,6 +491,7 @@ ar8327_init_pdata(struct arswitch_softc struct ar8327_pad_cfg pc; struct ar8327_port_cfg port_cfg; struct ar8327_sgmii_cfg scfg; + struct ar8327_led_cfg lcfg; uint32_t t, new_pos, pos; /* Port 0 */ @@ -487,6 +535,25 @@ ar8327_init_pdata(struct arswitch_softc new_pos = pos; /* XXX LED config */ + bzero(&lcfg, sizeof(lcfg)); + if (ar8327_fetch_pdata_led(sc, &lcfg)) { + if (lcfg.open_drain) + new_pos |= AR8327_POWER_ON_STRIP_LED_OPEN_EN; + else + new_pos &= ~AR8327_POWER_ON_STRIP_LED_OPEN_EN; + + arswitch_writereg(sc->sc_dev, AR8327_REG_LED_CTRL0, + lcfg.led_ctrl0); + arswitch_writereg(sc->sc_dev, AR8327_REG_LED_CTRL1, + lcfg.led_ctrl1); + arswitch_writereg(sc->sc_dev, AR8327_REG_LED_CTRL2, + lcfg.led_ctrl2); + arswitch_writereg(sc->sc_dev, AR8327_REG_LED_CTRL3, + lcfg.led_ctrl3); + + if (new_pos != pos) + new_pos |= AR8327_POWER_ON_STRIP_POWER_ON_SEL; + } /* SGMII config */ bzero(&scfg, sizeof(scfg)); From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 03:26:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1087733; Wed, 26 Feb 2014 03:26:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BDF031345; Wed, 26 Feb 2014 03:26:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1Q3Q0UQ072697; Wed, 26 Feb 2014 03:26:00 GMT (envelope-from lwhsu@svn.freebsd.org) Received: (from lwhsu@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1Q3Q0fO072696; Wed, 26 Feb 2014 03:26:00 GMT (envelope-from lwhsu@svn.freebsd.org) Message-Id: <201402260326.s1Q3Q0fO072696@svn.freebsd.org> From: Li-Wen Hsu Date: Wed, 26 Feb 2014 03:26:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262522 - head/sys/modules/i2c/iicbb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 03:26:00 -0000 Author: lwhsu (ports committer) Date: Wed Feb 26 03:26:00 2014 New Revision: 262522 URL: http://svnweb.freebsd.org/changeset/base/262522 Log: Fix make depend. Approved by: uqs Modified: head/sys/modules/i2c/iicbb/Makefile Modified: head/sys/modules/i2c/iicbb/Makefile ============================================================================== --- head/sys/modules/i2c/iicbb/Makefile Wed Feb 26 02:36:59 2014 (r262521) +++ head/sys/modules/i2c/iicbb/Makefile Wed Feb 26 03:26:00 2014 (r262522) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../../dev/iicbus KMOD = iicbb SRCS = device_if.h bus_if.h iicbus_if.h \ - iicbb_if.h iicbb_if.c iicbb.c + iicbb_if.h iicbb_if.c iicbb.c opt_platform.h .include From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 02:37:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65A11E1A; Wed, 26 Feb 2014 02:37:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4EF211DEF; Wed, 26 Feb 2014 02:37:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1Q2b23t051438; Wed, 26 Feb 2014 02:37:02 GMT (envelope-from jasone@svn.freebsd.org) Received: (from jasone@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1Q2b026051410; Wed, 26 Feb 2014 02:37:00 GMT (envelope-from jasone@svn.freebsd.org) Message-Id: <201402260237.s1Q2b026051410@svn.freebsd.org> From: Jason Evans Date: Wed, 26 Feb 2014 02:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262521 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 02:37:02 -0000 Author: jasone Date: Wed Feb 26 02:36:59 2014 New Revision: 262521 URL: http://svnweb.freebsd.org/changeset/base/262521 Log: Update jemalloc to version 3.5.1. Modified: head/contrib/jemalloc/ChangeLog head/contrib/jemalloc/FREEBSD-Xlist head/contrib/jemalloc/VERSION head/contrib/jemalloc/doc/jemalloc.3 head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_macros.h head/contrib/jemalloc/include/jemalloc/internal/prof.h head/contrib/jemalloc/include/jemalloc/jemalloc.h head/contrib/jemalloc/src/arena.c head/contrib/jemalloc/src/huge.c Modified: head/contrib/jemalloc/ChangeLog ============================================================================== --- head/contrib/jemalloc/ChangeLog Wed Feb 26 02:02:51 2014 (r262520) +++ head/contrib/jemalloc/ChangeLog Wed Feb 26 02:36:59 2014 (r262521) @@ -3,8 +3,26 @@ bug fixes are all mentioned, but interna brevity (even though they are more fun to write about). Much more detail can be found in the git revision history: - http://www.canonware.com/cgi-bin/gitweb.cgi?p=jemalloc.git - git://canonware.com/jemalloc.git + https://github.com/jemalloc/jemalloc + +* 3.5.1 (February 25, 2014) + + This version primarily addresses minor bugs in test code. + + Bug fixes: + - Configure Solaris/Illumos to use MADV_FREE. + - Fix junk filling for mremap(2)-based huge reallocation. This is only + relevant if configuring with the --enable-mremap option specified. + - Avoid compilation failure if 'restrict' C99 keyword is not supported by the + compiler. + - Add a configure test for SSE2 rather than assuming it is usable on i686 + systems. This fixes test compilation errors, especially on 32-bit Linux + systems. + - Fix mallctl argument size mismatches (size_t vs. uint64_t) in the stats unit + test. + - Fix/remove flawed alignment-related overflow tests. + - Prevent compiler optimizations that could change backtraces in the + prof_accum unit test. * 3.5.0 (January 22, 2014) @@ -16,7 +34,7 @@ found in the git revision history: API. The *allocx() functions are slightly simpler to use because they have fewer parameters, they directly return the results of primary interest, and mallocx()/rallocx() avoid the strict aliasing pitfall that - allocm()/rallocx() share with posix_memalign(). Note that *allocm() is + allocm()/rallocm() share with posix_memalign(). Note that *allocm() is slated for removal in the next non-bugfix release. - Add support for LinuxThreads. Modified: head/contrib/jemalloc/FREEBSD-Xlist ============================================================================== --- head/contrib/jemalloc/FREEBSD-Xlist Wed Feb 26 02:02:51 2014 (r262520) +++ head/contrib/jemalloc/FREEBSD-Xlist Wed Feb 26 02:36:59 2014 (r262521) @@ -28,6 +28,7 @@ include/jemalloc/internal/public_unnames include/jemalloc/internal/size_classes.sh include/jemalloc/jemalloc.h.in include/jemalloc/jemalloc.sh +include/jemalloc/jemalloc_defs.h include/jemalloc/jemalloc_defs.h.in include/jemalloc/jemalloc_macros.h include/jemalloc/jemalloc_macros.h.in Modified: head/contrib/jemalloc/VERSION ============================================================================== --- head/contrib/jemalloc/VERSION Wed Feb 26 02:02:51 2014 (r262520) +++ head/contrib/jemalloc/VERSION Wed Feb 26 02:36:59 2014 (r262521) @@ -1 +1 @@ -3.5.0-0-gcc47dde16203a6ae7eb685b53e1ae501f3869bc6 +3.5.1-0-g7709a64c59daf0b1f938be49472fcc499e1bd136 Modified: head/contrib/jemalloc/doc/jemalloc.3 ============================================================================== --- head/contrib/jemalloc/doc/jemalloc.3 Wed Feb 26 02:02:51 2014 (r262520) +++ head/contrib/jemalloc/doc/jemalloc.3 Wed Feb 26 02:36:59 2014 (r262521) @@ -2,12 +2,12 @@ .\" Title: JEMALLOC .\" Author: Jason Evans .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 01/22/2014 +.\" Date: 02/25/2014 .\" Manual: User Manual -.\" Source: jemalloc 3.5.0-0-gcc47dde16203a6ae7eb685b53e1ae501f3869bc6 +.\" Source: jemalloc 3.5.1-0-g7709a64c59daf0b1f938be49472fcc499e1bd136 .\" Language: English .\" -.TH "JEMALLOC" "3" "01/22/2014" "jemalloc 3.5.0-0-gcc47dde16203" "User Manual" +.TH "JEMALLOC" "3" "02/25/2014" "jemalloc 3.5.1-0-g7709a64c59da" "User Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -31,7 +31,7 @@ jemalloc \- general purpose memory allocation functions .SH "LIBRARY" .PP -This manual describes jemalloc 3\&.5\&.0\-0\-gcc47dde16203a6ae7eb685b53e1ae501f3869bc6\&. More information can be found at the +This manual describes jemalloc 3\&.5\&.1\-0\-g7709a64c59daf0b1f938be49472fcc499e1bd136\&. More information can be found at the \m[blue]\fBjemalloc website\fR\m[]\&\s-2\u[1]\d\s+2\&. .PP The following configuration options are enabled in libc\*(Aqs built\-in jemalloc: Modified: head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h Wed Feb 26 02:02:51 2014 (r262520) +++ head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h Wed Feb 26 02:36:59 2014 (r262521) @@ -188,6 +188,9 @@ */ /* #undef JEMALLOC_HAS_ALLOCA_H */ +/* C99 restrict keyword supported. */ +#define JEMALLOC_HAS_RESTRICT 1 + /* sizeof(int) == 2^LG_SIZEOF_INT. */ #define LG_SIZEOF_INT 2 Modified: head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_macros.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_macros.h Wed Feb 26 02:02:51 2014 (r262520) +++ head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_macros.h Wed Feb 26 02:36:59 2014 (r262521) @@ -45,3 +45,7 @@ #ifndef __DECONST # define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var)) #endif + +#ifndef JEMALLOC_HAS_RESTRICT +# define restrict +#endif Modified: head/contrib/jemalloc/include/jemalloc/internal/prof.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/prof.h Wed Feb 26 02:02:51 2014 (r262520) +++ head/contrib/jemalloc/include/jemalloc/internal/prof.h Wed Feb 26 02:36:59 2014 (r262521) @@ -8,7 +8,11 @@ typedef struct prof_ctx_s prof_ctx_t; typedef struct prof_tdata_s prof_tdata_t; /* Option defaults. */ -#define PROF_PREFIX_DEFAULT "jeprof" +#ifdef JEMALLOC_PROF +# define PROF_PREFIX_DEFAULT "jeprof" +#else +# define PROF_PREFIX_DEFAULT "" +#endif #define LG_PROF_SAMPLE_DEFAULT 19 #define LG_PROF_INTERVAL_DEFAULT -1 Modified: head/contrib/jemalloc/include/jemalloc/jemalloc.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/jemalloc.h Wed Feb 26 02:02:51 2014 (r262520) +++ head/contrib/jemalloc/include/jemalloc/jemalloc.h Wed Feb 26 02:36:59 2014 (r262521) @@ -67,12 +67,12 @@ extern "C" { #include #include -#define JEMALLOC_VERSION "3.5.0-0-gcc47dde16203a6ae7eb685b53e1ae501f3869bc6" +#define JEMALLOC_VERSION "3.5.1-0-g7709a64c59daf0b1f938be49472fcc499e1bd136" #define JEMALLOC_VERSION_MAJOR 3 #define JEMALLOC_VERSION_MINOR 5 -#define JEMALLOC_VERSION_BUGFIX 0 +#define JEMALLOC_VERSION_BUGFIX 1 #define JEMALLOC_VERSION_NREV 0 -#define JEMALLOC_VERSION_GID "cc47dde16203a6ae7eb685b53e1ae501f3869bc6" +#define JEMALLOC_VERSION_GID "7709a64c59daf0b1f938be49472fcc499e1bd136" # define MALLOCX_LG_ALIGN(la) (la) # if LG_SIZEOF_PTR == 2 Modified: head/contrib/jemalloc/src/arena.c ============================================================================== --- head/contrib/jemalloc/src/arena.c Wed Feb 26 02:02:51 2014 (r262520) +++ head/contrib/jemalloc/src/arena.c Wed Feb 26 02:36:59 2014 (r262521) @@ -2476,7 +2476,6 @@ bin_info_run_size_calc(arena_bin_info_t bin_info->reg_interval) - pad_size; } while (try_hdr_size > try_redzone0_offset); } while (try_run_size <= arena_maxclass - && try_run_size <= arena_maxclass && RUN_MAX_OVRHD * (bin_info->reg_interval << 3) > RUN_MAX_OVRHD_RELAX && (try_redzone0_offset << RUN_BFP) > RUN_MAX_OVRHD * try_run_size Modified: head/contrib/jemalloc/src/huge.c ============================================================================== --- head/contrib/jemalloc/src/huge.c Wed Feb 26 02:02:51 2014 (r262520) +++ head/contrib/jemalloc/src/huge.c Wed Feb 26 02:36:59 2014 (r262521) @@ -171,6 +171,16 @@ huge_ralloc(void *ptr, size_t oldsize, s abort(); memcpy(ret, ptr, copysize); chunk_dealloc_mmap(ptr, oldsize); + } else if (config_fill && zero == false && opt_junk && oldsize + < newsize) { + /* + * mremap(2) clobbers the original mapping, so + * junk/zero filling is not preserved. There is no + * need to zero fill here, since any trailing + * uninititialized memory is demand-zeroed by the + * kernel, but junk filling must be redone. + */ + memset(ret + oldsize, 0xa5, newsize - oldsize); } } else #endif From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 04:49:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9883A1FE; Wed, 26 Feb 2014 04:49:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 849DF18E9; Wed, 26 Feb 2014 04:49:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1Q4n9FH006976; Wed, 26 Feb 2014 04:49:09 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1Q4n9G8006975; Wed, 26 Feb 2014 04:49:09 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201402260449.s1Q4n9G8006975@svn.freebsd.org> From: Peter Grehan Date: Wed, 26 Feb 2014 04:49:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262523 - head/sys/boot/userboot/userboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 04:49:09 -0000 Author: grehan Date: Wed Feb 26 04:49:09 2014 New Revision: 262523 URL: http://svnweb.freebsd.org/changeset/base/262523 Log: Change the MK_ZFS != "no" case slightly to avoid a name clash with LIBZFS in bsd.lib.mk Submitted by: Max N Boyarov zotrix at bsd dot by OK'd by: sbruno Modified: head/sys/boot/userboot/userboot/Makefile Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Wed Feb 26 03:26:00 2014 (r262522) +++ head/sys/boot/userboot/userboot/Makefile Wed Feb 26 04:49:09 2014 (r262523) @@ -53,9 +53,7 @@ LIBSTAND= ${.OBJDIR}/../libstand/libstan .if ${MK_ZFS} != "no" CFLAGS+= -DUSERBOOT_ZFS_SUPPORT -LIBZFS= ${.OBJDIR}/../zfs/libzfsboot.a -DPADD= ${LIBZFS} -LDADD= ${LIBZFS} +LIBZFSBOOT= ${.OBJDIR}/../zfs/libzfsboot.a .endif # Always add MI sources @@ -63,7 +61,7 @@ LDADD= ${LIBZFS} .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -DPADD+= ${LIBFICL} ${LIBSTAND} -LDADD+= ${LIBFICL} ${LIBSTAND} +DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSTAND} +LDADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSTAND} .include From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 09:06:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A74476D; Wed, 26 Feb 2014 09:06:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 65D841D5D; Wed, 26 Feb 2014 09:06:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1Q96wbg014704; Wed, 26 Feb 2014 09:06:58 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1Q96wYY014703; Wed, 26 Feb 2014 09:06:58 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201402260906.s1Q96wYY014703@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 26 Feb 2014 09:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262525 - head/usr.bin/iscsictl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 09:06:58 -0000 Author: trasz Date: Wed Feb 26 09:06:57 2014 New Revision: 262525 URL: http://svnweb.freebsd.org/changeset/base/262525 Log: There is no need to prevent iscsictl from adding iSER session when there is no iSER support in ctld and/or kernel; should the user make that mistake, the output from "iscsictl -L" is enough to determine what the problem is. Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/iscsictl/iscsictl.c Modified: head/usr.bin/iscsictl/iscsictl.c ============================================================================== --- head/usr.bin/iscsictl/iscsictl.c Wed Feb 26 06:25:36 2014 (r262524) +++ head/usr.bin/iscsictl/iscsictl.c Wed Feb 26 09:06:57 2014 (r262525) @@ -242,11 +242,6 @@ conf_verify(struct conf *conf) } if (targ->t_protocol == PROTOCOL_UNSPECIFIED) targ->t_protocol = PROTOCOL_ISCSI; -#ifndef ICL_KERNEL_PROXY - if (targ->t_protocol == PROTOCOL_ISER) - errx(1, "iSER support requires ICL_KERNEL_PROXY; " - "see iscsi(4) for details"); -#endif if (targ->t_address == NULL) errx(1, "missing TargetAddress for target \"%s\"", targ->t_nickname); From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 09:08:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D7E4800; Wed, 26 Feb 2014 09:08:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 08BCD1D6E; Wed, 26 Feb 2014 09:08:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1Q98PFK014923; Wed, 26 Feb 2014 09:08:25 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1Q98P9d014921; Wed, 26 Feb 2014 09:08:25 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201402260908.s1Q98P9d014921@svn.freebsd.org> From: Peter Holm Date: Wed, 26 Feb 2014 09:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262526 - head/tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 09:08:26 -0000 Author: pho Date: Wed Feb 26 09:08:25 2014 New Revision: 262526 URL: http://svnweb.freebsd.org/changeset/base/262526 Log: Added a regression test for r234131. Discussed with: asomers Sponsored by: EMC / Isilon storage division Added: head/tests/sys/kern/kern_descrip_test.c (contents, props changed) Modified: head/tests/sys/kern/Makefile Modified: head/tests/sys/kern/Makefile ============================================================================== --- head/tests/sys/kern/Makefile Wed Feb 26 09:06:57 2014 (r262525) +++ head/tests/sys/kern/Makefile Wed Feb 26 09:08:25 2014 (r262526) @@ -2,7 +2,8 @@ TESTSDIR= ${TESTSBASE}/sys/kern -ATF_TESTS_C= unix_seqpacket_test +ATF_TESTS_C+= kern_descrip_test +ATF_TESTS_C+= unix_seqpacket_test TEST_METADATA.unix_seqpacket_test+= timeout="15" LDADD+= -lpthread Added: head/tests/sys/kern/kern_descrip_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/kern/kern_descrip_test.c Wed Feb 26 09:08:25 2014 (r262526) @@ -0,0 +1,80 @@ +/*- + * Copyright (c) 2013 EMC Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +ATF_TC_WITHOUT_HEAD(dup2_simple); +ATF_TC_BODY(dup2_simple, tc) +{ + int fd1, fd2; + struct stat sb1, sb2; + + fd1 = open("/etc/passwd", O_RDONLY); + ATF_REQUIRE(fd1 >= 0); + fd2 = 27; + ATF_REQUIRE(dup2(fd1, fd2) != -1); + ATF_REQUIRE(fstat(fd1, &sb1) != -1); + ATF_REQUIRE(fstat(fd2, &sb2) != -1); + ATF_REQUIRE(bcmp(&sb1, &sb2, sizeof(sb1)) == 0); +} + +/* + Regression test for r234131: + Return EBADF instead of EMFILE from dup2 when the second argument is + outside the range of valid file descriptors + */ + +ATF_TC_WITHOUT_HEAD(dup2_r234131); +ATF_TC_BODY(dup2_r234131, tc) +{ + int fd1, fd2, ret; + + fd1 = open("/etc/passwd", O_RDONLY); + fd2 = INT_MAX; + ret = dup2(fd1, fd2); + ATF_CHECK_EQ(-1, ret); + ATF_CHECK_EQ(EBADF, errno); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, dup2_simple); + ATF_TP_ADD_TC(tp, dup2_r234131); + + return atf_no_error(); +} From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 12:19:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9BD49587; Wed, 26 Feb 2014 12:19:38 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id 593B31321; Wed, 26 Feb 2014 12:19:38 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1WIdSa-000Kr4-4l; Wed, 26 Feb 2014 16:19:36 +0400 Date: Wed, 26 Feb 2014 16:19:36 +0400 From: Slawa Olhovchenkov To: Julio Merino Subject: Re: svn commit: r262480 - head/sys/dev/syscons Message-ID: <20140226121936.GA79819@zxy.spb.ru> References: <201402251348.s1PDm5Zp030180@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201402251348.s1PDm5Zp030180@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 12:19:38 -0000 On Tue, Feb 25, 2014 at 01:48:05PM +0000, Julio Merino wrote: > Author: jmmv > Date: Tue Feb 25 13:48:05 2014 > New Revision: 262480 > URL: http://svnweb.freebsd.org/changeset/base/262480 > > Log: > Increase maximum number of columns to support 1980x1200 displays. What about support 4K display? From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 16:10:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 596A6FB5; Wed, 26 Feb 2014 16:10:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 40DCA1988; Wed, 26 Feb 2014 16:10:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1QGA0fI083312; Wed, 26 Feb 2014 16:10:00 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1QG9tjR083240; Wed, 26 Feb 2014 16:09:55 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201402261609.s1QG9tjR083240@svn.freebsd.org> From: Ed Maste Date: Wed, 26 Feb 2014 16:09:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262528 - in head: contrib/llvm/tools/lldb/include/lldb contrib/llvm/tools/lldb/include/lldb/API contrib/llvm/tools/lldb/include/lldb/Breakpoint contrib/llvm/tools/lldb/include/lldb/Cor... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 16:10:00 -0000 Author: emaste Date: Wed Feb 26 16:09:54 2014 New Revision: 262528 URL: http://svnweb.freebsd.org/changeset/base/262528 Log: Update LLDB snapshot to upstream r202189 Highlights include (upstream revs in parens): - Improvements to the remote GDB protocol client (r196610, r197579, r197857, r200072, and others) - Bug fixes for big-endian targets (r196808) - Initial support for libdispatch (GCD) queues in the debuggee (r197190) - Add "step-avoid-libraries" setting (r199943) - IO subsystem improvements (including initial work on a curses gui) (r200263) - Support hardware watchpoints on FreeBSD (r201706) - Improved unwinding through hand-written assembly functions (r201839) - Handle DW_TAG_unspecified_parameters for variadic functions (r202061) - Fix Ctrl+C interrupting a running inferior process (r202086, r202154) - Various bug fixes for memory leaks, LLDB segfaults, the C++ demangler, ELF core files, DWARF debug info, and others. Sponsored by: DARPA, AFRL Added: head/contrib/llvm/tools/lldb/include/lldb/API/SBQueue.h - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/include/lldb/API/SBQueue.h head/contrib/llvm/tools/lldb/include/lldb/API/SBQueueItem.h - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/include/lldb/API/SBQueueItem.h head/contrib/llvm/tools/lldb/include/lldb/Core/IOHandler.h - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/include/lldb/Core/IOHandler.h head/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormattersContainer.h - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormattersContainer.h head/contrib/llvm/tools/lldb/include/lldb/Host/Editline.h - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/include/lldb/Host/Editline.h head/contrib/llvm/tools/lldb/include/lldb/Host/HostGetOpt.h - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/include/lldb/Host/HostGetOpt.h head/contrib/llvm/tools/lldb/include/lldb/Target/Queue.h - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/include/lldb/Target/Queue.h head/contrib/llvm/tools/lldb/include/lldb/Target/QueueItem.h - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/include/lldb/Target/QueueItem.h head/contrib/llvm/tools/lldb/include/lldb/Target/QueueList.h - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/include/lldb/Target/QueueList.h head/contrib/llvm/tools/lldb/include/lldb/Target/SectionLoadHistory.h - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/include/lldb/Target/SectionLoadHistory.h head/contrib/llvm/tools/lldb/source/API/SBQueue.cpp - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/source/API/SBQueue.cpp head/contrib/llvm/tools/lldb/source/API/SBQueueItem.cpp - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/source/API/SBQueueItem.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectGUI.cpp - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/source/Commands/CommandObjectGUI.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectGUI.h - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/source/Commands/CommandObjectGUI.h head/contrib/llvm/tools/lldb/source/Core/IOHandler.cpp - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/source/Core/IOHandler.cpp head/contrib/llvm/tools/lldb/source/Host/common/Editline.cpp - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/source/Host/common/Editline.cpp head/contrib/llvm/tools/lldb/source/Target/Queue.cpp - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/source/Target/Queue.cpp head/contrib/llvm/tools/lldb/source/Target/QueueItem.cpp - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/source/Target/QueueItem.cpp head/contrib/llvm/tools/lldb/source/Target/QueueList.cpp - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/source/Target/QueueList.cpp head/contrib/llvm/tools/lldb/source/Target/SectionLoadHistory.cpp - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/source/Target/SectionLoadHistory.cpp head/contrib/llvm/tools/lldb/tools/lldb-platform/exports - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/tools/lldb-platform/exports Replaced: head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h - copied unchanged from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h Deleted: head/contrib/llvm/tools/lldb/include/lldb/API/SBInputReader.h head/contrib/llvm/tools/lldb/include/lldb/Core/InputReader.h head/contrib/llvm/tools/lldb/include/lldb/Core/InputReaderEZ.h head/contrib/llvm/tools/lldb/include/lldb/Core/InputReaderStack.h head/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatNavigator.h head/contrib/llvm/tools/lldb/source/API/SBInputReader.cpp head/contrib/llvm/tools/lldb/source/Core/InputReader.cpp head/contrib/llvm/tools/lldb/source/Core/InputReaderEZ.cpp head/contrib/llvm/tools/lldb/source/Core/InputReaderStack.cpp head/contrib/llvm/tools/lldb/tools/driver/ELWrapper.cpp head/contrib/llvm/tools/lldb/tools/driver/ELWrapper.h head/contrib/llvm/tools/lldb/tools/driver/GetOptWrapper.cpp head/contrib/llvm/tools/lldb/tools/driver/GetOptWrapper.h head/contrib/llvm/tools/lldb/tools/driver/IOChannel.cpp head/contrib/llvm/tools/lldb/tools/driver/IOChannel.h Modified: head/contrib/llvm/tools/lldb/include/lldb/API/LLDB.h head/contrib/llvm/tools/lldb/include/lldb/API/SBAddress.h head/contrib/llvm/tools/lldb/include/lldb/API/SBCommandInterpreter.h head/contrib/llvm/tools/lldb/include/lldb/API/SBDebugger.h head/contrib/llvm/tools/lldb/include/lldb/API/SBDefines.h head/contrib/llvm/tools/lldb/include/lldb/API/SBError.h head/contrib/llvm/tools/lldb/include/lldb/API/SBModule.h head/contrib/llvm/tools/lldb/include/lldb/API/SBProcess.h head/contrib/llvm/tools/lldb/include/lldb/API/SBTarget.h head/contrib/llvm/tools/lldb/include/lldb/API/SBThread.h head/contrib/llvm/tools/lldb/include/lldb/API/SBType.h head/contrib/llvm/tools/lldb/include/lldb/API/SBTypeFormat.h head/contrib/llvm/tools/lldb/include/lldb/Breakpoint/Breakpoint.h head/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocation.h head/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocationList.h head/contrib/llvm/tools/lldb/include/lldb/Core/ArchSpec.h head/contrib/llvm/tools/lldb/include/lldb/Core/Communication.h head/contrib/llvm/tools/lldb/include/lldb/Core/ConnectionFileDescriptor.h head/contrib/llvm/tools/lldb/include/lldb/Core/Debugger.h head/contrib/llvm/tools/lldb/include/lldb/Core/Disassembler.h head/contrib/llvm/tools/lldb/include/lldb/Core/MappedHash.h head/contrib/llvm/tools/lldb/include/lldb/Core/Module.h head/contrib/llvm/tools/lldb/include/lldb/Core/Opcode.h head/contrib/llvm/tools/lldb/include/lldb/Core/SourceManager.h head/contrib/llvm/tools/lldb/include/lldb/Core/StreamAsynchronousIO.h head/contrib/llvm/tools/lldb/include/lldb/Core/StringList.h head/contrib/llvm/tools/lldb/include/lldb/Core/ValueObject.h head/contrib/llvm/tools/lldb/include/lldb/Core/ValueObjectList.h head/contrib/llvm/tools/lldb/include/lldb/DataFormatters/CXXFormatterFunctions.h head/contrib/llvm/tools/lldb/include/lldb/DataFormatters/FormatManager.h head/contrib/llvm/tools/lldb/include/lldb/DataFormatters/TypeCategory.h head/contrib/llvm/tools/lldb/include/lldb/DataFormatters/TypeCategoryMap.h head/contrib/llvm/tools/lldb/include/lldb/DataFormatters/TypeFormat.h head/contrib/llvm/tools/lldb/include/lldb/DataFormatters/TypeSynthetic.h head/contrib/llvm/tools/lldb/include/lldb/DataFormatters/ValueObjectPrinter.h head/contrib/llvm/tools/lldb/include/lldb/Expression/ClangFunction.h head/contrib/llvm/tools/lldb/include/lldb/Expression/IRForTarget.h head/contrib/llvm/tools/lldb/include/lldb/Host/File.h head/contrib/llvm/tools/lldb/include/lldb/Host/FileSpec.h head/contrib/llvm/tools/lldb/include/lldb/Host/Host.h head/contrib/llvm/tools/lldb/include/lldb/Host/SocketAddress.h head/contrib/llvm/tools/lldb/include/lldb/Interpreter/CommandInterpreter.h head/contrib/llvm/tools/lldb/include/lldb/Interpreter/PythonDataObjects.h head/contrib/llvm/tools/lldb/include/lldb/Interpreter/ScriptInterpreter.h head/contrib/llvm/tools/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h head/contrib/llvm/tools/lldb/include/lldb/Symbol/FuncUnwinders.h head/contrib/llvm/tools/lldb/include/lldb/Symbol/Function.h head/contrib/llvm/tools/lldb/include/lldb/Symbol/ObjectFile.h head/contrib/llvm/tools/lldb/include/lldb/Symbol/Symbol.h head/contrib/llvm/tools/lldb/include/lldb/Symbol/SymbolContext.h head/contrib/llvm/tools/lldb/include/lldb/Symbol/Type.h head/contrib/llvm/tools/lldb/include/lldb/Symbol/UnwindTable.h head/contrib/llvm/tools/lldb/include/lldb/Symbol/VariableList.h head/contrib/llvm/tools/lldb/include/lldb/Target/DynamicLoader.h head/contrib/llvm/tools/lldb/include/lldb/Target/ExecutionContext.h head/contrib/llvm/tools/lldb/include/lldb/Target/Platform.h head/contrib/llvm/tools/lldb/include/lldb/Target/Process.h head/contrib/llvm/tools/lldb/include/lldb/Target/SectionLoadList.h head/contrib/llvm/tools/lldb/include/lldb/Target/SystemRuntime.h head/contrib/llvm/tools/lldb/include/lldb/Target/Target.h head/contrib/llvm/tools/lldb/include/lldb/Target/Thread.h head/contrib/llvm/tools/lldb/include/lldb/Target/ThreadList.h head/contrib/llvm/tools/lldb/include/lldb/Target/ThreadPlanStepInRange.h head/contrib/llvm/tools/lldb/include/lldb/Target/UnwindAssembly.h head/contrib/llvm/tools/lldb/include/lldb/Utility/Iterable.h head/contrib/llvm/tools/lldb/include/lldb/lldb-enumerations.h head/contrib/llvm/tools/lldb/include/lldb/lldb-forward.h head/contrib/llvm/tools/lldb/include/lldb/lldb-private-enumerations.h head/contrib/llvm/tools/lldb/include/lldb/lldb-private-log.h head/contrib/llvm/tools/lldb/source/API/SBBreakpoint.cpp head/contrib/llvm/tools/lldb/source/API/SBCommandInterpreter.cpp head/contrib/llvm/tools/lldb/source/API/SBDebugger.cpp head/contrib/llvm/tools/lldb/source/API/SBFrame.cpp head/contrib/llvm/tools/lldb/source/API/SBModule.cpp head/contrib/llvm/tools/lldb/source/API/SBProcess.cpp head/contrib/llvm/tools/lldb/source/API/SBTarget.cpp head/contrib/llvm/tools/lldb/source/API/SBType.cpp head/contrib/llvm/tools/lldb/source/API/SBTypeCategory.cpp head/contrib/llvm/tools/lldb/source/API/SBTypeFormat.cpp head/contrib/llvm/tools/lldb/source/API/SBValue.cpp head/contrib/llvm/tools/lldb/source/Breakpoint/Breakpoint.cpp head/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocation.cpp head/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointLocationList.cpp head/contrib/llvm/tools/lldb/source/Breakpoint/BreakpointResolverName.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpointCommand.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpointCommand.h head/contrib/llvm/tools/lldb/source/Commands/CommandObjectCommands.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectDisassemble.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectExpression.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectExpression.h head/contrib/llvm/tools/lldb/source/Commands/CommandObjectMultiword.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectProcess.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectQuit.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectRegister.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectSource.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectTarget.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectType.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectWatchpointCommand.cpp head/contrib/llvm/tools/lldb/source/Commands/CommandObjectWatchpointCommand.h head/contrib/llvm/tools/lldb/source/Core/Address.cpp head/contrib/llvm/tools/lldb/source/Core/ArchSpec.cpp head/contrib/llvm/tools/lldb/source/Core/Broadcaster.cpp head/contrib/llvm/tools/lldb/source/Core/Communication.cpp head/contrib/llvm/tools/lldb/source/Core/ConnectionFileDescriptor.cpp head/contrib/llvm/tools/lldb/source/Core/DataExtractor.cpp head/contrib/llvm/tools/lldb/source/Core/Debugger.cpp head/contrib/llvm/tools/lldb/source/Core/Disassembler.cpp head/contrib/llvm/tools/lldb/source/Core/DynamicLoader.cpp head/contrib/llvm/tools/lldb/source/Core/Log.cpp head/contrib/llvm/tools/lldb/source/Core/Mangled.cpp head/contrib/llvm/tools/lldb/source/Core/Module.cpp head/contrib/llvm/tools/lldb/source/Core/Opcode.cpp head/contrib/llvm/tools/lldb/source/Core/Section.cpp head/contrib/llvm/tools/lldb/source/Core/SourceManager.cpp head/contrib/llvm/tools/lldb/source/Core/StreamAsynchronousIO.cpp head/contrib/llvm/tools/lldb/source/Core/StringList.cpp head/contrib/llvm/tools/lldb/source/Core/Value.cpp head/contrib/llvm/tools/lldb/source/Core/ValueObject.cpp head/contrib/llvm/tools/lldb/source/Core/ValueObjectChild.cpp head/contrib/llvm/tools/lldb/source/Core/ValueObjectVariable.cpp head/contrib/llvm/tools/lldb/source/DataFormatters/DataVisualization.cpp head/contrib/llvm/tools/lldb/source/DataFormatters/FormatManager.cpp head/contrib/llvm/tools/lldb/source/DataFormatters/LibCxx.cpp head/contrib/llvm/tools/lldb/source/DataFormatters/LibCxxUnorderedMap.cpp head/contrib/llvm/tools/lldb/source/DataFormatters/TypeCategory.cpp head/contrib/llvm/tools/lldb/source/DataFormatters/TypeFormat.cpp head/contrib/llvm/tools/lldb/source/DataFormatters/ValueObjectPrinter.cpp head/contrib/llvm/tools/lldb/source/Expression/ClangASTSource.cpp head/contrib/llvm/tools/lldb/source/Expression/ClangExpressionDeclMap.cpp head/contrib/llvm/tools/lldb/source/Expression/ClangExpressionParser.cpp head/contrib/llvm/tools/lldb/source/Expression/ClangUserExpression.cpp head/contrib/llvm/tools/lldb/source/Expression/DWARFExpression.cpp head/contrib/llvm/tools/lldb/source/Expression/IRDynamicChecks.cpp head/contrib/llvm/tools/lldb/source/Expression/IRExecutionUnit.cpp head/contrib/llvm/tools/lldb/source/Expression/IRForTarget.cpp head/contrib/llvm/tools/lldb/source/Expression/Materializer.cpp head/contrib/llvm/tools/lldb/source/Host/common/File.cpp head/contrib/llvm/tools/lldb/source/Host/common/Host.cpp head/contrib/llvm/tools/lldb/source/Host/common/OptionParser.cpp head/contrib/llvm/tools/lldb/source/Host/common/SocketAddress.cpp head/contrib/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp head/contrib/llvm/tools/lldb/source/Interpreter/CommandObject.cpp head/contrib/llvm/tools/lldb/source/Interpreter/Options.cpp head/contrib/llvm/tools/lldb/source/Interpreter/PythonDataObjects.cpp head/contrib/llvm/tools/lldb/source/Interpreter/ScriptInterpreterNone.cpp head/contrib/llvm/tools/lldb/source/Interpreter/ScriptInterpreterPython.cpp head/contrib/llvm/tools/lldb/source/Interpreter/embedded_interpreter.py head/contrib/llvm/tools/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp head/contrib/llvm/tools/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h head/contrib/llvm/tools/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h head/contrib/llvm/tools/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp head/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp head/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h head/contrib/llvm/tools/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp head/contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp head/contrib/llvm/tools/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp head/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp head/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h head/contrib/llvm/tools/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp head/contrib/llvm/tools/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h head/contrib/llvm/tools/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp head/contrib/llvm/tools/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h head/contrib/llvm/tools/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp head/contrib/llvm/tools/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h head/contrib/llvm/tools/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp head/contrib/llvm/tools/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.h head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/POSIXThread.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/POSIXThread.h head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.h head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_i386.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextFreeBSD_x86_64.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIX.h head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/RegisterContextPOSIXProcessMonitor_x86.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/HistoryThread.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/HistoryThread.h head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/Utility/UnwindLLDB.h head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h head/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp head/contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h head/contrib/llvm/tools/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp head/contrib/llvm/tools/lldb/source/Symbol/ClangASTContext.cpp head/contrib/llvm/tools/lldb/source/Symbol/ClangASTType.cpp head/contrib/llvm/tools/lldb/source/Symbol/FuncUnwinders.cpp head/contrib/llvm/tools/lldb/source/Symbol/Function.cpp head/contrib/llvm/tools/lldb/source/Symbol/Symbol.cpp head/contrib/llvm/tools/lldb/source/Symbol/Type.cpp head/contrib/llvm/tools/lldb/source/Symbol/Variable.cpp head/contrib/llvm/tools/lldb/source/Symbol/VariableList.cpp head/contrib/llvm/tools/lldb/source/Target/ExecutionContext.cpp head/contrib/llvm/tools/lldb/source/Target/LanguageRuntime.cpp head/contrib/llvm/tools/lldb/source/Target/Platform.cpp head/contrib/llvm/tools/lldb/source/Target/Process.cpp head/contrib/llvm/tools/lldb/source/Target/SectionLoadList.cpp head/contrib/llvm/tools/lldb/source/Target/StopInfo.cpp head/contrib/llvm/tools/lldb/source/Target/SystemRuntime.cpp head/contrib/llvm/tools/lldb/source/Target/Target.cpp head/contrib/llvm/tools/lldb/source/Target/Thread.cpp head/contrib/llvm/tools/lldb/source/Target/ThreadList.cpp head/contrib/llvm/tools/lldb/source/Target/ThreadPlanStepInRange.cpp head/contrib/llvm/tools/lldb/source/Target/ThreadPlanStepThrough.cpp head/contrib/llvm/tools/lldb/source/Target/ThreadPlanTracer.cpp head/contrib/llvm/tools/lldb/source/Target/UnwindAssembly.cpp head/contrib/llvm/tools/lldb/source/Utility/StringExtractorGDBRemote.cpp head/contrib/llvm/tools/lldb/source/Utility/StringExtractorGDBRemote.h head/contrib/llvm/tools/lldb/source/lldb-log.cpp head/contrib/llvm/tools/lldb/source/lldb.cpp head/contrib/llvm/tools/lldb/tools/driver/Driver.cpp head/contrib/llvm/tools/lldb/tools/driver/Driver.h head/contrib/llvm/tools/lldb/tools/driver/Platform.h head/contrib/llvm/tools/lldb/tools/lldb-platform/lldb-platform.cpp head/lib/clang/liblldbAPI/Makefile head/lib/clang/liblldbCommands/Makefile head/lib/clang/liblldbCore/Makefile head/lib/clang/liblldbHostCommon/Makefile head/lib/clang/liblldbTarget/Makefile head/usr.bin/clang/lldb/Makefile Directory Properties: head/ (props changed) head/contrib/llvm/ (props changed) head/contrib/llvm/tools/lldb/ (props changed) Modified: head/contrib/llvm/tools/lldb/include/lldb/API/LLDB.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/API/LLDB.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/API/LLDB.h Wed Feb 26 16:09:54 2014 (r262528) @@ -33,13 +33,14 @@ #include "lldb/API/SBFrame.h" #include "lldb/API/SBFunction.h" #include "lldb/API/SBHostOS.h" -#include "lldb/API/SBInputReader.h" #include "lldb/API/SBInstruction.h" #include "lldb/API/SBInstructionList.h" #include "lldb/API/SBLineEntry.h" #include "lldb/API/SBListener.h" #include "lldb/API/SBModule.h" #include "lldb/API/SBProcess.h" +#include "lldb/API/SBQueue.h" +#include "lldb/API/SBQueueItem.h" #include "lldb/API/SBSourceManager.h" #include "lldb/API/SBStream.h" #include "lldb/API/SBStringList.h" Modified: head/contrib/llvm/tools/lldb/include/lldb/API/SBAddress.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/API/SBAddress.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/API/SBAddress.h Wed Feb 26 16:09:54 2014 (r262528) @@ -118,6 +118,7 @@ protected: friend class SBTarget; friend class SBThread; friend class SBValue; + friend class SBQueueItem; lldb_private::Address * operator->(); Modified: head/contrib/llvm/tools/lldb/include/lldb/API/SBCommandInterpreter.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/API/SBCommandInterpreter.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/API/SBCommandInterpreter.h Wed Feb 26 16:09:54 2014 (r262528) @@ -122,6 +122,36 @@ public: SBCommandInterpreter (lldb_private::CommandInterpreter *interpreter_ptr = NULL); // Access using SBDebugger::GetCommandInterpreter(); + //---------------------------------------------------------------------- + /// Return true if the command interpreter is the active IO handler. + /// + /// This indicates that any input coming into the debugger handles will + /// go to the command interpreter and will result in LLDB command line + /// commands being executed. + //---------------------------------------------------------------------- + bool + IsActive (); + + //---------------------------------------------------------------------- + /// Get the string that needs to be written to the debugger stdin file + /// handle when a control character is typed. + /// + /// Some GUI programs will intercept "control + char" sequences and want + /// to have them do what normally would happen when using a real + /// terminal, so this function allows GUI programs to emulate this + /// functionality. + /// + /// @param[in] ch + /// The character that was typed along with the control key + /// + /// @return + /// The string that should be written into the file handle that is + /// feeding the input stream for the debugger, or NULL if there is + /// no string for this control key. + //---------------------------------------------------------------------- + const char * + GetIOHandlerControlSequence(char ch); + protected: lldb_private::CommandInterpreter & Modified: head/contrib/llvm/tools/lldb/include/lldb/API/SBDebugger.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/API/SBDebugger.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/API/SBDebugger.h Wed Feb 26 16:09:54 2014 (r262528) @@ -17,6 +17,16 @@ namespace lldb { + +class SBInputReader +{ +public: + SBInputReader(); + ~SBInputReader(); + SBError Initialize(lldb::SBDebugger&, unsigned long (*)(void*, lldb::SBInputReader*, lldb::InputReaderAction, char const*, unsigned long), void*, lldb::InputReaderGranularity, char const*, char const*, bool); + void SetIsDone(bool); + bool IsActive() const; +}; class SBDebugger { public: @@ -231,12 +241,6 @@ public: void PushInputReader (lldb::SBInputReader &reader); - void - NotifyTopInputReader (lldb::InputReaderAction notification); - - bool - InputReaderIsTopReader (const lldb::SBInputReader &reader); - const char * GetInstanceName (); @@ -313,6 +317,10 @@ public: GetSyntheticForType (SBTypeNameSpecifier); #endif + void + RunCommandInterpreter (bool auto_handle_events, + bool spawn_thread); + private: friend class SBCommandInterpreter; Modified: head/contrib/llvm/tools/lldb/include/lldb/API/SBDefines.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/API/SBDefines.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/API/SBDefines.h Wed Feb 26 16:09:54 2014 (r262528) @@ -48,7 +48,6 @@ class SBFileSpecList; class SBFrame; class SBFunction; class SBHostOS; -class SBInputReader; class SBInstruction; class SBInstructionList; class SBLineEntry; Modified: head/contrib/llvm/tools/lldb/include/lldb/API/SBError.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/API/SBError.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/API/SBError.h Wed Feb 26 16:09:54 2014 (r262528) @@ -71,7 +71,6 @@ protected: friend class SBDebugger; friend class SBCommunication; friend class SBHostOS; - friend class SBInputReader; friend class SBPlatform; friend class SBProcess; friend class SBThread; Modified: head/contrib/llvm/tools/lldb/include/lldb/API/SBModule.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/API/SBModule.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/API/SBModule.h Wed Feb 26 16:09:54 2014 (r262528) @@ -235,6 +235,25 @@ public: lldb::SBTypeList FindTypes (const char* type); + //------------------------------------------------------------------ + /// Get a type using its type ID. + /// + /// Each symbol file reader will assign different user IDs to their + /// types, but it is sometimes useful when debugging type issues to + /// be able to grab a type using its type ID. + /// + /// For DWARF debug info, the type ID is the DIE offset. + /// + /// @param[in] uid + /// The type user ID. + /// + /// @return + /// An SBType for the given type ID, or an empty SBType if the + /// type was not found. + //------------------------------------------------------------------ + lldb::SBType + GetTypeByID (lldb::user_id_t uid); + lldb::SBType GetBasicType(lldb::BasicType type); Modified: head/contrib/llvm/tools/lldb/include/lldb/API/SBProcess.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/API/SBProcess.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/API/SBProcess.h Wed Feb 26 16:09:54 2014 (r262528) @@ -13,6 +13,7 @@ #include "lldb/API/SBDefines.h" #include "lldb/API/SBError.h" #include "lldb/API/SBTarget.h" +#include "lldb/API/SBQueue.h" #include namespace lldb { @@ -142,6 +143,15 @@ public: SetSelectedThreadByIndexID (uint32_t index_id); //------------------------------------------------------------------ + // Queue related functions + //------------------------------------------------------------------ + uint32_t + GetNumQueues (); + + lldb::SBQueue + GetQueueAtIndex (size_t index); + + //------------------------------------------------------------------ // Stepping related functions //------------------------------------------------------------------ @@ -312,6 +322,7 @@ protected: friend class SBTarget; friend class SBThread; friend class SBValue; + friend class lldb_private::QueueImpl; lldb::ProcessSP GetSP() const; Copied: head/contrib/llvm/tools/lldb/include/lldb/API/SBQueue.h (from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/include/lldb/API/SBQueue.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/tools/lldb/include/lldb/API/SBQueue.h Wed Feb 26 16:09:54 2014 (r262528, copy of r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/include/lldb/API/SBQueue.h) @@ -0,0 +1,83 @@ +//===-- SBQueue.h -----------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLDB_SBQueue_h_ +#define LLDB_SBQueue_h_ + +#include + +#include "lldb/lldb-forward.h" +#include "lldb/API/SBDefines.h" +#include "lldb/API/SBQueueItem.h" + +namespace lldb { + +class SBQueue +{ +public: + SBQueue (); + + SBQueue (const QueueSP& queue_sp); + + SBQueue (const SBQueue& rhs); + + const SBQueue & + operator= (const lldb::SBQueue& rhs); + + ~SBQueue(); + + bool + IsValid() const; + + void + Clear (); + + lldb::SBProcess + GetProcess (); + + lldb::queue_id_t + GetQueueID () const; + + const char * + GetName () const; + + uint32_t + GetIndexID () const; + + uint32_t + GetNumThreads (); + + lldb::SBThread + GetThreadAtIndex (uint32_t); + + uint32_t + GetNumPendingItems (); + + lldb::SBQueueItem + GetPendingItemAtIndex (uint32_t); + +protected: + friend class SBProcess; + + void + SetQueue (const lldb::QueueSP& queue_sp); + + void + FetchThreads (); + + void + FetchItems (); + +private: + std::shared_ptr m_opaque_sp; +}; + +} // namespace lldb + +#endif // LLDB_SBQueue_h_ Copied: head/contrib/llvm/tools/lldb/include/lldb/API/SBQueueItem.h (from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/include/lldb/API/SBQueueItem.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/tools/lldb/include/lldb/API/SBQueueItem.h Wed Feb 26 16:09:54 2014 (r262528, copy of r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/include/lldb/API/SBQueueItem.h) @@ -0,0 +1,58 @@ +//===-- SBQueueItem.h -------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLDB_SBQueueItem_h_ +#define LLDB_SBQueueItem_h_ + +#include "lldb/API/SBDefines.h" +#include "lldb/API/SBAddress.h" +#include "lldb/API/SBThread.h" + +namespace lldb { + +class SBQueueItem +{ +public: + SBQueueItem (); + + SBQueueItem (const lldb::QueueItemSP& queue_item_sp); + + ~SBQueueItem(); + + bool + IsValid() const; + + void + Clear (); + + lldb::QueueItemKind + GetKind () const; + + void + SetKind (lldb::QueueItemKind kind); + + lldb::SBAddress + GetAddress () const; + + void + SetAddress (lldb::SBAddress addr); + + void + SetQueueItem (const lldb::QueueItemSP& queue_item_sp); + + SBThread + GetExtendedBacktraceThread (const char *type); + +private: + lldb::QueueItemSP m_queue_item_sp; +}; + +} // namespace lldb + +#endif // LLDB_SBQueueItem_h_ Modified: head/contrib/llvm/tools/lldb/include/lldb/API/SBTarget.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/API/SBTarget.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/API/SBTarget.h Wed Feb 26 16:09:54 2014 (r262528) @@ -646,9 +646,47 @@ public: void Clear (); + //------------------------------------------------------------------ + /// Resolve a current load address into a section offset address. + /// + /// @param[in] vm_addr + /// A virtual address from the current process state that is to + /// be translated into a section offset address. + /// + /// @return + /// An SBAddress which will be valid if \a vm_addr was + /// successfully resolved into a section offset address, or an + /// invalid SBAddress if \a vm_addr doesn't resolve to a section + /// in a module. + //------------------------------------------------------------------ lldb::SBAddress ResolveLoadAddress (lldb::addr_t vm_addr); + //------------------------------------------------------------------ + /// Resolve a current load address into a section offset address + /// using the process stop ID to identify a time in the past. + /// + /// @param[in] stop_id + /// Each time a process stops, the process stop ID integer gets + /// incremented. These stop IDs are used to identify past times + /// and can be used in history objects as a cheap way to store + /// the time at which the sample was taken. Specifying + /// UINT32_MAX will always resolve the address using the + /// currently loaded sections. + /// + /// @param[in] vm_addr + /// A virtual address from the current process state that is to + /// be translated into a section offset address. + /// + /// @return + /// An SBAddress which will be valid if \a vm_addr was + /// successfully resolved into a section offset address, or an + /// invalid SBAddress if \a vm_addr doesn't resolve to a section + /// in a module. + //------------------------------------------------------------------ + lldb::SBAddress + ResolvePastLoadAddress (uint32_t stop_id, lldb::addr_t vm_addr); + SBSymbolContext ResolveSymbolContextForAddress (const SBAddress& addr, uint32_t resolve_scope); Modified: head/contrib/llvm/tools/lldb/include/lldb/API/SBThread.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/API/SBThread.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/API/SBThread.h Wed Feb 26 16:09:54 2014 (r262528) @@ -214,6 +214,8 @@ protected: friend class SBProcess; friend class SBDebugger; friend class SBValue; + friend class lldb_private::QueueImpl; + friend class SBQueueItem; void SetThread (const lldb::ThreadSP& lldb_object_sp); Modified: head/contrib/llvm/tools/lldb/include/lldb/API/SBType.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/API/SBType.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/API/SBType.h Wed Feb 26 16:09:54 2014 (r262528) @@ -106,6 +106,9 @@ public: GetReferenceType(); lldb::SBType + GetTypedefedType(); + + lldb::SBType GetDereferencedType(); lldb::SBType Modified: head/contrib/llvm/tools/lldb/include/lldb/API/SBTypeFormat.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/API/SBTypeFormat.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/API/SBTypeFormat.h Wed Feb 26 16:09:54 2014 (r262528) @@ -22,6 +22,9 @@ public: SBTypeFormat (lldb::Format format, uint32_t options = 0); // see lldb::eTypeOption values + + SBTypeFormat (const char* type, + uint32_t options = 0); // see lldb::eTypeOption values SBTypeFormat (const lldb::SBTypeFormat &rhs); @@ -33,6 +36,9 @@ public: lldb::Format GetFormat (); + const char* + GetTypeName (); + uint32_t GetOptions(); @@ -40,6 +46,9 @@ public: SetFormat (lldb::Format); void + SetTypeName (const char*); + + void SetOptions (uint32_t); bool @@ -73,8 +82,15 @@ protected: SBTypeFormat (const lldb::TypeFormatImplSP &); + enum class Type + { + eTypeKeepSame, + eTypeFormat, + eTypeEnum + }; + bool - CopyOnWrite_Impl(); + CopyOnWrite_Impl(Type); }; Modified: head/contrib/llvm/tools/lldb/include/lldb/Breakpoint/Breakpoint.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/Breakpoint/Breakpoint.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/Breakpoint/Breakpoint.h Wed Feb 26 16:09:54 2014 (r262528) @@ -612,12 +612,30 @@ protected: /// Only the Target can make a breakpoint, and it owns the breakpoint lifespans. /// The constructor takes a filter and a resolver. Up in Target there are convenience /// variants that make breakpoints for some common cases. + /// + /// @param[in] target + /// The target in which the breakpoint will be set. + /// + /// @param[in] filter_sp + /// Shared pointer to the search filter that restricts the search domain of the breakpoint. + /// + /// @param[in] resolver_sp + /// Shared pointer to the resolver object that will determine breakpoint matches. + /// + /// @param hardware + /// If true, request a hardware breakpoint to be used to implement the breakpoint locations. + /// + /// @param resolve_indirect_symbols + /// If true, and the address of a given breakpoint location in this breakpoint is set on an + /// indirect symbol (i.e. Symbol::IsIndirect returns true) then the actual breakpoint site will + /// be set on the target of the indirect symbol. //------------------------------------------------------------------ // This is the generic constructor Breakpoint(Target &target, lldb::SearchFilterSP &filter_sp, lldb::BreakpointResolverSP &resolver_sp, - bool hardware); + bool hardware, + bool resolve_indirect_symbols = true); friend class BreakpointLocation; // To call the following two when determining whether to stop. @@ -643,6 +661,7 @@ private: BreakpointOptions m_options; // Settable breakpoint options BreakpointLocationList m_locations; // The list of locations currently found for this breakpoint. std::string m_kind_description; + bool m_resolve_indirect_symbols; void SendBreakpointChangedEvent (lldb::BreakpointEventType eventKind); Modified: head/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocation.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocation.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocation.h Wed Feb 26 16:09:54 2014 (r262528) @@ -321,7 +321,59 @@ public: //------------------------------------------------------------------ bool InvokeCallback (StoppointCallbackContext *context); + + //------------------------------------------------------------------ + /// Returns whether we should resolve Indirect functions in setting the breakpoint site + /// for this location. + /// + /// @return + /// \b true if the breakpoint SITE for this location should be set on the + /// resolved location for Indirect functions. + //------------------------------------------------------------------ + bool + ShouldResolveIndirectFunctions () + { + return m_should_resolve_indirect_functions; + } + //------------------------------------------------------------------ + /// Returns whether the address set in the breakpoint site for this location was found by resolving + /// an indirect symbol. + /// + /// @return + /// \b true or \b false as given in the description above. + //------------------------------------------------------------------ + bool + IsIndirect () + { + return m_is_indirect; + } + + void + SetIsIndirect (bool is_indirect) + { + m_is_indirect = is_indirect; + } + + //------------------------------------------------------------------ + /// Returns whether the address set in the breakpoint location was re-routed to the target of a + /// re-exported symbol. + /// + /// @return + /// \b true or \b false as given in the description above. + //------------------------------------------------------------------ + bool + IsReExported () + { + return m_is_reexported; + } + + void + SetIsReExported (bool is_reexported) + { + m_is_reexported = is_reexported; + } + protected: friend class BreakpointLocationList; friend class Process; @@ -375,12 +427,16 @@ private: Breakpoint &owner, const Address &addr, lldb::tid_t tid, - bool hardware); - + bool hardware, + bool check_for_resolver = true); + //------------------------------------------------------------------ // Data members: //------------------------------------------------------------------ bool m_being_created; + bool m_should_resolve_indirect_functions; + bool m_is_reexported; + bool m_is_indirect; Address m_address; ///< The address defining this location. Breakpoint &m_owner; ///< The breakpoint that produced this object. std::unique_ptr m_options_ap; ///< Breakpoint options pointer, NULL if we're using our breakpoint's options. @@ -390,6 +446,12 @@ private: size_t m_condition_hash; ///< For testing whether the condition source code changed. void + SetShouldResolveIndirectFunctions (bool do_resolve) + { + m_should_resolve_indirect_functions = do_resolve; + } + + void SendBreakpointLocationChangedEvent (lldb::BreakpointEventType eventKind); DISALLOW_COPY_AND_ASSIGN (BreakpointLocation); Modified: head/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocationList.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocationList.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointLocationList.h Wed Feb 26 16:09:54 2014 (r262528) @@ -236,7 +236,7 @@ protected: /// Returns breakpoint location id. //------------------------------------------------------------------ lldb::BreakpointLocationSP - Create (const Address &addr); + Create (const Address &addr, bool resolve_indirect_symbols); void StartRecordingNewLocations(BreakpointLocationCollection &new_locations); @@ -246,6 +246,7 @@ protected: lldb::BreakpointLocationSP AddLocation (const Address &addr, + bool resolve_indirect_symbols, bool *new_location = NULL); bool Modified: head/contrib/llvm/tools/lldb/include/lldb/Core/ArchSpec.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/Core/ArchSpec.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/Core/ArchSpec.h Wed Feb 26 16:09:54 2014 (r262528) @@ -13,6 +13,7 @@ #if defined(__cplusplus) #include "lldb/lldb-private.h" +#include "lldb/Core/ConstString.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Triple.h" @@ -90,6 +91,11 @@ public: eCore_x86_32_i486sx, eCore_x86_64_x86_64, + eCore_x86_64_x86_64h, // Haswell enabled x86_64 + eCore_hexagon_generic, + eCore_hexagon_hexagonv4, + eCore_hexagon_hexagonv5, + eCore_uknownMach32, eCore_uknownMach64, kNumCores, @@ -101,6 +107,7 @@ public: kCore_ppc_any, kCore_ppc64_any, kCore_x86_32_any, + kCore_hexagon_any, kCore_arm_first = eCore_arm_generic, kCore_arm_last = eCore_arm_xscale, @@ -115,7 +122,10 @@ public: kCore_ppc64_last = eCore_ppc64_ppc970_64, kCore_x86_32_first = eCore_x86_32_i386, - kCore_x86_32_last = eCore_x86_32_i486sx + kCore_x86_32_last = eCore_x86_32_i486sx, + + kCore_hexagon_first = eCore_hexagon_generic, + kCore_hexagon_last = eCore_hexagon_hexagonv5 }; //------------------------------------------------------------------ @@ -203,6 +213,27 @@ public: GetMachine () const; //------------------------------------------------------------------ + /// Returns the distribution id of the architecture. + /// + /// This will be something like "ubuntu", "fedora", etc. on Linux. + /// + /// @return A ConstString ref containing the distribution id, + /// potentially empty. + //------------------------------------------------------------------ + const ConstString& + GetDistributionId () const; + + //------------------------------------------------------------------ + /// Set the distribution id of the architecture. + /// + /// This will be something like "ubuntu", "fedora", etc. on Linux. + /// This should be the same value returned by + /// Host::GetDistributionId (). + ///------------------------------------------------------------------ + void + SetDistributionId (const char* distribution_id); + + //------------------------------------------------------------------ /// Tests if this ArchSpec is valid. /// /// @return True if the current architecture is valid, false @@ -400,6 +431,8 @@ protected: Core m_core; lldb::ByteOrder m_byte_order; + ConstString m_distribution_id; + // Called when m_def or m_entry are changed. Fills in all remaining // members with default values. void Modified: head/contrib/llvm/tools/lldb/include/lldb/Core/Communication.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/Core/Communication.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/Core/Communication.h Wed Feb 26 16:09:54 2014 (r262528) @@ -286,6 +286,8 @@ public: virtual bool StopReadThread (Error *error_ptr = NULL); + virtual bool + JoinReadThread (Error *error_ptr = NULL); //------------------------------------------------------------------ /// Checks if there is a currently running read thread. /// Modified: head/contrib/llvm/tools/lldb/include/lldb/Core/ConnectionFileDescriptor.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/Core/ConnectionFileDescriptor.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/Core/ConnectionFileDescriptor.h Wed Feb 26 16:09:54 2014 (r262528) @@ -11,9 +11,7 @@ #define liblldb_ConnectionFileDescriptor_h_ // C Includes -#ifdef _WIN32 -typedef unsigned short in_port_t; -#else +#ifndef _WIN32 #include #include #include @@ -68,14 +66,17 @@ public: // If the read file descriptor is a socket, then return // the port number that is being used by the socket. - in_port_t + uint16_t GetReadPort () const; // If the write file descriptor is a socket, then return // the port number that is being used by the socket. - in_port_t + uint16_t GetWritePort () const; + uint16_t + GetBoundPort (uint32_t timeout_sec); + protected: typedef enum @@ -95,7 +96,7 @@ protected: BytesAvailable (uint32_t timeout_usec, Error *error_ptr); lldb::ConnectionStatus - SocketListen (uint16_t listen_port_num, Error *error_ptr); + SocketListen (const char *host_and_port, Error *error_ptr); lldb::ConnectionStatus ConnectTCP (const char *host_and_port, Error *error_ptr); @@ -117,15 +118,16 @@ protected: FDType m_fd_send_type; FDType m_fd_recv_type; std::unique_ptr m_udp_send_sockaddr; - bool m_should_close_fd; // True if this class should close the file descriptor when it goes away. uint32_t m_socket_timeout_usec; int m_pipe_read; // A pipe that we select on the reading end of along with int m_pipe_write; // m_fd_recv so we can force ourselves out of the select. - Mutex m_mutex; + Mutex m_mutex; + Predicate m_port_predicate; // Used when binding to port zero to wait for the thread that creates the socket, binds and listens to resolve the port number + bool m_should_close_fd; // True if this class should close the file descriptor when it goes away. bool m_shutting_down; // This marks that we are shutting down so if we get woken up from BytesAvailable // to disconnect, we won't try to read again. - static in_port_t + static uint16_t GetSocketPort (int fd); static int Modified: head/contrib/llvm/tools/lldb/include/lldb/Core/Debugger.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/Core/Debugger.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/Core/Debugger.h Wed Feb 26 16:09:54 2014 (r262528) @@ -19,9 +19,8 @@ #include "lldb/lldb-public.h" #include "lldb/Core/Broadcaster.h" #include "lldb/Core/Communication.h" -#include "lldb/Core/InputReaderStack.h" +#include "lldb/Core/IOHandler.h" #include "lldb/Core/Listener.h" -#include "lldb/Core/StreamFile.h" #include "lldb/Core/SourceManager.h" #include "lldb/Core/UserID.h" #include "lldb/Core/UserSettingsController.h" @@ -91,23 +90,25 @@ public: void SetAsyncExecution (bool async); - File & + lldb::StreamFileSP GetInputFile () { - return m_input_file.GetFile(); + return m_input_file_sp; } - File & + lldb::StreamFileSP GetOutputFile () { - return m_output_file.GetFile(); + return m_output_file_sp; } - File & + lldb::StreamFileSP GetErrorFile () { - return m_error_file.GetFile(); + return m_error_file_sp; } + + void SetInputFileHandle (FILE *fh, bool tranfer_ownership); @@ -124,18 +125,6 @@ public: void RestoreInputTerminalState(); - Stream& - GetOutputStream () - { - return m_output_file; - } - - Stream& - GetErrorStream () - { - return m_error_file; - } - lldb::StreamSP GetAsyncOutputStream (); @@ -200,24 +189,38 @@ public: void DispatchInputEndOfFile (); + //------------------------------------------------------------------ + // If any of the streams are not set, set them to the in/out/err + // stream of the top most input reader to ensure they at least have + // something + //------------------------------------------------------------------ void - DispatchInput (const char *bytes, size_t bytes_len); + AdoptTopIOHandlerFilesIfInvalid (lldb::StreamFileSP &in, + lldb::StreamFileSP &out, + lldb::StreamFileSP &err); void - WriteToDefaultReader (const char *bytes, size_t bytes_len); + PushIOHandler (const lldb::IOHandlerSP& reader_sp); + bool + PopIOHandler (const lldb::IOHandlerSP& reader_sp); + + // Synchronously run an input reader until it is done void - PushInputReader (const lldb::InputReaderSP& reader_sp); + RunIOHandler (const lldb::IOHandlerSP& reader_sp); + + bool + IsTopIOHandler (const lldb::IOHandlerSP& reader_sp); + + ConstString + GetTopIOHandlerControlSequence(char ch); bool - PopInputReader (const lldb::InputReaderSP& reader_sp); + HideTopIOHandler(); void - NotifyTopInputReader (lldb::InputReaderAction notification); + RefreshTopIOHandler(); - bool - InputReaderIsTopReader (const lldb::InputReaderSP& reader_sp); - static lldb::DebuggerSP FindDebuggerWithID (lldb::user_id_t id); @@ -240,7 +243,7 @@ public: void - CleanUpInputReaders (); + ClearIOHandlers (); static int TestDebuggerRefCount (); @@ -338,29 +341,65 @@ public: bool LoadPlugin (const FileSpec& spec, Error& error); + void + ExecuteIOHanders(); + + bool + IsForwardingEvents (); + + void + EnableForwardEvents (const lldb::ListenerSP &listener_sp); + + void + CancelForwardEvents (const lldb::ListenerSP &listener_sp); protected: - static void - DispatchInputCallback (void *baton, const void *bytes, size_t bytes_len); + friend class CommandInterpreter; + + bool + StartEventHandlerThread(); - lldb::InputReaderSP - GetCurrentInputReader (); - void - ActivateInputReader (const lldb::InputReaderSP &reader_sp); + StopEventHandlerThread(); + + static lldb::thread_result_t + EventHandlerThread (lldb::thread_arg_t arg); bool - CheckIfTopInputReaderIsDone (); + StartIOHandlerThread(); + + void + StopIOHandlerThread(); + static lldb::thread_result_t + IOHandlerThread (lldb::thread_arg_t arg); + + void + DefaultEventHandler(); + + void + HandleBreakpointEvent (const lldb::EventSP &event_sp); + + void + HandleProcessEvent (const lldb::EventSP &event_sp); + + void + HandleThreadEvent (const lldb::EventSP &event_sp); + + size_t + GetProcessSTDOUT (Process *process, Stream *stream); + + size_t + GetProcessSTDERR (Process *process, Stream *stream); + SourceManager::SourceFileCache & GetSourceFileCache () { return m_source_file_cache; } - Communication m_input_comm; - StreamFile m_input_file; - StreamFile m_output_file; - StreamFile m_error_file; + lldb::StreamFileSP m_input_file_sp; + lldb::StreamFileSP m_output_file_sp; + lldb::StreamFileSP m_error_file_sp; TerminalState m_terminal_state; TargetList m_target_list; PlatformList m_platform_list; @@ -370,8 +409,7 @@ protected: // source file cache. std::unique_ptr m_command_interpreter_ap; - InputReaderStack m_input_reader_stack; - std::string m_input_reader_data; + IOHandlerStack m_input_reader_stack; typedef std::map LogStreamMap; LogStreamMap m_log_streams; lldb::StreamSP m_log_callback_stream_sp; @@ -379,7 +417,10 @@ protected: static LoadPluginCallbackType g_load_plugin_callback; typedef std::vector LoadedPluginsList; LoadedPluginsList m_loaded_plugins; - + lldb::thread_t m_event_handler_thread; + lldb::thread_t m_io_handler_thread; + lldb::ListenerSP m_forward_listener_sp; + bool m_event_handler_thread_alive; void InstanceInitialize (); Modified: head/contrib/llvm/tools/lldb/include/lldb/Core/Disassembler.h ============================================================================== --- head/contrib/llvm/tools/lldb/include/lldb/Core/Disassembler.h Wed Feb 26 11:29:07 2014 (r262527) +++ head/contrib/llvm/tools/lldb/include/lldb/Core/Disassembler.h Wed Feb 26 16:09:54 2014 (r262528) @@ -175,6 +175,9 @@ public: uint32_t GetIndexOfInstructionAtLoadAddress (lldb::addr_t load_addr, Target &target); + uint32_t + GetIndexOfInstructionAtAddress (const Address &addr); + void Clear(); Copied: head/contrib/llvm/tools/lldb/include/lldb/Core/IOHandler.h (from r262527, projects/lldb-r201577/contrib/llvm/tools/lldb/include/lldb/Core/IOHandler.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 17:14:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D726F73; Wed, 26 Feb 2014 17:14:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 77DA31197; Wed, 26 Feb 2014 17:14:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1QHE3rJ010687; Wed, 26 Feb 2014 17:14:03 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1QHE2Zu010679; Wed, 26 Feb 2014 17:14:02 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201402261714.s1QHE2Zu010679@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 26 Feb 2014 17:14:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262530 - in head/contrib/openpam: . lib/libpam t X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 17:14:03 -0000 Author: des Date: Wed Feb 26 17:14:02 2014 New Revision: 262530 URL: http://svnweb.freebsd.org/changeset/base/262530 Log: MFV (r262529): fix is_upper() predicate MFC after: 1 week Added: head/contrib/openpam/t/t_openpam_ctype.c - copied unchanged from r262529, vendor/openpam/dist/t/t_openpam_ctype.c Modified: head/contrib/openpam/CREDITS head/contrib/openpam/lib/libpam/openpam_ctype.h head/contrib/openpam/t/Makefile.am Directory Properties: head/contrib/openpam/ (props changed) Modified: head/contrib/openpam/CREDITS ============================================================================== --- head/contrib/openpam/CREDITS Wed Feb 26 17:06:54 2014 (r262529) +++ head/contrib/openpam/CREDITS Wed Feb 26 17:14:02 2014 (r262530) @@ -29,9 +29,9 @@ ideas: Hubert Feyrer Jason Evans Joe Marcus Clarke - Juli Mallett - Ankita Pal Jörg Sonnenberger + Juli Mallett + Larry Baird Maëlle Lesage Mark Murray Matthias Drochner Modified: head/contrib/openpam/lib/libpam/openpam_ctype.h ============================================================================== --- head/contrib/openpam/lib/libpam/openpam_ctype.h Wed Feb 26 17:06:54 2014 (r262529) +++ head/contrib/openpam/lib/libpam/openpam_ctype.h Wed Feb 26 17:14:02 2014 (r262530) @@ -39,10 +39,18 @@ (ch >= '0' && ch <= '9') /* + * Evaluates to non-zero if the argument is a hex digit. + */ +#define is_xdigit(ch) \ + ((ch >= '0' && ch <= '9') || \ + (ch >= 'a' && ch <= 'f') || \ + (ch >= 'A' && ch <= 'F')) + +/* * Evaluates to non-zero if the argument is an uppercase letter. */ #define is_upper(ch) \ - (ch >= 'A' && ch <= 'A') + (ch >= 'A' && ch <= 'Z') /* * Evaluates to non-zero if the argument is a lowercase letter. Modified: head/contrib/openpam/t/Makefile.am ============================================================================== --- head/contrib/openpam/t/Makefile.am Wed Feb 26 17:06:54 2014 (r262529) +++ head/contrib/openpam/t/Makefile.am Wed Feb 26 17:14:02 2014 (r262530) @@ -6,6 +6,7 @@ noinst_HEADERS = t.h # tests TESTS = +TESTS += t_openpam_ctype TESTS += t_openpam_readword TESTS += t_openpam_readlinev check_PROGRAMS = $(TESTS) Copied: head/contrib/openpam/t/t_openpam_ctype.c (from r262529, vendor/openpam/dist/t/t_openpam_ctype.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/openpam/t/t_openpam_ctype.c Wed Feb 26 17:14:02 2014 (r262530, copy of r262529, vendor/openpam/dist/t/t_openpam_ctype.c) @@ -0,0 +1,122 @@ +/*- + * Copyright (c) 2014 Dag-Erling Smørgrav + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include + +#include "openpam_ctype.h" + +#include "t.h" + +#define OC_DIGIT "0123456789" +#define OC_XDIGIT OC_DIGIT "ABCDEFabcdef" +#define OC_UPPER "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +#define OC_LOWER "abcdefghijklmnopqrstuvwxyz" +#define OC_LETTER OC_UPPER OC_LOWER +#define OC_LWS " \t\f\r" +#define OC_WS OC_LWS "\n" +#define OC_P "!\"#$%&'()*+,-./" OC_DIGIT ":;<=>?@" OC_UPPER "[\\]^_`" OC_LOWER "{|}~" +#define OC_PFCS OC_DIGIT OC_LETTER "._-" + +static const char oc_digit[] = OC_DIGIT; +static const char oc_xdigit[] = OC_XDIGIT; +static const char oc_upper[] = OC_UPPER; +static const char oc_lower[] = OC_LOWER; +static const char oc_letter[] = OC_LETTER; +static const char oc_lws[] = OC_LWS; +static const char oc_ws[] = OC_WS; +static const char oc_p[] = OC_P; +static const char oc_pfcs[] = OC_PFCS; + +#define T_OC(set) \ + T_FUNC(t_oc_##set, "is_" #set) \ + { \ + char crib[256]; \ + unsigned int i, ret; \ + \ + memset(crib, 0, sizeof crib); \ + for (i = 0; oc_##set[i]; ++i) \ + crib[(int)oc_##set[i]] = 1; \ + for (i = ret = 0; i < sizeof crib; ++i) { \ + if (is_##set(i) != crib[i]) { \ + t_verbose("is_%s() incorrect " \ + "for %#02x\n", #set, i); \ + ++ret; \ + } \ + } \ + return (ret == 0); \ + } + +T_OC(digit) +T_OC(xdigit) +T_OC(upper) +T_OC(lower) +T_OC(letter) +T_OC(lws) +T_OC(ws) +T_OC(p) +T_OC(pfcs) + + +/*************************************************************************** + * Boilerplate + */ + +const struct t_test *t_plan[] = { + T(t_oc_digit), + T(t_oc_xdigit), + T(t_oc_upper), + T(t_oc_lower), + T(t_oc_letter), + T(t_oc_lws), + T(t_oc_ws), + T(t_oc_p), + T(t_oc_pfcs), + NULL +}; + +const struct t_test ** +t_prepare(int argc, char *argv[]) +{ + + (void)argc; + (void)argv; + return (t_plan); +} + +void +t_cleanup(void) +{ +} From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 17:52:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDB647A1; Wed, 26 Feb 2014 17:52:53 +0000 (UTC) Received: from mail-ee0-x229.google.com (mail-ee0-x229.google.com [IPv6:2a00:1450:4013:c00::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D2DBD1562; Wed, 26 Feb 2014 17:52:52 +0000 (UTC) Received: by mail-ee0-f41.google.com with SMTP id b15so748952eek.14 for ; Wed, 26 Feb 2014 09:52:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=pVe2jDCxhOUGIA17gXl/LCrn0/zFC6r8aUcjWo7xOM0=; b=teo7Qd51d639S1hMI3KGeN7KUbMJUtIekeAYghz+IWjYqh/jueDd0kjkKUv5bDFNaN 6dkEQfH+PqIaVs9IVvix+2vvm0akvcrto6x0SP5qe8dkGAeZFHIQv9ZlKhI6nWt6g+Rm faD11j6Avr3s7iZfaPMjavNJQFr3YRwzaN952a7FZPpebXQngPBbXWwLKXdfs/iUuzOl 7ytYc6QAQv7QOgRNZnQzYKuH5++KGWD+cf3WtOjSg4zl/IlonbFy3G9/Idx7hrDSYz0t bxTrq7BunPQglG/VljuO5WHvhdzu0gdE3xNsKOi9HCP7QNKV/QdG0pn8TMg7fBU4S2za wrvQ== MIME-Version: 1.0 X-Received: by 10.204.26.69 with SMTP id d5mr83688bkc.47.1393437171252; Wed, 26 Feb 2014 09:52:51 -0800 (PST) Sender: chmeeedalf@gmail.com Received: by 10.205.21.68 with HTTP; Wed, 26 Feb 2014 09:52:51 -0800 (PST) In-Reply-To: <20140226013550.GA16841@raichu> References: <201402250258.s1P2wCDd060659@svn.freebsd.org> <20140226013550.GA16841@raichu> Date: Wed, 26 Feb 2014 09:52:51 -0800 X-Google-Sender-Auth: sbsQz6OmbPcygjhnqxcG48qxlPM Message-ID: Subject: Re: svn commit: r262466 - head/sys/cddl/dev/systrace From: Justin Hibbits To: Mark Johnston Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 17:52:53 -0000 On Tue, Feb 25, 2014 at 5:35 PM, Mark Johnston wrote: > On Tue, Feb 25, 2014 at 03:17:56PM -0800, Justin Hibbits wrote: >> I think this broke powerpc building. I see the following build failure: >> >> cc1: warnings being treated as errors >> /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c: >> In function 'systrace_probe': >> /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c:218: >> warning: function called through a non-compatible type >> /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c:218: >> note: if this code is reached, the program will abort >> > > Hi Justin, > > Sorry about this. I've reverted the commit. > > I realize that the change introduced undefined behaviour, but a similar > trick is used elsewhere in the DTrace code to pass extra arguments at a > probe site. Calling dtrace_probe() through a function pointer (patch > below) makes the warning go away, but I don't really understand why. > clang doesn't emit warnings in either case. > > Thanks, > -Mark > > diff --git a/sys/cddl/dev/systrace/systrace.c b/sys/cddl/dev/systrace/systrace.c > index 83f0793..5f4b82f 100644 > --- a/sys/cddl/dev/systrace/systrace.c > +++ b/sys/cddl/dev/systrace/systrace.c > @@ -168,8 +168,8 @@ static dtrace_pops_t systrace_pops = { > static struct cdev *systrace_cdev; > static dtrace_provider_id_t systrace_id; > > -typedef void (*systrace_dtrace_probe)(dtrace_id_t, uintptr_t, uintptr_t, > - uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); > +typedef void (*systrace_probe_t)(dtrace_id_t, uintptr_t, uintptr_t, uintptr_t, > + uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); > > #if !defined(LINUX_SYSTRACE) > /* > @@ -214,8 +214,9 @@ systrace_probe(u_int32_t id, int sysnum, struct sysent *sysent, void *params, > } > > /* Process the probe using the converted argments. */ > - ((systrace_dtrace_probe)(dtrace_probe))(id, uargs[0], uargs[1], > - uargs[2], uargs[3], uargs[4], uargs[5], uargs[6], uargs[7]); > + systrace_probe_t probe = (systrace_probe_t)dtrace_probe; > + probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4], > + uargs[5], uargs[6], uargs[7]); > } > > #endif Hi Mark, I think this patch works because it circumvents gcc's variable tracking. With the first patch, gcc knew the function that was being called, and knew it was undefined behavior. With the second patch, it only knows at that time that you're calling through a function pointer. It's completely forgotten that the function pointer is pointing to that function. Just a guess. I'll give it a go and let you know if it still complains. Thanks! - Justin From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 18:29:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E646389F; Wed, 26 Feb 2014 18:29:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B8D6119D4; Wed, 26 Feb 2014 18:29:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1QITE62039381; Wed, 26 Feb 2014 18:29:14 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1QITE3t039380; Wed, 26 Feb 2014 18:29:14 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402261829.s1QITE3t039380@svn.freebsd.org> From: Ian Lepore Date: Wed, 26 Feb 2014 18:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262531 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 18:29:15 -0000 Author: ian Date: Wed Feb 26 18:29:14 2014 New Revision: 262531 URL: http://svnweb.freebsd.org/changeset/base/262531 Log: Minor tweaks to the imx GPT timer... - Don't use spaces or dots in the eventtimer or timecounter names. They turn into sysctl node names, and it's just confusing. - Use comparator #3 instead of #1 for one-shot events. There's an extra 1-cycle penalty in the hardware for accessing the registers for comparator 1, no point in paying that penalty. - Lower the quality of the eventtimer from 1000 to 800, because the device can't support PERCPU timers and some other device in the system may be able to provide that. Modified: head/sys/arm/freescale/imx/imx_gpt.c Modified: head/sys/arm/freescale/imx/imx_gpt.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpt.c Wed Feb 26 17:14:02 2014 (r262530) +++ head/sys/arm/freescale/imx/imx_gpt.c Wed Feb 26 18:29:14 2014 (r262531) @@ -75,7 +75,7 @@ static int imx_gpt_probe(device_t); static int imx_gpt_attach(device_t); static struct timecounter imx_gpt_timecounter = { - .tc_name = "i.MX GPT Timecounter", + .tc_name = "iMXGPT", .tc_get_timecount = imx_gpt_get_timecount, .tc_counter_mask = ~0u, .tc_frequency = 0, @@ -244,9 +244,9 @@ imx_gpt_attach(device_t dev) } /* Register as an eventtimer. */ - sc->et.et_name = "i.MXxxx GPT Eventtimer"; + sc->et.et_name = "iMXGPT"; sc->et.et_flags = ET_FLAGS_ONESHOT | ET_FLAGS_PERIODIC; - sc->et.et_quality = 1000; + sc->et.et_quality = 800; sc->et.et_frequency = sc->clkfreq; sc->et.et_min_period = (MIN_ET_PERIOD << 32) / sc->et.et_frequency; sc->et.et_max_period = (0xfffffffeLLU << 32) / sc->et.et_frequency; @@ -286,9 +286,9 @@ imx_gpt_timer_start(struct eventtimer *e /* Do not disturb, otherwise event will be lost */ spinlock_enter(); /* Set expected value */ - WRITE4(sc, IMX_GPT_OCR1, READ4(sc, IMX_GPT_CNT) + ticks); + WRITE4(sc, IMX_GPT_OCR3, READ4(sc, IMX_GPT_CNT) + ticks); /* Enable compare register 1 Interrupt */ - SET4(sc, IMX_GPT_IR, GPT_IR_OF1); + SET4(sc, IMX_GPT_IR, GPT_IR_OF3); /* Now everybody can relax */ spinlock_exit(); return (0); @@ -349,7 +349,7 @@ imx_gpt_intr(void *arg) WRITE4(sc, IMX_GPT_SR, status); /* Handle one-shot timer events. */ - if (status & GPT_IR_OF1) { + if (status & GPT_IR_OF3) { if (sc->et.et_active) { sc->et.et_event_cb(&sc->et, sc->et.et_arg); } From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 19:14:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2406F664; Wed, 26 Feb 2014 19:14:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0EF8C102F; Wed, 26 Feb 2014 19:14:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1QJEsbr058737; Wed, 26 Feb 2014 19:14:54 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1QJEs2I058736; Wed, 26 Feb 2014 19:14:54 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201402261914.s1QJEs2I058736@svn.freebsd.org> From: Neel Natu Date: Wed, 26 Feb 2014 19:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262532 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 19:14:55 -0000 Author: neel Date: Wed Feb 26 19:14:54 2014 New Revision: 262532 URL: http://svnweb.freebsd.org/changeset/base/262532 Log: Document the "-a" and "-x" options to match the changes in r262236. Reviewed by: grehan Modified: head/usr.sbin/bhyve/bhyve.8 Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Wed Feb 26 18:29:14 2014 (r262531) +++ head/usr.sbin/bhyve/bhyve.8 Wed Feb 26 19:14:54 2014 (r262532) @@ -32,7 +32,7 @@ .Nd "run a guest operating system inside a virtual machine" .Sh SYNOPSIS .Nm -.Op Fl aehwAHPW +.Op Fl aehwxAHPW .Op Fl c Ar numcpus .Op Fl g Ar gdbport .Op Fl p Ar pinnedcpu @@ -58,7 +58,10 @@ exit is detected. .Sh OPTIONS .Bl -tag -width 10n .It Fl a -Disallow use of the local APIC in X2APIC mode. +The guest's local APIC is configured in xAPIC mode. + +The xAPIC mode is the default setting so this option is redundant. It will be +deprecated in a future version. .It Fl A Generate ACPI tables. Required for @@ -229,6 +232,8 @@ to exit when a guest issues an access to This is intended for debug purposes. .It Fl w Ignore accesses to unimplemented Model Specific Registers (MSRs). This is intended for debug purposes. +.It Fl x +The guest's local APIC is configured in x2APIC mode. .It Fl h Print help message and exit. .It Ar vmname From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 19:23:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA0D1A7C; Wed, 26 Feb 2014 19:23:55 +0000 (UTC) Received: from mail-qc0-x235.google.com (mail-qc0-x235.google.com [IPv6:2607:f8b0:400d:c01::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1FBF1117A; Wed, 26 Feb 2014 19:23:55 +0000 (UTC) Received: by mail-qc0-f181.google.com with SMTP id c9so2001040qcz.40 for ; Wed, 26 Feb 2014 11:23:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=/0AgBSkS/RFf89Y445VGfpORnBdLgbUBja/oWWifHaQ=; b=k5jVyVF9hlsfGebp7DU60TQNyVYmt/oMaUot2lcD8mJhG6TJXytZ8QNAolNSPDC8BS h7sMuZy0n64sHCIx2CqnrZ7XhENjPu8n51vpRVzyFwO6BrGRZSPGuP+qv1f/6BAs/QdB Vv/R0vUD8s4ACGSs7B1xF21YBxcSNj1bHL9t7NfDLp7O1OHXOKOk2/++keUJkhwaqfmS VqJ5WHTGwMGwAGrMYi0Yc1caBaokWQTxXJd1Fg7HL7xV0E3Y1L9ZlscAHHIjy84lAO2n rOBk+2uNDKSISqE8kMWIOJEUzBrRZCCelQOkwBlsJxj6+UeZN4N7k/FKDIteKc9FCe28 UZhQ== X-Received: by 10.224.96.138 with SMTP id h10mr4179949qan.46.1393442634274; Wed, 26 Feb 2014 11:23:54 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id 3sm5363775qan.15.2014.02.26.11.23.51 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 26 Feb 2014 11:23:53 -0800 (PST) Date: Wed, 26 Feb 2014 20:23:48 +0100 From: Mateusz Guzik To: John Baldwin Subject: Re: svn commit: r262309 - head/sys/kern Message-ID: <20140226192348.GA329@dft-labs.eu> References: <201402212229.s1LMT9BF093587@svn.freebsd.org> <201402251308.43875.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201402251308.43875.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 19:23:55 -0000 On Tue, Feb 25, 2014 at 01:08:43PM -0500, John Baldwin wrote: > On Friday, February 21, 2014 5:29:09 pm Mateusz Guzik wrote: > > Author: mjg > > Date: Fri Feb 21 22:29:09 2014 > > New Revision: 262309 > > URL: http://svnweb.freebsd.org/changeset/base/262309 > > > > Log: > > Fix a race between kern_proc_{o,}filedesc_out and fdescfree leading > > to use-after-free. > > > > fdescfree proceeds to free file pointers once fd_refcnt reaches 0, but > > kern_proc_{o,}filedesc_out only checked for hold count. > > Can you describe the race in more detail? The kern_* routines hold > FILEDESC_SLOCK() while they read the file which should prevent > fdescfree() from free'ing any files. Note that fdfree() (called > under FILEDESC_XLOCK() clears the file pointer to NULL via the > bzero(), so the sysctl handler should only see non-NULL pointers > for files that are not yet free'd. > oops, you are right. I somehow misread the code. Still, the change is harmless and matches other loop which iterates the table (see sysctl_kern_file), so I think it can stay. Other thing is that with that change in place we can get rid of XLOCK/XUNLOCK around fdfree in fdescfree. -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 20:29:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1149CA4E; Wed, 26 Feb 2014 20:29:51 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D7933183F; Wed, 26 Feb 2014 20:29:50 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A17CDB96E; Wed, 26 Feb 2014 15:29:49 -0500 (EST) From: John Baldwin To: Mateusz Guzik Subject: Re: svn commit: r262309 - head/sys/kern Date: Wed, 26 Feb 2014 15:29:31 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201402212229.s1LMT9BF093587@svn.freebsd.org> <201402251308.43875.jhb@freebsd.org> <20140226192348.GA329@dft-labs.eu> In-Reply-To: <20140226192348.GA329@dft-labs.eu> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201402261529.31942.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 26 Feb 2014 15:29:49 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 20:29:51 -0000 On Wednesday, February 26, 2014 2:23:48 pm Mateusz Guzik wrote: > On Tue, Feb 25, 2014 at 01:08:43PM -0500, John Baldwin wrote: > > On Friday, February 21, 2014 5:29:09 pm Mateusz Guzik wrote: > > > Author: mjg > > > Date: Fri Feb 21 22:29:09 2014 > > > New Revision: 262309 > > > URL: http://svnweb.freebsd.org/changeset/base/262309 > > > > > > Log: > > > Fix a race between kern_proc_{o,}filedesc_out and fdescfree leading > > > to use-after-free. > > > > > > fdescfree proceeds to free file pointers once fd_refcnt reaches 0, but > > > kern_proc_{o,}filedesc_out only checked for hold count. > > > > Can you describe the race in more detail? The kern_* routines hold > > FILEDESC_SLOCK() while they read the file which should prevent > > fdescfree() from free'ing any files. Note that fdfree() (called > > under FILEDESC_XLOCK() clears the file pointer to NULL via the > > bzero(), so the sysctl handler should only see non-NULL pointers > > for files that are not yet free'd. > > > > oops, you are right. I somehow misread the code. > > Still, the change is harmless and matches other loop which iterates the > table (see sysctl_kern_file), so I think it can stay. Actually, I think that should be undone. That was a hacky workaround for a long time ago when the FILEDESC locking wasn't a simple sx lock but was a mtx + sleep lock combo thing that had fast and slow variants. > Other thing is that with that change in place we can get rid of > XLOCK/XUNLOCK around fdfree in fdescfree. I would rather remove the fd_refcnt checks, or do them differently (not in the loop). Right now a reader might be confused to think that fd_refcnt can change within the loop when it cannot and then worry about unhandled races that don't exist (i.e. if fd_refcnt can change within the loop, what prevents the individual file objects from being freed out from under the loop?) I originally thought just that when I saw this commit and was going to note that your change was not a true fix and still left the race open until I found upon further investigation that your change was just noise since there wasn't a race to begin with. In the interest of clarity, please either remove the fd_refcnt checks from these loops (including sysctl_kern_file) or fix all three of them to do a single check after the SLOCK() but before the for loop itself. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 20:58:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49A36369; Wed, 26 Feb 2014 20:58:29 +0000 (UTC) Received: from mail-ee0-x22c.google.com (mail-ee0-x22c.google.com [IPv6:2a00:1450:4013:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5CA921ACE; Wed, 26 Feb 2014 20:58:28 +0000 (UTC) Received: by mail-ee0-f44.google.com with SMTP id d49so878180eek.31 for ; Wed, 26 Feb 2014 12:58:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=DkQZPPfaS9BS4iCvfRR/LTS3dU5A7GD2SHgCwYsfNMI=; b=tXOJ6uqYON4NV/gP9Rp1ohkekWSFFeneQU4wmLCe+BSJX/fSIAdfvIOcod0xiG0bdD tDHi/xLNWUmC5kdSrYVor//Q5lJIlZVpIzGpDwmQMI7oK4kw3OoI+VKUfqTi7gUPsBOw r9SDyrtaC8IJKXHdWL8XTQB2kGxKh9jRO67WIRXextEPo1vy19LaRKiN9W9Pxq2Q3mg6 Xr50VLZSWeVNU8+gz0mS7wikorZzdViCJEp9bZCndEwLM/XXj9JeIQ4rVxW4RZ20tuGh x66Fc39Z/wpIN4Hdhp+6qO/FPaCg1Ra5b9ZM5pXDVdidW1TjTYc3Y/TNlSGmzjX7CSit BybA== MIME-Version: 1.0 X-Received: by 10.204.96.205 with SMTP id i13mr3220499bkn.20.1393448305690; Wed, 26 Feb 2014 12:58:25 -0800 (PST) Sender: chmeeedalf@gmail.com Received: by 10.205.21.68 with HTTP; Wed, 26 Feb 2014 12:58:25 -0800 (PST) In-Reply-To: References: <201402250258.s1P2wCDd060659@svn.freebsd.org> <20140226013550.GA16841@raichu> Date: Wed, 26 Feb 2014 12:58:25 -0800 X-Google-Sender-Auth: Ui2BXv9t99dxJ_4BWEoSJY-ox5k Message-ID: Subject: Re: svn commit: r262466 - head/sys/cddl/dev/systrace From: Justin Hibbits To: Mark Johnston Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 20:58:29 -0000 On Wed, Feb 26, 2014 at 9:52 AM, Justin Hibbits wrote: > On Tue, Feb 25, 2014 at 5:35 PM, Mark Johnston wrote: >> On Tue, Feb 25, 2014 at 03:17:56PM -0800, Justin Hibbits wrote: >>> I think this broke powerpc building. I see the following build failure: >>> >>> cc1: warnings being treated as errors >>> /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c: >>> In function 'systrace_probe': >>> /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c:218: >>> warning: function called through a non-compatible type >>> /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c:218: >>> note: if this code is reached, the program will abort >>> >> >> Hi Justin, >> >> Sorry about this. I've reverted the commit. >> >> I realize that the change introduced undefined behaviour, but a similar >> trick is used elsewhere in the DTrace code to pass extra arguments at a >> probe site. Calling dtrace_probe() through a function pointer (patch >> below) makes the warning go away, but I don't really understand why. >> clang doesn't emit warnings in either case. >> >> Thanks, >> -Mark >> >> diff --git a/sys/cddl/dev/systrace/systrace.c b/sys/cddl/dev/systrace/systrace.c >> index 83f0793..5f4b82f 100644 >> --- a/sys/cddl/dev/systrace/systrace.c >> +++ b/sys/cddl/dev/systrace/systrace.c >> @@ -168,8 +168,8 @@ static dtrace_pops_t systrace_pops = { >> static struct cdev *systrace_cdev; >> static dtrace_provider_id_t systrace_id; >> >> -typedef void (*systrace_dtrace_probe)(dtrace_id_t, uintptr_t, uintptr_t, >> - uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); >> +typedef void (*systrace_probe_t)(dtrace_id_t, uintptr_t, uintptr_t, uintptr_t, >> + uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); >> >> #if !defined(LINUX_SYSTRACE) >> /* >> @@ -214,8 +214,9 @@ systrace_probe(u_int32_t id, int sysnum, struct sysent *sysent, void *params, >> } >> >> /* Process the probe using the converted argments. */ >> - ((systrace_dtrace_probe)(dtrace_probe))(id, uargs[0], uargs[1], >> - uargs[2], uargs[3], uargs[4], uargs[5], uargs[6], uargs[7]); >> + systrace_probe_t probe = (systrace_probe_t)dtrace_probe; >> + probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4], >> + uargs[5], uargs[6], uargs[7]); >> } >> >> #endif > > > Hi Mark, > > I think this patch works because it circumvents gcc's variable > tracking. With the first patch, gcc knew the function that was being > called, and knew it was undefined behavior. With the second patch, it > only knows at that time that you're calling through a function > pointer. It's completely forgotten that the function pointer is > pointing to that function. Just a guess. I'll give it a go and let > you know if it still complains. > > Thanks! > > - Justin Just tested and confirmed it builds successfully. - Justin From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 21:22:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6BFDF2A; Wed, 26 Feb 2014 21:22:07 +0000 (UTC) Received: from mail-qc0-x233.google.com (mail-qc0-x233.google.com [IPv6:2607:f8b0:400d:c01::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 334FD1D53; Wed, 26 Feb 2014 21:22:07 +0000 (UTC) Received: by mail-qc0-f179.google.com with SMTP id r5so2224822qcx.38 for ; Wed, 26 Feb 2014 13:22:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=mYtHy65xIqcP3Ip2nZMQyqQiDEQ/9mi3OKa/fTOuZt0=; b=lS8bqLglwyF4HhMnFywz+cEpZfodR2deVTzmcsVYBhoeGVJUnzxlB0Bdahf67RoA1s 2ToMn//Ujid8Kkd3fhPPnxrOiGZRxJfIow9MoCgQ+QR8ht/+mbZMM9jkfYYDlvG4lFAW 0za3fyUzUJVqMc+vr/WXkFFa8SxA5653aP36su8Cf5gvqM/LHQhLksgmeSix0OB1LW3G 6EGzOYeUKpQucDw8MRbpcd2Yg7TrK1QFdCKZM45GXnJKdPI7VXLw98ywcts6BofKN4Mg VWNDLUVbNooFoB8A6FBxnVpObJar5q+Y25KBReaJurYC5rIIye1Z6pS+uh2FfYlvZbt+ k8yA== X-Received: by 10.140.108.138 with SMTP id j10mr2430093qgf.7.1393449726287; Wed, 26 Feb 2014 13:22:06 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id d7sm6369173qad.10.2014.02.26.13.22.04 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 26 Feb 2014 13:22:05 -0800 (PST) Date: Wed, 26 Feb 2014 22:22:00 +0100 From: Mateusz Guzik To: John Baldwin Subject: Re: svn commit: r262309 - head/sys/kern Message-ID: <20140226212200.GB329@dft-labs.eu> References: <201402212229.s1LMT9BF093587@svn.freebsd.org> <201402251308.43875.jhb@freebsd.org> <20140226192348.GA329@dft-labs.eu> <201402261529.31942.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201402261529.31942.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 21:22:07 -0000 On Wed, Feb 26, 2014 at 03:29:31PM -0500, John Baldwin wrote: > On Wednesday, February 26, 2014 2:23:48 pm Mateusz Guzik wrote: > > On Tue, Feb 25, 2014 at 01:08:43PM -0500, John Baldwin wrote: > > > On Friday, February 21, 2014 5:29:09 pm Mateusz Guzik wrote: > > > > Author: mjg > > > > Date: Fri Feb 21 22:29:09 2014 > > > > New Revision: 262309 > > > > URL: http://svnweb.freebsd.org/changeset/base/262309 > > > > > > > > Log: > > > > Fix a race between kern_proc_{o,}filedesc_out and fdescfree leading > > > > to use-after-free. > > > > > > > > fdescfree proceeds to free file pointers once fd_refcnt reaches 0, but > > > > kern_proc_{o,}filedesc_out only checked for hold count. > > > > > > Can you describe the race in more detail? The kern_* routines hold > > > FILEDESC_SLOCK() while they read the file which should prevent > > > fdescfree() from free'ing any files. Note that fdfree() (called > > > under FILEDESC_XLOCK() clears the file pointer to NULL via the > > > bzero(), so the sysctl handler should only see non-NULL pointers > > > for files that are not yet free'd. > > > > > > > oops, you are right. I somehow misread the code. > > > > Still, the change is harmless and matches other loop which iterates the > > table (see sysctl_kern_file), so I think it can stay. > > Actually, I think that should be undone. That was a hacky workaround for > a long time ago when the FILEDESC locking wasn't a simple sx lock but was > a mtx + sleep lock combo thing that had fast and slow variants. > > > Other thing is that with that change in place we can get rid of > > XLOCK/XUNLOCK around fdfree in fdescfree. > > I would rather remove the fd_refcnt checks, or do them differently (not > in the loop). Right now a reader might be confused to think that > fd_refcnt can change within the loop when it cannot and then worry about > unhandled races that don't exist (i.e. if fd_refcnt can change within > the loop, what prevents the individual file objects from being freed out > from under the loop?) > But it can change. kern_proc_filedesc_out calls export_fd_to_sb which drops the lock for each fp and sysctl_kern_proc_ofiledesc drops the lock when dealing with vnodes. As far as I can say all this is safe - either data is refed (vref on a vnode) or the lock is still held while the data is being read, so by the time fp can be freed it is no longer used. > I originally thought just that when I saw this commit and was going to > note that your change was not a true fix and still left the race open > until I found upon further investigation that your change was just > noise since there wasn't a race to begin with. In the interest of > clarity, please either remove the fd_refcnt checks from these loops > (including sysctl_kern_file) or fix all three of them to do a single > check after the SLOCK() but before the for loop itself. My original misread of the code was that fdescfree can proceed to free files and functions I modified would encounter a stale fp once lock was taken. A side effect of my change is that if we happen to catch exiting process, we may end up giving up instead of checking for mostly now-null pointers. -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 21:35:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08EE65A7; Wed, 26 Feb 2014 21:35:34 +0000 (UTC) Received: from tensor.andric.com (unknown [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B747A1F60; Wed, 26 Feb 2014 21:35:33 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::e036:2b37:6205:a71a] (unknown [IPv6:2001:7b8:3a7:0:e036:2b37:6205:a71a]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id C9D7D5C45; Wed, 26 Feb 2014 22:35:23 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_0AE5CE0E-93B0-4626-AA14-E1671EBFDB63"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r262480 - head/sys/dev/syscons From: Dimitry Andric In-Reply-To: <20140226121936.GA79819@zxy.spb.ru> Date: Wed, 26 Feb 2014 22:33:42 +0100 Message-Id: <7017470D-60C4-41FA-83B7-24F36D026551@FreeBSD.org> References: <201402251348.s1PDm5Zp030180@svn.freebsd.org> <20140226121936.GA79819@zxy.spb.ru> To: Slawa Olhovchenkov X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Julio Merino , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 21:35:34 -0000 --Apple-Mail=_0AE5CE0E-93B0-4626-AA14-E1671EBFDB63 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 26 Feb 2014, at 13:19, Slawa Olhovchenkov wrote: > On Tue, Feb 25, 2014 at 01:48:05PM +0000, Julio Merino wrote: > >> Author: jmmv >> Date: Tue Feb 25 13:48:05 2014 >> New Revision: 262480 >> URL: http://svnweb.freebsd.org/changeset/base/262480 >> >> Log: >> Increase maximum number of columns to support 1980x1200 displays. > > What about support 4K display? No problem, just send us a few, so we can properly implement it! ;-) -Dimitry --Apple-Mail=_0AE5CE0E-93B0-4626-AA14-E1671EBFDB63 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlMOXb4ACgkQsF6jCi4glqPEgQCfacUY7MzFjnfP19G8QBnO+mh+ 7uAAnjkn4LN96ys9nanWnHHL5j9VLqEK =Y1Ol -----END PGP SIGNATURE----- --Apple-Mail=_0AE5CE0E-93B0-4626-AA14-E1671EBFDB63-- From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 21:38:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80CCA70C; Wed, 26 Feb 2014 21:38:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6D01F1F89; Wed, 26 Feb 2014 21:38:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1QLchf0015475; Wed, 26 Feb 2014 21:38:43 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1QLchL0015473; Wed, 26 Feb 2014 21:38:43 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201402262138.s1QLchL0015473@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 26 Feb 2014 21:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262533 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 21:38:43 -0000 Author: jilles Date: Wed Feb 26 21:38:42 2014 New Revision: 262533 URL: http://svnweb.freebsd.org/changeset/base/262533 Log: sh: Make expari() static. Modified: head/bin/sh/expand.c head/bin/sh/expand.h Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Wed Feb 26 19:14:54 2014 (r262532) +++ head/bin/sh/expand.c Wed Feb 26 21:38:42 2014 (r262533) @@ -100,6 +100,7 @@ static struct arglist exparg; /* holds static void argstr(char *, int); static char *exptilde(char *, int); +static void expari(int); static void expbackq(union node *, int, int); static int subevalvar(char *, char *, int, int, int, int, int); static char *evalvar(char *, int); @@ -390,7 +391,7 @@ removerecordregions(int endoff) * Expand arithmetic expression. Backup to start of expression, * evaluate, place result in (backed up) result, adjust string position. */ -void +static void expari(int flag) { char *p, *q, *start; Modified: head/bin/sh/expand.h ============================================================================== --- head/bin/sh/expand.h Wed Feb 26 19:14:54 2014 (r262532) +++ head/bin/sh/expand.h Wed Feb 26 21:38:42 2014 (r262533) @@ -58,6 +58,5 @@ struct arglist { union node; void expandarg(union node *, struct arglist *, int); -void expari(int); void rmescapes(char *); int casematch(union node *, const char *); From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 22:06:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF1C62E8; Wed, 26 Feb 2014 22:06:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 997141201; Wed, 26 Feb 2014 22:06:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1QM6CY1028957; Wed, 26 Feb 2014 22:06:12 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1QM6Aw7028945; Wed, 26 Feb 2014 22:06:10 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402262206.s1QM6Aw7028945@svn.freebsd.org> From: Ian Lepore Date: Wed, 26 Feb 2014 22:06:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262534 - in head/sys/arm: allwinner arm broadcom/bcm2835 freescale/imx include lpc mv ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 22:06:12 -0000 Author: ian Date: Wed Feb 26 22:06:10 2014 New Revision: 262534 URL: http://svnweb.freebsd.org/changeset/base/262534 Log: Replace many pasted identical definitions of cpu_initclocks() with a common implementation in arm/machdep.c. Most arm platforms either don't need to do anything, or just need to call the standard eventtimer init routines. A generic implementation that does that is now provided via weak linkage. Any platform that needs to do something different can provide a its own implementation to override the generic one. Modified: head/sys/arm/allwinner/timer.c head/sys/arm/arm/generic_timer.c head/sys/arm/arm/machdep.c head/sys/arm/arm/mpcore_timer.c head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c head/sys/arm/freescale/imx/imx_gpt.c head/sys/arm/include/machdep.h head/sys/arm/lpc/lpc_timer.c head/sys/arm/mv/timer.c head/sys/arm/ti/am335x/am335x_dmtimer.c Modified: head/sys/arm/allwinner/timer.c ============================================================================== --- head/sys/arm/allwinner/timer.c Wed Feb 26 21:38:42 2014 (r262533) +++ head/sys/arm/allwinner/timer.c Wed Feb 26 22:06:10 2014 (r262534) @@ -295,12 +295,6 @@ a10_timer_get_timerfreq(struct a10_timer return (sc->timer0_freq); } -void -cpu_initclocks(void) -{ - cpu_initclocks_bsp(); -} - static int a10_timer_hardclock(void *arg) { Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Wed Feb 26 21:38:42 2014 (r262533) +++ head/sys/arm/arm/generic_timer.c Wed Feb 26 22:06:10 2014 (r262534) @@ -332,16 +332,6 @@ static devclass_t arm_tmr_devclass; DRIVER_MODULE(timer, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0); void -cpu_initclocks(void) -{ - - if (PCPU_GET(cpuid) == 0) - cpu_initclocks_bsp(); - else - cpu_initclocks_ap(); -} - -void DELAY(int usec) { int32_t counts, counts_per_usec; Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Wed Feb 26 21:38:42 2014 (r262533) +++ head/sys/arm/arm/machdep.c Wed Feb 26 22:06:10 2014 (r262534) @@ -456,6 +456,30 @@ cpu_idle_wakeup(int cpu) return (0); } +/* + * Most ARM platforms don't need to do anything special to init their clocks + * (they get intialized during normal device attachment), and by not defining a + * cpu_initclocks() function they get this generic one. Any platform that needs + * to do something special can just provide their own implementation, which will + * override this one due to the weak linkage. + */ +void +arm_generic_initclocks(void) +{ + +#ifndef NO_EVENTTIMERS +#ifdef SMP + if (PCPU_GET(cpuid) == 0) + cpu_initclocks_bsp(); + else + cpu_initclocks_ap(); +#else + cpu_initclocks_bsp(); +#endif +#endif +} +__weak_reference(arm_generic_initclocks, cpu_initclocks); + int fill_regs(struct thread *td, struct reg *regs) { Modified: head/sys/arm/arm/mpcore_timer.c ============================================================================== --- head/sys/arm/arm/mpcore_timer.c Wed Feb 26 21:38:42 2014 (r262533) +++ head/sys/arm/arm/mpcore_timer.c Wed Feb 26 22:06:10 2014 (r262534) @@ -359,25 +359,6 @@ static devclass_t arm_tmr_devclass; DRIVER_MODULE(mp_tmr, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0); /** - * cpu_initclocks - called by system to initialise the cpu clocks - * - * This is a boilerplat function, most of the setup has already been done - * when the driver was attached. Therefore this function must only be called - * after the driver is attached. - * - * RETURNS - * nothing - */ -void -cpu_initclocks(void) -{ - if (PCPU_GET(cpuid) == 0) - cpu_initclocks_bsp(); - else - cpu_initclocks_ap(); -} - -/** * DELAY - Delay for at least usec microseconds. * @usec: number of microseconds to delay by * Modified: head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c Wed Feb 26 21:38:42 2014 (r262533) +++ head/sys/arm/broadcom/bcm2835/bcm2835_systimer.c Wed Feb 26 22:06:10 2014 (r262534) @@ -278,12 +278,6 @@ static devclass_t bcm_systimer_devclass; DRIVER_MODULE(bcm_systimer, simplebus, bcm_systimer_driver, bcm_systimer_devclass, 0, 0); void -cpu_initclocks(void) -{ - cpu_initclocks_bsp(); -} - -void DELAY(int usec) { int32_t counts; Modified: head/sys/arm/freescale/imx/imx_gpt.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpt.c Wed Feb 26 21:38:42 2014 (r262533) +++ head/sys/arm/freescale/imx/imx_gpt.c Wed Feb 26 22:06:10 2014 (r262534) @@ -319,17 +319,6 @@ imx_gpt_get_timerfreq(struct imx_gpt_sof return (sc->clkfreq); } -void -cpu_initclocks(void) -{ - - if (imx_gpt_sc == NULL) { - panic("%s: i.MX GPT driver has not been initialized!", __func__); - } - - cpu_initclocks_bsp(); -} - static int imx_gpt_intr(void *arg) { Modified: head/sys/arm/include/machdep.h ============================================================================== --- head/sys/arm/include/machdep.h Wed Feb 26 21:38:42 2014 (r262533) +++ head/sys/arm/include/machdep.h Wed Feb 26 22:06:10 2014 (r262534) @@ -32,6 +32,7 @@ vm_offset_t freebsd_parse_boot_param(str vm_offset_t linux_parse_boot_param(struct arm_boot_params *abp); vm_offset_t fake_preload_metadata(struct arm_boot_params *abp); vm_offset_t parse_boot_param(struct arm_boot_params *abp); +void arm_generic_initclocks(void); /* * Initialization functions called by the common initarm() function in Modified: head/sys/arm/lpc/lpc_timer.c ============================================================================== --- head/sys/arm/lpc/lpc_timer.c Wed Feb 26 21:38:42 2014 (r262533) +++ head/sys/arm/lpc/lpc_timer.c Wed Feb 26 22:06:10 2014 (r262534) @@ -280,12 +280,6 @@ lpc_get_timecount(struct timecounter *tc } void -cpu_initclocks(void) -{ - cpu_initclocks_bsp(); -} - -void DELAY(int usec) { uint32_t counter; Modified: head/sys/arm/mv/timer.c ============================================================================== --- head/sys/arm/mv/timer.c Wed Feb 26 21:38:42 2014 (r262533) +++ head/sys/arm/mv/timer.c Wed Feb 26 22:06:10 2014 (r262534) @@ -224,13 +224,6 @@ mv_timer_get_timecount(struct timecounte } void -cpu_initclocks(void) -{ - - cpu_initclocks_bsp(); -} - -void DELAY(int usec) { uint32_t val, val_temp; Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_dmtimer.c Wed Feb 26 21:38:42 2014 (r262533) +++ head/sys/arm/ti/am335x/am335x_dmtimer.c Wed Feb 26 22:06:10 2014 (r262534) @@ -662,12 +662,6 @@ DRIVER_MODULE(am335x_dmtimer, simplebus, MODULE_DEPEND(am335x_dmtimer, am335x_prcm, 1, 1, 1); void -cpu_initclocks(void) -{ - cpu_initclocks_bsp(); -} - -void DELAY(int usec) { struct am335x_dmtimer_softc *sc; From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 00:43:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03084682; Thu, 27 Feb 2014 00:43:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E1B561FD7; Thu, 27 Feb 2014 00:43:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1R0hA09098506; Thu, 27 Feb 2014 00:43:10 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1R0hAU9098502; Thu, 27 Feb 2014 00:43:10 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402270043.s1R0hAU9098502@svn.freebsd.org> From: Eitan Adler Date: Thu, 27 Feb 2014 00:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262539 - in head: sys/compat/linprocfs usr.bin/makewhatis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 00:43:11 -0000 Author: eadler Date: Thu Feb 27 00:43:10 2014 New Revision: 262539 URL: http://svnweb.freebsd.org/changeset/base/262539 Log: linprocfs: add support for /sys/kernel/random/uuid PR: kern/186187 Submitted by: Fernando MFC After: 2 weeks Modified: head/sys/compat/linprocfs/linprocfs.c head/usr.bin/makewhatis/makewhatis.1 head/usr.bin/makewhatis/makewhatis.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Wed Feb 26 23:03:10 2014 (r262538) +++ head/sys/compat/linprocfs/linprocfs.c Thu Feb 27 00:43:10 2014 (r262539) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1337,6 +1338,22 @@ linprocfs_dofdescfs(PFS_FILL_ARGS) return (0); } + +/* + * Filler function for proc/sys/kernel/random/uuid + */ +static int +linprocfs_douuid(PFS_FILL_ARGS) +{ + struct uuid uuid; + + kern_uuidgen(&uuid, 1); + sbuf_printf_uuid(sb, &uuid); + sbuf_printf(sb, "\n"); + return(0); +} + + /* * Constructor */ @@ -1436,6 +1453,11 @@ linprocfs_init(PFS_INIT_ARGS) pfs_create_file(dir, "sem", &linprocfs_dosem, NULL, NULL, NULL, PFS_RD); + /* /proc/sys/kernel/random/... */ + dir = pfs_create_dir(dir, "random", NULL, NULL, NULL, 0); + pfs_create_file(dir, "uuid", &linprocfs_douuid, + NULL, NULL, NULL, PFS_RD); + return (0); } Modified: head/usr.bin/makewhatis/makewhatis.1 ============================================================================== --- head/usr.bin/makewhatis/makewhatis.1 Wed Feb 26 23:03:10 2014 (r262538) +++ head/usr.bin/makewhatis/makewhatis.1 Thu Feb 27 00:43:10 2014 (r262539) @@ -24,12 +24,12 @@ .\" .\" $FreeBSD$ .\" -.Dd December 3, 2005 -.Dt MAKEWHATIS 1 +.Dd December 8, 2013 +.Dt MAKEWHATIS 8 .Os .Sh NAME .Nm makewhatis -.Nd "create whatis database" +.Nd create whatis database .Sh SYNOPSIS .Nm .Op Fl a @@ -98,9 +98,6 @@ option is used. .It Ev MACHINE If set, its value is used to override the current machine type when searching machine specific subdirectories. -.It Ev MACHINE_ARCH -If set, its value is used to override the current -architecture when searching architecture specific subdirectories. .It Ev MANPATH Determines the set of directories to be processed if none are given on the command line. @@ -133,4 +130,6 @@ program was originally written in Perl a The current version of .Nm was rewritten in C by -.An John Rochester . +.An John Rochester +with additional contributions by +.An Franco Fichtner Aq Mt franco@lastsummer.de . Modified: head/usr.bin/makewhatis/makewhatis.c ============================================================================== --- head/usr.bin/makewhatis/makewhatis.c Wed Feb 26 23:03:10 2014 (r262538) +++ head/usr.bin/makewhatis/makewhatis.c Thu Feb 27 00:43:10 2014 (r262539) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2002 John Rochester + * Copyright (c) 2013 Franco Fichtner * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,21 +25,19 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ */ -#include -__FBSDID("$FreeBSD$"); - +#include #include -#include #include #include -#include +#include #include #include #include -#include #include #include #include @@ -52,16 +51,56 @@ __FBSDID("$FreeBSD$"); static char blank[] = ""; /* - * Information collected about each man page in a section. + * Information collected about each man page alias. + */ +struct page_alias { + RB_ENTRY(page_alias) entry; + char *filename; + char *name; + char *suffix; + int gzipped; +}; + +/* + * Information collected about each unique man page. */ struct page_info { - char * filename; - char * name; - char * suffix; - int gzipped; - ino_t inode; + RB_HEAD(page_alias_tree, page_alias) head; + RB_ENTRY(page_info) entry; + ino_t inode; }; +static RB_HEAD(page_info_tree, page_info) page_head = RB_INITIALIZER(&page_head); + +/* + * Sorts page info by inode number. + */ +static int +infosort(const struct page_info *a, const struct page_info *b) +{ + return (memcmp(&a->inode, &b->inode, sizeof(a->inode))); +} + +RB_PROTOTYPE(page_info_tree, page_info, entry, infosort); +RB_GENERATE(page_info_tree, page_info, entry, infosort); + +/* + * Sorts page alias first by suffix, then name. + */ +static int +aliassort(const struct page_alias *a, const struct page_alias *b) +{ + int ret = strcmp(a->suffix, b->suffix); + if (ret) { + return (ret); + } + + return (strcmp(a->name, b->name)); +} + +RB_PROTOTYPE(page_alias_tree, page_alias, entry, aliassort); +RB_GENERATE(page_alias_tree, page_alias, entry, aliassort); + /* * An entry kept for each visited directory. */ @@ -100,7 +139,7 @@ static const char *whatis_name="whatis"; static char *common_output; /* -o option: the single output file */ static char *locale; /* user's locale if -L is used */ static char *lang_locale; /* short form of locale */ -static const char *machine, *machine_arch; +static const char *machine; static int exit_code; /* exit code to use when finished */ static SLIST_HEAD(, visited_dir) visited_dirs = @@ -132,62 +171,66 @@ static char mdoc_commands[] = "ArDvErEvF static void free_page_info(struct page_info *info) { - free(info->filename); - free(info->name); - free(info->suffix); + struct page_alias *alias; + + while ((alias = RB_ROOT(&info->head))) { + RB_REMOVE(page_alias_tree, &info->head, alias); + free(alias->filename); + free(alias->suffix); + free(alias->name); + free(alias); + } + free(info); } /* - * Allocates and fills in a new struct page_info given the - * name of the man section directory and the dirent of the file. - * If the file is not a man page, returns NULL. + * Allocates and fills in a new struct page_alias given the + * full file name of the man page and its dirent. + * If the file is not a man page, nothing is added. */ -static struct page_info * -new_page_info(char *dir, struct dirent *dirent) +static void +new_page_alias(struct page_info *info, char *filename, struct dirent *dirent) { - struct page_info *info; - int basename_length; + int gzipped, basename_length; + struct page_alias *alias; char *suffix; - struct stat st; - info = (struct page_info *) malloc(sizeof(struct page_info)); - if (info == NULL) - err(1, "malloc"); basename_length = strlen(dirent->d_name); suffix = &dirent->d_name[basename_length]; - asprintf(&info->filename, "%s/%s", dir, dirent->d_name); - if ((info->gzipped = basename_length >= 4 && strcmp(&dirent->d_name[basename_length - 3], ".gz") == 0)) { + + gzipped = basename_length >= 4 && + strcmp(&dirent->d_name[basename_length - 3], ".gz") == 0; + if (gzipped) { suffix -= 3; *suffix = '\0'; } + for (;;) { if (--suffix == dirent->d_name || !isalnum(*suffix)) { - if (*suffix == '.') + if (*suffix == '.') { break; - if (verbose) - warnx("%s: invalid man page name", info->filename); - free(info->filename); - free(info); - return NULL; + } + if (verbose) { + warnx("%s: invalid man page name", filename); + } + return; } } + *suffix++ = '\0'; - info->name = strdup(dirent->d_name); - info->suffix = strdup(suffix); - if (stat(info->filename, &st) < 0) { - warn("%s", info->filename); - free_page_info(info); - return NULL; - } - if (!S_ISREG(st.st_mode)) { - if (verbose && !S_ISDIR(st.st_mode)) - warnx("%s: not a regular file", info->filename); - free_page_info(info); - return NULL; + + alias = malloc(sizeof(*alias)); + if (alias == NULL) { + err(1, "malloc"); } - info->inode = st.st_ino; - return info; + + alias->name = strdup(dirent->d_name); /* XXX unsafe */ + alias->filename = strdup(filename); /* XXX unsafe */ + alias->suffix = strdup(suffix); /* XXX unsafe */ + alias->gzipped = gzipped; + + RB_INSERT(page_alias_tree, &info->head, alias); } /* @@ -206,10 +249,10 @@ static struct sbuf * new_sbuf(void) { struct sbuf *sbuf = (struct sbuf *) malloc(sizeof(struct sbuf)); - sbuf->content = (char *) malloc(LINE_ALLOC); + sbuf->content = malloc(LINE_ALLOC); sbuf->last = sbuf->content + LINE_ALLOC - 1; sbuf_clear(sbuf); - return sbuf; + return(sbuf); } /* @@ -227,7 +270,7 @@ sbuf_need(struct sbuf *sbuf, int nchars) size *= 2; cntsize = sbuf->end - sbuf->content; - new_content = (char *)malloc(size); + new_content = malloc(size); memcpy(new_content, sbuf->content, cntsize); free(sbuf->content); sbuf->content = new_content; @@ -288,29 +331,7 @@ static char * sbuf_content(struct sbuf *sbuf) { *sbuf->end = '\0'; - return sbuf->content; -} - -/* - * Returns true if no man page exists in the directory with - * any of the names in the StringList. - */ -static int -no_page_exists(char *dir, StringList *names, char *suffix) -{ - char path[MAXPATHLEN]; - size_t i; - - for (i = 0; i < names->sl_cur; i++) { - snprintf(path, sizeof path, "%s/%s.%s.gz", dir, names->sl_str[i], suffix); - if (access(path, F_OK) < 0) { - path[strlen(path) - 3] = '\0'; - if (access(path, F_OK) < 0) - continue; - } - return 0; - } - return 1; + return(sbuf->content); } static void @@ -337,7 +358,7 @@ open_output(char *name) if (output == NULL) { warn("%s", name); exit_code = 1; - return NULL; + return(NULL); } while (fgets(line, sizeof line, output) != NULL) { line[strlen(line) - 1] = '\0'; @@ -352,15 +373,15 @@ open_output(char *name) if (output == NULL) { warn("%s", name); exit_code = 1; - return NULL; + return(NULL); } - return output; + return(output); } static int linesort(const void *a, const void *b) { - return strcmp((*(const char * const *)a), (*(const char * const *)b)); + return(strcmp((*(const char * const *)a), (*(const char * const *)b))); } /* @@ -372,7 +393,8 @@ finish_output(FILE *output, char *name) size_t i; char *prev = NULL; - qsort(whatis_lines->sl_str, whatis_lines->sl_cur, sizeof(char *), linesort); + qsort(whatis_lines->sl_str, whatis_lines->sl_cur, sizeof(char *), + linesort); for (i = 0; i < whatis_lines->sl_cur; i++) { char *line = whatis_lines->sl_str[i]; if (i > 0 && strcmp(line, prev) == 0) @@ -395,7 +417,7 @@ open_whatis(char *mandir) char filename[MAXPATHLEN]; snprintf(filename, sizeof filename, "%s/%s", mandir, whatis_name); - return open_output(filename); + return(open_output(filename)); } static void @@ -419,20 +441,20 @@ already_visited(char *dir) if (stat(dir, &st) < 0) { warn("%s", dir); exit_code = 1; - return 1; + return(1); } SLIST_FOREACH(visit, &visited_dirs, next) { if (visit->inode == st.st_ino && visit->device == st.st_dev) { warnx("already visited %s", dir); - return 1; + return(1); } } visit = (struct visited_dir *) malloc(sizeof(struct visited_dir)); visit->device = st.st_dev; visit->inode = st.st_ino; SLIST_INSERT_HEAD(&visited_dirs, visit, next); - return 0; + return(0); } /* @@ -446,7 +468,7 @@ trim_rhs(char *str) while (--rhs > str && isspace(*rhs)) ; *++rhs = '\0'; - return rhs; + return(rhs); } /* @@ -457,7 +479,7 @@ skip_spaces(char *s) { while (*s != '\0' && isspace(*s)) s++; - return s; + return(s); } /* @@ -467,10 +489,10 @@ static int only_digits(char *line) { if (!isdigit(*line++)) - return 0; + return(0); while (isdigit(*line)) line++; - return *line == '\0'; + return(*line == '\0'); } /* @@ -487,7 +509,7 @@ name_section_line(char *line, const char const char **title; if (strncmp(line, section_start, 3) != 0) - return 0; + return(0); line = skip_spaces(line + 3); rhs = trim_rhs(line); if (*line == '"') { @@ -497,8 +519,8 @@ name_section_line(char *line, const char } for (title = name_section_titles; *title != NULL; title++) if (strcmp(*title, line) == 0) - return 1; - return 0; + return(1); + return(0); } /* @@ -518,7 +540,7 @@ de_nroff_copy(char *from, char *to, int switch (*++from) { case '(': if (strncmp(&from[1], "em", 2) == 0 || - strncmp(&from[1], "mi", 2) == 0) { + strncmp(&from[1], "mi", 2) == 0) { from += 3; continue; } @@ -534,7 +556,8 @@ de_nroff_copy(char *from, char *to, int if (*++from == '(') from += 3; else if (*from == '[') { - while (*++from != ']' && from < from_end); + while (*++from != ']' && from < from_end) + ; from++; } else from++; @@ -547,7 +570,7 @@ de_nroff_copy(char *from, char *to, int } *to++ = *from++; } - return to; + return(to); } /* @@ -594,6 +617,38 @@ process_man_line(char *line) } } +struct mdoc_text { + const char *mdoc; + const char *text; +}; + +static int +process_mdoc_macro(char *line) +{ + static const struct mdoc_text list[] = { + { ".At", "AT&T UNIX" }, + { ".Bsx", "BSD/OS" }, + { ".Bx", "BSD" }, + { ".Dx", "DragonFly" }, + { ".Fx", "FreeBSD" }, + { ".Nx", "NetBSD" }, + { ".Ox", "OpenBSD" }, + { ".Ux", "UNIX" }, + }; + unsigned int i; + + for (i = 0; i < sizeof(list) / sizeof(list[0]); ++i) { + if (!strcmp(line, list[i].mdoc)) { + sbuf_append(whatis_proto, list[i].text, + strlen(list[i].text)); + sbuf_append(whatis_proto, " ", 1); + return (1); + } + } + + return (0); +} + /* * Processes a new-style mdoc(7) line. */ @@ -613,6 +668,9 @@ process_mdoc_line(char *line) sbuf_append(whatis_proto, " ", 1); return; } + if (process_mdoc_macro(line)) { + return; + } xref = strncmp(line, ".Xr", 3) == 0; line += 3; while ((line = skip_spaces(line)) < line_end) { @@ -663,27 +721,6 @@ process_mdoc_line(char *line) sbuf_append(whatis_proto, " ", 1); } -/* - * Collects a list of comma-separated names from the text. - */ -static void -collect_names(StringList *names, char *text) -{ - char *arg; - - for (;;) { - arg = text; - text = strchr(text, ','); - if (text != NULL) - *text++ = '\0'; - sl_add(names, arg); - if (text == NULL) - return; - if (*text == ' ') - text++; - } -} - enum { STATE_UNKNOWN, STATE_MANSTYLE, STATE_MDOCNAME, STATE_MDOCDESC }; /* @@ -691,25 +728,33 @@ enum { STATE_UNKNOWN, STATE_MANSTYLE, ST * to whatis_lines. */ static void -process_page(struct page_info *page, char *section_dir) +process_page(struct page_info *info) { - gzFile in; - char buffer[4096]; - char *line; - StringList *names; - char *descr; int state = STATE_UNKNOWN; - size_t i; + struct page_alias *alias; + char *line, *descr; + char buffer[4096]; + gzFile in; + + /* + * Only read the page once for each inode. It's + * safe to assume that page->list is set. + */ + alias = RB_MIN(page_alias_tree, &info->head); + + if (verbose) { + fprintf(stderr, "\treading %s\n", alias->filename); + } sbuf_clear(whatis_proto); - if ((in = gzopen(page->filename, "r")) == NULL) { - warn("%s", page->filename); + if ((in = gzopen(alias->filename, "r")) == NULL) { + warn("%s", alias->filename); exit_code = 1; return; } - while (gzgets(in, buffer, sizeof buffer) != NULL) { + while (gzgets(in, buffer, sizeof(buffer)) != NULL) { line = buffer; - if (strncmp(line, ".\\\"", 3) == 0) /* ignore comments */ + if (strncmp(line, ".\\\"", 3) == 0) /* ignore comments */ continue; switch (state) { /* @@ -779,7 +824,9 @@ process_page(struct page_info *page, cha descr = strchr(line, ' '); if (descr == NULL) { if (verbose) - fprintf(stderr, " ignoring junk description \"%s\"\n", line); + fprintf(stderr, + "\tignoring junk description \"%s\"\n", + line); return; } *descr++ = '\0'; @@ -787,19 +834,16 @@ process_page(struct page_info *page, cha *descr = '\0'; descr += 3; } - names = sl_init(); - collect_names(names, line); sbuf_clear(whatis_final); - if (!sl_find(names, page->name) && no_page_exists(section_dir, names, page->suffix)) { + RB_FOREACH(alias, page_alias_tree, &info->head) { /* - * Add the page name since that's the only thing that - * man(1) will find. + * This won't append names stored in `line'. + * The reason for that is that we cannot be sure + * which section they belong to unless we have + * a real alias (via MLINKS) in this list. */ - add_whatis_name(page->name, page->suffix); + add_whatis_name(alias->name, alias->suffix); } - for (i = 0; i < names->sl_cur; i++) - add_whatis_name(names->sl_str[i], page->suffix); - sl_free(names, 0); sbuf_retract(whatis_final, 2); /* remove last ", " */ while (sbuf_length(whatis_final) < indent) sbuf_append(whatis_final, " ", 1); @@ -809,33 +853,19 @@ process_page(struct page_info *page, cha } /* - * Sorts pages first by inode number, then by name. - */ -static int -pagesort(const void *a, const void *b) -{ - const struct page_info *p1 = *(struct page_info * const *) a; - const struct page_info *p2 = *(struct page_info * const *) b; - if (p1->inode == p2->inode) - return strcmp(p1->name, p2->name); - return p1->inode - p2->inode; -} - -/* * Processes a single man section. */ static void process_section(char *section_dir) { struct dirent **entries; + struct page_info *info; int nentries; - struct page_info **pages; - int npages = 0; int i; - ino_t prev_inode = 0; - if (verbose) + if (verbose) { fprintf(stderr, " %s\n", section_dir); + } /* * scan the man section directory for pages @@ -846,33 +876,55 @@ process_section(char *section_dir) exit_code = 1; return; } + /* * collect information about man pages */ - pages = (struct page_info **) calloc(nentries, sizeof(struct page_info *)); for (i = 0; i < nentries; i++) { - struct page_info *info = new_page_info(section_dir, entries[i]); - if (info != NULL) - pages[npages++] = info; + struct page_info ref; + char *filename; + struct stat st; + + if (asprintf(&filename, "%s/%s", section_dir, + entries[i]->d_name) < 0) { + err(1, "malloc"); + } + + if (stat(filename, &st) < 0) { + warn("%s", filename); + goto process_section_next; + } + + if (!S_ISREG(st.st_mode)) { + if (verbose && !S_ISDIR(st.st_mode)) + warnx("%s: not a regular file", filename); + goto process_section_next; + } + + ref.inode = st.st_ino; + + info = RB_FIND(page_info_tree, &page_head, &ref); + if (info == NULL) { + info = malloc(sizeof(*info)); + if (info == NULL) { + err(1, "malloc"); + } + + bzero(info, sizeof(*info)); + info->inode = st.st_ino; + RB_INIT(&info->head); + + RB_INSERT(page_info_tree, &page_head, info); + } + + new_page_alias(info, filename, entries[i]); + +process_section_next: + free(entries[i]); + free(filename); } free(entries); - qsort(pages, npages, sizeof(struct page_info *), pagesort); - /* - * process each unique page - */ - for (i = 0; i < npages; i++) { - struct page_info *page = pages[i]; - if (page->inode != prev_inode) { - prev_inode = page->inode; - if (verbose) - fprintf(stderr, " reading %s\n", page->filename); - process_page(page, section_dir); - } else if (verbose) - fprintf(stderr, " skipping %s, duplicate\n", page->filename); - free_page_info(page); - } - free(pages); } /* @@ -884,12 +936,12 @@ select_sections(const struct dirent *ent const char *p = &entry->d_name[3]; if (strncmp(entry->d_name, "man", 3) != 0) - return 0; + return(0); while (*p != '\0') { if (!isalnum(*p++)) - return 0; + return(0); } - return 1; + return(1); } /* @@ -900,6 +952,7 @@ static void process_mandir(char *dir_name) { struct dirent **entries; + struct page_info *info; int nsections; FILE *fp = NULL; int i; @@ -919,21 +972,26 @@ process_mandir(char *dir_name) return; for (i = 0; i < nsections; i++) { char section_dir[MAXPATHLEN]; - snprintf(section_dir, sizeof section_dir, "%s/%s", dir_name, entries[i]->d_name); + snprintf(section_dir, sizeof section_dir, "%s/%s", dir_name, + entries[i]->d_name); process_section(section_dir); snprintf(section_dir, sizeof section_dir, "%s/%s/%s", dir_name, - entries[i]->d_name, machine); + entries[i]->d_name, machine); if (stat(section_dir, &st) == 0 && S_ISDIR(st.st_mode)) process_section(section_dir); - if (strcmp(machine_arch, machine) != 0) { - snprintf(section_dir, sizeof section_dir, "%s/%s/%s", - dir_name, entries[i]->d_name, machine_arch); - if (stat(section_dir, &st) == 0 && S_ISDIR(st.st_mode)) - process_section(section_dir); - } free(entries[i]); } free(entries); + + /* + * process and free all pages + */ + while ((info = RB_ROOT(&page_head))) { + RB_REMOVE(page_info_tree, &page_head, info); + process_page(info); + free_page_info(info); + } + if (common_output == NULL) finish_whatis(fp, dir_name); } @@ -1003,7 +1061,9 @@ main(int argc, char **argv) char *sep = strchr(locale, '_'); if (sep != NULL && isupper(sep[1]) && isupper(sep[2])) { - asprintf(&lang_locale, "%.*s%s", (int)(ptrdiff_t)(sep - locale), locale, &sep[3]); + asprintf(&lang_locale, "%.*s%s", + (int)(sep - locale), + locale, &sep[3]); } } break; @@ -1021,16 +1081,8 @@ main(int argc, char **argv) whatis_proto = new_sbuf(); whatis_final = new_sbuf(); - if ((machine = getenv("MACHINE")) == NULL) { - static struct utsname utsname; - - if (uname(&utsname) == -1) - err(1, "uname"); - machine = utsname.machine; - } - - if ((machine_arch = getenv("MACHINE_ARCH")) == NULL) - machine_arch = MACHINE_ARCH; + if ((machine = getenv("MACHINE")) == NULL) + machine = MACHINE; if (common_output != NULL && (fp = open_output(common_output)) == NULL) err(1, "%s", common_output); From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 00:52:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFC7795B; Thu, 27 Feb 2014 00:52:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C7D2F10C7; Thu, 27 Feb 2014 00:52:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1R0qYlX002939; Thu, 27 Feb 2014 00:52:34 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1R0qYah002937; Thu, 27 Feb 2014 00:52:34 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402270052.s1R0qYah002937@svn.freebsd.org> From: Eitan Adler Date: Thu, 27 Feb 2014 00:52:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262540 - head/usr.bin/makewhatis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 00:52:35 -0000 Author: eadler Date: Thu Feb 27 00:52:34 2014 New Revision: 262540 URL: http://svnweb.freebsd.org/changeset/base/262540 Log: I had some unrelated (wrong) changes to makewhatis. Undo them. Modified: head/usr.bin/makewhatis/makewhatis.1 head/usr.bin/makewhatis/makewhatis.c Modified: head/usr.bin/makewhatis/makewhatis.1 ============================================================================== --- head/usr.bin/makewhatis/makewhatis.1 Thu Feb 27 00:43:10 2014 (r262539) +++ head/usr.bin/makewhatis/makewhatis.1 Thu Feb 27 00:52:34 2014 (r262540) @@ -24,12 +24,12 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2013 -.Dt MAKEWHATIS 8 +.Dd December 3, 2005 +.Dt MAKEWHATIS 1 .Os .Sh NAME .Nm makewhatis -.Nd create whatis database +.Nd "create whatis database" .Sh SYNOPSIS .Nm .Op Fl a @@ -98,6 +98,9 @@ option is used. .It Ev MACHINE If set, its value is used to override the current machine type when searching machine specific subdirectories. +.It Ev MACHINE_ARCH +If set, its value is used to override the current +architecture when searching architecture specific subdirectories. .It Ev MANPATH Determines the set of directories to be processed if none are given on the command line. @@ -130,6 +133,4 @@ program was originally written in Perl a The current version of .Nm was rewritten in C by -.An John Rochester -with additional contributions by -.An Franco Fichtner Aq Mt franco@lastsummer.de . +.An John Rochester . Modified: head/usr.bin/makewhatis/makewhatis.c ============================================================================== --- head/usr.bin/makewhatis/makewhatis.c Thu Feb 27 00:43:10 2014 (r262539) +++ head/usr.bin/makewhatis/makewhatis.c Thu Feb 27 00:52:34 2014 (r262540) @@ -1,6 +1,5 @@ /*- * Copyright (c) 2002 John Rochester - * Copyright (c) 2013 Franco Fichtner * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,19 +24,21 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ -#include +#include +__FBSDID("$FreeBSD$"); + #include +#include #include #include -#include +#include #include #include #include +#include #include #include #include @@ -51,56 +52,16 @@ static char blank[] = ""; /* - * Information collected about each man page alias. - */ -struct page_alias { - RB_ENTRY(page_alias) entry; - char *filename; - char *name; - char *suffix; - int gzipped; -}; - -/* - * Information collected about each unique man page. + * Information collected about each man page in a section. */ struct page_info { - RB_HEAD(page_alias_tree, page_alias) head; - RB_ENTRY(page_info) entry; - ino_t inode; + char * filename; + char * name; + char * suffix; + int gzipped; + ino_t inode; }; -static RB_HEAD(page_info_tree, page_info) page_head = RB_INITIALIZER(&page_head); - -/* - * Sorts page info by inode number. - */ -static int -infosort(const struct page_info *a, const struct page_info *b) -{ - return (memcmp(&a->inode, &b->inode, sizeof(a->inode))); -} - -RB_PROTOTYPE(page_info_tree, page_info, entry, infosort); -RB_GENERATE(page_info_tree, page_info, entry, infosort); - -/* - * Sorts page alias first by suffix, then name. - */ -static int -aliassort(const struct page_alias *a, const struct page_alias *b) -{ - int ret = strcmp(a->suffix, b->suffix); - if (ret) { - return (ret); - } - - return (strcmp(a->name, b->name)); -} - -RB_PROTOTYPE(page_alias_tree, page_alias, entry, aliassort); -RB_GENERATE(page_alias_tree, page_alias, entry, aliassort); - /* * An entry kept for each visited directory. */ @@ -139,7 +100,7 @@ static const char *whatis_name="whatis"; static char *common_output; /* -o option: the single output file */ static char *locale; /* user's locale if -L is used */ static char *lang_locale; /* short form of locale */ -static const char *machine; +static const char *machine, *machine_arch; static int exit_code; /* exit code to use when finished */ static SLIST_HEAD(, visited_dir) visited_dirs = @@ -171,66 +132,62 @@ static char mdoc_commands[] = "ArDvErEvF static void free_page_info(struct page_info *info) { - struct page_alias *alias; - - while ((alias = RB_ROOT(&info->head))) { - RB_REMOVE(page_alias_tree, &info->head, alias); - free(alias->filename); - free(alias->suffix); - free(alias->name); - free(alias); - } - + free(info->filename); + free(info->name); + free(info->suffix); free(info); } /* - * Allocates and fills in a new struct page_alias given the - * full file name of the man page and its dirent. - * If the file is not a man page, nothing is added. + * Allocates and fills in a new struct page_info given the + * name of the man section directory and the dirent of the file. + * If the file is not a man page, returns NULL. */ -static void -new_page_alias(struct page_info *info, char *filename, struct dirent *dirent) +static struct page_info * +new_page_info(char *dir, struct dirent *dirent) { - int gzipped, basename_length; - struct page_alias *alias; + struct page_info *info; + int basename_length; char *suffix; + struct stat st; + info = (struct page_info *) malloc(sizeof(struct page_info)); + if (info == NULL) + err(1, "malloc"); basename_length = strlen(dirent->d_name); suffix = &dirent->d_name[basename_length]; - - gzipped = basename_length >= 4 && - strcmp(&dirent->d_name[basename_length - 3], ".gz") == 0; - if (gzipped) { + asprintf(&info->filename, "%s/%s", dir, dirent->d_name); + if ((info->gzipped = basename_length >= 4 && strcmp(&dirent->d_name[basename_length - 3], ".gz") == 0)) { suffix -= 3; *suffix = '\0'; } - for (;;) { if (--suffix == dirent->d_name || !isalnum(*suffix)) { - if (*suffix == '.') { + if (*suffix == '.') break; - } - if (verbose) { - warnx("%s: invalid man page name", filename); - } - return; + if (verbose) + warnx("%s: invalid man page name", info->filename); + free(info->filename); + free(info); + return NULL; } } - *suffix++ = '\0'; - - alias = malloc(sizeof(*alias)); - if (alias == NULL) { - err(1, "malloc"); + info->name = strdup(dirent->d_name); + info->suffix = strdup(suffix); + if (stat(info->filename, &st) < 0) { + warn("%s", info->filename); + free_page_info(info); + return NULL; } - - alias->name = strdup(dirent->d_name); /* XXX unsafe */ - alias->filename = strdup(filename); /* XXX unsafe */ - alias->suffix = strdup(suffix); /* XXX unsafe */ - alias->gzipped = gzipped; - - RB_INSERT(page_alias_tree, &info->head, alias); + if (!S_ISREG(st.st_mode)) { + if (verbose && !S_ISDIR(st.st_mode)) + warnx("%s: not a regular file", info->filename); + free_page_info(info); + return NULL; + } + info->inode = st.st_ino; + return info; } /* @@ -249,10 +206,10 @@ static struct sbuf * new_sbuf(void) { struct sbuf *sbuf = (struct sbuf *) malloc(sizeof(struct sbuf)); - sbuf->content = malloc(LINE_ALLOC); + sbuf->content = (char *) malloc(LINE_ALLOC); sbuf->last = sbuf->content + LINE_ALLOC - 1; sbuf_clear(sbuf); - return(sbuf); + return sbuf; } /* @@ -270,7 +227,7 @@ sbuf_need(struct sbuf *sbuf, int nchars) size *= 2; cntsize = sbuf->end - sbuf->content; - new_content = malloc(size); + new_content = (char *)malloc(size); memcpy(new_content, sbuf->content, cntsize); free(sbuf->content); sbuf->content = new_content; @@ -331,7 +288,29 @@ static char * sbuf_content(struct sbuf *sbuf) { *sbuf->end = '\0'; - return(sbuf->content); + return sbuf->content; +} + +/* + * Returns true if no man page exists in the directory with + * any of the names in the StringList. + */ +static int +no_page_exists(char *dir, StringList *names, char *suffix) +{ + char path[MAXPATHLEN]; + size_t i; + + for (i = 0; i < names->sl_cur; i++) { + snprintf(path, sizeof path, "%s/%s.%s.gz", dir, names->sl_str[i], suffix); + if (access(path, F_OK) < 0) { + path[strlen(path) - 3] = '\0'; + if (access(path, F_OK) < 0) + continue; + } + return 0; + } + return 1; } static void @@ -358,7 +337,7 @@ open_output(char *name) if (output == NULL) { warn("%s", name); exit_code = 1; - return(NULL); + return NULL; } while (fgets(line, sizeof line, output) != NULL) { line[strlen(line) - 1] = '\0'; @@ -373,15 +352,15 @@ open_output(char *name) if (output == NULL) { warn("%s", name); exit_code = 1; - return(NULL); + return NULL; } - return(output); + return output; } static int linesort(const void *a, const void *b) { - return(strcmp((*(const char * const *)a), (*(const char * const *)b))); + return strcmp((*(const char * const *)a), (*(const char * const *)b)); } /* @@ -393,8 +372,7 @@ finish_output(FILE *output, char *name) size_t i; char *prev = NULL; - qsort(whatis_lines->sl_str, whatis_lines->sl_cur, sizeof(char *), - linesort); + qsort(whatis_lines->sl_str, whatis_lines->sl_cur, sizeof(char *), linesort); for (i = 0; i < whatis_lines->sl_cur; i++) { char *line = whatis_lines->sl_str[i]; if (i > 0 && strcmp(line, prev) == 0) @@ -417,7 +395,7 @@ open_whatis(char *mandir) char filename[MAXPATHLEN]; snprintf(filename, sizeof filename, "%s/%s", mandir, whatis_name); - return(open_output(filename)); + return open_output(filename); } static void @@ -441,20 +419,20 @@ already_visited(char *dir) if (stat(dir, &st) < 0) { warn("%s", dir); exit_code = 1; - return(1); + return 1; } SLIST_FOREACH(visit, &visited_dirs, next) { if (visit->inode == st.st_ino && visit->device == st.st_dev) { warnx("already visited %s", dir); - return(1); + return 1; } } visit = (struct visited_dir *) malloc(sizeof(struct visited_dir)); visit->device = st.st_dev; visit->inode = st.st_ino; SLIST_INSERT_HEAD(&visited_dirs, visit, next); - return(0); + return 0; } /* @@ -468,7 +446,7 @@ trim_rhs(char *str) while (--rhs > str && isspace(*rhs)) ; *++rhs = '\0'; - return(rhs); + return rhs; } /* @@ -479,7 +457,7 @@ skip_spaces(char *s) { while (*s != '\0' && isspace(*s)) s++; - return(s); + return s; } /* @@ -489,10 +467,10 @@ static int only_digits(char *line) { if (!isdigit(*line++)) - return(0); + return 0; while (isdigit(*line)) line++; - return(*line == '\0'); + return *line == '\0'; } /* @@ -509,7 +487,7 @@ name_section_line(char *line, const char const char **title; if (strncmp(line, section_start, 3) != 0) - return(0); + return 0; line = skip_spaces(line + 3); rhs = trim_rhs(line); if (*line == '"') { @@ -519,8 +497,8 @@ name_section_line(char *line, const char } for (title = name_section_titles; *title != NULL; title++) if (strcmp(*title, line) == 0) - return(1); - return(0); + return 1; + return 0; } /* @@ -540,7 +518,7 @@ de_nroff_copy(char *from, char *to, int switch (*++from) { case '(': if (strncmp(&from[1], "em", 2) == 0 || - strncmp(&from[1], "mi", 2) == 0) { + strncmp(&from[1], "mi", 2) == 0) { from += 3; continue; } @@ -556,8 +534,7 @@ de_nroff_copy(char *from, char *to, int if (*++from == '(') from += 3; else if (*from == '[') { - while (*++from != ']' && from < from_end) - ; + while (*++from != ']' && from < from_end); from++; } else from++; @@ -570,7 +547,7 @@ de_nroff_copy(char *from, char *to, int } *to++ = *from++; } - return(to); + return to; } /* @@ -617,38 +594,6 @@ process_man_line(char *line) } } -struct mdoc_text { - const char *mdoc; - const char *text; -}; - -static int -process_mdoc_macro(char *line) -{ - static const struct mdoc_text list[] = { - { ".At", "AT&T UNIX" }, - { ".Bsx", "BSD/OS" }, - { ".Bx", "BSD" }, - { ".Dx", "DragonFly" }, - { ".Fx", "FreeBSD" }, - { ".Nx", "NetBSD" }, - { ".Ox", "OpenBSD" }, - { ".Ux", "UNIX" }, - }; - unsigned int i; - - for (i = 0; i < sizeof(list) / sizeof(list[0]); ++i) { - if (!strcmp(line, list[i].mdoc)) { - sbuf_append(whatis_proto, list[i].text, - strlen(list[i].text)); - sbuf_append(whatis_proto, " ", 1); - return (1); - } - } - - return (0); -} - /* * Processes a new-style mdoc(7) line. */ @@ -668,9 +613,6 @@ process_mdoc_line(char *line) sbuf_append(whatis_proto, " ", 1); return; } - if (process_mdoc_macro(line)) { - return; - } xref = strncmp(line, ".Xr", 3) == 0; line += 3; while ((line = skip_spaces(line)) < line_end) { @@ -721,6 +663,27 @@ process_mdoc_line(char *line) sbuf_append(whatis_proto, " ", 1); } +/* + * Collects a list of comma-separated names from the text. + */ +static void +collect_names(StringList *names, char *text) +{ + char *arg; + + for (;;) { + arg = text; + text = strchr(text, ','); + if (text != NULL) + *text++ = '\0'; + sl_add(names, arg); + if (text == NULL) + return; + if (*text == ' ') + text++; + } +} + enum { STATE_UNKNOWN, STATE_MANSTYLE, STATE_MDOCNAME, STATE_MDOCDESC }; /* @@ -728,33 +691,25 @@ enum { STATE_UNKNOWN, STATE_MANSTYLE, ST * to whatis_lines. */ static void -process_page(struct page_info *info) +process_page(struct page_info *page, char *section_dir) { - int state = STATE_UNKNOWN; - struct page_alias *alias; - char *line, *descr; - char buffer[4096]; gzFile in; - - /* - * Only read the page once for each inode. It's - * safe to assume that page->list is set. - */ - alias = RB_MIN(page_alias_tree, &info->head); - - if (verbose) { - fprintf(stderr, "\treading %s\n", alias->filename); - } + char buffer[4096]; + char *line; + StringList *names; + char *descr; + int state = STATE_UNKNOWN; + size_t i; sbuf_clear(whatis_proto); - if ((in = gzopen(alias->filename, "r")) == NULL) { - warn("%s", alias->filename); + if ((in = gzopen(page->filename, "r")) == NULL) { + warn("%s", page->filename); exit_code = 1; return; } - while (gzgets(in, buffer, sizeof(buffer)) != NULL) { + while (gzgets(in, buffer, sizeof buffer) != NULL) { line = buffer; - if (strncmp(line, ".\\\"", 3) == 0) /* ignore comments */ + if (strncmp(line, ".\\\"", 3) == 0) /* ignore comments */ continue; switch (state) { /* @@ -824,9 +779,7 @@ process_page(struct page_info *info) descr = strchr(line, ' '); if (descr == NULL) { if (verbose) - fprintf(stderr, - "\tignoring junk description \"%s\"\n", - line); + fprintf(stderr, " ignoring junk description \"%s\"\n", line); return; } *descr++ = '\0'; @@ -834,16 +787,19 @@ process_page(struct page_info *info) *descr = '\0'; descr += 3; } + names = sl_init(); + collect_names(names, line); sbuf_clear(whatis_final); - RB_FOREACH(alias, page_alias_tree, &info->head) { + if (!sl_find(names, page->name) && no_page_exists(section_dir, names, page->suffix)) { /* - * This won't append names stored in `line'. - * The reason for that is that we cannot be sure - * which section they belong to unless we have - * a real alias (via MLINKS) in this list. + * Add the page name since that's the only thing that + * man(1) will find. */ - add_whatis_name(alias->name, alias->suffix); + add_whatis_name(page->name, page->suffix); } + for (i = 0; i < names->sl_cur; i++) + add_whatis_name(names->sl_str[i], page->suffix); + sl_free(names, 0); sbuf_retract(whatis_final, 2); /* remove last ", " */ while (sbuf_length(whatis_final) < indent) sbuf_append(whatis_final, " ", 1); @@ -853,19 +809,33 @@ process_page(struct page_info *info) } /* + * Sorts pages first by inode number, then by name. + */ +static int +pagesort(const void *a, const void *b) +{ + const struct page_info *p1 = *(struct page_info * const *) a; + const struct page_info *p2 = *(struct page_info * const *) b; + if (p1->inode == p2->inode) + return strcmp(p1->name, p2->name); + return p1->inode - p2->inode; +} + +/* * Processes a single man section. */ static void process_section(char *section_dir) { struct dirent **entries; - struct page_info *info; int nentries; + struct page_info **pages; + int npages = 0; int i; + ino_t prev_inode = 0; - if (verbose) { + if (verbose) fprintf(stderr, " %s\n", section_dir); - } /* * scan the man section directory for pages @@ -876,55 +846,33 @@ process_section(char *section_dir) exit_code = 1; return; } - /* * collect information about man pages */ + pages = (struct page_info **) calloc(nentries, sizeof(struct page_info *)); for (i = 0; i < nentries; i++) { - struct page_info ref; - char *filename; - struct stat st; - - if (asprintf(&filename, "%s/%s", section_dir, - entries[i]->d_name) < 0) { - err(1, "malloc"); - } - - if (stat(filename, &st) < 0) { - warn("%s", filename); - goto process_section_next; - } - - if (!S_ISREG(st.st_mode)) { - if (verbose && !S_ISDIR(st.st_mode)) - warnx("%s: not a regular file", filename); - goto process_section_next; - } - - ref.inode = st.st_ino; - - info = RB_FIND(page_info_tree, &page_head, &ref); - if (info == NULL) { - info = malloc(sizeof(*info)); - if (info == NULL) { - err(1, "malloc"); - } - - bzero(info, sizeof(*info)); - info->inode = st.st_ino; - RB_INIT(&info->head); - - RB_INSERT(page_info_tree, &page_head, info); - } - - new_page_alias(info, filename, entries[i]); - -process_section_next: - + struct page_info *info = new_page_info(section_dir, entries[i]); + if (info != NULL) + pages[npages++] = info; free(entries[i]); - free(filename); } free(entries); + qsort(pages, npages, sizeof(struct page_info *), pagesort); + /* + * process each unique page + */ + for (i = 0; i < npages; i++) { + struct page_info *page = pages[i]; + if (page->inode != prev_inode) { + prev_inode = page->inode; + if (verbose) + fprintf(stderr, " reading %s\n", page->filename); + process_page(page, section_dir); + } else if (verbose) + fprintf(stderr, " skipping %s, duplicate\n", page->filename); + free_page_info(page); + } + free(pages); } /* @@ -936,12 +884,12 @@ select_sections(const struct dirent *ent const char *p = &entry->d_name[3]; if (strncmp(entry->d_name, "man", 3) != 0) - return(0); + return 0; while (*p != '\0') { if (!isalnum(*p++)) - return(0); + return 0; } - return(1); + return 1; } /* @@ -952,7 +900,6 @@ static void process_mandir(char *dir_name) { struct dirent **entries; - struct page_info *info; int nsections; FILE *fp = NULL; int i; @@ -972,26 +919,21 @@ process_mandir(char *dir_name) return; for (i = 0; i < nsections; i++) { char section_dir[MAXPATHLEN]; - snprintf(section_dir, sizeof section_dir, "%s/%s", dir_name, - entries[i]->d_name); + snprintf(section_dir, sizeof section_dir, "%s/%s", dir_name, entries[i]->d_name); process_section(section_dir); snprintf(section_dir, sizeof section_dir, "%s/%s/%s", dir_name, - entries[i]->d_name, machine); + entries[i]->d_name, machine); if (stat(section_dir, &st) == 0 && S_ISDIR(st.st_mode)) process_section(section_dir); + if (strcmp(machine_arch, machine) != 0) { + snprintf(section_dir, sizeof section_dir, "%s/%s/%s", + dir_name, entries[i]->d_name, machine_arch); + if (stat(section_dir, &st) == 0 && S_ISDIR(st.st_mode)) + process_section(section_dir); + } free(entries[i]); } free(entries); - - /* - * process and free all pages - */ - while ((info = RB_ROOT(&page_head))) { - RB_REMOVE(page_info_tree, &page_head, info); - process_page(info); - free_page_info(info); - } - if (common_output == NULL) finish_whatis(fp, dir_name); } @@ -1061,9 +1003,7 @@ main(int argc, char **argv) char *sep = strchr(locale, '_'); if (sep != NULL && isupper(sep[1]) && isupper(sep[2])) { - asprintf(&lang_locale, "%.*s%s", - (int)(sep - locale), - locale, &sep[3]); + asprintf(&lang_locale, "%.*s%s", (int)(ptrdiff_t)(sep - locale), locale, &sep[3]); } } break; @@ -1081,8 +1021,16 @@ main(int argc, char **argv) whatis_proto = new_sbuf(); whatis_final = new_sbuf(); - if ((machine = getenv("MACHINE")) == NULL) - machine = MACHINE; + if ((machine = getenv("MACHINE")) == NULL) { + static struct utsname utsname; + + if (uname(&utsname) == -1) + err(1, "uname"); + machine = utsname.machine; + } + + if ((machine_arch = getenv("MACHINE_ARCH")) == NULL) + machine_arch = MACHINE_ARCH; if (common_output != NULL && (fp = open_output(common_output)) == NULL) err(1, "%s", common_output); From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 00:54:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C828ACA for ; Thu, 27 Feb 2014 00:54:26 +0000 (UTC) Received: from mail-qa0-x22c.google.com (mail-qa0-x22c.google.com [IPv6:2607:f8b0:400d:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 50B6610E3 for ; Thu, 27 Feb 2014 00:54:26 +0000 (UTC) Received: by mail-qa0-f44.google.com with SMTP id f11so3174494qae.17 for ; Wed, 26 Feb 2014 16:54:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=477DYCqwcZ44qu7yXvpRG37SwzY7e3TdS/oL39J4UCE=; b=hH/XvC5j4uMeoZ1aZtEGcNJ2qBUpxza3pWr+FvFsyeaYiaJXynqukgAWwgBKYUoSPn Z53fTC5U9KJhX9kGmOWeZZ711oy17of2EmSHGAeoEXIsQjM01CWUzdrmGeW6lKIxK+Fx PDzPbOEAU1T+wPYMyTqReW76FHlpZ3pMSSqZg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:content-type; bh=477DYCqwcZ44qu7yXvpRG37SwzY7e3TdS/oL39J4UCE=; b=NSKwmPOnpsJxSmDgcwFIXqN75RKg408TR7mT9WhmU/hcAfXo0l/fel3uCzqhU7G+tz TIXBqC4C32lm7uPJLZKzk2NyV3pfSqxFiC7+rlzPPprofbimbLBnJd2H8rSPbOR0+O5q JZAlqq+b0IgtmwYaT53irpWnTQKSToWhYdmnqLypXNKqKIhloztwKaKWAe2W3/I9xCl7 XblCqGvan3HLuUPDrehcUhNlzCJkXjjyFuP7DSAYMPBX/gD7BO0gWTDlcA9x96auwKoM 1OQb6vbxiZX3PlofnsESVgzoYz2tTSPyzt1EWTMQBOXTVEOavcL86Vs/vrtbCABLHepk s9Ww== X-Gm-Message-State: ALoCoQk9GGJ+5HdefGs4shzXZVQ9fXx0x/7UnE0IM+LfGX7PWKexjFvkhEplBHAeAVvA6XyPaKNp X-Received: by 10.224.165.133 with SMTP id i5mr12157181qay.75.1393462465463; Wed, 26 Feb 2014 16:54:25 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.147.225 with HTTP; Wed, 26 Feb 2014 16:53:55 -0800 (PST) In-Reply-To: <201402270043.s1R0hAU9098502@svn.freebsd.org> References: <201402270043.s1R0hAU9098502@svn.freebsd.org> From: Eitan Adler Date: Wed, 26 Feb 2014 19:53:55 -0500 X-Google-Sender-Auth: 6cegtFKvqHVRDTmLRr4YQBGnQZk Message-ID: Subject: Re: svn commit: r262539 - in head: sys/compat/linprocfs usr.bin/makewhatis To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 00:54:26 -0000 On Wed, Feb 26, 2014 at 7:43 PM, Eitan Adler wrote: > Author: eadler > Date: Thu Feb 27 00:43:10 2014 > New Revision: 262539 > URL: http://svnweb.freebsd.org/changeset/base/262539 ... > head/usr.bin/makewhatis/makewhatis.1 > head/usr.bin/makewhatis/makewhatis.c Please ignore these. These were unrelated changes I forgot I had in this branch. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 01:04:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EE5A126; Thu, 27 Feb 2014 01:04:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 37ABA11B8; Thu, 27 Feb 2014 01:04:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1R14ZNs007703; Thu, 27 Feb 2014 01:04:35 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1R14ZCB007699; Thu, 27 Feb 2014 01:04:35 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402270104.s1R14ZCB007699@svn.freebsd.org> From: Mark Johnston Date: Thu, 27 Feb 2014 01:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262542 - in head: cddl/lib/libdtrace sys/cddl/contrib/opensolaris/uts/intel/dtrace sys/cddl/dev/dtrace/amd64 sys/cddl/dev/dtrace/i386 sys/cddl/dev/dtrace/x86 sys/modules/dtrace/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 01:04:36 -0000 Author: markj Date: Thu Feb 27 01:04:35 2014 New Revision: 262542 URL: http://svnweb.freebsd.org/changeset/base/262542 Log: Move some files that are identical on i386 and amd64 to an x86 subdirectory rather than keeping duplicate copies. Discussed with: avg MFC after: 1 week Added: head/sys/cddl/dev/dtrace/x86/ head/sys/cddl/dev/dtrace/x86/dis_tables.c - copied unchanged from r262521, head/sys/cddl/dev/dtrace/amd64/dis_tables.c head/sys/cddl/dev/dtrace/x86/dis_tables.h - copied unchanged from r262521, head/sys/cddl/dev/dtrace/amd64/dis_tables.h head/sys/cddl/dev/dtrace/x86/regset.h - copied unchanged from r262521, head/sys/cddl/dev/dtrace/amd64/regset.h Deleted: head/sys/cddl/dev/dtrace/amd64/dis_tables.c head/sys/cddl/dev/dtrace/amd64/dis_tables.h head/sys/cddl/dev/dtrace/amd64/regset.h head/sys/cddl/dev/dtrace/i386/dis_tables.c head/sys/cddl/dev/dtrace/i386/dis_tables.h head/sys/cddl/dev/dtrace/i386/regset.h Modified: head/cddl/lib/libdtrace/Makefile head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c head/sys/modules/dtrace/dtrace/Makefile Modified: head/cddl/lib/libdtrace/Makefile ============================================================================== --- head/cddl/lib/libdtrace/Makefile Thu Feb 27 01:01:02 2014 (r262541) +++ head/cddl/lib/libdtrace/Makefile Thu Feb 27 01:04:35 2014 (r262542) @@ -69,9 +69,11 @@ CFLAGS+= -I${.OBJDIR} -I${.CURDIR} \ #CFLAGS+= -DYYDEBUG .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -I${.CURDIR}/../../../sys/cddl/dev/dtrace/x86 CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel -DDIS_MEM .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/i386 .PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/${MACHINE_ARCH} +.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/x86 .elif ${MACHINE_CPUARCH} == "sparc64" CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/sparc Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Feb 27 01:01:02 2014 (r262541) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Thu Feb 27 01:04:35 2014 (r262542) @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include #include Copied: head/sys/cddl/dev/dtrace/x86/dis_tables.c (from r262521, head/sys/cddl/dev/dtrace/amd64/dis_tables.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/dev/dtrace/x86/dis_tables.c Thu Feb 27 01:04:35 2014 (r262542, copy of r262521, head/sys/cddl/dev/dtrace/amd64/dis_tables.c) @@ -0,0 +1,4841 @@ +/* + * + * CDDL HEADER START + * + * 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] + * + * CDDL HEADER END + */ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + */ + +/* + * Copyright (c) 2010, Intel Corporation. + * All rights reserved. + */ + +/* Copyright (c) 1988 AT&T */ +/* All Rights Reserved */ + +/* + * $FreeBSD$ + */ + +#include "dis_tables.h" + +/* BEGIN CSTYLED */ + +/* + * Disassembly begins in dis_distable, which is equivalent to the One-byte + * Opcode Map in the Intel IA32 ISA Reference (page A-6 in my copy). The + * decoding loops then traverse out through the other tables as necessary to + * decode a given instruction. + * + * The behavior of this file can be controlled by one of the following flags: + * + * DIS_TEXT Include text for disassembly + * DIS_MEM Include memory-size calculations + * + * Either or both of these can be defined. + * + * This file is not, and will never be, cstyled. If anything, the tables should + * be taken out another tab stop or two so nothing overlaps. + */ + +/* + * These functions must be provided for the consumer to do disassembly. + */ +#ifdef DIS_TEXT +extern char *strncpy(char *, const char *, size_t); +extern size_t strlen(const char *); +extern int strcmp(const char *, const char *); +extern int strncmp(const char *, const char *, size_t); +extern size_t strlcat(char *, const char *, size_t); +#endif + + +#define TERM 0 /* used to indicate that the 'indirect' */ + /* field terminates - no pointer. */ + +/* Used to decode instructions. */ +typedef struct instable { + struct instable *it_indirect; /* for decode op codes */ + uchar_t it_adrmode; +#ifdef DIS_TEXT + char it_name[NCPS]; + uint_t it_suffix:1; /* mnem + "w", "l", or "d" */ +#endif +#ifdef DIS_MEM + uint_t it_size:16; +#endif + uint_t it_invalid64:1; /* opcode invalid in amd64 */ + uint_t it_always64:1; /* 64 bit when in 64 bit mode */ + uint_t it_invalid32:1; /* invalid in IA32 */ + uint_t it_stackop:1; /* push/pop stack operation */ +} instable_t; + +/* + * Instruction formats. + */ +enum { + UNKNOWN, + MRw, + IMlw, + IMw, + IR, + OA, + AO, + MS, + SM, + Mv, + Mw, + M, /* register or memory */ + Mb, /* register or memory, always byte sized */ + MO, /* memory only (no registers) */ + PREF, + SWAPGS, + MONITOR_MWAIT, + R, + RA, + SEG, + MR, + RM, + IA, + MA, + SD, + AD, + SA, + D, + INM, + SO, + BD, + I, + P, + V, + DSHIFT, /* for double shift that has an 8-bit immediate */ + U, + OVERRIDE, + NORM, /* instructions w/o ModR/M byte, no memory access */ + IMPLMEM, /* instructions w/o ModR/M byte, implicit mem access */ + O, /* for call */ + JTAB, /* jump table */ + IMUL, /* for 186 iimul instr */ + CBW, /* so data16 can be evaluated for cbw and variants */ + MvI, /* for 186 logicals */ + ENTER, /* for 186 enter instr */ + RMw, /* for 286 arpl instr */ + Ib, /* for push immediate byte */ + F, /* for 287 instructions */ + FF, /* for 287 instructions */ + FFC, /* for 287 instructions */ + DM, /* 16-bit data */ + AM, /* 16-bit addr */ + LSEG, /* for 3-bit seg reg encoding */ + MIb, /* for 386 logicals */ + SREG, /* for 386 special registers */ + PREFIX, /* a REP instruction prefix */ + LOCK, /* a LOCK instruction prefix */ + INT3, /* The int 3 instruction, which has a fake operand */ + INTx, /* The normal int instruction, with explicit int num */ + DSHIFTcl, /* for double shift that implicitly uses %cl */ + CWD, /* so data16 can be evaluated for cwd and variants */ + RET, /* single immediate 16-bit operand */ + MOVZ, /* for movs and movz, with different size operands */ + CRC32, /* for crc32, with different size operands */ + XADDB, /* for xaddb */ + MOVSXZ, /* AMD64 mov sign extend 32 to 64 bit instruction */ + MOVBE, /* movbe instruction */ + +/* + * MMX/SIMD addressing modes. + */ + + MMO, /* Prefixable MMX/SIMD-Int mm/mem -> mm */ + MMOIMPL, /* Prefixable MMX/SIMD-Int mm -> mm (mem) */ + MMO3P, /* Prefixable MMX/SIMD-Int mm -> r32,imm8 */ + MMOM3, /* Prefixable MMX/SIMD-Int mm -> r32 */ + MMOS, /* Prefixable MMX/SIMD-Int mm -> mm/mem */ + MMOMS, /* Prefixable MMX/SIMD-Int mm -> mem */ + MMOPM, /* MMX/SIMD-Int mm/mem -> mm,imm8 */ + MMOPM_66o, /* MMX/SIMD-Int 0x66 optional mm/mem -> mm,imm8 */ + MMOPRM, /* Prefixable MMX/SIMD-Int r32/mem -> mm,imm8 */ + MMOSH, /* Prefixable MMX mm,imm8 */ + MM, /* MMX/SIMD-Int mm/mem -> mm */ + MMS, /* MMX/SIMD-Int mm -> mm/mem */ + MMSH, /* MMX mm,imm8 */ + XMMO, /* Prefixable SIMD xmm/mem -> xmm */ + XMMOS, /* Prefixable SIMD xmm -> xmm/mem */ + XMMOPM, /* Prefixable SIMD xmm/mem w/to xmm,imm8 */ + XMMOMX, /* Prefixable SIMD mm/mem -> xmm */ + XMMOX3, /* Prefixable SIMD xmm -> r32 */ + XMMOXMM, /* Prefixable SIMD xmm/mem -> mm */ + XMMOM, /* Prefixable SIMD xmm -> mem */ + XMMOMS, /* Prefixable SIMD mem -> xmm */ + XMM, /* SIMD xmm/mem -> xmm */ + XMM_66r, /* SIMD 0x66 prefix required xmm/mem -> xmm */ + XMM_66o, /* SIMD 0x66 prefix optional xmm/mem -> xmm */ + XMMXIMPL, /* SIMD xmm -> xmm (mem) */ + XMM3P, /* SIMD xmm -> r32,imm8 */ + XMM3PM_66r, /* SIMD 0x66 prefix required xmm -> r32/mem,imm8 */ + XMMP, /* SIMD xmm/mem w/to xmm,imm8 */ + XMMP_66o, /* SIMD 0x66 prefix optional xmm/mem w/to xmm,imm8 */ + XMMP_66r, /* SIMD 0x66 prefix required xmm/mem w/to xmm,imm8 */ + XMMPRM, /* SIMD r32/mem -> xmm,imm8 */ + XMMPRM_66r, /* SIMD 0x66 prefix required r32/mem -> xmm,imm8 */ + XMMS, /* SIMD xmm -> xmm/mem */ + XMMM, /* SIMD mem -> xmm */ + XMMM_66r, /* SIMD 0x66 prefix required mem -> xmm */ + XMMMS, /* SIMD xmm -> mem */ + XMM3MX, /* SIMD r32/mem -> xmm */ + XMM3MXS, /* SIMD xmm -> r32/mem */ + XMMSH, /* SIMD xmm,imm8 */ + XMMXM3, /* SIMD xmm/mem -> r32 */ + XMMX3, /* SIMD xmm -> r32 */ + XMMXMM, /* SIMD xmm/mem -> mm */ + XMMMX, /* SIMD mm -> xmm */ + XMMXM, /* SIMD xmm -> mm */ + XMMX2I, /* SIMD xmm -> xmm, imm, imm */ + XMM2I, /* SIMD xmm, imm, imm */ + XMMFENCE, /* SIMD lfence or mfence */ + XMMSFNC, /* SIMD sfence (none or mem) */ + XGETBV_XSETBV, + VEX_NONE, /* VEX no operand */ + VEX_MO, /* VEX mod_rm -> implicit reg */ + VEX_RMrX, /* VEX VEX.vvvv, mod_rm -> mod_reg */ + VEX_RRX, /* VEX VEX.vvvv, mod_reg -> mod_rm */ + VEX_RMRX, /* VEX VEX.vvvv, mod_rm, imm8[7:4] -> mod_reg */ + VEX_MX, /* VEX mod_rm -> mod_reg */ + VEX_MXI, /* VEX mod_rm, imm8 -> mod_reg */ + VEX_XXI, /* VEX mod_rm, imm8 -> VEX.vvvv */ + VEX_MR, /* VEX mod_rm -> mod_reg */ + VEX_RRI, /* VEX mod_reg, mod_rm -> implicit(eflags/r32) */ + VEX_RX, /* VEX mod_reg -> mod_rm */ + VEX_RR, /* VEX mod_rm -> mod_reg */ + VEX_RRi, /* VEX mod_rm, imm8 -> mod_reg */ + VEX_RM, /* VEX mod_reg -> mod_rm */ + VEX_RRM, /* VEX VEX.vvvv, mod_reg -> mod_rm */ + VEX_RMX /* VEX VEX.vvvv, mod_rm -> mod_reg */ +}; + +/* + * VEX prefixes + */ +#define VEX_2bytes 0xC5 /* the first byte of two-byte form */ +#define VEX_3bytes 0xC4 /* the first byte of three-byte form */ + +#define FILL 0x90 /* Fill byte used for alignment (nop) */ + +/* +** Register numbers for the i386 +*/ +#define EAX_REGNO 0 +#define ECX_REGNO 1 +#define EDX_REGNO 2 +#define EBX_REGNO 3 +#define ESP_REGNO 4 +#define EBP_REGNO 5 +#define ESI_REGNO 6 +#define EDI_REGNO 7 + +/* + * modes for immediate values + */ +#define MODE_NONE 0 +#define MODE_IPREL 1 /* signed IP relative value */ +#define MODE_SIGNED 2 /* sign extended immediate */ +#define MODE_IMPLIED 3 /* constant value implied from opcode */ +#define MODE_OFFSET 4 /* offset part of an address */ +#define MODE_RIPREL 5 /* like IPREL, but from %rip (amd64) */ + +/* + * The letters used in these macros are: + * IND - indirect to another to another table + * "T" - means to Terminate indirections (this is the final opcode) + * "S" - means "operand length suffix required" + * "NS" - means "no suffix" which is the operand length suffix of the opcode + * "Z" - means instruction size arg required + * "u" - means the opcode is invalid in IA32 but valid in amd64 + * "x" - means the opcode is invalid in amd64, but not IA32 + * "y" - means the operand size is always 64 bits in 64 bit mode + * "p" - means push/pop stack operation + */ + +#if defined(DIS_TEXT) && defined(DIS_MEM) +#define IND(table) {(instable_t *)table, 0, "", 0, 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, "", 0, 0, 1, 0, 0, 0} +#define TNS(name, amode) {TERM, amode, name, 0, 0, 0, 0, 0, 0} +#define TNSu(name, amode) {TERM, amode, name, 0, 0, 0, 0, 1, 0} +#define TNSx(name, amode) {TERM, amode, name, 0, 0, 1, 0, 0, 0} +#define TNSy(name, amode) {TERM, amode, name, 0, 0, 0, 1, 0, 0} +#define TNSyp(name, amode) {TERM, amode, name, 0, 0, 0, 1, 0, 1} +#define TNSZ(name, amode, sz) {TERM, amode, name, 0, sz, 0, 0, 0, 0} +#define TNSZy(name, amode, sz) {TERM, amode, name, 0, sz, 0, 1, 0, 0} +#define TS(name, amode) {TERM, amode, name, 1, 0, 0, 0, 0, 0} +#define TSx(name, amode) {TERM, amode, name, 1, 0, 1, 0, 0, 0} +#define TSy(name, amode) {TERM, amode, name, 1, 0, 0, 1, 0, 0} +#define TSp(name, amode) {TERM, amode, name, 1, 0, 0, 0, 0, 1} +#define TSZ(name, amode, sz) {TERM, amode, name, 1, sz, 0, 0, 0, 0} +#define TSZx(name, amode, sz) {TERM, amode, name, 1, sz, 1, 0, 0, 0} +#define TSZy(name, amode, sz) {TERM, amode, name, 1, sz, 0, 1, 0, 0} +#define INVALID {TERM, UNKNOWN, "", 0, 0, 0, 0, 0} +#elif defined(DIS_TEXT) +#define IND(table) {(instable_t *)table, 0, "", 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, "", 0, 1, 0, 0, 0} +#define TNS(name, amode) {TERM, amode, name, 0, 0, 0, 0, 0} +#define TNSu(name, amode) {TERM, amode, name, 0, 0, 0, 1, 0} +#define TNSx(name, amode) {TERM, amode, name, 0, 1, 0, 0, 0} +#define TNSy(name, amode) {TERM, amode, name, 0, 0, 1, 0, 0} +#define TNSyp(name, amode) {TERM, amode, name, 0, 0, 1, 0, 1} +#define TNSZ(name, amode, sz) {TERM, amode, name, 0, 0, 0, 0, 0} +#define TNSZy(name, amode, sz) {TERM, amode, name, 0, 0, 1, 0, 0} +#define TS(name, amode) {TERM, amode, name, 1, 0, 0, 0, 0} +#define TSx(name, amode) {TERM, amode, name, 1, 1, 0, 0, 0} +#define TSy(name, amode) {TERM, amode, name, 1, 0, 1, 0, 0} +#define TSp(name, amode) {TERM, amode, name, 1, 0, 0, 0, 1} +#define TSZ(name, amode, sz) {TERM, amode, name, 1, 0, 0, 0, 0} +#define TSZx(name, amode, sz) {TERM, amode, name, 1, 1, 0, 0, 0} +#define TSZy(name, amode, sz) {TERM, amode, name, 1, 0, 1, 0, 0} +#define INVALID {TERM, UNKNOWN, "", 0, 0, 0, 0, 0} +#elif defined(DIS_MEM) +#define IND(table) {(instable_t *)table, 0, 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, 0, 1, 0, 0, 0} +#define TNS(name, amode) {TERM, amode, 0, 0, 0, 0, 0} +#define TNSu(name, amode) {TERM, amode, 0, 0, 0, 1, 0} +#define TNSy(name, amode) {TERM, amode, 0, 0, 1, 0, 0} +#define TNSyp(name, amode) {TERM, amode, 0, 0, 1, 0, 1} +#define TNSx(name, amode) {TERM, amode, 0, 1, 0, 0, 0} +#define TNSZ(name, amode, sz) {TERM, amode, sz, 0, 0, 0, 0} +#define TNSZy(name, amode, sz) {TERM, amode, sz, 0, 1, 0, 0} +#define TS(name, amode) {TERM, amode, 0, 0, 0, 0, 0} +#define TSx(name, amode) {TERM, amode, 0, 1, 0, 0, 0} +#define TSy(name, amode) {TERM, amode, 0, 0, 1, 0, 0} +#define TSp(name, amode) {TERM, amode, 0, 0, 0, 0, 1} +#define TSZ(name, amode, sz) {TERM, amode, sz, 0, 0, 0, 0} +#define TSZx(name, amode, sz) {TERM, amode, sz, 1, 0, 0, 0} +#define TSZy(name, amode, sz) {TERM, amode, sz, 0, 1, 0, 0} +#define INVALID {TERM, UNKNOWN, 0, 0, 0, 0, 0} +#else +#define IND(table) {(instable_t *)table, 0, 0, 0, 0, 0} +#define INDx(table) {(instable_t *)table, 0, 1, 0, 0, 0} +#define TNS(name, amode) {TERM, amode, 0, 0, 0, 0} +#define TNSu(name, amode) {TERM, amode, 0, 0, 1, 0} +#define TNSy(name, amode) {TERM, amode, 0, 1, 0, 0} +#define TNSyp(name, amode) {TERM, amode, 0, 1, 0, 1} +#define TNSx(name, amode) {TERM, amode, 1, 0, 0, 0} +#define TNSZ(name, amode, sz) {TERM, amode, 0, 0, 0, 0} +#define TNSZy(name, amode, sz) {TERM, amode, 0, 1, 0, 0} +#define TS(name, amode) {TERM, amode, 0, 0, 0, 0} +#define TSx(name, amode) {TERM, amode, 1, 0, 0, 0} +#define TSy(name, amode) {TERM, amode, 0, 1, 0, 0} +#define TSp(name, amode) {TERM, amode, 0, 0, 0, 1} +#define TSZ(name, amode, sz) {TERM, amode, 0, 0, 0, 0} +#define TSZx(name, amode, sz) {TERM, amode, 1, 0, 0, 0} +#define TSZy(name, amode, sz) {TERM, amode, 0, 1, 0, 0} +#define INVALID {TERM, UNKNOWN, 0, 0, 0, 0} +#endif + +#ifdef DIS_TEXT +/* + * this decodes the r_m field for mode's 0, 1, 2 in 16 bit mode + */ +const char *const dis_addr16[3][8] = { +"(%bx,%si)", "(%bx,%di)", "(%bp,%si)", "(%bp,%di)", "(%si)", "(%di)", "", + "(%bx)", +"(%bx,%si)", "(%bx,%di)", "(%bp,%si)", "(%bp,%di)", "(%si)", "(%di", "(%bp)", + "(%bx)", +"(%bx,%si)", "(%bx,%di)", "(%bp,%si)", "(%bp,%di)", "(%si)", "(%di)", "(%bp)", + "(%bx)", +}; + + +/* + * This decodes 32 bit addressing mode r_m field for modes 0, 1, 2 + */ +const char *const dis_addr32_mode0[16] = { + "(%eax)", "(%ecx)", "(%edx)", "(%ebx)", "", "", "(%esi)", "(%edi)", + "(%r8d)", "(%r9d)", "(%r10d)", "(%r11d)", "", "", "(%r14d)", "(%r15d)" +}; + +const char *const dis_addr32_mode12[16] = { + "(%eax)", "(%ecx)", "(%edx)", "(%ebx)", "", "(%ebp)", "(%esi)", "(%edi)", + "(%r8d)", "(%r9d)", "(%r10d)", "(%r11d)", "", "(%r13d)", "(%r14d)", "(%r15d)" +}; + +/* + * This decodes 64 bit addressing mode r_m field for modes 0, 1, 2 + */ +const char *const dis_addr64_mode0[16] = { + "(%rax)", "(%rcx)", "(%rdx)", "(%rbx)", "", "(%rip)", "(%rsi)", "(%rdi)", + "(%r8)", "(%r9)", "(%r10)", "(%r11)", "(%r12)", "(%rip)", "(%r14)", "(%r15)" +}; +const char *const dis_addr64_mode12[16] = { + "(%rax)", "(%rcx)", "(%rdx)", "(%rbx)", "", "(%rbp)", "(%rsi)", "(%rdi)", + "(%r8)", "(%r9)", "(%r10)", "(%r11)", "(%r12)", "(%r13)", "(%r14)", "(%r15)" +}; + +/* + * decode for scale from SIB byte + */ +const char *const dis_scale_factor[4] = { ")", ",2)", ",4)", ",8)" }; + +/* + * register decoding for normal references to registers (ie. not addressing) + */ +const char *const dis_REG8[16] = { + "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh", + "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b" +}; + +const char *const dis_REG8_REX[16] = { + "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil", + "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b" +}; + +const char *const dis_REG16[16] = { + "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di", + "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w" +}; + +const char *const dis_REG32[16] = { + "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi", + "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d" +}; + +const char *const dis_REG64[16] = { + "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi", + "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15" +}; + +const char *const dis_DEBUGREG[16] = { + "%db0", "%db1", "%db2", "%db3", "%db4", "%db5", "%db6", "%db7", + "%db8", "%db9", "%db10", "%db11", "%db12", "%db13", "%db14", "%db15" +}; + +const char *const dis_CONTROLREG[16] = { + "%cr0", "%cr1", "%cr2", "%cr3", "%cr4", "%cr5?", "%cr6?", "%cr7?", + "%cr8", "%cr9?", "%cr10?", "%cr11?", "%cr12?", "%cr13?", "%cr14?", "%cr15?" +}; + +const char *const dis_TESTREG[16] = { + "%tr0?", "%tr1?", "%tr2?", "%tr3", "%tr4", "%tr5", "%tr6", "%tr7", + "%tr0?", "%tr1?", "%tr2?", "%tr3", "%tr4", "%tr5", "%tr6", "%tr7" +}; + +const char *const dis_MMREG[16] = { + "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7", + "%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7" +}; + +const char *const dis_XMMREG[16] = { + "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", + "%xmm8", "%xmm9", "%xmm10", "%xmm11", "%xmm12", "%xmm13", "%xmm14", "%xmm15" +}; + +const char *const dis_YMMREG[16] = { + "%ymm0", "%ymm1", "%ymm2", "%ymm3", "%ymm4", "%ymm5", "%ymm6", "%ymm7", + "%ymm8", "%ymm9", "%ymm10", "%ymm11", "%ymm12", "%ymm13", "%ymm14", "%ymm15" +}; + +const char *const dis_SEGREG[16] = { + "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "", "", + "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "", "" +}; + +/* + * SIMD predicate suffixes + */ +const char *const dis_PREDSUFFIX[8] = { + "eq", "lt", "le", "unord", "neq", "nlt", "nle", "ord" +}; + +const char *const dis_AVXvgrp7[3][8] = { + /*0 1 2 3 4 5 6 7*/ +/*71*/ {"", "", "vpsrlw", "", "vpsraw", "", "vpsllw", ""}, +/*72*/ {"", "", "vpsrld", "", "vpsrad", "", "vpslld", ""}, +/*73*/ {"", "", "vpsrlq", "vpsrldq", "", "", "vpsllq", "vpslldq"} +}; + +#endif /* DIS_TEXT */ + +/* + * "decode table" for 64 bit mode MOVSXD instruction (opcode 0x63) + */ +const instable_t dis_opMOVSLD = TNS("movslq",MOVSXZ); + +/* + * "decode table" for pause and clflush instructions + */ +const instable_t dis_opPause = TNS("pause", NORM); + +/* + * Decode table for 0x0F00 opcodes + */ +const instable_t dis_op0F00[8] = { + +/* [0] */ TNS("sldt",M), TNS("str",M), TNSy("lldt",M), TNSy("ltr",M), +/* [4] */ TNSZ("verr",M,2), TNSZ("verw",M,2), INVALID, INVALID, +}; + + +/* + * Decode table for 0x0F01 opcodes + */ +const instable_t dis_op0F01[8] = { + +/* [0] */ TNSZ("sgdt",MO,6), TNSZ("sidt",MONITOR_MWAIT,6), TNSZ("lgdt",XGETBV_XSETBV,6), TNSZ("lidt",MO,6), +/* [4] */ TNSZ("smsw",M,2), INVALID, TNSZ("lmsw",M,2), TNS("invlpg",SWAPGS), +}; + +/* + * Decode table for 0x0F18 opcodes -- SIMD prefetch + */ +const instable_t dis_op0F18[8] = { + +/* [0] */ TNS("prefetchnta",PREF),TNS("prefetcht0",PREF), TNS("prefetcht1",PREF), TNS("prefetcht2",PREF), +/* [4] */ INVALID, INVALID, INVALID, INVALID, +}; + +/* + * Decode table for 0x0FAE opcodes -- SIMD state save/restore + */ +const instable_t dis_op0FAE[8] = { +/* [0] */ TNSZ("fxsave",M,512), TNSZ("fxrstor",M,512), TNS("ldmxcsr",M), TNS("stmxcsr",M), +/* [4] */ TNSZ("xsave",M,512), TNS("lfence",XMMFENCE), TNS("mfence",XMMFENCE), TNS("sfence",XMMSFNC), +}; + +/* + * Decode table for 0x0FBA opcodes + */ + +const instable_t dis_op0FBA[8] = { + +/* [0] */ INVALID, INVALID, INVALID, INVALID, +/* [4] */ TS("bt",MIb), TS("bts",MIb), TS("btr",MIb), TS("btc",MIb), +}; + +/* + * Decode table for 0x0FC7 opcode + */ + +const instable_t dis_op0FC7[8] = { + +/* [0] */ INVALID, TNS("cmpxchg8b",M), INVALID, INVALID, +/* [4] */ INVALID, INVALID, INVALID, INVALID, +}; + + +/* + * Decode table for 0x0FC8 opcode -- 486 bswap instruction + * + *bit pattern: 0000 1111 1100 1reg + */ +const instable_t dis_op0FC8[4] = { +/* [0] */ TNS("bswap",R), INVALID, INVALID, INVALID, +}; + +/* + * Decode table for 0x0F71, 0x0F72, and 0x0F73 opcodes -- MMX instructions + */ +const instable_t dis_op0F7123[4][8] = { +{ +/* [70].0 */ INVALID, INVALID, INVALID, INVALID, +/* .4 */ INVALID, INVALID, INVALID, INVALID, +}, { +/* [71].0 */ INVALID, INVALID, TNS("psrlw",MMOSH), INVALID, +/* .4 */ TNS("psraw",MMOSH), INVALID, TNS("psllw",MMOSH), INVALID, +}, { +/* [72].0 */ INVALID, INVALID, TNS("psrld",MMOSH), INVALID, +/* .4 */ TNS("psrad",MMOSH), INVALID, TNS("pslld",MMOSH), INVALID, +}, { +/* [73].0 */ INVALID, INVALID, TNS("psrlq",MMOSH), TNS("INVALID",MMOSH), +/* .4 */ INVALID, INVALID, TNS("psllq",MMOSH), TNS("INVALID",MMOSH), +} }; + +/* + * Decode table for SIMD extensions to above 0x0F71-0x0F73 opcodes. + */ +const instable_t dis_opSIMD7123[32] = { +/* [70].0 */ INVALID, INVALID, INVALID, INVALID, +/* .4 */ INVALID, INVALID, INVALID, INVALID, + +/* [71].0 */ INVALID, INVALID, TNS("psrlw",XMMSH), INVALID, +/* .4 */ TNS("psraw",XMMSH), INVALID, TNS("psllw",XMMSH), INVALID, + +/* [72].0 */ INVALID, INVALID, TNS("psrld",XMMSH), INVALID, +/* .4 */ TNS("psrad",XMMSH), INVALID, TNS("pslld",XMMSH), INVALID, + +/* [73].0 */ INVALID, INVALID, TNS("psrlq",XMMSH), TNS("psrldq",XMMSH), +/* .4 */ INVALID, INVALID, TNS("psllq",XMMSH), TNS("pslldq",XMMSH), +}; + +/* + * SIMD instructions have been wedged into the existing IA32 instruction + * set through the use of prefixes. That is, while 0xf0 0x58 may be + * addps, 0xf3 0xf0 0x58 (literally, repz addps) is a completely different + * instruction - addss. At present, three prefixes have been coopted in + * this manner - address size (0x66), repnz (0xf2) and repz (0xf3). The + * following tables are used to provide the prefixed instruction names. + * The arrays are sparse, but they're fast. + */ + +/* + * Decode table for SIMD instructions with the address size (0x66) prefix. + */ +const instable_t dis_opSIMDdata16[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("movupd",XMM,16), TNSZ("movupd",XMMS,16), TNSZ("movlpd",XMMM,8), TNSZ("movlpd",XMMMS,8), +/* [14] */ TNSZ("unpcklpd",XMM,16),TNSZ("unpckhpd",XMM,16),TNSZ("movhpd",XMMM,8), TNSZ("movhpd",XMMMS,8), +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ TNSZ("movapd",XMM,16), TNSZ("movapd",XMMS,16), TNSZ("cvtpi2pd",XMMOMX,8),TNSZ("movntpd",XMMOMS,16), +/* [2C] */ TNSZ("cvttpd2pi",XMMXMM,16),TNSZ("cvtpd2pi",XMMXMM,16),TNSZ("ucomisd",XMM,8),TNSZ("comisd",XMM,8), + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ TNS("movmskpd",XMMOX3), TNSZ("sqrtpd",XMM,16), INVALID, INVALID, +/* [54] */ TNSZ("andpd",XMM,16), TNSZ("andnpd",XMM,16), TNSZ("orpd",XMM,16), TNSZ("xorpd",XMM,16), +/* [58] */ TNSZ("addpd",XMM,16), TNSZ("mulpd",XMM,16), TNSZ("cvtpd2ps",XMM,16),TNSZ("cvtps2dq",XMM,16), +/* [5C] */ TNSZ("subpd",XMM,16), TNSZ("minpd",XMM,16), TNSZ("divpd",XMM,16), TNSZ("maxpd",XMM,16), + +/* [60] */ TNSZ("punpcklbw",XMM,16),TNSZ("punpcklwd",XMM,16),TNSZ("punpckldq",XMM,16),TNSZ("packsswb",XMM,16), +/* [64] */ TNSZ("pcmpgtb",XMM,16), TNSZ("pcmpgtw",XMM,16), TNSZ("pcmpgtd",XMM,16), TNSZ("packuswb",XMM,16), +/* [68] */ TNSZ("punpckhbw",XMM,16),TNSZ("punpckhwd",XMM,16),TNSZ("punpckhdq",XMM,16),TNSZ("packssdw",XMM,16), +/* [6C] */ TNSZ("punpcklqdq",XMM,16),TNSZ("punpckhqdq",XMM,16),TNSZ("movd",XMM3MX,4),TNSZ("movdqa",XMM,16), + +/* [70] */ TNSZ("pshufd",XMMP,16), INVALID, INVALID, INVALID, +/* [74] */ TNSZ("pcmpeqb",XMM,16), TNSZ("pcmpeqw",XMM,16), TNSZ("pcmpeqd",XMM,16), INVALID, +/* [78] */ TNSZ("extrq",XMM2I,16), TNSZ("extrq",XMM,16), INVALID, INVALID, +/* [7C] */ INVALID, INVALID, TNSZ("movd",XMM3MXS,4), TNSZ("movdqa",XMMS,16), + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("cmppd",XMMP,16), INVALID, +/* [C4] */ TNSZ("pinsrw",XMMPRM,2),TNS("pextrw",XMM3P), TNSZ("shufpd",XMMP,16), INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, TNSZ("psrlw",XMM,16), TNSZ("psrld",XMM,16), TNSZ("psrlq",XMM,16), +/* [D4] */ TNSZ("paddq",XMM,16), TNSZ("pmullw",XMM,16), TNSZ("movq",XMMS,8), TNS("pmovmskb",XMMX3), +/* [D8] */ TNSZ("psubusb",XMM,16), TNSZ("psubusw",XMM,16), TNSZ("pminub",XMM,16), TNSZ("pand",XMM,16), +/* [DC] */ TNSZ("paddusb",XMM,16), TNSZ("paddusw",XMM,16), TNSZ("pmaxub",XMM,16), TNSZ("pandn",XMM,16), + +/* [E0] */ TNSZ("pavgb",XMM,16), TNSZ("psraw",XMM,16), TNSZ("psrad",XMM,16), TNSZ("pavgw",XMM,16), +/* [E4] */ TNSZ("pmulhuw",XMM,16), TNSZ("pmulhw",XMM,16), TNSZ("cvttpd2dq",XMM,16),TNSZ("movntdq",XMMS,16), +/* [E8] */ TNSZ("psubsb",XMM,16), TNSZ("psubsw",XMM,16), TNSZ("pminsw",XMM,16), TNSZ("por",XMM,16), +/* [EC] */ TNSZ("paddsb",XMM,16), TNSZ("paddsw",XMM,16), TNSZ("pmaxsw",XMM,16), TNSZ("pxor",XMM,16), + +/* [F0] */ INVALID, TNSZ("psllw",XMM,16), TNSZ("pslld",XMM,16), TNSZ("psllq",XMM,16), +/* [F4] */ TNSZ("pmuludq",XMM,16), TNSZ("pmaddwd",XMM,16), TNSZ("psadbw",XMM,16), TNSZ("maskmovdqu", XMMXIMPL,16), +/* [F8] */ TNSZ("psubb",XMM,16), TNSZ("psubw",XMM,16), TNSZ("psubd",XMM,16), TNSZ("psubq",XMM,16), +/* [FC] */ TNSZ("paddb",XMM,16), TNSZ("paddw",XMM,16), TNSZ("paddd",XMM,16), INVALID, +}; + +const instable_t dis_opAVX660F[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("vmovupd",VEX_MX,16), TNSZ("vmovupd",VEX_RX,16), TNSZ("vmovlpd",VEX_RMrX,8), TNSZ("vmovlpd",VEX_RM,8), +/* [14] */ TNSZ("vunpcklpd",VEX_RMrX,16),TNSZ("vunpckhpd",VEX_RMrX,16),TNSZ("vmovhpd",VEX_RMrX,8), TNSZ("vmovhpd",VEX_RM,8), +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ TNSZ("vmovapd",VEX_MX,16), TNSZ("vmovapd",VEX_RX,16), INVALID, TNSZ("vmovntpd",VEX_RM,16), +/* [2C] */ INVALID, INVALID, TNSZ("vucomisd",VEX_MX,8),TNSZ("vcomisd",VEX_MX,8), + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ TNS("vmovmskpd",VEX_MR), TNSZ("vsqrtpd",VEX_MX,16), INVALID, INVALID, +/* [54] */ TNSZ("vandpd",VEX_RMrX,16), TNSZ("vandnpd",VEX_RMrX,16), TNSZ("vorpd",VEX_RMrX,16), TNSZ("vxorpd",VEX_RMrX,16), +/* [58] */ TNSZ("vaddpd",VEX_RMrX,16), TNSZ("vmulpd",VEX_RMrX,16), TNSZ("vcvtpd2ps",VEX_MX,16),TNSZ("vcvtps2dq",VEX_MX,16), +/* [5C] */ TNSZ("vsubpd",VEX_RMrX,16), TNSZ("vminpd",VEX_RMrX,16), TNSZ("vdivpd",VEX_RMrX,16), TNSZ("vmaxpd",VEX_RMrX,16), + +/* [60] */ TNSZ("vpunpcklbw",VEX_RMrX,16),TNSZ("vpunpcklwd",VEX_RMrX,16),TNSZ("vpunpckldq",VEX_RMrX,16),TNSZ("vpacksswb",VEX_RMrX,16), +/* [64] */ TNSZ("vpcmpgtb",VEX_RMrX,16), TNSZ("vpcmpgtw",VEX_RMrX,16), TNSZ("vpcmpgtd",VEX_RMrX,16), TNSZ("vpackuswb",VEX_RMrX,16), +/* [68] */ TNSZ("vpunpckhbw",VEX_RMrX,16),TNSZ("vpunpckhwd",VEX_RMrX,16),TNSZ("vpunpckhdq",VEX_RMrX,16),TNSZ("vpackssdw",VEX_RMrX,16), +/* [6C] */ TNSZ("vpunpcklqdq",VEX_RMrX,16),TNSZ("vpunpckhqdq",VEX_RMrX,16),TNSZ("vmovd",VEX_MX,4),TNSZ("vmovdqa",VEX_MX,16), + +/* [70] */ TNSZ("vpshufd",VEX_MXI,16), TNSZ("vgrp71",VEX_XXI,16), TNSZ("vgrp72",VEX_XXI,16), TNSZ("vgrp73",VEX_XXI,16), +/* [74] */ TNSZ("vpcmpeqb",VEX_RMrX,16), TNSZ("vpcmpeqw",VEX_RMrX,16), TNSZ("vpcmpeqd",VEX_RMrX,16), INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ TNSZ("vhaddpd",VEX_RMrX,16), TNSZ("vhsubpd",VEX_RMrX,16), TNSZ("vmovd",VEX_RR,4), TNSZ("vmovdqa",VEX_RX,16), + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [8C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("vcmppd",VEX_RMRX,16), INVALID, +/* [C4] */ TNSZ("vpinsrw",VEX_RMRX,2),TNS("vpextrw",VEX_MR), TNSZ("vshufpd",VEX_RMRX,16), INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ TNSZ("vaddsubpd",VEX_RMrX,16),TNSZ("vpsrlw",VEX_RMrX,16), TNSZ("vpsrld",VEX_RMrX,16), TNSZ("vpsrlq",VEX_RMrX,16), +/* [D4] */ TNSZ("vpaddq",VEX_RMrX,16), TNSZ("vpmullw",VEX_RMrX,16), TNSZ("vmovq",VEX_RX,8), TNS("vpmovmskb",VEX_MR), +/* [D8] */ TNSZ("vpsubusb",VEX_RMrX,16), TNSZ("vpsubusw",VEX_RMrX,16), TNSZ("vpminub",VEX_RMrX,16), TNSZ("vpand",VEX_RMrX,16), +/* [DC] */ TNSZ("vpaddusb",VEX_RMrX,16), TNSZ("vpaddusw",VEX_RMrX,16), TNSZ("vpmaxub",VEX_RMrX,16), TNSZ("vpandn",VEX_RMrX,16), + +/* [E0] */ TNSZ("vpavgb",VEX_RMrX,16), TNSZ("vpsraw",VEX_RMrX,16), TNSZ("vpsrad",VEX_RMrX,16), TNSZ("vpavgw",VEX_RMrX,16), +/* [E4] */ TNSZ("vpmulhuw",VEX_RMrX,16), TNSZ("vpmulhw",VEX_RMrX,16), TNSZ("vcvttpd2dq",VEX_MX,16),TNSZ("vmovntdq",VEX_RM,16), +/* [E8] */ TNSZ("vpsubsb",VEX_RMrX,16), TNSZ("vpsubsw",VEX_RMrX,16), TNSZ("vpminsw",VEX_RMrX,16), TNSZ("vpor",VEX_RMrX,16), +/* [EC] */ TNSZ("vpaddsb",VEX_RMrX,16), TNSZ("vpaddsw",VEX_RMrX,16), TNSZ("vpmaxsw",VEX_RMrX,16), TNSZ("vpxor",VEX_RMrX,16), + +/* [F0] */ INVALID, TNSZ("vpsllw",VEX_RMrX,16), TNSZ("vpslld",VEX_RMrX,16), TNSZ("vpsllq",VEX_RMrX,16), +/* [F4] */ TNSZ("vpmuludq",VEX_RMrX,16), TNSZ("vpmaddwd",VEX_RMrX,16), TNSZ("vpsadbw",VEX_RMrX,16), TNS("vmaskmovdqu",VEX_MX), +/* [F8] */ TNSZ("vpsubb",VEX_RMrX,16), TNSZ("vpsubw",VEX_RMrX,16), TNSZ("vpsubd",VEX_RMrX,16), TNSZ("vpsubq",VEX_RMrX,16), +/* [FC] */ TNSZ("vpaddb",VEX_RMrX,16), TNSZ("vpaddw",VEX_RMrX,16), TNSZ("vpaddd",VEX_RMrX,16), INVALID, +}; + +/* + * Decode table for SIMD instructions with the repnz (0xf2) prefix. + */ +const instable_t dis_opSIMDrepnz[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("movsd",XMM,8), TNSZ("movsd",XMMS,8), INVALID, INVALID, +/* [14] */ INVALID, INVALID, INVALID, INVALID, +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, TNSZ("cvtsi2sd",XMM3MX,4),TNSZ("movntsd",XMMMS,8), +/* [2C] */ TNSZ("cvttsd2si",XMMXM3,8),TNSZ("cvtsd2si",XMMXM3,8),INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, TNSZ("sqrtsd",XMM,8), INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ TNSZ("addsd",XMM,8), TNSZ("mulsd",XMM,8), TNSZ("cvtsd2ss",XMM,8), INVALID, +/* [5C] */ TNSZ("subsd",XMM,8), TNSZ("minsd",XMM,8), TNSZ("divsd",XMM,8), TNSZ("maxsd",XMM,8), + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ TNSZ("pshuflw",XMMP,16),INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ TNSZ("insertq",XMMX2I,16),TNSZ("insertq",XMM,8),INVALID, INVALID, +/* [7C] */ INVALID, INVALID, INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("cmpsd",XMMP,8), INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ INVALID, INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, TNS("movdq2q",XMMXM), INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, INVALID, + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, TNSZ("cvtpd2dq",XMM,16),INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ INVALID, INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +const instable_t dis_opAVXF20F[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("vmovsd",VEX_RMrX,8), TNSZ("vmovsd",VEX_RRX,8), TNSZ("vmovddup",VEX_MX,8), INVALID, +/* [14] */ INVALID, INVALID, INVALID, INVALID, +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, TNSZ("vcvtsi2sd",VEX_RMrX,4),INVALID, +/* [2C] */ TNSZ("vcvttsd2si",VEX_MR,8),TNSZ("vcvtsd2si",VEX_MR,8),INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, TNSZ("vsqrtsd",VEX_RMrX,8), INVALID, INVALID, +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ TNSZ("vaddsd",VEX_RMrX,8), TNSZ("vmulsd",VEX_RMrX,8), TNSZ("vcvtsd2ss",VEX_RMrX,8), INVALID, +/* [5C] */ TNSZ("vsubsd",VEX_RMrX,8), TNSZ("vminsd",VEX_RMrX,8), TNSZ("vdivsd",VEX_RMrX,8), TNSZ("vmaxsd",VEX_RMrX,8), + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, INVALID, + +/* [70] */ TNSZ("vpshuflw",VEX_MXI,16),INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ TNSZ("vhaddps",VEX_RMrX,8), TNSZ("vhsubps",VEX_RMrX,8), INVALID, INVALID, + +/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [84] */ INVALID, INVALID, INVALID, INVALID, +/* [88] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [94] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [9C] */ INVALID, INVALID, INVALID, INVALID, + +/* [A0] */ INVALID, INVALID, INVALID, INVALID, +/* [A4] */ INVALID, INVALID, INVALID, INVALID, +/* [A8] */ INVALID, INVALID, INVALID, INVALID, +/* [AC] */ INVALID, INVALID, INVALID, INVALID, + +/* [B0] */ INVALID, INVALID, INVALID, INVALID, +/* [B4] */ INVALID, INVALID, INVALID, INVALID, +/* [B8] */ INVALID, INVALID, INVALID, INVALID, +/* [BC] */ INVALID, INVALID, INVALID, INVALID, + +/* [C0] */ INVALID, INVALID, TNSZ("vcmpsd",VEX_RMRX,8), INVALID, +/* [C4] */ INVALID, INVALID, INVALID, INVALID, +/* [C8] */ INVALID, INVALID, INVALID, INVALID, +/* [CC] */ INVALID, INVALID, INVALID, INVALID, + +/* [D0] */ TNSZ("vaddsubps",VEX_RMrX,8), INVALID, INVALID, INVALID, +/* [D4] */ INVALID, INVALID, INVALID, INVALID, +/* [D8] */ INVALID, INVALID, INVALID, INVALID, +/* [DC] */ INVALID, INVALID, INVALID, INVALID, + +/* [E0] */ INVALID, INVALID, INVALID, INVALID, +/* [E4] */ INVALID, INVALID, TNSZ("vcvtpd2dq",VEX_MX,16),INVALID, +/* [E8] */ INVALID, INVALID, INVALID, INVALID, +/* [EC] */ INVALID, INVALID, INVALID, INVALID, + +/* [F0] */ TNSZ("vlddqu",VEX_MX,16), INVALID, INVALID, INVALID, +/* [F4] */ INVALID, INVALID, INVALID, INVALID, +/* [F8] */ INVALID, INVALID, INVALID, INVALID, +/* [FC] */ INVALID, INVALID, INVALID, INVALID, +}; + +/* + * Decode table for SIMD instructions with the repz (0xf3) prefix. + */ +const instable_t dis_opSIMDrepz[256] = { +/* [00] */ INVALID, INVALID, INVALID, INVALID, +/* [04] */ INVALID, INVALID, INVALID, INVALID, +/* [08] */ INVALID, INVALID, INVALID, INVALID, +/* [0C] */ INVALID, INVALID, INVALID, INVALID, + +/* [10] */ TNSZ("movss",XMM,4), TNSZ("movss",XMMS,4), INVALID, INVALID, +/* [14] */ INVALID, INVALID, INVALID, INVALID, +/* [18] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, INVALID, INVALID, INVALID, + +/* [20] */ INVALID, INVALID, INVALID, INVALID, +/* [24] */ INVALID, INVALID, INVALID, INVALID, +/* [28] */ INVALID, INVALID, TNSZ("cvtsi2ss",XMM3MX,4),TNSZ("movntss",XMMMS,4), +/* [2C] */ TNSZ("cvttss2si",XMMXM3,4),TNSZ("cvtss2si",XMMXM3,4),INVALID, INVALID, + +/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [34] */ INVALID, INVALID, INVALID, INVALID, +/* [38] */ INVALID, INVALID, INVALID, INVALID, +/* [3C] */ INVALID, INVALID, INVALID, INVALID, + +/* [40] */ INVALID, INVALID, INVALID, INVALID, +/* [44] */ INVALID, INVALID, INVALID, INVALID, +/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [4C] */ INVALID, INVALID, INVALID, INVALID, + +/* [50] */ INVALID, TNSZ("sqrtss",XMM,4), TNSZ("rsqrtss",XMM,4), TNSZ("rcpss",XMM,4), +/* [54] */ INVALID, INVALID, INVALID, INVALID, +/* [58] */ TNSZ("addss",XMM,4), TNSZ("mulss",XMM,4), TNSZ("cvtss2sd",XMM,4), TNSZ("cvttps2dq",XMM,16), +/* [5C] */ TNSZ("subss",XMM,4), TNSZ("minss",XMM,4), TNSZ("divss",XMM,4), TNSZ("maxss",XMM,4), + +/* [60] */ INVALID, INVALID, INVALID, INVALID, +/* [64] */ INVALID, INVALID, INVALID, INVALID, +/* [68] */ INVALID, INVALID, INVALID, INVALID, +/* [6C] */ INVALID, INVALID, INVALID, TNSZ("movdqu",XMM,16), + +/* [70] */ TNSZ("pshufhw",XMMP,16),INVALID, INVALID, INVALID, +/* [74] */ INVALID, INVALID, INVALID, INVALID, +/* [78] */ INVALID, INVALID, INVALID, INVALID, +/* [7C] */ INVALID, INVALID, TNSZ("movq",XMM,8), TNSZ("movdqu",XMMS,16), + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 01:24:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5292643A; Thu, 27 Feb 2014 01:24:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 228551345; Thu, 27 Feb 2014 01:24:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1R1Om3U016317; Thu, 27 Feb 2014 01:24:48 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1R1Oler016316; Thu, 27 Feb 2014 01:24:47 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402270124.s1R1Oler016316@svn.freebsd.org> From: Mark Johnston Date: Thu, 27 Feb 2014 01:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262543 - head/sys/cddl/dev/dtrace/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 01:24:48 -0000 Author: markj Date: Thu Feb 27 01:24:47 2014 New Revision: 262543 URL: http://svnweb.freebsd.org/changeset/base/262543 Log: Fix the struct reg mappings for i386 and amd64, which differ between illumos and FreeBSD. Submitted by: Prashanth Kumar MFC after: 2 weeks Modified: head/sys/cddl/dev/dtrace/x86/regset.h Modified: head/sys/cddl/dev/dtrace/x86/regset.h ============================================================================== --- head/sys/cddl/dev/dtrace/x86/regset.h Thu Feb 27 01:04:35 2014 (r262542) +++ head/sys/cddl/dev/dtrace/x86/regset.h Thu Feb 27 01:24:47 2014 (r262543) @@ -61,6 +61,7 @@ extern "C" { #define REG_GSBASE 27 #define REG_FSBASE 26 +#if defined(sun) #define REG_DS 25 #define REG_ES 24 @@ -88,11 +89,40 @@ extern "C" { #define REG_R13 2 #define REG_R14 1 #define REG_R15 0 +#else +#define REG_SS 25 +#define REG_RSP 24 +#define REG_RFL 23 +#define REG_CS 22 +#define REG_RIP 21 +#define REG_DS 20 +#define REG_ES 19 +#define REG_ERR 18 +#define REG_GS 17 +#define REG_FS 16 +#define REG_TRAPNO 15 +#define REG_RAX 14 +#define REG_RCX 13 +#define REG_RDX 12 +#define REG_RBX 11 +#define REG_RBP 10 +#define REG_RSI 9 +#define REG_RDI 8 +#define REG_R8 7 +#define REG_R9 6 +#define REG_R10 5 +#define REG_R11 4 +#define REG_R12 3 +#define REG_R13 2 +#define REG_R14 1 +#define REG_R15 0 +#endif /* * The names and offsets defined here are specified by i386 ABI suppl. */ +#if defined(sun) #define SS 18 /* only stored on a privilege transition */ #define UESP 17 /* only stored on a privilege transition */ #define EFL 16 @@ -112,6 +142,27 @@ extern "C" { #define ES 2 #define FS 1 #define GS 0 +#else +#define GS 18 +#define SS 17 /* only stored on a privilege transition */ +#define UESP 16 /* only stored on a privilege transition */ +#define EFL 15 +#define CS 14 +#define EIP 13 +#define ERR 12 +#define TRAPNO 11 +#define EAX 10 +#define ECX 9 +#define EDX 8 +#define EBX 7 +#define ESP 6 +#define EBP 5 +#define ESI 4 +#define EDI 3 +#define DS 2 +#define ES 1 +#define FS 0 +#endif #define REG_PC EIP #define REG_FP EBP From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 04:06:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D0A1FF8; Thu, 27 Feb 2014 04:06:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7932511DC; Thu, 27 Feb 2014 04:06:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1R46Zxi087067; Thu, 27 Feb 2014 04:06:35 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1R46Z6m087066; Thu, 27 Feb 2014 04:06:35 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201402270406.s1R46Z6m087066@svn.freebsd.org> From: Benjamin Kaduk Date: Thu, 27 Feb 2014 04:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262546 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 04:06:35 -0000 Author: bjk (doc committer) Date: Thu Feb 27 04:06:34 2014 New Revision: 262546 URL: http://svnweb.freebsd.org/changeset/base/262546 Log: syncer(4) is a kernel process, not a user process Noticed by: Geoffrey Thomas Approved by: hrs (mentor) Modified: head/lib/libc/sys/sync.2 Modified: head/lib/libc/sys/sync.2 ============================================================================== --- head/lib/libc/sys/sync.2 Thu Feb 27 02:41:41 2014 (r262545) +++ head/lib/libc/sys/sync.2 Thu Feb 27 04:06:34 2014 (r262546) @@ -52,7 +52,7 @@ As information in the cache is lost afte .Fn sync system call is issued frequently -by the user process +by the kernel process .Xr syncer 4 (about every 30 seconds). .Pp From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 04:45:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 607FD624; Thu, 27 Feb 2014 04:45:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2E68214E8; Thu, 27 Feb 2014 04:45:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1R4jUhI004267; Thu, 27 Feb 2014 04:45:30 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1R4jURD004266; Thu, 27 Feb 2014 04:45:30 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201402270445.s1R4jURD004266@svn.freebsd.org> From: Justin Hibbits Date: Thu, 27 Feb 2014 04:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262547 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 04:45:30 -0000 Author: jhibbits Date: Thu Feb 27 04:45:29 2014 New Revision: 262547 URL: http://svnweb.freebsd.org/changeset/base/262547 Log: Fix callchain capture for hwpmc(4). While here, some style(9) fixes, too. MFC after: 2 weeks Modified: head/sys/dev/hwpmc/hwpmc_powerpc.c Modified: head/sys/dev/hwpmc/hwpmc_powerpc.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_powerpc.c Thu Feb 27 04:06:34 2014 (r262546) +++ head/sys/dev/hwpmc/hwpmc_powerpc.c Thu Feb 27 04:45:29 2014 (r262547) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -60,10 +61,14 @@ pmc_save_kernel_callchain(uintptr_t *cc, cc[frames++] = PMC_TRAPFRAME_TO_PC(tf); sp = (uintptr_t *)PMC_TRAPFRAME_TO_FP(tf); - for (frames = 1; frames < maxsamples; frames++) { + for (; frames < maxsamples; frames++) { if (!INKERNEL(sp)) break; +#ifdef __powerpc64__ + cc[frames++] = sp[2]; +#else cc[frames++] = sp[1]; +#endif sp = (uintptr_t *)*sp; } return (frames); @@ -72,12 +77,14 @@ pmc_save_kernel_callchain(uintptr_t *cc, static int powerpc_switch_in(struct pmc_cpu *pc, struct pmc_process *pp) { + return (0); } static int powerpc_switch_out(struct pmc_cpu *pc, struct pmc_process *pp) { + return (0); } @@ -111,6 +118,7 @@ powerpc_describe(int cpu, int ri, struct int powerpc_get_config(int cpu, int ri, struct pmc **ppm) { + *ppm = powerpc_pcpu[cpu]->pc_ppcpmcs[ri].phw_pmc; return (0); @@ -182,11 +190,23 @@ pmc_save_user_callchain(uintptr_t *cc, i cc[frames++] = PMC_TRAPFRAME_TO_PC(tf); sp = (uintptr_t *)PMC_TRAPFRAME_TO_FP(tf); - for (frames = 1; frames < maxsamples; frames++) { + for (; frames < maxsamples; frames++) { if (!INUSER(sp)) break; - cc[frames++] = fuword(sp + 1); - sp = (uintptr_t *)fuword(sp); +#ifdef __powerpc64__ + /* Check if 32-bit mode. */ + if (!(tf->srr1 & PSL_SF)) { + cc[frames++] = fuword32((uint32_t *)sp + 1); + sp = (uintptr_t *)(uintptr_t)fuword32(sp); + } else { + cc[frames++] = fuword(sp + 2); + sp = (uintptr_t *)fuword(sp); + } +#else + cc[frames++] = fuword32((uint32_t *)sp + 1); + sp = (uintptr_t *)fuword32(sp); +#endif } + return (frames); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 08:19:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4299DCD; Thu, 27 Feb 2014 08:19:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D935178F; Thu, 27 Feb 2014 08:19:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1R8JJnq013836; Thu, 27 Feb 2014 08:19:19 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1R8JJHT013835; Thu, 27 Feb 2014 08:19:19 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402270819.s1R8JJHT013835@svn.freebsd.org> From: Warner Losh Date: Thu, 27 Feb 2014 08:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262548 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 08:19:19 -0000 Author: imp Date: Thu Feb 27 08:19:19 2014 New Revision: 262548 URL: http://svnweb.freebsd.org/changeset/base/262548 Log: Style(9) nit: Use tab here. Modified: head/sys/arm/at91/uart_dev_at91usart.c Modified: head/sys/arm/at91/uart_dev_at91usart.c ============================================================================== --- head/sys/arm/at91/uart_dev_at91usart.c Thu Feb 27 04:45:29 2014 (r262547) +++ head/sys/arm/at91/uart_dev_at91usart.c Thu Feb 27 08:19:19 2014 (r262548) @@ -279,7 +279,7 @@ at91_usart_init(struct uart_bas *bas, in * we don't want to hang here forever if the hardware is in a bad state. */ if (!(RD4(bas, USART_CSR) & USART_CSR_TXRDY)) - DELAY(1000); + DELAY(10000); at91_usart_param(bas, baudrate, databits, stopbits, parity); From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 08:21:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6CE03C7; Thu, 27 Feb 2014 08:21:21 +0000 (UTC) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3149317C6; Thu, 27 Feb 2014 08:21:21 +0000 (UTC) Received: from dynamic.1.17.e8edf383af80.685b35818d2c.afb.bredband2.com (dynamic.1.17.e8edf383af80.685b35818d2c.afb.bredband2.com [31.208.68.40]) by mrelayeu.kundenserver.de (node=mreue105) with ESMTP (Nemesis) id 0LoIBN-1WuSp23uzB-00gF2R; Thu, 27 Feb 2014 09:21:10 +0100 Message-ID: <530EF570.1060803@FreeBSD.org> Date: Thu, 27 Feb 2014 09:21:04 +0100 From: Christian Brueffer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r262548 - head/sys/arm/at91 References: <201402270819.s1R8JJHT013835@svn.freebsd.org> In-Reply-To: <201402270819.s1R8JJHT013835@svn.freebsd.org> X-Enigmail-Version: 1.6 OpenPGP: id=3A67DC36; url=http://people.freebsd.org/~brueffer/brueffer.key.asc Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5DKbAMcX9lRcDdh61GKHWHhTJCVIP7dU8" X-Provags-ID: V02:K0:Wkl3HPyVOAruzJY5zfeBv7Dp2mLThvGiuhQxHyG7VUW FZ8vA8txNNCWXRuoAfhIZT2mNQK2MlQxucAorZX+N2JwxTwnY3 7OtZafUF19uiDcvAESTJwvObr8GKZcKheDxQWfS2LNaxwQAt/v +i79HKYt717WsXkdWTHF3nfrAYHgUgTr5UEIJzXOKImvuVi1kq 5X7W5ykyU+wSe6XXDVZgVvCMNTzWIMQEzEffJy5O5svyaRB0Hc v6ecNt/nsWSTseM++wKNPwwjB5+v8Uwn9+fXTKQJYNLrLcyDMp 9OJPHFn6J94OH71+OKQoZhUgQtH3x09nJxTffuq6MDkqspSpOo 3csajvkujcMybRKTD/ZGIdeJKK+2+pBBsjWegDxFAPh6f+RKWJ xemVijUjeYgPmO3W9axBVMloZco1tEqfQYGVVS92aLD/jBiH0d Aoqr4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 08:21:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --5DKbAMcX9lRcDdh61GKHWHhTJCVIP7dU8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2/27/14 9:19 AM, Warner Losh wrote: > Author: imp > Date: Thu Feb 27 08:19:19 2014 > New Revision: 262548 > URL: http://svnweb.freebsd.org/changeset/base/262548 >=20 > Log: > Style(9) nit: Use tab here. >=20 > Modified: > head/sys/arm/at91/uart_dev_at91usart.c >=20 > Modified: head/sys/arm/at91/uart_dev_at91usart.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/arm/at91/uart_dev_at91usart.c Thu Feb 27 04:45:29 2014 (r2= 62547) > +++ head/sys/arm/at91/uart_dev_at91usart.c Thu Feb 27 08:19:19 2014 (r2= 62548) > @@ -279,7 +279,7 @@ at91_usart_init(struct uart_bas *bas, in > * we don't want to hang here forever if the hardware is in a bad sta= te. > */ > if (!(RD4(bas, USART_CSR) & USART_CSR_TXRDY)) > - DELAY(1000); > + DELAY(10000); > =20 > at91_usart_param(bas, baudrate, databits, stopbits, parity); > =20 >=20 This also changes the actual DELAY value, was that intended? Chris --5DKbAMcX9lRcDdh61GKHWHhTJCVIP7dU8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQJ8BAEBCgBmBQJTDvV0XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ5QzhCQjQ5MDgzNDUwNjkyOUM5Mjg2NDE3 OEM4MzY5ODQ3RTE2NDg3AAoJEHjINphH4WSHUXQP/0zFUyUOhJeQxTgkJenFA42e j4KfXkcw0iZWzvnkwtGwY4gI1GDGLTPMZZ0Z4zppBolGYgRevhFlolsq5fBw36bm 4F25AE352OxXaqZC9F/LaTzHhL5281G7n71zEsnqWF7Sutb+8ZfjWMo+xIdHvwMX UxHbpuDMnGKWpFqqpnkOJaZfo93Fg0hij02updr1sFvwbosJ6XsZoMTD94J9+pZi inLot3Cv2yzSE1jq0uyoLGvsTQM+bJr49YSiirUlXL8uyhjhgRBiTEv6/8R1lRUa st101EEgezTHfFGdVu9tNwJ44/AR4DxpC9ZYbLcUK81pN+eKo0RKYZnqRiWggeBV y0HZV7J0uDjygE8r+Y+wARQjfXxsfMQhrBSmd2JcBGtGiM9h37Ly9ZMa+Pqnisn3 cHfiGMkc18xJN9fSjtYNTsc1+UxWY3K7PPzD14o0cCCr5PA8SKdqlv1xPTKs32jf L7tYDcZS/nMf//y1n9teWoaR1u0cvq7yvu5Pxur3gT/wC6gag76sisk5RR5h72Cg mK39pJ6zqMwnL7yBP0reGkho+mtZgeenaNoK4zpvujwQcMPol6cozR0KpJgacmQ1 CsVISzyJaWSZ9AFHNSsuNcg4JLrPCrSwNEyd/lu8vkQzizpZOwdWwRf6dgMxWVTE 9zQE8BxJGPeyIA+SYHXb =bcto -----END PGP SIGNATURE----- --5DKbAMcX9lRcDdh61GKHWHhTJCVIP7dU8-- From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 08:21:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37A58592; Thu, 27 Feb 2014 08:21:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E69C617CE; Thu, 27 Feb 2014 08:21:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1R8LS4R017593; Thu, 27 Feb 2014 08:21:28 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1R8LSaO017590; Thu, 27 Feb 2014 08:21:28 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402270821.s1R8LSaO017590@svn.freebsd.org> From: Warner Losh Date: Thu, 27 Feb 2014 08:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262549 - head/sys/dev/aic7xxx/aicasm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 08:21:29 -0000 Author: imp Date: Thu Feb 27 08:21:28 2014 New Revision: 262549 URL: http://svnweb.freebsd.org/changeset/base/262549 Log: Don't complain about missing prototypes to ease bootstrap issues. Modified: head/sys/dev/aic7xxx/aicasm/Makefile Modified: head/sys/dev/aic7xxx/aicasm/Makefile ============================================================================== --- head/sys/dev/aic7xxx/aicasm/Makefile Thu Feb 27 08:19:19 2014 (r262548) +++ head/sys/dev/aic7xxx/aicasm/Makefile Thu Feb 27 08:21:28 2014 (r262549) @@ -43,3 +43,4 @@ BINDIR=/usr/bin build-tools: ${PROG} .include +CFLAGS+= -Wno-missing-prototypes From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 08:36:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF8EADF3; Thu, 27 Feb 2014 08:36:05 +0000 (UTC) Received: from mail-pb0-x22a.google.com (mail-pb0-x22a.google.com [IPv6:2607:f8b0:400e:c01::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A16219B6; Thu, 27 Feb 2014 08:36:05 +0000 (UTC) Received: by mail-pb0-f42.google.com with SMTP id rr13so2222163pbb.15 for ; Thu, 27 Feb 2014 00:36:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=nr4V2z97FNajtFI5vAbEciGwLLiPkTffE1HAzg7bd3s=; b=JtlhS+igCIIMSAFZb7tP/GjwAVW7dm+JtjqRHF9n29igUnF0G+Aj++Uwp6YSUQIJue zDcxNzLwfOqv4a85u762aiwaDM0K9KTxCqgC6OU2SIYMI9ZL5kfeFSe1HRA3U8fjM5YC y2qMNycNs5XOo3ZffQy0lUsvX/TZNqz9GcgBBNYUQ7b1HuVdpmHGcmk8a8JKlZnjh4Wv pTzEdX2DNLlxHvEtEp44HSpSiPovhdWXIuOJGEfAGqND+/PoVLPJPBNfJJGoxpxN4E9A fSZ8GbWLYTE7wJQlN75hR/T+6+DMnk19c6kILEZy2mM7nbuYR2d6Pb6Adjbfib5Pufi8 R2xg== X-Received: by 10.68.93.161 with SMTP id cv1mr12222853pbb.122.1393490165062; Thu, 27 Feb 2014 00:36:05 -0800 (PST) Received: from [10.64.24.120] (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id zc6sm25895562pab.18.2014.02.27.00.36.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Feb 2014 00:36:03 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r262548 - head/sys/arm/at91 From: Warner Losh In-Reply-To: <530EF570.1060803@FreeBSD.org> Date: Thu, 27 Feb 2014 00:35:58 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201402270819.s1R8JJHT013835@svn.freebsd.org> <530EF570.1060803@FreeBSD.org> To: Christian Brueffer X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 08:36:05 -0000 On Feb 27, 2014, at 12:21 AM, Christian Brueffer = wrote: > On 2/27/14 9:19 AM, Warner Losh wrote: >> Author: imp >> Date: Thu Feb 27 08:19:19 2014 >> New Revision: 262548 >> URL: http://svnweb.freebsd.org/changeset/base/262548 >>=20 >> Log: >> Style(9) nit: Use tab here. >>=20 >> Modified: >> head/sys/arm/at91/uart_dev_at91usart.c >>=20 >> Modified: head/sys/arm/at91/uart_dev_at91usart.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/arm/at91/uart_dev_at91usart.c Thu Feb 27 04:45:29 2014 = (r262547) >> +++ head/sys/arm/at91/uart_dev_at91usart.c Thu Feb 27 08:19:19 2014 = (r262548) >> @@ -279,7 +279,7 @@ at91_usart_init(struct uart_bas *bas, in >> * we don't want to hang here forever if the hardware is in a = bad state. >> */ >> if (!(RD4(bas, USART_CSR) & USART_CSR_TXRDY)) >> - DELAY(1000); >> + DELAY(10000); >>=20 >> at91_usart_param(bas, baudrate, databits, stopbits, parity); >>=20 >>=20 >=20 > This also changes the actual DELAY value, was that intended? Yes. It should have been documented when I made the change, but I did = this a while ago and missed the extra zero when I prepared the commit. = My bad. Warner= From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 08:57:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 566FBF6C; Thu, 27 Feb 2014 08:57:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3E3F11C34; Thu, 27 Feb 2014 08:57:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1R8vcoG037032; Thu, 27 Feb 2014 08:57:38 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1R8vcif037031; Thu, 27 Feb 2014 08:57:38 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402270857.s1R8vcif037031@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 27 Feb 2014 08:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262550 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 08:57:38 -0000 Author: hselasky Date: Thu Feb 27 08:57:37 2014 New Revision: 262550 URL: http://svnweb.freebsd.org/changeset/base/262550 Log: Add support for kqfilter to USB character devices. Submitted by: Kohji Okuno MFC after: 2 weeks Modified: head/sys/dev/usb/usb_dev.c Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Thu Feb 27 08:21:28 2014 (r262549) +++ head/sys/dev/usb/usb_dev.c Thu Feb 27 08:57:37 2014 (r262550) @@ -124,6 +124,7 @@ static d_ioctl_t usb_ioctl; static d_read_t usb_read; static d_write_t usb_write; static d_poll_t usb_poll; +static d_kqfilter_t usb_kqfilter; static d_ioctl_t usb_static_ioctl; @@ -141,7 +142,8 @@ struct cdevsw usb_devsw = { .d_flags = D_TRACKCLOSE, .d_read = usb_read, .d_write = usb_write, - .d_poll = usb_poll + .d_poll = usb_poll, + .d_kqfilter = usb_kqfilter, }; static struct cdev* usb_dev = NULL; @@ -509,6 +511,7 @@ usb_fifo_create(struct usb_cdev_privdata f->fifo_index = n + USB_FIFO_TX; f->dev_ep_index = e; f->priv_mtx = &udev->device_mtx; + knlist_init_mtx(&f->selinfo.si_note, f->priv_mtx); f->priv_sc0 = ep; f->methods = &usb_ugen_methods; f->iface_index = ep->iface_index; @@ -536,6 +539,7 @@ usb_fifo_create(struct usb_cdev_privdata f->fifo_index = n + USB_FIFO_RX; f->dev_ep_index = e; f->priv_mtx = &udev->device_mtx; + knlist_init_mtx(&f->selinfo.si_note, f->priv_mtx); f->priv_sc0 = ep; f->methods = &usb_ugen_methods; f->iface_index = ep->iface_index; @@ -774,7 +778,12 @@ usb_fifo_close(struct usb_fifo *f, int f mtx_lock(f->priv_mtx); /* clear current cdev private data pointer */ + mtx_lock(&usb_ref_lock); f->curr_cpd = NULL; + mtx_unlock(&usb_ref_lock); + + /* check if we are watched by kevent */ + KNOTE_LOCKED(&f->selinfo.si_note, 0); /* check if we are selected */ if (f->flag_isselect) { @@ -1117,6 +1126,162 @@ done: return (err); } +static void +usb_filter_detach(struct knote *kn) +{ + struct usb_fifo *f = kn->kn_hook; + knlist_remove(&f->selinfo.si_note, kn, 0); +} + +static int +usb_filter_write(struct knote *kn, long hint) +{ + struct usb_cdev_privdata* cpd; + struct usb_fifo *f; + struct usb_mbuf *m; + + DPRINTFN(2, "\n"); + + f = kn->kn_hook; + + mtx_assert(f->priv_mtx, MA_OWNED); + + cpd = f->curr_cpd; + if (cpd == NULL) { + m = (void *)1; + } else if (f->fs_ep_max == 0) { + if (f->flag_iserror) { + /* we got an error */ + m = (void *)1; + } else { + if (f->queue_data == NULL) { + /* + * start write transfer, if not + * already started + */ + (f->methods->f_start_write) (f); + } + /* check if any packets are available */ + USB_IF_POLL(&f->free_q, m); + } + } else { + if (f->flag_iscomplete) { + m = (void *)1; + } else { + m = NULL; + } + } + return (m ? 1 : 0); +} + +static int +usb_filter_read(struct knote *kn, long hint) +{ + struct usb_cdev_privdata* cpd; + struct usb_fifo *f; + struct usb_mbuf *m; + + DPRINTFN(2, "\n"); + + f = kn->kn_hook; + + mtx_assert(f->priv_mtx, MA_OWNED); + + cpd = f->curr_cpd; + if (cpd == NULL) { + m = (void *)1; + } else if (f->fs_ep_max == 0) { + if (f->flag_iserror) { + /* we have an error */ + m = (void *)1; + } else { + if (f->queue_data == NULL) { + /* + * start read transfer, if not + * already started + */ + (f->methods->f_start_read) (f); + } + /* check if any packets are available */ + USB_IF_POLL(&f->used_q, m); + + /* start reading data, if any */ + if (m == NULL) + (f->methods->f_start_read) (f); + } + } else { + if (f->flag_iscomplete) { + m = (void *)1; + } else { + m = NULL; + } + } + return (m ? 1 : 0); +} + +static struct filterops usb_filtops_write = { + .f_isfd = 1, + .f_detach = usb_filter_detach, + .f_event = usb_filter_write, +}; + +static struct filterops usb_filtops_read = { + .f_isfd = 1, + .f_detach = usb_filter_detach, + .f_event = usb_filter_read, +}; + + +/* ARGSUSED */ +static int +usb_kqfilter(struct cdev* dev, struct knote *kn) +{ + struct usb_cdev_refdata refs; + struct usb_cdev_privdata* cpd; + struct usb_fifo *f; + int fflags; + int err = EINVAL; + + DPRINTFN(2, "\n"); + + if (devfs_get_cdevpriv((void **)&cpd) != 0 || + usb_ref_device(cpd, &refs, 0) != 0) + return (ENXIO); + + fflags = cpd->fflags; + + /* Figure out who needs service */ + switch (kn->kn_filter) { + case EVFILT_WRITE: + if (fflags & FWRITE) { + f = refs.txfifo; + kn->kn_fop = &usb_filtops_write; + err = 0; + } + break; + case EVFILT_READ: + if (fflags & FREAD) { + f = refs.rxfifo; + kn->kn_fop = &usb_filtops_read; + err = 0; + } + break; + default: + err = EOPNOTSUPP; + break; + } + + if (err == 0) { + kn->kn_hook = f; + mtx_lock(f->priv_mtx); + knlist_add(&f->selinfo.si_note, kn, 1); + mtx_unlock(f->priv_mtx); + } + + usb_unref_device(cpd, &refs); + return (err); +} + /* ARGSUSED */ static int usb_poll(struct cdev* dev, int events, struct thread* td) @@ -1184,7 +1349,7 @@ usb_poll(struct cdev* dev, int events, s if (!refs.is_usbfs) { if (f->flag_iserror) { - /* we have and error */ + /* we have an error */ m = (void *)1; } else { if (f->queue_data == NULL) { @@ -1581,6 +1746,8 @@ usb_fifo_wakeup(struct usb_fifo *f) { usb_fifo_signal(f); + KNOTE_LOCKED(&f->selinfo.si_note, 0); + if (f->flag_isselect) { selwakeup(&f->selinfo); f->flag_isselect = 0; @@ -1709,6 +1876,7 @@ usb_fifo_attach(struct usb_device *udev, f_tx->fifo_index = n + USB_FIFO_TX; f_tx->dev_ep_index = -1; f_tx->priv_mtx = priv_mtx; + knlist_init_mtx(&f_tx->selinfo.si_note, priv_mtx); f_tx->priv_sc0 = priv_sc; f_tx->methods = pm; f_tx->iface_index = iface_index; @@ -1717,6 +1885,7 @@ usb_fifo_attach(struct usb_device *udev, f_rx->fifo_index = n + USB_FIFO_RX; f_rx->dev_ep_index = -1; f_rx->priv_mtx = priv_mtx; + knlist_init_mtx(&f_rx->selinfo.si_note, priv_mtx); f_rx->priv_sc0 = priv_sc; f_rx->methods = pm; f_rx->iface_index = iface_index; From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 09:15:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6DBC783; Thu, 27 Feb 2014 09:15:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B21D81F58; Thu, 27 Feb 2014 09:15:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1R9FwKr049309; Thu, 27 Feb 2014 09:15:58 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1R9FwS7049308; Thu, 27 Feb 2014 09:15:58 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402270915.s1R9FwS7049308@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 27 Feb 2014 09:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262551 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 09:15:59 -0000 Author: hselasky Date: Thu Feb 27 09:15:58 2014 New Revision: 262551 URL: http://svnweb.freebsd.org/changeset/base/262551 Log: Add missing call to "knlist_destroy()". Found by: John-Mark Gurney MFC after: 2 weeks Modified: head/sys/dev/usb/usb_dev.c Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Thu Feb 27 08:57:37 2014 (r262550) +++ head/sys/dev/usb/usb_dev.c Thu Feb 27 09:15:58 2014 (r262551) @@ -109,7 +109,7 @@ static void usb_dev_uninit(void *); static int usb_fifo_uiomove(struct usb_fifo *, void *, int, struct uio *); static void usb_fifo_check_methods(struct usb_fifo_methods *); -static struct usb_fifo *usb_fifo_alloc(void); +static struct usb_fifo *usb_fifo_alloc(struct mtx *); static struct usb_endpoint *usb_dev_get_ep(struct usb_device *, uint8_t, uint8_t); static void usb_loc_fill(struct usb_fs_privdata *, @@ -370,15 +370,17 @@ usb_unref_device(struct usb_cdev_privdat } static struct usb_fifo * -usb_fifo_alloc(void) +usb_fifo_alloc(struct mtx *mtx) { struct usb_fifo *f; f = malloc(sizeof(*f), M_USBDEV, M_WAITOK | M_ZERO); - if (f) { + if (f != NULL) { cv_init(&f->cv_io, "FIFO-IO"); cv_init(&f->cv_drain, "FIFO-DRAIN"); + f->priv_mtx = mtx; f->refcount = 1; + knlist_init_mtx(&f->selinfo.si_note, mtx); } return (f); } @@ -502,7 +504,7 @@ usb_fifo_create(struct usb_cdev_privdata DPRINTFN(5, "dev_get_endpoint returned NULL\n"); return (EINVAL); } - f = usb_fifo_alloc(); + f = usb_fifo_alloc(&udev->device_mtx); if (f == NULL) { DPRINTFN(5, "could not alloc tx fifo\n"); return (ENOMEM); @@ -510,8 +512,6 @@ usb_fifo_create(struct usb_cdev_privdata /* update some fields */ f->fifo_index = n + USB_FIFO_TX; f->dev_ep_index = e; - f->priv_mtx = &udev->device_mtx; - knlist_init_mtx(&f->selinfo.si_note, f->priv_mtx); f->priv_sc0 = ep; f->methods = &usb_ugen_methods; f->iface_index = ep->iface_index; @@ -530,7 +530,7 @@ usb_fifo_create(struct usb_cdev_privdata DPRINTFN(5, "dev_get_endpoint returned NULL\n"); return (EINVAL); } - f = usb_fifo_alloc(); + f = usb_fifo_alloc(&udev->device_mtx); if (f == NULL) { DPRINTFN(5, "could not alloc rx fifo\n"); return (ENOMEM); @@ -538,8 +538,6 @@ usb_fifo_create(struct usb_cdev_privdata /* update some fields */ f->fifo_index = n + USB_FIFO_RX; f->dev_ep_index = e; - f->priv_mtx = &udev->device_mtx; - knlist_init_mtx(&f->selinfo.si_note, f->priv_mtx); f->priv_sc0 = ep; f->methods = &usb_ugen_methods; f->iface_index = ep->iface_index; @@ -624,6 +622,8 @@ usb_fifo_free(struct usb_fifo *f) cv_destroy(&f->cv_io); cv_destroy(&f->cv_drain); + knlist_destroy(&f->selinfo.si_note); + free(f, M_USBDEV); } @@ -1863,8 +1863,8 @@ usb_fifo_attach(struct usb_device *udev, break; } - f_tx = usb_fifo_alloc(); - f_rx = usb_fifo_alloc(); + f_tx = usb_fifo_alloc(priv_mtx); + f_rx = usb_fifo_alloc(priv_mtx); if ((f_tx == NULL) || (f_rx == NULL)) { usb_fifo_free(f_tx); @@ -1875,8 +1875,6 @@ usb_fifo_attach(struct usb_device *udev, f_tx->fifo_index = n + USB_FIFO_TX; f_tx->dev_ep_index = -1; - f_tx->priv_mtx = priv_mtx; - knlist_init_mtx(&f_tx->selinfo.si_note, priv_mtx); f_tx->priv_sc0 = priv_sc; f_tx->methods = pm; f_tx->iface_index = iface_index; @@ -1884,8 +1882,6 @@ usb_fifo_attach(struct usb_device *udev, f_rx->fifo_index = n + USB_FIFO_RX; f_rx->dev_ep_index = -1; - f_rx->priv_mtx = priv_mtx; - knlist_init_mtx(&f_rx->selinfo.si_note, priv_mtx); f_rx->priv_sc0 = priv_sc; f_rx->methods = pm; f_rx->iface_index = iface_index; From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 09:59:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7A0A50C; Thu, 27 Feb 2014 09:59:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A7F0F13AF; Thu, 27 Feb 2014 09:59:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1R9xGjp071418; Thu, 27 Feb 2014 09:59:16 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1R9xGBe071414; Thu, 27 Feb 2014 09:59:16 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201402270959.s1R9xGBe071414@svn.freebsd.org> From: Ruslan Bukin Date: Thu, 27 Feb 2014 09:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262552 - in head/sys/arm: conf freescale/vybrid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 09:59:16 -0000 Author: br Date: Thu Feb 27 09:59:15 2014 New Revision: 262552 URL: http://svnweb.freebsd.org/changeset/base/262552 Log: Add driver for Inter-Integrated Circuit (I2C). Added: head/sys/arm/freescale/vybrid/vf_i2c.c (contents, props changed) Modified: head/sys/arm/conf/VYBRID.common head/sys/arm/freescale/vybrid/files.vybrid Modified: head/sys/arm/conf/VYBRID.common ============================================================================== --- head/sys/arm/conf/VYBRID.common Thu Feb 27 09:15:58 2014 (r262551) +++ head/sys/arm/conf/VYBRID.common Thu Feb 27 09:59:15 2014 (r262552) @@ -124,8 +124,8 @@ device nand device uart # I2C (TWSI) -#device iic -#device iicbus +device iic +device iicbus # Ethernet device ether Modified: head/sys/arm/freescale/vybrid/files.vybrid ============================================================================== --- head/sys/arm/freescale/vybrid/files.vybrid Thu Feb 27 09:15:58 2014 (r262551) +++ head/sys/arm/freescale/vybrid/files.vybrid Thu Feb 27 09:59:15 2014 (r262552) @@ -23,6 +23,7 @@ arm/freescale/vybrid/vf_mscm.c standar arm/freescale/vybrid/vf_src.c standard arm/freescale/vybrid/vf_edma.c standard arm/freescale/vybrid/vf_dmamux.c standard +arm/freescale/vybrid/vf_i2c.c optional iicbus arm/freescale/vybrid/vf_tcon.c optional vt arm/freescale/vybrid/vf_dcu4.c optional vt arm/freescale/vybrid/vf_nfc.c optional nand Added: head/sys/arm/freescale/vybrid/vf_i2c.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/vybrid/vf_i2c.c Thu Feb 27 09:59:15 2014 (r262552) @@ -0,0 +1,498 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Vybrid Family Inter-Integrated Circuit (I2C) + * Chapter 48, Vybrid Reference Manual, Rev. 5, 07/2013 + */ + +/* + * This driver is based on the I2C driver for IMX (imx/i2c.c). + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "iicbus_if.h" + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#define I2C_IBAD 0x0 /* I2C Bus Address Register */ +#define I2C_IBFD 0x1 /* I2C Bus Frequency Divider Register */ +#define I2C_IBCR 0x2 /* I2C Bus Control Register */ +#define IBCR_MDIS (1 << 7) /* Module disable. */ +#define IBCR_IBIE (1 << 6) /* I-Bus Interrupt Enable. */ +#define IBCR_MSSL (1 << 5) /* Master/Slave mode select. */ +#define IBCR_TXRX (1 << 4) /* Transmit/Receive mode select. */ +#define IBCR_NOACK (1 << 3) /* Data Acknowledge disable. */ +#define IBCR_RSTA (1 << 2) /* Repeat Start. */ +#define IBCR_DMAEN (1 << 1) /* DMA Enable. */ +#define I2C_IBSR 0x3 /* I2C Bus Status Register */ +#define IBSR_TCF (1 << 7) /* Transfer complete. */ +#define IBSR_IAAS (1 << 6) /* Addressed as a slave. */ +#define IBSR_IBB (1 << 5) /* Bus busy. */ +#define IBSR_IBAL (1 << 4) /* Arbitration Lost. */ +#define IBSR_SRW (1 << 2) /* Slave Read/Write. */ +#define IBSR_IBIF (1 << 1) /* I-Bus Interrupt Flag. */ +#define IBSR_RXAK (1 << 0) /* Received Acknowledge. */ +#define I2C_IBDR 0x4 /* I2C Bus Data I/O Register */ +#define I2C_IBIC 0x5 /* I2C Bus Interrupt Config Register */ +#define IBIC_BIIE (1 << 7) /* Bus Idle Interrupt Enable bit. */ +#define I2C_IBDBG 0x6 /* I2C Bus Debug Register */ + +#ifdef DEBUG +#define vf_i2c_dbg(_sc, fmt, args...) \ + device_printf((_sc)->dev, fmt, ##args) +#else +#define vf_i2c_dbg(_sc, fmt, args...) +#endif + +static int i2c_repeated_start(device_t, u_char, int); +static int i2c_start(device_t, u_char, int); +static int i2c_stop(device_t); +static int i2c_reset(device_t, u_char, u_char, u_char *); +static int i2c_read(device_t, char *, int, int *, int, int); +static int i2c_write(device_t, const char *, int, int *, int); + +struct i2c_softc { + struct resource *res[2]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + void *ih; + device_t dev; + device_t iicbus; + struct mtx mutex; + int ibif; +}; + +static struct resource_spec i2c_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static void +i2c_intr(void *arg) +{ + struct i2c_softc *sc; + + sc = arg; + + if (READ1(sc, I2C_IBSR) & IBSR_IBIF) { + WRITE1(sc, I2C_IBSR, IBSR_IBIF); + sc->ibif = 1; + } +} + +static int +i2c_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-i2c")) + return (ENXIO); + + device_set_desc(dev, "Vybrid Family Inter-Integrated Circuit (I2C)"); + return (BUS_PROBE_DEFAULT); +} + +static int +i2c_attach(device_t dev) +{ + struct i2c_softc *sc; + int err; + + sc = device_get_softc(dev); + sc->dev = dev; + + mtx_init(&sc->mutex, device_get_nameunit(dev), "I2C", MTX_DEF); + + if (bus_alloc_resources(dev, i2c_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + /* Setup interrupt handler */ + err = bus_setup_intr(dev, sc->res[1], INTR_TYPE_BIO | INTR_MPSAFE, + NULL, i2c_intr, sc, &sc->ih); + if (err) { + device_printf(dev, "Unable to alloc interrupt resource.\n"); + return (ENXIO); + } + + WRITE1(sc, I2C_IBIC, IBIC_BIIE); + + sc->iicbus = device_add_child(dev, "iicbus", -1); + if (sc->iicbus == NULL) { + device_printf(dev, "could not add iicbus child"); + mtx_destroy(&sc->mutex); + return (ENXIO); + } + + bus_generic_attach(dev); + + return (0); +} + +/* Wait for transfer interrupt flag */ +static int +wait_for_iif(struct i2c_softc *sc) +{ + int retry; + + retry = 1000; + while (retry --) { + if (sc->ibif == 1) + return (IIC_NOERR); + DELAY(10); + } + + return (IIC_ETIMEOUT); +} + +/* Wait for free bus */ +static int +wait_for_nibb(struct i2c_softc *sc) +{ + int retry; + + retry = 1000; + while (retry --) { + if ((READ1(sc, I2C_IBSR) & IBSR_IBB) == 0) + return (IIC_NOERR); + DELAY(10); + } + + return (IIC_ETIMEOUT); +} + +/* Wait for transfer complete+interrupt flag */ +static int +wait_for_icf(struct i2c_softc *sc) +{ + int retry; + + retry = 1000; + while (retry --) { + if (READ1(sc, I2C_IBSR) & IBSR_TCF) { + if (sc->ibif == 1) + return (IIC_NOERR); + } + DELAY(10); + } + + return (IIC_ETIMEOUT); +} + +static int +i2c_repeated_start(device_t dev, u_char slave, int timeout) +{ + struct i2c_softc *sc; + int error; + int reg; + + sc = device_get_softc(dev); + + vf_i2c_dbg(sc, "i2c repeated start\n"); + + mtx_lock(&sc->mutex); + + WRITE1(sc, I2C_IBAD, slave); + + if ((READ1(sc, I2C_IBSR) & IBSR_IBB) == 0) { + mtx_unlock(&sc->mutex); + return (IIC_EBUSBSY); + } + + /* Set repeated start condition */ + DELAY(10); + + reg = READ1(sc, I2C_IBCR); + reg |= (IBCR_RSTA | IBCR_IBIE); + WRITE1(sc, I2C_IBCR, reg); + + DELAY(10); + + sc->ibif = 0; + + /* Write target address - LSB is R/W bit */ + WRITE1(sc, I2C_IBDR, slave); + + error = wait_for_iif(sc); + + mtx_unlock(&sc->mutex); + + if (error) + return (error); + + return (IIC_NOERR); +} + +static int +i2c_start(device_t dev, u_char slave, int timeout) +{ + struct i2c_softc *sc; + int error; + int reg; + + sc = device_get_softc(dev); + + vf_i2c_dbg(sc, "i2c start\n"); + + mtx_lock(&sc->mutex); + + WRITE1(sc, I2C_IBAD, slave); + + if (READ1(sc, I2C_IBSR) & IBSR_IBB) { + mtx_unlock(&sc->mutex); + vf_i2c_dbg(sc, "cant i2c start: IIC_EBUSBSY\n"); + return (IIC_EBUSBSY); + } + + /* Set start condition */ + reg = (IBCR_MSSL | IBCR_NOACK | IBCR_IBIE); + WRITE1(sc, I2C_IBCR, reg); + + DELAY(100); + + reg |= (IBCR_TXRX); + WRITE1(sc, I2C_IBCR, reg); + + sc->ibif = 0; + + /* Write target address - LSB is R/W bit */ + WRITE1(sc, I2C_IBDR, slave); + + error = wait_for_iif(sc); + + mtx_unlock(&sc->mutex); + if (error) { + vf_i2c_dbg(sc, "cant i2c start: iif error\n"); + return (error); + } + + return (IIC_NOERR); +} + +static int +i2c_stop(device_t dev) +{ + struct i2c_softc *sc; + + sc = device_get_softc(dev); + + vf_i2c_dbg(sc, "i2c stop\n"); + + mtx_lock(&sc->mutex); + + WRITE1(sc, I2C_IBCR, IBCR_NOACK | IBCR_IBIE); + + DELAY(100); + + /* Reset controller if bus still busy after STOP */ + if (wait_for_nibb(sc) == IIC_ETIMEOUT) { + WRITE1(sc, I2C_IBCR, IBCR_MDIS); + DELAY(1000); + WRITE1(sc, I2C_IBCR, IBCR_NOACK); + } + mtx_unlock(&sc->mutex); + + return (IIC_NOERR); +} + +static int +i2c_reset(device_t dev, u_char speed, u_char addr, u_char *oldadr) +{ + struct i2c_softc *sc; + + sc = device_get_softc(dev); + + vf_i2c_dbg(sc, "i2c reset\n"); + + switch (speed) { + case IIC_FAST: + case IIC_SLOW: + case IIC_UNKNOWN: + case IIC_FASTEST: + default: + break; + } + + mtx_lock(&sc->mutex); + WRITE1(sc, I2C_IBCR, IBCR_MDIS); + + DELAY(1000); + + WRITE1(sc, I2C_IBFD, 20); + WRITE1(sc, I2C_IBCR, 0x0); /* Enable i2c */ + + DELAY(1000); + + mtx_unlock(&sc->mutex); + + return (IIC_NOERR); +} + +static int +i2c_read(device_t dev, char *buf, int len, int *read, int last, int delay) +{ + struct i2c_softc *sc; + int error; + + sc = device_get_softc(dev); + + vf_i2c_dbg(sc, "i2c read\n"); + + *read = 0; + + mtx_lock(&sc->mutex); + + if (len) { + if (len == 1) + WRITE1(sc, I2C_IBCR, IBCR_IBIE | IBCR_MSSL | \ + IBCR_NOACK); + else + WRITE1(sc, I2C_IBCR, IBCR_IBIE | IBCR_MSSL); + + /* dummy read */ + sc->ibif = 0; + READ1(sc, I2C_IBDR); + DELAY(1000); + } + + while (*read < len) { + error = wait_for_icf(sc); + if (error) { + mtx_unlock(&sc->mutex); + return (error); + } + + if ((*read == len - 2) && last) { + /* NO ACK on last byte */ + WRITE1(sc, I2C_IBCR, IBCR_IBIE | IBCR_MSSL | \ + IBCR_NOACK); + } + + if ((*read == len - 1) && last) { + /* Transfer done, remove master bit */ + WRITE1(sc, I2C_IBCR, IBCR_IBIE | IBCR_NOACK); + } + + sc->ibif = 0; + *buf++ = READ1(sc, I2C_IBDR); + (*read)++; + } + mtx_unlock(&sc->mutex); + + return (IIC_NOERR); +} + +static int +i2c_write(device_t dev, const char *buf, int len, int *sent, int timeout) +{ + struct i2c_softc *sc; + int error; + + sc = device_get_softc(dev); + + vf_i2c_dbg(sc, "i2c write\n"); + + *sent = 0; + + mtx_lock(&sc->mutex); + while (*sent < len) { + sc->ibif = 0; + + WRITE1(sc, I2C_IBDR, *buf++); + + error = wait_for_iif(sc); + if (error) { + mtx_unlock(&sc->mutex); + return (error); + } + + (*sent)++; + } + mtx_unlock(&sc->mutex); + + return (IIC_NOERR); +} + +static device_method_t i2c_methods[] = { + DEVMETHOD(device_probe, i2c_probe), + DEVMETHOD(device_attach, i2c_attach), + + DEVMETHOD(iicbus_callback, iicbus_null_callback), + DEVMETHOD(iicbus_repeated_start, i2c_repeated_start), + DEVMETHOD(iicbus_start, i2c_start), + DEVMETHOD(iicbus_stop, i2c_stop), + DEVMETHOD(iicbus_reset, i2c_reset), + DEVMETHOD(iicbus_read, i2c_read), + DEVMETHOD(iicbus_write, i2c_write), + DEVMETHOD(iicbus_transfer, iicbus_transfer_gen), + + { 0, 0 } +}; + +static driver_t i2c_driver = { + "i2c", + i2c_methods, + sizeof(struct i2c_softc), +}; + +static devclass_t i2c_devclass; + +DRIVER_MODULE(i2c, simplebus, i2c_driver, i2c_devclass, 0, 0); +DRIVER_MODULE(iicbus, i2c, iicbus_driver, iicbus_devclass, 0, 0); From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 11:34:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D078A97; Thu, 27 Feb 2014 11:34:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 39CA31C06; Thu, 27 Feb 2014 11:34:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1RBYRgv014286; Thu, 27 Feb 2014 11:34:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RBYRu8014285; Thu, 27 Feb 2014 11:34:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402271134.s1RBYRu8014285@svn.freebsd.org> From: Alexander Motin Date: Thu, 27 Feb 2014 11:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262553 - head/sys/dev/mps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 11:34:27 -0000 Author: mav Date: Thu Feb 27 11:34:26 2014 New Revision: 262553 URL: http://svnweb.freebsd.org/changeset/base/262553 Log: Pass proper pointer to bus_dmamem_free() in mps_iocfacts_free(). Passing there pointer into the middle of allocated area caused kernel panic during reinit, for example, after firmware upgrade. MFC after: 1 week Modified: head/sys/dev/mps/mps.c Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Thu Feb 27 09:59:15 2014 (r262552) +++ head/sys/dev/mps/mps.c Thu Feb 27 11:34:26 2014 (r262553) @@ -617,8 +617,8 @@ mps_iocfacts_free(struct mps_softc *sc) if (sc->post_busaddr != 0) bus_dmamap_unload(sc->queues_dmat, sc->queues_map); - if (sc->post_queue != NULL) - bus_dmamem_free(sc->queues_dmat, sc->post_queue, + if (sc->free_queue != NULL) + bus_dmamem_free(sc->queues_dmat, sc->free_queue, sc->queues_map); if (sc->queues_dmat != NULL) bus_dma_tag_destroy(sc->queues_dmat); From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 12:11:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DA9B6C1; Thu, 27 Feb 2014 12:11:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EDE0210BD; Thu, 27 Feb 2014 12:11:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1RCBh9E032103; Thu, 27 Feb 2014 12:11:43 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RCBhE1032102; Thu, 27 Feb 2014 12:11:43 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201402271211.s1RCBhE1032102@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 27 Feb 2014 12:11:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262554 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 12:11:44 -0000 Author: hselasky Date: Thu Feb 27 12:11:43 2014 New Revision: 262554 URL: http://svnweb.freebsd.org/changeset/base/262554 Log: Clear the knote list before destroying it. Add seldrain() to wakeup any pollers. Submitted by: Kohji Okuno MFC after: 2 weeks Modified: head/sys/dev/usb/usb_dev.c Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Thu Feb 27 11:34:26 2014 (r262553) +++ head/sys/dev/usb/usb_dev.c Thu Feb 27 12:11:43 2014 (r262554) @@ -622,6 +622,8 @@ usb_fifo_free(struct usb_fifo *f) cv_destroy(&f->cv_io); cv_destroy(&f->cv_drain); + knlist_clear(&f->selinfo.si_note, 0); + seldrain(&f->selinfo); knlist_destroy(&f->selinfo.si_note); free(f, M_USBDEV); From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 13:05:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0AA8668; Thu, 27 Feb 2014 13:05:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8CD7315CD; Thu, 27 Feb 2014 13:05:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1RD5ug9054476; Thu, 27 Feb 2014 13:05:56 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RD5uMx054475; Thu, 27 Feb 2014 13:05:56 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201402271305.s1RD5uMx054475@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 27 Feb 2014 13:05:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262555 - head/usr.sbin/ntp/sntp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 13:05:56 -0000 Author: des Date: Thu Feb 27 13:05:56 2014 New Revision: 262555 URL: http://svnweb.freebsd.org/changeset/base/262555 Log: We install the tool, so why not the man page? MFC after: 3 days Modified: head/usr.sbin/ntp/sntp/Makefile Modified: head/usr.sbin/ntp/sntp/Makefile ============================================================================== --- head/usr.sbin/ntp/sntp/Makefile Thu Feb 27 12:11:43 2014 (r262554) +++ head/usr.sbin/ntp/sntp/Makefile Thu Feb 27 13:05:56 2014 (r262555) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../../contrib/ntp/sntp PROG= sntp -NO_MAN= +MAN= sntp.1 SRCS= internet.c main.c socket.c timing.c unix.c CFLAGS+= -I${.CURDIR}/../../../contrib/ntp/include -I${.CURDIR}/../ \ From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 13:26:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A56A2C8; Thu, 27 Feb 2014 13:26:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 73D0D17C7; Thu, 27 Feb 2014 13:26:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1RDQg8x063770; Thu, 27 Feb 2014 13:26:42 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RDQfLV063767; Thu, 27 Feb 2014 13:26:41 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201402271326.s1RDQfLV063767@svn.freebsd.org> From: Luiz Otavio O Souza Date: Thu, 27 Feb 2014 13:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262559 - in head/sys/modules/gpio: gpiobus gpioiic gpioled X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 13:26:42 -0000 Author: loos Date: Thu Feb 27 13:26:41 2014 New Revision: 262559 URL: http://svnweb.freebsd.org/changeset/base/262559 Log: Inspired by r262522, fix make depend. This fixes the build of gpio modules. Approved by: adrian (mentor) Modified: head/sys/modules/gpio/gpiobus/Makefile head/sys/modules/gpio/gpioiic/Makefile head/sys/modules/gpio/gpioled/Makefile Modified: head/sys/modules/gpio/gpiobus/Makefile ============================================================================== --- head/sys/modules/gpio/gpiobus/Makefile Thu Feb 27 13:25:26 2014 (r262558) +++ head/sys/modules/gpio/gpiobus/Makefile Thu Feb 27 13:26:41 2014 (r262559) @@ -33,7 +33,7 @@ KMOD= gpiobus SRCS= gpiobus.c -SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h +SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h opt_platform.h CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ Modified: head/sys/modules/gpio/gpioiic/Makefile ============================================================================== --- head/sys/modules/gpio/gpioiic/Makefile Thu Feb 27 13:25:26 2014 (r262558) +++ head/sys/modules/gpio/gpioiic/Makefile Thu Feb 27 13:26:41 2014 (r262559) @@ -34,6 +34,7 @@ KMOD= gpioiic SRCS= gpioiic.c SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h iicbus_if.h iicbb_if.h +SRCS+= opt_platform.h CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ Modified: head/sys/modules/gpio/gpioled/Makefile ============================================================================== --- head/sys/modules/gpio/gpioled/Makefile Thu Feb 27 13:25:26 2014 (r262558) +++ head/sys/modules/gpio/gpioled/Makefile Thu Feb 27 13:26:41 2014 (r262559) @@ -33,7 +33,7 @@ KMOD= gpioled SRCS= gpioled.c -SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h +SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h opt_platform.h CFLAGS+= -I. -I${.CURDIR}/../../../dev/gpio/ From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 13:29:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EF055F8; Thu, 27 Feb 2014 13:29:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3A5C1180F; Thu, 27 Feb 2014 13:29:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1RDTR8G064292; Thu, 27 Feb 2014 13:29:27 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RDTRdp064291; Thu, 27 Feb 2014 13:29:27 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201402271329.s1RDTRdp064291@svn.freebsd.org> From: Luiz Otavio O Souza Date: Thu, 27 Feb 2014 13:29:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262561 - head/sys/modules/geom/geom_uncompress X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 13:29:27 -0000 Author: loos Date: Thu Feb 27 13:29:26 2014 New Revision: 262561 URL: http://svnweb.freebsd.org/changeset/base/262561 Log: Fix a leftover of r260523. Remove the unnecessary dependency to zlib.h. Approved by: adrian (mentor) Modified: head/sys/modules/geom/geom_uncompress/Makefile Modified: head/sys/modules/geom/geom_uncompress/Makefile ============================================================================== --- head/sys/modules/geom/geom_uncompress/Makefile Thu Feb 27 13:27:04 2014 (r262560) +++ head/sys/modules/geom/geom_uncompress/Makefile Thu Feb 27 13:29:26 2014 (r262561) @@ -12,6 +12,6 @@ CFLAGS+= -I${.CURDIR}/../../../geom/unco -I${.CURDIR}/../../../contrib/xz-embedded/linux/lib/xz/ SRCS= g_uncompress.c xz_crc32.c xz_dec_bcj.c xz_dec_lzma2.c xz_dec_stream.c \ xz_malloc.c -SRCS+= xz.h xz_config.h xz_lzma2.h xz_malloc.h xz_private.h xz_stream.h zlib.h +SRCS+= xz.h xz_config.h xz_lzma2.h xz_malloc.h xz_private.h xz_stream.h .include From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 13:31:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2AAF77F7; Thu, 27 Feb 2014 13:31:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 14E7D18B6; Thu, 27 Feb 2014 13:31:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1RDVsln067218; Thu, 27 Feb 2014 13:31:54 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RDVs5d067217; Thu, 27 Feb 2014 13:31:54 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201402271331.s1RDVs5d067217@svn.freebsd.org> From: Luiz Otavio O Souza Date: Thu, 27 Feb 2014 13:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262562 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 13:31:55 -0000 Author: loos Date: Thu Feb 27 13:31:54 2014 New Revision: 262562 URL: http://svnweb.freebsd.org/changeset/base/262562 Log: Add geom_uncompress to the list of available geom modules on loader.conf. Approved by: adrian (mentor) Modified: head/sys/boot/forth/loader.conf Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Thu Feb 27 13:29:26 2014 (r262561) +++ head/sys/boot/forth/loader.conf Thu Feb 27 13:31:54 2014 (r262562) @@ -207,6 +207,7 @@ geom_nop_load="NO" # Transparent disk d geom_raid3_load="NO" # RAID3 disk driver (see graid3(8)) geom_shsec_load="NO" # Shared secret disk driver (see gshsec(8)) geom_stripe_load="NO" # RAID0 disk driver (see gstripe(8)) +geom_uncompress_load="NO" # Compressed disk images driver (see mkulzma(8)) geom_uzip_load="NO" # Compressed disk images driver (see mkuzip(8)) geom_vinum_load="NO" # Concatenated/mirror/raid driver (see vinum(4)) From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 14:52:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2ABE7C0; Thu, 27 Feb 2014 14:52:54 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F3825128E; Thu, 27 Feb 2014 14:52:53 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E926FB962; Thu, 27 Feb 2014 09:52:52 -0500 (EST) From: John Baldwin To: Mateusz Guzik Subject: Re: svn commit: r262309 - head/sys/kern Date: Thu, 27 Feb 2014 09:06:31 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201402212229.s1LMT9BF093587@svn.freebsd.org> <201402261529.31942.jhb@freebsd.org> <20140226212200.GB329@dft-labs.eu> In-Reply-To: <20140226212200.GB329@dft-labs.eu> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201402270906.31359.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 27 Feb 2014 09:52:53 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 14:52:54 -0000 On Wednesday, February 26, 2014 4:22:00 pm Mateusz Guzik wrote: > On Wed, Feb 26, 2014 at 03:29:31PM -0500, John Baldwin wrote: > > On Wednesday, February 26, 2014 2:23:48 pm Mateusz Guzik wrote: > > > On Tue, Feb 25, 2014 at 01:08:43PM -0500, John Baldwin wrote: > > > > On Friday, February 21, 2014 5:29:09 pm Mateusz Guzik wrote: > > > > > Author: mjg > > > > > Date: Fri Feb 21 22:29:09 2014 > > > > > New Revision: 262309 > > > > > URL: http://svnweb.freebsd.org/changeset/base/262309 > > > > > > > > > > Log: > > > > > Fix a race between kern_proc_{o,}filedesc_out and fdescfree leading > > > > > to use-after-free. > > > > > > > > > > fdescfree proceeds to free file pointers once fd_refcnt reaches 0, but > > > > > kern_proc_{o,}filedesc_out only checked for hold count. > > > > > > > > Can you describe the race in more detail? The kern_* routines hold > > > > FILEDESC_SLOCK() while they read the file which should prevent > > > > fdescfree() from free'ing any files. Note that fdfree() (called > > > > under FILEDESC_XLOCK() clears the file pointer to NULL via the > > > > bzero(), so the sysctl handler should only see non-NULL pointers > > > > for files that are not yet free'd. > > > > > > > > > > oops, you are right. I somehow misread the code. > > > > > > Still, the change is harmless and matches other loop which iterates the > > > table (see sysctl_kern_file), so I think it can stay. > > > > Actually, I think that should be undone. That was a hacky workaround for > > a long time ago when the FILEDESC locking wasn't a simple sx lock but was > > a mtx + sleep lock combo thing that had fast and slow variants. > > > > > Other thing is that with that change in place we can get rid of > > > XLOCK/XUNLOCK around fdfree in fdescfree. > > > > I would rather remove the fd_refcnt checks, or do them differently (not > > in the loop). Right now a reader might be confused to think that > > fd_refcnt can change within the loop when it cannot and then worry about > > unhandled races that don't exist (i.e. if fd_refcnt can change within > > the loop, what prevents the individual file objects from being freed out > > from under the loop?) > > > > But it can change. > > kern_proc_filedesc_out calls export_fd_to_sb which drops the lock for > each fp and sysctl_kern_proc_ofiledesc drops the lock when dealing with > vnodes. > > As far as I can say all this is safe - either data is refed (vref on a > vnode) or the lock is still held while the data is being read, so by the > time fp can be freed it is no longer used. Ugh, ok. Then the change is fine as-is, but I think we have to leave the locking in place around fdfree() still as a result. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 16:54:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF51942A; Thu, 27 Feb 2014 16:54:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 918A71B58; Thu, 27 Feb 2014 16:54:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1RGsitS060882; Thu, 27 Feb 2014 16:54:44 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RGsiIZ060878; Thu, 27 Feb 2014 16:54:44 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201402271654.s1RGsiIZ060878@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 27 Feb 2014 16:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262565 - in head/bin/sh: . tests/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 16:54:44 -0000 Author: jilles Date: Thu Feb 27 16:54:43 2014 New Revision: 262565 URL: http://svnweb.freebsd.org/changeset/base/262565 Log: sh: Do not corrupt internal representation if LINENO inner expansion fails. Example: f() { : ${LINENO+$((1/0))}; } and call this function twice. Added: head/bin/sh/tests/builtins/lineno2.0 (contents, props changed) Modified: head/bin/sh/expand.c head/bin/sh/tests/builtins/Makefile Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Thu Feb 27 16:07:12 2014 (r262564) +++ head/bin/sh/expand.c Thu Feb 27 16:54:43 2014 (r262565) @@ -672,10 +672,8 @@ evalvar(char *p, int flag) again: /* jump here after setting a variable with ${var=text} */ if (varflags & VSLINENO) { set = 1; - special = 0; - val = var; - p[-1] = '\0'; /* temporarily overwrite '=' to have \0 - terminated string */ + special = 1; + val = NULL; } else if (special) { set = varisset(var, varflags & VSNUL); val = NULL; @@ -704,7 +702,10 @@ again: /* jump here after setting a vari if (set && subtype != VSPLUS) { /* insert the value of the variable */ if (special) { - varvalue(var, varflags & VSQUOTE, subtype, flag); + if (varflags & VSLINENO) + STPUTBIN(var, p - var - 1, expdest); + else + varvalue(var, varflags & VSQUOTE, subtype, flag); if (subtype == VSLENGTH) { varlenb = expdest - stackblock() - startloc; varlen = varlenb; @@ -816,7 +817,6 @@ record: default: abort(); } - p[-1] = '='; /* recover overwritten '=' */ if (subtype != VSNORMAL) { /* skip to end of alternative */ int nesting = 1; Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Thu Feb 27 16:07:12 2014 (r262564) +++ head/bin/sh/tests/builtins/Makefile Thu Feb 27 16:54:43 2014 (r262565) @@ -87,6 +87,7 @@ FILES+= hash4.0 FILES+= jobid1.0 FILES+= jobid2.0 FILES+= lineno.0 lineno.0.stdout +FILES+= lineno2.0 FILES+= local1.0 FILES+= local2.0 FILES+= local3.0 Added: head/bin/sh/tests/builtins/lineno2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/lineno2.0 Thu Feb 27 16:54:43 2014 (r262565) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +f() { + : ${LINENO+${x?}} +} + +unset -v x +command eval f 2>/dev/null && exit 3 +x=1 +f From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 18:13:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B99B705; Thu, 27 Feb 2014 18:13:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0D98614F0; Thu, 27 Feb 2014 18:13:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1RID73G097065; Thu, 27 Feb 2014 18:13:07 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RID7re097064; Thu, 27 Feb 2014 18:13:07 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201402271813.s1RID7re097064@svn.freebsd.org> From: Ruslan Bukin Date: Thu, 27 Feb 2014 18:13:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262568 - head/sys/arm/freescale/vybrid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 18:13:08 -0000 Author: br Date: Thu Feb 27 18:13:07 2014 New Revision: 262568 URL: http://svnweb.freebsd.org/changeset/base/262568 Log: Do not setup interrupt handler (polling is used). Modified: head/sys/arm/freescale/vybrid/vf_i2c.c Modified: head/sys/arm/freescale/vybrid/vf_i2c.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_i2c.c Thu Feb 27 17:31:59 2014 (r262567) +++ head/sys/arm/freescale/vybrid/vf_i2c.c Thu Feb 27 18:13:07 2014 (r262568) @@ -104,11 +104,9 @@ struct i2c_softc { struct resource *res[2]; bus_space_tag_t bst; bus_space_handle_t bsh; - void *ih; device_t dev; device_t iicbus; struct mtx mutex; - int ibif; }; static struct resource_spec i2c_spec[] = { @@ -117,19 +115,6 @@ static struct resource_spec i2c_spec[] = { -1, 0 } }; -static void -i2c_intr(void *arg) -{ - struct i2c_softc *sc; - - sc = arg; - - if (READ1(sc, I2C_IBSR) & IBSR_IBIF) { - WRITE1(sc, I2C_IBSR, IBSR_IBIF); - sc->ibif = 1; - } -} - static int i2c_probe(device_t dev) { @@ -148,7 +133,6 @@ static int i2c_attach(device_t dev) { struct i2c_softc *sc; - int err; sc = device_get_softc(dev); sc->dev = dev; @@ -164,14 +148,6 @@ i2c_attach(device_t dev) sc->bst = rman_get_bustag(sc->res[0]); sc->bsh = rman_get_bushandle(sc->res[0]); - /* Setup interrupt handler */ - err = bus_setup_intr(dev, sc->res[1], INTR_TYPE_BIO | INTR_MPSAFE, - NULL, i2c_intr, sc, &sc->ih); - if (err) { - device_printf(dev, "Unable to alloc interrupt resource.\n"); - return (ENXIO); - } - WRITE1(sc, I2C_IBIC, IBIC_BIIE); sc->iicbus = device_add_child(dev, "iicbus", -1); @@ -194,8 +170,10 @@ wait_for_iif(struct i2c_softc *sc) retry = 1000; while (retry --) { - if (sc->ibif == 1) + if (READ1(sc, I2C_IBSR) & IBSR_IBIF) { + WRITE1(sc, I2C_IBSR, IBSR_IBIF); return (IIC_NOERR); + } DELAY(10); } @@ -227,8 +205,10 @@ wait_for_icf(struct i2c_softc *sc) retry = 1000; while (retry --) { if (READ1(sc, I2C_IBSR) & IBSR_TCF) { - if (sc->ibif == 1) + if (READ1(sc, I2C_IBSR) & IBSR_IBIF) { + WRITE1(sc, I2C_IBSR, IBSR_IBIF); return (IIC_NOERR); + } } DELAY(10); } @@ -265,8 +245,6 @@ i2c_repeated_start(device_t dev, u_char DELAY(10); - sc->ibif = 0; - /* Write target address - LSB is R/W bit */ WRITE1(sc, I2C_IBDR, slave); @@ -310,8 +288,6 @@ i2c_start(device_t dev, u_char slave, in reg |= (IBCR_TXRX); WRITE1(sc, I2C_IBCR, reg); - sc->ibif = 0; - /* Write target address - LSB is R/W bit */ WRITE1(sc, I2C_IBDR, slave); @@ -407,7 +383,6 @@ i2c_read(device_t dev, char *buf, int le WRITE1(sc, I2C_IBCR, IBCR_IBIE | IBCR_MSSL); /* dummy read */ - sc->ibif = 0; READ1(sc, I2C_IBDR); DELAY(1000); } @@ -430,7 +405,6 @@ i2c_read(device_t dev, char *buf, int le WRITE1(sc, I2C_IBCR, IBCR_IBIE | IBCR_NOACK); } - sc->ibif = 0; *buf++ = READ1(sc, I2C_IBDR); (*read)++; } @@ -453,7 +427,6 @@ i2c_write(device_t dev, const char *buf, mtx_lock(&sc->mutex); while (*sent < len) { - sc->ibif = 0; WRITE1(sc, I2C_IBDR, *buf++); From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 21:01:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 677BDA27; Thu, 27 Feb 2014 21:01:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 39CAC15AB; Thu, 27 Feb 2014 21:01:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1RL1BPW073518; Thu, 27 Feb 2014 21:01:11 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RL1AXR073515; Thu, 27 Feb 2014 21:01:10 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402272101.s1RL1AXR073515@svn.freebsd.org> From: Christian Brueffer Date: Thu, 27 Feb 2014 21:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262571 - head/sys/dev/etherswitch/ip17x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 21:01:11 -0000 Author: brueffer Date: Thu Feb 27 21:01:10 2014 New Revision: 262571 URL: http://svnweb.freebsd.org/changeset/base/262571 Log: Add missing includes and remove two unused ones. Reviewed by: loos MFC after: 1 week Modified: head/sys/dev/etherswitch/ip17x/ip17x.c head/sys/dev/etherswitch/ip17x/ip17x_phy.c head/sys/dev/etherswitch/ip17x/ip17x_vlans.c Modified: head/sys/dev/etherswitch/ip17x/ip17x.c ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip17x.c Thu Feb 27 20:00:26 2014 (r262570) +++ head/sys/dev/etherswitch/ip17x/ip17x.c Thu Feb 27 21:01:10 2014 (r262571) @@ -32,18 +32,21 @@ #include #include #include +#include +#include #include +#include #include #include #include #include +#include #include -#include #include -#include #include #include +#include #include #include Modified: head/sys/dev/etherswitch/ip17x/ip17x_phy.c ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip17x_phy.c Thu Feb 27 20:00:26 2014 (r262570) +++ head/sys/dev/etherswitch/ip17x/ip17x_phy.c Thu Feb 27 21:01:10 2014 (r262571) @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include Modified: head/sys/dev/etherswitch/ip17x/ip17x_vlans.c ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip17x_vlans.c Thu Feb 27 20:00:26 2014 (r262570) +++ head/sys/dev/etherswitch/ip17x/ip17x_vlans.c Thu Feb 27 21:01:10 2014 (r262571) @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 21:41:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A0C127F; Thu, 27 Feb 2014 21:41:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D08F51904; Thu, 27 Feb 2014 21:41:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1RLfrA4093291; Thu, 27 Feb 2014 21:41:53 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RLfrN6093286; Thu, 27 Feb 2014 21:41:53 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402272141.s1RLfrN6093286@svn.freebsd.org> From: Xin LI Date: Thu, 27 Feb 2014 21:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262572 - head/sys/dev/tws X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 21:41:54 -0000 Author: delphij Date: Thu Feb 27 21:41:52 2014 New Revision: 262572 URL: http://svnweb.freebsd.org/changeset/base/262572 Log: Get rid of the 'chan' from softc structure and use the latter directly as sleep channel. PR: kern/174684 Submitted by: jmg MFC after: 2 weeks Modified: head/sys/dev/tws/tws.h head/sys/dev/tws/tws_cam.c head/sys/dev/tws/tws_user.c Modified: head/sys/dev/tws/tws.h ============================================================================== --- head/sys/dev/tws/tws.h Thu Feb 27 21:01:10 2014 (r262571) +++ head/sys/dev/tws/tws.h Thu Feb 27 21:41:52 2014 (r262572) @@ -248,7 +248,6 @@ struct tws_softc { struct mtx io_lock; /* IO lock */ struct tws_ioctl_lock ioctl_lock; /* ioctl lock */ u_int32_t seq_id; /* Sequence id */ - void *chan; /* IOCTL req wait channel */ struct tws_circular_q aen_q; /* aen q */ struct tws_circular_q trace_q; /* trace q */ struct tws_stats stats; /* I/O stats */ Modified: head/sys/dev/tws/tws_cam.c ============================================================================== --- head/sys/dev/tws/tws_cam.c Thu Feb 27 21:01:10 2014 (r262571) +++ head/sys/dev/tws/tws_cam.c Thu Feb 27 21:41:52 2014 (r262572) @@ -1297,7 +1297,7 @@ tws_reinit(void *arg) tws_turn_on_interrupts(sc); - wakeup_one(sc->chan); + wakeup_one(sc); } Modified: head/sys/dev/tws/tws_user.c ============================================================================== --- head/sys/dev/tws/tws_user.c Thu Feb 27 21:01:10 2014 (r262571) +++ head/sys/dev/tws/tws_user.c Thu Feb 27 21:41:52 2014 (r262572) @@ -103,8 +103,7 @@ tws_passthru(struct tws_softc *sc, void do { req = tws_get_request(sc, TWS_REQ_TYPE_PASSTHRU); if ( !req ) { - sc->chan = (void *)sc; - error = tsleep(sc->chan, 0, "tws_sleep", TWS_IOCTL_TIMEOUT*hz); + error = tsleep(sc, 0, "tws_sleep", TWS_IOCTL_TIMEOUT*hz); if ( error == EWOULDBLOCK ) { return(ETIMEDOUT); } @@ -203,7 +202,7 @@ out_data: // req->state = TWS_REQ_STATE_FREE; - wakeup_one(sc->chan); + wakeup_one(sc); return(error); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 21:47:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 212216BC; Thu, 27 Feb 2014 21:47:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0CE3A194F; Thu, 27 Feb 2014 21:47:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1RLlKNR094405; Thu, 27 Feb 2014 21:47:20 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RLlK22094403; Thu, 27 Feb 2014 21:47:20 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402272147.s1RLlK22094403@svn.freebsd.org> From: Christian Brueffer Date: Thu, 27 Feb 2014 21:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262574 - in head/release/doc: en_US.ISO8859-1/hardware share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 21:47:21 -0000 Author: brueffer Date: Thu Feb 27 21:47:20 2014 New Revision: 262574 URL: http://svnweb.freebsd.org/changeset/base/262574 Log: Add tws(4) to the hardware notes. MFC after: 3 days Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml head/release/doc/share/misc/dev.archlist.txt Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Thu Feb 27 21:46:31 2014 (r262573) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Thu Feb 27 21:47:20 2014 (r262574) @@ -758,6 +758,8 @@ &hwlist.twe; + &hwlist.tws; + &hwlist.vpo; [&arch.i386;] The wds(4) driver supports the WD7000 SCSI Modified: head/release/doc/share/misc/dev.archlist.txt ============================================================================== --- head/release/doc/share/misc/dev.archlist.txt Thu Feb 27 21:46:31 2014 (r262573) +++ head/release/doc/share/misc/dev.archlist.txt Thu Feb 27 21:47:20 2014 (r262574) @@ -152,6 +152,7 @@ tl i386,pc98,amd64 trm i386,amd64 twa i386,amd64 twe i386,amd64 +tws i386,amd64 ubsa i386,pc98,amd64 ubsec i386,pc98,amd64 ubser i386,pc98,amd64 From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 21:48:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C244833; Thu, 27 Feb 2014 21:48:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E1C06195C; Thu, 27 Feb 2014 21:48:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1RLmYh2094639; Thu, 27 Feb 2014 21:48:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RLmYVS094638; Thu, 27 Feb 2014 21:48:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402272148.s1RLmYVS094638@svn.freebsd.org> From: Alexander Motin Date: Thu, 27 Feb 2014 21:48:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262575 - head/sys/dev/mps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 21:48:35 -0000 Author: mav Date: Thu Feb 27 21:48:34 2014 New Revision: 262575 URL: http://svnweb.freebsd.org/changeset/base/262575 Log: Restore SIM freeze/release match, broken at r253549. This fixes problem with SIM left in frozen state after reinit, for example, after firmware update. MFC after: 1 week Modified: head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Thu Feb 27 21:47:20 2014 (r262574) +++ head/sys/dev/mps/mps_sas.c Thu Feb 27 21:48:34 2014 (r262575) @@ -180,6 +180,9 @@ mpssas_startup_increment(struct mpssas_s /* just starting, freeze the simq */ mps_dprint(sassc->sc, MPS_INIT, "%s freezing simq\n", __func__); +#if __FreeBSD_version >= 1000039 + xpt_hold_boot(); +#endif xpt_freeze_simq(sassc->sim, 1); } mps_dprint(sassc->sc, MPS_INIT, "%s refcount %u\n", __func__, @@ -200,10 +203,10 @@ mpssas_startup_decrement(struct mpssas_s mps_dprint(sassc->sc, MPS_INIT, "%s releasing simq\n", __func__); sassc->flags &= ~MPSSAS_IN_STARTUP; + xpt_release_simq(sassc->sim, 1); #if __FreeBSD_version >= 1000039 xpt_release_boot(); #else - xpt_release_simq(sassc->sim, 1); mpssas_rescan_target(sassc->sc, NULL); #endif } @@ -763,12 +766,8 @@ mps_attach_sas(struct mps_softc *sc) * Hold off boot until discovery is complete. */ sassc->flags |= MPSSAS_IN_STARTUP | MPSSAS_IN_DISCOVERY; -#if __FreeBSD_version >= 1000039 - xpt_hold_boot(); -#else - xpt_freeze_simq(sassc->sim, 1); -#endif sc->sassc->startup_refcount = 0; + mpssas_startup_increment(sassc); callout_init(&sassc->discovery_callout, 1 /*mpsafe*/); sassc->discovery_timeouts = 0; @@ -1139,7 +1138,7 @@ mpssas_handle_reinit(struct mps_softc *s mps_dprint(sc, MPS_INIT, "%s startup\n", __func__); sc->sassc->flags |= MPSSAS_IN_STARTUP; sc->sassc->flags |= MPSSAS_IN_DISCOVERY; - xpt_freeze_simq(sc->sassc->sim, 1); + mpssas_startup_increment(sc->sassc); /* notify CAM of a bus reset */ mpssas_announce_reset(sc, AC_BUS_RESET, CAM_TARGET_WILDCARD, @@ -1152,12 +1151,6 @@ mpssas_handle_reinit(struct mps_softc *s "%s startup %u tm %u after command completion\n", __func__, sc->sassc->startup_refcount, sc->sassc->tm_count); - /* - * The simq was explicitly frozen above, so set the refcount to 0. - * The simq will be explicitly released after port enable completes. - */ - sc->sassc->startup_refcount = 0; - /* zero all the target handles, since they may change after the * reset, and we have to rediscover all the targets and use the new * handles. @@ -3461,15 +3454,12 @@ mpssas_read_cap_done(struct cam_periph * int mpssas_startup(struct mps_softc *sc) { - struct mpssas_softc *sassc; /* * Send the port enable message and set the wait_for_port_enable flag. * This flag helps to keep the simq frozen until all discovery events * are processed. */ - sassc = sc->sassc; - mpssas_startup_increment(sassc); sc->wait_for_port_enable = 1; mpssas_send_portenable(sc); return (0); @@ -3554,7 +3544,6 @@ mpssas_portenable_complete(struct mps_so sc->port_enable_complete = 1; wakeup(&sc->port_enable_complete); mpssas_startup_decrement(sassc); - xpt_release_simq(sassc->sim, 1); } int From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 21:50:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34494B5C; Thu, 27 Feb 2014 21:50:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 20A8A19F1; Thu, 27 Feb 2014 21:50:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1RLok7Z095149; Thu, 27 Feb 2014 21:50:47 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RLokGO095148; Thu, 27 Feb 2014 21:50:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402272150.s1RLokGO095148@svn.freebsd.org> From: Xin LI Date: Thu, 27 Feb 2014 21:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262577 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 21:50:47 -0000 Author: delphij Date: Thu Feb 27 21:50:46 2014 New Revision: 262577 URL: http://svnweb.freebsd.org/changeset/base/262577 Log: MFV r262570: 4626 libzfs memleak in zpool_in_use() illumos/illumos-gate@fb13f48f1d9593453b94cd1c7277553b56f493c8 MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Thu Feb 27 21:49:47 2014 (r262576) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Thu Feb 27 21:50:46 2014 (r262577) @@ -20,8 +20,8 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ /* @@ -1613,9 +1613,16 @@ zpool_in_use(libzfs_handle_t *hdl, int f * its state to active. */ if (pool_active(hdl, name, guid, &isactive) == 0 && isactive && - (zhp = zpool_open_canfail(hdl, name)) != NULL && - zpool_get_prop_int(zhp, ZPOOL_PROP_READONLY, NULL)) - stateval = POOL_STATE_ACTIVE; + (zhp = zpool_open_canfail(hdl, name)) != NULL) { + if (zpool_get_prop_int(zhp, ZPOOL_PROP_READONLY, NULL)) + stateval = POOL_STATE_ACTIVE; + + /* + * All we needed the zpool handle for is the + * readonly prop check. + */ + zpool_close(zhp); + } ret = B_TRUE; break; From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 22:55:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9949148E; Thu, 27 Feb 2014 22:55:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6E461106E; Thu, 27 Feb 2014 22:55:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1RMtYoQ027032; Thu, 27 Feb 2014 22:55:34 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1RMtY8a027029; Thu, 27 Feb 2014 22:55:34 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402272255.s1RMtY8a027029@svn.freebsd.org> From: Ian Lepore Date: Thu, 27 Feb 2014 22:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262581 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 22:55:34 -0000 Author: ian Date: Thu Feb 27 22:55:33 2014 New Revision: 262581 URL: http://svnweb.freebsd.org/changeset/base/262581 Log: Initialize the Low Power Mode bits to keep the ARM cores running during WFI. Modified: head/sys/arm/freescale/imx/imx6_ccm.c head/sys/arm/freescale/imx/imx6_ccmreg.h Modified: head/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccm.c Thu Feb 27 22:44:07 2014 (r262580) +++ head/sys/arm/freescale/imx/imx6_ccm.c Thu Feb 27 22:55:33 2014 (r262581) @@ -92,6 +92,7 @@ ccm_attach(device_t dev) { struct ccm_softc *sc; int err, rid; + uint32_t reg; sc = device_get_softc(dev); err = 0; @@ -107,6 +108,26 @@ ccm_attach(device_t dev) } ccm_sc = sc; + + /* + * Configure the Low Power Mode setting to leave the ARM core power on + * when a WFI instruction is executed. This lets the MPCore timers and + * GIC continue to run, which is helpful when the only thing that can + * wake you up is an MPCore Private Timer interrupt delivered via GIC. + * + * XXX Based on the docs, setting CCM_CGPR_INT_MEM_CLK_LPM shouldn't be + * required when the LPM bits are set to LPM_RUN. But experimentally + * I've experienced a fairly rare lockup when not setting it. I was + * unable to prove conclusively that the lockup was related to power + * management or that this definitively fixes it. Revisit this. + */ + reg = RD4(sc, CCM_CGPR); + reg |= CCM_CGPR_INT_MEM_CLK_LPM; + WR4(sc, CCM_CGPR, reg); + reg = RD4(sc, CCM_CLPCR); + reg = (reg & ~CCM_CLPCR_LPM_MASK) | CCM_CLPCR_LPM_RUN; + WR4(sc, CCM_CLPCR, reg); + err = 0; out: Modified: head/sys/arm/freescale/imx/imx6_ccmreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccmreg.h Thu Feb 27 22:44:07 2014 (r262580) +++ head/sys/arm/freescale/imx/imx6_ccmreg.h Thu Feb 27 22:55:33 2014 (r262581) @@ -29,13 +29,20 @@ #ifndef IMX6_CCMREG_H #define IMX6_CCMREG_H -#define CCM_CCGR1 0x06C -#define CCM_CCGR2 0x070 -#define CCM_CCGR3 0x074 -#define CCM_CCGR4 0x078 -#define CCM_CCGR5 0x07C -#define CCM_CCGR6 0x080 -#define CCM_CMEOR 0x088 +#define CCM_CLPCR 0x054 +#define CCM_CLPCR_LPM_MASK 0x03 +#define CCM_CLPCR_LPM_RUN 0x00 +#define CCM_CLPCR_LPM_WAIT 0x01 +#define CCM_CLPCR_LPM_STOP 0x02 +#define CCM_CGPR 0x064 +#define CCM_CGPR_INT_MEM_CLK_LPM (1 << 17) +#define CCM_CCGR1 0x06C +#define CCM_CCGR2 0x070 +#define CCM_CCGR3 0x074 +#define CCM_CCGR4 0x078 +#define CCM_CCGR5 0x07C +#define CCM_CCGR6 0x080 +#define CCM_CMEOR 0x088 #endif From owner-svn-src-head@FreeBSD.ORG Thu Feb 27 23:17:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F163165; Thu, 27 Feb 2014 23:17:45 +0000 (UTC) Received: from mail-qc0-x22f.google.com (mail-qc0-x22f.google.com [IPv6:2607:f8b0:400d:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D655B123A; Thu, 27 Feb 2014 23:17:44 +0000 (UTC) Received: by mail-qc0-f175.google.com with SMTP id e16so406680qcx.6 for ; Thu, 27 Feb 2014 15:17:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=gvukGNDMRBDZ0Hb+OwYe6H/PA8QL+rKV5VowF+cC3SM=; b=sKshIgDRlZsnaAT/UqScF4gkljilY0pQHW3XQ7CUCgQ0u+Jha3svX3yTX3zy78Xa2k p8Le81G+Z3MqVVpCPHp3w+s5syUcGKUq11NSO9UbxauPZYLLtLaVydjA2qUJbCZTdrVr uYm3WymWId30XW/0Mxj1qypRrpeOaIbkfpepCCm4LllKfS6L9jRiCc8U6yUR+b+vrUr/ mgEDRFIrPGfKCMvcC6gObgD5IrcTzZyhgIT7/KnPXz9mARiVMPes7Z3tbDoeEiFt/ZDS iS67sQNZEKvOHOWTIEYMcy1GfPSsAmEft8aKPaM5OS8Ck8KGmXhhA/2MESxutnpFKpuD mFSA== X-Received: by 10.140.26.240 with SMTP id 103mr11297334qgv.92.1393543063942; Thu, 27 Feb 2014 15:17:43 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id u20sm6728064qge.2.2014.02.27.15.17.42 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 27 Feb 2014 15:17:43 -0800 (PST) Date: Fri, 28 Feb 2014 00:17:38 +0100 From: Mateusz Guzik To: John Baldwin Subject: Re: svn commit: r262309 - head/sys/kern Message-ID: <20140227231738.GA24050@dft-labs.eu> References: <201402212229.s1LMT9BF093587@svn.freebsd.org> <201402261529.31942.jhb@freebsd.org> <20140226212200.GB329@dft-labs.eu> <201402270906.31359.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201402270906.31359.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Feb 2014 23:17:45 -0000 On Thu, Feb 27, 2014 at 09:06:31AM -0500, John Baldwin wrote: > On Wednesday, February 26, 2014 4:22:00 pm Mateusz Guzik wrote: > > On Wed, Feb 26, 2014 at 03:29:31PM -0500, John Baldwin wrote: > > > On Wednesday, February 26, 2014 2:23:48 pm Mateusz Guzik wrote: > > > > Other thing is that with that change in place we can get rid of > > > > XLOCK/XUNLOCK around fdfree in fdescfree. > > > > > > I would rather remove the fd_refcnt checks, or do them differently (not > > > in the loop). Right now a reader might be confused to think that > > > fd_refcnt can change within the loop when it cannot and then worry about > > > unhandled races that don't exist (i.e. if fd_refcnt can change within > > > the loop, what prevents the individual file objects from being freed out > > > from under the loop?) > > > > > > > But it can change. > > > > kern_proc_filedesc_out calls export_fd_to_sb which drops the lock for > > each fp and sysctl_kern_proc_ofiledesc drops the lock when dealing with > > vnodes. > > > > As far as I can say all this is safe - either data is refed (vref on a > > vnode) or the lock is still held while the data is being read, so by the > > time fp can be freed it is no longer used. > > Ugh, ok. Then the change is fine as-is, but I think we have to leave > the locking in place around fdfree() still as a result. > I don't see why. refcnt cannot drop as long as something holds fdp lock. 1) So let's say kern_proc_filedesc_out grabs the lock, refcnt is 0. No files are inspected and the loop is terminated. 2) So let's say refcnt is 1 and fp is being read. Lock is released only when the function is done with fp. Then fdescfree drops refcnt to 0 and proceeds to free fps. And we are back to 1). IOW I don't think locking around fdfree is of any use right now, although I don't feel strongly about removing it. -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 00:17:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF715CF6; Fri, 28 Feb 2014 00:17:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DBB621704; Fri, 28 Feb 2014 00:17:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1S0H3c4064531; Fri, 28 Feb 2014 00:17:03 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1S0H3nB064530; Fri, 28 Feb 2014 00:17:03 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402280017.s1S0H3nB064530@svn.freebsd.org> From: Ian Lepore Date: Fri, 28 Feb 2014 00:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262583 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 00:17:04 -0000 Author: ian Date: Fri Feb 28 00:17:03 2014 New Revision: 262583 URL: http://svnweb.freebsd.org/changeset/base/262583 Log: All our current ARM multi-core systems have all cores in one package with a shared L2 cache, reflect that in the common cpu_topo() routine. Modified: head/sys/arm/arm/mp_machdep.c Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Thu Feb 27 23:17:00 2014 (r262582) +++ head/sys/arm/arm/mp_machdep.c Fri Feb 28 00:17:03 2014 (r262583) @@ -372,7 +372,7 @@ struct cpu_group * cpu_topo(void) { - return (smp_topo_1level(CG_SHARE_L2, 1, 0)); + return (smp_topo_1level(CG_SHARE_L2, mp_ncpus, 0)); } void From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 00:23:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43A1CF4E; Fri, 28 Feb 2014 00:23:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 15F5F17A8; Fri, 28 Feb 2014 00:23:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1S0N4uD068341; Fri, 28 Feb 2014 00:23:04 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1S0N4lp068340; Fri, 28 Feb 2014 00:23:04 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402280023.s1S0N4lp068340@svn.freebsd.org> From: Ian Lepore Date: Fri, 28 Feb 2014 00:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262584 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 00:23:05 -0000 Author: ian Date: Fri Feb 28 00:23:04 2014 New Revision: 262584 URL: http://svnweb.freebsd.org/changeset/base/262584 Log: Supply a DELAY() implementation via weak linkage, so that SoC-specific code can supply a better implementation. A SoC with variable CPU frequency is likely to use a fixed-frequency timer for DELAY() (but still use the mpcore private timers as eventtimers). Also remove spaces from the eventtimer and timecounter names. Modified: head/sys/arm/arm/mpcore_timer.c Modified: head/sys/arm/arm/mpcore_timer.c ============================================================================== --- head/sys/arm/arm/mpcore_timer.c Fri Feb 28 00:17:03 2014 (r262583) +++ head/sys/arm/arm/mpcore_timer.c Fri Feb 28 00:23:04 2014 (r262584) @@ -129,12 +129,12 @@ uint32_t platform_arm_tmr_freq = 0; static timecounter_get_t arm_tmr_get_timecount; static struct timecounter arm_tmr_timecount = { - .tc_name = "ARM MPCore Timecounter", + .tc_name = "MPCore", .tc_get_timecount = arm_tmr_get_timecount, .tc_poll_pps = NULL, .tc_counter_mask = ~0u, .tc_frequency = 0, - .tc_quality = 1000, + .tc_quality = 800, }; /** @@ -254,7 +254,7 @@ arm_tmr_probe(device_t dev) if (!ofw_bus_is_compatible(dev, "arm,mpcore-timers")) return (ENXIO); - device_set_desc(dev, "ARM Generic MPCore Timers"); + device_set_desc(dev, "ARM MPCore Timers"); return (BUS_PROBE_DEFAULT); } @@ -327,7 +327,7 @@ arm_tmr_attach(device_t dev) return (ENXIO); } - sc->et.et_name = "ARM MPCore Eventtimer"; + sc->et.et_name = "MPCore"; sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU; sc->et.et_quality = 1000; @@ -369,8 +369,8 @@ DRIVER_MODULE(mp_tmr, simplebus, arm_tmr * RETURNS: * nothing */ -void -DELAY(int usec) +static void +arm_tmr_DELAY(int usec) { int32_t counts_per_usec; int32_t counts; @@ -408,3 +408,11 @@ DELAY(int usec) first = last; } } + +/* + * Supply a DELAY() implementation via weak linkage. A platform may want to use + * the mpcore per-cpu eventtimers but provide its own DELAY() routine, + * especially when the core frequency can change on the fly. + */ +__weak_reference(arm_tmr_DELAY, DELAY); + From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 00:26:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4FC42B4; Fri, 28 Feb 2014 00:26:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B624D17DD; Fri, 28 Feb 2014 00:26:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1S0Qver069054; Fri, 28 Feb 2014 00:26:57 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1S0QvBr069053; Fri, 28 Feb 2014 00:26:57 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402280026.s1S0QvBr069053@svn.freebsd.org> From: Ian Lepore Date: Fri, 28 Feb 2014 00:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262585 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 00:26:57 -0000 Author: ian Date: Fri Feb 28 00:26:57 2014 New Revision: 262585 URL: http://svnweb.freebsd.org/changeset/base/262585 Log: Add some rudimentary voltage control to go with the rudimentary frequency control. If we have to scale back the frequency due to temperature, it will help to lower the voltage as well. Modified: head/sys/arm/freescale/imx/imx6_anatop.c Modified: head/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_anatop.c Fri Feb 28 00:23:04 2014 (r262584) +++ head/sys/arm/freescale/imx/imx6_anatop.c Fri Feb 28 00:26:57 2014 (r262585) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -85,8 +86,11 @@ struct imx6_anatop_softc { struct resource *res[2]; uint32_t cpu_curhz; uint32_t cpu_curmhz; + uint32_t cpu_curmv; uint32_t cpu_minhz; + uint32_t cpu_minmv; uint32_t cpu_maxhz; + uint32_t cpu_maxmv; uint32_t refosc_hz; void *temp_intrhand; uint32_t temp_high_val; @@ -103,12 +107,15 @@ struct imx6_anatop_softc { static struct imx6_anatop_softc *imx6_anatop_sc; /* - * Table of CPU max frequencies. This is indexed by the max frequency value - * (0-3) from the ocotp CFG3 register. + * Tables of CPU max frequencies and corresponding voltages. This is indexed by + * the max frequency value (0-3) from the ocotp CFG3 register. */ static uint32_t imx6_cpu_maxhz_tab[] = { 792000000, 852000000, 996000000, 1200000000 }; +static uint32_t imx6_cpu_millivolt_tab[] = { + 1150, 1225, 1225, 1275 +}; #define TZ_ZEROC 2732 /* deci-Kelvin <-> deci-Celcius offset. */ @@ -130,6 +137,64 @@ imx6_anatop_write_4(bus_size_t offset, u bus_write_4(imx6_anatop_sc->res[MEMRES], offset, value); } +static void +vdd_set(struct imx6_anatop_softc *sc, int mv) +{ + int newtarg, oldtarg; + uint32_t delay, pmureg; + static boolean_t init_done = false; + + /* + * The datasheet says VDD_PU and VDD_SOC must be equal, and VDD_ARM + * can't be more than 50mV above or 200mV below them. For now to keep + * things simple we set all three to the same value. + */ + + pmureg = imx6_anatop_read_4(IMX6_ANALOG_PMU_REG_CORE); + oldtarg = pmureg & IMX6_ANALOG_PMU_REG0_TARG_MASK; + + /* Convert mV to target value. Clamp target to valid range. */ + if (mv < 725) + newtarg = 0x00; + else if (mv > 1450) + newtarg = 0x1F; + else + newtarg = (mv - 700) / 25; + + /* + * The first time through the 3 voltages might not be equal so use a + * long conservative delay. After that we need to delay 3uS for every + * 25mV step upward. No need to delay at all when lowering. + */ + if (init_done) { + if (newtarg == oldtarg) + return; + else if (newtarg > oldtarg) + delay = (newtarg - oldtarg) * 3; + else + delay = 0; + } else { + delay = 700 / 25 * 3; + init_done = true; + } + + /* + * Make the change and wait for it to take effect. + */ + pmureg &= ~(IMX6_ANALOG_PMU_REG0_TARG_MASK | + IMX6_ANALOG_PMU_REG1_TARG_MASK | + IMX6_ANALOG_PMU_REG2_TARG_MASK); + + pmureg |= newtarg << IMX6_ANALOG_PMU_REG0_TARG_SHIFT; + pmureg |= newtarg << IMX6_ANALOG_PMU_REG1_TARG_SHIFT; + pmureg |= newtarg << IMX6_ANALOG_PMU_REG2_TARG_SHIFT; + + imx6_anatop_write_4(IMX6_ANALOG_PMU_REG_CORE, pmureg); + DELAY(delay); + sc->cpu_curmv = newtarg * 25 + 700; + device_printf(sc->dev, "voltage set to %u\n", sc->cpu_curmv); +} + static inline uint32_t cpufreq_hz_from_div(struct imx6_anatop_softc *sc, uint32_t div) { @@ -231,7 +296,9 @@ cpufreq_initialize(struct imx6_anatop_so FSL_OCOTP_CFG3_SPEED_MASK) >> FSL_OCOTP_CFG3_SPEED_SHIFT; sc->cpu_minhz = cpufreq_actual_hz(sc, imx6_cpu_maxhz_tab[0]); + sc->cpu_minmv = imx6_cpu_millivolt_tab[0]; sc->cpu_maxhz = cpufreq_actual_hz(sc, imx6_cpu_maxhz_tab[cfg3speed]); + sc->cpu_maxmv = imx6_cpu_millivolt_tab[cfg3speed]; /* * Set the CPU to maximum speed. @@ -241,6 +308,7 @@ cpufreq_initialize(struct imx6_anatop_so * basically assumes that a single core can't overheat before interrupts * are enabled; empirical testing shows that to be a safe assumption. */ + vdd_set(sc, sc->cpu_maxmv); cpufreq_set_clock(sc, sc->cpu_maxhz); device_printf(sc->dev, "CPU frequency %uMHz\n", sc->cpu_curmhz); } @@ -321,6 +389,7 @@ tempmon_gofast(struct imx6_anatop_softc { if (sc->cpu_curhz < sc->cpu_maxhz) { + vdd_set(sc, sc->cpu_maxmv); cpufreq_set_clock(sc, sc->cpu_maxhz); } } @@ -331,6 +400,7 @@ tempmon_goslow(struct imx6_anatop_softc if (sc->cpu_curhz > sc->cpu_minhz) { cpufreq_set_clock(sc, sc->cpu_minhz); + vdd_set(sc, sc->cpu_minmv); } } @@ -451,6 +521,11 @@ imx6_anatop_attach(device_t dev) if (err != 0) goto out; + SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), + OID_AUTO, "cpu_voltage", CTLFLAG_RD, + &sc->cpu_curmv, 0, "Current CPU voltage in millivolts"); + imx6_anatop_sc = sc; /* From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 00:41:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E9D3AB8; Fri, 28 Feb 2014 00:41:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 014B9194C; Fri, 28 Feb 2014 00:41:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1S0ftJ8077574; Fri, 28 Feb 2014 00:41:55 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1S0ftkN077569; Fri, 28 Feb 2014 00:41:55 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402280041.s1S0ftkN077569@svn.freebsd.org> From: Ian Lepore Date: Fri, 28 Feb 2014 00:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262587 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 00:41:56 -0000 Author: ian Date: Fri Feb 28 00:41:55 2014 New Revision: 262587 URL: http://svnweb.freebsd.org/changeset/base/262587 Log: Add an armv7 implementation of cpu_sleep(). The arm11/armv6 implementation we've been using was actually just spinning due to ARM having redefined the old 'wait for interrupt' operation via the system coprocessor as a nop and replacing it with a WFI instruction. Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/arm/cpufunc_asm_armv7.S head/sys/arm/include/cpufunc.h Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Fri Feb 28 00:39:35 2014 (r262586) +++ head/sys/arm/arm/cpufunc.c Fri Feb 28 00:41:55 2014 (r262587) @@ -1107,7 +1107,7 @@ struct cpu_functions cortexa_cpufuncs = cpufunc_nullop, /* flush_brnchtgt_C */ (void *)cpufunc_nullop, /* flush_brnchtgt_E */ - arm11_sleep, /* sleep */ + armv7_sleep, /* sleep */ /* Soft functions */ Modified: head/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_armv7.S Fri Feb 28 00:39:35 2014 (r262586) +++ head/sys/arm/arm/cpufunc_asm_armv7.S Fri Feb 28 00:41:55 2014 (r262587) @@ -343,3 +343,9 @@ ENTRY(armv7_idcache_inv_all) bx lr @ return END(armv7_l1cache_inv_all) +ENTRY_NP(armv7_sleep) + dsb + wfi + bx lr +END(armv7_sleep) + Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Fri Feb 28 00:39:35 2014 (r262586) +++ head/sys/arm/include/cpufunc.h Fri Feb 28 00:41:55 2014 (r262587) @@ -523,6 +523,7 @@ void armv7_setup (char *string); void armv7_context_switch (void); void armv7_drain_writebuf (void); void armv7_sev (void); +void armv7_sleep (int unused); u_int armv7_auxctrl (u_int, u_int); void pj4bv7_setup (char *string); void pj4b_config (void); From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 01:31:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF817985; Fri, 28 Feb 2014 01:31:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BB77D1CF2; Fri, 28 Feb 2014 01:31:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1S1VZXS000903; Fri, 28 Feb 2014 01:31:35 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1S1VZWV000901; Fri, 28 Feb 2014 01:31:35 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402280131.s1S1VZWV000901@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Feb 2014 01:31:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262591 - in head/sys/contrib/dts: . arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 01:31:36 -0000 Author: imp Date: Fri Feb 28 01:31:35 2014 New Revision: 262591 URL: http://svnweb.freebsd.org/changeset/base/262591 Log: Initial import of Linux/Vendor DTS files for various embedded boards. Added: head/sys/contrib/dts/ head/sys/contrib/dts/FreeBSD-list head/sys/contrib/dts/FreeBSD-upgrade head/sys/contrib/dts/arm/ Added: head/sys/contrib/dts/FreeBSD-list ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dts/FreeBSD-list Fri Feb 28 01:31:35 2014 (r262591) @@ -0,0 +1,76 @@ +# $FreeBSD$ +# Files to include in the import and merging.... +src/arm/animeo_ip.dts +src/arm/at91-ariag25.dts +src/arm/at91-cosino.dtsi +src/arm/at91-cosino_mega2560.dts +src/arm/at91-foxg20.dts +src/arm/at91-qil_a9260.dts +src/arm/at91-sama5d3_xplained.dts +src/arm/at91rm9200.dtsi +src/arm/at91rm9200_pqfp.dtsi +src/arm/at91rm9200ek.dts +src/arm/at91sam9260.dtsi +src/arm/at91sam9263.dtsi +src/arm/at91sam9263ek.dts +src/arm/at91sam9g15.dtsi +src/arm/at91sam9g15ek.dts +src/arm/at91sam9g20.dtsi +src/arm/at91sam9g20ek.dts +src/arm/at91sam9g20ek_2mmc.dts +src/arm/at91sam9g20ek_common.dtsi +src/arm/at91sam9g25.dtsi +src/arm/at91sam9g25ek.dts +src/arm/at91sam9g35.dtsi +src/arm/at91sam9g35ek.dts +src/arm/at91sam9g45.dtsi +src/arm/at91sam9m10g45ek.dts +src/arm/at91sam9n12.dtsi +src/arm/at91sam9n12ek.dts +src/arm/at91sam9x25.dtsi +src/arm/at91sam9x25ek.dts +src/arm/at91sam9x35.dtsi +src/arm/at91sam9x35ek.dts +src/arm/at91sam9x5.dtsi +src/arm/at91sam9x5_macb0.dtsi +src/arm/at91sam9x5_macb1.dtsi +src/arm/at91sam9x5_usart3.dtsi +src/arm/at91sam9x5cm.dtsi +src/arm/at91sam9x5ek.dtsi +src/arm/ethernut5.dts +src/arm/evk-pro3.dts +src/arm/ge863-pro3.dtsi +src/arm/kizbox.dts +src/arm/mpa1600.dts +src/arm/pm9g45.dts +src/arm/sama5d3.dtsi +src/arm/sama5d31.dtsi +src/arm/sama5d31ek.dts +src/arm/sama5d33.dtsi +src/arm/sama5d33ek.dts +src/arm/sama5d34.dtsi +src/arm/sama5d34ek.dts +src/arm/sama5d35.dtsi +src/arm/sama5d35ek.dts +src/arm/sama5d36.dtsi +src/arm/sama5d36ek.dts +src/arm/sama5d3_can.dtsi +src/arm/sama5d3_emac.dtsi +src/arm/sama5d3_gmac.dtsi +src/arm/sama5d3_lcd.dtsi +src/arm/sama5d3_mci2.dtsi +src/arm/sama5d3_tcb1.dtsi +src/arm/sama5d3_uart.dtsi +src/arm/sama5d3xcm.dtsi +src/arm/sama5d3xdm.dtsi +src/arm/sama5d3xmb.dtsi +src/arm/tny_a9260.dts +src/arm/tny_a9260_common.dtsi +src/arm/tny_a9263.dts +src/arm/tny_a9g20.dts +src/arm/usb_a9260.dts +src/arm/usb_a9260_common.dtsi +src/arm/usb_a9263.dts +src/arm/usb_a9g20.dts +src/arm/usb_a9g20_common.dtsi +src/arm/usb_a9g20_lpw.dts Added: head/sys/contrib/dts/FreeBSD-upgrade ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dts/FreeBSD-upgrade Fri Feb 28 01:31:35 2014 (r262591) @@ -0,0 +1,24 @@ +#/bin/sh +# $FreeBSD$ +# +# These files are imported from Ian Campbell's git tree mirroring the linux +# kernel. +# +# git clone git://xenbits.xen.org/people/ianc/device-tree-rebasing.git +# +# will grab the latest tree. It is imported into vendor/device-tree/dist and tagged +# with the svn cp command, per the handbook. +# +# We only import those files from here that we know work with some kernel, rather than +# all of them. This means we have an 'opt in' list rather than an 'opt out' list +# that's more typical for FreeBSD. The opt-in list should be relative to the top level +# directory (so a bunch of lines starting with src). We import src/$ARCH/foo into +# sys/contrib/dts/$ARCH/foo with the goal being to use as many of these files as possible +# unmodified for FreeBSD. This isn't always possible, but there are workarounds. +# +# This script should take care of all that the first time... + +s=svn+ssh://svn.freebsd.org/base/vendor/device-tree/ + +args=$(grep -v ^# FreeBSD-list | sed -e"s=^=$s=") +svn cp -m "Initial import of DTS files from Linux" ${args} svn+ssh://svn.freebsd.org/base/head/sys/contrib/dts/arm From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 01:32:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE3CEADD; Fri, 28 Feb 2014 01:32:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A68781D00; Fri, 28 Feb 2014 01:32:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1S1WkFI001154; Fri, 28 Feb 2014 01:32:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1S1Wj7U001146; Fri, 28 Feb 2014 01:32:45 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402280132.s1S1Wj7U001146@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Feb 2014 01:32:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262592 - head/sys/contrib/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 01:32:46 -0000 Author: imp Date: Fri Feb 28 01:32:44 2014 New Revision: 262592 URL: http://svnweb.freebsd.org/changeset/base/262592 Log: Initial import of DTS files from Linux Added: head/sys/contrib/dts/arm/animeo_ip.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/animeo_ip.dts head/sys/contrib/dts/arm/at91-ariag25.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91-ariag25.dts head/sys/contrib/dts/arm/at91-cosino.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91-cosino.dtsi head/sys/contrib/dts/arm/at91-cosino_mega2560.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91-cosino_mega2560.dts head/sys/contrib/dts/arm/at91-foxg20.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91-foxg20.dts head/sys/contrib/dts/arm/at91-qil_a9260.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91-qil_a9260.dts head/sys/contrib/dts/arm/at91-sama5d3_xplained.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91-sama5d3_xplained.dts head/sys/contrib/dts/arm/at91rm9200.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91rm9200.dtsi head/sys/contrib/dts/arm/at91rm9200_pqfp.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91rm9200_pqfp.dtsi head/sys/contrib/dts/arm/at91rm9200ek.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91rm9200ek.dts head/sys/contrib/dts/arm/at91sam9260.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9260.dtsi head/sys/contrib/dts/arm/at91sam9263.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9263.dtsi head/sys/contrib/dts/arm/at91sam9263ek.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9263ek.dts head/sys/contrib/dts/arm/at91sam9g15.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9g15.dtsi head/sys/contrib/dts/arm/at91sam9g15ek.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9g15ek.dts head/sys/contrib/dts/arm/at91sam9g20.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9g20.dtsi head/sys/contrib/dts/arm/at91sam9g20ek.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9g20ek.dts head/sys/contrib/dts/arm/at91sam9g20ek_2mmc.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9g20ek_2mmc.dts head/sys/contrib/dts/arm/at91sam9g20ek_common.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9g20ek_common.dtsi head/sys/contrib/dts/arm/at91sam9g25.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9g25.dtsi head/sys/contrib/dts/arm/at91sam9g25ek.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9g25ek.dts head/sys/contrib/dts/arm/at91sam9g35.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9g35.dtsi head/sys/contrib/dts/arm/at91sam9g35ek.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9g35ek.dts head/sys/contrib/dts/arm/at91sam9g45.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9g45.dtsi head/sys/contrib/dts/arm/at91sam9m10g45ek.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9m10g45ek.dts head/sys/contrib/dts/arm/at91sam9n12.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9n12.dtsi head/sys/contrib/dts/arm/at91sam9n12ek.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9n12ek.dts head/sys/contrib/dts/arm/at91sam9x25.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9x25.dtsi head/sys/contrib/dts/arm/at91sam9x25ek.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9x25ek.dts head/sys/contrib/dts/arm/at91sam9x35.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9x35.dtsi head/sys/contrib/dts/arm/at91sam9x35ek.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9x35ek.dts head/sys/contrib/dts/arm/at91sam9x5.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9x5.dtsi head/sys/contrib/dts/arm/at91sam9x5_macb0.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9x5_macb0.dtsi head/sys/contrib/dts/arm/at91sam9x5_macb1.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9x5_macb1.dtsi head/sys/contrib/dts/arm/at91sam9x5_usart3.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9x5_usart3.dtsi head/sys/contrib/dts/arm/at91sam9x5cm.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9x5cm.dtsi head/sys/contrib/dts/arm/at91sam9x5ek.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/at91sam9x5ek.dtsi head/sys/contrib/dts/arm/ethernut5.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/ethernut5.dts head/sys/contrib/dts/arm/evk-pro3.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/evk-pro3.dts head/sys/contrib/dts/arm/ge863-pro3.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/ge863-pro3.dtsi head/sys/contrib/dts/arm/kizbox.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/kizbox.dts head/sys/contrib/dts/arm/mpa1600.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/mpa1600.dts head/sys/contrib/dts/arm/pm9g45.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/pm9g45.dts head/sys/contrib/dts/arm/sama5d3.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d3.dtsi head/sys/contrib/dts/arm/sama5d31.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d31.dtsi head/sys/contrib/dts/arm/sama5d31ek.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d31ek.dts head/sys/contrib/dts/arm/sama5d33.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d33.dtsi head/sys/contrib/dts/arm/sama5d33ek.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d33ek.dts head/sys/contrib/dts/arm/sama5d34.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d34.dtsi head/sys/contrib/dts/arm/sama5d34ek.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d34ek.dts head/sys/contrib/dts/arm/sama5d35.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d35.dtsi head/sys/contrib/dts/arm/sama5d35ek.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d35ek.dts head/sys/contrib/dts/arm/sama5d36.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d36.dtsi head/sys/contrib/dts/arm/sama5d36ek.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d36ek.dts head/sys/contrib/dts/arm/sama5d3_can.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d3_can.dtsi head/sys/contrib/dts/arm/sama5d3_emac.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d3_emac.dtsi head/sys/contrib/dts/arm/sama5d3_gmac.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d3_gmac.dtsi head/sys/contrib/dts/arm/sama5d3_lcd.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d3_lcd.dtsi head/sys/contrib/dts/arm/sama5d3_mci2.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d3_mci2.dtsi head/sys/contrib/dts/arm/sama5d3_tcb1.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d3_tcb1.dtsi head/sys/contrib/dts/arm/sama5d3_uart.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d3_uart.dtsi head/sys/contrib/dts/arm/sama5d3xcm.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d3xcm.dtsi head/sys/contrib/dts/arm/sama5d3xdm.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d3xdm.dtsi head/sys/contrib/dts/arm/sama5d3xmb.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/sama5d3xmb.dtsi head/sys/contrib/dts/arm/tny_a9260.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/tny_a9260.dts head/sys/contrib/dts/arm/tny_a9260_common.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/tny_a9260_common.dtsi head/sys/contrib/dts/arm/tny_a9263.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/tny_a9263.dts head/sys/contrib/dts/arm/tny_a9g20.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/tny_a9g20.dts head/sys/contrib/dts/arm/usb_a9260.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/usb_a9260.dts head/sys/contrib/dts/arm/usb_a9260_common.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/usb_a9260_common.dtsi head/sys/contrib/dts/arm/usb_a9263.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/usb_a9263.dts head/sys/contrib/dts/arm/usb_a9g20.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/usb_a9g20.dts head/sys/contrib/dts/arm/usb_a9g20_common.dtsi - copied unchanged from r262591, vendor/device-tree/dist/src/arm/usb_a9g20_common.dtsi head/sys/contrib/dts/arm/usb_a9g20_lpw.dts - copied unchanged from r262591, vendor/device-tree/dist/src/arm/usb_a9g20_lpw.dts Copied: head/sys/contrib/dts/arm/animeo_ip.dts (from r262591, vendor/device-tree/dist/src/arm/animeo_ip.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dts/arm/animeo_ip.dts Fri Feb 28 01:32:44 2014 (r262592, copy of r262591, vendor/device-tree/dist/src/arm/animeo_ip.dts) @@ -0,0 +1,167 @@ +/* + * animeo_ip.dts - Device Tree file for Somfy Animeo IP Boards + * + * Copyright (C) 2011-2012 Jean-Christophe PLAGNIOL-VILLARD + * + * Licensed under GPLv2 only. + */ + +/dts-v1/; +#include "at91sam9260.dtsi" + +/ { + model = "Somfy Animeo IP"; + compatible = "somfy,animeo-ip", "atmel,at91sam9260", "atmel,at91sam9"; + + aliases { + serial0 = &usart1; + serial1 = &usart2; + serial2 = &usart0; + serial3 = &dbgu; + serial4 = &usart3; + serial5 = &uart0; + serial6 = &uart1; + }; + + chosen { + linux,stdout-path = &usart2; + }; + + memory { + reg = <0x20000000 0x4000000>; + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + main_clock: clock@0 { + compatible = "atmel,osc", "fixed-clock"; + clock-frequency = <18432000>; + }; + }; + + ahb { + apb { + usart0: serial@fffb0000 { + pinctrl-0 = <&pinctrl_usart0 &pinctrl_usart0_rts>; + linux,rs485-enabled-at-boot-time; + status = "okay"; + }; + + usart1: serial@fffb4000 { + pinctrl-0 = <&pinctrl_usart1 &pinctrl_usart1_rts>; + linux,rs485-enabled-at-boot-time; + status = "okay"; + }; + + usart2: serial@fffb8000 { + pinctrl-0 = <&pinctrl_usart2>; + status = "okay"; + }; + + macb0: ethernet@fffc4000 { + pinctrl-0 = <&pinctrl_macb_rmii &pinctrl_macb_rmii_mii>; + phy-mode = "mii"; + status = "okay"; + }; + + mmc0: mmc@fffa8000 { + pinctrl-0 = <&pinctrl_mmc0_clk + &pinctrl_mmc0_slot1_cmd_dat0 + &pinctrl_mmc0_slot1_dat1_3>; + status = "okay"; + + slot@1 { + reg = <1>; + bus-width = <4>; + }; + }; + + watchdog@fffffd40 { + status = "okay"; + }; + }; + + nand0: nand@40000000 { + nand-bus-width = <8>; + nand-ecc-mode = "soft"; + nand-on-flash-bbt; + status = "okay"; + + barebox@0 { + label = "barebox"; + reg = <0x0 0x58000>; + }; + + u_boot_env@58000 { + label = "u_boot_env"; + reg = <0x58000 0x8000>; + }; + + ubi@60000 { + label = "ubi"; + reg = <0x60000 0x1FA0000>; + }; + }; + + usb0: ohci@00500000 { + num-ports = <2>; + atmel,vbus-gpio = <&pioB 15 GPIO_ACTIVE_LOW>; + status = "okay"; + }; + }; + + leds { + compatible = "gpio-leds"; + + power_green { + label = "power_green"; + gpios = <&pioC 17 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + }; + + power_red { + label = "power_red"; + gpios = <&pioA 2 GPIO_ACTIVE_HIGH>; + }; + + tx_green { + label = "tx_green"; + gpios = <&pioC 19 GPIO_ACTIVE_HIGH>; + }; + + tx_red { + label = "tx_red"; + gpios = <&pioC 18 GPIO_ACTIVE_HIGH>; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + + keyswitch_in { + label = "keyswitch_in"; + gpios = <&pioB 1 GPIO_ACTIVE_HIGH>; + linux,code = <28>; + gpio-key,wakeup; + }; + + error_in { + label = "error_in"; + gpios = <&pioB 2 GPIO_ACTIVE_HIGH>; + linux,code = <29>; + gpio-key,wakeup; + }; + + btn { + label = "btn"; + gpios = <&pioC 23 GPIO_ACTIVE_HIGH>; + linux,code = <31>; + gpio-key,wakeup; + }; + }; +}; Copied: head/sys/contrib/dts/arm/at91-ariag25.dts (from r262591, vendor/device-tree/dist/src/arm/at91-ariag25.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dts/arm/at91-ariag25.dts Fri Feb 28 01:32:44 2014 (r262592, copy of r262591, vendor/device-tree/dist/src/arm/at91-ariag25.dts) @@ -0,0 +1,180 @@ +/* + * at91-ariag25.dts - Device Tree file for Acme Systems Aria G25 (AT91SAM9G25 based) + * + * Copyright (C) 2013 Douglas Gilbert , + * Robert Nelson + * + * Licensed under GPLv2 or later. + */ +/dts-v1/; +#include "at91sam9g25.dtsi" + +/ { + model = "Acme Systems Aria G25"; + compatible = "acme,ariag25", "atmel,at91sam9x5ek", + "atmel,at91sam9x5", "atmel,at91sam9"; + + aliases { + serial0 = &dbgu; + serial1 = &usart0; + serial2 = &usart1; + serial3 = &usart2; + serial4 = &usart3; + serial5 = &uart0; + serial6 = &uart1; + }; + + chosen { + bootargs = "console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait"; + }; + + memory { + /* 128 MB, change this for 256 MB revision */ + reg = <0x20000000 0x8000000>; + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + main_clock: clock@0 { + compatible = "atmel,osc", "fixed-clock"; + clock-frequency = <12000000>; + }; + }; + + ahb { + apb { + mmc0: mmc@f0008000 { + /* N.B. Aria has no SD card detect (CD), assumed present */ + + pinctrl-0 = < + &pinctrl_mmc0_slot0_clk_cmd_dat0 + &pinctrl_mmc0_slot0_dat1_3>; + status = "okay"; + slot@0 { + reg = <0>; + bus-width = <4>; + }; + }; + + i2c0: i2c@f8010000 { + status = "okay"; + }; + + i2c1: i2c@f8014000 { + status = "okay"; + }; + + /* TWD2+TCLK2 hidden behind ethernet, so no i2c2 */ + + usart0: serial@f801c000 { + pinctrl-0 = <&pinctrl_usart0 + &pinctrl_usart0_rts + &pinctrl_usart0_cts>; + status = "okay"; + }; + + usart1: serial@f8020000 { + pinctrl-0 = <&pinctrl_usart1 + /* &pinctrl_usart1_rts */ + /* &pinctrl_usart1_cts */ + >; + status = "okay"; + }; + + usart2: serial@f8024000 { + /* cannot activate RTS2+CTS2, clash with + * ethernet on PB0 and PB1 */ + pinctrl-0 = <&pinctrl_usart2>; + status = "okay"; + }; + + usart3: serial@f8028000 { + compatible = "atmel,at91sam9260-usart"; + reg = <0xf8028000 0x200>; + interrupts = <8 4 5>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usart3 + /* &pinctrl_usart3_rts */ + /* &pinctrl_usart3_cts */ + >; + status = "okay"; + }; + + macb0: ethernet@f802c000 { + phy-mode = "rmii"; + /* + * following can be overwritten by bootloader: + * for example u-boot 'ftd set' command + */ + local-mac-address = [00 00 00 00 00 00]; + status = "okay"; + }; + + /* + * UART0/1 pins are marked as GPIO on + * Aria documentation. + * Change to "okay" if you need additional serial ports + */ + uart0: serial@f8040000 { + status = "disabled"; + }; + + uart1: serial@f8044000 { + status = "disabled"; + }; + + adc0: adc@f804c000 { + status = "okay"; + atmel,adc-channels-used = <0xf>; + atmel,adc-num-channels = <4>; + }; + + dbgu: serial@fffff200 { + status = "okay"; + }; + + pinctrl@fffff400 { + w1_0 { + pinctrl_w1_0: w1_0-0 { + atmel,pins = <0 21 0x0 0x1>; /* PA21 PIO, pull-up */ + }; + }; + }; + + rtc@fffffeb0 { + status = "okay"; + }; + }; + + usb0: ohci@00600000 { + status = "okay"; + num-ports = <3>; + }; + + usb1: ehci@00700000 { + status = "okay"; + }; + }; + + leds { + compatible = "gpio-leds"; + + /* little green LED in middle of Aria G25 module */ + aria_led { + label = "aria_led"; + gpios = <&pioB 8 GPIO_ACTIVE_HIGH>; /* PB8 */ + linux,default-trigger = "heartbeat"; + }; + + }; + + onewire@0 { + compatible = "w1-gpio"; + gpios = <&pioA 21 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_w1_0>; + }; +}; Copied: head/sys/contrib/dts/arm/at91-cosino.dtsi (from r262591, vendor/device-tree/dist/src/arm/at91-cosino.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dts/arm/at91-cosino.dtsi Fri Feb 28 01:32:44 2014 (r262592, copy of r262591, vendor/device-tree/dist/src/arm/at91-cosino.dtsi) @@ -0,0 +1,122 @@ +/* + * at91-cosino.dtsi - Device Tree file for Cosino core module + * + * Copyright (C) 2013 - Rodolfo Giometti + * HCE Engineering + * + * Derived from at91sam9x5ek.dtsi by: + * Copyright (C) 2012 Atmel, + * 2012 Nicolas Ferre + * + * Licensed under GPLv2 or later. + */ + +#include "at91sam9g35.dtsi" + +/ { + model = "HCE Cosino core module"; + compatible = "hce,cosino", "atmel,at91sam9x5", "atmel,at91sam9"; + + chosen { + bootargs = "console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait"; + }; + + memory { + reg = <0x20000000 0x8000000>; + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + main_clock: clock@0 { + compatible = "atmel,osc", "fixed-clock"; + clock-frequency = <12000000>; + }; + }; + + ahb { + apb { + mmc0: mmc@f0008000 { + pinctrl-0 = < + &pinctrl_board_mmc0 + &pinctrl_mmc0_slot0_clk_cmd_dat0 + &pinctrl_mmc0_slot0_dat1_3>; + status = "okay"; + slot@0 { + reg = <0>; + bus-width = <4>; + cd-gpios = <&pioD 15 GPIO_ACTIVE_HIGH>; + }; + }; + + dbgu: serial@fffff200 { + status = "okay"; + }; + + usart0: serial@f801c000 { + status = "okay"; + }; + + i2c0: i2c@f8010000 { + status = "okay"; + }; + + adc0: adc@f804c000 { + atmel,adc-clock-rate = <1000000>; + atmel,adc-ts-wires = <4>; + atmel,adc-ts-pressure-threshold = <10000>; + status = "okay"; + }; + + pinctrl@fffff400 { + mmc0 { + pinctrl_board_mmc0: mmc0-board { + atmel,pins = + ; /* PD15 gpio CD pin pull up and deglitch */ + }; + }; + }; + + watchdog@fffffe40 { + status = "okay"; + }; + }; + + nand0: nand@40000000 { + nand-bus-width = <8>; + nand-ecc-mode = "hw"; + atmel,has-pmecc; /* Enable PMECC */ + atmel,pmecc-cap = <4>; + atmel,pmecc-sector-size = <512>; + nand-on-flash-bbt; + status = "okay"; + + at91bootstrap@0 { + label = "at91bootstrap"; + reg = <0x0 0x40000>; + }; + + uboot@40000 { + label = "u-boot"; + reg = <0x40000 0x80000>; + }; + + ubootenv@c0000 { + label = "U-Boot Env"; + reg = <0xc0000 0x140000>; + }; + + kernel@200000 { + label = "kernel"; + reg = <0x200000 0x600000>; + }; + + rootfs@800000 { + label = "rootfs"; + reg = <0x800000 0x0f800000>; + }; + }; + }; +}; Copied: head/sys/contrib/dts/arm/at91-cosino_mega2560.dts (from r262591, vendor/device-tree/dist/src/arm/at91-cosino_mega2560.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dts/arm/at91-cosino_mega2560.dts Fri Feb 28 01:32:44 2014 (r262592, copy of r262591, vendor/device-tree/dist/src/arm/at91-cosino_mega2560.dts) @@ -0,0 +1,84 @@ +/* + * at91-cosino_mega2560.dts - Device Tree file for Cosino board with + * Mega 2560 extension + * + * Copyright (C) 2013 - Rodolfo Giometti + * HCE Engineering + * + * Derived from at91sam9g35ek.dts by: + * Copyright (C) 2012 Atmel, + * 2012 Nicolas Ferre + * + * Licensed under GPLv2 or later. + */ + +/dts-v1/; +#include "at91-cosino.dtsi" + +/ { + model = "HCE Cosino Mega 2560"; + compatible = "hce,cosino_mega2560", "atmel,at91sam9x5", "atmel,at91sam9"; + + ahb { + apb { + macb0: ethernet@f802c000 { + phy-mode = "rmii"; + status = "okay"; + }; + + adc0: adc@f804c000 { + atmel,adc-clock-rate = <1000000>; + atmel,adc-ts-wires = <4>; + atmel,adc-ts-pressure-threshold = <10000>; + status = "okay"; + }; + + + tsadcc: tsadcc@f804c000 { + status = "okay"; + }; + + rtc@fffffeb0 { + status = "okay"; + }; + + usart1: serial@f8020000 { + status = "okay"; + }; + + usart2: serial@f8024000 { + status = "okay"; + }; + + usb2: gadget@f803c000 { + atmel,vbus-gpio = <&pioB 16 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + mmc1: mmc@f000c000 { + pinctrl-0 = < + &pinctrl_mmc1_slot0_clk_cmd_dat0 + &pinctrl_mmc1_slot0_dat1_3>; + status = "okay"; + slot@0 { + reg = <0>; + bus-width = <4>; + non-removable; + }; + }; + }; + + usb0: ohci@00600000 { + status = "okay"; + num-ports = <3>; + atmel,vbus-gpio = <0 /* &pioD 18 GPIO_ACTIVE_LOW */ + &pioD 19 GPIO_ACTIVE_LOW + &pioD 20 GPIO_ACTIVE_LOW + >; + }; + + usb1: ehci@00700000 { + status = "okay"; + }; + }; +}; Copied: head/sys/contrib/dts/arm/at91-foxg20.dts (from r262591, vendor/device-tree/dist/src/arm/at91-foxg20.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dts/arm/at91-foxg20.dts Fri Feb 28 01:32:44 2014 (r262592, copy of r262591, vendor/device-tree/dist/src/arm/at91-foxg20.dts) @@ -0,0 +1,157 @@ +/* + * at91-foxg20.dts - Device Tree file for Acme Systems FoxG20 board + * + * Based on DT files for at91sam9g20ek evaluation board (AT91SAM9G20 SoC) + * + * Copyright (C) 2013 Douglas Gilbert + * + * Licensed under GPLv2 or later. + */ +/dts-v1/; +#include "at91sam9g20.dtsi" + +/ { + model = "Acme Systems FoxG20"; + compatible = "acme,foxg20", "atmel,at91sam9g20", "atmel,at91sam9"; + + chosen { + bootargs = "console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait"; + }; + + memory { + reg = <0x20000000 0x4000000>; + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + main_clock: clock@0 { + compatible = "atmel,osc", "fixed-clock"; + clock-frequency = <18432000>; + }; + }; + + ahb { + apb { + usb1: gadget@fffa4000 { + atmel,vbus-gpio = <&pioC 6 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + mmc0: mmc@fffa8000 { + pinctrl-0 = < + &pinctrl_mmc0_clk + &pinctrl_mmc0_slot1_cmd_dat0 + &pinctrl_mmc0_slot1_dat1_3>; + status = "okay"; + + slot@1 { + reg = <1>; + bus-width = <4>; + }; + }; + + usart0: serial@fffb0000 { + pinctrl-0 = + <&pinctrl_usart0 + &pinctrl_usart0_rts + &pinctrl_usart0_cts + >; + status = "okay"; + }; + + usart1: serial@fffb4000 { + status = "okay"; + }; + + usart2: serial@fffb8000 { + status = "okay"; + }; + + macb0: ethernet@fffc4000 { + phy-mode = "rmii"; + status = "okay"; + }; + + usart3: serial@fffd0000 { + status = "okay"; + }; + + uart0: serial@fffd4000 { + status = "okay"; + }; + + uart1: serial@fffd8000 { + status = "okay"; + }; + + dbgu: serial@fffff200 { + status = "okay"; + }; + + pinctrl@fffff400 { + board { + pinctrl_pck0_as_mck: pck0_as_mck { + atmel,pins = + ; + }; + }; + + mmc0_slot1 { + pinctrl_board_mmc0_slot1: mmc0_slot1-board { + atmel,pins = + ; /* CD pin */ + }; + }; + + i2c0 { + pinctrl_i2c0: i2c0-0 { + atmel,pins = + ; /* TWCK (SCL), open drain */ + }; + }; + }; + + watchdog@fffffd40 { + status = "okay"; + }; + }; + + usb0: ohci@00500000 { + num-ports = <2>; + status = "okay"; + }; + }; + + i2c@0 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c0>; + i2c-gpio,delay-us = <5>; /* ~85 kHz */ + status = "okay"; + }; + + leds { + compatible = "gpio-leds"; + + /* red LED marked "PC7" near mini USB (device) receptacle */ + user_led { + label = "user_led"; + gpios = <&pioC 7 GPIO_ACTIVE_HIGH>; /* PC7 */ + linux,default-trigger = "heartbeat"; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + + btn { + label = "Button"; + gpios = <&pioC 4 GPIO_ACTIVE_LOW>; + linux,code = <0x103>; + gpio-key,wakeup; + }; + }; +}; Copied: head/sys/contrib/dts/arm/at91-qil_a9260.dts (from r262591, vendor/device-tree/dist/src/arm/at91-qil_a9260.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dts/arm/at91-qil_a9260.dts Fri Feb 28 01:32:44 2014 (r262592, copy of r262591, vendor/device-tree/dist/src/arm/at91-qil_a9260.dts) @@ -0,0 +1,185 @@ +/* + * at91-qil_a9260.dts - Device Tree file for Calao QIL A9260 board + * + * Copyright (C) 2011-2013 Jean-Christophe PLAGNIOL-VILLARD + * + * Licensed under GPLv2. + */ +/dts-v1/; +#include "at91sam9260.dtsi" +/ { + model = "Calao QIL A9260"; + compatible = "calao,qil-a9260", "atmel,at91sam9260", "atmel,at91sam9"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + memory { + reg = <0x20000000 0x4000000>; + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + main_clock: clock@0 { + compatible = "atmel,osc", "fixed-clock"; + clock-frequency = <12000000>; + }; + }; + + ahb { + apb { + usb1: gadget@fffa4000 { + atmel,vbus-gpio = <&pioC 5 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + mmc0: mmc@fffa8000 { + pinctrl-0 = < + &pinctrl_mmc0_clk + &pinctrl_mmc0_slot0_cmd_dat0 + &pinctrl_mmc0_slot0_dat1_3>; + status = "okay"; + slot@0 { + reg = <0>; + bus-width = <4>; + }; + }; + + usart0: serial@fffb0000 { + pinctrl-0 = + <&pinctrl_usart0 + &pinctrl_usart0_rts + &pinctrl_usart0_cts + &pinctrl_usart0_dtr_dsr + &pinctrl_usart0_dcd + &pinctrl_usart0_ri>; + status = "okay"; + }; + + usart1: serial@fffb4000 { + pinctrl-0 = + <&pinctrl_usart1 + &pinctrl_usart1_rts + &pinctrl_usart1_cts>; + status = "okay"; + }; + + usart2: serial@fffb8000 { + pinctrl-0 = + <&pinctrl_usart2 + &pinctrl_usart2_rts + &pinctrl_usart2_cts>; + status = "okay"; + }; + + macb0: ethernet@fffc4000 { + phy-mode = "rmii"; + status = "okay"; + }; + + spi0: spi@fffc8000 { + status = "okay"; + cs-gpios = <&pioA 3 GPIO_ACTIVE_HIGH>; + + m41t94@0 { + compatible = "st,m41t94"; + reg = <0>; + spi-max-frequency = <1000000>; + }; + + }; + + dbgu: serial@fffff200 { + status = "okay"; + }; + + shdwc@fffffd10 { + atmel,wakeup-counter = <10>; + atmel,wakeup-rtt-timer; + }; + }; + + usb0: ohci@00500000 { + num-ports = <2>; + status = "okay"; + }; + + nand0: nand@40000000 { + nand-bus-width = <8>; + nand-ecc-mode = "soft"; + nand-on-flash-bbt; + status = "okay"; + + at91bootstrap@0 { + label = "at91bootstrap"; + reg = <0x0 0x20000>; + }; + + barebox@20000 { + label = "barebox"; + reg = <0x20000 0x40000>; + }; + + bareboxenv@60000 { + label = "bareboxenv"; + reg = <0x60000 0x20000>; + }; + + bareboxenv2@80000 { + label = "bareboxenv2"; + reg = <0x80000 0x20000>; + }; + + oftree@a0000 { + label = "oftree"; + reg = <0xa0000 0x20000>; + }; + + kernel@c0000 { + label = "kernel"; + reg = <0xc0000 0x400000>; + }; + + rootfs@4c0000 { + label = "rootfs"; + reg = <0x4c0000 0x7800000>; + }; + + data@7cc0000 { + label = "data"; + reg = <0x7cc0000 0x8340000>; + }; + }; + }; + + leds { + compatible = "gpio-leds"; + + user_led { + label = "user_led"; + gpios = <&pioB 21 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + + user_pb { + label = "user_pb"; + gpios = <&pioB 10 GPIO_ACTIVE_LOW>; + linux,code = <28>; + gpio-key,wakeup; + }; + }; + + i2c@0 { + status = "okay"; + }; +}; Copied: head/sys/contrib/dts/arm/at91-sama5d3_xplained.dts (from r262591, vendor/device-tree/dist/src/arm/at91-sama5d3_xplained.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dts/arm/at91-sama5d3_xplained.dts Fri Feb 28 01:32:44 2014 (r262592, copy of r262591, vendor/device-tree/dist/src/arm/at91-sama5d3_xplained.dts) @@ -0,0 +1,229 @@ +/* + * at91-sama5d3_xplained.dts - Device Tree file for the SAMA5D3 Xplained board + * + * Copyright (C) 2014 Atmel, + * 2014 Nicolas Ferre + * + * Licensed under GPLv2 or later. + */ +/dts-v1/; +#include "sama5d36.dtsi" + +/ { + model = "SAMA5D3 Xplained"; + compatible = "atmel,sama5d3-xplained", "atmel,sama5d3", "atmel,sama5"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + memory { + reg = <0x20000000 0x10000000>; + }; + + ahb { + apb { + mmc0: mmc@f0000000 { + pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3 &pinctrl_mmc0_dat4_7 &pinctrl_mmc0_cd>; + status = "okay"; + slot@0 { + reg = <0>; + bus-width = <8>; + cd-gpios = <&pioE 0 GPIO_ACTIVE_LOW>; + }; + }; + + spi0: spi@f0004000 { + cs-gpios = <&pioD 13 0>; + status = "okay"; + }; + + can0: can@f000c000 { + status = "okay"; + }; + + i2c0: i2c@f0014000 { + status = "okay"; + }; + + i2c1: i2c@f0018000 { + status = "okay"; + }; + + macb0: ethernet@f0028000 { + phy-mode = "rgmii"; + status = "okay"; + }; + + usart0: serial@f001c000 { + status = "okay"; + }; + + usart1: serial@f0020000 { + pinctrl-0 = <&pinctrl_usart1 &pinctrl_usart1_rts_cts>; + status = "okay"; + }; + + uart0: serial@f0024000 { + status = "okay"; + }; + + mmc1: mmc@f8000000 { + pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3 &pinctrl_mmc1_cd>; + status = "okay"; + slot@0 { + reg = <0>; + bus-width = <4>; + cd-gpios = <&pioE 1 GPIO_ACTIVE_HIGH>; + }; + }; + + spi1: spi@f8008000 { + cs-gpios = <&pioC 25 0>, <0>, <0>, <&pioD 16 0>; + status = "okay"; + }; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 01:33:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF18FC34; Fri, 28 Feb 2014 01:33:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C1FB1D09; Fri, 28 Feb 2014 01:33:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1S1X3Aq001297; Fri, 28 Feb 2014 01:33:03 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1S1X3bo001296; Fri, 28 Feb 2014 01:33:03 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402280133.s1S1X3bo001296@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Feb 2014 01:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262593 - head/sys/contrib/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 01:33:03 -0000 Author: imp Date: Fri Feb 28 01:33:03 2014 New Revision: 262593 URL: http://svnweb.freebsd.org/changeset/base/262593 Log: Correct initial import script Modified: head/sys/contrib/dts/FreeBSD-upgrade Modified: head/sys/contrib/dts/FreeBSD-upgrade ============================================================================== --- head/sys/contrib/dts/FreeBSD-upgrade Fri Feb 28 01:32:44 2014 (r262592) +++ head/sys/contrib/dts/FreeBSD-upgrade Fri Feb 28 01:33:03 2014 (r262593) @@ -18,7 +18,7 @@ # # This script should take care of all that the first time... -s=svn+ssh://svn.freebsd.org/base/vendor/device-tree/ +s=svn+ssh://svn.freebsd.org/base/vendor/device-tree/dist/ args=$(grep -v ^# FreeBSD-list | sed -e"s=^=$s=") svn cp -m "Initial import of DTS files from Linux" ${args} svn+ssh://svn.freebsd.org/base/head/sys/contrib/dts/arm From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 02:04:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1F1FEED; Fri, 28 Feb 2014 02:04:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CDA5410B8; Fri, 28 Feb 2014 02:04:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1S24fUT015653; Fri, 28 Feb 2014 02:04:41 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1S24ffF015651; Fri, 28 Feb 2014 02:04:41 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402280204.s1S24ffF015651@svn.freebsd.org> From: Mark Johnston Date: Fri, 28 Feb 2014 02:04:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262596 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 02:04:42 -0000 Author: markj Date: Fri Feb 28 02:04:41 2014 New Revision: 262596 URL: http://svnweb.freebsd.org/changeset/base/262596 Log: 4478 dtrace_dof_maxsize is far too small illumos/illumos-gate@d339a29bb4765c4b6883a935cf69b669cd05bca0 PR: 187027 MFC after: 1 week Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.dofmax.ksh - copied unchanged from r262595, vendor/illumos/dist/cmd/dtrace/test/tst/common/misc/tst.dofmax.ksh Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.dofmax.ksh (from r262595, vendor/illumos/dist/cmd/dtrace/test/tst/common/misc/tst.dofmax.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.dofmax.ksh Fri Feb 28 02:04:41 2014 (r262596, copy of r262595, vendor/illumos/dist/cmd/dtrace/test/tst/common/misc/tst.dofmax.ksh) @@ -0,0 +1,97 @@ +# +# CDDL HEADER START +# +# 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] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2012, Joyent, Inc. All rights reserved. +# + +let j=8 + +enable() +{ + prog=/var/tmp/dtest.$$.d + err=/var/tmp/dtest.$$.err + + nawk -v nprobes=$1 'BEGIN { \ + for (i = 0; i < nprobes - 1; i++) { \ + printf("dtrace:::BEGIN,\n"); \ + } \ + \ + printf("dtrace:::BEGIN { exit(0); }\n"); \ + }' /dev/null > $prog + + dtrace -qs $prog > /dev/null 2> $err + + if [[ "$?" -eq 0 ]]; then + return 0 + else + if ! grep "DIF program exceeds maximum program size" $err \ + 1> /dev/null 2>&1 ; then + echo "failed to enable $prog: `cat $err`" + exit 1 + fi + + return 1 + fi +} + +# +# First, establish an upper bound +# +let upper=1 + +while enable $upper ; do + let lower=upper + let upper=upper+upper + echo success at $lower, raised to $upper +done + +# +# Now search for the highest value that can be enabled +# +while [[ "$lower" -lt "$upper" ]]; do + let guess=$(((lower + upper) / 2)) + echo "lower is $lower; upper is $upper; guess is $guess\c" + + if enable $guess ; then + if [[ $((upper - lower)) -le 2 ]]; then + let upper=guess + fi + + echo " (success)" + let lower=guess + else + echo " (failure)" + let upper=guess + fi +done + +let expected=10000 + +if [[ "$lower" -lt "$expected" ]]; then + echo "expected support for enablings of at least $expected probes; \c" + echo "found $lower" + exit 1 +fi + +echo "maximum supported enabled probes found to be $lower" +exit 0 + Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri Feb 28 01:53:37 2014 (r262595) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri Feb 28 02:04:41 2014 (r262596) @@ -155,7 +155,7 @@ int dtrace_destructive_disallow = 0; dtrace_optval_t dtrace_nonroot_maxsize = (16 * 1024 * 1024); size_t dtrace_difo_maxsize = (256 * 1024); -dtrace_optval_t dtrace_dof_maxsize = (256 * 1024); +dtrace_optval_t dtrace_dof_maxsize = (8 * 1024 * 1024); size_t dtrace_global_maxsize = (16 * 1024); size_t dtrace_actions_max = (16 * 1024); size_t dtrace_retain_max = 1024; From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 02:38:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92678580; Fri, 28 Feb 2014 02:38:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F58912CC; Fri, 28 Feb 2014 02:38:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1S2c4Fd030047; Fri, 28 Feb 2014 02:38:04 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1S2c4Ol030046; Fri, 28 Feb 2014 02:38:04 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402280238.s1S2c4Ol030046@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Feb 2014 02:38:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262597 - head/sys/dev/nand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 02:38:04 -0000 Author: imp Date: Fri Feb 28 02:38:04 2014 New Revision: 262597 URL: http://svnweb.freebsd.org/changeset/base/262597 Log: Add fdt binding for nand for Atmel parts. This does little more than match the device. Pinctrl will need to be added before this will work, in addition to migrating the current board_foo.c method of configuring these pins to something else. Non-FDT systems won't be affected, yet. Modified: head/sys/dev/nand/nfc_at91.c Modified: head/sys/dev/nand/nfc_at91.c ============================================================================== --- head/sys/dev/nand/nfc_at91.c Fri Feb 28 02:04:41 2014 (r262596) +++ head/sys/dev/nand/nfc_at91.c Fri Feb 28 02:38:04 2014 (r262597) @@ -32,6 +32,8 @@ * is on the board. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -57,6 +59,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#endif + /* * Data cycles are triggered by access to any address within the EBI CS3 region * that has A21 and A22 clear. Command cycles are any access with bit A21 @@ -108,7 +116,10 @@ dev_write_1(struct at91_nand_softc *sc, static int at91_nand_probe(device_t dev) { - +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,at91rm9200-nand")) + return (ENXIO); +#endif device_set_desc(dev, "AT91 Integrated NAND controller"); return (BUS_PROBE_DEFAULT); } @@ -274,5 +285,9 @@ static driver_t at91_nand_driver = { }; static devclass_t at91_nand_devclass; -DRIVER_MODULE(at91_nand, atmelarm, at91_nand_driver, at91_nand_devclass, 0, 0); +#ifdef FDT +DRIVER_MODULE(at91_nand, simplebus, at91_nand_driver, at91_nand_devclass, 0, 0); +#else +DRIVER_MODULE(at91_nand, atmelarm, at91_nand_driver, at91_nand_devclass, 0, 0); +#endif From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 02:59:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36C937CE; Fri, 28 Feb 2014 02:59:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 23A141464; Fri, 28 Feb 2014 02:59:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1S2xqRB038969; Fri, 28 Feb 2014 02:59:52 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1S2xpsc038968; Fri, 28 Feb 2014 02:59:52 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402280259.s1S2xpsc038968@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Feb 2014 02:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262598 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 02:59:52 -0000 Author: imp Date: Fri Feb 28 02:59:51 2014 New Revision: 262598 URL: http://svnweb.freebsd.org/changeset/base/262598 Log: Add device node for SDRAMC device. Currently just claims device's resources. Added: head/sys/arm/at91/at91_sdramc.c (contents, props changed) Added: head/sys/arm/at91/at91_sdramc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/at91_sdramc.c Fri Feb 28 02:59:51 2014 (r262598) @@ -0,0 +1,105 @@ +/*- + * Copyright (c) 2014 Warner Losh. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#ifdef FDT +#include +#include +#include +#endif + +struct sdramc_softc { + struct resource *mem_res; /* Memory resource */ + device_t sc_dev; +}; + +static int +at91_sdramc_probe(device_t dev) +{ +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,at91sam9260-sdramc")) + return (ENXIO); +#endif + device_set_desc(dev, "SDRAMC"); + return (0); +} + +static int +at91_sdramc_attach(device_t dev) +{ + int rid, err = 0; + struct sdramc_softc *sc; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + + if (sc->mem_res == NULL) + panic("couldn't allocate register resources"); + + return (err); +} + +static device_method_t at91_sdramc_methods[] = { + DEVMETHOD(device_probe, at91_sdramc_probe), + DEVMETHOD(device_attach, at91_sdramc_attach), + DEVMETHOD_END +}; + +static driver_t at91_sdramc_driver = { + "at91_sdramc", + at91_sdramc_methods, + sizeof(struct sdramc_softc), +}; + +static devclass_t at91_sdramc_devclass; + +#ifdef FDT +DRIVER_MODULE(at91_sdramc, simplebus, at91_sdramc_driver, at91_sdramc_devclass, NULL, + NULL); +#else +DRIVER_MODULE(at91_sdramc, atmelarm, at91_sdramc_driver, at91_sdramc_devclass, NULL, + NULL); +#endif From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 03:00:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5996A927; Fri, 28 Feb 2014 03:00:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 46E961482; Fri, 28 Feb 2014 03:00:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1S30Tca041037; Fri, 28 Feb 2014 03:00:29 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1S30T2O041030; Fri, 28 Feb 2014 03:00:29 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402280300.s1S30T2O041030@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Feb 2014 03:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262600 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 03:00:29 -0000 Author: imp Date: Fri Feb 28 03:00:28 2014 New Revision: 262600 URL: http://svnweb.freebsd.org/changeset/base/262600 Log: tcb device for fdt Added: head/sys/arm/at91/at91_tcb.c (contents, props changed) Added: head/sys/arm/at91/at91_tcb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/at91_tcb.c Fri Feb 28 03:00:28 2014 (r262600) @@ -0,0 +1,105 @@ +/*- + * Copyright (c) 2014 Warner Losh. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#ifdef FDT +#include +#include +#include +#endif + +struct tcb_softc { + struct resource *mem_res; /* Memory resource */ + device_t sc_dev; +}; + +static int +at91_tcb_probe(device_t dev) +{ +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,at91rm9200-tcb")) + return (ENXIO); +#endif + device_set_desc(dev, "TCB"); + return (0); +} + +static int +at91_tcb_attach(device_t dev) +{ + int rid, err = 0; + struct tcb_softc *sc; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + + if (sc->mem_res == NULL) + panic("couldn't allocate register resources"); + + return (err); +} + +static device_method_t at91_tcb_methods[] = { + DEVMETHOD(device_probe, at91_tcb_probe), + DEVMETHOD(device_attach, at91_tcb_attach), + DEVMETHOD_END +}; + +static driver_t at91_tcb_driver = { + "at91_tcb", + at91_tcb_methods, + sizeof(struct tcb_softc), +}; + +static devclass_t at91_tcb_devclass; + +#ifdef FDT +DRIVER_MODULE(at91_tcb, simplebus, at91_tcb_driver, at91_tcb_devclass, NULL, + NULL); +#else +DRIVER_MODULE(at91_tcb, atmelarm, at91_tcb_driver, at91_tcb_devclass, NULL, + NULL); +#endif From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 03:00:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB50B922; Fri, 28 Feb 2014 03:00:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B8883147C; Fri, 28 Feb 2014 03:00:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1S30PQg040979; Fri, 28 Feb 2014 03:00:25 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1S30PjU040978; Fri, 28 Feb 2014 03:00:25 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402280300.s1S30PjU040978@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Feb 2014 03:00:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262599 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 03:00:26 -0000 Author: imp Date: Fri Feb 28 03:00:25 2014 New Revision: 262599 URL: http://svnweb.freebsd.org/changeset/base/262599 Log: shdwc device for fdt Added: head/sys/arm/at91/at91_shdwc.c (contents, props changed) Added: head/sys/arm/at91/at91_shdwc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/at91_shdwc.c Fri Feb 28 03:00:25 2014 (r262599) @@ -0,0 +1,105 @@ +/*- + * Copyright (c) 2014 Warner Losh. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#ifdef FDT +#include +#include +#include +#endif + +struct shdwc_softc { + struct resource *mem_res; /* Memory resource */ + device_t sc_dev; +}; + +static int +at91_shdwc_probe(device_t dev) +{ +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,at91sam9260-shdwc")) + return (ENXIO); +#endif + device_set_desc(dev, "SHDWC"); + return (0); +} + +static int +at91_shdwc_attach(device_t dev) +{ + int rid, err = 0; + struct shdwc_softc *sc; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + + if (sc->mem_res == NULL) + panic("couldn't allocate register resources"); + + return (err); +} + +static device_method_t at91_shdwc_methods[] = { + DEVMETHOD(device_probe, at91_shdwc_probe), + DEVMETHOD(device_attach, at91_shdwc_attach), + DEVMETHOD_END +}; + +static driver_t at91_shdwc_driver = { + "at91_shdwc", + at91_shdwc_methods, + sizeof(struct shdwc_softc), +}; + +static devclass_t at91_shdwc_devclass; + +#ifdef FDT +DRIVER_MODULE(at91_shdwc, simplebus, at91_shdwc_driver, at91_shdwc_devclass, NULL, + NULL); +#else +DRIVER_MODULE(at91_shdwc, atmelarm, at91_shdwc_driver, at91_shdwc_devclass, NULL, + NULL); +#endif From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 03:00:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A61A4A16; Fri, 28 Feb 2014 03:00:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A6EC1485; Fri, 28 Feb 2014 03:00:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1S30W85041532; Fri, 28 Feb 2014 03:00:32 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1S30Wq8041530; Fri, 28 Feb 2014 03:00:32 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402280300.s1S30Wq8041530@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Feb 2014 03:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262601 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 03:00:32 -0000 Author: imp Date: Fri Feb 28 03:00:31 2014 New Revision: 262601 URL: http://svnweb.freebsd.org/changeset/base/262601 Log: Add device and gadget bindings for fdt. These are preliminary and will need work before they work, especially the gadget bindings. Added: head/sys/dev/usb/controller/at91dci_fdt.c (contents, props changed) head/sys/dev/usb/controller/ohci_fdt.c (contents, props changed) Added: head/sys/dev/usb/controller/at91dci_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/at91dci_fdt.c Fri Feb 28 03:00:31 2014 (r262601) @@ -0,0 +1,333 @@ +#include +__FBSDID("$FreeBSD$"); + +/*- + * Copyright (c) 2007-2008 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include + +#define MEM_RID 0 + +/* Pin Definitions - do they belong here or somewhere else ? -- YES! */ + +#define VBUS_MASK AT91C_PIO_PB24 +#define VBUS_BASE AT91RM92_PIOB_BASE + +#define PULLUP_MASK AT91C_PIO_PB22 +#define PULLUP_BASE AT91RM92_PIOB_BASE + +static device_probe_t at91_udp_probe; +static device_attach_t at91_udp_attach; +static device_detach_t at91_udp_detach; + +struct at91_udp_softc { + struct at91dci_softc sc_dci; /* must be first */ + struct at91_pmc_clock *sc_mclk; + struct at91_pmc_clock *sc_iclk; + struct at91_pmc_clock *sc_fclk; + struct callout sc_vbus; +}; + +static void +at91_vbus_poll(struct at91_udp_softc *sc) +{ + uint8_t vbus_val; + + vbus_val = at91_pio_gpio_get(VBUS_BASE, VBUS_MASK) != 0; + at91dci_vbus_interrupt(&sc->sc_dci, vbus_val); + + callout_reset(&sc->sc_vbus, hz, (void *)&at91_vbus_poll, sc); +} + +static void +at91_udp_clocks_on(void *arg) +{ + struct at91_udp_softc *sc = arg; + + at91_pmc_clock_enable(sc->sc_mclk); + at91_pmc_clock_enable(sc->sc_iclk); + at91_pmc_clock_enable(sc->sc_fclk); +} + +static void +at91_udp_clocks_off(void *arg) +{ + struct at91_udp_softc *sc = arg; + + at91_pmc_clock_disable(sc->sc_fclk); + at91_pmc_clock_disable(sc->sc_iclk); + at91_pmc_clock_disable(sc->sc_mclk); +} + +static void +at91_udp_pull_up(void *arg) +{ + at91_pio_gpio_set(PULLUP_BASE, PULLUP_MASK); +} + +static void +at91_udp_pull_down(void *arg) +{ + at91_pio_gpio_clear(PULLUP_BASE, PULLUP_MASK); +} + +static int +at91_udp_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "atmel,at91rm9200-udc")) + return (ENXIO); + device_set_desc(dev, "AT91 integrated AT91_UDP controller"); + return (0); +} + +static int +at91_udp_attach(device_t dev) +{ + struct at91_udp_softc *sc = device_get_softc(dev); + int err; + int rid; + + /* setup AT9100 USB device controller interface softc */ + + sc->sc_dci.sc_clocks_on = &at91_udp_clocks_on; + sc->sc_dci.sc_clocks_off = &at91_udp_clocks_off; + sc->sc_dci.sc_clocks_arg = sc; + sc->sc_dci.sc_pull_up = &at91_udp_pull_up; + sc->sc_dci.sc_pull_down = &at91_udp_pull_down; + sc->sc_dci.sc_pull_arg = sc; + + /* initialise some bus fields */ + sc->sc_dci.sc_bus.parent = dev; + sc->sc_dci.sc_bus.devices = sc->sc_dci.sc_devices; + sc->sc_dci.sc_bus.devices_max = AT91_MAX_DEVICES; + + /* get all DMA memory */ + if (usb_bus_mem_alloc_all(&sc->sc_dci.sc_bus, + USB_GET_DMA_TAG(dev), NULL)) { + return (ENOMEM); + } + callout_init_mtx(&sc->sc_vbus, &sc->sc_dci.sc_bus.bus_mtx, 0); + + /* + * configure VBUS input pin, enable deglitch and enable + * interrupt : + */ + at91_pio_use_gpio(VBUS_BASE, VBUS_MASK); + at91_pio_gpio_input(VBUS_BASE, VBUS_MASK); + at91_pio_gpio_set_deglitch(VBUS_BASE, VBUS_MASK, 1); + at91_pio_gpio_set_interrupt(VBUS_BASE, VBUS_MASK, 0); + + /* + * configure PULLUP output pin : + */ + at91_pio_use_gpio(PULLUP_BASE, PULLUP_MASK); + at91_pio_gpio_output(PULLUP_BASE, PULLUP_MASK, 0); + + at91_udp_pull_down(sc); + + /* wait 10ms for pulldown to stabilise */ + usb_pause_mtx(NULL, hz / 100); + + sc->sc_mclk = at91_pmc_clock_ref("mck"); + sc->sc_iclk = at91_pmc_clock_ref("udc_clk"); + sc->sc_fclk = at91_pmc_clock_ref("udpck"); + + rid = MEM_RID; + sc->sc_dci.sc_io_res = + bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + + if (!(sc->sc_dci.sc_io_res)) { + err = ENOMEM; + goto error; + } + sc->sc_dci.sc_io_tag = rman_get_bustag(sc->sc_dci.sc_io_res); + sc->sc_dci.sc_io_hdl = rman_get_bushandle(sc->sc_dci.sc_io_res); + sc->sc_dci.sc_io_size = rman_get_size(sc->sc_dci.sc_io_res); + + rid = 0; + sc->sc_dci.sc_irq_res = + bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); + if (!(sc->sc_dci.sc_irq_res)) { + goto error; + } + sc->sc_dci.sc_bus.bdev = device_add_child(dev, "usbus", -1); + if (!(sc->sc_dci.sc_bus.bdev)) { + goto error; + } + device_set_ivars(sc->sc_dci.sc_bus.bdev, &sc->sc_dci.sc_bus); + +#if (__FreeBSD_version >= 700031) + err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); +#else + err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + (driver_intr_t *)at91dci_interrupt, sc, &sc->sc_dci.sc_intr_hdl); +#endif + if (err) { + sc->sc_dci.sc_intr_hdl = NULL; + goto error; + } + + err = at91dci_init(&sc->sc_dci); + if (!err) { + err = device_probe_and_attach(sc->sc_dci.sc_bus.bdev); + } + if (err) { + goto error; + } else { + /* poll VBUS one time */ + USB_BUS_LOCK(&sc->sc_dci.sc_bus); + at91_vbus_poll(sc); + USB_BUS_UNLOCK(&sc->sc_dci.sc_bus); + } + return (0); + +error: + at91_udp_detach(dev); + return (ENXIO); +} + +static int +at91_udp_detach(device_t dev) +{ + struct at91_udp_softc *sc = device_get_softc(dev); + device_t bdev; + int err; + + if (sc->sc_dci.sc_bus.bdev) { + bdev = sc->sc_dci.sc_bus.bdev; + device_detach(bdev); + device_delete_child(dev, bdev); + } + /* during module unload there are lots of children leftover */ + device_delete_children(dev); + + USB_BUS_LOCK(&sc->sc_dci.sc_bus); + callout_stop(&sc->sc_vbus); + USB_BUS_UNLOCK(&sc->sc_dci.sc_bus); + + callout_drain(&sc->sc_vbus); + + /* disable Transceiver */ + AT91_UDP_WRITE_4(&sc->sc_dci, AT91_UDP_TXVC, AT91_UDP_TXVC_DIS); + + /* disable and clear all interrupts */ + AT91_UDP_WRITE_4(&sc->sc_dci, AT91_UDP_IDR, 0xFFFFFFFF); + AT91_UDP_WRITE_4(&sc->sc_dci, AT91_UDP_ICR, 0xFFFFFFFF); + + if (sc->sc_dci.sc_irq_res && sc->sc_dci.sc_intr_hdl) { + /* + * only call at91_udp_uninit() after at91_udp_init() + */ + at91dci_uninit(&sc->sc_dci); + + err = bus_teardown_intr(dev, sc->sc_dci.sc_irq_res, + sc->sc_dci.sc_intr_hdl); + sc->sc_dci.sc_intr_hdl = NULL; + } + if (sc->sc_dci.sc_irq_res) { + bus_release_resource(dev, SYS_RES_IRQ, 0, + sc->sc_dci.sc_irq_res); + sc->sc_dci.sc_irq_res = NULL; + } + if (sc->sc_dci.sc_io_res) { + bus_release_resource(dev, SYS_RES_MEMORY, MEM_RID, + sc->sc_dci.sc_io_res); + sc->sc_dci.sc_io_res = NULL; + } + usb_bus_mem_free_all(&sc->sc_dci.sc_bus, NULL); + + /* disable clocks */ + at91_pmc_clock_disable(sc->sc_iclk); + at91_pmc_clock_disable(sc->sc_fclk); + at91_pmc_clock_disable(sc->sc_mclk); + at91_pmc_clock_deref(sc->sc_fclk); + at91_pmc_clock_deref(sc->sc_iclk); + at91_pmc_clock_deref(sc->sc_mclk); + + return (0); +} + +static device_method_t at91_udp_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, at91_udp_probe), + DEVMETHOD(device_attach, at91_udp_attach), + DEVMETHOD(device_detach, at91_udp_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + DEVMETHOD_END +}; + +static driver_t at91_udp_driver = { + .name = "at91_udp", + .methods = at91_udp_methods, + .size = sizeof(struct at91_udp_softc), +}; + +static devclass_t at91_udp_devclass; + +DRIVER_MODULE(at91_udp, simplebus, at91_udp_driver, at91_udp_devclass, 0, 0); Added: head/sys/dev/usb/controller/ohci_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/ohci_fdt.c Fri Feb 28 03:00:31 2014 (r262601) @@ -0,0 +1,250 @@ +/*- + * Copyright (c) 2006 M. Warner Losh. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include + +#define MEM_RID 0 + +static device_probe_t ohci_at91_fdt_probe; +static device_attach_t ohci_at91_fdt_attach; +static device_detach_t ohci_at91_fdt_detach; + +struct at91_ohci_softc { + struct ohci_softc sc_ohci; /* must be first */ + struct at91_pmc_clock *mclk; + struct at91_pmc_clock *iclk; + struct at91_pmc_clock *fclk; +}; + +static int +ohci_at91_fdt_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "atmel,at91rm9200-ohci")) + return (ENXIO); + device_set_desc(dev, "AT91 integrated OHCI controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +ohci_at91_fdt_attach(device_t dev) +{ + struct at91_ohci_softc *sc = device_get_softc(dev); + int err; + int rid; + + /* initialise some bus fields */ + sc->sc_ohci.sc_bus.parent = dev; + sc->sc_ohci.sc_bus.devices = sc->sc_ohci.sc_devices; + sc->sc_ohci.sc_bus.devices_max = OHCI_MAX_DEVICES; + + /* get all DMA memory */ + if (usb_bus_mem_alloc_all(&sc->sc_ohci.sc_bus, + USB_GET_DMA_TAG(dev), &ohci_iterate_hw_softc)) { + return (ENOMEM); + } + sc->mclk = at91_pmc_clock_ref("mck"); + sc->iclk = at91_pmc_clock_ref("ohci_clk"); + sc->fclk = at91_pmc_clock_ref("uhpck"); + + sc->sc_ohci.sc_dev = dev; + + rid = MEM_RID; + sc->sc_ohci.sc_io_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + + if (!(sc->sc_ohci.sc_io_res)) { + err = ENOMEM; + goto error; + } + sc->sc_ohci.sc_io_tag = rman_get_bustag(sc->sc_ohci.sc_io_res); + sc->sc_ohci.sc_io_hdl = rman_get_bushandle(sc->sc_ohci.sc_io_res); + sc->sc_ohci.sc_io_size = rman_get_size(sc->sc_ohci.sc_io_res); + + rid = 0; + sc->sc_ohci.sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (!(sc->sc_ohci.sc_irq_res)) { + goto error; + } + sc->sc_ohci.sc_bus.bdev = device_add_child(dev, "usbus", -1); + if (!(sc->sc_ohci.sc_bus.bdev)) { + goto error; + } + device_set_ivars(sc->sc_ohci.sc_bus.bdev, &sc->sc_ohci.sc_bus); + + strlcpy(sc->sc_ohci.sc_vendor, "Atmel", sizeof(sc->sc_ohci.sc_vendor)); + + err = bus_setup_intr(dev, sc->sc_ohci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)ohci_interrupt, sc, &sc->sc_ohci.sc_intr_hdl); + if (err) { + sc->sc_ohci.sc_intr_hdl = NULL; + goto error; + } + /* + * turn on the clocks from the AT91's point of view. Keep the unit in reset. + */ + at91_pmc_clock_enable(sc->mclk); + at91_pmc_clock_enable(sc->iclk); + at91_pmc_clock_enable(sc->fclk); + bus_space_write_4(sc->sc_ohci.sc_io_tag, sc->sc_ohci.sc_io_hdl, + OHCI_CONTROL, 0); + + err = ohci_init(&sc->sc_ohci); + if (!err) { + err = device_probe_and_attach(sc->sc_ohci.sc_bus.bdev); + } + if (err) { + goto error; + } + return (0); + +error: + ohci_at91_fdt_detach(dev); + return (ENXIO); +} + +static int +ohci_at91_fdt_detach(device_t dev) +{ + struct at91_ohci_softc *sc = device_get_softc(dev); + device_t bdev; + int err; + + if (sc->sc_ohci.sc_bus.bdev) { + bdev = sc->sc_ohci.sc_bus.bdev; + device_detach(bdev); + device_delete_child(dev, bdev); + } + /* during module unload there are lots of children leftover */ + device_delete_children(dev); + + if (sc->sc_ohci.sc_io_res != NULL) { + /* + * Put the controller into reset, then disable clocks and do + * the MI tear down. We have to disable the clocks/hardware + * after we do the rest of the teardown. We also disable the + * clocks in the opposite order we acquire them, but that + * doesn't seem to be absolutely necessary. We free up the + * clocks after we disable them, so the system could, in + * theory, reuse them. + */ + bus_space_write_4(sc->sc_ohci.sc_io_tag, sc->sc_ohci.sc_io_hdl, + OHCI_CONTROL, 0); + + at91_pmc_clock_disable(sc->fclk); + at91_pmc_clock_disable(sc->iclk); + at91_pmc_clock_disable(sc->mclk); + at91_pmc_clock_deref(sc->fclk); + at91_pmc_clock_deref(sc->iclk); + at91_pmc_clock_deref(sc->mclk); + + if (sc->sc_ohci.sc_irq_res && sc->sc_ohci.sc_intr_hdl) { + /* + * only call ohci_detach() after ohci_init() + */ + ohci_detach(&sc->sc_ohci); + + err = bus_teardown_intr(dev, sc->sc_ohci.sc_irq_res, + sc->sc_ohci.sc_intr_hdl); + sc->sc_ohci.sc_intr_hdl = NULL; + } + if (sc->sc_ohci.sc_irq_res) { + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_ohci.sc_irq_res); + sc->sc_ohci.sc_irq_res = NULL; + } + if (sc->sc_ohci.sc_io_res) { + bus_release_resource(dev, SYS_RES_MEMORY, MEM_RID, + sc->sc_ohci.sc_io_res); + sc->sc_ohci.sc_io_res = NULL; + } + } + usb_bus_mem_free_all(&sc->sc_ohci.sc_bus, &ohci_iterate_hw_softc); + + return (0); +} + +static device_method_t ohci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ohci_at91_fdt_probe), + DEVMETHOD(device_attach, ohci_at91_fdt_attach), + DEVMETHOD(device_detach, ohci_at91_fdt_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + DEVMETHOD_END +}; + +static driver_t ohci_driver = { + .name = "ohci", + .methods = ohci_methods, + .size = sizeof(struct at91_ohci_softc), +}; + +static devclass_t ohci_devclass; + +DRIVER_MODULE(ohci, simplebus, ohci_driver, ohci_devclass, 0, 0); +MODULE_DEPEND(ohci, usb, 1, 1, 1); From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 15:55:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7BB4F9AA; Fri, 28 Feb 2014 15:55:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4F04C1996; Fri, 28 Feb 2014 15:55:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SFta0v056373; Fri, 28 Feb 2014 15:55:36 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SFtZOn056371; Fri, 28 Feb 2014 15:55:35 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402281555.s1SFtZOn056371@svn.freebsd.org> From: Christian Brueffer Date: Fri, 28 Feb 2014 15:55:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262603 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 15:55:36 -0000 Author: brueffer Date: Fri Feb 28 15:55:35 2014 New Revision: 262603 URL: http://svnweb.freebsd.org/changeset/base/262603 Log: mdoc cleanup. MFC after: 1 week Modified: head/share/man/man4/nvd.4 head/share/man/man4/nvme.4 Modified: head/share/man/man4/nvd.4 ============================================================================== --- head/share/man/man4/nvd.4 Fri Feb 28 12:48:17 2014 (r262602) +++ head/share/man/man4/nvd.4 Fri Feb 28 15:55:35 2014 (r262603) @@ -65,7 +65,7 @@ I/O commands. .Sh SEE ALSO .Xr nvme 4 , .Xr nvmecontrol 8 , -.Xr disk 9 . +.Xr disk 9 .Sh HISTORY The .Nm Modified: head/share/man/man4/nvme.4 ============================================================================== --- head/share/man/man4/nvme.4 Fri Feb 28 12:48:17 2014 (r262602) +++ head/share/man/man4/nvme.4 Fri Feb 28 15:55:35 2014 (r262603) @@ -73,9 +73,13 @@ API for registering NVMe namespace consu API for submitting NVM commands to namespaces .It Ioctls for controller and namespace configuration and management +.Pp .Nm -creates controller devices in the format /dev/nvmeX and namespace devices in -the format /dev/nvmeXnsY. +creates controller devices in the format +.Pa /dev/nvmeX +and namespace devices in +the format +.Pa /dev/nvmeXnsY . Note that the NVM Express specification starts numbering namespaces at 1, not 0, and this driver follows that convention. .El @@ -104,7 +108,8 @@ Note that use of INTx implies disabling The following controller-level sysctls are currently implemented: .Bl -tag -width indent .It Va dev.nvme.0.int_coal_time -(R/W) Interrupt coalescing timer period in microseconds. Set to 0 to disable. +(R/W) Interrupt coalescing timer period in microseconds. +Set to 0 to disable. .It Va dev.nvme.0.int_coal_threshold (R/W) Interrupt coalescing threshold in number of command completions. Set to 0 to disable. @@ -146,7 +151,7 @@ and completion queues to the console. .Xr nvd 4 , .Xr pci 4 , .Xr nvmecontrol 8 , -.Xr disk 9 . +.Xr disk 9 .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 16:26:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C46B576B; Fri, 28 Feb 2014 16:26:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 972231C5B; Fri, 28 Feb 2014 16:26:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SGQitg070683; Fri, 28 Feb 2014 16:26:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SGQiJ7070682; Fri, 28 Feb 2014 16:26:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402281626.s1SGQiJ7070682@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Feb 2014 16:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262606 - head/sys/contrib/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 16:26:44 -0000 Author: imp Date: Fri Feb 28 16:26:44 2014 New Revision: 262606 URL: http://svnweb.freebsd.org/changeset/base/262606 Log: These file have a, possibly dubious, GPL claim. Until that's sorted, move to gnu. Added: - copied from r262605, head/sys/contrib/dts/ Directory Properties: head/sys/gnu/dts/ (props changed) Deleted: head/sys/contrib/dts/ From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 16:35:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 227AF948; Fri, 28 Feb 2014 16:35:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E9C5F1D10; Fri, 28 Feb 2014 16:35:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SGZ1qD074567; Fri, 28 Feb 2014 16:35:01 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SGZ1aA074566; Fri, 28 Feb 2014 16:35:01 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402281635.s1SGZ1aA074566@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Feb 2014 16:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262607 - head/sys/gnu/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 16:35:02 -0000 Author: imp Date: Fri Feb 28 16:35:01 2014 New Revision: 262607 URL: http://svnweb.freebsd.org/changeset/base/262607 Log: Add proper svn:keyword props Modified: Directory Properties: head/sys/gnu/dts/FreeBSD-list (props changed) head/sys/gnu/dts/FreeBSD-upgrade (props changed) From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 16:42:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82256C4B; Fri, 28 Feb 2014 16:42:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6EA4F1DD7; Fri, 28 Feb 2014 16:42:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SGgFes078281; Fri, 28 Feb 2014 16:42:15 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SGgFLq078277; Fri, 28 Feb 2014 16:42:15 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402281642.s1SGgFLq078277@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Feb 2014 16:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262608 - head/sys/gnu/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 16:42:15 -0000 Author: imp Date: Fri Feb 28 16:42:14 2014 New Revision: 262608 URL: http://svnweb.freebsd.org/changeset/base/262608 Log: Add skeleton.dtsi and update to new place in tree. Modified: head/sys/gnu/dts/FreeBSD-list head/sys/gnu/dts/FreeBSD-upgrade Modified: head/sys/gnu/dts/FreeBSD-list ============================================================================== --- head/sys/gnu/dts/FreeBSD-list Fri Feb 28 16:35:01 2014 (r262607) +++ head/sys/gnu/dts/FreeBSD-list Fri Feb 28 16:42:14 2014 (r262608) @@ -64,6 +64,7 @@ src/arm/sama5d3_uart.dtsi src/arm/sama5d3xcm.dtsi src/arm/sama5d3xdm.dtsi src/arm/sama5d3xmb.dtsi +src/arm/skeleton.dtsi src/arm/tny_a9260.dts src/arm/tny_a9260_common.dtsi src/arm/tny_a9263.dts Modified: head/sys/gnu/dts/FreeBSD-upgrade ============================================================================== --- head/sys/gnu/dts/FreeBSD-upgrade Fri Feb 28 16:35:01 2014 (r262607) +++ head/sys/gnu/dts/FreeBSD-upgrade Fri Feb 28 16:42:14 2014 (r262608) @@ -13,7 +13,7 @@ # all of them. This means we have an 'opt in' list rather than an 'opt out' list # that's more typical for FreeBSD. The opt-in list should be relative to the top level # directory (so a bunch of lines starting with src). We import src/$ARCH/foo into -# sys/contrib/dts/$ARCH/foo with the goal being to use as many of these files as possible +# sys/gnu/dts/$ARCH/foo with the goal being to use as many of these files as possible # unmodified for FreeBSD. This isn't always possible, but there are workarounds. # # This script should take care of all that the first time... @@ -21,4 +21,4 @@ s=svn+ssh://svn.freebsd.org/base/vendor/device-tree/dist/ args=$(grep -v ^# FreeBSD-list | sed -e"s=^=$s=") -svn cp -m "Initial import of DTS files from Linux" ${args} svn+ssh://svn.freebsd.org/base/head/sys/contrib/dts/arm +svn cp -m "Initial import of DTS files from Linux" ${args} svn+ssh://svn.freebsd.org/base/head/sys/gnu/dts/arm From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 16:43:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FF04E89; Fri, 28 Feb 2014 16:43:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5C6E71DEF; Fri, 28 Feb 2014 16:43:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SGhvGf078658; Fri, 28 Feb 2014 16:43:57 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SGhvXT078657; Fri, 28 Feb 2014 16:43:57 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402281643.s1SGhvXT078657@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Feb 2014 16:43:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262609 - head/sys/gnu/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 16:43:57 -0000 Author: imp Date: Fri Feb 28 16:43:56 2014 New Revision: 262609 URL: http://svnweb.freebsd.org/changeset/base/262609 Log: Add missing skeleton file. Added: head/sys/gnu/dts/arm/skeleton.dtsi - copied unchanged from r262608, vendor/device-tree/dist/src/arm/skeleton.dtsi Copied: head/sys/gnu/dts/arm/skeleton.dtsi (from r262608, vendor/device-tree/dist/src/arm/skeleton.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/skeleton.dtsi Fri Feb 28 16:43:56 2014 (r262609, copy of r262608, vendor/device-tree/dist/src/arm/skeleton.dtsi) @@ -0,0 +1,13 @@ +/* + * Skeleton device tree; the bare minimum needed to boot; just include and + * add a compatible value. The bootloader will typically populate the memory + * node. + */ + +/ { + #address-cells = <1>; + #size-cells = <1>; + chosen { }; + aliases { }; + memory { device_type = "memory"; reg = <0 0>; }; +}; From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 16:51:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3956AE9; Fri, 28 Feb 2014 16:51:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0C67F1F9A; Fri, 28 Feb 2014 16:51:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SGpXIE080739; Fri, 28 Feb 2014 16:51:33 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SGpXKn080738; Fri, 28 Feb 2014 16:51:33 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402281651.s1SGpXKn080738@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Feb 2014 16:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262610 - head/sys/gnu/dts/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 16:51:34 -0000 Author: imp Date: Fri Feb 28 16:51:33 2014 New Revision: 262610 URL: http://svnweb.freebsd.org/changeset/base/262610 Log: Symbolic bindings for the dts files... Added: head/sys/gnu/dts/include/ - copied from r262609, vendor/device-tree/dist/include/ From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 17:12:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41412653; Fri, 28 Feb 2014 17:12:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2D10B1178; Fri, 28 Feb 2014 17:12:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SHCWdH090492; Fri, 28 Feb 2014 17:12:32 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SHCVsH090489; Fri, 28 Feb 2014 17:12:31 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402281712.s1SHCVsH090489@svn.freebsd.org> From: Dimitry Andric Date: Fri, 28 Feb 2014 17:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262611 - in head/contrib/llvm: include/llvm/MC lib/MC X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 17:12:32 -0000 Author: dim Date: Fri Feb 28 17:12:31 2014 New Revision: 262611 URL: http://svnweb.freebsd.org/changeset/base/262611 Log: Pull in r196874 from upstream llvm trunk: Fix a crash that occurs when PWD is invalid. MCJIT needs to be able to run in hostile environments, even when PWD is invalid. There's no need to crash MCJIT in this case. The obvious fix is to simply leave MCContext's CompilationDir empty when PWD can't be determined. This way, MCJIT clients, and other clients that link with LLVM don't need a valid working directory. If we do want to guarantee valid CompilationDir, that should be done only for clients of getCompilationDir(). This is as simple as checking for an empty string. The only current use of getCompilationDir is EmitGenDwarfInfo, which won't conceivably run with an invalid working dir. However, in the purely hypothetically and untestable case that this happens, the AT_comp_dir will be omitted from the compilation_unit DIE. This should help fix assertions occurring with ports-mgmt/tinderbox, when it is using jails, and sometimes invalidates clang's current working directory. Reported by: decke MFC after: 2 weeks X-MFC-With: r261991 Modified: head/contrib/llvm/include/llvm/MC/MCContext.h head/contrib/llvm/lib/MC/MCContext.cpp head/contrib/llvm/lib/MC/MCDwarf.cpp Modified: head/contrib/llvm/include/llvm/MC/MCContext.h ============================================================================== --- head/contrib/llvm/include/llvm/MC/MCContext.h Fri Feb 28 16:51:33 2014 (r262610) +++ head/contrib/llvm/include/llvm/MC/MCContext.h Fri Feb 28 17:12:31 2014 (r262611) @@ -278,6 +278,7 @@ namespace llvm { /// This can be overridden by clients which want to control the reported /// compilation directory and have it be something other than the current /// working directory. + /// Returns an empty string if the current directory cannot be determined. StringRef getCompilationDir() const { return CompilationDir; } /// \brief Set the compilation directory for DW_AT_comp_dir Modified: head/contrib/llvm/lib/MC/MCContext.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCContext.cpp Fri Feb 28 16:51:33 2014 (r262610) +++ head/contrib/llvm/lib/MC/MCContext.cpp Fri Feb 28 17:12:31 2014 (r262611) @@ -47,8 +47,8 @@ MCContext::MCContext(const MCAsmInfo *ma AllowTemporaryLabels(true), DwarfCompileUnitID(0), AutoReset(DoAutoReset) { error_code EC = llvm::sys::fs::current_path(CompilationDir); - assert(!EC && "Could not determine the current directory"); - (void)EC; + if (EC) + CompilationDir.clear(); MachOUniquingMap = 0; ELFUniquingMap = 0; Modified: head/contrib/llvm/lib/MC/MCDwarf.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCDwarf.cpp Fri Feb 28 16:51:33 2014 (r262610) +++ head/contrib/llvm/lib/MC/MCDwarf.cpp Fri Feb 28 17:12:31 2014 (r262611) @@ -467,7 +467,8 @@ static void EmitGenDwarfAbbrev(MCStreame EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr); EmitAbbrev(MCOS, dwarf::DW_AT_high_pc, dwarf::DW_FORM_addr); EmitAbbrev(MCOS, dwarf::DW_AT_name, dwarf::DW_FORM_string); - EmitAbbrev(MCOS, dwarf::DW_AT_comp_dir, dwarf::DW_FORM_string); + if (!context.getCompilationDir().empty()) + EmitAbbrev(MCOS, dwarf::DW_AT_comp_dir, dwarf::DW_FORM_string); StringRef DwarfDebugFlags = context.getDwarfDebugFlags(); if (!DwarfDebugFlags.empty()) EmitAbbrev(MCOS, dwarf::DW_AT_APPLE_flags, dwarf::DW_FORM_string); @@ -643,8 +644,10 @@ static void EmitGenDwarfInfo(MCStreamer MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string. // AT_comp_dir, the working directory the assembly was done in. - MCOS->EmitBytes(context.getCompilationDir()); - MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string. + if (!context.getCompilationDir().empty()) { + MCOS->EmitBytes(context.getCompilationDir()); + MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string. + } // AT_APPLE_flags, the command line arguments of the assembler tool. StringRef DwarfDebugFlags = context.getDwarfDebugFlags(); From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 18:06:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DAF7B32A; Fri, 28 Feb 2014 18:06:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C2752161E; Fri, 28 Feb 2014 18:06:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SI6APH010852; Fri, 28 Feb 2014 18:06:10 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SI610U010791; Fri, 28 Feb 2014 18:06:01 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402281806.s1SI610U010791@svn.freebsd.org> From: Dimitry Andric Date: Fri, 28 Feb 2014 18:06:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262613 - in head: contrib/compiler-rt/lib contrib/gcc contrib/llvm/include/llvm/MC contrib/llvm/include/llvm/Object contrib/llvm/include/llvm/Support contrib/llvm/lib/CodeGen/AsmPrinte... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 18:06:11 -0000 Author: dim Date: Fri Feb 28 18:06:00 2014 New Revision: 262613 URL: http://svnweb.freebsd.org/changeset/base/262613 Log: Merge the projects/clang-sparc64 branch back to head. This brings in several updates from the llvm and clang trunks to make the sparc64 backend fully functional. Apart from one patch to sys/sparc64/include/pcpu.h which is still under discussion, this makes it possible to let clang fully build world and kernel for sparc64. Any assistance with testing this on actual sparc64 hardware is greatly appreciated, as there will unavoidably be bugs left. Many thanks go to Roman Divacky for his upstream work on getting the sparc64 backend into shape. MFC after: 1 month Added: head/contrib/llvm/lib/Target/Sparc/AsmParser/ - copied from r262612, projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/AsmParser/ head/contrib/llvm/lib/Target/Sparc/Disassembler/ - copied from r262612, projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/Disassembler/ head/contrib/llvm/lib/Target/Sparc/InstPrinter/ - copied from r262612, projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/InstPrinter/ head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp - copied unchanged from r262612, projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcELFObjectWriter.cpp - copied unchanged from r262612, projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcELFObjectWriter.cpp head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcFixupKinds.h - copied unchanged from r262612, projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcFixupKinds.h head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp - copied unchanged from r262612, projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.cpp - copied unchanged from r262612, projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.cpp head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.h - copied unchanged from r262612, projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.h head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcTargetStreamer.cpp - copied unchanged from r262612, projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcTargetStreamer.cpp head/contrib/llvm/lib/Target/Sparc/SparcInstrAliases.td - copied unchanged from r262612, projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/SparcInstrAliases.td head/contrib/llvm/lib/Target/Sparc/SparcMCInstLower.cpp - copied unchanged from r262612, projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/SparcMCInstLower.cpp head/contrib/llvm/lib/Target/Sparc/SparcTargetObjectFile.cpp - copied unchanged from r262612, projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/SparcTargetObjectFile.cpp head/contrib/llvm/lib/Target/Sparc/SparcTargetObjectFile.h - copied unchanged from r262612, projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/SparcTargetObjectFile.h head/contrib/llvm/lib/Target/Sparc/SparcTargetStreamer.h - copied unchanged from r262612, projects/clang-sparc64/contrib/llvm/lib/Target/Sparc/SparcTargetStreamer.h head/lib/clang/include/SparcGenAsmMatcher.inc - copied unchanged from r262612, projects/clang-sparc64/lib/clang/include/SparcGenAsmMatcher.inc head/lib/clang/include/SparcGenAsmWriter.inc - copied unchanged from r262612, projects/clang-sparc64/lib/clang/include/SparcGenAsmWriter.inc head/lib/clang/include/SparcGenCallingConv.inc - copied unchanged from r262612, projects/clang-sparc64/lib/clang/include/SparcGenCallingConv.inc head/lib/clang/include/SparcGenCodeEmitter.inc - copied unchanged from r262612, projects/clang-sparc64/lib/clang/include/SparcGenCodeEmitter.inc head/lib/clang/include/SparcGenDAGISel.inc - copied unchanged from r262612, projects/clang-sparc64/lib/clang/include/SparcGenDAGISel.inc head/lib/clang/include/SparcGenDisassemblerTables.inc - copied unchanged from r262612, projects/clang-sparc64/lib/clang/include/SparcGenDisassemblerTables.inc head/lib/clang/include/SparcGenInstrInfo.inc - copied unchanged from r262612, projects/clang-sparc64/lib/clang/include/SparcGenInstrInfo.inc head/lib/clang/include/SparcGenMCCodeEmitter.inc - copied unchanged from r262612, projects/clang-sparc64/lib/clang/include/SparcGenMCCodeEmitter.inc head/lib/clang/include/SparcGenRegisterInfo.inc - copied unchanged from r262612, projects/clang-sparc64/lib/clang/include/SparcGenRegisterInfo.inc head/lib/clang/include/SparcGenSubtargetInfo.inc - copied unchanged from r262612, projects/clang-sparc64/lib/clang/include/SparcGenSubtargetInfo.inc head/lib/clang/libllvmsparcasmparser/ - copied from r262612, projects/clang-sparc64/lib/clang/libllvmsparcasmparser/ head/lib/clang/libllvmsparccodegen/ - copied from r262612, projects/clang-sparc64/lib/clang/libllvmsparccodegen/ head/lib/clang/libllvmsparcdesc/ - copied from r262612, projects/clang-sparc64/lib/clang/libllvmsparcdesc/ head/lib/clang/libllvmsparcdisassembler/ - copied from r262612, projects/clang-sparc64/lib/clang/libllvmsparcdisassembler/ head/lib/clang/libllvmsparcinfo/ - copied from r262612, projects/clang-sparc64/lib/clang/libllvmsparcinfo/ head/lib/clang/libllvmsparcinstprinter/ - copied from r262612, projects/clang-sparc64/lib/clang/libllvmsparcinstprinter/ Modified: head/contrib/compiler-rt/lib/absvti2.c head/contrib/compiler-rt/lib/addvti3.c head/contrib/compiler-rt/lib/ashlti3.c head/contrib/compiler-rt/lib/ashrti3.c head/contrib/compiler-rt/lib/clzti2.c head/contrib/compiler-rt/lib/cmpti2.c head/contrib/compiler-rt/lib/ctzti2.c head/contrib/compiler-rt/lib/divti3.c head/contrib/compiler-rt/lib/ffsti2.c head/contrib/compiler-rt/lib/fixdfti.c head/contrib/compiler-rt/lib/fixsfti.c head/contrib/compiler-rt/lib/fixunsdfti.c head/contrib/compiler-rt/lib/fixunssfti.c head/contrib/compiler-rt/lib/fixunsxfti.c head/contrib/compiler-rt/lib/fixxfti.c head/contrib/compiler-rt/lib/floattidf.c head/contrib/compiler-rt/lib/floattisf.c head/contrib/compiler-rt/lib/floattixf.c head/contrib/compiler-rt/lib/floatuntidf.c head/contrib/compiler-rt/lib/floatuntisf.c head/contrib/compiler-rt/lib/floatuntixf.c head/contrib/compiler-rt/lib/int_types.h head/contrib/compiler-rt/lib/lshrti3.c head/contrib/compiler-rt/lib/modti3.c head/contrib/compiler-rt/lib/muloti4.c head/contrib/compiler-rt/lib/multi3.c head/contrib/compiler-rt/lib/mulvti3.c head/contrib/compiler-rt/lib/negti2.c head/contrib/compiler-rt/lib/negvti2.c head/contrib/compiler-rt/lib/parityti2.c head/contrib/compiler-rt/lib/popcountti2.c head/contrib/compiler-rt/lib/subvti3.c head/contrib/compiler-rt/lib/ucmpti2.c head/contrib/compiler-rt/lib/udivmodti4.c head/contrib/compiler-rt/lib/udivti3.c head/contrib/compiler-rt/lib/umodti3.c head/contrib/gcc/longlong.h head/contrib/llvm/include/llvm/MC/MCAsmInfo.h head/contrib/llvm/include/llvm/Object/ELFObjectFile.h head/contrib/llvm/include/llvm/Support/ELF.h head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp head/contrib/llvm/lib/MC/MCObjectFileInfo.cpp head/contrib/llvm/lib/Object/ELF.cpp head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp head/contrib/llvm/lib/Target/Sparc/DelaySlotFiller.cpp head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.h head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.h head/contrib/llvm/lib/Target/Sparc/Sparc.h head/contrib/llvm/lib/Target/Sparc/Sparc.td head/contrib/llvm/lib/Target/Sparc/SparcAsmPrinter.cpp head/contrib/llvm/lib/Target/Sparc/SparcCallingConv.td head/contrib/llvm/lib/Target/Sparc/SparcCodeEmitter.cpp head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.h head/contrib/llvm/lib/Target/Sparc/SparcInstr64Bit.td head/contrib/llvm/lib/Target/Sparc/SparcInstrFormats.td head/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.cpp head/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td head/contrib/llvm/lib/Target/Sparc/SparcJITInfo.cpp head/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp head/contrib/llvm/lib/Target/Sparc/SparcRelocations.h head/contrib/llvm/lib/Target/Sparc/SparcSubtarget.cpp head/contrib/llvm/lib/Target/Sparc/SparcSubtarget.h head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp head/lib/clang/Makefile head/lib/clang/clang.build.mk head/lib/clang/include/llvm/Config/AsmParsers.def head/lib/clang/include/llvm/Config/AsmPrinters.def head/lib/clang/include/llvm/Config/Disassemblers.def head/lib/clang/include/llvm/Config/Targets.def head/lib/libc/sparc64/sys/__sparc_utrap_setup.c head/lib/msun/Makefile head/lib/msun/ld128/s_expl.c head/share/mk/bsd.sys.mk head/sys/boot/sparc64/boot1/Makefile head/sys/conf/kern.mk head/sys/dev/esp/esp_sbus.c head/sys/dev/fb/creator.c head/sys/dev/fb/machfb.c head/sys/dev/mk48txx/mk48txx.c head/sys/kern/kern_malloc.c head/sys/sparc64/conf/GENERIC head/sys/sparc64/isa/isa.c head/sys/sparc64/pci/firereg.h head/usr.bin/clang/clang/Makefile head/usr.bin/clang/llc/Makefile head/usr.bin/clang/llvm-mc/Makefile head/usr.bin/clang/llvm-objdump/Makefile head/usr.bin/clang/llvm-rtdyld/Makefile head/usr.bin/clang/opt/Makefile head/usr.sbin/eeprom/ofw_options.c Directory Properties: head/ (props changed) head/cddl/ (props changed) head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/contrib/compiler-rt/ (props changed) head/contrib/gcc/ (props changed) head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) head/contrib/llvm/tools/lldb/ (props changed) head/contrib/openpam/ (props changed) head/contrib/serf/ (props changed) head/etc/ (props changed) head/lib/libc/ (props changed) head/lib/libvmmapi/ (props changed) head/sbin/ (props changed) head/share/man/man4/ (props changed) head/sys/ (props changed) head/sys/amd64/include/vmm.h (props changed) head/sys/amd64/include/vmm_dev.h (props changed) head/sys/amd64/vmm/ (props changed) head/sys/boot/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) head/sys/conf/ (props changed) head/sys/gnu/dts/ (props changed) head/usr.sbin/bhyve/ (props changed) head/usr.sbin/bhyveload/ (props changed) Modified: head/contrib/compiler-rt/lib/absvti2.c ============================================================================== --- head/contrib/compiler-rt/lib/absvti2.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/absvti2.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: absolute value */ @@ -30,4 +30,5 @@ __absvti2(ti_int a) return (a ^ s) - s; } -#endif +#endif /* CRT_HAS_128BIT */ + Modified: head/contrib/compiler-rt/lib/addvti3.c ============================================================================== --- head/contrib/compiler-rt/lib/addvti3.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/addvti3.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: a + b */ @@ -37,4 +37,4 @@ __addvti3(ti_int a, ti_int b) return s; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/ashlti3.c ============================================================================== --- head/contrib/compiler-rt/lib/ashlti3.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/ashlti3.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: a << b */ @@ -42,4 +42,4 @@ __ashlti3(ti_int a, si_int b) return result.all; } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/ashrti3.c ============================================================================== --- head/contrib/compiler-rt/lib/ashrti3.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/ashrti3.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: arithmetic a >> b */ @@ -43,4 +43,4 @@ __ashrti3(ti_int a, si_int b) return result.all; } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/clzti2.c ============================================================================== --- head/contrib/compiler-rt/lib/clzti2.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/clzti2.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: the number of leading 0-bits */ @@ -30,4 +30,4 @@ __clzti2(ti_int a) ((si_int)f & ((si_int)(sizeof(di_int) * CHAR_BIT))); } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/cmpti2.c ============================================================================== --- head/contrib/compiler-rt/lib/cmpti2.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/cmpti2.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: if (a < b) returns 0 * if (a == b) returns 1 @@ -39,4 +39,4 @@ __cmpti2(ti_int a, ti_int b) return 1; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/ctzti2.c ============================================================================== --- head/contrib/compiler-rt/lib/ctzti2.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/ctzti2.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: the number of trailing 0-bits */ @@ -30,4 +30,4 @@ __ctzti2(ti_int a) ((si_int)f & ((si_int)(sizeof(di_int) * CHAR_BIT))); } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/divti3.c ============================================================================== --- head/contrib/compiler-rt/lib/divti3.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/divti3.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem); @@ -32,4 +32,4 @@ __divti3(ti_int a, ti_int b) return (__udivmodti4(a, b, (tu_int*)0) ^ s_a) - s_a; /* negate if s_a == -1 */ } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/ffsti2.c ============================================================================== --- head/contrib/compiler-rt/lib/ffsti2.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/ffsti2.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: the index of the least significant 1-bit in a, or * the value zero if a is zero. The least significant bit is index one. @@ -34,4 +34,4 @@ __ffsti2(ti_int a) return __builtin_ctzll(x.s.low) + 1; } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/fixdfti.c ============================================================================== --- head/contrib/compiler-rt/lib/fixdfti.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/fixdfti.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a signed long long, rounding toward zero. */ @@ -42,4 +42,4 @@ __fixdfti(double a) return (r ^ s) - s; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/fixsfti.c ============================================================================== --- head/contrib/compiler-rt/lib/fixsfti.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/fixsfti.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a signed long long, rounding toward zero. */ @@ -42,4 +42,4 @@ __fixsfti(float a) return (r ^ s) - s; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/fixunsdfti.c ============================================================================== --- head/contrib/compiler-rt/lib/fixunsdfti.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/fixunsdfti.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a unsigned long long, rounding toward zero. * Negative values all become zero. @@ -44,4 +44,4 @@ __fixunsdfti(double a) return r; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/fixunssfti.c ============================================================================== --- head/contrib/compiler-rt/lib/fixunssfti.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/fixunssfti.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a unsigned long long, rounding toward zero. * Negative values all become zero. @@ -44,4 +44,4 @@ __fixunssfti(float a) return r; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/fixunsxfti.c ============================================================================== --- head/contrib/compiler-rt/lib/fixunsxfti.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/fixunsxfti.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a unsigned long long, rounding toward zero. * Negative values all become zero. @@ -46,4 +46,4 @@ __fixunsxfti(long double a) return r; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/fixxfti.c ============================================================================== --- head/contrib/compiler-rt/lib/fixxfti.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/fixxfti.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a signed long long, rounding toward zero. */ @@ -44,4 +44,4 @@ __fixxfti(long double a) return (r ^ s) - s; } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/floattidf.c ============================================================================== --- head/contrib/compiler-rt/lib/floattidf.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/floattidf.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a double, rounding toward even.*/ @@ -82,4 +82,4 @@ __floattidf(ti_int a) return fb.f; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/floattisf.c ============================================================================== --- head/contrib/compiler-rt/lib/floattisf.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/floattisf.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a float, rounding toward even. */ @@ -81,4 +81,4 @@ __floattisf(ti_int a) return fb.f; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/floattixf.c ============================================================================== --- head/contrib/compiler-rt/lib/floattixf.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/floattixf.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a long double, rounding toward even. */ @@ -47,7 +47,7 @@ __floattixf(ti_int a) * P = bit LDBL_MANT_DIG-1 bits to the right of 1 * Q = bit LDBL_MANT_DIG bits to the right of 1 * R = "or" of all bits to the right of Q - */ + */ switch (sd) { case LDBL_MANT_DIG + 1: @@ -83,4 +83,4 @@ __floattixf(ti_int a) return fb.f; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/floatuntidf.c ============================================================================== --- head/contrib/compiler-rt/lib/floatuntidf.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/floatuntidf.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a double, rounding toward even. */ @@ -43,7 +43,7 @@ __floatuntidf(tu_int a) * P = bit DBL_MANT_DIG-1 bits to the right of 1 * Q = bit DBL_MANT_DIG bits to the right of 1 * R = "or" of all bits to the right of Q - */ + */ switch (sd) { case DBL_MANT_DIG + 1: @@ -79,4 +79,4 @@ __floatuntidf(tu_int a) return fb.f; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/floatuntisf.c ============================================================================== --- head/contrib/compiler-rt/lib/floatuntisf.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/floatuntisf.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a float, rounding toward even. */ @@ -78,4 +78,4 @@ __floatuntisf(tu_int a) return fb.f; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/floatuntixf.c ============================================================================== --- head/contrib/compiler-rt/lib/floatuntixf.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/floatuntixf.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: convert a to a long double, rounding toward even. */ Modified: head/contrib/compiler-rt/lib/int_types.h ============================================================================== --- head/contrib/compiler-rt/lib/int_types.h Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/int_types.h Fri Feb 28 18:06:00 2014 (r262613) @@ -56,8 +56,11 @@ typedef union }s; } udwords; -#if __x86_64 +#if __LP64__ +#define CRT_HAS_128BIT +#endif +#ifdef CRT_HAS_128BIT typedef int ti_int __attribute__ ((mode (TI))); typedef unsigned tu_int __attribute__ ((mode (TI))); @@ -105,7 +108,7 @@ static inline tu_int make_tu(du_int h, d return r.all; } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ typedef union { Modified: head/contrib/compiler-rt/lib/lshrti3.c ============================================================================== --- head/contrib/compiler-rt/lib/lshrti3.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/lshrti3.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: logical a >> b */ @@ -42,4 +42,4 @@ __lshrti3(ti_int a, si_int b) return result.all; } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/modti3.c ============================================================================== --- head/contrib/compiler-rt/lib/modti3.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/modti3.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem); @@ -33,4 +33,4 @@ __modti3(ti_int a, ti_int b) return (r ^ s) - s; /* negate if s == -1 */ } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/muloti4.c ============================================================================== --- head/contrib/compiler-rt/lib/muloti4.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/muloti4.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: a * b */ @@ -59,4 +59,4 @@ __muloti4(ti_int a, ti_int b, int* overf return result; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/multi3.c ============================================================================== --- head/contrib/compiler-rt/lib/multi3.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/multi3.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: a * b */ @@ -55,4 +55,4 @@ __multi3(ti_int a, ti_int b) return r.all; } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/mulvti3.c ============================================================================== --- head/contrib/compiler-rt/lib/mulvti3.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/mulvti3.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: a * b */ @@ -57,4 +57,4 @@ __mulvti3(ti_int a, ti_int b) return a * b; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/negti2.c ============================================================================== --- head/contrib/compiler-rt/lib/negti2.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/negti2.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: -a */ @@ -27,4 +27,4 @@ __negti2(ti_int a) return -a; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/negvti2.c ============================================================================== --- head/contrib/compiler-rt/lib/negvti2.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/negvti2.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: -a */ @@ -29,4 +29,4 @@ __negvti2(ti_int a) return -a; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/parityti2.c ============================================================================== --- head/contrib/compiler-rt/lib/parityti2.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/parityti2.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: 1 if number of bits is odd else returns 0 */ @@ -28,4 +28,4 @@ __parityti2(ti_int a) return __paritydi2(x.s.high ^ x.s.low); } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/popcountti2.c ============================================================================== --- head/contrib/compiler-rt/lib/popcountti2.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/popcountti2.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: count of 1 bits */ @@ -41,4 +41,4 @@ __popcountti2(ti_int a) return (x + (x >> 8)) & 0xFF; /* (8 significant bits) */ } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/subvti3.c ============================================================================== --- head/contrib/compiler-rt/lib/subvti3.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/subvti3.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: a - b */ @@ -37,4 +37,4 @@ __subvti3(ti_int a, ti_int b) return s; } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/ucmpti2.c ============================================================================== --- head/contrib/compiler-rt/lib/ucmpti2.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/ucmpti2.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Returns: if (a < b) returns 0 * if (a == b) returns 1 @@ -39,4 +39,4 @@ __ucmpti2(tu_int a, tu_int b) return 1; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/udivmodti4.c ============================================================================== --- head/contrib/compiler-rt/lib/udivmodti4.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/udivmodti4.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT /* Effects: if rem != 0, *rem = a % b * Returns: a / b @@ -253,4 +253,4 @@ __udivmodti4(tu_int a, tu_int b, tu_int* return q.all; } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/udivti3.c ============================================================================== --- head/contrib/compiler-rt/lib/udivti3.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/udivti3.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem); @@ -26,4 +26,4 @@ __udivti3(tu_int a, tu_int b) return __udivmodti4(a, b, 0); } -#endif /* __x86_64 */ +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/compiler-rt/lib/umodti3.c ============================================================================== --- head/contrib/compiler-rt/lib/umodti3.c Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/compiler-rt/lib/umodti3.c Fri Feb 28 18:06:00 2014 (r262613) @@ -14,7 +14,7 @@ #include "int_lib.h" -#if __x86_64 +#ifdef CRT_HAS_128BIT tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem); @@ -28,4 +28,4 @@ __umodti3(tu_int a, tu_int b) return r; } -#endif +#endif /* CRT_HAS_128BIT */ Modified: head/contrib/gcc/longlong.h ============================================================================== --- head/contrib/gcc/longlong.h Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/gcc/longlong.h Fri Feb 28 18:06:00 2014 (r262613) @@ -1086,8 +1086,8 @@ UDItype __umulsidi3 (USItype, USItype); "bcs,a,pn %%xcc, 1f\n\t" \ "add %0, 1, %0\n" \ "1:" \ - : "=r" ((UDItype)(sh)), \ - "=&r" ((UDItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "%rJ" ((UDItype)(ah)), \ "rI" ((UDItype)(bh)), \ "%rJ" ((UDItype)(al)), \ @@ -1100,8 +1100,8 @@ UDItype __umulsidi3 (USItype, USItype); "bcs,a,pn %%xcc, 1f\n\t" \ "sub %0, 1, %0\n\t" \ "1:" \ - : "=r" ((UDItype)(sh)), \ - "=&r" ((UDItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "rJ" ((UDItype)(ah)), \ "rI" ((UDItype)(bh)), \ "rJ" ((UDItype)(al)), \ @@ -1133,8 +1133,8 @@ UDItype __umulsidi3 (USItype, USItype); "sllx %3,32,%3\n\t" \ "add %1,%3,%1\n\t" \ "add %5,%2,%0" \ - : "=r" ((UDItype)(wh)), \ - "=&r" ((UDItype)(wl)), \ + : "=r" (wh), \ + "=&r" (wl), \ "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) \ : "r" ((UDItype)(u)), \ "r" ((UDItype)(v)) \ Modified: head/contrib/llvm/include/llvm/MC/MCAsmInfo.h ============================================================================== --- head/contrib/llvm/include/llvm/MC/MCAsmInfo.h Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/llvm/include/llvm/MC/MCAsmInfo.h Fri Feb 28 18:06:00 2014 (r262613) @@ -371,7 +371,7 @@ namespace llvm { unsigned Encoding, MCStreamer &Streamer) const; - const MCExpr * + virtual const MCExpr * getExprForFDESymbol(const MCSymbol *Sym, unsigned Encoding, MCStreamer &Streamer) const; Modified: head/contrib/llvm/include/llvm/Object/ELFObjectFile.h ============================================================================== --- head/contrib/llvm/include/llvm/Object/ELFObjectFile.h Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/llvm/include/llvm/Object/ELFObjectFile.h Fri Feb 28 18:06:00 2014 (r262613) @@ -922,6 +922,9 @@ StringRef ELFObjectFile::getFileFo return "ELF32-mips"; case ELF::EM_PPC: return "ELF32-ppc"; + case ELF::EM_SPARC: + case ELF::EM_SPARC32PLUS: + return "ELF32-sparc"; default: return "ELF32-unknown"; } @@ -937,6 +940,8 @@ StringRef ELFObjectFile::getFileFo return "ELF64-ppc64"; case ELF::EM_S390: return "ELF64-s390"; + case ELF::EM_SPARCV9: + return "ELF64-sparc"; default: return "ELF64-unknown"; } @@ -967,6 +972,13 @@ unsigned ELFObjectFile::getArch() : Triple::ppc64; case ELF::EM_S390: return Triple::systemz; + + case ELF::EM_SPARC: + case ELF::EM_SPARC32PLUS: + return Triple::sparc; + case ELF::EM_SPARCV9: + return Triple::sparcv9; + default: return Triple::UnknownArch; } Modified: head/contrib/llvm/include/llvm/Support/ELF.h ============================================================================== --- head/contrib/llvm/include/llvm/Support/ELF.h Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/llvm/include/llvm/Support/ELF.h Fri Feb 28 18:06:00 2014 (r262613) @@ -1087,6 +1087,94 @@ enum { R_390_IRELATIVE = 61 }; +// ELF Relocation type for Sparc. +enum { + R_SPARC_NONE = 0, + R_SPARC_8 = 1, + R_SPARC_16 = 2, + R_SPARC_32 = 3, + R_SPARC_DISP8 = 4, + R_SPARC_DISP16 = 5, + R_SPARC_DISP32 = 6, + R_SPARC_WDISP30 = 7, + R_SPARC_WDISP22 = 8, + R_SPARC_HI22 = 9, + R_SPARC_22 = 10, + R_SPARC_13 = 11, + R_SPARC_LO10 = 12, + R_SPARC_GOT10 = 13, + R_SPARC_GOT13 = 14, + R_SPARC_GOT22 = 15, + R_SPARC_PC10 = 16, + R_SPARC_PC22 = 17, + R_SPARC_WPLT30 = 18, + R_SPARC_COPY = 19, + R_SPARC_GLOB_DAT = 20, + R_SPARC_JMP_SLOT = 21, + R_SPARC_RELATIVE = 22, + R_SPARC_UA32 = 23, + R_SPARC_PLT32 = 24, + R_SPARC_HIPLT22 = 25, + R_SPARC_LOPLT10 = 26, + R_SPARC_PCPLT32 = 27, + R_SPARC_PCPLT22 = 28, + R_SPARC_PCPLT10 = 29, + R_SPARC_10 = 30, + R_SPARC_11 = 31, + R_SPARC_64 = 32, + R_SPARC_OLO10 = 33, + R_SPARC_HH22 = 34, + R_SPARC_HM10 = 35, + R_SPARC_LM22 = 36, + R_SPARC_PC_HH22 = 37, + R_SPARC_PC_HM10 = 38, + R_SPARC_PC_LM22 = 39, + R_SPARC_WDISP16 = 40, + R_SPARC_WDISP19 = 41, + R_SPARC_7 = 43, + R_SPARC_5 = 44, + R_SPARC_6 = 45, + R_SPARC_DISP64 = 46, + R_SPARC_PLT64 = 47, + R_SPARC_HIX22 = 48, + R_SPARC_LOX10 = 49, + R_SPARC_H44 = 50, + R_SPARC_M44 = 51, + R_SPARC_L44 = 52, + R_SPARC_REGISTER = 53, + R_SPARC_UA64 = 54, + R_SPARC_UA16 = 55, + R_SPARC_TLS_GD_HI22 = 56, + R_SPARC_TLS_GD_LO10 = 57, + R_SPARC_TLS_GD_ADD = 58, + R_SPARC_TLS_GD_CALL = 59, + R_SPARC_TLS_LDM_HI22 = 60, + R_SPARC_TLS_LDM_LO10 = 61, + R_SPARC_TLS_LDM_ADD = 62, + R_SPARC_TLS_LDM_CALL = 63, + R_SPARC_TLS_LDO_HIX22 = 64, + R_SPARC_TLS_LDO_LOX10 = 65, + R_SPARC_TLS_LDO_ADD = 66, + R_SPARC_TLS_IE_HI22 = 67, + R_SPARC_TLS_IE_LO10 = 68, + R_SPARC_TLS_IE_LD = 69, + R_SPARC_TLS_IE_LDX = 70, + R_SPARC_TLS_IE_ADD = 71, + R_SPARC_TLS_LE_HIX22 = 72, + R_SPARC_TLS_LE_LOX10 = 73, + R_SPARC_TLS_DTPMOD32 = 74, + R_SPARC_TLS_DTPMOD64 = 75, + R_SPARC_TLS_DTPOFF32 = 76, + R_SPARC_TLS_DTPOFF64 = 77, + R_SPARC_TLS_TPOFF32 = 78, + R_SPARC_TLS_TPOFF64 = 79, + R_SPARC_GOTDATA_HIX22 = 80, + R_SPARC_GOTDATA_LOX22 = 81, + R_SPARC_GOTDATA_OP_HIX22 = 82, + R_SPARC_GOTDATA_OP_LOX22 = 83, + R_SPARC_GOTDATA_OP = 84 +}; + // Section header. struct Elf32_Shdr { Elf32_Word sh_name; // Section name (index into string table) Modified: head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Fri Feb 28 18:06:00 2014 (r262613) @@ -23,6 +23,7 @@ #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineInstrBundle.h" #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineLoopInfo.h" #include "llvm/CodeGen/MachineModuleInfo.h" @@ -2221,14 +2222,13 @@ isBlockOnlyReachableByFallthrough(const if (!MI.isBranch() || MI.isIndirectBranch()) return false; - // If we are the operands of one of the branches, this is not - // a fall through. - for (MachineInstr::mop_iterator OI = MI.operands_begin(), - OE = MI.operands_end(); OI != OE; ++OI) { - const MachineOperand& OP = *OI; - if (OP.isJTI()) + // If we are the operands of one of the branches, this is not a fall + // through. Note that targets with delay slots will usually bundle + // terminators with the delay slot instruction. + for (ConstMIBundleOperands OP(&MI); OP.isValid(); ++OP) { + if (OP->isJTI()) return false; - if (OP.isMBB() && OP.getMBB() == MBB) + if (OP->isMBB() && OP->getMBB() == MBB) return false; } } Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Fri Feb 28 18:06:00 2014 (r262613) @@ -220,10 +220,19 @@ void InstrEmitter::CreateVirtualRegister unsigned VRBase = 0; const TargetRegisterClass *RC = TRI->getAllocatableClass(TII->getRegClass(II, i, TRI, *MF)); - // If the register class is unknown for the given definition, then try to - // infer one from the value type. - if (!RC && i < NumResults) - RC = TLI->getRegClassFor(Node->getSimpleValueType(i)); + // Always let the value type influence the used register class. The + // constraints on the instruction may be too lax to represent the value + // type correctly. For example, a 64-bit float (X86::FR64) can't live in + // the 32-bit float super-class (X86::FR32). + if (i < NumResults && TLI->isTypeLegal(Node->getSimpleValueType(i))) { + const TargetRegisterClass *VTRC = + TLI->getRegClassFor(Node->getSimpleValueType(i)); + if (RC) + VTRC = TRI->getCommonSubClass(RC, VTRC); + if (VTRC) + RC = VTRC; + } + if (II.OpInfo[i].isOptionalDef()) { // Optional def must be a physical register. unsigned NumResults = CountResults(Node); Modified: head/contrib/llvm/lib/MC/MCObjectFileInfo.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCObjectFileInfo.cpp Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/llvm/lib/MC/MCObjectFileInfo.cpp Fri Feb 28 18:06:00 2014 (r262613) @@ -310,6 +310,33 @@ void MCObjectFileInfo::InitELFMCObjectFi FDEEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_udata8; TTypeEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_udata8; + } else if (T.getArch() == Triple::sparc) { + if (RelocM == Reloc::PIC_) { + LSDAEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4; + PersonalityEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | + dwarf::DW_EH_PE_sdata4; + FDEEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4; + TTypeEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | + dwarf::DW_EH_PE_sdata4; + } else { + LSDAEncoding = dwarf::DW_EH_PE_absptr; + PersonalityEncoding = dwarf::DW_EH_PE_absptr; + FDEEncoding = dwarf::DW_EH_PE_udata4; + TTypeEncoding = dwarf::DW_EH_PE_absptr; + } + } else if (T.getArch() == Triple::sparcv9) { + LSDAEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4; + if (RelocM == Reloc::PIC_) { + PersonalityEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | + dwarf::DW_EH_PE_sdata4; + FDEEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4; + TTypeEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | + dwarf::DW_EH_PE_sdata4; + } else { + PersonalityEncoding = dwarf::DW_EH_PE_absptr; + FDEEncoding = dwarf::DW_EH_PE_udata4; + TTypeEncoding = dwarf::DW_EH_PE_absptr; + } } else if (T.getArch() == Triple::systemz) { // All currently-defined code models guarantee that 4-byte PC-relative // values will be in range. Modified: head/contrib/llvm/lib/Object/ELF.cpp ============================================================================== --- head/contrib/llvm/lib/Object/ELF.cpp Fri Feb 28 17:46:56 2014 (r262612) +++ head/contrib/llvm/lib/Object/ELF.cpp Fri Feb 28 18:06:00 2014 (r262613) @@ -702,6 +702,98 @@ StringRef getELFRelocationTypeName(uint3 break; } break; + case ELF::EM_SPARC: + case ELF::EM_SPARC32PLUS: + case ELF::EM_SPARCV9: + switch (Type) { + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_NONE); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_8); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_16); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_32); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_DISP8); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_DISP16); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_DISP32); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_WDISP30); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_WDISP22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_HI22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_13); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_LO10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_GOT10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_GOT13); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_GOT22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PC10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PC22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_WPLT30); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_COPY); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_GLOB_DAT); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_JMP_SLOT); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_RELATIVE); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_UA32); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PLT32); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_HIPLT22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_LOPLT10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PCPLT32); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PCPLT22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PCPLT10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_11); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_64); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_OLO10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_HH22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_HM10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_LM22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PC_HH22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PC_HM10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PC_LM22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_WDISP16); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_WDISP19); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_7); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_5); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_6); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_DISP64); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_PLT64); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_HIX22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_LOX10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_H44); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_M44); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_L44); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_REGISTER); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_UA64); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_UA16); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_GD_HI22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_GD_LO10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_GD_ADD); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_GD_CALL); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_LDM_HI22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_LDM_LO10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_LDM_ADD); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_LDM_CALL); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_LDO_HIX22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_LDO_LOX10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_LDO_ADD); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_IE_HI22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_IE_LO10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_IE_LD); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_IE_LDX); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_IE_ADD); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_LE_HIX22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_LE_LOX10); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_DTPMOD32); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_DTPMOD64); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_DTPOFF32); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_DTPOFF64); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_TPOFF32); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_TLS_TPOFF64); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_GOTDATA_HIX22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_GOTDATA_LOX22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_GOTDATA_OP_HIX22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_GOTDATA_OP_LOX22); + LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_SPARC_GOTDATA_OP); + default: + break; + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 18:29:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 942C1D60; Fri, 28 Feb 2014 18:29:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7C79C1835; Fri, 28 Feb 2014 18:29:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SITMoL019172; Fri, 28 Feb 2014 18:29:22 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SITAQk019090; Fri, 28 Feb 2014 18:29:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402281829.s1SITAQk019090@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Feb 2014 18:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262614 - in head: . share/mk sys/boot/fdt/dts sys/boot/fdt/dts/arm sys/boot/fdt/dts/mips sys/boot/fdt/dts/powerpc sys/conf sys/tools/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 18:29:22 -0000 Author: imp Date: Fri Feb 28 18:29:09 2014 New Revision: 262614 URL: http://svnweb.freebsd.org/changeset/base/262614 Log: Integrate device-tree upstream files into the build process: (1) Invoke cpp to bring in files via #include (although the old /include/ stuff is supported still). (2) bring in files from either vendor tree or freebsd-custom files when building. (3) move all dts* files from sys/boot/fdt/dts to sys/boot/fdt/dts/${MACHINE} as appropriate. (4) encode all the magic to do the build in sys/tools/fdt/make_dtb.sh so that the different places in the tree use the exact same logic. (5) switch back to gpl dtc by default. the bsdl one in the tree has significant issues not easily addressed by those unfamiliar with the code. Added: head/sys/boot/fdt/dts/arm/ head/sys/boot/fdt/dts/arm/am335x-evm.dts - copied, changed from r262613, head/sys/boot/fdt/dts/am335x-evm.dts head/sys/boot/fdt/dts/arm/am335x.dtsi - copied, changed from r262613, head/sys/boot/fdt/dts/am335x.dtsi head/sys/boot/fdt/dts/arm/bcm2835.dtsi - copied, changed from r262613, head/sys/boot/fdt/dts/bcm2835.dtsi head/sys/boot/fdt/dts/arm/beaglebone-black.dts - copied, changed from r262613, head/sys/boot/fdt/dts/beaglebone-black.dts head/sys/boot/fdt/dts/arm/beaglebone.dts - copied, changed from r262613, head/sys/boot/fdt/dts/beaglebone.dts head/sys/boot/fdt/dts/arm/cubieboard.dts - copied, changed from r262613, head/sys/boot/fdt/dts/cubieboard.dts head/sys/boot/fdt/dts/arm/cubieboard2.dts - copied, changed from r262613, head/sys/boot/fdt/dts/cubieboard2.dts head/sys/boot/fdt/dts/arm/db78100.dts - copied, changed from r262613, head/sys/boot/fdt/dts/db78100.dts head/sys/boot/fdt/dts/arm/db78460.dts - copied, changed from r262613, head/sys/boot/fdt/dts/db78460.dts head/sys/boot/fdt/dts/arm/db88f5182.dts - copied, changed from r262613, head/sys/boot/fdt/dts/db88f5182.dts head/sys/boot/fdt/dts/arm/db88f5281.dts - copied, changed from r262613, head/sys/boot/fdt/dts/db88f5281.dts head/sys/boot/fdt/dts/arm/db88f6281.dts - copied, changed from r262613, head/sys/boot/fdt/dts/db88f6281.dts head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts - copied, changed from r262613, head/sys/boot/fdt/dts/digi-ccwmx53.dts head/sys/boot/fdt/dts/arm/dockstar.dts - copied, changed from r262613, head/sys/boot/fdt/dts/dockstar.dts head/sys/boot/fdt/dts/arm/dreamplug-1001.dts - copied, changed from r262613, head/sys/boot/fdt/dts/dreamplug-1001.dts head/sys/boot/fdt/dts/arm/dreamplug-1001N.dts - copied, changed from r262613, head/sys/boot/fdt/dts/dreamplug-1001N.dts head/sys/boot/fdt/dts/arm/ea3250.dts - copied, changed from r262613, head/sys/boot/fdt/dts/ea3250.dts head/sys/boot/fdt/dts/arm/efikamx.dts - copied, changed from r262613, head/sys/boot/fdt/dts/efikamx.dts head/sys/boot/fdt/dts/arm/exynos5250-arndale.dts - copied, changed from r262613, head/sys/boot/fdt/dts/exynos5250-arndale.dts head/sys/boot/fdt/dts/arm/exynos5250.dtsi - copied, changed from r262613, head/sys/boot/fdt/dts/exynos5250.dtsi head/sys/boot/fdt/dts/arm/imx51x.dtsi - copied, changed from r262613, head/sys/boot/fdt/dts/imx51x.dtsi head/sys/boot/fdt/dts/arm/imx53-qsb.dts - copied, changed from r262613, head/sys/boot/fdt/dts/imx53-qsb.dts head/sys/boot/fdt/dts/arm/imx53x.dtsi - copied, changed from r262613, head/sys/boot/fdt/dts/imx53x.dtsi head/sys/boot/fdt/dts/arm/imx6.dtsi - copied, changed from r262613, head/sys/boot/fdt/dts/imx6.dtsi head/sys/boot/fdt/dts/arm/p1020rdb.dts - copied, changed from r262613, head/sys/boot/fdt/dts/p1020rdb.dts head/sys/boot/fdt/dts/arm/p2020ds.dts - copied, changed from r262613, head/sys/boot/fdt/dts/p2020ds.dts head/sys/boot/fdt/dts/arm/p2041rdb.dts - copied, changed from r262613, head/sys/boot/fdt/dts/p2041rdb.dts head/sys/boot/fdt/dts/arm/p2041si.dtsi - copied, changed from r262613, head/sys/boot/fdt/dts/p2041si.dtsi head/sys/boot/fdt/dts/arm/p3041ds.dts - copied, changed from r262613, head/sys/boot/fdt/dts/p3041ds.dts head/sys/boot/fdt/dts/arm/p3041si.dtsi - copied, changed from r262613, head/sys/boot/fdt/dts/p3041si.dtsi head/sys/boot/fdt/dts/arm/p5020ds.dts - copied, changed from r262613, head/sys/boot/fdt/dts/p5020ds.dts head/sys/boot/fdt/dts/arm/p5020si.dtsi - copied, changed from r262613, head/sys/boot/fdt/dts/p5020si.dtsi head/sys/boot/fdt/dts/arm/pandaboard.dts - copied, changed from r262613, head/sys/boot/fdt/dts/pandaboard.dts head/sys/boot/fdt/dts/arm/rk3188-radxa.dts - copied, changed from r262613, head/sys/boot/fdt/dts/rk3188-radxa.dts head/sys/boot/fdt/dts/arm/rk3188.dtsi - copied, changed from r262613, head/sys/boot/fdt/dts/rk3188.dtsi head/sys/boot/fdt/dts/arm/rpi.dts - copied, changed from r262613, head/sys/boot/fdt/dts/rpi.dts head/sys/boot/fdt/dts/arm/sheevaplug.dts - copied, changed from r262613, head/sys/boot/fdt/dts/sheevaplug.dts head/sys/boot/fdt/dts/arm/tegra20-paz00.dts - copied, changed from r262613, head/sys/boot/fdt/dts/tegra20-paz00.dts head/sys/boot/fdt/dts/arm/tegra20.dtsi - copied, changed from r262613, head/sys/boot/fdt/dts/tegra20.dtsi head/sys/boot/fdt/dts/arm/trimslice.dts - copied, changed from r262613, head/sys/boot/fdt/dts/trimslice.dts head/sys/boot/fdt/dts/arm/ts7800.dts - copied, changed from r262613, head/sys/boot/fdt/dts/ts7800.dts head/sys/boot/fdt/dts/arm/versatilepb.dts - copied, changed from r262613, head/sys/boot/fdt/dts/versatilepb.dts head/sys/boot/fdt/dts/arm/vybrid-colibri-vf50.dts - copied, changed from r262613, head/sys/boot/fdt/dts/vybrid-colibri-vf50.dts head/sys/boot/fdt/dts/arm/vybrid-cosmic.dts - copied, changed from r262613, head/sys/boot/fdt/dts/vybrid-cosmic.dts head/sys/boot/fdt/dts/arm/vybrid-quartz.dts - copied, changed from r262613, head/sys/boot/fdt/dts/vybrid-quartz.dts head/sys/boot/fdt/dts/arm/vybrid.dtsi - copied, changed from r262613, head/sys/boot/fdt/dts/vybrid.dtsi head/sys/boot/fdt/dts/arm/wandboard-dual.dts - copied, changed from r262613, head/sys/boot/fdt/dts/wandboard-dual.dts head/sys/boot/fdt/dts/arm/wandboard-quad.dts - copied, changed from r262613, head/sys/boot/fdt/dts/wandboard-quad.dts head/sys/boot/fdt/dts/arm/wandboard-solo.dts - copied, changed from r262613, head/sys/boot/fdt/dts/wandboard-solo.dts head/sys/boot/fdt/dts/arm/zedboard.dts - copied, changed from r262613, head/sys/boot/fdt/dts/zedboard.dts head/sys/boot/fdt/dts/mips/ head/sys/boot/fdt/dts/mips/beri-netfpga.dts - copied, changed from r262613, head/sys/boot/fdt/dts/beri-netfpga.dts head/sys/boot/fdt/dts/mips/beri-sim.dts - copied, changed from r262613, head/sys/boot/fdt/dts/beri-sim.dts head/sys/boot/fdt/dts/mips/beripad-de4.dts - copied, changed from r262613, head/sys/boot/fdt/dts/beripad-de4.dts head/sys/boot/fdt/dts/mips/xlp-basic.dts - copied, changed from r262613, head/sys/boot/fdt/dts/xlp-basic.dts head/sys/boot/fdt/dts/powerpc/ head/sys/boot/fdt/dts/powerpc/mpc8555cds.dts - copied, changed from r262613, head/sys/boot/fdt/dts/mpc8555cds.dts head/sys/boot/fdt/dts/powerpc/mpc8572ds.dts - copied, changed from r262613, head/sys/boot/fdt/dts/mpc8572ds.dts head/sys/tools/fdt/make_dtb.sh (contents, props changed) Deleted: head/sys/boot/fdt/dts/am335x-evm.dts head/sys/boot/fdt/dts/am335x.dtsi head/sys/boot/fdt/dts/bcm2835.dtsi head/sys/boot/fdt/dts/beaglebone-black.dts head/sys/boot/fdt/dts/beaglebone.dts head/sys/boot/fdt/dts/beri-netfpga.dts head/sys/boot/fdt/dts/beri-sim.dts head/sys/boot/fdt/dts/beripad-de4.dts head/sys/boot/fdt/dts/cubieboard.dts head/sys/boot/fdt/dts/cubieboard2.dts head/sys/boot/fdt/dts/db78100.dts head/sys/boot/fdt/dts/db78460.dts head/sys/boot/fdt/dts/db88f5182.dts head/sys/boot/fdt/dts/db88f5281.dts head/sys/boot/fdt/dts/db88f6281.dts head/sys/boot/fdt/dts/digi-ccwmx53.dts head/sys/boot/fdt/dts/dockstar.dts head/sys/boot/fdt/dts/dreamplug-1001.dts head/sys/boot/fdt/dts/dreamplug-1001N.dts head/sys/boot/fdt/dts/ea3250.dts head/sys/boot/fdt/dts/efikamx.dts head/sys/boot/fdt/dts/exynos5250-arndale.dts head/sys/boot/fdt/dts/exynos5250.dtsi head/sys/boot/fdt/dts/imx51x.dtsi head/sys/boot/fdt/dts/imx53-qsb.dts head/sys/boot/fdt/dts/imx53x.dtsi head/sys/boot/fdt/dts/imx6.dtsi head/sys/boot/fdt/dts/mpc8555cds.dts head/sys/boot/fdt/dts/mpc8572ds.dts head/sys/boot/fdt/dts/p1020rdb.dts head/sys/boot/fdt/dts/p2020ds.dts head/sys/boot/fdt/dts/p2041rdb.dts head/sys/boot/fdt/dts/p2041si.dtsi head/sys/boot/fdt/dts/p3041ds.dts head/sys/boot/fdt/dts/p3041si.dtsi head/sys/boot/fdt/dts/p5020ds.dts head/sys/boot/fdt/dts/p5020si.dtsi head/sys/boot/fdt/dts/pandaboard.dts head/sys/boot/fdt/dts/rk3188-radxa.dts head/sys/boot/fdt/dts/rk3188.dtsi head/sys/boot/fdt/dts/rpi.dts head/sys/boot/fdt/dts/sheevaplug.dts head/sys/boot/fdt/dts/tegra20-paz00.dts head/sys/boot/fdt/dts/tegra20.dtsi head/sys/boot/fdt/dts/trimslice.dts head/sys/boot/fdt/dts/ts7800.dts head/sys/boot/fdt/dts/versatilepb.dts head/sys/boot/fdt/dts/vybrid-colibri-vf50.dts head/sys/boot/fdt/dts/vybrid-cosmic.dts head/sys/boot/fdt/dts/vybrid-quartz.dts head/sys/boot/fdt/dts/vybrid.dtsi head/sys/boot/fdt/dts/wandboard-dual.dts head/sys/boot/fdt/dts/wandboard-quad.dts head/sys/boot/fdt/dts/wandboard-solo.dts head/sys/boot/fdt/dts/xlp-basic.dts head/sys/boot/fdt/dts/zedboard.dts Modified: head/Makefile.inc1 head/share/mk/bsd.own.mk head/sys/conf/files Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Feb 28 18:06:00 2014 (r262613) +++ head/Makefile.inc1 Fri Feb 28 18:29:09 2014 (r262614) @@ -1262,7 +1262,7 @@ _dtrace_tools= cddl/usr.bin/sgsmsg cddl/ lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge .endif -# Default to building the BSDL DTC, but build the GPL one if users explicitly +# Default to building the GPL DTC, but build the BSDL one if users explicitly # request it. _dtc= usr.bin/dtc .if ${MK_GPL_DTC} != "no" @@ -1853,7 +1853,7 @@ builddtb: echo "ERROR: FDT_DTS_FILE must be specified!"; \ exit 1; \ fi; \ - if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} ]; then \ + if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${MACHINE}/${FDT_DTS_FILE} ]; then \ echo "ERROR: Specified DTS file (${FDT_DTS_FILE}) does not \ exist!"; \ exit 1; \ @@ -1863,9 +1863,9 @@ builddtb: directory"; \ fi @PATH=${TMPPATH} \ - dtc -O dtb -o \ - ${DTBOUTPUTPATH}/`echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb -b 0 \ - -p 1024 ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} + ${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \ + ${FDT_DTS_FILE} \ + ${DTBOUTPUTPATH}/`basename ${FDT_DTS_FILE} .dts` ############### Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Fri Feb 28 18:06:00 2014 (r262613) +++ head/share/mk/bsd.own.mk Fri Feb 28 18:29:09 2014 (r262614) @@ -287,6 +287,7 @@ __DEFAULT_YES_OPTIONS = \ GNU \ GPIB \ GPIO \ + GPL_DTC \ GROFF \ HTML \ ICONV \ @@ -368,7 +369,6 @@ __DEFAULT_NO_OPTIONS = \ CLANG_EXTRAS \ CTF \ DEBUG_FILES \ - GPL_DTC \ HESIOD \ INSTALL_AS_USER \ LLDB \ Copied and modified: head/sys/boot/fdt/dts/arm/am335x-evm.dts (from r262613, head/sys/boot/fdt/dts/am335x-evm.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/am335x.dtsi (from r262613, head/sys/boot/fdt/dts/am335x.dtsi) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/bcm2835.dtsi (from r262613, head/sys/boot/fdt/dts/bcm2835.dtsi) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/beaglebone-black.dts (from r262613, head/sys/boot/fdt/dts/beaglebone-black.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/beaglebone.dts (from r262613, head/sys/boot/fdt/dts/beaglebone.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/cubieboard.dts (from r262613, head/sys/boot/fdt/dts/cubieboard.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/cubieboard2.dts (from r262613, head/sys/boot/fdt/dts/cubieboard2.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/db78100.dts (from r262613, head/sys/boot/fdt/dts/db78100.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/db78460.dts (from r262613, head/sys/boot/fdt/dts/db78460.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/db88f5182.dts (from r262613, head/sys/boot/fdt/dts/db88f5182.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/db88f5281.dts (from r262613, head/sys/boot/fdt/dts/db88f5281.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/db88f6281.dts (from r262613, head/sys/boot/fdt/dts/db88f6281.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts (from r262613, head/sys/boot/fdt/dts/digi-ccwmx53.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/dockstar.dts (from r262613, head/sys/boot/fdt/dts/dockstar.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/dreamplug-1001.dts (from r262613, head/sys/boot/fdt/dts/dreamplug-1001.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/dreamplug-1001N.dts (from r262613, head/sys/boot/fdt/dts/dreamplug-1001N.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/ea3250.dts (from r262613, head/sys/boot/fdt/dts/ea3250.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/efikamx.dts (from r262613, head/sys/boot/fdt/dts/efikamx.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/exynos5250-arndale.dts (from r262613, head/sys/boot/fdt/dts/exynos5250-arndale.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/exynos5250.dtsi (from r262613, head/sys/boot/fdt/dts/exynos5250.dtsi) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/imx51x.dtsi (from r262613, head/sys/boot/fdt/dts/imx51x.dtsi) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/imx53-qsb.dts (from r262613, head/sys/boot/fdt/dts/imx53-qsb.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/imx53x.dtsi (from r262613, head/sys/boot/fdt/dts/imx53x.dtsi) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/imx6.dtsi (from r262613, head/sys/boot/fdt/dts/imx6.dtsi) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/p1020rdb.dts (from r262613, head/sys/boot/fdt/dts/p1020rdb.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/p2020ds.dts (from r262613, head/sys/boot/fdt/dts/p2020ds.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/p2041rdb.dts (from r262613, head/sys/boot/fdt/dts/p2041rdb.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/p2041si.dtsi (from r262613, head/sys/boot/fdt/dts/p2041si.dtsi) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/p3041ds.dts (from r262613, head/sys/boot/fdt/dts/p3041ds.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/p3041si.dtsi (from r262613, head/sys/boot/fdt/dts/p3041si.dtsi) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/p5020ds.dts (from r262613, head/sys/boot/fdt/dts/p5020ds.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/p5020si.dtsi (from r262613, head/sys/boot/fdt/dts/p5020si.dtsi) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/pandaboard.dts (from r262613, head/sys/boot/fdt/dts/pandaboard.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/rk3188-radxa.dts (from r262613, head/sys/boot/fdt/dts/rk3188-radxa.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/rk3188.dtsi (from r262613, head/sys/boot/fdt/dts/rk3188.dtsi) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/rpi.dts (from r262613, head/sys/boot/fdt/dts/rpi.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/sheevaplug.dts (from r262613, head/sys/boot/fdt/dts/sheevaplug.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/tegra20-paz00.dts (from r262613, head/sys/boot/fdt/dts/tegra20-paz00.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/tegra20.dtsi (from r262613, head/sys/boot/fdt/dts/tegra20.dtsi) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/trimslice.dts (from r262613, head/sys/boot/fdt/dts/trimslice.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/ts7800.dts (from r262613, head/sys/boot/fdt/dts/ts7800.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/versatilepb.dts (from r262613, head/sys/boot/fdt/dts/versatilepb.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/vybrid-colibri-vf50.dts (from r262613, head/sys/boot/fdt/dts/vybrid-colibri-vf50.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/vybrid-cosmic.dts (from r262613, head/sys/boot/fdt/dts/vybrid-cosmic.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/vybrid-quartz.dts (from r262613, head/sys/boot/fdt/dts/vybrid-quartz.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/vybrid.dtsi (from r262613, head/sys/boot/fdt/dts/vybrid.dtsi) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/wandboard-dual.dts (from r262613, head/sys/boot/fdt/dts/wandboard-dual.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/wandboard-quad.dts (from r262613, head/sys/boot/fdt/dts/wandboard-quad.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/wandboard-solo.dts (from r262613, head/sys/boot/fdt/dts/wandboard-solo.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/arm/zedboard.dts (from r262613, head/sys/boot/fdt/dts/zedboard.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/mips/beri-netfpga.dts (from r262613, head/sys/boot/fdt/dts/beri-netfpga.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/mips/beri-sim.dts (from r262613, head/sys/boot/fdt/dts/beri-sim.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/mips/beripad-de4.dts (from r262613, head/sys/boot/fdt/dts/beripad-de4.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/mips/xlp-basic.dts (from r262613, head/sys/boot/fdt/dts/xlp-basic.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/powerpc/mpc8555cds.dts (from r262613, head/sys/boot/fdt/dts/mpc8555cds.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/powerpc/mpc8572ds.dts (from r262613, head/sys/boot/fdt/dts/mpc8572ds.dts) ============================================================================== Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Feb 28 18:06:00 2014 (r262613) +++ head/sys/conf/files Fri Feb 28 18:29:09 2014 (r262614) @@ -14,11 +14,12 @@ acpi_quirks.h optional acpi \ # from the specified source (DTS) file: .dts -> .dtb # fdt_dtb_file optional fdt \ - compile-with "if [ -f $S/boot/fdt/dts/${FDT_DTS_FILE} ]; then dtc -O dtb -o ${FDT_DTS_FILE:R}.dtb -b 0 -p 1024 $S/boot/fdt/dts/${FDT_DTS_FILE}; fi" \ + compile-with "sh $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} ${.CURDIR}/${FDT_DTS_FILE:R}.dtb" \ no-obj no-implicit-rule before-depend \ clean "${FDT_DTS_FILE:R}.dtb" fdt_static_dtb.h optional fdt fdt_dtb_static \ - compile-with "sh $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ." \ + compile-with "sh $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ${.CURDIR}" \ + dependency "fdt_dtb_file" \ no-obj no-implicit-rule before-depend \ clean "fdt_static_dtb.h" feeder_eq_gen.h optional sound \ @@ -1370,7 +1371,7 @@ dev/fb/splash.c optional sc splash dev/fdt/fdt_common.c optional fdt dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ - dependency "$S/boot/fdt/dts/${FDT_DTS_FILE}" + dependency "$S/boot/fdt/dts/${MACHINE}/${FDT_DTS_FILE}" dev/fdt/simplebus.c optional fdt dev/fe/if_fe.c optional fe dev/fe/if_fe_pccard.c optional fe pccard Added: head/sys/tools/fdt/make_dtb.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/tools/fdt/make_dtb.sh Fri Feb 28 18:29:09 2014 (r262614) @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $FreeBSD$ + +# Script generates dtb file ($3) from dts source ($2) in build tree S ($1) +S=$1 +dts=$2 +dtb=$3 + +cpp -x assembler-with-cpp -I $S/gnu/dts/include -I $S/boot/fdt/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $dts /dev/null | + dtc -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts -i $S/gnu/dts/${MACHINE} From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 19:07:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DC88CEB; Fri, 28 Feb 2014 19:07:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A2E31BB0; Fri, 28 Feb 2014 19:07:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SJ7tkm035420; Fri, 28 Feb 2014 19:07:55 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SJ7tRR035419; Fri, 28 Feb 2014 19:07:55 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402281907.s1SJ7tRR035419@svn.freebsd.org> From: John Baldwin Date: Fri, 28 Feb 2014 19:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262615 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 19:07:55 -0000 Author: jhb Date: Fri Feb 28 19:07:55 2014 New Revision: 262615 URL: http://svnweb.freebsd.org/changeset/base/262615 Log: Workaround an apparent bug in VMWare Fusion's nested VT support where it triggers a VM exit with the exit reason of an external interrupt but without a valid interrupt set in the exit interrupt information. Tested by: Michael Dexter Reviewed by: neel MFC after: 1 week Modified: head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Fri Feb 28 18:29:09 2014 (r262614) +++ head/sys/amd64/vmm/intel/vmx.c Fri Feb 28 19:07:55 2014 (r262615) @@ -1827,6 +1827,13 @@ vmx_exit_process(struct vmx *vmx, int vc * this virtual interrupt during the subsequent VM enter. */ intr_info = vmcs_read(VMCS_EXIT_INTR_INFO); + + /* + * XXX: Ignore this exit if VMCS_INTR_VALID is not set. + * This appears to be a bug in VMWare Fusion? + */ + if (!(intr_info & VMCS_INTR_VALID)) + return (1); KASSERT((intr_info & VMCS_INTR_VALID) != 0 && (intr_info & VMCS_INTR_T_MASK) == VMCS_INTR_T_HWINTR, ("VM exit interruption info invalid: %#x", intr_info)); From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 19:21:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF7505A2; Fri, 28 Feb 2014 19:21:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8225F1D11; Fri, 28 Feb 2014 19:21:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SJL7tT040408; Fri, 28 Feb 2014 19:21:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SJL7it040407; Fri, 28 Feb 2014 19:21:07 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402281921.s1SJL7it040407@svn.freebsd.org> From: John Baldwin Date: Fri, 28 Feb 2014 19:21:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262618 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 19:21:07 -0000 Author: jhb Date: Fri Feb 28 19:21:07 2014 New Revision: 262618 URL: http://svnweb.freebsd.org/changeset/base/262618 Log: Whitespace fix. Modified: head/sys/sys/eventhandler.h Modified: head/sys/sys/eventhandler.h ============================================================================== --- head/sys/sys/eventhandler.h Fri Feb 28 19:18:07 2014 (r262617) +++ head/sys/sys/eventhandler.h Fri Feb 28 19:21:07 2014 (r262618) @@ -270,4 +270,3 @@ EVENTHANDLER_DECLARE(register_framebuffe EVENTHANDLER_DECLARE(unregister_framebuffer, unregister_framebuffer_fn); #endif /* _SYS_EVENTHANDLER_H_ */ - From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 19:51:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00A2E66A; Fri, 28 Feb 2014 19:51:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E15E01147; Fri, 28 Feb 2014 19:51:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SJpltx055110; Fri, 28 Feb 2014 19:51:47 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SJplBs055109; Fri, 28 Feb 2014 19:51:47 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201402281951.s1SJplBs055109@svn.freebsd.org> From: John-Mark Gurney Date: Fri, 28 Feb 2014 19:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262619 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 19:51:48 -0000 Author: jmg Date: Fri Feb 28 19:51:47 2014 New Revision: 262619 URL: http://svnweb.freebsd.org/changeset/base/262619 Log: since -F is safe, and an update from 10-HEAD to 10-STABLE is sooo bloody anoying w/o it.. recommend people use -F too... Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Feb 28 19:21:07 2014 (r262618) +++ head/UPDATING Fri Feb 28 19:51:47 2014 (r262619) @@ -1953,9 +1953,9 @@ COMMON ITEMS: make kernel KERNCONF=YOUR_KERNEL_HERE [1] [3] - mergemaster -p [5] + mergemaster -Fp [5] make installworld - mergemaster -i [4] + mergemaster -Fi [4] make delete-old [6] @@ -1990,9 +1990,9 @@ COMMON ITEMS: make kernel KERNCONF=YOUR_KERNEL_HERE [8] [1] [3] - mergemaster -p [5] + mergemaster -Fp [5] make installworld - mergemaster -i [4] + mergemaster -Fi [4] make delete-old [6] From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 21:25:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 400D6ECA; Fri, 28 Feb 2014 21:25:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2B0CA19DF; Fri, 28 Feb 2014 21:25:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SLPa5X092038; Fri, 28 Feb 2014 21:25:36 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SLPWST092018; Fri, 28 Feb 2014 21:25:32 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201402282125.s1SLPWST092018@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 28 Feb 2014 21:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262623 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 21:25:36 -0000 Author: pfg Date: Fri Feb 28 21:25:32 2014 New Revision: 262623 URL: http://svnweb.freebsd.org/changeset/base/262623 Log: ext2fs: use of tab vs spaces. Consistently use a single tab after a #define as mentioned in style(9). Use tabs instead of space for indenting. Fix a typo: "hash_vesion". No functional change. MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_balloc.c head/sys/fs/ext2fs/ext2_dinode.h head/sys/fs/ext2fs/ext2_dir.h head/sys/fs/ext2fs/ext2_extents.h head/sys/fs/ext2fs/ext2_extern.h head/sys/fs/ext2fs/ext2_htree.c head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/ext2fs/ext2_inode_cnv.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_mount.h head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/ext2fs/ext2fs.h head/sys/fs/ext2fs/fs.h head/sys/fs/ext2fs/htree.h head/sys/fs/ext2fs/inode.h Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Fri Feb 28 21:05:47 2014 (r262622) +++ head/sys/fs/ext2fs/ext2_alloc.c Fri Feb 28 21:25:32 2014 (r262623) @@ -122,7 +122,7 @@ ext2_alloc(struct inode *ip, daddr_t lbn ip->i_flag |= IN_CHANGE | IN_UPDATE; *bnp = bno; return (0); - } + } nospace: EXT2_UNLOCK(ump); ext2_fserr(fs, cred->cr_uid, "filesystem full"); @@ -397,11 +397,11 @@ ext2_valloc(struct vnode *pvp, int mode, ip->i_blocks = 0; ip->i_mode = 0; ip->i_flags = 0; - /* now we want to make sure that the block pointers are zeroed out */ - for (i = 0; i < NDADDR; i++) - ip->i_db[i] = 0; - for (i = 0; i < NIADDR; i++) - ip->i_ib[i] = 0; + /* now we want to make sure that the block pointers are zeroed out */ + for (i = 0; i < NDADDR; i++) + ip->i_db[i] = 0; + for (i = 0; i < NIADDR; i++) + ip->i_ib[i] = 0; /* * Set up a new generation number for this inode. @@ -443,7 +443,7 @@ static u_long ext2_dirpref(struct inode *pip) { struct m_ext2fs *fs; - int cg, prefcg, dirsize, cgsize; + int cg, prefcg, dirsize, cgsize; u_int avgifree, avgbfree, avgndir, curdirsize; u_int minifree, minbfree, maxndir; u_int mincg, minndir; @@ -452,7 +452,7 @@ ext2_dirpref(struct inode *pip) mtx_assert(EXT2_MTX(pip->i_ump), MA_OWNED); fs = pip->i_e2fs; - avgifree = fs->e2fs->e2fs_ficount / fs->e2fs_gcount; + avgifree = fs->e2fs->e2fs_ficount / fs->e2fs_gcount; avgbfree = fs->e2fs->e2fs_fbcount / fs->e2fs_gcount; avgndir = fs->e2fs_total_dir / fs->e2fs_gcount; @@ -473,11 +473,11 @@ ext2_dirpref(struct inode *pip) } for (cg = 0; cg < prefcg; cg++) if (fs->e2fs_gd[cg].ext2bgd_ndirs < minndir && - fs->e2fs_gd[cg].ext2bgd_nifree >= avgifree && - fs->e2fs_gd[cg].ext2bgd_nbfree >= avgbfree) { - mincg = cg; - minndir = fs->e2fs_gd[cg].ext2bgd_ndirs; - } + fs->e2fs_gd[cg].ext2bgd_nifree >= avgifree && + fs->e2fs_gd[cg].ext2bgd_nbfree >= avgbfree) { + mincg = cg; + minndir = fs->e2fs_gd[cg].ext2bgd_ndirs; + } return (mincg); } @@ -515,14 +515,14 @@ ext2_dirpref(struct inode *pip) for (cg = prefcg; cg < fs->e2fs_gcount; cg++) if (fs->e2fs_gd[cg].ext2bgd_ndirs < maxndir && fs->e2fs_gd[cg].ext2bgd_nifree >= minifree && - fs->e2fs_gd[cg].ext2bgd_nbfree >= minbfree) { + fs->e2fs_gd[cg].ext2bgd_nbfree >= minbfree) { if (fs->e2fs_contigdirs[cg] < maxcontigdirs) return (cg); } for (cg = 0; cg < prefcg; cg++) if (fs->e2fs_gd[cg].ext2bgd_ndirs < maxndir && fs->e2fs_gd[cg].ext2bgd_nifree >= minifree && - fs->e2fs_gd[cg].ext2bgd_nbfree >= minbfree) { + fs->e2fs_gd[cg].ext2bgd_nbfree >= minbfree) { if (fs->e2fs_contigdirs[cg] < maxcontigdirs) return (cg); } @@ -567,8 +567,8 @@ ext2_blkpref(struct inode *ip, e2fs_lbn_ /* now check whether we were provided with an array that basically tells us previous blocks to which we want to stay closeby */ - if (bap) - for (tmp = indx - 1; tmp >= 0; tmp--) + if (bap) + for (tmp = indx - 1; tmp >= 0; tmp--) if (bap[tmp]) return bap[tmp]; @@ -968,33 +968,33 @@ ext2_blkfree(struct inode *ip, e4fs_dadd ump = ip->i_ump; cg = dtog(fs, bno); if ((u_int)bno >= fs->e2fs->e2fs_bcount) { - printf("bad block %lld, ino %llu\n", (long long)bno, - (unsigned long long)ip->i_number); - ext2_fserr(fs, ip->i_uid, "bad block"); - return; - } - error = bread(ip->i_devvp, - fsbtodb(fs, fs->e2fs_gd[cg].ext2bgd_b_bitmap), - (int)fs->e2fs_bsize, NOCRED, &bp); - if (error) { - brelse(bp); - return; - } - bbp = (char *)bp->b_data; - bno = dtogd(fs, bno); - if (isclr(bbp, bno)) { - printf("block = %lld, fs = %s\n", - (long long)bno, fs->e2fs_fsmnt); - panic("ext2_blkfree: freeing free block"); - } - clrbit(bbp, bno); + printf("bad block %lld, ino %llu\n", (long long)bno, + (unsigned long long)ip->i_number); + ext2_fserr(fs, ip->i_uid, "bad block"); + return; + } + error = bread(ip->i_devvp, + fsbtodb(fs, fs->e2fs_gd[cg].ext2bgd_b_bitmap), + (int)fs->e2fs_bsize, NOCRED, &bp); + if (error) { + brelse(bp); + return; + } + bbp = (char *)bp->b_data; + bno = dtogd(fs, bno); + if (isclr(bbp, bno)) { + printf("block = %lld, fs = %s\n", + (long long)bno, fs->e2fs_fsmnt); + panic("ext2_blkfree: freeing free block"); + } + clrbit(bbp, bno); EXT2_LOCK(ump); ext2_clusteracct(fs, bbp, cg, bno, 1); - fs->e2fs->e2fs_fbcount++; - fs->e2fs_gd[cg].ext2bgd_nbfree++; - fs->e2fs_fmod = 1; + fs->e2fs->e2fs_fbcount++; + fs->e2fs_gd[cg].ext2bgd_nbfree++; + fs->e2fs_fmod = 1; EXT2_UNLOCK(ump); - bdwrite(bp); + bdwrite(bp); } /* @@ -1100,14 +1100,14 @@ ext2_fserr(struct m_ext2fs *fs, uid_t ui int cg_has_sb(int i) { - int a3, a5, a7; + int a3, a5, a7; - if (i == 0 || i == 1) - return 1; - for (a3 = 3, a5 = 5, a7 = 7; - a3 <= i || a5 <= i || a7 <= i; - a3 *= 3, a5 *= 5, a7 *= 7) - if (i == a3 || i == a5 || i == a7) - return 1; - return 0; + if (i == 0 || i == 1) + return 1; + for (a3 = 3, a5 = 5, a7 = 7; + a3 <= i || a5 <= i || a7 <= i; + a3 *= 3, a5 *= 5, a7 *= 7) + if (i == a3 || i == a5 || i == a7) + return 1; + return 0; } Modified: head/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_balloc.c Fri Feb 28 21:05:47 2014 (r262622) +++ head/sys/fs/ext2fs/ext2_balloc.c Fri Feb 28 21:25:32 2014 (r262623) @@ -80,7 +80,7 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t * If so, increment next_alloc fields to allow ext2_blkpref * to make a good guess */ - if (lbn == ip->i_next_alloc_block + 1) { + if (lbn == ip->i_next_alloc_block + 1) { ip->i_next_alloc_block++; ip->i_next_alloc_goal++; } @@ -167,7 +167,7 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t EXT2_LOCK(ump); pref = ext2_blkpref(ip, lbn, indirs[0].in_off + EXT2_NDIR_BLOCKS, &ip->i_db[0], 0); - if ((error = ext2_alloc(ip, lbn, pref, fs->e2fs_bsize, cred, + if ((error = ext2_alloc(ip, lbn, pref, fs->e2fs_bsize, cred, &newb))) return (error); nb = newb; Modified: head/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dinode.h Fri Feb 28 21:05:47 2014 (r262622) +++ head/sys/fs/ext2fs/ext2_dinode.h Fri Feb 28 21:25:32 2014 (r262623) @@ -27,7 +27,7 @@ */ #ifndef _FS_EXT2FS_EXT2_DINODE_H_ -#define _FS_EXT2FS_EXT2_DINODE_H_ +#define _FS_EXT2FS_EXT2_DINODE_H_ /* * Special inode numbers @@ -55,35 +55,35 @@ * EXT4_HUGE_FILE with some restrictions, imposed the lack of write * support. */ -#define EXT2_SECRM 0x00000001 /* Secure deletion */ -#define EXT2_UNRM 0x00000002 /* Undelete */ -#define EXT2_COMPR 0x00000004 /* Compress file */ -#define EXT2_SYNC 0x00000008 /* Synchronous updates */ -#define EXT2_IMMUTABLE 0x00000010 /* Immutable file */ -#define EXT2_APPEND 0x00000020 /* Writes to file may only append */ -#define EXT2_NODUMP 0x00000040 /* Do not dump file */ -#define EXT2_NOATIME 0x00000080 /* Do not update atime */ -#define EXT4_INDEX 0x00001000 /* Hash-indexed directory */ -#define EXT4_IMAGIC 0x00002000 /* AFS directory */ -#define EXT4_JOURNAL_DATA 0x00004000 /* File data should be journaled */ -#define EXT4_NOTAIL 0x00008000 /* File tail should not be merged */ -#define EXT4_DIRSYNC 0x00010000 /* Dirsync behaviour */ -#define EXT4_TOPDIR 0x00020000 /* Top of directory hierarchies*/ -#define EXT4_HUGE_FILE 0x00040000 /* Set to each huge file */ -#define EXT4_EXTENTS 0x00080000 /* Inode uses extents */ -#define EXT4_EOFBLOCKS 0x00400000 /* Blocks allocated beyond EOF */ +#define EXT2_SECRM 0x00000001 /* Secure deletion */ +#define EXT2_UNRM 0x00000002 /* Undelete */ +#define EXT2_COMPR 0x00000004 /* Compress file */ +#define EXT2_SYNC 0x00000008 /* Synchronous updates */ +#define EXT2_IMMUTABLE 0x00000010 /* Immutable file */ +#define EXT2_APPEND 0x00000020 /* Writes to file may only append */ +#define EXT2_NODUMP 0x00000040 /* Do not dump file */ +#define EXT2_NOATIME 0x00000080 /* Do not update atime */ +#define EXT4_INDEX 0x00001000 /* Hash-indexed directory */ +#define EXT4_IMAGIC 0x00002000 /* AFS directory */ +#define EXT4_JOURNAL_DATA 0x00004000 /* File data should be journaled */ +#define EXT4_NOTAIL 0x00008000 /* File tail should not be merged */ +#define EXT4_DIRSYNC 0x00010000 /* Dirsync behaviour */ +#define EXT4_TOPDIR 0x00020000 /* Top of directory hierarchies*/ +#define EXT4_HUGE_FILE 0x00040000 /* Set to each huge file */ +#define EXT4_EXTENTS 0x00080000 /* Inode uses extents */ +#define EXT4_EOFBLOCKS 0x00400000 /* Blocks allocated beyond EOF */ /* * Definitions for nanosecond timestamps. * Ext3 inode versioning, 2006-12-13. */ -#define EXT3_EPOCH_BITS 2 -#define EXT3_EPOCH_MASK ((1 << EXT3_EPOCH_BITS) - 1) -#define EXT3_NSEC_MASK (~0UL << EXT3_EPOCH_BITS) +#define EXT3_EPOCH_BITS 2 +#define EXT3_EPOCH_MASK ((1 << EXT3_EPOCH_BITS) - 1) +#define EXT3_NSEC_MASK (~0UL << EXT3_EPOCH_BITS) -#define E2DI_HAS_XTIME(ip) (EXT2_HAS_RO_COMPAT_FEATURE(ip->i_e2fs, \ +#define E2DI_HAS_XTIME(ip) (EXT2_HAS_RO_COMPAT_FEATURE(ip->i_e2fs, \ EXT2F_ROCOMPAT_EXTRA_ISIZE)) -#define E2DI_HAS_HUGE_FILE(ip) (EXT2_HAS_RO_COMPAT_FEATURE(ip->i_e2fs, \ +#define E2DI_HAS_HUGE_FILE(ip) (EXT2_HAS_RO_COMPAT_FEATURE(ip->i_e2fs, \ EXT2F_ROCOMPAT_HUGE_FILE)) /* @@ -94,7 +94,7 @@ #define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1) #define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1) #define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) -#define EXT2_MAXSYMLINKLEN (EXT2_N_BLOCKS * sizeof(uint32_t)) +#define EXT2_MAXSYMLINKLEN (EXT2_N_BLOCKS * sizeof(uint32_t)) /* * Structure of an inode on the disk @@ -121,16 +121,16 @@ struct ext2fs_dinode { uint16_t e2di_facl_high; /* 118: File EA bits 47:32 */ uint16_t e2di_uid_high; /* 120: Owner UID top 16 bits */ uint16_t e2di_gid_high; /* 122: Owner GID top 16 bits */ - uint16_t e2di_chksum_lo; /* 124: Lower inode checksum */ + uint16_t e2di_chksum_lo; /* 124: Lower inode checksum */ uint16_t e2di_lx_reserved; /* 126: Unused */ uint16_t e2di_extra_isize; /* 128: Size of this inode */ uint16_t e2di_chksum_hi; /* 130: High inode checksum */ - uint32_t e2di_ctime_extra; /* 132: Extra change time */ - uint32_t e2di_mtime_extra; /* 136: Extra modification time */ - uint32_t e2di_atime_extra; /* 140: Extra access time */ - uint32_t e2di_crtime; /* 144: Creation (birth)time */ - uint32_t e2di_crtime_extra; /* 148: Extra creation (birth)time */ - uint32_t e2di_version_hi; /* 152: High bits of inode version */ + uint32_t e2di_ctime_extra; /* 132: Extra change time */ + uint32_t e2di_mtime_extra; /* 136: Extra modification time */ + uint32_t e2di_atime_extra; /* 140: Extra access time */ + uint32_t e2di_crtime; /* 144: Creation (birth)time */ + uint32_t e2di_crtime_extra; /* 148: Extra creation (birth)time */ + uint32_t e2di_version_hi; /* 152: High bits of inode version */ }; #endif /* !_FS_EXT2FS_EXT2_DINODE_H_ */ Modified: head/sys/fs/ext2fs/ext2_dir.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dir.h Fri Feb 28 21:05:47 2014 (r262622) +++ head/sys/fs/ext2fs/ext2_dir.h Fri Feb 28 21:25:32 2014 (r262623) @@ -27,12 +27,12 @@ */ #ifndef _FS_EXT2FS_EXT2_DIR_H_ -#define _FS_EXT2FS_EXT2_DIR_H_ +#define _FS_EXT2FS_EXT2_DIR_H_ /* * Structure of a directory entry */ -#define EXT2FS_MAXNAMLEN 255 +#define EXT2FS_MAXNAMLEN 255 struct ext2fs_direct { uint32_t e2d_ino; /* inode number of entry */ @@ -72,31 +72,30 @@ struct ext2fs_direct_2 { /* * Maximal count of links to a file */ -#define EXT2_LINK_MAX 32000 +#define EXT2_LINK_MAX 32000 /* * Ext2 directory file types. Only the low 3 bits are used. The * other bits are reserved for now. */ -#define EXT2_FT_UNKNOWN 0 -#define EXT2_FT_REG_FILE 1 -#define EXT2_FT_DIR 2 -#define EXT2_FT_CHRDEV 3 -#define EXT2_FT_BLKDEV 4 -#define EXT2_FT_FIFO 5 -#define EXT2_FT_SOCK 6 -#define EXT2_FT_SYMLINK 7 - -#define EXT2_FT_MAX 8 +#define EXT2_FT_UNKNOWN 0 +#define EXT2_FT_REG_FILE 1 +#define EXT2_FT_DIR 2 +#define EXT2_FT_CHRDEV 3 +#define EXT2_FT_BLKDEV 4 +#define EXT2_FT_FIFO 5 +#define EXT2_FT_SOCK 6 +#define EXT2_FT_SYMLINK 7 +#define EXT2_FT_MAX 8 /* * EXT2_DIR_PAD defines the directory entries boundaries * * NOTE: It must be a multiple of 4 */ -#define EXT2_DIR_PAD 4 -#define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1) -#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \ +#define EXT2_DIR_PAD 4 +#define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1) +#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \ ~EXT2_DIR_ROUND) #endif /* !_FS_EXT2FS_EXT2_DIR_H_ */ Modified: head/sys/fs/ext2fs/ext2_extents.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.h Fri Feb 28 21:05:47 2014 (r262622) +++ head/sys/fs/ext2fs/ext2_extents.h Fri Feb 28 21:25:32 2014 (r262623) @@ -26,15 +26,15 @@ * $FreeBSD$ */ #ifndef _FS_EXT2FS_EXT2_EXTENTS_H_ -#define _FS_EXT2FS_EXT2_EXTENTS_H_ +#define _FS_EXT2FS_EXT2_EXTENTS_H_ #include -#define EXT4_EXT_MAGIC 0xf30a +#define EXT4_EXT_MAGIC 0xf30a -#define EXT4_EXT_CACHE_NO 0 -#define EXT4_EXT_CACHE_GAP 1 -#define EXT4_EXT_CACHE_IN 2 +#define EXT4_EXT_CACHE_NO 0 +#define EXT4_EXT_CACHE_GAP 1 +#define EXT4_EXT_CACHE_IN 2 /* * Ext4 file system extent on disk. Modified: head/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extern.h Fri Feb 28 21:05:47 2014 (r262622) +++ head/sys/fs/ext2fs/ext2_extern.h Fri Feb 28 21:25:32 2014 (r262623) @@ -72,8 +72,8 @@ int ext2_update(struct vnode *, int); int ext2_valloc(struct vnode *, int, struct ucred *, struct vnode **); int ext2_vfree(struct vnode *, ino_t, int); int ext2_vinit(struct mount *, struct vop_vector *, struct vnode **vpp); -int ext2_lookup(struct vop_cachedlookup_args *); -int ext2_readdir(struct vop_readdir_args *); +int ext2_lookup(struct vop_cachedlookup_args *); +int ext2_readdir(struct vop_readdir_args *); void ext2_print_inode(struct inode *); int ext2_direnter(struct inode *, struct vnode *, struct componentname *); Modified: head/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- head/sys/fs/ext2fs/ext2_htree.c Fri Feb 28 21:05:47 2014 (r262622) +++ head/sys/fs/ext2fs/ext2_htree.c Fri Feb 28 21:25:32 2014 (r262623) @@ -60,7 +60,7 @@ static int ext2_htree_check_next(struct const char *name, struct ext2fs_htree_lookup_info *info); static int ext2_htree_cmp_sort_entry(const void *e1, const void *e2); static int ext2_htree_find_leaf(struct inode *ip, const char *name, - int namelen, uint32_t *hash, uint8_t *hash_verion, + int namelen, uint32_t *hash, uint8_t *hash_version, struct ext2fs_htree_lookup_info *info); static uint32_t ext2_htree_get_block(struct ext2fs_htree_entry *ep); static uint16_t ext2_htree_get_count(struct ext2fs_htree_entry *ep); Modified: head/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode.c Fri Feb 28 21:05:47 2014 (r262622) +++ head/sys/fs/ext2fs/ext2_inode.c Fri Feb 28 21:25:32 2014 (r262623) @@ -248,7 +248,7 @@ ext2_truncate(struct vnode *vp, off_t le if (error && (allerror == 0)) allerror = error; vnode_pager_setsize(ovp, length); - + /* * Indirect blocks first. */ Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode_cnv.c Fri Feb 28 21:05:47 2014 (r262622) +++ head/sys/fs/ext2fs/ext2_inode_cnv.c Fri Feb 28 21:25:32 2014 (r262623) @@ -82,7 +82,7 @@ ext2_print_inode(struct inode *in) void ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) { - int i; + int i; ip->i_nlink = ei->e2di_nlink; /* Godmar thinks - if the link count is zero, then the inode is Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Fri Feb 28 21:05:47 2014 (r262622) +++ head/sys/fs/ext2fs/ext2_lookup.c Fri Feb 28 21:25:32 2014 (r262623) @@ -805,7 +805,7 @@ ext2_dirbad(struct inode *ip, doff_t off mp->mnt_stat.f_mntonname, (u_long)ip->i_number,(long)offset, how); else (void)printf("%s: bad dir ino %lu at offset %ld: %s\n", - mp->mnt_stat.f_mntonname, (u_long)ip->i_number, (long)offset, how); + mp->mnt_stat.f_mntonname, (u_long)ip->i_number, (long)offset, how); } Modified: head/sys/fs/ext2fs/ext2_mount.h ============================================================================== --- head/sys/fs/ext2fs/ext2_mount.h Fri Feb 28 21:05:47 2014 (r262622) +++ head/sys/fs/ext2fs/ext2_mount.h Fri Feb 28 21:25:32 2014 (r262623) @@ -31,7 +31,7 @@ */ #ifndef _FS_EXT2FS_EXT2_MOUNT_H_ -#define _FS_EXT2FS_EXT2_MOUNT_H_ +#define _FS_EXT2FS_EXT2_MOUNT_H_ #ifdef _KERNEL @@ -59,18 +59,18 @@ struct ext2mount { struct bufobj *um_bo; }; -#define EXT2_LOCK(aa) mtx_lock(&(aa)->um_lock) -#define EXT2_UNLOCK(aa) mtx_unlock(&(aa)->um_lock) -#define EXT2_MTX(aa) (&(aa)->um_lock) +#define EXT2_LOCK(aa) mtx_lock(&(aa)->um_lock) +#define EXT2_UNLOCK(aa) mtx_unlock(&(aa)->um_lock) +#define EXT2_MTX(aa) (&(aa)->um_lock) /* Convert mount ptr to ext2fsmount ptr. */ -#define VFSTOEXT2(mp) ((struct ext2mount *)((mp)->mnt_data)) +#define VFSTOEXT2(mp) ((struct ext2mount *)((mp)->mnt_data)) /* * Macros to access file system parameters in the ufsmount structure. * Used by ufs_bmap. */ -#define MNINDIR(ump) ((ump)->um_nindir) +#define MNINDIR(ump) ((ump)->um_nindir) #define blkptrtodb(ump, b) ((b) << (ump)->um_bptrtodb) #define is_sequential(ump, a, b) ((b) == (a) + ump->um_seqinc) #endif /* _KERNEL */ Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Fri Feb 28 21:05:47 2014 (r262622) +++ head/sys/fs/ext2fs/ext2_vfsops.c Fri Feb 28 21:25:32 2014 (r262623) @@ -674,7 +674,7 @@ ext2_mountfs(struct vnode *devvp, struct * Initialize filesystem stat information in mount struct. */ MNT_ILOCK(mp); - mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED; + mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED; MNT_IUNLOCK(mp); return (0); out: @@ -688,7 +688,7 @@ out: PICKUP_GIANT(); } if (ump) { - mtx_destroy(EXT2_MTX(ump)); + mtx_destroy(EXT2_MTX(ump)); free(ump->um_e2fs->e2fs_gd, M_EXT2MNT); free(ump->um_e2fs->e2fs_contigdirs, M_EXT2MNT); free(ump->um_e2fs->e2fs, M_EXT2MNT); @@ -723,8 +723,8 @@ ext2_unmount(struct mount *mp, int mntfl ronly = fs->e2fs_ronly; if (ronly == 0 && ext2_cgupdate(ump, MNT_WAIT) == 0) { if (fs->e2fs_wasvalid) - fs->e2fs->e2fs_state |= E2FS_ISCLEAN; - ext2_sbupdate(ump, MNT_WAIT); + fs->e2fs->e2fs_state |= E2FS_ISCLEAN; + ext2_sbupdate(ump, MNT_WAIT); } DROP_GIANT(); Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Fri Feb 28 21:05:47 2014 (r262622) +++ head/sys/fs/ext2fs/ext2_vnops.c Fri Feb 28 21:25:32 2014 (r262623) @@ -775,10 +775,10 @@ abortit: dp = VTOI(fdvp); ip = VTOI(fvp); if (ip->i_nlink >= EXT2_LINK_MAX) { - VOP_UNLOCK(fvp, 0); - error = EMLINK; - goto abortit; - } + VOP_UNLOCK(fvp, 0); + error = EMLINK; + goto abortit; + } if ((ip->i_flags & (NOUNLINK | IMMUTABLE | APPEND)) || (dp->i_flags & APPEND)) { VOP_UNLOCK(fvp, 0); @@ -942,8 +942,8 @@ abortit: * of the target directory. */ if (doingdirectory && !newparent) { - dp->i_nlink--; - dp->i_flag |= IN_CHANGE; + dp->i_nlink--; + dp->i_flag |= IN_CHANGE; } vput(tdvp); /* @@ -1623,7 +1623,6 @@ ext2_read(struct vop_read_args *ap) return (error); } - /* * Vnode op for reading. */ @@ -1723,7 +1722,7 @@ ext2_ind_read(struct vop_read_args *ap) xfersize = size; } error = uiomove((char *)bp->b_data + blkoffset, - (int)xfersize, uio); + (int)xfersize, uio); if (error) break; @@ -1960,10 +1959,10 @@ ext2_write(struct vop_write_args *ap) if (uio->uio_offset + xfersize > ip->i_size) vnode_pager_setsize(vp, uio->uio_offset + xfersize); - /* + /* * We must perform a read-before-write if the transfer size * does not cover the entire buffer. - */ + */ if (fs->e2fs_bsize > xfersize) flags |= BA_CLRBUF; else @@ -2057,9 +2056,9 @@ ext2_write(struct vop_write_args *ap) } } if (uio->uio_resid != resid) { - ip->i_flag |= IN_CHANGE | IN_UPDATE; - if (ioflag & IO_SYNC) - error = ext2_update(vp, 1); - } + ip->i_flag |= IN_CHANGE | IN_UPDATE; + if (ioflag & IO_SYNC) + error = ext2_update(vp, 1); + } return (error); } Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Fri Feb 28 21:05:47 2014 (r262622) +++ head/sys/fs/ext2fs/ext2fs.h Fri Feb 28 21:25:32 2014 (r262623) @@ -35,7 +35,7 @@ */ #ifndef _FS_EXT2FS_EXT2FS_H_ -#define _FS_EXT2FS_EXT2FS_H_ +#define _FS_EXT2FS_EXT2FS_H_ #include @@ -77,7 +77,7 @@ struct ext2fs { uint32_t e2fs_features_rocompat; /* RO-compatible feature set */ uint8_t e2fs_uuid[16]; /* 128-bit uuid for volume */ char e2fs_vname[16]; /* volume name */ - char e2fs_fsmnt[64]; /* name mounted on */ + char e2fs_fsmnt[64]; /* name mounted on */ uint32_t e2fs_algo; /* For compression */ uint8_t e2fs_prealloc; /* # of blocks for old prealloc */ uint8_t e2fs_dir_prealloc; /* # of blocks for old prealloc dirs */ @@ -103,10 +103,10 @@ struct ext2fs { uint16_t e4fs_mmpintv; /* number of seconds to wait in MMP checking */ uint64_t e4fs_mmpblk; /* block for multi-mount protection */ uint32_t e4fs_raid_stripe_wid;/* blocks on all data disks (N * stride) */ - uint8_t e4fs_log_gpf; /* FLEX_BG group size */ + uint8_t e4fs_log_gpf; /* FLEX_BG group size */ uint8_t e4fs_char_pad2; uint16_t e4fs_pad; - uint32_t reserved2[162]; /* Padding to the end of the block */ + uint32_t reserved2[162]; /* Padding to the end of the block */ }; /* @@ -114,7 +114,7 @@ struct ext2fs { * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in * the super block for this name. */ -#define MAXMNTLEN 512 +#define MAXMNTLEN 512 /* * In-Memory Superblock @@ -123,25 +123,25 @@ struct ext2fs { struct m_ext2fs { struct ext2fs * e2fs; char e2fs_fsmnt[MAXMNTLEN];/* name mounted on */ - char e2fs_ronly; /* mounted read-only flag */ - char e2fs_fmod; /* super block modified flag */ - uint32_t e2fs_bsize; /* Block size */ - uint32_t e2fs_bshift; /* calc of logical block no */ + char e2fs_ronly; /* mounted read-only flag */ + char e2fs_fmod; /* super block modified flag */ + uint32_t e2fs_bsize; /* Block size */ + uint32_t e2fs_bshift; /* calc of logical block no */ uint32_t e2fs_bpg; /* Number of blocks per group */ - int64_t e2fs_qbmask; /* = s_blocksize -1 */ - uint32_t e2fs_fsbtodb; /* Shift to get disk block */ + int64_t e2fs_qbmask; /* = s_blocksize -1 */ + uint32_t e2fs_fsbtodb; /* Shift to get disk block */ uint32_t e2fs_ipg; /* Number of inodes per group */ uint32_t e2fs_ipb; /* Number of inodes per block */ - uint32_t e2fs_itpg; /* Number of inode table per group */ - uint32_t e2fs_fsize; /* Size of fragments per block */ + uint32_t e2fs_itpg; /* Number of inode table per group */ + uint32_t e2fs_fsize; /* Size of fragments per block */ uint32_t e2fs_fpb; /* Number of fragments per block */ uint32_t e2fs_fpg; /* Number of fragments per group */ - uint32_t e2fs_gdbcount; /* Number of group descriptors */ - uint32_t e2fs_gcount; /* Number of groups */ + uint32_t e2fs_gdbcount; /* Number of group descriptors */ + uint32_t e2fs_gcount; /* Number of groups */ uint32_t e2fs_isize; /* Size of inode */ uint32_t e2fs_total_dir; /* Total number of directories */ uint8_t *e2fs_contigdirs; /* (u) # of contig. allocated dirs */ - char e2fs_wasvalid; /* valid at mount time */ + char e2fs_wasvalid; /* valid at mount time */ off_t e2fs_maxfilesize; struct ext2_gd *e2fs_gd; /* Group Descriptors */ int32_t e2fs_contigsumsize; /* size of cluster summary array */ @@ -160,39 +160,39 @@ struct csum { /* * The second extended file system magic number */ -#define E2FS_MAGIC 0xEF53 +#define E2FS_MAGIC 0xEF53 /* * Revision levels */ -#define E2FS_REV0 0 /* The good old (original) format */ -#define E2FS_REV1 1 /* V2 format w/ dynamic inode sizes */ +#define E2FS_REV0 0 /* The good old (original) format */ +#define E2FS_REV1 1 /* V2 format w/ dynamic inode sizes */ -#define E2FS_REV0_INODE_SIZE 128 +#define E2FS_REV0_INODE_SIZE 128 /* * compatible/incompatible features */ -#define EXT2F_COMPAT_PREALLOC 0x0001 -#define EXT2F_COMPAT_HASJOURNAL 0x0004 -#define EXT2F_COMPAT_RESIZE 0x0010 -#define EXT2F_COMPAT_DIRHASHINDEX 0x0020 - -#define EXT2F_ROCOMPAT_SPARSESUPER 0x0001 -#define EXT2F_ROCOMPAT_LARGEFILE 0x0002 -#define EXT2F_ROCOMPAT_BTREE_DIR 0x0004 -#define EXT2F_ROCOMPAT_HUGE_FILE 0x0008 -#define EXT2F_ROCOMPAT_GDT_CSUM 0x0010 -#define EXT2F_ROCOMPAT_DIR_NLINK 0x0020 -#define EXT2F_ROCOMPAT_EXTRA_ISIZE 0x0040 - -#define EXT2F_INCOMPAT_COMP 0x0001 -#define EXT2F_INCOMPAT_FTYPE 0x0002 -#define EXT2F_INCOMPAT_META_BG 0x0010 -#define EXT2F_INCOMPAT_EXTENTS 0x0040 -#define EXT2F_INCOMPAT_64BIT 0x0080 -#define EXT2F_INCOMPAT_MMP 0x0100 -#define EXT2F_INCOMPAT_FLEX_BG 0x0200 +#define EXT2F_COMPAT_PREALLOC 0x0001 +#define EXT2F_COMPAT_HASJOURNAL 0x0004 +#define EXT2F_COMPAT_RESIZE 0x0010 +#define EXT2F_COMPAT_DIRHASHINDEX 0x0020 + +#define EXT2F_ROCOMPAT_SPARSESUPER 0x0001 +#define EXT2F_ROCOMPAT_LARGEFILE 0x0002 +#define EXT2F_ROCOMPAT_BTREE_DIR 0x0004 +#define EXT2F_ROCOMPAT_HUGE_FILE 0x0008 +#define EXT2F_ROCOMPAT_GDT_CSUM 0x0010 +#define EXT2F_ROCOMPAT_DIR_NLINK 0x0020 +#define EXT2F_ROCOMPAT_EXTRA_ISIZE 0x0040 + +#define EXT2F_INCOMPAT_COMP 0x0001 +#define EXT2F_INCOMPAT_FTYPE 0x0002 +#define EXT2F_INCOMPAT_META_BG 0x0010 +#define EXT2F_INCOMPAT_EXTENTS 0x0040 +#define EXT2F_INCOMPAT_64BIT 0x0080 +#define EXT2F_INCOMPAT_MMP 0x0100 +#define EXT2F_INCOMPAT_FLEX_BG 0x0200 /* * Features supported in this implementation @@ -212,28 +212,28 @@ struct csum { * - EXT2F_INCOMPAT_FLEX_BG * - EXT2F_INCOMPAT_META_BG */ -#define EXT2F_COMPAT_SUPP EXT2F_COMPAT_DIRHASHINDEX -#define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER | \ +#define EXT2F_COMPAT_SUPP EXT2F_COMPAT_DIRHASHINDEX +#define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER | \ EXT2F_ROCOMPAT_LARGEFILE | \ EXT2F_ROCOMPAT_EXTRA_ISIZE) -#define EXT2F_INCOMPAT_SUPP EXT2F_INCOMPAT_FTYPE -#define EXT4F_RO_INCOMPAT_SUPP (EXT2F_INCOMPAT_EXTENTS | \ +#define EXT2F_INCOMPAT_SUPP EXT2F_INCOMPAT_FTYPE +#define EXT4F_RO_INCOMPAT_SUPP (EXT2F_INCOMPAT_EXTENTS | \ EXT2F_INCOMPAT_FLEX_BG | \ EXT2F_INCOMPAT_META_BG ) /* Assume that user mode programs are passing in an ext2fs superblock, not * a kernel struct super_block. This will allow us to call the feature-test * macros from user land. */ -#define EXT2_SB(sb) (sb) +#define EXT2_SB(sb) (sb) /* * Feature set definitions */ -#define EXT2_HAS_COMPAT_FEATURE(sb,mask) \ +#define EXT2_HAS_COMPAT_FEATURE(sb,mask) \ ( EXT2_SB(sb)->e2fs->e2fs_features_compat & htole32(mask) ) -#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) \ +#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask) \ ( EXT2_SB(sb)->e2fs->e2fs_features_rocompat & htole32(mask) ) -#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ +#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask) \ ( EXT2_SB(sb)->e2fs->e2fs_features_incompat & htole32(mask) ) /* @@ -245,8 +245,8 @@ struct csum { /* * Filesystem miscellaneous flags */ -#define E2FS_SIGNED_HASH 0x0001 -#define E2FS_UNSIGNED_HASH 0x0002 +#define E2FS_SIGNED_HASH 0x0001 +#define E2FS_UNSIGNED_HASH 0x0002 /* ext2 file system block group descriptor */ @@ -270,30 +270,30 @@ struct ext2_gd { * helps reading these metadatas */ -#define e2fs_cgload(old, new, size) memcpy((new), (old), (size)); -#define e2fs_cgsave(old, new, size) memcpy((new), (old), (size)); +#define e2fs_cgload(old, new, size) memcpy((new), (old), (size)); +#define e2fs_cgsave(old, new, size) memcpy((new), (old), (size)); /* * Macro-instructions used to manage several block sizes */ #define EXT2_MAX_BLOCK_SIZE 4096 -#define EXT2_MIN_BLOCK_LOG_SIZE 10 -#define EXT2_BLOCK_SIZE(s) ((s)->e2fs_bsize) +#define EXT2_MIN_BLOCK_LOG_SIZE 10 +#define EXT2_BLOCK_SIZE(s) ((s)->e2fs_bsize) #define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof(uint32_t)) -#define EXT2_INODE_SIZE(s) (EXT2_SB(s)->e2fs_isize) +#define EXT2_INODE_SIZE(s) (EXT2_SB(s)->e2fs_isize) /* * Macro-instructions used to manage fragments */ -#define EXT2_MIN_FRAG_SIZE 1024 +#define EXT2_MIN_FRAG_SIZE 1024 #define EXT2_MAX_FRAG_SIZE 4096 -#define EXT2_MIN_FRAG_LOG_SIZE 10 -#define EXT2_FRAG_SIZE(s) (EXT2_SB(s)->e2fs_fsize) -#define EXT2_FRAGS_PER_BLOCK(s) (EXT2_SB(s)->e2fs_fpb) +#define EXT2_MIN_FRAG_LOG_SIZE 10 +#define EXT2_FRAG_SIZE(s) (EXT2_SB(s)->e2fs_fsize) +#define EXT2_FRAGS_PER_BLOCK(s) (EXT2_SB(s)->e2fs_fpb) /* * Macro-instructions used to manage group descriptors */ -#define EXT2_BLOCKS_PER_GROUP(s) (EXT2_SB(s)->e2fs_bpg) +#define EXT2_BLOCKS_PER_GROUP(s) (EXT2_SB(s)->e2fs_bpg) #endif /* !_FS_EXT2FS_EXT2FS_H_ */ Modified: head/sys/fs/ext2fs/fs.h ============================================================================== --- head/sys/fs/ext2fs/fs.h Fri Feb 28 21:05:47 2014 (r262622) +++ head/sys/fs/ext2fs/fs.h Fri Feb 28 21:25:32 2014 (r262623) @@ -37,7 +37,7 @@ */ #ifndef _FS_EXT2FS_FS_H_ -#define _FS_EXT2FS_FS_H_ +#define _FS_EXT2FS_FS_H_ /* * Each disk drive contains some number of file systems. @@ -54,15 +54,15 @@ * The first boot and super blocks are given in absolute disk addresses. * The byte-offset forms are preferred, as they don't imply a sector size. */ -#define SBSIZE 1024 -#define SBLOCK 2 +#define SBSIZE 1024 +#define SBLOCK 2 /* * The path name on which the file system is mounted is maintained * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in * the super block for this name. */ -#define MAXMNTLEN 512 +#define MAXMNTLEN 512 /* * A summary of contiguous blocks of various sizes is maintained @@ -72,7 +72,7 @@ * XXX:FS_MAXCONTIG is set to 16 to conserve space. Here we set * EXT2_MAXCONTIG to 32 for better performance. */ -#define EXT2_MAXCONTIG 32 +#define EXT2_MAXCONTIG 32 /* * Grigoriy Orlov has done some extensive work to fine @@ -87,8 +87,8 @@ * 16384. */ -#define AFPDIR 64 -#define AVGDIRSIZE 1048576 +#define AFPDIR 64 +#define AVGDIRSIZE 1048576 /* * Macros for access to superblock array structures @@ -98,14 +98,14 @@ * Turn file system block numbers into disk block addresses. * This maps file system blocks to device size blocks. */ -#define fsbtodb(fs, b) ((daddr_t)(b) << (fs)->e2fs_fsbtodb) +#define fsbtodb(fs, b) ((daddr_t)(b) << (fs)->e2fs_fsbtodb) #define dbtofsb(fs, b) ((b) >> (fs)->e2fs_fsbtodb) /* get group containing inode */ -#define ino_to_cg(fs, x) (((x) - 1) / (fs->e2fs_ipg)) +#define ino_to_cg(fs, x) (((x) - 1) / (fs->e2fs_ipg)) /* get block containing inode from its number x */ -#define ino_to_fsba(fs, x) \ +#define ino_to_fsba(fs, x) \ ((fs)->e2fs_gd[ino_to_cg((fs), (x))].ext2bgd_i_tables + \ (((x) - 1) % (fs)->e2fs->e2fs_ipg) / (fs)->e2fs_ipb) @@ -126,20 +126,20 @@ * quantities by using shifts and masks in place of divisions * modulos and multiplications. */ -#define blkoff(fs, loc) /* calculates (loc % fs->fs_bsize) */ \ +#define blkoff(fs, loc) /* calculates (loc % fs->fs_bsize) */ \ ((loc) & (fs)->e2fs_qbmask) -#define lblktosize(fs, blk) /* calculates (blk * fs->fs_bsize) */ \ +#define lblktosize(fs, blk) /* calculates (blk * fs->fs_bsize) */ \ ((blk) << (fs->e2fs_bshift)) -#define lblkno(fs, loc) /* calculates (loc / fs->fs_bsize) */ \ +#define lblkno(fs, loc) /* calculates (loc / fs->fs_bsize) */ \ ((loc) >> (fs->e2fs_bshift)) /* no fragments -> logical block number equal # of frags */ -#define numfrags(fs, loc) /* calculates (loc / fs->fs_fsize) */ \ +#define numfrags(fs, loc) /* calculates (loc / fs->fs_fsize) */ \ ((loc) >> (fs->e2fs_bshift)) -#define fragroundup(fs, size) /* calculates roundup(size, fs->fs_fsize) */ \ +#define fragroundup(fs, size) /* calculates roundup(size, fs->fs_fsize) */ \ roundup(size, fs->e2fs_fsize) /* was (((size) + (fs)->fs_qfmask) & (fs)->fs_fmask) */ @@ -147,7 +147,7 @@ * Determining the size of a file block in the file system. * easy w/o fragments */ -#define blksize(fs, ip, lbn) ((fs)->e2fs_fsize) +#define blksize(fs, ip, lbn) ((fs)->e2fs_fsize) /* * INOPB is the number of inodes in a secondary storage block. Modified: head/sys/fs/ext2fs/htree.h ============================================================================== --- head/sys/fs/ext2fs/htree.h Fri Feb 28 21:05:47 2014 (r262622) +++ head/sys/fs/ext2fs/htree.h Fri Feb 28 21:25:32 2014 (r262623) @@ -28,18 +28,18 @@ */ #ifndef _FS_EXT2FS_HTREE_H_ -#define _FS_EXT2FS_HTREE_H_ +#define _FS_EXT2FS_HTREE_H_ /* EXT3 HTree directory indexing */ -#define EXT2_HTREE_LEGACY 0 -#define EXT2_HTREE_HALF_MD4 1 -#define EXT2_HTREE_TEA 2 -#define EXT2_HTREE_LEGACY_UNSIGNED 3 -#define EXT2_HTREE_HALF_MD4_UNSIGNED 4 -#define EXT2_HTREE_TEA_UNSIGNED 5 +#define EXT2_HTREE_LEGACY 0 +#define EXT2_HTREE_HALF_MD4 1 +#define EXT2_HTREE_TEA 2 +#define EXT2_HTREE_LEGACY_UNSIGNED 3 +#define EXT2_HTREE_HALF_MD4_UNSIGNED 4 +#define EXT2_HTREE_TEA_UNSIGNED 5 -#define EXT2_HTREE_EOF 0x7FFFFFFF +#define EXT2_HTREE_EOF 0x7FFFFFFF struct ext2fs_fake_direct { uint32_t e2d_ino; /* inode number of entry */ Modified: head/sys/fs/ext2fs/inode.h ============================================================================== --- head/sys/fs/ext2fs/inode.h Fri Feb 28 21:05:47 2014 (r262622) +++ head/sys/fs/ext2fs/inode.h Fri Feb 28 21:25:32 2014 (r262623) @@ -150,7 +150,7 @@ struct inode { #define IN_HASHED 0x0020 /* Inode is on hash list */ #define IN_LAZYMOD 0x0040 /* Modified, but don't write yet. */ #define IN_SPACECOUNTED 0x0080 /* Blocks to be freed in free count. */ -#define IN_LAZYACCESS 0x0100 /* Process IN_ACCESS after the +#define IN_LAZYACCESS 0x0100 /* Process IN_ACCESS after the suspension finished */ /* From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 21:33:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD77457E; Fri, 28 Feb 2014 21:33:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A97D41ABE; Fri, 28 Feb 2014 21:33:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SLXeOo095795; Fri, 28 Feb 2014 21:33:40 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SLXeCo095794; Fri, 28 Feb 2014 21:33:40 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402282133.s1SLXeCo095794@svn.freebsd.org> From: John Baldwin Date: Fri, 28 Feb 2014 21:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262624 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 21:33:40 -0000 Author: jhb Date: Fri Feb 28 21:33:40 2014 New Revision: 262624 URL: http://svnweb.freebsd.org/changeset/base/262624 Log: Correct VMware capitalization. Submitted by: joeld Modified: head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Fri Feb 28 21:25:32 2014 (r262623) +++ head/sys/amd64/vmm/intel/vmx.c Fri Feb 28 21:33:40 2014 (r262624) @@ -1830,7 +1830,7 @@ vmx_exit_process(struct vmx *vmx, int vc /* * XXX: Ignore this exit if VMCS_INTR_VALID is not set. - * This appears to be a bug in VMWare Fusion? + * This appears to be a bug in VMware Fusion? */ if (!(intr_info & VMCS_INTR_VALID)) return (1); From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 22:06:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0204F162; Fri, 28 Feb 2014 22:06:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E29D31D40; Fri, 28 Feb 2014 22:06:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SM6JdF008064; Fri, 28 Feb 2014 22:06:19 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SM6JTG008063; Fri, 28 Feb 2014 22:06:19 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402282206.s1SM6JTG008063@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Feb 2014 22:06:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262625 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 22:06:20 -0000 Author: imp Date: Fri Feb 28 22:06:19 2014 New Revision: 262625 URL: http://svnweb.freebsd.org/changeset/base/262625 Log: Only try to build the static dtb when we're building a static dtb... Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Feb 28 21:33:40 2014 (r262624) +++ head/sys/conf/files Fri Feb 28 22:06:19 2014 (r262625) @@ -13,7 +13,7 @@ acpi_quirks.h optional acpi \ # The 'fdt_dtb_file' target covers an actual DTB file name, which is derived # from the specified source (DTS) file: .dts -> .dtb # -fdt_dtb_file optional fdt \ +fdt_dtb_file optional fdt fdt_dtb_static \ compile-with "sh $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} ${.CURDIR}/${FDT_DTS_FILE:R}.dtb" \ no-obj no-implicit-rule before-depend \ clean "${FDT_DTS_FILE:R}.dtb" From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 22:37:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F86262E; Fri, 28 Feb 2014 22:37:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7BBB910BE; Fri, 28 Feb 2014 22:37:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SMbehD020116; Fri, 28 Feb 2014 22:37:40 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SMbe8e020115; Fri, 28 Feb 2014 22:37:40 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402282237.s1SMbe8e020115@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Feb 2014 22:37:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262627 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 22:37:40 -0000 Author: imp Date: Fri Feb 28 22:37:40 2014 New Revision: 262627 URL: http://svnweb.freebsd.org/changeset/base/262627 Log: Fix syntax errors (missing ;) that bsdl dtc was tolerant of, but gpl dtc isn't. Modified: head/sys/boot/fdt/dts/arm/imx6.dtsi Modified: head/sys/boot/fdt/dts/arm/imx6.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/imx6.dtsi Fri Feb 28 22:37:35 2014 (r262626) +++ head/sys/boot/fdt/dts/arm/imx6.dtsi Fri Feb 28 22:37:40 2014 (r262627) @@ -99,7 +99,7 @@ reg = <0x020c8000 0x1000>; interrupt-parent = <&gic>; interrupts = <49>; - } + }; gpt: timer@02098000 { compatible = "fsl,imx6q-gpt", "fsl,imx51-gpt"; @@ -343,7 +343,7 @@ ocotp0: ocotp@021bc000 { compatible = "fsl,imx6q-ocotp"; reg = <0x021bc000 0x4000>; - } + }; }; }; }; From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 22:37:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E27062B; Fri, 28 Feb 2014 22:37:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4A96710BD; Fri, 28 Feb 2014 22:37:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SMbaTr020063; Fri, 28 Feb 2014 22:37:36 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SMbaH0020062; Fri, 28 Feb 2014 22:37:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402282237.s1SMbaH0020062@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Feb 2014 22:37:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262626 - head/sys/tools/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 22:37:36 -0000 Author: imp Date: Fri Feb 28 22:37:35 2014 New Revision: 262626 URL: http://svnweb.freebsd.org/changeset/base/262626 Log: Use proper include path for dtc as well as cpp. Modified: head/sys/tools/fdt/make_dtb.sh (contents, props changed) Modified: head/sys/tools/fdt/make_dtb.sh ============================================================================== --- head/sys/tools/fdt/make_dtb.sh Fri Feb 28 22:06:19 2014 (r262625) +++ head/sys/tools/fdt/make_dtb.sh Fri Feb 28 22:37:35 2014 (r262626) @@ -8,4 +8,4 @@ dts=$2 dtb=$3 cpp -x assembler-with-cpp -I $S/gnu/dts/include -I $S/boot/fdt/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $dts /dev/null | - dtc -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts -i $S/gnu/dts/${MACHINE} + dtc -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts/${MACHINE} -i $S/gnu/dts/${MACHINE} From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 23:12:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E3B2349; Fri, 28 Feb 2014 23:12:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 29C3713B2; Fri, 28 Feb 2014 23:12:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SNCLAK035452; Fri, 28 Feb 2014 23:12:21 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SNCLoc035451; Fri, 28 Feb 2014 23:12:21 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201402282312.s1SNCLoc035451@svn.freebsd.org> From: Craig Rodrigues Date: Fri, 28 Feb 2014 23:12:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262628 - head/release/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 23:12:21 -0000 Author: rodrigc Date: Fri Feb 28 23:12:20 2014 New Revision: 262628 URL: http://svnweb.freebsd.org/changeset/base/262628 Log: Add a script which lists SVN log entries only for changesets which have files which have been Added or Removed. This can help identify changesets which should be mentioned in Release Engineering's release notes. Added: head/release/scripts/list-new-changesets.py (contents, props changed) Added: head/release/scripts/list-new-changesets.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/scripts/list-new-changesets.py Fri Feb 28 23:12:20 2014 (r262628) @@ -0,0 +1,117 @@ +#!/usr/bin/env python +# +# Copyright (c) 2014, Craig Rodrigues +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice unmodified, this list of conditions, and the following +# disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD$ + +# Display SVN log entries for changesets which have files which were +# Added or Deleted. +# This script takes arguments which would normally be +# passed to the "svn log" command. +# +# Examples: +# +# (1) Display all new changesets in stable/10 branch: +# +# list-new-changesets.py --stop-on-copy \ +# svn://svn.freebsd.org/base/stable/10 +# +# (2) Display all new changesets between r254153 and r261794 in +# stable/9 branch: +# +# list-new-changesets.py -r254153:261794 \ +# svn://svn.freebsd.org/base/stable/9 + +import os +import subprocess +import sys +import xml.etree.ElementTree + +def print_logentry(logentry): + """Print an SVN log entry. + + Take an SVN log entry formatted in XML, and print it out in + plain text. + """ + rev = logentry.attrib['revision'] + author = logentry.find('author').text + date = logentry.find('date').text + msg = logentry.find('msg').text + + print "-" * 71 + print "%s | %s | %s" % (rev, author, date) + print "Changed paths:" + for paths in logentry.findall('paths'): + for path in paths.findall('path'): + print " %s %s" % (path.attrib['action'], path.text) + + print + print msg.encode('utf-8') + +def main(args): + """Main function. + + Take command-line arguments which would be passed to 'svn log'. + Prepend '-v --xml' to get verbose XML formatted output. + Only display entries which have Added or Deleted files. + """ + cmd = ["svn", "log", "-v", "--xml"] + cmd += args[1:] + + print " ".join(cmd) + + proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + (out, err) = proc.communicate() + + if proc.returncode != 0: + print err + sys.exit(proc.returncode) + + displayed_entries = 0 + root = xml.etree.ElementTree.fromstring(out) + + for logentry in root.findall('logentry'): + show_logentry = False + + for paths in logentry.findall('paths'): + for path in paths.findall('path'): + if path.attrib['action'] == 'A': + show_logentry = True + elif path.attrib['action'] == 'D': + show_logentry = True + + if show_logentry == True : + print_logentry(logentry) + displayed_entries += 1 + + if displayed_entries == 0: + print "No changesets with Added or Deleted files" + + if displayed_entries > 0: + print "-" * 71 + + +if __name__ == "__main__": + main(sys.argv) From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 23:48:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D829BFC9; Fri, 28 Feb 2014 23:48:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BEFD116A0; Fri, 28 Feb 2014 23:48:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SNmEIm047776; Fri, 28 Feb 2014 23:48:14 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SNmE3N047772; Fri, 28 Feb 2014 23:48:14 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402282348.s1SNmE3N047772@svn.freebsd.org> From: Xin LI Date: Fri, 28 Feb 2014 23:48:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262629 - in head: contrib/ncurses contrib/ncurses/doc/html contrib/ncurses/form contrib/ncurses/include contrib/ncurses/man contrib/ncurses/menu contrib/ncurses/misc contrib/ncurses/nc... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 23:48:14 -0000 Author: delphij Date: Fri Feb 28 23:48:13 2014 New Revision: 262629 URL: http://svnweb.freebsd.org/changeset/base/262629 Log: MFV r262617: ncurses 5.9. Added: head/contrib/ncurses/README.MinGW - copied unchanged from r262617, vendor/ncurses/dist/README.MinGW head/contrib/ncurses/form/fty_generic.c - copied unchanged from r262617, vendor/ncurses/dist/form/fty_generic.c head/contrib/ncurses/form/llib-lformt - copied unchanged from r262617, vendor/ncurses/dist/form/llib-lformt head/contrib/ncurses/form/llib-lformtw - copied unchanged from r262617, vendor/ncurses/dist/form/llib-lformtw head/contrib/ncurses/include/nc_mingw.h - copied unchanged from r262617, vendor/ncurses/dist/include/nc_mingw.h head/contrib/ncurses/include/ncurses_dll.h.in - copied unchanged from r262617, vendor/ncurses/dist/include/ncurses_dll.h.in head/contrib/ncurses/include/ncurses_mingw.h - copied unchanged from r262617, vendor/ncurses/dist/include/ncurses_mingw.h head/contrib/ncurses/man/MKada_config.in - copied unchanged from r262617, vendor/ncurses/dist/man/MKada_config.in head/contrib/ncurses/man/MKncu_config.in - copied unchanged from r262617, vendor/ncurses/dist/man/MKncu_config.in head/contrib/ncurses/man/curs_sp_funcs.3x - copied unchanged from r262617, vendor/ncurses/dist/man/curs_sp_funcs.3x head/contrib/ncurses/man/curs_variables.3x - copied unchanged from r262617, vendor/ncurses/dist/man/curs_variables.3x head/contrib/ncurses/man/form_variables.3x - copied unchanged from r262617, vendor/ncurses/dist/man/form_variables.3x head/contrib/ncurses/man/tabs.1 - copied unchanged from r262617, vendor/ncurses/dist/man/tabs.1 head/contrib/ncurses/man/term_variables.3x - copied unchanged from r262617, vendor/ncurses/dist/man/term_variables.3x head/contrib/ncurses/menu/llib-lmenut - copied unchanged from r262617, vendor/ncurses/dist/menu/llib-lmenut head/contrib/ncurses/menu/llib-lmenutw - copied unchanged from r262617, vendor/ncurses/dist/menu/llib-lmenutw head/contrib/ncurses/misc/gen-pkgconfig.in - copied unchanged from r262617, vendor/ncurses/dist/misc/gen-pkgconfig.in head/contrib/ncurses/mk-dlls.sh.in - copied unchanged from r262617, vendor/ncurses/dist/mk-dlls.sh.in head/contrib/ncurses/ncurses/base/lib_driver.c - copied unchanged from r262617, vendor/ncurses/dist/ncurses/base/lib_driver.c head/contrib/ncurses/ncurses/build.priv.h - copied unchanged from r262617, vendor/ncurses/dist/ncurses/build.priv.h head/contrib/ncurses/ncurses/llib-lncursestw - copied unchanged from r262617, vendor/ncurses/dist/ncurses/llib-lncursestw head/contrib/ncurses/ncurses/tinfo/make_hash.c - copied unchanged from r262617, vendor/ncurses/dist/ncurses/tinfo/make_hash.c head/contrib/ncurses/ncurses/tinfo/tinfo_driver.c - copied unchanged from r262617, vendor/ncurses/dist/ncurses/tinfo/tinfo_driver.c head/contrib/ncurses/ncurses/wcwidth.h - copied unchanged from r262617, vendor/ncurses/dist/ncurses/wcwidth.h head/contrib/ncurses/ncurses/win32con/ - copied from r262617, vendor/ncurses/dist/ncurses/win32con/ head/contrib/ncurses/panel/llib-lpanelt - copied unchanged from r262617, vendor/ncurses/dist/panel/llib-lpanelt head/contrib/ncurses/panel/llib-lpaneltw - copied unchanged from r262617, vendor/ncurses/dist/panel/llib-lpaneltw head/contrib/ncurses/progs/tabs.c - copied unchanged from r262617, vendor/ncurses/dist/progs/tabs.c head/contrib/ncurses/progs/transform.c - copied unchanged from r262617, vendor/ncurses/dist/progs/transform.c Deleted: head/contrib/ncurses/include/ncurses_dll.h head/contrib/ncurses/misc/jpf-indent head/contrib/ncurses/misc/ncu-indent head/contrib/ncurses/mkdirs.sh head/contrib/ncurses/tar-copy.sh Modified: head/contrib/ncurses/ANNOUNCE head/contrib/ncurses/INSTALL head/contrib/ncurses/MANIFEST head/contrib/ncurses/Makefile.in head/contrib/ncurses/NEWS head/contrib/ncurses/TO-DO head/contrib/ncurses/aclocal.m4 head/contrib/ncurses/announce.html.in head/contrib/ncurses/config.guess head/contrib/ncurses/config.sub head/contrib/ncurses/configure head/contrib/ncurses/configure.in head/contrib/ncurses/dist.mk head/contrib/ncurses/doc/html/announce.html head/contrib/ncurses/doc/html/hackguide.html head/contrib/ncurses/doc/html/ncurses-intro.html head/contrib/ncurses/form/Makefile.in head/contrib/ncurses/form/f_trace.c head/contrib/ncurses/form/fld_arg.c head/contrib/ncurses/form/fld_attr.c head/contrib/ncurses/form/fld_current.c head/contrib/ncurses/form/fld_def.c head/contrib/ncurses/form/fld_dup.c head/contrib/ncurses/form/fld_ftchoice.c head/contrib/ncurses/form/fld_ftlink.c head/contrib/ncurses/form/fld_info.c head/contrib/ncurses/form/fld_just.c head/contrib/ncurses/form/fld_link.c head/contrib/ncurses/form/fld_max.c head/contrib/ncurses/form/fld_move.c head/contrib/ncurses/form/fld_newftyp.c head/contrib/ncurses/form/fld_opts.c head/contrib/ncurses/form/fld_pad.c head/contrib/ncurses/form/fld_page.c head/contrib/ncurses/form/fld_stat.c head/contrib/ncurses/form/fld_type.c head/contrib/ncurses/form/fld_user.c head/contrib/ncurses/form/form.h head/contrib/ncurses/form/form.priv.h head/contrib/ncurses/form/frm_cursor.c head/contrib/ncurses/form/frm_data.c head/contrib/ncurses/form/frm_def.c head/contrib/ncurses/form/frm_driver.c head/contrib/ncurses/form/frm_hook.c head/contrib/ncurses/form/frm_opts.c head/contrib/ncurses/form/frm_page.c head/contrib/ncurses/form/frm_post.c head/contrib/ncurses/form/frm_req_name.c head/contrib/ncurses/form/frm_scale.c head/contrib/ncurses/form/frm_sub.c head/contrib/ncurses/form/frm_user.c head/contrib/ncurses/form/frm_win.c head/contrib/ncurses/form/fty_alnum.c head/contrib/ncurses/form/fty_alpha.c head/contrib/ncurses/form/fty_enum.c head/contrib/ncurses/form/fty_int.c head/contrib/ncurses/form/fty_ipv4.c head/contrib/ncurses/form/fty_num.c head/contrib/ncurses/form/fty_regex.c head/contrib/ncurses/form/llib-lform head/contrib/ncurses/form/llib-lformw head/contrib/ncurses/form/modules head/contrib/ncurses/include/Caps head/contrib/ncurses/include/Caps.aix4 head/contrib/ncurses/include/Caps.hpux11 head/contrib/ncurses/include/Caps.keys head/contrib/ncurses/include/Caps.osf1r5 head/contrib/ncurses/include/Caps.uwin head/contrib/ncurses/include/MKterm.h.awk.in head/contrib/ncurses/include/Makefile.in head/contrib/ncurses/include/capdefaults.c head/contrib/ncurses/include/curses.h.in head/contrib/ncurses/include/curses.tail head/contrib/ncurses/include/curses.wide head/contrib/ncurses/include/headers head/contrib/ncurses/include/nc_alloc.h head/contrib/ncurses/include/nc_panel.h head/contrib/ncurses/include/nc_tparm.h head/contrib/ncurses/include/ncurses_defs head/contrib/ncurses/include/term_entry.h head/contrib/ncurses/include/tic.h head/contrib/ncurses/include/unctrl.h.in head/contrib/ncurses/man/Makefile.in head/contrib/ncurses/man/captoinfo.1m head/contrib/ncurses/man/clear.1 head/contrib/ncurses/man/curs_add_wch.3x head/contrib/ncurses/man/curs_add_wchstr.3x head/contrib/ncurses/man/curs_addch.3x head/contrib/ncurses/man/curs_addchstr.3x head/contrib/ncurses/man/curs_addstr.3x head/contrib/ncurses/man/curs_addwstr.3x head/contrib/ncurses/man/curs_attr.3x head/contrib/ncurses/man/curs_beep.3x head/contrib/ncurses/man/curs_bkgd.3x head/contrib/ncurses/man/curs_bkgrnd.3x head/contrib/ncurses/man/curs_border.3x head/contrib/ncurses/man/curs_border_set.3x head/contrib/ncurses/man/curs_clear.3x head/contrib/ncurses/man/curs_color.3x head/contrib/ncurses/man/curs_delch.3x head/contrib/ncurses/man/curs_deleteln.3x head/contrib/ncurses/man/curs_extend.3x head/contrib/ncurses/man/curs_get_wch.3x head/contrib/ncurses/man/curs_get_wstr.3x head/contrib/ncurses/man/curs_getcchar.3x head/contrib/ncurses/man/curs_getch.3x head/contrib/ncurses/man/curs_getstr.3x head/contrib/ncurses/man/curs_getyx.3x head/contrib/ncurses/man/curs_in_wch.3x head/contrib/ncurses/man/curs_in_wchstr.3x head/contrib/ncurses/man/curs_inch.3x head/contrib/ncurses/man/curs_inchstr.3x head/contrib/ncurses/man/curs_initscr.3x head/contrib/ncurses/man/curs_inopts.3x head/contrib/ncurses/man/curs_ins_wch.3x head/contrib/ncurses/man/curs_ins_wstr.3x head/contrib/ncurses/man/curs_insch.3x head/contrib/ncurses/man/curs_insstr.3x head/contrib/ncurses/man/curs_instr.3x head/contrib/ncurses/man/curs_inwstr.3x head/contrib/ncurses/man/curs_kernel.3x head/contrib/ncurses/man/curs_legacy.3x head/contrib/ncurses/man/curs_memleaks.3x head/contrib/ncurses/man/curs_mouse.3x head/contrib/ncurses/man/curs_move.3x head/contrib/ncurses/man/curs_opaque.3x head/contrib/ncurses/man/curs_outopts.3x head/contrib/ncurses/man/curs_overlay.3x head/contrib/ncurses/man/curs_pad.3x head/contrib/ncurses/man/curs_print.3x head/contrib/ncurses/man/curs_printw.3x head/contrib/ncurses/man/curs_refresh.3x head/contrib/ncurses/man/curs_scanw.3x head/contrib/ncurses/man/curs_scr_dump.3x head/contrib/ncurses/man/curs_scroll.3x head/contrib/ncurses/man/curs_slk.3x head/contrib/ncurses/man/curs_termattrs.3x head/contrib/ncurses/man/curs_termcap.3x head/contrib/ncurses/man/curs_terminfo.3x head/contrib/ncurses/man/curs_threads.3x head/contrib/ncurses/man/curs_touch.3x head/contrib/ncurses/man/curs_trace.3x head/contrib/ncurses/man/curs_util.3x head/contrib/ncurses/man/curs_window.3x head/contrib/ncurses/man/default_colors.3x head/contrib/ncurses/man/define_key.3x head/contrib/ncurses/man/form.3x head/contrib/ncurses/man/form_cursor.3x head/contrib/ncurses/man/form_data.3x head/contrib/ncurses/man/form_driver.3x head/contrib/ncurses/man/form_field.3x head/contrib/ncurses/man/form_field_attributes.3x head/contrib/ncurses/man/form_field_buffer.3x head/contrib/ncurses/man/form_field_info.3x head/contrib/ncurses/man/form_field_just.3x head/contrib/ncurses/man/form_field_new.3x head/contrib/ncurses/man/form_field_opts.3x head/contrib/ncurses/man/form_field_userptr.3x head/contrib/ncurses/man/form_field_validation.3x head/contrib/ncurses/man/form_fieldtype.3x head/contrib/ncurses/man/form_hook.3x head/contrib/ncurses/man/form_new.3x head/contrib/ncurses/man/form_new_page.3x head/contrib/ncurses/man/form_opts.3x head/contrib/ncurses/man/form_page.3x head/contrib/ncurses/man/form_post.3x head/contrib/ncurses/man/form_requestname.3x head/contrib/ncurses/man/form_userptr.3x head/contrib/ncurses/man/form_win.3x head/contrib/ncurses/man/infocmp.1m head/contrib/ncurses/man/infotocap.1m head/contrib/ncurses/man/key_defined.3x head/contrib/ncurses/man/keybound.3x head/contrib/ncurses/man/keyok.3x head/contrib/ncurses/man/legacy_coding.3x head/contrib/ncurses/man/man_db.renames head/contrib/ncurses/man/menu.3x head/contrib/ncurses/man/menu_attributes.3x head/contrib/ncurses/man/menu_cursor.3x head/contrib/ncurses/man/menu_driver.3x head/contrib/ncurses/man/menu_format.3x head/contrib/ncurses/man/menu_hook.3x head/contrib/ncurses/man/menu_items.3x head/contrib/ncurses/man/menu_mark.3x head/contrib/ncurses/man/menu_new.3x head/contrib/ncurses/man/menu_opts.3x head/contrib/ncurses/man/menu_pattern.3x head/contrib/ncurses/man/menu_post.3x head/contrib/ncurses/man/menu_requestname.3x head/contrib/ncurses/man/menu_spacing.3x head/contrib/ncurses/man/menu_userptr.3x head/contrib/ncurses/man/menu_win.3x head/contrib/ncurses/man/mitem_current.3x head/contrib/ncurses/man/mitem_name.3x head/contrib/ncurses/man/mitem_new.3x head/contrib/ncurses/man/mitem_opts.3x head/contrib/ncurses/man/mitem_userptr.3x head/contrib/ncurses/man/mitem_value.3x head/contrib/ncurses/man/mitem_visible.3x head/contrib/ncurses/man/ncurses.3x head/contrib/ncurses/man/panel.3x head/contrib/ncurses/man/resizeterm.3x head/contrib/ncurses/man/term.5 head/contrib/ncurses/man/term.7 head/contrib/ncurses/man/terminfo.head head/contrib/ncurses/man/terminfo.tail head/contrib/ncurses/man/tic.1m head/contrib/ncurses/man/toe.1m head/contrib/ncurses/man/tput.1 head/contrib/ncurses/man/tset.1 head/contrib/ncurses/man/wresize.3x head/contrib/ncurses/menu/Makefile.in head/contrib/ncurses/menu/llib-lmenu head/contrib/ncurses/menu/llib-lmenuw head/contrib/ncurses/menu/m_attribs.c head/contrib/ncurses/menu/m_cursor.c head/contrib/ncurses/menu/m_driver.c head/contrib/ncurses/menu/m_format.c head/contrib/ncurses/menu/m_global.c head/contrib/ncurses/menu/m_hook.c head/contrib/ncurses/menu/m_item_cur.c head/contrib/ncurses/menu/m_item_nam.c head/contrib/ncurses/menu/m_item_new.c head/contrib/ncurses/menu/m_item_opt.c head/contrib/ncurses/menu/m_item_top.c head/contrib/ncurses/menu/m_item_use.c head/contrib/ncurses/menu/m_item_val.c head/contrib/ncurses/menu/m_item_vis.c head/contrib/ncurses/menu/m_items.c head/contrib/ncurses/menu/m_new.c head/contrib/ncurses/menu/m_opts.c head/contrib/ncurses/menu/m_pad.c head/contrib/ncurses/menu/m_pattern.c head/contrib/ncurses/menu/m_post.c head/contrib/ncurses/menu/m_req_name.c head/contrib/ncurses/menu/m_scale.c head/contrib/ncurses/menu/m_spacing.c head/contrib/ncurses/menu/m_sub.c head/contrib/ncurses/menu/m_trace.c head/contrib/ncurses/menu/m_userptr.c head/contrib/ncurses/menu/m_win.c head/contrib/ncurses/menu/menu.h head/contrib/ncurses/menu/menu.priv.h head/contrib/ncurses/menu/modules head/contrib/ncurses/misc/Makefile.in head/contrib/ncurses/misc/ncurses-config.in head/contrib/ncurses/misc/run_tic.in head/contrib/ncurses/misc/terminfo.src head/contrib/ncurses/mk-0th.awk head/contrib/ncurses/mk-1st.awk head/contrib/ncurses/mk-hdr.awk head/contrib/ncurses/ncurses/Makefile.in head/contrib/ncurses/ncurses/README head/contrib/ncurses/ncurses/base/MKkeyname.awk head/contrib/ncurses/ncurses/base/MKlib_gen.sh head/contrib/ncurses/ncurses/base/MKunctrl.awk head/contrib/ncurses/ncurses/base/define_key.c head/contrib/ncurses/ncurses/base/key_defined.c head/contrib/ncurses/ncurses/base/keybound.c head/contrib/ncurses/ncurses/base/keyok.c head/contrib/ncurses/ncurses/base/legacy_coding.c head/contrib/ncurses/ncurses/base/lib_addch.c head/contrib/ncurses/ncurses/base/lib_addstr.c head/contrib/ncurses/ncurses/base/lib_beep.c head/contrib/ncurses/ncurses/base/lib_bkgd.c head/contrib/ncurses/ncurses/base/lib_box.c head/contrib/ncurses/ncurses/base/lib_chgat.c head/contrib/ncurses/ncurses/base/lib_clear.c head/contrib/ncurses/ncurses/base/lib_clearok.c head/contrib/ncurses/ncurses/base/lib_clrbot.c head/contrib/ncurses/ncurses/base/lib_clreol.c head/contrib/ncurses/ncurses/base/lib_color.c head/contrib/ncurses/ncurses/base/lib_colorset.c head/contrib/ncurses/ncurses/base/lib_delch.c head/contrib/ncurses/ncurses/base/lib_delwin.c head/contrib/ncurses/ncurses/base/lib_dft_fgbg.c head/contrib/ncurses/ncurses/base/lib_echo.c head/contrib/ncurses/ncurses/base/lib_endwin.c head/contrib/ncurses/ncurses/base/lib_erase.c head/contrib/ncurses/ncurses/base/lib_flash.c head/contrib/ncurses/ncurses/base/lib_freeall.c head/contrib/ncurses/ncurses/base/lib_getch.c head/contrib/ncurses/ncurses/base/lib_getstr.c head/contrib/ncurses/ncurses/base/lib_hline.c head/contrib/ncurses/ncurses/base/lib_immedok.c head/contrib/ncurses/ncurses/base/lib_inchstr.c head/contrib/ncurses/ncurses/base/lib_initscr.c head/contrib/ncurses/ncurses/base/lib_insch.c head/contrib/ncurses/ncurses/base/lib_insdel.c head/contrib/ncurses/ncurses/base/lib_insnstr.c head/contrib/ncurses/ncurses/base/lib_instr.c head/contrib/ncurses/ncurses/base/lib_isendwin.c head/contrib/ncurses/ncurses/base/lib_leaveok.c head/contrib/ncurses/ncurses/base/lib_mouse.c head/contrib/ncurses/ncurses/base/lib_move.c head/contrib/ncurses/ncurses/base/lib_mvwin.c head/contrib/ncurses/ncurses/base/lib_newterm.c head/contrib/ncurses/ncurses/base/lib_newwin.c head/contrib/ncurses/ncurses/base/lib_nl.c head/contrib/ncurses/ncurses/base/lib_overlay.c head/contrib/ncurses/ncurses/base/lib_pad.c head/contrib/ncurses/ncurses/base/lib_printw.c head/contrib/ncurses/ncurses/base/lib_redrawln.c head/contrib/ncurses/ncurses/base/lib_refresh.c head/contrib/ncurses/ncurses/base/lib_restart.c head/contrib/ncurses/ncurses/base/lib_scanw.c head/contrib/ncurses/ncurses/base/lib_screen.c head/contrib/ncurses/ncurses/base/lib_scroll.c head/contrib/ncurses/ncurses/base/lib_scrollok.c head/contrib/ncurses/ncurses/base/lib_scrreg.c head/contrib/ncurses/ncurses/base/lib_set_term.c head/contrib/ncurses/ncurses/base/lib_slk.c head/contrib/ncurses/ncurses/base/lib_slkatr_set.c head/contrib/ncurses/ncurses/base/lib_slkatrof.c head/contrib/ncurses/ncurses/base/lib_slkatron.c head/contrib/ncurses/ncurses/base/lib_slkatrset.c head/contrib/ncurses/ncurses/base/lib_slkattr.c head/contrib/ncurses/ncurses/base/lib_slkclear.c head/contrib/ncurses/ncurses/base/lib_slkcolor.c head/contrib/ncurses/ncurses/base/lib_slkinit.c head/contrib/ncurses/ncurses/base/lib_slklab.c head/contrib/ncurses/ncurses/base/lib_slkrefr.c head/contrib/ncurses/ncurses/base/lib_slkset.c head/contrib/ncurses/ncurses/base/lib_slktouch.c head/contrib/ncurses/ncurses/base/lib_touch.c head/contrib/ncurses/ncurses/base/lib_ungetch.c head/contrib/ncurses/ncurses/base/lib_vline.c head/contrib/ncurses/ncurses/base/lib_wattroff.c head/contrib/ncurses/ncurses/base/lib_wattron.c head/contrib/ncurses/ncurses/base/lib_winch.c head/contrib/ncurses/ncurses/base/lib_window.c head/contrib/ncurses/ncurses/base/nc_panel.c head/contrib/ncurses/ncurses/base/resizeterm.c head/contrib/ncurses/ncurses/base/safe_sprintf.c head/contrib/ncurses/ncurses/base/tries.c head/contrib/ncurses/ncurses/base/use_window.c head/contrib/ncurses/ncurses/base/wresize.c head/contrib/ncurses/ncurses/curses.priv.h head/contrib/ncurses/ncurses/llib-lncurses head/contrib/ncurses/ncurses/llib-lncursest head/contrib/ncurses/ncurses/llib-lncursesw head/contrib/ncurses/ncurses/modules head/contrib/ncurses/ncurses/tinfo/MKcaptab.sh head/contrib/ncurses/ncurses/tinfo/MKcodes.awk head/contrib/ncurses/ncurses/tinfo/MKfallback.sh head/contrib/ncurses/ncurses/tinfo/MKnames.awk head/contrib/ncurses/ncurses/tinfo/access.c head/contrib/ncurses/ncurses/tinfo/add_tries.c head/contrib/ncurses/ncurses/tinfo/alloc_entry.c head/contrib/ncurses/ncurses/tinfo/alloc_ttype.c head/contrib/ncurses/ncurses/tinfo/captoinfo.c head/contrib/ncurses/ncurses/tinfo/comp_expand.c head/contrib/ncurses/ncurses/tinfo/comp_hash.c head/contrib/ncurses/ncurses/tinfo/comp_parse.c head/contrib/ncurses/ncurses/tinfo/comp_scan.c head/contrib/ncurses/ncurses/tinfo/db_iterator.c head/contrib/ncurses/ncurses/tinfo/entries.c head/contrib/ncurses/ncurses/tinfo/free_ttype.c head/contrib/ncurses/ncurses/tinfo/hashed_db.c head/contrib/ncurses/ncurses/tinfo/home_terminfo.c head/contrib/ncurses/ncurses/tinfo/init_keytry.c head/contrib/ncurses/ncurses/tinfo/lib_acs.c head/contrib/ncurses/ncurses/tinfo/lib_baudrate.c head/contrib/ncurses/ncurses/tinfo/lib_cur_term.c head/contrib/ncurses/ncurses/tinfo/lib_data.c head/contrib/ncurses/ncurses/tinfo/lib_has_cap.c head/contrib/ncurses/ncurses/tinfo/lib_kernel.c head/contrib/ncurses/ncurses/tinfo/lib_longname.c head/contrib/ncurses/ncurses/tinfo/lib_napms.c head/contrib/ncurses/ncurses/tinfo/lib_options.c head/contrib/ncurses/ncurses/tinfo/lib_print.c head/contrib/ncurses/ncurses/tinfo/lib_raw.c head/contrib/ncurses/ncurses/tinfo/lib_setup.c head/contrib/ncurses/ncurses/tinfo/lib_termcap.c head/contrib/ncurses/ncurses/tinfo/lib_termname.c head/contrib/ncurses/ncurses/tinfo/lib_ti.c head/contrib/ncurses/ncurses/tinfo/lib_tparm.c head/contrib/ncurses/ncurses/tinfo/lib_tputs.c head/contrib/ncurses/ncurses/tinfo/lib_ttyflags.c head/contrib/ncurses/ncurses/tinfo/make_keys.c head/contrib/ncurses/ncurses/tinfo/name_match.c head/contrib/ncurses/ncurses/tinfo/parse_entry.c head/contrib/ncurses/ncurses/tinfo/read_entry.c head/contrib/ncurses/ncurses/tinfo/read_termcap.c head/contrib/ncurses/ncurses/tinfo/setbuf.c head/contrib/ncurses/ncurses/tinfo/trim_sgr0.c head/contrib/ncurses/ncurses/tinfo/use_screen.c head/contrib/ncurses/ncurses/tinfo/write_entry.c head/contrib/ncurses/ncurses/trace/lib_trace.c head/contrib/ncurses/ncurses/trace/lib_traceatr.c head/contrib/ncurses/ncurses/trace/lib_tracebits.c head/contrib/ncurses/ncurses/trace/lib_tracechr.c head/contrib/ncurses/ncurses/trace/lib_tracedmp.c head/contrib/ncurses/ncurses/trace/lib_tracemse.c head/contrib/ncurses/ncurses/trace/trace_buf.c head/contrib/ncurses/ncurses/trace/trace_tries.c head/contrib/ncurses/ncurses/trace/trace_xnames.c head/contrib/ncurses/ncurses/trace/varargs.c head/contrib/ncurses/ncurses/trace/visbuf.c head/contrib/ncurses/ncurses/tty/MKexpanded.sh head/contrib/ncurses/ncurses/tty/hardscroll.c head/contrib/ncurses/ncurses/tty/hashmap.c head/contrib/ncurses/ncurses/tty/lib_mvcur.c head/contrib/ncurses/ncurses/tty/lib_tstp.c head/contrib/ncurses/ncurses/tty/lib_twait.c head/contrib/ncurses/ncurses/tty/lib_vidattr.c head/contrib/ncurses/ncurses/tty/tty_update.c head/contrib/ncurses/ncurses/widechar/lib_add_wch.c head/contrib/ncurses/ncurses/widechar/lib_box_set.c head/contrib/ncurses/ncurses/widechar/lib_cchar.c head/contrib/ncurses/ncurses/widechar/lib_erasewchar.c head/contrib/ncurses/ncurses/widechar/lib_get_wch.c head/contrib/ncurses/ncurses/widechar/lib_get_wstr.c head/contrib/ncurses/ncurses/widechar/lib_hline_set.c head/contrib/ncurses/ncurses/widechar/lib_in_wch.c head/contrib/ncurses/ncurses/widechar/lib_in_wchnstr.c head/contrib/ncurses/ncurses/widechar/lib_ins_wch.c head/contrib/ncurses/ncurses/widechar/lib_inwstr.c head/contrib/ncurses/ncurses/widechar/lib_pecho_wchar.c head/contrib/ncurses/ncurses/widechar/lib_unget_wch.c head/contrib/ncurses/ncurses/widechar/lib_vid_attr.c head/contrib/ncurses/ncurses/widechar/lib_vline_set.c head/contrib/ncurses/ncurses/widechar/lib_wacs.c head/contrib/ncurses/ncurses/widechar/lib_wunctrl.c head/contrib/ncurses/panel/Makefile.in head/contrib/ncurses/panel/llib-lpanel head/contrib/ncurses/panel/llib-lpanelw head/contrib/ncurses/panel/modules head/contrib/ncurses/panel/p_above.c head/contrib/ncurses/panel/p_below.c head/contrib/ncurses/panel/p_bottom.c head/contrib/ncurses/panel/p_delete.c head/contrib/ncurses/panel/p_hidden.c head/contrib/ncurses/panel/p_hide.c head/contrib/ncurses/panel/p_move.c head/contrib/ncurses/panel/p_new.c head/contrib/ncurses/panel/p_replace.c head/contrib/ncurses/panel/p_show.c head/contrib/ncurses/panel/p_top.c head/contrib/ncurses/panel/p_update.c head/contrib/ncurses/panel/p_user.c head/contrib/ncurses/panel/p_win.c head/contrib/ncurses/panel/panel.c head/contrib/ncurses/panel/panel.h head/contrib/ncurses/panel/panel.priv.h head/contrib/ncurses/progs/Makefile.in head/contrib/ncurses/progs/dump_entry.c head/contrib/ncurses/progs/infocmp.c head/contrib/ncurses/progs/modules head/contrib/ncurses/progs/tic.c head/contrib/ncurses/progs/toe.c head/contrib/ncurses/progs/tput.c head/contrib/ncurses/progs/tset.c head/lib/ncurses/form/Makefile head/lib/ncurses/ncurses/Makefile head/lib/ncurses/ncurses/ncurses_cfg.h Directory Properties: head/contrib/ncurses/ (props changed) Modified: head/contrib/ncurses/ANNOUNCE ============================================================================== --- head/contrib/ncurses/ANNOUNCE Fri Feb 28 23:12:20 2014 (r262628) +++ head/contrib/ncurses/ANNOUNCE Fri Feb 28 23:48:13 2014 (r262629) @@ -1,4 +1,4 @@ - Announcing ncurses 5.7 + Announcing ncurses 5.9 The ncurses (new curses) library is a free software emulation of curses in System V Release 4.0, and more. It uses terminfo format, @@ -27,217 +27,30 @@ Release Notes This release is designed to be upward compatible from ncurses 5.0 - through 5.6; very few applications will require recompilation, + through 5.8; very few applications will require recompilation, depending on the platform. These are the highlights from the - change-log since ncurses 5.6 release. + change-log since ncurses 5.8 release. - Interface changes: - * generate linkable stubs for some macros: - getattrs - - New features and improvements: - * library - + new flavor of the ncurses library provides rudimentary - support for POSIX threads. Several functions are reentrant, - but most require either a window-level or screen-level mutex. - (This is API-compatible, but not ABI-compatible with the - normal library). - + add NCURSES_OPAQUE symbol to curses.h, will use to make - structs opaque in selected configurations. - + add NCURSES_EXT_FUNCS and NCURSES_EXT_COLORS symbols to - curses.h to make it simpler to tell if the extended functions - and/or colors are declared. - + add wresize() to C++ binding - + eliminate fixed-buffer vsprintf() calls in C++ binding. - + add several functions to C++ binding which wrap C functions - that pass a WINDOW* parameter. - + adapt mouse-handling code from menu library in form-library - + improve tracing for form library, showing created forms, - fields, etc. - + make $NCURSES_NO_PADDING feature work for termcap interface . - + add check to trace-file open, if the given name is a - directory, add ".log" to the name and try again. - + several new manpages: curs_legacy.3x, curs_memleaks.3x, - curs_opaque.3x and curs_threads.3x - * programs: - + modified three test-programs to demonstrate the threading - support in this version: ditto, rain, worm. - + several new test-programs: demo_panels, dots_mvcur, - inch_wide, inchs, key_name, key_names, savescreen, - savescreen.sh test_arrays, test_get_wstr, test_getstr, - test_instr, test_inwstr and test_opaque. - + add adacurses-config to the Ada95 install. - + modify tic -f option to format spaces as \s to prevent them - from being lost when that is read back in unformatted - strings. - + The tack program is now distributed separately from ncurses. - * terminal database - + added entries: - o Eterm-256color, Eterm-88color and rxvt-88color - o aterm - o konsole-256color - o mrxvt - o screen.mlterm - o screen.rxvt - o teraterm4.59 is now the primary primary teraterm entry, - renamed original to teraterm2.3 - o 9term terminal - o Newbury Data entries - + updated/improved entries: - o gnome to version 2.22.3 - o h19, z100 - o konsole to version 1.6.6 - o mlterm, mlterm+pcfkeys - o xterm, and building-blocks for function-keys to [3]xterm - patch #230. - - Major bug fixes: - * add logic to tic for cancelling strings in user-defined - capabilities (this is needed for current konsole terminfo entry). - * modify mk-1st.awk so the generated makefile rules for linking or - installing shared libraries do not first remove the library, in - case it is in use, e.g., libncurses.so by /bin/sh. - * correct check for notimeout() in wgetch(). - * fix a sign-extension bug in infocmp's repair_acsc() function. - * change winnstr() to stop at the end of the line. - * make Ada95 demo_panels() example work. - * fix for adding a non-spacing character at the beginning of a line. - * fill in extended-color pair to make colors work for - wide-characters using extended-colors. - * improve refresh of window on top of multi-column characters, - taking into account split characters on left/right window - boundaries. - * modify win_wchnstr() to ensure that only a base cell is returned - for each multi-column character. - * improve waddch() and winsch() handling of EILSEQ from mbrtowc() by - using unctrl() to display illegal bytes rather than trying to - append further bytes to make up a valid sequence. - * restore curs_set() state after endwin()/refresh() - * modify keyname() to use "^X" form only if meta() has been called, - or if keyname() is called without initializing curses, e.g., via - initscr() or newterm(). - * modify unctrl() to check codes in 128-255 range versus isprint(). - If they are not printable, and locale was set, use a "M-" or "~" - sequence. - * improve resizeterm() by moving ripped-off lines, and repainting - the soft-keys. - * modify form library to accept control characters such as newline - in set_field_buffer(), which is compatible with Solaris. - * use NCURSES_MOUSE_MASK() in definition of BUTTON_RELEASE(), etc., - to make those work properly with the --enable-ext-mouse - configuration - * correct some functions in Ada95 binding which were using return - value from C where none was returned. - * reviewed/fixed issues reported by Coverity and Klocwork tools. - - Portability: - * configure script: - + new options: - - --disable-big-strings - control whether static string tables are generated - as single large strings (to improve startup - performance), or as array of individual strings. - - --disable-relink - control whether shared libraries are relinked - (during install) when rpath is enabled. - - --disable-tic-depends - make explicit whether tic library depends on - ncurses/ncursesw library. - - --enable-mixed-case - override the configure script's check if the - filesystem supports mixed-case filenames. This - allows one to control how the terminal database - maps to the filesystem. For filesystems that do not - support mixed-case, the library uses generate - 2-character (hexadecimal) codes for the lower-level - of the filesystem terminfo database - - --enable-reentrant - builds a different flavor of the ncurses library - (ncursest) which improves reentrant use of the - library by reducing global and static variables - (see the "--with-pthread" option for the threaded - support). - - --enable-weak-symbols - use weak-symbols for linking to the POSIX thread - library, and use the same soname for the ncurses - shared library as the normal library (caveat: the - ABI is for the threaded library, which makes global - data accessed via functions). - - --with-pthread - build with the POSIX thread library (tested with - AIX, Linux, FreeBSD, OpenBSD, HPUX, IRIX64, - Solaris, Tru64). - - --with-ticlib - build/install the tic-support functions in a - separate library - - + improved options: - - --enable-ext-colors - requires the wide-character configuration. - - --with-chtype - ignore option value "unsigned" is always added to - the type in curses.h; do the same for - --with-mmask-t. - - --with-dmalloc - build-fix for redefinition of strndup. - - --with-hashed-db - accepts a parameter which is the install-prefix of - a given Berkeley Database. - - --with-hashed-db - the $LIBS environment variable overrides the search - for the db library. - - --without-hashed-db - assumed when "--disable-database" is used. - - * other configure/build issues: - + build-fixes for LynxOS - + modify shared-library rules to allow FreeBSD 3.x to use - rpath. - + build-fix for FreeBSD "contemporary" TTY interface. - + build-fixes for AIX with libtool. - + build-fixes for Darwin and libtool. - + modify BeOS-specific ifdef's to build on Haiku. - + corrected gcc options for building shared libraries on - Solaris and IRIX64. - + change shared-library configuration for OpenBSD, make rpath - work. - + build-fixes for using libutf8, e.g., on OpenBSD 3.7 - + add "-e" option in ncurses/Makefile.in when generating - source-files to force earlier exit if the build environment - fails unexpectedly. - + add support for shared libraries for QNX. - + change delimiter in MKlib_gen.sh from '%' to '@', to avoid - substitution by IBM xlc to '#' as part of its extensions to - digraphs. - * library: - + rewrite wrapper for wcrtomb(), making it work on Solaris. - This is used in the form library to determine the length of - the buffer needed by field_buffer. - + add/use configure script macro CF_SIG_ATOMIC_T, use the - corresponding type for data manipulated by signal handlers. - + set locale in misc/ncurses-config.in since it uses a range - + disable GPM mouse support when $TERM does not happen to - contain "linux", since Gpm_Open() no longer limits its - assertion to terminals that it might handle, e.g., within - "screen" in xterm. - + reset mouse file-descriptor when unloading GPM library. - * test programs: - + update test programs to build/work with various UNIX curses - for comparisons. + This is a bug-fix release, correcting a small number of urgent + problems in the ncurses library from the 5.8 release. + + It also improves the Ada95 binding: + * fixes a longstanding portability problem with its use of the + [3]set_field_type function. Because that function uses + variable-length argument lists, its interface with gnat does not + work with certain platforms. + * improves configurability and portability, particularly when built + separately from the main ncurses tree. The 5.8 release introduced + scripts which can be used to construct separate tarballs for the + Ada95 and ncurses examples. + Those were a proof of concept. For the 5.9 release, those scripts + are augmented with rpm- and dpkg-scripts used in test builds + against a variety of gnat- and system ncurses versions as old as + gnat 3.15 and ncurses 5.4 (see snapshots and systems tested + [4]here. + * additional improvements were made for portability of the ncurses + examples, adding rpm- and dpkg-scripts for test-builds. See + [5]this page for snapshots and other information. Features of Ncurses @@ -274,15 +87,15 @@ * Support for mouse event reporting with X Window xterm and FreeBSD and OS/2 console windows. * Extended mouse support via Alessandro Rubini's gpm package. - * The function wresize() allows you to resize windows, preserving + * The function wresize allows you to resize windows, preserving their data. - * The function use_default_colors() allows you to use the terminal's + * The function use_default_colors allows you to use the terminal's default colors for the default color pair, achieving the effect of transparent colors. - * The functions keyok() and define_key() allow you to better control - the use of function keys, e.g., disabling the ncurses KEY_MOUSE, - or by defining more than one control sequence to map to a given - key code. + * The functions keyok and define_key allow you to better control the + use of function keys, e.g., disabling the ncurses KEY_MOUSE, or by + defining more than one control sequence to map to a given key + code. * Support for 256-color terminals, such as modern xterm, when configured using the --enable-ext-colors option. * Support for 16-color terminals, such as aixterm and modern xterm. @@ -293,7 +106,7 @@ incorporates a novel, simple, and cheap algorithm that enables it to make optimal use of hardware scrolling, line-insertion, and line-deletion for screen-line movements. This algorithm is more - powerful than the 4.4BSD curses quickch() routine. + powerful than the 4.4BSD curses quickch routine. * Real support for terminals with the magic-cookie glitch. The screen-update code will refrain from drawing a highlight if the magic- cookie unattributed spaces required just before the @@ -356,55 +169,55 @@ cdk Curses Development Kit - [4]http://invisible-island.net/cdk/ - [5]http://www.vexus.ca/products/CDK/ + [6]http://invisible-island.net/cdk/ + [7]http://www.vexus.ca/products/CDK/ ded directory-editor - [6]http://invisible-island.net/ded/ + [8]http://invisible-island.net/ded/ dialog the underlying application used in Slackware's setup, and the basis for similar applications on GNU/Linux. - [7]http://invisible-island.net/dialog/ + [9]http://invisible-island.net/dialog/ lynx the character-screen WWW browser - [8]http://lynx.isc.org/release/ + [10]http://lynx.isc.org/release/ Midnight Commander file manager - [9]http://www.ibiblio.org/mc/ + [11]http://www.midnight-commander.org/ mutt mail utility - [10]http://www.mutt.org/ + [12]http://www.mutt.org/ ncftp file-transfer utility - [11]http://www.ncftp.com/ + [13]http://www.ncftp.com/ nvi New vi versions 1.50 are able to use ncurses versions 1.9.7 and later. - [12]http://www.bostic.com/vi/ + [14]https://sites.google.com/a/bostic.com/keithbostic/nvi pinfo Lynx-like info browser. - [13]https://alioth.debian.org/projects/pinfo/ + [15]https://alioth.debian.org/projects/pinfo/ tin - newsreader, supporting color, MIME [14]http://www.tin.org/ + newsreader, supporting color, MIME [16]http://www.tin.org/ as well as some that use ncurses for the terminfo support alone: minicom terminal emulator - [15]http://alioth.debian.org/projects/minicom/ + [17]http://alioth.debian.org/projects/minicom/ vile vi-like-emacs - [16]http://invisible-island.net/vile/ + [18]http://invisible-island.net/vile/ The ncurses distribution includes a selection of test programs (including a few games). @@ -412,11 +225,11 @@ Who's Who and What's What Zeyd Ben-Halim started it from a previous package pcurses, written by - Pavel Curtis. Eric S. Raymond continued development. Jürgen Pfeifer + Pavel Curtis. Eric S. Raymond continued development. Juergen Pfeifer wrote most of the form and menu libraries. Ongoing work is being done - by [17]Thomas Dickey. Thomas Dickey acts as the maintainer for the + by [19]Thomas Dickey. Thomas Dickey acts as the maintainer for the Free Software Foundation, which holds the copyright on ncurses. - Contact the current maintainers at [18]bug-ncurses@gnu.org. + Contact the current maintainers at [20]bug-ncurses@gnu.org. To join the ncurses mailing list, please write email to bug-ncurses-request@gnu.org containing the line: @@ -426,7 +239,7 @@ Who's Who and What's What and testing of this package. Beta versions of ncurses and patches to the current release are made - available at [19]ftp://invisible-island.net/ncurses/ . + available at [21]ftp://invisible-island.net/ncurses/ . Future Plans @@ -440,34 +253,36 @@ Future Plans Other Related Resources The distribution provides a newer version of the terminfo-format - terminal description file once maintained by [20]Eric Raymond . Unlike + terminal description file once maintained by [22]Eric Raymond . Unlike the older version, the termcap and terminfo data are provided in the same file, and provides several user-definable extensions beyond the X/Open specification. You can find lots of information on terminal-related topics not - covered in the terminfo file at [21]Richard Shuford's archive . + covered in the terminfo file at [23]Richard Shuford's archive . References 1. ftp://ftp.gnu.org/gnu/ncurses/ 2. ftp://invisible-island.net/ncurses/ - 3. http://invisible-island.net/xterm/xterm.log.html#xterm_230 - 4. http://invisible-island.net/cdk/ - 5. http://www.vexus.ca/products/CDK/ - 6. http://invisible-island.net/ded/ - 7. http://invisible-island.net/dialog/ - 8. http://lynx.isc.org/release/ - 9. http://www.ibiblio.org/mc/ - 10. http://www.mutt.org/ - 11. http://www.ncftp.com/ - 12. http://www.bostic.com/vi/ - 13. https://alioth.debian.org/projects/pinfo/ - 14. http://www.tin.org/ - 15. http://alioth.debian.org/projects/minicom/ - 16. http://invisible-island.net/vile/ - 17. mailto:dickey@invisible-island.net - 18. mailto:bug-ncurses@gnu.org - 19. ftp://invisible-island.net/ncurses/ - 20. http://www.catb.org/~esr/terminfo/ - 21. http://www.cs.utk.edu/~shuford/terminal_index.html + 3. http://invisible-island.net/ncurses/man/form_fieldtype.3x + 4. http://invisible-island.net/ncurses/ncurses-Ada95.html + 5. http://invisible-island.net/ncurses/ncurses-examples.html + 6. http://invisible-island.net/cdk/ + 7. http://www.vexus.ca/products/CDK/ + 8. http://invisible-island.net/ded/ + 9. http://invisible-island.net/dialog/ + 10. http://lynx.isc.org/release/ + 11. http://www.midnight-commander.org/ + 12. http://www.mutt.org/ + 13. http://www.ncftp.com/ + 14. https://sites.google.com/a/bostic.com/keithbostic/nvi + 15. https://alioth.debian.org/projects/pinfo/ + 16. http://www.tin.org/ + 17. http://alioth.debian.org/projects/minicom/ + 18. http://invisible-island.net/vile/ + 19. mailto:dickey@invisible-island.net + 20. mailto:bug-ncurses@gnu.org + 21. ftp://invisible-island.net/ncurses/ + 22. http://www.catb.org/~esr/terminfo/ + 23. http://web.archive.org/web/*/http://www.cs.utk.edu/~shuford/terminal Modified: head/contrib/ncurses/INSTALL ============================================================================== --- head/contrib/ncurses/INSTALL Fri Feb 28 23:12:20 2014 (r262628) +++ head/contrib/ncurses/INSTALL Fri Feb 28 23:48:13 2014 (r262629) @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: INSTALL,v 1.135 2008/11/02 21:13:51 tom Exp $ +-- $Id: INSTALL,v 1.155 2011/03/31 08:27:24 tom Exp $ --------------------------------------------------------------------- How to install Ncurses/Terminfo on your system --------------------------------------------------------------------- @@ -39,9 +39,8 @@ d.d is the current version number. Ther including `c++', `form', `man', `menu', 'misc', `ncurses', `panel', `progs', and `test'. See the README file for a roadmap to the package. -If you are a Linux or FreeBSD or NetBSD distribution integrator or packager, -please read and act on the section titled IF YOU ARE A SYSTEM INTEGRATOR -below. +If you are a distribution integrator or packager, please read and act on the +section titled IF YOU ARE A SYSTEM INTEGRATOR below. If you are converting from BSD curses and do not have root access, be sure to read the BSD CONVERSION NOTES section below. @@ -58,10 +57,6 @@ CROSS-COMPILER. If you want to build the Ada95 binding, go to the Ada95 directory and follow the instructions there. The Ada95 binding is not covered below. -If you are using anything but (a) Linux, or (b) one of the 4.4BSD-based -i386 Unixes, go read the Portability section in the TO-DO file before you -do anything else. - REQUIREMENTS: ------------ @@ -86,14 +81,14 @@ INSTALLATION PROCEDURE: The --prefix option to configure changes the root directory for installing ncurses. The default is normally in subdirectories of /usr/local, except - for systems where ncurses is normally installed as a system library, e.g., - Linux, the various BSD systems and Cygwin. Use --prefix=/usr to replace - your default curses distribution. + for systems where ncurses is normally installed as a system library (see + "IF YOU ARE A SYSTEM INTEGRATOR"). Use --prefix=/usr to replace your + default curses distribution. The package gets installed beneath the --prefix directory as follows: In $(prefix)/bin: tic, infocmp, captoinfo, tset, - reset, clear, tput, toe + reset, clear, tput, toe, tabs In $(prefix)/lib: libncurses*.* libcurses.a In $(prefix)/share/terminfo: compiled terminal descriptions In $(prefix)/include: C header files @@ -105,12 +100,12 @@ INSTALLATION PROCEDURE: Do not use commands such as - make install prefix=XXX + make install prefix=XXX to change the prefix after configuration, since the prefix value is used for some absolute pathnames such as TERMINFO. Instead do this - make install DESTDIR=XXX + make install DESTDIR=XXX See also the discussion of --with-install-prefix. @@ -147,7 +142,7 @@ INSTALLATION PROCEDURE: library interfaces are not binary-compatible with the non-wide-character version. Building and running the wide-character code relies on a fairly recent implementation of libiconv. We have built this configuration on - Linux using libiconv, sometimes requiring libutf8. + various systems using libiconv, sometimes requiring libutf8. If you configure using the --with-pthread option, a "t" is appended to the library names (e.g., libncursest.a, libncursestw.a). @@ -170,8 +165,8 @@ INSTALLATION PROCEDURE: ./configure --with-shared --without-normal --without-debug Rules for generating shared libraries are highly dependent upon the choice - of host system and compiler. We've been testing shared libraries on Linux - and SunOS with gcc, but more work needs to be done to make shared libraries + of host system and compiler. We've been testing shared libraries on + several systems, but more work needs to be done to make shared libraries work on other systems. If you have libtool installed, you can type @@ -338,6 +333,17 @@ SUMMARY OF CONFIGURE OPTIONS: --disable-largefile Disable compiler flags needed to use large-file interfaces. + --disable-libtool-version + when using --with-libtool, control how the major/minor version numbers + are used for constructing the library name. + + The default uses the -version-number feature of libtool, which makes + the library names compatible (though not identical) with the standard + build using --with-shared. + + Use --disable-libtool-version to use the libtool -version-info feature. + This corresponds to the setting used before patch 20100515. + --disable-leaks For testing, compile-in code that frees memory that normally would not be freed, to simplify analysis of memory-leaks. @@ -389,6 +395,12 @@ SUMMARY OF CONFIGURE OPTIONS: application. These are (for example $TERMINFO) those that allow the search path for the terminfo or termcap entry to be customized. + --disable-rpath-hack + Normally the configure script helps link libraries found in unusual + places by adding an rpath option to the link command. If you are + building packages, this feature may be redundant. Use this option + to suppress the feature. + --disable-scroll-hints Compile without scroll-hints code. This option is ignored when hashmap scrolling is configured, which is the default. @@ -421,7 +433,7 @@ SUMMARY OF CONFIGURE OPTIONS: changes several data references to functions to work around this problem. - NOTE: With ncurses 5.1, this may not be necessary, since we are + NOTE: With ncurses 5.1, this may not be necessary, since we are told that some linkers interpret uninitialized global data as a different type of reference which behaves as described above. We have explicitly initialized all of the global data to work around the @@ -450,7 +462,7 @@ SUMMARY OF CONFIGURE OPTIONS: warning. There will still be warnings due to subtle inconsistencies in the interface, but at a lower level. - NOTE: configuring ncurses with this option may detract from the + NOTE: configuring ncurses with this option may detract from the portability of your applications by encouraging you to use const in places where the XSI curses interface would not allow them. Similar issues arise when porting to SVr4 curses, which uses const in even @@ -471,7 +483,7 @@ SUMMARY OF CONFIGURE OPTIONS: encoded. This applies only to the wide-character (--enable-widec) configuration. - NOTE: using this option will make libraries which are not binary- + NOTE: using this option will make libraries which are not binary- compatible with libncursesw 5.4. None of the interfaces change, but applications which have an array of cchar_t's must be recompiled. @@ -480,7 +492,7 @@ SUMMARY OF CONFIGURE OPTIONS: That allows one to use ncurses with a wheel mouse with xterm or similar X terminal emulators. - NOTE: using this option will make libraries which are not binary- + NOTE: using this option will make libraries which are not binary- compatible with libncursesw 5.4. None of the interfaces change, but applications which have mouse mask mmask_t's must be recompiled. @@ -500,7 +512,7 @@ SUMMARY OF CONFIGURE OPTIONS: --enable-getcap-cache Cache translated termcaps under the directory $HOME/.terminfo - NOTE: this sounds good - it makes ncurses run faster the second time. + NOTE: this sounds good - it makes ncurses run faster the second time. But look where the data comes from - an /etc/termcap containing lots of entries that are not up to date. If you configure with this option and forget to install the terminfo database before running an ncurses @@ -513,6 +525,10 @@ SUMMARY OF CONFIGURE OPTIONS: may not be accurate, or that your stty settings have disabled the use of tabs. + --enable-interop + Compile-in experimental interop bindings. These provide generic types + for the form-library. + --enable-mixed-case Controls whether the filesystem on which the terminfo database resides supports mixed-case filenames (normal for UNIX, but not on other @@ -525,6 +541,15 @@ SUMMARY OF CONFIGURE OPTIONS: terminfo entries. This is the default, unless you have disabled the extended functions. + --enable-pc-files + If pkg-config is found (see --with-pkg-config), generate ".pc" files + for each of the libraries, and install them in pkg-config's library + directory. + + --enable-pthreads-eintr + add logic in threaded configuration to ensure that a read(2) system + call can be interrupted for SIGWINCH. + --enable-reentrant Compile experimental configuration which improves reentrant use of the library by reducing global and static variables. This option is also @@ -565,6 +590,11 @@ SUMMARY OF CONFIGURE OPTIONS: is not strictly compatible. This option allows one to implement this alteration without patching the source code. + --enable-sp-funcs + Compile-in support for extended functions which accept a SCREEN pointer, + reducing the need for juggling the global SP value with set_term() and + delscreen(). + --enable-symlinks If your system supports symbolic links, make tic use symbolic links rather than hard links to save diskspace when writing aliases in the @@ -576,6 +606,11 @@ SUMMARY OF CONFIGURE OPTIONS: capabilities as user-defined strings. This option is the default, unless you have disabled the extended functions. + --enable-term-driver + Enable experimental terminal-driver. This is currently used for the + MinGW port, by providing a way to substitute the low-level terminfo + library with different terminal drivers. + --enable-termcap Compile in support for reading terminal descriptions from termcap if no match is found in the terminfo database. See also the --enable-getcap @@ -630,12 +665,23 @@ SUMMARY OF CONFIGURE OPTIONS: --with-ada-objects=DIR Tell where to install the Ada objects (default: PREFIX/lib/ada/adalib) + --with-ada-sharedlib + Build a shared library for Ada95 binding, if the compiler permits. + + NOTE: You must also set the --with-shared option on some platforms + for a successful build. You need not use this option when you set + --with-shared, unless you want to use the Ada shared library. + --with-bool=TYPE If --without-cxx is specified, override the type used for the "bool" declared in curses.h (normally the type is automatically chosen to correspond with that in , or defaults to platform-specific sizes). + --with-build-cpp=XXX + This option is provided by the same macro used for $BUILD_CC, etc., + but is not directly used by ncurses. + --with-build-cc=XXX If cross-compiling, specify a host C compiler, which is needed to compile a few utilities which generate source modules for ncurses. @@ -682,12 +728,17 @@ SUMMARY OF CONFIGURE OPTIONS: to use a terminfo database which is compatible with the native applications. + --with-ccharw-max=XXX + Override the size of the wide-character array in cchar_t structures. + Changing this will alter the binary interface. This defaults to 5. + --with-chtype=TYPE Override type of chtype, which stores the video attributes and (if --enable-widec is not given) a character. Prior to ncurses 5.5, this was always unsigned long, but with ncurses 5.5, it may be unsigned. Use this option if you need to preserve compatibility with 64-bit - executables. + executables, e.g., by setting "--with-chtype=long" (the configure + script supplies "unsigned"). --with-database=XXX Specify the terminfo source file to install. Usually you will wish @@ -719,7 +770,7 @@ SUMMARY OF CONFIGURE OPTIONS: use Alessandro Rubini's GPM library to provide mouse support on the Linux console. Prior to ncurses 5.5, this introduced a dependency on the GPM library. - + Currently ncurses uses the dlsym() function to bind to the library at runtime, so it is only necessary that the library be present when ncurses is built, to obtain the filename (or soname) used in the @@ -736,7 +787,7 @@ SUMMARY OF CONFIGURE OPTIONS: Use a hashed database for storing terminfo data rather than storing each compiled entry in a separate binary file within a directory tree. - + In particular, this uses the Berkeley database 1.8.5 interface, as provided by that and its successors db 2, 3, and 4. The actual interface is slightly different in the successor versions of the @@ -770,7 +821,7 @@ SUMMARY OF CONFIGURE OPTIONS: make install DESTDIR=XXX since the makefiles pass that variable to subordinate makes. - NOTE: a few systems build shared libraries with fixed pathnames; this + NOTE: a few systems build shared libraries with fixed pathnames; this option probably will not work for those configurations. --with-libtool[=XXX] @@ -807,9 +858,9 @@ SUMMARY OF CONFIGURE OPTIONS: --with-manpage-renames=XXX Tell the configure script that you wish to rename the manpages while - installing. Currently the only distribution which does this is - the Linux Debian. The option value specifies the name of a file - that lists the renamed files, e.g., $srcdir/man/man_db.renames + installing. Currently the only distribution which does this is Debian. + The option value specifies the name of a file that lists the renamed + files, e.g., $srcdir/man/man_db.renames --with-manpage-symlinks Tell the configure script that you wish to make symbolic links in the @@ -850,6 +901,9 @@ SUMMARY OF CONFIGURE OPTIONS: those using termcap, do not use the higher speeds. Your application (or system, in general) may or may not. + --with-pkg-config=[DIR] + Check for pkg-config, optionally specifying its path. + --with-profile Generate profile-libraries These are named by adding "_p" to the root, e.g., libncurses_p.a @@ -873,7 +927,7 @@ SUMMARY OF CONFIGURE OPTIONS: which you are building, typically using a ".so" suffix, along with symbolic links that refer to the release version. - NOTE: Unless you override the configure script by setting the $CFLAGS + NOTE: Unless you override the configure script by setting the $CFLAGS environment variable, these will not be built with the -g debugging option. @@ -885,7 +939,11 @@ SUMMARY OF CONFIGURE OPTIONS: loads the system's copy of the ncurses shared libraries. In that case, using the misc/shlib script may be helpful, since it sets $LD_LIBRARY_PATH to point to the build tree, e.g., - ./misc/shlib make install + ./misc/shlib make install + + NOTE: If you use the --with-ada-sharedlib option, you should also + set this option, to ensure that C-language modules needed for the + Ada binding use appropriate compiler options. --with-shlib-version=XXX Specify whether to use the release or ABI version for shared libraries. @@ -946,6 +1004,17 @@ SUMMARY OF CONFIGURE OPTIONS: For testing, compile with debug option. This also sets the --disable-leaks option. + --with-wrap-prefix=XXX + When using the --enable-reentrant option, ncurses redefines variables + that would be global in curses, e.g., LINES, as a macro that calls a + "wrapping" function which fetches the data from the current SCREEN + structure. Normally that function is named by prepending "_nc_" to the + variable's name. The function is technically private (since portable + applications would not refer directly to it). But according to one + line of reasoning, it is not the same type of "private" as functions + which applications should not call even via a macro. This configure + option lets you choose the prefix for these wrapped variables. + --without-ada Suppress the configure script's check for Ada95, do not build the Ada95 binding and related demo. @@ -975,11 +1044,18 @@ SUMMARY OF CONFIGURE OPTIONS: --without-dlsym Do not use dlsym() to load GPM dynamically. + --without-manpages + Tell the configure script to suppress the install of ncurses' manpages. + --without-progs Tell the configure script to suppress the build of ncurses' application programs (e.g., tic). The test applications will still be built if you type "make", though not if you simply do "make install". + --without-tests + Tell the configure script to suppress the build of ncurses' test + programs. + --without-xterm-new Tell the configure script to use "xterm-old" for the entry used in the terminfo database. This will work with variations such as @@ -1001,6 +1077,60 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCU you may encounter when building a system with different versions of ncurses: + 5.8 (Feb 26, 2011) + Interface changes: + + + add an alternate library configuration, i.e., "terminal driver" to + support port to Windows, built with MinGW. There are two drivers + (terminfo and Windows console). The terminfo driver works on other + platforms. + + + add a new set of functions which accept a SCREEN* parameter, in + contrast with the original set which use the global value "sp". + By default, these names end with "_sp", and are otherwise + functionally identical with the originals. + + In addition to the "_sp" functions, there are a few new functions + associated with this feature: ceiling_panel, ground_panel, + new_prescr. + + If the library is not built with the sp-funcs extension, there + are no related interface changes. + + + add tiparm function based on review of X/Open Curses Issue 7. + + + change internal _nc_has_mouse function to public has_mouse function + + Added extensions: + + + add a few more functions to support the NCURSES_OPAQUE feature: + get_escdelay, is_pad, is_subwin + + Added internal functions (other than "_sp" variants): + _nc_curscr_of + _nc_format_slks + _nc_get_alias_table + _nc_get_hash_info + _nc_insert_wch + _nc_newscr_of + _nc_outc_wrapper + _nc_retrace_char + _nc_retrace_int_attr_t + _nc_retrace_mmask_t + _nc_setup_tinfo + _nc_stdscr_of + _nc_tinfo_cmdch + + Removed internal functions: + _nc_makenew (some configurations replace by _nc_makenew_sp) + + Modified internal functions: + _nc_UpdateAttrs + _nc_get_hash_table + _nc_has_mouse + _nc_insert_ch + _nc_wgetch + 5.7 (November 2, 2008) Interface changes: @@ -1011,7 +1141,7 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCU of the ncurses library used for the tic program as well as some others such as tack. There is no API change, but makefiles would be changed to use the tic-library built separately. - + tack, distributed separately from ncurses, uses some of the internal _nc_XXX functions, which are declared in the tic.h header file. @@ -1158,7 +1288,7 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCU still used in this release to allow compiling with not-so-old compilers. - + form and menu libraries now work with wide-character data. + + form and menu libraries now work with wide-character data. Applications which bypassed the form library and manipulated the FIELD.buf data directly will not work properly with libformw, since that no longer points to an array of char. The set_field_buffer() @@ -1438,8 +1568,8 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCU 4.0 (December 24, 1996) - We bumped to version 4.0 because the newly released dynamic loader - (ld.so.1.8.5) on Linux did not load shared libraries whose ABI and REL + We bumped to version 4.0 because the newly released Linux dynamic + loader (ld.so.1.8.5) did not load shared libraries whose ABI and REL versions were inconsistent. At that point, ncurses ABI was 3.4 and the REL was 1.9.9g, so we made them consistent. @@ -1496,10 +1626,10 @@ IF YOU ARE A SYSTEM INTEGRATOR: Configuration and Installation: - On platforms where ncurses is assumed to be installed in /usr/lib, + On platforms where ncurses is assumed to be installed in /usr/lib, the configure script uses "/usr" as a default: - Linux, FreeBSD, NetBSD, OpenBSD, Cygwin + GNU/Linux, FreeBSD, NetBSD, OpenBSD, Cygwin For other platforms, the default is "/usr/local". See the discussion of the "--disable-overwrite" option. @@ -1562,7 +1692,7 @@ IF YOU ARE A SYSTEM INTEGRATOR: bsdos -- BSD/OS If you are responsible for integrating ncurses for one of these - distribution, please either use the recommended name or get back + distributions, please either use the recommended name or get back to us explaining why you don't want to, so we can work out nomenclature that will make users' lives easier rather than harder. @@ -1584,7 +1714,8 @@ CONFIGURING FALLBACK ENTRIES: tree is accessible (that is, in single-user mode or at OS installation time) the ncurses library can be compiled to include an array of pre-fetched fallback entries. This must be done on a machine which - has ncurses' infocmp and terminfo database installed. + has ncurses' infocmp and terminfo database installed (as well as + ncurses' tic and infocmp programs). These entries are checked by setupterm() only when the conventional fetches from the terminfo tree and the termcap fallback (if configured) @@ -1689,8 +1820,8 @@ USING NCURSES WITH AFS: with this by making tic use symbolic links. USING NCURSES WITH GPM: - Ncurses 4.1 and up can be configured to use GPM (General Purpose - Mouse) which is used on Linux console. Be aware that GPM is commonly + Ncurses 4.1 and up can be configured to use GPM (General Purpose Mouse) + which is used with Linux console. Be aware that GPM is commonly installed as a shared library which contains a wrapper for the curses wgetch() function (libcurses.o). Some integrators have simplified linking applications by combining all or part of libcurses.so into the @@ -1735,6 +1866,10 @@ BUILDING NCURSES WITH A CROSS-COMPILER option), ncurses uses the development platform's tic to do the "make install.data" portion. + The system's tic program is used to install the terminal database, + even for cross-compiles. For best results, the tic program should + be from the most current version of ncurses. + BUGS: Send any feedback to the ncurses mailing list at bug-ncurses@gnu.org. To subscribe send mail to Modified: head/contrib/ncurses/MANIFEST ============================================================================== --- head/contrib/ncurses/MANIFEST Fri Feb 28 23:12:20 2014 (r262628) +++ head/contrib/ncurses/MANIFEST Fri Feb 28 23:48:13 2014 (r262629) @@ -3,6 +3,10 @@ ./Ada95/Makefile.in ./Ada95/README ./Ada95/TODO +./Ada95/aclocal.m4 +./Ada95/configure +./Ada95/configure.in +./Ada95/doc/Makefile.in ./Ada95/gen/Makefile.in ./Ada95/gen/adacurses-config.in ./Ada95/gen/gen.c @@ -23,6 +27,21 @@ ./Ada95/gen/terminal_interface-curses-trace.ads.m4 ./Ada95/gen/terminal_interface-curses.adb.m4 ./Ada95/gen/terminal_interface-curses.ads.m4 +./Ada95/include/MKncurses_def.sh +./Ada95/include/Makefile.in +./Ada95/include/ncurses_cfg.hin +./Ada95/include/ncurses_defs +./Ada95/make-tar.sh +./Ada95/mk-1st.awk +./Ada95/package/AdaCurses-doc.spec +./Ada95/package/AdaCurses.spec +./Ada95/package/debian/compat +./Ada95/package/debian/control +./Ada95/package/debian/copyright +./Ada95/package/debian/docs +./Ada95/package/debian/rules +./Ada95/package/debian/source/format +./Ada95/package/debian/watch ./Ada95/samples/Makefile.in ./Ada95/samples/README ./Ada95/samples/explain.txt @@ -109,6 +128,11 @@ ./Ada95/samples/tour.adb ./Ada95/samples/tour.ads ./Ada95/src/Makefile.in +./Ada95/src/c_varargs_to_ada.c +./Ada95/src/c_varargs_to_ada.h +./Ada95/src/library.gpr +./Ada95/src/modules +./Ada95/src/ncurses_compat.c ./Ada95/src/terminal_interface-curses-aux.adb ./Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb ./Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads @@ -172,6 +196,7 @@ ./Makefile.os2 ./NEWS ./README +./README.MinGW *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Feb 28 23:52:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5A74270; Fri, 28 Feb 2014 23:52:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D24421729; Fri, 28 Feb 2014 23:52:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1SNqCup051013; Fri, 28 Feb 2014 23:52:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1SNqCdT051012; Fri, 28 Feb 2014 23:52:12 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402282352.s1SNqCdT051012@svn.freebsd.org> From: Xin LI Date: Fri, 28 Feb 2014 23:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262630 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 23:52:13 -0000 Author: delphij Date: Fri Feb 28 23:52:12 2014 New Revision: 262630 URL: http://svnweb.freebsd.org/changeset/base/262630 Log: Bump __FreeBSD_version after import of ncurses 5.9. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Feb 28 23:48:13 2014 (r262629) +++ head/sys/sys/param.h Fri Feb 28 23:52:12 2014 (r262630) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100009 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100010 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 00:02:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AB4983A; Sat, 1 Mar 2014 00:02:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 36F1B1823; Sat, 1 Mar 2014 00:02:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2102Ajj055731; Sat, 1 Mar 2014 00:02:10 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2102A1k055730; Sat, 1 Mar 2014 00:02:10 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403010002.s2102A1k055730@svn.freebsd.org> From: Adrian Chadd Date: Sat, 1 Mar 2014 00:02:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262632 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 00:02:10 -0000 Author: adrian Date: Sat Mar 1 00:02:09 2014 New Revision: 262632 URL: http://svnweb.freebsd.org/changeset/base/262632 Log: Remove now dead code. Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sat Mar 1 00:01:40 2014 (r262631) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sat Mar 1 00:02:09 2014 (r262632) @@ -653,16 +653,6 @@ ar8327_port_init(struct arswitch_softc * else if (port == 6) t = sc->ar8327.port6_status; else -#if 0 - /* XXX DB120 - hard-code port0 to 1000/full */ - if (port == 0) { - t = AR8X16_PORT_STS_SPEED_1000; - t |= AR8X16_PORT_STS_TXMAC | AR8X16_PORT_STS_RXMAC; - t |= AR8X16_PORT_STS_DUPLEX; - t |= AR8X16_PORT_STS_RXFLOW; - t |= AR8X16_PORT_STS_TXFLOW; - } else -#endif t = AR8X16_PORT_STS_LINK_AUTO; arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_STATUS(port), t); From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 00:11:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61995E3D; Sat, 1 Mar 2014 00:11:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4E17118F0; Sat, 1 Mar 2014 00:11:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s210BkUL060514; Sat, 1 Mar 2014 00:11:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s210BkkO060513; Sat, 1 Mar 2014 00:11:46 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403010011.s210BkkO060513@svn.freebsd.org> From: Adrian Chadd Date: Sat, 1 Mar 2014 00:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262634 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 00:11:46 -0000 Author: adrian Date: Sat Mar 1 00:11:45 2014 New Revision: 262634 URL: http://svnweb.freebsd.org/changeset/base/262634 Log: Be paranoid about bit operations here. Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchreg.h Sat Mar 1 00:09:36 2014 (r262633) +++ head/sys/dev/etherswitch/arswitch/arswitchreg.h Sat Mar 1 00:11:45 2014 (r262634) @@ -296,7 +296,7 @@ */ /* XXX Linux define compatibility stuff */ -#define BITM(_count) ((1 << _count) - 1) +#define BITM(_count) ((1UL << _count) - 1) #define BITS(_shift, _count) (BITM(_count) << _shift) #define AR934X_REG_OPER_MODE0 0x04 From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 00:27:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24584593; Sat, 1 Mar 2014 00:27:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EBAED19F7; Sat, 1 Mar 2014 00:27:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s210R9i0065872; Sat, 1 Mar 2014 00:27:09 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s210R9Pb065871; Sat, 1 Mar 2014 00:27:09 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403010027.s210R9Pb065871@svn.freebsd.org> From: Xin LI Date: Sat, 1 Mar 2014 00:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262637 - head/contrib/ncurses X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 00:27:10 -0000 Author: delphij Date: Sat Mar 1 00:27:09 2014 New Revision: 262637 URL: http://svnweb.freebsd.org/changeset/base/262637 Log: Note in mergeinfo to mark all ncurses revisions as merged. Modified: Directory Properties: head/contrib/ncurses/ (props changed) From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 01:04:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8633351C; Sat, 1 Mar 2014 01:04:25 +0000 (UTC) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EE8A51CCB; Sat, 1 Mar 2014 01:04:24 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id s210nKXl059973; Fri, 28 Feb 2014 17:49:20 -0700 (MST) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id s210nKPp059972; Fri, 28 Feb 2014 17:49:20 -0700 (MST) (envelope-from ken) Date: Fri, 28 Feb 2014 17:49:20 -0700 From: "Kenneth D. Merry" To: Alexander Motin Subject: Re: svn commit: r262575 - head/sys/dev/mps Message-ID: <20140301004920.GA59925@nargothrond.kdm.org> References: <201402272148.s1RLmYVS094638@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201402272148.s1RLmYVS094638@svn.freebsd.org> User-Agent: Mutt/1.4.2i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 01:04:25 -0000 On Thu, Feb 27, 2014 at 21:48:34 +0000, Alexander Motin wrote: > Author: mav > Date: Thu Feb 27 21:48:34 2014 > New Revision: 262575 > URL: http://svnweb.freebsd.org/changeset/base/262575 > > Log: > Restore SIM freeze/release match, broken at r253549. > > This fixes problem with SIM left in frozen state after reinit, for example, > after firmware update. Oops! Thanks for fixing it! Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 02:57:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB159C6C; Sat, 1 Mar 2014 02:57:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A6AE61618; Sat, 1 Mar 2014 02:57:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s212vMmS025873; Sat, 1 Mar 2014 02:57:22 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s212vMEY025872; Sat, 1 Mar 2014 02:57:22 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403010257.s212vMEY025872@svn.freebsd.org> From: Adrian Chadd Date: Sat, 1 Mar 2014 02:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262642 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 02:57:22 -0000 Author: adrian Date: Sat Mar 1 02:57:22 2014 New Revision: 262642 URL: http://svnweb.freebsd.org/changeset/base/262642 Log: Add the bluetooth information structs to the firmware RX statistics message. It turns out that there's a variant format of the RX statisitcs notification from the intel firmware. It's even more whacked - the non-BT variant has bluetooth fields; apparently some later NICs return even _more_ bluetooth related fields. I'll commit the statistics structure changes here - it's a no-op for the driver. I'll later teach the driver code to populate a statistics structure from the received message after reformatting things correctly. I don't _think_ it's going to fix anything related to sensitivity programming as the CCK/OFDM (non-11n) fields are in the same place for both formats. But the HT structure and the general statistics aren't in the same place. I'll go find some NIC(s) that spit out the other format and when I find one, I'll go and update the driver to handle things correctly. Tested: * Intel 5100 (which returns the legacy, non-BT format) Obtained from: Linux iwlwifi Modified: head/sys/dev/iwn/if_iwnreg.h Modified: head/sys/dev/iwn/if_iwnreg.h ============================================================================== --- head/sys/dev/iwn/if_iwnreg.h Sat Mar 1 00:42:13 2014 (r262641) +++ head/sys/dev/iwn/if_iwnreg.h Sat Mar 1 02:57:22 2014 (r262642) @@ -1509,7 +1509,7 @@ struct iwn_rx_ht_phy_stats { uint32_t good_ampdu_crc32; uint32_t ampdu; uint32_t fragment; - uint32_t reserved; + uint32_t unsupport_mcs; } __packed; struct iwn_rx_stats { @@ -1519,6 +1519,20 @@ struct iwn_rx_stats { struct iwn_rx_ht_phy_stats ht; } __packed; +struct iwn_rx_general_stats_bt { + struct iwn_rx_general_stats common; + /* additional stats for bt */ + uint32_t num_bt_kills; + uint32_t reserved[2]; +} __packed; + +struct iwn_rx_stats_bt { + struct iwn_rx_phy_stats ofdm; + struct iwn_rx_phy_stats cck; + struct iwn_rx_general_stats_bt general_bt; + struct iwn_rx_ht_phy_stats ht; +} __packed; + struct iwn_tx_stats { uint32_t preamble; uint32_t rx_detected; @@ -1544,15 +1558,21 @@ struct iwn_tx_stats { uint32_t underrun; uint32_t bt_ht_kill; uint32_t rx_ba_resp; - uint32_t reserved[2]; + /* + * 6000 series only - LSB=ant A, ant B, ant C, MSB=reserved + * TX power on chain in 1/2 dBm. + */ + uint32_t tx_power; + uint32_t reserved[1]; } __packed; struct iwn_general_stats { - uint32_t temp; - uint32_t temp_m; + uint32_t temp; /* radio temperature */ + uint32_t temp_m; /* radio voltage */ uint32_t burst_check; uint32_t burst; - uint32_t reserved1[4]; + uint32_t wait_for_silence_timeout_cnt; + uint32_t reserved1[3]; uint32_t sleep; uint32_t slot_out; uint32_t slot_idle; @@ -1563,7 +1583,11 @@ struct iwn_general_stats { uint32_t probe; uint32_t reserved2[2]; uint32_t rx_enabled; - uint32_t reserved3[3]; + /* + * This is the number of times we have to re-tune + * in order to get out of bad PHY status. + */ + uint32_t num_of_sos_states; } __packed; struct iwn_stats { @@ -1571,8 +1595,30 @@ struct iwn_stats { struct iwn_rx_stats rx; struct iwn_tx_stats tx; struct iwn_general_stats general; + uint32_t reserved1[2]; } __packed; +struct iwn_bt_activity_stats { + /* Tx statistics */ + uint32_t hi_priority_tx_req_cnt; + uint32_t hi_priority_tx_denied_cnt; + uint32_t lo_priority_tx_req_cnt; + uint32_t lo_priority_tx_denied_cnt; + /* Rx statistics */ + uint32_t hi_priority_rx_req_cnt; + uint32_t hi_priority_rx_denied_cnt; + uint32_t lo_priority_rx_req_cnt; + uint32_t lo_priority_rx_denied_cnt; +} __packed; + +struct iwn_stats_bt { + uint32_t flags; + struct iwn_rx_stats_bt rx_bt; + struct iwn_tx_stats tx; + struct iwn_general_stats general; + struct iwn_bt_activity_stats activity; + uint32_t reserved1[2]; +}; /* Firmware error dump. */ struct iwn_fw_dump { From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 03:17:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8ABAC869; Sat, 1 Mar 2014 03:17:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6A84718A9; Sat, 1 Mar 2014 03:17:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s213Hl9F034940; Sat, 1 Mar 2014 03:17:47 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s213Hl1w034937; Sat, 1 Mar 2014 03:17:47 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403010317.s213Hl1w034937@svn.freebsd.org> From: Eitan Adler Date: Sat, 1 Mar 2014 03:17:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262645 - head/usr.bin/ssh-copy-id X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 03:17:47 -0000 Author: eadler Date: Sat Mar 1 03:17:46 2014 New Revision: 262645 URL: http://svnweb.freebsd.org/changeset/base/262645 Log: ssh-copy-id: avoid sending private keys; add -v option To help avoid confusion: when attempting to send a key file check to see if a file of the same name exists with a '.pub' suffix and send that instead. This mimics the behavior of other ssh-copy-id scripts. Add -v passthrough. Reported by: dweimer Reported by: feld MFC After: 1 week Modified: head/usr.bin/ssh-copy-id/ssh-copy-id.1 head/usr.bin/ssh-copy-id/ssh-copy-id.sh Modified: head/usr.bin/ssh-copy-id/ssh-copy-id.1 ============================================================================== --- head/usr.bin/ssh-copy-id/ssh-copy-id.1 Sat Mar 1 03:11:26 2014 (r262644) +++ head/usr.bin/ssh-copy-id/ssh-copy-id.1 Sat Mar 1 03:17:46 2014 (r262645) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 11, 2012 +.Dd Feburary 28, 2014 .Dt SSH-COPY-ID 1 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd copy public keys to a remote host .Sh SYNOPSIS .Nm -.Op Fl l +.Op Fl lv .Op Fl i Ar keyfile .Op Fl o Ar option .Op Fl p Ar port @@ -48,12 +48,14 @@ file (creating the file and directory, i The following options are available: .Bl -tag -width indent .It Fl i Ar file -Copy the key contained in +Copy the public key contained in .Ar file . This option can be specified multiple times and can be combined with the .Fl l option. +If a private key is specified and a public key is found then the public key +will be used. .It Fl l Copy the keys currently held by .Xr ssh-agent 1 . @@ -67,6 +69,9 @@ This option can be specified multiple ti .It Fl p Ar port Connect to the specified port on the remote host instead of the default. +.It Fl v +Pass -v to +.Xr ssh 1 . .El .Pp The remaining arguments are a list of remote hosts to connect to, Modified: head/usr.bin/ssh-copy-id/ssh-copy-id.sh ============================================================================== --- head/usr.bin/ssh-copy-id/ssh-copy-id.sh Sat Mar 1 03:11:26 2014 (r262644) +++ head/usr.bin/ssh-copy-id/ssh-copy-id.sh Sat Mar 1 03:17:46 2014 (r262645) @@ -28,7 +28,7 @@ # $FreeBSD$ usage() { - echo "usage: ssh-copy-id [-l] [-i keyfile] [-o option] [-p port] [user@]hostname" >&2 + echo "usage: ssh-copy-id [-lv] [-i keyfile] [-o option] [-p port] [user@]hostname" >&2 exit 1 } @@ -64,11 +64,13 @@ options="" IFS=$nl -while getopts 'i:lo:p:' arg; do +while getopts 'i:lo:p:v' arg; do case $arg in i) hasarg="x" - if [ -r "$OPTARG" ]; then + if [ -r "${OPTARG}.pub" ]; then + keys="$(cat -- "${OPTARG}.pub")$nl$keys" + elif [ -r "$OPTARG" ]; then keys="$(cat -- "$OPTARG")$nl$keys" else echo "File $OPTARG not found" >&2 @@ -85,6 +87,9 @@ while getopts 'i:lo:p:' arg; do o) options=$options$nl-o$nl$OPTARG ;; + v) + options="$options$nl-v" + ;; *) usage ;; From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 03:17:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 634439A4; Sat, 1 Mar 2014 03:17:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4272318AC; Sat, 1 Mar 2014 03:17:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s213Hxcd034997; Sat, 1 Mar 2014 03:17:59 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s213Hx74034996; Sat, 1 Mar 2014 03:17:59 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201403010317.s213Hx74034996@svn.freebsd.org> From: Neel Natu Date: Sat, 1 Mar 2014 03:17:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262646 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 03:17:59 -0000 Author: neel Date: Sat Mar 1 03:17:58 2014 New Revision: 262646 URL: http://svnweb.freebsd.org/changeset/base/262646 Log: Fix a race between VMRUN() and vcpu_notify_event() due to 'vcpu->hostcpu' being updated outside of the vcpu_lock(). The race is benign and could potentially result in a missed notification about a pending interrupt to a vcpu. The interrupt would not be lost but rather delayed until the next VM exit. The vcpu's hostcpu is now updated concurrently with the vcpu state change. When the vcpu transitions to the RUNNING state the hostcpu is set to 'curcpu'. It is set to 'NOCPU' in all other cases. Reviewed by: grehan Modified: head/sys/amd64/vmm/vmm.c Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Sat Mar 1 03:17:46 2014 (r262645) +++ head/sys/amd64/vmm/vmm.c Sat Mar 1 03:17:58 2014 (r262646) @@ -870,6 +870,14 @@ vcpu_set_state_locked(struct vcpu *vcpu, "vcpu idle state")); } + if (vcpu->state == VCPU_RUNNING) { + KASSERT(vcpu->hostcpu == curcpu, ("curcpu %d and hostcpu %d " + "mismatch for running vcpu", curcpu, vcpu->hostcpu)); + } else { + KASSERT(vcpu->hostcpu == NOCPU, ("Invalid hostcpu %d for a " + "vcpu that is not running", vcpu->hostcpu)); + } + /* * The following state transitions are allowed: * IDLE -> FROZEN -> IDLE @@ -894,6 +902,11 @@ vcpu_set_state_locked(struct vcpu *vcpu, return (EBUSY); vcpu->state = newstate; + if (newstate == VCPU_RUNNING) + vcpu->hostcpu = curcpu; + else + vcpu->hostcpu = NOCPU; + if (newstate == VCPU_IDLE) wakeup(&vcpu->state); @@ -1152,9 +1165,7 @@ restart: restore_guest_fpustate(vcpu); vcpu_require_state(vm, vcpuid, VCPU_RUNNING); - vcpu->hostcpu = curcpu; error = VMRUN(vm->cookie, vcpuid, rip, pmap, &vm->rendezvous_func); - vcpu->hostcpu = NOCPU; vcpu_require_state(vm, vcpuid, VCPU_FROZEN); save_guest_fpustate(vcpu); @@ -1548,19 +1559,28 @@ vcpu_notify_event(struct vm *vm, int vcp vcpu_lock(vcpu); hostcpu = vcpu->hostcpu; - if (hostcpu == NOCPU) { - if (vcpu->state == VCPU_SLEEPING) - wakeup_one(vcpu); - } else { - if (vcpu->state != VCPU_RUNNING) - panic("invalid vcpu state %d", vcpu->state); + if (vcpu->state == VCPU_RUNNING) { + KASSERT(hostcpu != NOCPU, ("vcpu running on invalid hostcpu")); if (hostcpu != curcpu) { - if (lapic_intr) + if (lapic_intr) { vlapic_post_intr(vcpu->vlapic, hostcpu, vmm_ipinum); - else + } else { ipi_cpu(hostcpu, vmm_ipinum); + } + } else { + /* + * If the 'vcpu' is running on 'curcpu' then it must + * be sending a notification to itself (e.g. SELF_IPI). + * The pending event will be picked up when the vcpu + * transitions back to guest context. + */ } + } else { + KASSERT(hostcpu == NOCPU, ("vcpu state %d not consistent " + "with hostcpu %d", vcpu->state, hostcpu)); + if (vcpu->state == VCPU_SLEEPING) + wakeup_one(vcpu); } vcpu_unlock(vcpu); } From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 03:36:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3397DD17; Sat, 1 Mar 2014 03:36:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1FB991A1F; Sat, 1 Mar 2014 03:36:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s213akRr042621; Sat, 1 Mar 2014 03:36:46 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s213akr5042620; Sat, 1 Mar 2014 03:36:46 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403010336.s213akr5042620@svn.freebsd.org> From: Eitan Adler Date: Sat, 1 Mar 2014 03:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262647 - head/usr.bin/ssh-copy-id X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 03:36:47 -0000 Author: eadler Date: Sat Mar 1 03:36:46 2014 New Revision: 262647 URL: http://svnweb.freebsd.org/changeset/base/262647 Log: ssh-copy-id: add restorecon call In certain situations when creating an authorized_key file on a Linux machine restorecon(1) may need to be called. Therefore, attempt to run it if it exists. MFC After: 1 week Idea from: https://bugzilla.redhat.com/show_bug.cgi?id=739989 Modified: head/usr.bin/ssh-copy-id/ssh-copy-id.sh Modified: head/usr.bin/ssh-copy-id/ssh-copy-id.sh ============================================================================== --- head/usr.bin/ssh-copy-id/ssh-copy-id.sh Sat Mar 1 03:17:58 2014 (r262646) +++ head/usr.bin/ssh-copy-id/ssh-copy-id.sh Sat Mar 1 03:36:46 2014 (r262647) @@ -46,6 +46,9 @@ sendkey() { printf "$alg $key $comment\n" >> "$keyfile" ; \ fi ; \ done \ + if [ -x /sbin/restorecon ]; then \ + /sbin/restorecon -F "$HOME/.ssh/" "$keyfile" >/dev/null 2>&1 || true ; \ + fi '\' } From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 10:04:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A53EF876; Sat, 1 Mar 2014 10:04:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 87BC810E1; Sat, 1 Mar 2014 10:04:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s21A4V3L097198; Sat, 1 Mar 2014 10:04:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s21A4VTM097197; Sat, 1 Mar 2014 10:04:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403011004.s21A4VTM097197@svn.freebsd.org> From: Adrian Chadd Date: Sat, 1 Mar 2014 10:04:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262653 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 10:04:31 -0000 Author: adrian Date: Sat Mar 1 10:04:31 2014 New Revision: 262653 URL: http://svnweb.freebsd.org/changeset/base/262653 Log: (I think!) make the AR8327 switch correctly handle traffic. This patch does four things: * it globally disables mirroring; * it globally sets the mirroring on each port to be disabled; * the initial port setup now programs a portmask for the port to allow transmission (forwarding) to all other ports bar itself; * the vlan setup path now programs the portmask for the port to allow transmission (forwarding) to all other ports bar itself. Before this, I hard-coded the portmask to 0x3f which would mean all ports (bar port 6, which currently isn't hooked up to anything.) This means that traffic would be duplicated back out the port it received it. I bet this wasn't .. optimal. In any case, this _seems_ to make DHCP from my macosx laptop work through this access point. I'll do some further testing to ensure it's actually working correctly on all my devices. Tested: * DB120, AR8327 switch Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sat Mar 1 04:49:55 2014 (r262652) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sat Mar 1 10:04:31 2014 (r262653) @@ -665,8 +665,19 @@ ar8327_port_init(struct arswitch_softc * t = AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH << AR8327_PORT_VLAN1_OUT_MODE_S; arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_VLAN1(port), t); + /* + * This doesn't configure any ports which this port can "see". + * bits 0-6 control which ports a frame coming into this port + * can be sent out to. + * + * So by doing this, we're making it impossible to send frames out + * to that port. + */ t = AR8327_PORT_LOOKUP_LEARN; t |= AR8X16_PORT_CTRL_STATE_FORWARD << AR8327_PORT_LOOKUP_STATE_S; + + /* So this allows traffic to any port except ourselves */ + t |= (0x3f & ~(1 << port)); arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_LOOKUP(port), t); } @@ -695,6 +706,13 @@ ar8327_reset_vlans(struct arswitch_softc uint32_t mode, t; /* + * Disable mirroring. + */ + arswitch_modifyreg(sc->sc_dev, AR8327_REG_FWD_CTRL0, + AR8327_FWD_CTRL0_MIRROR_PORT, + (0xF << AR8327_FWD_CTRL0_MIRROR_PORT_S)); + + /* * For now, let's default to one portgroup, just so traffic * flows. All ports can see other ports. */ @@ -713,13 +731,25 @@ ar8327_reset_vlans(struct arswitch_softc /* Set ingress = out_keep; members = 0x3f for all ports */ - t = 0x3f; /* all ports */ + t = (0x3f & ~(1 << i)); /* all ports besides us */ t |= AR8327_PORT_LOOKUP_LEARN; /* in_port_only, forward */ t |= AR8X16_PORT_VLAN_MODE_PORT_ONLY << AR8327_PORT_LOOKUP_IN_MODE_S; t |= AR8X16_PORT_CTRL_STATE_FORWARD << AR8327_PORT_LOOKUP_STATE_S; arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_LOOKUP(i), t); + + /* + * Disable port mirroring entirely. + */ + arswitch_modifyreg(sc->sc_dev, + AR8327_REG_PORT_LOOKUP(i), + AR8327_PORT_LOOKUP_ING_MIRROR_EN, + 0); + arswitch_modifyreg(sc->sc_dev, + AR8327_REG_PORT_HOL_CTRL1(i), + AR8327_PORT_HOL_CTRL1_EG_MIRROR_EN, + 0); } } From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 10:09:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E5673DE; Sat, 1 Mar 2014 10:09:02 +0000 (UTC) Received: from mail-qc0-x22e.google.com (mail-qc0-x22e.google.com [IPv6:2607:f8b0:400d:c01::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0A57311A4; Sat, 1 Mar 2014 10:09:01 +0000 (UTC) Received: by mail-qc0-f174.google.com with SMTP id x13so1863733qcv.5 for ; Sat, 01 Mar 2014 02:09:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=rIBG4NnJbjitu2ANnds16OpaloT8ioy0z3Bhz2Hbo9M=; b=IzpJR4+HLgTeC9MuqDh7kuVNbu40GvqmUoo1EE8OYn4bUZEHgbHF4X0rxze8+odaWJ 2g2jq3RpTQjWdysTGDEAyyMz0e66fNLKrf5JZbY8zJ6a7+riz53QSER4UMmiT5MM30+D F6z1XM2skj28KCsQeAJOoAd/fPyo5qw5yxb+CWKYCdGZWm7oMkDFscur7M2ZkQRML9Ej Ed+cpx3B8QyuGsoVuQmhOK/jIcetAk5K+n14g1HQgaeKE5j3oqVzlbKefiTOJWjGAnAV zXXcXTZfqbDd5Nh0nJXO1H5fZ7F6tQlBRnMZ01A+r58QMX9W1mMNF0OVyHb2MnTyW6++ kzfg== MIME-Version: 1.0 X-Received: by 10.224.57.142 with SMTP id c14mr9954341qah.55.1393668541141; Sat, 01 Mar 2014 02:09:01 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.16.10 with HTTP; Sat, 1 Mar 2014 02:09:01 -0800 (PST) In-Reply-To: <201403011004.s21A4VTM097197@svn.freebsd.org> References: <201403011004.s21A4VTM097197@svn.freebsd.org> Date: Sat, 1 Mar 2014 02:09:01 -0800 X-Google-Sender-Auth: y4cR7jigE4n74azcSYRXdwbkK5Y Message-ID: Subject: Re: svn commit: r262653 - head/sys/dev/etherswitch/arswitch From: Adrian Chadd To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 10:09:02 -0000 Source: OpenWRT; much reading of the AR8327 datasheet. -a On 1 March 2014 02:04, Adrian Chadd wrote: > Author: adrian > Date: Sat Mar 1 10:04:31 2014 > New Revision: 262653 > URL: http://svnweb.freebsd.org/changeset/base/262653 > > Log: > (I think!) make the AR8327 switch correctly handle traffic. > > This patch does four things: > > * it globally disables mirroring; > * it globally sets the mirroring on each port to be disabled; > * the initial port setup now programs a portmask for the port to allow > transmission (forwarding) to all other ports bar itself; > * the vlan setup path now programs the portmask for the port to > allow transmission (forwarding) to all other ports bar itself. > > Before this, I hard-coded the portmask to 0x3f which would mean all > ports (bar port 6, which currently isn't hooked up to anything.) > This means that traffic would be duplicated back out the port it > received it. I bet this wasn't .. optimal. > > In any case, this _seems_ to make DHCP from my macosx laptop > work through this access point. I'll do some further testing > to ensure it's actually working correctly on all my devices. > > Tested: > > * DB120, AR8327 switch > > Modified: > head/sys/dev/etherswitch/arswitch/arswitch_8327.c > > Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c > ============================================================================== > --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sat Mar 1 04:49:55 2014 (r262652) > +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sat Mar 1 10:04:31 2014 (r262653) > @@ -665,8 +665,19 @@ ar8327_port_init(struct arswitch_softc * > t = AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH << AR8327_PORT_VLAN1_OUT_MODE_S; > arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_VLAN1(port), t); > > + /* > + * This doesn't configure any ports which this port can "see". > + * bits 0-6 control which ports a frame coming into this port > + * can be sent out to. > + * > + * So by doing this, we're making it impossible to send frames out > + * to that port. > + */ > t = AR8327_PORT_LOOKUP_LEARN; > t |= AR8X16_PORT_CTRL_STATE_FORWARD << AR8327_PORT_LOOKUP_STATE_S; > + > + /* So this allows traffic to any port except ourselves */ > + t |= (0x3f & ~(1 << port)); > arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_LOOKUP(port), t); > } > > @@ -695,6 +706,13 @@ ar8327_reset_vlans(struct arswitch_softc > uint32_t mode, t; > > /* > + * Disable mirroring. > + */ > + arswitch_modifyreg(sc->sc_dev, AR8327_REG_FWD_CTRL0, > + AR8327_FWD_CTRL0_MIRROR_PORT, > + (0xF << AR8327_FWD_CTRL0_MIRROR_PORT_S)); > + > + /* > * For now, let's default to one portgroup, just so traffic > * flows. All ports can see other ports. > */ > @@ -713,13 +731,25 @@ ar8327_reset_vlans(struct arswitch_softc > > /* Set ingress = out_keep; members = 0x3f for all ports */ > > - t = 0x3f; /* all ports */ > + t = (0x3f & ~(1 << i)); /* all ports besides us */ > t |= AR8327_PORT_LOOKUP_LEARN; > > /* in_port_only, forward */ > t |= AR8X16_PORT_VLAN_MODE_PORT_ONLY << AR8327_PORT_LOOKUP_IN_MODE_S; > t |= AR8X16_PORT_CTRL_STATE_FORWARD << AR8327_PORT_LOOKUP_STATE_S; > arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_LOOKUP(i), t); > + > + /* > + * Disable port mirroring entirely. > + */ > + arswitch_modifyreg(sc->sc_dev, > + AR8327_REG_PORT_LOOKUP(i), > + AR8327_PORT_LOOKUP_ING_MIRROR_EN, > + 0); > + arswitch_modifyreg(sc->sc_dev, > + AR8327_REG_PORT_HOL_CTRL1(i), > + AR8327_PORT_HOL_CTRL1_EG_MIRROR_EN, > + 0); > } > } > > From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 13:23:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28F68F65; Sat, 1 Mar 2014 13:23:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 145B715AC; Sat, 1 Mar 2014 13:23:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s21DNqQu077261; Sat, 1 Mar 2014 13:23:52 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s21DNqoM077260; Sat, 1 Mar 2014 13:23:52 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201403011323.s21DNqoM077260@svn.freebsd.org> From: Tijl Coosemans Date: Sat, 1 Mar 2014 13:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262655 - head/lib/libiconv_modules/VIQR X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 13:23:53 -0000 Author: tijl Date: Sat Mar 1 13:23:52 2014 New Revision: 262655 URL: http://svnweb.freebsd.org/changeset/base/262655 Log: Silence the gcc warning about unsigned comparison with 0 in a different way because mnemonic_ext_size isn't a preprocessor macro. MFC after: 3 days Modified: head/lib/libiconv_modules/VIQR/citrus_viqr.c Modified: head/lib/libiconv_modules/VIQR/citrus_viqr.c ============================================================================== --- head/lib/libiconv_modules/VIQR/citrus_viqr.c Sat Mar 1 13:00:40 2014 (r262654) +++ head/lib/libiconv_modules/VIQR/citrus_viqr.c Sat Mar 1 13:23:52 2014 (r262655) @@ -456,8 +456,8 @@ _citrus_VIQR_encoding_module_init(_VIQRE return (errnum); } } -#if mnemonic_ext_size > 0 - for (i = 0; i < mnemonic_ext_size; ++i) { + /* a + 1 < b + 1 here to silence gcc warning about unsigned < 0. */ + for (i = 0; i + 1 < mnemonic_ext_size + 1; ++i) { const mnemonic_def_t *p; p = &mnemonic_ext[i]; @@ -471,7 +471,6 @@ _citrus_VIQR_encoding_module_init(_VIQRE return (errnum); } } -#endif return (0); } From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 16:06:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CAFA3A2; Sat, 1 Mar 2014 16:06:52 +0000 (UTC) Received: from mail-ie0-x22c.google.com (mail-ie0-x22c.google.com [IPv6:2607:f8b0:4001:c03::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 75F4C16FC; Sat, 1 Mar 2014 16:06:52 +0000 (UTC) Received: by mail-ie0-f172.google.com with SMTP id as1so4150131iec.17 for ; Sat, 01 Mar 2014 08:06:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=5LJSXkZy60JAMQyWAddDlVjeOSZ1H9YI1S7PQMJFrZ4=; b=IcDm0pgNIhzTQm1VgnPAuvstcf8YHSjjyiwOJs6ggrt2+tvf1hn2d/900Xkgg6Dt4T FsTmjf889YleL8or/qM+OoqKU8Dy4/i10ayd3mu+1dI2UEoDkq1432IUQWGlcpxJAYTB pd2aAPoqk0aHLiL5WrrxNzgQKXk8p814Q6mzR/cs5YWlHThTp5r4cblgn6iocOgmA3n9 9sUq2ljJdjhdpjbk3V0JGQvu7GMfOUUuLiUnAEHX3/AfNHY+mhrbB9VHz1gEMTMVjxKo oTUntiiDdNd3voddJaEwhsXWVX0SF/Z2SfObcY5iuglL/5dqzogqd8WYE7BIcH5yXvj3 oFNw== X-Received: by 10.42.65.73 with SMTP id k9mr17636755ici.44.1393690011839; Sat, 01 Mar 2014 08:06:51 -0800 (PST) Received: from raichu (198-84-185-216.cpe.teksavvy.com. [198.84.185.216]) by mx.google.com with ESMTPSA id v2sm19193179igk.7.2014.03.01.08.06.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Mar 2014 08:06:51 -0800 (PST) Sender: Mark Johnston Date: Sat, 1 Mar 2014 11:06:48 -0500 From: Mark Johnston To: src-committers@freebsd.org Subject: Re: svn commit: r262542 - in head: cddl/lib/libdtrace sys/cddl/contrib/opensolaris/uts/intel/dtrace sys/cddl/dev/dtrace/amd64 sys/cddl/dev/dtrace/i386 sys/cddl/dev/dtrace/x86 sys/modules/dtrace/dtrace Message-ID: <20140301160648.GB97155@raichu> References: <201402270104.s1R14ZCB007699@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201402270104.s1R14ZCB007699@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, lwhsu@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 16:06:52 -0000 On Thu, Feb 27, 2014 at 01:04:35AM +0000, Mark Johnston wrote: > Author: markj > Date: Thu Feb 27 01:04:35 2014 > New Revision: 262542 > URL: http://svnweb.freebsd.org/changeset/base/262542 > > Log: > Move some files that are identical on i386 and amd64 to an x86 subdirectory > rather than keeping duplicate copies. > > Discussed with: avg > MFC after: 1 week > > Added: > head/sys/cddl/dev/dtrace/x86/ > head/sys/cddl/dev/dtrace/x86/dis_tables.c > - copied unchanged from r262521, head/sys/cddl/dev/dtrace/amd64/dis_tables.c > head/sys/cddl/dev/dtrace/x86/dis_tables.h > - copied unchanged from r262521, head/sys/cddl/dev/dtrace/amd64/dis_tables.h > head/sys/cddl/dev/dtrace/x86/regset.h > - copied unchanged from r262521, head/sys/cddl/dev/dtrace/amd64/regset.h > Deleted: > head/sys/cddl/dev/dtrace/amd64/dis_tables.c > head/sys/cddl/dev/dtrace/amd64/dis_tables.h > head/sys/cddl/dev/dtrace/amd64/regset.h > head/sys/cddl/dev/dtrace/i386/dis_tables.c > head/sys/cddl/dev/dtrace/i386/dis_tables.h > head/sys/cddl/dev/dtrace/i386/regset.h > Modified: > head/cddl/lib/libdtrace/Makefile > head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c > head/sys/modules/dtrace/dtrace/Makefile This appears to have broken the ability to build dtrace.ko from sys/modules/dtrace/dtrace since I've added a file named "x86" to make's search path. Then kmod.mk decides that it doesn't need to create a symlink to sys/x86/include in the object directory, which breaks the build. The patch here fixes the problem by using an explicit path to the symlink. Would anyone be able to review it? http://people.freebsd.org/~lwhsu/patch/kmod.mk.diff Thanks, -Mark From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 16:07:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0076E2B5; Sat, 1 Mar 2014 16:07:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DD7D51702; Sat, 1 Mar 2014 16:07:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s21G7HTA041948; Sat, 1 Mar 2014 16:07:17 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s21G7HrZ041947; Sat, 1 Mar 2014 16:07:17 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403011607.s21G7HrZ041947@svn.freebsd.org> From: Dimitry Andric Date: Sat, 1 Mar 2014 16:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262657 - head/usr.bin/clang/lldb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 16:07:18 -0000 Author: dim Date: Sat Mar 1 16:07:17 2014 New Revision: 262657 URL: http://svnweb.freebsd.org/changeset/base/262657 Log: Apply fix for lldb not linking after the sparc backend import. Reported by: se Pointy hat to: dim Modified: head/usr.bin/clang/lldb/Makefile Modified: head/usr.bin/clang/lldb/Makefile ============================================================================== --- head/usr.bin/clang/lldb/Makefile Sat Mar 1 14:44:55 2014 (r262656) +++ head/usr.bin/clang/lldb/Makefile Sat Mar 1 16:07:17 2014 (r262657) @@ -116,6 +116,12 @@ LIBDEPS=\ llvmexecutionengine \ llvmcodegen \ llvmscalaropts \ + llvmsparcdisassembler \ + llvmsparccodegen \ + llvmsparcasmparser \ + llvmsparcdesc \ + llvmsparcinfo \ + llvmsparcinstprinter \ llvmarminfo \ llvmarminstprinter \ llvmmcparser \ From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 17:06:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01047628; Sat, 1 Mar 2014 17:06:10 +0000 (UTC) Received: from mail-qa0-x22d.google.com (mail-qa0-x22d.google.com [IPv6:2607:f8b0:400d:c00::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8B5FD1AEF; Sat, 1 Mar 2014 17:06:10 +0000 (UTC) Received: by mail-qa0-f45.google.com with SMTP id hw13so1907196qab.4 for ; Sat, 01 Mar 2014 09:06:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=wznJxKKPA5MEVsJvNfIp+bqBjR80u8bP0n98A6qeBQE=; b=0zdTXnGBpKln83Oc74HyU8ie1Apz9s2ZiR67VaA1y5r3DUO989olMAKL0pPLEGxDrT EHCUc3IxCmMdxeFrFDYgVlgMveosDSEtTsXrRSuRoz/ASUulCOIhjXIQ95LERT3731l4 MPJnmp/bS0wRIN6oC5V1T7pd6DktRKD8KTiL5XATZBJO79K2PijmWiZVK9FWgJ1xvePi a82dB3z1Qoh096IB0Odav0mTdD7oQr5va83aaSfTLOHhU1N0dP1q0UmJi3ZdcNF0wa3L 1+GCqELHBsluqHFt9YJR57KbDv9TouFOU7ZfKTA/sobJLgtMglkOc1N8fdO09busAZuI GTJw== MIME-Version: 1.0 X-Received: by 10.224.11.136 with SMTP id t8mr12239715qat.26.1393693569687; Sat, 01 Mar 2014 09:06:09 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.16.10 with HTTP; Sat, 1 Mar 2014 09:06:09 -0800 (PST) In-Reply-To: <201403011004.s21A4VTM097197@svn.freebsd.org> References: <201403011004.s21A4VTM097197@svn.freebsd.org> Date: Sat, 1 Mar 2014 09:06:09 -0800 X-Google-Sender-Auth: 1cyq9Nwdhuq1igwy4WyIE8d5woQ Message-ID: Subject: Re: svn commit: r262653 - head/sys/dev/etherswitch/arswitch From: Adrian Chadd To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 17:06:11 -0000 ... still doesn't correctly switch traffic in all instances. I'm not sure why; I'll go do some more digging. -a On 1 March 2014 02:04, Adrian Chadd wrote: > Author: adrian > Date: Sat Mar 1 10:04:31 2014 > New Revision: 262653 > URL: http://svnweb.freebsd.org/changeset/base/262653 > > Log: > (I think!) make the AR8327 switch correctly handle traffic. > > This patch does four things: > > * it globally disables mirroring; > * it globally sets the mirroring on each port to be disabled; > * the initial port setup now programs a portmask for the port to allow > transmission (forwarding) to all other ports bar itself; > * the vlan setup path now programs the portmask for the port to > allow transmission (forwarding) to all other ports bar itself. > > Before this, I hard-coded the portmask to 0x3f which would mean all > ports (bar port 6, which currently isn't hooked up to anything.) > This means that traffic would be duplicated back out the port it > received it. I bet this wasn't .. optimal. > > In any case, this _seems_ to make DHCP from my macosx laptop > work through this access point. I'll do some further testing > to ensure it's actually working correctly on all my devices. > > Tested: > > * DB120, AR8327 switch > > Modified: > head/sys/dev/etherswitch/arswitch/arswitch_8327.c > > Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c > ============================================================================== > --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sat Mar 1 04:49:55 2014 (r262652) > +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sat Mar 1 10:04:31 2014 (r262653) > @@ -665,8 +665,19 @@ ar8327_port_init(struct arswitch_softc * > t = AR8327_PORT_VLAN1_OUT_MODE_UNTOUCH << AR8327_PORT_VLAN1_OUT_MODE_S; > arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_VLAN1(port), t); > > + /* > + * This doesn't configure any ports which this port can "see". > + * bits 0-6 control which ports a frame coming into this port > + * can be sent out to. > + * > + * So by doing this, we're making it impossible to send frames out > + * to that port. > + */ > t = AR8327_PORT_LOOKUP_LEARN; > t |= AR8X16_PORT_CTRL_STATE_FORWARD << AR8327_PORT_LOOKUP_STATE_S; > + > + /* So this allows traffic to any port except ourselves */ > + t |= (0x3f & ~(1 << port)); > arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_LOOKUP(port), t); > } > > @@ -695,6 +706,13 @@ ar8327_reset_vlans(struct arswitch_softc > uint32_t mode, t; > > /* > + * Disable mirroring. > + */ > + arswitch_modifyreg(sc->sc_dev, AR8327_REG_FWD_CTRL0, > + AR8327_FWD_CTRL0_MIRROR_PORT, > + (0xF << AR8327_FWD_CTRL0_MIRROR_PORT_S)); > + > + /* > * For now, let's default to one portgroup, just so traffic > * flows. All ports can see other ports. > */ > @@ -713,13 +731,25 @@ ar8327_reset_vlans(struct arswitch_softc > > /* Set ingress = out_keep; members = 0x3f for all ports */ > > - t = 0x3f; /* all ports */ > + t = (0x3f & ~(1 << i)); /* all ports besides us */ > t |= AR8327_PORT_LOOKUP_LEARN; > > /* in_port_only, forward */ > t |= AR8X16_PORT_VLAN_MODE_PORT_ONLY << AR8327_PORT_LOOKUP_IN_MODE_S; > t |= AR8X16_PORT_CTRL_STATE_FORWARD << AR8327_PORT_LOOKUP_STATE_S; > arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_LOOKUP(i), t); > + > + /* > + * Disable port mirroring entirely. > + */ > + arswitch_modifyreg(sc->sc_dev, > + AR8327_REG_PORT_LOOKUP(i), > + AR8327_PORT_LOOKUP_ING_MIRROR_EN, > + 0); > + arswitch_modifyreg(sc->sc_dev, > + AR8327_REG_PORT_HOL_CTRL1(i), > + AR8327_PORT_HOL_CTRL1_EG_MIRROR_EN, > + 0); > } > } > > From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 17:55:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C7F49DF; Sat, 1 Mar 2014 17:55:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0E7481E56; Sat, 1 Mar 2014 17:55:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s21HtKKV087390; Sat, 1 Mar 2014 17:55:20 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s21HtKgl087389; Sat, 1 Mar 2014 17:55:20 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201403011755.s21HtKgl087389@svn.freebsd.org> From: Mark Johnston Date: Sat, 1 Mar 2014 17:55:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262661 - head/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 17:55:21 -0000 Author: markj Date: Sat Mar 1 17:55:20 2014 New Revision: 262661 URL: http://svnweb.freebsd.org/changeset/base/262661 Log: Fix emulation of call and jmp instructions on i386 and for 32-bit processes on amd64. Submitted by: Prashanth Kumar MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sat Mar 1 17:44:40 2014 (r262660) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sat Mar 1 17:55:20 2014 (r262661) @@ -1442,10 +1442,7 @@ fasttrap_pid_probe(struct reg *rp) if (tp->ftt_code == 0) { new_pc = tp->ftt_dest; } else { -#ifdef __amd64 - uintptr_t value; -#endif - uintptr_t addr = tp->ftt_dest; + uintptr_t value, addr = tp->ftt_dest; if (tp->ftt_base != FASTTRAP_NOREG) addr += fasttrap_getreg(rp, tp->ftt_base); @@ -1469,6 +1466,7 @@ fasttrap_pid_probe(struct reg *rp) #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { +#endif if ((value = fasttrap_fulword((void *)addr)) == -1) { fasttrap_sigsegv(p, curthread, @@ -1477,9 +1475,8 @@ fasttrap_pid_probe(struct reg *rp) break; } new_pc = value; +#ifdef __amd64 } else { -#endif -#ifdef __i386__ uint32_t value32; addr = (uintptr_t)(uint32_t)addr; if ((value32 = fasttrap_fuword32((void *)addr)) @@ -1490,13 +1487,11 @@ fasttrap_pid_probe(struct reg *rp) break; } new_pc = value32; -#endif } -#ifdef __amd64 +#endif } else { new_pc = addr; } -#endif } /* @@ -1515,11 +1510,9 @@ fasttrap_pid_probe(struct reg *rp) ret = fasttrap_sulword((void *)addr, pcps); } else { #endif -#ifdef __i386__ addr = rp->r_rsp - sizeof (uint32_t); pcps = (uint32_t)(pc + tp->ftt_size); ret = fasttrap_suword32((void *)addr, pcps); -#endif #ifdef __amd64 } #endif From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 18:56:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A73151A5; Sat, 1 Mar 2014 18:56:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 865C9149C; Sat, 1 Mar 2014 18:56:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s21Iuo6R015787; Sat, 1 Mar 2014 18:56:50 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s21IuoVN015786; Sat, 1 Mar 2014 18:56:50 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403011856.s21IuoVN015786@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 1 Mar 2014 18:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262663 - head/sys/dev/usb/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 18:56:50 -0000 Author: hselasky Date: Sat Mar 1 18:56:50 2014 New Revision: 262663 URL: http://svnweb.freebsd.org/changeset/base/262663 Log: - Make pointer easier to control when moving slowly. - Increase chance of vertical scrolling as vertical scrolling is used more often. Submitted by: Huang Wen Hui MFC after: 2 weeks Modified: head/sys/dev/usb/input/wsp.c Modified: head/sys/dev/usb/input/wsp.c ============================================================================== --- head/sys/dev/usb/input/wsp.c Sat Mar 1 18:09:38 2014 (r262662) +++ head/sys/dev/usb/input/wsp.c Sat Mar 1 18:56:50 2014 (r262663) @@ -401,6 +401,9 @@ struct wsp_softc { int dz_count; #define WSP_DZ_MAX_COUNT 32 int dt_sum; /* T-axis cumulative movement */ + int rdx; /* x axis remainder of divide by scale_factor */ + int rdy; /* y axis remainder of divide by scale_factor */ + int rdz; /* z axis remainder of divide by scale_factor */ int tp_datalen; uint8_t o_ntouch; /* old touch finger status */ uint8_t finger; /* 0 or 1 *, check which finger moving */ @@ -669,6 +672,9 @@ wsp_intr_callback(struct usb_xfer *xfer, int dx = 0; int dy = 0; int dz = 0; + int rdx = 0; + int rdy = 0; + int rdz = 0; int len; int i; @@ -830,6 +836,9 @@ wsp_intr_callback(struct usb_xfer *xfer, sc->dt_sum = 0; sc->dx_sum = 0; sc->dy_sum = 0; + sc->rdx = 0; + sc->rdy = 0; + sc->rdz = 0; sc->scr_mode = WSP_SCR_NONE; } else if (f[0].touch_major >= tun.pressure_touch_threshold && sc->sc_touch == WSP_UNTOUCH) { /* ignore first touch */ @@ -894,13 +903,22 @@ wsp_intr_callback(struct usb_xfer *xfer, DPRINTFN(WSP_LLEVEL_INFO, "dx=%5d, dy=%5d, mov=%5d\n", dx, dy, sc->finger); } - if (sc->dz_count--) - sc->dz_sum -= (dy / tun.scale_factor); + if (sc->dz_count--) { + rdz = (dy + sc->rdz) % tun.scale_factor; + sc->dz_sum -= (dy + sc->rdz) / tun.scale_factor; + sc->rdz = rdz; + } if ((sc->dz_sum / tun.z_factor) != 0) sc->dz_count = 0; } - dx /= tun.scale_factor; - dy /= tun.scale_factor; + rdx = (dx + sc->rdx) % tun.scale_factor; + dx = (dx + sc->rdx) / tun.scale_factor; + sc->rdx = rdx; + + rdy = (dy + sc->rdy) % tun.scale_factor; + dy = (dy + sc->rdy) / tun.scale_factor; + sc->rdy = rdy; + sc->dx_sum += dx; sc->dy_sum += dy; @@ -908,7 +926,7 @@ wsp_intr_callback(struct usb_xfer *xfer, if (sc->scr_mode == WSP_SCR_NONE && abs(sc->dx_sum) + abs(sc->dy_sum) > tun.scr_hor_threshold) sc->scr_mode = abs(sc->dx_sum) > - abs(sc->dy_sum) ? WSP_SCR_HOR : + abs(sc->dy_sum) * 3 ? WSP_SCR_HOR : WSP_SCR_VER; DPRINTFN(WSP_LLEVEL_INFO, "scr_mode=%5d, count=%d, dx_sum=%d, dy_sum=%d\n", sc->scr_mode, sc->intr_count, sc->dx_sum, sc->dy_sum); @@ -945,8 +963,10 @@ wsp_intr_callback(struct usb_xfer *xfer, sc->sc_status.dz += dz; wsp_add_to_queue(sc, dx, -dy, dz, sc->sc_status.button); - if (sc->dz_count == 0) + if (sc->dz_count == 0) { sc->dz_sum = 0; + sc->rdz = 0; + } } sc->pre_pos_x = sc->pos_x[0]; From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 19:02:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36BE4350; Sat, 1 Mar 2014 19:02:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 229EE1526; Sat, 1 Mar 2014 19:02:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s21J22tX019352; Sat, 1 Mar 2014 19:02:02 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s21J21Ki019345; Sat, 1 Mar 2014 19:02:01 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403011902.s21J21Ki019345@svn.freebsd.org> From: Ian Lepore Date: Sat, 1 Mar 2014 19:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262664 - in head/sys/boot: fdt uboot/common uboot/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 19:02:02 -0000 Author: ian Date: Sat Mar 1 19:02:00 2014 New Revision: 262664 URL: http://svnweb.freebsd.org/changeset/base/262664 Log: Prevent fdt data loaded from a file from overwriting the kernel environment, by having uboot_autoload() do the fdt setup (which may load a file) rather than waiting until we're actually in the process of launching the kernel. As part of making this happen... - Define LOADER_FDT_SUPPORT on the uboot/lib compile command line when MK_FDT is set. - Make fdt_setup_fdtb() public. - Declare public fdt_whatever() functions in a header instead of using scattered extern decls in .c files. Modified: head/sys/boot/fdt/fdt_loader_cmd.c head/sys/boot/uboot/common/metadata.c head/sys/boot/uboot/lib/Makefile head/sys/boot/uboot/lib/libuboot.h head/sys/boot/uboot/lib/module.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Sat Mar 1 18:56:50 2014 (r262663) +++ head/sys/boot/fdt/fdt_loader_cmd.c Sat Mar 1 19:02:00 2014 (r262664) @@ -279,7 +279,7 @@ fdt_load_dtb_file(const char * filename) return (0); } -static int +int fdt_setup_fdtp() { struct preloaded_file *bfp; Modified: head/sys/boot/uboot/common/metadata.c ============================================================================== --- head/sys/boot/uboot/common/metadata.c Sat Mar 1 18:56:50 2014 (r262663) +++ head/sys/boot/uboot/common/metadata.c Sat Mar 1 19:02:00 2014 (r262664) @@ -41,10 +41,6 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "glue.h" -#if defined(LOADER_FDT_SUPPORT) -extern int fdt_copy(vm_offset_t); -#endif - /* * Return a 'boothowto' value corresponding to the kernel arguments in * (kargs) and any relevant environment variables. Modified: head/sys/boot/uboot/lib/Makefile ============================================================================== --- head/sys/boot/uboot/lib/Makefile Sat Mar 1 18:56:50 2014 (r262663) +++ head/sys/boot/uboot/lib/Makefile Sat Mar 1 19:02:00 2014 (r262664) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + .PATH: ${.CURDIR}/../../common LIB= uboot @@ -18,6 +20,16 @@ SRCS+= disk.c CFLAGS+= -DLOADER_DISK_SUPPORT .endif +.if ${MK_FDT} != "no" +LOADER_FDT_SUPPORT= yes +.else +LOADER_FDT_SUPPORT= no +.endif + +.if ${LOADER_FDT_SUPPORT} == "yes" +CFLAGS+= -DLOADER_FDT_SUPPORT +.endif + # Pick up FDT includes CFLAGS+= -I${.CURDIR}/../../../../sys/contrib/libfdt/ Modified: head/sys/boot/uboot/lib/libuboot.h ============================================================================== --- head/sys/boot/uboot/lib/libuboot.h Sat Mar 1 18:56:50 2014 (r262663) +++ head/sys/boot/uboot/lib/libuboot.h Sat Mar 1 19:02:00 2014 (r262664) @@ -69,3 +69,9 @@ struct file_format; extern struct file_format uboot_elf; void reboot(void); + +#if defined(LOADER_FDT_SUPPORT) +extern int fdt_setup_fdtp(); +extern int fdt_copy(vm_offset_t); +#endif + Modified: head/sys/boot/uboot/lib/module.c ============================================================================== --- head/sys/boot/uboot/lib/module.c Sat Mar 1 18:56:50 2014 (r262663) +++ head/sys/boot/uboot/lib/module.c Sat Mar 1 19:02:00 2014 (r262664) @@ -29,19 +29,23 @@ __FBSDID("$FreeBSD$"); /* * U-Boot-specific module functionality. - * - * XXX not much for now... - * */ #include #include #include "bootstrap.h" +#include "libuboot.h" int uboot_autoload(void) { +#if defined(LOADER_FDT_SUPPORT) + int err; + + if ((err = fdt_setup_fdtp()) != 0) + return (err); +#endif return(0); } From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 19:06:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBFC59AB; Sat, 1 Mar 2014 19:06:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB0A21822; Sat, 1 Mar 2014 19:06:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s21J6iFe019918; Sat, 1 Mar 2014 19:06:44 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s21J6isq019912; Sat, 1 Mar 2014 19:06:44 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201403011906.s21J6isq019912@svn.freebsd.org> From: Mark Johnston Date: Sat, 1 Mar 2014 19:06:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262665 - in head/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 19:06:45 -0000 Author: markj Date: Sat Mar 1 19:06:43 2014 New Revision: 262665 URL: http://svnweb.freebsd.org/changeset/base/262665 Log: Expose a few DTrace parameters as sysctls under kern.dtrace and add descriptions for several existing sysctls. PR: 187027 Submitted by: Fedor Indutny (original version) MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/dev/dtrace/dtrace_ioctl.c head/sys/cddl/dev/dtrace/dtrace_sysctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sat Mar 1 19:02:00 2014 (r262664) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sat Mar 1 19:06:43 2014 (r262665) @@ -303,7 +303,8 @@ static kmutex_t dtrace_meta_lock; /* me #define PRIV_PROC_ZONE (1 << 5) #define PRIV_ALL ~0 -SYSCTL_NODE(_debug, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace Information"); +SYSCTL_DECL(_debug_dtrace); +SYSCTL_DECL(_kern_dtrace); #endif #if defined(sun) Modified: head/sys/cddl/dev/dtrace/dtrace_ioctl.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_ioctl.c Sat Mar 1 19:02:00 2014 (r262664) +++ head/sys/cddl/dev/dtrace/dtrace_ioctl.c Sat Mar 1 19:06:43 2014 (r262665) @@ -23,7 +23,8 @@ */ static int dtrace_verbose_ioctl; -SYSCTL_INT(_debug_dtrace, OID_AUTO, verbose_ioctl, CTLFLAG_RW, &dtrace_verbose_ioctl, 0, ""); +SYSCTL_INT(_debug_dtrace, OID_AUTO, verbose_ioctl, CTLFLAG_RW, + &dtrace_verbose_ioctl, 0, "log DTrace ioctls"); #define DTRACE_IOCTL_PRINTF(fmt, ...) if (dtrace_verbose_ioctl) printf(fmt, ## __VA_ARGS__ ) Modified: head/sys/cddl/dev/dtrace/dtrace_sysctl.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_sysctl.c Sat Mar 1 19:02:00 2014 (r262664) +++ head/sys/cddl/dev/dtrace/dtrace_sysctl.c Sat Mar 1 19:06:43 2014 (r262665) @@ -22,6 +22,8 @@ * */ +SYSCTL_NODE(_debug, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace debug parameters"); + int dtrace_debug = 0; TUNABLE_INT("debug.dtrace.debug", &dtrace_debug); SYSCTL_INT(_debug_dtrace, OID_AUTO, debug, CTLFLAG_RW, &dtrace_debug, 0, ""); @@ -78,7 +80,15 @@ sysctl_dtrace_providers(SYSCTL_HANDLER_A } SYSCTL_PROC(_debug_dtrace, OID_AUTO, providers, CTLTYPE_STRING | CTLFLAG_RD, - 0, 0, sysctl_dtrace_providers, "A", ""); + 0, 0, sysctl_dtrace_providers, "A", "available DTrace providers"); + +SYSCTL_NODE(_kern, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace parameters"); -SYSCTL_INT(_debug_dtrace, OID_AUTO, memstr_max, CTLFLAG_RW, &dtrace_memstr_max, +SYSCTL_INT(_kern_dtrace, OID_AUTO, memstr_max, CTLFLAG_RW, &dtrace_memstr_max, 0, "largest allowed argument to memstr(), 0 indicates no limit"); + +SYSCTL_LONG(_kern_dtrace, OID_AUTO, dof_maxsize, CTLFLAG_RW, + &dtrace_dof_maxsize, 0, "largest allowed DOF table"); + +SYSCTL_LONG(_kern_dtrace, OID_AUTO, helper_actions_max, CTLFLAG_RW, + &dtrace_helper_actions_max, 0, "maximum number of allowed helper actions"); From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 23:09:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94718DF8; Sat, 1 Mar 2014 23:09:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 747131A31; Sat, 1 Mar 2014 23:09:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s21N98Uv016241; Sat, 1 Mar 2014 23:09:08 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s21N98I3016240; Sat, 1 Mar 2014 23:09:08 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201403012309.s21N98I3016240@svn.freebsd.org> From: Mark Johnston Date: Sat, 1 Mar 2014 23:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262669 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 23:09:08 -0000 Author: markj Date: Sat Mar 1 23:09:07 2014 New Revision: 262669 URL: http://svnweb.freebsd.org/changeset/base/262669 Log: When our linker merges .SUNW_dof sections from multiple files, it simply concatenates the DOF tables into one section. Previously, the USDT init code in drti.o would only look at the first table in the DOF section; with this change, it iterates over all the tables, passing each DOF table to the kernel. PR: 186821 Submitted by: Fedor Indutny MFC after: 1 month Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Sat Mar 1 21:50:23 2014 (r262668) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Sat Mar 1 23:09:07 2014 (r262669) @@ -20,6 +20,7 @@ */ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2013 Voxer Inc. All rights reserved. * Use is subject to license terms. */ @@ -144,7 +145,8 @@ dtrace_dof_init(void) Lmid_t lmid; #else u_long lmid = 0; - dof_sec_t *sec; + dof_sec_t *sec, *secstart, *dofstrtab, *dofprobes; + dof_provider_t *dofprovider; size_t i; #endif int fd; @@ -152,14 +154,15 @@ dtrace_dof_init(void) #if !defined(sun) Elf *e; Elf_Scn *scn = NULL; - Elf_Data *symtabdata = NULL, *dynsymdata = NULL; + Elf_Data *symtabdata = NULL, *dynsymdata = NULL, *dofdata = NULL; + dof_hdr_t *dof_next = NULL; GElf_Shdr shdr; int efd, nprobes; char *s; + char *dofstrtabraw; size_t shstridx, symtabidx = 0, dynsymidx = 0; - unsigned char *dofstrtab = NULL; unsigned char *buf; - int fixedprobes = 0; + int fixedprobes; #endif if (getenv("DTRACE_DOF_INIT_DISABLE") != NULL) @@ -209,7 +212,8 @@ dtrace_dof_init(void) } else if (shdr.sh_type == SHT_PROGBITS) { s = elf_strptr(e, shstridx, shdr.sh_name); if (s && strcmp(s, ".SUNW_dof") == 0) { - dof = elf_getdata(scn, NULL)->d_buf; + dofdata = elf_getdata(scn, NULL); + dof = dofdata->d_buf; } } } @@ -219,6 +223,10 @@ dtrace_dof_init(void) close(efd); return; } + + while ((char *) dof < (char *) dofdata->d_buf + dofdata->d_size) { + fixedprobes = 0; + dof_next = (void *) ((char *) dof + dof->dofh_filesz); #endif if (dof->dofh_ident[DOF_ID_MAG0] != DOF_MAG_MAG0 || @@ -290,34 +298,49 @@ dtrace_dof_init(void) * We are assuming the number of probes is less than the number of * symbols (libc can have 4k symbols, for example). */ - sec = (dof_sec_t *)(dof + 1); + secstart = sec = (dof_sec_t *)(dof + 1); buf = (char *)dof; for (i = 0; i < dof->dofh_secnum; i++, sec++) { - if (sec->dofs_type == DOF_SECT_STRTAB) - dofstrtab = (unsigned char *)(buf + sec->dofs_offset); - else if (sec->dofs_type == DOF_SECT_PROBES && dofstrtab) + if (sec->dofs_type != DOF_SECT_PROVIDER) + continue; + + dofprovider = (void *) (buf + sec->dofs_offset); + dofstrtab = secstart + dofprovider->dofpv_strtab; + dofprobes = secstart + dofprovider->dofpv_probes; + + if (dofstrtab->dofs_type != DOF_SECT_STRTAB) { + fprintf(stderr, "WARNING: expected STRTAB section, but got %d\n", + dofstrtab->dofs_type); break; - - } - nprobes = sec->dofs_size / sec->dofs_entsize; - fixsymbol(e, symtabdata, symtabidx, nprobes, buf, sec, &fixedprobes, - dofstrtab); - if (fixedprobes != nprobes) { - /* - * If we haven't fixed all the probes using the - * symtab section, look inside the dynsym - * section. - */ - fixsymbol(e, dynsymdata, dynsymidx, nprobes, buf, sec, - &fixedprobes, dofstrtab); - } - if (fixedprobes != nprobes) { - fprintf(stderr, "WARNING: number of probes " - "fixed does not match the number of " - "defined probes (%d != %d, " - "respectively)\n", fixedprobes, nprobes); - fprintf(stderr, "WARNING: some probes might " - "not fire or your program might crash\n"); + } + if (dofprobes->dofs_type != DOF_SECT_PROBES) { + fprintf(stderr, "WARNING: expected PROBES section, but got %d\n", + dofprobes->dofs_type); + break; + } + + dprintf(1, "found provider %p\n", dofprovider); + dofstrtabraw = (char *)(buf + dofstrtab->dofs_offset); + nprobes = dofprobes->dofs_size / dofprobes->dofs_entsize; + fixsymbol(e, symtabdata, symtabidx, nprobes, buf, dofprobes, &fixedprobes, + dofstrtabraw); + if (fixedprobes != nprobes) { + /* + * If we haven't fixed all the probes using the + * symtab section, look inside the dynsym + * section. + */ + fixsymbol(e, dynsymdata, dynsymidx, nprobes, buf, dofprobes, + &fixedprobes, dofstrtabraw); + } + if (fixedprobes != nprobes) { + fprintf(stderr, "WARNING: number of probes " + "fixed does not match the number of " + "defined probes (%d != %d, " + "respectively)\n", fixedprobes, nprobes); + fprintf(stderr, "WARNING: some probes might " + "not fire or your program might crash\n"); + } } #endif if ((gen = ioctl(fd, DTRACEHIOC_ADDDOF, &dh)) == -1) @@ -330,7 +353,12 @@ dtrace_dof_init(void) } (void) close(fd); + #if !defined(sun) + /* End of while loop */ + dof = dof_next; + } + elf_end(e); (void) close(efd); #endif From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 00:47:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 586F9A85; Sun, 2 Mar 2014 00:47:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 44EB8125E; Sun, 2 Mar 2014 00:47:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s220lmKY056456; Sun, 2 Mar 2014 00:47:48 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s220lmDP056455; Sun, 2 Mar 2014 00:47:48 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403020047.s220lmDP056455@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 2 Mar 2014 00:47:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262673 - head/contrib/telnet/telnetd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 00:47:48 -0000 Author: marcel Date: Sun Mar 2 00:47:47 2014 New Revision: 262673 URL: http://svnweb.freebsd.org/changeset/base/262673 Log: Revive support for /etc/issue, lost due revision 81963. Obtained from: Juniper Networks, Inc. Modified: head/contrib/telnet/telnetd/telnetd.c Modified: head/contrib/telnet/telnetd/telnetd.c ============================================================================== --- head/contrib/telnet/telnetd/telnetd.c Sun Mar 2 00:30:42 2014 (r262672) +++ head/contrib/telnet/telnetd/telnetd.c Sun Mar 2 00:47:47 2014 (r262673) @@ -740,6 +740,10 @@ telnet(int f, int p, char *host) char *HE; char *HN; char *IM; + char *IF; + char *if_buf; + int if_fd = -1; + struct stat statbuf; int nfd; /* @@ -905,8 +909,13 @@ telnet(int f, int p, char *host) HE = Getstr("he", &cp); HN = Getstr("hn", &cp); IM = Getstr("im", &cp); + IF = Getstr("if", &cp); if (HN && *HN) (void) strlcpy(host_name, HN, sizeof(host_name)); + if (IF) { + if_fd = open(IF, O_RDONLY, 000); + IM = 0; + } if (IM == 0) IM = strdup(""); } else { @@ -916,6 +925,16 @@ telnet(int f, int p, char *host) edithost(HE, host_name); if (hostinfo && *IM) putf(IM, ptyibuf2); + if (IF && if_fd != -1) { + if(fstat (if_fd, &statbuf)!=-1) { + if (statbuf.st_size > 0) { + if_buf = (char *) mmap (0, statbuf.st_size, PROT_READ, 0, if_fd, 0); + putf(if_buf, ptyibuf2); + munmap (if_buf, statbuf.st_size); + } + close (if_fd); + } + } if (pcc) (void) strncat(ptyibuf2, ptyip, pcc+1); From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 02:49:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F6174D8; Sun, 2 Mar 2014 02:49:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3BCD21127; Sun, 2 Mar 2014 02:49:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s222nLcc004837; Sun, 2 Mar 2014 02:49:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s222nLdg004836; Sun, 2 Mar 2014 02:49:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403020249.s222nLdg004836@svn.freebsd.org> From: Adrian Chadd Date: Sun, 2 Mar 2014 02:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262677 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 02:49:21 -0000 Author: adrian Date: Sun Mar 2 02:49:20 2014 New Revision: 262677 URL: http://svnweb.freebsd.org/changeset/base/262677 Log: Add the USB EHCI flags required for the post-AR71xx devices. Tested: * DB120, AR9344 Modified: head/sys/mips/atheros/ar71xx_ehci.c Modified: head/sys/mips/atheros/ar71xx_ehci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_ehci.c Sun Mar 2 02:41:33 2014 (r262676) +++ head/sys/mips/atheros/ar71xx_ehci.c Sun Mar 2 02:49:20 2014 (r262677) @@ -133,7 +133,6 @@ ar71xx_ehci_attach(device_t self) sprintf(sc->sc_vendor, "Atheros"); - err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl); if (err) { @@ -159,6 +158,9 @@ ar71xx_ehci_attach(device_t self) case AR71XX_SOC_AR9132: case AR71XX_SOC_AR9330: case AR71XX_SOC_AR9331: + case AR71XX_SOC_AR9341: + case AR71XX_SOC_AR9342: + case AR71XX_SOC_AR9344: sc->sc_flags |= EHCI_SCFLG_TT | EHCI_SCFLG_NORESTERM; break; default: @@ -172,7 +174,6 @@ ar71xx_ehci_attach(device_t self) */ sc->sc_offs = EHCI_CAPLENGTH(EREAD4(sc, EHCI_CAPLEN_HCIVERSION)); - (void) ehci_reset(sc); err = ehci_init(sc); From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 03:34:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1C9BA25; Sun, 2 Mar 2014 03:34:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C1521566; Sun, 2 Mar 2014 03:34:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s223Y7UR024967; Sun, 2 Mar 2014 03:34:07 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s223Y7lG024966; Sun, 2 Mar 2014 03:34:07 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403020334.s223Y7lG024966@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 2 Mar 2014 03:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262679 - head/contrib/telnet/telnetd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 03:34:07 -0000 Author: marcel Date: Sun Mar 2 03:34:06 2014 New Revision: 262679 URL: http://svnweb.freebsd.org/changeset/base/262679 Log: Improve upon previous commit: 1. Check return of mmap(2) (*) 2. Avoid FD leak when fstat fails. 3. Fix style(9). (*) Pointed out by jmg@ Modified: head/contrib/telnet/telnetd/telnetd.c Modified: head/contrib/telnet/telnetd/telnetd.c ============================================================================== --- head/contrib/telnet/telnetd/telnetd.c Sun Mar 2 02:52:34 2014 (r262678) +++ head/contrib/telnet/telnetd/telnetd.c Sun Mar 2 03:34:06 2014 (r262679) @@ -926,14 +926,15 @@ telnet(int f, int p, char *host) if (hostinfo && *IM) putf(IM, ptyibuf2); if (IF && if_fd != -1) { - if(fstat (if_fd, &statbuf)!=-1) { - if (statbuf.st_size > 0) { - if_buf = (char *) mmap (0, statbuf.st_size, PROT_READ, 0, if_fd, 0); - putf(if_buf, ptyibuf2); - munmap (if_buf, statbuf.st_size); + if (fstat(if_fd, &statbuf) != -1 && statbuf.st_size > 0) { + if_buf = (char *) mmap (0, statbuf.st_size, + PROT_READ, 0, if_fd, 0); + if (if_buf != MAP_FAILED) { + putf(if_buf, ptyibuf2); + munmap(if_buf, statbuf.st_size); + } } close (if_fd); - } } if (pcc) From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 05:48:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B756678; Sun, 2 Mar 2014 05:48:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4BF6B1D45; Sun, 2 Mar 2014 05:48:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s225mvn6078681; Sun, 2 Mar 2014 05:48:57 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s225mupU078678; Sun, 2 Mar 2014 05:48:56 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403020548.s225mupU078678@svn.freebsd.org> From: Adrian Chadd Date: Sun, 2 Mar 2014 05:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262681 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 05:48:57 -0000 Author: adrian Date: Sun Mar 2 05:48:56 2014 New Revision: 262681 URL: http://svnweb.freebsd.org/changeset/base/262681 Log: Add ATU flush support. The OpenWRT AR8xxx switch support flushes the ATU (address translation unit) after each port link 'up' status change. I've modified this to just flush on any port transition. Whilst here, bump the number of ports on the AR8327 to 6, rather than the default of 5. It's DB120 specific; I'll go and make this configurable later. There's some debugging code in here still; I am still debugging whether this is or isn't working fully. Tested: * DB120, AR9344 + AR8327 switch Obtained from: OpenWRT Modified: head/sys/dev/etherswitch/arswitch/arswitch.c head/sys/dev/etherswitch/arswitch/arswitch_8327.c head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Sun Mar 2 05:47:05 2014 (r262680) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Sun Mar 2 05:48:56 2014 (r262681) @@ -256,6 +256,28 @@ ar8xxx_port_init(struct arswitch_softc * } static int +ar8xxx_atu_flush(struct arswitch_softc *sc) +{ + int ret; + + ret = arswitch_waitreg(sc->sc_dev, + AR8216_REG_ATU, + AR8216_ATU_ACTIVE, + 0, + 1000); + + if (ret) + device_printf(sc->sc_dev, "%s: waitreg failed\n", __func__); + + if (!ret) + arswitch_writereg(sc->sc_dev, + AR8216_REG_ATU, + AR8216_ATU_OP_FLUSH); + + return (ret); +} + +static int arswitch_attach(device_t dev) { struct arswitch_softc *sc; @@ -280,6 +302,7 @@ arswitch_attach(device_t dev) sc->hal.arswitch_vlan_setvgroup = ar8xxx_setvgroup; sc->hal.arswitch_vlan_get_pvid = ar8xxx_get_pvid; sc->hal.arswitch_vlan_set_pvid = ar8xxx_set_pvid; + sc->hal.arswitch_atu_flush = ar8xxx_atu_flush; /* * Attach switch related functions @@ -469,6 +492,7 @@ arswitch_miipollstat(struct arswitch_sof struct mii_data *mii; struct mii_softc *miisc; int portstatus; + int port_flap = 0; ARSWITCH_LOCK_ASSERT(sc, MA_OWNED); @@ -484,7 +508,6 @@ arswitch_miipollstat(struct arswitch_sof else portstatus = arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_STS(arswitch_portforphy(i))); - #if 0 DPRINTF(sc->sc_dev, "p[%d]=%b\n", i, @@ -492,6 +515,27 @@ arswitch_miipollstat(struct arswitch_sof "\20\3TXMAC\4RXMAC\5TXFLOW\6RXFLOW\7" "DUPLEX\11LINK_UP\12LINK_AUTO\13LINK_PAUSE"); #endif + /* + * If the current status is down, but we have a link + * status showing up, we need to do an ATU flush. + */ + if ((mii->mii_media_status & IFM_ACTIVE) == 0 && + (portstatus & AR8X16_PORT_STS_LINK_UP) != 0) { + device_printf(sc->sc_dev, "%s: port %d: port -> UP\n", + __func__, + i); + port_flap = 1; + } + /* + * and maybe if a port goes up->down? + */ + if ((mii->mii_media_status & IFM_ACTIVE) != 0 && + (portstatus & AR8X16_PORT_STS_LINK_UP) == 0) { + device_printf(sc->sc_dev, "%s: port %d: port -> DOWN\n", + __func__, + i); + port_flap = 1; + } arswitch_update_ifmedia(portstatus, &mii->mii_media_status, &mii->mii_media_active); LIST_FOREACH(miisc, &mii->mii_phys, mii_list) { @@ -501,6 +545,10 @@ arswitch_miipollstat(struct arswitch_sof mii_phy_update(miisc, MII_POLLSTAT); } } + + /* If a port went from down->up, flush the ATU */ + if (port_flap) + sc->hal.arswitch_atu_flush(sc); } static void Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Mar 2 05:47:05 2014 (r262680) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Mar 2 05:48:56 2014 (r262681) @@ -637,6 +637,9 @@ ar8327_hw_global_setup(struct arswitch_s arswitch_modifyreg(sc->sc_dev, AR8327_REG_MODULE_EN, AR8327_MODULE_EN_MIB, AR8327_MODULE_EN_MIB); + /* Set the right number of ports */ + sc->info.es_nports = 6; + return (0); } @@ -784,6 +787,28 @@ ar8327_set_pvid(struct arswitch_softc *s return (0); } +static int +ar8327_atu_flush(struct arswitch_softc *sc) +{ + + int ret; + + ret = arswitch_waitreg(sc->sc_dev, + AR8327_REG_ATU_FUNC, + AR8327_ATU_FUNC_BUSY, + 0, + 1000); + + if (ret) + device_printf(sc->sc_dev, "%s: waitreg failed\n", __func__); + + if (!ret) + arswitch_writereg(sc->sc_dev, + AR8327_REG_ATU_FUNC, + AR8327_ATU_FUNC_OP_FLUSH); + return (ret); +} + void ar8327_attach(struct arswitch_softc *sc) { @@ -801,6 +826,8 @@ ar8327_attach(struct arswitch_softc *sc) sc->hal.arswitch_vlan_get_pvid = ar8327_get_pvid; sc->hal.arswitch_vlan_set_pvid = ar8327_set_pvid; + sc->hal.arswitch_atu_flush = ar8327_atu_flush; + /* Set the switch vlan capabilities. */ sc->info.es_vlan_caps = ETHERSWITCH_VLAN_DOT1Q | ETHERSWITCH_VLAN_PORT | ETHERSWITCH_VLAN_DOUBLE_TAG; Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Sun Mar 2 05:47:05 2014 (r262680) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Sun Mar 2 05:48:56 2014 (r262681) @@ -81,6 +81,9 @@ struct arswitch_softc { /* Port functions */ void (* arswitch_port_init) (struct arswitch_softc *, int); + /* ATU functions */ + int (* arswitch_atu_flush) (struct arswitch_softc *); + /* VLAN functions */ int (* arswitch_port_vlan_setup) (struct arswitch_softc *, etherswitch_port_t *); From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 06:36:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61CA5AF2; Sun, 2 Mar 2014 06:36:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4E722115E; Sun, 2 Mar 2014 06:36:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s226aoNL098165; Sun, 2 Mar 2014 06:36:50 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s226aoTv098164; Sun, 2 Mar 2014 06:36:50 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201403020636.s226aoTv098164@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 2 Mar 2014 06:36:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262682 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 06:36:50 -0000 Author: gonzo Date: Sun Mar 2 06:36:49 2014 New Revision: 262682 URL: http://svnweb.freebsd.org/changeset/base/262682 Log: - Fix BBB's dts compilation with GNU dtc Modified: head/sys/boot/fdt/dts/arm/beaglebone-black.dts Modified: head/sys/boot/fdt/dts/arm/beaglebone-black.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/beaglebone-black.dts Sun Mar 2 05:48:56 2014 (r262681) +++ head/sys/boot/fdt/dts/arm/beaglebone-black.dts Sun Mar 2 06:36:49 2014 (r262682) @@ -150,7 +150,7 @@ compatible = "ti,am335x-pmic"; reg = <0x24>; }; - } + }; }; leds { From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 07:39:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04250ECA; Sun, 2 Mar 2014 07:39:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E4A07153E; Sun, 2 Mar 2014 07:39:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s227dbEl023023; Sun, 2 Mar 2014 07:39:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s227dbZ3023022; Sun, 2 Mar 2014 07:39:37 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403020739.s227dbZ3023022@svn.freebsd.org> From: Adrian Chadd Date: Sun, 2 Mar 2014 07:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262684 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 07:39:38 -0000 Author: adrian Date: Sun Mar 2 07:39:37 2014 New Revision: 262684 URL: http://svnweb.freebsd.org/changeset/base/262684 Log: Add a description here. Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Mar 2 07:10:43 2014 (r262683) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Mar 2 07:39:37 2014 (r262684) @@ -661,6 +661,9 @@ ar8327_port_init(struct arswitch_softc * arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_STATUS(port), t); arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_HEADER(port), 0); + /* + * Default to 1 port group. + */ t = 1 << AR8327_PORT_VLAN0_DEF_SVID_S; t |= 1 << AR8327_PORT_VLAN0_DEF_CVID_S; arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_VLAN0(port), t); From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 21:22:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05356E67; Sat, 1 Mar 2014 21:22:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E619B109C; Sat, 1 Mar 2014 21:22:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s21LMK6V075558; Sat, 1 Mar 2014 21:22:20 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s21LMK3W075556; Sat, 1 Mar 2014 21:22:20 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201403012122.s21LMK3W075556@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 1 Mar 2014 21:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262667 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 21:22:21 -0000 Author: pfg Date: Sat Mar 1 21:22:20 2014 New Revision: 262667 URL: http://svnweb.freebsd.org/changeset/base/262667 Log: ext2fs: small formatting fixes. Remove some redundant spaces. No functional change. MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_bmap.c Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Sat Mar 1 19:25:23 2014 (r262666) +++ head/sys/fs/ext2fs/ext2_alloc.c Sat Mar 1 21:22:20 2014 (r262667) @@ -934,7 +934,7 @@ ext2_nodealloccg(struct inode *ip, int c panic("ext2fs_nodealloccg: map corrupted"); /* NOTREACHED */ } - } + } ipref = (loc - ibp) * NBBY + ffs(~*loc) - 1; gotit: setbit(ibp, ipref); Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Sat Mar 1 19:25:23 2014 (r262666) +++ head/sys/fs/ext2fs/ext2_bmap.c Sat Mar 1 21:22:20 2014 (r262667) @@ -250,10 +250,10 @@ ext2_bmaparray(struct vnode *vp, daddr_t bn = ap->in_off; if (runb && bn) { for (--bn; bn >= 0 && *runb < maxrun && - is_sequential(ump, + is_sequential(ump, ((e2fs_daddr_t *)bp->b_data)[bn], ((e2fs_daddr_t *)bp->b_data)[bn + 1]); - --bn, ++*runb); + --bn, ++*runb); } } } From owner-svn-src-head@FreeBSD.ORG Sat Mar 1 19:25:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88B4BD56; Sat, 1 Mar 2014 19:25:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 75899156D; Sat, 1 Mar 2014 19:25:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s21JPO5u027806; Sat, 1 Mar 2014 19:25:24 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s21JPOP4027805; Sat, 1 Mar 2014 19:25:24 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403011925.s21JPOP4027805@svn.freebsd.org> From: Ian Lepore Date: Sat, 1 Mar 2014 19:25:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262666 - head/sys/boot/uboot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 19:25:24 -0000 Author: ian Date: Sat Mar 1 19:25:23 2014 New Revision: 262666 URL: http://svnweb.freebsd.org/changeset/base/262666 Log: If we can't find the u-boot api signature, exit with an error status that includes "badab1"; u-boot displays the status in hex, so this may help give some clue about why ubldr isn't working (more than -1 does anyway). Modified: head/sys/boot/uboot/common/main.c Modified: head/sys/boot/uboot/common/main.c ============================================================================== --- head/sys/boot/uboot/common/main.c Sat Mar 1 19:06:43 2014 (r262665) +++ head/sys/boot/uboot/common/main.c Sat Mar 1 19:25:23 2014 (r262666) @@ -124,15 +124,21 @@ main(void) struct open_file f; const char * loaderdev; + /* + * If we can't find the magic signature and related info, exit with a + * unique error code that U-Boot reports as "## Application terminated, + * rc = 0xnnbadab1". Hopefully 'badab1' looks enough like "bad api" to + * provide a clue. It's better than 0xffffffff anyway. + */ if (!api_search_sig(&sig)) - return (-1); + return (0x01badab1); syscall_ptr = sig->syscall; if (syscall_ptr == NULL) - return (-2); + return (0x02badab1); if (sig->version > API_SIG_VERSION) - return (-3); + return (0x03badab1); /* Clear BSS sections */ bzero(__sbss_start, __sbss_end - __sbss_start); From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 00:14:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E90E509; Sun, 2 Mar 2014 00:14:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4B385103F; Sun, 2 Mar 2014 00:14:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s220EwDT044125; Sun, 2 Mar 2014 00:14:58 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s220EwLK044124; Sun, 2 Mar 2014 00:14:58 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403020014.s220EwLK044124@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 2 Mar 2014 00:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262670 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 00:14:58 -0000 Author: marcel Date: Sun Mar 2 00:14:57 2014 New Revision: 262670 URL: http://svnweb.freebsd.org/changeset/base/262670 Log: Use ${MAKE} so that we always use the same version/implementation of make. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Mar 1 23:09:07 2014 (r262669) +++ head/Makefile.inc1 Sun Mar 2 00:14:57 2014 (r262670) @@ -132,8 +132,8 @@ OSRELDATE= 0 .endif .if !defined(VERSION) -REVISION!= make -C ${SRCDIR}/release -V REVISION -BRANCH!= make -C ${SRCDIR}/release -V BRANCH +REVISION!= ${MAKE} -C ${SRCDIR}/release -V REVISION +BRANCH!= ${MAKE} -C ${SRCDIR}/release -V BRANCH SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ ${SRCDIR}/sys/sys/param.h VERSION= FreeBSD ${REVISION}-${BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDATE} From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 02:41:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 821FB39B; Sun, 2 Mar 2014 02:41:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6DBA510F8; Sun, 2 Mar 2014 02:41:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s222fYVc003864; Sun, 2 Mar 2014 02:41:34 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s222fYnB003863; Sun, 2 Mar 2014 02:41:34 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403020241.s222fYnB003863@svn.freebsd.org> From: Xin LI Date: Sun, 2 Mar 2014 02:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262676 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 02:41:34 -0000 Author: delphij Date: Sun Mar 2 02:41:33 2014 New Revision: 262676 URL: http://svnweb.freebsd.org/changeset/base/262676 Log: All callers of static method load_nvlist() in spa.c handles error case, so there is no reason to assert that we won't hit an error. Instead, just return that error to caller and have the upper layer handle it. Obtained from: FreeNAS Reported by: rodrigc Reviewed by: Matthew Ahrens MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Mar 2 02:35:46 2014 (r262675) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sun Mar 2 02:41:33 2014 (r262676) @@ -1594,7 +1594,9 @@ load_nvlist(spa_t *spa, uint64_t obj, nv int error; *value = NULL; - VERIFY(0 == dmu_bonus_hold(spa->spa_meta_objset, obj, FTAG, &db)); + error = dmu_bonus_hold(spa->spa_meta_objset, obj, FTAG, &db); + if (error != 0) + return (error); nvsize = *(uint64_t *)db->db_data; dmu_buf_rele(db, FTAG); From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 02:52:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D783E5DE; Sun, 2 Mar 2014 02:52:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C25FA119A; Sun, 2 Mar 2014 02:52:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s222qckL008054; Sun, 2 Mar 2014 02:52:38 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s222qZoT008034; Sun, 2 Mar 2014 02:52:35 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201403020252.s222qZoT008034@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 2 Mar 2014 02:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262678 - in head/sys/ufs: ffs ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 02:52:38 -0000 Author: pfg Date: Sun Mar 2 02:52:34 2014 New Revision: 262678 URL: http://svnweb.freebsd.org/changeset/base/262678 Log: ufs: small formatting fixes. Cleanup some extra space. Use of tabs vs. spaces. No functional change. MFC after: 3 days Reviewed by: mckusick Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/ffs_vnops.c head/sys/ufs/ffs/fs.h head/sys/ufs/ffs/softdep.h head/sys/ufs/ufs/dir.h head/sys/ufs/ufs/dirhash.h head/sys/ufs/ufs/extattr.h head/sys/ufs/ufs/gjournal.h head/sys/ufs/ufs/inode.h head/sys/ufs/ufs/quota.h head/sys/ufs/ufs/ufs_extern.h head/sys/ufs/ufs/ufsmount.h Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sun Mar 2 02:49:20 2014 (r262677) +++ head/sys/ufs/ffs/ffs_alloc.c Sun Mar 2 02:52:34 2014 (r262678) @@ -1182,14 +1182,14 @@ ffs_dirpref(pip) for (cg = prefcg; cg < fs->fs_ncg; cg++) if (fs->fs_cs(fs, cg).cs_ndir < maxndir && fs->fs_cs(fs, cg).cs_nifree >= minifree && - fs->fs_cs(fs, cg).cs_nbfree >= minbfree) { + fs->fs_cs(fs, cg).cs_nbfree >= minbfree) { if (fs->fs_contigdirs[cg] < maxcontigdirs) return ((ino_t)(fs->fs_ipg * cg)); } for (cg = 0; cg < prefcg; cg++) if (fs->fs_cs(fs, cg).cs_ndir < maxndir && fs->fs_cs(fs, cg).cs_nifree >= minifree && - fs->fs_cs(fs, cg).cs_nbfree >= minbfree) { + fs->fs_cs(fs, cg).cs_nbfree >= minbfree) { if (fs->fs_contigdirs[cg] < maxcontigdirs) return ((ino_t)(fs->fs_ipg * cg)); } Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Sun Mar 2 02:49:20 2014 (r262677) +++ head/sys/ufs/ffs/ffs_balloc.c Sun Mar 2 02:52:34 2014 (r262678) @@ -248,7 +248,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t UFS_LOCK(ump); pref = ffs_blkpref_ufs1(ip, lbn, -indirs[0].in_off - 1, (ufs1_daddr_t *)0); - if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, + if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, flags, cred, &newb)) != 0) { curthread_pflags_restore(saved_inbdflush); return (error); @@ -809,7 +809,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t UFS_LOCK(ump); pref = ffs_blkpref_ufs2(ip, lbn, -indirs[0].in_off - 1, (ufs2_daddr_t *)0); - if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, + if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, flags, cred, &newb)) != 0) { curthread_pflags_restore(saved_inbdflush); return (error); Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Sun Mar 2 02:49:20 2014 (r262677) +++ head/sys/ufs/ffs/ffs_extern.h Sun Mar 2 02:52:34 2014 (r262678) @@ -165,10 +165,10 @@ void softdep_freework(struct workhead *) /* * Things to request flushing in softdep_request_cleanup() */ -#define FLUSH_INODES 1 -#define FLUSH_INODES_WAIT 2 -#define FLUSH_BLOCKS 3 -#define FLUSH_BLOCKS_WAIT 4 +#define FLUSH_INODES 1 +#define FLUSH_INODES_WAIT 2 +#define FLUSH_BLOCKS 3 +#define FLUSH_BLOCKS_WAIT 4 /* * Flag to ffs_syncvnode() to request flushing of data only, * but skip the ffs_update() on the inode itself. Used to avoid Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Sun Mar 2 02:49:20 2014 (r262677) +++ head/sys/ufs/ffs/ffs_snapshot.c Sun Mar 2 02:52:34 2014 (r262678) @@ -2642,7 +2642,7 @@ ffs_snapdata_acquire(struct vnode *devvp struct snapdata *sn; /* - * Allocate a free snapdata. This is done before acquiring the + * Allocate a free snapdata. This is done before acquiring the * devvp lock to avoid allocation while the devvp interlock is * held. */ Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sun Mar 2 02:49:20 2014 (r262677) +++ head/sys/ufs/ffs/ffs_softdep.c Sun Mar 2 02:52:34 2014 (r262678) @@ -119,7 +119,7 @@ softdep_mount(devvp, mp, fs, cred) return (0); } -void +void softdep_initialize() { @@ -174,7 +174,7 @@ softdep_setup_blkmapdep(bp, mp, newblkno panic("softdep_setup_blkmapdep called"); } -void +void softdep_setup_allocdirect(ip, lbn, newblkno, oldblkno, newsize, oldsize, bp) struct inode *ip; ufs_lbn_t lbn; @@ -188,7 +188,7 @@ softdep_setup_allocdirect(ip, lbn, newbl panic("softdep_setup_allocdirect called"); } -void +void softdep_setup_allocext(ip, lbn, newblkno, oldblkno, newsize, oldsize, bp) struct inode *ip; ufs_lbn_t lbn; @@ -267,7 +267,7 @@ softdep_freefile(pvp, ino, mode) panic("softdep_freefile called"); } -int +int softdep_setup_directory_add(bp, dp, diroffset, newinum, newdirbp, isnewblk) struct buf *bp; struct inode *dp; @@ -280,7 +280,7 @@ softdep_setup_directory_add(bp, dp, diro panic("softdep_setup_directory_add called"); } -void +void softdep_change_directoryentry_offset(bp, dp, base, oldloc, newloc, entrysize) struct buf *bp; struct inode *dp; @@ -293,7 +293,7 @@ softdep_change_directoryentry_offset(bp, panic("softdep_change_directoryentry_offset called"); } -void +void softdep_setup_remove(bp, dp, ip, isrmdir) struct buf *bp; struct inode *dp; @@ -304,7 +304,7 @@ softdep_setup_remove(bp, dp, ip, isrmdir panic("softdep_setup_remove called"); } -void +void softdep_setup_directory_change(bp, dp, ip, newinum, isrmdir) struct buf *bp; struct inode *dp; @@ -463,7 +463,7 @@ softdep_load_inodeblock(ip) panic("softdep_load_inodeblock called"); } -void +void softdep_update_inodeblock(ip, bp, waitfor) struct inode *ip; struct buf *bp; @@ -753,7 +753,7 @@ static int sync_cgs(struct mount *, int) static int handle_written_filepage(struct pagedep *, struct buf *); static int handle_written_sbdep(struct sbdep *, struct buf *); static void initiate_write_sbdep(struct sbdep *); -static void diradd_inode_written(struct diradd *, struct inodedep *); +static void diradd_inode_written(struct diradd *, struct inodedep *); static int handle_written_indirdep(struct indirdep *, struct buf *, struct buf**); static int handle_written_inodeblock(struct inodedep *, struct buf *); @@ -3246,7 +3246,7 @@ softdep_process_journal(mp, needwk, flag cnt++; /* * Verify some free journal space. softdep_prealloc() should - * guarantee that we don't run out so this is indicative of + * guarantee that we don't run out so this is indicative of * a problem with the flow control. Try to recover * gracefully in any event. */ @@ -10488,7 +10488,7 @@ softdep_setup_inofree(mp, bp, ino, wkhd) * We can free immediately even if the jaddref * isn't attached in a background write as now * the bitmaps are reconciled. - */ + */ wk->wk_state |= COMPLETE | ATTACHED; free_jaddref(WK_JADDREF(wk)); } @@ -10662,7 +10662,7 @@ jnewblk_rollback(jnewblk, fs, cgp, blksf /* Add back in counts associated with the new frags */ blk = blkmap(fs, blksfree, bbase); ffs_fragacct(fs, blk, cgp->cg_frsum, 1); - /* If a complete block has been reassembled, account for it. */ + /* If a complete block has been reassembled, account for it. */ fragno = fragstoblks(fs, bbase); if (ffs_isblock(fs, blksfree, fragno)) { cgp->cg_cs.cs_nffree -= fs->fs_frag; @@ -10677,7 +10677,7 @@ jnewblk_rollback(jnewblk, fs, cgp, blksf return (frags); } -static void +static void initiate_write_bmsafemap(bmsafemap, bp) struct bmsafemap *bmsafemap; struct buf *bp; /* The cg block. */ Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sun Mar 2 02:49:20 2014 (r262677) +++ head/sys/ufs/ffs/ffs_vfsops.c Sun Mar 2 02:52:34 2014 (r262678) @@ -1677,7 +1677,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags /* * We must promote to an exclusive lock for vnode creation. This * can happen if lookup is passed LOCKSHARED. - */ + */ if ((flags & LK_TYPE_MASK) == LK_SHARED) { flags &= ~LK_TYPE_MASK; flags |= LK_EXCLUSIVE; Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Sun Mar 2 02:49:20 2014 (r262677) +++ head/sys/ufs/ffs/ffs_vnops.c Sun Mar 2 02:52:34 2014 (r262678) @@ -720,10 +720,10 @@ ffs_write(ap) if (uio->uio_offset + xfersize > ip->i_size) vnode_pager_setsize(vp, uio->uio_offset + xfersize); - /* + /* * We must perform a read-before-write if the transfer size * does not cover the entire buffer. - */ + */ if (fs->fs_bsize > xfersize) flags |= BA_CLRBUF; else @@ -1082,7 +1082,7 @@ ffs_extwrite(struct vnode *vp, struct ui /* * We must perform a read-before-write if the transfer size * does not cover the entire buffer. - */ + */ if (fs->fs_bsize > xfersize) flags |= BA_CLRBUF; else Modified: head/sys/ufs/ffs/fs.h ============================================================================== --- head/sys/ufs/ffs/fs.h Sun Mar 2 02:49:20 2014 (r262677) +++ head/sys/ufs/ffs/fs.h Sun Mar 2 02:52:34 2014 (r262678) @@ -31,7 +31,7 @@ */ #ifndef _UFS_FFS_FS_H_ -#define _UFS_FFS_FS_H_ +#define _UFS_FFS_FS_H_ #include #include @@ -68,18 +68,18 @@ * given in byte-offset form, so they do not imply a sector size. The * SBLOCKSEARCH specifies the order in which the locations should be searched. */ -#define SBLOCK_FLOPPY 0 -#define SBLOCK_UFS1 8192 -#define SBLOCK_UFS2 65536 -#define SBLOCK_PIGGY 262144 -#define SBLOCKSIZE 8192 -#define SBLOCKSEARCH \ +#define SBLOCK_FLOPPY 0 +#define SBLOCK_UFS1 8192 +#define SBLOCK_UFS2 65536 +#define SBLOCK_PIGGY 262144 +#define SBLOCKSIZE 8192 +#define SBLOCKSEARCH \ { SBLOCK_UFS2, SBLOCK_UFS1, SBLOCK_FLOPPY, SBLOCK_PIGGY, -1 } /* * Max number of fragments per block. This value is NOT tweakable. */ -#define MAXFRAG 8 +#define MAXFRAG 8 /* * Addresses stored in inodes are capable of addressing fragments @@ -109,20 +109,20 @@ * Note that super blocks are always of size SBLOCKSIZE, * and that both SBLOCKSIZE and MAXBSIZE must be >= MINBSIZE. */ -#define MINBSIZE 4096 +#define MINBSIZE 4096 /* * The path name on which the filesystem is mounted is maintained * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in * the super block for this name. */ -#define MAXMNTLEN 468 +#define MAXMNTLEN 468 /* * The volume name for this filesystem is maintained in fs_volname. * MAXVOLLEN defines the length of the buffer allocated. */ -#define MAXVOLLEN 32 +#define MAXVOLLEN 32 /* * There is a 128-byte region in the superblock reserved for in-core @@ -147,7 +147,7 @@ * value of fs_maxcontig. To conserve space, a maximum summary size * is set by FS_MAXCONTIG. */ -#define FS_MAXCONTIG 16 +#define FS_MAXCONTIG 16 /* * MINFREE gives the minimum acceptable percentage of filesystem @@ -161,8 +161,8 @@ * default value. With 10% free space, fragmentation is not a * problem, so we choose to optimize for time. */ -#define MINFREE 8 -#define DEFAULTOPT FS_OPTTIME +#define MINFREE 8 +#define DEFAULTOPT FS_OPTTIME /* * Grigoriy Orlov has done some extensive work to fine @@ -173,8 +173,8 @@ * filesystems, but may need to be tuned for odd cases like filesystems * being used for squid caches or news spools. */ -#define AVFILESIZ 16384 /* expected average file size */ -#define AFPDIR 64 /* expected number of files per directory */ +#define AVFILESIZ 16384 /* expected average file size */ +#define AFPDIR 64 /* expected number of files per directory */ /* * The maximum number of snapshot nodes that can be associated @@ -184,7 +184,7 @@ * maintaining too many will slow the filesystem performance, so * having this limit is a good idea. */ -#define FSMAXSNAP 20 +#define FSMAXSNAP 20 /* * Used to identify special blocks in snapshots: @@ -197,8 +197,8 @@ * identify blocks that are in use by other snapshots (which are * expunged from this snapshot). */ -#define BLK_NOCOPY ((ufs2_daddr_t)(1)) -#define BLK_SNAP ((ufs2_daddr_t)(2)) +#define BLK_NOCOPY ((ufs2_daddr_t)(1)) +#define BLK_SNAP ((ufs2_daddr_t)(2)) /* * Sysctl values for the fast filesystem. @@ -214,7 +214,7 @@ #define FFS_ADJ_NIFREE 9 /* adjust number of free inodes */ #define FFS_ADJ_NFFREE 10 /* adjust number of free frags */ #define FFS_ADJ_NUMCLUSTERS 11 /* adjust number of free clusters */ -#define FFS_SET_CWD 12 /* set current directory */ +#define FFS_SET_CWD 12 /* set current directory */ #define FFS_SET_DOTDOT 13 /* set inode number for ".." */ #define FFS_UNLINK 14 /* remove a name in the filesystem */ #define FFS_SET_INODE 15 /* update an on-disk inode */ @@ -377,14 +377,14 @@ CTASSERT(sizeof(struct fs) == 1376); #define FS_UFS2_MAGIC 0x19540119 /* UFS2 fast filesystem magic number */ #define FS_BAD_MAGIC 0x19960408 /* UFS incomplete newfs magic number */ #define FS_OKAY 0x7c269d38 /* superblock checksum */ -#define FS_42INODEFMT -1 /* 4.2BSD inode format */ -#define FS_44INODEFMT 2 /* 4.4BSD inode format */ +#define FS_42INODEFMT -1 /* 4.2BSD inode format */ +#define FS_44INODEFMT 2 /* 4.4BSD inode format */ /* * Preference for optimization. */ -#define FS_OPTTIME 0 /* minimize allocation time */ -#define FS_OPTSPACE 1 /* minimize disk fragmentation */ +#define FS_OPTTIME 0 /* minimize allocation time */ +#define FS_OPTSPACE 1 /* minimize disk fragmentation */ /* * Filesystem flags. @@ -414,16 +414,16 @@ CTASSERT(sizeof(struct fs) == 1376); * labels into extended attributes on the file system rather than maintain * a single mount label for all objects. */ -#define FS_UNCLEAN 0x0001 /* filesystem not clean at mount */ -#define FS_DOSOFTDEP 0x0002 /* filesystem using soft dependencies */ -#define FS_NEEDSFSCK 0x0004 /* filesystem needs sync fsck before mount */ +#define FS_UNCLEAN 0x0001 /* filesystem not clean at mount */ +#define FS_DOSOFTDEP 0x0002 /* filesystem using soft dependencies */ +#define FS_NEEDSFSCK 0x0004 /* filesystem needs sync fsck before mount */ #define FS_SUJ 0x0008 /* Filesystem using softupdate journal */ -#define FS_ACLS 0x0010 /* file system has POSIX.1e ACLs enabled */ -#define FS_MULTILABEL 0x0020 /* file system is MAC multi-label */ -#define FS_GJOURNAL 0x0040 /* gjournaled file system */ -#define FS_FLAGS_UPDATED 0x0080 /* flags have been moved to new location */ -#define FS_NFS4ACLS 0x0100 /* file system has NFSv4 ACLs enabled */ -#define FS_INDEXDIRS 0x0200 /* kernel supports indexed directories */ +#define FS_ACLS 0x0010 /* file system has POSIX.1e ACLs enabled */ +#define FS_MULTILABEL 0x0020 /* file system is MAC multi-label */ +#define FS_GJOURNAL 0x0040 /* gjournaled file system */ +#define FS_FLAGS_UPDATED 0x0080 /* flags have been moved to new location */ +#define FS_NFS4ACLS 0x0100 /* file system has NFSv4 ACLs enabled */ +#define FS_INDEXDIRS 0x0200 /* kernel supports indexed directories */ #define FS_TRIM 0x0400 /* issue BIO_DELETE for deleted blocks */ /* @@ -446,7 +446,7 @@ CTASSERT(sizeof(struct fs) == 1376); * Its size is derived from the size of the maps maintained in the * cylinder group and the (struct cg) size. */ -#define CGSIZE(fs) \ +#define CGSIZE(fs) \ /* base cg */ (sizeof(struct cg) + sizeof(int32_t) + \ /* old btotoff */ (fs)->fs_old_cpg * sizeof(int32_t) + \ /* old boff */ (fs)->fs_old_cpg * sizeof(u_int16_t) + \ @@ -459,12 +459,12 @@ CTASSERT(sizeof(struct fs) == 1376); /* * The minimal number of cylinder groups that should be created. */ -#define MINCYLGRPS 4 +#define MINCYLGRPS 4 /* * Convert cylinder group to base address of its global summary info. */ -#define fs_cs(fs, indx) fs_csp[indx] +#define fs_cs(fs, indx) fs_csp[indx] /* * Cylinder group block for a filesystem. @@ -504,14 +504,14 @@ struct cg { /* * Macros for access to cylinder group array structures */ -#define cg_chkmagic(cgp) ((cgp)->cg_magic == CG_MAGIC) -#define cg_inosused(cgp) \ +#define cg_chkmagic(cgp) ((cgp)->cg_magic == CG_MAGIC) +#define cg_inosused(cgp) \ ((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_iusedoff)) -#define cg_blksfree(cgp) \ +#define cg_blksfree(cgp) \ ((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_freeoff)) -#define cg_clustersfree(cgp) \ +#define cg_clustersfree(cgp) \ ((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_clusteroff)) -#define cg_clustersum(cgp) \ +#define cg_clustersum(cgp) \ ((int32_t *)((uintptr_t)(cgp) + (cgp)->cg_clustersumoff)) /* @@ -532,7 +532,7 @@ struct cg { #define cgimin(fs, c) (cgstart(fs, c) + (fs)->fs_iblkno) /* inode blk */ #define cgsblock(fs, c) (cgstart(fs, c) + (fs)->fs_sblkno) /* super blk */ #define cgtod(fs, c) (cgstart(fs, c) + (fs)->fs_cblkno) /* cg block */ -#define cgstart(fs, c) \ +#define cgstart(fs, c) \ ((fs)->fs_magic == FS_UFS2_MAGIC ? cgbase(fs, c) : \ (cgbase(fs, c) + (fs)->fs_old_cgoffset * ((c) & ~((fs)->fs_old_cgmask)))) @@ -559,7 +559,7 @@ struct cg { * Extract the bits for a block from a map. * Compute the cylinder and rotational position of a cyl block addr. */ -#define blkmap(fs, map, loc) \ +#define blkmap(fs, map, loc) \ (((map)[(loc) / NBBY] >> ((loc) % NBBY)) & (0xff >> (NBBY - (fs)->fs_frag))) /* @@ -567,39 +567,39 @@ struct cg { * quantities by using shifts and masks in place of divisions * modulos and multiplications. */ -#define blkoff(fs, loc) /* calculates (loc % fs->fs_bsize) */ \ +#define blkoff(fs, loc) /* calculates (loc % fs->fs_bsize) */ \ ((loc) & (fs)->fs_qbmask) -#define fragoff(fs, loc) /* calculates (loc % fs->fs_fsize) */ \ +#define fragoff(fs, loc) /* calculates (loc % fs->fs_fsize) */ \ ((loc) & (fs)->fs_qfmask) -#define lfragtosize(fs, frag) /* calculates ((off_t)frag * fs->fs_fsize) */ \ +#define lfragtosize(fs, frag) /* calculates ((off_t)frag * fs->fs_fsize) */ \ (((off_t)(frag)) << (fs)->fs_fshift) -#define lblktosize(fs, blk) /* calculates ((off_t)blk * fs->fs_bsize) */ \ +#define lblktosize(fs, blk) /* calculates ((off_t)blk * fs->fs_bsize) */ \ (((off_t)(blk)) << (fs)->fs_bshift) /* Use this only when `blk' is known to be small, e.g., < NDADDR. */ -#define smalllblktosize(fs, blk) /* calculates (blk * fs->fs_bsize) */ \ +#define smalllblktosize(fs, blk) /* calculates (blk * fs->fs_bsize) */ \ ((blk) << (fs)->fs_bshift) -#define lblkno(fs, loc) /* calculates (loc / fs->fs_bsize) */ \ +#define lblkno(fs, loc) /* calculates (loc / fs->fs_bsize) */ \ ((loc) >> (fs)->fs_bshift) -#define numfrags(fs, loc) /* calculates (loc / fs->fs_fsize) */ \ +#define numfrags(fs, loc) /* calculates (loc / fs->fs_fsize) */ \ ((loc) >> (fs)->fs_fshift) -#define blkroundup(fs, size) /* calculates roundup(size, fs->fs_bsize) */ \ +#define blkroundup(fs, size) /* calculates roundup(size, fs->fs_bsize) */ \ (((size) + (fs)->fs_qbmask) & (fs)->fs_bmask) -#define fragroundup(fs, size) /* calculates roundup(size, fs->fs_fsize) */ \ +#define fragroundup(fs, size) /* calculates roundup(size, fs->fs_fsize) */ \ (((size) + (fs)->fs_qfmask) & (fs)->fs_fmask) -#define fragstoblks(fs, frags) /* calculates (frags / fs->fs_frag) */ \ +#define fragstoblks(fs, frags) /* calculates (frags / fs->fs_frag) */ \ ((frags) >> (fs)->fs_fragshift) -#define blkstofrags(fs, blks) /* calculates (blks * fs->fs_frag) */ \ +#define blkstofrags(fs, blks) /* calculates (blks * fs->fs_frag) */ \ ((blks) << (fs)->fs_fragshift) -#define fragnum(fs, fsb) /* calculates (fsb % fs->fs_frag) */ \ +#define fragnum(fs, fsb) /* calculates (fsb % fs->fs_frag) */ \ ((fsb) & ((fs)->fs_frag - 1)) -#define blknum(fs, fsb) /* calculates rounddown(fsb, fs->fs_frag) */ \ +#define blknum(fs, fsb) /* calculates rounddown(fsb, fs->fs_frag) */ \ ((fsb) &~ ((fs)->fs_frag - 1)) /* * Determine the number of available frags given a * percentage to hold in reserve. */ -#define freespace(fs, percentreserved) \ +#define freespace(fs, percentreserved) \ (blkstofrags((fs), (fs)->fs_cstotal.cs_nbfree) + \ (fs)->fs_cstotal.cs_nffree - \ (((off_t)((fs)->fs_dsize)) * (percentreserved) / 100)) @@ -607,11 +607,11 @@ struct cg { /* * Determining the size of a file block in the filesystem. */ -#define blksize(fs, ip, lbn) \ +#define blksize(fs, ip, lbn) \ (((lbn) >= NDADDR || (ip)->i_size >= smalllblktosize(fs, (lbn) + 1)) \ ? (fs)->fs_bsize \ : (fragroundup(fs, blkoff(fs, (ip)->i_size)))) -#define sblksize(fs, size, lbn) \ +#define sblksize(fs, size, lbn) \ (((lbn) >= NDADDR || (size) >= ((lbn) + 1) << (fs)->fs_bshift) \ ? (fs)->fs_bsize \ : (fragroundup(fs, blkoff(fs, (size))))) Modified: head/sys/ufs/ffs/softdep.h ============================================================================== --- head/sys/ufs/ffs/softdep.h Sun Mar 2 02:49:20 2014 (r262677) +++ head/sys/ufs/ffs/softdep.h Sun Mar 2 02:52:34 2014 (r262678) @@ -203,22 +203,22 @@ struct worklist { unsigned int wk_type:8, /* type of request */ wk_state:24; /* state flags */ }; -#define WK_DATA(wk) ((void *)(wk)) -#define WK_PAGEDEP(wk) ((struct pagedep *)(wk)) -#define WK_INODEDEP(wk) ((struct inodedep *)(wk)) -#define WK_BMSAFEMAP(wk) ((struct bmsafemap *)(wk)) +#define WK_DATA(wk) ((void *)(wk)) +#define WK_PAGEDEP(wk) ((struct pagedep *)(wk)) +#define WK_INODEDEP(wk) ((struct inodedep *)(wk)) +#define WK_BMSAFEMAP(wk) ((struct bmsafemap *)(wk)) #define WK_NEWBLK(wk) ((struct newblk *)(wk)) -#define WK_ALLOCDIRECT(wk) ((struct allocdirect *)(wk)) -#define WK_INDIRDEP(wk) ((struct indirdep *)(wk)) -#define WK_ALLOCINDIR(wk) ((struct allocindir *)(wk)) -#define WK_FREEFRAG(wk) ((struct freefrag *)(wk)) -#define WK_FREEBLKS(wk) ((struct freeblks *)(wk)) -#define WK_FREEWORK(wk) ((struct freework *)(wk)) -#define WK_FREEFILE(wk) ((struct freefile *)(wk)) -#define WK_DIRADD(wk) ((struct diradd *)(wk)) -#define WK_MKDIR(wk) ((struct mkdir *)(wk)) -#define WK_DIRREM(wk) ((struct dirrem *)(wk)) -#define WK_NEWDIRBLK(wk) ((struct newdirblk *)(wk)) +#define WK_ALLOCDIRECT(wk) ((struct allocdirect *)(wk)) +#define WK_INDIRDEP(wk) ((struct indirdep *)(wk)) +#define WK_ALLOCINDIR(wk) ((struct allocindir *)(wk)) +#define WK_FREEFRAG(wk) ((struct freefrag *)(wk)) +#define WK_FREEBLKS(wk) ((struct freeblks *)(wk)) +#define WK_FREEWORK(wk) ((struct freework *)(wk)) +#define WK_FREEFILE(wk) ((struct freefile *)(wk)) +#define WK_DIRADD(wk) ((struct diradd *)(wk)) +#define WK_MKDIR(wk) ((struct mkdir *)(wk)) +#define WK_DIRREM(wk) ((struct dirrem *)(wk)) +#define WK_NEWDIRBLK(wk) ((struct newdirblk *)(wk)) #define WK_JADDREF(wk) ((struct jaddref *)(wk)) #define WK_JREMREF(wk) ((struct jremref *)(wk)) #define WK_JMVREF(wk) ((struct jmvref *)(wk)) @@ -272,8 +272,8 @@ TAILQ_HEAD(freeblklst, freeblks); * list, any removed operations are done, and the dependency structure * is freed. */ -#define DAHASHSZ 5 -#define DIRADDHASH(offset) (((offset) >> 2) % DAHASHSZ) +#define DAHASHSZ 5 +#define DIRADDHASH(offset) (((offset) >> 2) % DAHASHSZ) struct pagedep { struct worklist pd_list; /* page buffer */ # define pd_state pd_list.wk_state /* check for multiple I/O starts */ @@ -363,8 +363,8 @@ struct inodedep { struct ufs2_dinode *idu_savedino2; /* saved ufs2_dinode contents */ } id_un; }; -#define id_savedino1 id_un.idu_savedino1 -#define id_savedino2 id_un.idu_savedino2 +#define id_savedino1 id_un.idu_savedino1 +#define id_savedino2 id_un.idu_savedino2 /* * A "bmsafemap" structure maintains a list of dependency structures @@ -678,8 +678,8 @@ struct diradd { } da_un; struct workhead da_jwork; /* Journal work awaiting completion. */ }; -#define da_previous da_un.dau_previous -#define da_pagedep da_un.dau_pagedep +#define da_previous da_un.dau_previous +#define da_pagedep da_un.dau_pagedep /* * Two "mkdir" structures are needed to track the additional dependencies @@ -735,8 +735,8 @@ struct dirrem { } dm_un; struct workhead dm_jwork; /* Journal work awaiting completion. */ }; -#define dm_pagedep dm_un.dmu_pagedep -#define dm_dirinum dm_un.dmu_dirinum +#define dm_pagedep dm_un.dmu_pagedep +#define dm_dirinum dm_un.dmu_dirinum /* * A "newdirblk" structure tracks the progress of a newly allocated @@ -1057,30 +1057,30 @@ struct mount_softdeps { /* * Keep the old names from when these were in the ufsmount structure. */ -#define softdep_workitem_pending um_softdep->sd_workitem_pending -#define softdep_worklist_tail um_softdep->sd_worklist_tail -#define softdep_journal_pending um_softdep->sd_journal_pending -#define softdep_journal_tail um_softdep->sd_journal_tail -#define softdep_jblocks um_softdep->sd_jblocks -#define softdep_unlinked um_softdep->sd_unlinked -#define softdep_dirtycg um_softdep->sd_dirtycg -#define softdep_mkdirlisthd um_softdep->sd_mkdirlisthd -#define pagedep_hashtbl um_softdep->sd_pdhash -#define pagedep_hash_size um_softdep->sd_pdhashsize -#define pagedep_nextclean um_softdep->sd_pdnextclean -#define inodedep_hashtbl um_softdep->sd_idhash -#define inodedep_hash_size um_softdep->sd_idhashsize -#define inodedep_nextclean um_softdep->sd_idnextclean -#define newblk_hashtbl um_softdep->sd_newblkhash -#define newblk_hash_size um_softdep->sd_newblkhashsize -#define bmsafemap_hashtbl um_softdep->sd_bmhash -#define bmsafemap_hash_size um_softdep->sd_bmhashsize -#define indir_hashtbl um_softdep->sd_indirhash -#define indir_hash_size um_softdep->sd_indirhashsize -#define softdep_numindirdeps um_softdep->sd_numindirdeps -#define softdep_on_journal um_softdep->sd_on_journal -#define softdep_on_worklist um_softdep->sd_on_worklist -#define softdep_deps um_softdep->sd_deps -#define softdep_accdeps um_softdep->sd_accdeps -#define softdep_req um_softdep->sd_req -#define softdep_curdeps um_softdep->sd_curdeps +#define softdep_workitem_pending um_softdep->sd_workitem_pending +#define softdep_worklist_tail um_softdep->sd_worklist_tail +#define softdep_journal_pending um_softdep->sd_journal_pending +#define softdep_journal_tail um_softdep->sd_journal_tail +#define softdep_jblocks um_softdep->sd_jblocks +#define softdep_unlinked um_softdep->sd_unlinked +#define softdep_dirtycg um_softdep->sd_dirtycg +#define softdep_mkdirlisthd um_softdep->sd_mkdirlisthd +#define pagedep_hashtbl um_softdep->sd_pdhash +#define pagedep_hash_size um_softdep->sd_pdhashsize +#define pagedep_nextclean um_softdep->sd_pdnextclean +#define inodedep_hashtbl um_softdep->sd_idhash +#define inodedep_hash_size um_softdep->sd_idhashsize +#define inodedep_nextclean um_softdep->sd_idnextclean +#define newblk_hashtbl um_softdep->sd_newblkhash +#define newblk_hash_size um_softdep->sd_newblkhashsize +#define bmsafemap_hashtbl um_softdep->sd_bmhash +#define bmsafemap_hash_size um_softdep->sd_bmhashsize +#define indir_hashtbl um_softdep->sd_indirhash +#define indir_hash_size um_softdep->sd_indirhashsize +#define softdep_numindirdeps um_softdep->sd_numindirdeps +#define softdep_on_journal um_softdep->sd_on_journal +#define softdep_on_worklist um_softdep->sd_on_worklist +#define softdep_deps um_softdep->sd_deps +#define softdep_accdeps um_softdep->sd_accdeps +#define softdep_req um_softdep->sd_req +#define softdep_curdeps um_softdep->sd_curdeps Modified: head/sys/ufs/ufs/dir.h ============================================================================== --- head/sys/ufs/ufs/dir.h Sun Mar 2 02:49:20 2014 (r262677) +++ head/sys/ufs/ufs/dir.h Sun Mar 2 02:52:34 2014 (r262678) @@ -44,7 +44,7 @@ * quantity to keep down the cost of doing lookup on a 32-bit machine. */ #define doff_t int32_t -#define MAXDIRSIZE (0x7fffffff) +#define MAXDIRSIZE (0x7fffffff) /* * A directory consists of some number of blocks of DIRBLKSIZ @@ -71,7 +71,7 @@ * Entries other than the first in a directory do not normally have * dp->d_ino set to 0. */ -#define DIRBLKSIZ DEV_BSIZE +#define DIRBLKSIZ DEV_BSIZE #define MAXNAMLEN 255 struct direct { @@ -113,14 +113,14 @@ struct direct { (((uintptr_t)&((struct direct *)0)->d_name + \ ((namlen)+1)*sizeof(((struct direct *)0)->d_name[0]) + 3) & ~3) #if (BYTE_ORDER == LITTLE_ENDIAN) -#define DIRSIZ(oldfmt, dp) \ +#define DIRSIZ(oldfmt, dp) \ ((oldfmt) ? DIRECTSIZ((dp)->d_type) : DIRECTSIZ((dp)->d_namlen)) #else -#define DIRSIZ(oldfmt, dp) \ +#define DIRSIZ(oldfmt, dp) \ DIRECTSIZ((dp)->d_namlen) #endif -#define OLDDIRFMT 1 -#define NEWDIRFMT 0 +#define OLDDIRFMT 1 +#define NEWDIRFMT 0 /* * Template for manipulating directories. Should use struct direct's, Modified: head/sys/ufs/ufs/dirhash.h ============================================================================== --- head/sys/ufs/ufs/dirhash.h Sun Mar 2 02:49:20 2014 (r262677) +++ head/sys/ufs/ufs/dirhash.h Sun Mar 2 02:52:34 2014 (r262678) @@ -26,7 +26,7 @@ */ #ifndef _UFS_UFS_DIRHASH_H_ -#define _UFS_UFS_DIRHASH_H_ +#define _UFS_UFS_DIRHASH_H_ #include #include @@ -44,11 +44,11 @@ * We also maintain information about free space in each block * to speed up creations. */ -#define DIRHASH_EMPTY (-1) /* entry unused */ -#define DIRHASH_DEL (-2) /* deleted entry; may be part of chain */ +#define DIRHASH_EMPTY (-1) /* entry unused */ +#define DIRHASH_DEL (-2) /* deleted entry; may be part of chain */ -#define DIRALIGN 4 -#define DH_NFSTATS (DIRECTSIZ(MAXNAMLEN + 1) / DIRALIGN) +#define DIRALIGN 4 +#define DH_NFSTATS (DIRECTSIZ(MAXNAMLEN + 1) / DIRALIGN) /* max DIRALIGN words in a directory entry */ /* @@ -68,18 +68,18 @@ * case it limits the number of hash builds to 1/DH_SCOREINIT of the * number of accesses. */ -#define DH_SCOREINIT 8 /* initial dh_score when dirhash built */ -#define DH_SCOREMAX 64 /* max dh_score value */ +#define DH_SCOREINIT 8 /* initial dh_score when dirhash built */ +#define DH_SCOREMAX 64 /* max dh_score value */ /* * The main hash table has 2 levels. It is an array of pointers to * blocks of DH_NBLKOFF offsets. */ -#define DH_BLKOFFSHIFT 8 -#define DH_NBLKOFF (1 << DH_BLKOFFSHIFT) -#define DH_BLKOFFMASK (DH_NBLKOFF - 1) +#define DH_BLKOFFSHIFT 8 +#define DH_NBLKOFF (1 << DH_BLKOFFSHIFT) +#define DH_BLKOFFMASK (DH_NBLKOFF - 1) -#define DH_ENTRY(dh, slot) \ +#define DH_ENTRY(dh, slot) \ ((dh)->dh_hash[(slot) >> DH_BLKOFFSHIFT][(slot) & DH_BLKOFFMASK]) struct dirhash { Modified: head/sys/ufs/ufs/extattr.h ============================================================================== --- head/sys/ufs/ufs/extattr.h Sun Mar 2 02:49:20 2014 (r262677) +++ head/sys/ufs/ufs/extattr.h Sun Mar 2 02:52:34 2014 (r262678) @@ -94,14 +94,14 @@ struct extattr { * attribute name to calculate and set the ea_length, ea_namelength, * and ea_contentpadlen fields of the extended attribute structure. */ -#define EXTATTR_NEXT(eap) \ +#define EXTATTR_NEXT(eap) \ ((struct extattr *)(((void *)(eap)) + (eap)->ea_length)) -#define EXTATTR_CONTENT(eap) (((void *)(eap)) + EXTATTR_BASE_LENGTH(eap)) -#define EXTATTR_CONTENT_SIZE(eap) \ +#define EXTATTR_CONTENT(eap) (((void *)(eap)) + EXTATTR_BASE_LENGTH(eap)) +#define EXTATTR_CONTENT_SIZE(eap) \ ((eap)->ea_length - EXTATTR_BASE_LENGTH(eap) - (eap)->ea_contentpadlen) -#define EXTATTR_BASE_LENGTH(eap) \ +#define EXTATTR_BASE_LENGTH(eap) \ ((sizeof(struct extattr) + (eap)->ea_namelength + 7) & ~7) -#define EXTATTR_SET_LENGTHS(eap, contentsize) do { \ +#define EXTATTR_SET_LENGTHS(eap, contentsize) do { \ KASSERT(((eap)->ea_name[0] != 0), \ ("Must initialize name before setting lengths")); \ (eap)->ea_namelength = strlen((eap)->ea_name); \ @@ -148,7 +148,7 @@ void ufs_extattr_vnode_inactive(struct v #else /* User-level definition of KASSERT for macros above */ -#define KASSERT(cond, str) do { \ +#define KASSERT(cond, str) do { \ if (!(cond)) { printf("panic: "); printf(str); printf("\n"); exit(1); }\ } while (0) Modified: head/sys/ufs/ufs/gjournal.h ============================================================================== --- head/sys/ufs/ufs/gjournal.h Sun Mar 2 02:49:20 2014 (r262677) +++ head/sys/ufs/ufs/gjournal.h Sun Mar 2 02:52:34 2014 (r262678) @@ -27,7 +27,7 @@ */ #ifndef _UFS_UFS_GJOURNAL_H_ -#define _UFS_UFS_GJOURNAL_H_ +#define _UFS_UFS_GJOURNAL_H_ /* * GEOM journal function prototypes. Modified: head/sys/ufs/ufs/inode.h ============================================================================== --- head/sys/ufs/ufs/inode.h Sun Mar 2 02:49:20 2014 (r262677) +++ head/sys/ufs/ufs/inode.h Sun Mar 2 02:52:34 2014 (r262678) @@ -129,12 +129,12 @@ struct inode { #define IN_TRUNCATED 0x0800 /* Journaled truncation pending. */ -#define i_devvp i_ump->um_devvp -#define i_umbufobj i_ump->um_bo -#define i_dirhash i_un.dirhash -#define i_snapblklist i_un.snapblklist -#define i_din1 dinode_u.din1 -#define i_din2 dinode_u.din2 +#define i_devvp i_ump->um_devvp +#define i_umbufobj i_ump->um_bo +#define i_dirhash i_un.dirhash +#define i_snapblklist i_un.snapblklist +#define i_din1 dinode_u.din1 +#define i_din2 dinode_u.din2 #ifdef _KERNEL /* @@ -154,7 +154,7 @@ struct inode { #define SHORTLINK(ip) \ (((ip)->i_ump->um_fstype == UFS1) ? \ (caddr_t)(ip)->i_din1->di_db : (caddr_t)(ip)->i_din2->di_db) -#define IS_SNAPSHOT(ip) ((ip)->i_flags & SF_SNAPSHOT) +#define IS_SNAPSHOT(ip) ((ip)->i_flags & SF_SNAPSHOT) /* * Structure used to pass around logical block paths generated by @@ -166,14 +166,14 @@ struct indir { }; /* Convert between inode pointers and vnode pointers. */ -#define VTOI(vp) ((struct inode *)(vp)->v_data) -#define ITOV(ip) ((ip)->i_vnode) +#define VTOI(vp) ((struct inode *)(vp)->v_data) +#define ITOV(ip) ((ip)->i_vnode) /* Determine if soft dependencies are being done */ -#define DOINGSOFTDEP(vp) ((vp)->v_mount->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) -#define MOUNTEDSOFTDEP(mp) ((mp)->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) -#define DOINGSUJ(vp) ((vp)->v_mount->mnt_flag & MNT_SUJ) -#define MOUNTEDSUJ(mp) ((mp)->mnt_flag & MNT_SUJ) +#define DOINGSOFTDEP(vp) ((vp)->v_mount->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) +#define MOUNTEDSOFTDEP(mp) ((mp)->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) +#define DOINGSUJ(vp) ((vp)->v_mount->mnt_flag & MNT_SUJ) +#define MOUNTEDSUJ(mp) ((mp)->mnt_flag & MNT_SUJ) /* This overlays the fid structure (see mount.h). */ struct ufid { Modified: head/sys/ufs/ufs/quota.h ============================================================================== --- head/sys/ufs/ufs/quota.h Sun Mar 2 02:49:20 2014 (r262677) +++ head/sys/ufs/ufs/quota.h Sun Mar 2 02:52:34 2014 (r262678) @@ -62,7 +62,7 @@ /* * Definitions for the default names of the quotas files. */ -#define INITQFNAMES { \ +#define INITQFNAMES { \ "user", /* USRQUOTA */ \ "group", /* GRPQUOTA */ \ "undefined", \ @@ -75,8 +75,8 @@ * broken into a main command defined below and a subcommand that is used * to convey the type of quota that is being manipulated (see above). */ -#define SUBCMDMASK 0x00ff -#define SUBCMDSHIFT 8 +#define SUBCMDMASK 0x00ff +#define SUBCMDSHIFT 8 #define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK)) #define Q_QUOTAON 0x0100 /* enable quotas */ @@ -119,10 +119,10 @@ struct dqblk64 { int64_t dqb_itime; /* time limit for excessive files */ }; -#define dqblk dqblk64 +#define dqblk dqblk64 -#define Q_DQHDR64_MAGIC "QUOTA64" -#define Q_DQHDR64_VERSION 0x20081104 +#define Q_DQHDR64_MAGIC "QUOTA64" +#define Q_DQHDR64_VERSION 0x20081104 struct dqhdr64 { char dqh_magic[8]; /* Q_DQHDR64_MAGIC */ Modified: head/sys/ufs/ufs/ufs_extern.h ============================================================================== --- head/sys/ufs/ufs/ufs_extern.h Sun Mar 2 02:49:20 2014 (r262677) +++ head/sys/ufs/ufs/ufs_extern.h Sun Mar 2 02:52:34 2014 (r262678) @@ -117,11 +117,11 @@ void softdep_revert_rmdir(struct inode * * Note: The general vfs code typically limits the sequential heuristic * count to 127. See sequential_heuristic() in kern/vfs_vnops.c */ -#define BA_CLRBUF 0x00010000 /* Clear invalid areas of buffer. */ -#define BA_METAONLY 0x00020000 /* Return indirect block buffer. */ +#define BA_CLRBUF 0x00010000 /* Clear invalid areas of buffer. */ +#define BA_METAONLY 0x00020000 /* Return indirect block buffer. */ #define BA_UNMAPPED 0x00040000 /* Do not mmap resulted buffer. */ -#define BA_SEQMASK 0x7F000000 /* Bits holding seq heuristic. */ -#define BA_SEQSHIFT 24 -#define BA_SEQMAX 0x7F +#define BA_SEQMASK 0x7F000000 /* Bits holding seq heuristic. */ +#define BA_SEQSHIFT 24 +#define BA_SEQMAX 0x7F #endif /* !_UFS_UFS_EXTERN_H_ */ Modified: head/sys/ufs/ufs/ufsmount.h ============================================================================== --- head/sys/ufs/ufs/ufsmount.h Sun Mar 2 02:49:20 2014 (r262677) +++ head/sys/ufs/ufs/ufsmount.h Sun Mar 2 02:52:34 2014 (r262678) @@ -31,7 +31,7 @@ */ #ifndef _UFS_UFS_UFSMOUNT_H_ -#define _UFS_UFS_UFSMOUNT_H_ +#define _UFS_UFS_UFSMOUNT_H_ #include /* XXX For struct workhead. */ @@ -98,13 +98,13 @@ struct ufsmount { void (*um_snapgone)(struct inode *); }; -#define UFS_BALLOC(aa, bb, cc, dd, ee, ff) VFSTOUFS((aa)->v_mount)->um_balloc(aa, bb, cc, dd, ee, ff) -#define UFS_BLKATOFF(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_blkatoff(aa, bb, cc, dd) -#define UFS_TRUNCATE(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd) -#define UFS_UPDATE(aa, bb) VFSTOUFS((aa)->v_mount)->um_update(aa, bb) -#define UFS_VALLOC(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd) -#define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc) -#define UFS_IFREE(aa, bb) ((aa)->um_ifree(aa, bb)) +#define UFS_BALLOC(aa, bb, cc, dd, ee, ff) VFSTOUFS((aa)->v_mount)->um_balloc(aa, bb, cc, dd, ee, ff) +#define UFS_BLKATOFF(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_blkatoff(aa, bb, cc, dd) +#define UFS_TRUNCATE(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd) +#define UFS_UPDATE(aa, bb) VFSTOUFS((aa)->v_mount)->um_update(aa, bb) +#define UFS_VALLOC(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd) +#define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc) +#define UFS_IFREE(aa, bb) ((aa)->um_ifree(aa, bb)) #define UFS_RDONLY(aa) ((aa)->i_ump->um_rdonly(aa)) #define UFS_SNAPGONE(aa) ((aa)->i_ump->um_snapgone(aa)) @@ -115,25 +115,25 @@ struct ufsmount { /* * Filesystem types */ -#define UFS1 1 -#define UFS2 2 +#define UFS1 1 +#define UFS2 2 /* * Flags describing the state of quotas. */ #define QTF_OPENING 0x01 /* Q_QUOTAON in progress */ #define QTF_CLOSING 0x02 /* Q_QUOTAOFF in progress */ -#define QTF_64BIT 0x04 /* 64-bit quota file */ +#define QTF_64BIT 0x04 /* 64-bit quota file */ /* Convert mount ptr to ufsmount ptr. */ -#define VFSTOUFS(mp) ((struct ufsmount *)((mp)->mnt_data)) +#define VFSTOUFS(mp) ((struct ufsmount *)((mp)->mnt_data)) #define UFSTOVFS(ump) (ump)->um_mountp /* * Macros to access filesystem parameters in the ufsmount structure. * Used by ufs_bmap. */ -#define MNINDIR(ump) ((ump)->um_nindir) +#define MNINDIR(ump) ((ump)->um_nindir) #define blkptrtodb(ump, b) ((b) << (ump)->um_bptrtodb) #define is_sequential(ump, a, b) ((b) == (a) + ump->um_seqinc) #endif /* _KERNEL */ From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 05:47:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A4534CD; Sun, 2 Mar 2014 05:47:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1365D1D39; Sun, 2 Mar 2014 05:47:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s225l5mZ078340; Sun, 2 Mar 2014 05:47:05 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s225l5YY078339; Sun, 2 Mar 2014 05:47:05 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403020547.s225l5YY078339@svn.freebsd.org> From: Adrian Chadd Date: Sun, 2 Mar 2014 05:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262680 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 05:47:06 -0000 Author: adrian Date: Sun Mar 2 05:47:05 2014 New Revision: 262680 URL: http://svnweb.freebsd.org/changeset/base/262680 Log: Add AR8216 era ATU management/configuration register definitions. Obtained from: OpenWRT Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchreg.h Sun Mar 2 03:34:06 2014 (r262679) +++ head/sys/dev/etherswitch/arswitch/arswitchreg.h Sun Mar 2 05:47:05 2014 (r262680) @@ -38,6 +38,11 @@ #define SM(_v, _f) (((_v) << _f##_S) & (_f)) #define MS(_v, _f) (((_v) & (_f)) >> _f##_S) +/* XXX Linux define compatibility stuff */ +#define BIT(_m) (1UL << (_m)) +#define BITM(_count) ((1UL << (_count)) - 1) +#define BITS(_shift, _count) (BITM(_count) << (_shift)) + /* Atheros specific MII registers */ #define MII_ATH_MMD_ADDR 0x0d #define MII_ATH_MMD_DATA 0x0e @@ -119,10 +124,34 @@ #define AR8X16_VLAN_MEMBER 0x0000003f #define AR8X16_VLAN_VALID (1 << 11) -#define AR8X16_REG_ARL_CTRL0 0x0050 -#define AR8X16_REG_ARL_CTRL1 0x0054 +#define AR8216_REG_ATU 0x0050 +#define AR8216_ATU_OP BITS(0, 3) +#define AR8216_ATU_OP_NOOP 0x0 +#define AR8216_ATU_OP_FLUSH 0x1 +#define AR8216_ATU_OP_LOAD 0x2 +#define AR8216_ATU_OP_PURGE 0x3 +#define AR8216_ATU_OP_FLUSH_LOCKED 0x4 +#define AR8216_ATU_OP_FLUSH_UNICAST 0x5 +#define AR8216_ATU_OP_GET_NEXT 0x6 +#define AR8216_ATU_ACTIVE BIT(3) +#define AR8216_ATU_PORT_NUM BITS(8, 4) +#define AR8216_ATU_FULL_VIO BIT(12) +#define AR8216_ATU_ADDR4 BITS(16, 8) +#define AR8216_ATU_ADDR5 BITS(24, 8) + +#define AR8216_REG_ATU_DATA 0x0054 +#define AR8216_ATU_ADDR3 BITS(0, 8) +#define AR8216_ATU_ADDR2 BITS(8, 8) +#define AR8216_ATU_ADDR1 BITS(16, 8) +#define AR8216_ATU_ADDR0 BITS(24, 8) + #define AR8X16_REG_ARL_CTRL2 0x0058 +#define AR8216_REG_ATU_CTRL 0x005C +#define AR8216_ATU_CTRL_AGE_EN BIT(17) +#define AR8216_ATU_CTRL_AGE_TIME BITS(0, 16) +#define AR8216_ATU_CTRL_AGE_TIME_S 0 + #define AR8X16_REG_AT_CTRL 0x005c #define AR8X16_AT_CTRL_ARP_EN (1 << 20) @@ -295,10 +324,6 @@ * AR9340 switch specific definitions. */ -/* XXX Linux define compatibility stuff */ -#define BITM(_count) ((1UL << _count) - 1) -#define BITS(_shift, _count) (BITM(_count) << _shift) - #define AR934X_REG_OPER_MODE0 0x04 #define AR934X_OPER_MODE0_MAC_GMII_EN (1 << 6) #define AR934X_OPER_MODE0_PHY_MII_EN (1 << 10) From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 08:58:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E55F884C; Sun, 2 Mar 2014 08:58:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C74F81AD9; Sun, 2 Mar 2014 08:58:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s228wMDK055015; Sun, 2 Mar 2014 08:58:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s228wLKb055007; Sun, 2 Mar 2014 08:58:21 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403020858.s228wLKb055007@svn.freebsd.org> From: Xin LI Date: Sun, 2 Mar 2014 08:58:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262685 - in head: contrib/ncurses contrib/ncurses/doc contrib/ncurses/doc/html contrib/ncurses/form contrib/ncurses/include contrib/ncurses/man contrib/ncurses/menu contrib/ncurses/mis... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 08:58:23 -0000 Author: delphij Date: Sun Mar 2 08:58:21 2014 New Revision: 262685 URL: http://svnweb.freebsd.org/changeset/base/262685 Log: MFV r262639: ncurses 5.9 20140222 snapshot. Requested by: bapt Added: head/contrib/ncurses/COPYING - copied unchanged from r262639, vendor/ncurses/dist/COPYING head/contrib/ncurses/include/nc_string.h - copied unchanged from r262639, vendor/ncurses/dist/include/nc_string.h head/contrib/ncurses/include/nc_termios.h - copied unchanged from r262639, vendor/ncurses/dist/include/nc_termios.h head/contrib/ncurses/man/manhtml.aliases - copied unchanged from r262639, vendor/ncurses/dist/man/manhtml.aliases head/contrib/ncurses/man/manhtml.externs - copied unchanged from r262639, vendor/ncurses/dist/man/manhtml.externs head/contrib/ncurses/ncurses/llib-ltic - copied unchanged from r262639, vendor/ncurses/dist/ncurses/llib-ltic head/contrib/ncurses/ncurses/llib-ltict - copied unchanged from r262639, vendor/ncurses/dist/ncurses/llib-ltict head/contrib/ncurses/ncurses/llib-ltictw - copied unchanged from r262639, vendor/ncurses/dist/ncurses/llib-ltictw head/contrib/ncurses/ncurses/llib-lticw - copied unchanged from r262639, vendor/ncurses/dist/ncurses/llib-lticw head/contrib/ncurses/ncurses/llib-ltinfo - copied unchanged from r262639, vendor/ncurses/dist/ncurses/llib-ltinfo head/contrib/ncurses/ncurses/llib-ltinfot - copied unchanged from r262639, vendor/ncurses/dist/ncurses/llib-ltinfot head/contrib/ncurses/ncurses/llib-ltinfotw - copied unchanged from r262639, vendor/ncurses/dist/ncurses/llib-ltinfotw head/contrib/ncurses/ncurses/llib-ltinfow - copied unchanged from r262639, vendor/ncurses/dist/ncurses/llib-ltinfow head/contrib/ncurses/ncurses/tinfo/obsolete.c - copied unchanged from r262639, vendor/ncurses/dist/ncurses/tinfo/obsolete.c head/contrib/ncurses/ncurses/widechar/widechars.c - copied unchanged from r262639, vendor/ncurses/dist/ncurses/widechar/widechars.c Deleted: head/contrib/ncurses/mk-dlls.sh.in head/contrib/ncurses/ncurses/base/memmove.c head/contrib/ncurses/ncurses/tinfo/setbuf.c head/contrib/ncurses/ncurses/tty/tty_display.h head/contrib/ncurses/ncurses/tty/tty_input.h Modified: head/contrib/ncurses/INSTALL head/contrib/ncurses/MANIFEST head/contrib/ncurses/Makefile.in head/contrib/ncurses/NEWS head/contrib/ncurses/README head/contrib/ncurses/README.MinGW head/contrib/ncurses/aclocal.m4 head/contrib/ncurses/announce.html.in head/contrib/ncurses/config.guess head/contrib/ncurses/config.sub head/contrib/ncurses/configure head/contrib/ncurses/configure.in head/contrib/ncurses/dist.mk head/contrib/ncurses/doc/html/NCURSES-Programming-HOWTO.html head/contrib/ncurses/doc/html/announce.html head/contrib/ncurses/doc/html/hackguide.html head/contrib/ncurses/doc/html/ncurses-intro.html head/contrib/ncurses/doc/ncurses-intro.doc head/contrib/ncurses/form/Makefile.in head/contrib/ncurses/form/fld_arg.c head/contrib/ncurses/form/fld_def.c head/contrib/ncurses/form/fld_dup.c head/contrib/ncurses/form/fld_ftchoice.c head/contrib/ncurses/form/fld_ftlink.c head/contrib/ncurses/form/fld_just.c head/contrib/ncurses/form/fld_link.c head/contrib/ncurses/form/fld_max.c head/contrib/ncurses/form/fld_move.c head/contrib/ncurses/form/fld_page.c head/contrib/ncurses/form/fld_stat.c head/contrib/ncurses/form/form.h head/contrib/ncurses/form/form.priv.h head/contrib/ncurses/form/frm_data.c head/contrib/ncurses/form/frm_def.c head/contrib/ncurses/form/frm_driver.c head/contrib/ncurses/form/frm_hook.c head/contrib/ncurses/form/frm_opts.c head/contrib/ncurses/form/frm_page.c head/contrib/ncurses/form/frm_post.c head/contrib/ncurses/form/frm_req_name.c head/contrib/ncurses/form/fty_generic.c head/contrib/ncurses/form/fty_int.c head/contrib/ncurses/form/fty_num.c head/contrib/ncurses/form/fty_regex.c head/contrib/ncurses/form/llib-lformtw head/contrib/ncurses/form/llib-lformw head/contrib/ncurses/include/Caps head/contrib/ncurses/include/Caps.aix4 head/contrib/ncurses/include/Caps.hpux11 head/contrib/ncurses/include/Caps.keys head/contrib/ncurses/include/Caps.osf1r5 head/contrib/ncurses/include/MKkey_defs.sh head/contrib/ncurses/include/MKterm.h.awk.in head/contrib/ncurses/include/Makefile.in head/contrib/ncurses/include/curses.h.in head/contrib/ncurses/include/curses.tail head/contrib/ncurses/include/curses.wide head/contrib/ncurses/include/headers head/contrib/ncurses/include/nc_alloc.h head/contrib/ncurses/include/nc_tparm.h head/contrib/ncurses/include/ncurses_defs head/contrib/ncurses/include/ncurses_mingw.h head/contrib/ncurses/include/term_entry.h head/contrib/ncurses/include/tic.h head/contrib/ncurses/man/Makefile.in head/contrib/ncurses/man/clear.1 head/contrib/ncurses/man/curs_add_wch.3x head/contrib/ncurses/man/curs_add_wchstr.3x head/contrib/ncurses/man/curs_addchstr.3x head/contrib/ncurses/man/curs_addstr.3x head/contrib/ncurses/man/curs_addwstr.3x head/contrib/ncurses/man/curs_attr.3x head/contrib/ncurses/man/curs_bkgrnd.3x head/contrib/ncurses/man/curs_border_set.3x head/contrib/ncurses/man/curs_get_wch.3x head/contrib/ncurses/man/curs_get_wstr.3x head/contrib/ncurses/man/curs_getcchar.3x head/contrib/ncurses/man/curs_getch.3x head/contrib/ncurses/man/curs_in_wchstr.3x head/contrib/ncurses/man/curs_initscr.3x head/contrib/ncurses/man/curs_inopts.3x head/contrib/ncurses/man/curs_ins_wstr.3x head/contrib/ncurses/man/curs_inwstr.3x head/contrib/ncurses/man/curs_mouse.3x head/contrib/ncurses/man/curs_opaque.3x head/contrib/ncurses/man/curs_overlay.3x head/contrib/ncurses/man/curs_sp_funcs.3x head/contrib/ncurses/man/curs_termcap.3x head/contrib/ncurses/man/curs_terminfo.3x head/contrib/ncurses/man/curs_threads.3x head/contrib/ncurses/man/curs_util.3x head/contrib/ncurses/man/curs_variables.3x head/contrib/ncurses/man/form_field.3x head/contrib/ncurses/man/form_variables.3x head/contrib/ncurses/man/infocmp.1m head/contrib/ncurses/man/menu_items.3x head/contrib/ncurses/man/ncurses.3x head/contrib/ncurses/man/resizeterm.3x head/contrib/ncurses/man/tabs.1 head/contrib/ncurses/man/term.7 head/contrib/ncurses/man/term_variables.3x head/contrib/ncurses/man/terminfo.head head/contrib/ncurses/man/terminfo.tail head/contrib/ncurses/man/tic.1m head/contrib/ncurses/man/toe.1m head/contrib/ncurses/man/tput.1 head/contrib/ncurses/man/tset.1 head/contrib/ncurses/menu/Makefile.in head/contrib/ncurses/menu/m_attribs.c head/contrib/ncurses/menu/m_driver.c head/contrib/ncurses/menu/m_format.c head/contrib/ncurses/menu/m_global.c head/contrib/ncurses/menu/m_hook.c head/contrib/ncurses/menu/m_item_new.c head/contrib/ncurses/menu/m_pad.c head/contrib/ncurses/menu/m_post.c head/contrib/ncurses/menu/m_req_name.c head/contrib/ncurses/menu/m_spacing.c head/contrib/ncurses/menu/menu.priv.h head/contrib/ncurses/menu/mf_common.h head/contrib/ncurses/misc/Makefile.in head/contrib/ncurses/misc/gen-pkgconfig.in head/contrib/ncurses/misc/gen_edit.sh head/contrib/ncurses/misc/ncurses-config.in head/contrib/ncurses/misc/run_tic.in head/contrib/ncurses/misc/terminfo.src head/contrib/ncurses/mk-0th.awk head/contrib/ncurses/mk-1st.awk head/contrib/ncurses/mk-hdr.awk head/contrib/ncurses/ncurses/Makefile.in head/contrib/ncurses/ncurses/base/MKkeyname.awk head/contrib/ncurses/ncurses/base/MKlib_gen.sh head/contrib/ncurses/ncurses/base/MKunctrl.awk head/contrib/ncurses/ncurses/base/keybound.c head/contrib/ncurses/ncurses/base/keyok.c head/contrib/ncurses/ncurses/base/lib_addch.c head/contrib/ncurses/ncurses/base/lib_addstr.c head/contrib/ncurses/ncurses/base/lib_beep.c head/contrib/ncurses/ncurses/base/lib_bkgd.c head/contrib/ncurses/ncurses/base/lib_chgat.c head/contrib/ncurses/ncurses/base/lib_color.c head/contrib/ncurses/ncurses/base/lib_colorset.c head/contrib/ncurses/ncurses/base/lib_dft_fgbg.c head/contrib/ncurses/ncurses/base/lib_driver.c head/contrib/ncurses/ncurses/base/lib_flash.c head/contrib/ncurses/ncurses/base/lib_freeall.c head/contrib/ncurses/ncurses/base/lib_getch.c head/contrib/ncurses/ncurses/base/lib_getstr.c head/contrib/ncurses/ncurses/base/lib_insch.c head/contrib/ncurses/ncurses/base/lib_instr.c head/contrib/ncurses/ncurses/base/lib_mouse.c head/contrib/ncurses/ncurses/base/lib_newterm.c head/contrib/ncurses/ncurses/base/lib_newwin.c head/contrib/ncurses/ncurses/base/lib_overlay.c head/contrib/ncurses/ncurses/base/lib_printw.c head/contrib/ncurses/ncurses/base/lib_refresh.c head/contrib/ncurses/ncurses/base/lib_restart.c head/contrib/ncurses/ncurses/base/lib_scanw.c head/contrib/ncurses/ncurses/base/lib_screen.c head/contrib/ncurses/ncurses/base/lib_scroll.c head/contrib/ncurses/ncurses/base/lib_set_term.c head/contrib/ncurses/ncurses/base/lib_slkatr_set.c head/contrib/ncurses/ncurses/base/lib_slkcolor.c head/contrib/ncurses/ncurses/base/lib_slkrefr.c head/contrib/ncurses/ncurses/base/lib_slkset.c head/contrib/ncurses/ncurses/base/lib_touch.c head/contrib/ncurses/ncurses/base/lib_ungetch.c head/contrib/ncurses/ncurses/base/resizeterm.c head/contrib/ncurses/ncurses/base/safe_sprintf.c head/contrib/ncurses/ncurses/base/vsscanf.c head/contrib/ncurses/ncurses/base/wresize.c head/contrib/ncurses/ncurses/build.priv.h head/contrib/ncurses/ncurses/curses.priv.h head/contrib/ncurses/ncurses/fifo_defs.h head/contrib/ncurses/ncurses/llib-lncurses head/contrib/ncurses/ncurses/llib-lncursest head/contrib/ncurses/ncurses/llib-lncursestw head/contrib/ncurses/ncurses/llib-lncursesw head/contrib/ncurses/ncurses/modules head/contrib/ncurses/ncurses/tinfo/MKcaptab.sh head/contrib/ncurses/ncurses/tinfo/access.c head/contrib/ncurses/ncurses/tinfo/alloc_entry.c head/contrib/ncurses/ncurses/tinfo/alloc_ttype.c head/contrib/ncurses/ncurses/tinfo/captoinfo.c head/contrib/ncurses/ncurses/tinfo/comp_error.c head/contrib/ncurses/ncurses/tinfo/comp_expand.c head/contrib/ncurses/ncurses/tinfo/comp_parse.c head/contrib/ncurses/ncurses/tinfo/comp_scan.c head/contrib/ncurses/ncurses/tinfo/db_iterator.c head/contrib/ncurses/ncurses/tinfo/doalloc.c head/contrib/ncurses/ncurses/tinfo/entries.c head/contrib/ncurses/ncurses/tinfo/getenv_num.c head/contrib/ncurses/ncurses/tinfo/hashed_db.c head/contrib/ncurses/ncurses/tinfo/home_terminfo.c head/contrib/ncurses/ncurses/tinfo/lib_acs.c head/contrib/ncurses/ncurses/tinfo/lib_baudrate.c head/contrib/ncurses/ncurses/tinfo/lib_cur_term.c head/contrib/ncurses/ncurses/tinfo/lib_data.c head/contrib/ncurses/ncurses/tinfo/lib_has_cap.c head/contrib/ncurses/ncurses/tinfo/lib_napms.c head/contrib/ncurses/ncurses/tinfo/lib_options.c head/contrib/ncurses/ncurses/tinfo/lib_print.c head/contrib/ncurses/ncurses/tinfo/lib_raw.c head/contrib/ncurses/ncurses/tinfo/lib_setup.c head/contrib/ncurses/ncurses/tinfo/lib_termcap.c head/contrib/ncurses/ncurses/tinfo/lib_tgoto.c head/contrib/ncurses/ncurses/tinfo/lib_ti.c head/contrib/ncurses/ncurses/tinfo/lib_tparm.c head/contrib/ncurses/ncurses/tinfo/lib_tputs.c head/contrib/ncurses/ncurses/tinfo/lib_ttyflags.c head/contrib/ncurses/ncurses/tinfo/make_hash.c head/contrib/ncurses/ncurses/tinfo/make_keys.c head/contrib/ncurses/ncurses/tinfo/name_match.c head/contrib/ncurses/ncurses/tinfo/parse_entry.c head/contrib/ncurses/ncurses/tinfo/read_entry.c head/contrib/ncurses/ncurses/tinfo/read_termcap.c head/contrib/ncurses/ncurses/tinfo/strings.c head/contrib/ncurses/ncurses/tinfo/tinfo_driver.c head/contrib/ncurses/ncurses/tinfo/trim_sgr0.c head/contrib/ncurses/ncurses/tinfo/write_entry.c head/contrib/ncurses/ncurses/trace/lib_trace.c head/contrib/ncurses/ncurses/trace/lib_traceatr.c head/contrib/ncurses/ncurses/trace/lib_tracebits.c head/contrib/ncurses/ncurses/trace/lib_tracechr.c head/contrib/ncurses/ncurses/trace/lib_tracedmp.c head/contrib/ncurses/ncurses/trace/lib_tracemse.c head/contrib/ncurses/ncurses/trace/trace_buf.c head/contrib/ncurses/ncurses/trace/trace_tries.c head/contrib/ncurses/ncurses/trace/varargs.c head/contrib/ncurses/ncurses/trace/visbuf.c head/contrib/ncurses/ncurses/tty/hardscroll.c head/contrib/ncurses/ncurses/tty/hashmap.c head/contrib/ncurses/ncurses/tty/lib_mvcur.c head/contrib/ncurses/ncurses/tty/lib_tstp.c head/contrib/ncurses/ncurses/tty/lib_twait.c head/contrib/ncurses/ncurses/tty/lib_vidattr.c head/contrib/ncurses/ncurses/tty/tty_update.c head/contrib/ncurses/ncurses/wcwidth.h head/contrib/ncurses/ncurses/widechar/lib_box_set.c head/contrib/ncurses/ncurses/widechar/lib_cchar.c head/contrib/ncurses/ncurses/widechar/lib_erasewchar.c head/contrib/ncurses/ncurses/widechar/lib_get_wch.c head/contrib/ncurses/ncurses/widechar/lib_get_wstr.c head/contrib/ncurses/ncurses/widechar/lib_ins_wch.c head/contrib/ncurses/ncurses/widechar/lib_inwstr.c head/contrib/ncurses/ncurses/widechar/lib_slk_wset.c head/contrib/ncurses/ncurses/widechar/lib_unget_wch.c head/contrib/ncurses/ncurses/widechar/lib_vid_attr.c head/contrib/ncurses/ncurses/widechar/lib_wacs.c head/contrib/ncurses/ncurses/widechar/lib_wunctrl.c head/contrib/ncurses/ncurses/win32con/win_driver.c head/contrib/ncurses/panel/Makefile.in head/contrib/ncurses/panel/p_above.c head/contrib/ncurses/panel/p_below.c head/contrib/ncurses/panel/panel.c head/contrib/ncurses/panel/panel.priv.h head/contrib/ncurses/progs/Makefile.in head/contrib/ncurses/progs/capconvert head/contrib/ncurses/progs/clear.c head/contrib/ncurses/progs/dump_entry.c head/contrib/ncurses/progs/dump_entry.h head/contrib/ncurses/progs/infocmp.c head/contrib/ncurses/progs/progs.priv.h head/contrib/ncurses/progs/tabs.c head/contrib/ncurses/progs/tic.c head/contrib/ncurses/progs/toe.c head/contrib/ncurses/progs/tput.c head/contrib/ncurses/progs/transform.c head/contrib/ncurses/progs/tset.c head/lib/ncurses/ncurses/Makefile head/lib/ncurses/ncurses/ncurses_cfg.h Directory Properties: head/contrib/ncurses/ (props changed) Copied: head/contrib/ncurses/COPYING (from r262639, vendor/ncurses/dist/COPYING) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/ncurses/COPYING Sun Mar 2 08:58:21 2014 (r262685, copy of r262639, vendor/ncurses/dist/COPYING) @@ -0,0 +1,28 @@ +Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, distribute with modifications, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name(s) of the above copyright +holders shall not be used in advertising or otherwise to promote the +sale, use or other dealings in this Software without prior written +authorization. + +-- vile:txtmode fc=72 +-- $Id: COPYING,v 1.2 2014/01/18 23:59:29 tom Exp $ Modified: head/contrib/ncurses/INSTALL ============================================================================== --- head/contrib/ncurses/INSTALL Sun Mar 2 07:39:37 2014 (r262684) +++ head/contrib/ncurses/INSTALL Sun Mar 2 08:58:21 2014 (r262685) @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: INSTALL,v 1.155 2011/03/31 08:27:24 tom Exp $ +-- $Id: INSTALL,v 1.168 2013/08/03 23:15:23 tom Exp $ --------------------------------------------------------------------- How to install Ncurses/Terminfo on your system --------------------------------------------------------------------- @@ -315,6 +315,10 @@ SUMMARY OF CONFIGURE OPTIONS: programs are useful in this configuration, e.g., reset and tput versus infocmp and tic. + --disable-db-install + Do not install the terminal database. This is used to omit features + for packages, as done with --without-progs. + --disable-ext-funcs Disable function-extensions. Configure ncurses without the functions that are not specified by XSI. See ncurses/modules for the exact @@ -407,13 +411,14 @@ SUMMARY OF CONFIGURE OPTIONS: --disable-tic-depends When building shared libraries, normally the tic library is linked to - depend upon the ncurses library (and in turn, on the term-library if - the --with-termlib option was given). The tic- and term-libraries - ABI does not depend on the --enable-widec option. Some packagers have - used this to reduce the number of library files which are packaged - by using only one copy of those libraries. To make this work properly, + depend upon the ncurses library (or equivalently, on the tinfo-library + if the --with-termlib option was given). The tic- and tinfo-library + ABIs do not depend on the --enable-widec option. Some packagers have + used this to reduce the number of library files which are packaged by + using only one copy of those libraries. To make this work properly, the tic library must be built without an explicit dependency on the - ncurses (or ncursesw) library. Use this configure option to do that. + underlying library (ncurses vs ncursesw, tinfo vs tinfow). Use this + configure option to do that. For example configure --with-ticlib --with-shared --disable-tic-depends @@ -555,6 +560,9 @@ SUMMARY OF CONFIGURE OPTIONS: library by reducing global and static variables. This option is also set if --with-pthread is used. + Enabling this option adds a "t" to the library names, except for the + special case when --enable-weak-symbols is also used. + --enable-rpath Use rpath option when generating shared libraries, and (with some restrictions) when linking the corresponding programs. This originally @@ -595,6 +603,14 @@ SUMMARY OF CONFIGURE OPTIONS: reducing the need for juggling the global SP value with set_term() and delscreen(). + --enable-string-hacks + Controls whether strlcat and strlcpy may be used. The same issue + applies to OpenBSD's warnings about snprintf, noting that this function + is weakly standardized. + + Aside from stifling these warnings, there is no functional improvement + in ncurses. + --enable-symlinks If your system supports symbolic links, make tic use symbolic links rather than hard links to save diskspace when writing aliases in the @@ -616,6 +632,12 @@ SUMMARY OF CONFIGURE OPTIONS: match is found in the terminfo database. See also the --enable-getcap and --enable-getcap-cache options. + Termcap support requires run-time parsing rather than loading + predigested data. If you have specified --with-ticlib, then you + cannot have termcap support since run-time parsing is done in the + tic library, which is intentionally not part of normal linkage + dependencies. + --enable-warnings Turn on GCC compiler warnings. There should be only a few. @@ -740,6 +762,12 @@ SUMMARY OF CONFIGURE OPTIONS: executables, e.g., by setting "--with-chtype=long" (the configure script supplies "unsigned"). + --with-cxx-shared + When --with-shared is set, build libncurses++ as a shared library. + This implicitly relies upon building with gcc/g++, since other + compiler suites may have differences in the way shared libraries are + built. libtool by the way has similar limitations. + --with-database=XXX Specify the terminfo source file to install. Usually you will wish to install ncurses' default (misc/terminfo.src). Certain systems @@ -824,7 +852,17 @@ SUMMARY OF CONFIGURE OPTIONS: NOTE: a few systems build shared libraries with fixed pathnames; this option probably will not work for those configurations. - --with-libtool[=XXX] + --with-lib-prefix=XXX + OS/2 EMX used a different naming convention from most Unix-like + platforms. It required that the "lib" part of a library name was + omitted. Newer EMX as part of eComStation does not follow that + convention. Use this option to override the configure script's + assumptions about the library-prefix. If this option is omitted, it + uses the original OS/2 EMX convention for that platform. Use + "--with-lib-prefix=lib" for the newer EMX in eComStation. Use + "--without-lib-prefix" to suppress it for other odd platforms. + + --with-libtool[=XXX] Generate libraries with libtool. If this option is selected, then it overrides all other library model specifications. Note that libtool must already be installed, uses makefile rules dependent on GNU make, @@ -904,6 +942,10 @@ SUMMARY OF CONFIGURE OPTIONS: --with-pkg-config=[DIR] Check for pkg-config, optionally specifying its path. + --with-pkg-config-libdir=[DIR] + If pkg-config was found, override the automatic check for its library + path. + --with-profile Generate profile-libraries These are named by adding "_p" to the root, e.g., libncurses_p.a @@ -996,10 +1038,27 @@ SUMMARY OF CONFIGURE OPTIONS: library dependencies for tic and other programs built with the tic library. + --with-tparm-arg[=XXX] + Override the type used for tparm() arguments, which normally is a + "long". However the function must assume that its arguments can hold a + pointer to char's which is not always workable for 64-bit platforms. A + better choice would be intptr_t, which was not available at the time + tparm's interface was defined. + + If the option is not given, this defaults to "long". + --with-trace Configure the trace() function as part of the all models of the ncurses library. Normally it is part of the debug (libncurses_g) library only. + --with-xterm-kbs=XXX + Configure xterm's terminfo entries to use either BS (^H, i.e., ASCII + backspace) or DEL (^?, or 127). XXX can be BS (or bs, 8) or DEL + (or del, 127). + + During installation, the makefile and scripts modifies the "xterm+kbs" + terminfo entry to use this setting. + --with-valgrind For testing, compile with debug option. This also sets the --disable-leaks option. @@ -1024,6 +1083,8 @@ SUMMARY OF CONFIGURE OPTIONS: install as "ncurses.h" and modify the installed headers and manpages accordingly. + Likewise, do not install an alias "curses" for the ncurses manpage. + --without-cxx XSI curses declares "bool" as part of the interface. C++ also declares "bool". Neither specifies the size and type of booleans, but both @@ -1726,20 +1787,37 @@ CONFIGURING FALLBACK ENTRIES: By default, there are no entries on the fallback list. After you have built the ncurses suite for the first time, you can change the list (the process needs infocmp(1)). To do so, use the script - ncurses/tinfo/MKfallback.sh. A configure script option + ncurses/tinfo/MKfallback.sh. The configure script option --with-fallbacks does this (it accepts a comma-separated list of the names you wish, and does not require a rebuild). If you wanted (say) to have linux, vt100, and xterm fallbacks, you - would use the commands + might use the commands cd ncurses; - tinfo/MKfallback.sh linux vt100 xterm >fallback.c + tinfo/MKfallback.sh \ + $TERMINFO \ + ../misc/terminfo.src \ + `which tic` \ + linux vt100 xterm >fallback.c + + The first three parameters of the script are normally supplied by + the configured makefiles via the "--with-fallbacks" option. They + are + + 1) the location of the terminfo database + 2) the source for the terminfo entries + 3) the location of the tic program, used to create a terminfo + database. Then just rebuild and reinstall the library as you would normally. You can restore the default empty fallback list with - tinfo/MKfallback.sh >fallback.c + tinfo/MKfallback.sh \ + $TERMINFO \ + ../misc/terminfo.src \ + `which tic` \ + >fallback.c The overhead for an empty fallback list is one trivial stub function. Any non-empty fallback list is const-ed and therefore lives in sharable Modified: head/contrib/ncurses/MANIFEST ============================================================================== --- head/contrib/ncurses/MANIFEST Sun Mar 2 07:39:37 2014 (r262684) +++ head/contrib/ncurses/MANIFEST Sun Mar 2 08:58:21 2014 (r262685) @@ -190,6 +190,7 @@ ./Ada95/src/terminal_interface-curses-text_io.ads ./Ada95/src/terminal_interface-curses-trace.adb_p ./Ada95/src/terminal_interface.ads +./COPYING ./INSTALL ./MANIFEST ./Makefile.in @@ -545,6 +546,8 @@ ./include/nc_alloc.h ./include/nc_mingw.h ./include/nc_panel.h +./include/nc_string.h +./include/nc_termios.h ./include/nc_tparm.h ./include/ncurses_cfg.hin ./include/ncurses_defs @@ -656,6 +659,8 @@ ./man/legacy_coding.3x ./man/make_sed.sh ./man/man_db.renames +./man/manhtml.aliases +./man/manhtml.externs ./man/manlinks.sed ./man/menu.3x ./man/menu_attributes.3x @@ -764,7 +769,6 @@ ./mk-0th.awk ./mk-1st.awk ./mk-2nd.awk -./mk-dlls.sh.in ./mk-hdr.awk ./ncurses/Makefile.in ./ncurses/README @@ -850,7 +854,6 @@ ./ncurses/base/lib_wattron.c ./ncurses/base/lib_winch.c ./ncurses/base/lib_window.c -./ncurses/base/memmove.c ./ncurses/base/nc_panel.c ./ncurses/base/resizeterm.c ./ncurses/base/safe_sprintf.c @@ -867,6 +870,14 @@ ./ncurses/llib-lncursest ./ncurses/llib-lncursestw ./ncurses/llib-lncursesw +./ncurses/llib-ltic +./ncurses/llib-ltict +./ncurses/llib-ltictw +./ncurses/llib-lticw +./ncurses/llib-ltinfo +./ncurses/llib-ltinfot +./ncurses/llib-ltinfotw +./ncurses/llib-ltinfow ./ncurses/modules ./ncurses/tinfo/MKcaptab.awk ./ncurses/tinfo/MKcaptab.sh @@ -915,10 +926,10 @@ ./ncurses/tinfo/make_hash.c ./ncurses/tinfo/make_keys.c ./ncurses/tinfo/name_match.c +./ncurses/tinfo/obsolete.c ./ncurses/tinfo/parse_entry.c ./ncurses/tinfo/read_entry.c ./ncurses/tinfo/read_termcap.c -./ncurses/tinfo/setbuf.c ./ncurses/tinfo/strings.c ./ncurses/tinfo/tinfo_driver.c ./ncurses/tinfo/trim_sgr0.c @@ -943,8 +954,6 @@ ./ncurses/tty/lib_tstp.c ./ncurses/tty/lib_twait.c ./ncurses/tty/lib_vidattr.c -./ncurses/tty/tty_display.h -./ncurses/tty/tty_input.h ./ncurses/tty/tty_update.c ./ncurses/wcwidth.h ./ncurses/widechar/charable.c @@ -967,9 +976,34 @@ ./ncurses/widechar/lib_vline_set.c ./ncurses/widechar/lib_wacs.c ./ncurses/widechar/lib_wunctrl.c +./ncurses/widechar/widechars.c ./ncurses/win32con/gettimeofday.c ./ncurses/win32con/wcwidth.c ./ncurses/win32con/win_driver.c +./package/debian-mingw/changelog +./package/debian-mingw/compat +./package/debian-mingw/control +./package/debian-mingw/copyright +./package/debian-mingw/rules +./package/debian-mingw/source/format +./package/debian-mingw/watch +./package/debian-mingw64/changelog +./package/debian-mingw64/compat +./package/debian-mingw64/control +./package/debian-mingw64/copyright +./package/debian-mingw64/rules +./package/debian-mingw64/source/format +./package/debian-mingw64/watch +./package/debian/changelog +./package/debian/compat +./package/debian/control +./package/debian/copyright +./package/debian/rules +./package/debian/source/format +./package/debian/watch +./package/mingw-ncurses.nsi +./package/mingw-ncurses.spec +./package/ncurses.spec ./panel/Makefile.in ./panel/headers ./panel/llib-lpanel @@ -1022,12 +1056,14 @@ ./test/cardfile.dat ./test/chgat.c ./test/clip_printw.c +./test/color_name.h ./test/color_set.c ./test/configure ./test/configure.in ./test/demo_altkeys.c ./test/demo_defkey.c ./test/demo_forms.c +./test/demo_forms.txt ./test/demo_keyok.c ./test/demo_menus.c ./test/demo_panels.c @@ -1036,6 +1072,7 @@ ./test/ditto.c ./test/dots.c ./test/dots_mvcur.c +./test/dots_termcap.c ./test/echochar.c ./test/edit_field.c ./test/edit_field.h @@ -1043,6 +1080,7 @@ ./test/firework.c ./test/firstlast.c ./test/foldkeys.c +./test/form_driver_w.c ./test/gdc.6 ./test/gdc.c ./test/hanoi.c @@ -1073,6 +1111,7 @@ ./test/package/debian/rules ./test/package/debian/source/format ./test/package/debian/watch +./test/package/mingw-ncurses-examples.spec ./test/package/ncurses-examples.spec ./test/programs ./test/railroad.c @@ -1092,12 +1131,15 @@ ./test/test_instr.c ./test/test_inwstr.c ./test/test_opaque.c +./test/test_vid_puts.c +./test/test_vidputs.c ./test/testaddch.c ./test/testcurs.c ./test/testscanw.c ./test/tracemunch ./test/view.c ./test/widechars-utf8.txt +./test/widechars.h ./test/worm.c ./test/xmas.c ./test/xterm-16color.dat Modified: head/contrib/ncurses/Makefile.in ============================================================================== --- head/contrib/ncurses/Makefile.in Sun Mar 2 07:39:37 2014 (r262684) +++ head/contrib/ncurses/Makefile.in Sun Mar 2 08:58:21 2014 (r262685) @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.30 2010/11/27 21:45:27 tom Exp $ +# $Id: Makefile.in,v 1.38 2014/01/18 20:19:45 tom Exp $ ############################################################################## -# Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. # +# Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -27,7 +27,7 @@ # authorization. # ############################################################################## # -# Author: Thomas E. Dickey 1996,1997 +# Author: Thomas E. Dickey 1996-on # # Master Makefile for ncurses library. @@ -35,7 +35,8 @@ SHELL = /bin/sh VPATH = @srcdir@ DESTDIR=@DESTDIR@ -CF_MFLAGS = @cf_cv_makeflags@ DESTDIR="$(DESTDIR)" +RPATH_LIST=@RPATH_LIST@ +TOP_MFLAGS = @cf_cv_makeflags@ DESTDIR="$(DESTDIR)" RPATH_LIST="$(RPATH_LIST)" @SET_MAKE@ @@ -48,13 +49,17 @@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ +datarootdir = @datarootdir@ bindir = @bindir@ ticdir = @TERMINFO@ includedir = @includedir@ +includesubdir = @includesubdir@ libdir = @libdir@ mandir = @mandir@ +include_dir = ${includedir}${includesubdir} + INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -74,25 +79,22 @@ preinstall : @ echo '' @ echo ' bin directory: '$(bindir) @ echo ' lib directory: '$(libdir) - @ echo ' include directory: '$(includedir) + @ echo ' include directory: '$(include_dir) @ echo ' man directory: '$(mandir) @MAKE_TERMINFO@ @ echo ' terminfo directory: '$(ticdir) @ echo '' - @ test "$(includedir)" = "$(prefix)/include" || \ + @ test "$(include_dir)" = "$(prefix)/include" || \ echo '** Include-directory is not in a standard location' - @ test ! -f $(includedir)/termcap.h || \ - fgrep NCURSES_VERSION $(includedir)/termcap.h >/dev/null || \ + @ test ! -f $(include_dir)/termcap.h || \ + fgrep NCURSES_VERSION $(include_dir)/termcap.h >/dev/null || \ echo '** Will overwrite non-ncurses termcap.h' - @ test ! -f $(includedir)/curses.h || \ - fgrep NCURSES_VERSION $(includedir)/curses.h >/dev/null || \ + @ test ! -f $(include_dir)/curses.h || \ + fgrep NCURSES_VERSION $(include_dir)/curses.h >/dev/null || \ echo '** Will overwrite non-ncurses curses.h' -dlls: libs - $(SHELL) $(srcdir)/mk-dlls.sh - distclean \ realclean :: - -rm -f mk-dlls.sh mingw_arch + # Put the common rules here so that we can easily construct the list of # directories to visit. Modified: head/contrib/ncurses/NEWS ============================================================================== --- head/contrib/ncurses/NEWS Sun Mar 2 07:39:37 2014 (r262684) +++ head/contrib/ncurses/NEWS Sun Mar 2 08:58:21 2014 (r262685) @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.1682 2011/04/04 00:02:42 tom Exp $ +-- $Id: NEWS,v 1.2172 2014/02/23 01:19:35 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,1360 @@ See the AUTHORS file for the correspondi Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20140222 + + fix some compiler warnings in win_driver.c + + updated notes for wsvt25 based on tack and vttest -TD + + add teken entry to show actual properties of FreeBSD's "xterm" + console -TD + +20140215 + + in-progress changes to win_driver.c to implement output without + allocating a console-buffer. This uses a pre-existing environment + variable NCGDB used by Juergen Pfeifer for debugging (prompted by + discussion with Erwin Waterlander regarding Console2, which hangs + when reading in an allocated console-buffer). + + add -t option to gdc.c, and modify to accept "S" to step through the + scrolling-stages. + + regenerate NCURSES-Programming-HOWTO.html to fix some of the broken + html emitted by docbook. + +20140209 + + modify CF_XOPEN_SOURCE macro to omit followup check to determine if + _XOPEN_SOURCE can/should be defined. g++ 4.7.2 built on Solaris 10 + has some header breakage due to its own predefinition of this symbol + (report by Jean-Pierre Flori, Sage #15796). + +20140201 + + add/use symbol NCURSES_PAIRS_T like NCURSES_COLOR_T, to illustrate + which "short" types are for color pairs and which are color values. + + fix build for s390x, by correcting field bit offsets in generated + representation clauses when int=32 long=64 and endian=big, or at + least on s390x (patch by Nicolas Boulenguez). + + minor cleanup change to test/form_driver_w.c (patch by Gaute Hope). + +20140125 + + remove unnecessary ifdef's in Ada95/gen/gen.c, which reportedly do + not work as is with gcc 4.8 due to fixes using chtype cast made for + new compiler warnings by gcc 4.8 in 20130824 (Debian #735753, patch + by Nicolas Boulenguez). + +20140118 + + apply includesubdir variable which was introduced in 20130805 to + gen-pkgconfig.in (Debian #735782). + +20131221 + + further improved man2html, used this to fix broken links in html + manpages. See + ftp://invisible-island.net/ncurses/patches/man2html + +20131214 + + modify configure-script/ifdef's to allow OLD_TTY feature to be + suppressed if the type of ospeed is configured using the option + --with-ospeed to not be a short. By default, it is a short for + termcap-compatibility (adapted from suggestion by Christian + Weisgerber). + + correct a typo in _nc_baudrate() (patch by Christian Weisgerber, + cf: 20061230). + + fix a few -Wlogical-op warnings. + + updated llib-l* files. + +20131207 + + add form_driver_w() entrypoint to wide-character forms library, as + well as test program form_driver_w (adapted from patch by Gaute + Hope). + +20131123 + + minor fix for CF_GCC_WARNINGS to special-case options which are not + recognized by clang. + +20131116 + + add special case to configure script to move _XOPEN_SOURCE_EXTENDED + definition from CPPFLAGS to CFLAGS if it happens to be needed for + Solaris, because g++ errors with that definition (report by + Jean-Pierre Flori, Sage #15268). + + correct logic in infocmp's -i option which was intended to ignore + strings which correspond to function-keys as candidates for piecing + together initialization- or reset-strings. The problem dates to + 1.9.7a, but was overlooked until changes in -Wlogical-op warnings for + gcc 4.8 (report by David Binderman). + + updated CF_GCC_WARNINGS to documented options for gcc 4.9.0, adding + checks for -Wextra, -Wignored-qualifiers and -Wlogical-op + + updated CF_GCC_WARNINGS to documented options for gcc 4.9.0, moving + checks for -Wextra and -Wdeclaration-after-statement into the macro, + and adding checks for -Wignored-qualifiers, -Wlogical-op and + -Wvarargs + + updated CF_CURSES_UNCTRL_H and CF_SHARED_OPTS macros from ongoing + work on cdk. + + update config.sub from + http://git.savannah.gnu.org/cgit/config.git + +20131110 + + minor cleanup of terminfo.tail + +20131102 + + use TS extension to describe xterm's title-escapes -TD + + modify terminator and nsterm-s to use xterm+sl-twm building block -TD + + update hurd.ti, add xenl to reflect 2011-03-06 change in + http://git.savannah.gnu.org/cgit/hurd/hurd.git/log/console/display.c + (Debian #727119). + + simplify pfkey expression in ansi.sys -TD + +20131027 + + correct/simplify ifdef's for cur_term versus broken-linker and + reentrant options (report by Jean-Pierre Flori, cf: 20090530). + + modify release/version combinations in test build-scripts to make + them more consistent with other packages. + +20131019 + + add nc_mingw.h to installed headers for MinGW port; needed for + compiling ncurses-examples. + + add rpm-script for testing cross-compile of ncurses-examples. + +20131014 + + fix new typo in CF_ADA_INCLUDE_DIRS macro (report by Roumen Petrov). + +20131012 + + fix a few compiler warnings in progs and test. + + minor fix to package/debian-mingw/rules, do not strip dll's. + + minor fixes to configure script for empty $prefix, e.g., when doing + cross-compiles to MinGW. + + add script for building test-packages of binaries cross-compiled to + MinGW using NSIS. + +20131005 + + minor fixes for ncurses-example package and makefile. + + add scripts for test-builds of cross-compiler packages for ncurses6 + to MinGW. + +20130928 + + some build-fixes for ncurses-examples with NetBSD-6.0 curses, though + it lacks some common functions such as use_env() which is not yet + addressed. + + build-fix and some compiler warning fixes for ncurses-examples with + OpenBSD 5.3 + + fix a possible null-pointer reference in a trace message from newterm. + + quiet a few warnings from NetBSD 6.0 namespace pollution by + nonstandard popcount() function in standard strings.h header. + + ignore g++ 4.2.1 warnings for "-Weffc++" in c++/cursesmain.cc + + fix a few overlooked places for --enable-string-hacks option. + +20130921 + + fix typo in curs_attr.3x (patch by Sven Joachim, cf: 20130831). + + build-fix for --with-shared option for DragonFly and FreeBSD (report + by Rong-En Fan, cf: 20130727). + +20130907 + + build-fixes for MSYS for two test-programs (patches by Ray Donnelly, + Alexey Pavlov). + + revert change to two of the dpkg format files, to work with dpkg + before/after Debian #700177. + + fix gcc -Wconversion warning in wattr_get() macro. + + add msys and msysdll to known host/configuration types (patch by + Alexey Pavlov). + + modify CF_RPATH_HACK configure macro to not rely upon "-u" option + of sort, improving portability. + + minor improvements for test-programs from reviewing Solaris port. + + update config.guess, config.sub from + http://git.savannah.gnu.org/cgit/config.git + +20130831 + + modify test/ncurses.c b/B tests to display lines only for the + attributes which a given terminal supports, to make room for an + italics test. + + completed ncv table in terminfo.tail; it did not list the wide + character codes listed in X/Open Curses issue 7. + + add A_ITALIC extension (prompted by discussion with Egmont Koblinger). + +20130824 + + fix some gcc 4.8 -Wconversion warnings. + + change format of dpkg test-scripts to quilted to work around bug + introduced by Debian #700177. + + discard cached keyname() values if meta() is changed after a value + was cached using (report by Kurban Mallachiev). + +20130816 + + add checks in tic to warn about terminals which lack cursor + addressing, capabilities or having those, are marked as hard_copy or + generic_type. + + use --without-progs in mingw-ncurses rpm. + + split out _nc_init_termtype() from alloc_entry.c to use in MinGW + port when tic and other programs are not needed. + +20130805 + + minor fixes to the --disable-overwrite logic, to ensure that the + configured $(includedir) is not cancelled by the mingwxx-filesystem + rpm macros. + + add --disable-db-install configure option, to simplify building + cross-compile support packages. + + add mingw-ncurses.spec file, for testing cross-compiles. + +20130727 + + improve configure macros from ongoing work on cdk, dialog, xterm: + + CF_ADD_LIB_AFTER - fix a problem with -Wl options + + CF_RPATH_HACK - add missing result-message + + CF_SHARED_OPTS - modify to use $rel_builddir in cygwin and mingw + dll symbols (which can be overridden) rather than explicit "../". + + CF_SHARED_OPTS - modify NetBSD and DragonFly symbols to use ${CC} + rather than ${LD} to improve rpath support. + + CF_SHARED_OPTS - add a symbol to denote the temporary files that + are created by the macro, to simplify clean-rules. + + CF_X_ATHENA - trim extra libraries to work with -Wl,--as-needed + + fix a regression in hashed-database support for NetBSD, which uses + the key-size differently from other implementations (cf: 20121229). + +20130720 + + further improvements for setupterm manpage, clarifying the + initialization of cur_term. + +20130713 + + improve manpages for initscr and setupterm. + + minor compiler-warning fixes + +20130706 + + add fallback defs for and (cf: 20120225). + + add check for size of wchar_t, use that to suppress a chunk of + wcwidth.h in MinGW port. + + quiet linker warnings for MinGW cross-compile with dll's using the + --enable-auto-import flag. + + add ncurses.map rule to ncurses/Makefile to help diagnose symbol + table issues. + +20130622 + + modify the clear program to take into account the E3 extended + capability to clear the terminal's scrollback buffer (patch by + Miroslav Lichvar, Redhat #815790). + + clarify in resizeterm manpage that LINES and COLS are updated. + + updated ansi example in terminfo.tail, correct misordered example + of sgr. + + fix other doclifter warnings for manpages + + remove unnecessary ".ta" in terminfo.tail, add missing ".fi" + (patch by Eric Raymond). + +20130615 + + minor changes to some configure macros to make them more reusable. + + fixes for tabs program (prompted by report by Nick Andrik): + + corrected logic in command-line parsing of -a and -c predefined + tab-lists options. + + allow "-0" and "-8" options to be combined with others, e.g.,"-0d". + + make warning messages more consistent with the other utilities by + not printing the full pathname of the program. + + add -V option for consistency with other utilities. + + fix off-by-one in columns for tabs program when processing an option + such as "-5" (patch by Nick Andrik). + +20130608 + + add to test/demo_forms.c examples of using the menu-hooks as well + as showing how the menu item user-data can be used to pass a callback + function pointer. + + add test/dots_termcap.c + + remove setupterm call from test/demo_termcap.c + + build-fix if --disable-ext-funcs configure option is used. + + modified test/edit_field.c and test/demo_forms.c to move the lengths + into a user-data structure, keeping the original string for later + expansion to free-format input/out demo. + + modified test/demo_forms.c to load data from file. + + added note to clarify Terminal.app's non-emulation of the various + terminal types listed in the preferences dialog -TD + + fix regression in error-reporting in lib_setup.c (Debian #711134, + cf: 20121117). + + build-fix for a case where --enable-broken_linker and + --enable-reentrant options are combined (report by George R Goffe). + +20130525 + + modify mvcur() to distinguish between internal use by the ncurses + library, and external callers, preventing it from reading the content + of the screen which is only nonblank when curses calls have updated + it. This makes test/dots_mvcur.c avoid painting colored cells in + the left margin of the display. + + minor fix to test/dots_mvcur.c + + move configured symbols USE_DATABASE and USE_TERMCAP to term.h as + NCURSES_USE_DATABASE and NCURSES_USE_TERMCAP to allow consistent + use of these symbols in term_entry.h + +20130518 + + corrected ifdefs in test/testcurs.c to allow comparison of mouse + interface versus pdcurses (cf: 20130316). + + add pow() to configure-check for math library, needed since + 20121208 for test/hanoi (Debian #708056). + + regenerated html manpages. + + update doctype used for html documentation. + +20130511 + + move nsterm-related entries out of "obsolete" section to more + plausible "ansi consoles" -TD + + additional cleanup of table-of-contents by reordering -TD + + revise fix for check for 8-bit value in _nc_insert_ch(); prior fix + prevented inserts when video attributes were attached to the data + (cf: 20121215) (Redhat #959534). + +20130504 + + fixes for issues found by Coverity: + + correct FNKEY() macro in progs/dump_entry.c, allowing kf11-kf63 to + display when infocmp's -R option is used for HP or AIX subsets. + + fix dead-code issue with test/movewindow.c + + improve limited-checking in _nc_read_termtype(). + +20130427 + + fix clang 3.2 warning in progs/dump_entry.c + + drop AC_TYPE_SIGNAL check; ncurses relies on c89 and later. + +20130413 + + add MinGW to cases where ncurses installs by default into /usr + (prompted by discussion with Daniel Silva Ferreira). + + add -D option to infocmp's usage-message (patch by Miroslav Lichvar). + + add a missing 'int' type for main function in configure check for + type of bool variable, to work with clang 3.2 (report by Dmitri + Gribenko). + + improve configure check for static_cast, to work with clang 3.2 + (report by Dmitri Gribenko). + + re-order rule for demo.o and macros defining header dependencies in + c++/Makefile.in to accommodate gmake (report by Dmitri Gribenko). + +20130406 + + improve parameter checking in copywin(). + + modify configure script to work around OS X's "libtool" program, to + choose glibtool instead. At the same time, chance the autoconf macro + to look for a "tool" rather than a "prog", to help with potential use + in cross-compiling. + + separate the rpath usage for c++ library from demo program + (Redhat #911540) + + update/correct header-dependencies in c++ makefile (report by Werner + Fink). + + add --with-cxx-shared to dpkg-script, as done for rpm-script. + +20130324 + + build-fix for libtool configuration (reports by Daniel Silva Ferreira + and Roumen Petrov). + +20130323 + + build-fix for OS X, to handle changes for --with-cxx-shared feature + (report by Christian Ebert). + + change initialization for vt220, similar entries for consistency + with cursor-key strings (NetBSD #47674) -TD + + further improvements to linux-16color (Benjamin Sittler) + +20130316 + + additional fix for tic.c, to allocate missing buffer space. + + eliminate configure-script warnings for gen-pkgconfig.in + + correct typo in sgr string for sun-color, + add bold for consistency with sgr, + change smso for consistency with sgr -TD + + correct typo in sgr string for terminator -TD + + add blink to the attributes masked by ncv in linux-16color (report + by Benjamin Sittler) + + improve warning message from post-load checking for missing "%?" + operator by tic/infocmp by showing the entry name and capability. + + minor formatting improvement to tic/infocmp -f option to ensure + line split after "%;". + + amend scripting for --with-cxx-shared option to handle the debug + library "libncurses++_g.a" (report by Sven Joachim). + +20130309 + + amend change to toe.c for reading from /dev/zero, to ensure that + there is a buffer for the temporary filename (cf: 20120324). + + regenerated html manpages. + + fix typo in terminfo.head (report by Sven Joachim, cf: 20130302). + + updated some autoconf macros: + + CF_ACVERSION_CHECK, from byacc 1.9 20130304 + + CF_INTEL_COMPILER, CF_XOPEN_SOURCE from luit 2.0-20130217 + + add configure option --with-cxx-shared to permit building + libncurses++ as a shared library when using g++, e.g., the same + limitations as libtool but better integrated with the usual build + configuration (Redhat #911540). + + modify MKkey_defs.sh to filter out build-path which was unnecessarily + shown in curses.h (Debian #689131). + +20130302 + + add section to terminfo manpage discussing user-defined capabilities. + + update manpage description of NCURSES_NO_SETBUF, explaining why it + is obsolete. + + add a check in waddch_nosync() to ensure that tab characters are + treated as control characters; some broken locales claim they are + printable. + + add some traces to the Windows console driver. + + initialize a temporary array in _nc_mbtowc, needed for some cases + of raw input in MinGW port. + +20130218 + + correct ifdef on change to lib_twait.c (report by Werner Fink). + + update config.guess, config.sub + +20130216 + + modify test/testcurs.c to work with mouse for ncurses as it does for + pdcurses. + + modify test/knight.c to work with mouse for pdcurses as it does for + ncurses. + + modify internal recursion in wgetch() which handles cooked mode to + check if the call to wgetnstr() returned an error. This can happen + when both nocbreak() and nodelay() are set, for instance (report by + Nils Christopher Brause) (cf: 960418). + + fixes for issues found by Coverity: + + add a check for valid position in ClearToEOS() + + fix in lib_twait.c when --enable-wgetch-events is used, pointer + use after free. + + improve a limit-check in make_hash.c + + fix a memory leak in hashed_db.c + +20130209 + + modify test/configure script to make it simpler to override names + of curses-related libraries, to help with linking with pdcurses in + MinGW environment. + + if the --with-terminfo-dirs configure option is not used, there is + no corresponding compiled-in value for that. Fill in "no default + value" for that part of the manpage substitution. + +20130202 + + correct initialization in knight.c which let it occasionally make + an incorrect move (cf: 20001028). + + improve documentation of the terminfo/termcap search path. + +20130126 + + further fixes to mvcur to pass callback function (cf: 20130112), + needed to make test/dots_mvcur work. + + reduce calls to SetConsoleActiveScreenBuffer in win_driver.c, to + help reduce flicker. + + modify configure script to omit "+b" from linker options for very + old HP-UX systems (report by Dennis Grevenstein) + + add HP-UX workaround for missing EILSEQ on old HP-UX systems (patch + by Dennis Grevenstein). + + restore memmove/strdup support for antique systems (request by + Dennis Grevenstein). + + change %l behavior in tparm to push the string length onto the stack + rather than saving the formatted length into the output buffer + (report by Roy Marples, cf: 980620). + +20130119 + + fixes for issues found by Coverity: + + fix memory leak in safe_sprintf.c + + add check for return-value in tty_update.c + + correct initialization for -s option in test/view.c + + add check for numeric overflow in lib_instr.c + + improve error-checking in copywin + + add advice in infocmp manpage for termcap users (Debian #698469). + + add "-y" option to test/demo_termcap and test/demo_terminfo to + demonstrate behavior with/without extended capabilities. + + updated termcap manpage to document legacy termcap behavior for + matching capability names. + + modify name-comparison for tgetstr, etc., to accommodate legacy + applications as well as to improve compatbility with BSD 4.2 + termcap implementations (Debian #698299) (cf: 980725). + +20130112 + + correct prototype in manpage for vid_puts. + + drop ncurses/tty/tty_display.h, ncurses/tty/tty_input.h, since they + are unused in the current driver model. + + modify mvcur to use stdout except when called within the ncurses + library. + + modify vidattr and vid_attr to use stdout as documented in manpage. + + amend changes made to buffering in 20120825 so that the low-level + putp() call uses stdout rather than ncurses' internal buffering. + The putp_sp() call does the same, for consistency (Redhat #892674). + +20130105 + + add "-s" option to test/view.c to allow it to start in single-step + mode, reducing size of trace files when it is used for debugging + MinGW changes. + + revert part of 20121222 change to tinfo_driver.c + + add experimental logic in win_driver.c to improve optimization of + screen updates. This does not yet work with double-width characters, + so it is ifdef'd out for the moment (prompted by report by Erwin + Waterlander regarding screen flicker). + +20121229 + + fix coverity warnings regarding copying into fixed-size buffers. + + add throw-declarations in the c++ binding per Coverity warning. + + minor changes to new-items for consistent reference to bug-report + numbers. + +20121222 + + add *.dSYM directories to clean-rule in ncurses directory makefile, + for Mac OS builds. + + add a configure check for gcc option -no-cpp-precomp, which is not + available in all Mac OS X configurations (report by Andras Salamon, + cf: 20011208). + + improve 20021221 workaround for broken acs, handling a case where + that ACS_xxx character is not in the acsc string but there is a known + wide-character which can be used. + +20121215 + + fix several warnings from clang 3.1 --analyze, includes correcting + a null-pointer check in _nc_mvcur_resume. + + correct display of double-width characters with MinGW port (report + by Erwin Waterlander). + + replace MinGW's wcrtomb(), fixing a problem with _nc_viscbuf + > fixes based on Coverity report: + + correct coloring in test/bs.c + + correct check for 8-bit value in _nc_insert_ch(). + + remove dead code in progs/tset.c, test/linedata.h + + add null-pointer checks in lib_tracemse.c, panel.priv.h, and some *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 07:10:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4681CE8; Sun, 2 Mar 2014 07:10:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A0F171319; Sun, 2 Mar 2014 07:10:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s227Ah7M011752; Sun, 2 Mar 2014 07:10:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s227Ah6A011751; Sun, 2 Mar 2014 07:10:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403020710.s227Ah6A011751@svn.freebsd.org> From: Adrian Chadd Date: Sun, 2 Mar 2014 07:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262683 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 07:10:43 -0000 Author: adrian Date: Sun Mar 2 07:10:43 2014 New Revision: 262683 URL: http://svnweb.freebsd.org/changeset/base/262683 Log: Set all of the ports into the same vlangroup; there's only one vlangroup (pvid=1) and we already configure them to send to other ports. Setting pvid=portnum would mean that there were separate vlangroups for each ports, but 'leaking' into other ports. The result? All port traffic flooded to all other port traffic. Tested: * DB120, AR9344 + AR8327 switch Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Mar 2 06:36:49 2014 (r262682) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Mar 2 07:10:43 2014 (r262683) @@ -720,9 +720,9 @@ ar8327_reset_vlans(struct arswitch_softc * flows. All ports can see other ports. */ for (i = 0; i < AR8327_NUM_PORTS; i++) { - /* set pvid = i */ - t = i << AR8327_PORT_VLAN0_DEF_SVID_S; - t |= i << AR8327_PORT_VLAN0_DEF_CVID_S; + /* set pvid = 1; there's only one vlangroup */ + t = 1 << AR8327_PORT_VLAN0_DEF_SVID_S; + t |= 1 << AR8327_PORT_VLAN0_DEF_CVID_S; arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_VLAN0(i), t); /* set egress == out_keep */ @@ -732,8 +732,7 @@ ar8327_reset_vlans(struct arswitch_softc t |= mode << AR8327_PORT_VLAN1_OUT_MODE_S; arswitch_writereg(sc->sc_dev, AR8327_REG_PORT_VLAN1(i), t); - /* Set ingress = out_keep; members = 0x3f for all ports */ - + /* Ports can see other ports */ t = (0x3f & ~(1 << i)); /* all ports besides us */ t |= AR8327_PORT_LOOKUP_LEARN; From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 13:12:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A9EA48F; Sun, 2 Mar 2014 13:12:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 66F371143; Sun, 2 Mar 2014 13:12:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s22DC7xV078303; Sun, 2 Mar 2014 13:12:07 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s22DC7PG078302; Sun, 2 Mar 2014 13:12:07 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201403021312.s22DC7PG078302@svn.freebsd.org> From: "Andrey A. Chernov" Date: Sun, 2 Mar 2014 13:12:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262689 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 13:12:07 -0000 Author: ache Date: Sun Mar 2 13:12:06 2014 New Revision: 262689 URL: http://svnweb.freebsd.org/changeset/base/262689 Log: Add fetch and patch to .PHONY and .NOTMAIN only if PORTNAME is defined. Unconditional addition cause real fetch(1) and patch(1) programs are builded every time. MFC after: 1 week Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sun Mar 2 12:15:26 2014 (r262688) +++ head/share/mk/bsd.sys.mk Sun Mar 2 13:12:06 2014 (r262689) @@ -155,11 +155,15 @@ CFLAGS+= ${CWARNFLAGS} PHONY_NOTMAIN = afterdepend afterinstall all beforedepend beforeinstall \ beforelinking build build-tools buildfiles buildincludes \ checkdpadd clean cleandepend cleandir cleanobj configure \ - depend dependall distclean distribute exe extract fetch \ + depend dependall distclean distribute exe extract \ html includes install installfiles installincludes lint \ - obj objlink objs objwarn patch realall realdepend \ + obj objlink objs objwarn realall realdepend \ realinstall regress subdir-all subdir-depend subdir-install \ tags whereobj +.if defined(PORTNAME) +PHONY_NOTMAIN+= fetch patch +.endif + .PHONY: ${PHONY_NOTMAIN} .NOTMAIN: ${PHONY_NOTMAIN} From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 13:26:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 396A89D0; Sun, 2 Mar 2014 13:26:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 25B741138; Sun, 2 Mar 2014 13:26:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s22DQ9tc082810; Sun, 2 Mar 2014 13:26:09 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s22DQ9Y7082809; Sun, 2 Mar 2014 13:26:09 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201403021326.s22DQ9Y7082809@svn.freebsd.org> From: Robert Watson Date: Sun, 2 Mar 2014 13:26:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262690 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 13:26:09 -0000 Author: rwatson Date: Sun Mar 2 13:26:08 2014 New Revision: 262690 URL: http://svnweb.freebsd.org/changeset/base/262690 Log: When querying a process's umask via sysctl in libprocstat(), don't print a warning if EPERM is returned as this is an expected failure mode rather than error -- similar to current handling of ESRCH. This makes the output of 'procstat -as' vastly more palatable. MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Sun Mar 2 13:12:06 2014 (r262689) +++ head/lib/libprocstat/libprocstat.c Sun Mar 2 13:26:08 2014 (r262690) @@ -2052,7 +2052,7 @@ procstat_getumask_sysctl(pid_t pid, unsi mib[3] = pid; len = sizeof(*maskp); error = sysctl(mib, 4, maskp, &len, NULL, 0); - if (error != 0 && errno != ESRCH) + if (error != 0 && errno != ESRCH && errno != EPERM) warn("sysctl: kern.proc.umask: %d", pid); return (error); } From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 17:19:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AEB70E76; Sun, 2 Mar 2014 17:19:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B28914EA; Sun, 2 Mar 2014 17:19:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s22HJJWm075499; Sun, 2 Mar 2014 17:19:19 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s22HJJAi075498; Sun, 2 Mar 2014 17:19:19 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403021719.s22HJJAi075498@svn.freebsd.org> From: Ian Lepore Date: Sun, 2 Mar 2014 17:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262694 - head/sys/boot/uboot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 17:19:19 -0000 Author: ian Date: Sun Mar 2 17:19:19 2014 New Revision: 262694 URL: http://svnweb.freebsd.org/changeset/base/262694 Log: Include needed header. I don't know why clang didn't complain about this but gcc sure did. Modified: head/sys/boot/uboot/common/metadata.c Modified: head/sys/boot/uboot/common/metadata.c ============================================================================== --- head/sys/boot/uboot/common/metadata.c Sun Mar 2 16:25:56 2014 (r262693) +++ head/sys/boot/uboot/common/metadata.c Sun Mar 2 17:19:19 2014 (r262694) @@ -41,6 +41,10 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "glue.h" +#if defined(LOADER_FDT_SUPPORT) +#include "libuboot.h" +#endif + /* * Return a 'boothowto' value corresponding to the kernel arguments in * (kargs) and any relevant environment variables. From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 19:46:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0885947; Sun, 2 Mar 2014 19:46:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A2AC611F8; Sun, 2 Mar 2014 19:46:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s22Jk4Es035999; Sun, 2 Mar 2014 19:46:04 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s22Jk43s035997; Sun, 2 Mar 2014 19:46:04 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403021946.s22Jk43s035997@svn.freebsd.org> From: Ian Lepore Date: Sun, 2 Mar 2014 19:46:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262695 - in head/sys/arm: conf freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 19:46:04 -0000 Author: ian Date: Sun Mar 2 19:46:03 2014 New Revision: 262695 URL: http://svnweb.freebsd.org/changeset/base/262695 Log: Add a tunable to set the number of active cores, and enable SMP by default. Modified: head/sys/arm/conf/IMX6 head/sys/arm/freescale/imx/imx6_mp.c Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Sun Mar 2 17:19:19 2014 (r262694) +++ head/sys/arm/conf/IMX6 Sun Mar 2 19:46:03 2014 (r262695) @@ -143,7 +143,7 @@ options ROOTDEVNAME=\"ufs:mmcsd0s2a\" # ARM and SoC-specific options options FDT # Configure using FDT/DTB data. -#options SMP # Enable multiple cores +options SMP # Enable multiple cores options VFP # Enable floating point hardware support options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) Modified: head/sys/arm/freescale/imx/imx6_mp.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_mp.c Sun Mar 2 17:19:19 2014 (r262694) +++ head/sys/arm/freescale/imx/imx6_mp.c Sun Mar 2 19:46:03 2014 (r262695) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -72,6 +73,7 @@ void platform_mp_setmaxid(void) { bus_space_handle_t scu; + int hwcpu, ncpu; uint32_t val; /* If we've already set the global vars don't bother to do it again. */ @@ -81,10 +83,16 @@ platform_mp_setmaxid(void) if (bus_space_map(fdtbus_bs_tag, SCU_PHYSBASE, SCU_SIZE, 0, &scu) != 0) panic("Couldn't map the SCU\n"); val = bus_space_read_4(fdtbus_bs_tag, scu, SCU_CONFIG_REG); + hwcpu = (val & SCU_CONFIG_REG_NCPU_MASK) + 1; bus_space_unmap(fdtbus_bs_tag, scu, SCU_SIZE); - mp_maxid = (val & SCU_CONFIG_REG_NCPU_MASK); - mp_ncpus = mp_maxid + 1; + ncpu = hwcpu; + TUNABLE_INT_FETCH("hw.ncpu", &ncpu); + if (ncpu < 1 || ncpu > hwcpu) + ncpu = hwcpu; + + mp_ncpus = ncpu; + mp_maxid = ncpu - 1; } int From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 19:55:02 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 676F3E91; Sun, 2 Mar 2014 19:55:02 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 374CF12B0; Sun, 2 Mar 2014 19:55:02 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WKCTV-000Msk-BK; Sun, 02 Mar 2014 19:55:01 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s22JsxmH045605; Sun, 2 Mar 2014 12:54:59 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+tbE+l8zrSH4WhOXsdNsu1 Subject: Re: svn commit: r262685 - in head: contrib/ncurses contrib/ncurses/doc contrib/ncurses/doc/html contrib/ncurses/form contrib/ncurses/include contrib/ncurses/man contrib/ncurses/menu contrib/ncurses/mis... From: Ian Lepore To: Xin LI In-Reply-To: <201403020858.s228wLKb055007@svn.freebsd.org> References: <201403020858.s228wLKb055007@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Sun, 02 Mar 2014 12:54:58 -0700 Message-ID: <1393790098.1149.248.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 19:55:02 -0000 On Sun, 2014-03-02 at 08:58 +0000, Xin LI wrote: > Author: delphij > Date: Sun Mar 2 08:58:21 2014 > New Revision: 262685 > URL: http://svnweb.freebsd.org/changeset/base/262685 > > Log: > MFV r262639: ncurses 5.9 20140222 snapshot. > > Requested by: bapt This seems to be causing tinderbox failures on ARM... cc -O -pipe -D_XOPEN_SOURCE_EXTENDED -DENABLE_WIDEC -I. -I/obj/arm.arm/src/lib/ncurses/formw/../ncursesw -I/src/lib/ncurses/formw/../ncursesw -I/src/lib/ncurses/formw/../ncurses -I/src/lib/ncurses/formw/../../../contrib/ncurses/include -I/src/lib/ncurses/formw/../../../contrib/ncurses/ncurses -Wall -DNDEBUG -DHAVE_CONFIG_H -I/src/lib/ncurses/formw/../../../contrib/ncurses/form -I/src/lib/ncurses/formw/../../../contrib/ncurses/menu -std=gnu99 -Qunused-arguments -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -c /src/lib/ncurses/formw/../../../contrib/ncurses/form/frm_driver.c -o frm_driver.o /src/lib/ncurses/formw/../../../contrib/ncurses/form/frm_driver.c:4506:9: error: comparison of integers of different signs: 'wchar_t' (aka 'unsigned int') and 'int' [-Werror,-Wsign-compare] if (c == FIRST_ACTIVE_MAGIC) ~ ^ ~~~~~~~~~~~~~~~~~~ 1 error generated. *** Error code 1 -- Ian From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 21:25:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C6E3B4D; Sun, 2 Mar 2014 21:25:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 68C7A1A90; Sun, 2 Mar 2014 21:25:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s22LPXID078486; Sun, 2 Mar 2014 21:25:33 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s22LPXgd078485; Sun, 2 Mar 2014 21:25:33 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403022125.s22LPXgd078485@svn.freebsd.org> From: Ian Lepore Date: Sun, 2 Mar 2014 21:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262696 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 21:25:33 -0000 Author: ian Date: Sun Mar 2 21:25:32 2014 New Revision: 262696 URL: http://svnweb.freebsd.org/changeset/base/262696 Log: Add __attribute__((used)) so that the delay implementation doesn't get optimized away as unreferenced, causing linker errors when trying to resolve the weak reference to the missing function. Modified: head/sys/arm/arm/mpcore_timer.c Modified: head/sys/arm/arm/mpcore_timer.c ============================================================================== --- head/sys/arm/arm/mpcore_timer.c Sun Mar 2 19:46:03 2014 (r262695) +++ head/sys/arm/arm/mpcore_timer.c Sun Mar 2 21:25:32 2014 (r262696) @@ -370,6 +370,7 @@ DRIVER_MODULE(mp_tmr, simplebus, arm_tmr * nothing */ static void +__attribute__((used)) /* Must emit function code for the weak ref below. */ arm_tmr_DELAY(int usec) { int32_t counts_per_usec; From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 22:59:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60DA0B38; Sun, 2 Mar 2014 22:59:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4DA7412DF; Sun, 2 Mar 2014 22:59:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s22MxZrW017093; Sun, 2 Mar 2014 22:59:35 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s22MxZim017092; Sun, 2 Mar 2014 22:59:35 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201403022259.s22MxZim017092@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 2 Mar 2014 22:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262697 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 22:59:35 -0000 Author: jilles Date: Sun Mar 2 22:59:34 2014 New Revision: 262697 URL: http://svnweb.freebsd.org/changeset/base/262697 Log: sh: Simplify expari(). Redo expari() like evalvar(). This makes the logic more understandable and avoids possible problems if arithmetic expansion occurs if CTLESC characters are not generated (looking backwards for CTLARI is not generally possible in that case but the old code tried anyway). This adds an extra argstr() recursion. Modified: head/bin/sh/expand.c Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sun Mar 2 21:25:32 2014 (r262696) +++ head/bin/sh/expand.c Sun Mar 2 22:59:34 2014 (r262697) @@ -100,7 +100,7 @@ static struct arglist exparg; /* holds static void argstr(char *, int); static char *exptilde(char *, int); -static void expari(int); +static char *expari(char *); static void expbackq(union node *, int, int); static int subevalvar(char *, char *, int, int, int, int, int); static char *evalvar(char *, int); @@ -207,7 +207,7 @@ expandarg(union node *arg, struct arglis /* * Perform parameter expansion, command substitution and arithmetic * expansion, and tilde expansion if requested via EXP_TILDE/EXP_VARTILDE. - * Processing ends at a CTLENDVAR character as well as '\0'. + * Processing ends at a CTLENDVAR or CTLENDARI character as well as '\0'. * This is used to expand word in ${var+word} etc. * If EXP_FULL, EXP_CASE or EXP_REDIR are set, keep and/or generate CTLESC * characters to allow for further processing. @@ -232,6 +232,7 @@ argstr(char *p, int flag) switch (c = *p++) { case '\0': case CTLENDVAR: + case CTLENDARI: goto breakloop; case CTLQUOTEMARK: lit_quoted = 1; @@ -262,8 +263,8 @@ argstr(char *p, int flag) expbackq(argbackq->n, c & CTLQUOTE, flag); argbackq = argbackq->next; break; - case CTLENDARI: - expari(flag); + case CTLARI: + p = expari(p); break; case ':': case '=': @@ -388,59 +389,56 @@ removerecordregions(int endoff) } /* - * Expand arithmetic expression. Backup to start of expression, - * evaluate, place result in (backed up) result, adjust string position. + * Expand arithmetic expression. + * Note that flag is not required as digits never require CTLESC characters. */ -static void -expari(int flag) +static char * +expari(char *p) { - char *p, *q, *start; + char *q, *start; arith_t result; int begoff; - int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); int quoted; + int c; + int nesting; + int adj; - /* - * This routine is slightly over-complicated for - * efficiency. First we make sure there is - * enough space for the result, which may be bigger - * than the expression. Next we - * scan backwards looking for the start of arithmetic. If the - * next previous character is a CTLESC character, then we - * have to rescan starting from the beginning since CTLESC - * characters have to be processed left to right. - */ - CHECKSTRSPACE(DIGITS(result) - 2, expdest); - USTPUTC('\0', expdest); - start = stackblock(); - p = expdest - 2; - while (p >= start && *p != CTLARI) - --p; - if (p < start || *p != CTLARI) - error("missing CTLARI (shouldn't happen)"); - if (p > start && *(p - 1) == CTLESC) - for (p = start; *p != CTLARI; p++) - if (*p == CTLESC) - p++; - - if (p[1] == '"') - quoted=1; - else - quoted=0; - begoff = p - start; + quoted = *p++ == '"'; + begoff = expdest - stackblock(); + argstr(p, 0); removerecordregions(begoff); - if (quotes) - rmescapes(p+2); + STPUTC('\0', expdest); + start = stackblock() + begoff; + q = grabstackstr(expdest); - result = arith(p+2); + result = arith(start); ungrabstackstr(q, expdest); - fmtstr(p, DIGITS(result), ARITH_FORMAT_STR, result); - while (*p++) - ; - if (quoted == 0) - recordregion(begoff, p - 1 - start, 0); - result = expdest - p + 1; - STADJUST(-result, expdest); + + start = stackblock() + begoff; + adj = start - expdest; + STADJUST(adj, expdest); + + CHECKSTRSPACE((int)(DIGITS(result) + 1), expdest); + fmtstr(expdest, DIGITS(result), ARITH_FORMAT_STR, result); + adj = strlen(expdest); + STADJUST(adj, expdest); + if (!quoted) + recordregion(begoff, expdest - stackblock(), 0); + nesting = 1; + while (nesting > 0) { + c = *p++; + if (c == CTLESC) + p++; + else if (c == CTLARI) + nesting++; + else if (c == CTLENDARI) + nesting--; + else if (c == CTLVAR) + p++; /* ignore variable substitution byte */ + else if (c == '\0') + return p - 1; + } + return p; } From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 23:51:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC108107; Sun, 2 Mar 2014 23:51:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B98241806; Sun, 2 Mar 2014 23:51:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s22Np3go040154; Sun, 2 Mar 2014 23:51:03 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s22Np3D5040153; Sun, 2 Mar 2014 23:51:03 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201403022351.s22Np3D5040153@svn.freebsd.org> From: Glen Barber Date: Sun, 2 Mar 2014 23:51:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262699 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 23:51:03 -0000 Author: gjb Date: Sun Mar 2 23:51:03 2014 New Revision: 262699 URL: http://svnweb.freebsd.org/changeset/base/262699 Log: Explicitly request review/regression testing on the release/release.sh script, as it is heavily used on a regular basis, not just during a release cycle. Sponsored by: The FreeBSD Foundation Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Sun Mar 2 23:09:36 2014 (r262698) +++ head/MAINTAINERS Sun Mar 2 23:51:03 2014 (r262699) @@ -130,3 +130,5 @@ sh(1) jilles Pre-commit review request nvme(4) jimharris Pre-commit review requested. nvd(4) jimharris Pre-commit review requested. nvmecontrol(8) jimharris Pre-commit review requested. +release/release.sh gjb Pre-commit review and regression tests + requested. From owner-svn-src-head@FreeBSD.ORG Mon Mar 3 07:49:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07AB95CF; Mon, 3 Mar 2014 07:49:15 +0000 (UTC) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id BCE46684; Mon, 3 Mar 2014 07:49:14 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id CAB3CD44EF5; Mon, 3 Mar 2014 18:49:04 +1100 (EST) Date: Mon, 3 Mar 2014 18:49:00 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore Subject: Re: svn commit: r262696 - head/sys/arm/arm In-Reply-To: <201403022125.s22LPXgd078485@svn.freebsd.org> Message-ID: <20140303181837.I859@besplex.bde.org> References: <201403022125.s22LPXgd078485@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=Wu4Sb7vv c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=WPRLij4gDd8A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=9i1iI9n1qKuvu3n0atMA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 07:49:15 -0000 On Sun, 2 Mar 2014, Ian Lepore wrote: > Log: > Add __attribute__((used)) so that the delay implementation doesn't get > optimized away as unreferenced, causing linker errors when trying to > resolve the weak reference to the missing function. Why not use the standard FreeBSD macro __used? Hard-coded __attribute__(())s are not only unportable; they are gross style bugs. They were all replaced by FreeBSD macros in old versions of FreeBSD. > Modified: head/sys/arm/arm/mpcore_timer.c > ============================================================================== > --- head/sys/arm/arm/mpcore_timer.c Sun Mar 2 19:46:03 2014 (r262695) > +++ head/sys/arm/arm/mpcore_timer.c Sun Mar 2 21:25:32 2014 (r262696) > @@ -370,6 +370,7 @@ DRIVER_MODULE(mp_tmr, simplebus, arm_tmr > * nothing > */ > static void > +__attribute__((used)) /* Must emit function code for the weak ref below. */ > arm_tmr_DELAY(int usec) > { > int32_t counts_per_usec; The bug was really in the weak reference macro. It is hard-coded in the same unportable asm for all arches and compilers (so the unportable gccism's in it are much larger than for __attribute__(())). Thus the compiler cannot see it. It is missing C parts that declare the referred-to identifier as __used. The __weak_reference() macro has dubious support for __STDC__ (it doesn't really suoport !__STDC__, but only cpp -traditional). Some macros in sys/cdefs.h has been broken to pretend to support lint. This actually breaks lint, by defining away the macros so that lint can't detect their unportabilities. One of these is __unused. But the support for lint is so broken that __unused is not one of these. Neither is __weak_reference() or __attribute__(). The last is intentional. All of the simpler macros like __used and __unused are just aliases for __attribute__(()). These should be defined away for lint if and only if they are just optimization hints or other hints not related to the correctness of the program, e.g., __pure2. The others, and __attribute__() itself, should be left undefined so that lint barfs on them if they are are ever used. lint has a -g flag that supports some gcc extensions. These don't include __attribute__(), so -g was almost useless in practice in 1993. It is more useless now. lint even has a hint about unconditionally defining away __attribute__(). It has a line of source to do this, but this line is ifdefed out in FreeBSD. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Mar 3 08:01:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32F6A98E; Mon, 3 Mar 2014 08:01:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 205F081E; Mon, 3 Mar 2014 08:01:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2381aqL093718; Mon, 3 Mar 2014 08:01:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2381a34093717; Mon, 3 Mar 2014 08:01:36 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403030801.s2381a34093717@svn.freebsd.org> From: Xin LI Date: Mon, 3 Mar 2014 08:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262705 - head/contrib/ncurses/form X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 08:01:37 -0000 Author: delphij Date: Mon Mar 3 08:01:36 2014 New Revision: 262705 URL: http://svnweb.freebsd.org/changeset/base/262705 Log: Workaround a GCC warning to unbreak ARM build. Reported by: ian Modified: head/contrib/ncurses/form/frm_driver.c Modified: head/contrib/ncurses/form/frm_driver.c ============================================================================== --- head/contrib/ncurses/form/frm_driver.c Mon Mar 3 07:31:55 2014 (r262704) +++ head/contrib/ncurses/form/frm_driver.c Mon Mar 3 08:01:36 2014 (r262705) @@ -4503,7 +4503,7 @@ form_driver_w(FORM *form, int type, wcha assert(form->page); - if (c == FIRST_ACTIVE_MAGIC) + if (c == (wchar_t)FIRST_ACTIVE_MAGIC) { form->current = _nc_First_Active_Field(form); RETURN(E_OK); From owner-svn-src-head@FreeBSD.ORG Mon Mar 3 11:00:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A63E0A36; Mon, 3 Mar 2014 11:00:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 86A6289B; Mon, 3 Mar 2014 11:00:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s23B0rkL064005; Mon, 3 Mar 2014 11:00:53 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s23B0qtx064000; Mon, 3 Mar 2014 11:00:52 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201403031100.s23B0qtx064000@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Mon, 3 Mar 2014 11:00:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262708 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 11:00:53 -0000 Author: ganbold Date: Mon Mar 3 11:00:52 2014 New Revision: 262708 URL: http://svnweb.freebsd.org/changeset/base/262708 Log: Add gpio and clock bits for A10/A20's EMAC ethernet controller driver, such as: - EMAC gpio configuration - EMAC clock activation Approved by: stas (mentor) Added: head/sys/arm/allwinner/a10_gpio.h (contents, props changed) Modified: head/sys/arm/allwinner/a10_clk.c head/sys/arm/allwinner/a10_clk.h head/sys/arm/allwinner/a10_gpio.c Modified: head/sys/arm/allwinner/a10_clk.c ============================================================================== --- head/sys/arm/allwinner/a10_clk.c Mon Mar 3 09:57:04 2014 (r262707) +++ head/sys/arm/allwinner/a10_clk.c Mon Mar 3 11:00:52 2014 (r262708) @@ -127,7 +127,7 @@ a10_clk_usb_activate(void) uint32_t reg_value; if (sc == NULL) - return ENXIO; + return (ENXIO); /* Gating AHB clock for USB */ reg_value = ccm_read_4(sc, CCM_AHB_GATING0); @@ -154,7 +154,7 @@ a10_clk_usb_deactivate(void) uint32_t reg_value; if (sc == NULL) - return ENXIO; + return (ENXIO); /* Disable clock for USB */ reg_value = ccm_read_4(sc, CCM_USB_CLK); @@ -173,3 +173,19 @@ a10_clk_usb_deactivate(void) return (0); } +int +a10_clk_emac_activate(void) { + struct a10_ccm_softc *sc = a10_ccm_sc; + uint32_t reg_value; + + if (sc == NULL) + return (ENXIO); + + /* Gating AHB clock for EMAC */ + reg_value = ccm_read_4(sc, CCM_AHB_GATING0); + reg_value |= CCM_AHB_GATING_EMAC; + ccm_write_4(sc, CCM_AHB_GATING0, reg_value); + + return (0); +} + Modified: head/sys/arm/allwinner/a10_clk.h ============================================================================== --- head/sys/arm/allwinner/a10_clk.h Mon Mar 3 09:57:04 2014 (r262707) +++ head/sys/arm/allwinner/a10_clk.h Mon Mar 3 11:00:52 2014 (r262708) @@ -103,6 +103,7 @@ #define CCM_AHB_GATING_USB0 (1 << 0) #define CCM_AHB_GATING_EHCI0 (1 << 1) #define CCM_AHB_GATING_EHCI1 (1 << 3) +#define CCM_AHB_GATING_EMAC (1 << 17) #define CCM_USB_PHY (1 << 8) #define CCM_USB0_RESET (1 << 0) @@ -111,5 +112,6 @@ int a10_clk_usb_activate(void); int a10_clk_usb_deactivate(void); +int a10_clk_emac_activate(void); #endif /* _A10_CLK_H_ */ Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Mon Mar 3 09:57:04 2014 (r262707) +++ head/sys/arm/allwinner/a10_gpio.c Mon Mar 3 11:00:52 2014 (r262708) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include "gpio_if.h" +#include "a10_gpio.h" /* * A10 have 9 banks of gpio. @@ -102,6 +103,8 @@ struct a10_gpio_softc { #define A10_GPIO_GP_INT_STA 0x214 #define A10_GPIO_GP_INT_DEB 0x218 +static struct a10_gpio_softc *a10_gpio_sc; + #define A10_GPIO_WRITE(_sc, _off, _val) \ bus_space_write_4(_sc->sc_bst, _sc->sc_bsh, _off, _val) #define A10_GPIO_READ(_sc, _off) \ @@ -473,6 +476,9 @@ a10_gpio_attach(device_t dev) device_add_child(dev, "gpioc", device_get_unit(dev)); device_add_child(dev, "gpiobus", device_get_unit(dev)); + + a10_gpio_sc = sc; + return (bus_generic_attach(dev)); fail: @@ -518,3 +524,19 @@ static driver_t a10_gpio_driver = { }; DRIVER_MODULE(a10_gpio, simplebus, a10_gpio_driver, a10_gpio_devclass, 0, 0); + +int +a10_emac_gpio_config(uint32_t pin) +{ + struct a10_gpio_softc *sc = a10_gpio_sc; + + if (sc == NULL) + return (ENXIO); + + /* Configure pin mux settings for MII. */ + A10_GPIO_LOCK(sc); + a10_gpio_set_function(sc, pin, A10_GPIO_PULLDOWN); + A10_GPIO_UNLOCK(sc); + + return (0); +} Added: head/sys/arm/allwinner/a10_gpio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a10_gpio.h Mon Mar 3 11:00:52 2014 (r262708) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _A10_GPIO_H_ +#define _A10_GPIO_H_ + +int a10_emac_gpio_config(uint32_t pin); + +#endif From owner-svn-src-head@FreeBSD.ORG Mon Mar 3 11:24:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6995A86; Mon, 3 Mar 2014 11:24:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 92C2CC37; Mon, 3 Mar 2014 11:24:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s23BOmUY075239; Mon, 3 Mar 2014 11:24:48 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s23BOmPa075237; Mon, 3 Mar 2014 11:24:48 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201403031124.s23BOmPa075237@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Mon, 3 Mar 2014 11:24:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262709 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 11:24:48 -0000 Author: ganbold Date: Mon Mar 3 11:24:47 2014 New Revision: 262709 URL: http://svnweb.freebsd.org/changeset/base/262709 Log: Add Static Random Access Memory controller driver for A10/A20. A10/A20's SRAM is used by devices, such as CPU, EMAC, for extra fast memory or as cache. Approved by: stas (mentor) Added: head/sys/arm/allwinner/a10_sramc.c (contents, props changed) head/sys/arm/allwinner/a10_sramc.h (contents, props changed) Added: head/sys/arm/allwinner/a10_sramc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a10_sramc.c Mon Mar 3 11:24:47 2014 (r262709) @@ -0,0 +1,134 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "a10_sramc.h" + +#define SRAM_CTL1_CFG 0x04 + +struct a10_sramc_softc { + struct resource *res; + bus_space_tag_t bst; + bus_space_handle_t bsh; +}; + +static struct a10_sramc_softc *a10_sramc_sc; + +#define sramc_read_4(sc, reg) \ + bus_space_read_4((sc)->bst, (sc)->bsh, (reg)) +#define sramc_write_4(sc, reg, val) \ + bus_space_write_4((sc)->bst, (sc)->bsh, (reg), (val)) + + +static int +a10_sramc_probe(device_t dev) +{ + + if (ofw_bus_is_compatible(dev, "allwinner,sun4i-sramc")) { + device_set_desc(dev, "Allwinner sramc module"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +a10_sramc_attach(device_t dev) +{ + struct a10_sramc_softc *sc = device_get_softc(dev); + int rid = 0; + + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (!sc->res) { + device_printf(dev, "could not allocate resource\n"); + return (ENXIO); + } + + sc->bst = rman_get_bustag(sc->res); + sc->bsh = rman_get_bushandle(sc->res); + + a10_sramc_sc = sc; + + return (0); +} + +static device_method_t a10_sramc_methods[] = { + DEVMETHOD(device_probe, a10_sramc_probe), + DEVMETHOD(device_attach, a10_sramc_attach), + { 0, 0 } +}; + +static driver_t a10_sramc_driver = { + "a10_sramc", + a10_sramc_methods, + sizeof(struct a10_sramc_softc), +}; + +static devclass_t a10_sramc_devclass; + +DRIVER_MODULE(a10_sramc, simplebus, a10_sramc_driver, a10_sramc_devclass, 0, 0); + +int +a10_map_to_emac(void) +{ + struct a10_sramc_softc *sc = a10_sramc_sc; + uint32_t reg_value; + + if (sc == NULL) + return (ENXIO); + + /* Map SRAM to EMAC, set bit 2 and 4. */ + reg_value = sramc_read_4(sc, SRAM_CTL1_CFG); + reg_value |= 0x5 << 2; + sramc_write_4(sc, SRAM_CTL1_CFG, reg_value); + + return (0); +} Added: head/sys/arm/allwinner/a10_sramc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a10_sramc.h Mon Mar 3 11:24:47 2014 (r262709) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _A10_SRAMC_H_ +#define _A10_SRAMC_H_ + +int a10_map_to_emac(void); + +#endif From owner-svn-src-head@FreeBSD.ORG Mon Mar 3 11:32:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B87EF3D; Mon, 3 Mar 2014 11:32:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1C827CF9; Mon, 3 Mar 2014 11:32:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s23BWuII079090; Mon, 3 Mar 2014 11:32:56 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s23BWu4Q079088; Mon, 3 Mar 2014 11:32:56 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201403031132.s23BWu4Q079088@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Mon, 3 Mar 2014 11:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262710 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 11:32:56 -0000 Author: ganbold Date: Mon Mar 3 11:32:55 2014 New Revision: 262710 URL: http://svnweb.freebsd.org/changeset/base/262710 Log: Add EMAC 10/100 Ethernet controller driver for A10/A20. It is available mostly in A10 devices like Hackberry, Marsboard, Mele A1000, A2000, A100 HTPC, cubieboard1 and A20 device like cubieboard2. TX performance can be improved using both channels 0 and 1. RX performance is poor and needs improvement with the assistance of external DMA controller in case there is bulk TCP receiver. Reviewed by: yongari@ Approved by: stas (mentor) Added: head/sys/arm/allwinner/if_emac.c (contents, props changed) head/sys/arm/allwinner/if_emacreg.h (contents, props changed) Added: head/sys/arm/allwinner/if_emac.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/if_emac.c Mon Mar 3 11:32:55 2014 (r262710) @@ -0,0 +1,1152 @@ +/*- + * Copyright (c) 2013 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* A10/A20 EMAC driver */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef INET +#include +#include +#include +#include +#endif + +#include +#include + +#include +#include +#include + +#include +#include + +#include + +#include "miibus_if.h" + +#include "gpio_if.h" + +#include "a10_clk.h" +#include "a10_sramc.h" +#include "a10_gpio.h" + +struct emac_softc { + struct ifnet *emac_ifp; + device_t emac_dev; + device_t emac_miibus; + bus_space_handle_t emac_handle; + bus_space_tag_t emac_tag; + struct resource *emac_res; + struct resource *emac_irq; + void *emac_intrhand; + int emac_if_flags; + struct mtx emac_mtx; + struct callout emac_tick_ch; + int emac_watchdog_timer; + int emac_rx_process_limit; + int emac_link; +}; + +static int emac_probe(device_t); +static int emac_attach(device_t); +static int emac_detach(device_t); +static int emac_shutdown(device_t); +static int emac_suspend(device_t); +static int emac_resume(device_t); + +static void emac_sys_setup(void); +static void emac_reset(struct emac_softc *); + +static void emac_init_locked(struct emac_softc *); +static void emac_start_locked(struct ifnet *); +static void emac_init(void *); +static void emac_stop_locked(struct emac_softc *); +static void emac_intr(void *); +static int emac_ioctl(struct ifnet *, u_long, caddr_t); + +static void emac_rxeof(struct emac_softc *, int); +static void emac_txeof(struct emac_softc *); + +static int emac_miibus_readreg(device_t, int, int); +static int emac_miibus_writereg(device_t, int, int, int); +static void emac_miibus_statchg(device_t); + +static int emac_ifmedia_upd(struct ifnet *); +static void emac_ifmedia_sts(struct ifnet *, struct ifmediareq *); + +static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); +static int sysctl_hw_emac_proc_limit(SYSCTL_HANDLER_ARGS); + +#define EMAC_READ_REG(sc, reg) \ + bus_space_read_4(sc->emac_tag, sc->emac_handle, reg) +#define EMAC_WRITE_REG(sc, reg, val) \ + bus_space_write_4(sc->emac_tag, sc->emac_handle, reg, val) + +static void +emac_sys_setup(void) +{ + int i; + + a10_clk_emac_activate(); + + /* + * Configure pin mux settings for MII. + * Pins PA0 from PA17. + */ + for (i = 0; i <= 17; i++) + a10_emac_gpio_config(i); + /* Map sram */ + a10_map_to_emac(); +} + +static void +emac_get_hwaddr(struct emac_softc *sc, uint8_t *hwaddr) +{ + uint32_t val0, val1, rnd; + + /* + * Try to get MAC address from running hardware. + * If there is something non-zero there just use it. + * + * Otherwise set the address to a convenient locally assigned address, + * 'bsd' + random 24 low-order bits. 'b' is 0x62, which has the locally + * assigned bit set, and the broadcast/multicast bit clear. + */ + val0 = EMAC_READ_REG(sc, EMAC_MAC_A0); + val1 = EMAC_READ_REG(sc, EMAC_MAC_A1); + if ((val0 | val1) != 0 && (val0 | val1) != 0xffffff) { + hwaddr[0] = (val1 >> 16) & 0xff; + hwaddr[1] = (val1 >> 8) & 0xff; + hwaddr[2] = (val1 >> 0) & 0xff; + hwaddr[3] = (val0 >> 16) & 0xff; + hwaddr[4] = (val0 >> 8) & 0xff; + hwaddr[5] = (val0 >> 0) & 0xff; + } else { + rnd = arc4random() & 0x00ffffff; + hwaddr[0] = 'b'; + hwaddr[1] = 's'; + hwaddr[2] = 'd'; + hwaddr[3] = (rnd >> 16) & 0xff; + hwaddr[4] = (rnd >> 8) & 0xff; + hwaddr[5] = (rnd >> 0) & 0xff; + } + if (bootverbose) + printf("MAC address: %s\n", ether_sprintf(hwaddr)); +} + +static void +emac_set_rx_mode(struct emac_softc *sc) +{ + struct ifnet *ifp; + struct ifmultiaddr *ifma; + uint32_t h, hashes[2]; + uint32_t rcr = 0; + + EMAC_ASSERT_LOCKED(sc); + + ifp = sc->emac_ifp; + + rcr = EMAC_READ_REG(sc, EMAC_RX_CTL); + + /* Unicast packet and DA filtering */ + rcr |= EMAC_RX_UCAD; + rcr |= EMAC_RX_DAF; + + hashes[0] = 0; + hashes[1] = 0; + if (ifp->if_flags & IFF_ALLMULTI) { + hashes[0] = 0xffffffff; + hashes[1] = 0xffffffff; + } else { + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &sc->emac_ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + h = ether_crc32_be(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; + hashes[h >> 5] |= 1 << (h & 0x1f); + } + if_maddr_runlock(ifp); + } + rcr |= EMAC_RX_MCO; + rcr |= EMAC_RX_MHF; + EMAC_WRITE_REG(sc, EMAC_RX_HASH0, hashes[0]); + EMAC_WRITE_REG(sc, EMAC_RX_HASH1, hashes[1]); + + if (ifp->if_flags & IFF_BROADCAST) { + rcr |= EMAC_RX_BCO; + rcr |= EMAC_RX_MCO; + } + + if (ifp->if_flags & IFF_PROMISC) + rcr |= EMAC_RX_PA; + else + rcr |= EMAC_RX_UCAD; + + EMAC_WRITE_REG(sc, EMAC_RX_CTL, rcr); +} + +static void +emac_reset(struct emac_softc *sc) +{ + + EMAC_WRITE_REG(sc, EMAC_CTL, 0); + DELAY(200); + EMAC_WRITE_REG(sc, EMAC_CTL, 1); + DELAY(200); +} + +static void +emac_txeof(struct emac_softc *sc) +{ + struct ifnet *ifp; + + EMAC_ASSERT_LOCKED(sc); + + ifp = sc->emac_ifp; + ifp->if_opackets++; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + + /* Unarm watchdog timer if no TX */ + sc->emac_watchdog_timer = 0; +} + +static void +emac_rxeof(struct emac_softc *sc, int count) +{ + struct ifnet *ifp; + struct mbuf *m, *m0; + uint32_t reg_val, rxcount; + int16_t len; + uint16_t status; + int good_packet, i; + + ifp = sc->emac_ifp; + for (; count > 0 && + (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0; count--) { + /* + * Race warning: The first packet might arrive with + * the interrupts disabled, but the second will fix + */ + rxcount = EMAC_READ_REG(sc, EMAC_RX_FBC); + if (!rxcount) { + /* Had one stuck? */ + rxcount = EMAC_READ_REG(sc, EMAC_RX_FBC); + if (!rxcount) + return; + } + /* Check packet header */ + reg_val = EMAC_READ_REG(sc, EMAC_RX_IO_DATA); + if (reg_val != EMAC_PACKET_HEADER) { + /* Packet header is wrong */ + if (bootverbose) + if_printf(ifp, "wrong packet header\n"); + /* Disable RX */ + reg_val = EMAC_READ_REG(sc, EMAC_CTL); + reg_val &= ~EMAC_CTL_RX_EN; + EMAC_WRITE_REG(sc, EMAC_CTL, reg_val); + + /* Flush RX FIFO */ + reg_val = EMAC_READ_REG(sc, EMAC_RX_CTL); + reg_val |= EMAC_RX_FLUSH_FIFO; + EMAC_WRITE_REG(sc, EMAC_RX_CTL, reg_val); + for (i = 100; i > 0; i--) { + DELAY(100); + if ((EMAC_READ_REG(sc, EMAC_RX_CTL) & + EMAC_RX_FLUSH_FIFO) == 0) + break; + } + if (i == 0) { + device_printf(sc->emac_dev, + "flush FIFO timeout\n"); + /* Reinitialize controller */ + emac_init_locked(sc); + return; + } + /* Enable RX */ + reg_val = EMAC_READ_REG(sc, EMAC_CTL); + reg_val |= EMAC_CTL_RX_EN; + EMAC_WRITE_REG(sc, EMAC_CTL, reg_val); + + return; + } + + good_packet = 1; + + /* Get packet size and status */ + reg_val = EMAC_READ_REG(sc, EMAC_RX_IO_DATA); + len = reg_val & 0xffff; + status = (reg_val >> 16) & 0xffff; + + if (len < 64) { + good_packet = 0; + if (bootverbose) + if_printf(ifp, + "bad packet: len = %i status = %i\n", + len, status); + ifp->if_ierrors++; + } +#if 0 + if (status & (EMAC_CRCERR | EMAC_LENERR)) { + good_packet = 0; + ifp->if_ierrors++; + if (status & EMAC_CRCERR) + if_printf(ifp, "crc error\n"); + if (status & EMAC_LENERR) + if_printf(ifp, "length error\n"); + } +#endif + if (good_packet) { + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return; + m->m_len = m->m_pkthdr.len = MCLBYTES; + + len -= ETHER_CRC_LEN; + + /* Copy entire frame to mbuf first. */ + bus_space_read_multi_4(sc->emac_tag, sc->emac_handle, + EMAC_RX_IO_DATA, mtod(m, uint32_t *), + roundup2(len, 4) / 4); + + m->m_pkthdr.rcvif = ifp; + m->m_len = m->m_pkthdr.len = len; + + /* + * Emac controller needs strict aligment, so to avoid + * copying over an entire frame to align, we allocate + * a new mbuf and copy ethernet header + IP header to + * the new mbuf. The new mbuf is prepended into the + * existing mbuf chain. + */ + if (m->m_len <= (MHLEN - ETHER_HDR_LEN)) { + bcopy(m->m_data, m->m_data + ETHER_HDR_LEN, + m->m_len); + m->m_data += ETHER_HDR_LEN; + } else if (m->m_len <= (MCLBYTES - ETHER_HDR_LEN) && + m->m_len > (MHLEN - ETHER_HDR_LEN)) { + MGETHDR(m0, M_NOWAIT, MT_DATA); + if (m0 != NULL) { + len = ETHER_HDR_LEN + + m->m_pkthdr.l2hlen; + bcopy(m->m_data, m0->m_data, len); + m->m_data += len; + m->m_len -= len; + m0->m_len = len; + M_MOVE_PKTHDR(m0, m); + m0->m_next = m; + m = m0; + } else { + ifp->if_ierrors++; + m_freem(m); + m = NULL; + continue; + } + } else if (m->m_len > EMAC_MAC_MAXF) { + ifp->if_ierrors++; + m_freem(m); + m = NULL; + continue; + } + ifp->if_ipackets++; + EMAC_UNLOCK(sc); + (*ifp->if_input)(ifp, m); + EMAC_LOCK(sc); + } + } +} + +static void +emac_watchdog(struct emac_softc *sc) +{ + struct ifnet *ifp; + + EMAC_ASSERT_LOCKED(sc); + + if (sc->emac_watchdog_timer == 0 || --sc->emac_watchdog_timer) + return; + + ifp = sc->emac_ifp; + + if (sc->emac_link == 0) { + if (bootverbose) + if_printf(sc->emac_ifp, "watchdog timeout " + "(missed link)\n"); + } else + if_printf(sc->emac_ifp, "watchdog timeout -- resetting\n"); + + ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + emac_init_locked(sc); + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + emac_start_locked(ifp); +} + +static void +emac_tick(void *arg) +{ + struct emac_softc *sc; + struct mii_data *mii; + + sc = (struct emac_softc *)arg; + mii = device_get_softc(sc->emac_miibus); + mii_tick(mii); + + emac_watchdog(sc); + callout_reset(&sc->emac_tick_ch, hz, emac_tick, sc); +} + +static void +emac_init(void *xcs) +{ + struct emac_softc *sc; + + sc = (struct emac_softc *)xcs; + EMAC_LOCK(sc); + emac_init_locked(sc); + EMAC_UNLOCK(sc); +} + +static void +emac_init_locked(struct emac_softc *sc) +{ + struct ifnet *ifp; + struct mii_data *mii; + uint32_t reg_val; + uint8_t *eaddr; + + EMAC_ASSERT_LOCKED(sc); + + ifp = sc->emac_ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + + /* Flush RX FIFO */ + reg_val = EMAC_READ_REG(sc, EMAC_RX_CTL); + reg_val |= EMAC_RX_FLUSH_FIFO; + EMAC_WRITE_REG(sc, EMAC_RX_CTL, reg_val); + DELAY(1); + + /* Soft reset MAC */ + reg_val = EMAC_READ_REG(sc, EMAC_MAC_CTL0); + reg_val &= (~EMAC_MAC_CTL0_SOFT_RST); + EMAC_WRITE_REG(sc, EMAC_MAC_CTL0, reg_val); + + /* Set MII clock */ + reg_val = EMAC_READ_REG(sc, EMAC_MAC_MCFG); + reg_val &= (~(0xf << 2)); + reg_val |= (0xd << 2); + EMAC_WRITE_REG(sc, EMAC_MAC_MCFG, reg_val); + + /* Clear RX counter */ + EMAC_WRITE_REG(sc, EMAC_RX_FBC, 0); + + /* Disable all interrupt and clear interrupt status */ + EMAC_WRITE_REG(sc, EMAC_INT_CTL, 0); + reg_val = EMAC_READ_REG(sc, EMAC_INT_STA); + EMAC_WRITE_REG(sc, EMAC_INT_STA, reg_val); + DELAY(1); + + /* Set up TX */ + reg_val = EMAC_READ_REG(sc, EMAC_TX_MODE); + reg_val |= EMAC_TX_AB_M; + reg_val &= EMAC_TX_TM; + EMAC_WRITE_REG(sc, EMAC_TX_MODE, reg_val); + + /* Set up RX */ + reg_val = EMAC_READ_REG(sc, EMAC_RX_CTL); + reg_val |= EMAC_RX_SETUP; + reg_val &= EMAC_RX_TM; + EMAC_WRITE_REG(sc, EMAC_RX_CTL, reg_val); + + /* Set up MAC CTL0. */ + reg_val = EMAC_READ_REG(sc, EMAC_MAC_CTL0); + reg_val |= EMAC_MAC_CTL0_SETUP; + EMAC_WRITE_REG(sc, EMAC_MAC_CTL0, reg_val); + + /* Set up MAC CTL1. */ + reg_val = EMAC_READ_REG(sc, EMAC_MAC_CTL1); + reg_val |= EMAC_MAC_CTL1_SETUP; + EMAC_WRITE_REG(sc, EMAC_MAC_CTL1, reg_val); + + /* Set up IPGT */ + EMAC_WRITE_REG(sc, EMAC_MAC_IPGT, EMAC_MAC_IPGT_FD); + + /* Set up IPGR */ + EMAC_WRITE_REG(sc, EMAC_MAC_IPGR, EMAC_MAC_NBTB_IPG2 | + (EMAC_MAC_NBTB_IPG1 << 8)); + + /* Set up Collison window */ + EMAC_WRITE_REG(sc, EMAC_MAC_CLRT, EMAC_MAC_RM | (EMAC_MAC_CW << 8)); + + /* Set up Max Frame Length */ + EMAC_WRITE_REG(sc, EMAC_MAC_MAXF, EMAC_MAC_MFL); + + /* Setup ethernet address */ + eaddr = IF_LLADDR(ifp); + EMAC_WRITE_REG(sc, EMAC_MAC_A1, eaddr[0] << 16 | + eaddr[1] << 8 | eaddr[2]); + EMAC_WRITE_REG(sc, EMAC_MAC_A0, eaddr[3] << 16 | + eaddr[4] << 8 | eaddr[5]); + + /* Setup rx filter */ + emac_set_rx_mode(sc); + + /* Enable RX/TX0/RX Hlevel interrupt */ + reg_val = EMAC_READ_REG(sc, EMAC_INT_CTL); + reg_val |= EMAC_INT_EN; + EMAC_WRITE_REG(sc, EMAC_INT_CTL, reg_val); + + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + + sc->emac_link = 0; + + /* Switch to the current media. */ + mii = device_get_softc(sc->emac_miibus); + mii_mediachg(mii); + + callout_reset(&sc->emac_tick_ch, hz, emac_tick, sc); +} + + +static void +emac_start(struct ifnet *ifp) +{ + struct emac_softc *sc; + + sc = ifp->if_softc; + EMAC_LOCK(sc); + emac_start_locked(ifp); + EMAC_UNLOCK(sc); +} + +static void +emac_start_locked(struct ifnet *ifp) +{ + struct emac_softc *sc; + struct mbuf *m, *m0; + uint32_t reg_val; + + sc = ifp->if_softc; + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) + return; + if (sc->emac_link == 0) + return; + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) + return; + + /* Select channel */ + EMAC_WRITE_REG(sc, EMAC_TX_INS, 0); + + /* + * Emac controller wants 4 byte aligned TX buffers. + * We have to copy pretty much all the time. + */ + if (m->m_next != NULL || (mtod(m, uintptr_t) & 3) != 0) { + m0 = m_defrag(m, M_NOWAIT); + if (m0 == NULL) { + m_freem(m); + m = NULL; + return; + } + m = m0; + } + /* Write data */ + bus_space_write_multi_4(sc->emac_tag, sc->emac_handle, + EMAC_TX_IO_DATA, mtod(m, uint32_t *), + roundup2(m->m_len, 4) / 4); + + /* Send the data lengh. */ + EMAC_WRITE_REG(sc, EMAC_TX_PL0, m->m_len); + + /* Start translate from fifo to phy. */ + reg_val = EMAC_READ_REG(sc, EMAC_TX_CTL0); + reg_val |= 1; + EMAC_WRITE_REG(sc, EMAC_TX_CTL0, reg_val); + + /* Set timeout */ + sc->emac_watchdog_timer = 5; + + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + BPF_MTAP(ifp, m); + m_freem(m); +} + +static void +emac_stop_locked(struct emac_softc *sc) +{ + struct ifnet *ifp; + uint32_t reg_val; + + EMAC_ASSERT_LOCKED(sc); + + ifp = sc->emac_ifp; + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + sc->emac_link = 0; + + /* Disable all interrupt and clear interrupt status */ + EMAC_WRITE_REG(sc, EMAC_INT_CTL, 0); + reg_val = EMAC_READ_REG(sc, EMAC_INT_STA); + EMAC_WRITE_REG(sc, EMAC_INT_STA, reg_val); + + /* Disable RX/TX */ + reg_val = EMAC_READ_REG(sc, EMAC_CTL); + reg_val &= ~(EMAC_CTL_RST | EMAC_CTL_TX_EN | EMAC_CTL_RX_EN); + EMAC_WRITE_REG(sc, EMAC_CTL, reg_val); + + callout_stop(&sc->emac_tick_ch); +} + +static void +emac_intr(void *arg) +{ + struct emac_softc *sc; + struct ifnet *ifp; + uint32_t reg_val; + + sc = (struct emac_softc *)arg; + EMAC_LOCK(sc); + ifp = sc->emac_ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + + /* Disable all interrupts */ + EMAC_WRITE_REG(sc, EMAC_INT_CTL, 0); + /* Get EMAC interrupt status */ + reg_val = EMAC_READ_REG(sc, EMAC_INT_STA); + /* Clear ISR status */ + EMAC_WRITE_REG(sc, EMAC_INT_STA, reg_val); + + /* Received incoming packet */ + if (reg_val & EMAC_INT_STA_RX) + emac_rxeof(sc, sc->emac_rx_process_limit); + + /* Transmit Interrupt check */ + if (reg_val & EMAC_INT_STA_TX){ + emac_txeof(sc); + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + emac_start_locked(ifp); + } + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + /* Re-enable interrupt mask */ + reg_val = EMAC_READ_REG(sc, EMAC_INT_CTL); + reg_val |= EMAC_INT_EN; + EMAC_WRITE_REG(sc, EMAC_INT_CTL, reg_val); + } + EMAC_UNLOCK(sc); +} + +static int +emac_ioctl(struct ifnet *ifp, u_long command, caddr_t data) +{ + struct emac_softc *sc; + struct mii_data *mii; + struct ifreq *ifr; + int error = 0; + + sc = ifp->if_softc; + ifr = (struct ifreq *)data; + + switch (command) { + case SIOCSIFFLAGS: + EMAC_LOCK(sc); + if (ifp->if_flags & IFF_UP) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + if ((ifp->if_flags ^ sc->emac_if_flags) & + (IFF_PROMISC | IFF_ALLMULTI)) + emac_set_rx_mode(sc); + } else + emac_init_locked(sc); + } else { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + emac_stop_locked(sc); + } + sc->emac_if_flags = ifp->if_flags; + EMAC_UNLOCK(sc); + break; + case SIOCADDMULTI: + case SIOCDELMULTI: + EMAC_LOCK(sc); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + emac_set_rx_mode(sc); + } + EMAC_UNLOCK(sc); + break; + case SIOCGIFMEDIA: + case SIOCSIFMEDIA: + mii = device_get_softc(sc->emac_miibus); + error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); + break; + default: + error = ether_ioctl(ifp, command, data); + break; + } + return (error); +} + +static int +emac_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-emac")) + return (ENXIO); + + device_set_desc(dev, "A10/A20 EMAC ethernet controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +emac_detach(device_t dev) +{ + struct emac_softc *sc; + + sc = device_get_softc(dev); + sc->emac_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + if (device_is_attached(dev)) { + ether_ifdetach(sc->emac_ifp); + EMAC_LOCK(sc); + emac_stop_locked(sc); + EMAC_UNLOCK(sc); + callout_drain(&sc->emac_tick_ch); + } + + if (sc->emac_intrhand != NULL) + bus_teardown_intr(sc->emac_dev, sc->emac_irq, + sc->emac_intrhand); + + if (sc->emac_miibus != NULL) { + device_delete_child(sc->emac_dev, sc->emac_miibus); + bus_generic_detach(sc->emac_dev); + } + + if (sc->emac_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->emac_res); + + if (sc->emac_irq != NULL) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->emac_irq); + + if (sc->emac_ifp != NULL) + if_free(sc->emac_ifp); + + if (mtx_initialized(&sc->emac_mtx)) + mtx_destroy(&sc->emac_mtx); + + return (0); +} + +static int +emac_shutdown(device_t dev) +{ + + return (emac_suspend(dev)); +} + +static int +emac_suspend(device_t dev) +{ + struct emac_softc *sc; + struct ifnet *ifp; + + sc = device_get_softc(dev); + + EMAC_LOCK(sc); + ifp = sc->emac_ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + emac_stop_locked(sc); + EMAC_UNLOCK(sc); + + return (0); +} + +static int +emac_resume(device_t dev) +{ + struct emac_softc *sc; + struct ifnet *ifp; + + sc = device_get_softc(dev); + + EMAC_LOCK(sc); + ifp = sc->emac_ifp; + if ((ifp->if_flags & IFF_UP) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + emac_init_locked(sc); + } + EMAC_UNLOCK(sc); + + return (0); +} + +static int +emac_attach(device_t dev) +{ + struct emac_softc *sc; + struct ifnet *ifp; + int error, rid; + uint8_t eaddr[ETHER_ADDR_LEN]; + + sc = device_get_softc(dev); + sc->emac_dev = dev; + + error = 0; + mtx_init(&sc->emac_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF); + callout_init_mtx(&sc->emac_tick_ch, &sc->emac_mtx, 0); + + rid = 0; + sc->emac_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->emac_res == NULL) { + device_printf(dev, "unable to map memory\n"); + error = ENXIO; + goto fail; + } + + sc->emac_tag = rman_get_bustag(sc->emac_res); + sc->emac_handle = rman_get_bushandle(sc->emac_res); + + rid = 0; + sc->emac_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); + if (sc->emac_irq == NULL) { + device_printf(dev, "cannot allocate IRQ resources.\n"); + error = ENXIO; + goto fail; + } + /* Create device sysctl node. */ + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "process_limit", CTLTYPE_INT | CTLFLAG_RW, + &sc->emac_rx_process_limit, 0, sysctl_hw_emac_proc_limit, "I", + "max number of Rx events to process"); + + sc->emac_rx_process_limit = EMAC_PROC_DEFAULT; + error = resource_int_value(device_get_name(dev), device_get_unit(dev), + "process_limit", &sc->emac_rx_process_limit); + if (error == 0) { + if (sc->emac_rx_process_limit < EMAC_PROC_MIN || + sc->emac_rx_process_limit > EMAC_PROC_MAX) { + device_printf(dev, "process_limit value out of range; " + "using default: %d\n", EMAC_PROC_DEFAULT); + sc->emac_rx_process_limit = EMAC_PROC_DEFAULT; + } + } + /* Setup EMAC */ + emac_sys_setup(); + emac_reset(sc); + + ifp = sc->emac_ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + device_printf(dev, "unable to allocate ifp\n"); + error = ENOSPC; + goto fail; + } + ifp->if_softc = sc; + + /* Setup MII */ + error = mii_attach(dev, &sc->emac_miibus, ifp, emac_ifmedia_upd, + emac_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "PHY probe failed\n"); + goto fail; + } + + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_start = emac_start; + ifp->if_ioctl = emac_ioctl; + ifp->if_init = emac_init; + IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); + + /* Get MAC address */ + emac_get_hwaddr(sc, eaddr); + ether_ifattach(ifp, eaddr); + + /* VLAN capability setup. */ + ifp->if_capabilities |= IFCAP_VLAN_MTU; + ifp->if_capenable = ifp->if_capabilities; + /* Tell the upper layer we support VLAN over-sized frames. */ + ifp->if_hdrlen = sizeof(struct ether_vlan_header); + + error = bus_setup_intr(dev, sc->emac_irq, INTR_TYPE_NET | INTR_MPSAFE, + NULL, emac_intr, sc, &sc->emac_intrhand); + if (error != 0) { + device_printf(dev, "could not set up interrupt handler.\n"); + ether_ifdetach(ifp); + goto fail; + } + +fail: + if (error != 0) + emac_detach(dev); + return (error); +} + +static boolean_t +emac_miibus_iowait(struct emac_softc *sc) +{ + uint32_t timeout; + + for (timeout = 100; timeout != 0; --timeout) { + DELAY(100); + if ((EMAC_READ_REG(sc, EMAC_MAC_MIND) & 0x1) == 0) + return (true); + } + + return (false); +} + +/* + * The MII bus interface + */ +static int +emac_miibus_readreg(device_t dev, int phy, int reg) +{ + struct emac_softc *sc; + int rval; + + sc = device_get_softc(dev); + + /* Issue phy address and reg */ + EMAC_WRITE_REG(sc, EMAC_MAC_MADR, (phy << 8) | reg); + /* Pull up the phy io line */ + EMAC_WRITE_REG(sc, EMAC_MAC_MCMD, 0x1); + if (!emac_miibus_iowait(sc)) { + device_printf(dev, "timeout waiting for mii read\n"); + return (0); + } + /* Push down the phy io line */ + EMAC_WRITE_REG(sc, EMAC_MAC_MCMD, 0x0); + /* Read data */ + rval = EMAC_READ_REG(sc, EMAC_MAC_MRDD); + + return (rval); +} + +static int +emac_miibus_writereg(device_t dev, int phy, int reg, int data) +{ + struct emac_softc *sc; + + sc = device_get_softc(dev); + + /* Issue phy address and reg */ + EMAC_WRITE_REG(sc, EMAC_MAC_MADR, (phy << 8) | reg); + /* Write data */ + EMAC_WRITE_REG(sc, EMAC_MAC_MWTD, data); + /* Pull up the phy io line */ + EMAC_WRITE_REG(sc, EMAC_MAC_MCMD, 0x1); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Mar 3 11:36:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51FB416F; Mon, 3 Mar 2014 11:36:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3DE1FD32; Mon, 3 Mar 2014 11:36:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s23BafIm079578; Mon, 3 Mar 2014 11:36:41 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s23BaeB9079572; Mon, 3 Mar 2014 11:36:40 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201403031136.s23BaeB9079572@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Mon, 3 Mar 2014 11:36:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262711 - in head/sys: arm/allwinner arm/allwinner/a20 arm/conf boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 11:36:41 -0000 Author: ganbold Date: Mon Mar 3 11:36:39 2014 New Revision: 262711 URL: http://svnweb.freebsd.org/changeset/base/262711 Log: Add EMAC and SRAM controller entries to FDT. Add EMAC device to kernel config files and enable EMAC, SRAM drivers for build. Approved by: stas (mentor) Modified: head/sys/arm/allwinner/a20/files.a20 head/sys/arm/allwinner/files.a10 head/sys/arm/conf/CUBIEBOARD head/sys/arm/conf/CUBIEBOARD2 head/sys/boot/fdt/dts/arm/cubieboard.dts head/sys/boot/fdt/dts/arm/cubieboard2.dts Modified: head/sys/arm/allwinner/a20/files.a20 ============================================================================== --- head/sys/arm/allwinner/a20/files.a20 Mon Mar 3 11:32:55 2014 (r262710) +++ head/sys/arm/allwinner/a20/files.a20 Mon Mar 3 11:36:39 2014 (r262711) @@ -12,8 +12,10 @@ arm/arm/gic.c standard arm/allwinner/a20/a20_cpu_cfg.c standard arm/allwinner/a10_clk.c standard +arm/allwinner/a10_sramc.c standard arm/allwinner/a10_gpio.c optional gpio arm/allwinner/a10_ehci.c optional ehci +arm/allwinner/if_emac.c optional emac arm/allwinner/a10_wdog.c standard arm/allwinner/timer.c standard arm/arm/bus_space-v6.c standard Modified: head/sys/arm/allwinner/files.a10 ============================================================================== --- head/sys/arm/allwinner/files.a10 Mon Mar 3 11:32:55 2014 (r262710) +++ head/sys/arm/allwinner/files.a10 Mon Mar 3 11:36:39 2014 (r262711) @@ -11,8 +11,10 @@ arm/arm/irq_dispatch.S standard arm/allwinner/a20/a20_cpu_cfg.c standard arm/allwinner/a10_clk.c standard +arm/allwinner/a10_sramc.c standard arm/allwinner/a10_gpio.c optional gpio arm/allwinner/a10_ehci.c optional ehci +arm/allwinner/if_emac.c optional emac arm/allwinner/a10_wdog.c standard arm/allwinner/timer.c standard arm/allwinner/aintc.c standard Modified: head/sys/arm/conf/CUBIEBOARD ============================================================================== --- head/sys/arm/conf/CUBIEBOARD Mon Mar 3 11:32:55 2014 (r262710) +++ head/sys/arm/conf/CUBIEBOARD Mon Mar 3 11:36:39 2014 (r262711) @@ -125,6 +125,8 @@ device smscphy #device cpsw device bpf +device emac + # USB ethernet support, requires miibus device miibus Modified: head/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- head/sys/arm/conf/CUBIEBOARD2 Mon Mar 3 11:32:55 2014 (r262710) +++ head/sys/arm/conf/CUBIEBOARD2 Mon Mar 3 11:36:39 2014 (r262711) @@ -125,6 +125,8 @@ device smscphy #device cpsw device bpf +device emac + # USB ethernet support, requires miibus device miibus Modified: head/sys/boot/fdt/dts/arm/cubieboard.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/cubieboard.dts Mon Mar 3 11:32:55 2014 (r262710) +++ head/sys/boot/fdt/dts/arm/cubieboard.dts Mon Mar 3 11:36:39 2014 (r262711) @@ -61,6 +61,13 @@ reg = < 0x01c20400 0x400 >; }; + sramc@01c00000 { + compatible = "allwinner,sun4i-sramc"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x01c00000 0x1000 >; + }; + ccm@01c20000 { compatible = "allwinner,sun4i-ccm"; #address-cells = <1>; @@ -124,6 +131,13 @@ busy-detect = <1>; broken-txfifo = <1>; }; + + emac@01c0b000 { + compatible = "allwinner,sun4i-emac"; + reg = <0x01c0b000 0x1000>; + interrupts = <55>; + interrupt-parent = <&AINTC>; + }; }; chosen { Modified: head/sys/boot/fdt/dts/arm/cubieboard2.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/cubieboard2.dts Mon Mar 3 11:32:55 2014 (r262710) +++ head/sys/boot/fdt/dts/arm/cubieboard2.dts Mon Mar 3 11:36:39 2014 (r262711) @@ -61,6 +61,13 @@ #interrupt-cells = <1>; }; + sramc@01c00000 { + compatible = "allwinner,sun4i-sramc"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x01c00000 0x1000 >; + }; + cpu-cfg@01c25c00 { compatible = "allwinner,sun7i-cpu-cfg"; #address-cells = <1>; @@ -130,6 +137,13 @@ busy-detect = <1>; broken-txfifo = <1>; }; + + emac@01c0b000 { + compatible = "allwinner,sun4i-emac"; + reg = <0x01c0b000 0x1000>; + interrupts = <55>; + interrupt-parent = <&GIC>; + }; }; chosen { From owner-svn-src-head@FreeBSD.ORG Mon Mar 3 14:37:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BEB813E9; Mon, 3 Mar 2014 14:37:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB6A1F1C; Mon, 3 Mar 2014 14:37:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s23EbIAM053915; Mon, 3 Mar 2014 14:37:18 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s23EbIkL053914; Mon, 3 Mar 2014 14:37:18 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403031437.s23EbIkL053914@svn.freebsd.org> From: Ian Lepore Date: Mon, 3 Mar 2014 14:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262712 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 14:37:18 -0000 Author: ian Date: Mon Mar 3 14:37:18 2014 New Revision: 262712 URL: http://svnweb.freebsd.org/changeset/base/262712 Log: Use the standard __used macro instead of a bare __attribute__. Submitted by: bde Modified: head/sys/arm/arm/mpcore_timer.c Modified: head/sys/arm/arm/mpcore_timer.c ============================================================================== --- head/sys/arm/arm/mpcore_timer.c Mon Mar 3 11:36:39 2014 (r262711) +++ head/sys/arm/arm/mpcore_timer.c Mon Mar 3 14:37:18 2014 (r262712) @@ -369,8 +369,7 @@ DRIVER_MODULE(mp_tmr, simplebus, arm_tmr * RETURNS: * nothing */ -static void -__attribute__((used)) /* Must emit function code for the weak ref below. */ +static void __used /* Must emit function code for the weak ref below. */ arm_tmr_DELAY(int usec) { int32_t counts_per_usec; From owner-svn-src-head@FreeBSD.ORG Mon Mar 3 14:41:15 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 242557F9; Mon, 3 Mar 2014 14:41:15 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EAB40F4D; Mon, 3 Mar 2014 14:41:14 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WKU3N-000LHE-Nx; Mon, 03 Mar 2014 14:41:13 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s23Ef9jY046853; Mon, 3 Mar 2014 07:41:09 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18JHofxiRI7TDddslqUUiSb Subject: Re: svn commit: r262696 - head/sys/arm/arm From: Ian Lepore To: Bruce Evans In-Reply-To: <20140303181837.I859@besplex.bde.org> References: <201403022125.s22LPXgd078485@svn.freebsd.org> <20140303181837.I859@besplex.bde.org> Content-Type: text/plain; charset="us-ascii" Date: Mon, 03 Mar 2014 07:41:09 -0700 Message-ID: <1393857669.1149.281.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 14:41:15 -0000 On Mon, 2014-03-03 at 18:49 +1100, Bruce Evans wrote: > On Sun, 2 Mar 2014, Ian Lepore wrote: > > > Log: > > Add __attribute__((used)) so that the delay implementation doesn't get > > optimized away as unreferenced, causing linker errors when trying to > > resolve the weak reference to the missing function. > > Why not use the standard FreeBSD macro __used? Hard-coded > __attribute__(())s are not only unportable; they are gross style bugs. > They were all replaced by FreeBSD macros in old versions of FreeBSD. Thanks. I actually looked for __used and somehow failed to find it. -- Ian From owner-svn-src-head@FreeBSD.ORG Mon Mar 3 16:00:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C69C9A4C; Mon, 3 Mar 2014 16:00:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B39C88DC; Mon, 3 Mar 2014 16:00:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s23G0BUh087897; Mon, 3 Mar 2014 16:00:11 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s23G0BQg087896; Mon, 3 Mar 2014 16:00:11 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403031600.s23G0BQg087896@svn.freebsd.org> From: Ian Lepore Date: Mon, 3 Mar 2014 16:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262714 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 16:00:11 -0000 Author: ian Date: Mon Mar 3 16:00:11 2014 New Revision: 262714 URL: http://svnweb.freebsd.org/changeset/base/262714 Log: Add a missing semicolong, noticed by the gnu dt compiler. Modified: head/sys/boot/fdt/dts/arm/beaglebone.dts Modified: head/sys/boot/fdt/dts/arm/beaglebone.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/beaglebone.dts Mon Mar 3 15:58:42 2014 (r262713) +++ head/sys/boot/fdt/dts/arm/beaglebone.dts Mon Mar 3 16:00:11 2014 (r262714) @@ -135,7 +135,7 @@ compatible = "ti,am335x-pmic"; reg = <0x24>; }; - } + }; }; chosen { From owner-svn-src-head@FreeBSD.ORG Mon Mar 3 16:34:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68217FDE; Mon, 3 Mar 2014 16:34:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 54CF7C73; Mon, 3 Mar 2014 16:34:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s23GYhdo004188; Mon, 3 Mar 2014 16:34:43 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s23GYhOb004187; Mon, 3 Mar 2014 16:34:43 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403031634.s23GYhOb004187@svn.freebsd.org> From: Warner Losh Date: Mon, 3 Mar 2014 16:34:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262715 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 16:34:43 -0000 Author: imp Date: Mon Mar 3 16:34:42 2014 New Revision: 262715 URL: http://svnweb.freebsd.org/changeset/base/262715 Log: Add note about dtc switch. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Mar 3 16:00:11 2014 (r262714) +++ head/UPDATING Mon Mar 3 16:34:42 2014 (r262715) @@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20140226: + Switched back to the GPL dtc compiler due to updates in the upstream + dts files not being supported by the BSDL dtc compiler. You will need + to rebuild your kernel toolchain to pick up the new compiler. Core dumps + may result while building dtb files during a kernel build if you fail + to do so. Set WITHOUT_GPL_DTC if you require the BSDL compiler. + 20140216: Clang and llvm have been upgraded to 3.4 release. From owner-svn-src-head@FreeBSD.ORG Mon Mar 3 18:06:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D20BDA2; Mon, 3 Mar 2014 18:06:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1A8E9785; Mon, 3 Mar 2014 18:06:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s23I6P9D046246; Mon, 3 Mar 2014 18:06:25 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s23I6Pdp046245; Mon, 3 Mar 2014 18:06:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201403031806.s23I6Pdp046245@svn.freebsd.org> From: John Baldwin Date: Mon, 3 Mar 2014 18:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262716 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 18:06:26 -0000 Author: jhb Date: Mon Mar 3 18:06:25 2014 New Revision: 262716 URL: http://svnweb.freebsd.org/changeset/base/262716 Log: Include kbd(4) when vt(4) is enabled as on other platforms. Reported by: Anton Shterenlikht Modified: head/sys/conf/files.ia64 Modified: head/sys/conf/files.ia64 ============================================================================== --- head/sys/conf/files.ia64 Mon Mar 3 16:34:42 2014 (r262715) +++ head/sys/conf/files.ia64 Mon Mar 3 18:06:25 2014 (r262716) @@ -52,7 +52,7 @@ dev/fb/fb.c optional fb | vga dev/fb/vga.c optional vga dev/hwpmc/hwpmc_ia64.c optional hwpmc dev/io/iodev.c optional io -dev/kbd/kbd.c optional atkbd | sc | ukbd +dev/kbd/kbd.c optional atkbd | sc | ukbd | vt dev/syscons/scterm-teken.c optional sc dev/syscons/scvgarndr.c optional sc vga dev/syscons/scvtb.c optional sc From owner-svn-src-head@FreeBSD.ORG Mon Mar 3 23:26:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A41FFA; Mon, 3 Mar 2014 23:26:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EBE2AE6C; Mon, 3 Mar 2014 23:26:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s23NQmBO076203; Mon, 3 Mar 2014 23:26:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s23NQmEY076202; Mon, 3 Mar 2014 23:26:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403032326.s23NQmEY076202@svn.freebsd.org> From: Xin LI Date: Mon, 3 Mar 2014 23:26:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262719 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Mar 2014 23:26:49 -0000 Author: delphij Date: Mon Mar 3 23:26:48 2014 New Revision: 262719 URL: http://svnweb.freebsd.org/changeset/base/262719 Log: Document the fact that OpenSSH default configuration requires Capsicum capability mode support in kernel, which have been worked around later but it's still recommended to have it enabled. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Mar 3 23:19:28 2014 (r262718) +++ head/UPDATING Mon Mar 3 23:26:48 2014 (r262719) @@ -52,6 +52,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 has now been fixed, but any C++ applications or shared libraries built between r261283 and r261801 should be recompiled. +20140204: + OpenSSH will now ignore errors caused by kernel lacking of Capsicum + capability mode support. Please note that enabling the feature in + kernel is still highly recommended. + +20140131: + OpenSSH is now built with sandbox support, and will use sandbox as + the default privilege separation method. This requires Capsicum + capability mode support in kernel. + 20140128: The libelf and libdwarf libraries have been updated to newer versions from upstream. Shared library version numbers for From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 01:14:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76999B2C; Tue, 4 Mar 2014 01:14:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 63B01B0A; Tue, 4 Mar 2014 01:14:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s241Ec1u024338; Tue, 4 Mar 2014 01:14:38 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s241EcCd024337; Tue, 4 Mar 2014 01:14:38 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403040114.s241EcCd024337@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 4 Mar 2014 01:14:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262721 - head/usr.bin/tftp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 01:14:38 -0000 Author: marcel Date: Tue Mar 4 01:14:37 2014 New Revision: 262721 URL: http://svnweb.freebsd.org/changeset/base/262721 Log: Increase MAXLINE to deal with longer paths. Obtained from: Juniper Networks, Inc. Modified: head/usr.bin/tftp/main.c Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Mon Mar 3 23:30:54 2014 (r262720) +++ head/usr.bin/tftp/main.c Tue Mar 4 01:14:37 2014 (r262721) @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); #include "tftp-options.h" #include "tftp.h" -#define MAXLINE 200 +#define MAXLINE (2 * MAXPATHLEN) #define TIMEOUT 5 /* secs between rexmt's */ typedef struct sockaddr_storage peeraddr; From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 02:19:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CF9696D; Tue, 4 Mar 2014 02:19:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 55353F86; Tue, 4 Mar 2014 02:19:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s242JnE4048877; Tue, 4 Mar 2014 02:19:49 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s242JdLS048825; Tue, 4 Mar 2014 02:19:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403040219.s242JdLS048825@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 4 Mar 2014 02:19:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262722 - in head/lib/libc: . amd64 arm arm/aeabi capability compat-43 db db/btree db/db db/hash db/man db/mpool db/recno gdtoa gen gmon i386 ia64 iconv inet isc locale mips nameser net... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 02:19:49 -0000 Author: marcel Date: Tue Mar 4 02:19:39 2014 New Revision: 262722 URL: http://svnweb.freebsd.org/changeset/base/262722 Log: Replace use of ${.CURDIR} by ${LIBC_SRCTOP} and define ${LIBC_SRCTOP} if not already defined. This allows building libc from outside of lib/libc using a reach-over makefile. A typical use-case is to build a standard ILP32 version and a COMPAT32 version in a single iteration by building the COMPAT32 version using a reach-over makefile. Obtained from: Juniper Networks, Inc. Modified: head/lib/libc/Makefile head/lib/libc/amd64/Makefile.inc head/lib/libc/arm/Makefile.inc head/lib/libc/arm/aeabi/Makefile.inc head/lib/libc/capability/Makefile.inc head/lib/libc/compat-43/Makefile.inc head/lib/libc/db/Makefile.inc head/lib/libc/db/btree/Makefile.inc head/lib/libc/db/db/Makefile.inc head/lib/libc/db/hash/Makefile.inc head/lib/libc/db/man/Makefile.inc head/lib/libc/db/mpool/Makefile.inc head/lib/libc/db/recno/Makefile.inc head/lib/libc/gdtoa/Makefile.inc head/lib/libc/gen/Makefile.inc head/lib/libc/gmon/Makefile.inc head/lib/libc/i386/Makefile.inc head/lib/libc/ia64/Makefile.inc head/lib/libc/iconv/Makefile.inc head/lib/libc/inet/Makefile.inc head/lib/libc/isc/Makefile.inc head/lib/libc/locale/Makefile.inc head/lib/libc/mips/Makefile.inc head/lib/libc/nameser/Makefile.inc head/lib/libc/net/Makefile.inc head/lib/libc/nls/Makefile.inc head/lib/libc/posix1e/Makefile.inc head/lib/libc/powerpc/Makefile.inc head/lib/libc/powerpc64/Makefile.inc head/lib/libc/quad/Makefile.inc head/lib/libc/regex/Makefile.inc head/lib/libc/resolv/Makefile.inc head/lib/libc/rpc/Makefile.inc head/lib/libc/softfloat/Makefile.inc head/lib/libc/sparc64/Makefile.inc head/lib/libc/sparc64/fpu/Makefile.inc head/lib/libc/sparc64/sys/Makefile.inc head/lib/libc/stdio/Makefile.inc head/lib/libc/stdlib/Makefile.inc head/lib/libc/stdlib/jemalloc/Makefile.inc head/lib/libc/stdtime/Makefile.inc head/lib/libc/string/Makefile.inc head/lib/libc/sys/Makefile.inc head/lib/libc/uuid/Makefile.inc head/lib/libc/xdr/Makefile.inc head/lib/libc/yp/Makefile.inc Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/Makefile Tue Mar 4 02:19:39 2014 (r262722) @@ -5,11 +5,13 @@ SHLIBDIR?= /lib .include +LIBC_SRCTOP?= ${.CURDIR} + # Pick the current architecture directory for libc. In general, this is # named MACHINE_CPUARCH, but some ABIs are different enough to require # their own libc, so allow a directory named MACHINE_ARCH to override this. -.if exists(${.CURDIR}/${MACHINE_ARCH}) +.if exists(${LIBC_SRCTOP}/${MACHINE_ARCH}) LIBC_ARCH=${MACHINE_ARCH} .else LIBC_ARCH=${MACHINE_CPUARCH} @@ -25,8 +27,8 @@ LIB=c SHLIB_MAJOR= 7 SHLIB_LDSCRIPT=libc.ldscript WARNS?= 2 -CFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include -CFLAGS+=-I${.CURDIR}/${LIBC_ARCH} +CFLAGS+=-I${LIBC_SRCTOP}/include -I${LIBC_SRCTOP}/../../include +CFLAGS+=-I${LIBC_SRCTOP}/${LIBC_ARCH} .if ${MK_NLS} != "no" CFLAGS+=-DNLS .endif @@ -61,49 +63,49 @@ MDASM= MIASM= NOASM= -.include "${.CURDIR}/${LIBC_ARCH}/Makefile.inc" -.include "${.CURDIR}/db/Makefile.inc" -.include "${.CURDIR}/compat-43/Makefile.inc" -.include "${.CURDIR}/gdtoa/Makefile.inc" -.include "${.CURDIR}/gen/Makefile.inc" -.include "${.CURDIR}/gmon/Makefile.inc" +.include "${LIBC_SRCTOP}/${LIBC_ARCH}/Makefile.inc" +.include "${LIBC_SRCTOP}/db/Makefile.inc" +.include "${LIBC_SRCTOP}/compat-43/Makefile.inc" +.include "${LIBC_SRCTOP}/gdtoa/Makefile.inc" +.include "${LIBC_SRCTOP}/gen/Makefile.inc" +.include "${LIBC_SRCTOP}/gmon/Makefile.inc" .if ${MK_ICONV} != "no" -.include "${.CURDIR}/iconv/Makefile.inc" +.include "${LIBC_SRCTOP}/iconv/Makefile.inc" .endif -.include "${.CURDIR}/inet/Makefile.inc" -.include "${.CURDIR}/isc/Makefile.inc" -.include "${.CURDIR}/locale/Makefile.inc" -.include "${.CURDIR}/nameser/Makefile.inc" -.include "${.CURDIR}/net/Makefile.inc" -.include "${.CURDIR}/nls/Makefile.inc" -.include "${.CURDIR}/posix1e/Makefile.inc" +.include "${LIBC_SRCTOP}/inet/Makefile.inc" +.include "${LIBC_SRCTOP}/isc/Makefile.inc" +.include "${LIBC_SRCTOP}/locale/Makefile.inc" +.include "${LIBC_SRCTOP}/nameser/Makefile.inc" +.include "${LIBC_SRCTOP}/net/Makefile.inc" +.include "${LIBC_SRCTOP}/nls/Makefile.inc" +.include "${LIBC_SRCTOP}/posix1e/Makefile.inc" .if ${LIBC_ARCH} != "amd64" && \ ${LIBC_ARCH} != "ia64" && \ ${LIBC_ARCH} != "powerpc64" && \ ${LIBC_ARCH} != "sparc64" && \ ${MACHINE_ARCH:Mmipsn32*} == "" && \ ${MACHINE_ARCH:Mmips64*} == "" -.include "${.CURDIR}/quad/Makefile.inc" +.include "${LIBC_SRCTOP}/quad/Makefile.inc" .endif -.include "${.CURDIR}/regex/Makefile.inc" -.include "${.CURDIR}/resolv/Makefile.inc" -.include "${.CURDIR}/stdio/Makefile.inc" -.include "${.CURDIR}/stdlib/Makefile.inc" -.include "${.CURDIR}/stdlib/jemalloc/Makefile.inc" -.include "${.CURDIR}/stdtime/Makefile.inc" -.include "${.CURDIR}/string/Makefile.inc" -.include "${.CURDIR}/sys/Makefile.inc" -.include "${.CURDIR}/rpc/Makefile.inc" -.include "${.CURDIR}/uuid/Makefile.inc" -.include "${.CURDIR}/xdr/Makefile.inc" +.include "${LIBC_SRCTOP}/regex/Makefile.inc" +.include "${LIBC_SRCTOP}/resolv/Makefile.inc" +.include "${LIBC_SRCTOP}/stdio/Makefile.inc" +.include "${LIBC_SRCTOP}/stdlib/Makefile.inc" +.include "${LIBC_SRCTOP}/stdlib/jemalloc/Makefile.inc" +.include "${LIBC_SRCTOP}/stdtime/Makefile.inc" +.include "${LIBC_SRCTOP}/string/Makefile.inc" +.include "${LIBC_SRCTOP}/sys/Makefile.inc" +.include "${LIBC_SRCTOP}/rpc/Makefile.inc" +.include "${LIBC_SRCTOP}/uuid/Makefile.inc" +.include "${LIBC_SRCTOP}/xdr/Makefile.inc" .if ${LIBC_ARCH} == "arm" || ${LIBC_ARCH} == "mips" -.include "${.CURDIR}/softfloat/Makefile.inc" +.include "${LIBC_SRCTOP}/softfloat/Makefile.inc" .endif .if ${MK_NIS} != "no" CFLAGS+= -DYP -.include "${.CURDIR}/yp/Makefile.inc" +.include "${LIBC_SRCTOP}/yp/Makefile.inc" .endif -.include "${.CURDIR}/capability/Makefile.inc" +.include "${LIBC_SRCTOP}/capability/Makefile.inc" .if ${MK_HESIOD} != "no" CFLAGS+= -DHESIOD .endif @@ -119,7 +121,7 @@ CFLAGS+=-D_FREEFALL_CONFIG STATICOBJS+=${LIBC_NONSHARED_SRCS:S/.c$/.o/} -VERSION_DEF=${.CURDIR}/Versions.def +VERSION_DEF=${LIBC_SRCTOP}/Versions.def SYMBOL_MAPS=${SYM_MAPS} CFLAGS+= -DSYMBOL_VERSIONING @@ -147,7 +149,7 @@ KSRCS= bcmp.c ffs.c ffsl.c fls.c flsl.c libkern: libkern.gen libkern.${LIBC_ARCH} libkern.gen: ${KQSRCS} ${KSRCS} - cp -p ${.CURDIR}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern + cp -p ${LIBC_SRCTOP}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern libkern.${LIBC_ARCH}:: ${KMSRCS} .if defined(KMSRCS) && !empty(KMSRCS) Modified: head/lib/libc/amd64/Makefile.inc ============================================================================== --- head/lib/libc/amd64/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/amd64/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -6,4 +6,4 @@ # Long double is 80 bits GDTOASRCS+=strtorx.c MDSRCS+=machdep_ldisx.c -SYM_MAPS+=${.CURDIR}/amd64/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/amd64/Symbol.map Modified: head/lib/libc/arm/Makefile.inc ============================================================================== --- head/lib/libc/arm/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/arm/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -7,12 +7,12 @@ SOFTFLOAT_BITS=32 # Long double is just double precision. MDSRCS+=machdep_ldisd.c -SYM_MAPS+=${.CURDIR}/arm/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol.map .if ${MK_ARM_EABI} == "no" # This contains the symbols that were removed when moving to the ARM EABI -SYM_MAPS+=${.CURDIR}/arm/Symbol_oabi.map +SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol_oabi.map .else -.include "${.CURDIR}/arm/aeabi/Makefile.inc" +.include "${LIBC_SRCTOP}/arm/aeabi/Makefile.inc" .endif Modified: head/lib/libc/arm/aeabi/Makefile.inc ============================================================================== --- head/lib/libc/arm/aeabi/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/arm/aeabi/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/arm/aeabi +.PATH: ${LIBC_SRCTOP}/arm/aeabi SRCS+= aeabi_atexit.c \ aeabi_double.c \ @@ -11,7 +11,7 @@ SRCS+= aeabi_atexit.c \ # libc. This causes issues when other parts of libc call these functions. # We work around this by including these functions in libc but mark them as # hidden so users of libc will not pick up these versions. -.PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/arm +.PATH: ${LIBC_SRCTOP}/../../contrib/compiler-rt/lib/arm SRCS+= aeabi_memcmp.S \ aeabi_memcpy.S \ @@ -26,5 +26,5 @@ CFLAGS.aeabi_memset.S= -DVISIBILITY_HIDD CFLAGS+= ${CFLAGS.${.IMPSRC:T}} -SYM_MAPS+=${.CURDIR}/arm/aeabi/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/arm/aeabi/Symbol.map Modified: head/lib/libc/capability/Makefile.inc ============================================================================== --- head/lib/libc/capability/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/capability/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,11 +1,11 @@ # $FreeBSD$ # capability sources -.PATH: ${.CURDIR}/../../sys/kern ${.CURDIR}/capability +.PATH: ${LIBC_SRCTOP}/../../sys/kern ${LIBC_SRCTOP}/capability SRCS+= subr_capability.c -SYM_MAPS+= ${.CURDIR}/capability/Symbol.map +SYM_MAPS+= ${LIBC_SRCTOP}/capability/Symbol.map MAN+= cap_rights_init.3 Modified: head/lib/libc/compat-43/Makefile.inc ============================================================================== --- head/lib/libc/compat-43/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/compat-43/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -2,12 +2,12 @@ # $FreeBSD$ # compat-43 sources -.PATH: ${.CURDIR}/${LIBC_ARCH}/compat-43 ${.CURDIR}/compat-43 +.PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/compat-43 ${LIBC_SRCTOP}/compat-43 SRCS+= creat.c gethostid.c getwd.c killpg.c sethostid.c setpgrp.c \ setrgid.c setruid.c sigcompat.c -SYM_MAPS+=${.CURDIR}/compat-43/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/compat-43/Symbol.map MAN+= creat.2 killpg.2 sigpause.2 sigsetmask.2 sigvec.2 MAN+= gethostid.3 setruid.3 Modified: head/lib/libc/db/Makefile.inc ============================================================================== --- head/lib/libc/db/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/db/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -3,11 +3,11 @@ # CFLAGS+=-D__DBINTERFACE_PRIVATE -.include "${.CURDIR}/db/btree/Makefile.inc" -.include "${.CURDIR}/db/db/Makefile.inc" -.include "${.CURDIR}/db/hash/Makefile.inc" -.include "${.CURDIR}/db/man/Makefile.inc" -.include "${.CURDIR}/db/mpool/Makefile.inc" -.include "${.CURDIR}/db/recno/Makefile.inc" +.include "${LIBC_SRCTOP}/db/btree/Makefile.inc" +.include "${LIBC_SRCTOP}/db/db/Makefile.inc" +.include "${LIBC_SRCTOP}/db/hash/Makefile.inc" +.include "${LIBC_SRCTOP}/db/man/Makefile.inc" +.include "${LIBC_SRCTOP}/db/mpool/Makefile.inc" +.include "${LIBC_SRCTOP}/db/recno/Makefile.inc" -SYM_MAPS+=${.CURDIR}/db/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/db/Symbol.map Modified: head/lib/libc/db/btree/Makefile.inc ============================================================================== --- head/lib/libc/db/btree/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/db/btree/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,7 +1,7 @@ # from @(#)Makefile.inc 8.2 (Berkeley) 7/14/94 # $FreeBSD$ -.PATH: ${.CURDIR}/db/btree +.PATH: ${LIBC_SRCTOP}/db/btree SRCS+= bt_close.c bt_conv.c bt_debug.c bt_delete.c bt_get.c bt_open.c \ bt_overflow.c bt_page.c bt_put.c bt_search.c bt_seq.c bt_split.c \ Modified: head/lib/libc/db/db/Makefile.inc ============================================================================== --- head/lib/libc/db/db/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/db/db/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,6 +1,6 @@ # from @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -.PATH: ${.CURDIR}/db/db +.PATH: ${LIBC_SRCTOP}/db/db SRCS+= db.c Modified: head/lib/libc/db/hash/Makefile.inc ============================================================================== --- head/lib/libc/db/hash/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/db/hash/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,7 +1,7 @@ # from @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -.PATH: ${.CURDIR}/db/hash +.PATH: ${LIBC_SRCTOP}/db/hash SRCS+= hash.c hash_bigkey.c hash_buf.c hash_func.c hash_log2.c \ hash_page.c ndbm.c Modified: head/lib/libc/db/man/Makefile.inc ============================================================================== --- head/lib/libc/db/man/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/db/man/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,7 +1,7 @@ # from @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -.PATH: ${.CURDIR}/db/man +.PATH: ${LIBC_SRCTOP}/db/man MAN+= btree.3 dbm.3 dbopen.3 hash.3 mpool.3 recno.3 Modified: head/lib/libc/db/mpool/Makefile.inc ============================================================================== --- head/lib/libc/db/mpool/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/db/mpool/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,6 +1,6 @@ # from @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -.PATH: ${.CURDIR}/db/mpool +.PATH: ${LIBC_SRCTOP}/db/mpool SRCS+= mpool.c mpool-compat.c Modified: head/lib/libc/db/recno/Makefile.inc ============================================================================== --- head/lib/libc/db/recno/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/db/recno/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,7 +1,7 @@ # from @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -.PATH: ${.CURDIR}/db/recno +.PATH: ${LIBC_SRCTOP}/db/recno SRCS+= rec_close.c rec_delete.c rec_get.c rec_open.c rec_put.c rec_search.c \ rec_seq.c rec_utils.c Modified: head/lib/libc/gdtoa/Makefile.inc ============================================================================== --- head/lib/libc/gdtoa/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/gdtoa/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,20 +1,20 @@ # $FreeBSD$ # netlib gdtoa sources -.PATH: ${.CURDIR}/gdtoa +.PATH: ${LIBC_SRCTOP}/gdtoa MISRCS+=_hdtoa.c _hldtoa.c _ldtoa.c glue.c GDTOASRCS+=dmisc.c dtoa.c gdtoa.c gethex.c gmisc.c \ hd_init.c hexnan.c misc.c smisc.c \ strtod.c strtodg.c strtof.c strtord.c sum.c ulp.c -SYM_MAPS+=${.CURDIR}/gdtoa/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/gdtoa/Symbol.map -CFLAGS+=-I${.CURDIR}/../../contrib/gdtoa +CFLAGS+=-I${LIBC_SRCTOP}/../../contrib/gdtoa .for src in ${GDTOASRCS} MISRCS+=gdtoa_${src} CLEANFILES+=gdtoa_${src} gdtoa_${src}: - ln -sf ${.CURDIR}/../../contrib/gdtoa/${src} ${.TARGET} + ln -sf ${LIBC_SRCTOP}/../../contrib/gdtoa/${src} ${.TARGET} .endfor Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/gen/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -2,7 +2,7 @@ # $FreeBSD$ # machine-independent gen sources -.PATH: ${.CURDIR}/${LIBC_ARCH}/gen ${.CURDIR}/gen +.PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen SRCS+= __getosreldate.c \ __xuname.c \ @@ -145,11 +145,11 @@ SRCS+= __getosreldate.c \ waitid.c \ wordexp.c -.PATH: ${.CURDIR}/../../contrib/libc-pwcache +.PATH: ${LIBC_SRCTOP}/../../contrib/libc-pwcache SRCS+= pwcache.c pwcache.h -.PATH: ${.CURDIR}/../../contrib/libc-vis -CFLAGS+= -I${.CURDIR}/../../contrib/libc-vis +.PATH: ${LIBC_SRCTOP}/../../contrib/libc-vis +CFLAGS+= -I${LIBC_SRCTOP}/../../contrib/libc-vis SRCS+= unvis.c vis.c MISRCS+=modf.c @@ -159,13 +159,13 @@ CANCELPOINTS_SRCS=sem.c sem_new.c SRCS+=cancelpoints_${src} CLEANFILES+=cancelpoints_${src} cancelpoints_${src}: - ln -sf ${.CURDIR}/gen/${src} ${.TARGET} + ln -sf ${LIBC_SRCTOP}/gen/${src} ${.TARGET} .endfor -SYM_MAPS+=${.CURDIR}/gen/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/gen/Symbol.map # machine-dependent gen sources -.sinclude "${.CURDIR}/${LIBC_ARCH}/gen/Makefile.inc" +.sinclude "${LIBC_SRCTOP}/${LIBC_ARCH}/gen/Makefile.inc" MAN+= alarm.3 \ arc4random.3 \ Modified: head/lib/libc/gmon/Makefile.inc ============================================================================== --- head/lib/libc/gmon/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/gmon/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -2,11 +2,11 @@ # $FreeBSD$ # gmon sources -.PATH: ${.CURDIR}/gmon +.PATH: ${LIBC_SRCTOP}/gmon SRCS+= gmon.c mcount.c -SYM_MAPS+=${.CURDIR}/gmon/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/gmon/Symbol.map MAN+= moncontrol.3 Modified: head/lib/libc/i386/Makefile.inc ============================================================================== --- head/lib/libc/i386/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/i386/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -3,4 +3,4 @@ # Long double is 80 bits GDTOASRCS+=strtorx.c MDSRCS+=machdep_ldisx.c -SYM_MAPS+=${.CURDIR}/i386/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/i386/Symbol.map Modified: head/lib/libc/ia64/Makefile.inc ============================================================================== --- head/lib/libc/ia64/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/ia64/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -6,4 +6,4 @@ # Long double is 80 bits GDTOASRCS+=strtorx.c MDSRCS+=machdep_ldisx.c -SYM_MAPS+=${.CURDIR}/ia64/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/ia64/Symbol.map Modified: head/lib/libc/iconv/Makefile.inc ============================================================================== --- head/lib/libc/iconv/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/iconv/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,7 +1,7 @@ # $FreeBSD$ # iconv sources -.PATH: ${.CURDIR}/iconv +.PATH: ${LIBC_SRCTOP}/iconv MAN+= iconv.3 iconvctl.3 iconv_canonicalize.3 iconvlist.3 __iconv_get_list.3 MLINKS+= iconv.3 iconv_open.3 \ @@ -15,8 +15,8 @@ SRCS+= citrus_bcs.c citrus_bcs_strtol.c citrus_lookup_factory.c citrus_mapper.c citrus_memstream.c \ citrus_mmap.c citrus_module.c citrus_none.c citrus_pivot_factory.c \ citrus_prop.c citrus_stdenc.c bsd_iconv.c iconv_compat.c -SYM_MAPS+= ${.CURDIR}/iconv/Symbol.map +SYM_MAPS+= ${LIBC_SRCTOP}/iconv/Symbol.map .if ${MK_ICONV} == yes -.include "${.CURDIR}/../libc_nonshared/Makefile.iconv" +.include "${LIBC_SRCTOP}/../libc_nonshared/Makefile.iconv" .endif Modified: head/lib/libc/inet/Makefile.inc ============================================================================== --- head/lib/libc/inet/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/inet/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,11 +1,11 @@ # $FreeBSD$ # inet sources -.PATH: ${.CURDIR}/inet +.PATH: ${LIBC_SRCTOP}/inet SRCS+= inet_addr.c inet_cidr_ntop.c inet_cidr_pton.c inet_lnaof.c \ inet_makeaddr.c inet_net_ntop.c inet_net_pton.c inet_neta.c \ inet_netof.c inet_network.c inet_ntoa.c inet_ntop.c \ inet_pton.c nsap_addr.c -SYM_MAPS+= ${.CURDIR}/inet/Symbol.map +SYM_MAPS+= ${LIBC_SRCTOP}/inet/Symbol.map Modified: head/lib/libc/isc/Makefile.inc ============================================================================== --- head/lib/libc/isc/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/isc/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,6 +1,6 @@ # $FreeBSD$ # isc sources -.PATH: ${.CURDIR}/isc +.PATH: ${LIBC_SRCTOP}/isc SRCS+= ev_streams.c ev_timers.c Modified: head/lib/libc/locale/Makefile.inc ============================================================================== --- head/lib/libc/locale/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/locale/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -2,7 +2,7 @@ # $FreeBSD$ # locale sources -.PATH: ${.CURDIR}/${LIBC_ARCH}/locale ${.CURDIR}/locale +.PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/locale ${LIBC_SRCTOP}/locale SRCS+= ascii.c big5.c btowc.c collate.c collcmp.c euc.c fix_grouping.c \ gb18030.c gb2312.c gbk.c ctype.c isctype.c iswctype.c \ @@ -29,7 +29,7 @@ SRCS+= c16rtomb_iconv.c c32rtomb_iconv.c SRCS+= c16rtomb.c c32rtomb.c mbrtoc16.c mbrtoc32.c .endif -SYM_MAPS+=${.CURDIR}/locale/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/locale/Symbol.map MAN+= btowc.3 \ ctype_l.3 \ Modified: head/lib/libc/mips/Makefile.inc ============================================================================== --- head/lib/libc/mips/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/mips/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -4,4 +4,4 @@ CFLAGS+=-DSOFTFLOAT MDSRCS+= machdep_ldisd.c -SYM_MAPS+= ${.CURDIR}/mips/Symbol.map +SYM_MAPS+= ${LIBC_SRCTOP}/mips/Symbol.map Modified: head/lib/libc/nameser/Makefile.inc ============================================================================== --- head/lib/libc/nameser/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/nameser/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,8 +1,8 @@ # $FreeBSD$ # nameser sources -.PATH: ${.CURDIR}/nameser +.PATH: ${LIBC_SRCTOP}/nameser SRCS+= ns_name.c ns_netint.c ns_parse.c ns_print.c ns_samedomain.c ns_ttl.c -SYM_MAPS+= ${.CURDIR}/nameser/Symbol.map +SYM_MAPS+= ${LIBC_SRCTOP}/nameser/Symbol.map Modified: head/lib/libc/net/Makefile.inc ============================================================================== --- head/lib/libc/net/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/net/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -2,7 +2,7 @@ # $FreeBSD$ # machine-independent net sources -.PATH: ${.CURDIR}/net +.PATH: ${LIBC_SRCTOP}/net SRCS+= base64.c ether_addr.c eui64.c \ gai_strerror.c getaddrinfo.c \ @@ -20,7 +20,7 @@ SRCS+= base64.c ether_addr.c eui64.c \ SRCS+= nscache.c nscachedcli.c .endif -SYM_MAPS+=${.CURDIR}/net/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/net/Symbol.map .if ${MK_INET6_SUPPORT} != "no" CFLAGS+=-DINET6 @@ -29,7 +29,7 @@ CFLAGS+=-DINET6 CFLAGS+=-I${.OBJDIR} # name6.c refers res_private.h -CFLAGS+=-I${.CURDIR}/resolv +CFLAGS+=-I${LIBC_SRCTOP}/resolv YFLAGS+=-p_nsyy LFLAGS+=-P_nsyy Modified: head/lib/libc/nls/Makefile.inc ============================================================================== --- head/lib/libc/nls/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/nls/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,11 +1,11 @@ # from $NetBSD: Makefile.inc,v 1.7 1995/02/27 13:06:20 cgd Exp $ # $FreeBSD$ -.PATH: ${.CURDIR}/nls +.PATH: ${LIBC_SRCTOP}/nls SRCS+= msgcat.c -SYM_MAPS+=${.CURDIR}/nls/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/nls/Symbol.map MAN+= catclose.3 catgets.3 catopen.3 Modified: head/lib/libc/posix1e/Makefile.inc ============================================================================== --- head/lib/libc/posix1e/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/posix1e/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,11 +1,11 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/posix1e +.PATH: ${LIBC_SRCTOP}/posix1e CFLAGS+=-D_ACL_PRIVATE # Copy kern/subr_acl_nfs4.c to the libc object directory. -subr_acl_nfs4.c: ${.CURDIR}/../../sys/kern/subr_acl_nfs4.c +subr_acl_nfs4.c: ${LIBC_SRCTOP}/../../sys/kern/subr_acl_nfs4.c cat ${.ALLSRC} > ${.TARGET} SRCS+= acl_branding.c \ @@ -37,7 +37,7 @@ SRCS+= acl_branding.c \ mac_set.c \ subr_acl_nfs4.c -SYM_MAPS+=${.CURDIR}/posix1e/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/posix1e/Symbol.map MAN+= acl.3 \ acl_add_flag_np.3 \ Modified: head/lib/libc/powerpc/Makefile.inc ============================================================================== --- head/lib/libc/powerpc/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/powerpc/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -4,4 +4,4 @@ SRCS+= __vdso_gettc.c # Long double is 64-bits MDSRCS+=machdep_ldisd.c -SYM_MAPS+=${.CURDIR}/powerpc/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/powerpc/Symbol.map Modified: head/lib/libc/powerpc64/Makefile.inc ============================================================================== --- head/lib/libc/powerpc64/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/powerpc64/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -4,4 +4,4 @@ SRCS+= __vdso_gettc.c # Long double is 64-bits MDSRCS+=machdep_ldisd.c -SYM_MAPS+=${.CURDIR}/powerpc64/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/powerpc64/Symbol.map Modified: head/lib/libc/quad/Makefile.inc ============================================================================== --- head/lib/libc/quad/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/quad/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -2,7 +2,7 @@ # $FreeBSD$ # Quad support, if needed -.PATH: ${.CURDIR}/${LIBC_ARCH}/quad ${.CURDIR}/quad +.PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/quad ${LIBC_SRCTOP}/quad .if ${LIBC_ARCH} == "i386" @@ -22,4 +22,4 @@ SRCS+= adddi3.c anddi3.c ashldi3.c ashrd .endif -SYM_MAPS+=${.CURDIR}/quad/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/quad/Symbol.map Modified: head/lib/libc/regex/Makefile.inc ============================================================================== --- head/lib/libc/regex/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/regex/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -2,13 +2,13 @@ # $FreeBSD$ # regex sources -.PATH: ${.CURDIR}/regex +.PATH: ${LIBC_SRCTOP}/regex CFLAGS+=-DPOSIX_MISTAKE SRCS+= regcomp.c regerror.c regexec.c regfree.c -SYM_MAPS+=${.CURDIR}/regex/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/regex/Symbol.map MAN+= regex.3 MAN+= re_format.7 Modified: head/lib/libc/resolv/Makefile.inc ============================================================================== --- head/lib/libc/resolv/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/resolv/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,10 +1,10 @@ # $FreeBSD$ # resolv sources -.PATH: ${.CURDIR}/resolv +.PATH: ${LIBC_SRCTOP}/resolv SRCS+= herror.c h_errno.c mtctxres.c res_comp.c res_data.c res_debug.c \ res_findzonecut.c res_init.c res_mkquery.c res_mkupdate.c \ res_query.c res_send.c res_state.c res_update.c -SYM_MAPS+= ${.CURDIR}/resolv/Symbol.map +SYM_MAPS+= ${LIBC_SRCTOP}/resolv/Symbol.map Modified: head/lib/libc/rpc/Makefile.inc ============================================================================== --- head/lib/libc/rpc/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/rpc/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,7 +1,7 @@ # @(#)Makefile 5.11 (Berkeley) 9/6/90 # $FreeBSD$ -.PATH: ${.CURDIR}/rpc ${.CURDIR}/. +.PATH: ${LIBC_SRCTOP}/rpc ${LIBC_SRCTOP}/. SRCS+= auth_none.c auth_unix.c authunix_prot.c bindresvport.c clnt_bcast.c \ clnt_dg.c clnt_generic.c clnt_perror.c clnt_raw.c clnt_simple.c \ clnt_vc.c rpc_dtablesize.c getnetconfig.c getnetpath.c getrpcent.c \ @@ -26,10 +26,10 @@ SRCS+= rtime.c # generated sources SRCS+= crypt_clnt.c crypt_xdr.c crypt.h -SYM_MAPS+=${.CURDIR}/rpc/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/rpc/Symbol.map CFLAGS+= -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -CFLAGS+= -I${.CURDIR}/rpc +CFLAGS+= -I${LIBC_SRCTOP}/rpc CLEANFILES+= crypt_clnt.c crypt_xdr.c crypt.h Modified: head/lib/libc/softfloat/Makefile.inc ============================================================================== --- head/lib/libc/softfloat/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/softfloat/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -3,9 +3,11 @@ SOFTFLOAT_BITS?=64 .PATH: ${LIBC_ARCH}/softfloat \ - ${.CURDIR}/softfloat/bits${SOFTFLOAT_BITS} ${.CURDIR}/softfloat + ${LIBC_SRCTOP}/softfloat/bits${SOFTFLOAT_BITS} \ + ${LIBC_SRCTOP}/softfloat -CFLAGS+= -I${.CURDIR}/${LIBC_ARCH}/softfloat -I${.CURDIR}/softfloat +CFLAGS+= -I${LIBC_SRCTOP}/${LIBC_ARCH}/softfloat \ + -I${LIBC_SRCTOP}/softfloat CFLAGS+= -DSOFTFLOAT_FOR_GCC SRCS+= softfloat.c @@ -27,4 +29,4 @@ CFLAGS+= -DFLOATX80 SRCS+= nexf2.c gtxf2.c gexf2.c negxf2.c .endif -SYM_MAPS+= ${.CURDIR}/softfloat/Symbol.map +SYM_MAPS+= ${LIBC_SRCTOP}/softfloat/Symbol.map Modified: head/lib/libc/sparc64/Makefile.inc ============================================================================== --- head/lib/libc/sparc64/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/sparc64/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -10,4 +10,4 @@ SRCS+= __vdso_gettc.c # Long double is quad precision GDTOASRCS+=strtorQ.c MDSRCS+=machdep_ldisQ.c -SYM_MAPS+=${.CURDIR}/sparc64/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/sparc64/Symbol.map Modified: head/lib/libc/sparc64/fpu/Makefile.inc ============================================================================== --- head/lib/libc/sparc64/fpu/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/sparc64/fpu/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,8 +1,8 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/sparc64/fpu +.PATH: ${LIBC_SRCTOP}/sparc64/fpu -CFLAGS+= -I${.CURDIR}/sparc64/sys +CFLAGS+= -I${LIBC_SRCTOP}/sparc64/sys SRCS+= fpu.c fpu_add.c fpu_compare.c fpu_div.c fpu_explode.c fpu_implode.c \ fpu_mul.c fpu_qp.c fpu_reg.S fpu_sqrt.c fpu_subr.c Modified: head/lib/libc/sparc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/sparc64/sys/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/sparc64/sys/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -10,7 +10,7 @@ SRCS+= __sparc_sigtramp_setup.c \ __sparc_utrap_setup.c \ sigcode.S -CFLAGS+= -I${.CURDIR}/sparc64/fpu +CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S sigaction.S Modified: head/lib/libc/stdio/Makefile.inc ============================================================================== --- head/lib/libc/stdio/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/stdio/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -2,7 +2,7 @@ # $FreeBSD$ # stdio sources -.PATH: ${.CURDIR}/stdio +.PATH: ${LIBC_SRCTOP}/stdio SRCS+= _flock_stub.c asprintf.c clrerr.c dprintf.c \ fclose.c fcloseall.c fdopen.c \ @@ -31,7 +31,7 @@ SRCS+= xprintf.c xprintf_float.c xprintf SRCS+= xprintf_errno.c xprintf_hexdump.c xprintf_quote.c SRCS+= xprintf_time.c xprintf_vis.c -SYM_MAPS+= ${.CURDIR}/stdio/Symbol.map +SYM_MAPS+= ${LIBC_SRCTOP}/stdio/Symbol.map MAN+= fclose.3 ferror.3 fflush.3 fgetln.3 fgets.3 fgetwln.3 fgetws.3 \ flockfile.3 \ Modified: head/lib/libc/stdlib/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/stdlib/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -2,7 +2,7 @@ # $FreeBSD$ # machine-independent stdlib sources -.PATH: ${.CURDIR}/${LIBC_ARCH}/stdlib ${.CURDIR}/stdlib +.PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/stdlib ${LIBC_SRCTOP}/stdlib MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \ bsearch.c div.c exit.c getenv.c getopt.c getopt_long.c \ @@ -13,10 +13,10 @@ MISRCS+=_Exit.c a64l.c abort.c abs.c ate strtol.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \ strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c -SYM_MAPS+= ${.CURDIR}/stdlib/Symbol.map +SYM_MAPS+= ${LIBC_SRCTOP}/stdlib/Symbol.map # machine-dependent stdlib sources -.sinclude "${.CURDIR}/${LIBC_ARCH}/stdlib/Makefile.inc" +.sinclude "${LIBC_SRCTOP}/${LIBC_ARCH}/stdlib/Makefile.inc" MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 \ atoi.3 atol.3 at_quick_exit.3 bsearch.3 \ Modified: head/lib/libc/stdlib/jemalloc/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/jemalloc/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/stdlib/jemalloc/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,26 +1,26 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/stdlib/jemalloc +.PATH: ${LIBC_SRCTOP}/stdlib/jemalloc JEMALLOCSRCS:= jemalloc.c arena.c atomic.c base.c bitmap.c chunk.c \ chunk_dss.c chunk_mmap.c ckh.c ctl.c extent.c hash.c huge.c mb.c \ mutex.c prof.c quarantine.c rtree.c stats.c tcache.c tsd.c util.c -SYM_MAPS+=${.CURDIR}/stdlib/jemalloc/Symbol.map +SYM_MAPS+=${LIBC_SRCTOP}/stdlib/jemalloc/Symbol.map -CFLAGS+=-I${.CURDIR}/../../contrib/jemalloc/include +CFLAGS+=-I${LIBC_SRCTOP}/../../contrib/jemalloc/include .for src in ${JEMALLOCSRCS} MISRCS+=jemalloc_${src} CLEANFILES+=jemalloc_${src} jemalloc_${src}: - ln -sf ${.CURDIR}/../../contrib/jemalloc/src/${src} ${.TARGET} + ln -sf ${LIBC_SRCTOP}/../../contrib/jemalloc/src/${src} ${.TARGET} .endfor MAN+=jemalloc.3 CLEANFILES+=jemalloc.3 jemalloc.3: - ln -sf ${.CURDIR}/../../contrib/jemalloc/doc/jemalloc.3 ${.TARGET} + ln -sf ${LIBC_SRCTOP}/../../contrib/jemalloc/doc/jemalloc.3 ${.TARGET} MLINKS+= \ jemalloc.3 malloc.3 \ Modified: head/lib/libc/stdtime/Makefile.inc ============================================================================== --- head/lib/libc/stdtime/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/stdtime/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,15 +1,15 @@ # Makefile.inc,v 1.2 1994/09/13 21:26:01 wollman Exp # $FreeBSD$ -.PATH: ${.CURDIR}/stdtime ${.CURDIR}/../locale \ - ${.CURDIR}/../../contrib/tzcode/stdtime +.PATH: ${LIBC_SRCTOP}/stdtime ${LIBC_SRCTOP}/../locale \ + ${LIBC_SRCTOP}/../../contrib/tzcode/stdtime SRCS+= asctime.c difftime.c localtime.c strftime.c strptime.c timelocal.c \ time32.c -SYM_MAPS+= ${.CURDIR}/stdtime/Symbol.map +SYM_MAPS+= ${LIBC_SRCTOP}/stdtime/Symbol.map -CFLAGS+= -I${.CURDIR}/../../contrib/tzcode/stdtime -I${.CURDIR}/stdtime +CFLAGS+= -I${LIBC_SRCTOP}/../../contrib/tzcode/stdtime -I${LIBC_SRCTOP}/stdtime CFLAGS.localtime.c= -fwrapv CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/lib/libc/string/Makefile.inc ============================================================================== --- head/lib/libc/string/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/string/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,9 +1,9 @@ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -.PATH: ${.CURDIR}/${LIBC_ARCH}/string ${.CURDIR}/string +.PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/string ${LIBC_SRCTOP}/string -CFLAGS+= -I${.CURDIR}/locale +CFLAGS+= -I${LIBC_SRCTOP}/locale # machine-independent string sources MISRCS+=bcmp.c bcopy.c bzero.c ffs.c ffsl.c ffsll.c fls.c flsl.c flsll.c \ @@ -22,11 +22,11 @@ MISRCS+=bcmp.c bcopy.c bzero.c ffs.c ffs wmemcmp.c \ wmemcpy.c wmemmove.c wmemset.c -SYM_MAPS+= ${.CURDIR}/string/Symbol.map +SYM_MAPS+= ${LIBC_SRCTOP}/string/Symbol.map # machine-dependent string sources -.sinclude "${.CURDIR}/${LIBC_ARCH}/string/Makefile.inc" +.sinclude "${LIBC_SRCTOP}/${LIBC_ARCH}/string/Makefile.inc" MAN+= bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \ memcmp.3 memcpy.3 memmem.3 memmove.3 memset.3 strcasecmp.3 strcat.3 \ Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/sys/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -2,18 +2,18 @@ # $FreeBSD$ # sys sources -.PATH: ${.CURDIR}/${LIBC_ARCH}/sys ${.CURDIR}/sys +.PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/sys ${LIBC_SRCTOP}/sys # Include the generated makefile containing the *complete* list # of syscall names in MIASM. -.include "${.CURDIR}/../../sys/sys/syscall.mk" +.include "${LIBC_SRCTOP}/../../sys/sys/syscall.mk" # Include machine dependent definitions. # # MDASM names override the default syscall names in MIASM. # NOASM will prevent the default syscall code from being generated. # -.sinclude "${.CURDIR}/${LIBC_ARCH}/sys/Makefile.inc" +.sinclude "${LIBC_SRCTOP}/${LIBC_ARCH}/sys/Makefile.inc" SRCS+= clock_gettime.c gettimeofday.c __vdso_gettimeofday.c NOASM+= clock_gettime.o gettimeofday.o @@ -55,7 +55,7 @@ SPSEUDO= ${PSEUDO:S/.o/.S/} SRCS+= ${SASM} ${SPSEUDO} -SYM_MAPS+= ${.CURDIR}/sys/Symbol.map +SYM_MAPS+= ${LIBC_SRCTOP}/sys/Symbol.map # Generated files CLEANFILES+= ${SASM} ${SPSEUDO} Modified: head/lib/libc/uuid/Makefile.inc ============================================================================== --- head/lib/libc/uuid/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/uuid/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -2,12 +2,12 @@ # DCE 1.1 UUID implementation sources -.PATH: ${.CURDIR}/uuid +.PATH: ${LIBC_SRCTOP}/uuid SRCS+= uuid_compare.c uuid_create.c uuid_create_nil.c uuid_equal.c \ uuid_from_string.c uuid_hash.c uuid_is_nil.c uuid_stream.c \ uuid_to_string.c -SYM_MAPS+= ${.CURDIR}/uuid/Symbol.map +SYM_MAPS+= ${LIBC_SRCTOP}/uuid/Symbol.map MAN+= uuid.3 MLINKS+=uuid.3 uuid_compare.3 Modified: head/lib/libc/xdr/Makefile.inc ============================================================================== --- head/lib/libc/xdr/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/xdr/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -1,12 +1,12 @@ # @(#)Makefile 5.11 (Berkeley) 9/6/90 # $FreeBSD$ -.PATH: ${.CURDIR}/xdr ${.CURDIR}/. +.PATH: ${LIBC_SRCTOP}/xdr ${LIBC_SRCTOP}/. SRCS+= xdr.c xdr_array.c xdr_float.c xdr_mem.c \ xdr_rec.c xdr_reference.c xdr_sizeof.c \ xdr_stdio.c -SYM_MAPS+= ${.CURDIR}/xdr/Symbol.map +SYM_MAPS+= ${LIBC_SRCTOP}/xdr/Symbol.map MAN+= xdr.3 Modified: head/lib/libc/yp/Makefile.inc ============================================================================== --- head/lib/libc/yp/Makefile.inc Tue Mar 4 01:14:37 2014 (r262721) +++ head/lib/libc/yp/Makefile.inc Tue Mar 4 02:19:39 2014 (r262722) @@ -2,12 +2,12 @@ # $FreeBSD$ # yp sources -.PATH: ${.CURDIR}/yp +.PATH: ${LIBC_SRCTOP}/yp SRCS+= xdryp.c yp.h yp_xdr.c yplib.c CLEANFILES+= yp.h yp_xdr.c -SYM_MAPS+= ${.CURDIR}/yp/Symbol.map +SYM_MAPS+= ${LIBC_SRCTOP}/yp/Symbol.map RPCSRC= ${DESTDIR}/usr/include/rpcsvc/yp.x RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -C From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 03:19:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 948EE87B; Tue, 4 Mar 2014 03:19:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8061E79A; Tue, 4 Mar 2014 03:19:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s243JSvk074569; Tue, 4 Mar 2014 03:19:28 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s243JRg2074562; Tue, 4 Mar 2014 03:19:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403040319.s243JRg2074562@svn.freebsd.org> From: Warner Losh Date: Tue, 4 Mar 2014 03:19:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262725 - in head/sys/boot/fdt/dts: arm mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 03:19:28 -0000 Author: imp Date: Tue Mar 4 03:19:26 2014 New Revision: 262725 URL: http://svnweb.freebsd.org/changeset/base/262725 Log: Fix syntax errors and warnings emitted by the GPL dtc. Modified: head/sys/boot/fdt/dts/arm/imx53-qsb.dts head/sys/boot/fdt/dts/arm/imx53x.dtsi head/sys/boot/fdt/dts/arm/rk3188.dtsi head/sys/boot/fdt/dts/arm/rpi.dts head/sys/boot/fdt/dts/mips/beri-netfpga.dts head/sys/boot/fdt/dts/mips/beri-sim.dts head/sys/boot/fdt/dts/mips/beripad-de4.dts Modified: head/sys/boot/fdt/dts/arm/imx53-qsb.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/imx53-qsb.dts Tue Mar 4 03:14:09 2014 (r262724) +++ head/sys/boot/fdt/dts/arm/imx53-qsb.dts Tue Mar 4 03:19:26 2014 (r262725) @@ -105,7 +105,7 @@ ethernet@63fec000 { status = "okay"; phy-mode = "rmii"; - } + }; i2c@63fc4000 { status = "okay"; }; Modified: head/sys/boot/fdt/dts/arm/imx53x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/imx53x.dtsi Tue Mar 4 03:14:09 2014 (r262724) +++ head/sys/boot/fdt/dts/arm/imx53x.dtsi Tue Mar 4 03:19:26 2014 (r262725) @@ -95,7 +95,7 @@ #address-cells = <1>; #size-cells = <1>; interrupt-parent = <&tzic>; - ranges = <0x50000000 0x14000000>; + ranges = <0x0 0x50000000 0x14000000>; aips@50000000 { /* AIPS1 */ compatible = "fsl,aips-bus", "simple-bus"; Modified: head/sys/boot/fdt/dts/arm/rk3188.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/rk3188.dtsi Tue Mar 4 03:14:09 2014 (r262724) +++ head/sys/boot/fdt/dts/arm/rk3188.dtsi Tue Mar 4 03:19:26 2014 (r262725) @@ -77,7 +77,6 @@ timer@20038000 { compatible = "rockchip,rk30xx-timer"; - compatible = "rockchip,rk3188-dw-apb-timer-osc"; reg = <0x20038000 0x20>; interrupts = <76>; clock-frequency = <24000000>; Modified: head/sys/boot/fdt/dts/arm/rpi.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/rpi.dts Tue Mar 4 03:14:09 2014 (r262724) +++ head/sys/boot/fdt/dts/arm/rpi.dts Tue Mar 4 03:19:26 2014 (r262725) @@ -28,13 +28,13 @@ /include/ "bcm2835.dtsi" -/memreserve/ 0x08000000 0x08000000; /* Set by VideoCore */ - / { model = "Raspberry Pi (BCM2835)"; compatible = "raspberrypi,model-a", "raspberrypi,model-b", "broadcom,bcm2835-vc", "broadcom,bcm2708-vc"; + memreserve = <0x08000000 0x08000000>; /* Set by VideoCore */ + memory { device_type = "memory"; reg = <0 0x8000000>; /* 128MB, Set by VideoCore */ Modified: head/sys/boot/fdt/dts/mips/beri-netfpga.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beri-netfpga.dts Tue Mar 4 03:14:09 2014 (r262724) +++ head/sys/boot/fdt/dts/mips/beri-netfpga.dts Tue Mar 4 03:19:26 2014 (r262725) @@ -66,7 +66,7 @@ device-type = "cpu"; compatible = "sri-cambridge,beri"; - reg = <0>; + reg = <0 1>; status = "okay"; }; @@ -75,7 +75,7 @@ device-type = "cpu"; compatible = "sri-cambridge,beri"; - reg = <1>; + reg = <1 1>; // XXX: should we need cached prefix? cpu-release-addr = <0xffffffff 0x800fffe0>; }; Modified: head/sys/boot/fdt/dts/mips/beri-sim.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beri-sim.dts Tue Mar 4 03:14:09 2014 (r262724) +++ head/sys/boot/fdt/dts/mips/beri-sim.dts Tue Mar 4 03:19:26 2014 (r262725) @@ -64,7 +64,7 @@ device-type = "cpu"; compatible = "sri-cambridge,beri"; - reg = <0>; + reg = <0 1>; status = "okay"; }; @@ -73,7 +73,7 @@ device-type = "cpu"; compatible = "sri-cambridge,beri"; - reg = <1>; + reg = <1 1>; // XXX: should we need cached prefix? cpu-release-addr = <0xffffffff 0x800fffe0>; }; Modified: head/sys/boot/fdt/dts/mips/beripad-de4.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beripad-de4.dts Tue Mar 4 03:14:09 2014 (r262724) +++ head/sys/boot/fdt/dts/mips/beripad-de4.dts Tue Mar 4 03:19:26 2014 (r262725) @@ -64,7 +64,7 @@ device-type = "cpu"; compatible = "sri-cambridge,beri"; - reg = <0>; + reg = <0 1>; status = "okay"; }; @@ -73,7 +73,7 @@ device-type = "cpu"; compatible = "sri-cambridge,beri"; - reg = <1>; + reg = <1 1>; // XXX: should we need cached prefix? cpu-release-addr = <0xffffffff 0x800fffe0>; }; From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 03:19:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBAE59AF; Tue, 4 Mar 2014 03:19:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AD7D079B; Tue, 4 Mar 2014 03:19:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s243Ja2r074631; Tue, 4 Mar 2014 03:19:36 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s243JaNt074630; Tue, 4 Mar 2014 03:19:36 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403040319.s243JaNt074630@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 4 Mar 2014 03:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262726 - head/sys/ia64/ia64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 03:19:36 -0000 Author: marcel Date: Tue Mar 4 03:19:36 2014 New Revision: 262726 URL: http://svnweb.freebsd.org/changeset/base/262726 Log: When reading physical memory, make sure to access it using the right memory attributes. The same applies to the mmap(2) interface. Not doing so results in machine checks. We find the memory attributes in the EFI memory map, as queried by mem_phys2virt(). Modified: head/sys/ia64/ia64/mem.c Modified: head/sys/ia64/ia64/mem.c ============================================================================== --- head/sys/ia64/ia64/mem.c Tue Mar 4 03:19:26 2014 (r262725) +++ head/sys/ia64/ia64/mem.c Tue Mar 4 03:19:36 2014 (r262726) @@ -47,19 +47,11 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include -#include -#include -#include -#include -#include #include #include - -#include -#include +#include #include #include @@ -69,10 +61,25 @@ __FBSDID("$FreeBSD$"); struct mem_range_softc mem_range_softc; -static __inline int -ia64_pa_access(vm_offset_t pa) +static int +mem_phys2virt(vm_offset_t offset, int prot, void **ptr, u_long *limit) { - return (VM_PROT_READ|VM_PROT_WRITE); + struct efi_md *md; + + if (prot & ~(VM_PROT_READ | VM_PROT_WRITE)) + return (EPERM); + + md = efi_md_find(offset); + if (md == NULL) + return (EFAULT); + + if (md->md_type == EFI_MD_TYPE_BAD) + return (EIO); + + *ptr = (void *)((md->md_attr & EFI_MD_ATTR_WB) + ? IA64_PHYS_TO_RR7(offset) : IA64_PHYS_TO_RR6(offset)); + *limit = (md->md_pages * EFI_PAGE_SIZE) - (offset - md->md_phys); + return (0); } /* ARGSUSED */ @@ -80,10 +87,15 @@ int memrw(struct cdev *dev, struct uio *uio, int flags) { struct iovec *iov; - vm_offset_t addr, eaddr, o, v; - int c, error, rw; + off_t ofs; + vm_offset_t addr; + void *ptr; + u_long limit; + int count, error, phys, rw; error = 0; + rw = (uio->uio_rw == UIO_READ) ? VM_PROT_READ : VM_PROT_WRITE; + while (uio->uio_resid > 0 && !error) { iov = uio->uio_iov; if (iov->iov_len == 0) { @@ -94,51 +106,41 @@ memrw(struct cdev *dev, struct uio *uio, continue; } - if (dev2unit(dev) == CDEV_MINOR_MEM) { - v = uio->uio_offset; -kmemphys: - /* Allow reads only in RAM. */ - rw = (uio->uio_rw == UIO_READ) - ? VM_PROT_READ : VM_PROT_WRITE; - if ((ia64_pa_access(v) & rw) != rw) { - error = EFAULT; - c = 0; - break; - } + ofs = uio->uio_offset; - o = uio->uio_offset & PAGE_MASK; - c = min(uio->uio_resid, (int)(PAGE_SIZE - o)); - error = uiomove((caddr_t)IA64_PHYS_TO_RR7(v), c, uio); - continue; + phys = (dev2unit(dev) == CDEV_MINOR_MEM) ? 1 : 0; + if (phys == 0 && ofs >= IA64_RR_BASE(6)) { + ofs = IA64_RR_MASK(ofs); + phys++; } - else if (dev2unit(dev) == CDEV_MINOR_KMEM) { - v = uio->uio_offset; - - if (v >= IA64_RR_BASE(6)) { - v = IA64_RR_MASK(v); - goto kmemphys; - } - c = min(iov->iov_len, MAXPHYS); + if (phys) { + error = mem_phys2virt(ofs, rw, &ptr, &limit); + if (error) + return (error); + + count = min(uio->uio_resid, limit); + error = uiomove(ptr, count, uio); + } else { + ptr = (void *)ofs; + count = iov->iov_len; /* * Make sure that all of the pages are currently * resident so that we don't create any zero-fill * pages. */ - addr = trunc_page(v); - eaddr = round_page(v + c); + limit = round_page(ofs + count); + addr = trunc_page(ofs); if (addr < VM_MAXUSER_ADDRESS) - return (EFAULT); - for (; addr < eaddr; addr += PAGE_SIZE) { + return (EINVAL); + for (; addr < limit; addr += PAGE_SIZE) { if (pmap_kextract(addr) == 0) return (EFAULT); } - if (!kernacc((caddr_t)v, c, (uio->uio_rw == UIO_READ) - ? VM_PROT_READ : VM_PROT_WRITE)) + if (!kernacc(ptr, count, rw)) return (EFAULT); - error = uiomove((caddr_t)v, c, uio); - continue; + error = uiomove(ptr, count, uio); } /* else panic! */ } @@ -153,6 +155,10 @@ int memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int prot, vm_memattr_t *memattr) { + void *ptr; + u_long limit; + int error; + /* * /dev/mem is the only one that makes sense through this * interface. For /dev/kmem any physaddr we return here @@ -160,13 +166,14 @@ memmmap(struct cdev *dev, vm_ooffset_t o * a later time. */ if (dev2unit(dev) != CDEV_MINOR_MEM) - return (-1); + return (ENXIO); - /* - * Allow access only in RAM. - */ - if ((prot & ia64_pa_access(atop((vm_offset_t)offset))) != prot) - return (-1); - *paddr = IA64_PHYS_TO_RR7(offset); + error = mem_phys2virt(offset, prot, &ptr, &limit); + if (error) + return (error); + + *paddr = offset; + *memattr = ((uintptr_t)ptr >= IA64_RR_BASE(7)) ? + VM_MEMATTR_WRITE_BACK : VM_MEMATTR_UNCACHEABLE; return (0); } From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 05:09:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE2AF583; Tue, 4 Mar 2014 05:09:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B5A6EBB; Tue, 4 Mar 2014 05:09:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2459lRQ017312; Tue, 4 Mar 2014 05:09:47 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2459lou017310; Tue, 4 Mar 2014 05:09:47 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201403040509.s2459lou017310@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 4 Mar 2014 05:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262727 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 05:09:47 -0000 Author: gnn Date: Tue Mar 4 05:09:46 2014 New Revision: 262727 URL: http://svnweb.freebsd.org/changeset/base/262727 Log: Naming consistency fix. The routing code defines RADIX_NODE_HEAD_LOCK as grabbing the write lock, but RADIX_NODE_HEAD_LOCK_ASSERT as checking the read lock. Submitted by: Vijay Singh MFC after: 1 month Modified: head/sys/net/radix.h head/sys/net/route.c Modified: head/sys/net/radix.h ============================================================================== --- head/sys/net/radix.h Tue Mar 4 03:19:36 2014 (r262726) +++ head/sys/net/radix.h Tue Mar 4 05:09:46 2014 (r262727) @@ -149,7 +149,8 @@ struct radix_node_head { #define RADIX_NODE_HEAD_DESTROY(rnh) rw_destroy(&(rnh)->rnh_lock) -#define RADIX_NODE_HEAD_LOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_LOCKED) +#define RADIX_NODE_HEAD_LOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_WLOCKED) +#define RADIX_NODE_HEAD_RLOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_RLOCKED) #define RADIX_NODE_HEAD_WLOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_WLOCKED) #endif /* _KERNEL */ Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Tue Mar 4 03:19:36 2014 (r262726) +++ head/sys/net/route.c Tue Mar 4 05:09:46 2014 (r262727) @@ -381,7 +381,7 @@ rtalloc1_fib(struct sockaddr *dst, int r RADIX_NODE_HEAD_RLOCK(rnh); #ifdef INVARIANTS else - RADIX_NODE_HEAD_LOCK_ASSERT(rnh); + RADIX_NODE_HEAD_RLOCK_ASSERT(rnh); #endif rn = rnh->rnh_matchaddr(dst, rnh); if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) { @@ -1000,9 +1000,10 @@ rn_mpath_update(int req, struct rt_addri * a matching RTAX_GATEWAY. */ struct rtentry *rt, *rto = NULL; - register struct radix_node *rn; + struct radix_node *rn; int error = 0; + RADIX_NODE_HEAD_LOCK_ASSERT(rnh); rn = rnh->rnh_lookup(dst, netmask, rnh); if (rn == NULL) return (ESRCH); From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 06:55:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E10EDCA9; Tue, 4 Mar 2014 06:55:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CDC8A957; Tue, 4 Mar 2014 06:55:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s246ts47061234; Tue, 4 Mar 2014 06:55:54 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s246tsAY061233; Tue, 4 Mar 2014 06:55:54 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201403040655.s246tsAY061233@svn.freebsd.org> From: Hiroki Sato Date: Tue, 4 Mar 2014 06:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262728 - head/sys/dev/ffec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 06:55:54 -0000 Author: hrs Date: Tue Mar 4 06:55:54 2014 New Revision: 262728 URL: http://svnweb.freebsd.org/changeset/base/262728 Log: Fix multicast filtering. Submitted by: Takanori Sawada PR: arm/187179 Modified: head/sys/dev/ffec/if_ffec.c Modified: head/sys/dev/ffec/if_ffec.c ============================================================================== --- head/sys/dev/ffec/if_ffec.c Tue Mar 4 05:09:46 2014 (r262727) +++ head/sys/dev/ffec/if_ffec.c Tue Mar 4 06:55:54 2014 (r262728) @@ -961,7 +961,7 @@ ffec_setup_rxfilter(struct ffec_softc *s continue; crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) ifma->ifma_addr), ETHER_ADDR_LEN); - ghash |= 1 << (crc & 0x3f); + ghash |= 1LLU << (crc & 0x3f); } if_maddr_runlock(ifp); } From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 08:01:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AE17B5B; Tue, 4 Mar 2014 08:01:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EBFDBEDD; Tue, 4 Mar 2014 08:01:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2481uTs088744; Tue, 4 Mar 2014 08:01:56 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2481uAc088743; Tue, 4 Mar 2014 08:01:56 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403040801.s2481uAc088743@svn.freebsd.org> From: Adrian Chadd Date: Tue, 4 Mar 2014 08:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262729 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 08:01:57 -0000 Author: adrian Date: Tue Mar 4 08:01:56 2014 New Revision: 262729 URL: http://svnweb.freebsd.org/changeset/base/262729 Log: Handle the newer-style bluetooth message format from the (at least) Centrino 2230 firmware. This fixes the general statistics block to be actually valid. I've verified this by contrasting the output of iwnstats before and after the change. The general block is now correct. Tested: * Intel 5100 (old format stats message) * Intel 2230 (new format stats message) Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Tue Mar 4 06:55:54 2014 (r262728) +++ head/sys/dev/iwn/if_iwn.c Tue Mar 4 08:01:56 2014 (r262729) @@ -685,6 +685,13 @@ iwn_attach(device_t dev) goto fail; } +#if 0 + device_printf(sc->sc_dev, "%s: rx_stats=%d, rx_stats_bt=%d\n", + __func__, + sizeof(struct iwn_stats), + sizeof(struct iwn_stats_bt)); +#endif + if (bootverbose) ieee80211_announce(ic); DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); @@ -3143,11 +3150,62 @@ iwn5000_rx_calib_results(struct iwn_soft static void iwn_stats_update(struct iwn_softc *sc, struct iwn_calib_state *calib, - struct iwn_stats *stats) + struct iwn_stats *stats, int len) { + struct iwn_stats_bt *stats_bt; + struct iwn_stats *lstats; + + /* + * First - check whether the length is the bluetooth or normal. + * + * If it's normal - just copy it and bump out. + * Otherwise we have to convert things. + */ + + if (len == sizeof(struct iwn_stats) + 4) { + memcpy(&sc->last_stat, stats, sizeof(struct iwn_stats)); + sc->last_stat_valid = 1; + return; + } - /* XXX lock assert */ - memcpy(&sc->last_stat, stats, sizeof(struct iwn_stats)); + /* + * If it's not the bluetooth size - log, then just copy. + */ + if (len != sizeof(struct iwn_stats_bt) + 4) { + DPRINTF(sc, IWN_DEBUG_STATS, + "%s: size of rx statistics (%d) not an expected size!\n", + __func__, + len); + memcpy(&sc->last_stat, stats, sizeof(struct iwn_stats)); + sc->last_stat_valid = 1; + return; + } + + /* + * Ok. Time to copy. + */ + stats_bt = (struct iwn_stats_bt *) stats; + lstats = &sc->last_stat; + + /* flags */ + lstats->flags = stats_bt->flags; + /* rx_bt */ + memcpy(&lstats->rx.ofdm, &stats_bt->rx_bt.ofdm, + sizeof(struct iwn_rx_phy_stats)); + memcpy(&lstats->rx.cck, &stats_bt->rx_bt.cck, + sizeof(struct iwn_rx_phy_stats)); + memcpy(&lstats->rx.general, &stats_bt->rx_bt.general_bt.common, + sizeof(struct iwn_rx_general_stats)); + memcpy(&lstats->rx.ht, &stats_bt->rx_bt.ht, + sizeof(struct iwn_rx_ht_phy_stats)); + /* tx */ + memcpy(&lstats->tx, &stats_bt->tx, + sizeof(struct iwn_tx_stats)); + /* general */ + memcpy(&lstats->general, &stats_bt->general, + sizeof(struct iwn_general_stats)); + + /* XXX TODO: Squirrel away the extra bluetooth stats somewhere */ sc->last_stat_valid = 1; } @@ -3165,6 +3223,7 @@ iwn_rx_statistics(struct iwn_softc *sc, struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); struct iwn_calib_state *calib = &sc->calib; struct iwn_stats *stats = (struct iwn_stats *)(desc + 1); + struct iwn_stats *lstats; int temp; DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); @@ -3179,15 +3238,26 @@ iwn_rx_statistics(struct iwn_softc *sc, bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); - DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: received statistics, cmd %d\n", - __func__, desc->type); + DPRINTF(sc, IWN_DEBUG_CALIBRATE | IWN_DEBUG_STATS, + "%s: received statistics, cmd %d, len %d\n", + __func__, desc->type, le16toh(desc->len)); sc->calib_cnt = 0; /* Reset TX power calibration timeout. */ - /* Collect/track general statistics for reporting */ - iwn_stats_update(sc, calib, stats); + /* + * Collect/track general statistics for reporting. + * + * This takes care of ensuring that the bluetooth sized message + * will be correctly converted to the legacy sized message. + */ + iwn_stats_update(sc, calib, stats, le16toh(desc->len)); + + /* + * And now, let's take a reference of it to use! + */ + lstats = &sc->last_stat; /* Test if temperature has changed. */ - if (stats->general.temp != sc->rawtemp) { + if (lstats->general.temp != sc->rawtemp) { /* Convert "raw" temperature to degC. */ sc->rawtemp = stats->general.temp; temp = ops->get_temperature(sc); @@ -3202,25 +3272,25 @@ iwn_rx_statistics(struct iwn_softc *sc, if (desc->type != IWN_BEACON_STATISTICS) return; /* Reply to a statistics request. */ - sc->noise = iwn_get_noise(&stats->rx.general); + sc->noise = iwn_get_noise(&lstats->rx.general); DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: noise %d\n", __func__, sc->noise); /* Test that RSSI and noise are present in stats report. */ - if (le32toh(stats->rx.general.flags) != 1) { + if (le32toh(lstats->rx.general.flags) != 1) { DPRINTF(sc, IWN_DEBUG_ANY, "%s\n", "received statistics without RSSI"); return; } if (calib->state == IWN_CALIB_STATE_ASSOC) - iwn_collect_noise(sc, &stats->rx.general); + iwn_collect_noise(sc, &lstats->rx.general); else if (calib->state == IWN_CALIB_STATE_RUN) { - iwn_tune_sensitivity(sc, &stats->rx); + iwn_tune_sensitivity(sc, &lstats->rx); /* * XXX TODO: Only run the RX recovery if we're associated! */ - iwn_check_rx_recovery(sc, stats); - iwn_save_stats_counters(sc, stats); + iwn_check_rx_recovery(sc, lstats); + iwn_save_stats_counters(sc, lstats); } DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 10:47:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F9F65D3; Tue, 4 Mar 2014 10:47:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D8A6FF0; Tue, 4 Mar 2014 10:47:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s24AlaAs053869; Tue, 4 Mar 2014 10:47:36 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24AlaDn053868; Tue, 4 Mar 2014 10:47:36 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201403041047.s24AlaDn053868@svn.freebsd.org> From: Peter Holm Date: Tue, 4 Mar 2014 10:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262730 - head/tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 10:47:36 -0000 Author: pho Date: Tue Mar 4 10:47:35 2014 New Revision: 262730 URL: http://svnweb.freebsd.org/changeset/base/262730 Log: Changed name of test case to a more descriptive one and moved comment to the "descr" property. Suggested by: jmmv Sponsored by: EMC / Isilon storage division Modified: head/tests/sys/kern/kern_descrip_test.c Modified: head/tests/sys/kern/kern_descrip_test.c ============================================================================== --- head/tests/sys/kern/kern_descrip_test.c Tue Mar 4 08:01:56 2014 (r262729) +++ head/tests/sys/kern/kern_descrip_test.c Tue Mar 4 10:47:35 2014 (r262730) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 EMC Corp. + * Copyright (c) 2014 EMC Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,14 +52,12 @@ ATF_TC_BODY(dup2_simple, tc) ATF_REQUIRE(bcmp(&sb1, &sb2, sizeof(sb1)) == 0); } -/* - Regression test for r234131: - Return EBADF instead of EMFILE from dup2 when the second argument is - outside the range of valid file descriptors - */ - -ATF_TC_WITHOUT_HEAD(dup2_r234131); -ATF_TC_BODY(dup2_r234131, tc) +ATF_TC(dup2__ebadf_when_2nd_arg_out_of_range); +ATF_TC_HEAD(dup2__ebadf_when_2nd_arg_out_of_range, tc) +{ + atf_tc_set_md_var(tc, "descr", "Regression test for r234131"); +} +ATF_TC_BODY(dup2__ebadf_when_2nd_arg_out_of_range, tc) { int fd1, fd2, ret; @@ -74,7 +72,7 @@ ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, dup2_simple); - ATF_TP_ADD_TC(tp, dup2_r234131); + ATF_TP_ADD_TC(tp, dup2__ebadf_when_2nd_arg_out_of_range); return atf_no_error(); } From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 12:33:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77EA6B88; Tue, 4 Mar 2014 12:33:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 62FEDD48; Tue, 4 Mar 2014 12:33:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s24CXJJi098159; Tue, 4 Mar 2014 12:33:19 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24CXJw9098157; Tue, 4 Mar 2014 12:33:19 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403041233.s24CXJw9098157@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 4 Mar 2014 12:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262732 - in head/sys/dev/usb: . quirk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 12:33:19 -0000 Author: hselasky Date: Tue Mar 4 12:33:18 2014 New Revision: 262732 URL: http://svnweb.freebsd.org/changeset/base/262732 Log: Add new quirk. MFC after: 1 week PR: usb/187188 Submitted by: Hiroo Ono Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Tue Mar 4 11:43:01 2014 (r262731) +++ head/sys/dev/usb/quirk/usb_quirk.c Tue Mar 4 12:33:18 2014 (r262732) @@ -93,6 +93,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(TELEX, MIC1, 0x009, 0x009, UQ_AU_NO_FRAC), USB_QUIRK(SILICONPORTALS, YAPPHONE, 0x100, 0x100, UQ_AU_INP_ASYNC), USB_QUIRK(LOGITECH, UN53B, 0x0000, 0xffff, UQ_NO_STRINGS), + USB_QUIRK(REALTEK, RTL8196EU, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(ELSA, MODEM1, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(PLANEX2, MZKUE150N, 0x0000, 0xffff, UQ_CFG_INDEX_1), /* Quirks for printer devices */ Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Mar 4 11:43:01 2014 (r262731) +++ head/sys/dev/usb/usbdevs Tue Mar 4 12:33:18 2014 (r262732) @@ -3688,6 +3688,7 @@ product REALTEK RTL8188CU_1 0x817a RTL81 product REALTEK RTL8188CU_2 0x817b RTL8188CU product REALTEK RTL8187 0x8187 RTL8187 Wireless Adapter product REALTEK RTL8187B_0 0x8189 RTL8187B Wireless Adapter +product REALTEK RTL8196EU 0x8196 RTL8196EU product REALTEK RTL8187B_1 0x8197 RTL8187B Wireless Adapter product REALTEK RTL8187B_2 0x8198 RTL8187B Wireless Adapter product REALTEK RTL8188CUS 0x818a RTL8188CUS From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 14:00:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54B35362; Tue, 4 Mar 2014 14:00:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4152991A; Tue, 4 Mar 2014 14:00:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s24E0oIZ033279; Tue, 4 Mar 2014 14:00:50 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24E0o55033278; Tue, 4 Mar 2014 14:00:50 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201403041400.s24E0o55033278@svn.freebsd.org> From: Mark Johnston Date: Tue, 4 Mar 2014 14:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262733 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 14:00:50 -0000 Author: markj Date: Tue Mar 4 14:00:49 2014 New Revision: 262733 URL: http://svnweb.freebsd.org/changeset/base/262733 Log: Use a full path to the target for make rules which create symlinks @, machine and ${MACHINE_CPUARCH}. Otherwise the presence of a file named "x86" or "x86.c" in the make path can cause problems. Submitted by: lwhsu (original version) MFC after: 1 month Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue Mar 4 12:33:18 2014 (r262732) +++ head/sys/conf/kmod.mk Tue Mar 4 14:00:49 2014 (r262733) @@ -238,7 +238,7 @@ beforedepend: ${_ILINKS} # causes all the modules to be rebuilt when the directory pointed to changes. .for _link in ${_ILINKS} .if !exists(${.OBJDIR}/${_link}) -${OBJS}: ${_link} +${OBJS}: ${.OBJDIR}/${_link} .endif .endfor @@ -252,18 +252,23 @@ SYSDIR= ${_dir} .error "can't find kernel source tree" .endif -${_ILINKS}: - @case ${.TARGET} in \ +.for _link in ${_ILINKS} +.PHONY: ${_link} +${_link}: ${.OBJDIR}/${_link} + +${.OBJDIR}/${_link}: + @case ${.TARGET:T} in \ machine) \ path=${SYSDIR}/${MACHINE}/include ;; \ @) \ path=${SYSDIR} ;; \ *) \ - path=${SYSDIR}/${.TARGET}/include ;; \ + path=${SYSDIR}/${.TARGET:T}/include ;; \ esac ; \ path=`(cd $$path && /bin/pwd)` ; \ - ${ECHO} ${.TARGET} "->" $$path ; \ - ln -sf $$path ${.TARGET} + ${ECHO} ${.TARGET:T} "->" $$path ; \ + ln -sf $$path ${.TARGET:T} +.endfor CLEANFILES+= ${PROG} ${KMOD}.kld ${OBJS} From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 14:19:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4570EDCE; Tue, 4 Mar 2014 14:19:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 329DDB26; Tue, 4 Mar 2014 14:19:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s24EJGJf039243; Tue, 4 Mar 2014 14:19:16 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24EJGg1039242; Tue, 4 Mar 2014 14:19:16 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403041419.s24EJGg1039242@svn.freebsd.org> From: Ian Lepore Date: Tue, 4 Mar 2014 14:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262736 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 14:19:16 -0000 Author: ian Date: Tue Mar 4 14:19:15 2014 New Revision: 262736 URL: http://svnweb.freebsd.org/changeset/base/262736 Log: Use an empty ranges statement for the bus, because all the children on the bus have their register properties declared as full physical addresses, not offsets from a base range for the bus. Modified: head/sys/boot/fdt/dts/arm/imx53x.dtsi Modified: head/sys/boot/fdt/dts/arm/imx53x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/imx53x.dtsi Tue Mar 4 14:05:37 2014 (r262735) +++ head/sys/boot/fdt/dts/arm/imx53x.dtsi Tue Mar 4 14:19:15 2014 (r262736) @@ -95,7 +95,7 @@ #address-cells = <1>; #size-cells = <1>; interrupt-parent = <&tzic>; - ranges = <0x0 0x50000000 0x14000000>; + ranges; aips@50000000 { /* AIPS1 */ compatible = "fsl,aips-bus", "simple-bus"; From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 15:07:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D348ED2; Tue, 4 Mar 2014 15:07:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6A816FE0; Tue, 4 Mar 2014 15:07:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s24F71Y5059218; Tue, 4 Mar 2014 15:07:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24F71E6059216; Tue, 4 Mar 2014 15:07:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201403041507.s24F71E6059216@svn.freebsd.org> From: Alexander Motin Date: Tue, 4 Mar 2014 15:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262741 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 15:07:01 -0000 Author: mav Date: Tue Mar 4 15:07:00 2014 New Revision: 262741 URL: http://svnweb.freebsd.org/changeset/base/262741 Log: Do not retry on CAM_FUNC_NOTAVAIL error, but return immediately. MFC after: 2 weeks Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Tue Mar 4 14:49:05 2014 (r262740) +++ head/sys/cam/cam_periph.c Tue Mar 4 15:07:00 2014 (r262741) @@ -1655,6 +1655,7 @@ cam_periph_error(union ccb *ccb, cam_fla case CAM_REQ_TOO_BIG: case CAM_LUN_INVALID: case CAM_TID_INVALID: + case CAM_FUNC_NOTAVAIL: error = EINVAL; break; case CAM_SCSI_BUS_RESET: From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 15:09:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B4F719D; Tue, 4 Mar 2014 15:09:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5816A69; Tue, 4 Mar 2014 15:09:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s24F9wlK059552; Tue, 4 Mar 2014 15:09:58 GMT (envelope-from dwmalone@svn.freebsd.org) Received: (from dwmalone@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24F9wRh059551; Tue, 4 Mar 2014 15:09:58 GMT (envelope-from dwmalone@svn.freebsd.org) Message-Id: <201403041509.s24F9wRh059551@svn.freebsd.org> From: David Malone Date: Tue, 4 Mar 2014 15:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262742 - head/usr.sbin/lpr/lpr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 15:09:58 -0000 Author: dwmalone Date: Tue Mar 4 15:09:57 2014 New Revision: 262742 URL: http://svnweb.freebsd.org/changeset/base/262742 Log: Add missing description of du (daemon.user) printcap capability. Modified: head/usr.sbin/lpr/lpr/printcap.5 Modified: head/usr.sbin/lpr/lpr/printcap.5 ============================================================================== --- head/usr.sbin/lpr/lpr/printcap.5 Tue Mar 4 15:07:00 2014 (r262741) +++ head/usr.sbin/lpr/lpr/printcap.5 Tue Mar 4 15:09:57 2014 (r262742) @@ -82,6 +82,7 @@ call) .It "df str" Ta Dv NULL Ta No "tex data filter" .Tn ( DVI format) +.It "du num 1 UID to run daemon as" .It "ff str" Ta So Li \ef Sc Ta No "string to send for a form feed" .It "fo bool false print a form feed when device is opened" .It "gf str" Ta Dv NULL Ta No "graph data filter" From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 17:12:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AC4C1B9; Tue, 4 Mar 2014 17:12:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7651EE4D; Tue, 4 Mar 2014 17:12:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s24HC78d012647; Tue, 4 Mar 2014 17:12:07 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24HC6Jd012637; Tue, 4 Mar 2014 17:12:06 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201403041712.s24HC6Jd012637@svn.freebsd.org> From: Tycho Nightingale Date: Tue, 4 Mar 2014 17:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262744 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 17:12:07 -0000 Author: tychon Date: Tue Mar 4 17:12:06 2014 New Revision: 262744 URL: http://svnweb.freebsd.org/changeset/base/262744 Log: Add SMBIOS support. A new option, -U, can be used to set the UUID in the System Information (Type 1) structure. Manpage fix to follow. Approved by: grehan (co-mentor) Added: head/usr.sbin/bhyve/smbiostbl.c (contents, props changed) head/usr.sbin/bhyve/smbiostbl.h (contents, props changed) Modified: head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/acpi.c head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/bhyverun.h Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Tue Mar 4 15:14:47 2014 (r262743) +++ head/usr.sbin/bhyve/Makefile Tue Mar 4 17:12:06 2014 (r262744) @@ -34,6 +34,7 @@ SRCS= \ pmtmr.c \ post.c \ rtc.c \ + smbiostbl.c \ uart_emul.c \ virtio.c \ xmsr.c \ Modified: head/usr.sbin/bhyve/acpi.c ============================================================================== --- head/usr.sbin/bhyve/acpi.c Tue Mar 4 15:14:47 2014 (r262743) +++ head/usr.sbin/bhyve/acpi.c Tue Mar 4 17:12:06 2014 (r262744) @@ -39,14 +39,14 @@ * * Layout * ------ - * RSDP -> 0xf0400 (36 bytes fixed) - * RSDT -> 0xf0440 (36 bytes + 4*N table addrs, 2 used) - * XSDT -> 0xf0480 (36 bytes + 8*N table addrs, 2 used) - * MADT -> 0xf0500 (depends on #CPUs) - * FADT -> 0xf0600 (268 bytes) - * HPET -> 0xf0740 (56 bytes) - * FACS -> 0xf0780 (64 bytes) - * DSDT -> 0xf0800 (variable - can go up to 0x100000) + * RSDP -> 0xf2400 (36 bytes fixed) + * RSDT -> 0xf2440 (36 bytes + 4*N table addrs, 2 used) + * XSDT -> 0xf2480 (36 bytes + 8*N table addrs, 2 used) + * MADT -> 0xf2500 (depends on #CPUs) + * FADT -> 0xf2600 (268 bytes) + * HPET -> 0xf2740 (56 bytes) + * FACS -> 0xf2780 (64 bytes) + * DSDT -> 0xf2800 (variable - can go up to 0x100000) */ #include @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); * Define the base address of the ACPI tables, and the offsets to * the individual tables */ -#define BHYVE_ACPI_BASE 0xf0400 +#define BHYVE_ACPI_BASE 0xf2400 #define RSDT_OFFSET 0x040 #define XSDT_OFFSET 0x080 #define MADT_OFFSET 0x100 Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Tue Mar 4 15:14:47 2014 (r262743) +++ head/usr.sbin/bhyve/bhyverun.c Tue Mar 4 17:12:06 2014 (r262744) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include "mptbl.h" #include "pci_emul.h" #include "pci_lpc.h" +#include "smbiostbl.h" #include "xmsr.h" #include "spinup_ap.h" #include "rtc.h" @@ -82,6 +83,7 @@ typedef int (*vmexit_handler_t)(struct v char *vmname; int guest_ncpus; +char *guest_uuid_str; static int pincpu = -1; static int guest_vmexit_on_hlt, guest_vmexit_on_pause; @@ -141,7 +143,8 @@ usage(int code) " -l: LPC device configuration\n" " -m: memory size in MB\n" " -w: ignore unimplemented MSRs\n" - " -x: local apic is in x2APIC mode\n", + " -x: local apic is in x2APIC mode\n" + " -U: uuid\n", progname, (int)strlen(progname), ""); exit(code); @@ -599,7 +602,7 @@ main(int argc, char *argv[]) guest_ncpus = 1; memsize = 256 * MB; - while ((c = getopt(argc, argv, "abehwxAHIPWp:g:c:s:m:l:")) != -1) { + while ((c = getopt(argc, argv, "abehwxAHIPWp:g:c:s:m:l:U:")) != -1) { switch (c) { case 'a': x2apic_mode = 0; @@ -653,6 +656,9 @@ main(int argc, char *argv[]) case 'e': strictio = 1; break; + case 'U': + guest_uuid_str = optarg; + break; case 'w': strictmsr = 0; break; @@ -723,6 +729,9 @@ main(int argc, char *argv[]) */ mptable_build(ctx, guest_ncpus); + error = smbios_build(ctx); + assert(error == 0); + if (acpi) { error = acpi_build(ctx, guest_ncpus); assert(error == 0); Modified: head/usr.sbin/bhyve/bhyverun.h ============================================================================== --- head/usr.sbin/bhyve/bhyverun.h Tue Mar 4 15:14:47 2014 (r262743) +++ head/usr.sbin/bhyve/bhyverun.h Tue Mar 4 17:12:06 2014 (r262744) @@ -37,6 +37,7 @@ struct vmctx; extern int guest_ncpus; +extern char *guest_uuid_str; extern char *vmname; void *paddr_guest2host(struct vmctx *ctx, uintptr_t addr, size_t len); Added: head/usr.sbin/bhyve/smbiostbl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/smbiostbl.c Tue Mar 4 17:12:06 2014 (r262744) @@ -0,0 +1,832 @@ +/*- + * Copyright (c) 2014 Tycho Nightingale + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "bhyverun.h" +#include "smbiostbl.h" + +#define MB (1024*1024) +#define GB (1024ULL*1024*1024) + +#define SMBIOS_BASE 0xF1000 + +/* BHYVE_ACPI_BASE - SMBIOS_BASE) */ +#define SMBIOS_MAX_LENGTH (0xF2400 - 0xF1000) + +#define SMBIOS_TYPE_BIOS 0 +#define SMBIOS_TYPE_SYSTEM 1 +#define SMBIOS_TYPE_CHASSIS 3 +#define SMBIOS_TYPE_PROCESSOR 4 +#define SMBIOS_TYPE_MEMARRAY 16 +#define SMBIOS_TYPE_MEMDEVICE 17 +#define SMBIOS_TYPE_MEMARRAYMAP 19 +#define SMBIOS_TYPE_BOOT 32 +#define SMBIOS_TYPE_EOT 127 + +struct smbios_structure { + uint8_t type; + uint8_t length; + uint16_t handle; +} __packed; + +typedef int (*initializer_func_t)(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size); + +struct smbios_template_entry { + struct smbios_structure *entry; + const char **strings; + initializer_func_t initializer; +}; + +/* + * SMBIOS Structure Table Entry Point + */ +#define SMBIOS_ENTRY_EANCHOR "_SM_" +#define SMBIOS_ENTRY_EANCHORLEN 4 +#define SMBIOS_ENTRY_IANCHOR "_DMI_" +#define SMBIOS_ENTRY_IANCHORLEN 5 + +struct smbios_entry_point { + char eanchor[4]; /* anchor tag */ + uint8_t echecksum; /* checksum of entry point structure */ + uint8_t eplen; /* length in bytes of entry point */ + uint8_t major; /* major version of the SMBIOS spec */ + uint8_t minor; /* minor version of the SMBIOS spec */ + uint16_t maxssize; /* maximum size in bytes of a struct */ + uint8_t revision; /* entry point structure revision */ + uint8_t format[5]; /* entry point rev-specific data */ + char ianchor[5]; /* intermediate anchor tag */ + uint8_t ichecksum; /* intermediate checksum */ + uint16_t stlen; /* len in bytes of structure table */ + uint32_t staddr; /* physical addr of structure table */ + uint16_t stnum; /* number of structure table entries */ + uint8_t bcdrev; /* BCD value representing DMI ver */ +} __packed; + +/* + * BIOS Information + */ +#define SMBIOS_FL_ISA 0x00000010 /* ISA is supported */ +#define SMBIOS_FL_PCI 0x00000080 /* PCI is supported */ +#define SMBIOS_FL_SHADOW 0x00001000 /* BIOS shadowing is allowed */ +#define SMBIOS_FL_CDBOOT 0x00008000 /* Boot from CD is supported */ +#define SMBIOS_FL_SELBOOT 0x00010000 /* Selectable Boot supported */ +#define SMBIOS_FL_EDD 0x00080000 /* EDD Spec is supported */ + +#define SMBIOS_XB1_FL_ACPI 0x00000001 /* ACPI is supported */ + +#define SMBIOS_XB2_FL_BBS 0x00000001 /* BIOS Boot Specification */ +#define SMBIOS_XB2_FL_VM 0x00000010 /* Virtual Machine */ + +struct smbios_table_type0 { + struct smbios_structure header; + uint8_t vendor; /* vendor string */ + uint8_t version; /* version string */ + uint16_t segment; /* address segment location */ + uint8_t rel_date; /* release date */ + uint8_t size; /* rom size */ + uint64_t cflags; /* characteristics */ + uint8_t xc_bytes[2]; /* characteristics ext bytes */ + uint8_t sb_major_rel; /* system bios version */ + uint8_t sb_minor_rele; + uint8_t ecfw_major_rel; /* embedded ctrl fw version */ + uint8_t ecfw_minor_rel; +} __packed; + +/* + * System Information + */ +#define SMBIOS_WAKEUP_SWITCH 0x06 /* power switch */ + +struct smbios_table_type1 { + struct smbios_structure header; + uint8_t manufacturer; /* manufacturer string */ + uint8_t product; /* product name string */ + uint8_t version; /* version string */ + uint8_t serial; /* serial number string */ + uint8_t uuid[16]; /* uuid byte array */ + uint8_t wakeup; /* wake-up event */ + uint8_t sku; /* sku number string */ + uint8_t family; /* family name string */ +} __packed; + +/* + * System Enclosure or Chassis + */ +#define SMBIOS_CHT_UNKNOWN 0x02 /* unknown */ + +#define SMBIOS_CHST_SAFE 0x03 /* safe */ + +#define SMBIOS_CHSC_NONE 0x03 /* none */ + +struct smbios_table_type3 { + struct smbios_structure header; + uint8_t manufacturer; /* manufacturer string */ + uint8_t type; /* type */ + uint8_t version; /* version string */ + uint8_t serial; /* serial number string */ + uint8_t asset; /* asset tag string */ + uint8_t bustate; /* boot-up state */ + uint8_t psstate; /* power supply state */ + uint8_t tstate; /* thermal state */ + uint8_t security; /* security status */ + uint8_t uheight; /* height in 'u's */ + uint8_t cords; /* number of power cords */ + uint8_t elems; /* number of element records */ + uint8_t elemlen; /* length of records */ + uint8_t sku; /* sku number string */ +} __packed; + +/* + * Processor Information + */ +#define SMBIOS_PRT_CENTRAL 0x03 /* central processor */ + +#define SMBIOS_PRF_OTHER 0x01 /* other */ + +#define SMBIOS_PRS_PRESENT 0x40 /* socket is populated */ +#define SMBIOS_PRS_ENABLED 0x1 /* enabled */ + +#define SMBIOS_PRU_NONE 0x06 /* none */ + +#define SMBIOS_PFL_64B 0x04 /* 64-bit capable */ + +struct smbios_table_type4 { + struct smbios_structure header; + uint8_t socket; /* socket designation string */ + uint8_t type; /* processor type */ + uint8_t family; /* processor family */ + uint8_t manufacturer; /* manufacturer string */ + uint64_t cpuid; /* processor cpuid */ + uint8_t version; /* version string */ + uint8_t voltage; /* voltage */ + uint16_t clkspeed; /* ext clock speed in mhz */ + uint16_t maxspeed; /* maximum speed in mhz */ + uint16_t curspeed; /* current speed in mhz */ + uint8_t status; /* status */ + uint8_t upgrade; /* upgrade */ + uint16_t l1handle; /* l1 cache handle */ + uint16_t l2handle; /* l2 cache handle */ + uint16_t l3handle; /* l3 cache handle */ + uint8_t serial; /* serial number string */ + uint8_t asset; /* asset tag string */ + uint8_t part; /* part number string */ + uint8_t cores; /* cores per socket */ + uint8_t ecores; /* enabled cores */ + uint8_t threads; /* threads per socket */ + uint16_t cflags; /* processor characteristics */ + uint16_t family2; /* processor family 2 */ +} __packed; + +/* + * Physical Memory Array + */ +#define SMBIOS_MAL_SYSMB 0x03 /* system board or motherboard */ + +#define SMBIOS_MAU_SYSTEM 0x03 /* system memory */ + +#define SMBIOS_MAE_NONE 0x03 /* none */ + +struct smbios_table_type16 { + struct smbios_structure header; + uint8_t location; /* physical device location */ + uint8_t use; /* device functional purpose */ + uint8_t ecc; /* err detect/correct method */ + uint32_t size; /* max mem capacity in kb */ + uint16_t errhand; /* handle of error (if any) */ + uint16_t ndevs; /* num of slots or sockets */ + uint64_t xsize; /* max mem capacity in bytes */ +} __packed; + +/* + * Memory Device + */ +#define SMBIOS_MDFF_UNKNOWN 0x02 /* unknown */ + +#define SMBIOS_MDT_UNKNOWN 0x02 /* unknown */ + +#define SMBIOS_MDF_UNKNOWN 0x0004 /* unknown */ + +struct smbios_table_type17 { + struct smbios_structure header; + uint16_t arrayhand; /* handle of physl mem array */ + uint16_t errhand; /* handle of mem error data */ + uint16_t twidth; /* total width in bits */ + uint16_t dwidth; /* data width in bits */ + uint16_t size; /* size in bytes */ + uint8_t form; /* form factor */ + uint8_t set; /* set */ + uint8_t dloc; /* device locator string */ + uint8_t bloc; /* phys bank locator string */ + uint8_t type; /* memory type */ + uint16_t flags; /* memory characteristics */ + uint16_t maxspeed; /* maximum speed in mhz */ + uint8_t manufacturer; /* manufacturer string */ + uint8_t serial; /* serial number string */ + uint8_t asset; /* asset tag string */ + uint8_t part; /* part number string */ + uint8_t attributes; /* attributes */ + uint32_t xsize; /* extended size in mbs */ + uint16_t curspeed; /* current speed in mhz */ + uint16_t minvoltage; /* minimum voltage */ + uint16_t maxvoltage; /* maximum voltage */ + uint16_t curvoltage; /* configured voltage */ +} __packed; + +/* + * Memory Array Mapped Address + */ +struct smbios_table_type19 { + struct smbios_structure header; + uint32_t saddr; /* start phys addr in kb */ + uint32_t eaddr; /* end phys addr in kb */ + uint16_t arrayhand; /* physical mem array handle */ + uint8_t width; /* num of dev in row */ + uint64_t xsaddr; /* start phys addr in bytes */ + uint64_t xeaddr; /* end phys addr in bytes */ +} __packed; + +/* + * System Boot Information + */ +#define SMBIOS_BOOT_NORMAL 0 /* no errors detected */ + +struct smbios_table_type32 { + struct smbios_structure header; + uint8_t reserved[6]; + uint8_t status; /* boot status */ +} __packed; + +/* + * End-of-Table + */ +struct smbios_table_type127 { + struct smbios_structure header; +} __packed; + +struct smbios_table_type0 smbios_type0_template = { + { SMBIOS_TYPE_BIOS, sizeof (struct smbios_table_type0), 0 }, + 1, /* bios vendor string */ + 2, /* bios version string */ + 0xF000, /* bios address segment location */ + 3, /* bios release date */ + 0x0, /* bios size (64k * (n + 1) is the size in bytes) */ + SMBIOS_FL_ISA | SMBIOS_FL_PCI | SMBIOS_FL_SHADOW | + SMBIOS_FL_CDBOOT | SMBIOS_FL_EDD, + { SMBIOS_XB1_FL_ACPI, SMBIOS_XB2_FL_BBS | SMBIOS_XB2_FL_VM }, + 0x0, /* bios major release */ + 0x0, /* bios minor release */ + 0xff, /* embedded controller firmware major release */ + 0xff /* embedded controller firmware minor release */ +}; + +const char *smbios_type0_strings[] = { + "BHYVE", /* vendor string */ + __TIME__, /* bios version string */ + __DATE__, /* bios release date string */ + NULL +}; + +struct smbios_table_type1 smbios_type1_template = { + { SMBIOS_TYPE_SYSTEM, sizeof (struct smbios_table_type1), 0 }, + 1, /* manufacturer string */ + 2, /* product string */ + 3, /* version string */ + 4, /* serial number string */ + { 0 }, + SMBIOS_WAKEUP_SWITCH, + 5, /* sku string */ + 6 /* family string */ +}; + +static int smbios_type1_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size); + +const char *smbios_type1_strings[] = { + " ", /* manufacturer string */ + "BHYVE", /* product name string */ + "1.0", /* version string */ + "None", /* serial number string */ + "None", /* sku string */ + " ", /* family name string */ + NULL +}; + +struct smbios_table_type3 smbios_type3_template = { + { SMBIOS_TYPE_CHASSIS, sizeof (struct smbios_table_type3), 0 }, + 1, /* manufacturer string */ + SMBIOS_CHT_UNKNOWN, + 2, /* version string */ + 3, /* serial number string */ + 4, /* asset tag string */ + SMBIOS_CHST_SAFE, + SMBIOS_CHST_SAFE, + SMBIOS_CHST_SAFE, + SMBIOS_CHSC_NONE, + 0, /* height in 'u's (0=enclosure height unspecified) */ + 0, /* number of power cords (0=number unspecified) */ + 0, /* number of contained element records */ + 0, /* length of records */ + 5 /* sku number string */ +}; + +const char *smbios_type3_strings[] = { + " ", /* manufacturer string */ + "1.0", /* version string */ + "None", /* serial number string */ + "None", /* asset tag string */ + "None", /* sku number string */ + NULL +}; + +struct smbios_table_type4 smbios_type4_template = { + { SMBIOS_TYPE_PROCESSOR, sizeof (struct smbios_table_type4), 0 }, + 1, /* socket designation string */ + SMBIOS_PRT_CENTRAL, + SMBIOS_PRF_OTHER, + 2, /* manufacturer string */ + 0, /* cpuid */ + 3, /* version string */ + 0, /* voltage */ + 0, /* external clock frequency in mhz (0=unknown) */ + 0, /* maximum frequency in mhz (0=unknown) */ + 0, /* current frequency in mhz (0=unknown) */ + SMBIOS_PRS_PRESENT | SMBIOS_PRS_ENABLED, + SMBIOS_PRU_NONE, + -1, /* l1 cache handle */ + -1, /* l2 cache handle */ + -1, /* l3 cache handle */ + 4, /* serial number string */ + 5, /* asset tag string */ + 6, /* part number string */ + 0, /* cores per socket (0=unknown) */ + 0, /* enabled cores per socket (0=unknown) */ + 0, /* threads per socket (0=unknown) */ + SMBIOS_PFL_64B, + SMBIOS_PRF_OTHER +}; + +const char *smbios_type4_strings[] = { + " ", /* socket designation string */ + " ", /* manufacturer string */ + " ", /* version string */ + "None", /* serial number string */ + "None", /* asset tag string */ + "None", /* part number string */ + NULL +}; + +static int smbios_type4_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size); + +struct smbios_table_type16 smbios_type16_template = { + { SMBIOS_TYPE_MEMARRAY, sizeof (struct smbios_table_type16), 0 }, + SMBIOS_MAL_SYSMB, + SMBIOS_MAU_SYSTEM, + SMBIOS_MAE_NONE, + 0x80000000, /* max mem capacity in kb (0x80000000=use extended) */ + -1, /* handle of error (if any) */ + 0, /* number of slots or sockets (TBD) */ + 0 /* extended maximum memory capacity in bytes (TBD) */ +}; + +static int smbios_type16_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size); + +struct smbios_table_type17 smbios_type17_template = { + { SMBIOS_TYPE_MEMDEVICE, sizeof (struct smbios_table_type17), 0 }, + -1, /* handle of physical memory array */ + -1, /* handle of memory error data */ + 64, /* total width in bits including ecc */ + 64, /* data width in bits */ + 0x7fff, /* size in bytes (0x7fff=use extended)*/ + SMBIOS_MDFF_UNKNOWN, + 0, /* set (0x00=none, 0xff=unknown) */ + 1, /* device locator string */ + 2, /* physical bank locator string */ + SMBIOS_MDT_UNKNOWN, + SMBIOS_MDF_UNKNOWN, + 0, /* maximum memory speed in mhz (0=unknown) */ + 3, /* manufacturer string */ + 4, /* serial number string */ + 5, /* asset tag string */ + 6, /* part number string */ + 0, /* attributes (0=unknown rank information) */ + 0, /* extended size in mb (TBD) */ + 0, /* current speed in mhz (0=unknown) */ + 0, /* minimum voltage in mv (0=unknown) */ + 0, /* maximum voltage in mv (0=unknown) */ + 0 /* configured voltage in mv (0=unknown) */ +}; + +const char *smbios_type17_strings[] = { + " ", /* device locator string */ + " ", /* physical bank locator string */ + " ", /* manufacturer string */ + "None", /* serial number string */ + "None", /* asset tag string */ + "None", /* part number string */ + NULL +}; + +static int smbios_type17_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size); + +struct smbios_table_type19 smbios_type19_template = { + { SMBIOS_TYPE_MEMARRAYMAP, sizeof (struct smbios_table_type19), 0 }, + 0xffffffff, /* starting phys addr in kb (0xffffffff=use ext) */ + 0xffffffff, /* ending phys addr in kb (0xffffffff=use ext) */ + -1, /* physical memory array handle */ + 1, /* number of devices that form a row */ + 0, /* extended starting phys addr in bytes (TDB) */ + 0 /* extended ending phys addr in bytes (TDB) */ +}; + +static int smbios_type19_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size); + +struct smbios_table_type32 smbios_type32_template = { + { SMBIOS_TYPE_BOOT, sizeof (struct smbios_table_type32), 0 }, + { 0, 0, 0, 0, 0, 0 }, + SMBIOS_BOOT_NORMAL +}; + +struct smbios_table_type127 smbios_type127_template = { + { SMBIOS_TYPE_EOT, sizeof (struct smbios_table_type127), 0 } +}; + +static int smbios_generic_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size); + +static struct smbios_template_entry smbios_template[] = { + { (struct smbios_structure *)&smbios_type0_template, + smbios_type0_strings, + smbios_generic_initializer }, + { (struct smbios_structure *)&smbios_type1_template, + smbios_type1_strings, + smbios_type1_initializer }, + { (struct smbios_structure *)&smbios_type3_template, + smbios_type3_strings, + smbios_generic_initializer }, + { (struct smbios_structure *)&smbios_type4_template, + smbios_type4_strings, + smbios_type4_initializer }, + { (struct smbios_structure *)&smbios_type16_template, + NULL, + smbios_type16_initializer }, + { (struct smbios_structure *)&smbios_type17_template, + smbios_type17_strings, + smbios_type17_initializer }, + { (struct smbios_structure *)&smbios_type19_template, + NULL, + smbios_type19_initializer }, + { (struct smbios_structure *)&smbios_type32_template, + NULL, + smbios_generic_initializer }, + { (struct smbios_structure *)&smbios_type127_template, + NULL, + smbios_generic_initializer }, + { NULL,NULL, NULL } +}; + +static uint64_t guest_lomem, guest_himem; +static uint16_t type16_handle; + +static int +smbios_generic_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size) +{ + struct smbios_structure *entry; + + memcpy(curaddr, template_entry, template_entry->length); + entry = (struct smbios_structure *)curaddr; + entry->handle = *n + 1; + curaddr += entry->length; + if (template_strings != NULL) { + int i; + + for (i = 0; template_strings[i] != NULL; i++) { + const char *string; + int len; + + string = template_strings[i]; + len = strlen(string) + 1; + memcpy(curaddr, string, len); + curaddr += len; + } + *curaddr = '\0'; + curaddr++; + } else { + /* Minimum string section is double nul */ + *curaddr = '\0'; + curaddr++; + *curaddr = '\0'; + curaddr++; + } + (*n)++; + *endaddr = curaddr; + + return (0); +} + +static int +smbios_type1_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size) +{ + struct smbios_table_type1 *type1; + + smbios_generic_initializer(template_entry, template_strings, + curaddr, endaddr, n, size); + type1 = (struct smbios_table_type1 *)curaddr; + + if (guest_uuid_str != NULL) { + uuid_t uuid; + uint32_t status; + + uuid_from_string(guest_uuid_str, &uuid, &status); + if (status != uuid_s_ok) + return (-1); + + uuid_enc_le(&type1->uuid, &uuid); + } else { + MD5_CTX mdctx; + u_char digest[16]; + char hostname[MAXHOSTNAMELEN]; + + /* + * Universally unique and yet reproducible are an + * oxymoron, however reproducible is desirable in + * this case. + */ + if (gethostname(hostname, sizeof(hostname))) + return (-1); + + MD5Init(&mdctx); + MD5Update(&mdctx, vmname, strlen(vmname)); + MD5Update(&mdctx, hostname, sizeof(hostname)); + MD5Final(digest, &mdctx); + + /* + * Set the variant and version number. + */ + digest[6] &= 0x0F; + digest[6] |= 0x30; /* version 3 */ + digest[8] &= 0x3F; + digest[8] |= 0x80; + + memcpy(&type1->uuid, digest, sizeof (digest)); + } + + return (0); +} + +static int +smbios_type4_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size) +{ + int i; + + for (i = 0; i < guest_ncpus; i++) { + struct smbios_table_type4 *type4; + char *p; + int nstrings, len; + + smbios_generic_initializer(template_entry, template_strings, + curaddr, endaddr, n, size); + type4 = (struct smbios_table_type4 *)curaddr; + p = curaddr + sizeof (struct smbios_table_type4); + nstrings = 0; + while (p < *endaddr - 1) { + if (*p++ == '\0') + nstrings++; + } + len = sprintf(*endaddr - 1, "CPU #%d", i) + 1; + *endaddr += len - 1; + *(*endaddr) = '\0'; + (*endaddr)++; + type4->socket = nstrings + 1; + curaddr = *endaddr; + } + + return (0); +} + +static int +smbios_type16_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size) +{ + struct smbios_table_type16 *type16; + + type16_handle = *n; + smbios_generic_initializer(template_entry, template_strings, + curaddr, endaddr, n, size); + type16 = (struct smbios_table_type16 *)curaddr; + type16->xsize = guest_lomem + guest_himem; + type16->ndevs = guest_himem > 0 ? 2 : 1; + + return (0); +} + +static int +smbios_type17_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size) +{ + struct smbios_table_type17 *type17; + + smbios_generic_initializer(template_entry, template_strings, + curaddr, endaddr, n, size); + type17 = (struct smbios_table_type17 *)curaddr; + type17->arrayhand = type16_handle; + type17->xsize = guest_lomem; + + if (guest_himem > 0) { + curaddr = *endaddr; + smbios_generic_initializer(template_entry, template_strings, + curaddr, endaddr, n, size); + type17 = (struct smbios_table_type17 *)curaddr; + type17->arrayhand = type16_handle; + type17->xsize = guest_himem; + } + + return (0); +} + +static int +smbios_type19_initializer(struct smbios_structure *template_entry, + const char **template_strings, char *curaddr, char **endaddr, + uint16_t *n, uint16_t *size) +{ + struct smbios_table_type19 *type19; + + smbios_generic_initializer(template_entry, template_strings, + curaddr, endaddr, n, size); + type19 = (struct smbios_table_type19 *)curaddr; + type19->arrayhand = type16_handle; + type19->xsaddr = 0; + type19->xeaddr = guest_lomem; + + if (guest_himem > 0) { + curaddr = *endaddr; + smbios_generic_initializer(template_entry, template_strings, + curaddr, endaddr, n, size); + type19 = (struct smbios_table_type19 *)curaddr; + type19->arrayhand = type16_handle; + type19->xsaddr = 4*GB; + type19->xeaddr = guest_himem; + } + + return (0); +} + +static void +smbios_ep_initializer(struct smbios_entry_point *smbios_ep, uint32_t staddr) +{ + memset(smbios_ep, 0, sizeof(*smbios_ep)); + memcpy(smbios_ep->eanchor, SMBIOS_ENTRY_EANCHOR, + SMBIOS_ENTRY_EANCHORLEN); + smbios_ep->eplen = 0x1F; + assert(sizeof (struct smbios_entry_point) == smbios_ep->eplen); + smbios_ep->major = 2; + smbios_ep->minor = 4; + smbios_ep->revision = 0; + memcpy(smbios_ep->ianchor, SMBIOS_ENTRY_IANCHOR, + SMBIOS_ENTRY_IANCHORLEN); + smbios_ep->staddr = staddr; + smbios_ep->bcdrev = 0x24; +} + +static void +smbios_ep_finalizer(struct smbios_entry_point *smbios_ep, uint16_t len, + uint16_t num, uint16_t maxssize) +{ + uint8_t checksum; + int i; + + smbios_ep->maxssize = maxssize; + smbios_ep->stlen = len; + smbios_ep->stnum = num; + + checksum = 0; + for (i = 0x10; i < 0x1f; i++) { + checksum -= ((uint8_t *)smbios_ep)[i]; + } + smbios_ep->ichecksum = checksum; + + checksum = 0; + for (i = 0; i < 0x1f; i++) { + checksum -= ((uint8_t *)smbios_ep)[i]; + } + smbios_ep->echecksum = checksum; +} + +int +smbios_build(struct vmctx *ctx) +{ + struct smbios_entry_point *smbios_ep; + uint16_t n; + uint16_t maxssize; + char *curaddr, *startaddr, *ststartaddr; + int i; + int err; + + err = vm_get_memory_seg(ctx, 0, &guest_lomem, NULL); + if (err != 0) + return (err); + + err = vm_get_memory_seg(ctx, 4*GB, &guest_himem, NULL); + if (err != 0) + return (err); + + startaddr = paddr_guest2host(ctx, SMBIOS_BASE, SMBIOS_MAX_LENGTH); + if (startaddr == NULL) { + fprintf(stderr, "smbios table requires mapped mem\n"); + return (ENOMEM); + } + + curaddr = startaddr; + + smbios_ep = (struct smbios_entry_point *)curaddr; + smbios_ep_initializer(smbios_ep, SMBIOS_BASE + + sizeof(struct smbios_entry_point)); + curaddr += sizeof(struct smbios_entry_point); + ststartaddr = curaddr; + + n = 0; + maxssize = 0; + for (i = 0; smbios_template[i].entry != NULL; i++) { + struct smbios_structure *entry; + const char **strings; + initializer_func_t initializer; + char *endaddr; + uint16_t size; + + entry = smbios_template[i].entry; + strings = smbios_template[i].strings; + initializer = smbios_template[i].initializer; + + err = (*initializer)(entry, strings, curaddr, &endaddr, + &n, &size); + if (err != 0) + return (err); + + if (size > maxssize) + maxssize = size; + + curaddr = endaddr; + } + + assert(curaddr - startaddr < SMBIOS_MAX_LENGTH); + smbios_ep_finalizer(smbios_ep, curaddr - ststartaddr, n, maxssize); + + return (0); +} Added: head/usr.sbin/bhyve/smbiostbl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/smbiostbl.h Tue Mar 4 17:12:06 2014 (r262744) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2014 Tycho Nightingale + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SMBIOSTBL_H_ +#define _SMBIOSTBL_H_ + +struct vmctx; + +int smbios_build(struct vmctx *ctx); + +#endif /* _SMBIOSTBL_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 18:38:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 778A078B; Tue, 4 Mar 2014 18:38:31 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4FC518A6; Tue, 4 Mar 2014 18:38:31 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 21C6DB95B; Tue, 4 Mar 2014 13:38:30 -0500 (EST) From: John Baldwin To: "George V. Neville-Neil" Subject: Re: svn commit: r262727 - head/sys/net Date: Tue, 4 Mar 2014 12:14:44 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201403040509.s2459lou017310@svn.freebsd.org> In-Reply-To: <201403040509.s2459lou017310@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201403041214.44230.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 04 Mar 2014 13:38:30 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 18:38:31 -0000 On Tuesday, March 04, 2014 12:09:47 am George V. Neville-Neil wrote: > Author: gnn > Date: Tue Mar 4 05:09:46 2014 > New Revision: 262727 > URL: http://svnweb.freebsd.org/changeset/base/262727 > > Log: > Naming consistency fix. The routing code defines > RADIX_NODE_HEAD_LOCK as grabbing the write lock, > but RADIX_NODE_HEAD_LOCK_ASSERT as checking the read lock. Actually, that isn't what RA_LOCKED means. RA_LOCKED means that it is either read- or write-locked. Note that you have now made RADIX_NODE_HEAD_LOCK_ASSERT() a redundant copy of RADIX_NODE_HEAD_WLOCK_ASSERT(). You should revert that part in some way (either remove HEAD_LOCK_ASSERT() entirely leaving just RLOCK_ASSERT() and WLOCK_ASSERT(), or restore HEAD_LOCK_ASSERT() to using RA_LOCKED if there are places that want to assert that the lock is held, but don't care if it is read or write). > Submitted by: Vijay Singh > MFC after: 1 month > > Modified: > head/sys/net/radix.h > head/sys/net/route.c > > Modified: head/sys/net/radix.h > ============================================================================== > --- head/sys/net/radix.h Tue Mar 4 03:19:36 2014 (r262726) > +++ head/sys/net/radix.h Tue Mar 4 05:09:46 2014 (r262727) > @@ -149,7 +149,8 @@ struct radix_node_head { > > > #define RADIX_NODE_HEAD_DESTROY(rnh) rw_destroy(&(rnh)->rnh_lock) > -#define RADIX_NODE_HEAD_LOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_LOCKED) > +#define RADIX_NODE_HEAD_LOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_WLOCKED) > +#define RADIX_NODE_HEAD_RLOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_RLOCKED) > #define RADIX_NODE_HEAD_WLOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_WLOCKED) > #endif /* _KERNEL */ > > > Modified: head/sys/net/route.c > ============================================================================== > --- head/sys/net/route.c Tue Mar 4 03:19:36 2014 (r262726) > +++ head/sys/net/route.c Tue Mar 4 05:09:46 2014 (r262727) > @@ -381,7 +381,7 @@ rtalloc1_fib(struct sockaddr *dst, int r > RADIX_NODE_HEAD_RLOCK(rnh); > #ifdef INVARIANTS > else > - RADIX_NODE_HEAD_LOCK_ASSERT(rnh); > + RADIX_NODE_HEAD_RLOCK_ASSERT(rnh); > #endif This was fine before if it is ok for a caller to hold a write lock when calling this function. If that is not allowed, then your change here is correct. > rn = rnh->rnh_matchaddr(dst, rnh); > if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) { > @@ -1000,9 +1000,10 @@ rn_mpath_update(int req, struct rt_addri > * a matching RTAX_GATEWAY. > */ > struct rtentry *rt, *rto = NULL; > - register struct radix_node *rn; > + struct radix_node *rn; > int error = 0; > > + RADIX_NODE_HEAD_LOCK_ASSERT(rnh); If a write lock is required, please use WLOCK_ASSERT() instead. > rn = rnh->rnh_lookup(dst, netmask, rnh); > if (rn == NULL) > return (ESRCH); > -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 19:41:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07BF8E8A; Tue, 4 Mar 2014 19:41:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E9B54EDC; Tue, 4 Mar 2014 19:41:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s24JfGFQ076865; Tue, 4 Mar 2014 19:41:16 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24JfG1O076864; Tue, 4 Mar 2014 19:41:16 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201403041941.s24JfG1O076864@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 4 Mar 2014 19:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262746 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 19:41:17 -0000 Author: jkim Date: Tue Mar 4 19:41:16 2014 New Revision: 262746 URL: http://svnweb.freebsd.org/changeset/base/262746 Log: Remove dead code since r230426, fix a comment, and tidy up. Reported by: jhb MFC after: 3 days Modified: head/sys/amd64/amd64/cpu_switch.S Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Tue Mar 4 18:27:00 2014 (r262745) +++ head/sys/amd64/amd64/cpu_switch.S Tue Mar 4 19:41:16 2014 (r262746) @@ -345,8 +345,8 @@ ENTRY(savectx) movq %r14,PCB_R14(%rdi) movq %r15,PCB_R15(%rdi) - movq %cr0,%rsi - movq %rsi,PCB_CR0(%rdi) + movq %cr0,%rax + movq %rax,PCB_CR0(%rdi) movq %cr2,%rax movq %rax,PCB_CR2(%rdi) movq %cr3,%rax @@ -409,8 +409,6 @@ ENTRY(savectx) sldt PCB_LDT(%rdi) str PCB_TR(%rdi) -2: movq %rsi,%cr0 /* The previous %cr0 is saved in %rsi. */ - movl $1,%eax ret END(savectx) @@ -550,12 +548,12 @@ ENTRY(resumectx) END(resumectx) /* - * Wrapper around fpusave to care about TS0_CR. + * Wrapper around fpusave to care about CR0_TS. */ ENTRY(ctx_fpusave) - movq %cr0,%rsi + movq %cr0,%rax clts call fpusave - movq %rsi,%cr0 + movq %rax,%cr0 ret END(ctx_fpusave) From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 19:49:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 235FD65E; Tue, 4 Mar 2014 19:49:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 106C9F55; Tue, 4 Mar 2014 19:49:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s24JnfXn078471; Tue, 4 Mar 2014 19:49:41 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24JnfLn078470; Tue, 4 Mar 2014 19:49:41 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403041949.s24JnfLn078470@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 4 Mar 2014 19:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262747 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 19:49:42 -0000 Author: glebius Date: Tue Mar 4 19:49:41 2014 New Revision: 262747 URL: http://svnweb.freebsd.org/changeset/base/262747 Log: Remove ifa_ref()/ifa_free(), which are atomic(9), from ip_output(). The ifaddr is already referenced by the rtentry, and we are holding reference on the rtentry throughout the function execution. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Tue Mar 4 19:41:16 2014 (r262746) +++ head/sys/netinet/ip_output.c Tue Mar 4 19:49:41 2014 (r262747) @@ -293,7 +293,6 @@ again: goto bad; } ia = ifatoia(rte->rt_ifa); - ifa_ref(&ia->ia_ifa); ifp = rte->rt_ifp; rte->rt_rmx.rmx_pksent++; if (rte->rt_flags & RTF_GATEWAY) @@ -550,11 +549,8 @@ sendit: #endif error = netisr_queue(NETISR_IP, m); goto done; - } else { - if (ia != NULL) - ifa_free(&ia->ia_ifa); + } else goto again; /* Redo the routing table lookup. */ - } } /* See if local, if yes, send it to netisr with IP_FASTFWD_OURS. */ @@ -583,8 +579,6 @@ sendit: m->m_flags |= M_SKIP_FIREWALL; m->m_flags &= ~M_IP_NEXTHOP; m_tag_delete(m, fwd_tag); - if (ia != NULL) - ifa_free(&ia->ia_ifa); goto again; } @@ -697,8 +691,6 @@ passout: done: if (ro == &iproute) RO_RTFREE(ro); - if (ia != NULL) - ifa_free(&ia->ia_ifa); return (error); bad: m_freem(m); From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 20:07:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3748C33; Tue, 4 Mar 2014 20:07:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D03461FB; Tue, 4 Mar 2014 20:07:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s24K7bjX086617; Tue, 4 Mar 2014 20:07:37 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24K7biB086614; Tue, 4 Mar 2014 20:07:37 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201403042007.s24K7biB086614@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 4 Mar 2014 20:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262748 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 20:07:38 -0000 Author: jkim Date: Tue Mar 4 20:07:36 2014 New Revision: 262748 URL: http://svnweb.freebsd.org/changeset/base/262748 Log: Properly save and restore CR0. MFC after: 3 days Modified: head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/mpboot.S head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Tue Mar 4 19:49:41 2014 (r262747) +++ head/sys/amd64/amd64/cpu_switch.S Tue Mar 4 20:07:36 2014 (r262748) @@ -552,8 +552,10 @@ END(resumectx) */ ENTRY(ctx_fpusave) movq %cr0,%rax + pushq %rax clts call fpusave + popq %rax movq %rax,%cr0 ret END(ctx_fpusave) Modified: head/sys/amd64/amd64/mpboot.S ============================================================================== --- head/sys/amd64/amd64/mpboot.S Tue Mar 4 19:49:41 2014 (r262747) +++ head/sys/amd64/amd64/mpboot.S Tue Mar 4 20:07:36 2014 (r262748) @@ -36,6 +36,7 @@ .p2align 4,0 .globl mptramp_start mptramp_start: +#ifndef __clang__ .code16 /* * The AP enters here in response to the startup IPI. @@ -65,6 +66,43 @@ mptramp_start: /* Enable protected mode */ movl $CR0_PE, %eax mov %eax, %cr0 +#else + /* + * The AP enters here in response to the startup IPI. + * We are in real mode. %cs is the only segment register set. + */ + cli /* make sure no interrupts */ + mov %cs, %eax /* copy %cs to %ds. Remember these */ + mov %eax, %ds /* are offsets rather than selectors */ + mov %eax, %ss + + /* + * Find relocation base and patch the gdt descript and ljmp targets + */ + .byte 0x66 + xorl %ebx, %ebx + mov %cs, %ebx + .byte 0x66 + sall $4, %ebx /* %ebx is now our relocation base */ + .byte 0x66, 0x09, 0x1e + .word lgdt_desc-mptramp_start+2 + .byte 0x66, 0x09, 0x1e + .word jmp_32-mptramp_start+2 + .byte 0x66, 0x09, 0x1e + .word jmp_64-mptramp_start+1 + + /* + * Load the descriptor table pointer. We'll need it when running + * in 16 bit protected mode. + */ + .byte 0x0f, 0x01, 0x16 + .word lgdt_desc-mptramp_start + + /* Enable protected mode */ + .byte 0x66 + movl $CR0_PE, %eax + mov %eax, %cr0 +#endif /* * Now execute a far jump to turn on protected mode. This @@ -88,7 +126,7 @@ jmp_32: .code32 protmode: mov $bootdata-gdt, %eax - mov %ax, %ds + mov %eax, %ds /* Turn on the PAE, PSE and PGE bits for when paging is enabled */ mov %cr4, %eax Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Mar 4 19:49:41 2014 (r262747) +++ head/sys/amd64/amd64/pmap.c Tue Mar 4 20:07:36 2014 (r262748) @@ -146,6 +146,13 @@ __FBSDID("$FreeBSD$"); #endif static __inline boolean_t +pmap_type_guest(pmap_t pmap) +{ + + return ((pmap->pm_type == PT_EPT) || (pmap->pm_type == PT_RVI)); +} + +static __inline boolean_t pmap_emulate_ad_bits(pmap_t pmap) { @@ -159,6 +166,7 @@ pmap_valid_bit(pmap_t pmap) switch (pmap->pm_type) { case PT_X86: + case PT_RVI: mask = X86_PG_V; break; case PT_EPT: @@ -181,6 +189,7 @@ pmap_rw_bit(pmap_t pmap) switch (pmap->pm_type) { case PT_X86: + case PT_RVI: mask = X86_PG_RW; break; case PT_EPT: @@ -205,6 +214,7 @@ pmap_global_bit(pmap_t pmap) case PT_X86: mask = X86_PG_G; break; + case PT_RVI: case PT_EPT: mask = 0; break; @@ -222,6 +232,7 @@ pmap_accessed_bit(pmap_t pmap) switch (pmap->pm_type) { case PT_X86: + case PT_RVI: mask = X86_PG_A; break; case PT_EPT: @@ -244,6 +255,7 @@ pmap_modified_bit(pmap_t pmap) switch (pmap->pm_type) { case PT_X86: + case PT_RVI: mask = X86_PG_M; break; case PT_EPT: @@ -1102,6 +1114,9 @@ pmap_swap_pat(pmap_t pmap, pt_entry_t en if ((entry & x86_pat_bits) != 0) entry ^= x86_pat_bits; break; + case PT_RVI: + /* XXX: PAT support. */ + break; case PT_EPT: /* * Nothing to do - the memory attributes are represented @@ -1145,6 +1160,11 @@ pmap_cache_bits(pmap_t pmap, int mode, b cache_bits |= PG_NC_PWT; break; + case PT_RVI: + /* XXX: PAT support. */ + cache_bits = 0; + break; + case PT_EPT: cache_bits = EPT_PG_IGNORE_PAT | EPT_PG_MEMORY_TYPE(mode); break; @@ -1165,6 +1185,10 @@ pmap_cache_mask(pmap_t pmap, boolean_t i case PT_X86: mask = is_pde ? X86_PG_PDE_CACHE : X86_PG_PTE_CACHE; break; + case PT_RVI: + /* XXX: PAT support. */ + mask = 0; + break; case PT_EPT: mask = EPT_PG_IGNORE_PAT | EPT_PG_MEMORY_TYPE(0x7); break; @@ -1189,6 +1213,7 @@ pmap_update_pde_store(pmap_t pmap, pd_en switch (pmap->pm_type) { case PT_X86: break; + case PT_RVI: case PT_EPT: /* * XXX @@ -1224,7 +1249,7 @@ pmap_update_pde_invalidate(pmap_t pmap, { pt_entry_t PG_G; - if (pmap->pm_type == PT_EPT) + if (pmap_type_guest(pmap)) return; KASSERT(pmap->pm_type == PT_X86, @@ -1338,7 +1363,7 @@ pmap_invalidate_page(pmap_t pmap, vm_off cpuset_t other_cpus; u_int cpuid; - if (pmap->pm_type == PT_EPT) { + if (pmap_type_guest(pmap)) { pmap_invalidate_ept(pmap); return; } @@ -1416,7 +1441,7 @@ pmap_invalidate_range(pmap_t pmap, vm_of vm_offset_t addr; u_int cpuid; - if (pmap->pm_type == PT_EPT) { + if (pmap_type_guest(pmap)) { pmap_invalidate_ept(pmap); return; } @@ -1475,7 +1500,7 @@ pmap_invalidate_all(pmap_t pmap) uint64_t cr3; u_int cpuid; - if (pmap->pm_type == PT_EPT) { + if (pmap_type_guest(pmap)) { pmap_invalidate_ept(pmap); return; } @@ -1595,7 +1620,7 @@ pmap_update_pde(pmap_t pmap, vm_offset_t cpuid = PCPU_GET(cpuid); other_cpus = all_cpus; CPU_CLR(cpuid, &other_cpus); - if (pmap == kernel_pmap || pmap->pm_type == PT_EPT) + if (pmap == kernel_pmap || pmap_type_guest(pmap)) active = all_cpus; else { active = pmap->pm_active; @@ -1633,6 +1658,7 @@ pmap_invalidate_page(pmap_t pmap, vm_off if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active)) invlpg(va); break; + case PT_RVI: case PT_EPT: pmap->pm_eptgen++; break; @@ -1652,6 +1678,7 @@ pmap_invalidate_range(pmap_t pmap, vm_of for (addr = sva; addr < eva; addr += PAGE_SIZE) invlpg(addr); break; + case PT_RVI: case PT_EPT: pmap->pm_eptgen++; break; @@ -1669,6 +1696,7 @@ pmap_invalidate_all(pmap_t pmap) if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active)) invltlb(); break; + case PT_RVI: case PT_EPT: pmap->pm_eptgen++; break; From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 20:09:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C24B8DB0; Tue, 4 Mar 2014 20:09:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AFB8821D; Tue, 4 Mar 2014 20:09:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s24K9Ngo086853; Tue, 4 Mar 2014 20:09:23 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24K9NQO086852; Tue, 4 Mar 2014 20:09:23 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201403042009.s24K9NQO086852@svn.freebsd.org> From: "Simon J. Gerraty" Date: Tue, 4 Mar 2014 20:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262749 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 20:09:23 -0000 Author: sjg Date: Tue Mar 4 20:09:23 2014 New Revision: 262749 URL: http://svnweb.freebsd.org/changeset/base/262749 Log: Allow comments at end of line. Reviewed by: marcel Modified: head/usr.sbin/makefs/mtree.c Modified: head/usr.sbin/makefs/mtree.c ============================================================================== --- head/usr.sbin/makefs/mtree.c Tue Mar 4 20:07:36 2014 (r262748) +++ head/usr.sbin/makefs/mtree.c Tue Mar 4 20:09:23 2014 (r262749) @@ -348,6 +348,13 @@ read_word(FILE *fp, char *buf, size_t bu if (error == -1) mtree_error("unexpected end of file"); return (error); + case '#': /* comment -- skip to end of line. */ + if (!esc) { + error = skip_to(fp, "\n"); + if (!error) + continue; + } + break; case '\\': esc++; if (esc == 1) From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 20:16:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E1421EE; Tue, 4 Mar 2014 20:16:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2ED3D31F; Tue, 4 Mar 2014 20:16:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s24KG1OF090762; Tue, 4 Mar 2014 20:16:01 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24KG02J090756; Tue, 4 Mar 2014 20:16:00 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201403042016.s24KG02J090756@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 4 Mar 2014 20:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262750 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 20:16:01 -0000 Author: jkim Date: Tue Mar 4 20:16:00 2014 New Revision: 262750 URL: http://svnweb.freebsd.org/changeset/base/262750 Log: Revert accidentally committed changes in 262748. Modified: head/sys/amd64/amd64/mpboot.S head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/mpboot.S ============================================================================== --- head/sys/amd64/amd64/mpboot.S Tue Mar 4 20:09:23 2014 (r262749) +++ head/sys/amd64/amd64/mpboot.S Tue Mar 4 20:16:00 2014 (r262750) @@ -36,7 +36,6 @@ .p2align 4,0 .globl mptramp_start mptramp_start: -#ifndef __clang__ .code16 /* * The AP enters here in response to the startup IPI. @@ -66,43 +65,6 @@ mptramp_start: /* Enable protected mode */ movl $CR0_PE, %eax mov %eax, %cr0 -#else - /* - * The AP enters here in response to the startup IPI. - * We are in real mode. %cs is the only segment register set. - */ - cli /* make sure no interrupts */ - mov %cs, %eax /* copy %cs to %ds. Remember these */ - mov %eax, %ds /* are offsets rather than selectors */ - mov %eax, %ss - - /* - * Find relocation base and patch the gdt descript and ljmp targets - */ - .byte 0x66 - xorl %ebx, %ebx - mov %cs, %ebx - .byte 0x66 - sall $4, %ebx /* %ebx is now our relocation base */ - .byte 0x66, 0x09, 0x1e - .word lgdt_desc-mptramp_start+2 - .byte 0x66, 0x09, 0x1e - .word jmp_32-mptramp_start+2 - .byte 0x66, 0x09, 0x1e - .word jmp_64-mptramp_start+1 - - /* - * Load the descriptor table pointer. We'll need it when running - * in 16 bit protected mode. - */ - .byte 0x0f, 0x01, 0x16 - .word lgdt_desc-mptramp_start - - /* Enable protected mode */ - .byte 0x66 - movl $CR0_PE, %eax - mov %eax, %cr0 -#endif /* * Now execute a far jump to turn on protected mode. This @@ -126,7 +88,7 @@ jmp_32: .code32 protmode: mov $bootdata-gdt, %eax - mov %eax, %ds + mov %ax, %ds /* Turn on the PAE, PSE and PGE bits for when paging is enabled */ mov %cr4, %eax Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Mar 4 20:09:23 2014 (r262749) +++ head/sys/amd64/amd64/pmap.c Tue Mar 4 20:16:00 2014 (r262750) @@ -146,13 +146,6 @@ __FBSDID("$FreeBSD$"); #endif static __inline boolean_t -pmap_type_guest(pmap_t pmap) -{ - - return ((pmap->pm_type == PT_EPT) || (pmap->pm_type == PT_RVI)); -} - -static __inline boolean_t pmap_emulate_ad_bits(pmap_t pmap) { @@ -166,7 +159,6 @@ pmap_valid_bit(pmap_t pmap) switch (pmap->pm_type) { case PT_X86: - case PT_RVI: mask = X86_PG_V; break; case PT_EPT: @@ -189,7 +181,6 @@ pmap_rw_bit(pmap_t pmap) switch (pmap->pm_type) { case PT_X86: - case PT_RVI: mask = X86_PG_RW; break; case PT_EPT: @@ -214,7 +205,6 @@ pmap_global_bit(pmap_t pmap) case PT_X86: mask = X86_PG_G; break; - case PT_RVI: case PT_EPT: mask = 0; break; @@ -232,7 +222,6 @@ pmap_accessed_bit(pmap_t pmap) switch (pmap->pm_type) { case PT_X86: - case PT_RVI: mask = X86_PG_A; break; case PT_EPT: @@ -255,7 +244,6 @@ pmap_modified_bit(pmap_t pmap) switch (pmap->pm_type) { case PT_X86: - case PT_RVI: mask = X86_PG_M; break; case PT_EPT: @@ -1114,9 +1102,6 @@ pmap_swap_pat(pmap_t pmap, pt_entry_t en if ((entry & x86_pat_bits) != 0) entry ^= x86_pat_bits; break; - case PT_RVI: - /* XXX: PAT support. */ - break; case PT_EPT: /* * Nothing to do - the memory attributes are represented @@ -1160,11 +1145,6 @@ pmap_cache_bits(pmap_t pmap, int mode, b cache_bits |= PG_NC_PWT; break; - case PT_RVI: - /* XXX: PAT support. */ - cache_bits = 0; - break; - case PT_EPT: cache_bits = EPT_PG_IGNORE_PAT | EPT_PG_MEMORY_TYPE(mode); break; @@ -1185,10 +1165,6 @@ pmap_cache_mask(pmap_t pmap, boolean_t i case PT_X86: mask = is_pde ? X86_PG_PDE_CACHE : X86_PG_PTE_CACHE; break; - case PT_RVI: - /* XXX: PAT support. */ - mask = 0; - break; case PT_EPT: mask = EPT_PG_IGNORE_PAT | EPT_PG_MEMORY_TYPE(0x7); break; @@ -1213,7 +1189,6 @@ pmap_update_pde_store(pmap_t pmap, pd_en switch (pmap->pm_type) { case PT_X86: break; - case PT_RVI: case PT_EPT: /* * XXX @@ -1249,7 +1224,7 @@ pmap_update_pde_invalidate(pmap_t pmap, { pt_entry_t PG_G; - if (pmap_type_guest(pmap)) + if (pmap->pm_type == PT_EPT) return; KASSERT(pmap->pm_type == PT_X86, @@ -1363,7 +1338,7 @@ pmap_invalidate_page(pmap_t pmap, vm_off cpuset_t other_cpus; u_int cpuid; - if (pmap_type_guest(pmap)) { + if (pmap->pm_type == PT_EPT) { pmap_invalidate_ept(pmap); return; } @@ -1441,7 +1416,7 @@ pmap_invalidate_range(pmap_t pmap, vm_of vm_offset_t addr; u_int cpuid; - if (pmap_type_guest(pmap)) { + if (pmap->pm_type == PT_EPT) { pmap_invalidate_ept(pmap); return; } @@ -1500,7 +1475,7 @@ pmap_invalidate_all(pmap_t pmap) uint64_t cr3; u_int cpuid; - if (pmap_type_guest(pmap)) { + if (pmap->pm_type == PT_EPT) { pmap_invalidate_ept(pmap); return; } @@ -1620,7 +1595,7 @@ pmap_update_pde(pmap_t pmap, vm_offset_t cpuid = PCPU_GET(cpuid); other_cpus = all_cpus; CPU_CLR(cpuid, &other_cpus); - if (pmap == kernel_pmap || pmap_type_guest(pmap)) + if (pmap == kernel_pmap || pmap->pm_type == PT_EPT) active = all_cpus; else { active = pmap->pm_active; @@ -1658,7 +1633,6 @@ pmap_invalidate_page(pmap_t pmap, vm_off if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active)) invlpg(va); break; - case PT_RVI: case PT_EPT: pmap->pm_eptgen++; break; @@ -1678,7 +1652,6 @@ pmap_invalidate_range(pmap_t pmap, vm_of for (addr = sva; addr < eva; addr += PAGE_SIZE) invlpg(addr); break; - case PT_RVI: case PT_EPT: pmap->pm_eptgen++; break; @@ -1696,7 +1669,6 @@ pmap_invalidate_all(pmap_t pmap) if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active)) invltlb(); break; - case PT_RVI: case PT_EPT: pmap->pm_eptgen++; break; From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 21:35:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D04563B5; Tue, 4 Mar 2014 21:35:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BBAF9E05; Tue, 4 Mar 2014 21:35:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s24LZwD5023998; Tue, 4 Mar 2014 21:35:58 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24LZvoW023992; Tue, 4 Mar 2014 21:35:57 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201403042135.s24LZvoW023992@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 4 Mar 2014 21:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262752 - in head/sys: amd64/amd64 amd64/include x86/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 21:35:59 -0000 Author: jkim Date: Tue Mar 4 21:35:57 2014 New Revision: 262752 URL: http://svnweb.freebsd.org/changeset/base/262752 Log: Move fpusave() wrapper for suspend hander to sys/amd64/amd64/fpu.c. Inspired by: jhb Modified: head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/fpu.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/include/fpu.h head/sys/amd64/include/md_var.h head/sys/x86/acpica/acpi_wakeup.c Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Tue Mar 4 20:21:43 2014 (r262751) +++ head/sys/amd64/amd64/cpu_switch.S Tue Mar 4 21:35:57 2014 (r262752) @@ -546,16 +546,3 @@ ENTRY(resumectx) xorl %eax,%eax ret END(resumectx) - -/* - * Wrapper around fpusave to care about CR0_TS. - */ -ENTRY(ctx_fpusave) - movq %cr0,%rax - pushq %rax - clts - call fpusave - popq %rax - movq %rax,%cr0 - ret -END(ctx_fpusave) Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Tue Mar 4 20:21:43 2014 (r262751) +++ head/sys/amd64/amd64/fpu.c Tue Mar 4 21:35:57 2014 (r262752) @@ -162,6 +162,17 @@ fpurestore(void *addr) fxrstor((char *)addr); } +void +fpususpend(void *addr) +{ + u_long cr0; + + cr0 = rcr0(); + stop_emulating(); + fpusave(addr); + load_cr0(cr0); +} + /* * Enable XSAVE if supported and allowed by user. * Calculate the xsave_mask. Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Tue Mar 4 20:21:43 2014 (r262751) +++ head/sys/amd64/amd64/mp_machdep.c Tue Mar 4 21:35:57 2014 (r262752) @@ -1464,7 +1464,7 @@ cpususpend_handler(void) cpu = PCPU_GET(cpuid); if (savectx(susppcbs[cpu])) { - ctx_fpusave(susppcbs[cpu]->pcb_fpususpend); + fpususpend(susppcbs[cpu]->pcb_fpususpend); wbinvd(); CPU_SET_ATOMIC(cpu, &suspended_cpus); } else { Modified: head/sys/amd64/include/fpu.h ============================================================================== --- head/sys/amd64/include/fpu.h Tue Mar 4 20:21:43 2014 (r262751) +++ head/sys/amd64/include/fpu.h Tue Mar 4 21:35:57 2014 (r262752) @@ -63,6 +63,7 @@ int fpusetregs(struct thread *td, struct char *xfpustate, size_t xfpustate_size); int fpusetxstate(struct thread *td, char *xfpustate, size_t xfpustate_size); +void fpususpend(void *addr); int fputrap_sse(void); int fputrap_x87(void); void fpuuserinited(struct thread *td); Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Tue Mar 4 20:21:43 2014 (r262751) +++ head/sys/amd64/include/md_var.h Tue Mar 4 21:35:57 2014 (r262752) @@ -89,7 +89,6 @@ void *alloc_fpusave(int flags); void amd64_syscall(struct thread *td, int traced); void busdma_swi(void); void cpu_setregs(void); -void ctx_fpusave(void *); void doreti_iret(void) __asm(__STRING(doreti_iret)); void doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault)); void ld_ds(void) __asm(__STRING(ld_ds)); Modified: head/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- head/sys/x86/acpica/acpi_wakeup.c Tue Mar 4 20:21:43 2014 (r262751) +++ head/sys/x86/acpica/acpi_wakeup.c Tue Mar 4 21:35:57 2014 (r262752) @@ -202,7 +202,7 @@ acpi_sleep_machdep(struct acpi_softc *sc if (savectx(susppcbs[0])) { #ifdef __amd64__ - ctx_fpusave(susppcbs[0]->pcb_fpususpend); + fpususpend(susppcbs[0]->pcb_fpususpend); #endif #ifdef SMP if (!CPU_EMPTY(&suspcpus) && suspend_cpus(suspcpus) == 0) { From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 21:44:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 169E45F8; Tue, 4 Mar 2014 21:44:56 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E105AEF4; Tue, 4 Mar 2014 21:44:55 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CF1D2B95B; Tue, 4 Mar 2014 16:44:54 -0500 (EST) From: John Baldwin To: "Jung-uk Kim" Subject: Re: svn commit: r262752 - in head/sys: amd64/amd64 amd64/include x86/acpica Date: Tue, 4 Mar 2014 16:44:43 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201403042135.s24LZvoW023992@svn.freebsd.org> In-Reply-To: <201403042135.s24LZvoW023992@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201403041644.43270.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 04 Mar 2014 16:44:54 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 21:44:56 -0000 On Tuesday, March 04, 2014 4:35:57 pm Jung-uk Kim wrote: > Author: jkim > Date: Tue Mar 4 21:35:57 2014 > New Revision: 262752 > URL: http://svnweb.freebsd.org/changeset/base/262752 > > Log: > Move fpusave() wrapper for suspend hander to sys/amd64/amd64/fpu.c. > > Inspired by: jhb Heh. I had just replied to your first commit to note that %rax wasn't call- safe and to suggest this very thing. Thanks! -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 21:51:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2D87926; Tue, 4 Mar 2014 21:51:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D865F4B; Tue, 4 Mar 2014 21:51:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s24LpF2A029461; Tue, 4 Mar 2014 21:51:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24LpCN4029435; Tue, 4 Mar 2014 21:51:12 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403042151.s24LpCN4029435@svn.freebsd.org> From: Xin LI Date: Tue, 4 Mar 2014 21:51:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262754 - in head/contrib/xz: . src/liblzma/api/lzma src/liblzma/check src/liblzma/common src/lzmainfo src/xz src/xzdec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 21:51:15 -0000 Author: delphij Date: Tue Mar 4 21:51:11 2014 New Revision: 262754 URL: http://svnweb.freebsd.org/changeset/base/262754 Log: MFV r253848 (mm): Update vendor/xz from v5.0 branch to post-5.0.5 MFC after: 2 weeks Modified: head/contrib/xz/ChangeLog head/contrib/xz/README head/contrib/xz/THANKS head/contrib/xz/src/liblzma/api/lzma/version.h head/contrib/xz/src/liblzma/check/sha256.c head/contrib/xz/src/liblzma/common/alone_decoder.c head/contrib/xz/src/liblzma/common/alone_decoder.h head/contrib/xz/src/liblzma/common/auto_decoder.c head/contrib/xz/src/lzmainfo/lzmainfo.1 head/contrib/xz/src/xz/coder.c head/contrib/xz/src/xz/coder.h head/contrib/xz/src/xz/file_io.c head/contrib/xz/src/xz/list.c head/contrib/xz/src/xz/util.c head/contrib/xz/src/xz/xz.1 head/contrib/xz/src/xzdec/xzdec.1 head/contrib/xz/src/xzdec/xzdec.c Directory Properties: head/contrib/xz/ (props changed) Modified: head/contrib/xz/ChangeLog ============================================================================== --- head/contrib/xz/ChangeLog Tue Mar 4 21:51:09 2014 (r262753) +++ head/contrib/xz/ChangeLog Tue Mar 4 21:51:11 2014 (r262754) @@ -1,3 +1,348 @@ +commit b69900ed0b2f914fc6c0a180dcb522dbe5b80ea7 +Author: Lasse Collin +Date: Sun Jun 30 18:02:27 2013 +0300 + + Man pages: Use similar syntax for synopsis as in xz. + + The man pages of lzmainfo, xzmore, and xzdec had similar + constructs as the man page of xz had before the commit + eb6ca9854b8eb9fbf72497c1cf608d6b19d2d494. Eric S. Raymond + didn't mention these man pages in his bug report, but + it's nice to be consistent. + +commit cf4a1e1879d89be314ef3c064bd2656ea452f87e +Author: Lasse Collin +Date: Sun Jun 30 15:55:09 2013 +0300 + + Update NEWS for 5.0.5. + +commit cb94bb6d1f34e1e93c2d634ea9c3b7dfb3981d05 +Author: Lasse Collin +Date: Sun Jun 30 15:54:38 2013 +0300 + + Bump version and soname for 5.0.5. + +commit b7dee202d5b041ccae028d0c5433b83cecbe9e5d +Author: Lasse Collin +Date: Fri Jun 28 23:56:17 2013 +0300 + + xz: Fix return value type in io_write_buf(). + + It didn't affect the behavior of the code since -1 + becomes true anyway. + +commit 265e7b44d804b47373f10b7da28350db7611cea6 +Author: Lasse Collin +Date: Fri Jun 28 18:46:13 2013 +0300 + + xz: Remove an outdated NetBSD-specific comment. + + Nowadays errno == EFTYPE is documented in open(2). + +commit 78c2f8db902195468b8249c432252a6b281db836 +Author: Lasse Collin +Date: Fri Jun 28 18:09:47 2013 +0300 + + xz: Fix error detection of fcntl(fd, F_SETFL, flags) calls. + + POSIX says that fcntl(fd, F_SETFL, flags) returns -1 on + error and "other than -1" on success. This is how it is + documented e.g. on OpenBSD too. On Linux, success with + F_SETFL is always 0 (at least accorinding to fcntl(2) + from man-pages 3.51). + +commit 91750dff8f2c654ff636f12a2acdffe5492374b3 +Author: Lasse Collin +Date: Fri Jun 28 17:36:47 2013 +0300 + + xz: Fix use of wrong variable in a fcntl() call. + + Due to a wrong variable name, when writing a sparse file + to standard output, *all* file status flags were cleared + (to the extent the operating system allowed it) instead of + only clearing the O_APPEND flag. In practice this worked + fine in the common situations on GNU/Linux, but I didn't + check how it behaved elsewhere. + + The original flags were still restored correctly. I still + changed the code to use a separate boolean variable to + indicate when the flags should be restored instead of + relying on a special value in stdout_flags. + +commit e11888a79a4a77a69afde60445880d44f63d01aa +Author: Lasse Collin +Date: Wed Jun 26 13:30:57 2013 +0300 + + xz: Check the value of lzma_stream_flags.version in --list. + + It is a no-op for now, but if an old xz version is used + together with a newer liblzma that supports something new, + then this check becomes important and will stop the old xz + from trying to parse files that it won't understand. + +commit f39ddd88f3222219ada88998cf30abfdd3e0e96c +Author: Lasse Collin +Date: Wed Jun 26 12:17:00 2013 +0300 + + Build: Require Automake 1.12 and use serial-tests option. + + It should actually still work with Automake 1.10 if + the serial-tests option is removed. Automake 1.13 started + using parallel tests by default and the option to get + the old behavior isn't supported before 1.12. + + At least for now, parallel tests don't improve anything + in XZ Utils but they hide the progress output from + test_compress.sh. + +commit cb84e278027a90e9827a6f4d3bb0b4d4744a2fbb +Author: Lasse Collin +Date: Sun Jun 23 17:36:47 2013 +0300 + + xz: Validate Uncompressed Size from Block Header in list.c. + + This affects only "xz -lvv". Normal decompression with xz + already detected if Block Header and Index had mismatched + Uncompressed Size fields. So this just makes "xz -lvv" + show such files as corrupt instead of showing the + Uncompressed Size from Index. + +commit f01780fce454c7489f7dcbf806299b50da5f51b7 +Author: Lasse Collin +Date: Wed Jun 26 10:58:58 2013 +0300 + + Update THANKS. + +commit d98ede7d700b892e32d9c2f46563b6ebc566786d +Author: Lasse Collin +Date: Fri Jun 21 22:04:45 2013 +0300 + + xz: Make the man page more friendly to doclifter. + + Thanks to Eric S. Raymond. + +commit 19b447b64b3f520cd5b11429000b092f7c76709b +Author: Lasse Collin +Date: Fri Jun 21 21:54:59 2013 +0300 + + xz: A couple of man page fixes. + + Now the interaction of presets and custom filter chains + is described correctly. Earlier it contradicted itself. + + Thanks to DevHC who reported these issues on IRC to me + on 2012-12-14. + +commit 45edf2966fc9a4d2eae8f84b2fa027fb4fa1df8b +Author: Lasse Collin +Date: Fri Jun 21 21:50:26 2013 +0300 + + xz: Fix interaction between preset and custom filter chains. + + There was somewhat illogical behavior when --extreme was + specified and mixed with custom filter chains. + + Before this commit, "xz -9 --lzma2 -e" was equivalent + to "xz --lzma2". After it is equivalent to "xz -6e" + (all earlier preset options get forgotten when a custom + filter chain is specified and the default preset is 6 + to which -e is applied). I find this less illogical. + + This also affects the meaning of "xz -9e --lzma2 -7". + Earlier it was equivalent to "xz -7e" (the -e specified + before a custom filter chain wasn't forgotten). Now it + is "xz -7". Note that "xz -7e" still is the same as "xz -e7". + + Hopefully very few cared about this in the first place, + so pretty much no one should even notice this change. + + Thanks to Conley Moorhous. + +commit b065984e5a9272eb50bc0c6d3731e6199c0ae8a8 +Author: Lasse Collin +Date: Fri Apr 8 17:53:05 2011 +0300 + + xz: Change size_t to uint32_t in a few places. + +commit 32be621f52f2e1686db88baa7b01dc1ae338f426 +Author: Lasse Collin +Date: Sat Apr 27 22:07:46 2013 +0300 + + Build: Use -Wvla with GCC if supported. + + Variable-length arrays are mandatory in C99 but optional in C11. + The code doesn't currently use any VLAs and it shouldn't in the + future either to stay compatible with C11 without requiring any + optional C11 features. + +commit efb07cfba65e9e05984c02cd796c1b0338ce04dc +Author: Lasse Collin +Date: Mon Apr 15 19:29:09 2013 +0300 + + xzdec: Improve the --help message. + + The options are now ordered in the same order as in xz's help + message. + + Descriptions were added to the options that are ignored. + I left them in parenthesis even if it looks a bit weird + because I find it easier to spot the ignored vs. non-ignored + options from the list that way. + +commit e3c8be13699e2813f5e2879d8187444b46d82d89 +Author: Lasse Collin +Date: Fri Apr 5 19:25:40 2013 +0300 + + Update THANKS. + +commit ad8282efe483612f6b5544f9a0d2e4914fb2532a +Author: Jeff Bastian +Date: Wed Apr 3 13:59:17 2013 +0200 + + xzgrep: make the '-h' option to be --no-filename equivalent + + * src/scripts/xzgrep.in: Accept the '-h' option in argument parsing. + +commit 9271a3eb0e022b23e8712154be851d0afe4c02e4 +Author: Lasse Collin +Date: Fri Apr 5 19:34:09 2013 +0300 + + liblzma: Be less picky in lzma_alone_decoder(). + + To avoid false positives when detecting .lzma files, + rare values in dictionary size and uncompressed size fields + were rejected. They will still be rejected if .lzma files + are decoded with lzma_auto_decoder(), but when using + lzma_alone_decoder() directly, such files will now be accepted. + Hopefully this is an OK compromise. + + This doesn't affect xz because xz still has its own file + format detection code. This does affect lzmadec though. + So after this commit lzmadec will accept files that xz or + xz-emulating-lzma doesn't. + + NOTE: lzma_alone_decoder() still won't decode all .lzma files + because liblzma's LZMA decoder doesn't support lc + lp > 4. + + Reported here: + http://sourceforge.net/projects/lzmautils/forums/forum/708858/topic/7068827 + + Conflicts: + src/liblzma/common/alone_decoder.c + src/liblzma/common/alone_decoder.h + +commit 211b931cee58626c1d2e021810cb108cb5cbc10f +Author: Lasse Collin +Date: Tue Mar 5 19:14:50 2013 +0200 + + Avoid unneeded use of awk in xzless. + + Use "read" instead of "awk" in xzless to get the version + number of "less". The need for awk was introduced in + the commit db5c1817fabf7cbb9e4087b1576eb26f0747338e. + + Thanks to Ariel P for the patch. + +commit 9f62fd9605eade23b62b07a235d1f02156f7a5c6 +Author: Jonathan Nieder +Date: Mon Nov 19 00:10:10 2012 -0800 + + xzless: Make "less -V" parsing more robust + + In v4.999.9beta~30 (xzless: Support compressed standard input, + 2009-08-09), xzless learned to parse ‘less -V’ output to figure out + whether less is new enough to handle $LESSOPEN settings starting + with “|-â€. That worked well for a while, but the version string from + ‘less’ versions 448 (June, 2012) is misparsed, producing a warning: + + $ xzless /tmp/test.xz; echo $? + /usr/bin/xzless: line 49: test: 456 (GNU regular expressions): \ + integer expression expected + 0 + + More precisely, modern ‘less’ lists the regexp implementation along + with its version number, and xzless passes the entire version number + with attached parenthetical phrase as a number to "test $a -gt $b", + producing the above confusing message. + + $ less-444 -V | head -1 + less 444 + $ less -V | head -1 + less 456 (no regular expressions) + + So relax the pattern matched --- instead of expecting "less ", + look for a line of the form "less [ (extra parenthetical)]". + While at it, improve the behavior when no matching line is found --- + instead of producing a cryptic message, we can fall back on a LESSPIPE + setting that is supported by all versions of ‘less’. + + The implementation uses "awk" for simplicity. Hopefully that’s + portable enough. + + Reported-by: Jörg-Volker Peetz + Signed-off-by: Jonathan Nieder + +commit 1d05980f5b5c2c94d833001daccacce4a466876e +Author: Lasse Collin +Date: Wed Oct 3 15:54:24 2012 +0300 + + xz: Fix the note about --rsyncable on the man page. + +commit fb68497333598688d309a92838d91fd560f7e9f0 +Author: Lasse Collin +Date: Fri Sep 28 20:11:09 2012 +0300 + + xz: Improve handling of failed realloc in xrealloc. + + Thanks to Jim Meyering. + +commit 75013db6d4d63c195bd8b8d45729b4be0665a812 +Author: Lasse Collin +Date: Sat Dec 15 20:01:02 2012 +0200 + + A few typo fixes to comments and the xz man page. + + Thanks to Jim Meyering. + +commit e44b21839b1dcbac5097be39b87dd2ddb6e114fd +Author: Lasse Collin +Date: Thu Aug 2 17:13:30 2012 +0300 + + Build: Bump gettext version requirement to 0.18. + + Otherwise too old version of m4/lib-link.m4 gets included + when autoreconf -fi is run. + +commit fd3dbb23ca7e75a7a888d7e897c381dc06308307 +Author: Lasse Collin +Date: Thu Jul 5 07:36:28 2012 +0300 + + Tests: Remove tests/test_block.c that had gotten committed accidentally. + +commit 05a735d279d74af437c31f25f69aded4713c1a3d +Author: Lasse Collin +Date: Thu Jul 5 07:33:35 2012 +0300 + + Build: Include macosx/build.sh in the distribution. + + It has been in the Git repository since 2010 but probably + few people have seen it since it hasn't been included in + the release tarballs. :-( + +commit 4e6d62793b5e7b87edcc93c7ded072c1ecd94173 +Author: Lasse Collin +Date: Thu Jul 5 07:24:45 2012 +0300 + + Docs: Fix the name LZMA Utils -> XZ Utils in debug/README. + +commit dd95b5e7614baf1f07a1316b5106bd616a9efa79 +Author: Lasse Collin +Date: Thu Jul 5 07:23:17 2012 +0300 + + Include debug/translation.bash in the distribution. + + Also fix the script name mentioned in README. + commit 20778053a07eb90c159c1377ca8dc05a90fd530b Author: Lasse Collin Date: Fri Jun 22 14:36:16 2012 +0300 Modified: head/contrib/xz/README ============================================================================== --- head/contrib/xz/README Tue Mar 4 21:51:09 2014 (r262753) +++ head/contrib/xz/README Tue Mar 4 21:51:11 2014 (r262754) @@ -210,8 +210,8 @@ XZ Utils # make -C po update-po make install - bash debug/translations.bash | less - bash debug/translations.bash | less -S # For --list outputs + bash debug/translation.bash | less + bash debug/translation.bash | less -S # For --list outputs Repeat the above as needed (no need to re-run configure though). Modified: head/contrib/xz/THANKS ============================================================================== --- head/contrib/xz/THANKS Tue Mar 4 21:51:09 2014 (r262753) +++ head/contrib/xz/THANKS Tue Mar 4 21:51:11 2014 (r262754) @@ -6,6 +6,7 @@ Some people have helped more, some less, has been important. :-) In alphabetical order: - Mark Adler - H. Peter Anvin + - Jeff Bastian - Nelson H. F. Beebe - Karl Berry - Anders F. Björklund @@ -47,6 +48,7 @@ has been important. :-) In alphabetical - Bela Lubkin - Gregory Margo - Jim Meyering + - Conley Moorhous - RafaÅ‚ MużyÅ‚o - Adrien Nader - Hongbo Ni @@ -58,8 +60,10 @@ has been important. :-) In alphabetical - Diego Elio Pettenò - Elbert Pol - Mikko Pouru + - Pavel Raiskup - Robert Readman - Bernhard Reutner-Fischer + - Eric S. Raymond - Cristian Rodríguez - Christian von Roques - Jukka Salmi Modified: head/contrib/xz/src/liblzma/api/lzma/version.h ============================================================================== --- head/contrib/xz/src/liblzma/api/lzma/version.h Tue Mar 4 21:51:09 2014 (r262753) +++ head/contrib/xz/src/liblzma/api/lzma/version.h Tue Mar 4 21:51:11 2014 (r262754) @@ -22,7 +22,7 @@ */ #define LZMA_VERSION_MAJOR 5 #define LZMA_VERSION_MINOR 0 -#define LZMA_VERSION_PATCH 4 +#define LZMA_VERSION_PATCH 5 #define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_STABLE #ifndef LZMA_VERSION_COMMIT Modified: head/contrib/xz/src/liblzma/check/sha256.c ============================================================================== --- head/contrib/xz/src/liblzma/check/sha256.c Tue Mar 4 21:51:09 2014 (r262753) +++ head/contrib/xz/src/liblzma/check/sha256.c Tue Mar 4 21:51:11 2014 (r262754) @@ -6,7 +6,6 @@ /// \todo Crypto++ has x86 ASM optimizations. They use SSE so if they /// are imported to liblzma, SSE instructions need to be used /// conditionally to keep the code working on older boxes. -/// We could also support using some external libary for SHA-256. // // This code is based on the code found from 7-Zip, which has a modified // version of the SHA-256 found from Crypto++ . Modified: head/contrib/xz/src/liblzma/common/alone_decoder.c ============================================================================== --- head/contrib/xz/src/liblzma/common/alone_decoder.c Tue Mar 4 21:51:09 2014 (r262753) +++ head/contrib/xz/src/liblzma/common/alone_decoder.c Tue Mar 4 21:51:11 2014 (r262754) @@ -26,6 +26,11 @@ struct lzma_coder_s { SEQ_CODE, } sequence; + /// If true, reject files that are unlikely to be .lzma files. + /// If false, more non-.lzma files get accepted and will give + /// LZMA_DATA_ERROR either immediately or after a few output bytes. + bool picky; + /// Position in the header fields size_t pos; @@ -68,13 +73,13 @@ alone_decode(lzma_coder *coder, |= (size_t)(in[*in_pos]) << (coder->pos * 8); if (++coder->pos == 4) { - if (coder->options.dict_size != UINT32_MAX) { + if (coder->picky && coder->options.dict_size + != UINT32_MAX) { // A hack to ditch tons of false positives: // We allow only dictionary sizes that are // 2^n or 2^n + 2^(n-1). LZMA_Alone created // only files with 2^n, but accepts any - // dictionary size. If someone complains, this - // will be reconsidered. + // dictionary size. uint32_t d = coder->options.dict_size - 1; d |= d >> 2; d |= d >> 3; @@ -103,9 +108,9 @@ alone_decode(lzma_coder *coder, // Another hack to ditch false positives: Assume that // if the uncompressed size is known, it must be less - // than 256 GiB. Again, if someone complains, this - // will be reconsidered. - if (coder->uncompressed_size != LZMA_VLI_UNKNOWN + // than 256 GiB. + if (coder->picky + && coder->uncompressed_size != LZMA_VLI_UNKNOWN && coder->uncompressed_size >= (LZMA_VLI_C(1) << 38)) return LZMA_FORMAT_ERROR; @@ -189,7 +194,7 @@ alone_decoder_memconfig(lzma_coder *code extern lzma_ret lzma_alone_decoder_init(lzma_next_coder *next, lzma_allocator *allocator, - uint64_t memlimit) + uint64_t memlimit, bool picky) { lzma_next_coder_init(&lzma_alone_decoder_init, next, allocator); @@ -208,6 +213,7 @@ lzma_alone_decoder_init(lzma_next_coder } next->coder->sequence = SEQ_PROPERTIES; + next->coder->picky = picky; next->coder->pos = 0; next->coder->options.dict_size = 0; next->coder->options.preset_dict = NULL; @@ -223,7 +229,7 @@ lzma_alone_decoder_init(lzma_next_coder extern LZMA_API(lzma_ret) lzma_alone_decoder(lzma_stream *strm, uint64_t memlimit) { - lzma_next_strm_init(lzma_alone_decoder_init, strm, memlimit); + lzma_next_strm_init(lzma_alone_decoder_init, strm, memlimit, false); strm->internal->supported_actions[LZMA_RUN] = true; strm->internal->supported_actions[LZMA_FINISH] = true; Modified: head/contrib/xz/src/liblzma/common/alone_decoder.h ============================================================================== --- head/contrib/xz/src/liblzma/common/alone_decoder.h Tue Mar 4 21:51:09 2014 (r262753) +++ head/contrib/xz/src/liblzma/common/alone_decoder.h Tue Mar 4 21:51:11 2014 (r262754) @@ -16,7 +16,8 @@ #include "common.h" -extern lzma_ret lzma_alone_decoder_init(lzma_next_coder *next, - lzma_allocator *allocator, uint64_t memlimit); +extern lzma_ret lzma_alone_decoder_init( + lzma_next_coder *next, lzma_allocator *allocator, + uint64_t memlimit, bool picky); #endif Modified: head/contrib/xz/src/liblzma/common/auto_decoder.c ============================================================================== --- head/contrib/xz/src/liblzma/common/auto_decoder.c Tue Mar 4 21:51:09 2014 (r262753) +++ head/contrib/xz/src/liblzma/common/auto_decoder.c Tue Mar 4 21:51:11 2014 (r262754) @@ -54,7 +54,7 @@ auto_decode(lzma_coder *coder, lzma_allo coder->memlimit, coder->flags)); } else { return_if_error(lzma_alone_decoder_init(&coder->next, - allocator, coder->memlimit)); + allocator, coder->memlimit, true)); // If the application wants to know about missing // integrity check or about the check in general, we Modified: head/contrib/xz/src/lzmainfo/lzmainfo.1 ============================================================================== --- head/contrib/xz/src/lzmainfo/lzmainfo.1 Tue Mar 4 21:51:09 2014 (r262753) +++ head/contrib/xz/src/lzmainfo/lzmainfo.1 Tue Mar 4 21:51:11 2014 (r262754) @@ -4,14 +4,14 @@ .\" This file has been put into the public domain. .\" You can do whatever you want with this file. .\" -.TH LZMAINFO 1 "2010-09-27" "Tukaani" "XZ Utils" +.TH LZMAINFO 1 "2013-06-30" "Tukaani" "XZ Utils" .SH NAME lzmainfo \- show information stored in the .lzma file header .SH SYNOPSIS .B lzmainfo .RB [ \-\-help ] .RB [ \-\-version ] -.RI [ file ]... +.RI [ file... ] .SH DESCRIPTION .B lzmainfo shows information stored in the Modified: head/contrib/xz/src/xz/coder.c ============================================================================== --- head/contrib/xz/src/xz/coder.c Tue Mar 4 21:51:09 2014 (r262753) +++ head/contrib/xz/src/xz/coder.c Tue Mar 4 21:51:11 2014 (r262754) @@ -37,15 +37,10 @@ static io_buf in_buf; static io_buf out_buf; /// Number of filters. Zero indicates that we are using a preset. -static size_t filters_count = 0; +static uint32_t filters_count = 0; /// Number of the preset (0-9) -static size_t preset_number = 6; - -/// If a preset is used (no custom filter chain) and preset_extreme is true, -/// a significantly slower compression is used to achieve slightly better -/// compression ratio. -static bool preset_extreme = false; +static uint32_t preset_number = LZMA_PRESET_DEFAULT; /// Integrity check type static lzma_check check; @@ -63,11 +58,9 @@ coder_set_check(lzma_check new_check) } -extern void -coder_set_preset(size_t new_preset) +static void +forget_filter_chain(void) { - preset_number = new_preset; - // Setting a preset makes us forget a possibly defined custom // filter chain. while (filters_count > 0) { @@ -81,9 +74,20 @@ coder_set_preset(size_t new_preset) extern void +coder_set_preset(uint32_t new_preset) +{ + preset_number &= ~LZMA_PRESET_LEVEL_MASK; + preset_number |= new_preset; + forget_filter_chain(); + return; +} + + +extern void coder_set_extreme(void) { - preset_extreme = true; + preset_number |= LZMA_PRESET_EXTREME; + forget_filter_chain(); return; } @@ -98,6 +102,12 @@ coder_add_filter(lzma_vli id, void *opti filters[filters_count].options = options; ++filters_count; + // Setting a custom filter chain makes us forget the preset options. + // This makes a difference if one specifies e.g. "xz -9 --lzma2 -e" + // where the custom filter chain resets the preset level back to + // the default 6, making the example equivalent to "xz -6e". + preset_number = LZMA_PRESET_DEFAULT; + return; } @@ -134,9 +144,6 @@ coder_set_compression_settings(void) } // Get the preset for LZMA1 or LZMA2. - if (preset_extreme) - preset_number |= LZMA_PRESET_EXTREME; - if (lzma_lzma_preset(&opt_lzma, preset_number)) message_bug(); Modified: head/contrib/xz/src/xz/coder.h ============================================================================== --- head/contrib/xz/src/xz/coder.h Tue Mar 4 21:51:09 2014 (r262753) +++ head/contrib/xz/src/xz/coder.h Tue Mar 4 21:51:11 2014 (r262754) @@ -46,7 +46,7 @@ extern bool opt_auto_adjust; extern void coder_set_check(lzma_check check); /// Set preset number -extern void coder_set_preset(size_t new_preset); +extern void coder_set_preset(uint32_t new_preset); /// Enable extreme mode extern void coder_set_extreme(void); Modified: head/contrib/xz/src/xz/file_io.c ============================================================================== --- head/contrib/xz/src/xz/file_io.c Tue Mar 4 21:51:09 2014 (r262753) +++ head/contrib/xz/src/xz/file_io.c Tue Mar 4 21:51:11 2014 (r262754) @@ -41,9 +41,10 @@ static bool warn_fchown; static bool try_sparse = true; #ifndef TUKLIB_DOSLIKE -/// File status flags of standard output. This is used by io_open_dest() -/// and io_close_dest(). -static int stdout_flags = 0; +/// Original file status flags of standard output. This is used by +/// io_open_dest() and io_close_dest() to save and restore the flags. +static int stdout_flags; +static bool restore_stdout_flags = false; #endif @@ -397,10 +398,6 @@ io_open_src_real(file_pair *pair) was_symlink = true; # elif defined(__NetBSD__) - // As of 2010-09-05, NetBSD doesn't document what errno is - // used with O_NOFOLLOW. It is EFTYPE though, and I - // understood that is very unlikely to change even though - // it is undocumented. if (errno == EFTYPE) was_symlink = true; @@ -441,7 +438,7 @@ io_open_src_real(file_pair *pair) flags &= ~O_NONBLOCK; - if (fcntl(pair->src_fd, F_SETFL, flags)) + if (fcntl(pair->src_fd, F_SETFL, flags) == -1) goto error_msg; } #endif @@ -634,11 +631,11 @@ io_open_dest_real(file_pair *pair) if (!S_ISREG(pair->dest_st.st_mode)) return false; - const int flags = fcntl(STDOUT_FILENO, F_GETFL); - if (flags == -1) + stdout_flags = fcntl(STDOUT_FILENO, F_GETFL); + if (stdout_flags == -1) return false; - if (flags & O_APPEND) { + if (stdout_flags & O_APPEND) { // Creating a sparse file is not possible // when O_APPEND is active (it's used by // shell's >> redirection). As I understand @@ -657,12 +654,14 @@ io_open_dest_real(file_pair *pair) return false; if (fcntl(STDOUT_FILENO, F_SETFL, - stdout_flags & ~O_APPEND)) + stdout_flags & ~O_APPEND) + == -1) return false; - // Remember the flags so that io_close_dest() - // can restore them. - stdout_flags = flags; + // Disabling O_APPEND succeeded. Mark + // that the flags should be restored + // in io_close_dest(). + restore_stdout_flags = true; } else if (lseek(STDOUT_FILENO, 0, SEEK_CUR) != pair->dest_st.st_size) { @@ -703,13 +702,12 @@ io_close_dest(file_pair *pair, bool succ { #ifndef TUKLIB_DOSLIKE // If io_open_dest() has disabled O_APPEND, restore it here. - if (stdout_flags != 0) { + if (restore_stdout_flags) { assert(pair->dest_fd == STDOUT_FILENO); - const int fail = fcntl(STDOUT_FILENO, F_SETFL, stdout_flags); - stdout_flags = 0; + restore_stdout_flags = false; - if (fail) { + if (fcntl(STDOUT_FILENO, F_SETFL, stdout_flags) == -1) { message_error(_("Error restoring the O_APPEND flag " "to standard output: %s"), strerror(errno)); @@ -882,7 +880,7 @@ io_write_buf(file_pair *pair, const uint if (amount == -1) { if (errno == EINTR) { if (user_abort) - return -1; + return true; continue; } Modified: head/contrib/xz/src/xz/list.c ============================================================================== --- head/contrib/xz/src/xz/list.c Tue Mar 4 21:51:09 2014 (r262753) +++ head/contrib/xz/src/xz/list.c Tue Mar 4 21:51:11 2014 (r262754) @@ -203,6 +203,20 @@ parse_indexes(xz_file_info *xfi, file_pa goto error; } + // Check that the Stream Footer doesn't specify something + // that we don't support. This can only happen if the xz + // version is older than liblzma and liblzma supports + // something new. + // + // It is enough to check Stream Footer. Stream Header must + // match when it is compared against Stream Footer with + // lzma_stream_flags_compare(). + if (footer_flags.version != 0) { + message_error("%s: %s", pair->src_name, + message_strm(LZMA_OPTIONS_ERROR)); + goto error; + } + // Check that the size of the Index field looks sane. lzma_vli index_size = footer_flags.backward_size; if ((lzma_vli)(pos) < index_size + LZMA_STREAM_HEADER_SIZE) { @@ -429,7 +443,19 @@ parse_block_header(file_pair *pair, cons switch (lzma_block_compressed_size(&block, iter->block.unpadded_size)) { case LZMA_OK: - break; + // Validate also block.uncompressed_size if it is present. + // If it isn't present, there's no need to set it since + // we aren't going to actually decompress the Block; if + // we were decompressing, then we should set it so that + // the Block decoder could validate the Uncompressed Size + // that was stored in the Index. + if (block.uncompressed_size == LZMA_VLI_UNKNOWN + || block.uncompressed_size + == iter->block.uncompressed_size) + break; + + // If the above fails, the file is corrupt so + // LZMA_DATA_ERROR is a good error code. case LZMA_DATA_ERROR: // Free the memory allocated by lzma_block_header_decode(). Modified: head/contrib/xz/src/xz/util.c ============================================================================== --- head/contrib/xz/src/xz/util.c Tue Mar 4 21:51:09 2014 (r262753) +++ head/contrib/xz/src/xz/util.c Tue Mar 4 21:51:11 2014 (r262754) @@ -26,9 +26,19 @@ xrealloc(void *ptr, size_t size) { assert(size > 0); + // Save ptr so that we can free it if realloc fails. + // The point is that message_fatal ends up calling stdio functions + // which in some libc implementations might allocate memory from + // the heap. Freeing ptr improves the chances that there's free + // memory for stdio functions if they need it. + void *p = ptr; ptr = realloc(ptr, size); - if (ptr == NULL) - message_fatal("%s", strerror(errno)); + + if (ptr == NULL) { + const int saved_errno = errno; + free(p); + message_fatal("%s", strerror(saved_errno)); + } return ptr; } Modified: head/contrib/xz/src/xz/xz.1 ============================================================================== --- head/contrib/xz/src/xz/xz.1 Tue Mar 4 21:51:09 2014 (r262753) +++ head/contrib/xz/src/xz/xz.1 Tue Mar 4 21:51:11 2014 (r262754) @@ -5,16 +5,17 @@ .\" This file has been put into the public domain. .\" You can do whatever you want with this file. .\" -.TH XZ 1 "2012-05-27" "Tukaani" "XZ Utils" +.TH XZ 1 "2013-06-21" "Tukaani" "XZ Utils" . .SH NAME xz, unxz, xzcat, lzma, unlzma, lzcat \- Compress or decompress .xz and .lzma files . .SH SYNOPSIS .B xz -.RI [ option ]... -.RI [ file ]... -.PP +.RI [ option... ] +.RI [ file... ] +. +.SH COMMAND ALIASES .B unxz is equivalent to .BR "xz \-\-decompress" . @@ -708,7 +709,7 @@ be dramatically higher than that of the DecMem contains the decompressor memory requirements. That is, the compression settings determine the memory requirements of the decompressor. -The exact decompressor memory usage is slighly more than +The exact decompressor memory usage is slightly more than the LZMA2 dictionary size, but the values in the table have been rounded up to the next full MiB. .RE @@ -897,11 +898,14 @@ if threading will be enabled by default. .SS "Custom compressor filter chains" A custom filter chain allows specifying the compression settings in detail instead of relying on -the settings associated to the preset levels. +the settings associated to the presets. When a custom filter chain is specified, -the compression preset level options -(\fB\-0\fR ... \fB\-9\fR and \fB\-\-extreme\fR) are -silently ignored. +preset options (\fB\-0\fR ... \fB\-9\fR and \fB\-\-extreme\fR) +earlier on the command line are forgotten. +If a preset option is specified +after one or more custom filter chain options, +the new preset takes effect and +the custom filter chain options specified earlier are forgotten. .PP A filter chain is comparable to piping on the command line. When compressing, the uncompressed input goes to the first filter, @@ -934,6 +938,15 @@ Extra commas in are ignored. Every option has a default value, so you need to specify only those you want to change. +.PP +To see the whole filter chain and +.IR options , +use +.B "xz \-vv" +(that is, use +.B \-\-verbose +twice). +This works also for viewing the filter chain options used by presets. .TP \fB\-\-lzma1\fR[\fB=\fIoptions\fR] .PD 0 @@ -976,13 +989,12 @@ The only supported modifier is currently .BR e , which matches .BR \-\-extreme . -The default -.I preset -is -.BR 6 , -from which the default values for the rest of the LZMA1 or LZMA2 +If no +.B preset +is specified, the default values of LZMA1 or LZMA2 .I options -are taken. +are taken from the preset +.BR 6 . .TP .BI dict= size Dictionary (history buffer) @@ -1578,7 +1590,7 @@ is supported only together with .BR \-\-info\-memory , and .BR \-\-list . -It will be supported for normal compression and +It will be supported for compression and decompression in the future. . .SS Version @@ -2179,14 +2191,15 @@ The output can vary even between differe builds of the same XZ Utils version, if different build options are used. .PP -The above means that implementing +The above means that once .B \-\-rsyncable -to create rsyncable -.B .xz -files is not going to happen without -freezing a part of the encoder -implementation, which can then be used with -.BR \-\-rsyncable . +has been implemented, +the resulting files won't necessarily be rsyncable +unless both old and new files have been compressed +with the same xz version. +This problem can be fixed if a part of the encoder +implementation is frozen to keep rsyncable output +stable across xz versions. . .SS "Embedded .xz decompressors" Embedded Modified: head/contrib/xz/src/xzdec/xzdec.1 ============================================================================== --- head/contrib/xz/src/xzdec/xzdec.1 Tue Mar 4 21:51:09 2014 (r262753) +++ head/contrib/xz/src/xzdec/xzdec.1 Tue Mar 4 21:51:11 2014 (r262754) @@ -4,17 +4,17 @@ .\" This file has been put into the public domain. .\" You can do whatever you want with this file. .\" -.TH XZDEC 1 "2010-09-27" "Tukaani" "XZ Utils" +.TH XZDEC 1 "2013-06-30" "Tukaani" "XZ Utils" .SH NAME xzdec, lzmadec \- Small .xz and .lzma decompressors .SH SYNOPSIS .B xzdec -.RI [ option ]... -.RI [ file ]... +.RI [ option... ] +.RI [ file... ] .br .B lzmadec -.RI [ option ]... -.RI [ file ]... +.RI [ option... ] +.RI [ file... ] .SH DESCRIPTION .B xzdec is a liblzma-based decompression-only tool for Modified: head/contrib/xz/src/xzdec/xzdec.c ============================================================================== --- head/contrib/xz/src/xzdec/xzdec.c Tue Mar 4 21:51:09 2014 (r262753) +++ head/contrib/xz/src/xzdec/xzdec.c Tue Mar 4 21:51:11 2014 (r262754) @@ -62,13 +62,13 @@ help(void) { printf( "Usage: %s [OPTION]... [FILE]...\n" -"Uncompress files in the ." TOOL_FORMAT " format to the standard output.\n" +"Decompress files in the ." TOOL_FORMAT " format to standard output.\n" "\n" -" -c, --stdout (ignored)\n" -" -d, --decompress (ignored)\n" -" -k, --keep (ignored)\n" +" -d, --decompress (ignored, only decompression is supported)\n" +" -k, --keep (ignored, files are never deleted)\n" +" -c, --stdout (ignored, output is always written to standard output)\n" " -q, --quiet specify *twice* to suppress errors\n" -" -Q, --no-warn (ignored)\n" +" -Q, --no-warn (ignored, the exit status 2 is never used)\n" " -h, --help display this help and exit\n" " -V, --version display the version number and exit\n" "\n" From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 22:30:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA8886A6; Tue, 4 Mar 2014 22:30:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BD1273F7; Tue, 4 Mar 2014 22:30:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s24MUc06044900; Tue, 4 Mar 2014 22:30:38 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24MUckS044898; Tue, 4 Mar 2014 22:30:38 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201403042230.s24MUckS044898@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 4 Mar 2014 22:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262755 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 22:30:39 -0000 Author: jilles Date: Tue Mar 4 22:30:38 2014 New Revision: 262755 URL: http://svnweb.freebsd.org/changeset/base/262755 Log: sh: Make argstr() return where it stopped and simplify expari() using this. Modified: head/bin/sh/expand.c Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Tue Mar 4 21:51:11 2014 (r262754) +++ head/bin/sh/expand.c Tue Mar 4 22:30:38 2014 (r262755) @@ -98,7 +98,7 @@ static struct ifsregion ifsfirst; /* fir static struct ifsregion *ifslastp; /* last struct in list */ static struct arglist exparg; /* holds expanded arg list */ -static void argstr(char *, int); +static char *argstr(char *, int); static char *exptilde(char *, int); static char *expari(char *); static void expbackq(union node *, int, int); @@ -213,7 +213,7 @@ expandarg(union node *arg, struct arglis * characters to allow for further processing. * If EXP_FULL is set, also preserve CTLQUOTEMARK characters. */ -static void +static char * argstr(char *p, int flag) { char c; @@ -231,9 +231,10 @@ argstr(char *p, int flag) CHECKSTRSPACE(2, expdest); switch (c = *p++) { case '\0': + return (p - 1); case CTLENDVAR: case CTLENDARI: - goto breakloop; + return (p); case CTLQUOTEMARK: lit_quoted = 1; /* "$@" syntax adherence hack */ @@ -290,7 +291,6 @@ argstr(char *p, int flag) expdest - stackblock(), 0); } } -breakloop:; } /* @@ -399,13 +399,11 @@ expari(char *p) arith_t result; int begoff; int quoted; - int c; - int nesting; int adj; quoted = *p++ == '"'; begoff = expdest - stackblock(); - argstr(p, 0); + p = argstr(p, 0); removerecordregions(begoff); STPUTC('\0', expdest); start = stackblock() + begoff; @@ -424,20 +422,6 @@ expari(char *p) STADJUST(adj, expdest); if (!quoted) recordregion(begoff, expdest - stackblock(), 0); - nesting = 1; - while (nesting > 0) { - c = *p++; - if (c == CTLESC) - p++; - else if (c == CTLARI) - nesting++; - else if (c == CTLENDARI) - nesting--; - else if (c == CTLVAR) - p++; /* ignore variable substitution byte */ - else if (c == '\0') - return p - 1; - } return p; } From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 23:18:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73A50FA2; Tue, 4 Mar 2014 23:18:01 +0000 (UTC) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 44BE5AC1; Tue, 4 Mar 2014 23:18:00 +0000 (UTC) Received: from pool-96-250-5-187.nycmny.fios.verizon.net ([96.250.5.187]:63391 helo=minion.home) by vps.hungerhost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1WKyb1-0005tA-9K; Tue, 04 Mar 2014 18:17:59 -0500 Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r262727 - head/sys/net From: George Neville-Neil In-Reply-To: <201403041214.44230.jhb@freebsd.org> Date: Tue, 4 Mar 2014 18:17:57 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201403040509.s2459lou017310@svn.freebsd.org> <201403041214.44230.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1874) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - freebsd.org X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 23:18:01 -0000 On Mar 4, 2014, at 12:14 , John Baldwin wrote: > On Tuesday, March 04, 2014 12:09:47 am George V. Neville-Neil wrote: >> Author: gnn >> Date: Tue Mar 4 05:09:46 2014 >> New Revision: 262727 >> URL: http://svnweb.freebsd.org/changeset/base/262727 >>=20 >> Log: >> Naming consistency fix. The routing code defines >> RADIX_NODE_HEAD_LOCK as grabbing the write lock, >> but RADIX_NODE_HEAD_LOCK_ASSERT as checking the read lock. >=20 > Actually, that isn't what RA_LOCKED means. RA_LOCKED means that it is > either read- or write-locked. Note that you have now made=20 > RADIX_NODE_HEAD_LOCK_ASSERT() a redundant copy of=20 > RADIX_NODE_HEAD_WLOCK_ASSERT(). You should revert that part in some > way (either remove HEAD_LOCK_ASSERT() entirely leaving just = RLOCK_ASSERT() and=20 > WLOCK_ASSERT(), or restore HEAD_LOCK_ASSERT() to using RA_LOCKED if = there are=20 > places that want to assert that the lock is held, but don't care if it = is read=20 > or write). Actually I=92ll revert the whole thing and to back to Vijay to rework = this. Best, George From owner-svn-src-head@FreeBSD.ORG Tue Mar 4 23:55:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0A5998A; Tue, 4 Mar 2014 23:55:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BCE29E14; Tue, 4 Mar 2014 23:55:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s24Nt43k080705; Tue, 4 Mar 2014 23:55:04 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s24Nt4uB080703; Tue, 4 Mar 2014 23:55:04 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201403042355.s24Nt4uB080703@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 4 Mar 2014 23:55:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262758 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 23:55:04 -0000 Author: gnn Date: Tue Mar 4 23:55:04 2014 New Revision: 262758 URL: http://svnweb.freebsd.org/changeset/base/262758 Log: Revert previous commit (262727) and bounce patch back to the submitter. Pointed out by: jhb Modified: head/sys/net/radix.h head/sys/net/route.c Modified: head/sys/net/radix.h ============================================================================== --- head/sys/net/radix.h Tue Mar 4 23:27:27 2014 (r262757) +++ head/sys/net/radix.h Tue Mar 4 23:55:04 2014 (r262758) @@ -149,8 +149,7 @@ struct radix_node_head { #define RADIX_NODE_HEAD_DESTROY(rnh) rw_destroy(&(rnh)->rnh_lock) -#define RADIX_NODE_HEAD_LOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_WLOCKED) -#define RADIX_NODE_HEAD_RLOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_RLOCKED) +#define RADIX_NODE_HEAD_LOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_LOCKED) #define RADIX_NODE_HEAD_WLOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_WLOCKED) #endif /* _KERNEL */ Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Tue Mar 4 23:27:27 2014 (r262757) +++ head/sys/net/route.c Tue Mar 4 23:55:04 2014 (r262758) @@ -381,7 +381,7 @@ rtalloc1_fib(struct sockaddr *dst, int r RADIX_NODE_HEAD_RLOCK(rnh); #ifdef INVARIANTS else - RADIX_NODE_HEAD_RLOCK_ASSERT(rnh); + RADIX_NODE_HEAD_LOCK_ASSERT(rnh); #endif rn = rnh->rnh_matchaddr(dst, rnh); if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) { @@ -1000,10 +1000,9 @@ rn_mpath_update(int req, struct rt_addri * a matching RTAX_GATEWAY. */ struct rtentry *rt, *rto = NULL; - struct radix_node *rn; + register struct radix_node *rn; int error = 0; - RADIX_NODE_HEAD_LOCK_ASSERT(rnh); rn = rnh->rnh_lookup(dst, netmask, rnh); if (rn == NULL) return (ESRCH); From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 00:26:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2D2A1EF; Wed, 5 Mar 2014 00:26:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8F79A171; Wed, 5 Mar 2014 00:26:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s250QP2c093905; Wed, 5 Mar 2014 00:26:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s250QPJa093904; Wed, 5 Mar 2014 00:26:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403050026.s250QPJa093904@svn.freebsd.org> From: Adrian Chadd Date: Wed, 5 Mar 2014 00:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262759 - head/tools/tools/iwn/iwnstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 00:26:25 -0000 Author: adrian Date: Wed Mar 5 00:26:25 2014 New Revision: 262759 URL: http://svnweb.freebsd.org/changeset/base/262759 Log: Add command line parsing - and an -i option so I can monitor multiple iwn interfaces. Tested: * Intel 5100 Modified: head/tools/tools/iwn/iwnstats/main.c Modified: head/tools/tools/iwn/iwnstats/main.c ============================================================================== --- head/tools/tools/iwn/iwnstats/main.c Tue Mar 4 23:55:04 2014 (r262758) +++ head/tools/tools/iwn/iwnstats/main.c Wed Mar 5 00:26:25 2014 (r262759) @@ -252,12 +252,42 @@ iwn_print(struct iwnstats *is) printf("--\n"); } +static void +usage(void) +{ + printf("Usage: iwnstats [-h] [-i ifname]\n"); + printf(" -h: Help\n"); + printf(" -i : Use ifname (default %s)\n", + IWN_DEFAULT_IF); +} + int -main(int argc, const char *argv[]) +main(int argc, char *argv[]) { struct iwnstats *is; + int ch; + char *ifname; + + ifname = strdup(IWN_DEFAULT_IF); + + /* Parse command line arguments */ + while ((ch = getopt(argc, argv, + "hi:")) != -1) { + switch (ch) { + case 'i': + if (ifname) + free(ifname); + ifname = strdup(optarg); + break; + default: + case '?': + case 'h': + usage(); + exit(1); + } + } - is = iwnstats_new(IWN_DEFAULT_IF); + is = iwnstats_new(ifname); if (is == NULL) { fprintf(stderr, "%s: couldn't allocate new stats structure\n", From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 00:40:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7BB2A50F; Wed, 5 Mar 2014 00:40:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 683A9284; Wed, 5 Mar 2014 00:40:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s250e4Br098462; Wed, 5 Mar 2014 00:40:04 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s250e32v098454; Wed, 5 Mar 2014 00:40:03 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403050040.s250e32v098454@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 5 Mar 2014 00:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262760 - in head: sbin/pfctl sys/net sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 00:40:04 -0000 Author: glebius Date: Wed Mar 5 00:40:03 2014 New Revision: 262760 URL: http://svnweb.freebsd.org/changeset/base/262760 Log: Instead of playing games with casts simply add 3 more members to the structure pf_rule, that are used when the structure is passed via ioctl(). PR: 187074 Modified: head/sbin/pfctl/pfctl.c head/sys/net/pfvar.h head/sys/netpfil/pf/pf_ioctl.c Modified: head/sbin/pfctl/pfctl.c ============================================================================== --- head/sbin/pfctl/pfctl.c Wed Mar 5 00:26:25 2014 (r262759) +++ head/sbin/pfctl/pfctl.c Wed Mar 5 00:40:03 2014 (r262760) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -792,18 +791,17 @@ pfctl_print_rule_counters(struct pf_rule } if (opts & PF_OPT_VERBOSE) { printf(" [ Evaluations: %-8llu Packets: %-8llu " - "Bytes: %-10llu States: %-6"PRIuPTR"]\n", + "Bytes: %-10llu States: %-6lu]\n", (unsigned long long)rule->evaluations, (unsigned long long)(rule->packets[0] + rule->packets[1]), (unsigned long long)(rule->bytes[0] + - rule->bytes[1]), - (uintptr_t)rule->states_cur); + rule->bytes[1]), rule->u_states_cur); if (!(opts & PF_OPT_DEBUG)) printf(" [ Inserted: uid %u pid %u " - "State Creations: %-6"PRIuPTR"]\n", + "State Creations: %-6lu]\n", (unsigned)rule->cuid, (unsigned)rule->cpid, - (uintptr_t)rule->states_tot); + rule->u_states_tot); } } @@ -905,7 +903,7 @@ pfctl_show_rules(int dev, char *path, in case PFCTL_SHOW_LABELS: if (pr.rule.label[0]) { printf("%s %llu %llu %llu %llu" - " %llu %llu %llu %"PRIuPTR"\n", + " %llu %llu %llu %llu\n", pr.rule.label, (unsigned long long)pr.rule.evaluations, (unsigned long long)(pr.rule.packets[0] + @@ -916,7 +914,7 @@ pfctl_show_rules(int dev, char *path, in (unsigned long long)pr.rule.bytes[0], (unsigned long long)pr.rule.packets[1], (unsigned long long)pr.rule.bytes[1], - (uintptr_t)pr.rule.states_tot); + (unsigned long long)pr.rule.u_states_tot); } break; case PFCTL_SHOW_RULES: Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Wed Mar 5 00:26:25 2014 (r262759) +++ head/sys/net/pfvar.h Wed Mar 5 00:40:03 2014 (r262760) @@ -580,6 +580,10 @@ struct pf_rule { struct pf_addr addr; u_int16_t port; } divert; + + uint64_t u_states_cur; + uint64_t u_states_tot; + uint64_t u_src_nodes; }; /* rule flags */ Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Wed Mar 5 00:26:25 2014 (r262759) +++ head/sys/netpfil/pf/pf_ioctl.c Wed Mar 5 00:40:03 2014 (r262760) @@ -1349,16 +1349,9 @@ DIOCADDRULE_error: break; } bcopy(rule, &pr->rule, sizeof(struct pf_rule)); - /* - * XXXGL: this is what happens when internal kernel - * structures are used as ioctl API structures. - */ - pr->rule.states_cur = - (counter_u64_t )counter_u64_fetch(rule->states_cur); - pr->rule.states_tot = - (counter_u64_t )counter_u64_fetch(rule->states_tot); - pr->rule.src_nodes = - (counter_u64_t )counter_u64_fetch(rule->src_nodes); + pr->rule.u_states_cur = counter_u64_fetch(rule->states_cur); + pr->rule.u_states_tot = counter_u64_fetch(rule->states_tot); + pr->rule.u_src_nodes = counter_u64_fetch(rule->src_nodes); if (pf_anchor_copyout(ruleset, rule, pr)) { PF_RULES_WUNLOCK(); error = EBUSY; From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 01:17:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20678D63; Wed, 5 Mar 2014 01:17:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 09C8B7FE; Wed, 5 Mar 2014 01:17:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s251HrOw016293; Wed, 5 Mar 2014 01:17:53 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s251HlEP016245; Wed, 5 Mar 2014 01:17:47 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403050117.s251HlEP016245@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 5 Mar 2014 01:17:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262763 - in head: share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netatalk sys/netinet sys/netinet6 sys/netipx sys/netpfil/pf sys/nfs usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 01:17:54 -0000 Author: glebius Date: Wed Mar 5 01:17:47 2014 New Revision: 262763 URL: http://svnweb.freebsd.org/changeset/base/262763 Log: - Remove rt_metrics_lite and simply put its members into rtentry. - Use counter(9) for rt_pksent (former rt_rmx.rmx_pksent). This removes another cache trashing ++ from packet forwarding path. - Create zini/fini methods for the rtentry UMA zone. Via initialize mutex and counter in them. - Fix reporting of rmx_pksent to routing socket. - Fix netstat(1) to report "Use" both in kvm(3) and sysctl(3) mode. The change is mostly targeted for stable/10 merge. For head, rt_pksent is expected to just disappear. Discussed with: melifaro Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/share/man/man9/rtentry.9 head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c head/sys/net/if_disc.c head/sys/net/if_faith.c head/sys/net/if_loop.c head/sys/net/if_stf.c head/sys/net/radix_mpath.c head/sys/net/route.c head/sys/net/route.h head/sys/net/rtsock.c head/sys/netatalk/ddp_output.c head/sys/netinet/in_rmx.c head/sys/netinet/ip_fastfwd.c head/sys/netinet/ip_input.c head/sys/netinet/ip_ipsec.c head/sys/netinet/ip_output.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet/tcp_output.c head/sys/netinet/tcp_subr.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/ip6_ipsec.c head/sys/netinet6/ip6_output.c head/sys/netipx/ipx_input.c head/sys/netipx/ipx_outputfl.c head/sys/netpfil/pf/pf.c head/sys/nfs/bootp_subr.c head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.h head/usr.bin/netstat/route.c Modified: head/share/man/man9/rtentry.9 ============================================================================== --- head/share/man/man9/rtentry.9 Wed Mar 5 00:48:11 2014 (r262762) +++ head/share/man/man9/rtentry.9 Wed Mar 5 01:17:47 2014 (r262763) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 16, 2013 +.Dd March 5, 2014 .Dt RTENTRY 9 .Os .Sh NAME @@ -78,6 +78,12 @@ intermediate stop on the way to that des flag is set). .It Vt "int rt_flags" ; See below. +If the +.Dv RTF_UP +flag is not present, the +.Fn rtfree +function will delete the route from the radix tree when the last +reference drops. .It Vt "int rt_refcnt" ; Route entries are reference-counted; this field indicates the number of external (to the radix tree) references. @@ -89,14 +95,14 @@ as it were, to the question posed by a r name the interface and interface address to be used in sending a packet to the destination or set of destinations which this route represents. -.It Vt "struct rt_metrics_lite rt_rmx" ; -See below. -If the -.Dv RTF_UP -flag is not present, the -.Fn rtfree -function will delete the route from the radix tree when the last -reference drops. +.It Vt "u_long rt_mtu"; +See description of rmx_mtu below. +.It Vt "u_long rt_weight"; +See description of rmx_weight below. +.It Vt "u_long rt_expire"; +See description of rmx_expire below. +.It Vt "counter64_t rt_pksent"; +See description of rmx_pksent below. .It Vt "struct rtentry *rt_gwroute" ; This member is a reference to a route whose destination is .Va rt_gateway . @@ -164,9 +170,7 @@ Indicates that the destination is a broa Indicates that the destination is a multicast address. .El .Pp -Every route has associated with it a set of metrics, stored in -.Vt "struct rt_metrics_lite" . -Metrics are supplied in +Several metrics are supplied in .Vt "struct rt_metrics" passed with routing control messages via .Xr route 4 @@ -175,8 +179,7 @@ Currently only .Vt rmx_mtu , rmx_expire , and .Vt rmx_pksent -metrics are used in -.Vt "struct rt_metrics_lite" . +metrics are supplied. All others are ignored. .Pp The following metrics are defined by Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Mar 5 01:17:47 2014 (r262763) @@ -802,7 +802,7 @@ ipf_fastroute(m0, mpp, fin, fdp) if (ro->ro_rt->rt_flags & RTF_GATEWAY) dst = (struct sockaddr_in *)ro->ro_rt->rt_gateway; if (ro->ro_rt) - ro->ro_rt->rt_use++; + counter_u64_add(ro->ro_rt->rt_pksent, 1); /* * For input packets which are being "fastrouted", they won't Modified: head/sys/net/if_disc.c ============================================================================== --- head/sys/net/if_disc.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/net/if_disc.c Wed Mar 5 01:17:47 2014 (r262763) @@ -186,7 +186,7 @@ static void discrtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info) { RT_LOCK_ASSERT(rt); - rt->rt_rmx.rmx_mtu = DSMTU; + rt->rt_mtu = DSMTU; } /* Modified: head/sys/net/if_faith.c ============================================================================== --- head/sys/net/if_faith.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/net/if_faith.c Wed Mar 5 01:17:47 2014 (r262763) @@ -246,7 +246,7 @@ faithrtrequest(cmd, rt, info) struct rt_addrinfo *info; { RT_LOCK_ASSERT(rt); - rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; + rt->rt_mtu = rt->rt_ifp->if_mtu; } /* Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/net/if_loop.c Wed Mar 5 01:17:47 2014 (r262763) @@ -395,7 +395,7 @@ lortrequest(int cmd, struct rtentry *rt, { RT_LOCK_ASSERT(rt); - rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; + rt->rt_mtu = rt->rt_ifp->if_mtu; } /* Modified: head/sys/net/if_stf.c ============================================================================== --- head/sys/net/if_stf.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/net/if_stf.c Wed Mar 5 01:17:47 2014 (r262763) @@ -785,7 +785,7 @@ stf_rtrequest(cmd, rt, info) struct rt_addrinfo *info; { RT_LOCK_ASSERT(rt); - rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; + rt->rt_mtu = rt->rt_ifp->if_mtu; } static int Modified: head/sys/net/radix_mpath.c ============================================================================== --- head/sys/net/radix_mpath.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/net/radix_mpath.c Wed Mar 5 01:17:47 2014 (r262763) @@ -85,7 +85,7 @@ rn_mpath_count(struct radix_node *rn) while (rn != NULL) { rt = (struct rtentry *)rn; - i += rt->rt_rmx.rmx_weight; + i += rt->rt_weight; rn = rn_mpath_next(rn); } return (i); @@ -230,8 +230,8 @@ rtalloc_mpath_fib(struct route *ro, uint hash += hashjitter; hash %= n; for (weight = abs((int32_t)hash), rt = ro->ro_rt; - weight >= rt->rt_rmx.rmx_weight && rn; - weight -= rt->rt_rmx.rmx_weight) { + weight >= rt->rt_weight && rn; + weight -= rt->rt_weight) { /* stay within the multipath routes */ if (rn->rn_dupedkey && rn->rn_mask != rn->rn_dupedkey->rn_mask) Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/net/route.c Wed Mar 5 01:17:47 2014 (r262763) @@ -202,6 +202,40 @@ route_init(void) } SYSINIT(route_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, route_init, 0); +static int +rtentry_zinit(void *mem, int size, int how) +{ + struct rtentry *rt = mem; + + rt->rt_pksent = counter_u64_alloc(how); + if (rt->rt_pksent == NULL) + return (ENOMEM); + + RT_LOCK_INIT(rt); + + return (0); +} + +static void +rtentry_zfini(void *mem, int size) +{ + struct rtentry *rt = mem; + + RT_LOCK_DESTROY(rt); + counter_u64_free(rt->rt_pksent); +} + +static int +rtentry_ctor(void *mem, int size, void *arg, int how) +{ + struct rtentry *rt = mem; + + bzero(rt, offsetof(struct rtentry, rt_endzero)); + counter_u64_zero(rt->rt_pksent); + + return (0); +} + static void vnet_route_init(const void *unused __unused) { @@ -213,8 +247,9 @@ vnet_route_init(const void *unused __unu V_rt_tables = malloc(rt_numfibs * (AF_MAX+1) * sizeof(struct radix_node_head *), M_RTABLE, M_WAITOK|M_ZERO); - V_rtzone = uma_zcreate("rtentry", sizeof(struct rtentry), NULL, NULL, - NULL, NULL, UMA_ALIGN_PTR, 0); + V_rtzone = uma_zcreate("rtentry", sizeof(struct rtentry), + rtentry_ctor, NULL, + rtentry_zinit, rtentry_zfini, UMA_ALIGN_PTR, 0); for (dom = domains; dom; dom = dom->dom_next) { if (dom->dom_rtattach == NULL) continue; @@ -491,7 +526,6 @@ rtfree(struct rtentry *rt) /* * and the rtentry itself of course */ - RT_LOCK_DESTROY(rt); uma_zfree(V_rtzone, rt); return; } @@ -1227,12 +1261,11 @@ rtrequest1_fib(int req, struct rt_addrin } else ifa_ref(info->rti_ifa); ifa = info->rti_ifa; - rt = uma_zalloc(V_rtzone, M_NOWAIT | M_ZERO); + rt = uma_zalloc(V_rtzone, M_NOWAIT); if (rt == NULL) { ifa_free(ifa); senderr(ENOBUFS); } - RT_LOCK_INIT(rt); rt->rt_flags = RTF_UP | flags; rt->rt_fibnum = fibnum; /* @@ -1240,7 +1273,6 @@ rtrequest1_fib(int req, struct rt_addrin */ RT_LOCK(rt); if ((error = rt_setgate(rt, dst, gateway)) != 0) { - RT_LOCK_DESTROY(rt); ifa_free(ifa); uma_zfree(V_rtzone, rt); senderr(error); @@ -1266,7 +1298,7 @@ rtrequest1_fib(int req, struct rt_addrin */ rt->rt_ifa = ifa; rt->rt_ifp = ifa->ifa_ifp; - rt->rt_rmx.rmx_weight = 1; + rt->rt_weight = 1; #ifdef RADIX_MPATH /* do not permit exactly the same dst/mask/gw pair */ @@ -1274,7 +1306,6 @@ rtrequest1_fib(int req, struct rt_addrin rt_mpath_conflict(rnh, rt, netmask)) { ifa_free(rt->rt_ifa); Free(rt_key(rt)); - RT_LOCK_DESTROY(rt); uma_zfree(V_rtzone, rt); senderr(EEXIST); } @@ -1342,7 +1373,6 @@ rtrequest1_fib(int req, struct rt_addrin if (rn == NULL) { ifa_free(rt->rt_ifa); Free(rt_key(rt)); - RT_LOCK_DESTROY(rt); uma_zfree(V_rtzone, rt); #ifdef FLOWTABLE if (rt0 != NULL) Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/net/route.h Wed Mar 5 01:17:47 2014 (r262763) @@ -33,6 +33,8 @@ #ifndef _NET_ROUTE_H_ #define _NET_ROUTE_H_ +#include + /* * Kernel resident routing tables. * @@ -57,17 +59,6 @@ struct route { #define RT_CACHING_CONTEXT 0x1 /* XXX: not used anywhere */ #define RT_NORTREF 0x2 /* doesn't hold reference on ro_rt */ -/* - * These numbers are used by reliable protocols for determining - * retransmission behavior and are included in the routing structure. - */ -struct rt_metrics_lite { - u_long rmx_mtu; /* MTU for this path */ - u_long rmx_expire; /* lifetime for route, e.g. redirect */ - u_long rmx_pksent; /* packets sent using this route */ - u_long rmx_weight; /* absolute weight */ -}; - struct rt_metrics { u_long rmx_locks; /* Kernel must leave these values alone */ u_long rmx_mtu; /* MTU for this path */ @@ -124,16 +115,17 @@ struct rtentry { #define rt_key(r) (*((struct sockaddr **)(&(r)->rt_nodes->rn_key))) #define rt_mask(r) (*((struct sockaddr **)(&(r)->rt_nodes->rn_mask))) struct sockaddr *rt_gateway; /* value */ - int rt_flags; /* up/down?, host/net */ - int rt_refcnt; /* # held references */ struct ifnet *rt_ifp; /* the answer: interface to use */ struct ifaddr *rt_ifa; /* the answer: interface address to use */ - struct rt_metrics_lite rt_rmx; /* metrics used by rx'ing protocols */ - u_int rt_fibnum; /* which FIB */ -#ifdef _KERNEL - /* XXX ugly, user apps use this definition but don't have a mtx def */ - struct mtx rt_mtx; /* mutex for routing entry */ -#endif + int rt_flags; /* up/down?, host/net */ + int rt_refcnt; /* # held references */ + u_int rt_fibnum; /* which FIB */ + u_long rt_mtu; /* MTU for this path */ + u_long rt_weight; /* absolute weight */ + u_long rt_expire; /* lifetime for route, e.g. redirect */ +#define rt_endzero rt_pksent + counter_u64_t rt_pksent; /* packets sent using this route */ + struct mtx rt_mtx; /* mutex for routing entry */ }; /* @@ -150,8 +142,6 @@ struct ortentry { struct ifnet *rt_ifp; /* the answer: interface to use */ }; -#define rt_use rt_rmx.rmx_pksent - #define RTF_UP 0x1 /* route usable */ #define RTF_GATEWAY 0x2 /* destination is a gateway */ #define RTF_HOST 0x4 /* host entry (net otherwise) */ Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/net/rtsock.c Wed Mar 5 01:17:47 2014 (r262763) @@ -189,10 +189,8 @@ static int sysctl_dumpentry(struct radix static int sysctl_iflist(int af, struct walkarg *w); static int sysctl_ifmalist(int af, struct walkarg *w); static int route_output(struct mbuf *m, struct socket *so); -static void rt_setmetrics(u_long which, const struct rt_metrics *in, - struct rt_metrics_lite *out); -static void rt_getmetrics(const struct rt_metrics_lite *in, - struct rt_metrics *out); +static void rt_setmetrics(const struct rt_msghdr *rtm, struct rtentry *rt); +static void rt_getmetrics(const struct rtentry *rt, struct rt_metrics *out); static void rt_dispatch(struct mbuf *, sa_family_t); static struct netisr_handler rtsock_nh = { @@ -680,8 +678,7 @@ route_output(struct mbuf *m, struct sock rti_need_deembed = (V_deembed_scopeid) ? 1 : 0; #endif RT_LOCK(saved_nrt); - rt_setmetrics(rtm->rtm_inits, - &rtm->rtm_rmx, &saved_nrt->rt_rmx); + rt_setmetrics(rtm, saved_nrt); rtm->rtm_index = saved_nrt->rt_ifp->if_index; RT_REMREF(saved_nrt); RT_UNLOCK(saved_nrt); @@ -850,7 +847,7 @@ route_output(struct mbuf *m, struct sock (rt->rt_flags & ~RTF_GWFLAG_COMPAT); else rtm->rtm_flags = rt->rt_flags; - rt_getmetrics(&rt->rt_rmx, &rtm->rtm_rmx); + rt_getmetrics(rt, &rtm->rtm_rmx); rtm->rtm_addrs = info.rti_addrs; break; @@ -913,8 +910,7 @@ route_output(struct mbuf *m, struct sock /* Allow some flags to be toggled on change. */ rt->rt_flags = (rt->rt_flags & ~RTF_FMASK) | (rtm->rtm_flags & RTF_FMASK); - rt_setmetrics(rtm->rtm_inits, &rtm->rtm_rmx, - &rt->rt_rmx); + rt_setmetrics(rtm, rt); rtm->rtm_index = rt->rt_ifp->if_index; if (rt->rt_ifa && rt->rt_ifa->ifa_rtrequest) rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, &info); @@ -1002,34 +998,30 @@ flush: } static void -rt_setmetrics(u_long which, const struct rt_metrics *in, - struct rt_metrics_lite *out) +rt_setmetrics(const struct rt_msghdr *rtm, struct rtentry *rt) { -#define metric(f, e) if (which & (f)) out->e = in->e; - /* - * Only these are stored in the routing entry since introduction - * of tcp hostcache. The rest is ignored. - */ - metric(RTV_MTU, rmx_mtu); - metric(RTV_WEIGHT, rmx_weight); - /* Userland -> kernel timebase conversion. */ - if (which & RTV_EXPIRE) - out->rmx_expire = in->rmx_expire ? - in->rmx_expire - time_second + time_uptime : 0; -#undef metric + + if (rtm->rtm_inits & RTV_MTU) + rt->rt_mtu = rtm->rtm_rmx.rmx_mtu; + if (rtm->rtm_inits & RTV_WEIGHT) + rt->rt_weight = rtm->rtm_rmx.rmx_weight; + /* Kernel -> userland timebase conversion. */ + if (rtm->rtm_inits & RTV_EXPIRE) + rt->rt_expire = rtm->rtm_rmx.rmx_expire ? + rtm->rtm_rmx.rmx_expire - time_second + time_uptime : 0; } static void -rt_getmetrics(const struct rt_metrics_lite *in, struct rt_metrics *out) +rt_getmetrics(const struct rtentry *rt, struct rt_metrics *out) { -#define metric(e) out->e = in->e; + bzero(out, sizeof(*out)); - metric(rmx_mtu); - metric(rmx_weight); + out->rmx_mtu = rt->rt_mtu; + out->rmx_weight = rt->rt_weight; + out->rmx_pksent = counter_u64_fetch(rt->rt_pksent); /* Kernel -> userland timebase conversion. */ - out->rmx_expire = in->rmx_expire ? - in->rmx_expire - time_uptime + time_second : 0; -#undef metric + out->rmx_expire = rt->rt_expire ? + rt->rt_expire - time_uptime + time_second : 0; } /* @@ -1596,11 +1588,7 @@ sysctl_dumpentry(struct radix_node *rn, (rt->rt_flags & ~RTF_GWFLAG_COMPAT); else rtm->rtm_flags = rt->rt_flags; - /* - * let's be honest about this being a retarded hack - */ - rtm->rtm_fmask = rt->rt_rmx.rmx_pksent; - rt_getmetrics(&rt->rt_rmx, &rtm->rtm_rmx); + rt_getmetrics(rt, &rtm->rtm_rmx); rtm->rtm_index = rt->rt_ifp->if_index; rtm->rtm_errno = rtm->rtm_pid = rtm->rtm_seq = 0; rtm->rtm_addrs = info.rti_addrs; Modified: head/sys/netatalk/ddp_output.c ============================================================================== --- head/sys/netatalk/ddp_output.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/netatalk/ddp_output.c Wed Mar 5 01:17:47 2014 (r262763) @@ -222,7 +222,7 @@ ddp_route(struct mbuf *m, struct route * elh->el_type = ELAP_DDPEXTEND; elh->el_dnode = gate.sat_addr.s_node; } - ro->ro_rt->rt_use++; + counter_u64_add(ro->ro_rt->rt_pksent, 1); #ifdef NETATALK_DEBUG printf ("ddp_route: from %d.%d to %d.%d, via %d.%d (%s)\n", Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/netinet/in_rmx.c Wed Mar 5 01:17:47 2014 (r262763) @@ -94,8 +94,8 @@ in_addroute(void *v_arg, void *n_arg, st if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) rt->rt_flags |= RTF_MULTICAST; - if (!rt->rt_rmx.rmx_mtu && rt->rt_ifp) - rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; + if (rt->rt_mtu == 0 && rt->rt_ifp != NULL) + rt->rt_mtu = rt->rt_ifp->if_mtu; return (rn_addroute(v_arg, n_arg, head, treenodes)); } @@ -115,7 +115,7 @@ in_matroute(void *v_arg, struct radix_no RT_LOCK(rt); if (rt->rt_flags & RTPRF_OURS) { rt->rt_flags &= ~RTPRF_OURS; - rt->rt_rmx.rmx_expire = 0; + rt->rt_expire = 0; } RT_UNLOCK(rt); } @@ -168,7 +168,7 @@ in_clsroute(struct radix_node *rn, struc */ if (V_rtq_reallyold != 0) { rt->rt_flags |= RTPRF_OURS; - rt->rt_rmx.rmx_expire = time_uptime + V_rtq_reallyold; + rt->rt_expire = time_uptime + V_rtq_reallyold; } else { rtexpunge(rt); } @@ -200,7 +200,7 @@ in_rtqkill(struct radix_node *rn, void * if (rt->rt_flags & RTPRF_OURS) { ap->found++; - if (ap->draining || rt->rt_rmx.rmx_expire <= time_uptime) { + if (ap->draining || rt->rt_expire <= time_uptime) { if (rt->rt_refcnt > 0) panic("rtqkill route really not free"); @@ -216,13 +216,9 @@ in_rtqkill(struct radix_node *rn, void * } } else { if (ap->updating && - (rt->rt_rmx.rmx_expire - time_uptime > - V_rtq_reallyold)) { - rt->rt_rmx.rmx_expire = - time_uptime + V_rtq_reallyold; - } - ap->nextstop = lmin(ap->nextstop, - rt->rt_rmx.rmx_expire); + (rt->rt_expire - time_uptime > V_rtq_reallyold)) + rt->rt_expire = time_uptime + V_rtq_reallyold; + ap->nextstop = lmin(ap->nextstop, rt->rt_expire); } } Modified: head/sys/netinet/ip_fastfwd.c ============================================================================== --- head/sys/netinet/ip_fastfwd.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/netinet/ip_fastfwd.c Wed Mar 5 01:17:47 2014 (r262763) @@ -490,8 +490,7 @@ passout: * Check if route is dampned (when ARP is unable to resolve) */ if ((ro.ro_rt->rt_flags & RTF_REJECT) && - (ro.ro_rt->rt_rmx.rmx_expire == 0 || - time_uptime < ro.ro_rt->rt_rmx.rmx_expire)) { + (ro.ro_rt->rt_expire == 0 || time_uptime < ro.ro_rt->rt_expire)) { icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0); goto consumed; } @@ -519,8 +518,8 @@ passout: /* * Check if packet fits MTU or if hardware will fragment for us */ - if (ro.ro_rt->rt_rmx.rmx_mtu) - mtu = min(ro.ro_rt->rt_rmx.rmx_mtu, ifp->if_mtu); + if (ro.ro_rt->rt_mtu) + mtu = min(ro.ro_rt->rt_mtu, ifp->if_mtu); else mtu = ifp->if_mtu; @@ -585,7 +584,7 @@ passout: if (error != 0) IPSTAT_INC(ips_odropped); else { - ro.ro_rt->rt_rmx.rmx_pksent++; + counter_u64_add(ro.ro_rt->rt_pksent, 1); IPSTAT_INC(ips_forward); IPSTAT_INC(ips_fastforward); } Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/netinet/ip_input.c Wed Mar 5 01:17:47 2014 (r262763) @@ -1463,7 +1463,7 @@ ip_forward(struct mbuf *m, int srcrt) error = ip_output(m, NULL, &ro, IP_FORWARDING, NULL, NULL); if (error == EMSGSIZE && ro.ro_rt) - mtu = ro.ro_rt->rt_rmx.rmx_mtu; + mtu = ro.ro_rt->rt_mtu; RO_RTFREE(&ro); if (error) Modified: head/sys/netinet/ip_ipsec.c ============================================================================== --- head/sys/netinet/ip_ipsec.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/netinet/ip_ipsec.c Wed Mar 5 01:17:47 2014 (r262763) @@ -237,9 +237,7 @@ ip_ipsec_mtu(struct mbuf *m, int mtu) sp->req->sav->sah != NULL) { ro = &sp->req->sav->sah->route_cache.sa_route; if (ro->ro_rt && ro->ro_rt->rt_ifp) { - mtu = - ro->ro_rt->rt_rmx.rmx_mtu ? - ro->ro_rt->rt_rmx.rmx_mtu : + mtu = ro->ro_rt->rt_mtu ? ro->ro_rt->rt_mtu : ro->ro_rt->rt_ifp->if_mtu; mtu -= ipsechdr; } Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/netinet/ip_output.c Wed Mar 5 01:17:47 2014 (r262763) @@ -294,7 +294,7 @@ again: } ia = ifatoia(rte->rt_ifa); ifp = rte->rt_ifp; - rte->rt_rmx.rmx_pksent++; + counter_u64_add(rte->rt_pksent, 1); if (rte->rt_flags & RTF_GATEWAY) gw = (struct sockaddr_in *)rte->rt_gateway; if (rte->rt_flags & RTF_HOST) @@ -314,9 +314,9 @@ again: * them, there is no way for one to update all its * routes when the MTU is changed. */ - if (rte->rt_rmx.rmx_mtu > ifp->if_mtu) - rte->rt_rmx.rmx_mtu = ifp->if_mtu; - mtu = rte->rt_rmx.rmx_mtu; + if (rte->rt_mtu > ifp->if_mtu) + rte->rt_mtu = ifp->if_mtu; + mtu = rte->rt_mtu; } else { mtu = ifp->if_mtu; } Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/netinet/sctp_os_bsd.h Wed Mar 5 01:17:47 2014 (r262763) @@ -328,11 +328,11 @@ typedef struct callout sctp_os_timer_t; /* MTU */ /*************************/ #define SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, af) ((struct ifnet *)ifn)->if_mtu -#define SCTP_GATHER_MTU_FROM_ROUTE(sctp_ifa, sa, rt) ((rt != NULL) ? rt->rt_rmx.rmx_mtu : 0) +#define SCTP_GATHER_MTU_FROM_ROUTE(sctp_ifa, sa, rt) ((rt != NULL) ? rt->rt_mtu : 0) #define SCTP_GATHER_MTU_FROM_INTFC(sctp_ifn) ((sctp_ifn->ifn_p != NULL) ? ((struct ifnet *)(sctp_ifn->ifn_p))->if_mtu : 0) #define SCTP_SET_MTU_OF_ROUTE(sa, rt, mtu) do { \ if (rt != NULL) \ - rt->rt_rmx.rmx_mtu = mtu; \ + rt->rt_mtu = mtu; \ } while(0) /* (de-)register interface event notifications */ Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/netinet/tcp_output.c Wed Mar 5 01:17:47 2014 (r262763) @@ -1194,7 +1194,7 @@ send: NULL, NULL, tp->t_inpcb); if (error == EMSGSIZE && ro.ro_rt != NULL) - mtu = ro.ro_rt->rt_rmx.rmx_mtu; + mtu = ro.ro_rt->rt_mtu; RO_RTFREE(&ro); } #endif /* INET6 */ @@ -1232,7 +1232,7 @@ send: tp->t_inpcb); if (error == EMSGSIZE && ro.ro_rt != NULL) - mtu = ro.ro_rt->rt_rmx.rmx_mtu; + mtu = ro.ro_rt->rt_mtu; RO_RTFREE(&ro); } #endif /* INET */ Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/netinet/tcp_subr.c Wed Mar 5 01:17:47 2014 (r262763) @@ -1811,10 +1811,10 @@ tcp_maxmtu(struct in_conninfo *inc, stru } if (sro.ro_rt != NULL) { ifp = sro.ro_rt->rt_ifp; - if (sro.ro_rt->rt_rmx.rmx_mtu == 0) + if (sro.ro_rt->rt_mtu == 0) maxmtu = ifp->if_mtu; else - maxmtu = min(sro.ro_rt->rt_rmx.rmx_mtu, ifp->if_mtu); + maxmtu = min(sro.ro_rt->rt_mtu, ifp->if_mtu); /* Report additional interface capabilities. */ if (cap != NULL) { @@ -1848,10 +1848,10 @@ tcp_maxmtu6(struct in_conninfo *inc, str } if (sro6.ro_rt != NULL) { ifp = sro6.ro_rt->rt_ifp; - if (sro6.ro_rt->rt_rmx.rmx_mtu == 0) + if (sro6.ro_rt->rt_mtu == 0) maxmtu = IN6_LINKMTU(sro6.ro_rt->rt_ifp); else - maxmtu = min(sro6.ro_rt->rt_rmx.rmx_mtu, + maxmtu = min(sro6.ro_rt->rt_mtu, IN6_LINKMTU(sro6.ro_rt->rt_ifp)); /* Report additional interface capabilities. */ Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/netinet6/in6_rmx.c Wed Mar 5 01:17:47 2014 (r262763) @@ -136,8 +136,8 @@ in6_addroute(void *v_arg, void *n_arg, s } } - if (!rt->rt_rmx.rmx_mtu && rt->rt_ifp) - rt->rt_rmx.rmx_mtu = IN6_LINKMTU(rt->rt_ifp); + if (!rt->rt_mtu && rt->rt_ifp) + rt->rt_mtu = IN6_LINKMTU(rt->rt_ifp); ret = rn_addroute(v_arg, n_arg, head, treenodes); if (ret == NULL) { @@ -207,12 +207,11 @@ in6_mtuexpire(struct radix_node *rn, voi if (!rt) panic("rt == NULL in in6_mtuexpire"); - if (rt->rt_rmx.rmx_expire && !(rt->rt_flags & RTF_PROBEMTU)) { - if (rt->rt_rmx.rmx_expire <= time_uptime) { + if (rt->rt_expire && !(rt->rt_flags & RTF_PROBEMTU)) { + if (rt->rt_expire <= time_uptime) { rt->rt_flags |= RTF_PROBEMTU; } else { - ap->nextstop = lmin(ap->nextstop, - rt->rt_rmx.rmx_expire); + ap->nextstop = lmin(ap->nextstop, rt->rt_expire); } } Modified: head/sys/netinet6/ip6_ipsec.c ============================================================================== --- head/sys/netinet6/ip6_ipsec.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/netinet6/ip6_ipsec.c Wed Mar 5 01:17:47 2014 (r262763) @@ -370,9 +370,7 @@ ip6_ipsec_mtu(struct mbuf *m) sp->req->sav->sah != NULL) { ro = &sp->req->sav->sah->route_cache.sa_route; if (ro->ro_rt && ro->ro_rt->rt_ifp) { - mtu = - ro->ro_rt->rt_rmx.rmx_mtu ? - ro->ro_rt->rt_rmx.rmx_mtu : + mtu = ro->ro_rt->rt_mtu ? ro->ro_rt->rt_mtu : ro->ro_rt->rt_ifp->if_mtu; mtu -= ipsechdr; } Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/netinet6/ip6_output.c Wed Mar 5 01:17:47 2014 (r262763) @@ -219,9 +219,9 @@ in6_delayed_cksum(struct mbuf *m, uint32 * skipped and ro->ro_rt would be used. If ro is present but ro->ro_rt is NULL, * then result of route lookup is stored in ro->ro_rt. * - * type of "mtu": rt_rmx.rmx_mtu is u_long, ifnet.ifr_mtu is int, and + * type of "mtu": rt_mtu is u_long, ifnet.ifr_mtu is int, and * nd_ifinfo.linkmtu is u_int32_t. so we use u_long to hold largest one, - * which is rt_rmx.rmx_mtu. + * which is rt_mtu. * * ifpp - XXX: just for statistics */ @@ -661,7 +661,7 @@ again: } if (rt != NULL) { ia = (struct in6_ifaddr *)(rt->rt_ifa); - rt->rt_use++; + counter_u64_add(rt->rt_pksent, 1); } @@ -1399,9 +1399,9 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, s ifmtu = IN6_LINKMTU(ifp); mtu = tcp_hc_getmtu(&inc); if (mtu) - mtu = min(mtu, ro_pmtu->ro_rt->rt_rmx.rmx_mtu); + mtu = min(mtu, ro_pmtu->ro_rt->rt_mtu); else - mtu = ro_pmtu->ro_rt->rt_rmx.rmx_mtu; + mtu = ro_pmtu->ro_rt->rt_mtu; if (mtu == 0) mtu = ifmtu; else if (mtu < IPV6_MMTU) { @@ -1425,7 +1425,7 @@ ip6_getpmtu(struct route_in6 *ro_pmtu, s * field isn't locked). */ mtu = ifmtu; - ro_pmtu->ro_rt->rt_rmx.rmx_mtu = mtu; + ro_pmtu->ro_rt->rt_mtu = mtu; } } else if (ifp) { mtu = IN6_LINKMTU(ifp); Modified: head/sys/netipx/ipx_input.c ============================================================================== --- head/sys/netipx/ipx_input.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/netipx/ipx_input.c Wed Mar 5 01:17:47 2014 (r262763) @@ -455,7 +455,7 @@ ipx_do_route(struct ipx_addr *src, struc if (ro->ro_rt == NULL || ro->ro_rt->rt_ifp == NULL) { return (0); } - ro->ro_rt->rt_use++; + counter_u64_add(ro->ro_rt->rt_pksent, 1); return (1); } Modified: head/sys/netipx/ipx_outputfl.c ============================================================================== --- head/sys/netipx/ipx_outputfl.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/netipx/ipx_outputfl.c Wed Mar 5 01:17:47 2014 (r262763) @@ -130,7 +130,7 @@ ipx_outputfl(struct mbuf *m0, struct rou error = ENETUNREACH; goto bad; } - ro->ro_rt->rt_use++; + counter_u64_add(ro->ro_rt->rt_pksent, 1); if (ro->ro_rt->rt_flags & (RTF_GATEWAY|RTF_HOST)) dst = (struct sockaddr_ipx *)ro->ro_rt->rt_gateway; gotif: Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/netpfil/pf/pf.c Wed Mar 5 01:17:47 2014 (r262763) @@ -5496,7 +5496,7 @@ pf_route(struct mbuf **m, struct pf_rule } ifp = rt->rt_ifp; - rt->rt_rmx.rmx_pksent++; + counter_u64_add(rt->rt_pksent, 1); if (rt->rt_flags & RTF_GATEWAY) bcopy(satosin(rt->rt_gateway), &dst, sizeof(dst)); Modified: head/sys/nfs/bootp_subr.c ============================================================================== --- head/sys/nfs/bootp_subr.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/sys/nfs/bootp_subr.c Wed Mar 5 01:17:47 2014 (r262763) @@ -343,7 +343,7 @@ bootpboot_p_rtentry(struct rtentry *rt) bootpboot_p_sa(rt->rt_gateway, NULL); printf(" "); printf("flags %x", (unsigned short) rt->rt_flags); - printf(" %d", (int) rt->rt_rmx.rmx_expire); + printf(" %d", (int) rt->rt_expire); printf(" %s\n", rt->rt_ifp->if_xname); } Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/usr.bin/netstat/main.c Wed Mar 5 01:17:47 2014 (r262763) @@ -763,6 +763,19 @@ kread(u_long addr, void *buf, size_t siz } /* + * Read single counter(9). + */ +uint64_t +kread_counter(u_long addr) +{ + + if (kvmd_init() < 0) + return (-1); + + return (kvm_counter_u64_fetch(kvmd, addr)); +} + +/* * Read an array of N counters in kernel memory into array of N uint64_t's. */ int Modified: head/usr.bin/netstat/netstat.h ============================================================================== --- head/usr.bin/netstat/netstat.h Wed Mar 5 00:48:11 2014 (r262762) +++ head/usr.bin/netstat/netstat.h Wed Mar 5 01:17:47 2014 (r262763) @@ -60,6 +60,7 @@ extern int live; /* true if we are exami struct nlist; int kread(u_long addr, void *buf, size_t size); +uint64_t kread_counter(u_long addr); int kread_counters(u_long addr, void *buf, size_t size); int kresolve_list(struct nlist *); const char *plural(uintmax_t); Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Wed Mar 5 00:48:11 2014 (r262762) +++ head/usr.bin/netstat/route.c Wed Mar 5 01:17:47 2014 (r262763) @@ -181,7 +181,7 @@ routepr(int fibnum, int af) /* * Since kernel & userland use different timebase * (time_uptime vs time_second) and we are reading kernel memory - * directly we should do rt_rmx.rmx_expire --> expire_time conversion. + * directly we should do rt_expire --> expire_time conversion. */ if (clock_gettime(CLOCK_UPTIME, &uptime) < 0) err(EX_OSERR, "clock_gettime() failed"); @@ -256,8 +256,7 @@ pr_family(int af1) static int wid_dst; static int wid_gw; static int wid_flags; -static int wid_refs; -static int wid_use; +static int wid_pksent; static int wid_mtu; static int wid_if; static int wid_expire; @@ -268,8 +267,7 @@ size_cols(int ef, struct radix_node *rn) wid_dst = WID_DST_DEFAULT(ef); wid_gw = WID_GW_DEFAULT(ef); wid_flags = 6; - wid_refs = 6; - wid_use = 8; + wid_pksent = 8; wid_mtu = 6; wid_if = WID_IF_DEFAULT(ef); wid_expire = 6; @@ -329,16 +327,10 @@ size_cols_rtentry(struct rtentry *rt) len = strlen(bp); wid_flags = MAX(len, wid_flags); - if (addr.u_sa.sa_family == AF_INET || Wflag) { - len = snprintf(buffer, sizeof(buffer), "%d", rt->rt_refcnt); - wid_refs = MAX(len, wid_refs); - len = snprintf(buffer, sizeof(buffer), "%lu", rt->rt_use); - wid_use = MAX(len, wid_use); - if (Wflag && rt->rt_rmx.rmx_mtu != 0) { - len = snprintf(buffer, sizeof(buffer), - "%lu", rt->rt_rmx.rmx_mtu); - wid_mtu = MAX(len, wid_mtu); - } + if (Wflag) { + len = snprintf(buffer, sizeof(buffer), "%lu", + kread_counter((u_long )rt->rt_pksent)); + wid_pksent = MAX(len, wid_pksent); } if (rt->rt_ifp) { if (rt->rt_ifp != lastif) { @@ -349,11 +341,11 @@ size_cols_rtentry(struct rtentry *rt) lastif = rt->rt_ifp; wid_if = MAX(len, wid_if); } - if (rt->rt_rmx.rmx_expire) { + if (rt->rt_expire) { time_t expire_time; if ((expire_time = - rt->rt_rmx.rmx_expire - uptime.tv_sec) > 0) { + rt->rt_expire - uptime.tv_sec) > 0) { len = snprintf(buffer, sizeof(buffer), "%d", (int)expire_time); wid_expire = MAX(len, wid_expire); @@ -373,10 +365,11 @@ pr_rthdr(int af1) if (Aflag) printf("%-8.8s ","Address"); if (Wflag) { - printf("%-*.*s %-*.*s %-*.*s %*.*s %*.*s %*s\n", + printf("%-*.*s %-*.*s %-*.*s %*.*s %*.*s %*.*s %*s\n", wid_dst, wid_dst, "Destination", wid_gw, wid_gw, "Gateway", wid_flags, wid_flags, "Flags", + wid_pksent, wid_pksent, "Use", wid_mtu, wid_mtu, "Mtu", wid_if, wid_if, "Netif", wid_expire, "Expire"); @@ -661,6 +654,8 @@ p_rtentry_sysctl(struct rt_msghdr *rtm) snprintf(buffer, sizeof(buffer), "%%-%d.%ds ", wid_flags, wid_flags); p_flags(rtm->rtm_flags, buffer); if (Wflag) { + printf("%*lu ", wid_pksent, rtm->rtm_rmx.rmx_pksent); + if (rtm->rtm_rmx.rmx_mtu != 0) printf("%*lu ", wid_mtu, rtm->rtm_rmx.rmx_mtu); else @@ -870,17 +865,14 @@ p_rtentry_kvm(struct rtentry *rt) p_sockaddr(kgetsa(rt->rt_gateway), NULL, RTF_HOST, wid_gw); snprintf(buffer, sizeof(buffer), "%%-%d.%ds ", wid_flags, wid_flags); p_flags(rt->rt_flags, buffer); - if (addr.u_sa.sa_family == AF_INET || Wflag) { -#if 0 - printf("%*d %*lu ", wid_refs, rt->rt_refcnt, - wid_use, rt->rt_use); -#endif - if (Wflag) { - if (rt->rt_rmx.rmx_mtu != 0) - printf("%*lu ", wid_mtu, rt->rt_rmx.rmx_mtu); - else - printf("%*s ", wid_mtu, ""); - } + if (Wflag) { + printf("%*lu ", wid_pksent, + kread_counter((u_long )rt->rt_pksent)); + + if (rt->rt_mtu != 0) + printf("%*lu ", wid_mtu, rt->rt_mtu); + else + printf("%*s ", wid_mtu, ""); } if (rt->rt_ifp) { if (rt->rt_ifp != lastif) { @@ -892,11 +884,11 @@ p_rtentry_kvm(struct rtentry *rt) lastif = rt->rt_ifp; } printf("%*.*s", wid_if, wid_if, prettyname); - if (rt->rt_rmx.rmx_expire) { + if (rt->rt_expire) { time_t expire_time; if ((expire_time = - rt->rt_rmx.rmx_expire - uptime.tv_sec) > 0) + rt->rt_expire - uptime.tv_sec) > 0) printf(" %*d", wid_expire, (int)expire_time); } if (rt->rt_nodes[0].rn_dupedkey) From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 01:34:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D410596C; Wed, 5 Mar 2014 01:34:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C1B7EA2C; Wed, 5 Mar 2014 01:34:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s251YAcE024216; Wed, 5 Mar 2014 01:34:10 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s251YAcb024215; Wed, 5 Mar 2014 01:34:10 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403050134.s251YAcb024215@svn.freebsd.org> From: Ed Maste Date: Wed, 5 Mar 2014 01:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262765 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 01:34:10 -0000 Author: emaste Date: Wed Mar 5 01:34:10 2014 New Revision: 262765 URL: http://svnweb.freebsd.org/changeset/base/262765 Log: Disable amd64 TLB Context ID (pcid) by default for now There are a number of reports of userspace application crashes that are "solved" by setting vm.pmap.pcid_enabled=0, including Java and the x11/mate-terminal port (PR ports/184362). I originally planned to disable this only in stable/10 (in r262753), but it has been pointed out that additional crash reports on HEAD are not likely to provide new insight into the problem. The feature can easily be enabled for testing. Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Mar 5 01:33:15 2014 (r262764) +++ head/sys/amd64/amd64/pmap.c Wed Mar 5 01:34:10 2014 (r262765) @@ -367,7 +367,7 @@ static int pmap_flags = PMAP_PDE_SUPERPA static struct unrhdr pcid_unr; static struct mtx pcid_mtx; -int pmap_pcid_enabled = 1; +int pmap_pcid_enabled = 0; SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN, &pmap_pcid_enabled, 0, "Is TLB Context ID enabled ?"); int invpcid_works = 0; From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 01:33:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18C227DD; Wed, 5 Mar 2014 01:33:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 03E5AA24; Wed, 5 Mar 2014 01:33:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s251XHeE024090; Wed, 5 Mar 2014 01:33:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s251XFkH024070; Wed, 5 Mar 2014 01:33:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403050133.s251XFkH024070@svn.freebsd.org> From: Xin LI Date: Wed, 5 Mar 2014 01:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262764 - in head/sys/contrib/xz-embedded: . linux/include/linux linux/lib linux/lib/xz linux/scripts userspace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 01:33:18 -0000 Author: delphij Date: Wed Mar 5 01:33:15 2014 New Revision: 262764 URL: http://svnweb.freebsd.org/changeset/base/262764 Log: MFV r262756: Import xz-embedded from git. This is from commit hash '6a8a2364434763a033781f6b2a605ace9a021013'. This makes it possible to use CRC64 but for now it's intentionally not added to build. Added: head/sys/contrib/xz-embedded/linux/lib/xz/xz_crc64.c - copied unchanged from r262756, vendor/xz-embedded/dist/linux/lib/xz/xz_crc64.c head/sys/contrib/xz-embedded/userspace/bytetest.c - copied unchanged from r262756, vendor/xz-embedded/dist/userspace/bytetest.c Modified: head/sys/contrib/xz-embedded/README head/sys/contrib/xz-embedded/linux/include/linux/xz.h head/sys/contrib/xz-embedded/linux/lib/decompress_unxz.c head/sys/contrib/xz-embedded/linux/lib/xz/Kconfig head/sys/contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c head/sys/contrib/xz-embedded/linux/scripts/xz_wrap.sh head/sys/contrib/xz-embedded/userspace/Makefile head/sys/contrib/xz-embedded/userspace/boottest.c head/sys/contrib/xz-embedded/userspace/xz_config.h head/sys/contrib/xz-embedded/userspace/xzminidec.c Directory Properties: head/sys/contrib/xz-embedded/ (props changed) Modified: head/sys/contrib/xz-embedded/README ============================================================================== --- head/sys/contrib/xz-embedded/README Wed Mar 5 01:17:47 2014 (r262763) +++ head/sys/contrib/xz-embedded/README Wed Mar 5 01:33:15 2014 (r262764) @@ -7,7 +7,7 @@ XZ Embedded XZ Embedded was written for use in the Linux kernel, but the code can be easily used in other environments too, including regular userspace - applications. + applications. See userspace/xzminidec.c for an example program. This README contains information that is useful only when the copy of XZ Embedded isn't part of the Linux kernel tree. You should also @@ -84,6 +84,42 @@ Embedding into userspace applications environment. Probably you should at least skim through it even if the default file works as is. +Integrity check support + + XZ Embedded always supports the integrity check types None and + CRC32. Support for CRC64 is optional. SHA-256 is currently not + supported in XZ Embedded although the .xz format does support it. + The xz tool from XZ Utils uses CRC64 by default, but CRC32 is usually + enough in embedded systems to keep the code size smaller. + + If you want support for CRC64, you need to copy linux/lib/xz/xz_crc64.c + into your application, and #define XZ_USE_CRC64 in xz_config.h or in + compiler flags. + + When using the internal CRC32 or CRC64, their lookup tables need to be + initialized with xz_crc32_init() and xz_crc64_init(), respectively. + See xz.h for details. + + To use external CRC32 or CRC64 code instead of the code from + xz_crc32.c or xz_crc64.c, the following #defines may be used + in xz_config.h or in compiler flags: + + #define XZ_INTERNAL_CRC32 0 + #define XZ_INTERNAL_CRC64 0 + + Then it is up to you to provide compatible xz_crc32() or xz_crc64() + functions. + + If the .xz file being decompressed uses an integrity check type that + isn't supported by XZ Embedded, it is treated as an error and the + file cannot be decompressed. For multi-call mode, this can be modified + by #defining XZ_DEC_ANY_CHECK. Then xz_dec_run() will return + XZ_UNSUPPORTED_CHECK when unsupported check type is detected. After + that decompression can be continued normally except that the + integrity check won't be verified. In single-call mode there's + no way to continue decoding, so XZ_DEC_ANY_CHECK is almost useless + in single-call mode. + BCJ filter support If you want support for one or more BCJ filters, you need to copy also Modified: head/sys/contrib/xz-embedded/linux/include/linux/xz.h ============================================================================== --- head/sys/contrib/xz-embedded/linux/include/linux/xz.h Wed Mar 5 01:17:47 2014 (r262763) +++ head/sys/contrib/xz-embedded/linux/include/linux/xz.h Wed Mar 5 01:33:15 2014 (r262764) @@ -256,6 +256,22 @@ XZ_EXTERN void xz_dec_end(struct xz_dec # endif #endif +/* + * If CRC64 support has been enabled with XZ_USE_CRC64, a CRC64 + * implementation is needed too. + */ +#ifndef XZ_USE_CRC64 +# undef XZ_INTERNAL_CRC64 +# define XZ_INTERNAL_CRC64 0 +#endif +#ifndef XZ_INTERNAL_CRC64 +# ifdef __KERNEL__ +# error Using CRC64 in the kernel has not been implemented. +# else +# define XZ_INTERNAL_CRC64 1 +# endif +#endif + #if XZ_INTERNAL_CRC32 /* * This must be called before any other xz_* function to initialize @@ -271,6 +287,21 @@ XZ_EXTERN void xz_crc32_init(void); XZ_EXTERN uint32_t xz_crc32(const uint8_t *buf, size_t size, uint32_t crc); #endif +#if XZ_INTERNAL_CRC64 +/* + * This must be called before any other xz_* function (except xz_crc32_init()) + * to initialize the CRC64 lookup table. + */ +XZ_EXTERN void xz_crc64_init(void); + +/* + * Update CRC64 value using the polynomial from ECMA-182. To start a new + * calculation, the third argument must be zero. To continue the calculation, + * the previously returned value is passed as the third argument. + */ +XZ_EXTERN uint64_t xz_crc64(const uint8_t *buf, size_t size, uint64_t crc); +#endif + #ifdef __cplusplus } #endif Modified: head/sys/contrib/xz-embedded/linux/lib/decompress_unxz.c ============================================================================== --- head/sys/contrib/xz-embedded/linux/lib/decompress_unxz.c Wed Mar 5 01:17:47 2014 (r262763) +++ head/sys/contrib/xz-embedded/linux/lib/decompress_unxz.c Wed Mar 5 01:33:15 2014 (r262764) @@ -83,7 +83,7 @@ * safety_margin = 128 + uncompressed_size * 8 / 32768 + 65536 * = 128 + (uncompressed_size >> 12) + 65536 * - * For comparision, according to arch/x86/boot/compressed/misc.c, the + * For comparison, according to arch/x86/boot/compressed/misc.c, the * equivalent formula for Deflate is this: * * safety_margin = 18 + (uncompressed_size >> 12) + 32768 Modified: head/sys/contrib/xz-embedded/linux/lib/xz/Kconfig ============================================================================== --- head/sys/contrib/xz-embedded/linux/lib/xz/Kconfig Wed Mar 5 01:17:47 2014 (r262763) +++ head/sys/contrib/xz-embedded/linux/lib/xz/Kconfig Wed Mar 5 01:33:15 2014 (r262764) @@ -6,42 +6,40 @@ config XZ_DEC the .xz file format as the container. For integrity checking, CRC32 is supported. See Documentation/xz.txt for more information. +if XZ_DEC + config XZ_DEC_X86 - bool "x86 BCJ filter decoder" if EXPERT - default y - depends on XZ_DEC + bool "x86 BCJ filter decoder" + default y if X86 select XZ_DEC_BCJ config XZ_DEC_POWERPC - bool "PowerPC BCJ filter decoder" if EXPERT - default y - depends on XZ_DEC + bool "PowerPC BCJ filter decoder" + default y if PPC select XZ_DEC_BCJ config XZ_DEC_IA64 - bool "IA-64 BCJ filter decoder" if EXPERT - default y - depends on XZ_DEC + bool "IA-64 BCJ filter decoder" + default y if IA64 select XZ_DEC_BCJ config XZ_DEC_ARM - bool "ARM BCJ filter decoder" if EXPERT - default y - depends on XZ_DEC + bool "ARM BCJ filter decoder" + default y if ARM select XZ_DEC_BCJ config XZ_DEC_ARMTHUMB - bool "ARM-Thumb BCJ filter decoder" if EXPERT - default y - depends on XZ_DEC + bool "ARM-Thumb BCJ filter decoder" + default y if (ARM && ARM_THUMB) select XZ_DEC_BCJ config XZ_DEC_SPARC - bool "SPARC BCJ filter decoder" if EXPERT - default y - depends on XZ_DEC + bool "SPARC BCJ filter decoder" + default y if SPARC select XZ_DEC_BCJ +endif + config XZ_DEC_BCJ bool default n Copied: head/sys/contrib/xz-embedded/linux/lib/xz/xz_crc64.c (from r262756, vendor/xz-embedded/dist/linux/lib/xz/xz_crc64.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/xz-embedded/linux/lib/xz/xz_crc64.c Wed Mar 5 01:33:15 2014 (r262764, copy of r262756, vendor/xz-embedded/dist/linux/lib/xz/xz_crc64.c) @@ -0,0 +1,50 @@ +/* + * CRC64 using the polynomial from ECMA-182 + * + * This file is similar to xz_crc32.c. See the comments there. + * + * Authors: Lasse Collin + * Igor Pavlov + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + */ + +#include "xz_private.h" + +#ifndef STATIC_RW_DATA +# define STATIC_RW_DATA static +#endif + +STATIC_RW_DATA uint64_t xz_crc64_table[256]; + +XZ_EXTERN void xz_crc64_init(void) +{ + const uint64_t poly = 0xC96C5795D7870F42; + + uint32_t i; + uint32_t j; + uint64_t r; + + for (i = 0; i < 256; ++i) { + r = i; + for (j = 0; j < 8; ++j) + r = (r >> 1) ^ (poly & ~((r & 1) - 1)); + + xz_crc64_table[i] = r; + } + + return; +} + +XZ_EXTERN uint64_t xz_crc64(const uint8_t *buf, size_t size, uint64_t crc) +{ + crc = ~crc; + + while (size != 0) { + crc = xz_crc64_table[*buf++ ^ (crc & 0xFF)] ^ (crc >> 8); + --size; + } + + return ~crc; +} Modified: head/sys/contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c ============================================================================== --- head/sys/contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c Wed Mar 5 01:17:47 2014 (r262763) +++ head/sys/contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c Wed Mar 5 01:33:15 2014 (r262764) @@ -10,6 +10,12 @@ #include "xz_private.h" #include "xz_stream.h" +#ifdef XZ_USE_CRC64 +# define IS_CRC64(check_type) ((check_type) == XZ_CHECK_CRC64) +#else +# define IS_CRC64(check_type) false +#endif + /* Hash used to validate the Index field */ struct xz_dec_hash { vli_type unpadded; @@ -42,8 +48,13 @@ struct xz_dec { size_t in_start; size_t out_start; +#ifdef XZ_USE_CRC64 + /* CRC32 or CRC64 value in Block or CRC32 value in Index */ + uint64_t crc; +#else /* CRC32 value in Block or Index */ - uint32_t crc32; + uint32_t crc; +#endif /* Type of the integrity check calculated from uncompressed data */ enum xz_check check_type; @@ -208,8 +219,8 @@ static enum xz_ret dec_vli(struct xz_dec * the observed compressed and uncompressed sizes of the Block so that * they don't exceed the values possibly stored in the Block Header * (validation assumes that no integer overflow occurs, since vli_type - * is normally uint64_t). Update the CRC32 if presence of the CRC32 - * field was indicated in Stream Header. + * is normally uint64_t). Update the CRC32 or CRC64 value if presence of + * the CRC32 or CRC64 field was indicated in Stream Header. * * Once the decoding is finished, validate that the observed sizes match * the sizes possibly stored in the Block Header. Update the hash and @@ -242,8 +253,13 @@ static enum xz_ret dec_block(struct xz_d return XZ_DATA_ERROR; if (s->check_type == XZ_CHECK_CRC32) - s->crc32 = xz_crc32(b->out + s->out_start, - b->out_pos - s->out_start, s->crc32); + s->crc = xz_crc32(b->out + s->out_start, + b->out_pos - s->out_start, s->crc); +#ifdef XZ_USE_CRC64 + else if (s->check_type == XZ_CHECK_CRC64) + s->crc = xz_crc64(b->out + s->out_start, + b->out_pos - s->out_start, s->crc); +#endif if (ret == XZ_STREAM_END) { if (s->block_header.compressed != VLI_UNKNOWN @@ -264,6 +280,8 @@ static enum xz_ret dec_block(struct xz_d #else if (s->check_type == XZ_CHECK_CRC32) s->block.hash.unpadded += 4; + else if (IS_CRC64(s->check_type)) + s->block.hash.unpadded += 8; #endif s->block.hash.uncompressed += s->block.uncompressed; @@ -282,7 +300,7 @@ static void index_update(struct xz_dec * { size_t in_used = b->in_pos - s->in_start; s->index.size += in_used; - s->crc32 = xz_crc32(b->in + s->in_start, in_used, s->crc32); + s->crc = xz_crc32(b->in + s->in_start, in_used, s->crc); } /* @@ -340,23 +358,25 @@ static enum xz_ret dec_index(struct xz_d } /* - * Validate that the next four input bytes match the value of s->crc32. - * s->pos must be zero when starting to validate the first byte. + * Validate that the next four or eight input bytes match the value + * of s->crc. s->pos must be zero when starting to validate the first byte. + * The "bits" argument allows using the same code for both CRC32 and CRC64. */ -static enum xz_ret crc32_validate(struct xz_dec *s, struct xz_buf *b) +static enum xz_ret crc_validate(struct xz_dec *s, struct xz_buf *b, + uint32_t bits) { do { if (b->in_pos == b->in_size) return XZ_OK; - if (((s->crc32 >> s->pos) & 0xFF) != b->in[b->in_pos++]) + if (((s->crc >> s->pos) & 0xFF) != b->in[b->in_pos++]) return XZ_DATA_ERROR; s->pos += 8; - } while (s->pos < 32); + } while (s->pos < bits); - s->crc32 = 0; + s->crc = 0; s->pos = 0; return XZ_STREAM_END; @@ -397,10 +417,11 @@ static enum xz_ret dec_stream_header(str return XZ_OPTIONS_ERROR; /* - * Of integrity checks, we support only none (Check ID = 0) and - * CRC32 (Check ID = 1). However, if XZ_DEC_ANY_CHECK is defined, - * we will accept other check types too, but then the check won't - * be verified and a warning (XZ_UNSUPPORTED_CHECK) will be given. + * Of integrity checks, we support none (Check ID = 0), + * CRC32 (Check ID = 1), and optionally CRC64 (Check ID = 4). + * However, if XZ_DEC_ANY_CHECK is defined, we will accept other + * check types too, but then the check won't be verified and + * a warning (XZ_UNSUPPORTED_CHECK) will be given. */ s->check_type = s->temp.buf[HEADER_MAGIC_SIZE + 1]; @@ -408,10 +429,10 @@ static enum xz_ret dec_stream_header(str if (s->check_type > XZ_CHECK_MAX) return XZ_OPTIONS_ERROR; - if (s->check_type > XZ_CHECK_CRC32) + if (s->check_type > XZ_CHECK_CRC32 && !IS_CRC64(s->check_type)) return XZ_UNSUPPORTED_CHECK; #else - if (s->check_type > XZ_CHECK_CRC32) + if (s->check_type > XZ_CHECK_CRC32 && !IS_CRC64(s->check_type)) return XZ_OPTIONS_ERROR; #endif @@ -645,7 +666,12 @@ static enum xz_ret dec_main(struct xz_de case SEQ_BLOCK_CHECK: if (s->check_type == XZ_CHECK_CRC32) { - ret = crc32_validate(s, b); + ret = crc_validate(s, b, 32); + if (ret != XZ_STREAM_END) + return ret; + } + else if (IS_CRC64(s->check_type)) { + ret = crc_validate(s, b, 64); if (ret != XZ_STREAM_END) return ret; } @@ -688,7 +714,7 @@ static enum xz_ret dec_main(struct xz_de s->sequence = SEQ_INDEX_CRC32; case SEQ_INDEX_CRC32: - ret = crc32_validate(s, b); + ret = crc_validate(s, b, 32); if (ret != XZ_STREAM_END) return ret; @@ -802,7 +828,7 @@ XZ_EXTERN void xz_dec_reset(struct xz_de s->sequence = SEQ_STREAM_HEADER; s->allow_buf_error = false; s->pos = 0; - s->crc32 = 0; + s->crc = 0; memzero(&s->block, sizeof(s->block)); memzero(&s->index, sizeof(s->index)); s->temp.pos = 0; Modified: head/sys/contrib/xz-embedded/linux/scripts/xz_wrap.sh ============================================================================== --- head/sys/contrib/xz-embedded/linux/scripts/xz_wrap.sh Wed Mar 5 01:17:47 2014 (r262763) +++ head/sys/contrib/xz-embedded/linux/scripts/xz_wrap.sh Wed Mar 5 01:33:15 2014 (r262764) @@ -12,8 +12,8 @@ BCJ= LZMA2OPTS= -case $ARCH in - x86|x86_64) BCJ=--x86 ;; +case $SRCARCH in + x86) BCJ=--x86 ;; powerpc) BCJ=--powerpc ;; ia64) BCJ=--ia64; LZMA2OPTS=pb=4 ;; arm) BCJ=--arm ;; Modified: head/sys/contrib/xz-embedded/userspace/Makefile ============================================================================== --- head/sys/contrib/xz-embedded/userspace/Makefile Wed Mar 5 01:17:47 2014 (r262763) +++ head/sys/contrib/xz-embedded/userspace/Makefile Wed Mar 5 01:33:15 2014 (r262764) @@ -10,11 +10,11 @@ CC = gcc -std=gnu89 BCJ_CPPFLAGS = -DXZ_DEC_X86 -DXZ_DEC_POWERPC -DXZ_DEC_IA64 \ -DXZ_DEC_ARM -DXZ_DEC_ARMTHUMB -DXZ_DEC_SPARC -CPPFLAGS = -DXZ_DEC_ANY_CHECK +CPPFLAGS = -DXZ_USE_CRC64 -DXZ_DEC_ANY_CHECK CFLAGS = -ggdb3 -O2 -pedantic -Wall -Wextra RM = rm -f VPATH = ../linux/include/linux ../linux/lib/xz -COMMON_SRCS = xz_crc32.c xz_dec_stream.c xz_dec_lzma2.c xz_dec_bcj.c +COMMON_SRCS = xz_crc32.c xz_crc64.c xz_dec_stream.c xz_dec_lzma2.c xz_dec_bcj.c COMMON_OBJS = $(COMMON_SRCS:.c=.o) XZMINIDEC_OBJS = xzminidec.o BYTETEST_OBJS = bytetest.o Modified: head/sys/contrib/xz-embedded/userspace/boottest.c ============================================================================== --- head/sys/contrib/xz-embedded/userspace/boottest.c Wed Mar 5 01:17:47 2014 (r262763) +++ head/sys/contrib/xz-embedded/userspace/boottest.c Wed Mar 5 01:33:15 2014 (r262764) @@ -19,6 +19,9 @@ static void error(/*const*/ char *msg) fprintf(stderr, "%s\n", msg); } +/* Disable the CRC64 support even if it was enabled in the Makefile. */ +#undef XZ_USE_CRC64 + #include "../linux/lib/decompress_unxz.c" static uint8_t in[1024 * 1024]; Copied: head/sys/contrib/xz-embedded/userspace/bytetest.c (from r262756, vendor/xz-embedded/dist/userspace/bytetest.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/xz-embedded/userspace/bytetest.c Wed Mar 5 01:33:15 2014 (r262764, copy of r262756, vendor/xz-embedded/dist/userspace/bytetest.c) @@ -0,0 +1,135 @@ +/* + * Lazy test for the case when the output size is known + * + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + */ + +#include +#include +#include +#include +#include "xz.h" + +static uint8_t in[1]; +static uint8_t out[BUFSIZ]; + +int main(int argc, char **argv) +{ + struct xz_buf b; + struct xz_dec *s; + enum xz_ret ret; + const char *msg; + size_t uncomp_size; + + if (argc != 2) { + fputs("Give uncompressed size as the argument", stderr); + return 1; + } + + uncomp_size = atoi(argv[1]); + + xz_crc32_init(); + + /* + * Support up to 64 MiB dictionary. The actually needed memory + * is allocated once the headers have been parsed. + */ + s = xz_dec_init(XZ_DYNALLOC, 1 << 26); + if (s == NULL) { + msg = "Memory allocation failed\n"; + goto error; + } + + b.in = in; + b.in_pos = 0; + b.in_size = 0; + b.out = out; + b.out_pos = 0; + b.out_size = uncomp_size < BUFSIZ ? uncomp_size : BUFSIZ; + + while (true) { + if (b.in_pos == b.in_size) { + b.in_size = fread(in, 1, sizeof(in), stdin); + b.in_pos = 0; + } + + ret = xz_dec_run(s, &b); + + if (b.out_pos == sizeof(out)) { + if (fwrite(out, 1, b.out_pos, stdout) != b.out_pos) { + msg = "Write error\n"; + goto error; + } + + uncomp_size -= b.out_pos; + b.out_pos = 0; + b.out_size = uncomp_size < BUFSIZ + ? uncomp_size : BUFSIZ; + } + + if (ret == XZ_OK) + continue; + +#ifdef XZ_DEC_ANY_CHECK + if (ret == XZ_UNSUPPORTED_CHECK) { + fputs(argv[0], stderr); + fputs(": ", stderr); + fputs("Unsupported check; not verifying " + "file integrity\n", stderr); + continue; + } +#endif + + if (uncomp_size != b.out_pos) { + msg = "Uncompressed size doesn't match\n"; + goto error; + } + + if (fwrite(out, 1, b.out_pos, stdout) != b.out_pos + || fclose(stdout)) { + msg = "Write error\n"; + goto error; + } + + switch (ret) { + case XZ_STREAM_END: + xz_dec_end(s); + return 0; + + case XZ_MEM_ERROR: + msg = "Memory allocation failed\n"; + goto error; + + case XZ_MEMLIMIT_ERROR: + msg = "Memory usage limit reached\n"; + goto error; + + case XZ_FORMAT_ERROR: + msg = "Not a .xz file\n"; + goto error; + + case XZ_OPTIONS_ERROR: + msg = "Unsupported options in the .xz headers\n"; + goto error; + + case XZ_DATA_ERROR: + case XZ_BUF_ERROR: + msg = "File is corrupt\n"; + goto error; + + default: + msg = "Bug!\n"; + goto error; + } + } + +error: + xz_dec_end(s); + fputs(argv[0], stderr); + fputs(": ", stderr); + fputs(msg, stderr); + return 1; +} Modified: head/sys/contrib/xz-embedded/userspace/xz_config.h ============================================================================== --- head/sys/contrib/xz-embedded/userspace/xz_config.h Wed Mar 5 01:17:47 2014 (r262763) +++ head/sys/contrib/xz-embedded/userspace/xz_config.h Wed Mar 5 01:33:15 2014 (r262764) @@ -10,6 +10,9 @@ #ifndef XZ_CONFIG_H #define XZ_CONFIG_H +/* Uncomment to enable CRC64 support. */ +/* #define XZ_USE_CRC64 */ + /* Uncomment as needed to enable BCJ filter decoders. */ /* #define XZ_DEC_X86 */ /* #define XZ_DEC_POWERPC */ @@ -18,7 +21,19 @@ /* #define XZ_DEC_ARMTHUMB */ /* #define XZ_DEC_SPARC */ -#include +/* + * MSVC doesn't support modern C but XZ Embedded is mostly C89 + * so these are enough. + */ +#ifdef _MSC_VER +typedef unsigned char bool; +# define true 1 +# define false 0 +# define inline __inline +#else +# include +#endif + #include #include Modified: head/sys/contrib/xz-embedded/userspace/xzminidec.c ============================================================================== --- head/sys/contrib/xz-embedded/userspace/xzminidec.c Wed Mar 5 01:17:47 2014 (r262763) +++ head/sys/contrib/xz-embedded/userspace/xzminidec.c Wed Mar 5 01:33:15 2014 (r262764) @@ -37,6 +37,9 @@ int main(int argc, char **argv) } xz_crc32_init(); +#ifdef XZ_USE_CRC64 + xz_crc64_init(); +#endif /* * Support up to 64 MiB dictionary. The actually needed memory From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 01:41:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A4DFE9B; Wed, 5 Mar 2014 01:41:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 47066A77; Wed, 5 Mar 2014 01:41:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s251fBnj027853; Wed, 5 Mar 2014 01:41:11 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s251fB19027852; Wed, 5 Mar 2014 01:41:11 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403050141.s251fB19027852@svn.freebsd.org> From: Eitan Adler Date: Wed, 5 Mar 2014 01:41:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262766 - head/tools/tools/iwn/iwnstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 01:41:11 -0000 Author: eadler Date: Wed Mar 5 01:41:10 2014 New Revision: 262766 URL: http://svnweb.freebsd.org/changeset/base/262766 Log: If the device doesn't exist when iwnstats starts running don't spam the console forever. Modified: head/tools/tools/iwn/iwnstats/main.c Modified: head/tools/tools/iwn/iwnstats/main.c ============================================================================== --- head/tools/tools/iwn/iwnstats/main.c Wed Mar 5 01:34:10 2014 (r262765) +++ head/tools/tools/iwn/iwnstats/main.c Wed Mar 5 01:41:10 2014 (r262766) @@ -29,6 +29,7 @@ * $FreeBSD$ */ +#include #include #include #include @@ -267,6 +268,7 @@ main(int argc, char *argv[]) struct iwnstats *is; int ch; char *ifname; + bool first; ifname = strdup(IWN_DEFAULT_IF); @@ -296,9 +298,12 @@ main(int argc, char *argv[]) } /* begin fetching data */ + first = true; while (1) { if (iwn_collect(is) != 0) { fprintf(stderr, "%s: fetch failed\n", argv[0]); + if (first) + return 1; goto next; } @@ -306,6 +311,7 @@ main(int argc, char *argv[]) next: usleep(100 * 1000); + first = false; } exit(0); From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 01:47:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86A1D1B6; Wed, 5 Mar 2014 01:47:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 736D5B1C; Wed, 5 Mar 2014 01:47:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s251l9oK028561; Wed, 5 Mar 2014 01:47:09 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s251l9YJ028559; Wed, 5 Mar 2014 01:47:09 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403050147.s251l9YJ028559@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 5 Mar 2014 01:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262767 - in head: sys/net usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 01:47:09 -0000 Author: glebius Date: Wed Mar 5 01:47:08 2014 New Revision: 262767 URL: http://svnweb.freebsd.org/changeset/base/262767 Log: Hide struct rtentry from userland. Modified: head/sys/net/route.h head/usr.bin/netstat/route.c Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Wed Mar 5 01:41:10 2014 (r262766) +++ head/sys/net/route.h Wed Mar 5 01:47:08 2014 (r262767) @@ -105,6 +105,8 @@ struct mbuf; #include #endif #endif + +#if defined(_KERNEL) || defined(_WANT_RTENTRY) struct rtentry { struct radix_node rt_nodes[2]; /* tree glue, and other values */ /* @@ -127,6 +129,7 @@ struct rtentry { counter_u64_t rt_pksent; /* packets sent using this route */ struct mtx rt_mtx; /* mutex for routing entry */ }; +#endif /* _KERNEL || _WANT_RTENTRY */ /* * Following structure necessary for 4.3 compatibility; Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Wed Mar 5 01:41:10 2014 (r262766) +++ head/usr.bin/netstat/route.c Wed Mar 5 01:47:08 2014 (r262767) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _WANT_RTENTRY #include #include From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 01:49:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71E07321; Wed, 5 Mar 2014 01:49:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F272B28; Wed, 5 Mar 2014 01:49:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s251neOD028843; Wed, 5 Mar 2014 01:49:40 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s251neK6028842; Wed, 5 Mar 2014 01:49:40 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403050149.s251neK6028842@svn.freebsd.org> From: Eitan Adler Date: Wed, 5 Mar 2014 01:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262768 - head/tools/tools/iwn/iwnstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 01:49:40 -0000 Author: eadler Date: Wed Mar 5 01:49:39 2014 New Revision: 262768 URL: http://svnweb.freebsd.org/changeset/base/262768 Log: Add static where appropriate. Modified: head/tools/tools/iwn/iwnstats/main.c Modified: head/tools/tools/iwn/iwnstats/main.c ============================================================================== --- head/tools/tools/iwn/iwnstats/main.c Wed Mar 5 01:47:08 2014 (r262767) +++ head/tools/tools/iwn/iwnstats/main.c Wed Mar 5 01:49:39 2014 (r262768) @@ -49,7 +49,7 @@ #define IWN_DEFAULT_IF "iwn0" -struct iwnstats * +static struct iwnstats * iwnstats_new(const char *ifname) { struct iwnstats *is; From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 02:10:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86AF185B; Wed, 5 Mar 2014 02:10:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7450ECE1; Wed, 5 Mar 2014 02:10:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s252ABsN037446; Wed, 5 Mar 2014 02:10:11 GMT (envelope-from brd@svn.freebsd.org) Received: (from brd@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s252ABhB037445; Wed, 5 Mar 2014 02:10:11 GMT (envelope-from brd@svn.freebsd.org) Message-Id: <201403050210.s252ABhB037445@svn.freebsd.org> From: Brad Davis Date: Wed, 5 Mar 2014 02:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262769 - head/usr.bin/logger X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 02:10:11 -0000 Author: brd (doc committer) Date: Wed Mar 5 02:10:10 2014 New Revision: 262769 URL: http://svnweb.freebsd.org/changeset/base/262769 Log: - Clarify usage of the -f option. Reviewed by: gjb@, dru@, and Allan Jude Modified: head/usr.bin/logger/logger.1 Modified: head/usr.bin/logger/logger.1 ============================================================================== --- head/usr.bin/logger/logger.1 Wed Mar 5 01:49:39 2014 (r262768) +++ head/usr.bin/logger/logger.1 Wed Mar 5 02:10:10 2014 (r262769) @@ -28,7 +28,7 @@ .\" @(#)logger.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd August 2, 2006 +.Dd March 4, 2014 .Dt LOGGER 1 .Os .Sh NAME @@ -74,7 +74,7 @@ with each line. .It Fl s Log the message to standard error, as well as the system log. .It Fl f Ar file -Log the specified file. +Read the contents of the specified file into syslog. .It Fl h Ar host Send the message to the remote system .Ar host From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 02:35:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0314DC4; Wed, 5 Mar 2014 02:35:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E4E44F03; Wed, 5 Mar 2014 02:35:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s252ZFtq048543; Wed, 5 Mar 2014 02:35:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s252ZFea048542; Wed, 5 Mar 2014 02:35:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403050235.s252ZFea048542@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 5 Mar 2014 02:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262770 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 02:35:16 -0000 Author: glebius Date: Wed Mar 5 02:35:15 2014 New Revision: 262770 URL: http://svnweb.freebsd.org/changeset/base/262770 Log: Pacify gcc. Modified: head/sys/net/flowtable.c Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Wed Mar 5 02:10:10 2014 (r262769) +++ head/sys/net/flowtable.c Wed Mar 5 02:35:15 2014 (r262770) @@ -772,6 +772,7 @@ flowtable_free_stale(struct flowtable *f tmpsize = ft->ft_size; memcpy(tmpmask, mask, ft->ft_size/8); curbit = 0; + fleprev = NULL; /* pacify gcc */ /* * XXX Note to self, bit_ffs operates at the byte level * and thus adds gratuitous overhead From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 02:35:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83FFC1FF; Wed, 5 Mar 2014 02:35:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 58BC5F07; Wed, 5 Mar 2014 02:35:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s252Zgff048622; Wed, 5 Mar 2014 02:35:42 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s252ZgkQ048621; Wed, 5 Mar 2014 02:35:42 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403050235.s252ZgkQ048621@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 5 Mar 2014 02:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262771 - head/sys/netatalk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 02:35:42 -0000 Author: glebius Date: Wed Mar 5 02:35:41 2014 New Revision: 262771 URL: http://svnweb.freebsd.org/changeset/base/262771 Log: Fix build. Modified: head/sys/netatalk/at_proto.c Modified: head/sys/netatalk/at_proto.c ============================================================================== --- head/sys/netatalk/at_proto.c Wed Mar 5 02:35:15 2014 (r262770) +++ head/sys/netatalk/at_proto.c Wed Mar 5 02:35:41 2014 (r262771) @@ -24,6 +24,7 @@ */ #include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 04:15:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 348F8CD7; Wed, 5 Mar 2014 04:15:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 22992B6A; Wed, 5 Mar 2014 04:15:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s254FIxA089513; Wed, 5 Mar 2014 04:15:18 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s254FH89089511; Wed, 5 Mar 2014 04:15:17 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201403050415.s254FH89089511@svn.freebsd.org> From: Mark Johnston Date: Wed, 5 Mar 2014 04:15:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262775 - head/sbin/savecore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 04:15:18 -0000 Author: markj Date: Wed Mar 5 04:15:17 2014 New Revision: 262775 URL: http://svnweb.freebsd.org/changeset/base/262775 Log: Log the name of the device that we failed to open rather than an uninitialized buffer. MFC after: 3 days Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Wed Mar 5 04:09:05 2014 (r262774) +++ head/sbin/savecore/savecore.c Wed Mar 5 04:15:17 2014 (r262775) @@ -618,7 +618,7 @@ DoFile(const char *savedir, const char * */ fdinfo = open(infoname, O_WRONLY | O_CREAT | O_TRUNC, 0600); if (fdinfo < 0) { - syslog(LOG_ERR, "%s: %m", buf); + syslog(LOG_ERR, "%s: %m", infoname); nerr++; goto closefd; } From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 04:18:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97709FB9; Wed, 5 Mar 2014 04:18:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 84E1BB8E; Wed, 5 Mar 2014 04:18:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s254IhTk089960; Wed, 5 Mar 2014 04:18:43 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s254IhaP089958; Wed, 5 Mar 2014 04:18:43 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201403050418.s254IhaP089958@svn.freebsd.org> From: Sean Bruno Date: Wed, 5 Mar 2014 04:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262776 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 04:18:43 -0000 Author: sbruno Date: Wed Mar 5 04:18:42 2014 New Revision: 262776 URL: http://svnweb.freebsd.org/changeset/base/262776 Log: Rename the Dlink 825 configuration file to indicate that this is for the mips 24k B1 Added: head/sys/mips/conf/DIR-825B1 - copied unchanged from r262775, head/sys/mips/conf/DIR-825 head/sys/mips/conf/DIR-825B1.hints - copied unchanged from r262775, head/sys/mips/conf/DIR-825.hints Deleted: head/sys/mips/conf/DIR-825 head/sys/mips/conf/DIR-825.hints Copied: head/sys/mips/conf/DIR-825B1 (from r262775, head/sys/mips/conf/DIR-825) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/DIR-825B1 Wed Mar 5 04:18:42 2014 (r262776, copy of r262775, head/sys/mips/conf/DIR-825) @@ -0,0 +1,71 @@ +# +# Specific board setup for the D-Link DIR-825 router. +# +# The DIR-825 has the following hardware: +# +# + AR7161 CPU SoC +# + AR9223 2.4GHz 11n +# + AR9220 5GHz 11n +# + RealTek RTL8366S Gigabit switch +# + m25p64 based 8MB flash +# + 64MB RAM +# + uboot environment + +# $FreeBSD$ + +include "AR71XX_BASE" +ident "DIR-825" +hints "DIR-825.hints" + +# Since the kernel image must fit inside 1024KiB, we have to build almost +# everything as modules. +nodevice random +nodevice gpio +nodevice gpioled +nodevice gif +nodevice gre +nodevice if_bridge +nodevice usb +nodevice ehci +nodevice wlan +nodevice wlan_xauth +nodevice wlan_acl +nodevice wlan_wep +nodevice wlan_tkip +nodevice wlan_ccmp +nodevice wlan_rssadapt +nodevice wlan_amrr +nodevice ath +nodevice ath_pci +nodevice ath_hal +nodevice umass +nodevice ath_rate_sample + +nooptions INET6 + +# Don't include the SCSI/CAM strings in the default build +options SCSI_NO_SENSE_STRINGS +options SCSI_NO_OP_STRINGS + +# .. And no sysctl strings +options NO_SYSCTL_DESCR + +# GEOM modules +device geom_map # to get access to the SPI flash partitions +device geom_uncompress # compressed in-memory filesystem hackery! +options GEOM_UNCOMPRESS +options GEOM_PART_GPT + +options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\" +options AR71XX_REALMEM=64*1024*1024 + +options AR71XX_ENV_UBOOT + +options MSDOSFS # Read MSDOS filesystems; useful for USB/CF + +# options MD_ROOT +# options MD_ROOT_SIZE="6144" + +options AR71XX_ATH_EEPROM # Fetch EEPROM/PCI config from flash +options ATH_EEPROM_FIRMWARE # Use EEPROM from flash +device firmware # Used by the above Copied: head/sys/mips/conf/DIR-825B1.hints (from r262775, head/sys/mips/conf/DIR-825.hints) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/DIR-825B1.hints Wed Mar 5 04:18:42 2014 (r262776, copy of r262775, head/sys/mips/conf/DIR-825.hints) @@ -0,0 +1,71 @@ +# $FreeBSD$ + +# arge0 is connected to the LAN side of the switch PHY. +# arge1 is connected to the single port WAN side of the switch PHY. + +hint.arge.0.phymask=0x0 +hint.arge.0.media=1000 +hint.arge.0.fduplex=1 +hint.arge.0.eeprommac=0x1f66ffa0 +hint.arge.0.readascii=1 + +hint.arge.1.phymask=0x0 +hint.arge.1.media=1000 +hint.arge.1.fduplex=1 +hint.arge.1.eeprommac=0x1f66ffb4 +hint.arge.1.readascii=1 + +# ath0 - slot 17 +hint.pcib.0.bus.0.17.0.ath_fixup_addr=0x1f661000 +hint.pcib.0.bus.0.17.0.ath_fixup_size=4096 + +# ath1 - slot 18 +hint.pcib.0.bus.0.18.0.ath_fixup_addr=0x1f665000 +hint.pcib.0.bus.0.18.0.ath_fixup_size=4096 + +# .. and now, telling each ath(4) NIC where to find the firmware +# image. +hint.ath.0.eeprom_firmware="pcib.0.bus.0.17.0.eeprom_firmware" +hint.ath.1.eeprom_firmware="pcib.0.bus.0.18.0.eeprom_firmware" + +# TODO: gpio LEDs + +# Geom MAP + +# The DIR-825 has an 8MB flash part - HOWEVER, the 64k caldata isn't +# at the end of the flash. It's ~ 6MB into the flash image. + +# mtdparts=ar7100-nor0:256k(uboot),64k(Config),1024k(vmlinux),5184k(rootfs),64k(caldata) + +hint.map.0.at="flash/spi0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x000040000 +hint.map.0.name="uboot" +hint.map.0.readonly=1 + +# This config partition is the D-Link specific configuration area. +# I'm re-purposing it for FreeBSD. +hint.map.1.at="flash/spi0" +hint.map.1.start=0x00040000 +hint.map.1.end=0x00050000 +hint.map.1.name="cfg" +hint.map.1.readonly=0 + +hint.map.2.at="flash/spi0" +hint.map.2.start=0x0050000 +hint.map.2.end=0x00150000 +hint.map.2.name="kernel" +hint.map.2.readonly=1 + +hint.map.3.at="flash/spi0" +hint.map.3.start=0x00150000 +hint.map.3.end=0x00660000 +hint.map.3.name="rootfs" +hint.map.3.readonly=0 + +hint.map.4.at="flash/spi0" +hint.map.4.start=0x00660000 +hint.map.4.end=0x00670000 +hint.map.4.name="art" +hint.map.4.readonly=1 + From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 04:19:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6328597; Wed, 5 Mar 2014 04:19:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D423EBA9; Wed, 5 Mar 2014 04:19:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s254JqQe090130; Wed, 5 Mar 2014 04:19:52 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s254JqBJ090127; Wed, 5 Mar 2014 04:19:52 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201403050419.s254JqBJ090127@svn.freebsd.org> From: Sean Bruno Date: Wed, 5 Mar 2014 04:19:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262777 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 04:19:53 -0000 Author: sbruno Date: Wed Mar 5 04:19:52 2014 New Revision: 262777 URL: http://svnweb.freebsd.org/changeset/base/262777 Log: Update location of hints and name of the kernel we are building. Modified: head/sys/mips/conf/DIR-825B1 head/sys/mips/conf/DIR-825B1.hints Modified: head/sys/mips/conf/DIR-825B1 ============================================================================== --- head/sys/mips/conf/DIR-825B1 Wed Mar 5 04:18:42 2014 (r262776) +++ head/sys/mips/conf/DIR-825B1 Wed Mar 5 04:19:52 2014 (r262777) @@ -1,7 +1,7 @@ # -# Specific board setup for the D-Link DIR-825 router. +# Specific board setup for the D-Link DIR-825B1 router. # -# The DIR-825 has the following hardware: +# The DIR-825B1 has the following hardware: # # + AR7161 CPU SoC # + AR9223 2.4GHz 11n @@ -14,8 +14,8 @@ # $FreeBSD$ include "AR71XX_BASE" -ident "DIR-825" -hints "DIR-825.hints" +ident "DIR-825B1" +hints "DIR-825B1.hints" # Since the kernel image must fit inside 1024KiB, we have to build almost # everything as modules. Modified: head/sys/mips/conf/DIR-825B1.hints ============================================================================== --- head/sys/mips/conf/DIR-825B1.hints Wed Mar 5 04:18:42 2014 (r262776) +++ head/sys/mips/conf/DIR-825B1.hints Wed Mar 5 04:19:52 2014 (r262777) @@ -32,7 +32,7 @@ hint.ath.1.eeprom_firmware="pcib.0.bus.0 # Geom MAP -# The DIR-825 has an 8MB flash part - HOWEVER, the 64k caldata isn't +# The DIR-825B1 has an 8MB flash part - HOWEVER, the 64k caldata isn't # at the end of the flash. It's ~ 6MB into the flash image. # mtdparts=ar7100-nor0:256k(uboot),64k(Config),1024k(vmlinux),5184k(rootfs),64k(caldata) From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 04:22:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0549D7AC; Wed, 5 Mar 2014 04:22:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB5E1C73; Wed, 5 Mar 2014 04:22:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s254M7De093370; Wed, 5 Mar 2014 04:22:07 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s254M77l093369; Wed, 5 Mar 2014 04:22:07 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201403050422.s254M77l093369@svn.freebsd.org> From: Sean Bruno Date: Wed, 5 Mar 2014 04:22:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262778 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 04:22:08 -0000 Author: sbruno Date: Wed Mar 5 04:22:07 2014 New Revision: 262778 URL: http://svnweb.freebsd.org/changeset/base/262778 Log: Populate the GPIO pins and GPIOLED configs Modified: head/sys/mips/conf/DIR-825B1.hints Modified: head/sys/mips/conf/DIR-825B1.hints ============================================================================== --- head/sys/mips/conf/DIR-825B1.hints Wed Mar 5 04:19:52 2014 (r262777) +++ head/sys/mips/conf/DIR-825B1.hints Wed Mar 5 04:22:07 2014 (r262778) @@ -28,14 +28,13 @@ hint.pcib.0.bus.0.18.0.ath_fixup_size=40 hint.ath.0.eeprom_firmware="pcib.0.bus.0.17.0.eeprom_firmware" hint.ath.1.eeprom_firmware="pcib.0.bus.0.18.0.eeprom_firmware" -# TODO: gpio LEDs - # Geom MAP # The DIR-825B1 has an 8MB flash part - HOWEVER, the 64k caldata isn't # at the end of the flash. It's ~ 6MB into the flash image. -# mtdparts=ar7100-nor0:256k(uboot),64k(Config),1024k(vmlinux),5184k(rootfs),64k(caldata) +# mtdparts=ar7100-nor0:256k(uboot),64k(Config),1024k(vmlinux),5184k(rootfs), +# 64k(caldata) hint.map.0.at="flash/spi0" hint.map.0.start=0x00000000 @@ -69,3 +68,73 @@ hint.map.4.end=0x00670000 hint.map.4.name="art" hint.map.4.readonly=1 +# GPIO specific configuration block + +# Don't flip on anything that isn't already enabled. +# This includes leaving the SPI CS1/CS2 pins as GPIO pins as they're +# not used here. +hint.gpio.0.function_set=0x00000000 + +hint.gpio.0.function_clear=0x00000000 + +# These are the GPIO LEDs and buttons which can be software controlled. +hint.gpio.0.pinmask=0x000009ff + +# Pin 1 - USB (LED blue) --> works +# Pin 2 - Power (LED orange) --> works +# Pin 3 - Power (LED blue) --> works +# Pin 4 - Button (RESET) --> works +# Pin 5 - WPS (LED blue) --> works +# Pin 6 - RTL8366RB switch data line +# Pin 7 - Planet (LED orange)--> works +# Pin 8 - RTL8366RB switch clock line +# Pin 9 - Button (WPS) --> works after set to high +# Pin 10 - N/C +# Pin 11 - N/C +# Pin 12 - Planet (LED blue) --> works + +# LEDs are configured separately and driven by the LED device +# usb tested good +hint.gpioled.0.at="gpiobus0" +hint.gpioled.0.name="usb-blue" +hint.gpioled.0.pins=0x0001 + +# no orange power led? +hint.gpioled.1.at="gpiobus0" +hint.gpioled.1.name="power-orange" +hint.gpioled.1.pins=0x0002 + +# blue power tested good +hint.gpioled.2.at="gpiobus0" +hint.gpioled.2.name="power-blue" +hint.gpioled.2.pins=0x0004 + +# wps tested good +hint.gpioled.3.at="gpiobus0" +hint.gpioled.3.name="wps-blue" +hint.gpioled.3.pins=0x0010 + +# orage globe tested good +hint.gpioled.4.at="gpiobus0" +hint.gpioled.4.name="planet-orange" +hint.gpioled.4.pins=0x0040 + +# no blue planet LED on this unit +hint.gpioled.5.at="gpiobus0" +hint.gpioled.5.name="planet-blue" +hint.gpioled.5.pins=0x0800 + +# GPIO I2C bus +hint.gpioiic.0.at="gpiobus0" +hint.gpioiic.0.pins=0x00a0 +hint.gpioiic.0.sda=0 +hint.gpioiic.0.scl=1 + +# I2C bus +# Don't be strict about I2C protocol - the relaxed semantics are required +# by the realtek switch PHY. +hint.iicbus.0.strict=0 + +# Bit bang bus - override default delay +#hint.iicbb.0.udelay=3 + From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 08:33:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5308EFA; Wed, 5 Mar 2014 08:33:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D224FA3F; Wed, 5 Mar 2014 08:33:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s258XwF7093934; Wed, 5 Mar 2014 08:33:58 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s258XwWS093933; Wed, 5 Mar 2014 08:33:58 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201403050833.s258XwWS093933@svn.freebsd.org> From: Peter Holm Date: Wed, 5 Mar 2014 08:33:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262781 - head/tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 08:33:59 -0000 Author: pho Date: Wed Mar 5 08:33:58 2014 New Revision: 262781 URL: http://svnweb.freebsd.org/changeset/base/262781 Log: Preserve naming consistency for test cases. Pointed out by: jmmv Sponsored by: EMC / Isilon storage division Modified: head/tests/sys/kern/kern_descrip_test.c Modified: head/tests/sys/kern/kern_descrip_test.c ============================================================================== --- head/tests/sys/kern/kern_descrip_test.c Wed Mar 5 04:27:15 2014 (r262780) +++ head/tests/sys/kern/kern_descrip_test.c Wed Mar 5 08:33:58 2014 (r262781) @@ -37,8 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include -ATF_TC_WITHOUT_HEAD(dup2_simple); -ATF_TC_BODY(dup2_simple, tc) +ATF_TC_WITHOUT_HEAD(dup2__simple); +ATF_TC_BODY(dup2__simple, tc) { int fd1, fd2; struct stat sb1, sb2; @@ -71,7 +71,7 @@ ATF_TC_BODY(dup2__ebadf_when_2nd_arg_out ATF_TP_ADD_TCS(tp) { - ATF_TP_ADD_TC(tp, dup2_simple); + ATF_TP_ADD_TC(tp, dup2__simple); ATF_TP_ADD_TC(tp, dup2__ebadf_when_2nd_arg_out_of_range); return atf_no_error(); From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 11:54:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0711847; Wed, 5 Mar 2014 11:54:11 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3CD10E2E; Wed, 5 Mar 2014 11:54:11 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id s25Bs2Rx000832; Wed, 5 Mar 2014 13:54:02 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s25Bs2Rx000832 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id s25Bs2t0000831; Wed, 5 Mar 2014 13:54:02 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 5 Mar 2014 13:54:02 +0200 From: Konstantin Belousov To: Ian Lepore Subject: Re: svn commit: r262411 - head/sys/arm/arm Message-ID: <20140305115402.GC24664@kib.kiev.ua> References: <201402232252.s1NMqmI5075701@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xhQBShgGdvjvx42z" Content-Disposition: inline In-Reply-To: <201402232252.s1NMqmI5075701@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 11:54:11 -0000 --xhQBShgGdvjvx42z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 23, 2014 at 10:52:48PM +0000, Ian Lepore wrote: > Author: ian > Date: Sun Feb 23 22:52:48 2014 > New Revision: 262411 > URL: http://svnweb.freebsd.org/changeset/base/262411 >=20 > Log: > If the L2 cache type is PIPT, pass a physical address for a flush. > =20 > While this is technically more correct, I don't think it much matters, > because the only thing in the tree that calls cpu_flush_dcache() is md(= 4) > and I'm > 99% sure it's bogus that it does so; md has no ability to do > anything that can perturb data cache coherency. Yes, md(4) does not break data cache coherency, but I think that Marcel added the flush to ensure instruction cache coherency. The intent was to ensure that harward-architecture machines would see up-to-date memory content when fetching instructions after read on md(4). --xhQBShgGdvjvx42z Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJTFxBZAAoJEJDCuSvBvK1BLHEP/1P19Nj8Ix+PFP74iAdLbrJT PiWbqdSFz7CKCOO01IqAtk5z4uTt8ZryBvqy7TQjG0SY9eKE5nQBJIe1GI38rT1p G10M95a+UVjon574HtmpGRYqejMy2eemKlwwA71H44OOQQ2SJqCtxY6k+5YE2DU+ N7VSLAeA0Bt+BwDRLMH4VnC4HCfk8vEqrXEXX2SzTUQwkWW0XjwaEXatjfgrX2cU NiKh7l58JXWvz0rBDDcg1lknI1+Ew0gIA+MLCTAYyLaeNsfLA5CRy5epT2X9fOvX +ZlPOaxx50XeO+IQvCDky+/ZdyDKje/Rrwz9kNNI2P9lHwU2CTzjo6tVazulZzFl Pt29cI9TwChtDgsRy+IByCk7aXfolZZ5HMyO6ORUrS8etzKxIpz3M14fwCV9KHy7 PWdqkhfKvrfzVUaaGEufReRd/Y69fmKHYPwVq+A3CjWxvB73+aGEXVnRJ5CGZvOf fy3uV0CsqsJyOZ1UjvCOqg83MrTpUEqs4yEkfFFEvE7V5e9qIru4whzSccwMN330 ldKUAK9JZe7+jOIJ6bfcIEhAEPym3i3ofmANuxdicvCy4QvACyOUvh6i5ZglzSaP O3xxPQritLcjAT/ILKLyUHCdXggC/I1wfImf5Yc8MUOIAS84ZpZMoNEjMuadwNx2 3gDDm7CVlhWpMnzYz2i8 =eq31 -----END PGP SIGNATURE----- --xhQBShgGdvjvx42z-- From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 12:02:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 514ECDB8; Wed, 5 Mar 2014 12:02:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3DC69F30; Wed, 5 Mar 2014 12:02:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s25C2Une081592; Wed, 5 Mar 2014 12:02:30 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s25C2UkP081591; Wed, 5 Mar 2014 12:02:30 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403051202.s25C2UkP081591@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 5 Mar 2014 12:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262782 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 12:02:30 -0000 Author: trasz Date: Wed Mar 5 12:02:29 2014 New Revision: 262782 URL: http://svnweb.freebsd.org/changeset/base/262782 Log: Fix missing unlock in persistent reservations code, which resulted in panics with Hyper-V Failover Cluster. Reviewed by: ken@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Mar 5 08:33:58 2014 (r262781) +++ head/sys/cam/ctl/ctl.c Wed Mar 5 12:02:29 2014 (r262782) @@ -8071,6 +8071,7 @@ ctl_persistent_reserve_out(struct ctl_sc ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); } + mtx_unlock(&softc->ctl_lock); } else /* create a reservation */ { /* * If it's not an "all registrants" type record From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 13:22:58 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 178296C6; Wed, 5 Mar 2014 13:22:58 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DDE4F920; Wed, 5 Mar 2014 13:22:57 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WLBmd-000MfS-CA; Wed, 05 Mar 2014 13:22:51 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s25DMmpe049328; Wed, 5 Mar 2014 06:22:48 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/r4bef9J1SABWAKS+By9OM Subject: Re: svn commit: r262411 - head/sys/arm/arm From: Ian Lepore To: Konstantin Belousov In-Reply-To: <20140305115402.GC24664@kib.kiev.ua> References: <201402232252.s1NMqmI5075701@svn.freebsd.org> <20140305115402.GC24664@kib.kiev.ua> Content-Type: text/plain; charset="us-ascii" Date: Wed, 05 Mar 2014 06:22:47 -0700 Message-ID: <1394025767.1149.327.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 13:22:58 -0000 On Wed, 2014-03-05 at 13:54 +0200, Konstantin Belousov wrote: > On Sun, Feb 23, 2014 at 10:52:48PM +0000, Ian Lepore wrote: > > Author: ian > > Date: Sun Feb 23 22:52:48 2014 > > New Revision: 262411 > > URL: http://svnweb.freebsd.org/changeset/base/262411 > > > > Log: > > If the L2 cache type is PIPT, pass a physical address for a flush. > > > > While this is technically more correct, I don't think it much matters, > > because the only thing in the tree that calls cpu_flush_dcache() is md(4) > > and I'm > 99% sure it's bogus that it does so; md has no ability to do > > anything that can perturb data cache coherency. > > Yes, md(4) does not break data cache coherency, but I think that > Marcel added the flush to ensure instruction cache coherency. The > intent was to ensure that harward-architecture machines would > see up-to-date memory content when fetching instructions after > read on md(4). Oh. If that's necessary on ia64, it seems like ia64/elf_machdep.c would be the place to do the flush. -- Ian From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 14:10:32 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C272FAD5; Wed, 5 Mar 2014 14:10:32 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9564ECCF; Wed, 5 Mar 2014 14:10:32 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WLCWl-0007D6-Af; Wed, 05 Mar 2014 14:10:31 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s25EATOL049368; Wed, 5 Mar 2014 07:10:29 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+uZk52UGq64dJPxA+77bMB Subject: Re: svn commit: r262760 - in head: sbin/pfctl sys/net sys/netpfil/pf From: Ian Lepore To: Gleb Smirnoff In-Reply-To: <201403050040.s250e32v098454@svn.freebsd.org> References: <201403050040.s250e32v098454@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Wed, 05 Mar 2014 07:10:28 -0700 Message-ID: <1394028628.1149.329.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 14:10:32 -0000 On Wed, 2014-03-05 at 00:40 +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Wed Mar 5 00:40:03 2014 > New Revision: 262760 > URL: http://svnweb.freebsd.org/changeset/base/262760 > > Log: > Instead of playing games with casts simply add 3 more members to the > structure pf_rule, that are used when the structure is passed via > ioctl(). > > PR: 187074 > > Modified: > head/sbin/pfctl/pfctl.c > head/sys/net/pfvar.h > head/sys/netpfil/pf/pf_ioctl.c This is causing build failures on 32-bit platforms (%lu with uint64_t values). -- Ian From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 14:37:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 644FE378; Wed, 5 Mar 2014 14:37:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 43E4FF98; Wed, 5 Mar 2014 14:37:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s25EbkHE042211; Wed, 5 Mar 2014 14:37:46 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s25EbkPv042210; Wed, 5 Mar 2014 14:37:46 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201403051437.s25EbkPv042210@svn.freebsd.org> From: Aleksandr Rybalko Date: Wed, 5 Mar 2014 14:37:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262785 - head/sys/dev/vt/hw/efifb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 14:37:46 -0000 Author: ray Date: Wed Mar 5 14:37:45 2014 New Revision: 262785 URL: http://svnweb.freebsd.org/changeset/base/262785 Log: Add efifb driver. Driver uses the data passed by UEFI compatible loader/BIOS and enable to use framebuffer created by those loader. Added: head/sys/dev/vt/hw/efifb/ head/sys/dev/vt/hw/efifb/efifb.c (contents, props changed) Added: head/sys/dev/vt/hw/efifb/efifb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/vt/hw/efifb/efifb.c Wed Mar 5 14:37:45 2014 (r262785) @@ -0,0 +1,143 @@ +/*- + * Copyright (c) 2014 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Aleksandr Rybalko under sponsorship from the + * FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include "opt_platform.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +static vd_init_t vt_efb_init; + +static struct vt_driver vt_efb_driver = { + .vd_init = vt_efb_init, + .vd_blank = vt_fb_blank, + .vd_bitbltchr = vt_fb_bitbltchr, + /* Better than VGA, but still generic driver. */ + .vd_priority = VD_PRIORITY_GENERIC + 1, +}; + +static struct fb_info info; +VT_CONSDEV_DECLARE(vt_efb_driver, + MAX(80, PIXEL_WIDTH(VT_FB_DEFAULT_WIDTH)), + MAX(25, PIXEL_HEIGHT(VT_FB_DEFAULT_HEIGHT)), &info); + +static int +vt_efb_init(struct vt_device *vd) +{ + int depth, d, disable, i, len; + struct fb_info *info; + struct efi_fb *efifb; + caddr_t kmdp; + + info = vd->vd_softc; + + disable = 0; + TUNABLE_INT_FETCH("hw.syscons.disable", &disable); + if (disable != 0) + return (CN_DEAD); + + kmdp = preload_search_by_type("elf kernel"); + if (kmdp == NULL) + kmdp = preload_search_by_type("elf64 kernel"); + efifb = (struct efi_fb *)preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_EFI_FB); + if (!efifb->fb_present) + return (CN_DEAD); + + info->fb_height = efifb->fb_height; + info->fb_width = efifb->fb_width; + + depth = fls(efifb->fb_mask_red); + d = fls(efifb->fb_mask_green); + depth = d > depth ? d : depth; + d = fls(efifb->fb_mask_blue); + depth = d > depth ? d : depth; + d = fls(efifb->fb_mask_reserved); + depth = d > depth ? d : depth; + info->fb_depth = depth; + + info->fb_stride = efifb->fb_stride * (depth / 8); + + vt_generate_vga_palette(info->fb_cmap, COLOR_FORMAT_RGB, + efifb->fb_mask_red, ffs(efifb->fb_mask_red) - 1, + efifb->fb_mask_green, ffs(efifb->fb_mask_green) - 1, + efifb->fb_mask_blue, ffs(efifb->fb_mask_blue) - 1); + + info->fb_size = info->fb_height * info->fb_stride; + info->fb_pbase = efifb->fb_addr; + /* + * We could use pmap_mapdev here except that the kernel pmap + * hasn't been created yet and hence any attempt to lock it will + * fail. + */ + info->fb_vbase = PHYS_TO_DMAP(efifb->fb_addr); + + /* blank full size */ + len = info->fb_size / 4; + for (i = 0; i < len; i++) { + ((uint32_t *)info->fb_vbase)[i] = 0; + } + + /* Get pixel storage size. */ + info->fb_bpp = info->fb_stride / info->fb_width * 8; + + /* + * Early FB driver work with static window buffer, so reduce to minimal + * size, buffer or screen. + */ + info->fb_width = MIN(info->fb_width, VT_FB_DEFAULT_WIDTH); + info->fb_height = MIN(info->fb_height, VT_FB_DEFAULT_HEIGHT); + + fb_probe(info); + vt_fb_init(vd); + + + return (CN_INTERNAL); +} + From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 16:42:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA08EDEC; Wed, 5 Mar 2014 16:42:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B6213F65; Wed, 5 Mar 2014 16:42:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s25GgXrV093813; Wed, 5 Mar 2014 16:42:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s25GgXAM093812; Wed, 5 Mar 2014 16:42:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201403051642.s25GgXAM093812@svn.freebsd.org> From: Alexander Motin Date: Wed, 5 Mar 2014 16:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262789 - head/sys/dev/hyperv/storvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 16:42:33 -0000 Author: mav Date: Wed Mar 5 16:42:33 2014 New Revision: 262789 URL: http://svnweb.freebsd.org/changeset/base/262789 Log: Remove custom bus scanner code and fix use of CAM's default scanner. This fixes kernel panic during boot, caused by incompatibility of recent CAM locking changes and this bus scanner code. Submitted by: Microsoft MFC after: 1 week Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Mar 5 16:19:29 2014 (r262788) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Mar 5 16:42:33 2014 (r262789) @@ -171,15 +171,12 @@ static struct storvsc_driver_props g_drv STORVSC_RINGBUFFER_SIZE} }; -static struct storvsc_softc *hs_softc[HS_MAX_ADAPTERS]; - /* static functions */ static int storvsc_probe(device_t dev); static int storvsc_attach(device_t dev); static int storvsc_detach(device_t dev); static void storvsc_poll(struct cam_sim * sim); static void storvsc_action(struct cam_sim * sim, union ccb * ccb); -static void scan_for_luns(struct storvsc_softc * sc); static void create_storvsc_request(union ccb *ccb, struct hv_storvsc_request *reqp); static void storvsc_free_request(struct storvsc_softc *sc, struct hv_storvsc_request *reqp); static enum hv_storage_type storvsc_get_storage_type(device_t dev); @@ -669,84 +666,6 @@ hv_storvsc_on_channel_callback(void *con } /** - * @brief callback function for completing a single LUN scan - * - * This function is responsible for waking up the executer of - * the scan LUN CCB action (cam_periph_runccb.) cam_periph_ccbwait - * sleeps on the mutex being signaled. - * - * @param periph a pointer to a CAM peripheral - * @param done_ccb pointer to CAM control block - */ -static void -storvsc_xptdone(struct cam_periph *periph, union ccb *done_ccb) -{ - wakeup(&done_ccb->ccb_h.cbfcnp); -} - -/** - * @brief scan for attached logical unit numbers (LUNs) - * - * In Hyper-V there is no backend changed device operation which - * presents FreeBSD with a list of devices to connect. The result is - * that we have to scan for a list of luns in the storvsc_attach() - * routine. There is only one SCSI target, so scan for the maximum - * number of luns. - * - * @param pointer to softc - */ -static void -scan_for_luns(struct storvsc_softc *sc) -{ - union ccb *request_ccb; - struct cam_path *path = sc->hs_path; - struct cam_path *my_path = NULL; - cam_status status; - int lun_nb = 0; - int error; - - request_ccb = malloc(sizeof(union ccb), M_CAMXPT, M_WAITOK); - my_path = malloc(sizeof(*my_path), M_CAMXPT, M_WAITOK); - - mtx_lock(&sc->hs_lock); - do { - /* - * Scan the next LUN. Reuse path and ccb structs. - */ - bzero(my_path, sizeof(*my_path)); - bzero(request_ccb, sizeof(*request_ccb)); - status = xpt_compile_path(my_path, - xpt_periph, - path->bus->path_id, - 0, - lun_nb); - - if (status != CAM_REQ_CMP) { - mtx_unlock(&sc->hs_lock); - xpt_print(path, "scan_for_lunYYY: can't compile" - " path, 0x%p can't continue\n", - sc->hs_path); - free(request_ccb, M_CAMXPT); - free(my_path, M_CAMXPT); - return; - } - - xpt_setup_ccb(&request_ccb->ccb_h, my_path, 5); - request_ccb->ccb_h.func_code = XPT_SCAN_LUN; - request_ccb->ccb_h.cbfcnp = storvsc_xptdone; - request_ccb->crcn.flags = CAM_FLAG_NONE; - - error = cam_periph_runccb(request_ccb, NULL, - CAM_FLAG_NONE, 0, NULL); - KASSERT(error == 0, ("cam_periph_runccb failed %d\n", error)); - xpt_release_path(my_path); - } while ( ++lun_nb < sc->hs_drv_props->drv_max_luns_per_target); - mtx_unlock(&sc->hs_lock); - free(request_ccb, M_CAMXPT); - free(my_path, M_CAMXPT); -} - -/** * @brief StorVSC probe function * * Device probe function. Returns 0 if the input device is a StorVSC @@ -904,10 +823,6 @@ storvsc_attach(device_t dev) } mtx_unlock(&sc->hs_lock); - scan_for_luns(sc); - for (i = 0; (hs_softc[i] != NULL) && (i < HS_MAX_ADAPTERS); i++); - KASSERT(i < HS_MAX_ADAPTERS, ("storvsc_attach: hs_softc full\n")); - hs_softc[i] = sc; root_mount_rel(root_mount_token); return (0); @@ -1147,7 +1062,7 @@ storvsc_action(struct cam_sim *sim, unio cpi->hba_eng_cnt = 0; cpi->max_target = STORVSC_MAX_TARGETS; cpi->max_lun = sc->hs_drv_props->drv_max_luns_per_target; - cpi->initiator_id = 0; + cpi->initiator_id = cpi->max_lun + 1; cpi->bus_id = cam_sim_bus(sim); cpi->base_transfer_speed = 300000; cpi->transport = XPORT_SAS; From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 18:39:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 070A78ED; Wed, 5 Mar 2014 18:39:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CDA79CE0; Wed, 5 Mar 2014 18:39:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s25IdR6W040942; Wed, 5 Mar 2014 18:39:27 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s25IdRlT040941; Wed, 5 Mar 2014 18:39:27 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403051839.s25IdRlT040941@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 5 Mar 2014 18:39:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262795 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 18:39:28 -0000 Author: hselasky Date: Wed Mar 5 18:39:27 2014 New Revision: 262795 URL: http://svnweb.freebsd.org/changeset/base/262795 Log: - Temporary fix for race in RUN driver which can cause freed memory to be accessed. - Properly lock callout_reset()'s. MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Wed Mar 5 17:23:38 2014 (r262794) +++ head/sys/dev/usb/wlan/if_run.c Wed Mar 5 18:39:27 2014 (r262795) @@ -2508,9 +2508,7 @@ run_ratectl_cb(void *arg, int pending) if (vap == NULL) return; - if (sc->rvp_cnt <= 1 && vap->iv_opmode == IEEE80211_M_STA) - run_iter_func(sc, vap->iv_bss); - else { + if (sc->rvp_cnt > 1 || vap->iv_opmode != IEEE80211_M_STA) { /* * run_reset_livelock() doesn't do anything with AMRR, * but Ralink wants us to call it every 1 sec. So, we @@ -2523,9 +2521,10 @@ run_ratectl_cb(void *arg, int pending) /* just in case, there are some stats to drain */ run_drain_fifo(sc); RUN_UNLOCK(sc); - ieee80211_iterate_nodes(&ic->ic_sta, run_iter_func, sc); } + ieee80211_iterate_nodes(&ic->ic_sta, run_iter_func, sc); + RUN_LOCK(sc); if(sc->ratectl_run != RUN_RATECTL_OFF) usb_callout_reset(&sc->ratectl_ch, hz, run_ratectl_to, sc); @@ -2605,6 +2604,11 @@ run_iter_func(void *arg, struct ieee8021 RUN_LOCK(sc); + /* Check for special case */ + if (sc->rvp_cnt <= 1 && vap->iv_opmode == IEEE80211_M_STA && + ni != vap->iv_bss) + goto fail; + if (sc->rvp_cnt <= 1 && (vap->iv_opmode == IEEE80211_M_IBSS || vap->iv_opmode == IEEE80211_M_STA)) { /* read statistic counters (clear on read) and update AMRR state */ @@ -2733,7 +2737,10 @@ run_newassoc(struct ieee80211_node *ni, rn->mgt_ridx = ridx; DPRINTF("rate=%d, mgmt_ridx=%d\n", rate, rn->mgt_ridx); - usb_callout_reset(&sc->ratectl_ch, hz, run_ratectl_to, sc); + RUN_LOCK(sc); + if(sc->ratectl_run != RUN_RATECTL_OFF) + usb_callout_reset(&sc->ratectl_ch, hz, run_ratectl_to, sc); + RUN_UNLOCK(sc); } /* From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 19:26:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F6ADD21; Wed, 5 Mar 2014 19:26:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 30E9321C; Wed, 5 Mar 2014 19:26:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s25JQMop061390; Wed, 5 Mar 2014 19:26:22 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s25JQMfW061389; Wed, 5 Mar 2014 19:26:22 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403051926.s25JQMfW061389@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 5 Mar 2014 19:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262799 - head/sbin/pfctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 19:26:23 -0000 Author: glebius Date: Wed Mar 5 19:26:22 2014 New Revision: 262799 URL: http://svnweb.freebsd.org/changeset/base/262799 Log: Fix compilation for 32-bit machines. Modified: head/sbin/pfctl/pfctl.c Modified: head/sbin/pfctl/pfctl.c ============================================================================== --- head/sbin/pfctl/pfctl.c Wed Mar 5 18:56:14 2014 (r262798) +++ head/sbin/pfctl/pfctl.c Wed Mar 5 19:26:22 2014 (r262799) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -791,17 +792,17 @@ pfctl_print_rule_counters(struct pf_rule } if (opts & PF_OPT_VERBOSE) { printf(" [ Evaluations: %-8llu Packets: %-8llu " - "Bytes: %-10llu States: %-6lu]\n", + "Bytes: %-10llu States: %-6ju]\n", (unsigned long long)rule->evaluations, (unsigned long long)(rule->packets[0] + rule->packets[1]), (unsigned long long)(rule->bytes[0] + - rule->bytes[1]), rule->u_states_cur); + rule->bytes[1]), (uintmax_t)rule->u_states_cur); if (!(opts & PF_OPT_DEBUG)) printf(" [ Inserted: uid %u pid %u " - "State Creations: %-6lu]\n", + "State Creations: %-6ju]\n", (unsigned)rule->cuid, (unsigned)rule->cpid, - rule->u_states_tot); + (uintmax_t)rule->u_states_tot); } } @@ -903,7 +904,7 @@ pfctl_show_rules(int dev, char *path, in case PFCTL_SHOW_LABELS: if (pr.rule.label[0]) { printf("%s %llu %llu %llu %llu" - " %llu %llu %llu %llu\n", + " %llu %llu %llu %ju\n", pr.rule.label, (unsigned long long)pr.rule.evaluations, (unsigned long long)(pr.rule.packets[0] + @@ -914,7 +915,7 @@ pfctl_show_rules(int dev, char *path, in (unsigned long long)pr.rule.bytes[0], (unsigned long long)pr.rule.packets[1], (unsigned long long)pr.rule.bytes[1], - (unsigned long long)pr.rule.u_states_tot); + (uintmax_t)pr.rule.u_states_tot); } break; case PFCTL_SHOW_RULES: From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 20:01:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38BE1247; Wed, 5 Mar 2014 20:01:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0C182825; Wed, 5 Mar 2014 20:01:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s25K140G076136; Wed, 5 Mar 2014 20:01:04 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s25K14rh076134; Wed, 5 Mar 2014 20:01:04 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403052001.s25K14rh076134@svn.freebsd.org> From: Dimitry Andric Date: Wed, 5 Mar 2014 20:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262805 - head/contrib/libc++/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 20:01:05 -0000 Author: dim Date: Wed Mar 5 20:01:04 2014 New Revision: 262805 URL: http://svnweb.freebsd.org/changeset/base/262805 Log: Pull in r199848 from upstream libc++ trunk: Const qualify __mem_fn call operator QOI improvement. Differential Revision: http://llvm-reviews.chandlerc.com/D2059 This should help with building recent versions of Mesa. See also: https://bugs.freedesktop.org/show_bug.cgi?id=75505 Reported by: dumbbell MFC after: 3 days Modified: head/contrib/libc++/include/__functional_03 head/contrib/libc++/include/functional Modified: head/contrib/libc++/include/__functional_03 ============================================================================== --- head/contrib/libc++/include/__functional_03 Wed Mar 5 19:55:10 2014 (r262804) +++ head/contrib/libc++/include/__functional_03 Wed Mar 5 20:01:04 2014 (r262805) @@ -33,28 +33,28 @@ public: // invoke typename __invoke_return::type - operator() () + operator() () const { return __invoke(__f_); } template typename __invoke_return0::type - operator() (_A0& __a0) + operator() (_A0& __a0) const { return __invoke(__f_, __a0); } template typename __invoke_return1::type - operator() (_A0& __a0, _A1& __a1) + operator() (_A0& __a0, _A1& __a1) const { return __invoke(__f_, __a0, __a1); } template typename __invoke_return2::type - operator() (_A0& __a0, _A1& __a1, _A2& __a2) + operator() (_A0& __a0, _A1& __a1, _A2& __a2) const { return __invoke(__f_, __a0, __a1, __a2); } Modified: head/contrib/libc++/include/functional ============================================================================== --- head/contrib/libc++/include/functional Wed Mar 5 19:55:10 2014 (r262804) +++ head/contrib/libc++/include/functional Wed Mar 5 20:01:04 2014 (r262805) @@ -1221,7 +1221,7 @@ public: template _LIBCPP_INLINE_VISIBILITY typename __invoke_return::type - operator() (_ArgTypes&&... __args) + operator() (_ArgTypes&&... __args) const { return __invoke(__f_, _VSTD::forward<_ArgTypes>(__args)...); } From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 21:16:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50B1AE09; Wed, 5 Mar 2014 21:16:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3D2BCE92; Wed, 5 Mar 2014 21:16:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s25LGlxR007926; Wed, 5 Mar 2014 21:16:47 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s25LGkEq007924; Wed, 5 Mar 2014 21:16:46 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403052116.s25LGkEq007924@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 5 Mar 2014 21:16:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262806 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 21:16:47 -0000 Author: glebius Date: Wed Mar 5 21:16:46 2014 New Revision: 262806 URL: http://svnweb.freebsd.org/changeset/base/262806 Log: The route code used to mtx_destroy() a locked mutex before rtentry free. Now, after r262763 it started to return locked mutexes to UMA. To fix that, conditionally unlock the mutex in the destructor. Tested by: "Sergey V. Dyatko" Modified: head/sys/net/route.c head/sys/net/route.h Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Wed Mar 5 20:01:04 2014 (r262805) +++ head/sys/net/route.c Wed Mar 5 21:16:46 2014 (r262806) @@ -237,6 +237,14 @@ rtentry_ctor(void *mem, int size, void * } static void +rtentry_dtor(void *mem, int size, void *arg) +{ + struct rtentry *rt = mem; + + RT_UNLOCK_COND(rt); +} + +static void vnet_route_init(const void *unused __unused) { struct domain *dom; @@ -248,7 +256,7 @@ vnet_route_init(const void *unused __unu sizeof(struct radix_node_head *), M_RTABLE, M_WAITOK|M_ZERO); V_rtzone = uma_zcreate("rtentry", sizeof(struct rtentry), - rtentry_ctor, NULL, + rtentry_ctor, rtentry_dtor, rtentry_zinit, rtentry_zfini, UMA_ALIGN_PTR, 0); for (dom = domains; dom; dom = dom->dom_next) { if (dom->dom_rtattach == NULL) Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Wed Mar 5 20:01:04 2014 (r262805) +++ head/sys/net/route.h Wed Mar 5 21:16:46 2014 (r262806) @@ -309,6 +309,10 @@ struct rt_addrinfo { #define RT_UNLOCK(_rt) mtx_unlock(&(_rt)->rt_mtx) #define RT_LOCK_DESTROY(_rt) mtx_destroy(&(_rt)->rt_mtx) #define RT_LOCK_ASSERT(_rt) mtx_assert(&(_rt)->rt_mtx, MA_OWNED) +#define RT_UNLOCK_COND(_rt) do { \ + if (mtx_owned(&(_rt)->rt_mtx)) \ + mtx_unlock(&(_rt)->rt_mtx); \ +} while (0) #define RT_ADDREF(_rt) do { \ RT_LOCK_ASSERT(_rt); \ From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 22:43:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA758747; Wed, 5 Mar 2014 22:43:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D72CB919; Wed, 5 Mar 2014 22:43:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s25MhUw3044152; Wed, 5 Mar 2014 22:43:30 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s25MhU1j044151; Wed, 5 Mar 2014 22:43:30 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403052243.s25MhU1j044151@svn.freebsd.org> From: Dimitry Andric Date: Wed, 5 Mar 2014 22:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262809 - head/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 22:43:31 -0000 Author: dim Date: Wed Mar 5 22:43:30 2014 New Revision: 262809 URL: http://svnweb.freebsd.org/changeset/base/262809 Log: Pull in r203007 from upstream clang trunk: Don't produce an alias between destructors with different calling conventions. Fixes pr19007. (Please note that is an LLVM PR identifier, not a FreeBSD one.) This should fix Firefox and/or libxul crashes (due to problems with regparm/stdcall calling conventions) on i386. Reported by: multiple users on freebsd-current PR: bin/187103 MFC after: 1 week Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp Wed Mar 5 22:04:30 2014 (r262808) +++ head/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp Wed Mar 5 22:43:30 2014 (r262809) @@ -92,7 +92,13 @@ bool CodeGenModule::TryEmitBaseDestructo if (!ClassLayout.getBaseClassOffset(UniqueBase).isZero()) return true; + // Give up if the calling conventions don't match. We could update the call, + // but it is probably not worth it. const CXXDestructorDecl *BaseD = UniqueBase->getDestructor(); + if (BaseD->getType()->getAs()->getCallConv() != + D->getType()->getAs()->getCallConv()) + return true; + return TryEmitDefinitionAsAlias(GlobalDecl(D, Dtor_Base), GlobalDecl(BaseD, Dtor_Base), false); From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 23:17:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EF15598; Wed, 5 Mar 2014 23:17:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3A1B9BBE; Wed, 5 Mar 2014 23:17:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s25NHtSx057052; Wed, 5 Mar 2014 23:17:55 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s25NHrVB057044; Wed, 5 Mar 2014 23:17:53 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201403052317.s25NHrVB057044@svn.freebsd.org> From: Glen Barber Date: Wed, 5 Mar 2014 23:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262810 - in head: release release/arm release/tools share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 23:17:55 -0000 Author: gjb Date: Wed Mar 5 23:17:53 2014 New Revision: 262810 URL: http://svnweb.freebsd.org/changeset/base/262810 Log: Merge ^/projects/release-embedded into ^/head. After several months of testing and fixing (and breaking) various parts of release/release.sh changes, it is now possible to build FreeBSD/arm images as part of the release process. When EMBEDDEDBUILD is set in the release.conf file, release.sh will create the build environment, then run a separate script in release/${XDEV}/release.sh [1]. Currently, only arm is supported. The release/${XDEV}/release.sh configures the build environment specific for the target image, such as installing gcc(1), installing additional third-party software from the ports tree, and fetching external sources. Once the build environment is set up, release/${XDEV}/release.sh runs Crochet, written by Tim Kientzle, which builds the userland and kernel, and creates an image that can be written to an SD card with dd(1). Many thanks to Tim for his work on Crochet. Sample configurations for FreeBSD/arm boards are in the release/arm/ directory, and Crochet configuration files for each board are located in release/tools/arm/. Supported boards at this time are: BEAGLEBONE, PANDABOARD, RPI-B, and WANDBOARD-QUAD. Adding support for additional boards will continue in the projects/release-embedded/ branch, and incrementally merged back to head/. Many thanks to the FreeBSD Foundation for the support and sponsorship of this project. [1] XDEV is used in order to keep the various configurations organized by architecture, but since TARGET and TARGET_ARCH are used to build the chroot, the values of those variables cannot be used. MFC after: 1 month Sponsored by: The FreeBSD Foundation Added: head/release/arm/ - copied from r262314, projects/release-embedded/release/arm/ head/release/tools/ - copied from r262314, projects/release-embedded/release/tools/ Modified: head/release/arm/BEAGLEBONE.conf head/release/arm/PANDABOARD.conf head/release/arm/RPI-B.conf head/release/arm/WANDBOARD-QUAD.conf head/release/arm/release.sh head/release/release.conf.sample head/release/release.sh head/share/man/man7/release.7 Directory Properties: head/ (props changed) Modified: head/release/arm/BEAGLEBONE.conf ============================================================================== --- projects/release-embedded/release/arm/BEAGLEBONE.conf Fri Feb 21 23:18:35 2014 (r262314) +++ head/release/arm/BEAGLEBONE.conf Wed Mar 5 23:17:53 2014 (r262810) @@ -13,7 +13,7 @@ fi # Build chroot configuration TARGET="amd64" TARGET_ARCH="amd64" -SVNROOT="svn://svn.FreeBSD.org" +SVNROOT="svn://svn.FreeBSD.org/" SRCBRANCH="base/head@rHEAD" DOCBRANCH="doc/head@rHEAD" PORTBRANCH="ports/head@rHEAD" @@ -24,7 +24,7 @@ NODOC=yes # script, these must be exported. set -a WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -KERNEL_FLAGS="-j $(expr \( $(sysctl -n hw.ncpu) + 1 \) / 2)" +KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" CHROOTDIR="/scratch" EMBEDDEDBUILD=1 EMBEDDEDPORTS="lang/python textproc/gsed" Modified: head/release/arm/PANDABOARD.conf ============================================================================== --- projects/release-embedded/release/arm/PANDABOARD.conf Fri Feb 21 23:18:35 2014 (r262314) +++ head/release/arm/PANDABOARD.conf Wed Mar 5 23:17:53 2014 (r262810) @@ -13,7 +13,7 @@ fi # Build chroot configuration TARGET="amd64" TARGET_ARCH="amd64" -SVNROOT="svn://svn.FreeBSD.org" +SVNROOT="svn://svn.FreeBSD.org/" SRCBRANCH="base/head@rHEAD" DOCBRANCH="doc/head@rHEAD" PORTBRANCH="ports/head@rHEAD" @@ -24,7 +24,7 @@ NODOC=yes # script, these must be exported. set -a WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -KERNEL_FLAGS="-j $(expr \( $(sysctl -n hw.ncpu) + 1 \) / 2)" +KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" CHROOTDIR="/scratch" EMBEDDEDBUILD=1 EMBEDDEDPORTS="lang/python textproc/gsed" Modified: head/release/arm/RPI-B.conf ============================================================================== --- projects/release-embedded/release/arm/RPI-B.conf Fri Feb 21 23:18:35 2014 (r262314) +++ head/release/arm/RPI-B.conf Wed Mar 5 23:17:53 2014 (r262810) @@ -13,7 +13,7 @@ fi # Build chroot configuration TARGET="amd64" TARGET_ARCH="amd64" -SVNROOT="svn://svn.FreeBSD.org" +SVNROOT="svn://svn.FreeBSD.org/" SRCBRANCH="base/head@rHEAD" DOCBRANCH="doc/head@rHEAD" PORTBRANCH="ports/head@rHEAD" @@ -24,7 +24,7 @@ NODOC=yes # script, these must be exported. set -a WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -KERNEL_FLAGS="-j $(expr \( $(sysctl -n hw.ncpu) + 1 \) / 2)" +KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" CHROOTDIR="/scratch" EMBEDDEDBUILD=1 EMBEDDEDPORTS="lang/python textproc/gsed" Modified: head/release/arm/WANDBOARD-QUAD.conf ============================================================================== --- projects/release-embedded/release/arm/WANDBOARD-QUAD.conf Fri Feb 21 23:18:35 2014 (r262314) +++ head/release/arm/WANDBOARD-QUAD.conf Wed Mar 5 23:17:53 2014 (r262810) @@ -13,7 +13,7 @@ fi # Build chroot configuration TARGET="amd64" TARGET_ARCH="amd64" -SVNROOT="svn://svn.FreeBSD.org" +SVNROOT="svn://svn.FreeBSD.org/" SRCBRANCH="base/head@rHEAD" DOCBRANCH="doc/head@rHEAD" PORTBRANCH="ports/head@rHEAD" @@ -24,7 +24,7 @@ NODOC=yes # script, these must be exported. set -a WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" -KERNEL_FLAGS="-j $(expr \( $(sysctl -n hw.ncpu) + 1 \) / 2)" +KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" CHROOTDIR="/scratch" EMBEDDEDBUILD=1 EMBEDDEDPORTS="lang/python textproc/gsed" Modified: head/release/arm/release.sh ============================================================================== --- projects/release-embedded/release/arm/release.sh Fri Feb 21 23:18:35 2014 (r262314) +++ head/release/arm/release.sh Wed Mar 5 23:17:53 2014 (r262810) @@ -1,4 +1,31 @@ #!/bin/sh +#- +# Copyright (c) 2013, 2014 The FreeBSD Foundation +# All rights reserved. +# +# This software was developed by Glen Barber +# under sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. # # $FreeBSD$ # @@ -55,7 +82,7 @@ install_crochet() { install_uboot() { # Only fetch u-boot sources if UBOOTSRC is set; otherwise it is # not needed. - if [ "X${UBOOTSRC}" != "X" ]; then + if [ -n "${UBOOTSRC}" ]; then continue else return 0 Modified: head/release/release.conf.sample ============================================================================== --- head/release/release.conf.sample Wed Mar 5 22:43:30 2014 (r262809) +++ head/release/release.conf.sample Wed Mar 5 23:17:53 2014 (r262810) @@ -45,5 +45,17 @@ PORTBRANCH="ports/head@rHEAD" ## Set miscellaneous 'make release' settings. #NODOC= #NOPORTS= -#RELSTRING= #WITH_DVD= + +## Set when building embedded images. +#EMBEDDEDBUILD= + +## Set to skip the chroot environment buildworld/installworld/distribution +## step if it is expected the build environment will exist via alternate +## means. +#CHROOTBUILD_SKIP= + +## Set to pass additional flags to make(1) for the build chroot setup, such +## as TARGET/TARGET_ARCH. +#CHROOT_MAKEENV= + Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Wed Mar 5 22:43:30 2014 (r262809) +++ head/release/release.sh Wed Mar 5 23:17:53 2014 (r262810) @@ -41,6 +41,7 @@ export PATH # The directory within which the release will be built. CHROOTDIR="/scratch" +RELENGDIR="$(realpath $(dirname $(basename ${0})))" # The default version control system command to obtain the sources. VCSCMD="svn checkout" @@ -52,6 +53,9 @@ SRCBRANCH="base/head@rHEAD" DOCBRANCH="doc/head@rHEAD" PORTBRANCH="ports/head@rHEAD" +# Set for embedded device builds. +EMBEDDEDBUILD= + # Sometimes one needs to checkout src with --force svn option. # If custom kernel configs copied to src tree before checkout, e.g. SRC_FORCE_CHECKOUT= @@ -108,9 +112,18 @@ SRCBRANCH="${SVNROOT}${SRCBRANCH}" DOCBRANCH="${SVNROOT}${DOCBRANCH}" PORTBRANCH="${SVNROOT}${PORTBRANCH}" +if [ -n "${EMBEDDEDBUILD}" ]; then + if [ -z "${XDEV}" ] || [ -z "${XDEV_ARCH}" ]; then + echo "ERROR: XDEV and XDEV_ARCH must be set in ${RELEASECONF}." + exit 1 + fi + WITH_DVD= + NODOC=yes +fi + # If PORTS is set and NODOC is unset, force NODOC=yes because the ports tree # is required to build the documentation set. -if [ "x${NOPORTS}" != "x" ] && [ "x${NODOC}" = "x" ]; then +if [ -n "${NOPORTS}" ] && [ -z "${NODOC}" ]; then echo "*** NOTICE: Setting NODOC=1 since ports tree is required" echo " and NOPORTS is set." NODOC=yes @@ -120,10 +133,10 @@ fi # The release makefile verifies definedness of NOPORTS/NODOC variables # instead of their values. DOCPORTS= -if [ "x${NOPORTS}" != "x" ]; then +if [ -n "${NOPORTS}" ]; then DOCPORTS="NOPORTS=yes " fi -if [ "x${NODOC}" != "x" ]; then +if [ -n "${NODOC}" ]; then DOCPORTS="${DOCPORTS}NODOC=yes" fi @@ -131,12 +144,12 @@ fi # this file, unless overridden by release.conf. In most cases, these # will not need to be changed. CONF_FILES="__MAKE_CONF=${MAKE_CONF} SRCCONF=${SRC_CONF}" -if [ "x${TARGET}" != "x" ] && [ "x${TARGET_ARCH}" != "x" ]; then +if [ -n "${TARGET}" ] && [ -n "${TARGET_ARCH}" ]; then ARCH_FLAGS="TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}" else ARCH_FLAGS= fi -CHROOT_MAKEENV="MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj" +CHROOT_MAKEENV="${CHROOT_MAKEENV} MAKEOBJDIRPREFIX=${CHROOTDIR}/tmp/obj" CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${CONF_FILES}" CHROOT_IMAKEFLAGS="${CONF_FILES}" CHROOT_DMAKEFLAGS="${CONF_FILES}" @@ -147,11 +160,11 @@ RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCO # Force src checkout if configured FORCE_SRC_KEY= -if [ "x${SRC_FORCE_CHECKOUT}" != "x" ]; then +if [ -n "${SRC_FORCE_CHECKOUT}" ]; then FORCE_SRC_KEY="--force" fi -if [ ! ${CHROOTDIR} ]; then +if [ -z "${CHROOTDIR}" ]; then echo "Please set CHROOTDIR." exit 1 fi @@ -166,19 +179,21 @@ set -e # Everything must succeed mkdir -p ${CHROOTDIR}/usr ${VCSCMD} ${FORCE_SRC_KEY} ${SRCBRANCH} ${CHROOTDIR}/usr/src -if [ "x${NODOC}" = "x" ]; then +if [ -z "${NODOC}" ]; then ${VCSCMD} ${DOCBRANCH} ${CHROOTDIR}/usr/doc fi -if [ "x${NOPORTS}" = "x" ]; then +if [ -z "${NOPORTS}" ]; then ${VCSCMD} ${PORTBRANCH} ${CHROOTDIR}/usr/ports fi -cd ${CHROOTDIR}/usr/src -env ${CHROOT_MAKEENV} make ${CHROOT_WMAKEFLAGS} buildworld -env ${CHROOT_MAKEENV} make ${CHROOT_IMAKEFLAGS} installworld \ - DESTDIR=${CHROOTDIR} -env ${CHROOT_MAKEENV} make ${CHROOT_DMAKEFLAGS} distribution \ - DESTDIR=${CHROOTDIR} +if [ -z "${CHROOTBUILD_SKIP}" ]; then + cd ${CHROOTDIR}/usr/src + env ${CHROOT_MAKEENV} make ${CHROOT_WMAKEFLAGS} buildworld + env ${CHROOT_MAKEENV} make ${CHROOT_IMAKEFLAGS} installworld \ + DESTDIR=${CHROOTDIR} + env ${CHROOT_MAKEENV} make ${CHROOT_DMAKEFLAGS} distribution \ + DESTDIR=${CHROOTDIR} +fi mount -t devfs devfs ${CHROOTDIR}/dev cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit @@ -194,6 +209,29 @@ if [ -e ${SRC_CONF} ] && [ ! -c ${SRC_CO cp ${SRC_CONF} ${CHROOTDIR}/${SRC_CONF} fi +# Embedded builds do not use the 'make release' target. +if [ -n "${EMBEDDEDBUILD}" ]; then + # If a crochet configuration file exists in *this* checkout of + # release/, copy it to the /tmp/external directory within the chroot. + # This allows building embedded releases without relying on updated + # scripts and/or configurations to exist in the branch being built. + if [ -e ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf ] && \ + [ -e ${RELENGDIR}/${XDEV}/release.sh ]; then + mkdir -p ${CHROOTDIR}/tmp/external/${XDEV}/ + cp ${RELENGDIR}/tools/${XDEV}/crochet-${KERNEL}.conf \ + ${CHROOTDIR}/tmp/external/${XDEV}/crochet-${KERNEL}.conf + /bin/sh ${RELENGDIR}/${XDEV}/release.sh + fi + # If the script does not exist for this architecture, exit. + # This probably should be checked earlier, but allowing the rest + # of the build process to get this far will at least set up the + # chroot environment for testing. + exit 0 +else + # Not embedded. + continue +fi + if [ -d ${CHROOTDIR}/usr/ports ]; then # Run ldconfig(8) in the chroot directory so /var/run/ld-elf*.so.hints # is created. This is needed by ports-mgmt/pkg. @@ -201,7 +239,7 @@ if [ -d ${CHROOTDIR}/usr/ports ]; then ## Trick the ports 'run-autotools-fixup' target to do the right thing. _OSVERSION=$(sysctl -n kern.osreldate) - if [ -d ${CHROOTDIR}/usr/doc ] && [ "x${NODOC}" = "x" ]; then + if [ -d ${CHROOTDIR}/usr/doc ] && [ -z "${NODOC}" ]; then PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" PBUILD_FLAGS="${PBUILD_FLAGS}" chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \ @@ -209,13 +247,9 @@ if [ -d ${CHROOTDIR}/usr/ports ]; then fi fi -if [ "x${RELSTRING}" = "x" ]; then - RELSTRING="$(chroot ${CHROOTDIR} uname -s)-${OSRELEASE}-${TARGET_ARCH}" -fi - eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_WMAKEFLAGS} buildworld eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ - release RELSTRING=${RELSTRING} + release eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ - install DESTDIR=/R RELSTRING=${RELSTRING} + install DESTDIR=/R Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Wed Mar 5 22:43:30 2014 (r262809) +++ head/share/man/man7/release.7 Wed Mar 5 23:17:53 2014 (r262810) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2014 +.Dd March 5, 2014 .Dt RELEASE 7 .Os .Sh NAME @@ -138,6 +138,11 @@ configuration file supports the followin .Bl -tag -width Ev .It Va CHROOTDIR The directory within which the release will be built. +.It Va CHROOT_MAKEENV +Additional +.Xr make 1 +arguments to pass through, which directly affect the +tuning of the build chroot. .It Va SVNROOT The .Xr svn 1 @@ -249,6 +254,72 @@ target. The command run to obtain the source trees. Defaults to .Qq Cm svn checkout . +.It Va CHROOTBUILD_SKIP +If defined, the +.Li buildworld , +.Li installworld , +and +.Li distribution +stages of the +.Xr chroot 8 +build environment setup are skipped. +This is intended solely for cases where the +.Xr chroot 8 +userland are provided by alternate means. +.El +.Sh EMBEDDED BUILDS +The following +.Fa release.conf +variables are relevant only to release builds for embedded systems: +.Bl -tag -width Ev +.It Va EMBEDDEDBUILD +Set to a non-null value to enable functionality for embedded device +release builds. +.Pq This option is considered highly experimental. +.Pp +When set, +.Va WITH_DVD +is unset, and +.Va NODOC +is defined. +Additionally, +.Va XDEV +and +.Va XDEV_ARCH +must also be defined. +When the build environment is created, +.Fa release.sh +runs a separate build script located in an architecture-specific +directory in +.Pa src/release/${XDEV}/ . +.It Va EMBEDDEDPORTS +Set to the list of any ports that are required for the target device +in the format of +.Fa category/port . +The +.Fa devel/subversion +port is built by default. +.It Va CROCHETSRC +Set to the source URL for the Crochet build tool. +.It Va CROCHETBRANCH +Set to the subversion branch from +.Va ${CROCHETSRC} +to use. +Defaults to +.Pa trunk . +.It Va UBOOTSRC +Set to the source URL of u-boot, if required. +.It Va UBOOTBRANCH +Set to the subversion branch from +.Va ${UBOOTSRC} +to use. +Defaults to +.Pa trunk . +.It Va UBOOTDIR +Set to the target directory within +.Va ${CHROOTDIR} +to check out +.Va ${UBOOTSRC}/${UBOOTBRANCH} . .El .Sh MAKEFILE TARGETS The release makefile From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 23:29:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81DB37FB; Wed, 5 Mar 2014 23:29:57 +0000 (UTC) Received: from mail-qg0-x233.google.com (mail-qg0-x233.google.com [IPv6:2607:f8b0:400d:c04::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 078E7C91; Wed, 5 Mar 2014 23:29:56 +0000 (UTC) Received: by mail-qg0-f51.google.com with SMTP id q108so4939468qgd.10 for ; Wed, 05 Mar 2014 15:29:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=69o/hqxwIzE7CsJzt9nYyffz2xx5wfAEa0OiGMQ48lo=; b=I9m7p/l54kHjTTsrapI9EWnVhaxdCuOpNCo+rC6HTqMHbasc8BTtMi7lUVsznBlzT/ BzB/wpke6I1a2uRHvcWif4MqR0WZLTAw+/0R+HY7fVKA2bCgAzqN93dZgKEqLfRDfdsl 1d94Zd5ds/8hHO2SJXhypeFa0syttDiD/doaXIW7x8Pzi5w/rPq1uMGS2i8VAQhahv2U iCjmXdUZmx4f5VKbJIs2RH1zt3myYvVvuj0iO4DSvd2yBmZHcGKvYFzWBwuxVoYzkEeA zmG5p97PsZYQSoUoGFcPY/50jSSxPtkCQewtswmxkeUkgRrEDcrDJUWTwUms6kEEMF/y bUqw== MIME-Version: 1.0 X-Received: by 10.224.11.136 with SMTP id t8mr10469327qat.26.1394062196018; Wed, 05 Mar 2014 15:29:56 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.8.137 with HTTP; Wed, 5 Mar 2014 15:29:55 -0800 (PST) In-Reply-To: <201403052116.s25LGkEq007924@svn.freebsd.org> References: <201403052116.s25LGkEq007924@svn.freebsd.org> Date: Wed, 5 Mar 2014 15:29:55 -0800 X-Google-Sender-Auth: F0rQRVBEPVIxuFXmnfEit1CNi6o Message-ID: Subject: Re: svn commit: r262806 - head/sys/net From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 23:29:57 -0000 ... why's the code returning locked mutexes to UMA? Why not fix the places that are doing this and doing a lock assertion in the destructor? What's this buy us? I'm very wary of design patterns like this that do conditional unlocking in free/destructor routines; it allows for the caller to not necessarily get all the lock/unlock stuff to line up in the main code and it can make debugging more of a pain. Thanks, -a On 5 March 2014 13:16, Gleb Smirnoff wrote: > Author: glebius > Date: Wed Mar 5 21:16:46 2014 > New Revision: 262806 > URL: http://svnweb.freebsd.org/changeset/base/262806 > > Log: > The route code used to mtx_destroy() a locked mutex before rtentry free. Now, > after r262763 it started to return locked mutexes to UMA. To fix that, > conditionally unlock the mutex in the destructor. > > Tested by: "Sergey V. Dyatko" > > Modified: > head/sys/net/route.c > head/sys/net/route.h > > Modified: head/sys/net/route.c > ============================================================================== > --- head/sys/net/route.c Wed Mar 5 20:01:04 2014 (r262805) > +++ head/sys/net/route.c Wed Mar 5 21:16:46 2014 (r262806) > @@ -237,6 +237,14 @@ rtentry_ctor(void *mem, int size, void * > } > > static void > +rtentry_dtor(void *mem, int size, void *arg) > +{ > + struct rtentry *rt = mem; > + > + RT_UNLOCK_COND(rt); > +} > + > +static void > vnet_route_init(const void *unused __unused) > { > struct domain *dom; > @@ -248,7 +256,7 @@ vnet_route_init(const void *unused __unu > sizeof(struct radix_node_head *), M_RTABLE, M_WAITOK|M_ZERO); > > V_rtzone = uma_zcreate("rtentry", sizeof(struct rtentry), > - rtentry_ctor, NULL, > + rtentry_ctor, rtentry_dtor, > rtentry_zinit, rtentry_zfini, UMA_ALIGN_PTR, 0); > for (dom = domains; dom; dom = dom->dom_next) { > if (dom->dom_rtattach == NULL) > > Modified: head/sys/net/route.h > ============================================================================== > --- head/sys/net/route.h Wed Mar 5 20:01:04 2014 (r262805) > +++ head/sys/net/route.h Wed Mar 5 21:16:46 2014 (r262806) > @@ -309,6 +309,10 @@ struct rt_addrinfo { > #define RT_UNLOCK(_rt) mtx_unlock(&(_rt)->rt_mtx) > #define RT_LOCK_DESTROY(_rt) mtx_destroy(&(_rt)->rt_mtx) > #define RT_LOCK_ASSERT(_rt) mtx_assert(&(_rt)->rt_mtx, MA_OWNED) > +#define RT_UNLOCK_COND(_rt) do { \ > + if (mtx_owned(&(_rt)->rt_mtx)) \ > + mtx_unlock(&(_rt)->rt_mtx); \ > +} while (0) > > #define RT_ADDREF(_rt) do { \ > RT_LOCK_ASSERT(_rt); \ > From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 23:35:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31710A95; Wed, 5 Mar 2014 23:35:06 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AACF1D49; Wed, 5 Mar 2014 23:35:04 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s25NYo9c071957 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 6 Mar 2014 03:34:50 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s25NYoPd071956; Thu, 6 Mar 2014 03:34:50 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 6 Mar 2014 03:34:50 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r262806 - head/sys/net Message-ID: <20140305233450.GG68791@FreeBSD.org> References: <201403052116.s25LGkEq007924@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 23:35:06 -0000 On Wed, Mar 05, 2014 at 03:29:55PM -0800, Adrian Chadd wrote: A> ... why's the code returning locked mutexes to UMA? A> A> Why not fix the places that are doing this and doing a lock assertion A> in the destructor? What's this buy us? A> A> I'm very wary of design patterns like this that do conditional A> unlocking in free/destructor routines; it allows for the caller to not A> necessarily get all the lock/unlock stuff to line up in the main code A> and it can make debugging more of a pain. I get your point, and even share it. I discussed that with melifaro@, he prefers destructors being smart. Note that mutex(9) by design allows to destroy a locked mutex. And route(4) relied on this semantics. Now I converted route(4) to lazy mutex deallocation. Of course, if mutex(9) didn't allow such trick, I wouldn't implement the code I did. But since code of route(4) was not considered broken before, I decided to keep status quo. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed Mar 5 23:37:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F167C87; Wed, 5 Mar 2014 23:37:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8CA4BD5D; Wed, 5 Mar 2014 23:37:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s25NbPoX064983; Wed, 5 Mar 2014 23:37:25 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s25NbPBH064982; Wed, 5 Mar 2014 23:37:25 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201403052337.s25NbPBH064982@svn.freebsd.org> From: John-Mark Gurney Date: Wed, 5 Mar 2014 23:37:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262811 - head/cddl/lib/libctf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2014 23:37:25 -0000 Author: jmg Date: Wed Mar 5 23:37:25 2014 New Revision: 262811 URL: http://svnweb.freebsd.org/changeset/base/262811 Log: mark that libctf depends upon libz so that if you dlopen libctf, you don't get: Undefined symbol "zError" Modified: head/cddl/lib/libctf/Makefile Modified: head/cddl/lib/libctf/Makefile ============================================================================== --- head/cddl/lib/libctf/Makefile Wed Mar 5 23:17:53 2014 (r262810) +++ head/cddl/lib/libctf/Makefile Wed Mar 5 23:37:25 2014 (r262811) @@ -27,5 +27,8 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ -I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common +DPADD= ${LIBZ} +LDADD= -lz + .include From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 00:10:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DEAE1526; Thu, 6 Mar 2014 00:10:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CC12EFED; Thu, 6 Mar 2014 00:10:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s260A7on078735; Thu, 6 Mar 2014 00:10:07 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s260A7Dq078734; Thu, 6 Mar 2014 00:10:07 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201403060010.s260A7Dq078734@svn.freebsd.org> From: Jeff Roberson Date: Thu, 6 Mar 2014 00:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262812 - head/sys/ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 00:10:07 -0000 Author: jeff Date: Thu Mar 6 00:10:07 2014 New Revision: 262812 URL: http://svnweb.freebsd.org/changeset/base/262812 Log: - Gracefully handle truncation failures when trying to shrink directories. This could cause dirhash panics since the dirhash state would be successfully truncated while the directory was not. Reported by: pho Discussed with: mckusick Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks Modified: head/sys/ufs/ufs/ufs_lookup.c Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Wed Mar 5 23:37:25 2014 (r262811) +++ head/sys/ufs/ufs/ufs_lookup.c Thu Mar 6 00:10:07 2014 (r262812) @@ -1130,12 +1130,15 @@ ufs_direnter(dvp, tvp, dirp, cnp, newdir dp->i_endoff && dp->i_endoff < dp->i_size) { if (tvp != NULL) VOP_UNLOCK(tvp, 0); + error = UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, + IO_NORMAL | IO_SYNC, cr); + if (error != 0) + vprint("ufs_direnter: failted to truncate", dvp); #ifdef UFS_DIRHASH - if (dp->i_dirhash != NULL) + if (error == 0 && dp->i_dirhash != NULL) ufsdirhash_dirtrunc(dp, dp->i_endoff); #endif - (void) UFS_TRUNCATE(dvp, (off_t)dp->i_endoff, - IO_NORMAL | IO_SYNC, cr); + error = 0; if (tvp != NULL) vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY); } From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 00:13:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0B1D9A9; Thu, 6 Mar 2014 00:13:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AE22D105; Thu, 6 Mar 2014 00:13:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s260DLSI081579; Thu, 6 Mar 2014 00:13:21 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s260DLGI081577; Thu, 6 Mar 2014 00:13:21 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201403060013.s260DLGI081577@svn.freebsd.org> From: Jeff Roberson Date: Thu, 6 Mar 2014 00:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262814 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 00:13:21 -0000 Author: jeff Date: Thu Mar 6 00:13:21 2014 New Revision: 262814 URL: http://svnweb.freebsd.org/changeset/base/262814 Log: - If we fail to do a non-blocking acquire of a buf lock while doing a waiting sync pass we need to do a blocking acquire and restart. Another thread, typically the buf daemon, may have this buf locked and if we don't wait we can fail to sync the file. This lead to a great variety of softdep panics because we rely on all dependencies being flushed before proceeding in several cases. Reported by: pho Discussed with: mckusick Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Thu Mar 6 00:11:47 2014 (r262813) +++ head/sys/ufs/ffs/ffs_vnops.c Thu Mar 6 00:13:21 2014 (r262814) @@ -259,9 +259,17 @@ loop: continue; if (bp->b_lblkno > lbn) panic("ffs_syncvnode: syncing truncated data."); - if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL)) + if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) == 0) { + BO_UNLOCK(bo); + } else if (wait != 0) { + if (BUF_LOCK(bp, + LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, + BO_LOCKPTR(bo)) != 0) { + bp->b_vflags &= ~BV_SCANNED; + goto next; + } + } else continue; - BO_UNLOCK(bo); if ((bp->b_flags & B_DELWRI) == 0) panic("ffs_fsync: not dirty"); /* From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 00:25:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C4C0EB2; Thu, 6 Mar 2014 00:25:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3964F1DD; Thu, 6 Mar 2014 00:25:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s260PMNE086078; Thu, 6 Mar 2014 00:25:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s260PLmL086076; Thu, 6 Mar 2014 00:25:21 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403060025.s260PLmL086076@svn.freebsd.org> From: Xin LI Date: Thu, 6 Mar 2014 00:25:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262816 - head/lib/libz X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 00:25:22 -0000 Author: delphij Date: Thu Mar 6 00:25:21 2014 New Revision: 262816 URL: http://svnweb.freebsd.org/changeset/base/262816 Log: Add a manual page for zopen(3) provided by our libz.so. Added: head/lib/libz/zopen.3 (contents, props changed) Modified: head/lib/libz/Makefile Modified: head/lib/libz/Makefile ============================================================================== --- head/lib/libz/Makefile Thu Mar 6 00:19:18 2014 (r262815) +++ head/lib/libz/Makefile Thu Mar 6 00:25:21 2014 (r262816) @@ -5,7 +5,7 @@ LIB= z SHLIBDIR?= /lib SHLIB_MAJOR= 6 -MAN= zlib.3 +MAN= zlib.3 zopen.3 #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 #CFLAGS=-g -DDEBUG Added: head/lib/libz/zopen.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libz/zopen.3 Thu Mar 6 00:25:21 2014 (r262816) @@ -0,0 +1,96 @@ +.\" Copyright (c) 2014 Xin Li +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 5, 2014 +.Dt ZOPEN 3 +.Os +.Sh NAME +.Nm zopen +.Nd open a gzip compressed stream +.Sh LIBRARY +.Lb libz +.Sh SYNOPSIS +.Ft FILE * +.Fn zopen "const char *path" "const char *mode" +.Sh DESCRIPTION +The +.Fn zopen +opens a gzip file whose name is the string pointed to by +.Fa path +and associates a stream with it. +It is a wrapper around +.Xr zlib 3 +and standard stream I/O APIs. +.Pp +The argument +.Fa mode +have the same meaning as it does in +.Xr fopen 3 . +.Pp +The +.Nm +function will associate read, write, seek and close +functions of +.Xr zlib 3 +after successfully opened a file with +.Xr funopen 3 +so that they will be used to read or write the new stream. +.Sh RETURN VALUES +Upon successful completion +.Nm +returns a +.Tn FILE +pointer. +Otherwise, +.Dv NULL +is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +In addition to the errors documented for +.Xr fopen 3 , +the +.Nm +function may also fail for: +.Bl -tag -width Er +.It Bq Er ENOMEM +Insufficient memory is available. +.El +.Sh COMPATIBILITY +This implementation of +.Nm +function first appeared in +.Nx 1.6 +and +.Fx 4.5 . +The +.Nm +function may not be portable to systems other than +.Fx . +.Sh SEE ALSO +.Xr fopen 3 , +.Xr funopen 3 , +.Xr zlib 3 From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 00:37:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4090203; Thu, 6 Mar 2014 00:37:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A10392A9; Thu, 6 Mar 2014 00:37:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s260bG76090293; Thu, 6 Mar 2014 00:37:16 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s260bGt7090292; Thu, 6 Mar 2014 00:37:16 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403060037.s260bGt7090292@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 6 Mar 2014 00:37:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262817 - head/sys/modules/crypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 00:37:16 -0000 Author: marcel Date: Thu Mar 6 00:37:16 2014 New Revision: 262817 URL: http://svnweb.freebsd.org/changeset/base/262817 Log: Add siphash.c. While here, sort. Modified: head/sys/modules/crypto/Makefile Modified: head/sys/modules/crypto/Makefile ============================================================================== --- head/sys/modules/crypto/Makefile Thu Mar 6 00:25:21 2014 (r262816) +++ head/sys/modules/crypto/Makefile Thu Mar 6 00:37:16 2014 (r262817) @@ -3,19 +3,22 @@ .PATH: ${.CURDIR}/../../opencrypto .PATH: ${.CURDIR}/../../crypto .PATH: ${.CURDIR}/../../crypto/blowfish +.PATH: ${.CURDIR}/../../crypto/camellia .PATH: ${.CURDIR}/../../crypto/des .PATH: ${.CURDIR}/../../crypto/rijndael .PATH: ${.CURDIR}/../../crypto/sha2 -.PATH: ${.CURDIR}/../../crypto/camellia +.PATH: ${.CURDIR}/../../crypto/siphash KMOD = crypto SRCS = crypto.c cryptodev_if.c SRCS += criov.c cryptosoft.c xform.c SRCS += cast.c cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c SRCS += skipjack.c bf_enc.c bf_ecb.c bf_skey.c +SRCS += camellia.c camellia-api.c SRCS += des_ecb.c des_enc.c des_setkey.c SRCS += sha1.c sha2.c +SRCS += siphash.c SRCS += opt_param.h cryptodev_if.h bus_if.h device_if.h SRCS += opt_ddb.h -SRCS += camellia.c camellia-api.c + .include From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 01:59:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 353AD350; Thu, 6 Mar 2014 01:59:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 16C77B20; Thu, 6 Mar 2014 01:59:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s261xHHa022106; Thu, 6 Mar 2014 01:59:17 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s261xDqK022086; Thu, 6 Mar 2014 01:59:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403060159.s261xDqK022086@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 6 Mar 2014 01:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262818 - in head/sys/modules: cyclic dtrace/dtmalloc dtrace/dtnfscl dtrace/dtnfsclient dtrace/dtrace dtrace/dtrace_test dtrace/dtraceall dtrace/fasttrap dtrace/fbt dtrace/lockstat dtra... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 01:59:17 -0000 Author: marcel Date: Thu Mar 6 01:59:13 2014 New Revision: 262818 URL: http://svnweb.freebsd.org/changeset/base/262818 Log: Use SYSDIR to reference to the top of the sys hierarchy. Define SYSDIR relative to .CURDIR if not already defined. This makes the makefiles more readable but also more re-usable and adaptable. Obtained from: Juniper Networks, Inc. Modified: head/sys/modules/cyclic/Makefile head/sys/modules/dtrace/dtmalloc/Makefile head/sys/modules/dtrace/dtnfscl/Makefile head/sys/modules/dtrace/dtnfsclient/Makefile head/sys/modules/dtrace/dtrace/Makefile head/sys/modules/dtrace/dtrace_test/Makefile head/sys/modules/dtrace/dtraceall/Makefile head/sys/modules/dtrace/fasttrap/Makefile head/sys/modules/dtrace/fbt/Makefile head/sys/modules/dtrace/lockstat/Makefile head/sys/modules/dtrace/profile/Makefile head/sys/modules/dtrace/prototype/Makefile head/sys/modules/dtrace/sdt/Makefile head/sys/modules/dtrace/systrace/Makefile head/sys/modules/dtrace/systrace_freebsd32/Makefile head/sys/modules/dtrace/systrace_linux32/Makefile head/sys/modules/opensolaris/Makefile Modified: head/sys/modules/cyclic/Makefile ============================================================================== --- head/sys/modules/cyclic/Makefile Thu Mar 6 00:37:16 2014 (r262817) +++ head/sys/modules/cyclic/Makefile Thu Mar 6 01:59:13 2014 (r262818) @@ -1,19 +1,21 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../cddl/dev/cyclic +SYSDIR?= ${.CURDIR}/../.. + +.PATH: ${SYSDIR}/cddl/dev/cyclic KMOD= cyclic SRCS= cyclic.c SRCS+= vnode_if.h -CFLAGS+= -I${.CURDIR}/../../cddl/compat/opensolaris \ - -I${.CURDIR}/../../cddl/contrib/opensolaris/uts/common \ - -I${.CURDIR}/../.. \ - -I${.CURDIR}/../../cddl/dev/cyclic/i386 +CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR} \ + -I${SYSDIR}/cddl/dev/cyclic/i386 IGNORE_PRAGMA= 1 .include -CFLAGS+= -include ${.CURDIR}/../../cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h Modified: head/sys/modules/dtrace/dtmalloc/Makefile ============================================================================== --- head/sys/modules/dtrace/dtmalloc/Makefile Thu Mar 6 00:37:16 2014 (r262817) +++ head/sys/modules/dtrace/dtmalloc/Makefile Thu Mar 6 01:59:13 2014 (r262818) @@ -1,15 +1,17 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/dev/dtmalloc +SYSDIR?= ${.CURDIR}/../../.. + +.PATH: ${SYSDIR}/cddl/dev/dtmalloc KMOD= dtmalloc SRCS= dtmalloc.c SRCS+= vnode_if.h -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ - -I${.CURDIR}/../../.. +CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR} .include -CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h Modified: head/sys/modules/dtrace/dtnfscl/Makefile ============================================================================== --- head/sys/modules/dtrace/dtnfscl/Makefile Thu Mar 6 00:37:16 2014 (r262817) +++ head/sys/modules/dtrace/dtnfscl/Makefile Thu Mar 6 01:59:13 2014 (r262818) @@ -1,15 +1,17 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../fs/nfsclient +SYSDIR?= ${.CURDIR}/../../.. + +.PATH: ${SYSDIR}/fs/nfsclient KMOD= dtnfscl SRCS= nfs_clkdtrace.c \ vnode_if.h -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ - -I${.CURDIR}/../../.. +CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR} .include -CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h Modified: head/sys/modules/dtrace/dtnfsclient/Makefile ============================================================================== --- head/sys/modules/dtrace/dtnfsclient/Makefile Thu Mar 6 00:37:16 2014 (r262817) +++ head/sys/modules/dtrace/dtnfsclient/Makefile Thu Mar 6 01:59:13 2014 (r262818) @@ -1,15 +1,17 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../nfsclient +SYSDIR?= ${.CURDIR}/../../.. + +.PATH: ${SYSDIR}/nfsclient KMOD= dtnfsclient SRCS= nfs_kdtrace.c SRCS+= vnode_if.h -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ - -I${.CURDIR}/../../.. +CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR} .include -CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h Modified: head/sys/modules/dtrace/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/dtrace/Makefile Thu Mar 6 00:37:16 2014 (r262817) +++ head/sys/modules/dtrace/dtrace/Makefile Thu Mar 6 01:59:13 2014 (r262818) @@ -1,12 +1,14 @@ # $FreeBSD$ +SYSDIR?= ${.CURDIR}/../../.. + ARCHDIR= ${MACHINE_CPUARCH} -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common/dtrace -.PATH: ${.CURDIR}/../../../cddl/compat/opensolaris/kern -.PATH: ${.CURDIR}/../../../cddl/kern -.PATH: ${.CURDIR}/../../../cddl/dev/dtrace -.PATH: ${.CURDIR}/../../../cddl/dev/dtrace/${ARCHDIR} +.PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace +.PATH: ${SYSDIR}/cddl/compat/opensolaris/kern +.PATH: ${SYSDIR}/cddl/kern +.PATH: ${SYSDIR}/cddl/dev/dtrace +.PATH: ${SYSDIR}/cddl/dev/dtrace/${ARCHDIR} KMOD= dtrace SRCS= dtrace.c \ @@ -14,11 +16,11 @@ SRCS= dtrace.c \ dtrace_subr.c .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" -.PATH: ${.CURDIR}/../../../cddl/dev/dtrace/x86 +.PATH: ${SYSDIR}/cddl/dev/dtrace/x86 SRCS+= dis_tables.c \ instr_size.c -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/intel \ - -I${.CURDIR}/../../../cddl/dev/dtrace/x86 +CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/intel \ + -I${SYSDIR}/cddl/dev/dtrace/x86 .endif SRCS+= bus_if.h device_if.h vnode_if.h @@ -36,11 +38,11 @@ SRCS += opensolaris_taskq.c SRCS+= opt_apic.h .endif -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/dev/dtrace \ - -I${.CURDIR}/../../../cddl/dev/dtrace/${ARCHDIR} \ - -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ - -I${.CURDIR}/../../.. -DDIS_MEM +CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ + -I${SYSDIR}/cddl/dev/dtrace \ + -I${SYSDIR}/cddl/dev/dtrace/${ARCHDIR} \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR} -DDIS_MEM CFLAGS+= -DSMP @@ -52,7 +54,7 @@ dtrace_asm.o: assym.s .include -CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h CWARNFLAGS+= -Wno-parentheses CWARNFLAGS+= -Wno-uninitialized Modified: head/sys/modules/dtrace/dtrace_test/Makefile ============================================================================== --- head/sys/modules/dtrace/dtrace_test/Makefile Thu Mar 6 00:37:16 2014 (r262817) +++ head/sys/modules/dtrace/dtrace_test/Makefile Thu Mar 6 01:59:13 2014 (r262818) @@ -1,16 +1,18 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/dev/dtrace +SYSDIR?= ${.CURDIR}/../../.. + +.PATH: ${SYSDIR}/cddl/dev/dtrace KMOD= dtrace_test SRCS= dtrace_test.c SRCS+= vnode_if.h -CFLAGS+= -I${.CURDIR}/../../.. +CFLAGS+= -I${SYSDIR} CFLAGS+= -D_KERNEL .include -CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h Modified: head/sys/modules/dtrace/dtraceall/Makefile ============================================================================== --- head/sys/modules/dtrace/dtraceall/Makefile Thu Mar 6 00:37:16 2014 (r262817) +++ head/sys/modules/dtrace/dtraceall/Makefile Thu Mar 6 01:59:13 2014 (r262818) @@ -1,9 +1,11 @@ # $FreeBSD$ +SYSDIR?= ${.CURDIR}/../../.. + KMOD= dtraceall SRCS= dtraceall.c opt_compat.h opt_nfs.h -CFLAGS+= -I${.CURDIR}/../../.. +CFLAGS+= -I${SYSDIR} .if !defined(KERNBUILDDIR) .if ${MACHINE_ARCH} == "amd64" @@ -14,4 +16,4 @@ opt_compat.h: .include -CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h Modified: head/sys/modules/dtrace/fasttrap/Makefile ============================================================================== --- head/sys/modules/dtrace/fasttrap/Makefile Thu Mar 6 00:37:16 2014 (r262817) +++ head/sys/modules/dtrace/fasttrap/Makefile Thu Mar 6 01:59:13 2014 (r262818) @@ -1,26 +1,28 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common/dtrace +SYSDIR?= ${.CURDIR}/../../.. + +.PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace KMOD= fasttrap SRCS= fasttrap.c fasttrap_isa.c opt_compat.h SRCS+= vnode_if.h -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ - -I${.CURDIR}/../../.. +CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR} .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/intel -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/uts/intel/dtrace +CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/intel +.PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/intel/dtrace .elif ${MACHINE_CPUARCH} == "powerpc" -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/powerpc -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/uts/powerpc/dtrace +CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/powerpc +.PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/powerpc/dtrace .endif CFLAGS+= -DSMP .include -CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h CWARNFLAGS+= -Wno-unused Modified: head/sys/modules/dtrace/fbt/Makefile ============================================================================== --- head/sys/modules/dtrace/fbt/Makefile Thu Mar 6 00:37:16 2014 (r262817) +++ head/sys/modules/dtrace/fbt/Makefile Thu Mar 6 01:59:13 2014 (r262818) @@ -1,6 +1,8 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/dev/fbt +SYSDIR?= ${.CURDIR}/../../.. + +.PATH: ${SYSDIR}/cddl/dev/fbt KMOD= fbt .if ${MACHINE_CPUARCH} == "powerpc" @@ -10,10 +12,10 @@ SRCS= fbt.c .endif SRCS+= vnode_if.h -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ - -I${.CURDIR}/../../.. +CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR} .include -CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h Modified: head/sys/modules/dtrace/lockstat/Makefile ============================================================================== --- head/sys/modules/dtrace/lockstat/Makefile Thu Mar 6 00:37:16 2014 (r262817) +++ head/sys/modules/dtrace/lockstat/Makefile Thu Mar 6 01:59:13 2014 (r262818) @@ -1,16 +1,18 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/dev/lockstat +SYSDIR?= ${.CURDIR}/../../.. + +.PATH: ${SYSDIR}/cddl/dev/lockstat KMOD= lockstat SRCS= lockstat.c SRCS+= vnode_if.h -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ - -I${.CURDIR}/../../.. +CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR} .include -CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h Modified: head/sys/modules/dtrace/profile/Makefile ============================================================================== --- head/sys/modules/dtrace/profile/Makefile Thu Mar 6 00:37:16 2014 (r262817) +++ head/sys/modules/dtrace/profile/Makefile Thu Mar 6 01:59:13 2014 (r262818) @@ -1,15 +1,17 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/dev/profile +SYSDIR?= ${.CURDIR}/../../.. + +.PATH: ${SYSDIR}/cddl/dev/profile KMOD= profile SRCS= profile.c SRCS+= vnode_if.h -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ - -I${.CURDIR}/../../.. +CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR} .include -CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h Modified: head/sys/modules/dtrace/prototype/Makefile ============================================================================== --- head/sys/modules/dtrace/prototype/Makefile Thu Mar 6 00:37:16 2014 (r262817) +++ head/sys/modules/dtrace/prototype/Makefile Thu Mar 6 01:59:13 2014 (r262818) @@ -1,15 +1,17 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/dev +SYSDIR?= ${.CURDIR}/../../.. + +.PATH: ${SYSDIR}/cddl/dev KMOD= prototype SRCS= prototype.c SRCS+= vnode_if.h -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ - -I${.CURDIR}/../../.. +CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR} .include -CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h Modified: head/sys/modules/dtrace/sdt/Makefile ============================================================================== --- head/sys/modules/dtrace/sdt/Makefile Thu Mar 6 00:37:16 2014 (r262817) +++ head/sys/modules/dtrace/sdt/Makefile Thu Mar 6 01:59:13 2014 (r262818) @@ -1,15 +1,17 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/dev/sdt +SYSDIR?= ${.CURDIR}/../../.. + +.PATH: ${SYSDIR}/cddl/dev/sdt KMOD= sdt SRCS= sdt.c SRCS+= vnode_if.h -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ - -I${.CURDIR}/../../.. +CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR} .include -CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h Modified: head/sys/modules/dtrace/systrace/Makefile ============================================================================== --- head/sys/modules/dtrace/systrace/Makefile Thu Mar 6 00:37:16 2014 (r262817) +++ head/sys/modules/dtrace/systrace/Makefile Thu Mar 6 01:59:13 2014 (r262818) @@ -1,15 +1,17 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/dev/systrace +SYSDIR?= ${.CURDIR}/../../.. + +.PATH: ${SYSDIR}/cddl/dev/systrace KMOD= systrace SRCS= systrace.c SRCS+= vnode_if.h -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ - -I${.CURDIR}/../../.. +CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR} .include -CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h Modified: head/sys/modules/dtrace/systrace_freebsd32/Makefile ============================================================================== --- head/sys/modules/dtrace/systrace_freebsd32/Makefile Thu Mar 6 00:37:16 2014 (r262817) +++ head/sys/modules/dtrace/systrace_freebsd32/Makefile Thu Mar 6 01:59:13 2014 (r262818) @@ -1,15 +1,17 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/dev/systrace +SYSDIR?= ${.CURDIR}/../../.. + +.PATH: ${SYSDIR}/cddl/dev/systrace KMOD= systrace_freebsd32 SRCS= systrace.c SRCS+= vnode_if.h -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ - -I${.CURDIR}/../../.. -DFREEBSD32_SYSTRACE +CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR} -DFREEBSD32_SYSTRACE .include -CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h Modified: head/sys/modules/dtrace/systrace_linux32/Makefile ============================================================================== --- head/sys/modules/dtrace/systrace_linux32/Makefile Thu Mar 6 00:37:16 2014 (r262817) +++ head/sys/modules/dtrace/systrace_linux32/Makefile Thu Mar 6 01:59:13 2014 (r262818) @@ -1,6 +1,8 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../cddl/dev/systrace +SYSDIR?= ${.CURDIR}/../../.. + +.PATH: ${SYSDIR}/cddl/dev/systrace .if ${MACHINE} == "amd64" KMOD= systrace_linux32 @@ -11,10 +13,10 @@ KMOD= systrace_linux SRCS= systrace.c SRCS+= vnode_if.h -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \ - -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \ - -I${.CURDIR}/../../.. -DLINUX_SYSTRACE +CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR} -DLINUX_SYSTRACE .include -CFLAGS+= -include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h Modified: head/sys/modules/opensolaris/Makefile ============================================================================== --- head/sys/modules/opensolaris/Makefile Thu Mar 6 00:37:16 2014 (r262817) +++ head/sys/modules/opensolaris/Makefile Thu Mar 6 01:59:13 2014 (r262818) @@ -1,6 +1,8 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../cddl/compat/opensolaris/kern +SYSDIR?= ${.CURDIR}/../.. + +.PATH: ${SYSDIR}/cddl/compat/opensolaris/kern KMOD= opensolaris SRCS= opensolaris.c \ @@ -9,7 +11,7 @@ SRCS= opensolaris.c \ opensolaris_misc.c \ opensolaris_sunddi.c -_A=${.CURDIR}/../../cddl/contrib/opensolaris/common/atomic +_A=${SYSDIR}/cddl/contrib/opensolaris/common/atomic .if exists(${_A}/${MACHINE_CPUARCH}/opensolaris_atomic.S) .PATH: ${_A}/${MACHINE_CPUARCH} SRCS+= opensolaris_atomic.S @@ -20,12 +22,12 @@ SRCS+= opensolaris_atomic.S SRCS+= opensolaris_atomic.c .endif -CFLAGS+= -I${.CURDIR}/../../cddl/compat/opensolaris \ - -I${.CURDIR}/../../cddl/contrib/opensolaris/uts/common \ - -I${.CURDIR}/../.. +CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR} IGNORE_PRAGMA= 1 .include -CFLAGS+= -include ${.CURDIR}/../../cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 02:00:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBD174D3; Thu, 6 Mar 2014 02:00:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CA3D3B2B; Thu, 6 Mar 2014 02:00:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s26201BM022369; Thu, 6 Mar 2014 02:00:01 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26201NU022368; Thu, 6 Mar 2014 02:00:01 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403060200.s26201NU022368@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 6 Mar 2014 02:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262819 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 02:00:01 -0000 Author: glebius Date: Thu Mar 6 02:00:01 2014 New Revision: 262819 URL: http://svnweb.freebsd.org/changeset/base/262819 Log: Fix compilation for 32-bit machines. Modified: head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Thu Mar 6 01:59:13 2014 (r262818) +++ head/usr.bin/netstat/route.c Thu Mar 6 02:00:01 2014 (r262819) @@ -329,8 +329,8 @@ size_cols_rtentry(struct rtentry *rt) wid_flags = MAX(len, wid_flags); if (Wflag) { - len = snprintf(buffer, sizeof(buffer), "%lu", - kread_counter((u_long )rt->rt_pksent)); + len = snprintf(buffer, sizeof(buffer), "%ju", + (uintmax_t )kread_counter((u_long )rt->rt_pksent)); wid_pksent = MAX(len, wid_pksent); } if (rt->rt_ifp) { @@ -867,8 +867,8 @@ p_rtentry_kvm(struct rtentry *rt) snprintf(buffer, sizeof(buffer), "%%-%d.%ds ", wid_flags, wid_flags); p_flags(rt->rt_flags, buffer); if (Wflag) { - printf("%*lu ", wid_pksent, - kread_counter((u_long )rt->rt_pksent)); + printf("%*ju ", wid_pksent, + (uintmax_t )kread_counter((u_long )rt->rt_pksent)); if (rt->rt_mtu != 0) printf("%*lu ", wid_mtu, rt->rt_mtu); From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 04:06:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F35CE1DD; Thu, 6 Mar 2014 04:06:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DED57845; Thu, 6 Mar 2014 04:06:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2646bDv074716; Thu, 6 Mar 2014 04:06:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2646bm4074712; Thu, 6 Mar 2014 04:06:37 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403060406.s2646bm4074712@svn.freebsd.org> From: Adrian Chadd Date: Thu, 6 Mar 2014 04:06:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262821 - in head/lib: . libbsdstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 04:06:38 -0000 Author: adrian Date: Thu Mar 6 04:06:36 2014 New Revision: 262821 URL: http://svnweb.freebsd.org/changeset/base/262821 Log: Add 'libstatfoo' from Sam Leffler. Added: head/lib/libbsdstat/ head/lib/libbsdstat/Makefile (contents, props changed) head/lib/libbsdstat/bsdstat.c (contents, props changed) head/lib/libbsdstat/bsdstat.h (contents, props changed) Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Thu Mar 6 02:48:54 2014 (r262820) +++ head/lib/Makefile Thu Mar 6 04:06:36 2014 (r262821) @@ -69,6 +69,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ libblocksruntime \ ${_libbluetooth} \ ${_libbsnmp} \ + libbsdstat \ libbz2 \ libcalendar \ libcam \ Added: head/lib/libbsdstat/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libbsdstat/Makefile Thu Mar 6 04:06:36 2014 (r262821) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +LIB= bsdstat +SHLIB_MAJOR= 1 +PRIVATELIB= + +WARNS?= 3 + +SRCS= bsdstat.c +INCS= bsdstat.h + +.include Added: head/lib/libbsdstat/bsdstat.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libbsdstat/bsdstat.c Thu Mar 6 04:06:36 2014 (r262821) @@ -0,0 +1,206 @@ +/*- + * Copyright (c) 2002-2007 Sam Leffler, Errno Consulting + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ + +#include +#include + +#include "bsdstat.h" + +static void +bsdstat_setfmt(struct bsdstat *sf, const char *fmt0) +{ +#define N(a) (sizeof(a)/sizeof(a[0])) + char fmt[4096]; + char *fp, *tok; + int i, j; + + j = 0; + strlcpy(fmt, fmt0, sizeof(fmt)); + for (fp = fmt; (tok = strsep(&fp, ", ")) != NULL;) { + for (i = 0; i < sf->nstats; i++) + if (strcasecmp(tok, sf->stats[i].name) == 0) + break; + if (i >= sf->nstats) { + fprintf(stderr, "%s: unknown statistic name \"%s\" " + "skipped\n", sf->name, tok); + continue; + } + if (j+3 > (int) sizeof(sf->fmts)) { + fprintf(stderr, "%s: not enough room for all stats; " + "stopped at %s\n", sf->name, tok); + break; + } + if (j != 0) + sf->fmts[j++] = ' '; + sf->fmts[j++] = FMTS_IS_STAT; + sf->fmts[j++] = i & 0xff; + sf->fmts[j++] = (i >> 8) & 0xff; + } + sf->fmts[j] = '\0'; +#undef N +} + +static void +bsdstat_collect(struct bsdstat *sf) +{ + fprintf(stderr, "%s: don't know how to collect data\n", sf->name); +} + +static void +bsdstat_update_tot(struct bsdstat *sf) +{ + fprintf(stderr, "%s: don't know how to update total data\n", sf->name); +} + +static int +bsdstat_get(struct bsdstat *sf, int s, char b[], size_t bs) +{ + fprintf(stderr, "%s: don't know how to get stat #%u\n", sf->name, s); + return 0; +} + +static void +bsdstat_print_header(struct bsdstat *sf, FILE *fd) +{ + const unsigned char *cp; + int i; + const struct fmt *f; + + for (cp = sf->fmts; *cp != '\0'; cp++) { + if (*cp == FMTS_IS_STAT) { + i = *(++cp); + i |= ((int) *(++cp)) << 8; + f = &sf->stats[i]; + fprintf(fd, "%*s", f->width, f->label); + } else + putc(*cp, fd); + } + putc('\n', fd); +} + +static void +bsdstat_print_current(struct bsdstat *sf, FILE *fd) +{ + char buf[32]; + const unsigned char *cp; + int i; + const struct fmt *f; + + for (cp = sf->fmts; *cp != '\0'; cp++) { + if (*cp == FMTS_IS_STAT) { + i = *(++cp); + i |= ((int) *(++cp)) << 8; + f = &sf->stats[i]; + if (sf->get_curstat(sf, i, buf, sizeof(buf))) + fprintf(fd, "%*s", f->width, buf); + } else + putc(*cp, fd); + } + putc('\n', fd); +} + +static void +bsdstat_print_total(struct bsdstat *sf, FILE *fd) +{ + char buf[32]; + const unsigned char *cp; + const struct fmt *f; + int i; + + for (cp = sf->fmts; *cp != '\0'; cp++) { + if (*cp == FMTS_IS_STAT) { + i = *(++cp); + i |= ((int) *(++cp)) << 8; + f = &sf->stats[i]; + if (sf->get_totstat(sf, i, buf, sizeof(buf))) + fprintf(fd, "%*s", f->width, buf); + } else + putc(*cp, fd); + } + putc('\n', fd); +} + +static void +bsdstat_print_verbose(struct bsdstat *sf, FILE *fd) +{ + const struct fmt *f; + char s[32]; + int i, width; + + width = 0; + for (i = 0; i < sf->nstats; i++) { + f = &sf->stats[i]; + if (f->width > width) + width = f->width; + } + for (i = 0; i < sf->nstats; i++) { + f = &sf->stats[i]; + if (sf->get_totstat(sf, i, s, sizeof(s)) && strcmp(s, "0")) + fprintf(fd, "%-*s %s\n", width, s, f->desc); + } +} + +static void +bsdstat_print_fields(struct bsdstat *sf, FILE *fd) +{ + int i, w, width; + + width = 0; + for (i = 0; i < sf->nstats; i++) { + w = strlen(sf->stats[i].name); + if (w > width) + width = w; + } + for (i = 0; i < sf->nstats; i++) { + const struct fmt *f = &sf->stats[i]; + if (f->width != 0) + fprintf(fd, "%-*s %s\n", width, f->name, f->desc); + } +} + +void +bsdstat_init(struct bsdstat *sf, const char *name, const struct fmt *stats, int nstats) +{ + sf->name = name; + sf->stats = stats; + sf->nstats = nstats; + sf->setfmt = bsdstat_setfmt; + sf->collect_cur = bsdstat_collect; + sf->collect_tot = bsdstat_collect; + sf->update_tot = bsdstat_update_tot; + sf->get_curstat = bsdstat_get; + sf->get_totstat = bsdstat_get; + sf->print_header = bsdstat_print_header; + sf->print_current = bsdstat_print_current; + sf->print_total = bsdstat_print_total; + sf->print_verbose = bsdstat_print_verbose; + sf->print_fields = bsdstat_print_fields; +} Added: head/lib/libbsdstat/bsdstat.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libbsdstat/bsdstat.h Thu Mar 6 04:06:36 2014 (r262821) @@ -0,0 +1,128 @@ +/*- + * Copyright (c) 2002-2007 Sam Leffler, Errno Consulting + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ + +#ifndef _BSDSTAT_H_ +#define _BSDSTAT_H_ +/* + * Base class for managing+displaying periodically collected statistics. + */ + +/* + * Statistic definition/description. The are defined + * for stats that correspond 1-1 w/ a collected stat + * and for stats that are calculated indirectly. + */ +struct fmt { + int width; /* printed field width */ + const char* name; /* stat field name referenced by user */ + const char* label; /* printed header label */ + const char* desc; /* verbose description */ +}; + +#define BSDSTAT_DECL_METHODS(_p) \ + /* set the format of the statistics to display */ \ + void (*setfmt)(_p, const char *); \ + /* collect+store ``current statistics'' */ \ + void (*collect_cur)(_p); \ + /* collect+store ``total statistics'' */ \ + void (*collect_tot)(_p); \ + /* update ``total statistics'' if necessary from current */ \ + void (*update_tot)(_p); \ + /* format a statistic from the current stats */ \ + int (*get_curstat)(_p, int, char [], size_t); \ + /* format a statistic from the total stats */ \ + int (*get_totstat)(_p, int, char [], size_t); \ + /* print field headers terminated by a \n */ \ + void (*print_header)(_p, FILE *); \ + /* print current statistics terminated by a \n */ \ + void (*print_current)(_p, FILE *); \ + /* print total statistics terminated by a \n */ \ + void (*print_total)(_p, FILE *); \ + /* print total statistics in a verbose (1 stat/line) format */ \ + void (*print_verbose)(_p, FILE *); \ + /* print available statistics */ \ + void (*print_fields)(_p, FILE *) + +/* + * Statistics base class. This class is not usable; only + * classes derived from it are useful. + */ +struct bsdstat { + const char *name; /* statistics name, e.g. wlanstats */ + const struct fmt *stats; /* statistics in class */ + int nstats; /* number of stats */ +#define FMTS_IS_STAT 0x80 /* the following two bytes are the stat id */ + unsigned char fmts[4096]; /* private: compiled stats to display */ + + BSDSTAT_DECL_METHODS(struct bsdstat *); +}; + +extern void bsdstat_init(struct bsdstat *, const char *name, + const struct fmt *stats, int nstats); + +#define BSDSTAT_DEFINE_BOUNCE(_t) \ +static void _t##_setfmt(struct _t *wf, const char *fmt0) \ + { wf->base.setfmt(&wf->base, fmt0); } \ +static void _t##_collect_cur(struct _t *wf) \ + { wf->base.collect_cur(&wf->base); } \ +static void _t##_collect_tot(struct _t *wf) \ + { wf->base.collect_tot(&wf->base); } \ +static void _t##_update_tot(struct _t *wf) \ + { wf->base.update_tot(&wf->base); } \ +static int _t##_get_curstat(struct _t *wf, int s, char b[], size_t bs) \ + { return wf->base.get_curstat(&wf->base, s, b, bs); } \ +static int _t##_get_totstat(struct _t *wf, int s, char b[], size_t bs) \ + { return wf->base.get_totstat(&wf->base, s, b, bs); } \ +static void _t##_print_header(struct _t *wf, FILE *fd) \ + { wf->base.print_header(&wf->base, fd); } \ +static void _t##_print_current(struct _t *wf, FILE *fd) \ + { wf->base.print_current(&wf->base, fd); } \ +static void _t##_print_total(struct _t *wf, FILE *fd) \ + { wf->base.print_total(&wf->base, fd); } \ +static void _t##_print_verbose(struct _t *wf, FILE *fd) \ + { wf->base.print_verbose(&wf->base, fd); } \ +static void _t##_print_fields(struct _t *wf, FILE *fd) \ + { wf->base.print_fields(&wf->base, fd); } + +#define BSDSTAT_BOUNCE(_p, _t) do { \ + _p->base.setfmt = _t##_setfmt; \ + _p->base.collect_cur = _t##_collect_cur; \ + _p->base.collect_tot = _t##_collect_tot; \ + _p->base.update_tot = _t##_update_tot; \ + _p->base.get_curstat = _t##_get_curstat; \ + _p->base.get_totstat = _t##_get_totstat; \ + _p->base.print_header = _t##_print_header; \ + _p->base.print_current = _t##_print_current; \ + _p->base.print_total = _t##_print_total; \ + _p->base.print_verbose = _t##_print_verbose; \ + _p->base.print_fields = _t##_print_fields; \ +} while (0) +#endif /* _BSDSTAT_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 06:39:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B96182D; Thu, 6 Mar 2014 06:39:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0900B326; Thu, 6 Mar 2014 06:39:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s266dtsj035961; Thu, 6 Mar 2014 06:39:55 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s266dtZ1035960; Thu, 6 Mar 2014 06:39:55 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201403060639.s266dtZ1035960@svn.freebsd.org> From: Kevin Lo Date: Thu, 6 Mar 2014 06:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262822 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 06:39:56 -0000 Author: kevlo Date: Thu Mar 6 06:39:55 2014 New Revision: 262822 URL: http://svnweb.freebsd.org/changeset/base/262822 Log: Fix a logic error when enabling MAC. Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Thu Mar 6 04:06:36 2014 (r262821) +++ head/sys/dev/usb/wlan/if_urtwn.c Thu Mar 6 06:39:55 2014 (r262822) @@ -1892,8 +1892,8 @@ urtwn_power_on(struct urtwn_softc *sc) urtwn_write_2(sc, R92C_APS_FSMCO, urtwn_read_2(sc, R92C_APS_FSMCO) | R92C_APS_FSMCO_APFM_ONMAC); for (ntries = 0; ntries < 1000; ntries++) { - if (urtwn_read_2(sc, R92C_APS_FSMCO) & - R92C_APS_FSMCO_APFM_ONMAC) + if (!(urtwn_read_2(sc, R92C_APS_FSMCO) & + R92C_APS_FSMCO_APFM_ONMAC)) break; DELAY(5); } From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 07:43:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2055A2A; Thu, 6 Mar 2014 07:43:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AEA12ADD; Thu, 6 Mar 2014 07:43:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s267hhmX063348; Thu, 6 Mar 2014 07:43:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s267hhOO063345; Thu, 6 Mar 2014 07:43:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403060743.s267hhOO063345@svn.freebsd.org> From: Adrian Chadd Date: Thu, 6 Mar 2014 07:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262824 - head/tools/tools/net80211/wlanstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 07:43:43 -0000 Author: adrian Date: Thu Mar 6 07:43:42 2014 New Revision: 262824 URL: http://svnweb.freebsd.org/changeset/base/262824 Log: Modify wlanstats to now use the copy of libbsdstat in /usr/lib/private. Modified: head/tools/tools/net80211/wlanstats/Makefile head/tools/tools/net80211/wlanstats/wlanstats.c head/tools/tools/net80211/wlanstats/wlanstats.h Modified: head/tools/tools/net80211/wlanstats/Makefile ============================================================================== --- head/tools/tools/net80211/wlanstats/Makefile Thu Mar 6 07:42:27 2014 (r262823) +++ head/tools/tools/net80211/wlanstats/Makefile Thu Mar 6 07:43:42 2014 (r262824) @@ -5,8 +5,10 @@ PROG= wlanstats BINDIR= /usr/local/bin NO_MAN= +USEPRIVATELIB= -SRCS= statfoo.c wlanstats.c main.c +SRCS= wlanstats.c main.c +LDADD= -lbsdstat CFLAGS.clang+= -fbracket-depth=512 .include Modified: head/tools/tools/net80211/wlanstats/wlanstats.c ============================================================================== --- head/tools/tools/net80211/wlanstats/wlanstats.c Thu Mar 6 07:42:27 2014 (r262823) +++ head/tools/tools/net80211/wlanstats/wlanstats.c Thu Mar 6 07:43:42 2014 (r262824) @@ -531,7 +531,7 @@ wlan_collect(struct wlanstatfoo_p *wf, } static void -wlan_collect_cur(struct statfoo *sf) +wlan_collect_cur(struct bsdstat *sf) { struct wlanstatfoo_p *wf = (struct wlanstatfoo_p *) sf; @@ -539,7 +539,7 @@ wlan_collect_cur(struct statfoo *sf) } static void -wlan_collect_tot(struct statfoo *sf) +wlan_collect_tot(struct bsdstat *sf) { struct wlanstatfoo_p *wf = (struct wlanstatfoo_p *) sf; @@ -547,7 +547,7 @@ wlan_collect_tot(struct statfoo *sf) } static void -wlan_update_tot(struct statfoo *sf) +wlan_update_tot(struct bsdstat *sf) { struct wlanstatfoo_p *wf = (struct wlanstatfoo_p *) sf; @@ -669,7 +669,7 @@ wlan_getinfo(struct wlanstatfoo_p *wf, i } static int -wlan_get_curstat(struct statfoo *sf, int s, char b[], size_t bs) +wlan_get_curstat(struct bsdstat *sf, int s, char b[], size_t bs) { struct wlanstatfoo_p *wf = (struct wlanstatfoo_p *) sf; #define STAT(x) \ @@ -833,7 +833,7 @@ wlan_get_curstat(struct statfoo *sf, int } static int -wlan_get_totstat(struct statfoo *sf, int s, char b[], size_t bs) +wlan_get_totstat(struct bsdstat *sf, int s, char b[], size_t bs) { struct wlanstatfoo_p *wf = (struct wlanstatfoo_p *) sf; #define STAT(x) \ @@ -994,7 +994,7 @@ wlan_get_totstat(struct statfoo *sf, int #undef STAT } -STATFOO_DEFINE_BOUNCE(wlanstatfoo) +BSDSTAT_DEFINE_BOUNCE(wlanstatfoo) struct wlanstatfoo * wlanstats_new(const char *ifname, const char *fmtstring) @@ -1004,7 +1004,7 @@ wlanstats_new(const char *ifname, const wf = calloc(1, sizeof(struct wlanstatfoo_p)); if (wf != NULL) { - statfoo_init(&wf->base.base, "wlanstats", wlanstats, N(wlanstats)); + bsdstat_init(&wf->base.base, "wlanstats", wlanstats, N(wlanstats)); /* override base methods */ wf->base.base.collect_cur = wlan_collect_cur; wf->base.base.collect_tot = wlan_collect_tot; @@ -1013,7 +1013,7 @@ wlanstats_new(const char *ifname, const wf->base.base.update_tot = wlan_update_tot; /* setup bounce functions for public methods */ - STATFOO_BOUNCE(wf, wlanstatfoo); + BSDSTAT_BOUNCE(wf, wlanstatfoo); /* setup our public methods */ wf->base.setifname = wlan_setifname; Modified: head/tools/tools/net80211/wlanstats/wlanstats.h ============================================================================== --- head/tools/tools/net80211/wlanstats/wlanstats.h Thu Mar 6 07:42:27 2014 (r262823) +++ head/tools/tools/net80211/wlanstats/wlanstats.h Thu Mar 6 07:43:42 2014 (r262824) @@ -32,15 +32,15 @@ #ifndef _WLANSTATS_H_ #define _WLANSTATS_H_ -#include "statfoo.h" +#include "bsdstat.h" /* * wlan statistics class. */ struct wlanstatfoo { - struct statfoo base; + struct bsdstat base; - STATFOO_DECL_METHODS(struct wlanstatfoo *); + BSDSTAT_DECL_METHODS(struct wlanstatfoo *); /* set the network interface name for collection */ void (*setifname)(struct wlanstatfoo *, const char *ifname); From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 07:44:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 035E5BFB; Thu, 6 Mar 2014 07:44:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CBBDCAEB; Thu, 6 Mar 2014 07:44:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s267i8dc063483; Thu, 6 Mar 2014 07:44:08 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s267i8AO063482; Thu, 6 Mar 2014 07:44:08 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403060744.s267i8AO063482@svn.freebsd.org> From: Adrian Chadd Date: Thu, 6 Mar 2014 07:44:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262825 - head/tools/tools/net80211/wlanstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 07:44:09 -0000 Author: adrian Date: Thu Mar 6 07:44:08 2014 New Revision: 262825 URL: http://svnweb.freebsd.org/changeset/base/262825 Log: Remove these; they're no longer required. Deleted: head/tools/tools/net80211/wlanstats/statfoo.c head/tools/tools/net80211/wlanstats/statfoo.h From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 07:44:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB870D49; Thu, 6 Mar 2014 07:44:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9972FAF9; Thu, 6 Mar 2014 07:44:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s267ijpF063637; Thu, 6 Mar 2014 07:44:45 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s267ijZb063636; Thu, 6 Mar 2014 07:44:45 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201403060744.s267ijZb063636@svn.freebsd.org> From: Jeremie Le Hen Date: Thu, 6 Mar 2014 07:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262826 - head/lib/libc/db/btree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 07:44:45 -0000 Author: jlh Date: Thu Mar 6 07:44:45 2014 New Revision: 262826 URL: http://svnweb.freebsd.org/changeset/base/262826 Log: Let __bt_put() accept the R_SETCURSOR flag, as stated in the dbopen(3) manpage. While here, update the comment above with all the accepted flags. Reviewed by: silence on hackers@ MFC after: 2 weeks Modified: head/lib/libc/db/btree/bt_put.c Modified: head/lib/libc/db/btree/bt_put.c ============================================================================== --- head/lib/libc/db/btree/bt_put.c Thu Mar 6 07:44:08 2014 (r262825) +++ head/lib/libc/db/btree/bt_put.c Thu Mar 6 07:44:45 2014 (r262826) @@ -55,7 +55,7 @@ static EPG *bt_fast(BTREE *, const DBT * * dbp: pointer to access method * key: key * data: data - * flag: R_NOOVERWRITE + * flag: R_NOOVERWRITE, R_SETCURSOR, R_CURSOR * * Returns: * RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key is already in the @@ -91,6 +91,7 @@ __bt_put(const DB *dbp, DBT *key, const switch (flags) { case 0: case R_NOOVERWRITE: + case R_SETCURSOR: break; case R_CURSOR: /* From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 07:45:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5341EB0; Thu, 6 Mar 2014 07:45:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C2678B0B; Thu, 6 Mar 2014 07:45:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s267jsOw063991; Thu, 6 Mar 2014 07:45:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s267jsfr063988; Thu, 6 Mar 2014 07:45:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403060745.s267jsfr063988@svn.freebsd.org> From: Adrian Chadd Date: Thu, 6 Mar 2014 07:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262827 - head/tools/tools/ath/athaggrstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 07:45:54 -0000 Author: adrian Date: Thu Mar 6 07:45:53 2014 New Revision: 262827 URL: http://svnweb.freebsd.org/changeset/base/262827 Log: Migrate athaggrstats to use bsdstat. Deleted: head/tools/tools/ath/athaggrstats/statfoo.c head/tools/tools/ath/athaggrstats/statfoo.h Modified: head/tools/tools/ath/athaggrstats/Makefile head/tools/tools/ath/athaggrstats/athaggrstats.c head/tools/tools/ath/athaggrstats/athaggrstats.h Modified: head/tools/tools/ath/athaggrstats/Makefile ============================================================================== --- head/tools/tools/ath/athaggrstats/Makefile Thu Mar 6 07:44:45 2014 (r262826) +++ head/tools/tools/ath/athaggrstats/Makefile Thu Mar 6 07:45:53 2014 (r262827) @@ -4,7 +4,7 @@ PROG= athaggrstats -SRCS= main.c statfoo.c athaggrstats.c opt_ah.h ah_osdep.h +SRCS= main.c athaggrstats.c opt_ah.h ah_osdep.h CLEANFILES+= opt_ah.h @@ -12,6 +12,8 @@ CLEANFILES+= opt_ah.h CFLAGS+=-DATH_SUPPORT_ANI CFLAGS+=-DATH_SUPPORT_TDMA +USEPRIVATELIB= +LDADD=-lbsdstat opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h Modified: head/tools/tools/ath/athaggrstats/athaggrstats.c ============================================================================== --- head/tools/tools/ath/athaggrstats/athaggrstats.c Thu Mar 6 07:44:45 2014 (r262826) +++ head/tools/tools/ath/athaggrstats/athaggrstats.c Thu Mar 6 07:45:53 2014 (r262827) @@ -184,7 +184,7 @@ ath_collect(struct athaggrstatfoo_p *wf, } static void -ath_collect_cur(struct statfoo *sf) +ath_collect_cur(struct bsdstat *sf) { struct athaggrstatfoo_p *wf = (struct athaggrstatfoo_p *) sf; @@ -192,7 +192,7 @@ ath_collect_cur(struct statfoo *sf) } static void -ath_collect_tot(struct statfoo *sf) +ath_collect_tot(struct bsdstat *sf) { struct athaggrstatfoo_p *wf = (struct athaggrstatfoo_p *) sf; @@ -200,7 +200,7 @@ ath_collect_tot(struct statfoo *sf) } static void -ath_update_tot(struct statfoo *sf) +ath_update_tot(struct bsdstat *sf) { struct athaggrstatfoo_p *wf = (struct athaggrstatfoo_p *) sf; @@ -219,7 +219,7 @@ snprintrate(char b[], size_t bs, int rat } static int -ath_get_curstat(struct statfoo *sf, int s, char b[], size_t bs) +ath_get_curstat(struct bsdstat *sf, int s, char b[], size_t bs) { struct athaggrstatfoo_p *wf = (struct athaggrstatfoo_p *) sf; #define STAT(x) \ @@ -275,7 +275,7 @@ ath_get_curstat(struct statfoo *sf, int } static int -ath_get_totstat(struct statfoo *sf, int s, char b[], size_t bs) +ath_get_totstat(struct bsdstat *sf, int s, char b[], size_t bs) { struct athaggrstatfoo_p *wf = (struct athaggrstatfoo_p *) sf; #define STAT(x) \ @@ -331,7 +331,7 @@ ath_get_totstat(struct statfoo *sf, int } static void -ath_print_verbose(struct statfoo *sf, FILE *fd) +ath_print_verbose(struct bsdstat *sf, FILE *fd) { struct athaggrstatfoo_p *wf = (struct athaggrstatfoo_p *) sf; const struct fmt *f; @@ -363,7 +363,7 @@ ath_print_verbose(struct statfoo *sf, FI fprintf(fd, "\n"); } -STATFOO_DEFINE_BOUNCE(athaggrstatfoo) +BSDSTAT_DEFINE_BOUNCE(athaggrstatfoo) struct athaggrstatfoo * athaggrstats_new(const char *ifname, const char *fmtstring) @@ -373,7 +373,7 @@ athaggrstats_new(const char *ifname, con wf = calloc(1, sizeof(struct athaggrstatfoo_p)); if (wf != NULL) { - statfoo_init(&wf->base.base, "athaggrstats", + bsdstat_init(&wf->base.base, "athaggrstats", athaggrstats, N(athaggrstats)); /* override base methods */ wf->base.base.collect_cur = ath_collect_cur; @@ -384,7 +384,7 @@ athaggrstats_new(const char *ifname, con wf->base.base.print_verbose = ath_print_verbose; /* setup bounce functions for public methods */ - STATFOO_BOUNCE(wf, athaggrstatfoo); + BSDSTAT_BOUNCE(wf, athaggrstatfoo); /* setup our public methods */ wf->base.setifname = ath_setifname; Modified: head/tools/tools/ath/athaggrstats/athaggrstats.h ============================================================================== --- head/tools/tools/ath/athaggrstats/athaggrstats.h Thu Mar 6 07:44:45 2014 (r262826) +++ head/tools/tools/ath/athaggrstats/athaggrstats.h Thu Mar 6 07:45:53 2014 (r262827) @@ -32,15 +32,15 @@ #ifndef _ATHAGGRSTATS_H_ #define _ATHAGGRSTATS_H_ -#include "statfoo.h" +#include "bsdstat.h" /* * ath statistics class. */ struct athaggrstatfoo { - struct statfoo base; + struct bsdstat base; - STATFOO_DECL_METHODS(struct athaggrstatfoo *); + BSDSTAT_DECL_METHODS(struct athaggrstatfoo *); /* set the network interface name for collection */ void (*setifname)(struct athaggrstatfoo *, const char *ifname); From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 07:46:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2301F170; Thu, 6 Mar 2014 07:46:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0FEE3B1B; Thu, 6 Mar 2014 07:46:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s267kWY5064198; Thu, 6 Mar 2014 07:46:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s267kWoO064197; Thu, 6 Mar 2014 07:46:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403060746.s267kWoO064197@svn.freebsd.org> From: Adrian Chadd Date: Thu, 6 Mar 2014 07:46:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262828 - head/tools/tools/ath/athaggrstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 07:46:33 -0000 Author: adrian Date: Thu Mar 6 07:46:32 2014 New Revision: 262828 URL: http://svnweb.freebsd.org/changeset/base/262828 Log: Fix a compiler warning. Thanks Clang! Modified: head/tools/tools/ath/athaggrstats/athaggrstats.c Modified: head/tools/tools/ath/athaggrstats/athaggrstats.c ============================================================================== --- head/tools/tools/ath/athaggrstats/athaggrstats.c Thu Mar 6 07:45:53 2014 (r262827) +++ head/tools/tools/ath/athaggrstats/athaggrstats.c Thu Mar 6 07:46:32 2014 (r262828) @@ -180,7 +180,7 @@ ath_collect(struct athaggrstatfoo_p *wf, { wf->ifr.ifr_data = (caddr_t) stats; if (ioctl(wf->s, SIOCGATHAGSTATS, &wf->ifr) < 0) - err(1, wf->ifr.ifr_name); + err(1, "%s: ioctl: %s", __func__, wf->ifr.ifr_name); } static void From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 07:47:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B1432AE; Thu, 6 Mar 2014 07:47:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 87A97B21; Thu, 6 Mar 2014 07:47:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s267lKFm064328; Thu, 6 Mar 2014 07:47:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s267lJrt064325; Thu, 6 Mar 2014 07:47:19 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403060747.s267lJrt064325@svn.freebsd.org> From: Adrian Chadd Date: Thu, 6 Mar 2014 07:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262829 - head/tools/tools/ath/athstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 07:47:20 -0000 Author: adrian Date: Thu Mar 6 07:47:19 2014 New Revision: 262829 URL: http://svnweb.freebsd.org/changeset/base/262829 Log: Migrate athstats to use bsdstat. Deleted: head/tools/tools/ath/athstats/statfoo.c head/tools/tools/ath/athstats/statfoo.h Modified: head/tools/tools/ath/athstats/Makefile head/tools/tools/ath/athstats/athstats.c head/tools/tools/ath/athstats/athstats.h Modified: head/tools/tools/ath/athstats/Makefile ============================================================================== --- head/tools/tools/ath/athstats/Makefile Thu Mar 6 07:46:32 2014 (r262828) +++ head/tools/tools/ath/athstats/Makefile Thu Mar 6 07:47:19 2014 (r262829) @@ -12,7 +12,7 @@ PROG= athstats # to not compile, use gcc for now. #CC= gcc -SRCS= main.c statfoo.c athstats.c opt_ah.h ah_osdep.h +SRCS= main.c athstats.c opt_ah.h ah_osdep.h CLEANFILES+= opt_ah.h @@ -23,6 +23,9 @@ CFLAGS+=-DATH_SUPPORT_TDMA CFLAGS.clang+= -fbracket-depth=512 +USEPRIVATELIB= +LDADD= -lbsdstat + opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h Modified: head/tools/tools/ath/athstats/athstats.c ============================================================================== --- head/tools/tools/ath/athstats/athstats.c Thu Mar 6 07:46:32 2014 (r262828) +++ head/tools/tools/ath/athstats/athstats.c Thu Mar 6 07:47:19 2014 (r262829) @@ -521,7 +521,7 @@ ath_collect(struct athstatfoo_p *wf, str } static void -ath_collect_cur(struct statfoo *sf) +ath_collect_cur(struct bsdstat *sf) { struct athstatfoo_p *wf = (struct athstatfoo_p *) sf; @@ -529,7 +529,7 @@ ath_collect_cur(struct statfoo *sf) } static void -ath_collect_tot(struct statfoo *sf) +ath_collect_tot(struct bsdstat *sf) { struct athstatfoo_p *wf = (struct athstatfoo_p *) sf; @@ -537,7 +537,7 @@ ath_collect_tot(struct statfoo *sf) } static void -ath_update_tot(struct statfoo *sf) +ath_update_tot(struct bsdstat *sf) { struct athstatfoo_p *wf = (struct athstatfoo_p *) sf; @@ -556,7 +556,7 @@ snprintrate(char b[], size_t bs, int rat } static int -ath_get_curstat(struct statfoo *sf, int s, char b[], size_t bs) +ath_get_curstat(struct bsdstat *sf, int s, char b[], size_t bs) { struct athstatfoo_p *wf = (struct athstatfoo_p *) sf; #define STAT(x) \ @@ -802,7 +802,7 @@ ath_get_curstat(struct statfoo *sf, int } static int -ath_get_totstat(struct statfoo *sf, int s, char b[], size_t bs) +ath_get_totstat(struct bsdstat *sf, int s, char b[], size_t bs) { struct athstatfoo_p *wf = (struct athstatfoo_p *) sf; #define STAT(x) \ @@ -1045,7 +1045,7 @@ ath_get_totstat(struct statfoo *sf, int } static void -ath_print_verbose(struct statfoo *sf, FILE *fd) +ath_print_verbose(struct bsdstat *sf, FILE *fd) { struct athstatfoo_p *wf = (struct athstatfoo_p *) sf; #define isphyerr(i) (S_PHY_MIN <= i && i <= S_PHY_MAX) @@ -1078,7 +1078,7 @@ ath_print_verbose(struct statfoo *sf, FI #undef isphyerr } -STATFOO_DEFINE_BOUNCE(athstatfoo) +BSDSTAT_DEFINE_BOUNCE(athstatfoo) struct athstatfoo * athstats_new(const char *ifname, const char *fmtstring) @@ -1088,7 +1088,7 @@ athstats_new(const char *ifname, const c wf = calloc(1, sizeof(struct athstatfoo_p)); if (wf != NULL) { - statfoo_init(&wf->base.base, "athstats", athstats, N(athstats)); + bsdstat_init(&wf->base.base, "athstats", athstats, N(athstats)); /* override base methods */ wf->base.base.collect_cur = ath_collect_cur; wf->base.base.collect_tot = ath_collect_tot; @@ -1098,7 +1098,7 @@ athstats_new(const char *ifname, const c wf->base.base.print_verbose = ath_print_verbose; /* setup bounce functions for public methods */ - STATFOO_BOUNCE(wf, athstatfoo); + BSDSTAT_BOUNCE(wf, athstatfoo); /* setup our public methods */ wf->base.setifname = ath_setifname; Modified: head/tools/tools/ath/athstats/athstats.h ============================================================================== --- head/tools/tools/ath/athstats/athstats.h Thu Mar 6 07:46:32 2014 (r262828) +++ head/tools/tools/ath/athstats/athstats.h Thu Mar 6 07:47:19 2014 (r262829) @@ -32,15 +32,15 @@ #ifndef _ATHSTATS_H_ #define _ATHSTATS_H_ -#include "statfoo.h" +#include /* * ath statistics class. */ struct athstatfoo { - struct statfoo base; + struct bsdstat base; - STATFOO_DECL_METHODS(struct athstatfoo *); + BSDSTAT_DECL_METHODS(struct athstatfoo *); /* set the network interface name for collection */ void (*setifname)(struct athstatfoo *, const char *ifname); From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 07:48:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07D983F8; Thu, 6 Mar 2014 07:48:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E8590B29; Thu, 6 Mar 2014 07:48:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s267mh2g064510; Thu, 6 Mar 2014 07:48:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s267mh7j064507; Thu, 6 Mar 2014 07:48:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403060748.s267mh7j064507@svn.freebsd.org> From: Adrian Chadd Date: Thu, 6 Mar 2014 07:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262830 - head/tools/tools/mwl/mwlstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 07:48:44 -0000 Author: adrian Date: Thu Mar 6 07:48:43 2014 New Revision: 262830 URL: http://svnweb.freebsd.org/changeset/base/262830 Log: Migrate mwlstats to use bsdstat. Deleted: head/tools/tools/mwl/mwlstats/statfoo.c head/tools/tools/mwl/mwlstats/statfoo.h Modified: head/tools/tools/mwl/mwlstats/Makefile head/tools/tools/mwl/mwlstats/mwlstats.c head/tools/tools/mwl/mwlstats/mwlstats.h Modified: head/tools/tools/mwl/mwlstats/Makefile ============================================================================== --- head/tools/tools/mwl/mwlstats/Makefile Thu Mar 6 07:47:19 2014 (r262829) +++ head/tools/tools/mwl/mwlstats/Makefile Thu Mar 6 07:48:43 2014 (r262830) @@ -4,7 +4,9 @@ PROG= mwlstats BINDIR= /usr/local/bin NO_MAN= -SRCS= main.c statfoo.c mwlstats.c +SRCS= main.c mwlstats.c +USEPRIVATELIB= +LDADD=-lbsdstat .include Modified: head/tools/tools/mwl/mwlstats/mwlstats.c ============================================================================== --- head/tools/tools/mwl/mwlstats/mwlstats.c Thu Mar 6 07:47:19 2014 (r262829) +++ head/tools/tools/mwl/mwlstats/mwlstats.c Thu Mar 6 07:48:43 2014 (r262830) @@ -265,7 +265,7 @@ mwl_collect(struct mwlstatfoo_p *wf, str } static void -mwl_collect_cur(struct statfoo *sf) +mwl_collect_cur(struct bsdstat *sf) { struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; @@ -273,7 +273,7 @@ mwl_collect_cur(struct statfoo *sf) } static void -mwl_collect_tot(struct statfoo *sf) +mwl_collect_tot(struct bsdstat *sf) { struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; @@ -281,7 +281,7 @@ mwl_collect_tot(struct statfoo *sf) } static void -mwl_update_tot(struct statfoo *sf) +mwl_update_tot(struct bsdstat *sf) { struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; @@ -300,7 +300,7 @@ setrate(char b[], size_t bs, uint8_t rat } static int -mwl_get_curstat(struct statfoo *sf, int s, char b[], size_t bs) +mwl_get_curstat(struct bsdstat *sf, int s, char b[], size_t bs) { struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; #define STAT(x) \ @@ -406,7 +406,7 @@ mwl_get_curstat(struct statfoo *sf, int } static int -mwl_get_totstat(struct statfoo *sf, int s, char b[], size_t bs) +mwl_get_totstat(struct bsdstat *sf, int s, char b[], size_t bs) { struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; #define STAT(x) \ @@ -510,7 +510,7 @@ mwl_get_totstat(struct statfoo *sf, int } static void -mwl_print_verbose(struct statfoo *sf, FILE *fd) +mwl_print_verbose(struct bsdstat *sf, FILE *fd) { struct mwlstatfoo_p *wf = (struct mwlstatfoo_p *) sf; const struct fmt *f; @@ -539,7 +539,7 @@ mwl_print_verbose(struct statfoo *sf, FI wf->total.mst_ant_rx[i]); } -STATFOO_DEFINE_BOUNCE(mwlstatfoo) +BSDSTAT_DEFINE_BOUNCE(mwlstatfoo) struct mwlstatfoo * mwlstats_new(const char *ifname, const char *fmtstring) @@ -549,7 +549,7 @@ mwlstats_new(const char *ifname, const c wf = calloc(1, sizeof(struct mwlstatfoo_p)); if (wf != NULL) { - statfoo_init(&wf->base.base, "mwlstats", mwlstats, N(mwlstats)); + bsdstat_init(&wf->base.base, "mwlstats", mwlstats, N(mwlstats)); /* override base methods */ wf->base.base.collect_cur = mwl_collect_cur; wf->base.base.collect_tot = mwl_collect_tot; @@ -559,7 +559,7 @@ mwlstats_new(const char *ifname, const c wf->base.base.print_verbose = mwl_print_verbose; /* setup bounce functions for public methods */ - STATFOO_BOUNCE(wf, mwlstatfoo); + BSDSTAT_BOUNCE(wf, mwlstatfoo); /* setup our public methods */ wf->base.setifname = mwl_setifname; Modified: head/tools/tools/mwl/mwlstats/mwlstats.h ============================================================================== --- head/tools/tools/mwl/mwlstats/mwlstats.h Thu Mar 6 07:47:19 2014 (r262829) +++ head/tools/tools/mwl/mwlstats/mwlstats.h Thu Mar 6 07:48:43 2014 (r262830) @@ -32,15 +32,15 @@ #ifndef _MWLSTATS_H_ #define _MWLSTATS_H_ -#include "statfoo.h" +#include "bsdstat.h" /* * mv statistics class. */ struct mwlstatfoo { - struct statfoo base; + struct bsdstat base; - STATFOO_DECL_METHODS(struct mwlstatfoo *); + BSDSTAT_DECL_METHODS(struct mwlstatfoo *); /* set the network interface name for collection */ void (*setifname)(struct mwlstatfoo *, const char *ifname); From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 07:49:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BAD85533; Thu, 6 Mar 2014 07:49:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A842DB2E; Thu, 6 Mar 2014 07:49:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s267nC2O064607; Thu, 6 Mar 2014 07:49:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s267nCbG064606; Thu, 6 Mar 2014 07:49:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403060749.s267nCbG064606@svn.freebsd.org> From: Adrian Chadd Date: Thu, 6 Mar 2014 07:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262831 - head/tools/tools/mwl/mwlstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 07:49:12 -0000 Author: adrian Date: Thu Mar 6 07:49:12 2014 New Revision: 262831 URL: http://svnweb.freebsd.org/changeset/base/262831 Log: Fix compiler warning. Thanks clang! Modified: head/tools/tools/mwl/mwlstats/mwlstats.c Modified: head/tools/tools/mwl/mwlstats/mwlstats.c ============================================================================== --- head/tools/tools/mwl/mwlstats/mwlstats.c Thu Mar 6 07:48:43 2014 (r262830) +++ head/tools/tools/mwl/mwlstats/mwlstats.c Thu Mar 6 07:49:12 2014 (r262831) @@ -261,7 +261,7 @@ mwl_collect(struct mwlstatfoo_p *wf, str { wf->ifr.ifr_data = (caddr_t) stats; if (ioctl(wf->s, SIOCGMVSTATS, &wf->ifr) < 0) - err(1, wf->ifr.ifr_name); + err(1, "%s: ioctl: %s", __func__, wf->ifr.ifr_name); } static void From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 07:50:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6376E7A1; Thu, 6 Mar 2014 07:50:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5057BB4B; Thu, 6 Mar 2014 07:50:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s267otqm065194; Thu, 6 Mar 2014 07:50:55 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s267osce065191; Thu, 6 Mar 2014 07:50:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403060750.s267osce065191@svn.freebsd.org> From: Adrian Chadd Date: Thu, 6 Mar 2014 07:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262832 - head/tools/tools/npe/npestats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 07:50:55 -0000 Author: adrian Date: Thu Mar 6 07:50:54 2014 New Revision: 262832 URL: http://svnweb.freebsd.org/changeset/base/262832 Log: Migrate npestats to use bsdstat. Deleted: head/tools/tools/npe/npestats/statfoo.c head/tools/tools/npe/npestats/statfoo.h Modified: head/tools/tools/npe/npestats/Makefile head/tools/tools/npe/npestats/npestats.c head/tools/tools/npe/npestats/npestats.h Modified: head/tools/tools/npe/npestats/Makefile ============================================================================== --- head/tools/tools/npe/npestats/Makefile Thu Mar 6 07:49:12 2014 (r262831) +++ head/tools/tools/npe/npestats/Makefile Thu Mar 6 07:50:54 2014 (r262832) @@ -1,8 +1,10 @@ # $FreeBSD$ PROG= npestats -SRCS= main.c statfoo.c npestats.c +SRCS= main.c npestats.c BINDIR= /usr/local/bin NO_MAN= true +USEPRIVATELIB= +LDADD= -lbsdstat .include Modified: head/tools/tools/npe/npestats/npestats.c ============================================================================== --- head/tools/tools/npe/npestats/npestats.c Thu Mar 6 07:49:12 2014 (r262831) +++ head/tools/tools/npe/npestats/npestats.c Thu Mar 6 07:50:54 2014 (r262832) @@ -151,7 +151,7 @@ npe_collect(struct npestatfoo_p *wf, str } static void -npe_collect_cur(struct statfoo *sf) +npe_collect_cur(struct bsdstat *sf) { struct npestatfoo_p *wf = (struct npestatfoo_p *) sf; @@ -159,7 +159,7 @@ npe_collect_cur(struct statfoo *sf) } static void -npe_collect_tot(struct statfoo *sf) +npe_collect_tot(struct bsdstat *sf) { struct npestatfoo_p *wf = (struct npestatfoo_p *) sf; @@ -167,7 +167,7 @@ npe_collect_tot(struct statfoo *sf) } static void -npe_update_tot(struct statfoo *sf) +npe_update_tot(struct bsdstat *sf) { struct npestatfoo_p *wf = (struct npestatfoo_p *) sf; @@ -175,7 +175,7 @@ npe_update_tot(struct statfoo *sf) } static int -npe_get_curstat(struct statfoo *sf, int s, char b[], size_t bs) +npe_get_curstat(struct bsdstat *sf, int s, char b[], size_t bs) { struct npestatfoo_p *wf = (struct npestatfoo_p *) sf; #define STAT(x) \ @@ -211,7 +211,7 @@ npe_get_curstat(struct statfoo *sf, int } static int -npe_get_totstat(struct statfoo *sf, int s, char b[], size_t bs) +npe_get_totstat(struct bsdstat *sf, int s, char b[], size_t bs) { struct npestatfoo_p *wf = (struct npestatfoo_p *) sf; #define STAT(x) \ @@ -246,7 +246,7 @@ npe_get_totstat(struct statfoo *sf, int #undef STAT } -STATFOO_DEFINE_BOUNCE(npestatfoo) +BSDSTAT_DEFINE_BOUNCE(npestatfoo) struct npestatfoo * npestats_new(const char *ifname, const char *fmtstring) @@ -256,7 +256,7 @@ npestats_new(const char *ifname, const c wf = calloc(1, sizeof(struct npestatfoo_p)); if (wf != NULL) { - statfoo_init(&wf->base.base, "npestats", npestats, N(npestats)); + bsdstat_init(&wf->base.base, "npestats", npestats, N(npestats)); /* override base methods */ wf->base.base.collect_cur = npe_collect_cur; wf->base.base.collect_tot = npe_collect_tot; @@ -265,7 +265,7 @@ npestats_new(const char *ifname, const c wf->base.base.update_tot = npe_update_tot; /* setup bounce functions for public methods */ - STATFOO_BOUNCE(wf, npestatfoo); + BSDSTAT_BOUNCE(wf, npestatfoo); /* setup our public methods */ wf->base.setifname = npe_setifname; Modified: head/tools/tools/npe/npestats/npestats.h ============================================================================== --- head/tools/tools/npe/npestats/npestats.h Thu Mar 6 07:49:12 2014 (r262831) +++ head/tools/tools/npe/npestats/npestats.h Thu Mar 6 07:50:54 2014 (r262832) @@ -32,15 +32,15 @@ #ifndef _NPESTATS_H_ #define _NPESTATS_H_ -#include "statfoo.h" +#include "bsdstat.h" /* * npe statistics class. */ struct npestatfoo { - struct statfoo base; + struct bsdstat base; - STATFOO_DECL_METHODS(struct npestatfoo *); + BSDSTAT_DECL_METHODS(struct npestatfoo *); /* set the network interface name for collection */ void (*setifname)(struct npestatfoo *, const char *ifname); From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 10:45:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB72591B; Thu, 6 Mar 2014 10:45:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 988FCF42; Thu, 6 Mar 2014 10:45:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s26Ajrnk037722; Thu, 6 Mar 2014 10:45:53 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26AjrmZ037721; Thu, 6 Mar 2014 10:45:53 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403061045.s26AjrmZ037721@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 6 Mar 2014 10:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262837 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 10:45:53 -0000 Author: trasz Date: Thu Mar 6 10:45:53 2014 New Revision: 262837 URL: http://svnweb.freebsd.org/changeset/base/262837 Log: Make reset handling in iSCSI target RFC-compliant. This fixes some rare hangs with Open-iSCSI (Linux). MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Thu Mar 6 10:26:25 2014 (r262836) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Thu Mar 6 10:45:53 2014 (r262837) @@ -633,11 +633,11 @@ cfiscsi_pdu_handle_task_request(struct i #endif io->taskio.task_action = CTL_TASK_LUN_RESET; break; - case BHSTMR_FUNCTION_TARGET_COLD_RESET: + case BHSTMR_FUNCTION_TARGET_WARM_RESET: #if 0 - CFISCSI_SESSION_DEBUG(cs, "BHSTMR_FUNCTION_TARGET_COLD_RESET"); + CFISCSI_SESSION_DEBUG(cs, "BHSTMR_FUNCTION_TARGET_WARM_RESET"); #endif - io->taskio.task_action = CTL_TASK_BUS_RESET; + io->taskio.task_action = CTL_TASK_TARGET_RESET; break; default: CFISCSI_SESSION_DEBUG(cs, "unsupported function 0x%x", From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 12:37:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F23EA4D0; Thu, 6 Mar 2014 12:37:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF218C5D; Thu, 6 Mar 2014 12:37:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s26CbPvH084688; Thu, 6 Mar 2014 12:37:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26CbPUf084687; Thu, 6 Mar 2014 12:37:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201403061237.s26CbPUf084687@svn.freebsd.org> From: Alexander Motin Date: Thu, 6 Mar 2014 12:37:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262847 - head/sys/dev/hyperv/storvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 12:37:26 -0000 Author: mav Date: Thu Mar 6 12:37:25 2014 New Revision: 262847 URL: http://svnweb.freebsd.org/changeset/base/262847 Log: Minor fix to r262789. MFC after: 6 days Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Mar 6 11:15:54 2014 (r262846) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Mar 6 12:37:25 2014 (r262847) @@ -1062,7 +1062,7 @@ storvsc_action(struct cam_sim *sim, unio cpi->hba_eng_cnt = 0; cpi->max_target = STORVSC_MAX_TARGETS; cpi->max_lun = sc->hs_drv_props->drv_max_luns_per_target; - cpi->initiator_id = cpi->max_lun + 1; + cpi->initiator_id = cpi->max_target; cpi->bus_id = cam_sim_bus(sim); cpi->base_transfer_speed = 300000; cpi->transport = XPORT_SAS; From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 16:26:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03CCE726; Thu, 6 Mar 2014 16:26:55 +0000 (UTC) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 44564A17; Thu, 6 Mar 2014 16:26:54 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.7/8.14.7) with ESMTP id s26GQrJQ018207; Thu, 6 Mar 2014 10:26:53 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.7/8.14.7/Submit) id s26GQqgw018206; Thu, 6 Mar 2014 10:26:52 -0600 (CST) (envelope-from brooks) Date: Thu, 6 Mar 2014 10:26:52 -0600 From: Brooks Davis To: Glen Barber Subject: Re: svn commit: r262810 - in head: release release/arm release/tools share/man/man7 Message-ID: <20140306162652.GD9427@lor.one-eyed-alien.net> References: <201403052317.s25NHrVB057044@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8nsIa27JVQLqB7/C" Content-Disposition: inline In-Reply-To: <201403052317.s25NHrVB057044@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 16:26:55 -0000 --8nsIa27JVQLqB7/C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 05, 2014 at 11:17:53PM +0000, Glen Barber wrote: > Author: gjb > Date: Wed Mar 5 23:17:53 2014 > New Revision: 262810 > URL: http://svnweb.freebsd.org/changeset/base/262810 >=20 > Log: > Merge ^/projects/release-embedded into ^/head. > =20 > After several months of testing and fixing (and breaking) > various parts of release/release.sh changes, it is now > possible to build FreeBSD/arm images as part of the release > process. Awesome! It looks like I'll need to take a look at this soon so I can start building BERI releases. -- Brooks --8nsIa27JVQLqB7/C Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iKYEARECAGYFAlMYoctfFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl bnBncC5maWZ0aGhvcnNlbWFuLm5ldDY1NUQ1MTlDMjZBNzgyRTcyNTI5OUJGMDVE OEU4QkU5RjIzODFBRDQACgkQXY6L6fI4GtTiRgCgtEKP3wPp3lKe6W+PeopBPLv5 yToAn0Eoq+RQ9QWB9qVcUvuo+TzpUsWU =YS/p -----END PGP SIGNATURE----- --8nsIa27JVQLqB7/C-- From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 16:37:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64E8F17F; Thu, 6 Mar 2014 16:37:14 +0000 (UTC) Received: from ppsw-40.csi.cam.ac.uk (ppsw-40-v6.csi.cam.ac.uk [IPv6:2001:630:212:8::e:f40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 26B9BB1A; Thu, 6 Mar 2014 16:37:14 +0000 (UTC) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from cpc28-cmbg15-2-0-cust64.5-4.cable.virginm.net ([86.27.189.65]:51620 helo=[192.168.0.7]) by ppsw-40.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:25) with esmtpsa (PLAIN:dc552) (TLSv1:AES128-SHA:128) id 1WLbIG-00074Q-kw (Exim 4.82_3-c0e5623) (return-path ); Thu, 06 Mar 2014 16:37:12 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r262810 - in head: release release/arm release/tools share/man/man7 From: David Chisnall In-Reply-To: <201403052317.s25NHrVB057044@svn.freebsd.org> Date: Thu, 6 Mar 2014 16:37:11 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <40489767-8712-42CA-ABDA-852BAD902BAD@cl.cam.ac.uk> References: <201403052317.s25NHrVB057044@svn.freebsd.org> To: Glen Barber X-Mailer: Apple Mail (2.1827) Sender: "Dr D. Chisnall" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 16:37:14 -0000 On 5 Mar 2014, at 23:17, Glen Barber wrote: > After several months of testing and fixing (and breaking) > various parts of release/release.sh changes, it is now > possible to build FreeBSD/arm images as part of the release > process. That's great! How much effort would it be to add QEMU images for ARM = and MIPS images to the things that we build by default? I'd love to see = these built for ARM and MIPS as part of the Jenkins builds and for = releases. David From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 17:33:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6363DF89; Thu, 6 Mar 2014 17:33:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5020C14A; Thu, 6 Mar 2014 17:33:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s26HXDk1013125; Thu, 6 Mar 2014 17:33:13 GMT (envelope-from pgj@svn.freebsd.org) Received: (from pgj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26HXDxU013124; Thu, 6 Mar 2014 17:33:13 GMT (envelope-from pgj@svn.freebsd.org) Message-Id: <201403061733.s26HXDxU013124@svn.freebsd.org> From: Gabor Pali Date: Thu, 6 Mar 2014 17:33:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262859 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 17:33:13 -0000 Author: pgj (doc,ports committer) Date: Thu Mar 6 17:33:12 2014 New Revision: 262859 URL: http://svnweb.freebsd.org/changeset/base/262859 Log: - Move carl to the alumni section Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Mar 6 17:17:16 2014 (r262858) +++ head/share/misc/committers-src.dot Thu Mar 6 17:33:12 2014 (r262859) @@ -40,6 +40,7 @@ billf [label="Bill Fumerola\nbillf@FreeB bmah [label="Bruce A. Mah\nbmah@FreeBSD.org\n2002/01/29\n2009/09/13"] bmilekic [label="Bosko Milekic\nbmilekic@FreeBSD.org\n2000/09/21\n2008/11/10"] bushman [label="Michael Bushkov\nbushman@FreeBSD.org\n2007/03/10\n2010/04/29"] +carl [label="Carl Delsey\ncarl@FreeBSD.org\n2013/01/14\n2014/03/06"] ceri [label="Ceri Davies\nceri@FreeBSD.org\n2006/11/07\n2012/03/07"] cjc [label="Crist J. Clark\ncjc@FreeBSD.org\n2001/06/01\n2006/12/29"] dds [label="Diomidis Spinellis\ndds@FreeBSD.org\n2003/06/20\n2010/09/22"] @@ -127,7 +128,6 @@ bruno [label="Bruno Ducrot\nbruno@FreeBS bryanv [label="Bryan Venteicher\nbryanv@FreeBSD.org\n2012/11/03"] bschmidt [label="Bernhard Schmidt\nbschmidt@FreeBSD.org\n2010/02/06"] bz [label="Bjoern A. Zeeb\nbz@FreeBSD.org\n2004/07/27"] -carl [label="Carl Delsey\ncarl@FreeBSD.org\n2013/01/14"] cognet [label="Olivier Houchard\ncognet@FreeBSD.org\n2002/10/09"] cokane [label="Coleman Kane\ncokane@FreeBSD.org\n2000/06/19"] cperciva [label="Colin Percival\ncperciva@FreeBSD.org\n2004/01/20"] From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 17:33:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B1D3154; Thu, 6 Mar 2014 17:33:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5B8B4151; Thu, 6 Mar 2014 17:33:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s26HXTdr013195; Thu, 6 Mar 2014 17:33:29 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26HXSsF013188; Thu, 6 Mar 2014 17:33:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201403061733.s26HXSsF013188@svn.freebsd.org> From: Alexander Motin Date: Thu, 6 Mar 2014 17:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262860 - in head: . etc usr.sbin/rpcbind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 17:33:29 -0000 Author: mav Date: Thu Mar 6 17:33:27 2014 New Revision: 262860 URL: http://svnweb.freebsd.org/changeset/base/262860 Log: Disable libwrap (TCP wrappers) support in rpcbind by default, introducing new command line options -W, to enable it when needed. On my tests this change by almost ten times improves rpcbind performance. No objections: many, net@ Modified: head/UPDATING head/etc/hosts.allow head/usr.sbin/rpcbind/rpcbind.8 head/usr.sbin/rpcbind/rpcbind.c head/usr.sbin/rpcbind/rpcbind.h head/usr.sbin/rpcbind/security.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Mar 6 17:33:12 2014 (r262859) +++ head/UPDATING Thu Mar 6 17:33:27 2014 (r262860) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20140306: + Support for libwrap (TCP wrappers) in rpcbind was disabled by default + to improve performance. To re-enable it, if needed, run rpcbind + with command line option -W. + 20140226: Switched back to the GPL dtc compiler due to updates in the upstream dts files not being supported by the BSDL dtc compiler. You will need Modified: head/etc/hosts.allow ============================================================================== --- head/etc/hosts.allow Thu Mar 6 17:33:12 2014 (r262859) +++ head/etc/hosts.allow Thu Mar 6 17:33:27 2014 (r262860) @@ -60,6 +60,7 @@ exim : localhost : allow exim : ALL : allow # Rpcbind is used for all RPC services; protect your NFS! +# Rpcbind should be running with -W option to support this. # (IP addresses rather than hostnames *MUST* be used here) #rpcbind : 192.0.2.32/255.255.255.224 : allow #rpcbind : 192.0.2.96/255.255.255.224 : allow Modified: head/usr.sbin/rpcbind/rpcbind.8 ============================================================================== --- head/usr.sbin/rpcbind/rpcbind.8 Thu Mar 6 17:33:12 2014 (r262859) +++ head/usr.sbin/rpcbind/rpcbind.8 Thu Mar 6 17:33:27 2014 (r262860) @@ -2,7 +2,7 @@ .\" Copyright 1989 AT&T .\" Copyright 1991 Sun Microsystems, Inc. .\" $FreeBSD$ -.Dd April 23, 2007 +.Dd March 6, 2014 .Dt RPCBIND 8 .Os .Sh NAME @@ -133,6 +133,8 @@ to use non-privileged ports for outgoing clients from using .Nm to connect to services from a privileged port. +.It Fl W +Enable libwrap (TCP wrappers) support. .El .Sh NOTES All RPC servers must be restarted if Modified: head/usr.sbin/rpcbind/rpcbind.c ============================================================================== --- head/usr.sbin/rpcbind/rpcbind.c Thu Mar 6 17:33:12 2014 (r262859) +++ head/usr.sbin/rpcbind/rpcbind.c Thu Mar 6 17:33:27 2014 (r262860) @@ -88,6 +88,9 @@ rpcblist_ptr list_rbl; /* A list of vers int runasdaemon = 0; int insecure = 0; int oldstyle_local = 0; +#ifdef LIBWRAP +int libwrap = 0; +#endif int verboselog = 0; char **hosts = NULL; @@ -785,7 +788,12 @@ parseargs(int argc, char *argv[]) #else #define WSOP "" #endif - while ((c = getopt(argc, argv, "6adh:iLls" WSOP)) != -1) { +#ifdef LIBWRAP +#define WRAPOP "W" +#else +#define WRAPOP "" +#endif + while ((c = getopt(argc, argv, "6adh:iLls" WRAPOP WSOP)) != -1) { switch (c) { case '6': ipv6_only = 1; @@ -818,6 +826,11 @@ parseargs(int argc, char *argv[]) case 's': runasdaemon = 1; break; +#ifdef LIBWRAP + case 'W': + libwrap = 1; + break; +#endif #ifdef WARMSTART case 'w': warmstart = 1; @@ -825,8 +838,8 @@ parseargs(int argc, char *argv[]) #endif default: /* error */ fprintf(stderr, - "usage: rpcbind [-6adiLls%s] [-h bindip]\n", - WSOP); + "usage: rpcbind [-6adiLls%s%s] [-h bindip]\n", + WRAPOP, WSOP); exit (1); } } Modified: head/usr.sbin/rpcbind/rpcbind.h ============================================================================== --- head/usr.sbin/rpcbind/rpcbind.h Thu Mar 6 17:33:12 2014 (r262859) +++ head/usr.sbin/rpcbind/rpcbind.h Thu Mar 6 17:33:27 2014 (r262860) @@ -66,6 +66,9 @@ struct r_rmtcall_args { extern int debugging; extern int doabort; +#ifdef LIBWRAP +extern int libwrap; +#endif extern int verboselog; extern int insecure; extern int oldstyle_local; Modified: head/usr.sbin/rpcbind/security.c ============================================================================== --- head/usr.sbin/rpcbind/security.c Thu Mar 6 17:33:12 2014 (r262859) +++ head/usr.sbin/rpcbind/security.c Thu Mar 6 17:33:27 2014 (r262860) @@ -108,13 +108,15 @@ check_access(SVCXPRT *xprt, rpcproc_t pr } #ifdef LIBWRAP - if (addr->sa_family == AF_LOCAL) - return 1; - request_init(&req, RQ_DAEMON, "rpcbind", RQ_CLIENT_SIN, addr, 0); - sock_methods(&req); - if(!hosts_access(&req)) { - logit(deny_severity, addr, proc, prog, ": request from unauthorized host"); - return 0; + if (libwrap && addr->sa_family != AF_LOCAL) { + request_init(&req, RQ_DAEMON, "rpcbind", RQ_CLIENT_SIN, addr, + 0); + sock_methods(&req); + if(!hosts_access(&req)) { + logit(deny_severity, addr, proc, prog, + ": request from unauthorized host"); + return 0; + } } #endif if (verboselog) From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 17:43:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 735DD63C; Thu, 6 Mar 2014 17:43:20 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 42BA226A; Thu, 6 Mar 2014 17:43:19 +0000 (UTC) Received: from glenbarber.us (nucleus.glenbarber.us [IPv6:2001:470:8:1205:2:2:ff:100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id BFE5BB246; Thu, 6 Mar 2014 17:43:17 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us BFE5BB246 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Thu, 6 Mar 2014 12:43:15 -0500 From: Glen Barber To: Brooks Davis Subject: Re: svn commit: r262810 - in head: release release/arm release/tools share/man/man7 Message-ID: <20140306174315.GO87036@glenbarber.us> References: <201403052317.s25NHrVB057044@svn.freebsd.org> <20140306162652.GD9427@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gh4H09KImyIEQ1se" Content-Disposition: inline In-Reply-To: <20140306162652.GD9427@lor.one-eyed-alien.net> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 17:43:20 -0000 --gh4H09KImyIEQ1se Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 06, 2014 at 10:26:52AM -0600, Brooks Davis wrote: > On Wed, Mar 05, 2014 at 11:17:53PM +0000, Glen Barber wrote: > > Author: gjb > > Date: Wed Mar 5 23:17:53 2014 > > New Revision: 262810 > > URL: http://svnweb.freebsd.org/changeset/base/262810 > >=20 > > Log: > > Merge ^/projects/release-embedded into ^/head. > > =20 > > After several months of testing and fixing (and breaking) > > various parts of release/release.sh changes, it is now > > possible to build FreeBSD/arm images as part of the release > > process. >=20 > Awesome! It looks like I'll need to take a look at this soon so I can > start building BERI releases. >=20 Do you have any documented steps to produce BERI images? I wanted to add mips images next anyway, so if you have something written down on a napkin somewhere that you could let me take a look at, it would be a great starting point for me, at least. Glen --gh4H09KImyIEQ1se Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTGLOzAAoJELls3eqvi17Q8XoP/0Aieo1Di91nCMzXBoFIMhsf 3DjnpByIP8JmimHHAciC+Jqfwg1sPIVUfoEYa9H80nhGR8IO1WR7V/VZbU0VXZkc Bf4lpDSQ5X9G7Pz3+Oro/THnOzOEzG1btSlovpw/qKbIt5SBMvA4KzhZ2NEGNpUL 4ZR7KeHAK4b6VB9x6lssG/dtYoQwga9bBo/kaaJzwW4SRfYXXvRxeYnNRDApPVoU AW8XYojSF8PmtNWfOB+7To7lbU+lVMqudSaGXB+IVsoxb5BgHOd4ObpODOCq7Gy5 RLcaekUFVcjdO4vCxyL9S1BX8AhoY0bwT++ojFrf8qU5LChWg76r+IlRdCecaw1X u5jHzeKlfsOn07lR0PhQX1EZ67Eq8qlBvMoOtjwIeganY+FtLYA1R2F1X1jTMkDM ZcSvuSKusJlXPXX3Z9gbyYKMTmQKLLA5nUDSdZTdVjgfPPJko4AiJFSZwPFt2sZ2 qSee+65lRi0NDtu6H1QNt4Gj8T8lK3qW9SdFDqexKrnV0VyYjlqnoOjxA2ofbje+ TLcZm93zjlfbSHkGfYYDHfiuTLtZZT7cCINiw4+oN8bZ+/bVbzjaM4Xq9vt5A8Xe UBFc3LxhCVKSQwEu44ldZp9zkCuAjcnAwrG9zmr9cPriLMU6lSRVOyxlXCu3zIeU Gj/SsScFY3bx0j7HFdY7 =ziQ4 -----END PGP SIGNATURE----- --gh4H09KImyIEQ1se-- From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 17:47:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 882C8912; Thu, 6 Mar 2014 17:47:58 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 58A6B2A5; Thu, 6 Mar 2014 17:47:58 +0000 (UTC) Received: from glenbarber.us (nucleus.glenbarber.us [IPv6:2001:470:8:1205:2:2:ff:100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 32FF4B2DE; Thu, 6 Mar 2014 17:47:57 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 32FF4B2DE Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Thu, 6 Mar 2014 12:47:55 -0500 From: Glen Barber To: David Chisnall Subject: Re: svn commit: r262810 - in head: release release/arm release/tools share/man/man7 Message-ID: <20140306174755.GQ87036@glenbarber.us> References: <201403052317.s25NHrVB057044@svn.freebsd.org> <40489767-8712-42CA-ABDA-852BAD902BAD@cl.cam.ac.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="63aIh6YiuHX+oBFP" Content-Disposition: inline In-Reply-To: <40489767-8712-42CA-ABDA-852BAD902BAD@cl.cam.ac.uk> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 17:47:58 -0000 --63aIh6YiuHX+oBFP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 06, 2014 at 04:37:11PM +0000, David Chisnall wrote: > On 5 Mar 2014, at 23:17, Glen Barber wrote: >=20 > > After several months of testing and fixing (and breaking) > > various parts of release/release.sh changes, it is now > > possible to build FreeBSD/arm images as part of the release > > process. >=20 > That's great! How much effort would it be to add QEMU images for > ARM and MIPS images to the things that we build by default? I'd > love to see these built for ARM and MIPS as part of the Jenkins > builds and for releases. >=20 It should be fairly trivial, however I've never had luck getting qemu to run non-x86 images. Maybe I am doing it wrong, though. Glen --63aIh6YiuHX+oBFP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTGLTLAAoJELls3eqvi17QzTYP/03zk5WTq85ZznvpJFsaEPVW 3nJIpI+Y0JPbbEl0mFsDywmjIDGWTkcgPbS6MPQh2Sm5eDrowqdBYC489NrDTHS9 e2xO54pT/JN6ddkX8lm8pNQi0lqw4GwqIcm9y0/H0IoUq5sA5oBM0EsoX5+tVNLd pV//0A3eU3O/+C9vRGY1qDQrXpO8bWnuzOjDlWmuO7s8Z1WyA94Y/0gWzh3ywg83 iIKLc8o1ozesqaBMaaD1pgtptpVMRZZrwIFg9Y9MB6KzTYJ0nEwOJ38hhcA4eNY8 Jc2paJ926IZgHR+ANvIXtVrjo0CTixcOObVTcaNT+G7k4M5q38nvVKSMmlgD8Ulf d17Uh3fIESZFHJcKXKrznCY0dCoW8qXdSwsn8E/FBEX/K7Y27oaiQX5fVL3vh+vU V4UpbnEMtmITP3mRjbfq9itP8Lb88tFK57PDcTyFJRVJ02zVgw9D+dhAk+08xbtx AGRZ6SAEkisyRqrAJSejQ6qNaF0Sni5TWW8RpCcbq1rmFrxr8S5gf7AzN0g4tu0i jo1SPnl2DjLcrLaYjONQnNNKPTDdM/Ew66UYxGNUd+mJFB3trE7RKAWwnirotbCh DjwPRn4WgX/1bG8eJnOURtVFS1ZguhnKKJBXyYOskZWjmO89eH9G7HEpVz6wSO7r idQvVaxzecxaB5SK22pn =z2C0 -----END PGP SIGNATURE----- --63aIh6YiuHX+oBFP-- From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 17:50:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28B58A97; Thu, 6 Mar 2014 17:50:53 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E95912C3; Thu, 6 Mar 2014 17:50:52 +0000 (UTC) Received: from [192.168.0.7] (cpc28-cmbg15-2-0-cust64.5-4.cable.virginm.net [86.27.189.65]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.5) with ESMTP id s26HoklY068644 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 6 Mar 2014 17:50:49 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r262810 - in head: release release/arm release/tools share/man/man7 From: David Chisnall In-Reply-To: <20140306174755.GQ87036@glenbarber.us> Date: Thu, 6 Mar 2014 17:50:41 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <7F258CFC-FE2B-4631-B890-AC998CA27782@FreeBSD.org> References: <201403052317.s25NHrVB057044@svn.freebsd.org> <40489767-8712-42CA-ABDA-852BAD902BAD@cl.cam.ac.uk> <20140306174755.GQ87036@glenbarber.us> To: Glen Barber , Stacey Son X-Mailer: Apple Mail (2.1827) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 17:50:53 -0000 On 6 Mar 2014, at 17:47, Glen Barber wrote: > On Thu, Mar 06, 2014 at 04:37:11PM +0000, David Chisnall wrote: >> On 5 Mar 2014, at 23:17, Glen Barber wrote: >>=20 >>> After several months of testing and fixing (and breaking) >>> various parts of release/release.sh changes, it is now >>> possible to build FreeBSD/arm images as part of the release >>> process. >>=20 >> That's great! How much effort would it be to add QEMU images for >> ARM and MIPS images to the things that we build by default? I'd >> love to see these built for ARM and MIPS as part of the Jenkins >> builds and for releases. >>=20 >=20 > It should be fairly trivial, however I've never had luck getting qemu = to > run non-x86 images. Maybe I am doing it wrong, though. Stacey may be able to help there. I think he did some = FreeBSD/MIPS-on-QEMU testing with the system emulation mode before = working on the user-mode emulation. David From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 18:48:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69927FA6; Thu, 6 Mar 2014 18:48:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 56CECB46; Thu, 6 Mar 2014 18:48:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s26Im3gJ044126; Thu, 6 Mar 2014 18:48:03 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26Im36K044124; Thu, 6 Mar 2014 18:48:03 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201403061848.s26Im36K044124@svn.freebsd.org> From: Glen Barber Date: Thu, 6 Mar 2014 18:48:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262862 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 18:48:03 -0000 Author: gjb Date: Thu Mar 6 18:48:02 2014 New Revision: 262862 URL: http://svnweb.freebsd.org/changeset/base/262862 Log: Add a hack-ish attempt to provide backwards-compatibility with release.conf SVNROOT entries that do not have a trailing '/'. In order to provide a mechanism to use !svn, the trailing '/' was added to SVNROOT so there were no assumptions being made about '/' being in the URL between SVNROOT and SRCBRANCH. Sponsored by: The FreeBSD Foundation Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Thu Mar 6 18:30:56 2014 (r262861) +++ head/release/release.sh Thu Mar 6 18:48:02 2014 (r262862) @@ -107,6 +107,16 @@ while getopts c: opt; do done shift $(($OPTIND - 1)) +# Fix for backwards-compatibility with release.conf that does not have the +# trailing '/'. +case ${SVNROOT} in + *svn*) + SVNROOT="${SVNROOT}/" + ;; + *) + ;; +esac + # Prefix the branches with the SVNROOT for the full checkout URL. SRCBRANCH="${SVNROOT}${SRCBRANCH}" DOCBRANCH="${SVNROOT}${DOCBRANCH}" From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 18:56:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C54171D; Thu, 6 Mar 2014 18:56:24 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7481BC23; Thu, 6 Mar 2014 18:56:23 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s26IuLXk078461 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 6 Mar 2014 22:56:21 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s26IuLlF078460; Thu, 6 Mar 2014 22:56:21 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 6 Mar 2014 22:56:21 +0400 From: Gleb Smirnoff To: Alexander Motin Subject: Re: svn commit: r262860 - in head: . etc usr.sbin/rpcbind Message-ID: <20140306185621.GM68791@FreeBSD.org> References: <201403061733.s26HXSsF013188@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201403061733.s26HXSsF013188@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 18:56:24 -0000 On Thu, Mar 06, 2014 at 05:33:28PM +0000, Alexander Motin wrote: A> Author: mav A> Date: Thu Mar 6 17:33:27 2014 A> New Revision: 262860 A> URL: http://svnweb.freebsd.org/changeset/base/262860 A> A> Log: A> Disable libwrap (TCP wrappers) support in rpcbind by default, introducing A> new command line options -W, to enable it when needed. A> A> On my tests this change by almost ten times improves rpcbind performance. A good extension to libwrap would be to make it cache contents of /etc/hosts.allow and observe its changes via EVFILT_VNODE kevent(2) filter. And actually reread the file only when its contents change. Of course this implies that application using libwrap is kevent(2)-driven. Sounds like a GSoC project, btw. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 20:24:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57328394; Thu, 6 Mar 2014 20:24:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 37830793; Thu, 6 Mar 2014 20:24:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s26KOGEl085294; Thu, 6 Mar 2014 20:24:16 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26KOFcI085288; Thu, 6 Mar 2014 20:24:15 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201403062024.s26KOFcI085288@svn.freebsd.org> From: Alan Somers Date: Thu, 6 Mar 2014 20:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262867 - in head: sys/kern sys/sys tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 20:24:16 -0000 Author: asomers Date: Thu Mar 6 20:24:15 2014 New Revision: 262867 URL: http://svnweb.freebsd.org/changeset/base/262867 Log: Fix PR kern/185813 "SOCK_SEQPACKET AF_UNIX sockets with asymmetrical buffers drop packets". It was caused by a check for the space available in a sockbuf, but it was checking the wrong sockbuf. sys/sys/sockbuf.h sys/kern/uipc_sockbuf.c Add sbappendaddr_nospacecheck_locked(), which is just like sbappendaddr_locked but doesn't validate the receiving socket's space. Factor out common code into sbappendaddr_locked_internal(). We shouldn't simply make sbappendaddr_locked check the space and then call sbappendaddr_nospacecheck_locked, because that would cause the O(n) function m_length to be called twice. sys/kern/uipc_usrreq.c Use sbappendaddr_nospacecheck_locked for SOCK_SEQPACKET sockets, because the receiving sockbuf's size limit is irrelevant. tests/sys/kern/unix_seqpacket_test.c Now that 185813 is fixed, pipe_128k_8k fails intermittently due to 185812. Make it fail every time by adding a usleep after starting the writer thread and before starting the reader thread in test_pipe. That gives the writer time to fill up its send buffer. Also, clear the expected failure message due to 185813. It actually said "185812", but that was a typo. PR: kern/185813 Reviewed by: silence from freebsd-net@ and rwatson@ MFC after: 3 weeks Sponsored by: Spectra Logic Corporation Modified: head/sys/kern/uipc_sockbuf.c head/sys/kern/uipc_usrreq.c head/sys/sys/sockbuf.h head/tests/sys/kern/unix_seqpacket_test.c Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Thu Mar 6 20:05:13 2014 (r262866) +++ head/sys/kern/uipc_sockbuf.c Thu Mar 6 20:24:15 2014 (r262867) @@ -620,29 +620,12 @@ sbappendrecord(struct sockbuf *sb, struc SOCKBUF_UNLOCK(sb); } -/* - * Append address and data, and optionally, control (ancillary) data to the - * receive queue of a socket. If present, m0 must include a packet header - * with total length. Returns 0 if no space in sockbuf or insufficient - * mbufs. - */ -int -sbappendaddr_locked(struct sockbuf *sb, const struct sockaddr *asa, - struct mbuf *m0, struct mbuf *control) +/* Helper routine that appends data, control, and address to a sockbuf. */ +static int +sbappendaddr_locked_internal(struct sockbuf *sb, const struct sockaddr *asa, + struct mbuf *m0, struct mbuf *control, struct mbuf *ctrl_last) { struct mbuf *m, *n, *nlast; - int space = asa->sa_len; - - SOCKBUF_LOCK_ASSERT(sb); - - if (m0 && (m0->m_flags & M_PKTHDR) == 0) - panic("sbappendaddr_locked"); - if (m0) - space += m0->m_pkthdr.len; - space += m_length(control, &n); - - if (space > sbspace(sb)) - return (0); #if MSIZE <= 256 if (asa->sa_len > MLEN) return (0); @@ -652,8 +635,8 @@ sbappendaddr_locked(struct sockbuf *sb, return (0); m->m_len = asa->sa_len; bcopy(asa, mtod(m, caddr_t), asa->sa_len); - if (n) - n->m_next = m0; /* concatenate data to control */ + if (ctrl_last) + ctrl_last->m_next = m0; /* concatenate data to control */ else control = m0; m->m_next = control; @@ -677,6 +660,50 @@ sbappendaddr_locked(struct sockbuf *sb, * mbufs. */ int +sbappendaddr_locked(struct sockbuf *sb, const struct sockaddr *asa, + struct mbuf *m0, struct mbuf *control) +{ + struct mbuf *ctrl_last; + int space = asa->sa_len; + + SOCKBUF_LOCK_ASSERT(sb); + + if (m0 && (m0->m_flags & M_PKTHDR) == 0) + panic("sbappendaddr_locked"); + if (m0) + space += m0->m_pkthdr.len; + space += m_length(control, &ctrl_last); + + if (space > sbspace(sb)) + return (0); + return (sbappendaddr_locked_internal(sb, asa, m0, control, ctrl_last)); +} + +/* + * Append address and data, and optionally, control (ancillary) data to the + * receive queue of a socket. If present, m0 must include a packet header + * with total length. Returns 0 if insufficient mbufs. Does not validate space + * on the receiving sockbuf. + */ +int +sbappendaddr_nospacecheck_locked(struct sockbuf *sb, const struct sockaddr *asa, + struct mbuf *m0, struct mbuf *control) +{ + struct mbuf *ctrl_last; + + SOCKBUF_LOCK_ASSERT(sb); + + ctrl_last = (control == NULL) ? NULL : m_last(control); + return (sbappendaddr_locked_internal(sb, asa, m0, control, ctrl_last)); +} + +/* + * Append address and data, and optionally, control (ancillary) data to the + * receive queue of a socket. If present, m0 must include a packet header + * with total length. Returns 0 if no space in sockbuf or insufficient + * mbufs. + */ +int sbappendaddr(struct sockbuf *sb, const struct sockaddr *asa, struct mbuf *m0, struct mbuf *control) { Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Thu Mar 6 20:05:13 2014 (r262866) +++ head/sys/kern/uipc_usrreq.c Thu Mar 6 20:24:15 2014 (r262867) @@ -892,7 +892,8 @@ uipc_send(struct socket *so, int flags, from = &sun_noname; so2 = unp2->unp_socket; SOCKBUF_LOCK(&so2->so_rcv); - if (sbappendaddr_locked(&so2->so_rcv, from, m, control)) { + if (sbappendaddr_nospacecheck_locked(&so2->so_rcv, from, m, + control)) { sorwakeup_locked(so2); m = NULL; control = NULL; @@ -977,8 +978,14 @@ uipc_send(struct socket *so, int flags, const struct sockaddr *from; from = &sun_noname; - if (sbappendaddr_locked(&so2->so_rcv, from, m, - control)) + /* + * Don't check for space available in so2->so_rcv. + * Unix domain sockets only check for space in the + * sending sockbuf, and that check is performed one + * level up the stack. + */ + if (sbappendaddr_nospacecheck_locked(&so2->so_rcv, + from, m, control)) control = NULL; break; } Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Thu Mar 6 20:05:13 2014 (r262866) +++ head/sys/sys/sockbuf.h Thu Mar 6 20:24:15 2014 (r262867) @@ -127,6 +127,8 @@ int sbappendaddr(struct sockbuf *sb, con struct mbuf *m0, struct mbuf *control); int sbappendaddr_locked(struct sockbuf *sb, const struct sockaddr *asa, struct mbuf *m0, struct mbuf *control); +int sbappendaddr_nospacecheck_locked(struct sockbuf *sb, + const struct sockaddr *asa, struct mbuf *m0, struct mbuf *control); int sbappendcontrol(struct sockbuf *sb, struct mbuf *m0, struct mbuf *control); int sbappendcontrol_locked(struct sockbuf *sb, struct mbuf *m0, Modified: head/tests/sys/kern/unix_seqpacket_test.c ============================================================================== --- head/tests/sys/kern/unix_seqpacket_test.c Thu Mar 6 20:05:13 2014 (r262866) +++ head/tests/sys/kern/unix_seqpacket_test.c Thu Mar 6 20:24:15 2014 (r262867) @@ -361,6 +361,12 @@ test_pipe(size_t sndbufsize, size_t rcvb reader_data.so = sv[1]; ATF_REQUIRE_EQ(0, pthread_create(&writer, NULL, test_pipe_writer, (void*)&writer_data)); + /* + * Give the writer time to start writing, and hopefully block, before + * starting the reader. This increases the likelihood of the test case + * failing due to PR kern/185812 + */ + usleep(1000); ATF_REQUIRE_EQ(0, pthread_create(&reader, NULL, test_pipe_reader, (void*)&reader_data)); @@ -951,7 +957,6 @@ ATF_TC_BODY(pipe_simulator_8k_128k, tc) ATF_TC_WITHOUT_HEAD(pipe_simulator_128k_8k); ATF_TC_BODY(pipe_simulator_128k_8k, tc) { - atf_tc_expect_fail("PR kern/185812 SOCK_SEQPACKET AF_UNIX sockets with asymmetrical buffers drop packets"); test_pipe_simulator(131072, 8192); } From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 19:26:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13BC7E9B; Thu, 6 Mar 2014 19:26:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0198CED6; Thu, 6 Mar 2014 19:26:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s26JQ8Ag061073; Thu, 6 Mar 2014 19:26:08 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26JQ8Qh061072; Thu, 6 Mar 2014 19:26:08 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <201403061926.s26JQ8Qh061072@svn.freebsd.org> From: Julian Elischer Date: Thu, 6 Mar 2014 19:26:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262864 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 19:26:09 -0000 Author: julian Date: Thu Mar 6 19:26:08 2014 New Revision: 262864 URL: http://svnweb.freebsd.org/changeset/base/262864 Log: Stop pw(8) from segfaulting when given certain input PR:187310 Submitted by: Kim Shrier Obtained from: bug MFC after: 1 week Modified: head/usr.sbin/pw/pw_group.c Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Thu Mar 6 18:50:35 2014 (r262863) +++ head/usr.sbin/pw/pw_group.c Thu Mar 6 19:26:08 2014 (r262864) @@ -227,10 +227,12 @@ pw_group(struct userconf * cnf, int mode else if (arg->ch == 'm') { int k = 0; - while (grp->gr_mem[k] != NULL) { - if (extendarray(&members, &grmembers, i + 2) != -1) - members[i++] = grp->gr_mem[k]; - k++; + if (grp->gr_mem != NULL) { + while (grp->gr_mem[k] != NULL) { + if (extendarray(&members, &grmembers, i + 2) != -1) + members[i++] = grp->gr_mem[k]; + k++; + } } } @@ -311,6 +313,9 @@ delete_members(char ***members, int *grm int k; struct passwd *pwd; + if (grp->gr_mem == NULL) + return; + k = 0; while (grp->gr_mem[k] != NULL) { matchFound = false; @@ -415,8 +420,10 @@ print_group(struct group * grp, int pret printf("Group Name: %-15s #%lu\n" " Members: ", grp->gr_name, (long) grp->gr_gid); - for (i = 0; grp->gr_mem[i]; i++) - printf("%s%s", i ? "," : "", grp->gr_mem[i]); + if (grp->gr_mem != NULL) { + for (i = 0; grp->gr_mem[i]; i++) + printf("%s%s", i ? "," : "", grp->gr_mem[i]); + } fputs("\n\n", stdout); } return EXIT_SUCCESS; From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 21:07:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 958A1AB3; Thu, 6 Mar 2014 21:07:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 82658B82; Thu, 6 Mar 2014 21:07:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s26L7Djc002875; Thu, 6 Mar 2014 21:07:13 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26L7Dt5002874; Thu, 6 Mar 2014 21:07:13 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201403062107.s26L7Dt5002874@svn.freebsd.org> From: Olivier Houchard Date: Thu, 6 Mar 2014 21:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262870 - head/sys/arm/ti/omap4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 21:07:13 -0000 Author: cognet Date: Thu Mar 6 21:07:13 2014 New Revision: 262870 URL: http://svnweb.freebsd.org/changeset/base/262870 Log: When calculating the MPU freq, make sure not to overflow by using a uint64_t. PR: arm/187223 Submitted by: Svatopluk Kraus Modified: head/sys/arm/ti/omap4/omap4_prcm_clks.c Modified: head/sys/arm/ti/omap4/omap4_prcm_clks.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_prcm_clks.c Thu Mar 6 21:02:16 2014 (r262869) +++ head/sys/arm/ti/omap4/omap4_prcm_clks.c Thu Mar 6 21:07:13 2014 (r262870) @@ -990,7 +990,7 @@ omap4_clk_get_arm_fclk_freq(struct ti_cl /* Calculate the MPU freq */ - mpuclk = (sysclk * pll_mult) / pll_div; + mpuclk = ((uint64_t)sysclk * pll_mult) / pll_div; /* Return the value */ if (freq) From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 19:58:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6488FBB7; Thu, 6 Mar 2014 19:58:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 374032A3; Thu, 6 Mar 2014 19:58:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s26Jw4St073292; Thu, 6 Mar 2014 19:58:04 GMT (envelope-from julian@svn.freebsd.org) Received: (from julian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26Jw4E8073291; Thu, 6 Mar 2014 19:58:04 GMT (envelope-from julian@svn.freebsd.org) Message-Id: <201403061958.s26Jw4E8073291@svn.freebsd.org> From: Julian Elischer Date: Thu, 6 Mar 2014 19:58:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262865 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 19:58:04 -0000 Author: julian Date: Thu Mar 6 19:58:03 2014 New Revision: 262865 URL: http://svnweb.freebsd.org/changeset/base/262865 Log: Part 2 of bug 187310.. had to commit separately due to local confusion. Don't let pw crash when give certain input. PR: 187310 Submitted by: Kim Shrier MFC after: 1 week Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Thu Mar 6 19:26:08 2014 (r262864) +++ head/usr.sbin/pw/pw_user.c Thu Mar 6 19:58:03 2014 (r262865) @@ -425,19 +425,22 @@ pw_user(struct userconf * cnf, int mode, } grp = GETGRNAM(a_name->val); - if (grp != NULL && *grp->gr_mem == NULL) + if (grp != NULL && + (grp->gr_mem == NULL || *grp->gr_mem == NULL)) delgrent(GETGRNAM(a_name->val)); SETGRENT(); while ((grp = GETGRENT()) != NULL) { int i; char group[MAXLOGNAME]; - for (i = 0; grp->gr_mem[i] != NULL; i++) { - if (!strcmp(grp->gr_mem[i], a_name->val)) { - while (grp->gr_mem[i] != NULL) { - grp->gr_mem[i] = grp->gr_mem[i+1]; - } - strlcpy(group, grp->gr_name, MAXLOGNAME); - chggrent(group, grp); + if (grp->gr_mem != NULL) { + for (i = 0; grp->gr_mem[i] != NULL; i++) { + if (!strcmp(grp->gr_mem[i], a_name->val)) { + while (grp->gr_mem[i] != NULL) { + grp->gr_mem[i] = grp->gr_mem[i+1]; + } + strlcpy(group, grp->gr_name, MAXLOGNAME); + chggrent(group, grp); + } } } } @@ -908,7 +911,8 @@ pw_gidpolicy(struct userconf * cnf, stru errx(EX_NOUSER, "group `%s' is not defined", a_gid->val); } gid = grp->gr_gid; - } else if ((grp = GETGRNAM(nam)) != NULL && grp->gr_mem[0] == NULL) { + } else if ((grp = GETGRNAM(nam)) != NULL && + (grp->gr_mem == NULL || grp->gr_mem[0] == NULL)) { gid = grp->gr_gid; /* Already created? Use it anyway... */ } else { struct cargs grpargs; @@ -1182,14 +1186,16 @@ print_user(struct passwd * pwd, int pret while ((grp=GETGRENT()) != NULL) { int i = 0; - while (grp->gr_mem[i] != NULL) - { - if (strcmp(grp->gr_mem[i], pwd->pw_name)==0) + if (grp->gr_mem != NULL) { + while (grp->gr_mem[i] != NULL) { - printf(j++ == 0 ? " Groups: %s" : ",%s", grp->gr_name); - break; + if (strcmp(grp->gr_mem[i], pwd->pw_name)==0) + { + printf(j++ == 0 ? " Groups: %s" : ",%s", grp->gr_name); + break; + } + ++i; } - ++i; } } ENDGRENT(); From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 20:39:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93AA2D7F; Thu, 6 Mar 2014 20:39:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 807B48B3; Thu, 6 Mar 2014 20:39:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s26Kducd090648; Thu, 6 Mar 2014 20:39:56 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26KduQl090647; Thu, 6 Mar 2014 20:39:56 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201403062039.s26KduQl090647@svn.freebsd.org> From: Alan Somers Date: Thu, 6 Mar 2014 20:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262868 - head/tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 20:39:56 -0000 Author: asomers Date: Thu Mar 6 20:39:56 2014 New Revision: 262868 URL: http://svnweb.freebsd.org/changeset/base/262868 Log: Only use -lpthread for unix_seqpacket_test, not for all test programs. Reported by: Garrett Cooper MFC after: 3 weeks Sponsored by: Spectra Logic Corporation Modified: head/tests/sys/kern/Makefile Modified: head/tests/sys/kern/Makefile ============================================================================== --- head/tests/sys/kern/Makefile Thu Mar 6 20:24:15 2014 (r262867) +++ head/tests/sys/kern/Makefile Thu Mar 6 20:39:56 2014 (r262868) @@ -6,6 +6,6 @@ ATF_TESTS_C+= kern_descrip_test ATF_TESTS_C+= unix_seqpacket_test TEST_METADATA.unix_seqpacket_test+= timeout="15" -LDADD+= -lpthread +LDADD.unix_seqpacket_test+= -lpthread .include From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 21:02:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22459882; Thu, 6 Mar 2014 21:02:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0DBA1B27; Thu, 6 Mar 2014 21:02:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s26L2Glm002335; Thu, 6 Mar 2014 21:02:16 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26L2G0H002333; Thu, 6 Mar 2014 21:02:16 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201403062102.s26L2G0H002333@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 6 Mar 2014 21:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262869 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 21:02:17 -0000 Author: pfg Date: Thu Mar 6 21:02:16 2014 New Revision: 262869 URL: http://svnweb.freebsd.org/changeset/base/262869 Log: ext2fs: Fix a bug when sorting htree entries. This a typo introduced when bringing the original code from NetBSD. Reported by: Mike Ma MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_htree.c Modified: head/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- head/sys/fs/ext2fs/ext2_htree.c Thu Mar 6 20:39:56 2014 (r262868) +++ head/sys/fs/ext2fs/ext2_htree.c Thu Mar 6 21:02:16 2014 (r262869) @@ -471,7 +471,7 @@ ext2_htree_cmp_sort_entry(const void *e1 if (entry1->h_hash < entry2->h_hash) return (-1); - if (entry2->h_hash > entry2->h_hash) + if (entry1->h_hash > entry2->h_hash) return (1); return (0); } From owner-svn-src-head@FreeBSD.ORG Thu Mar 6 22:47:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 146974F5; Thu, 6 Mar 2014 22:47:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 006A876D; Thu, 6 Mar 2014 22:47:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s26MlBqC043650; Thu, 6 Mar 2014 22:47:11 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s26MlBd3043649; Thu, 6 Mar 2014 22:47:11 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201403062247.s26MlBd3043649@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 6 Mar 2014 22:47:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262872 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 22:47:12 -0000 Author: jilles Date: Thu Mar 6 22:47:11 2014 New Revision: 262872 URL: http://svnweb.freebsd.org/changeset/base/262872 Log: fts: Don't abort if an empty pathname is given. Make fts_open(3) treat an empty pathname like any other pathname that cannot be lstatted because of [ENOENT]. It is rather confusing if rm -rf file1 "" file2 does not remove file1 and file2. PR: bin/187264 MFC after: 2 weeks Modified: head/lib/libc/gen/fts.c Modified: head/lib/libc/gen/fts.c ============================================================================== --- head/lib/libc/gen/fts.c Thu Mar 6 21:47:22 2014 (r262871) +++ head/lib/libc/gen/fts.c Thu Mar 6 22:47:11 2014 (r262872) @@ -161,11 +161,7 @@ fts_open(argv, options, compar) /* Allocate/initialize root(s). */ for (root = NULL, nitems = 0; *argv != NULL; ++argv, ++nitems) { - /* Don't allow zero-length paths. */ - if ((len = strlen(*argv)) == 0) { - errno = ENOENT; - goto mem3; - } + len = strlen(*argv); p = fts_alloc(sp, *argv, len); p->fts_level = FTS_ROOTLEVEL; From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 00:25:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FADBD63; Fri, 7 Mar 2014 00:25:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5D1C5FB3; Fri, 7 Mar 2014 00:25:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s270PQLl088349; Fri, 7 Mar 2014 00:25:26 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s270POfu088329; Fri, 7 Mar 2014 00:25:24 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403070025.s270POfu088329@svn.freebsd.org> From: Ian Lepore Date: Fri, 7 Mar 2014 00:25:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262877 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 00:25:26 -0000 Author: ian Date: Fri Mar 7 00:25:23 2014 New Revision: 262877 URL: http://svnweb.freebsd.org/changeset/base/262877 Log: Add option TMPFS to arm/conf/DEFAULTS, remove it from the few configs that have it individually. Concensus on freebsd-arm@ is that it should be included in all ARM kernels. Modified: head/sys/arm/conf/ARNDALE head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/DEFAULTS head/sys/arm/conf/DIGI-CCWMX53 head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/DREAMPLUG-1001 head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/IMX53-QSB head/sys/arm/conf/IMX6 head/sys/arm/conf/VYBRID.common head/sys/arm/conf/WANDBOARD.common Modified: head/sys/arm/conf/ARNDALE ============================================================================== --- head/sys/arm/conf/ARNDALE Thu Mar 6 23:49:46 2014 (r262876) +++ head/sys/arm/conf/ARNDALE Fri Mar 7 00:25:23 2014 (r262877) @@ -39,7 +39,6 @@ options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem options PROCFS #Process filesystem (requires PSEUDOFS) options PSEUDOFS #Pseudo-filesystem framework -options TMPFS options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI options KTRACE Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Thu Mar 6 23:49:46 2014 (r262876) +++ head/sys/arm/conf/BEAGLEBONE Fri Mar 7 00:25:23 2014 (r262877) @@ -38,7 +38,6 @@ options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem options PROCFS #Process filesystem (requires PSEUDOFS) options PSEUDOFS #Pseudo-filesystem framework -options TMPFS #Efficient memory filesystem options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI options KTRACE #ktrace(1) support Modified: head/sys/arm/conf/DEFAULTS ============================================================================== --- head/sys/arm/conf/DEFAULTS Thu Mar 6 23:49:46 2014 (r262876) +++ head/sys/arm/conf/DEFAULTS Fri Mar 7 00:25:23 2014 (r262877) @@ -7,3 +7,6 @@ device mem options GEOM_PART_BSD options GEOM_PART_MBR + +options TMPFS + Modified: head/sys/arm/conf/DIGI-CCWMX53 ============================================================================== --- head/sys/arm/conf/DIGI-CCWMX53 Thu Mar 6 23:49:46 2014 (r262876) +++ head/sys/arm/conf/DIGI-CCWMX53 Fri Mar 7 00:25:23 2014 (r262877) @@ -45,7 +45,6 @@ options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # TMP Memory Filesystem options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization #options COMPAT_FREEBSD5 # Compatible with FreeBSD5 Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Thu Mar 6 23:49:46 2014 (r262876) +++ head/sys/arm/conf/DOCKSTAR Fri Mar 7 00:25:23 2014 (r262877) @@ -36,7 +36,6 @@ options CD9660 #ISO 9660 filesystem options FFS #Berkeley Fast Filesystem options MSDOSFS #MS DOS File System (FAT, FAT32) options NULLFS #NULL filesystem -options TMPFS #Efficient memory filesystem options SYSVSHM #SYSV-style shared memory options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores Modified: head/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- head/sys/arm/conf/DREAMPLUG-1001 Thu Mar 6 23:49:46 2014 (r262876) +++ head/sys/arm/conf/DREAMPLUG-1001 Fri Mar 7 00:25:23 2014 (r262877) @@ -39,7 +39,6 @@ options CD9660 #ISO 9660 filesystem options FFS #Berkeley Fast Filesystem options MSDOSFS #MS DOS File System (FAT, FAT32) options NULLFS #NULL filesystem -options TMPFS #Efficient memory filesystem options SYSVSHM #SYSV-style shared memory options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Thu Mar 6 23:49:46 2014 (r262876) +++ head/sys/arm/conf/EFIKA_MX Fri Mar 7 00:25:23 2014 (r262877) @@ -45,7 +45,6 @@ options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # TMP Memory Filesystem options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization #options COMPAT_FREEBSD5 # Compatible with FreeBSD5 Modified: head/sys/arm/conf/IMX53-QSB ============================================================================== --- head/sys/arm/conf/IMX53-QSB Thu Mar 6 23:49:46 2014 (r262876) +++ head/sys/arm/conf/IMX53-QSB Fri Mar 7 00:25:23 2014 (r262877) @@ -44,7 +44,6 @@ options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # TMP Memory Filesystem options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization #options COMPAT_FREEBSD5 # Compatible with FreeBSD5 Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Thu Mar 6 23:49:46 2014 (r262876) +++ head/sys/arm/conf/IMX6 Fri Mar 7 00:25:23 2014 (r262877) @@ -40,7 +40,6 @@ options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # TMP Memory Filesystem options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization options KTRACE # ktrace(1) support Modified: head/sys/arm/conf/VYBRID.common ============================================================================== --- head/sys/arm/conf/VYBRID.common Thu Mar 6 23:49:46 2014 (r262876) +++ head/sys/arm/conf/VYBRID.common Fri Mar 7 00:25:23 2014 (r262877) @@ -38,7 +38,6 @@ options CD9660 #ISO 9660 Filesystem options PROCFS #Process filesystem (requires PSEUDOFS) options PSEUDOFS #Pseudo-filesystem framework #options NANDFS #NAND Filesystem -options TMPFS options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI options KTRACE Modified: head/sys/arm/conf/WANDBOARD.common ============================================================================== --- head/sys/arm/conf/WANDBOARD.common Thu Mar 6 23:49:46 2014 (r262876) +++ head/sys/arm/conf/WANDBOARD.common Fri Mar 7 00:25:23 2014 (r262877) @@ -39,7 +39,6 @@ options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework -options TMPFS # TMP Memory Filesystem options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization options KTRACE # ktrace(1) support From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 01:01:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B48EAD9; Fri, 7 Mar 2014 01:01:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 092455F7; Fri, 7 Mar 2014 01:01:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2711vMV007971; Fri, 7 Mar 2014 01:01:57 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2711v0A007970; Fri, 7 Mar 2014 01:01:57 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403070101.s2711v0A007970@svn.freebsd.org> From: Warner Losh Date: Fri, 7 Mar 2014 01:01:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262880 - head/sbin/newfs_nandfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 01:01:58 -0000 Author: imp Date: Fri Mar 7 01:01:57 2014 New Revision: 262880 URL: http://svnweb.freebsd.org/changeset/base/262880 Log: Slight if reordering to make error branch last. Modified: head/sbin/newfs_nandfs/newfs_nandfs.c Modified: head/sbin/newfs_nandfs/newfs_nandfs.c ============================================================================== --- head/sbin/newfs_nandfs/newfs_nandfs.c Fri Mar 7 00:38:29 2014 (r262879) +++ head/sbin/newfs_nandfs/newfs_nandfs.c Fri Mar 7 01:01:57 2014 (r262880) @@ -988,10 +988,10 @@ calculate_geometry(int fd) /* Get storage erase unit size */ if (!is_nand) erasesize = NANDFS_DEF_ERASESIZE; - else if (ioctl(fd, NAND_IO_GET_CHIP_PARAM, &chip_params) == -1) - errx(1, "Cannot ioctl(NAND_IO_GET_CHIP_PARAM)"); - else + else if (ioctl(fd, NAND_IO_GET_CHIP_PARAM, &chip_params) != -1) erasesize = chip_params.page_size * chip_params.pages_per_block; + else + errx(1, "Cannot ioctl(NAND_IO_GET_CHIP_PARAM)"); debug("erasesize: %#jx", (uintmax_t)erasesize); From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 01:23:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95699FA5; Fri, 7 Mar 2014 01:23:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 828C7812; Fri, 7 Mar 2014 01:23:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s271Nnx2019720; Fri, 7 Mar 2014 01:23:49 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s271Nn1b019719; Fri, 7 Mar 2014 01:23:49 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403070123.s271Nn1b019719@svn.freebsd.org> From: Eitan Adler Date: Fri, 7 Mar 2014 01:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262882 - head/tools/tools/net80211/wlanstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 01:23:49 -0000 Author: eadler Date: Fri Mar 7 01:23:49 2014 New Revision: 262882 URL: http://svnweb.freebsd.org/changeset/base/262882 Log: wlanstats: add help - add a help (-h) flag - move usage into itsown function Modified: head/tools/tools/net80211/wlanstats/main.c Modified: head/tools/tools/net80211/wlanstats/main.c ============================================================================== --- head/tools/tools/net80211/wlanstats/main.c Fri Mar 7 01:13:48 2014 (r262881) +++ head/tools/tools/net80211/wlanstats/main.c Fri Mar 7 01:23:49 2014 (r262882) @@ -153,6 +153,11 @@ print_sta_stats(FILE *fd, const u_int8_t } #endif +void +usage(void) { + printf("wlanstats: [-ah] [-i ifname] [-l] [-o fmt] [interval]\n"); +} + int main(int argc, char *argv[]) { @@ -167,11 +172,14 @@ main(int argc, char *argv[]) if (ifname == NULL) ifname = "wlan0"; wf = wlanstats_new(ifname, getfmt("default")); - while ((c = getopt(argc, argv, "ai:lm:o:")) != -1) { + while ((c = getopt(argc, argv, "ahi:lm:o:")) != -1) { switch (c) { case 'a': allnodes++; break; + case 'h': + usage(); + exit(0); case 'i': wf->setifname(wf, optarg); break; @@ -188,7 +196,8 @@ main(int argc, char *argv[]) wf->setfmt(wf, getfmt(optarg)); break; default: - errx(-1, "usage: %s [-a] [-i ifname] [-l] [-o fmt] [interval]\n", argv[0]); + usage(); + exit(1); /*NOTREACHED*/ } } From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 02:02:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id A41625A7; Fri, 7 Mar 2014 02:02:10 +0000 (UTC) Date: Fri, 7 Mar 2014 02:02:10 +0000 From: Alexey Dokuchaev To: Eitan Adler Subject: Re: svn commit: r262882 - head/tools/tools/net80211/wlanstats Message-ID: <20140307020210.GA38155@FreeBSD.org> References: <201403070123.s271Nn1b019719@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201403070123.s271Nn1b019719@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 02:02:10 -0000 On Fri, Mar 07, 2014 at 01:23:49AM +0000, Eitan Adler wrote: > New Revision: 262882 > URL: http://svnweb.freebsd.org/changeset/base/262882 > > Log: > wlanstats: add help > > - add a help (-h) flag > - move usage into itsown function it looks like the only change now is that usage info always go to stdout, and exit code differs. i don't think it should be mfced. ./danfe From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 02:49:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F1E0DE2; Fri, 7 Mar 2014 02:49:43 +0000 (UTC) Received: from mail-qc0-x22a.google.com (mail-qc0-x22a.google.com [IPv6:2607:f8b0:400d:c01::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7EB07DAB; Fri, 7 Mar 2014 02:49:42 +0000 (UTC) Received: by mail-qc0-f170.google.com with SMTP id e9so4115611qcy.1 for ; Thu, 06 Mar 2014 18:49:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=oE8sD+rbKfKj/gWvFWgLYfkq5izKEp6n57TNOf4FtPI=; b=t6UCSWOEo6Eqm28TYx3qf33SGKf2c8sHHmKd4dAck/rTf3wtsix3Fw/6KaPMcvaY/M vQ5XJfZogGtNz1WDBwLZJ7EPzh++vF9hAeZIf3hEMurwtuqXQav8tkLj4ybteM4eiKuf RL2LljFT8a9mahDbUMb/Ip/C/NQLG0EHQ8EY8/CjUIiXMutOPfJnl0b9G6zcC0HZfLDJ rTzowf2q9iBqVg/pKFRHDJHnJUmyRtaC/hrdDtBxqLIX03efEdZhMXyIhOS5qlP8gVZQ vyakh96TVS6ctpI5m7RNLsl1vk+YDNfxl6Tw9lilVqkaT58cUb2W25IEoJt0BHBVVrhT X39A== MIME-Version: 1.0 X-Received: by 10.140.36.200 with SMTP id p66mr17514919qgp.54.1394160581662; Thu, 06 Mar 2014 18:49:41 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.8.137 with HTTP; Thu, 6 Mar 2014 18:49:41 -0800 (PST) In-Reply-To: <20140307020210.GA38155@FreeBSD.org> References: <201403070123.s271Nn1b019719@svn.freebsd.org> <20140307020210.GA38155@FreeBSD.org> Date: Thu, 6 Mar 2014 18:49:41 -0800 X-Google-Sender-Auth: _csD-FCsQo5jLlgAsDE8Vx--3a0 Message-ID: Subject: Re: svn commit: r262882 - head/tools/tools/net80211/wlanstats From: Adrian Chadd To: Alexey Dokuchaev Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Eitan Adler X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 02:49:43 -0000 it's only in tools; I haven't yet moved it to usr.bin and I won't be MFCing it to -10 without first MFC'ing the libbsdstats/ commit. -a On 6 March 2014 18:02, Alexey Dokuchaev wrote: > On Fri, Mar 07, 2014 at 01:23:49AM +0000, Eitan Adler wrote: >> New Revision: 262882 >> URL: http://svnweb.freebsd.org/changeset/base/262882 >> >> Log: >> wlanstats: add help >> >> - add a help (-h) flag >> - move usage into itsown function > > it looks like the only change now is that usage info always go to stdout, > and exit code differs. i don't think it should be mfced. > > ./danfe > From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 03:07:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4896A3FE; Fri, 7 Mar 2014 03:07:20 +0000 (UTC) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id E94A9FF5; Fri, 7 Mar 2014 03:07:19 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id B8C8B1A312D; Fri, 7 Mar 2014 14:07:17 +1100 (EST) Date: Fri, 7 Mar 2014 14:07:15 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alexey Dokuchaev Subject: Re: svn commit: r262882 - head/tools/tools/net80211/wlanstats In-Reply-To: <20140307020210.GA38155@FreeBSD.org> Message-ID: <20140307132653.O3656@besplex.bde.org> References: <201403070123.s271Nn1b019719@svn.freebsd.org> <20140307020210.GA38155@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=ddC5gxne c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=P3guzJ-EPTYA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=1v9j2Wz2wCQUb9ePlhAA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 03:07:20 -0000 On Fri, 7 Mar 2014, Alexey Dokuchaev wrote: > On Fri, Mar 07, 2014 at 01:23:49AM +0000, Eitan Adler wrote: >> New Revision: 262882 >> URL: http://svnweb.freebsd.org/changeset/base/262882 >> >> Log: >> wlanstats: add help >> >> - add a help (-h) flag >> - move usage into itsown function > > it looks like the only change now is that usage info always go to stdout, > and exit code differs. i don't think it should be mfced. It also removes the double printing of the program name (correct) and the printing of "usage: ", and has mounds of style bugs. gnu utilities have a --help flag that causes similar behaviour (printing to stdout and exiting with status 0), but they still print error messages about usage to stderr. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 06:23:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51BA51C4; Fri, 7 Mar 2014 06:23:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3EB44AC; Fri, 7 Mar 2014 06:23:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s276NcMK062574; Fri, 7 Mar 2014 06:23:38 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s276NcPf062573; Fri, 7 Mar 2014 06:23:38 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201403070623.s276NcPf062573@svn.freebsd.org> From: Peter Grehan Date: Fri, 7 Mar 2014 06:23:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262884 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 06:23:38 -0000 Author: grehan Date: Fri Mar 7 06:23:37 2014 New Revision: 262884 URL: http://svnweb.freebsd.org/changeset/base/262884 Log: Open the uart emulation's backing tty in non-blocking mode. This fixes the issue of bhyve appearing to halt when using nmdm ports for the console, until a connection is made to the other end. bhyveload already does this. Reported by: Many. MFC after: 3 weeks. Modified: head/usr.sbin/bhyve/uart_emul.c Modified: head/usr.sbin/bhyve/uart_emul.c ============================================================================== --- head/usr.sbin/bhyve/uart_emul.c Fri Mar 7 02:41:45 2014 (r262883) +++ head/usr.sbin/bhyve/uart_emul.c Fri Mar 7 06:23:37 2014 (r262884) @@ -585,7 +585,7 @@ uart_tty_backend(struct uart_softc *sc, retval = -1; - fd = open(opts, O_RDWR); + fd = open(opts, O_RDWR | O_NONBLOCK); if (fd > 0 && isatty(fd)) { sc->tty.fd = fd; sc->tty.opened = true; From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 07:06:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78036EA9; Fri, 7 Mar 2014 07:06:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 63D1B5E4; Fri, 7 Mar 2014 07:06:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2776b6w081604; Fri, 7 Mar 2014 07:06:37 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2776anJ081598; Fri, 7 Mar 2014 07:06:36 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201403070706.s2776anJ081598@svn.freebsd.org> From: Ruslan Bukin Date: Fri, 7 Mar 2014 07:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262885 - in head/sys: arm/freescale/vybrid boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 07:06:37 -0000 Author: br Date: Fri Mar 7 07:06:36 2014 New Revision: 262885 URL: http://svnweb.freebsd.org/changeset/base/262885 Log: Add driver for Port control and interrupts (PORT). PORT is responsible for external interrupts management, so move IRQ lines from GPIO driver. Added: head/sys/arm/freescale/vybrid/vf_port.c (contents, props changed) head/sys/arm/freescale/vybrid/vf_port.h (contents, props changed) Modified: head/sys/arm/freescale/vybrid/files.vybrid head/sys/arm/freescale/vybrid/vf_gpio.c head/sys/boot/fdt/dts/arm/vybrid.dtsi Modified: head/sys/arm/freescale/vybrid/files.vybrid ============================================================================== --- head/sys/arm/freescale/vybrid/files.vybrid Fri Mar 7 06:23:37 2014 (r262884) +++ head/sys/arm/freescale/vybrid/files.vybrid Fri Mar 7 07:06:36 2014 (r262885) @@ -23,6 +23,7 @@ arm/freescale/vybrid/vf_mscm.c standar arm/freescale/vybrid/vf_src.c standard arm/freescale/vybrid/vf_edma.c standard arm/freescale/vybrid/vf_dmamux.c standard +arm/freescale/vybrid/vf_port.c standard arm/freescale/vybrid/vf_i2c.c optional iicbus arm/freescale/vybrid/vf_tcon.c optional vt arm/freescale/vybrid/vf_dcu4.c optional vt Modified: head/sys/arm/freescale/vybrid/vf_gpio.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_gpio.c Fri Mar 7 06:23:37 2014 (r262884) +++ head/sys/arm/freescale/vybrid/vf_gpio.c Fri Mar 7 07:06:36 2014 (r262885) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include "gpio_if.h" #include +#include #define GPIO_PDOR(n) (0x00 + 0x40 * (n >> 5)) #define GPIO_PSOR(n) (0x04 + 0x40 * (n >> 5)) @@ -68,8 +69,6 @@ __FBSDID("$FreeBSD$"); #define GPIO_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define GPIO_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define NPORTS 5 -#define NGPIO (NPORTS * 32) #define DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT) /* @@ -85,41 +84,23 @@ static int vf_gpio_pin_get(device_t, uin static int vf_gpio_pin_toggle(device_t, uint32_t pin); struct vf_gpio_softc { - struct resource *res[6]; + struct resource *res[1]; bus_space_tag_t bst; bus_space_handle_t bsh; struct mtx sc_mtx; int gpio_npins; struct gpio_pin gpio_pins[NGPIO]; - void *gpio_ih[NPORTS]; }; struct vf_gpio_softc *gpio_sc; static struct resource_spec vf_gpio_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, - { SYS_RES_IRQ, 0, RF_ACTIVE }, - { SYS_RES_IRQ, 1, RF_ACTIVE }, - { SYS_RES_IRQ, 2, RF_ACTIVE }, - { SYS_RES_IRQ, 3, RF_ACTIVE }, - { SYS_RES_IRQ, 4, RF_ACTIVE }, { -1, 0 } }; static int -vf_gpio_intr(void *arg) -{ - struct vf_gpio_softc *sc; - sc = arg; - - /* TODO: interrupt handling */ - - return (FILTER_HANDLED); -} - - -static int vf_gpio_probe(device_t dev) { @@ -137,7 +118,7 @@ static int vf_gpio_attach(device_t dev) { struct vf_gpio_softc *sc; - int irq, i; + int i; sc = device_get_softc(dev); mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); @@ -147,22 +128,13 @@ vf_gpio_attach(device_t dev) return (ENXIO); } - gpio_sc = sc; - /* Memory interface */ sc->bst = rman_get_bustag(sc->res[0]); sc->bsh = rman_get_bushandle(sc->res[0]); - sc->gpio_npins = NGPIO; + gpio_sc = sc; - for (irq = 0; irq < NPORTS; irq ++) { - if ((bus_setup_intr(dev, sc->res[1 + irq], INTR_TYPE_MISC, - vf_gpio_intr, NULL, sc, &sc->gpio_ih[irq]))) { - device_printf(dev, - "WARNING: unable to register interrupt handler\n"); - return (ENXIO); - } - } + sc->gpio_npins = NGPIO; for (i = 0; i < sc->gpio_npins; i++) { sc->gpio_pins[i].gp_pin = i; Added: head/sys/arm/freescale/vybrid/vf_port.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/vybrid/vf_port.c Fri Mar 7 07:06:36 2014 (r262885) @@ -0,0 +1,250 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Vybrid Family Port control and interrupts (PORT) + * Chapter 6, Vybrid Reference Manual, Rev. 5, 07/2013 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +/* Pin Control Register */ +#define PORT_PCR(n) (0x1000 * (n >> 5) + 0x4 * (n % 32)) +#define PCR_IRQC_S 16 +#define PCR_IRQC_M 0xF +#define PCR_DMA_RE 0x1 +#define PCR_DMA_FE 0x2 +#define PCR_DMA_EE 0x3 +#define PCR_INT_LZ 0x8 +#define PCR_INT_RE 0x9 +#define PCR_INT_FE 0xA +#define PCR_INT_EE 0xB +#define PCR_INT_LO 0xC +#define PCR_ISF (1 << 24) +#define PORT0_ISFR 0xA0 /* Interrupt Status Flag Register */ +#define PORT0_DFER 0xC0 /* Digital Filter Enable Register */ +#define PORT0_DFCR 0xC4 /* Digital Filter Clock Register */ +#define PORT0_DFWR 0xC8 /* Digital Filter Width Register */ + +struct port_event { + uint32_t enabled; + uint32_t mux_num; + uint32_t mux_src; + uint32_t mux_chn; + void (*ih) (void *); + void *ih_user; + enum ev_type pevt; +}; + +static struct port_event event_map[NGPIO]; + +struct port_softc { + struct resource *res[6]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + void *gpio_ih[NGPIO]; +}; + +struct port_softc *port_sc; + +static struct resource_spec port_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 1, RF_ACTIVE }, + { SYS_RES_IRQ, 2, RF_ACTIVE }, + { SYS_RES_IRQ, 3, RF_ACTIVE }, + { SYS_RES_IRQ, 4, RF_ACTIVE }, + { -1, 0 } +}; + +static int +port_intr(void *arg) +{ + struct port_event *pev; + struct port_softc *sc; + int reg; + int i; + + sc = arg; + + for (i = 0; i < NGPIO; i++) { + reg = READ4(sc, PORT_PCR(i)); + if (reg & PCR_ISF) { + + /* Clear interrupt */ + WRITE4(sc, PORT_PCR(i), reg); + + /* Handle event */ + pev = &event_map[i]; + if (pev->enabled == 1) { + if (pev->ih != NULL) { + pev->ih(pev->ih_user); + } + } + } + } + + return (FILTER_HANDLED); +} + +int +port_setup(int pnum, enum ev_type pevt, void (*ih)(void *), void *ih_user) +{ + struct port_event *pev; + struct port_softc *sc; + int reg; + int val; + + sc = port_sc; + + switch (pevt) { + case DMA_RISING_EDGE: + val = PCR_DMA_RE; + break; + case DMA_FALLING_EDGE: + val = PCR_DMA_FE; + break; + case DMA_EITHER_EDGE: + val = PCR_DMA_EE; + break; + case INT_LOGIC_ZERO: + val = PCR_INT_LZ; + break; + case INT_RISING_EDGE: + val = PCR_INT_RE; + break; + case INT_FALLING_EDGE: + val = PCR_INT_FE; + break; + case INT_EITHER_EDGE: + val = PCR_INT_RE; + break; + case INT_LOGIC_ONE: + val = PCR_INT_LO; + break; + default: + return (-1); + }; + + reg = READ4(sc, PORT_PCR(pnum)); + reg &= ~(PCR_IRQC_M << PCR_IRQC_S); + reg |= (val << PCR_IRQC_S); + WRITE4(sc, PORT_PCR(pnum), reg); + + pev = &event_map[pnum]; + pev->ih = ih; + pev->ih_user = ih_user; + pev->pevt = pevt; + pev->enabled = 1; + + return (0); +} + +static int +port_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-port")) + return (ENXIO); + + device_set_desc(dev, "Vybrid Family Port control and interrupts"); + return (BUS_PROBE_DEFAULT); +} + +static int +port_attach(device_t dev) +{ + struct port_softc *sc; + int irq; + + sc = device_get_softc(dev); + + if (bus_alloc_resources(dev, port_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + port_sc = sc; + + for (irq = 0; irq < NPORTS; irq ++) { + if ((bus_setup_intr(dev, sc->res[1 + irq], INTR_TYPE_MISC, + port_intr, NULL, sc, &sc->gpio_ih[irq]))) { + device_printf(dev, + "ERROR: Unable to register interrupt handler\n"); + return (ENXIO); + } + } + + return (0); +} + +static device_method_t port_methods[] = { + DEVMETHOD(device_probe, port_probe), + DEVMETHOD(device_attach, port_attach), + { 0, 0 } +}; + +static driver_t port_driver = { + "port", + port_methods, + sizeof(struct port_softc), +}; + +static devclass_t port_devclass; + +DRIVER_MODULE(port, simplebus, port_driver, port_devclass, 0, 0); Added: head/sys/arm/freescale/vybrid/vf_port.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/vybrid/vf_port.h Fri Mar 7 07:06:36 2014 (r262885) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define NPORTS 5 +#define NGPIO (NPORTS * 32) + +enum ev_type { + DMA_RISING_EDGE, + DMA_FALLING_EDGE, + DMA_EITHER_EDGE, + INT_LOGIC_ZERO, + INT_RISING_EDGE, + INT_FALLING_EDGE, + INT_EITHER_EDGE, + INT_LOGIC_ONE, +}; + +int port_setup(int, enum ev_type, void (*ih)(void *), void *ih_user); Modified: head/sys/boot/fdt/dts/arm/vybrid.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/vybrid.dtsi Fri Mar 7 06:23:37 2014 (r262884) +++ head/sys/boot/fdt/dts/arm/vybrid.dtsi Fri Mar 7 07:06:36 2014 (r262885) @@ -146,13 +146,18 @@ reg = <0x40048000 0x1000>; }; + port@40049000 { + compatible = "fsl,mvf600-port"; + reg = <0x40049000 0x5000>; + interrupts = < 139 140 141 142 143 >; + interrupt-parent = <&GIC>; + }; + gpio@400FF000 { compatible = "fsl,mvf600-gpio"; reg = <0x400FF000 0x200>; #gpio-cells = <3>; gpio-controller; - interrupts = < 139 140 141 142 143 >; - interrupt-parent = <&GIC>; }; nand@400E0000 { From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 09:19:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93B6F32A; Fri, 7 Mar 2014 09:19:38 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id 6E3AA25D; Fri, 7 Mar 2014 09:19:38 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [198.74.231.63]) by cyrus.watson.org (Postfix) with ESMTPS id B1B0B46B49; Fri, 7 Mar 2014 04:19:37 -0500 (EST) Date: Fri, 7 Mar 2014 09:19:37 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Bruce Evans Subject: Re: svn commit: r262882 - head/tools/tools/net80211/wlanstats In-Reply-To: <20140307132653.O3656@besplex.bde.org> Message-ID: References: <201403070123.s271Nn1b019719@svn.freebsd.org> <20140307020210.GA38155@FreeBSD.org> <20140307132653.O3656@besplex.bde.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, Eitan Adler , svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 09:19:38 -0000 On Fri, 7 Mar 2014, Bruce Evans wrote: >>> Log: >>> wlanstats: add help >>> >>> - add a help (-h) flag >>> - move usage into itsown function >> >> it looks like the only change now is that usage info always go to stdout, >> and exit code differs. i don't think it should be mfced. > > It also removes the double printing of the program name (correct) and the > printing of "usage: ", and has mounds of style bugs. > > gnu utilities have a --help flag that causes similar behaviour (printing to > stdout and exiting with status 0), but they still print error messages about > usage to stderr. They can also return a non-zero status if printing the man pages encounters problems. This leads to some curious text in the GNU info page for 'true' explaining that it can sometimes return false. Robert From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 09:45:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9567D103; Fri, 7 Mar 2014 09:45:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 690EF787; Fri, 7 Mar 2014 09:45:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s279jf4L056252; Fri, 7 Mar 2014 09:45:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s279jfos056250; Fri, 7 Mar 2014 09:45:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201403070945.s279jfos056250@svn.freebsd.org> From: Alexander Motin Date: Fri, 7 Mar 2014 09:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262886 - in head/sys: cam/ata sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 09:45:41 -0000 Author: mav Date: Fri Mar 7 09:45:40 2014 New Revision: 262886 URL: http://svnweb.freebsd.org/changeset/base/262886 Log: Fix support for increased logical sector size (4K-native drives). - Logical sector size is measured in words, not bytes. - If physical sector is not bigger then logical sector, it does not mean it should be set equal to 512 bytes, but set to logical sector. PR: misc/187269 Submitted by: Ravi Pokala MFC after: 1 week Modified: head/sys/cam/ata/ata_all.c head/sys/sys/ata.h Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Fri Mar 7 07:06:36 2014 (r262885) +++ head/sys/cam/ata/ata_all.c Fri Mar 7 09:45:40 2014 (r262886) @@ -338,10 +338,10 @@ semb_print_ident_short(struct sep_identi uint32_t ata_logical_sector_size(struct ata_params *ident_data) { - if ((ident_data->pss & 0xc000) == 0x4000 && + if ((ident_data->pss & ATA_PSS_VALID_MASK) == ATA_PSS_VALID_VALUE && (ident_data->pss & ATA_PSS_LSSABOVE512)) { - return ((u_int32_t)ident_data->lss_1 | - ((u_int32_t)ident_data->lss_2 << 16)); + return (((u_int32_t)ident_data->lss_1 | + ((u_int32_t)ident_data->lss_2 << 16)) * 2); } return (512); } @@ -349,10 +349,13 @@ ata_logical_sector_size(struct ata_param uint64_t ata_physical_sector_size(struct ata_params *ident_data) { - if ((ident_data->pss & 0xc000) == 0x4000 && - (ident_data->pss & ATA_PSS_MULTLS)) { - return ((uint64_t)ata_logical_sector_size(ident_data) * - (1 << (ident_data->pss & ATA_PSS_LSPPS))); + if ((ident_data->pss & ATA_PSS_VALID_MASK) == ATA_PSS_VALID_VALUE) { + if (ident_data->pss & ATA_PSS_MULTLS) { + return ((uint64_t)ata_logical_sector_size(ident_data) * + (1 << (ident_data->pss & ATA_PSS_LSPPS))); + } else { + return (uint64_t)ata_logical_sector_size(ident_data); + } } return (512); } Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Fri Mar 7 07:06:36 2014 (r262885) +++ head/sys/sys/ata.h Fri Mar 7 09:45:40 2014 (r262886) @@ -214,6 +214,8 @@ struct ata_params { #define ATA_PSS_LSPPS 0x000F #define ATA_PSS_LSSABOVE512 0x1000 #define ATA_PSS_MULTLS 0x2000 +#define ATA_PSS_VALID_MASK 0xC000 +#define ATA_PSS_VALID_VALUE 0x4000 /*107*/ u_int16_t isd; /*108*/ u_int16_t wwn[4]; u_int16_t reserved112[5]; From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 15:21:20 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABDD8C48; Fri, 7 Mar 2014 15:21:20 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4A61ABBC; Fri, 7 Mar 2014 15:21:20 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id s27FLBQw058031; Fri, 7 Mar 2014 17:21:11 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s27FLBQw058031 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id s27FLB2A058030; Fri, 7 Mar 2014 17:21:11 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 7 Mar 2014 17:21:11 +0200 From: Konstantin Belousov To: Ian Lepore Subject: Re: svn commit: r262411 - head/sys/arm/arm Message-ID: <20140307152111.GL24664@kib.kiev.ua> References: <201402232252.s1NMqmI5075701@svn.freebsd.org> <20140305115402.GC24664@kib.kiev.ua> <1394025767.1149.327.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aq8k2F4XKnGQvi/k" Content-Disposition: inline In-Reply-To: <1394025767.1149.327.camel@revolution.hippie.lan> User-Agent: Mutt/1.5.22 (2013-10-16) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 15:21:20 -0000 --aq8k2F4XKnGQvi/k Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 05, 2014 at 06:22:47AM -0700, Ian Lepore wrote: > On Wed, 2014-03-05 at 13:54 +0200, Konstantin Belousov wrote: > > On Sun, Feb 23, 2014 at 10:52:48PM +0000, Ian Lepore wrote: > > > Author: ian > > > Date: Sun Feb 23 22:52:48 2014 > > > New Revision: 262411 > > > URL: http://svnweb.freebsd.org/changeset/base/262411 > > >=20 > > > Log: > > > If the L2 cache type is PIPT, pass a physical address for a flush. > > > =20 > > > While this is technically more correct, I don't think it much matte= rs, > > > because the only thing in the tree that calls cpu_flush_dcache() is= md(4) > > > and I'm > 99% sure it's bogus that it does so; md has no ability to= do > > > anything that can perturb data cache coherency. > >=20 > > Yes, md(4) does not break data cache coherency, but I think that > > Marcel added the flush to ensure instruction cache coherency. The > > intent was to ensure that harward-architecture machines would > > see up-to-date memory content when fetching instructions after > > read on md(4). >=20 > Oh. If that's necessary on ia64, it seems like ia64/elf_machdep.c would > be the place to do the flush. I am not sure about ia64, it was needed for PowerPC, I think. The issue is not limited to the module loads, so elf_machdep.c cannot solve the problem. --aq8k2F4XKnGQvi/k Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJTGePmAAoJEJDCuSvBvK1B6wcQAJXAPTp0SQRhC6F6N9wAiP6J fs9OqM0piKSxOl9BouSatDjz/KI+wUacJ3YcaZhQNOyJViFcEeyOdcCYgZbC/U3s 83OL5nRpN4wxE5/g92pQm85WCRFa6kopW12RKlNpqlZ09bT8wkcmkNCoxBrmjB93 uFm0MGe0OiQhNQjrWeNPGEpXaO92f/ilc0ps3cfL+B1BM5+ou1si9QBp5MoqjK1L eQRY/LgkOA2PasorIr2ljiGZWwECQcNkFe+NitOomqZg1fxi2+ugRA54Y1vBfA97 JRVO2Vlaj50V0RVrKJpcaW+bXyMXPHO/zHAafaZBLk+v+e79TSv6ZTAODXrrzF0x P0M6FDYsH+0xlEssroLsd310dPn2p/wRAIRMSf6K8o81mtRrcRtUB7kksw0bUrUJ fQj6KHv1IKF61p35Qp0A+jrZtznvhsQiOIyy9hQkXqryx4JAm1I+LEpRDhYatXpN Tua2Sk4kYNzCF1vp163vmz9pPznJr1geLnB/bdwzdGbEPMuYctBlQU0MOqZytRqP DUia3I9dPqz85JMMXjHcy8N8coKNbWu4KYPA1lKkp0Ye1j1ixfJJRD7zuayMYQgi asdIO3FNnW8rkuUqdkEWVFNEQsNZMpNK0fSpK7L4fS2mRzm/dD+4Pf5mY0GRwh8p ds/LHMnJamdHcew7++sN =8API -----END PGP SIGNATURE----- --aq8k2F4XKnGQvi/k-- From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 15:35:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E42A0403; Fri, 7 Mar 2014 15:35:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D0D25CAC; Fri, 7 Mar 2014 15:35:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27FZtkG008436; Fri, 7 Mar 2014 15:35:55 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27FZtFZ008432; Fri, 7 Mar 2014 15:35:55 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403071535.s27FZtFZ008432@svn.freebsd.org> From: Eitan Adler Date: Fri, 7 Mar 2014 15:35:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262890 - in head/lib/libc: stdio string X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 15:35:56 -0000 Author: eadler Date: Fri Mar 7 15:35:54 2014 New Revision: 262890 URL: http://svnweb.freebsd.org/changeset/base/262890 Log: libc man pages: Remove reference to non-existent FreeBSD Security Architecture MFC After: 3 days Modified: head/lib/libc/stdio/tmpnam.3 head/lib/libc/string/strcat.3 head/lib/libc/string/strcpy.3 Modified: head/lib/libc/stdio/tmpnam.3 ============================================================================== --- head/lib/libc/stdio/tmpnam.3 Fri Mar 7 14:44:13 2014 (r262889) +++ head/lib/libc/stdio/tmpnam.3 Fri Mar 7 15:35:54 2014 (r262890) @@ -244,5 +244,3 @@ file permissions may be specified. It is strongly suggested that .Xr mkstemp 3 be used in place of these functions. -(See -the FSA.) Modified: head/lib/libc/string/strcat.3 ============================================================================== --- head/lib/libc/string/strcat.3 Fri Mar 7 14:44:13 2014 (r262889) +++ head/lib/libc/string/strcat.3 Fri Mar 7 15:35:54 2014 (r262890) @@ -103,8 +103,6 @@ The function is easily misused in a manner which enables malicious users to arbitrarily change a running program's functionality through a buffer overflow attack. -(See -the FSA.) .Pp Avoid using .Fn strcat . Modified: head/lib/libc/string/strcpy.3 ============================================================================== --- head/lib/libc/string/strcpy.3 Fri Mar 7 14:44:13 2014 (r262889) +++ head/lib/libc/string/strcpy.3 Fri Mar 7 15:35:54 2014 (r262890) @@ -210,7 +210,3 @@ The function is easily misused in a manner which enables malicious users to arbitrarily change a running program's functionality through a buffer overflow attack. -(See -the FSA -and -.Sx EXAMPLES . ) From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 16:14:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36AC0FBF; Fri, 7 Mar 2014 16:14:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1702D62; Fri, 7 Mar 2014 16:14:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27GEprB025202; Fri, 7 Mar 2014 16:14:51 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27GEp3a025200; Fri, 7 Mar 2014 16:14:51 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201403071614.s27GEp3a025200@svn.freebsd.org> From: Ruslan Bukin Date: Fri, 7 Mar 2014 16:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262891 - in head/sys: arm/freescale/vybrid boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 16:14:52 -0000 Author: br Date: Fri Mar 7 16:14:51 2014 New Revision: 262891 URL: http://svnweb.freebsd.org/changeset/base/262891 Log: - Export panel info to DTS - Reset all the layers before setup first one - Enable display Modified: head/sys/arm/freescale/vybrid/vf_dcu4.c head/sys/boot/fdt/dts/arm/vybrid-quartz.dts Modified: head/sys/arm/freescale/vybrid/vf_dcu4.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_dcu4.c Fri Mar 7 15:35:54 2014 (r262890) +++ head/sys/arm/freescale/vybrid/vf_dcu4.c Fri Mar 7 16:14:51 2014 (r262891) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -54,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "gpio_if.h" + #include #include #include @@ -74,6 +77,9 @@ __FBSDID("$FreeBSD$"); #define DCU_MODE_TEST 0x2 #define DCU_MODE_COLBAR 0x3 #define RASTER_EN (1 << 14) /* Raster scan of pixel data */ +#define PDI_EN (1 << 13) +#define PDI_DE_MODE (1 << 11) +#define PDI_MODE_M 2 #define DCU_BGND 0x014 /* Background */ #define DCU_DISP_SIZE 0x018 /* Display Size */ #define DELTA_M 0x7ff @@ -90,6 +96,9 @@ __FBSDID("$FreeBSD$"); #define DCU_SYNPOL 0x024 /* Synchronize Polarity */ #define INV_HS (1 << 0) #define INV_VS (1 << 1) +#define INV_PDI_VS (1 << 8) /* Polarity of PDI input VSYNC. */ +#define INV_PDI_HS (1 << 9) /* Polarity of PDI input HSYNC. */ +#define INV_PDI_DE (1 << 10) /* Polarity of PDI input DE. */ #define DCU_THRESHOLD 0x028 /* Threshold */ #define LS_BF_VS_SHIFT 16 #define OUT_BUF_HIGH_SHIFT 8 @@ -160,8 +169,20 @@ __FBSDID("$FreeBSD$"); #define DCU_CTRLDESCLn_8(n) DCU_CTRLDESCL(n, 8) #define DCU_CTRLDESCLn_9(n) DCU_CTRLDESCL(n, 9) -#define DISPLAY_WIDTH 480 -#define DISPLAY_HEIGHT 272 +#define NUM_LAYERS 64 + +struct panel_info { + uint32_t width; + uint32_t height; + uint32_t h_back_porch; + uint32_t h_pulse_width; + uint32_t h_front_porch; + uint32_t v_back_porch; + uint32_t v_pulse_width; + uint32_t v_front_porch; + uint32_t clk_div; + uint32_t backlight_pin; +}; struct dcu_softc { struct resource *res[2]; @@ -171,6 +192,7 @@ struct dcu_softc { device_t dev; device_t sc_fbd; /* fbd child */ struct fb_info sc_info; + struct panel_info *panel; }; static struct resource_spec dcu_spec[] = { @@ -209,33 +231,84 @@ dcu_intr(void *arg) } static int +get_panel_info(struct dcu_softc *sc, struct panel_info *panel) +{ + phandle_t node; + pcell_t dts_value[3]; + int len; + + if ((node = ofw_bus_get_node(sc->dev)) == -1) + return (ENXIO); + + /* panel size */ + if ((len = OF_getproplen(node, "panel-size")) <= 0) + return (ENXIO); + OF_getprop(node, "panel-size", &dts_value, len); + panel->width = fdt32_to_cpu(dts_value[0]); + panel->height = fdt32_to_cpu(dts_value[1]); + + /* hsync */ + if ((len = OF_getproplen(node, "panel-hsync")) <= 0) + return (ENXIO); + OF_getprop(node, "panel-hsync", &dts_value, len); + panel->h_back_porch = fdt32_to_cpu(dts_value[0]); + panel->h_pulse_width = fdt32_to_cpu(dts_value[1]); + panel->h_front_porch = fdt32_to_cpu(dts_value[2]); + + /* vsync */ + if ((len = OF_getproplen(node, "panel-vsync")) <= 0) + return (ENXIO); + OF_getprop(node, "panel-vsync", &dts_value, len); + panel->v_back_porch = fdt32_to_cpu(dts_value[0]); + panel->v_pulse_width = fdt32_to_cpu(dts_value[1]); + panel->v_front_porch = fdt32_to_cpu(dts_value[2]); + + /* clk divider */ + if ((len = OF_getproplen(node, "panel-clk-div")) <= 0) + return (ENXIO); + OF_getprop(node, "panel-clk-div", &dts_value, len); + panel->clk_div = fdt32_to_cpu(dts_value[0]); + + /* backlight pin */ + if ((len = OF_getproplen(node, "panel-backlight-pin")) <= 0) + return (ENXIO); + OF_getprop(node, "panel-backlight-pin", &dts_value, len); + panel->backlight_pin = fdt32_to_cpu(dts_value[0]); + + return (0); +} + +static int dcu_init(struct dcu_softc *sc) { + struct panel_info *panel; int reg; + int i; + + panel = sc->panel; /* Configure DCU */ reg = ((sc->sc_info.fb_height) << DELTA_Y_S); reg |= (sc->sc_info.fb_width / 16); WRITE4(sc, DCU_DISP_SIZE, reg); - /* TODO: export panel info to FDT */ - - reg = (2 << BP_H_SHIFT); - reg |= (41 << PW_H_SHIFT); - reg |= (2 << FP_H_SHIFT); + reg = (panel->h_back_porch << BP_H_SHIFT); + reg |= (panel->h_pulse_width << PW_H_SHIFT); + reg |= (panel->h_front_porch << FP_H_SHIFT); WRITE4(sc, DCU_HSYN_PARA, reg); - reg = (2 << BP_V_SHIFT); - reg |= (10 << PW_V_SHIFT); - reg |= (2 << FP_V_SHIFT); + reg = (panel->v_back_porch << BP_V_SHIFT); + reg |= (panel->v_pulse_width << PW_V_SHIFT); + reg |= (panel->v_front_porch << FP_V_SHIFT); WRITE4(sc, DCU_VSYN_PARA, reg); WRITE4(sc, DCU_BGND, 0); - WRITE4(sc, DCU_DIV_RATIO, 30); + WRITE4(sc, DCU_DIV_RATIO, panel->clk_div); reg = (INV_VS | INV_HS); WRITE4(sc, DCU_SYNPOL, reg); + /* TODO: export to panel info */ reg = (0x3 << LS_BF_VS_SHIFT); reg |= (0x78 << OUT_BUF_HIGH_SHIFT); reg |= (0 << OUT_BUF_LOW_SHIFT); @@ -244,6 +317,19 @@ dcu_init(struct dcu_softc *sc) /* Mask all the interrupts */ WRITE4(sc, DCU_INT_MASK, 0xffffffff); + /* Reset all layers */ + for (i = 0; i < NUM_LAYERS; i++) { + WRITE4(sc, DCU_CTRLDESCLn_1(i), 0x0); + WRITE4(sc, DCU_CTRLDESCLn_2(i), 0x0); + WRITE4(sc, DCU_CTRLDESCLn_3(i), 0x0); + WRITE4(sc, DCU_CTRLDESCLn_4(i), 0x0); + WRITE4(sc, DCU_CTRLDESCLn_5(i), 0x0); + WRITE4(sc, DCU_CTRLDESCLn_6(i), 0x0); + WRITE4(sc, DCU_CTRLDESCLn_7(i), 0x0); + WRITE4(sc, DCU_CTRLDESCLn_8(i), 0x0); + WRITE4(sc, DCU_CTRLDESCLn_9(i), 0x0); + } + /* Setup first layer */ reg = (sc->sc_info.fb_width | (sc->sc_info.fb_height << 16)); WRITE4(sc, DCU_CTRLDESCLn_1(0), reg); @@ -273,10 +359,13 @@ dcu_init(struct dcu_softc *sc) static int dcu_attach(device_t dev) { + struct panel_info panel; struct dcu_softc *sc; + device_t gpio_dev; int err; sc = device_get_softc(dev); + sc->dev = dev; if (bus_alloc_resources(dev, dcu_spec, sc->res)) { device_printf(dev, "could not allocate resources\n"); @@ -295,11 +384,30 @@ dcu_attach(device_t dev) return (ENXIO); } + if (get_panel_info(sc, &panel)) { + device_printf(dev, "Can't get panel info\n"); + return (ENXIO); + } + + sc->panel = &panel; + /* Bypass timing control (used for raw lcd panels) */ tcon_bypass(); - sc->sc_info.fb_width = DISPLAY_WIDTH; - sc->sc_info.fb_height = DISPLAY_HEIGHT; + /* Get the GPIO device, we need this to give power to USB */ + gpio_dev = devclass_get_device(devclass_find("gpio"), 0); + if (gpio_dev == NULL) { + device_printf(sc->dev, "Error: failed to get the GPIO dev\n"); + return (1); + } + + /* Turn on backlight */ + /* TODO: Use FlexTimer/PWM */ + GPIO_PIN_SETFLAGS(gpio_dev, panel.backlight_pin, GPIO_PIN_OUTPUT); + GPIO_PIN_SET(gpio_dev, panel.backlight_pin, GPIO_PIN_HIGH); + + sc->sc_info.fb_width = panel.width; + sc->sc_info.fb_height = panel.height; sc->sc_info.fb_stride = sc->sc_info.fb_width * 3; sc->sc_info.fb_bpp = sc->sc_info.fb_depth = 24; sc->sc_info.fb_size = sc->sc_info.fb_height * sc->sc_info.fb_stride; Modified: head/sys/boot/fdt/dts/arm/vybrid-quartz.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/vybrid-quartz.dts Fri Mar 7 15:35:54 2014 (r262890) +++ head/sys/boot/fdt/dts/arm/vybrid-quartz.dts Fri Mar 7 16:14:51 2014 (r262891) @@ -60,6 +60,51 @@ edma1: edma@40098000 { status = "okay"; }; + + dcu0: dcu4@40058000 { + status = "okay"; + + panel-size = < 800 480 >; + panel-hsync = < 40 48 40 >; + panel-vsync = < 29 3 13 >; + panel-clk-div = < 17 >; + panel-backlight-pin = < 25 >; + + iomux_config = < 105 0x1001c4 /* hsync */ + 106 0x1001c4 /* vsync */ + 107 0x1001e0 /* pclk */ + 108 0x1001e0 + 109 0x1001be /* de */ + 110 0x1001e0 /* r0 */ + 111 0x1001e0 + 112 0x1001e0 + 113 0x1001e0 + 114 0x1001e0 + 115 0x1001e0 + 116 0x1001e0 + 117 0x1001e0 + 118 0x1001e0 /* g0 */ + 119 0x1001e0 + 120 0x1001e0 + 121 0x1001e0 + 122 0x1001e0 + 123 0x1001e0 + 124 0x1001e0 + 125 0x1001e0 + 126 0x1001e0 /* b0 */ + 127 0x1001e0 + 128 0x1001e0 + 129 0x1001e0 + 130 0x1001e0 + 131 0x1001e0 + 132 0x1001e0 + 133 0x1001e0 + 25 0x0001be >; /* led */ + }; + + tcon0: tcon@4003D000 { + status = "okay"; + }; }; chosen { From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 17:47:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40DE6FAD; Fri, 7 Mar 2014 17:47:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2D6C2AE2; Fri, 7 Mar 2014 17:47:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27HlsYX065337; Fri, 7 Mar 2014 17:47:54 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27HlsJ2065336; Fri, 7 Mar 2014 17:47:54 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403071747.s27HlsJ2065336@svn.freebsd.org> From: Eitan Adler Date: Fri, 7 Mar 2014 17:47:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262893 - head/tools/tools/iwn/iwnstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 17:47:54 -0000 Author: eadler Date: Fri Mar 7 17:47:53 2014 New Revision: 262893 URL: http://svnweb.freebsd.org/changeset/base/262893 Log: wlanstats: Add some logic to translate from a vap to its parent device. This isn't entirely correct (as the device may not necc. be called wlan*) but this will be further worked into a combined ath, iwn, wlan, etc. tool. Discussed with: jhb, adrian Modified: head/tools/tools/iwn/iwnstats/main.c Modified: head/tools/tools/iwn/iwnstats/main.c ============================================================================== --- head/tools/tools/iwn/iwnstats/main.c Fri Mar 7 16:43:08 2014 (r262892) +++ head/tools/tools/iwn/iwnstats/main.c Fri Mar 7 17:47:53 2014 (r262893) @@ -38,6 +38,8 @@ #include #include #include +#include +#include #include "net80211/ieee80211_ioctl.h" #include "net80211/ieee80211_radiotap.h" @@ -269,6 +271,9 @@ main(int argc, char *argv[]) int ch; char *ifname; bool first; + char *sysctlname; + size_t len; + int ret; ifname = strdup(IWN_DEFAULT_IF); @@ -280,6 +285,19 @@ main(int argc, char *argv[]) if (ifname) free(ifname); ifname = strdup(optarg); + if (strncmp(ifname, "wlan", 4) == 0) { + free(ifname); + len = 0; + asprintf(&sysctlname, "net.wlan.%s.%%parent", ifname + 4); + ret = sysctlbyname(sysctlname, NULL, &len, NULL, 0); + if (ret != 0) + err(1, "sysctl failed"); + ifname = calloc(len, 1); + ret = sysctlbyname(sysctlname, ifname, &len, NULL, 0); + if (ret != 0) + err(1, "sysctl failed"); + free(sysctlname); + } break; default: case '?': From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 19:30:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A8F8F9; Fri, 7 Mar 2014 19:30:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8773F5FF; Fri, 7 Mar 2014 19:30:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27JU4s0006898; Fri, 7 Mar 2014 19:30:04 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27JU4u1006894; Fri, 7 Mar 2014 19:30:04 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201403071930.s27JU4u1006894@svn.freebsd.org> From: Alan Somers Date: Fri, 7 Mar 2014 19:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262894 - head/tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 19:30:04 -0000 Author: asomers Date: Fri Mar 7 19:30:03 2014 New Revision: 262894 URL: http://svnweb.freebsd.org/changeset/base/262894 Log: kern/Makefile Set WARNS=5 for all files in this directory kern/unix_seqpacket_test.c Fix compiler warnings. Most were benign, but rcvbuf_oversized wasn't working as intended because I forgot to set the buffer sizes. MFC after: 2 weeks Reported by: pho Sponsored by: Spectra Logic Corporation Modified: head/tests/sys/kern/Makefile head/tests/sys/kern/unix_seqpacket_test.c Modified: head/tests/sys/kern/Makefile ============================================================================== --- head/tests/sys/kern/Makefile Fri Mar 7 17:47:53 2014 (r262893) +++ head/tests/sys/kern/Makefile Fri Mar 7 19:30:03 2014 (r262894) @@ -8,4 +8,6 @@ TEST_METADATA.unix_seqpacket_test+= time LDADD.unix_seqpacket_test+= -lpthread +WARNS?= 5 + .include Modified: head/tests/sys/kern/unix_seqpacket_test.c ============================================================================== --- head/tests/sys/kern/unix_seqpacket_test.c Fri Mar 7 17:47:53 2014 (r262893) +++ head/tests/sys/kern/unix_seqpacket_test.c Fri Mar 7 19:30:03 2014 (r262894) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #define MIN(x, y) ((x) < (y) ? (x) : (y)) #define MAX(x, y) ((x) > (y) ? (x) : (y)) -void +static void do_socketpair(int *sv) { int s; @@ -55,7 +55,7 @@ do_socketpair(int *sv) ATF_REQUIRE(sv[0] != sv[1]); } -void +static void do_socketpair_nonblocking(int *sv) { int s; @@ -73,7 +73,7 @@ do_socketpair_nonblocking(int *sv) * Returns a pair of sockets made the hard way: bind, listen, connect & accept * @return const char* The path to the socket */ -const char* +static const char* mk_pair_of_sockets(int *sv) { struct sockaddr_un sun; @@ -116,7 +116,7 @@ mk_pair_of_sockets(int *sv) static volatile sig_atomic_t got_sigpipe = 0; static void -shutdown_send_sigpipe_handler(int x) +shutdown_send_sigpipe_handler(int __unused x) { got_sigpipe = 1; } @@ -124,16 +124,16 @@ shutdown_send_sigpipe_handler(int x) /* * Parameterized test function bodies */ -void +static void test_eagain(size_t sndbufsize, size_t rcvbufsize) { int i; int sv[2]; const size_t totalsize = (sndbufsize + rcvbufsize) * 2; const size_t pktsize = MIN(sndbufsize, rcvbufsize) / 4; + const int numpkts = totalsize / pktsize; char sndbuf[pktsize]; - char recv_buf[pktsize]; - ssize_t ssize, rsize; + ssize_t ssize; /* setup the socket pair */ do_socketpair_nonblocking(sv); @@ -145,7 +145,7 @@ test_eagain(size_t sndbufsize, size_t rc bzero(sndbuf, pktsize); /* Send data until we get EAGAIN */ - for(i=0; i < totalsize / pktsize; i++) { + for(i=0; i < numpkts; i++) { ssize = send(sv[0], sndbuf, pktsize, MSG_EOR); if (ssize == -1) { if (errno == EAGAIN) @@ -159,11 +159,11 @@ test_eagain(size_t sndbufsize, size_t rc atf_tc_fail("Never got EAGAIN"); } -void +static void test_sendrecv_symmetric_buffers(size_t bufsize, int blocking) { int s; int sv[2]; - const size_t pktsize = bufsize / 2; + const ssize_t pktsize = bufsize / 2; char sndbuf[pktsize]; char recv_buf[pktsize]; ssize_t ssize, rsize; @@ -201,12 +201,12 @@ test_sendrecv_symmetric_buffers(size_t b pktsize, rsize); } -void +static void test_pipe_simulator(size_t sndbufsize, size_t rcvbufsize) { - int s, num_sent, num_received; + int num_sent, num_received; int sv[2]; - const size_t pktsize = MIN(sndbufsize, rcvbufsize) / 4; + const ssize_t pktsize = MIN(sndbufsize, rcvbufsize) / 4; int numpkts; char sndbuf[pktsize]; char rcvbuf[pktsize]; @@ -331,12 +331,11 @@ test_pipe_reader(void* args) } -void +static void test_pipe(size_t sndbufsize, size_t rcvbufsize) { test_pipe_thread_data_t writer_data, reader_data; pthread_t writer, reader; - int num_sent, num_received; int sv[2]; const size_t pktsize = MIN(sndbufsize, rcvbufsize) / 4; int numpkts; @@ -611,12 +610,11 @@ ATF_TC_BODY(resize_connected_buffers, tc ATF_TC_WITHOUT_HEAD(send_recv); ATF_TC_BODY(send_recv, tc) { - int s; int sv[2]; const int bufsize = 64; const char *data = "data"; char recv_buf[bufsize]; - size_t datalen; + ssize_t datalen; ssize_t ssize, rsize; /* setup the socket pair */ @@ -648,12 +646,11 @@ ATF_TC_BODY(sendto_recvfrom, tc) { const char* path; struct sockaddr_storage from; - int s; int sv[2]; const int bufsize = 64; const char *data = "data"; char recv_buf[bufsize]; - size_t datalen; + ssize_t datalen; ssize_t ssize, rsize; socklen_t fromlen; @@ -696,12 +693,11 @@ ATF_TC_BODY(sendto_recvfrom, tc) ATF_TC_WITHOUT_HEAD(send_recv_with_connect); ATF_TC_BODY(send_recv_with_connect, tc) { - const char* path; int sv[2]; const int bufsize = 64; const char *data = "data"; char recv_buf[bufsize]; - size_t datalen; + ssize_t datalen; ssize_t ssize, rsize; mk_pair_of_sockets(sv); @@ -757,12 +753,11 @@ ATF_TC_BODY(shutdown_send_sigpipe, tc) ATF_TC_WITHOUT_HEAD(send_recv_nonblocking); ATF_TC_BODY(send_recv_nonblocking, tc) { - int s; int sv[2]; const int bufsize = 64; const char *data = "data"; char recv_buf[bufsize]; - size_t datalen; + ssize_t datalen; ssize_t ssize, rsize; /* setup the socket pair */ @@ -794,14 +789,12 @@ ATF_TC_BODY(send_recv_nonblocking, tc) ATF_TC_WITHOUT_HEAD(emsgsize); ATF_TC_BODY(emsgsize, tc) { - int s; int sv[2]; const size_t sndbufsize = 8192; const size_t rcvbufsize = 8192; const size_t pktsize = (sndbufsize + rcvbufsize) * 2; char sndbuf[pktsize]; - char recv_buf[pktsize]; - ssize_t ssize, rsize; + ssize_t ssize; /* setup the socket pair */ do_socketpair(sv); @@ -823,14 +816,12 @@ ATF_TC_BODY(emsgsize, tc) ATF_TC_WITHOUT_HEAD(emsgsize_nonblocking); ATF_TC_BODY(emsgsize_nonblocking, tc) { - int s; int sv[2]; const size_t sndbufsize = 8192; const size_t rcvbufsize = 8192; const size_t pktsize = (sndbufsize + rcvbufsize) * 2; char sndbuf[pktsize]; - char recv_buf[pktsize]; - ssize_t ssize, rsize; + ssize_t ssize; /* setup the socket pair */ do_socketpair_nonblocking(sv); @@ -883,25 +874,29 @@ ATF_TC_BODY(eagain_128k_128k, tc) ATF_TC_WITHOUT_HEAD(rcvbuf_oversized); ATF_TC_BODY(rcvbuf_oversized, tc) { - int s, i, j; + int i; int sv[2]; + const int pktsize = 1024; const size_t sndbufsize = 8192; const size_t rcvbufsize = 131072; - const size_t geom_mean_bufsize = 32768; - const int pktsize = 1024; + const size_t geometric_mean_bufsize = 32768; + const int numpkts = geometric_mean_bufsize / pktsize; char sndbuf[pktsize]; char recv_buf[pktsize]; - size_t datalen; ssize_t ssize, rsize; /* setup the socket pair */ do_socketpair_nonblocking(sv); + ATF_REQUIRE_EQ(0, setsockopt(sv[0], SOL_SOCKET, SO_SNDBUF, &sndbufsize, + sizeof(sndbufsize))); + ATF_REQUIRE_EQ(0, setsockopt(sv[1], SOL_SOCKET, SO_RCVBUF, &rcvbufsize, + sizeof(rcvbufsize))); /* * Send and receive packets that are collectively greater than the send * buffer, but less than the receive buffer */ - for (i=0; i < geom_mean_bufsize / pktsize; i++) { + for (i=0; i < numpkts; i++) { /* Fill the buffer */ memset(sndbuf, i, pktsize); From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 20:13:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69B25952; Fri, 7 Mar 2014 20:13:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3EC11A00; Fri, 7 Mar 2014 20:13:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27KD0dG026229; Fri, 7 Mar 2014 20:13:00 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27KCxhX026221; Fri, 7 Mar 2014 20:12:59 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403072012.s27KCxhX026221@svn.freebsd.org> From: Devin Teske Date: Fri, 7 Mar 2014 20:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262895 - in head/usr.sbin/bsdconfig: . share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 20:13:00 -0000 Author: dteske Date: Fri Mar 7 20:12:59 2014 New Revision: 262895 URL: http://svnweb.freebsd.org/changeset/base/262895 Log: Allow dispatched reswords to carry arguments. Fix a comment while here. Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/share/script.subr Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Fri Mar 7 19:30:03 2014 (r262894) +++ head/usr.sbin/bsdconfig/bsdconfig Fri Mar 7 20:12:59 2014 (r262895) @@ -324,7 +324,7 @@ if [ "$pgm" != "bsdconfig" ]; then [ "$pgm" = "$resword" ] || continue # Found a match f_dprintf "pgm=[%s] A valid resWord!" "$pgm" - f_dispatch $resword + f_dispatch $resword $resword "$@" exit $? done fi Modified: head/usr.sbin/bsdconfig/share/script.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/script.subr Fri Mar 7 19:30:03 2014 (r262894) +++ head/usr.sbin/bsdconfig/share/script.subr Fri Mar 7 20:12:59 2014 (r262895) @@ -1,6 +1,6 @@ if [ ! "$_SCRIPT_SUBR" ]; then _SCRIPT_SUBR=1 # -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -50,25 +50,23 @@ RESWORDS= # Create a new `reserved' word for scripting purposes. Reswords call pre- # defined functions but differ from those functions in the following ways: # -# + Reswords do not take arguments but instead get all their data from -# the environment variable namespace. # + Unless noError is set (must be non-NULL), if calling the resword # results in failure, the application will terminate prematurely. # + noError is unset after each/every resword is called. # # Reswords should not be used in bsdconfig itself (hence the name `reserved -# word') but instead only in scripts loaded through f_script_load()). +# word') but instead only in scripts loaded through f_script_load(). # f_resword_new() { local resword="$1" func="$2" [ "$resword" ] || return $FAILURE f_dprintf "script.subr: New resWord %s -> %s" "$resword" "$func" - eval $resword\(\){ f_dispatch $func $resword\; } + eval $resword\(\){ f_dispatch $func $resword \"\$@\"\; } RESWORDS="$RESWORDS${RESWORDS:+ }$resword" } -# f_dispatch $func [$resword] +# f_dispatch $func $resword # # Wrapper function used by `reserved words' (reswords) to call other functions. # If $noError is set and non-NULL, a failure result from $func is ignored, @@ -78,9 +76,10 @@ f_resword_new() # f_dispatch() { - local func="$1" resword="${2:-$1}" + local func="$1" resword="$2" + shift 2 # func resword f_dprintf "f_dispatch: calling resword \`%s'" "$resword" - eval $func + eval $func "$@" local retval=$? if [ $retval -ne $SUCCESS ]; then local _ignore_this_error From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 20:15:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 769A6AA9; Fri, 7 Mar 2014 20:15:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 63830A11; Fri, 7 Mar 2014 20:15:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27KF9RK026554; Fri, 7 Mar 2014 20:15:09 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27KF9XQ026553; Fri, 7 Mar 2014 20:15:09 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403072015.s27KF9XQ026553@svn.freebsd.org> From: Devin Teske Date: Fri, 7 Mar 2014 20:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262896 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 20:15:09 -0000 Author: dteske Date: Fri Mar 7 20:15:08 2014 New Revision: 262896 URL: http://svnweb.freebsd.org/changeset/base/262896 Log: Add missing local declaration. Modified: head/usr.sbin/bsdconfig/share/common.subr Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Fri Mar 7 20:12:59 2014 (r262895) +++ head/usr.sbin/bsdconfig/share/common.subr Fri Mar 7 20:15:08 2014 (r262896) @@ -1,7 +1,7 @@ if [ ! "$_COMMON_SUBR" ]; then _COMMON_SUBR=1 # # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -153,7 +153,7 @@ f_debug_init() # Process stored command-line arguments # set -- $ARGV - local OPTIND + local OPTIND flag f_dprintf "f_debug_init: ARGV=[%s] GETOPTS_STDARGS=[%s]" \ "$ARGV" "$GETOPTS_STDARGS" while getopts "$GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS" flag \ From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 20:15:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57E9ABE0; Fri, 7 Mar 2014 20:15:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 44EE2A14; Fri, 7 Mar 2014 20:15:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27KFrYG026650; Fri, 7 Mar 2014 20:15:53 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27KFrwC026649; Fri, 7 Mar 2014 20:15:53 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403072015.s27KFrwC026649@svn.freebsd.org> From: Devin Teske Date: Fri, 7 Mar 2014 20:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262897 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 20:15:53 -0000 Author: dteske Date: Fri Mar 7 20:15:52 2014 New Revision: 262897 URL: http://svnweb.freebsd.org/changeset/base/262897 Log: Fix a typo in a comment. Modified: head/usr.sbin/bsdconfig/share/common.subr Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Fri Mar 7 20:15:08 2014 (r262896) +++ head/usr.sbin/bsdconfig/share/common.subr Fri Mar 7 20:15:52 2014 (r262897) @@ -523,7 +523,7 @@ f_include_lang() # f_usage $file "FOO" "BAR" # # Will cause instances of "@FOO@" appearing in $file to be replaced with the -# text "BAR" before bering printed to the screen. +# text "BAR" before being printed to the screen. # # This function is a two-parter. Below is the awk(1) portion of the function, # afterward is the sh(1) function which utilizes the below awk script. From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 20:18:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63C5DD5B; Fri, 7 Mar 2014 20:18:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 508D6A34; Fri, 7 Mar 2014 20:18:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27KIeHO026994; Fri, 7 Mar 2014 20:18:40 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27KIeOp026992; Fri, 7 Mar 2014 20:18:40 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403072018.s27KIeOp026992@svn.freebsd.org> From: Devin Teske Date: Fri, 7 Mar 2014 20:18:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262898 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 20:18:40 -0000 Author: dteske Date: Fri Mar 7 20:18:39 2014 New Revision: 262898 URL: http://svnweb.freebsd.org/changeset/base/262898 Log: Fix incorrect return status if var_to_set and var_to_get are the same. Modified: head/usr.sbin/bsdconfig/share/common.subr Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Fri Mar 7 20:15:52 2014 (r262897) +++ head/usr.sbin/bsdconfig/share/common.subr Fri Mar 7 20:18:39 2014 (r262898) @@ -270,9 +270,9 @@ f_getvar() { local __var_to_get="$1" __var_to_set="$2" [ "$__var_to_set" ] || local value - eval ${__var_to_set:-value}=\"\${$__var_to_get}\" eval [ \"\${$__var_to_get+set}\" ] local __retval=$? + eval ${__var_to_set:-value}=\"\${$__var_to_get}\" eval f_dprintf '"f_getvar: var=[%s] value=[%s] r=%u"' \ \"\$__var_to_get\" \"\$${__var_to_set:-value}\" \$__retval [ "$__var_to_set" ] || { [ "$value" ] && echo "$value"; } From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 20:20:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB3BAF8A; Fri, 7 Mar 2014 20:20:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C860BA4A; Fri, 7 Mar 2014 20:20:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27KKRBH027870; Fri, 7 Mar 2014 20:20:27 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27KKRfl027869; Fri, 7 Mar 2014 20:20:27 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403072020.s27KKRfl027869@svn.freebsd.org> From: Devin Teske Date: Fri, 7 Mar 2014 20:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262899 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 20:20:27 -0000 Author: dteske Date: Fri Mar 7 20:20:27 2014 New Revision: 262899 URL: http://svnweb.freebsd.org/changeset/base/262899 Log: Make f_show_err non-fatal. Modified: head/usr.sbin/bsdconfig/share/common.subr Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Fri Mar 7 20:18:39 2014 (r262898) +++ head/usr.sbin/bsdconfig/share/common.subr Fri Mar 7 20:20:27 2014 (r262899) @@ -368,13 +368,10 @@ f_show_msg() # f_show_err $format [$arguments ...] # # Display a message in a dialog box with ``Error'' i18n title (overridden by -# setting msg_error) using printf(1) syntax. If running non-interactively, -# the process will terminate (using [above] f_die()). +# setting msg_error) using printf(1) syntax. # f_show_err() { - [ "$nonInteractive" ] && f_die - local msg msg=$( printf "$@" ) From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 20:25:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1480A209; Fri, 7 Mar 2014 20:25:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0115EAE3; Fri, 7 Mar 2014 20:25:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27KOxYB030770; Fri, 7 Mar 2014 20:24:59 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27KOxCq030769; Fri, 7 Mar 2014 20:24:59 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403072024.s27KOxCq030769@svn.freebsd.org> From: Devin Teske Date: Fri, 7 Mar 2014 20:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262900 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 20:25:00 -0000 Author: dteske Date: Fri Mar 7 20:24:59 2014 New Revision: 262900 URL: http://svnweb.freebsd.org/changeset/base/262900 Log: Centralize function name. Update a comment while here. Modified: head/usr.sbin/bsdconfig/share/script.subr Modified: head/usr.sbin/bsdconfig/share/script.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/script.subr Fri Mar 7 20:20:27 2014 (r262899) +++ head/usr.sbin/bsdconfig/share/script.subr Fri Mar 7 20:24:59 2014 (r262900) @@ -95,7 +95,7 @@ f_dispatch() # Load a script (usually filled with reswords). If $file is missing or NULL, # use one of the following instead (in order): # -# $configFile +# $configFile (global) # install.cfg # /stand/install.fg # /tmp/install.cfg @@ -107,9 +107,10 @@ f_dispatch() # f_script_load() { + local funcname=f_script_load local script="$1" config_file retval=$SUCCESS - f_dprintf "f_script_load: script=[%s]" "$script" + f_dprintf "$funcname: script=[%s]" "$script" if [ ! "$script" ]; then f_getvar $VAR_CONFIG_FILE config_file for script in \ @@ -129,11 +130,11 @@ f_script_load() setvar $VAR_NONINTERACTIVE yes if [ "$script" = "-" ]; then - f_dprintf "f_script_load: Loading script from stdin" + f_dprintf "$funcname: Loading script from stdin" eval "$( cat )" retval=$? else - f_dprintf "f_script_load: Loading script \`%s'" "$script" + f_dprintf "$funcname: Loading script \`%s'" "$script" if [ ! -e "$script" ]; then f_show_msg "$msg_unable_to_open" "$script" return $FAILURE From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 20:29:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EF204A3; Fri, 7 Mar 2014 20:29:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 24230B23; Fri, 7 Mar 2014 20:29:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27KTKUG031406; Fri, 7 Mar 2014 20:29:20 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27KTKU2031405; Fri, 7 Mar 2014 20:29:20 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403072029.s27KTKU2031405@svn.freebsd.org> From: Devin Teske Date: Fri, 7 Mar 2014 20:29:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262901 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 20:29:20 -0000 Author: dteske Date: Fri Mar 7 20:29:19 2014 New Revision: 262901 URL: http://svnweb.freebsd.org/changeset/base/262901 Log: s/__number/__num/ for code clarify but more to prevent localization of __number if passed as the var_to_set argument. Modified: head/usr.sbin/bsdconfig/share/strings.subr Modified: head/usr.sbin/bsdconfig/share/strings.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/strings.subr Fri Mar 7 20:24:59 2014 (r262900) +++ head/usr.sbin/bsdconfig/share/strings.subr Fri Mar 7 20:29:19 2014 (r262901) @@ -34,6 +34,12 @@ BSDCFG_SHARE="/usr/share/bsdconfig" ############################################################ GLOBALS # +# A Literal newline (for use with f_replace_all(), or IFS, or whatever) +# +NL=" +" # END-QUOTE + +# # Valid characters that can appear in an sh(1) variable name # # Please note that the character ranges A-Z and a-z should be avoided because @@ -369,14 +375,16 @@ f_shell_unescape() f_expand_number() { local __string="$1" __var_to_set="$2" - local __cp __number __bshift __maxinput + local __cp __num __bshift __maxinput - # Remove any leading non-digits and store numbers (sans suffix) + # Remove any leading non-digits __string="${__string#${__string%%[0-9]*}}" - __number="${__string%%[!0-9]*}" + + # Store the numbers (no trailing suffix) + __num="${__string%%[!0-9]*}" # Produce `-1' if string didn't contain any digits - if [ ! "$__number" ]; then + if [ ! "$__num" ]; then if [ "$__var_to_set" ]; then setvar "$__var_to_set" -1 else @@ -386,7 +394,7 @@ f_expand_number() fi # Remove all the leading numbers from the string to get at the prefix - __string="${__string#"$__number"}" + __string="${__string#"$__num"}" # # Test for invalid prefix (and determine bitshift length) @@ -394,9 +402,9 @@ f_expand_number() case "$__string" in ""|[[:space:]]*) # Shortcut if [ "$__var_to_set" ]; then - setvar "$__var_to_set" $__number + setvar "$__var_to_set" $__num else - echo $__number + echo $__num fi return $SUCCESS ;; [Kk]*) __bshift=10 ;; @@ -417,7 +425,7 @@ f_expand_number() # Determine if the wheels fall off __maxinput=$(( 0x7fffffffffffffff >> $__bshift )) - if [ $__number -gt $__maxinput ]; then + if [ $__num -gt $__maxinput ]; then # Input (before expanding) would exceed 64-bit signed int if [ "$__var_to_set" ]; then setvar "$__var_to_set" -1 @@ -428,11 +436,11 @@ f_expand_number() fi # Shift the number out and produce it - __number=$(( $__number << $__bshift )) + __num=$(( $__num << $__bshift )) if [ "$__var_to_set" ]; then - setvar "$__var_to_set" $__number + setvar "$__var_to_set" $__num else - echo $__number + echo $__num fi } From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 20:32:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30ADD7B8; Fri, 7 Mar 2014 20:32:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1B95BBC6; Fri, 7 Mar 2014 20:32:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27KWQq0035164; Fri, 7 Mar 2014 20:32:26 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27KWQmE035163; Fri, 7 Mar 2014 20:32:26 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403072032.s27KWQmE035163@svn.freebsd.org> From: Devin Teske Date: Fri, 7 Mar 2014 20:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262902 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 20:32:27 -0000 Author: dteske Date: Fri Mar 7 20:32:26 2014 New Revision: 262902 URL: http://svnweb.freebsd.org/changeset/base/262902 Log: Comment -- to go with NL global introduced (but not mentioned) by r262901 Modified: head/usr.sbin/bsdconfig/share/strings.subr Modified: head/usr.sbin/bsdconfig/share/strings.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/strings.subr Fri Mar 7 20:29:19 2014 (r262901) +++ head/usr.sbin/bsdconfig/share/strings.subr Fri Mar 7 20:32:26 2014 (r262902) @@ -271,6 +271,9 @@ f_uridecode() # capturing in a sub-shell (which is less recommended due to performance # degradation). # +# To replace newlines or a sequence containing the newline character, use $NL +# as `\n' is not supported. +# f_replaceall() { local __left="" __right="$1" From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 20:32:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F0658F2; Fri, 7 Mar 2014 20:32:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E6291BCB; Fri, 7 Mar 2014 20:32:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27KWkQh035234; Fri, 7 Mar 2014 20:32:46 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27KWkr1035231; Fri, 7 Mar 2014 20:32:46 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403072032.s27KWkr1035231@svn.freebsd.org> From: Ian Lepore Date: Fri, 7 Mar 2014 20:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262903 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 20:32:47 -0000 Author: ian Date: Fri Mar 7 20:32:45 2014 New Revision: 262903 URL: http://svnweb.freebsd.org/changeset/base/262903 Log: Fix the arm sys_sigreturn(): its argument is a struct ucontext, not a struct sigframe containing the struct ucontext. The signal trampoline return code on the other hand DOES have just a struct sigframe on the stack to work with, so have it get a pointer to the ucontext out of there to pass along to sys_sigreturn. In other words, make everything work right whether sys_sigreturn is invoked from the trampoline or from userland code calling sigreturn(2). Submitted by: Takashi Komatsu Reviewed by: cognet Modified: head/sys/arm/arm/genassym.c head/sys/arm/arm/locore.S head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/genassym.c ============================================================================== --- head/sys/arm/arm/genassym.c Fri Mar 7 20:32:26 2014 (r262902) +++ head/sys/arm/arm/genassym.c Fri Mar 7 20:32:45 2014 (r262903) @@ -109,6 +109,8 @@ ASSYM(TF_PC, offsetof(struct trapframe, ASSYM(P_PID, offsetof(struct proc, p_pid)); ASSYM(P_FLAG, offsetof(struct proc, p_flag)); +ASSYM(SIGF_UC, offsetof(struct sigframe, sf_uc)); + #ifdef ARM_TP_ADDRESS ASSYM(ARM_TP_ADDRESS, ARM_TP_ADDRESS); ASSYM(ARM_RAS_START, ARM_RAS_START); Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Fri Mar 7 20:32:26 2014 (r262902) +++ head/sys/arm/arm/locore.S Fri Mar 7 20:32:45 2014 (r262903) @@ -557,6 +557,7 @@ END(abort) ENTRY_NP(sigcode) mov r0, sp + add r0, r0, #SIGF_UC /* * Call the sigreturn system call. Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Fri Mar 7 20:32:26 2014 (r262902) +++ head/sys/arm/arm/machdep.c Fri Mar 7 20:32:45 2014 (r262903) @@ -742,28 +742,26 @@ sys_sigreturn(td, uap) const struct __ucontext *sigcntxp; } */ *uap; { - struct sigframe sf; - struct trapframe *tf; + ucontext_t uc; int spsr; if (uap == NULL) return (EFAULT); - if (copyin(uap->sigcntxp, &sf, sizeof(sf))) + if (copyin(uap->sigcntxp, &uc, sizeof(uc))) return (EFAULT); /* * Make sure the processor mode has not been tampered with and * interrupts have not been disabled. */ - spsr = sf.sf_uc.uc_mcontext.__gregs[_REG_CPSR]; + spsr = uc.uc_mcontext.__gregs[_REG_CPSR]; if ((spsr & PSR_MODE) != PSR_USR32_MODE || (spsr & (I32_bit | F32_bit)) != 0) return (EINVAL); /* Restore register context. */ - tf = td->td_frame; - set_mcontext(td, &sf.sf_uc.uc_mcontext); + set_mcontext(td, &uc.uc_mcontext); /* Restore signal mask. */ - kern_sigprocmask(td, SIG_SETMASK, &sf.sf_uc.uc_sigmask, NULL, 0); + kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); return (EJUSTRETURN); } From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 20:44:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6120C298; Fri, 7 Mar 2014 20:44:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4C601CC5; Fri, 7 Mar 2014 20:44:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27KiMI2039720; Fri, 7 Mar 2014 20:44:22 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27KiKCb039707; Fri, 7 Mar 2014 20:44:20 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403072044.s27KiKCb039707@svn.freebsd.org> From: Devin Teske Date: Fri, 7 Mar 2014 20:44:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262904 - in head/usr.sbin/bsdconfig: share usermgmt usermgmt/include usermgmt/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 20:44:22 -0000 Author: dteske Date: Fri Mar 7 20:44:19 2014 New Revision: 262904 URL: http://svnweb.freebsd.org/changeset/base/262904 Log: Rewrite groupmgmt -- hooking it into the scripting system with dispatch commands groupAdd, groupDelete, and groupEdit. Getting rid of the awkward- to-use `groupinput' bolt-on which Ron and I talked about rewriting. Added: head/usr.sbin/bsdconfig/usermgmt/share/group.subr (contents, props changed) Deleted: head/usr.sbin/bsdconfig/usermgmt/groupinput Modified: head/usr.sbin/bsdconfig/share/script.subr head/usr.sbin/bsdconfig/share/variable.subr head/usr.sbin/bsdconfig/usermgmt/Makefile head/usr.sbin/bsdconfig/usermgmt/groupadd head/usr.sbin/bsdconfig/usermgmt/groupdel head/usr.sbin/bsdconfig/usermgmt/groupedit head/usr.sbin/bsdconfig/usermgmt/include/messages.subr head/usr.sbin/bsdconfig/usermgmt/share/Makefile head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Modified: head/usr.sbin/bsdconfig/share/script.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/script.subr Fri Mar 7 20:32:45 2014 (r262903) +++ head/usr.sbin/bsdconfig/share/script.subr Fri Mar 7 20:44:19 2014 (r262904) @@ -37,6 +37,7 @@ f_include $BSDCFG_SHARE/media/tcpip.subr f_include $BSDCFG_SHARE/mustberoot.subr f_include $BSDCFG_SHARE/networking/services.subr f_include $BSDCFG_SHARE/packages/packages.subr +f_include $BSDCFG_SHARE/usermgmt/group.subr f_include $BSDCFG_SHARE/variable.subr ############################################################ GLOBALS @@ -198,6 +199,11 @@ f_resword_new packageAdd f_package_add f_resword_new packageDelete f_package_delete f_resword_new packageReinstall f_package_reinstall +# usermgmt/group.subr +f_resword_new groupAdd f_group_add +f_resword_new groupDelete f_group_delete +f_resword_new groupEdit f_group_edit + # variable.subr f_resword_new installVarDefaults f_variable_set_defaults f_resword_new dumpVariables f_dump_variables Modified: head/usr.sbin/bsdconfig/share/variable.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/variable.subr Fri Mar 7 20:32:45 2014 (r262903) +++ head/usr.sbin/bsdconfig/share/variable.subr Fri Mar 7 20:44:19 2014 (r262904) @@ -1,6 +1,6 @@ if [ ! "$_VARIABLE_SUBR" ]; then _VARIABLE_SUBR=1 # -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -241,6 +241,10 @@ f_variable_new VAR_FTP_PORT ftpPort f_variable_new VAR_FTP_STATE ftpState f_variable_new VAR_FTP_USER ftpUser f_variable_new VAR_GATEWAY defaultrouter +f_variable_new VAR_GROUP group +f_variable_new VAR_GROUP_GID groupGid +f_variable_new VAR_GROUP_MEMBERS groupMembers +f_variable_new VAR_GROUP_PASSWORD groupPassword f_variable_new VAR_HOSTNAME hostname f_variable_new VAR_HTTP_DIR httpDirectory f_variable_new VAR_HTTP_FTP_MODE httpFtpMode Modified: head/usr.sbin/bsdconfig/usermgmt/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/Makefile Fri Mar 7 20:32:45 2014 (r262903) +++ head/usr.sbin/bsdconfig/usermgmt/Makefile Fri Mar 7 20:44:19 2014 (r262904) @@ -8,8 +8,8 @@ FILESDIR= ${LIBEXECDIR}/bsdconfig/070.us FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} -SCRIPTS= groupadd groupdel groupedit groupinput \ - useradd userdel useredit userinput usermgmt +SCRIPTS= groupadd groupdel groupedit useradd userdel useredit \ + userinput usermgmt beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Modified: head/usr.sbin/bsdconfig/usermgmt/groupadd ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/groupadd Fri Mar 7 20:32:45 2014 (r262903) +++ head/usr.sbin/bsdconfig/usermgmt/groupadd Fri Mar 7 20:44:19 2014 (r262904) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -33,8 +33,11 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." "$0" f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/usermgmt/group.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt" +f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ipgm && pgm="${ipgm:-$pgm}" @@ -55,9 +58,19 @@ done shift $(( $OPTIND - 1 )) # -# Chain-load to groupinput to centralize code and minimize duplication +# Initialize # -$BSDCFG_LIBE/$APP_DIR/groupinput ${USE_XDIALOG:+-X} mode="Add" +f_dialog_title "$msg_add $msg_group" +f_dialog_backtitle "${ipgm:+bsdconfig }$pgm" +f_mustberoot_init + +# +# Add a user +# +# NB: If given an argument on the command-line use it; otherwise fall-back to +# environment variable $group (handle $VAR_GROUP). +# +f_group_add ${1:+"$1"} ################################################################################ # END Modified: head/usr.sbin/bsdconfig/usermgmt/groupdel ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/groupdel Fri Mar 7 20:32:45 2014 (r262903) +++ head/usr.sbin/bsdconfig/usermgmt/groupdel Fri Mar 7 20:44:19 2014 (r262904) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -34,6 +34,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" f_dprintf "%s: loading includes..." "$0" f_include $BSDCFG_SHARE/dialog.subr f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/usermgmt/group.subr f_include $BSDCFG_SHARE/usermgmt/group_input.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt" @@ -67,7 +68,7 @@ f_mustberoot_init # # Loop until the user Exits, Cancels or presses ESC # -defaultitem="" +defaultitem= while :; do f_dialog_menu_group_list "$defaultitem" retval=$? @@ -81,8 +82,7 @@ while :; do # Anything else is a group name - $BSDCFG_LIBE/$APP_DIR/groupinput \ - ${USE_XDIALOG:+-X} mode="Delete" group="$mtag" + f_group_delete "$mtag" done exit $SUCCESS Modified: head/usr.sbin/bsdconfig/usermgmt/groupedit ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/groupedit Fri Mar 7 20:32:45 2014 (r262903) +++ head/usr.sbin/bsdconfig/usermgmt/groupedit Fri Mar 7 20:44:19 2014 (r262904) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -34,6 +34,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" f_dprintf "%s: loading includes..." "$0" f_include $BSDCFG_SHARE/dialog.subr f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/usermgmt/group.subr f_include $BSDCFG_SHARE/usermgmt/group_input.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt" @@ -65,9 +66,17 @@ f_dialog_backtitle "${ipgm:+bsdconfig }$ f_mustberoot_init # -# Loop until the user Exits, Cancels or presses ESC +# If given a group name, operate on it and exit # -defaultitem="" +if [ "$1" ]; then + f_group_edit "$1" + exit $SUCCESS +fi + +# +# Present a list of groups and loop until user Exits, Cancels or presses ESC +# +defaultitem= while :; do f_dialog_menu_group_list "$defaultitem" retval=$? @@ -81,8 +90,7 @@ while :; do # Anything else is a group name - $BSDCFG_LIBE/$APP_DIR/groupinput \ - ${USE_XDIALOG:+-X} mode="Edit/View" group="$mtag" + f_group_edit "$mtag" done exit $SUCCESS Modified: head/usr.sbin/bsdconfig/usermgmt/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/include/messages.subr Fri Mar 7 20:32:45 2014 (r262903) +++ head/usr.sbin/bsdconfig/usermgmt/include/messages.subr Fri Mar 7 20:44:19 2014 (r262904) @@ -1,5 +1,5 @@ # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -90,6 +90,7 @@ msg_login_updated="Login Updated" msg_member_of_groups="Member of Groups" msg_n_a="N/A" msg_no="No" +msg_no_group_specified="No group specified!" msg_number_of_seconds_since_epoch="Number of seconds since the Epoch\n(1 = %s)\nNULL or zero to disable:" msg_ok="OK" msg_password="Password" @@ -97,6 +98,7 @@ msg_password_does_not_expire="Password d msg_password_expires_in_how_many_days="Password expires in how many days?" msg_password_expires_on="Password Expires on" msg_passwords_do_not_match="Passwords do not match." +msg_please_enter_a_group_name="Please enter a group name!" msg_reenter_group_password="Re-enter Group Password" msg_reenter_password="Re-enter Password" msg_save="Save" Modified: head/usr.sbin/bsdconfig/usermgmt/share/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/Makefile Fri Mar 7 20:32:45 2014 (r262903) +++ head/usr.sbin/bsdconfig/usermgmt/share/Makefile Fri Mar 7 20:44:19 2014 (r262904) @@ -3,7 +3,7 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/bsdconfig/usermgmt -FILES= group_input.subr user_input.subr +FILES= group.subr group_input.subr user_input.subr beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Added: head/usr.sbin/bsdconfig/usermgmt/share/group.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/usermgmt/share/group.subr Fri Mar 7 20:44:19 2014 (r262904) @@ -0,0 +1,484 @@ +if [ ! "$_USERMGMT_GROUP_SUBR" ]; then _USERMGMT_GROUP_SUBR=1 +# +# Copyright (c) 2012 Ron McDowell +# Copyright (c) 2012-2014 Devin Teske +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." usermgmt/group.subr +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/usermgmt/group_input.subr + +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt" +f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr + +############################################################ CONFIGURATION + +# set some reasonable defaults if /etc/adduser.conf does not exist. +[ -f /etc/adduser.conf ] && f_include /etc/adduser.conf +: ${passwdtype:="yes"} + +############################################################ FUNCTIONS + +# f_group_add [$group] +# +# Add a group. If both $group (as a first argument) and $VAR_GROUP are unset +# or NULL and we are running interactively, prompt the user to enter the name +# of a new group and (if $VAR_NO_CONFIRM is unset or NULL) prompt the user to +# answer some questions about the new group. Variables that can be used to +# script user input: +# +# VAR_GROUP [Optional if running interactively] +# The group to add. Ignored if given non-NULL first-argument. +# VAR_GROUP_GID [Optional] +# Numerical group ID to use. If NULL or unset, the group ID is +# automatically chosen. +# VAR_GROUP_MEMBERS [Optional] +# Comma separated list of users that are a member of this group. +# VAR_GROUP_PASSWORD [Optional] +# newgrp(1) password to set for the group. Default if NULL or +# unset is to disable newgrp(1) password authentication. +# +# Returns success if the group was successfully added. +# +f_group_add() +{ + local funcname=f_group_add + local title # Calculated below + local alert=f_show_msg no_confirm= + + f_getvar $VAR_NO_CONFIRM no_confirm + [ "$no_confirm" ] && alert=f_show_info + + local input + f_getvar 3:-\$$VAR_GROUP input "$1" + + # + # NB: pw(8) has a ``feature'' wherein `-n name' can be taken as GID + # instead of name. Work-around is to also pass `-g GID' at the same + # time (any GID will do; but `-1' is appropriate for this context). + # + if [ "$input" ] && f_quietly pw groupshow -n "$input" -g -1; then + f_show_err "$msg_group_already_used" "$input" + return $FAILURE + fi + + local group_name="$input" + while f_interactive && [ ! "$group_name" ]; do + f_dialog_input_group_name group_name "$group_name" || + return $SUCCESS + [ "$group_name" ] || + f_show_err "$msg_please_enter_a_group_name" + done + + local group_password group_gid group_members + f_getvar $VAR_GROUP_PASSWORD group_password + f_getvar $VAR_GROUP_GID group_gid + f_getvar $VAR_GROUP_MEMBERS group_members + + local group_password_disable= + f_interactive || [ "$group_password" ] || group_password_disable=1 + + if f_interactive && [ ! "$no_confirm" ]; then + f_dialog_noyes \ + "$msg_use_default_values_for_all_account_details" + retval=$? + if [ $retval -eq $DIALOG_ESC ]; then + return $SUCCESS + elif [ $retval -ne $DIALOG_OK ]; then + # + # Ask series of questions to pre-fill the editor screen + # + # Defaults used in each dialog should allow the user to + # simply hit ENTER to proceed and cancelling a single + # dialog cause them to return to the previous menu. + # + + if [ "$passwdtype" = "yes" ]; then + f_dialog_input_group_password group_password \ + group_password_disable || + return $FAILURE + fi + f_dialog_input_group_gid group_gid "$group_gid" || + return $FAILURE + f_dialog_input_group_members group_members \ + "$group_members" || return $FAILURE + fi + fi + + # + # Loop until the user decides to Exit, Cancel, or presses ESC + # + title="$msg_add $msg_group: $group_name" + if f_interactive; then + local mtag retval defaultitem= + while :; do + f_dialog_title "$title" + f_dialog_menu_group_add "$defaultitem" + retval=$? + f_dialog_title_restore + f_dialog_menutag_fetch mtag + f_dprintf "retval=%u mtag=[%s]" $retval "$mtag" + defaultitem="$mtag" + + # Return if user either pressed ESC or chose Cancel/No + [ $retval -eq $DIALOG_OK ] || return $FAILURE + + case "$mtag" in + X) # Add/Exit + local cmd="pw groupadd -n '$group_name'" + [ "$group_gid" ] && cmd="$cmd -g '$group_gid'" + [ "$group_members" ] && + cmd="$cmd -M '$group_members'" + + # Execute the command (break on success) + if [ "$group_password_disable" ]; then + f_eval_catch $funcname pw '%s -h -' "$cmd" + elif [ "$group_password" ]; then + echo "$group_password" | + f_eval_catch $funcname \ + pw '%s -h 0' "$cmd" + else + f_eval_catch $funcname pw '%s' "$cmd" + fi && break + ;; + 1) # Group Name (prompt for new group name) + f_dialog_input_group_name input "$group_name" || + continue + if f_quietly pw groupshow -n "$input" -g -1; then + f_show_err "$msg_group_already_used" "$input" + continue + fi + group_name="$input" + title="$msg_add $msg_group: $group_name" + ;; + 2) # Password + f_dialog_input_group_password group_password \ + group_password_disable + ;; + 3) # Group ID + f_dialog_input_group_gid group_gid "$group_gid" + ;; + 4) # Group Members + f_dialog_input_group_members group_members \ + "$group_members" + ;; + esac + done + else + # Form the command + local cmd="pw groupadd -n '$group_name'" + [ "$group_gid" ] && cmd="$cmd -g '$group_gid'" + [ "$group_members" ] && cmd="$cmd -M '$group_members'" + + # Execute the command + local retval err + if [ "$group_password_disable" ]; then + f_eval_catch -k err $funcname pw '%s -h -' "$cmd" + elif [ "$group_password" ]; then + echo "$group_password" | f_eval_catch -k err \ + $funcname pw '%s -h 0' "$cmd" + else + f_eval_catch -k err $funcname pw '%s' "$cmd" + fi + retval=$? + if [ $retval -ne $SUCCESS ]; then + f_show_err "%s" "$err" + return $retval + fi + fi + + f_dialog_title "$title" + $alert "$msg_group_added" + f_dialog_title_restore + [ "$no_confirm" -a "$USE_DIALOG" ] && sleep 2 + + return $SUCCESS +} + +# f_group_delete [$group] +# +# Delete a group. If both $group (as a first argument) and $VAR_GROUP are unset +# or NULL and we are running interactively, prompt the user to select a group +# from a list of available groups. Variables that can be used to script user +# input: +# +# VAR_GROUP [Optional if running interactively] +# The group to delete. Ignored if given non-NULL first-argument. +# +# Returns success if the group was successfully deleted. +# +f_group_delete() +{ + local funcname=f_group_delete + local title # Calculated below + local alert=f_show_msg no_confirm= + + f_getvar $VAR_NO_CONFIRM no_confirm + [ "$no_confirm" ] && alert=f_show_info + + local input + f_getvar 3:-\$$VAR_GROUP input "$1" + + local group_name group_password group_gid group_members + if [ "$input" ] && ! f_input_group "$input"; then + f_show_err "$msg_group_not_found" "$input" + return $FAILURE + fi + + # + # Loop until the user decides to Exit, Cancel, or presses ESC + # + title="$msg_delete $msg_group: $group_name" + if f_interactive; then + local mtag retval defaultitem= + while :; do + f_dialog_title "$title" + f_dialog_menu_group_delete "$group_name" "$defaultitem" + retval=$? + f_dialog_title_restore + f_dialog_menutag_fetch mtag + f_dprintf "retval=%u mtag=[%s]" $retval "$mtag" + defaultitem="$mtag" + + # Return if user either pressed ESC or chose Cancel/No + [ $retval -eq $DIALOG_OK ] || return $FAILURE + + case "$mtag" in + X) # Delete/Exit + f_eval_catch $funcname pw 'pw groupdel "%s"' \ + "$group_name" && break + ;; + 1) # Group Name (select different group from list) + f_dialog_menu_group_list "$group_name" || continue + f_dialog_menutag_fetch mtag + + [ "$mtag" = "X $msg_exit" ] && continue + + if ! f_input_group "$mtag"; then + f_show_err "$msg_group_not_found" "$mtag" + # Attempt to fall back to previous selection + f_input_group "$input" || return $FAILURE + else + input="$mtag" + fi + ;; + esac + done + else + local retval err + f_eval_catch -k err $funcname pw \ + 'pw groupdel "%s"' "$group_name" + retval=$? + if [ $retval -ne $SUCCESS ]; then + f_show_err "%s" "$err" + return $retval + fi + fi + + f_dialog_title "$title" + $alert "$msg_group_deleted" + f_dialog_title_restore + [ "$no_confirm" -a "$USE_DIALOG" ] && sleep 2 + + return $SUCCESS +} + +# f_group_edit [$group] +# +# Modify a group. If both $group (as a first argument) and $VAR_GROUP are unset +# or NULL and we are running interactively, prompt the user to select a group +# from a list of available groups. Variables that can be used to script user +# input: +# +# VAR_GROUP [Optional if running interactively] +# The group to modify. Ignored if given non-NULL first-argument. +# VAR_GROUP_GID [Optional] +# Numerical group ID to set. If NULL or unset, the group ID is +# unchanged. +# VAR_GROUP_MEMBERS [Optional] +# Comma separated list of users that are a member of this group. +# If NULL or unset, group membership is unmodified. +# VAR_GROUP_PASSWORD [Optional] +# newgrp(1) password to set for the group. If unset, the password +# is unmodified. If NULL, the newgrp(1) password is disabled. +# +# Returns success if the group was successfully modified. +# +f_group_edit() +{ + local funcname=f_group_edit + local title # Calculated below + local alert=f_show_msg no_confirm= + + f_getvar $VAR_NO_CONFIRM no_confirm + [ "$no_confirm" ] && alert=f_show_info + + local input + f_getvar 3:-\$$VAR_GROUP input "$1" + + # + # NB: pw(8) has a ``feature'' wherein `-n name' can be taken as GID + # instead of name. Work-around is to also pass `-g GID' at the same + # time (any GID will do; but `-1' is appropriate for this context). + # + if [ "$input" ] && ! f_quietly pw groupshow -n "$input" -g -1; then + f_show_err "$msg_group_not_found" "$input" + return $FAILURE + fi + + if f_interactive && [ ! "$input" ]; then + f_dialog_menu_group_list || return $SUCCESS + f_dialog_menutag_fetch input + [ "$input" = "X $msg_exit" ] && return $SUCCESS + elif [ ! "$input" ]; then + f_show_err "$msg_no_group_specified" + return $FAILURE + fi + + local group_name group_password group_gid group_members + if ! f_input_group "$input"; then + f_show_err "$msg_group_not_found" "$input" + return $FAILURE + fi + + f_isset $VAR_GROUP_GID && f_getvar $VAR_GROUP_GID group_gid + local null_members= + if f_isset $VAR_GROUP_MEMBERS; then + f_getvar $VAR_GROUP_MEMBERS group_members + [ "$group_members" ] || null_members=1 + fi + local group_password_disable= + if f_isset $VAR_GROUP_PASSWORD; then + f_getvar $VAR_GROUP_PASSWORD group_password + [ "$group_password" ] || group_password_disable=1 + fi + + # + # Loop until the user decides to Exit, Cancel, or presses ESC + # + title="$msg_edit_view $msg_group: $group_name" + if f_interactive; then + local mtag retval defaultitem= + while :; do + f_dialog_title "$title" + f_dialog_menu_group_edit "$defaultitem" + retval=$? + f_dialog_title_restore + f_dialog_menutag_fetch mtag + f_dprintf "retval=%u mtag=[%s]" $retval "$mtag" + defaultitem="$mtag" + + # Return if user either pressed ESC or chose Cancel/No + [ $retval -eq $DIALOG_OK ] || return $FAILURE + + case "$mtag" in + X) # Save/Exit + local cmd="pw groupmod -n '$group_name'" + [ "$group_gid" ] && cmd="$cmd -g '$group_gid'" + [ "$group_members" -o "$null_members" ] && + cmd="$cmd -M '$group_members'" + + # Execute the command (break on success) + if [ "$group_password_disable" ]; then + f_eval_catch $funcname pw '%s -h -' "$cmd" + elif [ "$group_password" ]; then + echo "$group_password" | + f_eval_catch $funcname \ + pw '%s -h 0' "$cmd" + else + f_eval_catch $funcname pw '%s' "$cmd" + fi && break + ;; + 1) # Group Name (select different group from list) + f_dialog_menu_group_list "$group_name" || continue + f_dialog_menutag_fetch mtag + + [ "$mtag" = "X $msg_exit" ] && continue + + if ! f_input_group "$mtag"; then + f_show_err "$msg_group_not_found" "$mtag" + # Attempt to fall back to prevoius selection + f_input_group "$input" || return $FAILURE + else + input="$mtag" + fi + title="$msg_edit_view $msg_group: $group_name" + ;; + 2) # Password + f_dialog_input_group_password group_password \ + group_password_disable + ;; + 3) # Group ID + f_dialog_input_group_gid group_gid "$group_gid" + ;; + 4) # Group Members + f_dialog_input_group_members group_members \ + "$group_members" && [ ! "$group_members" ] && + null_members=1 + ;; + esac + done + else + # Form the command + local cmd="pw groupmod -n '$group_name'" + [ "$group_gid" ] && cmd="$cmd -g '$group_gid'" + [ "$group_members" -o "$null_members" ] && + cmd="$cmd -M '$group_members'" + + # Execute the command + local retval err + if [ "$group_password_disable" ]; then + f_eval_catch -k err $funcname pw '%s -h -' "$cmd" + elif [ "$group_password" -o "$null_password" ]; then + echo "$group_password" | f_eval_catch -k err \ + $funcname pw '%s -h 0' "$cmd" + else + f_eval_catch -k err $funcname pw '%s' "$cmd" + fi + retval=$? + if [ $retval -ne $SUCCESS ]; then + f_show_err "%s" "$err" + return $retval + fi + fi + + f_dialog_title "$title" + $alert "$msg_group_updated" + f_dialog_title_restore + [ "$no_confirm" -a "$USE_DIALOG" ] && sleep 2 + + return $SUCCESS +} + +############################################################ MAIN + +f_dprintf "%s: Successfully loaded." usermgmt/group.subr + +fi # ! $_USERMGMT_GROUP_SUBR Modified: head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Fri Mar 7 20:32:45 2014 (r262903) +++ head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Fri Mar 7 20:44:19 2014 (r262904) @@ -1,7 +1,7 @@ if [ ! "$_USERMGMT_GROUP_INPUT_SUBR" ]; then _USERMGMT_GROUP_INPUT_SUBR=1 # # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -48,14 +48,20 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc # f_input_group() { - eval $( pw groupshow "$1" | awk -F: ' + local funcname=f_input_group + local group="$1" + + f_dprintf "$funcname: Getting info for group \`%s'" "$group" + eval "$( pw groupshow "$group" 2> /dev/null | awk -F: ' { + found = $1 != "" printf "group_name='\'%s\''\n", $1 printf "group_password=\n" printf "group_gid='\'%s\''\n", $3 printf "group_members='\'%s\''\n", $4 exit - }' ) + } + END { if (!found) print "false" }' )" } # f_dialog_menu_group_list [$default] @@ -105,300 +111,457 @@ f_dialog_menu_group_list() return $retval } -# f_dialog_input_group_name [$group_name] +# f_dialog_input_group_name $var_to_set [$group_name] # -# Allows the user to enter a new groupname for a given group. If the user does -# not cancel or press ESC, the $group_name variable will hold the -# newly-configured value upon return. -# -# If $cur_group_name is defined, the user can enter that and by-pass error- -# checking (allowing the user to "revert" to an old value without, for example, -# being told that the groupname already exists). +# Allows the user to enter a name for a new group. If the user does not cancel +# or press ESC, the $var_to_set variable will hold the newly-configured value +# upon return. # f_dialog_input_group_name() { + local __var_to_set="$1" __name="$2" + # # Loop until the user provides taint-free/valid input # - local _name="$1" _input="$1" + local __input="$__name" while :; do - # Return if user has either pressed ESC or chosen Cancel/No - f_dialog_input _input "$msg_group" "$_input" \ + f_dialog_input __input "$msg_group" "$__input" \ "$hline_alnum_tab_enter" || return $? # Check for no-change - [ "$_input" = "$_name" ] && return $DIALOG_OK - - # Check for reversion - if [ "$_input" = "$cur_group_name" ]; then - group_name="$cur_group_name" + if [ "$__input" = "$__name" ]; then + setvar "$__var_to_set" "$__input" return $DIALOG_OK fi # Check for NULL entry - if [ ! "$_input" ]; then + if [ ! "$__input" ]; then f_show_msg "$msg_group_is_empty" continue fi # Check for invalid entry - if ! echo "$_input" | grep -q "^[[:alpha:]]"; then + case "$__input" in [!a-zA-Z]*) f_show_msg "$msg_group_must_start_with_letter" continue - fi + esac # Check for duplicate entry - if f_quietly pw groupshow -n "$_input"; then - f_show_msg "$msg_group_already_used" "$_input" + if f_quietly pw groupshow -n "$__input"; then + f_show_msg "$msg_group_already_used" "$__input" continue fi - group_name="$_input" + setvar "$__var_to_set" "$__input" break done save_flag=1 - f_dprintf "group_name: [%s]->[%s]" "$cur_group_name" "$group_name" - return $DIALOG_OK } -# f_dialog_input_group_password +# f_dialog_input_group_password $var_to_set $dvar_to_set # -# Prompt the user to enter a password (twice). +# Prompt the user to enter a password (twice). If the user does not cancel or +# press ESC, $var_to_set will hold the confirmed user entry. Otherwise, if the +# user cancels or enters a NULL password (twice), they are given the choice to +# disable password authentication for the given group, wherein $dvar_to_set has +# a value of 1 to indicate password authentication should be disabled. # f_dialog_input_group_password() { - local prompt1="$msg_group_password" - local prompt2="$msg_reenter_group_password" - local hline="$hline_alnum_punc_tab_enter" + local __var_to_set="$1" __dvar_to_set="$2" + local __prompt1="$msg_group_password" + local __prompt2="$msg_reenter_group_password" + local __hline="$hline_alnum_punc_tab_enter" - local height1 width1 - f_dialog_inputbox_size height1 width1 \ + local __height1 __width1 + f_dialog_inputbox_size __height1 __width1 \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ - "$prompt1" \ + "$__prompt1" \ "" \ - "$hline" + "$__hline" - local height2 width2 - f_dialog_inputbox_size height2 width2 \ + local __height2 __width2 + f_dialog_inputbox_size __height2 __width2 \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ - "$prompt2" \ + "$__prompt2" \ "" \ - "$hline" + "$__hline" # # Loop until the user provides taint-free/valid input # - local retval _password1 _password2 + local __retval __password1 __password2 while :; do - _password1=$( $DIALOG \ + __password1=$( $DIALOG \ --title "$DIALOG_TITLE" \ --backtitle "$DIALOG_BACKTITLE" \ - --hline "$hline" \ + --hline "$__hline" \ --ok-label "$msg_ok" \ --cancel-label "$msg_cancel" \ --insecure \ - --passwordbox "$prompt1" \ - $height1 $width1 \ + --passwordbox "$__prompt1" \ + $__height1 $__width1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) - retval=$? - debug= f_dialog_line_sanitize _password1 + __retval=$? + debug= f_dialog_line_sanitize __password1 # Return if user has either pressed ESC or chosen Cancel/No - [ $retval -eq $DIALOG_OK ] || return $retval + [ $__retval -eq $DIALOG_OK ] || return $__retval - _password2=$( $DIALOG \ + __password2=$( $DIALOG \ --title "$DIALOG_TITLE" \ --backtitle "$DIALOG_BACKTITLE" \ - --hline "$hline" \ + --hline "$__hline" \ --ok-label "$msg_ok" \ --cancel-label "$msg_cancel" \ --insecure \ - --passwordbox "$prompt2" \ - $height2 $width2 \ + --passwordbox "$__prompt2" \ + $__height2 $__width2 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) - retval=$? - debug= f_dialog_line_sanitize _password2 + __retval=$? + debug= f_dialog_line_sanitize __password2 # Return if user has either pressed ESC or chosen Cancel/No - [ $retval -eq $DIALOG_OK ] || return $retval + [ $__retval -eq $DIALOG_OK ] || return $__retval # Check for password mismatch - if [ "$_password1" != "$_password2" ]; then + if [ "$__password1" != "$__password2" ]; then f_show_msg "$msg_group_passwords_do_not_match" continue fi # Check for NULL entry - if [ ! "$_password1" ]; then + if [ ! "$__password1" ]; then f_dialog_yesno "$msg_disable_password_auth_for_group" - local retval=$? - if [ $retval -eq $DIALOG_ESC ]; then - return $retval - elif [ $retval -eq $DIALOG_OK ]; then - pw_group_password_disable=1 + __retval=$? + if [ $__retval -eq $DIALOG_ESC ]; then + return $__retval + elif [ $__retval -eq $DIALOG_OK ]; then + setvar "$__dvar_to_set" 1 else continue # back to password prompt fi else - pw_group_password_disable= + setvar "$__dvar_to_set" "" fi - group_password="$_password1" + setvar "$__var_to_set" "$__password1" break done save_flag=1 - f_dprintf "group_password: [%s]->[%s]" \ - "$cur_group_password" "$group_password" - return $DIALOG_OK } -# f_dialog_input_group_gid [$group_gid] +# f_dialog_input_group_gid $var_to_set [$group_gid] # # Allow the user to enter a new GID for a given group. If the user does not -# cancel or press ESC, the $group_gid variable will hold the newly-configured +# cancel or press ESC, the $var_to_set variable will hold the newly-configured # value upon return. # f_dialog_input_group_gid() { - local _input="$1" + local __var_to_set="$1" __input="$2" # Return if user has either pressed ESC or chosen Cancel/No - f_dialog_input _input "$msg_group_id_leave_empty_for_default" \ - "$_input" "$hline_num_tab_enter" || return $? + f_dialog_input __input "$msg_group_id_leave_empty_for_default" \ + "$__input" "$hline_num_tab_enter" || return $? - group_gid="$_input" + setvar "$__var_to_set" "$__input" save_flag=1 - f_dprintf "group_gid: [%s]->[%s]" "$cur_group_gid" "$group_gid" - return $DIALOG_OK } -# f_dialog_input_group_members [$group_members] +# f_dialog_input_group_members $var_to_set [$group_members] # # Allow the user to modify a list of members for a given group. If the user -# does not cancel or press ESC, the $group_members variable will hold the -# newly-configured value upon return. +# does not cancel or press ESC, the $var_to_set variable will hold the newly- +# configured value upon return. # *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 21:37:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CED9EAB; Fri, 7 Mar 2014 21:37:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 28E01145; Fri, 7 Mar 2014 21:37:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27Lb0v5060549; Fri, 7 Mar 2014 21:37:00 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27LaoG0060483; Fri, 7 Mar 2014 21:36:50 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403072136.s27LaoG0060483@svn.freebsd.org> From: Ian Lepore Date: Fri, 7 Mar 2014 21:36:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262905 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 21:37:00 -0000 Author: ian Date: Fri Mar 7 21:36:49 2014 New Revision: 262905 URL: http://svnweb.freebsd.org/changeset/base/262905 Log: Strip arm/conf/DEFAULTS down to just items that are mandatory for running the architecture. Move the other contents into each of the individual config files. Requested by: imp Modified: head/sys/arm/conf/AC100 head/sys/arm/conf/ARMADAXP head/sys/arm/conf/ARNDALE head/sys/arm/conf/ATMEL head/sys/arm/conf/AVILA head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/BWCT head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/CRB head/sys/arm/conf/CUBIEBOARD head/sys/arm/conf/CUBIEBOARD2 head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DEFAULTS head/sys/arm/conf/DIGI-CCWMX53 head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/DREAMPLUG-1001 head/sys/arm/conf/EA3250 head/sys/arm/conf/EB9200 head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/EP80219 head/sys/arm/conf/ETHERNUT5 head/sys/arm/conf/GUMSTIX head/sys/arm/conf/HL200 head/sys/arm/conf/HL201 head/sys/arm/conf/IMX53-QSB head/sys/arm/conf/IMX6 head/sys/arm/conf/IQ31244 head/sys/arm/conf/KB920X head/sys/arm/conf/LN2410SBC head/sys/arm/conf/NSLU head/sys/arm/conf/PANDABOARD head/sys/arm/conf/QILA9G20 head/sys/arm/conf/RADXA head/sys/arm/conf/RPI-B head/sys/arm/conf/SAM9260EK head/sys/arm/conf/SAM9G20EK head/sys/arm/conf/SAM9X25EK head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/SIMICS head/sys/arm/conf/SN9G45 head/sys/arm/conf/TS7800 head/sys/arm/conf/VERSATILEPB head/sys/arm/conf/VYBRID.common head/sys/arm/conf/ZEDBOARD Modified: head/sys/arm/conf/AC100 ============================================================================== --- head/sys/arm/conf/AC100 Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/AC100 Fri Mar 7 21:36:49 2014 (r262905) @@ -25,6 +25,9 @@ options FFS #Berkeley Fast Filesystem #options BOOTP_NFSV3 #options BOOTP_WIRED_TO=mge0 +options TMPFS #Efficient memory filesystem +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme options GEOM_PART_GPT options ROOTDEVNAME=\"ufs:/dev/da0p1\" Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/ARMADAXP Fri Mar 7 21:36:49 2014 (r262905) @@ -26,6 +26,9 @@ options BOOTP_NFSROOT options BOOTP_NFSV3 options BOOTP_WIRED_TO=mge0 +options TMPFS #Efficient memory filesystem +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme options GEOM_PART_GPT options ROOTDEVNAME=\"ufs:/dev/da0p1\" Modified: head/sys/arm/conf/ARNDALE ============================================================================== --- head/sys/arm/conf/ARNDALE Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/ARNDALE Fri Mar 7 21:36:49 2014 (r262905) @@ -31,6 +31,9 @@ options HZ=100 ## options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options FFS #Berkeley Fast Filesystem options SOFTUPDATES options UFS_ACL #Support for access control lists Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/ATMEL Fri Mar 7 21:36:49 2014 (r262905) @@ -48,10 +48,13 @@ options NFSCL # New Network Filesyste options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL +options TMPFS #Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization options COMPAT_FREEBSD5 # Compatible with FreeBSD5 Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/AVILA Fri Mar 7 21:36:49 2014 (r262905) @@ -47,6 +47,9 @@ options INVARIANT_SUPPORT #Extra sanity options SCHED_4BSD #4BSD scheduler options INET #InterNETworking +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options NFSCL #New Network Filesystem Client Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/BEAGLEBONE Fri Mar 7 21:36:49 2014 (r262905) @@ -34,6 +34,9 @@ options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/BWCT ============================================================================== --- head/sys/arm/conf/BWCT Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/BWCT Fri Mar 7 21:36:49 2014 (r262905) @@ -51,6 +51,9 @@ options NFS_ROOT #NFS usable as /, req options BOOTP_NFSROOT options BOOTP +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/CAMBRIA Fri Mar 7 21:36:49 2014 (r262905) @@ -48,6 +48,9 @@ options INVARIANT_SUPPORT #Extra sanity options SCHED_4BSD #4BSD scheduler #options PREEMPTION options INET #InterNETworking +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options NFSCL #New Network Filesystem Client Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/CNS11XXNAS Fri Mar 7 21:36:49 2014 (r262905) @@ -53,6 +53,8 @@ options DDB #Enable the kernel debugg options SCHED_ULE #ULE scheduler #options SCHED_4BSD #4BSD scheduler +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme options GEOM_PART_GPT # GUID Partition Tables. #options GEOM_PART_EBR #options GEOM_PART_EBR_COMPAT @@ -69,6 +71,7 @@ options NFSCL #New Network Filesystem #options NFSD #New Network Filesystem Server #options NFSLOCKD #Network Lock Manager options NFS_ROOT #NFS usable as /, requires NFSCL +options TMPFS #Efficient memory filesystem options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/CRB ============================================================================== --- head/sys/arm/conf/CRB Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/CRB Fri Mar 7 21:36:49 2014 (r262905) @@ -45,6 +45,9 @@ options NFSD #New Network Filesystem options NFSLOCKD #Network Lock Manager options NFS_ROOT #NFS usable as /, requires NFSCL #options MSDOSFS #MSDOS Filesystem +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) options PSEUDOFS #Pseudo-filesystem framework Modified: head/sys/arm/conf/CUBIEBOARD ============================================================================== --- head/sys/arm/conf/CUBIEBOARD Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/CUBIEBOARD Fri Mar 7 21:36:49 2014 (r262905) @@ -29,6 +29,9 @@ options HZ=100 options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists Modified: head/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- head/sys/arm/conf/CUBIEBOARD2 Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/CUBIEBOARD2 Fri Mar 7 21:36:49 2014 (r262905) @@ -29,6 +29,9 @@ options HZ=100 options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/DB-78XXX Fri Mar 7 21:36:49 2014 (r262905) @@ -16,6 +16,9 @@ makeoptions WERROR="-Werror" options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options FFS #Berkeley Fast Filesystem options NANDFS #NAND Filesystem options NFSCL #New Network Filesystem Client Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/DB-88F5XXX Fri Mar 7 21:36:49 2014 (r262905) @@ -16,6 +16,9 @@ makeoptions WERROR="-Werror" options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options FFS #Berkeley Fast Filesystem options NFSCL #New Network Filesystem Client options NFSLOCKD #Network Lock Manager Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/DB-88F6XXX Fri Mar 7 21:36:49 2014 (r262905) @@ -16,6 +16,9 @@ makeoptions WERROR="-Werror" options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options FFS #Berkeley Fast Filesystem options NANDFS #NAND Filesystem options NFSCL #New Network Filesystem Client Modified: head/sys/arm/conf/DEFAULTS ============================================================================== --- head/sys/arm/conf/DEFAULTS Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/DEFAULTS Fri Mar 7 21:36:49 2014 (r262905) @@ -5,8 +5,3 @@ device mem -options GEOM_PART_BSD -options GEOM_PART_MBR - -options TMPFS - Modified: head/sys/arm/conf/DIGI-CCWMX53 ============================================================================== --- head/sys/arm/conf/DIGI-CCWMX53 Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/DIGI-CCWMX53 Fri Mar 7 21:36:49 2014 (r262905) @@ -41,10 +41,13 @@ options NFSCL # New Network Filesyste #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL +options TMPFS #Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization #options COMPAT_FREEBSD5 # Compatible with FreeBSD5 Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/DOCKSTAR Fri Mar 7 21:36:49 2014 (r262905) @@ -34,12 +34,15 @@ options INET6 #IPv6 communications pr options SOFTUPDATES options CD9660 #ISO 9660 filesystem options FFS #Berkeley Fast Filesystem +options TMPFS #Efficient memory filesystem options MSDOSFS #MS DOS File System (FAT, FAT32) options NULLFS #NULL filesystem options SYSVSHM #SYSV-style shared memory options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme options GEOM_ELI # Disk encryption. options GEOM_LABEL # Providers labelization. options GEOM_PART_GPT # GPT partitioning Modified: head/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- head/sys/arm/conf/DREAMPLUG-1001 Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/DREAMPLUG-1001 Fri Mar 7 21:36:49 2014 (r262905) @@ -35,6 +35,7 @@ options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols options SOFTUPDATES +options TMPFS #Efficient memory filesystem options CD9660 #ISO 9660 filesystem options FFS #Berkeley Fast Filesystem options MSDOSFS #MS DOS File System (FAT, FAT32) @@ -43,6 +44,8 @@ options SYSVSHM #SYSV-style shared me options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme options GEOM_ELI # Disk encryption. options GEOM_LABEL # Providers labelization. options GEOM_PART_GPT # GPT partitioning Modified: head/sys/arm/conf/EA3250 ============================================================================== --- head/sys/arm/conf/EA3250 Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/EA3250 Fri Mar 7 21:36:49 2014 (r262905) @@ -20,6 +20,9 @@ options FFS #Berkeley Fast Filesystem options NFSCL #Network Filesystem Client options NFSLOCKD #Network Lock Manager options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options MSDOSFS options BOOTP options BOOTP_NFSROOT Modified: head/sys/arm/conf/EB9200 ============================================================================== --- head/sys/arm/conf/EB9200 Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/EB9200 Fri Mar 7 21:36:49 2014 (r262905) @@ -41,6 +41,9 @@ options NFS_ROOT #NFS usable as /, req options BOOTP_NFSROOT options BOOTP +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/EFIKA_MX Fri Mar 7 21:36:49 2014 (r262905) @@ -41,10 +41,13 @@ options NFSCL # New Network Filesyste #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL +options TMPFS #Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization #options COMPAT_FREEBSD5 # Compatible with FreeBSD5 Modified: head/sys/arm/conf/EP80219 ============================================================================== --- head/sys/arm/conf/EP80219 Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/EP80219 Fri Mar 7 21:36:49 2014 (r262905) @@ -43,6 +43,7 @@ options NFSCL #New Network Filesystem options NFSD #New Network Filesystem Server options NFSLOCKD #Network Lock Manager options NFS_ROOT #NFS usable as /, requires NFSCL +options TMPFS #Efficient memory filesystem #options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) @@ -54,6 +55,8 @@ options SYSVMSG #SYSV-style message q options SYSVSEM #SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Providers labelization. Modified: head/sys/arm/conf/ETHERNUT5 ============================================================================== --- head/sys/arm/conf/ETHERNUT5 Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/ETHERNUT5 Fri Mar 7 21:36:49 2014 (r262905) @@ -41,6 +41,9 @@ options NFSCL # New Network Filesyste #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/GUMSTIX ============================================================================== --- head/sys/arm/conf/GUMSTIX Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/GUMSTIX Fri Mar 7 21:36:49 2014 (r262905) @@ -47,6 +47,9 @@ options UFS_DIRHASH #Improve performan options NFSCL #New Network Filesystem Client #options NFSD #New Network Filesystem Server options NFS_ROOT #NFS usable as /, requires NFSCL +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/HL200 ============================================================================== --- head/sys/arm/conf/HL200 Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/HL200 Fri Mar 7 21:36:49 2014 (r262905) @@ -49,6 +49,9 @@ options BOOTP_NFSV3 options BOOTP_WIRED_TO=ate0 options BOOTP_COMPAT +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/HL201 ============================================================================== --- head/sys/arm/conf/HL201 Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/HL201 Fri Mar 7 21:36:49 2014 (r262905) @@ -52,6 +52,9 @@ options NFS_ROOT #NFS usable as /, req options ALT_BREAK_TO_DEBUGGER +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/IMX53-QSB ============================================================================== --- head/sys/arm/conf/IMX53-QSB Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/IMX53-QSB Fri Mar 7 21:36:49 2014 (r262905) @@ -40,10 +40,13 @@ options NFSCL # New Network Filesyste #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL +options TMPFS #Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization #options COMPAT_FREEBSD5 # Compatible with FreeBSD5 Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/IMX6 Fri Mar 7 21:36:49 2014 (r262905) @@ -36,10 +36,13 @@ options NFSCL # New Network Filesyst #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL +options TMPFS #Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization options KTRACE # ktrace(1) support Modified: head/sys/arm/conf/IQ31244 ============================================================================== --- head/sys/arm/conf/IQ31244 Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/IQ31244 Fri Mar 7 21:36:49 2014 (r262905) @@ -44,6 +44,9 @@ options NFSCL #New Network Filesystem options NFSD #New Network Filesystem Server options NFSLOCKD #Network Lock Manager options NFS_ROOT #NFS usable as /, requires NFSCL +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem #options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/KB920X Fri Mar 7 21:36:49 2014 (r262905) @@ -47,6 +47,9 @@ options NFSCL #New Network Filesystem #options BOOTP_NFSROOT #options BOOTP +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/LN2410SBC ============================================================================== --- head/sys/arm/conf/LN2410SBC Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/LN2410SBC Fri Mar 7 21:36:49 2014 (r262905) @@ -47,6 +47,9 @@ options ROOTDEVNAME=\"ufs:da0s1\" #options NFSCL #New Network Filesystem Client #options NFS_ROOT #NFS usable as root device +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options PSEUDOFS #Pseudo-filesystem framework #options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI options KTRACE #ktrace(1) support Modified: head/sys/arm/conf/NSLU ============================================================================== --- head/sys/arm/conf/NSLU Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/NSLU Fri Mar 7 21:36:49 2014 (r262905) @@ -61,6 +61,9 @@ options NFSCL #New Network Filesystem options NFSD #New Network Filesystem Server options NFSLOCKD #Network Lock Manager options NFS_ROOT #NFS usable as /, requires NFSCL +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem #options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/PANDABOARD Fri Mar 7 21:36:49 2014 (r262905) @@ -54,6 +54,9 @@ options NFS_ROOT #NFS usable as /, req #options BOOTP #options BOOTP_NFSV3 #options BOOTP_WIRED_TO=ue0 +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/QILA9G20 ============================================================================== --- head/sys/arm/conf/QILA9G20 Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/QILA9G20 Fri Mar 7 21:36:49 2014 (r262905) @@ -53,6 +53,9 @@ options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1 options ALT_BREAK_TO_DEBUGGER +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/RADXA ============================================================================== --- head/sys/arm/conf/RADXA Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/RADXA Fri Mar 7 21:36:49 2014 (r262905) @@ -33,6 +33,9 @@ options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/RPI-B Fri Mar 7 21:36:49 2014 (r262905) @@ -32,6 +32,9 @@ options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options MSDOSFS #MSDOS Filesystem device snp Modified: head/sys/arm/conf/SAM9260EK ============================================================================== --- head/sys/arm/conf/SAM9260EK Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/SAM9260EK Fri Mar 7 21:36:49 2014 (r262905) @@ -42,10 +42,13 @@ options NFSCL # New Network Filesyste #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL +options TMPFS #Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) #options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme #options GEOM_PART_GPT # GUID Partition Tables. #options GEOM_LABEL # Provides labelization #options COMPAT_FREEBSD5 # Compatible with FreeBSD5 Modified: head/sys/arm/conf/SAM9G20EK ============================================================================== --- head/sys/arm/conf/SAM9G20EK Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/SAM9G20EK Fri Mar 7 21:36:49 2014 (r262905) @@ -32,6 +32,9 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking #options INET6 #IPv6 communications protocols +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options FFS #Berkeley Fast Filesystem #options SOFTUPDATES #Enable FFS soft updates support #options UFS_ACL #Support for access control lists Modified: head/sys/arm/conf/SAM9X25EK ============================================================================== --- head/sys/arm/conf/SAM9X25EK Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/SAM9X25EK Fri Mar 7 21:36:49 2014 (r262905) @@ -33,6 +33,9 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking #options INET6 #IPv6 communications protocols +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options FFS #Berkeley Fast Filesystem #options SOFTUPDATES #Enable FFS soft updates support #options UFS_ACL #Support for access control lists Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/SHEEVAPLUG Fri Mar 7 21:36:49 2014 (r262905) @@ -16,6 +16,9 @@ makeoptions WERROR="-Werror" options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options FFS #Berkeley Fast Filesystem options NANDFS #NAND Filesystem options NFSCL #New Network Filesystem Client Modified: head/sys/arm/conf/SIMICS ============================================================================== --- head/sys/arm/conf/SIMICS Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/SIMICS Fri Mar 7 21:36:49 2014 (r262905) @@ -43,6 +43,9 @@ options NFSCL #New Network Filesystem options NFSD #New Network Filesystem Server options NFSLOCKD #Network Lock Manager options NFS_ROOT #NFS usable as /, requires NFSCL +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem #options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/SN9G45 ============================================================================== --- head/sys/arm/conf/SN9G45 Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/SN9G45 Fri Mar 7 21:36:49 2014 (r262905) @@ -52,6 +52,9 @@ options ROOTDEVNAME=\"ufs:/dev/da0s1\" options ALT_BREAK_TO_DEBUGGER +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/TS7800 ============================================================================== --- head/sys/arm/conf/TS7800 Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/TS7800 Fri Mar 7 21:36:49 2014 (r262905) @@ -26,6 +26,10 @@ options BOOTP_NFSROOT options BOOTP_NFSV3 options BOOTP_WIRED_TO=mge0 +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem + options SYSVSHM #SYSV-style shared memory options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores Modified: head/sys/arm/conf/VERSATILEPB ============================================================================== --- head/sys/arm/conf/VERSATILEPB Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/VERSATILEPB Fri Mar 7 21:36:49 2014 (r262905) @@ -43,6 +43,9 @@ options UFS_ACL #Support for access c options UFS_DIRHASH #Improve performance on big directories device snp +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options PSEUDOFS #Pseudo-filesystem framework options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI Modified: head/sys/arm/conf/VYBRID.common ============================================================================== --- head/sys/arm/conf/VYBRID.common Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/VYBRID.common Fri Mar 7 21:36:49 2014 (r262905) @@ -33,6 +33,9 @@ options FFS #Berkeley Fast Filesystem options SOFTUPDATES options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem options PROCFS #Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Fri Mar 7 20:44:19 2014 (r262904) +++ head/sys/arm/conf/ZEDBOARD Fri Mar 7 21:36:49 2014 (r262905) @@ -41,6 +41,9 @@ options NFSCL #Network Filesystem Cli # options BOOTP_NFSROOT # options BOOTP +options GEOM_PART_BSD #BSD partition scheme +options GEOM_PART_MBR #MBR partition scheme +options TMPFS #Efficient memory filesystem options MSDOSFS #MSDOS Filesystem options CD9660 #ISO 9660 Filesystem options PROCFS #Process filesystem (requires PSEUDOFS) From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 22:17:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DB249D0; Fri, 7 Mar 2014 22:17:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A8A864F; Fri, 7 Mar 2014 22:17:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27MHZFq077333; Fri, 7 Mar 2014 22:17:35 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27MHZj8077332; Fri, 7 Mar 2014 22:17:35 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403072217.s27MHZj8077332@svn.freebsd.org> From: Devin Teske Date: Fri, 7 Mar 2014 22:17:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262908 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 22:17:35 -0000 Author: dteske Date: Fri Mar 7 22:17:35 2014 New Revision: 262908 URL: http://svnweb.freebsd.org/changeset/base/262908 Log: Change dipatch words from group* to *Group to backward compatible with ye-olden sysinstall(8). Modified: head/usr.sbin/bsdconfig/share/script.subr Modified: head/usr.sbin/bsdconfig/share/script.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/script.subr Fri Mar 7 22:14:39 2014 (r262907) +++ head/usr.sbin/bsdconfig/share/script.subr Fri Mar 7 22:17:35 2014 (r262908) @@ -200,9 +200,9 @@ f_resword_new packageDelete f_package_de f_resword_new packageReinstall f_package_reinstall # usermgmt/group.subr -f_resword_new groupAdd f_group_add -f_resword_new groupDelete f_group_delete -f_resword_new groupEdit f_group_edit +f_resword_new addGroup f_group_add +f_resword_new deleteGroup f_group_delete +f_resword_new editGroup f_group_edit # variable.subr f_resword_new installVarDefaults f_variable_set_defaults From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 22:24:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07235BEE; Fri, 7 Mar 2014 22:24:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E803575C; Fri, 7 Mar 2014 22:24:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27MOrdq081025; Fri, 7 Mar 2014 22:24:53 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27MOrEc081024; Fri, 7 Mar 2014 22:24:53 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403072224.s27MOrEc081024@svn.freebsd.org> From: Devin Teske Date: Fri, 7 Mar 2014 22:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262909 - head/usr.sbin/bsdconfig/usermgmt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 22:24:54 -0000 Author: dteske Date: Fri Mar 7 22:24:53 2014 New Revision: 262909 URL: http://svnweb.freebsd.org/changeset/base/262909 Log: Fix copy/paste error in a comment. Modified: head/usr.sbin/bsdconfig/usermgmt/groupadd Modified: head/usr.sbin/bsdconfig/usermgmt/groupadd ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/groupadd Fri Mar 7 22:17:35 2014 (r262908) +++ head/usr.sbin/bsdconfig/usermgmt/groupadd Fri Mar 7 22:24:53 2014 (r262909) @@ -65,7 +65,7 @@ f_dialog_backtitle "${ipgm:+bsdconfig }$ f_mustberoot_init # -# Add a user +# Add a group # # NB: If given an argument on the command-line use it; otherwise fall-back to # environment variable $group (handle $VAR_GROUP). From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 22:29:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0608ED4C; Fri, 7 Mar 2014 22:29:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E76DE771; Fri, 7 Mar 2014 22:29:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27MT0l7081495; Fri, 7 Mar 2014 22:29:00 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27MT0dF081494; Fri, 7 Mar 2014 22:29:00 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403072229.s27MT0dF081494@svn.freebsd.org> From: Devin Teske Date: Fri, 7 Mar 2014 22:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262910 - head/usr.sbin/bsdconfig/usermgmt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 22:29:01 -0000 Author: dteske Date: Fri Mar 7 22:29:00 2014 New Revision: 262910 URL: http://svnweb.freebsd.org/changeset/base/262910 Log: Take a group name on the command-line if available. Modified: head/usr.sbin/bsdconfig/usermgmt/groupdel Modified: head/usr.sbin/bsdconfig/usermgmt/groupdel ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/groupdel Fri Mar 7 22:24:53 2014 (r262909) +++ head/usr.sbin/bsdconfig/usermgmt/groupdel Fri Mar 7 22:29:00 2014 (r262910) @@ -66,6 +66,14 @@ f_dialog_backtitle "${ipgm:+bsdconfig }$ f_mustberoot_init # +# If given a group name, operate on it and exit +# +if [ "$1" ]; then + f_group_delete "$1" + exit $SUCCESS +fi + +# # Loop until the user Exits, Cancels or presses ESC # defaultitem= From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 23:01:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F1D19AA; Fri, 7 Mar 2014 23:01:25 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 986F4A0C; Fri, 7 Mar 2014 23:01:24 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s27Mw0CY085916 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 8 Mar 2014 02:58:00 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s27Mw0om085915; Sat, 8 Mar 2014 02:58:00 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 8 Mar 2014 02:58:00 +0400 From: Gleb Smirnoff To: Alan Somers Subject: Re: svn commit: r262867 - in head: sys/kern sys/sys tests/sys/kern Message-ID: <20140307225800.GG80022@FreeBSD.org> References: <201403062024.s26KOFcI085288@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201403062024.s26KOFcI085288@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 23:01:25 -0000 Alan, On Thu, Mar 06, 2014 at 08:24:15PM +0000, Alan Somers wrote: A> Author: asomers A> Date: Thu Mar 6 20:24:15 2014 A> New Revision: 262867 A> URL: http://svnweb.freebsd.org/changeset/base/262867 A> A> Log: A> Fix PR kern/185813 "SOCK_SEQPACKET AF_UNIX sockets with asymmetrical A> buffers drop packets". It was caused by a check for the space available A> in a sockbuf, but it was checking the wrong sockbuf. A> A> sys/sys/sockbuf.h A> sys/kern/uipc_sockbuf.c A> Add sbappendaddr_nospacecheck_locked(), which is just like A> sbappendaddr_locked but doesn't validate the receiving socket's A> space. Factor out common code into sbappendaddr_locked_internal(). A> We shouldn't simply make sbappendaddr_locked check the space and A> then call sbappendaddr_nospacecheck_locked, because that would cause A> the O(n) function m_length to be called twice. A> A> sys/kern/uipc_usrreq.c A> Use sbappendaddr_nospacecheck_locked for SOCK_SEQPACKET sockets, A> because the receiving sockbuf's size limit is irrelevant. A> A> tests/sys/kern/unix_seqpacket_test.c A> Now that 185813 is fixed, pipe_128k_8k fails intermittently due to A> 185812. Make it fail every time by adding a usleep after starting A> the writer thread and before starting the reader thread in A> test_pipe. That gives the writer time to fill up its send buffer. A> Also, clear the expected failure message due to 185813. It actually A> said "185812", but that was a typo. Can you please look at 181741? Seems very much related. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 23:01:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A25F4AE3; Fri, 7 Mar 2014 23:01:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8D175A12; Fri, 7 Mar 2014 23:01:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27N1ZER096727; Fri, 7 Mar 2014 23:01:35 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27N1ZF3096726; Fri, 7 Mar 2014 23:01:35 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201403072301.s27N1ZF3096726@svn.freebsd.org> From: Alan Somers Date: Fri, 7 Mar 2014 23:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262912 - head/cddl/contrib/opensolaris/lib/libuutil/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 23:01:35 -0000 Author: asomers Date: Fri Mar 7 23:01:35 2014 New Revision: 262912 URL: http://svnweb.freebsd.org/changeset/base/262912 Log: cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c Fix a memory leak in uu_avl_pool_create: pthread_mutex_init without a corresponding pthread_mutex_destroy. It shows up, among other places, when doing "zfs list". MFC after: 3 weeks Sponsored by: Spectra Logic Corporation Modified: head/cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c Modified: head/cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c Fri Mar 7 22:53:29 2014 (r262911) +++ head/cddl/contrib/opensolaris/lib/libuutil/common/uu_avl.c Fri Mar 7 23:01:35 2014 (r262912) @@ -128,6 +128,7 @@ uu_avl_pool_destroy(uu_avl_pool_t *pp) pp->uap_next->uap_prev = pp->uap_prev; pp->uap_prev->uap_next = pp->uap_next; (void) pthread_mutex_unlock(&uu_apool_list_lock); + (void) pthread_mutex_destroy(&pp->uap_lock); pp->uap_prev = NULL; pp->uap_next = NULL; uu_free(pp); From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 23:08:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6707DDB; Fri, 7 Mar 2014 23:08:53 +0000 (UTC) Received: from mail-we0-x22d.google.com (mail-we0-x22d.google.com [IPv6:2a00:1450:400c:c03::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A627DADB; Fri, 7 Mar 2014 23:08:52 +0000 (UTC) Received: by mail-we0-f173.google.com with SMTP id w61so5919593wes.18 for ; Fri, 07 Mar 2014 15:08:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=QK/8PIO9Mpi+XvduIeulBrXgdZJkIKhhRxxJ4NTGhtg=; b=Yy6+F2O6d4sy/FFhNQnUwhxQLTLXUlvMozvJRufoiiQARoExIoEGyS3WWSoiaR7RHq 8q5izw0n3sNPeRhJFrbgYi6WqxpfF+Q5Woyd4iqrYsDuehaIcVfYaiSUISTw0caPRa1b ExjjtmzSLStDyf9S6WDb6mr2jesDqZbCbmT2+kOU/J9BiU0G3ryhTzizTaJOjV+pbm/J mN29X1duBEmaf8Iv3ITOPmNHqWvuYHGh0NVyTlRu3QKxjCNiY/lX1iOhmVznTnzlmVWa RpnfnJXcUgG7uzaDldxCWe/4lTol1Ckm9PBh/5jNE5PMTE3QqTDYULGw/3ZDCZbSXPNV QGkA== MIME-Version: 1.0 X-Received: by 10.180.97.37 with SMTP id dx5mr640855wib.53.1394233731200; Fri, 07 Mar 2014 15:08:51 -0800 (PST) Sender: asomers@gmail.com Received: by 10.194.168.197 with HTTP; Fri, 7 Mar 2014 15:08:51 -0800 (PST) In-Reply-To: <20140307225800.GG80022@FreeBSD.org> References: <201403062024.s26KOFcI085288@svn.freebsd.org> <20140307225800.GG80022@FreeBSD.org> Date: Fri, 7 Mar 2014 16:08:51 -0700 X-Google-Sender-Auth: DkpTaOkfCD5GsQm8PH_fbE5YoR4 Message-ID: Subject: Re: svn commit: r262867 - in head: sys/kern sys/sys tests/sys/kern From: Alan Somers To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Alan Somers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 23:08:53 -0000 On Fri, Mar 7, 2014 at 3:58 PM, Gleb Smirnoff wrote: > Alan, > > On Thu, Mar 06, 2014 at 08:24:15PM +0000, Alan Somers wrote: > A> Author: asomers > A> Date: Thu Mar 6 20:24:15 2014 > A> New Revision: 262867 > A> URL: http://svnweb.freebsd.org/changeset/base/262867 > A> > A> Log: > A> Fix PR kern/185813 "SOCK_SEQPACKET AF_UNIX sockets with asymmetrical > A> buffers drop packets". It was caused by a check for the space available > A> in a sockbuf, but it was checking the wrong sockbuf. > A> > A> sys/sys/sockbuf.h > A> sys/kern/uipc_sockbuf.c > A> Add sbappendaddr_nospacecheck_locked(), which is just like > A> sbappendaddr_locked but doesn't validate the receiving socket's > A> space. Factor out common code into sbappendaddr_locked_internal(). > A> We shouldn't simply make sbappendaddr_locked check the space and > A> then call sbappendaddr_nospacecheck_locked, because that would cause > A> the O(n) function m_length to be called twice. > A> > A> sys/kern/uipc_usrreq.c > A> Use sbappendaddr_nospacecheck_locked for SOCK_SEQPACKET sockets, > A> because the receiving sockbuf's size limit is irrelevant. > A> > A> tests/sys/kern/unix_seqpacket_test.c > A> Now that 185813 is fixed, pipe_128k_8k fails intermittently due to > A> 185812. Make it fail every time by adding a usleep after starting > A> the writer thread and before starting the reader thread in > A> test_pipe. That gives the writer time to fill up its send buffer. > A> Also, clear the expected failure message due to 185813. It actually > A> said "185812", but that was a typo. > > Can you please look at 181741? Seems very much related. > > -- > Totus tuus, Glebius. Yes, it's related. The difference is that 181741 deals with sbappendcontrol_locked, but 185813 deals with sbappendaddr_locked. Similar functions that both had the same problem. Also, see my comments in the bug tracker for 181741. -alan From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 23:30:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A857C7B6; Fri, 7 Mar 2014 23:30:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 883FBC63; Fri, 7 Mar 2014 23:30:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27NUnMx008060; Fri, 7 Mar 2014 23:30:49 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27NUmO5008051; Fri, 7 Mar 2014 23:30:48 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201403072330.s27NUmO5008051@svn.freebsd.org> From: Alan Somers Date: Fri, 7 Mar 2014 23:30:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262914 - in head: sbin/devd sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 23:30:49 -0000 Author: asomers Date: Fri Mar 7 23:30:48 2014 New Revision: 262914 URL: http://svnweb.freebsd.org/changeset/base/262914 Log: sbin/devd/devd.8 sbin/devd/devd.cc Add a -q flag to devd that will suppress syslog logging at LOG_NOTICE or below. Requested by: ian@ and imp@ MFC after: 3 weeks Sponsored by: Spectra Logic Corporation Modified: head/sbin/devd/devd.8 head/sbin/devd/devd.cc head/sys/kern/uipc_usrreq.c head/sys/sys/sockbuf.h head/sys/sys/unpcb.h Modified: head/sbin/devd/devd.8 ============================================================================== --- head/sbin/devd/devd.8 Fri Mar 7 23:26:14 2014 (r262913) +++ head/sbin/devd/devd.8 Fri Mar 7 23:30:48 2014 (r262914) @@ -33,7 +33,7 @@ .Nd "device state change daemon" .Sh SYNOPSIS .Nm -.Op Fl dn +.Op Fl dnq .Op Fl f Ar file .Op Fl l Ar num .Sh DESCRIPTION @@ -63,6 +63,8 @@ The default connection limit is 10. .It Fl n Do not process all pending events before becoming a daemon. Instead, call daemon right away. +.It Fl q +Quiet mode. Only log messages at priority LOG_WARNING or above. .El .Sh IMPLEMENTATION NOTES The Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Fri Mar 7 23:26:14 2014 (r262913) +++ head/sbin/devd/devd.cc Fri Mar 7 23:30:48 2014 (r262914) @@ -129,8 +129,9 @@ static const char detach = '-'; static struct pidfh *pfh; -int dflag; -int nflag; +static int no_daemon = 0; +static int daemonize_quick = 0; +static int quiet_mode = 0; static unsigned total_events = 0; static volatile sig_atomic_t got_siginfo = 0; static volatile sig_atomic_t romeo_must_die = 0; @@ -291,7 +292,7 @@ match::do_match(config &c) * can consume excessive amounts of systime inside of connect(). Only * log when we're in -d mode. */ - if (dflag) { + if (no_daemon) { devdlog(LOG_DEBUG, "Testing %s=%s against %s, invert=%d\n", _var.c_str(), value.c_str(), _re.c_str(), _inv); } @@ -401,7 +402,7 @@ var_list::set_variable(const string &var * can consume excessive amounts of systime inside of connect(). Only * log when we're in -d mode. */ - if (dflag) + if (no_daemon) devdlog(LOG_DEBUG, "setting %s=%s\n", var.c_str(), val.c_str()); _vars[var] = val; } @@ -945,7 +946,7 @@ event_loop(void) accepting = 1; max_fd = max(fd, server_fd) + 1; while (!romeo_must_die) { - if (!once && !dflag && !nflag) { + if (!once && !no_daemon && !daemonize_quick) { // Check to see if we have any events pending. tv.tv_sec = 0; tv.tv_usec = 0; @@ -1139,9 +1140,9 @@ devdlog(int priority, const char* fmt, . va_list argp; va_start(argp, fmt); - if (dflag) + if (no_daemon) vfprintf(stderr, fmt, argp); - else + else if ((! quiet_mode) || (priority <= LOG_WARNING)) vsyslog(priority, fmt, argp); va_end(argp); } @@ -1149,7 +1150,7 @@ devdlog(int priority, const char* fmt, . static void usage() { - fprintf(stderr, "usage: %s [-dn] [-l connlimit] [-f file]\n", + fprintf(stderr, "usage: %s [-dnq] [-l connlimit] [-f file]\n", getprogname()); exit(1); } @@ -1179,10 +1180,10 @@ main(int argc, char **argv) int ch; check_devd_enabled(); - while ((ch = getopt(argc, argv, "df:l:n")) != -1) { + while ((ch = getopt(argc, argv, "df:l:nq")) != -1) { switch (ch) { case 'd': - dflag++; + no_daemon = 1; break; case 'f': configfile = optarg; @@ -1191,7 +1192,10 @@ main(int argc, char **argv) max_clients = MAX(1, strtoul(optarg, NULL, 0)); break; case 'n': - nflag++; + daemonize_quick = 1; + break; + case 'q': + quiet_mode = 1; break; default: usage(); @@ -1199,7 +1203,7 @@ main(int argc, char **argv) } cfg.parse(); - if (!dflag && nflag) { + if (!no_daemon && daemonize_quick) { cfg.open_pidfile(); daemon(0, 0); cfg.write_pidfile(); Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Fri Mar 7 23:26:14 2014 (r262913) +++ head/sys/kern/uipc_usrreq.c Fri Mar 7 23:30:48 2014 (r262914) @@ -51,7 +51,6 @@ * * TODO: * RDM - * distinguish datagram size limits from flow control limits in SEQPACKET * rethink name space problems * need a proper out-of-band */ @@ -789,7 +788,6 @@ uipc_rcvd(struct socket *so, int flags) struct unpcb *unp, *unp2; struct socket *so2; u_int mbcnt, sbcc; - u_long newhiwat; unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_rcvd: unp == NULL")); @@ -811,6 +809,15 @@ uipc_rcvd(struct socket *so, int flags) mbcnt = so->so_rcv.sb_mbcnt; sbcc = so->so_rcv.sb_cc; SOCKBUF_UNLOCK(&so->so_rcv); + /* + * There is a benign race condition at this point. If we're planning to + * clear SB_STOP, but uipc_send is called on the connected socket at + * this instant, it might add data to the sockbuf and set SB_STOP. Then + * we would erroneously clear SB_STOP below, even though the sockbuf is + * full. The race is benign because the only ill effect is to allow the + * sockbuf to exceed its size limit, and the size limits are not + * strictly guaranteed anyway. + */ UNP_PCB_LOCK(unp); unp2 = unp->unp_conn; if (unp2 == NULL) { @@ -819,13 +826,9 @@ uipc_rcvd(struct socket *so, int flags) } so2 = unp2->unp_socket; SOCKBUF_LOCK(&so2->so_snd); - so2->so_snd.sb_mbmax += unp->unp_mbcnt - mbcnt; - newhiwat = so2->so_snd.sb_hiwat + unp->unp_cc - sbcc; - (void)chgsbsize(so2->so_cred->cr_uidinfo, &so2->so_snd.sb_hiwat, - newhiwat, RLIM_INFINITY); + if (sbcc < so2->so_snd.sb_hiwat && mbcnt < so2->so_snd.sb_mbmax) + so2->so_snd.sb_flags &= ~SB_STOP; sowwakeup_locked(so2); - unp->unp_mbcnt = mbcnt; - unp->unp_cc = sbcc; UNP_PCB_UNLOCK(unp); return (0); } @@ -836,8 +839,7 @@ uipc_send(struct socket *so, int flags, { struct unpcb *unp, *unp2; struct socket *so2; - u_int mbcnt_delta, sbcc; - u_int newhiwat; + u_int mbcnt, sbcc; int error = 0; unp = sotounpcb(so); @@ -991,27 +993,21 @@ uipc_send(struct socket *so, int flags, } } - /* - * XXXRW: While fine for SOCK_STREAM, this conflates maximum - * datagram size and back-pressure for SOCK_SEQPACKET, which - * can lead to undesired return of EMSGSIZE on send instead - * of more desirable blocking. - */ - mbcnt_delta = so2->so_rcv.sb_mbcnt - unp2->unp_mbcnt; - unp2->unp_mbcnt = so2->so_rcv.sb_mbcnt; + mbcnt = so2->so_rcv.sb_mbcnt; sbcc = so2->so_rcv.sb_cc; sorwakeup_locked(so2); + /* + * The PCB lock on unp2 protects the SB_STOP flag. Without it, + * it would be possible for uipc_rcvd to be called at this + * point, drain the receiving sockbuf, clear SB_STOP, and then + * we would set SB_STOP below. That could lead to an empty + * sockbuf having SB_STOP set + */ SOCKBUF_LOCK(&so->so_snd); - if ((int)so->so_snd.sb_hiwat >= (int)(sbcc - unp2->unp_cc)) - newhiwat = so->so_snd.sb_hiwat - (sbcc - unp2->unp_cc); - else - newhiwat = 0; - (void)chgsbsize(so->so_cred->cr_uidinfo, &so->so_snd.sb_hiwat, - newhiwat, RLIM_INFINITY); - so->so_snd.sb_mbmax -= mbcnt_delta; + if (sbcc >= so->so_snd.sb_hiwat || mbcnt >= so->so_snd.sb_mbmax) + so->so_snd.sb_flags |= SB_STOP; SOCKBUF_UNLOCK(&so->so_snd); - unp2->unp_cc = sbcc; UNP_PCB_UNLOCK(unp2); m = NULL; break; @@ -1049,27 +1045,18 @@ release: static int uipc_sense(struct socket *so, struct stat *sb) { - struct unpcb *unp, *unp2; - struct socket *so2; + struct unpcb *unp; unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_sense: unp == NULL")); sb->st_blksize = so->so_snd.sb_hiwat; - UNP_LINK_RLOCK(); UNP_PCB_LOCK(unp); - unp2 = unp->unp_conn; - if ((so->so_type == SOCK_STREAM || so->so_type == SOCK_SEQPACKET) && - unp2 != NULL) { - so2 = unp2->unp_socket; - sb->st_blksize += so2->so_rcv.sb_cc; - } sb->st_dev = NODEV; if (unp->unp_ino == 0) unp->unp_ino = (++unp_ino == 0) ? ++unp_ino : unp_ino; sb->st_ino = unp->unp_ino; UNP_PCB_UNLOCK(unp); - UNP_LINK_RUNLOCK(); return (0); } @@ -2497,8 +2484,7 @@ DB_SHOW_COMMAND(unpcb, db_show_unpcb) /* XXXRW: Would be nice to print the full address, if any. */ db_printf("unp_addr: %p\n", unp->unp_addr); - db_printf("unp_cc: %d unp_mbcnt: %d unp_gencnt: %llu\n", - unp->unp_cc, unp->unp_mbcnt, + db_printf("unp_gencnt: %llu\n", (unsigned long long)unp->unp_gencnt); db_printf("unp_flags: %x (", unp->unp_flags); Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Fri Mar 7 23:26:14 2014 (r262913) +++ head/sys/sys/sockbuf.h Fri Mar 7 23:30:48 2014 (r262914) @@ -52,6 +52,7 @@ #define SB_NOCOALESCE 0x200 /* don't coalesce new data into existing mbufs */ #define SB_IN_TOE 0x400 /* socket buffer is in the middle of an operation */ #define SB_AUTOSIZE 0x800 /* automatically size socket buffer */ +#define SB_STOP 0x1000 /* backpressure indicator */ #define SBS_CANTSENDMORE 0x0010 /* can't send more data to peer */ #define SBS_CANTRCVMORE 0x0020 /* can't receive more data from peer */ @@ -168,9 +169,19 @@ void sbunlock(struct sockbuf *sb); * still be negative (cc > hiwat or mbcnt > mbmax). Should detect * overflow and return 0. Should use "lmin" but it doesn't exist now. */ -#define sbspace(sb) \ - ((long) imin((int)((sb)->sb_hiwat - (sb)->sb_cc), \ - (int)((sb)->sb_mbmax - (sb)->sb_mbcnt))) +static __inline +long +sbspace(struct sockbuf *sb) +{ + long bleft; + long mleft; + + if (sb->sb_flags & SB_STOP) + return(0); + bleft = sb->sb_hiwat - sb->sb_cc; + mleft = sb->sb_mbmax - sb->sb_mbcnt; + return((bleft < mleft) ? bleft : mleft); +} /* adjust counters in sb reflecting allocation of m */ #define sballoc(sb, m) { \ Modified: head/sys/sys/unpcb.h ============================================================================== --- head/sys/sys/unpcb.h Fri Mar 7 23:26:14 2014 (r262913) +++ head/sys/sys/unpcb.h Fri Mar 7 23:30:48 2014 (r262914) @@ -74,8 +74,8 @@ struct unpcb { struct unp_head unp_refs; /* referencing socket linked list */ LIST_ENTRY(unpcb) unp_reflink; /* link in unp_refs list */ struct sockaddr_un *unp_addr; /* bound address of socket */ - int unp_cc; /* copy of rcv.sb_cc */ - int unp_mbcnt; /* copy of rcv.sb_mbcnt */ + int reserved1; + int reserved2; unp_gen_t unp_gencnt; /* generation count of this instance */ short unp_flags; /* flags */ short unp_gcflag; /* Garbage collector flags. */ From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 23:35:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 978A1939 for ; Fri, 7 Mar 2014 23:35:54 +0000 (UTC) Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 68FC7CF3 for ; Fri, 7 Mar 2014 23:35:54 +0000 (UTC) Received: by mail-pa0-f42.google.com with SMTP id fb1so4836990pad.29 for ; Fri, 07 Mar 2014 15:35:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=NmyJVDB3A8YmQDIMbt5tOkuVZN5Avm9X+2XguYsZ98w=; b=azVLd3x9YzyPiigXjTIfQAzltjHdk5GF94Hqs0HzTtAvjroAgrcIgAdQAWaC3E8Abz h1/g2UdYRa/CyGuCQdFP6p+TUGXypb8z1/mlHDCgdiQzvhbjrYda9JXEJfJ9JxODrJz3 iw+f59IVnrV/trf+qSrxk730fY2THksMS2Tl0V1UImjHpVkl8VR9tGD90OYBf8Fmn/gi +M4BHxWhIM+CdFEF//UOJGzGtuyTOk5bzF8hveQlxsb+51VWf4vQT+95rkiJb6KMZrJQ ce3g8XjlA/0LP/wagerjIjG5llkt6o4YL5sTk3yUZsZLEE2i31Cn7TJpJyb+cCCD+RJP tbIQ== X-Gm-Message-State: ALoCoQkqlL4FG+WFuQUkFbD5fFjbEqL9rDrCwaBVZFTkaU/hMm6sDEmx5/XmMgUk+gZxWxBuS2pW X-Received: by 10.68.250.3 with SMTP id yy3mr25382879pbc.56.1394235348430; Fri, 07 Mar 2014 15:35:48 -0800 (PST) Received: from lgmac-cvenus.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id nz11sm15585507pab.6.2014.03.07.15.35.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Mar 2014 15:35:47 -0800 (PST) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r262914 - in head: sbin/devd sys/kern sys/sys From: Warner Losh In-Reply-To: <201403072330.s27NUmO5008051@svn.freebsd.org> Date: Fri, 7 Mar 2014 16:35:45 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201403072330.s27NUmO5008051@svn.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 23:35:54 -0000 On Mar 7, 2014, at 4:30 PM, Alan Somers wrote: > Author: asomers > Date: Fri Mar 7 23:30:48 2014 > New Revision: 262914 > URL: http://svnweb.freebsd.org/changeset/base/262914 >=20 > Log: > sbin/devd/devd.8 > sbin/devd/devd.cc > Add a -q flag to devd that will suppress syslog logging at > LOG_NOTICE or below. This also changes the logging from debug to no_daemon=85 Was that = intentional? > Requested by: ian@ and imp@ > MFC after: 3 weeks > Sponsored by: Spectra Logic Corporation >=20 > Modified: > head/sbin/devd/devd.8 > head/sbin/devd/devd.cc > head/sys/kern/uipc_usrreq.c > head/sys/sys/sockbuf.h > head/sys/sys/unpcb.h I don=92t think the sys files should have been committed in the same = commit, since those are clearly unrelated. Warner > Modified: head/sbin/devd/devd.8 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sbin/devd/devd.8 Fri Mar 7 23:26:14 2014 = (r262913) > +++ head/sbin/devd/devd.8 Fri Mar 7 23:30:48 2014 = (r262914) > @@ -33,7 +33,7 @@ > .Nd "device state change daemon" > .Sh SYNOPSIS > .Nm > -.Op Fl dn > +.Op Fl dnq > .Op Fl f Ar file > .Op Fl l Ar num > .Sh DESCRIPTION > @@ -63,6 +63,8 @@ The default connection limit is 10. > .It Fl n > Do not process all pending events before becoming a daemon. > Instead, call daemon right away. > +.It Fl q > +Quiet mode. Only log messages at priority LOG_WARNING or above. > .El > .Sh IMPLEMENTATION NOTES > The >=20 > Modified: head/sbin/devd/devd.cc > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sbin/devd/devd.cc Fri Mar 7 23:26:14 2014 = (r262913) > +++ head/sbin/devd/devd.cc Fri Mar 7 23:30:48 2014 = (r262914) > @@ -129,8 +129,9 @@ static const char detach =3D '-'; >=20 > static struct pidfh *pfh; >=20 > -int dflag; > -int nflag; > +static int no_daemon =3D 0; > +static int daemonize_quick =3D 0; > +static int quiet_mode =3D 0; > static unsigned total_events =3D 0; > static volatile sig_atomic_t got_siginfo =3D 0; > static volatile sig_atomic_t romeo_must_die =3D 0; > @@ -291,7 +292,7 @@ match::do_match(config &c) > * can consume excessive amounts of systime inside of connect(). = Only > * log when we're in -d mode. > */ > - if (dflag) { > + if (no_daemon) { > devdlog(LOG_DEBUG, "Testing %s=3D%s against %s, = invert=3D%d\n", > _var.c_str(), value.c_str(), _re.c_str(), _inv); > } > @@ -401,7 +402,7 @@ var_list::set_variable(const string &var > * can consume excessive amounts of systime inside of connect(). = Only > * log when we're in -d mode. > */ > - if (dflag) > + if (no_daemon) > devdlog(LOG_DEBUG, "setting %s=3D%s\n", var.c_str(), = val.c_str()); > _vars[var] =3D val; > } > @@ -945,7 +946,7 @@ event_loop(void) > accepting =3D 1; > max_fd =3D max(fd, server_fd) + 1; > while (!romeo_must_die) { > - if (!once && !dflag && !nflag) { > + if (!once && !no_daemon && !daemonize_quick) { > // Check to see if we have any events pending. > tv.tv_sec =3D 0; > tv.tv_usec =3D 0; > @@ -1139,9 +1140,9 @@ devdlog(int priority, const char* fmt, . > va_list argp; >=20 > va_start(argp, fmt); > - if (dflag) > + if (no_daemon) > vfprintf(stderr, fmt, argp); > - else > + else if ((! quiet_mode) || (priority <=3D LOG_WARNING)) > vsyslog(priority, fmt, argp); > va_end(argp); > } > @@ -1149,7 +1150,7 @@ devdlog(int priority, const char* fmt, . > static void > usage() > { > - fprintf(stderr, "usage: %s [-dn] [-l connlimit] [-f file]\n", > + fprintf(stderr, "usage: %s [-dnq] [-l connlimit] [-f file]\n", > getprogname()); > exit(1); > } > @@ -1179,10 +1180,10 @@ main(int argc, char **argv) > int ch; >=20 > check_devd_enabled(); > - while ((ch =3D getopt(argc, argv, "df:l:n")) !=3D -1) { > + while ((ch =3D getopt(argc, argv, "df:l:nq")) !=3D -1) { > switch (ch) { > case 'd': > - dflag++; > + no_daemon =3D 1; > break; > case 'f': > configfile =3D optarg; > @@ -1191,7 +1192,10 @@ main(int argc, char **argv) > max_clients =3D MAX(1, strtoul(optarg, NULL, = 0)); > break; > case 'n': > - nflag++; > + daemonize_quick =3D 1; > + break; > + case 'q': > + quiet_mode =3D 1; > break; > default: > usage(); > @@ -1199,7 +1203,7 @@ main(int argc, char **argv) > } >=20 > cfg.parse(); > - if (!dflag && nflag) { > + if (!no_daemon && daemonize_quick) { > cfg.open_pidfile(); > daemon(0, 0); > cfg.write_pidfile(); >=20 > Modified: head/sys/kern/uipc_usrreq.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/kern/uipc_usrreq.c Fri Mar 7 23:26:14 2014 = (r262913) > +++ head/sys/kern/uipc_usrreq.c Fri Mar 7 23:30:48 2014 = (r262914) > @@ -51,7 +51,6 @@ > * > * TODO: > * RDM > - * distinguish datagram size limits from flow control limits in = SEQPACKET > * rethink name space problems > * need a proper out-of-band > */ > @@ -789,7 +788,6 @@ uipc_rcvd(struct socket *so, int flags) > struct unpcb *unp, *unp2; > struct socket *so2; > u_int mbcnt, sbcc; > - u_long newhiwat; >=20 > unp =3D sotounpcb(so); > KASSERT(unp !=3D NULL, ("uipc_rcvd: unp =3D=3D NULL")); > @@ -811,6 +809,15 @@ uipc_rcvd(struct socket *so, int flags) > mbcnt =3D so->so_rcv.sb_mbcnt; > sbcc =3D so->so_rcv.sb_cc; > SOCKBUF_UNLOCK(&so->so_rcv); > + /* > + * There is a benign race condition at this point. If we're = planning to > + * clear SB_STOP, but uipc_send is called on the connected = socket at > + * this instant, it might add data to the sockbuf and set = SB_STOP. Then > + * we would erroneously clear SB_STOP below, even though the = sockbuf is > + * full. The race is benign because the only ill effect is to = allow the > + * sockbuf to exceed its size limit, and the size limits are not > + * strictly guaranteed anyway. > + */ > UNP_PCB_LOCK(unp); > unp2 =3D unp->unp_conn; > if (unp2 =3D=3D NULL) { > @@ -819,13 +826,9 @@ uipc_rcvd(struct socket *so, int flags) > } > so2 =3D unp2->unp_socket; > SOCKBUF_LOCK(&so2->so_snd); > - so2->so_snd.sb_mbmax +=3D unp->unp_mbcnt - mbcnt; > - newhiwat =3D so2->so_snd.sb_hiwat + unp->unp_cc - sbcc; > - (void)chgsbsize(so2->so_cred->cr_uidinfo, &so2->so_snd.sb_hiwat, > - newhiwat, RLIM_INFINITY); > + if (sbcc < so2->so_snd.sb_hiwat && mbcnt < so2->so_snd.sb_mbmax) > + so2->so_snd.sb_flags &=3D ~SB_STOP; > sowwakeup_locked(so2); > - unp->unp_mbcnt =3D mbcnt; > - unp->unp_cc =3D sbcc; > UNP_PCB_UNLOCK(unp); > return (0); > } > @@ -836,8 +839,7 @@ uipc_send(struct socket *so, int flags,=20 > { > struct unpcb *unp, *unp2; > struct socket *so2; > - u_int mbcnt_delta, sbcc; > - u_int newhiwat; > + u_int mbcnt, sbcc; > int error =3D 0; >=20 > unp =3D sotounpcb(so); > @@ -991,27 +993,21 @@ uipc_send(struct socket *so, int flags,=20 > } > } >=20 > - /* > - * XXXRW: While fine for SOCK_STREAM, this conflates = maximum > - * datagram size and back-pressure for SOCK_SEQPACKET, = which > - * can lead to undesired return of EMSGSIZE on send = instead > - * of more desirable blocking. > - */ > - mbcnt_delta =3D so2->so_rcv.sb_mbcnt - unp2->unp_mbcnt; > - unp2->unp_mbcnt =3D so2->so_rcv.sb_mbcnt; > + mbcnt =3D so2->so_rcv.sb_mbcnt; > sbcc =3D so2->so_rcv.sb_cc; > sorwakeup_locked(so2); >=20 > + /*=20 > + * The PCB lock on unp2 protects the SB_STOP flag. = Without it, > + * it would be possible for uipc_rcvd to be called at = this > + * point, drain the receiving sockbuf, clear SB_STOP, = and then > + * we would set SB_STOP below. That could lead to an = empty > + * sockbuf having SB_STOP set > + */ > SOCKBUF_LOCK(&so->so_snd); > - if ((int)so->so_snd.sb_hiwat >=3D (int)(sbcc - = unp2->unp_cc)) > - newhiwat =3D so->so_snd.sb_hiwat - (sbcc - = unp2->unp_cc); > - else > - newhiwat =3D 0; > - (void)chgsbsize(so->so_cred->cr_uidinfo, = &so->so_snd.sb_hiwat, > - newhiwat, RLIM_INFINITY); > - so->so_snd.sb_mbmax -=3D mbcnt_delta; > + if (sbcc >=3D so->so_snd.sb_hiwat || mbcnt >=3D = so->so_snd.sb_mbmax) > + so->so_snd.sb_flags |=3D SB_STOP; > SOCKBUF_UNLOCK(&so->so_snd); > - unp2->unp_cc =3D sbcc; > UNP_PCB_UNLOCK(unp2); > m =3D NULL; > break; > @@ -1049,27 +1045,18 @@ release: > static int > uipc_sense(struct socket *so, struct stat *sb) > { > - struct unpcb *unp, *unp2; > - struct socket *so2; > + struct unpcb *unp; >=20 > unp =3D sotounpcb(so); > KASSERT(unp !=3D NULL, ("uipc_sense: unp =3D=3D NULL")); >=20 > sb->st_blksize =3D so->so_snd.sb_hiwat; > - UNP_LINK_RLOCK(); > UNP_PCB_LOCK(unp); > - unp2 =3D unp->unp_conn; > - if ((so->so_type =3D=3D SOCK_STREAM || so->so_type =3D=3D = SOCK_SEQPACKET) && > - unp2 !=3D NULL) { > - so2 =3D unp2->unp_socket; > - sb->st_blksize +=3D so2->so_rcv.sb_cc; > - } > sb->st_dev =3D NODEV; > if (unp->unp_ino =3D=3D 0) > unp->unp_ino =3D (++unp_ino =3D=3D 0) ? ++unp_ino : = unp_ino; > sb->st_ino =3D unp->unp_ino; > UNP_PCB_UNLOCK(unp); > - UNP_LINK_RUNLOCK(); > return (0); > } >=20 > @@ -2497,8 +2484,7 @@ DB_SHOW_COMMAND(unpcb, db_show_unpcb) > /* XXXRW: Would be nice to print the full address, if any. */ > db_printf("unp_addr: %p\n", unp->unp_addr); >=20 > - db_printf("unp_cc: %d unp_mbcnt: %d unp_gencnt: %llu\n", > - unp->unp_cc, unp->unp_mbcnt, > + db_printf("unp_gencnt: %llu\n", > (unsigned long long)unp->unp_gencnt); >=20 > db_printf("unp_flags: %x (", unp->unp_flags); >=20 > Modified: head/sys/sys/sockbuf.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/sys/sockbuf.h Fri Mar 7 23:26:14 2014 = (r262913) > +++ head/sys/sys/sockbuf.h Fri Mar 7 23:30:48 2014 = (r262914) > @@ -52,6 +52,7 @@ > #define SB_NOCOALESCE 0x200 /* don't coalesce new = data into existing mbufs */ > #define SB_IN_TOE 0x400 /* socket buffer is in = the middle of an operation */ > #define SB_AUTOSIZE 0x800 /* automatically size = socket buffer */ > +#define SB_STOP 0x1000 /* backpressure = indicator */ >=20 > #define SBS_CANTSENDMORE 0x0010 /* can't send more data = to peer */ > #define SBS_CANTRCVMORE 0x0020 /* can't receive more = data from peer */ > @@ -168,9 +169,19 @@ void sbunlock(struct sockbuf *sb); > * still be negative (cc > hiwat or mbcnt > mbmax). Should detect > * overflow and return 0. Should use "lmin" but it doesn't exist now. > */ > -#define sbspace(sb) \ > - ((long) imin((int)((sb)->sb_hiwat - (sb)->sb_cc), \ > - (int)((sb)->sb_mbmax - (sb)->sb_mbcnt))) > +static __inline > +long > +sbspace(struct sockbuf *sb) > +{ > + long bleft; > + long mleft; > + > + if (sb->sb_flags & SB_STOP) > + return(0); > + bleft =3D sb->sb_hiwat - sb->sb_cc; > + mleft =3D sb->sb_mbmax - sb->sb_mbcnt; > + return((bleft < mleft) ? bleft : mleft); > +} >=20 > /* adjust counters in sb reflecting allocation of m */ > #define sballoc(sb, m) { \ >=20 > Modified: head/sys/sys/unpcb.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/sys/unpcb.h Fri Mar 7 23:26:14 2014 = (r262913) > +++ head/sys/sys/unpcb.h Fri Mar 7 23:30:48 2014 = (r262914) > @@ -74,8 +74,8 @@ struct unpcb { > struct unp_head unp_refs; /* referencing socket linked = list */ > LIST_ENTRY(unpcb) unp_reflink; /* link in unp_refs list */ > struct sockaddr_un *unp_addr; /* bound address of socket */ > - int unp_cc; /* copy of rcv.sb_cc */ > - int unp_mbcnt; /* copy of rcv.sb_mbcnt */ > + int reserved1; > + int reserved2; > unp_gen_t unp_gencnt; /* generation count of this = instance */ > short unp_flags; /* flags */ > short unp_gcflag; /* Garbage collector flags. */ >=20 From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 23:40:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A004AACC; Fri, 7 Mar 2014 23:40:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C8D6D25; Fri, 7 Mar 2014 23:40:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s27Nebf8011073; Fri, 7 Mar 2014 23:40:37 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s27Neabh011069; Fri, 7 Mar 2014 23:40:37 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201403072340.s27Neabh011069@svn.freebsd.org> From: Alan Somers Date: Fri, 7 Mar 2014 23:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262915 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 23:40:37 -0000 Author: asomers Date: Fri Mar 7 23:40:36 2014 New Revision: 262915 URL: http://svnweb.freebsd.org/changeset/base/262915 Log: Partial revert of change 262914. I screwed up subversion syntax with perforce syntax and committed some unrelated files. Only devd files should've been committed. Reported by: imp Pointy hat to: asomers MFC after: 3 weeks X-MFC-With: r262914 Modified: head/sys/kern/uipc_usrreq.c head/sys/sys/sockbuf.h head/sys/sys/unpcb.h Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Fri Mar 7 23:30:48 2014 (r262914) +++ head/sys/kern/uipc_usrreq.c Fri Mar 7 23:40:36 2014 (r262915) @@ -51,6 +51,7 @@ * * TODO: * RDM + * distinguish datagram size limits from flow control limits in SEQPACKET * rethink name space problems * need a proper out-of-band */ @@ -788,6 +789,7 @@ uipc_rcvd(struct socket *so, int flags) struct unpcb *unp, *unp2; struct socket *so2; u_int mbcnt, sbcc; + u_long newhiwat; unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_rcvd: unp == NULL")); @@ -809,15 +811,6 @@ uipc_rcvd(struct socket *so, int flags) mbcnt = so->so_rcv.sb_mbcnt; sbcc = so->so_rcv.sb_cc; SOCKBUF_UNLOCK(&so->so_rcv); - /* - * There is a benign race condition at this point. If we're planning to - * clear SB_STOP, but uipc_send is called on the connected socket at - * this instant, it might add data to the sockbuf and set SB_STOP. Then - * we would erroneously clear SB_STOP below, even though the sockbuf is - * full. The race is benign because the only ill effect is to allow the - * sockbuf to exceed its size limit, and the size limits are not - * strictly guaranteed anyway. - */ UNP_PCB_LOCK(unp); unp2 = unp->unp_conn; if (unp2 == NULL) { @@ -826,9 +819,13 @@ uipc_rcvd(struct socket *so, int flags) } so2 = unp2->unp_socket; SOCKBUF_LOCK(&so2->so_snd); - if (sbcc < so2->so_snd.sb_hiwat && mbcnt < so2->so_snd.sb_mbmax) - so2->so_snd.sb_flags &= ~SB_STOP; + so2->so_snd.sb_mbmax += unp->unp_mbcnt - mbcnt; + newhiwat = so2->so_snd.sb_hiwat + unp->unp_cc - sbcc; + (void)chgsbsize(so2->so_cred->cr_uidinfo, &so2->so_snd.sb_hiwat, + newhiwat, RLIM_INFINITY); sowwakeup_locked(so2); + unp->unp_mbcnt = mbcnt; + unp->unp_cc = sbcc; UNP_PCB_UNLOCK(unp); return (0); } @@ -839,7 +836,8 @@ uipc_send(struct socket *so, int flags, { struct unpcb *unp, *unp2; struct socket *so2; - u_int mbcnt, sbcc; + u_int mbcnt_delta, sbcc; + u_int newhiwat; int error = 0; unp = sotounpcb(so); @@ -993,21 +991,27 @@ uipc_send(struct socket *so, int flags, } } - mbcnt = so2->so_rcv.sb_mbcnt; + /* + * XXXRW: While fine for SOCK_STREAM, this conflates maximum + * datagram size and back-pressure for SOCK_SEQPACKET, which + * can lead to undesired return of EMSGSIZE on send instead + * of more desirable blocking. + */ + mbcnt_delta = so2->so_rcv.sb_mbcnt - unp2->unp_mbcnt; + unp2->unp_mbcnt = so2->so_rcv.sb_mbcnt; sbcc = so2->so_rcv.sb_cc; sorwakeup_locked(so2); - /* - * The PCB lock on unp2 protects the SB_STOP flag. Without it, - * it would be possible for uipc_rcvd to be called at this - * point, drain the receiving sockbuf, clear SB_STOP, and then - * we would set SB_STOP below. That could lead to an empty - * sockbuf having SB_STOP set - */ SOCKBUF_LOCK(&so->so_snd); - if (sbcc >= so->so_snd.sb_hiwat || mbcnt >= so->so_snd.sb_mbmax) - so->so_snd.sb_flags |= SB_STOP; + if ((int)so->so_snd.sb_hiwat >= (int)(sbcc - unp2->unp_cc)) + newhiwat = so->so_snd.sb_hiwat - (sbcc - unp2->unp_cc); + else + newhiwat = 0; + (void)chgsbsize(so->so_cred->cr_uidinfo, &so->so_snd.sb_hiwat, + newhiwat, RLIM_INFINITY); + so->so_snd.sb_mbmax -= mbcnt_delta; SOCKBUF_UNLOCK(&so->so_snd); + unp2->unp_cc = sbcc; UNP_PCB_UNLOCK(unp2); m = NULL; break; @@ -1045,18 +1049,27 @@ release: static int uipc_sense(struct socket *so, struct stat *sb) { - struct unpcb *unp; + struct unpcb *unp, *unp2; + struct socket *so2; unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_sense: unp == NULL")); sb->st_blksize = so->so_snd.sb_hiwat; + UNP_LINK_RLOCK(); UNP_PCB_LOCK(unp); + unp2 = unp->unp_conn; + if ((so->so_type == SOCK_STREAM || so->so_type == SOCK_SEQPACKET) && + unp2 != NULL) { + so2 = unp2->unp_socket; + sb->st_blksize += so2->so_rcv.sb_cc; + } sb->st_dev = NODEV; if (unp->unp_ino == 0) unp->unp_ino = (++unp_ino == 0) ? ++unp_ino : unp_ino; sb->st_ino = unp->unp_ino; UNP_PCB_UNLOCK(unp); + UNP_LINK_RUNLOCK(); return (0); } @@ -2484,7 +2497,8 @@ DB_SHOW_COMMAND(unpcb, db_show_unpcb) /* XXXRW: Would be nice to print the full address, if any. */ db_printf("unp_addr: %p\n", unp->unp_addr); - db_printf("unp_gencnt: %llu\n", + db_printf("unp_cc: %d unp_mbcnt: %d unp_gencnt: %llu\n", + unp->unp_cc, unp->unp_mbcnt, (unsigned long long)unp->unp_gencnt); db_printf("unp_flags: %x (", unp->unp_flags); Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Fri Mar 7 23:30:48 2014 (r262914) +++ head/sys/sys/sockbuf.h Fri Mar 7 23:40:36 2014 (r262915) @@ -52,7 +52,6 @@ #define SB_NOCOALESCE 0x200 /* don't coalesce new data into existing mbufs */ #define SB_IN_TOE 0x400 /* socket buffer is in the middle of an operation */ #define SB_AUTOSIZE 0x800 /* automatically size socket buffer */ -#define SB_STOP 0x1000 /* backpressure indicator */ #define SBS_CANTSENDMORE 0x0010 /* can't send more data to peer */ #define SBS_CANTRCVMORE 0x0020 /* can't receive more data from peer */ @@ -169,19 +168,9 @@ void sbunlock(struct sockbuf *sb); * still be negative (cc > hiwat or mbcnt > mbmax). Should detect * overflow and return 0. Should use "lmin" but it doesn't exist now. */ -static __inline -long -sbspace(struct sockbuf *sb) -{ - long bleft; - long mleft; - - if (sb->sb_flags & SB_STOP) - return(0); - bleft = sb->sb_hiwat - sb->sb_cc; - mleft = sb->sb_mbmax - sb->sb_mbcnt; - return((bleft < mleft) ? bleft : mleft); -} +#define sbspace(sb) \ + ((long) imin((int)((sb)->sb_hiwat - (sb)->sb_cc), \ + (int)((sb)->sb_mbmax - (sb)->sb_mbcnt))) /* adjust counters in sb reflecting allocation of m */ #define sballoc(sb, m) { \ Modified: head/sys/sys/unpcb.h ============================================================================== --- head/sys/sys/unpcb.h Fri Mar 7 23:30:48 2014 (r262914) +++ head/sys/sys/unpcb.h Fri Mar 7 23:40:36 2014 (r262915) @@ -74,8 +74,8 @@ struct unpcb { struct unp_head unp_refs; /* referencing socket linked list */ LIST_ENTRY(unpcb) unp_reflink; /* link in unp_refs list */ struct sockaddr_un *unp_addr; /* bound address of socket */ - int reserved1; - int reserved2; + int unp_cc; /* copy of rcv.sb_cc */ + int unp_mbcnt; /* copy of rcv.sb_mbcnt */ unp_gen_t unp_gencnt; /* generation count of this instance */ short unp_flags; /* flags */ short unp_gcflag; /* Garbage collector flags. */ From owner-svn-src-head@FreeBSD.ORG Fri Mar 7 23:46:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59F8ED63; Fri, 7 Mar 2014 23:46:14 +0000 (UTC) Received: from mail-we0-x22c.google.com (mail-we0-x22c.google.com [IPv6:2a00:1450:400c:c03::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7AA24DC8; Fri, 7 Mar 2014 23:46:13 +0000 (UTC) Received: by mail-we0-f172.google.com with SMTP id t61so5990194wes.17 for ; Fri, 07 Mar 2014 15:46:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=UWRGQU13hcgUOKz1BU8pZb+S1MTI8eyW//9NmUJ37Gg=; b=wC1QywP/rIsTGqT4Fs69/VUiBXwgoEl3jh0Fh++uPExRUkRoJ4R1J8Ut+UvSRf32xg 0dfXgYSuTWT62hyUJyDoZnf6Q4SZ4buqgiEarH0VfrcK6BFMIZKeZ64jTlMk/UGxApU/ ULKMu5o8Kcr67RwLpg0La17m1F/yLRdy4kCLEnsy/cmRTkK0MI84f+jsZL0kGU7vukKZ ynb9jeX0l7aBMFUU4F5EYdt9LC0F92qMfySGC+r/xoeA+ltTcFp5GaDCa1etX1Vv+121 vY9fREu4uJstqflm7qF0vXD7/46pHtdBilA5DXlO78FbbaHNCryWqMjytiMgC6oXkvy0 70Dw== MIME-Version: 1.0 X-Received: by 10.194.190.10 with SMTP id gm10mr22344849wjc.55.1394235972001; Fri, 07 Mar 2014 15:46:12 -0800 (PST) Sender: asomers@gmail.com Received: by 10.194.168.197 with HTTP; Fri, 7 Mar 2014 15:46:11 -0800 (PST) In-Reply-To: References: <201403072330.s27NUmO5008051@svn.freebsd.org> Date: Fri, 7 Mar 2014 16:46:11 -0700 X-Google-Sender-Auth: syH3Xuo1CamzjDXPt-npw3zhApk Message-ID: Subject: Re: svn commit: r262914 - in head: sbin/devd sys/kern sys/sys From: Alan Somers To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Alan Somers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 23:46:14 -0000 On Fri, Mar 7, 2014 at 4:35 PM, Warner Losh wrote: > > On Mar 7, 2014, at 4:30 PM, Alan Somers wrote: > >> Author: asomers >> Date: Fri Mar 7 23:30:48 2014 >> New Revision: 262914 >> URL: http://svnweb.freebsd.org/changeset/base/262914 >> >> Log: >> sbin/devd/devd.8 >> sbin/devd/devd.cc >> Add a -q flag to devd that will suppress syslog logging at >> LOG_NOTICE or below. > > This also changes the logging from debug to no_daemon... Was that intentional? Yes. It's just a name change for the variable. I didn't change what the variable does. As the man page says, it causes devd to both run in the foreground and log more verbosely. IMHO, running in the foreground is the more significant effect. > >> Requested by: ian@ and imp@ >> MFC after: 3 weeks >> Sponsored by: Spectra Logic Corporation >> >> Modified: >> head/sbin/devd/devd.8 >> head/sbin/devd/devd.cc >> head/sys/kern/uipc_usrreq.c >> head/sys/sys/sockbuf.h >> head/sys/sys/unpcb.h > > I don't think the sys files should have been committed in the same commit, since those are clearly unrelated. Yep. I suck. See r262915. -Alan From owner-svn-src-head@FreeBSD.ORG Sat Mar 8 00:14:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40C8AB33; Sat, 8 Mar 2014 00:14:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 20BC56B; Sat, 8 Mar 2014 00:14:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s280EiTk027991; Sat, 8 Mar 2014 00:14:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s280EeXV027966; Sat, 8 Mar 2014 00:14:40 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403080014.s280EeXV027966@svn.freebsd.org> From: Warner Losh Date: Sat, 8 Mar 2014 00:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262916 - in head/sys/arm: allwinner broadcom/bcm2835 freescale/imx mv rockchip samsung/exynos tegra ti versatile X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2014 00:14:45 -0000 Author: imp Date: Sat Mar 8 00:14:40 2014 New Revision: 262916 URL: http://svnweb.freebsd.org/changeset/base/262916 Log: Move all the files named foo/common.c to foo/foo_common.c, as appropriate for each of the 'foo' in the tree. This will allow us to compile them together (although symbol conflicts prevent us from doing that today, this just fixes the file name collision). Added: head/sys/arm/allwinner/a10_common.c - copied, changed from r262912, head/sys/arm/allwinner/common.c head/sys/arm/broadcom/bcm2835/bcm2835_common.c - copied, changed from r262912, head/sys/arm/broadcom/bcm2835/common.c head/sys/arm/freescale/imx/imx_common.c - copied, changed from r262912, head/sys/arm/freescale/imx/common.c head/sys/arm/mv/mv_common.c - copied, changed from r262912, head/sys/arm/mv/common.c head/sys/arm/rockchip/rk30xx_common.c - copied, changed from r262912, head/sys/arm/rockchip/common.c head/sys/arm/samsung/exynos/exynos5_common.c - copied, changed from r262912, head/sys/arm/samsung/exynos/common.c head/sys/arm/tegra/tegra2_common.c - copied, changed from r262912, head/sys/arm/tegra/common.c head/sys/arm/ti/ti_common.c - copied, changed from r262912, head/sys/arm/ti/common.c head/sys/arm/versatile/versatile_common.c - copied, changed from r262912, head/sys/arm/versatile/common.c Deleted: head/sys/arm/allwinner/common.c head/sys/arm/broadcom/bcm2835/common.c head/sys/arm/freescale/imx/common.c head/sys/arm/mv/common.c head/sys/arm/rockchip/common.c head/sys/arm/samsung/exynos/common.c head/sys/arm/tegra/common.c head/sys/arm/ti/common.c head/sys/arm/versatile/common.c Modified: head/sys/arm/allwinner/files.a10 head/sys/arm/broadcom/bcm2835/files.bcm2835 head/sys/arm/freescale/imx/files.imx51 head/sys/arm/freescale/imx/files.imx53 head/sys/arm/freescale/imx/files.imx6 head/sys/arm/mv/files.mv head/sys/arm/rockchip/files.rk30xx head/sys/arm/samsung/exynos/files.exynos5 head/sys/arm/tegra/files.tegra2 head/sys/arm/ti/files.ti head/sys/arm/versatile/files.versatile Copied and modified: head/sys/arm/allwinner/a10_common.c (from r262912, head/sys/arm/allwinner/common.c) ============================================================================== Modified: head/sys/arm/allwinner/files.a10 ============================================================================== --- head/sys/arm/allwinner/files.a10 Fri Mar 7 23:40:36 2014 (r262915) +++ head/sys/arm/allwinner/files.a10 Sat Mar 8 00:14:40 2014 (r262916) @@ -9,16 +9,16 @@ arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard arm/arm/irq_dispatch.S standard -arm/allwinner/a20/a20_cpu_cfg.c standard arm/allwinner/a10_clk.c standard -arm/allwinner/a10_sramc.c standard +arm/allwinner/a10_common.c standard arm/allwinner/a10_gpio.c optional gpio arm/allwinner/a10_ehci.c optional ehci -arm/allwinner/if_emac.c optional emac +arm/allwinner/a10_machdep.c standard +arm/allwinner/a10_sramc.c standard arm/allwinner/a10_wdog.c standard -arm/allwinner/timer.c standard +arm/allwinner/a20/a20_cpu_cfg.c standard arm/allwinner/aintc.c standard +arm/allwinner/if_emac.c optional emac +arm/allwinner/timer.c standard arm/arm/bus_space-v6.c standard -arm/allwinner/common.c standard #arm/allwinner/console.c standard -arm/allwinner/a10_machdep.c standard Copied and modified: head/sys/arm/broadcom/bcm2835/bcm2835_common.c (from r262912, head/sys/arm/broadcom/bcm2835/common.c) ============================================================================== Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm2835 Fri Mar 7 23:40:36 2014 (r262915) +++ head/sys/arm/broadcom/bcm2835/files.bcm2835 Sat Mar 8 00:14:40 2014 (r262916) @@ -1,6 +1,7 @@ # $FreeBSD$ arm/broadcom/bcm2835/bcm2835_bsc.c optional bcm2835_bsc +arm/broadcom/bcm2835/bcm2835_common.c optional fdt arm/broadcom/bcm2835/bcm2835_dma.c standard arm/broadcom/bcm2835/bcm2835_fb.c optional sc arm/broadcom/bcm2835/bcm2835_fbd.c optional vt @@ -12,7 +13,6 @@ arm/broadcom/bcm2835/bcm2835_sdhci.c op arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi arm/broadcom/bcm2835/bcm2835_systimer.c standard arm/broadcom/bcm2835/bcm2835_wdog.c standard -arm/broadcom/bcm2835/common.c optional fdt dev/usb/controller/dwc_otg_fdt.c optional dwcotg arm/arm/bus_space-v6.c standard Modified: head/sys/arm/freescale/imx/files.imx51 ============================================================================== --- head/sys/arm/freescale/imx/files.imx51 Fri Mar 7 23:40:36 2014 (r262915) +++ head/sys/arm/freescale/imx/files.imx51 Sat Mar 8 00:14:40 2014 (r262916) @@ -8,9 +8,9 @@ arm/arm/irq_dispatch.S standard kern/kern_clocksource.c standard # Init +arm/freescale/imx/imx_common.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx51_machdep.c standard -arm/freescale/imx/common.c standard arm/arm/bus_space-v6.c standard # Dummy serial console Modified: head/sys/arm/freescale/imx/files.imx53 ============================================================================== --- head/sys/arm/freescale/imx/files.imx53 Fri Mar 7 23:40:36 2014 (r262915) +++ head/sys/arm/freescale/imx/files.imx53 Sat Mar 8 00:14:40 2014 (r262916) @@ -8,9 +8,9 @@ arm/arm/irq_dispatch.S standard kern/kern_clocksource.c standard # Init +arm/freescale/imx/imx_common.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx53_machdep.c standard -arm/freescale/imx/common.c standard arm/arm/bus_space-v6.c standard # Special serial console for debuging early boot code Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Fri Mar 7 23:40:36 2014 (r262915) +++ head/sys/arm/freescale/imx/files.imx6 Sat Mar 8 00:14:40 2014 (r262916) @@ -18,8 +18,8 @@ arm/arm/gic.c standard arm/arm/pl310.c standard arm/arm/bus_space-v6.c standard arm/freescale/fsl_ocotp.c standard -arm/freescale/imx/common.c standard arm/freescale/imx/imx6_anatop.c standard +arm/freescale/imx/imx_common.c standard arm/freescale/imx/imx6_ccm.c standard arm/freescale/imx/imx6_machdep.c standard arm/freescale/imx/imx6_mp.c optional smp Copied and modified: head/sys/arm/freescale/imx/imx_common.c (from r262912, head/sys/arm/freescale/imx/common.c) ============================================================================== Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Fri Mar 7 23:40:36 2014 (r262915) +++ head/sys/arm/mv/files.mv Sat Mar 8 00:14:40 2014 (r262916) @@ -23,8 +23,8 @@ arm/arm/cpufunc_asm_pj4b.S standard arm/arm/irq_dispatch.S standard arm/mv/bus_space.c standard -arm/mv/common.c standard arm/mv/gpio.c standard +arm/mv/mv_common.c standard arm/mv/mv_localbus.c standard arm/mv/mv_machdep.c standard arm/mv/mv_pci.c optional pci Copied and modified: head/sys/arm/mv/mv_common.c (from r262912, head/sys/arm/mv/common.c) ============================================================================== Modified: head/sys/arm/rockchip/files.rk30xx ============================================================================== --- head/sys/arm/rockchip/files.rk30xx Fri Mar 7 23:40:36 2014 (r262915) +++ head/sys/arm/rockchip/files.rk30xx Sat Mar 8 00:14:40 2014 (r262916) @@ -13,7 +13,7 @@ arm/arm/gic.c standard arm/arm/mpcore_timer.c standard arm/arm/bus_space-v6.c standard -arm/rockchip/common.c standard +arm/rockchip/rk30xx_common.c standard arm/rockchip/rk30xx_machdep.c standard arm/rockchip/rk30xx_pmu.c standard arm/rockchip/rk30xx_grf.c standard Copied and modified: head/sys/arm/rockchip/rk30xx_common.c (from r262912, head/sys/arm/rockchip/common.c) ============================================================================== Copied and modified: head/sys/arm/samsung/exynos/exynos5_common.c (from r262912, head/sys/arm/samsung/exynos/common.c) ============================================================================== Modified: head/sys/arm/samsung/exynos/files.exynos5 ============================================================================== --- head/sys/arm/samsung/exynos/files.exynos5 Fri Mar 7 23:40:36 2014 (r262915) +++ head/sys/arm/samsung/exynos/files.exynos5 Sat Mar 8 00:14:40 2014 (r262916) @@ -16,7 +16,7 @@ arm/arm/generic_timer.c standard arm/samsung/exynos/arch_timer.c standard arm/samsung/exynos/exynos5_mp.c optional smp -arm/samsung/exynos/common.c standard +arm/samsung/exynos/exynos5_common.c standard arm/samsung/exynos/exynos5_machdep.c standard arm/samsung/exynos/uart.c optional uart arm/samsung/exynos/ehci_exynos5.c optional ehci Modified: head/sys/arm/tegra/files.tegra2 ============================================================================== --- head/sys/arm/tegra/files.tegra2 Fri Mar 7 23:40:36 2014 (r262915) +++ head/sys/arm/tegra/files.tegra2 Sat Mar 8 00:14:40 2014 (r262916) @@ -11,7 +11,7 @@ arm/arm/irq_dispatch.S standard arm/arm/gic.c standard arm/arm/mpcore_timer.c standard -arm/tegra/common.c standard +arm/tegra/tegra2_common.c standard arm/tegra/tegra2_machdep.c standard kern/kern_clocksource.c standard Copied and modified: head/sys/arm/tegra/tegra2_common.c (from r262912, head/sys/arm/tegra/common.c) ============================================================================== Modified: head/sys/arm/ti/files.ti ============================================================================== --- head/sys/arm/ti/files.ti Fri Mar 7 23:40:36 2014 (r262915) +++ head/sys/arm/ti/files.ti Sat Mar 8 00:14:40 2014 (r262916) @@ -11,7 +11,7 @@ arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard arm/arm/irq_dispatch.S standard -arm/ti/common.c standard +arm/ti/ti_common.c standard arm/ti/ti_cpuid.c standard arm/ti/ti_machdep.c standard arm/ti/ti_prcm.c standard Copied and modified: head/sys/arm/ti/ti_common.c (from r262912, head/sys/arm/ti/common.c) ============================================================================== Modified: head/sys/arm/versatile/files.versatile ============================================================================== --- head/sys/arm/versatile/files.versatile Fri Mar 7 23:40:36 2014 (r262915) +++ head/sys/arm/versatile/files.versatile Sat Mar 8 00:14:40 2014 (r262916) @@ -9,11 +9,11 @@ arm/arm/cpufunc_asm_armv6.S arm/arm/irq_dispatch.S standard arm/versatile/bus_space.c standard -arm/versatile/common.c standard arm/versatile/pl050.c optional sc arm/versatile/sp804.c standard arm/versatile/versatile_machdep.c standard arm/versatile/versatile_clcd.c optional sc +arm/versatile/versatile_common.c standard arm/versatile/versatile_pci.c optional pci arm/versatile/versatile_pci_bus_space.c optional pci arm/versatile/versatile_sic.c standard Copied and modified: head/sys/arm/versatile/versatile_common.c (from r262912, head/sys/arm/versatile/common.c) ============================================================================== From owner-svn-src-head@FreeBSD.ORG Sat Mar 8 00:35:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85E41F49; Sat, 8 Mar 2014 00:35:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 735A5217; Sat, 8 Mar 2014 00:35:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s280Z7F9036150; Sat, 8 Mar 2014 00:35:07 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s280Z7xF036149; Sat, 8 Mar 2014 00:35:07 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201403080035.s280Z7xF036149@svn.freebsd.org> From: Jeff Roberson Date: Sat, 8 Mar 2014 00:35:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262917 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2014 00:35:07 -0000 Author: jeff Date: Sat Mar 8 00:35:06 2014 New Revision: 262917 URL: http://svnweb.freebsd.org/changeset/base/262917 Log: - Make runq_steal_from more aggressive. Previously it would examine only a single priority queue. If that queue had a thread or threads which could not be migrated we would fail to steal load. This could cause starvation in situations where cores are idle. Submitted by: Doug Kilpatrick Tested by: pho Reviewed by: mav Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Sat Mar 8 00:14:40 2014 (r262916) +++ head/sys/kern/sched_ule.c Sat Mar 8 00:35:06 2014 (r262917) @@ -1057,32 +1057,27 @@ runq_steal_from(struct runq *rq, int cpu struct rqhead *rqh; struct thread *td, *first; int bit; - int pri; int i; rqb = &rq->rq_status; bit = start & (RQB_BPW -1); - pri = 0; first = NULL; again: for (i = RQB_WORD(start); i < RQB_LEN; bit = 0, i++) { if (rqb->rqb_bits[i] == 0) continue; - if (bit != 0) { - for (pri = bit; pri < RQB_BPW; pri++) - if (rqb->rqb_bits[i] & (1ul << pri)) - break; - if (pri >= RQB_BPW) + if (bit == 0) + bit = RQB_FFS(rqb->rqb_bits[i]); + for (; bit < RQB_BPW; bit++) { + if ((rqb->rqb_bits[i] & (1ul << bit)) == 0) continue; - } else - pri = RQB_FFS(rqb->rqb_bits[i]); - pri += (i << RQB_L2BPW); - rqh = &rq->rq_queues[pri]; - TAILQ_FOREACH(td, rqh, td_runq) { - if (first && THREAD_CAN_MIGRATE(td) && - THREAD_CAN_SCHED(td, cpu)) - return (td); - first = td; + rqh = &rq->rq_queues[bit + (i << RQB_L2BPW)]; + TAILQ_FOREACH(td, rqh, td_runq) { + if (first && THREAD_CAN_MIGRATE(td) && + THREAD_CAN_SCHED(td, cpu)) + return (td); + first = td; + } } } if (start != 0) { From owner-svn-src-head@FreeBSD.ORG Sat Mar 8 03:22:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D3D1A78; Sat, 8 Mar 2014 03:22:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3B47E9F; Sat, 8 Mar 2014 03:22:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s283MQm6005275; Sat, 8 Mar 2014 03:22:26 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s283MQKk005274; Sat, 8 Mar 2014 03:22:26 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403080322.s283MQKk005274@svn.freebsd.org> From: Warner Losh Date: Sat, 8 Mar 2014 03:22:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262919 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2014 03:22:26 -0000 Author: imp Date: Sat Mar 8 03:22:25 2014 New Revision: 262919 URL: http://svnweb.freebsd.org/changeset/base/262919 Log: Add commented out dts for sam9260ek as well as early printf support. Modified: head/sys/arm/conf/SAM9260EK Modified: head/sys/arm/conf/SAM9260EK ============================================================================== --- head/sys/arm/conf/SAM9260EK Sat Mar 8 03:22:20 2014 (r262918) +++ head/sys/arm/conf/SAM9260EK Sat Mar 8 03:22:25 2014 (r262919) @@ -25,6 +25,7 @@ include "../at91/std.sam9260ek" hints "SAM9260EK.hints" #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions MODULES_OVERRIDE="" options SCHED_4BSD # 4BSD scheduler #options PREEMPTION # Enable kernel thread preemption @@ -171,3 +172,12 @@ device at91_wdt # Atmel AT91 Watchdog T # NAND Flash - Reference design has Samsung 256MB but others possible device nand # NAND interface on CS3 + +# Coming soon, but not yet +#options FDT +#options FDT_DTB_STATIC +#makeoptions FDT_DTS_FILE=sam9260ek.dts + +options EARLY_PRINTF +options SOCDEV_PA=0xfc000000 +options SOCDEV_VA=0xdc000000 From owner-svn-src-head@FreeBSD.ORG Sat Mar 8 03:22:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 238C2A73; Sat, 8 Mar 2014 03:22:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0FA7B9C; Sat, 8 Mar 2014 03:22:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s283MKOs005223; Sat, 8 Mar 2014 03:22:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s283MKDW005222; Sat, 8 Mar 2014 03:22:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403080322.s283MKDW005222@svn.freebsd.org> From: Warner Losh Date: Sat, 8 Mar 2014 03:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262918 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2014 03:22:21 -0000 Author: imp Date: Sat Mar 8 03:22:20 2014 New Revision: 262918 URL: http://svnweb.freebsd.org/changeset/base/262918 Log: Initial cut for DTS on the hl201 board. Added: head/sys/boot/fdt/dts/arm/hl201.dts (contents, props changed) Added: head/sys/boot/fdt/dts/arm/hl201.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/hl201.dts Sat Mar 8 03:22:20 2014 (r262918) @@ -0,0 +1,44 @@ +/* + * Hot-e HL-201 - Warner Losh public domain + * + * $FreeBSD$ + */ +/dts-v1/; + +/* + * The following is a white lie. The HL-201 is a stripped down version of + * the SAM9G20EK board with a video output chip. + */ +#include "at91sam9g20ek_common.dtsi" + +/ { + model = "Thinlinx HL201"; + compatible = "thinlinx,hl201", "atmel,at91sam9g20ek", "atmel,at91sam9g20", "atmel,at91sam9"; + + leds { + compatible = "gpio-leds"; + + ds1 { + label = "ds1"; + gpios = <&pioA 9 0>; + linux,default-trigger = "heartbeat"; + }; + + ds5 { + label = "ds5"; + gpios = <&pioA 6 1>; + }; + }; + + /* Missing: one wire serial number, video chip */ + + aliases { + dbgu = &dbgu; + }; + + + chosen { + stdin = "dbgu"; + stdout = "dbgu"; + }; +}; From owner-svn-src-head@FreeBSD.ORG Sat Mar 8 03:39:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75D87F5A; Sat, 8 Mar 2014 03:39:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 600321AD; Sat, 8 Mar 2014 03:39:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s283dAek010098; Sat, 8 Mar 2014 03:39:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s283dAM8010097; Sat, 8 Mar 2014 03:39:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403080339.s283dAM8010097@svn.freebsd.org> From: Warner Losh Date: Sat, 8 Mar 2014 03:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262920 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2014 03:39:10 -0000 Author: imp Date: Sat Mar 8 03:39:09 2014 New Revision: 262920 URL: http://svnweb.freebsd.org/changeset/base/262920 Log: Make clock optional on uart nodes. It is a FreeBSD-specific extention, and won't be present in vendor supplied dts files. Modified: head/sys/dev/uart/uart_bus_fdt.c Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Sat Mar 8 03:22:25 2014 (r262919) +++ head/sys/dev/uart/uart_bus_fdt.c Sat Mar 8 03:39:09 2014 (r262920) @@ -97,9 +97,12 @@ uart_fdt_get_clock(phandle_t node, pcell { pcell_t clock; + /* + * clock-frequency is a FreeBSD-specific hack. Make its presence optional. + */ if ((OF_getprop(node, "clock-frequency", &clock, sizeof(clock))) <= 0) - return (ENXIO); + clock = 0; if (clock == 0) /* Try to retrieve parent 'bus-frequency' */ From owner-svn-src-head@FreeBSD.ORG Sat Mar 8 03:39:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1DF7692; Sat, 8 Mar 2014 03:39:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E918B1AF; Sat, 8 Mar 2014 03:39:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s283dFRw010156; Sat, 8 Mar 2014 03:39:15 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s283dFFq010153; Sat, 8 Mar 2014 03:39:15 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403080339.s283dFFq010153@svn.freebsd.org> From: Warner Losh Date: Sat, 8 Mar 2014 03:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262921 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2014 03:39:16 -0000 Author: imp Date: Sat Mar 8 03:39:15 2014 New Revision: 262921 URL: http://svnweb.freebsd.org/changeset/base/262921 Log: Set the baud rate if it isn't 0 (meaning it has been specified) not only if it is 0 (meaning that it hasn't been specified and is likely to turn off the UART's transmitter). Modified: head/sys/dev/uart/uart_core.c Modified: head/sys/dev/uart/uart_core.c ============================================================================== --- head/sys/dev/uart/uart_core.c Sat Mar 8 03:39:09 2014 (r262920) +++ head/sys/dev/uart/uart_core.c Sat Mar 8 03:39:15 2014 (r262921) @@ -473,7 +473,7 @@ uart_bus_attach(device_t dev) } if (sc->sc_sysdev != NULL) { - if (sc->sc_sysdev->baudrate == 0) { + if (sc->sc_sysdev->baudrate != 0) { if (UART_IOCTL(sc, UART_IOCTL_BAUD, (intptr_t)&sc->sc_sysdev->baudrate) != 0) sc->sc_sysdev->baudrate = -1; From owner-svn-src-head@FreeBSD.ORG Sat Mar 8 05:03:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22362D34; Sat, 8 Mar 2014 05:03:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0F88DA38; Sat, 8 Mar 2014 05:03:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2853uB3046797; Sat, 8 Mar 2014 05:03:56 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2853ubB046795; Sat, 8 Mar 2014 05:03:56 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403080503.s2853ubB046795@svn.freebsd.org> From: Warner Losh Date: Sat, 8 Mar 2014 05:03:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262923 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2014 05:03:57 -0000 Author: imp Date: Sat Mar 8 05:03:56 2014 New Revision: 262923 URL: http://svnweb.freebsd.org/changeset/base/262923 Log: Make at91_soc_id() public. Modified: head/sys/arm/at91/at91_machdep.c head/sys/arm/at91/at91var.h Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Sat Mar 8 03:54:49 2014 (r262922) +++ head/sys/arm/at91/at91_machdep.c Sat Mar 8 05:03:56 2014 (r262923) @@ -428,7 +428,7 @@ at91_try_id(uint32_t dbgu_base) return (1); } -static void +void at91_soc_id(void) { Modified: head/sys/arm/at91/at91var.h ============================================================================== --- head/sys/arm/at91/at91var.h Sat Mar 8 03:54:49 2014 (r262922) +++ head/sys/arm/at91/at91var.h Sat Mar 8 05:03:56 2014 (r262923) @@ -168,5 +168,6 @@ void at91_add_child(device_t dev, int pr extern uint32_t at91_irq_system; extern uint32_t at91_master_clock; void at91_pmc_init_clock(void); +void at91_soc_id(void); #endif /* _AT91VAR_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat Mar 8 06:06:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B007F415; Sat, 8 Mar 2014 06:06:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9CBEDDF6; Sat, 8 Mar 2014 06:06:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2866glJ070777; Sat, 8 Mar 2014 06:06:42 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2866gBH070776; Sat, 8 Mar 2014 06:06:42 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403080606.s2866gBH070776@svn.freebsd.org> From: Warner Losh Date: Sat, 8 Mar 2014 06:06:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262924 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2014 06:06:42 -0000 Author: imp Date: Sat Mar 8 06:06:42 2014 New Revision: 262924 URL: http://svnweb.freebsd.org/changeset/base/262924 Log: Properly round on unmapping. Modified: head/sys/arm/at91/at91.c Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Sat Mar 8 05:03:56 2014 (r262923) +++ head/sys/arm/at91/at91.c Sat Mar 8 06:06:42 2014 (r262924) @@ -84,8 +84,12 @@ at91_bs_unmap(void *t, bus_space_handle_ { vm_offset_t va, endva; + if (t == 0) + return; va = trunc_page((vm_offset_t)t); - endva = va + round_page(size); + if (va >= AT91_BASE && va <= AT91_BASE + 0xff00000) + return; + endva = round_page((vm_offset_t)t + size); /* Free the kernel virtual mapping. */ kva_free(va, endva - va); From owner-svn-src-head@FreeBSD.ORG Sat Mar 8 06:06:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56165548; Sat, 8 Mar 2014 06:06:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 38139DF8; Sat, 8 Mar 2014 06:06:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2866qPc070846; Sat, 8 Mar 2014 06:06:52 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2866oSs070837; Sat, 8 Mar 2014 06:06:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403080606.s2866oSs070837@svn.freebsd.org> From: Warner Losh Date: Sat, 8 Mar 2014 06:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262925 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2014 06:06:52 -0000 Author: imp Date: Sat Mar 8 06:06:50 2014 New Revision: 262925 URL: http://svnweb.freebsd.org/changeset/base/262925 Log: Move AIC related stuff to own file. Added: head/sys/arm/at91/at91_aic.c (contents, props changed) Modified: head/sys/arm/at91/at91.c head/sys/arm/at91/at91rm9200.c head/sys/arm/at91/at91sam9g20.c head/sys/arm/at91/at91sam9g20reg.h head/sys/arm/at91/at91sam9x5.c head/sys/arm/at91/at91sam9x5reg.h head/sys/arm/at91/files.at91 Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Sat Mar 8 06:06:42 2014 (r262924) +++ head/sys/arm/at91/at91.c Sat Mar 8 06:06:50 2014 (r262925) @@ -24,6 +24,8 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -49,12 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include -static struct at91_softc *at91_softc; - -static void at91_eoi(void *); - -extern const struct arm_devmap_entry at91_devmap[]; - uint32_t at91_master_clock; static int @@ -233,6 +229,12 @@ struct bus_space at91_bs_tag = { NULL, }; +#ifndef FDT + +static struct at91_softc *at91_softc; + +static void at91_eoi(void *); + static int at91_probe(device_t dev) { @@ -264,7 +266,6 @@ static int at91_attach(device_t dev) { struct at91_softc *sc = device_get_softc(dev); - int i; arm_post_filter = at91_eoi; @@ -294,29 +295,6 @@ at91_attach(device_t dev) 0xfffffffful) != 0) panic("at91_attach: failed to set up memory rman"); - /* - * Setup the interrupt table. - */ - if (soc_info.soc_data == NULL || soc_info.soc_data->soc_irq_prio == NULL) - panic("Interrupt priority table missing\n"); - for (i = 0; i < 32; i++) { - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SVR + - i * 4, i); - /* Priority. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SMR + i * 4, - soc_info.soc_data->soc_irq_prio[i]); - if (i < 8) - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_EOICR, - 1); - } - - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_SPU, 32); - /* No debug. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_DCR, 0); - /* Disable and clear all interrupts. */ - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_IDCR, 0xffffffff); - bus_space_write_4(sc->sc_st, sc->sc_aic_sh, IC_ICCR, 0xffffffff); - /* * Add this device's children... */ @@ -476,42 +454,6 @@ at91_print_child(device_t dev, device_t return (retval); } -void -arm_mask_irq(uintptr_t nb) -{ - - bus_space_write_4(at91_softc->sc_st, - at91_softc->sc_aic_sh, IC_IDCR, 1 << nb); -} - -int -arm_get_next_irq(int last __unused) -{ - int status; - int irq; - - irq = bus_space_read_4(at91_softc->sc_st, - at91_softc->sc_aic_sh, IC_IVR); - status = bus_space_read_4(at91_softc->sc_st, - at91_softc->sc_aic_sh, IC_ISR); - if (status == 0) { - bus_space_write_4(at91_softc->sc_st, - at91_softc->sc_aic_sh, IC_EOICR, 1); - return (-1); - } - return (irq); -} - -void -arm_unmask_irq(uintptr_t nb) -{ - - bus_space_write_4(at91_softc->sc_st, - at91_softc->sc_aic_sh, IC_IECR, 1 << nb); - bus_space_write_4(at91_softc->sc_st, at91_softc->sc_aic_sh, - IC_EOICR, 0); -} - static void at91_eoi(void *unused) { @@ -588,3 +530,4 @@ static driver_t at91_driver = { static devclass_t at91_devclass; DRIVER_MODULE(atmelarm, nexus, at91_driver, at91_devclass, 0, 0); +#endif Added: head/sys/arm/at91/at91_aic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/at91_aic.c Sat Mar 8 06:06:50 2014 (r262925) @@ -0,0 +1,188 @@ +/*- + * Copyright (c) 2014 Warner Losh. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#ifdef FDT +#include +#include +#include +#endif + +static struct aic_softc { + struct resource *mem_res; /* Memory resource */ + void *intrhand; /* Interrupt handle */ + device_t sc_dev; +} *sc; + +static inline uint32_t +RD4(struct aic_softc *sc, bus_size_t off) +{ + + return (bus_read_4(sc->mem_res, off)); +} + +static inline void +WR4(struct aic_softc *sc, bus_size_t off, uint32_t val) +{ + + bus_write_4(sc->mem_res, off, val); +} + +void +arm_mask_irq(uintptr_t nb) +{ + + WR4(sc, IC_IDCR, 1 << nb); +} + +int +arm_get_next_irq(int last __unused) +{ + int status; + int irq; + + irq = RD4(sc, IC_IVR); + status = RD4(sc, IC_ISR); + if (status == 0) { + WR4(sc, IC_EOICR, 1); + return (-1); + } + return (irq); +} + +void +arm_unmask_irq(uintptr_t nb) +{ + + WR4(sc, IC_IECR, 1 << nb); + WR4(sc, IC_EOICR, 0); +} + +static int +at91_aic_probe(device_t dev) +{ +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,at91rm9200-aic")) + return (ENXIO); +#endif + device_set_desc(dev, "AIC"); + return (0); +} + +static int +at91_aic_attach(device_t dev) +{ + int i, rid, err = 0; + + device_printf(dev, "Attach %d\n", bus_current_pass); + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + + if (sc->mem_res == NULL) + panic("couldn't allocate register resources"); + + /* + * Setup the interrupt table. + */ + if (soc_info.soc_data == NULL || soc_info.soc_data->soc_irq_prio == NULL) + panic("Interrupt priority table missing\n"); + for (i = 0; i < 32; i++) { + WR4(sc, IC_SVR + i * 4, i); + /* Priority. */ + WR4(sc, IC_SMR + i * 4, soc_info.soc_data->soc_irq_prio[i]); + if (i < 8) + WR4(sc, IC_EOICR, 1); + } + + WR4(sc, IC_SPU, 32); + /* No debug. */ + WR4(sc, IC_DCR, 0); + /* Disable and clear all interrupts. */ + WR4(sc, IC_IDCR, 0xffffffff); + WR4(sc, IC_ICCR, 0xffffffff); + enable_interrupts(I32_bit | F32_bit); + + return (err); +} + +static void +at91_aic_new_pass(device_t dev) +{ + device_printf(dev, "Pass %d\n", bus_current_pass); +} + +static device_method_t at91_aic_methods[] = { + DEVMETHOD(device_probe, at91_aic_probe), + DEVMETHOD(device_attach, at91_aic_attach), + DEVMETHOD(bus_new_pass, at91_aic_new_pass), + DEVMETHOD_END +}; + +static driver_t at91_aic_driver = { + "at91_aic", + at91_aic_methods, + sizeof(struct aic_softc), +}; + +static devclass_t at91_aic_devclass; + +#ifdef FDT +DRIVER_MODULE(at91_aic, simplebus, at91_aic_driver, at91_aic_devclass, NULL, + NULL); +#else +DRIVER_MODULE(at91_aic, atmelarm, at91_aic_driver, at91_aic_devclass, NULL, + NULL); +#endif +/* not yet +EARLY_DRIVER_MODULE(at91_aic, simplebus, at91_aic_driver, at91_aic_devclass, + NULL, NULL, BUS_PASS_INTERRUPT); +*/ Modified: head/sys/arm/at91/at91rm9200.c ============================================================================== --- head/sys/arm/at91/at91rm9200.c Sat Mar 8 06:06:42 2014 (r262924) +++ head/sys/arm/at91/at91rm9200.c Sat Mar 8 06:06:50 2014 (r262925) @@ -105,6 +105,7 @@ static const uint32_t at91_pio_base[] = static const struct cpu_devs at91_devs[] = { + DEVICE("at91_aic", AIC, 0), DEVICE("at91_pmc", PMC, 0), DEVICE("at91_st", ST, 0), DEVICE("at91_pio", PIOA, 0), Modified: head/sys/arm/at91/at91sam9g20.c ============================================================================== --- head/sys/arm/at91/at91sam9g20.c Sat Mar 8 06:06:42 2014 (r262924) +++ head/sys/arm/at91/at91sam9g20.c Sat Mar 8 06:06:50 2014 (r262925) @@ -103,6 +103,7 @@ static const uint32_t at91_pio_base[] = static const struct cpu_devs at91_devs[] = { + DEVICE("at91_aic", AIC, 0), DEVICE("at91_pmc", PMC, 0), DEVICE("at91_wdt", WDT, 0), DEVICE("at91_rst", RSTC, 0), Modified: head/sys/arm/at91/at91sam9g20reg.h ============================================================================== --- head/sys/arm/at91/at91sam9g20reg.h Sat Mar 8 06:06:42 2014 (r262924) +++ head/sys/arm/at91/at91sam9g20reg.h Sat Mar 8 06:06:50 2014 (r262925) @@ -221,6 +221,7 @@ #define AT91SAM9G20_IRQ_RSTC AT91SAM9G20_IRQ_SYSTEM #define AT91SAM9G20_IRQ_OHCI AT91SAM9G20_IRQ_UHP #define AT91SAM9G20_IRQ_NAND (-1) +#define AT91SAM9G20_IRQ_AIC (-1) #define AT91SAM9G20_AIC_BASE 0xffff000 #define AT91SAM9G20_AIC_SIZE 0x200 Modified: head/sys/arm/at91/at91sam9x5.c ============================================================================== --- head/sys/arm/at91/at91sam9x5.c Sat Mar 8 06:06:42 2014 (r262924) +++ head/sys/arm/at91/at91sam9x5.c Sat Mar 8 06:06:50 2014 (r262925) @@ -104,6 +104,7 @@ static const uint32_t at91_pio_base[] = static const struct cpu_devs at91_devs[] = { + DEVICE("at91_aic", AIC, 0), DEVICE("at91_pmc", PMC, 0), DEVICE("at91_wdt", WDT, 0), DEVICE("at91_rst", RSTC, 0), Modified: head/sys/arm/at91/at91sam9x5reg.h ============================================================================== --- head/sys/arm/at91/at91sam9x5reg.h Sat Mar 8 06:06:42 2014 (r262924) +++ head/sys/arm/at91/at91sam9x5reg.h Sat Mar 8 06:06:50 2014 (r262925) @@ -221,6 +221,7 @@ #define AT91SAM9X25_IRQ_PIOC AT91SAM9X25_IRQ_PIOCD #define AT91SAM9X25_IRQ_PIOD AT91SAM9X25_IRQ_PIOCD #define AT91SAM9X25_IRQ_NAND (-1) +#define AT91SAM9X25_IRQ_AIC (-1) #define AT91SAM9X25_AIC_BASE 0xffff000 #define AT91SAM9X25_AIC_SIZE 0x200 Modified: head/sys/arm/at91/files.at91 ============================================================================== --- head/sys/arm/at91/files.at91 Sat Mar 8 06:06:42 2014 (r262924) +++ head/sys/arm/at91/files.at91 Sat Mar 8 06:06:50 2014 (r262925) @@ -2,6 +2,7 @@ arm/arm/cpufunc_asm_arm9.S standard arm/arm/irq_dispatch.S standard arm/at91/at91_machdep.c standard +arm/at91/at91_aic.c standard arm/at91/at91.c standard arm/at91/at91_cfata.c optional at91_cfata arm/at91/at91_mci.c optional at91_mci From owner-svn-src-head@FreeBSD.ORG Sat Mar 8 14:58:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E407207; Sat, 8 Mar 2014 14:58:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2B991A45; Sat, 8 Mar 2014 14:58:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s28EweYa088581; Sat, 8 Mar 2014 14:58:40 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s28EwehV088580; Sat, 8 Mar 2014 14:58:40 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201403081458.s28EwehV088580@svn.freebsd.org> From: Hiroki Sato Date: Sat, 8 Mar 2014 14:58:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262929 - head/sys/dev/ffec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2014 14:58:40 -0000 Author: hrs Date: Sat Mar 8 14:58:39 2014 New Revision: 262929 URL: http://svnweb.freebsd.org/changeset/base/262929 Log: Fix another bug in multicast filtering. i.MX uses 6 bits from MSB in LE CRC32 for the hash value, not the lowest 6 bits in BE CRC32. Tested by: Takanori Sawada PR: arm/187179 Modified: head/sys/dev/ffec/if_ffec.c Modified: head/sys/dev/ffec/if_ffec.c ============================================================================== --- head/sys/dev/ffec/if_ffec.c Sat Mar 8 12:26:17 2014 (r262928) +++ head/sys/dev/ffec/if_ffec.c Sat Mar 8 14:58:39 2014 (r262929) @@ -959,9 +959,10 @@ ffec_setup_rxfilter(struct ffec_softc *s TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) + /* 6 bits from MSB in LE CRC32 are used for hash. */ + crc = ether_crc32_le(LLADDR((struct sockaddr_dl *) ifma->ifma_addr), ETHER_ADDR_LEN); - ghash |= 1LLU << (crc & 0x3f); + ghash |= 1LLU << (((uint8_t *)&crc)[3] >> 2); } if_maddr_runlock(ifp); } From owner-svn-src-head@FreeBSD.ORG Sat Mar 8 15:13:49 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 037C7698; Sat, 8 Mar 2014 15:13:49 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C84A5B9F; Sat, 8 Mar 2014 15:13:48 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WMIwd-000G1u-Fn; Sat, 08 Mar 2014 15:13:47 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s28FDj66053521; Sat, 8 Mar 2014 08:13:45 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+9A82oFzZS/8ThnBKlvrTL Subject: Re: svn commit: r262411 - head/sys/arm/arm From: Ian Lepore To: Konstantin Belousov In-Reply-To: <20140307152111.GL24664@kib.kiev.ua> References: <201402232252.s1NMqmI5075701@svn.freebsd.org> <20140305115402.GC24664@kib.kiev.ua> <1394025767.1149.327.camel@revolution.hippie.lan> <20140307152111.GL24664@kib.kiev.ua> Content-Type: text/plain; charset="us-ascii" Date: Sat, 08 Mar 2014 08:13:45 -0700 Message-ID: <1394291625.1149.405.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2014 15:13:49 -0000 On Fri, 2014-03-07 at 17:21 +0200, Konstantin Belousov wrote: > On Wed, Mar 05, 2014 at 06:22:47AM -0700, Ian Lepore wrote: > > On Wed, 2014-03-05 at 13:54 +0200, Konstantin Belousov wrote: > > > On Sun, Feb 23, 2014 at 10:52:48PM +0000, Ian Lepore wrote: > > > > Author: ian > > > > Date: Sun Feb 23 22:52:48 2014 > > > > New Revision: 262411 > > > > URL: http://svnweb.freebsd.org/changeset/base/262411 > > > > > > > > Log: > > > > If the L2 cache type is PIPT, pass a physical address for a flush. > > > > > > > > While this is technically more correct, I don't think it much matters, > > > > because the only thing in the tree that calls cpu_flush_dcache() is md(4) > > > > and I'm > 99% sure it's bogus that it does so; md has no ability to do > > > > anything that can perturb data cache coherency. > > > > > > Yes, md(4) does not break data cache coherency, but I think that > > > Marcel added the flush to ensure instruction cache coherency. The > > > intent was to ensure that harward-architecture machines would > > > see up-to-date memory content when fetching instructions after > > > read on md(4). > > > > Oh. If that's necessary on ia64, it seems like ia64/elf_machdep.c would > > be the place to do the flush. > > I am not sure about ia64, it was needed for PowerPC, I think. > The issue is not limited to the module loads, so elf_machdep.c cannot > solve the problem. The part of the commit message for r192323 about ARM is just wrong. I don't know enough about the other platforms mentioned in there to comment on those, but the flush call which that commit message bills as avoiding pessimization just maximially pessimizes things on ARM. -- Ian From owner-svn-src-head@FreeBSD.ORG Sat Mar 8 19:35:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38254E31; Sat, 8 Mar 2014 19:35:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2506D185; Sat, 8 Mar 2014 19:35:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s28JZWAt002369; Sat, 8 Mar 2014 19:35:32 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s28JZVgZ002368; Sat, 8 Mar 2014 19:35:32 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201403081935.s28JZVgZ002368@svn.freebsd.org> From: Rui Paulo Date: Sat, 8 Mar 2014 19:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262930 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2014 19:35:32 -0000 Author: rpaulo Date: Sat Mar 8 19:35:31 2014 New Revision: 262930 URL: http://svnweb.freebsd.org/changeset/base/262930 Log: Call ieee80211_dump_pkt() based on IFF_DUMPPKTS(). MFC after: 3 days Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sat Mar 8 14:58:39 2014 (r262929) +++ head/sys/dev/ath/if_ath_tx.c Sat Mar 8 19:35:31 2014 (r262930) @@ -3769,9 +3769,10 @@ ath_tx_tid_drain_print(struct ath_softc ni->ni_txseqs[tid->tid]); /* XXX Dump the frame, see what it is? */ - ieee80211_dump_pkt(ni->ni_ic, - mtod(bf->bf_m, const uint8_t *), - bf->bf_m->m_len, 0, -1); + if (IFF_DUMPPKTS(sc, ATH_DEBUG_XMIT)) + ieee80211_dump_pkt(ni->ni_ic, + mtod(bf->bf_m, const uint8_t *), + bf->bf_m->m_len, 0, -1); } /* From owner-svn-src-head@FreeBSD.ORG Sat Mar 8 19:44:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 399F5240; Sat, 8 Mar 2014 19:44:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0C5C825B; Sat, 8 Mar 2014 19:44:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s28JiZDN006142; Sat, 8 Mar 2014 19:44:35 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s28JiZsP006138; Sat, 8 Mar 2014 19:44:35 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201403081944.s28JiZsP006138@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 8 Mar 2014 19:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262931 - in head/bin: kill sh sh/tests/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2014 19:44:36 -0000 Author: jilles Date: Sat Mar 8 19:44:34 2014 New Revision: 262931 URL: http://svnweb.freebsd.org/changeset/base/262931 Log: sh: Successfully do nothing when killing a terminated job. If a job has terminated but is still known, silently do nothing when using the kill builtin with the job specifier. Formerly, the shell called kill() with the process group ID that might have been reused. Added: head/bin/sh/tests/builtins/kill1.0 (contents, props changed) Modified: head/bin/kill/kill.c head/bin/sh/jobs.c head/bin/sh/tests/builtins/Makefile Modified: head/bin/kill/kill.c ============================================================================== --- head/bin/kill/kill.c Sat Mar 8 19:35:31 2014 (r262930) +++ head/bin/kill/kill.c Sat Mar 8 19:44:34 2014 (r262931) @@ -133,9 +133,15 @@ main(int argc, char *argv[]) for (errors = 0; argc; argc--, argv++) { #ifdef SHELL - if (**argv == '%') + if (**argv == '%') { pid = getjobpgrp(*argv); - else + /* + * Silently ignore terminated jobs, like the kernel + * silently ignores zombies. + */ + if (pid == 0) + continue; + } else #endif { pid = strtol(*argv, &ep, 10); Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sat Mar 8 19:35:31 2014 (r262930) +++ head/bin/sh/jobs.c Sat Mar 8 19:44:34 2014 (r262931) @@ -645,6 +645,8 @@ getjobpgrp(char *name) struct job *jp; jp = getjob(name); + if (jp->state == JOBDONE) + return 0; return -jp->ps[0].pid; } Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Sat Mar 8 19:35:31 2014 (r262930) +++ head/bin/sh/tests/builtins/Makefile Sat Mar 8 19:44:34 2014 (r262931) @@ -86,6 +86,7 @@ FILES+= hash3.0 hash3.0.stdout FILES+= hash4.0 FILES+= jobid1.0 FILES+= jobid2.0 +FILES+= kill1.0 FILES+= lineno.0 lineno.0.stdout FILES+= lineno2.0 FILES+= local1.0 Added: head/bin/sh/tests/builtins/kill1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/kill1.0 Sat Mar 8 19:44:34 2014 (r262931) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +: & +p1=$! +: & +p2=$! +wait $p2 +kill %1 From owner-svn-src-head@FreeBSD.ORG Sat Mar 8 19:59:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8EB916F7; Sat, 8 Mar 2014 19:59:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7BFD5380; Sat, 8 Mar 2014 19:59:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s28JxqjV010707; Sat, 8 Mar 2014 19:59:52 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s28JxqRj010706; Sat, 8 Mar 2014 19:59:52 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403081959.s28JxqRj010706@svn.freebsd.org> From: Warner Losh Date: Sat, 8 Mar 2014 19:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262932 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2014 19:59:52 -0000 Author: imp Date: Sat Mar 8 19:59:52 2014 New Revision: 262932 URL: http://svnweb.freebsd.org/changeset/base/262932 Log: Back out r262921. I don't know what I was thinking, but it is lame. Modified: head/sys/dev/uart/uart_core.c Modified: head/sys/dev/uart/uart_core.c ============================================================================== --- head/sys/dev/uart/uart_core.c Sat Mar 8 19:44:34 2014 (r262931) +++ head/sys/dev/uart/uart_core.c Sat Mar 8 19:59:52 2014 (r262932) @@ -473,7 +473,7 @@ uart_bus_attach(device_t dev) } if (sc->sc_sysdev != NULL) { - if (sc->sc_sysdev->baudrate != 0) { + if (sc->sc_sysdev->baudrate == 0) { if (UART_IOCTL(sc, UART_IOCTL_BAUD, (intptr_t)&sc->sc_sysdev->baudrate) != 0) sc->sc_sysdev->baudrate = -1; From owner-svn-src-head@FreeBSD.ORG Sat Mar 8 23:05:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CC556C9; Sat, 8 Mar 2014 23:05:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4FFBD5F4; Sat, 8 Mar 2014 23:05:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s28N5Tlf098576; Sat, 8 Mar 2014 23:05:29 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s28N5Tt1098575; Sat, 8 Mar 2014 23:05:29 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201403082305.s28N5Tt1098575@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 8 Mar 2014 23:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262934 - head/usr.bin/xinstall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Mar 2014 23:05:29 -0000 Author: jilles Date: Sat Mar 8 23:05:28 2014 New Revision: 262934 URL: http://svnweb.freebsd.org/changeset/base/262934 Log: install: Use posix_spawnp() for starting strip and improve error messages. Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Sat Mar 8 20:31:04 2014 (r262933) +++ head/usr.bin/xinstall/xinstall.c Sat Mar 8 23:05:28 2014 (r262934) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -102,6 +103,8 @@ static enum { DIGEST_SHA512, } digesttype = DIGEST_NONE; +extern char **environ; + static gid_t gid; static uid_t uid; static int dobackup, docompare, dodir, dolink, dopreserve, dostrip, dounpriv, @@ -1215,27 +1218,33 @@ static void strip(const char *to_name) { const char *stripbin; - int serrno, status; - - switch (fork()) { - case -1: - serrno = errno; + const char *args[3]; + pid_t pid; + int error, status; + + stripbin = getenv("STRIPBIN"); + if (stripbin == NULL) + stripbin = "strip"; + args[0] = stripbin; + args[1] = to_name; + args[2] = NULL; + error = posix_spawnp(&pid, stripbin, NULL, NULL, + __DECONST(char **, args), environ); + if (error != 0) { (void)unlink(to_name); - errno = serrno; - err(EX_TEMPFAIL, "fork"); - case 0: - stripbin = getenv("STRIPBIN"); - if (stripbin == NULL) - stripbin = "strip"; - execlp(stripbin, stripbin, to_name, (char *)NULL); - err(EX_OSERR, "exec(%s)", stripbin); - default: - if (wait(&status) == -1 || status) { - serrno = errno; - (void)unlink(to_name); - errc(EX_SOFTWARE, serrno, "wait"); - /* NOTREACHED */ - } + errc(error == EAGAIN || error == EPROCLIM || error == ENOMEM ? + EX_TEMPFAIL : EX_OSERR, error, "spawn %s", stripbin); + } + if (waitpid(pid, &status, 0) == -1) { + error = errno; + (void)unlink(to_name); + errc(EX_SOFTWARE, error, "wait"); + /* NOTREACHED */ + } + if (status != 0) { + (void)unlink(to_name); + errx(EX_SOFTWARE, "strip command %s failed on %s", + stripbin, to_name); } } From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 01:52:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D453CCC4; Sun, 9 Mar 2014 01:52:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C0B501E6; Sun, 9 Mar 2014 01:52:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s291qLf3080924; Sun, 9 Mar 2014 01:52:21 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s291qLda080923; Sun, 9 Mar 2014 01:52:21 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403090152.s291qLda080923@svn.freebsd.org> From: Ian Lepore Date: Sun, 9 Mar 2014 01:52:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262935 - head/sys/arm/allwinner/a20 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 01:52:21 -0000 Author: ian Date: Sun Mar 9 01:52:21 2014 New Revision: 262935 URL: http://svnweb.freebsd.org/changeset/base/262935 Log: Follow r262916 with one more config file that references a renamed common.c Modified: head/sys/arm/allwinner/a20/files.a20 Modified: head/sys/arm/allwinner/a20/files.a20 ============================================================================== --- head/sys/arm/allwinner/a20/files.a20 Sat Mar 8 23:05:28 2014 (r262934) +++ head/sys/arm/allwinner/a20/files.a20 Sun Mar 9 01:52:21 2014 (r262935) @@ -19,5 +19,5 @@ arm/allwinner/if_emac.c optional emac arm/allwinner/a10_wdog.c standard arm/allwinner/timer.c standard arm/arm/bus_space-v6.c standard -arm/allwinner/common.c standard +arm/allwinner/a10_common.c standard arm/allwinner/a10_machdep.c standard From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 02:00:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A5AFE45; Sun, 9 Mar 2014 02:00:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2719B27E; Sun, 9 Mar 2014 02:00:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2920mnx084050; Sun, 9 Mar 2014 02:00:48 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2920m6c084049; Sun, 9 Mar 2014 02:00:48 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201403090200.s2920m6c084049@svn.freebsd.org> From: Glen Barber Date: Sun, 9 Mar 2014 02:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262936 - head/release/tools/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 02:00:49 -0000 Author: gjb Date: Sun Mar 9 02:00:48 2014 New Revision: 262936 URL: http://svnweb.freebsd.org/changeset/base/262936 Log: Update board definition for WANDBOARD-QUAD to match crochet. Sponsored by: The FreeBSD Foundation Modified: head/release/tools/arm/crochet-WANDBOARD-QUAD.conf Modified: head/release/tools/arm/crochet-WANDBOARD-QUAD.conf ============================================================================== --- head/release/tools/arm/crochet-WANDBOARD-QUAD.conf Sun Mar 9 01:52:21 2014 (r262935) +++ head/release/tools/arm/crochet-WANDBOARD-QUAD.conf Sun Mar 9 02:00:48 2014 (r262936) @@ -5,7 +5,7 @@ # This is the configuration file for use with crochet to produce # FreeBSD WandboardQuad images. -board_setup WandboardQuad +board_setup Wandboard option ImageSize 1gb option AutoSize From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 02:07:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87D80FC9; Sun, 9 Mar 2014 02:07:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7501A2B5; Sun, 9 Mar 2014 02:07:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2927Gw2085628; Sun, 9 Mar 2014 02:07:16 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2927GF3085625; Sun, 9 Mar 2014 02:07:16 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201403090207.s2927GF3085625@svn.freebsd.org> From: Neel Natu Date: Sun, 9 Mar 2014 02:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262937 - head/sys/dev/bvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 02:07:16 -0000 Author: neel Date: Sun Mar 9 02:07:15 2014 New Revision: 262937 URL: http://svnweb.freebsd.org/changeset/base/262937 Log: Fix panic "_mtx_lock_sleep: recursed on non-recursive mutex ttymtx" caused when acquiring the tty lock in bvm_tty_close(). Instead just assert that the tty lock is held before calling callout_reset(). Modified: head/sys/dev/bvm/bvm_console.c Modified: head/sys/dev/bvm/bvm_console.c ============================================================================== --- head/sys/dev/bvm/bvm_console.c Sun Mar 9 02:00:48 2014 (r262936) +++ head/sys/dev/bvm/bvm_console.c Sun Mar 9 02:07:15 2014 (r262937) @@ -128,9 +128,8 @@ static void bvm_tty_close(struct tty *tp) { - tty_lock(tp); + tty_lock_assert(tp, MA_OWNED); callout_stop(&bvm_timer); - tty_unlock(tp); } static void From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 02:28:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 327083DB; Sun, 9 Mar 2014 02:28:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2029E5E5; Sun, 9 Mar 2014 02:28:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s292SUUg093626; Sun, 9 Mar 2014 02:28:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s292SUA1093625; Sun, 9 Mar 2014 02:28:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403090228.s292SUA1093625@svn.freebsd.org> From: Warner Losh Date: Sun, 9 Mar 2014 02:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262940 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 02:28:31 -0000 Author: imp Date: Sun Mar 9 02:28:30 2014 New Revision: 262940 URL: http://svnweb.freebsd.org/changeset/base/262940 Log: Remove bogus define that causes compile errors. Most of the defines for SAM9X are going away soonish anyway (once FDT works), but until then... Modified: head/sys/arm/at91/at91sam9x5reg.h Modified: head/sys/arm/at91/at91sam9x5reg.h ============================================================================== --- head/sys/arm/at91/at91sam9x5reg.h Sun Mar 9 02:11:53 2014 (r262939) +++ head/sys/arm/at91/at91sam9x5reg.h Sun Mar 9 02:28:30 2014 (r262940) @@ -221,7 +221,6 @@ #define AT91SAM9X25_IRQ_PIOC AT91SAM9X25_IRQ_PIOCD #define AT91SAM9X25_IRQ_PIOD AT91SAM9X25_IRQ_PIOCD #define AT91SAM9X25_IRQ_NAND (-1) -#define AT91SAM9X25_IRQ_AIC (-1) #define AT91SAM9X25_AIC_BASE 0xffff000 #define AT91SAM9X25_AIC_SIZE 0x200 From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 03:00:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2716E62E; Sun, 9 Mar 2014 03:00:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ED999820; Sun, 9 Mar 2014 03:00:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s29304dZ007673; Sun, 9 Mar 2014 03:00:04 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29303B2007478; Sun, 9 Mar 2014 03:00:03 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403090300.s29303B2007478@svn.freebsd.org> From: Ian Lepore Date: Sun, 9 Mar 2014 03:00:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262941 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 03:00:05 -0000 Author: ian Date: Sun Mar 9 03:00:03 2014 New Revision: 262941 URL: http://svnweb.freebsd.org/changeset/base/262941 Log: Rework the VFP code that handles demand-based save and restore of state. The old code was full of complexity that would only matter if the kernel itself used the VFP hardware. Now that's reduced to either killing the userland process or panicking the kernel on an illegal VFP instruction. This removes most of the complexity from the assembler code, reducing it to just calling the save code if the outgoing thread used the VFP. The routine that stores the VFP state now takes a flag that indicates whether the hardware should be disabled after saving state. Right now it always is, but this makes the code ready to be used by get/set_mcontext() (doing so will be addressed in a future commit). Remove the arm-specific pc_vfpcthread from struct pcpu and use the MI field pc_fpcurthread instead. Reviewed by: cognet Modified: head/sys/arm/arm/genassym.c head/sys/arm/arm/swtch.S head/sys/arm/arm/vfp.c head/sys/arm/include/pcpu.h head/sys/arm/include/vfp.h Modified: head/sys/arm/arm/genassym.c ============================================================================== --- head/sys/arm/arm/genassym.c Sun Mar 9 02:28:30 2014 (r262940) +++ head/sys/arm/arm/genassym.c Sun Mar 9 03:00:03 2014 (r262941) @@ -119,9 +119,7 @@ ASSYM(ARM_RAS_END, ARM_RAS_END); #ifdef VFP ASSYM(PCB_VFPSTATE, offsetof(struct pcb, pcb_vfpstate)); -ASSYM(PCB_VFPCPU, offsetof(struct pcb, pcb_vfpcpu)); -ASSYM(PC_VFPCTHREAD, offsetof(struct pcpu, pc_vfpcthread)); ASSYM(PC_CPU, offsetof(struct pcpu, pc_cpu)); ASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap)); Modified: head/sys/arm/arm/swtch.S ============================================================================== --- head/sys/arm/arm/swtch.S Sun Mar 9 02:28:30 2014 (r262940) +++ head/sys/arm/arm/swtch.S Sun Mar 9 03:00:03 2014 (r262941) @@ -84,6 +84,8 @@ #include #include #include +#include + __FBSDID("$FreeBSD$"); #define DOMAIN_CLIENT 0x01 @@ -102,6 +104,10 @@ __FBSDID("$FreeBSD$"); ldr tmp, .Lcurpcpu #endif +#ifdef VFP + .fpu vfp /* allow VFP instructions */ +#endif + .Lcurpcpu: .word _C_LABEL(__pcpu) .word PCPU_SIZE @@ -121,16 +127,10 @@ ENTRY(cpu_throw) GET_PCPU(r7, r9) #ifdef VFP - /* - * vfp_discard will clear pcpu->pc_vfpcthread, and modify - * and modify the control as needed. - */ - ldr r4, [r7, #(PC_VFPCTHREAD)] /* this thread using vfp? */ - cmp r0, r4 - bne 3f - bl _C_LABEL(vfp_discard) /* yes, shut down vfp */ -3: -#endif /* VFP */ + fmrx r0, fpexc /* This thread is dying, if the VFP */ + tst r0, #(VFPEXC_EN) /* is enabled, go shut it down */ + blne _C_LABEL(vfp_discard) /* without preserving its state. */ +#endif ldr r7, [r5, #(TD_PCB)] /* r7 = new thread's PCB */ @@ -319,30 +319,14 @@ ENTRY(cpu_switch) /* rem: interrupts are enabled */ #ifdef VFP - /* - * vfp_store will clear pcpu->pc_vfpcthread, save - * registers and state, and modify the control as needed. - * a future exception will bounce the backup settings in the fp unit. - * XXX vfp_store can't change r4 - */ - GET_PCPU(r7, r8) - ldr r8, [r7, #(PC_VFPCTHREAD)] - cmp r4, r8 /* old thread used vfp? */ - bne 1f /* no, don't save */ - cmp r1, r4 /* same thread ? */ - beq 1f /* yes, skip vfp store */ -#ifdef SMP - ldr r8, [r7, #(PC_CPU)] /* last used on this cpu? */ - ldr r3, [r2, #(PCB_VFPCPU)] - cmp r8, r3 /* last cpu to use these registers? */ - bne 1f /* no. these values are stale */ + fmrx r0, fpexc /* If the VFP is enabled */ + tst r0, #(VFPEXC_EN) /* the current thread has */ + movne r1, #1 /* used it, so go save */ + addne r0, r2, #(PCB_VFPSTATE) /* the state into the PCB */ + blne _C_LABEL(vfp_store) /* and disable the VFP. */ #endif - add r0, r2, #(PCB_VFPSTATE) - bl _C_LABEL(vfp_store) -1: -#endif /* VFP */ - /* r1 now free! */ + /* r0-r3 now free! */ /* Third phase : restore saved context */ @@ -520,26 +504,12 @@ ENTRY(savectx) add r2, r0, #(PCB_R8) stmia r2, {r8-r13} #ifdef VFP - /* - * vfp_store will clear pcpu->pc_vfpcthread, save - * registers and state, and modify the control as needed. - * a future exception will bounce the backup settings in the fp unit. - */ - GET_PCPU(r7, r4) - ldr r4, [r7, #(PC_VFPCTHREAD)] /* vfp thread */ - ldr r2, [r7, #(PC_CURTHREAD)] /* current thread */ - cmp r4, r2 - bne 1f -#ifdef SMP - ldr r2, [r7, #(PC_CPU)] /* last used on this cpu? */ - ldr r3, [r0, #(PCB_VFPCPU)] - cmp r2, r3 - bne 1f /* no. these values are stale */ + fmrx r2, fpexc /* If the VFP is enabled */ + tst r2, #(VFPEXC_EN) /* the current thread has */ + movne r1, #1 /* used it, so go save */ + addne r0, r0, #(PCB_VFPSTATE) /* the state into the PCB */ + blne _C_LABEL(vfp_store) /* and disable the VFP. */ #endif - add r0, r0, #(PCB_VFPSTATE) - bl _C_LABEL(vfp_store) -1: -#endif /* VFP */ add sp, sp, #4; ldmfd sp!, {r4-r7, pc} END(savectx) Modified: head/sys/arm/arm/vfp.c ============================================================================== --- head/sys/arm/arm/vfp.c Sun Mar 9 02:28:30 2014 (r262940) +++ head/sys/arm/arm/vfp.c Sun Mar 9 03:00:03 2014 (r262941) @@ -1,4 +1,5 @@ -/* +/*- + * Copyright (c) 2014 Ian Lepore * Copyright (c) 2012 Mark Tinguely * * All rights reserved. @@ -34,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -41,12 +43,8 @@ __FBSDID("$FreeBSD$"); #include /* function prototypes */ -unsigned int get_coprocessorACR(void); static int vfp_bounce(u_int, u_int, struct trapframe *, int); static void vfp_restore(struct vfp_state *); -void vfp_discard(void); -void vfp_store(struct vfp_state *); -void set_coprocessorACR(u_int); extern int vfp_exists; static struct undefined_handler vfp10_uh, vfp11_uh; @@ -64,7 +62,20 @@ static int is_d32; val; \ }) -u_int +/* + * Work around an issue with GCC where the asm it generates is not unified + * syntax and fails to assemble because it expects the ldcleq instruction in the + * form ldcl, not in the UAL form ldcl, and similar for stcleq. + */ +#ifdef __clang__ +#define LDCLNE "ldclne " +#define STCLNE "stclne " +#else +#define LDCLNE "ldcnel " +#define STCLNE "stcnel " +#endif + +static u_int get_coprocessorACR(void) { u_int val; @@ -72,7 +83,7 @@ get_coprocessorACR(void) return val; } -void +static void set_coprocessorACR(u_int val) { __asm __volatile("mcr p15, 0, %0, c1, c0, 2\n\t" @@ -136,147 +147,103 @@ SYSINIT(vfp, SI_SUB_CPU, SI_ORDER_ANY, v static int vfp_bounce(u_int addr, u_int insn, struct trapframe *frame, int code) { - u_int fpexc; + u_int cpu, fpexc; struct pcb *curpcb; - struct thread *vfptd; - int i; - if (!vfp_exists) - return 1; /* vfp does not exist */ - i = disable_interrupts(I32_bit|F32_bit); - fpexc = fmrx(VFPEXC); /* read the vfp exception reg */ - if (fpexc & VFPEXC_EN) { - vfptd = PCPU_GET(vfpcthread); - /* did the kernel call the vfp or exception that expect us - * to emulate the command. Newer hardware does not require - * emulation, so we don't emulate yet. - */ -#ifdef SMP - /* don't save if newer registers are on another processor */ - if (vfptd /* && (vfptd == curthread) */ && - (vfptd->td_pcb->pcb_vfpcpu == PCPU_GET(cpu))) -#else - /* someone did not save their registers, */ - if (vfptd /* && (vfptd == curthread) */) -#endif - vfp_store(&vfptd->td_pcb->pcb_vfpstate); + if ((code & FAULT_USER) == 0) + panic("undefined floating point instruction in supervisor mode"); - fpexc &= ~VFPEXC_EN; - fmxr(VFPEXC, fpexc); /* turn vfp hardware off */ - if (vfptd == curthread) { - /* kill the process - we do not handle emulation */ - restore_interrupts(i); - killproc(curthread->td_proc, "vfp emulation"); - return 1; - } - /* should not happen. someone did not save their context */ - printf("vfp_bounce: vfpcthread: %p curthread: %p\n", - vfptd, curthread); + critical_enter(); + + /* + * If the VFP is already on and we got an undefined instruction, then + * something tried to executate a truly invalid instruction that maps to + * the VFP. + */ + fpexc = fmrx(VFPEXC); + if (fpexc & VFPEXC_EN) { + /* kill the process - we do not handle emulation */ + critical_exit(); + killproc(curthread->td_proc, "vfp emulation"); + return 1; } - fpexc |= VFPEXC_EN; - fmxr(VFPEXC, fpexc); /* enable the vfp and repeat command */ - curpcb = curthread->td_pcb; - /* If we were the last process to use the VFP, the process did not - * use a VFP on another processor, then the registers in the VFP - * will still be ours and are current. Eventually, we will make the - * restore smarter. + + /* + * If the last time this thread used the VFP it was on this core, and + * the last thread to use the VFP on this core was this thread, then the + * VFP state is valid, otherwise restore this thread's state to the VFP. */ - vfp_restore(&curpcb->pcb_vfpstate); -#ifdef SMP - curpcb->pcb_vfpcpu = PCPU_GET(cpu); -#endif - PCPU_SET(vfpcthread, curthread); - restore_interrupts(i); - return 0; + fmxr(VFPEXC, fpexc | VFPEXC_EN); + curpcb = curthread->td_pcb; + cpu = PCPU_GET(cpu); + if (curpcb->pcb_vfpcpu != cpu || curthread != PCPU_GET(fpcurthread)) { + vfp_restore(&curpcb->pcb_vfpstate); + curpcb->pcb_vfpcpu = cpu; + PCPU_SET(fpcurthread, curthread); + } + + critical_exit(); + return (0); } -/* vfs_store is called from from a VFP command to restore the registers and - * turn on the VFP hardware. - * Eventually we will use the information that this process was the last - * to use the VFP hardware and bypass the restore, just turn on the hardware. +/* + * Restore the given state to the VFP hardware. */ static void vfp_restore(struct vfp_state *vfpsave) { u_int vfpscr = 0; - /* - * Work around an issue with GCC where the asm it generates is - * not unified syntax and fails to assemble because it expects - * the ldcleq instruction in the form ldcl, not in the UAL - * form ldcl, and similar for stcleq. - */ -#ifdef __clang__ -#define ldclne "ldclne" -#define stclne "stclne" -#else -#define ldclne "ldcnel" -#define stclne "stcnel" -#endif - if (vfpsave) { - __asm __volatile("ldc p10, c0, [%1], #128\n" /* d0-d15 */ + __asm __volatile("ldc p10, c0, [%1], #128\n" /* d0-d15 */ "cmp %2, #0\n" /* -D16 or -D32? */ - ldclne" p11, c0, [%1], #128\n" /* d16-d31 */ + LDCLNE "p11, c0, [%1], #128\n" /* d16-d31 */ "addeq %1, %1, #128\n" /* skip missing regs */ "ldr %0, [%1]\n" /* set old vfpscr */ "mcr p10, 7, %0, cr1, c0, 0\n" : "=&r" (vfpscr) : "r" (vfpsave), "r" (is_d32) : "cc"); - } } -/* vfs_store is called from switch to save the vfp hardware registers - * into the pcb before switching to another process. - * we already know that the new process is different from this old - * process and that this process last used the VFP registers. - * Below we check to see if the VFP has been enabled since the last - * register save. - * This routine will exit with the VFP turned off. The next VFP user - * will trap to restore its registers and turn on the VFP hardware. +/* + * If the VFP is on, save its current state and turn it off if requested to do + * so. If the VFP is not on, does not change the values at *vfpsave. Caller is + * responsible for preventing a context switch while this is running. */ void -vfp_store(struct vfp_state *vfpsave) +vfp_store(struct vfp_state *vfpsave, boolean_t disable_vfp) { - u_int tmp, vfpscr = 0; + u_int tmp, vfpscr; tmp = fmrx(VFPEXC); /* Is the vfp enabled? */ - if (vfpsave && (tmp & VFPEXC_EN)) { - __asm __volatile("stc p11, c0, [%1], #128\n" /* d0-d15 */ + if (tmp & VFPEXC_EN) { + __asm __volatile( + "stc p11, c0, [%1], #128\n" /* d0-d15 */ "cmp %2, #0\n" /* -D16 or -D32? */ - stclne" p11, c0, [%1], #128\n" /* d16-d31 */ + STCLNE "p11, c0, [%1], #128\n" /* d16-d31 */ "addeq %1, %1, #128\n" /* skip missing regs */ "mrc p10, 7, %0, cr1, c0, 0\n" /* fmxr(VFPSCR) */ "str %0, [%1]\n" /* save vfpscr */ : "=&r" (vfpscr) : "r" (vfpsave), "r" (is_d32) : "cc"); + if (disable_vfp) + fmxr(VFPEXC , tmp & ~VFPEXC_EN); } -#undef ldcleq -#undef stcleq - -#ifndef SMP - /* eventually we will use this information for UP also */ - PCPU_SET(vfpcthread, 0); -#endif - tmp &= ~VFPEXC_EN; /* disable the vfp hardware */ - fmxr(VFPEXC , tmp); } -/* discard the registers at cpu_thread_free() when fpcurthread == td. - * Turn off the VFP hardware. +/* + * If the VFP hardware is on, the current thread was using it but now that + * thread is dying. Turn off the VFP and set pcpu fpcurthread to 0, to indicate + * that the VFP hardware state does not belong to any thread. Called only from + * cpu_throw(), so we don't have to worry about a context switch here. */ void vfp_discard() { - u_int tmp = 0; + u_int tmp; - /* - * No need to protect the access to vfpcthread by disabling - * interrupts, since it's called from cpu_throw(), who is called - * with interrupts disabled. - */ - - PCPU_SET(vfpcthread, 0); /* permanent forget about reg */ tmp = fmrx(VFPEXC); - tmp &= ~VFPEXC_EN; /* turn off VFP hardware */ - fmxr(VFPEXC, tmp); + if (tmp & VFPEXC_EN) { + fmxr(VFPEXC, tmp & ~VFPEXC_EN); + PCPU_SET(fpcurthread, 0); + } } #endif Modified: head/sys/arm/include/pcpu.h ============================================================================== --- head/sys/arm/include/pcpu.h Sun Mar 9 02:28:30 2014 (r262940) +++ head/sys/arm/include/pcpu.h Sun Mar 9 03:00:03 2014 (r262941) @@ -46,9 +46,8 @@ struct vmspace; unsigned int pc_vfpsid; \ unsigned int pc_vfpmvfr0; \ unsigned int pc_vfpmvfr1; \ - struct thread *pc_vfpcthread; \ struct pmap *pc_curpmap; \ - char __pad[133] + char __pad[137] #else #define PCPU_MD_FIELDS \ char __pad[157] Modified: head/sys/arm/include/vfp.h ============================================================================== --- head/sys/arm/include/vfp.h Sun Mar 9 02:28:30 2014 (r262940) +++ head/sys/arm/include/vfp.h Sun Mar 9 03:00:03 2014 (r262941) @@ -126,6 +126,10 @@ #define COPROC10 (0x3 << 20) #define COPROC11 (0x3 << 22) +#ifndef LOCORE void vfp_init(void); +void vfp_store(struct vfp_state *, boolean_t); +void vfp_discard(void); +#endif #endif From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 03:49:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A61ABE2E; Sun, 9 Mar 2014 03:49:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 86D88C57; Sun, 9 Mar 2014 03:49:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s293n8dv026723; Sun, 9 Mar 2014 03:49:08 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s293n7c8026716; Sun, 9 Mar 2014 03:49:07 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403090349.s293n7c8026716@svn.freebsd.org> From: Ian Lepore Date: Sun, 9 Mar 2014 03:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262942 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 03:49:08 -0000 Author: ian Date: Sun Mar 9 03:49:06 2014 New Revision: 262942 URL: http://svnweb.freebsd.org/changeset/base/262942 Log: Remove all dregs of a per-thread undefined-exception-mode stack. This is a leftover from the days when a low-level debugger had hooks in the undefined exception vector and needed stack space to function. These days it effectively isn't used because we switch immediately to the svc32 mode stack on exception entry. For that, the single undef mode stack per core that gets set up at init time works fine. The stack wasn't necessary but it was harmful, because the space for it was carved out of the normal per-thread svc32 stack, in effect cutting that 8K stack in half. If svc32 mode used more than 4k of stack space it wandered down into the undef mode stack, and then an undef exception would overwrite a couple words on the stack while switching to svc32 mode, corrupting the scv32 stack. Having another stack abut the bottom of the svc32 stack also effectively mooted the guard page below the stack. This work is based on analysis and patches submitted by Juergen Weiss. Modified: head/sys/arm/arm/genassym.c head/sys/arm/arm/machdep.c head/sys/arm/arm/swtch.S head/sys/arm/arm/vm_machdep.c head/sys/arm/include/param.h head/sys/arm/include/pcb.h Modified: head/sys/arm/arm/genassym.c ============================================================================== --- head/sys/arm/arm/genassym.c Sun Mar 9 03:00:03 2014 (r262941) +++ head/sys/arm/arm/genassym.c Sun Mar 9 03:49:06 2014 (r262942) @@ -60,7 +60,6 @@ ASSYM(PCB_NOALIGNFLT, PCB_NOALIGNFLT); ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); ASSYM(PCB_DACR, offsetof(struct pcb, pcb_dacr)); ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags)); -ASSYM(PCB_UND_SP, offsetof(struct pcb, un_32.pcb32_und_sp)); ASSYM(PCB_PAGEDIR, offsetof(struct pcb, pcb_pagedir)); ASSYM(PCB_L1VEC, offsetof(struct pcb, pcb_l1vec)); ASSYM(PCB_PL1VEC, offsetof(struct pcb, pcb_pl1vec)); Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sun Mar 9 03:00:03 2014 (r262941) +++ head/sys/arm/arm/machdep.c Sun Mar 9 03:49:06 2014 (r262942) @@ -379,8 +379,6 @@ cpu_startup(void *dummy) bufinit(); vm_pager_bufferinit(); - pcb->un_32.pcb32_und_sp = (u_int)thread0.td_kstack + - USPACE_UNDEF_STACK_TOP; pcb->un_32.pcb32_sp = (u_int)thread0.td_kstack + USPACE_SVC_STACK_TOP; vector_page_setprot(VM_PROT_READ); Modified: head/sys/arm/arm/swtch.S ============================================================================== --- head/sys/arm/arm/swtch.S Sun Mar 9 03:00:03 2014 (r262941) +++ head/sys/arm/arm/swtch.S Sun Mar 9 03:49:06 2014 (r262942) @@ -303,17 +303,6 @@ ENTRY(cpu_switch) /* Get the user structure for the new process in r9 */ ldr r9, [r1, #(TD_PCB)] - mrs r3, cpsr - /* - * We can do that, since - * PSR_SVC32_MODE|PSR_UND32_MODE == MSR_UND32_MODE - */ - orr r8, r3, #(PSR_UND32_MODE) - msr cpsr_c, r8 - - str sp, [r2, #(PCB_UND_SP)] - - msr cpsr_c, r3 /* Restore the old mode */ /* rem: r2 = old PCB */ /* rem: r9 = new PCB */ /* rem: interrupts are enabled */ @@ -422,10 +411,6 @@ ENTRY(cpu_switch) movne r0, #0 /* We *know* vector_page's VA is 0x0 */ movne lr, pc ldrne pc, [r10, #CF_TLB_FLUSHID_SE] - /* - * We can do that, since - * PSR_SVC32_MODE|PSR_UND32_MODE == MSR_UND32_MODE - */ .Lcs_context_switched: @@ -444,17 +429,6 @@ ENTRY(cpu_switch) /* rem: r9 = new PCB */ - mrs r3, cpsr - /* - * We can do that, since - * PSR_SVC32_MODE|PSR_UND32_MODE == MSR_UND32_MODE - */ - orr r2, r3, #(PSR_UND32_MODE) - msr cpsr_c, r2 - - ldr sp, [r9, #(PCB_UND_SP)] - - msr cpsr_c, r3 /* Restore the old mode */ /* Restore all the save registers */ #ifndef _ARM_ARCH_5E add r7, r9, #PCB_R8 Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Sun Mar 9 03:00:03 2014 (r262941) +++ head/sys/arm/arm/vm_machdep.c Sun Mar 9 03:49:06 2014 (r262942) @@ -144,7 +144,6 @@ cpu_fork(register struct thread *td1, re bcopy(td1->td_pcb, pcb2, sizeof(*pcb2)); mdp2 = &p2->p_md; bcopy(&td1->td_proc->p_md, mdp2, sizeof(*mdp2)); - pcb2->un_32.pcb32_und_sp = td2->td_kstack + USPACE_UNDEF_STACK_TOP; pcb2->un_32.pcb32_sp = td2->td_kstack + USPACE_SVC_STACK_TOP - sizeof(*pcb2); pmap_activate(td2); @@ -366,7 +365,6 @@ cpu_set_upcall(struct thread *td, struct tf->tf_spsr &= ~PSR_C_bit; tf->tf_r0 = 0; td->td_pcb->un_32.pcb32_sp = (u_int)sf; - td->td_pcb->un_32.pcb32_und_sp = td->td_kstack + USPACE_UNDEF_STACK_TOP; KASSERT((td->td_pcb->un_32.pcb32_sp & 7) == 0, ("cpu_set_upcall: Incorrect stack alignment")); Modified: head/sys/arm/include/param.h ============================================================================== --- head/sys/arm/include/param.h Sun Mar 9 03:00:03 2014 (r262941) +++ head/sys/arm/include/param.h Sun Mar 9 03:49:06 2014 (r262942) @@ -125,10 +125,8 @@ #define KSTACK_GUARD_PAGES 1 #endif /* !KSTACK_GUARD_PAGES */ -#define USPACE_SVC_STACK_TOP KSTACK_PAGES * PAGE_SIZE -#define USPACE_SVC_STACK_BOTTOM (USPACE_SVC_STACK_TOP - 0x1000) -#define USPACE_UNDEF_STACK_TOP (USPACE_SVC_STACK_BOTTOM - 0x10) -#define USPACE_UNDEF_STACK_BOTTOM (FPCONTEXTSIZE + 10) +#define USPACE_SVC_STACK_TOP (KSTACK_PAGES * PAGE_SIZE) + /* * Mach derived conversion macros */ Modified: head/sys/arm/include/pcb.h ============================================================================== --- head/sys/arm/include/pcb.h Sun Mar 9 03:00:03 2014 (r262941) +++ head/sys/arm/include/pcb.h Sun Mar 9 03:49:06 2014 (r262942) @@ -61,7 +61,6 @@ struct pcb_arm32 { u_int pcb32_sp; /* used */ u_int pcb32_lr; u_int pcb32_pc; - u_int pcb32_und_sp; }; #define pcb_pagedir un_32.pcb32_pagedir #define pcb_pl1vec un_32.pcb32_pl1vec From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 07:46:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 432933C8; Sun, 9 Mar 2014 07:46:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 232B5E8C; Sun, 9 Mar 2014 07:46:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s297k0EJ022228; Sun, 9 Mar 2014 07:46:00 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s297jxKg022227; Sun, 9 Mar 2014 07:45:59 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201403090745.s297jxKg022227@svn.freebsd.org> From: John-Mark Gurney Date: Sun, 9 Mar 2014 07:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262945 - head/lib/libcrypt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 07:46:00 -0000 Author: jmg Date: Sun Mar 9 07:45:59 2014 New Revision: 262945 URL: http://svnweb.freebsd.org/changeset/base/262945 Log: various formating fixes, use NUL for NUL bytes.. drop out dated perf numbers (can't imagine people are still running Pentium MMX 166's anymore)... bump date... drop max length of salt of 8 since _PASSWORD_LEN is now large, 128.. and state the max length of the salt depends upon the module, sha-{256,512} have a max salt of 16.. recommend 8 characters of salt instead of just 2... MFC after: 1 week Modified: head/lib/libcrypt/crypt.3 Modified: head/lib/libcrypt/crypt.3 ============================================================================== --- head/lib/libcrypt/crypt.3 Sun Mar 9 04:17:04 2014 (r262944) +++ head/lib/libcrypt/crypt.3 Sun Mar 9 07:45:59 2014 (r262945) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 9, 2011 +.Dd March 9, 2014 .Dt CRYPT 3 .Os .Sh NAME @@ -63,11 +63,16 @@ Currently these include the .Tn MD5 hash, .Tn NT-Hash -(compatible with Microsoft's NT scheme) +.Pq compatible with Microsoft's NT scheme and .Tn Blowfish . -The algorithm used will depend upon the format of the Salt (following -the Modular Crypt Format (MCF)), if +The algorithm used will depend upon the format of the Salt +.Po +following +the Modular Crypt Format +.Pq MCF +.Pc , +if .Tn DES and/or .Tn Blowfish @@ -77,8 +82,10 @@ has been called to change the default. .Pp The first argument to .Nm -is the data to hash (usually a password), in a -.Dv null Ns -terminated +is the data to hash +.Pq usually a password , +in a +.Dv NUL Ns -terminated string. The second is the salt, in one of three forms: .Pp @@ -96,22 +103,19 @@ If it begins with the string then the Modular Crypt Format is used, as outlined below. .It Traditional If neither of the above is true, it assumes the Traditional Format, -using the entire string as the salt (or the first portion). +using the entire string as the salt +.Pq or the first portion . .El .Pp All routines are designed to be time-consuming. -A brief test on a -.Tn Pentium -166/MMX shows the -.Tn DES -crypt to do approximately 2640 crypts -a CPU second and MD5 to do about 62 crypts a CPU second. .Ss DES Extended Format: The .Ar key -is divided into groups of 8 characters (the last group is null-padded) -and the low-order 7 bits of each character (56 bits per group) are -used to form the +is divided into groups of 8 characters +.Pq the last group is NUL-padded +and the low-order 7 bits of each character +.Pq 56 bits per group +are used to form the .Tn DES key as follows: the first group of 56 bits becomes the initial @@ -127,7 +131,8 @@ The salt is a 9-character array consisti by 4 bytes of iteration count and 4 bytes of salt. These are encoded as printable characters, 6 bits per character, least significant character first. -The values 0 to 63 are encoded as ``./0-9A-Za-z''. +The values 0 to 63 are encoded as +.Dq ./0-9A-Za-z . This allows 24 bits for both .Fa count and @@ -138,7 +143,8 @@ The introduces disorder in the .Tn DES algorithm in one of 16777216 or 4096 possible ways -(i.e., with 24 or 12 bits: if bit +.Po +i.e., with 24 or 12 bits: if bit .Em i of the .Ar salt @@ -148,7 +154,8 @@ and .Em i+24 are swapped in the .Tn DES -E-box output). +E-box output +.Pc . .Pp The .Tn DES @@ -157,11 +164,13 @@ key is used to encrypt a 64-bit constant iterations of .Tn DES . The value returned is a -.Dv null Ns -terminated -string, 20 or 13 bytes (plus null) in length, consisting of the +.Dv NUL Ns -terminated +string, 20 or 13 bytes +.Pq plus NUL +in length, consisting of the .Ar salt followed by the encoded 64-bit encryption. -.Ss "Modular" crypt: +.Ss Modular crypt: If the salt begins with the string .Fa $digit$ then the Modular Crypt Format is used. @@ -170,11 +179,10 @@ The represents which algorithm is used in encryption. Following the token is the actual salt to use in the encryption. -The length of the salt is limited -to 8 characters--because the length of the returned output is also limited -(_PASSWORD_LEN). -The salt must be terminated with the end of the string -(NULL) or a dollar sign. +The maximum length of the salt used depends upon the module. +The salt must be terminated with the end of the string character +.Pq NUL +or a dollar sign. Any characters after the dollar sign are ignored. .Pp Currently supported algorithms are: @@ -199,7 +207,7 @@ An example salt would be: .Bl -tag -width 6n -offset indent .It Cm "$4$thesalt$rest" .El -.Ss "Traditional" crypt: +.Ss Traditional crypt: The algorithm used will depend upon whether .Fn crypt_set_format has been called and whether a global default format has been specified. @@ -216,7 +224,7 @@ if it is available, or MD5 if not. .Pp How the salt is used will depend upon the algorithm for the hash. For -best results, specify at least two characters of salt. +best results, specify at least eight characters of salt. .Pp The .Fn crypt_get_format From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 13:19:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3F3E959; Sun, 9 Mar 2014 13:19:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C75458BB; Sun, 9 Mar 2014 13:19:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s29DJb2E055384; Sun, 9 Mar 2014 13:19:37 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29DJbIN055383; Sun, 9 Mar 2014 13:19:37 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201403091319.s29DJbIN055383@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 9 Mar 2014 13:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262946 - head/sbin/kldconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 13:19:38 -0000 Author: jilles Date: Sun Mar 9 13:19:37 2014 New Revision: 262946 URL: http://svnweb.freebsd.org/changeset/base/262946 Log: kldconfig: Remove some code for compatibility with FreeBSD 4.x. Verified using md5(1). Modified: head/sbin/kldconfig/kldconfig.c Modified: head/sbin/kldconfig/kldconfig.c ============================================================================== --- head/sbin/kldconfig/kldconfig.c Sun Mar 9 07:45:59 2014 (r262945) +++ head/sbin/kldconfig/kldconfig.c Sun Mar 9 13:19:37 2014 (r262946) @@ -40,15 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__FreeBSD_version) -#if __FreeBSD_version < 500000 -#define NEED_SLASHTERM -#endif /* < 500000 */ -#else /* defined(__FreeBSD_version) */ -/* just in case.. */ -#define NEED_SLASHTERM -#endif /* defined(__FreeBSD_version) */ - /* the default sysctl name */ #define PATHCTL "kern.module_path" @@ -163,18 +154,9 @@ addpath(struct pathhead *pathq, char *pa strlcpy(pathbuf, path, sizeof(pathbuf)); len = strlen(pathbuf); -#ifdef NEED_SLASHTERM - /* slash-terminate, because the kernel linker said so. */ - if ((len == 0) || (pathbuf[len-1] != '/')) { - if (len == sizeof(pathbuf) - 1) - errx(1, "path too long: %s", pathbuf); - pathbuf[len] = '/'; - } -#else /* NEED_SLASHTERM */ /* remove a terminating slash if present */ if ((len > 0) && (pathbuf[len-1] == '/')) pathbuf[--len] = '\0'; -#endif /* NEED_SLASHTERM */ /* is it already in there? */ TAILQ_FOREACH(pe, pathq, next) @@ -219,18 +201,9 @@ rempath(struct pathhead *pathq, char *pa strlcpy(pathbuf, path, sizeof(pathbuf)); len = strlen(pathbuf); -#ifdef NEED_SLASHTERM - /* slash-terminate, because the kernel linker said so. */ - if ((len == 0) || (pathbuf[len-1] != '/')) { - if (len == sizeof(pathbuf) - 1) - errx(1, "path too long: %s", pathbuf); - pathbuf[len] = '/'; - } -#else /* NEED_SLASHTERM */ /* remove a terminating slash if present */ if ((len > 0) && (pathbuf[len-1] == '/')) pathbuf[--len] = '\0'; -#endif /* NEED_SLASHTERM */ /* Is it in there? */ TAILQ_FOREACH(pe, pathq, next) From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 14:24:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2106614; Sun, 9 Mar 2014 14:24:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A4976DAE; Sun, 9 Mar 2014 14:24:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s29EO6W8083908; Sun, 9 Mar 2014 14:24:06 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29EO6UQ083903; Sun, 9 Mar 2014 14:24:06 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403091424.s29EO6UQ083903@svn.freebsd.org> From: Ian Lepore Date: Sun, 9 Mar 2014 14:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262948 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 14:24:06 -0000 Author: ian Date: Sun Mar 9 14:24:05 2014 New Revision: 262948 URL: http://svnweb.freebsd.org/changeset/base/262948 Log: Always call vfp_discard() on thread death, not just when the VFP is enabled. In vfp_discard(), if the state in the VFP hardware belongs to the thread which is dying, NULL out pcpu fpcurthread to indicate the state currently in the hardware belongs to nobody. Submitted by: Juergen Weiss Pointy hat to: me Modified: head/sys/arm/arm/swtch.S head/sys/arm/arm/vfp.c head/sys/arm/include/vfp.h Modified: head/sys/arm/arm/swtch.S ============================================================================== --- head/sys/arm/arm/swtch.S Sun Mar 9 13:23:49 2014 (r262947) +++ head/sys/arm/arm/swtch.S Sun Mar 9 14:24:05 2014 (r262948) @@ -124,14 +124,11 @@ ENTRY(cpu_throw) * r5 = newtd */ - GET_PCPU(r7, r9) - -#ifdef VFP - fmrx r0, fpexc /* This thread is dying, if the VFP */ - tst r0, #(VFPEXC_EN) /* is enabled, go shut it down */ - blne _C_LABEL(vfp_discard) /* without preserving its state. */ +#ifdef VFP /* This thread is dying, disable */ + bl _C_LABEL(vfp_discard) /* VFP without preserving state. */ #endif + GET_PCPU(r7, r9) ldr r7, [r5, #(TD_PCB)] /* r7 = new thread's PCB */ /* Switch to lwp0 context */ Modified: head/sys/arm/arm/vfp.c ============================================================================== --- head/sys/arm/arm/vfp.c Sun Mar 9 13:23:49 2014 (r262947) +++ head/sys/arm/arm/vfp.c Sun Mar 9 14:24:05 2014 (r262948) @@ -229,21 +229,23 @@ vfp_store(struct vfp_state *vfpsave, boo } /* - * If the VFP hardware is on, the current thread was using it but now that - * thread is dying. Turn off the VFP and set pcpu fpcurthread to 0, to indicate - * that the VFP hardware state does not belong to any thread. Called only from - * cpu_throw(), so we don't have to worry about a context switch here. + * The current thread is dying. If the state currently in the hardware belongs + * to the current thread, set fpcurthread to NULL to indicate that the VFP + * hardware state does not belong to any thread. If the VFP is on, turn it off. + * Called only from cpu_throw(), so we don't have to worry about a context + * switch here. */ void -vfp_discard() +vfp_discard(struct thread *td) { u_int tmp; + if (PCPU_GET(fpcurthread) == td) + PCPU_SET(fpcurthread, NULL); + tmp = fmrx(VFPEXC); - if (tmp & VFPEXC_EN) { + if (tmp & VFPEXC_EN) fmxr(VFPEXC, tmp & ~VFPEXC_EN); - PCPU_SET(fpcurthread, 0); - } } #endif Modified: head/sys/arm/include/vfp.h ============================================================================== --- head/sys/arm/include/vfp.h Sun Mar 9 13:23:49 2014 (r262947) +++ head/sys/arm/include/vfp.h Sun Mar 9 14:24:05 2014 (r262948) @@ -129,7 +129,7 @@ #ifndef LOCORE void vfp_init(void); void vfp_store(struct vfp_state *, boolean_t); -void vfp_discard(void); +void vfp_discard(struct thread *); #endif #endif From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 14:54:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3E793BC; Sun, 9 Mar 2014 14:54:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C0B2C173; Sun, 9 Mar 2014 14:54:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s29Es5S8000930; Sun, 9 Mar 2014 14:54:05 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29Es5We000928; Sun, 9 Mar 2014 14:54:05 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403091454.s29Es5We000928@svn.freebsd.org> From: Ian Lepore Date: Sun, 9 Mar 2014 14:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262949 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 14:54:05 -0000 Author: ian Date: Sun Mar 9 14:54:05 2014 New Revision: 262949 URL: http://svnweb.freebsd.org/changeset/base/262949 Log: When a thread begins life it doesn't own the VFP hardware state on any cpu. Modified: head/sys/arm/arm/machdep.c head/sys/arm/arm/vm_machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sun Mar 9 14:24:05 2014 (r262948) +++ head/sys/arm/arm/machdep.c Sun Mar 9 14:54:05 2014 (r262949) @@ -993,6 +993,7 @@ init_proc0(vm_offset_t kstack) thread0.td_pcb = (struct pcb *) (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; thread0.td_pcb->pcb_flags = 0; + thread0.td_pcb->pcb_vfpcpu = -1; thread0.td_frame = &proc0_tf; pcpup->pc_curpcb = thread0.td_pcb; } Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Sun Mar 9 14:24:05 2014 (r262948) +++ head/sys/arm/arm/vm_machdep.c Sun Mar 9 14:54:05 2014 (r262949) @@ -146,6 +146,7 @@ cpu_fork(register struct thread *td1, re bcopy(&td1->td_proc->p_md, mdp2, sizeof(*mdp2)); pcb2->un_32.pcb32_sp = td2->td_kstack + USPACE_SVC_STACK_TOP - sizeof(*pcb2); + pcb2->pcb_vfpcpu = -1; pmap_activate(td2); td2->td_frame = tf = (struct trapframe *)STACKALIGN( pcb2->un_32.pcb32_sp - sizeof(struct trapframe)); From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 15:36:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 041F1D34; Sun, 9 Mar 2014 15:36:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D86566C4; Sun, 9 Mar 2014 15:36:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s29Fau9f017904; Sun, 9 Mar 2014 15:36:56 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29FauAM017902; Sun, 9 Mar 2014 15:36:56 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403091536.s29FauAM017902@svn.freebsd.org> From: Ian Lepore Date: Sun, 9 Mar 2014 15:36:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262950 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 15:36:57 -0000 Author: ian Date: Sun Mar 9 15:36:56 2014 New Revision: 262950 URL: http://svnweb.freebsd.org/changeset/base/262950 Log: Make undefined exception entry MPSAFE. The old code used static storage to preserve a couple registers while setting up the trapframe for the main handler. Doing so was the last leftover crumbs from the days when a low-level debugger was hooked into the exception entry code. Now the exception entry sequence is essentially the same as for the other exceptions, which still involves needlessly indirecting through a function pointer which points to the same code on every platform. Removing that indirection will be handled as a separate cleanup. This work is based on an analysis by Juergen Weiss. Modified: head/sys/arm/arm/exception.S head/sys/arm/arm/undefined.c Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Sun Mar 9 14:54:05 2014 (r262949) +++ head/sys/arm/arm/exception.S Sun Mar 9 15:36:56 2014 (r262950) @@ -218,46 +218,25 @@ END(exception_exit) * look like direct entry from the vector. */ ASENTRY_NP(undefined_entry) - stmfd sp!, {r0, r1} - ldr r0, Lundefined_handler_indirection - ldr r1, [sp], #0x0004 - str r1, [r0, #0x0000] - ldr r1, [sp], #0x0004 - str r1, [r0, #0x0004] - ldmia r0, {r0, r1, pc} - -Lundefined_handler_indirection: - .word Lundefined_handler_indirection_data + sub lr, lr, #0x00000004 /* Adjust the lr */ + PUSHFRAMEINSVC /* Push trap frame and switch */ + /* to SVC32 mode */ + ldr r1, Lundefined_handler_address + adr lr, exception_exit + mov r0, sp /* pass the stack pointer as r0 */ + ldr pc, [r1] END(undefined_entry) -/* - * assembly bounce code for calling the kernel - * undefined instruction handler. This uses - * a standard trap frame and is called in SVC mode. - */ - -ENTRY_NP(undefinedinstruction_bounce) - PUSHFRAMEINSVC +ASENTRY_NP(undefinedinstruction_bounce) + b undefinedinstruction +END(undefinedinstruction_bounce) - mov r0, sp - adr lr, exception_exit - b _C_LABEL(undefinedinstruction) +Lundefined_handler_address: + .word _C_LABEL(undefined_handler_address) .data - .align 0 - -/* - * Indirection data - * 2 words use for preserving r0 and r1 - * 3rd word contains the undefined handler address. - */ - -Lundefined_handler_indirection_data: - .word 0 - .word 0 - .global _C_LABEL(undefined_handler_address) _C_LABEL(undefined_handler_address): - .word _C_LABEL(undefinedinstruction_bounce) -END(undefinedinstruction_bounce) + .word undefinedinstruction_bounce + Modified: head/sys/arm/arm/undefined.c ============================================================================== --- head/sys/arm/arm/undefined.c Sun Mar 9 14:54:05 2014 (r262949) +++ head/sys/arm/arm/undefined.c Sun Mar 9 15:36:56 2014 (r262950) @@ -183,7 +183,6 @@ undefinedinstruction(struct trapframe *f if (!(frame->tf_spsr & I32_bit)) enable_interrupts(I32_bit|F32_bit); - frame->tf_pc -= INSN_SIZE; PCPU_INC(cnt.v_trap); fault_pc = frame->tf_pc; From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 18:08:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9C26E5F; Sun, 9 Mar 2014 18:08:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D50423B7; Sun, 9 Mar 2014 18:08:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s29I8T3e080629; Sun, 9 Mar 2014 18:08:29 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29I8RIa080617; Sun, 9 Mar 2014 18:08:27 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403091808.s29I8RIa080617@svn.freebsd.org> From: Ian Lepore Date: Sun, 9 Mar 2014 18:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262952 - in head/sys/arm: arm at91 econa s3c2xx0 sa11x0 xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 18:08:30 -0000 Author: ian Date: Sun Mar 9 18:08:27 2014 New Revision: 262952 URL: http://svnweb.freebsd.org/changeset/base/262952 Log: The arm exception entry points currently vector through a function pointer to the actual handler routine. All the pointers are static-intialized to the only handlers available, and yet various platform-specific inits still set those pointers (to the values they're already initialized to). Begin to drain the swamp by removing all the redundant external declarations and runtime setting of the pointers that's scattered around various places. Modified: head/sys/arm/arm/machdep.c head/sys/arm/arm/trap.c head/sys/arm/at91/at91_machdep.c head/sys/arm/econa/econa_machdep.c head/sys/arm/s3c2xx0/s3c24x0_machdep.c head/sys/arm/sa11x0/assabet_machdep.c head/sys/arm/xscale/i80321/ep80219_machdep.c head/sys/arm/xscale/i80321/iq31244_machdep.c head/sys/arm/xscale/i8134x/crb_machdep.c head/sys/arm/xscale/ixp425/avila_machdep.c head/sys/arm/xscale/pxa/pxa_machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sun Mar 9 17:04:31 2014 (r262951) +++ head/sys/arm/arm/machdep.c Sun Mar 9 18:08:27 2014 (r262952) @@ -143,10 +143,6 @@ extern vm_offset_t ksym_start, ksym_end; static struct pv_addr kernel_pt_table[KERNEL_PT_MAX]; -extern u_int data_abort_handler_address; -extern u_int prefetch_abort_handler_address; -extern u_int undefined_handler_address; - vm_paddr_t pmap_pa; struct pv_addr systempage; @@ -1279,10 +1275,6 @@ initarm(struct arm_boot_params *abp) */ cpu_idcache_wbinv_all(); - /* Set stack for exception handlers */ - data_abort_handler_address = (u_int)data_abort_handler; - prefetch_abort_handler_address = (u_int)prefetch_abort_handler; - undefined_handler_address = (u_int)undefinedinstruction_bounce; undefined_init(); init_proc0(kernelstack.pv_va); Modified: head/sys/arm/arm/trap.c ============================================================================== --- head/sys/arm/arm/trap.c Sun Mar 9 17:04:31 2014 (r262951) +++ head/sys/arm/arm/trap.c Sun Mar 9 18:08:27 2014 (r262952) @@ -126,7 +126,6 @@ __FBSDID("$FreeBSD$"); void swi_handler(struct trapframe *); -void undefinedinstruction(struct trapframe *); #include #include Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Sun Mar 9 17:04:31 2014 (r262951) +++ head/sys/arm/at91/at91_machdep.c Sun Mar 9 18:08:27 2014 (r262952) @@ -111,10 +111,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -extern u_int data_abort_handler_address; -extern u_int prefetch_abort_handler_address; -extern u_int undefined_handler_address; - struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; /* Static device mappings. */ @@ -621,11 +617,6 @@ initarm(struct arm_boot_params *abp) */ cpu_idcache_wbinv_all(); - /* Set stack for exception handlers */ - - data_abort_handler_address = (u_int)data_abort_handler; - prefetch_abort_handler_address = (u_int)prefetch_abort_handler; - undefined_handler_address = (u_int)undefinedinstruction_bounce; undefined_init(); init_proc0(kernelstack.pv_va); Modified: head/sys/arm/econa/econa_machdep.c ============================================================================== --- head/sys/arm/econa/econa_machdep.c Sun Mar 9 17:04:31 2014 (r262951) +++ head/sys/arm/econa/econa_machdep.c Sun Mar 9 18:08:27 2014 (r262952) @@ -91,10 +91,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -extern u_int data_abort_handler_address; -extern u_int prefetch_abort_handler_address; -extern u_int undefined_handler_address; - struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; /* Physical and virtual addresses for some global pages */ @@ -309,10 +305,6 @@ initarm(struct arm_boot_params *abp) cpu_idcache_wbinv_all(); cpu_setup(""); - /* Set stack for exception handlers */ - data_abort_handler_address = (u_int)data_abort_handler; - prefetch_abort_handler_address = (u_int)prefetch_abort_handler; - undefined_handler_address = (u_int)undefinedinstruction_bounce; undefined_init(); init_proc0(kernelstack.pv_va); Modified: head/sys/arm/s3c2xx0/s3c24x0_machdep.c ============================================================================== --- head/sys/arm/s3c2xx0/s3c24x0_machdep.c Sun Mar 9 17:04:31 2014 (r262951) +++ head/sys/arm/s3c2xx0/s3c24x0_machdep.c Sun Mar 9 18:08:27 2014 (r262952) @@ -106,10 +106,6 @@ __FBSDID("$FreeBSD$"); extern int s3c2410_pclk; -extern u_int data_abort_handler_address; -extern u_int prefetch_abort_handler_address; -extern u_int undefined_handler_address; - struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; /* Physical and virtual addresses for some global pages */ @@ -372,10 +368,6 @@ initarm(struct arm_boot_params *abp) } cninit(); - /* Set stack for exception handlers */ - data_abort_handler_address = (u_int)data_abort_handler; - prefetch_abort_handler_address = (u_int)prefetch_abort_handler; - undefined_handler_address = (u_int)undefinedinstruction_bounce; undefined_init(); init_proc0(kernelstack.pv_va); Modified: head/sys/arm/sa11x0/assabet_machdep.c ============================================================================== --- head/sys/arm/sa11x0/assabet_machdep.c Sun Mar 9 17:04:31 2014 (r262951) +++ head/sys/arm/sa11x0/assabet_machdep.c Sun Mar 9 18:08:27 2014 (r262952) @@ -109,10 +109,6 @@ __FBSDID("$FreeBSD$"); #define KERNEL_VM_BASE (KERNBASE + 0x00100000) #define KERNEL_VM_SIZE 0x05000000 -extern u_int data_abort_handler_address; -extern u_int prefetch_abort_handler_address; -extern u_int undefined_handler_address; - struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; extern vm_offset_t sa1110_uart_vaddr; @@ -329,9 +325,6 @@ initarm(struct arm_boot_params *abp) pmap_map_chunk(l1pagetable, sa1_cache_clean_addr, 0xf0000000, CPU_SA110_CACHE_CLEAN_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - data_abort_handler_address = (u_int)data_abort_handler; - prefetch_abort_handler_address = (u_int)prefetch_abort_handler; - undefined_handler_address = (u_int)undefinedinstruction_bounce; undefined_init(); cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT); setttb(kernel_l1pt.pv_pa); Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/ep80219_machdep.c Sun Mar 9 17:04:31 2014 (r262951) +++ head/sys/arm/xscale/i80321/ep80219_machdep.c Sun Mar 9 18:08:27 2014 (r262952) @@ -103,10 +103,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -extern u_int data_abort_handler_address; -extern u_int prefetch_abort_handler_address; -extern u_int undefined_handler_address; - struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; /* Physical and virtual addresses for some global pages */ @@ -321,11 +317,6 @@ initarm(struct arm_boot_params *abp) physmem = memsize / PAGE_SIZE; cninit(); - /* Set stack for exception handlers */ - - data_abort_handler_address = (u_int)data_abort_handler; - prefetch_abort_handler_address = (u_int)prefetch_abort_handler; - undefined_handler_address = (u_int)undefinedinstruction_bounce; undefined_init(); init_proc0(kernelstack.pv_va); Modified: head/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/iq31244_machdep.c Sun Mar 9 17:04:31 2014 (r262951) +++ head/sys/arm/xscale/i80321/iq31244_machdep.c Sun Mar 9 18:08:27 2014 (r262952) @@ -103,10 +103,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -extern u_int data_abort_handler_address; -extern u_int prefetch_abort_handler_address; -extern u_int undefined_handler_address; - struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; /* Physical and virtual addresses for some global pages */ @@ -322,11 +318,6 @@ initarm(struct arm_boot_params *abp) physmem = memsize / PAGE_SIZE; cninit(); - /* Set stack for exception handlers */ - - data_abort_handler_address = (u_int)data_abort_handler; - prefetch_abort_handler_address = (u_int)prefetch_abort_handler; - undefined_handler_address = (u_int)undefinedinstruction_bounce; undefined_init(); init_proc0(kernelstack.pv_va); Modified: head/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- head/sys/arm/xscale/i8134x/crb_machdep.c Sun Mar 9 17:04:31 2014 (r262951) +++ head/sys/arm/xscale/i8134x/crb_machdep.c Sun Mar 9 18:08:27 2014 (r262952) @@ -106,10 +106,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -extern u_int data_abort_handler_address; -extern u_int prefetch_abort_handler_address; -extern u_int undefined_handler_address; - struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; /* Physical and virtual addresses for some global pages */ @@ -302,9 +298,6 @@ initarm(struct arm_boot_params *abp) cninit(); /* Set stack for exception handlers */ - data_abort_handler_address = (u_int)data_abort_handler; - prefetch_abort_handler_address = (u_int)prefetch_abort_handler; - undefined_handler_address = (u_int)undefinedinstruction_bounce; undefined_init(); init_proc0(kernelstack.pv_va); Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Sun Mar 9 17:04:31 2014 (r262951) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Sun Mar 9 18:08:27 2014 (r262952) @@ -102,10 +102,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -extern u_int data_abort_handler_address; -extern u_int prefetch_abort_handler_address; -extern u_int undefined_handler_address; - struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; /* Physical and virtual addresses for some global pages */ @@ -393,11 +389,6 @@ initarm(struct arm_boot_params *abp) else memsize = ixp425_sdram_size(); - /* Set stack for exception handlers */ - - data_abort_handler_address = (u_int)data_abort_handler; - prefetch_abort_handler_address = (u_int)prefetch_abort_handler; - undefined_handler_address = (u_int)undefinedinstruction_bounce; undefined_init(); init_proc0(kernelstack.pv_va); Modified: head/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_machdep.c Sun Mar 9 17:04:31 2014 (r262951) +++ head/sys/arm/xscale/pxa/pxa_machdep.c Sun Mar 9 18:08:27 2014 (r262952) @@ -103,10 +103,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -extern u_int data_abort_handler_address; -extern u_int prefetch_abort_handler_address; -extern u_int undefined_handler_address; - struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; /* Physical and virtual addresses for some global pages */ @@ -311,10 +307,6 @@ initarm(struct arm_boot_params *abp) /* Fire up consoles. */ cninit(); - /* Set stack for exception handlers */ - data_abort_handler_address = (u_int)data_abort_handler; - prefetch_abort_handler_address = (u_int)prefetch_abort_handler; - undefined_handler_address = (u_int)undefinedinstruction_bounce; undefined_init(); init_proc0(kernelstack.pv_va); From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 19:25:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B99CEA06; Sun, 9 Mar 2014 19:25:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8D883C02; Sun, 9 Mar 2014 19:25:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s29JPsbw013535; Sun, 9 Mar 2014 19:25:54 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29JPrhv013532; Sun, 9 Mar 2014 19:25:53 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403091925.s29JPrhv013532@svn.freebsd.org> From: Julio Merino Date: Sun, 9 Mar 2014 19:25:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262953 - head/tools/regression/usr.bin/m4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 19:25:54 -0000 Author: jmmv Date: Sun Mar 9 19:25:53 2014 New Revision: 262953 URL: http://svnweb.freebsd.org/changeset/base/262953 Log: Fix m4 tests so that they run cleanly with prove. Modified: head/tools/regression/usr.bin/m4/regress.gnusofterror.out head/tools/regression/usr.bin/m4/regress.sh head/tools/regression/usr.bin/m4/regress.t Modified: head/tools/regression/usr.bin/m4/regress.gnusofterror.out ============================================================================== --- head/tools/regression/usr.bin/m4/regress.gnusofterror.out Sun Mar 9 18:08:27 2014 (r262952) +++ head/tools/regression/usr.bin/m4/regress.gnusofterror.out Sun Mar 9 19:25:53 2014 (r262953) @@ -1 +1,2 @@ +m4: gnusofterror.m4 at line 3: include(hey I do not exit): No such file or directory abc Modified: head/tools/regression/usr.bin/m4/regress.sh ============================================================================== --- head/tools/regression/usr.bin/m4/regress.sh Sun Mar 9 18:08:27 2014 (r262952) +++ head/tools/regression/usr.bin/m4/regress.sh Sun Mar 9 19:25:53 2014 (r262953) @@ -2,7 +2,7 @@ LC_ALL=C; export LC_ALL -echo 1..22 +echo 1..21 REGRESSION_START($1) @@ -17,7 +17,7 @@ REGRESSION_TEST(`gnuformat', `m4 -g gnuf REGRESSION_TEST(`gnupatterns', `m4 -g gnupatterns.m4') REGRESSION_TEST(`gnupatterns2', `m4 -g gnupatterns2.m4') REGRESSION_TEST(`gnuprefix', `m4 -P gnuprefix.m4 2>&1') -REGRESSION_TEST(`gnusofterror', `m4 -g gnusofterror.m4') +REGRESSION_TEST(`gnusofterror', `m4 -g gnusofterror.m4 2>&1') REGRESSION_TEST(`gnutranslit2', `m4 -g translit2.m4') REGRESSION_TEST(`includes', `m4 -I. includes.m4') REGRESSION_TEST(`m4wrap3', `m4 m4wrap3.m4') Modified: head/tools/regression/usr.bin/m4/regress.t ============================================================================== --- head/tools/regression/usr.bin/m4/regress.t Sun Mar 9 18:08:27 2014 (r262952) +++ head/tools/regression/usr.bin/m4/regress.t Sun Mar 9 19:25:53 2014 (r262953) @@ -3,4 +3,4 @@ cd `dirname $0` -sh regress.sh +m4 ../regress.m4 regress.sh | sh From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 19:37:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2888AD10; Sun, 9 Mar 2014 19:37:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 15D0BCBF; Sun, 9 Mar 2014 19:37:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s29Jb1ET017792; Sun, 9 Mar 2014 19:37:01 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29Jb1hm017791; Sun, 9 Mar 2014 19:37:01 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403091937.s29Jb1hm017791@svn.freebsd.org> From: Julio Merino Date: Sun, 9 Mar 2014 19:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262954 - head/tools/regression/usr.bin/printf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 19:37:02 -0000 Author: jmmv Date: Sun Mar 9 19:37:01 2014 New Revision: 262954 URL: http://svnweb.freebsd.org/changeset/base/262954 Log: Fix printf tests so that they run cleanly with prove. Modified: head/tools/regression/usr.bin/printf/regress.sh Modified: head/tools/regression/usr.bin/printf/regress.sh ============================================================================== --- head/tools/regression/usr.bin/printf/regress.sh Sun Mar 9 19:25:53 2014 (r262953) +++ head/tools/regression/usr.bin/printf/regress.sh Sun Mar 9 19:37:01 2014 (r262954) @@ -2,7 +2,7 @@ REGRESSION_START($1) -echo '1..12' +echo '1..15' REGRESSION_TEST(`b', `printf "abc%b%b" "def\n" "\cghi"') REGRESSION_TEST(`d', `printf "%d,%5d,%.5d,%0*d,%.*d\n" 123 123 123 5 123 5 123') From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 20:51:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DC3AE8; Sun, 9 Mar 2014 20:51:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2AB2434E; Sun, 9 Mar 2014 20:51:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s29KpFCn051036; Sun, 9 Mar 2014 20:51:15 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29KpEkS051035; Sun, 9 Mar 2014 20:51:14 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403092051.s29KpEkS051035@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 9 Mar 2014 20:51:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262955 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 20:51:15 -0000 Author: marcel Date: Sun Mar 9 20:51:14 2014 New Revision: 262955 URL: http://svnweb.freebsd.org/changeset/base/262955 Log: Add 3wire and std as terminal types/classes. These are similar to the existing terminal types/classes that have the baudrate suffix, but differ in that no baudrate is set/defined. The purpose of these new types/classes is to allow them to be used for the serial console. Currently the uart(4) driver fixates the baudrate and the CLOCAL flag, which means that it doesn't matter whether you give it std. or 3wire. as the terminal type to getty and what exactly is set to. It's being overridden by uart(4). The goal is to change uart(4) not to override these settings. Modified: head/etc/gettytab Modified: head/etc/gettytab ============================================================================== --- head/etc/gettytab Sun Mar 9 19:37:01 2014 (r262954) +++ head/etc/gettytab Sun Mar 9 20:51:14 2014 (r262955) @@ -49,6 +49,8 @@ default:\ # autobaud code in getty, and likewise can # be assigned to any table desired (hopefully the same speed). # +std:\ + :np:sp#0: a|std.110|110-baud:\ :np:nd#1:cd#1:uc:sp#110: b|std.134|134.5-baud:\ @@ -221,6 +223,8 @@ al.Pc:\ # Entries for 3-wire serial terminals. These don't supply carrier, so # clocal needs to be set, and crtscts needs to be unset. # +3wire:\ + :np:nc:sp#0: 3wire.9600|9600-3wire:\ :np:nc:sp#9600: 3wire.19200|19200-3wire:\ From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 21:06:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DCAA5658; Sun, 9 Mar 2014 21:06:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BCA1A63E; Sun, 9 Mar 2014 21:06:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s29L6N30056322; Sun, 9 Mar 2014 21:06:23 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29L6M3D056313; Sun, 9 Mar 2014 21:06:22 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403092106.s29L6M3D056313@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 9 Mar 2014 21:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262957 - in head/etc: etc.arm etc.ia64 etc.mips etc.powerpc etc.sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 21:06:23 -0000 Author: marcel Date: Sun Mar 9 21:06:22 2014 New Revision: 262957 URL: http://svnweb.freebsd.org/changeset/base/262957 Log: Change the terminal type/class for enabled serial lines to 3wire. This allows us to change the uart(4) driver to not hardcode specific line settings for the serial console. A terminal type of 3wire makes sure the console still works when no DCD signal is present, which preserves behviour. When it is known that the terminal server (or DCE in general) provides DCD, a terminal type/class of std can be used. This has the effect of being logged out when one disconnects from the console -- improving security overall. Likewise, when uart(4) does not fixate the baudrate, one can change the terminal type/class to set a specific baudrate. An operator can use this to change the console speed mid-flight, without needing a reboot. Of course it helps in this respect if and when the firmware can be configured from the OS. The above mentioned capabilities depend on uart(4) being changed, which is to happen next. Modified: head/etc/etc.arm/ttys head/etc/etc.ia64/ttys head/etc/etc.mips/ttys head/etc/etc.powerpc/ttys head/etc/etc.sparc64/ttys Modified: head/etc/etc.arm/ttys ============================================================================== --- head/etc/etc.arm/ttys Sun Mar 9 21:02:23 2014 (r262956) +++ head/etc/etc.arm/ttys Sun Mar 9 21:06:22 2014 (r262957) @@ -41,7 +41,7 @@ ttyv7 "/usr/libexec/getty Pc" xterm off #ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty std.9600" vt100 on secure +ttyu0 "/usr/libexec/getty 3wire" vt100 on secure ttyu1 "/usr/libexec/getty std.9600" dialup off secure ttyu2 "/usr/libexec/getty std.9600" dialup off secure ttyu3 "/usr/libexec/getty std.9600" dialup off secure Modified: head/etc/etc.ia64/ttys ============================================================================== --- head/etc/etc.ia64/ttys Sun Mar 9 21:02:23 2014 (r262956) +++ head/etc/etc.ia64/ttys Sun Mar 9 21:06:22 2014 (r262957) @@ -41,8 +41,8 @@ ttyv7 "/usr/libexec/getty Pc" xterm off ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals. The 'dialup' keyword identifies dialin lines to login, # fingerd etc. -ttyu0 "/usr/libexec/getty std.9600" vt100 on secure -ttyu1 "/usr/libexec/getty std.9600" vt100 on secure +ttyu0 "/usr/libexec/getty 3wire" vt100 on secure +ttyu1 "/usr/libexec/getty 3wire" vt100 on secure ttyu2 "/usr/libexec/getty std.9600" dialup off secure ttyu3 "/usr/libexec/getty std.9600" dialup off secure # Dumb console Modified: head/etc/etc.mips/ttys ============================================================================== --- head/etc/etc.mips/ttys Sun Mar 9 21:02:23 2014 (r262956) +++ head/etc/etc.mips/ttys Sun Mar 9 21:06:22 2014 (r262957) @@ -30,7 +30,7 @@ console none unknown off secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty std.115200" dialup on secure +ttyu0 "/usr/libexec/getty 3wire" vt100 on secure ttyu1 "/usr/libexec/getty std.115200" dialup off secure ttyu2 "/usr/libexec/getty std.115200" dialup off secure ttyu3 "/usr/libexec/getty std.115200" dialup off secure Modified: head/etc/etc.powerpc/ttys ============================================================================== --- head/etc/etc.powerpc/ttys Sun Mar 9 21:02:23 2014 (r262956) +++ head/etc/etc.powerpc/ttys Sun Mar 9 21:06:22 2014 (r262957) @@ -41,7 +41,7 @@ ttyv7 "/usr/libexec/getty Pc" xterm on #ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty std.9600" vt100 on secure +ttyu0 "/usr/libexec/getty 3wire" vt100 on secure ttyu1 "/usr/libexec/getty std.9600" dialup off secure ttyu2 "/usr/libexec/getty std.9600" dialup off secure ttyu3 "/usr/libexec/getty std.9600" dialup off secure Modified: head/etc/etc.sparc64/ttys ============================================================================== --- head/etc/etc.sparc64/ttys Sun Mar 9 21:02:23 2014 (r262956) +++ head/etc/etc.sparc64/ttys Sun Mar 9 21:06:22 2014 (r262957) @@ -46,9 +46,9 @@ ttyv8 "/usr/local/bin/xdm -nodaemon" xte # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. # uart(4) -ttyu0 "/usr/libexec/getty std.9600" vt100 on secure -ttyu1 "/usr/libexec/getty std.9600" vt100 on secure -ttyu2 "/usr/libexec/getty std.9600" vt100 on secure +ttyu0 "/usr/libexec/getty 3wire" vt100 on secure +ttyu1 "/usr/libexec/getty 3wire" vt100 on secure +ttyu2 "/usr/libexec/getty 3wire" vt100 on secure ttyu3 "/usr/libexec/getty std.9600" vt100 off secure # Dumb console dcons "/usr/libexec/getty std.9600" vt100 off secure From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 21:12:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6D7D8F4; Sun, 9 Mar 2014 21:12:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A67226EA; Sun, 9 Mar 2014 21:12:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s29LCVLW059935; Sun, 9 Mar 2014 21:12:31 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29LCVAA059934; Sun, 9 Mar 2014 21:12:31 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403092112.s29LCVAA059934@svn.freebsd.org> From: Ian Lepore Date: Sun, 9 Mar 2014 21:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262958 - in head/sys: arm/arm arm/conf arm/include arm/sa11x0 arm/xscale/pxa conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 21:12:31 -0000 Author: ian Date: Sun Mar 9 21:12:31 2014 New Revision: 262958 URL: http://svnweb.freebsd.org/changeset/base/262958 Log: Remove all traces of support for ARM chips prior to the arm9 series. We never actually ran on these chips (other than using SA1 support in an emulator to do the early porting to FreeBSD long long ago). The clutter and complexity of some of this code keeps getting in the way of other maintenance, so it's time to go. Deleted: head/sys/arm/arm/cpufunc_asm_arm7tdmi.S head/sys/arm/arm/cpufunc_asm_arm8.S head/sys/arm/arm/cpufunc_asm_ixp12x0.S head/sys/arm/arm/cpufunc_asm_sa1.S head/sys/arm/arm/cpufunc_asm_sa11x0.S head/sys/arm/conf/SIMICS head/sys/arm/sa11x0/ Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/arm/elf_trampoline.c head/sys/arm/arm/identcpu.c head/sys/arm/arm/pmap.c head/sys/arm/arm/trap.c head/sys/arm/conf/NOTES head/sys/arm/include/armreg.h head/sys/arm/include/cpuconf.h head/sys/arm/include/cpufunc.h head/sys/arm/include/md_var.h head/sys/arm/include/param.h head/sys/arm/include/pmap.h head/sys/arm/xscale/pxa/pxareg.h head/sys/conf/Makefile.arm head/sys/conf/files.arm head/sys/conf/options.arm Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Sun Mar 9 21:06:22 2014 (r262957) +++ head/sys/arm/arm/cpufunc.c Sun Mar 9 21:12:31 2014 (r262958) @@ -1,9 +1,6 @@ /* $NetBSD: cpufunc.c,v 1.65 2003/11/05 12:53:15 scw Exp $ */ /*- - * arm7tdmi support code Copyright (c) 2001 John Fremlin - * arm8 support code Copyright (c) 1997 ARM Limited - * arm8 support code Copyright (c) 1997 Causality Limited * arm9 support code Copyright (C) 2001 ARM Ltd * Copyright (c) 1997 Mark Brinicombe. * Copyright (c) 1997 Causality Limited @@ -112,131 +109,6 @@ u_int arm_cache_loc; int cpu_do_powersave; int ctrl; -#ifdef CPU_ARM7TDMI -struct cpu_functions arm7tdmi_cpufuncs = { - /* CPU functions */ - - cpufunc_id, /* id */ - cpufunc_nullop, /* cpwait */ - - /* MMU functions */ - - cpufunc_control, /* control */ - cpufunc_domains, /* domain */ - arm7tdmi_setttb, /* setttb */ - cpufunc_faultstatus, /* faultstatus */ - cpufunc_faultaddress, /* faultaddress */ - - /* TLB functions */ - - arm7tdmi_tlb_flushID, /* tlb_flushID */ - arm7tdmi_tlb_flushID_SE, /* tlb_flushID_SE */ - arm7tdmi_tlb_flushID, /* tlb_flushI */ - arm7tdmi_tlb_flushID_SE, /* tlb_flushI_SE */ - arm7tdmi_tlb_flushID, /* tlb_flushD */ - arm7tdmi_tlb_flushID_SE, /* tlb_flushD_SE */ - - /* Cache operations */ - - cpufunc_nullop, /* icache_sync_all */ - (void *)cpufunc_nullop, /* icache_sync_range */ - - arm7tdmi_cache_flushID, /* dcache_wbinv_all */ - (void *)arm7tdmi_cache_flushID, /* dcache_wbinv_range */ - (void *)arm7tdmi_cache_flushID, /* dcache_inv_range */ - (void *)cpufunc_nullop, /* dcache_wb_range */ - - cpufunc_nullop, /* idcache_inv_all */ - arm7tdmi_cache_flushID, /* idcache_wbinv_all */ - (void *)arm7tdmi_cache_flushID, /* idcache_wbinv_range */ - cpufunc_nullop, /* l2cache_wbinv_all */ - (void *)cpufunc_nullop, /* l2cache_wbinv_range */ - (void *)cpufunc_nullop, /* l2cache_inv_range */ - (void *)cpufunc_nullop, /* l2cache_wb_range */ - - /* Other functions */ - - cpufunc_nullop, /* flush_prefetchbuf */ - cpufunc_nullop, /* drain_writebuf */ - cpufunc_nullop, /* flush_brnchtgt_C */ - (void *)cpufunc_nullop, /* flush_brnchtgt_E */ - - (void *)cpufunc_nullop, /* sleep */ - - /* Soft functions */ - - late_abort_fixup, /* dataabt_fixup */ - cpufunc_null_fixup, /* prefetchabt_fixup */ - - arm7tdmi_context_switch, /* context_switch */ - - arm7tdmi_setup /* cpu setup */ - -}; -#endif /* CPU_ARM7TDMI */ - -#ifdef CPU_ARM8 -struct cpu_functions arm8_cpufuncs = { - /* CPU functions */ - - cpufunc_id, /* id */ - cpufunc_nullop, /* cpwait */ - - /* MMU functions */ - - cpufunc_control, /* control */ - cpufunc_domains, /* domain */ - arm8_setttb, /* setttb */ - cpufunc_faultstatus, /* faultstatus */ - cpufunc_faultaddress, /* faultaddress */ - - /* TLB functions */ - - arm8_tlb_flushID, /* tlb_flushID */ - arm8_tlb_flushID_SE, /* tlb_flushID_SE */ - arm8_tlb_flushID, /* tlb_flushI */ - arm8_tlb_flushID_SE, /* tlb_flushI_SE */ - arm8_tlb_flushID, /* tlb_flushD */ - arm8_tlb_flushID_SE, /* tlb_flushD_SE */ - - /* Cache operations */ - - cpufunc_nullop, /* icache_sync_all */ - (void *)cpufunc_nullop, /* icache_sync_range */ - - arm8_cache_purgeID, /* dcache_wbinv_all */ - (void *)arm8_cache_purgeID, /* dcache_wbinv_range */ -/*XXX*/ (void *)arm8_cache_purgeID, /* dcache_inv_range */ - (void *)arm8_cache_cleanID, /* dcache_wb_range */ - - cpufunc_nullop, /* idcache_inv_all */ - arm8_cache_purgeID, /* idcache_wbinv_all */ - (void *)arm8_cache_purgeID, /* idcache_wbinv_range */ - cpufunc_nullop, /* l2cache_wbinv_all */ - (void *)cpufunc_nullop, /* l2cache_wbinv_range */ - (void *)cpufunc_nullop, /* l2cache_inv_range */ - (void *)cpufunc_nullop, /* l2cache_wb_range */ - - /* Other functions */ - - cpufunc_nullop, /* flush_prefetchbuf */ - cpufunc_nullop, /* drain_writebuf */ - cpufunc_nullop, /* flush_brnchtgt_C */ - (void *)cpufunc_nullop, /* flush_brnchtgt_E */ - - (void *)cpufunc_nullop, /* sleep */ - - /* Soft functions */ - - cpufunc_null_fixup, /* dataabt_fixup */ - cpufunc_null_fixup, /* prefetchabt_fixup */ - - arm8_context_switch, /* context_switch */ - - arm8_setup /* cpu setup */ -}; -#endif /* CPU_ARM8 */ - #ifdef CPU_ARM9 struct cpu_functions arm9_cpufuncs = { /* CPU functions */ @@ -550,192 +422,6 @@ struct cpu_functions pj4bv7_cpufuncs = { }; #endif /* CPU_MV_PJ4B */ -#ifdef CPU_SA110 -struct cpu_functions sa110_cpufuncs = { - /* CPU functions */ - - cpufunc_id, /* id */ - cpufunc_nullop, /* cpwait */ - - /* MMU functions */ - - cpufunc_control, /* control */ - cpufunc_domains, /* domain */ - sa1_setttb, /* setttb */ - cpufunc_faultstatus, /* faultstatus */ - cpufunc_faultaddress, /* faultaddress */ - - /* TLB functions */ - - armv4_tlb_flushID, /* tlb_flushID */ - sa1_tlb_flushID_SE, /* tlb_flushID_SE */ - armv4_tlb_flushI, /* tlb_flushI */ - (void *)armv4_tlb_flushI, /* tlb_flushI_SE */ - armv4_tlb_flushD, /* tlb_flushD */ - armv4_tlb_flushD_SE, /* tlb_flushD_SE */ - - /* Cache operations */ - - sa1_cache_syncI, /* icache_sync_all */ - sa1_cache_syncI_rng, /* icache_sync_range */ - - sa1_cache_purgeD, /* dcache_wbinv_all */ - sa1_cache_purgeD_rng, /* dcache_wbinv_range */ -/*XXX*/ sa1_cache_purgeD_rng, /* dcache_inv_range */ - sa1_cache_cleanD_rng, /* dcache_wb_range */ - - sa1_cache_flushID, /* idcache_inv_all */ - sa1_cache_purgeID, /* idcache_wbinv_all */ - sa1_cache_purgeID_rng, /* idcache_wbinv_range */ - cpufunc_nullop, /* l2cache_wbinv_all */ - (void *)cpufunc_nullop, /* l2cache_wbinv_range */ - (void *)cpufunc_nullop, /* l2cache_inv_range */ - (void *)cpufunc_nullop, /* l2cache_wb_range */ - - /* Other functions */ - - cpufunc_nullop, /* flush_prefetchbuf */ - armv4_drain_writebuf, /* drain_writebuf */ - cpufunc_nullop, /* flush_brnchtgt_C */ - (void *)cpufunc_nullop, /* flush_brnchtgt_E */ - - (void *)cpufunc_nullop, /* sleep */ - - /* Soft functions */ - - cpufunc_null_fixup, /* dataabt_fixup */ - cpufunc_null_fixup, /* prefetchabt_fixup */ - - sa110_context_switch, /* context_switch */ - - sa110_setup /* cpu setup */ -}; -#endif /* CPU_SA110 */ - -#if defined(CPU_SA1100) || defined(CPU_SA1110) -struct cpu_functions sa11x0_cpufuncs = { - /* CPU functions */ - - cpufunc_id, /* id */ - cpufunc_nullop, /* cpwait */ - - /* MMU functions */ - - cpufunc_control, /* control */ - cpufunc_domains, /* domain */ - sa1_setttb, /* setttb */ - cpufunc_faultstatus, /* faultstatus */ - cpufunc_faultaddress, /* faultaddress */ - - /* TLB functions */ - - armv4_tlb_flushID, /* tlb_flushID */ - sa1_tlb_flushID_SE, /* tlb_flushID_SE */ - armv4_tlb_flushI, /* tlb_flushI */ - (void *)armv4_tlb_flushI, /* tlb_flushI_SE */ - armv4_tlb_flushD, /* tlb_flushD */ - armv4_tlb_flushD_SE, /* tlb_flushD_SE */ - - /* Cache operations */ - - sa1_cache_syncI, /* icache_sync_all */ - sa1_cache_syncI_rng, /* icache_sync_range */ - - sa1_cache_purgeD, /* dcache_wbinv_all */ - sa1_cache_purgeD_rng, /* dcache_wbinv_range */ -/*XXX*/ sa1_cache_purgeD_rng, /* dcache_inv_range */ - sa1_cache_cleanD_rng, /* dcache_wb_range */ - - sa1_cache_flushID, /* idcache_inv_all */ - sa1_cache_purgeID, /* idcache_wbinv_all */ - sa1_cache_purgeID_rng, /* idcache_wbinv_range */ - cpufunc_nullop, /* l2cache_wbinv_all */ - (void *)cpufunc_nullop, /* l2cache_wbinv_range */ - (void *)cpufunc_nullop, /* l2cache_inv_range */ - (void *)cpufunc_nullop, /* l2cache_wb_range */ - - /* Other functions */ - - sa11x0_drain_readbuf, /* flush_prefetchbuf */ - armv4_drain_writebuf, /* drain_writebuf */ - cpufunc_nullop, /* flush_brnchtgt_C */ - (void *)cpufunc_nullop, /* flush_brnchtgt_E */ - - sa11x0_cpu_sleep, /* sleep */ - - /* Soft functions */ - - cpufunc_null_fixup, /* dataabt_fixup */ - cpufunc_null_fixup, /* prefetchabt_fixup */ - - sa11x0_context_switch, /* context_switch */ - - sa11x0_setup /* cpu setup */ -}; -#endif /* CPU_SA1100 || CPU_SA1110 */ - -#ifdef CPU_IXP12X0 -struct cpu_functions ixp12x0_cpufuncs = { - /* CPU functions */ - - cpufunc_id, /* id */ - cpufunc_nullop, /* cpwait */ - - /* MMU functions */ - - cpufunc_control, /* control */ - cpufunc_domains, /* domain */ - sa1_setttb, /* setttb */ - cpufunc_faultstatus, /* faultstatus */ - cpufunc_faultaddress, /* faultaddress */ - - /* TLB functions */ - - armv4_tlb_flushID, /* tlb_flushID */ - sa1_tlb_flushID_SE, /* tlb_flushID_SE */ - armv4_tlb_flushI, /* tlb_flushI */ - (void *)armv4_tlb_flushI, /* tlb_flushI_SE */ - armv4_tlb_flushD, /* tlb_flushD */ - armv4_tlb_flushD_SE, /* tlb_flushD_SE */ - - /* Cache operations */ - - sa1_cache_syncI, /* icache_sync_all */ - sa1_cache_syncI_rng, /* icache_sync_range */ - - sa1_cache_purgeD, /* dcache_wbinv_all */ - sa1_cache_purgeD_rng, /* dcache_wbinv_range */ -/*XXX*/ sa1_cache_purgeD_rng, /* dcache_inv_range */ - sa1_cache_cleanD_rng, /* dcache_wb_range */ - - sa1_cache_flushID, /* idcache_inv_all */ - sa1_cache_purgeID, /* idcache_wbinv_all */ - sa1_cache_purgeID_rng, /* idcache_wbinv_range */ - cpufunc_nullop, /* l2cache_wbinv_all */ - (void *)cpufunc_nullop, /* l2cache_wbinv_range */ - (void *)cpufunc_nullop, /* l2cache_inv_range */ - (void *)cpufunc_nullop, /* l2cache_wb_range */ - - /* Other functions */ - - ixp12x0_drain_readbuf, /* flush_prefetchbuf */ - armv4_drain_writebuf, /* drain_writebuf */ - cpufunc_nullop, /* flush_brnchtgt_C */ - (void *)cpufunc_nullop, /* flush_brnchtgt_E */ - - (void *)cpufunc_nullop, /* sleep */ - - /* Soft functions */ - - cpufunc_null_fixup, /* dataabt_fixup */ - cpufunc_null_fixup, /* prefetchabt_fixup */ - - ixp12x0_context_switch, /* context_switch */ - - ixp12x0_setup /* cpu setup */ -}; -#endif /* CPU_IXP12X0 */ - #if defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ defined(CPU_XSCALE_80219) @@ -1128,7 +814,7 @@ struct cpu_functions cpufuncs; u_int cputype; u_int cpu_reset_needs_v4_MMU_disable; /* flag used in locore.s */ -#if defined(CPU_ARM7TDMI) || defined(CPU_ARM8) || defined(CPU_ARM9) || \ +#if defined(CPU_ARM9) || \ defined (CPU_ARM9E) || defined (CPU_ARM10) || defined (CPU_ARM1136) || \ defined(CPU_ARM1176) || defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ @@ -1247,61 +933,7 @@ get_cachetype_cp15() arm_dcache_align_mask = arm_dcache_align - 1; } } -#endif /* ARM7TDMI || ARM8 || ARM9 || XSCALE */ - -#if defined(CPU_SA110) || defined(CPU_SA1100) || defined(CPU_SA1110) || \ - defined(CPU_IXP12X0) -/* Cache information for CPUs without cache type registers. */ -struct cachetab { - u_int32_t ct_cpuid; - int ct_pcache_type; - int ct_pcache_unified; - int ct_pdcache_size; - int ct_pdcache_line_size; - int ct_pdcache_ways; - int ct_picache_size; - int ct_picache_line_size; - int ct_picache_ways; -}; - -struct cachetab cachetab[] = { - /* cpuid, cache type, u, dsiz, ls, wy, isiz, ls, wy */ - /* XXX is this type right for SA-1? */ - { CPU_ID_SA110, CPU_CT_CTYPE_WB1, 0, 16384, 32, 32, 16384, 32, 32 }, - { CPU_ID_SA1100, CPU_CT_CTYPE_WB1, 0, 8192, 32, 32, 16384, 32, 32 }, - { CPU_ID_SA1110, CPU_CT_CTYPE_WB1, 0, 8192, 32, 32, 16384, 32, 32 }, - { CPU_ID_IXP1200, CPU_CT_CTYPE_WB1, 0, 16384, 32, 32, 16384, 32, 32 }, /* XXX */ - { 0, 0, 0, 0, 0, 0, 0, 0} -}; - -static void get_cachetype_table(void); - -static void -get_cachetype_table() -{ - int i; - u_int32_t cpuid = cpufunc_id(); - - for (i = 0; cachetab[i].ct_cpuid != 0; i++) { - if (cachetab[i].ct_cpuid == (cpuid & CPU_ID_CPU_MASK)) { - arm_pcache_type = cachetab[i].ct_pcache_type; - arm_pcache_unified = cachetab[i].ct_pcache_unified; - arm_pdcache_size = cachetab[i].ct_pdcache_size; - arm_pdcache_line_size = - cachetab[i].ct_pdcache_line_size; - arm_pdcache_ways = cachetab[i].ct_pdcache_ways; - arm_picache_size = cachetab[i].ct_picache_size; - arm_picache_line_size = - cachetab[i].ct_picache_line_size; - arm_picache_ways = cachetab[i].ct_picache_ways; - } - } - arm_dcache_align = arm_pdcache_line_size; - - arm_dcache_align_mask = arm_dcache_align - 1; -} - -#endif /* SA110 || SA1100 || SA1111 || IXP12X0 */ +#endif /* ARM9 || XSCALE */ /* * Cannot panic here as we may not have a console yet ... @@ -1318,27 +950,6 @@ set_cpufuncs() * CPU type where we want to use it by default, then we set it. */ -#ifdef CPU_ARM7TDMI - if ((cputype & CPU_ID_IMPLEMENTOR_MASK) == CPU_ID_ARM_LTD && - CPU_ID_IS7(cputype) && - (cputype & CPU_ID_7ARCH_MASK) == CPU_ID_7ARCH_V4T) { - cpufuncs = arm7tdmi_cpufuncs; - cpu_reset_needs_v4_MMU_disable = 0; - get_cachetype_cp15(); - pmap_pte_init_generic(); - goto out; - } -#endif -#ifdef CPU_ARM8 - if ((cputype & CPU_ID_IMPLEMENTOR_MASK) == CPU_ID_ARM_LTD && - (cputype & 0x0000f000) == 0x00008000) { - cpufuncs = arm8_cpufuncs; - cpu_reset_needs_v4_MMU_disable = 0; /* XXX correct? */ - get_cachetype_cp15(); - pmap_pte_init_arm8(); - goto out; - } -#endif /* CPU_ARM8 */ #ifdef CPU_ARM9 if (((cputype & CPU_ID_IMPLEMENTOR_MASK) == CPU_ID_ARM_LTD || (cputype & CPU_ID_IMPLEMENTOR_MASK) == CPU_ID_TI) && @@ -1464,39 +1075,7 @@ set_cpufuncs() goto out; } #endif /* CPU_MV_PJ4B */ -#ifdef CPU_SA110 - if (cputype == CPU_ID_SA110) { - cpufuncs = sa110_cpufuncs; - cpu_reset_needs_v4_MMU_disable = 1; /* SA needs it */ - get_cachetype_table(); - pmap_pte_init_sa1(); - goto out; - } -#endif /* CPU_SA110 */ -#ifdef CPU_SA1100 - if (cputype == CPU_ID_SA1100) { - cpufuncs = sa11x0_cpufuncs; - cpu_reset_needs_v4_MMU_disable = 1; /* SA needs it */ - get_cachetype_table(); - pmap_pte_init_sa1(); - /* Use powersave on this CPU. */ - cpu_do_powersave = 1; - - goto out; - } -#endif /* CPU_SA1100 */ -#ifdef CPU_SA1110 - if (cputype == CPU_ID_SA1110) { - cpufuncs = sa11x0_cpufuncs; - cpu_reset_needs_v4_MMU_disable = 1; /* SA needs it */ - get_cachetype_table(); - pmap_pte_init_sa1(); - /* Use powersave on this CPU. */ - cpu_do_powersave = 1; - goto out; - } -#endif /* CPU_SA1110 */ #if defined(CPU_FA526) || defined(CPU_FA626TE) if (cputype == CPU_ID_FA526 || cputype == CPU_ID_FA626TE) { cpufuncs = fa526_cpufuncs; @@ -1510,15 +1089,7 @@ set_cpufuncs() goto out; } #endif /* CPU_FA526 || CPU_FA626TE */ -#ifdef CPU_IXP12X0 - if (cputype == CPU_ID_IXP1200) { - cpufuncs = ixp12x0_cpufuncs; - cpu_reset_needs_v4_MMU_disable = 1; - get_cachetype_table(); - pmap_pte_init_sa1(); - goto out; - } -#endif /* CPU_IXP12X0 */ + #ifdef CPU_XSCALE_80200 if (cputype == CPU_ID_80200) { int rev = cpufunc_id() & CPU_ID_REVISION_MASK; @@ -1627,8 +1198,6 @@ out: * * DEBUG_FAULT_CORRECTION - Print debugging information during the * correction of registers after a fault. - * ARM6_LATE_ABORT - ARM6 supports both early and late aborts - * when defined should use late aborts */ @@ -1643,344 +1212,12 @@ cpufunc_null_fixup(arg) return(ABORT_FIXUP_OK); } - -#if defined(CPU_ARM7TDMI) - -#ifdef DEBUG_FAULT_CORRECTION -#define DFC_PRINTF(x) printf x -#define DFC_DISASSEMBLE(x) disassemble(x) -#else -#define DFC_PRINTF(x) /* nothing */ -#define DFC_DISASSEMBLE(x) /* nothing */ -#endif - /* - * "Early" data abort fixup. - * - * For ARM2, ARM2as, ARM3 and ARM6 (in early-abort mode). Also used - * indirectly by ARM6 (in late-abort mode) and ARM7[TDMI]. - * - * In early aborts, we may have to fix up LDM, STM, LDC and STC. + * CPU Setup code */ -int -early_abort_fixup(arg) - void *arg; -{ - struct trapframe *frame = arg; - u_int fault_pc; - u_int fault_instruction; - int saved_lr = 0; - - if ((frame->tf_spsr & PSR_MODE) == PSR_SVC32_MODE) { - - /* Ok an abort in SVC mode */ - - /* - * Copy the SVC r14 into the usr r14 - The usr r14 is garbage - * as the fault happened in svc mode but we need it in the - * usr slot so we can treat the registers as an array of ints - * during fixing. - * NOTE: This PC is in the position but writeback is not - * allowed on r15. - * Doing it like this is more efficient than trapping this - * case in all possible locations in the following fixup code. - */ - - saved_lr = frame->tf_usr_lr; - frame->tf_usr_lr = frame->tf_svc_lr; - - /* - * Note the trapframe does not have the SVC r13 so a fault - * from an instruction with writeback to r13 in SVC mode is - * not allowed. This should not happen as the kstack is - * always valid. - */ - } - - /* Get fault address and status from the CPU */ - - fault_pc = frame->tf_pc; - fault_instruction = *((volatile unsigned int *)fault_pc); - - /* Decode the fault instruction and fix the registers as needed */ - - if ((fault_instruction & 0x0e000000) == 0x08000000) { - int base; - int loop; - int count; - int *registers = &frame->tf_r0; - - DFC_PRINTF(("LDM/STM\n")); - DFC_DISASSEMBLE(fault_pc); - if (fault_instruction & (1 << 21)) { - DFC_PRINTF(("This instruction must be corrected\n")); - base = (fault_instruction >> 16) & 0x0f; - if (base == 15) - return ABORT_FIXUP_FAILED; - /* Count registers transferred */ - count = 0; - for (loop = 0; loop < 16; ++loop) { - if (fault_instruction & (1<tf_r0; - - /* REGISTER CORRECTION IS REQUIRED FOR THESE INSTRUCTIONS */ - - DFC_DISASSEMBLE(fault_pc); - - /* Only need to fix registers if write back is turned on */ - - if ((fault_instruction & (1 << 21)) != 0) { - base = (fault_instruction >> 16) & 0x0f; - if (base == 13 && - (frame->tf_spsr & PSR_MODE) == PSR_SVC32_MODE) - return ABORT_FIXUP_FAILED; - if (base == 15) - return ABORT_FIXUP_FAILED; - - offset = (fault_instruction & 0xff) << 2; - DFC_PRINTF(("r%d=%08x\n", base, registers[base])); - if ((fault_instruction & (1 << 23)) != 0) - offset = -offset; - registers[base] += offset; - DFC_PRINTF(("r%d=%08x\n", base, registers[base])); - } - } else if ((fault_instruction & 0x0e000000) == 0x0c000000) - return ABORT_FIXUP_FAILED; - - if ((frame->tf_spsr & PSR_MODE) == PSR_SVC32_MODE) { - - /* Ok an abort in SVC mode */ - - /* - * Copy the SVC r14 into the usr r14 - The usr r14 is garbage - * as the fault happened in svc mode but we need it in the - * usr slot so we can treat the registers as an array of ints - * during fixing. - * NOTE: This PC is in the position but writeback is not - * allowed on r15. - * Doing it like this is more efficient than trapping this - * case in all possible locations in the prior fixup code. - */ - - frame->tf_svc_lr = frame->tf_usr_lr; - frame->tf_usr_lr = saved_lr; - - /* - * Note the trapframe does not have the SVC r13 so a fault - * from an instruction with writeback to r13 in SVC mode is - * not allowed. This should not happen as the kstack is - * always valid. - */ - } - - return(ABORT_FIXUP_OK); -} -#endif /* CPU_ARM2/250/3/6/7 */ - - -#if defined(CPU_ARM7TDMI) -/* - * "Late" (base updated) data abort fixup - * - * For ARM6 (in late-abort mode) and ARM7. - * - * In this model, all data-transfer instructions need fixing up. We defer - * LDM, STM, LDC and STC fixup to the early-abort handler. - */ -int -late_abort_fixup(arg) - void *arg; -{ - struct trapframe *frame = arg; - u_int fault_pc; - u_int fault_instruction; - int saved_lr = 0; - - if ((frame->tf_spsr & PSR_MODE) == PSR_SVC32_MODE) { - - /* Ok an abort in SVC mode */ - - /* - * Copy the SVC r14 into the usr r14 - The usr r14 is garbage - * as the fault happened in svc mode but we need it in the - * usr slot so we can treat the registers as an array of ints - * during fixing. - * NOTE: This PC is in the position but writeback is not - * allowed on r15. - * Doing it like this is more efficient than trapping this - * case in all possible locations in the following fixup code. - */ - - saved_lr = frame->tf_usr_lr; - frame->tf_usr_lr = frame->tf_svc_lr; - - /* - * Note the trapframe does not have the SVC r13 so a fault - * from an instruction with writeback to r13 in SVC mode is - * not allowed. This should not happen as the kstack is - * always valid. - */ - } - - /* Get fault address and status from the CPU */ - - fault_pc = frame->tf_pc; - fault_instruction = *((volatile unsigned int *)fault_pc); - - /* Decode the fault instruction and fix the registers as needed */ - - /* Was is a swap instruction ? */ - if ((fault_instruction & 0x0fb00ff0) == 0x01000090) { - DFC_DISASSEMBLE(fault_pc); - } else if ((fault_instruction & 0x0c000000) == 0x04000000) { - - /* Was is a ldr/str instruction */ - /* This is for late abort only */ - - int base; - int offset; - int *registers = &frame->tf_r0; - - DFC_DISASSEMBLE(fault_pc); - - /* This is for late abort only */ - - if ((fault_instruction & (1 << 24)) == 0 - || (fault_instruction & (1 << 21)) != 0) { - /* postindexed ldr/str with no writeback */ - - base = (fault_instruction >> 16) & 0x0f; - if (base == 13 && - (frame->tf_spsr & PSR_MODE) == PSR_SVC32_MODE) - return ABORT_FIXUP_FAILED; - if (base == 15) - return ABORT_FIXUP_FAILED; - DFC_PRINTF(("late abt fix: r%d=%08x : ", - base, registers[base])); - if ((fault_instruction & (1 << 25)) == 0) { - /* Immediate offset - easy */ - - offset = fault_instruction & 0xfff; - if ((fault_instruction & (1 << 23))) - offset = -offset; - registers[base] += offset; - DFC_PRINTF(("imm=%08x ", offset)); - } else { - /* offset is a shifted register */ - int shift; - - offset = fault_instruction & 0x0f; - if (offset == base) - return ABORT_FIXUP_FAILED; - - /* - * Register offset - hard we have to - * cope with shifts ! - */ - offset = registers[offset]; - - if ((fault_instruction & (1 << 4)) == 0) - /* shift with amount */ - shift = (fault_instruction >> 7) & 0x1f; - else { - /* shift with register */ - if ((fault_instruction & (1 << 7)) != 0) - /* undefined for now so bail out */ - return ABORT_FIXUP_FAILED; - shift = ((fault_instruction >> 8) & 0xf); - if (base == shift) - return ABORT_FIXUP_FAILED; - DFC_PRINTF(("shift reg=%d ", shift)); - shift = registers[shift]; - } - DFC_PRINTF(("shift=%08x ", shift)); - switch (((fault_instruction >> 5) & 0x3)) { - case 0 : /* Logical left */ - offset = (int)(((u_int)offset) << shift); - break; - case 1 : /* Logical Right */ - if (shift == 0) shift = 32; - offset = (int)(((u_int)offset) >> shift); - break; - case 2 : /* Arithmetic Right */ - if (shift == 0) shift = 32; - offset = (int)(((int)offset) >> shift); - break; - case 3 : /* Rotate right (rol or rxx) */ - return ABORT_FIXUP_FAILED; - break; - } - - DFC_PRINTF(("abt: fixed LDR/STR with " - "register offset\n")); - if ((fault_instruction & (1 << 23))) - offset = -offset; - DFC_PRINTF(("offset=%08x ", offset)); - registers[base] += offset; - } - DFC_PRINTF(("r%d=%08x\n", base, registers[base])); - } - } - - if ((frame->tf_spsr & PSR_MODE) == PSR_SVC32_MODE) { - - /* Ok an abort in SVC mode */ - - /* - * Copy the SVC r14 into the usr r14 - The usr r14 is garbage - * as the fault happened in svc mode but we need it in the - * usr slot so we can treat the registers as an array of ints - * during fixing. - * NOTE: This PC is in the position but writeback is not - * allowed on r15. - * Doing it like this is more efficient than trapping this - * case in all possible locations in the prior fixup code. - */ - - frame->tf_svc_lr = frame->tf_usr_lr; - frame->tf_usr_lr = saved_lr; - - /* - * Note the trapframe does not have the SVC r13 so a fault - * from an instruction with writeback to r13 in SVC mode is - * not allowed. This should not happen as the kstack is - * always valid. - */ - } - - /* - * Now let the early-abort fixup routine have a go, in case it - * was an LDM, STM, LDC or STC that faulted. - */ - - return early_abort_fixup(arg); -} -#endif /* CPU_ARM7TDMI */ - -/* - * CPU Setup code - */ - -#if defined(CPU_ARM7TDMI) || defined(CPU_ARM8) || defined (CPU_ARM9) || \ +#if defined (CPU_ARM9) || \ defined(CPU_ARM9E) || \ - defined(CPU_SA110) || defined(CPU_SA1100) || defined(CPU_SA1110) || \ defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342) || \ @@ -2030,148 +1267,7 @@ parse_cpu_options(args, optlist, cpuctrl } return(cpuctrl); } -#endif /* CPU_ARM7TDMI || CPU_ARM8 || CPU_SA110 || XSCALE*/ - -#if defined(CPU_ARM7TDMI) || defined(CPU_ARM8) -struct cpu_option arm678_options[] = { -#ifdef COMPAT_12 - { "nocache", IGN, BIC, CPU_CONTROL_IDC_ENABLE }, - { "nowritebuf", IGN, BIC, CPU_CONTROL_WBUF_ENABLE }, -#endif /* COMPAT_12 */ - { "cpu.cache", BIC, OR, CPU_CONTROL_IDC_ENABLE }, - { "cpu.nocache", OR, BIC, CPU_CONTROL_IDC_ENABLE }, - { "cpu.writebuf", BIC, OR, CPU_CONTROL_WBUF_ENABLE }, - { "cpu.nowritebuf", OR, BIC, CPU_CONTROL_WBUF_ENABLE }, - { NULL, IGN, IGN, 0 } -}; - -#endif /* CPU_ARM6 || CPU_ARM7 || CPU_ARM7TDMI || CPU_ARM8 */ - -#ifdef CPU_ARM7TDMI -struct cpu_option arm7tdmi_options[] = { - { "arm7.cache", BIC, OR, CPU_CONTROL_IDC_ENABLE }, - { "arm7.nocache", OR, BIC, CPU_CONTROL_IDC_ENABLE }, - { "arm7.writebuf", BIC, OR, CPU_CONTROL_WBUF_ENABLE }, - { "arm7.nowritebuf", OR, BIC, CPU_CONTROL_WBUF_ENABLE }, -#ifdef COMPAT_12 - { "fpaclk2", BIC, OR, CPU_CONTROL_CPCLK }, -#endif /* COMPAT_12 */ - { "arm700.fpaclk", BIC, OR, CPU_CONTROL_CPCLK }, - { NULL, IGN, IGN, 0 } -}; - -void -arm7tdmi_setup(args) - char *args; -{ - int cpuctrl; - - cpuctrl = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_32BP_ENABLE - | CPU_CONTROL_32BD_ENABLE | CPU_CONTROL_SYST_ENABLE - | CPU_CONTROL_IDC_ENABLE | CPU_CONTROL_WBUF_ENABLE; - - cpuctrl = parse_cpu_options(args, arm678_options, cpuctrl); - cpuctrl = parse_cpu_options(args, arm7tdmi_options, cpuctrl); - -#ifdef __ARMEB__ - cpuctrl |= CPU_CONTROL_BEND_ENABLE; -#endif - - /* Clear out the cache */ - cpu_idcache_wbinv_all(); - - /* Set the control register */ - ctrl = cpuctrl; - cpu_control(0xffffffff, cpuctrl); -} -#endif /* CPU_ARM7TDMI */ - -#ifdef CPU_ARM8 -struct cpu_option arm8_options[] = { - { "arm8.cache", BIC, OR, CPU_CONTROL_IDC_ENABLE }, - { "arm8.nocache", OR, BIC, CPU_CONTROL_IDC_ENABLE }, - { "arm8.writebuf", BIC, OR, CPU_CONTROL_WBUF_ENABLE }, - { "arm8.nowritebuf", OR, BIC, CPU_CONTROL_WBUF_ENABLE }, -#ifdef COMPAT_12 - { "branchpredict", BIC, OR, CPU_CONTROL_BPRD_ENABLE }, -#endif /* COMPAT_12 */ - { "cpu.branchpredict", BIC, OR, CPU_CONTROL_BPRD_ENABLE }, - { "arm8.branchpredict", BIC, OR, CPU_CONTROL_BPRD_ENABLE }, - { NULL, IGN, IGN, 0 } -}; - -void -arm8_setup(args) - char *args; -{ - int integer; - int cpuctrl, cpuctrlmask; - int clocktest; - int setclock = 0; - - cpuctrl = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_32BP_ENABLE - | CPU_CONTROL_32BD_ENABLE | CPU_CONTROL_SYST_ENABLE - | CPU_CONTROL_IDC_ENABLE | CPU_CONTROL_WBUF_ENABLE; - cpuctrlmask = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_32BP_ENABLE - | CPU_CONTROL_32BD_ENABLE | CPU_CONTROL_SYST_ENABLE - | CPU_CONTROL_IDC_ENABLE | CPU_CONTROL_WBUF_ENABLE - | CPU_CONTROL_BPRD_ENABLE | CPU_CONTROL_ROM_ENABLE - | CPU_CONTROL_BEND_ENABLE | CPU_CONTROL_AFLT_ENABLE; - -#ifndef ARM32_DISABLE_ALIGNMENT_FAULTS - cpuctrl |= CPU_CONTROL_AFLT_ENABLE; -#endif - - cpuctrl = parse_cpu_options(args, arm678_options, cpuctrl); - cpuctrl = parse_cpu_options(args, arm8_options, cpuctrl); - -#ifdef __ARMEB__ - cpuctrl |= CPU_CONTROL_BEND_ENABLE; -#endif - - /* Get clock configuration */ - clocktest = arm8_clock_config(0, 0) & 0x0f; - - /* Special ARM8 clock and test configuration */ - if (get_bootconf_option(args, "arm8.clock.reset", BOOTOPT_TYPE_BOOLEAN, &integer)) { - clocktest = 0; - setclock = 1; - } - if (get_bootconf_option(args, "arm8.clock.dynamic", BOOTOPT_TYPE_BOOLEAN, &integer)) { - if (integer) - clocktest |= 0x01; - else - clocktest &= ~(0x01); - setclock = 1; - } - if (get_bootconf_option(args, "arm8.clock.sync", BOOTOPT_TYPE_BOOLEAN, &integer)) { - if (integer) - clocktest |= 0x02; - else - clocktest &= ~(0x02); - setclock = 1; - } - if (get_bootconf_option(args, "arm8.clock.fast", BOOTOPT_TYPE_BININT, &integer)) { - clocktest = (clocktest & ~0xc0) | (integer & 3) << 2; - setclock = 1; - } - if (get_bootconf_option(args, "arm8.test", BOOTOPT_TYPE_BININT, &integer)) { - clocktest |= (integer & 7) << 5; - setclock = 1; - } - - /* Clear out the cache */ - cpu_idcache_wbinv_all(); - - /* Set the control register */ - ctrl = cpuctrl; - cpu_control(0xffffffff, cpuctrl); - - /* Set the clock/test register */ - if (setclock) - arm8_clock_config(0x7f, clocktest); -} -#endif /* CPU_ARM8 */ +#endif /* CPU_ARM9 || XSCALE*/ #ifdef CPU_ARM9 struct cpu_option arm9_options[] = { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 21:56:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D15FA969; Sun, 9 Mar 2014 21:56:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BE75EA6A; Sun, 9 Mar 2014 21:56:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s29LuT90076868; Sun, 9 Mar 2014 21:56:29 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29LuTfH076867; Sun, 9 Mar 2014 21:56:29 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403092156.s29LuTfH076867@svn.freebsd.org> From: Julio Merino Date: Sun, 9 Mar 2014 21:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262959 - head/tools/regression/usr.bin/sed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 21:56:29 -0000 Author: jmmv Date: Sun Mar 9 21:56:29 2014 New Revision: 262959 URL: http://svnweb.freebsd.org/changeset/base/262959 Log: Fix sed tests so that they run cleanly with prove. Modified: head/tools/regression/usr.bin/sed/regress.sh Modified: head/tools/regression/usr.bin/sed/regress.sh ============================================================================== --- head/tools/regression/usr.bin/sed/regress.sh Sun Mar 9 21:12:31 2014 (r262958) +++ head/tools/regression/usr.bin/sed/regress.sh Sun Mar 9 21:56:29 2014 (r262959) @@ -2,7 +2,7 @@ REGRESSION_START($1) -echo '1..25' +echo '1..26' REGRESSION_TEST(`G', `sed G < regress.in') REGRESSION_TEST(`P', `sed P < regress.in') From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 22:05:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DCBB5D6A; Sun, 9 Mar 2014 22:05:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C6D16B58; Sun, 9 Mar 2014 22:05:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s29M5Prf080891; Sun, 9 Mar 2014 22:05:25 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29M5NZb080877; Sun, 9 Mar 2014 22:05:23 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403092205.s29M5NZb080877@svn.freebsd.org> From: Julio Merino Date: Sun, 9 Mar 2014 22:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262960 - head/tools/regression/usr.bin/yacc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 22:05:25 -0000 Author: jmmv Date: Sun Mar 9 22:05:23 2014 New Revision: 262960 URL: http://svnweb.freebsd.org/changeset/base/262960 Log: Fix yacc tests so that they run cleanly with prove. First, change the driver to run the installed yacc instead of the one from /usr/obj (which might not be there), just as we (intend to) do with all other tests. Second, regenerate the expected output files from scratch. Based on visual inspection, the differences seem OK. But this highlights that the tests in here are too fragile and, possibly, useless: we should be testing the behavior of the generated program, not the literal output. Something to be addressed later. Modified: head/tools/regression/usr.bin/yacc/regress.00.out head/tools/regression/usr.bin/yacc/regress.01.out head/tools/regression/usr.bin/yacc/regress.02.out head/tools/regression/usr.bin/yacc/regress.03.out head/tools/regression/usr.bin/yacc/regress.04.out head/tools/regression/usr.bin/yacc/regress.05.out head/tools/regression/usr.bin/yacc/regress.06.out head/tools/regression/usr.bin/yacc/regress.07.out head/tools/regression/usr.bin/yacc/regress.08.out head/tools/regression/usr.bin/yacc/regress.09.out head/tools/regression/usr.bin/yacc/regress.10.out head/tools/regression/usr.bin/yacc/regress.11.out head/tools/regression/usr.bin/yacc/regress.12.out head/tools/regression/usr.bin/yacc/regress.13.out head/tools/regression/usr.bin/yacc/regress.14.out head/tools/regression/usr.bin/yacc/regress.sh Modified: head/tools/regression/usr.bin/yacc/regress.00.out ============================================================================== --- head/tools/regression/usr.bin/yacc/regress.00.out Sun Mar 9 21:56:29 2014 (r262959) +++ head/tools/regression/usr.bin/yacc/regress.00.out Sun Mar 9 22:05:23 2014 (r262960) @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -77,10 +78,11 @@ static const short yycheck[] = { #define YYDEBUG 0 #endif #define YYMAXTOKEN 0 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { -"end-of-file", +"end-of-file","illegal-symbol", }; static const char *yyrule[] = { "$accept : rule", @@ -105,12 +107,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -145,7 +147,7 @@ static int yygrowstack(YYSTACKDATA *data else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -219,9 +221,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -303,9 +303,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -348,9 +346,7 @@ yyreduce: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } Modified: head/tools/regression/usr.bin/yacc/regress.01.out ============================================================================== --- head/tools/regression/usr.bin/yacc/regress.01.out Sun Mar 9 21:56:29 2014 (r262959) +++ head/tools/regression/usr.bin/yacc/regress.01.out Sun Mar 9 22:05:23 2014 (r262960) @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -25,7 +26,7 @@ int base; extern int yylex(void); static void yyerror(const char *s); -#line 28 "/dev/stdout" +#line 29 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -152,6 +153,7 @@ static const short yycheck[] = { #define YYDEBUG 0 #endif #define YYMAXTOKEN 259 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -162,7 +164,7 @@ static const char *yyname[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"DIGIT","LETTER","UMINUS", +0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol", }; static const char *yyrule[] = { "$accept : list", @@ -204,12 +206,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -263,7 +265,7 @@ yylex(void) } return( c ); } -#line 266 "/dev/stdout" +#line 267 "/dev/stdout" #if YYDEBUG #include /* needed for printf */ @@ -287,7 +289,7 @@ static int yygrowstack(YYSTACKDATA *data else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -361,9 +363,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -445,9 +445,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -529,7 +527,7 @@ case 18: #line 63 "calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 532 "/dev/stdout" +#line 529 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -551,9 +549,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } Modified: head/tools/regression/usr.bin/yacc/regress.02.out ============================================================================== --- head/tools/regression/usr.bin/yacc/regress.02.out Sun Mar 9 21:56:29 2014 (r262959) +++ head/tools/regression/usr.bin/yacc/regress.02.out Sun Mar 9 22:05:23 2014 (r262960) @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -55,7 +56,7 @@ typedef union INTERVAL vval; } YYSTYPE; #endif /* !YYSTYPE_IS_DECLARED */ -#line 58 "/dev/stdout" +#line 59 "/dev/stdout" /* compatibility with bison */ #ifdef YYPARSE_PARAM @@ -192,6 +193,7 @@ static const short yycheck[] = { #define YYDEBUG 0 #endif #define YYMAXTOKEN 260 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -202,7 +204,7 @@ static const char *yyname[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,"DREG","VREG","CONST","UMINUS", +0,0,"DREG","VREG","CONST","UMINUS","illegal-symbol", }; static const char *yyrule[] = { "$accept : line", @@ -254,12 +256,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -402,7 +404,7 @@ vdiv(double a, double b, INTERVAL v) { return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo)); } -#line 405 "/dev/stdout" +#line 406 "/dev/stdout" #if YYDEBUG #include /* needed for printf */ @@ -426,7 +428,7 @@ static int yygrowstack(YYSTACKDATA *data else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -500,9 +502,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -584,9 +584,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -771,7 +769,7 @@ case 28: yyval.vval = yystack.l_mark[-1].vval; } break; -#line 774 "/dev/stdout" +#line 771 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -793,9 +791,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } Modified: head/tools/regression/usr.bin/yacc/regress.03.out ============================================================================== --- head/tools/regression/usr.bin/yacc/regress.03.out Sun Mar 9 21:56:29 2014 (r262959) +++ head/tools/regression/usr.bin/yacc/regress.03.out Sun Mar 9 22:05:23 2014 (r262960) @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -28,7 +29,7 @@ int YYLEX_DECL(); static void YYERROR_DECL(); #endif -#line 31 "/dev/stdout" +#line 32 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -159,6 +160,7 @@ static const short yycheck[] = { #define YYDEBUG 0 #endif #define YYMAXTOKEN 259 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -169,7 +171,7 @@ static const char *yyname[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"DIGIT","LETTER","UMINUS", +0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol", }; static const char *yyrule[] = { "$accept : list", @@ -206,12 +208,12 @@ int yynerrs; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -270,7 +272,7 @@ YYLEX_DECL() } return( c ); } -#line 273 "/dev/stdout" +#line 274 "/dev/stdout" #if YYDEBUG #include /* needed for printf */ @@ -294,7 +296,7 @@ static int yygrowstack(YYSTACKDATA *data else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -375,9 +377,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -459,9 +459,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -543,7 +541,7 @@ case 18: #line 73 "calc3.y" { yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 546 "/dev/stdout" +#line 543 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -565,9 +563,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } Modified: head/tools/regression/usr.bin/yacc/regress.04.out ============================================================================== --- head/tools/regression/usr.bin/yacc/regress.04.out Sun Mar 9 21:56:29 2014 (r262959) +++ head/tools/regression/usr.bin/yacc/regress.04.out Sun Mar 9 22:05:23 2014 (r262960) @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -27,7 +28,7 @@ int yylex(void); static void yyerror(const char *s); #endif -#line 30 "/dev/stdout" +#line 31 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -154,6 +155,7 @@ static const short yycheck[] = { #define YYDEBUG 0 #endif #define YYMAXTOKEN 259 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -164,7 +166,7 @@ static const char *yyname[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"DIGIT","LETTER","UMINUS", +0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol", }; static const char *yyrule[] = { "$accept : list", @@ -206,12 +208,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -269,7 +271,7 @@ yylex(void) } return( c ); } -#line 272 "/dev/stdout" +#line 273 "/dev/stdout" #if YYDEBUG #include /* needed for printf */ @@ -293,7 +295,7 @@ static int yygrowstack(YYSTACKDATA *data else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -367,9 +369,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -451,9 +451,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -535,7 +533,7 @@ case 18: #line 65 "code_calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 538 "/dev/stdout" +#line 535 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -557,9 +555,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } Modified: head/tools/regression/usr.bin/yacc/regress.05.out ============================================================================== --- head/tools/regression/usr.bin/yacc/regress.05.out Sun Mar 9 21:56:29 2014 (r262959) +++ head/tools/regression/usr.bin/yacc/regress.05.out Sun Mar 9 22:05:23 2014 (r262960) @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -22,7 +23,7 @@ int yylex(void); static void yyerror(const char *); #endif -#line 25 "/dev/stdout" +#line 26 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -89,10 +90,11 @@ static const short yycheck[] = { #define YYDEBUG 0 #endif #define YYMAXTOKEN 0 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { -"end-of-file", +"end-of-file","illegal-symbol", }; static const char *yyrule[] = { "$accept : S", @@ -117,12 +119,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -160,7 +162,7 @@ yyerror(const char* s) { printf("%s\n", s); } -#line 163 "/dev/stdout" +#line 164 "/dev/stdout" #if YYDEBUG #include /* needed for printf */ @@ -184,7 +186,7 @@ static int yygrowstack(YYSTACKDATA *data else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -258,9 +260,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -342,9 +342,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -387,9 +385,7 @@ yyreduce: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } Modified: head/tools/regression/usr.bin/yacc/regress.06.out ============================================================================== --- head/tools/regression/usr.bin/yacc/regress.06.out Sun Mar 9 21:56:29 2014 (r262959) +++ head/tools/regression/usr.bin/yacc/regress.06.out Sun Mar 9 22:05:23 2014 (r262960) @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -18,7 +19,7 @@ static const char yysccsid[] = "@(#)yacc #line 2 "error.y" int yylex(void); static void yyerror(const char *); -#line 21 "/dev/stdout" +#line 22 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -85,10 +86,11 @@ static const short yycheck[] = { #define YYDEBUG 0 #endif #define YYMAXTOKEN 0 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { -"end-of-file", +"end-of-file","illegal-symbol", }; static const char *yyrule[] = { "$accept : S", @@ -113,12 +115,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -152,7 +154,7 @@ yyerror(const char* s) { printf("%s\n", s); } -#line 155 "/dev/stdout" +#line 156 "/dev/stdout" #if YYDEBUG #include /* needed for printf */ @@ -176,7 +178,7 @@ static int yygrowstack(YYSTACKDATA *data else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -250,9 +252,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -334,9 +334,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -379,9 +377,7 @@ yyreduce: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } Modified: head/tools/regression/usr.bin/yacc/regress.07.out ============================================================================== --- head/tools/regression/usr.bin/yacc/regress.07.out Sun Mar 9 21:56:29 2014 (r262959) +++ head/tools/regression/usr.bin/yacc/regress.07.out Sun Mar 9 22:05:23 2014 (r262960) @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -114,7 +115,7 @@ yyerror(const char *msg) { perror(msg); } -#line 117 "/dev/stdout" +#line 118 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -357,6 +358,7 @@ static const short yycheck[] = { #define YYDEBUG 0 #endif #define YYMAXTOKEN 319 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -372,6 +374,7 @@ static const char *yyname[] = { "MAIL","MSND","MSOM","MSAM","MRSQ","MRCP","ALLO","REST","RNFR","RNTO","ABOR", "DELE","CWD","LIST","NLST","SITE","STAT","HELP","NOOP","MKD","RMD","PWD","CDUP", "STOU","SMNT","SYST","SIZE","MDTM","UMASK","IDLE","CHMOD","LEXERR", +"illegal-symbol", }; static const char *yyrule[] = { "$accept : cmd_list", @@ -468,12 +471,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -1008,7 +1011,7 @@ sizecmd(char *filename) reply(504, "SIZE not implemented for Type %c.", "?AEIL"[type]); } } -#line 1011 "/dev/stdout" +#line 1013 "/dev/stdout" #if YYDEBUG #include /* needed for printf */ @@ -1032,7 +1035,7 @@ static int yygrowstack(YYSTACKDATA *data else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -1106,9 +1109,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -1190,9 +1191,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -1851,7 +1850,7 @@ case 73: } } break; -#line 1854 "/dev/stdout" +#line 1852 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -1873,9 +1872,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } Modified: head/tools/regression/usr.bin/yacc/regress.08.out ============================================================================== --- head/tools/regression/usr.bin/yacc/regress.08.out Sun Mar 9 21:56:29 2014 (r262959) +++ head/tools/regression/usr.bin/yacc/regress.08.out Sun Mar 9 22:05:23 2014 (r262960) @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -302,7 +303,7 @@ haveAnsiParam (void) } return FALSE; } -#line 305 "/dev/stdout" +#line 306 "/dev/stdout" /* compatibility with bison */ #ifdef YYPARSE_PARAM @@ -660,6 +661,7 @@ static const short yycheck[] = { #define YYDEBUG 0 #endif #define YYMAXTOKEN 291 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -676,6 +678,7 @@ static const char *yyname[] = { "T_UNSIGNED","T_ENUM","T_STRUCT","T_UNION","T_Bool","T_Complex","T_Imaginary", "T_TYPE_QUALIFIER","T_BRACKETS","T_LBRACE","T_MATCHRBRACE","T_ELLIPSIS", "T_INITIALIZER","T_STRING_LITERAL","T_ASM","T_ASMARG","T_VA_DCL", +"illegal-symbol", }; static const char *yyrule[] = { "$accept : program", @@ -813,12 +816,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -1001,7 +1004,7 @@ free_parser(void) #endif } #endif -#line 1004 "/dev/stdout" +#line 1006 "/dev/stdout" #if YYDEBUG #include /* needed for printf */ @@ -1025,7 +1028,7 @@ static int yygrowstack(YYSTACKDATA *data else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -1099,9 +1102,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -1183,9 +1184,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -1881,7 +1880,7 @@ case 114: yyval.declarator->func_def = FUNC_ANSI; } break; -#line 1884 "/dev/stdout" +#line 1882 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -1903,9 +1902,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } Modified: head/tools/regression/usr.bin/yacc/regress.09.out ============================================================================== --- head/tools/regression/usr.bin/yacc/regress.09.out Sun Mar 9 21:56:29 2014 (r262959) +++ head/tools/regression/usr.bin/yacc/regress.09.out Sun Mar 9 22:05:23 2014 (r262960) @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yacc #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -31,7 +32,7 @@ int YYLEX_DECL(); static void YYERROR_DECL(); #endif -#line 34 "/dev/stdout" +#line 35 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -158,6 +159,7 @@ static const short yycheck[] = { #define YYDEBUG 0 #endif #define YYMAXTOKEN 259 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -168,7 +170,7 @@ static const char *yyname[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"DIGIT","LETTER","UMINUS", +0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol", }; static const char *yyrule[] = { "$accept : list", @@ -210,12 +212,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 22:14:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C59EB53B; Sun, 9 Mar 2014 22:14:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B2270C55; Sun, 9 Mar 2014 22:14:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s29MEKMN085159; Sun, 9 Mar 2014 22:14:20 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29MEKPi085158; Sun, 9 Mar 2014 22:14:20 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403092214.s29MEKPi085158@svn.freebsd.org> From: Julio Merino Date: Sun, 9 Mar 2014 22:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262961 - head/tools/regression/usr.bin/pkill X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 22:14:20 -0000 Author: jmmv Date: Sun Mar 9 22:14:20 2014 New Revision: 262961 URL: http://svnweb.freebsd.org/changeset/base/262961 Log: Fix pkill tests so that they run cleanly with prove. This fixes a pgrep test that assumed that PID 2 was named g_event. This does not seem to be the case any longer (and I don't know if it ever was in all possible setups). Change this test to use the idle loop instead and determine its expected PID using ps without assuming any specific ID. Modified: head/tools/regression/usr.bin/pkill/pgrep-_s.t Modified: head/tools/regression/usr.bin/pkill/pgrep-_s.t ============================================================================== --- head/tools/regression/usr.bin/pkill/pgrep-_s.t Sun Mar 9 22:05:23 2014 (r262960) +++ head/tools/regression/usr.bin/pkill/pgrep-_s.t Sun Mar 9 22:14:20 2014 (r262961) @@ -5,15 +5,17 @@ base=`basename $0` echo "1..2" +exp_pid="$(ps ax | grep '\[idle\]' | awk '{print $1}')" + name="pgrep -S" -pid=`pgrep -Sx g_event` -if [ "$pid" = "2" ]; then +pid=`pgrep -Sx idle` +if [ "$pid" = "$exp_pid" ]; then echo "ok 1 - $name" else echo "not ok 1 - $name" fi -pid=`pgrep -x g_event` -if [ "$pid" != "2" ]; then +pid=`pgrep -x idle` +if [ "$pid" != "$exp_pid" ]; then echo "ok 2 - $name" else echo "not ok 2 - $name" From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 22:16:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13EE78F0; Sun, 9 Mar 2014 22:16:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 00F84C81; Sun, 9 Mar 2014 22:16:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s29MGdYl085580; Sun, 9 Mar 2014 22:16:39 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29MGdGA085579; Sun, 9 Mar 2014 22:16:39 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403092216.s29MGdGA085579@svn.freebsd.org> From: Julio Merino Date: Sun, 9 Mar 2014 22:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262962 - head/tools/regression/usr.bin/ncal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 22:16:40 -0000 Author: jmmv Date: Sun Mar 9 22:16:39 2014 New Revision: 262962 URL: http://svnweb.freebsd.org/changeset/base/262962 Log: Fix ncal tests so that they run cleanly with prove. Basically just make the test plan match what is actually being run. Modified: head/tools/regression/usr.bin/ncal/regress.sh Modified: head/tools/regression/usr.bin/ncal/regress.sh ============================================================================== --- head/tools/regression/usr.bin/ncal/regress.sh Sun Mar 9 22:14:20 2014 (r262961) +++ head/tools/regression/usr.bin/ncal/regress.sh Sun Mar 9 22:16:39 2014 (r262962) @@ -6,6 +6,8 @@ NCAL="${CAL_BIN} -N" YEARS="2008 2009 2010 2011" ONEYEAR="2009" +echo 1..89 + REGRESSION_START($1) # @@ -15,8 +17,6 @@ REGRESSION_START($1) # Full year calendars -echo 1..16 - for y in ${YEARS}; do # Regular calendar, Month days, No-highlight REGRESSION_TEST(`r-y${y}-md-nhl', `$NCAL -h ${y}') @@ -30,8 +30,6 @@ done # 3 month calendars -echo 17 .. 29 - for m in $(jot -w %02d 12); do # Regular calendar, Month days, No-highlight REGRESSION_TEST(`r-3m${ONEYEAR}${m}-md-nhl', From owner-svn-src-head@FreeBSD.ORG Sun Mar 9 22:38:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BAE8FC43; Sun, 9 Mar 2014 22:38:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A7A9EE24; Sun, 9 Mar 2014 22:38:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s29McBZF093774; Sun, 9 Mar 2014 22:38:11 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s29McBaA093773; Sun, 9 Mar 2014 22:38:11 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201403092238.s29McBaA093773@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 9 Mar 2014 22:38:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262963 - head/libexec/getty X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2014 22:38:11 -0000 Author: jilles Date: Sun Mar 9 22:38:11 2014 New Revision: 262963 URL: http://svnweb.freebsd.org/changeset/base/262963 Log: ttys(5): Pseudo-terminals are not listed and the network keyword is obsolete. Modified: head/libexec/getty/ttys.5 Modified: head/libexec/getty/ttys.5 ============================================================================== --- head/libexec/getty/ttys.5 Sun Mar 9 22:16:39 2014 (r262962) +++ head/libexec/getty/ttys.5 Sun Mar 9 22:38:11 2014 (r262963) @@ -28,7 +28,7 @@ .\" from: @(#)ttys.5 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" " -.Dd May 27, 2005 +.Dd March 9, 2014 .Dt TTYS 5 .Os .Sh NAME @@ -39,6 +39,9 @@ The file .Nm contains information that is used by various routines to initialize and control the use of terminal special files. +Pseudo-terminals (see +.Xr pts 4 ) +are not listed. This information is read with the .Xr getttyent 3 library routines. @@ -106,8 +109,7 @@ The flag ``secure'' (if the console is e uid of 0 to login on this line. The flag ``dialin'' indicates that a tty entry describes a dialin -line, and ``network'' indicates that a tty entry provides a -network connection. +line, and ``network'' is obsolete and does nothing. Either of these strings may also be specified in the terminal type field. The string ``window='' may be followed by a quoted command @@ -150,9 +152,6 @@ ttyh0 "/usr/libexec/getty std.9600" hp26 ttyh1 "/usr/libexec/getty std.9600" vt100 on group=dialup # 459 Evans # terminal emulate/window system ttyv0 "/usr/local/bin/xterm -display :0" xterm on window="/usr/local/bin/X :0" -# Network pseudo ttys -- don't enable getty -ttyp0 none network group=pty -ttyp1 none network off group=pty .Ed .Sh SEE ALSO .Xr login 1 , From owner-svn-src-head@FreeBSD.ORG Mon Mar 10 01:34:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD630E71; Mon, 10 Mar 2014 01:34:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9AB33EA2; Mon, 10 Mar 2014 01:34:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2A1Ycew067094; Mon, 10 Mar 2014 01:34:38 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2A1YcNM067093; Mon, 10 Mar 2014 01:34:38 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403100134.s2A1YcNM067093@svn.freebsd.org> From: Ian Lepore Date: Mon, 10 Mar 2014 01:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262966 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 01:34:38 -0000 Author: ian Date: Mon Mar 10 01:34:38 2014 New Revision: 262966 URL: http://svnweb.freebsd.org/changeset/base/262966 Log: Make the default exception handler vectors point to where I thought they were already pointing: the default handlers (not a panic that says there is no default handler). Modified: head/sys/arm/arm/exception.S Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Mon Mar 10 00:53:37 2014 (r262965) +++ head/sys/arm/arm/exception.S Mon Mar 10 01:34:38 2014 (r262966) @@ -115,16 +115,8 @@ Lprefetch_abort_handler_address: .global _C_LABEL(prefetch_abort_handler_address) _C_LABEL(prefetch_abort_handler_address): - .word abortprefetch + .word prefetch_abort_handler - .text -abortprefetch: - adr r0, abortprefetchmsg - b _C_LABEL(panic) - -abortprefetchmsg: - .asciz "abortprefetch" - .align 0 END(prefetch_abort_entry) /* @@ -151,16 +143,8 @@ Ldata_abort_handler_address: .data .global _C_LABEL(data_abort_handler_address) _C_LABEL(data_abort_handler_address): - .word abortdata + .word data_abort_handler - .text -abortdata: - adr r0, abortdatamsg - b _C_LABEL(panic) - -abortdatamsg: - .asciz "abortdata" - .align 0 END(data_abort_entry) /* From owner-svn-src-head@FreeBSD.ORG Mon Mar 10 06:03:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 390C3418; Mon, 10 Mar 2014 06:03:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 22AAD8B4; Mon, 10 Mar 2014 06:03:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2A63bEu077039; Mon, 10 Mar 2014 06:03:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2A63acI077029; Mon, 10 Mar 2014 06:03:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403100603.s2A63acI077029@svn.freebsd.org> From: Adrian Chadd Date: Mon, 10 Mar 2014 06:03:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262969 - in head/sys/dev/ath/ath_hal: . ar5210 ar5211 ar5212 ar5312 ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 06:03:38 -0000 Author: adrian Date: Mon Mar 10 06:03:35 2014 New Revision: 262969 URL: http://svnweb.freebsd.org/changeset/base/262969 Log: Migrate the chip power mode status to public ath_hal, rather than the private per-chip HAL. This allows the ah_osdep.[ch] code to check whether the power state is valid for doing chip programming. It should be a no-op for normal driver work but it does require a clean kernel/module rebuild, as the size of HAL structures have changed. Now, this doesn't track whether the hardware is ACTUALLY awake, as NETWORK_SLEEP wakes the chip up for a short period when traffic is received. This doesn't actually set the power mode to AWAKE, so we have to be careful about how we touch things. But it's enough to start down the path of implementing station mode chipset power savings, as a large part of the silliness is making sure the chip is awake during periodic calibration / ANI and random places where transmit may be occuring. I'd rather not a repeat of debugging power save on ath9k, where races with calibration and transmit path stuff took a couple years to shake out. Tested: * AR5416, STA mode Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5210/ar5210.h head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c head/sys/dev/ath/ath_hal/ar5210/ar5210_power.c head/sys/dev/ath/ath_hal/ar5211/ar5211.h head/sys/dev/ath/ath_hal/ar5211/ar5211_power.c head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c head/sys/dev/ath/ath_hal/ar5312/ar5312_power.c head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Mon Mar 10 02:38:41 2014 (r262968) +++ head/sys/dev/ath/ath_hal/ah.h Mon Mar 10 06:03:35 2014 (r262969) @@ -1297,6 +1297,9 @@ struct ath_hal { uint32_t ah_intrstate[8]; /* last int state */ uint32_t ah_syncstate; /* last sync intr state */ + /* Current powerstate from HAL calls */ + HAL_POWER_MODE ah_powerMode; + HAL_OPS_CONFIG ah_config; const HAL_RATE_TABLE *__ahdecl(*ah_getRateTable)(struct ath_hal *, u_int mode); Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210.h Mon Mar 10 02:38:41 2014 (r262968) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210.h Mon Mar 10 06:03:35 2014 (r262969) @@ -108,7 +108,6 @@ struct ath_hal_5210 { uint32_t ah_txDescInterruptMask; uint32_t ah_txEolInterruptMask; uint32_t ah_txUrnInterruptMask; - HAL_POWER_MODE ah_powerMode; uint8_t ah_bssid[IEEE80211_ADDR_LEN]; HAL_TX_QUEUE_INFO ah_txq[HAL_NUM_TX_QUEUES]; /* beacon+cab+data */ /* Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Mon Mar 10 02:38:41 2014 (r262968) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Mon Mar 10 06:03:35 2014 (r262969) @@ -219,7 +219,7 @@ ar5210Attach(uint16_t devid, HAL_SOFTC s AH_PRIVATE(ah)->ah_powerLimit = AR5210_MAX_RATE_POWER; AH_PRIVATE(ah)->ah_tpScale = HAL_TP_SCALE_MAX; /* no scaling */ - ahp->ah_powerMode = HAL_PM_UNDEFINED; + ah->ah_powerMode = HAL_PM_UNDEFINED; ahp->ah_staId1Defaults = 0; ahp->ah_rssiThr = INIT_RSSI_THR; ahp->ah_sifstime = (u_int) -1; Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_power.c Mon Mar 10 02:38:41 2014 (r262968) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_power.c Mon Mar 10 06:03:35 2014 (r262969) @@ -93,7 +93,6 @@ ar5210SetPowerModeSleep(struct ath_hal * HAL_BOOL ar5210SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode, int setChip) { - struct ath_hal_5210 *ahp = AH5210(ah); #ifdef AH_DEBUG static const char* modes[] = { "AWAKE", @@ -105,7 +104,7 @@ ar5210SetPowerMode(struct ath_hal *ah, H int status = AH_TRUE; HALDEBUG(ah, HAL_DEBUG_POWER, "%s: %s -> %s (%s)\n", __func__, - modes[ahp->ah_powerMode], modes[mode], + modes[ah->ah_powerMode], modes[mode], setChip ? "set chip " : ""); switch (mode) { case HAL_PM_AWAKE: @@ -122,7 +121,7 @@ ar5210SetPowerMode(struct ath_hal *ah, H __func__, mode); return AH_FALSE; } - ahp->ah_powerMode = mode; + ah->ah_powerMode = mode; return status; } Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211.h Mon Mar 10 02:38:41 2014 (r262968) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211.h Mon Mar 10 06:03:35 2014 (r262969) @@ -119,7 +119,6 @@ struct ath_hal_5211 { uint32_t ah_txEolInterruptMask; uint32_t ah_txUrnInterruptMask; HAL_TX_QUEUE_INFO ah_txq[HAL_NUM_TX_QUEUES]; - HAL_POWER_MODE ah_powerMode; HAL_ANT_SETTING ah_diversityControl; /* antenna setting */ uint32_t ah_calibrationTime; HAL_BOOL ah_bIQCalibration; Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_power.c Mon Mar 10 02:38:41 2014 (r262968) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_power.c Mon Mar 10 06:03:35 2014 (r262969) @@ -95,7 +95,6 @@ ar5211SetPowerModeNetworkSleep(struct at HAL_BOOL ar5211SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode, int setChip) { - struct ath_hal_5211 *ahp = AH5211(ah); #ifdef AH_DEBUG static const char* modes[] = { "AWAKE", @@ -107,7 +106,7 @@ ar5211SetPowerMode(struct ath_hal *ah, H int status = AH_TRUE; HALDEBUG(ah, HAL_DEBUG_POWER, "%s: %s -> %s (%s)\n", __func__, - modes[ahp->ah_powerMode], modes[mode], + modes[ah->ah_powerMode], modes[mode], setChip ? "set chip " : ""); switch (mode) { case HAL_PM_AWAKE: @@ -124,7 +123,7 @@ ar5211SetPowerMode(struct ath_hal *ah, H __func__, mode); return AH_FALSE; } - ahp->ah_powerMode = mode; + ah->ah_powerMode = mode; return status; } Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Mar 10 02:38:41 2014 (r262968) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Mar 10 06:03:35 2014 (r262969) @@ -270,7 +270,6 @@ struct ath_hal_5212 { uint32_t ah_intrTxqs; /* tx q interrupt state */ /* decomp mask array */ uint8_t ah_decompMask[HAL_DECOMP_MASK_SIZE]; - HAL_POWER_MODE ah_powerMode; HAL_ANT_SETTING ah_antControl; /* antenna setting */ HAL_BOOL ah_diversity; /* fast diversity setting */ enum { Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c Mon Mar 10 02:38:41 2014 (r262968) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c Mon Mar 10 06:03:35 2014 (r262969) @@ -119,7 +119,6 @@ ar5212SetPowerModeNetworkSleep(struct at HAL_BOOL ar5212SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode, int setChip) { - struct ath_hal_5212 *ahp = AH5212(ah); #ifdef AH_DEBUG static const char* modes[] = { "AWAKE", @@ -131,7 +130,7 @@ ar5212SetPowerMode(struct ath_hal *ah, H int status = AH_TRUE; HALDEBUG(ah, HAL_DEBUG_POWER, "%s: %s -> %s (%s)\n", __func__, - modes[ahp->ah_powerMode], modes[mode], + modes[ah->ah_powerMode], modes[mode], setChip ? "set chip " : ""); switch (mode) { case HAL_PM_AWAKE: @@ -148,7 +147,7 @@ ar5212SetPowerMode(struct ath_hal *ah, H __func__, mode); return AH_FALSE; } - ahp->ah_powerMode = mode; + ah->ah_powerMode = mode; return status; } Modified: head/sys/dev/ath/ath_hal/ar5312/ar5312_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5312/ar5312_power.c Mon Mar 10 02:38:41 2014 (r262968) +++ head/sys/dev/ath/ath_hal/ar5312/ar5312_power.c Mon Mar 10 06:03:35 2014 (r262969) @@ -71,7 +71,6 @@ ar5312SetPowerModeNetworkSleep(struct at HAL_BOOL ar5312SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode, int setChip) { - struct ath_hal_5212 *ahp = AH5212(ah); #ifdef AH_DEBUG static const char* modes[] = { "AWAKE", @@ -83,7 +82,7 @@ ar5312SetPowerMode(struct ath_hal *ah, H int status = AH_TRUE; HALDEBUG(ah, HAL_DEBUG_POWER, "%s: %s -> %s (%s)\n", __func__, - modes[ahp->ah_powerMode], modes[mode], + modes[ah->ah_powerMode], modes[mode], setChip ? "set chip " : ""); switch (mode) { case HAL_PM_AWAKE: @@ -100,7 +99,7 @@ ar5312SetPowerMode(struct ath_hal *ah, H __func__, mode); return AH_FALSE; } - ahp->ah_powerMode = mode; + ah->ah_powerMode = mode; return status; } Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c Mon Mar 10 02:38:41 2014 (r262968) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c Mon Mar 10 06:03:35 2014 (r262969) @@ -124,7 +124,6 @@ ar5416SetPowerModeNetworkSleep(struct at HAL_BOOL ar5416SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode, int setChip) { - struct ath_hal_5212 *ahp = AH5212(ah); #ifdef AH_DEBUG static const char* modes[] = { "AWAKE", @@ -138,7 +137,7 @@ ar5416SetPowerMode(struct ath_hal *ah, H return AH_TRUE; HALDEBUG(ah, HAL_DEBUG_POWER, "%s: %s -> %s (%s)\n", __func__, - modes[ahp->ah_powerMode], modes[mode], setChip ? "set chip " : ""); + modes[ah->ah_powerMode], modes[mode], setChip ? "set chip " : ""); switch (mode) { case HAL_PM_AWAKE: status = ar5416SetPowerModeAwake(ah, setChip); @@ -154,7 +153,7 @@ ar5416SetPowerMode(struct ath_hal *ah, H __func__, mode); return AH_FALSE; } - ahp->ah_powerMode = mode; + ah->ah_powerMode = mode; return status; } From owner-svn-src-head@FreeBSD.ORG Mon Mar 10 06:05:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE989582; Mon, 10 Mar 2014 06:05:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DAE778CF; Mon, 10 Mar 2014 06:05:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2A65Q0p077293; Mon, 10 Mar 2014 06:05:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2A65Q0G077292; Mon, 10 Mar 2014 06:05:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403100605.s2A65Q0G077292@svn.freebsd.org> From: Adrian Chadd Date: Mon, 10 Mar 2014 06:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262970 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 06:05:27 -0000 Author: adrian Date: Mon Mar 10 06:05:26 2014 New Revision: 262970 URL: http://svnweb.freebsd.org/changeset/base/262970 Log: Also tag the current HAL power mode in ar9300_set_power_mode(). Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c Mon Mar 10 06:03:35 2014 (r262969) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c Mon Mar 10 06:05:26 2014 (r262970) @@ -713,6 +713,7 @@ ar9300_set_power_mode(struct ath_hal *ah "%s: unknown power mode %u\n", __func__, mode); return AH_FALSE; } + ah->ah_powerMode = status; return status; } From owner-svn-src-head@FreeBSD.ORG Mon Mar 10 08:52:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3B60B25; Mon, 10 Mar 2014 08:52:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B0920983; Mon, 10 Mar 2014 08:52:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2A8qUHU045705; Mon, 10 Mar 2014 08:52:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2A8qUdC045704; Mon, 10 Mar 2014 08:52:30 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403100852.s2A8qUdC045704@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 10 Mar 2014 08:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262972 - head/sys/dev/usb/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 08:52:30 -0000 Author: hselasky Date: Mon Mar 10 08:52:30 2014 New Revision: 262972 URL: http://svnweb.freebsd.org/changeset/base/262972 Log: Ignore USB keyboard driver calls from critical sections. Reported by: Oliver Pinter MFC after: 1 week Modified: head/sys/dev/usb/input/ukbd.c Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Mon Mar 10 06:41:48 2014 (r262971) +++ head/sys/dev/usb/input/ukbd.c Mon Mar 10 08:52:30 2014 (r262972) @@ -1909,6 +1909,12 @@ ukbd_ioctl(keyboard_t *kbd, u_long cmd, int result; /* + * XXX Check of someone is calling us from a critical section: + */ + if (curthread->td_critnest != 0) + return (EDEADLK); + + /* * XXX KDGKBSTATE, KDSKBSTATE and KDSETLED can be called from any * context where printf(9) can be called, which among other things * includes interrupt filters and threads with any kinds of locks From owner-svn-src-head@FreeBSD.ORG Mon Mar 10 10:39:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A425741; Mon, 10 Mar 2014 10:39:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 85EB1302; Mon, 10 Mar 2014 10:39:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2AAdVgn088087; Mon, 10 Mar 2014 10:39:31 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2AAdTk5088077; Mon, 10 Mar 2014 10:39:29 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201403101039.s2AAdTk5088077@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 10 Mar 2014 10:39:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262975 - in head/contrib/libucl: . doc include src tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 10:39:31 -0000 Author: bapt Date: Mon Mar 10 10:39:29 2014 New Revision: 262975 URL: http://svnweb.freebsd.org/changeset/base/262975 Log: Update libucl to 2014-03-03 Added: head/contrib/libucl/Makefile.unix - copied unchanged from r262974, vendor/libucl/dist/Makefile.unix head/contrib/libucl/Makefile.w32 - copied unchanged from r262974, vendor/libucl/dist/Makefile.w32 head/contrib/libucl/tests/10.in - copied unchanged from r262974, vendor/libucl/dist/tests/10.in Deleted: head/contrib/libucl/Makefile Modified: head/contrib/libucl/doc/api.md head/contrib/libucl/include/ucl.h head/contrib/libucl/src/ucl_internal.h head/contrib/libucl/src/ucl_parser.c head/contrib/libucl/src/ucl_util.c head/contrib/libucl/tests/8.in head/contrib/libucl/tests/8.res Directory Properties: head/contrib/libucl/ (props changed) Copied: head/contrib/libucl/Makefile.unix (from r262974, vendor/libucl/dist/Makefile.unix) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libucl/Makefile.unix Mon Mar 10 10:39:29 2014 (r262975, copy of r262974, vendor/libucl/dist/Makefile.unix) @@ -0,0 +1,79 @@ +CC ?= gcc +DESTDIR ?= /usr/local +LD ?= gcc +C_COMMON_FLAGS ?= -fPIC -Wall -W -Wno-unused-parameter -Wno-pointer-sign -I./include -I./uthash -I./src +MAJOR_VERSION = 0 +MINOR_VERSION = 2 +PATCH_VERSION = 8 +VERSION = "$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)" +SONAME = libucl.so +SONAME_FULL = $(SONAME).$(MAJOR_VERSION) +OBJDIR ?= .obj +TESTDIR ?= tests +SRCDIR ?= src +INCLUDEDIR ?= include +MKDIR ?= mkdir +INSTALL ?= install +RM ?= rm +RMDIR ?= rmdir +LN ?= ln +LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) -shared -lm +LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl +LD_ADD ?= -lrt +COPT_FLAGS ?= -O2 +HDEPS = $(SRCDIR)/ucl_hash.h $(SRCDIR)/ucl_chartable.h $(SRCDIR)/ucl_internal.h $(INCLUDEDIR)/ucl.h $(SRCDIR)/xxhash.h +OBJECTS = $(OBJDIR)/ucl_hash.o $(OBJDIR)/ucl_util.o $(OBJDIR)/ucl_parser.o $(OBJDIR)/ucl_emitter.o $(OBJDIR)/xxhash.o + +all: $(OBJDIR) $(OBJDIR)/$(SONAME) + +$(OBJDIR)/$(SONAME): $(OBJDIR)/$(SONAME_FULL) + $(LN) -sf $(SONAME_FULL) $(OBJDIR)/$(SONAME) + +$(OBJDIR)/$(SONAME_FULL): $(OBJECTS) + $(CC) -o $(OBJDIR)/$(SONAME_FULL) $(OBJECTS) $(LD_SHARED_FLAGS) $(LDFLAGS) $(SSL_LIBS) $(FETCH_LIBS) + +$(OBJDIR): + @$(MKDIR) -p $(OBJDIR) + +# Compile rules +$(OBJDIR)/ucl_util.o: $(SRCDIR)/ucl_util.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_util.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_util.c +$(OBJDIR)/ucl_parser.o: $(SRCDIR)/ucl_parser.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_parser.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_parser.c +$(OBJDIR)/ucl_emitter.o: $(SRCDIR)/ucl_emitter.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_emitter.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter.c +$(OBJDIR)/ucl_hash.o: $(SRCDIR)/ucl_hash.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_hash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_hash.c +$(OBJDIR)/xxhash.o: $(SRCDIR)/xxhash.c $(HDEPS) + $(CC) -o $(OBJDIR)/xxhash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/xxhash.c + +clean: + $(RM) $(OBJDIR)/*.o $(OBJDIR)/$(SONAME_FULL) $(OBJDIR)/$(SONAME) $(OBJDIR)/chargen $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/objdump $(OBJDIR)/test_generate + $(RMDIR) $(OBJDIR) + +# Utils + +chargen: utils/chargen.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/chargen $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/chargen.c +objdump: utils/objdump.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/objdump $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/objdump.c $(LD_UCL_FLAGS) + +# Tests + +test: $(OBJDIR) $(OBJDIR)/$(SONAME) $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate + +run-test: test + TEST_DIR=$(TESTDIR) $(TESTDIR)/run_tests.sh $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate + +$(OBJDIR)/test_basic: $(TESTDIR)/test_basic.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/test_basic $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_basic.c $(LD_UCL_FLAGS) +$(OBJDIR)/test_speed: $(TESTDIR)/test_speed.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/test_speed $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_speed.c $(LD_UCL_FLAGS) $(LD_ADD) +$(OBJDIR)/test_generate: $(TESTDIR)/test_generate.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/test_generate $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_generate.c $(LD_UCL_FLAGS) $(LD_ADD) + +install: $(OBJDIR)/$(SONAME) + $(INSTALL) -m0755 $(SONAME) $(DESTDIR)/lib/$(SONAME) + $(INSTALL) -m0644 include/ucl.h $(DESTDIR)/include/ucl.h + +.PHONY: clean $(OBJDIR) Copied: head/contrib/libucl/Makefile.w32 (from r262974, vendor/libucl/dist/Makefile.w32) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libucl/Makefile.w32 Mon Mar 10 10:39:29 2014 (r262975, copy of r262974, vendor/libucl/dist/Makefile.w32) @@ -0,0 +1,79 @@ +CC ?= gcc +DESTDIR ?= /usr/local +LD ?= gcc +C_COMMON_FLAGS ?= -fPIC -Wall -W -Wno-unused-parameter -Wno-pointer-sign -I./include -I./uthash -I./src +MAJOR_VERSION = 0 +MINOR_VERSION = 2 +PATCH_VERSION = 8 +VERSION = "$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)" +SONAME = libucl.dll +OBJDIR ?= .obj +TESTDIR ?= tests +SRCDIR ?= src +INCLUDEDIR ?= include +MKDIR ?= mkdir +INSTALL ?= install +RM ?= rm +RMDIR ?= rmdir +ifeq (Windows_NT, $(OS)) +LN ?= ln +else +LN ?= rem ln +endif +LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) -shared -lm +LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl +LD_ADD ?= -lrt +COPT_FLAGS ?= -O2 +HDEPS = $(SRCDIR)/ucl_hash.h $(SRCDIR)/ucl_chartable.h $(SRCDIR)/ucl_internal.h $(INCLUDEDIR)/ucl.h $(SRCDIR)/xxhash.h +OBJECTS = $(OBJDIR)/ucl_hash.o $(OBJDIR)/ucl_util.o $(OBJDIR)/ucl_parser.o $(OBJDIR)/ucl_emitter.o $(OBJDIR)/xxhash.o + +all: $(OBJDIR) $(OBJDIR)/$(SONAME) + +$(OBJDIR)/$(SONAME): $(OBJECTS) + $(CC) -o $(OBJDIR)/$(SONAME) $(OBJECTS) $(LD_SHARED_FLAGS) $(LDFLAGS) $(SSL_LIBS) $(FETCH_LIBS) + +$(OBJDIR): + @$(MKDIR) -p $(OBJDIR) + +# Compile rules +$(OBJDIR)/ucl_util.o: $(SRCDIR)/ucl_util.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_util.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_util.c +$(OBJDIR)/ucl_parser.o: $(SRCDIR)/ucl_parser.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_parser.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_parser.c +$(OBJDIR)/ucl_emitter.o: $(SRCDIR)/ucl_emitter.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_emitter.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter.c +$(OBJDIR)/ucl_hash.o: $(SRCDIR)/ucl_hash.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_hash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_hash.c +$(OBJDIR)/xxhash.o: $(SRCDIR)/xxhash.c $(HDEPS) + $(CC) -o $(OBJDIR)/xxhash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/xxhash.c + +clean: + $(RM) $(OBJDIR)/*.o $(OBJDIR)/$(SONAME) $(OBJDIR)/$(SONAME) $(OBJDIR)/chargen $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/objdump $(OBJDIR)/test_generate + $(RMDIR) $(OBJDIR) + +# Utils + +chargen: utils/chargen.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/chargen $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/chargen.c +objdump: utils/objdump.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/objdump $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) utils/objdump.c $(LD_UCL_FLAGS) + +# Tests + +test: $(OBJDIR) $(OBJDIR)/$(SONAME) $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate + +run-test: test + TEST_DIR=$(TESTDIR) $(TESTDIR)/run_tests.sh $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate + +$(OBJDIR)/test_basic: $(TESTDIR)/test_basic.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/test_basic $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_basic.c $(LD_UCL_FLAGS) +$(OBJDIR)/test_speed: $(TESTDIR)/test_speed.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/test_speed $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_speed.c $(LD_UCL_FLAGS) $(LD_ADD) +$(OBJDIR)/test_generate: $(TESTDIR)/test_generate.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/test_generate $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_generate.c $(LD_UCL_FLAGS) $(LD_ADD) + +install: $(OBJDIR)/$(SONAME) + $(INSTALL) -m0755 $(SONAME) $(DESTDIR)/lib/$(SONAME) + $(INSTALL) -m0644 include/ucl.h $(DESTDIR)/include/ucl.h + +.PHONY: clean $(OBJDIR) Modified: head/contrib/libucl/doc/api.md ============================================================================== --- head/contrib/libucl/doc/api.md Mon Mar 10 10:24:22 2014 (r262974) +++ head/contrib/libucl/doc/api.md Mon Mar 10 10:39:29 2014 (r262975) @@ -260,4 +260,89 @@ Here is a list of all conversion functio - `ucl_object_tolstring` - returns `const char *` and `size_t` len of UCL object (string can be not NULL terminated) - `ucl_object_tostring_forced` - returns string representation of any UCL object -Strings returned by these pointers are associated with the UCL object and exist over its lifetime. A caller should not free this memory. \ No newline at end of file +Strings returned by these pointers are associated with the UCL object and exist over its lifetime. A caller should not free this memory. + +# Generation functions + +It is possible to generate UCL objects from C primitive types. Moreover, libucl permits to create and modify complex UCL objects, such as arrays or associative objects. + +## ucl_object_new +~~~C +ucl_object_t * ucl_object_new (void) +~~~ + +Creates new object of type `UCL_NULL`. This object should be released by caller. + +## ucl_object_typed_new +~~~C +ucl_object_t * ucl_object_typed_new (unsigned int type) +~~~ + +Create an object of a specified type: +- `UCL_OBJECT` - UCL object - key/value pairs +- `UCL_ARRAY` - UCL array +- `UCL_INT` - integer number +- `UCL_FLOAT` - floating point number +- `UCL_STRING` - NULL terminated string +- `UCL_BOOLEAN` - boolean value +- `UCL_TIME` - time value (floating point number of seconds) +- `UCL_USERDATA` - opaque userdata pointer (may be used in macros) +- `UCL_NULL` - null value + +This object should be released by caller. + +## Primitive objects generation +Libucl provides the functions similar to inverse conversion functions called with the specific C type: +- `ucl_object_fromint` - converts `int64_t` to UCL object +- `ucl_object_fromdouble` - converts `double` to UCL object +- `ucl_object_fromboolean` - converts `bool` to UCL object +- `ucl_object_fromstring` - converts `const char *` to UCL object (this string is NULL terminated) +- `ucl_object_fromlstring` - converts `const char *` and `size_t` len to UCL object (string can be not NULL terminated) + +Also there is a function to generate UCL object from a string performing various parsing or conversion operations called `ucl_object_fromstring_common`. + +## ucl_object_fromstring_common +~~~C +ucl_object_t * ucl_object_fromstring_common (const char *str, + size_t len, enum ucl_string_flags flags) +~~~ + +This function is used to convert a string `str` of size `len` to an UCL objects applying `flags` conversions. If `len` is equal to zero then a `str` is assumed as NULL-terminated. This function supports the following flags (a set of flags can be specified using logical `OR` operation): + +- `UCL_STRING_ESCAPE` - perform JSON escape +- `UCL_STRING_TRIM` - trim leading and trailing whitespaces +- `UCL_STRING_PARSE_BOOLEAN` - parse passed string and detect boolean +- `UCL_STRING_PARSE_INT` - parse passed string and detect integer number +- `UCL_STRING_PARSE_DOUBLE` - parse passed string and detect integer or float number +- `UCL_STRING_PARSE_NUMBER` - parse passed string and detect number (both float or integer types) +- `UCL_STRING_PARSE` - parse passed string (and detect booleans and numbers) +- `UCL_STRING_PARSE_BYTES` - assume that numeric multipliers are in bytes notation, for example `10k` means `10*1024` and not `10*1000` as assumed without this flag + +If parsing operations fail then the resulting UCL object will be a `UCL_STRING`. A caller should always check the type of the returned object and release it after using. + +# Iteration function + +Iteration are used to iterate over UCL compound types: arrays and objects. Moreover, iterations could be performed over the keys with multiple values (implicit arrays). To iterate over an object, an array or a key with multiple values there is a function `ucl_iterate_object`. + +## ucl_iterate_object +~~~C +ucl_object_t* ucl_iterate_object (ucl_object_t *obj, + ucl_object_iter_t *iter, bool expand_values); +~~~ + +This function accept opaque iterator pointer `iter`. In the first call this iterator *must* be initialized to `NULL`. Iterator is changed by this function call. `ucl_iterate_object` returns the next UCL object in the compound object `obj` or `NULL` if all objects have been iterated. The reference count of the object returned is not increased, so a caller should not unref the object or modify its content (e.g. by inserting to another compound object). The object `obj` should not be changed during the iteration process as well. `expand_values` flag speicifies whether `ucl_iterate_object` should expand keys with multiple values. The general rule is that if you need to iterate throught the *object* or *explicit array*, then you always need to set this flag to `true`. However, if you get some key in the object and want to extract all its values then you should set `expand_values` to `false`. Mixing of iteration types are not permitted since the iterator is set according to the iteration type and cannot be reused. Here is an example of iteration over the objects using libucl API (assuming that `top` is `UCL_OBJECT` in this example): + +~~~C +ucl_object_iter_t it = NULL, it_obj = NULL; +ucl_object_t *cur, *tmp; + +/* Iterate over the object */ +while ((obj = ucl_iterate_object (top, &it, true))) { + printf ("key: \"%s\"\n", ucl_object_key (obj)); + /* Iterate over the values of a key */ + while ((cur = ucl_iterate_object (obj, &it_obj, false))) { + printf ("value: \"%s\"\n", + ucl_object_tostring_forced (cur)); + } +} +~~~ \ No newline at end of file Modified: head/contrib/libucl/include/ucl.h ============================================================================== --- head/contrib/libucl/include/ucl.h Mon Mar 10 10:24:22 2014 (r262974) +++ head/contrib/libucl/include/ucl.h Mon Mar 10 10:39:29 2014 (r262975) @@ -32,6 +32,12 @@ #include #include +#ifdef _WIN32 +# define UCL_EXTERN __declspec(dllexport) +#else +# define UCL_EXTERN +#endif + /** * @mainpage * This is a reference manual for UCL API. You may find the description of UCL format by following this @@ -200,14 +206,14 @@ typedef struct ucl_object_s { * @param obj CL object * @return zero terminated key */ -char* ucl_copy_key_trash (ucl_object_t *obj); +UCL_EXTERN char* ucl_copy_key_trash (ucl_object_t *obj); /** * Copy and return a string value of an object, returned key is zero-terminated * @param obj CL object * @return zero terminated string representation of object value */ -char* ucl_copy_value_trash (ucl_object_t *obj); +UCL_EXTERN char* ucl_copy_value_trash (ucl_object_t *obj); /** * Creates a new object @@ -253,7 +259,7 @@ ucl_object_typed_new (unsigned int type) * @param flags conversion flags * @return new object */ -ucl_object_t * ucl_object_fromstring_common (const char *str, size_t len, +UCL_EXTERN ucl_object_t * ucl_object_fromstring_common (const char *str, size_t len, enum ucl_string_flags flags) UCL_WARN_UNUSED_RESULT; /** @@ -345,7 +351,7 @@ ucl_object_frombool (bool bv) * @param copy_key make an internal copy of key * @return new value of top object */ -ucl_object_t* ucl_object_insert_key (ucl_object_t *top, ucl_object_t *elt, +UCL_EXTERN ucl_object_t* ucl_object_insert_key (ucl_object_t *top, ucl_object_t *elt, const char *key, size_t keylen, bool copy_key) UCL_WARN_UNUSED_RESULT; /** @@ -358,10 +364,25 @@ ucl_object_t* ucl_object_insert_key (ucl * @param copy_key make an internal copy of key * @return new value of top object */ -ucl_object_t* ucl_object_replace_key (ucl_object_t *top, ucl_object_t *elt, +UCL_EXTERN ucl_object_t* ucl_object_replace_key (ucl_object_t *top, ucl_object_t *elt, const char *key, size_t keylen, bool copy_key) UCL_WARN_UNUSED_RESULT; /** + * Delete a object associated with key 'key', old object will be unrefered, + * @param top object + * @param key key associated to the object to remove + * @param keylen length of the key (or 0 for NULL terminated keys) + */ +UCL_EXTERN bool ucl_object_delete_keyl (ucl_object_t *top, const char *key, size_t keylen); + +/** + * Delete a object associated with key 'key', old object will be unrefered, + * @param top object + * @param key key associated to the object to remove + */ +UCL_EXTERN bool ucl_object_delete_key (ucl_object_t *top, const char *key); + +/** * Insert a object 'elt' to the hash 'top' and associate it with key 'key', if the specified key exist, * try to merge its content * @param top destination object (will be created automatically if top is NULL) @@ -371,7 +392,7 @@ ucl_object_t* ucl_object_replace_key (uc * @param copy_key make an internal copy of key * @return new value of top object */ -ucl_object_t* ucl_object_insert_key_merged (ucl_object_t *top, ucl_object_t *elt, +UCL_EXTERN ucl_object_t* ucl_object_insert_key_merged (ucl_object_t *top, ucl_object_t *elt, const char *key, size_t keylen, bool copy_key) UCL_WARN_UNUSED_RESULT; /** @@ -791,7 +812,7 @@ ucl_object_tolstring (ucl_object_t *obj, * @param key key to search * @return object matched the specified key or NULL if key is not found */ -ucl_object_t * ucl_object_find_key (ucl_object_t *obj, const char *key); +UCL_EXTERN ucl_object_t * ucl_object_find_key (ucl_object_t *obj, const char *key); /** * Return object identified by a fixed size key in the specified object @@ -800,7 +821,7 @@ ucl_object_t * ucl_object_find_key (ucl_ * @param klen length of a key * @return object matched the specified key or NULL if key is not found */ -ucl_object_t *ucl_object_find_keyl (ucl_object_t *obj, const char *key, size_t klen); +UCL_EXTERN ucl_object_t *ucl_object_find_keyl (ucl_object_t *obj, const char *key, size_t klen); /** * Returns a key of an object as a NULL terminated string @@ -830,7 +851,7 @@ ucl_object_keyl (ucl_object_t *obj, size * Free ucl object * @param obj ucl object to free */ -void ucl_object_free (ucl_object_t *obj); +UCL_EXTERN void ucl_object_free (ucl_object_t *obj); /** * Increase reference count for an object @@ -865,7 +886,7 @@ typedef void* ucl_object_iter_t; * while ((cur = ucl_iterate_object (obj, &it)) != NULL) ... * @return the next object or NULL */ -ucl_object_t* ucl_iterate_object (ucl_object_t *obj, ucl_object_iter_t *iter, bool expand_values); +UCL_EXTERN ucl_object_t* ucl_iterate_object (ucl_object_t *obj, ucl_object_iter_t *iter, bool expand_values); /** @} */ @@ -894,7 +915,7 @@ struct ucl_parser; * @param pool pool to allocate memory from * @return new parser object */ -struct ucl_parser* ucl_parser_new (int flags); +UCL_EXTERN struct ucl_parser* ucl_parser_new (int flags); /** * Register new handler for a macro @@ -903,7 +924,7 @@ struct ucl_parser* ucl_parser_new (int f * @param handler handler (it is called immediately after macro is parsed) * @param ud opaque user data for a handler */ -void ucl_parser_register_macro (struct ucl_parser *parser, const char *macro, +UCL_EXTERN void ucl_parser_register_macro (struct ucl_parser *parser, const char *macro, ucl_macro_handler handler, void* ud); /** @@ -912,7 +933,7 @@ void ucl_parser_register_macro (struct u * @param var variable name * @param value variable value */ -void ucl_parser_register_variable (struct ucl_parser *parser, const char *var, +UCL_EXTERN void ucl_parser_register_variable (struct ucl_parser *parser, const char *var, const char *value); /** @@ -923,7 +944,7 @@ void ucl_parser_register_variable (struc * @param err if *err is NULL it is set to parser error * @return true if chunk has been added and false in case of error */ -bool ucl_parser_add_chunk (struct ucl_parser *parser, const unsigned char *data, size_t len); +UCL_EXTERN bool ucl_parser_add_chunk (struct ucl_parser *parser, const unsigned char *data, size_t len); /** * Load and add data from a file @@ -932,7 +953,7 @@ bool ucl_parser_add_chunk (struct ucl_pa * @param err if *err is NULL it is set to parser error * @return true if chunk has been added and false in case of error */ -bool ucl_parser_add_file (struct ucl_parser *parser, const char *filename); +UCL_EXTERN bool ucl_parser_add_file (struct ucl_parser *parser, const char *filename); /** * Get a top object for a parser @@ -940,18 +961,18 @@ bool ucl_parser_add_file (struct ucl_par * @param err if *err is NULL it is set to parser error * @return top parser object or NULL */ -ucl_object_t* ucl_parser_get_object (struct ucl_parser *parser); +UCL_EXTERN ucl_object_t* ucl_parser_get_object (struct ucl_parser *parser); /** * Get the error string if failing * @param parser parser object */ -const char *ucl_parser_get_error(struct ucl_parser *parser); +UCL_EXTERN const char *ucl_parser_get_error(struct ucl_parser *parser); /** * Free ucl parser object * @param parser parser object */ -void ucl_parser_free (struct ucl_parser *parser); +UCL_EXTERN void ucl_parser_free (struct ucl_parser *parser); /** * Add new public key to parser for signatures check @@ -961,7 +982,7 @@ void ucl_parser_free (struct ucl_parser * @param err if *err is NULL it is set to parser error * @return true if a key has been successfully added */ -bool ucl_pubkey_add (struct ucl_parser *parser, const unsigned char *key, size_t len); +UCL_EXTERN bool ucl_pubkey_add (struct ucl_parser *parser, const unsigned char *key, size_t len); /** * Set FILENAME and CURDIR variables in parser @@ -970,7 +991,7 @@ bool ucl_pubkey_add (struct ucl_parser * * @param need_expand perform realpath() if this variable is true and filename is not NULL * @return true if variables has been set */ -bool ucl_parser_set_filevars (struct ucl_parser *parser, const char *filename, +UCL_EXTERN bool ucl_parser_set_filevars (struct ucl_parser *parser, const char *filename, bool need_expand); /** @} */ @@ -1005,7 +1026,7 @@ struct ucl_emitter_functions { * #UCL_EMIT_CONFIG then emit config like object * @return dump of an object (must be freed after using) or NULL in case of error */ -unsigned char *ucl_object_emit (ucl_object_t *obj, enum ucl_emitter emit_type); +UCL_EXTERN unsigned char *ucl_object_emit (ucl_object_t *obj, enum ucl_emitter emit_type); /** * Emit object to a string @@ -1014,7 +1035,7 @@ unsigned char *ucl_object_emit (ucl_obje * #UCL_EMIT_CONFIG then emit config like object * @return dump of an object (must be freed after using) or NULL in case of error */ -bool ucl_object_emit_full (ucl_object_t *obj, enum ucl_emitter emit_type, +UCL_EXTERN bool ucl_object_emit_full (ucl_object_t *obj, enum ucl_emitter emit_type, struct ucl_emitter_functions *emitter); /** @} */ Modified: head/contrib/libucl/src/ucl_internal.h ============================================================================== --- head/contrib/libucl/src/ucl_internal.h Mon Mar 10 10:24:22 2014 (r262974) +++ head/contrib/libucl/src/ucl_internal.h Mon Mar 10 10:39:29 2014 (r262975) @@ -25,7 +25,9 @@ #define UCL_INTERNAL_H_ #include +#ifndef _WIN32 #include +#endif #include #include Modified: head/contrib/libucl/src/ucl_parser.c ============================================================================== --- head/contrib/libucl/src/ucl_parser.c Mon Mar 10 10:24:22 2014 (r262974) +++ head/contrib/libucl/src/ucl_parser.c Mon Mar 10 10:39:29 2014 (r262975) @@ -1233,6 +1233,28 @@ ucl_parse_multiline_string (struct ucl_p return len; } +static ucl_object_t* +ucl_get_value_object (struct ucl_parser *parser) +{ + ucl_object_t *t, *obj = NULL; + + if (parser->stack->obj->type == UCL_ARRAY) { + /* Object must be allocated */ + obj = ucl_object_new (); + t = parser->stack->obj->value.av; + DL_APPEND (t, obj); + parser->cur_obj = obj; + parser->stack->obj->value.av = t; + parser->stack->obj->len ++; + } + else { + /* Object has been already allocated */ + obj = parser->cur_obj; + } + + return obj; +} + /** * Handle value data * @param parser @@ -1243,32 +1265,30 @@ static bool ucl_parse_value (struct ucl_parser *parser, struct ucl_chunk *chunk) { const unsigned char *p, *c; - ucl_object_t *obj = NULL, *t; + ucl_object_t *obj = NULL; unsigned int stripped_spaces; int str_len; bool need_unescape = false, ucl_escape = false, var_expand = false; p = chunk->pos; - while (p < chunk->end) { - if (obj == NULL) { - if (parser->stack->obj->type == UCL_ARRAY) { - /* Object must be allocated */ - obj = ucl_object_new (); - t = parser->stack->obj->value.av; - DL_APPEND (t, obj); - parser->cur_obj = obj; - parser->stack->obj->value.av = t; - parser->stack->obj->len ++; - } - else { - /* Object has been already allocated */ - obj = parser->cur_obj; - } + /* Skip any spaces and comments */ + if (ucl_test_character (*p, UCL_CHARACTER_WHITESPACE_UNSAFE) || + (chunk->remain >= 2 && ucl_lex_is_comment (p[0], p[1]))) { + while (p < chunk->end && ucl_test_character (*p, UCL_CHARACTER_WHITESPACE_UNSAFE)) { + ucl_chunk_skipc (chunk, p); + } + if (!ucl_skip_comments (parser)) { + return false; } + p = chunk->pos; + } + + while (p < chunk->end) { c = p; switch (*p) { case '"': + obj = ucl_get_value_object (parser); ucl_chunk_skipc (chunk, p); if (!ucl_lex_json_string (parser, chunk, &need_unescape, &ucl_escape, &var_expand)) { return false; @@ -1285,6 +1305,7 @@ ucl_parse_value (struct ucl_parser *pars return true; break; case '{': + obj = ucl_get_value_object (parser); /* We have a new object */ obj = ucl_add_parser_stack (obj, parser, false, parser->stack->level); @@ -1292,13 +1313,25 @@ ucl_parse_value (struct ucl_parser *pars return true; break; case '[': + obj = ucl_get_value_object (parser); /* We have a new array */ obj = ucl_add_parser_stack (obj, parser, true, parser->stack->level); ucl_chunk_skipc (chunk, p); return true; break; + case ']': + /* We have the array ending */ + if (parser->stack && parser->stack->obj->type == UCL_ARRAY) { + parser->state = UCL_STATE_AFTER_VALUE; + return true; + } + else { + goto parse_string; + } + break; case '<': + obj = ucl_get_value_object (parser); /* We have something like multiline value, which must be <<[A-Z]+\n */ if (chunk->end - p > 3) { if (memcmp (p, "<<", 2) == 0) { @@ -1332,17 +1365,9 @@ ucl_parse_value (struct ucl_parser *pars } /* Fallback to ordinary strings */ default: - /* Skip any spaces and comments */ - if (ucl_test_character (*p, UCL_CHARACTER_WHITESPACE_UNSAFE) || - (chunk->remain >= 2 && ucl_lex_is_comment (p[0], p[1]))) { - while (p < chunk->end && ucl_test_character (*p, UCL_CHARACTER_WHITESPACE_UNSAFE)) { - ucl_chunk_skipc (chunk, p); - } - if (!ucl_skip_comments (parser)) { - return false; - } - p = chunk->pos; - continue; +parse_string: + if (obj == NULL) { + obj = ucl_get_value_object (parser); } /* Parse atom */ if (ucl_test_character (*p, UCL_CHARACTER_VALUE_DIGIT_START)) { Modified: head/contrib/libucl/src/ucl_util.c ============================================================================== --- head/contrib/libucl/src/ucl_util.c Mon Mar 10 10:24:22 2014 (r262974) +++ head/contrib/libucl/src/ucl_util.c Mon Mar 10 10:39:29 2014 (r262975) @@ -35,6 +35,75 @@ #include #endif +#ifdef _WIN32 +#include + +#define PROT_READ 1 +#define PROT_WRITE 2 +#define PROT_READWRITE 3 +#define MAP_SHARED 1 +#define MAP_PRIVATE 2 +#define MAP_FAILED ((void *) -1) + +static void *mmap(char *addr, size_t length, int prot, int access, int fd, off_t offset) +{ + void *map = NULL; + HANDLE handle = INVALID_HANDLE_VALUE; + + switch (prot) { + default: + case PROT_READ: + { + handle = CreateFileMapping((HANDLE) _get_osfhandle(fd), 0, PAGE_READONLY, 0, length, 0); + if (!handle) break; + map = (void *) MapViewOfFile(handle, FILE_MAP_READ, 0, 0, length); + CloseHandle(handle); + break; + } + case PROT_WRITE: + { + handle = CreateFileMapping((HANDLE) _get_osfhandle(fd), 0, PAGE_READWRITE, 0, length, 0); + if (!handle) break; + map = (void *) MapViewOfFile(handle, FILE_MAP_WRITE, 0, 0, length); + CloseHandle(handle); + break; + } + case PROT_READWRITE: + { + handle = CreateFileMapping((HANDLE) _get_osfhandle(fd), 0, PAGE_READWRITE, 0, length, 0); + if (!handle) break; + map = (void *) MapViewOfFile(handle, FILE_MAP_ALL_ACCESS, 0, 0, length); + CloseHandle(handle); + break; + } + } + if (map == (void *) NULL) { + return (void *) MAP_FAILED; + } + return (void *) ((char *) map + offset); +} + +static int munmap(void *map,size_t length) +{ + if (!UnmapViewOfFile(map)) { + return(-1); + } + return(0); +} + +static char* realpath(const char *path, char *resolved_path) { + char *p; + char tmp[MAX_PATH + 1]; + strncpy(tmp, path, sizeof(tmp)-1); + p = tmp; + while(*p) { + if (*p == '/') *p = '\\'; + p++; + } + return _fullpath(resolved_path, tmp, MAX_PATH); +} +#endif + /** * @file rcl_util.c * Utilities for rcl parsing @@ -177,7 +246,7 @@ ucl_unescape_json_string (char *str, siz return (t - str); } -char * +UCL_EXTERN char * ucl_copy_key_trash (ucl_object_t *obj) { if (obj->trash_stack[UCL_TRASH_KEY] == NULL && obj->key != NULL) { @@ -193,7 +262,7 @@ ucl_copy_key_trash (ucl_object_t *obj) return obj->trash_stack[UCL_TRASH_KEY]; } -char * +UCL_EXTERN char * ucl_copy_value_trash (ucl_object_t *obj) { if (obj->trash_stack[UCL_TRASH_VALUE] == NULL) { @@ -216,7 +285,7 @@ ucl_copy_value_trash (ucl_object_t *obj) return obj->trash_stack[UCL_TRASH_VALUE]; } -ucl_object_t* +UCL_EXTERN ucl_object_t* ucl_parser_get_object (struct ucl_parser *parser) { if (parser->state != UCL_STATE_ERROR && parser->top_obj != NULL) { @@ -226,7 +295,7 @@ ucl_parser_get_object (struct ucl_parser return NULL; } -void +UCL_EXTERN void ucl_parser_free (struct ucl_parser *parser) { struct ucl_stack *stack, *stmp; @@ -266,7 +335,7 @@ ucl_parser_free (struct ucl_parser *pars UCL_FREE (sizeof (struct ucl_parser), parser); } -const char * +UCL_EXTERN const char * ucl_parser_get_error(struct ucl_parser *parser) { if (parser->err == NULL) @@ -275,7 +344,7 @@ ucl_parser_get_error(struct ucl_parser * return utstring_body(parser->err); } -bool +UCL_EXTERN bool ucl_pubkey_add (struct ucl_parser *parser, const unsigned char *key, size_t len) { #ifndef HAVE_OPENSSL @@ -679,7 +748,7 @@ ucl_include_file (const unsigned char *d * @param err error ptr * @return */ -bool +UCL_EXTERN bool ucl_include_handler (const unsigned char *data, size_t len, void* ud) { struct ucl_parser *parser = ud; @@ -700,7 +769,7 @@ ucl_include_handler (const unsigned char * @param err error ptr * @return */ -bool +UCL_EXTERN bool ucl_includes_handler (const unsigned char *data, size_t len, void* ud) { struct ucl_parser *parser = ud; @@ -714,7 +783,7 @@ ucl_includes_handler (const unsigned cha } -bool +UCL_EXTERN bool ucl_try_include_handler (const unsigned char *data, size_t len, void* ud) { struct ucl_parser *parser = ud; @@ -727,7 +796,7 @@ ucl_try_include_handler (const unsigned return ucl_include_url (data, len, parser, false, false); } -bool +UCL_EXTERN bool ucl_parser_set_filevars (struct ucl_parser *parser, const char *filename, bool need_expand) { char realbuf[PATH_MAX], *curdir; @@ -757,7 +826,7 @@ ucl_parser_set_filevars (struct ucl_pars return true; } -bool +UCL_EXTERN bool ucl_parser_add_file (struct ucl_parser *parser, const char *filename) { unsigned char *buf; @@ -1055,6 +1124,29 @@ ucl_object_insert_key_common (ucl_object return top; } +bool +ucl_object_delete_keyl(ucl_object_t *top, const char *key, size_t keylen) +{ + ucl_object_t *found; + + found = ucl_object_find_keyl(top, key, keylen); + + if (found == NULL) + return false; + + ucl_hash_delete(top->value.ov, found); + ucl_object_unref (found); + top->len --; + + return true; +} + +bool +ucl_object_delete_key(ucl_object_t *top, const char *key) +{ + return ucl_object_delete_keyl(top, key, 0); +} + ucl_object_t * ucl_object_insert_key (ucl_object_t *top, ucl_object_t *elt, const char *key, size_t keylen, bool copy_key) Copied: head/contrib/libucl/tests/10.in (from r262974, vendor/libucl/dist/tests/10.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libucl/tests/10.in Mon Mar 10 10:39:29 2014 (r262975, copy of r262974, vendor/libucl/dist/tests/10.in) @@ -0,0 +1 @@ +a [] Modified: head/contrib/libucl/tests/8.in ============================================================================== --- head/contrib/libucl/tests/8.in Mon Mar 10 10:24:22 2014 (r262974) +++ head/contrib/libucl/tests/8.in Mon Mar 10 10:39:29 2014 (r262975) @@ -19,3 +19,5 @@ section test { section foo { # test param = 123.2; } + +array = [] Modified: head/contrib/libucl/tests/8.res ============================================================================== --- head/contrib/libucl/tests/8.res Mon Mar 10 10:24:22 2014 (r262974) +++ head/contrib/libucl/tests/8.res Mon Mar 10 10:39:29 2014 (r262975) @@ -33,4 +33,6 @@ section { param = 123.200000; } } +array [ +] From owner-svn-src-head@FreeBSD.ORG Mon Mar 10 14:36:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6E04D02; Mon, 10 Mar 2014 14:36:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9961CFE1; Mon, 10 Mar 2014 14:36:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2AEaSwk086770; Mon, 10 Mar 2014 14:36:28 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2AEaRCu086764; Mon, 10 Mar 2014 14:36:27 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201403101436.s2AEaRCu086764@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 10 Mar 2014 14:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262976 - in head: etc/mtree share/examples share/examples/dma tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 14:36:28 -0000 Author: bapt Date: Mon Mar 10 14:36:27 2014 New Revision: 262976 URL: http://svnweb.freebsd.org/changeset/base/262976 Log: Add a mailer.conf example to use dma Added: head/share/examples/dma/ head/share/examples/dma/mailer.conf (contents, props changed) Modified: head/etc/mtree/BSD.usr.dist head/share/examples/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Mon Mar 10 10:39:29 2014 (r262975) +++ head/etc/mtree/BSD.usr.dist Mon Mar 10 14:36:27 2014 (r262976) @@ -301,6 +301,8 @@ .. diskless .. + dma + .. drivers .. etc Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Mon Mar 10 10:39:29 2014 (r262975) +++ head/share/examples/Makefile Mon Mar 10 14:36:27 2014 (r262976) @@ -247,6 +247,9 @@ SUBDIR+=ipfilter .if ${MK_PF} != "no" SUBDIR+=pf .endif +.if ${MK_DMAGENT} != "no" +SUBDIR+=dma +.endif .endif .if ${MK_TESTS} != "no" Added: head/share/examples/dma/mailer.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/dma/mailer.conf Mon Mar 10 14:36:27 2014 (r262976) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +sendmail /usr/libexec/dma +send-mail /usr/libexec/dma +mailq /usr/libexec/dma Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Mar 10 10:39:29 2014 (r262975) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Mar 10 14:36:27 2014 (r262976) @@ -4311,4 +4311,5 @@ OLD_FILES+=usr/bin/svnversion OLD_FILES+=usr/libexec/dma OLD_FILES+=usr/libexec/dma-mbox-create OLD_FILES+=usr/share/man/man8/dma.8.gz +OLD_FILES+=usr/share/examples/dma/mailer.conf .endif From owner-svn-src-head@FreeBSD.ORG Mon Mar 10 15:59:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CA5B620; Mon, 10 Mar 2014 15:59:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 59A51ADD; Mon, 10 Mar 2014 15:59:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2AFxpIB023940; Mon, 10 Mar 2014 15:59:51 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2AFxpLf023939; Mon, 10 Mar 2014 15:59:51 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201403101559.s2AFxpLf023939@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 10 Mar 2014 15:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262977 - head/share/examples/dma X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 15:59:51 -0000 Author: bapt Date: Mon Mar 10 15:59:50 2014 New Revision: 262977 URL: http://svnweb.freebsd.org/changeset/base/262977 Log: Add the makefile forgotten in previous commit Added: head/share/examples/dma/Makefile (contents, props changed) Added: head/share/examples/dma/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/dma/Makefile Mon Mar 10 15:59:50 2014 (r262977) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +NO_OBJ= + +FILES= mailer.conf + +FILESDIR= ${SHAREDIR}/examples/dma + +.include + From owner-svn-src-head@FreeBSD.ORG Mon Mar 10 16:07:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92C51A2F; Mon, 10 Mar 2014 16:07:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7FAF4BDB; Mon, 10 Mar 2014 16:07:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2AG7jJi028309; Mon, 10 Mar 2014 16:07:45 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2AG7jXv028308; Mon, 10 Mar 2014 16:07:45 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201403101607.s2AG7jXv028308@svn.freebsd.org> From: John Baldwin Date: Mon, 10 Mar 2014 16:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262978 - head/usr.sbin/mptable X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 16:07:45 -0000 Author: jhb Date: Mon Mar 10 16:07:45 2014 New Revision: 262978 URL: http://svnweb.freebsd.org/changeset/base/262978 Log: Pass the size of the top-level table to map when mapping the table instead of the size of the pointer. Reported by: Coverity Coverity CID: 1147171 Modified: head/usr.sbin/mptable/mptable.c Modified: head/usr.sbin/mptable/mptable.c ============================================================================== --- head/usr.sbin/mptable/mptable.c Mon Mar 10 15:59:50 2014 (r262977) +++ head/usr.sbin/mptable/mptable.c Mon Mar 10 16:07:45 2014 (r262978) @@ -402,7 +402,7 @@ MPFloatingPointer( u_int32_t paddr, int mpfps_t mpfps; /* map in mpfps structure*/ - *mpfpsp = mpfps = mapEntry( paddr, sizeof( mpfps ) ); + *mpfpsp = mpfps = mapEntry( paddr, sizeof( *mpfps ) ); /* show its contents */ printf( "MP Floating Pointer Structure:\n\n" ); From owner-svn-src-head@FreeBSD.ORG Mon Mar 10 18:10:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10B16BA1; Mon, 10 Mar 2014 18:10:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EE4ADAF5; Mon, 10 Mar 2014 18:10:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2AIAEAV084045; Mon, 10 Mar 2014 18:10:14 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2AIA9g9084012; Mon, 10 Mar 2014 18:10:09 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403101810.s2AIA9g9084012@svn.freebsd.org> From: Ian Lepore Date: Mon, 10 Mar 2014 18:10:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262979 - in head/sys/arm: allwinner allwinner/a20 arm at91 broadcom/bcm2835 econa freescale/imx freescale/vybrid lpc mv rockchip s3c2xx0 samsung/exynos tegra ti versatile xilinx xscale... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 18:10:15 -0000 Author: ian Date: Mon Mar 10 18:10:09 2014 New Revision: 262979 URL: http://svnweb.freebsd.org/changeset/base/262979 Log: Eliminate irq_dispatch.S. Move the data items it contained into arm/intr.c and the functionality it provided into arm/exception.S. Rename the main irq handling routine from arm_handler_execute() to arm_irq_handler() to make it more congruent with how other exception handlers are named, and also update its signature to reflect what has long been reality: it is passed just a trapframe pointer, no interrupt number argument. Deleted: head/sys/arm/arm/irq_dispatch.S Modified: head/sys/arm/allwinner/a20/files.a20 head/sys/arm/allwinner/files.a10 head/sys/arm/arm/exception.S head/sys/arm/arm/intr.c head/sys/arm/at91/files.at91 head/sys/arm/broadcom/bcm2835/files.bcm2835 head/sys/arm/econa/files.econa head/sys/arm/freescale/imx/files.imx51 head/sys/arm/freescale/imx/files.imx53 head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/vybrid/files.vybrid head/sys/arm/lpc/files.lpc head/sys/arm/mv/files.mv head/sys/arm/rockchip/files.rk30xx head/sys/arm/s3c2xx0/files.s3c2xx0 head/sys/arm/samsung/exynos/files.exynos5 head/sys/arm/tegra/files.tegra2 head/sys/arm/ti/files.ti head/sys/arm/versatile/files.versatile head/sys/arm/xilinx/files.zynq7 head/sys/arm/xscale/i80321/files.i80219 head/sys/arm/xscale/i80321/files.i80321 head/sys/arm/xscale/i8134x/files.i81342 head/sys/arm/xscale/ixp425/files.ixp425 head/sys/arm/xscale/pxa/files.pxa Modified: head/sys/arm/allwinner/a20/files.a20 ============================================================================== --- head/sys/arm/allwinner/a20/files.a20 Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/allwinner/a20/files.a20 Mon Mar 10 18:10:09 2014 (r262979) @@ -7,7 +7,6 @@ arm/arm/cpufunc_asm_armv5.S standard arm/arm/cpufunc_asm_arm10.S standard arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard -arm/arm/irq_dispatch.S standard arm/arm/gic.c standard arm/allwinner/a20/a20_cpu_cfg.c standard Modified: head/sys/arm/allwinner/files.a10 ============================================================================== --- head/sys/arm/allwinner/files.a10 Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/allwinner/files.a10 Mon Mar 10 18:10:09 2014 (r262979) @@ -7,7 +7,6 @@ arm/arm/cpufunc_asm_armv5.S standard arm/arm/cpufunc_asm_arm10.S standard arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard -arm/arm/irq_dispatch.S standard arm/allwinner/a10_clk.c standard arm/allwinner/a10_common.c standard Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/arm/exception.S Mon Mar 10 18:10:09 2014 (r262979) @@ -192,6 +192,16 @@ ASENTRY_NP(exception_exit) PULLFRAMEFROMSVCANDEXIT END(exception_exit) +ASENTRY_NP(irq_entry) + sub lr, lr, #0x00000004 /* Adjust the lr */ + PUSHFRAMEINSVC /* Push an interrupt frame */ + mov r0, sp /* arg for dispatcher */ + + adr lr, exception_exit + mov r1, #0 + b _C_LABEL(arm_irq_handler) +END(irq_entry) + /* * undefined_entry: * Modified: head/sys/arm/arm/intr.c ============================================================================== --- head/sys/arm/arm/intr.c Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/arm/intr.c Mon Mar 10 18:10:09 2014 (r262979) @@ -56,12 +56,18 @@ typedef void (*mask_fn)(void *); static struct intr_event *intr_events[NIRQ]; -void arm_handler_execute(struct trapframe *, int); +void arm_irq_handler(struct trapframe *); void (*arm_post_filter)(void *) = NULL; int (*arm_config_irq)(int irq, enum intr_trigger trig, enum intr_polarity pol) = NULL; +/* Data for statistics reporting. */ +u_long intrcnt[NIRQ]; +char intrnames[NIRQ * INTRNAME_LEN]; +size_t sintrcnt = sizeof(intrcnt); +size_t sintrnames = sizeof(intrnames); + /* * Pre-format intrnames into an array of fixed-size strings containing spaces. * This allows us to avoid the need for an intermediate table of indices into @@ -127,7 +133,7 @@ dosoftints(void) } void -arm_handler_execute(struct trapframe *frame, int irqnb) +arm_irq_handler(struct trapframe *frame) { struct intr_event *event; int i; Modified: head/sys/arm/at91/files.at91 ============================================================================== --- head/sys/arm/at91/files.at91 Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/at91/files.at91 Mon Mar 10 18:10:09 2014 (r262979) @@ -1,6 +1,5 @@ # $FreeBSD$ arm/arm/cpufunc_asm_arm9.S standard -arm/arm/irq_dispatch.S standard arm/at91/at91_machdep.c standard arm/at91/at91_aic.c standard arm/at91/at91.c standard Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm2835 Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/broadcom/bcm2835/files.bcm2835 Mon Mar 10 18:10:09 2014 (r262979) @@ -22,7 +22,6 @@ arm/arm/cpufunc_asm_arm11.S arm/arm/cpufunc_asm_arm11x6.S standard arm/arm/cpufunc_asm_armv5.S standard arm/arm/cpufunc_asm_armv6.S standard -arm/arm/irq_dispatch.S standard kern/kern_clocksource.c standard Modified: head/sys/arm/econa/files.econa ============================================================================== --- head/sys/arm/econa/files.econa Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/econa/files.econa Mon Mar 10 18:10:09 2014 (r262979) @@ -6,7 +6,6 @@ arm/econa/timer.c standard arm/econa/uart_bus_ec.c optional uart arm/econa/uart_cpu_ec.c optional uart dev/uart/uart_dev_ns8250.c optional uart -arm/arm/irq_dispatch.S standard arm/arm/bus_space_generic.c standard arm/econa/ehci_ebus.c optional ehci arm/econa/ohci_ec.c optional ohci Modified: head/sys/arm/freescale/imx/files.imx51 ============================================================================== --- head/sys/arm/freescale/imx/files.imx51 Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/freescale/imx/files.imx51 Mon Mar 10 18:10:09 2014 (r262979) @@ -4,7 +4,6 @@ arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_armv5.S standard arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard -arm/arm/irq_dispatch.S standard kern/kern_clocksource.c standard # Init Modified: head/sys/arm/freescale/imx/files.imx53 ============================================================================== --- head/sys/arm/freescale/imx/files.imx53 Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/freescale/imx/files.imx53 Mon Mar 10 18:10:09 2014 (r262979) @@ -4,7 +4,6 @@ arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_armv5.S standard arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard -arm/arm/irq_dispatch.S standard kern/kern_clocksource.c standard # Init Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/freescale/imx/files.imx6 Mon Mar 10 18:10:09 2014 (r262979) @@ -8,7 +8,6 @@ arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv5.S standard arm/arm/cpufunc_asm_armv7.S standard -arm/arm/irq_dispatch.S standard kern/kern_clocksource.c standard # Modified: head/sys/arm/freescale/vybrid/files.vybrid ============================================================================== --- head/sys/arm/freescale/vybrid/files.vybrid Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/freescale/vybrid/files.vybrid Mon Mar 10 18:10:09 2014 (r262979) @@ -8,7 +8,6 @@ arm/arm/cpufunc_asm_armv5.S standard arm/arm/cpufunc_asm_arm10.S standard arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard -arm/arm/irq_dispatch.S standard arm/arm/bus_space-v6.c standard arm/arm/gic.c standard Modified: head/sys/arm/lpc/files.lpc ============================================================================== --- head/sys/arm/lpc/files.lpc Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/lpc/files.lpc Mon Mar 10 18:10:09 2014 (r262979) @@ -1,6 +1,5 @@ # $FreeBSD$ arm/arm/bus_space_generic.c standard -arm/arm/irq_dispatch.S standard arm/arm/cpufunc_asm_arm9.S standard arm/arm/cpufunc_asm_armv5.S standard arm/lpc/lpc_machdep.c standard Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/mv/files.mv Mon Mar 10 18:10:09 2014 (r262979) @@ -20,7 +20,6 @@ arm/arm/cpufunc_asm_armv5_ec.S standard arm/arm/cpufunc_asm_armv7.S standard arm/arm/cpufunc_asm_sheeva.S standard arm/arm/cpufunc_asm_pj4b.S standard -arm/arm/irq_dispatch.S standard arm/mv/bus_space.c standard arm/mv/gpio.c standard Modified: head/sys/arm/rockchip/files.rk30xx ============================================================================== --- head/sys/arm/rockchip/files.rk30xx Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/rockchip/files.rk30xx Mon Mar 10 18:10:09 2014 (r262979) @@ -7,7 +7,6 @@ arm/arm/cpufunc_asm_armv5.S standard arm/arm/cpufunc_asm_arm10.S standard arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard -arm/arm/irq_dispatch.S standard arm/arm/gic.c standard arm/arm/mpcore_timer.c standard Modified: head/sys/arm/s3c2xx0/files.s3c2xx0 ============================================================================== --- head/sys/arm/s3c2xx0/files.s3c2xx0 Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/s3c2xx0/files.s3c2xx0 Mon Mar 10 18:10:09 2014 (r262979) @@ -2,7 +2,6 @@ arm/arm/bus_space_asm_generic.S standard arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_arm9.S standard -arm/arm/irq_dispatch.S standard arm/s3c2xx0/board_ln2410sbc.c optional board_ln2410sbc arm/s3c2xx0/s3c24x0_rtc.c standard arm/s3c2xx0/s3c24x0_machdep.c standard Modified: head/sys/arm/samsung/exynos/files.exynos5 ============================================================================== --- head/sys/arm/samsung/exynos/files.exynos5 Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/samsung/exynos/files.exynos5 Mon Mar 10 18:10:09 2014 (r262979) @@ -8,7 +8,6 @@ arm/arm/cpufunc_asm_armv5.S standard arm/arm/cpufunc_asm_arm10.S standard arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard -arm/arm/irq_dispatch.S standard arm/arm/bus_space-v6.c standard arm/arm/gic.c standard Modified: head/sys/arm/tegra/files.tegra2 ============================================================================== --- head/sys/arm/tegra/files.tegra2 Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/tegra/files.tegra2 Mon Mar 10 18:10:09 2014 (r262979) @@ -6,7 +6,6 @@ arm/arm/bus_space-v6.c standard arm/arm/cpufunc_asm_armv5.S standard arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard -arm/arm/irq_dispatch.S standard arm/arm/gic.c standard arm/arm/mpcore_timer.c standard Modified: head/sys/arm/ti/files.ti ============================================================================== --- head/sys/arm/ti/files.ti Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/ti/files.ti Mon Mar 10 18:10:09 2014 (r262979) @@ -9,7 +9,6 @@ arm/arm/cpufunc_asm_armv5.S standard arm/arm/cpufunc_asm_arm10.S standard arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard -arm/arm/irq_dispatch.S standard arm/ti/ti_common.c standard arm/ti/ti_cpuid.c standard Modified: head/sys/arm/versatile/files.versatile ============================================================================== --- head/sys/arm/versatile/files.versatile Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/versatile/files.versatile Mon Mar 10 18:10:09 2014 (r262979) @@ -6,7 +6,6 @@ arm/arm/cpufunc_asm_arm11.S arm/arm/cpufunc_asm_arm11x6.S standard arm/arm/cpufunc_asm_armv5.S standard arm/arm/cpufunc_asm_armv6.S standard -arm/arm/irq_dispatch.S standard arm/versatile/bus_space.c standard arm/versatile/pl050.c optional sc Modified: head/sys/arm/xilinx/files.zynq7 ============================================================================== --- head/sys/arm/xilinx/files.zynq7 Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/xilinx/files.zynq7 Mon Mar 10 18:10:09 2014 (r262979) @@ -11,7 +11,6 @@ arm/arm/cpufunc_asm_armv5.S standard arm/arm/cpufunc_asm_arm10.S standard arm/arm/cpufunc_asm_arm11.S standard arm/arm/cpufunc_asm_armv7.S standard -arm/arm/irq_dispatch.S standard arm/arm/gic.c standard arm/arm/mpcore_timer.c standard Modified: head/sys/arm/xscale/i80321/files.i80219 ============================================================================== --- head/sys/arm/xscale/i80321/files.i80219 Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/xscale/i80321/files.i80219 Mon Mar 10 18:10:09 2014 (r262979) @@ -4,7 +4,6 @@ # arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_xscale.S standard -arm/arm/irq_dispatch.S standard arm/xscale/i80321/i80321.c standard arm/xscale/i80321/i80321_dma.c optional dma arm/xscale/i80321/i80321_mcu.c standard Modified: head/sys/arm/xscale/i80321/files.i80321 ============================================================================== --- head/sys/arm/xscale/i80321/files.i80321 Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/xscale/i80321/files.i80321 Mon Mar 10 18:10:09 2014 (r262979) @@ -1,7 +1,6 @@ #$FreeBSD$ arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_xscale.S standard -arm/arm/irq_dispatch.S standard arm/xscale/i80321/i80321.c standard arm/xscale/i80321/i80321_aau.c optional aau arm/xscale/i80321/i80321_dma.c optional dma Modified: head/sys/arm/xscale/i8134x/files.i81342 ============================================================================== --- head/sys/arm/xscale/i8134x/files.i81342 Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/xscale/i8134x/files.i81342 Mon Mar 10 18:10:09 2014 (r262979) @@ -2,7 +2,6 @@ arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_xscale.S standard arm/arm/cpufunc_asm_xscale_c3.S standard -arm/arm/irq_dispatch.S standard arm/xscale/i80321/i80321_timer.c standard arm/xscale/i80321/i80321_wdog.c optional iopwdog arm/xscale/i8134x/i81342.c standard Modified: head/sys/arm/xscale/ixp425/files.ixp425 ============================================================================== --- head/sys/arm/xscale/ixp425/files.ixp425 Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/xscale/ixp425/files.ixp425 Mon Mar 10 18:10:09 2014 (r262979) @@ -1,7 +1,6 @@ #$FreeBSD$ arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_xscale.S standard -arm/arm/irq_dispatch.S standard arm/xscale/ixp425/ixp425.c standard arm/xscale/ixp425/ixp425_mem.c standard arm/xscale/ixp425/ixp425_space.c standard Modified: head/sys/arm/xscale/pxa/files.pxa ============================================================================== --- head/sys/arm/xscale/pxa/files.pxa Mon Mar 10 16:07:45 2014 (r262978) +++ head/sys/arm/xscale/pxa/files.pxa Mon Mar 10 18:10:09 2014 (r262979) @@ -2,7 +2,6 @@ arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_xscale.S standard -arm/arm/irq_dispatch.S standard arm/xscale/pxa/pxa_gpio.c standard arm/xscale/pxa/pxa_icu.c standard From owner-svn-src-head@FreeBSD.ORG Mon Mar 10 19:36:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD331257; Mon, 10 Mar 2014 19:36:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B9636600; Mon, 10 Mar 2014 19:36:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2AJaRXZ020152; Mon, 10 Mar 2014 19:36:27 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2AJaQF7020148; Mon, 10 Mar 2014 19:36:26 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403101936.s2AJaQF7020148@svn.freebsd.org> From: Ian Lepore Date: Mon, 10 Mar 2014 19:36:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262980 - in head/sys: arm/arm conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 19:36:27 -0000 Author: ian Date: Mon Mar 10 19:36:26 2014 New Revision: 262980 URL: http://svnweb.freebsd.org/changeset/base/262980 Log: Move the exception vector table (so-called "page0" data) into exception.S and eliminate vectors.S. All low-level exception handling is now consolidated into exception.S. Along with moving the default FIQ handler, change it to disable FIQs before returning. An FIQ should never happen, but if it does, it's got to be disabled as part of ignoring it. In general, we have hand-wavy support for FIQs that probably hasn't been used for 10 years and probably doesn't work (almost certainly doesn't work for SMP because it only updates the vector on the current cpu). This change doesn't really make the overall situation any better or worse. Deleted: head/sys/arm/arm/vectors.S Modified: head/sys/arm/arm/exception.S head/sys/arm/arm/fiq.c head/sys/arm/arm/fiq_subr.S head/sys/conf/files.arm Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Mon Mar 10 18:10:09 2014 (r262979) +++ head/sys/arm/arm/exception.S Mon Mar 10 19:36:26 2014 (r262980) @@ -148,7 +148,7 @@ _C_LABEL(data_abort_handler_address): END(data_abort_entry) /* - * address_exception_entry: + * addr_exception_entry: * * Handler for the Address Exception exception. * @@ -156,17 +156,17 @@ END(data_abort_entry) * print a warning message to the console and then treat * it like a Data Abort. */ -ASENTRY_NP(address_exception_entry) +ASENTRY_NP(addr_exception_entry) mrs r1, cpsr mrs r2, spsr mov r3, lr - adr r0, Laddress_exception_msg + adr r0, Laddr_exception_msg bl _C_LABEL(printf) /* XXX CLOBBERS LR!! */ b data_abort_entry -Laddress_exception_msg: +Laddr_exception_msg: .asciz "Address Exception CPSR=0x%08x SPSR=0x%08x LR=0x%08x\n" .balign 4 -END(address_exception_entry) +END(addr_exception_entry) /* * General exception exit handler @@ -234,3 +234,63 @@ Lundefined_handler_address: _C_LABEL(undefined_handler_address): .word undefinedinstruction_bounce +/* + * Entry point for FIQ interrupts. + * + * We don't currently support FIQ handlers very much. Something can + * install itself in the FIQ vector using code (that may or may not work + * these days) in fiq.c. If nobody does that and an FIQ happens, this + * default handler just disables FIQs and otherwise ignores it. + */ +ASENTRY_NP(fiq_entry) + mrs r8, cpsr /* FIQ handling isn't supported, */ + bic r8, #(F32_bit) /* just disable FIQ and return. */ + msr cpsr_c, r8 /* The r8 we trash here is the */ + subs pc, lr, #4 /* banked FIQ-mode r8. */ +END(fiq_entry) + +/* + * page0 and page0_data -- An image of the ARM vectors which is copied to + * the ARM vectors page (high or low) as part of CPU initialization. The + * code that does the copy assumes that page0_data holds one 32-bit word + * of data for each of the predefined ARM vectors. It also assumes that + * page0_data follows the vectors in page0, but other stuff can appear + * between the two. We currently leave room between the two for some fiq + * handler code to be copied in. + */ + .global _C_LABEL(page0), _C_LABEL(page0_data) + +_C_LABEL(page0): + ldr pc, .Lreset_entry + ldr pc, .Lundefined_entry + ldr pc, .Lswi_entry + ldr pc, .Lprefetch_abort_entry + ldr pc, .Ldata_abort_entry + ldr pc, .Laddr_exception_entry + ldr pc, .Lirq_entry +.fiqv: ldr pc, .Lfiq_entry + .space 256 /* room for some fiq handler code */ + +_C_LABEL(page0_data): +.Lreset_entry: .word reset_entry +.Lundefined_entry: .word undefined_entry +.Lswi_entry: .word swi_entry +.Lprefetch_abort_entry: .word prefetch_abort_entry +.Ldata_abort_entry: .word data_abort_entry +.Laddr_exception_entry: .word addr_exception_entry +.Lirq_entry: .word irq_entry +.Lfiq_entry: .word fiq_entry + +/* + * These items are used by the code in fiq.c to install what it calls the + * "null" handler. It's actually our default vector entry that just jumps + * to the default handler which just disables FIQs and returns. + */ + .global _C_LABEL(fiq_nullhandler_code), _C_LABEL(fiq_nullhandler_size) + +_C_LABEL(fiq_nullhandler_code): + .word .fiqv +_C_LABEL(fiq_nullhandler_size): + .word 4 + + Modified: head/sys/arm/arm/fiq.c ============================================================================== --- head/sys/arm/arm/fiq.c Mon Mar 10 18:10:09 2014 (r262979) +++ head/sys/arm/arm/fiq.c Mon Mar 10 19:36:26 2014 (r262980) @@ -51,8 +51,8 @@ __FBSDID("$FreeBSD$"); TAILQ_HEAD(, fiqhandler) fiqhandler_stack = TAILQ_HEAD_INITIALIZER(fiqhandler_stack); -extern char fiqvector[]; -extern char fiq_nullhandler[], fiq_nullhandler_end[]; +extern char *fiq_nullhandler_code; +extern uint32_t fiq_nullhandler_size; #define IRQ_BIT I32_bit #define FIQ_BIT F32_bit @@ -61,6 +61,9 @@ extern char fiq_nullhandler[], fiq_nullh * fiq_installhandler: * * Actually install the FIQ handler down at the FIQ vector. + * + * The FIQ vector is fixed by the hardware definition as the + * seventh 32-bit word in the vector page. * * Note: If the FIQ is invoked via an extra layer of * indirection, the actual FIQ code store lives in the @@ -70,11 +73,13 @@ extern char fiq_nullhandler[], fiq_nullh static void fiq_installhandler(void *func, size_t size) { + const uint32_t fiqvector = 7 * sizeof(uint32_t); + #if !defined(__ARM_FIQ_INDIRECT) vector_page_setprot(VM_PROT_READ|VM_PROT_WRITE); #endif - memcpy(vector_page + fiqvector, func, size); + memcpy((void *)(vector_page + fiqvector), func, size); #if !defined(__ARM_FIQ_INDIRECT) vector_page_setprot(VM_PROT_READ); @@ -159,8 +164,7 @@ fiq_release(struct fiqhandler *fh) if (TAILQ_FIRST(&fiqhandler_stack) == NULL) { /* Copy the NULL handler back down into the vector. */ - fiq_installhandler(fiq_nullhandler, - (size_t)(fiq_nullhandler_end - fiq_nullhandler)); + fiq_installhandler(fiq_nullhandler_code, fiq_nullhandler_size); /* Make sure FIQs are disabled when we return. */ oldirqstate |= FIQ_BIT; Modified: head/sys/arm/arm/fiq_subr.S ============================================================================== --- head/sys/arm/arm/fiq_subr.S Mon Mar 10 18:10:09 2014 (r262979) +++ head/sys/arm/arm/fiq_subr.S Mon Mar 10 19:36:26 2014 (r262980) @@ -91,13 +91,3 @@ ENTRY(fiq_setregs) RET END(fiq_setregs) -/* - * fiq_nullhandler: - * - * Null handler copied down to the FIQ vector when the last - * FIQ handler is removed. - */ - .global _C_LABEL(fiq_nullhandler), _C_LABEL(fiq_nullhandler_end) -_C_LABEL(fiq_nullhandler): - subs pc, lr, #4 -_C_LABEL(fiq_nullhandler_end): Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Mon Mar 10 18:10:09 2014 (r262979) +++ head/sys/conf/files.arm Mon Mar 10 19:36:26 2014 (r262980) @@ -50,7 +50,6 @@ arm/arm/sys_machdep.c standard arm/arm/trap.c standard arm/arm/uio_machdep.c standard arm/arm/undefined.c standard -arm/arm/vectors.S standard arm/arm/vm_machdep.c standard arm/arm/vfp.c standard board_id.h standard \ From owner-svn-src-head@FreeBSD.ORG Mon Mar 10 21:35:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 437B29AD; Mon, 10 Mar 2014 21:35:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3071528E; Mon, 10 Mar 2014 21:35:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2ALZSsY081959; Mon, 10 Mar 2014 21:35:28 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2ALZSmf081958; Mon, 10 Mar 2014 21:35:28 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403102135.s2ALZSmf081958@svn.freebsd.org> From: Devin Teske Date: Mon, 10 Mar 2014 21:35:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262982 - head/usr.sbin/bsdconfig/usermgmt/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 21:35:28 -0000 Author: dteske Date: Mon Mar 10 21:35:27 2014 New Revision: 262982 URL: http://svnweb.freebsd.org/changeset/base/262982 Log: Whitespace. Modified: head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Modified: head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Mon Mar 10 20:47:24 2014 (r262981) +++ head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Mon Mar 10 21:35:27 2014 (r262982) @@ -55,9 +55,9 @@ f_input_group() eval "$( pw groupshow "$group" 2> /dev/null | awk -F: ' { found = $1 != "" - printf "group_name='\'%s\''\n", $1 + printf "group_name='\'%s\''\n", $1 printf "group_password=\n" - printf "group_gid='\'%s\''\n", $3 + printf "group_gid='\'%s\''\n", $3 printf "group_members='\'%s\''\n", $4 exit } From owner-svn-src-head@FreeBSD.ORG Mon Mar 10 21:37:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06A26C55; Mon, 10 Mar 2014 21:37:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E6FD52C6; Mon, 10 Mar 2014 21:37:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2ALbemp082281; Mon, 10 Mar 2014 21:37:40 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2ALbeEW082280; Mon, 10 Mar 2014 21:37:40 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403102137.s2ALbeEW082280@svn.freebsd.org> From: Devin Teske Date: Mon, 10 Mar 2014 21:37:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262984 - head/usr.sbin/bsdconfig/usermgmt/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 21:37:41 -0000 Author: dteske Date: Mon Mar 10 21:37:40 2014 New Revision: 262984 URL: http://svnweb.freebsd.org/changeset/base/262984 Log: Remove vestigial global, no-longer used since SVN r262904. Modified: head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Modified: head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Mon Mar 10 21:37:07 2014 (r262983) +++ head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Mon Mar 10 21:37:40 2014 (r262984) @@ -157,7 +157,6 @@ f_dialog_input_group_name() setvar "$__var_to_set" "$__input" break done - save_flag=1 return $DIALOG_OK } @@ -256,7 +255,6 @@ f_dialog_input_group_password() setvar "$__var_to_set" "$__password1" break done - save_flag=1 return $DIALOG_OK } @@ -276,8 +274,6 @@ f_dialog_input_group_gid() "$__input" "$hline_num_tab_enter" || return $? setvar "$__var_to_set" "$__input" - save_flag=1 - return $DIALOG_OK } @@ -401,8 +397,6 @@ f_dialog_input_group_members() done setvar "$__var_to_set" "$__input" - save_flag=1 - return $DIALOG_OK } From owner-svn-src-head@FreeBSD.ORG Mon Mar 10 21:58:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7D4F272; Mon, 10 Mar 2014 21:58:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9A5D56C9; Mon, 10 Mar 2014 21:58:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2ALwdNU090383; Mon, 10 Mar 2014 21:58:39 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2ALwd1G090379; Mon, 10 Mar 2014 21:58:39 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403102158.s2ALwd1G090379@svn.freebsd.org> From: Dimitry Andric Date: Mon, 10 Mar 2014 21:58:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262985 - in head/contrib/llvm/lib/Target/Sparc: . InstPrinter MCTargetDesc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 21:58:39 -0000 Author: dim Date: Mon Mar 10 21:58:38 2014 New Revision: 262985 URL: http://svnweb.freebsd.org/changeset/base/262985 Log: Repair a few minor mismerges from r262261 in the clang-sparc64 project branch. This is also to minimize differences with upstream. MFC after: 3 weeks X-MFC-With: r262613 Deleted: head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcBaseInfo.h Modified: head/contrib/llvm/lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp Modified: head/contrib/llvm/lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp ============================================================================== --- head/contrib/llvm/lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp Mon Mar 10 21:37:40 2014 (r262984) +++ head/contrib/llvm/lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp Mon Mar 10 21:58:38 2014 (r262985) @@ -15,7 +15,6 @@ #include "SparcInstPrinter.h" #include "Sparc.h" -#include "MCTargetDesc/SparcBaseInfo.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCSymbol.h" Modified: head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp ============================================================================== --- head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp Mon Mar 10 21:37:40 2014 (r262984) +++ head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp Mon Mar 10 21:58:38 2014 (r262985) @@ -20,8 +20,8 @@ #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCRegisterInfo.h" -#include "llvm/ADT/Statistic.h" #include "llvm/MC/MCSymbol.h" +#include "llvm/ADT/Statistic.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; Modified: head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp Mon Mar 10 21:37:40 2014 (r262984) +++ head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp Mon Mar 10 21:58:38 2014 (r262985) @@ -17,7 +17,6 @@ #include "SparcMachineFunctionInfo.h" #include "SparcRegisterInfo.h" #include "SparcTargetMachine.h" -#include "MCTargetDesc/SparcBaseInfo.h" #include "SparcTargetObjectFile.h" #include "llvm/CodeGen/CallingConvLower.h" #include "llvm/CodeGen/MachineFrameInfo.h" From owner-svn-src-head@FreeBSD.ORG Mon Mar 10 22:38:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2241983; Mon, 10 Mar 2014 22:38:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF7E0A52; Mon, 10 Mar 2014 22:38:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2AMc8NQ006539; Mon, 10 Mar 2014 22:38:08 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2AMc8jo006536; Mon, 10 Mar 2014 22:38:08 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403102238.s2AMc8jo006536@svn.freebsd.org> From: Ian Lepore Date: Mon, 10 Mar 2014 22:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262986 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 22:38:09 -0000 Author: ian Date: Mon Mar 10 22:38:07 2014 New Revision: 262986 URL: http://svnweb.freebsd.org/changeset/base/262986 Log: Change the way the asm GET_CURTHREAD_PTR() macro is defined so that code using it doesn't have to have an "AST_LOCALS" macro somewhere in the file. Modified: head/sys/arm/arm/exception.S head/sys/arm/arm/swtch.S head/sys/arm/include/asmacros.h Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Mon Mar 10 21:58:38 2014 (r262985) +++ head/sys/arm/arm/exception.S Mon Mar 10 22:38:07 2014 (r262986) @@ -56,8 +56,6 @@ __FBSDID("$FreeBSD$"); .text .align 0 -AST_LOCALS - /* * reset_entry: * Modified: head/sys/arm/arm/swtch.S ============================================================================== --- head/sys/arm/arm/swtch.S Mon Mar 10 21:58:38 2014 (r262985) +++ head/sys/arm/arm/swtch.S Mon Mar 10 22:38:07 2014 (r262986) @@ -501,6 +501,5 @@ ENTRY(fork_trampoline) movs pc, lr /* Exit */ -AST_LOCALS END(fork_trampoline) Modified: head/sys/arm/include/asmacros.h ============================================================================== --- head/sys/arm/include/asmacros.h Mon Mar 10 21:58:38 2014 (r262985) +++ head/sys/arm/include/asmacros.h Mon Mar 10 22:38:07 2014 (r262986) @@ -243,13 +243,10 @@ name: #define GET_CURTHREAD_PTR(tmp) \ mrc p15, 0, tmp, c13, c0, 4 #else -#define AST_LOCALS ;\ -.Lcurthread: ;\ - .word _C_LABEL(__pcpu) + PC_CURTHREAD - -#define GET_CURTHREAD_PTR(tmp) \ - ldr tmp, .Lcurthread; \ - ldr tmp, [tmp] +#define AST_LOCALS +#define GET_CURTHREAD_PTR(tmp) \ + ldr tmp, =_C_LABEL(__pcpu);\ + ldr tmp, [tmp, #PC_CURTHREAD] #endif #define DO_AST \ From owner-svn-src-head@FreeBSD.ORG Mon Mar 10 22:52:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26FC2FF2; Mon, 10 Mar 2014 22:52:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 11C8AC02; Mon, 10 Mar 2014 22:52:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2AMqX1M014126; Mon, 10 Mar 2014 22:52:33 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2AMqWYe014123; Mon, 10 Mar 2014 22:52:32 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403102252.s2AMqWYe014123@svn.freebsd.org> From: Ian Lepore Date: Mon, 10 Mar 2014 22:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262987 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2014 22:52:33 -0000 Author: ian Date: Mon Mar 10 22:52:32 2014 New Revision: 262987 URL: http://svnweb.freebsd.org/changeset/base/262987 Log: Arrange for arm fork_trampoline() to return to userland via the standard swi_exit code in exception.S instead of having its own inline expansion of the DO_AST and PULLFRAME macros. That means that now all references to the PUSH/PULLFRAME and DO_AST macros are localized to exception.S, so move the macros themselves into there and remove them from asmacros.h Modified: head/sys/arm/arm/exception.S head/sys/arm/arm/swtch.S head/sys/arm/include/asmacros.h Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Mon Mar 10 22:38:07 2014 (r262986) +++ head/sys/arm/arm/exception.S Mon Mar 10 22:52:32 2014 (r262987) @@ -57,6 +57,216 @@ __FBSDID("$FreeBSD$"); .align 0 /* + * ASM macros for pushing and pulling trapframes from the stack + * + * These macros are used to handle the irqframe and trapframe structures + * defined above. + */ + +/* + * PUSHFRAME - macro to push a trap frame on the stack in the current mode + * Since the current mode is used, the SVC lr field is not defined. + * + * NOTE: r13 and r14 are stored separately as a work around for the + * SA110 rev 2 STM^ bug + */ +#ifdef ARM_TP_ADDRESS +#define PUSHFRAME \ + sub sp, sp, #4; /* Align the stack */ \ + str lr, [sp, #-4]!; /* Push the return address */ \ + sub sp, sp, #(4*17); /* Adjust the stack pointer */ \ + stmia sp, {r0-r12}; /* Push the user mode registers */ \ + add r0, sp, #(4*13); /* Adjust the stack pointer */ \ + stmia r0, {r13-r14}^; /* Push the user mode registers */ \ + mov r0, r0; /* NOP for previous instruction */ \ + mrs r0, spsr; /* Put the SPSR on the stack */ \ + str r0, [sp, #-4]!; \ + ldr r0, =ARM_RAS_START; \ + mov r1, #0; \ + str r1, [r0]; \ + mov r1, #0xffffffff; \ + str r1, [r0, #4]; +#else +#define PUSHFRAME \ + sub sp, sp, #4; /* Align the stack */ \ + str lr, [sp, #-4]!; /* Push the return address */ \ + sub sp, sp, #(4*17); /* Adjust the stack pointer */ \ + stmia sp, {r0-r12}; /* Push the user mode registers */ \ + add r0, sp, #(4*13); /* Adjust the stack pointer */ \ + stmia r0, {r13-r14}^; /* Push the user mode registers */ \ + mov r0, r0; /* NOP for previous instruction */ \ + mrs r0, spsr; /* Put the SPSR on the stack */ \ + str r0, [sp, #-4]!; +#endif + +/* + * PULLFRAME - macro to pull a trap frame from the stack in the current mode + * Since the current mode is used, the SVC lr field is ignored. + */ + +#ifdef ARM_TP_ADDRESS +#define PULLFRAME \ + ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ + msr spsr_fsxc, r0; \ + ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ + mov r0, r0; /* NOP for previous instruction */ \ + add sp, sp, #(4*17); /* Adjust the stack pointer */ \ + ldr lr, [sp], #0x0004; /* Pull the return address */ \ + add sp, sp, #4 /* Align the stack */ +#else +#define PULLFRAME \ + ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ + msr spsr_fsxc, r0; \ + clrex; \ + ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ + mov r0, r0; /* NOP for previous instruction */ \ + add sp, sp, #(4*17); /* Adjust the stack pointer */ \ + ldr lr, [sp], #0x0004; /* Pull the return address */ \ + add sp, sp, #4 /* Align the stack */ +#endif + +/* + * PUSHFRAMEINSVC - macro to push a trap frame on the stack in SVC32 mode + * This should only be used if the processor is not currently in SVC32 + * mode. The processor mode is switched to SVC mode and the trap frame is + * stored. The SVC lr field is used to store the previous value of + * lr in SVC mode. + * + * NOTE: r13 and r14 are stored separately as a work around for the + * SA110 rev 2 STM^ bug + */ +#ifdef ARM_TP_ADDRESS +#define PUSHFRAMEINSVC \ + stmdb sp, {r0-r3}; /* Save 4 registers */ \ + mov r0, lr; /* Save xxx32 r14 */ \ + mov r1, sp; /* Save xxx32 sp */ \ + mrs r3, spsr; /* Save xxx32 spsr */ \ + mrs r2, cpsr; /* Get the CPSR */ \ + bic r2, r2, #(PSR_MODE); /* Fix for SVC mode */ \ + orr r2, r2, #(PSR_SVC32_MODE); \ + msr cpsr_c, r2; /* Punch into SVC mode */ \ + mov r2, sp; /* Save SVC sp */ \ + bic sp, sp, #7; /* Align sp to an 8-byte addrress */ \ + sub sp, sp, #4; /* Pad trapframe to keep alignment */ \ + str r0, [sp, #-4]!; /* Push return address */ \ + str lr, [sp, #-4]!; /* Push SVC lr */ \ + str r2, [sp, #-4]!; /* Push SVC sp */ \ + msr spsr_fsxc, r3; /* Restore correct spsr */ \ + ldmdb r1, {r0-r3}; /* Restore 4 regs from xxx mode */ \ + sub sp, sp, #(4*15); /* Adjust the stack pointer */ \ + stmia sp, {r0-r12}; /* Push the user mode registers */ \ + add r0, sp, #(4*13); /* Adjust the stack pointer */ \ + stmia r0, {r13-r14}^; /* Push the user mode registers */ \ + mov r0, r0; /* NOP for previous instruction */ \ + ldr r5, =ARM_RAS_START; /* Check if there's any RAS */ \ + ldr r4, [r5, #4]; /* reset it to point at the */ \ + cmp r4, #0xffffffff; /* end of memory if necessary; */ \ + movne r1, #0xffffffff; /* leave value in r4 for later */ \ + strne r1, [r5, #4]; /* comparision against PC. */ \ + ldr r3, [r5]; /* Retrieve global RAS_START */ \ + cmp r3, #0; /* and reset it if non-zero. */ \ + movne r1, #0; /* If non-zero RAS_START and */ \ + strne r1, [r5]; /* PC was lower than RAS_END, */ \ + ldrne r1, [r0, #16]; /* adjust the saved PC so that */ \ + cmpne r4, r1; /* execution later resumes at */ \ + strhi r3, [r0, #16]; /* the RAS_START location. */ \ + mrs r0, spsr; \ + str r0, [sp, #-4]! +#else +#define PUSHFRAMEINSVC \ + stmdb sp, {r0-r3}; /* Save 4 registers */ \ + mov r0, lr; /* Save xxx32 r14 */ \ + mov r1, sp; /* Save xxx32 sp */ \ + mrs r3, spsr; /* Save xxx32 spsr */ \ + mrs r2, cpsr; /* Get the CPSR */ \ + bic r2, r2, #(PSR_MODE); /* Fix for SVC mode */ \ + orr r2, r2, #(PSR_SVC32_MODE); \ + msr cpsr_c, r2; /* Punch into SVC mode */ \ + mov r2, sp; /* Save SVC sp */ \ + bic sp, sp, #7; /* Align sp to an 8-byte addrress */ \ + sub sp, sp, #4; /* Pad trapframe to keep alignment */ \ + str r0, [sp, #-4]!; /* Push return address */ \ + str lr, [sp, #-4]!; /* Push SVC lr */ \ + str r2, [sp, #-4]!; /* Push SVC sp */ \ + msr spsr_fsxc, r3; /* Restore correct spsr */ \ + ldmdb r1, {r0-r3}; /* Restore 4 regs from xxx mode */ \ + sub sp, sp, #(4*15); /* Adjust the stack pointer */ \ + stmia sp, {r0-r12}; /* Push the user mode registers */ \ + add r0, sp, #(4*13); /* Adjust the stack pointer */ \ + stmia r0, {r13-r14}^; /* Push the user mode registers */ \ + mov r0, r0; /* NOP for previous instruction */ \ + mrs r0, spsr; /* Put the SPSR on the stack */ \ + str r0, [sp, #-4]! +#endif + +/* + * PULLFRAMEFROMSVCANDEXIT - macro to pull a trap frame from the stack + * in SVC32 mode and restore the saved processor mode and PC. + * This should be used when the SVC lr register needs to be restored on + * exit. + */ + +#ifdef ARM_TP_ADDRESS +#define PULLFRAMEFROMSVCANDEXIT \ + ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ + msr spsr_fsxc, r0; /* restore SPSR */ \ + ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ + mov r0, r0; /* NOP for previous instruction */ \ + add sp, sp, #(4*15); /* Adjust the stack pointer */ \ + ldmia sp, {sp, lr, pc}^ /* Restore lr and exit */ +#else +#define PULLFRAMEFROMSVCANDEXIT \ + ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ + msr spsr_fsxc, r0; /* restore SPSR */ \ + clrex; \ + ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ + mov r0, r0; /* NOP for previous instruction */ \ + add sp, sp, #(4*15); /* Adjust the stack pointer */ \ + ldmia sp, {sp, lr, pc}^ /* Restore lr and exit */ +#endif + +#if defined(__ARM_EABI__) +/* + * Unwind hints so we can unwind past functions that use + * PULLFRAMEFROMSVCANDEXIT. They are run in reverse order. + * As the last thing we do is restore the stack pointer + * we can ignore the padding at the end of struct trapframe. + */ +#define UNWINDSVCFRAME \ + .save {r13-r15}; /* Restore sp, lr, pc */ \ + .pad #(2*4); /* Skip user sp and lr */ \ + .save {r0-r12}; /* Restore r0-r12 */ \ + .pad #(4) /* Skip spsr */ +#else +#define UNWINDSVCFRAME +#endif + +#define DO_AST \ + ldr r0, [sp] /* Get the SPSR from stack */ ;\ + mrs r4, cpsr /* save CPSR */ ;\ + orr r1, r4, #(I32_bit|F32_bit) ;\ + msr cpsr_c, r1 /* Disable interrupts */ ;\ + and r0, r0, #(PSR_MODE) /* Returning to USR mode? */ ;\ + teq r0, #(PSR_USR32_MODE) ;\ + bne 2f /* Nope, get out now */ ;\ + bic r4, r4, #(I32_bit|F32_bit) ;\ +1: GET_CURTHREAD_PTR(r5) ;\ + ldr r1, [r5, #(TD_FLAGS)] ;\ + and r1, r1, #(TDF_ASTPENDING|TDF_NEEDRESCHED) ;\ + teq r1, #0x00000000 ;\ + beq 2f /* Nope. Just bail */ ;\ + msr cpsr_c, r4 /* Restore interrupts */ ;\ + mov r0, sp ;\ + bl _C_LABEL(ast) /* ast(frame) */ ;\ + orr r0, r4, #(I32_bit|F32_bit) ;\ + msr cpsr_c, r0 ;\ + b 1b ;\ +2: + + + + +/* * reset_entry: * * Handler for Reset exception. @@ -76,16 +286,27 @@ END(reset_entry) * Handler for the Software Interrupt exception. */ ASENTRY_NP(swi_entry) - STOP_UNWINDING /* Don't unwind past here */ + STOP_UNWINDING /* Don't unwind into user mode. */ PUSHFRAME mov r0, sp /* Pass the frame to any function */ bl _C_LABEL(swi_handler) /* It's a SWI ! */ - DO_AST + /* + * The fork_trampoline() code in swtch.S aranges for the MI fork_exit() + * to return to swi_exit here, to return to userland. The net effect is + * that a newly created thread appears to return from a SWI just like + * the parent thread that created it. + */ +ASENTRY_NP(swi_exit) + + DO_AST /* Deliver signals. */ + PULLFRAME movs pc, lr /* Exit */ + +END(swi_exit) END(swi_entry) /* Modified: head/sys/arm/arm/swtch.S ============================================================================== --- head/sys/arm/arm/swtch.S Mon Mar 10 22:38:07 2014 (r262986) +++ head/sys/arm/arm/swtch.S Mon Mar 10 22:52:32 2014 (r262987) @@ -486,20 +486,12 @@ ENTRY(savectx) END(savectx) ENTRY(fork_trampoline) - STOP_UNWINDING /* Can't unwind beyond the thread enty point */ - mov r1, r5 + STOP_UNWINDING /* EABI: Don't unwind beyond the thread enty point. */ + mov fp, #0 /* OABI: Stack traceback via fp stops here. */ mov r2, sp + mov r1, r5 mov r0, r4 - mov fp, #0 - bl _C_LABEL(fork_exit) - /* Kill irq"s */ - mrs r0, cpsr - orr r0, r0, #(I32_bit|F32_bit) - msr cpsr_c, r0 - DO_AST - PULLFRAME - - movs pc, lr /* Exit */ - + ldr lr, =swi_exit /* Go finish forking, then return */ + b _C_LABEL(fork_exit) /* to userland via swi_exit code. */ END(fork_trampoline) Modified: head/sys/arm/include/asmacros.h ============================================================================== --- head/sys/arm/include/asmacros.h Mon Mar 10 22:38:07 2014 (r262986) +++ head/sys/arm/include/asmacros.h Mon Mar 10 22:52:32 2014 (r262987) @@ -47,190 +47,6 @@ #ifdef LOCORE #include "opt_global.h" -/* - * ASM macros for pushing and pulling trapframes from the stack - * - * These macros are used to handle the irqframe and trapframe structures - * defined above. - */ - -/* - * PUSHFRAME - macro to push a trap frame on the stack in the current mode - * Since the current mode is used, the SVC lr field is not defined. - * - * NOTE: r13 and r14 are stored separately as a work around for the - * SA110 rev 2 STM^ bug - */ -#ifdef ARM_TP_ADDRESS -#define PUSHFRAME \ - sub sp, sp, #4; /* Align the stack */ \ - str lr, [sp, #-4]!; /* Push the return address */ \ - sub sp, sp, #(4*17); /* Adjust the stack pointer */ \ - stmia sp, {r0-r12}; /* Push the user mode registers */ \ - add r0, sp, #(4*13); /* Adjust the stack pointer */ \ - stmia r0, {r13-r14}^; /* Push the user mode registers */ \ - mov r0, r0; /* NOP for previous instruction */ \ - mrs r0, spsr; /* Put the SPSR on the stack */ \ - str r0, [sp, #-4]!; \ - ldr r0, =ARM_RAS_START; \ - mov r1, #0; \ - str r1, [r0]; \ - mov r1, #0xffffffff; \ - str r1, [r0, #4]; -#else -#define PUSHFRAME \ - sub sp, sp, #4; /* Align the stack */ \ - str lr, [sp, #-4]!; /* Push the return address */ \ - sub sp, sp, #(4*17); /* Adjust the stack pointer */ \ - stmia sp, {r0-r12}; /* Push the user mode registers */ \ - add r0, sp, #(4*13); /* Adjust the stack pointer */ \ - stmia r0, {r13-r14}^; /* Push the user mode registers */ \ - mov r0, r0; /* NOP for previous instruction */ \ - mrs r0, spsr; /* Put the SPSR on the stack */ \ - str r0, [sp, #-4]!; -#endif - -/* - * PULLFRAME - macro to pull a trap frame from the stack in the current mode - * Since the current mode is used, the SVC lr field is ignored. - */ - -#ifdef ARM_TP_ADDRESS -#define PULLFRAME \ - ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ - msr spsr_fsxc, r0; \ - ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ - mov r0, r0; /* NOP for previous instruction */ \ - add sp, sp, #(4*17); /* Adjust the stack pointer */ \ - ldr lr, [sp], #0x0004; /* Pull the return address */ \ - add sp, sp, #4 /* Align the stack */ -#else -#define PULLFRAME \ - ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ - msr spsr_fsxc, r0; \ - clrex; \ - ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ - mov r0, r0; /* NOP for previous instruction */ \ - add sp, sp, #(4*17); /* Adjust the stack pointer */ \ - ldr lr, [sp], #0x0004; /* Pull the return address */ \ - add sp, sp, #4 /* Align the stack */ -#endif - -/* - * PUSHFRAMEINSVC - macro to push a trap frame on the stack in SVC32 mode - * This should only be used if the processor is not currently in SVC32 - * mode. The processor mode is switched to SVC mode and the trap frame is - * stored. The SVC lr field is used to store the previous value of - * lr in SVC mode. - * - * NOTE: r13 and r14 are stored separately as a work around for the - * SA110 rev 2 STM^ bug - */ -#ifdef ARM_TP_ADDRESS -#define PUSHFRAMEINSVC \ - stmdb sp, {r0-r3}; /* Save 4 registers */ \ - mov r0, lr; /* Save xxx32 r14 */ \ - mov r1, sp; /* Save xxx32 sp */ \ - mrs r3, spsr; /* Save xxx32 spsr */ \ - mrs r2, cpsr; /* Get the CPSR */ \ - bic r2, r2, #(PSR_MODE); /* Fix for SVC mode */ \ - orr r2, r2, #(PSR_SVC32_MODE); \ - msr cpsr_c, r2; /* Punch into SVC mode */ \ - mov r2, sp; /* Save SVC sp */ \ - bic sp, sp, #7; /* Align sp to an 8-byte addrress */ \ - sub sp, sp, #4; /* Pad trapframe to keep alignment */ \ - str r0, [sp, #-4]!; /* Push return address */ \ - str lr, [sp, #-4]!; /* Push SVC lr */ \ - str r2, [sp, #-4]!; /* Push SVC sp */ \ - msr spsr_fsxc, r3; /* Restore correct spsr */ \ - ldmdb r1, {r0-r3}; /* Restore 4 regs from xxx mode */ \ - sub sp, sp, #(4*15); /* Adjust the stack pointer */ \ - stmia sp, {r0-r12}; /* Push the user mode registers */ \ - add r0, sp, #(4*13); /* Adjust the stack pointer */ \ - stmia r0, {r13-r14}^; /* Push the user mode registers */ \ - mov r0, r0; /* NOP for previous instruction */ \ - ldr r5, =ARM_RAS_START; /* Check if there's any RAS */ \ - ldr r4, [r5, #4]; /* reset it to point at the */ \ - cmp r4, #0xffffffff; /* end of memory if necessary; */ \ - movne r1, #0xffffffff; /* leave value in r4 for later */ \ - strne r1, [r5, #4]; /* comparision against PC. */ \ - ldr r3, [r5]; /* Retrieve global RAS_START */ \ - cmp r3, #0; /* and reset it if non-zero. */ \ - movne r1, #0; /* If non-zero RAS_START and */ \ - strne r1, [r5]; /* PC was lower than RAS_END, */ \ - ldrne r1, [r0, #16]; /* adjust the saved PC so that */ \ - cmpne r4, r1; /* execution later resumes at */ \ - strhi r3, [r0, #16]; /* the RAS_START location. */ \ - mrs r0, spsr; \ - str r0, [sp, #-4]! -#else -#define PUSHFRAMEINSVC \ - stmdb sp, {r0-r3}; /* Save 4 registers */ \ - mov r0, lr; /* Save xxx32 r14 */ \ - mov r1, sp; /* Save xxx32 sp */ \ - mrs r3, spsr; /* Save xxx32 spsr */ \ - mrs r2, cpsr; /* Get the CPSR */ \ - bic r2, r2, #(PSR_MODE); /* Fix for SVC mode */ \ - orr r2, r2, #(PSR_SVC32_MODE); \ - msr cpsr_c, r2; /* Punch into SVC mode */ \ - mov r2, sp; /* Save SVC sp */ \ - bic sp, sp, #7; /* Align sp to an 8-byte addrress */ \ - sub sp, sp, #4; /* Pad trapframe to keep alignment */ \ - str r0, [sp, #-4]!; /* Push return address */ \ - str lr, [sp, #-4]!; /* Push SVC lr */ \ - str r2, [sp, #-4]!; /* Push SVC sp */ \ - msr spsr_fsxc, r3; /* Restore correct spsr */ \ - ldmdb r1, {r0-r3}; /* Restore 4 regs from xxx mode */ \ - sub sp, sp, #(4*15); /* Adjust the stack pointer */ \ - stmia sp, {r0-r12}; /* Push the user mode registers */ \ - add r0, sp, #(4*13); /* Adjust the stack pointer */ \ - stmia r0, {r13-r14}^; /* Push the user mode registers */ \ - mov r0, r0; /* NOP for previous instruction */ \ - mrs r0, spsr; /* Put the SPSR on the stack */ \ - str r0, [sp, #-4]! -#endif - -/* - * PULLFRAMEFROMSVCANDEXIT - macro to pull a trap frame from the stack - * in SVC32 mode and restore the saved processor mode and PC. - * This should be used when the SVC lr register needs to be restored on - * exit. - */ - -#ifdef ARM_TP_ADDRESS -#define PULLFRAMEFROMSVCANDEXIT \ - ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ - msr spsr_fsxc, r0; /* restore SPSR */ \ - ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ - mov r0, r0; /* NOP for previous instruction */ \ - add sp, sp, #(4*15); /* Adjust the stack pointer */ \ - ldmia sp, {sp, lr, pc}^ /* Restore lr and exit */ -#else -#define PULLFRAMEFROMSVCANDEXIT \ - ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ - msr spsr_fsxc, r0; /* restore SPSR */ \ - clrex; \ - ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ - mov r0, r0; /* NOP for previous instruction */ \ - add sp, sp, #(4*15); /* Adjust the stack pointer */ \ - ldmia sp, {sp, lr, pc}^ /* Restore lr and exit */ -#endif -#if defined(__ARM_EABI__) -/* - * Unwind hints so we can unwind past functions that use - * PULLFRAMEFROMSVCANDEXIT. They are run in reverse order. - * As the last thing we do is restore the stack pointer - * we can ignore the padding at the end of struct trapframe. - */ -#define UNWINDSVCFRAME \ - .save {r13-r15}; /* Restore sp, lr, pc */ \ - .pad #(2*4); /* Skip user sp and lr */ \ - .save {r0-r12}; /* Restore r0-r12 */ \ - .pad #(4) /* Skip spsr */ -#else -#define UNWINDSVCFRAME -#endif - #define DATA(name) \ .data ; \ _ALIGN_DATA ; \ @@ -239,38 +55,14 @@ name: #ifdef _ARM_ARCH_6 -#define AST_LOCALS #define GET_CURTHREAD_PTR(tmp) \ mrc p15, 0, tmp, c13, c0, 4 #else -#define AST_LOCALS #define GET_CURTHREAD_PTR(tmp) \ ldr tmp, =_C_LABEL(__pcpu);\ ldr tmp, [tmp, #PC_CURTHREAD] #endif -#define DO_AST \ - ldr r0, [sp] /* Get the SPSR from stack */ ;\ - mrs r4, cpsr /* save CPSR */ ;\ - orr r1, r4, #(I32_bit|F32_bit) ;\ - msr cpsr_c, r1 /* Disable interrupts */ ;\ - and r0, r0, #(PSR_MODE) /* Returning to USR mode? */ ;\ - teq r0, #(PSR_USR32_MODE) ;\ - bne 2f /* Nope, get out now */ ;\ - bic r4, r4, #(I32_bit|F32_bit) ;\ -1: GET_CURTHREAD_PTR(r5) ;\ - ldr r1, [r5, #(TD_FLAGS)] ;\ - and r1, r1, #(TDF_ASTPENDING|TDF_NEEDRESCHED) ;\ - teq r1, #0x00000000 ;\ - beq 2f /* Nope. Just bail */ ;\ - msr cpsr_c, r4 /* Restore interrupts */ ;\ - mov r0, sp ;\ - bl _C_LABEL(ast) /* ast(frame) */ ;\ - orr r0, r4, #(I32_bit|F32_bit) ;\ - msr cpsr_c, r0 ;\ - b 1b ;\ -2: - #endif /* LOCORE */ #endif /* _KERNEL */ From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 00:21:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A6D8C6E; Tue, 11 Mar 2014 00:21:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 077D33E6; Tue, 11 Mar 2014 00:21:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2B0Ln5W051941; Tue, 11 Mar 2014 00:21:49 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2B0LnPX051940; Tue, 11 Mar 2014 00:21:49 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201403110021.s2B0LnPX051940@svn.freebsd.org> From: Andrew Turner Date: Tue, 11 Mar 2014 00:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262989 - head/lib/libc/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 00:21:50 -0000 Author: andrew Date: Tue Mar 11 00:21:49 2014 New Revision: 262989 URL: http://svnweb.freebsd.org/changeset/base/262989 Log: Export _libc_arm_fpu_present as a private symbol to be used by other system libraries, for example libm. Modified: head/lib/libc/arm/Symbol.map Modified: head/lib/libc/arm/Symbol.map ============================================================================== --- head/lib/libc/arm/Symbol.map Mon Mar 10 23:16:19 2014 (r262988) +++ head/lib/libc/arm/Symbol.map Tue Mar 11 00:21:49 2014 (r262989) @@ -76,4 +76,6 @@ FBSDprivate_1.0 { __fixunsdfsi; __extendsfdf2; __truncdfsf2; + + _libc_arm_fpu_present; }; From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 00:23:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3B7EDDF; Tue, 11 Mar 2014 00:23:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B634F5EA; Tue, 11 Mar 2014 00:23:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2B0No8d052238; Tue, 11 Mar 2014 00:23:50 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2B0NotY052237; Tue, 11 Mar 2014 00:23:50 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403110023.s2B0NotY052237@svn.freebsd.org> From: Xin LI Date: Tue, 11 Mar 2014 00:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262990 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 00:23:51 -0000 Author: delphij Date: Tue Mar 11 00:23:50 2014 New Revision: 262990 URL: http://svnweb.freebsd.org/changeset/base/262990 Log: MFV r262983: 4638 Panic in ZFS via rfs3_setattr()/rfs3_write(): dirtying snapshot! illumos/illumos-gate@2144b121c08e0eb676cc6ca4662ebbc9f9c22fe3 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Mar 11 00:21:49 2014 (r262989) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Mar 11 00:23:50 2014 (r262990) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ /* Portions Copyright 2007 Jeremy Teo */ @@ -842,6 +842,16 @@ zfs_write(vnode_t *vp, uio_t *uio, int i &zp->z_pflags, 8); /* + * In a case vp->v_vfsp != zp->z_zfsvfs->z_vfs (e.g. snapshots) our + * callers might not be able to detect properly that we are read-only, + * so check it explicitly here. + */ + if (zfsvfs->z_vfs->vfs_flag & VFS_RDONLY) { + ZFS_EXIT(zfsvfs); + return (SET_ERROR(EROFS)); + } + + /* * If immutable or not appending then return EPERM */ if ((zp->z_pflags & (ZFS_IMMUTABLE | ZFS_READONLY)) || @@ -5112,6 +5122,16 @@ zfs_space(vnode_t *vp, int cmd, flock64_ return (SET_ERROR(EINVAL)); } + /* + * In a case vp->v_vfsp != zp->z_zfsvfs->z_vfs (e.g. snapshots) our + * callers might not be able to detect properly that we are read-only, + * so check it explicitly here. + */ + if (zfsvfs->z_vfs->vfs_flag & VFS_RDONLY) { + ZFS_EXIT(zfsvfs); + return (SET_ERROR(EROFS)); + } + if (error = convoff(vp, bfp, 0, offset)) { ZFS_EXIT(zfsvfs); return (error); From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 00:25:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB4CFF29; Tue, 11 Mar 2014 00:25:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B7E415F7; Tue, 11 Mar 2014 00:25:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2B0Pte8052514; Tue, 11 Mar 2014 00:25:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2B0Ptdw052513; Tue, 11 Mar 2014 00:25:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403110025.s2B0Ptdw052513@svn.freebsd.org> From: Xin LI Date: Tue, 11 Mar 2014 00:25:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262991 - head/sys/nlm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 00:25:55 -0000 Author: delphij Date: Tue Mar 11 00:25:55 2014 New Revision: 262991 URL: http://svnweb.freebsd.org/changeset/base/262991 Log: Correct a typo in nlm_find_host_by_addr(): the intention of the code is to give "" rather than comparing the buffer against it. MFC after: 2 weeks Modified: head/sys/nlm/nlm_prot_impl.c Modified: head/sys/nlm/nlm_prot_impl.c ============================================================================== --- head/sys/nlm/nlm_prot_impl.c Tue Mar 11 00:23:50 2014 (r262990) +++ head/sys/nlm/nlm_prot_impl.c Tue Mar 11 00:25:55 2014 (r262991) @@ -1072,7 +1072,7 @@ nlm_find_host_by_addr(const struct socka break; #endif default: - strcmp(tmp, ""); + strlcpy(tmp, "", sizeof(tmp)); } From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 00:58:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99C2849C; Tue, 11 Mar 2014 00:58:45 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 44BDE8CA; Tue, 11 Mar 2014 00:58:44 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 7E6C41042450; Tue, 11 Mar 2014 11:58:43 +1100 (EST) Date: Tue, 11 Mar 2014 11:58:42 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marcel Moolenaar Subject: Re: svn commit: r262955 - head/etc In-Reply-To: <201403092051.s29KpEkS051035@svn.freebsd.org> Message-ID: <20140311093634.D1147@besplex.bde.org> References: <201403092051.s29KpEkS051035@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PqKqMW83 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=8D6f14zDHq4A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=lz6aOK_0zE1u8VndKhoA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 00:58:45 -0000 On Sun, 9 Mar 2014, Marcel Moolenaar wrote: > Log: > Add 3wire and std as terminal types/classes. These are similar to > the existing terminal types/classes that have the baudrate suffix, > but differ in that no baudrate is set/defined. > > The purpose of these new types/classes is to allow them to be used > for the serial console. Currently the uart(4) driver fixates the > baudrate and the CLOCAL flag, which means that it doesn't matter > whether you give it std. or 3wire. as the terminal type > to getty and what exactly is set to. It's being overridden > by uart(4). The goal is to change uart(4) not to override these > settings. This was handled correctly (not like the above) in sio starting in about 1994. I refined the Linux locking of tty parameters into the lock-state and initial-state tty devices. Consoles default to locking the speeds, CLOCAL (on) and HUPCL (off), while non-consoles default to not locking anything. Users with write permission on the lock state devices can change either. Fixating the settings in userland requires hacking on /etc/rc.d/serial or somewhere else in /etc/rc or later instead of in /etc/ttys. The initialization is a bit easier and the fixation then applies to all applications that either don't know about the lock state devices or don't have write permission on them. For example, the horrible cu application has a hard-coded default speed on 9600 bps. It blows away the default (initial-state) speed and uses this. To avoid typing in the speed or setting up config files for cu, you can fixate the speed to a more usable value. The version of cu in uucp wasn't as bad. It used the current speed (normally the initial speed), so it worked right without the fixation hack. But it normally needs programming of the initial-state devices in rc or later, to change from the system default speed of 9600 to something more useful. uart breaks this for consoles by ignoring the lock state setting for these parameters and forcing fixed settings instead. Upper layers also break this for CLOCAL. One version ignored the initial state for CLOCAL for callout devices and consoles and forced it on (so any locking of it kept it on). The current version seems to be relatively correct. It doesn't frob CLOCAL at open time, so the effects of this don't persist. However, it seems to have gone backwards for consoles. The TTY_CALLOUT() macro now classifies consoles as non-callout devices. This seems to result in the initial- state and lock-state parameters for the callout devices never being used for consoles. Instead, the initial-state and lock-state parameters for the callin devices are used for consoles. And without the hack to frob CLOCAL on for consoles, CLOCAL in the parameters is needed to avoid blocking in open for consoles. For consoles, it defaults to on for both devices, so the default case works right. CLOCAL is initialized specially for consoles in tty_init_console(). The rest of the function is not so good. It takes a speed parameter, though only one. Most drivers, including uart, neglect to use this parameter. uart fixates instead. tty_init_console() otherwise uses default parameters for the initial-state devices. These are correct for consoles but wrong for non-consoles. It is missing any initialization of the lock-state devices. So these have nothing locked, unless the driver initializes them. uart doesn't initialize them, but uses hard coded fixations to achieve the same result except that applications can't see the fixations that apply by reading the device and can't change the fixations by writing the device. uart also fixates HUPCL to off for consoles. Here are old fixes for this: % diff -c2 ./dev/uart/uart_tty.c~ ./dev/uart/uart_tty.c % *** ./dev/uart/uart_tty.c~ Sat Dec 24 05:22:06 2011 % --- ./dev/uart/uart_tty.c Sat Dec 24 05:22:08 2011 % *************** % *** 241,250 **** % if (t->c_ispeed != t->c_ospeed && t->c_ospeed != 0) % return (EINVAL); % - /* Fixate certain parameters for system devices. */ % - if (sc->sc_sysdev != NULL) { % - t->c_ispeed = t->c_ospeed = sc->sc_sysdev->baudrate; % - t->c_cflag |= CLOCAL; % - t->c_cflag &= ~HUPCL; % - } % if (t->c_ospeed == 0) { % UART_SETSIG(sc, SER_DDTR | SER_DRTS); % --- 241,244 ---- % *************** % *** 383,387 **** % sprintf(((struct consdev *)sc->sc_sysdev->cookie)->cn_name, % "ttyu%r", unit); % ! tty_init_console(tp, 0); % } % % --- 377,381 ---- % sprintf(((struct consdev *)sc->sc_sysdev->cookie)->cn_name, % "ttyu%r", unit); % ! tty_init_console(tp, sc->sc_sysdev->baudrate); % } % For uart, just delete the fixation and use the standard mechanism. This depends on fixing upper layers to initialize CLOCAL and HUPCL in the lock- state devices and ~HUPCL in the initial-state-devices. The upper layers already handled the speed, but uart didn't tell them the speed. The complete patch is much larger, to fix the last bug in many drivers. Other drivers are mostly just missing fixation. % diff -c2 ./kern/tty.c~ ./kern/tty.c % *** ./kern/tty.c~ Fri Mar 2 08:50:08 2012 % --- ./kern/tty.c Fri Mar 2 08:50:09 2012 % *************** % *** 822,829 **** % struct termios *t = &tp->t_termios_init_in; % % t->c_cflag = TTYDEF_CFLAG; % ! t->c_iflag = TTYDEF_IFLAG; % ! t->c_lflag = TTYDEF_LFLAG; % ! t->c_oflag = TTYDEF_OFLAG; % t->c_ispeed = TTYDEF_SPEED; % t->c_ospeed = TTYDEF_SPEED; % --- 852,867 ---- % struct termios *t = &tp->t_termios_init_in; % % + /* % + * Default to raw mode. The defaults in are % + * really getty's defaults for login terminals, so they must not % + * all be used here. It is most important to have echo flags off % + * initially to prevent echo wars before the echo flags can be % + * turned off. % + */ % t->c_cflag = TTYDEF_CFLAG; % ! t->c_iflag = IGNBRK; % ! t->c_lflag = 0; % ! t->c_oflag = 0; % ! % t->c_ispeed = TTYDEF_SPEED; % t->c_ospeed = TTYDEF_SPEED; This recovers from regressions in the non-console case. % *************** % *** 833,849 **** % } % % void % ! tty_init_console(struct tty *tp, speed_t s) % { % ! struct termios *ti = &tp->t_termios_init_in; % ! struct termios *to = &tp->t_termios_init_out; % % ! if (s != 0) { % ! ti->c_ispeed = ti->c_ospeed = s; % ! to->c_ispeed = to->c_ospeed = s; % ! } % % ! ti->c_cflag |= CLOCAL; % ! to->c_cflag |= CLOCAL; % } % % --- 871,920 ---- % } % % + /* % + * There is no getty for the single-user shell, so we must do its job and % + * change the default flags to ones suitable for logins. Also, if requested % + * to, then change the speed to whatever it actually is and lock this, and % + * unconditionally set CLOCAL and lock this, and unconditionally clear % + * HUPCL and lock this. % + * % + * Callers must tell us their speed and have us lock it iff they have a % + * speed that matters. % + * % + * These settings of CLOCAL and HUPCL are normally backwards for logins, % + * but CLOCAL is enforced so that the console cannot block endlessly when % + * a naive application like syslogd(8) attempts to write to it using a % + * simple open/write/close sequence, and ~HUPCL is enforced to avoid hanging % + * up on close in such a sequence (when the console is not held open by % + * another thread). Output is normally discarded instead of blocking. % + * Most ad hoc writes to the console use wall(8)'s ttymsg() and that is % + * remarkably deficent in terminal handling (it has none, but depends on % + * O_NONBLOCK). Not hanging up is a smaller feature. It matter mainly % + * when the other side of the connection is naive and is not using CLOCAL % + * so the connection gets broken by our hangup. However, if the other side % + * is sophisicated then it might prefer to get signaled on all transitions % + * of carrier. This can be supported by changing the initial state device % + * after booting. We should be more careful about raising and lowering % + * carrier before we are ready and finished, respectively, so that handshakes % + * based on carrier work. % + */ % void % ! tty_init_console(struct tty *tp, speed_t speed) % { % ! struct termios *tinit, *tlock; % % ! tinit = &tp->t_termios_init_in; % ! tlock= &tp->t_termios_lock_in; % ! if (speed != 0) { % ! tinit->c_ispeed = tinit->c_ospeed = speed; % ! tlock->c_ispeed = tlock->c_ospeed = speed; % ! } % ! tinit->c_cflag = (TTYDEF_CFLAG | CLOCAL) & ~HUPCL; % ! tlock->c_cflag = CLOCAL | HUPCL; % ! tinit->c_iflag = TTYDEF_IFLAG; % ! tinit->c_lflag = TTYDEF_LFLAG; % ! tinit->c_oflag = TTYDEF_OFLAG; % % ! tp->t_termios_init_out = *tinit; % ! tp->t_termios_lock_out = *tlock; % } % @@@ Callin and callout devices are almost completely broken. Their interlocking is completely broken. Their only use now is to provide storage for separate termios states (mainly just different CLOCAL settings), so that if you don't care about carrier then you can access the device simplistically using non-blocking opens. For example, "cat /dev/ttyu0" vs "cat /dev/ttyd0". I use such simplistic accesses combined with suitable initializations of the initial-state devices a lot for testing. cat knows nothing of termios or non-blocking opens, so it will tend to block in open on the callin device, but you might not want that. A termios-aware application can start with a nonblocking open of ttyd0 and turn CLOCAL off to get much the same effect as starting with a a blocking open of ttyu0. It should turn off CLOCAL for the latter too, but normally CLOCAL is already off. The separate states allow CLOCAL an other parameters to differ. Linux never had real callin and callout devices. In ~1992, it had something like FreeBSD has know (less complications broken support for real callin and callout devices). IIRC, the "callout" ones were removed 15-20 years ago. Real callin and callout devices have the following primary functionality: you can have a callin device sleeping waiting for carrier in open() (usually by getty()). To use the physical device as a callout device, even in 1980's unixes, you could open it with O_NONBLOCK and set CLOCAL, but setting CLOCAL would have significant effects on the callin application. At best its open would return, and you would have to put the application to sleep somehow. 1980's unixes used fragile userland code for this. It needs lockfiles, and perhaps a combination of select() and polling to wait for the callin application to go away. The races waking up when the callin application goes away are quite complicated, at least without special kernel support. Real callin and callin devices simplify this by duplicating the device state and moving the locking into the kernel. Just duplicating the device state makes things simpler. You can set CLOCAL on the callout device without the callout device seeing it. However, activity on the callout device make cause carrier to rise, and then you still have the complication of putting the callout application to sleep after it sees carrier. This is very easy to handle in the kernel -- you just make the callin application sleep waiting for the callout application to finish instead of waiting for carrier. The details are not quite so simple, and are completely broken in -current. Problems occur even without callout applications. When you have a getty sleeping waiting for carrier, it is useful to be able to examine the device state using stty. "stty Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C993706; Tue, 11 Mar 2014 01:10:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 73D2E9A0; Tue, 11 Mar 2014 01:10:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2B1Aj4v069409; Tue, 11 Mar 2014 01:10:45 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2B1Ajkl069407; Tue, 11 Mar 2014 01:10:45 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403110110.s2B1Ajkl069407@svn.freebsd.org> From: Eitan Adler Date: Tue, 11 Mar 2014 01:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262992 - head/lib/libbsdstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 01:10:45 -0000 Author: eadler Date: Tue Mar 11 01:10:44 2014 New Revision: 262992 URL: http://svnweb.freebsd.org/changeset/base/262992 Log: libbsdstat: fix warnings, set WARNS libbsdstat can build with WARNS=6 with a one line change. Modified: head/lib/libbsdstat/Makefile head/lib/libbsdstat/bsdstat.c Modified: head/lib/libbsdstat/Makefile ============================================================================== --- head/lib/libbsdstat/Makefile Tue Mar 11 00:25:55 2014 (r262991) +++ head/lib/libbsdstat/Makefile Tue Mar 11 01:10:44 2014 (r262992) @@ -4,8 +4,6 @@ LIB= bsdstat SHLIB_MAJOR= 1 PRIVATELIB= -WARNS?= 3 - SRCS= bsdstat.c INCS= bsdstat.h Modified: head/lib/libbsdstat/bsdstat.c ============================================================================== --- head/lib/libbsdstat/bsdstat.c Tue Mar 11 00:25:55 2014 (r262991) +++ head/lib/libbsdstat/bsdstat.c Tue Mar 11 01:10:44 2014 (r262992) @@ -81,7 +81,7 @@ bsdstat_update_tot(struct bsdstat *sf) } static int -bsdstat_get(struct bsdstat *sf, int s, char b[], size_t bs) +bsdstat_get(struct bsdstat *sf, int s, char b[] __unused, size_t bs __unused) { fprintf(stderr, "%s: don't know how to get stat #%u\n", sf->name, s); return 0; From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 01:41:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A56EED1D; Tue, 11 Mar 2014 01:41:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 92B93CC2; Tue, 11 Mar 2014 01:41:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2B1fAIv081646; Tue, 11 Mar 2014 01:41:10 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2B1fACl081644; Tue, 11 Mar 2014 01:41:10 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201403110141.s2B1fACl081644@svn.freebsd.org> From: John-Mark Gurney Date: Tue, 11 Mar 2014 01:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262993 - head/sys/opencrypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 01:41:10 -0000 Author: jmg Date: Tue Mar 11 01:41:09 2014 New Revision: 262993 URL: http://svnweb.freebsd.org/changeset/base/262993 Log: some minor clean up.. Always _ZERO memory so mtx_init won't panic... use the proper macro instead of hand rolling it... Reviewed by: jhb (only the malloc change) MFC after: 1 week Modified: head/sys/opencrypto/cryptodev.c head/sys/opencrypto/cryptosoft.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Tue Mar 11 01:10:44 2014 (r262992) +++ head/sys/opencrypto/cryptodev.c Tue Mar 11 01:41:09 2014 (r262993) @@ -1044,12 +1044,7 @@ csecreate(struct fcrypt *fcr, u_int64_t { struct csession *cse; -#ifdef INVARIANTS - /* NB: required when mtx_init is built with INVARIANTS */ cse = malloc(sizeof(struct csession), M_XDATA, M_NOWAIT | M_ZERO); -#else - cse = malloc(sizeof(struct csession), M_XDATA, M_NOWAIT); -#endif if (cse == NULL) return NULL; mtx_init(&cse->lock, "cryptodev", "crypto session lock", MTX_DEF); Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Tue Mar 11 01:10:44 2014 (r262992) +++ head/sys/opencrypto/cryptosoft.c Tue Mar 11 01:41:09 2014 (r262993) @@ -1003,7 +1003,7 @@ swcr_process(device_t dev, struct crypto goto done; } - lid = crp->crp_sid & 0xffffffff; + lid = CRYPTO_SESID2LID(crp->crp_sid); rw_rlock(&swcr_sessions_lock); if (swcr_sessions == NULL || lid >= swcr_sesnum || lid == 0 || swcr_sessions[lid] == NULL) { From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 01:45:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9819DEBA; Tue, 11 Mar 2014 01:45:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6AC97CE1; Tue, 11 Mar 2014 01:45:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2B1jlIP084359; Tue, 11 Mar 2014 01:45:47 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2B1jlTv084357; Tue, 11 Mar 2014 01:45:47 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201403110145.s2B1jlTv084357@svn.freebsd.org> From: John-Mark Gurney Date: Tue, 11 Mar 2014 01:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262994 - head/sys/opencrypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 01:45:47 -0000 Author: jmg Date: Tue Mar 11 01:45:46 2014 New Revision: 262994 URL: http://svnweb.freebsd.org/changeset/base/262994 Log: allow the kern.cryptodevallowsoft sysctl to enable symetric/hashes too... This will allow us to more easily test the software versions of these routines... Considering that we've never had an software asymetric implmentation, it's doubtful anyone has this enabled... Modified: head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Tue Mar 11 01:41:09 2014 (r262993) +++ head/sys/opencrypto/crypto.c Tue Mar 11 01:45:46 2014 (r262994) @@ -161,10 +161,10 @@ int crypto_userasymcrypto = 1; /* userla SYSCTL_INT(_kern, OID_AUTO, userasymcrypto, CTLFLAG_RW, &crypto_userasymcrypto, 0, "Enable/disable user-mode access to asymmetric crypto support"); -int crypto_devallowsoft = 0; /* only use hardware crypto for asym */ +int crypto_devallowsoft = 0; /* only use hardware crypto */ SYSCTL_INT(_kern, OID_AUTO, cryptodevallowsoft, CTLFLAG_RW, &crypto_devallowsoft, 0, - "Enable/disable use of software asym crypto support"); + "Enable/disable use of software crypto by /dev/crypto"); MALLOC_DEFINE(M_CRYPTO_DATA, "crypto", "crypto session records"); Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Tue Mar 11 01:41:09 2014 (r262993) +++ head/sys/opencrypto/cryptodev.c Tue Mar 11 01:45:46 2014 (r262994) @@ -351,11 +351,14 @@ cryptof_truncate( static int checkforsoftware(int crid) { - if (crid & CRYPTOCAP_F_SOFTWARE) - return EINVAL; /* XXX */ - if ((crid & CRYPTOCAP_F_HARDWARE) == 0 && - (crypto_getcaps(crid) & CRYPTOCAP_F_HARDWARE) == 0) - return EINVAL; /* XXX */ + + if (!crypto_devallowsoft) { + if (crid & CRYPTOCAP_F_SOFTWARE) + return EINVAL; /* XXX */ + if ((crid & CRYPTOCAP_F_HARDWARE) == 0 && + (crypto_getcaps(crid) & CRYPTOCAP_F_HARDWARE) == 0) + return EINVAL; /* XXX */ + } return 0; } From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 02:23:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67BFEE69; Tue, 11 Mar 2014 02:23:41 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 0E9424E; Tue, 11 Mar 2014 02:23:40 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 8DC61104428D; Tue, 11 Mar 2014 13:23:38 +1100 (EST) Date: Tue, 11 Mar 2014 13:23:38 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marcel Moolenaar Subject: Re: svn commit: r262957 - in head/etc: etc.arm etc.ia64 etc.mips etc.powerpc etc.sparc64 In-Reply-To: <201403092106.s29L6M3D056313@svn.freebsd.org> Message-ID: <20140311120707.A1147@besplex.bde.org> References: <201403092106.s29L6M3D056313@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=fbeUlSgF c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=1LetlUZaercA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=eVQHVEMfozF3_0W9SmMA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 02:23:41 -0000 On Sun, 9 Mar 2014, Marcel Moolenaar wrote: > Log: > Change the terminal type/class for enabled serial lines to 3wire. This > allows us to change the uart(4) driver to not hardcode specific line > settings for the serial console. /etc/ttys and /etc/gettytab are still stupid configuration methods. They hard-code settings in a different way. You can edit them, but this is painful across many machines, even if all the configurations are the same (but differ from the defaults). They hard-code too many settings. /etc/rc.d/serial is a bit hackish, but works especially well for consoles. > A terminal type of 3wire makes sure the console still works when no DCD > signal is present, which preserves behviour. When it is known that the > terminal server (or DCE in general) provides DCD, a terminal type/class > of std can be used. This has the effect of being logged out when one > disconnects from the console -- improving security overall. Now you default to 3wire instead of defaulting to modem control. All my local systems have cables giving full modem control. This is useful even for consoles -- it gives the disconnection that you mention. > Likewise, when uart(4) does not fixate the baudrate, one can change > the terminal type/class to set a specific baudrate. An operator can use > this to change the console speed mid-flight, without needing a reboot. > Of course it helps in this respect if and when the firmware can be > configured from the OS. It should still lock the speed and everything, to make it not too easy to break kernel console output. Without locking, anyone with write access can change the speed. That is normally root:wheel for callin devices and uucp:dialer for callout devices. Bad terminal programs like cu have a hard-coded internal speed. If you forget this and type cu -l... without a speed, then this breaks kernel console output if the speed isn't locked and cu's default differs from the actual speed. The settings used for booting should work then and be very hard to change. sio uses the following mechanisms which make the speed a little too hard to change and everything else much too hard (impossible) to change: - the driver locks critical boot-time settings (moved to tty.c in my version of not-very-current, so that it works for all drivers) - there is a sysctl to change the speed. I never approved of this and am still waiting for even the style bugs in it to be fixed - applications can change the settings after unlocking the locked ones, but this only affects high-level consoles. The sysctl must be used to change the speed for low-level consoles, and nothing else can be changed for low-level consoles. In particular, certain operations involving DTR are forced for low-level consoles. - low-level console i/o switches dynamically to the almost-fixed kernel parameters. Bad things happen when these parameters differ from the high-level (termios) parameters, but usually the only to the high-level i/o. E.g.: - if you allow an application to set bad parameters, then application i/o doesn't work, but kernel i/o keeps working - if you trace through parameter setting using a debugger, with the debugger i/o on the same device as the console, then debugger i/o doesn't break when the transient state becomes unsuitable for i/o. Worse things happen with the kernel parameters differ from the ones needed to work with the other side, but that is rare -- the parameters should have worked for booting, and to change them you should carefully change both sides together or in small steps that can easily be backed out of. > Modified: head/etc/etc.arm/ttys > ============================================================================== > --- head/etc/etc.arm/ttys Sun Mar 9 21:02:23 2014 (r262956) > +++ head/etc/etc.arm/ttys Sun Mar 9 21:06:22 2014 (r262957) > @@ -41,7 +41,7 @@ ttyv7 "/usr/libexec/getty Pc" xterm off > #ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure > # Serial terminals > # The 'dialup' keyword identifies dialin lines to login, fingerd etc. > -ttyu0 "/usr/libexec/getty std.9600" vt100 on secure > +ttyu0 "/usr/libexec/getty 3wire" vt100 on secure > ttyu1 "/usr/libexec/getty std.9600" dialup off secure > ttyu2 "/usr/libexec/getty std.9600" dialup off secure > ttyu3 "/usr/libexec/getty std.9600" dialup off secure > The stupidness of the /etc/ttys and /etc/gettytab configuration methods starts with hard-coding the console. It is usually on device 0, but not always. For me it is always on d0, not u0, and I always have to edit these files to change the speed to 115200. > Modified: head/etc/etc.ia64/ttys The stupidness of the configuration methods continues with not-quite- duplicating the ttys files to hold minor differences depending on ${ARCH}. Local differences are likely to be much larger (but not as large as 20-30 years ago with larger numbers of ttys on modems). > ============================================================================== > --- head/etc/etc.ia64/ttys Sun Mar 9 21:02:23 2014 (r262956) > +++ head/etc/etc.ia64/ttys Sun Mar 9 21:06:22 2014 (r262957) > @@ -41,8 +41,8 @@ ttyv7 "/usr/libexec/getty Pc" xterm off > ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure > # Serial terminals. The 'dialup' keyword identifies dialin lines to login, > # fingerd etc. > -ttyu0 "/usr/libexec/getty std.9600" vt100 on secure > -ttyu1 "/usr/libexec/getty std.9600" vt100 on secure > +ttyu0 "/usr/libexec/getty 3wire" vt100 on secure > +ttyu1 "/usr/libexec/getty 3wire" vt100 on secure > ttyu2 "/usr/libexec/getty std.9600" dialup off secure > ttyu3 "/usr/libexec/getty std.9600" dialup off secure > # Dumb console > Here you have 2 3wires instead of 1. This is not an arch-dependent difference. > Modified: head/etc/etc.mips/ttys > ============================================================================== > --- head/etc/etc.mips/ttys Sun Mar 9 21:02:23 2014 (r262956) > +++ head/etc/etc.mips/ttys Sun Mar 9 21:06:22 2014 (r262957) > @@ -30,7 +30,7 @@ > console none unknown off secure > # Serial terminals > # The 'dialup' keyword identifies dialin lines to login, fingerd etc. > -ttyu0 "/usr/libexec/getty std.115200" dialup on secure > +ttyu0 "/usr/libexec/getty 3wire" vt100 on secure > ttyu1 "/usr/libexec/getty std.115200" dialup off secure > ttyu2 "/usr/libexec/getty std.115200" dialup off secure > ttyu3 "/usr/libexec/getty std.115200" dialup off secure This is a much larger non-arch-dependent change. ttyu0 went from dialup to vt100. It is a bug for it to be so different from other arches, but maybe someone has no serial consoles and depends on it being dialup. > Modified: head/etc/etc.powerpc/ttys > ... > Modified: head/etc/etc.sparc64/ttys > ============================================================================== > --- head/etc/etc.sparc64/ttys Sun Mar 9 21:02:23 2014 (r262956) > +++ head/etc/etc.sparc64/ttys Sun Mar 9 21:06:22 2014 (r262957) > @@ -46,9 +46,9 @@ ttyv8 "/usr/local/bin/xdm -nodaemon" xte > # Serial terminals > # The 'dialup' keyword identifies dialin lines to login, fingerd etc. > # uart(4) > -ttyu0 "/usr/libexec/getty std.9600" vt100 on secure > -ttyu1 "/usr/libexec/getty std.9600" vt100 on secure > -ttyu2 "/usr/libexec/getty std.9600" vt100 on secure > +ttyu0 "/usr/libexec/getty 3wire" vt100 on secure > +ttyu1 "/usr/libexec/getty 3wire" vt100 on secure > +ttyu2 "/usr/libexec/getty 3wire" vt100 on secure > ttyu3 "/usr/libexec/getty std.9600" vt100 off secure > # Dumb console > dcons "/usr/libexec/getty std.9600" vt100 off secure Now 3 3wires instead of 1 or 2. No dialups at all. You didn't change amd64 or i386 at all. I now see the pattern for the 3wires: you mostly changed all non-dialups to 3wire. The number of dialups is arch-dependent for no good reason. amd64 and i386 have silly differences between themselves and the above: - amd64 has u0 std.11500 xterm on secure (surely broken to default to on?) - i386 has u0 std.9600 dialup off secure - amd64 and i386 are closer to having maximal dialups than others - amd64 and i386 have more things on than others. I think this is because the ttyv* lines essentially hard-code syscons and this is least wrong on x86. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 03:19:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60289FAC; Tue, 11 Mar 2014 03:19:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 402C07E8; Tue, 11 Mar 2014 03:19:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2B3JiaY023251; Tue, 11 Mar 2014 03:19:44 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2B3JiY6023250; Tue, 11 Mar 2014 03:19:44 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403110319.s2B3JiY6023250@svn.freebsd.org> From: Ian Lepore Date: Tue, 11 Mar 2014 03:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262995 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 03:19:44 -0000 Author: ian Date: Tue Mar 11 03:19:43 2014 New Revision: 262995 URL: http://svnweb.freebsd.org/changeset/base/262995 Log: Now that the PUSHFRAME and PULLFRAME macros are used only in the swi entry/exit code, they don't need to be macros. Now they're just inline code, and rewritten to use shorter instruction sequences. Modified: head/sys/arm/arm/exception.S Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Tue Mar 11 01:45:46 2014 (r262994) +++ head/sys/arm/arm/exception.S Tue Mar 11 03:19:43 2014 (r262995) @@ -57,75 +57,6 @@ __FBSDID("$FreeBSD$"); .align 0 /* - * ASM macros for pushing and pulling trapframes from the stack - * - * These macros are used to handle the irqframe and trapframe structures - * defined above. - */ - -/* - * PUSHFRAME - macro to push a trap frame on the stack in the current mode - * Since the current mode is used, the SVC lr field is not defined. - * - * NOTE: r13 and r14 are stored separately as a work around for the - * SA110 rev 2 STM^ bug - */ -#ifdef ARM_TP_ADDRESS -#define PUSHFRAME \ - sub sp, sp, #4; /* Align the stack */ \ - str lr, [sp, #-4]!; /* Push the return address */ \ - sub sp, sp, #(4*17); /* Adjust the stack pointer */ \ - stmia sp, {r0-r12}; /* Push the user mode registers */ \ - add r0, sp, #(4*13); /* Adjust the stack pointer */ \ - stmia r0, {r13-r14}^; /* Push the user mode registers */ \ - mov r0, r0; /* NOP for previous instruction */ \ - mrs r0, spsr; /* Put the SPSR on the stack */ \ - str r0, [sp, #-4]!; \ - ldr r0, =ARM_RAS_START; \ - mov r1, #0; \ - str r1, [r0]; \ - mov r1, #0xffffffff; \ - str r1, [r0, #4]; -#else -#define PUSHFRAME \ - sub sp, sp, #4; /* Align the stack */ \ - str lr, [sp, #-4]!; /* Push the return address */ \ - sub sp, sp, #(4*17); /* Adjust the stack pointer */ \ - stmia sp, {r0-r12}; /* Push the user mode registers */ \ - add r0, sp, #(4*13); /* Adjust the stack pointer */ \ - stmia r0, {r13-r14}^; /* Push the user mode registers */ \ - mov r0, r0; /* NOP for previous instruction */ \ - mrs r0, spsr; /* Put the SPSR on the stack */ \ - str r0, [sp, #-4]!; -#endif - -/* - * PULLFRAME - macro to pull a trap frame from the stack in the current mode - * Since the current mode is used, the SVC lr field is ignored. - */ - -#ifdef ARM_TP_ADDRESS -#define PULLFRAME \ - ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ - msr spsr_fsxc, r0; \ - ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ - mov r0, r0; /* NOP for previous instruction */ \ - add sp, sp, #(4*17); /* Adjust the stack pointer */ \ - ldr lr, [sp], #0x0004; /* Pull the return address */ \ - add sp, sp, #4 /* Align the stack */ -#else -#define PULLFRAME \ - ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ - msr spsr_fsxc, r0; \ - clrex; \ - ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ - mov r0, r0; /* NOP for previous instruction */ \ - add sp, sp, #(4*17); /* Adjust the stack pointer */ \ - ldr lr, [sp], #0x0004; /* Pull the return address */ \ - add sp, sp, #4 /* Align the stack */ -#endif - -/* * PUSHFRAMEINSVC - macro to push a trap frame on the stack in SVC32 mode * This should only be used if the processor is not currently in SVC32 * mode. The processor mode is switched to SVC mode and the trap frame is @@ -263,8 +194,15 @@ __FBSDID("$FreeBSD$"); b 1b ;\ 2: - - +/* + * If ARM_TP_ADDRESS is defined we're on armv4 or v5 and there is no clrex + * instruction, or need for one, so just #define it away. + */ +#ifdef ARM_TP_ADDRESS +#define CLREX +#else +#define CLREX clrex +#endif /* * reset_entry: @@ -281,17 +219,27 @@ Lreset_panicmsg: END(reset_entry) /* - * swi_entry - * - * Handler for the Software Interrupt exception. + * Entry point for Software Interrupt (SWI). + * + * The swi instruction switches to svc32 mode, so we're already on the + * right stack. We build a trapframe and invoke swi_handler(). */ ASENTRY_NP(swi_entry) - STOP_UNWINDING /* Don't unwind into user mode. */ - - PUSHFRAME - - mov r0, sp /* Pass the frame to any function */ - bl _C_LABEL(swi_handler) /* It's a SWI ! */ + sub sp, sp, #4 /* Align the stack (tf_pad). */ + str lr, [sp, #-4]! /* Push the return address (tf_pc). */ + sub sp, sp, #(4*17) /* Point sp to tf_r0, store the user */ + stmia sp, {r0-r14}^ /* registers. Store SPSR in tf_spsr. */ + mrs r0, spsr /* Now sp points to struct trapframe */ + str r0, [sp, #-4]! /* we've constructed on svc32 stack. */ +#ifdef ARM_RAS_START + ldr r0, =ARM_RAS_START /* If we're using RAS-based atomicity */ + mov r1, #0 /* we should never have a SWI in the */ + str r1, [r0] /* midst of a RAS sequence, but */ + mov r1, #0xffffffff /* be safe and reset the RAS vars. */ + str r1, [r0, #4] +#endif + mov r0, sp /* Pass the trapframe we just built */ + bl _C_LABEL(swi_handler) /* on the stack to the swi handler. */ /* * The fork_trampoline() code in swtch.S aranges for the MI fork_exit() @@ -301,11 +249,17 @@ ASENTRY_NP(swi_entry) */ ASENTRY_NP(swi_exit) - DO_AST /* Deliver signals. */ + DO_AST /* Do scheduling and signal delivery. */ - PULLFRAME - movs pc, lr /* Exit */ + CLREX /* Should never happen but be safe */ + ldr r0, [sp], #4 /* and don't exit with open monitor. */ + msr spsr_fsxc, r0 /* Restore SPSR. */ + ldmia sp, {r0-r14}^ /* Restore user mode registers. */ + ldr lr, [sp, #8] /* Restore the return address. */ + add sp, sp, #12 /* Deallocate the rest of trapframe. */ + movs pc, lr /* Return to user mode. */ + STOP_UNWINDING /* Don't unwind into user mode. */ END(swi_exit) END(swi_entry) From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 03:20:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A57917A; Tue, 11 Mar 2014 03:20:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 27868857; Tue, 11 Mar 2014 03:20:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2B3KBfu023415; Tue, 11 Mar 2014 03:20:11 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2B3KBqu023414; Tue, 11 Mar 2014 03:20:11 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403110320.s2B3KBqu023414@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 11 Mar 2014 03:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262996 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 03:20:11 -0000 Author: marcel Date: Tue Mar 11 03:20:10 2014 New Revision: 262996 URL: http://svnweb.freebsd.org/changeset/base/262996 Log: Pass the actual baudrate to tty_init_console(). This defines the initial baudrate of the device special file, and makes sure that on open(2) the UART is programmed with the correct baudrate. This then eliminates the need in uart_tty_param() to override the speed setting. Modified: head/sys/dev/uart/uart_tty.c Modified: head/sys/dev/uart/uart_tty.c ============================================================================== --- head/sys/dev/uart/uart_tty.c Tue Mar 11 03:19:43 2014 (r262995) +++ head/sys/dev/uart/uart_tty.c Tue Mar 11 03:20:10 2014 (r262996) @@ -386,7 +386,7 @@ uart_tty_attach(struct uart_softc *sc) if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE) { sprintf(((struct consdev *)sc->sc_sysdev->cookie)->cn_name, "ttyu%r", unit); - tty_init_console(tp, 0); + tty_init_console(tp, sc->sc_sysdev->baudrate); } swi_add(&tty_intr_event, uart_driver_name, uart_tty_intr, sc, SWI_TTY, From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 04:25:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0584CA4C; Tue, 11 Mar 2014 04:25:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB603D14; Tue, 11 Mar 2014 04:25:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2B4PCqJ050697; Tue, 11 Mar 2014 04:25:12 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2B4PCUt050696; Tue, 11 Mar 2014 04:25:12 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403110425.s2B4PCUt050696@svn.freebsd.org> From: Ian Lepore Date: Tue, 11 Mar 2014 04:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262997 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 04:25:13 -0000 Author: ian Date: Tue Mar 11 04:25:12 2014 New Revision: 262997 URL: http://svnweb.freebsd.org/changeset/base/262997 Log: Revert r262994 for now, it fails to boot on armv5. Modified: head/sys/arm/arm/exception.S Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Tue Mar 11 03:20:10 2014 (r262996) +++ head/sys/arm/arm/exception.S Tue Mar 11 04:25:12 2014 (r262997) @@ -57,6 +57,75 @@ __FBSDID("$FreeBSD$"); .align 0 /* + * ASM macros for pushing and pulling trapframes from the stack + * + * These macros are used to handle the irqframe and trapframe structures + * defined above. + */ + +/* + * PUSHFRAME - macro to push a trap frame on the stack in the current mode + * Since the current mode is used, the SVC lr field is not defined. + * + * NOTE: r13 and r14 are stored separately as a work around for the + * SA110 rev 2 STM^ bug + */ +#ifdef ARM_TP_ADDRESS +#define PUSHFRAME \ + sub sp, sp, #4; /* Align the stack */ \ + str lr, [sp, #-4]!; /* Push the return address */ \ + sub sp, sp, #(4*17); /* Adjust the stack pointer */ \ + stmia sp, {r0-r12}; /* Push the user mode registers */ \ + add r0, sp, #(4*13); /* Adjust the stack pointer */ \ + stmia r0, {r13-r14}^; /* Push the user mode registers */ \ + mov r0, r0; /* NOP for previous instruction */ \ + mrs r0, spsr; /* Put the SPSR on the stack */ \ + str r0, [sp, #-4]!; \ + ldr r0, =ARM_RAS_START; \ + mov r1, #0; \ + str r1, [r0]; \ + mov r1, #0xffffffff; \ + str r1, [r0, #4]; +#else +#define PUSHFRAME \ + sub sp, sp, #4; /* Align the stack */ \ + str lr, [sp, #-4]!; /* Push the return address */ \ + sub sp, sp, #(4*17); /* Adjust the stack pointer */ \ + stmia sp, {r0-r12}; /* Push the user mode registers */ \ + add r0, sp, #(4*13); /* Adjust the stack pointer */ \ + stmia r0, {r13-r14}^; /* Push the user mode registers */ \ + mov r0, r0; /* NOP for previous instruction */ \ + mrs r0, spsr; /* Put the SPSR on the stack */ \ + str r0, [sp, #-4]!; +#endif + +/* + * PULLFRAME - macro to pull a trap frame from the stack in the current mode + * Since the current mode is used, the SVC lr field is ignored. + */ + +#ifdef ARM_TP_ADDRESS +#define PULLFRAME \ + ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ + msr spsr_fsxc, r0; \ + ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ + mov r0, r0; /* NOP for previous instruction */ \ + add sp, sp, #(4*17); /* Adjust the stack pointer */ \ + ldr lr, [sp], #0x0004; /* Pull the return address */ \ + add sp, sp, #4 /* Align the stack */ +#else +#define PULLFRAME \ + ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ + msr spsr_fsxc, r0; \ + clrex; \ + ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ + mov r0, r0; /* NOP for previous instruction */ \ + add sp, sp, #(4*17); /* Adjust the stack pointer */ \ + ldr lr, [sp], #0x0004; /* Pull the return address */ \ + add sp, sp, #4 /* Align the stack */ +#endif + +/* * PUSHFRAMEINSVC - macro to push a trap frame on the stack in SVC32 mode * This should only be used if the processor is not currently in SVC32 * mode. The processor mode is switched to SVC mode and the trap frame is @@ -194,15 +263,8 @@ __FBSDID("$FreeBSD$"); b 1b ;\ 2: -/* - * If ARM_TP_ADDRESS is defined we're on armv4 or v5 and there is no clrex - * instruction, or need for one, so just #define it away. - */ -#ifdef ARM_TP_ADDRESS -#define CLREX -#else -#define CLREX clrex -#endif + + /* * reset_entry: @@ -219,27 +281,17 @@ Lreset_panicmsg: END(reset_entry) /* - * Entry point for Software Interrupt (SWI). - * - * The swi instruction switches to svc32 mode, so we're already on the - * right stack. We build a trapframe and invoke swi_handler(). + * swi_entry + * + * Handler for the Software Interrupt exception. */ ASENTRY_NP(swi_entry) - sub sp, sp, #4 /* Align the stack (tf_pad). */ - str lr, [sp, #-4]! /* Push the return address (tf_pc). */ - sub sp, sp, #(4*17) /* Point sp to tf_r0, store the user */ - stmia sp, {r0-r14}^ /* registers. Store SPSR in tf_spsr. */ - mrs r0, spsr /* Now sp points to struct trapframe */ - str r0, [sp, #-4]! /* we've constructed on svc32 stack. */ -#ifdef ARM_RAS_START - ldr r0, =ARM_RAS_START /* If we're using RAS-based atomicity */ - mov r1, #0 /* we should never have a SWI in the */ - str r1, [r0] /* midst of a RAS sequence, but */ - mov r1, #0xffffffff /* be safe and reset the RAS vars. */ - str r1, [r0, #4] -#endif - mov r0, sp /* Pass the trapframe we just built */ - bl _C_LABEL(swi_handler) /* on the stack to the swi handler. */ + STOP_UNWINDING /* Don't unwind into user mode. */ + + PUSHFRAME + + mov r0, sp /* Pass the frame to any function */ + bl _C_LABEL(swi_handler) /* It's a SWI ! */ /* * The fork_trampoline() code in swtch.S aranges for the MI fork_exit() @@ -249,17 +301,11 @@ ASENTRY_NP(swi_entry) */ ASENTRY_NP(swi_exit) - DO_AST /* Do scheduling and signal delivery. */ + DO_AST /* Deliver signals. */ - CLREX /* Should never happen but be safe */ - ldr r0, [sp], #4 /* and don't exit with open monitor. */ - msr spsr_fsxc, r0 /* Restore SPSR. */ - ldmia sp, {r0-r14}^ /* Restore user mode registers. */ - ldr lr, [sp, #8] /* Restore the return address. */ - add sp, sp, #12 /* Deallocate the rest of trapframe. */ - movs pc, lr /* Return to user mode. */ + PULLFRAME + movs pc, lr /* Exit */ - STOP_UNWINDING /* Don't unwind into user mode. */ END(swi_exit) END(swi_entry) From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 04:26:42 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20878BA2; Tue, 11 Mar 2014 04:26:42 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E74BCD2D; Tue, 11 Mar 2014 04:26:41 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WNEGw-000AoH-QG; Tue, 11 Mar 2014 04:26:35 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s2B4QWsx059538; Mon, 10 Mar 2014 22:26:32 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/jDw5UAzoJSKcOR36WLwcA Subject: Re: svn commit: r262997 - head/sys/arm/arm From: Ian Lepore To: src-committers@FreeBSD.org In-Reply-To: <201403110425.s2B4PCUt050696@svn.freebsd.org> References: <201403110425.s2B4PCUt050696@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Mon, 10 Mar 2014 22:26:32 -0600 Message-ID: <1394511992.1149.475.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 04:26:42 -0000 On Tue, 2014-03-11 at 04:25 +0000, Ian Lepore wrote: > Author: ian > Date: Tue Mar 11 04:25:12 2014 > New Revision: 262997 > URL: http://svnweb.freebsd.org/changeset/base/262997 > > Log: > Revert r262994 for now, it fails to boot on armv5. Oops, that should be r262995. Just further evidence that I need to go to bed. ;) -- Ian From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 06:07:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D84C7B30; Tue, 11 Mar 2014 06:07:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B95D26C2; Tue, 11 Mar 2014 06:07:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2B67CJk096960; Tue, 11 Mar 2014 06:07:12 GMT (envelope-from edavis@svn.freebsd.org) Received: (from edavis@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2B67CQk096959; Tue, 11 Mar 2014 06:07:12 GMT (envelope-from edavis@svn.freebsd.org) Message-Id: <201403110607.s2B67CQk096959@svn.freebsd.org> From: Eric Davis Date: Tue, 11 Mar 2014 06:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262999 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 06:07:12 -0000 Author: edavis Date: Tue Mar 11 06:07:12 2014 New Revision: 262999 URL: http://svnweb.freebsd.org/changeset/base/262999 Log: Fixed MSI interrupt allocation and handling. Fixed a DMA mapping leak that occurs when defragmenting packet chains. Approved by: davidch (mentor) MFC after: 1 week Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Tue Mar 11 05:58:52 2014 (r262998) +++ head/sys/dev/bxe/bxe.c Tue Mar 11 06:07:12 2014 (r262999) @@ -34,7 +34,7 @@ #include __FBSDID("$FreeBSD$"); -#define BXE_DRIVER_VERSION "1.78.77" +#define BXE_DRIVER_VERSION "1.78.78" #include "bxe.h" #include "ecore_sp.h" @@ -911,7 +911,7 @@ bxe_dma_map_addr(void *arg, bus_dma_segm dma->paddr = segs->ds_addr; dma->nseg = nseg; #if 0 - BLOGD(dma->sc, DBG_LOAD,, + BLOGD(dma->sc, DBG_LOAD, "DMA alloc '%s': vaddr=%p paddr=%p nseg=%d size=%lu\n", dma->msg, dma->vaddr, (void *)dma->paddr, dma->nseg, dma->size); @@ -5486,7 +5486,7 @@ bxe_tx_encap(struct bxe_fastpath *fp, st } /* make sure it fits in the packet window */ - if (__predict_false(nsegs > 12)) { + if (__predict_false(nsegs > BXE_MAX_SEGMENTS)) { /* * The mbuf may be to big for the controller to handle. If the frame * is a TSO frame we'll need to do an additional check. @@ -5501,8 +5501,9 @@ bxe_tx_encap(struct bxe_fastpath *fp, st fp->eth_q_stats.tx_window_violation_std++; } - /* lets try to defragment this mbuf */ + /* lets try to defragment this mbuf and remap it */ fp->eth_q_stats.mbuf_defrag_attempts++; + bus_dmamap_unload(fp->tx_mbuf_tag, tx_buf->m_map); m0 = m_defrag(*m_head, M_NOWAIT); if (m0 == NULL) { @@ -5520,10 +5521,12 @@ bxe_tx_encap(struct bxe_fastpath *fp, st /* No sense in trying to defrag/copy chain, drop it. :( */ rc = error; } - - /* if the chain is still too long then drop it */ - if (__predict_false(nsegs > 12)) { - rc = ENODEV; + else { + /* if the chain is still too long then drop it */ + if (__predict_false(nsegs > BXE_MAX_SEGMENTS)) { + bus_dmamap_unload(fp->tx_mbuf_tag, tx_buf->m_map); + rc = ENODEV; + } } } } @@ -9397,13 +9400,13 @@ bxe_interrupt_alloc(struct bxe_softc *sc } if (((sc->devinfo.pcie_cap_flags & BXE_MSI_CAPABLE_FLAG) == 0) || - (msi_count < 2)) { + (msi_count < 1)) { sc->interrupt_mode = INTR_MODE_INTX; /* try INTx next */ break; } - /* ask for the necessary number of MSI vectors */ - num_requested = min((sc->num_queues + 1), msi_count); + /* ask for a single MSI vector */ + num_requested = 1; BLOGD(sc, DBG_LOAD, "Requesting %d MSI vectors\n", num_requested); @@ -9414,8 +9417,8 @@ bxe_interrupt_alloc(struct bxe_softc *sc break; } - if (num_allocated < 2) { /* possible? */ - BLOGE(sc, "MSI allocation less than 2!\n"); + if (num_allocated != 1) { /* possible? */ + BLOGE(sc, "MSI allocation is not 1!\n"); sc->interrupt_mode = INTR_MODE_INTX; /* try INTx next */ pci_release_msi(sc->dev); break; @@ -9426,38 +9429,26 @@ bxe_interrupt_alloc(struct bxe_softc *sc /* best effort so use the number of vectors allocated to us */ sc->intr_count = num_allocated; - sc->num_queues = num_allocated - 1; + sc->num_queues = num_allocated; rid = 1; /* initial resource identifier */ - /* allocate the MSI vectors */ - for (i = 0; i < num_allocated; i++) { - sc->intr[i].rid = (rid + i); - - if ((sc->intr[i].resource = - bus_alloc_resource_any(sc->dev, - SYS_RES_IRQ, - &sc->intr[i].rid, - RF_ACTIVE)) == NULL) { - BLOGE(sc, "Failed to map MSI[%d] (rid=%d)!\n", - i, (rid + i)); - - for (j = (i - 1); j >= 0; j--) { - bus_release_resource(sc->dev, - SYS_RES_IRQ, - sc->intr[j].rid, - sc->intr[j].resource); - } - - sc->intr_count = 0; - sc->num_queues = 0; - sc->interrupt_mode = INTR_MODE_INTX; /* try INTx next */ - pci_release_msi(sc->dev); - break; - } + sc->intr[0].rid = rid; - BLOGD(sc, DBG_LOAD, "Mapped MSI[%d] (rid=%d)\n", i, (rid + i)); + if ((sc->intr[0].resource = + bus_alloc_resource_any(sc->dev, + SYS_RES_IRQ, + &sc->intr[0].rid, + RF_ACTIVE)) == NULL) { + BLOGE(sc, "Failed to map MSI[0] (rid=%d)!\n", rid); + sc->intr_count = 0; + sc->num_queues = 0; + sc->interrupt_mode = INTR_MODE_INTX; /* try INTx next */ + pci_release_msi(sc->dev); + break; } + + BLOGD(sc, DBG_LOAD, "Mapped MSI[0] (rid=%d)\n", rid); } while (0); do { /* try allocating INTx vector resources */ @@ -9636,54 +9627,21 @@ bxe_interrupt_attach(struct bxe_softc *s fp->state = BXE_FP_STATE_IRQ; } } else if (sc->interrupt_mode == INTR_MODE_MSI) { - BLOGD(sc, DBG_LOAD, "Enabling slowpath MSI[0] vector.\n"); + BLOGD(sc, DBG_LOAD, "Enabling MSI[0] vector\n"); /* - * Setup the interrupt handler. Note that we pass the driver instance - * to the interrupt handler for the slowpath. + * Setup the interrupt handler. Note that we pass the + * driver instance to the interrupt handler which + * will handle both the slowpath and fastpath. */ if ((rc = bus_setup_intr(sc->dev, sc->intr[0].resource, (INTR_TYPE_NET | INTR_MPSAFE), - NULL, bxe_intr_sp, sc, + NULL, bxe_intr_legacy, sc, &sc->intr[0].tag)) != 0) { BLOGE(sc, "Failed to allocate MSI[0] vector (%d)\n", rc); goto bxe_interrupt_attach_exit; } - bus_describe_intr(sc->dev, sc->intr[0].resource, - sc->intr[0].tag, "sp"); - - /* bus_bind_intr(sc->dev, sc->intr[0].resource, 0); */ - - /* initialize the fastpath vectors (note the first was used for sp) */ - for (i = 0; i < sc->num_queues; i++) { - fp = &sc->fp[i]; - BLOGD(sc, DBG_LOAD, "Enabling MSI[%d] vector\n", (i + 1)); - - /* - * Setup the interrupt handler. Note that we pass the - * fastpath context to the interrupt handler in this - * case. - */ - if ((rc = bus_setup_intr(sc->dev, sc->intr[i + 1].resource, - (INTR_TYPE_NET | INTR_MPSAFE), - NULL, bxe_intr_fp, fp, - &sc->intr[i + 1].tag)) != 0) { - BLOGE(sc, "Failed to allocate MSI[%d] vector (%d)\n", - (i + 1), rc); - goto bxe_interrupt_attach_exit; - } - - bus_describe_intr(sc->dev, sc->intr[i + 1].resource, - sc->intr[i + 1].tag, "fp%02d", i); - - /* bind the fastpath instance to a cpu */ - if (sc->num_queues > 1) { - bus_bind_intr(sc->dev, sc->intr[i + 1].resource, i); - } - - fp->state = BXE_FP_STATE_IRQ; - } } else { /* (sc->interrupt_mode == INTR_MODE_INTX) */ BLOGD(sc, DBG_LOAD, "Enabling INTx interrupts\n"); From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 07:22:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A571173E; Tue, 11 Mar 2014 07:22:24 +0000 (UTC) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 4E697CCF; Tue, 11 Mar 2014 07:22:23 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id D8B741A2325; Tue, 11 Mar 2014 18:22:15 +1100 (EST) Date: Tue, 11 Mar 2014 18:22:14 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marcel Moolenaar Subject: Re: svn commit: r262996 - head/sys/dev/uart In-Reply-To: <201403110320.s2B3KBqu023414@svn.freebsd.org> Message-ID: <20140311173639.K2716@besplex.bde.org> References: <201403110320.s2B3KBqu023414@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=ddC5gxne c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=jYpDk86rP-AA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=aEWq4vkuDa4fM4Uz3EUA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 07:22:24 -0000 On Tue, 11 Mar 2014, Marcel Moolenaar wrote: > Log: > Pass the actual baudrate to tty_init_console(). This defines the initial > baudrate of the device special file, and makes sure that on open(2) the > UART is programmed with the correct baudrate. This then eliminates the > need in uart_tty_param() to override the speed setting. Here are my old patches (except the one for uart, and larger updates for sio) to do this for more console drivers. Actually, I mainly added tty_init_console() calls that are completely missing (these are more needed when the non-console case is fixed so that the default isn't for consoles). Most of the drivers are virtual ones that don't have a speed. Only sio and uart were tested at runtime. bvm seems to be the only new console driver which is missing a tty_init_console() call after these patches. % diff -c2 ./dev/cfe/cfe_console.c~ ./dev/cfe/cfe_console.c % *** ./dev/cfe/cfe_console.c~ Sat Dec 24 05:21:14 2011 % --- ./dev/cfe/cfe_console.c Sat Dec 24 05:21:16 2011 % *************** % *** 90,93 **** % --- 90,94 ---- % cfe_consdev.cn_name[0] != '\0') { % tp = tty_alloc(&cfe_ttydevsw, NULL); % + tty_init_console(tp, 0); % tty_makedev(tp, NULL, "cfecons"); % } % diff -c2 ./dev/ofw/ofw_console.c~ ./dev/ofw/ofw_console.c % *** ./dev/ofw/ofw_console.c~ Sat Dec 24 05:21:27 2011 % --- ./dev/ofw/ofw_console.c Sat Dec 24 05:21:29 2011 % *************** % *** 98,101 **** % --- 98,102 ---- % */ % tp = tty_alloc(&ofw_ttydevsw, NULL); % + tty_init_console(tp, 0); % tty_makedev(tp, NULL, "%s", output); % tty_makealias(tp, "ofwcons"); % diff -c2 ./dev/syscons/syscons.c~ ./dev/syscons/syscons.c % *** ./dev/syscons/syscons.c~ Tue Apr 10 01:48:10 2012 % --- ./dev/syscons/syscons.c Tue Apr 10 01:48:11 2012 % *************** % *** 560,564 **** % */ % } % ! % dev = make_dev(&consolectl_devsw, 0, UID_ROOT, GID_WHEEL, 0600, % "consolectl"); % --- 562,567 ---- % */ % } % ! if (sc_console_unit == unit) % ! tty_init_console(sc->dev[0], 0); % dev = make_dev(&consolectl_devsw, 0, UID_ROOT, GID_WHEEL, 0600, % "consolectl"); % diff -c2 ./dev/usb/serial/usb_serial.c~ ./dev/usb/serial/usb_serial.c % *** ./dev/usb/serial/usb_serial.c~ Tue Apr 10 01:48:34 2012 % --- ./dev/usb/serial/usb_serial.c Tue Apr 10 01:48:57 2012 % *************** % *** 331,336 **** % % tp = tty_alloc_mutex(&ucom_class, sc, sc->sc_mtx); % - if (tp == NULL) % - return (ENOMEM); % % /* Check if the client has a custom TTY name */ -current already has my patches for usb only, except for this hunk. % --- 331,334 ---- % *************** % *** 369,376 **** % ucom_cons_softc = sc; % % ! memset(&t, 0, sizeof(t)); % ! t.c_ispeed = ucom_cons_baud; % ! t.c_ospeed = t.c_ispeed; % t.c_cflag = CS8; % % mtx_lock(ucom_cons_softc->sc_mtx); % --- 367,375 ---- % ucom_cons_softc = sc; % % ! tty_init_console(tp, ucom_cons_baud); % ! t = tp->t_termios_init_in; % ! #ifdef GARBAGE /* maybe usb can't do all modes, but CS8 by itself is invalid */ % t.c_cflag = CS8; % + #endif % % mtx_lock(ucom_cons_softc->sc_mtx); % *************** % *** 1080,1084 **** % % /* XXX the TTY layer should call "open()" first! */ % ! % error = ucom_open(tp); % if (error) { % --- 1079,1087 ---- % % /* XXX the TTY layer should call "open()" first! */ % ! /* % ! * Not quite; its ordering is partly backwards, but some % ! * parameters must be set early in ttydev_open(), possibly % ! * before calling ttydevsw_open(). % ! */ % error = ucom_open(tp); % if (error) { % *************** % *** 1091,1094 **** % --- 1094,1098 ---- % /* Check requested parameters. */ % if (t->c_ispeed && (t->c_ispeed != t->c_ospeed)) { % + /* XXX c_ospeed == 0 is perfectly valid. */ % DPRINTF("mismatch ispeed and ospeed\n"); % error = EINVAL; -current has the rest of these usb patches to a fault. It has this XXX comment about the broken ospeed (ospeed == 0 means hang up), but not the fix. Testing ispeed is also strange -- ispeed == 0 has no special meaning. uart gets this wrong in a lesser way: when ospeed == 0, it returns after hanging up without setting any other parameters. tcsetattr() is specified to attempt set _all_ the supported attributes requested. Then if it succeeds in setting a single attribute, it must return success, and if it failed to set a single attribute then it must return failure. When it succeeds in setting ospeed == 0, that is success for the call. The error handling for this is onerous for applications and most don't do it on success. On success, non-broken error handling has to do a tcgetattr() and check which attributes are actually set and decide whether it cares about others. For the ospeed == 0 case, it would see that no attributes were changed and would notice the uart bug if it requested a change of another attribute that it cares about (it has to discard the change to ospeed == 0 before comparing with the old attributes, since ospeed == 0 is physically impossible so it would be another bug for this setting to be sticky at the software level). If it doesn't want to change anything but just wants to hang up, then it should use tcgetattr() before tcsetattr and only request changing ospeed. % diff -c2 ./dev/xen/console/console.c~ ./dev/xen/console/console.c % *** ./dev/xen/console/console.c~ Sat Dec 24 05:20:43 2011 % --- ./dev/xen/console/console.c Sat Dec 24 05:20:45 2011 % *************** % *** 234,237 **** % --- 234,238 ---- % % xccons = tty_alloc(&xc_ttydevsw, NULL); % + tty_init_console(xccons, 0); % tty_makedev(xccons, NULL, "xc%r", 0); % % diff -c2 ./ia64/ia64/ssc.c~ ./ia64/ia64/ssc.c % *** ./ia64/ia64/ssc.c~ Sat Dec 24 05:24:12 2011 % --- ./ia64/ia64/ssc.c Sat Dec 24 05:24:13 2011 % *************** % *** 118,121 **** % --- 118,122 ---- % % tp = tty_alloc(&ssc_class, NULL); % + tty_init_console(tp, 0); % tty_makedev(tp, NULL, "ssccons"); % } Bruce From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 10:03:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 080D4F7A; Tue, 11 Mar 2014 10:03:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E692BDFF; Tue, 11 Mar 2014 10:03:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BA3VG8014419; Tue, 11 Mar 2014 10:03:31 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BA3U0c014411; Tue, 11 Mar 2014 10:03:30 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201403111003.s2BA3U0c014411@svn.freebsd.org> From: Roger Pau Monné Date: Tue, 11 Mar 2014 10:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263001 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include i386/xen x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 10:03:32 -0000 Author: royger Date: Tue Mar 11 10:03:29 2014 New Revision: 263001 URL: http://svnweb.freebsd.org/changeset/base/263001 Log: amd64/i386: switch IPI handlers to C code. Move asm IPIs handlers to C code, so both Xen and native IPI handlers share the same code. Reviewed by: jhb Approved by: gibbs Sponsored by: Citrix Systems R&D amd64/amd64/apic_vector.S: i386/i386/apic_vector.s: - Remove asm coded IPI handlers and instead call the newly introduced C variants. amd64/amd64/mp_machdep.c: i386/i386/mp_machdep.c: - Add C coded clones to the asm IPI handlers (moved from x86/xen/hvm.c). i386/include/smp.h: amd64/include/smp.h: - Add prototypes for the C IPI handlers. x86/xen/hvm.c: - Move the C IPI handlers to mp_machdep and call those in the Xen IPI handlers. i386/xen/mp_machdep.c: - Add dummy IPI handlers to the i386 Xen PV port (this port doesn't support SMP). Modified: head/sys/amd64/amd64/apic_vector.S head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/include/smp.h head/sys/i386/i386/apic_vector.s head/sys/i386/i386/mp_machdep.c head/sys/i386/include/smp.h head/sys/i386/xen/mp_machdep.c head/sys/x86/xen/hvm.c Modified: head/sys/amd64/amd64/apic_vector.S ============================================================================== --- head/sys/amd64/amd64/apic_vector.S Tue Mar 11 07:33:33 2014 (r263000) +++ head/sys/amd64/amd64/apic_vector.S Tue Mar 11 10:03:29 2014 (r263001) @@ -159,101 +159,26 @@ IDTVEC(xen_intr_upcall) #define NAKE_INTR_CS 24 SUPERALIGN_TEXT -global_invltlb: - movq %cr4,%rax - andq $~0x80,%rax /* PGE */ - movq %rax,%cr4 - orq $0x80,%rax - movq %rax,%cr4 -invltlb_ret_clear_pm_save: - movq smp_tlb_pmap,%rdx - testq %rdx,%rdx - jz invltlb_ret_rdx - testb $SEL_RPL_MASK,NAKE_INTR_CS(%rsp) - jz 1f - swapgs -1: - movl PCPU(CPUID),%eax - jz 2f - swapgs -2: - LK btcl %eax,PM_SAVE(%rdx) - SUPERALIGN_TEXT -invltlb_ret_rdx: - popq %rdx -invltlb_ret_rax: +invltlb_ret: movq lapic, %rax movl $0, LA_EOI(%rax) /* End Of Interrupt to APIC */ - LK incl smp_tlb_wait - popq %rax + POP_FRAME jmp doreti_iret SUPERALIGN_TEXT IDTVEC(invltlb_pcid) -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) PUSH_FRAME - movl PCPU(CPUID), %eax -#ifdef COUNT_XINVLTLB_HITS - incl xhits_gbl(,%rax,4) -#endif -#ifdef COUNT_IPIS - movq ipi_invltlb_counts(,%rax,8),%rax - incq (%rax) -#endif - POP_FRAME -#endif - - pushq %rax - pushq %rdx - movq %cr3,%rax + call invltlb_pcid_handler + jmp invltlb_ret - movq $smp_tlb_invpcid,%rdx - cmpl $0,(%rdx) - je global_invltlb - cmpl $-1,(%rdx) - je global_invltlb - - /* - * Only invalidate TLB for entries with current PCID. - */ - cmpl $0,invpcid_works - je 1f - /* Use invpcid if available. */ - movl $1,%eax /* INVPCID_CTX */ - /* invpcid (%rdx),%rax */ - .byte 0x66,0x0f,0x38,0x82,0x02 - jmp invltlb_ret_clear_pm_save -1: - /* Otherwise reload %cr3 twice. */ - movq pcid_cr3,%rdx - cmpq %rax,%rdx - je 2f - movq %rdx,%cr3 /* Invalidate, bit 63 is zero. */ - btsq $63,%rax -2: - movq %rax,%cr3 - jmp invltlb_ret_clear_pm_save SUPERALIGN_TEXT IDTVEC(invltlb) -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) PUSH_FRAME - movl PCPU(CPUID), %eax -#ifdef COUNT_XINVLTLB_HITS - incl xhits_gbl(,%rax,4) -#endif -#ifdef COUNT_IPIS - movq ipi_invltlb_counts(,%rax,8),%rax - incq (%rax) -#endif - POP_FRAME -#endif - pushq %rax - movq %cr3, %rax /* invalidate the TLB */ - movq %rax, %cr3 - jmp invltlb_ret_rax + call invltlb_handler + jmp invltlb_ret /* * Single page TLB shootdown @@ -261,86 +186,17 @@ IDTVEC(invltlb) .text SUPERALIGN_TEXT IDTVEC(invlpg_pcid) -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) PUSH_FRAME - movl PCPU(CPUID), %eax -#ifdef COUNT_XINVLTLB_HITS - incl xhits_pg(,%rax,4) -#endif -#ifdef COUNT_IPIS - movq ipi_invlpg_counts(,%rax,8),%rax - incq (%rax) -#endif - POP_FRAME -#endif - pushq %rax - pushq %rdx - movq $smp_tlb_invpcid,%rdx - cmpl $0,invpcid_works - jne 2f - - /* kernel pmap - use invlpg to invalidate global mapping */ - cmpl $0,(%rdx) - je 3f - cmpl $-1,(%rdx) - je global_invltlb - - /* - * PCID supported, but INVPCID is not. - * Temporarily switch to the target address space and do INVLPG. - */ - pushq %rcx - movq %cr3,%rcx - movq pcid_cr3,%rax - cmp %rcx,%rax - je 1f - btsq $63,%rax - movq %rax,%cr3 -1: movq 8(%rdx),%rax - invlpg (%rax) - btsq $63,%rcx - movq %rcx,%cr3 - popq %rcx - jmp invltlb_ret_rdx - - /* - * Invalidate the TLB entry using INVPCID_ADDR. - */ -2: - xorl %eax,%eax -/* invpcid (%rdx),%rax */ - .byte 0x66,0x0f,0x38,0x82,0x02 - jmp invltlb_ret_rdx - - /* - * PCID is not supported or kernel pmap. - * Invalidate single page using INVLPG. - */ -3: - movq 8(%rdx),%rax - invlpg (%rax) - jmp invltlb_ret_rdx + call invlpg_pcid_handler + jmp invltlb_ret SUPERALIGN_TEXT IDTVEC(invlpg) -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) PUSH_FRAME - movl PCPU(CPUID), %eax -#ifdef COUNT_XINVLTLB_HITS - incl xhits_pg(,%rax,4) -#endif -#ifdef COUNT_IPIS - movq ipi_invlpg_counts(,%rax,8),%rax - incq (%rax) -#endif - POP_FRAME -#endif - pushq %rax - movq smp_tlb_invpcid+8,%rax - invlpg (%rax) /* invalidate single page */ - jmp invltlb_ret_rax + call invlpg_handler + jmp invltlb_ret /* * Page range TLB shootdown. @@ -348,81 +204,10 @@ IDTVEC(invlpg) .text SUPERALIGN_TEXT IDTVEC(invlrng) -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) PUSH_FRAME - movl PCPU(CPUID), %eax -#ifdef COUNT_XINVLTLB_HITS - incl xhits_rng(,%rax,4) -#endif -#ifdef COUNT_IPIS - movq ipi_invlrng_counts(,%rax,8),%rax - incq (%rax) -#endif - POP_FRAME -#endif - pushq %rax - pushq %rdx - movq $smp_tlb_invpcid,%rdx - cmpl $0,pmap_pcid_enabled - je invlrng_single_page - - /* kernel pmap - use invlpg to invalidate global mapping */ - cmpl $0,(%rdx) - je invlrng_single_page - cmpl $-1,(%rdx) - je global_invltlb - cmpl $0,invpcid_works - jne invlrng_invpcid - - pushq %rcx - movq %cr3,%rcx - movq pcid_cr3,%rax - cmpq %rcx,%rax - je 1f - btsq $63,%rax - movq %rax,%cr3 -1: - movq 8(%rdx),%rdx - movq smp_tlb_addr2,%rax -2: - invlpg (%rdx) - addq $PAGE_SIZE,%rdx - cmpq %rax,%rdx - jb 2b - btsq $63,%rcx - movq %rcx,%cr3 - popq %rcx - jmp invltlb_ret_rdx - -invlrng_invpcid: - pushq %rcx - subq $16,%rsp - movq (%rdx),%rcx - movq %rcx,(%rsp) - movq 8(%rdx),%rax - movq %rax,8(%rsp) - movq smp_tlb_addr2,%rcx - subq %rax,%rcx - shrq $PAGE_SHIFT,%rcx -1: -// invpcid (%rdx),%rax - .byte 0x66,0x0f,0x38,0x82,0x02 - addq $PAGE_SIZE,8(%rsp) - dec %rcx - jne 1b - addq $16,%rsp - popq %rcx - jmp invltlb_ret_rdx - -invlrng_single_page: - movq 8(%rdx),%rdx - movq smp_tlb_addr2,%rax -1: invlpg (%rdx) /* invalidate single page */ - addq $PAGE_SIZE,%rdx - cmpq %rax,%rdx - jb 1b - jmp invltlb_ret_rdx + call invlrng_handler + jmp invltlb_ret /* * Invalidate cache. @@ -430,17 +215,10 @@ invlrng_single_page: .text SUPERALIGN_TEXT IDTVEC(invlcache) -#ifdef COUNT_IPIS PUSH_FRAME - movl PCPU(CPUID), %eax - movq ipi_invlcache_counts(,%rax,8),%rax - incq (%rax) - POP_FRAME -#endif - pushq %rax - wbinvd - jmp invltlb_ret_rax + call invlcache_handler + jmp invltlb_ret /* * Handler for IPIs sent via the per-cpu IPI bitmap. Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Tue Mar 11 07:33:33 2014 (r263000) +++ head/sys/amd64/amd64/mp_machdep.c Tue Mar 11 10:03:29 2014 (r263001) @@ -109,6 +109,7 @@ struct invpcid_descr smp_tlb_invpcid; volatile int smp_tlb_wait; uint64_t pcid_cr3; pmap_t smp_tlb_pmap; +extern int invpcid_works; #ifdef COUNT_IPIS /* Interrupt counts. */ @@ -1496,6 +1497,175 @@ cpususpend_handler(void) } /* + * Handlers for TLB related IPIs + */ +void +invltlb_handler(void) +{ +#ifdef COUNT_XINVLTLB_HITS + xhits_gbl[PCPU_GET(cpuid)]++; +#endif /* COUNT_XINVLTLB_HITS */ +#ifdef COUNT_IPIS + (*ipi_invltlb_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + invltlb(); + atomic_add_int(&smp_tlb_wait, 1); +} + +void +invltlb_pcid_handler(void) +{ + uint64_t cr3; +#ifdef COUNT_XINVLTLB_HITS + xhits_gbl[PCPU_GET(cpuid)]++; +#endif /* COUNT_XINVLTLB_HITS */ +#ifdef COUNT_IPIS + (*ipi_invltlb_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + cr3 = rcr3(); + if (smp_tlb_invpcid.pcid != (uint64_t)-1 && + smp_tlb_invpcid.pcid != 0) { + + if (invpcid_works) { + invpcid(&smp_tlb_invpcid, INVPCID_CTX); + } else { + /* Otherwise reload %cr3 twice. */ + if (cr3 != pcid_cr3) { + load_cr3(pcid_cr3); + cr3 |= CR3_PCID_SAVE; + } + load_cr3(cr3); + } + } else { + invltlb_globpcid(); + } + if (smp_tlb_pmap != NULL) + CPU_CLR_ATOMIC(PCPU_GET(cpuid), &smp_tlb_pmap->pm_save); + + atomic_add_int(&smp_tlb_wait, 1); +} + +void +invlpg_handler(void) +{ +#ifdef COUNT_XINVLTLB_HITS + xhits_pg[PCPU_GET(cpuid)]++; +#endif /* COUNT_XINVLTLB_HITS */ +#ifdef COUNT_IPIS + (*ipi_invlpg_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + invlpg(smp_tlb_invpcid.addr); + atomic_add_int(&smp_tlb_wait, 1); +} + +void +invlpg_pcid_handler(void) +{ +#ifdef COUNT_XINVLTLB_HITS + xhits_pg[PCPU_GET(cpuid)]++; +#endif /* COUNT_XINVLTLB_HITS */ +#ifdef COUNT_IPIS + (*ipi_invlpg_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + if (invpcid_works) { + invpcid(&smp_tlb_invpcid, INVPCID_ADDR); + } else if (smp_tlb_invpcid.pcid == 0) { + invlpg(smp_tlb_invpcid.addr); + } else if (smp_tlb_invpcid.pcid == (uint64_t)-1) { + invltlb_globpcid(); + } else { + uint64_t cr3; + + /* + * PCID supported, but INVPCID is not. + * Temporarily switch to the target address + * space and do INVLPG. + */ + cr3 = rcr3(); + if (cr3 != pcid_cr3) + load_cr3(pcid_cr3 | CR3_PCID_SAVE); + invlpg(smp_tlb_invpcid.addr); + load_cr3(cr3 | CR3_PCID_SAVE); + } + + atomic_add_int(&smp_tlb_wait, 1); +} + +static inline void +invlpg_range(vm_offset_t start, vm_offset_t end) +{ + + do { + invlpg(start); + start += PAGE_SIZE; + } while (start < end); +} + +void +invlrng_handler(void) +{ + vm_offset_t addr; +#ifdef COUNT_XINVLTLB_HITS + xhits_rng[PCPU_GET(cpuid)]++; +#endif /* COUNT_XINVLTLB_HITS */ +#ifdef COUNT_IPIS + (*ipi_invlrng_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + addr = smp_tlb_invpcid.addr; + if (pmap_pcid_enabled) { + if (invpcid_works) { + struct invpcid_descr d; + + d = smp_tlb_invpcid; + do { + invpcid(&d, INVPCID_ADDR); + d.addr += PAGE_SIZE; + } while (d.addr < smp_tlb_addr2); + } else if (smp_tlb_invpcid.pcid == 0) { + /* + * kernel pmap - use invlpg to invalidate + * global mapping. + */ + invlpg_range(addr, smp_tlb_addr2); + } else if (smp_tlb_invpcid.pcid == (uint64_t)-1) { + invltlb_globpcid(); + if (smp_tlb_pmap != NULL) { + CPU_CLR_ATOMIC(PCPU_GET(cpuid), + &smp_tlb_pmap->pm_save); + } + } else { + uint64_t cr3; + + cr3 = rcr3(); + if (cr3 != pcid_cr3) + load_cr3(pcid_cr3 | CR3_PCID_SAVE); + invlpg_range(addr, smp_tlb_addr2); + load_cr3(cr3 | CR3_PCID_SAVE); + } + } else { + invlpg_range(addr, smp_tlb_addr2); + } + + atomic_add_int(&smp_tlb_wait, 1); +} + +void +invlcache_handler(void) +{ +#ifdef COUNT_IPIS + (*ipi_invlcache_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + wbinvd(); + atomic_add_int(&smp_tlb_wait, 1); +} + +/* * This is called once the rest of the system is up and running and we're * ready to let the AP's out of the pen. */ Modified: head/sys/amd64/include/smp.h ============================================================================== --- head/sys/amd64/include/smp.h Tue Mar 11 07:33:33 2014 (r263000) +++ head/sys/amd64/include/smp.h Tue Mar 11 10:03:29 2014 (r263001) @@ -62,6 +62,12 @@ struct pmap; void cpu_add(u_int apic_id, char boot_cpu); void cpustop_handler(void); void cpususpend_handler(void); +void invltlb_handler(void); +void invltlb_pcid_handler(void); +void invlpg_handler(void); +void invlpg_pcid_handler(void); +void invlrng_handler(void); +void invlcache_handler(void); void init_secondary(void); void ipi_startup(int apic_id, int vector); void ipi_all_but_self(u_int ipi); Modified: head/sys/i386/i386/apic_vector.s ============================================================================== --- head/sys/i386/i386/apic_vector.s Tue Mar 11 07:33:33 2014 (r263000) +++ head/sys/i386/i386/apic_vector.s Tue Mar 11 10:03:29 2014 (r263001) @@ -163,39 +163,21 @@ IDTVEC(xen_intr_upcall) */ .text SUPERALIGN_TEXT -IDTVEC(invltlb) - pushl %eax - pushl %ds - movl $KDSEL, %eax /* Kernel data selector */ - movl %eax, %ds - -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) - pushl %fs - movl $KPSEL, %eax /* Private space selector */ - movl %eax, %fs - movl PCPU(CPUID), %eax - popl %fs -#ifdef COUNT_XINVLTLB_HITS - incl xhits_gbl(,%eax,4) -#endif -#ifdef COUNT_IPIS - movl ipi_invltlb_counts(,%eax,4),%eax - incl (%eax) -#endif -#endif - - movl %cr3, %eax /* invalidate the TLB */ - movl %eax, %cr3 - +invltlb_ret: movl lapic, %eax movl $0, LA_EOI(%eax) /* End Of Interrupt to APIC */ + POP_FRAME + iret + + SUPERALIGN_TEXT +IDTVEC(invltlb) + PUSH_FRAME + SET_KERNEL_SREGS + cld - lock - incl smp_tlb_wait + call invltlb_handler - popl %ds - popl %eax - iret + jmp invltlb_ret /* * Single page TLB shootdown @@ -203,38 +185,13 @@ IDTVEC(invltlb) .text SUPERALIGN_TEXT IDTVEC(invlpg) - pushl %eax - pushl %ds - movl $KDSEL, %eax /* Kernel data selector */ - movl %eax, %ds - -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) - pushl %fs - movl $KPSEL, %eax /* Private space selector */ - movl %eax, %fs - movl PCPU(CPUID), %eax - popl %fs -#ifdef COUNT_XINVLTLB_HITS - incl xhits_pg(,%eax,4) -#endif -#ifdef COUNT_IPIS - movl ipi_invlpg_counts(,%eax,4),%eax - incl (%eax) -#endif -#endif - - movl smp_tlb_addr1, %eax - invlpg (%eax) /* invalidate single page */ - - movl lapic, %eax - movl $0, LA_EOI(%eax) /* End Of Interrupt to APIC */ + PUSH_FRAME + SET_KERNEL_SREGS + cld - lock - incl smp_tlb_wait + call invlpg_handler - popl %ds - popl %eax - iret + jmp invltlb_ret /* * Page range TLB shootdown. @@ -242,44 +199,13 @@ IDTVEC(invlpg) .text SUPERALIGN_TEXT IDTVEC(invlrng) - pushl %eax - pushl %edx - pushl %ds - movl $KDSEL, %eax /* Kernel data selector */ - movl %eax, %ds - -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) - pushl %fs - movl $KPSEL, %eax /* Private space selector */ - movl %eax, %fs - movl PCPU(CPUID), %eax - popl %fs -#ifdef COUNT_XINVLTLB_HITS - incl xhits_rng(,%eax,4) -#endif -#ifdef COUNT_IPIS - movl ipi_invlrng_counts(,%eax,4),%eax - incl (%eax) -#endif -#endif + PUSH_FRAME + SET_KERNEL_SREGS + cld - movl smp_tlb_addr1, %edx - movl smp_tlb_addr2, %eax -1: invlpg (%edx) /* invalidate single page */ - addl $PAGE_SIZE, %edx - cmpl %eax, %edx - jb 1b + call invlrng_handler - movl lapic, %eax - movl $0, LA_EOI(%eax) /* End Of Interrupt to APIC */ - - lock - incl smp_tlb_wait - - popl %ds - popl %edx - popl %eax - iret + jmp invltlb_ret /* * Invalidate cache. @@ -287,32 +213,13 @@ IDTVEC(invlrng) .text SUPERALIGN_TEXT IDTVEC(invlcache) - pushl %eax - pushl %ds - movl $KDSEL, %eax /* Kernel data selector */ - movl %eax, %ds - -#ifdef COUNT_IPIS - pushl %fs - movl $KPSEL, %eax /* Private space selector */ - movl %eax, %fs - movl PCPU(CPUID), %eax - popl %fs - movl ipi_invlcache_counts(,%eax,4),%eax - incl (%eax) -#endif - - wbinvd - - movl lapic, %eax - movl $0, LA_EOI(%eax) /* End Of Interrupt to APIC */ + PUSH_FRAME + SET_KERNEL_SREGS + cld - lock - incl smp_tlb_wait + call invlcache_handler - popl %ds - popl %eax - iret + jmp invltlb_ret /* * Handler for IPIs sent via the per-cpu IPI bitmap. Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Tue Mar 11 07:33:33 2014 (r263000) +++ head/sys/i386/i386/mp_machdep.c Tue Mar 11 10:03:29 2014 (r263001) @@ -1551,6 +1551,72 @@ cpususpend_handler(void) CPU_CLR_ATOMIC(cpu, &suspended_cpus); CPU_CLR_ATOMIC(cpu, &started_cpus); } + +/* + * Handlers for TLB related IPIs + */ +void +invltlb_handler(void) +{ + uint64_t cr3; +#ifdef COUNT_XINVLTLB_HITS + xhits_gbl[PCPU_GET(cpuid)]++; +#endif /* COUNT_XINVLTLB_HITS */ +#ifdef COUNT_IPIS + (*ipi_invltlb_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + cr3 = rcr3(); + load_cr3(cr3); + atomic_add_int(&smp_tlb_wait, 1); +} + +void +invlpg_handler(void) +{ +#ifdef COUNT_XINVLTLB_HITS + xhits_pg[PCPU_GET(cpuid)]++; +#endif /* COUNT_XINVLTLB_HITS */ +#ifdef COUNT_IPIS + (*ipi_invlpg_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + invlpg(smp_tlb_addr1); + + atomic_add_int(&smp_tlb_wait, 1); +} + +void +invlrng_handler(void) +{ + vm_offset_t addr; +#ifdef COUNT_XINVLTLB_HITS + xhits_rng[PCPU_GET(cpuid)]++; +#endif /* COUNT_XINVLTLB_HITS */ +#ifdef COUNT_IPIS + (*ipi_invlrng_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + addr = smp_tlb_addr1; + do { + invlpg(addr); + addr += PAGE_SIZE; + } while (addr < smp_tlb_addr2); + + atomic_add_int(&smp_tlb_wait, 1); +} + +void +invlcache_handler(void) +{ +#ifdef COUNT_IPIS + (*ipi_invlcache_counts[PCPU_GET(cpuid)])++; +#endif /* COUNT_IPIS */ + + wbinvd(); + atomic_add_int(&smp_tlb_wait, 1); +} + /* * This is called once the rest of the system is up and running and we're * ready to let the AP's out of the pen. Modified: head/sys/i386/include/smp.h ============================================================================== --- head/sys/i386/include/smp.h Tue Mar 11 07:33:33 2014 (r263000) +++ head/sys/i386/include/smp.h Tue Mar 11 10:03:29 2014 (r263001) @@ -63,6 +63,10 @@ void cpustop_handler(void); #ifndef XEN void cpususpend_handler(void); #endif +void invltlb_handler(void); +void invlpg_handler(void); +void invlrng_handler(void); +void invlcache_handler(void); void init_secondary(void); void ipi_startup(int apic_id, int vector); void ipi_all_but_self(u_int ipi); Modified: head/sys/i386/xen/mp_machdep.c ============================================================================== --- head/sys/i386/xen/mp_machdep.c Tue Mar 11 07:33:33 2014 (r263000) +++ head/sys/i386/xen/mp_machdep.c Tue Mar 11 10:03:29 2014 (r263001) @@ -1276,6 +1276,31 @@ cpustop_handler(void) } /* + * Handlers for TLB related IPIs + * + * On i386 Xen PV this are no-ops since this port doesn't support SMP. + */ +void +invltlb_handler(void) +{ +} + +void +invlpg_handler(void) +{ +} + +void +invlrng_handler(void) +{ +} + +void +invlcache_handler(void) +{ +} + +/* * This is called once the rest of the system is up and running and we're * ready to let the AP's out of the pen. */ Modified: head/sys/x86/xen/hvm.c ============================================================================== --- head/sys/x86/xen/hvm.c Tue Mar 11 07:33:33 2014 (r263000) +++ head/sys/x86/xen/hvm.c Tue Mar 11 10:03:29 2014 (r263001) @@ -77,22 +77,12 @@ static void xen_hvm_cpu_resume(void); static void xen_hvm_cpu_init(void); /*---------------------------- Extern Declarations ---------------------------*/ -/* Variables used by mp_machdep to perform the MMU related IPIs */ -extern volatile int smp_tlb_wait; -extern vm_offset_t smp_tlb_addr2; -#ifdef __i386__ -extern vm_offset_t smp_tlb_addr1; -#else -extern struct invpcid_descr smp_tlb_invpcid; -extern uint64_t pcid_cr3; -extern int invpcid_works; -extern int pmap_pcid_enabled; -extern pmap_t smp_tlb_pmap; -#endif - #ifdef __i386__ extern void pmap_lazyfix_action(void); #endif +#ifdef __amd64__ +extern int pmap_pcid_enabled; +#endif /* Variables used by mp_machdep to perform the bitmap IPI */ extern volatile u_int cpu_ipi_pending[MAXCPU]; @@ -179,10 +169,7 @@ static int xen_smp_rendezvous_action(void *arg) { #ifdef COUNT_IPIS - int cpu; - - cpu = PCPU_GET(cpuid); - (*ipi_rendezvous_counts[cpu])++; + (*ipi_rendezvous_counts[PCPU_GET(cpuid)])++; #endif /* COUNT_IPIS */ smp_rendezvous_action(); @@ -192,20 +179,8 @@ xen_smp_rendezvous_action(void *arg) static int xen_invltlb(void *arg) { -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) - int cpu; - - cpu = PCPU_GET(cpuid); -#ifdef COUNT_XINVLTLB_HITS - xhits_gbl[cpu]++; -#endif /* COUNT_XINVLTLB_HITS */ -#ifdef COUNT_IPIS - (*ipi_invltlb_counts[cpu])++; -#endif /* COUNT_IPIS */ -#endif /* COUNT_XINVLTLB_HITS || COUNT_IPIS */ - invltlb(); - atomic_add_int(&smp_tlb_wait, 1); + invltlb_handler(); return (FILTER_HANDLED); } @@ -213,40 +188,8 @@ xen_invltlb(void *arg) static int xen_invltlb_pcid(void *arg) { - uint64_t cr3; -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) - int cpu; - - cpu = PCPU_GET(cpuid); -#ifdef COUNT_XINVLTLB_HITS - xhits_gbl[cpu]++; -#endif /* COUNT_XINVLTLB_HITS */ -#ifdef COUNT_IPIS - (*ipi_invltlb_counts[cpu])++; -#endif /* COUNT_IPIS */ -#endif /* COUNT_XINVLTLB_HITS || COUNT_IPIS */ - cr3 = rcr3(); - if (smp_tlb_invpcid.pcid != (uint64_t)-1 && - smp_tlb_invpcid.pcid != 0) { - - if (invpcid_works) { - invpcid(&smp_tlb_invpcid, INVPCID_CTX); - } else { - /* Otherwise reload %cr3 twice. */ - if (cr3 != pcid_cr3) { - load_cr3(pcid_cr3); - cr3 |= CR3_PCID_SAVE; - } - load_cr3(cr3); - } - } else { - invltlb_globpcid(); - } - if (smp_tlb_pmap != NULL) - CPU_CLR_ATOMIC(PCPU_GET(cpuid), &smp_tlb_pmap->pm_save); - - atomic_add_int(&smp_tlb_wait, 1); + invltlb_pcid_handler(); return (FILTER_HANDLED); } #endif @@ -254,24 +197,8 @@ xen_invltlb_pcid(void *arg) static int xen_invlpg(void *arg) { -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) - int cpu; - - cpu = PCPU_GET(cpuid); -#ifdef COUNT_XINVLTLB_HITS - xhits_pg[cpu]++; -#endif /* COUNT_XINVLTLB_HITS */ -#ifdef COUNT_IPIS - (*ipi_invlpg_counts[cpu])++; -#endif /* COUNT_IPIS */ -#endif /* COUNT_XINVLTLB_HITS || COUNT_IPIS */ -#ifdef __i386__ - invlpg(smp_tlb_addr1); -#else - invlpg(smp_tlb_invpcid.addr); -#endif - atomic_add_int(&smp_tlb_wait, 1); + invlpg_handler(); return (FILTER_HANDLED); } @@ -279,125 +206,25 @@ xen_invlpg(void *arg) static int xen_invlpg_pcid(void *arg) { -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) - int cpu; - - cpu = PCPU_GET(cpuid); -#ifdef COUNT_XINVLTLB_HITS - xhits_pg[cpu]++; -#endif /* COUNT_XINVLTLB_HITS */ -#ifdef COUNT_IPIS - (*ipi_invlpg_counts[cpu])++; -#endif /* COUNT_IPIS */ -#endif /* COUNT_XINVLTLB_HITS || COUNT_IPIS */ - - if (invpcid_works) { - invpcid(&smp_tlb_invpcid, INVPCID_ADDR); - } else if (smp_tlb_invpcid.pcid == 0) { - invlpg(smp_tlb_invpcid.addr); - } else if (smp_tlb_invpcid.pcid == (uint64_t)-1) { - invltlb_globpcid(); - } else { - uint64_t cr3; - - /* - * PCID supported, but INVPCID is not. - * Temporarily switch to the target address - * space and do INVLPG. - */ - cr3 = rcr3(); - if (cr3 != pcid_cr3) - load_cr3(pcid_cr3 | CR3_PCID_SAVE); - invlpg(smp_tlb_invpcid.addr); - load_cr3(cr3 | CR3_PCID_SAVE); - } - atomic_add_int(&smp_tlb_wait, 1); + invlpg_pcid_handler(); return (FILTER_HANDLED); } #endif -static inline void -invlpg_range(vm_offset_t start, vm_offset_t end) -{ - do { - invlpg(start); - start += PAGE_SIZE; - } while (start < end); -} - static int xen_invlrng(void *arg) { - vm_offset_t addr; -#if defined(COUNT_XINVLTLB_HITS) || defined(COUNT_IPIS) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 10:07:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A23D918A; Tue, 11 Mar 2014 10:07:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7358FE2E; Tue, 11 Mar 2014 10:07:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BA73CJ014859; Tue, 11 Mar 2014 10:07:03 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BA71Hg014846; Tue, 11 Mar 2014 10:07:01 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201403111007.s2BA71Hg014846@svn.freebsd.org> From: Roger Pau Monné Date: Tue, 11 Mar 2014 10:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263002 - in head/sys: amd64/amd64 amd64/include conf i386/xen x86/xen xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 10:07:03 -0000 Author: royger Date: Tue Mar 11 10:07:01 2014 New Revision: 263002 URL: http://svnweb.freebsd.org/changeset/base/263002 Log: xen: add PV/PVH kernel entry point Add the PV/PVH entry point and the low level functions for PVH early initialization. Approved by: gibbs Sponsored by: Citrix Systems R&D amd64/amd64/genassym.c: - Add __FreeBSD_version define to assym.s so it can be used for the Xen notes. amd64/amd64/locore.S: - Make bootstack global so it can be used from Xen kernel entry point. amd64/amd64/xen-locore.S: - Add Xen notes to the kernel. - Add the Xen PV entry point, that is going to call hammer_time_xen. amd64/include/asmacros.h: - Add ELFNOTE macros. i386/xen/xen_machdep.c: - Define HYPERVISOR_start_info for the XEN i386 PV port, which is going to be used in some shared code between PV and PVH. x86/xen/hvm.c: - Define HYPERVISOR_start_info for the PVH port. x86/xen/pv.c: - Introduce hammer_time_xen which is going to perform early setup for Xen PVH: - Setup shared Xen variables start_info, shared_info and xen_store. - Set guest type. - Create initial page tables as FreeBSD expects to find them. - Call into native init function (hammer_time). xen/xen-os.h: - Declare HYPERVISOR_start_info. conf/files.amd64: - Add amd64/amd64/locore.S and x86/xen/pv.c to the list of files. Added: head/sys/amd64/amd64/xen-locore.S (contents, props changed) head/sys/x86/xen/pv.c (contents, props changed) Modified: head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/locore.S head/sys/amd64/include/asmacros.h head/sys/conf/files.amd64 head/sys/i386/xen/xen_machdep.c head/sys/x86/xen/hvm.c head/sys/xen/xen-os.h Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Tue Mar 11 10:03:29 2014 (r263001) +++ head/sys/amd64/amd64/genassym.c Tue Mar 11 10:07:01 2014 (r263002) @@ -248,6 +248,8 @@ ASSYM(TSSSEL, GSEL(GPROC0_SEL, SEL_KPL)) ASSYM(LDTSEL, GSEL(GUSERLDT_SEL, SEL_KPL)); ASSYM(SEL_RPL_MASK, SEL_RPL_MASK); +ASSYM(__FreeBSD_version, __FreeBSD_version); + #ifdef HWPMC_HOOKS ASSYM(PMC_FN_USER_CALLCHAIN, PMC_FN_USER_CALLCHAIN); #endif Modified: head/sys/amd64/amd64/locore.S ============================================================================== --- head/sys/amd64/amd64/locore.S Tue Mar 11 10:03:29 2014 (r263001) +++ head/sys/amd64/amd64/locore.S Tue Mar 11 10:07:01 2014 (r263002) @@ -84,5 +84,6 @@ NON_GPROF_ENTRY(btext) .bss ALIGN_DATA /* just to be sure */ + .globl bootstack .space 0x1000 /* space for bootstack - temporary stack */ bootstack: Added: head/sys/amd64/amd64/xen-locore.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/amd64/xen-locore.S Tue Mar 11 10:07:01 2014 (r263002) @@ -0,0 +1,83 @@ +/*- + * Copyright (c) 2003 Peter Wemm + * Copyright (c) 2013 Roger Pau Monne + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include + +#include +#define __ASSEMBLY__ +#include + +#include "assym.s" + +.section __xen_guest + ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz, "FreeBSD") + ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION, .asciz, __XSTRING(__FreeBSD_version)) + ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION, .asciz, "xen-3.0") + ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE, .quad, KERNBASE) + ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET, .quad, KERNBASE) /* Xen honours elf->p_paddr; compensate for this */ + ELFNOTE(Xen, XEN_ELFNOTE_ENTRY, .quad, xen_start) + ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, .quad, hypercall_page) + ELFNOTE(Xen, XEN_ELFNOTE_HV_START_LOW, .quad, HYPERVISOR_VIRT_START) + ELFNOTE(Xen, XEN_ELFNOTE_FEATURES, .asciz, "writable_descriptor_tables|auto_translated_physmap|supervisor_mode_kernel|hvm_callback_vector") + ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE, .asciz, "yes") + ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID, .long, PG_V, PG_V) + ELFNOTE(Xen, XEN_ELFNOTE_LOADER, .asciz, "generic") + ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long, 0) + ELFNOTE(Xen, XEN_ELFNOTE_BSD_SYMTAB, .asciz, "yes") + + .text +.p2align PAGE_SHIFT, 0x90 /* Hypercall_page needs to be PAGE aligned */ + +NON_GPROF_ENTRY(hypercall_page) + .skip 0x1000, 0x90 /* Fill with "nop"s */ + +NON_GPROF_ENTRY(xen_start) + /* Don't trust what the loader gives for rflags. */ + pushq $PSL_KERNEL + popfq + + /* Parameters for the xen init function */ + movq %rsi, %rdi /* shared_info (arg 1) */ + movq %rsp, %rsi /* xenstack (arg 2) */ + + /* Use our own stack */ + movq $bootstack,%rsp + xorl %ebp, %ebp + + /* u_int64_t hammer_time_xen(start_info_t *si, u_int64_t xenstack); */ + call hammer_time_xen + movq %rax, %rsp /* set up kstack for mi_startup() */ + call mi_startup /* autoconfiguration, mountroot etc */ + + /* NOTREACHED */ +0: hlt + jmp 0b Modified: head/sys/amd64/include/asmacros.h ============================================================================== --- head/sys/amd64/include/asmacros.h Tue Mar 11 10:03:29 2014 (r263001) +++ head/sys/amd64/include/asmacros.h Tue Mar 11 10:07:01 2014 (r263002) @@ -201,4 +201,30 @@ #endif /* LOCORE */ +#ifdef __STDC__ +#define ELFNOTE(name, type, desctype, descdata...) \ +.pushsection .note.name ; \ + .align 4 ; \ + .long 2f - 1f /* namesz */ ; \ + .long 4f - 3f /* descsz */ ; \ + .long type ; \ +1:.asciz #name ; \ +2:.align 4 ; \ +3:desctype descdata ; \ +4:.align 4 ; \ +.popsection +#else /* !__STDC__, i.e. -traditional */ +#define ELFNOTE(name, type, desctype, descdata) \ +.pushsection .note.name ; \ + .align 4 ; \ + .long 2f - 1f /* namesz */ ; \ + .long 4f - 3f /* descsz */ ; \ + .long type ; \ +1:.asciz "name" ; \ +2:.align 4 ; \ +3:desctype descdata ; \ +4:.align 4 ; \ +.popsection +#endif /* __STDC__ */ + #endif /* !_MACHINE_ASMACROS_H_ */ Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Mar 11 10:03:29 2014 (r263001) +++ head/sys/conf/files.amd64 Tue Mar 11 10:07:01 2014 (r263002) @@ -108,6 +108,7 @@ amd64/amd64/in_cksum.c optional inet | amd64/amd64/initcpu.c standard amd64/amd64/io.c optional io amd64/amd64/locore.S standard no-obj +amd64/amd64/xen-locore.S optional xenhvm amd64/amd64/machdep.c standard amd64/amd64/mem.c optional mem amd64/amd64/minidump_machdep.c standard @@ -555,3 +556,4 @@ x86/x86/nexus.c standard x86/x86/tsc.c standard x86/xen/hvm.c optional xenhvm x86/xen/xen_intr.c optional xen | xenhvm +x86/xen/pv.c optional xenhvm Modified: head/sys/i386/xen/xen_machdep.c ============================================================================== --- head/sys/i386/xen/xen_machdep.c Tue Mar 11 10:03:29 2014 (r263001) +++ head/sys/i386/xen/xen_machdep.c Tue Mar 11 10:07:01 2014 (r263002) @@ -89,6 +89,7 @@ IDTVEC(div), IDTVEC(dbg), IDTVEC(nmi), I int xendebug_flags; start_info_t *xen_start_info; +start_info_t *HYPERVISOR_start_info; shared_info_t *HYPERVISOR_shared_info; xen_pfn_t *xen_machine_phys = machine_to_phys_mapping; xen_pfn_t *xen_phys_machine; @@ -927,6 +928,7 @@ initvalues(start_info_t *startinfo) HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_4gb_segments_notify); #endif xen_start_info = startinfo; + HYPERVISOR_start_info = startinfo; xen_phys_machine = (xen_pfn_t *)startinfo->mfn_list; IdlePTD = (pd_entry_t *)((uint8_t *)startinfo->pt_base + PAGE_SIZE); Modified: head/sys/x86/xen/hvm.c ============================================================================== --- head/sys/x86/xen/hvm.c Tue Mar 11 10:03:29 2014 (r263001) +++ head/sys/x86/xen/hvm.c Tue Mar 11 10:07:01 2014 (r263002) @@ -149,6 +149,7 @@ DPCPU_DEFINE(xen_intr_handle_t, ipi_hand /** Hypercall table accessed via HYPERVISOR_*_op() methods. */ char *hypercall_stubs; shared_info_t *HYPERVISOR_shared_info; +start_info_t *HYPERVISOR_start_info; #ifdef SMP /*---------------------------- XEN PV IPI Handlers ---------------------------*/ Added: head/sys/x86/xen/pv.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/xen/pv.c Tue Mar 11 10:07:01 2014 (r263002) @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2004 Christian Limpach. + * Copyright (c) 2004-2006,2008 Kip Macy + * Copyright (c) 2013 Roger Pau Monné + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +/* Native initial function */ +extern u_int64_t hammer_time(u_int64_t, u_int64_t); +/* Xen initial function */ +uint64_t hammer_time_xen(start_info_t *, uint64_t); + +/* + * First function called by the Xen PVH boot sequence. + * + * Set some Xen global variables and prepare the environment so it is + * as similar as possible to what native FreeBSD init function expects. + */ +uint64_t +hammer_time_xen(start_info_t *si, uint64_t xenstack) +{ + uint64_t physfree; + uint64_t *PT4 = (u_int64_t *)xenstack; + uint64_t *PT3 = (u_int64_t *)(xenstack + PAGE_SIZE); + uint64_t *PT2 = (u_int64_t *)(xenstack + 2 * PAGE_SIZE); + int i; + + xen_domain_type = XEN_PV_DOMAIN; + vm_guest = VM_GUEST_XEN; + + if ((si == NULL) || (xenstack == 0)) { + HYPERVISOR_shutdown(SHUTDOWN_crash); + } + + /* We use 3 pages of xen stack for the boot pagetables */ + physfree = xenstack + 3 * PAGE_SIZE - KERNBASE; + + /* Setup Xen global variables */ + HYPERVISOR_start_info = si; + HYPERVISOR_shared_info = + (shared_info_t *)(si->shared_info + KERNBASE); + + /* + * Setup some misc global variables for Xen devices + * + * XXX: Devices that need these specific variables should + * be rewritten to fetch this info by themselves from the + * start_info page. + */ + xen_store = (struct xenstore_domain_interface *) + (ptoa(si->store_mfn) + KERNBASE); + + /* + * Use the stack Xen gives us to build the page tables + * as native FreeBSD expects to find them (created + * by the boot trampoline). + */ + for (i = 0; i < (PAGE_SIZE / sizeof(uint64_t)); i++) { + /* Each slot of the level 4 pages points to the same level 3 page */ + PT4[i] = ((uint64_t)&PT3[0]) - KERNBASE; + PT4[i] |= PG_V | PG_RW | PG_U; + + /* Each slot of the level 3 pages points to the same level 2 page */ + PT3[i] = ((uint64_t)&PT2[0]) - KERNBASE; + PT3[i] |= PG_V | PG_RW | PG_U; + + /* The level 2 page slots are mapped with 2MB pages for 1GB. */ + PT2[i] = i * (2 * 1024 * 1024); + PT2[i] |= PG_V | PG_RW | PG_PS | PG_U; + } + load_cr3(((uint64_t)&PT4[0]) - KERNBASE); + + /* Now we can jump into the native init function */ + return (hammer_time(0, physfree)); +} Modified: head/sys/xen/xen-os.h ============================================================================== --- head/sys/xen/xen-os.h Tue Mar 11 10:03:29 2014 (r263001) +++ head/sys/xen/xen-os.h Tue Mar 11 10:07:01 2014 (r263002) @@ -51,6 +51,10 @@ void force_evtchn_callback(void); extern shared_info_t *HYPERVISOR_shared_info; +extern start_info_t *HYPERVISOR_start_info; + +/* XXX: we need to get rid of this and use HYPERVISOR_start_info directly */ +extern struct xenstore_domain_interface *xen_store; enum xen_domain_type { XEN_NATIVE, /* running on bare hardware */ From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 10:07:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA6722E8; Tue, 11 Mar 2014 10:07:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 97655E3E; Tue, 11 Mar 2014 10:07:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BA7tdm014979; Tue, 11 Mar 2014 10:07:55 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BA7tji014978; Tue, 11 Mar 2014 10:07:55 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201403111007.s2BA7tji014978@svn.freebsd.org> From: Roger Pau Monné Date: Tue, 11 Mar 2014 10:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263003 - head/sys/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 10:07:55 -0000 Author: royger Date: Tue Mar 11 10:07:55 2014 New Revision: 263003 URL: http://svnweb.freebsd.org/changeset/base/263003 Log: xen: add macro to detect if running as Dom0 Approved by: gibbs Sponsored by: Citrix Systems R&D xen/xen-os.h: - Add macro to detect if running as Dom0. Modified: head/sys/xen/xen-os.h Modified: head/sys/xen/xen-os.h ============================================================================== --- head/sys/xen/xen-os.h Tue Mar 11 10:07:01 2014 (r263002) +++ head/sys/xen/xen-os.h Tue Mar 11 10:07:55 2014 (r263003) @@ -82,6 +82,13 @@ xen_hvm_domain(void) return (xen_domain_type == XEN_HVM_DOMAIN); } +static inline bool +xen_initial_domain(void) +{ + return (xen_domain() && HYPERVISOR_start_info != NULL && + (HYPERVISOR_start_info->flags & SIF_INITDOMAIN) != 0); +} + #ifndef xen_mb #define xen_mb() mb() #endif From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 10:09:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E130544B; Tue, 11 Mar 2014 10:09:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CC9B5E52; Tue, 11 Mar 2014 10:09:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BA9OD1015202; Tue, 11 Mar 2014 10:09:24 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BA9NZp015193; Tue, 11 Mar 2014 10:09:23 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201403111009.s2BA9NZp015193@svn.freebsd.org> From: Roger Pau Monné Date: Tue, 11 Mar 2014 10:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263004 - in head/sys: conf dev/xen/console i386/include/xen i386/xen x86/xen xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 10:09:25 -0000 Author: royger Date: Tue Mar 11 10:09:23 2014 New Revision: 263004 URL: http://svnweb.freebsd.org/changeset/base/263004 Log: xen: add and enable Xen console for PVH guests This adds and enables the PV console used on XEN kernels to GENERIC/XENHVM kernels in order for it to be used on PVH. Approved by: gibbs Sponsored by: Citrix Systems R&D dev/xen/console/console.c: - Define console_page. - Move xc_printf debug function from i386 XEN code to generic console code. - Rework xc_printf. - Use xen_initial_domain instead of open-coded checks for Dom0. - Gate the attach of the PV console to PV(H) guests. dev/xen/console/xencons_ring.c: - Allow the PV Xen console to output earlier by directly signaling the event channel in start_info if the event channel is not yet initialized. - Use HYPERVISOR_start_info instead of xen_start_info. i386/include/xen/xen-os.h: - Remove prototype for xc_printf since it's now declared in global xen-os.h i386/xen/xen_machdep.c: - Remove previous version of xc_printf. - Remove definition of console_page (now it's defined in the console itself). - Fix some printf formatting errors. x86/xen/pv.c: - Add some early boot debug messages using xc_printf. - Set console_page based on the value passed in start_info. xen/xen-os.h: - Declare console_page and add prototype for xc_printf. Modified: head/sys/conf/files head/sys/dev/xen/console/console.c head/sys/dev/xen/console/xencons_ring.c head/sys/i386/include/xen/xen-os.h head/sys/i386/xen/xen_machdep.c head/sys/x86/xen/pv.c head/sys/xen/xen-os.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Mar 11 10:07:55 2014 (r263003) +++ head/sys/conf/files Tue Mar 11 10:09:23 2014 (r263004) @@ -2527,8 +2527,8 @@ dev/xe/if_xe_pccard.c optional xe pccar dev/xen/balloon/balloon.c optional xen | xenhvm dev/xen/blkfront/blkfront.c optional xen | xenhvm dev/xen/blkback/blkback.c optional xen | xenhvm -dev/xen/console/console.c optional xen -dev/xen/console/xencons_ring.c optional xen +dev/xen/console/console.c optional xen | xenhvm +dev/xen/console/xencons_ring.c optional xen | xenhvm dev/xen/control/control.c optional xen | xenhvm dev/xen/netback/netback.c optional xen | xenhvm dev/xen/netfront/netfront.c optional xen | xenhvm Modified: head/sys/dev/xen/console/console.c ============================================================================== --- head/sys/dev/xen/console/console.c Tue Mar 11 10:07:55 2014 (r263003) +++ head/sys/dev/xen/console/console.c Tue Mar 11 10:09:23 2014 (r263004) @@ -27,6 +27,8 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" +#include "opt_printf.h" + #ifdef DDB #include #endif @@ -69,11 +71,14 @@ struct mtx cn_mtx; static char wbuf[WBUF_SIZE]; static char rbuf[RBUF_SIZE]; static int rc, rp; -static unsigned int cnsl_evt_reg; +bool cnsl_evt_reg; static unsigned int wc, wp; /* write_cons, write_prod */ xen_intr_handle_t xen_intr_handle; device_t xencons_dev; +/* Virtual address of the shared console page */ +char *console_page; + #ifdef KDB static int xc_altbrk; #endif @@ -110,9 +115,70 @@ static struct ttydevsw xc_ttydevsw = { .tsw_outwakeup = xcoutwakeup, }; +/*----------------------------- Debug function -------------------------------*/ +struct putchar_arg { + char *buf; + size_t size; + size_t n_next; +}; + +static void +putchar(int c, void *arg) +{ + struct putchar_arg *pca; + + pca = (struct putchar_arg *)arg; + + if (pca->buf == NULL) { + /* + * We have no buffer, output directly to the + * console char by char. + */ + HYPERVISOR_console_write((char *)&c, 1); + } else { + pca->buf[pca->n_next++] = c; + if ((pca->size == pca->n_next) || (c = '\0')) { + /* Flush the buffer */ + HYPERVISOR_console_write(pca->buf, pca->n_next); + pca->n_next = 0; + } + } +} + +void +xc_printf(const char *fmt, ...) +{ + va_list ap; + struct putchar_arg pca; +#ifdef PRINTF_BUFR_SIZE + char buf[PRINTF_BUFR_SIZE]; + + pca.buf = buf; + pca.size = sizeof(buf); + pca.n_next = 0; +#else + pca.buf = NULL; + pca.size = 0; +#endif + + KASSERT((xen_domain()), ("call to xc_printf from non Xen guest")); + + va_start(ap, fmt); + kvprintf(fmt, putchar, &pca, 10, ap); + va_end(ap); + +#ifdef PRINTF_BUFR_SIZE + if (pca.n_next != 0) + HYPERVISOR_console_write(buf, pca.n_next); +#endif +} + static void xc_cnprobe(struct consdev *cp) { + if (!xen_pv_domain()) + return; + cp->cn_pri = CN_REMOTE; sprintf(cp->cn_name, "%s0", driver_name); } @@ -175,7 +241,7 @@ static void xc_cnputc(struct consdev *dev, int c) { - if (xen_start_info->flags & SIF_INITDOMAIN) + if (xen_initial_domain()) xc_cnputc_dom0(dev, c); else xc_cnputc_domu(dev, c); @@ -206,8 +272,7 @@ xcons_putc(int c) xcons_force_flush(); #endif } - if (cnsl_evt_reg) - __xencons_tx_flush(); + __xencons_tx_flush(); /* inform start path that we're pretty full */ return ((wp - wc) >= WBUF_SIZE - 100) ? TRUE : FALSE; @@ -217,6 +282,10 @@ static void xc_identify(driver_t *driver, device_t parent) { device_t child; + + if (!xen_pv_domain()) + return; + child = BUS_ADD_CHILD(parent, 0, driver_name, 0); device_set_driver(child, driver); device_set_desc(child, "Xen Console"); @@ -242,10 +311,10 @@ xc_attach(device_t dev) xencons_ring_init(); - cnsl_evt_reg = 1; + cnsl_evt_reg = true; callout_reset(&xc_callout, XC_POLLTIME, xc_timeout, xccons); - if (xen_start_info->flags & SIF_INITDOMAIN) { + if (xen_initial_domain()) { error = xen_intr_bind_virq(dev, VIRQ_CONSOLE, 0, NULL, xencons_priv_interrupt, NULL, INTR_TYPE_TTY, &xen_intr_handle); @@ -309,7 +378,7 @@ __xencons_tx_flush(void) sz = wp - wc; if (sz > (WBUF_SIZE - WBUF_MASK(wc))) sz = WBUF_SIZE - WBUF_MASK(wc); - if (xen_start_info->flags & SIF_INITDOMAIN) { + if (xen_initial_domain()) { HYPERVISOR_console_io(CONSOLEIO_write, sz, &wbuf[WBUF_MASK(wc)]); wc += sz; } else { @@ -426,7 +495,7 @@ xcons_force_flush(void) { int sz; - if (xen_start_info->flags & SIF_INITDOMAIN) + if (xen_initial_domain()) return; /* Spin until console data is flushed through to the domain controller. */ Modified: head/sys/dev/xen/console/xencons_ring.c ============================================================================== --- head/sys/dev/xen/console/xencons_ring.c Tue Mar 11 10:07:55 2014 (r263003) +++ head/sys/dev/xen/console/xencons_ring.c Tue Mar 11 10:09:23 2014 (r263004) @@ -32,9 +32,9 @@ __FBSDID("$FreeBSD$"); #define console_evtchn console.domU.evtchn xen_intr_handle_t console_handle; -extern char *console_page; extern struct mtx cn_mtx; extern device_t xencons_dev; +extern bool cnsl_evt_reg; static inline struct xencons_interface * xencons_interface(void) @@ -60,6 +60,9 @@ xencons_ring_send(const char *data, unsi struct xencons_interface *intf; XENCONS_RING_IDX cons, prod; int sent; + struct evtchn_send send = { + .port = HYPERVISOR_start_info->console_evtchn + }; intf = xencons_interface(); cons = intf->out_cons; @@ -76,7 +79,10 @@ xencons_ring_send(const char *data, unsi wmb(); intf->out_prod = prod; - xen_intr_signal(console_handle); + if (cnsl_evt_reg) + xen_intr_signal(console_handle); + else + HYPERVISOR_event_channel_op(EVTCHNOP_send, &send); return sent; @@ -125,11 +131,11 @@ xencons_ring_init(void) { int err; - if (!xen_start_info->console_evtchn) + if (HYPERVISOR_start_info->console_evtchn == 0) return 0; err = xen_intr_bind_local_port(xencons_dev, - xen_start_info->console_evtchn, NULL, xencons_handle_input, NULL, + HYPERVISOR_start_info->console_evtchn, NULL, xencons_handle_input, NULL, INTR_TYPE_MISC | INTR_MPSAFE, &console_handle); if (err) { return err; @@ -145,7 +151,7 @@ void xencons_suspend(void) { - if (!xen_start_info->console_evtchn) + if (HYPERVISOR_start_info->console_evtchn == 0) return; xen_intr_unbind(&console_handle); Modified: head/sys/i386/include/xen/xen-os.h ============================================================================== --- head/sys/i386/include/xen/xen-os.h Tue Mar 11 10:07:55 2014 (r263003) +++ head/sys/i386/include/xen/xen-os.h Tue Mar 11 10:09:23 2014 (r263004) @@ -45,7 +45,6 @@ static inline void rep_nop(void) #define cpu_relax() rep_nop() #ifndef XENHVM -void xc_printf(const char *fmt, ...); #ifdef SMP extern int gdtset; Modified: head/sys/i386/xen/xen_machdep.c ============================================================================== --- head/sys/i386/xen/xen_machdep.c Tue Mar 11 10:07:55 2014 (r263003) +++ head/sys/i386/xen/xen_machdep.c Tue Mar 11 10:09:23 2014 (r263004) @@ -186,21 +186,6 @@ xen_boothowto(char *envp) return howto; } -#define XC_PRINTF_BUFSIZE 1024 -void -xc_printf(const char *fmt, ...) -{ - __va_list ap; - int retval; - static char buf[XC_PRINTF_BUFSIZE]; - - va_start(ap, fmt); - retval = vsnprintf(buf, XC_PRINTF_BUFSIZE - 1, fmt, ap); - va_end(ap); - buf[retval] = 0; - (void)HYPERVISOR_console_write(buf, retval); -} - #define XPQUEUE_SIZE 128 @@ -745,8 +730,6 @@ void initvalues(start_info_t *startinfo) struct xenstore_domain_interface; extern struct xenstore_domain_interface *xen_store; -char *console_page; - void * bootmem_alloc(unsigned int size) { @@ -969,7 +952,7 @@ initvalues(start_info_t *startinfo) xc_printf("initvalues(): wooh - availmem=%x,%x\n", avail_space, cur_space); - xc_printf("KERNBASE=%x,pt_base=%x, VTOPFN(base)=%x, nr_pt_frames=%x\n", + xc_printf("KERNBASE=%x,pt_base=%lx, VTOPFN(base)=%x, nr_pt_frames=%lx\n", KERNBASE,xen_start_info->pt_base, VTOPFN(xen_start_info->pt_base), xen_start_info->nr_pt_frames); xendebug_flags = 0; /* 0xffffffff; */ @@ -978,7 +961,7 @@ initvalues(start_info_t *startinfo) shift_phys_machine(xen_phys_machine, xen_start_info->nr_pages); #endif XENPRINTF("IdlePTD %p\n", IdlePTD); - XENPRINTF("nr_pages: %ld shared_info: 0x%lx flags: 0x%lx pt_base: 0x%lx " + XENPRINTF("nr_pages: %ld shared_info: 0x%lx flags: 0x%x pt_base: 0x%lx " "mod_start: 0x%lx mod_len: 0x%lx\n", xen_start_info->nr_pages, xen_start_info->shared_info, xen_start_info->flags, xen_start_info->pt_base, Modified: head/sys/x86/xen/pv.c ============================================================================== --- head/sys/x86/xen/pv.c Tue Mar 11 10:07:55 2014 (r263003) +++ head/sys/x86/xen/pv.c Tue Mar 11 10:09:23 2014 (r263004) @@ -73,9 +73,12 @@ hammer_time_xen(start_info_t *si, uint64 vm_guest = VM_GUEST_XEN; if ((si == NULL) || (xenstack == 0)) { + xc_printf("ERROR: invalid start_info or xen stack, halting\n"); HYPERVISOR_shutdown(SHUTDOWN_crash); } + xc_printf("FreeBSD PVH running on %s\n", si->magic); + /* We use 3 pages of xen stack for the boot pagetables */ physfree = xenstack + 3 * PAGE_SIZE - KERNBASE; @@ -93,6 +96,7 @@ hammer_time_xen(start_info_t *si, uint64 */ xen_store = (struct xenstore_domain_interface *) (ptoa(si->store_mfn) + KERNBASE); + console_page = (char *)(ptoa(si->console.domU.mfn) + KERNBASE); /* * Use the stack Xen gives us to build the page tables Modified: head/sys/xen/xen-os.h ============================================================================== --- head/sys/xen/xen-os.h Tue Mar 11 10:07:55 2014 (r263003) +++ head/sys/xen/xen-os.h Tue Mar 11 10:09:23 2014 (r263004) @@ -55,6 +55,7 @@ extern start_info_t *HYPERVISOR_start_in /* XXX: we need to get rid of this and use HYPERVISOR_start_info directly */ extern struct xenstore_domain_interface *xen_store; +extern char *console_page; enum xen_domain_type { XEN_NATIVE, /* running on bare hardware */ @@ -89,6 +90,9 @@ xen_initial_domain(void) (HYPERVISOR_start_info->flags & SIF_INITDOMAIN) != 0); } +/* Debug/emergency function, prints directly to hypervisor console */ +void xc_printf(const char *, ...) __printflike(1, 2); + #ifndef xen_mb #define xen_mb() mb() #endif From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 10:13:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0B2D638; Tue, 11 Mar 2014 10:13:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 80A2BEF7; Tue, 11 Mar 2014 10:13:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BAD9lX018596; Tue, 11 Mar 2014 10:13:09 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BAD70J018581; Tue, 11 Mar 2014 10:13:07 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201403111013.s2BAD70J018581@svn.freebsd.org> From: Roger Pau Monné Date: Tue, 11 Mar 2014 10:13:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263005 - in head/sys: boot/i386/efi boot/i386/libi386 boot/ia64/common boot/powerpc/ofw boot/powerpc/ps3 boot/sparc64/loader boot/uboot/common boot/userboot/userboot i386/xen sys x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 10:13:09 -0000 Author: royger Date: Tue Mar 11 10:13:06 2014 New Revision: 263005 URL: http://svnweb.freebsd.org/changeset/base/263005 Log: howto_names: unify declaration Approved by: gibbs Sponsored by: Citrix Systems R&D boot/i386/efi/bootinfo.c: boot/i386/libi386/bootinfo.c: boot/ia64/common/bootinfo.c: boot/powerpc/ofw/metadata.c: boot/powerpc/ps3/metadata.c: boot/sparc64/loader/metadata.c: boot/uboot/common/metadata.c: boot/userboot/userboot/bootinfo.c: i386/xen/xen_machdep.c: - Include sys/boot.h - Remove custom definition of howto_names. sys/boot.h: - Define howto_names. x86/xen/pv.c: - Include sys/boot.h Added: head/sys/sys/boot.h (contents, props changed) Modified: head/sys/boot/i386/efi/bootinfo.c head/sys/boot/i386/libi386/bootinfo.c head/sys/boot/ia64/common/bootinfo.c head/sys/boot/powerpc/ofw/metadata.c head/sys/boot/powerpc/ps3/metadata.c head/sys/boot/sparc64/loader/metadata.c head/sys/boot/uboot/common/metadata.c head/sys/boot/userboot/userboot/bootinfo.c head/sys/i386/xen/xen_machdep.c head/sys/x86/xen/pv.c Modified: head/sys/boot/i386/efi/bootinfo.c ============================================================================== --- head/sys/boot/i386/efi/bootinfo.c Tue Mar 11 10:09:23 2014 (r263004) +++ head/sys/boot/i386/efi/bootinfo.c Tue Mar 11 10:13:06 2014 (r263005) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -41,29 +42,6 @@ __FBSDID("$FreeBSD$"); #include "libi386.h" #include -/* - * Return a 'boothowto' value corresponding to the kernel arguments in - * (kargs) and any relevant environment variables. - */ -static struct -{ - const char *ev; - int mask; -} howto_names[] = { - { "boot_askname", RB_ASKNAME}, - { "boot_cdrom", RB_CDROM}, - { "boot_ddb", RB_KDB}, - { "boot_dfltroot", RB_DFLTROOT}, - { "boot_gdb", RB_GDB}, - { "boot_multicons", RB_MULTIPLE}, - { "boot_mute", RB_MUTE}, - { "boot_pause", RB_PAUSE}, - { "boot_serial", RB_SERIAL}, - { "boot_single", RB_SINGLE}, - { "boot_verbose", RB_VERBOSE}, - { NULL, 0} -}; - static const char howto_switches[] = "aCdrgDmphsv"; static int howto_masks[] = { RB_ASKNAME, RB_CDROM, RB_KDB, RB_DFLTROOT, RB_GDB, RB_MULTIPLE, Modified: head/sys/boot/i386/libi386/bootinfo.c ============================================================================== --- head/sys/boot/i386/libi386/bootinfo.c Tue Mar 11 10:09:23 2014 (r263004) +++ head/sys/boot/i386/libi386/bootinfo.c Tue Mar 11 10:13:06 2014 (r263005) @@ -31,33 +31,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bootstrap.h" #include "libi386.h" #include "btxv86.h" -/* - * Return a 'boothowto' value corresponding to the kernel arguments in - * (kargs) and any relevant environment variables. - */ -static struct -{ - const char *ev; - int mask; -} howto_names[] = { - {"boot_askname", RB_ASKNAME}, - {"boot_cdrom", RB_CDROM}, - {"boot_ddb", RB_KDB}, - {"boot_dfltroot", RB_DFLTROOT}, - {"boot_gdb", RB_GDB}, - {"boot_multicons", RB_MULTIPLE}, - {"boot_mute", RB_MUTE}, - {"boot_pause", RB_PAUSE}, - {"boot_serial", RB_SERIAL}, - {"boot_single", RB_SINGLE}, - {"boot_verbose", RB_VERBOSE}, - {NULL, 0} -}; - int bi_getboothowto(char *kargs) { Modified: head/sys/boot/ia64/common/bootinfo.c ============================================================================== --- head/sys/boot/ia64/common/bootinfo.c Tue Mar 11 10:09:23 2014 (r263004) +++ head/sys/boot/ia64/common/bootinfo.c Tue Mar 11 10:13:06 2014 (r263005) @@ -33,35 +33,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include "libia64.h" -/* - * Return a 'boothowto' value corresponding to the kernel arguments in - * (kargs) and any relevant environment variables. - */ -static struct -{ - const char *ev; - int mask; -} howto_names[] = { - { "boot_askname", RB_ASKNAME}, - { "boot_cdrom", RB_CDROM}, - { "boot_ddb", RB_KDB}, - { "boot_dfltroot", RB_DFLTROOT}, - { "boot_gdb", RB_GDB}, - { "boot_multicons", RB_MULTIPLE}, - { "boot_mute", RB_MUTE}, - { "boot_pause", RB_PAUSE}, - { "boot_serial", RB_SERIAL}, - { "boot_single", RB_SINGLE}, - { "boot_verbose", RB_VERBOSE}, - { NULL, 0} -}; - static const char howto_switches[] = "aCdrgDmphsv"; static int howto_masks[] = { RB_ASKNAME, RB_CDROM, RB_KDB, RB_DFLTROOT, RB_GDB, RB_MULTIPLE, Modified: head/sys/boot/powerpc/ofw/metadata.c ============================================================================== --- head/sys/boot/powerpc/ofw/metadata.c Tue Mar 11 10:09:23 2014 (r263004) +++ head/sys/boot/powerpc/ofw/metadata.c Tue Mar 11 10:13:06 2014 (r263005) @@ -33,35 +33,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "bootstrap.h" #include "libofw.h" -/* - * Return a 'boothowto' value corresponding to the kernel arguments in - * (kargs) and any relevant environment variables. - */ -static struct -{ - const char *ev; - int mask; -} howto_names[] = { - {"boot_askname", RB_ASKNAME}, - {"boot_cdrom", RB_CDROM}, - {"boot_ddb", RB_KDB}, - {"boot_dfltroot", RB_DFLTROOT}, - {"boot_gdb", RB_GDB}, - {"boot_multicons", RB_MULTIPLE}, - {"boot_mute", RB_MUTE}, - {"boot_pause", RB_PAUSE}, - {"boot_serial", RB_SERIAL}, - {"boot_single", RB_SINGLE}, - {"boot_verbose", RB_VERBOSE}, - {NULL, 0} -}; - int md_getboothowto(char *kargs) { Modified: head/sys/boot/powerpc/ps3/metadata.c ============================================================================== --- head/sys/boot/powerpc/ps3/metadata.c Tue Mar 11 10:09:23 2014 (r263004) +++ head/sys/boot/powerpc/ps3/metadata.c Tue Mar 11 10:13:06 2014 (r263005) @@ -33,34 +33,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "bootstrap.h" -/* - * Return a 'boothowto' value corresponding to the kernel arguments in - * (kargs) and any relevant environment variables. - */ -static struct -{ - const char *ev; - int mask; -} howto_names[] = { - {"boot_askname", RB_ASKNAME}, - {"boot_cdrom", RB_CDROM}, - {"boot_ddb", RB_KDB}, - {"boot_dfltroot", RB_DFLTROOT}, - {"boot_gdb", RB_GDB}, - {"boot_multicons", RB_MULTIPLE}, - {"boot_mute", RB_MUTE}, - {"boot_pause", RB_PAUSE}, - {"boot_serial", RB_SERIAL}, - {"boot_single", RB_SINGLE}, - {"boot_verbose", RB_VERBOSE}, - {NULL, 0} -}; - int md_getboothowto(char *kargs) { Modified: head/sys/boot/sparc64/loader/metadata.c ============================================================================== --- head/sys/boot/sparc64/loader/metadata.c Tue Mar 11 10:09:23 2014 (r263004) +++ head/sys/boot/sparc64/loader/metadata.c Tue Mar 11 10:13:06 2014 (r263005) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -47,29 +48,6 @@ extern int itlb_slot; static int md_bootserial(void); -/* - * Return a 'boothowto' value corresponding to the kernel arguments in - * (kargs) and any relevant environment variables. - */ -static struct -{ - const char *ev; - int mask; -} howto_names[] = { - {"boot_askname", RB_ASKNAME}, - {"boot_cdrom", RB_CDROM}, - {"boot_ddb", RB_KDB}, - {"boot_dfltroot", RB_DFLTROOT}, - {"boot_gdb", RB_GDB}, - {"boot_multicons", RB_MULTIPLE}, - {"boot_mute", RB_MUTE}, - {"boot_pause", RB_PAUSE}, - {"boot_serial", RB_SERIAL}, - {"boot_single", RB_SINGLE}, - {"boot_verbose", RB_VERBOSE}, - {NULL, 0} -}; - int md_getboothowto(char *kargs) { Modified: head/sys/boot/uboot/common/metadata.c ============================================================================== --- head/sys/boot/uboot/common/metadata.c Tue Mar 11 10:09:23 2014 (r263004) +++ head/sys/boot/uboot/common/metadata.c Tue Mar 11 10:13:06 2014 (r263005) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -45,29 +46,6 @@ __FBSDID("$FreeBSD$"); #include "libuboot.h" #endif -/* - * Return a 'boothowto' value corresponding to the kernel arguments in - * (kargs) and any relevant environment variables. - */ -static struct -{ - const char *ev; - int mask; -} howto_names[] = { - {"boot_askname", RB_ASKNAME}, - {"boot_cdrom", RB_CDROM}, - {"boot_ddb", RB_KDB}, - {"boot_dfltroot", RB_DFLTROOT}, - {"boot_gdb", RB_GDB}, - {"boot_multicons", RB_MULTIPLE}, - {"boot_mute", RB_MUTE}, - {"boot_pause", RB_PAUSE}, - {"boot_serial", RB_SERIAL}, - {"boot_single", RB_SINGLE}, - {"boot_verbose", RB_VERBOSE}, - {NULL, 0} -}; - static int md_getboothowto(char *kargs) { Modified: head/sys/boot/userboot/userboot/bootinfo.c ============================================================================== --- head/sys/boot/userboot/userboot/bootinfo.c Tue Mar 11 10:09:23 2014 (r263004) +++ head/sys/boot/userboot/userboot/bootinfo.c Tue Mar 11 10:13:06 2014 (r263005) @@ -31,33 +31,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bootstrap.h" #include "libuserboot.h" -/* - * Return a 'boothowto' value corresponding to the kernel arguments in - * (kargs) and any relevant environment variables. - */ -static struct -{ - const char *ev; - int mask; -} howto_names[] = { - {"boot_askname", RB_ASKNAME}, - {"boot_cdrom", RB_CDROM}, - {"boot_ddb", RB_KDB}, - {"boot_dfltroot", RB_DFLTROOT}, - {"boot_gdb", RB_GDB}, - {"boot_multicons", RB_MULTIPLE}, - {"boot_mute", RB_MUTE}, - {"boot_pause", RB_PAUSE}, - {"boot_serial", RB_SERIAL}, - {"boot_single", RB_SINGLE}, - {"boot_verbose", RB_VERBOSE}, - {NULL, 0} -}; - int bi_getboothowto(char *kargs) { Modified: head/sys/i386/xen/xen_machdep.c ============================================================================== --- head/sys/i386/xen/xen_machdep.c Tue Mar 11 10:09:23 2014 (r263004) +++ head/sys/i386/xen/xen_machdep.c Tue Mar 11 10:13:06 2014 (r263005) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -156,24 +157,6 @@ xen_setbootenv(char *cmd_line) return cmd_line; } -static struct -{ - const char *ev; - int mask; -} howto_names[] = { - {"boot_askname", RB_ASKNAME}, - {"boot_single", RB_SINGLE}, - {"boot_nosync", RB_NOSYNC}, - {"boot_halt", RB_ASKNAME}, - {"boot_serial", RB_SERIAL}, - {"boot_cdrom", RB_CDROM}, - {"boot_gdb", RB_GDB}, - {"boot_gdb_pause", RB_RESERVED1}, - {"boot_verbose", RB_VERBOSE}, - {"boot_multicons", RB_MULTIPLE}, - {NULL, 0} -}; - int xen_boothowto(char *envp) { Added: head/sys/sys/boot.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/boot.h Tue Mar 11 10:13:06 2014 (r263005) @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2014 Roger Pau Monné + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS_BOOT_H_ +#define _SYS_BOOT_H_ + +/* + * Return a 'boothowto' value corresponding to the kernel arguments in + * (kargs) and any relevant environment variables. + */ +static struct +{ + const char *ev; + int mask; +} howto_names[] = { + { "boot_askname", RB_ASKNAME}, + { "boot_cdrom", RB_CDROM}, + { "boot_ddb", RB_KDB}, + { "boot_dfltroot", RB_DFLTROOT}, + { "boot_gdb", RB_GDB}, + { "boot_multicons", RB_MULTIPLE}, + { "boot_mute", RB_MUTE}, + { "boot_pause", RB_PAUSE}, + { "boot_serial", RB_SERIAL}, + { "boot_single", RB_SINGLE}, + { "boot_verbose", RB_VERBOSE}, + { NULL, 0} +}; + +#endif /* !_SYS_BOOT_H_ */ Modified: head/sys/x86/xen/pv.c ============================================================================== --- head/sys/x86/xen/pv.c Tue Mar 11 10:09:23 2014 (r263004) +++ head/sys/x86/xen/pv.c Tue Mar 11 10:13:06 2014 (r263005) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 10:15:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 682DC7AF; Tue, 11 Mar 2014 10:15:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 49BC9F12; Tue, 11 Mar 2014 10:15:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BAFQPZ018916; Tue, 11 Mar 2014 10:15:26 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BAFPfe018913; Tue, 11 Mar 2014 10:15:25 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201403111015.s2BAFPfe018913@svn.freebsd.org> From: Roger Pau Monné Date: Tue, 11 Mar 2014 10:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263006 - in head/sys: amd64/amd64 x86/include x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 10:15:26 -0000 Author: royger Date: Tue Mar 11 10:15:25 2014 New Revision: 263006 URL: http://svnweb.freebsd.org/changeset/base/263006 Log: amd64: introduce hook for custom preload metadata parsers Add hooks to amd64 in order to have diverging implementations, since on Xen PV the metadata is passed to the kernel in a different form. Approbed by: gibbs Sponsored by: Citrix Systems R&D amd64/amd64/machdep.c: - Define init_ops for native. - Put native code inside of native_parse_preload_data hook. - Call the parse_preload_data in order to fill the metadata info. x86/include/init.h: - Declare the init_ops struct. x86/xen/pv.c: - Declare xen_init_ops that contains the Xen PV implementation of init_ops. - Implement the parse_preload_data for Xen PVH, the info is fetched from HYPERVISOR_start_info->cmd_line as provided by Xen. Added: head/sys/x86/include/init.h (contents, props changed) Modified: head/sys/amd64/amd64/machdep.c head/sys/x86/xen/pv.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Mar 11 10:13:06 2014 (r263005) +++ head/sys/amd64/amd64/machdep.c Tue Mar 11 10:15:25 2014 (r263006) @@ -145,6 +145,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* Sanity check for __curthread() */ CTASSERT(offsetof(struct pcpu, pc_curthread) == 0); @@ -165,6 +166,14 @@ static int set_fpcontext(struct thread char *xfpustate, size_t xfpustate_len); SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); +/* Preload data parse function */ +static caddr_t native_parse_preload_data(u_int64_t); + +/* Default init_ops implementation. */ +struct init_ops init_ops = { + .parse_preload_data = native_parse_preload_data, +}; + /* * The file "conf/ldscript.amd64" defines the symbol "kernphys". Its value is * the physical address at which the kernel is loaded. @@ -1685,6 +1694,26 @@ do_next: msgbufp = (struct msgbuf *)PHYS_TO_DMAP(phys_avail[pa_indx]); } +static caddr_t +native_parse_preload_data(u_int64_t modulep) +{ + caddr_t kmdp; + + preload_metadata = (caddr_t)(uintptr_t)(modulep + KERNBASE); + preload_bootstrap_relocate(KERNBASE); + kmdp = preload_search_by_type("elf kernel"); + if (kmdp == NULL) + kmdp = preload_search_by_type("elf64 kernel"); + boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); + kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *) + KERNBASE; +#ifdef DDB + ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); + ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); +#endif + + return (kmdp); +} + u_int64_t hammer_time(u_int64_t modulep, u_int64_t physfree) { @@ -1709,17 +1738,7 @@ hammer_time(u_int64_t modulep, u_int64_t */ proc_linkup0(&proc0, &thread0); - preload_metadata = (caddr_t)(uintptr_t)(modulep + KERNBASE); - preload_bootstrap_relocate(KERNBASE); - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); - kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *) + KERNBASE; -#ifdef DDB - ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); - ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); -#endif + kmdp = init_ops.parse_preload_data(modulep); /* Init basic tunables, hz etc */ init_param1(); Added: head/sys/x86/include/init.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/include/init.h Tue Mar 11 10:15:25 2014 (r263006) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2013 Roger Pau Monné + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __X86_INIT_H__ +#define __X86_INIT_H__ +/* + * Struct containing pointers to init functions whose + * implementation is run time selectable. Selection can be made, + * for example, based on detection of a BIOS variant or + * hypervisor environment. + */ +struct init_ops { + caddr_t (*parse_preload_data)(u_int64_t); +}; + +extern struct init_ops init_ops; + +#endif /* __X86_INIT_H__ */ Modified: head/sys/x86/xen/pv.c ============================================================================== --- head/sys/x86/xen/pv.c Tue Mar 11 10:13:06 2014 (r263005) +++ head/sys/x86/xen/pv.c Tue Mar 11 10:15:25 2014 (r263006) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -47,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include @@ -55,6 +58,16 @@ extern u_int64_t hammer_time(u_int64_t, /* Xen initial function */ uint64_t hammer_time_xen(start_info_t *, uint64_t); +/*--------------------------- Forward Declarations ---------------------------*/ +static caddr_t xen_pv_parse_preload_data(u_int64_t); + +/*-------------------------------- Global Data -------------------------------*/ +/* Xen init_ops implementation. */ +struct init_ops xen_init_ops = { + .parse_preload_data = xen_pv_parse_preload_data, +}; + +/*-------------------------------- Xen PV init -------------------------------*/ /* * First function called by the Xen PVH boot sequence. * @@ -119,6 +132,56 @@ hammer_time_xen(start_info_t *si, uint64 } load_cr3(((uint64_t)&PT4[0]) - KERNBASE); + /* Set the hooks for early functions that diverge from bare metal */ + init_ops = xen_init_ops; + /* Now we can jump into the native init function */ return (hammer_time(0, physfree)); } + +/*-------------------------------- PV specific -------------------------------*/ +/* + * Functions to convert the "extra" parameters passed by Xen + * into FreeBSD boot options. + */ +static void +xen_pv_set_env(void) +{ + char *cmd_line_next, *cmd_line; + size_t env_size; + + cmd_line = HYPERVISOR_start_info->cmd_line; + env_size = sizeof(HYPERVISOR_start_info->cmd_line); + + /* Skip leading spaces */ + for (; isspace(*cmd_line) && (env_size != 0); cmd_line++) + env_size--; + + /* Replace ',' with '\0' */ + for (cmd_line_next = cmd_line; strsep(&cmd_line_next, ",") != NULL;) + ; + + init_static_kenv(cmd_line, env_size); +} + +static void +xen_pv_set_boothowto(void) +{ + int i; + + /* get equivalents from the environment */ + for (i = 0; howto_names[i].ev != NULL; i++) { + if (getenv(howto_names[i].ev) != NULL) + boothowto |= howto_names[i].mask; + } +} + +static caddr_t +xen_pv_parse_preload_data(u_int64_t modulep) +{ + /* Parse the extra boot information given by Xen */ + xen_pv_set_env(); + xen_pv_set_boothowto(); + + return (NULL); +} From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 10:16:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22C288F2; Tue, 11 Mar 2014 10:16:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0F4ECF1F; Tue, 11 Mar 2014 10:16:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BAGHEp019047; Tue, 11 Mar 2014 10:16:17 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BAGHxE019046; Tue, 11 Mar 2014 10:16:17 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201403111016.s2BAGHxE019046@svn.freebsd.org> From: Roger Pau Monné Date: Tue, 11 Mar 2014 10:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263007 - head/sys/dev/xen/timer X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 10:16:18 -0000 Author: royger Date: Tue Mar 11 10:16:17 2014 New Revision: 263007 URL: http://svnweb.freebsd.org/changeset/base/263007 Log: xen: rework xen timer so it can be used early in boot process This should not introduce any functional change, and makes the functions suitable to be called before we have actually mapped the vcpu_info struct on a per-cpu basis. Approved by: gibbs Sponsored by: Citrix Systems R&D dev/xen/timer/timer.c: - Remove citrical_{enter/exit}, the clock code will already be called with preemption disabled when needed. Add a comment to that regard in xentimer_get_timecount. - Allow xen_fetch_vcpu_time to be called with a specifc vcpu_info that will be used to fetch current time. - Assert that xentimer_et_start will always be called with preemption disabled. Modified: head/sys/dev/xen/timer/timer.c Modified: head/sys/dev/xen/timer/timer.c ============================================================================== --- head/sys/dev/xen/timer/timer.c Tue Mar 11 10:15:25 2014 (r263006) +++ head/sys/dev/xen/timer/timer.c Tue Mar 11 10:16:17 2014 (r263007) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -230,22 +231,22 @@ xen_fetch_vcpu_tinfo(struct vcpu_time_in /** * \brief Get the current time, in nanoseconds, since the hypervisor booted. * + * \param vcpu vcpu_info structure to fetch the time from. + * * \note This function returns the current CPU's idea of this value, unless * it happens to be less than another CPU's previously determined value. */ static uint64_t -xen_fetch_vcpu_time(void) +xen_fetch_vcpu_time(struct vcpu_info *vcpu) { struct vcpu_time_info dst; struct vcpu_time_info *src; uint32_t pre_version; uint64_t now; volatile uint64_t last; - struct vcpu_info *vcpu = DPCPU_GET(vcpu_info); src = &vcpu->time; - critical_enter(); do { pre_version = xen_fetch_vcpu_tinfo(&dst, src); barrier(); @@ -266,16 +267,24 @@ xen_fetch_vcpu_time(void) } } while (!atomic_cmpset_64(&xen_timer_last_time, last, now)); - critical_exit(); - return (now); } static uint32_t xentimer_get_timecount(struct timecounter *tc) { + uint64_t vcpu_time; + + /* + * We don't disable preemption here because the worst that can + * happen is reading the vcpu_info area of a different CPU than + * the one we are currently running on, but that would also + * return a valid tc (and we avoid the overhead of + * critical_{enter/exit} calls). + */ + vcpu_time = xen_fetch_vcpu_time(DPCPU_GET(vcpu_info)); - return ((uint32_t)xen_fetch_vcpu_time() & UINT_MAX); + return (vcpu_time & UINT32_MAX); } /** @@ -305,7 +314,10 @@ xen_fetch_wallclock(struct timespec *ts) static void xen_fetch_uptime(struct timespec *ts) { - uint64_t uptime = xen_fetch_vcpu_time(); + uint64_t uptime; + + uptime = xen_fetch_vcpu_time(DPCPU_GET(vcpu_info)); + ts->tv_sec = uptime / NSEC_IN_SEC; ts->tv_nsec = uptime % NSEC_IN_SEC; } @@ -354,7 +366,7 @@ xentimer_intr(void *arg) struct xentimer_softc *sc = (struct xentimer_softc *)arg; struct xentimer_pcpu_data *pcpu = DPCPU_PTR(xentimer_pcpu); - pcpu->last_processed = xen_fetch_vcpu_time(); + pcpu->last_processed = xen_fetch_vcpu_time(DPCPU_GET(vcpu_info)); if (pcpu->timer != 0 && sc->et.et_active) sc->et.et_event_cb(&sc->et, sc->et.et_arg); @@ -398,7 +410,14 @@ xentimer_et_start(struct eventtimer *et, struct xentimer_softc *sc = et->et_priv; int cpu = PCPU_GET(vcpu_id); struct xentimer_pcpu_data *pcpu = DPCPU_PTR(xentimer_pcpu); + struct vcpu_info *vcpu = DPCPU_GET(vcpu_info); uint64_t first_in_ns, next_time; +#ifdef INVARIANTS + struct thread *td = curthread; +#endif + + KASSERT(td->td_critnest != 0, + ("xentimer_et_start called without preemption disabled")); /* See sbttots() for this formula. */ first_in_ns = (((first >> 32) * NSEC_IN_SEC) + @@ -415,7 +434,7 @@ xentimer_et_start(struct eventtimer *et, do { if (++i == 60) panic("can't schedule timer"); - next_time = xen_fetch_vcpu_time() + first_in_ns; + next_time = xen_fetch_vcpu_time(vcpu) + first_in_ns; error = xentimer_vcpu_start_timer(cpu, next_time); } while (error == -ETIME); From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 10:20:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3352A94; Tue, 11 Mar 2014 10:20:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC8B1F4E; Tue, 11 Mar 2014 10:20:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BAKjRa022107; Tue, 11 Mar 2014 10:20:45 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BAKgFU022089; Tue, 11 Mar 2014 10:20:42 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201403111020.s2BAKgFU022089@svn.freebsd.org> From: Roger Pau Monné Date: Tue, 11 Mar 2014 10:20:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263008 - in head/sys: amd64/amd64 amd64/include conf dev/xen/timer i386/i386 i386/include i386/xen pc98/pc98 x86/include x86/isa x86/x86 x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 10:20:45 -0000 Author: royger Date: Tue Mar 11 10:20:42 2014 New Revision: 263008 URL: http://svnweb.freebsd.org/changeset/base/263008 Log: xen: implement an early timer for Xen PVH When running as a PVH guest, there's no emulated i8254, so we need to use the Xen PV timer as the early source for DELAY. This change allows for different implementations of the early DELAY function and implements a Xen variant for it. Approved by: gibbs Sponsored by: Citrix Systems R&D dev/xen/timer/timer.c: dev/xen/timer/timer.h: - Implement Xen early delay functions using the PV timer and declare them. x86/include/init.h: - Add hooks for early clock source initialization and early delay functions. i386/i386/machdep.c: pc98/pc98/machdep.c: amd64/amd64/machdep.c: - Set early delay hooks to use the i8254 on bare metal. - Use clock_init (that will in turn make use of init_ops) to initialize the early clock source. amd64/include/clock.h: i386/include/clock.h: - Declare i8254_delay and clock_init. i386/xen/clock.c: - Rename DELAY to i8254_delay. x86/isa/clock.c: - Introduce clock_init that will take care of initializing the early clock by making use of the init_ops hooks. - Move non ISA related delay functions to the newly introduced delay file. x86/x86/delay.c: - Add moved delay related functions. - Implement generic DELAY function that will use the init_ops hooks. x86/xen/pv.c: - Set PVH hooks for the early delay related functions in init_ops. conf/files.amd64: conf/files.i386: conf/files.pc98: - Add delay.c to the kernel build. Added: head/sys/dev/xen/timer/timer.h (contents, props changed) head/sys/x86/x86/delay.c (contents, props changed) Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/include/clock.h head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 head/sys/dev/xen/timer/timer.c head/sys/i386/i386/machdep.c head/sys/i386/include/clock.h head/sys/i386/xen/clock.c head/sys/pc98/pc98/machdep.c head/sys/x86/include/init.h head/sys/x86/isa/clock.c head/sys/x86/xen/pv.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Mar 11 10:16:17 2014 (r263007) +++ head/sys/amd64/amd64/machdep.c Tue Mar 11 10:20:42 2014 (r263008) @@ -172,6 +172,8 @@ static caddr_t native_parse_preload_data /* Default init_ops implementation. */ struct init_ops init_ops = { .parse_preload_data = native_parse_preload_data, + .early_clock_source_init = i8254_init, + .early_delay = i8254_delay, }; /* @@ -1822,10 +1824,10 @@ hammer_time(u_int64_t modulep, u_int64_t lidt(&r_idt); /* - * Initialize the i8254 before the console so that console + * Initialize the clock before the console so that console * initialization can use DELAY(). */ - i8254_init(); + clock_init(); /* * Initialize the console before we print anything out. Modified: head/sys/amd64/include/clock.h ============================================================================== --- head/sys/amd64/include/clock.h Tue Mar 11 10:16:17 2014 (r263007) +++ head/sys/amd64/include/clock.h Tue Mar 11 10:20:42 2014 (r263008) @@ -25,6 +25,8 @@ extern int smp_tsc; #endif void i8254_init(void); +void i8254_delay(int); +void clock_init(void); /* * Driver to clock driver interface. Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Mar 11 10:16:17 2014 (r263007) +++ head/sys/conf/files.amd64 Tue Mar 11 10:20:42 2014 (r263008) @@ -554,6 +554,7 @@ x86/x86/mptable_pci.c optional mptable x86/x86/msi.c optional pci x86/x86/nexus.c standard x86/x86/tsc.c standard +x86/x86/delay.c standard x86/xen/hvm.c optional xenhvm x86/xen/xen_intr.c optional xen | xenhvm x86/xen/pv.c optional xenhvm Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Mar 11 10:16:17 2014 (r263007) +++ head/sys/conf/files.i386 Tue Mar 11 10:20:42 2014 (r263008) @@ -593,5 +593,6 @@ x86/x86/mptable_pci.c optional apic nat x86/x86/msi.c optional apic pci x86/x86/nexus.c standard x86/x86/tsc.c standard +x86/x86/delay.c standard x86/xen/hvm.c optional xenhvm x86/xen/xen_intr.c optional xen | xenhvm Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Tue Mar 11 10:16:17 2014 (r263007) +++ head/sys/conf/files.pc98 Tue Mar 11 10:20:42 2014 (r263008) @@ -259,3 +259,5 @@ x86/x86/mptable_pci.c optional apic pci x86/x86/msi.c optional apic pci x86/x86/nexus.c standard x86/x86/tsc.c standard +x86/x86/tsc.c standard +x86/x86/delay.c standard Modified: head/sys/dev/xen/timer/timer.c ============================================================================== --- head/sys/dev/xen/timer/timer.c Tue Mar 11 10:16:17 2014 (r263007) +++ head/sys/dev/xen/timer/timer.c Tue Mar 11 10:20:42 2014 (r263008) @@ -60,6 +60,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "clock_if.h" static devclass_t xentimer_devclass; @@ -592,6 +594,38 @@ xentimer_suspend(device_t dev) return (0); } +/* + * Xen early clock init + */ +void +xen_clock_init(void) +{ +} + +/* + * Xen PV DELAY function + * + * When running on PVH mode we don't have an emulated i8524, so + * make use of the Xen time info in order to code a simple DELAY + * function that can be used during early boot. + */ +void +xen_delay(int n) +{ + struct vcpu_info *vcpu = &HYPERVISOR_shared_info->vcpu_info[0]; + uint64_t end_ns; + uint64_t current; + + end_ns = xen_fetch_vcpu_time(vcpu); + end_ns += n * NSEC_IN_USEC; + + for (;;) { + current = xen_fetch_vcpu_time(vcpu); + if (current >= end_ns) + break; + } +} + static device_method_t xentimer_methods[] = { DEVMETHOD(device_identify, xentimer_identify), DEVMETHOD(device_probe, xentimer_probe), Added: head/sys/dev/xen/timer/timer.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/xen/timer/timer.h Tue Mar 11 10:20:42 2014 (r263008) @@ -0,0 +1,35 @@ +/*- + * Copyright (c) 2013 Roger Pau Monné + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _XEN_TIMER_H_ +#define _XEN_TIMER_H_ + +void xen_clock_init(void); +void xen_delay(int); + +#endif /* _XEN_TIMER_H_ */ Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Mar 11 10:16:17 2014 (r263007) +++ head/sys/i386/i386/machdep.c Tue Mar 11 10:20:42 2014 (r263008) @@ -132,6 +132,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef PERFMON #include #endif @@ -253,6 +254,12 @@ struct mtx icu_lock; struct mem_range_softc mem_range_softc; + /* Default init_ops implementation. */ + struct init_ops init_ops = { + .early_clock_source_init = i8254_init, + .early_delay = i8254_delay, + }; + static void cpu_startup(dummy) void *dummy; @@ -2977,10 +2984,10 @@ init386(first) #endif /* XBOX */ /* - * Initialize the i8254 before the console so that console + * Initialize the clock before the console so that console * initialization can use DELAY(). */ - i8254_init(); + clock_init(); /* * Initialize the console before we print anything out. Modified: head/sys/i386/include/clock.h ============================================================================== --- head/sys/i386/include/clock.h Tue Mar 11 10:16:17 2014 (r263007) +++ head/sys/i386/include/clock.h Tue Mar 11 10:20:42 2014 (r263008) @@ -22,6 +22,8 @@ extern int tsc_is_invariant; extern int tsc_perf_stat; void i8254_init(void); +void i8254_delay(int); +void clock_init(void); /* * Driver to clock driver interface. Modified: head/sys/i386/xen/clock.c ============================================================================== --- head/sys/i386/xen/clock.c Tue Mar 11 10:16:17 2014 (r263007) +++ head/sys/i386/xen/clock.c Tue Mar 11 10:20:42 2014 (r263008) @@ -192,7 +192,7 @@ i8254_init(void) * Note: timer had better have been programmed before this is first used! */ void -DELAY(int n) +i8254_delay(int n) { int delta, ticks_left; uint32_t tick, prev_tick; Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Tue Mar 11 10:16:17 2014 (r263007) +++ head/sys/pc98/pc98/machdep.c Tue Mar 11 10:20:42 2014 (r263008) @@ -129,6 +129,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef PERFMON #include #endif @@ -220,6 +221,12 @@ struct mtx icu_lock; struct mem_range_softc mem_range_softc; + /* Default init_ops implementation. */ + struct init_ops init_ops = { + .early_clock_source_init = i8254_init, + .early_delay = i8254_delay, + }; + static void cpu_startup(dummy) void *dummy; @@ -2267,7 +2274,7 @@ init386(first) * Initialize the i8254 before the console so that console * initialization can use DELAY(). */ - i8254_init(); + clock_init(); /* * Initialize the console before we print anything out. Modified: head/sys/x86/include/init.h ============================================================================== --- head/sys/x86/include/init.h Tue Mar 11 10:16:17 2014 (r263007) +++ head/sys/x86/include/init.h Tue Mar 11 10:20:42 2014 (r263008) @@ -36,6 +36,8 @@ */ struct init_ops { caddr_t (*parse_preload_data)(u_int64_t); + void (*early_clock_source_init)(void); + void (*early_delay)(int); }; extern struct init_ops init_ops; Modified: head/sys/x86/isa/clock.c ============================================================================== --- head/sys/x86/isa/clock.c Tue Mar 11 10:16:17 2014 (r263007) +++ head/sys/x86/isa/clock.c Tue Mar 11 10:20:42 2014 (r263008) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef PC98 #include @@ -139,6 +140,15 @@ static u_char timer2_state; static unsigned i8254_get_timecount(struct timecounter *tc); static void set_i8254_freq(int mode, uint32_t period); +void +clock_init(void) +{ + /* Init the clock lock */ + mtx_init(&clock_lock, "clk", NULL, MTX_SPIN | MTX_NOPROFILE); + /* Init the clock in order to use DELAY */ + init_ops.early_clock_source_init(); +} + static int clkintr(void *arg) { @@ -247,61 +257,13 @@ getit(void) return ((high << 8) | low); } -#ifndef DELAYDEBUG -static u_int -get_tsc(__unused struct timecounter *tc) -{ - - return (rdtsc32()); -} - -static __inline int -delay_tc(int n) -{ - struct timecounter *tc; - timecounter_get_t *func; - uint64_t end, freq, now; - u_int last, mask, u; - - tc = timecounter; - freq = atomic_load_acq_64(&tsc_freq); - if (tsc_is_invariant && freq != 0) { - func = get_tsc; - mask = ~0u; - } else { - if (tc->tc_quality <= 0) - return (0); - func = tc->tc_get_timecount; - mask = tc->tc_counter_mask; - freq = tc->tc_frequency; - } - now = 0; - end = freq * n / 1000000; - if (func == get_tsc) - sched_pin(); - last = func(tc) & mask; - do { - cpu_spinwait(); - u = func(tc) & mask; - if (u < last) - now += mask - last + u + 1; - else - now += u - last; - last = u; - } while (now < end); - if (func == get_tsc) - sched_unpin(); - return (1); -} -#endif - /* * Wait "n" microseconds. * Relies on timer 1 counting down from (i8254_freq / hz) * Note: timer had better have been programmed before this is first used! */ void -DELAY(int n) +i8254_delay(int n) { int delta, prev_tick, tick, ticks_left; #ifdef DELAYDEBUG @@ -317,9 +279,6 @@ DELAY(int n) } if (state == 1) printf("DELAY(%d)...", n); -#else - if (delay_tc(n)) - return; #endif /* * Read the counter first, so that the rest of the setup overhead is @@ -499,7 +458,6 @@ void i8254_init(void) { - mtx_init(&clock_lock, "clk", NULL, MTX_SPIN | MTX_NOPROFILE); #ifdef PC98 if (pc98_machine_type & M_8M) i8254_freq = 1996800L; /* 1.9968 MHz */ Added: head/sys/x86/x86/delay.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/x86/delay.c Tue Mar 11 10:20:42 2014 (r263008) @@ -0,0 +1,106 @@ +/*- + * Copyright (c) 1990 The Regents of the University of California. + * Copyright (c) 2010 Alexander Motin + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * William Jolitz and Don Ahn. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 + */ + +#include +__FBSDID("$FreeBSD$"); + +/* Generic x86 routines to handle delay */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +static u_int +get_tsc(__unused struct timecounter *tc) +{ + + return (rdtsc32()); +} + +static int +delay_tc(int n) +{ + struct timecounter *tc; + timecounter_get_t *func; + uint64_t end, freq, now; + u_int last, mask, u; + + tc = timecounter; + freq = atomic_load_acq_64(&tsc_freq); + if (tsc_is_invariant && freq != 0) { + func = get_tsc; + mask = ~0u; + } else { + if (tc->tc_quality <= 0) + return (0); + func = tc->tc_get_timecount; + mask = tc->tc_counter_mask; + freq = tc->tc_frequency; + } + now = 0; + end = freq * n / 1000000; + if (func == get_tsc) + sched_pin(); + last = func(tc) & mask; + do { + cpu_spinwait(); + u = func(tc) & mask; + if (u < last) + now += mask - last + u + 1; + else + now += u - last; + last = u; + } while (now < end); + if (func == get_tsc) + sched_unpin(); + return (1); +} + +void +DELAY(int n) +{ + + if (delay_tc(n)) + return; + + init_ops.early_delay(n); +} Modified: head/sys/x86/xen/pv.c ============================================================================== --- head/sys/x86/xen/pv.c Tue Mar 11 10:16:17 2014 (r263007) +++ head/sys/x86/xen/pv.c Tue Mar 11 10:20:42 2014 (r263008) @@ -53,6 +53,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + /* Native initial function */ extern u_int64_t hammer_time(u_int64_t, u_int64_t); /* Xen initial function */ @@ -65,6 +67,8 @@ static caddr_t xen_pv_parse_preload_data /* Xen init_ops implementation. */ struct init_ops xen_init_ops = { .parse_preload_data = xen_pv_parse_preload_data, + .early_clock_source_init = xen_clock_init, + .early_delay = xen_delay, }; /*-------------------------------- Xen PV init -------------------------------*/ From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 10:23:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FB9BC58; Tue, 11 Mar 2014 10:23:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5B347FEE; Tue, 11 Mar 2014 10:23:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BAN4Tm022772; Tue, 11 Mar 2014 10:23:04 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BAN3px022768; Tue, 11 Mar 2014 10:23:03 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201403111023.s2BAN3px022768@svn.freebsd.org> From: Roger Pau Monné Date: Tue, 11 Mar 2014 10:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263009 - in head/sys: amd64/amd64 amd64/include/pc x86/include x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 10:23:04 -0000 Author: royger Date: Tue Mar 11 10:23:03 2014 New Revision: 263009 URL: http://svnweb.freebsd.org/changeset/base/263009 Log: xen: implement hook to fetch and parse e820 memory map e820 memory map is fetched using a hypercall under Xen PVH, so add a hook to init_ops in oder to diverge from bare metal and implement a Xen variant. Approved by: gibbs Sponsored by: Citrix Systems R&D x86/include/init.h: - Add a parse_memmap hook to init_ops, that will be called to fetch and parse the memory map. amd64/amd64/machdep.c: - Decouple the fetch and the parse of the memmap, so the parse function can be shared with Xen code. - Move code around in order to implement the parse_memmap hook. amd64/include/pc/bios.h: - Declare bios_add_smap_entries (implemented in machdep.c). x86/xen/pv.c: - Implement fetching of e820 memmap when running as a PVH guest by using the XENMEM_memory_map hypercall. Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/include/pc/bios.h head/sys/x86/include/init.h head/sys/x86/xen/pv.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Mar 11 10:20:42 2014 (r263008) +++ head/sys/amd64/amd64/machdep.c Tue Mar 11 10:23:03 2014 (r263009) @@ -169,11 +169,15 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, /* Preload data parse function */ static caddr_t native_parse_preload_data(u_int64_t); +/* Native function to fetch and parse the e820 map */ +static void native_parse_memmap(caddr_t, vm_paddr_t *, int *); + /* Default init_ops implementation. */ struct init_ops init_ops = { .parse_preload_data = native_parse_preload_data, .early_clock_source_init = i8254_init, .early_delay = i8254_delay, + .parse_memmap = native_parse_memmap, }; /* @@ -1403,21 +1407,12 @@ add_physmap_entry(uint64_t base, uint64_ return (1); } -static void -add_smap_entries(struct bios_smap *smapbase, vm_paddr_t *physmap, - int *physmap_idx) +void +bios_add_smap_entries(struct bios_smap *smapbase, u_int32_t smapsize, + vm_paddr_t *physmap, int *physmap_idx) { struct bios_smap *smap, *smapend; - u_int32_t smapsize; - /* - * Memory map from INT 15:E820. - * - * subr_module.c says: - * "Consumer may safely assume that size value precedes data." - * ie: an int32_t immediately precedes smap. - */ - smapsize = *((u_int32_t *)smapbase - 1); smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize); for (smap = smapbase; smap < smapend; smap++) { @@ -1434,6 +1429,29 @@ add_smap_entries(struct bios_smap *smapb } } +static void +native_parse_memmap(caddr_t kmdp, vm_paddr_t *physmap, int *physmap_idx) +{ + struct bios_smap *smap; + u_int32_t size; + + /* + * Memory map from INT 15:E820. + * + * subr_module.c says: + * "Consumer may safely assume that size value precedes data." + * ie: an int32_t immediately precedes smap. + */ + + smap = (struct bios_smap *)preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_SMAP); + if (smap == NULL) + panic("No BIOS smap info from loader!"); + size = *((u_int32_t *)smap - 1); + + bios_add_smap_entries(smap, size, physmap, physmap_idx); +} + /* * Populate the (physmap) array with base/bound pairs describing the * available physical memory in the system, then test this memory and @@ -1451,19 +1469,13 @@ getmemsize(caddr_t kmdp, u_int64_t first vm_paddr_t pa, physmap[PHYSMAP_SIZE]; u_long physmem_start, physmem_tunable, memtest; pt_entry_t *pte; - struct bios_smap *smapbase; quad_t dcons_addr, dcons_size; bzero(physmap, sizeof(physmap)); basemem = 0; physmap_idx = 0; - smapbase = (struct bios_smap *)preload_search_info(kmdp, - MODINFO_METADATA | MODINFOMD_SMAP); - if (smapbase == NULL) - panic("No BIOS smap info from loader!"); - - add_smap_entries(smapbase, physmap, &physmap_idx); + init_ops.parse_memmap(kmdp, physmap, &physmap_idx); /* * Find the 'base memory' segment for SMP Modified: head/sys/amd64/include/pc/bios.h ============================================================================== --- head/sys/amd64/include/pc/bios.h Tue Mar 11 10:20:42 2014 (r263008) +++ head/sys/amd64/include/pc/bios.h Tue Mar 11 10:23:03 2014 (r263009) @@ -106,6 +106,8 @@ struct bios_oem { int bios_oem_strings(struct bios_oem *oem, u_char *buffer, size_t maxlen); uint32_t bios_sigsearch(uint32_t start, u_char *sig, int siglen, int paralen, int sigofs); +void bios_add_smap_entries(struct bios_smap *smapbase, u_int32_t smapsize, + vm_paddr_t *physmap, int *physmap_idx); #endif #endif /* _MACHINE_PC_BIOS_H_ */ Modified: head/sys/x86/include/init.h ============================================================================== --- head/sys/x86/include/init.h Tue Mar 11 10:20:42 2014 (r263008) +++ head/sys/x86/include/init.h Tue Mar 11 10:23:03 2014 (r263009) @@ -38,6 +38,7 @@ struct init_ops { caddr_t (*parse_preload_data)(u_int64_t); void (*early_clock_source_init)(void); void (*early_delay)(int); + void (*parse_memmap)(caddr_t, vm_paddr_t *, int *); }; extern struct init_ops init_ops; Modified: head/sys/x86/xen/pv.c ============================================================================== --- head/sys/x86/xen/pv.c Tue Mar 11 10:20:42 2014 (r263008) +++ head/sys/x86/xen/pv.c Tue Mar 11 10:23:03 2014 (r263009) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -60,8 +61,11 @@ extern u_int64_t hammer_time(u_int64_t, /* Xen initial function */ uint64_t hammer_time_xen(start_info_t *, uint64_t); +#define MAX_E820_ENTRIES 128 + /*--------------------------- Forward Declarations ---------------------------*/ static caddr_t xen_pv_parse_preload_data(u_int64_t); +static void xen_pv_parse_memmap(caddr_t, vm_paddr_t *, int *); /*-------------------------------- Global Data -------------------------------*/ /* Xen init_ops implementation. */ @@ -69,8 +73,11 @@ struct init_ops xen_init_ops = { .parse_preload_data = xen_pv_parse_preload_data, .early_clock_source_init = xen_clock_init, .early_delay = xen_delay, + .parse_memmap = xen_pv_parse_memmap, }; +static struct bios_smap xen_smap[MAX_E820_ENTRIES]; + /*-------------------------------- Xen PV init -------------------------------*/ /* * First function called by the Xen PVH boot sequence. @@ -189,3 +196,21 @@ xen_pv_parse_preload_data(u_int64_t modu return (NULL); } + +static void +xen_pv_parse_memmap(caddr_t kmdp, vm_paddr_t *physmap, int *physmap_idx) +{ + struct xen_memory_map memmap; + u_int32_t size; + int rc; + + /* Fetch the E820 map from Xen */ + memmap.nr_entries = MAX_E820_ENTRIES; + set_xen_guest_handle(memmap.buffer, xen_smap); + rc = HYPERVISOR_memory_op(XENMEM_memory_map, &memmap); + if (rc) + panic("unable to fetch Xen E820 memory map"); + size = memmap.nr_entries * sizeof(xen_smap[0]); + + bios_add_smap_entries(xen_smap, size, physmap, physmap_idx); +} From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 10:24:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1001DAB; Tue, 11 Mar 2014 10:24:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9101FFFE; Tue, 11 Mar 2014 10:24:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BAOENN022933; Tue, 11 Mar 2014 10:24:14 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BAOD2c022929; Tue, 11 Mar 2014 10:24:13 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201403111024.s2BAOD2c022929@svn.freebsd.org> From: Roger Pau Monné Date: Tue, 11 Mar 2014 10:24:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263010 - in head/sys: amd64/include/xen i386/i386 i386/include/xen x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 10:24:14 -0000 Author: royger Date: Tue Mar 11 10:24:13 2014 New Revision: 263010 URL: http://svnweb.freebsd.org/changeset/base/263010 Log: xen: use the same hypercall mechanism for XEN and XENHVM Currently XEN (PV) and XENHVM (PVHVM) ports use different ways to issue hypercalls, unify this by filling the hypercall_page under HVM also. Approved by: gibbs Sponsored by: Citrix Systems R&D amd64/include/xen/hypercall.h: - Unify Xen hypercall code by always using the PV way. i386/i386/locore.s: - Define hypercall_page on i386 XENHVM. x86/xen/hvm.c: - Fill hypercall_page on XENHVM kernels using the HVM method (only when running as an HVM guest). Modified: head/sys/amd64/include/xen/hypercall.h head/sys/i386/i386/locore.s head/sys/i386/include/xen/hypercall.h head/sys/x86/xen/hvm.c Modified: head/sys/amd64/include/xen/hypercall.h ============================================================================== --- head/sys/amd64/include/xen/hypercall.h Tue Mar 11 10:23:03 2014 (r263009) +++ head/sys/amd64/include/xen/hypercall.h Tue Mar 11 10:24:13 2014 (r263010) @@ -51,15 +51,8 @@ #define CONFIG_XEN_COMPAT 0x030002 #define __must_check -#ifdef XEN #define HYPERCALL_STR(name) \ "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)" -#else -#define HYPERCALL_STR(name) \ - "mov $("STR(__HYPERVISOR_##name)" * 32),%%eax; "\ - "add hypercall_stubs(%%rip),%%rax; " \ - "call *%%rax" -#endif #define _hypercall0(type, name) \ ({ \ Modified: head/sys/i386/i386/locore.s ============================================================================== --- head/sys/i386/i386/locore.s Tue Mar 11 10:23:03 2014 (r263009) +++ head/sys/i386/i386/locore.s Tue Mar 11 10:24:13 2014 (r263010) @@ -898,3 +898,12 @@ done_pde: #endif ret + +#ifdef XENHVM +/* Xen Hypercall page */ + .text +.p2align PAGE_SHIFT, 0x90 /* Hypercall_page needs to be PAGE aligned */ + +NON_GPROF_ENTRY(hypercall_page) + .skip 0x1000, 0x90 /* Fill with "nop"s */ +#endif Modified: head/sys/i386/include/xen/hypercall.h ============================================================================== --- head/sys/i386/include/xen/hypercall.h Tue Mar 11 10:23:03 2014 (r263009) +++ head/sys/i386/include/xen/hypercall.h Tue Mar 11 10:24:13 2014 (r263010) @@ -39,16 +39,8 @@ #define ENOXENSYS 38 #define CONFIG_XEN_COMPAT 0x030002 - -#if defined(XEN) #define HYPERCALL_STR(name) \ "call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)" -#else -#define HYPERCALL_STR(name) \ - "mov hypercall_stubs,%%eax; " \ - "add $("STR(__HYPERVISOR_##name)" * 32),%%eax; " \ - "call *%%eax" -#endif #define _hypercall0(type, name) \ ({ \ Modified: head/sys/x86/xen/hvm.c ============================================================================== --- head/sys/x86/xen/hvm.c Tue Mar 11 10:23:03 2014 (r263009) +++ head/sys/x86/xen/hvm.c Tue Mar 11 10:24:13 2014 (r263010) @@ -147,7 +147,7 @@ DPCPU_DEFINE(xen_intr_handle_t, ipi_hand /*------------------ Hypervisor Access Shared Memory Regions -----------------*/ /** Hypercall table accessed via HYPERVISOR_*_op() methods. */ -char *hypercall_stubs; +extern char *hypercall_page; shared_info_t *HYPERVISOR_shared_info; start_info_t *HYPERVISOR_start_info; @@ -386,16 +386,21 @@ xen_hvm_cpuid_base(void) * Allocate and fill in the hypcall page. */ static int -xen_hvm_init_hypercall_stubs(void) +xen_hvm_init_hypercall_stubs(enum xen_hvm_init_type init_type) { uint32_t base, regs[4]; int i; + if (xen_pv_domain()) { + /* hypercall page is already set in the PV case */ + return (0); + } + base = xen_hvm_cpuid_base(); if (base == 0) return (ENXIO); - if (hypercall_stubs == NULL) { + if (init_type == XEN_HVM_INIT_COLD) { do_cpuid(base + 1, regs); printf("XEN: Hypervisor version %d.%d detected.\n", regs[0] >> 16, regs[0] & 0xffff); @@ -405,18 +410,9 @@ xen_hvm_init_hypercall_stubs(void) * Find the hypercall pages. */ do_cpuid(base + 2, regs); - - if (hypercall_stubs == NULL) { - size_t call_region_size; - - call_region_size = regs[0] * PAGE_SIZE; - hypercall_stubs = malloc(call_region_size, M_XENHVM, M_NOWAIT); - if (hypercall_stubs == NULL) - panic("Unable to allocate Xen hypercall region"); - } for (i = 0; i < regs[0]; i++) - wrmsr(regs[1], vtophys(hypercall_stubs + i * PAGE_SIZE) + i); + wrmsr(regs[1], vtophys(&hypercall_page + i * PAGE_SIZE) + i); return (0); } @@ -519,7 +515,7 @@ xen_hvm_init(enum xen_hvm_init_type init if (init_type == XEN_HVM_INIT_CANCELLED_SUSPEND) return; - error = xen_hvm_init_hypercall_stubs(); + error = xen_hvm_init_hypercall_stubs(init_type); switch (init_type) { case XEN_HVM_INIT_COLD: From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 10:25:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B604EF06; Tue, 11 Mar 2014 10:25:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A2DB861; Tue, 11 Mar 2014 10:25:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BAP9qs023091; Tue, 11 Mar 2014 10:25:09 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BAP9oS023089; Tue, 11 Mar 2014 10:25:09 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201403111025.s2BAP9oS023089@svn.freebsd.org> From: Roger Pau Monné Date: Tue, 11 Mar 2014 10:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263011 - in head/sys: conf x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 10:25:09 -0000 Author: royger Date: Tue Mar 11 10:25:08 2014 New Revision: 263011 URL: http://svnweb.freebsd.org/changeset/base/263011 Log: xen: add an apic_enumerator for PVH On PVH there's no ACPI, so the CPU enumeration must be implemented using Xen hypercalls. Approved by: gibbs Sponsored by: Citrix Systems R&D x86/xen/pvcpu_enum.c: - Enumerate avaiable vCPUs on PVH by using the VCPUOP_is_up hypercall. - Set vcpu_id for PVH guests. conf/files.amd64: - Include the PV CPU enumerator in the XENHVM build. Added: head/sys/x86/xen/pvcpu_enum.c (contents, props changed) Modified: head/sys/conf/files.amd64 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Mar 11 10:24:13 2014 (r263010) +++ head/sys/conf/files.amd64 Tue Mar 11 10:25:08 2014 (r263011) @@ -558,3 +558,4 @@ x86/x86/delay.c standard x86/xen/hvm.c optional xenhvm x86/xen/xen_intr.c optional xen | xenhvm x86/xen/pv.c optional xenhvm +x86/xen/pvcpu_enum.c optional xenhvm Added: head/sys/x86/xen/pvcpu_enum.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/xen/pvcpu_enum.c Tue Mar 11 10:25:08 2014 (r263011) @@ -0,0 +1,134 @@ +/*- + * Copyright (c) 2003 John Baldwin + * Copyright (c) 2013 Roger Pau Monné + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include + +static int xenpv_probe(void); +static int xenpv_probe_cpus(void); +static int xenpv_setup_local(void); +static int xenpv_setup_io(void); + +static struct apic_enumerator xenpv_enumerator = { + "Xen PV", + xenpv_probe, + xenpv_probe_cpus, + xenpv_setup_local, + xenpv_setup_io +}; + +/* + * This enumerator will only be registered on PVH + */ +static int +xenpv_probe(void) +{ + return (-100); +} + +/* + * Test each possible vCPU in order to find the number of vCPUs + */ +static int +xenpv_probe_cpus(void) +{ +#ifdef SMP + int i, ret; + + for (i = 0; i < MAXCPU; i++) { + ret = HYPERVISOR_vcpu_op(VCPUOP_is_up, i, NULL); + if (ret >= 0) + lapic_create((i * 2), (i == 0)); + } +#endif + return (0); +} + +/* + * Initialize the vCPU id of the BSP + */ +static int +xenpv_setup_local(void) +{ + PCPU_SET(vcpu_id, 0); + lapic_init(0); + return (0); +} + +/* + * On PVH guests there's no IO APIC + */ +static int +xenpv_setup_io(void) +{ + return (0); +} + +static void +xenpv_register(void *dummy __unused) +{ + if (xen_pv_domain()) { + apic_register_enumerator(&xenpv_enumerator); + } +} +SYSINIT(xenpv_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST, xenpv_register, NULL); + +/* + * Setup per-CPU vCPU IDs + */ +static void +xenpv_set_ids(void *dummy) +{ + struct pcpu *pc; + int i; + + CPU_FOREACH(i) { + pc = pcpu_find(i); + pc->pc_vcpu_id = i; + } +} +SYSINIT(xenpv_set_ids, SI_SUB_CPU, SI_ORDER_MIDDLE, xenpv_set_ids, NULL); From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 10:26:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6CC7E2; Tue, 11 Mar 2014 10:26:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BADD26E; Tue, 11 Mar 2014 10:26:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BAQGE0023250; Tue, 11 Mar 2014 10:26:16 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BAQGDn023248; Tue, 11 Mar 2014 10:26:16 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201403111026.s2BAQGDn023248@svn.freebsd.org> From: Roger Pau Monné Date: Tue, 11 Mar 2014 10:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263012 - in head/sys: amd64/amd64 x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 10:26:17 -0000 Author: royger Date: Tue Mar 11 10:26:16 2014 New Revision: 263012 URL: http://svnweb.freebsd.org/changeset/base/263012 Log: xen: add hook for AP bootstrap memory reservation This hook will only be implemented for bare metal, Xen doesn't require any bootstrap code since APs are started in long mode with paging enabled. Approved by: gibbs Sponsored by: Citrix Systems R&D amd64/amd64/machdep.c: - Set mp_bootaddress hook for bare metal. x86/include/init.h: - Define mp_bootaddress in init_ops. Modified: head/sys/amd64/amd64/machdep.c head/sys/x86/include/init.h Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Mar 11 10:25:08 2014 (r263011) +++ head/sys/amd64/amd64/machdep.c Tue Mar 11 10:26:16 2014 (r263012) @@ -178,6 +178,9 @@ struct init_ops init_ops = { .early_clock_source_init = i8254_init, .early_delay = i8254_delay, .parse_memmap = native_parse_memmap, +#ifdef SMP + .mp_bootaddress = mp_bootaddress, +#endif }; /* @@ -1490,10 +1493,14 @@ getmemsize(caddr_t kmdp, u_int64_t first if (basemem == 0) panic("BIOS smap did not include a basemem segment!"); -#ifdef SMP - /* make hole for AP bootstrap code */ - physmap[1] = mp_bootaddress(physmap[1] / 1024); -#endif + /* + * Make hole for "AP -> long mode" bootstrap code. The + * mp_bootaddress vector is only available when the kernel + * is configured to support APs and APs for the system start + * in 32bit mode (e.g. SMP bare metal). + */ + if (init_ops.mp_bootaddress) + physmap[1] = init_ops.mp_bootaddress(physmap[1] / 1024); /* * Maxmem isn't the "maximum memory", it's one larger than the Modified: head/sys/x86/include/init.h ============================================================================== --- head/sys/x86/include/init.h Tue Mar 11 10:25:08 2014 (r263011) +++ head/sys/x86/include/init.h Tue Mar 11 10:26:16 2014 (r263012) @@ -39,6 +39,7 @@ struct init_ops { void (*early_clock_source_init)(void); void (*early_delay)(int); void (*parse_memmap)(caddr_t, vm_paddr_t *, int *); + u_int (*mp_bootaddress)(u_int); }; extern struct init_ops init_ops; From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 10:26:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82CA1221; Tue, 11 Mar 2014 10:26:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6F9DC7C; Tue, 11 Mar 2014 10:26:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BAQsj4023395; Tue, 11 Mar 2014 10:26:54 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BAQsq3023394; Tue, 11 Mar 2014 10:26:54 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201403111026.s2BAQsq3023394@svn.freebsd.org> From: Roger Pau Monné Date: Tue, 11 Mar 2014 10:26:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263013 - head/sys/x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 10:26:54 -0000 Author: royger Date: Tue Mar 11 10:26:53 2014 New Revision: 263013 URL: http://svnweb.freebsd.org/changeset/base/263013 Log: xen: changes to hvm code in order to support PVH guests On PVH we don't need to init the shared info page, or disable emulated devices. Also, make sure PV IPIs are set before starting the APs. Approved by: gibbs Sponsored by: Citrix Systems R&D x86/xen/hvm.c: - Return early from functions that are no-ops on Xen PVH guests. - In order to make sure PV IPIs are setup before AP startup, initialize them in SI_SUB_SMP-1. Modified: head/sys/x86/xen/hvm.c Modified: head/sys/x86/xen/hvm.c ============================================================================== --- head/sys/x86/xen/hvm.c Tue Mar 11 10:26:16 2014 (r263012) +++ head/sys/x86/xen/hvm.c Tue Mar 11 10:26:53 2014 (r263013) @@ -350,7 +350,7 @@ xen_setup_cpus(void) { int i; - if (!xen_hvm_domain() || !xen_vector_callback_enabled) + if (!xen_vector_callback_enabled) return; #ifdef __amd64__ @@ -422,6 +422,14 @@ xen_hvm_init_shared_info_page(void) { struct xen_add_to_physmap xatp; + if (xen_pv_domain()) { + /* + * Already setup in the PV case, shared_info is passed inside + * of the start_info struct at start of day. + */ + return; + } + if (HYPERVISOR_shared_info == NULL) { HYPERVISOR_shared_info = malloc(PAGE_SIZE, M_XENHVM, M_NOWAIT); if (HYPERVISOR_shared_info == NULL) @@ -498,6 +506,15 @@ enum { static void xen_hvm_disable_emulated_devices(void) { + + if (xen_pv_domain()) { + /* + * No emulated devices in the PV case, so no need to unplug + * anything. + */ + return; + } + if (inw(XEN_MAGIC_IOPORT) != XMI_MAGIC) return; @@ -522,9 +539,19 @@ xen_hvm_init(enum xen_hvm_init_type init if (error != 0) return; + /* + * If xen_domain_type is not set at this point + * it means we are inside a (PV)HVM guest, because + * for PVH the guest type is set much earlier + * (see hammer_time_xen). + */ + if (!xen_domain()) { + xen_domain_type = XEN_HVM_DOMAIN; + vm_guest = VM_GUEST_XEN; + } + setup_xen_features(); cpu_ops = xen_hvm_cpu_ops; - vm_guest = VM_GUEST_XEN; break; case XEN_HVM_INIT_RESUME: if (error != 0) @@ -539,9 +566,15 @@ xen_hvm_init(enum xen_hvm_init_type init } xen_vector_callback_enabled = 0; - xen_domain_type = XEN_HVM_DOMAIN; - xen_hvm_init_shared_info_page(); xen_hvm_set_callback(NULL); + + /* + * On (PV)HVM domains we need to request the hypervisor to + * fill the shared info page, for PVH guest the shared_info page + * is passed inside the start_info struct and is already set, so this + * functions are no-ops. + */ + xen_hvm_init_shared_info_page(); xen_hvm_disable_emulated_devices(); } @@ -573,6 +606,9 @@ xen_set_vcpu_id(void) struct pcpu *pc; int i; + if (!xen_hvm_domain()) + return; + /* Set vcpu_id to acpi_id */ CPU_FOREACH(i) { pc = pcpu_find(i); @@ -616,7 +652,8 @@ xen_hvm_cpu_init(void) SYSINIT(xen_hvm_init, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, xen_hvm_sysinit, NULL); #ifdef SMP -SYSINIT(xen_setup_cpus, SI_SUB_SMP, SI_ORDER_FIRST, xen_setup_cpus, NULL); +/* We need to setup IPIs before APs are started */ +SYSINIT(xen_setup_cpus, SI_SUB_SMP-1, SI_ORDER_FIRST, xen_setup_cpus, NULL); #endif SYSINIT(xen_hvm_cpu_init, SI_SUB_INTR, SI_ORDER_FIRST, xen_hvm_cpu_init, NULL); SYSINIT(xen_set_vcpu_id, SI_SUB_CPU, SI_ORDER_ANY, xen_set_vcpu_id, NULL); From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 10:27:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3C4F454; Tue, 11 Mar 2014 10:27:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B39CF90; Tue, 11 Mar 2014 10:27:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BARwHN023645; Tue, 11 Mar 2014 10:27:58 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BARvoC023640; Tue, 11 Mar 2014 10:27:57 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201403111027.s2BARvoC023640@svn.freebsd.org> From: Roger Pau Monné Date: Tue, 11 Mar 2014 10:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263014 - in head/sys: amd64/amd64 amd64/include x86/include x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 10:27:58 -0000 Author: royger Date: Tue Mar 11 10:27:57 2014 New Revision: 263014 URL: http://svnweb.freebsd.org/changeset/base/263014 Log: xen: add a hook to perform AP startup AP startup on PVH follows the PV method, so we need to add a hook in order to diverge from bare metal. Approved by: gibbs Sponsored by: Citrix Systems R&D amd64/amd64/machdep.c: - Add hook for start_all_aps on native (using native_start_all_aps defined in mp_machdep). amd64/amd64/mp_machdep.c: - Make some variables global because they will also be used by the Xen PVH AP startup code. - Use the start_all_aps hook to start APs. - Rename start_all_aps to native_start_all_aps. amd64/include/smp.h: - Add declaration for native_start_all_aps. x86/include/init.h: - Declare start_all_aps hook in init_ops. x86/xen/pv.c: - Pick external declarations from mp_machdep. - Introduce Xen PV code to start APs on PVH. - Set start_all_aps init hook to use the Xen PVH implementation. Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/include/smp.h head/sys/x86/include/init.h head/sys/x86/xen/pv.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Mar 11 10:26:53 2014 (r263013) +++ head/sys/amd64/amd64/machdep.c Tue Mar 11 10:27:57 2014 (r263014) @@ -180,6 +180,7 @@ struct init_ops init_ops = { .parse_memmap = native_parse_memmap, #ifdef SMP .mp_bootaddress = mp_bootaddress, + .start_all_aps = native_start_all_aps, #endif }; Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Tue Mar 11 10:26:53 2014 (r263013) +++ head/sys/amd64/amd64/mp_machdep.c Tue Mar 11 10:27:57 2014 (r263014) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define WARMBOOT_TARGET 0 #define WARMBOOT_OFF (KERNBASE + 0x0467) @@ -90,7 +91,7 @@ extern struct pcpu __pcpu[]; /* AP uses this during bootstrap. Do not staticize. */ char *bootSTK; -static int bootAP; +int bootAP; /* Free these after use */ void *bootstacks[MAXCPU]; @@ -139,7 +140,7 @@ extern int pmap_pcid_enabled; static volatile cpuset_t ipi_nmi_pending; /* used to hold the AP's until we are ready to release them */ -static struct mtx ap_boot_mtx; +struct mtx ap_boot_mtx; /* Set to 1 once we're ready to let the APs out of the pen. */ static volatile int aps_ready = 0; @@ -166,7 +167,6 @@ static int cpu_cores; /* cores per pac static void assign_cpu_ids(void); static void set_interrupt_apic_ids(void); -static int start_all_aps(void); static int start_ap(int apic_id); static void release_aps(void *dummy); @@ -570,7 +570,7 @@ cpu_mp_start(void) assign_cpu_ids(); /* Start each Application Processor */ - start_all_aps(); + init_ops.start_all_aps(); set_interrupt_apic_ids(); } @@ -909,8 +909,8 @@ assign_cpu_ids(void) /* * start each AP in our list */ -static int -start_all_aps(void) +int +native_start_all_aps(void) { vm_offset_t va = boot_address + KERNBASE; u_int64_t *pt4, *pt3, *pt2; Modified: head/sys/amd64/include/smp.h ============================================================================== --- head/sys/amd64/include/smp.h Tue Mar 11 10:26:53 2014 (r263013) +++ head/sys/amd64/include/smp.h Tue Mar 11 10:27:57 2014 (r263014) @@ -85,6 +85,7 @@ void smp_masked_invlpg_range(cpuset_t ma vm_offset_t startva, vm_offset_t endva); void smp_invltlb(struct pmap *pmap); void smp_masked_invltlb(cpuset_t mask, struct pmap *pmap); +int native_start_all_aps(void); #endif /* !LOCORE */ #endif /* SMP */ Modified: head/sys/x86/include/init.h ============================================================================== --- head/sys/x86/include/init.h Tue Mar 11 10:26:53 2014 (r263013) +++ head/sys/x86/include/init.h Tue Mar 11 10:27:57 2014 (r263014) @@ -40,6 +40,7 @@ struct init_ops { void (*early_delay)(int); void (*parse_memmap)(caddr_t, vm_paddr_t *, int *); u_int (*mp_bootaddress)(u_int); + int (*start_all_aps)(void); }; extern struct init_ops init_ops; Modified: head/sys/x86/xen/pv.c ============================================================================== --- head/sys/x86/xen/pv.c Tue Mar 11 10:26:53 2014 (r263013) +++ head/sys/x86/xen/pv.c Tue Mar 11 10:27:57 2014 (r263014) @@ -34,10 +34,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include +#include #include #include @@ -50,10 +53,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include + #include /* Native initial function */ @@ -67,6 +73,22 @@ uint64_t hammer_time_xen(start_info_t *, static caddr_t xen_pv_parse_preload_data(u_int64_t); static void xen_pv_parse_memmap(caddr_t, vm_paddr_t *, int *); +#ifdef SMP +static int xen_pv_start_all_aps(void); +#endif + +/*---------------------------- Extern Declarations ---------------------------*/ +#ifdef SMP +/* Variables used by amd64 mp_machdep to start APs */ +extern struct mtx ap_boot_mtx; +extern void *bootstacks[]; +extern char *doublefault_stack; +extern char *nmi_stack; +extern void *dpcpu; +extern int bootAP; +extern char *bootSTK; +#endif + /*-------------------------------- Global Data -------------------------------*/ /* Xen init_ops implementation. */ struct init_ops xen_init_ops = { @@ -74,6 +96,9 @@ struct init_ops xen_init_ops = { .early_clock_source_init = xen_clock_init, .early_delay = xen_delay, .parse_memmap = xen_pv_parse_memmap, +#ifdef SMP + .start_all_aps = xen_pv_start_all_aps, +#endif }; static struct bios_smap xen_smap[MAX_E820_ENTRIES]; @@ -151,6 +176,77 @@ hammer_time_xen(start_info_t *si, uint64 } /*-------------------------------- PV specific -------------------------------*/ +#ifdef SMP +static bool +start_xen_ap(int cpu) +{ + struct vcpu_guest_context *ctxt; + int ms, cpus = mp_naps; + const size_t stacksize = KSTACK_PAGES * PAGE_SIZE; + + /* allocate and set up an idle stack data page */ + bootstacks[cpu] = + (void *)kmem_malloc(kernel_arena, stacksize, M_WAITOK | M_ZERO); + doublefault_stack = + (char *)kmem_malloc(kernel_arena, PAGE_SIZE, M_WAITOK | M_ZERO); + nmi_stack = + (char *)kmem_malloc(kernel_arena, PAGE_SIZE, M_WAITOK | M_ZERO); + dpcpu = + (void *)kmem_malloc(kernel_arena, DPCPU_SIZE, M_WAITOK | M_ZERO); + + bootSTK = (char *)bootstacks[cpu] + KSTACK_PAGES * PAGE_SIZE - 8; + bootAP = cpu; + + ctxt = malloc(sizeof(*ctxt), M_TEMP, M_WAITOK | M_ZERO); + if (ctxt == NULL) + panic("unable to allocate memory"); + + ctxt->flags = VGCF_IN_KERNEL; + ctxt->user_regs.rip = (unsigned long) init_secondary; + ctxt->user_regs.rsp = (unsigned long) bootSTK; + + /* Set the AP to use the same page tables */ + ctxt->ctrlreg[3] = KPML4phys; + + if (HYPERVISOR_vcpu_op(VCPUOP_initialise, cpu, ctxt)) + panic("unable to initialize AP#%d", cpu); + + free(ctxt, M_TEMP); + + /* Launch the vCPU */ + if (HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL)) + panic("unable to start AP#%d", cpu); + + /* Wait up to 5 seconds for it to start. */ + for (ms = 0; ms < 5000; ms++) { + if (mp_naps > cpus) + return (true); + DELAY(1000); + } + + return (false); +} + +static int +xen_pv_start_all_aps(void) +{ + int cpu; + + mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN); + + for (cpu = 1; cpu < mp_ncpus; cpu++) { + + /* attempt to start the Application Processor */ + if (!start_xen_ap(cpu)) + panic("AP #%d failed to start!", cpu); + + CPU_SET(cpu, &all_cpus); /* record AP in CPU map */ + } + + return (mp_naps); +} +#endif /* SMP */ + /* * Functions to convert the "extra" parameters passed by Xen * into FreeBSD boot options. From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 13:47:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27F8887A; Tue, 11 Mar 2014 13:47:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 13EAC87A; Tue, 11 Mar 2014 13:47:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BDlBId004770; Tue, 11 Mar 2014 13:47:11 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BDlBM8004769; Tue, 11 Mar 2014 13:47:11 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403111347.s2BDlBM8004769@svn.freebsd.org> From: Bryan Drewery Date: Tue, 11 Mar 2014 13:47:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263021 - head/lib/libfetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 13:47:12 -0000 Author: bdrewery Date: Tue Mar 11 13:47:11 2014 New Revision: 263021 URL: http://svnweb.freebsd.org/changeset/base/263021 Log: Support Last-Modified behind proxies which return UTC instead of GMT. The standard states that GMT must be used, but that UTC is equivalent. Still parse UTC as otherwise this causes problems for pkg(8). It will refetch the repository every time 'pkg update' or other remote operations are used behind these proxies. RFC2616: "All HTTP date/time stamps MUST be represented in Greenwich Mean Time (GMT), without exception. For the purposes of HTTP, GMT is exactly equal to UTC (Coordinated Universal Time)."" Approved by: bapt (mentor) Reviewed by: des, peter Sponsored by: EMC / Isilon Storage Division MFC after: 1 week Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Tue Mar 11 13:16:03 2014 (r263020) +++ head/lib/libfetch/http.c Tue Mar 11 13:47:11 2014 (r263021) @@ -876,6 +876,12 @@ http_parse_mtime(const char *p, time_t * strncpy(locale, setlocale(LC_TIME, NULL), sizeof(locale)); setlocale(LC_TIME, "C"); r = strptime(p, "%a, %d %b %Y %H:%M:%S GMT", &tm); + /* + * Some proxies use UTC in response, but it should still be + * parsed. RFC2616 states GMT and UTC are exactly equal for HTTP. + */ + if (r == NULL) + r = strptime(p, "%a, %d %b %Y %H:%M:%S UTC", &tm); /* XXX should add support for date-2 and date-3 */ setlocale(LC_TIME, locale); if (r == NULL) From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 15:46:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32079267; Tue, 11 Mar 2014 15:46:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 071CC779; Tue, 11 Mar 2014 15:46:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BFk3Aw054167; Tue, 11 Mar 2014 15:46:03 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BFk3e5054166; Tue, 11 Mar 2014 15:46:03 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403111546.s2BFk3e5054166@svn.freebsd.org> From: Ian Lepore Date: Tue, 11 Mar 2014 15:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263030 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 15:46:04 -0000 Author: ian Date: Tue Mar 11 15:46:03 2014 New Revision: 263030 URL: http://svnweb.freebsd.org/changeset/base/263030 Log: Remove some unnecessary indirection and jump right to the handler functions. Modified: head/sys/arm/arm/exception.S Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Tue Mar 11 15:43:06 2014 (r263029) +++ head/sys/arm/arm/exception.S Tue Mar 11 15:46:03 2014 (r263030) @@ -322,20 +322,9 @@ ASENTRY_NP(prefetch_abort_entry) sub lr, lr, #0x00000004 /* Adjust the lr */ PUSHFRAMEINSVC - ldr r1, Lprefetch_abort_handler_address adr lr, exception_exit mov r0, sp /* pass the stack pointer as r0 */ - ldr pc, [r1] - -Lprefetch_abort_handler_address: - .word _C_LABEL(prefetch_abort_handler_address) - - .data - .global _C_LABEL(prefetch_abort_handler_address) - -_C_LABEL(prefetch_abort_handler_address): - .word prefetch_abort_handler - + b prefetch_abort_handler END(prefetch_abort_entry) /* @@ -352,18 +341,9 @@ ASENTRY_NP(data_abort_entry) sub lr, lr, #0x00000008 /* Adjust the lr */ PUSHFRAMEINSVC /* Push trap frame and switch */ /* to SVC32 mode */ - ldr r1, Ldata_abort_handler_address adr lr, exception_exit mov r0, sp /* pass the stack pointer as r0 */ - ldr pc, [r1] -Ldata_abort_handler_address: - .word _C_LABEL(data_abort_handler_address) - - .data - .global _C_LABEL(data_abort_handler_address) -_C_LABEL(data_abort_handler_address): - .word data_abort_handler - + b data_abort_handler END(data_abort_entry) /* @@ -435,23 +415,10 @@ ASENTRY_NP(undefined_entry) sub lr, lr, #0x00000004 /* Adjust the lr */ PUSHFRAMEINSVC /* Push trap frame and switch */ /* to SVC32 mode */ - ldr r1, Lundefined_handler_address adr lr, exception_exit mov r0, sp /* pass the stack pointer as r0 */ - ldr pc, [r1] -END(undefined_entry) - -ASENTRY_NP(undefinedinstruction_bounce) b undefinedinstruction -END(undefinedinstruction_bounce) - -Lundefined_handler_address: - .word _C_LABEL(undefined_handler_address) - - .data - .global _C_LABEL(undefined_handler_address) -_C_LABEL(undefined_handler_address): - .word undefinedinstruction_bounce +END(undefined_entry) /* * Entry point for FIQ interrupts. From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 16:48:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 585CF6D4; Tue, 11 Mar 2014 16:48:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4126DD00; Tue, 11 Mar 2014 16:48:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BGml6P079125; Tue, 11 Mar 2014 16:48:47 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BGmldQ079124; Tue, 11 Mar 2014 16:48:47 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403111648.s2BGmldQ079124@svn.freebsd.org> From: Ian Lepore Date: Tue, 11 Mar 2014 16:48:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263033 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 16:48:47 -0000 Author: ian Date: Tue Mar 11 16:48:46 2014 New Revision: 263033 URL: http://svnweb.freebsd.org/changeset/base/263033 Log: No functional changes. Rewrite comments, use tabs consistantly, reorder some of the functions so that similar things are grouped together. Modified: head/sys/arm/arm/exception.S Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Tue Mar 11 16:24:54 2014 (r263032) +++ head/sys/arm/arm/exception.S Tue Mar 11 16:48:46 2014 (r263033) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); stmia sp, {r0-r12}; /* Push the user mode registers */ \ add r0, sp, #(4*13); /* Adjust the stack pointer */ \ stmia r0, {r13-r14}^; /* Push the user mode registers */ \ - mov r0, r0; /* NOP for previous instruction */ \ + mov r0, r0; /* NOP for previous instruction */ \ mrs r0, spsr; /* Put the SPSR on the stack */ \ str r0, [sp, #-4]!; \ ldr r0, =ARM_RAS_START; \ @@ -94,7 +94,7 @@ __FBSDID("$FreeBSD$"); stmia sp, {r0-r12}; /* Push the user mode registers */ \ add r0, sp, #(4*13); /* Adjust the stack pointer */ \ stmia r0, {r13-r14}^; /* Push the user mode registers */ \ - mov r0, r0; /* NOP for previous instruction */ \ + mov r0, r0; /* NOP for previous instruction */ \ mrs r0, spsr; /* Put the SPSR on the stack */ \ str r0, [sp, #-4]!; #endif @@ -106,22 +106,22 @@ __FBSDID("$FreeBSD$"); #ifdef ARM_TP_ADDRESS #define PULLFRAME \ - ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ - msr spsr_fsxc, r0; \ - ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ - mov r0, r0; /* NOP for previous instruction */ \ + ldr r0, [sp], #4; /* Get the SPSR from stack */ \ + msr spsr_fsxc, r0; \ + ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ + mov r0, r0; /* NOP for previous instruction */ \ add sp, sp, #(4*17); /* Adjust the stack pointer */ \ - ldr lr, [sp], #0x0004; /* Pull the return address */ \ + ldr lr, [sp], #4; /* Pull the return address */ \ add sp, sp, #4 /* Align the stack */ #else #define PULLFRAME \ - ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ - msr spsr_fsxc, r0; \ + ldr r0, [sp], #4 ; /* Get the SPSR from stack */ \ + msr spsr_fsxc, r0; \ clrex; \ - ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ - mov r0, r0; /* NOP for previous instruction */ \ + ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ + mov r0, r0; /* NOP for previous instruction */ \ add sp, sp, #(4*17); /* Adjust the stack pointer */ \ - ldr lr, [sp], #0x0004; /* Pull the return address */ \ + ldr lr, [sp], #4; /* Pull the return address */ \ add sp, sp, #4 /* Align the stack */ #endif @@ -141,60 +141,60 @@ __FBSDID("$FreeBSD$"); mov r0, lr; /* Save xxx32 r14 */ \ mov r1, sp; /* Save xxx32 sp */ \ mrs r3, spsr; /* Save xxx32 spsr */ \ - mrs r2, cpsr; /* Get the CPSR */ \ - bic r2, r2, #(PSR_MODE); /* Fix for SVC mode */ \ - orr r2, r2, #(PSR_SVC32_MODE); \ - msr cpsr_c, r2; /* Punch into SVC mode */ \ + mrs r2, cpsr; /* Get the CPSR */ \ + bic r2, r2, #(PSR_MODE); /* Fix for SVC mode */ \ + orr r2, r2, #(PSR_SVC32_MODE); \ + msr cpsr_c, r2; /* Punch into SVC mode */ \ mov r2, sp; /* Save SVC sp */ \ bic sp, sp, #7; /* Align sp to an 8-byte addrress */ \ sub sp, sp, #4; /* Pad trapframe to keep alignment */ \ str r0, [sp, #-4]!; /* Push return address */ \ str lr, [sp, #-4]!; /* Push SVC lr */ \ str r2, [sp, #-4]!; /* Push SVC sp */ \ - msr spsr_fsxc, r3; /* Restore correct spsr */ \ + msr spsr_fsxc, r3; /* Restore correct spsr */ \ ldmdb r1, {r0-r3}; /* Restore 4 regs from xxx mode */ \ sub sp, sp, #(4*15); /* Adjust the stack pointer */ \ stmia sp, {r0-r12}; /* Push the user mode registers */ \ add r0, sp, #(4*13); /* Adjust the stack pointer */ \ stmia r0, {r13-r14}^; /* Push the user mode registers */ \ - mov r0, r0; /* NOP for previous instruction */ \ + mov r0, r0; /* NOP for previous instruction */ \ ldr r5, =ARM_RAS_START; /* Check if there's any RAS */ \ - ldr r4, [r5, #4]; /* reset it to point at the */ \ - cmp r4, #0xffffffff; /* end of memory if necessary; */ \ - movne r1, #0xffffffff; /* leave value in r4 for later */ \ - strne r1, [r5, #4]; /* comparision against PC. */ \ - ldr r3, [r5]; /* Retrieve global RAS_START */ \ - cmp r3, #0; /* and reset it if non-zero. */ \ - movne r1, #0; /* If non-zero RAS_START and */ \ - strne r1, [r5]; /* PC was lower than RAS_END, */ \ - ldrne r1, [r0, #16]; /* adjust the saved PC so that */ \ - cmpne r4, r1; /* execution later resumes at */ \ - strhi r3, [r0, #16]; /* the RAS_START location. */ \ - mrs r0, spsr; \ - str r0, [sp, #-4]! + ldr r4, [r5, #4]; /* reset it to point at the */ \ + cmp r4, #0xffffffff; /* end of memory if necessary; */ \ + movne r1, #0xffffffff; /* leave value in r4 for later */ \ + strne r1, [r5, #4]; /* comparision against PC. */ \ + ldr r3, [r5]; /* Retrieve global RAS_START */ \ + cmp r3, #0; /* and reset it if non-zero. */ \ + movne r1, #0; /* If non-zero RAS_START and */ \ + strne r1, [r5]; /* PC was lower than RAS_END, */ \ + ldrne r1, [r0, #16]; /* adjust the saved PC so that */ \ + cmpne r4, r1; /* execution later resumes at */ \ + strhi r3, [r0, #16]; /* the RAS_START location. */ \ + mrs r0, spsr; \ + str r0, [sp, #-4]! #else #define PUSHFRAMEINSVC \ stmdb sp, {r0-r3}; /* Save 4 registers */ \ mov r0, lr; /* Save xxx32 r14 */ \ mov r1, sp; /* Save xxx32 sp */ \ mrs r3, spsr; /* Save xxx32 spsr */ \ - mrs r2, cpsr; /* Get the CPSR */ \ - bic r2, r2, #(PSR_MODE); /* Fix for SVC mode */ \ - orr r2, r2, #(PSR_SVC32_MODE); \ - msr cpsr_c, r2; /* Punch into SVC mode */ \ + mrs r2, cpsr; /* Get the CPSR */ \ + bic r2, r2, #(PSR_MODE); /* Fix for SVC mode */ \ + orr r2, r2, #(PSR_SVC32_MODE); \ + msr cpsr_c, r2; /* Punch into SVC mode */ \ mov r2, sp; /* Save SVC sp */ \ bic sp, sp, #7; /* Align sp to an 8-byte addrress */ \ sub sp, sp, #4; /* Pad trapframe to keep alignment */ \ str r0, [sp, #-4]!; /* Push return address */ \ str lr, [sp, #-4]!; /* Push SVC lr */ \ str r2, [sp, #-4]!; /* Push SVC sp */ \ - msr spsr_fsxc, r3; /* Restore correct spsr */ \ + msr spsr_fsxc, r3; /* Restore correct spsr */ \ ldmdb r1, {r0-r3}; /* Restore 4 regs from xxx mode */ \ sub sp, sp, #(4*15); /* Adjust the stack pointer */ \ stmia sp, {r0-r12}; /* Push the user mode registers */ \ add r0, sp, #(4*13); /* Adjust the stack pointer */ \ stmia r0, {r13-r14}^; /* Push the user mode registers */ \ - mov r0, r0; /* NOP for previous instruction */ \ + mov r0, r0; /* NOP for previous instruction */ \ mrs r0, spsr; /* Put the SPSR on the stack */ \ str r0, [sp, #-4]! #endif @@ -208,19 +208,19 @@ __FBSDID("$FreeBSD$"); #ifdef ARM_TP_ADDRESS #define PULLFRAMEFROMSVCANDEXIT \ - ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ - msr spsr_fsxc, r0; /* restore SPSR */ \ - ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ - mov r0, r0; /* NOP for previous instruction */ \ + ldr r0, [sp], #4; /* Get the SPSR from stack */ \ + msr spsr_fsxc, r0; /* restore SPSR */ \ + ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ + mov r0, r0; /* NOP for previous instruction */ \ add sp, sp, #(4*15); /* Adjust the stack pointer */ \ ldmia sp, {sp, lr, pc}^ /* Restore lr and exit */ #else #define PULLFRAMEFROMSVCANDEXIT \ - ldr r0, [sp], #0x0004; /* Get the SPSR from stack */ \ - msr spsr_fsxc, r0; /* restore SPSR */ \ + ldr r0, [sp], #4; /* Get the SPSR from stack */ \ + msr spsr_fsxc, r0; /* restore SPSR */ \ clrex; \ - ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ - mov r0, r0; /* NOP for previous instruction */ \ + ldmia sp, {r0-r14}^; /* Restore registers (usr mode) */ \ + mov r0, r0; /* NOP for previous instruction */ \ add sp, sp, #(4*15); /* Adjust the stack pointer */ \ ldmia sp, {sp, lr, pc}^ /* Restore lr and exit */ #endif @@ -264,35 +264,16 @@ __FBSDID("$FreeBSD$"); 2: - - -/* - * reset_entry: - * - * Handler for Reset exception. - */ -ASENTRY_NP(reset_entry) - adr r0, Lreset_panicmsg - bl _C_LABEL(panic) - /* NOTREACHED */ -Lreset_panicmsg: - .asciz "Reset vector called, LR = 0x%08x" - .balign 4 -END(reset_entry) - /* - * swi_entry + * Entry point for a Software Interrupt (SWI). * - * Handler for the Software Interrupt exception. + * The hardware switches to svc32 mode on a swi, so we're already on the + * right stack; just build a trapframe and call the handler. */ ASENTRY_NP(swi_entry) - STOP_UNWINDING /* Don't unwind into user mode. */ - - PUSHFRAME - - mov r0, sp /* Pass the frame to any function */ - bl _C_LABEL(swi_handler) /* It's a SWI ! */ - + PUSHFRAME /* Build the trapframe on the */ + mov r0, sp /* scv32 stack, pass it to the */ + bl _C_LABEL(swi_handler) /* swi handler. */ /* * The fork_trampoline() code in swtch.S aranges for the MI fork_exit() * to return to swi_exit here, to return to userland. The net effect is @@ -300,133 +281,105 @@ ASENTRY_NP(swi_entry) * the parent thread that created it. */ ASENTRY_NP(swi_exit) - - DO_AST /* Deliver signals. */ - - PULLFRAME - movs pc, lr /* Exit */ - + DO_AST /* Handle pending signals. */ + PULLFRAME /* Deallocate trapframe. */ + movs pc, lr /* Return to userland. */ + STOP_UNWINDING /* Don't unwind into user mode. */ END(swi_exit) END(swi_entry) /* - * prefetch_abort_entry: + * Standard exception exit handler. + * + * This is used to return from all exceptions except SWI. It uses DO_AST and + * PULLFRAMEFROMSVCANDEXIT and can only be called if the exception entry code + * used PUSHFRAMEINSVC. * - * Handler for the Prefetch Abort exception. + * If the return is to user mode, this uses DO_AST to deliver any pending + * signals and/or handle TDF_NEEDRESCHED first. + */ +ASENTRY_NP(exception_exit) + DO_AST /* Handle pending signals. */ + PULLFRAMEFROMSVCANDEXIT /* Return. */ + UNWINDSVCFRAME /* Special unwinding for exceptions. */ +END(exception_exit) + +/* + * Entry point for a Prefetch Abort exception. + * + * The hardware switches to the abort mode stack; we switch to svc32 before + * calling the handler, then return directly to the original mode/stack + * on exit (without transitioning back through the abort mode stack). */ ASENTRY_NP(prefetch_abort_entry) #ifdef __XSCALE__ nop /* Make absolutely sure any pending */ nop /* imprecise aborts have occurred. */ #endif - sub lr, lr, #0x00000004 /* Adjust the lr */ - - PUSHFRAMEINSVC - adr lr, exception_exit - mov r0, sp /* pass the stack pointer as r0 */ - b prefetch_abort_handler + sub lr, lr, #4 /* Adjust the lr. Transition to scv32 */ + PUSHFRAMEINSVC /* mode stack, build trapframe there. */ + adr lr, exception_exit /* Return from handler via standard */ + mov r0, sp /* exception exit routine. Pass the */ + b prefetch_abort_handler /* trapframe to the handler. */ END(prefetch_abort_entry) /* - * data_abort_entry: + * Entry point for a Data Abort exception. * - * Handler for the Data Abort exception. + * The hardware switches to the abort mode stack; we switch to svc32 before + * calling the handler, then return directly to the original mode/stack + * on exit (without transitioning back through the abort mode stack). */ ASENTRY_NP(data_abort_entry) #ifdef __XSCALE__ nop /* Make absolutely sure any pending */ nop /* imprecise aborts have occurred. */ #endif - - sub lr, lr, #0x00000008 /* Adjust the lr */ - PUSHFRAMEINSVC /* Push trap frame and switch */ - /* to SVC32 mode */ - adr lr, exception_exit - mov r0, sp /* pass the stack pointer as r0 */ - b data_abort_handler + sub lr, lr, #8 /* Adjust the lr. Transition to scv32 */ + PUSHFRAMEINSVC /* mode stack, build trapframe there. */ + adr lr, exception_exit /* Return from handler via standard */ + mov r0, sp /* exception exit routine. Pass the */ + b data_abort_handler /* trapframe to the handler. */ END(data_abort_entry) /* - * addr_exception_entry: - * - * Handler for the Address Exception exception. + * Entry point for an Undefined Instruction exception. * - * NOTE: This exception isn't really used on arm32. We - * print a warning message to the console and then treat - * it like a Data Abort. + * The hardware switches to the undefined mode stack; we switch to svc32 before + * calling the handler, then return directly to the original mode/stack + * on exit (without transitioning back through the undefined mode stack). */ -ASENTRY_NP(addr_exception_entry) - mrs r1, cpsr - mrs r2, spsr - mov r3, lr - adr r0, Laddr_exception_msg - bl _C_LABEL(printf) /* XXX CLOBBERS LR!! */ - b data_abort_entry -Laddr_exception_msg: - .asciz "Address Exception CPSR=0x%08x SPSR=0x%08x LR=0x%08x\n" - .balign 4 -END(addr_exception_entry) +ASENTRY_NP(undefined_entry) + sub lr, lr, #4 /* Adjust the lr. Transition to scv32 */ + PUSHFRAMEINSVC /* mode stack, build trapframe there. */ + adr lr, exception_exit /* Return from handler via standard */ + mov r0, sp /* exception exit routine. Pass the */ + b undefinedinstruction /* trapframe to the handler. */ +END(undefined_entry) /* - * General exception exit handler - * (Placed here to be within range of all the references to it) - * - * It exits straight away if not returning to USR mode. - * This loops around delivering any pending ASTs. - * Interrupts are disabled at suitable points to avoid ASTs - * being posted between testing and exit to user mode. + * Entry point for a normal IRQ. * - * This function uses PULLFRAMEFROMSVCANDEXIT and DO_AST and can - * only be called if the exception handler used PUSHFRAMEINSVC. - * - * For EABI, don't try to unwind any further than this. This is a - * stopgap measure to avoid getting stuck in a loop in the unwinder, - * which happens because we don't yet provide the proper unwind info - * here that describes which registers are being restored. + * The hardware switches to the IRQ mode stack; we switch to svc32 before + * calling the handler, then return directly to the original mode/stack + * on exit (without transitioning back through the IRQ mode stack). */ - -ASENTRY_NP(exception_exit) - UNWINDSVCFRAME - DO_AST - PULLFRAMEFROMSVCANDEXIT -END(exception_exit) - ASENTRY_NP(irq_entry) - sub lr, lr, #0x00000004 /* Adjust the lr */ - PUSHFRAMEINSVC /* Push an interrupt frame */ - mov r0, sp /* arg for dispatcher */ - - adr lr, exception_exit - mov r1, #0 - b _C_LABEL(arm_irq_handler) -END(irq_entry) - -/* - * undefined_entry: - * - * Handler for the Undefined Instruction exception. - * - * We indirect the undefined vector via the handler address - * in the data area. Entry to the undefined handler must - * look like direct entry from the vector. - */ -ASENTRY_NP(undefined_entry) - - sub lr, lr, #0x00000004 /* Adjust the lr */ - PUSHFRAMEINSVC /* Push trap frame and switch */ - /* to SVC32 mode */ - adr lr, exception_exit - mov r0, sp /* pass the stack pointer as r0 */ - b undefinedinstruction -END(undefined_entry) + sub lr, lr, #4 /* Adjust the lr. Transition to scv32 */ + PUSHFRAMEINSVC /* mode stack, build trapframe there. */ + adr lr, exception_exit /* Return from handler via standard */ + mov r0, sp /* exception exit routine. Pass the */ + b _C_LABEL(arm_irq_handler)/* trapframe to the handler. */ +END(irq_entry) /* - * Entry point for FIQ interrupts. + * Entry point for an FIQ interrupt. * * We don't currently support FIQ handlers very much. Something can * install itself in the FIQ vector using code (that may or may not work * these days) in fiq.c. If nobody does that and an FIQ happens, this * default handler just disables FIQs and otherwise ignores it. + */ ASENTRY_NP(fiq_entry) mrs r8, cpsr /* FIQ handling isn't supported, */ @@ -436,6 +389,35 @@ ASENTRY_NP(fiq_entry) END(fiq_entry) /* + * Entry point for an Address Exception exception. + * This is an arm26 exception that should never happen. + */ +ASENTRY_NP(addr_exception_entry) + mrs r1, cpsr + mrs r2, spsr + mov r3, lr + adr r0, Laddr_exception_msg + bl _C_LABEL(printf) /* XXX CLOBBERS LR!! */ + b data_abort_entry +Laddr_exception_msg: + .asciz "Address Exception CPSR=0x%08x SPSR=0x%08x LR=0x%08x\n" + .balign 4 +END(addr_exception_entry) + +/* + * Entry point for the system Reset vector. + * This should never happen, so panic. + */ +ASENTRY_NP(reset_entry) + adr r0, Lreset_panicmsg + bl _C_LABEL(panic) + /* NOTREACHED */ +Lreset_panicmsg: + .asciz "Reset vector called, LR = 0x%08x" + .balign 4 +END(reset_entry) + +/* * page0 and page0_data -- An image of the ARM vectors which is copied to * the ARM vectors page (high or low) as part of CPU initialization. The * code that does the copy assumes that page0_data holds one 32-bit word From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 16:53:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50943A13; Tue, 11 Mar 2014 16:53:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3D62EDBE; Tue, 11 Mar 2014 16:53:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BGr4QI082502; Tue, 11 Mar 2014 16:53:04 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BGr4Za082501; Tue, 11 Mar 2014 16:53:04 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403111653.s2BGr4Za082501@svn.freebsd.org> From: Ian Lepore Date: Tue, 11 Mar 2014 16:53:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263034 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 16:53:04 -0000 Author: ian Date: Tue Mar 11 16:53:03 2014 New Revision: 263034 URL: http://svnweb.freebsd.org/changeset/base/263034 Log: Use panic rather than printf to "handle" an arm26 address exception (should never happen on arm32). Pass the right arguments to panic for the reset exception (which also should never happen). Modified: head/sys/arm/arm/exception.S Modified: head/sys/arm/arm/exception.S ============================================================================== --- head/sys/arm/arm/exception.S Tue Mar 11 16:48:46 2014 (r263033) +++ head/sys/arm/arm/exception.S Tue Mar 11 16:53:03 2014 (r263034) @@ -379,7 +379,6 @@ END(irq_entry) * install itself in the FIQ vector using code (that may or may not work * these days) in fiq.c. If nobody does that and an FIQ happens, this * default handler just disables FIQs and otherwise ignores it. - */ ASENTRY_NP(fiq_entry) mrs r8, cpsr /* FIQ handling isn't supported, */ @@ -393,12 +392,11 @@ END(fiq_entry) * This is an arm26 exception that should never happen. */ ASENTRY_NP(addr_exception_entry) - mrs r1, cpsr - mrs r2, spsr mov r3, lr + mrs r2, spsr + mrs r1, cpsr adr r0, Laddr_exception_msg - bl _C_LABEL(printf) /* XXX CLOBBERS LR!! */ - b data_abort_entry + b _C_LABEL(panic) Laddr_exception_msg: .asciz "Address Exception CPSR=0x%08x SPSR=0x%08x LR=0x%08x\n" .balign 4 @@ -409,8 +407,9 @@ END(addr_exception_entry) * This should never happen, so panic. */ ASENTRY_NP(reset_entry) + mov r1, lr adr r0, Lreset_panicmsg - bl _C_LABEL(panic) + b _C_LABEL(panic) /* NOTREACHED */ Lreset_panicmsg: .asciz "Reset vector called, LR = 0x%08x" From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 16:56:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 466C2B7E; Tue, 11 Mar 2014 16:56:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 303B5DDD; Tue, 11 Mar 2014 16:56:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BGu3iq082930; Tue, 11 Mar 2014 16:56:03 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BGu1fp082907; Tue, 11 Mar 2014 16:56:01 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201403111656.s2BGu1fp082907@svn.freebsd.org> From: Tycho Nightingale Date: Tue, 11 Mar 2014 16:56:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263035 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel sys/amd64/vmm/io sys/modules/vmm usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 16:56:03 -0000 Author: tychon Date: Tue Mar 11 16:56:00 2014 New Revision: 263035 URL: http://svnweb.freebsd.org/changeset/base/263035 Log: Replace the userspace atpic stub with a more functional vmm.ko model. New ioctls VM_ISA_ASSERT_IRQ, VM_ISA_DEASSERT_IRQ and VM_ISA_PULSE_IRQ can be used to manipulate the pic, and optionally the ioapic, pin state. Reviewed by: jhb, neel Approved by: neel (co-mentor) Added: head/sys/amd64/vmm/io/vatpic.c (contents, props changed) head/sys/amd64/vmm/io/vatpic.h (contents, props changed) head/sys/amd64/vmm/vmm_ioport.c (contents, props changed) head/sys/amd64/vmm/vmm_ioport.h (contents, props changed) Deleted: head/usr.sbin/bhyve/atpic.c head/usr.sbin/bhyve/elcr.c Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/io/vhpet.c head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/io/vlapic_priv.h head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_dev.c head/sys/modules/vmm/Makefile head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/pci_lpc.c head/usr.sbin/bhyve/pit_8254.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Tue Mar 11 16:53:03 2014 (r263034) +++ head/lib/libvmmapi/vmmapi.c Tue Mar 11 16:56:00 2014 (r263035) @@ -458,6 +458,41 @@ vm_ioapic_pincount(struct vmctx *ctx, in } int +vm_isa_assert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq) +{ + struct vm_isa_irq isa_irq; + + bzero(&isa_irq, sizeof(struct vm_isa_irq)); + isa_irq.atpic_irq = atpic_irq; + isa_irq.ioapic_irq = ioapic_irq; + + return (ioctl(ctx->fd, VM_ISA_ASSERT_IRQ, &isa_irq)); +} + +int +vm_isa_deassert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq) +{ + struct vm_isa_irq isa_irq; + + bzero(&isa_irq, sizeof(struct vm_isa_irq)); + isa_irq.atpic_irq = atpic_irq; + isa_irq.ioapic_irq = ioapic_irq; + + return (ioctl(ctx->fd, VM_ISA_DEASSERT_IRQ, &isa_irq)); +} + +int +vm_isa_pulse_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq) +{ + struct vm_isa_irq isa_irq; + bzero(&isa_irq, sizeof(struct vm_isa_irq)); + isa_irq.atpic_irq = atpic_irq; + isa_irq.ioapic_irq = ioapic_irq; + + return (ioctl(ctx->fd, VM_ISA_PULSE_IRQ, &isa_irq)); +} + +int vm_inject_nmi(struct vmctx *ctx, int vcpu) { struct vm_nmi vmnmi; Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Tue Mar 11 16:53:03 2014 (r263034) +++ head/lib/libvmmapi/vmmapi.h Tue Mar 11 16:56:00 2014 (r263035) @@ -71,6 +71,9 @@ int vm_ioapic_assert_irq(struct vmctx *c int vm_ioapic_deassert_irq(struct vmctx *ctx, int irq); int vm_ioapic_pulse_irq(struct vmctx *ctx, int irq); int vm_ioapic_pincount(struct vmctx *ctx, int *pincount); +int vm_isa_deassert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); +int vm_isa_pulse_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); +int vm_isa_pulse_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); int vm_inject_nmi(struct vmctx *ctx, int vcpu); int vm_capability_name2type(const char *capname); const char *vm_capability_type2name(int type); Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Tue Mar 11 16:53:03 2014 (r263034) +++ head/sys/amd64/include/vmm.h Tue Mar 11 16:56:00 2014 (r263035) @@ -187,6 +187,7 @@ void vcpu_notify_event(struct vm *vm, in struct vmspace *vm_get_vmspace(struct vm *vm); int vm_assign_pptdev(struct vm *vm, int bus, int slot, int func); int vm_unassign_pptdev(struct vm *vm, int bus, int slot, int func); +struct vatpic *vm_atpic(struct vm *vm); /* * Inject exception 'vme' into the guest vcpu. This function returns 0 on Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Tue Mar 11 16:53:03 2014 (r263034) +++ head/sys/amd64/include/vmm_dev.h Tue Mar 11 16:56:00 2014 (r263035) @@ -79,6 +79,11 @@ struct vm_ioapic_irq { int irq; }; +struct vm_isa_irq { + int atpic_irq; + int ioapic_irq; +}; + struct vm_capability { int cpuid; enum vm_cap_type captype; @@ -198,6 +203,11 @@ enum { IOCNUM_SET_X2APIC_STATE = 60, IOCNUM_GET_X2APIC_STATE = 61, IOCNUM_GET_HPET_CAPABILITIES = 62, + + /* legacy interrupt injection */ + IOCNUM_ISA_ASSERT_IRQ = 80, + IOCNUM_ISA_DEASSERT_IRQ = 81, + IOCNUM_ISA_PULSE_IRQ = 82, }; #define VM_RUN \ @@ -230,6 +240,12 @@ enum { _IOW('v', IOCNUM_IOAPIC_PULSE_IRQ, struct vm_ioapic_irq) #define VM_IOAPIC_PINCOUNT \ _IOR('v', IOCNUM_IOAPIC_PINCOUNT, int) +#define VM_ISA_ASSERT_IRQ \ + _IOW('v', IOCNUM_ISA_ASSERT_IRQ, struct vm_isa_irq) +#define VM_ISA_DEASSERT_IRQ \ + _IOW('v', IOCNUM_ISA_DEASSERT_IRQ, struct vm_isa_irq) +#define VM_ISA_PULSE_IRQ \ + _IOW('v', IOCNUM_ISA_PULSE_IRQ, struct vm_isa_irq) #define VM_SET_CAPABILITY \ _IOW('v', IOCNUM_SET_CAPABILITY, struct vm_capability) #define VM_GET_CAPABILITY \ Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Tue Mar 11 16:53:03 2014 (r263034) +++ head/sys/amd64/vmm/intel/vmx.c Tue Mar 11 16:56:00 2014 (r263035) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "vmm_host.h" +#include "vmm_ioport.h" #include "vmm_ipi.h" #include "vmm_msr.h" #include "vmm_ktr.h" @@ -1861,6 +1862,11 @@ vmx_exit_process(struct vmx *vmx, int vc vmexit->u.inout.rep = (qual & 0x20) ? 1 : 0; vmexit->u.inout.port = (uint16_t)(qual >> 16); vmexit->u.inout.eax = (uint32_t)(vmxctx->guest_rax); + error = emulate_ioport(vmx->vm, vcpu, vmexit); + if (error == 0) { + handled = 1; + vmxctx->guest_rax = vmexit->u.inout.eax; + } break; case EXIT_REASON_CPUID: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_CPUID, 1); Added: head/sys/amd64/vmm/io/vatpic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/vmm/io/vatpic.c Tue Mar 11 16:56:00 2014 (r263035) @@ -0,0 +1,595 @@ +/*- + * Copyright (c) 2014 Tycho Nightingale + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include "vmm_ktr.h" +#include "vmm_lapic.h" +#include "vioapic.h" +#include "vatpic.h" + +static MALLOC_DEFINE(M_VATPIC, "atpic", "bhyve virtual atpic (8259)"); + +#define VATPIC_LOCK(vatpic) mtx_lock_spin(&((vatpic)->mtx)) +#define VATPIC_UNLOCK(vatpic) mtx_unlock_spin(&((vatpic)->mtx)) +#define VATPIC_LOCKED(vatpic) mtx_owned(&((vatpic)->mtx)) + +enum irqstate { + IRQSTATE_ASSERT, + IRQSTATE_DEASSERT, + IRQSTATE_PULSE +}; + +struct atpic { + bool ready; + int icw_num; + int rd_cmd_reg; + + bool aeoi; + bool poll; + bool rotate; + + int irq_base; + uint8_t request; /* Interrupt Request Register (IIR) */ + uint8_t service; /* Interrupt Service (ISR) */ + uint8_t mask; /* Interrupt Mask Register (IMR) */ + + int acnt[8]; /* sum of pin asserts and deasserts */ + int priority; /* current pin priority */ +}; + +struct vatpic { + struct vm *vm; + struct mtx mtx; + struct atpic atpic[2]; + uint8_t elc[2]; +}; + +#define VATPIC_CTR0(vatpic, fmt) \ + VM_CTR0((vatpic)->vm, fmt) + +#define VATPIC_CTR1(vatpic, fmt, a1) \ + VM_CTR1((vatpic)->vm, fmt, a1) + +#define VATPIC_CTR2(vatpic, fmt, a1, a2) \ + VM_CTR2((vatpic)->vm, fmt, a1, a2) + +#define VATPIC_CTR3(vatpic, fmt, a1, a2, a3) \ + VM_CTR3((vatpic)->vm, fmt, a1, a2, a3) + +#define VATPIC_CTR4(vatpic, fmt, a1, a2, a3, a4) \ + VM_CTR4((vatpic)->vm, fmt, a1, a2, a3, a4) + + +static __inline int +vatpic_get_highest_isrpin(struct atpic *atpic) +{ + int bit, pin; + int i; + + for (i = 0; i <= 7; i++) { + pin = ((i + 7 - atpic->priority) & 0x7); + bit = (1 << pin); + + if (atpic->service & bit) + return (pin); + } + + return (-1); +} + +static __inline int +vatpic_get_highest_irrpin(struct atpic *atpic) +{ + int bit, pin; + int i, j; + + for (i = 0; i <= 7; i++) { + pin = ((i + 7 - atpic->priority) & 0x7); + bit = (1 << pin); + if (atpic->service & bit) + break; + } + + for (j = 0; j < i; j++) { + pin = ((j + 7 - atpic->priority) & 0x7); + bit = (1 << pin); + if (atpic->request & bit && (~atpic->mask & bit)) + return (pin); + } + + return (-1); +} + +static void +vatpic_notify_intr(struct vatpic *vatpic) +{ + struct atpic *atpic; + int pin; + + KASSERT(VATPIC_LOCKED(vatpic), ("vatpic_notify_intr not locked")); + + /* XXX master only */ + atpic = &vatpic->atpic[0]; + + if ((pin = vatpic_get_highest_irrpin(atpic)) != -1) { + VATPIC_CTR4(vatpic, "atpic notify pin = %d " + "(imr 0x%x irr 0x%x isr 0x%x)", pin, + atpic->mask, atpic->request, atpic->service); + lapic_set_local_intr(vatpic->vm, -1, APIC_LVT_LINT0); + vioapic_pulse_irq(vatpic->vm, 0); + } else { + VATPIC_CTR3(vatpic, "atpic no eligible interrupts " + "(imr 0x%x irr 0x%x isr 0x%x)", + atpic->mask, atpic->request, atpic->service); + } +} + +static int +vatpic_icw1(struct vatpic *vatpic, struct atpic *atpic, uint8_t val) +{ + VATPIC_CTR1(vatpic, "atpic icw1 0x%x", val); + + atpic->ready = false; + + atpic->icw_num = 1; + atpic->mask = 0; + atpic->priority = 0; + atpic->rd_cmd_reg = 0; + + if ((val & ICW1_SNGL) != 0) { + VATPIC_CTR0(vatpic, "vatpic cascade mode required"); + return (-1); + } + + if ((val & ICW1_IC4) == 0) { + VATPIC_CTR0(vatpic, "vatpic icw4 required"); + return (-1); + } + + atpic->icw_num++; + + return (0); +} + +static int +vatpic_icw2(struct vatpic *vatpic, struct atpic *atpic, uint8_t val) +{ + VATPIC_CTR1(vatpic, "atpic icw2 0x%x", val); + + atpic->irq_base = val & 0xf8; + + atpic->icw_num++; + + return (0); +} + +static int +vatpic_icw3(struct vatpic *vatpic, struct atpic *atpic, uint8_t val) +{ + VATPIC_CTR1(vatpic, "atpic icw3 0x%x", val); + + atpic->icw_num++; + + return (0); +} + +static int +vatpic_icw4(struct vatpic *vatpic, struct atpic *atpic, uint8_t val) +{ + VATPIC_CTR1(vatpic, "atpic icw4 0x%x", val); + + if ((val & ICW4_8086) == 0) { + VATPIC_CTR0(vatpic, "vatpic microprocessor mode required"); + return (-1); + } + + if ((val & ICW4_AEOI) != 0) + atpic->aeoi = true; + + atpic->icw_num = 0; + atpic->ready = true; + + return (0); +} + +static int +vatpic_ocw1(struct vatpic *vatpic, struct atpic *atpic, uint8_t val) +{ + VATPIC_CTR1(vatpic, "atpic ocw1 0x%x", val); + + atpic->mask = val & 0xff; + + return (0); +} + +static int +vatpic_ocw2(struct vatpic *vatpic, struct atpic *atpic, uint8_t val) +{ + VATPIC_CTR1(vatpic, "atpic ocw2 0x%x", val); + + atpic->rotate = ((val & OCW2_R) != 0); + + if ((val & OCW2_EOI) != 0) { + int isr_bit; + + if ((val & OCW2_SL) != 0) { + /* specific EOI */ + isr_bit = val & 0x7; + } else { + /* non-specific EOI */ + isr_bit = vatpic_get_highest_isrpin(atpic); + } + + if (isr_bit != -1) { + atpic->service &= ~(1 << isr_bit); + + if (atpic->rotate) + atpic->priority = isr_bit; + } + } else if ((val & OCW2_SL) != 0 && atpic->rotate == true) { + /* specific priority */ + atpic->priority = val & 0x7; + } + + return (0); +} + +static int +vatpic_ocw3(struct vatpic *vatpic, struct atpic *atpic, uint8_t val) +{ + VATPIC_CTR1(vatpic, "atpic ocw3 0x%x", val); + + atpic->poll = ((val & OCW3_P) != 0); + + if (val & OCW3_RR) { + /* read register command */ + atpic->rd_cmd_reg = val & OCW3_RIS; + } + + return (0); +} + +static void +vatpic_set_pinstate(struct vatpic *vatpic, int pin, bool newstate) +{ + struct atpic *atpic; + int oldcnt, newcnt; + bool level; + + KASSERT(pin >= 0 && pin < 16, + ("vatpic_set_pinstate: invalid pin number %d", pin)); + KASSERT(VATPIC_LOCKED(vatpic), + ("vatpic_set_pinstate: vatpic is not locked")); + + atpic = &vatpic->atpic[pin >> 3]; + + oldcnt = atpic->acnt[pin & 0x7]; + if (newstate) + atpic->acnt[pin & 0x7]++; + else + atpic->acnt[pin & 0x7]--; + newcnt = atpic->acnt[pin & 0x7]; + + if (newcnt < 0) { + VATPIC_CTR2(vatpic, "atpic pin%d: bad acnt %d", pin, newcnt); + } + + level = ((vatpic->elc[pin >> 3] & (1 << (pin & 0x7))) != 0); + + if ((oldcnt == 0 && newcnt == 1) || (newcnt > 0 && level == true)) { + /* rising edge or level */ + VATPIC_CTR1(vatpic, "atpic pin%d: asserted", pin); + atpic->request |= (1 << (pin & 0x7)); + } else if (oldcnt == 1 && newcnt == 0) { + /* falling edge */ + VATPIC_CTR1(vatpic, "atpic pin%d: deasserted", pin); + } else { + VATPIC_CTR3(vatpic, "atpic pin%d: %s, ignored, acnt %d", + pin, newstate ? "asserted" : "deasserted", newcnt); + } + + vatpic_notify_intr(vatpic); +} + +static int +vatpic_set_irqstate(struct vm *vm, int irq, enum irqstate irqstate) +{ + struct vatpic *vatpic; + struct atpic *atpic; + + if (irq < 0 || irq > 15) + return (EINVAL); + + vatpic = vm_atpic(vm); + atpic = &vatpic->atpic[irq >> 3]; + + if (atpic->ready == false) + return (0); + + VATPIC_LOCK(vatpic); + switch (irqstate) { + case IRQSTATE_ASSERT: + vatpic_set_pinstate(vatpic, irq, true); + break; + case IRQSTATE_DEASSERT: + vatpic_set_pinstate(vatpic, irq, false); + break; + case IRQSTATE_PULSE: + vatpic_set_pinstate(vatpic, irq, true); + vatpic_set_pinstate(vatpic, irq, false); + break; + default: + panic("vatpic_set_irqstate: invalid irqstate %d", irqstate); + } + VATPIC_UNLOCK(vatpic); + + return (0); +} + +int +vatpic_assert_irq(struct vm *vm, int irq) +{ + return (vatpic_set_irqstate(vm, irq, IRQSTATE_ASSERT)); +} + +int +vatpic_deassert_irq(struct vm *vm, int irq) +{ + return (vatpic_set_irqstate(vm, irq, IRQSTATE_DEASSERT)); +} + +int +vatpic_pulse_irq(struct vm *vm, int irq) +{ + return (vatpic_set_irqstate(vm, irq, IRQSTATE_PULSE)); +} + +int +vatpic_pending_intr(struct vm *vm, int *vecptr) +{ + struct vatpic *vatpic; + struct atpic *atpic; + int pin; + + vatpic = vm_atpic(vm); + + /* XXX master only */ + atpic = &vatpic->atpic[0]; + + VATPIC_LOCK(vatpic); + + pin = vatpic_get_highest_irrpin(atpic); + if (pin == -1) + pin = 7; + + *vecptr = atpic->irq_base + pin; + + VATPIC_UNLOCK(vatpic); + + return (1); +} + +void +vatpic_intr_accepted(struct vm *vm, int vector) +{ + struct vatpic *vatpic; + struct atpic *atpic; + int pin; + + vatpic = vm_atpic(vm); + + /* XXX master only */ + atpic = &vatpic->atpic[0]; + + VATPIC_LOCK(vatpic); + pin = vector & 0x7; + + if (atpic->acnt[pin] == 0) + atpic->request &= ~(1 << pin); + + if (atpic->aeoi == true) { + if (atpic->rotate == true) + atpic->priority = pin; + } else { + atpic->service |= (1 << pin); + } + + vatpic_notify_intr(vatpic); + + VATPIC_UNLOCK(vatpic); +} + +int +vatpic_master_handler(void *vm, int vcpuid, struct vm_exit *vmexit) +{ + struct vatpic *vatpic; + struct atpic *atpic; + int error; + uint8_t val; + + vatpic = vm_atpic(vm); + atpic = &vatpic->atpic[0]; + + if (vmexit->u.inout.bytes != 1) + return (-1); + + if (vmexit->u.inout.in) { + VATPIC_LOCK(vatpic); + if (atpic->poll) { + VATPIC_CTR0(vatpic, "vatpic polled mode not " + "supported"); + VATPIC_UNLOCK(vatpic); + return (-1); + } else { + if (vmexit->u.inout.port & ICU_IMR_OFFSET) { + /* read interrrupt mask register */ + vmexit->u.inout.eax = atpic->mask; + } else { + if (atpic->rd_cmd_reg == OCW3_RIS) { + /* read interrupt service register */ + vmexit->u.inout.eax = atpic->service; + } else { + /* read interrupt request register */ + vmexit->u.inout.eax = atpic->request; + } + } + } + VATPIC_UNLOCK(vatpic); + + return (0); + } + + val = vmexit->u.inout.eax; + + VATPIC_LOCK(vatpic); + + if (vmexit->u.inout.port & ICU_IMR_OFFSET) { + if (atpic->ready) { + error = vatpic_ocw1(vatpic, atpic, val); + } else { + switch (atpic->icw_num) { + case 2: + error = vatpic_icw2(vatpic, atpic, val); + break; + case 3: + error = vatpic_icw3(vatpic, atpic, val); + break; + case 4: + error = vatpic_icw4(vatpic, atpic, val); + break; + } + } + } else { + if (val & (1 << 4)) + error = vatpic_icw1(vatpic, atpic, val); + + if (atpic->ready) { + if (val & (1 << 3)) + error = vatpic_ocw3(vatpic, atpic, val); + else + error = vatpic_ocw2(vatpic, atpic, val); + } + } + + if (atpic->ready) + vatpic_notify_intr(vatpic); + + VATPIC_UNLOCK(vatpic); + + return (error); +} + +int +vatpic_slave_handler(void *vm, int vcpuid, struct vm_exit *vmexit) +{ + if (vmexit->u.inout.bytes != 1) + return (-1); + + if (vmexit->u.inout.in) { + if (vmexit->u.inout.port & ICU_IMR_OFFSET) { + /* all interrupts masked */ + vmexit->u.inout.eax = 0xff; + } else { + vmexit->u.inout.eax = 0x00; + } + } + + /* Pretend all accesses to the slave 8259 are alright */ + return (0); +} + +int +vatpic_elc_handler(void *vm, int vcpuid, struct vm_exit *vmexit) +{ + struct vatpic *vatpic; + bool is_master; + + vatpic = vm_atpic(vm); + is_master = (vmexit->u.inout.port == IO_ELCR1); + + if (vmexit->u.inout.bytes != 1) + return (-1); + + if (vmexit->u.inout.in) { + if (is_master) + vmexit->u.inout.eax = vatpic->elc[0]; + else + vmexit->u.inout.eax = vatpic->elc[1]; + } else { + /* + * For the master PIC the cascade channel (IRQ2), the + * heart beat timer (IRQ0), and the keyboard + * controller (IRQ1) cannot be programmed for level + * mode. + * + * For the slave PIC the real time clock (IRQ8) and + * the floating point error interrupt (IRQ13) cannot + * be programmed for level mode. + */ + if (is_master) + vatpic->elc[0] = (vmexit->u.inout.eax & 0xf8); + else + vatpic->elc[1] = (vmexit->u.inout.eax & 0xde); + } + + return (0); +} + +struct vatpic * +vatpic_init(struct vm *vm) +{ + struct vatpic *vatpic; + + vatpic = malloc(sizeof(struct vatpic), M_VATPIC, M_WAITOK | M_ZERO); + vatpic->vm = vm; + + mtx_init(&vatpic->mtx, "vatpic lock", NULL, MTX_SPIN); + + return (vatpic); +} + +void +vatpic_cleanup(struct vatpic *vatpic) +{ + free(vatpic, M_VATPIC); +} Added: head/sys/amd64/vmm/io/vatpic.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/vmm/io/vatpic.h Tue Mar 11 16:56:00 2014 (r263035) @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2014 Tycho Nightingale + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _VATPIC_H_ +#define _VATPIC_H_ + +#include + +#define ICU_IMR_OFFSET 1 + +#define IO_ELCR1 0x4d0 +#define IO_ELCR2 0x4d1 + +struct vatpic *vatpic_init(struct vm *vm); +void vatpic_cleanup(struct vatpic *vatpic); + +int vatpic_master_handler(void *vm, int vcpuid, struct vm_exit *vmexit); +int vatpic_slave_handler(void *vm, int vcpuid, struct vm_exit *vmexit); +int vatpic_elc_handler(void *vm, int vcpuid, struct vm_exit *vmexit); + +int vatpic_assert_irq(struct vm *vm, int irq); +int vatpic_deassert_irq(struct vm *vm, int irq); +int vatpic_pulse_irq(struct vm *vm, int irq); + +int vatpic_pending_intr(struct vm *vm, int *vecptr); +void vatpic_intr_accepted(struct vm *vm, int vector); + +#endif /* _VATPIC_H_ */ Modified: head/sys/amd64/vmm/io/vhpet.c ============================================================================== --- head/sys/amd64/vmm/io/vhpet.c Tue Mar 11 16:53:03 2014 (r263034) +++ head/sys/amd64/vmm/io/vhpet.c Tue Mar 11 16:56:00 2014 (r263035) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include "vmm_lapic.h" +#include "vatpic.h" #include "vioapic.h" #include "vhpet.h" @@ -167,6 +168,25 @@ vhpet_timer_ioapic_pin(struct vhpet *vhp return ((vhpet->timer[n].cap_config & HPET_TCNF_INT_ROUTE) >> 9); } +static __inline int +vhpet_timer_atpic_pin(struct vhpet *vhpet, int n) +{ + if (vhpet->config & HPET_CNF_LEG_RT) { + /* + * In "legacy routing" timers 0 and 1 are connected to + * 8259 master pin 0 and slave pin 0 respectively. + */ + switch (n) { + case 0: + return (0); + case 1: + return (8); + } + } + + return (-1); +} + static uint32_t vhpet_counter(struct vhpet *vhpet, sbintime_t *nowptr) { @@ -196,12 +216,17 @@ vhpet_counter(struct vhpet *vhpet, sbint static void vhpet_timer_clear_isr(struct vhpet *vhpet, int n) { - int pin; + int pin, legacy_pin; if (vhpet->isr & (1 << n)) { pin = vhpet_timer_ioapic_pin(vhpet, n); KASSERT(pin != 0, ("vhpet timer %d irq incorrectly routed", n)); vioapic_deassert_irq(vhpet->vm, pin); + + legacy_pin = vhpet_timer_atpic_pin(vhpet, n); + if (legacy_pin != -1) + vatpic_deassert_irq(vhpet->vm, legacy_pin); + vhpet->isr &= ~(1 << n); } } @@ -242,7 +267,7 @@ vhpet_timer_edge_trig(struct vhpet *vhpe static void vhpet_timer_interrupt(struct vhpet *vhpet, int n) { - int pin; + int pin, legacy_pin; /* If interrupts are not enabled for this timer then just return. */ if (!vhpet_timer_interrupt_enabled(vhpet, n)) @@ -268,11 +293,17 @@ vhpet_timer_interrupt(struct vhpet *vhpe return; } + legacy_pin = vhpet_timer_atpic_pin(vhpet, n); + if (vhpet_timer_edge_trig(vhpet, n)) { vioapic_pulse_irq(vhpet->vm, pin); + if (legacy_pin != -1) + vatpic_pulse_irq(vhpet->vm, legacy_pin); } else { vhpet->isr |= 1 << n; vioapic_assert_irq(vhpet->vm, pin); + if (legacy_pin != -1) + vatpic_assert_irq(vhpet->vm, legacy_pin); } } Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Tue Mar 11 16:53:03 2014 (r263034) +++ head/sys/amd64/vmm/io/vlapic.c Tue Mar 11 16:56:00 2014 (r263035) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include "vlapic.h" #include "vlapic_priv.h" +#include "vatpic.h" #include "vioapic.h" #define PRIO(x) ((x) >> 4) @@ -299,6 +300,16 @@ vlapic_set_intr_ready(struct vlapic *vla return (1); } +static VMM_STAT(VLAPIC_EXTINT_COUNT, "number of ExtINTs received by vlapic"); + +static void +vlapic_deliver_extint(struct vlapic *vlapic) +{ + vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_EXTINT_COUNT, 1); + vlapic->extint_pending = true; + vcpu_notify_event(vlapic->vm, vlapic->vcpuid, false); +} + static __inline uint32_t * vlapic_get_lvtptr(struct vlapic *vlapic, uint32_t offset) { @@ -448,6 +459,9 @@ vlapic_fire_lvt(struct vlapic *vlapic, u case APIC_LVT_DM_NMI: vm_inject_nmi(vlapic->vm, vlapic->vcpuid); break; + case APIC_LVT_DM_EXTINT: + vlapic_deliver_extint(vlapic); + break; default: // Other modes ignored return (0); @@ -651,6 +665,25 @@ vlapic_trigger_lvt(struct vlapic *vlapic { uint32_t lvt; + if (vlapic_enabled(vlapic) == false) { + /* + * When the local APIC is global/hardware disabled, + * LINT[1:0] pins are configured as INTR and NMI pins, + * respectively. + */ + switch (vector) { + case APIC_LVT_LINT0: + vlapic_deliver_extint(vlapic); + break; + case APIC_LVT_LINT1: + vm_inject_nmi(vlapic->vm, vlapic->vcpuid); + break; + default: + break; + } + return (0); + } + switch (vector) { case APIC_LVT_LINT0: lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_LINT0_LVT); @@ -1020,6 +1053,9 @@ vlapic_pending_intr(struct vlapic *vlapi int idx, i, bitpos, vector; uint32_t *irrptr, val; + if (vlapic->extint_pending) + return (vatpic_pending_intr(vlapic->vm, vecptr)); + if (vlapic->ops.pending_intr) return ((*vlapic->ops.pending_intr)(vlapic, vecptr)); @@ -1054,6 +1090,12 @@ vlapic_intr_accepted(struct vlapic *vlap uint32_t *irrptr, *isrptr; int idx, stk_top; + if (vlapic->extint_pending) { + vlapic->extint_pending = false; + vatpic_intr_accepted(vlapic->vm, vector); + return; + } + if (vlapic->ops.intr_accepted) return ((*vlapic->ops.intr_accepted)(vlapic, vector)); @@ -1474,11 +1516,13 @@ vlapic_deliver_intr(struct vm *vm, bool int vcpuid; cpuset_t dmask; - if (delmode != APIC_DELMODE_FIXED && delmode != APIC_DELMODE_LOWPRIO) { + if (delmode != IOART_DELFIXED && + delmode != IOART_DELLOPRI && + delmode != IOART_DELEXINT) { VM_CTR1(vm, "vlapic intr invalid delmode %#x", delmode); return; } - lowprio = (delmode == APIC_DELMODE_LOWPRIO); + lowprio = (delmode == IOART_DELLOPRI); /* * We don't provide any virtual interrupt redirection hardware so @@ -1490,7 +1534,11 @@ vlapic_deliver_intr(struct vm *vm, bool while ((vcpuid = CPU_FFS(&dmask)) != 0) { vcpuid--; CPU_CLR(vcpuid, &dmask); - lapic_set_intr(vm, vcpuid, vec, level); + if (delmode == IOART_DELEXINT) { + vlapic_deliver_extint(vm_lapic(vm, vcpuid)); + } else { + lapic_set_intr(vm, vcpuid, vec, level); + } } } Modified: head/sys/amd64/vmm/io/vlapic_priv.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic_priv.h Tue Mar 11 16:53:03 2014 (r263034) +++ head/sys/amd64/vmm/io/vlapic_priv.h Tue Mar 11 16:56:00 2014 (r263035) @@ -156,6 +156,8 @@ struct vlapic { uint32_t esr_pending; int esr_firing; + bool extint_pending; + struct callout callout; /* vlapic timer */ struct bintime timer_fire_bt; /* callout expiry time */ struct bintime timer_freq_bt; /* timer frequency */ Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Tue Mar 11 16:53:03 2014 (r263034) +++ head/sys/amd64/vmm/vmm.c Tue Mar 11 16:56:00 2014 (r263035) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include "vmm_host.h" #include "vmm_mem.h" #include "vmm_util.h" +#include "vatpic.h" #include "vhpet.h" #include "vioapic.h" #include "vlapic.h" @@ -116,6 +117,7 @@ struct vm { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 17:08:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DCE9E2A6; Tue, 11 Mar 2014 17:08:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C9DE0F04; Tue, 11 Mar 2014 17:08:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BH8jx2087759; Tue, 11 Mar 2014 17:08:45 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BH8jQn087758; Tue, 11 Mar 2014 17:08:45 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403111708.s2BH8jQn087758@svn.freebsd.org> From: Warner Losh Date: Tue, 11 Mar 2014 17:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263036 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 17:08:45 -0000 Author: imp Date: Tue Mar 11 17:08:45 2014 New Revision: 263036 URL: http://svnweb.freebsd.org/changeset/base/263036 Log: Remove clause 3 (advertising clause), per regent's letter. Modified: head/sys/arm/arm/sys_machdep.c Modified: head/sys/arm/arm/sys_machdep.c ============================================================================== --- head/sys/arm/arm/sys_machdep.c Tue Mar 11 16:56:00 2014 (r263035) +++ head/sys/arm/arm/sys_machdep.c Tue Mar 11 17:08:45 2014 (r263036) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 17:20:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E346F853; Tue, 11 Mar 2014 17:20:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B432485; Tue, 11 Mar 2014 17:20:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BHKp7a094259; Tue, 11 Mar 2014 17:20:51 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BHKpgl094256; Tue, 11 Mar 2014 17:20:51 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403111720.s2BHKpgl094256@svn.freebsd.org> From: Warner Losh Date: Tue, 11 Mar 2014 17:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263037 - in head/sys: amd64/amd64 i386/i386 mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 17:20:52 -0000 Author: imp Date: Tue Mar 11 17:20:50 2014 New Revision: 263037 URL: http://svnweb.freebsd.org/changeset/base/263037 Log: Remove clause 3 (the advertising clause), per the regent's letter. Modified: head/sys/amd64/amd64/sys_machdep.c head/sys/i386/i386/sys_machdep.c head/sys/mips/mips/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Tue Mar 11 17:08:45 2014 (r263036) +++ head/sys/amd64/amd64/sys_machdep.c Tue Mar 11 17:20:50 2014 (r263037) @@ -11,7 +11,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Tue Mar 11 17:08:45 2014 (r263036) +++ head/sys/i386/i386/sys_machdep.c Tue Mar 11 17:20:50 2014 (r263037) @@ -10,7 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/mips/mips/sys_machdep.c ============================================================================== --- head/sys/mips/mips/sys_machdep.c Tue Mar 11 17:08:45 2014 (r263036) +++ head/sys/mips/mips/sys_machdep.c Tue Mar 11 17:20:50 2014 (r263037) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 20:32:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE171846; Tue, 11 Mar 2014 20:32:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C99A0C17; Tue, 11 Mar 2014 20:32:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BKWOaQ074865; Tue, 11 Mar 2014 20:32:24 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BKWNI5074860; Tue, 11 Mar 2014 20:32:23 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201403112032.s2BKWNI5074860@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 11 Mar 2014 20:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263041 - head/contrib/tzdata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 20:32:25 -0000 Author: edwin Date: Tue Mar 11 20:32:23 2014 New Revision: 263041 URL: http://svnweb.freebsd.org/changeset/base/263041 Log: MFV of 263039, tzdata2014a: - Fix historical info about asia/Zion, Ukraine - Fiji starts DST at 02:00 instead of 03:00 - Turkey will move to DST at 31 March this year. Modified: head/contrib/tzdata/asia head/contrib/tzdata/australasia head/contrib/tzdata/europe head/contrib/tzdata/northamerica head/contrib/tzdata/southamerica Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/asia ============================================================================== --- head/contrib/tzdata/asia Tue Mar 11 20:30:30 2014 (r263040) +++ head/contrib/tzdata/asia Tue Mar 11 20:32:23 2014 (r263041) @@ -1090,8 +1090,13 @@ Rule Zion 1986 only - May 18 0:00 1:00 D Rule Zion 1986 only - Sep 7 0:00 0 S Rule Zion 1987 only - Apr 15 0:00 1:00 D Rule Zion 1987 only - Sep 13 0:00 0 S -Rule Zion 1988 only - Apr 9 0:00 1:00 D -Rule Zion 1988 only - Sep 3 0:00 0 S + +# From Avigdor Finkelstein (2014-03-05): +# I check the Parliament (Knesset) records and there it's stated that the +# [1988] transition should take place on Saturday night, when the Sabbath +# ends and changes to Sunday. +Rule Zion 1988 only - Apr 10 0:00 1:00 D +Rule Zion 1988 only - Sep 4 0:00 0 S # From Ephraim Silverberg # (1997-03-04, 1998-03-16, 1998-12-28, 2000-01-17, 2000-07-25, 2004-12-22, Modified: head/contrib/tzdata/australasia ============================================================================== --- head/contrib/tzdata/australasia Tue Mar 11 20:30:30 2014 (r263040) +++ head/contrib/tzdata/australasia Tue Mar 11 20:32:23 2014 (r263041) @@ -354,16 +354,18 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=6702&catid=71&Itemid=155 # From the Fijian Government Media Center (2013-08-30) via David Wheeler: -# Fiji will start daylight savings on Sunday 27th October, 2013 and end at 3am -# on Sunday 19th January, 2014.... move clocks forward by one hour from 2am +# Fiji will start daylight savings on Sunday 27th October, 2013 ... +# move clocks forward by one hour from 2am # http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-27th-OCTOBER-201.aspx -# -# From Paul Eggert (2013-09-09): + +# From Steffen Thorsen (2013-01-10): +# Fiji will end DST on 2014-01-19 02:00: +# http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVINGS-TO-END-THIS-MONTH-%281%29.aspx + +# From Paul Eggert (2014-01-10): # For now, guess that Fiji springs forward the Sunday before the fourth -# Monday in October. This matches both recent practice and -# timeanddate.com's current spring-forward prediction. -# For the January 2014 transition we guessed right while timeanddate.com -# guessed wrong, so leave the fall-back prediction alone. +# Monday in October, and springs back the penultimate Sunday in January. +# This is ad hoc, but matches recent practice. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 S @@ -372,7 +374,8 @@ Rule Fiji 2009 only - Nov 29 2:00 1:00 S Rule Fiji 2010 only - Mar lastSun 3:00 0 - Rule Fiji 2010 max - Oct Sun>=21 2:00 1:00 S Rule Fiji 2011 only - Mar Sun>=1 3:00 0 - -Rule Fiji 2012 max - Jan Sun>=18 3:00 0 - +Rule Fiji 2012 2013 - Jan Sun>=18 3:00 0 - +Rule Fiji 2014 max - Jan Sun>=18 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji FJ%sT # Fiji Time Modified: head/contrib/tzdata/europe ============================================================================== --- head/contrib/tzdata/europe Tue Mar 11 20:30:30 2014 (r263040) +++ head/contrib/tzdata/europe Tue Mar 11 20:32:23 2014 (r263041) @@ -2745,14 +2745,18 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Ju # According to the articles linked below, Turkey will change into summer # time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27. # This change is due to a nationwide exam on 27th. -# -# # http://www.worldbulletin.net/?aType=haber&ArticleID=70872 -# # Turkish: -# # http://www.hurriyet.com.tr/ekonomi/17230464.asp?gid=373 -# + +# From Faruk Pasin (2014-02-14): +# The DST for Turkey has been changed for this year because of the +# Turkish Local election.... +# http://www.sabah.com.tr/Ekonomi/2014/02/12/yaz-saatinde-onemli-degisiklik +# ... so Turkey will move clocks forward one hour on March 31 at 3:00 a.m. +# From Paul Eggert (2014-02-17): +# Here is an English-language source: +# http://www.worldbulletin.net/turkey/129016/turkey-switches-to-daylight-saving-time-march-31 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S @@ -2821,6 +2825,8 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880 2:00 Turkey EE%sT 2007 2:00 EU EE%sT 2011 Mar 27 1:00u 2:00 - EET 2011 Mar 28 1:00u + 2:00 EU EE%sT 2014 Mar 30 1:00u + 2:00 - EET 2014 Mar 31 1:00u 2:00 EU EE%sT Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. @@ -2842,19 +2848,13 @@ Link Europe/Istanbul Asia/Istanbul # Ist # approval from 266 deputies. # # Ukraine abolishes transter back to the winter time (in Russian) -# # http://news.mail.ru/politics/6861560/ -# # # The Ukrainians will no longer change the clock (in Russian) -# # http://www.segodnya.ua/news/14290482.html -# # # Deputies cancelled the winter time (in Russian) -# # http://www.pravda.com.ua/rus/news/2011/09/20/6600616/ -# # # From Philip Pizzey (2011-10-18): # Today my Ukrainian colleagues have informed me that the @@ -2865,18 +2865,39 @@ Link Europe/Istanbul Asia/Istanbul # Ist # As far as I understand, the recent change to the Ukrainian time zone # (Europe/Kiev) to introduce permanent daylight saving time (similar # to Russia) was reverted today: -# -# # http://portal.rada.gov.ua/rada/control/en/publish/article/info_left?art_id=287324&cat_id=105995 -# # # Also reported by Alexander Bokovoy (2011-10-18) who also noted: # The law documents themselves are at -# -# # http://w1.c1.rada.gov.ua/pls/zweb_n/webproc4_1?id=&pf3511=41484 -# +# From Vladimir in Moscow via Alois Treindl re Kiev time 1991/2 (2014-02-28): +# First in Ukraine they changed Time zone from UTC+3 to UTC+2 with DST: +# 03 25 1990 02:00 -03.00 1 Time Zone 3 with DST +# 07 01 1990 02:00 -02.00 1 Time Zone 2 with DST +# * Ukrainian Government's Resolution of 18.06.1990, No. 134. +# http://search.ligazakon.ua/l_doc2.nsf/link1/T001500.html +# +# They did not end DST in September, 1990 (according to the law, +# "summer time" was still in action): +# 09 30 1990 03:00 -02.00 1 Time Zone 2 with DST +# * Ukrainian Government's Resolution of 21.09.1990, No. 272. +# http://search.ligazakon.ua/l_doc2.nsf/link1/KP900272.html +# +# Again no change in March, 1991 ("summer time" in action): +# 03 31 1991 02:00 -02.00 1 Time Zone 2 with DST +# +# DST ended in September 1991 ("summer time" ended): +# 09 29 1991 03:00 -02.00 0 Time Zone 2, no DST +# * Ukrainian Government's Resolution of 25.09.1991, No. 225. +# http://www.uazakon.com/documents/date_21/pg_iwgdoc.htm +# This is an answer. +# +# Since 1992 they had normal DST procedure: +# 03 29 1992 02:00 -02.00 1 DST started +# 09 27 1992 03:00 -02.00 0 DST ended +# * Ukrainian Government's Resolution of 20.03.1992, No. 139. +# http://www.uazakon.com/documents/date_8u/pg_grcasa.htm # Zone NAME GMTOFF RULES FORMAT [UNTIL] # Most of Ukraine since 1970 has been like Kiev. @@ -2887,9 +2908,8 @@ Zone Europe/Kiev 2:02:04 - LMT 1880 2:00 - EET 1930 Jun 21 3:00 - MSK 1941 Sep 20 1:00 C-Eur CE%sT 1943 Nov 6 - 3:00 Russia MSK/MSD 1990 - 3:00 - MSK 1990 Jul 1 2:00 - 2:00 - EET 1992 + 3:00 Russia MSK/MSD 1990 Jul 1 2:00 + 2:00 1:00 EEST 1991 Sep 29 3:00 2:00 E-Eur EE%sT 1995 2:00 EU EE%sT # Ruthenia used CET 1990/1991. Modified: head/contrib/tzdata/northamerica ============================================================================== --- head/contrib/tzdata/northamerica Tue Mar 11 20:30:30 2014 (r263040) +++ head/contrib/tzdata/northamerica Tue Mar 11 20:32:23 2014 (r263041) @@ -391,9 +391,10 @@ Zone America/Denver -6:59:56 - LMT 1883 # US Pacific time, represented by Los Angeles # # California, northern Idaho (Benewah, Bonner, Boundary, Clearwater, -# Idaho, Kootenai, Latah, Lewis, Nez Perce, and Shoshone counties, -# and the northern three-quarters of Idaho county), -# most of Nevada, most of Oregon, and Washington +# Kootenai, Latah, Lewis, Nez Perce, and Shoshone counties, Idaho county +# north of the Salmon River, and the towns of Burgdorf and Warren), +# Nevada (except West Wendover), Oregon (except the northern 3/4 of +# Malheur county), and Washington # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER Rule CA 1948 only - Mar 14 2:00 1:00 D Modified: head/contrib/tzdata/southamerica ============================================================================== --- head/contrib/tzdata/southamerica Tue Mar 11 20:30:30 2014 (r263040) +++ head/contrib/tzdata/southamerica Tue Mar 11 20:32:23 2014 (r263041) @@ -1275,6 +1275,13 @@ Zone America/Rio_Branco -4:31:12 - LMT 1 # start date is 2013-09-08 00:00.... # http://www.gob.cl/informa/2013/02/15/gobierno-anuncia-fechas-de-cambio-de-hora-para-el-ano-2013.htm +# From Jose Miguel Garrido (2014-02-19): +# Today appeared in the Diario Oficial a decree amending the time change +# dates to 2014. +# DST End: last Saturday of April 2014 (Sun 27 Apr 2014 03:00 UTC) +# DST Start: first Saturday of September 2014 (Sun 07 Sep 2014 04:00 UTC) +# http://www.diariooficial.interior.gob.cl//media/2014/02/19/do-20140219.pdf + # NOTE: ChileAQ rules for Antarctic bases are stored separately in the # 'antarctica' file. @@ -1608,6 +1615,9 @@ Rule Para 2010 2012 - Apr Sun>=8 0:00 0 # From Carlos Raul Perasso (2013-03-15): # The change in Paraguay is now final. Decree number 10780 # http://www.presidencia.gov.py/uploads/pdf/presidencia-3b86ff4b691c79d4f5927ca964922ec74772ce857c02ca054a52a37b49afc7fb.pdf +# From Carlos Raul Perasso (2014-02-28): +# Decree 1264 can be found at: +# http://www.presidencia.gov.py/archivos/documentos/DECRETO1264_ey9r8zai.pdf Rule Para 2013 max - Mar Sun>=22 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1666,18 +1676,19 @@ Zone America/Paramaribo -3:40:40 - LMT 1 Zone America/Port_of_Spain -4:06:04 - LMT 1912 Mar 2 -4:00 - AST +# These all agree with Trinidad and Tobago since 1970. Link America/Port_of_Spain America/Anguilla Link America/Port_of_Spain America/Dominica Link America/Port_of_Spain America/Grenada Link America/Port_of_Spain America/Guadeloupe -Link America/Port_of_Spain America/Marigot +Link America/Port_of_Spain America/Marigot # St Martin (French part) Link America/Port_of_Spain America/Montserrat Link America/Port_of_Spain America/St_Barthelemy -Link America/Port_of_Spain America/St_Kitts +Link America/Port_of_Spain America/St_Kitts # St Kitts & Nevis Link America/Port_of_Spain America/St_Lucia -Link America/Port_of_Spain America/St_Thomas +Link America/Port_of_Spain America/St_Thomas # Virgin Islands (US) Link America/Port_of_Spain America/St_Vincent -Link America/Port_of_Spain America/Tortola +Link America/Port_of_Spain America/Tortola # Virgin Islands (UK) # Uruguay # From Paul Eggert (1993-11-18): From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 21:11:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9B41E8F; Tue, 11 Mar 2014 21:11:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A6B87293; Tue, 11 Mar 2014 21:11:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BLBh1D091474; Tue, 11 Mar 2014 21:11:43 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BLBhQ1091473; Tue, 11 Mar 2014 21:11:43 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403112111.s2BLBhQ1091473@svn.freebsd.org> From: Dimitry Andric Date: Tue, 11 Mar 2014 21:11:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263048 - head/contrib/llvm/tools/clang/tools/driver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 21:11:43 -0000 Author: dim Date: Tue Mar 11 21:11:43 2014 New Revision: 263048 URL: http://svnweb.freebsd.org/changeset/base/263048 Log: Repair recognition of "CC" as an alias for the C++ compiler, since it was silently broken by upstream for a Windows-specific use-case. Apparently some versions of CMake still rely on this archaic feature... Reported by: rakuco MFC after: 3 days X-MFC-With: r261991 Modified: head/contrib/llvm/tools/clang/tools/driver/driver.cpp Modified: head/contrib/llvm/tools/clang/tools/driver/driver.cpp ============================================================================== --- head/contrib/llvm/tools/clang/tools/driver/driver.cpp Tue Mar 11 21:06:17 2014 (r263047) +++ head/contrib/llvm/tools/clang/tools/driver/driver.cpp Tue Mar 11 21:11:43 2014 (r263048) @@ -229,8 +229,10 @@ static void ParseProgName(SmallVectorImp { "++", "--driver-mode=g++" }, }; std::string ProgName(llvm::sys::path::stem(ArgVector[0])); +#ifdef _WIN32 std::transform(ProgName.begin(), ProgName.end(), ProgName.begin(), toLowercase); +#endif StringRef ProgNameRef(ProgName); StringRef Prefix; From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 21:43:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40875ABA; Tue, 11 Mar 2014 21:43:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2CB747A4; Tue, 11 Mar 2014 21:43:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BLhB0h004802; Tue, 11 Mar 2014 21:43:11 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BLhBcH004801; Tue, 11 Mar 2014 21:43:11 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403112143.s2BLhBcH004801@svn.freebsd.org> From: Dimitry Andric Date: Tue, 11 Mar 2014 21:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263049 - head/contrib/llvm/tools/clang/lib/Frontend X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 21:43:11 -0000 Author: dim Date: Tue Mar 11 21:43:10 2014 New Revision: 263049 URL: http://svnweb.freebsd.org/changeset/base/263049 Log: Garbage collect the old way of adding the libstdc++ include directories in clang's InitHeaderSearch.cpp. This has been superseded by David Chisnall's commit in r255321. Moreover, if libc++ is used, the libstdc++ include directories should not be in the search path at all. These directories are now only used if you pass -stdlib=libstdc++. MFC after: 3 days X-MFC-With: r261991 Modified: head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp Modified: head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp Tue Mar 11 21:11:43 2014 (r263048) +++ head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp Tue Mar 11 21:43:10 2014 (r263049) @@ -427,14 +427,6 @@ AddDefaultCPlusPlusIncludePaths(const ll else AddPath("/usr/include/c++/4.4", CXXSystem, false); break; - case llvm::Triple::FreeBSD: - // FreeBSD 8.0 - // FreeBSD 7.3 - AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2", - "", "", "", triple); - AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2/backward", - "", "", "", triple); - break; case llvm::Triple::OpenBSD: { std::string t = triple.getTriple(); if (t.substr(0, 6) == "x86_64") From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 22:02:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9441664F; Tue, 11 Mar 2014 22:02:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6771A968; Tue, 11 Mar 2014 22:02:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BM2oSg013608; Tue, 11 Mar 2014 22:02:50 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BM2nFa013603; Tue, 11 Mar 2014 22:02:49 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403112202.s2BM2nFa013603@svn.freebsd.org> From: Ian Lepore Date: Tue, 11 Mar 2014 22:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263052 - in head/sys/boot/uboot: common lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 22:02:50 -0000 Author: ian Date: Tue Mar 11 22:02:49 2014 New Revision: 263052 URL: http://svnweb.freebsd.org/changeset/base/263052 Log: Enhance the mechanism that lets you configure the ubldr boot device by setting the u-boot environment variable loaderdev=. It used to accept only 'disk' or 'net'. Now it allows specification of unit, slice, and partition as well. In addition to the generic 'disk' it also accepts specific storage device types such as 'mmc' or 'sata'. If there isn't a loaderdev env var, the historical behavior is maintained. It will use the first storage device it finds, or a network device if no working storage device exists. 99% of the work on this was done by Patrick Kelsey, but I made some changes, so if anything goes wrong, blame me. Submitted by: Patrick Kelsey Modified: head/sys/boot/uboot/common/main.c head/sys/boot/uboot/lib/api_public.h head/sys/boot/uboot/lib/disk.c head/sys/boot/uboot/lib/glue.c head/sys/boot/uboot/lib/libuboot.h Modified: head/sys/boot/uboot/common/main.c ============================================================================== --- head/sys/boot/uboot/common/main.c Tue Mar 11 21:48:30 2014 (r263051) +++ head/sys/boot/uboot/common/main.c Tue Mar 11 22:02:49 2014 (r263052) @@ -36,10 +36,27 @@ __FBSDID("$FreeBSD$"); #include "glue.h" #include "libuboot.h" +#ifndef nitems +#define nitems(x) (sizeof((x)) / sizeof((x)[0])) +#endif + struct uboot_devdesc currdev; struct arch_switch archsw; /* MI/MD interface boundary */ int devs_no; +struct device_type { + const char *name; + int type; +} device_types[] = { + { "disk", DEV_TYP_STOR }, + { "ide", DEV_TYP_STOR | DT_STOR_IDE }, + { "mmc", DEV_TYP_STOR | DT_STOR_MMC }, + { "sata", DEV_TYP_STOR | DT_STOR_SATA }, + { "scsi", DEV_TYP_STOR | DT_STOR_SCSI }, + { "usb", DEV_TYP_STOR | DT_STOR_USB }, + { "net", DEV_TYP_NET } +}; + extern char end[]; extern char bootprog_name[]; extern char bootprog_rev[]; @@ -116,12 +133,242 @@ meminfo(void) } } +static const char * +get_device_type(const char *devstr, int *devtype) +{ + int i; + int namelen; + struct device_type *dt; + + if (devstr) { + for (i = 0; i < nitems(device_types); i++) { + dt = &device_types[i]; + namelen = strlen(dt->name); + if (strncmp(dt->name, devstr, namelen) == 0) { + *devtype = dt->type; + return (devstr + namelen); + } + } + printf("Unknown device type '%s'\n", devstr); + } + + *devtype = -1; + return (NULL); +} + +static const char * +device_typename(int type) +{ + int i; + + for (i = 0; i < nitems(device_types); i++) + if (device_types[i].type == type) + return (device_types[i].name); + + return (""); +} + +/* + * Parse a device string into type, unit, slice and partition numbers. A + * returned value of -1 for type indicates a search should be done for the + * first loadable device, otherwise a returned value of -1 for unit + * indicates a search should be done for the first loadable device of the + * given type. + * + * The returned values for slice and partition are interpreted by + * disk_open(). + * + * Valid device strings: For device types: + * + * DEV_TYP_STOR, DEV_TYP_NET + * DEV_TYP_STOR, DEV_TYP_NET + * : DEV_TYP_STOR, DEV_TYP_NET + * : DEV_TYP_STOR + * :. DEV_TYP_STOR + * :. DEV_TYP_STOR + * + * For valid type names, see the device_types array, above. + * + * Slice numbers are 1-based. 0 is a wildcard. + */ +static void +get_load_device(int *type, int *unit, int *slice, int *partition) +{ + char *devstr; + const char *p; + char *endp; + + devstr = ub_env_get("loaderdev"); + if (devstr == NULL) + devstr = ""; + else + printf("U-Boot setting: loaderdev=%s\n", devstr); + + p = get_device_type(devstr, type); + + *unit = -1; + *slice = 0; + *partition = -1; + + /* + * Empty device string, or unknown device name, or a bare, known + * device name. + */ + if ((*type == -1) || (*p == '\0')) { + return; + } + + /* Malformed unit number. */ + if (!isdigit(*p)) { + *type = -1; + return; + } + + /* Guaranteed to extract a number from the string, as *p is a digit. */ + *unit = strtol(p, &endp, 10); + p = endp; + + /* Known device name with unit number and nothing else. */ + if (*p == '\0') { + return; + } + + /* Device string is malformed beyond unit number. */ + if (*p != ':') { + *type = -1; + *unit = -1; + return; + } + + p++; + + /* No slice and partition specification. */ + if ('\0' == *p ) + return; + + /* Only DEV_TYP_STOR devices can have a slice specification. */ + if (!(*type & DEV_TYP_STOR)) { + *type = -1; + *unit = -1; + return; + } + + *slice = strtoul(p, &endp, 10); + + /* Malformed slice number. */ + if (p == endp) { + *type = -1; + *unit = -1; + *slice = 0; + return; + } + + p = endp; + + /* No partition specification. */ + if (*p == '\0') + return; + + /* Device string is malformed beyond slice number. */ + if (*p != '.') { + *type = -1; + *unit = -1; + *slice = 0; + return; + } + + p++; + + /* No partition specification. */ + if (*p == '\0') + return; + + *partition = strtol(p, &endp, 10); + p = endp; + + /* Full, valid device string. */ + if (*endp == '\0') + return; + + /* Junk beyond partition number. */ + *type = -1; + *unit = -1; + *slice = 0; + *partition = -1; +} + +static int +probe_disks(int load_type, int load_unit, int load_slice, int load_partition) +{ + int i, open_result, unit; + struct open_file f; + + currdev.d_disk.slice = load_slice; + currdev.d_disk.partition = load_partition; + + f.f_devdata = &currdev; + open_result = -1; + + if (load_type == -1) { + printf("Probing all storage devices...\n"); + /* Try each disk in succession until one works. */ + for (currdev.d_unit = 0; currdev.d_unit < UB_MAX_DEV; + currdev.d_unit++) { + printf("Checking unit=%d slice=%d partition=%d...", + currdev.d_unit, currdev.d_disk.slice, + currdev.d_disk.partition); + open_result = devsw[i]->dv_open(&f, &currdev); + if (open_result == 0) { + printf(" good.\n"); + return (0); + } + printf("\n"); + } + return (-1); + } + + if (load_unit == -1) { + printf("Probing all %s devices...\n", device_typename(load_type)); + /* Try each disk of given type in succession until one works. */ + for (unit = 0; unit < UB_MAX_DEV; unit++) { + currdev.d_unit = uboot_diskgetunit(load_type, unit); + if (currdev.d_unit == -1) + break; + printf("Checking unit=%d slice=%d partition=%d...", + currdev.d_unit, currdev.d_disk.slice, + currdev.d_disk.partition); + open_result = devsw[i]->dv_open(&f, &currdev); + if (open_result == 0) { + printf(" good.\n"); + return (0); + } + printf("\n"); + } + return (-1); + } + + if ((currdev.d_unit = uboot_diskgetunit(load_type, load_unit)) != -1) { + printf("Checking unit=%d slice=%d partition=%d...", + currdev.d_unit, currdev.d_disk.slice, + currdev.d_disk.partition); + open_result = devsw[i]->dv_open(&f,&currdev); + if (open_result == 0) { + printf("good.\n"); + return (0); + } + printf("\n"); + } + + printf("Requested disk type/unit not found\n"); + return (-1); +} + int main(void) { struct api_signature *sig = NULL; - int diskdev, i, netdev, usedev; - struct open_file f; + int load_type, load_unit, load_slice, load_partition; + int i; const char * loaderdev; /* @@ -173,50 +420,11 @@ main(void) printf("(%s, %s)\n", bootprog_maker, bootprog_date); meminfo(); + get_load_device(&load_type, &load_unit, &load_slice, &load_partition); + /* - * March through the device switch probing for things -- sort of. - * - * The devsw array will have one or two items in it. If - * LOADER_DISK_SUPPORT is defined the first item will be a disk (which - * may not actually work if u-boot didn't supply one). If - * LOADER_NET_SUPPORT is defined the next item will be a network - * interface. Again it may not actually work at the u-boot level. - * - * The original logic was to always use a disk if it could be - * successfully opened, otherwise use the network interface. Now that - * logic is amended to first check whether the u-boot environment - * contains a loaderdev variable which tells us which device to use. If - * it does, we use it and skip the original (second) loop which "probes" - * for a device. We still loop over the devsw just in case it ever gets - * expanded to hold more than 2 devices (but then unit numbers, which - * don't currently exist, may come into play). If the device named by - * loaderdev isn't found, fall back using to the old "probe" loop. - * - * The original probe loop still effectively behaves as it always has: - * the first usable disk device is choosen, and a network device is used - * only if no disk device is found. The logic has been reworked so that - * it examines (and thus lists) every potential device along the way - * instead of breaking out of the loop when the first device is found. + * March through the device switch probing for things. */ - loaderdev = ub_env_get("loaderdev"); - usedev = -1; - if (loaderdev != NULL) { - for (i = 0; devsw[i] != NULL; i++) { - if (strcmp(loaderdev, devsw[i]->dv_name) == 0) { - if (devsw[i]->dv_init == NULL) - continue; - if ((devsw[i]->dv_init)() != 0) - continue; - usedev = i; - goto have_device; - } - } - printf("U-Boot env contains 'loaderdev=%s', " - "device not found.\n", loaderdev); - } - printf("Probing for bootable devices...\n"); - diskdev = -1; - netdev = -1; for (i = 0; devsw[i] != NULL; i++) { if (devsw[i]->dv_init == NULL) @@ -224,43 +432,33 @@ main(void) if ((devsw[i]->dv_init)() != 0) continue; - printf("Bootable device: %s\n", devsw[i]->dv_name); + printf("Found U-Boot device: %s\n", devsw[i]->dv_name); - if (strncmp(devsw[i]->dv_name, "disk", - strlen(devsw[i]->dv_name)) == 0) { - f.f_devdata = &currdev; - currdev.d_dev = devsw[i]; - currdev.d_type = currdev.d_dev->dv_type; - currdev.d_unit = 0; - currdev.d_disk.slice = 0; - if (devsw[i]->dv_open(&f, &currdev) == 0) { - devsw[i]->dv_close(&f); - if (diskdev == -1) - diskdev = i; - } - } else if (strncmp(devsw[i]->dv_name, "net", - strlen(devsw[i]->dv_name)) == 0) { - if (netdev == -1) - netdev = i; + currdev.d_dev = devsw[i]; + currdev.d_type = currdev.d_dev->dv_type; + currdev.d_unit = 0; + + if ((load_type == -1 || (load_type & DEV_TYP_STOR)) && + strcmp(devsw[i]->dv_name, "disk") == 0) { + if (probe_disks(load_type, load_unit, load_slice, + load_partition) == 0) + break; } - } - - if (diskdev != -1) - usedev = diskdev; - else if (netdev != -1) - usedev = netdev; - else - panic("No bootable devices found!\n"); -have_device: - - currdev.d_dev = devsw[usedev]; - currdev.d_type = devsw[usedev]->dv_type; - currdev.d_unit = 0; - if (currdev.d_type == DEV_TYP_STOR) - currdev.d_disk.slice = 0; + if (load_type == -1 || ((load_type & DEV_TYP_NET) && + strcmp(devsw[i]->dv_name, "net") == 0)) + break; + } - printf("Current device: %s\n", currdev.d_dev->dv_name); + /* + * If we couldn't find a boot device, return an error to u-boot. + * U-boot may be running a boot script that can try something different + * so returning an error is better than forcing a reboot. + */ + if (devsw[i] == NULL) { + printf("No boot device found!\n"); + return (0xbadef1ce); + } env_setenv("currdev", EV_VOLATILE, uboot_fmtdev(&currdev), uboot_setcurrdev, env_nounset); Modified: head/sys/boot/uboot/lib/api_public.h ============================================================================== --- head/sys/boot/uboot/lib/api_public.h Tue Mar 11 21:48:30 2014 (r263051) +++ head/sys/boot/uboot/lib/api_public.h Tue Mar 11 22:02:49 2014 (r263052) @@ -132,7 +132,7 @@ typedef unsigned long lbastart_t; #define DT_STOR_SCSI 0x0020 #define DT_STOR_USB 0x0040 #define DT_STOR_MMC 0x0080 -#define DT_STOR_NAND 0x0100 +#define DT_STOR_SATA 0x0100 #define DEV_STA_CLOSED 0x0000 /* invalid, closed */ #define DEV_STA_OPEN 0x0001 /* open i.e. active */ Modified: head/sys/boot/uboot/lib/disk.c ============================================================================== --- head/sys/boot/uboot/lib/disk.c Tue Mar 11 21:48:30 2014 (r263051) +++ head/sys/boot/uboot/lib/disk.c Tue Mar 11 22:02:49 2014 (r263052) @@ -278,3 +278,26 @@ stor_ioctl(struct open_file *f, u_long c return (0); } + +/* + * Return the device unit number for the given type and type-relative unit + * number. + */ +int +uboot_diskgetunit(int type, int type_unit) +{ + int local_type_unit; + int i; + + local_type_unit = 0; + for (i = 0; i < stor_info_no; i++) { + if ((stor_info[i].type & type) == type) { + if (local_type_unit == type_unit) { + return (i); + } + local_type_unit++; + } + } + + return (-1); +} Modified: head/sys/boot/uboot/lib/glue.c ============================================================================== --- head/sys/boot/uboot/lib/glue.c Tue Mar 11 21:48:30 2014 (r263051) +++ head/sys/boot/uboot/lib/glue.c Tue Mar 11 22:02:49 2014 (r263052) @@ -404,8 +404,8 @@ ub_stor_type(int type) if (type & DT_STOR_MMC) return ("MMC"); - if (type & DT_STOR_NAND) - return ("NAND"); + if (type & DT_STOR_SATA) + return ("SATA"); return ("Unknown"); } Modified: head/sys/boot/uboot/lib/libuboot.h ============================================================================== --- head/sys/boot/uboot/lib/libuboot.h Tue Mar 11 21:48:30 2014 (r263051) +++ head/sys/boot/uboot/lib/libuboot.h Tue Mar 11 22:02:49 2014 (r263052) @@ -32,9 +32,9 @@ struct uboot_devdesc struct devsw *d_dev; int d_type; int d_unit; + void *d_opendata; union { struct { - void *data; int slice; int partition; off_t offset; @@ -70,6 +70,8 @@ extern struct file_format uboot_elf; void reboot(void); +int uboot_diskgetunit(int type, int type_unit); + #if defined(LOADER_FDT_SUPPORT) extern int fdt_setup_fdtp(); extern int fdt_copy(vm_offset_t); From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 22:12:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00CA2D59; Tue, 11 Mar 2014 22:12:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E2048A6D; Tue, 11 Mar 2014 22:12:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BMCCac018136; Tue, 11 Mar 2014 22:12:12 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BMCC8G018135; Tue, 11 Mar 2014 22:12:12 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201403112212.s2BMCC8G018135@svn.freebsd.org> From: Tycho Nightingale Date: Tue, 11 Mar 2014 22:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263054 - head/sys/amd64/vmm/io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 22:12:13 -0000 Author: tychon Date: Tue Mar 11 22:12:12 2014 New Revision: 263054 URL: http://svnweb.freebsd.org/changeset/base/263054 Log: Don't try to return a vector to a caller that only cares if a vector is pending or not. Approved by: neel (co-mentor) Modified: head/sys/amd64/vmm/io/vlapic.c Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Tue Mar 11 22:11:45 2014 (r263053) +++ head/sys/amd64/vmm/io/vlapic.c Tue Mar 11 22:12:12 2014 (r263054) @@ -1053,8 +1053,12 @@ vlapic_pending_intr(struct vlapic *vlapi int idx, i, bitpos, vector; uint32_t *irrptr, val; - if (vlapic->extint_pending) - return (vatpic_pending_intr(vlapic->vm, vecptr)); + if (vlapic->extint_pending) { + if (vecptr == NULL) + return (1); + else + return (vatpic_pending_intr(vlapic->vm, vecptr)); + } if (vlapic->ops.pending_intr) return ((*vlapic->ops.pending_intr)(vlapic, vecptr)); From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 22:41:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DC2F761; Tue, 11 Mar 2014 22:41:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3E8D2C96; Tue, 11 Mar 2014 22:41:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BMfZwQ028464; Tue, 11 Mar 2014 22:41:35 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BMfZXP028463; Tue, 11 Mar 2014 22:41:35 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403112241.s2BMfZXP028463@svn.freebsd.org> From: Ian Lepore Date: Tue, 11 Mar 2014 22:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263056 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 22:41:35 -0000 Author: ian Date: Tue Mar 11 22:41:34 2014 New Revision: 263056 URL: http://svnweb.freebsd.org/changeset/base/263056 Log: Remove the unreferenced DATA() macro. That leaves only GET_CURTHREAD_PTR() which was added by cognet in 2012, so remove the no-longer-applicable license stuff that referred to all the old contents, and put in a standard 2-clause BSD license (to cover the 6 lines of useful code left in here). Modified: head/sys/arm/include/asmacros.h Modified: head/sys/arm/include/asmacros.h ============================================================================== --- head/sys/arm/include/asmacros.h Tue Mar 11 22:34:28 2014 (r263055) +++ head/sys/arm/include/asmacros.h Tue Mar 11 22:41:34 2014 (r263056) @@ -1,12 +1,7 @@ -/* $NetBSD: frame.h,v 1.6 2003/10/05 19:44:58 matt Exp $ */ - /*- - * Copyright (c) 1994-1997 Mark Brinicombe. - * Copyright (c) 1994 Brini. + * Copyright (c) 2012 Olivier Houchard * All rights reserved. * - * This code is derived from software written for Brini by Mark Brinicombe - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -15,20 +10,14 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Brini. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. * - * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF @@ -47,13 +36,6 @@ #ifdef LOCORE #include "opt_global.h" -#define DATA(name) \ - .data ; \ - _ALIGN_DATA ; \ - .globl name ; \ - .type name, %object ; \ -name: - #ifdef _ARM_ARCH_6 #define GET_CURTHREAD_PTR(tmp) \ mrc p15, 0, tmp, c13, c0, 4 From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 22:47:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 176198F9; Tue, 11 Mar 2014 22:47:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE2AAD33; Tue, 11 Mar 2014 22:47:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BMl5qq030826; Tue, 11 Mar 2014 22:47:05 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BMl5FM030820; Tue, 11 Mar 2014 22:47:05 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403112247.s2BMl5FM030820@svn.freebsd.org> From: Ian Lepore Date: Tue, 11 Mar 2014 22:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263057 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 22:47:06 -0000 Author: ian Date: Tue Mar 11 22:47:04 2014 New Revision: 263057 URL: http://svnweb.freebsd.org/changeset/base/263057 Log: Remove #include from files that don't need it. Modified: head/sys/arm/arm/copystr.S head/sys/arm/arm/fusu.S head/sys/arm/arm/support.S head/sys/arm/include/sysarch.h Modified: head/sys/arm/arm/copystr.S ============================================================================== --- head/sys/arm/arm/copystr.S Tue Mar 11 22:41:34 2014 (r263056) +++ head/sys/arm/arm/copystr.S Tue Mar 11 22:47:04 2014 (r263057) @@ -42,7 +42,6 @@ #include "assym.s" #include #include -#include __FBSDID("$FreeBSD$"); #include Modified: head/sys/arm/arm/fusu.S ============================================================================== --- head/sys/arm/arm/fusu.S Tue Mar 11 22:41:34 2014 (r263056) +++ head/sys/arm/arm/fusu.S Tue Mar 11 22:47:04 2014 (r263057) @@ -34,7 +34,6 @@ */ #include -#include #include #include "assym.s" __FBSDID("$FreeBSD$"); Modified: head/sys/arm/arm/support.S ============================================================================== --- head/sys/arm/arm/support.S Tue Mar 11 22:41:34 2014 (r263056) +++ head/sys/arm/arm/support.S Tue Mar 11 22:47:04 2014 (r263057) @@ -87,7 +87,6 @@ */ #include -#include __FBSDID("$FreeBSD$"); #include "assym.s" Modified: head/sys/arm/include/sysarch.h ============================================================================== --- head/sys/arm/include/sysarch.h Tue Mar 11 22:41:34 2014 (r263056) +++ head/sys/arm/include/sysarch.h Tue Mar 11 22:47:04 2014 (r263057) @@ -45,7 +45,7 @@ * The cpu_switch() code assumes ARM_RAS_START is ARM_TP_ADDRESS + 4, and * ARM_RAS_END is ARM_TP_ADDRESS + 8, so if that ever changes, be sure to * update the cpu_switch() (and cpu_throw()) code as well. - * In addition, code in arm/include/atomic.h and arm/include/asmacros.h + * In addition, code in arm/include/atomic.h and arm/arm/exception.S * assumes that ARM_RAS_END is at ARM_RAS_START+4, so be sure to update those * if ARM_RAS_END moves in relation to ARM_RAS_START (look for occurrences * of ldr/str rm,[rn, #4]). From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 23:41:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5C9DA42; Tue, 11 Mar 2014 23:41:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C0DD42F7; Tue, 11 Mar 2014 23:41:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BNfbsM054713; Tue, 11 Mar 2014 23:41:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BNfat6054706; Tue, 11 Mar 2014 23:41:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403112341.s2BNfat6054706@svn.freebsd.org> From: Warner Losh Date: Tue, 11 Mar 2014 23:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263059 - in head/sys: amd64/amd64 arm/arm i386/i386 ia64/ia64 mips/mips powerpc/powerpc sparc64/sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 23:41:38 -0000 Author: imp Date: Tue Mar 11 23:41:35 2014 New Revision: 263059 URL: http://svnweb.freebsd.org/changeset/base/263059 Log: Delete stray clause 3 (Advertising clause) and renumber while i'm here. Approved by: alc@ Modified: head/sys/amd64/amd64/uio_machdep.c head/sys/arm/arm/uio_machdep.c head/sys/i386/i386/uio_machdep.c head/sys/ia64/ia64/uio_machdep.c head/sys/mips/mips/uio_machdep.c head/sys/powerpc/powerpc/uio_machdep.c head/sys/sparc64/sparc64/uio_machdep.c Modified: head/sys/amd64/amd64/uio_machdep.c ============================================================================== --- head/sys/amd64/amd64/uio_machdep.c Tue Mar 11 23:04:32 2014 (r263058) +++ head/sys/amd64/amd64/uio_machdep.c Tue Mar 11 23:41:35 2014 (r263059) @@ -16,7 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/arm/arm/uio_machdep.c ============================================================================== --- head/sys/arm/arm/uio_machdep.c Tue Mar 11 23:04:32 2014 (r263058) +++ head/sys/arm/arm/uio_machdep.c Tue Mar 11 23:41:35 2014 (r263059) @@ -16,11 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/i386/i386/uio_machdep.c ============================================================================== --- head/sys/i386/i386/uio_machdep.c Tue Mar 11 23:04:32 2014 (r263058) +++ head/sys/i386/i386/uio_machdep.c Tue Mar 11 23:41:35 2014 (r263059) @@ -16,7 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/ia64/ia64/uio_machdep.c ============================================================================== --- head/sys/ia64/ia64/uio_machdep.c Tue Mar 11 23:04:32 2014 (r263058) +++ head/sys/ia64/ia64/uio_machdep.c Tue Mar 11 23:41:35 2014 (r263059) @@ -16,7 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/mips/mips/uio_machdep.c ============================================================================== --- head/sys/mips/mips/uio_machdep.c Tue Mar 11 23:04:32 2014 (r263058) +++ head/sys/mips/mips/uio_machdep.c Tue Mar 11 23:41:35 2014 (r263059) @@ -16,7 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/powerpc/powerpc/uio_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/uio_machdep.c Tue Mar 11 23:04:32 2014 (r263058) +++ head/sys/powerpc/powerpc/uio_machdep.c Tue Mar 11 23:41:35 2014 (r263059) @@ -16,7 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/sparc64/sparc64/uio_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/uio_machdep.c Tue Mar 11 23:04:32 2014 (r263058) +++ head/sys/sparc64/sparc64/uio_machdep.c Tue Mar 11 23:41:35 2014 (r263059) @@ -16,7 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 01:28:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AC6A2E6; Wed, 12 Mar 2014 01:28:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 27E4EDF0; Wed, 12 Mar 2014 01:28:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2C1SM63097010; Wed, 12 Mar 2014 01:28:22 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2C1SMlY097009; Wed, 12 Mar 2014 01:28:22 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201403120128.s2C1SMlY097009@svn.freebsd.org> From: Kirk McKusick Date: Wed, 12 Mar 2014 01:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263062 - head/sbin/fsck_ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 01:28:22 -0000 Author: mckusick Date: Wed Mar 12 01:28:21 2014 New Revision: 263062 URL: http://svnweb.freebsd.org/changeset/base/263062 Log: Avoid segment fault when attempting to clean up cylinder group buffer cache. PR: 187221 Submitted by: Petr Lampa Obtained from: Petr Lampa MFC after: 1 week Modified: head/sbin/fsck_ffs/fsutil.c Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Tue Mar 11 23:54:13 2014 (r263061) +++ head/sbin/fsck_ffs/fsutil.c Wed Mar 12 01:28:21 2014 (r263062) @@ -436,13 +436,15 @@ ckfini(int markclean) } if (numbufs != cnt) errx(EEXIT, "panic: lost %d buffers", numbufs - cnt); - for (cnt = 0; cnt < sblock.fs_ncg; cnt++) { - if (cgbufs[cnt].b_un.b_cg == NULL) - continue; - flush(fswritefd, &cgbufs[cnt]); - free(cgbufs[cnt].b_un.b_cg); + if (cgbufs != NULL) { + for (cnt = 0; cnt < sblock.fs_ncg; cnt++) { + if (cgbufs[cnt].b_un.b_cg == NULL) + continue; + flush(fswritefd, &cgbufs[cnt]); + free(cgbufs[cnt].b_un.b_cg); + } + free(cgbufs); } - free(cgbufs); pbp = pdirbp = (struct bufarea *)0; if (cursnapshot == 0 && sblock.fs_clean != markclean) { if ((sblock.fs_clean = markclean) != 0) { From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 08:54:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09B33A20; Wed, 12 Mar 2014 08:54:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EA69CD69; Wed, 12 Mar 2014 08:54:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2C8sTgf079977; Wed, 12 Mar 2014 08:54:29 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2C8sTCx079976; Wed, 12 Mar 2014 08:54:29 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201403120854.s2C8sTCx079976@svn.freebsd.org> From: Poul-Henning Kamp Date: Wed, 12 Mar 2014 08:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263077 - head/usr.bin/ministat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 08:54:30 -0000 Author: phk Date: Wed Mar 12 08:54:29 2014 New Revision: 263077 URL: http://svnweb.freebsd.org/changeset/base/263077 Log: Make ministat CRNL tolerant by stripping all isspace() from the tail end of input lines. Modified: head/usr.bin/ministat/ministat.c Modified: head/usr.bin/ministat/ministat.c ============================================================================== --- head/usr.bin/ministat/ministat.c Wed Mar 12 08:32:01 2014 (r263076) +++ head/usr.bin/ministat/ministat.c Wed Mar 12 08:54:29 2014 (r263077) @@ -13,6 +13,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -475,8 +476,8 @@ ReadSet(const char *n, int column, const line++; i = strlen(buf); - if (buf[i-1] == '\n') - buf[i-1] = '\0'; + while (i > 0 && isspace(buf[i - 1])) + buf[--i] = '\0'; for (i = 1, t = strtok(buf, delim); t != NULL && *t != '#'; i++, t = strtok(NULL, delim)) { From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 10:23:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1937D6A; Wed, 12 Mar 2014 10:23:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DEBAC896; Wed, 12 Mar 2014 10:23:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2CANpYv016896; Wed, 12 Mar 2014 10:23:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2CANpqq016895; Wed, 12 Mar 2014 10:23:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403121023.s2CANpqq016895@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 12 Mar 2014 10:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263079 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 10:23:52 -0000 Author: kib Date: Wed Mar 12 10:23:51 2014 New Revision: 263079 URL: http://svnweb.freebsd.org/changeset/base/263079 Log: The auio structure is only initialized when the vnode is symlink, avoid reading from it otherwise. Submitted by: Conrad Meyer MFC after: 1 week Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Wed Mar 12 09:08:51 2014 (r263078) +++ head/sys/kern/vfs_syscalls.c Wed Mar 12 10:23:51 2014 (r263079) @@ -2553,9 +2553,9 @@ kern_readlinkat(struct thread *td, int f auio.uio_td = td; auio.uio_resid = count; error = VOP_READLINK(vp, &auio, td->td_ucred); + td->td_retval[0] = count - auio.uio_resid; } vput(vp); - td->td_retval[0] = count - auio.uio_resid; return (error); } From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 10:25:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7ECFF82; Wed, 12 Mar 2014 10:25:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A5D489E; Wed, 12 Mar 2014 10:25:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2CAPRKd017242; Wed, 12 Mar 2014 10:25:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2CAPQRl017239; Wed, 12 Mar 2014 10:25:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403121025.s2CAPQRl017239@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 12 Mar 2014 10:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263080 - in head/sys: dev/cpuctl dev/hwpmc kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 10:25:27 -0000 Author: kib Date: Wed Mar 12 10:25:26 2014 New Revision: 263080 URL: http://svnweb.freebsd.org/changeset/base/263080 Log: Use correct types for sizeof() in the calculations for the malloc(9) sizes [1]. While there, remove unneeded checks for failed allocations with M_WAITOK flag. Submitted by: Conrad Meyer [1] MFC after: 1 week Modified: head/sys/dev/cpuctl/cpuctl.c head/sys/dev/hwpmc/hwpmc_piv.c head/sys/kern/kern_linker.c Modified: head/sys/dev/cpuctl/cpuctl.c ============================================================================== --- head/sys/dev/cpuctl/cpuctl.c Wed Mar 12 10:23:51 2014 (r263079) +++ head/sys/dev/cpuctl/cpuctl.c Wed Mar 12 10:25:26 2014 (r263080) @@ -510,13 +510,8 @@ cpuctl_modevent(module_t mod __unused, i } if (bootverbose) printf("cpuctl: access to MSR registers/cpuid info.\n"); - cpuctl_devs = (struct cdev **)malloc(sizeof(void *) * mp_ncpus, - M_CPUCTL, M_WAITOK | M_ZERO); - if (cpuctl_devs == NULL) { - DPRINTF("[cpuctl,%d]: cannot allocate memory\n", - __LINE__); - return (ENOMEM); - } + cpuctl_devs = malloc(sizeof(*cpuctl_devs) * mp_ncpus, M_CPUCTL, + M_WAITOK | M_ZERO); for (cpu = 0; cpu < mp_ncpus; cpu++) if (cpu_enabled(cpu)) cpuctl_devs[cpu] = make_dev(&cpuctl_cdevsw, cpu, Modified: head/sys/dev/hwpmc/hwpmc_piv.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_piv.c Wed Mar 12 10:23:51 2014 (r263079) +++ head/sys/dev/hwpmc/hwpmc_piv.c Wed Mar 12 10:25:26 2014 (r263080) @@ -1620,8 +1620,7 @@ pmc_p4_initialize(struct pmc_mdep *md, i PMCDBG(MDP,INI,1, "%s", "p4-initialize"); /* Allocate space for pointers to per-cpu descriptors. */ - p4_pcpu = malloc(sizeof(struct p4_cpu **) * ncpus, M_PMC, - M_ZERO|M_WAITOK); + p4_pcpu = malloc(sizeof(*p4_pcpu) * ncpus, M_PMC, M_ZERO | M_WAITOK); /* Fill in the class dependent descriptor. */ pcd = &md->pmd_classdep[PMC_MDEP_CLASS_INDEX_P4]; Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Wed Mar 12 10:23:51 2014 (r263079) +++ head/sys/kern/kern_linker.c Wed Mar 12 10:25:26 2014 (r263080) @@ -725,14 +725,11 @@ linker_file_add_dependency(linker_file_t linker_file_t *newdeps; sx_assert(&kld_sx, SA_XLOCKED); - newdeps = malloc((file->ndeps + 1) * sizeof(linker_file_t *), - M_LINKER, M_WAITOK | M_ZERO); - if (newdeps == NULL) - return (ENOMEM); + newdeps = malloc((file->ndeps + 1) * sizeof(*newdeps), M_LINKER, + M_WAITOK | M_ZERO); if (file->deps) { - bcopy(file->deps, newdeps, - file->ndeps * sizeof(linker_file_t *)); + bcopy(file->deps, newdeps, file->ndeps * sizeof(*newdeps)); free(file->deps, M_LINKER); } file->deps = newdeps; From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 10:35:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2C163DB; Wed, 12 Mar 2014 10:35:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BC993986; Wed, 12 Mar 2014 10:35:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2CAZNHO021349; Wed, 12 Mar 2014 10:35:23 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2CAZN6U021346; Wed, 12 Mar 2014 10:35:23 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403121035.s2CAZN6U021346@svn.freebsd.org> From: Julio Merino Date: Wed, 12 Mar 2014 10:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263081 - head/tools/regression/usr.bin/lastcomm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 10:35:23 -0000 Author: jmmv Date: Wed Mar 12 10:35:22 2014 New Revision: 263081 URL: http://svnweb.freebsd.org/changeset/base/263081 Log: Fix lastcomm tests under amd64. Force the use of TZ=UTC and adjust data files accordingly. I have no means to verify that the data files for the other architectures are valid. Modified: head/tools/regression/usr.bin/lastcomm/regress.t head/tools/regression/usr.bin/lastcomm/v1-amd64.out head/tools/regression/usr.bin/lastcomm/v2-amd64.out Modified: head/tools/regression/usr.bin/lastcomm/regress.t ============================================================================== --- head/tools/regression/usr.bin/lastcomm/regress.t Wed Mar 12 10:25:26 2014 (r263080) +++ head/tools/regression/usr.bin/lastcomm/regress.t Wed Mar 12 10:35:22 2014 (r263081) @@ -6,6 +6,8 @@ DIR=`dirname $0` ARCH=`uname -m` +TZ=UTC; export TZ + check() { NUM=$1 Modified: head/tools/regression/usr.bin/lastcomm/v1-amd64.out ============================================================================== --- head/tools/regression/usr.bin/lastcomm/v1-amd64.out Wed Mar 12 10:25:26 2014 (r263080) +++ head/tools/regression/usr.bin/lastcomm/v1-amd64.out Wed Mar 12 10:35:22 2014 (r263081) @@ -1,28 +1,28 @@ -core -FDX root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -core -DX root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -cc - root 0.000 secs 0.000 us 0.000 sy 0.016 es Wed May 16 06:44 -ld - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -as - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -cc1 - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time -F root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -ln - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time -F root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -ln - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time -F root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -ln - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 0.234 es Wed May 16 06:44 -diff - root 0.203 secs 0.203 us 0.000 sy 0.234 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 0.016 es Wed May 16 06:44 -dd - root 0.016 secs 0.000 us 0.016 sy 0.016 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 3.016 es Wed May 16 06:44 -sleep - root 0.000 secs 0.000 us 0.000 sy 3.000 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 1.938 es Wed May 16 06:44 -find - root 0.250 secs 0.031 us 0.219 sy 1.938 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 3.062 es Wed May 16 06:44 -egrep - root 3.031 secs 3.031 us 0.000 sy 3.062 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 0.188 es Wed May 16 06:44 -awk - root 0.172 secs 0.172 us 0.000 sy 0.188 es Wed May 16 06:44 -accton - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 +core -FDX root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +core -DX root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +cc - root 0.000 secs 0.000 us 0.000 sy 0.016 es Wed May 16 11:44 +ld - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +as - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +cc1 - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time -F root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +ln - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time -F root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +ln - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time -F root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +ln - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 0.234 es Wed May 16 11:44 +diff - root 0.203 secs 0.203 us 0.000 sy 0.234 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 0.016 es Wed May 16 11:44 +dd - root 0.016 secs 0.000 us 0.016 sy 0.016 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 3.016 es Wed May 16 11:44 +sleep - root 0.000 secs 0.000 us 0.000 sy 3.000 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 1.938 es Wed May 16 11:44 +find - root 0.250 secs 0.031 us 0.219 sy 1.938 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 3.062 es Wed May 16 11:44 +egrep - root 3.031 secs 3.031 us 0.000 sy 3.062 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 0.188 es Wed May 16 11:44 +awk - root 0.172 secs 0.172 us 0.000 sy 0.188 es Wed May 16 11:44 +accton - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 Modified: head/tools/regression/usr.bin/lastcomm/v2-amd64.out ============================================================================== --- head/tools/regression/usr.bin/lastcomm/v2-amd64.out Wed Mar 12 10:25:26 2014 (r263080) +++ head/tools/regression/usr.bin/lastcomm/v2-amd64.out Wed Mar 12 10:35:22 2014 (r263081) @@ -1,28 +1,28 @@ -core -FDX root 0.002 secs 0.000 us 0.002 sy 0.009 es Thu May 17 00:57 -core -DX root 0.005 secs 0.000 us 0.005 sy 0.010 es Thu May 17 00:57 -cc - root 0.005 secs 0.000 us 0.005 sy 0.652 es Thu May 17 00:57 -ld - root 0.014 secs 0.005 us 0.009 sy 0.150 es Thu May 17 00:57 -as - root 0.005 secs 0.000 us 0.005 sy 0.078 es Thu May 17 00:57 -cc1 - root 0.024 secs 0.008 us 0.016 sy 0.347 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 0.005 es Thu May 17 00:57 -1234567890123456 - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 00:57 -ln - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 0.005 es Thu May 17 00:57 -1234567890123456 - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 00:57 -ln - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 0.013 es Thu May 17 00:57 -123456789012345 - root 0.002 secs 0.000 us 0.002 sy 0.010 es Thu May 17 00:57 -ln - root 0.003 secs 0.000 us 0.003 sy 0.003 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 0.246 es Thu May 17 00:57 -diff - root 0.223 secs 0.164 us 0.060 sy 0.243 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 0.079 es Thu May 17 00:57 -dd - root 0.076 secs 0.000 us 0.076 sy 0.076 es Thu May 17 00:57 -time - root 0.004 secs 0.000 us 0.004 sy 3.006 es Thu May 17 00:57 -sleep - root 0.002 secs 0.000 us 0.002 sy 3.002 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 9.945 es Thu May 17 00:57 -find - root 0.822 secs 0.055 us 0.767 sy 9.942 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 3.313 es Thu May 17 00:57 -egrep - root 3.247 secs 3.247 us 0.000 sy 3.310 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 0.185 es Thu May 17 00:57 -awk - root 0.163 secs 0.156 us 0.007 sy 0.164 es Thu May 17 00:57 -accton - root 0.002 secs 0.000 us 0.002 sy 0.019 es Thu May 17 00:57 +core -FDX root 0.002 secs 0.000 us 0.002 sy 0.009 es Thu May 17 05:57 +core -DX root 0.005 secs 0.000 us 0.005 sy 0.010 es Thu May 17 05:57 +cc - root 0.005 secs 0.000 us 0.005 sy 0.652 es Thu May 17 05:57 +ld - root 0.014 secs 0.005 us 0.009 sy 0.150 es Thu May 17 05:57 +as - root 0.005 secs 0.000 us 0.005 sy 0.078 es Thu May 17 05:57 +cc1 - root 0.024 secs 0.008 us 0.016 sy 0.347 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 0.005 es Thu May 17 05:57 +1234567890123456 - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 05:57 +ln - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 0.005 es Thu May 17 05:57 +1234567890123456 - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 05:57 +ln - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 0.013 es Thu May 17 05:57 +123456789012345 - root 0.002 secs 0.000 us 0.002 sy 0.010 es Thu May 17 05:57 +ln - root 0.003 secs 0.000 us 0.003 sy 0.003 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 0.246 es Thu May 17 05:57 +diff - root 0.223 secs 0.164 us 0.060 sy 0.243 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 0.079 es Thu May 17 05:57 +dd - root 0.076 secs 0.000 us 0.076 sy 0.076 es Thu May 17 05:57 +time - root 0.004 secs 0.000 us 0.004 sy 3.006 es Thu May 17 05:57 +sleep - root 0.002 secs 0.000 us 0.002 sy 3.002 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 9.945 es Thu May 17 05:57 +find - root 0.822 secs 0.055 us 0.767 sy 9.942 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 3.313 es Thu May 17 05:57 +egrep - root 3.247 secs 3.247 us 0.000 sy 3.310 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 0.185 es Thu May 17 05:57 +awk - root 0.163 secs 0.156 us 0.007 sy 0.164 es Thu May 17 05:57 +accton - root 0.002 secs 0.000 us 0.002 sy 0.019 es Thu May 17 05:57 From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 10:38:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E57E665; Wed, 12 Mar 2014 10:38:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5B43B9D5; Wed, 12 Mar 2014 10:38:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2CAcXat021795; Wed, 12 Mar 2014 10:38:33 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2CAcXKu021794; Wed, 12 Mar 2014 10:38:33 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403121038.s2CAcXKu021794@svn.freebsd.org> From: Julio Merino Date: Wed, 12 Mar 2014 10:38:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263082 - head/tools/regression/usr.bin/make X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 10:38:33 -0000 Author: jmmv Date: Wed Mar 12 10:38:32 2014 New Revision: 263082 URL: http://svnweb.freebsd.org/changeset/base/263082 Log: Only run the make tests when make is fmake. Because bmake is the default make being built, many of the tests here fail due to differences between the two. Just skip the tests for now when using fmake. Modified: head/tools/regression/usr.bin/make/common.sh Modified: head/tools/regression/usr.bin/make/common.sh ============================================================================== --- head/tools/regression/usr.bin/make/common.sh Wed Mar 12 10:35:22 2014 (r263081) +++ head/tools/regression/usr.bin/make/common.sh Wed Mar 12 10:38:32 2014 (r263082) @@ -13,6 +13,13 @@ fatal() exit 1 } +make_is_fmake() { + # This test is not very reliable but works for now: the old fmake + # does have a -v option while bmake doesn't. + ${MAKE_PROG} -f Makefile.non-existent -v 2>&1 | \ + grep -q "cannot open.*non-existent" +} + # # Check whether the working directory exists - it must. # @@ -322,19 +329,25 @@ eval_compare() while [ ${N} -le ${TEST_N} ] ; do fail= todo= + skip= if ! skip_test ${N} ; then do_compare stdout ${N} || fail="${fail}stdout " do_compare stderr ${N} || fail="${fail}stderr " do_compare status ${N} || fail="${fail}status " eval todo=\${TEST_${N}_TODO} + else + eval skip=\${TEST_${N}_SKIP} fi if [ ! -z "$fail" ]; then echo -n "not " fi echo -n "ok ${N} ${SUBDIR}/${N}" - if [ ! -z "$fail" -o ! -z "$todo" ]; then + if [ ! -z "$fail" -o ! -z "$todo" -o ! -z "$skip" ]; then echo -n " # " fi + if [ ! -z "$skip" ] ; then + echo -n "skip $skip; " + fi if [ ! -z "$todo" ] ; then echo -n "TODO $todo; " fi @@ -473,6 +486,12 @@ eval_cmd() set -- prove fi + if ! make_is_fmake ; then + for i in $(jot ${TEST_N:-1}) ; do + eval TEST_${i}_SKIP=\"make is not fmake\" + done + fi + for i do case $i in From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 10:41:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5082E82F; Wed, 12 Mar 2014 10:41:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3BB189FB; Wed, 12 Mar 2014 10:41:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2CAfGqu024559; Wed, 12 Mar 2014 10:41:16 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2CAfEsd024550; Wed, 12 Mar 2014 10:41:14 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403121041.s2CAfEsd024550@svn.freebsd.org> From: Julio Merino Date: Wed, 12 Mar 2014 10:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263083 - head/tools/regression/usr.sbin/sa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 10:41:16 -0000 Author: jmmv Date: Wed Mar 12 10:41:14 2014 New Revision: 263083 URL: http://svnweb.freebsd.org/changeset/base/263083 Log: Fix sa tests. Small divergences in the output padding made some sa tests fail. Just trim all whitespace from the outputs and the golden files so comparisons are less fragile and the tests pass again. Modified: head/tools/regression/usr.sbin/sa/regress.t head/tools/regression/usr.sbin/sa/v1-amd64-sav.out head/tools/regression/usr.sbin/sa/v1-amd64-u.out head/tools/regression/usr.sbin/sa/v1-amd64-usr.out head/tools/regression/usr.sbin/sa/v1-i386-sav.out head/tools/regression/usr.sbin/sa/v1-i386-u.out head/tools/regression/usr.sbin/sa/v1-i386-usr.out head/tools/regression/usr.sbin/sa/v1-sparc64-sav.out head/tools/regression/usr.sbin/sa/v1-sparc64-u.out head/tools/regression/usr.sbin/sa/v1-sparc64-usr.out head/tools/regression/usr.sbin/sa/v2-amd64-u.out head/tools/regression/usr.sbin/sa/v2-i386-u.out head/tools/regression/usr.sbin/sa/v2-sparc64-u.out Modified: head/tools/regression/usr.sbin/sa/regress.t ============================================================================== --- head/tools/regression/usr.sbin/sa/regress.t Wed Mar 12 10:38:32 2014 (r263082) +++ head/tools/regression/usr.sbin/sa/regress.t Wed Mar 12 10:41:14 2014 (r263083) @@ -7,10 +7,16 @@ DIR=`dirname $0` LCDIR=`dirname $0`/../../usr.bin/lastcomm ARCH=`uname -m` +collapse_whitespace() +{ + sed -E 's,[ ]+, ,g' +} + check() { NUM=$1 shift + collapse_whitespace | \ if diff -q - $1 then echo "ok $NUM" @@ -64,7 +70,8 @@ sa -m -P $DIR/v2c-$ARCH-sav.in -U $DIR/v cp $LCDIR/v1-$ARCH-acct.in $DIR/v1-$ARCH-acct.in sa -is -P $DIR/v2c-$ARCH-sav.in -U $DIR/v2c-$ARCH-usr.in $DIR/v1-$ARCH-acct.in >/dev/null cp $LCDIR/v1-$ARCH-acct.in $DIR/v1-$ARCH-acct.in -sa -s -P $DIR/v2c-$ARCH-sav.in -U $DIR/v2c-$ARCH-usr.in $DIR/v1-$ARCH-acct.in >$DIR/double +sa -s -P $DIR/v2c-$ARCH-sav.in -U $DIR/v2c-$ARCH-usr.in $DIR/v1-$ARCH-acct.in \ + | collapse_whitespace >$DIR/double cp $LCDIR/v1-$ARCH-acct.in $DIR/v1-$ARCH-acct.in sa -i $DIR/v1-$ARCH-acct.in $DIR/v1-$ARCH-acct.in | check 13 $DIR/double Modified: head/tools/regression/usr.sbin/sa/v1-amd64-sav.out ============================================================================== --- head/tools/regression/usr.sbin/sa/v1-amd64-sav.out Wed Mar 12 10:38:32 2014 (r263082) +++ head/tools/regression/usr.sbin/sa/v1-amd64-sav.out Wed Mar 12 10:41:14 2014 (r263083) @@ -1,5 +1,5 @@ - 28 0.282re 0.06cp 40avio 957k - 13 0.141re 0.06cp 87avio 903k ***other - 3 0.000re 0.00cp 0avio 0k ln - 9 0.141re 0.00cp 0avio 19700k time - 3 0.000re 0.00cp 0avio 0k time* + 28 0.282re 0.06cp 40avio 957k + 13 0.141re 0.06cp 87avio 903k ***other + 3 0.000re 0.00cp 0avio 0k ln + 9 0.141re 0.00cp 0avio 19700k time + 3 0.000re 0.00cp 0avio 0k time* Modified: head/tools/regression/usr.sbin/sa/v1-amd64-u.out ============================================================================== --- head/tools/regression/usr.sbin/sa/v1-amd64-u.out Wed Mar 12 10:38:32 2014 (r263082) +++ head/tools/regression/usr.sbin/sa/v1-amd64-u.out Wed Mar 12 10:41:14 2014 (r263083) @@ -1,28 +1,28 @@ - 0 0.000 cpu 0k mem 0 io accton - 0 0.172 cpu 41k mem 0 io awk - 0 0.000 cpu 140k mem 0 io time - 0 3.031 cpu 45k mem 1 io egrep - 0 0.000 cpu 0k mem 0 io time - 0 0.250 cpu 42k mem 1087 io find - 0 0.000 cpu 0k mem 0 io time - 0 0.000 cpu 0k mem 0 io sleep - 0 0.000 cpu 57k mem 0 io time - 0 0.016 cpu 31k mem 16 io dd - 0 0.000 cpu 0k mem 0 io time - 0 0.203 cpu 1976k mem 0 io diff - 0 0.000 cpu 0k mem 0 io time - 0 0.000 cpu 0k mem 0 io ln - 0 0.000 cpu 0k mem 0 io time* - 0 0.000 cpu 0k mem 0 io time - 0 0.000 cpu 0k mem 0 io ln - 0 0.000 cpu 0k mem 0 io time* - 0 0.000 cpu 0k mem 0 io time - 0 0.000 cpu 0k mem 0 io ln - 0 0.000 cpu 0k mem 0 io time* - 0 0.000 cpu 0k mem 0 io time - 0 0.000 cpu 713k mem 0 io cc1 - 0 0.000 cpu 0k mem 0 io as - 0 0.000 cpu 228k mem 1 io ld - 0 0.000 cpu 196k mem 9 io cc - 0 0.000 cpu 45k mem 7 io core - 0 0.000 cpu 0k mem 9 io core* + 0 0.000 cpu 0k mem 0 io accton + 0 0.172 cpu 41k mem 0 io awk + 0 0.000 cpu 140k mem 0 io time + 0 3.031 cpu 45k mem 1 io egrep + 0 0.000 cpu 0k mem 0 io time + 0 0.250 cpu 42k mem 1087 io find + 0 0.000 cpu 0k mem 0 io time + 0 0.000 cpu 0k mem 0 io sleep + 0 0.000 cpu 57k mem 0 io time + 0 0.016 cpu 31k mem 16 io dd + 0 0.000 cpu 0k mem 0 io time + 0 0.203 cpu 1976k mem 0 io diff + 0 0.000 cpu 0k mem 0 io time + 0 0.000 cpu 0k mem 0 io ln + 0 0.000 cpu 0k mem 0 io time* + 0 0.000 cpu 0k mem 0 io time + 0 0.000 cpu 0k mem 0 io ln + 0 0.000 cpu 0k mem 0 io time* + 0 0.000 cpu 0k mem 0 io time + 0 0.000 cpu 0k mem 0 io ln + 0 0.000 cpu 0k mem 0 io time* + 0 0.000 cpu 0k mem 0 io time + 0 0.000 cpu 713k mem 0 io cc1 + 0 0.000 cpu 0k mem 0 io as + 0 0.000 cpu 228k mem 1 io ld + 0 0.000 cpu 196k mem 9 io cc + 0 0.000 cpu 45k mem 7 io core + 0 0.000 cpu 0k mem 9 io core* Modified: head/tools/regression/usr.sbin/sa/v1-amd64-usr.out ============================================================================== --- head/tools/regression/usr.sbin/sa/v1-amd64-usr.out Wed Mar 12 10:38:32 2014 (r263082) +++ head/tools/regression/usr.sbin/sa/v1-amd64-usr.out Wed Mar 12 10:41:14 2014 (r263083) @@ -1 +1 @@ -root 28 0.06cpu 1130tio 3514k*sec +root 28 0.06cpu 1130tio 3514k*sec Modified: head/tools/regression/usr.sbin/sa/v1-i386-sav.out ============================================================================== --- head/tools/regression/usr.sbin/sa/v1-i386-sav.out Wed Mar 12 10:38:32 2014 (r263082) +++ head/tools/regression/usr.sbin/sa/v1-i386-sav.out Wed Mar 12 10:41:14 2014 (r263083) @@ -1,5 +1,5 @@ - 28 0.425re 0.10cp 143avio 477k - 14 0.220re 0.10cp 286avio 411k ***other - 2 0.000re 0.00cp 0avio 0k 1234567890123456 - 3 0.000re 0.00cp 0avio 0k ln - 9 0.205re 0.00cp 0avio 40400k time + 28 0.425re 0.10cp 143avio 477k + 14 0.220re 0.10cp 286avio 411k ***other + 2 0.000re 0.00cp 0avio 0k 1234567890123456 + 3 0.000re 0.00cp 0avio 0k ln + 9 0.205re 0.00cp 0avio 40400k time Modified: head/tools/regression/usr.sbin/sa/v1-i386-u.out ============================================================================== --- head/tools/regression/usr.sbin/sa/v1-i386-u.out Wed Mar 12 10:38:32 2014 (r263082) +++ head/tools/regression/usr.sbin/sa/v1-i386-u.out Wed Mar 12 10:41:14 2014 (r263083) @@ -1,28 +1,28 @@ - 0 0.000 cpu 264k mem 0 io accton - 0 0.453 cpu 41k mem 0 io awk - 0 0.000 cpu 0k mem 0 io time - 0 4.984 cpu 41k mem 28 io egrep - 0 0.000 cpu 140k mem 0 io time - 0 0.266 cpu 36k mem 3921 io find - 0 0.000 cpu 0k mem 0 io time - 0 0.000 cpu 0k mem 0 io sleep - 0 0.000 cpu 0k mem 0 io time - 0 0.016 cpu 25k mem 16 io dd - 0 0.000 cpu 0k mem 0 io time - 0 0.312 cpu 1361k mem 0 io diff - 0 0.000 cpu 0k mem 0 io time - 0 0.000 cpu 0k mem 0 io ln - 0 0.000 cpu 0k mem 0 io 123456789012345 - 0 0.000 cpu 0k mem 0 io time - 0 0.000 cpu 0k mem 0 io ln - 0 0.000 cpu 0k mem 0 io 1234567890123456 - 0 0.000 cpu 264k mem 0 io time - 0 0.000 cpu 0k mem 0 io ln - 0 0.000 cpu 0k mem 0 io 1234567890123456 - 0 0.000 cpu 0k mem 0 io time - 0 0.016 cpu 233k mem 1 io cc1 - 0 0.000 cpu 482k mem 1 io as - 0 0.000 cpu 0k mem 11 io ld - 0 0.000 cpu 0k mem 6 io cc - 0 0.000 cpu 0k mem 12 io core - 0 0.000 cpu 0k mem 7 io core* + 0 0.000 cpu 264k mem 0 io accton + 0 0.453 cpu 41k mem 0 io awk + 0 0.000 cpu 0k mem 0 io time + 0 4.984 cpu 41k mem 28 io egrep + 0 0.000 cpu 140k mem 0 io time + 0 0.266 cpu 36k mem 3921 io find + 0 0.000 cpu 0k mem 0 io time + 0 0.000 cpu 0k mem 0 io sleep + 0 0.000 cpu 0k mem 0 io time + 0 0.016 cpu 25k mem 16 io dd + 0 0.000 cpu 0k mem 0 io time + 0 0.312 cpu 1361k mem 0 io diff + 0 0.000 cpu 0k mem 0 io time + 0 0.000 cpu 0k mem 0 io ln + 0 0.000 cpu 0k mem 0 io 123456789012345 + 0 0.000 cpu 0k mem 0 io time + 0 0.000 cpu 0k mem 0 io ln + 0 0.000 cpu 0k mem 0 io 1234567890123456 + 0 0.000 cpu 264k mem 0 io time + 0 0.000 cpu 0k mem 0 io ln + 0 0.000 cpu 0k mem 0 io 1234567890123456 + 0 0.000 cpu 0k mem 0 io time + 0 0.016 cpu 233k mem 1 io cc1 + 0 0.000 cpu 482k mem 1 io as + 0 0.000 cpu 0k mem 11 io ld + 0 0.000 cpu 0k mem 6 io cc + 0 0.000 cpu 0k mem 12 io core + 0 0.000 cpu 0k mem 7 io core* Modified: head/tools/regression/usr.sbin/sa/v1-i386-usr.out ============================================================================== --- head/tools/regression/usr.sbin/sa/v1-i386-usr.out Wed Mar 12 10:38:32 2014 (r263082) +++ head/tools/regression/usr.sbin/sa/v1-i386-usr.out Wed Mar 12 10:41:14 2014 (r263083) @@ -1 +1 @@ -root 28 0.10cpu 4003tio 2887k*sec +root 28 0.10cpu 4003tio 2887k*sec Modified: head/tools/regression/usr.sbin/sa/v1-sparc64-sav.out ============================================================================== Binary file (source and/or target). No diff available. Modified: head/tools/regression/usr.sbin/sa/v1-sparc64-u.out ============================================================================== Binary file (source and/or target). No diff available. Modified: head/tools/regression/usr.sbin/sa/v1-sparc64-usr.out ============================================================================== Binary file (source and/or target). No diff available. Modified: head/tools/regression/usr.sbin/sa/v2-amd64-u.out ============================================================================== --- head/tools/regression/usr.sbin/sa/v2-amd64-u.out Wed Mar 12 10:38:32 2014 (r263082) +++ head/tools/regression/usr.sbin/sa/v2-amd64-u.out Wed Mar 12 10:41:14 2014 (r263083) @@ -1,28 +1,28 @@ - 0 0.002 cpu 68k mem 0 io accton - 0 0.163 cpu 35k mem 0 io awk - 0 0.003 cpu 0k mem 0 io time - 0 3.247 cpu 29k mem 26 io egrep - 0 0.003 cpu 93k mem 0 io time - 0 0.822 cpu 19k mem 4472 io find - 0 0.003 cpu 0k mem 0 io time - 0 0.002 cpu 0k mem 0 io sleep - 0 0.004 cpu 88k mem 0 io time - 0 0.076 cpu 18k mem 16 io dd - 0 0.003 cpu 0k mem 0 io time - 0 0.223 cpu 24k mem 0 io diff - 0 0.003 cpu 0k mem 0 io time - 0 0.003 cpu 0k mem 0 io ln - 0 0.002 cpu 0k mem 0 io 123456789012345 - 0 0.003 cpu 0k mem 0 io time - 0 0.002 cpu 0k mem 0 io ln - 0 0.002 cpu 0k mem 0 io 1234567890123456 - 0 0.003 cpu 0k mem 0 io time - 0 0.002 cpu 0k mem 0 io ln - 0 0.002 cpu 70k mem 0 io 1234567890123456 - 0 0.003 cpu 0k mem 0 io time - 0 0.024 cpu 661k mem 2 io cc1 - 0 0.005 cpu 0k mem 1 io as - 0 0.014 cpu 192k mem 9 io ld - 0 0.005 cpu 162k mem 5 io cc - 0 0.005 cpu 0k mem 13 io core - 0 0.002 cpu 0k mem 7 io core* + 0 0.002 cpu 68k mem 0 io accton + 0 0.163 cpu 35k mem 0 io awk + 0 0.003 cpu 0k mem 0 io time + 0 3.247 cpu 29k mem 26 io egrep + 0 0.003 cpu 93k mem 0 io time + 0 0.822 cpu 19k mem 4472 io find + 0 0.003 cpu 0k mem 0 io time + 0 0.002 cpu 0k mem 0 io sleep + 0 0.004 cpu 88k mem 0 io time + 0 0.076 cpu 18k mem 16 io dd + 0 0.003 cpu 0k mem 0 io time + 0 0.223 cpu 24k mem 0 io diff + 0 0.003 cpu 0k mem 0 io time + 0 0.003 cpu 0k mem 0 io ln + 0 0.002 cpu 0k mem 0 io 123456789012345 + 0 0.003 cpu 0k mem 0 io time + 0 0.002 cpu 0k mem 0 io ln + 0 0.002 cpu 0k mem 0 io 1234567890123456 + 0 0.003 cpu 0k mem 0 io time + 0 0.002 cpu 0k mem 0 io ln + 0 0.002 cpu 70k mem 0 io 1234567890123456 + 0 0.003 cpu 0k mem 0 io time + 0 0.024 cpu 661k mem 2 io cc1 + 0 0.005 cpu 0k mem 1 io as + 0 0.014 cpu 192k mem 9 io ld + 0 0.005 cpu 162k mem 5 io cc + 0 0.005 cpu 0k mem 13 io core + 0 0.002 cpu 0k mem 7 io core* Modified: head/tools/regression/usr.sbin/sa/v2-i386-u.out ============================================================================== --- head/tools/regression/usr.sbin/sa/v2-i386-u.out Wed Mar 12 10:38:32 2014 (r263082) +++ head/tools/regression/usr.sbin/sa/v2-i386-u.out Wed Mar 12 10:41:14 2014 (r263083) @@ -1,28 +1,28 @@ - 0 0.001 cpu 0k mem 0 io accton - 0 0.448 cpu 112k mem 0 io awk - 0 0.001 cpu 0k mem 0 io time - 0 6.680 cpu 110k mem 0 io egrep - 0 0.001 cpu 0k mem 0 io time - 0 0.248 cpu 108k mem 0 io find - 0 0.001 cpu 0k mem 0 io time - 0 0.001 cpu 0k mem 0 io sleep - 0 0.001 cpu 0k mem 0 io time - 0 0.025 cpu 103k mem 16 io dd - 0 0.001 cpu 0k mem 0 io time - 0 0.423 cpu 110k mem 0 io diff - 0 0.001 cpu 0k mem 0 io time - 0 0.001 cpu 0k mem 0 io ln - 0 0.001 cpu 0k mem 0 io 123456789012345 - 0 0.001 cpu 0k mem 0 io time - 0 0.001 cpu 0k mem 0 io ln - 0 0.001 cpu 0k mem 0 io 1234567890123456 - 0 0.001 cpu 140k mem 0 io time - 0 0.001 cpu 0k mem 0 io ln - 0 0.001 cpu 0k mem 0 io 1234567890123456 - 0 0.001 cpu 0k mem 0 io time - 0 0.016 cpu 620k mem 0 io cc1 - 0 0.002 cpu 432k mem 0 io as - 0 0.028 cpu 96k mem 0 io ld - 0 0.002 cpu 0k mem 0 io cc - 0 0.002 cpu 68k mem 12 io core - 0 0.000 cpu 0k mem 7 io core* + 0 0.001 cpu 0k mem 0 io accton + 0 0.448 cpu 112k mem 0 io awk + 0 0.001 cpu 0k mem 0 io time + 0 6.680 cpu 110k mem 0 io egrep + 0 0.001 cpu 0k mem 0 io time + 0 0.248 cpu 108k mem 0 io find + 0 0.001 cpu 0k mem 0 io time + 0 0.001 cpu 0k mem 0 io sleep + 0 0.001 cpu 0k mem 0 io time + 0 0.025 cpu 103k mem 16 io dd + 0 0.001 cpu 0k mem 0 io time + 0 0.423 cpu 110k mem 0 io diff + 0 0.001 cpu 0k mem 0 io time + 0 0.001 cpu 0k mem 0 io ln + 0 0.001 cpu 0k mem 0 io 123456789012345 + 0 0.001 cpu 0k mem 0 io time + 0 0.001 cpu 0k mem 0 io ln + 0 0.001 cpu 0k mem 0 io 1234567890123456 + 0 0.001 cpu 140k mem 0 io time + 0 0.001 cpu 0k mem 0 io ln + 0 0.001 cpu 0k mem 0 io 1234567890123456 + 0 0.001 cpu 0k mem 0 io time + 0 0.016 cpu 620k mem 0 io cc1 + 0 0.002 cpu 432k mem 0 io as + 0 0.028 cpu 96k mem 0 io ld + 0 0.002 cpu 0k mem 0 io cc + 0 0.002 cpu 68k mem 12 io core + 0 0.000 cpu 0k mem 7 io core* Modified: head/tools/regression/usr.sbin/sa/v2-sparc64-u.out ============================================================================== Binary file (source and/or target). No diff available. From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 10:42:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8735FA0A; Wed, 12 Mar 2014 10:42:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 73DD5A74; Wed, 12 Mar 2014 10:42:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2CAgxDp025239; Wed, 12 Mar 2014 10:42:59 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2CAgxMj025238; Wed, 12 Mar 2014 10:42:59 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403121042.s2CAgxMj025238@svn.freebsd.org> From: Julio Merino Date: Wed, 12 Mar 2014 10:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263084 - head/tools/regression/sbin/mdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 10:42:59 -0000 Author: jmmv Date: Wed Mar 12 10:42:58 2014 New Revision: 263084 URL: http://svnweb.freebsd.org/changeset/base/263084 Log: Turn a test precondition into a skip in the mdconfig tests. Tests that cannot be run because a precondition is not met should be marked as skipped, not failed. Do this for the tests in mdconfig that first check if the caller user is root. Modified: head/tools/regression/sbin/mdconfig/00.t Modified: head/tools/regression/sbin/mdconfig/00.t ============================================================================== --- head/tools/regression/sbin/mdconfig/00.t Wed Mar 12 10:41:14 2014 (r263083) +++ head/tools/regression/sbin/mdconfig/00.t Wed Mar 12 10:42:58 2014 (r263084) @@ -32,8 +32,8 @@ echo "1..1" if [ `whoami` != "root" ]; then - echo "not ok 1 - you need to be root to run this test." - exit 1 + echo "ok 1 # skip You need to be root to run this test." + exit 0 fi TESTDIR=$(dirname $(realpath $0)) From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 10:45:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7002EB5E; Wed, 12 Mar 2014 10:45:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4FB84A84; Wed, 12 Mar 2014 10:45:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2CAjNRo025639; Wed, 12 Mar 2014 10:45:23 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2CAjMGJ025637; Wed, 12 Mar 2014 10:45:22 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403121045.s2CAjMGJ025637@svn.freebsd.org> From: Julio Merino Date: Wed, 12 Mar 2014 10:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263085 - head/tools/regression/lib/libc/string X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 10:45:23 -0000 Author: jmmv Date: Wed Mar 12 10:45:22 2014 New Revision: 263085 URL: http://svnweb.freebsd.org/changeset/base/263085 Log: Make the strerror tests work without libtap. Just replace the simple calls to the library with ad-hoc code. We should later rewrite these with the ATF libraries anyway, which are part of the base system. Modified: head/tools/regression/lib/libc/string/Makefile head/tools/regression/lib/libc/string/test-strerror.c Modified: head/tools/regression/lib/libc/string/Makefile ============================================================================== --- head/tools/regression/lib/libc/string/Makefile Wed Mar 12 10:42:58 2014 (r263084) +++ head/tools/regression/lib/libc/string/Makefile Wed Mar 12 10:45:22 2014 (r263085) @@ -1,9 +1,5 @@ # $FreeBSD$ -CFLAGS+= -I/usr/local/include -LDFLAGS+= -L/usr/local/lib -LDLIBS= -ltap - TESTS= test-stpncpy test-strerror test-wcscasecmp test-wcsnlen .PHONY: tests Modified: head/tools/regression/lib/libc/string/test-strerror.c ============================================================================== --- head/tools/regression/lib/libc/string/test-strerror.c Wed Mar 12 10:42:58 2014 (r263084) +++ head/tools/regression/lib/libc/string/test-strerror.c Wed Mar 12 10:45:22 2014 (r263085) @@ -33,7 +33,19 @@ #include #include -#include +static int test_count = 1; +static int exit_status = EXIT_SUCCESS; + +#define CHECK(x) \ + do { \ + if (x) { \ + printf("ok %d\n", test_count); \ + } else { \ + printf("not ok %d # %s\n", test_count, #x); \ + exit_status = EXIT_FAILURE; \ + } \ + ++test_count; \ + } while (0) int main(void) @@ -42,7 +54,7 @@ main(void) char *sret; int iret; - plan_tests(27); + printf("1..27\n"); /* * strerror() failure tests. @@ -50,86 +62,86 @@ main(void) errno = 0; sret = strerror(INT_MAX); snprintf(buf, sizeof(buf), "Unknown error: %d", INT_MAX); - ok1(strcmp(sret, buf) == 0); - ok1(errno == EINVAL); + CHECK(strcmp(sret, buf) == 0); + CHECK(errno == EINVAL); /* * strerror() success tests. */ errno = 0; sret = strerror(0); - ok1(strcmp(sret, "No error: 0") == 0); - ok1(errno == 0); + CHECK(strcmp(sret, "No error: 0") == 0); + CHECK(errno == 0); errno = 0; sret = strerror(EPERM); - ok1(strcmp(sret, "Operation not permitted") == 0); - ok1(errno == 0); + CHECK(strcmp(sret, "Operation not permitted") == 0); + CHECK(errno == 0); errno = 0; sret = strerror(EPFNOSUPPORT); - ok1(strcmp(sret, "Protocol family not supported") == 0); - ok1(errno == 0); + CHECK(strcmp(sret, "Protocol family not supported") == 0); + CHECK(errno == 0); errno = 0; sret = strerror(ELAST); - ok1(errno == 0); + CHECK(errno == 0); /* * strerror_r() failure tests. */ memset(buf, '*', sizeof(buf)); iret = strerror_r(-1, buf, sizeof(buf)); - ok1(strcmp(buf, "Unknown error: -1") == 0); - ok1(iret == EINVAL); + CHECK(strcmp(buf, "Unknown error: -1") == 0); + CHECK(iret == EINVAL); memset(buf, '*', sizeof(buf)); /* One byte too short. */ iret = strerror_r(EPERM, buf, strlen("Operation not permitted")); - ok1(strcmp(buf, "Operation not permitte") == 0); - ok1(iret == ERANGE); + CHECK(strcmp(buf, "Operation not permitte") == 0); + CHECK(iret == ERANGE); memset(buf, '*', sizeof(buf)); /* One byte too short. */ iret = strerror_r(-1, buf, strlen("Unknown error: -1")); - ok1(strcmp(buf, "Unknown error: -") == 0); - ok1(iret == EINVAL); + CHECK(strcmp(buf, "Unknown error: -") == 0); + CHECK(iret == EINVAL); memset(buf, '*', sizeof(buf)); /* Two bytes too short. */ iret = strerror_r(-2, buf, strlen("Unknown error: -2") - 1); - ok1(strcmp(buf, "Unknown error: ") == 0); - ok1(iret == EINVAL); + CHECK(strcmp(buf, "Unknown error: ") == 0); + CHECK(iret == EINVAL); memset(buf, '*', sizeof(buf)); /* Three bytes too short. */ iret = strerror_r(-2, buf, strlen("Unknown error: -2") - 2); - ok1(strcmp(buf, "Unknown error:") == 0); - ok1(iret == EINVAL); + CHECK(strcmp(buf, "Unknown error:") == 0); + CHECK(iret == EINVAL); memset(buf, '*', sizeof(buf)); /* One byte too short. */ iret = strerror_r(12345, buf, strlen("Unknown error: 12345")); - ok1(strcmp(buf, "Unknown error: 1234") == 0); - ok1(iret == EINVAL); + CHECK(strcmp(buf, "Unknown error: 1234") == 0); + CHECK(iret == EINVAL); /* * strerror_r() success tests. */ memset(buf, '*', sizeof(buf)); iret = strerror_r(0, buf, sizeof(buf)); - ok1(strcmp(buf, "No error: 0") == 0); - ok1(iret == 0); + CHECK(strcmp(buf, "No error: 0") == 0); + CHECK(iret == 0); memset(buf, '*', sizeof(buf)); iret = strerror_r(EDEADLK, buf, sizeof(buf)); - ok1(strcmp(buf, "Resource deadlock avoided") == 0); - ok1(iret == 0); + CHECK(strcmp(buf, "Resource deadlock avoided") == 0); + CHECK(iret == 0); memset(buf, '*', sizeof(buf)); iret = strerror_r(EPROCLIM, buf, sizeof(buf)); - ok1(strcmp(buf, "Too many processes") == 0); - ok1(iret == 0); + CHECK(strcmp(buf, "Too many processes") == 0); + CHECK(iret == 0); - return exit_status(); + return exit_status; } From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 10:59:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B40FAF48; Wed, 12 Mar 2014 10:59:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A1769B80; Wed, 12 Mar 2014 10:59:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2CAxpZW030111; Wed, 12 Mar 2014 10:59:51 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2CAxpE5030110; Wed, 12 Mar 2014 10:59:51 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403121059.s2CAxpE5030110@svn.freebsd.org> From: Julio Merino Date: Wed, 12 Mar 2014 10:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263087 - head/tools/regression/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 10:59:51 -0000 Author: jmmv Date: Wed Mar 12 10:59:51 2014 New Revision: 263087 URL: http://svnweb.freebsd.org/changeset/base/263087 Log: Remove broken tests for eui64_line. This function is not public and brooks (initial committer adding the code) suggests the deletion of the tests (which I don't know if they work) instead of changing the visibility of the function. Deleted: head/tools/regression/lib/libc/net/test-eui64_line.c head/tools/regression/lib/libc/net/test-eui64_line.t Modified: head/tools/regression/lib/libc/net/Makefile Modified: head/tools/regression/lib/libc/net/Makefile ============================================================================== --- head/tools/regression/lib/libc/net/Makefile Wed Mar 12 10:45:58 2014 (r263086) +++ head/tools/regression/lib/libc/net/Makefile Wed Mar 12 10:59:51 2014 (r263087) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTS= test-ether test-eui64_aton test-eui64_line test-eui64_ntoa +TESTS= test-ether test-eui64_aton test-eui64_ntoa CFLAGS+= -g -Wall .PHONY: tests From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 11:53:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8294E7B; Wed, 12 Mar 2014 11:53:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B54DD9D; Wed, 12 Mar 2014 11:53:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2CBrZ9I059460; Wed, 12 Mar 2014 11:53:35 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2CBrZGK059459; Wed, 12 Mar 2014 11:53:35 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403121153.s2CBrZGK059459@svn.freebsd.org> From: Julio Merino Date: Wed, 12 Mar 2014 11:53:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263089 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 11:53:35 -0000 Author: jmmv Date: Wed Mar 12 11:53:35 2014 New Revision: 263089 URL: http://svnweb.freebsd.org/changeset/base/263089 Log: Fix description of WITHOUT_BMAKE's purpose. This variable exists to select fmake, not bmake. (I suspect the comment might have come from a time when this was named WITH_BMAKE.) Modified: head/tools/build/options/WITHOUT_BMAKE Modified: head/tools/build/options/WITHOUT_BMAKE ============================================================================== --- head/tools/build/options/WITHOUT_BMAKE Wed Mar 12 11:09:17 2014 (r263088) +++ head/tools/build/options/WITHOUT_BMAKE Wed Mar 12 11:53:35 2014 (r263089) @@ -3,6 +3,6 @@ Set to not build and install the portabl .Xr make 1 instead of the traditional FreeBSD make. This build option is temporary. -It allows developers to switch to bmake in order to work out any remaining -kinks or issues. +It allows developers to switch to the traditional FreeBSD make in order to +work out any remaining kinks or issues. This option will be removed in due time. From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 12:27:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26CA4748; Wed, 12 Mar 2014 12:27:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 143A8381; Wed, 12 Mar 2014 12:27:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2CCRDXm083889; Wed, 12 Mar 2014 12:27:13 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2CCRDre083888; Wed, 12 Mar 2014 12:27:13 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403121227.s2CCRDre083888@svn.freebsd.org> From: Julio Merino Date: Wed, 12 Mar 2014 12:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263090 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 12:27:14 -0000 Author: jmmv Date: Wed Mar 12 12:27:13 2014 New Revision: 263090 URL: http://svnweb.freebsd.org/changeset/base/263090 Log: Make ether_line really report an error when all input is invalid. The previous code failed to return an error condition when the whole input was invalid due to improper handling of the sscanf return value. Actually, this failure was properly being caught by a test in tools/regression/lib/libc/net/test-ether.t but was not noticed because these tests are never run. (On my way to fixing that ;-) The fix applied here resembles the implementation of ether_line in NetBSD modulo the setting of an errno value (which is not documented as an expectation in the manpage anyway). Modified: head/lib/libc/net/ether_addr.c Modified: head/lib/libc/net/ether_addr.c ============================================================================== --- head/lib/libc/net/ether_addr.c Wed Mar 12 11:53:35 2014 (r263089) +++ head/lib/libc/net/ether_addr.c Wed Mar 12 12:27:13 2014 (r263090) @@ -72,11 +72,13 @@ ether_line(const char *l, struct ether_a i = sscanf(l, "%x:%x:%x:%x:%x:%x %s", &o[0], &o[1], &o[2], &o[3], &o[4], &o[5], hostname); - if (i != 7) - return (i); - for (i=0; i<6; i++) - e->octet[i] = o[i]; - return (0); + if (i == 7) { + for (i = 0; i < 6; i++) + e->octet[i] = o[i]; + return (0); + } else { + return (-1); + } } /* From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 14:29:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72D2D9A3; Wed, 12 Mar 2014 14:29:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F6D71F1; Wed, 12 Mar 2014 14:29:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2CET9px038769; Wed, 12 Mar 2014 14:29:09 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2CET8Hh038762; Wed, 12 Mar 2014 14:29:08 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403121429.s2CET8Hh038762@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 12 Mar 2014 14:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263091 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 14:29:09 -0000 Author: glebius Date: Wed Mar 12 14:29:08 2014 New Revision: 263091 URL: http://svnweb.freebsd.org/changeset/base/263091 Log: Since both netinet/ and netinet6/ call into netipsec/ and netpfil/, the protocol specific mbuf flags are shared between them. - Move all M_FOO definitions into a single place: netinet/in6.h, to avoid future clashes. - Resolve clash between M_DECRYPTED and M_SKIP_FIREWALL which resulted in a failure of operation of IPSEC and packet filters. Thanks to Nicolas and Georgios for all the hard work on bisecting, testing and finally finding the root of the problem. PR: kern/186755 PR: kern/185876 In collaboration with: Georgios Amanakis In collaboration with: Nicolas DEFFAYET Sponsored by: Nginx, Inc. Modified: head/sys/netinet/ip_input.c head/sys/netinet/ip_var.h head/sys/netinet6/in6.h head/sys/netinet6/ip6_var.h Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Wed Mar 12 12:27:13 2014 (r263090) +++ head/sys/netinet/ip_input.c Wed Mar 12 14:29:08 2014 (r263091) @@ -702,6 +702,7 @@ ours: * ip_reass() will return a different mbuf. */ if (ip->ip_off & htons(IP_MF | IP_OFFMASK)) { + /* XXXGL: shouldn't we save & set m_flags? */ m = ip_reass(m); if (m == NULL) return; @@ -794,6 +795,8 @@ SYSCTL_PROC(_net_inet_ip, OID_AUTO, maxf NULL, 0, sysctl_maxnipq, "I", "Maximum number of IPv4 fragment reassembly queue entries"); +#define M_IP_FRAG M_PROTO9 + /* * Take incoming datagram fragment and try to reassemble it into * whole datagram. If the argument is the first fragment or one Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Wed Mar 12 12:27:13 2014 (r263090) +++ head/sys/netinet/ip_var.h Wed Mar 12 14:29:08 2014 (r263091) @@ -162,15 +162,6 @@ void kmod_ipstat_dec(int statnum); #define IP_ROUTETOIF SO_DONTROUTE /* 0x10 bypass routing tables */ #define IP_ALLOWBROADCAST SO_BROADCAST /* 0x20 can send broadcast packets */ -/* - * IPv4 protocol layer specific mbuf flags. - */ -#define M_FASTFWD_OURS M_PROTO1 /* changed dst to local */ -#define M_IP_NEXTHOP M_PROTO2 /* explicit ip nexthop */ -#define M_SKIP_FIREWALL M_PROTO3 /* skip firewall processing, - keep in sync with IP6 */ -#define M_IP_FRAG M_PROTO4 /* fragment reassembly */ - #ifdef __NO_STRICT_ALIGNMENT #define IP_HDR_ALIGNED_P(ip) 1 #else Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Wed Mar 12 12:27:13 2014 (r263090) +++ head/sys/netinet6/in6.h Wed Mar 12 14:29:08 2014 (r263091) @@ -622,13 +622,18 @@ struct ip6_mtuinfo { #endif /* __BSD_VISIBLE */ /* - * Redefinition of mbuf flags + * Since both netinet/ and netinet6/ call into netipsec/ and netpfil/, + * the protocol specific mbuf flags are shared between them. */ -#define M_AUTHIPHDR M_PROTO2 -#define M_DECRYPTED M_PROTO3 -#define M_LOOP M_PROTO4 -#define M_AUTHIPDGM M_PROTO5 -#define M_RTALERT_MLD M_PROTO6 +#define M_FASTFWD_OURS M_PROTO1 /* changed dst to local */ +#define M_IP6_NEXTHOP M_PROTO2 /* explicit ip nexthop */ +#define M_IP_NEXTHOP M_PROTO2 /* explicit ip nexthop */ +#define M_SKIP_FIREWALL M_PROTO3 /* skip firewall processing */ +#define M_AUTHIPHDR M_PROTO4 +#define M_DECRYPTED M_PROTO5 +#define M_LOOP M_PROTO6 +#define M_AUTHIPDGM M_PROTO7 +#define M_RTALERT_MLD M_PROTO8 #ifdef _KERNEL struct cmsghdr; Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Wed Mar 12 12:27:13 2014 (r263090) +++ head/sys/netinet6/ip6_var.h Wed Mar 12 14:29:08 2014 (r263091) @@ -293,13 +293,6 @@ struct ip6aux { #define IPV6_FORWARDING 0x02 /* most of IPv6 header exists */ #define IPV6_MINMTU 0x04 /* use minimum MTU (IPV6_USE_MIN_MTU) */ -/* - * IPv6 protocol layer specific mbuf flags. - */ -#define M_IP6_NEXTHOP M_PROTO2 /* explicit ip nexthop */ -#define M_SKIP_FIREWALL M_PROTO3 /* skip firewall processing, - keep in sync with IPv4 */ - #ifdef __NO_STRICT_ALIGNMENT #define IP6_HDR_ALIGNED_P(ip) 1 #else From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 15:13:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40BA6ADA; Wed, 12 Mar 2014 15:13:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2DE0A933; Wed, 12 Mar 2014 15:13:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2CFDwqi058331; Wed, 12 Mar 2014 15:13:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2CFDwgr058330; Wed, 12 Mar 2014 15:13:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403121513.s2CFDwgr058330@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 12 Mar 2014 15:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263092 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 15:13:58 -0000 Author: kib Date: Wed Mar 12 15:13:57 2014 New Revision: 263092 URL: http://svnweb.freebsd.org/changeset/base/263092 Log: Do not vdrop() the tmpfs vnode until it is unlocked. The hold reference might be the last, and then vdrop() would free the vnode. Reported and tested by: bdrewery MFC after: 1 week Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Wed Mar 12 14:29:08 2014 (r263091) +++ head/sys/vm/vm_object.c Wed Mar 12 15:13:57 2014 (r263092) @@ -536,17 +536,18 @@ vm_object_deallocate(vm_object_t object) vhold(vp); VM_OBJECT_WUNLOCK(object); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - vdrop(vp); VM_OBJECT_WLOCK(object); if (object->type == OBJT_DEAD || object->ref_count != 1) { VM_OBJECT_WUNLOCK(object); VOP_UNLOCK(vp, 0); + vdrop(vp); return; } if ((object->flags & OBJ_TMPFS) != 0) VOP_UNSET_TEXT(vp); VOP_UNLOCK(vp, 0); + vdrop(vp); } if (object->shadow_count == 0 && object->handle == NULL && From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 15:14:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C6E3CF8; Wed, 12 Mar 2014 15:14:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 799AA942; Wed, 12 Mar 2014 15:14:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2CFEuac058574; Wed, 12 Mar 2014 15:14:56 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2CFEuam058573; Wed, 12 Mar 2014 15:14:56 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403121514.s2CFEuam058573@svn.freebsd.org> From: Eitan Adler Date: Wed, 12 Mar 2014 15:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263093 - head/tools/tools/iwn/iwnstats X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 15:14:56 -0000 Author: eadler Date: Wed Mar 12 15:14:55 2014 New Revision: 263093 URL: http://svnweb.freebsd.org/changeset/base/263093 Log: wlanstats: print timestamp Print timestamp in addition to data for more useful debugging. Discussed with: adrian Modified: head/tools/tools/iwn/iwnstats/main.c Modified: head/tools/tools/iwn/iwnstats/main.c ============================================================================== --- head/tools/tools/iwn/iwnstats/main.c Wed Mar 12 15:13:57 2014 (r263092) +++ head/tools/tools/iwn/iwnstats/main.c Wed Mar 12 15:14:55 2014 (r263093) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -239,9 +240,13 @@ static void iwn_print(struct iwnstats *is) { struct iwn_stats *s; + struct timeval tv; s = &is->st; + gettimeofday(&tv, NULL); + printf("time=%ld.%.6ld\n", (long)tv.tv_sec, (long)tv.tv_usec); + iwn_stats_general_print(is, s); /* RX */ From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 15:30:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B07C363; Wed, 12 Mar 2014 15:30:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 48A43A92; Wed, 12 Mar 2014 15:30:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2CFUfQ6063569; Wed, 12 Mar 2014 15:30:41 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2CFUfj4063568; Wed, 12 Mar 2014 15:30:41 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201403121530.s2CFUfj4063568@svn.freebsd.org> From: Michael Tuexen Date: Wed, 12 Mar 2014 15:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263094 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 15:30:41 -0000 Author: tuexen Date: Wed Mar 12 15:30:40 2014 New Revision: 263094 URL: http://svnweb.freebsd.org/changeset/base/263094 Log: SCTP uses CRC32C and not Adler anymore. While there change the reference to RFC 4960. This does not change any code, just comments. MFC after: 3 days Modified: head/sys/netinet/sctp.h Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Wed Mar 12 15:14:55 2014 (r263093) +++ head/sys/netinet/sctp.h Wed Mar 12 15:30:40 2014 (r263094) @@ -43,13 +43,13 @@ __FBSDID("$FreeBSD$"); #define SCTP_PACKED __attribute__((packed)) /* - * SCTP protocol - RFC2960. + * SCTP protocol - RFC4960. */ struct sctphdr { uint16_t src_port; /* source port */ uint16_t dest_port; /* destination port */ uint32_t v_tag; /* verification tag of packet */ - uint32_t checksum; /* Adler32 C-Sum */ + uint32_t checksum; /* CRC32C checksum */ /* chunks follow... */ } SCTP_PACKED; From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 16:38:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E477B74; Wed, 12 Mar 2014 16:38:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6B8EC1E6; Wed, 12 Mar 2014 16:38:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2CGcuXX091518; Wed, 12 Mar 2014 16:38:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2CGcu25091517; Wed, 12 Mar 2014 16:38:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403121638.s2CGcu25091517@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 12 Mar 2014 16:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263095 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 16:38:56 -0000 Author: kib Date: Wed Mar 12 16:38:55 2014 New Revision: 263095 URL: http://svnweb.freebsd.org/changeset/base/263095 Log: Initialize paddr to handle the case of zero size. Reported and reviewed by: Conrad Meyer MFC after: 1 week Modified: head/sys/vm/device_pager.c Modified: head/sys/vm/device_pager.c ============================================================================== --- head/sys/vm/device_pager.c Wed Mar 12 15:30:40 2014 (r263094) +++ head/sys/vm/device_pager.c Wed Mar 12 16:38:55 2014 (r263095) @@ -414,6 +414,7 @@ old_dev_pager_ctor(void *handle, vm_ooff * XXX assumes VM_PROT_* == PROT_* */ npages = OFF_TO_IDX(size); + paddr = 0; /* Make paddr initialized for the case of size == 0. */ for (off = foff; npages--; off += PAGE_SIZE) { if (csw->d_mmap(dev, off, &paddr, (int)prot, &dummy) != 0) { dev_relthread(dev, ref); From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 17:18:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D66CEE7; Wed, 12 Mar 2014 17:18:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2A124831; Wed, 12 Mar 2014 17:18:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2CHIGCg007841; Wed, 12 Mar 2014 17:18:16 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2CHIGoa007840; Wed, 12 Mar 2014 17:18:16 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201403121718.s2CHIGoa007840@svn.freebsd.org> From: Michael Tuexen Date: Wed, 12 Mar 2014 17:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263096 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 17:18:16 -0000 Author: tuexen Date: Wed Mar 12 17:18:15 2014 New Revision: 263096 URL: http://svnweb.freebsd.org/changeset/base/263096 Log: Put the offset of the CRC32C in csum_data instead of 0. The virtio driver needs the offset to be stored in csum_data, like in the case for UDP and TCP. The virtio problem was reported by Niu Zhixiong , who helped in debugging and testing the patch. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Mar 12 16:38:55 2014 (r263095) +++ head/sys/netinet/sctp_output.c Wed Mar 12 17:18:15 2014 (r263096) @@ -4108,7 +4108,7 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_STAT_INCR(sctps_sendnocrc); #else m->m_pkthdr.csum_flags = CSUM_SCTP; - m->m_pkthdr.csum_data = 0; + m->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum); SCTP_STAT_INCR(sctps_sendhwcrc); #endif } @@ -4457,7 +4457,7 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_STAT_INCR(sctps_sendnocrc); #else m->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; - m->m_pkthdr.csum_data = 0; + m->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum); SCTP_STAT_INCR(sctps_sendhwcrc); #endif } @@ -11007,7 +11007,7 @@ sctp_send_resp_msg(struct sockaddr *src, SCTP_STAT_INCR(sctps_sendnocrc); #else mout->m_pkthdr.csum_flags = CSUM_SCTP; - mout->m_pkthdr.csum_data = 0; + mout->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum); SCTP_STAT_INCR(sctps_sendhwcrc); #endif } @@ -11037,7 +11037,7 @@ sctp_send_resp_msg(struct sockaddr *src, SCTP_STAT_INCR(sctps_sendnocrc); #else mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; - mout->m_pkthdr.csum_data = 0; + mout->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum); SCTP_STAT_INCR(sctps_sendhwcrc); #endif } From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 19:58:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C63542A; Wed, 12 Mar 2014 19:58:12 +0000 (UTC) Received: from mail-qa0-x22f.google.com (mail-qa0-x22f.google.com [IPv6:2607:f8b0:400d:c00::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B6272A2E; Wed, 12 Mar 2014 19:58:11 +0000 (UTC) Received: by mail-qa0-f47.google.com with SMTP id w5so2489qac.34 for ; Wed, 12 Mar 2014 12:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ECDq/vtydSeEAHH6kfk8l82I/EmFCgyxh0N4Hz7OJgA=; b=pyTo4DUgpYBjLALB5y6llQbpbSTA26gfmYT4tJdtKghaoo5LPZC7mtJVxpXne7IWBR +FgHxGL5QvacbUf+TrOeRWgxlhqEMiubCVa35nfycwFjPvFY7UyOa05bMeCZi72iEP7H l+OTFil8LfXzUTcmb3X6Rm/DV+/1Vhu7tEmoNPgcRSTaTNFLGMW2TAZwjEjHG272350D hYcYWSIAKRCpjB5AvYg8ssYyJ6Mn3rMmMJ9BCtPJkQ9+hPMYO2mgi8iH72a0y/Yk73sl gkhv3hyTHbgSKlXVGxj19T1U62EEuLHlDsTsodSpCo38nHRHX56l4c/0x4pRA3ykUPHD AzOQ== MIME-Version: 1.0 X-Received: by 10.140.50.169 with SMTP id s38mr41552794qga.12.1394654290905; Wed, 12 Mar 2014 12:58:10 -0700 (PDT) Received: by 10.224.8.137 with HTTP; Wed, 12 Mar 2014 12:58:10 -0700 (PDT) Received: by 10.224.8.137 with HTTP; Wed, 12 Mar 2014 12:58:10 -0700 (PDT) In-Reply-To: <201403121429.s2CET8Hh038762@svn.freebsd.org> References: <201403121429.s2CET8Hh038762@svn.freebsd.org> Date: Wed, 12 Mar 2014 12:58:10 -0700 Message-ID: Subject: Re: svn commit: r263091 - in head/sys: netinet netinet6 From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 19:58:12 -0000 Will this work for non inet6 builds? Adrian On Mar 12, 2014 7:29 AM, "Gleb Smirnoff" wrote: > Author: glebius > Date: Wed Mar 12 14:29:08 2014 > New Revision: 263091 > URL: http://svnweb.freebsd.org/changeset/base/263091 > > Log: > Since both netinet/ and netinet6/ call into netipsec/ and netpfil/, > the protocol specific mbuf flags are shared between them. > > - Move all M_FOO definitions into a single place: netinet/in6.h, to > avoid future clashes. > - Resolve clash between M_DECRYPTED and M_SKIP_FIREWALL which resulted > in a failure of operation of IPSEC and packet filters. > > Thanks to Nicolas and Georgios for all the hard work on bisecting, > testing and finally finding the root of the problem. > > PR: kern/186755 > PR: kern/185876 > In collaboration with: Georgios Amanakis > In collaboration with: Nicolas DEFFAYET > Sponsored by: Nginx, Inc. > > Modified: > head/sys/netinet/ip_input.c > head/sys/netinet/ip_var.h > head/sys/netinet6/in6.h > head/sys/netinet6/ip6_var.h > > Modified: head/sys/netinet/ip_input.c > > ============================================================================== > --- head/sys/netinet/ip_input.c Wed Mar 12 12:27:13 2014 (r263090) > +++ head/sys/netinet/ip_input.c Wed Mar 12 14:29:08 2014 (r263091) > @@ -702,6 +702,7 @@ ours: > * ip_reass() will return a different mbuf. > */ > if (ip->ip_off & htons(IP_MF | IP_OFFMASK)) { > + /* XXXGL: shouldn't we save & set m_flags? */ > m = ip_reass(m); > if (m == NULL) > return; > @@ -794,6 +795,8 @@ SYSCTL_PROC(_net_inet_ip, OID_AUTO, maxf > NULL, 0, sysctl_maxnipq, "I", > "Maximum number of IPv4 fragment reassembly queue entries"); > > +#define M_IP_FRAG M_PROTO9 > + > /* > * Take incoming datagram fragment and try to reassemble it into > * whole datagram. If the argument is the first fragment or one > > Modified: head/sys/netinet/ip_var.h > > ============================================================================== > --- head/sys/netinet/ip_var.h Wed Mar 12 12:27:13 2014 (r263090) > +++ head/sys/netinet/ip_var.h Wed Mar 12 14:29:08 2014 (r263091) > @@ -162,15 +162,6 @@ void kmod_ipstat_dec(int statnum); > #define IP_ROUTETOIF SO_DONTROUTE /* 0x10 bypass routing > tables */ > #define IP_ALLOWBROADCAST SO_BROADCAST /* 0x20 can send broadcast > packets */ > > -/* > - * IPv4 protocol layer specific mbuf flags. > - */ > -#define M_FASTFWD_OURS M_PROTO1 /* changed dst to > local */ > -#define M_IP_NEXTHOP M_PROTO2 /* explicit ip > nexthop */ > -#define M_SKIP_FIREWALL M_PROTO3 /* skip firewall > processing, > - keep in sync with IP6 */ > -#define M_IP_FRAG M_PROTO4 /* fragment > reassembly */ > - > #ifdef __NO_STRICT_ALIGNMENT > #define IP_HDR_ALIGNED_P(ip) 1 > #else > > Modified: head/sys/netinet6/in6.h > > ============================================================================== > --- head/sys/netinet6/in6.h Wed Mar 12 12:27:13 2014 (r263090) > +++ head/sys/netinet6/in6.h Wed Mar 12 14:29:08 2014 (r263091) > @@ -622,13 +622,18 @@ struct ip6_mtuinfo { > #endif /* __BSD_VISIBLE */ > > /* > - * Redefinition of mbuf flags > + * Since both netinet/ and netinet6/ call into netipsec/ and netpfil/, > + * the protocol specific mbuf flags are shared between them. > */ > -#define M_AUTHIPHDR M_PROTO2 > -#define M_DECRYPTED M_PROTO3 > -#define M_LOOP M_PROTO4 > -#define M_AUTHIPDGM M_PROTO5 > -#define M_RTALERT_MLD M_PROTO6 > +#define M_FASTFWD_OURS M_PROTO1 /* changed dst to > local */ > +#define M_IP6_NEXTHOP M_PROTO2 /* explicit ip > nexthop */ > +#define M_IP_NEXTHOP M_PROTO2 /* explicit ip > nexthop */ > +#define M_SKIP_FIREWALL M_PROTO3 /* skip firewall > processing */ > +#define M_AUTHIPHDR M_PROTO4 > +#define M_DECRYPTED M_PROTO5 > +#define M_LOOP M_PROTO6 > +#define M_AUTHIPDGM M_PROTO7 > +#define M_RTALERT_MLD M_PROTO8 > > #ifdef _KERNEL > struct cmsghdr; > > Modified: head/sys/netinet6/ip6_var.h > > ============================================================================== > --- head/sys/netinet6/ip6_var.h Wed Mar 12 12:27:13 2014 (r263090) > +++ head/sys/netinet6/ip6_var.h Wed Mar 12 14:29:08 2014 (r263091) > @@ -293,13 +293,6 @@ struct ip6aux { > #define IPV6_FORWARDING 0x02 /* most of IPv6 header > exists */ > #define IPV6_MINMTU 0x04 /* use minimum MTU > (IPV6_USE_MIN_MTU) */ > > -/* > - * IPv6 protocol layer specific mbuf flags. > - */ > -#define M_IP6_NEXTHOP M_PROTO2 /* explicit ip > nexthop */ > -#define M_SKIP_FIREWALL M_PROTO3 /* skip firewall > processing, > - keep in sync with IPv4 > */ > - > #ifdef __NO_STRICT_ALIGNMENT > #define IP6_HDR_ALIGNED_P(ip) 1 > #else > > From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 21:09:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66FA6D1E for ; Wed, 12 Mar 2014 21:09:25 +0000 (UTC) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C757617E for ; Wed, 12 Mar 2014 21:09:24 +0000 (UTC) Received: by mail-lb0-f169.google.com with SMTP id q8so66128lbi.0 for ; Wed, 12 Mar 2014 14:09:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=z/yHVsglUZXflixFoGn3PdSp6wgeCXCiq0GNoW3hPJs=; b=NiFYfozEcUfbbmBsZIerjj84r/gvzHkxnh8DeYXuEi2+GK/vQbGHGzO1YFqnF9vQgG 4PsjEZhKdKrnt16RpIrOq9UZkjtn23U0C6bTIxav250wwIst8HTsz97P8/SOG37xzGnf jCO1otMXkr1Uy0x3JhQTJsg+02OEp0ozjnH+MK8/Nddy2CkHx9VPw0IKkW72S0by9uFL K8TDqddoWmu7INrgkWCGUgzXhDiJ9bGurz8ERNFTqrZarmpSJ/FPzK878mmoFt6WqYZh 1q6NbS3fluIrzbB58Yo3Y0uEqX7LMqbyuqzR0ZcSsyNhawN5oLFqbcSpJ+w5bl4qlo3o iZiw== X-Gm-Message-State: ALoCoQncp46sC3em6H8VAXnigb5f0bOLC78E1ntEEPr+JB7rRXPczQ1CKB13wWFojd2h0lbOwP9K X-Received: by 10.152.19.7 with SMTP id a7mr10990806lae.16.1394658556801; Wed, 12 Mar 2014 14:09:16 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id th3sm29990910lbb.11.2014.03.12.14.09.15 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 14:09:16 -0700 (PDT) Message-ID: <5320CCFB.7090301@freebsd.org> Date: Thu, 13 Mar 2014 01:09:15 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r263091 - in head/sys: netinet netinet6 References: <201403121429.s2CET8Hh038762@svn.freebsd.org> In-Reply-To: <201403121429.s2CET8Hh038762@svn.freebsd.org> X-Enigmail-Version: 1.7a1pre Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 21:09:25 -0000 On 12.03.2014 18:29, Gleb Smirnoff wrote: > --- head/sys/netinet/ip_input.c Wed Mar 12 12:27:13 2014 (r263090) > +++ head/sys/netinet/ip_input.c Wed Mar 12 14:29:08 2014 (r263091) > @@ -794,6 +795,8 @@ SYSCTL_PROC(_net_inet_ip, OID_AUTO, maxf > NULL, 0, sysctl_maxnipq, "I", > "Maximum number of IPv4 fragment reassembly queue entries"); > > +#define M_IP_FRAG M_PROTO9 > + > /* > * Take incoming datagram fragment and try to reassemble it into > * whole datagram. If the argument is the first fragment or one > > Modified: head/sys/netinet6/in6.h > ============================================================================== > --- head/sys/netinet6/in6.h Wed Mar 12 12:27:13 2014 (r263090) > +++ head/sys/netinet6/in6.h Wed Mar 12 14:29:08 2014 (r263091) > @@ -622,13 +622,18 @@ struct ip6_mtuinfo { > #endif /* __BSD_VISIBLE */ > > /* > - * Redefinition of mbuf flags > + * Since both netinet/ and netinet6/ call into netipsec/ and netpfil/, > + * the protocol specific mbuf flags are shared between them. > */ > -#define M_AUTHIPHDR M_PROTO2 > -#define M_DECRYPTED M_PROTO3 > -#define M_LOOP M_PROTO4 > -#define M_AUTHIPDGM M_PROTO5 > -#define M_RTALERT_MLD M_PROTO6 > +#define M_FASTFWD_OURS M_PROTO1 /* changed dst to local */ > +#define M_IP6_NEXTHOP M_PROTO2 /* explicit ip nexthop */ > +#define M_IP_NEXTHOP M_PROTO2 /* explicit ip nexthop */ > +#define M_SKIP_FIREWALL M_PROTO3 /* skip firewall processing */ > +#define M_AUTHIPHDR M_PROTO4 > +#define M_DECRYPTED M_PROTO5 > +#define M_LOOP M_PROTO6 > +#define M_AUTHIPDGM M_PROTO7 > +#define M_RTALERT_MLD M_PROTO8 > Next time someone add new mbuf flag to in6.h, it will be M_PROTO9 and situation repeat itself, since you left M_PROTO9 in ip_input.c -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 22:20:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F1638AA; Wed, 12 Mar 2014 22:20:03 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2F74AD2C; Wed, 12 Mar 2014 22:20:02 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s2CMJujX013734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 12 Mar 2014 15:19:56 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s2CMJuKY013733; Wed, 12 Mar 2014 15:19:56 -0700 (PDT) (envelope-from jmg) Date: Wed, 12 Mar 2014 15:19:55 -0700 From: John-Mark Gurney To: Gleb Smirnoff Subject: Re: svn commit: r263091 - in head/sys: netinet netinet6 Message-ID: <20140312221955.GC32089@funkthat.com> References: <201403121429.s2CET8Hh038762@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201403121429.s2CET8Hh038762@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Wed, 12 Mar 2014 15:19:56 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 22:20:03 -0000 Gleb Smirnoff wrote this message on Wed, Mar 12, 2014 at 14:29 +0000: > Author: glebius > Date: Wed Mar 12 14:29:08 2014 > New Revision: 263091 > URL: http://svnweb.freebsd.org/changeset/base/263091 > > Log: > Since both netinet/ and netinet6/ call into netipsec/ and netpfil/, > the protocol specific mbuf flags are shared between them. > > - Move all M_FOO definitions into a single place: netinet/in6.h, to > avoid future clashes. > - Resolve clash between M_DECRYPTED and M_SKIP_FIREWALL which resulted > in a failure of operation of IPSEC and packet filters. > > Thanks to Nicolas and Georgios for all the hard work on bisecting, > testing and finally finding the root of the problem. > > PR: kern/186755 > PR: kern/185876 > In collaboration with: Georgios Amanakis > In collaboration with: Nicolas DEFFAYET > Sponsored by: Nginx, Inc. Was the version bumped so that old kernel modules won't cause issues w/ the new numbering? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 22:39:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4823CF2C; Wed, 12 Mar 2014 22:39:00 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id E6B74EC0; Wed, 12 Mar 2014 22:38:59 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 0FA8710436DF; Thu, 13 Mar 2014 09:38:52 +1100 (EST) Date: Thu, 13 Mar 2014 09:38:51 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r263080 - in head/sys: dev/cpuctl dev/hwpmc kern In-Reply-To: <201403121025.s2CAPQRl017239@svn.freebsd.org> Message-ID: <20140313081336.C5739@besplex.bde.org> References: <201403121025.s2CAPQRl017239@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=fbeUlSgF c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=nTxyh5FW7Y8A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=D_k5nLaqhlZ3kOncPtIA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 22:39:00 -0000 On Wed, 12 Mar 2014, Konstantin Belousov wrote: > Log: > Use correct types for sizeof() in the calculations for the malloc(9) sizes [1]. > While there, remove unneeded checks for failed allocations with M_WAITOK flag. > > Submitted by: Conrad Meyer [1] > MFC after: 1 week Nice cleanups. > Modified: head/sys/kern/kern_linker.c > ============================================================================== > --- head/sys/kern/kern_linker.c Wed Mar 12 10:23:51 2014 (r263079) > +++ head/sys/kern/kern_linker.c Wed Mar 12 10:25:26 2014 (r263080) > @@ -725,14 +725,11 @@ linker_file_add_dependency(linker_file_t > linker_file_t *newdeps; > > sx_assert(&kld_sx, SA_XLOCKED); > - newdeps = malloc((file->ndeps + 1) * sizeof(linker_file_t *), > - M_LINKER, M_WAITOK | M_ZERO); > - if (newdeps == NULL) > - return (ENOMEM); > + newdeps = malloc((file->ndeps + 1) * sizeof(*newdeps), M_LINKER, > + M_WAITOK | M_ZERO); > Still has a style bug: extra blank line. KNF disallows all optional blank lines (indent -sob), even ones to separate unrelated statements, and this one separates related statements. > if (file->deps) { > - bcopy(file->deps, newdeps, > - file->ndeps * sizeof(linker_file_t *)); > + bcopy(file->deps, newdeps, file->ndeps * sizeof(*newdeps)); > free(file->deps, M_LINKER); > } > file->deps = newdeps; I don't agree with having realloc() or reallocf() in the kernel, but since realloc() is there it is a style bug to not use it in the above. The code using realloc() seems to be: file->deps = realloc(file->deps, (file->ndeps + 1) * sizeof(*newdeps), M_LINKER, M_WAITOK | M_ZERO); This is 5 more lines shorter. Perhaps 8 lines shorter after removing the temporary variable. reallocf() is especially not needed in the kernel, since most allocations are M_WAITOK so they can't fail. It is used a whole 5 files in the whole kernel, and most of these uses are wrong. - in drm_realloc() in dev/drm/drmP.h. This function is badly named. It does reallocf(), not realloc(). This function is so bogus that it is never used, at least in dev/drm. The nearby drm_alloc(), which does malloc(), is used a lot. Instead, 4 places use plain realloc(). Plain realloc() suffices for these cases, since all uses are with M_WAITOK. But all these uses are followed by garbage error handling that is even more laborious than in the garbage removed in this commit, despite having the usual bug from not using reallocf() (leak the old allocation on failure). - 3 times in dev/pci/pci.c. All these uses are bogus, since the allocations are M_WAITOK so they can't fail, and if they could fail the error handling given by reallocf() would be wrong. - 2 times in in uhso_alloc_tty(). All these uses are bogus, as in pci.c, except they are followed by bogus checks that the M_WAITOK reallocf() doesn't fail, so perhaps the error handling for the impossible case where it fails is correct. - in drm_realloc() in dev/drm2/drmP.h. drm is cloned for some reason, so its bugs are cloned too. All the other bugs described above are cloned too, starting with not actually using this function. - twice in dev/drm2/drm_edid2.c. All these uses are bogus, as in pci.c, plus they have the internal layering violation of not using drm2's own realloc interface. These bugs are not due to the cloning -- the original never uses reallocf(), and the dead code for the error handling is not present in the new code. - in atm_getvccs(). This use is actually correct. Summary: after removing the garbage, reallocf() is used a whole once in the kernel. Not counting the above, or boot or utilities, realloc() is used in a whole 22 files in the kernel, with an average of not much more than 1 use per file. Many of the uses are in low quality code that does things like casting the result of realloc() or trying to implement the usual bug from not using reallocf() but not managing to do so since by using M_WAITOK (these tend to be followed by verbose dead code for handling allocation failure but not the leak; hopefully callers of malloc() are not so stupid about M_WAITOK). This leaves about 10 correct useful uses of realloc(). It saves a whole statement to use realloc() instead of malloc() + bcopy() for a M_WAITOK malloc(). I prefer the separate statement, and don't really like the M_ZERO flag instead of a separate bzero() either. Kernel realloc() is non-smart and never extends the original allocation, but just does malloc() + bcopy() internally. Since it is so rarely needed in the kernel, it is OK for callers to know this and not use it just to benefit from it ecoming smarter. reallocf() gives much larger simplifications in callers for the single non-M_WAITOK caller. Further cleanups might give as many a 2 correct non-M_WAITOK callers. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 03:14:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DD5711B; Thu, 13 Mar 2014 03:14:28 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE27F9ED; Thu, 13 Mar 2014 03:14:26 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s2D3E3nI039217 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 13 Mar 2014 07:14:03 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s2D3E391039216; Thu, 13 Mar 2014 07:14:03 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 13 Mar 2014 07:14:03 +0400 From: Gleb Smirnoff To: Andrey Chernov Subject: Re: svn commit: r263091 - in head/sys: netinet netinet6 Message-ID: <20140313031403.GQ80022@FreeBSD.org> References: <201403121429.s2CET8Hh038762@svn.freebsd.org> <5320CCFB.7090301@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5320CCFB.7090301@freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 03:14:28 -0000 On Thu, Mar 13, 2014 at 01:09:15AM +0400, Andrey Chernov wrote: A> On 12.03.2014 18:29, Gleb Smirnoff wrote: A> > --- head/sys/netinet/ip_input.c Wed Mar 12 12:27:13 2014 (r263090) A> > +++ head/sys/netinet/ip_input.c Wed Mar 12 14:29:08 2014 (r263091) A> > @@ -794,6 +795,8 @@ SYSCTL_PROC(_net_inet_ip, OID_AUTO, maxf A> > NULL, 0, sysctl_maxnipq, "I", A> > "Maximum number of IPv4 fragment reassembly queue entries"); A> > A> > +#define M_IP_FRAG M_PROTO9 A> > + A> > /* A> > * Take incoming datagram fragment and try to reassemble it into A> > * whole datagram. If the argument is the first fragment or one A> > A> > Modified: head/sys/netinet6/in6.h A> > ============================================================================== A> > --- head/sys/netinet6/in6.h Wed Mar 12 12:27:13 2014 (r263090) A> > +++ head/sys/netinet6/in6.h Wed Mar 12 14:29:08 2014 (r263091) A> > @@ -622,13 +622,18 @@ struct ip6_mtuinfo { A> > #endif /* __BSD_VISIBLE */ A> > A> > /* A> > - * Redefinition of mbuf flags A> > + * Since both netinet/ and netinet6/ call into netipsec/ and netpfil/, A> > + * the protocol specific mbuf flags are shared between them. A> > */ A> > -#define M_AUTHIPHDR M_PROTO2 A> > -#define M_DECRYPTED M_PROTO3 A> > -#define M_LOOP M_PROTO4 A> > -#define M_AUTHIPDGM M_PROTO5 A> > -#define M_RTALERT_MLD M_PROTO6 A> > +#define M_FASTFWD_OURS M_PROTO1 /* changed dst to local */ A> > +#define M_IP6_NEXTHOP M_PROTO2 /* explicit ip nexthop */ A> > +#define M_IP_NEXTHOP M_PROTO2 /* explicit ip nexthop */ A> > +#define M_SKIP_FIREWALL M_PROTO3 /* skip firewall processing */ A> > +#define M_AUTHIPHDR M_PROTO4 A> > +#define M_DECRYPTED M_PROTO5 A> > +#define M_LOOP M_PROTO6 A> > +#define M_AUTHIPDGM M_PROTO7 A> > +#define M_RTALERT_MLD M_PROTO8 A> > A> A> Next time someone add new mbuf flag to in6.h, it will be M_PROTO9 and A> situation repeat itself, since you left M_PROTO9 in ip_input.c Not true probably. The ip fragment reassembly code is dead end of the stack. Once mbufs reach the reassembly queue, they won't go anywhere else. So clash there should be safe. Notice that before my commit M_IP_FRAG was clashing with M_LOOP and we didn't have any bug reports on that. I've put the non-clashing value there just being overcautios and not having enough time to analyze and test the reassembly. I also put an XXX comment, it seems to me that resulting (reassembled mbuf) might inherit flags from the first fragment, and I am not absolutely sure it is correct. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 03:14:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3FC92254; Thu, 13 Mar 2014 03:14:43 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B7B0C9EF; Thu, 13 Mar 2014 03:14:42 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s2D3Een4039228 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 13 Mar 2014 07:14:40 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s2D3Ee9v039226; Thu, 13 Mar 2014 07:14:40 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 13 Mar 2014 07:14:40 +0400 From: Gleb Smirnoff To: John-Mark Gurney Subject: Re: svn commit: r263091 - in head/sys: netinet netinet6 Message-ID: <20140313031440.GR80022@FreeBSD.org> References: <201403121429.s2CET8Hh038762@svn.freebsd.org> <20140312221955.GC32089@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140312221955.GC32089@funkthat.com> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 03:14:43 -0000 On Wed, Mar 12, 2014 at 03:19:55PM -0700, John-Mark Gurney wrote: J> > Log: J> > Since both netinet/ and netinet6/ call into netipsec/ and netpfil/, J> > the protocol specific mbuf flags are shared between them. J> > J> > - Move all M_FOO definitions into a single place: netinet/in6.h, to J> > avoid future clashes. J> > - Resolve clash between M_DECRYPTED and M_SKIP_FIREWALL which resulted J> > in a failure of operation of IPSEC and packet filters. J> > J> > Thanks to Nicolas and Georgios for all the hard work on bisecting, J> > testing and finally finding the root of the problem. J> > J> > PR: kern/186755 J> > PR: kern/185876 J> > In collaboration with: Georgios Amanakis J> > In collaboration with: Nicolas DEFFAYET J> > Sponsored by: Nginx, Inc. J> J> Was the version bumped so that old kernel modules won't cause issues w/ J> the new numbering? You are probably right. But since I'm going to checkin another ABI breaker soon, we will piggyback on that bump. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 03:14:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 783CD38B; Thu, 13 Mar 2014 03:14:58 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D8DB99F5; Thu, 13 Mar 2014 03:14:57 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s2D3Eu3T039261 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 13 Mar 2014 07:14:56 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s2D3EuHq039260; Thu, 13 Mar 2014 07:14:56 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 13 Mar 2014 07:14:56 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r263091 - in head/sys: netinet netinet6 Message-ID: <20140313031455.GS80022@FreeBSD.org> References: <201403121429.s2CET8Hh038762@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 03:14:58 -0000 On Wed, Mar 12, 2014 at 12:58:10PM -0700, Adrian Chadd wrote: A> Will this work for non inet6 builds? Of course it works. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 03:42:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 905E27D9; Thu, 13 Mar 2014 03:42:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7AB71BFF; Thu, 13 Mar 2014 03:42:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2D3gUEQ063634; Thu, 13 Mar 2014 03:42:30 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2D3gP0K063605; Thu, 13 Mar 2014 03:42:25 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403130342.s2D3gP0K063605@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 13 Mar 2014 03:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263102 - in head: sys/compat/linprocfs sys/dev/bxe sys/dev/ixgbe sys/dev/mxge sys/dev/oce sys/dev/qlxgb sys/dev/qlxgbe sys/dev/qlxge sys/dev/sbni sys/dev/virtio/network sys/dev/vmware/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 03:42:30 -0000 Author: glebius Date: Thu Mar 13 03:42:24 2014 New Revision: 263102 URL: http://svnweb.freebsd.org/changeset/base/263102 Log: Since 32-bit if_baudrate isn't enough to describe a baud rate of a 10 Gbit interface, in the r241616 a crutch was provided. It didn't work well, and finally we decided that it is time to break ABI and simply make if_baudrate a 64-bit value. Meanwhile, the entire struct if_data was reviewed. o Remove the if_baudrate_pf crutch. o Make all fields of struct if_data fixed machine independent size. The notion of data (packet counters, etc) are by no means MD. And it is a bug that on amd64 we've got a 64-bit counters, while on i386 32-bit, which at modern speeds overflow within a second. This also removes quite a lot of COMPAT_FREEBSD32 code. o Give 16 bit for the ifi_datalen field. This field was provided to make future changes to if_data less ABI breaking. Unfortunately the 8 bit size of it had effectively limited sizeof if_data to 256 bytes. o Give 32 bits to ifi_mtu and ifi_metric. o Give 64 bits to the rest of fields, since they are counters. __FreeBSD_version bumped. Discussed with: emax Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/dev/bxe/bxe.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/mxge/if_mxge.c head/sys/dev/mxge/if_mxge_var.h head/sys/dev/oce/oce_if.c head/sys/dev/qlxgb/qla_os.c head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxge/qls_os.c head/sys/dev/sbni/if_sbni.c head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/vmware/vmxnet3/if_vmx.c head/sys/dev/vxge/vxge.c head/sys/mips/rmi/dev/nlge/if_nlge.c head/sys/net/if.h head/sys/net/if_bridge.c head/sys/net/if_epair.c head/sys/net/if_var.h head/sys/net/rtsock.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c head/sys/ofed/drivers/net/mlx4/en_netdev.c head/sys/ofed/include/rdma/ib_addr.h head/sys/sys/param.h head/tools/tools/ifinfo/ifinfo.c head/usr.bin/netstat/if.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/compat/linprocfs/linprocfs.c Thu Mar 13 03:42:24 2014 (r263102) @@ -1131,31 +1131,32 @@ linprocfs_donetdev(PFS_FILL_ARGS) TAILQ_FOREACH(ifp, &V_ifnet, if_link) { linux_ifname(ifp, ifname, sizeof ifname); sbuf_printf(sb, "%6.6s: ", ifname); - sbuf_printf(sb, "%7lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu ", - ifp->if_ibytes, /* rx_bytes */ - ifp->if_ipackets, /* rx_packets */ - ifp->if_ierrors, /* rx_errors */ - ifp->if_iqdrops, /* rx_dropped + - * rx_missed_errors */ - 0UL, /* rx_fifo_errors */ - 0UL, /* rx_length_errors + - * rx_over_errors + - * rx_crc_errors + - * rx_frame_errors */ - 0UL, /* rx_compressed */ - ifp->if_imcasts); /* multicast, XXX-BZ rx only? */ - sbuf_printf(sb, "%8lu %7lu %4lu %4lu %4lu %5lu %7lu %10lu\n", - ifp->if_obytes, /* tx_bytes */ - ifp->if_opackets, /* tx_packets */ - ifp->if_oerrors, /* tx_errors */ - 0UL, /* tx_dropped */ - 0UL, /* tx_fifo_errors */ - ifp->if_collisions, /* collisions */ - 0UL, /* tx_carrier_errors + - * tx_aborted_errors + - * tx_window_errors + - * tx_heartbeat_errors */ - 0UL); /* tx_compressed */ + sbuf_printf(sb, "%7ju %7ju %4ju %4ju %4lu %5lu %10lu %9ju ", + (uintmax_t )ifp->if_ibytes, /* rx_bytes */ + (uintmax_t )ifp->if_ipackets, /* rx_packets */ + (uintmax_t )ifp->if_ierrors, /* rx_errors */ + (uintmax_t )ifp->if_iqdrops, /* rx_dropped + + * rx_missed_errors */ + 0UL, /* rx_fifo_errors */ + 0UL, /* rx_length_errors + + * rx_over_errors + + * rx_crc_errors + + * rx_frame_errors */ + 0UL, /* rx_compressed */ + (uintmax_t )ifp->if_imcasts); /* multicast, + * XXX-BZ rx only? */ + sbuf_printf(sb, "%8ju %7ju %4ju %4lu %4lu %5ju %7lu %10lu\n", + (uintmax_t )ifp->if_obytes, /* tx_bytes */ + (uintmax_t )ifp->if_opackets, /* tx_packets */ + (uintmax_t )ifp->if_oerrors, /* tx_errors */ + 0UL, /* tx_dropped */ + 0UL, /* tx_fifo_errors */ + (uintmax_t )ifp->if_collisions, /* collisions */ + 0UL, /* tx_carrier_errors + + * tx_aborted_errors + + * tx_window_errors + + * tx_heartbeat_errors*/ + 0UL); /* tx_compressed */ } IFNET_RUNLOCK(); CURVNET_RESTORE(); Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/dev/bxe/bxe.c Thu Mar 13 03:42:24 2014 (r263102) @@ -13321,11 +13321,7 @@ bxe_init_ifnet(struct bxe_softc *sc) #endif ifp->if_capenable = ifp->if_capabilities; ifp->if_capenable &= ~IFCAP_WOL_MAGIC; /* XXX not yet... */ -#if __FreeBSD_version < 1000025 - ifp->if_baudrate = 1000000000; -#else - if_initbaudrate(ifp, IF_Gbps(10)); -#endif + ifp->if_baudrate = IF_Gbps(10); ifp->if_snd.ifq_drv_maxlen = sc->tx_ring_size; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/dev/ixgbe/ixgbe.c Thu Mar 13 03:42:24 2014 (r263102) @@ -2628,11 +2628,7 @@ ixgbe_setup_interface(device_t dev, stru return (-1); } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); -#if __FreeBSD_version < 1000025 - ifp->if_baudrate = 1000000000; -#else - if_initbaudrate(ifp, IF_Gbps(10)); -#endif + ifp->if_baudrate = IF_Gbps(10); ifp->if_init = ixgbe_init; ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/dev/mxge/if_mxge.c Thu Mar 13 03:42:24 2014 (r263102) @@ -3140,12 +3140,10 @@ mxge_intr(void *arg) sc->link_state = stats->link_up; if (sc->link_state) { if_link_state_change(sc->ifp, LINK_STATE_UP); - if_initbaudrate(sc->ifp, IF_Gbps(10)); if (mxge_verbose) device_printf(sc->dev, "link up\n"); } else { if_link_state_change(sc->ifp, LINK_STATE_DOWN); - sc->ifp->if_baudrate = 0; if (mxge_verbose) device_printf(sc->dev, "link down\n"); } @@ -4887,7 +4885,7 @@ mxge_attach(device_t dev) goto abort_with_rings; } - if_initbaudrate(ifp, IF_Gbps(10)); + ifp->if_baudrate = IF_Gbps(10); ifp->if_capabilities = IFCAP_RXCSUM | IFCAP_TXCSUM | IFCAP_TSO4 | IFCAP_VLAN_MTU | IFCAP_LINKSTATE | IFCAP_TXCSUM_IPV6 | IFCAP_RXCSUM_IPV6; Modified: head/sys/dev/mxge/if_mxge_var.h ============================================================================== --- head/sys/dev/mxge/if_mxge_var.h Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/dev/mxge/if_mxge_var.h Thu Mar 13 03:42:24 2014 (r263102) @@ -57,12 +57,8 @@ $FreeBSD$ #define IF_Kbps(x) ((uintmax_t)(x) * 1000) /* kilobits/sec. */ #define IF_Mbps(x) (IF_Kbps((x) * 1000)) /* megabits/sec. */ #define IF_Gbps(x) (IF_Mbps((x) * 1000)) /* gigabits/sec. */ -static __inline void -if_initbaudrate(struct ifnet *ifp, uintmax_t baud) -{ - ifp->if_baudrate = baud; -} #endif + #ifndef VLAN_CAPABILITIES #define VLAN_CAPABILITIES(ifp) #define mxge_vlans_active(sc) (sc)->ifp->if_nvlans Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/dev/oce/oce_if.c Thu Mar 13 03:42:24 2014 (r263102) @@ -1721,7 +1721,7 @@ oce_attach_ifp(POCE_SOFTC sc) #endif sc->ifp->if_capenable = sc->ifp->if_capabilities; - if_initbaudrate(sc->ifp, IF_Gbps(10)); + sc->ifp->if_baudrate = IF_Gbps(10); #if __FreeBSD_version >= 1000000 sc->ifp->if_hw_tsomax = OCE_MAX_TSO_SIZE; Modified: head/sys/dev/qlxgb/qla_os.c ============================================================================== --- head/sys/dev/qlxgb/qla_os.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/dev/qlxgb/qla_os.c Thu Mar 13 03:42:24 2014 (r263102) @@ -669,7 +669,7 @@ qla_init_ifnet(device_t dev, qla_host_t if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - if_initbaudrate(ifp, IF_Gbps(10)); + ifp->if_baudrate = IF_Gbps(10); ifp->if_init = qla_init; ifp->if_softc = ha; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; Modified: head/sys/dev/qlxgbe/ql_os.c ============================================================================== --- head/sys/dev/qlxgbe/ql_os.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/dev/qlxgbe/ql_os.c Thu Mar 13 03:42:24 2014 (r263102) @@ -748,14 +748,8 @@ qla_init_ifnet(device_t dev, qla_host_t if_initname(ifp, device_get_name(dev), device_get_unit(dev)); -#if __FreeBSD_version >= 1000000 - if_initbaudrate(ifp, IF_Gbps(10)); + ifp->if_baudrate = IF_Gbps(10); ifp->if_capabilities = IFCAP_LINKSTATE; -#else - ifp->if_mtu = ETHERMTU; - ifp->if_baudrate = (1 * 1000 * 1000 *1000); - -#endif /* #if __FreeBSD_version >= 1000000 */ ifp->if_init = qla_init; ifp->if_softc = ha; Modified: head/sys/dev/qlxge/qls_os.c ============================================================================== --- head/sys/dev/qlxge/qls_os.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/dev/qlxge/qls_os.c Thu Mar 13 03:42:24 2014 (r263102) @@ -736,13 +736,7 @@ qls_init_ifnet(device_t dev, qla_host_t panic("%s: cannot if_alloc()\n", device_get_nameunit(dev)); if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - -#if __FreeBSD_version >= 1000000 - if_initbaudrate(ifp, IF_Gbps(10)); -#else - ifp->if_baudrate = 1 * 1000 * 1000 * 1000; -#endif /* #if (__FreeBSD_version > 1000000) */ - + ifp->if_baudrate = IF_Gbps(10); ifp->if_init = qls_init; ifp->if_softc = ha; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; Modified: head/sys/dev/sbni/if_sbni.c ============================================================================== --- head/sys/dev/sbni/if_sbni.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/dev/sbni/if_sbni.c Thu Mar 13 03:42:24 2014 (r263102) @@ -250,7 +250,7 @@ sbni_attach(struct sbni_softc *sc, int u ether_ifattach(ifp, sc->enaddr); /* device attach does transition from UNCONFIGURED to IDLE state */ - if_printf(ifp, "speed %ld, rxl ", ifp->if_baudrate); + if_printf(ifp, "speed %ju, rxl ", (uintmax_t)ifp->if_baudrate); if (sc->delta_rxl) printf("auto\n"); else Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/dev/virtio/network/if_vtnet.c Thu Mar 13 03:42:24 2014 (r263102) @@ -913,7 +913,7 @@ vtnet_setup_interface(struct vtnet_softc } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - if_initbaudrate(ifp, IF_Gbps(10)); /* Approx. */ + ifp->if_baudrate = IF_Gbps(10); /* Approx. */ ifp->if_softc = sc; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_init = vtnet_init; Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmx.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Thu Mar 13 03:42:24 2014 (r263102) @@ -1471,11 +1471,7 @@ vmxnet3_setup_interface(struct vmxnet3_s } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); -#if __FreeBSD_version < 1000025 - ifp->if_baudrate = 1000000000; -#else - if_initbaudrate(ifp, IF_Gbps(10)); -#endif + ifp->if_baudrate = IF_Gbps(10); ifp->if_softc = sc; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_init = vmxnet3_init; Modified: head/sys/dev/vxge/vxge.c ============================================================================== --- head/sys/dev/vxge/vxge.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/dev/vxge/vxge.c Thu Mar 13 03:42:24 2014 (r263102) @@ -322,7 +322,7 @@ vxge_init_locked(vxge_dev_t *vdev) status = vxge_hal_device_mtu_check(vpath_handle, ifp->if_mtu); if (status != VXGE_HAL_OK) { device_printf(vdev->ndev, - "invalid mtu size %ld specified\n", ifp->if_mtu); + "invalid mtu size %u specified\n", ifp->if_mtu); goto _exit1; } @@ -2908,7 +2908,7 @@ vxge_change_mtu(vxge_dev_t *vdev, unsign goto _exit0; (vdev->ifp)->if_mtu = new_mtu; - device_printf(vdev->ndev, "MTU changed to %ld\n", (vdev->ifp)->if_mtu); + device_printf(vdev->ndev, "MTU changed to %u\n", (vdev->ifp)->if_mtu); if (vdev->is_initialized) { if_down(vdev->ifp); @@ -3241,7 +3241,7 @@ vxge_device_hw_info_print(vxge_dev_t *vd snprintf(vdev->config.nic_attr[VXGE_PRINT_MTU_SIZE], sizeof(vdev->config.nic_attr[VXGE_PRINT_MTU_SIZE]), - "%lu", vdev->ifp->if_mtu); + "%u", vdev->ifp->if_mtu); snprintf(vdev->config.nic_attr[VXGE_PRINT_LRO_MODE], sizeof(vdev->config.nic_attr[VXGE_PRINT_LRO_MODE]), Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c ============================================================================== --- head/sys/mips/rmi/dev/nlge/if_nlge.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/mips/rmi/dev/nlge/if_nlge.c Thu Mar 13 03:42:24 2014 (r263102) @@ -697,7 +697,7 @@ nlge_msgring_handler(int bucket, int siz printf("ERROR: Tx fb error (%d) on port %d\n", tx_error, port); } - atomic_incr_long((tx_error) ? &ifp->if_oerrors: &ifp->if_opackets); + tx_error ? ifp->if_oerrors++ : ifp->if_opackets++; } else if (ctrl == CTRL_SNGL || ctrl == CTRL_START) { /* Rx Packet */ @@ -776,7 +776,7 @@ fail: NLGE_UNLOCK(sc); } m_freem(m); - atomic_incr_long(&ifp->if_iqdrops); + ifp->if_iqdrops++; } return (error); } @@ -825,7 +825,7 @@ nlge_rx(struct nlge_softc *sc, vm_paddr_ m->m_pkthdr.len = m->m_len = len; m->m_pkthdr.rcvif = ifp; - atomic_incr_long(&ifp->if_ipackets); + ifp->if_ipackets++; (*ifp->if_input)(ifp, m); } Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/net/if.h Thu Mar 13 03:42:24 2014 (r263102) @@ -74,32 +74,45 @@ struct if_clonereq { */ struct if_data { /* generic interface information */ - u_char ifi_type; /* ethernet, tokenring, etc */ - u_char ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc */ - u_char ifi_addrlen; /* media address length */ - u_char ifi_hdrlen; /* media header length */ - u_char ifi_link_state; /* current link state */ - u_char ifi_vhid; /* carp vhid */ - u_char ifi_baudrate_pf; /* baudrate power factor */ - u_char ifi_datalen; /* length of this data struct */ - u_long ifi_mtu; /* maximum transmission unit */ - u_long ifi_metric; /* routing metric (external only) */ - u_long ifi_baudrate; /* linespeed */ + uint8_t ifi_type; /* ethernet, tokenring, etc */ + uint8_t ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc */ + uint8_t ifi_addrlen; /* media address length */ + uint8_t ifi_hdrlen; /* media header length */ + uint8_t ifi_link_state; /* current link state */ + uint8_t ifi_vhid; /* carp vhid */ + uint16_t ifi_datalen; /* length of this data struct */ + uint32_t ifi_mtu; /* maximum transmission unit */ + uint32_t ifi_metric; /* routing metric (external only) */ + uint64_t ifi_baudrate; /* linespeed */ /* volatile statistics */ - u_long ifi_ipackets; /* packets received on interface */ - u_long ifi_ierrors; /* input errors on interface */ - u_long ifi_opackets; /* packets sent on interface */ - u_long ifi_oerrors; /* output errors on interface */ - u_long ifi_collisions; /* collisions on csma interfaces */ - u_long ifi_ibytes; /* total number of octets received */ - u_long ifi_obytes; /* total number of octets sent */ - u_long ifi_imcasts; /* packets received via multicast */ - u_long ifi_omcasts; /* packets sent via multicast */ - u_long ifi_iqdrops; /* dropped on input, this interface */ - u_long ifi_noproto; /* destined for unsupported protocol */ - uint64_t ifi_hwassist; /* HW offload capabilities, see IFCAP */ - time_t ifi_epoch; /* uptime at attach or stat reset */ - struct timeval ifi_lastchange; /* time of last administrative change */ + uint64_t ifi_ipackets; /* packets received on interface */ + uint64_t ifi_ierrors; /* input errors on interface */ + uint64_t ifi_opackets; /* packets sent on interface */ + uint64_t ifi_oerrors; /* output errors on interface */ + uint64_t ifi_collisions; /* collisions on csma interfaces */ + uint64_t ifi_ibytes; /* total number of octets received */ + uint64_t ifi_obytes; /* total number of octets sent */ + uint64_t ifi_imcasts; /* packets received via multicast */ + uint64_t ifi_omcasts; /* packets sent via multicast */ + uint64_t ifi_iqdrops; /* dropped on input */ + uint64_t ifi_oqdrops; /* dropped on output */ + uint64_t ifi_noproto; /* destined for unsupported protocol */ + uint64_t ifi_hwassist; /* HW offload capabilities, see IFCAP */ + + /* Unions are here to make sizes MI. */ + union { /* uptime at attach or stat reset */ + time_t tt; + uint64_t ph; + } __ifi_epoch; +#define ifi_epoch __ifi_epoch.tt + union { /* time of last administrative change */ + struct timeval tv; + struct { + uint64_t ph1; + uint64_t ph2; + } ph; + } __ifi_lastchange; +#define ifi_lastchange __ifi_lastchange.tv }; /*- Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/net/if_bridge.c Thu Mar 13 03:42:24 2014 (r263102) @@ -817,7 +817,7 @@ bridge_ioctl(struct ifnet *ifp, u_long c BRIDGE_LOCK(sc); LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { if (bif->bif_ifp->if_mtu != ifr->ifr_mtu) { - log(LOG_NOTICE, "%s: invalid MTU: %lu(%s)" + log(LOG_NOTICE, "%s: invalid MTU: %u(%s)" " != %d\n", sc->sc_ifp->if_xname, bif->bif_ifp->if_mtu, bif->bif_ifp->if_xname, ifr->ifr_mtu); @@ -1107,7 +1107,7 @@ bridge_ioctl_add(struct bridge_softc *sc if (LIST_EMPTY(&sc->sc_iflist)) sc->sc_ifp->if_mtu = ifs->if_mtu; else if (sc->sc_ifp->if_mtu != ifs->if_mtu) { - if_printf(sc->sc_ifp, "invalid MTU: %lu(%s) != %lu\n", + if_printf(sc->sc_ifp, "invalid MTU: %u(%s) != %u\n", ifs->if_mtu, ifs->if_xname, sc->sc_ifp->if_mtu); return (EINVAL); } Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/net/if_epair.c Thu Mar 13 03:42:24 2014 (r263102) @@ -824,7 +824,7 @@ epair_clone_create(struct if_clone *ifc, sca->if_qflush = ifp->if_qflush; ifp->if_qflush = epair_qflush; ifp->if_transmit = epair_transmit; - if_initbaudrate(ifp, IF_Gbps(10)); /* arbitrary maximum */ + ifp->if_baudrate = IF_Gbps(10); /* arbitrary maximum */ /* Swap the name and finish initialization of interface b. */ *dp = 'b'; @@ -850,7 +850,7 @@ epair_clone_create(struct if_clone *ifc, scb->if_qflush = ifp->if_qflush; ifp->if_qflush = epair_qflush; ifp->if_transmit = epair_transmit; - if_initbaudrate(ifp, IF_Gbps(10)); /* arbitrary maximum */ + ifp->if_baudrate = IF_Gbps(10); /* arbitrary maximum */ /* * Restore name to a as the ifp for this will go into the Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/net/if_var.h Thu Mar 13 03:42:24 2014 (r263102) @@ -215,7 +215,6 @@ struct ifnet { #define if_metric if_data.ifi_metric #define if_link_state if_data.ifi_link_state #define if_baudrate if_data.ifi_baudrate -#define if_baudrate_pf if_data.ifi_baudrate_pf #define if_hwassist if_data.ifi_hwassist #define if_ipackets if_data.ifi_ipackets #define if_ierrors if_data.ifi_ierrors @@ -326,18 +325,6 @@ EVENTHANDLER_DECLARE(group_change_event, #define IF_AFDATA_WLOCK_ASSERT(ifp) rw_assert(&(ifp)->if_afdata_lock, RA_WLOCKED) #define IF_AFDATA_UNLOCK_ASSERT(ifp) rw_assert(&(ifp)->if_afdata_lock, RA_UNLOCKED) -static __inline void -if_initbaudrate(struct ifnet *ifp, uintmax_t baud) -{ - - ifp->if_baudrate_pf = 0; - while (baud > (u_long)(~0UL)) { - baud /= 10; - ifp->if_baudrate_pf++; - } - ifp->if_baudrate = baud; -} - /* * 72 was chosen below because it is the size of a TCP/IP * header (40) + the minimum mss (32). Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/net/rtsock.c Thu Mar 13 03:42:24 2014 (r263102) @@ -73,34 +73,6 @@ #include #include -struct if_data32 { - uint8_t ifi_type; - uint8_t ifi_physical; - uint8_t ifi_addrlen; - uint8_t ifi_hdrlen; - uint8_t ifi_link_state; - uint8_t ifi_vhid; - uint8_t ifi_baudrate_pf; - uint8_t ifi_datalen; - uint32_t ifi_mtu; - uint32_t ifi_metric; - uint32_t ifi_baudrate; - uint32_t ifi_ipackets; - uint32_t ifi_ierrors; - uint32_t ifi_opackets; - uint32_t ifi_oerrors; - uint32_t ifi_collisions; - uint32_t ifi_ibytes; - uint32_t ifi_obytes; - uint32_t ifi_imcasts; - uint32_t ifi_omcasts; - uint32_t ifi_iqdrops; - uint32_t ifi_noproto; - uint32_t ifi_hwassist; - int32_t ifi_epoch; - struct timeval32 ifi_lastchange; -}; - struct if_msghdr32 { uint16_t ifm_msglen; uint8_t ifm_version; @@ -108,7 +80,7 @@ struct if_msghdr32 { int32_t ifm_addrs; int32_t ifm_flags; uint16_t ifm_index; - struct if_data32 ifm_data; + struct if_data ifm_data; }; struct if_msghdrl32 { @@ -121,7 +93,7 @@ struct if_msghdrl32 { uint16_t _ifm_spare1; uint16_t ifm_len; uint16_t ifm_data_off; - struct if_data32 ifm_data; + struct if_data ifm_data; }; struct ifa_msghdrl32 { @@ -135,7 +107,7 @@ struct ifa_msghdrl32 { uint16_t ifam_len; uint16_t ifam_data_off; int32_t ifam_metric; - struct if_data32 ifam_data; + struct if_data ifam_data; }; #endif /* COMPAT_FREEBSD32 */ @@ -1598,79 +1570,44 @@ sysctl_dumpentry(struct radix_node *rn, return (error); } -#ifdef COMPAT_FREEBSD32 -static void -copy_ifdata32(struct if_data *src, struct if_data32 *dst) -{ - - bzero(dst, sizeof(*dst)); - CP(*src, *dst, ifi_type); - CP(*src, *dst, ifi_physical); - CP(*src, *dst, ifi_addrlen); - CP(*src, *dst, ifi_hdrlen); - CP(*src, *dst, ifi_link_state); - CP(*src, *dst, ifi_vhid); - CP(*src, *dst, ifi_baudrate_pf); - dst->ifi_datalen = sizeof(struct if_data32); - CP(*src, *dst, ifi_mtu); - CP(*src, *dst, ifi_metric); - CP(*src, *dst, ifi_baudrate); - CP(*src, *dst, ifi_ipackets); - CP(*src, *dst, ifi_ierrors); - CP(*src, *dst, ifi_opackets); - CP(*src, *dst, ifi_oerrors); - CP(*src, *dst, ifi_collisions); - CP(*src, *dst, ifi_ibytes); - CP(*src, *dst, ifi_obytes); - CP(*src, *dst, ifi_imcasts); - CP(*src, *dst, ifi_omcasts); - CP(*src, *dst, ifi_iqdrops); - CP(*src, *dst, ifi_noproto); - CP(*src, *dst, ifi_hwassist); - CP(*src, *dst, ifi_epoch); - TV_CP(*src, *dst, ifi_lastchange); -} -#endif - static int sysctl_iflist_ifml(struct ifnet *ifp, struct rt_addrinfo *info, struct walkarg *w, int len) { struct if_msghdrl *ifm; + struct if_data *ifd; + + ifm = (struct if_msghdrl *)w->w_tmem; #ifdef COMPAT_FREEBSD32 if (w->w_req->flags & SCTL_MASK32) { struct if_msghdrl32 *ifm32; - ifm32 = (struct if_msghdrl32 *)w->w_tmem; + ifm32 = (struct if_msghdrl32 *)ifm; ifm32->ifm_addrs = info->rti_addrs; ifm32->ifm_flags = ifp->if_flags | ifp->if_drv_flags; ifm32->ifm_index = ifp->if_index; ifm32->_ifm_spare1 = 0; ifm32->ifm_len = sizeof(*ifm32); ifm32->ifm_data_off = offsetof(struct if_msghdrl32, ifm_data); - - copy_ifdata32(&ifp->if_data, &ifm32->ifm_data); - /* Fixup if_data carp(4) vhid. */ - if (carp_get_vhid_p != NULL) - ifm32->ifm_data.ifi_vhid = - (*carp_get_vhid_p)(ifp->if_addr); - - return (SYSCTL_OUT(w->w_req, (caddr_t)ifm32, len)); - } + ifd = &ifm32->ifm_data; + } else #endif - ifm = (struct if_msghdrl *)w->w_tmem; - ifm->ifm_addrs = info->rti_addrs; - ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; - ifm->ifm_index = ifp->if_index; - ifm->_ifm_spare1 = 0; - ifm->ifm_len = sizeof(*ifm); - ifm->ifm_data_off = offsetof(struct if_msghdrl, ifm_data); + { + ifm->ifm_addrs = info->rti_addrs; + ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; + ifm->ifm_index = ifp->if_index; + ifm->_ifm_spare1 = 0; + ifm->ifm_len = sizeof(*ifm); + ifm->ifm_data_off = offsetof(struct if_msghdrl, ifm_data); + ifd = &ifm->ifm_data; + } + + *ifd = ifp->if_data; - ifm->ifm_data = ifp->if_data; /* Fixup if_data carp(4) vhid. */ if (carp_get_vhid_p != NULL) - ifm->ifm_data.ifi_vhid = (*carp_get_vhid_p)(ifp->if_addr); + ifd->ifi_vhid = (*carp_get_vhid_p)(ifp->if_addr); return (SYSCTL_OUT(w->w_req, (caddr_t)ifm, len)); } @@ -1680,34 +1617,32 @@ sysctl_iflist_ifm(struct ifnet *ifp, str struct walkarg *w, int len) { struct if_msghdr *ifm; + struct if_data *ifd; + + ifm = (struct if_msghdr *)w->w_tmem; #ifdef COMPAT_FREEBSD32 if (w->w_req->flags & SCTL_MASK32) { struct if_msghdr32 *ifm32; - ifm32 = (struct if_msghdr32 *)w->w_tmem; + ifm32 = (struct if_msghdr32 *)ifm; ifm32->ifm_addrs = info->rti_addrs; ifm32->ifm_flags = ifp->if_flags | ifp->if_drv_flags; ifm32->ifm_index = ifp->if_index; - - copy_ifdata32(&ifp->if_data, &ifm32->ifm_data); - /* Fixup if_data carp(4) vhid. */ - if (carp_get_vhid_p != NULL) - ifm32->ifm_data.ifi_vhid = - (*carp_get_vhid_p)(ifp->if_addr); - - return (SYSCTL_OUT(w->w_req, (caddr_t)ifm32, len)); - } + ifd = &ifm32->ifm_data; + } else #endif - ifm = (struct if_msghdr *)w->w_tmem; - ifm->ifm_addrs = info->rti_addrs; - ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; - ifm->ifm_index = ifp->if_index; + { + ifm->ifm_addrs = info->rti_addrs; + ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; + ifm->ifm_index = ifp->if_index; + ifd = &ifm->ifm_data; + } - ifm->ifm_data = ifp->if_data; + *ifd = ifp->if_data; /* Fixup if_data carp(4) vhid. */ if (carp_get_vhid_p != NULL) - ifm->ifm_data.ifi_vhid = (*carp_get_vhid_p)(ifp->if_addr); + ifd->ifi_vhid = (*carp_get_vhid_p)(ifp->if_addr); return (SYSCTL_OUT(w->w_req, (caddr_t)ifm, len)); } @@ -1717,12 +1652,15 @@ sysctl_iflist_ifaml(struct ifaddr *ifa, struct walkarg *w, int len) { struct ifa_msghdrl *ifam; + struct if_data *ifd; + + ifam = (struct ifa_msghdrl *)w->w_tmem; #ifdef COMPAT_FREEBSD32 if (w->w_req->flags & SCTL_MASK32) { struct ifa_msghdrl32 *ifam32; - ifam32 = (struct ifa_msghdrl32 *)w->w_tmem; + ifam32 = (struct ifa_msghdrl32 *)ifam; ifam32->ifam_addrs = info->rti_addrs; ifam32->ifam_flags = ifa->ifa_flags; ifam32->ifam_index = ifa->ifa_ifp->if_index; @@ -1731,45 +1669,30 @@ sysctl_iflist_ifaml(struct ifaddr *ifa, ifam32->ifam_data_off = offsetof(struct ifa_msghdrl32, ifam_data); ifam32->ifam_metric = ifa->ifa_metric; - - bzero(&ifam32->ifam_data, sizeof(ifam32->ifam_data)); - ifam32->ifam_data.ifi_datalen = sizeof(struct if_data32); - ifam32->ifam_data.ifi_ipackets = - counter_u64_fetch(ifa->ifa_ipackets); - ifam32->ifam_data.ifi_opackets = - counter_u64_fetch(ifa->ifa_opackets); - ifam32->ifam_data.ifi_ibytes = - counter_u64_fetch(ifa->ifa_ibytes); - ifam32->ifam_data.ifi_obytes = - counter_u64_fetch(ifa->ifa_obytes); - - /* Fixup if_data carp(4) vhid. */ - if (carp_get_vhid_p != NULL) - ifam32->ifam_data.ifi_vhid = (*carp_get_vhid_p)(ifa); - - return (SYSCTL_OUT(w->w_req, (caddr_t)ifam32, len)); - } + ifd = &ifam32->ifam_data; + } else #endif - - ifam = (struct ifa_msghdrl *)w->w_tmem; - ifam->ifam_addrs = info->rti_addrs; - ifam->ifam_flags = ifa->ifa_flags; - ifam->ifam_index = ifa->ifa_ifp->if_index; - ifam->_ifam_spare1 = 0; - ifam->ifam_len = sizeof(*ifam); - ifam->ifam_data_off = offsetof(struct ifa_msghdrl, ifam_data); - ifam->ifam_metric = ifa->ifa_metric; - - bzero(&ifam->ifam_data, sizeof(ifam->ifam_data)); - ifam->ifam_data.ifi_datalen = sizeof(struct if_data); - ifam->ifam_data.ifi_ipackets = counter_u64_fetch(ifa->ifa_ipackets); - ifam->ifam_data.ifi_opackets = counter_u64_fetch(ifa->ifa_opackets); - ifam->ifam_data.ifi_ibytes = counter_u64_fetch(ifa->ifa_ibytes); - ifam->ifam_data.ifi_obytes = counter_u64_fetch(ifa->ifa_obytes); + { + ifam->ifam_addrs = info->rti_addrs; + ifam->ifam_flags = ifa->ifa_flags; + ifam->ifam_index = ifa->ifa_ifp->if_index; + ifam->_ifam_spare1 = 0; + ifam->ifam_len = sizeof(*ifam); + ifam->ifam_data_off = offsetof(struct ifa_msghdrl, ifam_data); + ifam->ifam_metric = ifa->ifa_metric; + ifd = &ifam->ifam_data; + } + + bzero(ifd, sizeof(*ifd)); + ifd->ifi_datalen = sizeof(struct if_data); + ifd->ifi_ipackets = counter_u64_fetch(ifa->ifa_ipackets); + ifd->ifi_opackets = counter_u64_fetch(ifa->ifa_opackets); + ifd->ifi_ibytes = counter_u64_fetch(ifa->ifa_ibytes); + ifd->ifi_obytes = counter_u64_fetch(ifa->ifa_obytes); /* Fixup if_data carp(4) vhid. */ if (carp_get_vhid_p != NULL) - ifam->ifam_data.ifi_vhid = (*carp_get_vhid_p)(ifa); + ifd->ifi_vhid = (*carp_get_vhid_p)(ifa); return (SYSCTL_OUT(w->w_req, w->w_tmem, len)); } Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Thu Mar 13 03:42:24 2014 (r263102) @@ -876,7 +876,7 @@ ipoib_intf_alloc(const char *name) dev->if_output = ipoib_output; dev->if_input = ipoib_input; dev->if_resolvemulti = ipoib_resolvemulti; - if_initbaudrate(dev, IF_Gbps(10)); + dev->if_baudrate = IF_Gbps(10); dev->if_broadcastaddr = priv->broadcastaddr; dev->if_snd.ifq_maxlen = ipoib_sendq_size * 2; sdl = (struct sockaddr_dl *)dev->if_addr->ifa_addr; Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_netdev.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/ofed/drivers/net/mlx4/en_netdev.c Thu Mar 13 03:42:24 2014 (r263102) @@ -328,7 +328,7 @@ static void mlx4_en_set_default_moderati */ priv->rx_frames = MLX4_EN_RX_COAL_TARGET / priv->dev->if_mtu + 1; priv->rx_usecs = MLX4_EN_RX_COAL_TIME; - en_dbg(INTR, priv, "Default coalesing params for mtu:%ld - " + en_dbg(INTR, priv, "Default coalesing params for mtu:%u - " "rx_frames:%d rx_usecs:%d\n", priv->dev->if_mtu, priv->rx_frames, priv->rx_usecs); @@ -972,7 +972,7 @@ static int mlx4_en_change_mtu(struct net struct mlx4_en_dev *mdev = priv->mdev; int err = 0; - en_dbg(DRV, priv, "Change MTU called - current:%ld new:%d\n", + en_dbg(DRV, priv, "Change MTU called - current:%u new:%d\n", dev->if_mtu, new_mtu); if ((new_mtu < MLX4_EN_MIN_MTU) || (new_mtu > priv->max_mtu)) { Modified: head/sys/ofed/include/rdma/ib_addr.h ============================================================================== --- head/sys/ofed/include/rdma/ib_addr.h Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/ofed/include/rdma/ib_addr.h Thu Mar 13 03:42:24 2014 (r263102) @@ -247,19 +247,13 @@ static inline int iboe_get_rate(struct n #else static inline int iboe_get_rate(struct net_device *dev) { - uintmax_t baudrate; - int exp; - - baudrate = dev->if_baudrate; - for (exp = dev->if_baudrate_pf; exp > 0; exp--) - baudrate *= 10; - if (baudrate >= IF_Gbps(40)) + if (dev->if_baudrate >= IF_Gbps(40)) return IB_RATE_40_GBPS; - else if (baudrate >= IF_Gbps(30)) + else if (dev->if_baudrate >= IF_Gbps(30)) return IB_RATE_30_GBPS; - else if (baudrate >= IF_Gbps(20)) + else if (dev->if_baudrate >= IF_Gbps(20)) return IB_RATE_20_GBPS; - else if (baudrate >= IF_Gbps(10)) + else if (dev->if_baudrate >= IF_Gbps(10)) return IB_RATE_10_GBPS; else return IB_RATE_PORT_CURRENT; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Mar 13 03:42:00 2014 (r263101) +++ head/sys/sys/param.h Thu Mar 13 03:42:24 2014 (r263102) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100010 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100011 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/tools/tools/ifinfo/ifinfo.c ============================================================================== --- head/tools/tools/ifinfo/ifinfo.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/tools/tools/ifinfo/ifinfo.c Thu Mar 13 03:42:24 2014 (r263102) @@ -171,8 +171,6 @@ printit(const struct ifmibdata *ifmd, co printf("\theader length: %d\n", ifmd->ifmd_data.ifi_hdrlen); printf("\tlink state: %u\n", ifmd->ifmd_data.ifi_link_state); printf("\tvhid: %u\n", ifmd->ifmd_data.ifi_vhid); - printf("\tbaudrate power factor: %u\n", - ifmd->ifmd_data.ifi_baudrate_pf); printf("\tdatalen: %u\n", ifmd->ifmd_data.ifi_datalen); printf("\tmtu: %lu\n", ifmd->ifmd_data.ifi_mtu); printf("\tmetric: %lu\n", ifmd->ifmd_data.ifi_metric); Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Thu Mar 13 03:42:00 2014 (r263101) +++ head/usr.bin/netstat/if.c Thu Mar 13 03:42:24 2014 (r263102) @@ -438,9 +438,11 @@ intpr(int interval, void (*pfunc)(char * printf("%*s %-17.17s", Wflag ? 27 : 25, "", fmt); if (ifma->ifma_addr->sa_family == AF_LINK) { - printf(" %8lu", IFA_STAT(imcasts)); + printf(" %8ju", + (uintmax_t )IFA_STAT(imcasts)); printf("%*s", bflag ? 17 : 6, ""); - printf(" %8lu", IFA_STAT(omcasts)); + printf(" %8ju", + (uintmax_t )IFA_STAT(omcasts)); } putchar('\n'); } From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 05:11:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54726B9A; Thu, 13 Mar 2014 05:11:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3551F354; Thu, 13 Mar 2014 05:11:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2D5BwBf000825; Thu, 13 Mar 2014 05:11:58 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2D5Bu10000813; Thu, 13 Mar 2014 05:11:56 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201403130511.s2D5Bu10000813@svn.freebsd.org> From: Glen Barber Date: Thu, 13 Mar 2014 05:11:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263105 - in head/share/man: man4 man8 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 05:11:58 -0000 Author: gjb Date: Thu Mar 13 05:11:56 2014 New Revision: 263105 URL: http://svnweb.freebsd.org/changeset/base/263105 Log: Add hyperv manual pages provided by Microsoft, formatted for FreeBSD standards. Very little, if any, content was modified. These are not yet linked to the build. Submitted by: Abhishek Gupta (abgupta!microsoft dot com) Sponsored by: The FreeBSD Foundation Added: head/share/man/man4/hv_ata_pci_disengage.4 (contents, props changed) head/share/man/man4/hv_kvp.4 (contents, props changed) head/share/man/man4/hv_netvsc.4 (contents, props changed) head/share/man/man4/hv_storvsc.4 (contents, props changed) head/share/man/man4/hv_utils.4 (contents, props changed) head/share/man/man4/hv_vmbus.4 (contents, props changed) head/share/man/man8/hv_kvp_daemon.8 (contents, props changed) Added: head/share/man/man4/hv_ata_pci_disengage.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/hv_ata_pci_disengage.4 Thu Mar 13 05:11:56 2014 (r263105) @@ -0,0 +1,90 @@ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2012 Microsoft Corp. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd September 10, 2013 +.Dt HYPER-V 4 +.Os +.Sh NAME +.Nm hv_ata_pci_disengage +.Nd Hyper-V ATA PCI Disengage driver +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in +the system kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hyperv" +.Ed +.Sh DESCRIPTION +The +.Nm +driver prevents the native +.Fx +ATA driver from +loading in the presence of Hyper-V. +.Fx +guests running on Hyper-V can take advantage of the Hyper-V Storage +Virtual Consumer +.Pq Xr hv_storvsc 4 +for using their IDE devices. +Since the ATA +driver serves IDE devices as well, there is a chance that the ATA driver may +interfere with the operations of +.Xr hv_storvsc 4 . +The +.Nm +driver avoids +conflicts between the ATA driver and +.Xr hv_storvsc 4 +by disabling the ATA driver +when the +.Fx +guest is booting. +.Pp +A side effect of disabling the ATA driver is that CDROM may become +inoperational on +.Fx +guest partitions. +If CDROM access is a must then users may use +"set hw.ata.disk_enable=1" at boot time to prevent the ATA driver from being +disabled. +.Sh SEE ALSO +.Xr hv_vmbus 4 , +.Xr hv_utils 4 , +.Xr hv_netvsc 4 , +.Xr hv_storvsc 4 +.Sh HISTORY +Support for +.Nm +first appeared in +.Fx 10.0 . +The driver was developed through a joint effort between Citrix Incorporated, +Microsoft Corporation, and Network Appliance Incorporated. +.Sh AUTHORS +.An -nosplit +.Fx +support for +.Nm +was first added by +.An Microsoft BSD Integration Services Team Aq bsdic@microsoft.com . Added: head/share/man/man4/hv_kvp.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/hv_kvp.4 Thu Mar 13 05:11:56 2014 (r263105) @@ -0,0 +1,96 @@ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2012 Microsoft Corp. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd September 10, 2013 +.Dt HYPER-V 4 +.Os +.Sh NAME +.Nm hv_kvp +.Nd Hyper-V Key Value Pair Driver +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in +the system kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hyperv" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides the ability to store, retrieve, modify and delete +key value pairs for +.Fx +guest partitions running on Hyper-V. +Hyper-V allows administrators to store custom metadata in the form +of key value pairs inside the +.Fx +guest partition. +Administrators can use Windows Powershell scripts to add, read, +modify and delete such key value pairs. +.Pp +The driver is bare bones and merely forwards requests to its counterpart +user mode daemon, +.Xr hv_kvp_daemon 8 . +The daemon maintains pools of key value +pairs and does the actual metadata management. +.Pp +The same driver and daemon combination are also used to set and get +IP addresses from a +.Fx +guest. +.Pp +The set functionality is particularly +useful when the +.Fx +guest is assigned a static IP address and is failed over from one +Hyper-V host to another. +After failover, Hyper-V uses the set IP functionality to automatically +update the +.Fx +guest's IP address to its original static value. +.Pp +On the other hand, the get IP functionality is used to update the guest IP +address in the Hyper-V management console window. +.Sh SEE ALSO +.Xr hv_vmbus 4 , +.Xr hv_utils 4 , +.Xr hv_netvsc 4 , +.Xr hv_storvsc 4 , +.Xr hv_ata_pci_disengage 4 , +.Xr hv_kvp_daemon 8 +.Sh HISTORY +Support for +.Nm +first appeared in +.Fx 10.0 . +The driver was developed through a joint effort between Citrix +Incorporated, Microsoft Corporation and Network Appliance Incorporated. +.Sh AUTHORS +.An -nosplit +.Fx +support for +.Nm +was first added by +.An Microsoft BSD Integration Services Team Aq bsdic@microsoft.com . Added: head/share/man/man4/hv_netvsc.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/hv_netvsc.4 Thu Mar 13 05:11:56 2014 (r263105) @@ -0,0 +1,83 @@ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2012 Microsoft Corp. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd September 10, 2013 +.Dt HYPER-V 4 +.Os +.Sh NAME +.Nm hv_netvsc +.Nd Hyper-V Network Virtual Service Consumer +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in +the system kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hyperv" +.Ed +.Sh DESCRIPTION +The +.Nm +driver implements the virtual network device for +.Fx +guest +partitions running on Hyper-V. +.Fx +guest partitions running on Hyper-V do not have direct access to +network devices attached to the Hyper-V server. +Although a +.Fx +guest can access network devices using Hyper-V's +full emulation mode, the performance in this mode tends to be unsatisfactory. +.Pp +To counter the above issues, the +.Nm +driver implements a network +Virtual +Service Consumer (VSC) that relays network requests from the guest partition +to the network Virtual Service Provider (VSP) hosted in the root partition +using the high performance data exchange infrastructure provided by +.Xr hv_vmbus 4 +driver. +The VSP in the root partition then forwards the network related requests to +the physical network card. +.Sh SEE ALSO +.Xr hv_vmbus 4 , +.Xr hv_utils 4 , +.Xr hv_storvsc 4 , +.Xr hv_ata_pci_disengage 4 +.Sh HISTORY +Support for +.Nm +first appeared in +.Fx 10.0 . +The driver was developed through a joint effort between Citrix Incorporated, +Microsoft Corporation, and Network Appliance Incorporated. +.Sh AUTHORS +.An -nosplit +.Fx +support for +.Nm +was first added by +.An Microsoft BSD Integration Services Team Aq bsdic@microsoft.com . Added: head/share/man/man4/hv_storvsc.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/hv_storvsc.4 Thu Mar 13 05:11:56 2014 (r263105) @@ -0,0 +1,89 @@ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2012 Microsoft Corp. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd September 10, 2013 +.Dt HYPER-V 4 +.Os +.Sh NAME +.Nm hv_storvsc +.Nd Hyper-V Storage Virtual Service Consumer +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in +the system kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hyperv" +.Ed +.Sh DESCRIPTION +The +.Nm +driver implements the virtual store device for +.Fx +guest +partitions running on Hyper-V. +.Fx +guest partitions running on Hyper-V do not have direct access to +storage devices attached to the Hyper-V server. +Although a +.Fx +guest can access storage devices using Hyper-V's +full emulation mode, the performance in this mode tends to be unsatisfactory. +.Pp +To counter the above issues, the +.Nm +driver implements a storage +Virtual +Service Consumer (VSC) that relays storage requests from the guest partition +to the storage Virtual Service Provider (VSP) hosted in the root partition +using the high performance data exchange infrastructure provided by +.Xr hv_vmbus 4 +driver. +The VSP in the root partition then forwards the storage related requests to +the physical storage device. +.Pp +This driver functions by presenting a SCSI HBA interface to the Comman Access +Method (CAM) layer. +CAM control blocks (CCBs) are +converted into VSCSI protocol messages which are delivered to the root +partition VSP over the Hyper-V VMBus. +.Sh SEE ALSO +.Xr hv_vmbus 4 , +.Xr hv_utils 4 , +.Xr hv_netvsc 4 , +.Xr hv_ata_pci_disengage 4 +.Sh HISTORY +Support for +.Nm +first appeared in +.Fx 10.0 . +The driver was developed through a joint effort between Citrix Incorporated, +Microsoft Corporation, and Network Appliance Incorporated. +.Sh AUTHORS +.An -nosplit +.Fx +support for +.Nm +was first added by +.An Microsoft BSD Integration Services Team Aq bsdic@microsoft.com . Added: head/share/man/man4/hv_utils.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/hv_utils.4 Thu Mar 13 05:11:56 2014 (r263105) @@ -0,0 +1,85 @@ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2012 Microsoft Corp. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd September 10, 2013 +.Dt HYPER-V 4 +.Os +.Sh NAME +.Nm hv_utils +.Nd Hyper-V Utilities Driver +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in +the system kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hyperv" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides time keeping, shutdown and heartbeat +functionality for +.Fx +guest partitions running on Hyper-V. +Hyper-V is a hypervisor-based virtualization technology from Microsoft. +The +.Nm +driver is one of the core drivers required to be present in guest +partitions running on Hyper-V. +This driver provides the following +functionalities to guest partitions: +.Pp +(a) Time Keeping: The clock inside the guest partition will remain accurate by +synchronizing to the clock on the virtualization server via Timesync service, +and with the help of the pluggable time source device. +.Pp +(b) Integrated shutdown: Guest partitions running +.Fx +can be shut down from +Hyper-V Manager console by using the +.Qq Shut down +command. +.Pp +(c) Heartbeat: This feature allows the virtualization server to detect whether +the guest partition is running and responsive. +.Sh SEE ALSO +.Xr hv_vmbus 4 , +.Xr hv_netvsc 4 , +.Xr hv_storvsc 4 , +.Xr hv_ata_pci_disengage 4 +.Sh HISTORY +Support for +.Nm +first appeared in +.Fx 10.0 . +The driver was developed through a joint effort between Citrix Incorporated, +Microsoft Corporation, and Network Appliance Incorporated. +.Sh AUTHORS +.An -nosplit +.Fx +support for +.Nm +was first added by +.An Microsoft BSD Integration Services Team Aq bsdic@microsoft.com . Added: head/share/man/man4/hv_vmbus.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/hv_vmbus.4 Thu Mar 13 05:11:56 2014 (r263105) @@ -0,0 +1,93 @@ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2012 Microsoft Corp. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd September 10, 2013 +.Dt HYPER-V 4 +.Os +.Sh NAME +.Nm hv_vmbus +.Nd Hyper-V Virtual Machine Bus (VMBus) Driver +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in +the system kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hyperv" +.Ed +.Sh DESCRIPTION +The +.Nm +provides a high performance communication interface between +guest and root partitions in Hyper-V. +Hyper-V is a hypervisor-based virtualization technology from Microsoft. +Hyper-V supports isolation in terms of a partition. +A partition is a +logical unit of isolation, supported by the hypervisor, in which +operating systems execute. +.Pp +The Microsoft hypervisor must have at least one parent, or root, +partition, running Windows Server operating system. +The virtualization stack runs in the parent partition and has +direct access to the hardware devices. +The root partition then creates the child partitions which host +the guest operating systems. +.Pp +Child partitions do not have direct access to other hardware resources +and are presented +a virtual view of the resources, as virtual devices (VDevs). +Requests to the virtual devices are +redirected either via the VMBus or the hypervisor to the devices in +the parent partition, which handles the requests. +.Pp +The VMBus is a logical inter-partition communication channel. +The parent partition hosts Virtualization Service Providers (VSPs) +which communicate over the VMBus to handle device access requests from +child partitions. +Child partitions host Virtualization Service +Consumers (VSCs) which redirect device requests to VSPs in the parent +partition via the VMBus. +The Hyper-V VMBus driver defines and implements +the interface that facilitate high performance bi-directional communication +between the VSCs and VSPs. +All VSCs utilize the VMBus driver. +.Sh SEE ALSO +.Xr hv_utils 4 , +.Xr hv_netvsc 4 , +.Xr hv_storvsc 4 , +.Xr hv_ata_pci_disengage 4 +.Sh HISTORY +Support for +.Nm +first appeared in +.Fx 10.0 . +The driver was developed through a joint effort between Citrix Incorporated, +Microsoft Corporation, and Network Appliance Incorporated. +.Sh AUTHORS +.An -nosplit +.Fx +support for +.Nm +was first added by +.An Microsoft BSD Integration Services Team Aq bsdic@microsoft.com . Added: head/share/man/man8/hv_kvp_daemon.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man8/hv_kvp_daemon.8 Thu Mar 13 05:11:56 2014 (r263105) @@ -0,0 +1,96 @@ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2012 Microsoft Corp. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd September 10, 2013 +.Dt HYPER-V 4 +.Os +.Sh NAME +.Nm hv_kvp_daemon +.Nd Hyper-V Key Value Pair Daemon +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in +the system kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hyperv" +.Ed +.Sh DESCRIPTION +The +.Nm +daemon provides the ability to store, retrieve, modify and delete +Key Value pairs for +.Fx +guest partitions running on Hyper-V. +Hyper-V allows administrators to store custom metadata in the form +of Key Value pairs inside the +.Fx +guest partition. +Administrators can use Windows Powershell scripts to add, read, modify +and delete such Key Value pairs. +.Pp +The +.Nm +accepts Key Value pair management requests from the +.Xr hv_kvp 4 +driver and performs the actual metadata management on the file-system. +.Pp +The same daemon and driver combination is also used to set and get +IP addresses from a +.Fx +guest. +.Pp +The set functionality is particularly +useful when the +.Fx +guest is assigned a static IP address and is failed +over from one Hyper-V host to another. +After failover, Hyper-V uses the set IP functionality to automatically +update the +.Fx +guest's IP address to its original static value. +.Pp +On the other hand, the get IP functionality is used to update the guest IP +address in the Hyper-V management console window. +.Sh SEE ALSO +.Xr hv_vmbus 4 , +.Xr hv_utils 4 , +.Xr hv_netvsc 4 , +.Xr hv_storvsc 4 , +.Xr hv_ata_pci_disengage 4 , +.Xr hv_kvp 4 +.Sh HISTORY +Support for +.Nm +first appeared in +.Fx 10.0 . +The daemon was developed through a joint effort between Citrix Incorporated, +Microsoft Corporation, and Network Appliance Incorporated. +.Sh AUTHORS +.An -nosplit +.Fx +support for +.Nm +was first added by +.An Microsoft BSD Integration Services Team Aq bsdic@microsoft.com . From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 05:17:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F633D3C; Thu, 13 Mar 2014 05:17:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D0C5385; Thu, 13 Mar 2014 05:17:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2D5HsEQ001526; Thu, 13 Mar 2014 05:17:54 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2D5Hrv4001522; Thu, 13 Mar 2014 05:17:53 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201403130517.s2D5Hrv4001522@svn.freebsd.org> From: Glen Barber Date: Thu, 13 Mar 2014 05:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263106 - in head/share/man: man4 man8 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 05:17:54 -0000 Author: gjb Date: Thu Mar 13 05:17:53 2014 New Revision: 263106 URL: http://svnweb.freebsd.org/changeset/base/263106 Log: Connect the hyperv drivers to the build. MFC after: 5 days X-MFC-With: r263105 Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/Makefile head/share/man/man8/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Mar 13 05:11:56 2014 (r263105) +++ head/share/man/man4/Makefile Thu Mar 13 05:17:53 2014 (r263106) @@ -172,6 +172,12 @@ MAN= aac.4 \ ${_hptmv.4} \ ${_hptnr.4} \ ${_hptrr.4} \ + hv_ata_pci_disengage.4 \ + hv_kvp.4 \ + hv_netvsc.4 \ + hv_storvsc.4 \ + hv_utils.4 \ + hv_vmbus.4 \ hwpmc.4 \ ichsmb.4 \ ${_ichwd.4} \ Modified: head/share/man/man8/Makefile ============================================================================== --- head/share/man/man8/Makefile Thu Mar 13 05:11:56 2014 (r263105) +++ head/share/man/man8/Makefile Thu Mar 13 05:17:53 2014 (r263106) @@ -3,6 +3,7 @@ MAN= crash.8 \ diskless.8 \ + hv_kvp_daemon.8 \ intro.8 \ nanobsd.8 \ picobsd.8 \ From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 06:54:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5F9BF62; Thu, 13 Mar 2014 06:54:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A30F2CE1; Thu, 13 Mar 2014 06:54:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2D6sAGs041520; Thu, 13 Mar 2014 06:54:10 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2D6sAJ6041519; Thu, 13 Mar 2014 06:54:10 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201403130654.s2D6sAJ6041519@svn.freebsd.org> From: David Xu Date: Thu, 13 Mar 2014 06:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263107 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 06:54:10 -0000 Author: davidxu Date: Thu Mar 13 06:54:10 2014 New Revision: 263107 URL: http://svnweb.freebsd.org/changeset/base/263107 Log: To avoid missing a chance to cancel thread, call _pthread_testcancel at the beginning of _sem_timedwait. Submitted by: Eric van Gyzen < eric at vangyzen dot net > MFC after: 3 days Modified: head/lib/libc/gen/sem_new.c Modified: head/lib/libc/gen/sem_new.c ============================================================================== --- head/lib/libc/gen/sem_new.c Thu Mar 13 05:17:53 2014 (r263106) +++ head/lib/libc/gen/sem_new.c Thu Mar 13 06:54:10 2014 (r263107) @@ -381,6 +381,7 @@ _sem_timedwait(sem_t * __restrict sem, return (-1); retval = 0; + _pthread_testcancel(); for (;;) { while ((val = sem->_kern._count) > 0) { if (atomic_cmpset_acq_int(&sem->_kern._count, val, val - 1)) From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 15:57:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B3998DE; Thu, 13 Mar 2014 15:57:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6BDBAAE7; Thu, 13 Mar 2014 15:57:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2DFvREV062153; Thu, 13 Mar 2014 15:57:27 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2DFvQKK062146; Thu, 13 Mar 2014 15:57:26 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201403131557.s2DFvQKK062146@svn.freebsd.org> From: Ryan Stone Date: Thu, 13 Mar 2014 15:57:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263109 - head/sys/dev/puc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 15:57:27 -0000 Author: rstone Date: Thu Mar 13 15:57:25 2014 New Revision: 263109 URL: http://svnweb.freebsd.org/changeset/base/263109 Log: Add MSI support to puc(9) Add support for MSI interrupts in the puc(9) driver. By default the driver will prefer MSI interrupts to legacy interrupts. A tunable, hw.puc.msi_disable, has been added to force the allocation of legacy interrupts. Reviewed by: jhb@ MFC after: 2 weeks Sponsored by: Sandvine Inc. Modified: head/sys/dev/puc/puc.c head/sys/dev/puc/puc_bfe.h head/sys/dev/puc/puc_cfg.c head/sys/dev/puc/puc_pccard.c head/sys/dev/puc/puc_pci.c head/sys/dev/puc/pucdata.c Modified: head/sys/dev/puc/puc.c ============================================================================== --- head/sys/dev/puc/puc.c Thu Mar 13 14:34:25 2014 (r263108) +++ head/sys/dev/puc/puc.c Thu Mar 13 15:57:25 2014 (r263109) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -70,6 +71,8 @@ const char puc_driver_name[] = "puc"; static MALLOC_DEFINE(M_PUC, "PUC", "PUC driver"); +SYSCTL_NODE(_hw, OID_AUTO, puc, CTLFLAG_RD, 0, "puc(9) driver configuration"); + struct puc_bar * puc_get_bar(struct puc_softc *sc, int rid) { @@ -324,7 +327,6 @@ puc_bfe_attach(device_t dev) if (bootverbose && sc->sc_ilr != 0) device_printf(dev, "using interrupt latch register\n"); - sc->sc_irid = 0; sc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irid, RF_ACTIVE|RF_SHAREABLE); if (sc->sc_ires != NULL) { Modified: head/sys/dev/puc/puc_bfe.h ============================================================================== --- head/sys/dev/puc/puc_bfe.h Thu Mar 13 14:34:25 2014 (r263108) +++ head/sys/dev/puc/puc_bfe.h Thu Mar 13 15:57:25 2014 (r263109) @@ -66,6 +66,7 @@ struct puc_softc { int sc_fastintr:1; int sc_leaving:1; int sc_polled:1; + int sc_msi:1; int sc_ilr; @@ -94,4 +95,6 @@ int puc_bus_setup_intr(device_t, device_ driver_filter_t *, driver_intr_t *, void *, void **); int puc_bus_teardown_intr(device_t, device_t, struct resource *, void *); +SYSCTL_DECL(_hw_puc); + #endif /* _DEV_PUC_BFE_H_ */ Modified: head/sys/dev/puc/puc_cfg.c ============================================================================== --- head/sys/dev/puc/puc_cfg.c Thu Mar 13 14:34:25 2014 (r263108) +++ head/sys/dev/puc/puc_cfg.c Thu Mar 13 15:57:25 2014 (r263109) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/dev/puc/puc_pccard.c ============================================================================== --- head/sys/dev/puc/puc_pccard.c Thu Mar 13 14:34:25 2014 (r263108) +++ head/sys/dev/puc/puc_pccard.c Thu Mar 13 15:57:25 2014 (r263109) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/dev/puc/puc_pci.c ============================================================================== --- head/sys/dev/puc/puc_pci.c Thu Mar 13 14:34:25 2014 (r263108) +++ head/sys/dev/puc/puc_pci.c Thu Mar 13 15:57:25 2014 (r263109) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -78,6 +79,11 @@ __FBSDID("$FreeBSD$"); #include #include +static int puc_msi_disable; +TUNABLE_INT("hw.puc.msi_disable", &puc_msi_disable); +SYSCTL_INT(_hw_puc, OID_AUTO, msi_disable, CTLFLAG_RD | CTLFLAG_TUN, + &puc_msi_disable, 0, "Disable use of MSI interrupts by puc(9)"); + static const struct puc_cfg * puc_pci_match(device_t dev, const struct puc_cfg *desc) { @@ -120,11 +126,56 @@ puc_pci_probe(device_t dev) return (puc_bfe_probe(dev, desc)); } +static int +puc_pci_attach(device_t dev) +{ + struct puc_softc *sc; + int error, count; + + sc = device_get_softc(dev); + + if (!puc_msi_disable) { + count = 1; + + if (pci_alloc_msi(dev, &count) == 0) { + sc->sc_msi = 1; + sc->sc_irid = 1; + } + } + + error = puc_bfe_attach(dev); + + if (error != 0 && sc->sc_msi) + pci_release_msi(dev); + + return (error); +} + +static int +puc_pci_detach(device_t dev) +{ + struct puc_softc *sc; + int error; + + sc = device_get_softc(dev); + + error = puc_bfe_detach(dev); + + if (error != 0) + return (error); + + if (sc->sc_msi) + error = pci_release_msi(dev); + + return (error); +} + + static device_method_t puc_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, puc_pci_probe), - DEVMETHOD(device_attach, puc_bfe_attach), - DEVMETHOD(device_detach, puc_bfe_detach), + DEVMETHOD(device_attach, puc_pci_attach), + DEVMETHOD(device_detach, puc_pci_detach), DEVMETHOD(bus_alloc_resource, puc_bus_alloc_resource), DEVMETHOD(bus_release_resource, puc_bus_release_resource), Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Thu Mar 13 14:34:25 2014 (r263108) +++ head/sys/dev/puc/pucdata.c Thu Mar 13 15:57:25 2014 (r263109) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 16:19:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 254387AE; Thu, 13 Mar 2014 16:19:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1284DD1E; Thu, 13 Mar 2014 16:19:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2DGJal6071197; Thu, 13 Mar 2014 16:19:36 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2DGJax1071196; Thu, 13 Mar 2014 16:19:36 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201403131619.s2DGJax1071196@svn.freebsd.org> From: John-Mark Gurney Date: Thu, 13 Mar 2014 16:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263110 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 16:19:37 -0000 Author: jmg Date: Thu Mar 13 16:19:36 2014 New Revision: 263110 URL: http://svnweb.freebsd.org/changeset/base/263110 Log: remove link to the missing AMD Geode LX SB man page... we can add it back once someone cares enough to write one.. Modified: head/share/man/man4/crypto.4 Modified: head/share/man/man4/crypto.4 ============================================================================== --- head/share/man/man4/crypto.4 Thu Mar 13 15:57:25 2014 (r263109) +++ head/share/man/man4/crypto.4 Thu Mar 13 16:19:36 2014 (r263110) @@ -107,7 +107,6 @@ crypto access device .El .Sh SEE ALSO .Xr aesni 4 , -.Xr glxsb 4 , .Xr hifn 4 , .Xr ipsec 4 , .Xr padlock 4 , From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 16:51:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 643AD851; Thu, 13 Mar 2014 16:51:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5149612C; Thu, 13 Mar 2014 16:51:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2DGp2e1086398; Thu, 13 Mar 2014 16:51:02 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2DGp26X086397; Thu, 13 Mar 2014 16:51:02 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403131651.s2DGp26X086397@svn.freebsd.org> From: Eitan Adler Date: Thu, 13 Mar 2014 16:51:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263111 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 16:51:02 -0000 Author: eadler Date: Thu Mar 13 16:51:01 2014 New Revision: 263111 URL: http://svnweb.freebsd.org/changeset/base/263111 Log: Fix pointer type in call to malloc Submitted by: Meyer, Conrad conrad.meyer@isilon.com Modified: head/sys/dev/hwpmc/hwpmc_core.c Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Thu Mar 13 16:19:36 2014 (r263110) +++ head/sys/dev/hwpmc/hwpmc_core.c Thu Mar 13 16:51:01 2014 (r263111) @@ -2679,7 +2679,7 @@ pmc_core_initialize(struct pmc_mdep *md, PMCDBG(MDP,INI,1,"core-init pmcmask=0x%jx iafri=%d", core_pmcmask, core_iaf_ri); - core_pcpu = malloc(sizeof(struct core_cpu **) * maxcpu, M_PMC, + core_pcpu = malloc(sizeof(*core_pcpu) * maxcpu, M_PMC, M_ZERO | M_WAITOK); /* From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 16:51:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B6799B0; Thu, 13 Mar 2014 16:51:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 18A771AB; Thu, 13 Mar 2014 16:51:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2DGpeot086496; Thu, 13 Mar 2014 16:51:40 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2DGpe6o086495; Thu, 13 Mar 2014 16:51:40 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403131651.s2DGpe6o086495@svn.freebsd.org> From: Eitan Adler Date: Thu, 13 Mar 2014 16:51:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263112 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 16:51:41 -0000 Author: eadler Date: Thu Mar 13 16:51:40 2014 New Revision: 263112 URL: http://svnweb.freebsd.org/changeset/base/263112 Log: Fix pointer type in call to malloc Submitted by: Meyer, Conrad conrad.meyer@isilon.com Modified: head/sys/dev/hwpmc/hwpmc_uncore.c Modified: head/sys/dev/hwpmc/hwpmc_uncore.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_uncore.c Thu Mar 13 16:51:01 2014 (r263111) +++ head/sys/dev/hwpmc/hwpmc_uncore.c Thu Mar 13 16:51:40 2014 (r263112) @@ -1212,7 +1212,7 @@ pmc_uncore_initialize(struct pmc_mdep *m PMCDBG(MDP,INI,1,"uncore-init pmcmask=0x%jx ucfri=%d", uncore_pmcmask, uncore_ucf_ri); - uncore_pcpu = malloc(sizeof(struct uncore_cpu **) * maxcpu, M_PMC, + uncore_pcpu = malloc(sizeof(*uncore_pcpu) * maxcpu, M_PMC, M_ZERO | M_WAITOK); return (0); From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 18:11:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD105929; Thu, 13 Mar 2014 18:11:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B9D86C09; Thu, 13 Mar 2014 18:11:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2DIBgIf019578; Thu, 13 Mar 2014 18:11:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2DIBgUb019577; Thu, 13 Mar 2014 18:11:42 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201403131811.s2DIBgUb019577@svn.freebsd.org> From: John Baldwin Date: Thu, 13 Mar 2014 18:11:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263113 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 18:11:42 -0000 Author: jhb Date: Thu Mar 13 18:11:42 2014 New Revision: 263113 URL: http://svnweb.freebsd.org/changeset/base/263113 Log: Correct type for malloc(). Submitted by: "Conrad Meyer" Modified: head/sys/x86/x86/mca.c Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Thu Mar 13 16:51:40 2014 (r263112) +++ head/sys/x86/x86/mca.c Thu Mar 13 18:11:42 2014 (r263113) @@ -700,8 +700,8 @@ cmci_setup(void) { int i; - cmc_state = malloc((mp_maxid + 1) * sizeof(struct cmc_state **), - M_MCA, M_WAITOK); + cmc_state = malloc((mp_maxid + 1) * sizeof(struct cmc_state *), M_MCA, + M_WAITOK); for (i = 0; i <= mp_maxid; i++) cmc_state[i] = malloc(sizeof(struct cmc_state) * mca_banks, M_MCA, M_WAITOK | M_ZERO); From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 18:16:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B27BAB02; Thu, 13 Mar 2014 18:16:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9F03BC4C; Thu, 13 Mar 2014 18:16:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2DIGgDT020524; Thu, 13 Mar 2014 18:16:42 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2DIGg2M020523; Thu, 13 Mar 2014 18:16:42 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403131816.s2DIGg2M020523@svn.freebsd.org> From: Devin Teske Date: Thu, 13 Mar 2014 18:16:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263114 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 18:16:42 -0000 Author: dteske Date: Thu Mar 13 18:16:42 2014 New Revision: 263114 URL: http://svnweb.freebsd.org/changeset/base/263114 Log: Fix pw(8) deletion of group "username" on userdel even if group "username" is not associated with user "username". E.g., user "foo" has primary group "wheel" and is unassociated with group "foo", yet userdel would delete the group "foo" when deleting user "foo" (despite the fact that user "foo" is not associated with group "foo" in any way). Patch committed with minor style(9) changes. PR: bin/169471 Submitted by: Alexander Pyhalov Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Thu Mar 13 18:11:42 2014 (r263113) +++ head/usr.sbin/pw/pw_user.c Thu Mar 13 18:16:42 2014 (r263114) @@ -380,6 +380,8 @@ pw_user(struct userconf * cnf, int mode, char file[MAXPATHLEN]; char home[MAXPATHLEN]; uid_t uid = pwd->pw_uid; + struct group *gr; + char grname[LOGNAMESIZE]; if (strcmp(pwd->pw_name, "root") == 0) errx(EX_DATAERR, "cannot remove user 'root'"); @@ -406,6 +408,11 @@ pw_user(struct userconf * cnf, int mode, */ sprintf(file, "%s/%s", _PATH_MAILDIR, pwd->pw_name); strlcpy(home, pwd->pw_dir, sizeof(home)); + gr = GETGRGID(pwd->pw_gid); + if (gr != NULL) + strlcpy(grname, gr->gr_name, LOGNAMESIZE); + else + grname[0] = '\0'; rc = delpwent(pwd); if (rc == -1) @@ -426,7 +433,8 @@ pw_user(struct userconf * cnf, int mode, grp = GETGRNAM(a_name->val); if (grp != NULL && - (grp->gr_mem == NULL || *grp->gr_mem == NULL)) + (grp->gr_mem == NULL || *grp->gr_mem == NULL) && + strcmp(a_name->val, grname) == 0) delgrent(GETGRNAM(a_name->val)); SETGRENT(); while ((grp = GETGRENT()) != NULL) { From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 18:17:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63405C45; Thu, 13 Mar 2014 18:17:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4EAA6C55; Thu, 13 Mar 2014 18:17:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2DIHJnf020640; Thu, 13 Mar 2014 18:17:19 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2DIHIkP020637; Thu, 13 Mar 2014 18:17:18 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403131817.s2DIHIkP020637@svn.freebsd.org> From: Ed Maste Date: Thu, 13 Mar 2014 18:17:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263115 - in head/sys/boot/efi: include/amd64 libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 18:17:19 -0000 Author: emaste Date: Thu Mar 13 18:17:18 2014 New Revision: 263115 URL: http://svnweb.freebsd.org/changeset/base/263115 Log: Add amd64 EFI headers Sponsored by: The FreeBSD Foundation Added: head/sys/boot/efi/include/amd64/ head/sys/boot/efi/include/amd64/efibind.h (contents, props changed) head/sys/boot/efi/include/amd64/pe.h (contents, props changed) Modified: head/sys/boot/efi/libefi/Makefile Added: head/sys/boot/efi/include/amd64/efibind.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/include/amd64/efibind.h Thu Mar 13 18:17:18 2014 (r263115) @@ -0,0 +1,267 @@ +/* $FreeBSD$ */ +/*++ + +Copyright (c) 1999 - 2003 Intel Corporation. All rights reserved +This software and associated documentation (if any) is furnished +under a license and may only be used or copied in accordance +with the terms of the license. Except as permitted by such +license, no part of this software or documentation may be +reproduced, stored in a retrieval system, or transmitted in any +form or by any means without the express written consent of +Intel Corporation. + +Module Name: + + efefind.h + +Abstract: + + EFI to compile bindings + + + + +Revision History + +--*/ + +#pragma pack() + + +#ifdef __FreeBSD__ +#include +#else +// +// Basic int types of various widths +// + +#if (__STDC_VERSION__ < 199901L ) + + // No ANSI C 1999/2000 stdint.h integer width declarations + + #if _MSC_EXTENSIONS + + // Use Microsoft C compiler integer width declarations + + typedef unsigned __int64 uint64_t; + typedef __int64 int64_t; + typedef unsigned __int32 uint32_t; + typedef __int32 int32_t; + typedef unsigned short uint16_t; + typedef short int16_t; + typedef unsigned char uint8_t; + typedef char int8_t; + #else + #ifdef UNIX_LP64 + + // Use LP64 programming model from C_FLAGS for integer width declarations + + typedef unsigned long uint64_t; + typedef long int64_t; + typedef unsigned int uint32_t; + typedef int int32_t; + typedef unsigned short uint16_t; + typedef short int16_t; + typedef unsigned char uint8_t; + typedef char int8_t; + #else + + // Assume P64 programming model from C_FLAGS for integer width declarations + + typedef unsigned long long uint64_t; + typedef long long int64_t; + typedef unsigned int uint32_t; + typedef int int32_t; + typedef unsigned short uint16_t; + typedef short int16_t; + typedef unsigned char uint8_t; + typedef char int8_t; + #endif + #endif +#endif +#endif /* __FreeBSD__ */ + +// +// Basic EFI types of various widths +// + +typedef uint64_t UINT64; +typedef int64_t INT64; + +#ifndef _BASETSD_H_ + typedef uint32_t UINT32; + typedef int32_t INT32; +#endif + +typedef uint16_t UINT16; +typedef int16_t INT16; +typedef uint8_t UINT8; +typedef int8_t INT8; + + +#undef VOID +#define VOID void + + +typedef int64_t INTN; +typedef uint64_t UINTN; + +#ifdef EFI_NT_EMULATOR + #define POST_CODE(_Data) +#else + #ifdef EFI_DEBUG +#define POST_CODE(_Data) __asm mov eax,(_Data) __asm out 0x80,al + #else + #define POST_CODE(_Data) + #endif +#endif + +#define EFIERR(a) (0x8000000000000000 | a) +#define EFI_ERROR_MASK 0x8000000000000000 +#define EFIERR_OEM(a) (0xc000000000000000 | a) + + +#define BAD_POINTER 0xFBFBFBFBFBFBFBFB +#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF + +#define BREAKPOINT() __asm { int 3 } + +// +// Pointers must be aligned to these address to function +// + +#define MIN_ALIGNMENT_SIZE 4 + +#define ALIGN_VARIABLE(Value ,Adjustment) \ + (UINTN)Adjustment = 0; \ + if((UINTN)Value % MIN_ALIGNMENT_SIZE) \ + (UINTN)Adjustment = MIN_ALIGNMENT_SIZE - ((UINTN)Value % MIN_ALIGNMENT_SIZE); \ + Value = (UINTN)Value + (UINTN)Adjustment + + +// +// Define macros to build data structure signatures from characters. +// + +#define EFI_SIGNATURE_16(A,B) ((A) | (B<<8)) +#define EFI_SIGNATURE_32(A,B,C,D) (EFI_SIGNATURE_16(A,B) | (EFI_SIGNATURE_16(C,D) << 16)) +#define EFI_SIGNATURE_64(A,B,C,D,E,F,G,H) (EFI_SIGNATURE_32(A,B,C,D) | ((UINT64)(EFI_SIGNATURE_32(E,F,G,H)) << 32)) + +// +// EFIAPI - prototype calling convention for EFI function pointers +// BOOTSERVICE - prototype for implementation of a boot service interface +// RUNTIMESERVICE - prototype for implementation of a runtime service interface +// RUNTIMEFUNCTION - prototype for implementation of a runtime function that is not a service +// RUNTIME_CODE - pragma macro for declaring runtime code +// + +#ifdef __amd64__ +#define EFIAPI __attribute__((ms_abi)) +#endif + +#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options + #if _MSC_EXTENSIONS + #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler + #else + #define EFIAPI // Substitute expresion to force C calling convention + #endif +#endif + +#define BOOTSERVICE +//#define RUNTIMESERVICE(proto,a) alloc_text("rtcode",a); proto a +//#define RUNTIMEFUNCTION(proto,a) alloc_text("rtcode",a); proto a +#define RUNTIMESERVICE +#define RUNTIMEFUNCTION + + +#define RUNTIME_CODE(a) alloc_text("rtcode", a) +#define BEGIN_RUNTIME_DATA() data_seg("rtdata") +#define END_RUNTIME_DATA() data_seg("") + +#define VOLATILE volatile + +#define MEMORY_FENCE() + +#ifdef EFI_NO_INTERFACE_DECL + #define EFI_FORWARD_DECLARATION(x) + #define EFI_INTERFACE_DECL(x) +#else + #define EFI_FORWARD_DECLARATION(x) typedef struct _##x x + #define EFI_INTERFACE_DECL(x) typedef struct x +#endif + +#ifdef EFI_NT_EMULATOR + +// +// To help ensure proper coding of integrated drivers, they are +// compiled as DLLs. In NT they require a dll init entry pointer. +// The macro puts a stub entry point into the DLL so it will load. +// + +#define EFI_DRIVER_ENTRY_POINT(InitFunction) \ + EFI_STATUS \ + InitFunction ( \ + EFI_HANDLE ImageHandle, \ + EFI_SYSTEM_TABLE *SystemTable \ + ); \ + \ + UINTN \ + __stdcall \ + _DllMainCRTStartup ( \ + UINTN Inst, \ + UINTN reason_for_call, \ + VOID *rserved \ + ) \ + { \ + return 1; \ + } \ + \ + int \ + __declspec( dllexport ) \ + __cdecl \ + InitializeDriver ( \ + void *ImageHandle, \ + void *SystemTable \ + ) \ + { \ + return InitFunction(ImageHandle, SystemTable); \ + } + + + #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \ + (_if)->LoadInternal(type, name, NULL) + +#else // EFI_NT_EMULATOR + +// +// When build similiar to FW, then link everything together as +// one big module. +// + + #define EFI_DRIVER_ENTRY_POINT(InitFunction) + + #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \ + (_if)->LoadInternal(type, name, entry) + +#endif // EFI_FW_NT + +#ifdef __FreeBSD__ +#define INTERFACE_DECL(x) struct x +#else +// +// Some compilers don't support the forward reference construct: +// typedef struct XXXXX +// +// The following macro provide a workaround for such cases. +// +#ifdef NO_INTERFACE_DECL +#define INTERFACE_DECL(x) +#else +#define INTERFACE_DECL(x) typedef struct x +#endif +#endif /* __FreeBSD__ */ + +#if _MSC_EXTENSIONS +#pragma warning ( disable : 4731 ) // Suppress warnings about modification of EBP +#endif + Added: head/sys/boot/efi/include/amd64/pe.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/include/amd64/pe.h Thu Mar 13 18:17:18 2014 (r263115) @@ -0,0 +1,592 @@ +/* $FreeBSD$ */ +/* + PE32+ header file + */ +#ifndef _PE_H +#define _PE_H + +#define IMAGE_DOS_SIGNATURE 0x5A4D // MZ +#define IMAGE_OS2_SIGNATURE 0x454E // NE +#define IMAGE_OS2_SIGNATURE_LE 0x454C // LE +#define IMAGE_NT_SIGNATURE 0x00004550 // PE00 +#define IMAGE_EDOS_SIGNATURE 0x44454550 // PEED + + +typedef struct _IMAGE_DOS_HEADER { // DOS .EXE header + UINT16 e_magic; // Magic number + UINT16 e_cblp; // Bytes on last page of file + UINT16 e_cp; // Pages in file + UINT16 e_crlc; // Relocations + UINT16 e_cparhdr; // Size of header in paragraphs + UINT16 e_minalloc; // Minimum extra paragraphs needed + UINT16 e_maxalloc; // Maximum extra paragraphs needed + UINT16 e_ss; // Initial (relative) SS value + UINT16 e_sp; // Initial SP value + UINT16 e_csum; // Checksum + UINT16 e_ip; // Initial IP value + UINT16 e_cs; // Initial (relative) CS value + UINT16 e_lfarlc; // File address of relocation table + UINT16 e_ovno; // Overlay number + UINT16 e_res[4]; // Reserved words + UINT16 e_oemid; // OEM identifier (for e_oeminfo) + UINT16 e_oeminfo; // OEM information; e_oemid specific + UINT16 e_res2[10]; // Reserved words + UINT32 e_lfanew; // File address of new exe header + } IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER; + +typedef struct _IMAGE_OS2_HEADER { // OS/2 .EXE header + UINT16 ne_magic; // Magic number + UINT8 ne_ver; // Version number + UINT8 ne_rev; // Revision number + UINT16 ne_enttab; // Offset of Entry Table + UINT16 ne_cbenttab; // Number of bytes in Entry Table + UINT32 ne_crc; // Checksum of whole file + UINT16 ne_flags; // Flag UINT16 + UINT16 ne_autodata; // Automatic data segment number + UINT16 ne_heap; // Initial heap allocation + UINT16 ne_stack; // Initial stack allocation + UINT32 ne_csip; // Initial CS:IP setting + UINT32 ne_sssp; // Initial SS:SP setting + UINT16 ne_cseg; // Count of file segments + UINT16 ne_cmod; // Entries in Module Reference Table + UINT16 ne_cbnrestab; // Size of non-resident name table + UINT16 ne_segtab; // Offset of Segment Table + UINT16 ne_rsrctab; // Offset of Resource Table + UINT16 ne_restab; // Offset of resident name table + UINT16 ne_modtab; // Offset of Module Reference Table + UINT16 ne_imptab; // Offset of Imported Names Table + UINT32 ne_nrestab; // Offset of Non-resident Names Table + UINT16 ne_cmovent; // Count of movable entries + UINT16 ne_align; // Segment alignment shift count + UINT16 ne_cres; // Count of resource segments + UINT8 ne_exetyp; // Target Operating system + UINT8 ne_flagsothers; // Other .EXE flags + UINT16 ne_pretthunks; // offset to return thunks + UINT16 ne_psegrefbytes; // offset to segment ref. bytes + UINT16 ne_swaparea; // Minimum code swap area size + UINT16 ne_expver; // Expected Windows version number + } IMAGE_OS2_HEADER, *PIMAGE_OS2_HEADER; + +// +// File header format. +// + +typedef struct _IMAGE_FILE_HEADER { + UINT16 Machine; + UINT16 NumberOfSections; + UINT32 TimeDateStamp; + UINT32 PointerToSymbolTable; + UINT32 NumberOfSymbols; + UINT16 SizeOfOptionalHeader; + UINT16 Characteristics; +} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER; + +#define IMAGE_SIZEOF_FILE_HEADER 20 + +#define IMAGE_FILE_RELOCS_STRIPPED 0x0001 // Relocation info stripped from file. +#define IMAGE_FILE_EXECUTABLE_IMAGE 0x0002 // File is executable (i.e. no unresolved externel references). +#define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 // Line nunbers stripped from file. +#define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 // Local symbols stripped from file. +#define IMAGE_FILE_BYTES_REVERSED_LO 0x0080 // Bytes of machine word are reversed. +#define IMAGE_FILE_32BIT_MACHINE 0x0100 // 32 bit word machine. +#define IMAGE_FILE_DEBUG_STRIPPED 0x0200 // Debugging info stripped from file in .DBG file +#define IMAGE_FILE_SYSTEM 0x1000 // System File. +#define IMAGE_FILE_DLL 0x2000 // File is a DLL. +#define IMAGE_FILE_BYTES_REVERSED_HI 0x8000 // Bytes of machine word are reversed. + +#define IMAGE_FILE_MACHINE_UNKNOWN 0 +#define IMAGE_FILE_MACHINE_I386 0x14c // Intel 386. +#define IMAGE_FILE_MACHINE_R3000 0x162 // MIPS little-endian, 0540 big-endian +#define IMAGE_FILE_MACHINE_R4000 0x166 // MIPS little-endian +#define IMAGE_FILE_MACHINE_ALPHA 0x184 // Alpha_AXP +#define IMAGE_FILE_MACHINE_POWERPC 0x1F0 // IBM PowerPC Little-Endian +#define IMAGE_FILE_MACHINE_TAHOE 0x7cc // Intel EM machine +// +// Directory format. +// + +typedef struct _IMAGE_DATA_DIRECTORY { + UINT32 VirtualAddress; + UINT32 Size; +} IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY; + +#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 + +// +// Optional header format. +// + +typedef struct _IMAGE_OPTIONAL_HEADER { + // + // Standard fields. + // + + UINT16 Magic; + UINT8 MajorLinkerVersion; + UINT8 MinorLinkerVersion; + UINT32 SizeOfCode; + UINT32 SizeOfInitializedData; + UINT32 SizeOfUninitializedData; + UINT32 AddressOfEntryPoint; + UINT32 BaseOfCode; + UINT32 BaseOfData; + + // + // NT additional fields. + // + + UINT32 ImageBase; + UINT32 SectionAlignment; + UINT32 FileAlignment; + UINT16 MajorOperatingSystemVersion; + UINT16 MinorOperatingSystemVersion; + UINT16 MajorImageVersion; + UINT16 MinorImageVersion; + UINT16 MajorSubsystemVersion; + UINT16 MinorSubsystemVersion; + UINT32 Reserved1; + UINT32 SizeOfImage; + UINT32 SizeOfHeaders; + UINT32 CheckSum; + UINT16 Subsystem; + UINT16 DllCharacteristics; + UINT32 SizeOfStackReserve; + UINT32 SizeOfStackCommit; + UINT32 SizeOfHeapReserve; + UINT32 SizeOfHeapCommit; + UINT32 LoaderFlags; + UINT32 NumberOfRvaAndSizes; + IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; +} IMAGE_OPTIONAL_HEADER, *PIMAGE_OPTIONAL_HEADER; + +typedef struct _IMAGE_ROM_OPTIONAL_HEADER { + UINT16 Magic; + UINT8 MajorLinkerVersion; + UINT8 MinorLinkerVersion; + UINT32 SizeOfCode; + UINT32 SizeOfInitializedData; + UINT32 SizeOfUninitializedData; + UINT32 AddressOfEntryPoint; + UINT32 BaseOfCode; + UINT32 BaseOfData; + UINT32 BaseOfBss; + UINT32 GprMask; + UINT32 CprMask[4]; + UINT32 GpValue; +} IMAGE_ROM_OPTIONAL_HEADER, *PIMAGE_ROM_OPTIONAL_HEADER; + +#define IMAGE_SIZEOF_ROM_OPTIONAL_HEADER 56 +#define IMAGE_SIZEOF_STD_OPTIONAL_HEADER 28 +#define IMAGE_SIZEOF_NT_OPTIONAL_HEADER 224 + +#define IMAGE_NT_OPTIONAL_HDR_MAGIC 0x10b +#define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107 + +typedef struct _IMAGE_NT_HEADERS { + UINT32 Signature; + IMAGE_FILE_HEADER FileHeader; + IMAGE_OPTIONAL_HEADER OptionalHeader; +} IMAGE_NT_HEADERS, *PIMAGE_NT_HEADERS; + +typedef struct _IMAGE_ROM_HEADERS { + IMAGE_FILE_HEADER FileHeader; + IMAGE_ROM_OPTIONAL_HEADER OptionalHeader; +} IMAGE_ROM_HEADERS, *PIMAGE_ROM_HEADERS; + +#define IMAGE_FIRST_SECTION( ntheader ) ((PIMAGE_SECTION_HEADER) \ + ((UINT32)ntheader + \ + FIELD_OFFSET( IMAGE_NT_HEADERS, OptionalHeader ) + \ + ((PIMAGE_NT_HEADERS)(ntheader))->FileHeader.SizeOfOptionalHeader \ + )) + + +// Subsystem Values + +#define IMAGE_SUBSYSTEM_UNKNOWN 0 // Unknown subsystem. +#define IMAGE_SUBSYSTEM_NATIVE 1 // Image doesn't require a subsystem. +#define IMAGE_SUBSYSTEM_WINDOWS_GUI 2 // Image runs in the Windows GUI subsystem. +#define IMAGE_SUBSYSTEM_WINDOWS_CUI 3 // Image runs in the Windows character subsystem. +#define IMAGE_SUBSYSTEM_OS2_CUI 5 // image runs in the OS/2 character subsystem. +#define IMAGE_SUBSYSTEM_POSIX_CUI 7 // image run in the Posix character subsystem. + + +// Directory Entries + +#define IMAGE_DIRECTORY_ENTRY_EXPORT 0 // Export Directory +#define IMAGE_DIRECTORY_ENTRY_IMPORT 1 // Import Directory +#define IMAGE_DIRECTORY_ENTRY_RESOURCE 2 // Resource Directory +#define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3 // Exception Directory +#define IMAGE_DIRECTORY_ENTRY_SECURITY 4 // Security Directory +#define IMAGE_DIRECTORY_ENTRY_BASERELOC 5 // Base Relocation Table +#define IMAGE_DIRECTORY_ENTRY_DEBUG 6 // Debug Directory +#define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7 // Description String +#define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8 // Machine Value (MIPS GP) +#define IMAGE_DIRECTORY_ENTRY_TLS 9 // TLS Directory +#define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10 // Load Configuration Directory + +// +// Section header format. +// + +#define IMAGE_SIZEOF_SHORT_NAME 8 + +typedef struct _IMAGE_SECTION_HEADER { + UINT8 Name[IMAGE_SIZEOF_SHORT_NAME]; + union { + UINT32 PhysicalAddress; + UINT32 VirtualSize; + } Misc; + UINT32 VirtualAddress; + UINT32 SizeOfRawData; + UINT32 PointerToRawData; + UINT32 PointerToRelocations; + UINT32 PointerToLinenumbers; + UINT16 NumberOfRelocations; + UINT16 NumberOfLinenumbers; + UINT32 Characteristics; +} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER; + +#define IMAGE_SIZEOF_SECTION_HEADER 40 + +#define IMAGE_SCN_TYPE_NO_PAD 0x00000008 // Reserved. + +#define IMAGE_SCN_CNT_CODE 0x00000020 // Section contains code. +#define IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040 // Section contains initialized data. +#define IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080 // Section contains uninitialized data. + +#define IMAGE_SCN_LNK_OTHER 0x00000100 // Reserved. +#define IMAGE_SCN_LNK_INFO 0x00000200 // Section contains comments or some other type of information. +#define IMAGE_SCN_LNK_REMOVE 0x00000800 // Section contents will not become part of image. +#define IMAGE_SCN_LNK_COMDAT 0x00001000 // Section contents comdat. + +#define IMAGE_SCN_ALIGN_1BYTES 0x00100000 // +#define IMAGE_SCN_ALIGN_2BYTES 0x00200000 // +#define IMAGE_SCN_ALIGN_4BYTES 0x00300000 // +#define IMAGE_SCN_ALIGN_8BYTES 0x00400000 // +#define IMAGE_SCN_ALIGN_16BYTES 0x00500000 // Default alignment if no others are specified. +#define IMAGE_SCN_ALIGN_32BYTES 0x00600000 // +#define IMAGE_SCN_ALIGN_64BYTES 0x00700000 // + +#define IMAGE_SCN_MEM_DISCARDABLE 0x02000000 // Section can be discarded. +#define IMAGE_SCN_MEM_NOT_CACHED 0x04000000 // Section is not cachable. +#define IMAGE_SCN_MEM_NOT_PAGED 0x08000000 // Section is not pageable. +#define IMAGE_SCN_MEM_SHARED 0x10000000 // Section is shareable. +#define IMAGE_SCN_MEM_EXECUTE 0x20000000 // Section is executable. +#define IMAGE_SCN_MEM_READ 0x40000000 // Section is readable. +#define IMAGE_SCN_MEM_WRITE 0x80000000 // Section is writeable. + +// +// Symbol format. +// + + +#define IMAGE_SIZEOF_SYMBOL 18 + +// +// Section values. +// +// Symbols have a section number of the section in which they are +// defined. Otherwise, section numbers have the following meanings: +// + +#define IMAGE_SYM_UNDEFINED (UINT16)0 // Symbol is undefined or is common. +#define IMAGE_SYM_ABSOLUTE (UINT16)-1 // Symbol is an absolute value. +#define IMAGE_SYM_DEBUG (UINT16)-2 // Symbol is a special debug item. + +// +// Type (fundamental) values. +// + +#define IMAGE_SYM_TYPE_NULL 0 // no type. +#define IMAGE_SYM_TYPE_VOID 1 // +#define IMAGE_SYM_TYPE_CHAR 2 // type character. +#define IMAGE_SYM_TYPE_SHORT 3 // type short integer. +#define IMAGE_SYM_TYPE_INT 4 // +#define IMAGE_SYM_TYPE_LONG 5 // +#define IMAGE_SYM_TYPE_FLOAT 6 // +#define IMAGE_SYM_TYPE_DOUBLE 7 // +#define IMAGE_SYM_TYPE_STRUCT 8 // +#define IMAGE_SYM_TYPE_UNION 9 // +#define IMAGE_SYM_TYPE_ENUM 10 // enumeration. +#define IMAGE_SYM_TYPE_MOE 11 // member of enumeration. +#define IMAGE_SYM_TYPE_BYTE 12 // +#define IMAGE_SYM_TYPE_WORD 13 // +#define IMAGE_SYM_TYPE_UINT 14 // +#define IMAGE_SYM_TYPE_DWORD 15 // + +// +// Type (derived) values. +// + +#define IMAGE_SYM_DTYPE_NULL 0 // no derived type. +#define IMAGE_SYM_DTYPE_POINTER 1 // pointer. +#define IMAGE_SYM_DTYPE_FUNCTION 2 // function. +#define IMAGE_SYM_DTYPE_ARRAY 3 // array. + +// +// Storage classes. +// + +#define IMAGE_SYM_CLASS_END_OF_FUNCTION (BYTE )-1 +#define IMAGE_SYM_CLASS_NULL 0 +#define IMAGE_SYM_CLASS_AUTOMATIC 1 +#define IMAGE_SYM_CLASS_EXTERNAL 2 +#define IMAGE_SYM_CLASS_STATIC 3 +#define IMAGE_SYM_CLASS_REGISTER 4 +#define IMAGE_SYM_CLASS_EXTERNAL_DEF 5 +#define IMAGE_SYM_CLASS_LABEL 6 +#define IMAGE_SYM_CLASS_UNDEFINED_LABEL 7 +#define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 8 +#define IMAGE_SYM_CLASS_ARGUMENT 9 +#define IMAGE_SYM_CLASS_STRUCT_TAG 10 +#define IMAGE_SYM_CLASS_MEMBER_OF_UNION 11 +#define IMAGE_SYM_CLASS_UNION_TAG 12 +#define IMAGE_SYM_CLASS_TYPE_DEFINITION 13 +#define IMAGE_SYM_CLASS_UNDEFINED_STATIC 14 +#define IMAGE_SYM_CLASS_ENUM_TAG 15 +#define IMAGE_SYM_CLASS_MEMBER_OF_ENUM 16 +#define IMAGE_SYM_CLASS_REGISTER_PARAM 17 +#define IMAGE_SYM_CLASS_BIT_FIELD 18 +#define IMAGE_SYM_CLASS_BLOCK 100 +#define IMAGE_SYM_CLASS_FUNCTION 101 +#define IMAGE_SYM_CLASS_END_OF_STRUCT 102 +#define IMAGE_SYM_CLASS_FILE 103 +// new +#define IMAGE_SYM_CLASS_SECTION 104 +#define IMAGE_SYM_CLASS_WEAK_EXTERNAL 105 + +// type packing constants + +#define N_BTMASK 017 +#define N_TMASK 060 +#define N_TMASK1 0300 +#define N_TMASK2 0360 +#define N_BTSHFT 4 +#define N_TSHIFT 2 + +// MACROS + +// +// Communal selection types. +// + +#define IMAGE_COMDAT_SELECT_NODUPLICATES 1 +#define IMAGE_COMDAT_SELECT_ANY 2 +#define IMAGE_COMDAT_SELECT_SAME_SIZE 3 +#define IMAGE_COMDAT_SELECT_EXACT_MATCH 4 +#define IMAGE_COMDAT_SELECT_ASSOCIATIVE 5 + +#define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1 +#define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2 +#define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3 + + +// +// Relocation format. +// + +typedef struct _IMAGE_RELOCATION { + UINT32 VirtualAddress; + UINT32 SymbolTableIndex; + UINT16 Type; +} IMAGE_RELOCATION; + +#define IMAGE_SIZEOF_RELOCATION 10 + +// +// I386 relocation types. +// + +#define IMAGE_REL_I386_ABSOLUTE 0 // Reference is absolute, no relocation is necessary +#define IMAGE_REL_I386_DIR16 01 // Direct 16-bit reference to the symbols virtual address +#define IMAGE_REL_I386_REL16 02 // PC-relative 16-bit reference to the symbols virtual address +#define IMAGE_REL_I386_DIR32 06 // Direct 32-bit reference to the symbols virtual address +#define IMAGE_REL_I386_DIR32NB 07 // Direct 32-bit reference to the symbols virtual address, base not included +#define IMAGE_REL_I386_SEG12 011 // Direct 16-bit reference to the segment-selector bits of a 32-bit virtual address +#define IMAGE_REL_I386_SECTION 012 +#define IMAGE_REL_I386_SECREL 013 +#define IMAGE_REL_I386_REL32 024 // PC-relative 32-bit reference to the symbols virtual address + +// +// MIPS relocation types. +// + +#define IMAGE_REL_MIPS_ABSOLUTE 0 // Reference is absolute, no relocation is necessary +#define IMAGE_REL_MIPS_REFHALF 01 +#define IMAGE_REL_MIPS_REFWORD 02 +#define IMAGE_REL_MIPS_JMPADDR 03 +#define IMAGE_REL_MIPS_REFHI 04 +#define IMAGE_REL_MIPS_REFLO 05 +#define IMAGE_REL_MIPS_GPREL 06 +#define IMAGE_REL_MIPS_LITERAL 07 +#define IMAGE_REL_MIPS_SECTION 012 +#define IMAGE_REL_MIPS_SECREL 013 +#define IMAGE_REL_MIPS_REFWORDNB 042 +#define IMAGE_REL_MIPS_PAIR 045 + +// +// Alpha Relocation types. +// + +#define IMAGE_REL_ALPHA_ABSOLUTE 0x0 +#define IMAGE_REL_ALPHA_REFLONG 0x1 +#define IMAGE_REL_ALPHA_REFQUAD 0x2 +#define IMAGE_REL_ALPHA_GPREL32 0x3 +#define IMAGE_REL_ALPHA_LITERAL 0x4 +#define IMAGE_REL_ALPHA_LITUSE 0x5 +#define IMAGE_REL_ALPHA_GPDISP 0x6 +#define IMAGE_REL_ALPHA_BRADDR 0x7 +#define IMAGE_REL_ALPHA_HINT 0x8 +#define IMAGE_REL_ALPHA_INLINE_REFLONG 0x9 +#define IMAGE_REL_ALPHA_REFHI 0xA +#define IMAGE_REL_ALPHA_REFLO 0xB +#define IMAGE_REL_ALPHA_PAIR 0xC +#define IMAGE_REL_ALPHA_MATCH 0xD +#define IMAGE_REL_ALPHA_SECTION 0xE +#define IMAGE_REL_ALPHA_SECREL 0xF +#define IMAGE_REL_ALPHA_REFLONGNB 0x10 + +// +// IBM PowerPC relocation types. +// + +#define IMAGE_REL_PPC_ABSOLUTE 0x0000 // NOP +#define IMAGE_REL_PPC_ADDR64 0x0001 // 64-bit address +#define IMAGE_REL_PPC_ADDR32 0x0002 // 32-bit address +#define IMAGE_REL_PPC_ADDR24 0x0003 // 26-bit address, shifted left 2 (branch absolute) +#define IMAGE_REL_PPC_ADDR16 0x0004 // 16-bit address +#define IMAGE_REL_PPC_ADDR14 0x0005 // 16-bit address, shifted left 2 (load doubleword) +#define IMAGE_REL_PPC_REL24 0x0006 // 26-bit PC-relative offset, shifted left 2 (branch relative) +#define IMAGE_REL_PPC_REL14 0x0007 // 16-bit PC-relative offset, shifted left 2 (br cond relative) +#define IMAGE_REL_PPC_TOCREL16 0x0008 // 16-bit offset from TOC base +#define IMAGE_REL_PPC_TOCREL14 0x0009 // 16-bit offset from TOC base, shifted left 2 (load doubleword) + +#define IMAGE_REL_PPC_ADDR32NB 0x000A // 32-bit addr w/o image base +#define IMAGE_REL_PPC_SECREL 0x000B // va of containing section (as in an image sectionhdr) +#define IMAGE_REL_PPC_SECTION 0x000C // sectionheader number +#define IMAGE_REL_PPC_IFGLUE 0x000D // substitute TOC restore instruction iff symbol is glue code +#define IMAGE_REL_PPC_IMGLUE 0x000E // symbol is glue code; virtual address is TOC restore instruction + +#define IMAGE_REL_PPC_TYPEMASK 0x00FF // mask to isolate above values in IMAGE_RELOCATION.Type + +// Flag bits in IMAGE_RELOCATION.TYPE + +#define IMAGE_REL_PPC_NEG 0x0100 // subtract reloc value rather than adding it +#define IMAGE_REL_PPC_BRTAKEN 0x0200 // fix branch prediction bit to predict branch taken +#define IMAGE_REL_PPC_BRNTAKEN 0x0400 // fix branch prediction bit to predict branch not taken +#define IMAGE_REL_PPC_TOCDEFN 0x0800 // toc slot defined in file (or, data in toc) + +// +// Based relocation format. +// + +typedef struct _IMAGE_BASE_RELOCATION { + UINT32 VirtualAddress; + UINT32 SizeOfBlock; +// UINT16 TypeOffset[1]; +} IMAGE_BASE_RELOCATION, *PIMAGE_BASE_RELOCATION; + +#define IMAGE_SIZEOF_BASE_RELOCATION 8 + +// +// Based relocation types. +// + +#define IMAGE_REL_BASED_ABSOLUTE 0 +#define IMAGE_REL_BASED_HIGH 1 +#define IMAGE_REL_BASED_LOW 2 +#define IMAGE_REL_BASED_HIGHLOW 3 +#define IMAGE_REL_BASED_HIGHADJ 4 +#define IMAGE_REL_BASED_MIPS_JMPADDR 5 +#define IMAGE_REL_BASED_IA64_IMM64 9 +#define IMAGE_REL_BASED_DIR64 10 + +// +// Line number format. +// + +typedef struct _IMAGE_LINENUMBER { + union { + UINT32 SymbolTableIndex; // Symbol table index of function name if Linenumber is 0. + UINT32 VirtualAddress; // Virtual address of line number. + } Type; + UINT16 Linenumber; // Line number. +} IMAGE_LINENUMBER; + +#define IMAGE_SIZEOF_LINENUMBER 6 + +// +// Archive format. +// + +#define IMAGE_ARCHIVE_START_SIZE 8 +#define IMAGE_ARCHIVE_START "!\n" +#define IMAGE_ARCHIVE_END "`\n" +#define IMAGE_ARCHIVE_PAD "\n" +#define IMAGE_ARCHIVE_LINKER_MEMBER "/ " +#define IMAGE_ARCHIVE_LONGNAMES_MEMBER "// " + +typedef struct _IMAGE_ARCHIVE_MEMBER_HEADER { + UINT8 Name[16]; // File member name - `/' terminated. + UINT8 Date[12]; // File member date - decimal. + UINT8 UserID[6]; // File member user id - decimal. + UINT8 GroupID[6]; // File member group id - decimal. + UINT8 Mode[8]; // File member mode - octal. + UINT8 Size[10]; // File member size - decimal. + UINT8 EndHeader[2]; // String to end header. +} IMAGE_ARCHIVE_MEMBER_HEADER, *PIMAGE_ARCHIVE_MEMBER_HEADER; + +#define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60 + +// +// DLL support. +// + +// +// Export Format +// + +typedef struct _IMAGE_EXPORT_DIRECTORY { + UINT32 Characteristics; + UINT32 TimeDateStamp; + UINT16 MajorVersion; + UINT16 MinorVersion; + UINT32 Name; + UINT32 Base; + UINT32 NumberOfFunctions; + UINT32 NumberOfNames; + UINT32 *AddressOfFunctions; + UINT32 *AddressOfNames; + UINT32 *AddressOfNameOrdinals; +} IMAGE_EXPORT_DIRECTORY, *PIMAGE_EXPORT_DIRECTORY; + +// +// Import Format +// + +typedef struct _IMAGE_IMPORT_BY_NAME { + UINT16 Hint; + UINT8 Name[1]; +} IMAGE_IMPORT_BY_NAME, *PIMAGE_IMPORT_BY_NAME; + +typedef struct _IMAGE_THUNK_DATA { + union { + UINT32 Function; + UINT32 Ordinal; + PIMAGE_IMPORT_BY_NAME AddressOfData; + } u1; +} IMAGE_THUNK_DATA, *PIMAGE_THUNK_DATA; + +#define IMAGE_ORDINAL_FLAG 0x80000000 +#define IMAGE_SNAP_BY_ORDINAL(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG) != 0) +#define IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff) + +typedef struct _IMAGE_IMPORT_DESCRIPTOR { + UINT32 Characteristics; + UINT32 TimeDateStamp; + UINT32 ForwarderChain; + UINT32 Name; + PIMAGE_THUNK_DATA FirstThunk; +} IMAGE_IMPORT_DESCRIPTOR, *PIMAGE_IMPORT_DESCRIPTOR; + +#endif Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Thu Mar 13 18:16:42 2014 (r263114) +++ head/sys/boot/efi/libefi/Makefile Thu Mar 13 18:17:18 2014 (r263115) @@ -7,7 +7,7 @@ SRCS= delay.c efi_console.c efinet.c efi libefi.c time.c CFLAGS+= -I${.CURDIR}/../include -CFLAGS+= -I${.CURDIR}/../include/${MACHINE_CPUARCH:S/amd64/i386/} +CFLAGS+= -I${.CURDIR}/../include/${MACHINE_CPUARCH} CFLAGS+= -I${.CURDIR}/../../../../lib/libstand # Pick up the bootstrap header for some interface items From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 18:42:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C31C863; Thu, 13 Mar 2014 18:42:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6BD26F06; Thu, 13 Mar 2014 18:42:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2DIgDWi032504; Thu, 13 Mar 2014 18:42:13 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2DIgCcM032500; Thu, 13 Mar 2014 18:42:12 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201403131842.s2DIgCcM032500@svn.freebsd.org> From: Alan Somers Date: Thu, 13 Mar 2014 18:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263116 - in head: sys/kern sys/sys tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 18:42:13 -0000 Author: asomers Date: Thu Mar 13 18:42:12 2014 New Revision: 263116 URL: http://svnweb.freebsd.org/changeset/base/263116 Log: Replace 4.4BSD Lite's unix domain socket backpressure hack with a cleaner mechanism, based on the new SB_STOP sockbuf flag. The old hack dynamically changed the sending sockbuf's high water mark whenever adding or removing data from the receiving sockbuf. It worked for stream sockets, but it never worked for SOCK_SEQPACKET sockets because of their atomic nature. If the sockbuf was partially full, it might return EMSGSIZE instead of blocking. The new solution is based on DragonFlyBSD's fix from commit 3a6117bbe0ed6a87605c1e43e12a1438d8844380 on 2008-05-27. It adds an SB_STOP flag to sockbufs. Whenever uipc_send surpasses the socket's size limit, it sets SB_STOP on the sending sockbuf. sbspace() will then return 0 for that sockbuf, causing sosend_generic and friends to block. uipc_rcvd will likewise clear SB_STOP. There are two fringe benefits: uipc_{send,rcvd} no longer need to call chgsbsize() on every send and receive because they don't change the sockbuf's high water mark. Also, uipc_sense no longer needs to acquire the UIPC linkage lock, because it's simpler to compute the st_blksizes. There is one drawback: since sbspace() will only ever return 0 or the maximum, sosend_generic will allow the sockbuf to exceed its nominal maximum size by at most one packet of size less than the max. I don't think that's a serious problem. In fact, I'm not even positive that FreeBSD guarantees a socket will always stay within its nominal size limit. sys/sys/sockbuf.h Add the SB_STOP flag and adjust sbspace() sys/sys/unpcb.h Delete the obsolete unp_cc and unp_mbcnt fields from struct unpcb. sys/kern/uipc_usrreq.c Adjust uipc_rcvd, uipc_send, and uipc_sense to use the SB_STOP backpressure mechanism. Removing obsolete unpcb fields from db_show_unpcb. tests/sys/kern/unix_seqpacket_test.c Clear expected failures from ATF. Obtained from: DragonFly BSD PR: kern/185812 Reviewed by: silence from freebsd-net@ and rwatson@ MFC after: 3 weeks Sponsored by: Spectra Logic Corporation Modified: head/sys/kern/uipc_usrreq.c head/sys/sys/sockbuf.h head/sys/sys/unpcb.h head/tests/sys/kern/unix_seqpacket_test.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Thu Mar 13 18:17:18 2014 (r263115) +++ head/sys/kern/uipc_usrreq.c Thu Mar 13 18:42:12 2014 (r263116) @@ -51,7 +51,6 @@ * * TODO: * RDM - * distinguish datagram size limits from flow control limits in SEQPACKET * rethink name space problems * need a proper out-of-band */ @@ -789,7 +788,6 @@ uipc_rcvd(struct socket *so, int flags) struct unpcb *unp, *unp2; struct socket *so2; u_int mbcnt, sbcc; - u_long newhiwat; unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_rcvd: unp == NULL")); @@ -811,6 +809,15 @@ uipc_rcvd(struct socket *so, int flags) mbcnt = so->so_rcv.sb_mbcnt; sbcc = so->so_rcv.sb_cc; SOCKBUF_UNLOCK(&so->so_rcv); + /* + * There is a benign race condition at this point. If we're planning to + * clear SB_STOP, but uipc_send is called on the connected socket at + * this instant, it might add data to the sockbuf and set SB_STOP. Then + * we would erroneously clear SB_STOP below, even though the sockbuf is + * full. The race is benign because the only ill effect is to allow the + * sockbuf to exceed its size limit, and the size limits are not + * strictly guaranteed anyway. + */ UNP_PCB_LOCK(unp); unp2 = unp->unp_conn; if (unp2 == NULL) { @@ -819,13 +826,9 @@ uipc_rcvd(struct socket *so, int flags) } so2 = unp2->unp_socket; SOCKBUF_LOCK(&so2->so_snd); - so2->so_snd.sb_mbmax += unp->unp_mbcnt - mbcnt; - newhiwat = so2->so_snd.sb_hiwat + unp->unp_cc - sbcc; - (void)chgsbsize(so2->so_cred->cr_uidinfo, &so2->so_snd.sb_hiwat, - newhiwat, RLIM_INFINITY); + if (sbcc < so2->so_snd.sb_hiwat && mbcnt < so2->so_snd.sb_mbmax) + so2->so_snd.sb_flags &= ~SB_STOP; sowwakeup_locked(so2); - unp->unp_mbcnt = mbcnt; - unp->unp_cc = sbcc; UNP_PCB_UNLOCK(unp); return (0); } @@ -836,8 +839,7 @@ uipc_send(struct socket *so, int flags, { struct unpcb *unp, *unp2; struct socket *so2; - u_int mbcnt_delta, sbcc; - u_int newhiwat; + u_int mbcnt, sbcc; int error = 0; unp = sotounpcb(so); @@ -991,27 +993,21 @@ uipc_send(struct socket *so, int flags, } } - /* - * XXXRW: While fine for SOCK_STREAM, this conflates maximum - * datagram size and back-pressure for SOCK_SEQPACKET, which - * can lead to undesired return of EMSGSIZE on send instead - * of more desirable blocking. - */ - mbcnt_delta = so2->so_rcv.sb_mbcnt - unp2->unp_mbcnt; - unp2->unp_mbcnt = so2->so_rcv.sb_mbcnt; + mbcnt = so2->so_rcv.sb_mbcnt; sbcc = so2->so_rcv.sb_cc; sorwakeup_locked(so2); + /* + * The PCB lock on unp2 protects the SB_STOP flag. Without it, + * it would be possible for uipc_rcvd to be called at this + * point, drain the receiving sockbuf, clear SB_STOP, and then + * we would set SB_STOP below. That could lead to an empty + * sockbuf having SB_STOP set + */ SOCKBUF_LOCK(&so->so_snd); - if ((int)so->so_snd.sb_hiwat >= (int)(sbcc - unp2->unp_cc)) - newhiwat = so->so_snd.sb_hiwat - (sbcc - unp2->unp_cc); - else - newhiwat = 0; - (void)chgsbsize(so->so_cred->cr_uidinfo, &so->so_snd.sb_hiwat, - newhiwat, RLIM_INFINITY); - so->so_snd.sb_mbmax -= mbcnt_delta; + if (sbcc >= so->so_snd.sb_hiwat || mbcnt >= so->so_snd.sb_mbmax) + so->so_snd.sb_flags |= SB_STOP; SOCKBUF_UNLOCK(&so->so_snd); - unp2->unp_cc = sbcc; UNP_PCB_UNLOCK(unp2); m = NULL; break; @@ -1049,27 +1045,18 @@ release: static int uipc_sense(struct socket *so, struct stat *sb) { - struct unpcb *unp, *unp2; - struct socket *so2; + struct unpcb *unp; unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_sense: unp == NULL")); sb->st_blksize = so->so_snd.sb_hiwat; - UNP_LINK_RLOCK(); UNP_PCB_LOCK(unp); - unp2 = unp->unp_conn; - if ((so->so_type == SOCK_STREAM || so->so_type == SOCK_SEQPACKET) && - unp2 != NULL) { - so2 = unp2->unp_socket; - sb->st_blksize += so2->so_rcv.sb_cc; - } sb->st_dev = NODEV; if (unp->unp_ino == 0) unp->unp_ino = (++unp_ino == 0) ? ++unp_ino : unp_ino; sb->st_ino = unp->unp_ino; UNP_PCB_UNLOCK(unp); - UNP_LINK_RUNLOCK(); return (0); } @@ -2497,8 +2484,7 @@ DB_SHOW_COMMAND(unpcb, db_show_unpcb) /* XXXRW: Would be nice to print the full address, if any. */ db_printf("unp_addr: %p\n", unp->unp_addr); - db_printf("unp_cc: %d unp_mbcnt: %d unp_gencnt: %llu\n", - unp->unp_cc, unp->unp_mbcnt, + db_printf("unp_gencnt: %llu\n", (unsigned long long)unp->unp_gencnt); db_printf("unp_flags: %x (", unp->unp_flags); Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Thu Mar 13 18:17:18 2014 (r263115) +++ head/sys/sys/sockbuf.h Thu Mar 13 18:42:12 2014 (r263116) @@ -52,6 +52,7 @@ #define SB_NOCOALESCE 0x200 /* don't coalesce new data into existing mbufs */ #define SB_IN_TOE 0x400 /* socket buffer is in the middle of an operation */ #define SB_AUTOSIZE 0x800 /* automatically size socket buffer */ +#define SB_STOP 0x1000 /* backpressure indicator */ #define SBS_CANTSENDMORE 0x0010 /* can't send more data to peer */ #define SBS_CANTRCVMORE 0x0020 /* can't receive more data from peer */ @@ -168,9 +169,19 @@ void sbunlock(struct sockbuf *sb); * still be negative (cc > hiwat or mbcnt > mbmax). Should detect * overflow and return 0. Should use "lmin" but it doesn't exist now. */ -#define sbspace(sb) \ - ((long) imin((int)((sb)->sb_hiwat - (sb)->sb_cc), \ - (int)((sb)->sb_mbmax - (sb)->sb_mbcnt))) +static __inline +long +sbspace(struct sockbuf *sb) +{ + long bleft; + long mleft; + + if (sb->sb_flags & SB_STOP) + return(0); + bleft = sb->sb_hiwat - sb->sb_cc; + mleft = sb->sb_mbmax - sb->sb_mbcnt; + return((bleft < mleft) ? bleft : mleft); +} /* adjust counters in sb reflecting allocation of m */ #define sballoc(sb, m) { \ Modified: head/sys/sys/unpcb.h ============================================================================== --- head/sys/sys/unpcb.h Thu Mar 13 18:17:18 2014 (r263115) +++ head/sys/sys/unpcb.h Thu Mar 13 18:42:12 2014 (r263116) @@ -74,8 +74,8 @@ struct unpcb { struct unp_head unp_refs; /* referencing socket linked list */ LIST_ENTRY(unpcb) unp_reflink; /* link in unp_refs list */ struct sockaddr_un *unp_addr; /* bound address of socket */ - int unp_cc; /* copy of rcv.sb_cc */ - int unp_mbcnt; /* copy of rcv.sb_mbcnt */ + int reserved1; + int reserved2; unp_gen_t unp_gencnt; /* generation count of this instance */ short unp_flags; /* flags */ short unp_gcflag; /* Garbage collector flags. */ Modified: head/tests/sys/kern/unix_seqpacket_test.c ============================================================================== --- head/tests/sys/kern/unix_seqpacket_test.c Thu Mar 13 18:17:18 2014 (r263115) +++ head/tests/sys/kern/unix_seqpacket_test.c Thu Mar 13 18:42:12 2014 (r263116) @@ -844,25 +844,21 @@ ATF_TC_BODY(emsgsize_nonblocking, tc) ATF_TC_WITHOUT_HEAD(eagain_8k_8k); ATF_TC_BODY(eagain_8k_8k, tc) { - atf_tc_expect_fail("PR kern/185812 send(2) on a UNIX domain SEQPACKET socket returns EMSGSIZE instead of EAGAIN"); test_eagain(8192, 8192); } ATF_TC_WITHOUT_HEAD(eagain_8k_128k); ATF_TC_BODY(eagain_8k_128k, tc) { - atf_tc_expect_fail("PR kern/185812 send(2) on a UNIX domain SEQPACKET socket returns EMSGSIZE instead of EAGAIN"); test_eagain(8192, 131072); } ATF_TC_WITHOUT_HEAD(eagain_128k_8k); ATF_TC_BODY(eagain_128k_8k, tc) { - atf_tc_expect_fail("PR kern/185812 send(2) on a UNIX domain SEQPACKET socket returns EMSGSIZE instead of EAGAIN"); test_eagain(131072, 8192); } ATF_TC_WITHOUT_HEAD(eagain_128k_128k); ATF_TC_BODY(eagain_128k_128k, tc) { - atf_tc_expect_fail("PR kern/185812 send(2) on a UNIX domain SEQPACKET socket returns EMSGSIZE instead of EAGAIN"); test_eagain(131072, 131072); } @@ -969,37 +965,24 @@ ATF_TC_BODY(pipe_simulator_128k_128k, tc ATF_TC_WITHOUT_HEAD(pipe_8k_8k); ATF_TC_BODY(pipe_8k_8k, tc) { - atf_tc_expect_fail("PR kern/185812 send(2) on a UNIX domain SEQPACKET socket returns EMSGSIZE instead of EAGAIN"); test_pipe(8192, 8192); } ATF_TC_WITHOUT_HEAD(pipe_8k_128k); ATF_TC_BODY(pipe_8k_128k, tc) { - atf_tc_expect_fail("PR kern/185812 send(2) on a UNIX domain SEQPACKET socket returns EMSGSIZE instead of EAGAIN"); test_pipe(8192, 131072); } ATF_TC_WITHOUT_HEAD(pipe_128k_8k); ATF_TC_BODY(pipe_128k_8k, tc) { - /* - * kern/185812 causes this test case to both fail and timeout. The - * atf-c-api(3) doesn't have a way to set such an expectation. - * If you use atf_tc_expect_fail, then it will timeout. If you use - * atf_tc_expect_timeout, then it will fail. If you use both, then it - * will show up as an unexpected pass, which is much worse - * - * https://code.google.com/p/kyua/issues/detail?id=76 - */ - atf_tc_expect_fail("PR kern/185812 send(2) on a UNIX domain SEQPACKET socket returns EMSGSIZE instead of EAGAIN"); test_pipe(131072, 8192); } ATF_TC_WITHOUT_HEAD(pipe_128k_128k); ATF_TC_BODY(pipe_128k_128k, tc) { - atf_tc_expect_fail("PR kern/185812 send(2) on a UNIX domain SEQPACKET socket returns EMSGSIZE instead of EAGAIN"); test_pipe(131072, 131072); } From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 19:26:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92F1E7AA; Thu, 13 Mar 2014 19:26:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7E049382; Thu, 13 Mar 2014 19:26:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2DJQNAw049324; Thu, 13 Mar 2014 19:26:23 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2DJQNC8049323; Thu, 13 Mar 2014 19:26:23 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403131926.s2DJQNC8049323@svn.freebsd.org> From: Ed Maste Date: Thu, 13 Mar 2014 19:26:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263117 - head/sys/boot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 19:26:23 -0000 Author: emaste Date: Thu Mar 13 19:26:23 2014 New Revision: 263117 URL: http://svnweb.freebsd.org/changeset/base/263117 Log: Connect 64-bit boot ficl to the build It is not yet used, but this will ensure it doesn't get broken. Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/Makefile.amd64 Modified: head/sys/boot/Makefile.amd64 ============================================================================== --- head/sys/boot/Makefile.amd64 Thu Mar 13 18:42:12 2014 (r263116) +++ head/sys/boot/Makefile.amd64 Thu Mar 13 19:26:23 2014 (r263117) @@ -1,6 +1,7 @@ # $FreeBSD$ SUBDIR+= efi +SUBDIR+= ficl64 SUBDIR+= libstand32 SUBDIR+= zfs SUBDIR+= userboot From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 19:26:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6ED557AD; Thu, 13 Mar 2014 19:26:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5AE76384; Thu, 13 Mar 2014 19:26:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2DJQRHN049365; Thu, 13 Mar 2014 19:26:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2DJQRHg049363; Thu, 13 Mar 2014 19:26:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201403131926.s2DJQRHg049363@svn.freebsd.org> From: Alexander Motin Date: Thu, 13 Mar 2014 19:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263118 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 19:26:27 -0000 Author: mav Date: Thu Mar 13 19:26:26 2014 New Revision: 263118 URL: http://svnweb.freebsd.org/changeset/base/263118 Log: Report ZVOL block size as GEOM stripesize. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Mar 13 19:26:23 2014 (r263117) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Mar 13 19:26:26 2014 (r263118) @@ -925,12 +925,16 @@ zvol_open(struct g_provider *pp, int fla return (SET_ERROR(ENXIO)); } - if (zv->zv_total_opens == 0) + if (zv->zv_total_opens == 0) { err = zvol_first_open(zv); - if (err) { - if (locked) - mutex_exit(&spa_namespace_lock); - return (err); + if (err) { + if (locked) + mutex_exit(&spa_namespace_lock); + return (err); + } + pp->mediasize = zv->zv_volsize; + pp->stripeoffset = 0; + pp->stripesize = zv->zv_volblocksize; } if ((flag & FWRITE) && (zv->zv_flags & ZVOL_RDONLY)) { err = SET_ERROR(EROFS); From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 21:07:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 666E120F; Thu, 13 Mar 2014 21:07:38 +0000 (UTC) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 27F26EE1; Thu, 13 Mar 2014 21:07:37 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 326CC1A07D5; Fri, 14 Mar 2014 08:07:30 +1100 (EST) Date: Fri, 14 Mar 2014 08:07:07 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin Subject: Re: svn commit: r263113 - head/sys/x86/x86 In-Reply-To: <201403131811.s2DIBgUb019577@svn.freebsd.org> Message-ID: <20140314073741.T978@besplex.bde.org> References: <201403131811.s2DIBgUb019577@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=ddC5gxne c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=ajY_dDsnAdgA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=5aufQkHnAAAA:8 a=nG4OoZy845CdLDuT8BwA:9 a=CjuIK1q_8ugA:10 a=WnMqR7Xl1tcA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 21:07:38 -0000 On Thu, 13 Mar 2014, John Baldwin wrote: > Log: > Correct type for malloc(). > > Submitted by: "Conrad Meyer" Not so nice a cleanup as a previous one by the same author. > Modified: head/sys/x86/x86/mca.c > ============================================================================== > --- head/sys/x86/x86/mca.c Thu Mar 13 16:51:40 2014 (r263112) > +++ head/sys/x86/x86/mca.c Thu Mar 13 18:11:42 2014 (r263113) > @@ -700,8 +700,8 @@ cmci_setup(void) > { > int i; > > - cmc_state = malloc((mp_maxid + 1) * sizeof(struct cmc_state **), > - M_MCA, M_WAITOK); > + cmc_state = malloc((mp_maxid + 1) * sizeof(struct cmc_state *), M_MCA, > + M_WAITOK); This still spells the element type verbosely and non-robustly as instead of as . Better spelling: cmc_state = malloc((mp_maxid + 1) * sizeof(*cmc_state), M_MCA, M_WAITOK); The variable names are confusing. cmc_state is a doubly-indirect pointer, but is spelled without a single p. This was confusing enough to give the original bug (but since all struct pointers have the same size even in strictly portable C, this was only a style bug). It is unclear what sort of a pointer cmc_state is in the changed version, but using the correct spelling automatically gets the number of stars right (since the size being malloc()ed has a product term with a variable, the allocation must be for a dynamic array and the element type must need a single star to modify the result type; this star actually removes 1 of the 2 indirections, giving a pointer to the basic struct type). Local pointers to struct cmc_state are mostly spelled cc. Struct member names in struct cmc_state are missing prefixes. > for (i = 0; i <= mp_maxid; i++) > cmc_state[i] = malloc(sizeof(struct cmc_state) * mca_banks, > M_MCA, M_WAITOK | M_ZERO); SImilarly, plus the order of terms in the multiplication is gratuitously different. I prefer the first order: cmc_state[i] = malloc(mca_banks * sizeof(*cmc_state[i]), M_MCA, M_WAITOK | M_ZERO); There are 2 other malloc()s in the file. These use the best spelling for the sizeof() but not for variable names. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 22:27:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1DF26AD; Thu, 13 Mar 2014 22:27:28 +0000 (UTC) Received: from secure.freebsdsolutions.net (secure.freebsdsolutions.net [69.55.234.48]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 82323852; Thu, 13 Mar 2014 22:27:28 +0000 (UTC) Received: from [10.10.1.198] (office.betterlinux.com [199.58.199.60]) (authenticated bits=0) by secure.freebsdsolutions.net (8.14.4/8.14.4) with ESMTP id s2DMRGIn076483 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Thu, 13 Mar 2014 18:27:17 -0400 (EDT) (envelope-from john@jnielsen.net) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263110 - head/share/man/man4 From: John Nielsen In-Reply-To: <201403131619.s2DGJax1071196@svn.freebsd.org> Date: Thu, 13 Mar 2014 16:28:20 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <4D0B04BD-4EF6-4963-941E-012B81F8DFAB@jnielsen.net> References: <201403131619.s2DGJax1071196@svn.freebsd.org> To: John-Mark Gurney X-Mailer: Apple Mail (2.1874) X-DCC-Etherboy-Metrics: ns1.jnielsen.net 1002; Body=4 Fuz1=4 Fuz2=4 X-Virus-Scanned: clamav-milter 0.97.8 at ns1.jnielsen.net X-Virus-Status: Clean Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 22:27:28 -0000 On Mar 13, 2014, at 10:19 AM, John-Mark Gurney wrote: > Author: jmg > Date: Thu Mar 13 16:19:36 2014 > New Revision: 263110 > URL: http://svnweb.freebsd.org/changeset/base/263110 >=20 > Log: > remove link to the missing AMD Geode LX SB man page... we can add it > back once someone cares enough to write one.. You mean like this one? http://svnweb.freebsd.org/base/head/share/man/man4/man4.i386/glxsb.4 > Modified: > head/share/man/man4/crypto.4 >=20 > Modified: head/share/man/man4/crypto.4 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/share/man/man4/crypto.4 Thu Mar 13 15:57:25 2014 = (r263109) > +++ head/share/man/man4/crypto.4 Thu Mar 13 16:19:36 2014 = (r263110) > @@ -107,7 +107,6 @@ crypto access device > .El > .Sh SEE ALSO > .Xr aesni 4 , > -.Xr glxsb 4 , > .Xr hifn 4 , > .Xr ipsec 4 , > .Xr padlock 4 , > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to = "svn-src-head-unsubscribe@freebsd.org" >=20 From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 23:09:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D62B0732; Thu, 13 Mar 2014 23:09:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C30EAC41; Thu, 13 Mar 2014 23:09:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2DN9mmB040270; Thu, 13 Mar 2014 23:09:48 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2DN9m2S040268; Thu, 13 Mar 2014 23:09:48 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403132309.s2DN9m2S040268@svn.freebsd.org> From: Dimitry Andric Date: Thu, 13 Mar 2014 23:09:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263120 - head/contrib/libc++/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 23:09:49 -0000 Author: dim Date: Thu Mar 13 23:09:48 2014 New Revision: 263120 URL: http://svnweb.freebsd.org/changeset/base/263120 Log: Pull in r201021 from upstream libc++ trunk: Fix for PR18735 - self-assignment for map/multimap gives incorrect results in C++03 (Please note: that is an LLVM PR identifier, not a FreeBSD one.) Reported by: rakuco MFC after: 3 days Modified: head/contrib/libc++/include/map head/contrib/libc++/include/unordered_map Modified: head/contrib/libc++/include/map ============================================================================== --- head/contrib/libc++/include/map Thu Mar 13 21:06:13 2014 (r263119) +++ head/contrib/libc++/include/map Thu Mar 13 23:09:48 2014 (r263120) @@ -884,10 +884,12 @@ public: #if __cplusplus >= 201103L __tree_ = __m.__tree_; #else - __tree_.clear(); - __tree_.value_comp() = __m.__tree_.value_comp(); - __tree_.__copy_assign_alloc(__m.__tree_); - insert(__m.begin(), __m.end()); + if (this != &__m) { + __tree_.clear(); + __tree_.value_comp() = __m.__tree_.value_comp(); + __tree_.__copy_assign_alloc(__m.__tree_); + insert(__m.begin(), __m.end()); + } #endif return *this; } @@ -1616,10 +1618,12 @@ public: #if __cplusplus >= 201103L __tree_ = __m.__tree_; #else - __tree_.clear(); - __tree_.value_comp() = __m.__tree_.value_comp(); - __tree_.__copy_assign_alloc(__m.__tree_); - insert(__m.begin(), __m.end()); + if (this != &__m) { + __tree_.clear(); + __tree_.value_comp() = __m.__tree_.value_comp(); + __tree_.__copy_assign_alloc(__m.__tree_); + insert(__m.begin(), __m.end()); + } #endif return *this; } Modified: head/contrib/libc++/include/unordered_map ============================================================================== --- head/contrib/libc++/include/unordered_map Thu Mar 13 21:06:13 2014 (r263119) +++ head/contrib/libc++/include/unordered_map Thu Mar 13 23:09:48 2014 (r263120) @@ -831,12 +831,14 @@ public: #if __cplusplus >= 201103L __table_ = __u.__table_; #else - __table_.clear(); - __table_.hash_function() = __u.__table_.hash_function(); - __table_.key_eq() = __u.__table_.key_eq(); - __table_.max_load_factor() = __u.__table_.max_load_factor(); - __table_.__copy_assign_alloc(__u.__table_); - insert(__u.begin(), __u.end()); + if (this != &__u) { + __table_.clear(); + __table_.hash_function() = __u.__table_.hash_function(); + __table_.key_eq() = __u.__table_.key_eq(); + __table_.max_load_factor() = __u.__table_.max_load_factor(); + __table_.__copy_assign_alloc(__u.__table_); + insert(__u.begin(), __u.end()); + } #endif return *this; } @@ -1567,12 +1569,14 @@ public: #if __cplusplus >= 201103L __table_ = __u.__table_; #else - __table_.clear(); - __table_.hash_function() = __u.__table_.hash_function(); - __table_.key_eq() = __u.__table_.key_eq(); - __table_.max_load_factor() = __u.__table_.max_load_factor(); - __table_.__copy_assign_alloc(__u.__table_); - insert(__u.begin(), __u.end()); + if (this != &__u) { + __table_.clear(); + __table_.hash_function() = __u.__table_.hash_function(); + __table_.key_eq() = __u.__table_.key_eq(); + __table_.max_load_factor() = __u.__table_.max_load_factor(); + __table_.__copy_assign_alloc(__u.__table_); + insert(__u.begin(), __u.end()); + } #endif return *this; } From owner-svn-src-head@FreeBSD.ORG Thu Mar 13 23:31:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F27BE66; Thu, 13 Mar 2014 23:31:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 518C7E0B; Thu, 13 Mar 2014 23:31:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2DNV6Ku050295; Thu, 13 Mar 2014 23:31:06 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2DNV6lB050293; Thu, 13 Mar 2014 23:31:06 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201403132331.s2DNV6lB050293@svn.freebsd.org> From: Christian Brueffer Date: Thu, 13 Mar 2014 23:31:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263121 - head/libexec/bootpd/tools/bootptest X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2014 23:31:06 -0000 Author: brueffer Date: Thu Mar 13 23:31:05 2014 New Revision: 263121 URL: http://svnweb.freebsd.org/changeset/base/263121 Log: Re-format the license to conform to our BSD license template as much as possible. This does not change the wording in any way. Remove the 3rd clause ("advertising clause") of the BSD license as permitted by the University of Berkeley on July 22, 1999. While the clause itself mentions Lawrence Berkeley Laboratory, UCB is the sole copyright holder of this file. Reviewed by: imp, emaste, eadler MFC after: 2 weeks Modified: head/libexec/bootpd/tools/bootptest/print-bootp.c Modified: head/libexec/bootpd/tools/bootptest/print-bootp.c ============================================================================== --- head/libexec/bootpd/tools/bootptest/print-bootp.c Thu Mar 13 23:09:48 2014 (r263120) +++ head/libexec/bootpd/tools/bootptest/print-bootp.c Thu Mar 13 23:31:05 2014 (r263121) @@ -1,19 +1,18 @@ /* - * Copyright (c) 1988-1990 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988-1990 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that: (1) source code distributions - * retain the above copyright notice and this paragraph in its entirety, (2) - * distributions including binary code include the above copyright notice and - * this paragraph in its entirety in the documentation or other materials - * provided with the distribution, and (3) all advertising materials mentioning - * features or use of this software display the following acknowledgement: - * ``This product includes software developed by the University of California, - * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of - * the University nor the names of its contributors may be used to endorse - * or promote products derived from this software without specific prior - * written permission. + * modification, are permitted provided that: + * 1. Source code distributions retain the above copyright + * notice and this paragraph in its entirety + * 2. Distributions including binary code include the above copyright + * notice and this paragraph in its entirety in the documentation + * or other materials provided with the distribution, and + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 00:47:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14B12B4C; Fri, 14 Mar 2014 00:47:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 01215633; Fri, 14 Mar 2014 00:47:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E0lk5h081138; Fri, 14 Mar 2014 00:47:46 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E0lkMG081137; Fri, 14 Mar 2014 00:47:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403140047.s2E0lkMG081137@svn.freebsd.org> From: Xin LI Date: Fri, 14 Mar 2014 00:47:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263123 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 00:47:47 -0000 Author: delphij Date: Fri Mar 14 00:47:46 2014 New Revision: 263123 URL: http://svnweb.freebsd.org/changeset/base/263123 Log: Hide a few messages under bootverbose. Reviewed by: Abhishek Gupta MFC after: 2 weeks Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Mar 14 00:12:53 2014 (r263122) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Mar 14 00:47:46 2014 (r263123) @@ -182,7 +182,8 @@ netvsc_drv_init(void) static void netvsc_init(void) { - printf("Netvsc initializing... "); + if (bootverbose) + printf("Netvsc initializing... "); /* * XXXKYS: cleanup initialization @@ -190,10 +191,10 @@ netvsc_init(void) if (!cold && !g_netvsc_drv.drv_inited) { g_netvsc_drv.drv_inited = 1; netvsc_drv_init(); - printf("done!\n"); - } else { + if (bootverbose) + printf("done!\n"); + } else if (bootverbose) printf("Already initialized!\n"); - } } /* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */ @@ -214,7 +215,8 @@ netvsc_probe(device_t dev) p = vmbus_get_type(dev); if (!memcmp(p, &g_net_vsc_device_type.data, sizeof(hv_guid))) { device_set_desc(dev, "Synthetic Network Interface"); - printf("Netvsc probe... DONE \n"); + if (bootverbose) + printf("Netvsc probe... DONE \n"); return (0); } @@ -300,7 +302,8 @@ netvsc_detach(device_t dev) { struct hv_device *hv_device = vmbus_get_devctx(dev); - printf("netvsc_detach\n"); + if (bootverbose) + printf("netvsc_detach\n"); /* * XXXKYS: Need to clean up all our @@ -895,7 +898,8 @@ hn_stop(hn_softc_t *sc) ifp = sc->hn_ifp; - printf(" Closing Device ...\n"); + if (bootverbose) + printf(" Closing Device ...\n"); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); sc->hn_initdone = 0; From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 00:49:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0DB3CAC; Fri, 14 Mar 2014 00:49:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 83AC6644; Fri, 14 Mar 2014 00:49:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E0n24j081320; Fri, 14 Mar 2014 00:49:02 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E0n2Zp081319; Fri, 14 Mar 2014 00:49:02 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403140049.s2E0n2Zp081319@svn.freebsd.org> From: Ian Lepore Date: Fri, 14 Mar 2014 00:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263124 - head/sys/boot/uboot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 00:49:02 -0000 Author: ian Date: Fri Mar 14 00:49:02 2014 New Revision: 263124 URL: http://svnweb.freebsd.org/changeset/base/263124 Log: Fix an uninitialized variable error I perpetrated when splitting some code into a separate function. Pass the missing value from main() to the probe_disks() function. Modified: head/sys/boot/uboot/common/main.c Modified: head/sys/boot/uboot/common/main.c ============================================================================== --- head/sys/boot/uboot/common/main.c Fri Mar 14 00:47:46 2014 (r263123) +++ head/sys/boot/uboot/common/main.c Fri Mar 14 00:49:02 2014 (r263124) @@ -298,9 +298,10 @@ get_load_device(int *type, int *unit, in } static int -probe_disks(int load_type, int load_unit, int load_slice, int load_partition) +probe_disks(int devidx, int load_type, int load_unit, int load_slice, + int load_partition) { - int i, open_result, unit; + int open_result, unit; struct open_file f; currdev.d_disk.slice = load_slice; @@ -317,7 +318,7 @@ probe_disks(int load_type, int load_unit printf("Checking unit=%d slice=%d partition=%d...", currdev.d_unit, currdev.d_disk.slice, currdev.d_disk.partition); - open_result = devsw[i]->dv_open(&f, &currdev); + open_result = devsw[devidx]->dv_open(&f, &currdev); if (open_result == 0) { printf(" good.\n"); return (0); @@ -337,7 +338,7 @@ probe_disks(int load_type, int load_unit printf("Checking unit=%d slice=%d partition=%d...", currdev.d_unit, currdev.d_disk.slice, currdev.d_disk.partition); - open_result = devsw[i]->dv_open(&f, &currdev); + open_result = devsw[devidx]->dv_open(&f, &currdev); if (open_result == 0) { printf(" good.\n"); return (0); @@ -351,7 +352,7 @@ probe_disks(int load_type, int load_unit printf("Checking unit=%d slice=%d partition=%d...", currdev.d_unit, currdev.d_disk.slice, currdev.d_disk.partition); - open_result = devsw[i]->dv_open(&f,&currdev); + open_result = devsw[devidx]->dv_open(&f,&currdev); if (open_result == 0) { printf("good.\n"); return (0); @@ -440,7 +441,7 @@ main(void) if ((load_type == -1 || (load_type & DEV_TYP_STOR)) && strcmp(devsw[i]->dv_name, "disk") == 0) { - if (probe_disks(load_type, load_unit, load_slice, + if (probe_disks(i, load_type, load_unit, load_slice, load_partition) == 0) break; } From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 01:17:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AFBC9E4; Fri, 14 Mar 2014 01:17:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E1CF68ED; Fri, 14 Mar 2014 01:17:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E1HBS2093453; Fri, 14 Mar 2014 01:17:11 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E1HBlG093452; Fri, 14 Mar 2014 01:17:11 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403140117.s2E1HBlG093452@svn.freebsd.org> From: Bryan Drewery Date: Fri, 14 Mar 2014 01:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263129 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 01:17:12 -0000 Author: bdrewery Date: Fri Mar 14 01:17:11 2014 New Revision: 263129 URL: http://svnweb.freebsd.org/changeset/base/263129 Log: Combine similar code from vprintf(9) and log(9). MFC after: 2 weeks Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Fri Mar 14 01:10:54 2014 (r263128) +++ head/sys/kern/subr_prf.c Fri Mar 14 01:17:11 2014 (r263129) @@ -248,23 +248,18 @@ ttyprintf(struct tty *tp, const char *fm return (retval); } -/* - * Log writes to the log buffer, and guarantees not to sleep (so can be - * called by interrupt routines). If there is no process reading the - * log yet, it writes to the console also. - */ -void -log(int level, const char *fmt, ...) +static int +_vprintf(int level, int flags, const char *fmt, va_list ap) { - va_list ap; struct putchar_arg pca; + int retval; #ifdef PRINTF_BUFR_SIZE char bufr[PRINTF_BUFR_SIZE]; #endif pca.tty = NULL; pca.pri = level; - pca.flags = log_open ? TOLOG : TOCONS; + pca.flags = flags; #ifdef PRINTF_BUFR_SIZE pca.p_bufr = bufr; pca.p_next = pca.p_bufr; @@ -272,12 +267,11 @@ log(int level, const char *fmt, ...) pca.remain = sizeof(bufr); *pca.p_next = '\0'; #else + /* Don't buffer console output. */ pca.p_bufr = NULL; #endif - va_start(ap, fmt); - kvprintf(fmt, putchar, &pca, 10, ap); - va_end(ap); + retval = kvprintf(fmt, putchar, &pca, 10, ap); #ifdef PRINTF_BUFR_SIZE /* Write any buffered console/log output: */ @@ -289,6 +283,24 @@ log(int level, const char *fmt, ...) cnputs(pca.p_bufr); } #endif + + return (retval); +} + +/* + * Log writes to the log buffer, and guarantees not to sleep (so can be + * called by interrupt routines). If there is no process reading the + * log yet, it writes to the console also. + */ +void +log(int level, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + (void)_vprintf(level, log_open ? TOLOG : TOCONS, fmt, ap); + va_end(ap); + msgbuftrigger = 1; } @@ -374,35 +386,9 @@ printf(const char *fmt, ...) int vprintf(const char *fmt, va_list ap) { - struct putchar_arg pca; int retval; -#ifdef PRINTF_BUFR_SIZE - char bufr[PRINTF_BUFR_SIZE]; -#endif - pca.tty = NULL; - pca.flags = TOCONS | TOLOG; - pca.pri = -1; -#ifdef PRINTF_BUFR_SIZE - pca.p_bufr = bufr; - pca.p_next = pca.p_bufr; - pca.n_bufr = sizeof(bufr); - pca.remain = sizeof(bufr); - *pca.p_next = '\0'; -#else - /* Don't buffer console output. */ - pca.p_bufr = NULL; -#endif - - retval = kvprintf(fmt, putchar, &pca, 10, ap); - -#ifdef PRINTF_BUFR_SIZE - /* Write any buffered console/log output: */ - if (*pca.p_bufr != '\0') { - cnputs(pca.p_bufr); - msglogstr(pca.p_bufr, pca.pri, /*filter_cr*/ 1); - } -#endif + retval = _vprintf(-1, TOCONS | TOLOG, fmt, ap); if (!panicstr) msgbuftrigger = 1; From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 01:43:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 116091AF; Fri, 14 Mar 2014 01:43:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F27E0AB5; Fri, 14 Mar 2014 01:43:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E1htwW005359; Fri, 14 Mar 2014 01:43:55 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E1httY005358; Fri, 14 Mar 2014 01:43:55 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403140143.s2E1httY005358@svn.freebsd.org> From: Bryan Drewery Date: Fri, 14 Mar 2014 01:43:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263130 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 01:43:56 -0000 Author: bdrewery Date: Fri Mar 14 01:43:55 2014 New Revision: 263130 URL: http://svnweb.freebsd.org/changeset/base/263130 Log: Fix -o size less than PAGE_SIZE resulting in SIZE_MAX being used. Discussed with: kib MFC after: 2 weeks Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Fri Mar 14 01:17:11 2014 (r263129) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Fri Mar 14 01:43:55 2014 (r263130) @@ -200,11 +200,13 @@ tmpfs_mount(struct mount *mp) * allowed to use, based on the maximum size the user passed in * the mount structure. A value of zero is treated as if the * maximum available space was requested. */ - if (size_max < PAGE_SIZE || size_max > OFF_MAX - PAGE_SIZE || + if (size_max == 0 || size_max > OFF_MAX - PAGE_SIZE || (SIZE_MAX < OFF_MAX && size_max / PAGE_SIZE >= SIZE_MAX)) pages = SIZE_MAX; - else + else { + size_max = roundup(size_max, PAGE_SIZE); pages = howmany(size_max, PAGE_SIZE); + } MPASS(pages > 0); if (nodes_max <= 3) { From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 01:54:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE2AE4AD; Fri, 14 Mar 2014 01:54:39 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 706D2B7E; Fri, 14 Mar 2014 01:54:39 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s2E1scHP036451 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 13 Mar 2014 18:54:39 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s2E1scVl036450; Thu, 13 Mar 2014 18:54:38 -0700 (PDT) (envelope-from jmg) Date: Thu, 13 Mar 2014 18:54:38 -0700 From: John-Mark Gurney To: John Nielsen Subject: Re: svn commit: r263110 - head/share/man/man4 Message-ID: <20140314015438.GO32089@funkthat.com> References: <201403131619.s2DGJax1071196@svn.freebsd.org> <4D0B04BD-4EF6-4963-941E-012B81F8DFAB@jnielsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D0B04BD-4EF6-4963-941E-012B81F8DFAB@jnielsen.net> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 13 Mar 2014 18:54:39 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 01:54:39 -0000 John Nielsen wrote this message on Thu, Mar 13, 2014 at 16:28 -0600: > On Mar 13, 2014, at 10:19 AM, John-Mark Gurney wrote: > > > Author: jmg > > Date: Thu Mar 13 16:19:36 2014 > > New Revision: 263110 > > URL: http://svnweb.freebsd.org/changeset/base/263110 > > > > Log: > > remove link to the missing AMD Geode LX SB man page... we can add it > > back once someone cares enough to write one.. > > You mean like this one? > http://svnweb.freebsd.org/base/head/share/man/man4/man4.i386/glxsb.4 The problems of checking on an amd64 box... :( Actually, how are we suppose to handle links to arch dependant man pages in arch independant man pages? I did this check on an amd64 box, so the page glxsb didn't get installed... Should we just always install these man pages on all arches then? Or are we fine w/ references to non-existant pages (on some arches)? Or should glxsb.4 be moved to an arch independant dir? I'll fix properly once the above questions get answered... > > Modified: > > head/share/man/man4/crypto.4 > > > > Modified: head/share/man/man4/crypto.4 > > ============================================================================== > > --- head/share/man/man4/crypto.4 Thu Mar 13 15:57:25 2014 (r263109) > > +++ head/share/man/man4/crypto.4 Thu Mar 13 16:19:36 2014 (r263110) > > @@ -107,7 +107,6 @@ crypto access device > > .El > > .Sh SEE ALSO > > .Xr aesni 4 , > > -.Xr glxsb 4 , > > .Xr hifn 4 , > > .Xr ipsec 4 , > > .Xr padlock 4 , > > _______________________________________________ > > svn-src-head@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > > -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 02:10:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8C94A0E; Fri, 14 Mar 2014 02:10:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC13DC74; Fri, 14 Mar 2014 02:10:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E2AUbd016018; Fri, 14 Mar 2014 02:10:30 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E2AUgZ016017; Fri, 14 Mar 2014 02:10:30 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403140210.s2E2AUgZ016017@svn.freebsd.org> From: Bryan Drewery Date: Fri, 14 Mar 2014 02:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263131 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 02:10:30 -0000 Author: bdrewery Date: Fri Mar 14 02:10:30 2014 New Revision: 263131 URL: http://svnweb.freebsd.org/changeset/base/263131 Log: Cleanup redundant logic and add some comments to help explain how it works in lieu of potentially less clear code. Sponsored by: EMC / Isilon Storage Division Discussed with: Russell Cattelan Modified: head/sys/fs/tmpfs/tmpfs_subr.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Fri Mar 14 01:43:55 2014 (r263130) +++ head/sys/fs/tmpfs/tmpfs_subr.c Fri Mar 14 02:10:30 2014 (r263131) @@ -348,6 +348,9 @@ tmpfs_dirent_hash(const char *name, u_in static __inline off_t tmpfs_dirent_cookie(struct tmpfs_dirent *de) { + if (de == NULL) + return (TMPFS_DIRCOOKIE_EOF); + MPASS(de->td_cookie >= TMPFS_DIRCOOKIE_MIN); return (de->td_cookie); @@ -1155,6 +1158,15 @@ tmpfs_dir_getdents(struct tmpfs_node *no TMPFS_VALIDATE_DIR(node); off = 0; + + /* + * Lookup the node from the current offset. The starting offset of + * 0 will lookup both '.' and '..', and then the first real entry, + * or EOF if there are none. Then find all entries for the dir that + * fit into the buffer. Once no more entries are found (de == NULL), + * the offset is set to TMPFS_DIRCOOKIE_EOF, which will cause the next + * call to return 0. + */ switch (uio->uio_offset) { case TMPFS_DIRCOOKIE_DOT: error = tmpfs_dir_getdotdent(node, uio); @@ -1168,12 +1180,10 @@ tmpfs_dir_getdents(struct tmpfs_node *no if (error != 0) return (error); de = tmpfs_dir_first(node, &dc); - if (de == NULL) - uio->uio_offset = TMPFS_DIRCOOKIE_EOF; - else - uio->uio_offset = tmpfs_dirent_cookie(de); + uio->uio_offset = tmpfs_dirent_cookie(de); if (cnt != 0) cookies[(*ncookies)++] = off = uio->uio_offset; + /* EOF. */ if (de == NULL) return (0); break; @@ -1252,10 +1262,7 @@ tmpfs_dir_getdents(struct tmpfs_node *no if (error == 0) { de = tmpfs_dir_next(node, &dc); if (cnt != 0) { - if (de == NULL) - off = TMPFS_DIRCOOKIE_EOF; - else - off = tmpfs_dirent_cookie(de); + off = tmpfs_dirent_cookie(de); MPASS(*ncookies < cnt); cookies[(*ncookies)++] = off; } @@ -1263,12 +1270,8 @@ tmpfs_dir_getdents(struct tmpfs_node *no } while (error == 0 && uio->uio_resid > 0 && de != NULL); /* Update the offset and cache. */ - if (cnt == 0) { - if (de == NULL) - off = TMPFS_DIRCOOKIE_EOF; - else - off = tmpfs_dirent_cookie(de); - } + if (cnt == 0) + off = tmpfs_dirent_cookie(de); uio->uio_offset = off; node->tn_dir.tn_readdir_lastn = off; From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 02:15:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71AC3BF8; Fri, 14 Mar 2014 02:15:23 +0000 (UTC) Received: from felyko.com (felyko.com [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 5A0DBCFB; Fri, 14 Mar 2014 02:15:23 +0000 (UTC) Received: from [IPv6:2601:9:8280:603:d81c:eb3d:730f:25bd] (unknown [IPv6:2601:9:8280:603:d81c:eb3d:730f:25bd]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 6E39939843; Thu, 13 Mar 2014 19:15:22 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r262972 - head/sys/dev/usb/input From: Rui Paulo In-Reply-To: <201403100852.s2A8qUdC045704@svn.freebsd.org> Date: Thu, 13 Mar 2014 19:15:26 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201403100852.s2A8qUdC045704@svn.freebsd.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 02:15:23 -0000 On 10 Mar 2014, at 01:52, Hans Petter Selasky = wrote: > Author: hselasky > Date: Mon Mar 10 08:52:30 2014 > New Revision: 262972 > URL: http://svnweb.freebsd.org/changeset/base/262972 >=20 > Log: > Ignore USB keyboard driver calls from critical sections. >=20 > Reported by: Oliver Pinter > MFC after: 1 week >=20 > Modified: > head/sys/dev/usb/input/ukbd.c >=20 > Modified: head/sys/dev/usb/input/ukbd.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/usb/input/ukbd.c Mon Mar 10 06:41:48 2014 = (r262971) > +++ head/sys/dev/usb/input/ukbd.c Mon Mar 10 08:52:30 2014 = (r262972) > @@ -1909,6 +1909,12 @@ ukbd_ioctl(keyboard_t *kbd, u_long cmd,=20 > int result; >=20 > /* > + * XXX Check of someone is calling us from a critical section: > + */ > + if (curthread->td_critnest !=3D 0) > + return (EDEADLK); Shouldn't this panic? -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 02:37:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9ED292FE; Fri, 14 Mar 2014 02:37:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8BB32EC1; Fri, 14 Mar 2014 02:37:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E2bdO7026316; Fri, 14 Mar 2014 02:37:39 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E2bdWi026315; Fri, 14 Mar 2014 02:37:39 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403140237.s2E2bdWi026315@svn.freebsd.org> From: Devin Teske Date: Fri, 14 Mar 2014 02:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263133 - head/usr.sbin/bsdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 02:37:39 -0000 Author: dteske Date: Fri Mar 14 02:37:39 2014 New Revision: 263133 URL: http://svnweb.freebsd.org/changeset/base/263133 Log: Remove indexfile from debug statement as it is already logged by f_index_menusel_command() used just-prior to this debug statement. Also, log the arguments being passed to the resword. Modified: head/usr.sbin/bsdconfig/bsdconfig Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Fri Mar 14 02:37:07 2014 (r263132) +++ head/usr.sbin/bsdconfig/bsdconfig Fri Mar 14 02:37:39 2014 (r263133) @@ -315,8 +315,7 @@ if [ "$pgm" != "bsdconfig" ]; then if indexfile=$( f_index_file "$pgm" ) && cmd=$( f_index_menusel_command "$indexfile" "$pgm" ) then - f_dprintf "pgm=[%s] indexfile=[%s] cmd=[%s]" \ - "$pgm" "$indexfile" "$cmd" + f_dprintf "pgm=[%s] cmd=[%s] *=[%s]" "$pgm" "$cmd" "$*" exec "$cmd" "$@" || exit 1 else f_include $BSDCFG_SHARE/script.subr From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 02:38:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 125D8447; Fri, 14 Mar 2014 02:38:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F34DCECA; Fri, 14 Mar 2014 02:38:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E2cuho026487; Fri, 14 Mar 2014 02:38:56 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E2cuMW026486; Fri, 14 Mar 2014 02:38:56 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403140238.s2E2cuMW026486@svn.freebsd.org> From: Devin Teske Date: Fri, 14 Mar 2014 02:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263134 - head/usr.sbin/bsdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 02:38:57 -0000 Author: dteske Date: Fri Mar 14 02:38:56 2014 New Revision: 263134 URL: http://svnweb.freebsd.org/changeset/base/263134 Log: Add debug statement just before attempting to exec a module. Modified: head/usr.sbin/bsdconfig/bsdconfig Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Fri Mar 14 02:37:39 2014 (r263133) +++ head/usr.sbin/bsdconfig/bsdconfig Fri Mar 14 02:38:56 2014 (r263134) @@ -381,6 +381,7 @@ if [ "$1" ]; then # Not reached fi + f_dprintf "cmd=[%s] *=[%s]" "$cmd" "$*" shift exec $cmd ${USE_XDIALOG:+-X} "$@" || exit 1 # Not reached From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 02:39:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41F6C590; Fri, 14 Mar 2014 02:39:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2E1C2ED3; Fri, 14 Mar 2014 02:39:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E2dhMG026623; Fri, 14 Mar 2014 02:39:43 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E2dhWj026622; Fri, 14 Mar 2014 02:39:43 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403140239.s2E2dhWj026622@svn.freebsd.org> From: Devin Teske Date: Fri, 14 Mar 2014 02:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263135 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 02:39:43 -0000 Author: dteske Date: Fri Mar 14 02:39:42 2014 New Revision: 263135 URL: http://svnweb.freebsd.org/changeset/base/263135 Log: Comments. Modified: head/usr.sbin/bsdconfig/share/device.subr Modified: head/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/device.subr Fri Mar 14 02:38:56 2014 (r263134) +++ head/usr.sbin/bsdconfig/share/device.subr Fri Mar 14 02:39:42 2014 (r263135) @@ -170,11 +170,10 @@ f_device_reset() for dev in $DEVICES; do f_device_shutdown $dev - # - # XXX this potentially leaks $dev->private if it's being + # XXX This potentially leaks $dev->private if it's being # used to point to something dynamic, but you're not supposed # to call this routine at such times that some open instance - # has its private member pointing somewhere anyway. XXX + # has its private member pointing somewhere anyway. # f_struct_free device_$dev done @@ -325,8 +324,7 @@ f_device_get_all() case "$diskname" in cd*) - # XXX - # Due to unknown reasons, kern.disks returns SCSI + # XXX Due to unknown reasons, kern.disks returns SCSI # CDROM as a valid disk. This will prevent bsdconfig # from presenting SCSI CDROMs as available disks in # various menus. Why GEOM treats SCSI CDROM as a disk From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 02:40:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 180266D7; Fri, 14 Mar 2014 02:40:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 052D0F45; Fri, 14 Mar 2014 02:40:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E2eqwA028877; Fri, 14 Mar 2014 02:40:52 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E2eqP5028872; Fri, 14 Mar 2014 02:40:52 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403140240.s2E2eqP5028872@svn.freebsd.org> From: Devin Teske Date: Fri, 14 Mar 2014 02:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263136 - in head/usr.sbin/bsdconfig: . share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 02:40:53 -0000 Author: dteske Date: Fri Mar 14 02:40:52 2014 New Revision: 263136 URL: http://svnweb.freebsd.org/changeset/base/263136 Log: Update copyright. Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/share/device.subr Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Fri Mar 14 02:39:42 2014 (r263135) +++ head/usr.sbin/bsdconfig/bsdconfig Fri Mar 14 02:40:52 2014 (r263136) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: head/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/device.subr Fri Mar 14 02:39:42 2014 (r263135) +++ head/usr.sbin/bsdconfig/share/device.subr Fri Mar 14 02:40:52 2014 (r263136) @@ -1,6 +1,6 @@ if [ ! "$_DEVICE_SUBR" ]; then _DEVICE_SUBR=1 # -# Copyright (c) 2012-2013 Devin Teske +# Copyright (c) 2012-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 02:50:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C00D914; Fri, 14 Mar 2014 02:50:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5C324F87; Fri, 14 Mar 2014 02:50:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E2oX1d031829; Fri, 14 Mar 2014 02:50:33 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E2oXDo031828; Fri, 14 Mar 2014 02:50:33 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403140250.s2E2oXDo031828@svn.freebsd.org> From: Devin Teske Date: Fri, 14 Mar 2014 02:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263137 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 02:50:33 -0000 Author: dteske Date: Fri Mar 14 02:50:32 2014 New Revision: 263137 URL: http://svnweb.freebsd.org/changeset/base/263137 Log: Fix future namespace issues for functions taking $var_to_set -- functions taking a variable to set need to make sure they protect their locals; if $var_to_set positional argument coincides with a local the expected call to `setvar' will fail to reach outside of the function's namespace. When such collisions are experienced (as I did in the rewrite of usermgmt) the solution is to append a full or abbreviated version of the function name to the local (ultimately eliminating collisions). This is rarely needed and only occurs when you have a lot of like-named functions that pass very similar $var_to_set positional arguments to each other (such as-is the case with an expansive library such as `dialog.subr'). Modified: head/usr.sbin/bsdconfig/share/dialog.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Fri Mar 14 02:40:52 2014 (r263136) +++ head/usr.sbin/bsdconfig/share/dialog.subr Fri Mar 14 02:50:32 2014 (r263137) @@ -1,6 +1,6 @@ if [ ! "$_DIALOG_SUBR" ]; then _DIALOG_SUBR=1 # -# Copyright (c) 2006-2013 Devin Teske +# Copyright (c) 2006-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -469,16 +469,17 @@ f_dialog_menu_constrain() # Print debug warnings if any given (non-NULL) argument are invalid # NOTE: Don't change the name of $__{var,min,}{height,width,rows} # - local __height __width __rows + local __height_menu_constrain __width_menu_constrain + local __rows_menu_constrain local __arg __cp __fname=f_dialog_menu_constrain for __arg in height width rows; do debug= f_getvar __var_$__arg __cp [ "$__cp" ] || continue - if ! debug= f_getvar "$__cp" __$__arg; then + if ! debug= f_getvar "$__cp" __${__arg}_menu_constrain; then f_dprintf "%s: var_%s variable \`%s' not set" \ $__fname $__arg "$__cp" __retval=$FAILURE - elif ! eval f_isinteger \$__$__arg; then + elif ! eval f_isinteger \$__${__arg}_menu_constrain; then f_dprintf "%s: var_%s variable value not a number" \ $__fname $__arg __retval=$FAILURE @@ -502,9 +503,11 @@ f_dialog_menu_constrain() # Adjust height if desired if [ "$__var_height" ]; then - if [ $__height -lt ${__min_height:-0} ]; then + if [ $__height_menu_constrain -lt ${__min_height:-0} ]; then setvar "$__var_height" $__min_height - elif [ $__height -gt $__max_height_menu_constrain ]; then + elif [ $__height_menu_constrain -gt \ + $__max_height_menu_constrain ] + then setvar "$__var_height" $__max_height_menu_constrain fi fi @@ -516,9 +519,11 @@ f_dialog_menu_constrain() else : ${__min_width:=${DIALOG_MIN_WIDTH:-24}} fi - if [ $__width -lt $__min_width ]; then + if [ $__width_menu_constrain -lt $__min_width ]; then setvar "$__var_width" $__min_width - elif [ $__width -gt $__max_width_menu_constrain ]; then + elif [ $__width_menu_constrain -gt \ + $__max_width_menu_constrain ] + then setvar "$__var_width" $__max_width_menu_constrain fi fi @@ -531,16 +536,20 @@ f_dialog_menu_constrain() : ${__min_rows:=0} fi - local __max_rows=$(( $__max_height_menu_constrain - 7 )) + local __max_rows_menu_constrain=$(( + $__max_height_menu_constrain - 7 + )) # If prompt_len is zero (no prompt), bump the max-rows by 1 # Default assumption is (if no argument) that there's no prompt - [ ${__prompt_len:-0} -gt 0 ] || - __max_rows=$(( $__max_rows + 1 )) + [ ${__prompt_len:-0} -gt 0 ] || __max_rows_menu_constrain=$(( + $__max_rows_menu_constrain + 1 + )) - if [ $__rows -lt $__min_rows ]; then + if [ $__rows_menu_constrain -lt $__min_rows ]; then setvar "$__var_rows" $__min_rows - elif [ $__rows -gt $__max_rows ]; then - setvar "$__var_rows" $__max_rows + elif [ $__rows_menu_constrain -gt $__max_rows_menu_constrain ] + then + setvar "$__var_rows" $__max_rows_menu_constrain fi fi @@ -1100,19 +1109,20 @@ f_dialog_radiolist_size() # longest item-length (both used to bump the width), and the number of # rows (used to bump the height). # - local __longest_tag=0 __longest_item=0 __rows=0 + local __longest_tag=0 __longest_item=0 __rows_rlist_size=0 while [ $# -ge 3 ]; do local __tag="$1" __item="$2" shift 3 # tag/item/status [ ${#__tag} -gt $__longest_tag ] && __longest_tag=${#__tag} [ ${#__item} -gt $__longest_item ] && __longest_item=${#__item} - __rows=$(( $__rows + 1 )) + __rows_rlist_size=$(( $__rows_rlist_size + 1 )) done # Adjust rows early (for up-coming height calculation) if [ "$__var_height" -o "$__var_rows" ]; then # Add a row for visual aid if using Xdialog(1) - [ "$USE_XDIALOG" ] && __rows=$(( $__rows + 1 )) + [ "$USE_XDIALOG" ] && + __rows_rlist_size=$(( $__rows_rlist_size + 1 )) fi # Adjust height if desired @@ -1120,10 +1130,12 @@ f_dialog_radiolist_size() # Add rows to height if [ "$USE_XDIALOG" ]; then __height_rlist_size=$(( - $__height_rlist_size + $__rows + 7 )) + $__height_rlist_size + $__rows_rlist_size + 7 + )) else __height_rlist_size=$(( - $__height_rlist_size + $__rows + 4 )) + $__height_rlist_size + $__rows_rlist_size + 4 + )) fi setvar "$__var_height" $__height_rlist_size fi @@ -1140,7 +1152,7 @@ f_dialog_radiolist_size() fi # Store adjusted rows if desired - [ "$__var_rows" ] && setvar "$__var_rows" $__rows + [ "$__var_rows" ] && setvar "$__var_rows" $__rows_rlist_size # Constrain height, width, and rows to sensible minimum/maximum values # Return success if no-constrain, else return status from constrain @@ -1220,20 +1232,26 @@ f_dialog_radiolist_with_help_size() # all used to bump the width -- and the number of rows (used to bump # the height). # - local __longest_tag=0 __longest_item=0 __longest_help=0 __rows=0 + local __longest_tag=0 __longest_item=0 __longest_help=0 + local __rows_rlist_with_help_size=0 while [ $# -ge 4 ]; do local __tag="$1" __item="$2" __status="$3" __help="$4" shift 4 # tag/item/status/help [ ${#__tag} -gt $__longest_tag ] && __longest_tag=${#__tag} [ ${#__item} -gt $__longest_item ] && __longest_item=${#__item} [ ${#__help} -gt $__longest_help ] && __longest_help=${#__help} - __rows=$(( $__rows + 1 )) + __rows_rlist_with_help_size=$(( + $__rows_rlist_with_help_size + 1 + )) done # Adjust rows early (for up-coming height calculation) if [ "$__var_height" -o "$__var_rows" ]; then # Add a row for visual aid if using Xdialog(1) - [ "$USE_XDIALOG" ] && __rows=$(( $__rows + 1 )) + [ "$USE_XDIALOG" ] && + __rows_rlist_with_help_size=$(( + $__rows_rlist_with_help_size + 1 + )) fi # Adjust height if desired @@ -1241,10 +1259,14 @@ f_dialog_radiolist_with_help_size() # Add rows to height if [ "$USE_XDIALOG" ]; then __height_rlist_with_help_size=$(( - $__height_rlist_with_help_size + $__rows + 7 )) + $__height_rlist_with_help_size + + $__rows_rlist_with_help_size + 7 + )) else __height_rlist_with_help_size=$(( - $__height_rlist_with_help_size + $__rows + 4 )) + $__height_rlist_with_help_size + + $__rows_rlist_with_help_size + 4 + )) fi setvar "$__var_height" $__height fi @@ -1270,7 +1292,7 @@ f_dialog_radiolist_with_help_size() fi # Store adjusted rows if desired - [ "$__var_rows" ] && setvar "$__var_rows" $__rows + [ "$__var_rows" ] && setvar "$__var_rows" $__rows_rlist_with_help_size # Constrain height, width, and rows to sensible minimum/maximum values # Return success if no-constrain, else return status from constrain From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 02:53:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C0A1AAC; Fri, 14 Mar 2014 02:53:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7BDBA79; Fri, 14 Mar 2014 02:53:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E2rb4w034200; Fri, 14 Mar 2014 02:53:37 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E2rbUc034199; Fri, 14 Mar 2014 02:53:37 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403140253.s2E2rbUc034199@svn.freebsd.org> From: Eitan Adler Date: Fri, 14 Mar 2014 02:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263138 - in head/share: doc/papers/diskperf doc/papers/fsinterface doc/papers/kernmalloc doc/papers/kerntune doc/papers/newvm doc/papers/relengr doc/papers/sysperf doc/psd/05.sysman do... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 02:53:37 -0000 Author: eadler Date: Fri Mar 14 02:53:36 2014 New Revision: 263138 URL: http://svnweb.freebsd.org/changeset/base/263138 Log: Set nokeyword property on some files which don't already have it. This will allow my next commit. Modified: Directory Properties: head/share/doc/papers/diskperf/appendix.ms (props changed) head/share/doc/papers/diskperf/equip.ms (props changed) head/share/doc/papers/diskperf/methodology.ms (props changed) head/share/doc/papers/diskperf/results.ms (props changed) head/share/doc/papers/fsinterface/abstract.ms (props changed) head/share/doc/papers/fsinterface/slides.t (props changed) head/share/doc/papers/kernmalloc/alloc.fig (props changed) head/share/doc/papers/kernmalloc/appendix.t (props changed) head/share/doc/papers/kernmalloc/usage.tbl (props changed) head/share/doc/papers/kerntune/0.t (props changed) head/share/doc/papers/kerntune/2.t (props changed) head/share/doc/papers/kerntune/3.t (props changed) head/share/doc/papers/kerntune/4.t (props changed) head/share/doc/papers/kerntune/fig2.pic (props changed) head/share/doc/papers/newvm/0.t (props changed) head/share/doc/papers/relengr/1.t (props changed) head/share/doc/papers/relengr/2.t (props changed) head/share/doc/papers/relengr/3.t (props changed) head/share/doc/papers/sysperf/0.t (props changed) head/share/doc/papers/sysperf/1.t (props changed) head/share/doc/papers/sysperf/2.t (props changed) head/share/doc/papers/sysperf/3.t (props changed) head/share/doc/papers/sysperf/6.t (props changed) head/share/doc/papers/sysperf/7.t (props changed) head/share/doc/papers/sysperf/a1.t (props changed) head/share/doc/papers/sysperf/a2.t (props changed) head/share/doc/psd/05.sysman/0.t (props changed) head/share/doc/psd/05.sysman/1.0.t (props changed) head/share/doc/psd/05.sysman/1.3.t (props changed) head/share/doc/psd/05.sysman/1.4.t (props changed) head/share/doc/psd/05.sysman/1.5.t (props changed) head/share/doc/psd/05.sysman/1.6.t (props changed) head/share/doc/psd/05.sysman/1.7.t (props changed) head/share/doc/psd/05.sysman/2.0.t (props changed) head/share/doc/psd/05.sysman/2.1.t (props changed) head/share/doc/psd/05.sysman/2.2.t (props changed) head/share/doc/psd/05.sysman/2.4.t (props changed) head/share/doc/psd/05.sysman/2.5.t (props changed) head/share/doc/psd/05.sysman/a.t (props changed) head/share/doc/psd/18.gprof/abstract.me (props changed) head/share/doc/psd/18.gprof/gathering.me (props changed) head/share/doc/psd/18.gprof/header.me (props changed) head/share/doc/psd/18.gprof/intro.me (props changed) head/share/doc/psd/18.gprof/postp.me (props changed) head/share/doc/psd/18.gprof/postp1.pic (props changed) head/share/doc/psd/18.gprof/postp2.pic (props changed) head/share/doc/psd/18.gprof/postp3.pic (props changed) head/share/doc/psd/18.gprof/pres1.pic (props changed) head/share/doc/psd/18.gprof/pres2.pic (props changed) head/share/doc/psd/18.gprof/present.me (props changed) head/share/doc/psd/18.gprof/profiling.me (props changed) head/share/doc/psd/18.gprof/refs.me (props changed) head/share/doc/psd/20.ipctut/dgramread.c (props changed) head/share/doc/psd/20.ipctut/dgramsend.c (props changed) head/share/doc/psd/20.ipctut/pipe.c (props changed) head/share/doc/psd/20.ipctut/socketpair.c (props changed) head/share/doc/psd/20.ipctut/strchkread.c (props changed) head/share/doc/psd/20.ipctut/streamread.c (props changed) head/share/doc/psd/20.ipctut/streamwrite.c (props changed) head/share/doc/psd/20.ipctut/tutor.me (props changed) head/share/doc/psd/20.ipctut/udgramread.c (props changed) head/share/doc/psd/20.ipctut/udgramsend.c (props changed) head/share/doc/psd/20.ipctut/ustreamread.c (props changed) head/share/doc/psd/20.ipctut/ustreamwrite.c (props changed) head/share/doc/psd/21.ipc/0.t (props changed) head/share/doc/psd/21.ipc/1.t (props changed) head/share/doc/psd/21.ipc/2.t (props changed) head/share/doc/smm/01.setup/1.t (props changed) head/share/doc/smm/01.setup/6.t (props changed) head/share/doc/smm/02.config/0.t (props changed) head/share/doc/smm/02.config/1.t (props changed) head/share/doc/smm/02.config/2.t (props changed) head/share/doc/smm/02.config/3.t (props changed) head/share/doc/smm/02.config/4.t (props changed) head/share/doc/smm/02.config/5.t (props changed) head/share/doc/smm/02.config/a.t (props changed) head/share/doc/smm/02.config/b.t (props changed) head/share/doc/smm/02.config/c.t (props changed) head/share/doc/smm/02.config/d.t (props changed) head/share/doc/smm/02.config/e.t (props changed) head/share/doc/smm/04.quotas/quotas.ms (props changed) head/share/doc/smm/05.fastfs/0.t (props changed) head/share/doc/smm/05.fastfs/1.t (props changed) head/share/doc/smm/05.fastfs/2.t (props changed) head/share/doc/smm/05.fastfs/4.t (props changed) head/share/doc/smm/05.fastfs/5.t (props changed) head/share/doc/smm/05.fastfs/6.t (props changed) head/share/doc/smm/06.nfs/0.t (props changed) head/share/doc/smm/06.nfs/ref.t (props changed) head/share/doc/smm/07.lpd/0.t (props changed) head/share/doc/smm/07.lpd/1.t (props changed) head/share/doc/smm/07.lpd/2.t (props changed) head/share/doc/smm/07.lpd/3.t (props changed) head/share/doc/smm/07.lpd/4.t (props changed) head/share/doc/smm/07.lpd/5.t (props changed) head/share/doc/smm/07.lpd/6.t (props changed) head/share/doc/smm/07.lpd/7.t (props changed) head/share/doc/smm/11.timedop/timed.ms (props changed) head/share/doc/smm/12.timed/date (props changed) head/share/doc/smm/12.timed/loop (props changed) head/share/doc/smm/12.timed/time (props changed) head/share/doc/smm/12.timed/unused (props changed) head/share/doc/smm/18.net/0.t (props changed) head/share/doc/smm/18.net/1.t (props changed) head/share/doc/smm/18.net/2.t (props changed) head/share/doc/smm/18.net/3.t (props changed) head/share/doc/smm/18.net/4.t (props changed) head/share/doc/smm/18.net/5.t (props changed) head/share/doc/smm/18.net/6.t (props changed) head/share/doc/smm/18.net/8.t (props changed) head/share/doc/smm/18.net/9.t (props changed) head/share/doc/smm/18.net/a.t (props changed) head/share/doc/smm/18.net/b.t (props changed) head/share/doc/smm/18.net/c.t (props changed) head/share/doc/smm/18.net/d.t (props changed) head/share/doc/smm/18.net/e.t (props changed) head/share/doc/smm/18.net/f.t (props changed) head/share/doc/usd/07.mail/mail1.nr (props changed) head/share/doc/usd/07.mail/mail2.nr (props changed) head/share/doc/usd/07.mail/mail3.nr (props changed) head/share/doc/usd/07.mail/mail4.nr (props changed) head/share/doc/usd/07.mail/mail6.nr (props changed) head/share/doc/usd/07.mail/mail7.nr (props changed) head/share/doc/usd/07.mail/mail8.nr (props changed) head/share/doc/usd/07.mail/mail9.nr (props changed) head/share/doc/usd/07.mail/maila.nr (props changed) head/share/me/acm.me (props changed) head/share/me/chars.me (props changed) head/share/me/deltext.me (props changed) head/share/me/float.me (props changed) head/share/me/footnote.me (props changed) head/share/me/index.me (props changed) head/share/me/letterhead.me (props changed) head/share/me/local.me (props changed) head/share/me/null.me (props changed) head/share/me/refer.me (props changed) head/share/me/sh.me (props changed) head/share/me/tbl.me (props changed) head/share/me/thesis.me (props changed) From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 02:56:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6A98C3E; Fri, 14 Mar 2014 02:56:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B305D9F; Fri, 14 Mar 2014 02:56:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E2unJx034625; Fri, 14 Mar 2014 02:56:49 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E2unSu034622; Fri, 14 Mar 2014 02:56:49 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403140256.s2E2unSu034622@svn.freebsd.org> From: Devin Teske Date: Fri, 14 Mar 2014 02:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263139 - in head/usr.sbin/bsdconfig: share timezone/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 02:56:49 -0000 Author: dteske Date: Fri Mar 14 02:56:49 2014 New Revision: 263139 URL: http://svnweb.freebsd.org/changeset/base/263139 Log: Remove useless NULL string '' in compound strings. Look very closely. Modified: head/usr.sbin/bsdconfig/share/keymap.subr head/usr.sbin/bsdconfig/timezone/share/menus.subr Modified: head/usr.sbin/bsdconfig/share/keymap.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/keymap.subr Fri Mar 14 02:53:36 2014 (r263138) +++ head/usr.sbin/bsdconfig/share/keymap.subr Fri Mar 14 02:56:49 2014 (r263139) @@ -165,7 +165,7 @@ f_keymap_get_all() marks[keym] = mark name = keym gsub(/[^[:alnum:]_]/, "_", name) - gsub(/'\''/, "'\''\\'\'''\''", desc); + gsub(/'\''/, "'\''\\'\'\''", desc); printf "f_keymap_checkfile %s && " \ "f_keymap_register %s '\'%s\'' %s %u\n", keym, name, desc, keym, mark Modified: head/usr.sbin/bsdconfig/timezone/share/menus.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/menus.subr Fri Mar 14 02:53:36 2014 (r263138) +++ head/usr.sbin/bsdconfig/timezone/share/menus.subr Fri Mar 14 02:56:49 2014 (r263139) @@ -104,7 +104,7 @@ f_make_menus_awk=' function add_zone_n_to_country_menu(tlc, n) { zone_title = ENVIRON["country_" tlc "_descr_" n] - gsub(/'\''/, "'\''\\'\'''\''", zone_title) + gsub(/'\''/, "'\''\\'\'\''", zone_title) country_menu_list[tlc] = country_menu_list[tlc] \ ( length(country_menu_list[tlc]) > 0 ? "\n" : "" ) \ n " '\''" zone_title "'\''" @@ -121,7 +121,7 @@ BEGIN { { tlc = countries[cp] title = ENVIRON["country_" tlc "_name"] - gsub(/'\''/, "'\''\\'\'''\''", title) + gsub(/'\''/, "'\''\\'\'\''", title) nzones = ENVIRON["country_" tlc "_nzones"] if (!nzones) { From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 02:58:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E26D1E80; Fri, 14 Mar 2014 02:58:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CB8C7BB; Fri, 14 Mar 2014 02:58:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E2wwuO034926; Fri, 14 Mar 2014 02:58:58 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E2wmYu034872; Fri, 14 Mar 2014 02:58:48 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403140258.s2E2wmYu034872@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 14 Mar 2014 02:58:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263140 - in head: . contrib/mdocml etc etc/defaults etc/mtree etc/rc.d gnu/usr.bin/groff/tmac include lib lib/libipx release/picobsd/bridge release/picobsd/qemu rescue/rescue sbin/ifco... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 02:58:59 -0000 Author: glebius Date: Fri Mar 14 02:58:48 2014 New Revision: 263140 URL: http://svnweb.freebsd.org/changeset/base/263140 Log: Remove IPX support. IPX was a network transport protocol in Novell's NetWare network operating system from late 80s and then 90s. The NetWare itself switched to TCP/IP as default transport in 1998. Later, in this century the Novell Open Enterprise Server became successor of Novell NetWare. The last release that claimed to still support IPX was OES 2 in 2007. Routing equipment vendors (e.g. Cisco) discontinued support for IPX in 2011. Thus, IPX won't be supported in FreeBSD 11.0-RELEASE. Deleted: head/etc/rc.d/ipxrouted head/lib/libipx/ head/sbin/ifconfig/af_ipx.c head/share/man/man4/ef.4 head/sys/modules/if_ef/ head/sys/net/if_ef.c head/sys/netipx/ head/tools/build/options/WITHOUT_IPX head/tools/build/options/WITHOUT_IPX_SUPPORT head/tools/regression/netipx/ head/usr.bin/netstat/ipx.c head/usr.sbin/IPXrouted/ Modified: head/Makefile.inc1 head/ObsoleteFiles.inc head/contrib/mdocml/lib.in head/etc/defaults/rc.conf head/etc/mtree/BSD.include.dist head/etc/network.subr head/etc/nsmb.conf head/etc/rc.d/Makefile head/etc/rc.d/routing head/gnu/usr.bin/groff/tmac/fr.ISO8859-1 head/gnu/usr.bin/groff/tmac/ru.KOI8-R head/include/Makefile head/lib/Makefile head/release/picobsd/bridge/crunch.conf head/release/picobsd/qemu/crunch.conf head/rescue/rescue/Makefile head/sbin/ifconfig/Makefile head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/ifconfig.c head/sbin/route/route.8 head/share/man/man4/Makefile head/share/man/man4/netgraph.4 head/share/man/man4/ng_iface.4 head/share/man/man5/nsmb.conf.5 head/share/man/man5/rc.conf.5 head/share/man/man5/src.conf.5 head/share/man/man7/hier.7 head/share/man/man9/netisr.9 head/share/mk/bsd.libnames.mk head/share/mk/bsd.own.mk head/sys/Makefile head/sys/amd64/amd64/machdep.c head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/i386/i386/machdep.c head/sys/kern/Make.tags.inc head/sys/kern/kern_jail.c head/sys/mips/rmi/rootfs_list.txt head/sys/modules/Makefile head/sys/modules/arcnet/Makefile head/sys/modules/if_tun/Makefile head/sys/modules/netgraph/iface/Makefile head/sys/modules/smbfs/Makefile head/sys/modules/sppp/Makefile head/sys/modules/wlan/Makefile head/sys/net/if_arcsubr.c head/sys/net/if_ethersubr.c head/sys/net/if_fddisubr.c head/sys/net/if_iso88025subr.c head/sys/net/if_loop.c head/sys/net/if_spppfr.c head/sys/net/if_spppsubr.c head/sys/net/if_tun.c head/sys/net/if_types.h head/sys/net/netisr.h head/sys/net/rtsock.c head/sys/net80211/ieee80211_ioctl.c head/sys/netgraph/ng_cisco.c head/sys/netgraph/ng_iface.c head/sys/netgraph/ng_iface.h head/sys/netgraph/ng_ksocket.c head/sys/netinet/in_proto.c head/sys/netsmb/netbios.h head/sys/pc98/pc98/machdep.c head/sys/security/mac_biba/mac_biba.c head/sys/security/mac_lomac/mac_lomac.c head/sys/sys/param.h head/sys/sys/priv.h head/tools/bsdbox/Makefile head/tools/bsdbox/Makefile.net head/tools/build/mk/OptionalObsoleteFiles.inc head/tools/tools/nanobsd/gateworks/common head/usr.bin/kdump/kdump.c head/usr.bin/netstat/Makefile head/usr.bin/netstat/if.c head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.1 head/usr.bin/netstat/netstat.h head/usr.bin/netstat/route.c head/usr.sbin/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Mar 14 02:56:49 2014 (r263139) +++ head/Makefile.inc1 Fri Mar 14 02:58:48 2014 (r263140) @@ -1486,7 +1486,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_lib_atf} \ lib/libbz2 ${_libcom_err} lib/libcrypt \ lib/libelf lib/libexpat \ - ${_lib_libgssapi} ${_lib_libipx} \ + ${_lib_libgssapi} \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd lib/libnv \ ${_lib_libcapsicum} \ lib/ncurses/ncurses lib/ncurses/ncursesw \ @@ -1588,10 +1588,6 @@ kerberos5/lib/libheimsqlite__L: lib/libt _lib_libgssapi= lib/libgssapi .endif -.if ${MK_IPX} != "no" -_lib_libipx= lib/libipx -.endif - .if ${MK_KERBEROS} != "no" _kerberos5_lib= kerberos5/lib _kerberos5_lib_libasn1= kerberos5/lib/libasn1 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Mar 14 02:56:49 2014 (r263139) +++ head/ObsoleteFiles.inc Fri Mar 14 02:58:48 2014 (r263140) @@ -38,6 +38,30 @@ # xargs -n1 | sort | uniq -d; # done +# 20140314: Remove IPX/SPX +OLD_LIBS+=lib/libipx.so.5 +OLD_FILES+=usr/include/netipx/ipx.h +OLD_FILES+=usr/include/netipx/ipx_if.h +OLD_FILES+=usr/include/netipx/ipx_pcb.h +OLD_FILES+=usr/include/netipx/ipx_var.h +OLD_FILES+=usr/include/netipx/spx.h +OLD_FILES+=usr/include/netipx/spx_debug.h +OLD_FILES+=usr/include/netipx/spx_timer.h +OLD_FILES+=usr/include/netipx/spx_var.h +OLD_DIRS+=usr/include/netipx +OLD_FILES+=usr/lib/libipx.a +OLD_FILES+=usr/lib/libipx.so +OLD_FILES+=usr/lib/libipx_p.a +OLD_FILES+=usr/lib32/libipx.a +OLD_FILES+=usr/lib32/libipx.so +OLD_LIBS+=usr/lib32/libipx.so.5 +OLD_FILES+=usr/lib32/libipx_p.a +OLD_FILES+=usr/sbin/IPXrouted +OLD_FILES+=usr/share/man/man3/ipx.3.gz +OLD_FILES+=usr/share/man/man3/ipx_addr.3.gz +OLD_FILES+=usr/share/man/man3/ipx_ntoa.3.gz +OLD_FILES+=usr/share/man/man8/IPXrouted.8.gz + # 20140223: Remove libyaml OLD_FILES+=usr/lib/private/libyaml.a OLD_FILES+=usr/lib/private/libyaml.so Modified: head/contrib/mdocml/lib.in ============================================================================== --- head/contrib/mdocml/lib.in Fri Mar 14 02:56:49 2014 (r263139) +++ head/contrib/mdocml/lib.in Fri Mar 14 02:58:48 2014 (r263140) @@ -59,7 +59,6 @@ LINE("libhammer", "HAMMER Filesystem Use LINE("libi386", "i386 Architecture Library (libi386, \\-li386)") LINE("libintl", "Internationalized Message Handling Library (libintl, \\-lintl)") LINE("libipsec", "IPsec Policy Control Library (libipsec, \\-lipsec)") -LINE("libipx", "IPX Address Conversion Support Library (libipx, \\-lipx)") LINE("libiscsi", "iSCSI protocol library (libiscsi, \\-liscsi)") LINE("libisns", "Internet Storage Name Service Library (libisns, \\-lisns)") LINE("libjail", "Jail Library (libjail, \\-ljail)") Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Fri Mar 14 02:56:49 2014 (r263139) +++ head/etc/defaults/rc.conf Fri Mar 14 02:58:48 2014 (r263140) @@ -212,7 +212,6 @@ cloned_interfaces="" # List of cloned n #cloned_interfaces="gif0 gif1 gif2 gif3" # Pre-cloning GENERIC config. #ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration. #ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry. -#ifconfig_ed0_ipx="ipx 0x00010010" # Sample IPX address family entry. #ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" # Sample IPv6 addr entry #ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" # Sample IPv6 alias #ifconfig_fxp0_name="net0" # Change interface name from fxp0 to net0. @@ -382,9 +381,6 @@ mrouted_program="/usr/local/sbin/mrouted # install it from package or # port. mrouted_flags="" # Flags for multicast routing daemon. -ipxgateway_enable="NO" # Set to YES to enable IPX routing. -ipxrouted_enable="NO" # Set to YES to run the IPX routing daemon. -ipxrouted_flags="" # Flags for IPX routing daemon. arpproxy_all="NO" # replaces obsolete kernel option ARP_PROXYALL. forward_sourceroute="NO" # do source routing (only if gateway_enable is set to "YES") accept_sourceroute="NO" # accept source routed packets to us Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Fri Mar 14 02:56:49 2014 (r263139) +++ head/etc/mtree/BSD.include.dist Fri Mar 14 02:58:48 2014 (r263140) @@ -275,8 +275,6 @@ .. netipsec .. - netipx - .. netnatm api .. Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Fri Mar 14 02:56:49 2014 (r263139) +++ head/etc/network.subr Fri Mar 14 02:58:48 2014 (r263140) @@ -51,7 +51,6 @@ ifn_start() if ! noafif $ifn; then afexists inet && ipv4_up ${ifn} && cfg=0 afexists inet6 && ipv6_up ${ifn} && cfg=0 - afexists ipx && ipx_up ${ifn} && cfg=0 fi childif_create ${ifn} && cfg=0 @@ -71,7 +70,6 @@ ifn_stop() [ -z "$ifn" ] && err 1 "ifn_stop called without an interface" if ! noafif $ifn; then - afexists ipx && ipx_down ${ifn} && cfg=0 afexists inet6 && ipv6_down ${ifn} && cfg=0 afexists inet && ipv4_down ${ifn} && cfg=0 fi @@ -495,9 +493,6 @@ afexists() inet|inet6) check_kern_features ${_af} ;; - ipx) - ${SYSCTL_N} net.ipx > /dev/null 2>&1 - ;; atm) if [ -x /sbin/atmconfig ]; then /sbin/atmconfig diag list > /dev/null 2>&1 @@ -1096,7 +1091,6 @@ ifalias_af_common() case $ifconfig_args in inet\ *) _iaf=inet ;; inet6\ *) _iaf=inet6 ;; - ipx\ *) _iaf=ipx ;; link\ *) _iaf=link ;; ether\ *) _iaf=ether ;; esac @@ -1146,7 +1140,7 @@ ifalias_af_common() _tmpargs= for _c in `get_if_var $_if ifconfig_IF_aliases` $_aliasn; do case $_c in - inet|inet6|ipx|link|ether) + inet|inet6|link|ether) case $_tmpargs in ${_af}\ *) eval ifalias_af_common_handler $_if $_af $_action $_tmpargs && _ret=0 @@ -1520,55 +1514,6 @@ ng_create_one() done } -# ipx_up ifn -# Configure any IPX addresses for interface $ifn. Returns 0 if -# IPX arguments were found and configured; returns 1 otherwise. -# -ipx_up() -{ - local ifn - ifn="$1" - - # ifconfig_IF_ipx - ifconfig_args=`_ifconfig_getargs $ifn ipx` - if [ -n "${ifconfig_args}" ]; then - ${IFCONFIG_CMD} ${ifn} ${ifconfig_args} - return 0 - fi - - return 1 -} - -# ipx_down ifn -# Remove IPX addresses for interface $ifn. Returns 0 if IPX -# addresses were found and unconfigured. It returns 1, otherwise. -# -ipx_down() -{ - local _if _ifs _ret ipxList oldifs _ipx - _if=$1 - _ifs="^" - _ret=1 - ipxList="`${IFCONFIG_CMD} ${_if} | grep 'ipx ' | tr "\n" "$_ifs"`" - oldifs="$IFS" - - IFS="$_ifs" - for _ipx in $ipxList ; do - # get rid of extraneous line - [ -z "$_ipx" ] && break - - _ipx=`expr "$_ipx" : '.*\(ipx [0-9a-h]\{1,8\}H*\.[0-9a-h]\{1,12\}\).*'` - - IFS="$oldifs" - ${IFCONFIG_CMD} ${_if} ${_ipx} delete - IFS="$_ifs" - _ret=0 - done - IFS="$oldifs" - - return $_ret -} - # ifnet_rename [ifname] # Rename interfaces if ifconfig_IF_name is defined. # Modified: head/etc/nsmb.conf ============================================================================== --- head/etc/nsmb.conf Fri Mar 14 02:56:49 2014 (r263139) +++ head/etc/nsmb.conf Fri Mar 14 02:58:48 2014 (r263140) @@ -29,7 +29,7 @@ # # keyword/section A B C D Comment # -# addr - + - - IP or IPX address of SMB server +# addr - + - - IP address of SMB server # charsets + + + + local:remote charset pair # nbns + + - - address of NetBIOS name server (WINS) # nbscope + + - - NetBIOS scope Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Fri Mar 14 02:56:49 2014 (r263139) +++ head/etc/rc.d/Makefile Fri Mar 14 02:58:48 2014 (r263140) @@ -63,7 +63,6 @@ FILES= DAEMON \ ipmon \ ipnat \ ipsec \ - ${_ipxrouted} \ iscsictl \ iscsid \ jail \ @@ -165,10 +164,6 @@ FILES= DAEMON \ zfs \ zvol -.if ${MK_IPX} != "no" -_ipxrouted= ipxrouted -.endif - .if ${MK_OFED} != "no" _opensm= opensm .endif Modified: head/etc/rc.d/routing ============================================================================== --- head/etc/rc.d/routing Fri Mar 14 02:56:49 2014 (r263139) +++ head/etc/rc.d/routing Fri Mar 14 02:58:48 2014 (r263140) @@ -33,7 +33,7 @@ routing_start() esac case $_af in - inet|inet6|ipx|atm) + inet|inet6|atm) if afexists $_af; then setroutes $_cmd $_af $_if else @@ -41,7 +41,7 @@ routing_start() fi ;; ""|[Aa][Ll][Ll]|[Aa][Nn][Yy]) - for _a in inet inet6 ipx atm; do + for _a in inet inet6 atm; do afexists $_a && setroutes $_cmd $_a $_if done ;; @@ -62,7 +62,7 @@ routing_stop() esac case $_af in - inet|inet6|ipx|atm) + inet|inet6|atm) if afexists $_af; then eval static_${_af} delete $_if # When $_if is specified, do not flush routes. @@ -74,7 +74,7 @@ routing_stop() fi ;; ""|[Aa][Ll][Ll]|[Aa][Nn][Yy]) - for _a in inet inet6 ipx atm; do + for _a in inet inet6 atm; do afexists $_a || continue eval static_${_a} delete $_if # When $_if is specified, do not flush routes. @@ -127,11 +127,6 @@ routing_stop_atm() return 0 } -routing_stop_ipx() -{ - return 0 -} - static_inet() { local _action _if _skip @@ -290,11 +285,6 @@ static_atm() fi } -static_ipx() -{ - : -} - ropts_init() { if [ -z "${_ropts_initdone}" ]; then @@ -387,20 +377,5 @@ options_atm() [ -n "${_ropts_initdone}" ] && echo '.' } -options_ipx() -{ - _ropts_initdone= - - if checkyesno ipxgateway_enable; then - ropts_init ipx - echo -n ' gateway=YES' - ${SYSCTL} net.ipx.ipx.ipxforwarding=1 > /dev/null - else - ${SYSCTL} net.ipx.ipx.ipxforwarding=0 > /dev/null - fi - - [ -n "${_ropts_initdone}" ] && echo '.' -} - load_rc_config $name run_rc_command "$@" Modified: head/gnu/usr.bin/groff/tmac/fr.ISO8859-1 ============================================================================== --- head/gnu/usr.bin/groff/tmac/fr.ISO8859-1 Fri Mar 14 02:56:49 2014 (r263139) +++ head/gnu/usr.bin/groff/tmac/fr.ISO8859-1 Fri Mar 14 02:58:48 2014 (r263140) @@ -86,7 +86,6 @@ .\" XXX ds doc-str-Lb-libgeom Userland API Library for kernel GEOM subsystem (libgeom, \-lgeom) .ds doc-str-Lb-libi386 Bibliothèque de l'architecture i386 (libi386, \-li386) .ds doc-str-Lb-libipsec Bibliothèque de contrôle de politique IPsec (libipsec, \-lipsec) -.ds doc-str-Lb-libipx Bibliothèque de support des conversions des adresses IPX (libipx, \-lipx) .ds doc-str-Lb-libkvm Bibliothèque d'accès aux données du noyau (libkvm, \-lkvm) .ds doc-str-Lb-libm Bibliothèque mathématique (libm, \-lm) .ds doc-str-Lb-libmd Bibliothèque de support des signatures (MD4, MD5, etc.) (libmd, \-lmd) Modified: head/gnu/usr.bin/groff/tmac/ru.KOI8-R ============================================================================== --- head/gnu/usr.bin/groff/tmac/ru.KOI8-R Fri Mar 14 02:56:49 2014 (r263139) +++ head/gnu/usr.bin/groff/tmac/ru.KOI8-R Fri Mar 14 02:58:48 2014 (r263140) @@ -86,7 +86,6 @@ .ds doc-str-Lb-libgeom ðÏÌØÚÏ×ÁÔÅÌØÓËÁÑ API ÂÉÂÌÉÏÔÅËÁ ÐÏÄÓÉÓÔÅÍÙ ÑÄÒÁ GEOM (libgeom, \-lgeom) .ds doc-str-Lb-libi386 âÉÂÌÉÏÔÅËÁ ÁÒÈÉÔÅËÔÕÒÙ i386 (libi386, \-li386) .ds doc-str-Lb-libipsec âÉÂÌÉÏÔÅËÁ ÕÐÒÁ×ÌÅÎÉÑ IPsec Policy (libipsec, \-lipsec) -.ds doc-str-Lb-libipx âÉÂÌÉÏÔÅËÁ ÐÏÄÄÅÒÖËÉ ËÏÎ×ÅÒÓÉÉ ÁÄÒÅÓÏ× IPX (libipx, \-lipx) .ds doc-str-Lb-libkvm âÉÂÌÉÏÔÅËÁ ÄÏÓÔÕÐÁ Ë ÄÁÎÎÙÍ ÑÄÒÁ (libkvm, \-lkvm) .ds doc-str-Lb-libm âÉÂÌÉÏÔÅËÁ ÍÁÔÅÍÁÔÉÞÅÓËÉÈ ÆÕÎËÃÉÊ (libm, \-lm) .\" XXX ds doc-str-Lb-libmd Message Digest (MD4, MD5, É Ô.Ä.) Support Library (libmd, \-lmd) Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Fri Mar 14 02:56:49 2014 (r263139) +++ head/include/Makefile Fri Mar 14 02:58:48 2014 (r263140) @@ -37,9 +37,7 @@ LHDRS= aio.h errno.h fcntl.h linker_set. syslog.h ucontext.h LDIRS= bsm cam geom net net80211 netatalk netgraph netinet netinet6 \ - netipsec ${_netipx} netnatm netsmb \ - nfs nfsclient nfsserver \ - sys vm + netipsec netnatm netsmb nfs nfsclient nfsserver sys vm LSUBDIRS= cam/ata cam/scsi \ dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon dev/firewire \ @@ -76,11 +74,6 @@ INCS+= hesiod.h LSUBSUBDIRS+= netgraph/bluetooth/include .endif -# XXX unconditionally needed by -#.if ${MK_IPX} != "no" -_netipx= netipx -#.endif - # Handle the #define aliases for libiconv .if ${MK_ICONV} == "yes" INCS+= iconv.h Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Fri Mar 14 02:56:49 2014 (r263139) +++ head/lib/Makefile Fri Mar 14 02:58:48 2014 (r263140) @@ -88,7 +88,6 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libgssapi} \ ${_librpcsec_gss} \ libipsec \ - ${_libipx} \ libjail \ libkiconv \ liblzma \ @@ -183,10 +182,6 @@ _librpcsec_gss= librpcsec_gss _libiconv_modules= libiconv_modules .endif -.if ${MK_IPX} != "no" -_libipx= libipx -.endif - .if ${MK_LDNS} != "no" _libldns= libldns .endif Modified: head/release/picobsd/bridge/crunch.conf ============================================================================== --- head/release/picobsd/bridge/crunch.conf Fri Mar 14 02:56:49 2014 (r263139) +++ head/release/picobsd/bridge/crunch.conf Fri Mar 14 02:58:48 2014 (r263140) @@ -31,7 +31,6 @@ buildopts -DWITHOUT_PAM -DRELEASE_CRUNCH -DPPP_NO_NETGRAPH buildopts -DTRACEROUTE_NO_IPSEC -DNO_INET6 -buildopts -DWITHOUT_IPX # Directories where to look for sources of various binaries. # @__CWD__@ is a magic keyword in the picobsd's (Makefile.conf) Modified: head/release/picobsd/qemu/crunch.conf ============================================================================== --- head/release/picobsd/qemu/crunch.conf Fri Mar 14 02:56:49 2014 (r263139) +++ head/release/picobsd/qemu/crunch.conf Fri Mar 14 02:58:48 2014 (r263140) @@ -31,7 +31,6 @@ buildopts -DWITHOUT_PAM -DRELEASE_CRUNCH -DPPP_NO_NETGRAPH buildopts -DTRACEROUTE_NO_IPSEC -DNO_INET6 -buildopts -DWITHOUT_IPX # Directories where to look for sources of various binaries. # @__CWD__@ is a magic keyword in the picobsd's (Makefile.conf) Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Fri Mar 14 02:56:49 2014 (r263139) +++ head/rescue/rescue/Makefile Fri Mar 14 02:58:48 2014 (r263140) @@ -119,9 +119,6 @@ CRUNCH_PROGS_sbin+= zpool # CRUNCH_PROGS+= devd CRUNCH_LIBS+= -lalias -lcam -lcurses -ldevstat -lipsec -.if ${MK_IPX} != "no" -CRUNCH_LIBS+= -lipx -.endif .if ${MK_ZFS} != "no" CRUNCH_LIBS+= -lavl -ljail -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem .endif Modified: head/sbin/ifconfig/Makefile ============================================================================== --- head/sbin/ifconfig/Makefile Fri Mar 14 02:56:49 2014 (r263139) +++ head/sbin/ifconfig/Makefile Fri Mar 14 02:58:48 2014 (r263140) @@ -53,11 +53,6 @@ CFLAGS+= -DINET6 .if ${MK_INET_SUPPORT} != "no" CFLAGS+= -DINET .endif -.if ${MK_IPX_SUPPORT} != "no" && !defined(RELEASE_CRUNCH) -SRCS+= af_ipx.c # IPX support -DPADD+= ${LIBIPX} -LDADD+= -lipx -.endif .if ${MK_JAIL} != "no" && !defined(RELEASE_CRUNCH) && !defined(RESCUE) CFLAGS+= -DJAIL DPADD+= ${LIBJAIL} Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Fri Mar 14 02:56:49 2014 (r263139) +++ head/sbin/ifconfig/ifconfig.8 Fri Mar 14 02:58:48 2014 (r263140) @@ -159,12 +159,8 @@ supported are .Dq inet , .Dq inet6 , .Dq atalk , -.Dq ipx , -.\" .Dq iso , and .Dq link . -.\" and -.\" .Dq ns . The default if available is .Dq inet or otherwise @@ -309,12 +305,6 @@ using the kernel configuration option, or the .Va net.fibs tunable. -.It Cm ipdst -This is used to specify an Internet host who is willing to receive -IP packets encapsulating IPX packets bound for a remote network. -An apparent point to point link is constructed, and -the address specified will be taken as the IPX address and network -of the destination. .It Cm maclabel Ar label If Mandatory Access Control support is enabled in the kernel, set the MAC label to Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Fri Mar 14 02:56:49 2014 (r263139) +++ head/sbin/ifconfig/ifconfig.c Fri Mar 14 02:58:48 2014 (r263140) @@ -741,20 +741,6 @@ setifbroadaddr(const char *addr, int dum } static void -setifipdst(const char *addr, int dummy __unused, int s, - const struct afswtch *afp) -{ - const struct afswtch *inet; - - inet = af_getbyname("inet"); - if (inet == NULL) - return; - inet->af_getaddr(addr, DSTADDR); - clearaddr = 0; - newaddr = 0; -} - -static void notealias(const char *addr, int param, int s, const struct afswtch *afp) { #define rqtosa(x) (&(((struct ifreq *)(afp->x))->ifr_addr)) @@ -1176,7 +1162,6 @@ static struct cmd basic_cmds[] = { DEF_CMD_ARG("netmask", setifnetmask), DEF_CMD_ARG("metric", setifmetric), DEF_CMD_ARG("broadcast", setifbroadaddr), - DEF_CMD_ARG("ipdst", setifipdst), DEF_CMD_ARG2("tunnel", settunnel), DEF_CMD("-tunnel", 0, deletetunnel), DEF_CMD("deletetunnel", 0, deletetunnel), Modified: head/sbin/route/route.8 ============================================================================== --- head/sbin/route/route.8 Fri Mar 14 02:56:49 2014 (r263139) +++ head/sbin/route/route.8 Fri Mar 14 02:58:48 2014 (r263140) @@ -487,7 +487,6 @@ The next-hop gateway should be reachable .Xr netintro 4 , .Xr route 4 , .Xr arp 8 , -.Xr IPXrouted 8 , .Xr routed 8 .\".Xr XNSrouted 8 .Sh HISTORY Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Mar 14 02:56:49 2014 (r263139) +++ head/share/man/man4/Makefile Fri Mar 14 02:58:48 2014 (r263140) @@ -122,7 +122,6 @@ MAN= aac.4 \ dummynet.4 \ ed.4 \ edsc.4 \ - ef.4 \ ehci.4 \ em.4 \ en.4 \ Modified: head/share/man/man4/netgraph.4 ============================================================================== --- head/share/man/man4/netgraph.4 Fri Mar 14 02:56:49 2014 (r263139) +++ head/share/man/man4/netgraph.4 Fri Mar 14 02:58:48 2014 (r263140) @@ -1270,7 +1270,7 @@ sending frames out of the interface. .It INTERFACE This node is also a system networking interface. It has hooks representing -each protocol family (IP, AppleTalk, IPX, etc.) and appears in the output of +each protocol family (IP, AppleTalk, etc.) and appears in the output of .Xr ifconfig 8 . The interfaces are named .Dq Li ng0 , Modified: head/share/man/man4/ng_iface.4 ============================================================================== --- head/share/man/man4/ng_iface.4 Fri Mar 14 02:56:49 2014 (r263139) +++ head/share/man/man4/ng_iface.4 Fri Mar 14 02:58:48 2014 (r263140) @@ -70,7 +70,7 @@ Packets transmitted via the interface fl protocol-specific hook. Similarly, packets received on a hook appear on the interface as packets received into the corresponding protocol stack. -The currently supported protocols are IP, IPv6, AppleTalk, IPX, ATM, +The currently supported protocols are IP, IPv6, AppleTalk, ATM, NATM, and NS. .Pp An @@ -90,8 +90,6 @@ Transmission and reception of IP packets Transmission and reception of IPv6 packets. .It Va atalk Transmission and reception of AppleTalk packets. -.It Va ipx -Transmission and reception of IPX packets. .It Va atm Transmission and reception of ATM packets. .It Va natm Modified: head/share/man/man5/nsmb.conf.5 ============================================================================== --- head/share/man/man5/nsmb.conf.5 Fri Mar 14 02:56:49 2014 (r263139) +++ head/share/man/man5/nsmb.conf.5 Fri Mar 14 02:58:48 2014 (r263140) @@ -82,7 +82,7 @@ Possible keywords may include: .Bl -column ".Va retry_count" ".Sy Section" .It Sy "Keyword Section Comment" .It Sy " A B C D" -.It Va addr Ta "- + - -" Ta "IP or IPX address of SMB server" +.It Va addr Ta "- + - -" Ta "IP address of SMB server" .It Va charsets Ta "- + + +" Ta "local:remote charset pair" .It Va nbns Ta "+ + - -" Ta "address of NetBIOS name server (WINS)" .It Va nbscope Ta "+ + - -" Ta "NetBIOS scope" @@ -141,13 +141,6 @@ used on a password: .Bd -literal -offset indent smbutil crypt .Ed -.Sh COMPATIBILITY -At the time of this writing, the -.Tn IPX -protocol remains unsupported. -Future -.Fx -releases are expected to support this. .Sh SEE ALSO .Xr smbutil 1 , .Xr mount_smbfs 8 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Fri Mar 14 02:56:49 2014 (r263139) +++ head/share/man/man5/rc.conf.5 Fri Mar 14 02:58:48 2014 (r263140) @@ -2845,27 +2845,6 @@ If is set to .Dq Li YES this is the list of interfaces to use. -.It Va ipxgateway_enable -.Pq Vt bool -If set to -.Dq Li YES , -enable the routing of IPX traffic. -.It Va ipxrouted_enable -.Pq Vt bool -If set to -.Dq Li YES , -run the -.Xr IPXrouted 8 -daemon at system boot time. -.It Va ipxrouted_flags -.Pq Vt str -If -.Va ipxrouted_enable -is set to -.Dq Li YES , -these are the flags to pass to the -.Xr IPXrouted 8 -daemon. .It Va arpproxy_all .Pq Vt bool If set to Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri Mar 14 02:56:49 2014 (r263139) +++ head/share/man/man5/src.conf.5 Fri Mar 14 02:58:48 2014 (r263140) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd February 22, 2014 +.Dd March 5, 2014 .Dt SRC.CONF 5 .Os .Sh NAME @@ -448,10 +448,6 @@ Set to not build GPIB bus support. Set to not build .Xr gpioctl 8 as part of the base system. -.It Va WITH_GPL_DTC -.\" from FreeBSD: head/tools/build/options/WITH_GPL_DTC 246262 2013-02-02 22:42:46Z dim -Set to build the GPL'd version of the device tree compiler from elinux.org, -instead of the BSD licensed one. .It Va WITHOUT_GROFF .\" from FreeBSD: head/tools/build/options/WITHOUT_GROFF 218941 2011-02-22 08:13:49Z uqs Set to not build @@ -524,18 +520,6 @@ Set to not build IP Filter package. .It Va WITHOUT_IPFW .\" from FreeBSD: head/tools/build/options/WITHOUT_IPFW 183242 2008-09-21 22:02:26Z sam Set to not build IPFW tools. -.It Va WITHOUT_IPX -.\" from FreeBSD: head/tools/build/options/WITHOUT_IPX 156932 2006-03-21 07:50:50Z ru -Set to not build programs and libraries related to IPX networking. -When set, it also enforces the following options: -.Pp -.Bl -item -compact -.It -.Va WITHOUT_IPX_SUPPORT -.El -.It Va WITHOUT_IPX_SUPPORT -.\" from FreeBSD: head/tools/build/options/WITHOUT_IPX_SUPPORT 156932 2006-03-21 07:50:50Z ru -Set to build some programs without IPX support. .It Va WITHOUT_JAIL .\" from FreeBSD: head/tools/build/options/WITHOUT_JAIL 249966 2013-04-27 04:09:09Z eadler Set to not build tools for the support of jails; e.g., Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Fri Mar 14 02:56:49 2014 (r263139) +++ head/share/man/man7/hier.7 Fri Mar 14 02:58:48 2014 (r263140) @@ -297,8 +297,6 @@ see kernel key-management service; see .Xr ipsec 4 -.It Pa netipx/ -IPX/SPX protocol stacks .It Pa netnatm/ NATM include files; see Modified: head/share/man/man9/netisr.9 ============================================================================== --- head/share/man/man9/netisr.9 Fri Mar 14 02:56:49 2014 (r263139) +++ head/share/man/man9/netisr.9 Fri Mar 14 02:58:48 2014 (r263140) @@ -204,8 +204,6 @@ Appletalk phase 1 Appletalk phase 2 .It Dv NETISR_ARP ARP -.It Dv NETISR_IPX -IPX/SPX .It Dv NETISR_IPV6 IPv6 .It Dv NETISR_NATM Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Fri Mar 14 02:56:49 2014 (r263139) +++ head/share/mk/bsd.libnames.mk Fri Mar 14 02:58:48 2014 (r263140) @@ -67,9 +67,6 @@ LIBHEIMNTLM?= ${DESTDIR}${LIBDIR}/libhei LIBHEIMSQLITE?= ${DESTDIR}${LIBDIR}/libheimsqlite.a LIBHX509?= ${DESTDIR}${LIBDIR}/libhx509.a LIBIPSEC?= ${DESTDIR}${LIBDIR}/libipsec.a -.if ${MK_IPX} != "no" -LIBIPX?= ${DESTDIR}${LIBDIR}/libipx.a -.endif LIBJAIL?= ${DESTDIR}${LIBDIR}/libjail.a LIBKADM5CLNT?= ${DESTDIR}${LIBDIR}/libkadm5clnt.a LIBKADM5SRV?= ${DESTDIR}${LIBDIR}/libkadm5srv.a Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Fri Mar 14 02:56:49 2014 (r263139) +++ head/share/mk/bsd.own.mk Fri Mar 14 02:58:48 2014 (r263140) @@ -297,7 +297,6 @@ __DEFAULT_YES_OPTIONS = \ INSTALLLIB \ IPFILTER \ IPFW \ - IPX \ JAIL \ KDUMP \ KERBEROS \ @@ -572,7 +571,6 @@ MK_TESTS:= no GNU \ INET \ INET6 \ - IPX \ KERBEROS \ KVM \ NETGRAPH \ Modified: head/sys/Makefile ============================================================================== --- head/sys/Makefile Fri Mar 14 02:56:49 2014 (r263139) +++ head/sys/Makefile Fri Mar 14 02:58:48 2014 (r263140) @@ -10,7 +10,7 @@ SUBDIR= boot # Directories to include in cscope name file and TAGS. CSCOPEDIRS= boot bsm cam cddl compat conf contrib crypto ddb dev fs gdb \ geom gnu isa kern libkern modules net net80211 netatalk \ - netgraph netinet netinet6 netipsec netipx netnatm netpfil \ + netgraph netinet netinet6 netipsec netnatm netpfil \ netsmb nfs nfsclient nfsserver nlm ofed opencrypto \ pci rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR} .if !defined(CSCOPE_ARCHDIR) Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Fri Mar 14 02:56:49 2014 (r263139) +++ head/sys/amd64/amd64/machdep.c Fri Mar 14 02:58:48 2014 (r263140) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include "opt_cpu.h" #include "opt_ddb.h" #include "opt_inet.h" -#include "opt_ipx.h" #include "opt_isa.h" #include "opt_kstack_pages.h" #include "opt_maxmem.h" Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Mar 14 02:56:49 2014 (r263139) +++ head/sys/conf/NOTES Fri Mar 14 02:58:48 2014 (r263140) @@ -606,8 +606,6 @@ options IPSEC #IP security (requires # options IPSEC_NAT_T #NAT-T support, UDP encap of ESP -options IPX #IPX/SPX communications protocols - options NETATALK #Appletalk communications protocols options NETATALKDEBUG #Appletalk debugging @@ -886,14 +884,6 @@ options XBONEHACK device faith device stf -# The `ef' device provides support for multiple ethernet frame types -# specified via ETHER_* options. See ef(4) for details. -device ef -options ETHER_II # enable Ethernet_II frame -options ETHER_8023 # enable Ethernet_802.3 (Novell) frame -options ETHER_8022 # enable Ethernet_802.2 frame -options ETHER_SNAP # enable Ethernet_802.2/SNAP frame - # The pf packet filter consists of three devices: # The `pf' device provides /dev/pf and the firewall code itself. # The `pflog' device provides the pflog0 interface which logs packets. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Mar 14 02:56:49 2014 (r263139) +++ head/sys/conf/files Fri Mar 14 02:58:48 2014 (r263140) @@ -3087,7 +3087,6 @@ net/if_dead.c standard net/if_debug.c optional ddb net/if_disc.c optional disc net/if_edsc.c optional edsc -net/if_ef.c optional ef net/if_enc.c optional enc ipsec inet | enc ipsec inet6 net/if_epair.c optional epair net/if_ethersubr.c optional ether @@ -3365,16 +3364,6 @@ netipsec/xform_ipcomp.c optional ipsec netipsec/xform_ipip.c optional ipsec inet | ipsec inet6 netipsec/xform_tcp.c optional ipsec inet tcp_signature | \ ipsec inet6 tcp_signature -netipx/ipx.c optional ipx -netipx/ipx_cksum.c optional ipx -netipx/ipx_input.c optional ipx -netipx/ipx_outputfl.c optional ipx -netipx/ipx_pcb.c optional ipx -netipx/ipx_proto.c optional ipx -netipx/ipx_usrreq.c optional ipx -netipx/spx_debug.c optional ipx -netipx/spx_reass.c optional ipx -netipx/spx_usrreq.c optional ipx netnatm/natm.c optional natm netnatm/natm_pcb.c optional natm netnatm/natm_proto.c optional natm Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Mar 14 02:56:49 2014 (r263139) +++ head/sys/conf/options Fri Mar 14 02:58:48 2014 (r263140) @@ -398,10 +398,6 @@ DEV_PFLOG opt_pf.h DEV_PFSYNC opt_pf.h DEV_VLAN opt_vlan.h DUMMYNET opt_ipdn.h -ETHER_8022 opt_ef.h -ETHER_8023 opt_ef.h -ETHER_II opt_ef.h -ETHER_SNAP opt_ef.h INET opt_inet.h INET6 opt_inet6.h IPDIVERT @@ -419,7 +415,6 @@ IPSEC_DEBUG opt_ipsec.h IPSEC_FILTERTUNNEL opt_ipsec.h IPSEC_NAT_T opt_ipsec.h IPSTEALTH -IPX KRPC LIBALIAS LIBMBPOOL Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Fri Mar 14 02:56:49 2014 (r263139) +++ head/sys/i386/i386/machdep.c Fri Mar 14 02:58:48 2014 (r263140) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include "opt_cpu.h" #include "opt_ddb.h" #include "opt_inet.h" -#include "opt_ipx.h" #include "opt_isa.h" #include "opt_kstack_pages.h" #include "opt_maxmem.h" Modified: head/sys/kern/Make.tags.inc ============================================================================== --- head/sys/kern/Make.tags.inc Fri Mar 14 02:56:49 2014 (r263139) +++ head/sys/kern/Make.tags.inc Fri Mar 14 02:58:48 2014 (r263140) @@ -40,7 +40,6 @@ COMM= ${SYS}/dev/advansys/*.[ch] \ ${SYS}/netinet/*.[ch] \ ${SYS}/netinet6/*.[ch] \ ${SYS}/netipsec/*.[ch] \ - ${SYS}/netipx/*.[ch] \ ${SYS}/netnatm/*.[ch] \ ${SYS}/nfs/*.[ch] \ ${SYS}/nfsclient/*.[ch] \ @@ -59,7 +58,6 @@ COMMDIR1= ${SYS}/conf \ ${SYS}/netinet \ ${SYS}/netinet6 \ ${SYS}/netipsec \ - ${SYS}/netipx \ ${SYS}/netnatm \ ${SYS}/nfs \ ${SYS}/pci \ Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Fri Mar 14 02:56:49 2014 (r263139) +++ head/sys/kern/kern_jail.c Fri Mar 14 02:58:48 2014 (r263140) @@ -3744,12 +3744,6 @@ prison_priv_check(struct ucred *cred, in #ifdef notyet /* - * IPX/SPX privileges. - */ - case PRIV_NETIPX_RESERVEDPORT: - case PRIV_NETIPX_RAW: - - /* * NCP privileges. */ case PRIV_NETNCP: Modified: head/sys/mips/rmi/rootfs_list.txt ============================================================================== --- head/sys/mips/rmi/rootfs_list.txt Fri Mar 14 02:56:49 2014 (r263139) +++ head/sys/mips/rmi/rootfs_list.txt Fri Mar 14 02:58:48 2014 (r263140) @@ -222,7 +222,6 @@ ./etc/rc.d/ipmon ./etc/rc.d/ipnat ./etc/rc.d/ipsec -./etc/rc.d/ipxrouted ./etc/rc.d/jail ./etc/rc.d/kadmind ./etc/rc.d/kerberos @@ -437,7 +436,6 @@ ./lib/libbsdxml.so.4 ./lib/libgeom.so.5 ./lib/libipsec.so.4 -./lib/libipx.so.5 ./lib/libjail.so.1 ./lib/libkiconv.so.4 ./lib/libpcap.so.7 Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Mar 14 02:56:49 2014 (r263139) +++ head/sys/modules/Makefile Fri Mar 14 02:58:48 2014 (r263140) @@ -136,7 +136,6 @@ SUBDIR= \ if_bridge \ if_disc \ if_edsc \ - if_ef \ if_epair \ if_faith \ if_gif \ Modified: head/sys/modules/arcnet/Makefile ============================================================================== --- head/sys/modules/arcnet/Makefile Fri Mar 14 02:56:49 2014 (r263139) +++ head/sys/modules/arcnet/Makefile Fri Mar 14 02:58:48 2014 (r263140) @@ -4,7 +4,7 @@ KMOD= arcnet SRCS= if_arcsubr.c -SRCS+= opt_inet.h opt_inet6.h opt_ipx.h opt_ofed.h +SRCS+= opt_inet.h opt_inet6.h opt_ofed.h EXPORT_SYMS= arc_frag_init \ arc_frag_next \ @@ -22,9 +22,6 @@ opt_inet.h: opt_inet6.h: echo "#define INET6 1" > ${.TARGET} - -opt_ipx.h: - echo "#define IPX 1" > ${.TARGET} .endif .include Modified: head/sys/modules/if_tun/Makefile ============================================================================== --- head/sys/modules/if_tun/Makefile Fri Mar 14 02:56:49 2014 (r263139) +++ head/sys/modules/if_tun/Makefile Fri Mar 14 02:58:48 2014 (r263140) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../net KMOD= if_tun -SRCS= if_tun.c opt_atalk.h opt_inet.h opt_inet6.h opt_ipx.h +SRCS= if_tun.c opt_atalk.h opt_inet.h opt_inet6.h .if !defined(KERNBUILDDIR) opt_atalk.h: @@ -14,9 +14,6 @@ opt_inet.h: opt_inet6.h: echo "#define INET6 1" > ${.TARGET} - -opt_ipx.h: - echo "#define IPX 1" > ${.TARGET} .endif .include Modified: head/sys/modules/netgraph/iface/Makefile ============================================================================== --- head/sys/modules/netgraph/iface/Makefile Fri Mar 14 02:56:49 2014 (r263139) +++ head/sys/modules/netgraph/iface/Makefile Fri Mar 14 02:58:48 2014 (r263140) @@ -2,7 +2,7 @@ # $Whistle: Makefile,v 1.2 1999/01/19 19:39:21 archie Exp $ KMOD= ng_iface -SRCS= ng_iface.c opt_atalk.h opt_inet.h opt_inet6.h opt_ipx.h +SRCS= ng_iface.c opt_atalk.h opt_inet.h opt_inet6.h .if !defined(KERNBUILDDIR) opt_atalk.h: @@ -13,9 +13,6 @@ opt_inet.h: opt_inet6.h: echo "#define INET6 1" > ${.TARGET} - -opt_ipx.h: - echo "#define IPX 1" > ${.TARGET} .endif .include Modified: head/sys/modules/smbfs/Makefile ============================================================================== --- head/sys/modules/smbfs/Makefile Fri Mar 14 02:56:49 2014 (r263139) +++ head/sys/modules/smbfs/Makefile Fri Mar 14 02:58:48 2014 (r263140) @@ -10,8 +10,7 @@ KMOD= smbfs SRCS= vnode_if.h \ - opt_inet.h opt_ipx.h \ - opt_netsmb.h \ + opt_inet.h opt_netsmb.h \ iconv_converter_if.h \ md4c.c \ smb_conn.c smb_dev.c smb_trantcp.c smb_smb.c smb_subr.c smb_rq.c \ @@ -27,9 +26,6 @@ SRCS+= des_enc.S SRCS+= des_enc.c .endif -# Build with IPX support (1|0) -SMB_IPX?= 0 - # Build with INET support (1|0) SMB_INET?= 1 @@ -44,11 +40,6 @@ CFLAGS+= -DVNPRINT opt_inet.h: echo "#define INET 1" > ${.TARGET} .endif - -.if ${SMB_IPX} > 0 -opt_ipx.h: - echo "#define IPX 1" > ${.TARGET} -.endif .endif .include Modified: head/sys/modules/sppp/Makefile ============================================================================== --- head/sys/modules/sppp/Makefile Fri Mar 14 02:56:49 2014 (r263139) +++ head/sys/modules/sppp/Makefile Fri Mar 14 02:58:48 2014 (r263140) @@ -4,7 +4,7 @@ KMOD= sppp SRCS= if_spppfr.c if_spppsubr.c slcompress.c -SRCS+= opt_inet.h opt_inet6.h opt_ipx.h +SRCS+= opt_inet.h opt_inet6.h EXPORT_SYMS= sppp_attach \ sppp_detach \ @@ -21,9 +21,6 @@ opt_inet.h: opt_inet6.h: echo "#define INET6 1" > ${.TARGET} - -opt_ipx.h: - echo "#define IPX 1" > ${.TARGET} .endif .include Modified: head/sys/modules/wlan/Makefile ============================================================================== --- head/sys/modules/wlan/Makefile Fri Mar 14 02:56:49 2014 (r263139) +++ head/sys/modules/wlan/Makefile Fri Mar 14 02:58:48 2014 (r263140) @@ -13,7 +13,7 @@ SRCS= ieee80211.c ieee80211_action.c iee ieee80211_ht.c ieee80211_hwmp.c ieee80211_adhoc.c ieee80211_hostap.c \ ieee80211_monitor.c ieee80211_sta.c ieee80211_wds.c ieee80211_ddb.c \ ieee80211_tdma.c ieee80211_superg.c -SRCS+= bus_if.h device_if.h opt_ddb.h opt_inet.h opt_inet6.h opt_ipx.h \ +SRCS+= bus_if.h device_if.h opt_ddb.h opt_inet.h opt_inet6.h \ opt_tdma.h opt_wlan.h .if !defined(KERNBUILDDIR) @@ -23,8 +23,6 @@ opt_wlan.h: echo "#define IEEE80211_SUPPORT_MESH 1" >> ${.TARGET} opt_inet.h: echo "#define INET 1" > ${.TARGET} -opt_ipx.h: - echo "#define IPX 1" > ${.TARGET} # override to get ddb support? opt_ddb.h: :> ${.TARGET} Modified: head/sys/net/if_arcsubr.c ============================================================================== --- head/sys/net/if_arcsubr.c Fri Mar 14 02:56:49 2014 (r263139) +++ head/sys/net/if_arcsubr.c Fri Mar 14 02:58:48 2014 (r263140) @@ -40,7 +40,6 @@ */ #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_ipx.h" #include #include @@ -77,11 +76,6 @@ #include #endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 03:00:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E556FDC; Fri, 14 Mar 2014 03:00:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F0351D5; Fri, 14 Mar 2014 03:00:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E3026S035252; Fri, 14 Mar 2014 03:00:02 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E30204035251; Fri, 14 Mar 2014 03:00:02 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403140300.s2E30204035251@svn.freebsd.org> From: Devin Teske Date: Fri, 14 Mar 2014 03:00:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263141 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 03:00:03 -0000 Author: dteske Date: Fri Mar 14 03:00:02 2014 New Revision: 263141 URL: http://svnweb.freebsd.org/changeset/base/263141 Log: Point hat! Fix a broken f_isinteger(). Modified: head/usr.sbin/bsdconfig/share/strings.subr Modified: head/usr.sbin/bsdconfig/share/strings.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/strings.subr Fri Mar 14 02:58:48 2014 (r263140) +++ head/usr.sbin/bsdconfig/share/strings.subr Fri Mar 14 03:00:02 2014 (r263141) @@ -195,7 +195,7 @@ f_number_of_lines() f_isinteger() { local arg="${1#-}" - [ "${arg:-x}" = "${arg#[!0-9]*}" ] + [ "${arg:-x}" = "${arg%[!0-9]*}" ] } # f_uriencode [$text] From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 03:08:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 393083CC; Fri, 14 Mar 2014 03:08:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1F089279; Fri, 14 Mar 2014 03:08:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E386m0039925; Fri, 14 Mar 2014 03:08:06 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E37q5R039829; Fri, 14 Mar 2014 03:07:52 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403140307.s2E37q5R039829@svn.freebsd.org> From: Eitan Adler Date: Fri, 14 Mar 2014 03:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263142 - in head: lib/libpam/modules/pam_radius lib/libpam/modules/pam_tacplus sbin/mdconfig secure/usr.bin/bdes share/doc/papers/beyond4.3 share/doc/papers/diskperf share/doc/papers/f... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 03:08:06 -0000 Author: eadler Date: Fri Mar 14 03:07:51 2014 New Revision: 263142 URL: http://svnweb.freebsd.org/changeset/base/263142 Log: multiple: Remove 3rd clause from BSD license where approved by the regents and renumber. This patch skips files in contrib/ and crypto/ Acked by: imp Discussed with: emaste Added: head/usr.sbin/IPXrouted/ - copied from r262539, head/usr.sbin/IPXrouted/ Modified: head/lib/libpam/modules/pam_radius/pam_radius.8 head/lib/libpam/modules/pam_tacplus/pam_tacplus.8 head/sbin/mdconfig/mdconfig.8 head/secure/usr.bin/bdes/bdes.1 head/share/doc/papers/beyond4.3/beyond43.ms head/share/doc/papers/diskperf/abs.ms (contents, props changed) head/share/doc/papers/diskperf/appendix.ms (contents, props changed) head/share/doc/papers/diskperf/conclusions.ms head/share/doc/papers/diskperf/equip.ms (contents, props changed) head/share/doc/papers/diskperf/methodology.ms (contents, props changed) head/share/doc/papers/diskperf/motivation.ms head/share/doc/papers/diskperf/results.ms (contents, props changed) head/share/doc/papers/diskperf/tests.ms head/share/doc/papers/fsinterface/abstract.ms (contents, props changed) head/share/doc/papers/fsinterface/fsinterface.ms head/share/doc/papers/fsinterface/slides.t (contents, props changed) head/share/doc/papers/kernmalloc/alloc.fig (contents, props changed) head/share/doc/papers/kernmalloc/appendix.ms head/share/doc/papers/kernmalloc/appendix.t (contents, props changed) head/share/doc/papers/kernmalloc/kernmalloc.t head/share/doc/papers/kernmalloc/usage.tbl (contents, props changed) head/share/doc/papers/kerntune/0.t (contents, props changed) head/share/doc/papers/kerntune/1.t head/share/doc/papers/kerntune/2.t (contents, props changed) head/share/doc/papers/kerntune/3.t (contents, props changed) head/share/doc/papers/kerntune/4.t (contents, props changed) head/share/doc/papers/kerntune/fig2.pic (contents, props changed) head/share/doc/papers/newvm/0.t (contents, props changed) head/share/doc/papers/newvm/1.t head/share/doc/papers/newvm/a.t head/share/doc/papers/relengr/0.t head/share/doc/papers/relengr/1.t (contents, props changed) head/share/doc/papers/relengr/2.t (contents, props changed) head/share/doc/papers/relengr/3.t (contents, props changed) head/share/doc/papers/sysperf/0.t (contents, props changed) head/share/doc/papers/sysperf/1.t (contents, props changed) head/share/doc/papers/sysperf/2.t (contents, props changed) head/share/doc/papers/sysperf/3.t (contents, props changed) head/share/doc/papers/sysperf/4.t head/share/doc/papers/sysperf/5.t head/share/doc/papers/sysperf/6.t (contents, props changed) head/share/doc/papers/sysperf/7.t (contents, props changed) head/share/doc/papers/sysperf/a1.t (contents, props changed) head/share/doc/papers/sysperf/a2.t (contents, props changed) head/share/doc/papers/sysperf/appendix.ms head/share/doc/psd/05.sysman/0.t (contents, props changed) head/share/doc/psd/05.sysman/1.0.t (contents, props changed) head/share/doc/psd/05.sysman/1.1.t head/share/doc/psd/05.sysman/1.2.t head/share/doc/psd/05.sysman/1.3.t (contents, props changed) head/share/doc/psd/05.sysman/1.4.t (contents, props changed) head/share/doc/psd/05.sysman/1.5.t (contents, props changed) head/share/doc/psd/05.sysman/1.6.t (contents, props changed) head/share/doc/psd/05.sysman/1.7.t (contents, props changed) head/share/doc/psd/05.sysman/2.0.t (contents, props changed) head/share/doc/psd/05.sysman/2.1.t (contents, props changed) head/share/doc/psd/05.sysman/2.2.t (contents, props changed) head/share/doc/psd/05.sysman/2.3.t head/share/doc/psd/05.sysman/2.4.t (contents, props changed) head/share/doc/psd/05.sysman/2.5.t (contents, props changed) head/share/doc/psd/05.sysman/a.t (contents, props changed) head/share/doc/psd/12.make/tutorial.ms head/share/doc/psd/18.gprof/abstract.me (contents, props changed) head/share/doc/psd/18.gprof/gathering.me (contents, props changed) head/share/doc/psd/18.gprof/header.me (contents, props changed) head/share/doc/psd/18.gprof/intro.me (contents, props changed) head/share/doc/psd/18.gprof/postp.me (contents, props changed) head/share/doc/psd/18.gprof/postp1.pic (contents, props changed) head/share/doc/psd/18.gprof/postp2.pic (contents, props changed) head/share/doc/psd/18.gprof/postp3.pic (contents, props changed) head/share/doc/psd/18.gprof/pres1.pic (contents, props changed) head/share/doc/psd/18.gprof/pres2.pic (contents, props changed) head/share/doc/psd/18.gprof/present.me (contents, props changed) head/share/doc/psd/18.gprof/profiling.me (contents, props changed) head/share/doc/psd/18.gprof/refs.me (contents, props changed) head/share/doc/psd/20.ipctut/dgramread.c (contents, props changed) head/share/doc/psd/20.ipctut/dgramsend.c (contents, props changed) head/share/doc/psd/20.ipctut/pipe.c (contents, props changed) head/share/doc/psd/20.ipctut/socketpair.c (contents, props changed) head/share/doc/psd/20.ipctut/strchkread.c (contents, props changed) head/share/doc/psd/20.ipctut/streamread.c (contents, props changed) head/share/doc/psd/20.ipctut/streamwrite.c (contents, props changed) head/share/doc/psd/20.ipctut/tutor.me (contents, props changed) head/share/doc/psd/20.ipctut/udgramread.c (contents, props changed) head/share/doc/psd/20.ipctut/udgramsend.c (contents, props changed) head/share/doc/psd/20.ipctut/ustreamread.c (contents, props changed) head/share/doc/psd/20.ipctut/ustreamwrite.c (contents, props changed) head/share/doc/psd/21.ipc/0.t (contents, props changed) head/share/doc/psd/21.ipc/1.t (contents, props changed) head/share/doc/psd/21.ipc/2.t (contents, props changed) head/share/doc/psd/21.ipc/3.t head/share/doc/psd/21.ipc/4.t head/share/doc/psd/21.ipc/5.t head/share/doc/psd/contents/contents.ms head/share/doc/smm/01.setup/0.t head/share/doc/smm/01.setup/1.t (contents, props changed) head/share/doc/smm/01.setup/2.t head/share/doc/smm/01.setup/3.t head/share/doc/smm/01.setup/4.t head/share/doc/smm/01.setup/5.t head/share/doc/smm/01.setup/6.t (contents, props changed) head/share/doc/smm/02.config/0.t (contents, props changed) head/share/doc/smm/02.config/1.t (contents, props changed) head/share/doc/smm/02.config/2.t (contents, props changed) head/share/doc/smm/02.config/3.t (contents, props changed) head/share/doc/smm/02.config/4.t (contents, props changed) head/share/doc/smm/02.config/5.t (contents, props changed) head/share/doc/smm/02.config/6.t head/share/doc/smm/02.config/a.t (contents, props changed) head/share/doc/smm/02.config/b.t (contents, props changed) head/share/doc/smm/02.config/c.t (contents, props changed) head/share/doc/smm/02.config/d.t (contents, props changed) head/share/doc/smm/02.config/e.t (contents, props changed) head/share/doc/smm/04.quotas/quotas.ms (contents, props changed) head/share/doc/smm/05.fastfs/0.t (contents, props changed) head/share/doc/smm/05.fastfs/1.t (contents, props changed) head/share/doc/smm/05.fastfs/2.t (contents, props changed) head/share/doc/smm/05.fastfs/3.t head/share/doc/smm/05.fastfs/4.t (contents, props changed) head/share/doc/smm/05.fastfs/5.t (contents, props changed) head/share/doc/smm/05.fastfs/6.t (contents, props changed) head/share/doc/smm/06.nfs/0.t (contents, props changed) head/share/doc/smm/06.nfs/1.t head/share/doc/smm/06.nfs/2.t head/share/doc/smm/06.nfs/ref.t (contents, props changed) head/share/doc/smm/07.lpd/0.t (contents, props changed) head/share/doc/smm/07.lpd/1.t (contents, props changed) head/share/doc/smm/07.lpd/2.t (contents, props changed) head/share/doc/smm/07.lpd/3.t (contents, props changed) head/share/doc/smm/07.lpd/4.t (contents, props changed) head/share/doc/smm/07.lpd/5.t (contents, props changed) head/share/doc/smm/07.lpd/6.t (contents, props changed) head/share/doc/smm/07.lpd/7.t (contents, props changed) head/share/doc/smm/11.timedop/timed.ms (contents, props changed) head/share/doc/smm/12.timed/date (contents, props changed) head/share/doc/smm/12.timed/loop (contents, props changed) head/share/doc/smm/12.timed/time (contents, props changed) head/share/doc/smm/12.timed/timed.ms head/share/doc/smm/12.timed/unused (contents, props changed) head/share/doc/smm/18.net/0.t (contents, props changed) head/share/doc/smm/18.net/1.t (contents, props changed) head/share/doc/smm/18.net/2.t (contents, props changed) head/share/doc/smm/18.net/3.t (contents, props changed) head/share/doc/smm/18.net/4.t (contents, props changed) head/share/doc/smm/18.net/5.t (contents, props changed) head/share/doc/smm/18.net/6.t (contents, props changed) head/share/doc/smm/18.net/7.t head/share/doc/smm/18.net/8.t (contents, props changed) head/share/doc/smm/18.net/9.t (contents, props changed) head/share/doc/smm/18.net/a.t (contents, props changed) head/share/doc/smm/18.net/b.t (contents, props changed) head/share/doc/smm/18.net/c.t (contents, props changed) head/share/doc/smm/18.net/d.t (contents, props changed) head/share/doc/smm/18.net/e.t (contents, props changed) head/share/doc/smm/18.net/f.t (contents, props changed) head/share/doc/smm/contents/contents.ms head/share/doc/usd/07.mail/mail0.nr head/share/doc/usd/07.mail/mail1.nr (contents, props changed) head/share/doc/usd/07.mail/mail2.nr (contents, props changed) head/share/doc/usd/07.mail/mail3.nr (contents, props changed) head/share/doc/usd/07.mail/mail4.nr (contents, props changed) head/share/doc/usd/07.mail/mail5.nr head/share/doc/usd/07.mail/mail6.nr (contents, props changed) head/share/doc/usd/07.mail/mail7.nr (contents, props changed) head/share/doc/usd/07.mail/mail8.nr (contents, props changed) head/share/doc/usd/07.mail/mail9.nr (contents, props changed) head/share/doc/usd/07.mail/maila.nr (contents, props changed) head/share/doc/usd/18.msdiffs/ms.diffs head/share/doc/usd/contents/contents.ms head/share/man/man1/intro.1 head/share/man/man3/assert.3 head/share/man/man3/bitstring.3 head/share/man/man3/end.3 head/share/man/man3/fpgetround.3 head/share/man/man3/intro.3 head/share/man/man3/queue.3 head/share/man/man3/stdarg.3 head/share/man/man4/cy.4 head/share/man/man4/digi.4 head/share/man/man4/disc.4 head/share/man/man4/edsc.4 head/share/man/man4/fd.4 head/share/man/man4/icmp.4 head/share/man/man4/inet.4 head/share/man/man4/ip.4 head/share/man/man4/ksyms.4 head/share/man/man4/lp.4 head/share/man/man4/mem.4 head/share/man/man4/mtio.4 head/share/man/man4/netintro.4 head/share/man/man4/null.4 head/share/man/man4/pts.4 head/share/man/man4/route.4 head/share/man/man4/sctp.4 head/share/man/man4/sio.4 head/share/man/man4/tcp.4 head/share/man/man4/termios.4 head/share/man/man4/tty.4 head/share/man/man4/udp.4 head/share/man/man4/unix.4 head/share/man/man5/a.out.5 head/share/man/man5/acct.5 head/share/man/man5/core.5 head/share/man/man5/devfs.5 head/share/man/man5/dir.5 head/share/man/man5/disktab.5 head/share/man/man5/fdescfs.5 head/share/man/man5/fs.5 head/share/man/man5/fstab.5 head/share/man/man5/group.5 head/share/man/man5/hosts.5 head/share/man/man5/hosts.equiv.5 head/share/man/man5/hosts.lpd.5 head/share/man/man5/intro.5 head/share/man/man5/networks.5 head/share/man/man5/passwd.5 head/share/man/man5/phones.5 head/share/man/man5/protocols.5 head/share/man/man5/remote.5 head/share/man/man5/resolver.5 head/share/man/man5/services.5 head/share/man/man5/shells.5 head/share/man/man5/stab.5 head/share/man/man6/intro.6 head/share/man/man7/adding_user.7 head/share/man/man7/ascii.7 head/share/man/man7/environ.7 head/share/man/man7/hier.7 head/share/man/man7/hostname.7 head/share/man/man7/intro.7 head/share/man/man7/mailaddr.7 head/share/man/man7/operator.7 head/share/man/man7/sticky.7 head/share/man/man8/crash.8 head/share/man/man8/intro.8 head/share/man/man8/rc.8 head/share/man/man9/buf.9 head/share/man/man9/intro.9 head/share/me/acm.me (contents, props changed) head/share/me/chars.me (contents, props changed) head/share/me/deltext.me (contents, props changed) head/share/me/eqn.me head/share/me/float.me (contents, props changed) head/share/me/footnote.me (contents, props changed) head/share/me/index.me (contents, props changed) head/share/me/letterhead.me (contents, props changed) head/share/me/local.me (contents, props changed) head/share/me/null.me (contents, props changed) head/share/me/orig_me.7 head/share/me/refer.me (contents, props changed) head/share/me/sh.me (contents, props changed) head/share/me/tbl.me (contents, props changed) head/share/me/thesis.me (contents, props changed) head/share/me/tmac.orig_me head/share/termcap/termcap.5 head/usr.bin/indent/indent.1 head/usr.bin/locate/locate/locate.1 head/usr.bin/make/make.1 head/usr.bin/pr/pr.1 head/usr.bin/whereis/whereis.1 head/usr.sbin/IPXrouted/IPXrouted.8 head/usr.sbin/rpc.lockd/rpc.lockd.8 head/usr.sbin/rpc.statd/rpc.statd.8 Modified: head/lib/libpam/modules/pam_radius/pam_radius.8 ============================================================================== --- head/lib/libpam/modules/pam_radius/pam_radius.8 Fri Mar 14 03:00:02 2014 (r263141) +++ head/lib/libpam/modules/pam_radius/pam_radius.8 Fri Mar 14 03:07:51 2014 (r263142) @@ -16,11 +16,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/lib/libpam/modules/pam_tacplus/pam_tacplus.8 ============================================================================== --- head/lib/libpam/modules/pam_tacplus/pam_tacplus.8 Fri Mar 14 03:00:02 2014 (r263141) +++ head/lib/libpam/modules/pam_tacplus/pam_tacplus.8 Fri Mar 14 03:07:51 2014 (r263142) @@ -16,11 +16,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/sbin/mdconfig/mdconfig.8 ============================================================================== --- head/sbin/mdconfig/mdconfig.8 Fri Mar 14 03:00:02 2014 (r263141) +++ head/sbin/mdconfig/mdconfig.8 Fri Mar 14 03:07:51 2014 (r263142) @@ -16,11 +16,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/secure/usr.bin/bdes/bdes.1 ============================================================================== --- head/secure/usr.bin/bdes/bdes.1 Fri Mar 14 03:00:02 2014 (r263141) +++ head/secure/usr.bin/bdes/bdes.1 Fri Mar 14 03:07:51 2014 (r263142) @@ -12,11 +12,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/beyond4.3/beyond43.ms ============================================================================== --- head/share/doc/papers/beyond4.3/beyond43.ms Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/beyond4.3/beyond43.ms Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/diskperf/abs.ms ============================================================================== --- head/share/doc/papers/diskperf/abs.ms Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/diskperf/abs.ms Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/diskperf/appendix.ms ============================================================================== --- head/share/doc/papers/diskperf/appendix.ms Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/diskperf/appendix.ms Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/diskperf/conclusions.ms ============================================================================== --- head/share/doc/papers/diskperf/conclusions.ms Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/diskperf/conclusions.ms Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/diskperf/equip.ms ============================================================================== --- head/share/doc/papers/diskperf/equip.ms Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/diskperf/equip.ms Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/diskperf/methodology.ms ============================================================================== --- head/share/doc/papers/diskperf/methodology.ms Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/diskperf/methodology.ms Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/diskperf/motivation.ms ============================================================================== --- head/share/doc/papers/diskperf/motivation.ms Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/diskperf/motivation.ms Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/diskperf/results.ms ============================================================================== --- head/share/doc/papers/diskperf/results.ms Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/diskperf/results.ms Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/diskperf/tests.ms ============================================================================== --- head/share/doc/papers/diskperf/tests.ms Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/diskperf/tests.ms Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/fsinterface/abstract.ms ============================================================================== --- head/share/doc/papers/fsinterface/abstract.ms Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/fsinterface/abstract.ms Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/fsinterface/fsinterface.ms ============================================================================== --- head/share/doc/papers/fsinterface/fsinterface.ms Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/fsinterface/fsinterface.ms Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/fsinterface/slides.t ============================================================================== --- head/share/doc/papers/fsinterface/slides.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/fsinterface/slides.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/kernmalloc/alloc.fig ============================================================================== --- head/share/doc/papers/kernmalloc/alloc.fig Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/kernmalloc/alloc.fig Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/kernmalloc/appendix.ms ============================================================================== --- head/share/doc/papers/kernmalloc/appendix.ms Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/kernmalloc/appendix.ms Fri Mar 14 03:07:51 2014 (r263142) @@ -82,11 +82,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/kernmalloc/appendix.t ============================================================================== --- head/share/doc/papers/kernmalloc/appendix.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/kernmalloc/appendix.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/kernmalloc/kernmalloc.t ============================================================================== --- head/share/doc/papers/kernmalloc/kernmalloc.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/kernmalloc/kernmalloc.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/kernmalloc/usage.tbl ============================================================================== --- head/share/doc/papers/kernmalloc/usage.tbl Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/kernmalloc/usage.tbl Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/kerntune/0.t ============================================================================== --- head/share/doc/papers/kerntune/0.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/kerntune/0.t Fri Mar 14 03:07:51 2014 (r263142) @@ -10,11 +10,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/kerntune/1.t ============================================================================== --- head/share/doc/papers/kerntune/1.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/kerntune/1.t Fri Mar 14 03:07:51 2014 (r263142) @@ -10,11 +10,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/kerntune/2.t ============================================================================== --- head/share/doc/papers/kerntune/2.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/kerntune/2.t Fri Mar 14 03:07:51 2014 (r263142) @@ -10,11 +10,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/kerntune/3.t ============================================================================== --- head/share/doc/papers/kerntune/3.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/kerntune/3.t Fri Mar 14 03:07:51 2014 (r263142) @@ -10,11 +10,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/kerntune/4.t ============================================================================== --- head/share/doc/papers/kerntune/4.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/kerntune/4.t Fri Mar 14 03:07:51 2014 (r263142) @@ -10,11 +10,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/kerntune/fig2.pic ============================================================================== --- head/share/doc/papers/kerntune/fig2.pic Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/kerntune/fig2.pic Fri Mar 14 03:07:51 2014 (r263142) @@ -10,11 +10,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/newvm/0.t ============================================================================== --- head/share/doc/papers/newvm/0.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/newvm/0.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/newvm/1.t ============================================================================== --- head/share/doc/papers/newvm/1.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/newvm/1.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/newvm/a.t ============================================================================== --- head/share/doc/papers/newvm/a.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/newvm/a.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/relengr/0.t ============================================================================== --- head/share/doc/papers/relengr/0.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/relengr/0.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/relengr/1.t ============================================================================== --- head/share/doc/papers/relengr/1.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/relengr/1.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/relengr/2.t ============================================================================== --- head/share/doc/papers/relengr/2.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/relengr/2.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/relengr/3.t ============================================================================== --- head/share/doc/papers/relengr/3.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/relengr/3.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/sysperf/0.t ============================================================================== --- head/share/doc/papers/sysperf/0.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/sysperf/0.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/sysperf/1.t ============================================================================== --- head/share/doc/papers/sysperf/1.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/sysperf/1.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/sysperf/2.t ============================================================================== --- head/share/doc/papers/sysperf/2.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/sysperf/2.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/sysperf/3.t ============================================================================== --- head/share/doc/papers/sysperf/3.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/sysperf/3.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/sysperf/4.t ============================================================================== --- head/share/doc/papers/sysperf/4.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/sysperf/4.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/sysperf/5.t ============================================================================== --- head/share/doc/papers/sysperf/5.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/sysperf/5.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/sysperf/6.t ============================================================================== --- head/share/doc/papers/sysperf/6.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/sysperf/6.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/sysperf/7.t ============================================================================== --- head/share/doc/papers/sysperf/7.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/sysperf/7.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/sysperf/a1.t ============================================================================== --- head/share/doc/papers/sysperf/a1.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/sysperf/a1.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/sysperf/a2.t ============================================================================== --- head/share/doc/papers/sysperf/a2.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/sysperf/a2.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/papers/sysperf/appendix.ms ============================================================================== --- head/share/doc/papers/sysperf/appendix.ms Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/papers/sysperf/appendix.ms Fri Mar 14 03:07:51 2014 (r263142) @@ -82,11 +82,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" @@ -931,11 +927,7 @@ rnd() .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/05.sysman/0.t ============================================================================== --- head/share/doc/psd/05.sysman/0.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/05.sysman/0.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/05.sysman/1.0.t ============================================================================== --- head/share/doc/psd/05.sysman/1.0.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/05.sysman/1.0.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/05.sysman/1.1.t ============================================================================== --- head/share/doc/psd/05.sysman/1.1.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/05.sysman/1.1.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/05.sysman/1.2.t ============================================================================== --- head/share/doc/psd/05.sysman/1.2.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/05.sysman/1.2.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/05.sysman/1.3.t ============================================================================== --- head/share/doc/psd/05.sysman/1.3.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/05.sysman/1.3.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/05.sysman/1.4.t ============================================================================== --- head/share/doc/psd/05.sysman/1.4.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/05.sysman/1.4.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/05.sysman/1.5.t ============================================================================== --- head/share/doc/psd/05.sysman/1.5.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/05.sysman/1.5.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/05.sysman/1.6.t ============================================================================== --- head/share/doc/psd/05.sysman/1.6.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/05.sysman/1.6.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/05.sysman/1.7.t ============================================================================== --- head/share/doc/psd/05.sysman/1.7.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/05.sysman/1.7.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/05.sysman/2.0.t ============================================================================== --- head/share/doc/psd/05.sysman/2.0.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/05.sysman/2.0.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/05.sysman/2.1.t ============================================================================== --- head/share/doc/psd/05.sysman/2.1.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/05.sysman/2.1.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/05.sysman/2.2.t ============================================================================== --- head/share/doc/psd/05.sysman/2.2.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/05.sysman/2.2.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/05.sysman/2.3.t ============================================================================== --- head/share/doc/psd/05.sysman/2.3.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/05.sysman/2.3.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/05.sysman/2.4.t ============================================================================== --- head/share/doc/psd/05.sysman/2.4.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/05.sysman/2.4.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/05.sysman/2.5.t ============================================================================== --- head/share/doc/psd/05.sysman/2.5.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/05.sysman/2.5.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/05.sysman/a.t ============================================================================== --- head/share/doc/psd/05.sysman/a.t Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/05.sysman/a.t Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/12.make/tutorial.ms ============================================================================== --- head/share/doc/psd/12.make/tutorial.ms Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/12.make/tutorial.ms Fri Mar 14 03:07:51 2014 (r263142) @@ -14,11 +14,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/18.gprof/abstract.me ============================================================================== --- head/share/doc/psd/18.gprof/abstract.me Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/18.gprof/abstract.me Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/18.gprof/gathering.me ============================================================================== --- head/share/doc/psd/18.gprof/gathering.me Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/18.gprof/gathering.me Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/18.gprof/header.me ============================================================================== --- head/share/doc/psd/18.gprof/header.me Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/18.gprof/header.me Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/share/doc/psd/18.gprof/intro.me ============================================================================== --- head/share/doc/psd/18.gprof/intro.me Fri Mar 14 03:00:02 2014 (r263141) +++ head/share/doc/psd/18.gprof/intro.me Fri Mar 14 03:07:51 2014 (r263142) @@ -9,11 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 03:09:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDF06533; Fri, 14 Mar 2014 03:09:29 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D03AB287; Fri, 14 Mar 2014 03:09:28 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s2E39PIx046589 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 14 Mar 2014 07:09:25 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s2E39PTI046588; Fri, 14 Mar 2014 07:09:25 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 14 Mar 2014 07:09:25 +0400 From: Gleb Smirnoff To: Eitan Adler Subject: Re: svn commit: r263142 - in head: lib/libpam/modules/pam_radius lib/libpam/modules/pam_tacplus sbin/mdconfig secure/usr.bin/bdes share/doc/papers/beyond4.3 share/doc/papers/diskperf share/doc/papers/f... Message-ID: <20140314030925.GG40073@FreeBSD.org> References: <201403140307.s2E37q5R039829@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201403140307.s2E37q5R039829@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 03:09:29 -0000 On Fri, Mar 14, 2014 at 03:07:52AM +0000, Eitan Adler wrote: E> Author: eadler E> Date: Fri Mar 14 03:07:51 2014 E> New Revision: 263142 E> URL: http://svnweb.freebsd.org/changeset/base/263142 E> E> Log: E> multiple: Remove 3rd clause from BSD license where approved by the E> regents and renumber. E> E> This patch skips files in contrib/ and crypto/ E> E> Acked by: imp E> Discussed with: emaste E> E> Added: E> head/usr.sbin/IPXrouted/ E> - copied from r262539, head/usr.sbin/IPXrouted/ Seems like you blindly did "mine full", when subversion reported you a merge conflict. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 03:11:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F2A368B for ; Fri, 14 Mar 2014 03:11:06 +0000 (UTC) Received: from mail-qc0-x22c.google.com (mail-qc0-x22c.google.com [IPv6:2607:f8b0:400d:c01::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 009C4297 for ; Fri, 14 Mar 2014 03:11:05 +0000 (UTC) Received: by mail-qc0-f172.google.com with SMTP id i8so2296021qcq.3 for ; Thu, 13 Mar 2014 20:11:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=6aYQ5HwBGOXgpo878Iws8dudh23sGvo3xAfDSAjJ1B4=; b=j/0jEPQ3R5arQ7rCsqhel6uXQjk+XQivj8LJLT0nmlOLNutcdyahRuf+YVlDeV/ott HzvvnGrWidqZfUIMDvuSkbaIsfYidMpI3KD+VXFLscbndpIUGnfgJDitRm00hM8q8+Gg IOgM4O1K30nlePsaVuLe6oFIT1tY8QEXm2V3k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=6aYQ5HwBGOXgpo878Iws8dudh23sGvo3xAfDSAjJ1B4=; b=FRWvABoGo8BvP6+FKqtMXkDEBnnLQhB3vZXQA20CoKgEXWeWvz4i08de600ZKu+NWX vxWOn/lMl1I3ZNbbmi1BcnilTyUo8AWCZRcGiiT+Twi3fgGKxnd7kUWXtAiaJSWUXCfn 4zQWmS6MwdBw1syrdmXaeF+9X4Hbb52CNxVsGnXnidiaFvLFnfYzDjMDHE82Ke7o+gvY dG0MIpJACeLfRQtbzHPbJ+8hrgygWxg9JP78V6709aMXywqLj+36rwnq6wEVnQI5Rqng xeDzIQppelDZX22wYoS13Ll6f9LmzqbZ/+wJQ0ln6QEAOv42dwphMKB6pkw7wpop1/2c EeWQ== X-Gm-Message-State: ALoCoQmMSbLxAjVG9BqSOvOn1zl6xosGb9XdkFF55wJ9iX53qxJBz9N6XnzxUU+0wWc8/eJjs6kN X-Received: by 10.224.7.10 with SMTP id b10mr6991910qab.50.1394766665167; Thu, 13 Mar 2014 20:11:05 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.147.225 with HTTP; Thu, 13 Mar 2014 20:10:34 -0700 (PDT) In-Reply-To: <20140314030925.GG40073@FreeBSD.org> References: <201403140307.s2E37q5R039829@svn.freebsd.org> <20140314030925.GG40073@FreeBSD.org> From: Eitan Adler Date: Thu, 13 Mar 2014 23:10:34 -0400 X-Google-Sender-Auth: rTGVt2ha9siuzlkU6eyRvhpplis Message-ID: Subject: Re: svn commit: r263142 - in head: lib/libpam/modules/pam_radius lib/libpam/modules/pam_tacplus sbin/mdconfig secure/usr.bin/bdes share/doc/papers/beyond4.3 share/doc/papers/diskperf share/doc/papers/f... To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 03:11:06 -0000 On 13 March 2014 23:09, Gleb Smirnoff wrote: > On Fri, Mar 14, 2014 at 03:07:52AM +0000, Eitan Adler wrote: > E> Author: eadler > E> Date: Fri Mar 14 03:07:51 2014 > E> New Revision: 263142 > E> URL: http://svnweb.freebsd.org/changeset/base/263142 > E> > E> Log: > E> multiple: Remove 3rd clause from BSD license where approved by the > E> regents and renumber. > E> > E> This patch skips files in contrib/ and crypto/ > E> > E> Acked by: imp > E> Discussed with: emaste > E> > E> Added: > E> head/usr.sbin/IPXrouted/ > E> - copied from r262539, head/usr.sbin/IPXrouted/ > > Seems like you blindly did "mine full", when subversion reported > you a merge conflict. I thought I hit "theirs full". I noticed this and am working on fixing it. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 03:12:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 837977F8; Fri, 14 Mar 2014 03:12:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5772831B; Fri, 14 Mar 2014 03:12:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E3Cgv5043375; Fri, 14 Mar 2014 03:12:42 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E3Cgti043374; Fri, 14 Mar 2014 03:12:42 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403140312.s2E3Cgti043374@svn.freebsd.org> From: Eitan Adler Date: Fri, 14 Mar 2014 03:12:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263143 - head/usr.sbin/IPXrouted X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 03:12:42 -0000 Author: eadler Date: Fri Mar 14 03:12:41 2014 New Revision: 263143 URL: http://svnweb.freebsd.org/changeset/base/263143 Log: Remove directory which should not have been re-added. Deleted: head/usr.sbin/IPXrouted/ From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 03:15:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1EF2978; Fri, 14 Mar 2014 03:15:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8EBB4336; Fri, 14 Mar 2014 03:15:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E3F2Ml043702; Fri, 14 Mar 2014 03:15:02 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E3F2gn043701; Fri, 14 Mar 2014 03:15:02 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403140315.s2E3F2gn043701@svn.freebsd.org> From: Devin Teske Date: Fri, 14 Mar 2014 03:15:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263144 - head/usr.sbin/bsdconfig/usermgmt/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 03:15:02 -0000 Author: dteske Date: Fri Mar 14 03:15:02 2014 New Revision: 263144 URL: http://svnweb.freebsd.org/changeset/base/263144 Log: Fix a code-typo that prevented auto-sizing of the dialog. Modified: head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Modified: head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Fri Mar 14 03:12:41 2014 (r263143) +++ head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Fri Mar 14 03:15:02 2014 (r263144) @@ -301,7 +301,7 @@ f_dialog_input_group_members() \"\$DIALOG_BACKTITLE\" \ \"\$__prompt\" \ \"\$__hline\" \ - $menu_list + $__menu_list local __menu_choice __retval while :; do From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 03:25:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8852FBD9; Fri, 14 Mar 2014 03:25:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5BB7860A; Fri, 14 Mar 2014 03:25:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E3PYDA047934; Fri, 14 Mar 2014 03:25:34 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E3PY49047933; Fri, 14 Mar 2014 03:25:34 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403140325.s2E3PY49047933@svn.freebsd.org> From: Devin Teske Date: Fri, 14 Mar 2014 03:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263145 - head/usr.sbin/bsdconfig/usermgmt/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 03:25:34 -0000 Author: dteske Date: Fri Mar 14 03:25:33 2014 New Revision: 263145 URL: http://svnweb.freebsd.org/changeset/base/263145 Log: Fix comments and whitespace. Modified: head/usr.sbin/bsdconfig/usermgmt/share/group.subr Modified: head/usr.sbin/bsdconfig/usermgmt/share/group.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/group.subr Fri Mar 14 03:15:02 2014 (r263144) +++ head/usr.sbin/bsdconfig/usermgmt/share/group.subr Fri Mar 14 03:25:33 2014 (r263145) @@ -163,7 +163,7 @@ f_group_add() elif [ "$group_password" ]; then echo "$group_password" | f_eval_catch $funcname \ - pw '%s -h 0' "$cmd" + pw '%s -h 0' "$cmd" else f_eval_catch $funcname pw '%s' "$cmd" fi && break @@ -324,7 +324,9 @@ f_group_delete() # unchanged. # VAR_GROUP_MEMBERS [Optional] # Comma separated list of users that are a member of this group. -# If NULL or unset, group membership is unmodified. +# If set but NULL, group memberships are reset (no users will be +# a member of this group). If unset, group membership is +# unmodified. # VAR_GROUP_PASSWORD [Optional] # newgrp(1) password to set for the group. If unset, the password # is unmodified. If NULL, the newgrp(1) password is disabled. @@ -409,9 +411,8 @@ f_group_edit() if [ "$group_password_disable" ]; then f_eval_catch $funcname pw '%s -h -' "$cmd" elif [ "$group_password" ]; then - echo "$group_password" | - f_eval_catch $funcname \ - pw '%s -h 0' "$cmd" + echo "$group_password" | f_eval_catch \ + $funcname pw '%s -h 0' "$cmd" else f_eval_catch $funcname pw '%s' "$cmd" fi && break @@ -424,7 +425,7 @@ f_group_edit() if ! f_input_group "$mtag"; then f_show_err "$msg_group_not_found" "$mtag" - # Attempt to fall back to prevoius selection + # Attempt to fall back to previous selection f_input_group "$input" || return $FAILURE else input="$mtag" From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 03:28:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22911D6F; Fri, 14 Mar 2014 03:28:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1001262B; Fri, 14 Mar 2014 03:28:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E3SLBQ048249; Fri, 14 Mar 2014 03:28:21 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E3SLxi048248; Fri, 14 Mar 2014 03:28:21 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403140328.s2E3SLxi048248@svn.freebsd.org> From: Devin Teske Date: Fri, 14 Mar 2014 03:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263146 - head/usr.sbin/bsdconfig/usermgmt/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 03:28:22 -0000 Author: dteske Date: Fri Mar 14 03:28:21 2014 New Revision: 263146 URL: http://svnweb.freebsd.org/changeset/base/263146 Log: Reduce the sleep cycle when using dialog(1) to 1-second. Modified: head/usr.sbin/bsdconfig/usermgmt/share/group.subr Modified: head/usr.sbin/bsdconfig/usermgmt/share/group.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/group.subr Fri Mar 14 03:25:33 2014 (r263145) +++ head/usr.sbin/bsdconfig/usermgmt/share/group.subr Fri Mar 14 03:28:21 2014 (r263146) @@ -217,7 +217,7 @@ f_group_add() f_dialog_title "$title" $alert "$msg_group_added" f_dialog_title_restore - [ "$no_confirm" -a "$USE_DIALOG" ] && sleep 2 + [ "$no_confirm" -a "$USE_DIALOG" ] && sleep 1 return $SUCCESS } @@ -305,7 +305,7 @@ f_group_delete() f_dialog_title "$title" $alert "$msg_group_deleted" f_dialog_title_restore - [ "$no_confirm" -a "$USE_DIALOG" ] && sleep 2 + [ "$no_confirm" -a "$USE_DIALOG" ] && sleep 1 return $SUCCESS } @@ -473,7 +473,7 @@ f_group_edit() f_dialog_title "$title" $alert "$msg_group_updated" f_dialog_title_restore - [ "$no_confirm" -a "$USE_DIALOG" ] && sleep 2 + [ "$no_confirm" -a "$USE_DIALOG" ] && sleep 1 return $SUCCESS } From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 03:33:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF42BEE8; Fri, 14 Mar 2014 03:33:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B4376C1; Fri, 14 Mar 2014 03:33:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E3X3XA051733; Fri, 14 Mar 2014 03:33:03 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E3X3ue051732; Fri, 14 Mar 2014 03:33:03 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403140333.s2E3X3ue051732@svn.freebsd.org> From: Devin Teske Date: Fri, 14 Mar 2014 03:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263147 - head/usr.sbin/bsdconfig/usermgmt/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 03:33:03 -0000 Author: dteske Date: Fri Mar 14 03:33:03 2014 New Revision: 263147 URL: http://svnweb.freebsd.org/changeset/base/263147 Log: Fix a bug preventing errors from pw(8) from filtering up to a dialog. Programs running as rvalue to pipe cannot access current namespace. Modified: head/usr.sbin/bsdconfig/usermgmt/share/group.subr Modified: head/usr.sbin/bsdconfig/usermgmt/share/group.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/group.subr Fri Mar 14 03:28:21 2014 (r263146) +++ head/usr.sbin/bsdconfig/usermgmt/share/group.subr Fri Mar 14 03:33:03 2014 (r263147) @@ -202,8 +202,8 @@ f_group_add() if [ "$group_password_disable" ]; then f_eval_catch -k err $funcname pw '%s -h -' "$cmd" elif [ "$group_password" ]; then - echo "$group_password" | f_eval_catch -k err \ - $funcname pw '%s -h 0' "$cmd" + err=$( echo "$group_password" | f_eval_catch -de \ + $funcname pw '%s -h 0' "$cmd" 2>&1 ) else f_eval_catch -k err $funcname pw '%s' "$cmd" fi @@ -458,8 +458,8 @@ f_group_edit() if [ "$group_password_disable" ]; then f_eval_catch -k err $funcname pw '%s -h -' "$cmd" elif [ "$group_password" -o "$null_password" ]; then - echo "$group_password" | f_eval_catch -k err \ - $funcname pw '%s -h 0' "$cmd" + err=$( echo "$group_password" | f_eval_catch -de \ + $funcname pw '%s -h 0' "$cmd" 2>&1 ) else f_eval_catch -k err $funcname pw '%s' "$cmd" fi From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 03:34:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35B6ED7; Fri, 14 Mar 2014 03:34:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 22BE56CC; Fri, 14 Mar 2014 03:34:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E3YhGw051936; Fri, 14 Mar 2014 03:34:44 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E3Yh9s051935; Fri, 14 Mar 2014 03:34:43 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403140334.s2E3Yh9s051935@svn.freebsd.org> From: Devin Teske Date: Fri, 14 Mar 2014 03:34:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263148 - head/usr.sbin/bsdconfig/usermgmt/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 03:34:44 -0000 Author: dteske Date: Fri Mar 14 03:34:43 2014 New Revision: 263148 URL: http://svnweb.freebsd.org/changeset/base/263148 Log: For non-interactive scripts, forgot to check we were given an argument before proceeding. Modified: head/usr.sbin/bsdconfig/usermgmt/share/group.subr Modified: head/usr.sbin/bsdconfig/usermgmt/share/group.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/group.subr Fri Mar 14 03:33:03 2014 (r263147) +++ head/usr.sbin/bsdconfig/usermgmt/share/group.subr Fri Mar 14 03:34:43 2014 (r263148) @@ -96,6 +96,10 @@ f_group_add() [ "$group_name" ] || f_show_err "$msg_please_enter_a_group_name" done + if [ ! "$group_name" ]; then + f_show_err "$msg_no_group_specified" + return $FAILURE + fi local group_password group_gid group_members f_getvar $VAR_GROUP_PASSWORD group_password From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 03:37:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC5E423A; Fri, 14 Mar 2014 03:37:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BDB7C6EE; Fri, 14 Mar 2014 03:37:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E3b8s8052254; Fri, 14 Mar 2014 03:37:08 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E3b8jG052252; Fri, 14 Mar 2014 03:37:08 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403140337.s2E3b8jG052252@svn.freebsd.org> From: Devin Teske Date: Fri, 14 Mar 2014 03:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263149 - head/usr.sbin/bsdconfig/usermgmt/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 03:37:08 -0000 Author: dteske Date: Fri Mar 14 03:37:08 2014 New Revision: 263149 URL: http://svnweb.freebsd.org/changeset/base/263149 Log: Add protection against input containing single-quotes (e.g., i18n-users). Modified: head/usr.sbin/bsdconfig/usermgmt/share/group.subr head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Modified: head/usr.sbin/bsdconfig/usermgmt/share/group.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/group.subr Fri Mar 14 03:34:43 2014 (r263148) +++ head/usr.sbin/bsdconfig/usermgmt/share/group.subr Fri Mar 14 03:37:08 2014 (r263149) @@ -156,10 +156,17 @@ f_group_add() case "$mtag" in X) # Add/Exit - local cmd="pw groupadd -n '$group_name'" - [ "$group_gid" ] && cmd="$cmd -g '$group_gid'" + local var + for var in gid members name; do + local _group_$var + eval f_shell_escape \ + \"\$group_$var\" _group_$var + done + + local cmd="pw groupadd -n '$_group_name'" + [ "$group_gid" ] && cmd="$cmd -g '$_group_gid'" [ "$group_members" ] && - cmd="$cmd -M '$group_members'" + cmd="$cmd -M '$_group_members'" # Execute the command (break on success) if [ "$group_password_disable" ]; then @@ -196,10 +203,16 @@ f_group_add() esac done else + local var + for var in gid members name; do + local _group_$var + eval f_shell_escape \"\$group_$var\" _group_$var + done + # Form the command - local cmd="pw groupadd -n '$group_name'" - [ "$group_gid" ] && cmd="$cmd -g '$group_gid'" - [ "$group_members" ] && cmd="$cmd -M '$group_members'" + local cmd="pw groupadd -n '$_group_name'" + [ "$group_gid" ] && cmd="$cmd -g '$_group_gid'" + [ "$group_members" ] && cmd="$cmd -M '$_group_members'" # Execute the command local retval err @@ -276,8 +289,10 @@ f_group_delete() case "$mtag" in X) # Delete/Exit + local _group_name + f_shell_escape "$group_name" _group_name f_eval_catch $funcname pw 'pw groupdel "%s"' \ - "$group_name" && break + "$_group_name" && break ;; 1) # Group Name (select different group from list) f_dialog_menu_group_list "$group_name" || continue @@ -296,9 +311,10 @@ f_group_delete() esac done else - local retval err + local retval err _group_name + f_shell_escape "$group_name" _group_name f_eval_catch -k err $funcname pw \ - 'pw groupdel "%s"' "$group_name" + "pw groupdel '%s'" "$_group_name" retval=$? if [ $retval -ne $SUCCESS ]; then f_show_err "%s" "$err" @@ -406,10 +422,17 @@ f_group_edit() case "$mtag" in X) # Save/Exit - local cmd="pw groupmod -n '$group_name'" - [ "$group_gid" ] && cmd="$cmd -g '$group_gid'" + local var + for var in gid members name; do + local _group_$var + eval f_shell_escape \ + \"\$group_$var\" _group_$var + done + + local cmd="pw groupmod -n '$_group_name'" + [ "$group_gid" ] && cmd="$cmd -g '$_group_gid'" [ "$group_members" -o "$null_members" ] && - cmd="$cmd -M '$group_members'" + cmd="$cmd -M '$_group_members'" # Execute the command (break on success) if [ "$group_password_disable" ]; then @@ -451,11 +474,17 @@ f_group_edit() esac done else + local var + for var in gid members name; do + local _group_$var + eval f_shell_escape \"\$group_$var\" _group_$var + done + # Form the command - local cmd="pw groupmod -n '$group_name'" - [ "$group_gid" ] && cmd="$cmd -g '$group_gid'" + local cmd="pw groupmod -n '$_group_name'" + [ "$group_gid" ] && cmd="$cmd -g '$_group_gid'" [ "$group_members" -o "$null_members" ] && - cmd="$cmd -M '$group_members'" + cmd="$cmd -M '$_group_members'" # Execute the command local retval err Modified: head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Fri Mar 14 03:34:43 2014 (r263148) +++ head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr Fri Mar 14 03:37:08 2014 (r263149) @@ -53,12 +53,16 @@ f_input_group() f_dprintf "$funcname: Getting info for group \`%s'" "$group" eval "$( pw groupshow "$group" 2> /dev/null | awk -F: ' + function set_value(var, value) { + gsub(/'\''/, "'\''\\'\'\''", value) + printf "group_%s='\'%s\''\n", var, value + } { found = $1 != "" - printf "group_name='\'%s\''\n", $1 - printf "group_password=\n" - printf "group_gid='\'%s\''\n", $3 - printf "group_members='\'%s\''\n", $4 + set_value("name", $1) + set_value("password", "") + set_value("gid", $3) + set_value("members", $4) exit } END { if (!found) print "false" }' )" @@ -80,10 +84,13 @@ f_dialog_menu_group_list() # Add groups from group(5) menu_list="$menu_list $( pw groupshow -a | awk -F: ' - !/^[[:space:]]*(#|$)/ { - printf "'\'%s\'\ \'%s\''\n", $1, $1 - }' - )" + function mprint(tag, item) { + gsub(/'\''/, "'\''\\'\'\''", tag) + gsub(/'\''/, "'\''\\'\'\''", item) + printf "'\'%s\'\ \'%s\''\n", tag, item + } + !/^[[:space:]]*(#|$)/ { mprint($1, $1) } + ' )" local height width rows eval f_dialog_menu_size height width rows \ @@ -331,16 +338,18 @@ f_dialog_input_group_members() X) # Exit break ;; 1) # Select Group Members from a list - local __user_list __length=0 __user __check_list= + local __check_list= # Calculated below + local __user_list __u __user __length=0 __user_list=$( pw usershow -a | awk -F: '!/^[[:space:]]*(#|$)/{print $1}' ) while [ $__length -ne ${#__user_list} ]; do - __user="${__user_list%%$NL*}" # First line + __u="${__user_list%%$NL*}" # First line + f_shell_escape "$__u" __user # Format of a checklist entry: tag item status __check_list="$__check_list '$__user' ''" case "$__input" in - "$__user"|"$__user",*|*,"$__user",*|*,"$__user") + "$__u"|"$__u",*|*,"$__u",*|*,"$__u") __check_list="$__check_list on" ;; *) __check_list="$__check_list off" @@ -416,12 +425,20 @@ f_dialog_menu_group_add() local defaultitem="$1" local hline="$hline_arrows_tab_enter" + # Localize potentially hostile variables and escape their values + # to the local variable (see f_shell_escape() of `strings.subr') + local var + for var in gid members name; do + local _group_$var + eval f_shell_escape \"\$group_$var\" _group_$var + done + menu_list=" 'X' '$msg_add/$msg_exit' - '1' '$msg_group: $group_name' + '1' '$msg_group: $_group_name' '2' '$msg_password: -----' - '3' '$msg_group_id: $group_gid' - '4' '$msg_group_members: $group_members' + '3' '$msg_group_id: $_group_gid' + '4' '$msg_group_members: $_group_members' " # END-QUOTE local height width rows @@ -470,12 +487,20 @@ f_dialog_menu_group_delete() local group_name group_password group_gid group_members f_input_group "$1" + # Localize potentially hostile variables and escape their values + # to the local variable (see f_shell_escape() of `strings.subr') + local var + for var in gid members name; do + local _group_$var + eval f_shell_escape \"\$group_$var\" _group_$var + done + menu_list=" 'X' '$msg_delete/$msg_exit' - '1' '$msg_group: $group_name' + '1' '$msg_group: $_group_name' '-' '$msg_password: -----' - '-' '$msg_group_id: $group_gid' - '-' '$msg_group_members: $group_members' + '-' '$msg_group_id: $_group_gid' + '-' '$msg_group_members: $_group_members' " # END-QUOTE local height width rows @@ -521,12 +546,20 @@ f_dialog_menu_group_edit() local defaultitem="$1" local hline="$hline_arrows_tab_enter" + # Localize potentially hostile variables and escape their values + # to the local variable (see f_shell_escape() of `strings.subr') + local var + for var in gid members name; do + local _group_$var + eval f_shell_escape \"\$group_$var\" _group_$var + done + menu_list=" 'X' '$msg_save/$msg_exit' - '1' '$msg_group: $group_name' + '1' '$msg_group: $_group_name' '2' '$msg_password: -----' - '3' '$msg_group_id: $group_gid' - '4' '$msg_group_members: $group_members' + '3' '$msg_group_id: $_group_gid' + '4' '$msg_group_members: $_group_members' " # END-QUOTE local height width rows From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 03:42:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC7503AF; Fri, 14 Mar 2014 03:42:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 989867CC; Fri, 14 Mar 2014 03:42:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E3g61D055680; Fri, 14 Mar 2014 03:42:06 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E3g5r7055673; Fri, 14 Mar 2014 03:42:05 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201403140342.s2E3g5r7055673@svn.freebsd.org> From: Devin Teske Date: Fri, 14 Mar 2014 03:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263150 - in head/usr.sbin/bsdconfig: share usermgmt usermgmt/include usermgmt/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 03:42:06 -0000 Author: dteske Date: Fri Mar 14 03:42:05 2014 New Revision: 263150 URL: http://svnweb.freebsd.org/changeset/base/263150 Log: Rewrite usermgmt -- hooking it into the scripting system with dispatch commands addUser, deleteUser, and editUser. Getting rid of the awkward- to-use `userinput' bolt-on which Ron and I talked about rewriting. Added: head/usr.sbin/bsdconfig/usermgmt/share/user.subr (contents, props changed) Deleted: head/usr.sbin/bsdconfig/usermgmt/userinput Modified: head/usr.sbin/bsdconfig/share/script.subr head/usr.sbin/bsdconfig/share/variable.subr head/usr.sbin/bsdconfig/usermgmt/Makefile head/usr.sbin/bsdconfig/usermgmt/include/messages.subr head/usr.sbin/bsdconfig/usermgmt/share/Makefile head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr head/usr.sbin/bsdconfig/usermgmt/useradd head/usr.sbin/bsdconfig/usermgmt/userdel head/usr.sbin/bsdconfig/usermgmt/useredit Modified: head/usr.sbin/bsdconfig/share/script.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/script.subr Fri Mar 14 03:37:08 2014 (r263149) +++ head/usr.sbin/bsdconfig/share/script.subr Fri Mar 14 03:42:05 2014 (r263150) @@ -38,6 +38,7 @@ f_include $BSDCFG_SHARE/mustberoot.subr f_include $BSDCFG_SHARE/networking/services.subr f_include $BSDCFG_SHARE/packages/packages.subr f_include $BSDCFG_SHARE/usermgmt/group.subr +f_include $BSDCFG_SHARE/usermgmt/user.subr f_include $BSDCFG_SHARE/variable.subr ############################################################ GLOBALS @@ -204,6 +205,11 @@ f_resword_new addGroup f_group_add f_resword_new deleteGroup f_group_delete f_resword_new editGroup f_group_edit +# usermgmt/user.subr +f_resword_new addUser f_user_add +f_resword_new deleteUser f_user_delete +f_resword_new editUser f_user_edit + # variable.subr f_resword_new installVarDefaults f_variable_set_defaults f_resword_new dumpVariables f_dump_variables Modified: head/usr.sbin/bsdconfig/share/variable.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/variable.subr Fri Mar 14 03:37:08 2014 (r263149) +++ head/usr.sbin/bsdconfig/share/variable.subr Fri Mar 14 03:42:05 2014 (r263150) @@ -283,6 +283,21 @@ f_variable_new VAR_SLOW_ETHER slowEther f_variable_new VAR_TRY_DHCP tryDHCP f_variable_new VAR_TRY_RTSOL tryRTSOL f_variable_new VAR_UFS_PATH ufs +f_variable_new VAR_USER user +f_variable_new VAR_USER_ACCOUNT_EXPIRE userAccountExpire +f_variable_new VAR_USER_DOTFILES_CREATE userDotfilesCreate +f_variable_new VAR_USER_GECOS userGecos +f_variable_new VAR_USER_GID userGid +f_variable_new VAR_USER_GROUPS userGroups +f_variable_new VAR_USER_GROUP_DELETE userGroupDelete +f_variable_new VAR_USER_HOME userHome +f_variable_new VAR_USER_HOME_CREATE userHomeCreate +f_variable_new VAR_USER_HOME_DELETE userHomeDelete +f_variable_new VAR_USER_LOGIN_CLASS userLoginClass +f_variable_new VAR_USER_PASSWORD userPassword +f_variable_new VAR_USER_PASSWORD_EXPIRE userPasswordExpire +f_variable_new VAR_USER_SHELL userShell +f_variable_new VAR_USER_UID userUid f_variable_new VAR_ZFSINTERACTIVE zfsInteractive # Modified: head/usr.sbin/bsdconfig/usermgmt/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/Makefile Fri Mar 14 03:37:08 2014 (r263149) +++ head/usr.sbin/bsdconfig/usermgmt/Makefile Fri Mar 14 03:42:05 2014 (r263150) @@ -8,8 +8,7 @@ FILESDIR= ${LIBEXECDIR}/bsdconfig/070.us FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} -SCRIPTS= groupadd groupdel groupedit useradd userdel useredit \ - userinput usermgmt +SCRIPTS= groupadd groupdel groupedit useradd userdel useredit usermgmt beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Modified: head/usr.sbin/bsdconfig/usermgmt/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/include/messages.subr Fri Mar 14 03:37:08 2014 (r263149) +++ head/usr.sbin/bsdconfig/usermgmt/include/messages.subr Fri Mar 14 03:42:05 2014 (r263150) @@ -33,7 +33,7 @@ hline_arrows_tab_enter="Press arrows, TA hline_num_arrows_tab_enter="Use numbers, arrows, TAB or ENTER" hline_num_tab_enter="Use numbers, TAB or ENTER" msg_account_does_not_expire="Account does not expire" -msg_account_expires_in_how_many_days="Account expires in how many days?" +msg_account_expire_manual_edit="Enter account expiration time. Format is one of:\n\n a) decimal for UNIX time since %s\n b) dd-mmm-yy[yy] for day, month, and 2- or 4-digit year\n c) +n[mhdwoy] for relative time from current date\n\nNOTE: Value of zero disables expiration." msg_account_expires_on="Account Expires on" msg_add="Add" msg_add_group="Add Group" @@ -56,6 +56,7 @@ msg_edit_group="Edit/View Group" msg_edit_login="Edit/View Login" msg_edit_view="Edit/View" msg_enter_group_members_manually="Enter Group Members manually" +msg_enter_groups_manually="Enter Groups manually" msg_enter_number_of_days_into_the_future="Enter number of days into the future" msg_enter_value_manually="Edit value manually" msg_error="ERROR!" @@ -74,9 +75,8 @@ msg_group_not_found="%s: Group not found msg_group_password="Group Password" msg_group_passwords_do_not_match="Group Passwords do not match." msg_group_updated="Group Updated" +msg_groups="Groups" msg_home_directory="Home Directory" -msg_invalid_number_of_days="Invalid number of days." -msg_invalid_number_of_seconds="Invalid number of seconds." msg_login="Login" msg_login_added="Login Added" msg_login_already_used="%s: Login is already used." @@ -85,25 +85,28 @@ msg_login_deleted="Login Deleted" msg_login_is_empty="Login is empty." msg_login_management="Login/Group Management" msg_login_must_start_with_letter="Login must start with a letter." -msg_login_not_found="Login not found." +msg_login_not_found="%s: Login not found." msg_login_updated="Login Updated" msg_member_of_groups="Member of Groups" msg_n_a="N/A" msg_no="No" msg_no_group_specified="No group specified!" +msg_no_user_specified="No user specified!" msg_number_of_seconds_since_epoch="Number of seconds since the Epoch\n(1 = %s)\nNULL or zero to disable:" msg_ok="OK" msg_password="Password" msg_password_does_not_expire="Password does not expire" -msg_password_expires_in_how_many_days="Password expires in how many days?" +msg_password_expire_manual_edit="Enter password expiration time. Format is one of:\n\n a) decimal for UNIX time since %s\n b) dd-mmm-yy[yy] for day, month, and 2- or 4-digit year\n c) +n[mhdwoy] for relative time from current date\n\nNOTE: Value of zero disables expiration." msg_password_expires_on="Password Expires on" msg_passwords_do_not_match="Passwords do not match." msg_please_enter_a_group_name="Please enter a group name!" +msg_please_enter_a_user_name="Please enter a user name!" msg_reenter_group_password="Re-enter Group Password" msg_reenter_password="Re-enter Password" msg_save="Save" msg_save_exit_or_cancel="Choose Save/Exit when finished or Cancel." msg_select_group_members_from_list="Select Group Members from a list" +msg_select_groups_from_list="Select Groups from a list" msg_select_login_shell="Select Login Shell" msg_separated_by_commas="Separated by commas" msg_shell="Shell" Modified: head/usr.sbin/bsdconfig/usermgmt/share/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/Makefile Fri Mar 14 03:37:08 2014 (r263149) +++ head/usr.sbin/bsdconfig/usermgmt/share/Makefile Fri Mar 14 03:42:05 2014 (r263150) @@ -3,7 +3,7 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/bsdconfig/usermgmt -FILES= group.subr group_input.subr user_input.subr +FILES= group.subr group_input.subr user.subr user_input.subr beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Added: head/usr.sbin/bsdconfig/usermgmt/share/user.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/usermgmt/share/user.subr Fri Mar 14 03:42:05 2014 (r263150) @@ -0,0 +1,1184 @@ +if [ ! "$_USERMGMT_USER_SUBR" ]; then _USERMGMT_USER_SUBR=1 +# +# Copyright (c) 2012 Ron McDowell +# Copyright (c) 2012-2014 Devin Teske +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." usermgmt/user.subr +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/strings.subr +f_include $BSDCFG_SHARE/usermgmt/group_input.subr +f_include $BSDCFG_SHARE/usermgmt/user_input.subr + +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt" +f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr + +############################################################ CONFIGURATION + +# set some reasonable defaults if /etc/adduser.conf does not exist. +[ -f /etc/adduser.conf ] && f_include /etc/adduser.conf +: ${defaultclass:=""} +: ${defaultshell:="/bin/sh"} +: ${homeprefix:="/home"} +: ${passwdtype:="yes"} +: ${udotdir:="/usr/share/skel"} +: ${uexpire:=""} + # Default account expire time. Format is similar to upwexpire variable. +: ${ugecos:="User &"} +: ${upwexpire:=""} + # The default password expiration time. Format of the date is either a + # UNIX time in decimal, or a date in dd-mmm-yy[yy] format, where dd is + # the day, mmm is the month in either numeric or alphabetic format, and + # yy[yy] is either a two or four digit year. This variable also accepts + # a relative date in the form of n[mhdwoy] where n is a decimal, octal + # (leading 0) or hexadecimal (leading 0x) digit followed by the number + # of Minutes, Hours, Days, Weeks, Months or Years from the current date + # at which the expiration time is to be set. + +# +# uexpire and upwexpire from adduser.conf(5) differ only slightly from what +# pw(8) accepts as `date' argument(s); pw(8) requires a leading `+' for the +# relative date syntax (n[mhdwoy]). +# +case "$uexpire" in *[mhdwoy]) + f_isinteger "${uexpire%[mhdwoy]}" && uexpire="+$uexpire" +esac +case "$upwexpire" in *[mhdwoy]) + f_isinteger "${upwexpire%[mhdwoy]}" && upwexpire="+$upwexpire" +esac + +############################################################ FUNCTIONS + +# f_user_create_homedir $user +# +# Create home directory for $user. +# +f_user_create_homedir() +{ + local funcname=f_user_create_homedir + local user="$1" + + [ "$user" ] || return $FAILURE + + local user_account_expire user_class user_gecos user_gid user_home_dir + local user_member_groups user_name user_password user_password_expire + local user_shell user_uid # Variables created by f_input_user() below + f_input_user "$user" || return $FAILURE + + f_dprintf "Creating home directory \`%s' for user \`%s'" \ + "$user_home_dir" "$user" + + local _user_gid _user_home_dir _user_uid + f_shell_escape "$user_gid" _user_gid + f_shell_escape "$user_home_dir" _user_home_dir + f_shell_escape "$user_uid" _user_uid + f_eval_catch $funcname mkdir "mkdir -p '%s'" "$_user_home_dir" || + return $FAILURE + f_eval_catch $funcname chown "chown '%i:%i' '%s'" \ + "$_user_uid" "$_user_gid" "$_user_home_dir" || return $FAILURE +} + +# f_user_copy_dotfiles $user +# +# Copy `skel' dot-files from $udotdir (global inherited from /etc/adduser.conf) +# to the home-directory of $user. Attempts to create the home-directory first +# if it doesn't exist. +# +f_user_copy_dotfiles() +{ + local funcname=f_user_copy_dotfiles + local user="$1" + + [ "$udotdir" ] || return $FAILURE + [ "$user" ] || return $FAILURE + + local user_account_expire user_class user_gecos user_gid user_home_dir + local user_member_groups user_name user_password user_password_expire + local user_shell user_uid # Variables created by f_input_user() below + f_input_user "$user" || return $FAILURE + + f_dprintf "Copying dot-files from \`%s' to \`%s'" \ + "$udotdir" "$user_home_dir" + + # Attempt to create the home directory if it doesn't exist + [ -d "$user_home_dir" ] || + f_user_create_homedir "$user" || return $FAILURE + + local _user_gid _user_home_dir _user_uid + f_shell_escape "$user_gid" _user_gid + f_shell_escape "$user_home_dir" _user_home_dir + f_shell_escape "$user_uid" _user_uid + + local - # Localize `set' to this function + set +f # Enable glob pattern-matching for paths + cd "$udotdir" || return $FAILURE + + local _file file retval + for file in dot.*; do + [ -e "$file" ] || continue # no-match + + f_shell_escape "$file" "_file" + f_eval_catch $funcname cp "cp -n '%s' '%s'" \ + "$_file" "$_user_home_dir/${_file#dot}" + retval=$? + [ $retval -eq $SUCCESS ] || break + f_eval_catch $funcname chown \ + "chown -h '%i:%i' '%s'" \ + "$_user_uid" "$_user_gid" \ + "$_user_home_dir/${_file#dot}" + retval=$? + [ $retval -eq $SUCCESS ] || break + done + + cd - + return $retval +} + +# f_user_add [$user] +# +# Create a login account. If both $user (as a first argument) and $VAR_USER are +# unset or NULL and we are running interactively, prompt the end-user to enter +# the name of a new login account and (if $VAR_NO_CONFIRM is unset or NULL) +# prompt the end-user to answer some questions about the new account. Variables +# that can be used to script user input: +# +# VAR_USER [Optional if running interactively] +# The login to add. Ignored if given non-NULL first-argument. +# VAR_USER_ACCOUNT_EXPIRE [Optional] +# The account expiration time. Format is similar to +# VAR_USER_PASSWORD_EXPIRE variable below. Default is to never +# expire the account. +# VAR_USER_DOTFILES_CREATE [Optional] +# If non-NULL, populate the user's home directory with the +# template files found in $udotdir (`/usr/share/skel' default). +# VAR_USER_GECOS [Optional] +# Often the full name of the account holder. Default is NULL. +# VAR_USER_GID [Optional] +# Numerical primary-group ID to use. If NULL or unset, the group +# ID is automatically chosen. +# VAR_USER_GROUPS [Optional] +# Comma-separated list of additional groups to which the user is +# a member of. Default is NULL (no additional groups). +# VAR_USER_HOME [Optional] +# The home directory to set. If NULL or unset, the home directory +# is automatically calculated. +# VAR_USER_HOME_CREATE [Optional] +# If non-NULL, create the user's home directory if it doesn't +# already exist. +# VAR_USER_LOGIN_CLASS [Optional] +# Login class to use when creating the login. Default is NULL. +# VAR_USER_PASSWORD [Optional] +# Unencrypted password to use. If unset or NULL, password +# authentication for the login is disabled. +# VAR_USER_PASSWORD_EXPIRE [Optional] +# The password expiration time. Format of the date is either a +# UNIX time in decimal, or a date in dd-mmm-yy[yy] format, where +# dd is the day, mmm is the month in either numeric or alphabetic +# format, and yy[yy] is either a two or four digit year. This +# variable also accepts a relative date in the form of +n[mhdwoy] +# where n is a decimal, octal (leading 0) or hexadecimal (leading +# 0x) digit followed by the number of Minutes, Hours, Days, +# Weeks, Months or Years from the current date at which the +# expiration time is to be set. Default is to never expire the +# account password. +# VAR_USER_SHELL [Optional] +# Path to login shell to use. Default is `/bin/sh'. +# VAR_USER_UID [Optional] +# Numerical user ID to use. If NULL or unset, the user ID is +# automatically chosen. +# +# Returns success if the user account was successfully created. +# +f_user_add() +{ + local funcname=f_user_add + local title # Calculated below + local alert=f_show_msg no_confirm= + + f_getvar $VAR_NO_CONFIRM no_confirm + [ "$no_confirm" ] && alert=f_show_info + + local input + f_getvar 3:-\$$VAR_USER input "$1" + + # + # NB: pw(8) has a ``feature'' wherein `-n name' can be taken as UID + # instead of name. Work-around is to also pass `-u UID' at the same + # time (any UID will do; but `-1' is appropriate for this context). + # + if [ "$input" ] && f_quietly pw usershow -n "$input" -u -1; then + f_show_err "$msg_login_already_used" "$input" + return $FAILURE + fi + + local user_name="$input" + while f_interactive && [ ! "$user_name" ]; do + f_dialog_input_name user_name "$user_name" || + return $SUCCESS + [ "$user_name" ] || + f_show_err "$msg_please_enter_a_user_name" + done + if [ ! "$user_name" ]; then + f_show_err "$msg_no_user_specified" + return $FAILURE + fi + + local user_account_expire user_class user_gecos user_gid user_home_dir + local user_member_groups user_password user_password_expire user_shell + local user_uid user_dotfiles_create= user_home_create= + f_getvar $VAR_USER_ACCOUNT_EXPIRE-\$uexpire user_account_expire + f_getvar $VAR_USER_DOTFILES_CREATE:+\$msg_yes user_dotfiles_create + f_getvar $VAR_USER_GECOS-\$ugecos user_gecos + f_getvar $VAR_USER_GID user_gid + f_getvar $VAR_USER_GROUPS user_member_groups + f_getvar $VAR_USER_HOME:-\${homeprefix%/}/\$user_name \ + user_home_dir + f_getvar $VAR_USER_HOME_CREATE:+\$msg_yes user_home_create + f_getvar $VAR_USER_LOGIN_CLASS-\$defaultclass user_class + f_getvar $VAR_USER_PASSWORD user_password + f_getvar $VAR_USER_PASSWORD_EXPIRE-\$upwexpire user_password_expire + f_getvar $VAR_USER_SHELL-\$defaultshell user_shell + f_getvar $VAR_USER_UID user_uid + + # Create home-dir if no script-override and does not exist + f_isset $VAR_USER_HOME_CREATE || [ -d "$user_home_dir" ] || + user_home_create="$msg_yes" + # Copy dotfiles if home-dir creation is desired, does not yet exist, + # and no script-override has been set + f_isset $VAR_USER_DOTFILES_CREATE || + [ "$user_home_create" != "$msg_yes" ] || + [ -d "$user_home_dir" ] || user_dotfiles_create="$msg_yes" + # Create home-dir if copying dotfiles but home-dir does not exist + [ "$user_dotfiles_create" -a ! -d "$user_home_dir" ] && + user_home_create="$msg_yes" + + # Set flags for meaningful NULL values if-provided + local no_account_expire= no_password_expire= null_gecos= null_members= + local user_password_disable= + f_isset $VAR_USER_ACCOUNT_EXPIRE && + [ ! "$user_account_expire" ] && no_account_expire=1 + f_isset $VAR_USER_GECOS && + [ ! "$user_gecos" ] && null_gecos=1 + f_isset $VAR_USER_GROUPS && + [ ! "$user_member_groups" ] && null_members=1 + f_isset $VAR_USER_PASSWORD && + [ ! "$user_password" ] && user_password_disable=1 + f_isset $VAR_USER_PASSWORD_EXPIRE && + [ ! "$user_password_expire" ] && no_password_expire=1 + + if f_interactive && [ ! "$no_confirm" ]; then + f_dialog_noyes \ + "$msg_use_default_values_for_all_account_details" + retval=$? + if [ $retval -eq $DIALOG_ESC ]; then + return $SUCCESS + elif [ $retval -ne $DIALOG_OK ]; then + # + # Ask series of questions to pre-fill the editor screen + # + # Defaults used in each dialog should allow the user to + # simply hit ENTER to proceed, because cancelling any + # single dialog will cause them to be returned to the + # previous menu. + # + + f_dialog_input_gecos user_gecos "$user_gecos" || + return $FAILURE + if [ "$passwdtype" = "yes" ]; then + f_dialog_input_password user_password \ + user_password_disable || + return $FAILURE + fi + f_dialog_input_uid user_uid "$user_uid" || + return $FAILURE + f_dialog_input_gid user_gid "$user_gid" || + return $FAILURE + f_dialog_input_member_groups user_member_groups \ + "$user_member_groups" || return $FAILURE + f_dialog_input_class user_class "$user_class" || + return $FAILURE + f_dialog_input_expire_password user_password_expire \ + "$user_password_expire" || return $FAILURE + f_dialog_input_expire_account user_account_expire \ + "$user_account_expire" || return $FAILURE + f_dialog_input_home_dir user_home_dir \ + "$user_home_dir" || return $FAILURE + if [ ! -d "$user_home_dir" ]; then + f_dialog_input_home_create user_home_create || + return $FAILURE + if [ "$user_home_create" = "$msg_yes" ]; then + f_dialog_input_dotfiles_create \ + user_dotfiles_create || + return $FAILURE + fi + fi + f_dialog_input_shell user_shell "$user_shell" || + return $FAILURE + fi + fi + + # + # Loop until the user decides to Exit, Cancel, or presses ESC + # + title="$msg_add $msg_user: $user_name" + if f_interactive; then + local mtag retval defaultitem= + while :; do + f_dialog_title "$title" + f_dialog_menu_user_add "$defaultitem" + retval=$? + f_dialog_title_restore + f_dialog_menutag_fetch mtag + f_dprintf "retval=%u mtag=[%s]" $retval "$mtag" + defaultitem="$mtag" + + # Return if user either pressed ESC or chose Cancel/No + [ $retval -eq $DIALOG_OK ] || return $FAILURE + + case "$mtag" in + X) # Add/Exit + local var + for var in account_expire class gecos gid home_dir \ + member_groups name password_expire shell uid \ + ; do + local _user_$var + eval f_shell_escape \"\$user_$var\" _user_$var + done + + local cmd="pw useradd -n '$_user_name'" + [ "$user_gid" ] && cmd="$cmd -g '$_user_gid'" + [ "$user_shell" ] && cmd="$cmd -s '$_user_shell'" + [ "$user_uid" ] && cmd="$cmd -u '$_user_uid'" + [ "$user_account_expire" -o \ + "$no_account_expire" ] && + cmd="$cmd -e '$_user_account_expire'" + [ "$user_class" -o "$null_class" ] && + cmd="$cmd -L '$_user_class'" + [ "$user_gecos" -o "$null_gecos" ] && + cmd="$cmd -c '$_user_gecos'" + [ "$user_home_dir" ] && + cmd="$cmd -d '$_user_home_dir'" + [ "$user_member_groups" ] && + cmd="$cmd -G '$_user_member_groups'" + [ "$user_password_expire" -o \ + "$no_password_expire" ] && + cmd="$cmd -p '$_user_password_expire'" + + # Execute the command + if [ "$user_password_disable" ]; then + f_eval_catch $funcname pw '%s -h -' "$cmd" + elif [ "$user_password" ]; then + echo "$user_password" | f_eval_catch \ + $funcname pw '%s -h 0' "$cmd" + else + f_eval_catch $funcname pw '%s' "$cmd" + fi || continue + + # Create home directory if desired + [ "${user_home_create:-$msg_no}" != "$msg_no" ] && + f_user_create_homedir "$user_name" + + # Copy dotfiles if desired + [ "${user_dotfiles_create:-$msg_no}" != \ + "$msg_no" ] && f_user_copy_dotfiles "$user_name" + + break # to success + ;; + 1) # Login (prompt for new login name) + f_dialog_input_name input "$user_name" || + continue + if f_quietly pw usershow -n "$input" -u -1; then + f_show_err "$msg_login_already_used" "$input" + continue + fi + user_name="$input" + title="$msg_add $msg_user: $user_name" + user_home_dir="${homeprefix%/}/$user_name" + ;; + 2) # Full Name + f_dialog_input_gecos user_gecos "$user_gecos" && + [ ! "$user_gecos" ] && null_gecos=1 ;; + 3) # Password + f_dialog_input_password \ + user_password user_password_disable ;; + 4) # User ID + f_dialog_input_uid user_uid "$user_uid" ;; + 5) # Group ID + f_dialog_input_gid user_gid "$user_gid" ;; + 6) # Member of Groups + f_dialog_input_member_groups \ + user_member_groups "$user_member_groups" && + [ ! "$user_member_groups" ] && + null_members=1 ;; + 7) # Login Class + f_dialog_input_class user_class "$user_class" && + [ ! "$user_class" ] && null_class=1 ;; + 8) # Password Expires On + f_dialog_input_expire_password \ + user_password_expire "$user_password_expire" && + [ ! "$user_password_expire" ] && + no_password_expire=1 ;; + 9) # Account Expires On + f_dialog_input_expire_account \ + user_account_expire "$user_account_expire" && + [ ! "$user_account_expire" ] && + no_account_expire=1 ;; + A) # Home Directory + f_dialog_input_home_dir \ + user_home_dir "$user_home_dir" ;; + B) # Shell + f_dialog_input_shell user_shell "$user_shell" ;; + C) # Create Home Directory? + if [ "${user_home_create:-$msg_no}" != "$msg_no" ] + then + user_home_create="$msg_no" + else + user_home_create="$msg_yes" + fi ;; + D) # Create Dotfiles? + if [ "${user_dotfiles_create:-$msg_no}" != \ + "$msg_no" ] + then + user_dotfiles_create="$msg_no" + else + user_dotfiles_create="$msg_yes" + fi ;; + esac + done + else + local var + for var in account_expire class gecos gid home_dir \ + member_groups name password_expire shell uid \ + ; do + local _user_$var + eval f_shell_escape \"\$user_$var\" _user_$var + done + + # Form the command + local cmd="pw useradd -n '$_user_name'" + [ "$user_gid" ] && cmd="$cmd -g '$_user_gid'" + [ "$user_home_dir" ] && cmd="$cmd -d '$_user_home_dir'" + [ "$user_shell" ] && cmd="$cmd -s '$_user_shell'" + [ "$user_uid" ] && cmd="$cmd -u '$_user_uid'" + [ "$user_account_expire" -o "$no_account_expire" ] && + cmd="$cmd -e '$_user_account_expire'" + [ "$user_class" -o "$null_class" ] && + cmd="$cmd -L '$_user_class'" + [ "$user_gecos" -o "$null_gecos" ] && + cmd="$cmd -c '$_user_gecos'" + [ "$user_member_groups" -o "$null_members" ] && + cmd="$cmd -G '$_user_member_groups'" + [ "$user_password_expire" -o "$no_password_expire" ] && + cmd="$cmd -p '$_user_password_expire'" + + # Execute the command + local retval err + if [ "$user_password_disable" ]; then + f_eval_catch -k err $funcname pw '%s -h -' "$cmd" + elif [ "$user_password" ]; then + err=$( echo "$user_password" | f_eval_catch -de \ + $funcname pw '%s -h 0' "$cmd" 2>&1 ) + else + f_eval_catch -k err $funcname pw '%s' "$cmd" + fi + retval=$? + if [ $retval -ne $SUCCESS ]; then + f_show_err "%s" "$err" + return $retval + fi + + # Create home directory if desired + [ "${user_home_create:-$msg_no}" != "$msg_no" ] && + f_user_create_homedir "$user_name" + + # Copy dotfiles if desired + [ "${user_dotfiles_create:-$msg_no}" != "$msg_no" ] && + f_user_copy_dotfiles "$user_name" + fi + + f_dialog_title "$title" + $alert "$msg_login_added" + f_dialog_title_restore + [ "$no_confirm" -a "$USE_DIALOG" ] && sleep 1 + + return $SUCCESS +} + +# f_user_delete [$user] +# +# Delete a user. If both $user (as a first argument) and $VAR_USER are unset or +# NULL and we are running interactively, prompt the end-user to select a user +# account from a list of those available. Variables that can be used to script +# user input: +# +# VAR_USER [Optional if running interactively] +# The user to delete. Ignored if given non-NULL first-argument. +# +# Returns success if the user account was successfully deleted. +# +f_user_delete() +{ + local funcname=f_user_delete + local title # Calculated below + local alert=f_show_msg no_confirm= + + f_getvar $VAR_NO_CONFIRM no_confirm + [ "$no_confirm" ] && alert=f_show_info + + local input + f_getvar 3:-\$$VAR_USER input "$1" + + if f_interactive && [ ! "$input" ]; then + f_dialog_menu_user_list || return $SUCCESS + f_dialog_menutag_fetch input + [ "$input" = "X $msg_exit" ] && return $SUCCESS + elif [ ! "$input" ]; then + f_show_err "$msg_no_user_specified" + return $FAILURE + fi + + local user_account_expire user_class user_gecos user_gid user_home_dir + local user_member_groups user_name user_password user_password_expire + local user_shell user_uid # Variables created by f_input_user() below + if [ "$input" ] && ! f_input_user "$input"; then + f_show_err "$msg_login_not_found" "$input" + return $FAILURE + fi + + local user_group_delete= user_home_delete= + f_getvar $VAR_USER_GROUP_DELETE:-\$msg_no user_group_delete + f_getvar $VAR_USER_HOME_DELETE:-\$msg_no user_home_delete + + # Attempt to translate user GID into a group name + local user_group + if user_group=$( pw groupshow -g "$user_gid" 2> /dev/null ); then + user_group="${user_group%%:*}" + # Default to delete the primary group if no script-override and + # exists with same name as the user (same logic used by pw(8)) + f_isset $VAR_USER_GROUP_DELETE || + [ "$user_group" != "$user_name" ] || + user_group_delete="$msg_yes" + fi + + # + # Loop until the user decides to Exit, Cancel, or presses ESC + # + title="$msg_delete $msg_user: $user_name" + if f_interactive; then + local mtag retval defaultitem= + while :; do + f_dialog_title "$title" + f_dialog_menu_user_delete "$user_name" "$defaultitem" + retval=$? + f_dialog_title_restore + f_dialog_menutag_fetch mtag + f_dprintf "retval=%u mtag=[%s]" $retval "$mtag" + defaultitem="$mtag" + + # Return if user either pressed ESC or chose Cancel/No + [ $retval -eq $DIALOG_OK ] || return $FAILURE + + case "$mtag" in + X) # Delete/Exit + f_shell_escape "$user_uid" _user_uid + + # Save group information in case pw(8) deletes it + # and we wanted to keep it (to be restored below) + if [ "${user_group_delete:-$msg_no}" = "$msg_no" ] + then + local v vars="gid members name password" + for v in $vars; do local group_$var; done + f_input_group "$user_group" + + # Remove user-to-delete from group members + # NB: Otherwise group restoration could fail + local name length=0 _members= + while [ $length -ne ${#group_members} ]; do + name="${group_members%%,*}" + [ "$name" != "$user_name" ] && + _members="$_members,$name" + length=${#group_members} + group_members="${group_members#*,}" + done + group_members="${_members#,}" + + # Create escaped variables for f_eval_catch() + for v in $vars; do + local _group_$v + eval f_shell_escape \ + \"\$group_$v\" _group_$v + done + fi + + # Delete the user (if asked to delete home directory + # display [X]dialog notification to show activity) + local cmd="pw userdel -u '$_user_uid'" + if [ "$user_home_delete" = "$msg_yes" -a \ + "$USE_XDIALOG" ] + then + local err + err=$( + exec 9>&1 + f_eval_catch -e $funcname pw \ + "%s -r" "$cmd" \ + >&$DIALOG_TERMINAL_PASSTHRU_FD 2>&9 | + f_xdialog_info \ + "$msg_deleting_home_directory" + ) + [ ! "$err" ] + elif [ "$user_home_delete" = "$msg_yes" ]; then + f_dialog_info "$msg_deleting_home_directory" + f_eval_catch $funcname pw '%s -r' "$cmd" + else + f_eval_catch $funcname pw '%s' "$cmd" + fi || continue + + # + # pw(8) may conditionally delete the primary group, + # which may not be what is desired. + # + # If we've been asked to delete the group and pw(8) + # chose not to, delete it. Otherwise, if we're told + # to NOT delete the group, we may need to restore it + # since pw(8) doesn't have a flag to tell `userdel' + # to not delete the group. + # + # NB: If primary group and user have different names + # the group may not have been deleted (again, see PR + # 169471 and SVN r263114 for details). + # + if [ "${user_group_delete:-$msg_no}" != "$msg_no" ] + then + f_quietly pw groupshow -g "$user_gid" && + f_eval_catch $funcname pw \ + "pw groupdel -g '%s'" "$_user_gid" + elif ! f_quietly pw groupshow -g "$group_gid" && + [ "$group_name" -a "$group_gid" ] + then + # Group deleted by pw(8), so restore it + local cmd="pw groupadd -n '$_group_name'" + cmd="$cmd -g '$_group_gid'" + cmd="$cmd -M '$_group_members'" + + # Get the group password (pw(8) groupshow does + # NOT provide this (even if running privileged) + local group_password_enc + group_password_enc=$( getent group | awk -F: ' + !/^[[:space:]]*(#|$)/ && \ + $1 == ENVIRON["group_name"] && \ + $3 == ENVIRON["group_gid"] && \ + $4 == ENVIRON["group_members"] \ + { print $2; exit } + ' ) + if [ "$group_password_enc" ]; then + echo "$group_password_enc" | + f_eval_catch $funcname \ + pw '%s -H 0' "$cmd" + else + f_eval_catch $funcname \ + pw '%s -h -' "$cmd" + fi + fi + + break # to success + ;; + 1) # Login (select different login from list) + f_dialog_menu_user_list "$user_name" || continue + f_dialog_menutag_fetch mtag + + [ "$mtag" = "X $msg_exit" ] && continue + + if ! f_input_user "$mtag"; then + f_show_err "$msg_login_not_found" "$mtag" + # Attempt to fall back to previous selection + f_input_user "$input" || return $FAILURE + else + input="$mtag" + fi + title="$msg_delete $msg_user: $user_name" + ;; + C) # Delete Primary Group? + if [ "${user_group_delete:-$msg_no}" != "$msg_no" ] + then + user_group_delete="$msg_no" + else + user_group_delete="$msg_yes" + fi ;; + D) # Delete Home Directory? + if [ "${user_home_delete:-$msg_no}" != "$msg_no" ] + then + user_home_delete="$msg_no" + else + user_home_delete="$msg_yes" + fi ;; + esac + done + else + f_shell_escape "$user_uid" _user_uid + + # Save group information in case pw(8) deletes it + # and we wanted to keep it (to be restored below) + if [ "${user_group_delete:-$msg_no}" = "$msg_no" ]; then + local v vars="gid members name password" + for v in $vars; do local group_$v; done + f_input_group "$user_group" + + # Remove user we're about to delete from group members + # NB: Otherwise group restoration could fail + local name length=0 _members= + while [ $length -ne ${#group_members} ]; do + name="${group_members%%,*}" + [ "$name" != "$user_name" ] && + _members="$_members,$name" + length=${#group_members} + group_members="${group_members#*,}" + done + group_members="${_members#,}" + + # Create escaped variables for later f_eval_catch() + for v in $vars; do + local _group_$v + eval f_shell_escape \"\$group_$v\" _group_$v + done + fi + + # Delete the user (if asked to delete home directory + # display [X]dialog notification to show activity) + local err cmd="pw userdel -u '$_user_uid'" + if [ "$user_home_delete" = "$msg_yes" -a "$USE_XDIALOG" ]; then + err=$( + exec 9>&1 + f_eval_catch -de $funcname pw \ + '%s -r' "$cmd" 2>&9 | f_xdialog_info \ + "$msg_deleting_home_directory" + ) + [ ! "$err" ] + elif [ "$user_home_delete" = "$msg_yes" ]; then + f_dialog_info "$msg_deleting_home_directory" + f_eval_catch -k err $funcname pw '%s -r' "$cmd" + else + f_eval_catch -k err $funcname pw '%s' "$cmd" + fi + local retval=$? + if [ $retval -ne $SUCCESS ]; then + f_show_err "%s" "$err" + return $retval + fi + + # + # pw(8) may conditionally delete the primary group, which may + # not be what is desired. + # + # If we've been asked to delete the group and pw(8) chose not + # to, delete it. Otherwise, if we're told to NOT delete the + # group, we may need to restore it since pw(8) doesn't have a + # flag to tell `userdel' to not delete the group. + # + # NB: If primary group and user have different names the group + # may not have been deleted (again, see PR 169471 and SVN + # r263114 for details). + # + if [ "${user_group_delete:-$msg_no}" != "$msg_no" ] + then + f_quietly pw groupshow -g "$user_gid" && + f_eval_catch $funcname pw \ + "pw groupdel -g '%s'" "$_user_gid" + elif ! f_quietly pw groupshow -g "$group_gid" && + [ "$group_name" -a "$group_gid" ] + then + # Group deleted by pw(8), so restore it + local cmd="pw groupadd -n '$_group_name'" + cmd="$cmd -g '$_group_gid'" + cmd="$cmd -M '$_group_members'" + local group_password_enc + group_password_enc=$( getent group | awk -F: ' + !/^[[:space:]]*(#|$)/ && \ + $1 == ENVIRON["group_name"] && \ + $3 == ENVIRON["group_gid"] && \ + $4 == ENVIRON["group_members"] \ + { print $2; exit } + ' ) + if [ "$group_password_enc" ]; then + echo "$group_password_enc" | + f_eval_catch $funcname \ + pw '%s -H 0' "$cmd" + else + f_eval_catch $funcname \ + pw '%s -h -' "$cmd" + fi + fi + fi + + f_dialog_title "$title" + $alert "$msg_login_deleted" + f_dialog_title_restore + [ "$no_confirm" -a "$USE_DIALOG" ] && sleep 1 + + return $SUCCESS +} + +# f_user_edit [$user] +# +# Modify a login account. If both $user (as a first argument) and $VAR_USER are +# unset or NULL and we are running interactively, prompt the end-user to select +# a login account from a list of those available. Variables that can be used to +# script user input: +# +# VAR_USER [Optional if running interactively] +# The login to modify. Ignored if given non-NULL first-argument. +# VAR_USER_ACCOUNT_EXPIRE [Optional] +# The account expiration time. Format is similar to +# VAR_USER_PASSWORD_EXPIRE variable below. If unset, account +# expiry is unchanged. If set but NULL, account expiration is +# disabled (same as setting a value of `0'). +# VAR_USER_DOTFILES_CREATE [Optional] +# If non-NULL, re-populate the user's home directory with the +# template files found in $udotdir (`/usr/share/skel' default). +# VAR_USER_GECOS [Optional] +# Often the full name of the account holder. If unset, the GECOS +# field is unmodified. If set but NULL, the field is blanked. +# VAR_USER_GID [Optional] *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 06:29:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD245105; Fri, 14 Mar 2014 06:29:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 96A747EB; Fri, 14 Mar 2014 06:29:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E6TpYv020983; Fri, 14 Mar 2014 06:29:51 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E6TiCn020942; Fri, 14 Mar 2014 06:29:44 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403140629.s2E6TiCn020942@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 14 Mar 2014 06:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263152 - in head: . etc/mtree include sbin/ifconfig sbin/route share/man/man4 share/man/man7 share/man/man9 sys sys/amd64/amd64 sys/conf sys/i386/i386 sys/kern sys/modules/if_gre sys/m... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 06:29:51 -0000 Author: glebius Date: Fri Mar 14 06:29:43 2014 New Revision: 263152 URL: http://svnweb.freebsd.org/changeset/base/263152 Log: Remove AppleTalk support. AppleTalk was a network transport protocol for Apple Macintosh devices in 80s and then 90s. Starting with Mac OS X in 2000 the AppleTalk was a legacy protocol and primary networking protocol is TCP/IP. The last Mac OS X release to support AppleTalk happened in 2009. The same year routing equipment vendors (namely Cisco) end their support. Thus, AppleTalk won't be supported in FreeBSD 11.0-RELEASE. Deleted: head/sbin/ifconfig/af_atalk.c head/sys/netatalk/ head/sys/security/mac/mac_atalk.c head/tools/regression/netatalk/ head/usr.bin/netstat/atalk.c Modified: head/ObsoleteFiles.inc head/etc/mtree/BSD.include.dist head/include/Makefile head/sbin/ifconfig/Makefile head/sbin/ifconfig/ifconfig.8 head/sbin/route/keywords head/sbin/route/route.8 head/sbin/route/route.c head/share/man/man4/gre.4 head/share/man/man4/netgraph.4 head/share/man/man4/ng_iface.4 head/share/man/man7/hier.7 head/share/man/man9/netisr.9 head/sys/Makefile head/sys/amd64/amd64/machdep.c head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/i386/i386/machdep.c head/sys/kern/Make.tags.inc head/sys/kern/kern_jail.c head/sys/kern/subr_witness.c head/sys/modules/if_gre/Makefile head/sys/modules/if_tun/Makefile head/sys/modules/netgraph/iface/Makefile head/sys/net/if_ethersubr.c head/sys/net/if_fddisubr.c head/sys/net/if_gre.c head/sys/net/if_loop.c head/sys/net/if_spppfr.c head/sys/net/if_tun.c head/sys/net/netisr.h head/sys/netgraph/ng_cisco.c head/sys/netgraph/ng_iface.c head/sys/netgraph/ng_iface.h head/sys/netgraph/ng_ksocket.c head/sys/netinet/ip_gre.c head/sys/pc98/pc98/machdep.c head/sys/security/mac/mac_framework.h head/sys/security/mac/mac_policy.h head/sys/security/mac_biba/mac_biba.c head/sys/security/mac_lomac/mac_lomac.c head/sys/security/mac_mls/mac_mls.c head/sys/security/mac_stub/mac_stub.c head/sys/security/mac_test/mac_test.c head/sys/sys/param.h head/sys/sys/priv.h head/tools/regression/README head/tools/tools/net80211/wlanwatch/wlanwatch.c head/tools/tools/net80211/wlanwds/wlanwds.c head/usr.bin/kdump/kdump.c head/usr.bin/netstat/Makefile head/usr.bin/netstat/if.c head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.1 head/usr.bin/netstat/netstat.h head/usr.bin/netstat/route.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Mar 14 04:35:18 2014 (r263151) +++ head/ObsoleteFiles.inc Fri Mar 14 06:29:43 2014 (r263152) @@ -38,6 +38,18 @@ # xargs -n1 | sort | uniq -d; # done +# 20140314: AppleTalk +OLD_DIRS+=usr/include/netatalk +OLD_FILES+=usr/include/netatalk/aarp.h +OLD_FILES+=usr/include/netatalk/at.h +OLD_FILES+=usr/include/netatalk/at_extern.h +OLD_FILES+=usr/include/netatalk/at_var.h +OLD_FILES+=usr/include/netatalk/ddp.h +OLD_FILES+=usr/include/netatalk/ddp_pcb.h +OLD_FILES+=usr/include/netatalk/ddp_var.h +OLD_FILES+=usr/include/netatalk/endian.h +OLD_FILES+=usr/include/netatalk/phase2.h + # 20140314: Remove IPX/SPX OLD_LIBS+=lib/libipx.so.5 OLD_FILES+=usr/include/netipx/ipx.h Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Fri Mar 14 04:35:18 2014 (r263151) +++ head/etc/mtree/BSD.include.dist Fri Mar 14 06:29:43 2014 (r263152) @@ -257,8 +257,6 @@ .. net80211 .. - netatalk - .. netgraph atm .. Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Fri Mar 14 04:35:18 2014 (r263151) +++ head/include/Makefile Fri Mar 14 06:29:43 2014 (r263152) @@ -36,7 +36,7 @@ PHDRS= sched.h _semaphore.h LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdatomic.h stdint.h \ syslog.h ucontext.h -LDIRS= bsm cam geom net net80211 netatalk netgraph netinet netinet6 \ +LDIRS= bsm cam geom net net80211 netgraph netinet netinet6 \ netipsec netnatm netsmb nfs nfsclient nfsserver sys vm LSUBDIRS= cam/ata cam/scsi \ Modified: head/sbin/ifconfig/Makefile ============================================================================== --- head/sbin/ifconfig/Makefile Fri Mar 14 04:35:18 2014 (r263151) +++ head/sbin/ifconfig/Makefile Fri Mar 14 06:29:43 2014 (r263152) @@ -21,7 +21,6 @@ SRCS+= af_inet.c # IPv4 support .if ${MK_INET6_SUPPORT} != "no" SRCS+= af_inet6.c # IPv6 support .endif -SRCS+= af_atalk.c # AppleTalk support .if ${MK_INET6_SUPPORT} != "no" SRCS+= af_nd6.c # ND6 support .endif Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Fri Mar 14 04:35:18 2014 (r263151) +++ head/sbin/ifconfig/ifconfig.8 Fri Mar 14 06:29:43 2014 (r263152) @@ -158,7 +158,6 @@ The address or protocol families current supported are .Dq inet , .Dq inet6 , -.Dq atalk , and .Dq link . The default if available is @@ -562,42 +561,6 @@ The prefix can also be specified using t See the .Ar address option above for more information. -.\" see -.\" Xr eon 5 . -.\" .It Cm nsellength Ar n -.\" .Pf ( Tn ISO -.\" only) -.\" This specifies a trailing number of bytes for a received -.\" .Tn NSAP -.\" used for local identification, the remaining leading part of which is -.\" taken to be the -.\" .Tn NET -.\" (Network Entity Title). -.\" The default value is 1, which is conformant to US -.\" .Tn GOSIP . -.\" When an ISO address is set in an ifconfig command, -.\" it is really the -.\" .Tn NSAP -.\" which is being specified. -.\" For example, in -.\" .Tn US GOSIP , -.\" 20 hex digits should be -.\" specified in the -.\" .Tn ISO NSAP -.\" to be assigned to the interface. -.\" There is some evidence that a number different from 1 may be useful -.\" for -.\" .Tn AFI -.\" 37 type addresses. -.It Cm range Ar netrange -Under appletalk, set the interface to respond to a -.Ar netrange -of the form -.Ar startnet Ns - Ns Ar endnet . -Appletalk uses this scheme instead of -netmasks though -.Fx -implements it internally as a set of netmasks. .It Cm remove Another name for the .Fl alias @@ -605,10 +568,6 @@ parameter. Introduced for compatibility with .Bsx . -.It Cm phase -The argument following this specifies the version (phase) of the -Appletalk network attached to the interface. -Values of 1 or 2 are permitted. .Sm off .It Cm link Op Cm 0 No - Cm 2 .Sm on Modified: head/sbin/route/keywords ============================================================================== --- head/sbin/route/keywords Fri Mar 14 04:35:18 2014 (r263151) +++ head/sbin/route/keywords Fri Mar 14 06:29:43 2014 (r263152) @@ -4,7 +4,6 @@ 4 6 add -atalk blackhole change cloning Modified: head/sbin/route/route.8 ============================================================================== --- head/sbin/route/route.8 Fri Mar 14 04:35:18 2014 (r263151) +++ head/sbin/route/route.8 Fri Mar 14 06:29:43 2014 (r263152) @@ -144,7 +144,6 @@ will ``flush'' the routing tables of all When the address family may is specified by any of the .Fl osi , .Fl xns , -.Fl atalk , .Fl inet6 , or .Fl inet @@ -255,14 +254,12 @@ if the local or remote addresses change. The optional modifiers .Fl xns , .Fl osi , -.Fl atalk , and .Fl link specify that all subsequent addresses are in the -.Tn XNS , -.Tn OSI , +.Tn XNS or -.Tn AppleTalk +.Tn OSI address families, or are specified as link-level addresses, and the names must be numeric specifications rather than Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Fri Mar 14 04:35:18 2014 (r263151) +++ head/sbin/route/route.c Fri Mar 14 06:29:43 2014 (r263152) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -72,8 +71,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define ATALK_BUF_SIZE 20 - struct fibl { TAILQ_ENTRY(fibl) fl_next; @@ -114,8 +111,6 @@ static struct { static TAILQ_HEAD(fibl_head_t, fibl) fibl_head; -static int atalk_aton(const char *, struct at_addr *); -static char *atalk_ntoa(struct at_addr, char [ATALK_BUF_SIZE]); static void printb(int, const char *); static void flushroutes(int argc, char *argv[]); static int flushroutes_fib(int); @@ -409,9 +404,6 @@ flushroutes(int argc, char *argv[]) af = AF_INET6; break; #endif - case K_ATALK: - af = AF_APPLETALK; - break; case K_LINK: af = AF_LINK; break; @@ -526,7 +518,6 @@ routename(struct sockaddr *sa) { struct sockaddr_dl *sdl; const char *cp; - char atalk_buf[ATALK_BUF_SIZE]; int n; if (!domain_initialized) { @@ -604,12 +595,6 @@ routename(struct sockaddr *sa) break; } #endif - case AF_APPLETALK: - (void)snprintf(rt_line, sizeof(rt_line), "atalk %s", - atalk_ntoa(((struct sockaddr_at *)(void *)sa)->sat_addr, - atalk_buf)); - break; - case AF_LINK: sdl = (struct sockaddr_dl *)(void *)sa; @@ -651,7 +636,6 @@ static const char * netname(struct sockaddr *sa) { struct sockaddr_dl *sdl; - char atalk_buf[ATALK_BUF_SIZE]; int n; #ifdef INET struct netent *np = NULL; @@ -712,13 +696,6 @@ netname(struct sockaddr *sa) return(net_line); } #endif - - case AF_APPLETALK: - (void)snprintf(net_line, sizeof(net_line), "atalk %s", - atalk_ntoa(((struct sockaddr_at *)(void *)sa)->sat_addr, - atalk_buf)); - break; - case AF_LINK: sdl = (struct sockaddr_dl *)(void *)sa; @@ -838,10 +815,6 @@ newroute(int argc, char **argv) aflen = sizeof(struct sockaddr_in6); break; #endif - case K_ATALK: - af = AF_APPLETALK; - aflen = sizeof(struct sockaddr_at); - break; case K_SA: af = PF_ROUTE; aflen = sizeof(struct sockaddr_storage); @@ -1304,16 +1277,6 @@ getaddr(int idx, char *str, struct hoste return (0); } #endif /* INET6 */ - - case AF_APPLETALK: - { - struct sockaddr_at *sat = (struct sockaddr_at *)(void *)sa; - - if (!atalk_aton(str, &sat->sat_addr)) - errx(EX_NOHOST, "bad address: %s", str); - rtm_addrs |= RTA_NETMASK; - return(forcehost || sat->sat_addr.s_node != 0); - } case AF_LINK: link_addr(str, (struct sockaddr_dl *)(void *)sa); return (1); @@ -1892,7 +1855,6 @@ keyword(const char *cp) static void sodump(struct sockaddr *sa, const char *which) { - char atalk_buf[ATALK_BUF_SIZE]; #ifdef INET6 char nbuf[INET6_ADDRSTRLEN]; #endif @@ -1915,11 +1877,6 @@ sodump(struct sockaddr *sa, const char * sizeof(nbuf))); break; #endif - case AF_APPLETALK: - (void)printf("%s: atalk %s; ", which, - atalk_ntoa(((struct sockaddr_at *)(void *)sa)->sat_addr, - atalk_buf)); - break; } (void)fflush(stdout); } @@ -1973,24 +1930,3 @@ sockaddr(char *addr, struct sockaddr *sa } while (cp < cplim); sa->sa_len = cp - (char *)sa; } - -static int -atalk_aton(const char *text, struct at_addr *addr) -{ - u_int net, node; - - if (sscanf(text, "%u.%u", &net, &node) != 2 - || net > 0xffff || node > 0xff) - return(0); - addr->s_net = htons(net); - addr->s_node = node; - return(1); -} - -static char * -atalk_ntoa(struct at_addr at, char buf[ATALK_BUF_SIZE]) -{ - (void)snprintf(buf, ATALK_BUF_SIZE, "%u.%u", ntohs(at.s_net), at.s_node); - buf[ATALK_BUF_SIZE - 1] = '\0'; - return(buf); -} Modified: head/share/man/man4/gre.4 ============================================================================== --- head/share/man/man4/gre.4 Fri Mar 14 04:35:18 2014 (r263151) +++ head/share/man/man4/gre.4 Fri Mar 14 06:29:43 2014 (r263152) @@ -75,7 +75,7 @@ Encapsulated datagrams are prepended an outer datagram and a GRE header. The GRE header specifies the type of the encapsulated datagram and thus allows for tunneling other -protocols than IP like e.g.\& AppleTalk. +protocols than IP. GRE mode is also the default tunnel mode on Cisco routers. This is also the default mode of operation of the .Nm @@ -169,8 +169,7 @@ Get the GRE key currently used for outgo Note that the IP addresses of the tunnel endpoints may be the same as the ones defined with .Xr ifconfig 8 -for the interface (as if IP is encapsulated), but need not be, as e.g.\& when -encapsulating AppleTalk. +for the interface (as if IP is encapsulated), but need not be. .Sh EXAMPLES Configuration example: .Bd -literal @@ -294,7 +293,6 @@ The kernel must be set to forward datagr .Xr sysctl 8 variable to non-zero. .Sh SEE ALSO -.\" Xr atalk 4 , .Xr gif 4 , .Xr inet 4 , .Xr ip 4 , Modified: head/share/man/man4/netgraph.4 ============================================================================== --- head/share/man/man4/netgraph.4 Fri Mar 14 04:35:18 2014 (r263151) +++ head/share/man/man4/netgraph.4 Fri Mar 14 06:29:43 2014 (r263152) @@ -1269,8 +1269,8 @@ It allows capturing raw Ethernet frames sending frames out of the interface. .It INTERFACE This node is also a system networking interface. -It has hooks representing -each protocol family (IP, AppleTalk, etc.) and appears in the output of +It has hooks representing each protocol family (IP, IPv6) +and appears in the output of .Xr ifconfig 8 . The interfaces are named .Dq Li ng0 , Modified: head/share/man/man4/ng_iface.4 ============================================================================== --- head/share/man/man4/ng_iface.4 Fri Mar 14 04:35:18 2014 (r263151) +++ head/share/man/man4/ng_iface.4 Fri Mar 14 06:29:43 2014 (r263152) @@ -70,8 +70,7 @@ Packets transmitted via the interface fl protocol-specific hook. Similarly, packets received on a hook appear on the interface as packets received into the corresponding protocol stack. -The currently supported protocols are IP, IPv6, AppleTalk, ATM, -NATM, and NS. +The currently supported protocols are IP, IPv6, ATM, NATM, and NS. .Pp An .Nm iface @@ -88,8 +87,6 @@ This node type supports the following ho Transmission and reception of IP packets. .It Va inet6 Transmission and reception of IPv6 packets. -.It Va atalk -Transmission and reception of AppleTalk packets. .It Va atm Transmission and reception of ATM packets. .It Va natm Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Fri Mar 14 04:35:18 2014 (r263151) +++ head/share/man/man7/hier.7 Fri Mar 14 06:29:43 2014 (r263152) @@ -279,8 +279,6 @@ mail filter API machine-specific C include files .It Pa net/ miscellaneous network C include files -.It Pa netatalk/ -Appletalk protocol .It Pa netinet/ C include files for Internet standard protocols; see Modified: head/share/man/man9/netisr.9 ============================================================================== --- head/share/man/man9/netisr.9 Fri Mar 14 04:35:18 2014 (r263151) +++ head/share/man/man9/netisr.9 Fri Mar 14 06:29:43 2014 (r263152) @@ -189,19 +189,13 @@ and variants. .Ss Protocol number constants The follow protocol numbers are currently defined: -.Bl -tag -width NETISR_ATALK1 +.Bl -tag -width NETISR_ROUTE .It Dv NETISR_IP IPv4 .It Dv NETISR_IGMP IGMPv3 loopback .It Dv NETISR_ROUTE Routing socket loopback -.It Dv NETISR_AARP -Appletalk AARP -.It Dv NETISR_ATALK1 -Appletalk phase 1 -.It Dv NETISR_ATALK2 -Appletalk phase 2 .It Dv NETISR_ARP ARP .It Dv NETISR_IPV6 Modified: head/sys/Makefile ============================================================================== --- head/sys/Makefile Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/Makefile Fri Mar 14 06:29:43 2014 (r263152) @@ -9,7 +9,7 @@ SUBDIR= boot # Directories to include in cscope name file and TAGS. CSCOPEDIRS= boot bsm cam cddl compat conf contrib crypto ddb dev fs gdb \ - geom gnu isa kern libkern modules net net80211 netatalk \ + geom gnu isa kern libkern modules net net80211 \ netgraph netinet netinet6 netipsec netnatm netpfil \ netsmb nfs nfsclient nfsserver nlm ofed opencrypto \ pci rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR} Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/amd64/amd64/machdep.c Fri Mar 14 06:29:43 2014 (r263152) @@ -41,7 +41,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_atalk.h" #include "opt_atpic.h" #include "opt_compat.h" #include "opt_cpu.h" Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/conf/NOTES Fri Mar 14 06:29:43 2014 (r263152) @@ -606,9 +606,6 @@ options IPSEC #IP security (requires # options IPSEC_NAT_T #NAT-T support, UDP encap of ESP -options NETATALK #Appletalk communications protocols -options NETATALKDEBUG #Appletalk debugging - # # SMB/CIFS requester # NETSMB enables support for SMB protocol, it requires LIBMCHAIN and LIBICONV @@ -1070,7 +1067,7 @@ options MD_ROOT options QUOTA #enable disk quotas # If you are running a machine just as a fileserver for PC and MAC -# users, using SAMBA or Netatalk, you may consider setting this option +# users, using SAMBA, you may consider setting this option # and keeping all those users' directories on a filesystem that is # mounted with the suiddir option. This gives new files the same # ownership as the directory (similar to group). It's a security hole Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/conf/files Fri Mar 14 06:29:43 2014 (r263152) @@ -3168,14 +3168,6 @@ net80211/ieee80211_tdma.c optional wlan net80211/ieee80211_wds.c optional wlan net80211/ieee80211_xauth.c optional wlan wlan_xauth net80211/ieee80211_alq.c optional wlan ieee80211_alq -netatalk/aarp.c optional netatalk -netatalk/at_control.c optional netatalk -netatalk/at_proto.c optional netatalk -netatalk/at_rmx.c optional netatalk -netatalk/ddp_input.c optional netatalk -netatalk/ddp_output.c optional netatalk -netatalk/ddp_pcb.c optional netatalk -netatalk/ddp_usrreq.c optional netatalk netgraph/atm/ccatm/ng_ccatm.c optional ngatm_ccatm \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" netgraph/atm/ng_atm.c optional ngatm_atm @@ -3775,7 +3767,6 @@ security/audit/bsm_errno.c optional audi security/audit/bsm_fcntl.c optional audit security/audit/bsm_socket_type.c optional audit security/audit/bsm_token.c optional audit -security/mac/mac_atalk.c optional mac netatalk security/mac/mac_audit.c optional mac audit security/mac/mac_cred.c optional mac security/mac/mac_framework.c optional mac Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/conf/options Fri Mar 14 06:29:43 2014 (r263152) @@ -422,7 +422,6 @@ LIBMCHAIN MBUF_PROFILING MBUF_STRESS_TEST MROUTING opt_mrouting.h -NETATALK opt_atalk.h NFSLOCKD PCBGROUP opt_pcbgroup.h PF_DEFAULT_TO_DROP opt_pf.h @@ -548,7 +547,6 @@ VP0_DEBUG opt_vpo.h LPT_DEBUG opt_lpt.h PLIP_DEBUG opt_plip.h LOCKF_DEBUG opt_debug_lockf.h -NETATALKDEBUG opt_atalk.h SI_DEBUG opt_debug_si.h # Fb options Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/i386/i386/machdep.c Fri Mar 14 06:29:43 2014 (r263152) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include "opt_apic.h" -#include "opt_atalk.h" #include "opt_atpic.h" #include "opt_compat.h" #include "opt_cpu.h" Modified: head/sys/kern/Make.tags.inc ============================================================================== --- head/sys/kern/Make.tags.inc Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/kern/Make.tags.inc Fri Mar 14 06:29:43 2014 (r263152) @@ -36,7 +36,6 @@ COMM= ${SYS}/dev/advansys/*.[ch] \ ${SYS}/geom/*.[ch] \ ${SYS}/kern/*.[ch] \ ${SYS}/net/*.[ch] \ - ${SYS}/netatalk/*.[ch] \ ${SYS}/netinet/*.[ch] \ ${SYS}/netinet6/*.[ch] \ ${SYS}/netipsec/*.[ch] \ @@ -54,7 +53,6 @@ COMMDIR1= ${SYS}/conf \ ${SYS}/geom \ ${SYS}/kern \ ${SYS}/net \ - ${SYS}/netatalk \ ${SYS}/netinet \ ${SYS}/netinet6 \ ${SYS}/netipsec \ Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/kern/kern_jail.c Fri Mar 14 06:29:43 2014 (r263152) @@ -3699,11 +3699,6 @@ prison_priv_check(struct ucred *cred, in #ifdef notyet /* - * AppleTalk privileges. - */ - case PRIV_NETATALK_RESERVEDPORT: - - /* * ATM privileges. */ case PRIV_NETATM_CFG: Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/kern/subr_witness.c Fri Mar 14 06:29:43 2014 (r263152) @@ -547,12 +547,6 @@ static struct witness_order_list_entry o { "so_snd", &lock_class_mtx_sleep }, { NULL, NULL }, /* - * netatalk - */ - { "ddp_list_mtx", &lock_class_mtx_sleep }, - { "ddp_mtx", &lock_class_mtx_sleep }, - { NULL, NULL }, - /* * BPF */ { "bpf global lock", &lock_class_mtx_sleep }, Modified: head/sys/modules/if_gre/Makefile ============================================================================== --- head/sys/modules/if_gre/Makefile Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/modules/if_gre/Makefile Fri Mar 14 06:29:43 2014 (r263152) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../net ${.CURDIR}/../../netinet ${.CURDIR}/../../netinet6 KMOD= if_gre -SRCS= if_gre.c ip_gre.c opt_inet.h opt_inet6.h opt_atalk.h +SRCS= if_gre.c ip_gre.c opt_inet.h opt_inet6.h .if !defined(KERNBUILDDIR) opt_inet.h: @@ -11,9 +11,6 @@ opt_inet.h: opt_inet6.h: echo "#define INET6 1" > ${.TARGET} - -opt_atalk.h: - echo "#define NETATALK 1" > ${.TARGET} .endif .include Modified: head/sys/modules/if_tun/Makefile ============================================================================== --- head/sys/modules/if_tun/Makefile Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/modules/if_tun/Makefile Fri Mar 14 06:29:43 2014 (r263152) @@ -3,12 +3,9 @@ .PATH: ${.CURDIR}/../../net KMOD= if_tun -SRCS= if_tun.c opt_atalk.h opt_inet.h opt_inet6.h +SRCS= if_tun.c opt_inet.h opt_inet6.h .if !defined(KERNBUILDDIR) -opt_atalk.h: - echo "#define NETATALK 1" > ${.TARGET} - opt_inet.h: echo "#define INET 1" > ${.TARGET} Modified: head/sys/modules/netgraph/iface/Makefile ============================================================================== --- head/sys/modules/netgraph/iface/Makefile Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/modules/netgraph/iface/Makefile Fri Mar 14 06:29:43 2014 (r263152) @@ -2,12 +2,9 @@ # $Whistle: Makefile,v 1.2 1999/01/19 19:39:21 archie Exp $ KMOD= ng_iface -SRCS= ng_iface.c opt_atalk.h opt_inet.h opt_inet6.h +SRCS= ng_iface.c opt_inet.h opt_inet6.h .if !defined(KERNBUILDDIR) -opt_atalk.h: - echo "#define NETATALK 1" > ${.TARGET} - opt_inet.h: echo "#define INET 1" > ${.TARGET} Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/net/if_ethersubr.c Fri Mar 14 06:29:43 2014 (r263152) @@ -30,7 +30,6 @@ * $FreeBSD$ */ -#include "opt_atalk.h" #include "opt_inet.h" #include "opt_inet6.h" #include "opt_netgraph.h" @@ -82,18 +81,6 @@ int (*ef_inputp)(struct ifnet*, struct e int (*ef_outputp)(struct ifnet *ifp, struct mbuf **mp, const struct sockaddr *dst, short *tp, int *hlen); -#ifdef NETATALK -#include -#include -#include - -#define llc_snap_org_code llc_un.type_snap.org_code -#define llc_snap_ether_type llc_un.type_snap.ether_type - -extern u_char at_org_code[3]; -extern u_char aarp_org_code[3]; -#endif /* NETATALK */ - #include #ifdef CTASSERT @@ -243,42 +230,6 @@ ether_output(struct ifnet *ifp, struct m type = htons(ETHERTYPE_IPV6); break; #endif -#ifdef NETATALK - case AF_APPLETALK: - { - struct at_ifaddr *aa; - - if ((aa = at_ifawithnet((const struct sockaddr_at *)dst)) == NULL) - senderr(EHOSTUNREACH); /* XXX */ - if (!aarpresolve(ifp, m, (const struct sockaddr_at *)dst, edst)) { - ifa_free(&aa->aa_ifa); - return (0); - } - /* - * In the phase 2 case, need to prepend an mbuf for the llc header. - */ - if ( aa->aa_flags & AFA_PHASE2 ) { - struct llc llc; - - ifa_free(&aa->aa_ifa); - M_PREPEND(m, LLC_SNAPFRAMELEN, M_NOWAIT); - if (m == NULL) - senderr(ENOBUFS); - llc.llc_dsap = llc.llc_ssap = LLC_SNAP_LSAP; - llc.llc_control = LLC_UI; - bcopy(at_org_code, llc.llc_snap_org_code, sizeof(at_org_code)); - llc.llc_snap_ether_type = htons( ETHERTYPE_AT ); - bcopy(&llc, mtod(m, caddr_t), LLC_SNAPFRAMELEN); - type = htons(m->m_pkthdr.len); - hlen = LLC_SNAPFRAMELEN + ETHER_HDR_LEN; - } else { - ifa_free(&aa->aa_ifa); - type = htons(ETHERTYPE_AT); - } - break; - } -#endif /* NETATALK */ - case pseudo_AF_HDRCMPLT: { const struct ether_header *eh; @@ -720,9 +671,6 @@ ether_demux(struct ifnet *ifp, struct mb struct ether_header *eh; int i, isr; u_short ether_type; -#if defined(NETATALK) - struct llc *l; -#endif KASSERT(ifp != NULL, ("%s: NULL interface pointer", __func__)); @@ -798,38 +746,7 @@ ether_demux(struct ifnet *ifp, struct mb isr = NETISR_IPV6; break; #endif -#ifdef NETATALK - case ETHERTYPE_AT: - isr = NETISR_ATALK1; - break; - case ETHERTYPE_AARP: - isr = NETISR_AARP; - break; -#endif /* NETATALK */ default: -#if defined(NETATALK) - if (ether_type > ETHERMTU) - goto discard; - l = mtod(m, struct llc *); - if (l->llc_dsap == LLC_SNAP_LSAP && - l->llc_ssap == LLC_SNAP_LSAP && - l->llc_control == LLC_UI) { - if (bcmp(&(l->llc_snap_org_code)[0], at_org_code, - sizeof(at_org_code)) == 0 && - ntohs(l->llc_snap_ether_type) == ETHERTYPE_AT) { - m_adj(m, LLC_SNAPFRAMELEN); - isr = NETISR_ATALK2; - break; - } - if (bcmp(&(l->llc_snap_org_code)[0], aarp_org_code, - sizeof(aarp_org_code)) == 0 && - ntohs(l->llc_snap_ether_type) == ETHERTYPE_AARP) { - m_adj(m, LLC_SNAPFRAMELEN); - isr = NETISR_AARP; - break; - } - } -#endif /* NETATALK */ goto discard; } netisr_dispatch(isr, m); Modified: head/sys/net/if_fddisubr.c ============================================================================== --- head/sys/net/if_fddisubr.c Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/net/if_fddisubr.c Fri Mar 14 06:29:43 2014 (r263152) @@ -36,7 +36,6 @@ * $FreeBSD$ */ -#include "opt_atalk.h" #include "opt_inet.h" #include "opt_inet6.h" @@ -75,15 +74,6 @@ #include #endif -#ifdef NETATALK -#include -#include -#include - -extern u_char at_org_code[ 3 ]; -extern u_char aarp_org_code[ 3 ]; -#endif /* NETATALK */ - #include static const u_char fddibroadcastaddr[FDDI_ADDR_LEN] = @@ -178,40 +168,6 @@ fddi_output(struct ifnet *ifp, struct mb type = htons(ETHERTYPE_IPV6); break; #endif /* INET6 */ -#ifdef NETATALK - case AF_APPLETALK: { - struct at_ifaddr *aa; - if (!aarpresolve(ifp, m, (const struct sockaddr_at *)dst, edst)) - return (0); - /* - * ifaddr is the first thing in at_ifaddr - */ - if ((aa = at_ifawithnet((const struct sockaddr_at *)dst)) == 0) - goto bad; - - /* - * In the phase 2 case, we need to prepend an mbuf for the llc header. - * Since we must preserve the value of m, which is passed to us by - * value, we m_copy() the first mbuf, and use it for our llc header. - */ - if (aa->aa_flags & AFA_PHASE2) { - struct llc llc; - - M_PREPEND(m, LLC_SNAPFRAMELEN, M_WAITOK); - llc.llc_dsap = llc.llc_ssap = LLC_SNAP_LSAP; - llc.llc_control = LLC_UI; - bcopy(at_org_code, llc.llc_snap.org_code, sizeof(at_org_code)); - llc.llc_snap.ether_type = htons(ETHERTYPE_AT); - bcopy(&llc, mtod(m, caddr_t), LLC_SNAPFRAMELEN); - type = 0; - } else { - type = htons(ETHERTYPE_AT); - } - ifa_free(&aa->aa_ifa); - break; - } -#endif /* NETATALK */ - case pseudo_AF_HDRCMPLT: { const struct ether_header *eh; @@ -459,23 +415,6 @@ fddi_input(ifp, m) ifp->if_noproto++; goto dropanyway; } -#ifdef NETATALK - if (bcmp(&(l->llc_snap.org_code)[0], at_org_code, - sizeof(at_org_code)) == 0 && - ntohs(l->llc_snap.ether_type) == ETHERTYPE_AT) { - isr = NETISR_ATALK2; - m_adj(m, LLC_SNAPFRAMELEN); - break; - } - - if (bcmp(&(l->llc_snap.org_code)[0], aarp_org_code, - sizeof(aarp_org_code)) == 0 && - ntohs(l->llc_snap.ether_type) == ETHERTYPE_AARP) { - m_adj(m, LLC_SNAPFRAMELEN); - isr = NETISR_AARP; - break; - } -#endif /* NETATALK */ if (l->llc_snap.org_code[0] != 0 || l->llc_snap.org_code[1] != 0 || l->llc_snap.org_code[2] != 0) { @@ -510,14 +449,6 @@ fddi_input(ifp, m) isr = NETISR_DECNET; break; #endif -#ifdef NETATALK - case ETHERTYPE_AT: - isr = NETISR_ATALK1; - break; - case ETHERTYPE_AARP: - isr = NETISR_AARP; - break; -#endif /* NETATALK */ default: /* printf("fddi_input: unknown protocol 0x%x\n", type); */ ifp->if_noproto++; Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/net/if_gre.c Fri Mar 14 06:29:43 2014 (r263152) @@ -41,7 +41,6 @@ * Also supported: IP in IP encaps (proto 55) as of RFC 2004 */ -#include "opt_atalk.h" #include "opt_inet.h" #include "opt_inet6.h" @@ -440,11 +439,6 @@ gre_output(struct ifnet *ifp, struct mbu etype = ETHERTYPE_IPV6; break; #endif -#ifdef NETATALK - case AF_APPLETALK: - etype = ETHERTYPE_ATALK; - break; -#endif default: _IF_DROP(&ifp->if_snd); m_freem(m); Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/net/if_loop.c Fri Mar 14 06:29:43 2014 (r263152) @@ -34,7 +34,6 @@ * Loopback interface driver for protocol testing and timing. */ -#include "opt_atalk.h" #include "opt_inet.h" #include "opt_inet6.h" @@ -71,11 +70,6 @@ #include #endif -#ifdef NETATALK -#include -#include -#endif - #include #ifdef TINY_LOMTU @@ -267,8 +261,6 @@ looutput(struct ifnet *ifp, struct mbuf #endif m->m_pkthdr.csum_flags &= ~LO_CSUM_FEATURES6; break; - case AF_APPLETALK: - break; default: printf("looutput: af=%d unexpected\n", af); m_freem(m); @@ -361,11 +353,6 @@ if_simloop(struct ifnet *ifp, struct mbu isr = NETISR_IPV6; break; #endif -#ifdef NETATALK - case AF_APPLETALK: - isr = NETISR_ATALK2; - break; -#endif default: printf("if_simloop: can't handle af=%d\n", af); m_freem(m); Modified: head/sys/net/if_spppfr.c ============================================================================== --- head/sys/net/if_spppfr.c Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/net/if_spppfr.c Fri Mar 14 06:29:43 2014 (r263152) @@ -260,11 +260,6 @@ drop: ++ifp->if_ierrors; isr = NETISR_IP; break; #endif -#ifdef NETATALK - case ETHERTYPE_AT: - isr = NETISR_ATALK; - break; -#endif } if (! (ifp->if_flags & IFF_UP)) @@ -339,11 +334,6 @@ struct mbuf *sppp_fr_header (struct sppp type = 0x8137; break; #endif -#ifdef NETATALK - case AF_APPLETALK: - type = ETHERTYPE_AT; - break; -#endif } h[3] = FR_PADDING; h[4] = FR_SNAP; Modified: head/sys/net/if_tun.c ============================================================================== --- head/sys/net/if_tun.c Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/net/if_tun.c Fri Mar 14 06:29:43 2014 (r263152) @@ -16,7 +16,6 @@ * $FreeBSD$ */ -#include "opt_atalk.h" #include "opt_inet.h" #include "opt_inet6.h" @@ -905,11 +904,6 @@ tunwrite(struct cdev *dev, struct uio *u isr = NETISR_IPV6; break; #endif -#ifdef NETATALK - case AF_APPLETALK: - isr = NETISR_ATALK2; - break; -#endif default: m_freem(m); return (EAFNOSUPPORT); Modified: head/sys/net/netisr.h ============================================================================== --- head/sys/net/netisr.h Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/net/netisr.h Fri Mar 14 06:29:43 2014 (r263152) @@ -52,15 +52,11 @@ #define NETISR_IP 1 #define NETISR_IGMP 2 /* IGMPv3 output queue */ #define NETISR_ROUTE 3 /* routing socket */ -#define NETISR_AARP 4 /* Appletalk ARP */ -#define NETISR_ATALK2 5 /* Appletalk phase 2 */ -#define NETISR_ATALK1 6 /* Appletalk phase 1 */ -#define NETISR_ARP 7 /* same as AF_LINK */ -/* 8 was IPX */ -#define NETISR_ETHER 9 /* ethernet input */ -#define NETISR_IPV6 10 -#define NETISR_NATM 11 -#define NETISR_EPAIR 12 /* if_epair(4) */ +#define NETISR_ARP 4 /* same as AF_LINK */ +#define NETISR_ETHER 5 /* ethernet input */ +#define NETISR_IPV6 6 +#define NETISR_NATM 7 +#define NETISR_EPAIR 8 /* if_epair(4) */ /* * Protocol ordering and affinity policy constants. See the detailed Modified: head/sys/netgraph/ng_cisco.c ============================================================================== --- head/sys/netgraph/ng_cisco.c Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/netgraph/ng_cisco.c Fri Mar 14 06:29:43 2014 (r263152) @@ -55,8 +55,6 @@ #include #include -#include - #include #include #include Modified: head/sys/netgraph/ng_iface.c ============================================================================== --- head/sys/netgraph/ng_iface.c Fri Mar 14 04:35:18 2014 (r263151) +++ head/sys/netgraph/ng_iface.c Fri Mar 14 06:29:43 2014 (r263152) @@ -52,7 +52,6 @@ * This node also includes Berkeley packet filter support. */ -#include "opt_atalk.h" #include "opt_inet.h" #include "opt_inet6.h" @@ -103,7 +102,6 @@ typedef const struct iffam *iffam_p; const static struct iffam gFamilies[] = { { AF_INET, NG_IFACE_HOOK_INET }, { AF_INET6, NG_IFACE_HOOK_INET6 }, - { AF_APPLETALK, NG_IFACE_HOOK_ATALK }, { AF_ATM, NG_IFACE_HOOK_ATM }, { AF_NATM, NG_IFACE_HOOK_NATM }, }; @@ -759,11 +757,6 @@ ng_iface_rcvdata(hook_p hook, item_p ite isr = NETISR_IPV6; break; #endif -#ifdef NETATALK - case AF_APPLETALK: - isr = NETISR_ATALK2; - break; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 06:37:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 397A7329; Fri, 14 Mar 2014 06:37:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 265C38B7; Fri, 14 Mar 2014 06:37:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E6b9Kd024778; Fri, 14 Mar 2014 06:37:09 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E6b8lq024776; Fri, 14 Mar 2014 06:37:08 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201403140637.s2E6b8lq024776@svn.freebsd.org> From: Kevin Lo Date: Fri, 14 Mar 2014 06:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263153 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 06:37:09 -0000 Author: kevlo Date: Fri Mar 14 06:37:08 2014 New Revision: 263153 URL: http://svnweb.freebsd.org/changeset/base/263153 Log: Similar to r246614, fix panic on removing urtwn(4). It happens because nodes are freed after the adapter is gone. Modified: head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnreg.h Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Fri Mar 14 06:29:43 2014 (r263152) +++ head/sys/dev/usb/wlan/if_urtwn.c Fri Mar 14 06:37:08 2014 (r263153) @@ -247,8 +247,8 @@ static void urtwn_iq_calib(struct urtwn static void urtwn_lc_calib(struct urtwn_softc *); static void urtwn_init(void *); static void urtwn_init_locked(void *); -static void urtwn_stop(struct ifnet *, int); -static void urtwn_stop_locked(struct ifnet *, int); +static void urtwn_stop(struct ifnet *); +static void urtwn_stop_locked(struct ifnet *); static void urtwn_abort_xfers(struct urtwn_softc *); static int urtwn_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); @@ -459,20 +459,40 @@ urtwn_detach(device_t self) struct urtwn_softc *sc = device_get_softc(self); struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; + unsigned int x; - if (!device_is_attached(self)) - return (0); + /* Prevent further ioctls. */ + URTWN_LOCK(sc); + sc->sc_flags |= URTWN_DETACHED; + URTWN_UNLOCK(sc); - urtwn_stop(ifp, 1); + urtwn_stop(ifp); callout_drain(&sc->sc_watchdog_ch); - /* stop all USB transfers */ - usbd_transfer_unsetup(sc->sc_xfer, URTWN_N_TRANSFER); - ieee80211_ifdetach(ic); + /* Prevent further allocations from RX/TX data lists. */ + URTWN_LOCK(sc); + STAILQ_INIT(&sc->sc_tx_active); + STAILQ_INIT(&sc->sc_tx_inactive); + STAILQ_INIT(&sc->sc_tx_pending); + + STAILQ_INIT(&sc->sc_rx_active); + STAILQ_INIT(&sc->sc_rx_inactive); + URTWN_UNLOCK(sc); + /* drain USB transfers */ + for (x = 0; x != URTWN_N_TRANSFER; x++) + usbd_transfer_drain(sc->sc_xfer[x]); + + /* Free data buffers. */ + URTWN_LOCK(sc); urtwn_free_tx_list(sc); urtwn_free_rx_list(sc); + URTWN_UNLOCK(sc); + + /* stop all USB transfers */ + usbd_transfer_unsetup(sc->sc_xfer, URTWN_N_TRANSFER); + ieee80211_ifdetach(ic); if_free(ifp); mtx_destroy(&sc->sc_mtx); @@ -1758,10 +1778,17 @@ urtwn_start_locked(struct ifnet *ifp, st static int urtwn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { + struct urtwn_softc *sc = ifp->if_softc; struct ieee80211com *ic = ifp->if_l2com; struct ifreq *ifr = (struct ifreq *) data; int error = 0, startall = 0; + URTWN_LOCK(sc); + error = (sc->sc_flags & URTWN_DETACHED) ? ENXIO : 0; + URTWN_UNLOCK(sc); + if (error != 0) + return (error); + switch (cmd) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { @@ -1771,7 +1798,7 @@ urtwn_ioctl(struct ifnet *ifp, u_long cm } } else { if (ifp->if_drv_flags & IFF_DRV_RUNNING) - urtwn_stop(ifp, 1); + urtwn_stop(ifp); } if (startall) ieee80211_start_all(ic); @@ -2785,7 +2812,7 @@ urtwn_init_locked(void *arg) int error; if (ifp->if_drv_flags & IFF_DRV_RUNNING) - urtwn_stop_locked(ifp, 0); + urtwn_stop_locked(ifp); /* Init firmware commands ring. */ sc->fwcur = 0; @@ -2943,11 +2970,10 @@ urtwn_init(void *arg) } static void -urtwn_stop_locked(struct ifnet *ifp, int disable) +urtwn_stop_locked(struct ifnet *ifp) { struct urtwn_softc *sc = ifp->if_softc; - (void)disable; ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); callout_stop(&sc->sc_watchdog_ch); @@ -2955,12 +2981,12 @@ urtwn_stop_locked(struct ifnet *ifp, int } static void -urtwn_stop(struct ifnet *ifp, int disable) +urtwn_stop(struct ifnet *ifp) { struct urtwn_softc *sc = ifp->if_softc; URTWN_LOCK(sc); - urtwn_stop_locked(ifp, disable); + urtwn_stop_locked(ifp); URTWN_UNLOCK(sc); } Modified: head/sys/dev/usb/wlan/if_urtwnreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnreg.h Fri Mar 14 06:29:43 2014 (r263152) +++ head/sys/dev/usb/wlan/if_urtwnreg.h Fri Mar 14 06:37:08 2014 (r263153) @@ -1119,6 +1119,7 @@ struct urtwn_softc { int ac2idx[WME_NUM_AC]; u_int sc_flags; #define URTWN_FLAG_CCK_HIPWR 0x01 +#define URTWN_DETACHED 0x02 u_int chip; #define URTWN_CHIP_92C 0x01 From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 06:38:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAFF749B; Fri, 14 Mar 2014 06:38:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D84358CC; Fri, 14 Mar 2014 06:38:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E6cMoi024953; Fri, 14 Mar 2014 06:38:22 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E6cM6D024952; Fri, 14 Mar 2014 06:38:22 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201403140638.s2E6cM6D024952@svn.freebsd.org> From: Kevin Lo Date: Fri, 14 Mar 2014 06:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263154 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 06:38:23 -0000 Author: kevlo Date: Fri Mar 14 06:38:22 2014 New Revision: 263154 URL: http://svnweb.freebsd.org/changeset/base/263154 Log: Reset the bit of the R92C_MCUFWDL associated with checksum report before loading firmware page. It may fix this problem: "urtwn0: timeout waiting for checksum report" Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Fri Mar 14 06:37:08 2014 (r263153) +++ head/sys/dev/usb/wlan/if_urtwn.c Fri Mar 14 06:38:22 2014 (r263154) @@ -2098,6 +2098,10 @@ urtwn_load_firmware(struct urtwn_softc * urtwn_write_1(sc, R92C_MCUFWDL + 2, urtwn_read_1(sc, R92C_MCUFWDL + 2) & ~0x08); + /* Reset the FWDL checksum. */ + urtwn_write_1(sc, R92C_MCUFWDL, + urtwn_read_1(sc, R92C_MCUFWDL) | R92C_MCUFWDL_CHKSUM_RPT); + for (page = 0; len > 0; page++) { mlen = min(len, R92C_FW_PAGE_SIZE); error = urtwn_fw_loadpage(sc, page, ptr, mlen); From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 07:11:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F10D791; Fri, 14 Mar 2014 07:11:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE917BBD; Fri, 14 Mar 2014 07:11:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E7BX0e039187; Fri, 14 Mar 2014 07:11:33 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E7BXTi039186; Fri, 14 Mar 2014 07:11:33 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403140711.s2E7BXTi039186@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 14 Mar 2014 07:11:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263155 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 07:11:34 -0000 Author: hselasky Date: Fri Mar 14 07:11:33 2014 New Revision: 263155 URL: http://svnweb.freebsd.org/changeset/base/263155 Log: Add support for more sample rates to USB audio driver. Submitted by: Shunsuke Suganuma <3226388001@jcom.home.ne.jp> PR: usb/171254 MFC after: 1 week Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Fri Mar 14 06:38:22 2014 (r263154) +++ head/sys/dev/sound/usb/uaudio.c Fri Mar 14 07:11:33 2014 (r263155) @@ -182,7 +182,7 @@ struct uaudio_configure_msg { struct uaudio_softc *sc; }; -#define CHAN_MAX_ALT 20 +#define CHAN_MAX_ALT 24 struct uaudio_chan_alt { union uaudio_asf1d p_asf1d; @@ -1883,6 +1883,10 @@ uaudio_chan_fill_info_sub(struct uaudio_ /* This structure defines all the supported rates. */ static const uint32_t uaudio_rate_list[CHAN_MAX_ALT] = { + 384000, + 352800, + 192000, + 176400, 96000, 88200, 88000, From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 08:42:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C30581AE; Fri, 14 Mar 2014 08:42:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AF83669D; Fri, 14 Mar 2014 08:42:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E8gVtZ080595; Fri, 14 Mar 2014 08:42:31 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E8gUTP080588; Fri, 14 Mar 2014 08:42:30 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403140842.s2E8gUTP080588@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 14 Mar 2014 08:42:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263159 - in head/sys/dev: sound/usb usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 08:42:31 -0000 Author: hselasky Date: Fri Mar 14 08:42:30 2014 New Revision: 263159 URL: http://svnweb.freebsd.org/changeset/base/263159 Log: Workaround for USB MIDI adapters which use non-supported values of wMaxPacketSize for BULK endpoints. MFC after: 1 week Modified: head/sys/dev/sound/usb/uaudio.c head/sys/dev/usb/usb_core.h head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/usbdi.h Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Fri Mar 14 07:58:11 2014 (r263158) +++ head/sys/dev/sound/usb/uaudio.c Fri Mar 14 08:42:30 2014 (r263159) @@ -5674,6 +5674,25 @@ umidi_probe(device_t dev) DPRINTF("error=%s\n", usbd_errstr(error)); goto detach; } + + /* + * Some USB MIDI device makers couldn't resist using + * wMaxPacketSize = 4 for RX and TX BULK endpoints, although + * that size is an unsupported value for FULL speed BULK + * endpoints. The same applies to some HIGH speed MIDI devices + * which are using a wMaxPacketSize different from 512 bytes. + * + * Refer to section 5.8.3 in USB 2.0 PDF: Cite: "All Host + * Controllers are required to have support for 8-, 16-, 32-, + * and 64-byte maximum packet sizes for full-speed bulk + * endpoints and 512 bytes for high-speed bulk endpoints." + */ + if (usbd_xfer_maxp_was_clamped(chan->xfer[UMIDI_TX_TRANSFER])) + chan->single_command = 1; + + if (chan->single_command != 0) + device_printf(dev, "Single command MIDI quirk enabled\n"); + if ((chan->max_cable > UMIDI_CABLES_MAX) || (chan->max_cable == 0)) { chan->max_cable = UMIDI_CABLES_MAX; Modified: head/sys/dev/usb/usb_core.h ============================================================================== --- head/sys/dev/usb/usb_core.h Fri Mar 14 07:58:11 2014 (r263158) +++ head/sys/dev/usb/usb_core.h Fri Mar 14 08:42:30 2014 (r263159) @@ -114,6 +114,8 @@ struct usb_xfer_flags_int { uint8_t can_cancel_immed:1; /* set if USB transfer can be * cancelled immediately */ uint8_t doing_callback:1; /* set if executing the callback */ + uint8_t maxp_was_clamped:1; /* set if the max packet size + * was outside its allowed range */ }; /* Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Fri Mar 14 07:58:11 2014 (r263158) +++ head/sys/dev/usb/usb_transfer.c Fri Mar 14 08:42:30 2014 (r263159) @@ -346,6 +346,7 @@ usbd_transfer_setup_sub(struct usb_setup usb_frcount_t n_frlengths; usb_frcount_t n_frbuffers; usb_frcount_t x; + uint16_t maxp_old; uint8_t type; uint8_t zmps; @@ -433,6 +434,11 @@ usbd_transfer_setup_sub(struct usb_setup if (xfer->max_packet_count > parm->hc_max_packet_count) { xfer->max_packet_count = parm->hc_max_packet_count; } + + /* store max packet size value before filtering */ + + maxp_old = xfer->max_packet_size; + /* filter "wMaxPacketSize" according to HC capabilities */ if ((xfer->max_packet_size > parm->hc_max_packet_size) || @@ -465,6 +471,13 @@ usbd_transfer_setup_sub(struct usb_setup } } + /* + * Check if the max packet size was outside its allowed range + * and clamped to a valid value: + */ + if (maxp_old != xfer->max_packet_size) + xfer->flags_int.maxp_was_clamped = 1; + /* compute "max_frame_size" */ usbd_update_max_frame_size(xfer); @@ -3432,3 +3445,13 @@ usbd_xfer_get_timestamp(struct usb_xfer { return (xfer->isoc_time_complete); } + +/* + * The following function returns non-zero if the max packet size + * field was clamped to a valid value. Else it returns zero. + */ +uint8_t +usbd_xfer_maxp_was_clamped(struct usb_xfer *xfer) +{ + return (xfer->flags_int.maxp_was_clamped); +} Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Fri Mar 14 07:58:11 2014 (r263158) +++ head/sys/dev/usb/usbdi.h Fri Mar 14 08:42:30 2014 (r263159) @@ -569,6 +569,7 @@ int usbd_xfer_is_stalled(struct usb_xfer void usbd_xfer_set_flag(struct usb_xfer *xfer, int flag); void usbd_xfer_clr_flag(struct usb_xfer *xfer, int flag); uint16_t usbd_xfer_get_timestamp(struct usb_xfer *xfer); +uint8_t usbd_xfer_maxp_was_clamped(struct usb_xfer *xfer); void usbd_copy_in(struct usb_page_cache *cache, usb_frlength_t offset, const void *ptr, usb_frlength_t len); From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 08:43:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 017AA32C; Fri, 14 Mar 2014 08:43:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E1D866AB; Fri, 14 Mar 2014 08:43:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E8hvTF080791; Fri, 14 Mar 2014 08:43:57 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E8hvMl080790; Fri, 14 Mar 2014 08:43:57 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201403140843.s2E8hvMl080790@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 14 Mar 2014 08:43:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263160 - in head: . contrib/lukemftpd libexec/lukemftpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 08:43:58 -0000 Author: des Date: Fri Mar 14 08:43:56 2014 New Revision: 263160 URL: http://svnweb.freebsd.org/changeset/base/263160 Log: Remove lukemftpd. It was disconnected from the build in 2009. MFC after: 3 days Deleted: head/contrib/lukemftpd/ head/libexec/lukemftpd/ Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Fri Mar 14 08:42:30 2014 (r263159) +++ head/MAINTAINERS Fri Mar 14 08:43:56 2014 (r263160) @@ -82,7 +82,6 @@ binutils obrien Insists on BU blocked fr file obrien Insists to keep file blocked from other's unapproved commits contrib/bzip2 obrien Pre-commit review required. -lukemftpd obrien Pre-commit review required. geom_concat pjd Pre-commit review preferred. geom_eli pjd Pre-commit review preferred. geom_gate pjd Pre-commit review preferred. From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 08:56:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60AA0F42; Fri, 14 Mar 2014 08:56:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4A4208F3; Fri, 14 Mar 2014 08:56:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2E8uOEq085830; Fri, 14 Mar 2014 08:56:24 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2E8uKQQ085804; Fri, 14 Mar 2014 08:56:20 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403140856.s2E8uKQQ085804@svn.freebsd.org> From: Julio Merino Date: Fri, 14 Mar 2014 08:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263161 - in head: bin/date/tests bin/mv/tests bin/pax/tests bin/sh/tests bin/test/tests lib/atf/libatf-c++/tests lib/atf/libatf-c++/tests/detail lib/atf/libatf-c/tests lib/atf/libatf-c... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 08:56:24 -0000 Author: jmmv Date: Fri Mar 14 08:56:19 2014 New Revision: 263161 URL: http://svnweb.freebsd.org/changeset/base/263161 Log: Make bsd.test.mk the only public mk fragment for the building of tests. Change {atf,plain,tap}.test.mk to be internal implementation details of bsd.test.mk. Makefiles that build tests should now only include bsd.test.mk and declaratively specify what they want to build, without worrying about the internal implementation of the mk files. The reason for this change is to permit building test programs of different interfaces from a single directory, which is something I had a need for while porting tests over from src/tools/regression/. Additionally, this change makes it possible to perform some other requested changes to bsd.test.mk in an easier manner. Coming soon. Modified: head/bin/date/tests/Makefile head/bin/mv/tests/Makefile head/bin/pax/tests/Makefile head/bin/sh/tests/Makefile head/bin/test/tests/Makefile head/lib/atf/libatf-c++/tests/Makefile head/lib/atf/libatf-c++/tests/detail/Makefile head/lib/atf/libatf-c/tests/Makefile head/lib/atf/libatf-c/tests/detail/Makefile head/lib/atf/tests/test-programs/Makefile head/lib/libcrypt/tests/Makefile head/libexec/atf/atf-check/tests/Makefile head/share/examples/tests/tests/atf/Makefile head/share/examples/tests/tests/plain/Makefile head/share/mk/atf.test.mk head/share/mk/bsd.test.mk head/share/mk/plain.test.mk head/share/mk/tap.test.mk head/tests/sys/kern/Makefile head/usr.bin/atf/atf-sh/tests/Makefile Modified: head/bin/date/tests/Makefile ============================================================================== --- head/bin/date/tests/Makefile Fri Mar 14 08:43:56 2014 (r263160) +++ head/bin/date/tests/Makefile Fri Mar 14 08:56:19 2014 (r263161) @@ -6,4 +6,4 @@ TESTSDIR= ${TESTSBASE}/bin/date TAP_TESTS_SH= legacy_test -.include +.include Modified: head/bin/mv/tests/Makefile ============================================================================== --- head/bin/mv/tests/Makefile Fri Mar 14 08:43:56 2014 (r263160) +++ head/bin/mv/tests/Makefile Fri Mar 14 08:56:19 2014 (r263161) @@ -6,4 +6,4 @@ TESTSDIR= ${TESTSBASE}/bin/mv TAP_TESTS_SH= legacy_test -.include +.include Modified: head/bin/pax/tests/Makefile ============================================================================== --- head/bin/pax/tests/Makefile Fri Mar 14 08:43:56 2014 (r263160) +++ head/bin/pax/tests/Makefile Fri Mar 14 08:56:19 2014 (r263161) @@ -6,4 +6,4 @@ TESTSDIR= ${TESTSBASE}/bin/pax TAP_TESTS_PERL= legacy_test -.include +.include Modified: head/bin/sh/tests/Makefile ============================================================================== --- head/bin/sh/tests/Makefile Fri Mar 14 08:43:56 2014 (r263160) +++ head/bin/sh/tests/Makefile Fri Mar 14 08:56:19 2014 (r263161) @@ -15,4 +15,4 @@ TEST_METADATA.legacy_test+= required_use SUBDIR+= builtins errors execution expansion parameters parser set-e -.include +.include Modified: head/bin/test/tests/Makefile ============================================================================== --- head/bin/test/tests/Makefile Fri Mar 14 08:43:56 2014 (r263160) +++ head/bin/test/tests/Makefile Fri Mar 14 08:56:19 2014 (r263161) @@ -12,4 +12,4 @@ TAP_TESTS_SH= legacy_test # requested. See https://code.google.com/p/kyua/issues/detail?id=6 TEST_METADATA.legacy_test+= required_user="unprivileged" -.include +.include Modified: head/lib/atf/libatf-c++/tests/Makefile ============================================================================== --- head/lib/atf/libatf-c++/tests/Makefile Fri Mar 14 08:43:56 2014 (r263160) +++ head/lib/atf/libatf-c++/tests/Makefile Fri Mar 14 08:56:19 2014 (r263161) @@ -28,4 +28,4 @@ SRCS.${_T}= ${_T}.cpp test_helpers.cpp ATF_TESTS_SH= pkg_config_test -.include +.include Modified: head/lib/atf/libatf-c++/tests/detail/Makefile ============================================================================== --- head/lib/atf/libatf-c++/tests/detail/Makefile Fri Mar 14 08:43:56 2014 (r263160) +++ head/lib/atf/libatf-c++/tests/detail/Makefile Fri Mar 14 08:56:19 2014 (r263161) @@ -29,4 +29,4 @@ BINDIR.${p}= ${TESTSDIR} version_helper.o: atf-version .include "../../../common.mk" -.include +.include Modified: head/lib/atf/libatf-c/tests/Makefile ============================================================================== --- head/lib/atf/libatf-c/tests/Makefile Fri Mar 14 08:43:56 2014 (r263160) +++ head/lib/atf/libatf-c/tests/Makefile Fri Mar 14 08:56:19 2014 (r263161) @@ -35,4 +35,4 @@ SRCS.${_T}= ${_T}.c test_helpers.c ATF_TESTS_SH= pkg_config_test -.include +.include Modified: head/lib/atf/libatf-c/tests/detail/Makefile ============================================================================== --- head/lib/atf/libatf-c/tests/detail/Makefile Fri Mar 14 08:43:56 2014 (r263160) +++ head/lib/atf/libatf-c/tests/detail/Makefile Fri Mar 14 08:56:19 2014 (r263161) @@ -31,4 +31,4 @@ BINDIR.${p}= ${TESTSDIR} version_helper.o: atf-version .include "../../../common.mk" -.include +.include Modified: head/lib/atf/tests/test-programs/Makefile ============================================================================== --- head/lib/atf/tests/test-programs/Makefile Fri Mar 14 08:43:56 2014 (r263160) +++ head/lib/atf/tests/test-programs/Makefile Fri Mar 14 08:56:19 2014 (r263161) @@ -21,4 +21,4 @@ ATF_TESTS_SH+= ${_T} ATF_TESTS_SH_SRC_${_T}= common.sh ${_T}.sh .endfor -.include +.include Modified: head/lib/libcrypt/tests/Makefile ============================================================================== --- head/lib/libcrypt/tests/Makefile Fri Mar 14 08:43:56 2014 (r263160) +++ head/lib/libcrypt/tests/Makefile Fri Mar 14 08:56:19 2014 (r263161) @@ -9,4 +9,4 @@ ATF_TESTS_C= crypt_tests CFLAGS+= -I${.CURDIR:H} LDADD+= -L${.OBJDIR:H} -lcrypt -.include +.include Modified: head/libexec/atf/atf-check/tests/Makefile ============================================================================== --- head/libexec/atf/atf-check/tests/Makefile Fri Mar 14 08:43:56 2014 (r263160) +++ head/libexec/atf/atf-check/tests/Makefile Fri Mar 14 08:56:19 2014 (r263161) @@ -9,4 +9,4 @@ ATF= ${.CURDIR:H:H:H:H}/contrib/atf ATF_TESTS_SH= atf-check_test -.include +.include Modified: head/share/examples/tests/tests/atf/Makefile ============================================================================== --- head/share/examples/tests/tests/atf/Makefile Fri Mar 14 08:43:56 2014 (r263160) +++ head/share/examples/tests/tests/atf/Makefile Fri Mar 14 08:56:19 2014 (r263161) @@ -27,4 +27,4 @@ ATF_TESTS_SH= cp_test # definitions from above. KYUAFILE= yes -.include +.include Modified: head/share/examples/tests/tests/plain/Makefile ============================================================================== --- head/share/examples/tests/tests/plain/Makefile Fri Mar 14 08:43:56 2014 (r263160) +++ head/share/examples/tests/tests/plain/Makefile Fri Mar 14 08:56:19 2014 (r263161) @@ -27,4 +27,4 @@ PLAIN_TESTS_SH= cp_test # definitions from above. KYUAFILE= yes -.include +.include Modified: head/share/mk/atf.test.mk ============================================================================== --- head/share/mk/atf.test.mk Fri Mar 14 08:43:56 2014 (r263160) +++ head/share/mk/atf.test.mk Fri Mar 14 08:56:19 2014 (r263161) @@ -1,9 +1,13 @@ # $FreeBSD$ # +# You must include bsd.test.mk instead of this file from your Makefile. +# # Logic to build and install ATF test programs; i.e. test programs linked # against the ATF libraries. -.include +.if !target(____) +.error atf.test.mk cannot be included directly. +.endif # List of C, C++ and shell test programs to build. # @@ -164,5 +168,3 @@ realtest: .PHONY .endif .endif - -.include Modified: head/share/mk/bsd.test.mk ============================================================================== --- head/share/mk/bsd.test.mk Fri Mar 14 08:43:56 2014 (r263160) +++ head/share/mk/bsd.test.mk Fri Mar 14 08:56:19 2014 (r263161) @@ -2,16 +2,14 @@ # # Generic build infrastructure for test programs. # -# The code in this file is independent of the implementation of the test -# programs being built; this file just provides generic infrastructure for the -# build and the definition of various helper variables and targets. -# -# Makefiles should never include this file directly. Instead, they should -# include one of the various *.test.mk depending on the specific test programs -# being built. +# This is the only public file that should be included by Makefiles when +# tests are to be built. All other *.test.mk files are internal and not +# to be included directly. .include +____: + # Directory in which to install tests defined by the current Makefile. # Makefiles have to override this to point to a subdirectory of TESTSBASE. TESTSDIR?= . @@ -67,11 +65,6 @@ TESTS_ENV+= PATH=${TESTS_PATH:tW:C/ +/:/ TESTS_LD_LIBRARY_PATH+= ${DESTDIR}/lib ${DESTDIR}/usr/lib TESTS_ENV+= LD_LIBRARY_PATH=${TESTS_LD_LIBRARY_PATH:tW:C/ +/:/g} -# List of all tests being built. This variable is internal should not be -# defined by the Makefile. The various *.test.mk modules extend this variable -# as needed. -_TESTS?= - # Path to the prefix of the installed Kyua CLI, if any. # # If kyua is installed from ports, we automatically define a realtest target @@ -79,6 +72,15 @@ _TESTS?= # hierarchy specified by this variable. KYUA_PREFIX?= /usr/local +# List of all tests being built. The various *.test.mk modules extend this +# variable as needed. +_TESTS= + +# Pull in the definitions of all supported test interfaces. +.include +.include +.include + .if !empty(TESTS_SUBDIRS) SUBDIR+= ${TESTS_SUBDIRS} .endif Modified: head/share/mk/plain.test.mk ============================================================================== --- head/share/mk/plain.test.mk Fri Mar 14 08:43:56 2014 (r263160) +++ head/share/mk/plain.test.mk Fri Mar 14 08:56:19 2014 (r263161) @@ -1,10 +1,14 @@ # $FreeBSD$ # +# You must include bsd.test.mk instead of this file from your Makefile. +# # Logic to build and install plain test programs. A plain test programs it not # supposed to use any specific testing framework: all it does is run some code # and report the test's pass or fail status via a 0 or 1 exit code. -.include +.if !target(____) +.error plain.test.mk cannot be included directly. +.endif # List of C, C++ and shell test programs to build. # @@ -58,5 +62,3 @@ ${_T}: ${PLAIN_TESTS_SH_SRC_${_T}} mv ${.TARGET}.tmp ${.TARGET} .endfor .endif - -.include Modified: head/share/mk/tap.test.mk ============================================================================== --- head/share/mk/tap.test.mk Fri Mar 14 08:43:56 2014 (r263160) +++ head/share/mk/tap.test.mk Fri Mar 14 08:56:19 2014 (r263161) @@ -1,12 +1,16 @@ # $FreeBSD$ # +# You must include bsd.test.mk instead of this file from your Makefile. +# # Logic to build and install TAP-compliant test programs. # # This is provided to support existing tests in the FreeBSD source tree # (particularly those coming from tools/regression/) that comply with the # Test Anything Protocol. It should not be used for new tests. -.include +.if !target(____) +.error tap.test.mk cannot be included directly. +.endif # List of C, C++ and shell test programs to build. # @@ -87,5 +91,3 @@ ${_T}: ${TAP_TESTS_SH_SRC_${_T}} mv ${.TARGET}.tmp ${.TARGET} .endfor .endif - -.include Modified: head/tests/sys/kern/Makefile ============================================================================== --- head/tests/sys/kern/Makefile Fri Mar 14 08:43:56 2014 (r263160) +++ head/tests/sys/kern/Makefile Fri Mar 14 08:56:19 2014 (r263161) @@ -10,4 +10,4 @@ LDADD.unix_seqpacket_test+= -lpthread WARNS?= 5 -.include +.include Modified: head/usr.bin/atf/atf-sh/tests/Makefile ============================================================================== --- head/usr.bin/atf/atf-sh/tests/Makefile Fri Mar 14 08:43:56 2014 (r263160) +++ head/usr.bin/atf/atf-sh/tests/Makefile Fri Mar 14 08:56:19 2014 (r263161) @@ -23,4 +23,4 @@ misc_helpers: misc_helpers.sh chmod +x ${.TARGET}.tmp mv ${.TARGET}.tmp ${.TARGET} -.include +.include From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 09:13:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1695FB6A; Fri, 14 Mar 2014 09:13:52 +0000 (UTC) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AFB5DB54; Fri, 14 Mar 2014 09:13:51 +0000 (UTC) Received: from dynamic.1.17.e8edf383af80.685b35818d2c.afb.bredband2.com (dynamic.1.17.e8edf383af80.685b35818d2c.afb.bredband2.com [31.208.68.40]) by mrelayeu.kundenserver.de (node=mreue105) with ESMTP (Nemesis) id 0MHpa1-1WRxcd0d1p-003gr2; Fri, 14 Mar 2014 10:13:38 +0100 Message-ID: <5322C83F.6060109@FreeBSD.org> Date: Fri, 14 Mar 2014 10:13:35 +0100 From: Christian Brueffer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: John-Mark Gurney , John Nielsen Subject: Re: svn commit: r263110 - head/share/man/man4 References: <201403131619.s2DGJax1071196@svn.freebsd.org> <4D0B04BD-4EF6-4963-941E-012B81F8DFAB@jnielsen.net> <20140314015438.GO32089@funkthat.com> In-Reply-To: <20140314015438.GO32089@funkthat.com> X-Enigmail-Version: 1.6 OpenPGP: id=3A67DC36; url=http://people.freebsd.org/~brueffer/brueffer.key.asc Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="F6eEIoq8CwEl1rG35AdIf7Aw87QegITis" X-Provags-ID: V02:K0:FaRZbdTpPD8Rimxv0Fx7g3jm/uzpBUcF+wTZ0WNYsLg +PnfvcOYdbbpXA7MFeWyjfwTNYMtupSutqHYHncsrOD4P+cN51 tN3wFaEaeoQQmsJUkXTAF85KrBTeyIhlqk31c09BYows7XjsP1 DjSGu8OvYYblIonsWqa5DhcS9Ctcl+LevDoyiElCcnLdAAd4TN uD/36d4CMOVhwGb1kIYSYrbI6JAb90/LsTVQnegPgljWm5qXjW GJoPV6bIiOSbOTXWJBv+lfKOkTvTuA+EHFZA7J8J199gQxco8G mZXp+m6sJSIEuWmk9La4zAYW16nYK8Sdtn8Vxfcai8pPS7srU7 pcVoCiNcsqMrORwm5LCqLJB949HJIvuc7VIQFAiATIo7ylKaJF rpem0Odqps78MOqB7yf1YtK0l/l6iOf0iIaAD8aJLcXUx2OJe+ cTAT1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 09:13:52 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --F6eEIoq8CwEl1rG35AdIf7Aw87QegITis Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 3/14/14 2:54 AM, John-Mark Gurney wrote: > John Nielsen wrote this message on Thu, Mar 13, 2014 at 16:28 -0600: >> On Mar 13, 2014, at 10:19 AM, John-Mark Gurney wrote= : >> >>> Author: jmg >>> Date: Thu Mar 13 16:19:36 2014 >>> New Revision: 263110 >>> URL: http://svnweb.freebsd.org/changeset/base/263110 >>> >>> Log: >>> remove link to the missing AMD Geode LX SB man page... we can add it= >>> back once someone cares enough to write one.. >> >> You mean like this one? >> http://svnweb.freebsd.org/base/head/share/man/man4/man4.i386/glxsb.4 >=20 > The problems of checking on an amd64 box... :( >=20 > Actually, how are we suppose to handle links to arch dependant man > pages in arch independant man pages? I did this check on an amd64 box,= > so the page glxsb didn't get installed... Should we just always > install these man pages on all arches then? Or are we fine w/ > references to non-existant pages (on some arches)? >=20 > Or should glxsb.4 be moved to an arch independant dir? >=20 I wonder if it makes sense to keep arch-dependent man directories at all. I.e., if I prepare an ARM disk image on my amd64 laptop, I really want to have the arm manpages available on that amd64 box. Does anyone see a reason not to move man4/man4.${ARCH}/*.4 to man4? We're talking about 60 manpages here, so space is not really an issue. Chris --F6eEIoq8CwEl1rG35AdIf7Aw87QegITis Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQJ8BAEBCgBmBQJTIshBXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ5QzhCQjQ5MDgzNDUwNjkyOUM5Mjg2NDE3 OEM4MzY5ODQ3RTE2NDg3AAoJEHjINphH4WSH/GQP/3CmeuMi7i8gRgcs+X3syO0b zoSu05YSAG5bOBwao7H3EMBsM/W0aksYV0CD99m+xtDeUhpC0ZbcQqAjJxHamuIX H4pKko5rO+t0asMGgoRTDkm5td8BFfUs+73LBAY0LUjwFNcfbgjSYLoPLYKC6h2P MGrbSxs/uWBi1GF1ebhGTRilLvANcIz43YFFdvx2bHN2fCkvhWIxi/GfHjB9MYyk r1LkMmwzB30lp5mOR+nDU3b2IY0pAQ4RndCJ+TZWWkAPF4d8nqxClgtZ7rP8uW1l PvKVb75UEs321BPRuAg2bCLfoP48n018y6IvhXrcZwnUS2lETMd/Su1CepyZxjPp OGxJdphanNAl/AKDxOgyDeh6ntB/ltBEuEm4TH/Fcq2YG3iYFGk7g6Wht1UZdZ57 cjrWzbr79zD9uHCF3y7Cvsxr/rlVDM+xjwPGixXbf/O6shDvYNpxMTz7Zu0VjlzB r8uNazzK7ZvdOg1t6HyWxMWCqQdhYBCWbPS/xyIaZd+M+BBQnFvnv+BSgRYMw9cN eBBAw5YTNAFlusg89sT70q92W0BPTCs0YrKfLKnQnvnqMzmkat/OSh6SQ2rYR9DY FNsv9oHk7N+6S3sY6x9UJfyv8VXnYWKN5g7tcf+DFE0GTuKHVjDuHQQQYKf+nG34 jlQ4YBqa5tPVRY6A8UKB =H4d0 -----END PGP SIGNATURE----- --F6eEIoq8CwEl1rG35AdIf7Aw87QegITis-- From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 09:32:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE531742; Fri, 14 Mar 2014 09:32:05 +0000 (UTC) Received: from mta04.bitpro.no (mta04.bitpro.no [92.42.64.203]) by mx1.freebsd.org (Postfix) with ESMTP id 96CEBD61; Fri, 14 Mar 2014 09:32:05 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta04.bitpro.no (Postfix) with ESMTPS id 7105410021A; Fri, 14 Mar 2014 10:32:03 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 110008F8B13; Fri, 14 Mar 2014 10:31:57 +0100 (CET) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VpadQNjxwUqu; Fri, 14 Mar 2014 10:31:56 +0100 (CET) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) by mail.lockless.no (Postfix) with ESMTPSA id CB23E8F8A9B; Fri, 14 Mar 2014 10:31:56 +0100 (CET) Message-ID: <5322CCC5.7020608@bitfrost.no> Date: Fri, 14 Mar 2014 10:32:53 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Rui Paulo Subject: Re: svn commit: r262972 - head/sys/dev/usb/input References: <201403100852.s2A8qUdC045704@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 09:32:05 -0000 On 03/14/14 03:15, Rui Paulo wrote: > On 10 Mar 2014, at 01:52, Hans Petter Selasky wrote: > >> Author: hselasky >> Date: Mon Mar 10 08:52:30 2014 >> New Revision: 262972 >> URL: http://svnweb.freebsd.org/changeset/base/262972 >> >> Log: >> Ignore USB keyboard driver calls from critical sections. >> >> Reported by: Oliver Pinter >> MFC after: 1 week >> >> Modified: >> head/sys/dev/usb/input/ukbd.c >> >> Modified: head/sys/dev/usb/input/ukbd.c >> ============================================================================== >> --- head/sys/dev/usb/input/ukbd.c Mon Mar 10 06:41:48 2014 (r262971) >> +++ head/sys/dev/usb/input/ukbd.c Mon Mar 10 08:52:30 2014 (r262972) >> @@ -1909,6 +1909,12 @@ ukbd_ioctl(keyboard_t *kbd, u_long cmd, >> int result; >> >> /* >> + * XXX Check of someone is calling us from a critical section: >> + */ >> + if (curthread->td_critnest != 0) >> + return (EDEADLK); > > Shouldn't this panic? > > -- > Rui Paulo > Hi, This happens on shutdown, in some special case. Not sure if panic at shutdown is appropriate? --HPS From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 11:45:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F4DA98D; Fri, 14 Mar 2014 11:45:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7C961D04; Fri, 14 Mar 2014 11:45:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2EBjKnE057602; Fri, 14 Mar 2014 11:45:20 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2EBjKIg057601; Fri, 14 Mar 2014 11:45:20 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403141145.s2EBjKIg057601@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 14 Mar 2014 11:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263168 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 11:45:20 -0000 Author: glebius Date: Fri Mar 14 11:45:19 2014 New Revision: 263168 URL: http://svnweb.freebsd.org/changeset/base/263168 Log: Add placeholders for IPX/SPX and AppleTalk priveledges, to avoid number clashes with any future constants. Suggested by: rwatson Modified: head/sys/sys/priv.h Modified: head/sys/sys/priv.h ============================================================================== --- head/sys/sys/priv.h Fri Mar 14 10:30:17 2014 (r263167) +++ head/sys/sys/priv.h Fri Mar 14 11:45:19 2014 (r263168) @@ -347,6 +347,11 @@ #define PRIV_NET80211_MANAGE 441 /* Administer 802.11. */ /* + * Placeholder for AppleTalk privileges, not supported anymore. + */ +#define _PRIV_NETATALK_RESERVEDPORT 450 /* Bind low port number. */ + +/* * ATM privileges. */ #define PRIV_NETATM_CFG 460 @@ -387,6 +392,12 @@ #define PRIV_NETINET_BINDANY 506 /* Allow bind to any address. */ /* + * Placeholders for IPX/SPX privileges, not supported any more. + */ +#define _PRIV_NETIPX_RESERVEDPORT 520 /* Bind low port number. */ +#define _PRIV_NETIPX_RAW 521 /* Open netipx raw socket. */ + +/* * NCP privileges. */ #define PRIV_NETNCP 530 /* Use another user's connection. */ From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 12:15:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39AEE2C1; Fri, 14 Mar 2014 12:15:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2630BFE0; Fri, 14 Mar 2014 12:15:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2ECFTl4069632; Fri, 14 Mar 2014 12:15:29 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2ECFTnR069631; Fri, 14 Mar 2014 12:15:29 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201403141215.s2ECFTnR069631@svn.freebsd.org> From: Christian Brueffer Date: Fri, 14 Mar 2014 12:15:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263169 - head/sys/dev/amdtemp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 12:15:29 -0000 Author: brueffer Date: Fri Mar 14 12:15:28 2014 New Revision: 263169 URL: http://svnweb.freebsd.org/changeset/base/263169 Log: Add support for AMD Family 16h (Kabini) sensor devices. PR: 186587 Submitted by: David Rufino MFC after: 2 weeks Modified: head/sys/dev/amdtemp/amdtemp.c Modified: head/sys/dev/amdtemp/amdtemp.c ============================================================================== --- head/sys/dev/amdtemp/amdtemp.c Fri Mar 14 11:45:19 2014 (r263168) +++ head/sys/dev/amdtemp/amdtemp.c Fri Mar 14 12:15:28 2014 (r263169) @@ -79,6 +79,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_MISC12 0x1403 #define DEVICEID_AMD_MISC14 0x1703 #define DEVICEID_AMD_MISC15 0x1603 +#define DEVICEID_AMD_MISC16 0x1533 static struct amdtemp_product { uint16_t amdtemp_vendorid; @@ -90,6 +91,7 @@ static struct amdtemp_product { { VENDORID_AMD, DEVICEID_AMD_MISC12 }, { VENDORID_AMD, DEVICEID_AMD_MISC14 }, { VENDORID_AMD, DEVICEID_AMD_MISC15 }, + { VENDORID_AMD, DEVICEID_AMD_MISC16 }, { 0, 0 } }; @@ -204,6 +206,7 @@ amdtemp_probe(device_t dev) case 0x12: case 0x14: case 0x15: + case 0x16: break; default: return (ENXIO); @@ -327,6 +330,7 @@ amdtemp_attach(device_t dev) case 0x12: case 0x14: case 0x15: + case 0x16: /* * There is only one sensor per package. */ From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 12:21:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 563D15CF; Fri, 14 Mar 2014 12:21:30 +0000 (UTC) Received: from mail.vnode.se (mail.vnode.se [212.247.52.13]) by mx1.freebsd.org (Postfix) with ESMTP id C3EAC147; Fri, 14 Mar 2014 12:21:29 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id B91BEE3F07A; Fri, 14 Mar 2014 13:14:14 +0100 (CET) X-Virus-Scanned: amavisd-new at vnode.se Received: from mail.vnode.se ([127.0.0.1]) by mail.vnode.se (mail.vnode.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8HX-skNroxCZ; Fri, 14 Mar 2014 13:14:12 +0100 (CET) Received: from [10.101.102.191] (edsfw.benders.se [212.247.52.27]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id 5A081E3F079; Fri, 14 Mar 2014 13:14:11 +0100 (CET) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263110 - head/share/man/man4 From: Joel Dahl In-Reply-To: <5322C83F.6060109@FreeBSD.org> Date: Fri, 14 Mar 2014 13:14:10 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201403131619.s2DGJax1071196@svn.freebsd.org> <4D0B04BD-4EF6-4963-941E-012B81F8DFAB@jnielsen.net> <20140314015438.GO32089@funkthat.com> <5322C83F.6060109@FreeBSD.org> To: Christian Brueffer X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, John-Mark Gurney , John Nielsen , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 12:21:30 -0000 14 mar 2014 kl. 10:13 skrev Christian Brueffer : > On 3/14/14 2:54 AM, John-Mark Gurney wrote: >> John Nielsen wrote this message on Thu, Mar 13, 2014 at 16:28 -0600: >>> On Mar 13, 2014, at 10:19 AM, John-Mark Gurney = wrote: >>>=20 >>>> Author: jmg >>>> Date: Thu Mar 13 16:19:36 2014 >>>> New Revision: 263110 >>>> URL: http://svnweb.freebsd.org/changeset/base/263110 >>>>=20 >>>> Log: >>>> remove link to the missing AMD Geode LX SB man page... we can add = it >>>> back once someone cares enough to write one.. >>>=20 >>> You mean like this one? >>> http://svnweb.freebsd.org/base/head/share/man/man4/man4.i386/glxsb.4 >>=20 >> The problems of checking on an amd64 box... :( >>=20 >> Actually, how are we suppose to handle links to arch dependant man >> pages in arch independant man pages? I did this check on an amd64 = box, >> so the page glxsb didn't get installed... Should we just always >> install these man pages on all arches then? Or are we fine w/ >> references to non-existant pages (on some arches)? >>=20 >> Or should glxsb.4 be moved to an arch independant dir? >>=20 >=20 > I wonder if it makes sense to keep arch-dependent man directories at > all. I.e., if I prepare an ARM disk image on my amd64 laptop, I = really > want to have the arm manpages available on that amd64 box. >=20 > Does anyone see a reason not to move man4/man4.${ARCH}/*.4 to man4? > We're talking about 60 manpages here, so space is not really an issue. Sounds good to me. =97 Joel From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 12:52:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8298C669; Fri, 14 Mar 2014 12:52:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6CD7E68F; Fri, 14 Mar 2014 12:52:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2ECqurQ086085; Fri, 14 Mar 2014 12:52:56 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2ECqtL0086081; Fri, 14 Mar 2014 12:52:55 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403141252.s2ECqtL0086081@svn.freebsd.org> From: Julio Merino Date: Fri, 14 Mar 2014 12:52:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263172 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 12:52:56 -0000 Author: jmmv Date: Fri Mar 14 12:52:55 2014 New Revision: 263172 URL: http://svnweb.freebsd.org/changeset/base/263172 Log: Move FreeBSD Test Suite-specific code to a suite.test.mk file. The new suite.test.mk file contains all the logic needed to install test programs under /usr/tests/ and to support Kyua as the run-time engine. This file is included by default by bsd.test.mk so Makefiles do not need to care about its existence. Specific Makefiles can define NOT_FOR_TEST_SUITE to indicate that whatever test programs they are building are not supposed to be installed under /usr/tests/ nor run by Kyua. (The effect of passing this setting is that suite.test.mk is simply not included.) NOT_FOR_TEST_SUITE should never be used by Makefiles in the base system. This functionality is provided so that third-parties can hook in their own test code, with different semantics, if they wish. This was asked for by sjg@. Added: head/share/mk/suite.test.mk (contents, props changed) Modified: head/share/mk/Makefile head/share/mk/bsd.test.mk Modified: head/share/mk/Makefile ============================================================================== --- head/share/mk/Makefile Fri Mar 14 12:42:30 2014 (r263171) +++ head/share/mk/Makefile Fri Mar 14 12:52:55 2014 (r263172) @@ -46,6 +46,7 @@ FILESDIR= ${BINDIR}/mk .if ${MK_TESTS} != "no" FILES+= atf.test.mk FILES+= plain.test.mk +FILES+= suite.test.mk FILES+= tap.test.mk .endif Modified: head/share/mk/bsd.test.mk ============================================================================== --- head/share/mk/bsd.test.mk Fri Mar 14 12:42:30 2014 (r263171) +++ head/share/mk/bsd.test.mk Fri Mar 14 12:52:55 2014 (r263172) @@ -10,14 +10,6 @@ ____: -# Directory in which to install tests defined by the current Makefile. -# Makefiles have to override this to point to a subdirectory of TESTSBASE. -TESTSDIR?= . - -# Name of the test suite these tests belong to. Should rarely be changed for -# Makefiles built into the FreeBSD src tree. -TESTSUITE?= FreeBSD - # List of subdirectories containing tests into which to recurse. This has the # same semantics as SUBDIR at build-time. However, the directories listed here # get registered into the run-time test suite definitions so that the test @@ -27,31 +19,10 @@ TESTSUITE?= FreeBSD # SUBDIR for directories that may contain helper binaries and/or data files. TESTS_SUBDIRS?= -# Knob to control the handling of the Kyuafile for this Makefile. -# -# If 'yes', a Kyuafile exists in the source tree and is installed into -# TESTSDIR. -# -# If 'auto', a Kyuafile is automatically generated based on the list of test -# programs built by the Makefile and is installed into TESTSDIR. This is the -# default and is sufficient in the majority of the cases. -# -# If 'no', no Kyuafile is installed. -KYUAFILE?= auto - -# Per-test program interface definition. -# -# The name provided here must match one of the interface names supported by -# Kyua as this is later encoded in the Kyuafile test program definitions. -#TEST_INTERFACE.= interface-name - -# Per-test program metadata properties as a list of key/value pairs. -# -# All the variables for a particular program are appended to the program's -# definition in the Kyuafile. This feature can be used to avoid having to -# explicitly supply a Kyuafile in the source directory, allowing the caller -# Makefile to rely on the KYUAFILE=auto behavior defined here. -#TEST_METADATA.+= key="value" +# If defined, indicates that the tests built by the Makefile are not part of +# the FreeBSD Test Suite. The implication of this is that the tests won't be +# installed under /usr/tests/ and that Kyua won't be able to run them. +#NOT_FOR_TEST_SUITE= # List of variables to pass to the tests at run-time via the environment. TESTS_ENV?= @@ -65,13 +36,6 @@ TESTS_ENV+= PATH=${TESTS_PATH:tW:C/ +/:/ TESTS_LD_LIBRARY_PATH+= ${DESTDIR}/lib ${DESTDIR}/usr/lib TESTS_ENV+= LD_LIBRARY_PATH=${TESTS_LD_LIBRARY_PATH:tW:C/ +/:/g} -# Path to the prefix of the installed Kyua CLI, if any. -# -# If kyua is installed from ports, we automatically define a realtest target -# below to run the tests using this tool. The tools are searched for in the -# hierarchy specified by this variable. -KYUA_PREFIX?= /usr/local - # List of all tests being built. The various *.test.mk modules extend this # variable as needed. _TESTS= @@ -95,82 +59,9 @@ WITHOUT_MAN=yes PROG_VARS+= BINDIR PROGS_TARGETS+= install -.if ${KYUAFILE:tl} == "yes" -FILES+= Kyuafile -FILESDIR_Kyuafile= ${TESTSDIR} - -CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp -.elif ${KYUAFILE:tl} == "auto" -FILES+= Kyuafile.auto -FILESDIR_Kyuafile.auto= ${TESTSDIR} -FILESNAME_Kyuafile.auto= Kyuafile - -CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp - -.NOPATH: Kyuafile.auto -Kyuafile.auto: Makefile - @{ \ - echo '-- Automatically generated by bsd.test.mk.'; \ - echo; \ - echo 'syntax(2)'; \ - echo; \ - echo 'test_suite("${TESTSUITE}")'; \ - echo; \ - } >Kyuafile.auto.tmp -.for _T in ${_TESTS} - @echo '${TEST_INTERFACE.${_T}}_test_program{name="${_T}"${TEST_METADATA.${_T}:C/$/,/:tW:C/^/, /W:C/,$//W}}' \ - >>Kyuafile.auto.tmp -.endfor -.for _T in ${TESTS_SUBDIRS:N.WAIT} - @echo "include(\"${_T}/Kyuafile\")" >>Kyuafile.auto.tmp -.endfor - @mv Kyuafile.auto.tmp Kyuafile.auto -.endif - -KYUA?= ${KYUA_PREFIX}/bin/kyua -.if exists(${KYUA}) -# Definition of the "make test" target and supporting variables. -# -# This target, by necessity, can only work for native builds (i.e. a FreeBSD -# host building a release for the same system). The target runs Kyua, which is -# not in the toolchain, and the tests execute code built for the target host. -# -# Due to the dependencies of the binaries built by the source tree and how they -# are used by tests, it is highly possible for a execution of "make test" to -# report bogus results unless the new binaries are put in place. -realtest: .PHONY - @echo "*** WARNING: make test is experimental" - @echo "***" - @echo "*** Using this test does not preclude you from running the tests" - @echo "*** installed in ${TESTSBASE}. This test run may raise false" - @echo "*** positives and/or false negatives." - @echo - @set -e; \ - ${KYUA} test -k ${DESTDIR}${TESTSDIR}/Kyuafile; \ - result=0; \ - echo; \ - echo "*** Once again, note that "make test" is unsupported."; \ - test $${result} -eq 0 -.endif - -beforetest: .PHONY -.if defined(TESTSDIR) -.if ${TESTSDIR} == ${TESTSBASE} -# Forbid running from ${TESTSBASE}. It can cause false positives/negatives and -# it does not cover all the tests (e.g. it misses testing software in external). - @echo "*** Sorry, you cannot use make test from src/tests. Install the" - @echo "*** tests into their final location and run them from ${TESTSBASE}" - @false -.else - @echo "*** Using this test does not preclude you from running the tests" - @echo "*** installed in ${TESTSBASE}. This test run may raise false" - @echo "*** positives and/or false negatives." -.endif -.else - @echo "*** No TESTSDIR defined; nothing to do." - @false +.if !defined(NOT_FOR_TEST_SUITE) +.include .endif - @echo .if !target(realtest) realtest: .PHONY Added: head/share/mk/suite.test.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/mk/suite.test.mk Fri Mar 14 12:52:55 2014 (r263172) @@ -0,0 +1,127 @@ +# $FreeBSD$ +# +# You must include bsd.test.mk instead of this file from your Makefile. +# +# Internal glue for the build of /usr/tests/. + +.if !target(____) +.error suite.test.mk cannot be included directly. +.endif + +# Directory in which to install tests defined by the current Makefile. +# Makefiles have to override this to point to a subdirectory of TESTSBASE. +TESTSDIR?= . + +# Name of the test suite these tests belong to. Should rarely be changed for +# Makefiles built into the FreeBSD src tree. +TESTSUITE?= FreeBSD + +# Knob to control the handling of the Kyuafile for this Makefile. +# +# If 'yes', a Kyuafile exists in the source tree and is installed into +# TESTSDIR. +# +# If 'auto', a Kyuafile is automatically generated based on the list of test +# programs built by the Makefile and is installed into TESTSDIR. This is the +# default and is sufficient in the majority of the cases. +# +# If 'no', no Kyuafile is installed. +KYUAFILE?= auto + +# Per-test program interface definition. +# +# The name provided here must match one of the interface names supported by +# Kyua as this is later encoded in the Kyuafile test program definitions. +#TEST_INTERFACE.= interface-name + +# Per-test program metadata properties as a list of key/value pairs. +# +# All the variables for a particular program are appended to the program's +# definition in the Kyuafile. This feature can be used to avoid having to +# explicitly supply a Kyuafile in the source directory, allowing the caller +# Makefile to rely on the KYUAFILE=auto behavior defined here. +#TEST_METADATA.+= key="value" + +# Path to the prefix of the installed Kyua CLI, if any. +# +# If kyua is installed from ports, we automatically define a realtest target +# below to run the tests using this tool. The tools are searched for in the +# hierarchy specified by this variable. +KYUA_PREFIX?= /usr/local + +.if ${KYUAFILE:tl} == "yes" +FILES+= Kyuafile +FILESDIR_Kyuafile= ${TESTSDIR} + +CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp +.elif ${KYUAFILE:tl} == "auto" +FILES+= Kyuafile.auto +FILESDIR_Kyuafile.auto= ${TESTSDIR} +FILESNAME_Kyuafile.auto= Kyuafile + +CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp + +.NOPATH: Kyuafile.auto +Kyuafile.auto: Makefile + @{ \ + echo '-- Automatically generated by bsd.test.mk.'; \ + echo; \ + echo 'syntax(2)'; \ + echo; \ + echo 'test_suite("${TESTSUITE}")'; \ + echo; \ + } >Kyuafile.auto.tmp +.for _T in ${_TESTS} + @echo '${TEST_INTERFACE.${_T}}_test_program{name="${_T}"${TEST_METADATA.${_T}:C/$/,/:tW:C/^/, /W:C/,$//W}}' \ + >>Kyuafile.auto.tmp +.endfor +.for _T in ${TESTS_SUBDIRS:N.WAIT} + @echo "include(\"${_T}/Kyuafile\")" >>Kyuafile.auto.tmp +.endfor + @mv Kyuafile.auto.tmp Kyuafile.auto +.endif + +KYUA?= ${KYUA_PREFIX}/bin/kyua +.if exists(${KYUA}) +# Definition of the "make test" target and supporting variables. +# +# This target, by necessity, can only work for native builds (i.e. a FreeBSD +# host building a release for the same system). The target runs Kyua, which is +# not in the toolchain, and the tests execute code built for the target host. +# +# Due to the dependencies of the binaries built by the source tree and how they +# are used by tests, it is highly possible for a execution of "make test" to +# report bogus results unless the new binaries are put in place. +realtest: .PHONY + @echo "*** WARNING: make test is experimental" + @echo "***" + @echo "*** Using this test does not preclude you from running the tests" + @echo "*** installed in ${TESTSBASE}. This test run may raise false" + @echo "*** positives and/or false negatives." + @echo + @set -e; \ + ${KYUA} test -k ${DESTDIR}${TESTSDIR}/Kyuafile; \ + result=0; \ + echo; \ + echo "*** Once again, note that "make test" is unsupported."; \ + test $${result} -eq 0 +.endif + +beforetest: .PHONY +.if defined(TESTSDIR) +.if ${TESTSDIR} == ${TESTSBASE} +# Forbid running from ${TESTSBASE}. It can cause false positives/negatives and +# it does not cover all the tests (e.g. it misses testing software in external). + @echo "*** Sorry, you cannot use make test from src/tests. Install the" + @echo "*** tests into their final location and run them from ${TESTSBASE}" + @false +.else + @echo "*** Using this test does not preclude you from running the tests" + @echo "*** installed in ${TESTSBASE}. This test run may raise false" + @echo "*** positives and/or false negatives." +.endif +.else + @echo "*** No TESTSDIR defined; nothing to do." + @false +.endif + @echo From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 12:55:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BC6A878; Fri, 14 Mar 2014 12:55:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2F23F6B6; Fri, 14 Mar 2014 12:55:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2ECt7JB086448; Fri, 14 Mar 2014 12:55:07 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2ECt7Dm086447; Fri, 14 Mar 2014 12:55:07 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403141255.s2ECt7Dm086447@svn.freebsd.org> From: Julio Merino Date: Fri, 14 Mar 2014 12:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263173 - head/share/examples/tests/tests/atf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 12:55:07 -0000 Author: jmmv Date: Fri Mar 14 12:55:06 2014 New Revision: 263173 URL: http://svnweb.freebsd.org/changeset/base/263173 Log: Remove unnecessary svn:executable property from source file. The atf cp_test.sh sample file should have never been marked executable in the first place because this file needs to be "built" first before being usable. Modified: Directory Properties: head/share/examples/tests/tests/atf/cp_test.sh (props changed) From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 13:55:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 859F9673; Fri, 14 Mar 2014 13:55:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7192ADBF; Fri, 14 Mar 2014 13:55:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2EDtnth011820; Fri, 14 Mar 2014 13:55:49 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2EDtnQi011818; Fri, 14 Mar 2014 13:55:49 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403141355.s2EDtnQi011818@svn.freebsd.org> From: Bryan Drewery Date: Fri, 14 Mar 2014 13:55:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263174 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 13:55:49 -0000 Author: bdrewery Date: Fri Mar 14 13:55:48 2014 New Revision: 263174 URL: http://svnweb.freebsd.org/changeset/base/263174 Log: Rename cnt to maxcookies and change its use as the condition for when to lookup cookies to be less obscure. No functional change. Since r245115, cnt has not really been needed in tmpfs_dir_getdents(). Keep it for the MPASS() for now though. Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks Modified: head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Fri Mar 14 12:55:06 2014 (r263173) +++ head/sys/fs/tmpfs/tmpfs_subr.c Fri Mar 14 13:55:48 2014 (r263174) @@ -1147,7 +1147,7 @@ tmpfs_dir_getdotdotdent(struct tmpfs_nod * error code if another error happens. */ int -tmpfs_dir_getdents(struct tmpfs_node *node, struct uio *uio, int cnt, +tmpfs_dir_getdents(struct tmpfs_node *node, struct uio *uio, int maxcookies, u_long *cookies, int *ncookies) { struct tmpfs_dir_cursor dc; @@ -1173,7 +1173,7 @@ tmpfs_dir_getdents(struct tmpfs_node *no if (error != 0) return (error); uio->uio_offset = TMPFS_DIRCOOKIE_DOTDOT; - if (cnt != 0) + if (cookies != NULL) cookies[(*ncookies)++] = off = uio->uio_offset; case TMPFS_DIRCOOKIE_DOTDOT: error = tmpfs_dir_getdotdotdent(node, uio); @@ -1181,7 +1181,7 @@ tmpfs_dir_getdents(struct tmpfs_node *no return (error); de = tmpfs_dir_first(node, &dc); uio->uio_offset = tmpfs_dirent_cookie(de); - if (cnt != 0) + if (cookies != NULL) cookies[(*ncookies)++] = off = uio->uio_offset; /* EOF. */ if (de == NULL) @@ -1193,7 +1193,7 @@ tmpfs_dir_getdents(struct tmpfs_node *no de = tmpfs_dir_lookup_cookie(node, uio->uio_offset, &dc); if (de == NULL) return (EINVAL); - if (cnt != 0) + if (cookies != NULL) off = tmpfs_dirent_cookie(de); } @@ -1261,18 +1261,19 @@ tmpfs_dir_getdents(struct tmpfs_node *no error = uiomove(&d, d.d_reclen, uio); if (error == 0) { de = tmpfs_dir_next(node, &dc); - if (cnt != 0) { + if (cookies != NULL) { off = tmpfs_dirent_cookie(de); - MPASS(*ncookies < cnt); + MPASS(*ncookies < maxcookies); cookies[(*ncookies)++] = off; } } } while (error == 0 && uio->uio_resid > 0 && de != NULL); - /* Update the offset and cache. */ - if (cnt == 0) + /* Skip setting off when using cookies as it is already done above. */ + if (cookies == NULL) off = tmpfs_dirent_cookie(de); + /* Update the offset and cache. */ uio->uio_offset = off; node->tn_dir.tn_readdir_lastn = off; node->tn_dir.tn_readdir_lastp = de; Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Fri Mar 14 12:55:06 2014 (r263173) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Fri Mar 14 13:55:48 2014 (r263174) @@ -1199,32 +1199,38 @@ tmpfs_readdir(struct vop_readdir_args *v int error; ssize_t startresid; - int cnt = 0; + int maxcookies; struct tmpfs_node *node; /* This operation only makes sense on directory nodes. */ if (vp->v_type != VDIR) return ENOTDIR; + maxcookies = 0; node = VP_TO_TMPFS_DIR(vp); startresid = uio->uio_resid; + /* Allocate cookies for NFS and compat modules. */ if (cookies != NULL && ncookies != NULL) { - cnt = howmany(node->tn_size, sizeof(struct tmpfs_dirent)) + 2; - *cookies = malloc(cnt * sizeof(**cookies), M_TEMP, M_WAITOK); + maxcookies = howmany(node->tn_size, + sizeof(struct tmpfs_dirent)) + 2; + *cookies = malloc(maxcookies * sizeof(**cookies), M_TEMP, + M_WAITOK); *ncookies = 0; } - if (cnt == 0) + if (cookies == NULL) error = tmpfs_dir_getdents(node, uio, 0, NULL, NULL); else - error = tmpfs_dir_getdents(node, uio, cnt, *cookies, ncookies); + error = tmpfs_dir_getdents(node, uio, maxcookies, *cookies, + ncookies); + /* Buffer was filled without hitting EOF. */ if (error == EJUSTRETURN) error = (uio->uio_resid != startresid) ? 0 : EINVAL; - if (error != 0 && cnt != 0) + if (error != 0 && cookies != NULL) free(*cookies, M_TEMP); if (eofflag != NULL) From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 13:58:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E1697D4; Fri, 14 Mar 2014 13:58:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6AA1FDDA; Fri, 14 Mar 2014 13:58:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2EDw311012100; Fri, 14 Mar 2014 13:58:03 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2EDw3hU012098; Fri, 14 Mar 2014 13:58:03 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403141358.s2EDw3hU012098@svn.freebsd.org> From: Bryan Drewery Date: Fri, 14 Mar 2014 13:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263175 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 13:58:03 -0000 Author: bdrewery Date: Fri Mar 14 13:58:02 2014 New Revision: 263175 URL: http://svnweb.freebsd.org/changeset/base/263175 Log: Add missing FALLTHROUGH comment in tmpfs_dir_getdents for looking up '.' and '..'. Reviewed by: Russell Cattelan Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks Modified: head/sys/fs/tmpfs/tmpfs_subr.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Fri Mar 14 13:55:48 2014 (r263174) +++ head/sys/fs/tmpfs/tmpfs_subr.c Fri Mar 14 13:58:02 2014 (r263175) @@ -1175,6 +1175,7 @@ tmpfs_dir_getdents(struct tmpfs_node *no uio->uio_offset = TMPFS_DIRCOOKIE_DOTDOT; if (cookies != NULL) cookies[(*ncookies)++] = off = uio->uio_offset; + /* FALLTHROUGH */ case TMPFS_DIRCOOKIE_DOTDOT: error = tmpfs_dir_getdotdotdent(node, uio); if (error != 0) From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 14:37:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E8656F5 for ; Fri, 14 Mar 2014 14:37:50 +0000 (UTC) Received: from mail-ie0-f177.google.com (mail-ie0-f177.google.com [209.85.223.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C9AFF24C for ; Fri, 14 Mar 2014 14:37:49 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id rl12so2500124iec.8 for ; Fri, 14 Mar 2014 07:37:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=IulJvt6zNRMjzzzdByVhIeLBxSFOMoSzzLgKP4idug4=; b=IjNDOGRAOGWla4UJd+zPKnn8XM1YsSj65VtdIldQTwYVxKU4xxm+4LlHpjwXcf2L0f Wv3l9eF+sGXmgQHdHeUicMr5D9kGlUvFYkQfO7gFIUuougX1YsjEpfLGuu8Ngj0aut+m VCnnxI1KN7LVqphHPpJDz9IIm6T3oD1Mk+VCd+sP6SxYr2C+ZEZUdY6rS4kjZnzu/iA7 UWpI+jB4zYj5lm9sA2YU3VXE0O3/lWdWqnU/8y/SuJGWuxVhjSD2X2YOEx2n8HD1uS8G 7qTGNe0tWsjaRV+oOss2adqzlARkDYs20qZWwOIE1d/1uqYYhxU+dn0aPiJP3gR3UzP7 ILCw== X-Gm-Message-State: ALoCoQm+ZzJLL5uDXlP+SL/gRSAEjXxiTpN7+1VSiT99GVzE0ltr/8oHA6uxHhWJMCdyM7ToOZim X-Received: by 10.42.64.17 with SMTP id e17mr6846857ici.26.1394807415630; Fri, 14 Mar 2014 07:30:15 -0700 (PDT) Received: from netflix-mac.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id an1sm19824224igc.0.2014.03.14.07.30.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Mar 2014 07:30:15 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263110 - head/share/man/man4 From: Warner Losh In-Reply-To: <5322C83F.6060109@FreeBSD.org> Date: Fri, 14 Mar 2014 08:30:08 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201403131619.s2DGJax1071196@svn.freebsd.org> <4D0B04BD-4EF6-4963-941E-012B81F8DFAB@jnielsen.net> <20140314015438.GO32089@funkthat.com> <5322C83F.6060109@FreeBSD.org> To: Christian Brueffer X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, John-Mark Gurney , John Nielsen , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 14:37:50 -0000 On Mar 14, 2014, at 3:13 AM, Christian Brueffer = wrote: > On 3/14/14 2:54 AM, John-Mark Gurney wrote: >> John Nielsen wrote this message on Thu, Mar 13, 2014 at 16:28 -0600: >>> On Mar 13, 2014, at 10:19 AM, John-Mark Gurney = wrote: >>>=20 >>>> Author: jmg >>>> Date: Thu Mar 13 16:19:36 2014 >>>> New Revision: 263110 >>>> URL: http://svnweb.freebsd.org/changeset/base/263110 >>>>=20 >>>> Log: >>>> remove link to the missing AMD Geode LX SB man page... we can add = it >>>> back once someone cares enough to write one.. >>>=20 >>> You mean like this one? >>> http://svnweb.freebsd.org/base/head/share/man/man4/man4.i386/glxsb.4 >>=20 >> The problems of checking on an amd64 box... :( >>=20 >> Actually, how are we suppose to handle links to arch dependant man >> pages in arch independant man pages? I did this check on an amd64 = box, >> so the page glxsb didn't get installed... Should we just always >> install these man pages on all arches then? Or are we fine w/ >> references to non-existant pages (on some arches)? >>=20 >> Or should glxsb.4 be moved to an arch independant dir? >>=20 >=20 > I wonder if it makes sense to keep arch-dependent man directories at > all. I.e., if I prepare an ARM disk image on my amd64 laptop, I = really > want to have the arm manpages available on that amd64 box. >=20 > Does anyone see a reason not to move man4/man4.${ARCH}/*.4 to man4? > We're talking about 60 manpages here, so space is not really an issue. Historically there was the separation because xp on one platform might = be radically different from xp on another platform. The other reason was = confusion because it wasn=92t always clear if device foo actually worked on = platform X. Do we have any collisions like that? If so, we need to resolve those = first. Also, it would be good to tag the ones that are arm specific as such = somehow. Warner From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 15:22:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1821E80; Fri, 14 Mar 2014 15:22:13 +0000 (UTC) Received: from felyko.com (felyko.com [174.136.100.2]) by mx1.freebsd.org (Postfix) with ESMTP id AA6078D7; Fri, 14 Mar 2014 15:22:13 +0000 (UTC) Received: from [10.0.1.3] (c-24-6-115-18.hsd1.ca.comcast.net [24.6.115.18]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id C8E5B39841; Fri, 14 Mar 2014 08:22:05 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r262972 - head/sys/dev/usb/input From: Rui Paulo In-Reply-To: <5322CCC5.7020608@bitfrost.no> Date: Fri, 14 Mar 2014 08:22:16 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201403100852.s2A8qUdC045704@svn.freebsd.org> <5322CCC5.7020608@bitfrost.no> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 15:22:13 -0000 On 14 Mar 2014, at 02:32, Hans Petter Selasky wrote: > On 03/14/14 03:15, Rui Paulo wrote: >> On 10 Mar 2014, at 01:52, Hans Petter Selasky = wrote: >>=20 >>> Author: hselasky >>> Date: Mon Mar 10 08:52:30 2014 >>> New Revision: 262972 >>> URL: http://svnweb.freebsd.org/changeset/base/262972 >>>=20 >>> Log: >>> Ignore USB keyboard driver calls from critical sections. >>>=20 >>> Reported by: Oliver Pinter >>> MFC after: 1 week >>>=20 >>> Modified: >>> head/sys/dev/usb/input/ukbd.c >>>=20 >>> Modified: head/sys/dev/usb/input/ukbd.c >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/sys/dev/usb/input/ukbd.c Mon Mar 10 06:41:48 2014 = (r262971) >>> +++ head/sys/dev/usb/input/ukbd.c Mon Mar 10 08:52:30 2014 = (r262972) >>> @@ -1909,6 +1909,12 @@ ukbd_ioctl(keyboard_t *kbd, u_long cmd, >>> int result; >>>=20 >>> /* >>> + * XXX Check of someone is calling us from a critical section: >>> + */ >>> + if (curthread->td_critnest !=3D 0) >>> + return (EDEADLK); >>=20 >> Shouldn't this panic? >>=20 >> -- >> Rui Paulo >>=20 >=20 > Hi, >=20 > This happens on shutdown, in some special case. Not sure if panic at = shutdown is appropriate? I thought this was a programming error. Do we know the special cases = and why it happens? -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 16:41:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0513DB40; Fri, 14 Mar 2014 16:41:10 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D23CF9A; Fri, 14 Mar 2014 16:41:09 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s2EGf7u1047658 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 14 Mar 2014 09:41:08 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s2EGf7ok047657; Fri, 14 Mar 2014 09:41:07 -0700 (PDT) (envelope-from jmg) Date: Fri, 14 Mar 2014 09:41:07 -0700 From: John-Mark Gurney To: Warner Losh Subject: Re: svn commit: r263110 - head/share/man/man4 Message-ID: <20140314164107.GS32089@funkthat.com> References: <201403131619.s2DGJax1071196@svn.freebsd.org> <4D0B04BD-4EF6-4963-941E-012B81F8DFAB@jnielsen.net> <20140314015438.GO32089@funkthat.com> <5322C83F.6060109@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Fri, 14 Mar 2014 09:41:08 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, John Nielsen , src-committers@freebsd.org, Christian Brueffer X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 16:41:10 -0000 Warner Losh wrote this message on Fri, Mar 14, 2014 at 08:30 -0600: > On Mar 14, 2014, at 3:13 AM, Christian Brueffer wrote: > > > On 3/14/14 2:54 AM, John-Mark Gurney wrote: > >> John Nielsen wrote this message on Thu, Mar 13, 2014 at 16:28 -0600: > >>> On Mar 13, 2014, at 10:19 AM, John-Mark Gurney wrote: > >>> > >>>> Author: jmg > >>>> Date: Thu Mar 13 16:19:36 2014 > >>>> New Revision: 263110 > >>>> URL: http://svnweb.freebsd.org/changeset/base/263110 > >>>> > >>>> Log: > >>>> remove link to the missing AMD Geode LX SB man page... we can add it > >>>> back once someone cares enough to write one.. > >>> > >>> You mean like this one? > >>> http://svnweb.freebsd.org/base/head/share/man/man4/man4.i386/glxsb.4 > >> > >> The problems of checking on an amd64 box... :( > >> > >> Actually, how are we suppose to handle links to arch dependant man > >> pages in arch independant man pages? I did this check on an amd64 box, > >> so the page glxsb didn't get installed... Should we just always > >> install these man pages on all arches then? Or are we fine w/ > >> references to non-existant pages (on some arches)? > >> > >> Or should glxsb.4 be moved to an arch independant dir? > >> > > > > I wonder if it makes sense to keep arch-dependent man directories at > > all. I.e., if I prepare an ARM disk image on my amd64 laptop, I really > > want to have the arm manpages available on that amd64 box. > > > > Does anyone see a reason not to move man4/man4.${ARCH}/*.4 to man4? > > We're talking about 60 manpages here, so space is not really an issue. > > Historically there was the separation because xp on one platform might be > radically different from xp on another platform. The other reason was confusion > because it wasn?t always clear if device foo actually worked on platform X. We have less of that issue now, but it could still be.. but issues like that can be addressed other ways, though kernel config, release notes, etc.. I doubt people use manpages as a guage if a device worked on their arch... Plus, if the device is shared and known not to work on a specific arch, that should be listed in the BUGS section of the man page.. :) > Do we have any collisions like that? If so, we need to resolve those first. Doesn't look like it... $ grep ^_ Makefile | sed -e 's/.4.*//' | wc -l 86 $ grep ^_ Makefile | sed -e 's/.4.*//' | sort -u | wc -l 86 It's also telling that besides i386 and amd64 specific man pages, we only have one mips specific man page in man4... This won't address the other man pages for arch specific utilities and libraries though, like sunlabel... > Also, it would be good to tag the ones that are arm specific as such somehow. Should we just tag the pages w/ a section listing relevant architectures, or break the beauty of single digit section numbers and do 4.i386? I just realized that we host man pages on FreeBSD.org, how do we make sure we get all of them for all arches? Looks like we don't, as glxsb.4 isn't available... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 16:47:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E84C6E37 for ; Fri, 14 Mar 2014 16:47:44 +0000 (UTC) Received: from mail-ig0-f172.google.com (mail-ig0-f172.google.com [209.85.213.172]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AE8BF191 for ; Fri, 14 Mar 2014 16:47:44 +0000 (UTC) Received: by mail-ig0-f172.google.com with SMTP id uq10so20643275igb.5 for ; Fri, 14 Mar 2014 09:47:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=KLWCM7LA7lbnuTDZQqnmyQLk+xNxSuJiyfoIMW6Q+zE=; b=IB1Dd8bgcB9xslak1e4K5B79NNuqn6lERSzUQkrvjlDG4OjYvOvz+FBbWgX/kZN9Wd tHWLSe0dk7njOAGm9U1bx33rXPZfIXerJoChdIVAJGHaGhUu14RoczdptFwrQyNFKtP9 gyKICnU5V2283K+CFB+DU16mCQNBMn/0hZE82kTZVnC23XyGj/8i5MSwCCE4o6nWC4ft JX6AlEKSqM1Wr7vUsT38AuenaaqqB5pnSBwelfMQ0wA1/AwCmksM2cO0d3erBM7dnmyy vS1pg1tjkdmymighieZrZVav3aS4U20kOUluDK0VTst5TQW/MJLoGpBzINF656b/Z+Ul pLOA== X-Gm-Message-State: ALoCoQlnILSXyKriq9c40CfDPdoDmWMhrUpS6gJtKN9NK7A4fqXZ2v4rgmzVmRtawRDi2CzQzwdM X-Received: by 10.43.65.145 with SMTP id xm17mr7728673icb.35.1394815658290; Fri, 14 Mar 2014 09:47:38 -0700 (PDT) Received: from netflix-mac.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id u1sm20862249igm.8.2014.03.14.09.47.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Mar 2014 09:47:37 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263110 - head/share/man/man4 From: Warner Losh In-Reply-To: <20140314164107.GS32089@funkthat.com> Date: Fri, 14 Mar 2014 10:47:32 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <933F8270-90C1-4AFE-9F39-A7ADBC05C772@bsdimp.com> References: <201403131619.s2DGJax1071196@svn.freebsd.org> <4D0B04BD-4EF6-4963-941E-012B81F8DFAB@jnielsen.net> <20140314015438.GO32089@funkthat.com> <5322C83F.6060109@FreeBSD.org> <20140314164107.GS32089@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, John Nielsen , src-committers@freebsd.org, Christian Brueffer X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 16:47:45 -0000 On Mar 14, 2014, at 10:41 AM, John-Mark Gurney wrote: > Warner Losh wrote this message on Fri, Mar 14, 2014 at 08:30 -0600: >> On Mar 14, 2014, at 3:13 AM, Christian Brueffer = wrote: >>=20 >>> On 3/14/14 2:54 AM, John-Mark Gurney wrote: >>>> John Nielsen wrote this message on Thu, Mar 13, 2014 at 16:28 = -0600: >>>>> On Mar 13, 2014, at 10:19 AM, John-Mark Gurney = wrote: >>>>>=20 >>>>>> Author: jmg >>>>>> Date: Thu Mar 13 16:19:36 2014 >>>>>> New Revision: 263110 >>>>>> URL: http://svnweb.freebsd.org/changeset/base/263110 >>>>>>=20 >>>>>> Log: >>>>>> remove link to the missing AMD Geode LX SB man page... we can add = it >>>>>> back once someone cares enough to write one.. >>>>>=20 >>>>> You mean like this one? >>>>> = http://svnweb.freebsd.org/base/head/share/man/man4/man4.i386/glxsb.4 >>>>=20 >>>> The problems of checking on an amd64 box... :( >>>>=20 >>>> Actually, how are we suppose to handle links to arch dependant man >>>> pages in arch independant man pages? I did this check on an amd64 = box, >>>> so the page glxsb didn't get installed... Should we just always >>>> install these man pages on all arches then? Or are we fine w/ >>>> references to non-existant pages (on some arches)? >>>>=20 >>>> Or should glxsb.4 be moved to an arch independant dir? >>>>=20 >>>=20 >>> I wonder if it makes sense to keep arch-dependent man directories at >>> all. I.e., if I prepare an ARM disk image on my amd64 laptop, I = really >>> want to have the arm manpages available on that amd64 box. >>>=20 >>> Does anyone see a reason not to move man4/man4.${ARCH}/*.4 to man4? >>> We're talking about 60 manpages here, so space is not really an = issue. >>=20 >> Historically there was the separation because xp on one platform = might be >> radically different from xp on another platform. The other reason was = confusion >> because it wasn?t always clear if device foo actually worked on = platform X. >=20 > We have less of that issue now, but it could still be.. but issues = like > that can be addressed other ways, though kernel config, release notes, > etc.. I doubt people use manpages as a guage if a device worked on > their arch... Plus, if the device is shared and known not to work on > a specific arch, that should be listed in the BUGS section of the man > page.. :) Yea, kinda my point :) >> Do we have any collisions like that? If so, we need to resolve those = first. >=20 > Doesn't look like it... > $ grep ^_ Makefile | sed -e 's/.4.*//' | wc -l > 86 > $ grep ^_ Makefile | sed -e 's/.4.*//' | sort -u | wc -l > 86 >=20 > It's also telling that besides i386 and amd64 specific man pages, we > only have one mips specific man page in man4=85 True enough, I hadn=92t looked... > This won't address the other man pages for arch specific utilities > and libraries though, like sunlabel=85 True, but those are niche things, so it is less important :) >> Also, it would be good to tag the ones that are arm specific as such = somehow. >=20 > Should we just tag the pages w/ a section listing relevant = architectures, > or break the beauty of single digit section numbers and do 4.i386? Tag in the man page itself, either in its own unique section, or in = BUGS. > I just realized that we host man pages on FreeBSD.org, how do we make > sure we get all of them for all arches? Looks like we don't, as > glxsb.4 isn't available=85 I=92d move them all into man4, which will solve this problem. The ones = that are truly arch specific should have BUGS entries added for them. Warner= From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 16:55:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C5AEDE; Fri, 14 Mar 2014 16:55:25 +0000 (UTC) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A0C5D25E; Fri, 14 Mar 2014 16:55:24 +0000 (UTC) Received: from dator167.onk.lu.se (dator167.onk.lu.se [130.235.5.190]) by mrelayeu.kundenserver.de (node=mreue101) with ESMTP (Nemesis) id 0MgfcV-1WkpSg0nR9-00NxCI; Fri, 14 Mar 2014 17:55:21 +0100 Message-ID: <53233477.7060400@FreeBSD.org> Date: Fri, 14 Mar 2014 17:55:19 +0100 From: Christian Brueffer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Warner Losh , John-Mark Gurney Subject: Re: svn commit: r263110 - head/share/man/man4 References: <201403131619.s2DGJax1071196@svn.freebsd.org> <4D0B04BD-4EF6-4963-941E-012B81F8DFAB@jnielsen.net> <20140314015438.GO32089@funkthat.com> <5322C83F.6060109@FreeBSD.org> <20140314164107.GS32089@funkthat.com> <933F8270-90C1-4AFE-9F39-A7ADBC05C772@bsdimp.com> In-Reply-To: <933F8270-90C1-4AFE-9F39-A7ADBC05C772@bsdimp.com> X-Enigmail-Version: 1.6 OpenPGP: id=3A67DC36; url=http://people.freebsd.org/~brueffer/brueffer.key.asc Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ddKqq6cLAUmMJTHCPMrEjkAoSaq0VlnVd" X-Provags-ID: V02:K0:IpwOQM1Vl1VNQ/1G1xzlBylUFLf4nTCKUEW9ECHEjay HdNqsEcCvEJ7fPx8StCXwEbz9bnRf8/Z+XYaGJCCRgZ/lxm7B+ p2xkvPX9jL0V/VgECjEWr1ZD/61GA+Kl9ESq9NYIqe5XH3IIXC uyR2zUahlOpC5TDsyhfUVI9ruQPTCoutfU614QFsLcoX+DiGh1 etdPshL6FUjylfF5utrZc6gLDNrDgat9mYcllnT2/1cGqQ6j/U 7pZqI2pTNezemHWQ4ckHOH50flj2ur83N1l1Vn0kgIVgomwbIi Hxoo5ndqMCNclaPBp2jcD6xkMzuWsO3+JNVIHeuWWtguKx9Mdj JqCVH6bTLy6mKhDC5vcqkYMguPoG0aVyCbKycPV+b Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, John Nielsen , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 16:55:25 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ddKqq6cLAUmMJTHCPMrEjkAoSaq0VlnVd Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 3/14/14 5:47 PM, Warner Losh wrote: >=20 > On Mar 14, 2014, at 10:41 AM, John-Mark Gurney wrote= : >=20 >> Warner Losh wrote this message on Fri, Mar 14, 2014 at 08:30 -0600: >>> On Mar 14, 2014, at 3:13 AM, Christian Brueffer wrote: >>> >>>> On 3/14/14 2:54 AM, John-Mark Gurney wrote: >>>>> John Nielsen wrote this message on Thu, Mar 13, 2014 at 16:28 -0600= : >>>>>> On Mar 13, 2014, at 10:19 AM, John-Mark Gurney w= rote: >>>>>> >>>>>>> Author: jmg >>>>>>> Date: Thu Mar 13 16:19:36 2014 >>>>>>> New Revision: 263110 >>>>>>> URL: http://svnweb.freebsd.org/changeset/base/263110 >>>>>>> >>>>>>> Log: >>>>>>> remove link to the missing AMD Geode LX SB man page... we can add= it >>>>>>> back once someone cares enough to write one.. >>>>>> >>>>>> You mean like this one? >>>>>> http://svnweb.freebsd.org/base/head/share/man/man4/man4.i386/glxsb= =2E4 >>>>> >>>>> The problems of checking on an amd64 box... :( >>>>> >>>>> Actually, how are we suppose to handle links to arch dependant man >>>>> pages in arch independant man pages? I did this check on an amd64 = box, >>>>> so the page glxsb didn't get installed... Should we just always >>>>> install these man pages on all arches then? Or are we fine w/ >>>>> references to non-existant pages (on some arches)? >>>>> >>>>> Or should glxsb.4 be moved to an arch independant dir? >>>>> >>>> >>>> I wonder if it makes sense to keep arch-dependent man directories at= >>>> all. I.e., if I prepare an ARM disk image on my amd64 laptop, I rea= lly >>>> want to have the arm manpages available on that amd64 box. >>>> >>>> Does anyone see a reason not to move man4/man4.${ARCH}/*.4 to man4? >>>> We're talking about 60 manpages here, so space is not really an issu= e. >>> >>> Historically there was the separation because xp on one platform migh= t be >>> radically different from xp on another platform. The other reason was= confusion >>> because it wasn?t always clear if device foo actually worked on platf= orm X. >> >> We have less of that issue now, but it could still be.. but issues lik= e >> that can be addressed other ways, though kernel config, release notes,= >> etc.. I doubt people use manpages as a guage if a device worked on >> their arch... Plus, if the device is shared and known not to work on >> a specific arch, that should be listed in the BUGS section of the man >> page.. :) >=20 > Yea, kinda my point :) >=20 >>> Do we have any collisions like that? If so, we need to resolve those = first. >> >> Doesn't look like it... >> $ grep ^_ Makefile | sed -e 's/.4.*//' | wc -l >> 86 >> $ grep ^_ Makefile | sed -e 's/.4.*//' | sort -u | wc -l >> 86 >> >> It's also telling that besides i386 and amd64 specific man pages, we >> only have one mips specific man page in man4=85 >=20 > True enough, I hadn=92t looked... >=20 >> This won't address the other man pages for arch specific utilities >> and libraries though, like sunlabel=85 >=20 > True, but those are niche things, so it is less important :) >=20 >>> Also, it would be good to tag the ones that are arm specific as such = somehow. >> >> Should we just tag the pages w/ a section listing relevant architectur= es, >> or break the beauty of single digit section numbers and do 4.i386? >=20 > Tag in the man page itself, either in its own unique section, or in BUG= S. >=20 We kinda maintain some of this information already (albeit I'm not sure how accurate it is) in the hardware notes. The hardware notes themselves are generated from the HARDWARE sections of the manpages, while the arch information is in src/release/doc/share/misc/dev.archlist.txt. One possibility would be to generate this file from an ARCHITECTURE (or the like) section in section 4 manpages, the same way as we to with HARDWARE sections. Chris --ddKqq6cLAUmMJTHCPMrEjkAoSaq0VlnVd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQJ8BAEBCgBmBQJTIzR4XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ5QzhCQjQ5MDgzNDUwNjkyOUM5Mjg2NDE3 OEM4MzY5ODQ3RTE2NDg3AAoJEHjINphH4WSHyogP/0SxFvQsNkTkBtijfYqNJ/3o N3C8urA90BAYFDuuBWA7YBC/B04Lrn2D5DIuZxEIF3ai3c3xLSovXN8goqrNTgaW eNrik7PbmJq4nTrGCP4HG1mrzbf/YumptoDKqz7/fm3aB6+ld09YfBrQn4kLPG0O mM6J+EQRznUxreyicu5ZKwpbMx3RwegCQj1AqkY7yoVhnFSFRBWDaoYHMbLQn7sA Mnokbi8wmd/1wg0d0WEqt4Caft57CrWijggNS9I4SVSxWdj+V41Ha1vsfNIGGqDs s6/j5Xh10lSXMLxRyInDGAIQIoHfZLH9Ef+PET1aqEpxfmcSc4EKsFILkHfwmLuJ vjRjPn2wD+GEeto4NHI4/zbwfWHC7lBz5/7H5KlvmAt1/bHvo+xOv0E1xPBBszmq 19klhoFvhZrOKmp4yvPK4gnmjUujws6s6HAZOncn5lyVSmEI1CJxidLra1feC7J5 KAaGSeCmVW2xnlBIDmvXWYAJk0N0NP3V+BmADcZPrNn2rs0kRxpcKvcRZ9zp7b5k hdDPei+IAWQvN/sHzXgK7BG/tQmJ5anb6QqhvnZevI7sFk9rZSeD06anE/Mvtye4 zorhGeWhkp8LF0b98YwFkdp1ILhmwjYhoytwjYTdM5iiE/DPChHPcg4vgKSX+o64 g9RPDmGrcesz8bvboYho =RhP/ -----END PGP SIGNATURE----- --ddKqq6cLAUmMJTHCPMrEjkAoSaq0VlnVd-- From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 17:13:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B415B11; Fri, 14 Mar 2014 17:13:34 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 34CE5653; Fri, 14 Mar 2014 17:13:34 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s2EHDWfY048143 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 14 Mar 2014 10:13:32 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s2EHDWpw048142; Fri, 14 Mar 2014 10:13:32 -0700 (PDT) (envelope-from jmg) Date: Fri, 14 Mar 2014 10:13:32 -0700 From: John-Mark Gurney To: Warner Losh Subject: Re: svn commit: r263110 - head/share/man/man4 Message-ID: <20140314171332.GT32089@funkthat.com> References: <201403131619.s2DGJax1071196@svn.freebsd.org> <4D0B04BD-4EF6-4963-941E-012B81F8DFAB@jnielsen.net> <20140314015438.GO32089@funkthat.com> <5322C83F.6060109@FreeBSD.org> <20140314164107.GS32089@funkthat.com> <933F8270-90C1-4AFE-9F39-A7ADBC05C772@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <933F8270-90C1-4AFE-9F39-A7ADBC05C772@bsdimp.com> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Fri, 14 Mar 2014 10:13:32 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, John Nielsen , src-committers@freebsd.org, Christian Brueffer X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 17:13:34 -0000 Warner Losh wrote this message on Fri, Mar 14, 2014 at 10:47 -0600: > > It's also telling that besides i386 and amd64 specific man pages, we > > only have one mips specific man page in man4? > > True enough, I hadn?t looked... Oh, I missed the man4.* subdirs that was added.. and apparently the person adding the mips specific manpage to the Makefile missed it too, or maybe thought one page wasn't enough to add the subdir.. Oh, and another good reason to move them out.. looks like many of the man4.i386 pages are misclassified... aic was misclassified as an i386 only scsi device... And interestingly, the isa attachment for it is i386 only? but pccard attachment for all arches? ie and other isa based ethernet cards are there, but aren't in the arch specific files.* files... Guess spring is here a little early.. :) -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 17:18:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB3DE103; Fri, 14 Mar 2014 17:18:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B72386B8; Fri, 14 Mar 2014 17:18:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2EHILmf095351; Fri, 14 Mar 2014 17:18:21 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2EHILX8095349; Fri, 14 Mar 2014 17:18:21 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403141718.s2EHILX8095349@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 14 Mar 2014 17:18:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263178 - in head: . share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 17:18:21 -0000 Author: glebius Date: Fri Mar 14 17:18:21 2014 New Revision: 263178 URL: http://svnweb.freebsd.org/changeset/base/263178 Log: A miss from r263140. Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Mar 14 16:42:20 2014 (r263177) +++ head/ObsoleteFiles.inc Fri Mar 14 17:18:21 2014 (r263178) @@ -72,6 +72,7 @@ OLD_FILES+=usr/sbin/IPXrouted OLD_FILES+=usr/share/man/man3/ipx.3.gz OLD_FILES+=usr/share/man/man3/ipx_addr.3.gz OLD_FILES+=usr/share/man/man3/ipx_ntoa.3.gz +OLD_FILES+=usr/share/man/man4/if_ef.4.gz OLD_FILES+=usr/share/man/man8/IPXrouted.8.gz # 20140223: Remove libyaml Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Mar 14 16:42:20 2014 (r263177) +++ head/share/man/man4/Makefile Fri Mar 14 17:18:21 2014 (r263178) @@ -614,7 +614,6 @@ MLINKS+=de.4 if_de.4 MLINKS+=disc.4 if_disc.4 MLINKS+=ed.4 if_ed.4 MLINKS+=edsc.4 if_edsc.4 -MLINKS+=ef.4 if_ef.4 MLINKS+=em.4 if_em.4 MLINKS+=en.4 if_en.4 MLINKS+=enc.4 if_enc.4 From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 17:20:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 544F5290; Fri, 14 Mar 2014 17:20:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 415286D3; Fri, 14 Mar 2014 17:20:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2EHKOhD095690; Fri, 14 Mar 2014 17:20:24 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2EHKOwg095689; Fri, 14 Mar 2014 17:20:24 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403141720.s2EHKOwg095689@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 14 Mar 2014 17:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263179 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 17:20:24 -0000 Author: glebius Date: Fri Mar 14 17:20:23 2014 New Revision: 263179 URL: http://svnweb.freebsd.org/changeset/base/263179 Log: Another miss from r263140. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Mar 14 17:18:21 2014 (r263178) +++ head/ObsoleteFiles.inc Fri Mar 14 17:20:23 2014 (r263179) @@ -72,6 +72,7 @@ OLD_FILES+=usr/sbin/IPXrouted OLD_FILES+=usr/share/man/man3/ipx.3.gz OLD_FILES+=usr/share/man/man3/ipx_addr.3.gz OLD_FILES+=usr/share/man/man3/ipx_ntoa.3.gz +OLD_FILES+=usr/share/man/man4/ef.4.gz OLD_FILES+=usr/share/man/man4/if_ef.4.gz OLD_FILES+=usr/share/man/man8/IPXrouted.8.gz From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 17:20:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B51E3E7; Fri, 14 Mar 2014 17:20:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4E7436DC; Fri, 14 Mar 2014 17:20:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2EHKkUr095753; Fri, 14 Mar 2014 17:20:46 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2EHKkte095752; Fri, 14 Mar 2014 17:20:46 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403141720.s2EHKkte095752@svn.freebsd.org> From: Bryan Drewery Date: Fri, 14 Mar 2014 17:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263180 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 17:20:46 -0000 Author: bdrewery Date: Fri Mar 14 17:20:45 2014 New Revision: 263180 URL: http://svnweb.freebsd.org/changeset/base/263180 Log: Fix ABI from /usr/local/etc/pkg.conf not being respected. Regression from r259266. Sponsored by: EMC / Isilon Storage Division MFC after: 1 week Modified: head/usr.sbin/pkg/config.c Modified: head/usr.sbin/pkg/config.c ============================================================================== --- head/usr.sbin/pkg/config.c Fri Mar 14 17:20:23 2014 (r263179) +++ head/usr.sbin/pkg/config.c Fri Mar 14 17:20:45 2014 (r263180) @@ -66,6 +66,7 @@ struct config_entry { char *value; STAILQ_HEAD(, config_value) *list; bool envset; + bool main_only; /* Only set in pkg.conf. */ }; static struct config_entry c[] = { @@ -76,6 +77,7 @@ static struct config_entry c[] = { NULL, NULL, false, + false, }, [ABI] = { PKG_CONFIG_STRING, @@ -84,6 +86,7 @@ static struct config_entry c[] = { NULL, NULL, false, + true, }, [MIRROR_TYPE] = { PKG_CONFIG_STRING, @@ -92,6 +95,7 @@ static struct config_entry c[] = { NULL, NULL, false, + false, }, [ASSUME_ALWAYS_YES] = { PKG_CONFIG_BOOL, @@ -100,6 +104,7 @@ static struct config_entry c[] = { NULL, NULL, false, + true, }, [SIGNATURE_TYPE] = { PKG_CONFIG_STRING, @@ -108,6 +113,7 @@ static struct config_entry c[] = { NULL, NULL, false, + false, }, [FINGERPRINTS] = { PKG_CONFIG_STRING, @@ -116,6 +122,7 @@ static struct config_entry c[] = { NULL, NULL, false, + false, }, [REPOS_DIR] = { PKG_CONFIG_LIST, @@ -124,6 +131,7 @@ static struct config_entry c[] = { NULL, NULL, false, + true, }, }; @@ -597,6 +605,9 @@ config_parse(ucl_object_t *obj, pkg_conf for (i = 0; i < CONFIG_SIZE; i++) { if (c[i].envset) continue; + /* Prevent overriding ABI, ASSUME_ALWAYS_YES, etc. */ + if (conftype != CONFFILE_PKG && c[i].main_only == true) + continue; switch (c[i].type) { case PKG_CONFIG_LIST: c[i].list = temp_config[i].list; From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 17:26:50 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D39B6F9; Fri, 14 Mar 2014 17:26:50 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3216A81B; Fri, 14 Mar 2014 17:26:49 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s2EHQm6G048337 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 14 Mar 2014 10:26:48 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s2EHQmDt048336; Fri, 14 Mar 2014 10:26:48 -0700 (PDT) (envelope-from jmg) Date: Fri, 14 Mar 2014 10:26:48 -0700 From: John-Mark Gurney To: Christian Brueffer Subject: Re: svn commit: r263110 - head/share/man/man4 Message-ID: <20140314172648.GU32089@funkthat.com> References: <201403131619.s2DGJax1071196@svn.freebsd.org> <4D0B04BD-4EF6-4963-941E-012B81F8DFAB@jnielsen.net> <20140314015438.GO32089@funkthat.com> <5322C83F.6060109@FreeBSD.org> <20140314164107.GS32089@funkthat.com> <933F8270-90C1-4AFE-9F39-A7ADBC05C772@bsdimp.com> <53233477.7060400@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53233477.7060400@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Fri, 14 Mar 2014 10:26:48 -0700 (PDT) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, John Nielsen , src-committers@FreeBSD.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 17:26:50 -0000 Christian Brueffer wrote this message on Fri, Mar 14, 2014 at 17:55 +0100: > On 3/14/14 5:47 PM, Warner Losh wrote: > > > > On Mar 14, 2014, at 10:41 AM, John-Mark Gurney wrote: > > > >> Warner Losh wrote this message on Fri, Mar 14, 2014 at 08:30 -0600: > >>> On Mar 14, 2014, at 3:13 AM, Christian Brueffer wrote: > >>> > >>>> On 3/14/14 2:54 AM, John-Mark Gurney wrote: > >>>>> John Nielsen wrote this message on Thu, Mar 13, 2014 at 16:28 -0600: > >>>>>> On Mar 13, 2014, at 10:19 AM, John-Mark Gurney wrote: > >>>>>> > >>>>>>> Author: jmg > >>>>>>> Date: Thu Mar 13 16:19:36 2014 > >>>>>>> New Revision: 263110 > >>>>>>> URL: http://svnweb.freebsd.org/changeset/base/263110 > >>>>>>> > >>>>>>> Log: > >>>>>>> remove link to the missing AMD Geode LX SB man page... we can add it > >>>>>>> back once someone cares enough to write one.. > >>>>>> > >>>>>> You mean like this one? > >>>>>> http://svnweb.freebsd.org/base/head/share/man/man4/man4.i386/glxsb.4 > >>>>> > >>>>> The problems of checking on an amd64 box... :( > >>>>> > >>>>> Actually, how are we suppose to handle links to arch dependant man > >>>>> pages in arch independant man pages? I did this check on an amd64 box, > >>>>> so the page glxsb didn't get installed... Should we just always > >>>>> install these man pages on all arches then? Or are we fine w/ > >>>>> references to non-existant pages (on some arches)? > >>>>> > >>>>> Or should glxsb.4 be moved to an arch independant dir? > >>>>> > >>>> > >>>> I wonder if it makes sense to keep arch-dependent man directories at > >>>> all. I.e., if I prepare an ARM disk image on my amd64 laptop, I really > >>>> want to have the arm manpages available on that amd64 box. > >>>> > >>>> Does anyone see a reason not to move man4/man4.${ARCH}/*.4 to man4? > >>>> We're talking about 60 manpages here, so space is not really an issue. > >>> > >>> Historically there was the separation because xp on one platform might be > >>> radically different from xp on another platform. The other reason was confusion > >>> because it wasn?t always clear if device foo actually worked on platform X. > >> > >> We have less of that issue now, but it could still be.. but issues like > >> that can be addressed other ways, though kernel config, release notes, > >> etc.. I doubt people use manpages as a guage if a device worked on > >> their arch... Plus, if the device is shared and known not to work on > >> a specific arch, that should be listed in the BUGS section of the man > >> page.. :) > > > > Yea, kinda my point :) > > > >>> Do we have any collisions like that? If so, we need to resolve those first. > >> > >> Doesn't look like it... > >> $ grep ^_ Makefile | sed -e 's/.4.*//' | wc -l > >> 86 > >> $ grep ^_ Makefile | sed -e 's/.4.*//' | sort -u | wc -l > >> 86 > >> > >> It's also telling that besides i386 and amd64 specific man pages, we > >> only have one mips specific man page in man4? > > > > True enough, I hadn?t looked... > > > >> This won't address the other man pages for arch specific utilities > >> and libraries though, like sunlabel? > > > > True, but those are niche things, so it is less important :) > > > >>> Also, it would be good to tag the ones that are arm specific as such somehow. > >> > >> Should we just tag the pages w/ a section listing relevant architectures, > >> or break the beauty of single digit section numbers and do 4.i386? > > > > Tag in the man page itself, either in its own unique section, or in BUGS. > > > > We kinda maintain some of this information already (albeit I'm not sure > how accurate it is) in the hardware notes. The hardware notes > themselves are generated from the HARDWARE sections of the manpages, > while the arch information is in > src/release/doc/share/misc/dev.archlist.txt. > > One possibility would be to generate this file from an ARCHITECTURE (or > the like) section in section 4 manpages, the same way as we to with > HARDWARE sections. This becomes a little troublesome to handle all the corner cases that can be expressed, and what do we want to say... There is if the code has been tested or not, and just how arch specific it is... Pretty much all of our supported platforms support PCI, and therefor ISA through a bridge, which means all the "i386" specific ISA cards could possibly find themselves on non-i386 machines... Now if they'll work due to endian issues or other issues or not is another issue entirely... Some of the entries in dev.archlist.txt don't match what you can build per sys/conf/files*... aic's pccard is available to all, it's isa is only to i386 and pc98, but listed as i386, pc98 and amd64... so we end up w/ an odd set here, that isn't very easy to figure out and parse... Do we want a list of expected working and tested working? Then we also might want to list known not working configurations too... I know too much about how to hack to get crazy hardware to work where it isn't suppose to, so other people w/ clearer heads on this topic should make these decisions... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 17:37:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B304A1B; Fri, 14 Mar 2014 17:37:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EBFBD900; Fri, 14 Mar 2014 17:37:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2EHbchx003553; Fri, 14 Mar 2014 17:37:38 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2EHbcE6003552; Fri, 14 Mar 2014 17:37:38 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403141737.s2EHbcE6003552@svn.freebsd.org> From: Bryan Drewery Date: Fri, 14 Mar 2014 17:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263181 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 17:37:39 -0000 Author: bdrewery Date: Fri Mar 14 17:37:38 2014 New Revision: 263181 URL: http://svnweb.freebsd.org/changeset/base/263181 Log: Fix ASSUME_ALWAYS_YES not being parsed properly from config after UCL conversion. Sponsored by: EMC / Isilon Storage Division MFC after: 1 week Modified: head/usr.sbin/pkg/config.c Modified: head/usr.sbin/pkg/config.c ============================================================================== --- head/usr.sbin/pkg/config.c Fri Mar 14 17:20:45 2014 (r263180) +++ head/usr.sbin/pkg/config.c Fri Mar 14 17:37:38 2014 (r263181) @@ -594,6 +594,10 @@ config_parse(ucl_object_t *obj, pkg_conf next); } break; + case PKG_CONFIG_BOOL: + temp_config[i].value = + strdup(ucl_object_toboolean(cur) ? "yes" : "no"); + break; default: /* Normal string value. */ temp_config[i].value = strdup(ucl_object_tostring(cur)); From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 19:37:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECCF6DB7; Fri, 14 Mar 2014 19:37:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D98FA61D; Fri, 14 Mar 2014 19:37:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2EJbbUA051880; Fri, 14 Mar 2014 19:37:37 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2EJbbux051879; Fri, 14 Mar 2014 19:37:37 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403141937.s2EJbbux051879@svn.freebsd.org> From: Ed Maste Date: Fri, 14 Mar 2014 19:37:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263183 - head/sys/dev/vt/hw/efifb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 19:37:38 -0000 Author: emaste Date: Fri Mar 14 19:37:37 2014 New Revision: 263183 URL: http://svnweb.freebsd.org/changeset/base/263183 Log: Use the existence of module metadata to indicate framebuffer presence Modified: head/sys/dev/vt/hw/efifb/efifb.c Modified: head/sys/dev/vt/hw/efifb/efifb.c ============================================================================== --- head/sys/dev/vt/hw/efifb/efifb.c Fri Mar 14 17:59:36 2014 (r263182) +++ head/sys/dev/vt/hw/efifb/efifb.c Fri Mar 14 19:37:37 2014 (r263183) @@ -87,7 +87,7 @@ vt_efb_init(struct vt_device *vd) kmdp = preload_search_by_type("elf64 kernel"); efifb = (struct efi_fb *)preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_EFI_FB); - if (!efifb->fb_present) + if (efifb == NULL) return (CN_DEAD); info->fb_height = efifb->fb_height; From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 19:45:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 793C21AA; Fri, 14 Mar 2014 19:45:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0DE74A; Fri, 14 Mar 2014 19:45:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2EJjR2L055777; Fri, 14 Mar 2014 19:45:27 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2EJjRBZ055776; Fri, 14 Mar 2014 19:45:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403141945.s2EJjRBZ055776@svn.freebsd.org> From: Warner Losh Date: Fri, 14 Mar 2014 19:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263184 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 19:45:27 -0000 Author: imp Date: Fri Mar 14 19:45:26 2014 New Revision: 263184 URL: http://svnweb.freebsd.org/changeset/base/263184 Log: Fix build with spaces in names. PR: 162736 Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 19:37:37 2014 (r263183) +++ head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 19:45:26 2014 (r263184) @@ -197,12 +197,14 @@ build_world ( ) ( ) build_kernel ( ) ( + local extra + pprint 2 "build kernel ($NANO_KERNEL)" pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.bk" ( if [ -f ${NANO_KERNEL} ] ; then - kernconfdir=$(realpath $(dirname ${NANO_KERNEL})) + extra="KERNCONFDIR=$(realpath $(dirname ${NANO_KERNEL}))" kernconf=$(basename ${NANO_KERNEL}) else kernconf=${NANO_KERNEL} @@ -216,8 +218,7 @@ build_kernel ( ) ( # Note: We intentionally build all modules, not only the ones in # NANO_MODULES so the built world can be reused by multiple images. env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \ - __MAKE_CONF=${NANO_MAKE_CONF_BUILD} \ - ${kernconfdir:+"KERNCONFDIR="}${kernconfdir} \ + ${extra} __MAKE_CONF=${NANO_MAKE_CONF_BUILD} \ KERNCONF=${kernconf} ) > ${MAKEOBJDIRPREFIX}/_.bk 2>&1 ) @@ -277,12 +278,14 @@ install_etc ( ) ( ) install_kernel ( ) ( + local extra + pprint 2 "install kernel ($NANO_KERNEL)" pprint 3 "log: ${NANO_OBJ}/_.ik" ( if [ -f ${NANO_KERNEL} ] ; then - kernconfdir=$(realpath $(dirname ${NANO_KERNEL})) + extra="KERNCONFDIR=$(realpath $(dirname ${NANO_KERNEL}))" kernconf=$(basename ${NANO_KERNEL}) else kernconf=${NANO_KERNEL} @@ -291,8 +294,7 @@ install_kernel ( ) ( cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} ${NANO_MAKE} installkernel \ DESTDIR=${NANO_WORLDDIR} \ - __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} \ - ${kernconfdir:+"KERNCONFDIR="}${kernconfdir} \ + ${extra} __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} \ KERNCONF=${kernconf} \ MODULES_OVERRIDE="${NANO_MODULES}" ) > ${NANO_OBJ}/_.ik 2>&1 From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 19:45:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98035297; Fri, 14 Mar 2014 19:45:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8631774C; Fri, 14 Mar 2014 19:45:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2EJjXqC055839; Fri, 14 Mar 2014 19:45:33 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2EJjX5N055837; Fri, 14 Mar 2014 19:45:33 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403141945.s2EJjX5N055837@svn.freebsd.org> From: Warner Losh Date: Fri, 14 Mar 2014 19:45:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263185 - head/tools/tools/nanobsd/pcengines X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 19:45:33 -0000 Author: imp Date: Fri Mar 14 19:45:32 2014 New Revision: 263185 URL: http://svnweb.freebsd.org/changeset/base/263185 Log: Make pcengines config files compile again. Modified: head/tools/tools/nanobsd/pcengines/ALIX_DSK head/tools/tools/nanobsd/pcengines/common.conf Modified: head/tools/tools/nanobsd/pcengines/ALIX_DSK ============================================================================== --- head/tools/tools/nanobsd/pcengines/ALIX_DSK Fri Mar 14 19:45:26 2014 (r263184) +++ head/tools/tools/nanobsd/pcengines/ALIX_DSK Fri Mar 14 19:45:32 2014 (r263185) @@ -23,6 +23,9 @@ options PSEUDOFS options GEOM_PART_GPT options GEOM_LABEL options COMPAT_43TTY +options COMPAT_FREEBSD4 # Compatible with FreeBSD4 +options COMPAT_FREEBSD5 # Compatible with FreeBSD5 +options COMPAT_FREEBSD6 # Compatible with FreeBSD6 options COMPAT_FREEBSD7 options SCSI_DELAY=5000 options SYSVSHM @@ -32,12 +35,11 @@ options P1003_1B_SEMAPHORES options _KPOSIX_PRIORITY_SCHEDULING options PRINTF_BUFR_SIZE=128 device apic +device cpufreq +device acpi device pci device fdc device ata -device atadisk -device atapicd -device atapist options ATA_STATIC_ID device scbus device da Modified: head/tools/tools/nanobsd/pcengines/common.conf ============================================================================== --- head/tools/tools/nanobsd/pcengines/common.conf Fri Mar 14 19:45:26 2014 (r263184) +++ head/tools/tools/nanobsd/pcengines/common.conf Fri Mar 14 19:45:32 2014 (r263185) @@ -2,8 +2,11 @@ # $FreeBSD$ # -NANO_TOOLS=`pwd` -NANO_PACKAGE_DIR=`pwd`/Pkg +NANO_SRC=$(pwd) +NANO_SRC=${NANO_SRC%/tools/tools/nanobsd/pcengines} +NANO_OBJ=${NANO_SRC}/../${NANO_NAME}/obj +NANO_TOOLS=$(pwd) +NANO_PACKAGE_DIR=$(pwd)/Pkg #NANO_RAM_TMPVARSIZE=20480 #NANO_RAM_TMPVARSIZE=30720 NANO_RAM_TMPVARSIZE=40960 From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 19:45:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8108B417; Fri, 14 Mar 2014 19:45:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6ECDC74F; Fri, 14 Mar 2014 19:45:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2EJjf7d055896; Fri, 14 Mar 2014 19:45:41 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2EJjfHS055894; Fri, 14 Mar 2014 19:45:41 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403141945.s2EJjfHS055894@svn.freebsd.org> From: Warner Losh Date: Fri, 14 Mar 2014 19:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263186 - in head: . tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 19:45:41 -0000 Author: imp Date: Fri Mar 14 19:45:40 2014 New Revision: 263186 URL: http://svnweb.freebsd.org/changeset/base/263186 Log: With the more generous footprints today, it makes little sense to use UFS1 by default any more. Switch to UFS2. Modified: head/Makefile.inc1 head/tools/tools/nanobsd/nanobsd.sh Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Mar 14 19:45:32 2014 (r263185) +++ head/Makefile.inc1 Fri Mar 14 19:45:40 2014 (r263186) @@ -231,6 +231,9 @@ CROSSENV+= GROFF_BIN_PATH=${WORLDTMP}/le GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \ GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac .endif +.if defined(TARGET_CFLAGS) +CROSSENV+= ${TARGET_CFLAGS} +.endif # bootstrap-tools stage BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 19:45:32 2014 (r263185) +++ head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 19:45:40 2014 (r263186) @@ -86,7 +86,7 @@ NANO_CUSTOMIZE="" NANO_LATE_CUSTOMIZE="" # Newfs paramters to use -NANO_NEWFS="-b 4096 -f 512 -i 8192 -O1 -U" +NANO_NEWFS="-b 4096 -f 512 -i 8192 -O2 -U" # The drive name of the media at runtime NANO_DRIVE=ad0 From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 19:46:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 838FB562; Fri, 14 Mar 2014 19:46:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 70A67758; Fri, 14 Mar 2014 19:46:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2EJkJY2056021; Fri, 14 Mar 2014 19:46:19 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2EJkJBW056020; Fri, 14 Mar 2014 19:46:19 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403141946.s2EJkJBW056020@svn.freebsd.org> From: Warner Losh Date: Fri, 14 Mar 2014 19:46:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263187 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 19:46:19 -0000 Author: imp Date: Fri Mar 14 19:46:18 2014 New Revision: 263187 URL: http://svnweb.freebsd.org/changeset/base/263187 Log: Print an error message when we exit out early. PR: 136889 Submitted by: Aragon Gouveia Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 19:45:40 2014 (r263186) +++ head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 19:46:18 2014 (r263187) @@ -167,6 +167,13 @@ NANO_DATADIR="" # ####################################################################### +nano_cleanup ( ) ( + if [ $? -ne 0 ]; then + echo "Error encountered. Check for errors in last log file." 1>&2 + fi + exit $? +) + clean_build ( ) ( pprint 2 "Clean and create object directory (${MAKEOBJDIRPREFIX})" @@ -576,7 +583,8 @@ create_i386_diskimage ( ) ( fi mdconfig -d -u $MD - trap - 1 2 15 EXIT + trap - 1 2 15 + trap nano_cleanup EXIT ) > ${NANO_OBJ}/_.di 2>&1 ) @@ -929,6 +937,8 @@ if [ $# -gt 0 ] ; then usage fi +trap nano_cleanup EXIT + ####################################################################### # Setup and Export Internal variables # From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 19:46:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E45E369B; Fri, 14 Mar 2014 19:46:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D1B9775C; Fri, 14 Mar 2014 19:46:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2EJkWS7056091; Fri, 14 Mar 2014 19:46:32 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2EJkWT6056090; Fri, 14 Mar 2014 19:46:32 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403141946.s2EJkWT6056090@svn.freebsd.org> From: Warner Losh Date: Fri, 14 Mar 2014 19:46:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263188 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 19:46:33 -0000 Author: imp Date: Fri Mar 14 19:46:32 2014 New Revision: 263188 URL: http://svnweb.freebsd.org/changeset/base/263188 Log: When NANO_IMAGE_MBRONLY is set, and we're backing via swap, only copy the MBR. PR: 136889 Submitted by: Aragon Gouveia Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 19:46:18 2014 (r263187) +++ head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 19:46:32 2014 (r263188) @@ -136,6 +136,9 @@ NANO_BOOT2CFG="-h" # Can be "file" or "swap" NANO_MD_BACKING="file" +# for swap type md(4) backing, write out the mbr only +NANO_IMAGE_MBRONLY=true + # Progress Print level PPLEVEL=3 @@ -573,6 +576,14 @@ create_i386_diskimage ( ) ( fi if [ "${NANO_MD_BACKING}" = "swap" ] ; then + if [ ${NANO_IMAGE_MBRONLY} ]; then + echo "Writing out _.disk.mbr..." + dd if=/dev/${MD} of=${NANO_DISKIMGDIR}/_.disk.mbr bs=512 count=1 + else + echo "Writing out ${NANO_IMGNAME}..." + dd if=/dev/${MD} of=${IMG} bs=64k + fi + echo "Writing out ${NANO_IMGNAME}..." dd conv=sparse if=/dev/${MD} of=${IMG} bs=64k fi From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 20:20:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0851E84; Fri, 14 Mar 2014 20:20:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D801A1A; Fri, 14 Mar 2014 20:20:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2EKKWlI069400; Fri, 14 Mar 2014 20:20:32 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2EKKW5p069399; Fri, 14 Mar 2014 20:20:32 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403142020.s2EKKW5p069399@svn.freebsd.org> From: Warner Losh Date: Fri, 14 Mar 2014 20:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263189 - head/tools/tools/nanobsd/Files/root X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 20:20:32 -0000 Author: imp Date: Fri Mar 14 20:20:32 2014 New Revision: 263189 URL: http://svnweb.freebsd.org/changeset/base/263189 Log: NanoBSD has a utility shell script called save_cfg which helps keep /cfg updated with the modified configuration files in /etc. I have written an improved version with the following features: * Recurses directories. * Only requires file arguments the first time the file/directory is * added to /cfg. * Handles file deletions. PR: 145962, 157533 Submitted by: Aragon Gouveia and Alex Bakhtin Modified: head/tools/tools/nanobsd/Files/root/save_cfg Modified: head/tools/tools/nanobsd/Files/root/save_cfg ============================================================================== --- head/tools/tools/nanobsd/Files/root/save_cfg Fri Mar 14 19:46:32 2014 (r263188) +++ head/tools/tools/nanobsd/Files/root/save_cfg Fri Mar 14 20:20:32 2014 (r263189) @@ -1,6 +1,7 @@ #!/bin/sh # # Copyright (c) 2006 Mathieu Arnold +# Copyright (c) 2010 Alex Bakhtin # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -32,11 +33,86 @@ set -e trap "umount /cfg" 1 2 15 EXIT mount /cfg ( +cd /etc +for filename in "$@" `find * -type f` +do + if [ ! -f /cfg/$filename -a ! -f /cfg/.ignore/$filename ] + then + + # + # If file doesn't exist in /cfg and file is not in the 'ignore' list + # then check if this file is exactly the same as original file + # in nanobsd image + # + if ! cmp -s /etc/$filename /conf/base/etc/$filename + then + file_path=`echo "$filename" | sed 's/\/[^/]*$//'` + if [ $file_path != $filename ] + then + if [ ! -d /etc/$file_path ] + then + # should never go here unless we have some errors in + # sed script extracting file path + echo "Error: Path /etc/$file_path is not directory." + exit 1; + fi + fi + + # + # Ask user - how should we handle this file. + # Add to cfg (y/n/i)? + # y) -> save this file in /cfg + # n) -> do not save this file in /cfg for current script invocation ONLY + # i) -> add file to ignore list (/cfg/.ignore hiereachy) and never save + # try to add this file to /cfg. + # + # touch is ised to add files to /cfg to keep the script flow straight and easy + # + read -p "New file /etc/$filename found. Add to /cfg (y/n/i)? " key + case "$key" in + [yY]) + if [ $file_path != $filename ] + then + mkdir -vp /cfg/$file_path + fi + touch /cfg/$filename && echo "File /etc/$filename added to /cfg." + ;; + [iI]) + mkdir -vp /cfg/.ignore + if [ $file_path != $filename ] + then + mkdir -vp /cfg/.ignore/$file_path + fi + touch /cfg/.ignore/$filename && echo "File /etc/$filename added to ignore list." + ;; + esac + fi + fi +done + +# +# Actually check all files in /cfg and save if necessary +# cd /cfg -for i in "$@" `find * -type f` +for filename in "$@" `find * -type f` do - cmp -s /etc/$i /cfg/$i || cp -pfv /etc/$i /cfg/$i + if [ -f /etc/$filename ] + then + cmp -s /etc/$filename /cfg/$filename || cp -pfv /etc/$filename /cfg/$filename + else + + # + # Give user an option to remove file from /cfg if this file is removed from /etc + # + read -p "File /cfg/$filename not found in /etc. Remove from /cfg (y/n)? " key + case "$key" in + [yY]) + rm /cfg/$filename && echo "File /cfg/$filename removed" + ;; + esac + fi done + ) umount /cfg trap 1 2 15 EXIT From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 20:20:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60F97E85; Fri, 14 Mar 2014 20:20:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 41F3CA1B; Fri, 14 Mar 2014 20:20:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2EKKbot069453; Fri, 14 Mar 2014 20:20:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2EKKbSe069452; Fri, 14 Mar 2014 20:20:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403142020.s2EKKbSe069452@svn.freebsd.org> From: Warner Losh Date: Fri, 14 Mar 2014 20:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263190 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 20:20:37 -0000 Author: imp Date: Fri Mar 14 20:20:36 2014 New Revision: 263190 URL: http://svnweb.freebsd.org/changeset/base/263190 Log: Be more explicit about setting SRCCONF to /dev/null (plus allow it to be overridden). PR: 160443 Submitted by: Garrett Cooper Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 20:20:32 2014 (r263189) +++ head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 20:20:36 2014 (r263190) @@ -163,6 +163,10 @@ NANO_CFGDIR="" # Directory to populate /data from NANO_DATADIR="" +# src.conf to use when building the image. Defaults to /dev/null for the sake +# of determinism. +SRCCONF=${SRCCONF:=/dev/null} + ####################################################################### # # The functions which do the real work. @@ -193,7 +197,6 @@ make_conf_build ( ) ( echo "${CONF_WORLD}" > ${NANO_MAKE_CONF_BUILD} echo "${CONF_BUILD}" >> ${NANO_MAKE_CONF_BUILD} - echo "SRCCONF=/dev/null" >> ${NANO_MAKE_CONF_BUILD} ) build_world ( ) ( @@ -202,6 +205,7 @@ build_world ( ) ( cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} \ + SRCCONF=${SRCCONF} \ __MAKE_CONF=${NANO_MAKE_CONF_BUILD} buildworld \ > ${MAKEOBJDIRPREFIX}/_.bw 2>&1 ) @@ -228,6 +232,7 @@ build_kernel ( ) ( # Note: We intentionally build all modules, not only the ones in # NANO_MODULES so the built world can be reused by multiple images. env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \ + SRCCONF=${SRCCONF} \ ${extra} __MAKE_CONF=${NANO_MAKE_CONF_BUILD} \ KERNCONF=${kernconf} ) > ${MAKEOBJDIRPREFIX}/_.bk 2>&1 @@ -257,7 +262,6 @@ make_conf_install ( ) ( echo "${CONF_WORLD}" > ${NANO_MAKE_CONF_INSTALL} echo "${CONF_INSTALL}" >> ${NANO_MAKE_CONF_INSTALL} - echo "SRCCONF=/dev/null" >> ${NANO_MAKE_CONF_INSTALL} ) install_world ( ) ( @@ -266,7 +270,8 @@ install_world ( ) ( cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} \ - ${NANO_MAKE} __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} installworld \ + ${NANO_MAKE} SRCCONF=${SRCCONF} \ + __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} installworld \ DESTDIR=${NANO_WORLDDIR} \ > ${NANO_OBJ}/_.iw 2>&1 chflags -R noschg ${NANO_WORLDDIR} @@ -279,7 +284,8 @@ install_etc ( ) ( cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} \ - ${NANO_MAKE} __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} distribution \ + ${NANO_MAKE} SRCCONF=${SRCCONF} \ + __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} distribution \ DESTDIR=${NANO_WORLDDIR} \ > ${NANO_OBJ}/_.etc 2>&1 # make.conf doesn't get created by default, but some ports need it @@ -304,6 +310,7 @@ install_kernel ( ) ( cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} ${NANO_MAKE} installkernel \ DESTDIR=${NANO_WORLDDIR} \ + SRCCONF=${SRCCONF} \ ${extra} __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} \ KERNCONF=${kernconf} \ MODULES_OVERRIDE="${NANO_MODULES}" From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 20:31:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA706546 for ; Fri, 14 Mar 2014 20:31:17 +0000 (UTC) Received: from mail-qc0-x22e.google.com (mail-qc0-x22e.google.com [IPv6:2607:f8b0:400d:c01::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 90BE8B2E for ; Fri, 14 Mar 2014 20:31:17 +0000 (UTC) Received: by mail-qc0-f174.google.com with SMTP id x13so3523848qcv.33 for ; Fri, 14 Mar 2014 13:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=IIZgKp6d4NUiN8Vx/jkbsp8sdOn+35zaX0NkQUq4tKU=; b=Fn0ZegfRKOqvKHCQvm2KLfPaAwG1ASqXmum1A+vLKR/kEAMMlDYbETHYCTBsq4sAPS E+NSON1yQlKBHnoFsnflJ0ZFJ89/gsX44x91Pow9HbJBvQ6fNBlWLWquSKIOmS4bOtw4 1S4u+YhXcAXi1FO0ktRgs3b8XD0gsT5BtO/e8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=IIZgKp6d4NUiN8Vx/jkbsp8sdOn+35zaX0NkQUq4tKU=; b=SZyigFCOL8FHMHY+9B/LMB7elvhtL7Hq9O5XPzvGMoQICEadxv8ya2gjy1mW6ByJzH yoDHv6czDzqVkx5ux0OrvbN2Rp5a04ypPIXkJ4fAuCcC4IyIColKo3f/2f2JhVF52wvW TpdZCmhtlDx9zemQ3mpQxjZ6wmtSdhjuD6PdOip6YdisAwLKRhWUn6OEkhSAib0k74NY ySA5yxd3jmk5vwWi0wlNP36CGMS4A19tICL+1mBNCo+hzVKFSW0ocNBCPqEfDhPNt0Yc 3xF75yEwUZDbhM1Pg6oAN6RbZsYFrpgWG+daJyRijbdpPUhG0oRIFOAkBzcuIz1mCPg1 EyyQ== X-Gm-Message-State: ALoCoQmu1XI4XMrHkdc4E3bVX1f06/5YpgvJgTnP/vJEe6+Xe5OBTN7Q8Z14/VFA0Yp3yZeM21Zv X-Received: by 10.224.57.142 with SMTP id c14mr12578178qah.23.1394829076775; Fri, 14 Mar 2014 13:31:16 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.147.225 with HTTP; Fri, 14 Mar 2014 13:30:46 -0700 (PDT) In-Reply-To: <201403141945.s2EJjfHS055894@svn.freebsd.org> References: <201403141945.s2EJjfHS055894@svn.freebsd.org> From: Eitan Adler Date: Fri, 14 Mar 2014 16:30:46 -0400 X-Google-Sender-Auth: E97poGtGyvMWcJZ-ClS_rE0rso8 Message-ID: Subject: Re: svn commit: r263186 - in head: . tools/tools/nanobsd To: Warner Losh Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 20:31:18 -0000 On 14 March 2014 15:45, Warner Losh wrote: > Author: imp > Date: Fri Mar 14 19:45:40 2014 > New Revision: 263186 > URL: http://svnweb.freebsd.org/changeset/base/263186 > > Log: > With the more generous footprints today, it makes little sense to use > UFS1 by default any more. Switch to UFS2. > > Modified: > head/Makefile.inc1 > head/tools/tools/nanobsd/nanobsd.sh > > Modified: head/Makefile.inc1 > ============================================================================== > --- head/Makefile.inc1 Fri Mar 14 19:45:32 2014 (r263185) > +++ head/Makefile.inc1 Fri Mar 14 19:45:40 2014 (r263186) > @@ -231,6 +231,9 @@ CROSSENV+= GROFF_BIN_PATH=${WORLDTMP}/le > GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \ > GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac > .endif > +.if defined(TARGET_CFLAGS) > +CROSSENV+= ${TARGET_CFLAGS} > +.endif > > # bootstrap-tools stage > BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ > > Modified: head/tools/tools/nanobsd/nanobsd.sh > ============================================================================== > --- head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 19:45:32 2014 (r263185) > +++ head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 19:45:40 2014 (r263186) > @@ -86,7 +86,7 @@ NANO_CUSTOMIZE="" > NANO_LATE_CUSTOMIZE="" > > # Newfs paramters to use > -NANO_NEWFS="-b 4096 -f 512 -i 8192 -O1 -U" > +NANO_NEWFS="-b 4096 -f 512 -i 8192 -O2 -U" Perhaps it makes sense to drop -O and just rely on newfs's default? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 20:32:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C96A269E for ; Fri, 14 Mar 2014 20:32:46 +0000 (UTC) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9219CBA8 for ; Fri, 14 Mar 2014 20:32:46 +0000 (UTC) Received: by mail-ie0-f182.google.com with SMTP id y20so3157354ier.13 for ; Fri, 14 Mar 2014 13:32:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=A8uu24b9ekzcHLoSetCUQ0oBs4kv3Q6pCIU04QWy8qo=; b=JoXJ+5FGOKoqsZjE37YJnvFox6deo9znp0DSJWJ8/PzM1NmUUcPMIKcqeq1MJCS/a8 ZsvZztpv6XbzusvGwtDTJi/f42ZpH942AbuLt0reZBOQ+6Qu6DDTucwhbr6f1QZ2FbKr VsTOB6JKLxNzxnFK7fusRvhJ1zt+qnZXeJ47R6JAemXo5CkMyNrZNYsTMNlrxepXflcF VIiiOXtHp7tD/efcJVJLFF5KOljzTv0+ZJeeneh7FOxODtriGIa/i9Yx3yFvYbZyq6eh ri3kskxdiuYSbLaVP5I1ZdSmaJbI77iTUlOBD9KzMmBo6ZT3+7DFBZy8mousqomqMDp1 +SeA== X-Gm-Message-State: ALoCoQnPmbeABlRwsYGomm+tevfWFqdyoK3P/pjtYPQ6/jwo2bvSD8kN+w+sQHf/Xmg+Ka6BabIk X-Received: by 10.50.12.100 with SMTP id x4mr9940120igb.15.1394829160580; Fri, 14 Mar 2014 13:32:40 -0700 (PDT) Received: from netflix-mac.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id mi2sm406405igb.3.2014.03.14.13.32.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Mar 2014 13:32:38 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263186 - in head: . tools/tools/nanobsd From: Warner Losh In-Reply-To: Date: Fri, 14 Mar 2014 14:32:37 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <183D757C-486B-45F7-8AC3-70106C0C3605@bsdimp.com> References: <201403141945.s2EJjfHS055894@svn.freebsd.org> To: Eitan Adler X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 20:32:46 -0000 On Mar 14, 2014, at 2:30 PM, Eitan Adler wrote: > On 14 March 2014 15:45, Warner Losh wrote: >> Author: imp >> Date: Fri Mar 14 19:45:40 2014 >> New Revision: 263186 >> URL: http://svnweb.freebsd.org/changeset/base/263186 >>=20 >> Log: >> With the more generous footprints today, it makes little sense to = use >> UFS1 by default any more. Switch to UFS2. >>=20 >> Modified: >> head/Makefile.inc1 >> head/tools/tools/nanobsd/nanobsd.sh >>=20 >> Modified: head/Makefile.inc1 >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/Makefile.inc1 Fri Mar 14 19:45:32 2014 (r263185) >> +++ head/Makefile.inc1 Fri Mar 14 19:45:40 2014 (r263186) >> @@ -231,6 +231,9 @@ CROSSENV+=3D GROFF_BIN_PATH=3D${WORLDTMP}/le >> = GROFF_FONT_PATH=3D${WORLDTMP}/legacy/usr/share/groff_font \ >> GROFF_TMAC_PATH=3D${WORLDTMP}/legacy/usr/share/tmac >> .endif >> +.if defined(TARGET_CFLAGS) >> +CROSSENV+=3D ${TARGET_CFLAGS} >> +.endif >>=20 >> # bootstrap-tools stage >> BMAKEENV=3D INSTALL=3D"sh ${.CURDIR}/tools/install.sh" \ >>=20 >> Modified: head/tools/tools/nanobsd/nanobsd.sh >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 19:45:32 2014 = (r263185) >> +++ head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 19:45:40 2014 = (r263186) >> @@ -86,7 +86,7 @@ NANO_CUSTOMIZE=3D"" >> NANO_LATE_CUSTOMIZE=3D"" >>=20 >> # Newfs paramters to use >> -NANO_NEWFS=3D"-b 4096 -f 512 -i 8192 -O1 -U" >> +NANO_NEWFS=3D"-b 4096 -f 512 -i 8192 -O2 -U" >=20 > Perhaps it makes sense to drop -O and just rely on newfs's default? Not a bad idea. Warner= From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 20:54:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02341B4D; Fri, 14 Mar 2014 20:54:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E3580D6A; Fri, 14 Mar 2014 20:54:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2EKsF8V084177; Fri, 14 Mar 2014 20:54:15 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2EKsFIa084176; Fri, 14 Mar 2014 20:54:15 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403142054.s2EKsFIa084176@svn.freebsd.org> From: Eitan Adler Date: Fri, 14 Mar 2014 20:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263191 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 20:54:16 -0000 Author: eadler Date: Fri Mar 14 20:54:15 2014 New Revision: 263191 URL: http://svnweb.freebsd.org/changeset/base/263191 Log: libusb: add libusb_log_level enum This is documented on http://libusb.sourceforge.net/api-1.0/group__lib.html Modified: head/lib/libusb/libusb.h Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Fri Mar 14 20:20:36 2014 (r263190) +++ head/lib/libusb/libusb.h Fri Mar 14 20:54:15 2014 (r263191) @@ -192,6 +192,19 @@ enum libusb_transfer_flags { LIBUSB_TRANSFER_FREE_TRANSFER = 1 << 2, }; +enum libusb_log_level { + LIBUSB_LOG_LEVEL_NONE = 0, + LIBUSB_LOG_LEVEL_ERROR, + LIBUSB_LOG_LEVEL_WARNING, + LIBUSB_LOG_LEVEL_INFO, + LIBUSB_LOG_LEVEL_DEBUG +}; + +/* XXX */ +/* libusb_set_debug should take parameters from libusb_log_level + * above according to + * http://libusb.sourceforge.net/api-1.0/group__lib.html + */ enum libusb_debug_level { LIBUSB_DEBUG_NO=0, LIBUSB_DEBUG_FUNCTION=1, From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 21:13:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F083CF46; Fri, 14 Mar 2014 21:13:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DD739EEC; Fri, 14 Mar 2014 21:13:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2ELDwlf092494; Fri, 14 Mar 2014 21:13:58 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2ELDwhx092493; Fri, 14 Mar 2014 21:13:58 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403142113.s2ELDwhx092493@svn.freebsd.org> From: Warner Losh Date: Fri, 14 Mar 2014 21:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263192 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 21:13:59 -0000 Author: imp Date: Fri Mar 14 21:13:58 2014 New Revision: 263192 URL: http://svnweb.freebsd.org/changeset/base/263192 Log: Rely on default UFS type (though this is unlikely to change). Submitted by: eadler Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 20:54:15 2014 (r263191) +++ head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 21:13:58 2014 (r263192) @@ -86,7 +86,7 @@ NANO_CUSTOMIZE="" NANO_LATE_CUSTOMIZE="" # Newfs paramters to use -NANO_NEWFS="-b 4096 -f 512 -i 8192 -O2 -U" +NANO_NEWFS="-b 4096 -f 512 -i 8192 -U" # The drive name of the media at runtime NANO_DRIVE=ad0 From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 21:18:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96548215; Fri, 14 Mar 2014 21:18:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 82D6FF20; Fri, 14 Mar 2014 21:18:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2ELIfdI093065; Fri, 14 Mar 2014 21:18:41 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2ELIfYS093064; Fri, 14 Mar 2014 21:18:41 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403142118.s2ELIfYS093064@svn.freebsd.org> From: Warner Losh Date: Fri, 14 Mar 2014 21:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263193 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 21:18:41 -0000 Author: imp Date: Fri Mar 14 21:18:41 2014 New Revision: 263193 URL: http://svnweb.freebsd.org/changeset/base/263193 Log: Remove TARGET_BIG_ENDIAN. It's no longer relevant. Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 21:13:58 2014 (r263192) +++ head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 21:18:41 2014 (r263193) @@ -228,7 +228,6 @@ build_kernel ( ) ( # unset these just in case to avoid compiler complaints # when cross-building unset TARGET_CPUTYPE - unset TARGET_BIG_ENDIAN # Note: We intentionally build all modules, not only the ones in # NANO_MODULES so the built world can be reused by multiple images. env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \ From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 21:35:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 755934E7; Fri, 14 Mar 2014 21:35:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6267D12F; Fri, 14 Mar 2014 21:35:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2ELZHpY000768; Fri, 14 Mar 2014 21:35:17 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2ELZHM2000767; Fri, 14 Mar 2014 21:35:17 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201403142135.s2ELZHM2000767@svn.freebsd.org> From: Neel Natu Date: Fri, 14 Mar 2014 21:35:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263194 - head/usr.bin/ktrdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 21:35:17 -0000 Author: neel Date: Fri Mar 14 21:35:16 2014 New Revision: 263194 URL: http://svnweb.freebsd.org/changeset/base/263194 Log: Fix an issue with ktrdump(8) where it would not print all entries in the KTR buffer. This happens when 'i' tries to wrap around from 0 to 'entries - 1'. Since 'i' is a signed integer the modulo operation actually returns a negative number. Fix this by computing the next index to use "by hand" instead of relying on the modulo operator. Modified: head/usr.bin/ktrdump/ktrdump.c Modified: head/usr.bin/ktrdump/ktrdump.c ============================================================================== --- head/usr.bin/ktrdump/ktrdump.c Fri Mar 14 21:18:41 2014 (r263193) +++ head/usr.bin/ktrdump/ktrdump.c Fri Mar 14 21:35:16 2014 (r263194) @@ -219,8 +219,11 @@ main(int ac, char **av) /* * Now tear through the trace buffer. */ - if (!iflag) - i = (index - 1) % entries; + if (!iflag) { + i = index - 1; + if (i < 0) + i = entries - 1; + } tlast = -1; for (;;) { if (buf[i].ktr_desc == NULL) @@ -288,7 +291,8 @@ next: if ((c = *p++) == '\0') if (!iflag) { if (i == index) break; - i = (i - 1) % entries; + if (--i < 0) + i = entries - 1; } else { if (++i == entries) break; From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 21:45:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D354F7BF; Fri, 14 Mar 2014 21:45:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B398020C; Fri, 14 Mar 2014 21:45:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2ELjcYC004793; Fri, 14 Mar 2014 21:45:38 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2ELjcSN004790; Fri, 14 Mar 2014 21:45:38 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201403142145.s2ELjcSN004790@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 14 Mar 2014 21:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263195 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 21:45:39 -0000 Author: jilles Date: Fri Mar 14 21:45:37 2014 New Revision: 263195 URL: http://svnweb.freebsd.org/changeset/base/263195 Log: sh: Add some consts. Modified: head/bin/sh/expand.c head/bin/sh/jobs.c head/bin/sh/redir.c Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Fri Mar 14 21:35:16 2014 (r263194) +++ head/bin/sh/expand.c Fri Mar 14 21:45:37 2014 (r263195) @@ -104,8 +104,8 @@ static char *expari(char *); static void expbackq(union node *, int, int); static int subevalvar(char *, char *, int, int, int, int, int); static char *evalvar(char *, int); -static int varisset(char *, int); -static void varvalue(char *, int, int, int); +static int varisset(const char *, int); +static void varvalue(const char *, int, int, int); static void recordregion(int, int, int); static void removerecordregions(int); static void ifsbreakup(char *, struct arglist *); @@ -633,7 +633,7 @@ evalvar(char *p, int flag) int subtype; int varflags; char *var; - char *val; + const char *val; int patloc; int c; int set; @@ -827,7 +827,7 @@ record: */ static int -varisset(char *name, int nulok) +varisset(const char *name, int nulok) { if (*name == '!') @@ -876,7 +876,7 @@ strtodest(const char *p, int flag, int s */ static void -varvalue(char *name, int quoted, int subtype, int flag) +varvalue(const char *name, int quoted, int subtype, int flag) { int num; char *p; Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Fri Mar 14 21:35:16 2014 (r263194) +++ head/bin/sh/jobs.c Fri Mar 14 21:45:37 2014 (r263195) @@ -95,9 +95,9 @@ static void restartjob(struct job *); #endif static void freejob(struct job *); static int waitcmdloop(struct job *); -static struct job *getjob_nonotfound(char *); -static struct job *getjob(char *); pid_t getjobpgrp(char *); +static struct job *getjob_nonotfound(const char *); +static struct job *getjob(const char *); static pid_t dowait(int, struct job *); static void checkzombies(void); static void cmdtxt(union node *); @@ -558,7 +558,7 @@ jobidcmd(int argc __unused, char **argv */ static struct job * -getjob_nonotfound(char *name) +getjob_nonotfound(const char *name) { int jobno; struct job *found, *jp; @@ -628,7 +628,7 @@ currentjob: if ((jp = getcurjob(NULL)) = static struct job * -getjob(char *name) +getjob(const char *name) { struct job *jp; Modified: head/bin/sh/redir.c ============================================================================== --- head/bin/sh/redir.c Fri Mar 14 21:35:16 2014 (r263194) +++ head/bin/sh/redir.c Fri Mar 14 21:45:37 2014 (r263195) @@ -152,7 +152,7 @@ openredirect(union node *redir, char mem { struct stat sb; int fd = redir->nfile.fd; - char *fname; + const char *fname; int f; int e; @@ -250,7 +250,7 @@ movefd: static int openhere(union node *redir) { - char *p; + const char *p; int pip[2]; size_t len = 0; int flags; From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 22:07:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 642C8A6E; Fri, 14 Mar 2014 22:07:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 503F0398; Fri, 14 Mar 2014 22:07:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2EM79aC012927; Fri, 14 Mar 2014 22:07:09 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2EM79Op012926; Fri, 14 Mar 2014 22:07:09 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201403142207.s2EM79Op012926@svn.freebsd.org> From: Neel Natu Date: Fri, 14 Mar 2014 22:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263196 - head/usr.bin/ktrdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 22:07:09 -0000 Author: neel Date: Fri Mar 14 22:07:08 2014 New Revision: 263196 URL: http://svnweb.freebsd.org/changeset/base/263196 Log: Don't dump entries that were modified during the time the KTR buffer was being copied to userspace. Failing to do this would result in entries at the bottom of the ktrdump output to be more recent than entries at the top. With this change the timestamps are monotonically decreasing going from the top to the bottom of the ktrdump output. Modified: head/usr.bin/ktrdump/ktrdump.c Modified: head/usr.bin/ktrdump/ktrdump.c ============================================================================== --- head/usr.bin/ktrdump/ktrdump.c Fri Mar 14 21:45:37 2014 (r263195) +++ head/usr.bin/ktrdump/ktrdump.c Fri Mar 14 22:07:08 2014 (r263196) @@ -93,7 +93,7 @@ main(int ac, char **av) char *p; int version; int entries; - int index; + int index, index2; int parm; int in; int c; @@ -182,7 +182,8 @@ main(int ac, char **av) if (kvm_read(kd, nl[2].n_value, &index, sizeof(index)) == -1 || kvm_read(kd, nl[3].n_value, &bufptr, sizeof(bufptr)) == -1 || - kvm_read(kd, bufptr, buf, sizeof(*buf) * entries) == -1) + kvm_read(kd, bufptr, buf, sizeof(*buf) * entries) == -1 || + kvm_read(kd, nl[2].n_value, &index2, sizeof(index2)) == -1) errx(1, "%s", kvm_geterr(kd)); } @@ -289,7 +290,14 @@ next: if ((c = *p++) == '\0') parms[4], parms[5]); fprintf(out, "\n"); if (!iflag) { - if (i == index) + /* + * 'index' and 'index2' are the values of 'ktr_idx' + * before and after the KTR buffer was copied into + * 'buf'. Since the KTR entries between 'index' and + * 'index2' were in flux while the KTR buffer was + * being copied to userspace we don't dump them. + */ + if (i == index2) break; if (--i < 0) i = entries - 1; From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 23:26:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26C3B780; Fri, 14 Mar 2014 23:26:43 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 92BB3C11; Fri, 14 Mar 2014 23:26:42 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 23D3B1045587; Sat, 15 Mar 2014 10:26:33 +1100 (EST) Date: Sat, 15 Mar 2014 10:26:26 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Rui Paulo Subject: Re: svn commit: r262972 - head/sys/dev/usb/input In-Reply-To: Message-ID: <20140315075248.Y964@besplex.bde.org> References: <201403100852.s2A8qUdC045704@svn.freebsd.org> <5322CCC5.7020608@bitfrost.no> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=ddC5gxne c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=XVJnJZe_LX4A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=8xAuDnBn9tNlXJECYWkA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 Cc: Hans Petter Selasky , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 23:26:43 -0000 On Fri, 14 Mar 2014, Rui Paulo wrote: > On 14 Mar 2014, at 02:32, Hans Petter Selasky wrote: > >> On 03/14/14 03:15, Rui Paulo wrote: >>> On 10 Mar 2014, at 01:52, Hans Petter Selasky wrote: [>* excessive quoting deleted] >>>> Modified: head/sys/dev/usb/input/ukbd.c >>>> ============================================================================== >>>> --- head/sys/dev/usb/input/ukbd.c Mon Mar 10 06:41:48 2014 (r262971) >>>> +++ head/sys/dev/usb/input/ukbd.c Mon Mar 10 08:52:30 2014 (r262972) >>>> @@ -1909,6 +1909,12 @@ ukbd_ioctl(keyboard_t *kbd, u_long cmd, >>>> int result; >>>> >>>> /* >>>> + * XXX Check of someone is calling us from a critical section: >>>> + */ >>>> + if (curthread->td_critnest != 0) >>>> + return (EDEADLK); >>> >>> Shouldn't this panic? >> >> This happens on shutdown, in some special case. Not sure if panic at shutdown is appropriate? > > I thought this was a programming error. Do we know the special cases and why it happens? Doesn't it already break setting of LEDs and perhaps other things in ddb (when ddb traps a in a critical section)? Panicing would give even better breakage. It is a programming error (or perhaps a hardware defect) to not allow setting LEDs in ddb. Some hardware makes this very difficult. VGA and AT keyboard hardware is simpler than USB hardware, but syscons gets this wrong, mostly in the opposite direction by allowing races. Serial hardware is simpler still, but some serial drivers still get this wrong. Working console drivers support single-stepping through their own (re)initialization (except parts of this hidden by the virtualization needed to make it work). Most reinitialization occurs in ioctls, where it is probably simpler than in resume. It includes things like LED handling: - someone hits caps lock. The keyboard interrupt handler calls code to set the LED for caps lock (if this is done in software) - someone is debugging keyboard code, perhaps even LED handling code, and execution stops in or before the LED handling code - the debugging includes keystrokes that should toggle LEDs. These may occur at any instruction in the LED handling code, where the reinitialization of the LEDs is in in an indeterminate state. The intermediate state should be locked, but debugger activity must not block on this. The keystrokes should have their normal action of toggling the LED, except possibly when it was in a half-way state -- then toggling it could go either way) - when the LED handling code finishes, or soon after, the LED state must not be indeterminate. It might be the opposite of what it would have been without any debugger activity, but only if this is consistent with the software state. Normal software state for things like caps lock has precedence over what the LED is showing. Any debugger activity that toggles caps lock should toggle the software state first and set the LED to match. Very occasionally, the states will get out of sync when an instruction modifies the hardware state. This should be fixed up as soon as possible. In syscons, related fixups occur automatically for VGA things since everything is refreshed from the software state often. LED toggling has to work in critical sections too. Then the LED code itself is not being reentered (unless parts of it are locked by critical sections), but there are other complications. Of course, the LED code must not use any interrupts or do any context switches in debugger mode. (This reminds me that the AT keyboard hardware and syscons software for it are horrible. It takes a complicated protocol and several milliseconds to toggle a LED. My first microcomputer in 1982 was much better. It took a single memory access and several microseconds to set a LED to an 8-bit color. Syscons has always used polled i/o to set LEDs. This blocks its interrupt handler (and with spltty() or Giant, too many other interrupt handlers) for too long. But it allows LED setting in debugger mode to work without additional complications or bugs.) Bruce From owner-svn-src-head@FreeBSD.ORG Sat Mar 15 00:57:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0ED50558; Sat, 15 Mar 2014 00:57:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ECA9D32C; Sat, 15 Mar 2014 00:57:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2F0vq8A081620; Sat, 15 Mar 2014 00:57:52 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2F0vofg081606; Sat, 15 Mar 2014 00:57:50 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201403150057.s2F0vofg081606@svn.freebsd.org> From: Robert Watson Date: Sat, 15 Mar 2014 00:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263198 - in head/sys: amd64/conf conf net netinet netinet6 sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 00:57:53 -0000 Author: rwatson Date: Sat Mar 15 00:57:50 2014 New Revision: 263198 URL: http://svnweb.freebsd.org/changeset/base/263198 Log: Several years after initial development, merge prototype support for linking NIC Receive Side Scaling (RSS) to the network stack's connection-group implementation. This prototype (and derived patches) are in use at Juniper and several other FreeBSD-using companies, so despite some reservations about its maturity, merge the patch to the base tree so that it can be iteratively refined in collaboration rather than maintained as a set of gradually diverging patch sets. (1) Merge a software implementation of the Toeplitz hash specified in RSS implemented by David Malone. This is used to allow suitable pcbgroup placement of connections before the first packet is received from the NIC. Software hashing is generally avoided, however, due to high cost of the hash on general-purpose CPUs. (2) In in_rss.c, maintain authoritative versions of RSS state intended to be pushed to each NIC, including keying material, hash algorithm/ configuration, and buckets. Provide software-facing interfaces to hash 2- and 4-tuples for IPv4 and IPv6 using both the RSS standardised Toeplitz and a 'naive' variation with a hash efficient in software but with poor distribution properties. Implement rss_m2cpuid()to be used by netisr and other load balancing code to look up the CPU on which an mbuf should be processed. (3) In the Ethernet link layer, allow netisr distribution using RSS as a source of policy as an alternative to source ordering; continue to default to direct dispatch (i.e., don't try and requeue packets for processing on the 'right' CPU if they arrive in a directly dispatchable context). (4) Allow RSS to control tuning of connection groups in order to align groups with RSS buckets. If a packet arrives on a protocol using connection groups, and contains a suitable hardware-generated hash, use that hash value to select the connection group for pcb lookup for both IPv4 and IPv6. If no hardware-generated Toeplitz hash is available, we fall back on regular PCB lookup risking contention rather than pay the cost of Toeplitz in software -- this is a less scalable but, at my last measurement, faster approach. As core counts go up, we may want to revise this strategy despite CPU overhead. Where device drivers suitably configure NICs, and connection groups / RSS are enabled, this should avoid both lock and line contention during connection lookup for TCP. This commit does not modify any device drivers to tune device RSS configuration to the global RSS configuration; patches are in circulation to do this for at least Chelsio T3 and Intel 1G/10G drivers. Currently, the KPI for device drivers is not particularly robust, nor aware of more advanced features such as runtime reconfiguration/rebalancing. This will hopefully prove a useful starting point for refinement. No MFC is scheduled as we will first want to nail down a more mature and maintainable KPI/KBI for device drivers. Sponsored by: Juniper Networks (original work) Sponsored by: EMC/Isilon (patch update and merge) Added: head/sys/netinet/in_rss.c (contents, props changed) head/sys/netinet/in_rss.h (contents, props changed) head/sys/netinet/toeplitz.c (contents, props changed) head/sys/netinet/toeplitz.h (contents, props changed) Modified: head/sys/amd64/conf/GENERIC head/sys/conf/files head/sys/conf/options head/sys/net/if_ethersubr.c head/sys/netinet/in_pcb.c head/sys/netinet/in_pcbgroup.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_pcbgroup.c head/sys/sys/priv.h Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sat Mar 15 00:23:35 2014 (r263197) +++ head/sys/amd64/conf/GENERIC Sat Mar 15 00:57:50 2014 (r263198) @@ -28,6 +28,8 @@ options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols +options PCBGROUP # Protocol control-block groups +options RSS # Receive-side scaling support options TCP_OFFLOAD # TCP offload options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Mar 15 00:23:35 2014 (r263197) +++ head/sys/conf/files Sat Mar 15 00:57:50 2014 (r263198) @@ -3267,6 +3267,7 @@ netinet/in_pcb.c optional inet | inet6 netinet/in_pcbgroup.c optional inet pcbgroup | inet6 pcbgroup netinet/in_proto.c optional inet | inet6 netinet/in_rmx.c optional inet +netinet/in_rss.c optional inet rss | inet6 rss netinet/ip_divert.c optional inet ipdivert ipfirewall netinet/ip_ecn.c optional inet | inet6 netinet/ip_encap.c optional inet | inet6 @@ -3308,6 +3309,7 @@ netinet/tcp_syncache.c optional inet | netinet/tcp_timer.c optional inet | inet6 netinet/tcp_timewait.c optional inet | inet6 netinet/tcp_usrreq.c optional inet | inet6 +netinet/toeplitz.c optional inet rss | inet6 rss netinet/udp_usrreq.c optional inet | inet6 netinet/libalias/alias.c optional libalias inet | netgraph_nat inet netinet/libalias/alias_db.c optional libalias inet | netgraph_nat inet Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat Mar 15 00:23:35 2014 (r263197) +++ head/sys/conf/options Sat Mar 15 00:57:50 2014 (r263198) @@ -427,6 +427,7 @@ PCBGROUP opt_pcbgroup.h PF_DEFAULT_TO_DROP opt_pf.h RADIX_MPATH opt_mpath.h ROUTETABLES opt_route.h +RSS opt_rss.h SLIP_IFF_OPTS opt_slip.h TCPDEBUG TCP_OFFLOAD opt_inet.h # Enable code to dispatch TCP offloading Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Sat Mar 15 00:23:35 2014 (r263197) +++ head/sys/net/if_ethersubr.c Sat Mar 15 00:57:50 2014 (r263198) @@ -34,6 +34,7 @@ #include "opt_inet6.h" #include "opt_netgraph.h" #include "opt_mbuf_profiling.h" +#include "opt_rss.h" #include #include @@ -70,6 +71,7 @@ #include #include #include +#include #include #include #endif @@ -583,7 +585,22 @@ ether_input_internal(struct ifnet *ifp, /* * Ethernet input dispatch; by default, direct dispatch here regardless of - * global configuration. + * global configuration. However, if RSS is enabled, hook up RSS affinity + * so that when deferred or hybrid dispatch is enabled, we can redistribute + * load based on RSS. + * + * XXXRW: Would be nice if the ifnet passed up a flag indicating whether or + * not it had already done work distribution via multi-queue. Then we could + * direct dispatch in the event load balancing was already complete and + * handle the case of interfaces with different capabilities better. + * + * XXXRW: Sort of want an M_DISTRIBUTED flag to avoid multiple distributions + * at multiple layers? + * + * XXXRW: For now, enable all this only if RSS is compiled in, although it + * works fine without RSS. Need to characterise the performance overhead + * of the detour through the netisr code in the event the result is always + * direct dispatch. */ static void ether_nh_input(struct mbuf *m) @@ -596,8 +613,14 @@ static struct netisr_handler ether_nh = .nh_name = "ether", .nh_handler = ether_nh_input, .nh_proto = NETISR_ETHER, +#ifdef RSS + .nh_policy = NETISR_POLICY_CPU, + .nh_dispatch = NETISR_DISPATCH_DIRECT, + .nh_m2cpuid = rss_m2cpuid, +#else .nh_policy = NETISR_POLICY_SOURCE, .nh_dispatch = NETISR_DISPATCH_DIRECT, +#endif }; static void Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Sat Mar 15 00:23:35 2014 (r263197) +++ head/sys/netinet/in_pcb.c Sat Mar 15 00:57:50 2014 (r263198) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_pcbgroup.h" +#include "opt_rss.h" #include #include @@ -75,6 +76,7 @@ __FBSDID("$FreeBSD$"); #if defined(INET) || defined(INET6) #include #include +#include #include #include #include @@ -1820,7 +1822,7 @@ struct inpcb * in_pcblookup(struct inpcbinfo *pcbinfo, struct in_addr faddr, u_int fport, struct in_addr laddr, u_int lport, int lookupflags, struct ifnet *ifp) { -#if defined(PCBGROUP) +#if defined(PCBGROUP) && !defined(RSS) struct inpcbgroup *pcbgroup; #endif @@ -1829,7 +1831,17 @@ in_pcblookup(struct inpcbinfo *pcbinfo, KASSERT((lookupflags & (INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB)) != 0, ("%s: LOCKPCB not set", __func__)); -#if defined(PCBGROUP) + /* + * When not using RSS, use connection groups in preference to the + * reservation table when looking up 4-tuples. When using RSS, just + * use the reservation table, due to the cost of the Toeplitz hash + * in software. + * + * XXXRW: This policy belongs in the pcbgroup code, as in principle + * we could be doing RSS with a non-Toeplitz hash that is affordable + * in software. + */ +#if defined(PCBGROUP) && !defined(RSS) if (in_pcbgroup_enabled(pcbinfo)) { pcbgroup = in_pcbgroup_bytuple(pcbinfo, laddr, lport, faddr, fport); @@ -1856,16 +1868,27 @@ in_pcblookup_mbuf(struct inpcbinfo *pcbi ("%s: LOCKPCB not set", __func__)); #ifdef PCBGROUP - if (in_pcbgroup_enabled(pcbinfo)) { + /* + * If we can use a hardware-generated hash to look up the connection + * group, use that connection group to find the inpcb. Otherwise + * fall back on a software hash -- or the reservation table if we're + * using RSS. + * + * XXXRW: As above, that policy belongs in the pcbgroup code. + */ + if (in_pcbgroup_enabled(pcbinfo) && + !(M_HASHTYPE_TEST(m, M_HASHTYPE_NONE))) { pcbgroup = in_pcbgroup_byhash(pcbinfo, M_HASHTYPE_GET(m), m->m_pkthdr.flowid); if (pcbgroup != NULL) return (in_pcblookup_group(pcbinfo, pcbgroup, faddr, fport, laddr, lport, lookupflags, ifp)); +#ifndef RSS pcbgroup = in_pcbgroup_bytuple(pcbinfo, laddr, lport, faddr, fport); return (in_pcblookup_group(pcbinfo, pcbgroup, faddr, fport, laddr, lport, lookupflags, ifp)); +#endif } #endif return (in_pcblookup_hash(pcbinfo, faddr, fport, laddr, lport, Modified: head/sys/netinet/in_pcbgroup.c ============================================================================== --- head/sys/netinet/in_pcbgroup.c Sat Mar 15 00:23:35 2014 (r263197) +++ head/sys/netinet/in_pcbgroup.c Sat Mar 15 00:57:50 2014 (r263198) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" +#include "opt_rss.h" #include #include @@ -43,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #ifdef INET6 #include #endif /* INET6 */ @@ -60,6 +62,13 @@ __FBSDID("$FreeBSD$"); * minimal cache line migration and lock contention during steady state * operation. * + * Hardware-offloaded checksums are often inefficient in software -- for + * example, Toeplitz, specified by RSS, introduced a significant overhead if + * performed during per-packge processing. It is therefore desirable to fall + * back on traditional reservation table lookups without affinity where + * hardware-offloaded checksums aren't available, such as for traffic over + * non-RSS interfaces. + * * Internet protocols, such as UDP and TCP, register to use connection groups * by providing an ipi_hashfields value other than IPI_HASHFIELDS_NONE; this * indicates to the connection group code whether a 2-tuple or 4-tuple is @@ -72,6 +81,11 @@ __FBSDID("$FreeBSD$"); * signficantly more expensive than without connection groups, but that * steady-state processing can be significantly faster. * + * When RSS is used, certain connection group parameters, such as the number + * of groups, are provided by the RSS implementation, found in in_rss.c. + * Otherwise, in_pcbgroup.c selects possible sensible parameters + * corresponding to the degree of parallelism exposed by netisr. + * * Most of the implementation of connection groups is in this file; however, * connection group lookup is implemented in in_pcb.c alongside reservation * table lookups -- see in_pcblookup_group(). @@ -126,11 +140,25 @@ in_pcbgroup_init(struct inpcbinfo *pcbin if (mp_ncpus == 1) return; +#ifdef RSS /* - * Use one group per CPU for now. If we decide to do dynamic - * rebalancing a la RSS, we'll need to shift left by at least 1. + * If we're using RSS, then RSS determines the number of connection + * groups to use: one connection group per RSS bucket. If for some + * reason RSS isn't able to provide a number of buckets, disable + * connection groups entirely. + * + * XXXRW: Can this ever happen? + */ + numpcbgroups = rss_getnumbuckets(); + if (numpcbgroups == 0) + return; +#else + /* + * Otherwise, we'll just use one per CPU for now. If we decide to + * do dynamic rebalancing a la RSS, we'll need similar logic here. */ numpcbgroups = mp_ncpus; +#endif pcbinfo->ipi_hashfields = hashfields; pcbinfo->ipi_pcbgroups = malloc(numpcbgroups * @@ -146,10 +174,19 @@ in_pcbgroup_init(struct inpcbinfo *pcbin /* * Initialise notional affinity of the pcbgroup -- for RSS, - * we want the same notion of affinity as NICs to be used. - * Just round robin for the time being. + * we want the same notion of affinity as NICs to be used. In + * the non-RSS case, just round robin for the time being. + * + * XXXRW: The notion of a bucket to CPU mapping is common at + * both pcbgroup and RSS layers -- does that mean that we + * should migrate it all from RSS to here, and just leave RSS + * responsible only for providing hashing and mapping funtions? */ +#ifdef RSS + pcbgroup->ipg_cpu = rss_getcpu(pgn); +#else pcbgroup->ipg_cpu = (pgn % mp_ncpus); +#endif } } @@ -179,23 +216,38 @@ in_pcbgroup_destroy(struct inpcbinfo *pc /* * Given a hash of whatever the covered tuple might be, return a pcbgroup - * index. + * index. Where RSS is supported, try to align bucket selection with RSS CPU + * affinity strategy. */ static __inline u_int in_pcbgroup_getbucket(struct inpcbinfo *pcbinfo, uint32_t hash) { +#ifdef RSS + return (rss_getbucket(hash)); +#else return (hash % pcbinfo->ipi_npcbgroups); +#endif } /* * Map a (hashtype, hash) tuple into a connection group, or NULL if the hash - * information is insufficient to identify the pcbgroup. + * information is insufficient to identify the pcbgroup. This might occur if + * a TCP packet turns up with a 2-tuple hash, or if an RSS hash is present but + * RSS is not compiled into the kernel. */ struct inpcbgroup * in_pcbgroup_byhash(struct inpcbinfo *pcbinfo, u_int hashtype, uint32_t hash) { +#ifdef RSS + if ((pcbinfo->ipi_hashfields == IPI_HASHFIELDS_4TUPLE && + hashtype == M_HASHTYPE_RSS_TCP_IPV4) || + (pcbinfo->ipi_hashfields == IPI_HASHFIELDS_2TUPLE && + hashtype == M_HASHTYPE_RSS_IPV4)) + return (&pcbinfo->ipi_pcbgroups[ + in_pcbgroup_getbucket(pcbinfo, hash)]); +#endif return (NULL); } @@ -213,13 +265,26 @@ in_pcbgroup_bytuple(struct inpcbinfo *pc { uint32_t hash; + /* + * RSS note: we pass foreign addr/port as source, and local addr/port + * as destination, as we want to align with what the hardware is + * doing. + */ switch (pcbinfo->ipi_hashfields) { case IPI_HASHFIELDS_4TUPLE: +#ifdef RSS + hash = rss_hash_ip4_4tuple(faddr, fport, laddr, lport); +#else hash = faddr.s_addr ^ fport; +#endif break; case IPI_HASHFIELDS_2TUPLE: +#ifdef RSS + hash = rss_hash_ip4_2tuple(faddr, laddr); +#else hash = faddr.s_addr ^ laddr.s_addr; +#endif break; default: Added: head/sys/netinet/in_rss.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/in_rss.c Sat Mar 15 00:57:50 2014 (r263198) @@ -0,0 +1,505 @@ +/*- + * Copyright (c) 2010-2011 Juniper Networks, Inc. + * All rights reserved. + * + * This software was developed by Robert N. M. Watson under contract + * to Juniper Networks, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +__FBSDID("$FreeBSD$"); + +#include "opt_inet6.h" +#include "opt_pcbgroup.h" + +#ifndef PCBGROUP +#error "options RSS depends on options PCBGROUP" +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +/*- + * Operating system parts of receiver-side scaling (RSS), which allows + * network cards to direct flows to particular receive queues based on hashes + * of header tuples. This implementation aligns RSS buckets with connection + * groups at the TCP/IP layer, so each bucket is associated with exactly one + * group. As a result, the group lookup structures (and lock) should have an + * effective affinity with exactly one CPU. + * + * Network device drivers needing to configure RSS will query this framework + * for parameters, such as the current RSS key, hashing policies, number of + * bits, and indirection table mapping hashes to buckets and CPUs. They may + * provide their own supplementary information, such as queue<->CPU bindings. + * It is the responsibility of the network device driver to inject packets + * into the stack on as close to the right CPU as possible, if playing by RSS + * rules. + * + * TODO: + * + * - Synchronization for rss_key and other future-configurable parameters. + * - Event handler drivers can register to pick up RSS configuration changes. + * - Should we allow rss_basecpu to be configured? + * - Randomize key on boot. + * - IPv6 support. + * - Statistics on how often there's a misalignment between hardware + * placement and pcbgroup expectations. + */ + +SYSCTL_NODE(_net_inet, OID_AUTO, rss, CTLFLAG_RW, 0, "Receive-side steering"); + +/* + * Toeplitz is the only required hash function in the RSS spec, so use it by + * default. + */ +static u_int rss_hashalgo = RSS_HASH_TOEPLITZ; +SYSCTL_INT(_net_inet_rss, OID_AUTO, hashalgo, CTLFLAG_RD, &rss_hashalgo, 0, + "RSS hash algorithm"); +TUNABLE_INT("net.inet.rss.hashalgo", &rss_hashalgo); + +/* + * Size of the indirection table; at most 128 entries per the RSS spec. We + * size it to at least 2 times the number of CPUs by default to allow useful + * rebalancing. If not set explicitly with a loader tunable, we tune based + * on the number of CPUs present. + * + * XXXRW: buckets might be better to use for the tunable than bits. + */ +static u_int rss_bits; +SYSCTL_INT(_net_inet_rss, OID_AUTO, bits, CTLFLAG_RD, &rss_bits, 0, + "RSS bits"); +TUNABLE_INT("net.inet.rss.bits", &rss_bits); + +static u_int rss_mask; +SYSCTL_INT(_net_inet_rss, OID_AUTO, mask, CTLFLAG_RD, &rss_mask, 0, + "RSS mask"); + +static const u_int rss_maxbits = RSS_MAXBITS; +SYSCTL_INT(_net_inet_rss, OID_AUTO, maxbits, CTLFLAG_RD, + __DECONST(int *, &rss_maxbits), 0, "RSS maximum bits"); + +/* + * RSS's own count of the number of CPUs it could be using for processing. + * Bounded to 64 by RSS constants. + */ +static u_int rss_ncpus; +SYSCTL_INT(_net_inet_rss, OID_AUTO, ncpus, CTLFLAG_RD, &rss_ncpus, 0, + "Number of CPUs available to RSS"); + +#define RSS_MAXCPUS (1 << (RSS_MAXBITS - 1)) +static const u_int rss_maxcpus = RSS_MAXCPUS; +SYSCTL_INT(_net_inet_rss, OID_AUTO, maxcpus, CTLFLAG_RD, + __DECONST(int *, &rss_maxcpus), 0, "RSS maximum CPUs that can be used"); + +/* + * Variable exists just for reporting rss_bits in a user-friendly way. + */ +static u_int rss_buckets; +SYSCTL_INT(_net_inet_rss, OID_AUTO, buckets, CTLFLAG_RD, &rss_buckets, 0, + "RSS buckets"); + +/* + * Base CPU number; devices will add this to all CPU numbers returned by the + * RSS indirection table. Currently unmodifable in FreeBSD. + */ +static const u_int rss_basecpu; +SYSCTL_INT(_net_inet_rss, OID_AUTO, basecpu, CTLFLAG_RD, + __DECONST(int *, &rss_basecpu), 0, "RSS base CPU"); + +/* + * RSS secret key, intended to prevent attacks on load-balancing. Its + * effectiveness may be limited by algorithm choice and available entropy + * during the boot. + * + * XXXRW: And that we don't randomize it yet! + * + * XXXRW: This default is actually the default key from Chelsio T3 cards, as + * it offers reasonable distribution, unlike all-0 keys which always + * generate a hash of 0 (upsettingly). + */ +static uint8_t rss_key[RSS_KEYSIZE] = { + 0x43, 0xa3, 0x8f, 0xb0, 0x41, 0x67, 0x25, 0x3d, + 0x25, 0x5b, 0x0e, 0xc2, 0x6d, 0x5a, 0x56, 0xda, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +/* + * RSS hash->CPU table, which maps hashed packet headers to particular CPUs. + * Drivers may supplement this table with a seperate CPU<->queue table when + * programming devices. + */ +struct rss_table_entry { + uint8_t rte_cpu; /* CPU affinity of bucket. */ +}; +static struct rss_table_entry rss_table[RSS_TABLE_MAXLEN]; + +static void +rss_init(__unused void *arg) +{ + u_int i; + + /* + * Validate tunables, coerce to sensible values. + */ + switch (rss_hashalgo) { + case RSS_HASH_TOEPLITZ: + case RSS_HASH_NAIVE: + break; + + default: + printf("%s: invalid RSS hashalgo %u, coercing to %u", + __func__, rss_hashalgo, RSS_HASH_TOEPLITZ); + rss_hashalgo = RSS_HASH_TOEPLITZ; + } + + /* + * Count available CPUs. + * + * XXXRW: Note incorrect assumptions regarding contiguity of this set + * elsewhere. + */ + rss_ncpus = 0; + for (i = 0; i <= mp_maxid; i++) { + if (CPU_ABSENT(i)) + continue; + rss_ncpus++; + } + if (rss_ncpus > RSS_MAXCPUS) + rss_ncpus = RSS_MAXCPUS; + + /* + * Tune RSS table entries to be no less than 2x the number of CPUs + * -- unless we're running uniprocessor, in which case there's not + * much point in having buckets to rearrange for load-balancing! + */ + if (rss_ncpus > 1) { + if (rss_bits == 0) + rss_bits = fls(rss_ncpus - 1) + 1; + + /* + * Microsoft limits RSS table entries to 128, so apply that + * limit to both auto-detected CPU counts and user-configured + * ones. + */ + if (rss_bits == 0 || rss_bits > RSS_MAXBITS) { + printf("%s: RSS bits %u not valid, coercing to %u", + __func__, rss_bits, RSS_MAXBITS); + rss_bits = RSS_MAXBITS; + } + + /* + * Figure out how many buckets to use; warn if less than the + * number of configured CPUs, although this is not a fatal + * problem. + */ + rss_buckets = (1 << rss_bits); + if (rss_buckets < rss_ncpus) + printf("%s: WARNING: rss_buckets (%u) less than " + "rss_ncpus (%u)\n", __func__, rss_buckets, + rss_ncpus); + rss_mask = rss_buckets - 1; + } else { + rss_bits = 0; + rss_buckets = 1; + rss_mask = 0; + } + + /* + * Set up initial CPU assignments: round-robin by default. + * + * XXXRW: Need a mapping to non-contiguous IDs here. + */ + for (i = 0; i < rss_buckets; i++) + rss_table[i].rte_cpu = i % rss_ncpus; + + /* + * Randomize rrs_key. + * + * XXXRW: Not yet. If nothing else, will require an rss_isbadkey() + * loop to check for "bad" RSS keys. + */ +} +SYSINIT(rss_init, SI_SUB_SOFTINTR, SI_ORDER_SECOND, rss_init, NULL); + +static uint32_t +rss_naive_hash(u_int keylen, const uint8_t *key, u_int datalen, + const uint8_t *data) +{ + uint32_t v; + u_int i; + + v = 0; + for (i = 0; i < keylen; i++) + v += key[i]; + for (i = 0; i < datalen; i++) + v += data[i]; + return (v); +} + +static uint32_t +rss_hash(u_int datalen, const uint8_t *data) +{ + + switch (rss_hashalgo) { + case RSS_HASH_TOEPLITZ: + return (toeplitz_hash(sizeof(rss_key), rss_key, datalen, + data)); + + case RSS_HASH_NAIVE: + return (rss_naive_hash(sizeof(rss_key), rss_key, datalen, + data)); + + default: + panic("%s: unsupported/unknown hashalgo %d", __func__, + rss_hashalgo); + } +} + +/* + * Hash an IPv4 2-tuple. + */ +uint32_t +rss_hash_ip4_2tuple(struct in_addr src, struct in_addr dst) +{ + uint8_t data[sizeof(src) + sizeof(dst)]; + u_int datalen; + + datalen = 0; + bcopy(&src, &data[datalen], sizeof(src)); + datalen += sizeof(src); + bcopy(&dst, &data[datalen], sizeof(dst)); + datalen += sizeof(dst); + return (rss_hash(datalen, data)); +} + +/* + * Hash an IPv4 4-tuple. + */ +uint32_t +rss_hash_ip4_4tuple(struct in_addr src, u_short srcport, struct in_addr dst, + u_short dstport) +{ + uint8_t data[sizeof(src) + sizeof(dst) + sizeof(srcport) + + sizeof(dstport)]; + u_int datalen; + + datalen = 0; + bcopy(&src, &data[datalen], sizeof(src)); + datalen += sizeof(src); + bcopy(&dst, &data[datalen], sizeof(dst)); + datalen += sizeof(dst); + bcopy(&srcport, &data[datalen], sizeof(srcport)); + datalen += sizeof(srcport); + bcopy(&dstport, &data[datalen], sizeof(dstport)); + datalen += sizeof(dstport); + return (rss_hash(datalen, data)); +} + +#ifdef INET6 +/* + * Hash an IPv6 2-tuple. + */ +uint32_t +rss_hash_ip6_2tuple(struct in6_addr src, struct in6_addr dst) +{ + uint8_t data[sizeof(src) + sizeof(dst)]; + u_int datalen; + + datalen = 0; + bcopy(&src, &data[datalen], sizeof(src)); + datalen += sizeof(src); + bcopy(&dst, &data[datalen], sizeof(dst)); + datalen += sizeof(dst); + return (rss_hash(datalen, data)); +} + +/* + * Hash an IPv6 4-tuple. + */ +uint32_t +rss_hash_ip6_4tuple(struct in6_addr src, u_short srcport, + struct in6_addr dst, u_short dstport) +{ + uint8_t data[sizeof(src) + sizeof(dst) + sizeof(srcport) + + sizeof(dstport)]; + u_int datalen; + + datalen = 0; + bcopy(&src, &data[datalen], sizeof(src)); + datalen += sizeof(src); + bcopy(&dst, &data[datalen], sizeof(dst)); + datalen += sizeof(dst); + bcopy(&srcport, &data[datalen], sizeof(srcport)); + datalen += sizeof(srcport); + bcopy(&dstport, &data[datalen], sizeof(dstport)); + datalen += sizeof(dstport); + return (rss_hash(datalen, data)); +} +#endif /* INET6 */ + +/* + * Query the number of RSS bits in use. + */ +u_int +rss_getbits(void) +{ + + return (rss_bits); +} + +/* + * Query the RSS bucket associated with an RSS hash. + */ +u_int +rss_getbucket(u_int hash) +{ + + return (hash & rss_mask); +} + +/* + * Query the RSS CPU associated with an RSS bucket. + */ +u_int +rss_getcpu(u_int bucket) +{ + + return (rss_table[bucket].rte_cpu); +} + +/* + * netisr CPU affinity lookup routine for use by protocols. + */ +struct mbuf * +rss_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid) +{ + + M_ASSERTPKTHDR(m); + + switch (M_HASHTYPE_GET(m)) { + case M_HASHTYPE_RSS_IPV4: + case M_HASHTYPE_RSS_TCP_IPV4: + *cpuid = rss_getcpu(rss_getbucket(m->m_pkthdr.flowid)); + return (m); + + default: + *cpuid = NETISR_CPUID_NONE; + return (m); + } +} + +/* + * Query the RSS hash algorithm. + */ +u_int +rss_gethashalgo(void) +{ + + return (rss_hashalgo); +} + +/* + * Query the current RSS key; likely to be used by device drivers when + * configuring hardware RSS. Caller must pass an array of size RSS_KEYSIZE. + * + * XXXRW: Perhaps we should do the accept-a-length-and-truncate thing? + */ +void +rss_getkey(uint8_t *key) +{ + + bcopy(rss_key, key, sizeof(rss_key)); +} + +/* + * Query the number of buckets; this may be used by both network device + * drivers, which will need to populate hardware shadows of the software + * indirection table, and the network stack itself (such as when deciding how + * many connection groups to allocate). + */ +u_int +rss_getnumbuckets(void) +{ + + return (rss_buckets); +} + +/* + * Query the number of CPUs in use by RSS; may be useful to device drivers + * trying to figure out how to map a larger number of CPUs into a smaller + * number of receive queues. + */ +u_int +rss_getnumcpus(void) +{ + + return (rss_ncpus); +} + +/* + * XXXRW: Confirm that sysctl -a won't dump this keying material, don't want + * it appearing in debugging output unnecessarily. + */ +static int +sysctl_rss_key(SYSCTL_HANDLER_ARGS) +{ + uint8_t temp_rss_key[RSS_KEYSIZE]; + int error; + + error = priv_check(req->td, PRIV_NETINET_HASHKEY); + if (error) + return (error); + + bcopy(rss_key, temp_rss_key, sizeof(temp_rss_key)); + error = sysctl_handle_opaque(oidp, temp_rss_key, + sizeof(temp_rss_key), req); + if (error) + return (error); + if (req->newptr != NULL) { + /* XXXRW: Not yet. */ + return (EINVAL); + } + return (0); +} +SYSCTL_PROC(_net_inet_rss, OID_AUTO, key, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_rss_key, + "", "RSS keying material"); Added: head/sys/netinet/in_rss.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/in_rss.h Sat Mar 15 00:57:50 2014 (r263198) @@ -0,0 +1,94 @@ +/*- + * Copyright (c) 2010-2011 Juniper Networks, Inc. + * All rights reserved. + * + * This software was developed by Robert N. M. Watson under contract + * to Juniper Networks, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NETINET_IN_RSS_H_ +#define _NETINET_IN_RSS_H_ + +#include /* in_addr_t */ + +/* + * Supported RSS hash functions. + */ +#define RSS_HASH_NAIVE 0x00000001 /* Poor but fast hash. */ +#define RSS_HASH_TOEPLITZ 0x00000002 /* Required by RSS. */ +#define RSS_HASH_CRC32 0x00000004 /* Future; some NICs do it. */ + +#define RSS_HASH_MASK (RSS_HASH_NAIVE | RSS_HASH_TOEPLITZ) + +/* + * Instances of struct inpcbinfo declare an RSS hash type indicating what + * header fields are covered. + */ +#define RSS_HASHFIELDS_NONE 0 +#define RSS_HASHFIELDS_4TUPLE 1 +#define RSS_HASHFIELDS_2TUPLE 2 + +/* + * Compile-time limits on the size of the indirection table. + */ +#define RSS_MAXBITS 7 +#define RSS_TABLE_MAXLEN (1 << RSS_MAXBITS) + +/* + * Maximum key size used throughout. It's OK for hardware to use only the + * first 16 bytes, which is all that's required for IPv4. + */ +#define RSS_KEYSIZE 40 + +/* + * Device driver interfaces to query RSS properties that must be programmed + * into hardware. + */ +u_int rss_getbits(void); +u_int rss_getbucket(u_int hash); +u_int rss_getcpu(u_int bucket); +void rss_getkey(uint8_t *key); +u_int rss_gethashalgo(void); +u_int rss_getnumbuckets(void); +u_int rss_getnumcpus(void); + +/* + * Network stack interface to generate a hash for a protocol tuple. + */ +uint32_t rss_hash_ip4_4tuple(struct in_addr src, u_short srcport, + struct in_addr dst, u_short dstport); +uint32_t rss_hash_ip4_2tuple(struct in_addr src, struct in_addr dst); +uint32_t rss_hash_ip6_4tuple(struct in6_addr src, u_short srcport, + struct in6_addr dst, u_short dstport); +uint32_t rss_hash_ip6_2tuple(struct in6_addr src, + struct in6_addr dst); + +/* + * Network stack interface to query desired CPU affinity of a packet. + */ +struct mbuf *rss_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid); + +#endif /* !_NETINET_IN_RSS_H_ */ Added: head/sys/netinet/toeplitz.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/toeplitz.c Sat Mar 15 00:57:50 2014 (r263198) @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2010 David Malone + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include + +#include + +uint32_t +toeplitz_hash(u_int keylen, const uint8_t *key, u_int datalen, + const uint8_t *data) +{ + uint32_t hash = 0, v; + u_int i, b; + + /* XXXRW: Perhaps an assertion about key length vs. data length? */ + + v = (key[0]<<24) + (key[1]<<16) + (key[2] <<8) + key[3]; + for (i = 0; i < datalen; i++) { + for (b = 0; b < 8; b++) { + if (data[i] & (1<<(7-b))) + hash ^= v; + v <<= 1; + if ((i + 4) < RSS_KEYSIZE && + (key[i+4] & (1<<(7-b)))) + v |= 1; + } + } + return (hash); +} Added: head/sys/netinet/toeplitz.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Mar 15 00:58:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CAC569B; Sat, 15 Mar 2014 00:58:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1999F32F; Sat, 15 Mar 2014 00:58:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2F0w89t081709; Sat, 15 Mar 2014 00:58:08 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2F0w84n081708; Sat, 15 Mar 2014 00:58:08 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403150058.s2F0w84n081708@svn.freebsd.org> From: Warner Losh Date: Sat, 15 Mar 2014 00:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263199 - head/usr.bin/dtc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 00:58:09 -0000 Author: imp Date: Sat Mar 15 00:58:08 2014 New Revision: 263199 URL: http://svnweb.freebsd.org/changeset/base/263199 Log: Fix cut-and-paste error message. Modified: head/usr.bin/dtc/fdt.cc Modified: head/usr.bin/dtc/fdt.cc ============================================================================== --- head/usr.bin/dtc/fdt.cc Sat Mar 15 00:57:50 2014 (r263198) +++ head/usr.bin/dtc/fdt.cc Sat Mar 15 00:58:08 2014 (r263199) @@ -1379,7 +1379,7 @@ device_tree::parse_dts(const char *fn, F (input.next_token(), input.consume_integer(len)))) { - input.parse_error("Expected /dts-v1/; version string"); + input.parse_error("Expected size on /memreserve/ node."); } input.next_token(); input.consume(';'); From owner-svn-src-head@FreeBSD.ORG Sat Mar 15 00:59:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D56B4818; Sat, 15 Mar 2014 00:59:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C26B0341; Sat, 15 Mar 2014 00:59:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2F0xNUX081872; Sat, 15 Mar 2014 00:59:23 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2F0xNpt081871; Sat, 15 Mar 2014 00:59:23 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201403150059.s2F0xNpt081871@svn.freebsd.org> From: Robert Watson Date: Sat, 15 Mar 2014 00:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263200 - head/sys/amd64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 00:59:23 -0000 Author: rwatson Date: Sat Mar 15 00:59:23 2014 New Revision: 263200 URL: http://svnweb.freebsd.org/changeset/base/263200 Log: Revert a small portion of r263198 left over from local testing: don't enable PCB groups and RSS by default [yet]. Modified: head/sys/amd64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sat Mar 15 00:58:08 2014 (r263199) +++ head/sys/amd64/conf/GENERIC Sat Mar 15 00:59:23 2014 (r263200) @@ -28,8 +28,6 @@ options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols -options PCBGROUP # Protocol control-block groups -options RSS # Receive-side scaling support options TCP_OFFLOAD # TCP offload options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem From owner-svn-src-head@FreeBSD.ORG Sat Mar 15 01:20:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C75BC72; Sat, 15 Mar 2014 01:20:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C5927B0; Sat, 15 Mar 2014 01:20:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2F1Kjq9092409; Sat, 15 Mar 2014 01:20:45 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2F1KhQS091135; Sat, 15 Mar 2014 01:20:43 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403150120.s2F1KhQS091135@svn.freebsd.org> From: Eitan Adler Date: Sat, 15 Mar 2014 01:20:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263201 - head/usr.bin/csup X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 01:20:45 -0000 Author: eadler Date: Sat Mar 15 01:20:42 2014 New Revision: 263201 URL: http://svnweb.freebsd.org/changeset/base/263201 Log: Use the system queue.h instead of bundling its own. PR: bin/187067 Submitted by: lulf Deleted: head/usr.bin/csup/queue.h Modified: head/usr.bin/csup/config.h head/usr.bin/csup/diff.c head/usr.bin/csup/fixups.c head/usr.bin/csup/fixups.h head/usr.bin/csup/keyword.c head/usr.bin/csup/proto.c head/usr.bin/csup/rcsfile.c head/usr.bin/csup/rcsparse.c head/usr.bin/csup/status.c head/usr.bin/csup/threads.c Modified: head/usr.bin/csup/config.h ============================================================================== --- head/usr.bin/csup/config.h Sat Mar 15 00:59:23 2014 (r263200) +++ head/usr.bin/csup/config.h Sat Mar 15 01:20:42 2014 (r263201) @@ -30,11 +30,11 @@ #include #include +#include #include #include "fattr.h" -#include "queue.h" #include "misc.h" /* Modified: head/usr.bin/csup/diff.c ============================================================================== --- head/usr.bin/csup/diff.c Sat Mar 15 00:59:23 2014 (r263200) +++ head/usr.bin/csup/diff.c Sat Mar 15 01:20:42 2014 (r263201) @@ -26,6 +26,8 @@ * $FreeBSD$ */ +#include + #include #include #include @@ -38,7 +40,6 @@ #include "keyword.h" #include "misc.h" #include "stream.h" -#include "queue.h" typedef long lineno_t; Modified: head/usr.bin/csup/fixups.c ============================================================================== --- head/usr.bin/csup/fixups.c Sat Mar 15 00:59:23 2014 (r263200) +++ head/usr.bin/csup/fixups.c Sat Mar 15 01:20:42 2014 (r263201) @@ -26,6 +26,8 @@ * $FreeBSD$ */ +#include + #include #include #include @@ -33,7 +35,6 @@ #include "fixups.h" #include "misc.h" -#include "queue.h" /* * A synchronized queue to implement fixups. The updater thread adds Modified: head/usr.bin/csup/fixups.h ============================================================================== --- head/usr.bin/csup/fixups.h Sat Mar 15 00:59:23 2014 (r263200) +++ head/usr.bin/csup/fixups.h Sat Mar 15 01:20:42 2014 (r263201) @@ -28,7 +28,7 @@ #ifndef _FIXUPS_H_ #define _FIXUPS_H_ -#include "queue.h" +#include struct coll; struct fixups; Modified: head/usr.bin/csup/keyword.c ============================================================================== --- head/usr.bin/csup/keyword.c Sat Mar 15 00:59:23 2014 (r263200) +++ head/usr.bin/csup/keyword.c Sat Mar 15 01:20:42 2014 (r263201) @@ -26,6 +26,8 @@ * $FreeBSD$ */ +#include + #include #include #include @@ -37,7 +39,6 @@ #include "diff.h" #include "keyword.h" #include "misc.h" -#include "queue.h" #include "stream.h" /* Modified: head/usr.bin/csup/proto.c ============================================================================== --- head/usr.bin/csup/proto.c Sat Mar 15 00:59:23 2014 (r263200) +++ head/usr.bin/csup/proto.c Sat Mar 15 01:20:42 2014 (r263201) @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -57,7 +58,6 @@ #include "misc.h" #include "mux.h" #include "proto.h" -#include "queue.h" #include "stream.h" #include "threads.h" #include "updater.h" Modified: head/usr.bin/csup/rcsfile.c ============================================================================== --- head/usr.bin/csup/rcsfile.c Sat Mar 15 00:59:23 2014 (r263200) +++ head/usr.bin/csup/rcsfile.c Sat Mar 15 01:20:42 2014 (r263201) @@ -26,6 +26,8 @@ * $FreeBSD$ */ +#include + #include #include #include @@ -37,7 +39,6 @@ #include "keyword.h" #include "misc.h" #include "proto.h" -#include "queue.h" #include "rcsfile.h" #include "rcsparse.h" #include "stream.h" Modified: head/usr.bin/csup/rcsparse.c ============================================================================== --- head/usr.bin/csup/rcsparse.c Sat Mar 15 00:59:23 2014 (r263200) +++ head/usr.bin/csup/rcsparse.c Sat Mar 15 01:20:42 2014 (r263201) @@ -26,12 +26,13 @@ * $FreeBSD$ */ +#include + #include #include #include #include "misc.h" -#include "queue.h" #include "rcsfile.h" #include "rcsparse.h" #include "rcstokenizer.h" Modified: head/usr.bin/csup/status.c ============================================================================== --- head/usr.bin/csup/status.c Sat Mar 15 00:59:23 2014 (r263200) +++ head/usr.bin/csup/status.c Sat Mar 15 01:20:42 2014 (r263201) @@ -26,6 +26,8 @@ * $FreeBSD$ */ +#include + #include #include #include @@ -39,7 +41,6 @@ #include "misc.h" #include "pathcomp.h" #include "proto.h" -#include "queue.h" #include "status.h" #include "stream.h" Modified: head/usr.bin/csup/threads.c ============================================================================== --- head/usr.bin/csup/threads.c Sat Mar 15 00:59:23 2014 (r263200) +++ head/usr.bin/csup/threads.c Sat Mar 15 01:20:42 2014 (r263201) @@ -26,13 +26,14 @@ * $FreeBSD$ */ +#include + #include #include #include #include #include "misc.h" -#include "queue.h" #include "threads.h" /* From owner-svn-src-head@FreeBSD.ORG Sat Mar 15 02:26:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0EDA5341; Sat, 15 Mar 2014 02:26:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F03EBD71; Sat, 15 Mar 2014 02:26:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2F2QkUH019671; Sat, 15 Mar 2014 02:26:46 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2F2Qkf0019670; Sat, 15 Mar 2014 02:26:46 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403150226.s2F2Qkf0019670@svn.freebsd.org> From: Eitan Adler Date: Sat, 15 Mar 2014 02:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263202 - head/usr.sbin/service X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 02:26:47 -0000 Author: eadler Date: Sat Mar 15 02:26:46 2014 New Revision: 263202 URL: http://svnweb.freebsd.org/changeset/base/263202 Log: Be a little more verbose in service's error message PR: bin/187118 Submitted by: culot Modified: head/usr.sbin/service/service.sh Modified: head/usr.sbin/service/service.sh ============================================================================== --- head/usr.sbin/service/service.sh Sat Mar 15 01:20:42 2014 (r263201) +++ head/usr.sbin/service/service.sh Sat Mar 15 02:26:46 2014 (r263202) @@ -145,5 +145,5 @@ done # If the script was not found echo "$script does not exist in /etc/rc.d or the local startup" -echo "directories (${local_startup})" +echo "directories (${local_startup}), or is not executable" exit 1 From owner-svn-src-head@FreeBSD.ORG Sat Mar 15 04:47:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FF65FFB; Sat, 15 Mar 2014 04:47:34 +0000 (UTC) Received: from mail-qc0-x22e.google.com (mail-qc0-x22e.google.com [IPv6:2607:f8b0:400d:c01::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7AA8EBD0; Sat, 15 Mar 2014 04:47:33 +0000 (UTC) Received: by mail-qc0-f174.google.com with SMTP id x13so3895637qcv.33 for ; Fri, 14 Mar 2014 21:47:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=95IrPvZf+ETGVC10e7+90se19SS8biiGJRNFmUU7DLc=; b=Y/mX0uc+8/1gt7mB0DWSDCeZ9OFcgt8ym2P+aWpIJ5WzLZkUnxYrv3k9ykQ2FLtef5 UzN2RSG1pxZ9JR8du4r4XIF8ljbjjTCBrv1mqlWKdGwRKmNwJt3QnR0Q8ZWOSy10fHm7 NTtBxo+b1EdsC0VxzH/+V/7+civzTGVeo2y18OEmPXiHD5ix9rkEHL0yARshefOzmAlj oFzUgDG/AoDhzYYiSRMry+KlaDeeLGhtNncKm0NR3KGN59/Xedy0u3dadMuy3Rjw9NNM JI60Df45L9TZkCDZIpTTdO59MIlC87qTpME6M6Gp/hUD5Fxkjv96fUjM7vIJfadknl9l mYdQ== MIME-Version: 1.0 X-Received: by 10.140.43.10 with SMTP id d10mr13641702qga.45.1394858852610; Fri, 14 Mar 2014 21:47:32 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.8.137 with HTTP; Fri, 14 Mar 2014 21:47:32 -0700 (PDT) Received: by 10.224.8.137 with HTTP; Fri, 14 Mar 2014 21:47:32 -0700 (PDT) In-Reply-To: <201403150057.s2F0vofg081606@svn.freebsd.org> References: <201403150057.s2F0vofg081606@svn.freebsd.org> Date: Fri, 14 Mar 2014 21:47:32 -0700 X-Google-Sender-Auth: 0Rk47CHD4RtOfbbkJvum_zCxmlU Message-ID: Subject: Re: svn commit: r263198 - in head/sys: amd64/conf conf net netinet netinet6 sys From: Adrian Chadd To: Robert Watson Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 04:47:34 -0000 Woo! Thanks! Adrian On Mar 14, 2014 5:57 PM, "Robert Watson" wrote: > Author: rwatson > Date: Sat Mar 15 00:57:50 2014 > New Revision: 263198 > URL: http://svnweb.freebsd.org/changeset/base/263198 > > Log: > Several years after initial development, merge prototype support for > linking NIC Receive Side Scaling (RSS) to the network stack's > connection-group implementation. This prototype (and derived patches) > are in use at Juniper and several other FreeBSD-using companies, so > despite some reservations about its maturity, merge the patch to the > base tree so that it can be iteratively refined in collaboration rather > than maintained as a set of gradually diverging patch sets. > > (1) Merge a software implementation of the Toeplitz hash specified in > RSS implemented by David Malone. This is used to allow suitable > pcbgroup placement of connections before the first packet is > received from the NIC. Software hashing is generally avoided, > however, due to high cost of the hash on general-purpose CPUs. > > (2) In in_rss.c, maintain authoritative versions of RSS state intended > to be pushed to each NIC, including keying material, hash > algorithm/ configuration, and buckets. Provide software-facing > interfaces to hash 2- and 4-tuples for IPv4 and IPv6 using both > the RSS standardised Toeplitz and a 'naive' variation with a hash > efficient in software but with poor distribution properties. > Implement rss_m2cpuid()to be used by netisr and other load > balancing code to look up the CPU on which an mbuf should be > processed. > > (3) In the Ethernet link layer, allow netisr distribution using RSS as > a source of policy as an alternative to source ordering; continue > to default to direct dispatch (i.e., don't try and requeue packets > for processing on the 'right' CPU if they arrive in a directly > dispatchable context). > > (4) Allow RSS to control tuning of connection groups in order to align > groups with RSS buckets. If a packet arrives on a protocol using > connection groups, and contains a suitable hardware-generated > hash, use that hash value to select the connection group for pcb > lookup for both IPv4 and IPv6. If no hardware-generated Toeplitz > hash is available, we fall back on regular PCB lookup risking > contention rather than pay the cost of Toeplitz in software -- > this is a less scalable but, at my last measurement, faster > approach. As core counts go up, we may want to revise this > strategy despite CPU overhead. > > Where device drivers suitably configure NICs, and connection groups / > RSS are enabled, this should avoid both lock and line contention during > connection lookup for TCP. This commit does not modify any device > drivers to tune device RSS configuration to the global RSS > configuration; patches are in circulation to do this for at least > Chelsio T3 and Intel 1G/10G drivers. Currently, the KPI for device > drivers is not particularly robust, nor aware of more advanced features > such as runtime reconfiguration/rebalancing. This will hopefully prove > a useful starting point for refinement. > > No MFC is scheduled as we will first want to nail down a more mature > and maintainable KPI/KBI for device drivers. > > Sponsored by: Juniper Networks (original work) > Sponsored by: EMC/Isilon (patch update and merge) > > Added: > head/sys/netinet/in_rss.c (contents, props changed) > head/sys/netinet/in_rss.h (contents, props changed) > head/sys/netinet/toeplitz.c (contents, props changed) > head/sys/netinet/toeplitz.h (contents, props changed) > Modified: > head/sys/amd64/conf/GENERIC > head/sys/conf/files > head/sys/conf/options > head/sys/net/if_ethersubr.c > head/sys/netinet/in_pcb.c > head/sys/netinet/in_pcbgroup.c > head/sys/netinet6/in6_pcb.c > head/sys/netinet6/in6_pcbgroup.c > head/sys/sys/priv.h > > Modified: head/sys/amd64/conf/GENERIC > > ============================================================================== > --- head/sys/amd64/conf/GENERIC Sat Mar 15 00:23:35 2014 (r263197) > +++ head/sys/amd64/conf/GENERIC Sat Mar 15 00:57:50 2014 (r263198) > @@ -28,6 +28,8 @@ options SCHED_ULE # ULE scheduler > options PREEMPTION # Enable kernel thread preemption > options INET # InterNETworking > options INET6 # IPv6 communications protocols > +options PCBGROUP # Protocol control-block groups > +options RSS # Receive-side scaling support > options TCP_OFFLOAD # TCP offload > options SCTP # Stream Control Transmission > Protocol > options FFS # Berkeley Fast Filesystem > > Modified: head/sys/conf/files > > ============================================================================== > --- head/sys/conf/files Sat Mar 15 00:23:35 2014 (r263197) > +++ head/sys/conf/files Sat Mar 15 00:57:50 2014 (r263198) > @@ -3267,6 +3267,7 @@ netinet/in_pcb.c optional inet | inet6 > netinet/in_pcbgroup.c optional inet pcbgroup | inet6 pcbgroup > netinet/in_proto.c optional inet | inet6 > netinet/in_rmx.c optional inet > +netinet/in_rss.c optional inet rss | inet6 rss > netinet/ip_divert.c optional inet ipdivert ipfirewall > netinet/ip_ecn.c optional inet | inet6 > netinet/ip_encap.c optional inet | inet6 > @@ -3308,6 +3309,7 @@ netinet/tcp_syncache.c optional inet | > netinet/tcp_timer.c optional inet | inet6 > netinet/tcp_timewait.c optional inet | inet6 > netinet/tcp_usrreq.c optional inet | inet6 > +netinet/toeplitz.c optional inet rss | inet6 rss > netinet/udp_usrreq.c optional inet | inet6 > netinet/libalias/alias.c optional libalias inet | netgraph_nat inet > netinet/libalias/alias_db.c optional libalias inet | netgraph_nat inet > > Modified: head/sys/conf/options > > ============================================================================== > --- head/sys/conf/options Sat Mar 15 00:23:35 2014 (r263197) > +++ head/sys/conf/options Sat Mar 15 00:57:50 2014 (r263198) > @@ -427,6 +427,7 @@ PCBGROUP opt_pcbgroup.h > PF_DEFAULT_TO_DROP opt_pf.h > RADIX_MPATH opt_mpath.h > ROUTETABLES opt_route.h > +RSS opt_rss.h > SLIP_IFF_OPTS opt_slip.h > TCPDEBUG > TCP_OFFLOAD opt_inet.h # Enable code to dispatch TCP offloading > > Modified: head/sys/net/if_ethersubr.c > > ============================================================================== > --- head/sys/net/if_ethersubr.c Sat Mar 15 00:23:35 2014 (r263197) > +++ head/sys/net/if_ethersubr.c Sat Mar 15 00:57:50 2014 (r263198) > @@ -34,6 +34,7 @@ > #include "opt_inet6.h" > #include "opt_netgraph.h" > #include "opt_mbuf_profiling.h" > +#include "opt_rss.h" > > #include > #include > @@ -70,6 +71,7 @@ > #include > #include > #include > +#include > #include > #include > #endif > @@ -583,7 +585,22 @@ ether_input_internal(struct ifnet *ifp, > > /* > * Ethernet input dispatch; by default, direct dispatch here regardless of > - * global configuration. > + * global configuration. However, if RSS is enabled, hook up RSS affinity > + * so that when deferred or hybrid dispatch is enabled, we can > redistribute > + * load based on RSS. > + * > + * XXXRW: Would be nice if the ifnet passed up a flag indicating whether > or > + * not it had already done work distribution via multi-queue. Then we > could > + * direct dispatch in the event load balancing was already complete and > + * handle the case of interfaces with different capabilities better. > + * > + * XXXRW: Sort of want an M_DISTRIBUTED flag to avoid multiple > distributions > + * at multiple layers? > + * > + * XXXRW: For now, enable all this only if RSS is compiled in, although it > + * works fine without RSS. Need to characterise the performance overhead > + * of the detour through the netisr code in the event the result is always > + * direct dispatch. > */ > static void > ether_nh_input(struct mbuf *m) > @@ -596,8 +613,14 @@ static struct netisr_handler ether_nh = > .nh_name = "ether", > .nh_handler = ether_nh_input, > .nh_proto = NETISR_ETHER, > +#ifdef RSS > + .nh_policy = NETISR_POLICY_CPU, > + .nh_dispatch = NETISR_DISPATCH_DIRECT, > + .nh_m2cpuid = rss_m2cpuid, > +#else > .nh_policy = NETISR_POLICY_SOURCE, > .nh_dispatch = NETISR_DISPATCH_DIRECT, > +#endif > }; > > static void > > Modified: head/sys/netinet/in_pcb.c > > ============================================================================== > --- head/sys/netinet/in_pcb.c Sat Mar 15 00:23:35 2014 (r263197) > +++ head/sys/netinet/in_pcb.c Sat Mar 15 00:57:50 2014 (r263198) > @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); > #include "opt_inet.h" > #include "opt_inet6.h" > #include "opt_pcbgroup.h" > +#include "opt_rss.h" > > #include > #include > @@ -75,6 +76,7 @@ __FBSDID("$FreeBSD$"); > #if defined(INET) || defined(INET6) > #include > #include > +#include > #include > #include > #include > @@ -1820,7 +1822,7 @@ struct inpcb * > in_pcblookup(struct inpcbinfo *pcbinfo, struct in_addr faddr, u_int fport, > struct in_addr laddr, u_int lport, int lookupflags, struct ifnet *ifp) > { > -#if defined(PCBGROUP) > +#if defined(PCBGROUP) && !defined(RSS) > struct inpcbgroup *pcbgroup; > #endif > > @@ -1829,7 +1831,17 @@ in_pcblookup(struct inpcbinfo *pcbinfo, > KASSERT((lookupflags & (INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB)) > != 0, > ("%s: LOCKPCB not set", __func__)); > > -#if defined(PCBGROUP) > + /* > + * When not using RSS, use connection groups in preference to the > + * reservation table when looking up 4-tuples. When using RSS, > just > + * use the reservation table, due to the cost of the Toeplitz hash > + * in software. > + * > + * XXXRW: This policy belongs in the pcbgroup code, as in principle > + * we could be doing RSS with a non-Toeplitz hash that is > affordable > + * in software. > + */ > +#if defined(PCBGROUP) && !defined(RSS) > if (in_pcbgroup_enabled(pcbinfo)) { > pcbgroup = in_pcbgroup_bytuple(pcbinfo, laddr, lport, > faddr, > fport); > @@ -1856,16 +1868,27 @@ in_pcblookup_mbuf(struct inpcbinfo *pcbi > ("%s: LOCKPCB not set", __func__)); > > #ifdef PCBGROUP > - if (in_pcbgroup_enabled(pcbinfo)) { > + /* > + * If we can use a hardware-generated hash to look up the > connection > + * group, use that connection group to find the inpcb. Otherwise > + * fall back on a software hash -- or the reservation table if > we're > + * using RSS. > + * > + * XXXRW: As above, that policy belongs in the pcbgroup code. > + */ > + if (in_pcbgroup_enabled(pcbinfo) && > + !(M_HASHTYPE_TEST(m, M_HASHTYPE_NONE))) { > pcbgroup = in_pcbgroup_byhash(pcbinfo, M_HASHTYPE_GET(m), > m->m_pkthdr.flowid); > if (pcbgroup != NULL) > return (in_pcblookup_group(pcbinfo, pcbgroup, > faddr, > fport, laddr, lport, lookupflags, ifp)); > +#ifndef RSS > pcbgroup = in_pcbgroup_bytuple(pcbinfo, laddr, lport, > faddr, > fport); > return (in_pcblookup_group(pcbinfo, pcbgroup, faddr, fport, > laddr, lport, lookupflags, ifp)); > +#endif > } > #endif > return (in_pcblookup_hash(pcbinfo, faddr, fport, laddr, lport, > > Modified: head/sys/netinet/in_pcbgroup.c > > ============================================================================== > --- head/sys/netinet/in_pcbgroup.c Sat Mar 15 00:23:35 2014 > (r263197) > +++ head/sys/netinet/in_pcbgroup.c Sat Mar 15 00:57:50 2014 > (r263198) > @@ -32,6 +32,7 @@ > __FBSDID("$FreeBSD$"); > > #include "opt_inet6.h" > +#include "opt_rss.h" > > #include > #include > @@ -43,6 +44,7 @@ __FBSDID("$FreeBSD$"); > > #include > #include > +#include > #ifdef INET6 > #include > #endif /* INET6 */ > @@ -60,6 +62,13 @@ __FBSDID("$FreeBSD$"); > * minimal cache line migration and lock contention during steady state > * operation. > * > + * Hardware-offloaded checksums are often inefficient in software -- for > + * example, Toeplitz, specified by RSS, introduced a significant overhead > if > + * performed during per-packge processing. It is therefore desirable to > fall > + * back on traditional reservation table lookups without affinity where > + * hardware-offloaded checksums aren't available, such as for traffic over > + * non-RSS interfaces. > + * > * Internet protocols, such as UDP and TCP, register to use connection > groups > * by providing an ipi_hashfields value other than IPI_HASHFIELDS_NONE; > this > * indicates to the connection group code whether a 2-tuple or 4-tuple is > @@ -72,6 +81,11 @@ __FBSDID("$FreeBSD$"); > * signficantly more expensive than without connection groups, but that > * steady-state processing can be significantly faster. > * > + * When RSS is used, certain connection group parameters, such as the > number > + * of groups, are provided by the RSS implementation, found in in_rss.c. > + * Otherwise, in_pcbgroup.c selects possible sensible parameters > + * corresponding to the degree of parallelism exposed by netisr. > + * > * Most of the implementation of connection groups is in this file; > however, > * connection group lookup is implemented in in_pcb.c alongside > reservation > * table lookups -- see in_pcblookup_group(). > @@ -126,11 +140,25 @@ in_pcbgroup_init(struct inpcbinfo *pcbin > if (mp_ncpus == 1) > return; > > +#ifdef RSS > /* > - * Use one group per CPU for now. If we decide to do dynamic > - * rebalancing a la RSS, we'll need to shift left by at least 1. > + * If we're using RSS, then RSS determines the number of connection > + * groups to use: one connection group per RSS bucket. If for some > + * reason RSS isn't able to provide a number of buckets, disable > + * connection groups entirely. > + * > + * XXXRW: Can this ever happen? > + */ > + numpcbgroups = rss_getnumbuckets(); > + if (numpcbgroups == 0) > + return; > +#else > + /* > + * Otherwise, we'll just use one per CPU for now. If we decide to > + * do dynamic rebalancing a la RSS, we'll need similar logic here. > */ > numpcbgroups = mp_ncpus; > +#endif > > pcbinfo->ipi_hashfields = hashfields; > pcbinfo->ipi_pcbgroups = malloc(numpcbgroups * > @@ -146,10 +174,19 @@ in_pcbgroup_init(struct inpcbinfo *pcbin > > /* > * Initialise notional affinity of the pcbgroup -- for RSS, > - * we want the same notion of affinity as NICs to be used. > - * Just round robin for the time being. > + * we want the same notion of affinity as NICs to be used. > In > + * the non-RSS case, just round robin for the time being. > + * > + * XXXRW: The notion of a bucket to CPU mapping is common > at > + * both pcbgroup and RSS layers -- does that mean that we > + * should migrate it all from RSS to here, and just leave > RSS > + * responsible only for providing hashing and mapping > funtions? > */ > +#ifdef RSS > + pcbgroup->ipg_cpu = rss_getcpu(pgn); > +#else > pcbgroup->ipg_cpu = (pgn % mp_ncpus); > +#endif > } > } > > @@ -179,23 +216,38 @@ in_pcbgroup_destroy(struct inpcbinfo *pc > > /* > * Given a hash of whatever the covered tuple might be, return a pcbgroup > - * index. > + * index. Where RSS is supported, try to align bucket selection with RSS > CPU > + * affinity strategy. > */ > static __inline u_int > in_pcbgroup_getbucket(struct inpcbinfo *pcbinfo, uint32_t hash) > { > > +#ifdef RSS > + return (rss_getbucket(hash)); > +#else > return (hash % pcbinfo->ipi_npcbgroups); > +#endif > } > > /* > * Map a (hashtype, hash) tuple into a connection group, or NULL if the > hash > - * information is insufficient to identify the pcbgroup. > + * information is insufficient to identify the pcbgroup. This might > occur if > + * a TCP packet turns up with a 2-tuple hash, or if an RSS hash is > present but > + * RSS is not compiled into the kernel. > */ > struct inpcbgroup * > in_pcbgroup_byhash(struct inpcbinfo *pcbinfo, u_int hashtype, uint32_t > hash) > { > > +#ifdef RSS > + if ((pcbinfo->ipi_hashfields == IPI_HASHFIELDS_4TUPLE && > + hashtype == M_HASHTYPE_RSS_TCP_IPV4) || > + (pcbinfo->ipi_hashfields == IPI_HASHFIELDS_2TUPLE && > + hashtype == M_HASHTYPE_RSS_IPV4)) > + return (&pcbinfo->ipi_pcbgroups[ > + in_pcbgroup_getbucket(pcbinfo, hash)]); > +#endif > return (NULL); > } > > @@ -213,13 +265,26 @@ in_pcbgroup_bytuple(struct inpcbinfo *pc > { > uint32_t hash; > > + /* > + * RSS note: we pass foreign addr/port as source, and local > addr/port > + * as destination, as we want to align with what the hardware is > + * doing. > + */ > switch (pcbinfo->ipi_hashfields) { > case IPI_HASHFIELDS_4TUPLE: > +#ifdef RSS > + hash = rss_hash_ip4_4tuple(faddr, fport, laddr, lport); > +#else > hash = faddr.s_addr ^ fport; > +#endif > break; > > case IPI_HASHFIELDS_2TUPLE: > +#ifdef RSS > + hash = rss_hash_ip4_2tuple(faddr, laddr); > +#else > hash = faddr.s_addr ^ laddr.s_addr; > +#endif > break; > > default: > > Added: head/sys/netinet/in_rss.c > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/netinet/in_rss.c Sat Mar 15 00:57:50 2014 (r263198) > @@ -0,0 +1,505 @@ > +/*- > + * Copyright (c) 2010-2011 Juniper Networks, Inc. > + * All rights reserved. > + * > + * This software was developed by Robert N. M. Watson under contract > + * to Juniper Networks, Inc. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > + > +__FBSDID("$FreeBSD$"); > + > +#include "opt_inet6.h" > +#include "opt_pcbgroup.h" > + > +#ifndef PCBGROUP > +#error "options RSS depends on options PCBGROUP" > +#endif > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > + > +/*- > + * Operating system parts of receiver-side scaling (RSS), which allows > + * network cards to direct flows to particular receive queues based on > hashes > + * of header tuples. This implementation aligns RSS buckets with > connection > + * groups at the TCP/IP layer, so each bucket is associated with exactly > one > + * group. As a result, the group lookup structures (and lock) should > have an > + * effective affinity with exactly one CPU. > + * > + * Network device drivers needing to configure RSS will query this > framework > + * for parameters, such as the current RSS key, hashing policies, number > of > + * bits, and indirection table mapping hashes to buckets and CPUs. They > may > + * provide their own supplementary information, such as queue<->CPU > bindings. > + * It is the responsibility of the network device driver to inject packets > + * into the stack on as close to the right CPU as possible, if playing by > RSS > + * rules. > + * > + * TODO: > + * > + * - Synchronization for rss_key and other future-configurable parameters. > + * - Event handler drivers can register to pick up RSS configuration > changes. > + * - Should we allow rss_basecpu to be configured? > + * - Randomize key on boot. > + * - IPv6 support. > + * - Statistics on how often there's a misalignment between hardware > + * placement and pcbgroup expectations. > + */ > + > +SYSCTL_NODE(_net_inet, OID_AUTO, rss, CTLFLAG_RW, 0, "Receive-side > steering"); > + > +/* > + * Toeplitz is the only required hash function in the RSS spec, so use it > by > + * default. > + */ > +static u_int rss_hashalgo = RSS_HASH_TOEPLITZ; > +SYSCTL_INT(_net_inet_rss, OID_AUTO, hashalgo, CTLFLAG_RD, &rss_hashalgo, > 0, > + "RSS hash algorithm"); > +TUNABLE_INT("net.inet.rss.hashalgo", &rss_hashalgo); > + > +/* > + * Size of the indirection table; at most 128 entries per the RSS spec. > We > + * size it to at least 2 times the number of CPUs by default to allow > useful > + * rebalancing. If not set explicitly with a loader tunable, we tune > based > + * on the number of CPUs present. > + * > + * XXXRW: buckets might be better to use for the tunable than bits. > + */ > +static u_int rss_bits; > +SYSCTL_INT(_net_inet_rss, OID_AUTO, bits, CTLFLAG_RD, &rss_bits, 0, > + "RSS bits"); > +TUNABLE_INT("net.inet.rss.bits", &rss_bits); > + > +static u_int rss_mask; > +SYSCTL_INT(_net_inet_rss, OID_AUTO, mask, CTLFLAG_RD, &rss_mask, 0, > + "RSS mask"); > + > +static const u_int rss_maxbits = RSS_MAXBITS; > +SYSCTL_INT(_net_inet_rss, OID_AUTO, maxbits, CTLFLAG_RD, > + __DECONST(int *, &rss_maxbits), 0, "RSS maximum bits"); > + > +/* > + * RSS's own count of the number of CPUs it could be using for processing. > + * Bounded to 64 by RSS constants. > + */ > +static u_int rss_ncpus; > +SYSCTL_INT(_net_inet_rss, OID_AUTO, ncpus, CTLFLAG_RD, &rss_ncpus, 0, > + "Number of CPUs available to RSS"); > + > +#define RSS_MAXCPUS (1 << (RSS_MAXBITS - 1)) > +static const u_int rss_maxcpus = RSS_MAXCPUS; > +SYSCTL_INT(_net_inet_rss, OID_AUTO, maxcpus, CTLFLAG_RD, > + __DECONST(int *, &rss_maxcpus), 0, "RSS maximum CPUs that can be > used"); > + > +/* > + * Variable exists just for reporting rss_bits in a user-friendly way. > + */ > +static u_int rss_buckets; > +SYSCTL_INT(_net_inet_rss, OID_AUTO, buckets, CTLFLAG_RD, &rss_buckets, 0, > + "RSS buckets"); > + > +/* > + * Base CPU number; devices will add this to all CPU numbers returned by > the > + * RSS indirection table. Currently unmodifable in FreeBSD. > + */ > +static const u_int rss_basecpu; > +SYSCTL_INT(_net_inet_rss, OID_AUTO, basecpu, CTLFLAG_RD, > + __DECONST(int *, &rss_basecpu), 0, "RSS base CPU"); > + > +/* > + * RSS secret key, intended to prevent attacks on load-balancing. Its > + * effectiveness may be limited by algorithm choice and available entropy > + * during the boot. > + * > + * XXXRW: And that we don't randomize it yet! > + * > + * XXXRW: This default is actually the default key from Chelsio T3 cards, > as > + * it offers reasonable distribution, unlike all-0 keys which always > + * generate a hash of 0 (upsettingly). > + */ > +static uint8_t rss_key[RSS_KEYSIZE] = { > + 0x43, 0xa3, 0x8f, 0xb0, 0x41, 0x67, 0x25, 0x3d, > + 0x25, 0x5b, 0x0e, 0xc2, 0x6d, 0x5a, 0x56, 0xda, > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > +}; > + > +/* > + * RSS hash->CPU table, which maps hashed packet headers to particular > CPUs. > + * Drivers may supplement this table with a seperate CPU<->queue table > when > + * programming devices. > + */ > +struct rss_table_entry { > + uint8_t rte_cpu; /* CPU affinity of bucket. */ > +}; > +static struct rss_table_entry rss_table[RSS_TABLE_MAXLEN]; > + > +static void > +rss_init(__unused void *arg) > +{ > + u_int i; > + > + /* > + * Validate tunables, coerce to sensible values. > + */ > + switch (rss_hashalgo) { > + case RSS_HASH_TOEPLITZ: > + case RSS_HASH_NAIVE: > + break; > + > + default: > + printf("%s: invalid RSS hashalgo %u, coercing to %u", > + __func__, rss_hashalgo, RSS_HASH_TOEPLITZ); > + rss_hashalgo = RSS_HASH_TOEPLITZ; > + } > + > + /* > + * Count available CPUs. > + * > + * XXXRW: Note incorrect assumptions regarding contiguity of this > set > + * elsewhere. > + */ > + rss_ncpus = 0; > + for (i = 0; i <= mp_maxid; i++) { > + if (CPU_ABSENT(i)) > + continue; > + rss_ncpus++; > + } > + if (rss_ncpus > RSS_MAXCPUS) > + rss_ncpus = RSS_MAXCPUS; > + > + /* > + * Tune RSS table entries to be no less than 2x the number of CPUs > + * -- unless we're running uniprocessor, in which case there's not > + * much point in having buckets to rearrange for load-balancing! > + */ > + if (rss_ncpus > 1) { > + if (rss_bits == 0) > + rss_bits = fls(rss_ncpus - 1) + 1; > + > + /* > + * Microsoft limits RSS table entries to 128, so apply that > + * limit to both auto-detected CPU counts and > user-configured > + * ones. > + */ > + if (rss_bits == 0 || rss_bits > RSS_MAXBITS) { > + printf("%s: RSS bits %u not valid, coercing to > %u", > + __func__, rss_bits, RSS_MAXBITS); > + rss_bits = RSS_MAXBITS; > + } > + > + /* > + * Figure out how many buckets to use; warn if less than > the > + * number of configured CPUs, although this is not a fatal > + * problem. > + */ > + rss_buckets = (1 << rss_bits); > + if (rss_buckets < rss_ncpus) > + printf("%s: WARNING: rss_buckets (%u) less than " > + "rss_ncpus (%u)\n", __func__, rss_buckets, > + rss_ncpus); > + rss_mask = rss_buckets - 1; > + } else { > + rss_bits = 0; > + rss_buckets = 1; > + rss_mask = 0; > + } > + > + /* > + * Set up initial CPU assignments: round-robin by default. > + * > + * XXXRW: Need a mapping to non-contiguous IDs here. > + */ > + for (i = 0; i < rss_buckets; i++) > + rss_table[i].rte_cpu = i % rss_ncpus; > + > + /* > + * Randomize rrs_key. > + * > + * XXXRW: Not yet. If nothing else, will require an rss_isbadkey() > + * loop to check for "bad" RSS keys. > + */ > +} > +SYSINIT(rss_init, SI_SUB_SOFTINTR, SI_ORDER_SECOND, rss_init, NULL); > + > +static uint32_t > +rss_naive_hash(u_int keylen, const uint8_t *key, u_int datalen, > + const uint8_t *data) > +{ > + uint32_t v; > + u_int i; > + > + v = 0; > + for (i = 0; i < keylen; i++) > + v += key[i]; > + for (i = 0; i < datalen; i++) > + v += data[i]; > + return (v); > +} > + > +static uint32_t > +rss_hash(u_int datalen, const uint8_t *data) > +{ > + > + switch (rss_hashalgo) { > + case RSS_HASH_TOEPLITZ: > + return (toeplitz_hash(sizeof(rss_key), rss_key, datalen, > + data)); > + > + case RSS_HASH_NAIVE: > + return (rss_naive_hash(sizeof(rss_key), rss_key, datalen, > + data)); > + > + default: > + panic("%s: unsupported/unknown hashalgo %d", __func__, > + rss_hashalgo); > + } > +} > + > +/* > + * Hash an IPv4 2-tuple. > + */ > +uint32_t > +rss_hash_ip4_2tuple(struct in_addr src, struct in_addr dst) > +{ > + uint8_t data[sizeof(src) + sizeof(dst)]; > + u_int datalen; > + > + datalen = 0; > + bcopy(&src, &data[datalen], sizeof(src)); > + datalen += sizeof(src); > + bcopy(&dst, &data[datalen], sizeof(dst)); > + datalen += sizeof(dst); > + return (rss_hash(datalen, data)); > +} > + > +/* > + * Hash an IPv4 4-tuple. > + */ > +uint32_t > +rss_hash_ip4_4tuple(struct in_addr src, u_short srcport, struct in_addr > dst, > + u_short dstport) > +{ > + uint8_t data[sizeof(src) + sizeof(dst) + sizeof(srcport) + > + sizeof(dstport)]; > + u_int datalen; > + > + datalen = 0; > + bcopy(&src, &data[datalen], sizeof(src)); > + datalen += sizeof(src); > + bcopy(&dst, &data[datalen], sizeof(dst)); > + datalen += sizeof(dst); > + bcopy(&srcport, &data[datalen], sizeof(srcport)); > + datalen += sizeof(srcport); > + bcopy(&dstport, &data[datalen], sizeof(dstport)); > + datalen += sizeof(dstport); > + return (rss_hash(datalen, data)); > +} > + > +#ifdef INET6 > +/* > + * Hash an IPv6 2-tuple. > + */ > +uint32_t > +rss_hash_ip6_2tuple(struct in6_addr src, struct in6_addr dst) > +{ > + uint8_t data[sizeof(src) + sizeof(dst)]; > + u_int datalen; > + > + datalen = 0; > + bcopy(&src, &data[datalen], sizeof(src)); > + datalen += sizeof(src); > + bcopy(&dst, &data[datalen], sizeof(dst)); > + datalen += sizeof(dst); > + return (rss_hash(datalen, data)); > +} > + > +/* > + * Hash an IPv6 4-tuple. > + */ > +uint32_t > +rss_hash_ip6_4tuple(struct in6_addr src, u_short srcport, > + struct in6_addr dst, u_short dstport) > +{ > + uint8_t data[sizeof(src) + sizeof(dst) + sizeof(srcport) + > + sizeof(dstport)]; > + u_int datalen; > + > + datalen = 0; > + bcopy(&src, &data[datalen], sizeof(src)); > + datalen += sizeof(src); > + bcopy(&dst, &data[datalen], sizeof(dst)); > + datalen += sizeof(dst); > + bcopy(&srcport, &data[datalen], sizeof(srcport)); > + datalen += sizeof(srcport); > + bcopy(&dstport, &data[datalen], sizeof(dstport)); > + datalen += sizeof(dstport); > + return (rss_hash(datalen, data)); > +} > +#endif /* INET6 */ > + > +/* > + * Query the number of RSS bits in use. > + */ > +u_int > +rss_getbits(void) > +{ > + > + return (rss_bits); > +} > + > +/* > + * Query the RSS bucket associated with an RSS hash. > + */ > +u_int > +rss_getbucket(u_int hash) > +{ > + > + return (hash & rss_mask); > +} > + > +/* > + * Query the RSS CPU associated with an RSS bucket. > + */ > +u_int > +rss_getcpu(u_int bucket) > +{ > + > + return (rss_table[bucket].rte_cpu); > +} > + > +/* > + * netisr CPU affinity lookup routine for use by protocols. > + */ > +struct mbuf * > +rss_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid) > +{ > + > + M_ASSERTPKTHDR(m); > + > + switch (M_HASHTYPE_GET(m)) { > + case M_HASHTYPE_RSS_IPV4: > + case M_HASHTYPE_RSS_TCP_IPV4: > + *cpuid = rss_getcpu(rss_getbucket(m->m_pkthdr.flowid)); > + return (m); > + > + default: > + *cpuid = NETISR_CPUID_NONE; > + return (m); > + } > +} > + > +/* > + * Query the RSS hash algorithm. > + */ > +u_int > +rss_gethashalgo(void) > +{ > + > + return (rss_hashalgo); > +} > + > +/* > + * Query the current RSS key; likely to be used by device drivers when > + * configuring hardware RSS. Caller must pass an array of size > RSS_KEYSIZE. > + * > + * XXXRW: Perhaps we should do the accept-a-length-and-truncate thing? > + */ > +void > +rss_getkey(uint8_t *key) > +{ > + > + bcopy(rss_key, key, sizeof(rss_key)); > +} > + > +/* > + * Query the number of buckets; this may be used by both network device > + * drivers, which will need to populate hardware shadows of the software > + * indirection table, and the network stack itself (such as when deciding > how > + * many connection groups to allocate). > + */ > +u_int > +rss_getnumbuckets(void) > +{ > + > + return (rss_buckets); > +} > + > +/* > + * Query the number of CPUs in use by RSS; may be useful to device drivers > + * trying to figure out how to map a larger number of CPUs into a smaller > + * number of receive queues. > + */ > +u_int > +rss_getnumcpus(void) > +{ > + > + return (rss_ncpus); > +} > + > +/* > + * XXXRW: Confirm that sysctl -a won't dump this keying material, don't > want > + * it appearing in debugging output unnecessarily. > + */ > +static int > +sysctl_rss_key(SYSCTL_HANDLER_ARGS) > +{ > + uint8_t temp_rss_key[RSS_KEYSIZE]; > + int error; > + > + error = priv_check(req->td, PRIV_NETINET_HASHKEY); > + if (error) > + return (error); > + > + bcopy(rss_key, temp_rss_key, sizeof(temp_rss_key)); > + error = sysctl_handle_opaque(oidp, temp_rss_key, > + sizeof(temp_rss_key), req); > + if (error) > + return (error); > + if (req->newptr != NULL) { > + /* XXXRW: Not yet. */ > + return (EINVAL); > + } > + return (0); > +} > +SYSCTL_PROC(_net_inet_rss, OID_AUTO, key, > + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_rss_key, > + "", "RSS keying material"); > > Added: head/sys/netinet/in_rss.h > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/netinet/in_rss.h Sat Mar 15 00:57:50 2014 (r263198) > @@ -0,0 +1,94 @@ > +/*- > + * Copyright (c) 2010-2011 Juniper Networks, Inc. > + * All rights reserved. > + * > + * This software was developed by Robert N. M. Watson under contract > + * to Juniper Networks, Inc. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef _NETINET_IN_RSS_H_ > +#define _NETINET_IN_RSS_H_ > + > +#include /* in_addr_t */ > + > +/* > + * Supported RSS hash functions. > + */ > +#define RSS_HASH_NAIVE 0x00000001 /* Poor but fast > hash. */ > +#define RSS_HASH_TOEPLITZ 0x00000002 /* Required by > RSS. */ > +#define RSS_HASH_CRC32 0x00000004 /* Future; some > NICs do it. */ > + > +#define RSS_HASH_MASK (RSS_HASH_NAIVE | > RSS_HASH_TOEPLITZ) > + > +/* > + * Instances of struct inpcbinfo declare an RSS hash type indicating what > + * header fields are covered. > + */ > +#define RSS_HASHFIELDS_NONE 0 > +#define RSS_HASHFIELDS_4TUPLE 1 > +#define RSS_HASHFIELDS_2TUPLE 2 > + > +/* > + * Compile-time limits on the size of the indirection table. > + */ > +#define RSS_MAXBITS 7 > +#define RSS_TABLE_MAXLEN (1 << RSS_MAXBITS) > + > +/* > + * Maximum key size used throughout. It's OK for hardware to use only the > + * first 16 bytes, which is all that's required for IPv4. > + */ > +#define RSS_KEYSIZE 40 > + > +/* > + * Device driver interfaces to query RSS properties that must be > programmed > + * into hardware. > + */ > +u_int rss_getbits(void); > +u_int rss_getbucket(u_int hash); > +u_int rss_getcpu(u_int bucket); > +void rss_getkey(uint8_t *key); > +u_int rss_gethashalgo(void); > +u_int rss_getnumbuckets(void); > +u_int rss_getnumcpus(void); > + > +/* > + * Network stack interface to generate a hash for a protocol tuple. > + */ > +uint32_t rss_hash_ip4_4tuple(struct in_addr src, u_short srcport, > + struct in_addr dst, u_short dstport); > +uint32_t rss_hash_ip4_2tuple(struct in_addr src, struct in_addr > dst); > +uint32_t rss_hash_ip6_4tuple(struct in6_addr src, u_short srcport, > + struct in6_addr dst, u_short dstport); > +uint32_t rss_hash_ip6_2tuple(struct in6_addr src, > + struct in6_addr dst); > + > +/* > + * Network stack interface to query desired CPU affinity of a packet. > + */ > +struct mbuf *rss_m2cpuid(struct mbuf *m, uintptr_t source, u_int > *cpuid); > + > +#endif /* !_NETINET_IN_RSS_H_ */ > > Added: head/sys/netinet/toeplitz.c > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/netinet/toeplitz.c Sat Mar 15 00:57:50 2014 (r263198) > @@ -0,0 +1,58 @@ > +/*- > + * Copyright (c) 2010 David Malone > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > + > +#include > +#include > + > +#include > + > +uint32_t > +toeplitz_hash(u_int keylen, const uint8_t *key, u_int datalen, > + const uint8_t *data) > +{ > + uint32_t hash = 0, v; > + u_int i, b; > + > + /* XXXRW: Perhaps an assertion about key length vs. data length? */ > + > + v = (key[0]<<24) + (key[1]<<16) + (key[2] <<8) + key[3]; > + for (i = 0; i < datalen; i++) { > + for (b = 0; b < 8; b++) { > + if (data[i] & (1<<(7-b))) > + hash ^= v; > + v <<= 1; > + if ((i + 4) < RSS_KEYSIZE && > + (key[i+4] & (1<<(7-b)))) > + v |= 1; > + } > + } > + return (hash); > +} > > Added: head/sys/netinet/toeplitz.h > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > From owner-svn-src-head@FreeBSD.ORG Sat Mar 15 06:49:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD35E30F; Sat, 15 Mar 2014 06:49:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A81B568A; Sat, 15 Mar 2014 06:49:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2F6nYbK026092; Sat, 15 Mar 2014 06:49:34 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2F6nWof026079; Sat, 15 Mar 2014 06:49:32 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403150649.s2F6nWof026079@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 15 Mar 2014 06:49:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263203 - in head: share/man/man4 share/man/man9 sys/net sys/sys usr.bin/netstat usr.sbin/ppp usr.sbin/route6d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 06:49:34 -0000 Author: glebius Date: Sat Mar 15 06:49:32 2014 New Revision: 263203 URL: http://svnweb.freebsd.org/changeset/base/263203 Log: Garbage collect long time obsoleted (or never used) stuff from routing API. Modified: head/share/man/man4/route.4 head/share/man/man9/rtentry.9 head/sys/net/iso88025.h head/sys/net/route.c head/sys/net/route.h head/sys/sys/sockio.h head/usr.bin/netstat/netstat.1 head/usr.bin/netstat/route.c head/usr.sbin/ppp/route.c head/usr.sbin/route6d/route6d.c Modified: head/share/man/man4/route.4 ============================================================================== --- head/share/man/man4/route.4 Sat Mar 15 02:26:46 2014 (r263202) +++ head/share/man/man4/route.4 Sat Mar 15 06:49:32 2014 (r263203) @@ -192,8 +192,6 @@ Messages include: #define RTM_REDIRECT 0x6 /* Told to use different route */ #define RTM_MISS 0x7 /* Lookup failed on this address */ #define RTM_LOCK 0x8 /* fix specified metrics */ -#define RTM_OLDADD 0x9 /* caused by SIOCADDRT */ -#define RTM_OLDDEL 0xa /* caused by SIOCDELRT */ #define RTM_RESOLVE 0xb /* request to resolve dst to LL addr - unused */ #define RTM_NEWADDR 0xc /* address being added to iface */ #define RTM_DELADDR 0xd /* address being removed from iface */ Modified: head/share/man/man9/rtentry.9 ============================================================================== --- head/share/man/man9/rtentry.9 Sat Mar 15 02:26:46 2014 (r263202) +++ head/share/man/man9/rtentry.9 Sat Mar 15 06:49:32 2014 (r263203) @@ -157,8 +157,6 @@ Requests that output sent via this route .It Dv RTF_PROTO2 .It Dv RTF_PROTO3 Protocol-specific. -.It Dv RTF_PRCLONING -This flag is obsolete and simply ignored by facility. .It Dv RTF_PINNED Indicates that this route is immutable to a routing protocol. .It Dv RTF_LOCAL Modified: head/sys/net/iso88025.h ============================================================================== --- head/sys/net/iso88025.h Sat Mar 15 02:26:46 2014 (r263202) +++ head/sys/net/iso88025.h Sat Mar 15 06:49:32 2014 (r263203) @@ -162,11 +162,13 @@ struct iso88025_addr { #define ISO88025_BPF_UNSUPPORTED 0 #define ISO88025_BPF_SUPPORTED 1 +#ifdef _KERNEL void iso88025_ifattach (struct ifnet *, const u_int8_t *, int); void iso88025_ifdetach (struct ifnet *, int); int iso88025_ioctl (struct ifnet *, u_long, caddr_t ); int iso88025_output (struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); void iso88025_input (struct ifnet *, struct mbuf *); +#endif /* _KERNEL */ -#endif +#endif /* !_NET_ISO88025_H_ */ Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat Mar 15 02:26:46 2014 (r263202) +++ head/sys/net/route.c Sat Mar 15 06:49:32 2014 (r263203) @@ -1733,15 +1733,6 @@ rtinit1(struct ifaddr *ifa, int cmd, int return (error); } -#ifndef BURN_BRIDGES -/* special one for inet internal use. may not use. */ -int -rtinit_fib(struct ifaddr *ifa, int cmd, int flags) -{ - return (rtinit1(ifa, cmd, flags, RT_ALL_FIBS)); -} -#endif - /* * Set up a routing table entry, normally * for an interface. Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sat Mar 15 02:26:46 2014 (r263202) +++ head/sys/net/route.h Sat Mar 15 06:49:32 2014 (r263203) @@ -86,10 +86,6 @@ struct rt_metrics { #define RT_ALL_FIBS -1 /* Announce event for every fib */ extern u_int rt_numfibs; /* number of usable routing tables */ extern u_int rt_add_addr_allfibs; /* Announce interfaces to all fibs */ -/* - * XXX kernel function pointer `rt_output' is visible to applications. - */ -struct mbuf; /* * We distinguish between routes to hosts and routes to networks, @@ -131,20 +127,6 @@ struct rtentry { }; #endif /* _KERNEL || _WANT_RTENTRY */ -/* - * Following structure necessary for 4.3 compatibility; - * We should eventually move it to a compat file. - */ -struct ortentry { - u_long rt_hash; /* to speed lookups */ - struct sockaddr rt_dst; /* key */ - struct sockaddr rt_gateway; /* value */ - short rt_flags; /* up/down?, host/net */ - short rt_refcnt; /* # held references */ - u_long rt_use; /* raw # packets forwarded */ - struct ifnet *rt_ifp; /* the answer: interface to use */ -}; - #define RTF_UP 0x1 /* route usable */ #define RTF_GATEWAY 0x2 /* destination is a gateway */ #define RTF_HOST 0x4 /* host entry (net otherwise) */ @@ -162,12 +144,7 @@ struct ortentry { #define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */ #define RTF_PROTO2 0x4000 /* protocol specific routing flag */ #define RTF_PROTO1 0x8000 /* protocol specific routing flag */ - -/* XXX: temporary to stay API/ABI compatible with userland */ -#ifndef _KERNEL -#define RTF_PRCLONING 0x10000 /* unused, for compatibility */ -#endif - +/* 0x10000 unused, was RTF_PRCLONING */ /* 0x20000 unused, was RTF_WASCLONED */ #define RTF_PROTO3 0x40000 /* protocol specific routing flag */ /* 0x80000 unused */ @@ -229,8 +206,8 @@ struct rt_msghdr { #define RTM_REDIRECT 0x6 /* Told to use different route */ #define RTM_MISS 0x7 /* Lookup failed on this address */ #define RTM_LOCK 0x8 /* fix specified metrics */ -#define RTM_OLDADD 0x9 /* caused by SIOCADDRT */ -#define RTM_OLDDEL 0xa /* caused by SIOCDELRT */ + /* 0x9 */ + /* 0xa */ #define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */ #define RTM_NEWADDR 0xc /* address being added to iface */ #define RTM_DELADDR 0xd /* address being removed from iface */ @@ -405,11 +382,6 @@ void rtredirect(struct sockaddr *, stru int rtrequest(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **); -#ifndef BURN_BRIDGES -/* defaults to "all" FIBs */ -int rtinit_fib(struct ifaddr *, int, int); -#endif - /* XXX MRT NEW VERSIONS THAT USE FIBs * For now the protocol indepedent versions are the same as the AF_INET ones * but this will change.. Modified: head/sys/sys/sockio.h ============================================================================== --- head/sys/sys/sockio.h Sat Mar 15 02:26:46 2014 (r263202) +++ head/sys/sys/sockio.h Sat Mar 15 06:49:32 2014 (r263203) @@ -44,8 +44,8 @@ #define SIOCSPGRP _IOW('s', 8, int) /* set process group */ #define SIOCGPGRP _IOR('s', 9, int) /* get process group */ -#define SIOCADDRT _IOW('r', 10, struct ortentry) /* add route */ -#define SIOCDELRT _IOW('r', 11, struct ortentry) /* delete route */ +/* SIOCADDRT _IOW('r', 10, struct ortentry) 4.3BSD */ +/* SIOCDELRT _IOW('r', 11, struct ortentry) 4.3BSD */ #define SIOCGETVIFCNT _IOWR('r', 15, struct sioc_vif_req)/* get vif pkt cnt */ #define SIOCGETSGCNT _IOWR('r', 16, struct sioc_sg_req) /* get s,g pkt cnt */ Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Sat Mar 15 02:26:46 2014 (r263202) +++ head/usr.bin/netstat/netstat.1 Sat Mar 15 06:49:32 2014 (r263203) @@ -244,14 +244,6 @@ If is also present, show the contents of the internal Patricia tree structures; used for debugging. -If -.Fl a -is also present, -show protocol-cloned routes -(routes generated by an -.Dv RTF_PRCLONING -parent route); -normally these routes are not shown. When .Fl W is also present, @@ -431,8 +423,6 @@ The mapping between letters and flags is .It Li 3 Ta Dv RTF_PROTO3 Ta "Protocol specific routing flag #3" .It Li B Ta Dv RTF_BLACKHOLE Ta "Just discard pkts (during updates)" .It Li b Ta Dv RTF_BROADCAST Ta "The route represents a broadcast address" -.It Li C Ta Dv RTF_CLONING Ta "Generate new routes on use" -.It Li c Ta Dv RTF_PRCLONING Ta "Protocol-specified generate new routes on use" .It Li D Ta Dv RTF_DYNAMIC Ta "Created dynamically (by redirect)" .It Li G Ta Dv RTF_GATEWAY Ta "Destination requires forwarding by intermediary" .It Li H Ta Dv RTF_HOST Ta "Host entry (net otherwise)" @@ -441,7 +431,6 @@ The mapping between letters and flags is .It Li R Ta Dv RTF_REJECT Ta "Host or net unreachable" .It Li S Ta Dv RTF_STATIC Ta "Manually added" .It Li U Ta Dv RTF_UP Ta "Route usable" -.It Li W Ta Dv RTF_WASCLONED Ta "Route was generated as a result of cloning" .It Li X Ta Dv RTF_XRESOLVE Ta "External daemon translates proto to link address" .El .Pp Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Sat Mar 15 02:26:46 2014 (r263202) +++ head/usr.bin/netstat/route.c Sat Mar 15 06:49:32 2014 (r263203) @@ -90,19 +90,12 @@ struct bits { { RTF_STATIC, 'S' }, { RTF_PROTO1, '1' }, { RTF_PROTO2, '2' }, - { RTF_PRCLONING,'c' }, { RTF_PROTO3, '3' }, { RTF_BLACKHOLE,'B' }, { RTF_BROADCAST,'b' }, #ifdef RTF_LLINFO { RTF_LLINFO, 'L' }, #endif -#ifdef RTF_WASCLONED - { RTF_WASCLONED,'W' }, -#endif -#ifdef RTF_CLONING - { RTF_CLONING, 'C' }, -#endif { 0 , 0 } }; Modified: head/usr.sbin/ppp/route.c ============================================================================== --- head/usr.sbin/ppp/route.c Sat Mar 15 02:26:46 2014 (r263202) +++ head/usr.sbin/ppp/route.c Sat Mar 15 06:49:32 2014 (r263203) @@ -158,26 +158,16 @@ static struct bits { { RTF_MODIFIED, 'M' }, { RTF_DONE, 'd' }, { RTF_XRESOLVE, 'X' }, -#ifdef RTF_CLONING - { RTF_CLONING, 'C' }, -#endif { RTF_STATIC, 'S' }, { RTF_PROTO1, '1' }, { RTF_PROTO2, '2' }, { RTF_BLACKHOLE, 'B' }, - #ifdef RTF_LLINFO { RTF_LLINFO, 'L' }, #endif #ifdef RTF_CLONING { RTF_CLONING, 'C' }, #endif -#ifdef RTF_WASCLONED - { RTF_WASCLONED, 'W' }, -#endif -#ifdef RTF_PRCLONING - { RTF_PRCLONING, 'c' }, -#endif #ifdef RTF_PROTO3 { RTF_PROTO3, '3' }, #endif @@ -187,10 +177,6 @@ static struct bits { { 0, '\0' } }; -#ifndef RTF_WASCLONED -#define RTF_WASCLONED (0) -#endif - static void p_flags(struct prompt *prompt, u_int32_t f, unsigned max) { @@ -434,7 +420,7 @@ route_IfDelete(struct bundle *bundle, in * route X was cloned from route Y (and is no longer there 'cos it * may have gone with route Y). */ - if (RTF_WASCLONED == 0 && pass == 0) + if (pass == 0) /* So we can't tell ! */ continue; for (cp = sp; cp < ep; cp += rtm->rtm_msglen) { @@ -461,8 +447,7 @@ route_IfDelete(struct bundle *bundle, in sa[RTAX_GATEWAY]->sa_family == AF_INET6 || #endif sa[RTAX_GATEWAY]->sa_family == AF_LINK) { - if ((pass == 0 && (rtm->rtm_flags & RTF_WASCLONED)) || - (pass == 1 && !(rtm->rtm_flags & RTF_WASCLONED))) { + if (pass == 1) { ncprange_setsa(&range, sa[RTAX_DST], sa[RTAX_NETMASK]); rt_Set(bundle, RTM_DELETE, &range, NULL, 0, 0); } else Modified: head/usr.sbin/route6d/route6d.c ============================================================================== --- head/usr.sbin/route6d/route6d.c Sat Mar 15 02:26:46 2014 (r263202) +++ head/usr.sbin/route6d/route6d.c Sat Mar 15 06:49:32 2014 (r263203) @@ -1901,10 +1901,6 @@ rtrecv(void) if (!rt_deladdr(ifcp, rta[RTAX_IFA], rta[RTAX_NETMASK])) iface++; break; - case RTM_OLDADD: - case RTM_OLDDEL: - trace(1, "\tnot supported yet, ignored\n"); - break; } } @@ -2467,17 +2463,9 @@ do { \ RTTYPE("REDIRECT", RTM_REDIRECT); RTTYPE("MISS", RTM_MISS); RTTYPE("LOCK", RTM_LOCK); - RTTYPE("OLDADD", RTM_OLDADD); - RTTYPE("OLDDEL", RTM_OLDDEL); RTTYPE("NEWADDR", RTM_NEWADDR); RTTYPE("DELADDR", RTM_DELADDR); RTTYPE("IFINFO", RTM_IFINFO); -#ifdef RTM_OLDADD - RTTYPE("OLDADD", RTM_OLDADD); -#endif -#ifdef RTM_OLDDEL - RTTYPE("OLDDEL", RTM_OLDDEL); -#endif #ifdef RTM_OIFINFO RTTYPE("OIFINFO", RTM_OIFINFO); #endif @@ -2518,18 +2506,9 @@ do { \ #ifdef RTF_MASK RTFLAG("m", RTF_MASK); #endif -#ifdef RTF_CLONING - RTFLAG("C", RTF_CLONING); -#endif #ifdef RTF_CLONED RTFLAG("c", RTF_CLONED); #endif -#ifdef RTF_PRCLONING - RTFLAG("c", RTF_PRCLONING); -#endif -#ifdef RTF_WASCLONED - RTFLAG("W", RTF_WASCLONED); -#endif RTFLAG("X", RTF_XRESOLVE); #ifdef RTF_LLINFO RTFLAG("L", RTF_LLINFO); From owner-svn-src-head@FreeBSD.ORG Sat Mar 15 08:55:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0B6D88D; Sat, 15 Mar 2014 08:55:19 +0000 (UTC) Received: from mta05.bitpro.no (mta05.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id 89B18F82; Sat, 15 Mar 2014 08:55:18 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta05.bitpro.no (Postfix) with ESMTPS id 76F6E17FCF8; Sat, 15 Mar 2014 09:55:10 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id CEC568F4AEE; Sat, 15 Mar 2014 09:55:04 +0100 (CET) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PVbIXoUmztnw; Sat, 15 Mar 2014 09:55:04 +0100 (CET) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) by mail.lockless.no (Postfix) with ESMTPSA id 02B6B8F4A87; Sat, 15 Mar 2014 09:55:03 +0100 (CET) Message-ID: <5324159F.3030207@bitfrost.no> Date: Sat, 15 Mar 2014 09:55:59 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Bruce Evans , Rui Paulo Subject: Re: svn commit: r262972 - head/sys/dev/usb/input References: <201403100852.s2A8qUdC045704@svn.freebsd.org> <5322CCC5.7020608@bitfrost.no> <20140315075248.Y964@besplex.bde.org> In-Reply-To: <20140315075248.Y964@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 08:55:19 -0000 On 03/15/14 00:26, Bruce Evans wrote: > LED toggling has to work in critical sections too. Then the LED code > itself is not being reentered (unless parts of it are locked by > critical sections), but there are other complications. Of course, > the LED code must not use any interrupts or do any context switches > in debugger mode. CAPS lock works, only the LED is not lighted up. --HPS From owner-svn-src-head@FreeBSD.ORG Sat Mar 15 09:28:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36A7D11A; Sat, 15 Mar 2014 09:28:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 22A1C263; Sat, 15 Mar 2014 09:28:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2F9S0kU090657; Sat, 15 Mar 2014 09:28:00 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2F9Rxh5090655; Sat, 15 Mar 2014 09:27:59 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403150927.s2F9Rxh5090655@svn.freebsd.org> From: Julio Merino Date: Sat, 15 Mar 2014 09:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263204 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 09:28:00 -0000 Author: jmmv Date: Sat Mar 15 09:27:59 2014 New Revision: 263204 URL: http://svnweb.freebsd.org/changeset/base/263204 Log: Add some documentation for bsd.test.mk. Modified: head/share/mk/bsd.README Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Sat Mar 15 06:49:32 2014 (r263203) +++ head/share/mk/bsd.README Sat Mar 15 09:27:59 2014 (r263204) @@ -39,6 +39,7 @@ bsd.prog.mk - building programs from so bsd.snmpmod.mk - building modules for the SNMP daemon bsnmpd bsd.subdir.mk - targets for building subdirectories bsd.sys.mk - common settings used for building FreeBSD sources +bsd.test.mk - building test programs from source files sys.mk - default rules for all makes This file does not document bsd.port*.mk. They are documented in ports(7). @@ -365,3 +366,86 @@ It has rules for building profiled objec built by default. Libraries are ranlib'd before installation. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +The include file handles building one or more test programs +intended to be used in the FreeBSD Test Suite under /usr/tests/. + +It has seven targets: + + all: + build the test programs. + clean: + remove the test programs and any object files. + cleandir: + remove all of the files removed by the target clean, as + well as .depend and tags. + depend: + make the dependencies for the source files, and store + them in the file .depend. + install: + install the test programs and their data files; if the + Makefile does not itself define the target install, the + targets beforeinstall and afterinstall may also be used + to cause actions immediately before and after the + install target is executed. + lint: + run lint on the source files. + tags: + create a tags file for the source files. + test: + runs the test programs from the object directory; if the + Makefile does not itself define the target test, the + targets beforetest and aftertest may also be used to + cause actions immediately before and after the test + target is executed. + +It sets/uses the following variables, among many others: + +TESTDIR Path to the installed tests. Must be a subdirectory of + TESTSBASE and the subpath should match the relative + location of the tests within the src tree. + +KYUAFILE If 'auto' (the default), generate a Kyuafile out of the + test programs defined in the Makefile. If 'yes', then a + manually-crafted Kyuafile must be supplied with the + sources. If 'no', no Kyuafile is installed (useful for + subdirectories providing helper programs or data files + only). + +ATF_TESTS_C The names of the ATF C test programs to build. + +ATF_TESTS_CXX The names of the ATF C++ test programs to build. + +ATF_TESTS_SH The names of the ATF sh test programs to build. + +PLAIN_TESTS_C The names of the plain (legacy) programs to build. + +PLAIN_TESTS_CXX The names of the plain (legacy) test programs to build. + +PLAIN_TESTS_SH The names of the plain (legacy) test programs to build. + +TAP_TESTS_C The names of the TAP-compliant C test programs to build. + +TAP_TESTS_CXX The names of the TAP-compliant C++ test programs to + build. + +TAP_TESTS_SH The names of the TAP-compliant sh test programs to + build. + +TESTS_SUBDIRS List of subdirectories containing tests into which to + recurse. Differs from SUBDIR in that these directories + get registered into the automatically-generated + Kyuafile (if any). + +NOT_FOR_TEST_SUITE + If defined, none of the built test programs get + installed under /usr/tests/ and no Kyuafile is + automatically generated. Should not be used within the + FreeBSD source tree but is provided for the benefit of + third-parties. + +The actual building of the test programs is performed by . +Please see the documentation above for this other file for additional +details on the behavior of . From owner-svn-src-head@FreeBSD.ORG Sat Mar 15 09:34:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83BA8444; Sat, 15 Mar 2014 09:34:42 +0000 (UTC) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3FD83324; Sat, 15 Mar 2014 09:34:42 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 950283C3669; Sat, 15 Mar 2014 20:34:29 +1100 (EST) Date: Sat, 15 Mar 2014 20:34:27 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hans Petter Selasky Subject: Re: svn commit: r262972 - head/sys/dev/usb/input In-Reply-To: <5324159F.3030207@bitfrost.no> Message-ID: <20140315201925.A2808@besplex.bde.org> References: <201403100852.s2A8qUdC045704@svn.freebsd.org> <5322CCC5.7020608@bitfrost.no> <20140315075248.Y964@besplex.bde.org> <5324159F.3030207@bitfrost.no> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=fbeUlSgF c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=XVJnJZe_LX4A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=xiiNejUuvOIGF5njXkcA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo , Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 09:34:42 -0000 On Sat, 15 Mar 2014, Hans Petter Selasky wrote: > On 03/15/14 00:26, Bruce Evans wrote: >> LED toggling has to work in critical sections too. Then the LED code >> itself is not being reentered (unless parts of it are locked by >> critical sections), but there are other complications. Of course, >> the LED code must not use any interrupts or do any context switches >> in debugger mode. > > CAPS lock works, only the LED is not lighted up. Yes, that's the expected brokenness. If keyboard input works at all, it is not likely to be a fundamental problem. However, the working parts probably need races to work. I really miss the LEDs on a keyboard without them. Under WinXP, there is a utility to display the caps lock state using only 10MB of memory. Under FreeBSD, I don't have such bloat and have to fly blind. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Mar 15 12:03:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97381C8E; Sat, 15 Mar 2014 12:03:48 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id E6F59184; Sat, 15 Mar 2014 12:03:47 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [198.74.231.63]) by cyrus.watson.org (Postfix) with ESMTPS id 694C146B2A; Sat, 15 Mar 2014 08:03:47 -0400 (EDT) Date: Sat, 15 Mar 2014 12:03:47 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Adrian Chadd Subject: Re: svn commit: r263198 - in head/sys: amd64/conf conf net netinet netinet6 sys In-Reply-To: Message-ID: References: <201403150057.s2F0vofg081606@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8BIT X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 12:03:48 -0000 On Fri, 14 Mar 2014, Adrian Chadd wrote: > Woo! Thanks! I'd characterise this work as "early" in that it would benefit from performance optimisation, device-driver work, and feature enhancement (e.g., not just stuff like load rebalancing, but also statistics to detect RSS configuration problems leading to work being directed to the wrong CPU, etc). In any case, hopefully this is a useful starting point for people doing work in this space. Robert > > Adrian > > On Mar 14, 2014 5:57 PM, "Robert Watson" wrote: > Author: rwatson > Date: Sat Mar 15 00:57:50 2014 > New Revision: 263198 > URL: http://svnweb.freebsd.org/changeset/base/263198 > > Log: >   Several years after initial development, merge prototype > support for >   linking NIC Receive Side Scaling (RSS) to the network stack's >   connection-group implementation.  This prototype (and derived > patches) >   are in use at Juniper and several other FreeBSD-using > companies, so >   despite some reservations about its maturity, merge the patch > to the >   base tree so that it can be iteratively refined in > collaboration rather >   than maintained as a set of gradually diverging patch sets. > >   (1) Merge a software implementation of the Toeplitz hash > specified in >       RSS implemented by David Malone.  This is used to allow > suitable >       pcbgroup placement of connections before the first packet > is >       received from the NIC.  Software hashing is generally > avoided, >       however, due to high cost of the hash on general-purpose > CPUs. > >   (2) In in_rss.c, maintain authoritative versions of RSS state > intended >       to be pushed to each NIC, including keying material, hash >       algorithm/ configuration, and buckets.  Provide > software-facing >       interfaces to hash 2- and 4-tuples for IPv4 and IPv6 using > both >       the RSS standardised Toeplitz and a 'naive' variation with > a hash >       efficient in software but with poor distribution > properties. >       Implement rss_m2cpuid()to be used by netisr and other load >       balancing code to look up the CPU on which an mbuf should > be >       processed. > >   (3) In the Ethernet link layer, allow netisr distribution > using RSS as >       a source of policy as an alternative to source ordering; > continue >       to default to direct dispatch (i.e., don't try and requeue > packets >       for processing on the 'right' CPU if they arrive in a > directly >       dispatchable context). > >   (4) Allow RSS to control tuning of connection groups in order > to align >       groups with RSS buckets.  If a packet arrives on a > protocol using >       connection groups, and contains a suitable > hardware-generated >       hash, use that hash value to select the connection group > for pcb >       lookup for both IPv4 and IPv6.  If no hardware-generated > Toeplitz >       hash is available, we fall back on regular PCB lookup > risking >       contention rather than pay the cost of Toeplitz in > software -- >       this is a less scalable but, at my last measurement, > faster >       approach.  As core counts go up, we may want to revise > this >       strategy despite CPU overhead. > >   Where device drivers suitably configure NICs, and connection > groups / >   RSS are enabled, this should avoid both lock and line > contention during >   connection lookup for TCP.  This commit does not modify any > device >   drivers to tune device RSS configuration to the global RSS >   configuration; patches are in circulation to do this for at > least >   Chelsio T3 and Intel 1G/10G drivers.  Currently, the KPI for > device >   drivers is not particularly robust, nor aware of more advanced > features >   such as runtime reconfiguration/rebalancing.  This will > hopefully prove >   a useful starting point for refinement. > >   No MFC is scheduled as we will first want to nail down a more > mature >   and maintainable KPI/KBI for device drivers. > >   Sponsored by:   Juniper Networks (original work) >   Sponsored by:   EMC/Isilon (patch update and merge) > > Added: >   head/sys/netinet/in_rss.c   (contents, props changed) >   head/sys/netinet/in_rss.h   (contents, props changed) >   head/sys/netinet/toeplitz.c   (contents, props changed) >   head/sys/netinet/toeplitz.h   (contents, props changed) > Modified: >   head/sys/amd64/conf/GENERIC >   head/sys/conf/files >   head/sys/conf/options >   head/sys/net/if_ethersubr.c >   head/sys/netinet/in_pcb.c >   head/sys/netinet/in_pcbgroup.c >   head/sys/netinet6/in6_pcb.c >   head/sys/netinet6/in6_pcbgroup.c >   head/sys/sys/priv.h > > Modified: head/sys/amd64/conf/GENERIC > =========================================================================== > === > --- head/sys/amd64/conf/GENERIC Sat Mar 15 00:23:35 2014       >  (r263197) > +++ head/sys/amd64/conf/GENERIC Sat Mar 15 00:57:50 2014       >  (r263198) > @@ -28,6 +28,8 @@ options       SCHED_ULE               # ULE > scheduler >  options        PREEMPTION              # Enable kernel thread > preemption >  options        INET                    # InterNETworking >  options        INET6                   # IPv6 communications > protocols > +options        PCBGROUP                # Protocol control-block > groups > +options        RSS                     # Receive-side scaling > support >  options        TCP_OFFLOAD             # TCP offload >  options        SCTP                    # Stream Control > Transmission Protocol >  options        FFS                     # Berkeley Fast > Filesystem > > Modified: head/sys/conf/files > =========================================================================== > === > --- head/sys/conf/files Sat Mar 15 00:23:35 2014       >  (r263197) > +++ head/sys/conf/files Sat Mar 15 00:57:50 2014       >  (r263198) > @@ -3267,6 +3267,7 @@ netinet/in_pcb.c          optional inet | > inet6 >  netinet/in_pcbgroup.c          optional inet pcbgroup | inet6 > pcbgroup >  netinet/in_proto.c             optional inet | inet6 >  netinet/in_rmx.c               optional inet > +netinet/in_rss.c               optional inet rss | inet6 rss >  netinet/ip_divert.c            optional inet ipdivert > ipfirewall >  netinet/ip_ecn.c               optional inet | inet6 >  netinet/ip_encap.c             optional inet | inet6 > @@ -3308,6 +3309,7 @@ netinet/tcp_syncache.c            optional > inet | >  netinet/tcp_timer.c            optional inet | inet6 >  netinet/tcp_timewait.c         optional inet | inet6 >  netinet/tcp_usrreq.c           optional inet | inet6 > +netinet/toeplitz.c             optional inet rss | inet6 rss >  netinet/udp_usrreq.c           optional inet | inet6 >  netinet/libalias/alias.c       optional libalias inet | > netgraph_nat inet >  netinet/libalias/alias_db.c    optional libalias inet | > netgraph_nat inet > > Modified: head/sys/conf/options > =========================================================================== > === > --- head/sys/conf/options       Sat Mar 15 00:23:35 2014       >  (r263197) > +++ head/sys/conf/options       Sat Mar 15 00:57:50 2014       >  (r263198) > @@ -427,6 +427,7 @@ PCBGROUP            opt_pcbgroup.h >  PF_DEFAULT_TO_DROP     opt_pf.h >  RADIX_MPATH            opt_mpath.h >  ROUTETABLES            opt_route.h > +RSS                    opt_rss.h >  SLIP_IFF_OPTS          opt_slip.h >  TCPDEBUG >  TCP_OFFLOAD            opt_inet.h # Enable code to dispatch TCP > offloading > > Modified: head/sys/net/if_ethersubr.c > =========================================================================== > === > --- head/sys/net/if_ethersubr.c Sat Mar 15 00:23:35 2014       >  (r263197) > +++ head/sys/net/if_ethersubr.c Sat Mar 15 00:57:50 2014       >  (r263198) > @@ -34,6 +34,7 @@ >  #include "opt_inet6.h" >  #include "opt_netgraph.h" >  #include "opt_mbuf_profiling.h" > +#include "opt_rss.h" > >  #include >  #include > @@ -70,6 +71,7 @@ >  #include >  #include >  #include > +#include >  #include >  #include >  #endif > @@ -583,7 +585,22 @@ ether_input_internal(struct ifnet *ifp, > >  /* >   * Ethernet input dispatch; by default, direct dispatch here > regardless of > - * global configuration. > + * global configuration.  However, if RSS is enabled, hook up > RSS affinity > + * so that when deferred or hybrid dispatch is enabled, we can > redistribute > + * load based on RSS. > + * > + * XXXRW: Would be nice if the ifnet passed up a flag > indicating whether or > + * not it had already done work distribution via multi-queue. >  Then we could > + * direct dispatch in the event load balancing was already > complete and > + * handle the case of interfaces with different capabilities > better. > + * > + * XXXRW: Sort of want an M_DISTRIBUTED flag to avoid multiple > distributions > + * at multiple layers? > + * > + * XXXRW: For now, enable all this only if RSS is compiled in, > although it > + * works fine without RSS.  Need to characterise the > performance overhead > + * of the detour through the netisr code in the event the > result is always > + * direct dispatch. >   */ >  static void >  ether_nh_input(struct mbuf *m) > @@ -596,8 +613,14 @@ static struct netisr_handler       ether_nh > = >         .nh_name = "ether", >         .nh_handler = ether_nh_input, >         .nh_proto = NETISR_ETHER, > +#ifdef RSS > +       .nh_policy = NETISR_POLICY_CPU, > +       .nh_dispatch = NETISR_DISPATCH_DIRECT, > +       .nh_m2cpuid = rss_m2cpuid, > +#else >         .nh_policy = NETISR_POLICY_SOURCE, >         .nh_dispatch = NETISR_DISPATCH_DIRECT, > +#endif >  }; > >  static void > > Modified: head/sys/netinet/in_pcb.c > =========================================================================== > === > --- head/sys/netinet/in_pcb.c   Sat Mar 15 00:23:35 2014       >  (r263197) > +++ head/sys/netinet/in_pcb.c   Sat Mar 15 00:57:50 2014       >  (r263198) > @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); >  #include "opt_inet.h" >  #include "opt_inet6.h" >  #include "opt_pcbgroup.h" > +#include "opt_rss.h" > >  #include >  #include > @@ -75,6 +76,7 @@ __FBSDID("$FreeBSD$"); >  #if defined(INET) || defined(INET6) >  #include >  #include > +#include >  #include >  #include >  #include > @@ -1820,7 +1822,7 @@ struct inpcb * >  in_pcblookup(struct inpcbinfo *pcbinfo, struct in_addr faddr, > u_int fport, >      struct in_addr laddr, u_int lport, int lookupflags, struct > ifnet *ifp) >  { > -#if defined(PCBGROUP) > +#if defined(PCBGROUP) && !defined(RSS) >         struct inpcbgroup *pcbgroup; >  #endif > > @@ -1829,7 +1831,17 @@ in_pcblookup(struct inpcbinfo *pcbinfo, >         KASSERT((lookupflags & (INPLOOKUP_RLOCKPCB | > INPLOOKUP_WLOCKPCB)) != 0, >             ("%s: LOCKPCB not set", __func__)); > > -#if defined(PCBGROUP) > +       /* > +        * When not using RSS, use connection groups in > preference to the > +        * reservation table when looking up 4-tuples.  When > using RSS, just > +        * use the reservation table, due to the cost of the > Toeplitz hash > +        * in software. > +        * > +        * XXXRW: This policy belongs in the pcbgroup code, as > in principle > +        * we could be doing RSS with a non-Toeplitz hash that > is affordable > +        * in software. > +        */ > +#if defined(PCBGROUP) && !defined(RSS) >         if (in_pcbgroup_enabled(pcbinfo)) { >                 pcbgroup = in_pcbgroup_bytuple(pcbinfo, laddr, > lport, faddr, >                     fport); > @@ -1856,16 +1868,27 @@ in_pcblookup_mbuf(struct inpcbinfo *pcbi >             ("%s: LOCKPCB not set", __func__)); > >  #ifdef PCBGROUP > -       if (in_pcbgroup_enabled(pcbinfo)) { > +       /* > +        * If we can use a hardware-generated hash to look up > the connection > +        * group, use that connection group to find the inpcb. >  Otherwise > +        * fall back on a software hash -- or the reservation > table if we're > +        * using RSS. > +        * > +        * XXXRW: As above, that policy belongs in the pcbgroup > code. > +        */ > +       if (in_pcbgroup_enabled(pcbinfo) && > +           !(M_HASHTYPE_TEST(m, M_HASHTYPE_NONE))) { >                 pcbgroup = in_pcbgroup_byhash(pcbinfo, > M_HASHTYPE_GET(m), >                     m->m_pkthdr.flowid); >                 if (pcbgroup != NULL) >                         return (in_pcblookup_group(pcbinfo, > pcbgroup, faddr, >                             fport, laddr, lport, lookupflags, > ifp)); > +#ifndef RSS >                 pcbgroup = in_pcbgroup_bytuple(pcbinfo, laddr, > lport, faddr, >                     fport); >                 return (in_pcblookup_group(pcbinfo, pcbgroup, > faddr, fport, >                     laddr, lport, lookupflags, ifp)); > +#endif >         } >  #endif >         return (in_pcblookup_hash(pcbinfo, faddr, fport, laddr, > lport, > > Modified: head/sys/netinet/in_pcbgroup.c > =========================================================================== > === > --- head/sys/netinet/in_pcbgroup.c      Sat Mar 15 00:23:35 2014 >        (r263197) > +++ head/sys/netinet/in_pcbgroup.c      Sat Mar 15 00:57:50 2014 >        (r263198) > @@ -32,6 +32,7 @@ >  __FBSDID("$FreeBSD$"); > >  #include "opt_inet6.h" > +#include "opt_rss.h" > >  #include >  #include > @@ -43,6 +44,7 @@ __FBSDID("$FreeBSD$"); > >  #include >  #include > +#include >  #ifdef INET6 >  #include >  #endif /* INET6 */ > @@ -60,6 +62,13 @@ __FBSDID("$FreeBSD$"); >   * minimal cache line migration and lock contention during > steady state >   * operation. >   * > + * Hardware-offloaded checksums are often inefficient in > software -- for > + * example, Toeplitz, specified by RSS, introduced a > significant overhead if > + * performed during per-packge processing.  It is therefore > desirable to fall > + * back on traditional reservation table lookups without > affinity where > + * hardware-offloaded checksums aren't available, such as for > traffic over > + * non-RSS interfaces. > + * >   * Internet protocols, such as UDP and TCP, register to use > connection groups >   * by providing an ipi_hashfields value other than > IPI_HASHFIELDS_NONE; this >   * indicates to the connection group code whether a 2-tuple or > 4-tuple is > @@ -72,6 +81,11 @@ __FBSDID("$FreeBSD$"); >   * signficantly more expensive than without connection groups, > but that >   * steady-state processing can be significantly faster. >   * > + * When RSS is used, certain connection group parameters, such > as the number > + * of groups, are provided by the RSS implementation, found in > in_rss.c. > + * Otherwise, in_pcbgroup.c selects possible sensible > parameters > + * corresponding to the degree of parallelism exposed by > netisr. > + * >   * Most of the implementation of connection groups is in this > file; however, >   * connection group lookup is implemented in in_pcb.c alongside > reservation >   * table lookups -- see in_pcblookup_group(). > @@ -126,11 +140,25 @@ in_pcbgroup_init(struct inpcbinfo *pcbin >         if (mp_ncpus == 1) >                 return; > > +#ifdef RSS >         /* > -        * Use one group per CPU for now.  If we decide to do > dynamic > -        * rebalancing a la RSS, we'll need to shift left by at > least 1. > +        * If we're using RSS, then RSS determines the number of > connection > +        * groups to use: one connection group per RSS bucket. >  If for some > +        * reason RSS isn't able to provide a number of buckets, > disable > +        * connection groups entirely. > +        * > +        * XXXRW: Can this ever happen? > +        */ > +       numpcbgroups = rss_getnumbuckets(); > +       if (numpcbgroups == 0) > +               return; > +#else > +       /* > +        * Otherwise, we'll just use one per CPU for now.  If we > decide to > +        * do dynamic rebalancing a la RSS, we'll need similar > logic here. >          */ >         numpcbgroups = mp_ncpus; > +#endif > >         pcbinfo->ipi_hashfields = hashfields; >         pcbinfo->ipi_pcbgroups = malloc(numpcbgroups * > @@ -146,10 +174,19 @@ in_pcbgroup_init(struct inpcbinfo *pcbin > >                 /* >                  * Initialise notional affinity of the pcbgroup > -- for RSS, > -                * we want the same notion of affinity as NICs > to be used. > -                * Just round robin for the time being. > +                * we want the same notion of affinity as NICs > to be used.  In > +                * the non-RSS case, just round robin for the > time being. > +                * > +                * XXXRW: The notion of a bucket to CPU mapping > is common at > +                * both pcbgroup and RSS layers -- does that > mean that we > +                * should migrate it all from RSS to here, and > just leave RSS > +                * responsible only for providing hashing and > mapping funtions? >                  */ > +#ifdef RSS > +               pcbgroup->ipg_cpu = rss_getcpu(pgn); > +#else >                 pcbgroup->ipg_cpu = (pgn % mp_ncpus); > +#endif >         } >  } > > @@ -179,23 +216,38 @@ in_pcbgroup_destroy(struct inpcbinfo *pc > >  /* >   * Given a hash of whatever the covered tuple might be, return > a pcbgroup > - * index. > + * index.  Where RSS is supported, try to align bucket > selection with RSS CPU > + * affinity strategy. >   */ >  static __inline u_int >  in_pcbgroup_getbucket(struct inpcbinfo *pcbinfo, uint32_t hash) >  { > > +#ifdef RSS > +       return (rss_getbucket(hash)); > +#else >         return (hash % pcbinfo->ipi_npcbgroups); > +#endif >  } > >  /* >   * Map a (hashtype, hash) tuple into a connection group, or > NULL if the hash > - * information is insufficient to identify the pcbgroup. > + * information is insufficient to identify the pcbgroup.  This > might occur if > + * a TCP packet turns up with a 2-tuple hash, or if an RSS hash > is present but > + * RSS is not compiled into the kernel. >   */ >  struct inpcbgroup * >  in_pcbgroup_byhash(struct inpcbinfo *pcbinfo, u_int hashtype, > uint32_t hash) >  { > > +#ifdef RSS > +       if ((pcbinfo->ipi_hashfields == IPI_HASHFIELDS_4TUPLE && > +           hashtype == M_HASHTYPE_RSS_TCP_IPV4) || > +           (pcbinfo->ipi_hashfields == IPI_HASHFIELDS_2TUPLE && > +           hashtype == M_HASHTYPE_RSS_IPV4)) > +               return (&pcbinfo->ipi_pcbgroups[ > +                   in_pcbgroup_getbucket(pcbinfo, hash)]); > +#endif >         return (NULL); >  } > > @@ -213,13 +265,26 @@ in_pcbgroup_bytuple(struct inpcbinfo *pc >  { >         uint32_t hash; > > +       /* > +        * RSS note: we pass foreign addr/port as source, and > local addr/port > +        * as destination, as we want to align with what the > hardware is > +        * doing. > +        */ >         switch (pcbinfo->ipi_hashfields) { >         case IPI_HASHFIELDS_4TUPLE: > +#ifdef RSS > +               hash = rss_hash_ip4_4tuple(faddr, fport, laddr, > lport); > +#else >                 hash = faddr.s_addr ^ fport; > +#endif >                 break; > >         case IPI_HASHFIELDS_2TUPLE: > +#ifdef RSS > +               hash = rss_hash_ip4_2tuple(faddr, laddr); > +#else >                 hash = faddr.s_addr ^ laddr.s_addr; > +#endif >                 break; > >         default: > > Added: head/sys/netinet/in_rss.c > =========================================================================== > === > --- /dev/null   00:00:00 1970   (empty, because file is newly > added) > +++ head/sys/netinet/in_rss.c   Sat Mar 15 00:57:50 2014       >  (r263198) > @@ -0,0 +1,505 @@ > +/*- > + * Copyright (c) 2010-2011 Juniper Networks, Inc. > + * All rights reserved. > + * > + * This software was developed by Robert N. M. Watson under > contract > + * to Juniper Networks, Inc. > + * > + * Redistribution and use in source and binary forms, with or > without > + * modification, are permitted provided that the following > conditions > + * are met: > + * 1. Redistributions of source code must retain the above > copyright > + *    notice, this list of conditions and the following > disclaimer. > + * 2. Redistributions in binary form must reproduce the above > copyright > + *    notice, this list of conditions and the following > disclaimer in the > + *    documentation and/or other materials provided with the > distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS > ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A > PARTICULAR PURPOSE > + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR > CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > + > +__FBSDID("$FreeBSD$"); > + > +#include "opt_inet6.h" > +#include "opt_pcbgroup.h" > + > +#ifndef PCBGROUP > +#error "options RSS depends on options PCBGROUP" > +#endif > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > + > +/*- > + * Operating system parts of receiver-side scaling (RSS), which > allows > + * network cards to direct flows to particular receive queues > based on hashes > + * of header tuples.  This implementation aligns RSS buckets > with connection > + * groups at the TCP/IP layer, so each bucket is associated > with exactly one > + * group.  As a result, the group lookup structures (and lock) > should have an > + * effective affinity with exactly one CPU. > + * > + * Network device drivers needing to configure RSS will query > this framework > + * for parameters, such as the current RSS key, hashing > policies, number of > + * bits, and indirection table mapping hashes to buckets and > CPUs.  They may > + * provide their own supplementary information, such as > queue<->CPU bindings. > + * It is the responsibility of the network device driver to > inject packets > + * into the stack on as close to the right CPU as possible, if > playing by RSS > + * rules. > + * > + * TODO: > + * > + * - Synchronization for rss_key and other future-configurable > parameters. > + * - Event handler drivers can register to pick up RSS > configuration changes. > + * - Should we allow rss_basecpu to be configured? > + * - Randomize key on boot. > + * - IPv6 support. > + * - Statistics on how often there's a misalignment between > hardware > + *   placement and pcbgroup expectations. > + */ > + > +SYSCTL_NODE(_net_inet, OID_AUTO, rss, CTLFLAG_RW, 0, > "Receive-side steering"); > + > +/* > + * Toeplitz is the only required hash function in the RSS spec, > so use it by > + * default. > + */ > +static u_int   rss_hashalgo = RSS_HASH_TOEPLITZ; > +SYSCTL_INT(_net_inet_rss, OID_AUTO, hashalgo, CTLFLAG_RD, > &rss_hashalgo, 0, > +    "RSS hash algorithm"); > +TUNABLE_INT("net.inet.rss.hashalgo", &rss_hashalgo); > + > +/* > + * Size of the indirection table; at most 128 entries per the > RSS spec.  We > + * size it to at least 2 times the number of CPUs by default to > allow useful > + * rebalancing.  If not set explicitly with a loader tunable, > we tune based > + * on the number of CPUs present. > + * > + * XXXRW: buckets might be better to use for the tunable than > bits. > + */ > +static u_int   rss_bits; > +SYSCTL_INT(_net_inet_rss, OID_AUTO, bits, CTLFLAG_RD, > &rss_bits, 0, > +    "RSS bits"); > +TUNABLE_INT("net.inet.rss.bits", &rss_bits); > + > +static u_int   rss_mask; > +SYSCTL_INT(_net_inet_rss, OID_AUTO, mask, CTLFLAG_RD, > &rss_mask, 0, > +    "RSS mask"); > + > +static const u_int     rss_maxbits = RSS_MAXBITS; > +SYSCTL_INT(_net_inet_rss, OID_AUTO, maxbits, CTLFLAG_RD, > +    __DECONST(int *, &rss_maxbits), 0, "RSS maximum bits"); > + > +/* > + * RSS's own count of the number of CPUs it could be using for > processing. > + * Bounded to 64 by RSS constants. > + */ > +static u_int   rss_ncpus; > +SYSCTL_INT(_net_inet_rss, OID_AUTO, ncpus, CTLFLAG_RD, > &rss_ncpus, 0, > +    "Number of CPUs available to RSS"); > + > +#define        RSS_MAXCPUS     (1 << (RSS_MAXBITS - 1)) > +static const u_int     rss_maxcpus = RSS_MAXCPUS; > +SYSCTL_INT(_net_inet_rss, OID_AUTO, maxcpus, CTLFLAG_RD, > +    __DECONST(int *, &rss_maxcpus), 0, "RSS maximum CPUs that > can be used"); > + > +/* > + * Variable exists just for reporting rss_bits in a > user-friendly way. > + */ > +static u_int   rss_buckets; > +SYSCTL_INT(_net_inet_rss, OID_AUTO, buckets, CTLFLAG_RD, > &rss_buckets, 0, > +    "RSS buckets"); > + > +/* > + * Base CPU number; devices will add this to all CPU numbers > returned by the > + * RSS indirection table.  Currently unmodifable in FreeBSD. > + */ > +static const u_int     rss_basecpu; > +SYSCTL_INT(_net_inet_rss, OID_AUTO, basecpu, CTLFLAG_RD, > +    __DECONST(int *, &rss_basecpu), 0, "RSS base CPU"); > + > +/* > + * RSS secret key, intended to prevent attacks on > load-balancing.  Its > + * effectiveness may be limited by algorithm choice and > available entropy > + * during the boot. > + * > + * XXXRW: And that we don't randomize it yet! > + * > + * XXXRW: This default is actually the default key from Chelsio > T3 cards, as > + * it offers reasonable distribution, unlike all-0 keys which > always > + * generate a hash of 0 (upsettingly). > + */ > +static uint8_t rss_key[RSS_KEYSIZE] = { > +       0x43, 0xa3, 0x8f, 0xb0, 0x41, 0x67, 0x25, 0x3d, > +       0x25, 0x5b, 0x0e, 0xc2, 0x6d, 0x5a, 0x56, 0xda, > +       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > +       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > +       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > +}; > + > +/* > + * RSS hash->CPU table, which maps hashed packet headers to > particular CPUs. > + * Drivers may supplement this table with a seperate > CPU<->queue table when > + * programming devices. > + */ > +struct rss_table_entry { > +       uint8_t         rte_cpu;        /* CPU affinity of > bucket. */ > +}; > +static struct rss_table_entry  rss_table[RSS_TABLE_MAXLEN]; > + > +static void > +rss_init(__unused void *arg) > +{ > +       u_int i; > + > +       /* > +        * Validate tunables, coerce to sensible values. > +        */ > +       switch (rss_hashalgo) { > +       case RSS_HASH_TOEPLITZ: > +       case RSS_HASH_NAIVE: > +               break; > + > +       default: > +               printf("%s: invalid RSS hashalgo %u, coercing to > %u", > +                   __func__, rss_hashalgo, RSS_HASH_TOEPLITZ); > +               rss_hashalgo = RSS_HASH_TOEPLITZ; > +       } > + > +       /* > +        * Count available CPUs. > +        * > +        * XXXRW: Note incorrect assumptions regarding > contiguity of this set > +        * elsewhere. > +        */ > +       rss_ncpus = 0; > +       for (i = 0; i <= mp_maxid; i++) { > +               if (CPU_ABSENT(i)) > +                       continue; > +               rss_ncpus++; > +       } > +       if (rss_ncpus > RSS_MAXCPUS) > +               rss_ncpus = RSS_MAXCPUS; > + > +       /* > +        * Tune RSS table entries to be no less than 2x the > number of CPUs > +        * -- unless we're running uniprocessor, in which case > there's not > +        * much point in having buckets to rearrange for > load-balancing! > +        */ > +       if (rss_ncpus > 1) { > +               if (rss_bits == 0) > +                       rss_bits = fls(rss_ncpus - 1) + 1; > + > +               /* > +                * Microsoft limits RSS table entries to 128, so > apply that > +                * limit to both auto-detected CPU counts and > user-configured > +                * ones. > +                */ > +               if (rss_bits == 0 || rss_bits > RSS_MAXBITS) { > +                       printf("%s: RSS bits %u not valid, > coercing to  %u", > +                           __func__, rss_bits, RSS_MAXBITS); > +                       rss_bits = RSS_MAXBITS; > +               } > + > +               /* > +                * Figure out how many buckets to use; warn if > less than the > +                * number of configured CPUs, although this is > not a fatal > +                * problem. > +                */ > +               rss_buckets = (1 << rss_bits); > +               if (rss_buckets < rss_ncpus) > +                       printf("%s: WARNING: rss_buckets (%u) > less than " > +                           "rss_ncpus (%u)\n", __func__, > rss_buckets, > +                           rss_ncpus); > +               rss_mask = rss_buckets - 1; > +       } else { > +               rss_bits = 0; > +               rss_buckets = 1; > +               rss_mask = 0; > +       } > + > +       /* > +        * Set up initial CPU assignments: round-robin by > default. > +        * > +        * XXXRW: Need a mapping to non-contiguous IDs here. > +        */ > +       for (i = 0; i < rss_buckets; i++) > +               rss_table[i].rte_cpu = i % rss_ncpus; > + > +       /* > +        * Randomize rrs_key. > +        * > +        * XXXRW: Not yet.  If nothing else, will require an > rss_isbadkey() > +        * loop to check for "bad" RSS keys. > +        */ > +} > +SYSINIT(rss_init, SI_SUB_SOFTINTR, SI_ORDER_SECOND, rss_init, > NULL); > + > +static uint32_t > +rss_naive_hash(u_int keylen, const uint8_t *key, u_int datalen, > +    const uint8_t *data) > +{ > +       uint32_t v; > +       u_int i; > + > +       v = 0; > +       for (i = 0; i < keylen; i++) > +               v += key[i]; > +       for (i = 0; i < datalen; i++) > +               v += data[i]; > +       return (v); > +} > + > +static uint32_t > +rss_hash(u_int datalen, const uint8_t *data) > +{ > + > +       switch (rss_hashalgo) { > +       case RSS_HASH_TOEPLITZ: > +               return (toeplitz_hash(sizeof(rss_key), rss_key, > datalen, > +                   data)); > + > +       case RSS_HASH_NAIVE: > +               return (rss_naive_hash(sizeof(rss_key), rss_key, > datalen, > +                   data)); > + > +       default: > +               panic("%s: unsupported/unknown hashalgo %d", > __func__, > +                   rss_hashalgo); > +       } > +} > + > +/* > + * Hash an IPv4 2-tuple. > + */ > +uint32_t > +rss_hash_ip4_2tuple(struct in_addr src, struct in_addr dst) > +{ > +       uint8_t data[sizeof(src) + sizeof(dst)]; > +       u_int datalen; > + > +       datalen = 0; > +       bcopy(&src, &data[datalen], sizeof(src)); > +       datalen += sizeof(src); > +       bcopy(&dst, &data[datalen], sizeof(dst)); > +       datalen += sizeof(dst); > +       return (rss_hash(datalen, data)); > +} > + > +/* > + * Hash an IPv4 4-tuple. > + */ > +uint32_t > +rss_hash_ip4_4tuple(struct in_addr src, u_short srcport, struct > in_addr dst, > +    u_short dstport) > +{ > +       uint8_t data[sizeof(src) + sizeof(dst) + sizeof(srcport) > + > +           sizeof(dstport)]; > +       u_int datalen; > + > +       datalen = 0; > +       bcopy(&src, &data[datalen], sizeof(src)); > +       datalen += sizeof(src); > +       bcopy(&dst, &data[datalen], sizeof(dst)); > +       datalen += sizeof(dst); > +       bcopy(&srcport, &data[datalen], sizeof(srcport)); > +       datalen += sizeof(srcport); > +       bcopy(&dstport, &data[datalen], sizeof(dstport)); > +       datalen += sizeof(dstport); > +       return (rss_hash(datalen, data)); > +} > + > +#ifdef INET6 > +/* > + * Hash an IPv6 2-tuple. > + */ > +uint32_t > +rss_hash_ip6_2tuple(struct in6_addr src, struct in6_addr dst) > +{ > +       uint8_t data[sizeof(src) + sizeof(dst)]; > +       u_int datalen; > + > +       datalen = 0; > +       bcopy(&src, &data[datalen], sizeof(src)); > +       datalen += sizeof(src); > +       bcopy(&dst, &data[datalen], sizeof(dst)); > +       datalen += sizeof(dst); > +       return (rss_hash(datalen, data)); > +} > + > +/* > + * Hash an IPv6 4-tuple. > + */ > +uint32_t > +rss_hash_ip6_4tuple(struct in6_addr src, u_short srcport, > +    struct in6_addr dst, u_short dstport) > +{ > +       uint8_t data[sizeof(src) + sizeof(dst) + sizeof(srcport) > + > +           sizeof(dstport)]; > +       u_int datalen; > + > +       datalen = 0; > +       bcopy(&src, &data[datalen], sizeof(src)); > +       datalen += sizeof(src); > +       bcopy(&dst, &data[datalen], sizeof(dst)); > +       datalen += sizeof(dst); > +       bcopy(&srcport, &data[datalen], sizeof(srcport)); > +       datalen += sizeof(srcport); > +       bcopy(&dstport, &data[datalen], sizeof(dstport)); > +       datalen += sizeof(dstport); > +       return (rss_hash(datalen, data)); > +} > +#endif /* INET6 */ > + > +/* > + * Query the number of RSS bits in use. > + */ > +u_int > +rss_getbits(void) > +{ > + > +       return (rss_bits); > +} > + > +/* > + * Query the RSS bucket associated with an RSS hash. > + */ > +u_int > +rss_getbucket(u_int hash) > +{ > + > +       return (hash & rss_mask); > +} > + > +/* > + * Query the RSS CPU associated with an RSS bucket. > + */ > +u_int > +rss_getcpu(u_int bucket) > +{ > + > +       return (rss_table[bucket].rte_cpu); > +} > + > +/* > + * netisr CPU affinity lookup routine for use by protocols. > + */ > +struct mbuf * > +rss_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid) > +{ > + > +       M_ASSERTPKTHDR(m); > + > +       switch (M_HASHTYPE_GET(m)) { > +       case M_HASHTYPE_RSS_IPV4: > +       case M_HASHTYPE_RSS_TCP_IPV4: > +               *cpuid = > rss_getcpu(rss_getbucket(m->m_pkthdr.flowid)); > +               return (m); > + > +       default: > +               *cpuid = NETISR_CPUID_NONE; > +               return (m); > +       } > +} > + > +/* > + * Query the RSS hash algorithm. > + */ > +u_int > +rss_gethashalgo(void) > +{ > + > +       return (rss_hashalgo); > +} > + > +/* > + * Query the current RSS key; likely to be used by device > drivers when > + * configuring hardware RSS.  Caller must pass an array of size > RSS_KEYSIZE. > + * > + * XXXRW: Perhaps we should do the accept-a-length-and-truncate > thing? > + */ > +void > +rss_getkey(uint8_t *key) > +{ > + > +       bcopy(rss_key, key, sizeof(rss_key)); > +} > + > +/* > + * Query the number of buckets; this may be used by both > network device > + * drivers, which will need to populate hardware shadows of the > software > + * indirection table, and the network stack itself (such as > when deciding how > + * many connection groups to allocate). > + */ > +u_int > +rss_getnumbuckets(void) > +{ > + > +       return (rss_buckets); > +} > + > +/* > + * Query the number of CPUs in use by RSS; may be useful to > device drivers > + * trying to figure out how to map a larger number of CPUs into > a smaller > + * number of receive queues. > + */ > +u_int > +rss_getnumcpus(void) > +{ > + > +       return (rss_ncpus); > +} > + > +/* > + * XXXRW: Confirm that sysctl -a won't dump this keying > material, don't want > + * it appearing in debugging output unnecessarily. > + */ > +static int > +sysctl_rss_key(SYSCTL_HANDLER_ARGS) > +{ > +       uint8_t temp_rss_key[RSS_KEYSIZE]; > +       int error; > + > +       error = priv_check(req->td, PRIV_NETINET_HASHKEY); > +       if (error) > +               return (error); > + > +       bcopy(rss_key, temp_rss_key, sizeof(temp_rss_key)); > +       error = sysctl_handle_opaque(oidp, temp_rss_key, > +           sizeof(temp_rss_key), req); > +       if (error) > +               return (error); > +       if (req->newptr != NULL) { > +               /* XXXRW: Not yet. */ > +               return (EINVAL); > +       } > +       return (0); > +} > +SYSCTL_PROC(_net_inet_rss, OID_AUTO, key, > +    CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, > sysctl_rss_key, > +    "", "RSS keying material"); > > Added: head/sys/netinet/in_rss.h > =========================================================================== > === > --- /dev/null   00:00:00 1970   (empty, because file is newly > added) > +++ head/sys/netinet/in_rss.h   Sat Mar 15 00:57:50 2014       >  (r263198) > @@ -0,0 +1,94 @@ > +/*- > + * Copyright (c) 2010-2011 Juniper Networks, Inc. > + * All rights reserved. > + * > + * This software was developed by Robert N. M. Watson under > contract > + * to Juniper Networks, Inc. > + * > + * Redistribution and use in source and binary forms, with or > without > + * modification, are permitted provided that the following > conditions > + * are met: > + * 1. Redistributions of source code must retain the above > copyright > + *    notice, this list of conditions and the following > disclaimer. > + * 2. Redistributions in binary form must reproduce the above > copyright > + *    notice, this list of conditions and the following > disclaimer in the > + *    documentation and/or other materials provided with the > distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS > ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A > PARTICULAR PURPOSE > + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR > CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef _NETINET_IN_RSS_H_ > +#define        _NETINET_IN_RSS_H_ > + > +#include                /* in_addr_t */ > + > +/* > + * Supported RSS hash functions. > + */ > +#define        RSS_HASH_NAIVE          0x00000001      /* Poor > but fast hash. */ > +#define        RSS_HASH_TOEPLITZ       0x00000002      /* > Required by RSS. */ > +#define        RSS_HASH_CRC32          0x00000004      /* > Future; some NICs do it. */ > + > +#define        RSS_HASH_MASK           (RSS_HASH_NAIVE | > RSS_HASH_TOEPLITZ) > + > +/* > + * Instances of struct inpcbinfo declare an RSS hash type > indicating what > + * header fields are covered. > + */ > +#define        RSS_HASHFIELDS_NONE             0 > +#define        RSS_HASHFIELDS_4TUPLE           1 > +#define        RSS_HASHFIELDS_2TUPLE           2 > + > +/* > + * Compile-time limits on the size of the indirection table. > + */ > +#define        RSS_MAXBITS     7 > +#define        RSS_TABLE_MAXLEN        (1 << RSS_MAXBITS) > + > +/* > + * Maximum key size used throughout.  It's OK for hardware to > use only the > + * first 16 bytes, which is all that's required for IPv4. > + */ > +#define        RSS_KEYSIZE     40 > + > +/* > + * Device driver interfaces to query RSS properties that must > be programmed > + * into hardware. > + */ > +u_int  rss_getbits(void); > +u_int  rss_getbucket(u_int hash); > +u_int  rss_getcpu(u_int bucket); > +void   rss_getkey(uint8_t *key); > +u_int  rss_gethashalgo(void); > +u_int  rss_getnumbuckets(void); > +u_int  rss_getnumcpus(void); > + > +/* > + * Network stack interface to generate a hash for a protocol > tuple. > + */ > +uint32_t       rss_hash_ip4_4tuple(struct in_addr src, u_short > srcport, > +                   struct in_addr dst, u_short dstport); > +uint32_t       rss_hash_ip4_2tuple(struct in_addr src, struct > in_addr dst); > +uint32_t       rss_hash_ip6_4tuple(struct in6_addr src, u_short > srcport, > +                   struct in6_addr dst, u_short dstport); > +uint32_t       rss_hash_ip6_2tuple(struct in6_addr src, > +                   struct in6_addr dst); > + > +/* > + * Network stack interface to query desired CPU affinity of a > packet. > + */ > +struct mbuf    *rss_m2cpuid(struct mbuf *m, uintptr_t source, > u_int *cpuid); > + > +#endif /* !_NETINET_IN_RSS_H_ */ > > Added: head/sys/netinet/toeplitz.c > =========================================================================== > === > --- /dev/null   00:00:00 1970   (empty, because file is newly > added) > +++ head/sys/netinet/toeplitz.c Sat Mar 15 00:57:50 2014       >  (r263198) > @@ -0,0 +1,58 @@ > +/*- > + * Copyright (c) 2010 David Malone > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or > without > + * modification, are permitted provided that the following > conditions > + * are met: > + * 1. Redistributions of source code must retain the above > copyright > + *    notice, this list of conditions and the following > disclaimer. > + * 2. Redistributions in binary form must reproduce the above > copyright > + *    notice, this list of conditions and the following > disclaimer in the > + *    documentation and/or other materials provided with the > distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS > ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A > PARTICULAR PURPOSE > + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR > CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS > INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > + > +#include > +#include > + > +#include > + > +uint32_t > +toeplitz_hash(u_int keylen, const uint8_t *key, u_int datalen, > +    const uint8_t *data) > +{ > +       uint32_t hash = 0, v; > +       u_int i, b; > + > +       /* XXXRW: Perhaps an assertion about key length vs. data > length? */ > + > +       v = (key[0]<<24) + (key[1]<<16) + (key[2] <<8) + key[3]; > +       for (i = 0; i < datalen; i++) { > +               for (b = 0; b < 8; b++) { > +                       if (data[i] & (1<<(7-b))) > +                               hash ^= v; > +                       v <<= 1; > +                       if ((i + 4) < RSS_KEYSIZE && > +                           (key[i+4] & (1<<(7-b)))) > +                               v |= 1; > +               } > +       } > +       return (hash); > +} > > Added: head/sys/netinet/toeplitz.h > =========================================================================== > === > --- /dev/null   00:00:00 1970   (empty, because file is newly > added) > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > > From owner-svn-src-head@FreeBSD.ORG Sat Mar 15 14:58:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B10CCC4; Sat, 15 Mar 2014 14:58:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 16BAB112; Sat, 15 Mar 2014 14:58:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2FEwnN7028621; Sat, 15 Mar 2014 14:58:49 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2FEwnxg028616; Sat, 15 Mar 2014 14:58:49 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201403151458.s2FEwnxg028616@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 15 Mar 2014 14:58:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263206 - in head/bin: kill sh sh/bltin sh/tests/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 14:58:50 -0000 Author: jilles Date: Sat Mar 15 14:58:48 2014 New Revision: 263206 URL: http://svnweb.freebsd.org/changeset/base/263206 Log: sh: Allow kill %job on jobs started without job control. When killing a %job started without job control, kill all processes in it. As with process groups and zombies, if any process in the job can be killed or has already terminated, the command is successful. This also fixes occasional failures of the builtins/kill1.0 test. Added: head/bin/sh/tests/builtins/kill2.0 (contents, props changed) Modified: head/bin/kill/kill.c head/bin/sh/bltin/bltin.h head/bin/sh/jobs.c head/bin/sh/tests/builtins/Makefile Modified: head/bin/kill/kill.c ============================================================================== --- head/bin/kill/kill.c Sat Mar 15 10:26:13 2014 (r263205) +++ head/bin/kill/kill.c Sat Mar 15 14:58:48 2014 (r263206) @@ -67,7 +67,7 @@ static void usage(void); int main(int argc, char *argv[]) { - int errors, numsig, pid; + int errors, numsig, pid, ret; char *ep; if (argc < 2) @@ -133,22 +133,17 @@ main(int argc, char *argv[]) for (errors = 0; argc; argc--, argv++) { #ifdef SHELL - if (**argv == '%') { - pid = getjobpgrp(*argv); - /* - * Silently ignore terminated jobs, like the kernel - * silently ignores zombies. - */ - if (pid == 0) - continue; - } else + if (**argv == '%') + ret = killjob(*argv, numsig); + else #endif { pid = strtol(*argv, &ep, 10); if (!**argv || *ep) errx(2, "illegal process id: %s", *argv); + ret = kill(pid, numsig); } - if (kill(pid, numsig) == -1) { + if (ret == -1) { warn("%s", *argv); errors = 1; } Modified: head/bin/sh/bltin/bltin.h ============================================================================== --- head/bin/sh/bltin/bltin.h Sat Mar 15 10:26:13 2014 (r263205) +++ head/bin/sh/bltin/bltin.h Sat Mar 15 14:58:48 2014 (r263206) @@ -74,6 +74,6 @@ pointer stalloc(int); void error(const char *, ...) __printf0like(1, 2); -pid_t getjobpgrp(char *); +int killjob(const char *, int); extern char *commandname; Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sat Mar 15 10:26:13 2014 (r263205) +++ head/bin/sh/jobs.c Sat Mar 15 14:58:48 2014 (r263206) @@ -95,9 +95,9 @@ static void restartjob(struct job *); #endif static void freejob(struct job *); static int waitcmdloop(struct job *); -pid_t getjobpgrp(char *); static struct job *getjob_nonotfound(const char *); static struct job *getjob(const char *); +pid_t killjob(const char *, int); static pid_t dowait(int, struct job *); static void checkzombies(void); static void cmdtxt(union node *); @@ -639,15 +639,26 @@ getjob(const char *name) } -pid_t -getjobpgrp(char *name) +int +killjob(const char *name, int sig) { struct job *jp; + int i, ret; jp = getjob(name); if (jp->state == JOBDONE) return 0; - return -jp->ps[0].pid; + if (jp->jobctl) + return kill(-jp->ps[0].pid, sig); + ret = -1; + errno = ESRCH; + for (i = 0; i < jp->nprocs; i++) + if (jp->ps[i].status == -1 || WIFSTOPPED(jp->ps[i].status)) { + if (kill(jp->ps[i].pid, sig) == 0) + ret = 0; + } else + ret = 0; + return ret; } /* Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Sat Mar 15 10:26:13 2014 (r263205) +++ head/bin/sh/tests/builtins/Makefile Sat Mar 15 14:58:48 2014 (r263206) @@ -86,7 +86,7 @@ FILES+= hash3.0 hash3.0.stdout FILES+= hash4.0 FILES+= jobid1.0 FILES+= jobid2.0 -FILES+= kill1.0 +FILES+= kill1.0 kill2.0 FILES+= lineno.0 lineno.0.stdout FILES+= lineno2.0 FILES+= local1.0 Added: head/bin/sh/tests/builtins/kill2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/kill2.0 Sat Mar 15 14:58:48 2014 (r263206) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +sleep 1 | sleep 1 & +kill %+ +wait "$!" +r=$? +[ "$r" -gt 128 ] && [ "$(kill -l "$r")" = TERM ] From owner-svn-src-head@FreeBSD.ORG Sat Mar 15 16:59:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88BED953; Sat, 15 Mar 2014 16:59:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 761D3D56; Sat, 15 Mar 2014 16:59:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2FGxwmI079543; Sat, 15 Mar 2014 16:59:58 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2FGxwbi079542; Sat, 15 Mar 2014 16:59:58 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403151659.s2FGxwbi079542@svn.freebsd.org> From: Warner Losh Date: Sat, 15 Mar 2014 16:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263207 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 16:59:58 -0000 Author: imp Date: Sat Mar 15 16:59:57 2014 New Revision: 263207 URL: http://svnweb.freebsd.org/changeset/base/263207 Log: Fix wandboard to include tmpfs, mbr and bsd labels. PR: 187606 Submitted by: Takanori Sawada Modified: head/sys/arm/conf/WANDBOARD.common Modified: head/sys/arm/conf/WANDBOARD.common ============================================================================== --- head/sys/arm/conf/WANDBOARD.common Sat Mar 15 14:58:48 2014 (r263206) +++ head/sys/arm/conf/WANDBOARD.common Sat Mar 15 16:59:57 2014 (r263207) @@ -35,10 +35,13 @@ options NFSCL # New Network Filesyst #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization options KTRACE # ktrace(1) support From owner-svn-src-head@FreeBSD.ORG Sat Mar 15 17:29:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A7FC1F7; Sat, 15 Mar 2014 17:29:39 +0000 (UTC) Received: from mail-qc0-x236.google.com (mail-qc0-x236.google.com [IPv6:2607:f8b0:400d:c01::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B701FFCF; Sat, 15 Mar 2014 17:29:38 +0000 (UTC) Received: by mail-qc0-f182.google.com with SMTP id e16so4343157qcx.13 for ; Sat, 15 Mar 2014 10:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=0AvYOQ3FQONXbqWsz1fQD/L/w7xIV2qK0XzjUevjzug=; b=jTT4AKNnYQZ9IXDMdtLwhYEvxZ4ynqxwDTVMV4ZUDjxhGr9qtIO2K6J0oNCRw/wS0z jZErNeBKchQMdTcgwK6qxRxDIiRhcf6OHiUs6+pQTrSlRiMtSAhf3XT+HUzcri7EYJTl 4dxHpiQPXx+G4Tl3fHF1RPAHv15aIx6sPtKZQeI9H4cdVD2+mO78HiLV4p7sjTWQcKeS X3s7WA0wxyNyuIo4ylD5aO6Uqt4WYDHCMsb3lU6y8aqApARHvjQTNvsngVK2XmjHZKLC wSaJZ5bQ8lgrSW7AwJNhUyKG7J6jwVO+gkmVXbPjAjHktEgg7m7LflpLh3ttD/jeZim/ qvvA== MIME-Version: 1.0 X-Received: by 10.140.42.138 with SMTP id c10mr16955281qga.24.1394904577889; Sat, 15 Mar 2014 10:29:37 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.8.137 with HTTP; Sat, 15 Mar 2014 10:29:37 -0700 (PDT) In-Reply-To: References: <201403150057.s2F0vofg081606@svn.freebsd.org> Date: Sat, 15 Mar 2014 10:29:37 -0700 X-Google-Sender-Auth: h1QcGas3Pmlx2Pp_m8kf1fuVXHE Message-ID: Subject: Re: svn commit: r263198 - in head/sys: amd64/conf conf net netinet netinet6 sys From: Adrian Chadd To: Robert Watson Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 17:29:39 -0000 On 15 March 2014 05:03, Robert Watson wrote: > On Fri, 14 Mar 2014, Adrian Chadd wrote: > >> Woo! Thanks! > > > I'd characterise this work as "early" in that it would benefit from > performance optimisation, device-driver work, and feature enhancement (e.g., > not just stuff like load rebalancing, but also statistics to detect RSS > configuration problems leading to work being directed to the wrong CPU, > etc). In any case, hopefully this is a useful starting point for people > doing work in this space. Yup. I have a bunch of diagnostics and statistics to add to ensure things are staying on the right CPU. I'll spin them up on netperf soon and dive into UDP testing/fixing. -a From owner-svn-src-head@FreeBSD.ORG Sat Mar 15 17:33:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4FE3492; Sat, 15 Mar 2014 17:33:27 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id B8EFDCA; Sat, 15 Mar 2014 17:33:27 +0000 (UTC) Received: from [10.108.26.30] (unknown [46.233.116.87]) by cyrus.watson.org (Postfix) with ESMTPSA id 2FA9646B0C; Sat, 15 Mar 2014 13:33:24 -0400 (EDT) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263198 - in head/sys: amd64/conf conf net netinet netinet6 sys From: "Robert N. M. Watson" In-Reply-To: Date: Sat, 15 Mar 2014 17:33:22 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <33030492-A1A3-4A00-B2B3-66B9B2DFB461@FreeBSD.org> References: <201403150057.s2F0vofg081606@svn.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1874) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 17:33:28 -0000 On 15 Mar 2014, at 17:29, Adrian Chadd wrote: >> I'd characterise this work as "early" in that it would benefit from >> performance optimisation, device-driver work, and feature enhancement = (e.g., >> not just stuff like load rebalancing, but also statistics to detect = RSS >> configuration problems leading to work being directed to the wrong = CPU, >> etc). In any case, hopefully this is a useful starting point for = people >> doing work in this space. >=20 > Yup. I have a bunch of diagnostics and statistics to add to ensure > things are staying on the right CPU. >=20 > I'll spin them up on netperf soon and dive into UDP testing/fixing. Excellent -- netstat support for monitoring queue and RSS behaviour is = definitely the next step to run in, here. I'd like to see us extend the = kernel's device-driver independent data structures and statistics to = allow interfaces to expose additional hardware queue = information/statistics as well as higher-level netisr, pcbgroup, and RSS = information. Robert= From owner-svn-src-head@FreeBSD.ORG Sat Mar 15 21:58:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6227D528; Sat, 15 Mar 2014 21:58:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4CE21A1D; Sat, 15 Mar 2014 21:58:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2FLw9JG001191; Sat, 15 Mar 2014 21:58:09 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2FLw7po001183; Sat, 15 Mar 2014 21:58:07 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201403152158.s2FLw7po001183@svn.freebsd.org> From: Andrew Turner Date: Sat, 15 Mar 2014 21:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263210 - head/lib/msun/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 21:58:09 -0000 Author: andrew Date: Sat Mar 15 21:58:07 2014 New Revision: 263210 URL: http://svnweb.freebsd.org/changeset/base/263210 Log: On armv6 access both the softfloat and, when available, the vfp to get and set the floating-point environment. Added: head/lib/msun/arm/fenv-mangle.h (contents, props changed) head/lib/msun/arm/fenv-softfp.c (contents, props changed) head/lib/msun/arm/fenv-vfp.c (contents, props changed) Modified: head/lib/msun/arm/Makefile.inc head/lib/msun/arm/Symbol.map head/lib/msun/arm/fenv.c head/lib/msun/arm/fenv.h Modified: head/lib/msun/arm/Makefile.inc ============================================================================== --- head/lib/msun/arm/Makefile.inc Sat Mar 15 18:20:39 2014 (r263209) +++ head/lib/msun/arm/Makefile.inc Sat Mar 15 21:58:07 2014 (r263210) @@ -2,3 +2,8 @@ LDBL_PREC = 53 SYM_MAPS += ${.CURDIR}/arm/Symbol.map + +.if ${TARGET_ARCH} == "armv6" +ARCH_SRCS = fenv-softfp.c fenv-vfp.c +.endif + Modified: head/lib/msun/arm/Symbol.map ============================================================================== --- head/lib/msun/arm/Symbol.map Sat Mar 15 18:20:39 2014 (r263209) +++ head/lib/msun/arm/Symbol.map Sat Mar 15 21:58:07 2014 (r263210) @@ -15,4 +15,7 @@ FBSD_1.3 { fegetenv; feholdexcept; feupdateenv; + feenableexcept; + fedisableexcept; + fegetexcept; }; Added: head/lib/msun/arm/fenv-mangle.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/arm/fenv-mangle.h Sat Mar 15 21:58:07 2014 (r263210) @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2013 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifdef _FENV_MANGLE_H_ +#error Only include fenv-mangle.h once +#endif + +#define _FENV_MANGLE_H_ + +#ifndef FENV_MANGLE +#error FENV_MANGLE is undefined +#endif + +#define feclearexcept FENV_MANGLE(feclearexcept) +#define fegetexceptflag FENV_MANGLE(fegetexceptflag) +#define fesetexceptflag FENV_MANGLE(fesetexceptflag) +#define feraiseexcept FENV_MANGLE(feraiseexcept) +#define fetestexcept FENV_MANGLE(fetestexcept) +#define fegetround FENV_MANGLE(fegetround) +#define fesetround FENV_MANGLE(fesetround) +#define fegetenv FENV_MANGLE(fegetenv) +#define feholdexcept FENV_MANGLE(feholdexcept) +#define fesetenv FENV_MANGLE(fesetenv) +#define feupdateenv FENV_MANGLE(feupdateenv) +#define feenableexcept FENV_MANGLE(feenableexcept) +#define fedisableexcept FENV_MANGLE(fedisableexcept) +#define fegetexcept FENV_MANGLE(fegetexcept) + Added: head/lib/msun/arm/fenv-softfp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/arm/fenv-softfp.c Sat Mar 15 21:58:07 2014 (r263210) @@ -0,0 +1,32 @@ +/*- + * Copyright (c) 2013 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define FENV_MANGLE(x) __softfp_ ##x +#include "fenv-mangle.h" +#include "fenv.c" + Added: head/lib/msun/arm/fenv-vfp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/arm/fenv-vfp.c Sat Mar 15 21:58:07 2014 (r263210) @@ -0,0 +1,33 @@ +/*- + * Copyright (c) 2013 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define FENV_MANGLE(x) __vfp_ ##x +#include "fenv-mangle.h" +#define __ARM_PCS_VFP +#include "fenv.c" + Modified: head/lib/msun/arm/fenv.c ============================================================================== --- head/lib/msun/arm/fenv.c Sat Mar 15 18:20:39 2014 (r263209) +++ head/lib/msun/arm/fenv.c Sat Mar 15 21:58:07 2014 (r263210) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2004 David Schultz + * Copyright (c) 2013 Andrew Turner * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,11 +30,30 @@ #define __fenv_static #include "fenv.h" +/* When SOFTFP_ABI is defined we are using the softfp ABI. */ +#if defined(__VFP_FP__) && !defined(__ARM_PCS_VFP) +#define SOFTFP_ABI +#endif + + +#ifndef FENV_MANGLE +/* + * Hopefully the system ID byte is immutable, so it's valid to use + * this as a default environment. + */ +const fenv_t __fe_dfl_env = 0; +#endif + + +/* If this is a non-mangled softfp version special processing is required */ +#if defined(FENV_MANGLE) || !defined(SOFTFP_ABI) + /* * The following macros map between the softfloat emulator's flags and * the hardware's FPSR. The hardware this file was written for doesn't * have rounding control bits, so we stick those in the system ID byte. */ +#ifndef __ARM_PCS_VFP #define __set_env(env, flags, mask, rnd) env = ((flags) \ | (mask)<<_FPUSW_SHIFT \ | (rnd) << 24) @@ -42,17 +62,12 @@ & FE_ALL_EXCEPT) #define __env_round(env) (((env) >> 24) & _ROUND_MASK) #include "fenv-softfloat.h" +#endif #ifdef __GNUC_GNU_INLINE__ #error "This file must be compiled with C99 'inline' semantics" #endif -/* - * Hopefully the system ID byte is immutable, so it's valid to use - * this as a default environment. - */ -const fenv_t __fe_dfl_env = 0; - extern inline int feclearexcept(int __excepts); extern inline int fegetexceptflag(fexcept_t *__flagp, int __excepts); extern inline int fesetexceptflag(const fexcept_t *__flagp, int __excepts); @@ -64,3 +79,233 @@ extern inline int fegetenv(fenv_t *__env extern inline int feholdexcept(fenv_t *__envp); extern inline int fesetenv(const fenv_t *__envp); extern inline int feupdateenv(const fenv_t *__envp); +extern inline int feenableexcept(int __mask); +extern inline int fedisableexcept(int __mask); +extern inline int fegetexcept(void); + +#else /* !FENV_MANGLE && SOFTFP_ABI */ +/* Set by libc when the VFP unit is enabled */ +extern int _libc_arm_fpu_present; + +int __softfp_feclearexcept(int __excepts); +int __softfp_fegetexceptflag(fexcept_t *__flagp, int __excepts); +int __softfp_fesetexceptflag(const fexcept_t *__flagp, int __excepts); +int __softfp_feraiseexcept(int __excepts); +int __softfp_fetestexcept(int __excepts); +int __softfp_fegetround(void); +int __softfp_fesetround(int __round); +int __softfp_fegetenv(fenv_t *__envp); +int __softfp_feholdexcept(fenv_t *__envp); +int __softfp_fesetenv(const fenv_t *__envp); +int __softfp_feupdateenv(const fenv_t *__envp); +int __softfp_feenableexcept(int __mask); +int __softfp_fedisableexcept(int __mask); +int __softfp_fegetexcept(void); + +int __vfp_feclearexcept(int __excepts); +int __vfp_fegetexceptflag(fexcept_t *__flagp, int __excepts); +int __vfp_fesetexceptflag(const fexcept_t *__flagp, int __excepts); +int __vfp_feraiseexcept(int __excepts); +int __vfp_fetestexcept(int __excepts); +int __vfp_fegetround(void); +int __vfp_fesetround(int __round); +int __vfp_fegetenv(fenv_t *__envp); +int __vfp_feholdexcept(fenv_t *__envp); +int __vfp_fesetenv(const fenv_t *__envp); +int __vfp_feupdateenv(const fenv_t *__envp); +int __vfp_feenableexcept(int __mask); +int __vfp_fedisableexcept(int __mask); +int __vfp_fegetexcept(void); + +static int +__softfp_round_to_vfp(int round) +{ + + switch (round) { + case FE_TONEAREST: + default: + return VFP_FE_TONEAREST; + case FE_TOWARDZERO: + return VFP_FE_TOWARDZERO; + case FE_UPWARD: + return VFP_FE_UPWARD; + case FE_DOWNWARD: + return VFP_FE_DOWNWARD; + } +} + +static int +__softfp_round_from_vfp(int round) +{ + + switch (round) { + case VFP_FE_TONEAREST: + default: + return FE_TONEAREST; + case VFP_FE_TOWARDZERO: + return FE_TOWARDZERO; + case VFP_FE_UPWARD: + return FE_UPWARD; + case VFP_FE_DOWNWARD: + return FE_DOWNWARD; + } +} + +int feclearexcept(int __excepts) +{ + + if (_libc_arm_fpu_present) + __vfp_feclearexcept(__excepts); + __softfp_feclearexcept(__excepts); + + return (0); +} + +int fegetexceptflag(fexcept_t *__flagp, int __excepts) +{ + fexcept_t __vfp_flagp; + + __vfp_flagp = 0; + if (_libc_arm_fpu_present) + __vfp_fegetexceptflag(&__vfp_flagp, __excepts); + __softfp_fegetexceptflag(__flagp, __excepts); + + *__flagp |= __vfp_flagp; + + return (0); +} + +int fesetexceptflag(const fexcept_t *__flagp, int __excepts) +{ + + if (_libc_arm_fpu_present) + __vfp_fesetexceptflag(__flagp, __excepts); + __softfp_fesetexceptflag(__flagp, __excepts); + + return (0); +} + +int feraiseexcept(int __excepts) +{ + + if (_libc_arm_fpu_present) + __vfp_feraiseexcept(__excepts); + __softfp_feraiseexcept(__excepts); + + return (0); +} + +int fetestexcept(int __excepts) +{ + int __got_excepts; + + __got_excepts = 0; + if (_libc_arm_fpu_present) + __got_excepts = __vfp_fetestexcept(__excepts); + __got_excepts |= __softfp_fetestexcept(__excepts); + + return (__got_excepts); +} + +int fegetround(void) +{ + + if (_libc_arm_fpu_present) + return __softfp_round_from_vfp(__vfp_fegetround()); + return __softfp_fegetround(); +} + +int fesetround(int __round) +{ + + if (_libc_arm_fpu_present) + __vfp_fesetround(__softfp_round_to_vfp(__round)); + __softfp_fesetround(__round); + + return (0); +} + +int fegetenv(fenv_t *__envp) +{ + fenv_t __vfp_envp; + + __vfp_envp = 0; + if (_libc_arm_fpu_present) + __vfp_fegetenv(&__vfp_envp); + __softfp_fegetenv(__envp); + *__envp |= __vfp_envp; + + return (0); +} + +int feholdexcept(fenv_t *__envp) +{ + fenv_t __vfp_envp; + + __vfp_envp = 0; + if (_libc_arm_fpu_present) + __vfp_feholdexcept(&__vfp_envp); + __softfp_feholdexcept(__envp); + *__envp |= __vfp_envp; + + return (0); +} + +int fesetenv(const fenv_t *__envp) +{ + + if (_libc_arm_fpu_present) + __vfp_fesetenv(__envp); + __softfp_fesetenv(__envp); + + return (0); +} + +int feupdateenv(const fenv_t *__envp) +{ + + if (_libc_arm_fpu_present) + __vfp_feupdateenv(__envp); + __softfp_feupdateenv(__envp); + + return (0); +} + +int feenableexcept(int __mask) +{ + int __unmasked; + + __unmasked = 0; + if (_libc_arm_fpu_present) + __unmasked = __vfp_feenableexcept(__mask); + __unmasked |= __softfp_feenableexcept(__mask); + + return (__unmasked); +} + +int fedisableexcept(int __mask) +{ + int __unmasked; + + __unmasked = 0; + if (_libc_arm_fpu_present) + __unmasked = __vfp_fedisableexcept(__mask); + __unmasked |= __softfp_fedisableexcept(__mask); + + return (__unmasked); +} + +int fegetexcept(void) +{ + int __unmasked; + + __unmasked = 0; + if (_libc_arm_fpu_present) + __unmasked = __vfp_fegetexcept(); + __unmasked |= __softfp_fegetexcept(); + + return (__unmasked); +} + +#endif + Modified: head/lib/msun/arm/fenv.h ============================================================================== --- head/lib/msun/arm/fenv.h Sat Mar 15 18:20:39 2014 (r263209) +++ head/lib/msun/arm/fenv.h Sat Mar 15 21:58:07 2014 (r263210) @@ -54,11 +54,16 @@ typedef __uint32_t fexcept_t; #endif /* Rounding modes */ +#define VFP_FE_TONEAREST 0x00000000 +#define VFP_FE_UPWARD 0x00400000 +#define VFP_FE_DOWNWARD 0x00800000 +#define VFP_FE_TOWARDZERO 0x00c00000 + #ifdef __ARM_PCS_VFP -#define FE_TONEAREST 0x00000000 -#define FE_UPWARD 0x00400000 -#define FE_DOWNWARD 0x00800000 -#define FE_TOWARDZERO 0x00c00000 +#define FE_TONEAREST VFP_FE_TONEAREST +#define FE_UPWARD VFP_FE_UPWARD +#define FE_DOWNWARD VFP_FE_DOWNWARD +#define FE_TOWARDZERO VFP_FE_TOWARDZERO #else #define FE_TONEAREST 0x0000 #define FE_TOWARDZERO 0x0001 @@ -92,6 +97,11 @@ int fegetenv(fenv_t *__envp); int feholdexcept(fenv_t *__envp); int fesetenv(const fenv_t *__envp); int feupdateenv(const fenv_t *__envp); +#if __BSD_VISIBLE +int feenableexcept(int __mask); +int fedisableexcept(int __mask); +int fegetexcept(void); +#endif #else /* __ARM_PCS_VFP */ From owner-svn-src-head@FreeBSD.ORG Sat Mar 15 23:09:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD07B454; Sat, 15 Mar 2014 23:09:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C9CAF06; Sat, 15 Mar 2014 23:09:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2FN9alf029590; Sat, 15 Mar 2014 23:09:36 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2FN9ZWf029583; Sat, 15 Mar 2014 23:09:35 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201403152309.s2FN9ZWf029583@svn.freebsd.org> From: Tycho Nightingale Date: Sat, 15 Mar 2014 23:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263211 - in head/sys/amd64: include vmm vmm/intel vmm/io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 23:09:36 -0000 Author: tychon Date: Sat Mar 15 23:09:34 2014 New Revision: 263211 URL: http://svnweb.freebsd.org/changeset/base/263211 Log: Fix a race wherein the source of an interrupt vector is wrongly attributed if an ExtINT arrives during interrupt injection. Also, fix a spurious interrupt if the PIC tries to raise an interrupt before the outstanding one is accepted. Finally, improve the PIC interrupt latency when another interrupt is raised immediately after the outstanding one is accepted by creating a vmexit rather than waiting for one to occur by happenstance. Approved by: neel (co-mentor) Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/io/vatpic.c head/sys/amd64/vmm/io/vatpic.h head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/io/vlapic_priv.h head/sys/amd64/vmm/vmm.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Sat Mar 15 21:58:07 2014 (r263210) +++ head/sys/amd64/include/vmm.h Sat Mar 15 23:09:34 2014 (r263211) @@ -117,6 +117,9 @@ int vm_run(struct vm *vm, struct vm_run int vm_inject_nmi(struct vm *vm, int vcpu); int vm_nmi_pending(struct vm *vm, int vcpuid); void vm_nmi_clear(struct vm *vm, int vcpuid); +int vm_inject_extint(struct vm *vm, int vcpu); +int vm_extint_pending(struct vm *vm, int vcpuid); +void vm_extint_clear(struct vm *vm, int vcpuid); uint64_t *vm_guest_msrs(struct vm *vm, int cpu); struct vlapic *vm_lapic(struct vm *vm, int cpu); struct vioapic *vm_ioapic(struct vm *vm); Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sat Mar 15 21:58:07 2014 (r263210) +++ head/sys/amd64/vmm/intel/vmx.c Sat Mar 15 23:09:34 2014 (r263211) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include "vmm_msr.h" #include "vmm_ktr.h" #include "vmm_stat.h" +#include "vatpic.h" #include "vlapic.h" #include "vlapic_priv.h" @@ -1144,7 +1145,7 @@ static void vmx_inject_interrupts(struct vmx *vmx, int vcpu, struct vlapic *vlapic) { struct vm_exception exc; - int vector, need_nmi_exiting; + int vector, need_nmi_exiting, extint_pending; uint64_t rflags; uint32_t gi, info; @@ -1196,7 +1197,9 @@ vmx_inject_interrupts(struct vmx *vmx, i vmx_set_nmi_window_exiting(vmx, vcpu); } - if (virtual_interrupt_delivery) { + extint_pending = vm_extint_pending(vmx->vm, vcpu); + + if (!extint_pending && virtual_interrupt_delivery) { vmx_inject_pir(vlapic); return; } @@ -1212,9 +1215,14 @@ vmx_inject_interrupts(struct vmx *vmx, i return; } - /* Ask the local apic for a vector to inject */ - if (!vlapic_pending_intr(vlapic, &vector)) - return; + if (!extint_pending) { + /* Ask the local apic for a vector to inject */ + if (!vlapic_pending_intr(vlapic, &vector)) + return; + } else { + /* Ask the legacy pic for a vector to inject */ + vatpic_pending_intr(vmx->vm, &vector); + } KASSERT(vector >= 32 && vector <= 255, ("invalid vector %d", vector)); @@ -1252,8 +1260,22 @@ vmx_inject_interrupts(struct vmx *vmx, i info |= vector; vmcs_write(VMCS_ENTRY_INTR_INFO, info); - /* Update the Local APIC ISR */ - vlapic_intr_accepted(vlapic, vector); + if (!extint_pending) { + /* Update the Local APIC ISR */ + vlapic_intr_accepted(vlapic, vector); + } else { + vm_extint_clear(vmx->vm, vcpu); + vatpic_intr_accepted(vmx->vm, vector); + + /* + * After we accepted the current ExtINT the PIC may + * have posted another one. If that is the case, set + * the Interrupt Window Exiting execution control so + * we can inject that one too. + */ + if (vm_extint_pending(vmx->vm, vcpu)) + vmx_set_int_window_exiting(vmx, vcpu); + } VCPU_CTR1(vmx->vm, vcpu, "Injecting hwintr at vector %d", vector); Modified: head/sys/amd64/vmm/io/vatpic.c ============================================================================== --- head/sys/amd64/vmm/io/vatpic.c Sat Mar 15 21:58:07 2014 (r263210) +++ head/sys/amd64/vmm/io/vatpic.c Sat Mar 15 23:09:34 2014 (r263211) @@ -82,6 +82,8 @@ struct vatpic { struct mtx mtx; struct atpic atpic[2]; uint8_t elc[2]; + + bool intr_raised; }; #define VATPIC_CTR0(vatpic, fmt) \ @@ -148,6 +150,9 @@ vatpic_notify_intr(struct vatpic *vatpic KASSERT(VATPIC_LOCKED(vatpic), ("vatpic_notify_intr not locked")); + if (vatpic->intr_raised == true) + return; + /* XXX master only */ atpic = &vatpic->atpic[0]; @@ -155,8 +160,32 @@ vatpic_notify_intr(struct vatpic *vatpic VATPIC_CTR4(vatpic, "atpic notify pin = %d " "(imr 0x%x irr 0x%x isr 0x%x)", pin, atpic->mask, atpic->request, atpic->service); + + /* + * PIC interrupts are routed to both the Local APIC + * and the I/O APIC to support operation in 1 of 3 + * modes. + * + * 1. Legacy PIC Mode: the PIC effectively bypasses + * all APIC components. In mode '1' the local APIC is + * disabled and LINT0 is reconfigured as INTR to + * deliver the PIC interrupt directly to the CPU. + * + * 2. Virtual Wire Mode: the APIC is treated as a + * virtual wire which delivers interrupts from the PIC + * to the CPU. In mode '2' LINT0 is programmed as + * ExtINT to indicate that the PIC is the source of + * the interrupt. + * + * 3. Symmetric I/O Mode: PIC interrupts are fielded + * by the I/O APIC and delivered to the appropriate + * CPU. In mode '3' the I/O APIC input 0 is + * programmed as ExtINT to indicate that the PIC is + * the source of the interrupt. + */ lapic_set_local_intr(vatpic->vm, -1, APIC_LVT_LINT0); vioapic_pulse_irq(vatpic->vm, 0); + vatpic->intr_raised = true; } else { VATPIC_CTR3(vatpic, "atpic no eligible interrupts " "(imr 0x%x irr 0x%x isr 0x%x)", @@ -384,7 +413,7 @@ vatpic_pulse_irq(struct vm *vm, int irq) return (vatpic_set_irqstate(vm, irq, IRQSTATE_PULSE)); } -int +void vatpic_pending_intr(struct vm *vm, int *vecptr) { struct vatpic *vatpic; @@ -405,8 +434,6 @@ vatpic_pending_intr(struct vm *vm, int * *vecptr = atpic->irq_base + pin; VATPIC_UNLOCK(vatpic); - - return (1); } void @@ -422,6 +449,8 @@ vatpic_intr_accepted(struct vm *vm, int atpic = &vatpic->atpic[0]; VATPIC_LOCK(vatpic); + vatpic->intr_raised = false; + pin = vector & 0x7; if (atpic->acnt[pin] == 0) Modified: head/sys/amd64/vmm/io/vatpic.h ============================================================================== --- head/sys/amd64/vmm/io/vatpic.h Sat Mar 15 21:58:07 2014 (r263210) +++ head/sys/amd64/vmm/io/vatpic.h Sat Mar 15 23:09:34 2014 (r263211) @@ -47,7 +47,7 @@ int vatpic_assert_irq(struct vm *vm, int int vatpic_deassert_irq(struct vm *vm, int irq); int vatpic_pulse_irq(struct vm *vm, int irq); -int vatpic_pending_intr(struct vm *vm, int *vecptr); +void vatpic_pending_intr(struct vm *vm, int *vecptr); void vatpic_intr_accepted(struct vm *vm, int vector); #endif /* _VATPIC_H_ */ Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Sat Mar 15 21:58:07 2014 (r263210) +++ head/sys/amd64/vmm/io/vlapic.c Sat Mar 15 23:09:34 2014 (r263211) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include "vlapic.h" #include "vlapic_priv.h" -#include "vatpic.h" #include "vioapic.h" #define PRIO(x) ((x) >> 4) @@ -300,16 +299,6 @@ vlapic_set_intr_ready(struct vlapic *vla return (1); } -static VMM_STAT(VLAPIC_EXTINT_COUNT, "number of ExtINTs received by vlapic"); - -static void -vlapic_deliver_extint(struct vlapic *vlapic) -{ - vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_EXTINT_COUNT, 1); - vlapic->extint_pending = true; - vcpu_notify_event(vlapic->vm, vlapic->vcpuid, false); -} - static __inline uint32_t * vlapic_get_lvtptr(struct vlapic *vlapic, uint32_t offset) { @@ -460,7 +449,7 @@ vlapic_fire_lvt(struct vlapic *vlapic, u vm_inject_nmi(vlapic->vm, vlapic->vcpuid); break; case APIC_LVT_DM_EXTINT: - vlapic_deliver_extint(vlapic); + vm_inject_extint(vlapic->vm, vlapic->vcpuid); break; default: // Other modes ignored @@ -673,7 +662,7 @@ vlapic_trigger_lvt(struct vlapic *vlapic */ switch (vector) { case APIC_LVT_LINT0: - vlapic_deliver_extint(vlapic); + vm_inject_extint(vlapic->vm, vlapic->vcpuid); break; case APIC_LVT_LINT1: vm_inject_nmi(vlapic->vm, vlapic->vcpuid); @@ -1053,13 +1042,6 @@ vlapic_pending_intr(struct vlapic *vlapi int idx, i, bitpos, vector; uint32_t *irrptr, val; - if (vlapic->extint_pending) { - if (vecptr == NULL) - return (1); - else - return (vatpic_pending_intr(vlapic->vm, vecptr)); - } - if (vlapic->ops.pending_intr) return ((*vlapic->ops.pending_intr)(vlapic, vecptr)); @@ -1094,12 +1076,6 @@ vlapic_intr_accepted(struct vlapic *vlap uint32_t *irrptr, *isrptr; int idx, stk_top; - if (vlapic->extint_pending) { - vlapic->extint_pending = false; - vatpic_intr_accepted(vlapic->vm, vector); - return; - } - if (vlapic->ops.intr_accepted) return ((*vlapic->ops.intr_accepted)(vlapic, vector)); @@ -1539,7 +1515,7 @@ vlapic_deliver_intr(struct vm *vm, bool vcpuid--; CPU_CLR(vcpuid, &dmask); if (delmode == IOART_DELEXINT) { - vlapic_deliver_extint(vm_lapic(vm, vcpuid)); + vm_inject_extint(vm, vcpuid); } else { lapic_set_intr(vm, vcpuid, vec, level); } Modified: head/sys/amd64/vmm/io/vlapic_priv.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic_priv.h Sat Mar 15 21:58:07 2014 (r263210) +++ head/sys/amd64/vmm/io/vlapic_priv.h Sat Mar 15 23:09:34 2014 (r263211) @@ -156,8 +156,6 @@ struct vlapic { uint32_t esr_pending; int esr_firing; - bool extint_pending; - struct callout callout; /* vlapic timer */ struct bintime timer_fire_bt; /* callout expiry time */ struct bintime timer_freq_bt; /* timer frequency */ Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Sat Mar 15 21:58:07 2014 (r263210) +++ head/sys/amd64/vmm/vmm.c Sat Mar 15 23:09:34 2014 (r263211) @@ -95,6 +95,7 @@ struct vcpu { struct vm_exit exitinfo; enum x2apic_state x2apic_state; int nmi_pending; + int extint_pending; struct vm_exception exception; int exception_pending; }; @@ -1351,6 +1352,53 @@ vm_nmi_clear(struct vm *vm, int vcpuid) vmm_stat_incr(vm, vcpuid, VCPU_NMI_COUNT, 1); } +static VMM_STAT(VCPU_EXTINT_COUNT, "number of ExtINTs delivered to vcpu"); + +int +vm_inject_extint(struct vm *vm, int vcpuid) +{ + struct vcpu *vcpu; + + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + return (EINVAL); + + vcpu = &vm->vcpu[vcpuid]; + + vcpu->extint_pending = 1; + vcpu_notify_event(vm, vcpuid, false); + return (0); +} + +int +vm_extint_pending(struct vm *vm, int vcpuid) +{ + struct vcpu *vcpu; + + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + panic("vm_extint_pending: invalid vcpuid %d", vcpuid); + + vcpu = &vm->vcpu[vcpuid]; + + return (vcpu->extint_pending); +} + +void +vm_extint_clear(struct vm *vm, int vcpuid) +{ + struct vcpu *vcpu; + + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + panic("vm_extint_pending: invalid vcpuid %d", vcpuid); + + vcpu = &vm->vcpu[vcpuid]; + + if (vcpu->extint_pending == 0) + panic("vm_extint_clear: inconsistent extint_pending state"); + + vcpu->extint_pending = 0; + vmm_stat_incr(vm, vcpuid, VCPU_EXTINT_COUNT, 1); +} + int vm_get_capability(struct vm *vm, int vcpu, int type, int *retval) { From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 00:53:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 172448B9; Sun, 16 Mar 2014 00:53:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EB648942; Sun, 16 Mar 2014 00:53:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2G0rfk9073672; Sun, 16 Mar 2014 00:53:41 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2G0rfmA073668; Sun, 16 Mar 2014 00:53:41 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201403160053.s2G0rfmA073668@svn.freebsd.org> From: John-Mark Gurney Date: Sun, 16 Mar 2014 00:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263214 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 00:53:42 -0000 Author: jmg Date: Sun Mar 16 00:53:40 2014 New Revision: 263214 URL: http://svnweb.freebsd.org/changeset/base/263214 Log: change td_retval into a union w/ off_t, with defines to mask the change... This eliminates a cast, and also forces td_retval (often 2 32-bit registers) to be aligned so that off_t's can be stored there on arches with strict alignment requirements like armeb (AVILA)... On i386, this doesn't change alignment, and on amd64 it doesn't either, as register_t is already 64bits... This will also prevent future breakage due to people adding additional fields to the struct... This gets AVILA booting a bit farther... Reviewed by: bde Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/uipc_shm.c head/sys/kern/vfs_vnops.c head/sys/sys/proc.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sun Mar 16 00:22:07 2014 (r263213) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sun Mar 16 00:53:40 2014 (r263214) @@ -1504,7 +1504,7 @@ freebsd32_lseek(struct thread *td, struc ap.whence = uap->whence; error = sys_lseek(td, &ap); /* Expand the quad return into two parts for eax and edx */ - pos = *(off_t *)(td->td_retval); + pos = td->td_uretoff.tdu_off; td->td_retval[RETVAL_LO] = pos & 0xffffffff; /* %eax */ td->td_retval[RETVAL_HI] = pos >> 32; /* %edx */ return error; Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Sun Mar 16 00:22:07 2014 (r263213) +++ head/sys/kern/uipc_shm.c Sun Mar 16 00:53:40 2014 (r263214) @@ -270,7 +270,7 @@ shm_seek(struct file *fp, off_t offset, if (offset < 0 || offset > shmfd->shm_size) error = EINVAL; else - *(off_t *)(td->td_retval) = offset; + td->td_uretoff.tdu_off = offset; } foffset_unlock(fp, offset, error != 0 ? FOF_NOUPDATE : 0); return (error); Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sun Mar 16 00:22:07 2014 (r263213) +++ head/sys/kern/vfs_vnops.c Sun Mar 16 00:53:40 2014 (r263214) @@ -2080,7 +2080,7 @@ vn_seek(struct file *fp, off_t offset, i if (error != 0) goto drop; VFS_KNOTE_UNLOCKED(vp, 0); - *(off_t *)(td->td_retval) = offset; + td->td_uretoff.tdu_off = offset; drop: foffset_unlock(fp, offset, error != 0 ? FOF_NOUPDATE : 0); return (error); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sun Mar 16 00:22:07 2014 (r263213) +++ head/sys/sys/proc.h Sun Mar 16 00:53:40 2014 (r263214) @@ -300,7 +300,11 @@ struct thread { TDS_RUNQ, TDS_RUNNING } td_state; /* (t) thread state */ - register_t td_retval[2]; /* (k) Syscall aux returns. */ + union { + register_t tdu_retval[2]; + off_t tdu_off; + } td_uretoff; /* (k) Syscall aux returns. */ +#define td_retval td_uretoff.tdu_retval struct callout td_slpcallout; /* (h) Callout for sleep. */ struct trapframe *td_frame; /* (k) */ struct vm_object *td_kstack_obj;/* (a) Kstack object. */ From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 00:57:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23605A1A; Sun, 16 Mar 2014 00:57:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 051CC95B; Sun, 16 Mar 2014 00:57:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2G0vQ16074161; Sun, 16 Mar 2014 00:57:26 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2G0vQEh074159; Sun, 16 Mar 2014 00:57:26 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201403160057.s2G0vQEh074159@svn.freebsd.org> From: John-Mark Gurney Date: Sun, 16 Mar 2014 00:57:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263215 - head/sys/crypto/sha2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 00:57:27 -0000 Author: jmg Date: Sun Mar 16 00:57:26 2014 New Revision: 263215 URL: http://svnweb.freebsd.org/changeset/base/263215 Log: copy these files from lib/libmd in preperation for moving these files into the kernel... Added: head/sys/crypto/sha2/sha256.h - copied unchanged from r263213, head/lib/libmd/sha256.h head/sys/crypto/sha2/sha256c.c - copied unchanged from r263213, head/lib/libmd/sha256c.c Copied: head/sys/crypto/sha2/sha256.h (from r263213, head/lib/libmd/sha256.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/sha2/sha256.h Sun Mar 16 00:57:26 2014 (r263215, copy of r263213, head/lib/libmd/sha256.h) @@ -0,0 +1,50 @@ +/*- + * Copyright 2005 Colin Percival + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SHA256_H_ +#define _SHA256_H_ + +#include + +typedef struct SHA256Context { + uint32_t state[8]; + uint64_t count; + unsigned char buf[64]; +} SHA256_CTX; + +__BEGIN_DECLS +void SHA256_Init(SHA256_CTX *); +void SHA256_Update(SHA256_CTX *, const void *, size_t); +void SHA256_Final(unsigned char [32], SHA256_CTX *); +char *SHA256_End(SHA256_CTX *, char *); +char *SHA256_File(const char *, char *); +char *SHA256_FileChunk(const char *, char *, off_t, off_t); +char *SHA256_Data(const void *, unsigned int, char *); +__END_DECLS + +#endif /* !_SHA256_H_ */ Copied: head/sys/crypto/sha2/sha256c.c (from r263213, head/lib/libmd/sha256c.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/sha2/sha256c.c Sun Mar 16 00:57:26 2014 (r263215, copy of r263213, head/lib/libmd/sha256c.c) @@ -0,0 +1,297 @@ +/*- + * Copyright 2005 Colin Percival + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include + +#include "sha256.h" + +#if BYTE_ORDER == BIG_ENDIAN + +/* Copy a vector of big-endian uint32_t into a vector of bytes */ +#define be32enc_vect(dst, src, len) \ + memcpy((void *)dst, (const void *)src, (size_t)len) + +/* Copy a vector of bytes into a vector of big-endian uint32_t */ +#define be32dec_vect(dst, src, len) \ + memcpy((void *)dst, (const void *)src, (size_t)len) + +#else /* BYTE_ORDER != BIG_ENDIAN */ + +/* + * Encode a length len/4 vector of (uint32_t) into a length len vector of + * (unsigned char) in big-endian form. Assumes len is a multiple of 4. + */ +static void +be32enc_vect(unsigned char *dst, const uint32_t *src, size_t len) +{ + size_t i; + + for (i = 0; i < len / 4; i++) + be32enc(dst + i * 4, src[i]); +} + +/* + * Decode a big-endian length len vector of (unsigned char) into a length + * len/4 vector of (uint32_t). Assumes len is a multiple of 4. + */ +static void +be32dec_vect(uint32_t *dst, const unsigned char *src, size_t len) +{ + size_t i; + + for (i = 0; i < len / 4; i++) + dst[i] = be32dec(src + i * 4); +} + +#endif /* BYTE_ORDER != BIG_ENDIAN */ + +/* Elementary functions used by SHA256 */ +#define Ch(x, y, z) ((x & (y ^ z)) ^ z) +#define Maj(x, y, z) ((x & (y | z)) | (y & z)) +#define SHR(x, n) (x >> n) +#define ROTR(x, n) ((x >> n) | (x << (32 - n))) +#define S0(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22)) +#define S1(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25)) +#define s0(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ SHR(x, 3)) +#define s1(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ SHR(x, 10)) + +/* SHA256 round function */ +#define RND(a, b, c, d, e, f, g, h, k) \ + t0 = h + S1(e) + Ch(e, f, g) + k; \ + t1 = S0(a) + Maj(a, b, c); \ + d += t0; \ + h = t0 + t1; + +/* Adjusted round function for rotating state */ +#define RNDr(S, W, i, k) \ + RND(S[(64 - i) % 8], S[(65 - i) % 8], \ + S[(66 - i) % 8], S[(67 - i) % 8], \ + S[(68 - i) % 8], S[(69 - i) % 8], \ + S[(70 - i) % 8], S[(71 - i) % 8], \ + W[i] + k) + +/* + * SHA256 block compression function. The 256-bit state is transformed via + * the 512-bit input block to produce a new state. + */ +static void +SHA256_Transform(uint32_t * state, const unsigned char block[64]) +{ + uint32_t W[64]; + uint32_t S[8]; + uint32_t t0, t1; + int i; + + /* 1. Prepare message schedule W. */ + be32dec_vect(W, block, 64); + for (i = 16; i < 64; i++) + W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16]; + + /* 2. Initialize working variables. */ + memcpy(S, state, 32); + + /* 3. Mix. */ + RNDr(S, W, 0, 0x428a2f98); + RNDr(S, W, 1, 0x71374491); + RNDr(S, W, 2, 0xb5c0fbcf); + RNDr(S, W, 3, 0xe9b5dba5); + RNDr(S, W, 4, 0x3956c25b); + RNDr(S, W, 5, 0x59f111f1); + RNDr(S, W, 6, 0x923f82a4); + RNDr(S, W, 7, 0xab1c5ed5); + RNDr(S, W, 8, 0xd807aa98); + RNDr(S, W, 9, 0x12835b01); + RNDr(S, W, 10, 0x243185be); + RNDr(S, W, 11, 0x550c7dc3); + RNDr(S, W, 12, 0x72be5d74); + RNDr(S, W, 13, 0x80deb1fe); + RNDr(S, W, 14, 0x9bdc06a7); + RNDr(S, W, 15, 0xc19bf174); + RNDr(S, W, 16, 0xe49b69c1); + RNDr(S, W, 17, 0xefbe4786); + RNDr(S, W, 18, 0x0fc19dc6); + RNDr(S, W, 19, 0x240ca1cc); + RNDr(S, W, 20, 0x2de92c6f); + RNDr(S, W, 21, 0x4a7484aa); + RNDr(S, W, 22, 0x5cb0a9dc); + RNDr(S, W, 23, 0x76f988da); + RNDr(S, W, 24, 0x983e5152); + RNDr(S, W, 25, 0xa831c66d); + RNDr(S, W, 26, 0xb00327c8); + RNDr(S, W, 27, 0xbf597fc7); + RNDr(S, W, 28, 0xc6e00bf3); + RNDr(S, W, 29, 0xd5a79147); + RNDr(S, W, 30, 0x06ca6351); + RNDr(S, W, 31, 0x14292967); + RNDr(S, W, 32, 0x27b70a85); + RNDr(S, W, 33, 0x2e1b2138); + RNDr(S, W, 34, 0x4d2c6dfc); + RNDr(S, W, 35, 0x53380d13); + RNDr(S, W, 36, 0x650a7354); + RNDr(S, W, 37, 0x766a0abb); + RNDr(S, W, 38, 0x81c2c92e); + RNDr(S, W, 39, 0x92722c85); + RNDr(S, W, 40, 0xa2bfe8a1); + RNDr(S, W, 41, 0xa81a664b); + RNDr(S, W, 42, 0xc24b8b70); + RNDr(S, W, 43, 0xc76c51a3); + RNDr(S, W, 44, 0xd192e819); + RNDr(S, W, 45, 0xd6990624); + RNDr(S, W, 46, 0xf40e3585); + RNDr(S, W, 47, 0x106aa070); + RNDr(S, W, 48, 0x19a4c116); + RNDr(S, W, 49, 0x1e376c08); + RNDr(S, W, 50, 0x2748774c); + RNDr(S, W, 51, 0x34b0bcb5); + RNDr(S, W, 52, 0x391c0cb3); + RNDr(S, W, 53, 0x4ed8aa4a); + RNDr(S, W, 54, 0x5b9cca4f); + RNDr(S, W, 55, 0x682e6ff3); + RNDr(S, W, 56, 0x748f82ee); + RNDr(S, W, 57, 0x78a5636f); + RNDr(S, W, 58, 0x84c87814); + RNDr(S, W, 59, 0x8cc70208); + RNDr(S, W, 60, 0x90befffa); + RNDr(S, W, 61, 0xa4506ceb); + RNDr(S, W, 62, 0xbef9a3f7); + RNDr(S, W, 63, 0xc67178f2); + + /* 4. Mix local working variables into global state */ + for (i = 0; i < 8; i++) + state[i] += S[i]; +} + +static unsigned char PAD[64] = { + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/* Add padding and terminating bit-count. */ +static void +SHA256_Pad(SHA256_CTX * ctx) +{ + unsigned char len[8]; + uint32_t r, plen; + + /* + * Convert length to a vector of bytes -- we do this now rather + * than later because the length will change after we pad. + */ + be64enc(len, ctx->count); + + /* Add 1--64 bytes so that the resulting length is 56 mod 64 */ + r = (ctx->count >> 3) & 0x3f; + plen = (r < 56) ? (56 - r) : (120 - r); + SHA256_Update(ctx, PAD, (size_t)plen); + + /* Add the terminating bit-count */ + SHA256_Update(ctx, len, 8); +} + +/* SHA-256 initialization. Begins a SHA-256 operation. */ +void +SHA256_Init(SHA256_CTX * ctx) +{ + + /* Zero bits processed so far */ + ctx->count = 0; + + /* Magic initialization constants */ + ctx->state[0] = 0x6A09E667; + ctx->state[1] = 0xBB67AE85; + ctx->state[2] = 0x3C6EF372; + ctx->state[3] = 0xA54FF53A; + ctx->state[4] = 0x510E527F; + ctx->state[5] = 0x9B05688C; + ctx->state[6] = 0x1F83D9AB; + ctx->state[7] = 0x5BE0CD19; +} + +/* Add bytes into the hash */ +void +SHA256_Update(SHA256_CTX * ctx, const void *in, size_t len) +{ + uint64_t bitlen; + uint32_t r; + const unsigned char *src = in; + + /* Number of bytes left in the buffer from previous updates */ + r = (ctx->count >> 3) & 0x3f; + + /* Convert the length into a number of bits */ + bitlen = len << 3; + + /* Update number of bits */ + ctx->count += bitlen; + + /* Handle the case where we don't need to perform any transforms */ + if (len < 64 - r) { + memcpy(&ctx->buf[r], src, len); + return; + } + + /* Finish the current block */ + memcpy(&ctx->buf[r], src, 64 - r); + SHA256_Transform(ctx->state, ctx->buf); + src += 64 - r; + len -= 64 - r; + + /* Perform complete blocks */ + while (len >= 64) { + SHA256_Transform(ctx->state, src); + src += 64; + len -= 64; + } + + /* Copy left over data into buffer */ + memcpy(ctx->buf, src, len); +} + +/* + * SHA-256 finalization. Pads the input data, exports the hash value, + * and clears the context state. + */ +void +SHA256_Final(unsigned char digest[32], SHA256_CTX * ctx) +{ + + /* Add padding */ + SHA256_Pad(ctx); + + /* Write the hash */ + be32enc_vect(digest, ctx->state, 32); + + /* Clear the context state */ + memset((void *)ctx, 0, sizeof(*ctx)); +} From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 01:17:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E23BCE0; Sun, 16 Mar 2014 01:17:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3AF10AC2; Sun, 16 Mar 2014 01:17:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2G1HArq082248; Sun, 16 Mar 2014 01:17:10 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2G1H9NR082246; Sun, 16 Mar 2014 01:17:09 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201403160117.s2G1H9NR082246@svn.freebsd.org> From: John-Mark Gurney Date: Sun, 16 Mar 2014 01:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263216 - head/share/man/man3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 01:17:10 -0000 Author: jmg Date: Sun Mar 16 01:17:09 2014 New Revision: 263216 URL: http://svnweb.freebsd.org/changeset/base/263216 Log: Xref pthread_cancel... bump Dd, _exit was still dated 1996! yes, it has been modified a few times since then... MFC after: 1 week Modified: head/share/man/man3/pthread_create.3 head/share/man/man3/pthread_exit.3 Modified: head/share/man/man3/pthread_create.3 ============================================================================== --- head/share/man/man3/pthread_create.3 Sun Mar 16 00:57:26 2014 (r263215) +++ head/share/man/man3/pthread_create.3 Sun Mar 16 01:17:09 2014 (r263216) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 4, 2006 +.Dd March 15, 2014 .Dt PTHREAD_CREATE 3 .Os .Sh NAME @@ -118,6 +118,7 @@ is invalid. .Sh SEE ALSO .Xr fork 2 , .Xr pthread_attr 3 , +.Xr pthread_cancel 3 , .Xr pthread_cleanup_pop 3 , .Xr pthread_cleanup_push 3 , .Xr pthread_exit 3 , Modified: head/share/man/man3/pthread_exit.3 ============================================================================== --- head/share/man/man3/pthread_exit.3 Sun Mar 16 00:57:26 2014 (r263215) +++ head/share/man/man3/pthread_exit.3 Sun Mar 16 01:17:09 2014 (r263216) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 1996 +.Dd March 15, 2014 .Dt PTHREAD_EXIT 3 .Os .Sh NAME @@ -97,6 +97,7 @@ None. .Sh SEE ALSO .Xr _exit 2 , .Xr exit 3 , +.Xr pthread_cancel 3 , .Xr pthread_create 3 , .Xr pthread_join 3 .Sh STANDARDS From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 01:17:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E6E6E21; Sun, 16 Mar 2014 01:17:54 +0000 (UTC) Received: from mail-qc0-x235.google.com (mail-qc0-x235.google.com [IPv6:2607:f8b0:400d:c01::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB752AC6; Sun, 16 Mar 2014 01:17:53 +0000 (UTC) Received: by mail-qc0-f181.google.com with SMTP id e9so4458709qcy.26 for ; Sat, 15 Mar 2014 18:17:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=xuBeMC3zNN7pt85OSNwlCN8TAzdYOwH4X16c6P1T3EQ=; b=PiP+FZxCpWSEkkXHIRlAgLXvnXkw/BDs6BiI010+kBCLOjL2Jg/WfEATb/GyhqwETd 6sgRN0+D7amU7rt3fuQCflNnozRPvJpnQy5jx/m3ZqQZ8gqblLusIrFzvUe/DR/9FB4o XY9Nuvq1U4/LESw2z0SHjIuepx77B9y5lp29bRMq3LW8aN2mfnTkvo9znGyptCEO+U1Q s0uMJtL93ff/jepieYm6UPOMfm5BN9ueANs/RfhIt52ZfqMtFTGyOyPZe+SX+C+nfbm+ ZTJw51YUx14JiKUK1f+hyKG92YYYzaDZi8vK/7f/T7xFTWf6htyqU6hpplGZMLgtT67P SK3Q== MIME-Version: 1.0 X-Received: by 10.140.92.6 with SMTP id a6mr18244095qge.34.1394932672879; Sat, 15 Mar 2014 18:17:52 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.8.137 with HTTP; Sat, 15 Mar 2014 18:17:52 -0700 (PDT) In-Reply-To: <201403160053.s2G0rfmA073668@svn.freebsd.org> References: <201403160053.s2G0rfmA073668@svn.freebsd.org> Date: Sat, 15 Mar 2014 18:17:52 -0700 X-Google-Sender-Auth: abn8jKBtfJBt8OfRQPDeQrrIqYA Message-ID: Subject: Re: svn commit: r263214 - in head/sys: compat/freebsd32 kern sys From: Adrian Chadd To: John-Mark Gurney Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 01:17:54 -0000 How far along does it get? -a On 15 March 2014 17:53, John-Mark Gurney wrote: > Author: jmg > Date: Sun Mar 16 00:53:40 2014 > New Revision: 263214 > URL: http://svnweb.freebsd.org/changeset/base/263214 > > Log: > change td_retval into a union w/ off_t, with defines to mask the > change... This eliminates a cast, and also forces td_retval > (often 2 32-bit registers) to be aligned so that off_t's can be > stored there on arches with strict alignment requirements like > armeb (AVILA)... On i386, this doesn't change alignment, and on > amd64 it doesn't either, as register_t is already 64bits... > > This will also prevent future breakage due to people adding additional > fields to the struct... > > This gets AVILA booting a bit farther... > > Reviewed by: bde > > Modified: > head/sys/compat/freebsd32/freebsd32_misc.c > head/sys/kern/uipc_shm.c > head/sys/kern/vfs_vnops.c > head/sys/sys/proc.h > > Modified: head/sys/compat/freebsd32/freebsd32_misc.c > ============================================================================== > --- head/sys/compat/freebsd32/freebsd32_misc.c Sun Mar 16 00:22:07 2014 (r263213) > +++ head/sys/compat/freebsd32/freebsd32_misc.c Sun Mar 16 00:53:40 2014 (r263214) > @@ -1504,7 +1504,7 @@ freebsd32_lseek(struct thread *td, struc > ap.whence = uap->whence; > error = sys_lseek(td, &ap); > /* Expand the quad return into two parts for eax and edx */ > - pos = *(off_t *)(td->td_retval); > + pos = td->td_uretoff.tdu_off; > td->td_retval[RETVAL_LO] = pos & 0xffffffff; /* %eax */ > td->td_retval[RETVAL_HI] = pos >> 32; /* %edx */ > return error; > > Modified: head/sys/kern/uipc_shm.c > ============================================================================== > --- head/sys/kern/uipc_shm.c Sun Mar 16 00:22:07 2014 (r263213) > +++ head/sys/kern/uipc_shm.c Sun Mar 16 00:53:40 2014 (r263214) > @@ -270,7 +270,7 @@ shm_seek(struct file *fp, off_t offset, > if (offset < 0 || offset > shmfd->shm_size) > error = EINVAL; > else > - *(off_t *)(td->td_retval) = offset; > + td->td_uretoff.tdu_off = offset; > } > foffset_unlock(fp, offset, error != 0 ? FOF_NOUPDATE : 0); > return (error); > > Modified: head/sys/kern/vfs_vnops.c > ============================================================================== > --- head/sys/kern/vfs_vnops.c Sun Mar 16 00:22:07 2014 (r263213) > +++ head/sys/kern/vfs_vnops.c Sun Mar 16 00:53:40 2014 (r263214) > @@ -2080,7 +2080,7 @@ vn_seek(struct file *fp, off_t offset, i > if (error != 0) > goto drop; > VFS_KNOTE_UNLOCKED(vp, 0); > - *(off_t *)(td->td_retval) = offset; > + td->td_uretoff.tdu_off = offset; > drop: > foffset_unlock(fp, offset, error != 0 ? FOF_NOUPDATE : 0); > return (error); > > Modified: head/sys/sys/proc.h > ============================================================================== > --- head/sys/sys/proc.h Sun Mar 16 00:22:07 2014 (r263213) > +++ head/sys/sys/proc.h Sun Mar 16 00:53:40 2014 (r263214) > @@ -300,7 +300,11 @@ struct thread { > TDS_RUNQ, > TDS_RUNNING > } td_state; /* (t) thread state */ > - register_t td_retval[2]; /* (k) Syscall aux returns. */ > + union { > + register_t tdu_retval[2]; > + off_t tdu_off; > + } td_uretoff; /* (k) Syscall aux returns. */ > +#define td_retval td_uretoff.tdu_retval > struct callout td_slpcallout; /* (h) Callout for sleep. */ > struct trapframe *td_frame; /* (k) */ > struct vm_object *td_kstack_obj;/* (a) Kstack object. */ > From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 01:22:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAA52FE9; Sun, 16 Mar 2014 01:22:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D79FFB5F; Sun, 16 Mar 2014 01:22:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2G1MNHt085739; Sun, 16 Mar 2014 01:22:23 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2G1MNZf085738; Sun, 16 Mar 2014 01:22:23 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403160122.s2G1MNZf085738@svn.freebsd.org> From: Julio Merino Date: Sun, 16 Mar 2014 01:22:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263217 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 01:22:24 -0000 Author: jmmv Date: Sun Mar 16 01:22:23 2014 New Revision: 263217 URL: http://svnweb.freebsd.org/changeset/base/263217 Log: Document support for TAP-compliant Perl test programs. Modified: head/share/mk/bsd.README Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Sun Mar 16 01:17:09 2014 (r263216) +++ head/share/mk/bsd.README Sun Mar 16 01:22:23 2014 (r263217) @@ -426,11 +426,22 @@ PLAIN_TESTS_CXX The names of the plain ( PLAIN_TESTS_SH The names of the plain (legacy) test programs to build. +TAP_PERL_INTERPRETER + Path to the Perl interpreter to be used for + TAP-compliant test programs that are written in Perl. + Refer to TAP_TESTS_PERL for details. + TAP_TESTS_C The names of the TAP-compliant C test programs to build. TAP_TESTS_CXX The names of the TAP-compliant C++ test programs to build. +TAP_TESTS_PERL The names of the TAP-compliant Perl test programs to + build. The corresponding source files should end with + the .pl extension; the test program is marked as + requiring Perl; and TAP_PERL_INTERPRETER is used in the + built scripts as the interpreter of choice. + TAP_TESTS_SH The names of the TAP-compliant sh test programs to build. From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 01:26:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A20B92F8; Sun, 16 Mar 2014 01:26:11 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5BD2CC46; Sun, 16 Mar 2014 01:26:10 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s2G1QAw8075697 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 15 Mar 2014 18:26:10 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s2G1QAKG075696; Sat, 15 Mar 2014 18:26:10 -0700 (PDT) (envelope-from jmg) Date: Sat, 15 Mar 2014 18:26:09 -0700 From: John-Mark Gurney To: Adrian Chadd Subject: Re: svn commit: r263214 - in head/sys: compat/freebsd32 kern sys Message-ID: <20140316012609.GY32089@funkthat.com> References: <201403160053.s2G0rfmA073668@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Sat, 15 Mar 2014 18:26:10 -0700 (PDT) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 01:26:11 -0000 Adrian Chadd wrote this message on Sat, Mar 15, 2014 at 18:17 -0700: > How far along does it get? It rarely gets to multiuser, and even if it does, it panics very shortly afterward: panic: vm_page_alloc: page 0xc0805db0 is wired I did finally get around to dumping the vm_page struct for it (the CTF crazyness) and I did send it to alc and kib, but neither one has replied... here is a dump in case someone else has some vm_page clue: {'act_count': '\x00', 'aflags': '\x00', 'busy_lock': 1, 'dirty': '\xff', 'flags': 0, 'hold_count': 0, 'listq': {'tqe_next': 0xc0805e00, 'tqe_prev': 0xc06d18a0}, 'md': {'pv_kva': 3235856384, 'pv_list': {'tqh_first': 0x0, 'tqh_last': 0xc0805de0}, 'pv_memattr': '\x00', 'pvh_attrs': 0}, 'object': 0xc06d1878, 'oflags': '\x04', 'order': '\t', 'phys_addr': 17776640, 'pindex': 3572, 'plinks': {'memguard': {'p': 0, 'v': 3228376932}, 'q': {'tqe_next': 0x0, 'tqe_prev': 0xc06d1f64}, 's': {'pv': 0xc06d1f64, 'ss': {'sle_next': 0x0}}}, 'pool': '\x00', 'queue': '\xff', 'segind': '\x01', 'valid': '\xff', 'wire_count': 1} and as you can see, wire_count is not 0... but looks resonable... So, I'm blocked until someone w/ clue tells me what more I need to do to debug this... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 01:43:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88089622; Sun, 16 Mar 2014 01:43:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 73981D7D; Sun, 16 Mar 2014 01:43:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2G1hPnr093672; Sun, 16 Mar 2014 01:43:25 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2G1hOV8093665; Sun, 16 Mar 2014 01:43:24 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201403160143.s2G1hOV8093665@svn.freebsd.org> From: John-Mark Gurney Date: Sun, 16 Mar 2014 01:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263218 - in head: lib/libcrypt lib/libmd sys/conf sys/crypto/sha2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 01:43:25 -0000 Author: jmg Date: Sun Mar 16 01:43:23 2014 New Revision: 263218 URL: http://svnweb.freebsd.org/changeset/base/263218 Log: replace the kernel's version w/ cperciva's implementation... In all my tests, it is faster ~20%, even on an old IXP425 533MHz it is ~45% faster... This is partly due to loop unrolling, so the code size does significantly increase... I do plan on committing a version that rolls up the loops again for smaller code size for embedded systems where size is more important than absolute performance (it'll save ~6k code)... The kernel implementation is now shared w/ userland's libcrypt and libmd... We drop support for sha256 from sha2.c, so now sha2.c only contains sha384 and sha512... Reviewed by: secteam@ Modified: head/lib/libcrypt/Makefile head/lib/libmd/Makefile head/sys/conf/files head/sys/crypto/sha2/sha2.c head/sys/crypto/sha2/sha2.h head/sys/crypto/sha2/sha256.h head/sys/crypto/sha2/sha256c.c Modified: head/lib/libcrypt/Makefile ============================================================================== --- head/lib/libcrypt/Makefile Sun Mar 16 01:22:23 2014 (r263217) +++ head/lib/libcrypt/Makefile Sun Mar 16 01:43:23 2014 (r263218) @@ -9,7 +9,7 @@ SHLIBDIR?= /lib SHLIB_MAJOR= 5 LIB= crypt -.PATH: ${.CURDIR}/../libmd +.PATH: ${.CURDIR}/../libmd ${.CURDIR}/../../sys/crypto/sha2 SRCS= crypt.c misc.c \ crypt-md5.c md5c.c \ crypt-nthash.c md4c.c \ Modified: head/lib/libmd/Makefile ============================================================================== --- head/lib/libmd/Makefile Sun Mar 16 01:22:23 2014 (r263217) +++ head/lib/libmd/Makefile Sun Mar 16 01:43:23 2014 (r263218) @@ -43,7 +43,7 @@ CLEANFILES+= md[245]hl.c md[245].ref md[ sha256.ref sha256hl.c sha512.ref sha512hl.c CFLAGS+= -I${.CURDIR} -.PATH: ${.CURDIR}/${MACHINE_ARCH} +.PATH: ${.CURDIR}/${MACHINE_ARCH} ${.CURDIR}/../../sys/crypto/sha2 .if exists(${MACHINE_ARCH}/sha.S) SRCS+= sha.S Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Mar 16 01:22:23 2014 (r263217) +++ head/sys/conf/files Sun Mar 16 01:43:23 2014 (r263218) @@ -522,6 +522,8 @@ crypto/sha1.c optional carp | crypto | netgraph_mppc_encryption | sctp crypto/sha2/sha2.c optional crypto | geom_bde | ipsec | random | \ sctp | zfs +crypto/sha2/sha256c.c optional crypto | geom_bde | ipsec | random | \ + sctp | zfs crypto/siphash/siphash.c optional inet | inet6 crypto/siphash/siphash_test.c optional inet | inet6 ddb/db_access.c optional ddb Modified: head/sys/crypto/sha2/sha2.c ============================================================================== --- head/sys/crypto/sha2/sha2.c Sun Mar 16 01:22:23 2014 (r263217) +++ head/sys/crypto/sha2/sha2.c Sun Mar 16 01:43:23 2014 (r263218) @@ -121,20 +121,10 @@ __FBSDID("$FreeBSD$"); * Thank you, Jun-ichiro itojun Hagino, for suggesting using u_intXX_t * types and pointing out recent ANSI C support for uintXX_t in inttypes.h. */ -#if 0 /*def SHA2_USE_INTTYPES_H*/ - typedef uint8_t sha2_byte; /* Exactly 1 byte */ typedef uint32_t sha2_word32; /* Exactly 4 bytes */ typedef uint64_t sha2_word64; /* Exactly 8 bytes */ -#else /* SHA2_USE_INTTYPES_H */ - -typedef u_int8_t sha2_byte; /* Exactly 1 byte */ -typedef u_int32_t sha2_word32; /* Exactly 4 bytes */ -typedef u_int64_t sha2_word64; /* Exactly 8 bytes */ - -#endif /* SHA2_USE_INTTYPES_H */ - /*** SHA-256/384/512 Various Length Definitions ***********************/ /* NOTE: Most of these are in sha2.h */ @@ -183,8 +173,6 @@ typedef u_int64_t sha2_word64; /* Exactl */ /* Shift-right (used in SHA-256, SHA-384, and SHA-512): */ #define R(b,x) ((x) >> (b)) -/* 32-bit Rotate-right (used in SHA-256): */ -#define S32(b,x) (((x) >> (b)) | ((x) << (32 - (b)))) /* 64-bit Rotate-right (used in SHA-384 and SHA-512): */ #define S64(b,x) (((x) >> (b)) | ((x) << (64 - (b)))) @@ -192,12 +180,6 @@ typedef u_int64_t sha2_word64; /* Exactl #define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z))) #define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) -/* Four of six logical functions used in SHA-256: */ -#define Sigma0_256(x) (S32(2, (x)) ^ S32(13, (x)) ^ S32(22, (x))) -#define Sigma1_256(x) (S32(6, (x)) ^ S32(11, (x)) ^ S32(25, (x))) -#define sigma0_256(x) (S32(7, (x)) ^ S32(18, (x)) ^ R(3 , (x))) -#define sigma1_256(x) (S32(17, (x)) ^ S32(19, (x)) ^ R(10, (x))) - /* Four of six logical functions used in SHA-384 and SHA-512: */ #define Sigma0_512(x) (S64(28, (x)) ^ S64(34, (x)) ^ S64(39, (x))) #define Sigma1_512(x) (S64(14, (x)) ^ S64(18, (x)) ^ S64(41, (x))) @@ -210,43 +192,10 @@ typedef u_int64_t sha2_word64; /* Exactl * only. */ static void SHA512_Last(SHA512_CTX*); -static void SHA256_Transform(SHA256_CTX*, const sha2_word32*); static void SHA512_Transform(SHA512_CTX*, const sha2_word64*); /*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/ -/* Hash constant words K for SHA-256: */ -static const sha2_word32 K256[64] = { - 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, - 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, - 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, - 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, - 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, - 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, - 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, - 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, - 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, - 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, - 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, - 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, - 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, - 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, - 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, - 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL -}; - -/* Initial hash value H for SHA-256: */ -static const sha2_word32 sha256_initial_hash_value[8] = { - 0x6a09e667UL, - 0xbb67ae85UL, - 0x3c6ef372UL, - 0xa54ff53aUL, - 0x510e527fUL, - 0x9b05688cUL, - 0x1f83d9abUL, - 0x5be0cd19UL -}; - /* Hash constant words K for SHA-384 and SHA-512: */ static const sha2_word64 K512[80] = { 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, @@ -323,301 +272,6 @@ static const char *sha2_hex_digits = "01 /*** SHA-256: *********************************************************/ -void SHA256_Init(SHA256_CTX* context) { - if (context == (SHA256_CTX*)0) { - return; - } - bcopy(sha256_initial_hash_value, context->state, SHA256_DIGEST_LENGTH); - bzero(context->buffer, SHA256_BLOCK_LENGTH); - context->bitcount = 0; -} - -#ifdef SHA2_UNROLL_TRANSFORM - -/* Unrolled SHA-256 round macros: */ - -#if BYTE_ORDER == LITTLE_ENDIAN - -#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ - REVERSE32(*data++, W256[j]); \ - T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ - K256[j] + W256[j]; \ - (d) += T1; \ - (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ - j++ - - -#else /* BYTE_ORDER == LITTLE_ENDIAN */ - -#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ - T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ - K256[j] + (W256[j] = *data++); \ - (d) += T1; \ - (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ - j++ - -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ - -#define ROUND256(a,b,c,d,e,f,g,h) \ - s0 = W256[(j+1)&0x0f]; \ - s0 = sigma0_256(s0); \ - s1 = W256[(j+14)&0x0f]; \ - s1 = sigma1_256(s1); \ - T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + K256[j] + \ - (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); \ - (d) += T1; \ - (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ - j++ - -static void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { - sha2_word32 a, b, c, d, e, f, g, h, s0, s1; - sha2_word32 T1, *W256; - int j; - - W256 = (sha2_word32*)context->buffer; - - /* Initialize registers with the prev. intermediate value */ - a = context->state[0]; - b = context->state[1]; - c = context->state[2]; - d = context->state[3]; - e = context->state[4]; - f = context->state[5]; - g = context->state[6]; - h = context->state[7]; - - j = 0; - do { - /* Rounds 0 to 15 (unrolled): */ - ROUND256_0_TO_15(a,b,c,d,e,f,g,h); - ROUND256_0_TO_15(h,a,b,c,d,e,f,g); - ROUND256_0_TO_15(g,h,a,b,c,d,e,f); - ROUND256_0_TO_15(f,g,h,a,b,c,d,e); - ROUND256_0_TO_15(e,f,g,h,a,b,c,d); - ROUND256_0_TO_15(d,e,f,g,h,a,b,c); - ROUND256_0_TO_15(c,d,e,f,g,h,a,b); - ROUND256_0_TO_15(b,c,d,e,f,g,h,a); - } while (j < 16); - - /* Now for the remaining rounds to 64: */ - do { - ROUND256(a,b,c,d,e,f,g,h); - ROUND256(h,a,b,c,d,e,f,g); - ROUND256(g,h,a,b,c,d,e,f); - ROUND256(f,g,h,a,b,c,d,e); - ROUND256(e,f,g,h,a,b,c,d); - ROUND256(d,e,f,g,h,a,b,c); - ROUND256(c,d,e,f,g,h,a,b); - ROUND256(b,c,d,e,f,g,h,a); - } while (j < 64); - - /* Compute the current intermediate hash value */ - context->state[0] += a; - context->state[1] += b; - context->state[2] += c; - context->state[3] += d; - context->state[4] += e; - context->state[5] += f; - context->state[6] += g; - context->state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = 0; -} - -#else /* SHA2_UNROLL_TRANSFORM */ - -static void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { - sha2_word32 a, b, c, d, e, f, g, h, s0, s1; - sha2_word32 T1, T2, *W256; - int j; - - W256 = (sha2_word32*)context->buffer; - - /* Initialize registers with the prev. intermediate value */ - a = context->state[0]; - b = context->state[1]; - c = context->state[2]; - d = context->state[3]; - e = context->state[4]; - f = context->state[5]; - g = context->state[6]; - h = context->state[7]; - - j = 0; - do { -#if BYTE_ORDER == LITTLE_ENDIAN - /* Copy data while converting to host byte order */ - REVERSE32(*data++,W256[j]); - /* Apply the SHA-256 compression function to update a..h */ - T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j]; -#else /* BYTE_ORDER == LITTLE_ENDIAN */ - /* Apply the SHA-256 compression function to update a..h with copy */ - T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++); -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ - T2 = Sigma0_256(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 16); - - do { - /* Part of the message block expansion: */ - s0 = W256[(j+1)&0x0f]; - s0 = sigma0_256(s0); - s1 = W256[(j+14)&0x0f]; - s1 = sigma1_256(s1); - - /* Apply the SHA-256 compression function to update a..h */ - T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + - (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); - T2 = Sigma0_256(a) + Maj(a, b, c); - h = g; - g = f; - f = e; - e = d + T1; - d = c; - c = b; - b = a; - a = T1 + T2; - - j++; - } while (j < 64); - - /* Compute the current intermediate hash value */ - context->state[0] += a; - context->state[1] += b; - context->state[2] += c; - context->state[3] += d; - context->state[4] += e; - context->state[5] += f; - context->state[6] += g; - context->state[7] += h; - - /* Clean up */ - a = b = c = d = e = f = g = h = T1 = T2 = 0; -} - -#endif /* SHA2_UNROLL_TRANSFORM */ - -void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { - unsigned int freespace, usedspace; - - if (len == 0) { - /* Calling with no data is valid - we do nothing */ - return; - } - - /* Sanity check: */ - assert(context != (SHA256_CTX*)0 && data != (sha2_byte*)0); - - usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; - if (usedspace > 0) { - /* Calculate how much free space is available in the buffer */ - freespace = SHA256_BLOCK_LENGTH - usedspace; - - if (len >= freespace) { - /* Fill the buffer completely and process it */ - bcopy(data, &context->buffer[usedspace], freespace); - context->bitcount += freespace << 3; - len -= freespace; - data += freespace; - SHA256_Transform(context, (sha2_word32*)context->buffer); - } else { - /* The buffer is not yet full */ - bcopy(data, &context->buffer[usedspace], len); - context->bitcount += len << 3; - /* Clean up: */ - usedspace = freespace = 0; - return; - } - } - while (len >= SHA256_BLOCK_LENGTH) { - /* Process as many complete blocks as we can */ - SHA256_Transform(context, (const sha2_word32*)data); - context->bitcount += SHA256_BLOCK_LENGTH << 3; - len -= SHA256_BLOCK_LENGTH; - data += SHA256_BLOCK_LENGTH; - } - if (len > 0) { - /* There's left-overs, so save 'em */ - bcopy(data, context->buffer, len); - context->bitcount += len << 3; - } - /* Clean up: */ - usedspace = freespace = 0; -} - -void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { - sha2_word32 *d = (sha2_word32*)digest; - unsigned int usedspace; - - /* Sanity check: */ - assert(context != (SHA256_CTX*)0); - - /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (sha2_byte*)0) { - usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; -#if BYTE_ORDER == LITTLE_ENDIAN - /* Convert FROM host byte order */ - REVERSE64(context->bitcount,context->bitcount); -#endif - if (usedspace > 0) { - /* Begin padding with a 1 bit: */ - context->buffer[usedspace++] = 0x80; - - if (usedspace <= SHA256_SHORT_BLOCK_LENGTH) { - /* Set-up for the last transform: */ - bzero(&context->buffer[usedspace], SHA256_SHORT_BLOCK_LENGTH - usedspace); - } else { - if (usedspace < SHA256_BLOCK_LENGTH) { - bzero(&context->buffer[usedspace], SHA256_BLOCK_LENGTH - usedspace); - } - /* Do second-to-last transform: */ - SHA256_Transform(context, (sha2_word32*)context->buffer); - - /* And set-up for the last transform: */ - bzero(context->buffer, SHA256_SHORT_BLOCK_LENGTH); - } - } else { - /* Set-up for the last transform: */ - bzero(context->buffer, SHA256_SHORT_BLOCK_LENGTH); - - /* Begin padding with a 1 bit: */ - *context->buffer = 0x80; - } - /* Set the bit count: */ - *(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; - - /* Final transform: */ - SHA256_Transform(context, (sha2_word32*)context->buffer); - -#if BYTE_ORDER == LITTLE_ENDIAN - { - /* Convert TO host byte order */ - int j; - for (j = 0; j < 8; j++) { - REVERSE32(context->state[j],context->state[j]); - *d++ = context->state[j]; - } - } -#else - bcopy(context->state, d, SHA256_DIGEST_LENGTH); -#endif - } - - /* Clean up state data: */ - bzero(context, sizeof(*context)); - usedspace = 0; -} - char *SHA256_End(SHA256_CTX* context, char buffer[]) { sha2_byte digest[SHA256_DIGEST_LENGTH], *d = digest; int i; @@ -641,7 +295,7 @@ char *SHA256_End(SHA256_CTX* context, ch return buffer; } -char* SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_STRING_LENGTH]) { +char* SHA256_Data(const void *data, unsigned int len, char *digest) { SHA256_CTX context; SHA256_Init(&context); Modified: head/sys/crypto/sha2/sha2.h ============================================================================== --- head/sys/crypto/sha2/sha2.h Sun Mar 16 01:22:23 2014 (r263217) +++ head/sys/crypto/sha2/sha2.h Sun Mar 16 01:43:23 2014 (r263218) @@ -56,70 +56,17 @@ extern "C" { #define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1) -/*** SHA-256/384/512 Context Structures *******************************/ -/* NOTE: If your architecture does not define either u_intXX_t types or - * uintXX_t (from inttypes.h), you may need to define things by hand - * for your system: - */ -#if 0 -typedef unsigned char u_int8_t; /* 1-byte (8-bits) */ -typedef unsigned int u_int32_t; /* 4-bytes (32-bits) */ -typedef unsigned long long u_int64_t; /* 8-bytes (64-bits) */ -#endif -/* - * Most BSD systems already define u_intXX_t types, as does Linux. - * Some systems, however, like Compaq's Tru64 Unix instead can use - * uintXX_t types defined by very recent ANSI C standards and included - * in the file: - * - * #include - * - * If you choose to use then please define: - * - * #define SHA2_USE_INTTYPES_H - * - * Or on the command line during compile: - * - * cc -DSHA2_USE_INTTYPES_H ... - */ -#if 0 /*def SHA2_USE_INTTYPES_H*/ - -typedef struct _SHA256_CTX { - uint32_t state[8]; - uint64_t bitcount; - uint8_t buffer[SHA256_BLOCK_LENGTH]; -} SHA256_CTX; +/*** SHA-384/512 Context Structures *******************************/ typedef struct _SHA512_CTX { uint64_t state[8]; uint64_t bitcount[2]; uint8_t buffer[SHA512_BLOCK_LENGTH]; } SHA512_CTX; -#else /* SHA2_USE_INTTYPES_H */ - -typedef struct _SHA256_CTX { - u_int32_t state[8]; - u_int64_t bitcount; - u_int8_t buffer[SHA256_BLOCK_LENGTH]; -} SHA256_CTX; -typedef struct _SHA512_CTX { - u_int64_t state[8]; - u_int64_t bitcount[2]; - u_int8_t buffer[SHA512_BLOCK_LENGTH]; -} SHA512_CTX; - -#endif /* SHA2_USE_INTTYPES_H */ - typedef SHA512_CTX SHA384_CTX; -/*** SHA-256/384/512 Function Prototypes ******************************/ - -void SHA256_Init(SHA256_CTX *); -void SHA256_Update(SHA256_CTX*, const u_int8_t*, size_t); -void SHA256_Final(u_int8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*); -char* SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]); -char* SHA256_Data(const u_int8_t*, size_t, char[SHA256_DIGEST_STRING_LENGTH]); +/*** SHA-384/512 Function Prototypes ******************************/ void SHA384_Init(SHA384_CTX*); void SHA384_Update(SHA384_CTX*, const u_int8_t*, size_t); @@ -137,4 +84,6 @@ char* SHA512_Data(const u_int8_t*, size_ } #endif /* __cplusplus */ +#include "sha256.h" + #endif /* __SHA2_H__ */ Modified: head/sys/crypto/sha2/sha256.h ============================================================================== --- head/sys/crypto/sha2/sha256.h Sun Mar 16 01:22:23 2014 (r263217) +++ head/sys/crypto/sha2/sha256.h Sun Mar 16 01:43:23 2014 (r263218) @@ -29,12 +29,14 @@ #ifndef _SHA256_H_ #define _SHA256_H_ +#ifndef _KERNEL #include +#endif typedef struct SHA256Context { uint32_t state[8]; uint64_t count; - unsigned char buf[64]; + uint8_t buf[64]; } SHA256_CTX; __BEGIN_DECLS @@ -42,9 +44,11 @@ void SHA256_Init(SHA256_CTX *); void SHA256_Update(SHA256_CTX *, const void *, size_t); void SHA256_Final(unsigned char [32], SHA256_CTX *); char *SHA256_End(SHA256_CTX *, char *); +char *SHA256_Data(const void *, unsigned int, char *); +#ifndef _KERNEL char *SHA256_File(const char *, char *); char *SHA256_FileChunk(const char *, char *, off_t, off_t); -char *SHA256_Data(const void *, unsigned int, char *); +#endif __END_DECLS #endif /* !_SHA256_H_ */ Modified: head/sys/crypto/sha2/sha256c.c ============================================================================== --- head/sys/crypto/sha2/sha256c.c Sun Mar 16 01:22:23 2014 (r263217) +++ head/sys/crypto/sha2/sha256c.c Sun Mar 16 01:43:23 2014 (r263218) @@ -30,7 +30,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef _KERNEL +#include +#else #include +#endif #include "sha256.h" From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 01:55:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A48BB90C; Sun, 16 Mar 2014 01:55:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 77163E4B; Sun, 16 Mar 2014 01:55:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2G1tV7k097891; Sun, 16 Mar 2014 01:55:31 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2G1tUo8097887; Sun, 16 Mar 2014 01:55:30 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201403160155.s2G1tUo8097887@svn.freebsd.org> From: John-Mark Gurney Date: Sun, 16 Mar 2014 01:55:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263219 - in head/sys/modules: crypto geom/geom_bde random zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 01:55:31 -0000 Author: jmg Date: Sun Mar 16 01:55:30 2014 New Revision: 263219 URL: http://svnweb.freebsd.org/changeset/base/263219 Log: I clearly didn't test the modules... add sha256c.c to the various modules that included sha2.c... Modified: head/sys/modules/crypto/Makefile head/sys/modules/geom/geom_bde/Makefile head/sys/modules/random/Makefile head/sys/modules/zfs/Makefile Modified: head/sys/modules/crypto/Makefile ============================================================================== --- head/sys/modules/crypto/Makefile Sun Mar 16 01:43:23 2014 (r263218) +++ head/sys/modules/crypto/Makefile Sun Mar 16 01:55:30 2014 (r263219) @@ -16,7 +16,7 @@ SRCS += cast.c cryptodeflate.c rmd160.c SRCS += skipjack.c bf_enc.c bf_ecb.c bf_skey.c SRCS += camellia.c camellia-api.c SRCS += des_ecb.c des_enc.c des_setkey.c -SRCS += sha1.c sha2.c +SRCS += sha1.c sha2.c sha256c.c SRCS += siphash.c SRCS += opt_param.h cryptodev_if.h bus_if.h device_if.h SRCS += opt_ddb.h Modified: head/sys/modules/geom/geom_bde/Makefile ============================================================================== --- head/sys/modules/geom/geom_bde/Makefile Sun Mar 16 01:43:23 2014 (r263218) +++ head/sys/modules/geom/geom_bde/Makefile Sun Mar 16 01:55:30 2014 (r263219) @@ -6,6 +6,6 @@ KMOD= geom_bde SRCS= g_bde.c g_bde_crypt.c g_bde_lock.c g_bde_work.c -SRCS+= rijndael-alg-fst.c rijndael-api-fst.c sha2.c +SRCS+= rijndael-alg-fst.c rijndael-api-fst.c sha2.c sha256c.c .include Modified: head/sys/modules/random/Makefile ============================================================================== --- head/sys/modules/random/Makefile Sun Mar 16 01:43:23 2014 (r263218) +++ head/sys/modules/random/Makefile Sun Mar 16 01:55:30 2014 (r263219) @@ -12,7 +12,7 @@ SRCS+= ivy.c .endif SRCS+= randomdev_soft.c yarrow.c hash.c SRCS+= random_harvestq.c live_entropy_sources.c rwfile.c -SRCS+= rijndael-alg-fst.c rijndael-api-fst.c sha2.c +SRCS+= rijndael-alg-fst.c rijndael-api-fst.c sha2.c sha256c.c SRCS+= bus_if.h device_if.h vnode_if.h opt_cpu.h opt_random.h CFLAGS+= -I${.CURDIR}/../.. Modified: head/sys/modules/zfs/Makefile ============================================================================== --- head/sys/modules/zfs/Makefile Sun Mar 16 01:43:23 2014 (r263218) +++ head/sys/modules/zfs/Makefile Sun Mar 16 01:55:30 2014 (r263219) @@ -65,7 +65,7 @@ SRCS+= zmod_subr.c SRCS+= zutil.c .PATH: ${.CURDIR}/../../crypto/sha2 -SRCS+= sha2.c +SRCS+= sha2.c sha256c.c .PATH: ${SUNW}/common/zfs .include "${SUNW}/uts/common/Makefile.files" From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 02:07:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE5CBB43; Sun, 16 Mar 2014 02:07:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A8BA7F08; Sun, 16 Mar 2014 02:07:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2G27ANk002273; Sun, 16 Mar 2014 02:07:10 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2G278F7002261; Sun, 16 Mar 2014 02:07:08 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403160207.s2G278F7002261@svn.freebsd.org> From: Julio Merino Date: Sun, 16 Mar 2014 02:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263220 - in head: etc/mtree sbin sbin/dhclient sbin/dhclient/tests sbin/growfs sbin/growfs/tests sbin/mdconfig sbin/mdconfig/tests sbin/tests tools/regression/sbin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 02:07:10 -0000 Author: jmmv Date: Sun Mar 16 02:07:08 2014 New Revision: 263220 URL: http://svnweb.freebsd.org/changeset/base/263220 Log: Migrate tools/regression/sbin/ to the new tests layout. Pretty much all that this change does is shuffles the code around and hooks it into the regular build. The code of the old tests has not changed. Added: head/sbin/dhclient/tests/ - copied from r263215, head/tools/regression/sbin/dhclient/ head/sbin/growfs/tests/ - copied from r263215, head/tools/regression/sbin/growfs/ head/sbin/growfs/tests/legacy_test.pl - copied, changed from r263215, head/tools/regression/sbin/growfs/regress.t head/sbin/mdconfig/tests/ - copied from r263215, head/tools/regression/sbin/mdconfig/ head/sbin/mdconfig/tests/legacy_test.sh - copied, changed from r263215, head/tools/regression/sbin/mdconfig/00.t - copied unchanged from r263215, head/tools/regression/sbin/mdconfig/run head/sbin/tests/ head/sbin/tests/Makefile (contents, props changed) Directory Properties: head/sbin/mdconfig/tests/run.pl (props changed) Deleted: head/sbin/growfs/tests/regress.t head/sbin/mdconfig/tests/00.t head/sbin/mdconfig/tests/run head/tools/regression/sbin/ Modified: head/etc/mtree/BSD.tests.dist head/sbin/Makefile head/sbin/dhclient/Makefile head/sbin/dhclient/tests/Makefile head/sbin/growfs/Makefile head/sbin/growfs/tests/Makefile head/sbin/mdconfig/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Sun Mar 16 01:55:30 2014 (r263219) +++ head/etc/mtree/BSD.tests.dist Sun Mar 16 02:07:08 2014 (r263220) @@ -68,6 +68,14 @@ .. .. .. + sbin + dhclient + .. + growfs + .. + mdconfig + .. + .. share examples tests Modified: head/sbin/Makefile ============================================================================== --- head/sbin/Makefile Sun Mar 16 01:55:30 2014 (r263219) +++ head/sbin/Makefile Sun Mar 16 02:07:08 2014 (r263220) @@ -118,6 +118,10 @@ SUBDIR+= quotacheck SUBDIR+= routed .endif +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include SUBDIR:= ${SUBDIR:O} Modified: head/sbin/dhclient/Makefile ============================================================================== --- head/sbin/dhclient/Makefile Sun Mar 16 01:55:30 2014 (r263219) +++ head/sbin/dhclient/Makefile Sun Mar 16 02:07:08 2014 (r263220) @@ -31,6 +31,8 @@ # OF THE POSSIBILITY OF SUCH DAMAGE. # +.include + SRCS= dhclient.c clparse.c alloc.c dispatch.c hash.c bpf.c options.c \ tree.c conflex.c errwarn.c inet.c packet.c convert.c tables.c \ parse.c privsep.c @@ -44,4 +46,8 @@ LDADD= -lutil WARNS?= 2 +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: head/sbin/dhclient/tests/Makefile ============================================================================== --- head/tools/regression/sbin/dhclient/Makefile Sun Mar 16 00:57:26 2014 (r263215) +++ head/sbin/dhclient/tests/Makefile Sun Mar 16 02:07:08 2014 (r263220) @@ -1,17 +1,15 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../../sbin/dhclient +TESTSDIR= ${TESTSBASE}/sbin/dhclient -SRCS= alloc.c convert.c hash.c options.c tables.c \ - fake.c \ - option-domain-search.c +.PATH: ${.CURDIR}/.. -CFLAGS+= -I${.CURDIR}/../../../../sbin/dhclient -LDADD= -lutil +PLAIN_TESTS_C= option-domain-search_test +SRCS.option-domain-search_test= alloc.c convert.c hash.c options.c \ + tables.c fake.c option-domain-search.c +CFLAGS.option-domain-search_test+= -I${.CURDIR}/.. +LDADD.option-domain-search_test= -lutil -PROG= option-domain-search - -NO_MAN= WARNS?= 2 -.include +.include Modified: head/sbin/growfs/Makefile ============================================================================== --- head/sbin/growfs/Makefile Sun Mar 16 01:55:30 2014 (r263219) +++ head/sbin/growfs/Makefile Sun Mar 16 02:07:08 2014 (r263220) @@ -6,6 +6,8 @@ #GFSDBG= +.include + .PATH: ${.CURDIR}/../mount PROG= growfs @@ -20,4 +22,8 @@ SRCS+= debug.c DPADD= ${LIBUTIL} LDADD= -lutil +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: head/sbin/growfs/tests/Makefile ============================================================================== --- head/tools/regression/sbin/growfs/Makefile Sun Mar 16 00:57:26 2014 (r263215) +++ head/sbin/growfs/tests/Makefile Sun Mar 16 02:07:08 2014 (r263220) @@ -1,6 +1,7 @@ # $FreeBSD$ -all test: - prove -vmw regress.t +TESTSDIR= ${TESTSBASE}/sbin/growfs -clean: +TAP_TESTS_PERL= legacy_test + +.include Copied and modified: head/sbin/growfs/tests/legacy_test.pl (from r263215, head/tools/regression/sbin/growfs/regress.t) ============================================================================== --- head/tools/regression/sbin/growfs/regress.t Sun Mar 16 00:57:26 2014 (r263215, copy source) +++ head/sbin/growfs/tests/legacy_test.pl Sun Mar 16 02:07:08 2014 (r263220) @@ -1,5 +1,3 @@ -#! /usr/bin/perl -# # $FreeBSD$ use strict; Modified: head/sbin/mdconfig/Makefile ============================================================================== --- head/sbin/mdconfig/Makefile Sun Mar 16 01:55:30 2014 (r263219) +++ head/sbin/mdconfig/Makefile Sun Mar 16 02:07:08 2014 (r263220) @@ -1,9 +1,15 @@ # $FreeBSD$ +.include + PROG= mdconfig MAN= mdconfig.8 DPADD= ${LIBUTIL} ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} LDADD= -lutil -lgeom -lbsdxml -lsbuf +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Copied and modified: head/sbin/mdconfig/tests/legacy_test.sh (from r263215, head/tools/regression/sbin/mdconfig/00.t) ============================================================================== --- head/tools/regression/sbin/mdconfig/00.t Sun Mar 16 00:57:26 2014 (r263215, copy source) +++ head/sbin/mdconfig/tests/legacy_test.sh Sun Mar 16 02:07:08 2014 (r263220) @@ -38,7 +38,7 @@ fi TESTDIR=$(dirname $(realpath $0)) -perl $TESTDIR/run $TESTDIR/mdconfig.test > /dev/null +__PERL__ -w -U $TESTDIR/run $TESTDIR/mdconfig.test > /dev/null if [ $? -eq 0 ]; then echo "ok 1" Copied: head/sbin/mdconfig/tests/run.pl (from r263215, head/tools/regression/sbin/mdconfig/run) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/mdconfig/tests/run.pl Sun Mar 16 02:07:08 2014 (r263220, copy of r263215, head/tools/regression/sbin/mdconfig/run) @@ -0,0 +1,329 @@ +#!/usr/bin/perl -w -U + +# Copyright (c) 2007, 2008 Andreas Gruenbacher. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions, and the following disclaimer, +# without modification, immediately at the beginning of the file. +# 2. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# Alternatively, this software may be distributed under the terms of the +# GNU Public License ("GPL"). +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# +# Possible improvements: +# +# - distinguish stdout and stderr output +# - add environment variable like assignments +# - run up to a specific line +# - resume at a specific line +# + +use strict; +use FileHandle; +use Getopt::Std; +use POSIX qw(isatty setuid getcwd); +use vars qw($opt_l $opt_v); + +no warnings qw(taint); + +$opt_l = ~0; # a really huge number +getopts('l:v'); + +my ($OK, $FAILED) = ("ok", "failed"); +if (isatty(fileno(STDOUT))) { + $OK = "\033[32m" . $OK . "\033[m"; + $FAILED = "\033[31m\033[1m" . $FAILED . "\033[m"; +} + +sub exec_test($$); +sub process_test($$$$); + +my ($prog, $in, $out) = ([], [], []); +my $prog_line = 0; +my ($tests, $failed) = (0,0); +my $lineno; +my $width = ($ENV{COLUMNS} || 80) >> 1; + +for (;;) { + my $line = <>; $lineno++; + if (defined $line) { + # Substitute %VAR and %{VAR} with environment variables. + $line =~ s[%(\w+)][$ENV{$1}]eg; + $line =~ s[%{(\w+)}][$ENV{$1}]eg; + } + if (defined $line) { + if ($line =~ s/^\s*< ?//) { + push @$in, $line; + } elsif ($line =~ s/^\s*> ?//) { + push @$out, $line; + } else { + process_test($prog, $prog_line, $in, $out); + last if $prog_line >= $opt_l; + + $prog = []; + $prog_line = 0; + } + if ($line =~ s/^\s*\$ ?//) { + $prog = [ map { s/\\(.)/$1/g; $_ } split /(? @$result) ? @$out : @$result; + for (my $n=0; $n < $nmax; $n++) { + my $use_re; + if (defined $out->[$n] && $out->[$n] =~ /^~ /) { + $use_re = 1; + $out->[$n] =~ s/^~ //g; + } + + if (!defined($out->[$n]) || !defined($result->[$n]) || + (!$use_re && $result->[$n] ne $out->[$n]) || + ( $use_re && $result->[$n] !~ /^$out->[$n]/)) { + push @good, ($use_re ? '!~' : '!='); + } + else { + push @good, ($use_re ? '=~' : '=='); + } + } + my $good = !(grep /!/, @good); + $tests++; + $failed++ unless $good; + print $good ? $OK : $FAILED, "\n"; + if (!$good || $opt_v) { + for (my $n=0; $n < $nmax; $n++) { + my $l = defined($out->[$n]) ? $out->[$n] : "~"; + chomp $l; + my $r = defined($result->[$n]) ? $result->[$n] : "~"; + chomp $r; + print sprintf("%-" . ($width-3) . "s %s %s\n", + $r, $good[$n], $l); + } + } +} + + +sub su($) { + my ($user) = @_; + + $user ||= "root"; + + my ($login, $pass, $uid, $gid) = getpwnam($user) + or return [ "su: user $user does not exist\n" ]; + my @groups = (); + my $fh = new FileHandle("/etc/group") + or return [ "opening /etc/group: $!\n" ]; + while (<$fh>) { + chomp; + my ($group, $passwd, $gid, $users) = split /:/; + foreach my $u (split /,/, $users) { + push @groups, $gid + if ($user eq $u); + } + } + $fh->close; + + my $groups = join(" ", ($gid, $gid, @groups)); + #print STDERR "[[$groups]]\n"; + $! = 0; # reset errno + $> = 0; + $( = $gid; + $) = $groups; + if ($!) { + return [ "su: $!\n" ]; + } + if ($uid != 0) { + $> = $uid; + #$< = $uid; + if ($!) { + return [ "su: $prog->[1]: $!\n" ]; + } + } + #print STDERR "[($>,$<)($(,$))]"; + return []; +} + + +sub sg($) { + my ($group) = @_; + + my $gid = getgrnam($group) + or return [ "sg: group $group does not exist\n" ]; + my %groups = map { $_ eq $gid ? () : ($_ => 1) } (split /\s/, $)); + + #print STDERR "<<", join("/", keys %groups), ">>\n"; + my $groups = join(" ", ($gid, $gid, keys %groups)); + #print STDERR "[[$groups]]\n"; + $! = 0; # reset errno + if ($> != 0) { + my $uid = $>; + $> = 0; + $( = $gid; + $) = $groups; + $> = $uid; + } else { + $( = $gid; + $) = $groups; + } + if ($!) { + return [ "sg: $!\n" ]; + } + print STDERR "[($>,$<)($(,$))]"; + return []; +} + + +sub exec_test($$) { + my ($prog, $in) = @_; + local (*IN, *IN_DUP, *IN2, *OUT_DUP, *OUT, *OUT2); + my $needs_shell = (join('', @$prog) =~ /[][|<>"'`\$\*\?]/); + + if ($prog->[0] eq "umask") { + umask oct $prog->[1]; + return []; + } elsif ($prog->[0] eq "cd") { + if (!chdir $prog->[1]) { + return [ "chdir: $prog->[1]: $!\n" ]; + } + $ENV{PWD} = getcwd; + return []; + } elsif ($prog->[0] eq "su") { + return su($prog->[1]); + } elsif ($prog->[0] eq "sg") { + return sg($prog->[1]); + } elsif ($prog->[0] eq "export") { + my ($name, $value) = split /=/, $prog->[1]; + # FIXME: need to evaluate $value, so that things like this will work: + # export dir=$PWD/dir + $ENV{$name} = $value; + return []; + } elsif ($prog->[0] eq "unset") { + delete $ENV{$prog->[1]}; + return []; + } + + pipe *IN2, *OUT + or die "Can't create pipe for reading: $!"; + open *IN_DUP, "<&STDIN" + or *IN_DUP = undef; + open *STDIN, "<&IN2" + or die "Can't duplicate pipe for reading: $!"; + close *IN2; + + open *OUT_DUP, ">&STDOUT" + or die "Can't duplicate STDOUT: $!"; + pipe *IN, *OUT2 + or die "Can't create pipe for writing: $!"; + open *STDOUT, ">&OUT2" + or die "Can't duplicate pipe for writing: $!"; + close *OUT2; + + *STDOUT->autoflush(); + *OUT->autoflush(); + + $SIG{CHLD} = 'IGNORE'; + + if (fork()) { + # Server + if (*IN_DUP) { + open *STDIN, "<&IN_DUP" + or die "Can't duplicate STDIN: $!"; + close *IN_DUP + or die "Can't close STDIN duplicate: $!"; + } + open *STDOUT, ">&OUT_DUP" + or die "Can't duplicate STDOUT: $!"; + close *OUT_DUP + or die "Can't close STDOUT duplicate: $!"; + + foreach my $line (@$in) { + #print "> $line"; + print OUT $line; + } + close *OUT + or die "Can't close pipe for writing: $!"; + + my $result = []; + while () { + #print "< $_"; + if ($needs_shell) { + s#^/bin/sh: line \d+: ##; + } + push @$result, $_; + } + return $result; + } else { + # Client + $< = $>; + close IN + or die "Can't close read end for input pipe: $!"; + close OUT + or die "Can't close write end for output pipe: $!"; + close OUT_DUP + or die "Can't close STDOUT duplicate: $!"; + local *ERR_DUP; + open ERR_DUP, ">&STDERR" + or die "Can't duplicate STDERR: $!"; + open STDERR, ">&STDOUT" + or die "Can't join STDOUT and STDERR: $!"; + + if ($needs_shell) { + exec ('/bin/sh', '-c', join(" ", @$prog)); + } else { + exec @$prog; + } + print STDERR $prog->[0], ": $!\n"; + exit; + } +} + Added: head/sbin/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/tests/Makefile Sun Mar 16 02:07:08 2014 (r263220) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/sbin + +.PATH: ${.CURDIR:H:H}/tests +KYUAFILE= yes + +.include From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 02:27:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB942E38; Sun, 16 Mar 2014 02:27:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B7FF5B2; Sun, 16 Mar 2014 02:27:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2G2RSt3010332; Sun, 16 Mar 2014 02:27:28 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2G2RRbb010324; Sun, 16 Mar 2014 02:27:27 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403160227.s2G2RRbb010324@svn.freebsd.org> From: Julio Merino Date: Sun, 16 Mar 2014 02:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263221 - head/tools/regression/usr.sbin/etcupdate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 02:27:29 -0000 Author: jmmv Date: Sun Mar 16 02:27:27 2014 New Revision: 263221 URL: http://svnweb.freebsd.org/changeset/base/263221 Log: Change etcupdate tests to return 1 on test failures. This is a prerequisite for hooking these tests into the test suite. And, fortunately, all tests seem to pass! Modified: head/tools/regression/usr.sbin/etcupdate/always.sh head/tools/regression/usr.sbin/etcupdate/conflicts.sh head/tools/regression/usr.sbin/etcupdate/fbsdid.sh head/tools/regression/usr.sbin/etcupdate/ignore.sh head/tools/regression/usr.sbin/etcupdate/preworld.sh head/tools/regression/usr.sbin/etcupdate/tests.sh head/tools/regression/usr.sbin/etcupdate/tzsetup.sh Modified: head/tools/regression/usr.sbin/etcupdate/always.sh ============================================================================== --- head/tools/regression/usr.sbin/etcupdate/always.sh Sun Mar 16 02:07:08 2014 (r263220) +++ head/tools/regression/usr.sbin/etcupdate/always.sh Sun Mar 16 02:27:27 2014 (r263221) @@ -29,6 +29,7 @@ # Various regression tests to test the -A flag to the 'update' command. +FAILED=no WORKDIR=work usage() @@ -275,6 +276,7 @@ missing() { if [ -e $TEST/$1 -o -L $TEST/$1 ]; then echo "File $1 should be missing" + FAILED=yes fi } @@ -283,6 +285,7 @@ present() { if ! [ -e $TEST/$1 -o -L $TEST/$1 ]; then echo "File $1 should be present" + FAILED=yes fi } @@ -291,6 +294,7 @@ fifo() { if ! [ -p $TEST/$1 ]; then echo "File $1 should be a FIFO" + FAILED=yes fi } @@ -299,6 +303,7 @@ dir() { if ! [ -d $TEST/$1 ]; then echo "File $1 should be a directory" + FAILED=yes fi } @@ -310,10 +315,12 @@ link() if ! [ -L $TEST/$1 ]; then echo "File $1 should be a link" + FAILED=yes elif [ $# -gt 1 ]; then val=`readlink $TEST/$1` if [ "$val" != "$2" ]; then echo "Link $1 should link to \"$2\"" + FAILED=yes fi fi } @@ -327,15 +334,18 @@ file() if ! [ -f $TEST/$1 ]; then echo "File $1 should be a regular file" + FAILED=yes elif [ $# -eq 2 ]; then contents=`cat $TEST/$1` if [ "$contents" != "$2" ]; then echo "File $1 has wrong contents" + FAILED=yes fi elif [ $# -eq 3 ]; then sum=`md5 -q $TEST/$1` if [ "$sum" != "$3" ]; then echo "File $1 has wrong contents" + FAILED=yes fi fi } @@ -348,10 +358,12 @@ conflict() if ! [ -f $CONFLICTS/$1 ]; then echo "File $1 missing conflict" + FAILED=yes elif [ $# -gt 1 ]; then sum=`md5 -q $CONFLICTS/$1` if [ "$sum" != "$2" ]; then echo "Conflict $1 has wrong contents" + FAILED=yes fi fi } @@ -361,11 +373,13 @@ noconflict() { if [ -f $CONFLICTS/$1 ]; then echo "File $1 should not have a conflict" + FAILED=yes fi } if [ `id -u` -ne 0 ]; then echo "must be root" + exit 0 fi if [ -r /etc/etcupdate.conf ]; then @@ -413,7 +427,8 @@ Warnings: EOF echo "Differences for regular:" -diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out +diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out \ + || FAILED=yes ## /first/difftype/second: present /first/difftype/second/fifo @@ -533,7 +548,8 @@ Warnings: EOF echo "Differences for -A '/first*' -A '/second* /*di*':" -diff -u -L "correct" $WORKDIR/correct1.out -L "test" $WORKDIR/test1.out +diff -u -L "correct" $WORKDIR/correct1.out -L "test" $WORKDIR/test1.out \ + || FAILED=yes ## /first/difftype/second: present /first/difftype/second/fifo @@ -610,3 +626,5 @@ file /dirchange/todir/difffile/file "baz ## /dirchange/todir/difftype: file /dirchange/todir/difftype/file "baz" + +[ "${FAILED}" = no ] Modified: head/tools/regression/usr.sbin/etcupdate/conflicts.sh ============================================================================== --- head/tools/regression/usr.sbin/etcupdate/conflicts.sh Sun Mar 16 02:07:08 2014 (r263220) +++ head/tools/regression/usr.sbin/etcupdate/conflicts.sh Sun Mar 16 02:27:27 2014 (r263221) @@ -29,6 +29,7 @@ # Various regression tests to run for the 'resolve' command. +FAILED=no WORKDIR=work usage() @@ -134,6 +135,7 @@ missing() { if [ -e $TEST/$1 -o -L $TEST/$1 ]; then echo "File $1 should be missing" + FAILED=yes fi } @@ -142,6 +144,7 @@ present() { if ! [ -e $TEST/$1 -o -L $TEST/$1 ]; then echo "File $1 should be present" + FAILED=yes fi } @@ -154,15 +157,18 @@ file() if ! [ -f $TEST/$1 ]; then echo "File $1 should be a regular file" + FAILED=yes elif [ $# -eq 2 ]; then contents=`cat $TEST/$1` if [ "$contents" != "$2" ]; then echo "File $1 has wrong contents" + FAILED=yes fi elif [ $# -eq 3 ]; then sum=`md5 -q $TEST/$1` if [ "$sum" != "$3" ]; then echo "File $1 has wrong contents" + FAILED=yes fi fi } @@ -175,10 +181,12 @@ conflict() if ! [ -f $CONFLICTS/$1 ]; then echo "File $1 missing conflict" + FAILED=yes elif [ $# -gt 1 ]; then sum=`md5 -q $CONFLICTS/$1` if [ "$sum" != "$2" ]; then echo "Conflict $1 has wrong contents" + FAILED=yes fi fi } @@ -188,11 +196,13 @@ resolved() { if [ -f $CONFLICTS/$1 ]; then echo "Conflict $1 should be resolved" + FAILED=yes fi } if [ `id -u` -ne 0 ]; then echo "must be root" + exit 0 fi if [ -r /etc/etcupdate.conf ]; then @@ -255,11 +265,13 @@ echo "Checking newalias warning for 'p'" echo 'p' | $COMMAND resolve -d $WORKDIR -D $TEST | grep -q newalias if [ $? -eq 0 ]; then echo "+ Extra warning" + FAILED=yes fi echo "Checking newalias warning for 'mf'": echo 'mf' | $COMMAND resolve -d $WORKDIR -D $TEST | grep -q newalias if [ $? -eq 0 ]; then echo "+ Extra warning" + FAILED=yes fi # Verify that 'tf' and 'r' do generate the newaliases warning. @@ -268,6 +280,7 @@ echo "Checking newalias warning for 'tf' echo 'tf' | $COMMAND resolve -d $WORKDIR -D $TEST | grep -q newalias if [ $? -ne 0 ]; then echo "- Missing warning" + FAILED=yes fi build_aliases_conflict @@ -275,4 +288,7 @@ cp $TEST/etc/mail/aliases $CONFLICTS/etc echo 'r' | $COMMAND resolve -d $WORKDIR -D $TEST | grep -q newalias if [ $? -ne 0 ]; then echo "- Missing warning" + FAILED=yes fi + +[ "${FAILED}" = no ] Modified: head/tools/regression/usr.sbin/etcupdate/fbsdid.sh ============================================================================== --- head/tools/regression/usr.sbin/etcupdate/fbsdid.sh Sun Mar 16 02:07:08 2014 (r263220) +++ head/tools/regression/usr.sbin/etcupdate/fbsdid.sh Sun Mar 16 02:27:27 2014 (r263221) @@ -29,6 +29,7 @@ # Various regression tests to test the -F flag to the 'update' command. +FAILED=no WORKDIR=work usage() @@ -213,6 +214,7 @@ missing() { if [ -e $TEST/$1 -o -L $TEST/$1 ]; then echo "File $1 should be missing" + FAILED=yes fi } @@ -221,6 +223,7 @@ present() { if ! [ -e $TEST/$1 -o -L $TEST/$1 ]; then echo "File $1 should be present" + FAILED=yes fi } @@ -233,15 +236,18 @@ file() if ! [ -f $TEST/$1 ]; then echo "File $1 should be a regular file" + FAILED=yes elif [ $# -eq 2 ]; then contents=`cat $TEST/$1` if [ "$contents" != "$2" ]; then echo "File $1 has wrong contents" + FAILED=yes fi elif [ $# -eq 3 ]; then sum=`md5 -q $TEST/$1` if [ "$sum" != "$3" ]; then echo "File $1 has wrong contents" + FAILED=yes fi fi } @@ -254,10 +260,12 @@ conflict() if ! [ -f $CONFLICTS/$1 ]; then echo "File $1 missing conflict" + FAILED=yes elif [ $# -gt 1 ]; then sum=`md5 -q $CONFLICTS/$1` if [ "$sum" != "$2" ]; then echo "Conflict $1 has wrong contents" + FAILED=yes fi fi } @@ -267,11 +275,13 @@ noconflict() { if [ -f $CONFLICTS/$1 ]; then echo "File $1 should not have a conflict" + FAILED=yes fi } if [ `id -u` -ne 0 ]; then echo "must be root" + exit 0 fi if [ -r /etc/etcupdate.conf ]; then @@ -297,7 +307,8 @@ Warnings: EOF echo "Differences for regular:" -diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out +diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out \ + || FAILED=yes file /remove "" 1bb4776213af107077be78fead8a351c file /old "" 2f799a7addc4132563ef9b44adc66157 @@ -329,7 +340,8 @@ cat > $WORKDIR/correctF.out < $WORKDIR/correctAF.out < $WORKDIR/correct.out < $WORKDIR/correct1.out < $WORKDIR/correct.out < $WORKDIR/test.out echo "Differences for real:" -diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out +diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out \ + || FAILED=yes check_trees + +[ "${FAILED}" = no ] Modified: head/tools/regression/usr.sbin/etcupdate/tests.sh ============================================================================== --- head/tools/regression/usr.sbin/etcupdate/tests.sh Sun Mar 16 02:07:08 2014 (r263220) +++ head/tools/regression/usr.sbin/etcupdate/tests.sh Sun Mar 16 02:27:27 2014 (r263221) @@ -29,6 +29,7 @@ # Various regression tests to run for the 'update' command. +FAILED=no WORKDIR=work usage() @@ -653,6 +654,7 @@ missing() { if [ -e $TEST/$1 -o -L $TEST/$1 ]; then echo "File $1 should be missing" + FAILED=yes fi } @@ -661,6 +663,7 @@ present() { if ! [ -e $TEST/$1 -o -L $TEST/$1 ]; then echo "File $1 should be present" + FAILED=yes fi } @@ -669,6 +672,7 @@ fifo() { if ! [ -p $TEST/$1 ]; then echo "File $1 should be a FIFO" + FAILED=yes fi } @@ -677,6 +681,7 @@ dir() { if ! [ -d $TEST/$1 ]; then echo "File $1 should be a directory" + FAILED=yes fi } @@ -688,10 +693,12 @@ link() if ! [ -L $TEST/$1 ]; then echo "File $1 should be a link" + FAILED=yes elif [ $# -gt 1 ]; then val=`readlink $TEST/$1` if [ "$val" != "$2" ]; then echo "Link $1 should link to \"$2\"" + FAILED=yes fi fi } @@ -705,15 +712,18 @@ file() if ! [ -f $TEST/$1 ]; then echo "File $1 should be a regular file" + FAILED=yes elif [ $# -eq 2 ]; then contents=`cat $TEST/$1` if [ "$contents" != "$2" ]; then echo "File $1 has wrong contents" + FAILED=yes fi elif [ $# -eq 3 ]; then sum=`md5 -q $TEST/$1` if [ "$sum" != "$3" ]; then echo "File $1 has wrong contents" + FAILED=yes fi fi } @@ -726,10 +736,12 @@ conflict() if ! [ -f $CONFLICTS/$1 ]; then echo "File $1 missing conflict" + FAILED=yes elif [ $# -gt 1 ]; then sum=`md5 -q $CONFLICTS/$1` if [ "$sum" != "$2" ]; then echo "Conflict $1 has wrong contents" + FAILED=yes fi fi } @@ -920,6 +932,7 @@ check_trees() if [ `id -u` -ne 0 ]; then echo "must be root" + exit 0 fi if [ -r /etc/etcupdate.conf ]; then @@ -994,11 +1007,15 @@ Warnings: EOF echo "Differences for -n:" -diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/testn.out +diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/testn.out \ + || failed=YES $COMMAND -r -d $WORKDIR -D $TEST > $WORKDIR/test.out echo "Differences for real:" -diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out +diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out \ + || failed=YES check_trees + +[ "${FAILED}" = no ] Modified: head/tools/regression/usr.sbin/etcupdate/tzsetup.sh ============================================================================== --- head/tools/regression/usr.sbin/etcupdate/tzsetup.sh Sun Mar 16 02:07:08 2014 (r263220) +++ head/tools/regression/usr.sbin/etcupdate/tzsetup.sh Sun Mar 16 02:27:27 2014 (r263221) @@ -29,6 +29,7 @@ # Various regression tests for the tzsetup handling in the 'update' command. +FAILED=no WORKDIR=work usage() @@ -85,6 +86,7 @@ missing() { if [ -e $TEST/$1 -o -L $TEST/$1 ]; then echo "File $1 should be missing" + FAILED=yes fi } @@ -96,10 +98,12 @@ link() if ! [ -L $TEST/$1 ]; then echo "File $1 should be a link" + FAILED=yes elif [ $# -gt 1 ]; then val=`readlink $TEST/$1` if [ "$val" != "$2" ]; then echo "Link $1 should link to \"$2\"" + FAILED=yes fi fi } @@ -113,21 +117,25 @@ file() if ! [ -f $TEST/$1 ]; then echo "File $1 should be a regular file" + FAILED=yes elif [ $# -eq 2 ]; then contents=`cat $TEST/$1` if [ "$contents" != "$2" ]; then echo "File $1 has wrong contents" + FAILED=yes fi elif [ $# -eq 3 ]; then sum=`md5 -q $TEST/$1` if [ "$sum" != "$3" ]; then echo "File $1 has wrong contents" + FAILED=yes fi fi } if [ `id -u` -ne 0 ]; then echo "must be root" + exit 0 fi if [ -r /etc/etcupdate.conf ]; then @@ -144,12 +152,14 @@ cat > $WORKDIR/correct.out < $WORKDIR/test.out echo "Differences for no /etc/localtime:" -diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out +diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out \ + || FAILED=yes missing /etc/localtime missing /var/db/zoneinfo @@ -165,12 +175,14 @@ cat > $WORKDIR/correct.out < $WORKDIR/test.out echo "Differences for symlinked /etc/localtime:" -diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out +diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out \ + || FAILED=yes link /etc/localtime "/dev/null" missing /var/db/zoneinfo @@ -188,12 +200,14 @@ Warnings: EOF echo "Differences for missing /var/db/zoneinfo with -n:" -diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/testn.out +diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/testn.out \ + || FAILED=yes $COMMAND -r -d $WORKDIR -D $TEST > $WORKDIR/test.out echo "Differences for missing /var/db/zoneinfo:" -diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out +diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out \ + || FAILED=yes file /etc/localtime "bar" missing /var/db/zoneinfo @@ -210,12 +224,16 @@ cat > $WORKDIR/correct.out < $WORKDIR/test.out echo "Differences for real update:" -diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out +diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out \ + || FAILED=yes file /etc/localtime "foo" file /var/db/zoneinfo "foo" + +[ "${FAILED}" = no ] From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 02:32:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 280DDF9F; Sun, 16 Mar 2014 02:32:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1547A164; Sun, 16 Mar 2014 02:32:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2G2WiNS013829; Sun, 16 Mar 2014 02:32:44 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2G2Wi2T013828; Sun, 16 Mar 2014 02:32:44 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403160232.s2G2Wi2T013828@svn.freebsd.org> From: Julio Merino Date: Sun, 16 Mar 2014 02:32:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263222 - head/sbin/mdconfig/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 02:32:45 -0000 Author: jmmv Date: Sun Mar 16 02:32:44 2014 New Revision: 263222 URL: http://svnweb.freebsd.org/changeset/base/263222 Log: Add Makefile missed in r263220. Added: head/sbin/mdconfig/tests/Makefile (contents, props changed) Added: head/sbin/mdconfig/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/mdconfig/tests/Makefile Sun Mar 16 02:32:44 2014 (r263222) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/sbin/mdconfig + +TAP_TESTS_SH= legacy_test +TAP_TESTS_SH_SED_legacy_test= 's,__PERL__,${TAP_PERL_INTERPRETER},g' +TEST_METADATA.legacy_test+= required_programs="${TAP_PERL_INTERPRETER}" + +FILESDIR= ${TESTSDIR} +FILES= mdconfig.test +FILES+= run.pl + +.include From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 02:34:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8601D171; Sun, 16 Mar 2014 02:34:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 72D9D16C; Sun, 16 Mar 2014 02:34:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2G2YYab014099; Sun, 16 Mar 2014 02:34:34 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2G2YYuZ014098; Sun, 16 Mar 2014 02:34:34 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403160234.s2G2YYuZ014098@svn.freebsd.org> From: Adrian Chadd Date: Sun, 16 Mar 2014 02:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263223 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 02:34:34 -0000 Author: adrian Date: Sun Mar 16 02:34:33 2014 New Revision: 263223 URL: http://svnweb.freebsd.org/changeset/base/263223 Log: * Add ethernet MAC configuration from the EEPROM for arge0/arge1 * The AR9344 switch has 5 ports in use, not four. Tested: * DB120 reference board Modified: head/sys/mips/conf/DB120.hints Modified: head/sys/mips/conf/DB120.hints ============================================================================== --- head/sys/mips/conf/DB120.hints Sun Mar 16 02:32:44 2014 (r263222) +++ head/sys/mips/conf/DB120.hints Sun Mar 16 02:34:33 2014 (r263223) @@ -55,6 +55,9 @@ hint.arge.0.fduplex=1 hint.arge.0.miimode=3 # RGMII hint.arge.0.pll_1000=0x06000000 +# MAC for arge0 is the first 6 bytes of the ART +hint.arge.0.eeprommac=0x1f7f0000 + # mdiobus1 on arge1 hint.argemdio.1.at="nexus0" hint.argemdio.1.maddr=0x1a000000 @@ -67,7 +70,7 @@ hint.argemdio.1.order=0 hint.arswitch.1.at="mdio2" hint.arswitch.1.is_7240=0 hint.arswitch.1.is_9340=1 -hint.arswitch.1.numphys=4 +hint.arswitch.1.numphys=5 hint.arswitch.1.phy4cpu=0 # phy 4 is not a "CPU port" PHY here hint.arswitch.1.is_rgmii=0 hint.arswitch.1.is_gmii=1 # arge1 <-> switch PHY is GMII @@ -78,6 +81,9 @@ hint.arge.1.media=1000 hint.arge.1.fduplex=1 hint.arge.1.miimode=1 # GMII +# MAC for arge1 is the second 6 bytes of the ART +hint.arge.1.eeprommac=0x1f7f0006 + # ath0: Where the ART is - last 64k in the flash hint.ath.0.eepromaddr=0x1fff0000 hint.ath.0.eepromsize=16384 From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 02:41:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB6C6383; Sun, 16 Mar 2014 02:41:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7FEC41B3; Sun, 16 Mar 2014 02:41:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2G2flI3017756; Sun, 16 Mar 2014 02:41:47 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2G2flQb017755; Sun, 16 Mar 2014 02:41:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403160241.s2G2flQb017755@svn.freebsd.org> From: Adrian Chadd Date: Sun, 16 Mar 2014 02:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263224 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 02:41:47 -0000 Author: adrian Date: Sun Mar 16 02:41:47 2014 New Revision: 263224 URL: http://svnweb.freebsd.org/changeset/base/263224 Log: Handle the case where both arge0 and arge1 MAC addresses are available via 'eeprommac'. The existing driver would just make arge units past 0 take the primary MAC and increment it by the unit number, without correct address wrapping. That has to be fixed at a later date. Tested: * Atheros DB120 reference obard Modified: head/sys/mips/atheros/if_arge.c Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Sun Mar 16 02:34:33 2014 (r263223) +++ head/sys/mips/atheros/if_arge.c Sun Mar 16 02:41:47 2014 (r263224) @@ -555,6 +555,7 @@ arge_attach(device_t dev) long eeprom_mac_addr = 0; int miicfg = 0; int readascii = 0; + int local_mac = 0; sc = device_get_softc(dev); sc->arge_dev = dev; @@ -576,6 +577,7 @@ arge_attach(device_t dev) */ if (resource_long_value(device_get_name(dev), device_get_unit(dev), "eeprommac", &eeprom_mac_addr) == 0) { + local_mac = 1; int i; const char *mac = (const char *) MIPS_PHYS_TO_KSEG1(eeprom_mac_addr); @@ -729,7 +731,22 @@ arge_attach(device_t dev) sc->arge_eaddr[4] = (rnd >> 16) & 0xff; sc->arge_eaddr[5] = (rnd >> 8) & 0xff; } - if (sc->arge_mac_unit != 0) + + /* + * This is a little hairy and stupid. + * + * For some older boards, the arge1 mac isn't pulled from anywhere. + * It's just assumed the MAC is the base MAC + 1. + * + * For other boards, there's multiple MAC addresses stored in EEPROM. + * + * So, if we did read the eeprommac for this particular interface, + * let's use the address as given. Otherwise, just add the MAC unit + * counter to it. + * + * XXX TODO: we really should handle MAC byte wraparound! + */ + if (local_mac == 0 && sc->arge_mac_unit != 0) sc->arge_eaddr[5] += sc->arge_mac_unit; if (arge_dma_alloc(sc) != 0) { From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 04:09:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1BA50D52; Sun, 16 Mar 2014 04:09:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EF704A7B; Sun, 16 Mar 2014 04:09:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2G49Oo5051388; Sun, 16 Mar 2014 04:09:24 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2G49MQE051372; Sun, 16 Mar 2014 04:09:22 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403160409.s2G49MQE051372@svn.freebsd.org> From: Julio Merino Date: Sun, 16 Mar 2014 04:09:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263226 - in head: etc/mtree tools/regression/usr.bin tools/regression/usr.bin/lastcomm tools/regression/usr.sbin usr.bin/lastcomm usr.bin/lastcomm/tests usr.sbin usr.sbin/etcupdate usr... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 04:09:25 -0000 Author: jmmv Date: Sun Mar 16 04:09:22 2014 New Revision: 263226 URL: http://svnweb.freebsd.org/changeset/base/263226 Log: Migrate tools/regression/{usr.bin/lastcomm,usr.sbin}/ to the new tests layout. This change was originally going to only migrate the usr.sbin tests but, as it turns out, the usr.sbin/sa/ tests require files from usr.bin/lastcomm/ so it's better to just also migrate the latter at the same time. The other usr.bin tests will be moved separately. To make these tests work within the test suite, some of them have required changes to prevent modifying the source directory and instead just rely on the current directory for file manipulation. Added: head/usr.bin/lastcomm/tests/ - copied from r263225, head/tools/regression/usr.bin/lastcomm/ head/usr.bin/lastcomm/tests/legacy_test.sh (contents, props changed) - copied, changed from r263225, head/tools/regression/usr.bin/lastcomm/regress.t head/usr.sbin/etcupdate/tests/ - copied from r263221, head/tools/regression/usr.sbin/etcupdate/ head/usr.sbin/etcupdate/tests/Makefile (contents, props changed) - copied unchanged from r263221, head/tools/regression/usr.sbin/etcupdate/always.sh - copied unchanged from r263221, head/tools/regression/usr.sbin/etcupdate/conflicts.sh - copied unchanged from r263221, head/tools/regression/usr.sbin/etcupdate/fbsdid.sh - copied unchanged from r263221, head/tools/regression/usr.sbin/etcupdate/ignore.sh - copied unchanged from r263221, head/tools/regression/usr.sbin/etcupdate/preworld.sh - copied unchanged from r263221, head/tools/regression/usr.sbin/etcupdate/tests.sh - copied unchanged from r263221, head/tools/regression/usr.sbin/etcupdate/tzsetup.sh head/usr.sbin/newsyslog/tests/ - copied from r263221, head/tools/regression/usr.sbin/newsyslog/ head/usr.sbin/newsyslog/tests/legacy_test.sh (contents, props changed) - copied, changed from r263221, head/tools/regression/usr.sbin/newsyslog/regress.sh head/usr.sbin/sa/tests/ - copied from r263221, head/tools/regression/usr.sbin/sa/ head/usr.sbin/sa/tests/legacy_test.sh (contents, props changed) - copied, changed from r263221, head/tools/regression/usr.sbin/sa/regress.t head/usr.sbin/tests/ head/usr.sbin/tests/Makefile (contents, props changed) Directory Properties: head/usr.sbin/etcupdate/tests/always_test.sh (props changed) head/usr.sbin/etcupdate/tests/conflicts_test.sh (props changed) head/usr.sbin/etcupdate/tests/fbsdid_test.sh (props changed) head/usr.sbin/etcupdate/tests/ignore_test.sh (props changed) head/usr.sbin/etcupdate/tests/preworld_test.sh (props changed) head/usr.sbin/etcupdate/tests/tests_test.sh (props changed) head/usr.sbin/etcupdate/tests/tzsetup_test.sh (props changed) Deleted: head/tools/regression/usr.bin/lastcomm/ head/tools/regression/usr.sbin/ head/usr.bin/lastcomm/tests/regress.t head/usr.sbin/etcupdate/tests/always.sh head/usr.sbin/etcupdate/tests/conflicts.sh head/usr.sbin/etcupdate/tests/fbsdid.sh head/usr.sbin/etcupdate/tests/ignore.sh head/usr.sbin/etcupdate/tests/preworld.sh head/usr.sbin/etcupdate/tests/tests.sh head/usr.sbin/etcupdate/tests/tzsetup.sh head/usr.sbin/newsyslog/tests/regress.sh head/usr.sbin/newsyslog/tests/regress.t head/usr.sbin/sa/tests/regress.t Modified: head/etc/mtree/BSD.tests.dist head/tools/regression/usr.bin/Makefile head/usr.bin/lastcomm/Makefile head/usr.bin/lastcomm/tests/Makefile head/usr.bin/lastcomm/tests/values.sh (contents, props changed) head/usr.sbin/Makefile head/usr.sbin/etcupdate/Makefile head/usr.sbin/newsyslog/Makefile head/usr.sbin/newsyslog/tests/Makefile head/usr.sbin/sa/Makefile head/usr.sbin/sa/tests/Makefile head/usr.sbin/sa/tests/prime.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Sun Mar 16 03:32:29 2014 (r263225) +++ head/etc/mtree/BSD.tests.dist Sun Mar 16 04:09:22 2014 (r263226) @@ -95,6 +95,16 @@ atf-sh .. .. + lastcomm + .. + .. + usr.sbin + etcupdate + .. + newsyslog + .. + sa + .. .. .. .. Modified: head/tools/regression/usr.bin/Makefile ============================================================================== --- head/tools/regression/usr.bin/Makefile Sun Mar 16 03:32:29 2014 (r263225) +++ head/tools/regression/usr.bin/Makefile Sun Mar 16 04:09:22 2014 (r263226) @@ -2,8 +2,5 @@ SUBDIR= apply calendar comm file2c join jot m4 ncal printf sed tr \ uudecode uuencode xargs -.if !defined(AUTOMATED) -SUBDIR+= lastcomm -.endif .include Modified: head/usr.bin/lastcomm/Makefile ============================================================================== --- head/usr.bin/lastcomm/Makefile Sun Mar 16 03:32:29 2014 (r263225) +++ head/usr.bin/lastcomm/Makefile Sun Mar 16 04:09:22 2014 (r263226) @@ -1,7 +1,13 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= lastcomm SRCS= lastcomm.c readrec.c +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: head/usr.bin/lastcomm/tests/Makefile ============================================================================== --- head/tools/regression/usr.bin/lastcomm/Makefile Sun Mar 16 03:32:29 2014 (r263225) +++ head/usr.bin/lastcomm/tests/Makefile Sun Mar 16 04:09:22 2014 (r263226) @@ -1,6 +1,21 @@ # $FreeBSD$ -all: regress +TESTSDIR= ${TESTSBASE}/usr.bin/lastcomm -regress: regress.t - ./regress.t +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= v1-amd64-acct.in +FILES+= v1-amd64.out +FILES+= v1-i386-acct.in +FILES+= v1-i386.out +FILES+= v1-sparc64-acct.in +FILES+= v1-sparc64.out +FILES+= v2-amd64-acct.in +FILES+= v2-amd64.out +FILES+= v2-i386-acct.in +FILES+= v2-i386.out +FILES+= v2-sparc64-acct.in +FILES+= v2-sparc64.out + +.include Copied and modified: head/usr.bin/lastcomm/tests/legacy_test.sh (from r263225, head/tools/regression/usr.bin/lastcomm/regress.t) ============================================================================== --- head/tools/regression/usr.bin/lastcomm/regress.t Sun Mar 16 03:32:29 2014 (r263225, copy source) +++ head/usr.bin/lastcomm/tests/legacy_test.sh Sun Mar 16 04:09:22 2014 (r263226) @@ -14,7 +14,7 @@ check() shift # Remove tty field, which varies between systems. awk '{$4 = ""; print}' | - if diff -q - $DIR/$1 + if diff -q - $1 then echo "ok $NUM" else @@ -23,19 +23,16 @@ check() } -cat $DIR/v1-$ARCH-acct.in $DIR/v2-$ARCH-acct.in >$DIR/v1v2-$ARCH-acct.in -cat $DIR/v2-$ARCH.out $DIR/v1-$ARCH.out >$DIR/v1v2-$ARCH.out +cat $DIR/v1-$ARCH-acct.in $DIR/v2-$ARCH-acct.in >v1v2-$ARCH-acct.in +cat $DIR/v2-$ARCH.out $DIR/v1-$ARCH.out >v1v2-$ARCH.out echo 1..6 -lastcomm -cesuS -f $DIR/v1-$ARCH-acct.in | check 1 v1-$ARCH.out -lastcomm -cesuS -f - <$DIR/v1-$ARCH-acct.in | tail -r | check 2 v1-$ARCH.out -lastcomm -cesuS -f $DIR/v2-$ARCH-acct.in | check 3 v2-$ARCH.out -lastcomm -cesuS -f - <$DIR/v2-$ARCH-acct.in | tail -r | check 4 v2-$ARCH.out -lastcomm -cesuS -f $DIR/v1v2-$ARCH-acct.in | check 5 v1v2-$ARCH.out -lastcomm -cesuS -f - <$DIR/v1v2-$ARCH-acct.in | tail -r | check 6 v1v2-$ARCH.out - -rm $DIR/v1v2-$ARCH-acct.in -rm $DIR/v1v2-$ARCH.out +lastcomm -cesuS -f $DIR/v1-$ARCH-acct.in | check 1 $DIR/v1-$ARCH.out +lastcomm -cesuS -f - <$DIR/v1-$ARCH-acct.in | tail -r | check 2 $DIR/v1-$ARCH.out +lastcomm -cesuS -f $DIR/v2-$ARCH-acct.in | check 3 $DIR/v2-$ARCH.out +lastcomm -cesuS -f - <$DIR/v2-$ARCH-acct.in | tail -r | check 4 $DIR/v2-$ARCH.out +lastcomm -cesuS -f v1v2-$ARCH-acct.in | check 5 v1v2-$ARCH.out +lastcomm -cesuS -f - + SCRIPTS=etcupdate.sh MAN= etcupdate.8 +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/usr.sbin/etcupdate/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/etcupdate/tests/Makefile Sun Mar 16 04:09:22 2014 (r263226) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.sbin/etcupdate + +PLAIN_TESTS_SH= +.for test in always_test \ + conflicts_test \ + fbsdid_test \ + ignore_test \ + preworld_test \ + tests_test \ + tzsetup_test +PLAIN_TESTS_SH+= ${test} +TEST_METADATA.${test}+= required_user="root" +.endfor + +.include Copied: head/usr.sbin/etcupdate/tests/always_test.sh (from r263221, head/tools/regression/usr.sbin/etcupdate/always.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/etcupdate/tests/always_test.sh Sun Mar 16 04:09:22 2014 (r263226, copy of r263221, head/tools/regression/usr.sbin/etcupdate/always.sh) @@ -0,0 +1,630 @@ +#!/bin/sh +# +# Copyright (c) 2010 Advanced Computing Technologies LLC +# Written by: John H. Baldwin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +# Various regression tests to test the -A flag to the 'update' command. + +FAILED=no +WORKDIR=work + +usage() +{ + echo "Usage: always.sh [-s script] [-w workdir]" + exit 1 +} + +# Allow the user to specify an alternate work directory or script. +COMMAND=etcupdate +while getopts "s:w:" option; do + case $option in + s) + COMMAND="sh $OPTARG" + ;; + w) + WORKDIR=$OPTARG + ;; + *) + echo + usage + ;; + esac +done +shift $((OPTIND - 1)) +if [ $# -ne 0 ]; then + usage +fi + +CONFLICTS=$WORKDIR/conflicts +OLD=$WORKDIR/old +NEW=$WORKDIR/current +TEST=$WORKDIR/test + +# The various states of the comparison of a file between two trees. +states="equal first second difftype difflinks difffiles" + +# These tests deal with ignoring certain patterns of files. We run +# the test multiple times forcing the install of different patterns. +build_trees() +{ + local i + + rm -rf $OLD $NEW $TEST $CONFLICTS + + for i in $states; do + for j in $states; do + for k in $states; do + mkdir -p $OLD/$i/$j/$k $NEW/$i/$j/$k \ + $TEST/$i/$j/$k + done + done + done + + # What follows are the various warning/conflict cases from the + # larger regression tests. These results of many of these + # tests should be changed when installation is forced. The + # cases when these updates should still fail even when forced + # are: 1) it should not force the removal of a modified file + # and 2) it should not remove a subdirectory that contains a + # modified or added file. + + # /first/difftype/second: File with different local type + # removed. Should generate a warning. + mkfifo $OLD/first/difftype/second/fifo + mkdir $TEST/first/difftype/second/fifo + + # /first/difflinks/second: Modified link removed. Should + # generate a warning. + ln -s "old link" $OLD/first/difflinks/second/link + ln -s "test link" $TEST/first/difflinks/second/link + + # /first/difffiles/second: Modified file removed. Should + # generate a warning. + echo "foo" > $OLD/first/difffiles/second/file + echo "bar" > $TEST/first/difffiles/second/file + + # /second/second/difftype: Newly added file conflicts with + # existing file in test tree of a different type. Should + # generate a warning. + mkdir $NEW/second/second/difftype/dir + mkfifo $TEST/second/second/difftype/dir + + # /second/second/difflinks: Newly added link conflicts with + # existing link in test tree. Should generate a warning. + ln -s "new link" $NEW/second/second/difflinks/link + ln -s "test link" $TEST/second/second/difflinks/link + + # /second/second/difffiles: Newly added file conflicts with + # existing file in test tree. Should generate a warning. + echo "new" > $NEW/second/second/difffiles/file + echo "test" > $TEST/second/second/difffiles/file + + # /difftype/first/first: A removed file has changed type. + # This should generate a warning. + mkfifo $OLD/difftype/first/first/fifo + mkdir $NEW/difftype/first/first/fifo + + # /difftype/difftype/difftype: All three files (old, new, and + # test) are different types from each other. This should + # generate a warning. + mkfifo $OLD/difftype/difftype/difftype/one + mkdir $NEW/difftype/difftype/difftype/one + echo "foo" > $TEST/difftype/difftype/difftype/one + mkdir $OLD/difftype/difftype/difftype/two + echo "baz" > $NEW/difftype/difftype/difftype/two + ln -s "bar" $TEST/difftype/difftype/difftype/two + + # /difftype/difftype/difflinks: A file has changed from a + # non-link to a link in both the new and test trees, but the + # target of the new and test links differ. This should + # generate a new link conflict. + mkfifo $OLD/difftype/difftype/difflinks/link + ln -s "new" $NEW/difftype/difftype/difflinks/link + ln -s "test" $TEST/difftype/difftype/difflinks/link + + # /difftype/difftype/difffile: A file has changed from a + # non-regular file to a regular file in both the new and test + # trees, but the contents in the new and test files differ. + # This should generate a new file conflict. + ln -s "old" $OLD/difftype/difftype/difffiles/file + echo "foo" > $NEW/difftype/difftype/difffiles/file + echo "bar" > $TEST/difftype/difftype/difffiles/file + + # /difflinks/first/first: A modified link is missing in the + # test tree. This should generate a warning. + ln -s "old" $OLD/difflinks/first/first/link + ln -s "new" $NEW/difflinks/first/first/link + + # /difflinks/difftype/difftype: An updated link has been + # changed to a different file type in the test tree. This + # should generate a warning. + ln -s "old" $OLD/difflinks/difftype/difftype/link + ln -s "new" $NEW/difflinks/difftype/difftype/link + echo "test" > $TEST/difflinks/difftype/difftype/link + + # /difflinks/difflinks/difflinks: An updated link has been + # modified in the test tree and doesn't match either the old + # or new links. This should generate a warning. + ln -s "old" $OLD/difflinks/difflinks/difflinks/link + ln -s "new" $NEW/difflinks/difflinks/difflinks/link + ln -s "test" $TEST/difflinks/difflinks/difflinks/link + + # /difffiles/first/first: A removed file has been changed in + # the new tree. This should generate a warning. + echo "foo" > $OLD/difffiles/first/first/file + echo "bar" > $NEW/difffiles/first/first/file + + # /difffiles/difftype/difftype: An updated regular file has + # been changed to a different file type in the test tree. + # This should generate a warning. + echo "old" > $OLD/difffiles/difftype/difftype/file + echo "new" > $NEW/difffiles/difftype/difftype/file + mkfifo $TEST/difffiles/difftype/difftype/file + + # /difffiles/difffiles/difffiles: A modified regular file was + # updated in the new tree. The changes should be merged into + # to the new file if possible. If the merge fails, a conflict + # should be generated. For this test we just include the + # conflict case. + cat > $OLD/difffiles/difffiles/difffiles/conflict < $NEW/difffiles/difffiles/difffiles/conflict < $TEST/difffiles/difffiles/difffiles/conflict < $TEST/rmdir/extra/localfile.txt + + # /rmdir/conflict: Do not remove a directory with a conflicted + # remove file. This should generate a warning. + for i in $OLD $TEST; do + mkdir $i/rmdir/conflict + done + mkfifo $OLD/rmdir/conflict/difftype + mkdir $TEST/rmdir/conflict/difftype + + ## Tests for converting files to directories and vice versa + for i in $OLD $NEW $TEST; do + for j in already old fromdir todir; do + mkdir -p $i/dirchange/$j + done + done + + # /dirchange/fromdir/extradir: Convert a directory tree to a + # file. The test tree includes an extra file in the directory + # that is not present in the old tree. This should generate a + # warning. + for i in $OLD $TEST; do + mkdir $i/dirchange/fromdir/extradir + echo "foo" > $i/dirchange/fromdir/extradir/file + done + mkfifo $TEST/dirchange/fromdir/extradir/fifo + ln -s "bar" $NEW/dirchange/fromdir/extradir + + # /dirchange/fromdir/conflict: Convert a directory tree to a + # file. The test tree includes a local change that generates + # a warning and prevents the removal of the directory. + for i in $OLD $TEST; do + mkdir $i/dirchange/fromdir/conflict + done + echo "foo" > $OLD/dirchange/fromdir/conflict/somefile + echo "bar" > $TEST/dirchange/fromdir/conflict/somefile + mkfifo $NEW/dirchange/fromdir/conflict + + # /dirchange/todir/difffile: Convert a file to a directory + # tree. The test tree has a locally modified version of the + # file so that the conversion fails with a warning. + echo "foo" > $OLD/dirchange/todir/difffile + mkdir $NEW/dirchange/todir/difffile + echo "baz" > $NEW/dirchange/todir/difffile/file + echo "bar" > $TEST/dirchange/todir/difffile + + # /dirchange/todir/difftype: Similar to the previous test, but + # the conflict is due to a change in the file type. + echo "foo" > $OLD/dirchange/todir/difftype + mkdir $NEW/dirchange/todir/difftype + echo "baz" > $NEW/dirchange/todir/difftype/file + mkfifo $TEST/dirchange/todir/difftype +} + +# $1 - relative path to file that should be missing from TEST +missing() +{ + if [ -e $TEST/$1 -o -L $TEST/$1 ]; then + echo "File $1 should be missing" + FAILED=yes + fi +} + +# $1 - relative path to file that should be present in TEST +present() +{ + if ! [ -e $TEST/$1 -o -L $TEST/$1 ]; then + echo "File $1 should be present" + FAILED=yes + fi +} + +# $1 - relative path to file that should be a fifo in TEST +fifo() +{ + if ! [ -p $TEST/$1 ]; then + echo "File $1 should be a FIFO" + FAILED=yes + fi +} + +# $1 - relative path to file that should be a directory in TEST +dir() +{ + if ! [ -d $TEST/$1 ]; then + echo "File $1 should be a directory" + FAILED=yes + fi +} + +# $1 - relative path to file that should be a symlink in TEST +# $2 - optional value of the link +link() +{ + local val + + if ! [ -L $TEST/$1 ]; then + echo "File $1 should be a link" + FAILED=yes + elif [ $# -gt 1 ]; then + val=`readlink $TEST/$1` + if [ "$val" != "$2" ]; then + echo "Link $1 should link to \"$2\"" + FAILED=yes + fi + fi +} + +# $1 - relative path to regular file that should be present in TEST +# $2 - optional string that should match file contents +# $3 - optional MD5 of the flie contents, overrides $2 if present +file() +{ + local contents sum + + if ! [ -f $TEST/$1 ]; then + echo "File $1 should be a regular file" + FAILED=yes + elif [ $# -eq 2 ]; then + contents=`cat $TEST/$1` + if [ "$contents" != "$2" ]; then + echo "File $1 has wrong contents" + FAILED=yes + fi + elif [ $# -eq 3 ]; then + sum=`md5 -q $TEST/$1` + if [ "$sum" != "$3" ]; then + echo "File $1 has wrong contents" + FAILED=yes + fi + fi +} + +# $1 - relative path to a regular file that should have a conflict +# $2 - optional MD5 of the conflict file contents +conflict() +{ + local sum + + if ! [ -f $CONFLICTS/$1 ]; then + echo "File $1 missing conflict" + FAILED=yes + elif [ $# -gt 1 ]; then + sum=`md5 -q $CONFLICTS/$1` + if [ "$sum" != "$2" ]; then + echo "Conflict $1 has wrong contents" + FAILED=yes + fi + fi +} + +# $1 - relative path to a regular file that should not have a conflict +noconflict() +{ + if [ -f $CONFLICTS/$1 ]; then + echo "File $1 should not have a conflict" + FAILED=yes + fi +} + +if [ `id -u` -ne 0 ]; then + echo "must be root" + exit 0 +fi + +if [ -r /etc/etcupdate.conf ]; then + echo "WARNING: /etc/etcupdate.conf settings may break some tests." +fi + +# First run the test ignoring no patterns. + +build_trees + +$COMMAND -r -d $WORKDIR -D $TEST > $WORKDIR/test.out + +cat > $WORKDIR/correct.out < \ + $WORKDIR/test1.out + +cat > $WORKDIR/correct1.out < +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +# Various regression tests to run for the 'resolve' command. + +FAILED=no +WORKDIR=work + +usage() +{ + echo "Usage: conflicts.sh [-s script] [-w workdir]" + exit 1 +} + +# Allow the user to specify an alternate work directory or script. +COMMAND=etcupdate +while getopts "s:w:" option; do + case $option in + s) + COMMAND="sh $OPTARG" + ;; + w) + WORKDIR=$OPTARG + ;; + *) + echo + usage + ;; + esac +done +shift $((OPTIND - 1)) +if [ $# -ne 0 ]; then + usage +fi + +CONFLICTS=$WORKDIR/conflicts +OLD=$WORKDIR/old +NEW=$WORKDIR/current +TEST=$WORKDIR/test + +# These tests deal with conflicts to a single file. For each test, we +# generate a conflict in /etc/login.conf. Each resolve option is tested +# to ensure it DTRT. +build_login_conflict() +{ + + rm -rf $OLD $NEW $TEST $CONFLICTS + mkdir -p $OLD/etc $NEW/etc $TEST/etc + + # Generate a conflict in /etc/login.conf. + cat > $OLD/etc/login.conf < $NEW/etc/login.conf < $TEST/etc/login.conf </dev/null +} + +# This is used to verify special handling for /etc/mail/aliases and +# the newaliases warning. +build_aliases_conflict() +{ + + rm -rf $OLD $NEW $TEST $CONFLICTS + mkdir -p $OLD/etc/mail $NEW/etc/mail $TEST/etc/mail + + # Generate a conflict in /etc/mail/aliases + cat > $OLD/etc/mail/aliases < $NEW/etc/mail/aliases < $TEST/etc/mail/aliases </dev/null +} + +# $1 - relative path to file that should be missing from TEST +missing() +{ + if [ -e $TEST/$1 -o -L $TEST/$1 ]; then + echo "File $1 should be missing" + FAILED=yes + fi +} + +# $1 - relative path to file that should be present in TEST +present() +{ + if ! [ -e $TEST/$1 -o -L $TEST/$1 ]; then + echo "File $1 should be present" + FAILED=yes + fi +} + +# $1 - relative path to regular file that should be present in TEST +# $2 - optional string that should match file contents +# $3 - optional MD5 of the flie contents, overrides $2 if present +file() +{ + local contents sum + + if ! [ -f $TEST/$1 ]; then + echo "File $1 should be a regular file" + FAILED=yes + elif [ $# -eq 2 ]; then + contents=`cat $TEST/$1` + if [ "$contents" != "$2" ]; then + echo "File $1 has wrong contents" + FAILED=yes + fi + elif [ $# -eq 3 ]; then + sum=`md5 -q $TEST/$1` + if [ "$sum" != "$3" ]; then + echo "File $1 has wrong contents" + FAILED=yes + fi + fi +} + +# $1 - relative path to a regular file that should have a conflict +# $2 - optional MD5 of the conflict file contents +conflict() +{ + local sum + + if ! [ -f $CONFLICTS/$1 ]; then + echo "File $1 missing conflict" + FAILED=yes + elif [ $# -gt 1 ]; then + sum=`md5 -q $CONFLICTS/$1` + if [ "$sum" != "$2" ]; then + echo "Conflict $1 has wrong contents" + FAILED=yes + fi + fi +} + +# $1 - relative path to a regular file that should no longer have a conflict *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 07:25:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CFC2271; Sun, 16 Mar 2014 07:25:27 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 14C7AA27; Sun, 16 Mar 2014 07:25:26 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s2G7PP29080355 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 16 Mar 2014 00:25:26 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s2G7PPHO080354; Sun, 16 Mar 2014 00:25:25 -0700 (PDT) (envelope-from jmg) Date: Sun, 16 Mar 2014 00:25:25 -0700 From: John-Mark Gurney To: Andrew Turner Subject: Re: svn commit: r263210 - head/lib/msun/arm Message-ID: <20140316072525.GC32089@funkthat.com> References: <201403152158.s2FLw7po001183@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201403152158.s2FLw7po001183@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Sun, 16 Mar 2014 00:25:26 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 07:25:27 -0000 Andrew Turner wrote this message on Sat, Mar 15, 2014 at 21:58 +0000: > Author: andrew > Date: Sat Mar 15 21:58:07 2014 > New Revision: 263210 > URL: http://svnweb.freebsd.org/changeset/base/263210 > > Log: > On armv6 access both the softfloat and, when available, the vfp to get and > set the floating-point environment. Looks like this may have broken arm and armeb: http://tinderbox.freebsd.org/tinderbox-head-noclang-build-HEAD-arm-arm.brief -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 08:04:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D47DF644; Sun, 16 Mar 2014 08:04:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B73C9CB5; Sun, 16 Mar 2014 08:04:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2G84FNY046641; Sun, 16 Mar 2014 08:04:15 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2G847tQ046589; Sun, 16 Mar 2014 08:04:07 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403160804.s2G847tQ046589@svn.freebsd.org> From: Julio Merino Date: Sun, 16 Mar 2014 08:04:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263227 - in head: etc/mtree tools/regression/usr.bin tools/regression/usr.bin/apply tools/regression/usr.bin/calendar tools/regression/usr.bin/comm tools/regression/usr.bin/file2c tool... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 08:04:15 -0000 Author: jmmv Date: Sun Mar 16 08:04:06 2014 New Revision: 263227 URL: http://svnweb.freebsd.org/changeset/base/263227 Log: Migrate most of tools/regression/usr.bin/ to the new tests layout. I'm starting with the easy cases. The leftovers need to be looked at a bit more closely. Note that this change _does_ modify the code of the old tests. This is required in order to allow the code to locate the data files in the source directory instead of the current directory, because Kyua automatically changes the latter to a temporary directory. Also note that at least one test is known to be broken here. Actually, the test is not really broken: it's marked as a TODO but unfortunately Kyua's TAP parser currently does not understand that. Will have to be fixed separately. Added: head/usr.bin/apply/tests/ - copied from r263226, head/tools/regression/usr.bin/apply/ head/usr.bin/apply/tests/legacy_test.sh - copied, changed from r263226, head/tools/regression/usr.bin/apply/regress.t head/usr.bin/calendar/tests/ - copied from r263225, head/tools/regression/usr.bin/calendar/ head/usr.bin/calendar/tests/legacy_test.sh - copied, changed from r263225, head/tools/regression/usr.bin/calendar/regress.t head/usr.bin/comm/tests/ - copied from r263225, head/tools/regression/usr.bin/comm/ head/usr.bin/comm/tests/legacy_test.sh - copied, changed from r263225, head/tools/regression/usr.bin/comm/regress.t head/usr.bin/file2c/tests/ - copied from r263225, head/tools/regression/usr.bin/file2c/ head/usr.bin/file2c/tests/legacy_test.sh - copied, changed from r263225, head/tools/regression/usr.bin/file2c/regress.t head/usr.bin/join/tests/ - copied from r263225, head/tools/regression/usr.bin/join/ head/usr.bin/join/tests/legacy_test.sh - copied, changed from r263225, head/tools/regression/usr.bin/join/regress.t head/usr.bin/jot/tests/ - copied from r263225, head/tools/regression/usr.bin/jot/ head/usr.bin/jot/tests/legacy_test.sh - copied, changed from r263225, head/tools/regression/usr.bin/jot/regress.t head/usr.bin/m4/tests/ - copied from r263225, head/tools/regression/usr.bin/m4/ head/usr.bin/m4/tests/legacy_test.sh - copied, changed from r263225, head/tools/regression/usr.bin/m4/regress.t head/usr.bin/ncal/tests/ - copied from r263225, head/tools/regression/usr.bin/ncal/ head/usr.bin/ncal/tests/legacy_test.sh - copied, changed from r263225, head/tools/regression/usr.bin/ncal/regress.t head/usr.bin/printf/tests/ - copied from r263225, head/tools/regression/usr.bin/printf/ head/usr.bin/printf/tests/legacy_test.sh - copied, changed from r263225, head/tools/regression/usr.bin/printf/regress.t head/usr.bin/sed/tests/ - copied from r263225, head/tools/regression/usr.bin/sed/ head/usr.bin/sed/tests/inplace_race_test.sh - copied, changed from r263225, head/tools/regression/usr.bin/sed/inplace_race.t head/usr.bin/sed/tests/legacy_test.sh - copied, changed from r263225, head/tools/regression/usr.bin/sed/regress.t head/usr.bin/sed/tests/multi_test.sh - copied, changed from r263225, head/tools/regression/usr.bin/sed/multitest.t head/usr.bin/sed/tests/regress.multitest.out/Makefile (contents, props changed) head/usr.bin/tests/regress.m4 - copied, changed from r263225, head/tools/regression/usr.bin/regress.m4 head/usr.bin/tr/tests/ - copied from r263225, head/tools/regression/usr.bin/tr/ head/usr.bin/tr/tests/legacy_test.sh - copied, changed from r263225, head/tools/regression/usr.bin/tr/regress.t head/usr.bin/uudecode/tests/ - copied from r263225, head/tools/regression/usr.bin/uudecode/ head/usr.bin/uudecode/tests/legacy_test.sh - copied, changed from r263225, head/tools/regression/usr.bin/uudecode/regress.t head/usr.bin/uuencode/tests/ - copied from r263225, head/tools/regression/usr.bin/uuencode/ head/usr.bin/uuencode/tests/legacy_test.sh - copied, changed from r263225, head/tools/regression/usr.bin/uuencode/regress.t head/usr.bin/xargs/tests/ - copied from r263225, head/tools/regression/usr.bin/xargs/ head/usr.bin/xargs/tests/legacy_test.sh - copied, changed from r263225, head/tools/regression/usr.bin/xargs/regress.t head/usr.bin/yacc/tests/ - copied from r263225, head/tools/regression/usr.bin/yacc/ head/usr.bin/yacc/tests/legacy_test.sh (contents, props changed) - copied, changed from r263225, head/tools/regression/usr.bin/yacc/regress.t Deleted: head/tools/regression/usr.bin/Makefile head/tools/regression/usr.bin/apply/ head/tools/regression/usr.bin/calendar/ head/tools/regression/usr.bin/comm/ head/tools/regression/usr.bin/file2c/ head/tools/regression/usr.bin/join/ head/tools/regression/usr.bin/jot/ head/tools/regression/usr.bin/m4/ head/tools/regression/usr.bin/ncal/ head/tools/regression/usr.bin/printf/ head/tools/regression/usr.bin/regress.m4 head/tools/regression/usr.bin/sed/ head/tools/regression/usr.bin/tr/ head/tools/regression/usr.bin/uudecode/ head/tools/regression/usr.bin/uuencode/ head/tools/regression/usr.bin/xargs/ head/tools/regression/usr.bin/yacc/ head/usr.bin/apply/tests/regress.t head/usr.bin/calendar/tests/regress.t head/usr.bin/comm/tests/regress.t head/usr.bin/file2c/tests/regress.t head/usr.bin/join/tests/regress.t head/usr.bin/jot/tests/regress.t head/usr.bin/m4/tests/regress.t head/usr.bin/ncal/tests/regress.t head/usr.bin/printf/tests/regress.t head/usr.bin/sed/tests/inplace_race.t head/usr.bin/sed/tests/multitest.t head/usr.bin/sed/tests/regress.t head/usr.bin/tr/tests/regress.t head/usr.bin/uudecode/tests/regress.t head/usr.bin/uuencode/tests/regress.t head/usr.bin/xargs/tests/regress.t head/usr.bin/yacc/tests/regress.t Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/apply/Makefile head/usr.bin/apply/tests/Makefile head/usr.bin/apply/tests/regress.sh head/usr.bin/calendar/Makefile head/usr.bin/calendar/tests/Makefile head/usr.bin/calendar/tests/regress.sh head/usr.bin/comm/Makefile head/usr.bin/comm/tests/Makefile head/usr.bin/comm/tests/regress.sh head/usr.bin/file2c/Makefile head/usr.bin/file2c/tests/Makefile head/usr.bin/file2c/tests/regress.sh head/usr.bin/join/Makefile head/usr.bin/join/tests/Makefile head/usr.bin/join/tests/regress.sh head/usr.bin/jot/Makefile head/usr.bin/jot/tests/Makefile head/usr.bin/m4/Makefile head/usr.bin/m4/tests/Makefile head/usr.bin/m4/tests/regress.sh head/usr.bin/ncal/Makefile head/usr.bin/ncal/tests/Makefile head/usr.bin/printf/Makefile head/usr.bin/printf/tests/Makefile head/usr.bin/sed/Makefile head/usr.bin/sed/tests/Makefile head/usr.bin/sed/tests/regress.sh head/usr.bin/tests/Makefile head/usr.bin/tr/Makefile head/usr.bin/tr/tests/Makefile head/usr.bin/tr/tests/regress.sh head/usr.bin/uudecode/Makefile head/usr.bin/uudecode/tests/Makefile head/usr.bin/uudecode/tests/regress.sh head/usr.bin/uuencode/Makefile head/usr.bin/uuencode/tests/Makefile head/usr.bin/uuencode/tests/regress.sh head/usr.bin/xargs/Makefile head/usr.bin/xargs/tests/Makefile head/usr.bin/xargs/tests/regress.sh head/usr.bin/yacc/Makefile head/usr.bin/yacc/tests/Makefile head/usr.bin/yacc/tests/regress.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Sun Mar 16 04:09:22 2014 (r263226) +++ head/etc/mtree/BSD.tests.dist Sun Mar 16 08:04:06 2014 (r263227) @@ -91,12 +91,44 @@ .. .. usr.bin + apply + .. atf atf-sh .. .. + calendar + .. + comm + .. + file2c + .. + join + .. + jot + .. lastcomm .. + m4 + .. + ncal + .. + printf + .. + sed + regress.multitest.out + .. + .. + tr + .. + uudecode + .. + uuencode + .. + xargs + .. + yacc + .. .. usr.sbin etcupdate Modified: head/usr.bin/apply/Makefile ============================================================================== --- head/usr.bin/apply/Makefile Sun Mar 16 04:09:22 2014 (r263226) +++ head/usr.bin/apply/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -1,8 +1,14 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= apply DPADD= ${LIBSBUF} LDADD= -lsbuf +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: head/usr.bin/apply/tests/Makefile ============================================================================== --- head/tools/regression/usr.bin/apply/Makefile Sun Mar 16 04:09:22 2014 (r263226) +++ head/usr.bin/apply/tests/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -1,4 +1,14 @@ # $FreeBSD$ -all: - @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR} +TESTSDIR= ${TESTSBASE}/usr.bin/apply + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= regress.00.in +FILES+= regress.00.out +FILES+= regress.01.out +FILES+= regress.01.sh +FILES+= regress.sh + +.include Copied and modified: head/usr.bin/apply/tests/legacy_test.sh (from r263226, head/tools/regression/usr.bin/apply/regress.t) ============================================================================== --- head/tools/regression/usr.bin/apply/regress.t Sun Mar 16 04:09:22 2014 (r263226, copy source) +++ head/usr.bin/apply/tests/legacy_test.sh Sun Mar 16 08:04:06 2014 (r263227) @@ -1,6 +1,6 @@ #!/bin/sh # $FreeBSD$ -cd `dirname $0` +SRCDIR="$(dirname "${0}")"; export SRCDIR -m4 ../regress.m4 regress.sh | sh +m4 "${SRCDIR}/../regress.m4" "${SRCDIR}/regress.sh" | sh Modified: head/usr.bin/apply/tests/regress.sh ============================================================================== --- head/tools/regression/usr.bin/apply/regress.sh Sun Mar 16 04:09:22 2014 (r263226) +++ head/usr.bin/apply/tests/regress.sh Sun Mar 16 08:04:06 2014 (r263227) @@ -4,7 +4,7 @@ echo 1..2 REGRESSION_START($1) -REGRESSION_TEST(`00', `apply "echo %1 %1 %1 %1" $(cat regress.00.in)') -REGRESSION_TEST(`01', `sh regress.01.sh') +REGRESSION_TEST(`00', `apply "echo %1 %1 %1 %1" $(cat ${SRCDIR}/regress.00.in)') +REGRESSION_TEST(`01', `sh ${SRCDIR}/regress.01.sh') REGRESSION_END() Modified: head/usr.bin/calendar/Makefile ============================================================================== --- head/usr.bin/calendar/Makefile Sun Mar 16 04:09:22 2014 (r263226) +++ head/usr.bin/calendar/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= calendar SRCS= calendar.c locale.c events.c dates.c parsedata.c io.c day.c \ ostern.c paskha.c pom.c sunpos.c calcpp.c @@ -31,4 +33,8 @@ beforeinstall: ln -s fr_FR.ISO8859-1 ${DESTDIR}${SHAREDIR}/calendar/${link} .endfor +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: head/usr.bin/calendar/tests/Makefile ============================================================================== --- head/tools/regression/usr.bin/calendar/Makefile Sun Mar 16 03:32:29 2014 (r263225) +++ head/usr.bin/calendar/tests/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -1,4 +1,39 @@ # $FreeBSD$ -all: - @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR} +TESTSDIR= ${TESTSBASE}/usr.bin/calendar + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= calendar.calibrate +FILES+= regress.a1.out +FILES+= regress.a2.out +FILES+= regress.a3.out +FILES+= regress.a4.out +FILES+= regress.a5.out +FILES+= regress.b1.out +FILES+= regress.b2.out +FILES+= regress.b3.out +FILES+= regress.b4.out +FILES+= regress.b5.out +FILES+= regress.s1.out +FILES+= regress.s2.out +FILES+= regress.s3.out +FILES+= regress.s4.out +FILES+= regress.sh +FILES+= regress.w0-1.out +FILES+= regress.w0-2.out +FILES+= regress.w0-3.out +FILES+= regress.w0-4.out +FILES+= regress.w0-5.out +FILES+= regress.w0-6.out +FILES+= regress.w0-7.out +FILES+= regress.wn-1.out +FILES+= regress.wn-2.out +FILES+= regress.wn-3.out +FILES+= regress.wn-4.out +FILES+= regress.wn-5.out +FILES+= regress.wn-6.out +FILES+= regress.wn-7.out + +.include Copied and modified: head/usr.bin/calendar/tests/legacy_test.sh (from r263225, head/tools/regression/usr.bin/calendar/regress.t) ============================================================================== --- head/tools/regression/usr.bin/calendar/regress.t Sun Mar 16 03:32:29 2014 (r263225, copy source) +++ head/usr.bin/calendar/tests/legacy_test.sh Sun Mar 16 08:04:06 2014 (r263227) @@ -1,6 +1,6 @@ #!/bin/sh # $FreeBSD$ -cd `dirname $0` +SRCDIR="$(dirname "${0}")"; export SRCDIR -m4 ../regress.m4 regress.sh | sh +m4 "${SRCDIR}/../regress.m4" "${SRCDIR}/regress.sh" | sh Modified: head/usr.bin/calendar/tests/regress.sh ============================================================================== --- head/tools/regression/usr.bin/calendar/regress.sh Sun Mar 16 03:32:29 2014 (r263225) +++ head/usr.bin/calendar/tests/regress.sh Sun Mar 16 08:04:06 2014 (r263227) @@ -1,6 +1,6 @@ # $FreeBSD$ -CALENDAR_FILE="-f calendar.calibrate" +CALENDAR_FILE="-f ${SRCDIR}/calendar.calibrate" CALENDAR_BIN="calendar" CALENDAR="${CALENDAR_BIN} ${CALENDAR_FILE}" Modified: head/usr.bin/comm/Makefile ============================================================================== --- head/usr.bin/comm/Makefile Sun Mar 16 04:09:22 2014 (r263226) +++ head/usr.bin/comm/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -1,6 +1,12 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= comm +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: head/usr.bin/comm/tests/Makefile ============================================================================== --- head/tools/regression/usr.bin/comm/Makefile Sun Mar 16 03:32:29 2014 (r263225) +++ head/usr.bin/comm/tests/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -1,4 +1,19 @@ # $FreeBSD$ -all: - @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR} +TESTSDIR= ${TESTSBASE}/usr.bin/comm + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= regress.00.out +FILES+= regress.00a.in +FILES+= regress.00b.in +FILES+= regress.01.out +FILES+= regress.01a.in +FILES+= regress.01b.in +FILES+= regress.02.out +FILES+= regress.02a.in +FILES+= regress.02b.in +FILES+= regress.sh + +.include Copied and modified: head/usr.bin/comm/tests/legacy_test.sh (from r263225, head/tools/regression/usr.bin/comm/regress.t) ============================================================================== --- head/tools/regression/usr.bin/comm/regress.t Sun Mar 16 03:32:29 2014 (r263225, copy source) +++ head/usr.bin/comm/tests/legacy_test.sh Sun Mar 16 08:04:06 2014 (r263227) @@ -1,6 +1,6 @@ #!/bin/sh # $FreeBSD$ -cd `dirname $0` +SRCDIR="$(dirname "${0}")"; export SRCDIR -m4 ../regress.m4 regress.sh | sh +m4 "${SRCDIR}/../regress.m4" "${SRCDIR}/regress.sh" | sh Modified: head/usr.bin/comm/tests/regress.sh ============================================================================== --- head/tools/regression/usr.bin/comm/regress.sh Sun Mar 16 03:32:29 2014 (r263225) +++ head/usr.bin/comm/tests/regress.sh Sun Mar 16 08:04:06 2014 (r263227) @@ -1,13 +1,11 @@ # $FreeBSD$ -LC_ALL=C; export LC_ALL - echo 1..3 REGRESSION_START($1) -REGRESSION_TEST(`00', `comm -12 regress.00a.in regress.00b.in') -REGRESSION_TEST(`01', `comm -12 regress.01a.in regress.01b.in') -REGRESSION_TEST(`02', `comm regress.02a.in regress.02b.in') +REGRESSION_TEST(`00', `comm -12 ${SRCDIR}/regress.00a.in ${SRCDIR}/regress.00b.in') +REGRESSION_TEST(`01', `comm -12 ${SRCDIR}/regress.01a.in ${SRCDIR}/regress.01b.in') +REGRESSION_TEST(`02', `comm ${SRCDIR}/regress.02a.in ${SRCDIR}/regress.02b.in') REGRESSION_END() Modified: head/usr.bin/file2c/Makefile ============================================================================== --- head/usr.bin/file2c/Makefile Sun Mar 16 04:09:22 2014 (r263226) +++ head/usr.bin/file2c/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -1,4 +1,11 @@ # $FreeBSD$ +.include + PROG= file2c + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: head/usr.bin/file2c/tests/Makefile ============================================================================== --- head/tools/regression/usr.bin/file2c/Makefile Sun Mar 16 03:32:29 2014 (r263225) +++ head/usr.bin/file2c/tests/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -1,4 +1,20 @@ # $FreeBSD$ -all: - @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR} +TESTSDIR= ${TESTSBASE}/usr.bin/file2c + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= regress.1.out +FILES+= regress.2.out +FILES+= regress.3.out +FILES+= regress.4.out +FILES+= regress.5.out +FILES+= regress.6.out +FILES+= regress.7.out +FILES+= regress.8.out +FILES+= regress.9.out +FILES+= regress.in +FILES+= regress.sh + +.include Copied and modified: head/usr.bin/file2c/tests/legacy_test.sh (from r263225, head/tools/regression/usr.bin/file2c/regress.t) ============================================================================== --- head/tools/regression/usr.bin/file2c/regress.t Sun Mar 16 03:32:29 2014 (r263225, copy source) +++ head/usr.bin/file2c/tests/legacy_test.sh Sun Mar 16 08:04:06 2014 (r263227) @@ -1,6 +1,6 @@ #!/bin/sh # $FreeBSD$ -cd `dirname $0` +SRCDIR="$(dirname "${0}")"; export SRCDIR -m4 ../regress.m4 regress.sh | sh +m4 "${SRCDIR}/../regress.m4" "${SRCDIR}/regress.sh" | sh Modified: head/usr.bin/file2c/tests/regress.sh ============================================================================== --- head/tools/regression/usr.bin/file2c/regress.sh Sun Mar 16 03:32:29 2014 (r263225) +++ head/usr.bin/file2c/tests/regress.sh Sun Mar 16 08:04:06 2014 (r263227) @@ -4,16 +4,16 @@ echo 1..9 REGRESSION_START($1) -REGRESSION_TEST(`1', `head -c 13 regress.in | file2c') -REGRESSION_TEST(`2', `head -c 26 regress.in | file2c PREFIX') -REGRESSION_TEST(`3', `head -c 39 regress.in | file2c PREFIX SUFFIX') -REGRESSION_TEST(`4', `head -c 52 regress.in | file2c -x') -REGRESSION_TEST(`5', `head -c 65 regress.in | file2c -n -1') +REGRESSION_TEST(`1', `head -c 13 ${SRCDIR}/regress.in | file2c') +REGRESSION_TEST(`2', `head -c 26 ${SRCDIR}/regress.in | file2c PREFIX') +REGRESSION_TEST(`3', `head -c 39 ${SRCDIR}/regress.in | file2c PREFIX SUFFIX') +REGRESSION_TEST(`4', `head -c 52 ${SRCDIR}/regress.in | file2c -x') +REGRESSION_TEST(`5', `head -c 65 ${SRCDIR}/regress.in | file2c -n -1') -REGRESSION_TEST(`6', `head -c 7 regress.in | file2c -n 1 P S') -REGRESSION_TEST(`7', `head -c 14 regress.in | file2c -n 2 -x "P S"') -REGRESSION_TEST(`8', `head -c 21 regress.in | file2c -n 16 P -x S') +REGRESSION_TEST(`6', `head -c 7 ${SRCDIR}/regress.in | file2c -n 1 P S') +REGRESSION_TEST(`7', `head -c 14 ${SRCDIR}/regress.in | file2c -n 2 -x "P S"') +REGRESSION_TEST(`8', `head -c 21 ${SRCDIR}/regress.in | file2c -n 16 P -x S') -REGRESSION_TEST(`9', `file2c "const char data[] = {" ", 0};" < regress.in') +REGRESSION_TEST(`9', `file2c "const char data[] = {" ", 0};" <${SRCDIR}/regress.in') REGRESSION_END() Modified: head/usr.bin/join/Makefile ============================================================================== --- head/usr.bin/join/Makefile Sun Mar 16 04:09:22 2014 (r263226) +++ head/usr.bin/join/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -1,5 +1,12 @@ +# $FreeBSD$ # @(#)Makefile 8.1 (Berkeley) 6/6/93 +.include + PROG= join +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: head/usr.bin/join/tests/Makefile ============================================================================== --- head/tools/regression/usr.bin/join/Makefile Sun Mar 16 03:32:29 2014 (r263225) +++ head/usr.bin/join/tests/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -1,4 +1,13 @@ # $FreeBSD$ -all: - @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR} +TESTSDIR= ${TESTSBASE}/usr.bin/join + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= regress.1.in +FILES+= regress.2.in +FILES+= regress.out +FILES+= regress.sh + +.include Copied and modified: head/usr.bin/join/tests/legacy_test.sh (from r263225, head/tools/regression/usr.bin/join/regress.t) ============================================================================== --- head/tools/regression/usr.bin/join/regress.t Sun Mar 16 03:32:29 2014 (r263225, copy source) +++ head/usr.bin/join/tests/legacy_test.sh Sun Mar 16 08:04:06 2014 (r263227) @@ -1,6 +1,6 @@ #!/bin/sh # $FreeBSD$ -cd `dirname $0` +SRCDIR="$(dirname "${0}")"; export SRCDIR -m4 ../regress.m4 regress.sh | sh +m4 "${SRCDIR}/../regress.m4" "${SRCDIR}/regress.sh" | sh Modified: head/usr.bin/join/tests/regress.sh ============================================================================== --- head/tools/regression/usr.bin/join/regress.sh Sun Mar 16 03:32:29 2014 (r263225) +++ head/usr.bin/join/tests/regress.sh Sun Mar 16 08:04:06 2014 (r263227) @@ -4,6 +4,6 @@ echo 1..1 REGRESSION_START($1) -REGRESSION_TEST_ONE(`join -t , -a1 -a2 -e "(unknown)" -o 0,1.2,2.2 regress.1.in regress.2.in') +REGRESSION_TEST_ONE(`join -t , -a1 -a2 -e "(unknown)" -o 0,1.2,2.2 ${SRCDIR}/regress.1.in ${SRCDIR}/regress.2.in') REGRESSION_END() Modified: head/usr.bin/jot/Makefile ============================================================================== --- head/usr.bin/jot/Makefile Sun Mar 16 04:09:22 2014 (r263226) +++ head/usr.bin/jot/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -1,6 +1,12 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= jot +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: head/usr.bin/jot/tests/Makefile ============================================================================== --- head/tools/regression/usr.bin/jot/Makefile Sun Mar 16 03:32:29 2014 (r263225) +++ head/usr.bin/jot/tests/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -1,4 +1,71 @@ # $FreeBSD$ -all: - @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR} +TESTSDIR= ${TESTSBASE}/usr.bin/jot + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= regress.ascii.out +FILES+= regress.block.out +FILES+= regress.dddd.out +FILES+= regress.dddh.out +FILES+= regress.ddhd.out +FILES+= regress.ddhd2.out +FILES+= regress.ddhh.out +FILES+= regress.ddhh2.out +FILES+= regress.dhdd.out +FILES+= regress.dhdh.out +FILES+= regress.dhhd.out +FILES+= regress.dhhd2.out +FILES+= regress.dhhh.out +FILES+= regress.dhhh2.out +FILES+= regress.ed.out +FILES+= regress.grep.out +FILES+= regress.hddd.out +FILES+= regress.hddd2.out +FILES+= regress.hddh.out +FILES+= regress.hddh2.out +FILES+= regress.hdhd.out +FILES+= regress.hdhd2.out +FILES+= regress.hdhh.out +FILES+= regress.hdhh2.out +FILES+= regress.hhdd.out +FILES+= regress.hhdd2.out +FILES+= regress.hhdh.out +FILES+= regress.hhdh2.out +FILES+= regress.hhhd.out +FILES+= regress.hhhd2.out +FILES+= regress.hhhh.out +FILES+= regress.hhhh2.out +FILES+= regress.n21.out +FILES+= regress.rand1.out +FILES+= regress.rand2.out +FILES+= regress.sh +FILES+= regress.stutter.out +FILES+= regress.stutter2.out +FILES+= regress.tabs.out +FILES+= regress.wX1.out +FILES+= regress.wXl.out +FILES+= regress.wc.out +FILES+= regress.wdl.out +FILES+= regress.wdn.out +FILES+= regress.we.out +FILES+= regress.wf.out +FILES+= regress.wg.out +FILES+= regress.wgd.out +FILES+= regress.wo.out +FILES+= regress.wp1.out +FILES+= regress.wp2.out +FILES+= regress.wp3.out +FILES+= regress.wp4.out +FILES+= regress.wp5.out +FILES+= regress.wp6.out +FILES+= regress.wu.out +FILES+= regress.wwe.out +FILES+= regress.wx.out +FILES+= regress.wxn.out +FILES+= regress.x.out +FILES+= regress.xaa.out +FILES+= regress.yes.out + +.include Copied and modified: head/usr.bin/jot/tests/legacy_test.sh (from r263225, head/tools/regression/usr.bin/jot/regress.t) ============================================================================== --- head/tools/regression/usr.bin/jot/regress.t Sun Mar 16 03:32:29 2014 (r263225, copy source) +++ head/usr.bin/jot/tests/legacy_test.sh Sun Mar 16 08:04:06 2014 (r263227) @@ -1,6 +1,6 @@ #!/bin/sh # $FreeBSD$ -cd `dirname $0` +SRCDIR="$(dirname "${0}")"; export SRCDIR -m4 ../regress.m4 regress.sh | sh +m4 "${SRCDIR}/../regress.m4" "${SRCDIR}/regress.sh" | sh Modified: head/usr.bin/m4/Makefile ============================================================================== --- head/usr.bin/m4/Makefile Sun Mar 16 04:09:22 2014 (r263226) +++ head/usr.bin/m4/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -4,6 +4,8 @@ # -DEXTENDED # if you want the paste & spaste macros. +.include + PROG= m4 CFLAGS+=-DEXTENDED -I${.CURDIR} -I${.CURDIR}/lib DPADD= ${LIBY} ${LIBL} ${LIBM} @@ -22,4 +24,8 @@ tokenizer.o: parser.h CLEANFILES+= parser.c parser.h tokenizer.o +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: head/usr.bin/m4/tests/Makefile ============================================================================== --- head/tools/regression/usr.bin/m4/Makefile Sun Mar 16 03:32:29 2014 (r263225) +++ head/usr.bin/m4/tests/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -1,4 +1,52 @@ # $FreeBSD$ -all: - @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR} +TESTSDIR= ${TESTSBASE}/usr.bin/m4 + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= args.m4 +FILES+= args2.m4 +FILES+= comments.m4 +FILES+= esyscmd.m4 +FILES+= eval.m4 +FILES+= ff_after_dnl.m4.uu +FILES+= gnueval.m4 +FILES+= gnuformat.m4 +FILES+= gnupatterns.m4 +FILES+= gnupatterns2.m4 +FILES+= gnuprefix.m4 +FILES+= gnusofterror.m4 +FILES+= includes.aux +FILES+= includes.m4 +FILES+= m4wrap3.m4 +FILES+= patterns.m4 +FILES+= quotes.m4 +FILES+= redef.m4 +FILES+= regress.args.out +FILES+= regress.args2.out +FILES+= regress.comments.out +FILES+= regress.esyscmd.out +FILES+= regress.eval.out +FILES+= regress.ff_after_dnl.out +FILES+= regress.gnueval.out +FILES+= regress.gnuformat.out +FILES+= regress.gnupatterns.out +FILES+= regress.gnupatterns2.out +FILES+= regress.gnuprefix.out +FILES+= regress.gnusofterror.out +FILES+= regress.gnutranslit2.out +FILES+= regress.includes.out +FILES+= regress.m4wrap3.out +FILES+= regress.patterns.out +FILES+= regress.quotes.out +FILES+= regress.redef.out +FILES+= regress.sh +FILES+= regress.strangequotes.out +FILES+= regress.translit.out +FILES+= regress.translit2.out +FILES+= strangequotes.m4.uu +FILES+= translit.m4 +FILES+= translit2.m4 + +.include Copied and modified: head/usr.bin/m4/tests/legacy_test.sh (from r263225, head/tools/regression/usr.bin/m4/regress.t) ============================================================================== --- head/tools/regression/usr.bin/m4/regress.t Sun Mar 16 03:32:29 2014 (r263225, copy source) +++ head/usr.bin/m4/tests/legacy_test.sh Sun Mar 16 08:04:06 2014 (r263227) @@ -1,6 +1,6 @@ #!/bin/sh # $FreeBSD$ -cd `dirname $0` +SRCDIR="$(dirname "${0}")"; export SRCDIR -m4 ../regress.m4 regress.sh | sh +m4 "${SRCDIR}/../regress.m4" "${SRCDIR}/regress.sh" | sh Modified: head/usr.bin/m4/tests/regress.sh ============================================================================== --- head/tools/regression/usr.bin/m4/regress.sh Sun Mar 16 03:32:29 2014 (r263225) +++ head/usr.bin/m4/tests/regress.sh Sun Mar 16 08:04:06 2014 (r263227) @@ -1,31 +1,33 @@ # $FreeBSD$ -LC_ALL=C; export LC_ALL - echo 1..21 +test_m4() { + m4 "${@}" 2>&1 | sed -e "s,${SRCDIR}/,,g" +} + REGRESSION_START($1) -REGRESSION_TEST(`args', `m4 args.m4') -REGRESSION_TEST(`args2', `m4 args2.m4') -REGRESSION_TEST(`comments', `m4 comments.m4') -REGRESSION_TEST(`esyscmd', `m4 esyscmd.m4') -REGRESSION_TEST(`eval', `m4 eval.m4') -REGRESSION_TEST(`ff_after_dnl', `uudecode -o /dev/stdout ff_after_dnl.m4.uu | m4') -REGRESSION_TEST(`gnueval', `m4 -g gnueval.m4') -REGRESSION_TEST(`gnuformat', `m4 -g gnuformat.m4') -REGRESSION_TEST(`gnupatterns', `m4 -g gnupatterns.m4') -REGRESSION_TEST(`gnupatterns2', `m4 -g gnupatterns2.m4') -REGRESSION_TEST(`gnuprefix', `m4 -P gnuprefix.m4 2>&1') -REGRESSION_TEST(`gnusofterror', `m4 -g gnusofterror.m4 2>&1') -REGRESSION_TEST(`gnutranslit2', `m4 -g translit2.m4') -REGRESSION_TEST(`includes', `m4 -I. includes.m4') -REGRESSION_TEST(`m4wrap3', `m4 m4wrap3.m4') -REGRESSION_TEST(`patterns', `m4 patterns.m4') -REGRESSION_TEST(`quotes', `m4 quotes.m4 2>&1') -REGRESSION_TEST(`strangequotes', `uudecode -o /dev/stdout strangequotes.m4.uu | m4') -REGRESSION_TEST(`redef', `m4 redef.m4') -REGRESSION_TEST(`translit', `m4 translit.m4') -REGRESSION_TEST(`translit2', `m4 translit2.m4') +REGRESSION_TEST(`args', `test_m4 ${SRCDIR}/args.m4') +REGRESSION_TEST(`args2', `test_m4 ${SRCDIR}/args2.m4') +REGRESSION_TEST(`comments', `test_m4 ${SRCDIR}/comments.m4') +REGRESSION_TEST(`esyscmd', `test_m4 ${SRCDIR}/esyscmd.m4') +REGRESSION_TEST(`eval', `test_m4 ${SRCDIR}/eval.m4') +REGRESSION_TEST(`ff_after_dnl', `uudecode -o /dev/stdout ${SRCDIR}/ff_after_dnl.m4.uu | m4') +REGRESSION_TEST(`gnueval', `test_m4 -g ${SRCDIR}/gnueval.m4') +REGRESSION_TEST(`gnuformat', `test_m4 -g ${SRCDIR}/gnuformat.m4') +REGRESSION_TEST(`gnupatterns', `test_m4 -g ${SRCDIR}/gnupatterns.m4') +REGRESSION_TEST(`gnupatterns2', `test_m4 -g ${SRCDIR}/gnupatterns2.m4') +REGRESSION_TEST(`gnuprefix', `test_m4 -P ${SRCDIR}/gnuprefix.m4 2>&1') +REGRESSION_TEST(`gnusofterror', `test_m4 -g ${SRCDIR}/gnusofterror.m4 2>&1') +REGRESSION_TEST(`gnutranslit2', `test_m4 -g ${SRCDIR}/translit2.m4') +REGRESSION_TEST(`includes', `test_m4 -I${SRCDIR} ${SRCDIR}/includes.m4') +REGRESSION_TEST(`m4wrap3', `test_m4 ${SRCDIR}/m4wrap3.m4') +REGRESSION_TEST(`patterns', `test_m4 ${SRCDIR}/patterns.m4') +REGRESSION_TEST(`quotes', `test_m4 ${SRCDIR}/quotes.m4 2>&1') +REGRESSION_TEST(`strangequotes', `uudecode -o /dev/stdout ${SRCDIR}/strangequotes.m4.uu | m4') +REGRESSION_TEST(`redef', `test_m4 ${SRCDIR}/redef.m4') +REGRESSION_TEST(`translit', `test_m4 ${SRCDIR}/translit.m4') +REGRESSION_TEST(`translit2', `test_m4 ${SRCDIR}/translit2.m4') REGRESSION_END() Modified: head/usr.bin/ncal/Makefile ============================================================================== --- head/usr.bin/ncal/Makefile Sun Mar 16 04:09:22 2014 (r263226) +++ head/usr.bin/ncal/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= ncal DPADD= ${LIBCALENDAR} ${LIBTERMCAP} @@ -8,4 +10,8 @@ LDADD= -lcalendar -ltermcap LINKS= ${BINDIR}/ncal ${BINDIR}/cal MLINKS= ncal.1 cal.1 +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: head/usr.bin/ncal/tests/Makefile ============================================================================== --- head/tools/regression/usr.bin/ncal/Makefile Sun Mar 16 03:32:29 2014 (r263225) +++ head/usr.bin/ncal/tests/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -1,4 +1,99 @@ # $FreeBSD$ -all: - @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR} +TESTSDIR= ${TESTSBASE}/usr.bin/ncal + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= regress.b-3m200901-jd-nhl.out +FILES+= regress.b-3m200901-md-nhl.out +FILES+= regress.b-3m200902-jd-nhl.out +FILES+= regress.b-3m200902-md-nhl.out +FILES+= regress.b-3m200903-jd-nhl.out +FILES+= regress.b-3m200903-md-nhl.out +FILES+= regress.b-3m200904-jd-nhl.out +FILES+= regress.b-3m200904-md-nhl.out +FILES+= regress.b-3m200905-jd-nhl.out +FILES+= regress.b-3m200905-md-nhl.out +FILES+= regress.b-3m200906-jd-nhl.out +FILES+= regress.b-3m200906-md-nhl.out +FILES+= regress.b-3m200907-jd-nhl.out +FILES+= regress.b-3m200907-md-nhl.out +FILES+= regress.b-3m200908-jd-nhl.out +FILES+= regress.b-3m200908-md-nhl.out +FILES+= regress.b-3m200909-jd-nhl.out +FILES+= regress.b-3m200909-md-nhl.out +FILES+= regress.b-3m200910-jd-nhl.out +FILES+= regress.b-3m200910-md-nhl.out +FILES+= regress.b-3m200911-jd-nhl.out +FILES+= regress.b-3m200911-md-nhl.out +FILES+= regress.b-3m200912-jd-nhl.out +FILES+= regress.b-3m200912-md-nhl.out +FILES+= regress.b-y2008-jd-nhl.out +FILES+= regress.b-y2008-md-nhl.out +FILES+= regress.b-y2009-jd-nhl.out +FILES+= regress.b-y2009-md-nhl.out +FILES+= regress.b-y2010-jd-nhl.out +FILES+= regress.b-y2010-md-nhl.out +FILES+= regress.b-y2011-jd-nhl.out +FILES+= regress.b-y2011-md-nhl.out +FILES+= regress.f-3A-nhl.out +FILES+= regress.f-3AB-nhl.out +FILES+= regress.f-3B-nhl.out +FILES+= regress.f-3gy-nhl.out +FILES+= regress.f-3y-nhl.out +FILES+= regress.f-mgm-nhl.out +FILES+= regress.f-yA-nhl.out +FILES+= regress.f-yAB-nhl.out +FILES+= regress.f-yB-nhl.out +FILES+= regress.f-ygm-nhl.out +FILES+= regress.f-ym-nhl.out +FILES+= regress.r-3m200901-jd-nhl.out +FILES+= regress.r-3m200901-md-nhl.out +FILES+= regress.r-3m200902-jd-nhl.out +FILES+= regress.r-3m200902-md-nhl.out +FILES+= regress.r-3m200903-jd-nhl.out +FILES+= regress.r-3m200903-md-nhl.out +FILES+= regress.r-3m200904-jd-nhl.out +FILES+= regress.r-3m200904-md-nhl.out +FILES+= regress.r-3m200905-jd-nhl.out +FILES+= regress.r-3m200905-md-nhl.out +FILES+= regress.r-3m200906-jd-nhl.out +FILES+= regress.r-3m200906-md-nhl.out +FILES+= regress.r-3m200907-jd-nhl.out +FILES+= regress.r-3m200907-md-nhl.out +FILES+= regress.r-3m200908-jd-nhl.out +FILES+= regress.r-3m200908-md-nhl.out +FILES+= regress.r-3m200909-jd-nhl.out +FILES+= regress.r-3m200909-md-nhl.out +FILES+= regress.r-3m200910-jd-nhl.out +FILES+= regress.r-3m200910-md-nhl.out +FILES+= regress.r-3m200911-jd-nhl.out +FILES+= regress.r-3m200911-md-nhl.out +FILES+= regress.r-3m200912-jd-nhl.out +FILES+= regress.r-3m200912-md-nhl.out +FILES+= regress.r-y2008-jd-nhl.out +FILES+= regress.r-y2008-md-nhl.out +FILES+= regress.r-y2009-jd-nhl.out +FILES+= regress.r-y2009-md-nhl.out +FILES+= regress.r-y2010-jd-nhl.out +FILES+= regress.r-y2010-md-nhl.out +FILES+= regress.r-y2011-jd-nhl.out +FILES+= regress.r-y2011-md-nhl.out +FILES+= regress.s-b-3-nhl.out +FILES+= regress.s-b-A-nhl.out +FILES+= regress.s-b-AB-nhl.out +FILES+= regress.s-b-B-nhl.out +FILES+= regress.s-b-gmgy-nhl.out +FILES+= regress.s-b-m-nhl.out +FILES+= regress.s-b-mgy-nhl.out +FILES+= regress.s-r-3-nhl.out +FILES+= regress.s-r-A-nhl.out +FILES+= regress.s-r-AB-nhl.out +FILES+= regress.s-r-B-nhl.out +FILES+= regress.s-r-gmgy-nhl.out +FILES+= regress.s-r-m-nhl.out +FILES+= regress.s-r-mgy-nhl.out +FILES+= regress.sh + +.include Copied and modified: head/usr.bin/ncal/tests/legacy_test.sh (from r263225, head/tools/regression/usr.bin/ncal/regress.t) ============================================================================== --- head/tools/regression/usr.bin/ncal/regress.t Sun Mar 16 03:32:29 2014 (r263225, copy source) +++ head/usr.bin/ncal/tests/legacy_test.sh Sun Mar 16 08:04:06 2014 (r263227) @@ -1,6 +1,6 @@ #!/bin/sh # $FreeBSD$ -cd `dirname $0` +SRCDIR="$(dirname "${0}")"; export SRCDIR -m4 ../regress.m4 regress.sh | sh +m4 "${SRCDIR}/../regress.m4" "${SRCDIR}/regress.sh" | sh Modified: head/usr.bin/printf/Makefile ============================================================================== --- head/usr.bin/printf/Makefile Sun Mar 16 04:09:22 2014 (r263226) +++ head/usr.bin/printf/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -1,6 +1,12 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= printf +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: head/usr.bin/printf/tests/Makefile ============================================================================== --- head/tools/regression/usr.bin/printf/Makefile Sun Mar 16 03:32:29 2014 (r263225) +++ head/usr.bin/printf/tests/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -1,4 +1,22 @@ # $FreeBSD$ -all: - @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR} +TESTSDIR= ${TESTSBASE}/usr.bin/printf + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= regress.b.out +FILES+= regress.d.out +FILES+= regress.f.out +FILES+= regress.l1.out +FILES+= regress.l2.out +FILES+= regress.m1.out +FILES+= regress.m2.out +FILES+= regress.m3.out +FILES+= regress.m4.out +FILES+= regress.m5.out +FILES+= regress.s.out +FILES+= regress.sh +FILES+= regress.zero.out + +.include Copied and modified: head/usr.bin/printf/tests/legacy_test.sh (from r263225, head/tools/regression/usr.bin/printf/regress.t) ============================================================================== --- head/tools/regression/usr.bin/printf/regress.t Sun Mar 16 03:32:29 2014 (r263225, copy source) +++ head/usr.bin/printf/tests/legacy_test.sh Sun Mar 16 08:04:06 2014 (r263227) @@ -1,6 +1,6 @@ #!/bin/sh # $FreeBSD$ -cd `dirname $0` +SRCDIR="$(dirname "${0}")"; export SRCDIR -m4 ../regress.m4 regress.sh | sh +m4 "${SRCDIR}/../regress.m4" "${SRCDIR}/regress.sh" | sh Modified: head/usr.bin/sed/Makefile ============================================================================== --- head/usr.bin/sed/Makefile Sun Mar 16 04:09:22 2014 (r263226) +++ head/usr.bin/sed/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -1,9 +1,15 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= sed SRCS= compile.c main.c misc.c process.c WARNS?= 2 +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: head/usr.bin/sed/tests/Makefile ============================================================================== --- head/tools/regression/usr.bin/sed/Makefile Sun Mar 16 03:32:29 2014 (r263225) +++ head/usr.bin/sed/tests/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -1,6 +1,38 @@ # $FreeBSD$ -all: - @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR} - @sh multitest.t - @sh inplace_race.t +TESTSDIR= ${TESTSBASE}/usr.bin/sed + +TAP_TESTS_SH= legacy_test +TAP_TESTS_SH+= multi_test +TAP_TESTS_SH+= inplace_race_test + +FILESDIR= ${TESTSDIR} +FILES= hanoi.sed +FILES+= math.sed +FILES+= regress.G.out +FILES+= regress.P.out +FILES+= regress.b2a.out +FILES+= regress.bcb.out +FILES+= regress.c0.out +FILES+= regress.c1.out +FILES+= regress.c2.out +FILES+= regress.c3.out +FILES+= regress.hanoi.out +FILES+= regress.icase1.out +FILES+= regress.icase2.out +FILES+= regress.icase3.out +FILES+= regress.icase4.out +FILES+= regress.in +FILES+= regress.math.out +FILES+= regress.not.out +FILES+= regress.psl.out +FILES+= regress.s3.out +FILES+= regress.s4.out +FILES+= regress.s5.out +FILES+= regress.sg.out +FILES+= regress.sh +FILES+= regress.y.out + +SUBDIR= regress.multitest.out + +.include Copied and modified: head/usr.bin/sed/tests/inplace_race_test.sh (from r263225, head/tools/regression/usr.bin/sed/inplace_race.t) ============================================================================== --- head/tools/regression/usr.bin/sed/inplace_race.t Sun Mar 16 03:32:29 2014 (r263225, copy source) +++ head/usr.bin/sed/tests/inplace_race_test.sh Sun Mar 16 08:04:06 2014 (r263227) @@ -42,10 +42,6 @@ fi echo "1..1" -T=$(mktemp -d "${TMPDIR:-/tmp}/sed-test.XXXXXX") -trap 'cd /; rm -rf "$T"' 0 -cd "$T" - data=abababab data=$data$data$data$data data=$data$data$data$data Copied and modified: head/usr.bin/sed/tests/legacy_test.sh (from r263225, head/tools/regression/usr.bin/sed/regress.t) ============================================================================== --- head/tools/regression/usr.bin/sed/regress.t Sun Mar 16 03:32:29 2014 (r263225, copy source) +++ head/usr.bin/sed/tests/legacy_test.sh Sun Mar 16 08:04:06 2014 (r263227) @@ -1,6 +1,6 @@ #!/bin/sh # $FreeBSD$ -cd `dirname $0` +SRCDIR="$(dirname "${0}")"; export SRCDIR -m4 ../regress.m4 regress.sh | sh +m4 "${SRCDIR}/../regress.m4" "${SRCDIR}/regress.sh" | sh Copied and modified: head/usr.bin/sed/tests/multi_test.sh (from r263225, head/tools/regression/usr.bin/sed/multitest.t) ============================================================================== --- head/tools/regression/usr.bin/sed/multitest.t Sun Mar 16 03:32:29 2014 (r263225, copy source) +++ head/usr.bin/sed/tests/multi_test.sh Sun Mar 16 08:04:06 2014 (r263227) @@ -41,10 +41,11 @@ # of the BSD sed. Each test should have a unique mark name, which is # used for naming the corresponding file in regress.multitest.out. +SRCDIR=$(dirname $0) + main() { - cd `dirname $0` - REGRESS=regress.multitest.out + REGRESS=${SRCDIR}/regress.multitest.out DICT=/usr/share/dict/words awk 'END { for (i = 1; i < 15; i++) print "l1_" i}' lines1 Added: head/usr.bin/sed/tests/regress.multitest.out/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sed/tests/regress.multitest.out/Makefile Sun Mar 16 08:04:06 2014 (r263227) @@ -0,0 +1,136 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/sed/regress.multitest.out + +FILESDIR= ${TESTSDIR} +FILES= 1.1 +FILES+= 1.10 +FILES+= 1.11 +FILES+= 1.12 +FILES+= 1.13 +FILES+= 1.14 +FILES+= 1.15 +FILES+= 1.16 +FILES+= 1.17 +FILES+= 1.18 +FILES+= 1.2 +FILES+= 1.3 +FILES+= 1.4 +FILES+= 1.4.1 +FILES+= 1.5 +FILES+= 1.6 +FILES+= 1.7 +FILES+= 1.8 +FILES+= 1.9 +FILES+= 2.1 +FILES+= 2.10 +FILES+= 2.11 +FILES+= 2.12 +FILES+= 2.13 +FILES+= 2.14 +FILES+= 2.15 +FILES+= 2.16 +FILES+= 2.17 +FILES+= 2.18 +FILES+= 2.19 +FILES+= 2.2 +FILES+= 2.20 +FILES+= 2.21 +FILES+= 2.22 +FILES+= 2.3 +FILES+= 2.4 +FILES+= 2.5 +FILES+= 2.6 +FILES+= 2.7 +FILES+= 2.8 +FILES+= 2.9 +FILES+= 3.1 +FILES+= 3.2 +FILES+= 3.3 +FILES+= 3.4 +FILES+= 4.1 +FILES+= 4.2 +FILES+= 4.3 +FILES+= 4.4 +FILES+= 4.5 +FILES+= 4.6 +FILES+= 4.7 +FILES+= 4.8 +FILES+= 5.1 +FILES+= 5.2 +FILES+= 5.3 +FILES+= 5.4 +FILES+= 5.5 +FILES+= 5.6 +FILES+= 5.7 +FILES+= 5.8 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 08:38:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0A918DA; Sun, 16 Mar 2014 08:38:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BD13DED3; Sun, 16 Mar 2014 08:38:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2G8cVkA059147; Sun, 16 Mar 2014 08:38:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2G8cVsr059146; Sun, 16 Mar 2014 08:38:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403160838.s2G8cVsr059146@svn.freebsd.org> From: Adrian Chadd Date: Sun, 16 Mar 2014 08:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263228 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 08:38:31 -0000 Author: adrian Date: Sun Mar 16 08:38:31 2014 New Revision: 263228 URL: http://svnweb.freebsd.org/changeset/base/263228 Log: * Handle the three other timer interrupts for now, from the AR724x later. If the interrupts are ACKed even if they're not masked, we get the interrupts again later. Grr. * The AR724x and later chips want the interrupt bits cleared by writing the relevant bit to it, NOT by writing all but the current interrupt to it. Tested: * AR9344, DB120 reference board TODO: * Test ar724x and later chips to ensure no regressions have occured. Modified: head/sys/mips/atheros/apb.c Modified: head/sys/mips/atheros/apb.c ============================================================================== --- head/sys/mips/atheros/apb.c Sun Mar 16 08:04:06 2014 (r263227) +++ head/sys/mips/atheros/apb.c Sun Mar 16 08:38:31 2014 (r263228) @@ -362,9 +362,9 @@ apb_filter(void *arg) case AR71XX_SOC_AR9341: case AR71XX_SOC_AR9342: case AR71XX_SOC_AR9344: - /* Ack/clear the irq on status register for AR724x */ + /* ACK/clear the given interrupt */ ATH_WRITE_REG(AR71XX_MISC_INTR_STATUS, - reg & ~(1 << irq)); + (1 << irq)); break; default: /* fallthrough */ @@ -385,7 +385,7 @@ apb_filter(void *arg) continue; } /* Ignore timer interrupts */ - if (irq != 0) + if (irq != 0 && irq != 8 && irq != 9 && irq != 10) printf("Stray APB IRQ %d\n", irq); continue; } From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 08:39:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DC8EAF3; Sun, 16 Mar 2014 08:39:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 79F62EDE; Sun, 16 Mar 2014 08:39:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2G8dkjK059441; Sun, 16 Mar 2014 08:39:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2G8dkD4059440; Sun, 16 Mar 2014 08:39:46 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403160839.s2G8dkD4059440@svn.freebsd.org> From: Adrian Chadd Date: Sun, 16 Mar 2014 08:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263229 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 08:39:46 -0000 Author: adrian Date: Sun Mar 16 08:39:46 2014 New Revision: 263229 URL: http://svnweb.freebsd.org/changeset/base/263229 Log: The AR71xx has APB interrupts in the MISC registers from 0-7, later chips have more. So for now, let's allow more. We should teach the apb code to just reject interrupts that lie outside what the chip can do at runtime. Modified: head/sys/mips/atheros/apbvar.h Modified: head/sys/mips/atheros/apbvar.h ============================================================================== --- head/sys/mips/atheros/apbvar.h Sun Mar 16 08:38:31 2014 (r263228) +++ head/sys/mips/atheros/apbvar.h Sun Mar 16 08:39:46 2014 (r263229) @@ -23,21 +23,23 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ */ #ifndef _APBVAR_H_ #define _APBVAR_H_ #define APB_IRQ_BASE 0 -#define APB_IRQ_END 7 -#define APB_NIRQS 8 +#define APB_IRQ_END 31 +#define APB_NIRQS 32 struct apb_softc { struct rman apb_irq_rman; struct rman apb_mem_rman; /* IRQ events structs for child devices */ - struct intr_event *sc_eventstab[APB_NIRQS]; - mips_intrcnt_t sc_intr_counter[APB_NIRQS]; + struct intr_event *sc_eventstab[APB_NIRQS]; + mips_intrcnt_t sc_intr_counter[APB_NIRQS]; /* Resources and cookies for MIPS CPU INTs */ struct resource *sc_misc_irq; void *sc_misc_ih; From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 09:38:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1808768C; Sun, 16 Mar 2014 09:38:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 04FB3752; Sun, 16 Mar 2014 09:38:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2G9chra083675; Sun, 16 Mar 2014 09:38:43 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2G9chWf083674; Sun, 16 Mar 2014 09:38:43 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201403160938.s2G9chWf083674@svn.freebsd.org> From: Andrew Turner Date: Sun, 16 Mar 2014 09:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263230 - head/lib/msun/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 09:38:44 -0000 Author: andrew Date: Sun Mar 16 09:38:43 2014 New Revision: 263230 URL: http://svnweb.freebsd.org/changeset/base/263230 Log: Build fenv-vfp.c with the softfp float abi. Without this gcc generates an incorrect assembly file that doesn't allow for vfp instructions. Modified: head/lib/msun/arm/Makefile.inc Modified: head/lib/msun/arm/Makefile.inc ============================================================================== --- head/lib/msun/arm/Makefile.inc Sun Mar 16 08:39:46 2014 (r263229) +++ head/lib/msun/arm/Makefile.inc Sun Mar 16 09:38:43 2014 (r263230) @@ -7,3 +7,6 @@ SYM_MAPS += ${.CURDIR}/arm/Symbol.map ARCH_SRCS = fenv-softfp.c fenv-vfp.c .endif +CFLAGS.fenv-vfp.c= -mfloat-abi=softfp +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} + From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 09:40:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65ECDD53; Sun, 16 Mar 2014 09:40:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 53D227A0; Sun, 16 Mar 2014 09:40:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2G9e6bG083934; Sun, 16 Mar 2014 09:40:06 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2G9e6NV083933; Sun, 16 Mar 2014 09:40:06 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201403160940.s2G9e6NV083933@svn.freebsd.org> From: Andrew Turner Date: Sun, 16 Mar 2014 09:40:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263231 - head/lib/msun/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 09:40:06 -0000 Author: andrew Date: Sun Mar 16 09:40:05 2014 New Revision: 263231 URL: http://svnweb.freebsd.org/changeset/base/263231 Log: Only build the vfp/softfp switching code on armv6 as we don't support vfp on anything earlier than this. This should fix the armeb and arm builds when using gcc. Modified: head/lib/msun/arm/fenv.c Modified: head/lib/msun/arm/fenv.c ============================================================================== --- head/lib/msun/arm/fenv.c Sun Mar 16 09:38:43 2014 (r263230) +++ head/lib/msun/arm/fenv.c Sun Mar 16 09:40:05 2014 (r263231) @@ -30,6 +30,10 @@ #define __fenv_static #include "fenv.h" +#if defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6) +#define FENV_ARMv6 +#endif + /* When SOFTFP_ABI is defined we are using the softfp ABI. */ #if defined(__VFP_FP__) && !defined(__ARM_PCS_VFP) #define SOFTFP_ABI @@ -46,7 +50,7 @@ const fenv_t __fe_dfl_env = 0; /* If this is a non-mangled softfp version special processing is required */ -#if defined(FENV_MANGLE) || !defined(SOFTFP_ABI) +#if defined(FENV_MANGLE) || !defined(SOFTFP_ABI) || !defined(FENV_ARMv6) /* * The following macros map between the softfloat emulator's flags and From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 10:07:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CA1A9B4; Sun, 16 Mar 2014 10:07:41 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id BA1EFE3F; Sun, 16 Mar 2014 10:07:40 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [198.74.231.63]) by cyrus.watson.org (Postfix) with ESMTPS id 9DC3F46B0C; Sun, 16 Mar 2014 06:07:39 -0400 (EDT) Date: Sun, 16 Mar 2014 10:07:39 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: John-Mark Gurney Subject: Re: svn commit: r263215 - head/sys/crypto/sha2 In-Reply-To: <201403160057.s2G0vQEh074159@svn.freebsd.org> Message-ID: References: <201403160057.s2G0vQEh074159@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 10:07:41 -0000 On Sun, 16 Mar 2014, John-Mark Gurney wrote: > Log: > copy these files from lib/libmd in preperation for moving these files > into the kernel... I was sure that there was a sha256 implementation in the kernel already, and indeed there is -- in the ZFS code. Having it in the crypto tree makes (much) more sense (and I remain surprised it wasn't there already). I wonder if this means we can GC at least the copy in the zfs tree (if not the boot copy as well). Robert > > Added: > head/sys/crypto/sha2/sha256.h > - copied unchanged from r263213, head/lib/libmd/sha256.h > head/sys/crypto/sha2/sha256c.c > - copied unchanged from r263213, head/lib/libmd/sha256c.c > > Copied: head/sys/crypto/sha2/sha256.h (from r263213, head/lib/libmd/sha256.h) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/crypto/sha2/sha256.h Sun Mar 16 00:57:26 2014 (r263215, copy of r263213, head/lib/libmd/sha256.h) > @@ -0,0 +1,50 @@ > +/*- > + * Copyright 2005 Colin Percival > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef _SHA256_H_ > +#define _SHA256_H_ > + > +#include > + > +typedef struct SHA256Context { > + uint32_t state[8]; > + uint64_t count; > + unsigned char buf[64]; > +} SHA256_CTX; > + > +__BEGIN_DECLS > +void SHA256_Init(SHA256_CTX *); > +void SHA256_Update(SHA256_CTX *, const void *, size_t); > +void SHA256_Final(unsigned char [32], SHA256_CTX *); > +char *SHA256_End(SHA256_CTX *, char *); > +char *SHA256_File(const char *, char *); > +char *SHA256_FileChunk(const char *, char *, off_t, off_t); > +char *SHA256_Data(const void *, unsigned int, char *); > +__END_DECLS > + > +#endif /* !_SHA256_H_ */ > > Copied: head/sys/crypto/sha2/sha256c.c (from r263213, head/lib/libmd/sha256c.c) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/crypto/sha2/sha256c.c Sun Mar 16 00:57:26 2014 (r263215, copy of r263213, head/lib/libmd/sha256c.c) > @@ -0,0 +1,297 @@ > +/*- > + * Copyright 2005 Colin Percival > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > + > +#include > + > +#include "sha256.h" > + > +#if BYTE_ORDER == BIG_ENDIAN > + > +/* Copy a vector of big-endian uint32_t into a vector of bytes */ > +#define be32enc_vect(dst, src, len) \ > + memcpy((void *)dst, (const void *)src, (size_t)len) > + > +/* Copy a vector of bytes into a vector of big-endian uint32_t */ > +#define be32dec_vect(dst, src, len) \ > + memcpy((void *)dst, (const void *)src, (size_t)len) > + > +#else /* BYTE_ORDER != BIG_ENDIAN */ > + > +/* > + * Encode a length len/4 vector of (uint32_t) into a length len vector of > + * (unsigned char) in big-endian form. Assumes len is a multiple of 4. > + */ > +static void > +be32enc_vect(unsigned char *dst, const uint32_t *src, size_t len) > +{ > + size_t i; > + > + for (i = 0; i < len / 4; i++) > + be32enc(dst + i * 4, src[i]); > +} > + > +/* > + * Decode a big-endian length len vector of (unsigned char) into a length > + * len/4 vector of (uint32_t). Assumes len is a multiple of 4. > + */ > +static void > +be32dec_vect(uint32_t *dst, const unsigned char *src, size_t len) > +{ > + size_t i; > + > + for (i = 0; i < len / 4; i++) > + dst[i] = be32dec(src + i * 4); > +} > + > +#endif /* BYTE_ORDER != BIG_ENDIAN */ > + > +/* Elementary functions used by SHA256 */ > +#define Ch(x, y, z) ((x & (y ^ z)) ^ z) > +#define Maj(x, y, z) ((x & (y | z)) | (y & z)) > +#define SHR(x, n) (x >> n) > +#define ROTR(x, n) ((x >> n) | (x << (32 - n))) > +#define S0(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22)) > +#define S1(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25)) > +#define s0(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ SHR(x, 3)) > +#define s1(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ SHR(x, 10)) > + > +/* SHA256 round function */ > +#define RND(a, b, c, d, e, f, g, h, k) \ > + t0 = h + S1(e) + Ch(e, f, g) + k; \ > + t1 = S0(a) + Maj(a, b, c); \ > + d += t0; \ > + h = t0 + t1; > + > +/* Adjusted round function for rotating state */ > +#define RNDr(S, W, i, k) \ > + RND(S[(64 - i) % 8], S[(65 - i) % 8], \ > + S[(66 - i) % 8], S[(67 - i) % 8], \ > + S[(68 - i) % 8], S[(69 - i) % 8], \ > + S[(70 - i) % 8], S[(71 - i) % 8], \ > + W[i] + k) > + > +/* > + * SHA256 block compression function. The 256-bit state is transformed via > + * the 512-bit input block to produce a new state. > + */ > +static void > +SHA256_Transform(uint32_t * state, const unsigned char block[64]) > +{ > + uint32_t W[64]; > + uint32_t S[8]; > + uint32_t t0, t1; > + int i; > + > + /* 1. Prepare message schedule W. */ > + be32dec_vect(W, block, 64); > + for (i = 16; i < 64; i++) > + W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16]; > + > + /* 2. Initialize working variables. */ > + memcpy(S, state, 32); > + > + /* 3. Mix. */ > + RNDr(S, W, 0, 0x428a2f98); > + RNDr(S, W, 1, 0x71374491); > + RNDr(S, W, 2, 0xb5c0fbcf); > + RNDr(S, W, 3, 0xe9b5dba5); > + RNDr(S, W, 4, 0x3956c25b); > + RNDr(S, W, 5, 0x59f111f1); > + RNDr(S, W, 6, 0x923f82a4); > + RNDr(S, W, 7, 0xab1c5ed5); > + RNDr(S, W, 8, 0xd807aa98); > + RNDr(S, W, 9, 0x12835b01); > + RNDr(S, W, 10, 0x243185be); > + RNDr(S, W, 11, 0x550c7dc3); > + RNDr(S, W, 12, 0x72be5d74); > + RNDr(S, W, 13, 0x80deb1fe); > + RNDr(S, W, 14, 0x9bdc06a7); > + RNDr(S, W, 15, 0xc19bf174); > + RNDr(S, W, 16, 0xe49b69c1); > + RNDr(S, W, 17, 0xefbe4786); > + RNDr(S, W, 18, 0x0fc19dc6); > + RNDr(S, W, 19, 0x240ca1cc); > + RNDr(S, W, 20, 0x2de92c6f); > + RNDr(S, W, 21, 0x4a7484aa); > + RNDr(S, W, 22, 0x5cb0a9dc); > + RNDr(S, W, 23, 0x76f988da); > + RNDr(S, W, 24, 0x983e5152); > + RNDr(S, W, 25, 0xa831c66d); > + RNDr(S, W, 26, 0xb00327c8); > + RNDr(S, W, 27, 0xbf597fc7); > + RNDr(S, W, 28, 0xc6e00bf3); > + RNDr(S, W, 29, 0xd5a79147); > + RNDr(S, W, 30, 0x06ca6351); > + RNDr(S, W, 31, 0x14292967); > + RNDr(S, W, 32, 0x27b70a85); > + RNDr(S, W, 33, 0x2e1b2138); > + RNDr(S, W, 34, 0x4d2c6dfc); > + RNDr(S, W, 35, 0x53380d13); > + RNDr(S, W, 36, 0x650a7354); > + RNDr(S, W, 37, 0x766a0abb); > + RNDr(S, W, 38, 0x81c2c92e); > + RNDr(S, W, 39, 0x92722c85); > + RNDr(S, W, 40, 0xa2bfe8a1); > + RNDr(S, W, 41, 0xa81a664b); > + RNDr(S, W, 42, 0xc24b8b70); > + RNDr(S, W, 43, 0xc76c51a3); > + RNDr(S, W, 44, 0xd192e819); > + RNDr(S, W, 45, 0xd6990624); > + RNDr(S, W, 46, 0xf40e3585); > + RNDr(S, W, 47, 0x106aa070); > + RNDr(S, W, 48, 0x19a4c116); > + RNDr(S, W, 49, 0x1e376c08); > + RNDr(S, W, 50, 0x2748774c); > + RNDr(S, W, 51, 0x34b0bcb5); > + RNDr(S, W, 52, 0x391c0cb3); > + RNDr(S, W, 53, 0x4ed8aa4a); > + RNDr(S, W, 54, 0x5b9cca4f); > + RNDr(S, W, 55, 0x682e6ff3); > + RNDr(S, W, 56, 0x748f82ee); > + RNDr(S, W, 57, 0x78a5636f); > + RNDr(S, W, 58, 0x84c87814); > + RNDr(S, W, 59, 0x8cc70208); > + RNDr(S, W, 60, 0x90befffa); > + RNDr(S, W, 61, 0xa4506ceb); > + RNDr(S, W, 62, 0xbef9a3f7); > + RNDr(S, W, 63, 0xc67178f2); > + > + /* 4. Mix local working variables into global state */ > + for (i = 0; i < 8; i++) > + state[i] += S[i]; > +} > + > +static unsigned char PAD[64] = { > + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 > +}; > + > +/* Add padding and terminating bit-count. */ > +static void > +SHA256_Pad(SHA256_CTX * ctx) > +{ > + unsigned char len[8]; > + uint32_t r, plen; > + > + /* > + * Convert length to a vector of bytes -- we do this now rather > + * than later because the length will change after we pad. > + */ > + be64enc(len, ctx->count); > + > + /* Add 1--64 bytes so that the resulting length is 56 mod 64 */ > + r = (ctx->count >> 3) & 0x3f; > + plen = (r < 56) ? (56 - r) : (120 - r); > + SHA256_Update(ctx, PAD, (size_t)plen); > + > + /* Add the terminating bit-count */ > + SHA256_Update(ctx, len, 8); > +} > + > +/* SHA-256 initialization. Begins a SHA-256 operation. */ > +void > +SHA256_Init(SHA256_CTX * ctx) > +{ > + > + /* Zero bits processed so far */ > + ctx->count = 0; > + > + /* Magic initialization constants */ > + ctx->state[0] = 0x6A09E667; > + ctx->state[1] = 0xBB67AE85; > + ctx->state[2] = 0x3C6EF372; > + ctx->state[3] = 0xA54FF53A; > + ctx->state[4] = 0x510E527F; > + ctx->state[5] = 0x9B05688C; > + ctx->state[6] = 0x1F83D9AB; > + ctx->state[7] = 0x5BE0CD19; > +} > + > +/* Add bytes into the hash */ > +void > +SHA256_Update(SHA256_CTX * ctx, const void *in, size_t len) > +{ > + uint64_t bitlen; > + uint32_t r; > + const unsigned char *src = in; > + > + /* Number of bytes left in the buffer from previous updates */ > + r = (ctx->count >> 3) & 0x3f; > + > + /* Convert the length into a number of bits */ > + bitlen = len << 3; > + > + /* Update number of bits */ > + ctx->count += bitlen; > + > + /* Handle the case where we don't need to perform any transforms */ > + if (len < 64 - r) { > + memcpy(&ctx->buf[r], src, len); > + return; > + } > + > + /* Finish the current block */ > + memcpy(&ctx->buf[r], src, 64 - r); > + SHA256_Transform(ctx->state, ctx->buf); > + src += 64 - r; > + len -= 64 - r; > + > + /* Perform complete blocks */ > + while (len >= 64) { > + SHA256_Transform(ctx->state, src); > + src += 64; > + len -= 64; > + } > + > + /* Copy left over data into buffer */ > + memcpy(ctx->buf, src, len); > +} > + > +/* > + * SHA-256 finalization. Pads the input data, exports the hash value, > + * and clears the context state. > + */ > +void > +SHA256_Final(unsigned char digest[32], SHA256_CTX * ctx) > +{ > + > + /* Add padding */ > + SHA256_Pad(ctx); > + > + /* Write the hash */ > + be32enc_vect(digest, ctx->state, 32); > + > + /* Clear the context state */ > + memset((void *)ctx, 0, sizeof(*ctx)); > +} > > From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 10:20:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 010372A1; Sun, 16 Mar 2014 10:20:16 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id A26B8FA4; Sun, 16 Mar 2014 10:20:16 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [198.74.231.63]) by cyrus.watson.org (Postfix) with ESMTPS id 5411046B0D; Sun, 16 Mar 2014 06:20:16 -0400 (EDT) Date: Sun, 16 Mar 2014 10:20:16 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: John-Mark Gurney Subject: Re: svn commit: r263215 - head/sys/crypto/sha2 In-Reply-To: Message-ID: References: <201403160057.s2G0vQEh074159@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 10:20:17 -0000 On Sun, 16 Mar 2014, Robert Watson wrote: >> copy these files from lib/libmd in preperation for moving these files >> into the kernel... > > I was sure that there was a sha256 implementation in the kernel already, and > indeed there is -- in the ZFS code. Having it in the crypto tree makes > (much) more sense (and I remain surprised it wasn't there already). I > wonder if this means we can GC at least the copy in the zfs tree (if not the > boot copy as well). Reading the follow-up commit I now understand better. I do wonder if we can drop the ZFS copy, however -- in general, we seem to prefer FreeBSD versions of things (e.g., the ACL code) when they are available. Robert > > Robert > > >> >> Added: >> head/sys/crypto/sha2/sha256.h >> - copied unchanged from r263213, head/lib/libmd/sha256.h >> head/sys/crypto/sha2/sha256c.c >> - copied unchanged from r263213, head/lib/libmd/sha256c.c >> >> Copied: head/sys/crypto/sha2/sha256.h (from r263213, >> head/lib/libmd/sha256.h) >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/sys/crypto/sha2/sha256.h Sun Mar 16 00:57:26 2014 >> (r263215, copy of r263213, head/lib/libmd/sha256.h) >> @@ -0,0 +1,50 @@ >> +/*- >> + * Copyright 2005 Colin Percival >> + * All rights reserved. >> + * >> + * Redistribution and use in source and binary forms, with or without >> + * modification, are permitted provided that the following conditions >> + * are met: >> + * 1. Redistributions of source code must retain the above copyright >> + * notice, this list of conditions and the following disclaimer. >> + * 2. Redistributions in binary form must reproduce the above copyright >> + * notice, this list of conditions and the following disclaimer in the >> + * documentation and/or other materials provided with the distribution. >> + * >> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND >> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >> PURPOSE >> + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE >> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >> CONSEQUENTIAL >> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS >> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) >> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, >> STRICT >> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY >> WAY >> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF >> + * SUCH DAMAGE. >> + * >> + * $FreeBSD$ >> + */ >> + >> +#ifndef _SHA256_H_ >> +#define _SHA256_H_ >> + >> +#include >> + >> +typedef struct SHA256Context { >> + uint32_t state[8]; >> + uint64_t count; >> + unsigned char buf[64]; >> +} SHA256_CTX; >> + >> +__BEGIN_DECLS >> +void SHA256_Init(SHA256_CTX *); >> +void SHA256_Update(SHA256_CTX *, const void *, size_t); >> +void SHA256_Final(unsigned char [32], SHA256_CTX *); >> +char *SHA256_End(SHA256_CTX *, char *); >> +char *SHA256_File(const char *, char *); >> +char *SHA256_FileChunk(const char *, char *, off_t, off_t); >> +char *SHA256_Data(const void *, unsigned int, char *); >> +__END_DECLS >> + >> +#endif /* !_SHA256_H_ */ >> >> Copied: head/sys/crypto/sha2/sha256c.c (from r263213, >> head/lib/libmd/sha256c.c) >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/sys/crypto/sha2/sha256c.c Sun Mar 16 00:57:26 2014 >> (r263215, copy of r263213, head/lib/libmd/sha256c.c) >> @@ -0,0 +1,297 @@ >> +/*- >> + * Copyright 2005 Colin Percival >> + * All rights reserved. >> + * >> + * Redistribution and use in source and binary forms, with or without >> + * modification, are permitted provided that the following conditions >> + * are met: >> + * 1. Redistributions of source code must retain the above copyright >> + * notice, this list of conditions and the following disclaimer. >> + * 2. Redistributions in binary form must reproduce the above copyright >> + * notice, this list of conditions and the following disclaimer in the >> + * documentation and/or other materials provided with the distribution. >> + * >> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND >> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >> PURPOSE >> + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE >> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >> CONSEQUENTIAL >> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS >> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) >> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, >> STRICT >> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY >> WAY >> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF >> + * SUCH DAMAGE. >> + */ >> + >> +#include >> +__FBSDID("$FreeBSD$"); >> + >> +#include >> +#include >> + >> +#include >> + >> +#include "sha256.h" >> + >> +#if BYTE_ORDER == BIG_ENDIAN >> + >> +/* Copy a vector of big-endian uint32_t into a vector of bytes */ >> +#define be32enc_vect(dst, src, len) \ >> + memcpy((void *)dst, (const void *)src, (size_t)len) >> + >> +/* Copy a vector of bytes into a vector of big-endian uint32_t */ >> +#define be32dec_vect(dst, src, len) \ >> + memcpy((void *)dst, (const void *)src, (size_t)len) >> + >> +#else /* BYTE_ORDER != BIG_ENDIAN */ >> + >> +/* >> + * Encode a length len/4 vector of (uint32_t) into a length len vector of >> + * (unsigned char) in big-endian form. Assumes len is a multiple of 4. >> + */ >> +static void >> +be32enc_vect(unsigned char *dst, const uint32_t *src, size_t len) >> +{ >> + size_t i; >> + >> + for (i = 0; i < len / 4; i++) >> + be32enc(dst + i * 4, src[i]); >> +} >> + >> +/* >> + * Decode a big-endian length len vector of (unsigned char) into a length >> + * len/4 vector of (uint32_t). Assumes len is a multiple of 4. >> + */ >> +static void >> +be32dec_vect(uint32_t *dst, const unsigned char *src, size_t len) >> +{ >> + size_t i; >> + >> + for (i = 0; i < len / 4; i++) >> + dst[i] = be32dec(src + i * 4); >> +} >> + >> +#endif /* BYTE_ORDER != BIG_ENDIAN */ >> + >> +/* Elementary functions used by SHA256 */ >> +#define Ch(x, y, z) ((x & (y ^ z)) ^ z) >> +#define Maj(x, y, z) ((x & (y | z)) | (y & z)) >> +#define SHR(x, n) (x >> n) >> +#define ROTR(x, n) ((x >> n) | (x << (32 - n))) >> +#define S0(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22)) >> +#define S1(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25)) >> +#define s0(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ SHR(x, 3)) >> +#define s1(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ SHR(x, 10)) >> + >> +/* SHA256 round function */ >> +#define RND(a, b, c, d, e, f, g, h, k) \ >> + t0 = h + S1(e) + Ch(e, f, g) + k; \ >> + t1 = S0(a) + Maj(a, b, c); \ >> + d += t0; \ >> + h = t0 + t1; >> + >> +/* Adjusted round function for rotating state */ >> +#define RNDr(S, W, i, k) \ >> + RND(S[(64 - i) % 8], S[(65 - i) % 8], \ >> + S[(66 - i) % 8], S[(67 - i) % 8], \ >> + S[(68 - i) % 8], S[(69 - i) % 8], \ >> + S[(70 - i) % 8], S[(71 - i) % 8], \ >> + W[i] + k) >> + >> +/* >> + * SHA256 block compression function. The 256-bit state is transformed >> via >> + * the 512-bit input block to produce a new state. >> + */ >> +static void >> +SHA256_Transform(uint32_t * state, const unsigned char block[64]) >> +{ >> + uint32_t W[64]; >> + uint32_t S[8]; >> + uint32_t t0, t1; >> + int i; >> + >> + /* 1. Prepare message schedule W. */ >> + be32dec_vect(W, block, 64); >> + for (i = 16; i < 64; i++) >> + W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16]; >> + >> + /* 2. Initialize working variables. */ >> + memcpy(S, state, 32); >> + >> + /* 3. Mix. */ >> + RNDr(S, W, 0, 0x428a2f98); >> + RNDr(S, W, 1, 0x71374491); >> + RNDr(S, W, 2, 0xb5c0fbcf); >> + RNDr(S, W, 3, 0xe9b5dba5); >> + RNDr(S, W, 4, 0x3956c25b); >> + RNDr(S, W, 5, 0x59f111f1); >> + RNDr(S, W, 6, 0x923f82a4); >> + RNDr(S, W, 7, 0xab1c5ed5); >> + RNDr(S, W, 8, 0xd807aa98); >> + RNDr(S, W, 9, 0x12835b01); >> + RNDr(S, W, 10, 0x243185be); >> + RNDr(S, W, 11, 0x550c7dc3); >> + RNDr(S, W, 12, 0x72be5d74); >> + RNDr(S, W, 13, 0x80deb1fe); >> + RNDr(S, W, 14, 0x9bdc06a7); >> + RNDr(S, W, 15, 0xc19bf174); >> + RNDr(S, W, 16, 0xe49b69c1); >> + RNDr(S, W, 17, 0xefbe4786); >> + RNDr(S, W, 18, 0x0fc19dc6); >> + RNDr(S, W, 19, 0x240ca1cc); >> + RNDr(S, W, 20, 0x2de92c6f); >> + RNDr(S, W, 21, 0x4a7484aa); >> + RNDr(S, W, 22, 0x5cb0a9dc); >> + RNDr(S, W, 23, 0x76f988da); >> + RNDr(S, W, 24, 0x983e5152); >> + RNDr(S, W, 25, 0xa831c66d); >> + RNDr(S, W, 26, 0xb00327c8); >> + RNDr(S, W, 27, 0xbf597fc7); >> + RNDr(S, W, 28, 0xc6e00bf3); >> + RNDr(S, W, 29, 0xd5a79147); >> + RNDr(S, W, 30, 0x06ca6351); >> + RNDr(S, W, 31, 0x14292967); >> + RNDr(S, W, 32, 0x27b70a85); >> + RNDr(S, W, 33, 0x2e1b2138); >> + RNDr(S, W, 34, 0x4d2c6dfc); >> + RNDr(S, W, 35, 0x53380d13); >> + RNDr(S, W, 36, 0x650a7354); >> + RNDr(S, W, 37, 0x766a0abb); >> + RNDr(S, W, 38, 0x81c2c92e); >> + RNDr(S, W, 39, 0x92722c85); >> + RNDr(S, W, 40, 0xa2bfe8a1); >> + RNDr(S, W, 41, 0xa81a664b); >> + RNDr(S, W, 42, 0xc24b8b70); >> + RNDr(S, W, 43, 0xc76c51a3); >> + RNDr(S, W, 44, 0xd192e819); >> + RNDr(S, W, 45, 0xd6990624); >> + RNDr(S, W, 46, 0xf40e3585); >> + RNDr(S, W, 47, 0x106aa070); >> + RNDr(S, W, 48, 0x19a4c116); >> + RNDr(S, W, 49, 0x1e376c08); >> + RNDr(S, W, 50, 0x2748774c); >> + RNDr(S, W, 51, 0x34b0bcb5); >> + RNDr(S, W, 52, 0x391c0cb3); >> + RNDr(S, W, 53, 0x4ed8aa4a); >> + RNDr(S, W, 54, 0x5b9cca4f); >> + RNDr(S, W, 55, 0x682e6ff3); >> + RNDr(S, W, 56, 0x748f82ee); >> + RNDr(S, W, 57, 0x78a5636f); >> + RNDr(S, W, 58, 0x84c87814); >> + RNDr(S, W, 59, 0x8cc70208); >> + RNDr(S, W, 60, 0x90befffa); >> + RNDr(S, W, 61, 0xa4506ceb); >> + RNDr(S, W, 62, 0xbef9a3f7); >> + RNDr(S, W, 63, 0xc67178f2); >> + >> + /* 4. Mix local working variables into global state */ >> + for (i = 0; i < 8; i++) >> + state[i] += S[i]; >> +} >> + >> +static unsigned char PAD[64] = { >> + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, >> + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, >> + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, >> + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 >> +}; >> + >> +/* Add padding and terminating bit-count. */ >> +static void >> +SHA256_Pad(SHA256_CTX * ctx) >> +{ >> + unsigned char len[8]; >> + uint32_t r, plen; >> + >> + /* >> + * Convert length to a vector of bytes -- we do this now rather >> + * than later because the length will change after we pad. >> + */ >> + be64enc(len, ctx->count); >> + >> + /* Add 1--64 bytes so that the resulting length is 56 mod 64 */ >> + r = (ctx->count >> 3) & 0x3f; >> + plen = (r < 56) ? (56 - r) : (120 - r); >> + SHA256_Update(ctx, PAD, (size_t)plen); >> + >> + /* Add the terminating bit-count */ >> + SHA256_Update(ctx, len, 8); >> +} >> + >> +/* SHA-256 initialization. Begins a SHA-256 operation. */ >> +void >> +SHA256_Init(SHA256_CTX * ctx) >> +{ >> + >> + /* Zero bits processed so far */ >> + ctx->count = 0; >> + >> + /* Magic initialization constants */ >> + ctx->state[0] = 0x6A09E667; >> + ctx->state[1] = 0xBB67AE85; >> + ctx->state[2] = 0x3C6EF372; >> + ctx->state[3] = 0xA54FF53A; >> + ctx->state[4] = 0x510E527F; >> + ctx->state[5] = 0x9B05688C; >> + ctx->state[6] = 0x1F83D9AB; >> + ctx->state[7] = 0x5BE0CD19; >> +} >> + >> +/* Add bytes into the hash */ >> +void >> +SHA256_Update(SHA256_CTX * ctx, const void *in, size_t len) >> +{ >> + uint64_t bitlen; >> + uint32_t r; >> + const unsigned char *src = in; >> + >> + /* Number of bytes left in the buffer from previous updates */ >> + r = (ctx->count >> 3) & 0x3f; >> + >> + /* Convert the length into a number of bits */ >> + bitlen = len << 3; >> + >> + /* Update number of bits */ >> + ctx->count += bitlen; >> + >> + /* Handle the case where we don't need to perform any transforms */ >> + if (len < 64 - r) { >> + memcpy(&ctx->buf[r], src, len); >> + return; >> + } >> + >> + /* Finish the current block */ >> + memcpy(&ctx->buf[r], src, 64 - r); >> + SHA256_Transform(ctx->state, ctx->buf); >> + src += 64 - r; >> + len -= 64 - r; >> + >> + /* Perform complete blocks */ >> + while (len >= 64) { >> + SHA256_Transform(ctx->state, src); >> + src += 64; >> + len -= 64; >> + } >> + >> + /* Copy left over data into buffer */ >> + memcpy(ctx->buf, src, len); >> +} >> + >> +/* >> + * SHA-256 finalization. Pads the input data, exports the hash value, >> + * and clears the context state. >> + */ >> +void >> +SHA256_Final(unsigned char digest[32], SHA256_CTX * ctx) >> +{ >> + >> + /* Add padding */ >> + SHA256_Pad(ctx); >> + >> + /* Write the hash */ >> + be32enc_vect(digest, ctx->state, 32); >> + >> + /* Clear the context state */ >> + memset((void *)ctx, 0, sizeof(*ctx)); >> +} >> >> > From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 10:49:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF45DC81; Sun, 16 Mar 2014 10:49:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AA200919; Sun, 16 Mar 2014 10:49:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GAnGRv012545; Sun, 16 Mar 2014 10:49:16 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GAnGoX012543; Sun, 16 Mar 2014 10:49:16 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201403161049.s2GAnGoX012543@svn.freebsd.org> From: Robert Watson Date: Sun, 16 Mar 2014 10:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263232 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 10:49:16 -0000 Author: rwatson Date: Sun Mar 16 10:49:16 2014 New Revision: 263232 URL: http://svnweb.freebsd.org/changeset/base/263232 Log: Rename capability.h to capsicum.h: the original name conflicts with the draft POSIX.1e capability.h used on some systems (e.g., Linux). On FreeBSD, leave a wrapper header so that current code continues to compile. We will eventually want to deprecate the old header as the presence of a capability.h may be confusing some configure scripts. Suggested by: David Drysdale Discussed on: cl-capsicum-discuss MFC after: 3 weeks Added: head/sys/sys/capsicum.h - copied, changed from r263197, head/sys/sys/capability.h Modified: head/sys/sys/capability.h Modified: head/sys/sys/capability.h ============================================================================== --- head/sys/sys/capability.h Sun Mar 16 09:40:05 2014 (r263231) +++ head/sys/sys/capability.h Sun Mar 16 10:49:16 2014 (r263232) @@ -1,14 +1,10 @@ /*- - * Copyright (c) 2008-2010 Robert N. M. Watson - * Copyright (c) 2012 FreeBSD Foundation + * Copyright (c) 2014 Robert N. M. Watson * All rights reserved. * * This software was developed at the University of Cambridge Computer * Laboratory with support from a grant from Google, Inc. * - * Portions of this software were developed by Pawel Jakub Dawidek under - * sponsorship from the FreeBSD Foundation. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -34,391 +30,14 @@ */ /* - * Definitions for FreeBSD capabilities facility. + * Historically, the key userspace and kernel Capsicum definitions were found + * in this file. However, it conflicted with POSIX.1e's capability.h, so has + * been renamed capability.h. The file remains for backwards compatibility + * reasons as a nested include. */ #ifndef _SYS_CAPABILITY_H_ #define _SYS_CAPABILITY_H_ -#include -#include - -#include -#include -#include - -#ifndef _KERNEL -#include -#endif - -#define CAPRIGHT(idx, bit) ((1ULL << (57 + (idx))) | (bit)) - -/* - * Possible rights on capabilities. - * - * Notes: - * Some system calls don't require a capability in order to perform an - * operation on an fd. These include: close, dup, dup2. - * - * sendfile is authorized using CAP_READ on the file and CAP_WRITE on the - * socket. - * - * mmap() and aio*() system calls will need special attention as they may - * involve reads or writes depending a great deal on context. - */ - -/* INDEX 0 */ - -/* - * General file I/O. - */ -/* Allows for openat(O_RDONLY), read(2), readv(2). */ -#define CAP_READ CAPRIGHT(0, 0x0000000000000001ULL) -/* Allows for openat(O_WRONLY | O_APPEND), write(2), writev(2). */ -#define CAP_WRITE CAPRIGHT(0, 0x0000000000000002ULL) -/* Allows for lseek(fd, 0, SEEK_CUR). */ -#define CAP_SEEK_TELL CAPRIGHT(0, 0x0000000000000004ULL) -/* Allows for lseek(2). */ -#define CAP_SEEK (CAP_SEEK_TELL | 0x0000000000000008ULL) -/* Allows for aio_read(2), pread(2), preadv(2). */ -#define CAP_PREAD (CAP_SEEK | CAP_READ) -/* - * Allows for aio_write(2), openat(O_WRONLY) (without O_APPEND), pwrite(2), - * pwritev(2). - */ -#define CAP_PWRITE (CAP_SEEK | CAP_WRITE) -/* Allows for mmap(PROT_NONE). */ -#define CAP_MMAP CAPRIGHT(0, 0x0000000000000010ULL) -/* Allows for mmap(PROT_READ). */ -#define CAP_MMAP_R (CAP_MMAP | CAP_SEEK | CAP_READ) -/* Allows for mmap(PROT_WRITE). */ -#define CAP_MMAP_W (CAP_MMAP | CAP_SEEK | CAP_WRITE) -/* Allows for mmap(PROT_EXEC). */ -#define CAP_MMAP_X (CAP_MMAP | CAP_SEEK | 0x0000000000000020ULL) -/* Allows for mmap(PROT_READ | PROT_WRITE). */ -#define CAP_MMAP_RW (CAP_MMAP_R | CAP_MMAP_W) -/* Allows for mmap(PROT_READ | PROT_EXEC). */ -#define CAP_MMAP_RX (CAP_MMAP_R | CAP_MMAP_X) -/* Allows for mmap(PROT_WRITE | PROT_EXEC). */ -#define CAP_MMAP_WX (CAP_MMAP_W | CAP_MMAP_X) -/* Allows for mmap(PROT_READ | PROT_WRITE | PROT_EXEC). */ -#define CAP_MMAP_RWX (CAP_MMAP_R | CAP_MMAP_W | CAP_MMAP_X) -/* Allows for openat(O_CREAT). */ -#define CAP_CREATE CAPRIGHT(0, 0x0000000000000040ULL) -/* Allows for openat(O_EXEC) and fexecve(2) in turn. */ -#define CAP_FEXECVE CAPRIGHT(0, 0x0000000000000080ULL) -/* Allows for openat(O_SYNC), openat(O_FSYNC), fsync(2), aio_fsync(2). */ -#define CAP_FSYNC CAPRIGHT(0, 0x0000000000000100ULL) -/* Allows for openat(O_TRUNC), ftruncate(2). */ -#define CAP_FTRUNCATE CAPRIGHT(0, 0x0000000000000200ULL) - -/* Lookups - used to constrain *at() calls. */ -#define CAP_LOOKUP CAPRIGHT(0, 0x0000000000000400ULL) - -/* VFS methods. */ -/* Allows for fchdir(2). */ -#define CAP_FCHDIR CAPRIGHT(0, 0x0000000000000800ULL) -/* Allows for fchflags(2). */ -#define CAP_FCHFLAGS CAPRIGHT(0, 0x0000000000001000ULL) -/* Allows for fchflags(2) and chflagsat(2). */ -#define CAP_CHFLAGSAT (CAP_FCHFLAGS | CAP_LOOKUP) -/* Allows for fchmod(2). */ -#define CAP_FCHMOD CAPRIGHT(0, 0x0000000000002000ULL) -/* Allows for fchmod(2) and fchmodat(2). */ -#define CAP_FCHMODAT (CAP_FCHMOD | CAP_LOOKUP) -/* Allows for fchown(2). */ -#define CAP_FCHOWN CAPRIGHT(0, 0x0000000000004000ULL) -/* Allows for fchown(2) and fchownat(2). */ -#define CAP_FCHOWNAT (CAP_FCHOWN | CAP_LOOKUP) -/* Allows for fcntl(2). */ -#define CAP_FCNTL CAPRIGHT(0, 0x0000000000008000ULL) -/* - * Allows for flock(2), openat(O_SHLOCK), openat(O_EXLOCK), - * fcntl(F_SETLK_REMOTE), fcntl(F_SETLKW), fcntl(F_SETLK), fcntl(F_GETLK). - */ -#define CAP_FLOCK CAPRIGHT(0, 0x0000000000010000ULL) -/* Allows for fpathconf(2). */ -#define CAP_FPATHCONF CAPRIGHT(0, 0x0000000000020000ULL) -/* Allows for UFS background-fsck operations. */ -#define CAP_FSCK CAPRIGHT(0, 0x0000000000040000ULL) -/* Allows for fstat(2). */ -#define CAP_FSTAT CAPRIGHT(0, 0x0000000000080000ULL) -/* Allows for fstat(2), fstatat(2) and faccessat(2). */ -#define CAP_FSTATAT (CAP_FSTAT | CAP_LOOKUP) -/* Allows for fstatfs(2). */ -#define CAP_FSTATFS CAPRIGHT(0, 0x0000000000100000ULL) -/* Allows for futimes(2). */ -#define CAP_FUTIMES CAPRIGHT(0, 0x0000000000200000ULL) -/* Allows for futimes(2) and futimesat(2). */ -#define CAP_FUTIMESAT (CAP_FUTIMES | CAP_LOOKUP) -/* Allows for linkat(2) and renameat(2) (destination directory descriptor). */ -#define CAP_LINKAT (CAP_LOOKUP | 0x0000000000400000ULL) -/* Allows for mkdirat(2). */ -#define CAP_MKDIRAT (CAP_LOOKUP | 0x0000000000800000ULL) -/* Allows for mkfifoat(2). */ -#define CAP_MKFIFOAT (CAP_LOOKUP | 0x0000000001000000ULL) -/* Allows for mknodat(2). */ -#define CAP_MKNODAT (CAP_LOOKUP | 0x0000000002000000ULL) -/* Allows for renameat(2). */ -#define CAP_RENAMEAT (CAP_LOOKUP | 0x0000000004000000ULL) -/* Allows for symlinkat(2). */ -#define CAP_SYMLINKAT (CAP_LOOKUP | 0x0000000008000000ULL) -/* - * Allows for unlinkat(2) and renameat(2) if destination object exists and - * will be removed. - */ -#define CAP_UNLINKAT (CAP_LOOKUP | 0x0000000010000000ULL) - -/* Socket operations. */ -/* Allows for accept(2) and accept4(2). */ -#define CAP_ACCEPT CAPRIGHT(0, 0x0000000020000000ULL) -/* Allows for bind(2). */ -#define CAP_BIND CAPRIGHT(0, 0x0000000040000000ULL) -/* Allows for connect(2). */ -#define CAP_CONNECT CAPRIGHT(0, 0x0000000080000000ULL) -/* Allows for getpeername(2). */ -#define CAP_GETPEERNAME CAPRIGHT(0, 0x0000000100000000ULL) -/* Allows for getsockname(2). */ -#define CAP_GETSOCKNAME CAPRIGHT(0, 0x0000000200000000ULL) -/* Allows for getsockopt(2). */ -#define CAP_GETSOCKOPT CAPRIGHT(0, 0x0000000400000000ULL) -/* Allows for listen(2). */ -#define CAP_LISTEN CAPRIGHT(0, 0x0000000800000000ULL) -/* Allows for sctp_peeloff(2). */ -#define CAP_PEELOFF CAPRIGHT(0, 0x0000001000000000ULL) -#define CAP_RECV CAP_READ -#define CAP_SEND CAP_WRITE -/* Allows for setsockopt(2). */ -#define CAP_SETSOCKOPT CAPRIGHT(0, 0x0000002000000000ULL) -/* Allows for shutdown(2). */ -#define CAP_SHUTDOWN CAPRIGHT(0, 0x0000004000000000ULL) - -/* Allows for bindat(2) on a directory descriptor. */ -#define CAP_BINDAT (CAP_LOOKUP | 0x0000008000000000ULL) -/* Allows for connectat(2) on a directory descriptor. */ -#define CAP_CONNECTAT (CAP_LOOKUP | 0x0000010000000000ULL) - -#define CAP_SOCK_CLIENT \ - (CAP_CONNECT | CAP_GETPEERNAME | CAP_GETSOCKNAME | CAP_GETSOCKOPT | \ - CAP_PEELOFF | CAP_RECV | CAP_SEND | CAP_SETSOCKOPT | CAP_SHUTDOWN) -#define CAP_SOCK_SERVER \ - (CAP_ACCEPT | CAP_BIND | CAP_GETPEERNAME | CAP_GETSOCKNAME | \ - CAP_GETSOCKOPT | CAP_LISTEN | CAP_PEELOFF | CAP_RECV | CAP_SEND | \ - CAP_SETSOCKOPT | CAP_SHUTDOWN) - -/* All used bits for index 0. */ -#define CAP_ALL0 CAPRIGHT(0, 0x0000007FFFFFFFFFULL) - -/* Available bits for index 0. */ -#define CAP_UNUSED0_40 CAPRIGHT(0, 0x0000008000000000ULL) -/* ... */ -#define CAP_UNUSED0_57 CAPRIGHT(0, 0x0100000000000000ULL) - -/* INDEX 1 */ - -/* Mandatory Access Control. */ -/* Allows for mac_get_fd(3). */ -#define CAP_MAC_GET CAPRIGHT(1, 0x0000000000000001ULL) -/* Allows for mac_set_fd(3). */ -#define CAP_MAC_SET CAPRIGHT(1, 0x0000000000000002ULL) - -/* Methods on semaphores. */ -#define CAP_SEM_GETVALUE CAPRIGHT(1, 0x0000000000000004ULL) -#define CAP_SEM_POST CAPRIGHT(1, 0x0000000000000008ULL) -#define CAP_SEM_WAIT CAPRIGHT(1, 0x0000000000000010ULL) - -/* Allows select(2) and poll(2) on descriptor. */ -#define CAP_EVENT CAPRIGHT(1, 0x0000000000000020ULL) -/* Allows for kevent(2) on kqueue descriptor with eventlist != NULL. */ -#define CAP_KQUEUE_EVENT CAPRIGHT(1, 0x0000000000000040ULL) - -/* Strange and powerful rights that should not be given lightly. */ -/* Allows for ioctl(2). */ -#define CAP_IOCTL CAPRIGHT(1, 0x0000000000000080ULL) -#define CAP_TTYHOOK CAPRIGHT(1, 0x0000000000000100ULL) - -/* Process management via process descriptors. */ -/* Allows for pdgetpid(2). */ -#define CAP_PDGETPID CAPRIGHT(1, 0x0000000000000200ULL) -/* Allows for pdwait4(2). */ -#define CAP_PDWAIT CAPRIGHT(1, 0x0000000000000400ULL) -/* Allows for pdkill(2). */ -#define CAP_PDKILL CAPRIGHT(1, 0x0000000000000800ULL) - -/* Extended attributes. */ -/* Allows for extattr_delete_fd(2). */ -#define CAP_EXTATTR_DELETE CAPRIGHT(1, 0x0000000000001000ULL) -/* Allows for extattr_get_fd(2). */ -#define CAP_EXTATTR_GET CAPRIGHT(1, 0x0000000000002000ULL) -/* Allows for extattr_list_fd(2). */ -#define CAP_EXTATTR_LIST CAPRIGHT(1, 0x0000000000004000ULL) -/* Allows for extattr_set_fd(2). */ -#define CAP_EXTATTR_SET CAPRIGHT(1, 0x0000000000008000ULL) - -/* Access Control Lists. */ -/* Allows for acl_valid_fd_np(3). */ -#define CAP_ACL_CHECK CAPRIGHT(1, 0x0000000000010000ULL) -/* Allows for acl_delete_fd_np(3). */ -#define CAP_ACL_DELETE CAPRIGHT(1, 0x0000000000020000ULL) -/* Allows for acl_get_fd(3) and acl_get_fd_np(3). */ -#define CAP_ACL_GET CAPRIGHT(1, 0x0000000000040000ULL) -/* Allows for acl_set_fd(3) and acl_set_fd_np(3). */ -#define CAP_ACL_SET CAPRIGHT(1, 0x0000000000080000ULL) - -/* Allows for kevent(2) on kqueue descriptor with changelist != NULL. */ -#define CAP_KQUEUE_CHANGE CAPRIGHT(1, 0x0000000000100000ULL) - -#define CAP_KQUEUE (CAP_KQUEUE_EVENT | CAP_KQUEUE_CHANGE) - -/* All used bits for index 1. */ -#define CAP_ALL1 CAPRIGHT(1, 0x00000000001FFFFFULL) - -/* Available bits for index 1. */ -#define CAP_UNUSED1_22 CAPRIGHT(1, 0x0000000000200000ULL) -/* ... */ -#define CAP_UNUSED1_57 CAPRIGHT(1, 0x0100000000000000ULL) - -/* Backward compatibility. */ -#define CAP_POLL_EVENT CAP_EVENT - -#define CAP_ALL(rights) do { \ - (rights)->cr_rights[0] = \ - ((uint64_t)CAP_RIGHTS_VERSION << 62) | CAP_ALL0; \ - (rights)->cr_rights[1] = CAP_ALL1; \ -} while (0) - -#define CAP_NONE(rights) do { \ - (rights)->cr_rights[0] = \ - ((uint64_t)CAP_RIGHTS_VERSION << 62) | CAPRIGHT(0, 0ULL); \ - (rights)->cr_rights[1] = CAPRIGHT(1, 0ULL); \ -} while (0) - -#define CAPRVER(right) ((int)((right) >> 62)) -#define CAPVER(rights) CAPRVER((rights)->cr_rights[0]) -#define CAPARSIZE(rights) (CAPVER(rights) + 2) -#define CAPIDXBIT(right) ((int)(((right) >> 57) & 0x1F)) - -/* - * Allowed fcntl(2) commands. - */ -#define CAP_FCNTL_GETFL (1 << F_GETFL) -#define CAP_FCNTL_SETFL (1 << F_SETFL) -#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 -#define CAP_FCNTL_GETOWN (1 << F_GETOWN) -#define CAP_FCNTL_SETOWN (1 << F_SETOWN) -#endif -#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 -#define CAP_FCNTL_ALL (CAP_FCNTL_GETFL | CAP_FCNTL_SETFL | \ - CAP_FCNTL_GETOWN | CAP_FCNTL_SETOWN) -#else -#define CAP_FCNTL_ALL (CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) -#endif - -#define CAP_IOCTLS_ALL SSIZE_MAX - -__BEGIN_DECLS - -#define cap_rights_init(...) \ - __cap_rights_init(CAP_RIGHTS_VERSION, __VA_ARGS__, 0ULL) -cap_rights_t *__cap_rights_init(int version, cap_rights_t *rights, ...); - -#define cap_rights_set(rights, ...) \ - __cap_rights_set((rights), __VA_ARGS__, 0ULL) -cap_rights_t *__cap_rights_set(cap_rights_t *rights, ...); - -#define cap_rights_clear(rights, ...) \ - __cap_rights_clear((rights), __VA_ARGS__, 0ULL) -cap_rights_t *__cap_rights_clear(cap_rights_t *rights, ...); - -#define cap_rights_is_set(rights, ...) \ - __cap_rights_is_set((rights), __VA_ARGS__, 0ULL) -bool __cap_rights_is_set(const cap_rights_t *rights, ...); - -bool cap_rights_is_valid(const cap_rights_t *rights); -cap_rights_t *cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src); -cap_rights_t *cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src); -bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little); - -__END_DECLS - -#ifdef _KERNEL - -#include - -#define IN_CAPABILITY_MODE(td) (((td)->td_ucred->cr_flags & CRED_FLAG_CAPMODE) != 0) - -struct filedesc; - -/* - * Test whether a capability grants the requested rights. - */ -int cap_check(const cap_rights_t *havep, const cap_rights_t *needp); -/* - * Convert capability rights into VM access flags. - */ -u_char cap_rights_to_vmprot(cap_rights_t *havep); - -/* - * For the purposes of procstat(1) and similar tools, allow kern_descrip.c to - * extract the rights from a capability. - */ -cap_rights_t *cap_rights(struct filedesc *fdp, int fd); - -int cap_ioctl_check(struct filedesc *fdp, int fd, u_long cmd); -int cap_fcntl_check(struct filedesc *fdp, int fd, int cmd); - -#else /* !_KERNEL */ - -__BEGIN_DECLS -/* - * cap_enter(): Cause the process to enter capability mode, which will - * prevent it from directly accessing global namespaces. System calls will - * be limited to process-local, process-inherited, or file descriptor - * operations. If already in capability mode, a no-op. - */ -int cap_enter(void); - -/* - * Are we sandboxed (in capability mode)? - * This is a libc wrapper around the cap_getmode(2) system call. - */ -bool cap_sandboxed(void); - -/* - * cap_getmode(): Are we in capability mode? - */ -int cap_getmode(u_int *modep); - -/* - * Limits capability rights for the given descriptor (CAP_*). - */ -int cap_rights_limit(int fd, const cap_rights_t *rights); -/* - * Returns capability rights for the given descriptor. - */ -#define cap_rights_get(fd, rights) \ - __cap_rights_get(CAP_RIGHTS_VERSION, (fd), (rights)) -int __cap_rights_get(int version, int fd, cap_rights_t *rights); -/* - * Limits allowed ioctls for the given descriptor. - */ -int cap_ioctls_limit(int fd, const unsigned long *cmds, size_t ncmds); -/* - * Returns array of allowed ioctls for the given descriptor. - * If all ioctls are allowed, the cmds array is not populated and - * the function returns CAP_IOCTLS_ALL. - */ -ssize_t cap_ioctls_get(int fd, unsigned long *cmds, size_t maxcmds); -/* - * Limits allowed fcntls for the given descriptor (CAP_FCNTL_*). - */ -int cap_fcntls_limit(int fd, uint32_t fcntlrights); -/* - * Returns bitmask of allowed fcntls for the given descriptor. - */ -int cap_fcntls_get(int fd, uint32_t *fcntlrightsp); - -__END_DECLS - -#endif /* !_KERNEL */ +#include #endif /* !_SYS_CAPABILITY_H_ */ Copied and modified: head/sys/sys/capsicum.h (from r263197, head/sys/sys/capability.h) ============================================================================== --- head/sys/sys/capability.h Sat Mar 15 00:23:35 2014 (r263197, copy source) +++ head/sys/sys/capsicum.h Sun Mar 16 10:49:16 2014 (r263232) @@ -36,8 +36,8 @@ /* * Definitions for FreeBSD capabilities facility. */ -#ifndef _SYS_CAPABILITY_H_ -#define _SYS_CAPABILITY_H_ +#ifndef _SYS_CAPSICUM_H_ +#define _SYS_CAPSICUM_H_ #include #include @@ -421,4 +421,4 @@ __END_DECLS #endif /* !_KERNEL */ -#endif /* !_SYS_CAPABILITY_H_ */ +#endif /* !_SYS_CAPSICUM_H_ */ From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 10:56:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 386FCF14; Sun, 16 Mar 2014 10:56:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1FB309CB; Sun, 16 Mar 2014 10:56:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GAuC80016443; Sun, 16 Mar 2014 10:56:12 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GAtvfK016332; Sun, 16 Mar 2014 10:55:57 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201403161055.s2GAtvfK016332@svn.freebsd.org> From: Robert Watson Date: Sun, 16 Mar 2014 10:55:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263233 - in head/sys: amd64/amd64 amd64/linux32 arm/arm cam/ctl cddl/compat/opensolaris/sys compat/freebsd32 compat/linux compat/svr4 dev/aac dev/aacraid dev/amr dev/filemon dev/hwpmc ... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 10:56:12 -0000 Author: rwatson Date: Sun Mar 16 10:55:57 2014 New Revision: 263233 URL: http://svnweb.freebsd.org/changeset/base/263233 Log: Update kernel inclusions of capability.h to use capsicum.h instead; some further refinement is required as some device drivers intended to be portable over FreeBSD versions rely on __FreeBSD_version to decide whether to include capability.h. MFC after: 3 weeks Modified: head/sys/amd64/amd64/sys_machdep.c head/sys/amd64/linux32/linux32_machdep.c head/sys/arm/arm/sys_machdep.c head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/cddl/compat/opensolaris/sys/file.h head/sys/compat/freebsd32/freebsd32_capability.c head/sys/compat/freebsd32/freebsd32_ioctl.c head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/linux/linux_file.c head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_socket.c head/sys/compat/svr4/svr4_fcntl.c head/sys/compat/svr4/svr4_filio.c head/sys/compat/svr4/svr4_ioctl.c head/sys/compat/svr4/svr4_misc.c head/sys/compat/svr4/svr4_stream.c head/sys/dev/aac/aac_linux.c head/sys/dev/aacraid/aacraid_linux.c head/sys/dev/amr/amr_linux.c head/sys/dev/filemon/filemon.c head/sys/dev/hwpmc/hwpmc_logging.c head/sys/dev/ipmi/ipmi_linux.c head/sys/dev/iscsi/icl.c head/sys/dev/iscsi/icl_proxy.c head/sys/dev/iscsi_initiator/iscsi.c head/sys/dev/mfi/mfi_linux.c head/sys/dev/tdfx/tdfx_linux.c head/sys/fs/fdescfs/fdesc_vnops.c head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/i386/i386/sys_machdep.c head/sys/i386/ibcs2/ibcs2_fcntl.c head/sys/i386/ibcs2/ibcs2_ioctl.c head/sys/i386/ibcs2/ibcs2_misc.c head/sys/i386/linux/linux_machdep.c head/sys/kern/imgact_elf.c head/sys/kern/kern_descrip.c head/sys/kern/kern_event.c head/sys/kern/kern_exec.c head/sys/kern/kern_exit.c head/sys/kern/kern_ktrace.c head/sys/kern/kern_sig.c head/sys/kern/kern_sysctl.c head/sys/kern/subr_capability.c head/sys/kern/subr_syscall.c head/sys/kern/subr_trap.c head/sys/kern/sys_capability.c head/sys/kern/sys_generic.c head/sys/kern/sys_procdesc.c head/sys/kern/tty.c head/sys/kern/uipc_mqueue.c head/sys/kern/uipc_sem.c head/sys/kern/uipc_shm.c head/sys/kern/uipc_syscalls.c head/sys/kern/uipc_usrreq.c head/sys/kern/vfs_acl.c head/sys/kern/vfs_aio.c head/sys/kern/vfs_extattr.c head/sys/kern/vfs_lookup.c head/sys/kern/vfs_syscalls.c head/sys/netsmb/smb_dev.c head/sys/nfsserver/nfs_srvkrpc.c head/sys/security/mac/mac_syscalls.c head/sys/sparc64/sparc64/sys_machdep.c head/sys/ufs/ffs/ffs_alloc.c head/sys/vm/vm_mmap.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/amd64/amd64/sys_machdep.c Sun Mar 16 10:55:57 2014 (r263233) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/amd64/linux32/linux32_machdep.c Sun Mar 16 10:55:57 2014 (r263233) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/arm/arm/sys_machdep.c ============================================================================== --- head/sys/arm/arm/sys_machdep.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/arm/arm/sys_machdep.c Sun Mar 16 10:55:57 2014 (r263233) @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Sun Mar 16 10:55:57 2014 (r263233) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include #include Modified: head/sys/cddl/compat/opensolaris/sys/file.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/file.h Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/cddl/compat/opensolaris/sys/file.h Sun Mar 16 10:55:57 2014 (r263233) @@ -36,7 +36,7 @@ #ifdef _KERNEL typedef struct file file_t; -#include +#include static __inline file_t * getf(int fd, cap_rights_t *rightsp) Modified: head/sys/compat/freebsd32/freebsd32_capability.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_capability.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/compat/freebsd32/freebsd32_capability.c Sun Mar 16 10:55:57 2014 (r263233) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include "opt_capsicum.h" #include -#include +#include #include #include #include Modified: head/sys/compat/freebsd32/freebsd32_ioctl.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_ioctl.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/compat/freebsd32/freebsd32_ioctl.c Sun Mar 16 10:55:57 2014 (r263233) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include -#include +#include #include #include #include Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sun Mar 16 10:55:57 2014 (r263233) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/compat/linux/linux_file.c Sun Mar 16 10:55:57 2014 (r263233) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/compat/linux/linux_ioctl.c Sun Mar 16 10:55:57 2014 (r263233) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/compat/linux/linux_socket.c Sun Mar 16 10:55:57 2014 (r263233) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/compat/svr4/svr4_fcntl.c ============================================================================== --- head/sys/compat/svr4/svr4_fcntl.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/compat/svr4/svr4_fcntl.c Sun Mar 16 10:55:57 2014 (r263233) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include #include Modified: head/sys/compat/svr4/svr4_filio.c ============================================================================== --- head/sys/compat/svr4/svr4_filio.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/compat/svr4/svr4_filio.c Sun Mar 16 10:55:57 2014 (r263233) @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/compat/svr4/svr4_ioctl.c ============================================================================== --- head/sys/compat/svr4/svr4_ioctl.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/compat/svr4/svr4_ioctl.c Sun Mar 16 10:55:57 2014 (r263233) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/compat/svr4/svr4_misc.c ============================================================================== --- head/sys/compat/svr4/svr4_misc.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/compat/svr4/svr4_misc.c Sun Mar 16 10:55:57 2014 (r263233) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/compat/svr4/svr4_stream.c ============================================================================== --- head/sys/compat/svr4/svr4_stream.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/compat/svr4/svr4_stream.c Sun Mar 16 10:55:57 2014 (r263233) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/dev/aac/aac_linux.c ============================================================================== --- head/sys/dev/aac/aac_linux.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/dev/aac/aac_linux.c Sun Mar 16 10:55:57 2014 (r263233) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/dev/aacraid/aacraid_linux.c ============================================================================== --- head/sys/dev/aacraid/aacraid_linux.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/dev/aacraid/aacraid_linux.c Sun Mar 16 10:55:57 2014 (r263233) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include #if __FreeBSD_version >= 900000 -#include +#include #endif #include #include Modified: head/sys/dev/amr/amr_linux.c ============================================================================== --- head/sys/dev/amr/amr_linux.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/dev/amr/amr_linux.c Sun Mar 16 10:55:57 2014 (r263233) @@ -30,7 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/dev/filemon/filemon.c ============================================================================== --- head/sys/dev/filemon/filemon.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/dev/filemon/filemon.c Sun Mar 16 10:55:57 2014 (r263233) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #include #if __FreeBSD_version >= 900041 -#include +#include #endif #include "filemon.h" Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/dev/hwpmc/hwpmc_logging.c Sun Mar 16 10:55:57 2014 (r263233) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include #include Modified: head/sys/dev/ipmi/ipmi_linux.c ============================================================================== --- head/sys/dev/ipmi/ipmi_linux.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/dev/ipmi/ipmi_linux.c Sun Mar 16 10:55:57 2014 (r263233) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/dev/iscsi/icl.c Sun Mar 16 10:55:57 2014 (r263233) @@ -35,7 +35,7 @@ */ #include -#include +#include #include #include #include Modified: head/sys/dev/iscsi/icl_proxy.c ============================================================================== --- head/sys/dev/iscsi/icl_proxy.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/dev/iscsi/icl_proxy.c Sun Mar 16 10:55:57 2014 (r263233) @@ -69,7 +69,7 @@ #ifdef ICL_KERNEL_PROXY #include -#include +#include #include #include #include Modified: head/sys/dev/iscsi_initiator/iscsi.c ============================================================================== --- head/sys/dev/iscsi_initiator/iscsi.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/dev/iscsi_initiator/iscsi.c Sun Mar 16 10:55:57 2014 (r263233) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include "opt_iscsi_initiator.h" #include -#include +#include #include #include #include Modified: head/sys/dev/mfi/mfi_linux.c ============================================================================== --- head/sys/dev/mfi/mfi_linux.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/dev/mfi/mfi_linux.c Sun Mar 16 10:55:57 2014 (r263233) @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/dev/tdfx/tdfx_linux.c ============================================================================== --- head/sys/dev/tdfx/tdfx_linux.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/dev/tdfx/tdfx_linux.c Sun Mar 16 10:55:57 2014 (r263233) @@ -28,7 +28,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include #include Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/fs/fdescfs/fdesc_vnops.c Sun Mar 16 10:55:57 2014 (r263233) @@ -40,7 +40,7 @@ #include #include -#include +#include #include #include #include Modified: head/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- head/sys/fs/fuse/fuse_vfsops.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/fs/fuse/fuse_vfsops.c Sun Mar 16 10:55:57 2014 (r263233) @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/fs/nfsclient/nfs_clport.c Sun Mar 16 10:55:57 2014 (r263233) @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" -#include +#include /* * generally, I don't like #includes inside .h files, but it seems to Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Sun Mar 16 10:55:57 2014 (r263233) @@ -34,7 +34,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include /* * Functions that perform the vfs operations required by the routines in Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/i386/i386/sys_machdep.c Sun Mar 16 10:55:57 2014 (r263233) @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$"); #include "opt_kstack_pages.h" #include -#include +#include #include #include #include Modified: head/sys/i386/ibcs2/ibcs2_fcntl.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_fcntl.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/i386/ibcs2/ibcs2_fcntl.c Sun Mar 16 10:55:57 2014 (r263233) @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/i386/ibcs2/ibcs2_ioctl.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_ioctl.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/i386/ibcs2/ibcs2_ioctl.c Sun Mar 16 10:55:57 2014 (r263233) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/i386/ibcs2/ibcs2_misc.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_misc.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/i386/ibcs2/ibcs2_misc.c Sun Mar 16 10:55:57 2014 (r263233) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); */ #include #include -#include +#include #include #include #include Modified: head/sys/i386/linux/linux_machdep.c ============================================================================== --- head/sys/i386/linux/linux_machdep.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/i386/linux/linux_machdep.c Sun Mar 16 10:55:57 2014 (r263233) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/imgact_elf.c Sun Mar 16 10:55:57 2014 (r263233) @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$"); #include "opt_core.h" #include -#include +#include #include #include #include Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/kern_descrip.c Sun Mar 16 10:55:57 2014 (r263233) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/kern_event.c Sun Mar 16 10:55:57 2014 (r263233) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/kern_exec.c Sun Mar 16 10:55:57 2014 (r263233) @@ -33,9 +33,9 @@ __FBSDID("$FreeBSD$"); #include "opt_vm.h" #include -#include +#include #include -#include +#include #include #include #include Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/kern_exit.c Sun Mar 16 10:55:57 2014 (r263233) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/kern/kern_ktrace.c ============================================================================== --- head/sys/kern/kern_ktrace.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/kern_ktrace.c Sun Mar 16 10:55:57 2014 (r263233) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ktrace.h" #include -#include +#include #include #include #include Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/kern_sig.c Sun Mar 16 10:55:57 2014 (r263233) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/kern_sysctl.c Sun Mar 16 10:55:57 2014 (r263233) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/kern/subr_capability.c ============================================================================== --- head/sys/kern/subr_capability.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/subr_capability.c Sun Mar 16 10:55:57 2014 (r263233) @@ -36,13 +36,13 @@ __FBSDID("$FreeBSD$"); #ifdef _KERNEL #include -#include +#include #include #include #else /* !_KERNEL */ #include -#include +#include #include #include Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/subr_syscall.c Sun Mar 16 10:55:57 2014 (r263233) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); -#include +#include #include #ifdef KTRACE #include Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/subr_trap.c Sun Mar 16 10:55:57 2014 (r263233) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/kern/sys_capability.c ============================================================================== --- head/sys/kern/sys_capability.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/sys_capability.c Sun Mar 16 10:55:57 2014 (r263233) @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ktrace.h" #include -#include +#include #include #include #include Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/sys_generic.c Sun Mar 16 10:55:57 2014 (r263233) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/kern/sys_procdesc.c ============================================================================== --- head/sys/kern/sys_procdesc.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/sys_procdesc.c Sun Mar 16 10:55:57 2014 (r263233) @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include #include Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/tty.c Sun Mar 16 10:55:57 2014 (r263233) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include -#include +#include #include #include #include Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/uipc_mqueue.c Sun Mar 16 10:55:57 2014 (r263233) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/kern/uipc_sem.c ============================================================================== --- head/sys/kern/uipc_sem.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/uipc_sem.c Sun Mar 16 10:55:57 2014 (r263233) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include "opt_posix.h" #include -#include +#include #include #include #include Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/uipc_shm.c Sun Mar 16 10:55:57 2014 (r263233) @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); #include "opt_capsicum.h" #include -#include +#include #include #include #include Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/uipc_syscalls.c Sun Mar 16 10:55:57 2014 (r263233) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/uipc_usrreq.c Sun Mar 16 10:55:57 2014 (r263233) @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include -#include +#include #include #include #include /* XXX must be before */ Modified: head/sys/kern/vfs_acl.c ============================================================================== --- head/sys/kern/vfs_acl.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/vfs_acl.c Sun Mar 16 10:55:57 2014 (r263233) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/vfs_aio.c Sun Mar 16 10:55:57 2014 (r263233) @@ -28,7 +28,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/kern/vfs_extattr.c ============================================================================== --- head/sys/kern/vfs_extattr.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/vfs_extattr.c Sun Mar 16 10:55:57 2014 (r263233) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/vfs_lookup.c Sun Mar 16 10:55:57 2014 (r263233) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/kern/vfs_syscalls.c Sun Mar 16 10:55:57 2014 (r263233) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/netsmb/smb_dev.c ============================================================================== --- head/sys/netsmb/smb_dev.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/netsmb/smb_dev.c Sun Mar 16 10:55:57 2014 (r263233) @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/nfsserver/nfs_srvkrpc.c ============================================================================== --- head/sys/nfsserver/nfs_srvkrpc.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/nfsserver/nfs_srvkrpc.c Sun Mar 16 10:55:57 2014 (r263233) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include "opt_kgssapi.h" #include -#include +#include #include #include #include Modified: head/sys/security/mac/mac_syscalls.c ============================================================================== --- head/sys/security/mac/mac_syscalls.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/security/mac/mac_syscalls.c Sun Mar 16 10:55:57 2014 (r263233) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include "opt_mac.h" #include -#include +#include #include #include #include Modified: head/sys/sparc64/sparc64/sys_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/sys_machdep.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/sparc64/sparc64/sys_machdep.c Sun Mar 16 10:55:57 2014 (r263233) @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include #include Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/ufs/ffs/ffs_alloc.c Sun Mar 16 10:55:57 2014 (r263233) @@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$"); #include "opt_quota.h" #include -#include +#include #include #include #include Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sun Mar 16 10:49:16 2014 (r263232) +++ head/sys/vm/vm_mmap.c Sun Mar 16 10:55:57 2014 (r263233) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 11:04:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3724B252; Sun, 16 Mar 2014 11:04:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 204B9A8F; Sun, 16 Mar 2014 11:04:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GB4qmA020450; Sun, 16 Mar 2014 11:04:52 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GB4jgP020411; Sun, 16 Mar 2014 11:04:45 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201403161104.s2GB4jgP020411@svn.freebsd.org> From: Robert Watson Date: Sun, 16 Mar 2014 11:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263234 - in head: contrib/tcpdump crypto/openssh lib/libc/gen lib/libcasper lib/libprocstat sbin/casperd sbin/dhclient sbin/hastd sbin/ping tools/regression/capsicum/libcapsicum tools/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 11:04:52 -0000 Author: rwatson Date: Sun Mar 16 11:04:44 2014 New Revision: 263234 URL: http://svnweb.freebsd.org/changeset/base/263234 Log: Update most userspace consumers of capability.h to use capsicum.h instead. auditdistd is not updated as I will make the change upstream and then do a vendor import sometime in the next week or two. MFC after: 3 weeks Modified: head/contrib/tcpdump/tcpdump.c head/crypto/openssh/sandbox-capsicum.c head/lib/libc/gen/cap_sandboxed.c head/lib/libcasper/libcasper.c head/lib/libprocstat/libprocstat.c head/sbin/casperd/casperd.c head/sbin/casperd/zygote.c head/sbin/dhclient/bpf.c head/sbin/dhclient/dhclient.c head/sbin/hastd/subr.c head/sbin/ping/ping.c head/tools/regression/capsicum/libcapsicum/dns.c head/tools/regression/capsicum/libcapsicum/grp.c head/tools/regression/capsicum/libcapsicum/pwd.c head/tools/regression/capsicum/libcapsicum/sysctl.c head/tools/regression/capsicum/syscalls/cap_fcntls_limit.c head/tools/regression/capsicum/syscalls/cap_getmode.c head/tools/regression/capsicum/syscalls/cap_ioctls_limit.c head/tools/regression/security/cap_test/cap_test_capabilities.c head/tools/regression/security/cap_test/cap_test_capmode.c head/tools/regression/security/cap_test/cap_test_fcntl.c head/tools/regression/security/cap_test/cap_test_pdfork.c head/tools/regression/security/cap_test/cap_test_pdkill.c head/tools/regression/security/cap_test/cap_test_relative.c head/tools/regression/security/cap_test/cap_test_sysctl.c head/usr.bin/kdump/kdump.c head/usr.bin/kdump/mksubr head/usr.bin/procstat/procstat_files.c head/usr.bin/rwho/rwho.c head/usr.bin/uniq/uniq.c head/usr.sbin/ctld/kernel.c head/usr.sbin/iscsid/iscsid.c head/usr.sbin/rwhod/rwhod.c Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/contrib/tcpdump/tcpdump.c Sun Mar 16 11:04:44 2014 (r263234) @@ -69,7 +69,7 @@ extern int SIZE_BUF; #include #include #ifdef __FreeBSD__ -#include +#include #include #include #include Modified: head/crypto/openssh/sandbox-capsicum.c ============================================================================== --- head/crypto/openssh/sandbox-capsicum.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/crypto/openssh/sandbox-capsicum.c Sun Mar 16 11:04:44 2014 (r263234) @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include Modified: head/lib/libc/gen/cap_sandboxed.c ============================================================================== --- head/lib/libc/gen/cap_sandboxed.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/lib/libc/gen/cap_sandboxed.c Sun Mar 16 11:04:44 2014 (r263234) @@ -30,7 +30,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include Modified: head/lib/libcasper/libcasper.c ============================================================================== --- head/lib/libcasper/libcasper.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/lib/libcasper/libcasper.c Sun Mar 16 11:04:44 2014 (r263234) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include #include Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/lib/libprocstat/libprocstat.c Sun Mar 16 11:04:44 2014 (r263234) @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #define _KERNEL #include #include Modified: head/sbin/casperd/casperd.c ============================================================================== --- head/sbin/casperd/casperd.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/sbin/casperd/casperd.c Sun Mar 16 11:04:44 2014 (r263234) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include #include Modified: head/sbin/casperd/zygote.c ============================================================================== --- head/sbin/casperd/zygote.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/sbin/casperd/zygote.c Sun Mar 16 11:04:44 2014 (r263234) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include Modified: head/sbin/dhclient/bpf.c ============================================================================== --- head/sbin/dhclient/bpf.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/sbin/dhclient/bpf.c Sun Mar 16 11:04:44 2014 (r263234) @@ -43,11 +43,11 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include "dhcpd.h" #include "privsep.h" -#include +#include #include #include Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/sbin/dhclient/dhclient.c Sun Mar 16 11:04:44 2014 (r263234) @@ -56,12 +56,12 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include "dhcpd.h" #include "privsep.h" -#include +#include #include Modified: head/sbin/hastd/subr.c ============================================================================== --- head/sbin/hastd/subr.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/sbin/hastd/subr.c Sun Mar 16 11:04:44 2014 (r263234) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #ifdef HAVE_CAPSICUM -#include +#include #include #endif Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/sbin/ping/ping.c Sun Mar 16 11:04:44 2014 (r263234) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); */ #include /* NB: we rely on this for */ -#include +#include #include #include #include Modified: head/tools/regression/capsicum/libcapsicum/dns.c ============================================================================== --- head/tools/regression/capsicum/libcapsicum/dns.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/tools/regression/capsicum/libcapsicum/dns.c Sun Mar 16 11:04:44 2014 (r263234) @@ -30,7 +30,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include Modified: head/tools/regression/capsicum/libcapsicum/grp.c ============================================================================== --- head/tools/regression/capsicum/libcapsicum/grp.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/tools/regression/capsicum/libcapsicum/grp.c Sun Mar 16 11:04:44 2014 (r263234) @@ -30,7 +30,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include Modified: head/tools/regression/capsicum/libcapsicum/pwd.c ============================================================================== --- head/tools/regression/capsicum/libcapsicum/pwd.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/tools/regression/capsicum/libcapsicum/pwd.c Sun Mar 16 11:04:44 2014 (r263234) @@ -30,7 +30,7 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include Modified: head/tools/regression/capsicum/libcapsicum/sysctl.c ============================================================================== --- head/tools/regression/capsicum/libcapsicum/sysctl.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/tools/regression/capsicum/libcapsicum/sysctl.c Sun Mar 16 11:04:44 2014 (r263234) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include Modified: head/tools/regression/capsicum/syscalls/cap_fcntls_limit.c ============================================================================== --- head/tools/regression/capsicum/syscalls/cap_fcntls_limit.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/tools/regression/capsicum/syscalls/cap_fcntls_limit.c Sun Mar 16 11:04:44 2014 (r263234) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include #include Modified: head/tools/regression/capsicum/syscalls/cap_getmode.c ============================================================================== --- head/tools/regression/capsicum/syscalls/cap_getmode.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/tools/regression/capsicum/syscalls/cap_getmode.c Sun Mar 16 11:04:44 2014 (r263234) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include Modified: head/tools/regression/capsicum/syscalls/cap_ioctls_limit.c ============================================================================== --- head/tools/regression/capsicum/syscalls/cap_ioctls_limit.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/tools/regression/capsicum/syscalls/cap_ioctls_limit.c Sun Mar 16 11:04:44 2014 (r263234) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include #include Modified: head/tools/regression/security/cap_test/cap_test_capabilities.c ============================================================================== --- head/tools/regression/security/cap_test/cap_test_capabilities.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/tools/regression/security/cap_test/cap_test_capabilities.c Sun Mar 16 11:04:44 2014 (r263234) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include #include Modified: head/tools/regression/security/cap_test/cap_test_capmode.c ============================================================================== --- head/tools/regression/security/cap_test/cap_test_capmode.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/tools/regression/security/cap_test/cap_test_capmode.c Sun Mar 16 11:04:44 2014 (r263234) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include #include Modified: head/tools/regression/security/cap_test/cap_test_fcntl.c ============================================================================== --- head/tools/regression/security/cap_test/cap_test_fcntl.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/tools/regression/security/cap_test/cap_test_fcntl.c Sun Mar 16 11:04:44 2014 (r263234) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include #include Modified: head/tools/regression/security/cap_test/cap_test_pdfork.c ============================================================================== --- head/tools/regression/security/cap_test/cap_test_pdfork.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/tools/regression/security/cap_test/cap_test_pdfork.c Sun Mar 16 11:04:44 2014 (r263234) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include #include Modified: head/tools/regression/security/cap_test/cap_test_pdkill.c ============================================================================== --- head/tools/regression/security/cap_test/cap_test_pdkill.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/tools/regression/security/cap_test/cap_test_pdkill.c Sun Mar 16 11:04:44 2014 (r263234) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include #include Modified: head/tools/regression/security/cap_test/cap_test_relative.c ============================================================================== --- head/tools/regression/security/cap_test/cap_test_relative.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/tools/regression/security/cap_test/cap_test_relative.c Sun Mar 16 11:04:44 2014 (r263234) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include Modified: head/tools/regression/security/cap_test/cap_test_sysctl.c ============================================================================== --- head/tools/regression/security/cap_test/cap_test_sysctl.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/tools/regression/security/cap_test/cap_test_sysctl.c Sun Mar 16 11:04:44 2014 (r263234) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include #include Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/usr.bin/kdump/kdump.c Sun Mar 16 11:04:44 2014 (r263234) @@ -46,7 +46,7 @@ extern int errno; #include #undef _KERNEL #include -#include +#include #include #define _KERNEL #include Modified: head/usr.bin/kdump/mksubr ============================================================================== --- head/usr.bin/kdump/mksubr Sun Mar 16 10:55:57 2014 (r263233) +++ head/usr.bin/kdump/mksubr Sun Mar 16 11:04:44 2014 (r263234) @@ -187,7 +187,7 @@ cat <<_EOF_ #include #include #include -#include +#include #include #include @@ -448,7 +448,7 @@ _EOF_ auto_or_type "accessmodename" "[A-Z]_OK[[:space:]]+0?x?[0-9A-Fa-f]+" "sys/unistd.h" auto_switch_type "acltypename" "ACL_TYPE_[A-Z4_]+[[:space:]]+0x[0-9]+" "sys/acl.h" -auto_or_type "capfcntlname" "CAP_FCNTL_[A-Z]+[[:space:]]+\(1" "sys/capability.h" +auto_or_type "capfcntlname" "CAP_FCNTL_[A-Z]+[[:space:]]+\(1" "sys/capsicum.h" auto_switch_type "extattrctlname" "EXTATTR_NAMESPACE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/extattr.h" auto_switch_type "fadvisebehavname" "POSIX_FADV_[A-Z]+[[:space:]]+[0-9]+" "sys/fcntl.h" auto_or_type "flagsname" "O_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/fcntl.h" @@ -679,7 +679,7 @@ cat <<_EOF_ _EOF_ egrep '#define[[:space:]]+CAP_[A-Z_]+[[:space:]]+CAPRIGHT\([0-9],[[:space:]]+0x[0-9]{16}ULL\)' \ - $include_dir/sys/capability.h | \ + $include_dir/sys/capsicum.h | \ sed -E 's/[ ]+/ /g' | \ awk -F '[ \(,\)]' ' BEGIN { Modified: head/usr.bin/procstat/procstat_files.c ============================================================================== --- head/usr.bin/procstat/procstat_files.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/usr.bin/procstat/procstat_files.c Sun Mar 16 11:04:44 2014 (r263234) @@ -27,7 +27,7 @@ */ #include -#include +#include #include #include #include Modified: head/usr.bin/rwho/rwho.c ============================================================================== --- head/usr.bin/rwho/rwho.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/usr.bin/rwho/rwho.c Sun Mar 16 11:04:44 2014 (r263234) @@ -43,7 +43,7 @@ static char sccsid[] = "@(#)rwho.c 8.1 ( #include __FBSDID("$FreeBSD$"); -#include +#include #include #include Modified: head/usr.bin/uniq/uniq.c ============================================================================== --- head/usr.bin/uniq/uniq.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/usr.bin/uniq/uniq.c Sun Mar 16 11:04:44 2014 (r263234) @@ -44,7 +44,7 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ -#include +#include #include #include Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/usr.sbin/ctld/kernel.c Sun Mar 16 11:04:44 2014 (r263234) @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include Modified: head/usr.sbin/iscsid/iscsid.c ============================================================================== --- head/usr.sbin/iscsid/iscsid.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/usr.sbin/iscsid/iscsid.c Sun Mar 16 11:04:44 2014 (r263234) @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include Modified: head/usr.sbin/rwhod/rwhod.c ============================================================================== --- head/usr.sbin/rwhod/rwhod.c Sun Mar 16 10:55:57 2014 (r263233) +++ head/usr.sbin/rwhod/rwhod.c Sun Mar 16 11:04:44 2014 (r263234) @@ -43,7 +43,7 @@ static char sccsid[] = "@(#)rwhod.c 8.1 #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 11:06:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6AC73B4; Sun, 16 Mar 2014 11:06:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D3ADEA9C; Sun, 16 Mar 2014 11:06:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GB65hk020648; Sun, 16 Mar 2014 11:06:05 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GB65Zx020647; Sun, 16 Mar 2014 11:06:05 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201403161106.s2GB65Zx020647@svn.freebsd.org> From: Robert Watson Date: Sun, 16 Mar 2014 11:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263235 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 11:06:06 -0000 Author: rwatson Date: Sun Mar 16 11:06:05 2014 New Revision: 263235 URL: http://svnweb.freebsd.org/changeset/base/263235 Log: Bump __FreeBSD_version to reflect capability.h -> capsicum.h change. MFC after: 3 weeks Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Mar 16 11:04:44 2014 (r263234) +++ head/sys/sys/param.h Sun Mar 16 11:06:05 2014 (r263235) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100013 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100014 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 12:31:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8C5BF8D; Sun, 16 Mar 2014 12:31:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B5FA91FE; Sun, 16 Mar 2014 12:31:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GCVScn055614; Sun, 16 Mar 2014 12:31:28 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GCVS6I055613; Sun, 16 Mar 2014 12:31:28 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201403161231.s2GCVS6I055613@svn.freebsd.org> From: Tycho Nightingale Date: Sun, 16 Mar 2014 12:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263236 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 12:31:28 -0000 Author: tychon Date: Sun Mar 16 12:31:28 2014 New Revision: 263236 URL: http://svnweb.freebsd.org/changeset/base/263236 Log: Support the bootloader's single 16-bit 'outw' access to the Divisor Latch MSB and LSB registers. Approved by: neel (co-mentor) Modified: head/usr.sbin/bhyve/pci_lpc.c Modified: head/usr.sbin/bhyve/pci_lpc.c ============================================================================== --- head/usr.sbin/bhyve/pci_lpc.c Sun Mar 16 11:06:05 2014 (r263235) +++ head/usr.sbin/bhyve/pci_lpc.c Sun Mar 16 12:31:28 2014 (r263236) @@ -125,15 +125,27 @@ lpc_uart_io_handler(struct vmctx *ctx, i int offset; struct lpc_uart_softc *sc = arg; - if (bytes != 1) - return (-1); - offset = port - sc->iobase; - if (in) - *eax = uart_read(sc->uart_softc, offset); - else - uart_write(sc->uart_softc, offset, *eax); + switch (bytes) { + case 1: + if (in) + *eax = uart_read(sc->uart_softc, offset); + else + uart_write(sc->uart_softc, offset, *eax); + break; + case 2: + if (in) { + *eax = uart_read(sc->uart_softc, offset); + *eax |= uart_read(sc->uart_softc, offset + 1) << 8; + } else { + uart_write(sc->uart_softc, offset, *eax); + uart_write(sc->uart_softc, offset + 1, *eax >> 8); + } + break; + default: + return (-1); + } return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 12:32:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DBF615A; Sun, 16 Mar 2014 12:32:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 79811208; Sun, 16 Mar 2014 12:32:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GCWHOm056076; Sun, 16 Mar 2014 12:32:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GCWGJo056069; Sun, 16 Mar 2014 12:32:16 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201403161232.s2GCWGJo056069@svn.freebsd.org> From: Michael Tuexen Date: Sun, 16 Mar 2014 12:32:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263237 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 12:32:17 -0000 Author: tuexen Date: Sun Mar 16 12:32:16 2014 New Revision: 263237 URL: http://svnweb.freebsd.org/changeset/base/263237 Log: * Provide information in error causes in ASCII instead of proprietary binary format. * Add support for a diagnostic information error cause. The code is sysctlable and the default is 0, which means it is not sent. This is joint work with rrs@. MFC after: 1 week Modified: head/sys/netinet/sctp.h head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Sun Mar 16 12:31:28 2014 (r263236) +++ head/sys/netinet/sctp.h Sun Mar 16 12:32:16 2014 (r263237) @@ -365,6 +365,12 @@ struct sctp_paramhdr { /* * error cause parameters (user visible) */ +struct sctp_gen_error_cause { + uint16_t code; + uint16_t length; + uint8_t info[]; +} SCTP_PACKED; + struct sctp_error_cause { uint16_t code; uint16_t length; Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Sun Mar 16 12:31:28 2014 (r263236) +++ head/sys/netinet/sctp_constants.h Sun Mar 16 12:32:16 2014 (r263237) @@ -771,6 +771,9 @@ __FBSDID("$FreeBSD$"); */ #define SCTP_DEFAULT_SPLIT_POINT_MIN 2904 +/* Maximum length of diagnostic information in error causes */ +#define SCTP_DIAG_INFO_LEN 64 + /* ABORT CODES and other tell-tale location * codes are generated by adding the below * to the instance id. Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun Mar 16 12:31:28 2014 (r263236) +++ head/sys/netinet/sctp_indata.c Sun Mar 16 12:32:16 2014 (r263237) @@ -561,7 +561,8 @@ sctp_queue_data_to_stream(struct sctp_tc struct sctp_queued_to_read *at; int queue_needed; uint16_t nxt_todel; - struct mbuf *oper; + struct mbuf *op_err; + char msg[SCTP_DIAG_INFO_LEN]; queue_needed = 1; asoc->size_on_all_streams += control->length; @@ -578,7 +579,7 @@ sctp_queue_data_to_stream(struct sctp_tc (uint32_t) nxt_todel); if (SCTP_SSN_GE(strm->last_sequence_delivered, control->sinfo_ssn)) { /* The incoming sseq is behind where we last delivered? */ - SCTPDBG(SCTP_DEBUG_INDATA1, "Duplicate S-SEQ:%d delivered:%d from peer, Abort association\n", + SCTPDBG(SCTP_DEBUG_INDATA1, "Duplicate S-SEQ:%d delivered:%d from peer, Abort association\n", control->sinfo_ssn, strm->last_sequence_delivered); protocol_error: /* @@ -586,26 +587,12 @@ protocol_error: * association destruction */ TAILQ_INSERT_HEAD(&strm->inqueue, control, next); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr) + - (sizeof(uint32_t) * 3); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_1); - ippp++; - *ippp = control->sinfo_tsn; - ippp++; - *ippp = ((control->sinfo_stream << 16) | control->sinfo_ssn); - } + snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + strm->last_sequence_delivered, control->sinfo_tsn, + control->sinfo_stream, control->sinfo_ssn); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_1; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; @@ -839,7 +826,9 @@ static void sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_tmit_chunk *chk, int *abort_flag) { - struct mbuf *oper; + struct mbuf *op_err; + char msg[SCTP_DIAG_INFO_LEN]; + uint32_t cum_ackp1, prev_tsn, post_tsn; struct sctp_tmit_chunk *at, *prev, *next; @@ -864,30 +853,14 @@ sctp_queue_data_for_reasm(struct sctp_tc * a FIRST fragment mark. */ SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, its not first, no fragmented delivery in progress\n"); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (sizeof(uint32_t) * 3); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_2); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - - } + snprintf(msg, sizeof(msg), + "Expected B-bit for TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_2; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; } else if (asoc->fragmented_delivery_inprogress && (chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) == SCTP_DATA_FIRST_FRAG) { @@ -897,28 +870,14 @@ sctp_queue_data_for_reasm(struct sctp_tc * MIDDLE fragment NOT a FIRST */ SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, it IS a first and fragmented delivery in progress\n"); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_3); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - } + snprintf(msg, sizeof(msg), + "Didn't expect B-bit for TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_3; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; } else if (asoc->fragmented_delivery_inprogress) { /* @@ -931,30 +890,15 @@ sctp_queue_data_for_reasm(struct sctp_tc SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, it IS not same stream number %d vs %d\n", chk->rec.data.stream_number, asoc->str_of_pdapi); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (sizeof(uint32_t) * 3); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_4); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - } + snprintf(msg, sizeof(msg), + "Expected SID=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + asoc->str_of_pdapi, + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_4; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; } else if ((asoc->fragment_flags & SCTP_DATA_UNORDERED) != SCTP_DATA_UNORDERED && @@ -963,31 +907,15 @@ sctp_queue_data_for_reasm(struct sctp_tc SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, it IS not same stream seq %d vs %d\n", chk->rec.data.stream_seq, asoc->ssn_of_pdapi); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_5); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - - } + snprintf(msg, sizeof(msg), + "Expected SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + asoc->ssn_of_pdapi, + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_5; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; } } @@ -1057,31 +985,14 @@ sctp_queue_data_for_reasm(struct sctp_tc SCTP_DATA_FIRST_FRAG) { SCTPDBG(SCTP_DEBUG_INDATA1, "Prev check - It can be a midlle or last but not a first\n"); SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, it's a FIRST!\n"); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_6); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - - } + snprintf(msg, sizeof(msg), + "Can't handle B-bit, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_6; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1091,33 +1002,18 @@ sctp_queue_data_for_reasm(struct sctp_tc * Huh, need the correct STR here, * they must be the same. */ - SCTP_PRINTF("Prev check - Gak, Evil plot, ssn:%d not the same as at:%d\n", + SCTP_PRINTF("Prev check - Gak, Evil plot, sid:%d not the same as at:%d\n", chk->rec.data.stream_number, prev->rec.data.stream_number); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_7); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - } + snprintf(msg, sizeof(msg), + "Expect SID=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + prev->rec.data.stream_number, + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_7; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1131,30 +1027,15 @@ sctp_queue_data_for_reasm(struct sctp_tc SCTPDBG(SCTP_DEBUG_INDATA1, "Prev check - Gak, Evil plot, sseq:%d not the same as at:%d\n", chk->rec.data.stream_seq, prev->rec.data.stream_seq); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_8); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - } + snprintf(msg, sizeof(msg), + "Expect SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + prev->rec.data.stream_seq, + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_8; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1164,31 +1045,14 @@ sctp_queue_data_for_reasm(struct sctp_tc if ((chk->rec.data.rcv_flags & SCTP_DATA_FRAG_MASK) != SCTP_DATA_FIRST_FRAG) { SCTPDBG(SCTP_DEBUG_INDATA1, "Prev check - Gak, evil plot, its not FIRST and it must be!\n"); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_9); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - - } + snprintf(msg, sizeof(msg), + "Expect B-bit, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_9; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1208,30 +1072,14 @@ sctp_queue_data_for_reasm(struct sctp_tc != SCTP_DATA_LAST_FRAG) { SCTPDBG(SCTP_DEBUG_INDATA1, "Next chk - Next is FIRST, we must be LAST\n"); SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, its not a last!\n"); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_10); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - } + snprintf(msg, sizeof(msg), + "Expect only E-bit, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_10; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1247,31 +1095,14 @@ sctp_queue_data_for_reasm(struct sctp_tc SCTP_DATA_LAST_FRAG) { SCTPDBG(SCTP_DEBUG_INDATA1, "Next chk - Next is a MIDDLE/LAST\n"); SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, new prev chunk is a LAST\n"); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_11); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - - } + snprintf(msg, sizeof(msg), + "Didn't expect E-bit, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_11; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1284,31 +1115,15 @@ sctp_queue_data_for_reasm(struct sctp_tc SCTPDBG(SCTP_DEBUG_INDATA1, "Next chk - Gak, Evil plot, ssn:%d not the same as at:%d\n", chk->rec.data.stream_number, next->rec.data.stream_number); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_12); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - - } + snprintf(msg, sizeof(msg), + "Required SID %4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + next->rec.data.stream_number, + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_12; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1322,30 +1137,15 @@ sctp_queue_data_for_reasm(struct sctp_tc SCTPDBG(SCTP_DEBUG_INDATA1, "Next chk - Gak, Evil plot, sseq:%d not the same as at:%d\n", chk->rec.data.stream_seq, next->rec.data.stream_seq); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_13); - ippp++; - *ippp = chk->rec.data.TSN_seq; - ippp++; - *ippp = ((chk->rec.data.stream_number << 16) | chk->rec.data.stream_seq); - } + snprintf(msg, sizeof(msg), + "Required SSN %4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + next->rec.data.stream_seq, + chk->rec.data.TSN_seq, + chk->rec.data.stream_number, + chk->rec.data.stream_seq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_13; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return; } @@ -1430,7 +1230,8 @@ sctp_process_a_data_chunk(struct sctp_tc int the_len; int need_reasm_check = 0; uint16_t strmno, strmseq; - struct mbuf *oper; + struct mbuf *op_err; + char msg[SCTP_DIAG_INFO_LEN]; struct sctp_queued_to_read *control; int ordered; uint32_t protocol_id; @@ -1497,15 +1298,12 @@ sctp_process_a_data_chunk(struct sctp_tc */ if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) || - (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET)) - ) { + (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET))) { /* * wait a minute, this guy is gone, there is no longer a * receiver. Send peer an ABORT! */ - struct mbuf *op_err; - - op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); + op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); @@ -1633,27 +1431,13 @@ sctp_process_a_data_chunk(struct sctp_tc /* The incoming sseq is behind where we last delivered? */ SCTPDBG(SCTP_DEBUG_INDATA1, "EVIL/Broken-Dup S-SEQ:%d delivered:%d from peer, Abort!\n", strmseq, asoc->strmin[strmno].last_sequence_delivered); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_14); - ippp++; - *ippp = tsn; - ippp++; - *ippp = ((strmno << 16) | strmseq); - } + snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + asoc->strmin[strmno].last_sequence_delivered, + tsn, strmno, strmseq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_14; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); } @@ -1892,28 +1676,11 @@ failed_pdapi_express_del: control->whoFrom = NULL; } sctp_free_a_readq(stcb, control); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_15); - ippp++; - *ippp = tsn; - ippp++; - *ippp = ((strmno << 16) | strmseq); - } + snprintf(msg, sizeof(msg), "Reas. queue emtpy, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + tsn, strmno, strmseq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_15; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); } else { @@ -1925,31 +1692,11 @@ failed_pdapi_express_del: control->whoFrom = NULL; } sctp_free_a_readq(stcb, control); - - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_16); - ippp++; - *ippp = tsn; - ippp++; - *ippp = ((strmno << 16) | strmseq); - } + snprintf(msg, sizeof(msg), "PD ongoing, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + tsn, strmno, strmseq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); } @@ -1971,30 +1718,11 @@ failed_pdapi_express_del: control->whoFrom = NULL; } sctp_free_a_readq(stcb, control); - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = - sizeof(struct sctp_paramhdr) + - (3 * sizeof(uint32_t)); - ph = mtod(oper, - struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = - htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_17); - ippp++; - *ippp = tsn; - ippp++; - *ippp = ((strmno << 16) | strmseq); - } + snprintf(msg, sizeof(msg), "No PD ongoing, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x", + tsn, strmno, strmseq); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; return (0); } @@ -2601,26 +2329,11 @@ sctp_process_data(struct mbuf **mm, int * invalid data chunk. */ struct mbuf *op_err; + char msg[SCTP_DIAG_INFO_LEN]; - op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 2 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - - if (op_err) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(op_err) = sizeof(struct sctp_paramhdr) + - (2 * sizeof(uint32_t)); - ph = mtod(op_err, struct sctp_paramhdr *); - ph->param_type = - htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(SCTP_BUF_LEN(op_err)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_19); - ippp++; - *ippp = asoc->cumulative_tsn; - - } + snprintf(msg, sizeof(msg), "DATA chunk of length %d", + chk_length); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19; sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, @@ -2688,7 +2401,7 @@ sctp_process_data(struct mbuf **mm, int if (SCTP_BASE_SYSCTL(sctp_strict_data_order)) { struct mbuf *op_err; - op_err = sctp_generate_invmanparam(SCTP_CAUSE_PROTOCOL_VIOLATION); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, @@ -3837,7 +3550,8 @@ sctp_express_handle_sack(struct sctp_tcb } if (SCTP_TSN_GE(cumack, send_s)) { #ifndef INVARIANTS - struct mbuf *oper; + struct mbuf *op_err; + char msg[SCTP_DIAG_INFO_LEN]; #endif #ifdef INVARIANTS @@ -3846,22 +3560,11 @@ sctp_express_handle_sack(struct sctp_tcb *abort_now = 1; /* XXX */ - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr) + - sizeof(uint32_t); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_25); - } + snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal then TSN %8.8x", + cumack, send_s); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_25; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); return; #endif } @@ -4211,23 +3914,14 @@ again: (asoc->stream_queue_cnt == 0)) { if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { /* Need to abort here */ - struct mbuf *oper; + struct mbuf *op_err; abort_out_now: *abort_now = 1; /* XXX */ - oper = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - - SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - } + op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); } else { struct sctp_nets *netp; @@ -4420,7 +4114,8 @@ sctp_handle_sack(struct mbuf *m, int off send_s = asoc->sending_seq; } if (SCTP_TSN_GE(cum_ack, send_s)) { - struct mbuf *oper; + struct mbuf *op_err; + char msg[SCTP_DIAG_INFO_LEN]; /* * no way, we have not even sent this TSN out yet. @@ -4435,22 +4130,11 @@ sctp_handle_sack(struct mbuf *m, int off hopeless_peer: *abort_now = 1; /* XXX */ - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr) + - sizeof(uint32_t); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_25); - } + snprintf(msg, sizeof(msg), "Cum ack %8.8x greater or equal then TSN %8.8x", + cum_ack, send_s); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_25; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); return; } } @@ -4939,23 +4623,14 @@ sctp_handle_sack(struct mbuf *m, int off (asoc->stream_queue_cnt == 0)) { if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { /* Need to abort here */ - struct mbuf *oper; + struct mbuf *op_err; abort_out_now: *abort_now = 1; /* XXX */ - oper = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - - SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - } + op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_31; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); return; } else { struct sctp_nets *netp; @@ -5384,33 +5059,20 @@ sctp_handle_forward_tsn(struct sctp_tcb asoc->cumulative_tsn = new_cum_tsn; if (gap >= m_size) { if ((long)gap > sctp_sbspace(&stcb->asoc, &stcb->sctp_socket->so_rcv)) { - struct mbuf *oper; + struct mbuf *op_err; + char msg[SCTP_DIAG_INFO_LEN]; /* * out of range (of single byte chunks in the rwnd I * give out). This must be an attacker. */ *abort_flag = 1; - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_NOWAIT, 1, MT_DATA); - if (oper) { - struct sctp_paramhdr *ph; - uint32_t *ippp; - - SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr) + - (sizeof(uint32_t) * 3); - ph = mtod(oper, struct sctp_paramhdr *); - ph->param_type = htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_33); - ippp++; - *ippp = asoc->highest_tsn_inside_map; - ippp++; - *ippp = new_cum_tsn; - } + snprintf(msg, sizeof(msg), + "New cum ack %8.8x too high, highest TSN %8.8x", + new_cum_tsn, asoc->highest_tsn_inside_map); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_33; - sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); return; } SCTP_STAT_INCR(sctps_fwdtsn_map_over); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Mar 16 12:31:28 2014 (r263236) +++ head/sys/netinet/sctp_input.c Sun Mar 16 12:32:16 2014 (r263237) @@ -97,7 +97,7 @@ sctp_handle_init(struct mbuf *m, int iph } /* validate length */ if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_chunk)) { - op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); + op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); @@ -109,7 +109,7 @@ sctp_handle_init(struct mbuf *m, int iph init = &cp->init; if (init->initiate_tag == 0) { /* protocol error... send abort */ - op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); + op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); @@ -119,7 +119,7 @@ sctp_handle_init(struct mbuf *m, int iph } if (ntohl(init->a_rwnd) < SCTP_MIN_RWND) { /* invalid parameter... send abort */ - op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); + op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); @@ -129,7 +129,7 @@ sctp_handle_init(struct mbuf *m, int iph } if (init->num_inbound_streams == 0) { /* protocol error... send abort */ - op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); + op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); @@ -139,7 +139,7 @@ sctp_handle_init(struct mbuf *m, int iph } if (init->num_outbound_streams == 0) { /* protocol error... send abort */ - op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); + op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); @@ -150,7 +150,9 @@ sctp_handle_init(struct mbuf *m, int iph if (sctp_validate_init_auth_params(m, offset + sizeof(*cp), offset + ntohs(cp->ch.chunk_length))) { /* auth parameter(s) error... send abort */ - sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, NULL, + op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), + "Problem with AUTH parameters"); + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -179,7 +181,9 @@ sctp_handle_init(struct mbuf *m, int iph * state :-) */ if (SCTP_BASE_SYSCTL(sctp_blackhole) == 0) { - sctp_send_abort(m, iphlen, src, dst, sh, 0, NULL, + op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), + "No listener"); + sctp_send_abort(m, iphlen, src, dst, sh, 0, op_err, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 12:33:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 474F62A6; Sun, 16 Mar 2014 12:33:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 34374213; Sun, 16 Mar 2014 12:33:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GCXfYQ056292; Sun, 16 Mar 2014 12:33:41 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GCXfZQ056291; Sun, 16 Mar 2014 12:33:41 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201403161233.s2GCXfZQ056291@svn.freebsd.org> From: Tycho Nightingale Date: Sun, 16 Mar 2014 12:33:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263238 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 12:33:41 -0000 Author: tychon Date: Sun Mar 16 12:33:40 2014 New Revision: 263238 URL: http://svnweb.freebsd.org/changeset/base/263238 Log: Though there currently isn't a way to insert new media into an ATAPI drive, at least pretend to support Asynchronous Notification (AN) to avoid a guest needlessly polling for it. Approved by: grehan (co-mentor) Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Sun Mar 16 12:32:16 2014 (r263237) +++ head/usr.sbin/bhyve/pci_ahci.c Sun Mar 16 12:33:40 2014 (r263238) @@ -95,6 +95,13 @@ enum sata_fis_type { #define MODEPAGE_CD_CAPABILITIES 0x2A /* + * ATA commands + */ +#define ATA_SF_ENAB_SATA_SF 0x10 +#define ATA_SATA_SF_AN 0x05 +#define ATA_SF_DIS_SATA_SF 0x90 + +/* * Debug printf */ #ifdef AHCI_DEBUG @@ -1169,6 +1176,17 @@ ahci_handle_cmd(struct ahci_port *p, int case ATA_SETFEATURES: { switch (cfis[3]) { + case ATA_SF_ENAB_SATA_SF: + switch (cfis[12]) { + case ATA_SATA_SF_AN: + p->tfd = ATA_S_DSC | ATA_S_READY; + break; + default: + p->tfd = ATA_S_ERROR | ATA_S_READY; + p->tfd |= (ATA_ERROR_ABORT << 8); + break; + } + break; case ATA_SF_ENAB_WCACHE: case ATA_SF_DIS_WCACHE: case ATA_SF_ENAB_RCACHE: From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 13:16:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 284AE95A; Sun, 16 Mar 2014 13:16:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 13B7E785; Sun, 16 Mar 2014 13:16:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GDGWgi072461; Sun, 16 Mar 2014 13:16:32 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GDGULB072451; Sun, 16 Mar 2014 13:16:30 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201403161316.s2GDGULB072451@svn.freebsd.org> From: Andrew Turner Date: Sun, 16 Mar 2014 13:16:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263239 - head/lib/libc/arm/aeabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 13:16:32 -0000 Author: andrew Date: Sun Mar 16 13:16:30 2014 New Revision: 263239 URL: http://svnweb.freebsd.org/changeset/base/263239 Log: Add an optimised version of the float and double helper functions. These are only used on armv6 when the vfp unit is detected. They will also be available for the upcoming armv6hf platform, however while not used by default there will need to be defined for any software that calls them directly. Added: head/lib/libc/arm/aeabi/aeabi_vfp.h (contents, props changed) head/lib/libc/arm/aeabi/aeabi_vfp_double.S (contents, props changed) head/lib/libc/arm/aeabi/aeabi_vfp_float.S (contents, props changed) Modified: head/lib/libc/arm/aeabi/Makefile.inc head/lib/libc/arm/aeabi/aeabi_double.c head/lib/libc/arm/aeabi/aeabi_float.c Modified: head/lib/libc/arm/aeabi/Makefile.inc ============================================================================== --- head/lib/libc/arm/aeabi/Makefile.inc Sun Mar 16 12:33:40 2014 (r263238) +++ head/lib/libc/arm/aeabi/Makefile.inc Sun Mar 16 13:16:30 2014 (r263239) @@ -6,6 +6,10 @@ SRCS+= aeabi_atexit.c \ aeabi_double.c \ aeabi_float.c \ aeabi_unwind_cpp.c +.if ${MACHINE_ARCH:Marmv6*} +SRCS+= aeabi_vfp_double.S \ + aeabi_vfp_float.S +.endif # Add the aeabi_mem* functions. While they live in compiler-rt they call into # libc. This causes issues when other parts of libc call these functions. Modified: head/lib/libc/arm/aeabi/aeabi_double.c ============================================================================== --- head/lib/libc/arm/aeabi/aeabi_double.c Sun Mar 16 12:33:40 2014 (r263238) +++ head/lib/libc/arm/aeabi/aeabi_double.c Sun Mar 16 13:16:30 2014 (r263239) @@ -32,70 +32,45 @@ __FBSDID("$FreeBSD$"); #include "milieu.h" #include "softfloat.h" +#include "aeabi_vfp.h" + +extern int _libc_arm_fpu_present; + flag __unorddf2(float64, float64); -int __aeabi_dcmpeq(float64 a, float64 b) -{ - return float64_eq(a, b); -} - -int __aeabi_dcmplt(float64 a, float64 b) -{ - return float64_lt(a, b); -} - -int __aeabi_dcmple(float64 a, float64 b) -{ - return float64_le(a, b); -} - -int __aeabi_dcmpge(float64 a, float64 b) -{ - return float64_le(b, a); -} - -int __aeabi_dcmpgt(float64 a, float64 b) -{ - return float64_lt(b, a); -} - -int __aeabi_dcmpun(float64 a, float64 b) -{ - return __unorddf2(a, b); -} - -int __aeabi_d2iz(float64 a) -{ - return float64_to_int32_round_to_zero(a); -} - -float32 __aeabi_d2f(float64 a) -{ - return float64_to_float32(a); -} - -float64 __aeabi_i2d(int a) -{ - return int32_to_float64(a); -} - -float64 __aeabi_dadd(float64 a, float64 b) -{ - return float64_add(a, b); -} - -float64 __aeabi_ddiv(float64 a, float64 b) -{ - return float64_div(a, b); -} - -float64 __aeabi_dmul(float64 a, float64 b) -{ - return float64_mul(a, b); -} - -float64 __aeabi_dsub(float64 a, float64 b) -{ - return float64_sub(a, b); -} +/* These are written in asm and are only called from this file */ +int __aeabi_dcmpeq_vfp(float64, float64); +int __aeabi_dcmplt_vfp(float64, float64); +int __aeabi_dcmple_vfp(float64, float64); +int __aeabi_dcmpgt_vfp(float64, float64); +int __aeabi_dcmpge_vfp(float64, float64); +int __aeabi_dcmpun_vfp(float64, float64); +int __aeabi_d2iz_vfp(float64); +float32 __aeabi_d2f_vfp(float64); +float64 __aeabi_i2d_vfp(int); +float64 __aeabi_dadd_vfp(float64, float64); +float64 __aeabi_ddiv_vfp(float64, float64); +float64 __aeabi_dmul_vfp(float64, float64); +float64 __aeabi_dsub_vfp(float64, float64); + +/* + * Depending on the target these will: + * On armv6 with a vfp call the above function, or + * Call the softfloat cunstion in the 3rd argument. + */ +int AEABI_FUNC2(dcmpeq, float64, float64_eq) +int AEABI_FUNC2(dcmplt, float64, float64_lt) +int AEABI_FUNC2(dcmple, float64, float64_le) +int AEABI_FUNC2_REV(dcmpge, float64, float64_le) +int AEABI_FUNC2_REV(dcmpgt, float64, float64_lt) +int AEABI_FUNC2(dcmpun, float64, __unorddf2) + +int AEABI_FUNC(d2iz, float64, float64_to_int32_round_to_zero) +float32 AEABI_FUNC(d2f, float64, float64_to_float32) +float64 AEABI_FUNC(i2d, int, int32_to_float64) + +float64 AEABI_FUNC2(dadd, float64, float64_add) +float64 AEABI_FUNC2(ddiv, float64, float64_div) +float64 AEABI_FUNC2(dmul, float64, float64_mul) +float64 AEABI_FUNC2(dsub, float64, float64_sub) Modified: head/lib/libc/arm/aeabi/aeabi_float.c ============================================================================== --- head/lib/libc/arm/aeabi/aeabi_float.c Sun Mar 16 12:33:40 2014 (r263238) +++ head/lib/libc/arm/aeabi/aeabi_float.c Sun Mar 16 13:16:30 2014 (r263239) @@ -32,70 +32,45 @@ __FBSDID("$FreeBSD$"); #include "milieu.h" #include "softfloat.h" +#include "aeabi_vfp.h" + +extern int _libc_arm_fpu_present; + flag __unordsf2(float32, float32); -int __aeabi_fcmpeq(float32 a, float32 b) -{ - return float32_eq(a, b); -} - -int __aeabi_fcmplt(float32 a, float32 b) -{ - return float32_lt(a, b); -} - -int __aeabi_fcmple(float32 a, float32 b) -{ - return float32_le(a, b); -} - -int __aeabi_fcmpge(float32 a, float32 b) -{ - return float32_le(b, a); -} - -int __aeabi_fcmpgt(float32 a, float32 b) -{ - return float32_lt(b, a); -} - -int __aeabi_fcmpun(float32 a, float32 b) -{ - return __unordsf2(a, b); -} - -int __aeabi_f2iz(float32 a) -{ - return float32_to_int32_round_to_zero(a); -} - -float32 __aeabi_f2d(float32 a) -{ - return float32_to_float64(a); -} - -float32 __aeabi_i2f(int a) -{ - return int32_to_float32(a); -} - -float32 __aeabi_fadd(float32 a, float32 b) -{ - return float32_add(a, b); -} - -float32 __aeabi_fdiv(float32 a, float32 b) -{ - return float32_div(a, b); -} - -float32 __aeabi_fmul(float32 a, float32 b) -{ - return float32_mul(a, b); -} - -float32 __aeabi_fsub(float32 a, float32 b) -{ - return float32_sub(a, b); -} +/* These are written in asm and are only called from this file */ +int __aeabi_fcmpeq_vfp(float32, float32); +int __aeabi_fcmplt_vfp(float32, float32); +int __aeabi_fcmple_vfp(float32, float32); +int __aeabi_fcmpgt_vfp(float32, float32); +int __aeabi_fcmpge_vfp(float32, float32); +int __aeabi_fcmpun_vfp(float32, float32); +int __aeabi_f2iz_vfp(float32); +float64 __aeabi_f2d_vfp(float32); +float32 __aeabi_i2f_vfp(int); +float32 __aeabi_fadd_vfp(float32, float32); +float32 __aeabi_fdiv_vfp(float32, float32); +float32 __aeabi_fmul_vfp(float32, float32); +float32 __aeabi_fsub_vfp(float32, float32); + +/* + * Depending on the target these will: + * On armv6 with a vfp call the above function, or + * Call the softfloat cunstion in the 3rd argument. + */ +int AEABI_FUNC2(fcmpeq, float32, float32_eq) +int AEABI_FUNC2(fcmplt, float32, float32_lt) +int AEABI_FUNC2(fcmple, float32, float32_le) +int AEABI_FUNC2_REV(fcmpge, float32, float32_le) +int AEABI_FUNC2_REV(fcmpgt, float32, float32_lt) +int AEABI_FUNC2(fcmpun, float32, __unordsf2) + +int AEABI_FUNC(f2iz, float32, float32_to_int32_round_to_zero) +float64 AEABI_FUNC(f2d, float32, float32_to_float64) +float32 AEABI_FUNC(i2f, int, int32_to_float32) + +float32 AEABI_FUNC2(fadd, float32, float32_add) +float32 AEABI_FUNC2(fdiv, float32, float32_div) +float32 AEABI_FUNC2(fmul, float32, float32_mul) +float32 AEABI_FUNC2(fsub, float32, float32_sub) Added: head/lib/libc/arm/aeabi/aeabi_vfp.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/aeabi/aeabi_vfp.h Sun Mar 16 13:16:30 2014 (r263239) @@ -0,0 +1,129 @@ +/* + * Copyright (C) 2013 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef AEABI_VFP_H +#define AEABI_VFP_H + +/* + * ASM helper macros. These allow the functions to be changed depending on + * the endian-ness we are building for. + */ + +/* Allow the name of the function to be changed depending on the ABI */ +#ifndef __ARM_PCS_VFP +#define AEABI_ENTRY(x) ENTRY(__aeabi_ ## x ## _vfp) +#define AEABI_END(x) END(__aeabi_ ## x ## _vfp) +#else +#define AEABI_ENTRY(x) ENTRY(__aeabi_ ## x) +#define AEABI_END(x) END(__aeabi_ ## x) +#endif + +/* + * These should be used when a function either takes, or returns a floating + * point falue. They will load the data from an ARM to a VFP register(s), + * or from a VFP to an ARM register + */ +#ifdef __ARMEB__ +#define LOAD_DREG(vreg, reg0, reg1) vmov vreg, reg1, reg0 +#define UNLOAD_DREG(reg0, reg1, vreg) vmov reg1, reg0, vreg +#else +#define LOAD_DREG(vreg, reg0, reg1) vmov vreg, reg0, reg1 +#define UNLOAD_DREG(reg0, reg1, vreg) vmov reg0, reg1, vreg +#endif + +#define LOAD_SREGS(vreg0, vreg1, reg0, reg1) vmov vreg0, vreg1, reg0, reg1 +#define LOAD_SREG(vreg, reg) vmov vreg, reg +#define UNLOAD_SREG(reg, vreg) vmov reg, vreg + +/* + * C Helper macros + */ + +#if 1 && defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6) +/* + * Generate a function that will either call into the VFP implementation, + * or the soft float version for a given __aeabi_* helper. The function + * will take a single argument of the type given by in_type. + */ +#define AEABI_FUNC(name, in_type, soft_func) \ +__aeabi_ ## name(in_type a) \ +{ \ + if (_libc_arm_fpu_present) \ + return __aeabi_ ## name ## _vfp(a); \ + else \ + return soft_func (a); \ +} + +/* As above, but takes two arguments of the same type */ +#define AEABI_FUNC2(name, in_type, soft_func) \ +__aeabi_ ## name(in_type a, in_type b) \ +{ \ + if (_libc_arm_fpu_present) \ + return __aeabi_ ## name ## _vfp(a, b); \ + else \ + return soft_func (a, b); \ +} + +/* As above, but with the soft float arguments reversed */ +#define AEABI_FUNC2_REV(name, in_type, soft_func) \ +__aeabi_ ## name(in_type a, in_type b) \ +{ \ + if (_libc_arm_fpu_present) \ + return __aeabi_ ## name ## _vfp(a, b); \ + else \ + return soft_func (b, a); \ +} +#else +/* + * Helper macros for when we are only able to use the softfloat + * version of these functions, i.e. on arm before armv6. + */ +#define AEABI_FUNC(name, in_type, soft_func) \ +__aeabi_ ## name(in_type a) \ +{ \ + return soft_func (a); \ +} + +/* As above, but takes two arguments of the same type */ +#define AEABI_FUNC2(name, in_type, soft_func) \ +__aeabi_ ## name(in_type a, in_type b) \ +{ \ + return soft_func (a, b); \ +} + +/* As above, but with the soft float arguments reversed */ +#define AEABI_FUNC2_REV(name, in_type, soft_func) \ +__aeabi_ ## name(in_type a, in_type b) \ +{ \ + return soft_func (b, a); \ +} +#endif + +#endif + Added: head/lib/libc/arm/aeabi/aeabi_vfp_double.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/aeabi/aeabi_vfp_double.S Sun Mar 16 13:16:30 2014 (r263239) @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2013 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "aeabi_vfp.h" + +.fpu vfp +.syntax unified + +/* int __aeabi_dcmpeq(double, double) */ +AEABI_ENTRY(dcmpeq) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vcmp.f64 d0, d1 + vmrs APSR_nzcv, fpscr + movne r0, #0 + moveq r0, #1 + RET +AEABI_END(dcmpeq) + +/* int __aeabi_dcmplt(double, double) */ +AEABI_ENTRY(dcmplt) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vcmp.f64 d0, d1 + vmrs APSR_nzcv, fpscr + movcs r0, #0 + movlt r0, #1 + RET +AEABI_END(dcmplt) + +/* int __aeabi_dcmple(double, double) */ +AEABI_ENTRY(dcmple) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vcmp.f64 d0, d1 + vmrs APSR_nzcv, fpscr + movhi r0, #0 + movls r0, #1 + RET +AEABI_END(dcmple) + +/* int __aeabi_dcmpge(double, double) */ +AEABI_ENTRY(dcmpge) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vcmp.f64 d0, d1 + vmrs APSR_nzcv, fpscr + movlt r0, #0 + movge r0, #1 + RET +AEABI_END(dcmpge) + +/* int __aeabi_dcmpgt(double, double) */ +AEABI_ENTRY(dcmpgt) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vcmp.f64 d0, d1 + vmrs APSR_nzcv, fpscr + movle r0, #0 + movgt r0, #1 + RET +AEABI_END(dcmpgt) + +/* int __aeabi_dcmpun(double, double) */ +AEABI_ENTRY(dcmpun) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vcmp.f64 d0, d1 + vmrs APSR_nzcv, fpscr + movvc r0, #0 + movvs r0, #1 + RET +AEABI_END(dcmpun) + +/* int __aeabi_d2iz(double) */ +AEABI_ENTRY(d2iz) + LOAD_DREG(d0, r0, r1) +#if 0 + /* + * This should be the correct instruction, but binutils incorrectly + * encodes it as the version that used FPSCR to determine the rounding. + * When binutils is fixed we can use this again. + */ + vcvt.s32.f64 s0, d0 +#else + ftosizd s0, d0 +#endif + vmov r0, s0 + RET +AEABI_END(d2iz) + +/* float __aeabi_d2f(double) */ +AEABI_ENTRY(d2f) + LOAD_DREG(d0, r0, r1) + vcvt.f32.f64 s0, d0 + UNLOAD_SREG(r0, s0) + RET +AEABI_END(d2f) + +/* double __aeabi_i2d(int) */ +AEABI_ENTRY(i2d) + vmov s0, r0 + vcvt.f64.s32 d0, s0 + UNLOAD_DREG(r0, r1, d0) + RET +AEABI_END(i2d) + +/* double __aeabi_dadd(double, double) */ +AEABI_ENTRY(dadd) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vadd.f64 d0, d0, d1 + UNLOAD_DREG(r0, r1, d0) + RET +AEABI_END(dadd) + +/* double __aeabi_ddiv(double, double) */ +AEABI_ENTRY(ddiv) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vdiv.f64 d0, d0, d1 + UNLOAD_DREG(r0, r1, d0) + RET +AEABI_END(ddiv) + +/* double __aeabi_dmul(double, double) */ +AEABI_ENTRY(dmul) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vmul.f64 d0, d0, d1 + UNLOAD_DREG(r0, r1, d0) + RET +AEABI_END(dmul) + +/* double __aeabi_dsub(double, double) */ +AEABI_ENTRY(dsub) + LOAD_DREG(d0, r0, r1) + LOAD_DREG(d1, r2, r3) + vsub.f64 d0, d0, d1 + UNLOAD_DREG(r0, r1, d0) + RET +AEABI_END(dsub) + Added: head/lib/libc/arm/aeabi/aeabi_vfp_float.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/aeabi/aeabi_vfp_float.S Sun Mar 16 13:16:30 2014 (r263239) @@ -0,0 +1,160 @@ +/* + * Copyright (C) 2013 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "aeabi_vfp.h" + +.fpu vfp +.syntax unified + +/* int __aeabi_fcmpeq(float, float) */ +AEABI_ENTRY(fcmpeq) + LOAD_SREGS(s0, s1, r0, r1) + vcmp.f32 s0, s1 + vmrs APSR_nzcv, fpscr + movne r0, #0 + moveq r0, #1 + RET +AEABI_END(fcmpeq) + +/* int __aeabi_fcmplt(float, float) */ +AEABI_ENTRY(fcmplt) + LOAD_SREGS(s0, s1, r0, r1) + vcmp.f32 s0, s1 + vmrs APSR_nzcv, fpscr + movcs r0, #0 + movlt r0, #1 + RET +AEABI_END(fcmplt) + +/* int __aeabi_fcmple(float, float) */ +AEABI_ENTRY(fcmple) + LOAD_SREGS(s0, s1, r0, r1) + vcmp.f32 s0, s1 + vmrs APSR_nzcv, fpscr + movhi r0, #0 + movls r0, #1 + RET +AEABI_END(fcmple) + +/* int __aeabi_fcmpge(float, float) */ +AEABI_ENTRY(fcmpge) + LOAD_SREGS(s0, s1, r0, r1) + vcmp.f32 s0, s1 + vmrs APSR_nzcv, fpscr + movlt r0, #0 + movge r0, #1 + RET +AEABI_END(fcmpge) + +/* int __aeabi_fcmpgt(float, float) */ +AEABI_ENTRY(fcmpgt) + LOAD_SREGS(s0, s1, r0, r1) + vcmp.f32 s0, s1 + vmrs APSR_nzcv, fpscr + movle r0, #0 + movgt r0, #1 + RET +AEABI_END(fcmpgt) + +/* int __aeabi_fcmpun(float, float) */ +AEABI_ENTRY(fcmpun) + LOAD_SREGS(s0, s1, r0, r1) + vcmp.f32 s0, s1 + vmrs APSR_nzcv, fpscr + movvc r0, #0 + movvs r0, #1 + RET +AEABI_END(fcmpun) + +/* int __aeabi_f2iz(float) */ +AEABI_ENTRY(f2iz) + LOAD_SREG(s0, r0) +#if 0 + /* + * This should be the correct instruction, but binutils incorrectly + * encodes it as the version that used FPSCR to determine the rounding. + * When binutils is fixed we can use this again. + */ + vcvt.s32.f32 s0, s0 +#else + ftosizs s0, s0 +#endif + vmov r0, s0 + RET +AEABI_END(f2iz) + +/* double __aeabi_f2d(float) */ +AEABI_ENTRY(f2d) + LOAD_SREG(s0, r0) + vcvt.f64.f32 d0, s0 + UNLOAD_DREG(r0, r1, d0) + RET +AEABI_END(f2d) + +/* float __aeabi_i2f(int) */ +AEABI_ENTRY(i2f) + vmov s0, r0 + vcvt.f32.s32 s0, s0 + UNLOAD_SREG(r0, s0) + RET +AEABI_END(i2f) + +/* float __aeabi_fadd(float, float) */ +AEABI_ENTRY(fadd) + LOAD_SREGS(s0, s1, r0, r1) + vadd.f32 s0, s0, s1 + UNLOAD_SREG(r0, s0) + RET +AEABI_END(fadd) + +/* float __aeabi_fmul(float, float) */ +AEABI_ENTRY(fdiv) + LOAD_SREGS(s0, s1, r0, r1) + vdiv.f32 s0, s0, s1 + UNLOAD_SREG(r0, s0) + RET +AEABI_END(fdiv) + +/* float __aeabi_fmul(float, float) */ +AEABI_ENTRY(fmul) + LOAD_SREGS(s0, s1, r0, r1) + vmul.f32 s0, s0, s1 + UNLOAD_SREG(r0, s0) + RET +AEABI_END(fmul) + +/* float __aeabi_fsub(float, float) */ +AEABI_ENTRY(fsub) + LOAD_SREGS(s0, s1, r0, r1) + vsub.f32 s0, s0, s1 + UNLOAD_SREG(r0, s0) + RET +AEABI_END(fsub) + From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 13:43:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93FA724E; Sun, 16 Mar 2014 13:43:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 80A2D9FC; Sun, 16 Mar 2014 13:43:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GDh7x3084170; Sun, 16 Mar 2014 13:43:07 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GDh7U4084168; Sun, 16 Mar 2014 13:43:07 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201403161343.s2GDh7U4084168@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 16 Mar 2014 13:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263240 - in head/sbin: casperd ping X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 13:43:07 -0000 Author: jilles Date: Sun Mar 16 13:43:06 2014 New Revision: 263240 URL: http://svnweb.freebsd.org/changeset/base/263240 Log: Fix statically-linked build (WITHOUT_DYNAMICROOT). Modified: head/sbin/casperd/Makefile head/sbin/ping/Makefile Modified: head/sbin/casperd/Makefile ============================================================================== --- head/sbin/casperd/Makefile Sun Mar 16 13:16:30 2014 (r263239) +++ head/sbin/casperd/Makefile Sun Mar 16 13:43:06 2014 (r263240) @@ -4,8 +4,8 @@ PROG= casperd SRCS= casperd.c zygote.c -DPADD= ${LIBCAPSICUM} ${LIBCASPER} ${LIBNV} ${LIBPJDLOG} ${LIBUTIL} -LDADD= -lcapsicum -lcasper -lnv -lpjdlog -lutil +DPADD= ${LIBCASPER} ${LIBCAPSICUM} ${LIBNV} ${LIBPJDLOG} ${LIBUTIL} +LDADD= -lcasper -lcapsicum -lnv -lpjdlog -lutil MAN= casperd.8 Modified: head/sbin/ping/Makefile ============================================================================== --- head/sbin/ping/Makefile Sun Mar 16 13:16:30 2014 (r263239) +++ head/sbin/ping/Makefile Sun Mar 16 13:43:06 2014 (r263240) @@ -12,8 +12,8 @@ DPADD= ${LIBM} LDADD= -lm .if ${MK_CASPER} != "no" && !defined(RESCUE) -DPADD+= ${LIBCAPSICUM} -LDADD+= -lcapsicum +DPADD+= ${LIBCAPSICUM} ${LIBNV} +LDADD+= -lcapsicum -lnv CFLAGS+=-DHAVE_LIBCAPSICUM .endif From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 14:19:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46C8BDBB; Sun, 16 Mar 2014 14:19:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 33ECCCD6; Sun, 16 Mar 2014 14:19:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GEJlMb097033; Sun, 16 Mar 2014 14:19:47 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GEJkwb097031; Sun, 16 Mar 2014 14:19:46 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201403161419.s2GEJkwb097031@svn.freebsd.org> From: Andrew Turner Date: Sun, 16 Mar 2014 14:19:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263242 - head/lib/libc/arm/aeabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 14:19:47 -0000 Author: andrew Date: Sun Mar 16 14:19:46 2014 New Revision: 263242 URL: http://svnweb.freebsd.org/changeset/base/263242 Log: Fix the spelling of function. Reported by: ian@ Modified: head/lib/libc/arm/aeabi/aeabi_double.c head/lib/libc/arm/aeabi/aeabi_float.c Modified: head/lib/libc/arm/aeabi/aeabi_double.c ============================================================================== --- head/lib/libc/arm/aeabi/aeabi_double.c Sun Mar 16 14:06:10 2014 (r263241) +++ head/lib/libc/arm/aeabi/aeabi_double.c Sun Mar 16 14:19:46 2014 (r263242) @@ -56,7 +56,7 @@ float64 __aeabi_dsub_vfp(float64, float6 /* * Depending on the target these will: * On armv6 with a vfp call the above function, or - * Call the softfloat cunstion in the 3rd argument. + * Call the softfloat function in the 3rd argument. */ int AEABI_FUNC2(dcmpeq, float64, float64_eq) int AEABI_FUNC2(dcmplt, float64, float64_lt) Modified: head/lib/libc/arm/aeabi/aeabi_float.c ============================================================================== --- head/lib/libc/arm/aeabi/aeabi_float.c Sun Mar 16 14:06:10 2014 (r263241) +++ head/lib/libc/arm/aeabi/aeabi_float.c Sun Mar 16 14:19:46 2014 (r263242) @@ -56,7 +56,7 @@ float32 __aeabi_fsub_vfp(float32, float3 /* * Depending on the target these will: * On armv6 with a vfp call the above function, or - * Call the softfloat cunstion in the 3rd argument. + * Call the softfloat function in the 3rd argument. */ int AEABI_FUNC2(fcmpeq, float32, float32_eq) int AEABI_FUNC2(fcmplt, float32, float32_lt) From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 14:21:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B22EF12; Sun, 16 Mar 2014 14:21:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 27F75D5B; Sun, 16 Mar 2014 14:21:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GELAj5098104; Sun, 16 Mar 2014 14:21:10 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GELAJ4098103; Sun, 16 Mar 2014 14:21:10 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201403161421.s2GELAJ4098103@svn.freebsd.org> From: Andrew Turner Date: Sun, 16 Mar 2014 14:21:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263243 - head/lib/libc/arm/aeabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 14:21:10 -0000 Author: andrew Date: Sun Mar 16 14:21:09 2014 New Revision: 263243 URL: http://svnweb.freebsd.org/changeset/base/263243 Log: Remove an extra 1 in an #if line Reported by: ian@ Modified: head/lib/libc/arm/aeabi/aeabi_vfp.h Modified: head/lib/libc/arm/aeabi/aeabi_vfp.h ============================================================================== --- head/lib/libc/arm/aeabi/aeabi_vfp.h Sun Mar 16 14:19:46 2014 (r263242) +++ head/lib/libc/arm/aeabi/aeabi_vfp.h Sun Mar 16 14:21:09 2014 (r263243) @@ -65,7 +65,7 @@ * C Helper macros */ -#if 1 && defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6) +#if defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6) /* * Generate a function that will either call into the VFP implementation, * or the soft float version for a given __aeabi_* helper. The function From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 14:42:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DCE20B2E; Sun, 16 Mar 2014 14:42:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C9463F5C; Sun, 16 Mar 2014 14:42:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GEgwcw008962; Sun, 16 Mar 2014 14:42:58 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GEgwUT008961; Sun, 16 Mar 2014 14:42:58 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201403161442.s2GEgwUT008961@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 16 Mar 2014 14:42:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263244 - head/usr.bin/find X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 14:42:58 -0000 Author: jilles Date: Sun Mar 16 14:42:58 2014 New Revision: 263244 URL: http://svnweb.freebsd.org/changeset/base/263244 Log: find: When performing -quit, finish pending -exec ... + command lines. This avoids unexpected partial processing when a find command uses both -quit and -exec ... +. GNU find does the same. MFC after: 1 week Modified: head/usr.bin/find/function.c Modified: head/usr.bin/find/function.c ============================================================================== --- head/usr.bin/find/function.c Sun Mar 16 14:21:09 2014 (r263243) +++ head/usr.bin/find/function.c Sun Mar 16 14:42:58 2014 (r263244) @@ -1774,6 +1774,7 @@ f_false(PLAN *plan __unused, FTSENT *ent int f_quit(PLAN *plan __unused, FTSENT *entry __unused) { + finish_execplus(); exit(0); } From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 15:22:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48A346AB; Sun, 16 Mar 2014 15:22:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 337C2334; Sun, 16 Mar 2014 15:22:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GFMmEZ025373; Sun, 16 Mar 2014 15:22:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GFMkvF025359; Sun, 16 Mar 2014 15:22:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403161522.s2GFMkvF025359@svn.freebsd.org> From: Warner Losh Date: Sun, 16 Mar 2014 15:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263245 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 15:22:48 -0000 Author: imp Date: Sun Mar 16 15:22:46 2014 New Revision: 263245 URL: http://svnweb.freebsd.org/changeset/base/263245 Log: Make all the comments '# ' and align to same column. This fixes the rampently incosnsitent usage which made cut and paste from one file to another look ugly. Modified: head/sys/arm/conf/AC100 head/sys/arm/conf/ARMADAXP head/sys/arm/conf/ARNDALE head/sys/arm/conf/ATMEL head/sys/arm/conf/AVILA head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/BWCT head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/CRB head/sys/arm/conf/CUBIEBOARD head/sys/arm/conf/CUBIEBOARD2 head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DIGI-CCWMX53 head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/DREAMPLUG-1001 head/sys/arm/conf/EA3250 head/sys/arm/conf/EB9200 head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/EP80219 head/sys/arm/conf/ETHERNUT5 head/sys/arm/conf/GUMSTIX head/sys/arm/conf/HL200 head/sys/arm/conf/HL201 head/sys/arm/conf/IMX53-QSB head/sys/arm/conf/IMX6 head/sys/arm/conf/IQ31244 head/sys/arm/conf/KB920X head/sys/arm/conf/LN2410SBC head/sys/arm/conf/NSLU head/sys/arm/conf/PANDABOARD head/sys/arm/conf/QILA9G20 head/sys/arm/conf/RADXA head/sys/arm/conf/RPI-B head/sys/arm/conf/SAM9260EK head/sys/arm/conf/SAM9G20EK head/sys/arm/conf/SAM9X25EK head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/SN9G45 head/sys/arm/conf/TS7800 head/sys/arm/conf/VERSATILEPB head/sys/arm/conf/VYBRID.common head/sys/arm/conf/WANDBOARD.common head/sys/arm/conf/ZEDBOARD Modified: head/sys/arm/conf/AC100 ============================================================================== --- head/sys/arm/conf/AC100 Sun Mar 16 14:42:58 2014 (r263244) +++ head/sys/arm/conf/AC100 Sun Mar 16 15:22:46 2014 (r263245) @@ -9,32 +9,32 @@ include "../tegra/std.tegra2" makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" -#options SCHED_ULE #ULE scheduler -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -#options INET6 #IPv6 communications protocols -options FFS #Berkeley Fast Filesystem -#options NFSCL #Network Filesystem Client -#options NFSLOCKD #Network Lock Manager -#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +#options SCHED_ULE # ULE scheduler +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +#options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +#options NFSCL # Network Filesystem Client +#options NFSLOCKD # Network Lock Manager +#options NFS_ROOT # NFS usable as /, requires NFSCLIENT #options BOOTP #options BOOTP_NFSROOT #options BOOTP_NFSV3 #options BOOTP_WIRED_TO=mge0 -options TMPFS #Efficient memory filesystem -options GEOM_PART_BSD #BSD partition scheme -options GEOM_PART_MBR #MBR partition scheme +options TMPFS # Efficient memory filesystem +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme options GEOM_PART_GPT options ROOTDEVNAME=\"ufs:/dev/da0p1\" -options SYSVSHM #SYSV-style shared memory -options SYSVMSG #SYSV-style message queues -options SYSVSEM #SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions options MUTEX_NOINLINE options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT @@ -48,8 +48,8 @@ options VERBOSE_SYSINIT options DDB options GDB options DIAGNOSTIC -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options KDB options KDB_TRACE #options KTR @@ -57,8 +57,8 @@ options KDB_TRACE #options KTR_ENTRIES=16384 #options KTR_MASK=(KTR_SPARE2) #options KTR_COMPILE=KTR_ALL -options WITNESS #Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options WITNESS_KDB options MUTEX_DEBUG Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Sun Mar 16 14:42:58 2014 (r263244) +++ head/sys/arm/conf/ARMADAXP Sun Mar 16 15:22:46 2014 (r263245) @@ -10,32 +10,32 @@ include "../mv/armadaxp/std.mv78x60" options SOC_MV_ARMADAXP makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" -#options SCHED_ULE #ULE scheduler -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -options INET6 #IPv6 communications protocols -options FFS #Berkeley Fast Filesystem -options NFSCL #Network Filesystem Client -options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +#options SCHED_ULE # ULE scheduler +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +options NFSCL # Network Filesystem Client +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCLIENT options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 options BOOTP_WIRED_TO=mge0 -options TMPFS #Efficient memory filesystem -options GEOM_PART_BSD #BSD partition scheme -options GEOM_PART_MBR #MBR partition scheme +options TMPFS # Efficient memory filesystem +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme options GEOM_PART_GPT options ROOTDEVNAME=\"ufs:/dev/da0p1\" -options SYSVSHM #SYSV-style shared memory -options SYSVMSG #SYSV-style message queues -options SYSVSEM #SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions options MUTEX_NOINLINE options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT @@ -50,8 +50,8 @@ options ALT_BREAK_TO_DEBUGGER options DDB options GDB #options DIAGNOSTIC -#options INVARIANTS #Enable calls of extra sanity checking -#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options KDB options KDB_TRACE #options KTR @@ -59,8 +59,8 @@ options KDB_TRACE #options KTR_ENTRIES=16384 #options KTR_MASK=(KTR_SPARE2) #options KTR_COMPILE=KTR_ALL -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options WITNESS_KDB # Pseudo devices Modified: head/sys/arm/conf/ARNDALE ============================================================================== --- head/sys/arm/conf/ARNDALE Sun Mar 16 14:42:58 2014 (r263244) +++ head/sys/arm/conf/ARNDALE Sun Mar 16 15:22:46 2014 (r263245) @@ -24,55 +24,55 @@ include "../samsung/exynos/std.exynos5" makeoptions MODULES_OVERRIDE="" makeoptions WITHOUT_MODULES="ahc" -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" -options HZ=100 ## -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -options INET6 #IPv6 communications protocols -options GEOM_PART_BSD #BSD partition scheme -options GEOM_PART_MBR #MBR partition scheme -options TMPFS #Efficient memory filesystem -options FFS #Berkeley Fast Filesystem +options HZ=100 +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options TMPFS # Efficient memory filesystem +options FFS # Berkeley Fast Filesystem options SOFTUPDATES -options UFS_ACL #Support for access control lists -options UFS_DIRHASH #Improve performance on big directories -options MSDOSFS #MSDOS Filesystem -options CD9660 #ISO 9660 Filesystem -options PROCFS #Process filesystem (requires PSEUDOFS) -options PSEUDOFS #Pseudo-filesystem framework -options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE -options SYSVSHM #SYSV-style shared memory -options SYSVMSG #SYSV-style message queues -options SYSVSEM #SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions options KBD_INSTALL_CDEV options PREEMPTION options FREEBSD_BOOT_LOADER -options VFP # vfp/neon +options VFP # vfp/neon # Debugging -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT #Enable verbose sysinit messages +#options VERBOSE_SYSINIT # Enable verbose sysinit messages options KDB -options DDB #Enable the kernel debugger -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options DDB # Enable the kernel debugger +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options DIAGNOSTIC # NFS support -options NFSCL #Network Filesystem Client -options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFSCL # Network Filesystem Client +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCLIENT # Uncomment this for NFS root -#options NFS_ROOT #NFS usable as /, requires NFSCL +#options NFS_ROOT # NFS usable as /, requires NFSCL #options BOOTP_NFSROOT #options BOOTP_COMPAT #options BOOTP Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Sun Mar 16 14:42:58 2014 (r263244) +++ head/sys/arm/conf/ATMEL Sun Mar 16 15:22:46 2014 (r263245) @@ -48,13 +48,13 @@ options NFSCL # New Network Filesyste options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS #Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework -options GEOM_PART_BSD #BSD partition scheme -options GEOM_PART_MBR #MBR partition scheme +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization options COMPAT_FREEBSD5 # Compatible with FreeBSD5 @@ -109,73 +109,73 @@ options GDB # Support remote GDB. # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. -device bpf # Berkeley packet filter +device bpf # Berkeley packet filter # Ethernet -device mii # Minimal MII support -device ate # Atmel AT91 Ethernet friver +device mii # Minimal MII support +device ate # Atmel AT91 Ethernet friver # I2C -device at91_twi # Atmel AT91 Two-wire Interface -device iic # I2C generic I/O device driver -device iicbus # I2C bus system -device pcf8563 # NXP PCF8563 clock/calendar +device at91_twi # Atmel AT91 Two-wire Interface +device iic # I2C generic I/O device driver +device iicbus # I2C bus system +device pcf8563 # NXP PCF8563 clock/calendar # MMC/SD -device at91_mci # Atmel AT91 Multimedia Card Interface +device at91_mci # Atmel AT91 Multimedia Card Interface options AT91_MCI_HAS_4WIRE -device mmc # MMC/SD bus -device mmcsd # MMC/SD memory card +device mmc # MMC/SD bus +device mmcsd # MMC/SD memory card # DataFlash -device at91_spi # Atmel AT91 Serial Peripheral Interface -device spibus # SPI bus -device at45d # Atmel AT45D -device geom_map # GEOM partition mapping +device at91_spi # Atmel AT91 Serial Peripheral Interface +device spibus # SPI bus +device at45d # Atmel AT45D +device geom_map # GEOM partition mapping # Pseudo devices. -device loop # Network loopback -device random # Entropy device -device ether # Ethernet support -device vlan # 802.1Q VLAN support -device tun # Packet tunnel. -device md # Memory "disks" -device gif # IPv6 and IPv4 tunneling -device faith # IPv6-to-IPv4 relaying (translation) -#device firmware # firmware assist module +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device vlan # 802.1Q VLAN support +device tun # Packet tunnel. +device md # Memory "disks" +device gif # IPv6 and IPv4 tunneling +device faith # IPv6-to-IPv4 relaying (translation) +#device firmware # firmware assist module # SCSI peripherals -device scbus # SCSI bus (required for ATA/SCSI) -device ch # SCSI media changers -device da # Direct Access (disks) -device sa # Sequential Access (tape etc) -device cd # CD -device pass # Passthrough device (direct ATA/SCSI access) -device ses # Enclosure Services (SES and SAF-TE) -#device ctl # CAM Target Layer +device scbus # SCSI bus (required for ATA/SCSI) +device ch # SCSI media changers +device da # Direct Access (disks) +device sa # Sequential Access (tape etc) +device cd # CD +device pass # Passthrough device (direct ATA/SCSI access) +device ses # Enclosure Services (SES and SAF-TE) +#device ctl # CAM Target Layer # Serial (COM) ports -device uart # Multi-uart driver +device uart # Multi-uart driver options ALT_BREAK_TO_DEBUGGER # USB support -options USB_DEBUG # enable debug msgs -device ohci # OHCI USB interface -device usb # USB Bus (required) -device umass # Disks/Mass storage - Requires scbus and da +options USB_DEBUG # enable debug msgs +device ohci # OHCI USB interface +device usb # USB Bus (required) +device umass # Disks/Mass storage - Requires scbus and da # USB device (gadget) support -device at91_dci # Atmel's usb device -device usfs # emulate a flash -device cdce # emulate an ethernet -device usb_template # Control of the gadget +device at91_dci # Atmel's usb device +device usfs # emulate a flash +device cdce # emulate an ethernet +device usb_template # Control of the gadget # watchdog -device at91_wdt # Atmel AT91 Watchdog Timer +device at91_wdt # Atmel AT91 Watchdog Timer device at91_rtc device at91_ssc -#device at91_tc # missing? +#device at91_tc # missing? # NAND Flash - Reference design has Samsung 256MB but others possible device nand # NAND interface on CS3 Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Sun Mar 16 14:42:58 2014 (r263244) +++ head/sys/arm/conf/AVILA Sun Mar 16 15:22:46 2014 (r263245) @@ -25,10 +25,10 @@ include "../xscale/ixp425/std.ixp425" include "../xscale/ixp425/std.avila" options XSCALE_CACHE_READ_WRITE_ALLOCATE #To statically compile in device wiring instead of /boot/device.hints -hints "AVILA.hints" #Default places to look for devices. +hints "AVILA.hints" # Default places to look for devices. makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=xscale #options HZ=1000 options HZ=100 @@ -37,23 +37,23 @@ options DEVICE_POLLING # Debugging for use in -current options KDB #options GDB -options DDB #Enable the kernel debugger -#options DEADLKRES #Enable the deadlock resolver -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options DDB # Enable the kernel debugger +#options DEADLKRES # Enable the deadlock resolver +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options DIAGNOSTIC -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -options GEOM_PART_BSD #BSD partition scheme -options GEOM_PART_MBR #MBR partition scheme -options TMPFS #Efficient memory filesystem -options FFS #Berkeley Fast Filesystem -options SOFTUPDATES #Enable FFS soft updates support -options NFSCL #New Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCL +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options TMPFS # Efficient memory filesystem +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options NFSCL # New Network Filesystem Client +options NFS_ROOT # NFS usable as /, requires NFSCL options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 @@ -73,34 +73,34 @@ device hwpmc device pci device uart -device ixpwdog # watchdog timer -device cfi # flash support -device cfid # flash disk support -device geom_redboot # redboot fis parser +device ixpwdog # watchdog timer +device cfi # flash support +device cfid # flash disk support +device geom_redboot # redboot fis parser # I2C Bus device iicbus device iicbb device iic -device ixpiic # I2C bus glue -device ds1672 # DS1672 on I2C bus -device ad7418 # AD7418 on I2C bus +device ixpiic # I2C bus glue +device ds1672 # DS1672 on I2C bus +device ad7418 # AD7418 on I2C bus device avila_led device gpio device gpioled -device avila_gpio # GPIO pins on J8 +device avila_gpio # GPIO pins on J8 device ata -device avila_ata # Gateworks CF/IDE support +device avila_ata # Gateworks CF/IDE support -device npe # Network Processing Engine +device npe # Network Processing Engine device npe_fw device firmware -device qmgr # Q Manager (required by npe) -device mii # NB: required by npe +device qmgr # Q Manager (required by npe) +device mii # NB: required by npe device ether device bpf @@ -108,24 +108,24 @@ device loop device if_bridge device md -device random # Entropy device +device random # Entropy device # Wireless NIC cards -device wlan # 802.11 support +device wlan # 802.11 support options IEEE80211_DEBUG options IEEE80211_SUPPORT_TDMA options IEEE80211_SUPPORT_MESH -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support device wlan_xauth -device ath # Atheros NICs -device ath_pci # Atheros pci/cardbus glue +device ath # Atheros NICs +device ath_pci # Atheros pci/cardbus glue options ATH_DEBUG options ATH_DIAGAPI #options ATH_TX99_DIAG -device ath_rate_sample # SampleRate tx rate control for ath +device ath_rate_sample # SampleRate tx rate control for ath #options AH_DEBUG #options AH_ASSERT @@ -149,9 +149,9 @@ device usb device ohci device ehci device umass -device scbus # SCSI bus (required for ATA/SCSI) -device da # Direct Access (disks) -device pass # Passthrough device (direct ATA/SCSI access) +device scbus # SCSI bus (required for ATA/SCSI) +device da # Direct Access (disks) +device pass # Passthrough device (direct ATA/SCSI access) #device ural #device zyd Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Sun Mar 16 14:42:58 2014 (r263244) +++ head/sys/arm/conf/BEAGLEBONE Sun Mar 16 15:22:46 2014 (r263245) @@ -27,42 +27,42 @@ include "../ti/am335x/std.beaglebone" makeoptions WITHOUT_MODULES="ahc" options HZ=100 -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -options INET6 #IPv6 communications protocols -options FFS #Berkeley Fast Filesystem -options SOFTUPDATES #Enable FFS soft updates support -options UFS_ACL #Support for access control lists -options UFS_DIRHASH #Improve performance on big directories -options GEOM_PART_BSD #BSD partition scheme -options GEOM_PART_MBR #MBR partition scheme -options TMPFS #Efficient memory filesystem -options MSDOSFS #MSDOS Filesystem -options CD9660 #ISO 9660 Filesystem -options PROCFS #Process filesystem (requires PSEUDOFS) -options PSEUDOFS #Pseudo-filesystem framework -options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI -options KTRACE #ktrace(1) support -options SYSVSHM #SYSV-style shared memory -options SYSVMSG #SYSV-style message queues -options SYSVSEM #SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options TMPFS # Efficient memory filesystem +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE # ktrace(1) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PREEMPTION options FREEBSD_BOOT_LOADER options VFP # vfp/neon # Debugging -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT #Enable verbose sysinit messages +#options VERBOSE_SYSINIT # Enable verbose sysinit messages options KDB -options DDB #Enable the kernel debugger -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS #Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options DDB # Enable the kernel debugger +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options DIAGNOSTIC # NFS support @@ -71,7 +71,7 @@ options NFSCL options NFSLOCKD # Uncomment this for NFS root -#options NFS_ROOT #NFS usable as /, requires NFSCL +#options NFS_ROOT # NFS usable as /, requires NFSCL #options BOOTP_NFSROOT #options BOOTP_COMPAT #options BOOTP @@ -129,7 +129,7 @@ device miibus device axe # ASIX Electronics USB Ethernet # Device mode support and USFS template -device usb_template # Control of the gadget +device usb_template # Control of the gadget device usfs # Flattened Device Tree Modified: head/sys/arm/conf/BWCT ============================================================================== --- head/sys/arm/conf/BWCT Sun Mar 16 14:42:58 2014 (r263244) +++ head/sys/arm/conf/BWCT Sun Mar 16 15:22:46 2014 (r263245) @@ -27,42 +27,42 @@ include "../at91/std.bwct" hints "BWCT.hints" makeoptions MODULES_OVERRIDE="" -#makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +#makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options DDB options KDB options BREAK_TO_DEBUGGER options ALT_BREAK_TO_DEBUGGER -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -#options INET6 #IPv6 communications protocols -options FFS #Berkeley Fast Filesystem -options SOFTUPDATES #Enable FFS soft updates support -#options UFS_ACL #Support for access control lists -#options UFS_DIRHASH #Improve performance on big directories -#options MD_ROOT #MD is a potential root device +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +#options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +#options UFS_ACL # Support for access control lists +#options UFS_DIRHASH # Improve performance on big directories +#options MD_ROOT # MD is a potential root device #options MD_ROOT_SIZE=4096 # 4MB ram disk #options ROOTDEVNAME=\"ufs:md0\" #options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" -options NFSCL #New Network Filesystem Client -#options NFSD #New Network Filesystem Server -#options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCL +options NFSCL # New Network Filesystem Client +#options NFSD # New Network Filesystem Server +#options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCL options BOOTP_NFSROOT options BOOTP -options GEOM_PART_BSD #BSD partition scheme -options GEOM_PART_MBR #MBR partition scheme -options TMPFS #Efficient memory filesystem -#options MSDOSFS #MSDOS Filesystem -#options CD9660 #ISO 9660 Filesystem -#options PROCFS #Process filesystem (requires PSEUDOFS) -options PSEUDOFS #Pseudo-filesystem framework -#options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI -#options KTRACE #ktrace(1) support -options SYSVSHM #SYSV-style shared memory -options SYSVMSG #SYSV-style message queues -options SYSVSEM #SYSV-style semaphores +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options TMPFS # Efficient memory filesystem +#options MSDOSFS # MSDOS Filesystem +#options CD9660 # ISO 9660 Filesystem +#options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +#options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +#options KTRACE # ktrace(1) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions #options NO_SYSCTL_DESCR options MUTEX_NOINLINE @@ -79,11 +79,11 @@ device mii device rlswitch # Debugging for use in -current -#options DEADLKRES #Enable the deadlock resolver -#options INVARIANTS #Enable calls of extra sanity checking -#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options DEADLKRES # Enable the deadlock resolver +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options DIAGNOSTIC device md @@ -96,17 +96,17 @@ device mmcsd # mmc/sd flash cards # iic device iic device iicbus -device ds1672 # DS1672 on I2C bus +device ds1672 # DS1672 on I2C bus #device iicsmb # smb over i2c bridge #device smbus # Bus support, required for smb below. #device smb # SPI bus device spibus -#device at45d # at45db642 and maybe others +#device at45d # at45db642 and maybe others -device bpf # Berkeley packet filter +device bpf # Berkeley packet filter #options USB_DEBUG #device ohci #device usb -#device umass # Disks/Mass storage - Requires scbus and da +#device umass # Disks/Mass storage - Requires scbus and da Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Sun Mar 16 14:42:58 2014 (r263244) +++ head/sys/arm/conf/CAMBRIA Sun Mar 16 15:22:46 2014 (r263245) @@ -27,7 +27,7 @@ options XSCALE_CACHE_READ_WRITE_ALLOCAT #To statically compile in device wiring instead of /boot/device.hints hints "CAMBRIA.hints" # Default places to look for devices. -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=xscale makeoptions MODULES_OVERRIDE="" #options HZ=1000 @@ -37,24 +37,24 @@ options DEVICE_POLLING # Debugging for use in -current options KDB #options GDB -options DDB #Enable the kernel debugger -#options DEADLKRES #Enable the deadlock resolver -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options DDB # Enable the kernel debugger +#options DEADLKRES # Enable the deadlock resolver +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options DIAGNOSTIC -options SCHED_4BSD #4BSD scheduler +options SCHED_4BSD # 4BSD scheduler #options PREEMPTION -options INET #InterNETworking -options GEOM_PART_BSD #BSD partition scheme -options GEOM_PART_MBR #MBR partition scheme -options TMPFS #Efficient memory filesystem -options FFS #Berkeley Fast Filesystem -options SOFTUPDATES #Enable FFS soft updates support -options NFSCL #New Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCL +options INET # InterNETworking +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options TMPFS # Efficient memory filesystem +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options NFSCL # New Network Filesystem Client +options NFS_ROOT # NFS usable as /, requires NFSCL options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 @@ -73,37 +73,37 @@ options VERBOSE_INIT_ARM device pci device uart -device ixpwdog # watchdog timer +device ixpwdog # watchdog timer -options IXP4XX_FLASH_SIZE=0x02000000 # stock 2358 comes w/ 32M -device cfi # flash support -device cfid # flash disk support -device geom_redboot # redboot fis parser +options IXP4XX_FLASH_SIZE=0x02000000 # stock 2358 comes w/ 32M +device cfi # flash support +device cfid # flash disk support +device geom_redboot # redboot fis parser # I2C Bus device iicbus device iicbb device iic -device ixpiic # I2C bus glue -device ds1672 # DS1672 on I2C bus -device ad7418 # AD7418 on I2C bus +device ixpiic # I2C bus glue +device ds1672 # DS1672 on I2C bus +device ad7418 # AD7418 on I2C bus -device cambria_fled # Font Panel LED on I2C bus -device cambria_led # 8-LED latch +device cambria_fled # Font Panel LED on I2C bus +device cambria_led # 8-LED latch device gpio device gpioled -device cambria_gpio # GPIO pins on J11 +device cambria_gpio # GPIO pins on J11 device ata -device avila_ata # Gateworks CF/IDE support +device avila_ata # Gateworks CF/IDE support -device npe # Network Processing Engine +device npe # Network Processing Engine device npe_fw device firmware -device qmgr # Q Manager (required by npe) -device mii # NB: required by npe +device qmgr # Q Manager (required by npe) +device mii # NB: required by npe device ether device bpf @@ -111,26 +111,26 @@ device loop device if_bridge device md -device random # Entropy device +device random # Entropy device # Wireless NIC cards -device wlan # 802.11 support +device wlan # 802.11 support options IEEE80211_DEBUG options IEEE80211_SUPPORT_TDMA options IEEE80211_SUPPORT_MESH -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support device wlan_xauth -device ath # Atheros NICs -device ath_pci # Atheros pci/cardbus glue +device ath # Atheros NICs +device ath_pci # Atheros pci/cardbus glue options ATH_DEBUG options ATH_DIAGAPI options ATH_ENABLE_DFS options ATH_ENABLE_11N #options ATH_TX99_DIAG -device ath_rate_sample # SampleRate tx rate control for ath +device ath_rate_sample # SampleRate tx rate control for ath options AH_DEBUG options AH_PRIVATE_DIAG @@ -139,13 +139,13 @@ device ath_hal # NB: 2 USB 2.0 ports standard device usb -options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order +options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order #options USB_DEBUG device ehci device umass -device scbus # SCSI bus (required for ATA/SCSI) -device da # Direct Access (disks) -device pass # Passthrough device (direct ATA/SCSI access) +device scbus # SCSI bus (required for ATA/SCSI) +device da # Direct Access (disks) +device pass # Passthrough device (direct ATA/SCSI access) #device ural #device zyd Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Sun Mar 16 14:42:58 2014 (r263244) +++ head/sys/arm/conf/CNS11XXNAS Sun Mar 16 15:22:46 2014 (r263245) @@ -22,7 +22,7 @@ ident CNS11XXNAS #options PHYSADDR=0x10000000 #options KERNPHYSADDR=0x10200000 -#options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm +#options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm #options FLASHADDR=0x50000000 #options LOADERRAMADDR=0x00000000 @@ -30,61 +30,61 @@ include "../econa/std.econa" makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options HZ=100 options DEVICE_POLLING # Debugging for use in -current options KDB #options GDB -options DDB #Enable the kernel debugger -#options DEADLKRES #Enable the deadlock resolver -#options INVARIANTS #Enable calls of extra sanity checking -#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -##options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options DDB # Enable the kernel debugger +#options DEADLKRES # Enable the deadlock resolver +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +##options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options DIAGNOSTIC #options COMPAT_FREEBSD5 #options COMPAT_FREEBSD6 -#options COMPAT_FREEBSD7 +#options COMPAT_FREEBSD7n -options SCHED_ULE #ULE scheduler -#options SCHED_4BSD #4BSD scheduler -options GEOM_PART_BSD #BSD partition scheme -options GEOM_PART_MBR #MBR partition scheme +options SCHED_ULE # ULE scheduler +#options SCHED_4BSD # 4BSD scheduler +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme options GEOM_PART_GPT # GUID Partition Tables. #options GEOM_PART_EBR #options GEOM_PART_EBR_COMPAT options GEOM_LABEL # Provides labelization -options INET #InterNETworking -options INET6 #IPv6 communications protocols -options FFS #Berkeley Fast Filesystem -options SOFTUPDATES #Enable FFS soft updates support -options UFS_ACL #Support for access control lists -options UFS_DIRHASH #Improve performance on big directories -options NFSCL #New Network Filesystem Client -#options NFSD #New Network Filesystem Server -#options NFSLOCKD #Network Lock Manager -options NFS_ROOT #NFS usable as /, requires NFSCL -options TMPFS #Efficient memory filesystem -options MSDOSFS #MSDOS Filesystem -#options CD9660 #ISO 9660 Filesystem -#options PROCFS #Process filesystem (requires PSEUDOFS) -options PSEUDOFS #Pseudo-filesystem framework -options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI -options KTRACE #ktrace(1) support -options SYSVSHM #SYSV-style shared memory -options SYSVMSG #SYSV-style message queues -options SYSVSEM #SYSV-style semaphores +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options NFSCL # New Network Filesystem Client +#options NFSD # New Network Filesystem Server +#options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCL +options TMPFS # Efficient memory filesystem +options MSDOSFS # MSDOS Filesystem +#options CD9660 # ISO 9660 Filesystem +#options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE # ktrace(1) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -options MUTEX_NOINLINE #Mutex inlines are space hogs -options RWLOCK_NOINLINE #rwlock inlines are space hogs -options SX_NOINLINE #sx inliens are space hogs +options MUTEX_NOINLINE # Mutex inlines are space hogs +options RWLOCK_NOINLINE # rwlock inlines are space hogs +options SX_NOINLINE # sx inliens are space hogs #options BOOTP #options BOOTP_NFSROOT #options BOOTP_NFSV3 @@ -96,14 +96,14 @@ device uart device firmware -device mii # Minimal mii routines +device mii # Minimal mii routines device ether device bpf device loop device md -device random # Entropy device +device random # Entropy device *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 15:22:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78D16796; Sun, 16 Mar 2014 15:22:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 65D9D335; Sun, 16 Mar 2014 15:22:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GFMrMg025430; Sun, 16 Mar 2014 15:22:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GFMrBD025427; Sun, 16 Mar 2014 15:22:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403161522.s2GFMrBD025427@svn.freebsd.org> From: Warner Losh Date: Sun, 16 Mar 2014 15:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263246 - in head/sys: amd64/conf i386/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 15:22:53 -0000 Author: imp Date: Sun Mar 16 15:22:52 2014 New Revision: 263246 URL: http://svnweb.freebsd.org/changeset/base/263246 Log: Align all comments in config files on same column. This consistency helps when bits and pieces of GENERIC from i386 or amd64 are cut and pasted into other architecture's config files (which in the case of ARM had gotten rather akimbo). Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Mar 16 15:22:46 2014 (r263245) +++ head/sys/amd64/conf/GENERIC Sun Mar 16 15:22:52 2014 (r263246) @@ -70,7 +70,7 @@ options MAC # TrustedBSD MAC Framewor options KDTRACE_FRAME # Ensure frames are compiled in options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data -options INCLUDE_CONFIG_FILE # Include this file in kernel +options INCLUDE_CONFIG_FILE # Include this file in kernel # Debugging support. Always need this: options KDB # Enable kernel debugger support. @@ -100,253 +100,253 @@ device pci device fdc # ATA controllers -device ahci # AHCI-compatible SATA controllers -device ata # Legacy ATA/SATA controllers -options ATA_STATIC_ID # Static device numbering -device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA -device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA +device ahci # AHCI-compatible SATA controllers +device ata # Legacy ATA/SATA controllers +options ATA_STATIC_ID # Static device numbering +device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA +device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # SCSI Controllers -device ahc # AHA2940 and onboard AIC7xxx devices +device ahc # AHA2940 and onboard AIC7xxx devices options AHC_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~128k to driver. -device ahd # AHA39320/29320 and onboard AIC79xx devices +device ahd # AHA39320/29320 and onboard AIC79xx devices options AHD_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~215k to driver. -device esp # AMD Am53C974 (Tekram DC-390(T)) -device hptiop # Highpoint RocketRaid 3xxx series -device isp # Qlogic family -#device ispfw # Firmware for QLogic HBAs- normally a module -device mpt # LSI-Logic MPT-Fusion -device mps # LSI-Logic MPT-Fusion 2 -#device ncr # NCR/Symbios Logic -device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') -device trm # Tekram DC395U/UW/F DC315U adapters - -device adv # Advansys SCSI adapters -device adw # Advansys wide SCSI adapters -device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60. -device bt # Buslogic/Mylex MultiMaster SCSI adapters -device isci # Intel C600 SAS controller +device esp # AMD Am53C974 (Tekram DC-390(T)) +device hptiop # Highpoint RocketRaid 3xxx series +device isp # Qlogic family +#device ispfw # Firmware for QLogic HBAs- normally a module +device mpt # LSI-Logic MPT-Fusion +device mps # LSI-Logic MPT-Fusion 2 +#device ncr # NCR/Symbios Logic +device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') +device trm # Tekram DC395U/UW/F DC315U adapters + +device adv # Advansys SCSI adapters +device adw # Advansys wide SCSI adapters +device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60. +device bt # Buslogic/Mylex MultiMaster SCSI adapters +device isci # Intel C600 SAS controller # ATA/SCSI peripherals -device scbus # SCSI bus (required for ATA/SCSI) -device ch # SCSI media changers -device da # Direct Access (disks) -device sa # Sequential Access (tape etc) -device cd # CD -device pass # Passthrough device (direct ATA/SCSI access) -device ses # Enclosure Services (SES and SAF-TE) -#device ctl # CAM Target Layer +device scbus # SCSI bus (required for ATA/SCSI) +device ch # SCSI media changers +device da # Direct Access (disks) +device sa # Sequential Access (tape etc) +device cd # CD +device pass # Passthrough device (direct ATA/SCSI access) +device ses # Enclosure Services (SES and SAF-TE) +#device ctl # CAM Target Layer # RAID controllers interfaced to the SCSI subsystem -device amr # AMI MegaRAID -device arcmsr # Areca SATA II RAID +device amr # AMI MegaRAID +device arcmsr # Areca SATA II RAID #XXX it is not 64-bit clean, -scottl -#device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID -device ciss # Compaq Smart RAID 5* -device dpt # DPT Smartcache III, IV - See NOTES for options -device hptmv # Highpoint RocketRAID 182x -device hptnr # Highpoint DC7280, R750 -device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx -device hpt27xx # Highpoint RocketRAID 27xx -device iir # Intel Integrated RAID -device ips # IBM (Adaptec) ServeRAID -device mly # Mylex AcceleRAID/eXtremeRAID -device twa # 3ware 9000 series PATA/SATA RAID -device tws # LSI 3ware 9750 SATA+SAS 6Gb/s RAID controller +#device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID +device ciss # Compaq Smart RAID 5* +device dpt # DPT Smartcache III, IV - See NOTES for options +device hptmv # Highpoint RocketRAID 182x +device hptnr # Highpoint DC7280, R750 +device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx +device hpt27xx # Highpoint RocketRAID 27xx +device iir # Intel Integrated RAID +device ips # IBM (Adaptec) ServeRAID +device mly # Mylex AcceleRAID/eXtremeRAID +device twa # 3ware 9000 series PATA/SATA RAID +device tws # LSI 3ware 9750 SATA+SAS 6Gb/s RAID controller # RAID controllers -device aac # Adaptec FSA RAID -device aacp # SCSI passthrough for aac (requires CAM) -device aacraid # Adaptec by PMC RAID -device ida # Compaq Smart RAID -device mfi # LSI MegaRAID SAS -device mlx # Mylex DAC960 family +device aac # Adaptec FSA RAID +device aacp # SCSI passthrough for aac (requires CAM) +device aacraid # Adaptec by PMC RAID +device ida # Compaq Smart RAID +device mfi # LSI MegaRAID SAS +device mlx # Mylex DAC960 family #XXX pointer/int warnings -#device pst # Promise Supertrak SX6000 -device twe # 3ware ATA RAID +#device pst # Promise Supertrak SX6000 +device twe # 3ware ATA RAID # atkbdc0 controls both the keyboard and the PS/2 mouse -device atkbdc # AT keyboard controller -device atkbd # AT keyboard -device psm # PS/2 mouse +device atkbdc # AT keyboard controller +device atkbd # AT keyboard +device psm # PS/2 mouse -device kbdmux # keyboard multiplexer +device kbdmux # keyboard multiplexer -device vga # VGA video card driver -options VESA # Add support for VESA BIOS Extensions (VBE) +device vga # VGA video card driver +options VESA # Add support for VESA BIOS Extensions (VBE) -device splash # Splash screen and screen saver support +device splash # Splash screen and screen saver support # syscons is the default console driver, resembling an SCO console device sc -options SC_PIXEL_MODE # add support for the raster text mode +options SC_PIXEL_MODE # add support for the raster text mode -device agp # support several AGP chipsets +device agp # support several AGP chipsets # PCCARD (PCMCIA) support # PCMCIA and cardbus bridge support -device cbb # cardbus (yenta) bridge -device pccard # PC Card (16-bit) bus -device cardbus # CardBus (32-bit) bus +device cbb # cardbus (yenta) bridge +device pccard # PC Card (16-bit) bus +device cardbus # CardBus (32-bit) bus # Serial (COM) ports -device uart # Generic UART driver +device uart # Generic UART driver # Parallel port device ppc -device ppbus # Parallel port bus (required) -device lpt # Printer -device ppi # Parallel port interface device -#device vpo # Requires scbus and da +device ppbus # Parallel port bus (required) +device lpt # Printer +device ppi # Parallel port interface device +#device vpo # Requires scbus and da -device puc # Multi I/O cards and multi-channel UARTs +device puc # Multi I/O cards and multi-channel UARTs # PCI Ethernet NICs. -device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE -device de # DEC/Intel DC21x4x (``Tulip'') -device em # Intel PRO/1000 Gigabit Ethernet Family -device igb # Intel PRO/1000 PCIE Server Gigabit Family -device ixgbe # Intel PRO/10GbE PCIE Ethernet Family -device le # AMD Am7900 LANCE and Am79C9xx PCnet -device ti # Alteon Networks Tigon I/II gigabit Ethernet -device txp # 3Com 3cR990 (``Typhoon'') -device vx # 3Com 3c590, 3c595 (``Vortex'') +device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE +device de # DEC/Intel DC21x4x (``Tulip'') +device em # Intel PRO/1000 Gigabit Ethernet Family +device igb # Intel PRO/1000 PCIE Server Gigabit Family +device ixgbe # Intel PRO/10GbE PCIE Ethernet Family +device le # AMD Am7900 LANCE and Am79C9xx PCnet +device ti # Alteon Networks Tigon I/II gigabit Ethernet +device txp # 3Com 3cR990 (``Typhoon'') +device vx # 3Com 3c590, 3c595 (``Vortex'') # PCI Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! -device miibus # MII bus support -device ae # Attansic/Atheros L2 FastEthernet -device age # Attansic/Atheros L1 Gigabit Ethernet -device alc # Atheros AR8131/AR8132 Ethernet -device ale # Atheros AR8121/AR8113/AR8114 Ethernet -device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet -device bfe # Broadcom BCM440x 10/100 Ethernet -device bge # Broadcom BCM570xx Gigabit Ethernet -device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn -device dc # DEC/Intel 21143 and various workalikes -device et # Agere ET1310 10/100/Gigabit Ethernet -device fxp # Intel EtherExpress PRO/100B (82557, 82558) -device gem # Sun GEM/Sun ERI/Apple GMAC -device hme # Sun HME (Happy Meal Ethernet) -device jme # JMicron JMC250 Gigabit/JMC260 Fast Ethernet -device lge # Level 1 LXT1001 gigabit Ethernet -device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet -device nfe # nVidia nForce MCP on-board Ethernet -device nge # NatSemi DP83820 gigabit Ethernet -device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') -device re # RealTek 8139C+/8169/8169S/8110S -device rl # RealTek 8129/8139 -device sf # Adaptec AIC-6915 (``Starfire'') -device sge # Silicon Integrated Systems SiS190/191 -device sis # Silicon Integrated Systems SiS 900/SiS 7016 -device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet -device ste # Sundance ST201 (D-Link DFE-550TX) -device stge # Sundance/Tamarack TC9021 gigabit Ethernet -device tl # Texas Instruments ThunderLAN -device tx # SMC EtherPower II (83c170 ``EPIC'') -device vge # VIA VT612x gigabit Ethernet -device vr # VIA Rhine, Rhine II -device wb # Winbond W89C840F -device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') +device miibus # MII bus support +device ae # Attansic/Atheros L2 FastEthernet +device age # Attansic/Atheros L1 Gigabit Ethernet +device alc # Atheros AR8131/AR8132 Ethernet +device ale # Atheros AR8121/AR8113/AR8114 Ethernet +device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet +device bfe # Broadcom BCM440x 10/100 Ethernet +device bge # Broadcom BCM570xx Gigabit Ethernet +device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn +device dc # DEC/Intel 21143 and various workalikes +device et # Agere ET1310 10/100/Gigabit Ethernet +device fxp # Intel EtherExpress PRO/100B (82557, 82558) +device gem # Sun GEM/Sun ERI/Apple GMAC +device hme # Sun HME (Happy Meal Ethernet) +device jme # JMicron JMC250 Gigabit/JMC260 Fast Ethernet +device lge # Level 1 LXT1001 gigabit Ethernet +device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet +device nfe # nVidia nForce MCP on-board Ethernet +device nge # NatSemi DP83820 gigabit Ethernet +device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') +device re # RealTek 8139C+/8169/8169S/8110S +device rl # RealTek 8129/8139 +device sf # Adaptec AIC-6915 (``Starfire'') +device sge # Silicon Integrated Systems SiS190/191 +device sis # Silicon Integrated Systems SiS 900/SiS 7016 +device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet +device ste # Sundance ST201 (D-Link DFE-550TX) +device stge # Sundance/Tamarack TC9021 gigabit Ethernet +device tl # Texas Instruments ThunderLAN +device tx # SMC EtherPower II (83c170 ``EPIC'') +device vge # VIA VT612x gigabit Ethernet +device vr # VIA Rhine, Rhine II +device wb # Winbond W89C840F +device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # ISA Ethernet NICs. pccard NICs included. -device cs # Crystal Semiconductor CS89x0 NIC +device cs # Crystal Semiconductor CS89x0 NIC # 'device ed' requires 'device miibus' -device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards -device ex # Intel EtherExpress Pro/10 and Pro/10+ -device ep # Etherlink III based cards -device fe # Fujitsu MB8696x based cards -device sn # SMC's 9000 series of Ethernet chips -device xe # Xircom pccard Ethernet +device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards +device ex # Intel EtherExpress Pro/10 and Pro/10+ +device ep # Etherlink III based cards +device fe # Fujitsu MB8696x based cards +device sn # SMC's 9000 series of Ethernet chips +device xe # Xircom pccard Ethernet # Wireless NIC cards -device wlan # 802.11 support -options IEEE80211_DEBUG # enable debug msgs -options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's +device wlan # 802.11 support +options IEEE80211_DEBUG # enable debug msgs +options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's options IEEE80211_SUPPORT_MESH # enable 802.11s draft support -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support -device wlan_amrr # AMRR transmit rate control algorithm -device an # Aironet 4500/4800 802.11 wireless NICs. -device ath # Atheros NICs -device ath_pci # Atheros pci/cardbus glue -device ath_hal # pci/cardbus chip support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support +device wlan_amrr # AMRR transmit rate control algorithm +device an # Aironet 4500/4800 802.11 wireless NICs. +device ath # Atheros NICs +device ath_pci # Atheros pci/cardbus glue +device ath_hal # pci/cardbus chip support options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors -options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation -options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later -device ath_rate_sample # SampleRate tx rate control for ath -#device bwi # Broadcom BCM430x/BCM431x wireless NICs. -#device bwn # Broadcom BCM43xx wireless NICs. -device ipw # Intel 2100 wireless NICs. -device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs. -device iwn # Intel 4965/1000/5000/6000 wireless NICs. -device malo # Marvell Libertas wireless NICs. -device mwl # Marvell 88W8363 802.11n wireless NICs. -device ral # Ralink Technology RT2500 wireless NICs. -device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. -device wpi # Intel 3945ABG wireless NICs. +options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation +options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later +device ath_rate_sample # SampleRate tx rate control for ath +#device bwi # Broadcom BCM430x/BCM431x wireless NICs. +#device bwn # Broadcom BCM43xx wireless NICs. +device ipw # Intel 2100 wireless NICs. +device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs. +device iwn # Intel 4965/1000/5000/6000 wireless NICs. +device malo # Marvell Libertas wireless NICs. +device mwl # Marvell 88W8363 802.11n wireless NICs. +device ral # Ralink Technology RT2500 wireless NICs. +device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. +device wpi # Intel 3945ABG wireless NICs. # Pseudo devices. -device loop # Network loopback -device random # Entropy device -device padlock_rng # VIA Padlock RNG -device rdrand_rng # Intel Bull Mountain RNG -device ether # Ethernet support -device vlan # 802.1Q VLAN support -device tun # Packet tunnel. -device md # Memory "disks" -device gif # IPv6 and IPv4 tunneling -device faith # IPv6-to-IPv4 relaying (translation) -device firmware # firmware assist module +device loop # Network loopback +device random # Entropy device +device padlock_rng # VIA Padlock RNG +device rdrand_rng # Intel Bull Mountain RNG +device ether # Ethernet support +device vlan # 802.1Q VLAN support +device tun # Packet tunnel. +device md # Memory "disks" +device gif # IPv6 and IPv4 tunneling +device faith # IPv6-to-IPv4 relaying (translation) +device firmware # firmware assist module # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. -device bpf # Berkeley packet filter +device bpf # Berkeley packet filter # USB support -options USB_DEBUG # enable debug msgs -device uhci # UHCI PCI->USB interface -device ohci # OHCI PCI->USB interface -device ehci # EHCI PCI->USB interface (USB 2.0) -device xhci # XHCI PCI->USB interface (USB 3.0) -device usb # USB Bus (required) -device ukbd # Keyboard -device umass # Disks/Mass storage - Requires scbus and da +options USB_DEBUG # enable debug msgs +device uhci # UHCI PCI->USB interface +device ohci # OHCI PCI->USB interface +device ehci # EHCI PCI->USB interface (USB 2.0) +device xhci # XHCI PCI->USB interface (USB 3.0) +device usb # USB Bus (required) +device ukbd # Keyboard +device umass # Disks/Mass storage - Requires scbus and da # Sound support -device sound # Generic sound driver (required) -device snd_cmi # CMedia CMI8338/CMI8738 -device snd_csa # Crystal Semiconductor CS461x/428x -device snd_emu10kx # Creative SoundBlaster Live! and Audigy -device snd_es137x # Ensoniq AudioPCI ES137x -device snd_hda # Intel High Definition Audio -device snd_ich # Intel, NVidia and other ICH AC'97 Audio -device snd_via8233 # VIA VT8233x Audio +device sound # Generic sound driver (required) +device snd_cmi # CMedia CMI8338/CMI8738 +device snd_csa # Crystal Semiconductor CS461x/428x +device snd_emu10kx # Creative SoundBlaster Live! and Audigy +device snd_es137x # Ensoniq AudioPCI ES137x +device snd_hda # Intel High Definition Audio +device snd_ich # Intel, NVidia and other ICH AC'97 Audio +device snd_via8233 # VIA VT8233x Audio # MMC/SD -device mmc # MMC/SD bus -device mmcsd # MMC/SD memory card -device sdhci # Generic PCI SD Host Controller +device mmc # MMC/SD bus +device mmcsd # MMC/SD memory card +device sdhci # Generic PCI SD Host Controller # VirtIO support -device virtio # Generic VirtIO bus (required) -device virtio_pci # VirtIO PCI device -device vtnet # VirtIO Ethernet device -device virtio_blk # VirtIO Block device -device virtio_scsi # VirtIO SCSI device -device virtio_balloon # VirtIO Memory Balloon device +device virtio # Generic VirtIO bus (required) +device virtio_pci # VirtIO PCI device +device vtnet # VirtIO Ethernet device +device virtio_blk # VirtIO Block device +device virtio_scsi # VirtIO SCSI device +device virtio_balloon # VirtIO Memory Balloon device # HyperV drivers -device hyperv # HyperV drivers +device hyperv # HyperV drivers # Xen HVM Guest Optimizations # NOTE: XENHVM depends on xenpci. They must be added or removed together. -options XENHVM # Xen HVM kernel infrastructure -device xenpci # Xen HVM Hypervisor services driver +options XENHVM # Xen HVM kernel infrastructure +device xenpci # Xen HVM Hypervisor services driver # VMware support -device vmx # VMware VMXNET3 Ethernet +device vmx # VMware VMXNET3 Ethernet Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sun Mar 16 15:22:46 2014 (r263245) +++ head/sys/i386/conf/GENERIC Sun Mar 16 15:22:52 2014 (r263246) @@ -70,7 +70,7 @@ options CAPABILITIES # Capsicum capabi options MAC # TrustedBSD MAC Framework options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data -options INCLUDE_CONFIG_FILE # Include this file in kernel +options INCLUDE_CONFIG_FILE # Include this file in kernel # Debugging support. Always need this: options KDB # Enable kernel debugger support. @@ -101,94 +101,94 @@ device pci device fdc # ATA controllers -device ahci # AHCI-compatible SATA controllers -device ata # Legacy ATA/SATA controllers -options ATA_STATIC_ID # Static device numbering -device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA -device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA +device ahci # AHCI-compatible SATA controllers +device ata # Legacy ATA/SATA controllers +options ATA_STATIC_ID # Static device numbering +device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA +device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # SCSI Controllers -device ahb # EISA AHA1742 family -device ahc # AHA2940 and onboard AIC7xxx devices +device ahb # EISA AHA1742 family +device ahc # AHA2940 and onboard AIC7xxx devices options AHC_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~128k to driver. -device ahd # AHA39320/29320 and onboard AIC79xx devices +device ahd # AHA39320/29320 and onboard AIC79xx devices options AHD_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~215k to driver. -device esp # AMD Am53C974 (Tekram DC-390(T)) -device hptiop # Highpoint RocketRaid 3xxx series -device isp # Qlogic family -#device ispfw # Firmware for QLogic HBAs- normally a module -device mpt # LSI-Logic MPT-Fusion -device mps # LSI-Logic MPT-Fusion 2 -#device ncr # NCR/Symbios Logic -device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') -device trm # Tekram DC395U/UW/F DC315U adapters - -device adv # Advansys SCSI adapters -device adw # Advansys wide SCSI adapters -device aha # Adaptec 154x SCSI adapters -device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60. -device bt # Buslogic/Mylex MultiMaster SCSI adapters - -device ncv # NCR 53C500 -device nsp # Workbit Ninja SCSI-3 -device stg # TMC 18C30/18C50 -device isci # Intel C600 SAS controller +device esp # AMD Am53C974 (Tekram DC-390(T)) +device hptiop # Highpoint RocketRaid 3xxx series +device isp # Qlogic family +#device ispfw # Firmware for QLogic HBAs- normally a module +device mpt # LSI-Logic MPT-Fusion +device mps # LSI-Logic MPT-Fusion 2 +#device ncr # NCR/Symbios Logic +device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') +device trm # Tekram DC395U/UW/F DC315U adapters + +device adv # Advansys SCSI adapters +device adw # Advansys wide SCSI adapters +device aha # Adaptec 154x SCSI adapters +device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60. +device bt # Buslogic/Mylex MultiMaster SCSI adapters + +device ncv # NCR 53C500 +device nsp # Workbit Ninja SCSI-3 +device stg # TMC 18C30/18C50 +device isci # Intel C600 SAS controller # ATA/SCSI peripherals -device scbus # SCSI bus (required for ATA/SCSI) -device ch # SCSI media changers -device da # Direct Access (disks) -device sa # Sequential Access (tape etc) -device cd # CD -device pass # Passthrough device (direct ATA/SCSI access) -device ses # Enclosure Services (SES and SAF-TE) -#device ctl # CAM Target Layer +device scbus # SCSI bus (required for ATA/SCSI) +device ch # SCSI media changers +device da # Direct Access (disks) +device sa # Sequential Access (tape etc) +device cd # CD +device pass # Passthrough device (direct ATA/SCSI access) +device ses # Enclosure Services (SES and SAF-TE) +#device ctl # CAM Target Layer # RAID controllers interfaced to the SCSI subsystem -device amr # AMI MegaRAID -device arcmsr # Areca SATA II RAID -device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID -device ciss # Compaq Smart RAID 5* -device dpt # DPT Smartcache III, IV - See NOTES for options -device hptmv # Highpoint RocketRAID 182x -device hptnr # Highpoint DC7280, R750 -device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx -device hpt27xx # Highpoint RocketRAID 27xx -device iir # Intel Integrated RAID -device ips # IBM (Adaptec) ServeRAID -device mly # Mylex AcceleRAID/eXtremeRAID -device twa # 3ware 9000 series PATA/SATA RAID -device tws # LSI 3ware 9750 SATA+SAS 6Gb/s RAID controller +device amr # AMI MegaRAID +device arcmsr # Areca SATA II RAID +device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID +device ciss # Compaq Smart RAID 5* +device dpt # DPT Smartcache III, IV - See NOTES for options +device hptmv # Highpoint RocketRAID 182x +device hptnr # Highpoint DC7280, R750 +device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx +device hpt27xx # Highpoint RocketRAID 27xx +device iir # Intel Integrated RAID +device ips # IBM (Adaptec) ServeRAID +device mly # Mylex AcceleRAID/eXtremeRAID +device twa # 3ware 9000 series PATA/SATA RAID +device tws # LSI 3ware 9750 SATA+SAS 6Gb/s RAID controller # RAID controllers -device aac # Adaptec FSA RAID -device aacp # SCSI passthrough for aac (requires CAM) -device aacraid # Adaptec by PMC RAID -device ida # Compaq Smart RAID -device mfi # LSI MegaRAID SAS -device mlx # Mylex DAC960 family -device pst # Promise Supertrak SX6000 -device twe # 3ware ATA RAID +device aac # Adaptec FSA RAID +device aacp # SCSI passthrough for aac (requires CAM) +device aacraid # Adaptec by PMC RAID +device ida # Compaq Smart RAID +device mfi # LSI MegaRAID SAS +device mlx # Mylex DAC960 family +device pst # Promise Supertrak SX6000 +device twe # 3ware ATA RAID # atkbdc0 controls both the keyboard and the PS/2 mouse -device atkbdc # AT keyboard controller -device atkbd # AT keyboard -device psm # PS/2 mouse +device atkbdc # AT keyboard controller +device atkbd # AT keyboard +device psm # PS/2 mouse -device kbdmux # keyboard multiplexer +device kbdmux # keyboard multiplexer -device vga # VGA video card driver -options VESA # Add support for VESA BIOS Extensions (VBE) +device vga # VGA video card driver +options VESA # Add support for VESA BIOS Extensions (VBE) -device splash # Splash screen and screen saver support +device splash # Splash screen and screen saver support # syscons is the default console driver, resembling an SCO console device sc -options SC_PIXEL_MODE # add support for the raster text mode +options SC_PIXEL_MODE # add support for the raster text mode -device agp # support several AGP chipsets +device agp # support several AGP chipsets # Power management support (see NOTES for more options) #device apm @@ -197,169 +197,169 @@ device pmtimer # PCCARD (PCMCIA) support # PCMCIA and cardbus bridge support -device cbb # cardbus (yenta) bridge -device pccard # PC Card (16-bit) bus -device cardbus # CardBus (32-bit) bus +device cbb # cardbus (yenta) bridge +device pccard # PC Card (16-bit) bus +device cardbus # CardBus (32-bit) bus # Serial (COM) ports -device uart # Generic UART driver +device uart # Generic UART driver # Parallel port device ppc -device ppbus # Parallel port bus (required) -device lpt # Printer -device ppi # Parallel port interface device -#device vpo # Requires scbus and da +device ppbus # Parallel port bus (required) +device lpt # Printer +device ppi # Parallel port interface device +#device vpo # Requires scbus and da -device puc # Multi I/O cards and multi-channel UARTs +device puc # Multi I/O cards and multi-channel UARTs # PCI Ethernet NICs. -device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE -device de # DEC/Intel DC21x4x (``Tulip'') -device em # Intel PRO/1000 Gigabit Ethernet Family -device igb # Intel PRO/1000 PCIE Server Gigabit Family -device ixgb # Intel PRO/10GbE Ethernet Card -device le # AMD Am7900 LANCE and Am79C9xx PCnet -device ti # Alteon Networks Tigon I/II gigabit Ethernet -device txp # 3Com 3cR990 (``Typhoon'') -device vx # 3Com 3c590, 3c595 (``Vortex'') +device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE +device de # DEC/Intel DC21x4x (``Tulip'') +device em # Intel PRO/1000 Gigabit Ethernet Family +device igb # Intel PRO/1000 PCIE Server Gigabit Family +device ixgb # Intel PRO/10GbE Ethernet Card +device le # AMD Am7900 LANCE and Am79C9xx PCnet +device ti # Alteon Networks Tigon I/II gigabit Ethernet +device txp # 3Com 3cR990 (``Typhoon'') +device vx # 3Com 3c590, 3c595 (``Vortex'') # PCI Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! -device miibus # MII bus support -device ae # Attansic/Atheros L2 FastEthernet -device age # Attansic/Atheros L1 Gigabit Ethernet -device alc # Atheros AR8131/AR8132 Ethernet -device ale # Atheros AR8121/AR8113/AR8114 Ethernet -device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet -device bfe # Broadcom BCM440x 10/100 Ethernet -device bge # Broadcom BCM570xx Gigabit Ethernet -device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn -device dc # DEC/Intel 21143 and various workalikes -device et # Agere ET1310 10/100/Gigabit Ethernet -device fxp # Intel EtherExpress PRO/100B (82557, 82558) -device gem # Sun GEM/Sun ERI/Apple GMAC -device hme # Sun HME (Happy Meal Ethernet) -device jme # JMicron JMC250 Gigabit/JMC260 Fast Ethernet -device lge # Level 1 LXT1001 gigabit Ethernet -device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet -device nfe # nVidia nForce MCP on-board Ethernet -device nge # NatSemi DP83820 gigabit Ethernet -device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') -device re # RealTek 8139C+/8169/8169S/8110S -device rl # RealTek 8129/8139 -device sf # Adaptec AIC-6915 (``Starfire'') -device sge # Silicon Integrated Systems SiS190/191 -device sis # Silicon Integrated Systems SiS 900/SiS 7016 -device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet -device ste # Sundance ST201 (D-Link DFE-550TX) -device stge # Sundance/Tamarack TC9021 gigabit Ethernet -device tl # Texas Instruments ThunderLAN -device tx # SMC EtherPower II (83c170 ``EPIC'') -device vge # VIA VT612x gigabit Ethernet -device vr # VIA Rhine, Rhine II -device vte # DM&P Vortex86 RDC R6040 Fast Ethernet -device wb # Winbond W89C840F -device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') +device miibus # MII bus support +device ae # Attansic/Atheros L2 FastEthernet +device age # Attansic/Atheros L1 Gigabit Ethernet +device alc # Atheros AR8131/AR8132 Ethernet +device ale # Atheros AR8121/AR8113/AR8114 Ethernet +device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet +device bfe # Broadcom BCM440x 10/100 Ethernet +device bge # Broadcom BCM570xx Gigabit Ethernet +device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn +device dc # DEC/Intel 21143 and various workalikes +device et # Agere ET1310 10/100/Gigabit Ethernet +device fxp # Intel EtherExpress PRO/100B (82557, 82558) +device gem # Sun GEM/Sun ERI/Apple GMAC +device hme # Sun HME (Happy Meal Ethernet) +device jme # JMicron JMC250 Gigabit/JMC260 Fast Ethernet +device lge # Level 1 LXT1001 gigabit Ethernet +device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet +device nfe # nVidia nForce MCP on-board Ethernet +device nge # NatSemi DP83820 gigabit Ethernet +device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') +device re # RealTek 8139C+/8169/8169S/8110S +device rl # RealTek 8129/8139 +device sf # Adaptec AIC-6915 (``Starfire'') +device sge # Silicon Integrated Systems SiS190/191 +device sis # Silicon Integrated Systems SiS 900/SiS 7016 +device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet +device ste # Sundance ST201 (D-Link DFE-550TX) +device stge # Sundance/Tamarack TC9021 gigabit Ethernet +device tl # Texas Instruments ThunderLAN +device tx # SMC EtherPower II (83c170 ``EPIC'') +device vge # VIA VT612x gigabit Ethernet +device vr # VIA Rhine, Rhine II +device vte # DM&P Vortex86 RDC R6040 Fast Ethernet +device wb # Winbond W89C840F +device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # ISA Ethernet NICs. pccard NICs included. -device cs # Crystal Semiconductor CS89x0 NIC +device cs # Crystal Semiconductor CS89x0 NIC # 'device ed' requires 'device miibus' -device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards -device ex # Intel EtherExpress Pro/10 and Pro/10+ -device ep # Etherlink III based cards -device fe # Fujitsu MB8696x based cards -device ie # EtherExpress 8/16, 3C507, StarLAN 10 etc. -device sn # SMC's 9000 series of Ethernet chips -device xe # Xircom pccard Ethernet +device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards +device ex # Intel EtherExpress Pro/10 and Pro/10+ +device ep # Etherlink III based cards +device fe # Fujitsu MB8696x based cards +device ie # EtherExpress 8/16, 3C507, StarLAN 10 etc. +device sn # SMC's 9000 series of Ethernet chips +device xe # Xircom pccard Ethernet # Wireless NIC cards -device wlan # 802.11 support -options IEEE80211_DEBUG # enable debug msgs -options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's +device wlan # 802.11 support +options IEEE80211_DEBUG # enable debug msgs +options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's options IEEE80211_SUPPORT_MESH # enable 802.11s draft support -device wlan_wep # 802.11 WEP support -device wlan_ccmp # 802.11 CCMP support -device wlan_tkip # 802.11 TKIP support -device wlan_amrr # AMRR transmit rate control algorithm -device an # Aironet 4500/4800 802.11 wireless NICs. -device ath # Atheros NICs -device ath_pci # Atheros pci/cardbus glue -device ath_hal # pci/cardbus chip support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support +device wlan_amrr # AMRR transmit rate control algorithm +device an # Aironet 4500/4800 802.11 wireless NICs. +device ath # Atheros NICs +device ath_pci # Atheros pci/cardbus glue +device ath_hal # pci/cardbus chip support options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors -options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation -options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later -device ath_rate_sample # SampleRate tx rate control for ath -#device bwi # Broadcom BCM430x/BCM431x wireless NICs. -#device bwn # Broadcom BCM43xx wireless NICs. -device ipw # Intel 2100 wireless NICs. -device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs. -device iwn # Intel 4965/1000/5000/6000 wireless NICs. -device malo # Marvell Libertas wireless NICs. -device mwl # Marvell 88W8363 802.11n wireless NICs. -device ral # Ralink Technology RT2500 wireless NICs. -device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. -#device wl # Older non 802.11 Wavelan wireless NIC. -device wpi # Intel 3945ABG wireless NICs. +options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation +options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later +device ath_rate_sample # SampleRate tx rate control for ath +#device bwi # Broadcom BCM430x/BCM431x wireless NICs. +#device bwn # Broadcom BCM43xx wireless NICs. +device ipw # Intel 2100 wireless NICs. +device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs. +device iwn # Intel 4965/1000/5000/6000 wireless NICs. +device malo # Marvell Libertas wireless NICs. +device mwl # Marvell 88W8363 802.11n wireless NICs. +device ral # Ralink Technology RT2500 wireless NICs. +device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. +#device wl # Older non 802.11 Wavelan wireless NIC. +device wpi # Intel 3945ABG wireless NICs. # Pseudo devices. -device loop # Network loopback -device random # Entropy device -device padlock_rng # VIA Padlock RNG -device rdrand_rng # Intel Bull Mountain RNG -device ether # Ethernet support -device vlan # 802.1Q VLAN support -device tun # Packet tunnel. -device md # Memory "disks" -device gif # IPv6 and IPv4 tunneling -device faith # IPv6-to-IPv4 relaying (translation) -device firmware # firmware assist module +device loop # Network loopback +device random # Entropy device +device padlock_rng # VIA Padlock RNG +device rdrand_rng # Intel Bull Mountain RNG +device ether # Ethernet support +device vlan # 802.1Q VLAN support +device tun # Packet tunnel. +device md # Memory "disks" +device gif # IPv6 and IPv4 tunneling +device faith # IPv6-to-IPv4 relaying (translation) +device firmware # firmware assist module # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. -device bpf # Berkeley packet filter +device bpf # Berkeley packet filter # USB support -options USB_DEBUG # enable debug msgs -device uhci # UHCI PCI->USB interface -device ohci # OHCI PCI->USB interface -device ehci # EHCI PCI->USB interface (USB 2.0) -device xhci # XHCI PCI->USB interface (USB 3.0) -device usb # USB Bus (required) -device ukbd # Keyboard -device umass # Disks/Mass storage - Requires scbus and da +options USB_DEBUG # enable debug msgs +device uhci # UHCI PCI->USB interface +device ohci # OHCI PCI->USB interface +device ehci # EHCI PCI->USB interface (USB 2.0) +device xhci # XHCI PCI->USB interface (USB 3.0) +device usb # USB Bus (required) +device ukbd # Keyboard +device umass # Disks/Mass storage - Requires scbus and da # Sound support -device sound # Generic sound driver (required) -device snd_cmi # CMedia CMI8338/CMI8738 -device snd_csa # Crystal Semiconductor CS461x/428x -device snd_emu10kx # Creative SoundBlaster Live! and Audigy -device snd_es137x # Ensoniq AudioPCI ES137x -device snd_hda # Intel High Definition Audio -device snd_ich # Intel, NVidia and other ICH AC'97 Audio -device snd_via8233 # VIA VT8233x Audio +device sound # Generic sound driver (required) +device snd_cmi # CMedia CMI8338/CMI8738 +device snd_csa # Crystal Semiconductor CS461x/428x +device snd_emu10kx # Creative SoundBlaster Live! and Audigy +device snd_es137x # Ensoniq AudioPCI ES137x +device snd_hda # Intel High Definition Audio +device snd_ich # Intel, NVidia and other ICH AC'97 Audio +device snd_via8233 # VIA VT8233x Audio # MMC/SD -device mmc # MMC/SD bus -device mmcsd # MMC/SD memory card -device sdhci # Generic PCI SD Host Controller +device mmc # MMC/SD bus +device mmcsd # MMC/SD memory card +device sdhci # Generic PCI SD Host Controller # VirtIO support -device virtio # Generic VirtIO bus (required) -device virtio_pci # VirtIO PCI device -device vtnet # VirtIO Ethernet device -device virtio_blk # VirtIO Block device -device virtio_scsi # VirtIO SCSI device -device virtio_balloon # VirtIO Memory Balloon device +device virtio # Generic VirtIO bus (required) +device virtio_pci # VirtIO PCI device +device vtnet # VirtIO Ethernet device +device virtio_blk # VirtIO Block device +device virtio_scsi # VirtIO SCSI device +device virtio_balloon # VirtIO Memory Balloon device # HyperV drivers -device hyperv # HyperV drivers +device hyperv # HyperV drivers # Xen HVM Guest Optimizations # NOTE: XENHVM depends on xenpci. They must be added or removed together. -options XENHVM # Xen HVM kernel infrastructure -device xenpci # Xen HVM Hypervisor services driver +options XENHVM # Xen HVM kernel infrastructure +device xenpci # Xen HVM Hypervisor services driver # VMware support -device vmx # VMware VMXNET3 Ethernet +device vmx # VMware VMXNET3 Ethernet From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 16:39:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF99C8D1; Sun, 16 Mar 2014 16:39:36 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9025AB1D; Sun, 16 Mar 2014 16:39:36 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s2GGdZZQ087492 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 16 Mar 2014 09:39:35 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s2GGdZNd087491; Sun, 16 Mar 2014 09:39:35 -0700 (PDT) (envelope-from jmg) Date: Sun, 16 Mar 2014 09:39:35 -0700 From: John-Mark Gurney To: Robert Watson Subject: Re: svn commit: r263215 - head/sys/crypto/sha2 Message-ID: <20140316163935.GD32089@funkthat.com> References: <201403160057.s2G0vQEh074159@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Sun, 16 Mar 2014 09:39:35 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 16:39:36 -0000 Robert Watson wrote this message on Sun, Mar 16, 2014 at 10:20 +0000: > On Sun, 16 Mar 2014, Robert Watson wrote: > > >> copy these files from lib/libmd in preperation for moving these files > >> into the kernel... > > > >I was sure that there was a sha256 implementation in the kernel already, > >and indeed there is -- in the ZFS code. Having it in the crypto tree > >makes (much) more sense (and I remain surprised it wasn't there already). > >I wonder if this means we can GC at least the copy in the zfs tree (if not > >the boot copy as well). > > Reading the follow-up commit I now understand better. I do wonder if we > can drop the ZFS copy, however -- in general, we seem to prefer FreeBSD > versions of things (e.g., the ACL code) when they are available. Which one are you talking about? If you are talking about the one in sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c, that is just a wrapper around the one I just improved/replaced... If you are talking about the one in sys/cddl/boot/zfs/sha256.c, that, I assume, is part of the boot code, and would require special handling.. plus, boot code doesn't need to run fast, and usually needs to be smaller, though once I add the option of rolling the loops up, we could look at that... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 17:23:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44B7722A; Sun, 16 Mar 2014 17:23:03 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C82B6EB8; Sun, 16 Mar 2014 17:23:02 +0000 (UTC) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1WPEm1-000MQI-0q; Sun, 16 Mar 2014 17:23:00 +0000 Subject: Re: svn commit: r263218 - in head: lib/libcrypt lib/libmd sys/conf sys/crypto/sha2 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Content-Type: multipart/signed; boundary="Apple-Mail=_291B4856-BBEF-4936-BDB4-68428A14E0C2"; protocol="application/pgp-signature"; micalg=pgp-sha512 From: Mark R V Murray In-Reply-To: <201403160143.s2G1hOV8093665@svn.freebsd.org> Date: Sun, 16 Mar 2014 17:24:04 +0000 Message-Id: <08A216A5-BE59-4505-AA13-2B7E026DB56A@grondar.org> References: <201403160143.s2G1hOV8093665@svn.freebsd.org> To: John-Mark Gurney X-Mailer: Apple Mail (2.1874) X-SA-Score: -2.2 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 17:23:03 -0000 --Apple-Mail=_291B4856-BBEF-4936-BDB4-68428A14E0C2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Hi I haven=92t looked at this closely, but if you=92ve dropped support for = sha256, then sys/dev/random/... can=92t use it :-( M On 16 Mar 2014, at 01:43, John-Mark Gurney wrote: > Author: jmg > Date: Sun Mar 16 01:43:23 2014 > New Revision: 263218 > URL: http://svnweb.freebsd.org/changeset/base/263218 >=20 > Log: > replace the kernel's version w/ cperciva's implementation... In all > my tests, it is faster ~20%, even on an old IXP425 533MHz it is ~45% > faster... This is partly due to loop unrolling, so the code size = does > significantly increase... I do plan on committing a version that > rolls up the loops again for smaller code size for embedded systems > where size is more important than absolute performance (it'll save = ~6k > code)... >=20 > The kernel implementation is now shared w/ userland's libcrypt and > libmd... >=20 > We drop support for sha256 from sha2.c, so now sha2.c only contains > sha384 and sha512... >=20 > Reviewed by: secteam@ >=20 > Modified: > head/lib/libcrypt/Makefile > head/lib/libmd/Makefile > head/sys/conf/files > head/sys/crypto/sha2/sha2.c > head/sys/crypto/sha2/sha2.h > head/sys/crypto/sha2/sha256.h > head/sys/crypto/sha2/sha256c.c >=20 > Modified: head/lib/libcrypt/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/lib/libcrypt/Makefile Sun Mar 16 01:22:23 2014 = (r263217) > +++ head/lib/libcrypt/Makefile Sun Mar 16 01:43:23 2014 = (r263218) > @@ -9,7 +9,7 @@ SHLIBDIR?=3D /lib > SHLIB_MAJOR=3D 5 > LIB=3D crypt >=20 > -.PATH: ${.CURDIR}/../libmd > +.PATH: ${.CURDIR}/../libmd = ${.CURDIR}/../../sys/crypto/sha2 > SRCS=3D crypt.c misc.c \ > crypt-md5.c md5c.c \ > crypt-nthash.c md4c.c \ >=20 > Modified: head/lib/libmd/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/lib/libmd/Makefile Sun Mar 16 01:22:23 2014 = (r263217) > +++ head/lib/libmd/Makefile Sun Mar 16 01:43:23 2014 = (r263218) > @@ -43,7 +43,7 @@ CLEANFILES+=3D md[245]hl.c md[245].ref md[ > sha256.ref sha256hl.c sha512.ref sha512hl.c >=20 > CFLAGS+=3D -I${.CURDIR} > -.PATH: ${.CURDIR}/${MACHINE_ARCH} > +.PATH: ${.CURDIR}/${MACHINE_ARCH} ${.CURDIR}/../../sys/crypto/sha2 >=20 > .if exists(${MACHINE_ARCH}/sha.S) > SRCS+=3D sha.S >=20 > Modified: head/sys/conf/files > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/conf/files Sun Mar 16 01:22:23 2014 = (r263217) > +++ head/sys/conf/files Sun Mar 16 01:43:23 2014 = (r263218) > @@ -522,6 +522,8 @@ crypto/sha1.c optional carp | = crypto | > netgraph_mppc_encryption | sctp > crypto/sha2/sha2.c optional crypto | geom_bde | ipsec | = random | \ > sctp | zfs > +crypto/sha2/sha256c.c optional crypto | geom_bde | = ipsec | random | \ > + sctp | zfs > crypto/siphash/siphash.c optional inet | inet6 > crypto/siphash/siphash_test.c optional inet | inet6 > ddb/db_access.c optional ddb >=20 > Modified: head/sys/crypto/sha2/sha2.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/crypto/sha2/sha2.c Sun Mar 16 01:22:23 2014 = (r263217) > +++ head/sys/crypto/sha2/sha2.c Sun Mar 16 01:43:23 2014 = (r263218) > @@ -121,20 +121,10 @@ __FBSDID("$FreeBSD$"); > * Thank you, Jun-ichiro itojun Hagino, for suggesting using u_intXX_t > * types and pointing out recent ANSI C support for uintXX_t in = inttypes.h. > */ > -#if 0 /*def SHA2_USE_INTTYPES_H*/ > - > typedef uint8_t sha2_byte; /* Exactly 1 byte */ > typedef uint32_t sha2_word32; /* Exactly 4 bytes */ > typedef uint64_t sha2_word64; /* Exactly 8 bytes */ >=20 > -#else /* SHA2_USE_INTTYPES_H */ > - > -typedef u_int8_t sha2_byte; /* Exactly 1 byte */ > -typedef u_int32_t sha2_word32; /* Exactly 4 bytes */ > -typedef u_int64_t sha2_word64; /* Exactly 8 bytes */ > - > -#endif /* SHA2_USE_INTTYPES_H */ > - >=20 > /*** SHA-256/384/512 Various Length Definitions = ***********************/ > /* NOTE: Most of these are in sha2.h */ > @@ -183,8 +173,6 @@ typedef u_int64_t sha2_word64; /* Exactl > */ > /* Shift-right (used in SHA-256, SHA-384, and SHA-512): */ > #define R(b,x) ((x) >> (b)) > -/* 32-bit Rotate-right (used in SHA-256): */ > -#define S32(b,x) (((x) >> (b)) | ((x) << (32 - (b)))) > /* 64-bit Rotate-right (used in SHA-384 and SHA-512): */ > #define S64(b,x) (((x) >> (b)) | ((x) << (64 - (b)))) >=20 > @@ -192,12 +180,6 @@ typedef u_int64_t sha2_word64; /* Exactl > #define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z))) > #define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) >=20 > -/* Four of six logical functions used in SHA-256: */ > -#define Sigma0_256(x) (S32(2, (x)) ^ S32(13, (x)) ^ S32(22, = (x))) > -#define Sigma1_256(x) (S32(6, (x)) ^ S32(11, (x)) ^ S32(25, = (x))) > -#define sigma0_256(x) (S32(7, (x)) ^ S32(18, (x)) ^ R(3 , = (x))) > -#define sigma1_256(x) (S32(17, (x)) ^ S32(19, (x)) ^ R(10, = (x))) > - > /* Four of six logical functions used in SHA-384 and SHA-512: */ > #define Sigma0_512(x) (S64(28, (x)) ^ S64(34, (x)) ^ S64(39, (x))) > #define Sigma1_512(x) (S64(14, (x)) ^ S64(18, (x)) ^ S64(41, (x))) > @@ -210,43 +192,10 @@ typedef u_int64_t sha2_word64; /* Exactl > * only. > */ > static void SHA512_Last(SHA512_CTX*); > -static void SHA256_Transform(SHA256_CTX*, const sha2_word32*); > static void SHA512_Transform(SHA512_CTX*, const sha2_word64*); >=20 >=20 > /*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS = ************************/ > -/* Hash constant words K for SHA-256: */ > -static const sha2_word32 K256[64] =3D { > - 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, > - 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, > - 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, > - 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, > - 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, > - 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, > - 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, > - 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, > - 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, > - 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, > - 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, > - 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, > - 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, > - 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, > - 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, > - 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL > -}; > - > -/* Initial hash value H for SHA-256: */ > -static const sha2_word32 sha256_initial_hash_value[8] =3D { > - 0x6a09e667UL, > - 0xbb67ae85UL, > - 0x3c6ef372UL, > - 0xa54ff53aUL, > - 0x510e527fUL, > - 0x9b05688cUL, > - 0x1f83d9abUL, > - 0x5be0cd19UL > -}; > - > /* Hash constant words K for SHA-384 and SHA-512: */ > static const sha2_word64 K512[80] =3D { > 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, > @@ -323,301 +272,6 @@ static const char *sha2_hex_digits =3D "01 >=20 >=20 > /*** SHA-256: = *********************************************************/ > -void SHA256_Init(SHA256_CTX* context) { > - if (context =3D=3D (SHA256_CTX*)0) { > - return; > - } > - bcopy(sha256_initial_hash_value, context->state, = SHA256_DIGEST_LENGTH); > - bzero(context->buffer, SHA256_BLOCK_LENGTH); > - context->bitcount =3D 0; > -} > - > -#ifdef SHA2_UNROLL_TRANSFORM > - > -/* Unrolled SHA-256 round macros: */ > - > -#if BYTE_ORDER =3D=3D LITTLE_ENDIAN > - > -#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ > - REVERSE32(*data++, W256[j]); \ > - T1 =3D (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ > - K256[j] + W256[j]; \ > - (d) +=3D T1; \ > - (h) =3D T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ > - j++ > - > - > -#else /* BYTE_ORDER =3D=3D LITTLE_ENDIAN */ > - > -#define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ > - T1 =3D (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ > - K256[j] + (W256[j] =3D *data++); \ > - (d) +=3D T1; \ > - (h) =3D T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ > - j++ > - > -#endif /* BYTE_ORDER =3D=3D LITTLE_ENDIAN */ > - > -#define ROUND256(a,b,c,d,e,f,g,h) \ > - s0 =3D W256[(j+1)&0x0f]; \ > - s0 =3D sigma0_256(s0); \ > - s1 =3D W256[(j+14)&0x0f]; \ > - s1 =3D sigma1_256(s1); \ > - T1 =3D (h) + Sigma1_256(e) + Ch((e), (f), (g)) + K256[j] + \ > - (W256[j&0x0f] +=3D s1 + W256[(j+9)&0x0f] + s0); \ > - (d) +=3D T1; \ > - (h) =3D T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ > - j++ > - > -static void SHA256_Transform(SHA256_CTX* context, const sha2_word32* = data) { > - sha2_word32 a, b, c, d, e, f, g, h, s0, s1; > - sha2_word32 T1, *W256; > - int j; > - > - W256 =3D (sha2_word32*)context->buffer; > - > - /* Initialize registers with the prev. intermediate value */ > - a =3D context->state[0]; > - b =3D context->state[1]; > - c =3D context->state[2]; > - d =3D context->state[3]; > - e =3D context->state[4]; > - f =3D context->state[5]; > - g =3D context->state[6]; > - h =3D context->state[7]; > - > - j =3D 0; > - do { > - /* Rounds 0 to 15 (unrolled): */ > - ROUND256_0_TO_15(a,b,c,d,e,f,g,h); > - ROUND256_0_TO_15(h,a,b,c,d,e,f,g); > - ROUND256_0_TO_15(g,h,a,b,c,d,e,f); > - ROUND256_0_TO_15(f,g,h,a,b,c,d,e); > - ROUND256_0_TO_15(e,f,g,h,a,b,c,d); > - ROUND256_0_TO_15(d,e,f,g,h,a,b,c); > - ROUND256_0_TO_15(c,d,e,f,g,h,a,b); > - ROUND256_0_TO_15(b,c,d,e,f,g,h,a); > - } while (j < 16); > - > - /* Now for the remaining rounds to 64: */ > - do { > - ROUND256(a,b,c,d,e,f,g,h); > - ROUND256(h,a,b,c,d,e,f,g); > - ROUND256(g,h,a,b,c,d,e,f); > - ROUND256(f,g,h,a,b,c,d,e); > - ROUND256(e,f,g,h,a,b,c,d); > - ROUND256(d,e,f,g,h,a,b,c); > - ROUND256(c,d,e,f,g,h,a,b); > - ROUND256(b,c,d,e,f,g,h,a); > - } while (j < 64); > - > - /* Compute the current intermediate hash value */ > - context->state[0] +=3D a; > - context->state[1] +=3D b; > - context->state[2] +=3D c; > - context->state[3] +=3D d; > - context->state[4] +=3D e; > - context->state[5] +=3D f; > - context->state[6] +=3D g; > - context->state[7] +=3D h; > - > - /* Clean up */ > - a =3D b =3D c =3D d =3D e =3D f =3D g =3D h =3D T1 =3D 0; > -} > - > -#else /* SHA2_UNROLL_TRANSFORM */ > - > -static void SHA256_Transform(SHA256_CTX* context, const sha2_word32* = data) { > - sha2_word32 a, b, c, d, e, f, g, h, s0, s1; > - sha2_word32 T1, T2, *W256; > - int j; > - > - W256 =3D (sha2_word32*)context->buffer; > - > - /* Initialize registers with the prev. intermediate value */ > - a =3D context->state[0]; > - b =3D context->state[1]; > - c =3D context->state[2]; > - d =3D context->state[3]; > - e =3D context->state[4]; > - f =3D context->state[5]; > - g =3D context->state[6]; > - h =3D context->state[7]; > - > - j =3D 0; > - do { > -#if BYTE_ORDER =3D=3D LITTLE_ENDIAN > - /* Copy data while converting to host byte order */ > - REVERSE32(*data++,W256[j]); > - /* Apply the SHA-256 compression function to update a..h = */ > - T1 =3D h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + = W256[j]; > -#else /* BYTE_ORDER =3D=3D LITTLE_ENDIAN */ > - /* Apply the SHA-256 compression function to update a..h = with copy */ > - T1 =3D h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + = (W256[j] =3D *data++); > -#endif /* BYTE_ORDER =3D=3D LITTLE_ENDIAN */ > - T2 =3D Sigma0_256(a) + Maj(a, b, c); > - h =3D g; > - g =3D f; > - f =3D e; > - e =3D d + T1; > - d =3D c; > - c =3D b; > - b =3D a; > - a =3D T1 + T2; > - > - j++; > - } while (j < 16); > - > - do { > - /* Part of the message block expansion: */ > - s0 =3D W256[(j+1)&0x0f]; > - s0 =3D sigma0_256(s0); > - s1 =3D W256[(j+14)&0x0f];=09 > - s1 =3D sigma1_256(s1); > - > - /* Apply the SHA-256 compression function to update a..h = */ > - T1 =3D h + Sigma1_256(e) + Ch(e, f, g) + K256[j] +=20 > - (W256[j&0x0f] +=3D s1 + W256[(j+9)&0x0f] + s0); > - T2 =3D Sigma0_256(a) + Maj(a, b, c); > - h =3D g; > - g =3D f; > - f =3D e; > - e =3D d + T1; > - d =3D c; > - c =3D b; > - b =3D a; > - a =3D T1 + T2; > - > - j++; > - } while (j < 64); > - > - /* Compute the current intermediate hash value */ > - context->state[0] +=3D a; > - context->state[1] +=3D b; > - context->state[2] +=3D c; > - context->state[3] +=3D d; > - context->state[4] +=3D e; > - context->state[5] +=3D f; > - context->state[6] +=3D g; > - context->state[7] +=3D h; > - > - /* Clean up */ > - a =3D b =3D c =3D d =3D e =3D f =3D g =3D h =3D T1 =3D T2 =3D 0; > -} > - > -#endif /* SHA2_UNROLL_TRANSFORM */ > - > -void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t = len) { > - unsigned int freespace, usedspace; > - > - if (len =3D=3D 0) { > - /* Calling with no data is valid - we do nothing */ > - return; > - } > - > - /* Sanity check: */ > - assert(context !=3D (SHA256_CTX*)0 && data !=3D (sha2_byte*)0); > - > - usedspace =3D (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; > - if (usedspace > 0) { > - /* Calculate how much free space is available in the = buffer */ > - freespace =3D SHA256_BLOCK_LENGTH - usedspace; > - > - if (len >=3D freespace) { > - /* Fill the buffer completely and process it */ > - bcopy(data, &context->buffer[usedspace], = freespace); > - context->bitcount +=3D freespace << 3; > - len -=3D freespace; > - data +=3D freespace; > - SHA256_Transform(context, = (sha2_word32*)context->buffer); > - } else { > - /* The buffer is not yet full */ > - bcopy(data, &context->buffer[usedspace], len); > - context->bitcount +=3D len << 3; > - /* Clean up: */ > - usedspace =3D freespace =3D 0; > - return; > - } > - } > - while (len >=3D SHA256_BLOCK_LENGTH) { > - /* Process as many complete blocks as we can */ > - SHA256_Transform(context, (const sha2_word32*)data); > - context->bitcount +=3D SHA256_BLOCK_LENGTH << 3; > - len -=3D SHA256_BLOCK_LENGTH; > - data +=3D SHA256_BLOCK_LENGTH; > - } > - if (len > 0) { > - /* There's left-overs, so save 'em */ > - bcopy(data, context->buffer, len); > - context->bitcount +=3D len << 3; > - } > - /* Clean up: */ > - usedspace =3D freespace =3D 0; > -} > - > -void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { > - sha2_word32 *d =3D (sha2_word32*)digest; > - unsigned int usedspace; > - > - /* Sanity check: */ > - assert(context !=3D (SHA256_CTX*)0); > - > - /* If no digest buffer is passed, we don't bother doing this: */ > - if (digest !=3D (sha2_byte*)0) { > - usedspace =3D (context->bitcount >> 3) % = SHA256_BLOCK_LENGTH; > -#if BYTE_ORDER =3D=3D LITTLE_ENDIAN > - /* Convert FROM host byte order */ > - REVERSE64(context->bitcount,context->bitcount); > -#endif > - if (usedspace > 0) { > - /* Begin padding with a 1 bit: */ > - context->buffer[usedspace++] =3D 0x80; > - > - if (usedspace <=3D SHA256_SHORT_BLOCK_LENGTH) { > - /* Set-up for the last transform: */ > - bzero(&context->buffer[usedspace], = SHA256_SHORT_BLOCK_LENGTH - usedspace); > - } else { > - if (usedspace < SHA256_BLOCK_LENGTH) { > - = bzero(&context->buffer[usedspace], SHA256_BLOCK_LENGTH - usedspace); > - } > - /* Do second-to-last transform: */ > - SHA256_Transform(context, = (sha2_word32*)context->buffer); > - > - /* And set-up for the last transform: */ > - bzero(context->buffer, = SHA256_SHORT_BLOCK_LENGTH); > - } > - } else { > - /* Set-up for the last transform: */ > - bzero(context->buffer, = SHA256_SHORT_BLOCK_LENGTH); > - > - /* Begin padding with a 1 bit: */ > - *context->buffer =3D 0x80; > - } > - /* Set the bit count: */ > - = *(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] =3D = context->bitcount; > - > - /* Final transform: */ > - SHA256_Transform(context, = (sha2_word32*)context->buffer); > - > -#if BYTE_ORDER =3D=3D LITTLE_ENDIAN > - { > - /* Convert TO host byte order */ > - int j; > - for (j =3D 0; j < 8; j++) { > - = REVERSE32(context->state[j],context->state[j]); > - *d++ =3D context->state[j]; > - } > - } > -#else > - bcopy(context->state, d, SHA256_DIGEST_LENGTH); > -#endif > - } > - > - /* Clean up state data: */ > - bzero(context, sizeof(*context)); > - usedspace =3D 0; > -} > - > char *SHA256_End(SHA256_CTX* context, char buffer[]) { > sha2_byte digest[SHA256_DIGEST_LENGTH], *d =3D digest; > int i; > @@ -641,7 +295,7 @@ char *SHA256_End(SHA256_CTX* context, ch > return buffer; > } >=20 > -char* SHA256_Data(const sha2_byte* data, size_t len, char = digest[SHA256_DIGEST_STRING_LENGTH]) { > +char* SHA256_Data(const void *data, unsigned int len, char *digest) { > SHA256_CTX context; >=20 > SHA256_Init(&context); >=20 > Modified: head/sys/crypto/sha2/sha2.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/crypto/sha2/sha2.h Sun Mar 16 01:22:23 2014 = (r263217) > +++ head/sys/crypto/sha2/sha2.h Sun Mar 16 01:43:23 2014 = (r263218) > @@ -56,70 +56,17 @@ extern "C" { > #define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1) >=20 >=20 > -/*** SHA-256/384/512 Context Structures = *******************************/ > -/* NOTE: If your architecture does not define either u_intXX_t types = or > - * uintXX_t (from inttypes.h), you may need to define things by hand > - * for your system: > - */ > -#if 0 > -typedef unsigned char u_int8_t; /* 1-byte (8-bits) */ > -typedef unsigned int u_int32_t; /* 4-bytes (32-bits) */ > -typedef unsigned long long u_int64_t; /* 8-bytes (64-bits) */ > -#endif > -/* > - * Most BSD systems already define u_intXX_t types, as does Linux. > - * Some systems, however, like Compaq's Tru64 Unix instead can use > - * uintXX_t types defined by very recent ANSI C standards and = included > - * in the file: > - * > - * #include > - * > - * If you choose to use then please define:=20 > - * > - * #define SHA2_USE_INTTYPES_H > - * > - * Or on the command line during compile: > - * > - * cc -DSHA2_USE_INTTYPES_H ... > - */ > -#if 0 /*def SHA2_USE_INTTYPES_H*/ > - > -typedef struct _SHA256_CTX { > - uint32_t state[8]; > - uint64_t bitcount; > - uint8_t buffer[SHA256_BLOCK_LENGTH]; > -} SHA256_CTX; > +/*** SHA-384/512 Context Structures *******************************/ > typedef struct _SHA512_CTX { > uint64_t state[8]; > uint64_t bitcount[2]; > uint8_t buffer[SHA512_BLOCK_LENGTH]; > } SHA512_CTX; >=20 > -#else /* SHA2_USE_INTTYPES_H */ > - > -typedef struct _SHA256_CTX { > - u_int32_t state[8]; > - u_int64_t bitcount; > - u_int8_t buffer[SHA256_BLOCK_LENGTH]; > -} SHA256_CTX; > -typedef struct _SHA512_CTX { > - u_int64_t state[8]; > - u_int64_t bitcount[2]; > - u_int8_t buffer[SHA512_BLOCK_LENGTH]; > -} SHA512_CTX; > - > -#endif /* SHA2_USE_INTTYPES_H */ > - > typedef SHA512_CTX SHA384_CTX; >=20 >=20 > -/*** SHA-256/384/512 Function Prototypes = ******************************/ > - > -void SHA256_Init(SHA256_CTX *); > -void SHA256_Update(SHA256_CTX*, const u_int8_t*, size_t); > -void SHA256_Final(u_int8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*); > -char* SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]); > -char* SHA256_Data(const u_int8_t*, size_t, = char[SHA256_DIGEST_STRING_LENGTH]); > +/*** SHA-384/512 Function Prototypes ******************************/ >=20 > void SHA384_Init(SHA384_CTX*); > void SHA384_Update(SHA384_CTX*, const u_int8_t*, size_t); > @@ -137,4 +84,6 @@ char* SHA512_Data(const u_int8_t*, size_ > } > #endif /* __cplusplus */ >=20 > +#include "sha256.h" > + > #endif /* __SHA2_H__ */ >=20 > Modified: head/sys/crypto/sha2/sha256.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/crypto/sha2/sha256.h Sun Mar 16 01:22:23 2014 = (r263217) > +++ head/sys/crypto/sha2/sha256.h Sun Mar 16 01:43:23 2014 = (r263218) > @@ -29,12 +29,14 @@ > #ifndef _SHA256_H_ > #define _SHA256_H_ >=20 > +#ifndef _KERNEL > #include > +#endif >=20 > typedef struct SHA256Context { > uint32_t state[8]; > uint64_t count; > - unsigned char buf[64]; > + uint8_t buf[64]; > } SHA256_CTX; >=20 > __BEGIN_DECLS > @@ -42,9 +44,11 @@ void SHA256_Init(SHA256_CTX *); > void SHA256_Update(SHA256_CTX *, const void *, size_t); > void SHA256_Final(unsigned char [32], SHA256_CTX *); > char *SHA256_End(SHA256_CTX *, char *); > +char *SHA256_Data(const void *, unsigned int, char *); > +#ifndef _KERNEL > char *SHA256_File(const char *, char *); > char *SHA256_FileChunk(const char *, char *, off_t, off_t); > -char *SHA256_Data(const void *, unsigned int, char *); > +#endif > __END_DECLS >=20 > #endif /* !_SHA256_H_ */ >=20 > Modified: head/sys/crypto/sha2/sha256c.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/crypto/sha2/sha256c.c Sun Mar 16 01:22:23 2014 = (r263217) > +++ head/sys/crypto/sha2/sha256c.c Sun Mar 16 01:43:23 2014 = (r263218) > @@ -30,7 +30,11 @@ __FBSDID("$FreeBSD$"); > #include > #include >=20 > +#ifdef _KERNEL > +#include > +#else > #include > +#endif >=20 > #include "sha256.h" >=20 >=20 --=20 Mark R V Murray --Apple-Mail=_291B4856-BBEF-4936-BDB4-68428A14E0C2 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - http://gpgtools.org iQCVAwUBUyXeON58vKOKE6LNAQpzvAP8DBPlA5/9rT6N4jkWuVBhBI4d0YgRRJQg +T+7LFw9UoXHcf2PRFfnIwzUdqQrogp18ihy/d3mfVGn8wTC7uNhRbA7gR5Y20zX TJZF+NptPHo6x3/I3yMrPGHXt/35hedLM/7KrOkOw5FivuN4jW7o93qedH0ZeA0x pMgcrjDBhHU= =3zd4 -----END PGP SIGNATURE----- --Apple-Mail=_291B4856-BBEF-4936-BDB4-68428A14E0C2-- From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 20:21:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 990ED46F; Sun, 16 Mar 2014 20:21:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 86932F58; Sun, 16 Mar 2014 20:21:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GKLfu1045520; Sun, 16 Mar 2014 20:21:41 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GKLfmQ045517; Sun, 16 Mar 2014 20:21:41 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403162021.s2GKLfmQ045517@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Mar 2014 20:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263248 - head/sys/ia64/ia64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 20:21:41 -0000 Author: marcel Date: Sun Mar 16 20:21:40 2014 New Revision: 263248 URL: http://svnweb.freebsd.org/changeset/base/263248 Log: In intr_event_handle() we already save and set td_intr_frame, so don't do it also in ia64_handle_intr(). With ia64_handle_intr() not saving and setting td_intr_frame, make sure to do it for clock interrupts in ia64_ih_clock(). Modified: head/sys/ia64/ia64/clock.c head/sys/ia64/ia64/interrupt.c Modified: head/sys/ia64/ia64/clock.c ============================================================================== --- head/sys/ia64/ia64/clock.c Sun Mar 16 16:33:25 2014 (r263247) +++ head/sys/ia64/ia64/clock.c Sun Mar 16 20:21:40 2014 (r263248) @@ -76,6 +76,7 @@ static u_int ia64_ih_clock(struct thread *td, u_int xiv, struct trapframe *tf) { struct eventtimer *et; + struct trapframe *stf; uint64_t itc, load; uint32_t mode; @@ -96,8 +97,12 @@ ia64_ih_clock(struct thread *td, u_int x ia64_srlz_d(); et = &ia64_clock_et; - if (et->et_active) + if (et->et_active) { + stf = td->td_intr_frame; + td->td_intr_frame = tf; et->et_event_cb(et, et->et_arg); + td->td_intr_frame = stf; + } return (1); } Modified: head/sys/ia64/ia64/interrupt.c ============================================================================== --- head/sys/ia64/ia64/interrupt.c Sun Mar 16 16:33:25 2014 (r263247) +++ head/sys/ia64/ia64/interrupt.c Sun Mar 16 20:21:40 2014 (r263248) @@ -301,7 +301,6 @@ void ia64_handle_intr(struct trapframe *tf) { struct thread *td; - struct trapframe *stf; u_int xiv; td = curthread; @@ -316,9 +315,6 @@ ia64_handle_intr(struct trapframe *tf) } critical_enter(); - stf = td->td_intr_frame; - td->td_intr_frame = tf; - do { CTR2(KTR_INTR, "INTR: ITC=%u, XIV=%u", (u_int)tf->tf_special.ifa, xiv); @@ -329,8 +325,6 @@ ia64_handle_intr(struct trapframe *tf) xiv = ia64_get_ivr(); ia64_srlz_d(); } while (xiv != 15); - - td->td_intr_frame = stf; critical_exit(); out: From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 20:31:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55DD366F; Sun, 16 Mar 2014 20:31:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4439812; Sun, 16 Mar 2014 20:31:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GKV6v2047736; Sun, 16 Mar 2014 20:31:06 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GKV6KV047735; Sun, 16 Mar 2014 20:31:06 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201403162031.s2GKV6KV047735@svn.freebsd.org> From: Antoine Brodin Date: Sun, 16 Mar 2014 20:31:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263249 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 20:31:06 -0000 Author: antoine Date: Sun Mar 16 20:31:05 2014 New Revision: 263249 URL: http://svnweb.freebsd.org/changeset/base/263249 Log: Add more obsolete files Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Mar 16 20:21:40 2014 (r263248) +++ head/ObsoleteFiles.inc Sun Mar 16 20:31:05 2014 (r263249) @@ -75,7 +75,10 @@ OLD_FILES+=usr/share/man/man3/ipx_ntoa.3 OLD_FILES+=usr/share/man/man4/ef.4.gz OLD_FILES+=usr/share/man/man4/if_ef.4.gz OLD_FILES+=usr/share/man/man8/IPXrouted.8.gz - +# 20140314: bsdconfig usermgmt rewrite +OLD_FILES+=usr/libexec/bsdconfig/070.usermgmt/userinput +# 20140307: bsdconfig groupmgmt rewrite +OLD_FILES+=usr/libexec/bsdconfig/070.usermgmt/groupinput # 20140223: Remove libyaml OLD_FILES+=usr/lib/private/libyaml.a OLD_FILES+=usr/lib/private/libyaml.so @@ -118,6 +121,9 @@ OLD_FILES+=usr/include/clang/3.3/xopintr OLD_FILES+=usr/share/man/man1/llvm-prof.1.gz OLD_FILES+=usr/share/man/man1/llvm-ranlib.1.gz OLD_DIRS+=usr/include/clang/3.3 +# 20140216: nve(4) removed +OLD_FILES+=usr/share/man/man4/if_nve.4.gz +OLD_FILES+=usr/share/man/man4/nve.4.gz # 20140205: Open Firmware device moved OLD_FILES+=usr/include/dev/ofw/ofw_nexus.h # 20140128: libelf and libdwarf import From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 20:34:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1301852; Sun, 16 Mar 2014 20:34:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E7307F; Sun, 16 Mar 2014 20:34:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GKYjVH050674; Sun, 16 Mar 2014 20:34:45 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GKYjXV050673; Sun, 16 Mar 2014 20:34:45 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403162034.s2GKYjXV050673@svn.freebsd.org> From: Ian Lepore Date: Sun, 16 Mar 2014 20:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263250 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 20:34:45 -0000 Author: ian Date: Sun Mar 16 20:34:45 2014 New Revision: 263250 URL: http://svnweb.freebsd.org/changeset/base/263250 Log: Use the same terminology as the ARM docs in comments. No functional changes. Modified: head/sys/arm/arm/cpufunc_asm_armv7.S Modified: head/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_armv7.S Sun Mar 16 20:31:05 2014 (r263249) +++ head/sys/arm/arm/cpufunc_asm_armv7.S Sun Mar 16 20:34:45 2014 (r263250) @@ -84,10 +84,10 @@ END(armv7_setttb) ENTRY(armv7_tlb_flushID) dsb #ifdef SMP - mcr p15, 0, r0, c8, c3, 0 /* flush I+D tlb */ - mcr p15, 0, r0, c7, c1, 6 /* flush BTB */ + mcr p15, 0, r0, c8, c3, 0 /* flush Unified TLB all entries Inner Shareable */ + mcr p15, 0, r0, c7, c1, 6 /* flush BTB Inner Shareable */ #else - mcr p15, 0, r0, c8, c7, 0 /* flush I+D tlb */ + mcr p15, 0, r0, c8, c7, 0 /* flush Unified TLB all entries */ mcr p15, 0, r0, c7, c5, 6 /* flush BTB */ #endif dsb @@ -99,10 +99,10 @@ ENTRY(armv7_tlb_flushID_SE) ldr r1, .Lpage_mask bic r0, r0, r1 #ifdef SMP - mcr p15, 0, r0, c8, c3, 3 /* flush D tlb single entry Inner Shareable*/ + mcr p15, 0, r0, c8, c3, 3 /* flush Unified TLB single entry Inner Shareable */ mcr p15, 0, r0, c7, c1, 6 /* flush BTB Inner Shareable */ #else - mcr p15, 0, r0, c8, c7, 1 /* flush D tlb single entry */ + mcr p15, 0, r0, c8, c7, 1 /* flush Unified TLB single entry */ mcr p15, 0, r0, c7, c5, 6 /* flush BTB */ #endif dsb From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 20:36:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E55DB5F; Sun, 16 Mar 2014 20:36:02 +0000 (UTC) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B836C9C; Sun, 16 Mar 2014 20:36:01 +0000 (UTC) Received: from dynamic.1.17.e8edf383af80.685b35818d2c.afb.bredband2.com (dynamic.1.17.e8edf383af80.685b35818d2c.afb.bredband2.com [31.208.68.40]) by mrelayeu.kundenserver.de (node=mreue104) with ESMTP (Nemesis) id 0M0RJt-1XHevE24WD-00uXvh; Sun, 16 Mar 2014 21:35:53 +0100 Message-ID: <53260B26.1090407@FreeBSD.org> Date: Sun, 16 Mar 2014 21:35:50 +0100 From: Christian Brueffer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Antoine Brodin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r263249 - head References: <201403162031.s2GKV6KV047735@svn.freebsd.org> In-Reply-To: <201403162031.s2GKV6KV047735@svn.freebsd.org> X-Enigmail-Version: 1.6 OpenPGP: id=3A67DC36; url=http://people.freebsd.org/~brueffer/brueffer.key.asc Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Kp3SVKkH4rdW21U8V6XhRkKA8OriCcF3x" X-Provags-ID: V02:K0:CuCEBNZXmQcfVAcyiKWBKiL8WBaR9iu2mdL8Wwk5wDX bEtDGTgWVMKFEpJ3Mqy6nInQk7U7pEtp963ftFUcpmFGOv5Ife UTCWbpYDaqqVSLpV4s+w8RD3LWuBEIkg23huEkmXtJswDUPFik ccxKBDZ2ZHy+yF5zlC+rrIIaay/WcdQx6PiMXmFEjii2U1vG94 sSWS9//HRS0KVREUg4L7cpbGmKO4teiYhhGBbKt3Rs5Kxdmldr YS0U1O/4NyBMU/sEH580WCPysptSRqYvxVyLoCjCF/s4VUIO/Q KhMEioFUuONoVQn4Yhc7Io03vC4e5Og5cR2aQJNU02Bef8Wlp6 bFVapGLaZL6seOr218i7spDSyxzkFvYQS9tGCqUNzC8BIoV79+ FQUWpt0tiyJaw7Cg4A8PJodR+6NhOiZlNMR6TMV5MWuuKfVUhS 7rhfT X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 20:36:02 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Kp3SVKkH4rdW21U8V6XhRkKA8OriCcF3x Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 3/16/14 9:31 PM, Antoine Brodin wrote: > Author: antoine > Date: Sun Mar 16 20:31:05 2014 > New Revision: 263249 > URL: http://svnweb.freebsd.org/changeset/base/263249 >=20 > Log: > Add more obsolete files >=20 > Modified: > head/ObsoleteFiles.inc >=20 > Modified: head/ObsoleteFiles.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/ObsoleteFiles.inc Sun Mar 16 20:21:40 2014 (r263248) > +++ head/ObsoleteFiles.inc Sun Mar 16 20:31:05 2014 (r263249) > @@ -75,7 +75,10 @@ OLD_FILES+=3Dusr/share/man/man3/ipx_ntoa.3 > OLD_FILES+=3Dusr/share/man/man4/ef.4.gz > OLD_FILES+=3Dusr/share/man/man4/if_ef.4.gz > OLD_FILES+=3Dusr/share/man/man8/IPXrouted.8.gz > - > +# 20140314: bsdconfig usermgmt rewrite > +OLD_FILES+=3Dusr/libexec/bsdconfig/070.usermgmt/userinput > +# 20140307: bsdconfig groupmgmt rewrite > +OLD_FILES+=3Dusr/libexec/bsdconfig/070.usermgmt/groupinput > # 20140223: Remove libyaml > OLD_FILES+=3Dusr/lib/private/libyaml.a > OLD_FILES+=3Dusr/lib/private/libyaml.so > @@ -118,6 +121,9 @@ OLD_FILES+=3Dusr/include/clang/3.3/xopintr > OLD_FILES+=3Dusr/share/man/man1/llvm-prof.1.gz > OLD_FILES+=3Dusr/share/man/man1/llvm-ranlib.1.gz > OLD_DIRS+=3Dusr/include/clang/3.3 > +# 20140216: nve(4) removed > +OLD_FILES+=3Dusr/share/man/man4/if_nve.4.gz > +OLD_FILES+=3Dusr/share/man/man4/nve.4.gz > # 20140205: Open Firmware device moved > OLD_FILES+=3Dusr/include/dev/ofw/ofw_nexus.h > # 20140128: libelf and libdwarf import >=20 The nve(4) stuff was in my initial patchset, not sure why it wasn't part of the actual commit... Thanks for catching this! Chris --Kp3SVKkH4rdW21U8V6XhRkKA8OriCcF3x Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQJ8BAEBCgBmBQJTJgsoXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ5QzhCQjQ5MDgzNDUwNjkyOUM5Mjg2NDE3 OEM4MzY5ODQ3RTE2NDg3AAoJEHjINphH4WSHZfAQAI7LzrOFd1jDhyg1L5GrkDl/ AmTchdRkboxwa+ltQKeCSn3yC8tEvdawbfag9VgZGGVdJxZsnap/PsOywfnyhHKj 0+io0FOnnJo5F4vWsvoSnVEnL5xRlVslAu87n/VQ9WLonIR+n2ma+Te8bU11gYEl epbjZBrbUm1EY/JDnpHvdfjT5+tjmbhP0aCvrp0Vk3FnIOYeshiUWLcmfT+W1U6D JVKcClcBp5i0icX+S0JMefzS/Sbpjv+wUTrHSgX0aA9Z1UPa+w+z/qPqNVPY5Qlt Exo/4073ChjfFLGkJqhBtYKapWp0BTaUUQFUY8W0Tfu5tZ/4PvuV1eWKN8lTLVx9 X+4tto9USzgFAgxM7yKkWlswwFV7Pyow/FW8CD+K0Wb7/DBnB92Gbze++zqSyhUm vXlhdDfbtKUbEduJBCiuTJxePJjWXoDhoC5NB6Y7jbr8pwntPlVD5rgx/QM5is9E ygv7K4O94zw423BT21dx027iB7Vw2CE5n/Ye2OU+ixizsGS9W5nwL3n2zu79fmtV f/tYSYeDjJ7AL5fYHHkSR29KrAfRF7w9/FCuxwff7bpXk9142q/ZBrIAomk9fMPW yiJtlN9psFa2nxNlN5EWvMluSvpSjnfWtKLsxMSp+8EbQFBEBJccQidZ63Ba8OmE bNdm+gtbz0QA563Ezk13 =mm6f -----END PGP SIGNATURE----- --Kp3SVKkH4rdW21U8V6XhRkKA8OriCcF3x-- From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 20:39:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0CDFDC9; Sun, 16 Mar 2014 20:39:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E891110; Sun, 16 Mar 2014 20:39:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GKddu5051325; Sun, 16 Mar 2014 20:39:39 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GKdd4A051324; Sun, 16 Mar 2014 20:39:39 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403162039.s2GKdd4A051324@svn.freebsd.org> From: Ian Lepore Date: Sun, 16 Mar 2014 20:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263251 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 20:39:39 -0000 Author: ian Date: Sun Mar 16 20:39:39 2014 New Revision: 263251 URL: http://svnweb.freebsd.org/changeset/base/263251 Log: Use armv7 TLB flush code, not arm11, for cortex-a processors. The armv7 architecture uses a unified TLB model for maintenence ops even if separate instruction and data TLBs are implemented in hardware. That means that there's no distinction between the 'I' and 'D' flavors of flush, they all use the same 'ID' implementation. On the other hand, there is a difference between SMP and UP on armv7, but not on arm11, so use the armv7 routines for cortex-a processors. Modified: head/sys/arm/arm/cpufunc.c Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Sun Mar 16 20:34:45 2014 (r263250) +++ head/sys/arm/arm/cpufunc.c Sun Mar 16 20:39:39 2014 (r263251) @@ -754,14 +754,18 @@ struct cpu_functions cortexa_cpufuncs = cpufunc_faultstatus, /* Faultstatus */ cpufunc_faultaddress, /* Faultaddress */ - /* TLB functions */ + /* + * TLB functions. ARMv7 does all TLB ops based on a unified TLB model + * whether the hardware implements separate I+D or not, so we use the + * same 'ID' functions for all 3 variations. + */ armv7_tlb_flushID, /* tlb_flushID */ armv7_tlb_flushID_SE, /* tlb_flushID_SE */ - arm11_tlb_flushI, /* tlb_flushI */ - arm11_tlb_flushI_SE, /* tlb_flushI_SE */ - arm11_tlb_flushD, /* tlb_flushD */ - arm11_tlb_flushD_SE, /* tlb_flushD_SE */ + armv7_tlb_flushID, /* tlb_flushI */ + armv7_tlb_flushID_SE, /* tlb_flushI_SE */ + armv7_tlb_flushID, /* tlb_flushD */ + armv7_tlb_flushID_SE, /* tlb_flushD_SE */ /* Cache operations */ From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 21:05:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F028E423; Sun, 16 Mar 2014 21:05:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE2AF326; Sun, 16 Mar 2014 21:05:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GL50UC064273; Sun, 16 Mar 2014 21:05:00 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GL50QJ064272; Sun, 16 Mar 2014 21:05:00 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201403162105.s2GL50QJ064272@svn.freebsd.org> From: Robert Watson Date: Sun, 16 Mar 2014 21:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263252 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 21:05:01 -0000 Author: rwatson Date: Sun Mar 16 21:05:00 2014 New Revision: 263252 URL: http://svnweb.freebsd.org/changeset/base/263252 Log: Fix a comment in capability.h: it got renamed to capsicum.h, not capability.h. MFC after: 3 weeks Spotted by: alc, mcdouga9 at egr.msu.edu, thompsa Modified: head/sys/sys/capability.h Modified: head/sys/sys/capability.h ============================================================================== --- head/sys/sys/capability.h Sun Mar 16 20:39:39 2014 (r263251) +++ head/sys/sys/capability.h Sun Mar 16 21:05:00 2014 (r263252) @@ -32,7 +32,7 @@ /* * Historically, the key userspace and kernel Capsicum definitions were found * in this file. However, it conflicted with POSIX.1e's capability.h, so has - * been renamed capability.h. The file remains for backwards compatibility + * been renamed capsicum.h. The file remains for backwards compatibility * reasons as a nested include. */ #ifndef _SYS_CAPABILITY_H_ From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 21:15:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83954741; Sun, 16 Mar 2014 21:15:10 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5DF455E5; Sun, 16 Mar 2014 21:15:10 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s2GLF2P9090879 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 16 Mar 2014 14:15:03 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s2GLF2OH090878; Sun, 16 Mar 2014 14:15:02 -0700 (PDT) (envelope-from jmg) Date: Sun, 16 Mar 2014 14:15:02 -0700 From: John-Mark Gurney To: Mark R V Murray Subject: Re: svn commit: r263218 - in head: lib/libcrypt lib/libmd sys/conf sys/crypto/sha2 Message-ID: <20140316211501.GE32089@funkthat.com> References: <201403160143.s2G1hOV8093665@svn.freebsd.org> <08A216A5-BE59-4505-AA13-2B7E026DB56A@grondar.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <08A216A5-BE59-4505-AA13-2B7E026DB56A@grondar.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Sun, 16 Mar 2014 14:15:03 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 21:15:10 -0000 Mark Murray wrote this message on Sun, Mar 16, 2014 at 17:24 +0000: > I haven?t looked at this closely, but if you?ve dropped support for sha256, then sys/dev/random/... can?t use it :-( Please read closer... To many things would break if sha256 was really removed... > On 16 Mar 2014, at 01:43, John-Mark Gurney wrote: > > replace the kernel's version w/ cperciva's implementation... In all > > my tests, it is faster ~20%, even on an old IXP425 533MHz it is ~45% > > faster... This is partly due to loop unrolling, so the code size does > > significantly increase... I do plan on committing a version that > > rolls up the loops again for smaller code size for embedded systems > > where size is more important than absolute performance (it'll save ~6k > > code)... > > > > The kernel implementation is now shared w/ userland's libcrypt and > > libmd... > > > > We drop support for sha256 from sha2.c, so now sha2.c only contains > > sha384 and sha512... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 21:57:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A5C9B34; Sun, 16 Mar 2014 21:57:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2730C99E; Sun, 16 Mar 2014 21:57:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GLv6AP085765; Sun, 16 Mar 2014 21:57:06 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GLv5N4085763; Sun, 16 Mar 2014 21:57:05 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403162157.s2GLv5N4085763@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Mar 2014 21:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263253 - head/sys/ia64/ia64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 21:57:06 -0000 Author: marcel Date: Sun Mar 16 21:57:05 2014 New Revision: 263253 URL: http://svnweb.freebsd.org/changeset/base/263253 Log: Don't use the ITC as the faulting address for external interrupts. We only use it for tracing and the KTR infrastructure will use ITC for the time-stamp. Modified: head/sys/ia64/ia64/exception.S head/sys/ia64/ia64/interrupt.c Modified: head/sys/ia64/ia64/exception.S ============================================================================== --- head/sys/ia64/ia64/exception.S Sun Mar 16 21:05:00 2014 (r263252) +++ head/sys/ia64/ia64/exception.S Sun Mar 16 21:57:05 2014 (r263253) @@ -1388,7 +1388,7 @@ IVT_END(Break_Instruction) IVT_ENTRY(External_Interrupt, 0x3000) { .mib - mov r17=ar.itc // Put the ITC in the trapframe. + mov r17=0 mov r16=ip br.sptk exception_save ;; Modified: head/sys/ia64/ia64/interrupt.c ============================================================================== --- head/sys/ia64/ia64/interrupt.c Sun Mar 16 21:05:00 2014 (r263252) +++ head/sys/ia64/ia64/interrupt.c Sun Mar 16 21:57:05 2014 (r263253) @@ -316,8 +316,8 @@ ia64_handle_intr(struct trapframe *tf) critical_enter(); do { - CTR2(KTR_INTR, "INTR: ITC=%u, XIV=%u", - (u_int)tf->tf_special.ifa, xiv); + CTR3(KTR_INTR, "INTR: XIV=%u, #%u: frame=%p", xiv, + PCPU_GET(cnt.v_intr), tf); if (!(ia64_handler[xiv])(td, xiv, tf)) { ia64_set_eoi(0); ia64_srlz_d(); From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 22:56:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D96A8449; Sun, 16 Mar 2014 22:56:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C5899DDB; Sun, 16 Mar 2014 22:56:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2GMuM29010183; Sun, 16 Mar 2014 22:56:22 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2GMuMeG010181; Sun, 16 Mar 2014 22:56:22 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403162256.s2GMuMeG010181@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Mar 2014 22:56:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263254 - in head/sys/ia64: ia64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 22:56:22 -0000 Author: marcel Date: Sun Mar 16 22:56:22 2014 New Revision: 263254 URL: http://svnweb.freebsd.org/changeset/base/263254 Log: Move the implementation of kdb_cpu_trap() from to machdep.c. This makes it easier to add conditional code based on options. Modified: head/sys/ia64/ia64/machdep.c head/sys/ia64/include/kdb.h Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Sun Mar 16 21:57:05 2014 (r263253) +++ head/sys/ia64/ia64/machdep.c Sun Mar 16 22:56:22 2014 (r263254) @@ -86,6 +86,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -562,6 +563,18 @@ spinlock_exit(void) } void +kdb_cpu_trap(int vector, int code __unused) +{ + + __asm __volatile("flushrs;;"); + + /* Restart after the break instruction. */ + if (vector == IA64_VEC_BREAK && + kdb_frame->tf_special.ifa == IA64_FIXED_BREAK) + kdb_frame->tf_special.psr += IA64_PSR_RI_1; +} + +void map_vhpt(uintptr_t vhpt) { pt_entry_t pte; Modified: head/sys/ia64/include/kdb.h ============================================================================== --- head/sys/ia64/include/kdb.h Sun Mar 16 21:57:05 2014 (r263253) +++ head/sys/ia64/include/kdb.h Sun Mar 16 22:56:22 2014 (r263254) @@ -35,6 +35,8 @@ #define KDB_STOPPEDPCB(pc) (&(pc)->pc_md.pcb) +void kdb_cpu_trap(int, int); + static __inline void kdb_cpu_clear_singlestep(void) { @@ -62,14 +64,4 @@ kdb_cpu_sync_icache(unsigned char *addr, } } -static __inline void -kdb_cpu_trap(int vector, int _) -{ - __asm __volatile("flushrs;;"); - - if (vector == IA64_VEC_BREAK && - kdb_frame->tf_special.ifa == IA64_FIXED_BREAK) - kdb_frame->tf_special.psr += IA64_PSR_RI_1; -} - #endif /* _MACHINE_KDB_H_ */ From owner-svn-src-head@FreeBSD.ORG Sun Mar 16 23:14:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 773F689E; Sun, 16 Mar 2014 23:14:19 +0000 (UTC) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 35C7CF52; Sun, 16 Mar 2014 23:14:18 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 755E7D44B3F; Mon, 17 Mar 2014 10:14:17 +1100 (EST) Date: Mon, 17 Mar 2014 10:14:14 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh Subject: Re: svn commit: r263246 - in head/sys: amd64/conf i386/conf In-Reply-To: <201403161522.s2GFMrBD025427@svn.freebsd.org> Message-ID: <20140317100304.Q1131@besplex.bde.org> References: <201403161522.s2GFMrBD025427@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=fbeUlSgF c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=7CtZVUGXL_QA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=zKlxM0aeT84R1zlGm0AA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 23:14:19 -0000 On Sun, 16 Mar 2014, Warner Losh wrote: > Log: > Align all comments in config files on same column. This consistency > helps when bits and pieces of GENERIC from i386 or amd64 are cut and > pasted into other architecture's config files (which in the case of > ARM had gotten rather akimbo). Indentation of comments on device lines was not quite right, but this breaks the formatting further by blindly indenting without changing the comments, so that some lines are now too long. > Modified: head/sys/amd64/conf/GENERIC > ============================================================================== > --- head/sys/amd64/conf/GENERIC Sun Mar 16 15:22:46 2014 (r263245) > +++ head/sys/amd64/conf/GENERIC Sun Mar 16 15:22:52 2014 (r263246) > @@ -70,7 +70,7 @@ options MAC # TrustedBSD MAC Framewor > options KDTRACE_FRAME # Ensure frames are compiled in > options KDTRACE_HOOKS # Kernel DTrace hooks > options DDB_CTF # Kernel ELF linker loads CTF data > -options INCLUDE_CONFIG_FILE # Include this file in kernel > +options INCLUDE_CONFIG_FILE # Include this file in kernel > > # Debugging support. Always need this: > options KDB # Enable kernel debugger support. Comments on options lines lived for longer with indentation to column 40, so they are mostly carefully written to be not too long. > @@ -100,253 +100,253 @@ device pci > device fdc > > # ATA controllers > -device ahci # AHCI-compatible SATA controllers > -device ata # Legacy ATA/SATA controllers > -options ATA_STATIC_ID # Static device numbering > -device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA > -device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA > +device ahci # AHCI-compatible SATA controllers > +device ata # Legacy ATA/SATA controllers > +options ATA_STATIC_ID # Static device numbering > +device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA > +device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA Too long by 3 or 4 characters (83 columns). Too long by 11 or 12 characters when quoting in mail adds a prefix. Too long by 11 or 12 characters when commenting out adds a prefix of '# ', although an uglier prefix of '#' doesn't cause the extra indentation. When globally reformatting device lines, they should be more carefully formatted with spaces, like options lines are, so that commenting them out works better. The best formatting for this seems to be 'device'. For options lines, we use 'options'. 2 spaces instead of 1 are needed after the keyword to reach the first tab stop. The density of device lines that were of length >= 72 is not very high, but there are so many device lines that it is painful just to read them all. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 01:49:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBB18137 for ; Mon, 17 Mar 2014 01:49:28 +0000 (UTC) Received: from mail-qc0-x22b.google.com (mail-qc0-x22b.google.com [IPv6:2607:f8b0:400d:c01::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 860BBCF9 for ; Mon, 17 Mar 2014 01:49:28 +0000 (UTC) Received: by mail-qc0-f171.google.com with SMTP id x13so5321507qcv.30 for ; Sun, 16 Mar 2014 18:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=ISPp4jEX71K+OKo5s6eFe0rXV+/u180KbZ157yh/LB0=; b=AAj5Vj5zsgYhElFOxKW7uvPNjkIt9t3wUtZqRjBxcDjTZUkZW0qwCu0Y1KOgyWBcMY GBAtImE5PgX94Vraz2v2fKVJHVqBIJsJtILxsvDiIdUEhqoQ/+y8gdSwiQ2uvoF3lOvQ v1np1atwezkO8tUKR5PJDW//jkQdnWs3D8mZ4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=ISPp4jEX71K+OKo5s6eFe0rXV+/u180KbZ157yh/LB0=; b=mEVUBDWpaU4wdX6HasZUJ2g5O5Nf2bzzHTB49eVSWO6v54yXiajBPdsgiKSyMptVZa 1OIMeO6662eNM7bNhZZtqw9c/A5/JPkfn8dn2DGi8o5y4oWOpq7BMcuedB+xmADm5JLz 5Dgx9bkmqQF2G3dswIvMBcwYmWXWLAS9Dti6+9gBIUyc8CIW0c5dyaC9TgT0EDLcpVWN c+AbuaNIH8He1WyOXpGupeFoPB/acfqIpnuLFUN45O1d0/a+vjlC8RncW8gTlC7cQYsv hxy2PIB8JcWEdeo7PZpSMKUTBMbvycXd6hGK+HGKGDc5X9ObeyuoxPs0XJ/pbay/1CEC 1/jA== X-Gm-Message-State: ALoCoQlb+psGTWAA5nMUV/7/okQBHamcv2euobdHpTAtDur5iCWAzxnDMnHcSTpi1HW0GMOFyDsU X-Received: by 10.140.94.68 with SMTP id f62mr23637806qge.64.1395020967674; Sun, 16 Mar 2014 18:49:27 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.147.225 with HTTP; Sun, 16 Mar 2014 18:48:57 -0700 (PDT) In-Reply-To: <201403162105.s2GL50QJ064272@svn.freebsd.org> References: <201403162105.s2GL50QJ064272@svn.freebsd.org> From: Eitan Adler Date: Sun, 16 Mar 2014 21:48:57 -0400 X-Google-Sender-Auth: RKoT9kQX_ZXu3LwHJr3UOiwuboQ Message-ID: Subject: Re: svn commit: r263252 - head/sys/sys To: Robert Watson Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 01:49:28 -0000 On 16 March 2014 17:05, Robert Watson wrote: > Author: rwatson > Date: Sun Mar 16 21:05:00 2014 > New Revision: 263252 > URL: http://svnweb.freebsd.org/changeset/base/263252 > > Log: > Fix a comment in capability.h: it got renamed to capsicum.h, not > capability.h. Perhaps it makes to sense to add a #warning statement to the file as well? Additionally, is it intended that this file live forever or will be removed as some point in the future? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 04:38:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36CC9B1C; Mon, 17 Mar 2014 04:38:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2541FC9C; Mon, 17 Mar 2014 04:38:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2H4cAAW048342; Mon, 17 Mar 2014 04:38:10 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2H4cA9X048341; Mon, 17 Mar 2014 04:38:10 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403170438.s2H4cA9X048341@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 17 Mar 2014 04:38:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263257 - head/sys/ia64/ia64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 04:38:11 -0000 Author: marcel Date: Mon Mar 17 04:38:10 2014 New Revision: 263257 URL: http://svnweb.freebsd.org/changeset/base/263257 Log: In intr_event_handle() we already save and set td_intr_frame, so don't do it also in ia64_handle_intr(). With ia64_handle_intr() not saving and setting td_intr_frame, make sure to do it for timer interrupts in ia64_ih_hardclock(). Modified: head/sys/ia64/ia64/mp_machdep.c Modified: head/sys/ia64/ia64/mp_machdep.c ============================================================================== --- head/sys/ia64/ia64/mp_machdep.c Mon Mar 17 02:14:13 2014 (r263256) +++ head/sys/ia64/ia64/mp_machdep.c Mon Mar 17 04:38:10 2014 (r263257) @@ -113,10 +113,14 @@ ia64_ih_ast(struct thread *td, u_int xiv static u_int ia64_ih_hardclock(struct thread *td, u_int xiv, struct trapframe *tf) { + struct trapframe *stf; PCPU_INC(md.stats.pcs_nhardclocks); CTR1(KTR_SMP, "IPI_HARDCLOCK, cpuid=%d", PCPU_GET(cpuid)); + stf = td->td_intr_frame; + td->td_intr_frame = tf; hardclockintr(); + td->td_intr_frame = stf; return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 05:45:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A1D72E8; Mon, 17 Mar 2014 05:45:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0552D279; Mon, 17 Mar 2014 05:45:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2H5jTYh076020; Mon, 17 Mar 2014 05:45:29 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2H5jTZT076017; Mon, 17 Mar 2014 05:45:29 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201403170545.s2H5jTZT076017@svn.freebsd.org> From: Bryan Venteicher Date: Mon, 17 Mar 2014 05:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263259 - in head: share/man/man4 sys/dev/vmware/vmxnet3 sys/modules/vmware/vmxnet3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 05:45:30 -0000 Author: bryanv Date: Mon Mar 17 05:45:29 2014 New Revision: 263259 URL: http://svnweb.freebsd.org/changeset/base/263259 Log: Add Tx/Rx multiqueue support to vmx(4) As a prerequisite for multiple queues, the guest must have MSIX enabled. Unfortunately, to work around device passthrough bugs, FreeBSD disables MSIX when running as a VMWare guest due to the hw.pci.honor_msi_blacklist tunable; this tunable must be disabled for multiple queues. Also included is various minor changes from the projects/vmxnet branch. MFC after: 1 month Modified: head/share/man/man4/vmx.4 head/sys/dev/vmware/vmxnet3/if_vmx.c head/sys/dev/vmware/vmxnet3/if_vmxreg.h head/sys/dev/vmware/vmxnet3/if_vmxvar.h head/sys/modules/vmware/vmxnet3/Makefile Modified: head/share/man/man4/vmx.4 ============================================================================== --- head/share/man/man4/vmx.4 Mon Mar 17 05:03:53 2014 (r263258) +++ head/share/man/man4/vmx.4 Mon Mar 17 05:45:29 2014 (r263259) @@ -81,12 +81,35 @@ VMware Fusion 2.0 and newer .Pp For more information on configuring this device, see .Xr ifconfig 8 . +.Sh MULTIPLE QUEUES +The +.Nm +driver supports multiple transmit and receive queues. +Multiple queues are only supported by certain VMware products, such as ESXi. +The number of queues allocated depends on the presence of MSI-X, +the number of configured CPUs, +and the tunables listed below. +.Fx +does not enable MSI-X support on VMware by default. +The +.Va hw.pci.honor_msi_blacklist +tunable must be disabled to enable MSI-X support. .Sh LOADER TUNABLES Tunables can be set at the .Xr loader 8 prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width indent +.It Va hw.vmx.txnqueue +.It Va hw.vmx. Ns Ar X Ns Va .txnqueue +Maximum number of transmit queues allocated by default by the driver. +The default value is 8. +The maximum supported by the VMXNET3 virtual NIC is 8. +.It Va hw.vmx.rxnqueue +.It Va hw.vmx. Ns Ar X Ns Va .rxnqueue +Maximum number of receive queues allocated by default by the driver. +The default value is 8. +The maximum supported by the VMXNET3 virtual NIC is 16. .It Va hw.vmx.txndesc .It Va hw.vmx. Ns Ar X Ns Va .txndesc .Pp Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmx.c Mon Mar 17 05:03:53 2014 (r263258) +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Mon Mar 17 05:45:29 2014 (r263259) @@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -69,9 +71,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -/* Always enable for now - useful for queue hangs. */ -#define VMXNET3_DEBUG_SYSCTL - #ifdef VMXNET3_FAILPOINTS #include static SYSCTL_NODE(DEBUG_FP, OID_AUTO, vmxnet3, CTLFLAG_RW, 0, @@ -88,6 +87,7 @@ static int vmxnet3_alloc_resources(struc static void vmxnet3_free_resources(struct vmxnet3_softc *); static int vmxnet3_check_version(struct vmxnet3_softc *); static void vmxnet3_initial_config(struct vmxnet3_softc *); +static void vmxnet3_check_multiqueue(struct vmxnet3_softc *); static int vmxnet3_alloc_msix_interrupts(struct vmxnet3_softc *); static int vmxnet3_alloc_msi_interrupts(struct vmxnet3_softc *); @@ -104,6 +104,13 @@ static void vmxnet3_free_interrupt(struc struct vmxnet3_interrupt *); static void vmxnet3_free_interrupts(struct vmxnet3_softc *); +#ifndef VMXNET3_LEGACY_TX +static int vmxnet3_alloc_taskqueue(struct vmxnet3_softc *); +static void vmxnet3_start_taskqueue(struct vmxnet3_softc *); +static void vmxnet3_drain_taskqueue(struct vmxnet3_softc *); +static void vmxnet3_free_taskqueue(struct vmxnet3_softc *); +#endif + static int vmxnet3_init_rxq(struct vmxnet3_softc *, int); static int vmxnet3_init_txq(struct vmxnet3_softc *, int); static int vmxnet3_alloc_rxtx_queues(struct vmxnet3_softc *); @@ -122,6 +129,7 @@ static void vmxnet3_free_queue_data(stru static int vmxnet3_alloc_mcast_table(struct vmxnet3_softc *); static void vmxnet3_init_shared_data(struct vmxnet3_softc *); static void vmxnet3_reinit_interface(struct vmxnet3_softc *); +static void vmxnet3_reinit_rss_shared_data(struct vmxnet3_softc *); static void vmxnet3_reinit_shared_data(struct vmxnet3_softc *); static int vmxnet3_alloc_data(struct vmxnet3_softc *); static void vmxnet3_free_data(struct vmxnet3_softc *); @@ -152,13 +160,24 @@ static int vmxnet3_reinit(struct vmxnet3 static void vmxnet3_init_locked(struct vmxnet3_softc *); static void vmxnet3_init(void *); -static int vmxnet3_txq_offload_ctx(struct mbuf *, int *, int *, int *); +static int vmxnet3_txq_offload_ctx(struct vmxnet3_txqueue *,struct mbuf *, + int *, int *, int *); static int vmxnet3_txq_load_mbuf(struct vmxnet3_txqueue *, struct mbuf **, bus_dmamap_t, bus_dma_segment_t [], int *); static void vmxnet3_txq_unload_mbuf(struct vmxnet3_txqueue *, bus_dmamap_t); static int vmxnet3_txq_encap(struct vmxnet3_txqueue *, struct mbuf **); +static void vmxnet3_txq_update_pending(struct vmxnet3_txqueue *); +#ifdef VMXNET3_LEGACY_TX static void vmxnet3_start_locked(struct ifnet *); static void vmxnet3_start(struct ifnet *); +#else +static int vmxnet3_txq_mq_start_locked(struct vmxnet3_txqueue *, + struct mbuf *); +static int vmxnet3_txq_mq_start(struct ifnet *, struct mbuf *); +static void vmxnet3_txq_tq_deferred(void *, int); +#endif +static void vmxnet3_txq_start(struct vmxnet3_txqueue *); +static void vmxnet3_tx_start_all(struct vmxnet3_softc *); static void vmxnet3_update_vlan_filter(struct vmxnet3_softc *, int, uint16_t); @@ -168,7 +187,16 @@ static void vmxnet3_set_rxfilter(struct static int vmxnet3_change_mtu(struct vmxnet3_softc *, int); static int vmxnet3_ioctl(struct ifnet *, u_long, caddr_t); +#ifndef VMXNET3_LEGACY_TX +static void vmxnet3_qflush(struct ifnet *); +#endif + static int vmxnet3_watchdog(struct vmxnet3_txqueue *); +static void vmxnet3_refresh_host_stats(struct vmxnet3_softc *); +static void vmxnet3_txq_accum_stats(struct vmxnet3_txqueue *, + struct vmxnet3_txq_stats *); +static void vmxnet3_rxq_accum_stats(struct vmxnet3_rxqueue *, + struct vmxnet3_rxq_stats *); static void vmxnet3_tick(void *); static void vmxnet3_link_status(struct vmxnet3_softc *); static void vmxnet3_media_status(struct ifnet *, struct ifmediareq *); @@ -213,6 +241,12 @@ typedef enum { static void vmxnet3_barrier(struct vmxnet3_softc *, vmxnet3_barrier_t); /* Tunables. */ +static int vmxnet3_mq_disable = 0; +TUNABLE_INT("hw.vmx.mq_disable", &vmxnet3_mq_disable); +static int vmxnet3_default_txnqueue = VMXNET3_DEF_TX_QUEUES; +TUNABLE_INT("hw.vmx.txnqueue", &vmxnet3_default_txnqueue); +static int vmxnet3_default_rxnqueue = VMXNET3_DEF_RX_QUEUES; +TUNABLE_INT("hw.vmx.rxnqueue", &vmxnet3_default_rxnqueue); static int vmxnet3_default_txndesc = VMXNET3_DEF_TX_NDESC; TUNABLE_INT("hw.vmx.txndesc", &vmxnet3_default_txndesc); static int vmxnet3_default_rxndesc = VMXNET3_DEF_RX_NDESC; @@ -282,10 +316,18 @@ vmxnet3_attach(device_t dev) if (error) goto fail; +#ifndef VMXNET3_LEGACY_TX + error = vmxnet3_alloc_taskqueue(sc); + if (error) + goto fail; +#endif + error = vmxnet3_alloc_interrupts(sc); if (error) goto fail; + vmxnet3_check_multiqueue(sc); + error = vmxnet3_alloc_data(sc); if (error) goto fail; @@ -302,7 +344,9 @@ vmxnet3_attach(device_t dev) } vmxnet3_setup_sysctl(sc); - vmxnet3_link_status(sc); +#ifndef VMXNET3_LEGACY_TX + vmxnet3_start_taskqueue(sc); +#endif fail: if (error) @@ -321,11 +365,16 @@ vmxnet3_detach(device_t dev) ifp = sc->vmx_ifp; if (device_is_attached(dev)) { - ether_ifdetach(ifp); VMXNET3_CORE_LOCK(sc); vmxnet3_stop(sc); VMXNET3_CORE_UNLOCK(sc); + callout_drain(&sc->vmx_tick); +#ifndef VMXNET3_LEGACY_TX + vmxnet3_drain_taskqueue(sc); +#endif + + ether_ifdetach(ifp); } if (sc->vmx_vlan_attach != NULL) { @@ -337,6 +386,9 @@ vmxnet3_detach(device_t dev) sc->vmx_vlan_detach = NULL; } +#ifndef VMXNET3_LEGACY_TX + vmxnet3_free_taskqueue(sc); +#endif vmxnet3_free_interrupts(sc); if (ifp != NULL) { @@ -463,14 +515,26 @@ vmxnet3_check_version(struct vmxnet3_sof static void vmxnet3_initial_config(struct vmxnet3_softc *sc) { - int ndesc; + int nqueue, ndesc; - /* - * BMV Much of the work is already done, but this driver does - * not support multiqueue yet. - */ - sc->vmx_ntxqueues = VMXNET3_TX_QUEUES; - sc->vmx_nrxqueues = VMXNET3_RX_QUEUES; + nqueue = vmxnet3_tunable_int(sc, "txnqueue", vmxnet3_default_txnqueue); + if (nqueue > VMXNET3_MAX_TX_QUEUES || nqueue < 1) + nqueue = VMXNET3_DEF_TX_QUEUES; + if (nqueue > mp_ncpus) + nqueue = mp_ncpus; + sc->vmx_max_ntxqueues = nqueue; + + nqueue = vmxnet3_tunable_int(sc, "rxnqueue", vmxnet3_default_rxnqueue); + if (nqueue > VMXNET3_MAX_RX_QUEUES || nqueue < 1) + nqueue = VMXNET3_DEF_RX_QUEUES; + if (nqueue > mp_ncpus) + nqueue = mp_ncpus; + sc->vmx_max_nrxqueues = nqueue; + + if (vmxnet3_tunable_int(sc, "mq_disable", vmxnet3_mq_disable)) { + sc->vmx_max_nrxqueues = 1; + sc->vmx_max_ntxqueues = 1; + } ndesc = vmxnet3_tunable_int(sc, "txd", vmxnet3_default_txndesc); if (ndesc > VMXNET3_MAX_TX_NDESC || ndesc < VMXNET3_MIN_TX_NDESC) @@ -488,6 +552,27 @@ vmxnet3_initial_config(struct vmxnet3_so sc->vmx_max_rxsegs = VMXNET3_MAX_RX_SEGS; } +static void +vmxnet3_check_multiqueue(struct vmxnet3_softc *sc) +{ + + if (sc->vmx_intr_type != VMXNET3_IT_MSIX) + goto out; + + /* BMV: Just use the maximum configured for now. */ + sc->vmx_nrxqueues = sc->vmx_max_nrxqueues; + sc->vmx_ntxqueues = sc->vmx_max_ntxqueues; + + if (sc->vmx_nrxqueues > 1) + sc->vmx_flags |= VMXNET3_FLAG_RSS; + + return; + +out: + sc->vmx_ntxqueues = 1; + sc->vmx_nrxqueues = 1; +} + static int vmxnet3_alloc_msix_interrupts(struct vmxnet3_softc *sc) { @@ -500,7 +585,7 @@ vmxnet3_alloc_msix_interrupts(struct vmx return (1); /* Allocate an additional vector for the events interrupt. */ - required = sc->vmx_nrxqueues + sc->vmx_ntxqueues + 1; + required = sc->vmx_max_nrxqueues + sc->vmx_max_ntxqueues + 1; nmsix = pci_msix_count(dev); if (nmsix < required) @@ -513,6 +598,8 @@ vmxnet3_alloc_msix_interrupts(struct vmx } else pci_release_msi(dev); + /* BMV TODO Fallback to sharing MSIX vectors if possible. */ + return (1); } @@ -586,10 +673,6 @@ vmxnet3_alloc_intr_resources(struct vmxn return (0); } -/* - * NOTE: We only support the simple case of each Rx and Tx queue on its - * own MSIX vector. This is good enough until we support mulitqueue. - */ static int vmxnet3_setup_msix_interrupts(struct vmxnet3_softc *sc) { @@ -651,10 +734,6 @@ vmxnet3_setup_legacy_interrupt(struct vm return (error); } -/* - * XXX BMV Should probably reorganize the attach and just do - * this in vmxnet3_init_shared_data(). - */ static void vmxnet3_set_interrupt_idx(struct vmxnet3_softc *sc) { @@ -784,6 +863,71 @@ vmxnet3_free_interrupts(struct vmxnet3_s pci_release_msi(sc->vmx_dev); } +#ifndef VMXNET3_LEGACY_TX +static int +vmxnet3_alloc_taskqueue(struct vmxnet3_softc *sc) +{ + device_t dev; + + dev = sc->vmx_dev; + + sc->vmx_tq = taskqueue_create(device_get_nameunit(dev), M_NOWAIT, + taskqueue_thread_enqueue, &sc->vmx_tq); + if (sc->vmx_tq == NULL) + return (ENOMEM); + + return (0); +} + +static void +vmxnet3_start_taskqueue(struct vmxnet3_softc *sc) +{ + device_t dev; + int nthreads, error; + + dev = sc->vmx_dev; + + /* + * The taskqueue is typically not frequently used, so a dedicated + * thread for each queue is unnecessary. + */ + nthreads = MAX(1, sc->vmx_ntxqueues / 2); + + /* + * Most drivers just ignore the return value - it only fails + * with ENOMEM so an error is not likely. It is hard for us + * to recover from an error here. + */ + error = taskqueue_start_threads(&sc->vmx_tq, nthreads, PI_NET, + "%s taskq", device_get_nameunit(dev)); + if (error) + device_printf(dev, "failed to start taskqueue: %d", error); +} + +static void +vmxnet3_drain_taskqueue(struct vmxnet3_softc *sc) +{ + struct vmxnet3_txqueue *txq; + int i; + + if (sc->vmx_tq != NULL) { + for (i = 0; i < sc->vmx_max_ntxqueues; i++) { + txq = &sc->vmx_txq[i]; + taskqueue_drain(sc->vmx_tq, &txq->vxtxq_defrtask); + } + } +} + +static void +vmxnet3_free_taskqueue(struct vmxnet3_softc *sc) +{ + if (sc->vmx_tq != NULL) { + taskqueue_free(sc->vmx_tq); + sc->vmx_tq = NULL; + } +} +#endif + static int vmxnet3_init_rxq(struct vmxnet3_softc *sc, int q) { @@ -839,6 +983,15 @@ vmxnet3_init_txq(struct vmxnet3_softc *s txq->vxtxq_comp_ring.vxcr_ndesc = sc->vmx_ntxdescs; +#ifndef VMXNET3_LEGACY_TX + TASK_INIT(&txq->vxtxq_defrtask, 0, vmxnet3_txq_tq_deferred, txq); + + txq->vxtxq_br = buf_ring_alloc(VMXNET3_DEF_BUFRING_SIZE, M_DEVBUF, + M_NOWAIT, &txq->vxtxq_mtx); + if (txq->vxtxq_br == NULL) + return (ENOMEM); +#endif + return (0); } @@ -847,20 +1000,32 @@ vmxnet3_alloc_rxtx_queues(struct vmxnet3 { int i, error; + /* + * Only attempt to create multiple queues if MSIX is available. MSIX is + * disabled by default because its apparently broken for devices passed + * through by at least ESXi 5.1. The hw.pci.honor_msi_blacklist tunable + * must be set to zero for MSIX. This check prevents us from allocating + * queue structures that we will not use. + */ + if (sc->vmx_flags & VMXNET3_FLAG_NO_MSIX) { + sc->vmx_max_nrxqueues = 1; + sc->vmx_max_ntxqueues = 1; + } + sc->vmx_rxq = malloc(sizeof(struct vmxnet3_rxqueue) * - sc->vmx_nrxqueues, M_DEVBUF, M_NOWAIT | M_ZERO); + sc->vmx_max_nrxqueues, M_DEVBUF, M_NOWAIT | M_ZERO); sc->vmx_txq = malloc(sizeof(struct vmxnet3_txqueue) * - sc->vmx_ntxqueues, M_DEVBUF, M_NOWAIT | M_ZERO); + sc->vmx_max_ntxqueues, M_DEVBUF, M_NOWAIT | M_ZERO); if (sc->vmx_rxq == NULL || sc->vmx_txq == NULL) return (ENOMEM); - for (i = 0; i < sc->vmx_nrxqueues; i++) { + for (i = 0; i < sc->vmx_max_nrxqueues; i++) { error = vmxnet3_init_rxq(sc, i); if (error) return (error); } - for (i = 0; i < sc->vmx_ntxqueues; i++) { + for (i = 0; i < sc->vmx_max_ntxqueues; i++) { error = vmxnet3_init_txq(sc, i); if (error) return (error); @@ -901,6 +1066,13 @@ vmxnet3_destroy_txq(struct vmxnet3_txque txq->vxtxq_sc = NULL; txq->vxtxq_id = -1; +#ifndef VMXNET3_LEGACY_TX + if (txq->vxtxq_br != NULL) { + buf_ring_free(txq->vxtxq_br, M_DEVBUF); + txq->vxtxq_br = NULL; + } +#endif + if (txr->vxtxr_txbuf != NULL) { free(txr->vxtxr_txbuf, M_DEVBUF); txr->vxtxr_txbuf = NULL; @@ -916,14 +1088,14 @@ vmxnet3_free_rxtx_queues(struct vmxnet3_ int i; if (sc->vmx_rxq != NULL) { - for (i = 0; i < sc->vmx_nrxqueues; i++) + for (i = 0; i < sc->vmx_max_nrxqueues; i++) vmxnet3_destroy_rxq(&sc->vmx_rxq[i]); free(sc->vmx_rxq, M_DEVBUF); sc->vmx_rxq = NULL; } if (sc->vmx_txq != NULL) { - for (i = 0; i < sc->vmx_ntxqueues; i++) + for (i = 0; i < sc->vmx_max_ntxqueues; i++) vmxnet3_destroy_txq(&sc->vmx_txq[i]); free(sc->vmx_txq, M_DEVBUF); sc->vmx_txq = NULL; @@ -967,6 +1139,17 @@ vmxnet3_alloc_shared_data(struct vmxnet3 kva += sizeof(struct vmxnet3_rxq_shared); } + if (sc->vmx_flags & VMXNET3_FLAG_RSS) { + size = sizeof(struct vmxnet3_rss_shared); + error = vmxnet3_dma_malloc(sc, size, 128, &sc->vmx_rss_dma); + if (error) { + device_printf(dev, "cannot alloc rss shared memory\n"); + return (error); + } + sc->vmx_rss = + (struct vmxnet3_rss_shared *) sc->vmx_rss_dma.dma_vaddr; + } + return (0); } @@ -974,6 +1157,11 @@ static void vmxnet3_free_shared_data(struct vmxnet3_softc *sc) { + if (sc->vmx_rss != NULL) { + vmxnet3_dma_free(sc, &sc->vmx_rss_dma); + sc->vmx_rss = NULL; + } + if (sc->vmx_qs != NULL) { vmxnet3_dma_free(sc, &sc->vmx_qs_dma); sc->vmx_qs = NULL; @@ -1010,7 +1198,7 @@ vmxnet3_alloc_txq_data(struct vmxnet3_so BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - VMXNET3_TSO_MAXSIZE, /* maxsize */ + VMXNET3_TX_MAXSIZE, /* maxsize */ VMXNET3_TX_MAXSEGS, /* nsegments */ VMXNET3_TX_MAXSEGSIZE, /* maxsegsize */ 0, /* flags */ @@ -1335,6 +1523,13 @@ vmxnet3_init_shared_data(struct vmxnet3_ ds->queue_shared_len = sc->vmx_qs_dma.dma_size; ds->nrxsg_max = sc->vmx_max_rxsegs; + /* RSS conf */ + if (sc->vmx_flags & VMXNET3_FLAG_RSS) { + ds->rss.version = 1; + ds->rss.paddr = sc->vmx_rss_dma.dma_paddr; + ds->rss.len = sc->vmx_rss_dma.dma_size; + } + /* Interrupt control. */ ds->automask = sc->vmx_intr_mask_mode == VMXNET3_IMM_AUTO; ds->nintr = sc->vmx_nintrs; @@ -1394,9 +1589,43 @@ vmxnet3_reinit_interface(struct vmxnet3_ if (ifp->if_capenable & IFCAP_TXCSUM_IPV6) ifp->if_hwassist |= VMXNET3_CSUM_OFFLOAD_IPV6; if (ifp->if_capenable & IFCAP_TSO4) - ifp->if_hwassist |= CSUM_TSO; + ifp->if_hwassist |= CSUM_IP_TSO; if (ifp->if_capenable & IFCAP_TSO6) - ifp->if_hwassist |= CSUM_TSO; /* No CSUM_TSO_IPV6. */ + ifp->if_hwassist |= CSUM_IP6_TSO; +} + +static void +vmxnet3_reinit_rss_shared_data(struct vmxnet3_softc *sc) +{ + /* + * Use the same key as the Linux driver until FreeBSD can do + * RSS (presumably Toeplitz) in software. + */ + static const uint8_t rss_key[UPT1_RSS_MAX_KEY_SIZE] = { + 0x3b, 0x56, 0xd1, 0x56, 0x13, 0x4a, 0xe7, 0xac, + 0xe8, 0x79, 0x09, 0x75, 0xe8, 0x65, 0x79, 0x28, + 0x35, 0x12, 0xb9, 0x56, 0x7c, 0x76, 0x4b, 0x70, + 0xd8, 0x56, 0xa3, 0x18, 0x9b, 0x0a, 0xee, 0xf3, + 0x96, 0xa6, 0x9f, 0x8f, 0x9e, 0x8c, 0x90, 0xc9, + }; + + struct vmxnet3_driver_shared *ds; + struct vmxnet3_rss_shared *rss; + int i; + + ds = sc->vmx_ds; + rss = sc->vmx_rss; + + rss->hash_type = + UPT1_RSS_HASH_TYPE_IPV4 | UPT1_RSS_HASH_TYPE_TCP_IPV4 | + UPT1_RSS_HASH_TYPE_IPV6 | UPT1_RSS_HASH_TYPE_TCP_IPV6; + rss->hash_func = UPT1_RSS_HASH_FUNC_TOEPLITZ; + rss->hash_key_size = UPT1_RSS_MAX_KEY_SIZE; + rss->ind_table_size = UPT1_RSS_MAX_IND_TABLE_SIZE; + memcpy(rss->hash_key, rss_key, UPT1_RSS_MAX_KEY_SIZE); + + for (i = 0; i < UPT1_RSS_MAX_IND_TABLE_SIZE; i++) + rss->ind_table[i] = i % sc->vmx_nrxqueues; } static void @@ -1408,6 +1637,10 @@ vmxnet3_reinit_shared_data(struct vmxnet ifp = sc->vmx_ifp; ds = sc->vmx_ds; + ds->mtu = ifp->if_mtu; + ds->ntxqueue = sc->vmx_ntxqueues; + ds->nrxqueue = sc->vmx_nrxqueues; + ds->upt_features = 0; if (ifp->if_capenable & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) ds->upt_features |= UPT1_F_CSUM; @@ -1416,9 +1649,10 @@ vmxnet3_reinit_shared_data(struct vmxnet if (ifp->if_capenable & IFCAP_LRO) ds->upt_features |= UPT1_F_LRO; - ds->mtu = ifp->if_mtu; - ds->ntxqueue = sc->vmx_ntxqueues; - ds->nrxqueue = sc->vmx_nrxqueues; + if (sc->vmx_flags & VMXNET3_FLAG_RSS) { + ds->upt_features |= UPT1_F_RSS; + vmxnet3_reinit_rss_shared_data(sc); + } vmxnet3_write_bar1(sc, VMXNET3_BAR1_DSL, sc->vmx_ds_dma.dma_paddr); vmxnet3_write_bar1(sc, VMXNET3_BAR1_DSH, @@ -1471,15 +1705,28 @@ vmxnet3_setup_interface(struct vmxnet3_s } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); +#if __FreeBSD_version < 1000025 + ifp->if_baudrate = 1000000000; +#elif __FreeBSD_version < 1100011 + if_initbaudrate(ifp, IF_Gbps(10)); +#else ifp->if_baudrate = IF_Gbps(10); +#endif ifp->if_softc = sc; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_init = vmxnet3_init; ifp->if_ioctl = vmxnet3_ioctl; + ifp->if_hw_tsomax = VMXNET3_TSO_MAXSIZE; + +#ifdef VMXNET3_LEGACY_TX ifp->if_start = vmxnet3_start; ifp->if_snd.ifq_drv_maxlen = sc->vmx_ntxdescs - 1; IFQ_SET_MAXLEN(&ifp->if_snd, sc->vmx_ntxdescs - 1); IFQ_SET_READY(&ifp->if_snd); +#else + ifp->if_transmit = vmxnet3_txq_mq_start; + ifp->if_qflush = vmxnet3_qflush; +#endif vmxnet3_get_lladdr(sc); ether_ifattach(ifp, sc->vmx_lladdr); @@ -1527,8 +1774,11 @@ vmxnet3_evintr(struct vmxnet3_softc *sc) event = sc->vmx_ds->event; vmxnet3_write_bar1(sc, VMXNET3_BAR1_EVENT, event); - if (event & VMXNET3_EVENT_LINK) + if (event & VMXNET3_EVENT_LINK) { vmxnet3_link_status(sc); + if (sc->vmx_link_active != 0) + vmxnet3_tx_start_all(sc); + } if (event & (VMXNET3_EVENT_TQERROR | VMXNET3_EVENT_RQERROR)) { reset = 1; @@ -1564,6 +1814,7 @@ vmxnet3_txq_eof(struct vmxnet3_txqueue * struct vmxnet3_comp_ring *txc; struct vmxnet3_txcompdesc *txcd; struct vmxnet3_txbuf *txb; + struct mbuf *m; u_int sop; sc = txq->vxtxq_sc; @@ -1587,15 +1838,18 @@ vmxnet3_txq_eof(struct vmxnet3_txqueue * sop = txr->vxtxr_next; txb = &txr->vxtxr_txbuf[sop]; - if (txb->vtxb_m != NULL) { + if ((m = txb->vtxb_m) != NULL) { bus_dmamap_sync(txr->vxtxr_txtag, txb->vtxb_dmamap, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(txr->vxtxr_txtag, txb->vtxb_dmamap); - m_freem(txb->vtxb_m); - txb->vtxb_m = NULL; + txq->vxtxq_stats.vmtxs_opackets++; + txq->vxtxq_stats.vmtxs_obytes += m->m_pkthdr.len; + if (m->m_flags & M_MCAST) + txq->vxtxq_stats.vmtxs_omcasts++; - ifp->if_opackets++; + m_freem(m); + txb->vtxb_m = NULL; } txr->vxtxr_next = (txcd->eop_idx + 1) % txr->vxtxr_ndesc; @@ -1769,11 +2023,39 @@ vmxnet3_rxq_input(struct vmxnet3_rxqueue ifp = sc->vmx_ifp; if (rxcd->error) { - ifp->if_ierrors++; + rxq->vxrxq_stats.vmrxs_ierrors++; m_freem(m); return; } +#ifdef notyet + switch (rxcd->rss_type) { + case VMXNET3_RCD_RSS_TYPE_IPV4: + m->m_pkthdr.flowid = rxcd->rss_hash; + M_HASHTYPE_SET(m, M_HASHTYPE_RSS_IPV4); + break; + case VMXNET3_RCD_RSS_TYPE_TCPIPV4: + m->m_pkthdr.flowid = rxcd->rss_hash; + M_HASHTYPE_SET(m, M_HASHTYPE_RSS_TCP_IPV4); + break; + case VMXNET3_RCD_RSS_TYPE_IPV6: + m->m_pkthdr.flowid = rxcd->rss_hash; + M_HASHTYPE_SET(m, M_HASHTYPE_RSS_IPV6); + break; + case VMXNET3_RCD_RSS_TYPE_TCPIPV6: + m->m_pkthdr.flowid = rxcd->rss_hash; + M_HASHTYPE_SET(m, M_HASHTYPE_RSS_TCP_IPV6); + break; + default: /* VMXNET3_RCD_RSS_TYPE_NONE */ + m->m_pkthdr.flowid = rxq->vxrxq_id; + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); + break; + } +#else + m->m_pkthdr.flowid = rxq->vxrxq_id; + m->m_flags |= M_FLOWID; +#endif + if (!rxcd->no_csum) vmxnet3_rx_csum(rxcd, m); if (rxcd->vlan) { @@ -1781,7 +2063,9 @@ vmxnet3_rxq_input(struct vmxnet3_rxqueue m->m_pkthdr.ether_vtag = rxcd->vtag; } - ifp->if_ipackets++; + rxq->vxrxq_stats.vmrxs_ipackets++; + rxq->vxrxq_stats.vmrxs_ibytes += m->m_pkthdr.len; + VMXNET3_RXQ_UNLOCK(rxq); (*ifp->if_input)(ifp, m); VMXNET3_RXQ_LOCK(rxq); @@ -1863,7 +2147,7 @@ vmxnet3_rxq_eof(struct vmxnet3_rxqueue * } if (vmxnet3_newbuf(sc, rxr) != 0) { - ifp->if_iqdrops++; + rxq->vxrxq_stats.vmrxs_iqdrops++; vmxnet3_rxq_eof_discard(rxq, rxr, idx); if (!rxcd->eop) vmxnet3_rxq_discard_chain(rxq); @@ -1882,7 +2166,7 @@ vmxnet3_rxq_eof(struct vmxnet3_rxqueue * ("%s: frame not started?", __func__)); if (vmxnet3_newbuf(sc, rxr) != 0) { - ifp->if_iqdrops++; + rxq->vxrxq_stats.vmrxs_iqdrops++; vmxnet3_rxq_eof_discard(rxq, rxr, idx); if (!rxcd->eop) vmxnet3_rxq_discard_chain(rxq); @@ -1951,8 +2235,7 @@ vmxnet3_legacy_intr(void *xsc) VMXNET3_TXQ_LOCK(txq); vmxnet3_txq_eof(txq); - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - vmxnet3_start_locked(ifp); + vmxnet3_txq_start(txq); VMXNET3_TXQ_UNLOCK(txq); vmxnet3_enable_all_intrs(sc); @@ -1974,8 +2257,7 @@ vmxnet3_txq_intr(void *xtxq) VMXNET3_TXQ_LOCK(txq); vmxnet3_txq_eof(txq); - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - vmxnet3_start_locked(ifp); + vmxnet3_txq_start(txq); VMXNET3_TXQ_UNLOCK(txq); vmxnet3_enable_intr(sc, txq->vxtxq_intr_idx); @@ -2054,6 +2336,7 @@ vmxnet3_rxstop(struct vmxnet3_softc *sc, if (rxb->vrxb_m == NULL) continue; + bus_dmamap_sync(rxr->vxrxr_rxtag, rxb->vrxb_dmamap, BUS_DMASYNC_POSTREAD); bus_dmamap_unload(rxr->vxrxr_rxtag, rxb->vrxb_dmamap); @@ -2316,7 +2599,8 @@ vmxnet3_init(void *xsc) * the mbuf packet header. Bug andre@. */ static int -vmxnet3_txq_offload_ctx(struct mbuf *m, int *etype, int *proto, int *start) +vmxnet3_txq_offload_ctx(struct vmxnet3_txqueue *txq, struct mbuf *m, + int *etype, int *proto, int *start) { struct ether_vlan_header *evh; int offset; @@ -2340,7 +2624,7 @@ vmxnet3_txq_offload_ctx(struct mbuf *m, (caddr_t) &iphdr); ip = &iphdr; } else - ip = (struct ip *)(m->m_data + offset); + ip = mtodo(m, offset); *proto = ip->ip_p; *start = offset + (ip->ip_hl << 2); break; @@ -2368,19 +2652,21 @@ vmxnet3_txq_offload_ctx(struct mbuf *m, return (EINVAL); } - if (m->m_len < *start + sizeof(struct tcphdr)) { - m_copydata(m, offset, sizeof(struct tcphdr), - (caddr_t) &tcphdr); - tcp = &tcphdr; - } else - tcp = (struct tcphdr *)(m->m_data + *start); + txq->vxtxq_stats.vmtxs_tso++; /* * For TSO, the size of the protocol header is also * included in the descriptor header size. */ + if (m->m_len < *start + sizeof(struct tcphdr)) { + m_copydata(m, offset, sizeof(struct tcphdr), + (caddr_t) &tcphdr); + tcp = &tcphdr; + } else + tcp = mtodo(m, *start); *start += (tcp->th_off << 2); - } + } else + txq->vxtxq_stats.vmtxs_csum++; return (0); } @@ -2392,18 +2678,17 @@ vmxnet3_txq_load_mbuf(struct vmxnet3_txq struct vmxnet3_txring *txr; struct mbuf *m; bus_dma_tag_t tag; - int maxsegs, error; + int error; txr = &txq->vxtxq_cmd_ring; m = *m0; tag = txr->vxtxr_txtag; - maxsegs = VMXNET3_TX_MAXSEGS; error = bus_dmamap_load_mbuf_sg(tag, dmap, m, segs, nsegs, 0); if (error == 0 || error != EFBIG) return (error); - m = m_collapse(m, M_NOWAIT, maxsegs); + m = m_defrag(m, M_NOWAIT); if (m != NULL) { *m0 = m; error = bus_dmamap_load_mbuf_sg(tag, dmap, m, segs, nsegs, 0); @@ -2413,8 +2698,9 @@ vmxnet3_txq_load_mbuf(struct vmxnet3_txq if (error) { m_freem(*m0); *m0 = NULL; + txq->vxtxq_sc->vmx_stats.vmst_defrag_failed++; } else - txq->vxtxq_sc->vmx_stats.vmst_collapsed++; + txq->vxtxq_sc->vmx_stats.vmst_defragged++; return (error); } @@ -2457,13 +2743,13 @@ vmxnet3_txq_encap(struct vmxnet3_txqueue ("%s: mbuf %p with too many segments %d", __func__, m, nsegs)); if (VMXNET3_TXRING_AVAIL(txr) < nsegs) { - txq->vxtxq_stats.vtxrs_full++; + txq->vxtxq_stats.vmtxs_full++; vmxnet3_txq_unload_mbuf(txq, dmap); return (ENOSPC); } else if (m->m_pkthdr.csum_flags & VMXNET3_CSUM_ALL_OFFLOAD) { - error = vmxnet3_txq_offload_ctx(m, &etype, &proto, &start); + error = vmxnet3_txq_offload_ctx(txq, m, &etype, &proto, &start); if (error) { - txq->vxtxq_stats.vtxrs_offload_failed++; + txq->vxtxq_stats.vmtxs_offload_failed++; vmxnet3_txq_unload_mbuf(txq, dmap); m_freem(m); *m0 = NULL; @@ -2529,6 +2815,22 @@ vmxnet3_txq_encap(struct vmxnet3_txqueue } static void +vmxnet3_txq_update_pending(struct vmxnet3_txqueue *txq) +{ + struct vmxnet3_txring *txr; + + txr = &txq->vxtxq_cmd_ring; + + if (txq->vxtxq_ts->npending > 0) { + txq->vxtxq_ts->npending = 0; + vmxnet3_write_bar0(txq->vxtxq_sc, + VMXNET3_BAR0_TXH(txq->vxtxq_id), txr->vxtxr_head); + } +} + +#ifdef VMXNET3_LEGACY_TX + +static void vmxnet3_start_locked(struct ifnet *ifp) { struct vmxnet3_softc *sc; @@ -2573,11 +2875,7 @@ vmxnet3_start_locked(struct ifnet *ifp) } if (tx > 0) { - if (txq->vxtxq_ts->npending > 0) { - txq->vxtxq_ts->npending = 0; - vmxnet3_write_bar0(sc, VMXNET3_BAR0_TXH(txq->vxtxq_id), - txr->vxtxr_head); - } + vmxnet3_txq_update_pending(txq); txq->vxtxq_watchdog = VMXNET3_WATCHDOG_TIMEOUT; } } @@ -2596,6 +2894,153 @@ vmxnet3_start(struct ifnet *ifp) VMXNET3_TXQ_UNLOCK(txq); } +#else /* !VMXNET3_LEGACY_TX */ + +static int +vmxnet3_txq_mq_start_locked(struct vmxnet3_txqueue *txq, struct mbuf *m) +{ + struct vmxnet3_softc *sc; + struct vmxnet3_txring *txr; + struct buf_ring *br; + struct ifnet *ifp; + int tx, avail, error; + + sc = txq->vxtxq_sc; + br = txq->vxtxq_br; + ifp = sc->vmx_ifp; + txr = &txq->vxtxq_cmd_ring; + tx = 0; + error = 0; + + VMXNET3_TXQ_LOCK_ASSERT(txq); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + sc->vmx_link_active == 0) { + if (m != NULL) + error = drbr_enqueue(ifp, br, m); + return (error); + } + + if (m != NULL) { + error = drbr_enqueue(ifp, br, m); + if (error) + return (error); + } + + while ((avail = VMXNET3_TXRING_AVAIL(txr)) >= 2) { + m = drbr_peek(ifp, br); + if (m == NULL) + break; + + /* Assume worse case if this mbuf is the head of a chain. */ + if (m->m_next != NULL && avail < VMXNET3_TX_MAXSEGS) { + drbr_putback(ifp, br, m); + error = ENOBUFS; + break; + } + + error = vmxnet3_txq_encap(txq, &m); + if (error) { + if (m != NULL) + drbr_putback(ifp, br, m); + else + drbr_advance(ifp, br); + break; + } + drbr_advance(ifp, br); + + tx++; + ETHER_BPF_MTAP(ifp, m); + } + + if (tx > 0) { + vmxnet3_txq_update_pending(txq); + txq->vxtxq_watchdog = VMXNET3_WATCHDOG_TIMEOUT; + } + + return (error); +} + +static int +vmxnet3_txq_mq_start(struct ifnet *ifp, struct mbuf *m) +{ + struct vmxnet3_softc *sc; + struct vmxnet3_txqueue *txq; + int i, ntxq, error; + + sc = ifp->if_softc; + ntxq = sc->vmx_ntxqueues; + + if (m->m_flags & M_FLOWID) + i = m->m_pkthdr.flowid % ntxq; + else + i = curcpu % ntxq; + + txq = &sc->vmx_txq[i]; + + if (VMXNET3_TXQ_TRYLOCK(txq) != 0) { + error = vmxnet3_txq_mq_start_locked(txq, m); + VMXNET3_TXQ_UNLOCK(txq); + } else { + error = drbr_enqueue(ifp, txq->vxtxq_br, m); + taskqueue_enqueue(sc->vmx_tq, &txq->vxtxq_defrtask); + } + + return (error); +} + +static void +vmxnet3_txq_tq_deferred(void *xtxq, int pending) +{ + struct vmxnet3_softc *sc; + struct vmxnet3_txqueue *txq; + + txq = xtxq; + sc = txq->vxtxq_sc; + + VMXNET3_TXQ_LOCK(txq); + if (!drbr_empty(sc->vmx_ifp, txq->vxtxq_br)) + vmxnet3_txq_mq_start_locked(txq, NULL); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 06:45:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7361CC2; Mon, 17 Mar 2014 06:45:00 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 799B393E; Mon, 17 Mar 2014 06:45:00 +0000 (UTC) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1WPRI7-000NXK-E3; Mon, 17 Mar 2014 06:44:57 +0000 Subject: Re: svn commit: r263218 - in head: lib/libcrypt lib/libmd sys/conf sys/crypto/sha2 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Content-Type: multipart/signed; boundary="Apple-Mail=_CABB1BB3-1394-44FB-8E92-6C62CEB45032"; protocol="application/pgp-signature"; micalg=pgp-sha512 From: Mark R V Murray In-Reply-To: <20140316211501.GE32089@funkthat.com> Date: Mon, 17 Mar 2014 06:46:04 +0000 Message-Id: <6A6C4765-D396-4BF2-A5A8-96098A71D995@grondar.org> References: <201403160143.s2G1hOV8093665@svn.freebsd.org> <08A216A5-BE59-4505-AA13-2B7E026DB56A@grondar.org> <20140316211501.GE32089@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.1874) X-SA-Score: -2.2 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 06:45:00 -0000 --Apple-Mail=_CABB1BB3-1394-44FB-8E92-6C62CEB45032 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 16 Mar 2014, at 21:15, John-Mark Gurney wrote: > Mark Murray wrote this message on Sun, Mar 16, 2014 at 17:24 +0000: >> I haven?t looked at this closely, but if you?ve dropped support for = sha256, then sys/dev/random/... can?t use it :-( >=20 > Please read closer... To many things would break if sha256 was really > removed=85 Oops! Thanks! *blush* M --=20 Mark R V Murray --Apple-Mail=_CABB1BB3-1394-44FB-8E92-6C62CEB45032 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - http://gpgtools.org iQCVAwUBUyaaMt58vKOKE6LNAQpu9QP/Zdxq3oI42oMv/fSyRHb6d7h5ub+TRfbv Dx6khbsAAUWurcMcfpPL61xw4dxSVnesbIuhLHVxeLfuYYOaiu9J5pvLxOxIDQ8E uKeLw0Msp2jEwMq4F/UbyNa+t+xaTjYo85pVmtVC9HXyTMF1qpZVwQ758LXL+JSC WJh6WHfXxnU= =MyIi -----END PGP SIGNATURE----- --Apple-Mail=_CABB1BB3-1394-44FB-8E92-6C62CEB45032-- From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 07:19:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACC9822C; Mon, 17 Mar 2014 07:19:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 995DBB7E; Mon, 17 Mar 2014 07:19:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2H7JJ1l012563; Mon, 17 Mar 2014 07:19:19 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2H7JJFC012562; Mon, 17 Mar 2014 07:19:19 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403170719.s2H7JJFC012562@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 17 Mar 2014 07:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263262 - head/sys/dev/usb/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 07:19:19 -0000 Author: hselasky Date: Mon Mar 17 07:19:19 2014 New Revision: 263262 URL: http://svnweb.freebsd.org/changeset/base/263262 Log: Fix spelling. Reported by: Kevin P. Neal Modified: head/sys/dev/usb/input/ukbd.c Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Mon Mar 17 06:38:40 2014 (r263261) +++ head/sys/dev/usb/input/ukbd.c Mon Mar 17 07:19:19 2014 (r263262) @@ -1909,7 +1909,7 @@ ukbd_ioctl(keyboard_t *kbd, u_long cmd, int result; /* - * XXX Check of someone is calling us from a critical section: + * XXX Check if someone is calling us from a critical section: */ if (curthread->td_critnest != 0) return (EDEADLK); From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 07:54:40 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26168C9A; Mon, 17 Mar 2014 07:54:40 +0000 (UTC) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [IPv6:2001:770:10:300::86e2:510b]) by mx1.freebsd.org (Postfix) with SMTP id E11C1E9C; Mon, 17 Mar 2014 07:54:38 +0000 (UTC) Received: from walton.maths.tcd.ie ([134.226.81.10] helo=walton.maths.tcd.ie) by salmon.maths.tcd.ie with SMTP id ; 17 Mar 2014 07:54:37 +0000 (GMT) Received: by walton.maths.tcd.ie (Postfix, from userid 238) id E8F0F7306D; Mon, 17 Mar 2014 07:54:36 +0000 (GMT) Date: Mon, 17 Mar 2014 07:54:36 +0000 From: David Malone To: Robert Watson Subject: Re: svn commit: r263198 - in head/sys: amd64/conf conf net netinet netinet6 sys Message-ID: <20140317075436.GA5864@walton.maths.tcd.ie> References: <201403150057.s2F0vofg081606@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201403150057.s2F0vofg081606@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 07:54:40 -0000 > (1) Merge a software implementation of the Toeplitz hash specified in > RSS implemented by David Malone. This is used to allow suitable > pcbgroup placement of connections before the first packet is > received from the NIC. Software hashing is generally avoided, > however, due to high cost of the hash on general-purpose CPUs. I could look at a faster software implementation, but I guess most of the value is when hashing is done on the NIC. David. From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 08:27:05 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 872BF539; Mon, 17 Mar 2014 08:27:05 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id 5CE70188; Mon, 17 Mar 2014 08:27:05 +0000 (UTC) Received: from [10.0.1.9] (host81-156-92-9.range81-156.btcentralplus.com [81.156.92.9]) by cyrus.watson.org (Postfix) with ESMTPSA id 84A6846B0C; Mon, 17 Mar 2014 04:27:03 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263198 - in head/sys: amd64/conf conf net netinet netinet6 sys From: "Robert N. M. Watson" In-Reply-To: <20140317075436.GA5864@walton.maths.tcd.ie> Date: Mon, 17 Mar 2014 08:26:55 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201403150057.s2F0vofg081606@svn.freebsd.org> <20140317075436.GA5864@walton.maths.tcd.ie> To: David Malone X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 08:27:05 -0000 On 17 Mar 2014, at 07:54, David Malone wrote: >> (1) Merge a software implementation of the Toeplitz hash specified = in >> RSS implemented by David Malone. This is used to allow suitable >> pcbgroup placement of connections before the first packet is >> received from the NIC. Software hashing is generally avoided, >> however, due to high cost of the hash on general-purpose CPUs. >=20 > I could look at a faster software implementation, but I guess most of > the value is when hashing is done on the NIC. In my benchmarking (a couple of years ago) the software path never = really turned up a lot. If you end up with a flow migrating from an RSS = NIC to a non-RSS NIC, you fall back on the 'reservation' hash table, = using the conventional hash and picking up contention, but you don't end = up doing the software version of Toeplitz per-packet. The only reason we = need a software implementation (currently) is to do an initial placement = of a new outbound flow into the hash table prior to receiving a packet = with the hardware-generated hash on it. For the inbound direction, we = can pick it up from the first packet. (Although, actually, we also need = to do it for inbound flows that come from non-RSS NICs -- or localhost = or such). Robert= From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 11:58:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11108C3B; Mon, 17 Mar 2014 11:58:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E6029A22; Mon, 17 Mar 2014 11:58:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2HBwneY027882; Mon, 17 Mar 2014 11:58:49 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2HBwnQ7027877; Mon, 17 Mar 2014 11:58:49 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403171158.s2HBwnQ7027877@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 17 Mar 2014 11:58:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263264 - head/usr.bin/talk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 11:58:50 -0000 Author: glebius Date: Mon Mar 17 11:58:48 2014 New Revision: 263264 URL: http://svnweb.freebsd.org/changeset/base/263264 Log: Make talk(1) capable of displaying UTF-8 characters. Sponsored by: Nginx, Inc. Modified: head/usr.bin/talk/Makefile head/usr.bin/talk/display.c head/usr.bin/talk/io.c head/usr.bin/talk/talk.h Modified: head/usr.bin/talk/Makefile ============================================================================== --- head/usr.bin/talk/Makefile Mon Mar 17 09:01:01 2014 (r263263) +++ head/usr.bin/talk/Makefile Mon Mar 17 11:58:48 2014 (r263264) @@ -4,7 +4,7 @@ PROG= talk SRCS= ctl.c ctl_transact.c display.c get_addrs.c get_iface.c get_names.c \ init_disp.c invite.c io.c look_up.c msgs.c talk.c -DPADD= ${LIBCURSES} -LDADD= -lcurses +DPADD= ${LIBCURSESW} +LDADD= -lcursesw .include Modified: head/usr.bin/talk/display.c ============================================================================== --- head/usr.bin/talk/display.c Mon Mar 17 09:01:01 2014 (r263263) +++ head/usr.bin/talk/display.c Mon Mar 17 11:58:48 2014 (r263264) @@ -41,9 +41,14 @@ static const char sccsid[] = "@(#)displa */ #include #include +#include +#define _XOPEN_SOURCE_EXTENDED +#include #include "talk.h" +void display(xwin_t *, wchar_t *); + xwin_t my_win; xwin_t his_win; WINDOW *line_win; @@ -61,111 +66,130 @@ max(int a, int b) return (a > b ? a : b); } +static cchar_t * +makecchar(wchar_t in) +{ + static cchar_t cc; + wchar_t wc[2]; + + wc[0] = in; + wc[1] = L'\0'; + + if (setcchar(&cc, wc, A_NORMAL, 0, NULL) != OK) + p_error("settchar(3) failure"); + + return (&cc); +} + /* - * Display some text on somebody's window, processing some control + * Display a symbol on somebody's window, processing some control * characters while we are at it. */ void -display(xwin_t *win, char *text, int size) +display(xwin_t *win, wchar_t *wc) { - int i; - char cch; - for (i = 0; i < size; i++) { - if (*text == '\n' || *text == '\r') { - waddch(win->x_win, '\n'); - getyx(win->x_win, win->x_line, win->x_col); - text++; - continue; - } - if (*text == 004 && win == &my_win) { - /* control-D clears the screen */ + /* + * Alas, can't use variables in C switch statement. + * Workaround these 3 cases with goto. + */ + if (*wc == win->kill) + goto kill; + else if (*wc == win->cerase) + goto cerase; + else if (*wc == win->werase) + goto werase; + + switch (*wc) { + case L'\n': + case L'\r': + wadd_wch(win->x_win, makecchar(L'\n')); + getyx(win->x_win, win->x_line, win->x_col); + wrefresh(win->x_win); + return; + + case 004: + if (win == &my_win) { + /* Ctrl-D clears the screen. */ werase(my_win.x_win); getyx(my_win.x_win, my_win.x_line, my_win.x_col); wrefresh(my_win.x_win); werase(his_win.x_win); getyx(his_win.x_win, his_win.x_line, his_win.x_col); wrefresh(his_win.x_win); - text++; - continue; } + return; - /* erase character */ - if ( *text == win->cerase - || *text == 010 /* BS */ - || *text == 0177 /* DEL */ - ) { - wmove(win->x_win, win->x_line, max(--win->x_col, 0)); - getyx(win->x_win, win->x_line, win->x_col); - waddch(win->x_win, ' '); - wmove(win->x_win, win->x_line, win->x_col); - getyx(win->x_win, win->x_line, win->x_col); - text++; - continue; - } + /* Erase character. */ + case 010: /* BS */ + case 0177: /* DEL */ +cerase: + wmove(win->x_win, win->x_line, max(--win->x_col, 0)); + getyx(win->x_win, win->x_line, win->x_col); + waddch(win->x_win, ' '); + wmove(win->x_win, win->x_line, win->x_col); + getyx(win->x_win, win->x_line, win->x_col); + wrefresh(win->x_win); + return; + + case 027: /* ^W */ +werase: + { /* * On word erase search backwards until we find * the beginning of a word or the beginning of * the line. */ - if ( *text == win->werase - || *text == 027 /* ^W */ - ) { - int endcol, xcol, ii, c; - - endcol = win->x_col; - xcol = endcol - 1; - while (xcol >= 0) { - c = readwin(win->x_win, win->x_line, xcol); - if (c != ' ') - break; - xcol--; - } - while (xcol >= 0) { - c = readwin(win->x_win, win->x_line, xcol); - if (c == ' ') - break; - xcol--; - } - wmove(win->x_win, win->x_line, xcol + 1); - for (ii = xcol + 1; ii < endcol; ii++) - waddch(win->x_win, ' '); - wmove(win->x_win, win->x_line, xcol + 1); - getyx(win->x_win, win->x_line, win->x_col); - text++; - continue; - } - /* line kill */ - if ( *text == win->kill - || *text == 025 /* ^U */ - ) { - wmove(win->x_win, win->x_line, 0); - wclrtoeol(win->x_win); - getyx(win->x_win, win->x_line, win->x_col); - text++; - continue; - } - if (*text == '\f') { - if (win == &my_win) - wrefresh(curscr); - text++; - continue; - } - if (*text == '\7') { - write(STDOUT_FILENO, text, 1); - text++; - continue; + int endcol, xcol, c; + + endcol = win->x_col; + xcol = endcol - 1; + while (xcol >= 0) { + c = readwin(win->x_win, win->x_line, xcol); + if (c != ' ') + break; + xcol--; + } + while (xcol >= 0) { + c = readwin(win->x_win, win->x_line, xcol); + if (c == ' ') + break; + xcol--; } - if (!isprint((unsigned char)*text) && *text != '\t') { - waddch(win->x_win, '^'); - getyx(win->x_win, win->x_line, win->x_col); - cch = (*text & 63) + 64; - waddch(win->x_win, cch); - } else - waddch(win->x_win, (unsigned char)*text); + wmove(win->x_win, win->x_line, xcol + 1); + for (int i = xcol + 1; i < endcol; i++) + waddch(win->x_win, ' '); + wmove(win->x_win, win->x_line, xcol + 1); + getyx(win->x_win, win->x_line, win->x_col); + wrefresh(win->x_win); + return; + } + + case 025: /* ^U */ +kill: + wmove(win->x_win, win->x_line, 0); + wclrtoeol(win->x_win); getyx(win->x_win, win->x_line, win->x_col); - text++; + wrefresh(win->x_win); + return; + + case L'\f': + if (win == &my_win) + wrefresh(curscr); + return; + + case L'\7': + write(STDOUT_FILENO, wc, sizeof(*wc)); + return; } + + + if (iswprint(*wc) || *wc == L'\t') + wadd_wch(win->x_win, makecchar(*wc)); + else + beep(); + + getyx(win->x_win, win->x_line, win->x_col); wrefresh(win->x_win); } Modified: head/usr.bin/talk/io.c ============================================================================== --- head/usr.bin/talk/io.c Mon Mar 17 09:01:01 2014 (r263263) +++ head/usr.bin/talk/io.c Mon Mar 17 11:58:48 2014 (r263264) @@ -46,14 +46,17 @@ static const char sccsid[] = "@(#)io.c 8 #include #include #include +#include #include #include #include +#define _XOPEN_SOURCE_EXTENDED +#include #include "talk.h" #include "talk_ctl.h" -#define A_LONG_TIME 10000000 +extern void display(xwin_t *, wchar_t *); volatile sig_atomic_t gotwinch = 0; @@ -65,9 +68,10 @@ talk(void) { struct hostent *hp, *hp2; int nb; - fd_set read_set, read_template; - char buf[BUFSIZ], **addr, *his_machine_name; - struct timeval wait; + fd_set read_set; + wchar_t buf[BUFSIZ]; + char **addr, *his_machine_name; + FILE *sockfp; his_machine_name = NULL; hp = gethostbyaddr((const char *)&his_machine_addr.s_addr, @@ -85,64 +89,58 @@ talk(void) } if (his_machine_name == NULL) his_machine_name = strdup(inet_ntoa(his_machine_addr)); - snprintf(buf, sizeof(buf), "Connection established with %s@%s.", + snprintf((char *)buf, sizeof(buf), "Connection established with %s@%s.", msg.r_name, his_machine_name); free(his_machine_name); - message(buf); + message((char *)buf); write(STDOUT_FILENO, "\007\007\007", 3); current_line = 0; + if ((sockfp = fdopen(sockt, "w+")) == NULL) + p_error("fdopen"); + + setvbuf(sockfp, NULL, _IONBF, 0); + setvbuf(stdin, NULL, _IONBF, 0); + /* - * Wait on both the other process (sockt_mask) and - * standard input ( STDIN_MASK ) + * Wait on both the other process (sockt) and standard input. */ - FD_ZERO(&read_template); - FD_SET(sockt, &read_template); - FD_SET(fileno(stdin), &read_template); for (;;) { - read_set = read_template; - wait.tv_sec = A_LONG_TIME; - wait.tv_usec = 0; - nb = select(32, &read_set, 0, 0, &wait); + FD_ZERO(&read_set); + FD_SET(sockt, &read_set); + FD_SET(fileno(stdin), &read_set); + nb = select(32, &read_set, 0, 0, NULL); if (gotwinch) { resize_display(); gotwinch = 0; } if (nb <= 0) { - if (errno == EINTR) { - read_set = read_template; + if (errno == EINTR) continue; - } - /* panic, we don't know what happened */ + /* Panic, we don't know what happened. */ p_error("Unexpected error from select"); quit(); } if (FD_ISSET(sockt, &read_set)) { - /* There is data on sockt */ - nb = read(sockt, buf, sizeof buf); - if (nb <= 0) { + wint_t w; + + /* There is data on sockt. */ + w = fgetwc(sockfp); + if (w == WEOF) { message("Connection closed. Exiting"); quit(); } - display(&his_win, buf, nb); + display(&his_win, &w); } if (FD_ISSET(fileno(stdin), &read_set)) { - /* - * We can't make the tty non_blocking, because - * curses's output routines would screw up - */ - int i; - ioctl(0, FIONREAD, (void *) &nb); - if (nb > (ssize_t)(sizeof buf)) - nb = sizeof buf; - nb = read(STDIN_FILENO, buf, nb); - display(&my_win, buf, nb); - /* might lose data here because sockt is non-blocking */ - for (i = 0; i < nb; ++i) - if (buf[i] == '\r') - buf[i] = '\n'; - write(sockt, buf, nb); + wint_t w; + + if ((w = getwchar()) != WEOF) { + display(&my_win, &w); + (void )fputwc(w, sockfp); + (void )fflush(sockfp); + } } } } Modified: head/usr.bin/talk/talk.h ============================================================================== --- head/usr.bin/talk/talk.h Mon Mar 17 09:01:01 2014 (r263263) +++ head/usr.bin/talk/talk.h Mon Mar 17 11:58:48 2014 (r263264) @@ -69,7 +69,6 @@ extern int check_local(void); extern void check_writeable(void); extern void ctl_transact(struct in_addr,CTL_MSG,int,CTL_RESPONSE *); extern void disp_msg(int); -extern void display(xwin_t *, char *, int); extern void end_msgs(void); extern void get_addrs(const char *, const char *); extern int get_iface(struct in_addr *, struct in_addr *); From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 12:08:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C20F2D3; Mon, 17 Mar 2014 12:08:08 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9774CB50; Mon, 17 Mar 2014 12:08:07 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s2HC7oV0066711 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 17 Mar 2014 16:07:50 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s2HC7oot066710; Mon, 17 Mar 2014 16:07:50 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 17 Mar 2014 16:07:50 +0400 From: Gleb Smirnoff To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r263264 - head/usr.bin/talk Message-ID: <20140317120750.GK40073@FreeBSD.org> References: <201403171158.s2HBwnQ7027877@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201403171158.s2HBwnQ7027877@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 12:08:08 -0000 On Mon, Mar 17, 2014 at 11:58:49AM +0000, Gleb Smirnoff wrote: T> Author: glebius T> Date: Mon Mar 17 11:58:48 2014 T> New Revision: 263264 T> URL: http://svnweb.freebsd.org/changeset/base/263264 T> T> Log: T> Make talk(1) capable of displaying UTF-8 characters. NB: the network talk protocol is a protocol originating from 4.3BSD, that never underwent any standardization. It consists of the talkd(8) daemon, that runs via inetd(8) and initiates a talk session between remote users, and the talk(1) utility that displays the actual chatting session. The session initialization is defined as protocol in /usr/include/protocols/talkd.h The protocol even has version field, so can be carefully extended. However, nothing is said about contents of the stream session established. Apparently, original authors didn't care about locale awareness of the utility. I decided not to touch the protocol version. Here are my reasons: 1) The signalling protocol didn't change. Only stream session, which isn't defined. 2) I doubt anyone in modern world runs talk(1) over a network wider than 127.0.0.0/8. Moreover, only extremely old fashioned geeks run it at all. 3) The interoperability isn't broken at all, it is only extended. If both sides of session run same locale, they communicate correctly. Plain ASCII or KOI8-R work as they did before. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 13:54:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECB22A44; Mon, 17 Mar 2014 13:54:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D9C8F7C0; Mon, 17 Mar 2014 13:54:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2HDsrd3075886; Mon, 17 Mar 2014 13:54:53 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2HDsr8h075885; Mon, 17 Mar 2014 13:54:53 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403171354.s2HDsr8h075885@svn.freebsd.org> From: Ian Lepore Date: Mon, 17 Mar 2014 13:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263265 - head/sys/boot/uboot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 13:54:54 -0000 Author: ian Date: Mon Mar 17 13:54:53 2014 New Revision: 263265 URL: http://svnweb.freebsd.org/changeset/base/263265 Log: Fix the paren nesting so that the network device is probed if the load device type is either network or wildcard. Modified: head/sys/boot/uboot/common/main.c Modified: head/sys/boot/uboot/common/main.c ============================================================================== --- head/sys/boot/uboot/common/main.c Mon Mar 17 11:58:48 2014 (r263264) +++ head/sys/boot/uboot/common/main.c Mon Mar 17 13:54:53 2014 (r263265) @@ -446,8 +446,8 @@ main(void) break; } - if (load_type == -1 || ((load_type & DEV_TYP_NET) && - strcmp(devsw[i]->dv_name, "net") == 0)) + if ((load_type == -1 || (load_type & DEV_TYP_NET)) && + strcmp(devsw[i]->dv_name, "net") == 0) break; } From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 14:19:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DEC9C2D2; Mon, 17 Mar 2014 14:19:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CB3DE9D9; Mon, 17 Mar 2014 14:19:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2HEJgL1084784; Mon, 17 Mar 2014 14:19:42 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2HEJg24084783; Mon, 17 Mar 2014 14:19:42 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201403171419.s2HEJg24084783@svn.freebsd.org> From: Robert Watson Date: Mon, 17 Mar 2014 14:19:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263266 - head/usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 14:19:42 -0000 Author: rwatson Date: Mon Mar 17 14:19:42 2014 New Revision: 263266 URL: http://svnweb.freebsd.org/changeset/base/263266 Log: Line-wrapping tweak: make the sample jail command line fit in 80 characters. MFC after: 3 days Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Mon Mar 17 13:54:53 2014 (r263265) +++ head/usr.sbin/jail/jail.8 Mon Mar 17 14:19:42 2014 (r263266) @@ -898,8 +898,9 @@ or for running a virtual server. .Pp Start a shell in the jail: .Bd -literal -offset indent -jail -c path=/data/jail/testjail mount.devfs host.hostname=testhostname \\ - ip4.addr=192.0.2.100 command=/bin/sh +jail -c path=/data/jail/testjail mount.devfs \\ + host.hostname=testhostname ip4.addr=192.0.2.100 \\ + command=/bin/sh .Ed .Pp Assuming no errors, you will end up with a shell prompt within the jail. From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 16:10:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DAA0345A; Mon, 17 Mar 2014 16:10:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BA8B47D9; Mon, 17 Mar 2014 16:10:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2HGAgi4030551; Mon, 17 Mar 2014 16:10:42 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2HGAgQh030550; Mon, 17 Mar 2014 16:10:42 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403171610.s2HGAgQh030550@svn.freebsd.org> From: Ian Lepore Date: Mon, 17 Mar 2014 16:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263267 - head/sys/boot/uboot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 16:10:42 -0000 Author: ian Date: Mon Mar 17 16:10:42 2014 New Revision: 263267 URL: http://svnweb.freebsd.org/changeset/base/263267 Log: Cosmetic changes to printed output, mostly related to probing devices... - Display slice and partition as instead of 0 or -1 when they're not set to specific values (the paritition=-1 was confusing folks). - When loaderdev isn't set in the u-boot environment, say so rather than displaying unknown device ''. - Print the loader(8) ident/version info earlier, so that all device- related info appears together afterwards. The one change here that isn't purely cosmetic is to call setheap() earlier. The comment says "Initialise heap as early as possible", now that's more accurate. It shouldn't make any functional difference, but may be safer if future changes lead to trying to allocate memory earlier. Modified: head/sys/boot/uboot/common/main.c Modified: head/sys/boot/uboot/common/main.c ============================================================================== --- head/sys/boot/uboot/common/main.c Mon Mar 17 14:19:42 2014 (r263266) +++ head/sys/boot/uboot/common/main.c Mon Mar 17 16:10:42 2014 (r263267) @@ -128,7 +128,7 @@ meminfo(void) for (i = 0; i < 3; i++) { size = memsize(si, t[i]); if (size > 0) - printf("%s:\t %lldMB\n", ub_mem_type(t[i]), + printf("%s: %lldMB\n", ub_mem_type(t[i]), size / 1024 / 1024); } } @@ -198,18 +198,20 @@ get_load_device(int *type, int *unit, in const char *p; char *endp; - devstr = ub_env_get("loaderdev"); - if (devstr == NULL) - devstr = ""; - else - printf("U-Boot setting: loaderdev=%s\n", devstr); - - p = get_device_type(devstr, type); - + *type = -1; *unit = -1; *slice = 0; *partition = -1; + devstr = ub_env_get("loaderdev"); + if (devstr == NULL) { + printf("U-Boot env: loaderdev not set, will probe all devices.\n"); + return; + } + printf("U-Boot env: loaderdev='%s'\n", devstr); + + p = get_device_type(devstr, type); + /* * Empty device string, or unknown device name, or a bare, known * device name. @@ -297,6 +299,27 @@ get_load_device(int *type, int *unit, in *partition = -1; } +static void +print_disk_probe_info() +{ + char slice[32]; + char partition[32]; + + if (currdev.d_disk.slice > 0) + sprintf(slice, "%d", currdev.d_disk.slice); + else + strcpy(slice, ""); + + if (currdev.d_disk.partition > 0) + sprintf(partition, "%d", currdev.d_disk.partition); + else + strcpy(partition, ""); + + printf(" Checking unit=%d slice=%s partition=%s...", + currdev.d_unit, slice, partition); + +} + static int probe_disks(int devidx, int load_type, int load_unit, int load_slice, int load_partition) @@ -311,13 +334,11 @@ probe_disks(int devidx, int load_type, i open_result = -1; if (load_type == -1) { - printf("Probing all storage devices...\n"); + printf(" Probing all disk devices...\n"); /* Try each disk in succession until one works. */ for (currdev.d_unit = 0; currdev.d_unit < UB_MAX_DEV; currdev.d_unit++) { - printf("Checking unit=%d slice=%d partition=%d...", - currdev.d_unit, currdev.d_disk.slice, - currdev.d_disk.partition); + print_disk_probe_info(); open_result = devsw[devidx]->dv_open(&f, &currdev); if (open_result == 0) { printf(" good.\n"); @@ -329,15 +350,13 @@ probe_disks(int devidx, int load_type, i } if (load_unit == -1) { - printf("Probing all %s devices...\n", device_typename(load_type)); + printf(" Probing all %s devices...\n", device_typename(load_type)); /* Try each disk of given type in succession until one works. */ for (unit = 0; unit < UB_MAX_DEV; unit++) { currdev.d_unit = uboot_diskgetunit(load_type, unit); if (currdev.d_unit == -1) break; - printf("Checking unit=%d slice=%d partition=%d...", - currdev.d_unit, currdev.d_disk.slice, - currdev.d_disk.partition); + print_disk_probe_info(); open_result = devsw[devidx]->dv_open(&f, &currdev); if (open_result == 0) { printf(" good.\n"); @@ -349,18 +368,16 @@ probe_disks(int devidx, int load_type, i } if ((currdev.d_unit = uboot_diskgetunit(load_type, load_unit)) != -1) { - printf("Checking unit=%d slice=%d partition=%d...", - currdev.d_unit, currdev.d_disk.slice, - currdev.d_disk.partition); + print_disk_probe_info(); open_result = devsw[devidx]->dv_open(&f,&currdev); if (open_result == 0) { - printf("good.\n"); + printf(" good.\n"); return (0); } printf("\n"); } - printf("Requested disk type/unit not found\n"); + printf(" Requested disk type/unit not found\n"); return (-1); } @@ -393,21 +410,26 @@ main(void) bzero(__bss_start, _end - __bss_start); /* - * Set up console. - */ + * Initialise the heap as early as possible. Once this is done, + * alloc() is usable. The stack is buried inside us, so this is safe. + */ + setheap((void *)end, (void *)(end + 512 * 1024)); + + /* + * Set up console. + */ cons_probe(); + printf("Compatible U-Boot API signature found @%x\n", (uint32_t)sig); - printf("Compatible API signature found @%x\n", (uint32_t)sig); + printf("\n"); + printf("%s, Revision %s\n", bootprog_name, bootprog_rev); + printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n"); dump_sig(sig); dump_addr_info(); - /* - * Initialise the heap as early as possible. Once this is done, - * alloc() is usable. The stack is buried inside us, so this is - * safe. - */ - setheap((void *)end, (void *)(end + 512 * 1024)); + meminfo(); /* * Enumerate U-Boot devices @@ -416,11 +438,6 @@ main(void) panic("no U-Boot devices found"); printf("Number of U-Boot devices: %d\n", devs_no); - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); - meminfo(); - get_load_device(&load_type, &load_unit, &load_slice, &load_partition); /* From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 16:40:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAE44158; Mon, 17 Mar 2014 16:40:44 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id 96EC8AC8; Mon, 17 Mar 2014 16:40:44 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1WPaah-000M0T-1b; Mon, 17 Mar 2014 20:40:43 +0400 Date: Mon, 17 Mar 2014 20:40:43 +0400 From: Slawa Olhovchenkov To: Gleb Smirnoff Subject: Re: svn commit: r263140 - in head: . contrib/mdocml etc etc/defaults etc/mtree etc/rc.d gnu/usr.bin/groff/tmac include lib lib/libipx release/picobsd/bridge release/picobsd/qemu rescue/rescue sbin/ifco... Message-ID: <20140317164043.GA83327@zxy.spb.ru> References: <201403140258.s2E2wmYu034872@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201403140258.s2E2wmYu034872@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 16:40:45 -0000 On Fri, Mar 14, 2014 at 02:58:48AM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Fri Mar 14 02:58:48 2014 > New Revision: 263140 > URL: http://svnweb.freebsd.org/changeset/base/263140 > > Log: > Remove IPX support. > > IPX was a network transport protocol in Novell's NetWare network operating > system from late 80s and then 90s. The NetWare itself switched to TCP/IP > as default transport in 1998. Later, in this century the Novell Open > Enterprise Server became successor of Novell NetWare. The last release > that claimed to still support IPX was OES 2 in 2007. Routing equipment > vendors (e.g. Cisco) discontinued support for IPX in 2011. Just for truth: Cisco don't fully discontinued support for IPX in 2011. In 2011 Cisco discontinued support for IPX only in selected software lines: 15.1(3)S, 15.2(2)T, 15.1(1)SY, 15.2(1)E, and later. 12.4 supported to January 31, 2016 12.4T supported to November 30, 2016 15.0M supported to April 30, 2017 15.0S don't have EoL/EoS notice 15.1M supported to March 31, 2018 15.2M don't have EoL/EoS notice 15.3M don't have EoL/EoS notice From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 16:45:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0B8531A; Mon, 17 Mar 2014 16:45:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DD105B6B; Mon, 17 Mar 2014 16:45:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2HGjSTG046421; Mon, 17 Mar 2014 16:45:28 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2HGjSC7046420; Mon, 17 Mar 2014 16:45:28 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201403171645.s2HGjSC7046420@svn.freebsd.org> From: Roger Pau Monné Date: Mon, 17 Mar 2014 16:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263268 - head/sys/dev/xen/console X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 16:45:29 -0000 Author: royger Date: Mon Mar 17 16:45:28 2014 New Revision: 263268 URL: http://svnweb.freebsd.org/changeset/base/263268 Log: xen: fix usage of db_active in xen console Replace usage of db_active in Xen console with kdb_active. Reported by: Andrzej Tobola Approved by: gibbs Sponsored by: Citrix Systems R&D Modified: head/sys/dev/xen/console/console.c Modified: head/sys/dev/xen/console/console.c ============================================================================== --- head/sys/dev/xen/console/console.c Mon Mar 17 16:10:42 2014 (r263267) +++ head/sys/dev/xen/console/console.c Mon Mar 17 16:45:28 2014 (r263268) @@ -247,13 +247,12 @@ xc_cnputc(struct consdev *dev, int c) xc_cnputc_domu(dev, c); } -extern int db_active; static boolean_t xcons_putc(int c) { int force_flush = xc_mute || #ifdef DDB - db_active || + kdb_active || #endif panicstr; /* we're not gonna recover, so force * flush From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 17:00:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA2457CE for ; Mon, 17 Mar 2014 17:00:28 +0000 (UTC) Received: from cdptpa-oedge-vip.email.rr.com (cdptpa-outbound-snat.email.rr.com [107.14.166.231]) by mx1.freebsd.org (Postfix) with ESMTP id ADA2BCD8 for ; Mon, 17 Mar 2014 17:00:28 +0000 (UTC) Received: from [76.187.139.93] ([76.187.139.93:49344] helo=[192.168.0.22]) by cdptpa-oedge01 (envelope-from ) (ecelerity 3.5.0.35861 r(Momo-dev:tip)) with ESMTP id 78/F4-21197-42A27235; Mon, 17 Mar 2014 17:00:20 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: svn commit: r262810 - in head: release release/arm release/tools share/man/man7 From: Stacey Son In-Reply-To: <7F258CFC-FE2B-4631-B890-AC998CA27782@FreeBSD.org> Date: Mon, 17 Mar 2014 12:00:20 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <34B90EBE-93A5-4FB3-A41A-22CDD98517FD@FreeBSD.org> References: <201403052317.s25NHrVB057044@svn.freebsd.org> <40489767-8712-42CA-ABDA-852BAD902BAD@cl.cam.ac.uk> <20140306174755.GQ87036@glenbarber.us> <7F258CFC-FE2B-4631-B890-AC998CA27782@FreeBSD.org> To: David Chisnall X-Mailer: Apple Mail (2.1510) X-RR-Connecting-IP: 107.14.168.118:25 X-Cloudmark-Score: 0 Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 17:00:29 -0000 On Mar 6, 2014, at 11:50 AM, David Chisnall = wrote: >=20 > On 6 Mar 2014, at 17:47, Glen Barber wrote: >=20 >> On Thu, Mar 06, 2014 at 04:37:11PM +0000, David Chisnall wrote: >>> On 5 Mar 2014, at 23:17, Glen Barber wrote: >>>=20 >>>> After several months of testing and fixing (and breaking) >>>> various parts of release/release.sh changes, it is now >>>> possible to build FreeBSD/arm images as part of the release >>>> process. >>>=20 >>> That's great! How much effort would it be to add QEMU images for >>> ARM and MIPS images to the things that we build by default? I'd >>> love to see these built for ARM and MIPS as part of the Jenkins >>> builds and for releases. >>>=20 >>=20 >> It should be fairly trivial, however I've never had luck getting qemu = to >> run non-x86 images. Maybe I am doing it wrong, though. >=20 > Stacey may be able to help there. I think he did some = FreeBSD/MIPS-on-QEMU testing with the system emulation mode before = working on the user-mode emulation. Hi All, Sorry I have been in South American for about the last 11 days and away = from internet (mostly). =20 As for Qemu System-Mode emulation the following wiki page works for = MIPS... https://wiki.freebsd.org/FreeBSD/MipsEmulation I have not tried system-mode emulation for ARM but I have built a number = of ports using qemu user-mode (using my rather large patch) for that = arch. -stacey. From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 19:55:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6522EB0D; Mon, 17 Mar 2014 19:55:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 50F65139; Mon, 17 Mar 2014 19:55:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2HJtS5q025090; Mon, 17 Mar 2014 19:55:28 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2HJtSXm025089; Mon, 17 Mar 2014 19:55:28 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201403171955.s2HJtSXm025089@svn.freebsd.org> From: Alan Somers Date: Mon, 17 Mar 2014 19:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263271 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 19:55:28 -0000 Author: asomers Date: Mon Mar 17 19:55:27 2014 New Revision: 263271 URL: http://svnweb.freebsd.org/changeset/base/263271 Log: share/man/man9/counter.9 Fix logic error in the description of counter_u64_alloc: the command may fail only if M_NOWAIT is specified, not M_WAITOK. Reviewed by: glebius MFC after: 2 weeks Sponsored by: Spectra Logic Corporation Modified: head/share/man/man9/counter.9 Modified: head/share/man/man9/counter.9 ============================================================================== --- head/share/man/man9/counter.9 Mon Mar 17 19:09:39 2014 (r263270) +++ head/share/man/man9/counter.9 Mon Mar 17 19:55:27 2014 (r263271) @@ -91,7 +91,7 @@ wait flag, should be either or .Va M_WAITOK . If -.Va M_WAITOK +.Va M_NOWAIT is specified the operation may fail. .It Fn counter_u64_free c Free the previously allocated counter From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 19:58:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A23FD72; Mon, 17 Mar 2014 19:58:27 +0000 (UTC) Received: from mail-qc0-x22c.google.com (mail-qc0-x22c.google.com [IPv6:2607:f8b0:400d:c01::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 10B7816D; Mon, 17 Mar 2014 19:58:26 +0000 (UTC) Received: by mail-qc0-f172.google.com with SMTP id i8so6567653qcq.17 for ; Mon, 17 Mar 2014 12:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=RSppg1VBene+fOQlxAWC5uv0qBTVoHL5bvt9rygeCD4=; b=CZpUEJzoyAgHCxy3f3Bjvb0XJHOQQYiQ1iOEqkswNeuHmxPHY466r5J6XvZ0aQYt+A BZsl1emBlenNbXY9bPM68L1mmfiYApxmO5Tk/ziKbdM01rxoMRQq6BrYYplt6yq8Odlv iHkMeZNIWvY1T7ix65XilVUYbDai4iWrtW0lS06wtP3HkvC3c2bz4ZuiXPVDB6JlCWzj ePh4p18uO6JdVBsNBTl0d05Q9gRVtP5wMqeIPROz39I7VlLR1AOBbMzz2NdMgBNcKUmX NMuV+y0zbYS3q/37WMmTjNUywzkTrqJsu/WIeatD5veStOkDhC6DLAyr8mN+02dsmo7T kfdg== MIME-Version: 1.0 X-Received: by 10.224.79.133 with SMTP id p5mr4503035qak.98.1395086306229; Mon, 17 Mar 2014 12:58:26 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.8.137 with HTTP; Mon, 17 Mar 2014 12:58:26 -0700 (PDT) In-Reply-To: References: <201403150057.s2F0vofg081606@svn.freebsd.org> <20140317075436.GA5864@walton.maths.tcd.ie> Date: Mon, 17 Mar 2014 12:58:26 -0700 X-Google-Sender-Auth: B6UR16eVeNUnyoRITuiReFJG5Ts Message-ID: Subject: Re: svn commit: r263198 - in head/sys: amd64/conf conf net netinet netinet6 sys From: Adrian Chadd To: "Robert N. M. Watson" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: David Malone , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 19:58:27 -0000 On 17 March 2014 01:26, Robert N. M. Watson wrote: > > On 17 Mar 2014, at 07:54, David Malone wrote: > >>> (1) Merge a software implementation of the Toeplitz hash specified in >>> RSS implemented by David Malone. This is used to allow suitable >>> pcbgroup placement of connections before the first packet is >>> received from the NIC. Software hashing is generally avoided, >>> however, due to high cost of the hash on general-purpose CPUs. >> >> I could look at a faster software implementation, but I guess most of >> the value is when hashing is done on the NIC. > > In my benchmarking (a couple of years ago) the software path never really= turned up a lot. If you end up with a flow migrating from an RSS NIC to a = non-RSS NIC, you fall back on the 'reservation' hash table, using the conve= ntional hash and picking up contention, but you don't end up doing the soft= ware version of Toeplitz per-packet. The only reason we need a software imp= lementation (currently) is to do an initial placement of a new outbound flo= w into the hash table prior to receiving a packet with the hardware-generat= ed hash on it. For the inbound direction, we can pick it up from the first = packet. (Although, actually, we also need to do it for inbound flows that c= ome from non-RSS NICs -- or localhost or such). If it's done right, then yes, we should only see a per-packet RSS hash on: * NICs / paths that don't do it in hardware on the receive side; * Doing per-packet sanity checking - ie, doing a software RSS as well as the hardware RSS in order to verify that they both line up. I plan on adding the latter at some point soon so we can ensure that things end up on the right queue. For higher connection rate workloads, we want to ensure that the initial hash selection for outbound matches the inbound, as we don't want to be grabbing non-local-CPU locks to migrate connections to other pcbgroups after they've been established. We absolutely want to keep things on the local CPU as much as we can. Thanks! -a From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 22:30:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 147A91DD; Mon, 17 Mar 2014 22:30:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0158A1B0; Mon, 17 Mar 2014 22:30:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2HMUs8u090241; Mon, 17 Mar 2014 22:30:54 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2HMUsvk090240; Mon, 17 Mar 2014 22:30:54 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201403172230.s2HMUsvk090240@svn.freebsd.org> From: Jim Harris Date: Mon, 17 Mar 2014 22:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263275 - head/sys/dev/isci/scil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 22:30:55 -0000 Author: jimharris Date: Mon Mar 17 22:30:54 2014 New Revision: 263275 URL: http://svnweb.freebsd.org/changeset/base/263275 Log: isci: Ensure ATA passthrough commands with RETURN_RESPONSE bit set translate their response. Sponsored by: Intel Discussed with: scottl MFC after: 3 days Modified: head/sys/dev/isci/scil/sati_passthrough.c Modified: head/sys/dev/isci/scil/sati_passthrough.c ============================================================================== --- head/sys/dev/isci/scil/sati_passthrough.c Mon Mar 17 21:45:08 2014 (r263274) +++ head/sys/dev/isci/scil/sati_passthrough.c Mon Mar 17 22:30:54 2014 (r263275) @@ -441,6 +441,13 @@ SATI_STATUS sati_passthrough_16_translat sati_set_ata_lba_mid_exp(register_fis, sati_get_cdb_byte(cdb, 9)); sati_set_ata_lba_high_exp(register_fis, sati_get_cdb_byte(cdb, 11)); } + + if (PASSTHROUGH_CDB_CK_COND(cdb) || + PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_RETURN_RESPONSE) + { + sequence->is_translate_response_required = TRUE; + } + sati_set_ata_features(register_fis, sati_get_cdb_byte(cdb, 4)); sati_set_ata_sector_count(register_fis, sati_get_cdb_byte(cdb, 6)); sati_set_ata_lba_low(register_fis, sati_get_cdb_byte(cdb, 8)); @@ -483,6 +490,8 @@ SATI_STATUS sati_passthrough_translate_r return SATI_FAILURE_CHECK_RESPONSE_DATA; } + sequence->state = SATI_SEQUENCE_STATE_FINAL; + // If the user set the check condition bit, fill out the sense data if (PASSTHROUGH_CDB_CK_COND(cdb) || PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_RETURN_RESPONSE) @@ -496,10 +505,9 @@ SATI_STATUS sati_passthrough_translate_r SCSI_ASC_NO_ADDITIONAL_SENSE, SCSI_ASCQ_ATA_PASS_THROUGH_INFORMATION_AVAILABLE ); + return SATI_FAILURE_CHECK_RESPONSE_DATA; } - sequence->state = SATI_SEQUENCE_STATE_FINAL; - return SATI_COMPLETE; } From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 22:32:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB65F33D; Mon, 17 Mar 2014 22:32:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B7C7B233; Mon, 17 Mar 2014 22:32:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2HMWtKM090838; Mon, 17 Mar 2014 22:32:55 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2HMWsYJ090832; Mon, 17 Mar 2014 22:32:54 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201403172232.s2HMWsYJ090832@svn.freebsd.org> From: Jim Harris Date: Mon, 17 Mar 2014 22:32:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263276 - head/sys/dev/isci/scil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 22:32:56 -0000 Author: jimharris Date: Mon Mar 17 22:32:54 2014 New Revision: 263276 URL: http://svnweb.freebsd.org/changeset/base/263276 Log: Base the max number of SG elements on MAXPHYS. Sponsored by: Intel Discussed with: scottl, emax MFC after: 3 days Modified: head/sys/dev/isci/scil/sati_util.h head/sys/dev/isci/scil/sci_controller_constants.h head/sys/dev/isci/scil/sci_util.h head/sys/dev/isci/scil/scic_sds_request.h Modified: head/sys/dev/isci/scil/sati_util.h ============================================================================== --- head/sys/dev/isci/scil/sati_util.h Mon Mar 17 22:30:54 2014 (r263275) +++ head/sys/dev/isci/scil/sati_util.h Mon Mar 17 22:32:54 2014 (r263276) @@ -62,6 +62,8 @@ * structure data, fill in sense data, etc. */ +#include + #include #include @@ -144,15 +146,6 @@ #define ATA_MICROCODE_OFFSET_DOWNLOAD 0x03 #define ATA_MICROCODE_DOWNLOAD_SAVE 0x07 -#ifndef MIN -#define MIN(x,y) ((x) < (y) ? (x) : (y)) -#endif - -#ifndef MAX -#define MAX(x,y) ((x) > (y) ? (x) : (y)) -#endif - - void sati_ata_non_data_command( void * ata_io, SATI_TRANSLATOR_SEQUENCE_T * sequence Modified: head/sys/dev/isci/scil/sci_controller_constants.h ============================================================================== --- head/sys/dev/isci/scil/sci_controller_constants.h Mon Mar 17 22:30:54 2014 (r263275) +++ head/sys/dev/isci/scil/sci_controller_constants.h Mon Mar 17 22:32:54 2014 (r263276) @@ -54,6 +54,8 @@ #ifndef _SCI_CONTROLLER_CONSTANTS_H_ #define _SCI_CONTROLLER_CONSTANTS_H_ +#include + /** * @file * @@ -148,8 +150,13 @@ extern "C" { /** * This constant defines the maximum number of Scatter-Gather Elements * to be used by any SCI component. + * + * Note: number of elements must be an even number, since descriptors + * posted to hardware always contain pairs of elements (with second + * element set to zeroes if not needed). */ -#define SCI_MAX_SCATTER_GATHER_ELEMENTS 130 +#define __MAXPHYS_ELEMENTS ((MAXPHYS / PAGE_SIZE) + 1) +#define SCI_MAX_SCATTER_GATHER_ELEMENTS ((__MAXPHYS_ELEMENTS + 1) & ~0x1) #endif #ifndef SCI_MIN_SCATTER_GATHER_ELEMENTS Modified: head/sys/dev/isci/scil/sci_util.h ============================================================================== --- head/sys/dev/isci/scil/sci_util.h Mon Mar 17 22:30:54 2014 (r263275) +++ head/sys/dev/isci/scil/sci_util.h Mon Mar 17 22:32:54 2014 (r263276) @@ -54,20 +54,14 @@ #ifndef _SCI_UTIL_H_ #define _SCI_UTIL_H_ +#include + #include #ifndef ARRAY_SIZE #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) #endif -#ifndef MIN -#define MIN(x,y) ((x) < (y) ? (x) : (y)) -#endif - -#ifndef MAX -#define MAX(x,y) ((x) > (y) ? (x) : (y)) -#endif - /** * Normal byte swap macro */ Modified: head/sys/dev/isci/scil/scic_sds_request.h ============================================================================== --- head/sys/dev/isci/scil/scic_sds_request.h Mon Mar 17 22:30:54 2014 (r263275) +++ head/sys/dev/isci/scil/scic_sds_request.h Mon Mar 17 22:32:54 2014 (r263276) @@ -65,6 +65,8 @@ extern "C" { #endif // __cplusplus +#include + #include #include @@ -331,7 +333,6 @@ extern SCIC_SDS_IO_REQUEST_STATE_HANDLER #define scic_sds_request_get_task_context(request) \ ((request)->task_context_buffer) -#define CACHE_LINE_SIZE (64) #define scic_sds_request_align_task_context_buffer(address) \ ((SCU_TASK_CONTEXT_T *)( \ (((POINTER_UINT)(address)) + (CACHE_LINE_SIZE - 1)) \ From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 22:36:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 401444AE; Mon, 17 Mar 2014 22:36:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2CEEE24D; Mon, 17 Mar 2014 22:36:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2HMa5gT091312; Mon, 17 Mar 2014 22:36:05 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2HMa54N091311; Mon, 17 Mar 2014 22:36:05 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201403172236.s2HMa54N091311@svn.freebsd.org> From: Jim Harris Date: Mon, 17 Mar 2014 22:36:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263277 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 22:36:05 -0000 Author: jimharris Date: Mon Mar 17 22:36:04 2014 New Revision: 263277 URL: http://svnweb.freebsd.org/changeset/base/263277 Log: nvme: Remove the software progress marker SET_FEATURE command during controller initialization. The spec says OS drivers should send this command after controller initialization completes successfully, but other NVMe OS drivers are not sending this command. This change will therefore reduce differences between the FreeBSD and other OS drivers. Sponsored by: Intel MFC after: 3 days Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Mon Mar 17 22:32:54 2014 (r263276) +++ head/sys/dev/nvme/nvme_ctrlr.c Mon Mar 17 22:36:04 2014 (r263277) @@ -842,16 +842,6 @@ nvme_ctrlr_start(void *ctrlr_arg) for (i = 0; i < ctrlr->num_io_queues; i++) nvme_io_qpair_enable(&ctrlr->ioq[i]); - - /* - * Clear software progress marker to 0, to indicate to pre-boot - * software that OS driver load was successful. - * - * Chatham does not support this feature. - */ - if (pci_get_devid(ctrlr->dev) != CHATHAM_PCI_ID) - nvme_ctrlr_cmd_set_feature(ctrlr, - NVME_FEAT_SOFTWARE_PROGRESS_MARKER, 0, NULL, 0, NULL, NULL); } void From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 22:37:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2166608; Mon, 17 Mar 2014 22:37:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AEFC426A; Mon, 17 Mar 2014 22:37:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2HMbHT9091505; Mon, 17 Mar 2014 22:37:17 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2HMbH6l091504; Mon, 17 Mar 2014 22:37:17 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201403172237.s2HMbH6l091504@svn.freebsd.org> From: Jim Harris Date: Mon, 17 Mar 2014 22:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263278 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 22:37:17 -0000 Author: jimharris Date: Mon Mar 17 22:37:17 2014 New Revision: 263278 URL: http://svnweb.freebsd.org/changeset/base/263278 Log: nvme: NVMe specification dictates 4-byte alignment for PRPs (not 8). Sponsored by: Intel MFC after: 3 days Modified: head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Mon Mar 17 22:36:04 2014 (r263277) +++ head/sys/dev/nvme/nvme_qpair.c Mon Mar 17 22:37:17 2014 (r263278) @@ -498,8 +498,9 @@ nvme_qpair_construct(struct nvme_qpair * mtx_init(&qpair->lock, "nvme qpair lock", NULL, MTX_DEF); + /* Note: NVMe PRP format is restricted to 4-byte alignment. */ bus_dma_tag_create(bus_get_dma_tag(ctrlr->dev), - sizeof(uint64_t), PAGE_SIZE, BUS_SPACE_MAXADDR, + 4, PAGE_SIZE, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, NVME_MAX_XFER_SIZE, (NVME_MAX_XFER_SIZE/PAGE_SIZE)+1, PAGE_SIZE, 0, NULL, NULL, &qpair->dma_tag); From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 23:21:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EEC35DE0; Mon, 17 Mar 2014 23:21:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C1A75856; Mon, 17 Mar 2014 23:21:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2HNLVd3011140; Mon, 17 Mar 2014 23:21:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2HNLVSS011139; Mon, 17 Mar 2014 23:21:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403172321.s2HNLVSS011139@svn.freebsd.org> From: Adrian Chadd Date: Mon, 17 Mar 2014 23:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263279 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 23:21:32 -0000 Author: adrian Date: Mon Mar 17 23:21:31 2014 New Revision: 263279 URL: http://svnweb.freebsd.org/changeset/base/263279 Log: Implement apb_print_child(). Tested: * AR9344, Atheros DB120 Reference board Modified: head/sys/mips/atheros/apb.c Modified: head/sys/mips/atheros/apb.c ============================================================================== --- head/sys/mips/atheros/apb.c Mon Mar 17 22:37:17 2014 (r263278) +++ head/sys/mips/atheros/apb.c Mon Mar 17 23:21:31 2014 (r263279) @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); #define dprintf(x, arg...) #endif /* APB_DEBUG */ +#define DEVTOAPB(dev) ((struct apb_ivar *) device_get_ivars(dev)) + static int apb_activate_resource(device_t, device_t, int, int, struct resource *); static device_t apb_add_child(device_t, u_int, const char *, int); @@ -477,6 +479,37 @@ apb_get_resource_list(device_t dev, devi return (&(ivar->resources)); } +static int +apb_print_all_resources(device_t dev) +{ + struct apb_ivar *ndev = DEVTOAPB(dev); + struct resource_list *rl = &ndev->resources; + int retval = 0; + + if (STAILQ_FIRST(rl)) + retval += printf(" at"); + + retval += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); + retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + + return (retval); +} + +static int +apb_print_child(device_t bus, device_t child) +{ + int retval = 0; + + retval += bus_print_child_header(bus, child); + retval += apb_print_all_resources(child); + if (device_get_flags(child)) + retval += printf(" flags %#x", device_get_flags(child)); + retval += printf(" on %s\n", device_get_nameunit(bus)); + + return (retval); +} + + static device_method_t apb_methods[] = { DEVMETHOD(bus_activate_resource, apb_activate_resource), DEVMETHOD(bus_add_child, apb_add_child), @@ -491,6 +524,7 @@ static device_method_t apb_methods[] = { DEVMETHOD(device_probe, apb_probe), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), + DEVMETHOD(bus_print_child, apb_print_child), DEVMETHOD_END }; From owner-svn-src-head@FreeBSD.ORG Mon Mar 17 23:30:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 112F839E; Mon, 17 Mar 2014 23:30:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F1AC6949; Mon, 17 Mar 2014 23:30:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2HNUcwP012823; Mon, 17 Mar 2014 23:30:38 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2HNUcch012821; Mon, 17 Mar 2014 23:30:38 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201403172330.s2HNUcch012821@svn.freebsd.org> From: Neel Natu Date: Mon, 17 Mar 2014 23:30:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263280 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 23:30:39 -0000 Author: neel Date: Mon Mar 17 23:30:38 2014 New Revision: 263280 URL: http://svnweb.freebsd.org/changeset/base/263280 Log: Notify vcpus participating in the rendezvous of the pending event to ensure that they execute the rendezvous function as soon as possible. Modified: head/sys/amd64/vmm/vmm.c Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Mon Mar 17 23:21:31 2014 (r263279) +++ head/sys/amd64/vmm/vmm.c Mon Mar 17 23:30:38 2014 (r263280) @@ -1657,6 +1657,8 @@ void vm_smp_rendezvous(struct vm *vm, int vcpuid, cpuset_t dest, vm_rendezvous_func_t func, void *arg) { + int i; + /* * Enforce that this function is called without any locks */ @@ -1687,6 +1689,15 @@ restart: vm_set_rendezvous_func(vm, func); mtx_unlock(&vm->rendezvous_mtx); + /* + * Wake up any sleeping vcpus and trigger a VM-exit in any running + * vcpus so they handle the rendezvous as soon as possible. + */ + for (i = 0; i < VM_MAXCPU; i++) { + if (CPU_ISSET(i, &dest)) + vcpu_notify_event(vm, i, false); + } + vm_handle_rendezvous(vm, vcpuid); } From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 01:14:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4374E268; Tue, 18 Mar 2014 01:14:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2F5882F3; Tue, 18 Mar 2014 01:14:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2I1Eolo057724; Tue, 18 Mar 2014 01:14:50 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2I1Eojq057723; Tue, 18 Mar 2014 01:14:50 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403180114.s2I1Eojq057723@svn.freebsd.org> From: Bryan Drewery Date: Tue, 18 Mar 2014 01:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263287 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 01:14:50 -0000 Author: bdrewery Date: Tue Mar 18 01:14:49 2014 New Revision: 263287 URL: http://svnweb.freebsd.org/changeset/base/263287 Log: 'pkg(8) add' has no internal restriction on number of packages. Submitted by: tj MFC after: 1 week Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Tue Mar 18 01:00:14 2014 (r263286) +++ head/tools/tools/nanobsd/nanobsd.sh Tue Mar 18 01:14:49 2014 (r263287) @@ -809,10 +809,9 @@ cust_pkgng () ( 'env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg info | /usr/bin/wc -l'` # Attempt to install more packages - # ...but no more than 200 at a time due to (XXX still the case?) pkg_add's internal # limitations. chroot ${NANO_WORLDDIR} sh -c \ - 'ls Pkg/*txz | xargs -n 200 env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg add ' || true + 'ls Pkg/*txz | xargs env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg add ' || true # See what that got us now=`chroot ${NANO_WORLDDIR} sh -c \ From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 01:17:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F042144C; Tue, 18 Mar 2014 01:17:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DD5F530C; Tue, 18 Mar 2014 01:17:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2I1H8uf058066; Tue, 18 Mar 2014 01:17:08 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2I1H8GN058065; Tue, 18 Mar 2014 01:17:08 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403180117.s2I1H8GN058065@svn.freebsd.org> From: Bryan Drewery Date: Tue, 18 Mar 2014 01:17:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263288 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 01:17:09 -0000 Author: bdrewery Date: Tue Mar 18 01:17:08 2014 New Revision: 263288 URL: http://svnweb.freebsd.org/changeset/base/263288 Log: Remove comment meant for removal in r263287 X-MFC-with: 263287 Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Tue Mar 18 01:14:49 2014 (r263287) +++ head/tools/tools/nanobsd/nanobsd.sh Tue Mar 18 01:17:08 2014 (r263288) @@ -809,7 +809,6 @@ cust_pkgng () ( 'env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg info | /usr/bin/wc -l'` # Attempt to install more packages - # limitations. chroot ${NANO_WORLDDIR} sh -c \ 'ls Pkg/*txz | xargs env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg add ' || true From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 01:40:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7893AF8; Tue, 18 Mar 2014 01:40:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D01026CD; Tue, 18 Mar 2014 01:40:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2I1eYYN066951; Tue, 18 Mar 2014 01:40:34 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2I1ePds066900; Tue, 18 Mar 2014 01:40:25 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403180140.s2I1ePds066900@svn.freebsd.org> From: Ed Maste Date: Tue, 18 Mar 2014 01:40:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263289 - in head: contrib/file contrib/pf/pflogd contrib/tnftp contrib/vis lib/libedit share/man/man9 sys/compat/svr4 sys/dev/esp sys/dev/le sys/dev/usb/serial sys/mips/cavium sys/mips... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 01:40:35 -0000 Author: emaste Date: Tue Mar 18 01:40:25 2014 New Revision: 263289 URL: http://svnweb.freebsd.org/changeset/base/263289 Log: Update NetBSD Foundation copyrights to 2-clause BSD The NetBSD Foundation states "Third parties are encouraged to change the license on any files which have a 4-clause license contributed to the NetBSD Foundation to a 2-clause license." This change removes clauses 3 and 4 from copyright / license blocks that list The NetBSD Foundation as the only copyright holder. Sponsored by: The FreeBSD Foundation Modified: head/contrib/file/mygetopt.h head/contrib/pf/pflogd/pidfile.c head/contrib/tnftp/COPYING head/contrib/vis/extern.h head/lib/libedit/chartype.h head/share/man/man9/bus_dma.9 head/share/man/man9/bus_space.9 head/sys/compat/svr4/svr4_fuser.h head/sys/compat/svr4/svr4_ipc.c head/sys/compat/svr4/svr4_resource.c head/sys/compat/svr4/svr4_resource.h head/sys/dev/esp/ncr53c9xvar.h head/sys/dev/le/am7990.c head/sys/dev/le/am79900.c head/sys/dev/le/am79900reg.h head/sys/dev/le/am7990reg.h head/sys/dev/le/if_le_isa.c head/sys/dev/le/if_le_pci.c head/sys/dev/le/lance.c head/sys/dev/le/lancereg.h head/sys/dev/usb/serial/ubsa.c head/sys/dev/usb/serial/ubser.c head/sys/dev/usb/serial/uchcom.c head/sys/dev/usb/serial/ufoma.c head/sys/dev/usb/serial/umodem.c head/sys/dev/usb/serial/uplcom.c head/sys/dev/usb/serial/usb_serial.c head/sys/dev/usb/serial/usb_serial.h head/sys/mips/cavium/octopci_bus_space.c head/sys/mips/include/bus.h head/sys/mips/mips/bus_space_fdt.c head/sys/mips/mips/bus_space_generic.c head/sys/mips/mips/gdb_machdep.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/moea64_native.c head/sys/powerpc/include/bat.h head/sys/powerpc/include/bus.h head/sys/sys/bus_dma.h head/sys/tools/miidevs2h.awk head/sys/tools/pccarddevs2h.awk head/sys/x86/include/bus.h Modified: head/contrib/file/mygetopt.h ============================================================================== --- head/contrib/file/mygetopt.h Tue Mar 18 01:17:08 2014 (r263288) +++ head/contrib/file/mygetopt.h Tue Mar 18 01:40:25 2014 (r263289) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/contrib/pf/pflogd/pidfile.c ============================================================================== --- head/contrib/pf/pflogd/pidfile.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/contrib/pf/pflogd/pidfile.c Tue Mar 18 01:40:25 2014 (r263289) @@ -17,13 +17,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/contrib/tnftp/COPYING ============================================================================== --- head/contrib/tnftp/COPYING Tue Mar 18 01:17:08 2014 (r263288) +++ head/contrib/tnftp/COPYING Tue Mar 18 01:40:25 2014 (r263289) @@ -14,13 +14,6 @@ are met: 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the NetBSD - Foundation, Inc. and its contributors. -4. Neither the name of The NetBSD Foundation nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/contrib/vis/extern.h ============================================================================== --- head/contrib/vis/extern.h Tue Mar 18 01:17:08 2014 (r263288) +++ head/contrib/vis/extern.h Tue Mar 18 01:40:25 2014 (r263289) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/lib/libedit/chartype.h ============================================================================== --- head/lib/libedit/chartype.h Tue Mar 18 01:17:08 2014 (r263288) +++ head/lib/libedit/chartype.h Tue Mar 18 01:40:25 2014 (r263289) @@ -12,13 +12,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/share/man/man9/bus_dma.9 ============================================================================== --- head/share/man/man9/bus_dma.9 Tue Mar 18 01:17:08 2014 (r263288) +++ head/share/man/man9/bus_dma.9 Tue Mar 18 01:40:25 2014 (r263289) @@ -37,13 +37,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgment: -.\" This product includes software developed by the NetBSD -.\" Foundation, Inc. and its contributors. -.\" 4. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/share/man/man9/bus_space.9 ============================================================================== --- head/share/man/man9/bus_space.9 Tue Mar 18 01:17:08 2014 (r263288) +++ head/share/man/man9/bus_space.9 Tue Mar 18 01:40:25 2014 (r263289) @@ -36,13 +36,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgment: -.\" This product includes software developed by the NetBSD -.\" Foundation, Inc. and its contributors. -.\" 4. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/compat/svr4/svr4_fuser.h ============================================================================== --- head/sys/compat/svr4/svr4_fuser.h Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/compat/svr4/svr4_fuser.h Tue Mar 18 01:40:25 2014 (r263289) @@ -20,13 +20,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/compat/svr4/svr4_ipc.c ============================================================================== --- head/sys/compat/svr4/svr4_ipc.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/compat/svr4/svr4_ipc.c Tue Mar 18 01:40:25 2014 (r263289) @@ -13,13 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/compat/svr4/svr4_resource.c ============================================================================== --- head/sys/compat/svr4/svr4_resource.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/compat/svr4/svr4_resource.c Tue Mar 18 01:40:25 2014 (r263289) @@ -13,13 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/compat/svr4/svr4_resource.h ============================================================================== --- head/sys/compat/svr4/svr4_resource.h Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/compat/svr4/svr4_resource.h Tue Mar 18 01:40:25 2014 (r263289) @@ -18,13 +18,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/dev/esp/ncr53c9xvar.h ============================================================================== --- head/sys/dev/esp/ncr53c9xvar.h Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/dev/esp/ncr53c9xvar.h Tue Mar 18 01:40:25 2014 (r263289) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/dev/le/am7990.c ============================================================================== --- head/sys/dev/le/am7990.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/dev/le/am7990.c Tue Mar 18 01:40:25 2014 (r263289) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/dev/le/am79900.c ============================================================================== --- head/sys/dev/le/am79900.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/dev/le/am79900.c Tue Mar 18 01:40:25 2014 (r263289) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/dev/le/am79900reg.h ============================================================================== --- head/sys/dev/le/am79900reg.h Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/dev/le/am79900reg.h Tue Mar 18 01:40:25 2014 (r263289) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/dev/le/am7990reg.h ============================================================================== --- head/sys/dev/le/am7990reg.h Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/dev/le/am7990reg.h Tue Mar 18 01:40:25 2014 (r263289) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/dev/le/if_le_isa.c ============================================================================== --- head/sys/dev/le/if_le_isa.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/dev/le/if_le_isa.c Tue Mar 18 01:40:25 2014 (r263289) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/dev/le/if_le_pci.c ============================================================================== --- head/sys/dev/le/if_le_pci.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/dev/le/if_le_pci.c Tue Mar 18 01:40:25 2014 (r263289) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/dev/le/lance.c ============================================================================== --- head/sys/dev/le/lance.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/dev/le/lance.c Tue Mar 18 01:40:25 2014 (r263289) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/dev/le/lancereg.h ============================================================================== --- head/sys/dev/le/lancereg.h Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/dev/le/lancereg.h Tue Mar 18 01:40:25 2014 (r263289) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/dev/usb/serial/ubsa.c ============================================================================== --- head/sys/dev/usb/serial/ubsa.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/dev/usb/serial/ubsa.c Tue Mar 18 01:40:25 2014 (r263289) @@ -41,13 +41,6 @@ __FBSDID("$FreeBSD$"); * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/dev/usb/serial/ubser.c ============================================================================== --- head/sys/dev/usb/serial/ubser.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/dev/usb/serial/ubser.c Tue Mar 18 01:40:25 2014 (r263289) @@ -48,13 +48,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/dev/usb/serial/uchcom.c ============================================================================== --- head/sys/dev/usb/serial/uchcom.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/dev/usb/serial/uchcom.c Tue Mar 18 01:40:25 2014 (r263289) @@ -41,13 +41,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/dev/usb/serial/ufoma.c ============================================================================== --- head/sys/dev/usb/serial/ufoma.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/dev/usb/serial/ufoma.c Tue Mar 18 01:40:25 2014 (r263289) @@ -46,13 +46,6 @@ __FBSDID("$FreeBSD$"); * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/dev/usb/serial/umodem.c ============================================================================== --- head/sys/dev/usb/serial/umodem.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/dev/usb/serial/umodem.c Tue Mar 18 01:40:25 2014 (r263289) @@ -45,13 +45,6 @@ __FBSDID("$FreeBSD$"); * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/dev/usb/serial/uplcom.c ============================================================================== --- head/sys/dev/usb/serial/uplcom.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/dev/usb/serial/uplcom.c Tue Mar 18 01:40:25 2014 (r263289) @@ -44,13 +44,6 @@ __FBSDID("$FreeBSD$"); * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/dev/usb/serial/usb_serial.c Tue Mar 18 01:40:25 2014 (r263289) @@ -46,13 +46,6 @@ __FBSDID("$FreeBSD$"); * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/dev/usb/serial/usb_serial.h ============================================================================== --- head/sys/dev/usb/serial/usb_serial.h Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/dev/usb/serial/usb_serial.h Tue Mar 18 01:40:25 2014 (r263289) @@ -43,13 +43,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/mips/cavium/octopci_bus_space.c ============================================================================== --- head/sys/mips/cavium/octopci_bus_space.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/mips/cavium/octopci_bus_space.c Tue Mar 18 01:40:25 2014 (r263289) @@ -17,13 +17,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/mips/include/bus.h ============================================================================== --- head/sys/mips/include/bus.h Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/mips/include/bus.h Tue Mar 18 01:40:25 2014 (r263289) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/mips/mips/bus_space_fdt.c ============================================================================== --- head/sys/mips/mips/bus_space_fdt.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/mips/mips/bus_space_fdt.c Tue Mar 18 01:40:25 2014 (r263289) @@ -17,13 +17,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/mips/mips/bus_space_generic.c ============================================================================== --- head/sys/mips/mips/bus_space_generic.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/mips/mips/bus_space_generic.c Tue Mar 18 01:40:25 2014 (r263289) @@ -17,13 +17,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/mips/mips/gdb_machdep.c ============================================================================== --- head/sys/mips/mips/gdb_machdep.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/mips/mips/gdb_machdep.c Tue Mar 18 01:40:25 2014 (r263289) @@ -41,13 +41,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/powerpc/aim/mmu_oea.c Tue Mar 18 01:40:25 2014 (r263289) @@ -13,13 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/powerpc/aim/mmu_oea64.c Tue Mar 18 01:40:25 2014 (r263289) @@ -13,13 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/powerpc/aim/moea64_native.c ============================================================================== --- head/sys/powerpc/aim/moea64_native.c Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/powerpc/aim/moea64_native.c Tue Mar 18 01:40:25 2014 (r263289) @@ -13,13 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/powerpc/include/bat.h ============================================================================== --- head/sys/powerpc/include/bat.h Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/powerpc/include/bat.h Tue Mar 18 01:40:25 2014 (r263289) @@ -13,13 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/powerpc/include/bus.h ============================================================================== --- head/sys/powerpc/include/bus.h Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/powerpc/include/bus.h Tue Mar 18 01:40:25 2014 (r263289) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/sys/bus_dma.h ============================================================================== --- head/sys/sys/bus_dma.h Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/sys/bus_dma.h Tue Mar 18 01:40:25 2014 (r263289) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/tools/miidevs2h.awk ============================================================================== --- head/sys/tools/miidevs2h.awk Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/tools/miidevs2h.awk Tue Mar 18 01:40:25 2014 (r263289) @@ -16,13 +16,6 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -# must display the following acknowledgement: -# This product includes software developed by the NetBSD -# Foundation, Inc. and its contributors. -# 4. Neither the name of The NetBSD Foundation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/tools/pccarddevs2h.awk ============================================================================== --- head/sys/tools/pccarddevs2h.awk Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/tools/pccarddevs2h.awk Tue Mar 18 01:40:25 2014 (r263289) @@ -17,13 +17,6 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -# must display the following acknowledgement: -# This product includes software developed by the NetBSD -# Foundation, Inc. and its contributors. -# 4. Neither the name of The NetBSD Foundation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/x86/include/bus.h ============================================================================== --- head/sys/x86/include/bus.h Tue Mar 18 01:17:08 2014 (r263288) +++ head/sys/x86/include/bus.h Tue Mar 18 01:40:25 2014 (r263289) @@ -49,13 +49,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 02:49:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3A5E779; Tue, 18 Mar 2014 02:49:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B1385C6B; Tue, 18 Mar 2014 02:49:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2I2nSGT094703; Tue, 18 Mar 2014 02:49:28 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2I2nS9G094702; Tue, 18 Mar 2014 02:49:28 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201403180249.s2I2nS9G094702@svn.freebsd.org> From: Neel Natu Date: Tue, 18 Mar 2014 02:49:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263290 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 02:49:28 -0000 Author: neel Date: Tue Mar 18 02:49:28 2014 New Revision: 263290 URL: http://svnweb.freebsd.org/changeset/base/263290 Log: When a vcpu is deactivated it must also unblock any rendezvous that may be blocked on it. This is done by issuing a wakeup after clearing the 'vcpuid' from 'active_cpus'. Also, use CPU_CLR_ATOMIC() to guarantee visibility of the updated 'active_cpus' across all host cpus. Modified: head/sys/amd64/vmm/vmm.c Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Tue Mar 18 01:40:25 2014 (r263289) +++ head/sys/amd64/vmm/vmm.c Tue Mar 18 02:49:28 2014 (r263290) @@ -130,7 +130,7 @@ struct vm { * An active vcpu is one that has been started implicitly (BSP) or * explicitly (AP) by sending it a startup ipi. */ - cpuset_t active_cpus; + volatile cpuset_t active_cpus; struct mtx rendezvous_mtx; cpuset_t rendezvous_req_cpus; @@ -969,8 +969,12 @@ vm_handle_rendezvous(struct vm *vm, int mtx_lock(&vm->rendezvous_mtx); while (vm->rendezvous_func != NULL) { + /* 'rendezvous_req_cpus' must be a subset of 'active_cpus' */ + CPU_AND(&vm->rendezvous_req_cpus, &vm->active_cpus); + if (vcpuid != -1 && - CPU_ISSET(vcpuid, &vm->rendezvous_req_cpus)) { + CPU_ISSET(vcpuid, &vm->rendezvous_req_cpus) && + !CPU_ISSET(vcpuid, &vm->rendezvous_done_cpus)) { VCPU_CTR0(vm, vcpuid, "Calling rendezvous func"); (*vm->rendezvous_func)(vm, vcpuid, vm->rendezvous_arg); CPU_SET(vcpuid, &vm->rendezvous_done_cpus); @@ -997,9 +1001,10 @@ vm_handle_hlt(struct vm *vm, int vcpuid, { struct vm_exit *vmexit; struct vcpu *vcpu; - int t, timo; + int t, timo, spindown; vcpu = &vm->vcpu[vcpuid]; + spindown = 0; vcpu_lock(vcpu); @@ -1026,17 +1031,25 @@ vm_handle_hlt(struct vm *vm, int vcpuid, * Spindown the vcpu if the apic is disabled and it * had entered the halted state. */ - *retu = true; - vmexit = vm_exitinfo(vm, vcpuid); - vmexit->exitcode = VM_EXITCODE_SPINDOWN_CPU; - vm_deactivate_cpu(vm, vcpuid); - VCPU_CTR0(vm, vcpuid, "spinning down cpu"); + spindown = 1; } vcpu_require_state_locked(vcpu, VCPU_FROZEN); vmm_stat_incr(vm, vcpuid, VCPU_IDLE_TICKS, ticks - t); } vcpu_unlock(vcpu); + /* + * Since 'vm_deactivate_cpu()' grabs a sleep mutex we must call it + * outside the confines of the vcpu spinlock. + */ + if (spindown) { + *retu = true; + vmexit = vm_exitinfo(vm, vcpuid); + vmexit->exitcode = VM_EXITCODE_SPINDOWN_CPU; + vm_deactivate_cpu(vm, vcpuid); + VCPU_CTR0(vm, vcpuid, "spinning down cpu"); + } + return (0); } @@ -1541,16 +1554,37 @@ void vm_activate_cpu(struct vm *vm, int vcpuid) { - if (vcpuid >= 0 && vcpuid < VM_MAXCPU) - CPU_SET(vcpuid, &vm->active_cpus); + KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, + ("vm_activate_cpu: invalid vcpuid %d", vcpuid)); + KASSERT(!CPU_ISSET(vcpuid, &vm->active_cpus), + ("vm_activate_cpu: vcpuid %d is already active", vcpuid)); + + VCPU_CTR0(vm, vcpuid, "activated"); + CPU_SET_ATOMIC(vcpuid, &vm->active_cpus); } static void vm_deactivate_cpu(struct vm *vm, int vcpuid) { - if (vcpuid >= 0 && vcpuid < VM_MAXCPU) - CPU_CLR(vcpuid, &vm->active_cpus); + KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, + ("vm_deactivate_cpu: invalid vcpuid %d", vcpuid)); + KASSERT(CPU_ISSET(vcpuid, &vm->active_cpus), + ("vm_deactivate_cpu: vcpuid %d is not active", vcpuid)); + + VCPU_CTR0(vm, vcpuid, "deactivated"); + CPU_CLR_ATOMIC(vcpuid, &vm->active_cpus); + + /* + * If a vcpu rendezvous is in progress then it could be blocked + * on 'vcpuid' - unblock it before disappearing forever. + */ + mtx_lock(&vm->rendezvous_mtx); + if (vm->rendezvous_func != NULL) { + VCPU_CTR0(vm, vcpuid, "unblock rendezvous after deactivation"); + wakeup(&vm->rendezvous_func); + } + mtx_unlock(&vm->rendezvous_mtx); } cpuset_t From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 06:41:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C416EAD; Tue, 18 Mar 2014 06:41:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 58FB2A0; Tue, 18 Mar 2014 06:41:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2I6fIiI091431; Tue, 18 Mar 2014 06:41:18 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2I6fIvp091430; Tue, 18 Mar 2014 06:41:18 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403180641.s2I6fIvp091430@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 18 Mar 2014 06:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263291 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 06:41:18 -0000 Author: hselasky Date: Tue Mar 18 06:41:17 2014 New Revision: 263291 URL: http://svnweb.freebsd.org/changeset/base/263291 Log: Update USB template manual page. MFC after: 1 week Modified: head/share/man/man4/usb2_template.4 Modified: head/share/man/man4/usb2_template.4 ============================================================================== --- head/share/man/man4/usb2_template.4 Tue Mar 18 02:49:28 2014 (r263290) +++ head/share/man/man4/usb2_template.4 Tue Mar 18 06:41:17 2014 (r263291) @@ -23,14 +23,14 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 21, 2008 -.Dt USB2_TEMPLATE 4 +.Dd March 18, 2014 +.Dt USB_TEMPLATE 4 .Os . .Sh NAME . . -.Nm usb2_template +.Nm usb_template . .Nd "USB templates" . @@ -39,13 +39,13 @@ To compile this module into the kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent -.Cd "device usb2_template" +.Cd "device usb_template" .Ed .Pp To load the module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -usb2_template_load="YES" +usb_template_load="YES" .Ed . .Sh DESCRIPTION @@ -62,21 +62,20 @@ descriptors. The USB template module currently has templates for USB Mass Storage, USB CDC Ethernet and Message Transfer Protocol. . -USB templates are currently selected using the "hw.usb2.template" +USB templates are currently selected using the "hw.usb.template" sysctl. . -The "hw.usb2.template" value can be changed at any time, but will not +The "hw.usb.template" value can be changed at any time, but will not have any effect until the USB device has been re-enumerated. . . . .Sh SEE ALSO -.Xr usb2_controller 4 -.Xr usb2_core 4 +.Xr usb 4 .Sh STANDARDS The .Nm -module complies with the USB 2.0 standard. +module complies to the USB 1.0, 2.0 and 3.0 standard. .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 06:43:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0EB84FF8; Tue, 18 Mar 2014 06:43:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EEBBFAE; Tue, 18 Mar 2014 06:43:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2I6hLF1091681; Tue, 18 Mar 2014 06:43:21 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2I6hLF9091679; Tue, 18 Mar 2014 06:43:21 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403180643.s2I6hLF9091679@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 18 Mar 2014 06:43:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263292 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 06:43:22 -0000 Author: hselasky Date: Tue Mar 18 06:43:21 2014 New Revision: 263292 URL: http://svnweb.freebsd.org/changeset/base/263292 Log: Correctly name USB template manual page and install it by default. Suggested by: Sascha Wildner MFC after: 1 week Added: head/share/man/man4/usb_template.4 - copied unchanged from r263291, head/share/man/man4/usb2_template.4 Deleted: head/share/man/man4/usb2_template.4 Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Mar 18 06:41:17 2014 (r263291) +++ head/share/man/man4/Makefile Tue Mar 18 06:43:21 2014 (r263292) @@ -536,6 +536,7 @@ MAN= aac.4 \ urtwn.4 \ urtwnfw.4 \ usb.4 \ + usb_template.4 \ usb_quirk.4 \ uslcom.4 \ utopia.4 \ Copied: head/share/man/man4/usb_template.4 (from r263291, head/share/man/man4/usb2_template.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/usb_template.4 Tue Mar 18 06:43:21 2014 (r263292, copy of r263291, head/share/man/man4/usb2_template.4) @@ -0,0 +1,83 @@ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2008 Hans Petter Selasky. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd March 18, 2014 +.Dt USB_TEMPLATE 4 +.Os +. +.Sh NAME +. +. +.Nm usb_template +. +.Nd "USB templates" +. +. +.Sh SYNOPSIS +To compile this module into the kernel, place the following line in +your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device usb_template" +.Ed +.Pp +To load the module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +usb_template_load="YES" +.Ed +. +.Sh DESCRIPTION +The +.Nm +module implements various USB templates that are needed when +programming an USB device side driver. +. +A USB template consists of an USB device descriptor, one or more USB +configuration descriptors, one or more USB interface descriptors, one +or more USB endpoint descriptors, USB strings and additional USB +descriptors. +. +The USB template module currently has templates for USB Mass Storage, +USB CDC Ethernet and Message Transfer Protocol. +. +USB templates are currently selected using the "hw.usb.template" +sysctl. +. +The "hw.usb.template" value can be changed at any time, but will not +have any effect until the USB device has been re-enumerated. +. +. +. +.Sh SEE ALSO +.Xr usb 4 +.Sh STANDARDS +The +.Nm +module complies to the USB 1.0, 2.0 and 3.0 standard. +.Sh HISTORY +The +.Nm +module was written by +.An Hans Petter Selasky Aq hselasky@FreeBSD.org . From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 06:52:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C38D62A6; Tue, 18 Mar 2014 06:52:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A3B2B1A3; Tue, 18 Mar 2014 06:52:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2I6qCaX095562; Tue, 18 Mar 2014 06:52:12 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2I6qCbh095559; Tue, 18 Mar 2014 06:52:12 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403180652.s2I6qCbh095559@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 18 Mar 2014 06:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263293 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 06:52:12 -0000 Author: hselasky Date: Tue Mar 18 06:52:11 2014 New Revision: 263293 URL: http://svnweb.freebsd.org/changeset/base/263293 Log: Add missing umoscom manual page. Suggested by: Sascha Wildner MFC after: 1 week Added: head/share/man/man4/umoscom.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Mar 18 06:43:21 2014 (r263292) +++ head/share/man/man4/Makefile Tue Mar 18 06:52:11 2014 (r263293) @@ -525,6 +525,7 @@ MAN= aac.4 \ umcs.4 \ umct.4 \ umodem.4 \ + umoscom.4 \ ums.4 \ unix.4 \ upgt.4 \ Added: head/share/man/man4/umoscom.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/umoscom.4 Tue Mar 18 06:52:11 2014 (r263293) @@ -0,0 +1,66 @@ +.\" +.\" Copyright (c) 2014 Hans Petter Selasky +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 18, 2014 +.Dt UMOSCOM 4 +.Os +.Sh NAME +.Nm umoscom +.Nd USB support for serial adapters based on chips made by MOSCHIP +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device usb" +.Cd "device ucom" +.Cd "device umoscom" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +umoscom_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for various serial adapters based on chips from MOSCHIP. +.Pp +The device is accessed through the +.Xr ucom 4 +driver which makes it behave like a +.Xr tty 4 . +.Sh SEE ALSO +.Xr tty 4 , +.Xr ucom 4 , +.Xr usb 4 +.Sh HISTORY +The +.Nm +driver appeared in OpenBSD and was ported to FreeBSD. From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 07:06:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6774E492; Tue, 18 Mar 2014 07:06:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 486F6271; Tue, 18 Mar 2014 07:06:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2I76WCd000279; Tue, 18 Mar 2014 07:06:32 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2I76Vam000277; Tue, 18 Mar 2014 07:06:31 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403180706.s2I76Vam000277@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 18 Mar 2014 07:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263294 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 07:06:32 -0000 Author: hselasky Date: Tue Mar 18 07:06:31 2014 New Revision: 263294 URL: http://svnweb.freebsd.org/changeset/base/263294 Log: Add missing usfs manual page. Suggested by: Sascha Wildner MFC after: 1 week Added: head/share/man/man4/usfs.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Mar 18 06:52:11 2014 (r263293) +++ head/share/man/man4/Makefile Tue Mar 18 07:06:31 2014 (r263294) @@ -540,6 +540,7 @@ MAN= aac.4 \ usb_template.4 \ usb_quirk.4 \ uslcom.4 \ + usfs.4 \ utopia.4 \ uvisor.4 \ uvscom.4 \ Added: head/share/man/man4/usfs.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/usfs.4 Tue Mar 18 07:06:31 2014 (r263294) @@ -0,0 +1,62 @@ +.\" +.\" Copyright (c) 2014 Hans Petter Selasky +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 18, 2014 +.Dt USFS 4 +.Os +.Sh NAME +.Nm usfs +.Nd USB device side support for bulk only transport mass storage +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device usb" +.Cd "device usfs" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +usfs_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for emulating an USB mass storage device when +the USB stack is activated in USB device side mode. +.Pp +Upon attach the driver creates a RAM disk which can be read and written. +.Sh SEE ALSO +.Xr umass 4 +.Xr usb 4 +.Sh HISTORY +The +.Nm +driver appeared in FreeBSD 8. From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 12:18:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC1F09B1; Tue, 18 Mar 2014 12:18:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CC02880A; Tue, 18 Mar 2014 12:18:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2ICIZGt027769; Tue, 18 Mar 2014 12:18:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2ICIZPq027768; Tue, 18 Mar 2014 12:18:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403181218.s2ICIZPq027768@svn.freebsd.org> From: Adrian Chadd Date: Tue, 18 Mar 2014 12:18:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263295 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 12:18:36 -0000 Author: adrian Date: Tue Mar 18 12:18:35 2014 New Revision: 263295 URL: http://svnweb.freebsd.org/changeset/base/263295 Log: Add the AR934x NAND flash controller register definitions. Obtained from: OpenWRT Added: head/sys/mips/atheros/ar934x_nfcreg.h (contents, props changed) Added: head/sys/mips/atheros/ar934x_nfcreg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/atheros/ar934x_nfcreg.h Tue Mar 18 12:18:35 2014 (r263295) @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2014 Adrian Chadd . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +/* + * Register definitions for the built-in NAND controller + * of the Atheros AR934x and QCA955x SoCs. + * + * This file is based on the AR934x SoC driver from OpenWRT. + * + * Copyright (C) 2011-2013 Gabor Juhos + * + * Used with permission. + */ +#ifndef __AR934X_NFCREG_H__ +#define __AR934X_NFCREG_H__ + +#define BIT(x) (1 << (x)) + +#define AR934X_NFC_REG_CMD 0x00 +#define AR934X_NFC_REG_CTRL 0x04 +#define AR934X_NFC_REG_STATUS 0x08 +#define AR934X_NFC_REG_INT_MASK 0x0c +#define AR934X_NFC_REG_INT_STATUS 0x10 +#define AR934X_NFC_REG_ECC_CTRL 0x14 +#define AR934X_NFC_REG_ECC_OFFSET 0x18 +#define AR934X_NFC_REG_ADDR0_0 0x1c +#define AR934X_NFC_REG_ADDR0_1 0x24 +#define AR934X_NFC_REG_ADDR1_0 0x20 +#define AR934X_NFC_REG_ADDR1_1 0x28 +#define AR934X_NFC_REG_SPARE_SIZE 0x30 +#define AR934X_NFC_REG_PROTECT 0x38 +#define AR934X_NFC_REG_LOOKUP_EN 0x40 +#define AR934X_NFC_REG_LOOKUP(_x) (0x44 + (_i) * 4) +#define AR934X_NFC_REG_DMA_ADDR 0x64 +#define AR934X_NFC_REG_DMA_COUNT 0x68 +#define AR934X_NFC_REG_DMA_CTRL 0x6c +#define AR934X_NFC_REG_MEM_CTRL 0x80 +#define AR934X_NFC_REG_DATA_SIZE 0x84 +#define AR934X_NFC_REG_READ_STATUS 0x88 +#define AR934X_NFC_REG_TIME_SEQ 0x8c +#define AR934X_NFC_REG_TIMINGS_ASYN 0x90 +#define AR934X_NFC_REG_TIMINGS_SYN 0x94 +#define AR934X_NFC_REG_FIFO_DATA 0x98 +#define AR934X_NFC_REG_TIME_MODE 0x9c +#define AR934X_NFC_REG_DMA_ADDR_OFFS 0xa0 +#define AR934X_NFC_REG_FIFO_INIT 0xb0 +#define AR934X_NFC_REG_GEN_SEQ_CTRL 0xb4 + +#define AR934X_NFC_CMD_CMD_SEQ_S 0 +#define AR934X_NFC_CMD_CMD_SEQ_M 0x3f +#define AR934X_NFC_CMD_SEQ_1C 0x00 +#define AR934X_NFC_CMD_SEQ_ERASE 0x0e +#define AR934X_NFC_CMD_SEQ_12 0x0c +#define AR934X_NFC_CMD_SEQ_1C1AXR 0x21 +#define AR934X_NFC_CMD_SEQ_S 0x24 +#define AR934X_NFC_CMD_SEQ_1C3AXR 0x27 +#define AR934X_NFC_CMD_SEQ_1C5A1CXR 0x2a +#define AR934X_NFC_CMD_SEQ_18 0x32 +#define AR934X_NFC_CMD_INPUT_SEL_SIU 0 +#define AR934X_NFC_CMD_INPUT_SEL_DMA BIT(6) +#define AR934X_NFC_CMD_ADDR_SEL_0 0 +#define AR934X_NFC_CMD_ADDR_SEL_1 BIT(7) +#define AR934X_NFC_CMD_CMD0_S 8 +#define AR934X_NFC_CMD_CMD0_M 0xff +#define AR934X_NFC_CMD_CMD1_S 16 +#define AR934X_NFC_CMD_CMD1_M 0xff +#define AR934X_NFC_CMD_CMD2_S 24 +#define AR934X_NFC_CMD_CMD2_M 0xff + +#define AR934X_NFC_CTRL_ADDR_CYCLE0_M 0x7 +#define AR934X_NFC_CTRL_ADDR_CYCLE0_S 0 +#define AR934X_NFC_CTRL_SPARE_EN BIT(3) +#define AR934X_NFC_CTRL_INT_EN BIT(4) +#define AR934X_NFC_CTRL_ECC_EN BIT(5) +#define AR934X_NFC_CTRL_BLOCK_SIZE_S 6 +#define AR934X_NFC_CTRL_BLOCK_SIZE_M 0x3 +#define AR934X_NFC_CTRL_BLOCK_SIZE_32 0 +#define AR934X_NFC_CTRL_BLOCK_SIZE_64 1 +#define AR934X_NFC_CTRL_BLOCK_SIZE_128 2 +#define AR934X_NFC_CTRL_BLOCK_SIZE_256 3 +#define AR934X_NFC_CTRL_PAGE_SIZE_S 8 +#define AR934X_NFC_CTRL_PAGE_SIZE_M 0x7 +#define AR934X_NFC_CTRL_PAGE_SIZE_256 0 +#define AR934X_NFC_CTRL_PAGE_SIZE_512 1 +#define AR934X_NFC_CTRL_PAGE_SIZE_1024 2 +#define AR934X_NFC_CTRL_PAGE_SIZE_2048 3 +#define AR934X_NFC_CTRL_PAGE_SIZE_4096 4 +#define AR934X_NFC_CTRL_PAGE_SIZE_8192 5 +#define AR934X_NFC_CTRL_PAGE_SIZE_16384 6 +#define AR934X_NFC_CTRL_CUSTOM_SIZE_EN BIT(11) +#define AR934X_NFC_CTRL_IO_WIDTH_8BITS 0 +#define AR934X_NFC_CTRL_IO_WIDTH_16BITS BIT(12) +#define AR934X_NFC_CTRL_LOOKUP_EN BIT(13) +#define AR934X_NFC_CTRL_PROT_EN BIT(14) +#define AR934X_NFC_CTRL_WORK_MODE_ASYNC 0 +#define AR934X_NFC_CTRL_WORK_MODE_SYNC BIT(15) +#define AR934X_NFC_CTRL_ADDR0_AUTO_INC BIT(16) +#define AR934X_NFC_CTRL_ADDR1_AUTO_INC BIT(17) +#define AR934X_NFC_CTRL_ADDR_CYCLE1_M 0x7 +#define AR934X_NFC_CTRL_ADDR_CYCLE1_S 18 +#define AR934X_NFC_CTRL_SMALL_PAGE BIT(21) + +#define AR934X_NFC_DMA_CTRL_DMA_START BIT(7) +#define AR934X_NFC_DMA_CTRL_DMA_DIR_WRITE 0 +#define AR934X_NFC_DMA_CTRL_DMA_DIR_READ BIT(6) +#define AR934X_NFC_DMA_CTRL_DMA_MODE_SG BIT(5) +#define AR934X_NFC_DMA_CTRL_DMA_BURST_S 2 +#define AR934X_NFC_DMA_CTRL_DMA_BURST_0 0 +#define AR934X_NFC_DMA_CTRL_DMA_BURST_1 1 +#define AR934X_NFC_DMA_CTRL_DMA_BURST_2 2 +#define AR934X_NFC_DMA_CTRL_DMA_BURST_3 3 +#define AR934X_NFC_DMA_CTRL_DMA_BURST_4 4 +#define AR934X_NFC_DMA_CTRL_DMA_BURST_5 5 +#define AR934X_NFC_DMA_CTRL_ERR_FLAG BIT(1) +#define AR934X_NFC_DMA_CTRL_DMA_READY BIT(0) + +#define AR934X_NFC_INT_DEV_RDY(_x) BIT(4 + (_x)) +#define AR934X_NFC_INT_CMD_END BIT(1) + +#define AR934X_NFC_ECC_CTRL_ERR_THRES_S 8 +#define AR934X_NFC_ECC_CTRL_ERR_THRES_M 0x1f +#define AR934X_NFC_ECC_CTRL_ECC_CAP_S 5 +#define AR934X_NFC_ECC_CTRL_ECC_CAP_M 0x7 +#define AR934X_NFC_ECC_CTRL_ECC_CAP_2 0 +#define AR934X_NFC_ECC_CTRL_ECC_CAP_4 1 +#define AR934X_NFC_ECC_CTRL_ECC_CAP_6 2 +#define AR934X_NFC_ECC_CTRL_ECC_CAP_8 3 +#define AR934X_NFC_ECC_CTRL_ECC_CAP_10 4 +#define AR934X_NFC_ECC_CTRL_ECC_CAP_12 5 +#define AR934X_NFC_ECC_CTRL_ECC_CAP_14 6 +#define AR934X_NFC_ECC_CTRL_ECC_CAP_16 7 +#define AR934X_NFC_ECC_CTRL_ERR_OVER BIT(2) +#define AR934X_NFC_ECC_CTRL_ERR_UNCORRECT BIT(1) +#define AR934X_NFC_ECC_CTRL_ERR_CORRECT BIT(0) + +#define AR934X_NFC_ECC_OFFS_OFSET_M 0xffff + +/* default timing values */ +#define AR934X_NFC_TIME_SEQ_DEFAULT 0x7fff +#define AR934X_NFC_TIMINGS_ASYN_DEFAULT 0x22 +#define AR934X_NFC_TIMINGS_SYN_DEFAULT 0xf + +#define AR934X_NFC_ID_BUF_SIZE 8 +#define AR934X_NFC_DEV_READY_TIMEOUT 25 /* msecs */ +#define AR934X_NFC_DMA_READY_TIMEOUT 25 /* msecs */ +#define AR934X_NFC_DONE_TIMEOUT 1000 +#define AR934X_NFC_DMA_RETRIES 20 + +#define AR934X_NFC_IRQ_MASK AR934X_NFC_INT_DEV_RDY(0) + +#define AR934X_NFC_GENSEQ_SMALL_PAGE_READ 0x30043 + +#endif /* __AR934X_NFCREG_H__ */ From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 12:19:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E562EAFC; Tue, 18 Mar 2014 12:19:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B7BB2817; Tue, 18 Mar 2014 12:19:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2ICJdRJ027921; Tue, 18 Mar 2014 12:19:39 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2ICJd6O027918; Tue, 18 Mar 2014 12:19:39 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403181219.s2ICJd6O027918@svn.freebsd.org> From: Adrian Chadd Date: Tue, 18 Mar 2014 12:19:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263296 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 12:19:40 -0000 Author: adrian Date: Tue Mar 18 12:19:39 2014 New Revision: 263296 URL: http://svnweb.freebsd.org/changeset/base/263296 Log: Extend the Atheros SoC support to include a method to enable/disable the NAND flash controller. Add the AR934x NAND flash controller reset routines. (It's different on subsequent SoCs.) Tested: * AR9344, Atheros DB120 reference platform Obtained from: OpenWRT Modified: head/sys/mips/atheros/ar71xx_cpudef.h head/sys/mips/atheros/ar934x_chip.c Modified: head/sys/mips/atheros/ar71xx_cpudef.h ============================================================================== --- head/sys/mips/atheros/ar71xx_cpudef.h Tue Mar 18 12:18:35 2014 (r263295) +++ head/sys/mips/atheros/ar71xx_cpudef.h Tue Mar 18 12:19:39 2014 (r263296) @@ -63,6 +63,8 @@ struct ar71xx_cpu_def { void (* ar71xx_chip_reset_wmac) (void); void (* ar71xx_chip_init_gmac) (void); + + void (* ar71xx_chip_reset_nfc) (int); }; extern struct ar71xx_cpu_def * ar71xx_cpu_ops; @@ -140,6 +142,13 @@ static inline void ar71xx_device_ddr_flu ar71xx_cpu_ops->ar71xx_chip_ddr_flush_ip2(); } +static inline void ar71xx_reset_nfc(int active) +{ + + if (ar71xx_cpu_ops->ar71xx_chip_reset_nfc) + ar71xx_cpu_ops->ar71xx_chip_reset_nfc(active); +} + /* XXX shouldn't be here! */ extern uint32_t u_ar71xx_refclk; extern uint32_t u_ar71xx_cpu_freq; Modified: head/sys/mips/atheros/ar934x_chip.c ============================================================================== --- head/sys/mips/atheros/ar934x_chip.c Tue Mar 18 12:18:35 2014 (r263295) +++ head/sys/mips/atheros/ar934x_chip.c Tue Mar 18 12:19:39 2014 (r263296) @@ -375,6 +375,7 @@ static void ar934x_chip_reset_wmac(void) { + /* XXX TODO */ } static void @@ -391,6 +392,31 @@ ar934x_chip_init_gmac(void) } } +/* + * Reset the NAND Flash Controller. + * + * + active=1 means "make it active". + * + active=0 means "make it inactive". + */ +static void +ar934x_chip_reset_nfc(int active) +{ + + if (active) { + ar71xx_device_start(AR934X_RESET_NANDF); + DELAY(100); + + ar71xx_device_start(AR934X_RESET_ETH_SWITCH_ANALOG); + DELAY(250); + } else { + ar71xx_device_stop(AR934X_RESET_ETH_SWITCH_ANALOG); + DELAY(250); + + ar71xx_device_stop(AR934X_RESET_NANDF); + DELAY(100); + } +} + struct ar71xx_cpu_def ar934x_chip_def = { &ar934x_chip_detect_mem_size, &ar934x_chip_detect_sys_frequency, @@ -407,4 +433,5 @@ struct ar71xx_cpu_def ar934x_chip_def = &ar934x_chip_reset_ethernet_switch, &ar934x_chip_reset_wmac, &ar934x_chip_init_gmac, + &ar934x_chip_reset_nfc, }; From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 12:50:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4AB83E8; Tue, 18 Mar 2014 12:50:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9FAFAC28; Tue, 18 Mar 2014 12:50:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2ICoMJG040571; Tue, 18 Mar 2014 12:50:22 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2ICoMJe040570; Tue, 18 Mar 2014 12:50:22 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403181250.s2ICoMJe040570@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 18 Mar 2014 12:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263297 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 12:50:22 -0000 Author: glebius Date: Tue Mar 18 12:50:22 2014 New Revision: 263297 URL: http://svnweb.freebsd.org/changeset/base/263297 Log: Return error when packet is dropped because of link down. Submitted-by: Boris Misenov Sponsored by: Solarflare Communications, Inc. Modified: head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Tue Mar 18 12:19:39 2014 (r263296) +++ head/sys/dev/sfxge/sfxge_tx.c Tue Mar 18 12:50:22 2014 (r263297) @@ -588,7 +588,7 @@ sfxge_if_transmit(struct ifnet *ifp, str if (!SFXGE_LINK_UP(sc)) { m_freem(m); - return (0); + return (ENETDOWN); } /* Pick the desired transmit queue. */ From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 13:47:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12BF2D51; Tue, 18 Mar 2014 13:47:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F1B4726C; Tue, 18 Mar 2014 13:47:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2IDlRBw064956; Tue, 18 Mar 2014 13:47:27 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2IDlRmL064953; Tue, 18 Mar 2014 13:47:27 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403181347.s2IDlRmL064953@svn.freebsd.org> From: Ed Maste Date: Tue, 18 Mar 2014 13:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263298 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 13:47:28 -0000 Author: emaste Date: Tue Mar 18 13:47:27 2014 New Revision: 263298 URL: http://svnweb.freebsd.org/changeset/base/263298 Log: Use standard FreeBSD license disclaimer The original was accidentally copied from a NetBSD Foundation copyright block. Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/umoscom.4 head/share/man/man4/usfs.4 head/share/man/man4/xhci.4 Modified: head/share/man/man4/umoscom.4 ============================================================================== --- head/share/man/man4/umoscom.4 Tue Mar 18 12:50:22 2014 (r263297) +++ head/share/man/man4/umoscom.4 Tue Mar 18 13:47:27 2014 (r263298) @@ -11,17 +11,17 @@ .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" -.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -.\" POSSIBILITY OF SUCH DAMAGE. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/share/man/man4/usfs.4 ============================================================================== --- head/share/man/man4/usfs.4 Tue Mar 18 12:50:22 2014 (r263297) +++ head/share/man/man4/usfs.4 Tue Mar 18 13:47:27 2014 (r263298) @@ -11,18 +11,18 @@ .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" -.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -.\" POSSIBILITY OF SUCH DAMAGE. -.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" .\" $FreeBSD$ .\" .Dd March 18, 2014 Modified: head/share/man/man4/xhci.4 ============================================================================== --- head/share/man/man4/xhci.4 Tue Mar 18 12:50:22 2014 (r263297) +++ head/share/man/man4/xhci.4 Tue Mar 18 13:47:27 2014 (r263298) @@ -10,17 +10,17 @@ .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" -.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -.\" POSSIBILITY OF SUCH DAMAGE. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 14:41:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E7E76CA; Tue, 18 Mar 2014 14:41:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 12AB3AA7; Tue, 18 Mar 2014 14:41:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2IEfT8Z088029; Tue, 18 Mar 2014 14:41:29 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2IEfIDi087619; Tue, 18 Mar 2014 14:41:18 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403181441.s2IEfIDi087619@svn.freebsd.org> From: Warner Losh Date: Tue, 18 Mar 2014 14:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263301 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf powerpc/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 14:41:30 -0000 Author: imp Date: Tue Mar 18 14:41:18 2014 New Revision: 263301 URL: http://svnweb.freebsd.org/changeset/base/263301 Log: In kernel config files, it is supposed to be 'options' not 'options', per long standing (but recently not so strictly enforced) convention. Modified: head/sys/amd64/conf/NOTES head/sys/arm/conf/AC100 head/sys/arm/conf/ARMADAXP head/sys/arm/conf/ARNDALE head/sys/arm/conf/ATMEL head/sys/arm/conf/AVILA head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/BWCT head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/COLIBRI-VF50 head/sys/arm/conf/COSMIC head/sys/arm/conf/CRB head/sys/arm/conf/CUBIEBOARD head/sys/arm/conf/CUBIEBOARD2 head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DIGI-CCWMX53 head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/DREAMPLUG-1001 head/sys/arm/conf/EA3250 head/sys/arm/conf/EB9200 head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/EP80219 head/sys/arm/conf/ETHERNUT5 head/sys/arm/conf/GUMSTIX head/sys/arm/conf/HL200 head/sys/arm/conf/HL201 head/sys/arm/conf/IMX53-QSB head/sys/arm/conf/IMX6 head/sys/arm/conf/IQ31244 head/sys/arm/conf/KB920X head/sys/arm/conf/LN2410SBC head/sys/arm/conf/NSLU head/sys/arm/conf/PANDABOARD head/sys/arm/conf/QILA9G20 head/sys/arm/conf/QUARTZ head/sys/arm/conf/RADXA head/sys/arm/conf/RPI-B head/sys/arm/conf/SAM9260EK head/sys/arm/conf/SAM9G20EK head/sys/arm/conf/SAM9X25EK head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/SN9G45 head/sys/arm/conf/TS7800 head/sys/arm/conf/VERSATILEPB head/sys/arm/conf/VYBRID.common head/sys/arm/conf/WANDBOARD.common head/sys/arm/conf/ZEDBOARD head/sys/i386/conf/NOTES head/sys/i386/conf/XEN head/sys/ia64/conf/GENERIC head/sys/mips/conf/ALCHEMY head/sys/mips/conf/ALFA_HORNET_UB head/sys/mips/conf/AP121 head/sys/mips/conf/AP91 head/sys/mips/conf/AP93 head/sys/mips/conf/AP94 head/sys/mips/conf/AP96 head/sys/mips/conf/AR71XX_BASE head/sys/mips/conf/AR724X_BASE head/sys/mips/conf/AR91XX_BASE head/sys/mips/conf/AR933X_BASE head/sys/mips/conf/AR934X_BASE head/sys/mips/conf/CARAMBOLA2 head/sys/mips/conf/DB120 head/sys/mips/conf/DIR-825B1 head/sys/mips/conf/ENH200 head/sys/mips/conf/PB47 head/sys/mips/conf/PB92 head/sys/mips/conf/PICOSTATION_M2HP head/sys/mips/conf/ROUTERSTATION head/sys/mips/conf/ROUTERSTATION_MFS head/sys/mips/conf/RSPRO head/sys/mips/conf/RSPRO_MFS head/sys/mips/conf/RSPRO_STANDALONE head/sys/mips/conf/RT305X head/sys/mips/conf/SENTRY5 head/sys/mips/conf/SWARM64_SMP head/sys/mips/conf/SWARM_SMP head/sys/mips/conf/TP-WN1043ND head/sys/mips/conf/WZR-300HP head/sys/mips/conf/XLRN32 head/sys/mips/conf/std.SWARM head/sys/mips/conf/std.XLP head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/powerpc/conf/MPC85XX head/sys/powerpc/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/amd64/conf/NOTES Tue Mar 18 14:41:18 2014 (r263301) @@ -187,7 +187,7 @@ options VESA_DEBUG device dpms # DPMS suspend & resume via VESA BIOS # x86 real mode BIOS emulator, required by atkbdc/dpms/vesa -options X86BIOS +options X86BIOS # # Optional devices: @@ -440,7 +440,7 @@ device ips # # Intel C600 (Patsburg) integrated SAS controller device isci -options ISCI_LOGGING # enable debugging in isci HAL +options ISCI_LOGGING # enable debugging in isci HAL # # NVM Express (NVMe) support Modified: head/sys/arm/conf/AC100 ============================================================================== --- head/sys/arm/conf/AC100 Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/AC100 Tue Mar 18 14:41:18 2014 (r263301) @@ -25,7 +25,7 @@ options FFS # Berkeley Fast Filesyste #options BOOTP_NFSV3 #options BOOTP_WIRED_TO=mge0 -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme options GEOM_PART_GPT Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/ARMADAXP Tue Mar 18 14:41:18 2014 (r263301) @@ -26,7 +26,7 @@ options BOOTP_NFSROOT options BOOTP_NFSV3 options BOOTP_WIRED_TO=mge0 -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme options GEOM_PART_GPT Modified: head/sys/arm/conf/ARNDALE ============================================================================== --- head/sys/arm/conf/ARNDALE Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/ARNDALE Tue Mar 18 14:41:18 2014 (r263301) @@ -27,49 +27,49 @@ makeoptions WITHOUT_MODULES="ahc" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" -options HZ=100 -options SCHED_4BSD # 4BSD scheduler -options INET # InterNETworking -options INET6 # IPv6 communications protocols +options HZ=100 +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options KBD_INSTALL_CDEV -options PREEMPTION -options FREEBSD_BOOT_LOADER +options TMPFS # Efficient memory filesystem +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV +options PREEMPTION +options FREEBSD_BOOT_LOADER options VFP # vfp/neon # Debugging makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options BREAK_TO_DEBUGGER +options BREAK_TO_DEBUGGER #options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB -options DDB # Enable the kernel debugger -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +options KDB +options DDB # Enable the kernel debugger +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options DIAGNOSTIC +options DIAGNOSTIC # NFS support -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCLIENT +options NFSCL # Network Filesystem Client +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCLIENT # Uncomment this for NFS root #options NFS_ROOT # NFS usable as /, requires NFSCL @@ -83,7 +83,7 @@ device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards device sdhci # generic sdhci -options ROOTDEVNAME=\"ufs:/dev/da0\" +options ROOTDEVNAME=\"ufs:/dev/da0\" #options SMP @@ -98,7 +98,7 @@ device gpio # USB support options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb -options USB_DEBUG +options USB_DEBUG #options USB_REQ_DEBUG #options USB_VERBOSE #device musb @@ -134,6 +134,6 @@ device axe # ASIX Electronics USB Eth device bpf # Berkeley packet filter #FDT -options FDT -options FDT_DTB_STATIC +options FDT +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=exynos5250-arndale.dts Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/ATMEL Tue Mar 18 14:41:18 2014 (r263301) @@ -48,7 +48,7 @@ options NFSCL # New Network Filesyste options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/AVILA Tue Mar 18 14:41:18 2014 (r263301) @@ -49,7 +49,7 @@ options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options NFSCL # New Network Filesystem Client Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/BEAGLEBONE Tue Mar 18 14:41:18 2014 (r263301) @@ -36,7 +36,7 @@ options UFS_ACL # Support for access options UFS_DIRHASH # Improve performance on big directories options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/BWCT ============================================================================== --- head/sys/arm/conf/BWCT Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/BWCT Tue Mar 18 14:41:18 2014 (r263301) @@ -53,7 +53,7 @@ options BOOTP options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/CAMBRIA Tue Mar 18 14:41:18 2014 (r263301) @@ -50,7 +50,7 @@ options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options NFSCL # New Network Filesystem Client Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/CNS11XXNAS Tue Mar 18 14:41:18 2014 (r263301) @@ -71,7 +71,7 @@ options NFSCL # New Network Filesyste #options NFSD # New Network Filesystem Server #options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/COLIBRI-VF50 ============================================================================== --- head/sys/arm/conf/COLIBRI-VF50 Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/COLIBRI-VF50 Tue Mar 18 14:41:18 2014 (r263301) @@ -21,6 +21,6 @@ include "VYBRID.common" ident COLIBRI-VF50 #FDT -options FDT -options FDT_DTB_STATIC +options FDT +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=vybrid-colibri-vf50.dts Modified: head/sys/arm/conf/COSMIC ============================================================================== --- head/sys/arm/conf/COSMIC Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/COSMIC Tue Mar 18 14:41:18 2014 (r263301) @@ -21,6 +21,6 @@ include "VYBRID.common" ident COSMIC #FDT -options FDT -options FDT_DTB_STATIC +options FDT +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=vybrid-cosmic.dts Modified: head/sys/arm/conf/CRB ============================================================================== --- head/sys/arm/conf/CRB Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/CRB Tue Mar 18 14:41:18 2014 (r263301) @@ -47,7 +47,7 @@ options NFS_ROOT # NFS usable as /, re #options MSDOSFS # MSDOS Filesystem options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework Modified: head/sys/arm/conf/CUBIEBOARD ============================================================================== --- head/sys/arm/conf/CUBIEBOARD Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/CUBIEBOARD Tue Mar 18 14:41:18 2014 (r263301) @@ -31,7 +31,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists @@ -82,7 +82,7 @@ options WITNESS_SKIPSPIN # Don't run wi #device mmcsd # mmc/sd flash cards # Boot device is 2nd slice on MMC/SD card -options ROOTDEVNAME=\"ufs:/dev/da0s2\" +options ROOTDEVNAME=\"ufs:/dev/da0s2\" # ATA controllers #device ahci # AHCI-compatible SATA controllers @@ -134,7 +134,7 @@ device emac device miibus # Flattened Device Tree -options FDT -options FDT_DTB_STATIC +options FDT +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=cubieboard.dts Modified: head/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- head/sys/arm/conf/CUBIEBOARD2 Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/CUBIEBOARD2 Tue Mar 18 14:41:18 2014 (r263301) @@ -31,7 +31,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/DB-78XXX Tue Mar 18 14:41:18 2014 (r263301) @@ -18,7 +18,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem options NANDFS # NAND Filesystem options NFSCL # New Network Filesystem Client Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/DB-88F5XXX Tue Mar 18 14:41:18 2014 (r263301) @@ -18,7 +18,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem options NFSCL # New Network Filesystem Client options NFSLOCKD # Network Lock Manager Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/DB-88F6XXX Tue Mar 18 14:41:18 2014 (r263301) @@ -18,7 +18,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem options NANDFS # NAND Filesystem options NFSCL # New Network Filesystem Client Modified: head/sys/arm/conf/DIGI-CCWMX53 ============================================================================== --- head/sys/arm/conf/DIGI-CCWMX53 Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/DIGI-CCWMX53 Tue Mar 18 14:41:18 2014 (r263301) @@ -41,7 +41,7 @@ options NFSCL # New Network Filesyste #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/DOCKSTAR Tue Mar 18 14:41:18 2014 (r263301) @@ -34,7 +34,7 @@ options INET6 # IPv6 communications p options SOFTUPDATES options CD9660 # ISO 9660 filesystem options FFS # Berkeley Fast Filesystem -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MS DOS File System (FAT, FAT32) options NULLFS # NULL filesystem options SYSVSHM # SYSV-style shared memory Modified: head/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- head/sys/arm/conf/DREAMPLUG-1001 Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/DREAMPLUG-1001 Tue Mar 18 14:41:18 2014 (r263301) @@ -35,7 +35,7 @@ options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols options SOFTUPDATES -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options CD9660 # ISO 9660 filesystem options FFS # Berkeley Fast Filesystem options MSDOSFS # MS DOS File System (FAT, FAT32) Modified: head/sys/arm/conf/EA3250 ============================================================================== --- head/sys/arm/conf/EA3250 Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/EA3250 Tue Mar 18 14:41:18 2014 (r263301) @@ -22,7 +22,7 @@ options NFSLOCKD # Network Lock Manage options NFS_ROOT # NFS usable as /, requires NFSCLIENT options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS options BOOTP options BOOTP_NFSROOT Modified: head/sys/arm/conf/EB9200 ============================================================================== --- head/sys/arm/conf/EB9200 Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/EB9200 Tue Mar 18 14:41:18 2014 (r263301) @@ -43,7 +43,7 @@ options BOOTP options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/EFIKA_MX Tue Mar 18 14:41:18 2014 (r263301) @@ -41,7 +41,7 @@ options NFSCL # New Network Filesyste #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/EP80219 ============================================================================== --- head/sys/arm/conf/EP80219 Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/EP80219 Tue Mar 18 14:41:18 2014 (r263301) @@ -43,7 +43,7 @@ options NFSCL # New Network Filesyste options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/ETHERNUT5 ============================================================================== --- head/sys/arm/conf/ETHERNUT5 Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/ETHERNUT5 Tue Mar 18 14:41:18 2014 (r263301) @@ -43,7 +43,7 @@ options NFSLOCKD # Network Lock Manage options NFS_ROOT # NFS usable as /, requires NFSCL options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/GUMSTIX ============================================================================== --- head/sys/arm/conf/GUMSTIX Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/GUMSTIX Tue Mar 18 14:41:18 2014 (r263301) @@ -49,7 +49,7 @@ options NFSCL # New Network Filesyste options NFS_ROOT # NFS usable as /, requires NFSCL options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/HL200 ============================================================================== --- head/sys/arm/conf/HL200 Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/HL200 Tue Mar 18 14:41:18 2014 (r263301) @@ -51,7 +51,7 @@ options BOOTP_COMPAT options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/HL201 ============================================================================== --- head/sys/arm/conf/HL201 Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/HL201 Tue Mar 18 14:41:18 2014 (r263301) @@ -54,7 +54,7 @@ options ALT_BREAK_TO_DEBUGGER options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/IMX53-QSB ============================================================================== --- head/sys/arm/conf/IMX53-QSB Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/IMX53-QSB Tue Mar 18 14:41:18 2014 (r263301) @@ -40,7 +40,7 @@ options NFSCL # New Network Filesyste #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/IMX6 Tue Mar 18 14:41:18 2014 (r263301) @@ -36,7 +36,7 @@ options NFSCL # New Network Filesyst #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/IQ31244 ============================================================================== --- head/sys/arm/conf/IQ31244 Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/IQ31244 Tue Mar 18 14:41:18 2014 (r263301) @@ -46,7 +46,7 @@ options NFSLOCKD # Network Lock Manage options NFS_ROOT # NFS usable as /, requires NFSCL options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/KB920X Tue Mar 18 14:41:18 2014 (r263301) @@ -49,7 +49,7 @@ options NFSCL # New Network Filesyste options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/LN2410SBC ============================================================================== --- head/sys/arm/conf/LN2410SBC Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/LN2410SBC Tue Mar 18 14:41:18 2014 (r263301) @@ -49,7 +49,7 @@ options ROOTDEVNAME=\"ufs:da0s1\" options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options PSEUDOFS # Pseudo-filesystem framework #options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support Modified: head/sys/arm/conf/NSLU ============================================================================== --- head/sys/arm/conf/NSLU Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/NSLU Tue Mar 18 14:41:18 2014 (r263301) @@ -63,7 +63,7 @@ options NFSLOCKD # Network Lock Manage options NFS_ROOT # NFS usable as /, requires NFSCL options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/PANDABOARD Tue Mar 18 14:41:18 2014 (r263301) @@ -56,7 +56,7 @@ options NFS_ROOT # NFS usable as /, re #options BOOTP_WIRED_TO=ue0 options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/QILA9G20 ============================================================================== --- head/sys/arm/conf/QILA9G20 Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/QILA9G20 Tue Mar 18 14:41:18 2014 (r263301) @@ -55,7 +55,7 @@ options ALT_BREAK_TO_DEBUGGER options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/QUARTZ ============================================================================== --- head/sys/arm/conf/QUARTZ Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/QUARTZ Tue Mar 18 14:41:18 2014 (r263301) @@ -21,6 +21,6 @@ include "VYBRID.common" ident QUARTZ #FDT -options FDT -options FDT_DTB_STATIC +options FDT +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=vybrid-quartz.dts Modified: head/sys/arm/conf/RADXA ============================================================================== --- head/sys/arm/conf/RADXA Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/RADXA Tue Mar 18 14:41:18 2014 (r263301) @@ -25,44 +25,44 @@ include "../rockchip/std.rk30xx" makeoptions MODULES_OVERRIDE="" makeoptions WITHOUT_MODULES="ahc" -options HZ=100 -options SCHED_4BSD # 4BSD scheduler -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories +options HZ=100 +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options PREEMPTION -options FREEBSD_BOOT_LOADER -options VFP # vfp/neon +options TMPFS # Efficient memory filesystem +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE # ktrace(1) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options PREEMPTION +options FREEBSD_BOOT_LOADER +options VFP # vfp/neon # Debugging makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options BREAK_TO_DEBUGGER +options BREAK_TO_DEBUGGER #options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB -options DDB # Enable the kernel debugger +options KDB +options DDB # Enable the kernel debugger #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options DIAGNOSTIC +options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +options DIAGNOSTIC # NFS support #options NFSCL @@ -74,7 +74,7 @@ options DIAGNOSTIC #device mmcsd # mmc/sd flash cards # Boot device is 2nd slice on MMC/SD card -options ROOTDEVNAME=\"ufs:/dev/da0s2\" +options ROOTDEVNAME=\"ufs:/dev/da0s2\" # Console and misc device uart @@ -98,7 +98,7 @@ device pass # USB support options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb -options USB_DEBUG +options USB_DEBUG #options USB_REQ_DEBUG #options USB_VERBOSE device dwcotg # DWC OTG controller @@ -117,7 +117,7 @@ device miibus device udav # Flattened Device Tree -options FDT -options FDT_DTB_STATIC +options FDT +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=rk3188-radxa.dts Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/RPI-B Tue Mar 18 14:41:18 2014 (r263301) @@ -27,14 +27,14 @@ options HZ=100 options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols -options SCTP # Stream Control Transmission Protocol +options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem device snp Modified: head/sys/arm/conf/SAM9260EK ============================================================================== --- head/sys/arm/conf/SAM9260EK Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/SAM9260EK Tue Mar 18 14:41:18 2014 (r263301) @@ -43,7 +43,7 @@ options NFSCL # New Network Filesyste #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/SAM9G20EK ============================================================================== --- head/sys/arm/conf/SAM9G20EK Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/SAM9G20EK Tue Mar 18 14:41:18 2014 (r263301) @@ -34,7 +34,7 @@ options INET # InterNETworking #options INET6 # IPv6 communications protocols options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem #options SOFTUPDATES # Enable FFS soft updates support #options UFS_ACL # Support for access control lists Modified: head/sys/arm/conf/SAM9X25EK ============================================================================== --- head/sys/arm/conf/SAM9X25EK Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/SAM9X25EK Tue Mar 18 14:41:18 2014 (r263301) @@ -35,7 +35,7 @@ options INET # InterNETworking #options INET6 # IPv6 communications protocols options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem #options SOFTUPDATES # Enable FFS soft updates support #options UFS_ACL # Support for access control lists Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/SHEEVAPLUG Tue Mar 18 14:41:18 2014 (r263301) @@ -18,7 +18,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem options NANDFS # NAND Filesystem options NFSCL # New Network Filesystem Client Modified: head/sys/arm/conf/SN9G45 ============================================================================== --- head/sys/arm/conf/SN9G45 Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/SN9G45 Tue Mar 18 14:41:18 2014 (r263301) @@ -54,7 +54,7 @@ options ALT_BREAK_TO_DEBUGGER options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/TS7800 ============================================================================== --- head/sys/arm/conf/TS7800 Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/TS7800 Tue Mar 18 14:41:18 2014 (r263301) @@ -28,7 +28,7 @@ options BOOTP_WIRED_TO=mge0 options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues Modified: head/sys/arm/conf/VERSATILEPB ============================================================================== --- head/sys/arm/conf/VERSATILEPB Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/VERSATILEPB Tue Mar 18 14:41:18 2014 (r263301) @@ -29,8 +29,8 @@ makeoptions KERNVIRTADDR=0xc0100000 options KERNPHYSADDR=0x00100000 makeoptions KERNPHYSADDR=0x00100000 options PHYSADDR=0x00000000 -options FREEBSD_BOOT_LOADER -options LINUX_BOOT_ABI +options FREEBSD_BOOT_LOADER +options LINUX_BOOT_ABI makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options HZ=100 @@ -45,7 +45,7 @@ device snp options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options PSEUDOFS # Pseudo-filesystem framework options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI Modified: head/sys/arm/conf/VYBRID.common ============================================================================== --- head/sys/arm/conf/VYBRID.common Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/VYBRID.common Tue Mar 18 14:41:18 2014 (r263301) @@ -25,32 +25,32 @@ makeoptions WITHOUT_MODULES="ahc" makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" -options HZ=100 -options SCHED_4BSD # 4BSD scheduler -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories +options HZ=100 +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework +options TMPFS # Efficient memory filesystem +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework #options NANDFS # NAND Filesystem -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options KBD_INSTALL_CDEV -options PREEMPTION -options FREEBSD_BOOT_LOADER +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV +options PREEMPTION +options FREEBSD_BOOT_LOADER options MUTEX_NOINLINE options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT @@ -59,10 +59,10 @@ options VFP # vfp/neon # Debugging makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options BREAK_TO_DEBUGGER +options BREAK_TO_DEBUGGER #options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB -options DDB # Enable the kernel debugger +options KDB +options DDB # Enable the kernel debugger #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles @@ -70,9 +70,9 @@ options DDB # Enable the kernel debug #options DIAGNOSTIC # NFS support -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCLIENT +options NFSCL # Network Filesystem Client +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCLIENT # Uncomment this for NFS root #options NFS_ROOT # NFS usable as /, requires NFSCL @@ -86,9 +86,9 @@ device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards device sdhci # generic sdhci -#options ROOTDEVNAME=\"nfs:10.5.0.1:/tftpboot/cosmic\" -#options ROOTDEVNAME=\"nandfs:/dev/gnand0s.root\" -options ROOTDEVNAME=\"ufs:/dev/da0\" +#options ROOTDEVNAME=\"nfs:10.5.0.1:/tftpboot/cosmic\" +#options ROOTDEVNAME=\"nandfs:/dev/gnand0s.root\" +options ROOTDEVNAME=\"ufs:/dev/da0\" #options SMP @@ -103,7 +103,7 @@ device gpio # USB support options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb -options USB_DEBUG +options USB_DEBUG #options USB_REQ_DEBUG #options USB_VERBOSE #device musb @@ -143,6 +143,6 @@ device sound # Framebuffer device vt device kbdmux -options SC_DFLT_FONT # compile font in +options SC_DFLT_FONT # compile font in makeoptions SC_DFLT_FONT=cp437 device ukbd Modified: head/sys/arm/conf/WANDBOARD.common ============================================================================== --- head/sys/arm/conf/WANDBOARD.common Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/WANDBOARD.common Tue Mar 18 14:41:18 2014 (r263301) @@ -35,7 +35,7 @@ options NFSCL # New Network Filesyst #options NFSD # New Network Filesystem Server options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCL -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem #options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/arm/conf/ZEDBOARD Tue Mar 18 14:41:18 2014 (r263301) @@ -43,7 +43,7 @@ options NFSCL # Network Filesystem Cl options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem +options TMPFS # Efficient memory filesystem options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) @@ -54,7 +54,7 @@ options SYSVSHM # SYSV-style shared m options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options FREEBSD_BOOT_LOADER +options FREEBSD_BOOT_LOADER options VFP # vfp/neon # Debugging Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/i386/conf/NOTES Tue Mar 18 14:41:18 2014 (r263301) @@ -381,7 +381,7 @@ options VESA_DEBUG device dpms # DPMS suspend & resume via VESA BIOS # x86 real mode BIOS emulator, required by atkbdc/dpms/vesa -options X86BIOS +options X86BIOS # # The Numeric Processing eXtension driver. This is non-optional. @@ -756,7 +756,7 @@ device ips # # Intel C600 (Patsburg) integrated SAS controller device isci -options ISCI_LOGGING # enable debugging in isci HAL +options ISCI_LOGGING # enable debugging in isci HAL # # NVM Express (NVMe) support Modified: head/sys/i386/conf/XEN ============================================================================== --- head/sys/i386/conf/XEN Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/i386/conf/XEN Tue Mar 18 14:41:18 2014 (r263301) @@ -83,8 +83,8 @@ device gif # IPv6 and IPv4 tunneling device faith # IPv6-to-IPv4 relaying (translation) # Wireless cards -options IEEE80211_SUPPORT_MESH -options AH_SUPPORT_AR5416 +options IEEE80211_SUPPORT_MESH +options AH_SUPPORT_AR5416 # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! Modified: head/sys/ia64/conf/GENERIC ============================================================================== --- head/sys/ia64/conf/GENERIC Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/ia64/conf/GENERIC Tue Mar 18 14:41:18 2014 (r263301) @@ -183,11 +183,11 @@ device uvscom # USB serial support for # Wireless NIC cards. # The wlan(4) module assumes this, so just define it so it # at least correctly loads. -options IEEE80211_SUPPORT_MESH +options IEEE80211_SUPPORT_MESH # The ath(4) and ath_hal(4) code requires this. The module currently # builds everything including AR5416 (and later 11n NIC) support. -options AH_SUPPORT_AR5416 +options AH_SUPPORT_AR5416 # Various (pseudo) devices device ether # Ethernet support Modified: head/sys/mips/conf/ALCHEMY ============================================================================== --- head/sys/mips/conf/ALCHEMY Tue Mar 18 14:19:53 2014 (r263300) +++ head/sys/mips/conf/ALCHEMY Tue Mar 18 14:41:18 2014 (r263301) @@ -28,15 +28,15 @@ include "../alchemy/std.alchemy" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -options DDB -options KDB +options DDB +options KDB -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -options NFSCL #Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCL -options PSEUDOFS #Pseudo-filesystem framework -# options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options NFSCL #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCL +options PSEUDOFS #Pseudo-filesystem framework +# options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions options BOOTP options BOOTP_NFSROOT @@ -48,15 +48,15 @@ options BOOTP_COMPAT # options SOFTUPDATES #Enable FFS soft updates support # options UFS_ACL #Support for access control lists # options UFS_DIRHASH #Improve performance on big directories -options ROOTDEVNAME=\"nfs:10.0.0.1:/mnt/bsd\" +options ROOTDEVNAME=\"nfs:10.0.0.1:/mnt/bsd\" # Debugging for use in -current #options DEADLKRES #Enable the deadlock resolver -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed device loop device ether *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 15:01:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36393593; Tue, 18 Mar 2014 15:01:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 22DDBD29; Tue, 18 Mar 2014 15:01:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2IF1XVv098851; Tue, 18 Mar 2014 15:01:33 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2IF1Wld098850; Tue, 18 Mar 2014 15:01:32 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201403181501.s2IF1Wld098850@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 18 Mar 2014 15:01:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263302 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 15:01:33 -0000 Author: gnn Date: Tue Mar 18 15:01:32 2014 New Revision: 263302 URL: http://svnweb.freebsd.org/changeset/base/263302 Log: fix mbuf leak if it does not fit in software queue mbuf should be owned by if_transmit function in any case. Submitted-by: Andrew Rybchenko Sponsored by: Solarflare Communications, Inc. Modified: head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Tue Mar 18 14:41:18 2014 (r263301) +++ head/sys/dev/sfxge/sfxge_tx.c Tue Mar 18 15:01:32 2014 (r263302) @@ -536,6 +536,7 @@ sfxge_tx_packet_add(struct sfxge_txq *tx return (0); fail: + m_freem(m); return (rc); } From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 15:43:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9BBD569A; Tue, 18 Mar 2014 15:43:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6D6E633B; Tue, 18 Mar 2014 15:43:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2IFhhYV015730; Tue, 18 Mar 2014 15:43:43 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2IFhhSc015728; Tue, 18 Mar 2014 15:43:43 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201403181543.s2IFhhSc015728@svn.freebsd.org> From: Jim Harris Date: Tue, 18 Mar 2014 15:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263303 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 15:43:43 -0000 Author: jimharris Date: Tue Mar 18 15:43:42 2014 New Revision: 263303 URL: http://svnweb.freebsd.org/changeset/base/263303 Log: Update nvme(4) and nvd(4) man pages to clarify the differences between their respective device nodes. Sponsored by: Intel MFC after: 3 days Modified: head/share/man/man4/nvd.4 head/share/man/man4/nvme.4 Modified: head/share/man/man4/nvd.4 ============================================================================== --- head/share/man/man4/nvd.4 Tue Mar 18 15:01:32 2014 (r263302) +++ head/share/man/man4/nvd.4 Tue Mar 18 15:43:42 2014 (r263303) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2012-2013 Intel Corporation +.\" Copyright (c) 2012-2014 Intel Corporation .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2013 +.Dd March 18, 2014 .Dt NVD 4 .Os .Sh NAME @@ -62,8 +62,22 @@ It depends on the .Xr nvme 4 driver for notification of existing NVMe namespaces and submission of NVM I/O commands. +.Pp +Device nodes from the +.Nm +driver will have the format /dev/nvdX and are +.Xr GEOM 4 +disks which can be partitioned by +.Xr geom 8 . +Note that device nodes from the +.Xr nvme 4 +driver are not +.Xr GEOM 4 +disks and cannot be partitioned. .Sh SEE ALSO +.Xr GEOM 4 , .Xr nvme 4 , +.Xr geom 8 , .Xr nvmecontrol 8 , .Xr disk 9 .Sh HISTORY Modified: head/share/man/man4/nvme.4 ============================================================================== --- head/share/man/man4/nvme.4 Tue Mar 18 15:01:32 2014 (r263302) +++ head/share/man/man4/nvme.4 Tue Mar 18 15:43:42 2014 (r263303) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2012-2013 Intel Corporation +.\" Copyright (c) 2012-2014 Intel Corporation .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2013 +.Dd March 18, 2014 .Dt NVME 4 .Os .Sh NAME @@ -54,7 +54,8 @@ nvme_load="YES" .Pp Most users will also want to enable .Xr nvd 4 -to surface NVM Express namespaces as disk devices. +to surface NVM Express namespaces as disk devices which can be +partitioned. Note that in NVM Express terms, a namespace is roughly equivalent to a SCSI LUN. .Sh DESCRIPTION @@ -73,11 +74,13 @@ API for registering NVMe namespace consu API for submitting NVM commands to namespaces .It Ioctls for controller and namespace configuration and management +.El .Pp +The .Nm -creates controller devices in the format +driver creates controller device nodes in the format .Pa /dev/nvmeX -and namespace devices in +and namespace device nodes in the format .Pa /dev/nvmeXnsY . Note that the NVM Express specification starts numbering namespaces at 1, From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 15:59:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D6B8B59; Tue, 18 Mar 2014 15:59:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 099C46A0; Tue, 18 Mar 2014 15:59:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2IFx6U2020426; Tue, 18 Mar 2014 15:59:06 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2IFx6CW020425; Tue, 18 Mar 2014 15:59:06 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403181559.s2IFx6CW020425@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 18 Mar 2014 15:59:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263304 - head/sys/x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 15:59:07 -0000 Author: kib Date: Tue Mar 18 15:59:06 2014 New Revision: 263304 URL: http://svnweb.freebsd.org/changeset/base/263304 Log: Trim at EOL. MFC after: 3 days Modified: head/sys/x86/iommu/busdma_dmar.c Modified: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Tue Mar 18 15:43:42 2014 (r263303) +++ head/sys/x86/iommu/busdma_dmar.c Tue Mar 18 15:59:06 2014 (r263304) @@ -237,7 +237,7 @@ dmar_bus_dmamap_create(bus_dma_tag_t dma map->cansleep = false; tag->map_count++; *mapp = (bus_dmamap_t)map; - + return (0); } @@ -280,7 +280,7 @@ dmar_bus_dmamem_alloc(bus_dma_tag_t dmat mflags |= (flags & BUS_DMA_ZERO) != 0 ? M_ZERO : 0; attr = (flags & BUS_DMA_NOCACHE) != 0 ? VM_MEMATTR_UNCACHEABLE : VM_MEMATTR_DEFAULT; - + tag = (struct bus_dma_tag_dmar *)dmat; map = (struct bus_dmamap_dmar *)*mapp; From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 16:20:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D2D04C6; Tue, 18 Mar 2014 16:20:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 698A6960; Tue, 18 Mar 2014 16:20:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2IGKYnO029468; Tue, 18 Mar 2014 16:20:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2IGKYGa029467; Tue, 18 Mar 2014 16:20:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403181620.s2IGKYGa029467@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 18 Mar 2014 16:20:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263305 - head/sys/x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 16:20:34 -0000 Author: kib Date: Tue Mar 18 16:20:33 2014 New Revision: 263305 URL: http://svnweb.freebsd.org/changeset/base/263305 Log: It is not uncommon for BIOSes to report wrong RMRR entries in DMAR table. Among them, some (old AMI ?) BIOSes report entries with range like (bf7ec000, bf7ebfff). Attempts to ignore the bogus entries result in faults, so the range must be covered somehow. Provide a workaround by identity mapping the 32 pages after the bogus entry start, which seems to be enough for the reported BIOS. Reported and tested by: Jason Harmening Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/iommu/intel_ctx.c Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Tue Mar 18 15:59:06 2014 (r263304) +++ head/sys/x86/iommu/intel_ctx.c Tue Mar 18 16:20:33 2014 (r263305) @@ -182,6 +182,15 @@ ctx_init_rmrr(struct dmar_ctx *ctx, devi end = entry->end; entry->start = trunc_page(start); entry->end = round_page(end); + if (entry->start == entry->end) { + /* Workaround for some AMI (?) BIOSes */ + if (bootverbose) { + device_printf(dev, "BIOS bug: dmar%d RMRR " + "region (%jx, %jx) corrected\n", + ctx->dmar->unit, start, end); + } + entry->end += DMAR_PAGE_SIZE * 0x20; + } size = OFF_TO_IDX(entry->end - entry->start); ma = malloc(sizeof(vm_page_t) * size, M_TEMP, M_WAITOK); for (i = 0; i < size; i++) { From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 16:41:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8776DCDD; Tue, 18 Mar 2014 16:41:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 66E89C27; Tue, 18 Mar 2014 16:41:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2IGfXE5038756; Tue, 18 Mar 2014 16:41:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2IGfW6a038753; Tue, 18 Mar 2014 16:41:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403181641.s2IGfW6a038753@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 18 Mar 2014 16:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263306 - head/sys/x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 16:41:33 -0000 Author: kib Date: Tue Mar 18 16:41:32 2014 New Revision: 263306 URL: http://svnweb.freebsd.org/changeset/base/263306 Log: Add support for the PCI(e)-PCI bridges to the Intel VT-d driver. The bridge takes ownership of the transaction, so bsf of the requester is the bridge and not a device behind it. As result, code needs to walk the hierarchy up to use correct context. Note that PCIe->PCI-X bridges are not handled quite correctly since such bridges are allowed to only take ownership of some transactions. Also, weird but unrealistic cases of PCIe behind PCI bus are also not handled. Still, the patch provides significant step forward for the bridge handling. Submitted by: Jason Harmening MFC after: 1 week Modified: head/sys/x86/iommu/busdma_dmar.c head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_dmar.h Modified: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Tue Mar 18 16:20:33 2014 (r263305) +++ head/sys/x86/iommu/busdma_dmar.c Tue Mar 18 16:41:32 2014 (r263306) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -69,15 +70,10 @@ __FBSDID("$FreeBSD$"); */ static bool -dmar_bus_dma_is_dev_disabled(device_t dev) +dmar_bus_dma_is_dev_disabled(int domain, int bus, int slot, int func) { char str[128], *env; - int domain, bus, slot, func; - domain = pci_get_domain(dev); - bus = pci_get_bus(dev); - slot = pci_get_slot(dev); - func = pci_get_function(dev); snprintf(str, sizeof(str), "hw.busdma.pci%d.%d.%d.%d.bounce", domain, bus, slot, func); env = getenv(str); @@ -87,11 +83,119 @@ dmar_bus_dma_is_dev_disabled(device_t de return (true); } +/* + * Given original device, find the requester ID that will be seen by + * the DMAR unit and used for page table lookup. PCI bridges may take + * ownership of transactions from downstream devices, so it may not be + * the same as the BSF of the target device. In those cases, all + * devices downstream of the bridge must share a single mapping + * domain, and must collectively be assigned to use either DMAR or + * bounce mapping. + */ +static device_t +dmar_get_requester(device_t dev, int *bus, int *slot, int *func) +{ + devclass_t pci_class; + device_t pci, pcib, requester; + int cap_offset; + + pci_class = devclass_find("pci"); + requester = dev; + + *bus = pci_get_bus(dev); + *slot = pci_get_slot(dev); + *func = pci_get_function(dev); + + /* + * Walk the bridge hierarchy from the target device to the + * host port to find the translating bridge nearest the DMAR + * unit. + */ + for (;;) { + pci = device_get_parent(dev); + KASSERT(pci != NULL, ("NULL parent for pci%d:%d:%d:%d", + pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), + pci_get_function(dev))); + KASSERT(device_get_devclass(pci) == pci_class, + ("Non-pci parent for pci%d:%d:%d:%d", + pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), + pci_get_function(dev))); + + pcib = device_get_parent(pci); + KASSERT(pcib != NULL, ("NULL bridge for pci%d:%d:%d:%d", + pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), + pci_get_function(dev))); + + /* + * The parent of our "bridge" isn't another PCI bus, + * so pcib isn't a PCI->PCI bridge but rather a host + * port, and the requester ID won't be translated + * further. + */ + if (device_get_devclass(device_get_parent(pcib)) != pci_class) + break; + + if (pci_find_cap(dev, PCIY_EXPRESS, &cap_offset) != 0) { + /* + * Device is not PCIe, it cannot be seen as a + * requester by DMAR unit. + */ + requester = pcib; + + /* Check whether the bus above is PCIe. */ + if (pci_find_cap(pcib, PCIY_EXPRESS, + &cap_offset) == 0) { + /* + * The current device is not PCIe, but + * the bridge above it is. This is a + * PCIe->PCI bridge. Assume that the + * requester ID will be the secondary + * bus number with slot and function + * set to zero. + * + * XXX: Doesn't handle the case where + * the bridge is PCIe->PCI-X, and the + * bridge will only take ownership of + * requests in some cases. We should + * provide context entries with the + * same page tables for taken and + * non-taken transactions. + */ + *bus = pci_get_bus(dev); + *slot = *func = 0; + } else { + /* + * Neither the device nor the bridge + * above it are PCIe. This is a + * conventional PCI->PCI bridge, which + * will use the bridge's BSF as the + * requester ID. + */ + *bus = pci_get_bus(pcib); + *slot = pci_get_slot(pcib); + *func = pci_get_function(pcib); + } + } + /* + * Do not stop the loop even if the target device is + * PCIe, because it is possible (but unlikely) to have + * a PCI->PCIe bridge somewhere in the hierarchy. + */ + + dev = pcib; + } + return (requester); +} + struct dmar_ctx * dmar_instantiate_ctx(struct dmar_unit *dmar, device_t dev, bool rmrr) { + device_t requester; struct dmar_ctx *ctx; bool disabled; + int bus, slot, func; + + requester = dmar_get_requester(dev, &bus, &slot, &func); /* * If the user requested the IOMMU disabled for the device, we @@ -100,11 +204,11 @@ dmar_instantiate_ctx(struct dmar_unit *d * Instead provide the identity mapping for the device * context. */ - disabled = dmar_bus_dma_is_dev_disabled(dev); - ctx = dmar_get_ctx(dmar, dev, disabled, rmrr); + disabled = dmar_bus_dma_is_dev_disabled(pci_get_domain(dev), bus, + slot, func); + ctx = dmar_get_ctx(dmar, requester, bus, slot, func, disabled, rmrr); if (ctx == NULL) return (NULL); - ctx->ctx_tag.owner = dev; if (disabled) { /* * Keep the first reference on context, release the Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Tue Mar 18 16:20:33 2014 (r263305) +++ head/sys/x86/iommu/intel_ctx.c Tue Mar 18 16:41:32 2014 (r263306) @@ -262,17 +262,15 @@ dmar_ctx_dtr(struct dmar_ctx *ctx, bool } struct dmar_ctx * -dmar_get_ctx(struct dmar_unit *dmar, device_t dev, bool id_mapped, bool rmrr_init) +dmar_get_ctx(struct dmar_unit *dmar, device_t dev, int bus, int slot, int func, + bool id_mapped, bool rmrr_init) { struct dmar_ctx *ctx, *ctx1; dmar_ctx_entry_t *ctxp; struct sf_buf *sf; - int bus, slot, func, error, mgaw; + int error, mgaw; bool enable; - bus = pci_get_bus(dev); - slot = pci_get_slot(dev); - func = pci_get_function(dev); enable = false; TD_PREP_PINNED_ASSERT; DMAR_LOCK(dmar); @@ -356,6 +354,7 @@ dmar_get_ctx(struct dmar_unit *dmar, dev ctx = dmar_find_ctx_locked(dmar, bus, slot, func); if (ctx == NULL) { ctx = ctx1; + ctx->ctx_tag.owner = dev; ctx->domain = alloc_unrl(dmar->domids); if (ctx->domain == -1) { DMAR_UNLOCK(dmar); @@ -376,9 +375,11 @@ dmar_get_ctx(struct dmar_unit *dmar, dev LIST_INSERT_HEAD(&dmar->contexts, ctx, link); ctx_id_entry_init(ctx, ctxp); device_printf(dev, - "dmar%d pci%d:%d:%d:%d domain %d mgaw %d agaw %d\n", + "dmar%d pci%d:%d:%d:%d domain %d mgaw %d " + "agaw %d %s-mapped\n", dmar->unit, dmar->segment, bus, slot, - func, ctx->domain, ctx->mgaw, ctx->agaw); + func, ctx->domain, ctx->mgaw, ctx->agaw, + id_mapped ? "id" : "re"); } else { dmar_ctx_dtr(ctx1, true, true); } Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Tue Mar 18 16:20:33 2014 (r263305) +++ head/sys/x86/iommu/intel_dmar.h Tue Mar 18 16:41:32 2014 (r263306) @@ -270,7 +270,7 @@ void ctx_free_pgtbl(struct dmar_ctx *ctx struct dmar_ctx *dmar_instantiate_ctx(struct dmar_unit *dmar, device_t dev, bool rmrr); struct dmar_ctx *dmar_get_ctx(struct dmar_unit *dmar, device_t dev, - bool id_mapped, bool rmrr_init); + int bus, int slot, int func, bool id_mapped, bool rmrr_init); void dmar_free_ctx_locked(struct dmar_unit *dmar, struct dmar_ctx *ctx); void dmar_free_ctx(struct dmar_ctx *ctx); struct dmar_ctx *dmar_find_ctx_locked(struct dmar_unit *dmar, int bus, From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 17:00:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 825E87D0; Tue, 18 Mar 2014 17:00:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6F15AE10; Tue, 18 Mar 2014 17:00:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2IH0Xgb047769; Tue, 18 Mar 2014 17:00:33 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2IH0XD1047768; Tue, 18 Mar 2014 17:00:33 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403181700.s2IH0XD1047768@svn.freebsd.org> From: Ed Maste Date: Tue, 18 Mar 2014 17:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263308 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 17:00:33 -0000 Author: emaste Date: Tue Mar 18 17:00:32 2014 New Revision: 263308 URL: http://svnweb.freebsd.org/changeset/base/263308 Log: Switch to standard 2-clause license Approved by: hps@ Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/wsp.4 Modified: head/share/man/man4/wsp.4 ============================================================================== --- head/share/man/man4/wsp.4 Tue Mar 18 16:56:05 2014 (r263307) +++ head/share/man/man4/wsp.4 Tue Mar 18 17:00:32 2014 (r263308) @@ -9,9 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. Neither the name of the author nor the names of any co-contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 18:09:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2501A202; Tue, 18 Mar 2014 18:09:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 06D68833; Tue, 18 Mar 2014 18:09:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2II98w9074408; Tue, 18 Mar 2014 18:09:08 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2II98oi074405; Tue, 18 Mar 2014 18:09:08 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201403181809.s2II98oi074405@svn.freebsd.org> From: Jim Harris Date: Tue, 18 Mar 2014 18:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263310 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 18:09:09 -0000 Author: jimharris Date: Tue Mar 18 18:09:08 2014 New Revision: 263310 URL: http://svnweb.freebsd.org/changeset/base/263310 Log: nvme: Close hole where nvd(4) would not be notified of all nvme(4) instances if modules loaded during boot. Sponsored by: Intel MFC after: 3 days Modified: head/sys/dev/nvme/nvme.c head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_private.h Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Tue Mar 18 17:17:42 2014 (r263309) +++ head/sys/dev/nvme/nvme.c Tue Mar 18 18:09:08 2014 (r263310) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012-2013 Intel Corporation + * Copyright (C) 2012-2014 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -266,39 +266,75 @@ nvme_detach (device_t dev) } static void -nvme_notify_consumer(struct nvme_consumer *cons) +nvme_notify(struct nvme_consumer *cons, + struct nvme_controller *ctrlr) { - device_t *devlist; - struct nvme_controller *ctrlr; struct nvme_namespace *ns; void *ctrlr_cookie; - int dev_idx, ns_idx, devcount; + int cmpset, ns_idx; + + /* + * The consumer may register itself after the nvme devices + * have registered with the kernel, but before the + * driver has completed initialization. In that case, + * return here, and when initialization completes, the + * controller will make sure the consumer gets notified. + */ + if (!ctrlr->is_initialized) + return; + + cmpset = atomic_cmpset_32(&ctrlr->notification_sent, 0, 1); + + if (cmpset == 0) + return; + + if (cons->ctrlr_fn != NULL) + ctrlr_cookie = (*cons->ctrlr_fn)(ctrlr); + else + ctrlr_cookie = NULL; + ctrlr->cons_cookie[cons->id] = ctrlr_cookie; + if (ctrlr->is_failed) { + if (cons->fail_fn != NULL) + (*cons->fail_fn)(ctrlr_cookie); + /* + * Do not notify consumers about the namespaces of a + * failed controller. + */ + return; + } + for (ns_idx = 0; ns_idx < ctrlr->cdata.nn; ns_idx++) { + ns = &ctrlr->ns[ns_idx]; + if (cons->ns_fn != NULL) + ns->cons_cookie[cons->id] = + (*cons->ns_fn)(ns, ctrlr_cookie); + } +} + +void +nvme_notify_new_controller(struct nvme_controller *ctrlr) +{ + int i; + + for (i = 0; i < NVME_MAX_CONSUMERS; i++) { + if (nvme_consumer[i].id != INVALID_CONSUMER_ID) { + nvme_notify(&nvme_consumer[i], ctrlr); + } + } +} + +static void +nvme_notify_new_consumer(struct nvme_consumer *cons) +{ + device_t *devlist; + struct nvme_controller *ctrlr; + int dev_idx, devcount; if (devclass_get_devices(nvme_devclass, &devlist, &devcount)) return; for (dev_idx = 0; dev_idx < devcount; dev_idx++) { ctrlr = DEVICE2SOFTC(devlist[dev_idx]); - if (cons->ctrlr_fn != NULL) - ctrlr_cookie = (*cons->ctrlr_fn)(ctrlr); - else - ctrlr_cookie = NULL; - ctrlr->cons_cookie[cons->id] = ctrlr_cookie; - if (ctrlr->is_failed) { - if (cons->fail_fn != NULL) - (*cons->fail_fn)(ctrlr_cookie); - /* - * Do not notify consumers about the namespaces of a - * failed controller. - */ - continue; - } - for (ns_idx = 0; ns_idx < ctrlr->cdata.nn; ns_idx++) { - ns = &ctrlr->ns[ns_idx]; - if (cons->ns_fn != NULL) - ns->cons_cookie[cons->id] = - (*cons->ns_fn)(ns, ctrlr_cookie); - } + nvme_notify(cons, ctrlr); } free(devlist, M_TEMP); @@ -353,7 +389,7 @@ nvme_register_consumer(nvme_cons_ns_fn_t nvme_consumer[i].async_fn = async_fn; nvme_consumer[i].fail_fn = fail_fn; - nvme_notify_consumer(&nvme_consumer[i]); + nvme_notify_new_consumer(&nvme_consumer[i]); return (&nvme_consumer[i]); } Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Tue Mar 18 17:17:42 2014 (r263309) +++ head/sys/dev/nvme/nvme_ctrlr.c Tue Mar 18 18:09:08 2014 (r263310) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012-2013 Intel Corporation + * Copyright (C) 2012-2014 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -851,6 +851,9 @@ nvme_ctrlr_start_config_hook(void *arg) nvme_ctrlr_start(ctrlr); config_intrhook_disestablish(&ctrlr->config_hook); + + ctrlr->is_initialized = 1; + nvme_notify_new_controller(ctrlr); } static void @@ -1174,6 +1177,8 @@ intx: taskqueue_start_threads(&ctrlr->taskqueue, 1, PI_DISK, "nvme taskq"); ctrlr->is_resetting = 0; + ctrlr->is_initialized = 0; + ctrlr->notification_sent = 0; TASK_INIT(&ctrlr->reset_task, 0, nvme_ctrlr_reset_task, ctrlr); TASK_INIT(&ctrlr->fail_req_task, 0, nvme_ctrlr_fail_req_task, ctrlr); Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Tue Mar 18 17:17:42 2014 (r263309) +++ head/sys/dev/nvme/nvme_private.h Tue Mar 18 18:09:08 2014 (r263310) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012-2013 Intel Corporation + * Copyright (C) 2012-2014 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -330,7 +330,9 @@ struct nvme_controller { void *cons_cookie[NVME_MAX_CONSUMERS]; - uint32_t is_resetting; + uint32_t is_resetting; + uint32_t is_initialized; + uint32_t notification_sent; boolean_t is_failed; STAILQ_HEAD(, nvme_request) fail_req; @@ -556,5 +558,6 @@ void nvme_notify_async_consumers(struct uint32_t log_page_id, void *log_page_buffer, uint32_t log_page_size); void nvme_notify_fail_consumers(struct nvme_controller *ctrlr); +void nvme_notify_new_controller(struct nvme_controller *ctrlr); #endif /* __NVME_PRIVATE_H__ */ From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 18:10:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B1D3452; Tue, 18 Mar 2014 18:10:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 681D5858; Tue, 18 Mar 2014 18:10:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2IIAajC075084; Tue, 18 Mar 2014 18:10:36 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2IIAZLF075078; Tue, 18 Mar 2014 18:10:35 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201403181810.s2IIAZLF075078@svn.freebsd.org> From: Jim Harris Date: Tue, 18 Mar 2014 18:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263311 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 18:10:36 -0000 Author: jimharris Date: Tue Mar 18 18:10:35 2014 New Revision: 263311 URL: http://svnweb.freebsd.org/changeset/base/263311 Log: nvme: Allocate all MSI resources up front so that we can fall back to INTx if necessary. Sponsored by: Intel MFC after: 3 days Modified: head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Tue Mar 18 18:09:08 2014 (r263310) +++ head/sys/dev/nvme/nvme_ctrlr.c Tue Mar 18 18:10:35 2014 (r263311) @@ -1075,8 +1075,8 @@ nvme_ctrlr_construct(struct nvme_control { union cap_lo_register cap_lo; union cap_hi_register cap_hi; - int num_vectors, per_cpu_io_queues, status = 0; - int timeout_period; + int i, num_vectors, per_cpu_io_queues, rid; + int status, timeout_period; ctrlr->dev = dev; @@ -1149,8 +1149,45 @@ nvme_ctrlr_construct(struct nvme_control goto intx; } - if (pci_alloc_msix(dev, &num_vectors) != 0) + if (pci_alloc_msix(dev, &num_vectors) != 0) { ctrlr->msix_enabled = 0; + goto intx; + } + + /* + * On earlier FreeBSD releases, there are reports that + * pci_alloc_msix() can return successfully with all vectors + * requested, but a subsequent bus_alloc_resource_any() + * for one of those vectors fails. This issue occurs more + * readily with multiple devices using per-CPU vectors. + * To workaround this issue, try to allocate the resources now, + * and fall back to INTx if we cannot allocate all of them. + * This issue cannot be reproduced on more recent versions of + * FreeBSD which have increased the maximum number of MSI-X + * vectors, but adding the workaround makes it easier for + * vendors wishing to import this driver into kernels based on + * older versions of FreeBSD. + */ + for (i = 0; i < num_vectors; i++) { + rid = i + 1; + ctrlr->msi_res[i] = bus_alloc_resource_any(ctrlr->dev, + SYS_RES_IRQ, &rid, RF_ACTIVE); + + if (ctrlr->msi_res[i] == NULL) { + ctrlr->msix_enabled = 0; + while (i > 0) { + i--; + bus_release_resource(ctrlr->dev, + SYS_RES_IRQ, + rman_get_rid(ctrlr->msi_res[i]), + ctrlr->msi_res[i]); + } + pci_release_msi(dev); + nvme_printf(ctrlr, "could not obtain all MSI-X " + "resources, reverting to intx\n"); + break; + } + } intx: Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Tue Mar 18 18:09:08 2014 (r263310) +++ head/sys/dev/nvme/nvme_private.h Tue Mar 18 18:10:35 2014 (r263311) @@ -289,6 +289,8 @@ struct nvme_controller { struct task fail_req_task; struct taskqueue *taskqueue; + struct resource *msi_res[MAXCPU + 1]; + /* For shared legacy interrupt. */ int rid; struct resource *res; Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Tue Mar 18 18:09:08 2014 (r263310) +++ head/sys/dev/nvme/nvme_qpair.c Tue Mar 18 18:10:35 2014 (r263311) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012-2013 Intel Corporation + * Copyright (C) 2012-2014 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -487,9 +487,7 @@ nvme_qpair_construct(struct nvme_qpair * * the queue's vector to get the corresponding rid to use. */ qpair->rid = vector + 1; - - qpair->res = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ, - &qpair->rid, RF_ACTIVE); + qpair->res = ctrlr->msi_res[vector]; bus_setup_intr(ctrlr->dev, qpair->res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 19:23:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6935F78; Tue, 18 Mar 2014 19:23:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D0EDE12C; Tue, 18 Mar 2014 19:23:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2IJNhAN006955; Tue, 18 Mar 2014 19:23:43 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2IJNfZv006943; Tue, 18 Mar 2014 19:23:41 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403181923.s2IJNfZv006943@svn.freebsd.org> From: Dimitry Andric Date: Tue, 18 Mar 2014 19:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263312 - in head/contrib/llvm: include/llvm/CodeGen lib/CodeGen lib/CodeGen/SelectionDAG lib/MC/MCParser lib/Target/X86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 19:23:44 -0000 Author: dim Date: Tue Mar 18 19:23:41 2014 New Revision: 263312 URL: http://svnweb.freebsd.org/changeset/base/263312 Log: Pull in r196939 from upstream llvm trunk (by Reid Kleckner): Reland "Fix miscompile of MS inline assembly with stack realignment" This re-lands commit r196876, which was reverted in r196879. The tests have been fixed to pass on platforms with a stack alignment larger than 4. Update to clang side tests will land shortly. Pull in r196986 from upstream llvm trunk (by Reid Kleckner): Revert the backend fatal error from r196939 The combination of inline asm, stack realignment, and dynamic allocas turns out to be too common to reject out of hand. ASan inserts empy inline asm fragments and uses aligned allocas. Compiling any trivial function containing a dynamic alloca with ASan is enough to trigger the check. XFAIL the test cases that would be miscompiled and add one that uses the relevant functionality. Pull in r202930 from upstream llvm trunk (by Hans Wennborg): Check for dynamic allocas and inline asm that clobbers sp before building selection dag (PR19012) In X86SelectionDagInfo::EmitTargetCodeForMemcpy we check with MachineFrameInfo to make sure that ESI isn't used as a base pointer register before we choose to emit rep movs (which clobbers esi). The problem is that MachineFrameInfo wouldn't know about dynamic allocas or inline asm that clobbers the stack pointer until SelectionDAGBuilder has encountered them. This patch fixes the problem by checking for such things when building the FunctionLoweringInfo. Differential Revision: http://llvm-reviews.chandlerc.com/D2954 Together, these commits fix the problem encountered in the devel/emacs port on the i386 architecture, where a combination of stack realignment, alloca() and memcpy() could incidentally clobber the %esi register, leading to segfaults in the temacs build-time utility. See also: http://llvm.org/PR18171 and http://llvm.org/PR19012 Reported by: ashish PR: ports/183064 MFC after: 1 week Modified: head/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineFrameInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineFunction.h head/contrib/llvm/lib/CodeGen/MachineFunction.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp head/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp head/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp Modified: head/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h Tue Mar 18 18:10:35 2014 (r263311) +++ head/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h Tue Mar 18 19:23:41 2014 (r263312) @@ -41,6 +41,7 @@ class MachineBasicBlock; class MachineFunction; class MachineModuleInfo; class MachineRegisterInfo; +class SelectionDAG; class TargetLowering; class Value; @@ -125,7 +126,7 @@ public: /// set - Initialize this FunctionLoweringInfo with the given Function /// and its associated MachineFunction. /// - void set(const Function &Fn, MachineFunction &MF); + void set(const Function &Fn, MachineFunction &MF, SelectionDAG *DAG); /// clear - Clear out all the function-specific state. This returns this /// FunctionLoweringInfo to an empty state, ready to be used for a Modified: head/contrib/llvm/include/llvm/CodeGen/MachineFrameInfo.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/MachineFrameInfo.h Tue Mar 18 18:10:35 2014 (r263311) +++ head/contrib/llvm/include/llvm/CodeGen/MachineFrameInfo.h Tue Mar 18 19:23:41 2014 (r263312) @@ -223,6 +223,10 @@ class MachineFrameInfo { /// Whether the "realign-stack" option is on. bool RealignOption; + /// True if the function includes inline assembly that adjusts the stack + /// pointer. + bool HasInlineAsmWithSPAdjust; + const TargetFrameLowering *getFrameLowering() const; public: explicit MachineFrameInfo(const TargetMachine &TM, bool RealignOpt) @@ -240,6 +244,7 @@ public: LocalFrameSize = 0; LocalFrameMaxAlign = 0; UseLocalStackAllocationBlock = false; + HasInlineAsmWithSPAdjust = false; } /// hasStackObjects - Return true if there are any stack objects in this @@ -451,6 +456,10 @@ public: bool hasCalls() const { return HasCalls; } void setHasCalls(bool V) { HasCalls = V; } + /// Returns true if the function contains any stack-adjusting inline assembly. + bool hasInlineAsmWithSPAdjust() const { return HasInlineAsmWithSPAdjust; } + void setHasInlineAsmWithSPAdjust(bool B) { HasInlineAsmWithSPAdjust = B; } + /// getMaxCallFrameSize - Return the maximum size of a call frame that must be /// allocated for an outgoing function call. This is only available if /// CallFrameSetup/Destroy pseudo instructions are used by the target, and @@ -521,7 +530,7 @@ public: /// variable sized object is created, whether or not the index returned is /// actually used. /// - int CreateVariableSizedObject(unsigned Alignment); + int CreateVariableSizedObject(unsigned Alignment, const AllocaInst *Alloca); /// getCalleeSavedInfo - Returns a reference to call saved info vector for the /// current function. Modified: head/contrib/llvm/include/llvm/CodeGen/MachineFunction.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/MachineFunction.h Tue Mar 18 18:10:35 2014 (r263311) +++ head/contrib/llvm/include/llvm/CodeGen/MachineFunction.h Tue Mar 18 19:23:41 2014 (r263312) @@ -131,8 +131,8 @@ class MachineFunction { /// about the control flow of such functions. bool ExposesReturnsTwice; - /// True if the function includes MS-style inline assembly. - bool HasMSInlineAsm; + /// True if the function includes any inline assembly. + bool HasInlineAsm; MachineFunction(const MachineFunction &) LLVM_DELETED_FUNCTION; void operator=(const MachineFunction&) LLVM_DELETED_FUNCTION; @@ -218,15 +218,14 @@ public: ExposesReturnsTwice = B; } - /// Returns true if the function contains any MS-style inline assembly. - bool hasMSInlineAsm() const { - return HasMSInlineAsm; + /// Returns true if the function contains any inline assembly. + bool hasInlineAsm() const { + return HasInlineAsm; } - /// Set a flag that indicates that the function contains MS-style inline - /// assembly. - void setHasMSInlineAsm(bool B) { - HasMSInlineAsm = B; + /// Set a flag that indicates that the function contains inline assembly. + void setHasInlineAsm(bool B) { + HasInlineAsm = B; } /// getInfo - Keep track of various per-function pieces of information for Modified: head/contrib/llvm/lib/CodeGen/MachineFunction.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/MachineFunction.cpp Tue Mar 18 18:10:35 2014 (r263311) +++ head/contrib/llvm/lib/CodeGen/MachineFunction.cpp Tue Mar 18 19:23:41 2014 (r263312) @@ -525,13 +525,14 @@ int MachineFrameInfo::CreateSpillStackOb /// variable sized object is created, whether or not the index returned is /// actually used. /// -int MachineFrameInfo::CreateVariableSizedObject(unsigned Alignment) { +int MachineFrameInfo::CreateVariableSizedObject(unsigned Alignment, + const AllocaInst *Alloca) { HasVarSizedObjects = true; Alignment = clampStackAlignment(!getFrameLowering()->isStackRealignable() || !RealignOption, Alignment, getFrameLowering()->getStackAlignment()); - Objects.push_back(StackObject(0, Alignment, 0, false, false, true, 0)); + Objects.push_back(StackObject(0, Alignment, 0, false, false, true, Alloca)); ensureMaxAlignment(Alignment); return (int)Objects.size()-NumFixedObjects-1; } Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp Tue Mar 18 18:10:35 2014 (r263311) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp Tue Mar 18 19:23:41 2014 (r263312) @@ -33,6 +33,7 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/MathExtras.h" #include "llvm/Target/TargetInstrInfo.h" +#include "llvm/Target/TargetFrameLowering.h" #include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetOptions.h" #include "llvm/Target/TargetRegisterInfo.h" @@ -55,7 +56,8 @@ static bool isUsedOutsideOfDefiningBlock return false; } -void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf) { +void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf, + SelectionDAG *DAG) { const TargetLowering *TLI = TM.getTargetLowering(); Fn = &fn; @@ -100,6 +102,43 @@ void FunctionLoweringInfo::set(const Fun for (; BB != EB; ++BB) for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I != E; ++I) { + // Look for dynamic allocas. + if (const AllocaInst *AI = dyn_cast(I)) { + if (!AI->isStaticAlloca()) { + unsigned Align = std::max( + (unsigned)TLI->getDataLayout()->getPrefTypeAlignment( + AI->getAllocatedType()), + AI->getAlignment()); + unsigned StackAlign = TM.getFrameLowering()->getStackAlignment(); + if (Align <= StackAlign) + Align = 0; + // Inform the Frame Information that we have variable-sized objects. + MF->getFrameInfo()->CreateVariableSizedObject(Align ? Align : 1, AI); + } + } + + // Look for inline asm that clobbers the SP register. + if (isa(I) || isa(I)) { + ImmutableCallSite CS(I); + if (const InlineAsm *IA = dyn_cast(CS.getCalledValue())) { + unsigned SP = TLI->getStackPointerRegisterToSaveRestore(); + std::vector Ops = + TLI->ParseConstraints(CS); + for (size_t I = 0, E = Ops.size(); I != E; ++I) { + TargetLowering::AsmOperandInfo &Op = Ops[I]; + if (Op.Type == InlineAsm::isClobber) { + // Clobbers don't have SDValue operands, hence SDValue(). + TLI->ComputeConstraintToUse(Op, SDValue(), DAG); + std::pair PhysReg = + TLI->getRegForInlineAsmConstraint(Op.ConstraintCode, + Op.ConstraintVT); + if (PhysReg.first == SP) + MF->getFrameInfo()->setHasInlineAsmWithSPAdjust(true); + } + } + } + } + // Mark values used outside their block as exported, by allocating // a virtual register for them. if (isUsedOutsideOfDefiningBlock(I)) Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Tue Mar 18 18:10:35 2014 (r263311) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Tue Mar 18 19:23:41 2014 (r263312) @@ -851,12 +851,20 @@ void RegsForValue::AddInlineAsmOperands( SDValue Res = DAG.getTargetConstant(Flag, MVT::i32); Ops.push_back(Res); + unsigned SP = TLI.getStackPointerRegisterToSaveRestore(); for (unsigned Value = 0, Reg = 0, e = ValueVTs.size(); Value != e; ++Value) { unsigned NumRegs = TLI.getNumRegisters(*DAG.getContext(), ValueVTs[Value]); MVT RegisterVT = RegVTs[Value]; for (unsigned i = 0; i != NumRegs; ++i) { assert(Reg < Regs.size() && "Mismatch in # registers expected"); - Ops.push_back(DAG.getRegister(Regs[Reg++], RegisterVT)); + unsigned TheReg = Regs[Reg++]; + Ops.push_back(DAG.getRegister(TheReg, RegisterVT)); + + if (TheReg == SP && Code == InlineAsm::Kind_Clobber) { + // If we clobbered the stack pointer, MFI should know about it. + assert(DAG.getMachineFunction().getFrameInfo()-> + hasInlineAsmWithSPAdjust()); + } } } } @@ -3370,9 +3378,7 @@ void SelectionDAGBuilder::visitAlloca(co setValue(&I, DSA); DAG.setRoot(DSA.getValue(1)); - // Inform the Frame Information that we have just allocated a variable-sized - // object. - FuncInfo.MF->getFrameInfo()->CreateVariableSizedObject(Align ? Align : 1); + assert(FuncInfo.MF->getFrameInfo()->hasVarSizedObjects()); } void SelectionDAGBuilder::visitLoad(const LoadInst &I) { Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Mar 18 18:10:35 2014 (r263311) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Mar 18 19:23:41 2014 (r263312) @@ -419,7 +419,7 @@ bool SelectionDAGISel::runOnMachineFunct SplitCriticalSideEffectEdges(const_cast(Fn), this); CurDAG->init(*MF, TTI, TLI); - FuncInfo->set(Fn, *MF); + FuncInfo->set(Fn, *MF, CurDAG); if (UseMBPI && OptLevel != CodeGenOpt::None) FuncInfo->BPI = &getAnalysis(); @@ -428,7 +428,8 @@ bool SelectionDAGISel::runOnMachineFunct SDB->init(GFI, *AA, LibInfo); - MF->setHasMSInlineAsm(false); + MF->setHasInlineAsm(false); + SelectAllBasicBlocks(Fn); // If the first basic block in the function has live ins that need to be @@ -511,7 +512,7 @@ bool SelectionDAGISel::runOnMachineFunct for (MachineFunction::const_iterator I = MF->begin(), E = MF->end(); I != E; ++I) { - if (MFI->hasCalls() && MF->hasMSInlineAsm()) + if (MFI->hasCalls() && MF->hasInlineAsm()) break; const MachineBasicBlock *MBB = I; @@ -522,8 +523,8 @@ bool SelectionDAGISel::runOnMachineFunct II->isStackAligningInlineAsm()) { MFI->setHasCalls(true); } - if (II->isMSInlineAsm()) { - MF->setHasMSInlineAsm(true); + if (II->isInlineAsm()) { + MF->setHasInlineAsm(true); } } } Modified: head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Tue Mar 18 18:10:35 2014 (r263311) +++ head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Tue Mar 18 19:23:41 2014 (r263312) @@ -4192,6 +4192,11 @@ bool AsmParser::parseMSInlineAsm( AsmStrRewrites.push_back(AsmRewrite(AOK_Input, Start, SymName.size())); } } + + // Consider implicit defs to be clobbers. Think of cpuid and push. + const uint16_t *ImpDefs = Desc.getImplicitDefs(); + for (unsigned I = 0, E = Desc.getNumImplicitDefs(); I != E; ++I) + ClobberRegs.push_back(ImpDefs[I]); } // Set the number of Outputs and Inputs. Modified: head/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp Tue Mar 18 18:10:35 2014 (r263311) +++ head/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp Tue Mar 18 19:23:41 2014 (r263312) @@ -50,7 +50,7 @@ bool X86FrameLowering::hasFP(const Machi return (MF.getTarget().Options.DisableFramePointerElim(MF) || RegInfo->needsStackRealignment(MF) || MFI->hasVarSizedObjects() || - MFI->isFrameAddressTaken() || MF.hasMSInlineAsm() || + MFI->isFrameAddressTaken() || MFI->hasInlineAsmWithSPAdjust() || MF.getInfo()->getForceFramePointer() || MMI.callsUnwindInit() || MMI.callsEHReturn()); } Modified: head/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp Tue Mar 18 18:10:35 2014 (r263311) +++ head/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp Tue Mar 18 19:23:41 2014 (r263312) @@ -403,18 +403,15 @@ bool X86RegisterInfo::hasBasePointer(con if (!EnableBasePointer) return false; - // When we need stack realignment and there are dynamic allocas, we can't - // reference off of the stack pointer, so we reserve a base pointer. - // - // This is also true if the function contain MS-style inline assembly. We - // do this because if any stack changes occur in the inline assembly, e.g., - // "pusha", then any C local variable or C argument references in the - // inline assembly will be wrong because the SP is not properly tracked. - if ((needsStackRealignment(MF) && MFI->hasVarSizedObjects()) || - MF.hasMSInlineAsm()) - return true; - - return false; + // When we need stack realignment, we can't address the stack from the frame + // pointer. When we have dynamic allocas or stack-adjusting inline asm, we + // can't address variables from the stack pointer. MS inline asm can + // reference locals while also adjusting the stack pointer. When we can't + // use both the SP and the FP, we need a separate base pointer register. + bool CantUseFP = needsStackRealignment(MF); + bool CantUseSP = + MFI->hasVarSizedObjects() || MFI->hasInlineAsmWithSPAdjust(); + return CantUseFP && CantUseSP; } bool X86RegisterInfo::canRealignStack(const MachineFunction &MF) const { From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 19:35:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE024C5F; Tue, 18 Mar 2014 19:35:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A068329E; Tue, 18 Mar 2014 19:35:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2IJZQUG011254; Tue, 18 Mar 2014 19:35:26 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2IJZQif011253; Tue, 18 Mar 2014 19:35:26 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403181935.s2IJZQif011253@svn.freebsd.org> From: Dimitry Andric Date: Tue, 18 Mar 2014 19:35:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263313 - head/contrib/llvm/lib/CodeGen/SelectionDAG X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 19:35:26 -0000 Author: dim Date: Tue Mar 18 19:35:26 2014 New Revision: 263313 URL: http://svnweb.freebsd.org/changeset/base/263313 Log: Pull in r203311 from upstream llvm trunk (by Arnold Schwaighofer): ISel: Make VSELECT selection terminate in cases where the condition type has to be split and the result type widened. When the condition of a vselect has to be split it makes no sense widening the vselect and thereby widening the condition. We end up in an endless loop of widening (vselect result type) and splitting (condition mask type) doing this. Instead, split both the condition and the vselect and widen the result. I ran this over the test suite with i686 and mattr=+sse and saw no regressions. Fixes PR18036. With this fix the original problem case from the graphics/rawtherapee port (posted in http://llvm.org/PR18036 ) now compiles within ~97MB RSS. Reported by: mandree MFC after: 1 week Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Tue Mar 18 19:23:41 2014 (r263312) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Tue Mar 18 19:35:26 2014 (r263313) @@ -2180,6 +2180,17 @@ SDValue DAGTypeLegalizer::WidenVecRes_SE if (getTypeAction(CondVT) == TargetLowering::TypeWidenVector) Cond1 = GetWidenedVector(Cond1); + // If we have to split the condition there is no point in widening the + // select. This would result in an cycle of widening the select -> + // widening the condition operand -> splitting the condition operand -> + // splitting the select -> widening the select. Instead split this select + // further and widen the resulting type. + if (getTypeAction(CondVT) == TargetLowering::TypeSplitVector) { + SDValue SplitSelect = SplitVecOp_VSELECT(N, 0); + SDValue Res = ModifyToType(SplitSelect, WidenVT); + return Res; + } + if (Cond1.getValueType() != CondWidenVT) Cond1 = ModifyToType(Cond1, CondWidenVT); } From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 20:14:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39A5E406; Tue, 18 Mar 2014 20:14:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 25A0F939; Tue, 18 Mar 2014 20:14:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2IKEEpr027877; Tue, 18 Mar 2014 20:14:14 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2IKEDMX027873; Tue, 18 Mar 2014 20:14:13 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201403182014.s2IKEDMX027873@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 18 Mar 2014 20:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263317 - in head/sys/dev/cxgbe: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 20:14:14 -0000 Author: np Date: Tue Mar 18 20:14:13 2014 New Revision: 263317 URL: http://svnweb.freebsd.org/changeset/base/263317 Log: cxgbe(4): significant rx rework. - More flexible cluster size selection, including the ability to fall back to a safe cluster size (PAGE_SIZE from zone_jumbop by default) in case an allocation of a larger size fails. - A single get_fl_payload() function that assembles the payload into an mbuf chain for any kind of freelist. This replaces two variants: one for freelists with buffer packing enabled and another for those without. - Buffer packing with any sized cluster. It was limited to 4K clusters only before this change. - Enable buffer packing for TOE rx queues as well. - Statistics and tunables to go with all these changes. The driver's man page will be updated separately. MFC after: 5 weeks Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/t4_hw.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Mar 18 20:05:55 2014 (r263316) +++ head/sys/dev/cxgbe/adapter.h Tue Mar 18 20:14:13 2014 (r263317) @@ -134,10 +134,11 @@ enum { RX_FL_ESIZE = EQ_ESIZE, /* 8 64bit addresses */ #if MJUMPAGESIZE != MCLBYTES - FL_BUF_SIZES_MAX = 5, /* cluster, jumbop, jumbo9k, jumbo16k, extra */ + SW_ZONE_SIZES = 4, /* cluster, jumbop, jumbo9k, jumbo16k */ #else - FL_BUF_SIZES_MAX = 4, /* cluster, jumbo9k, jumbo16k, extra */ + SW_ZONE_SIZES = 3, /* cluster, jumbo9k, jumbo16k */ #endif + CL_METADATA_SIZE = CACHE_LINE_SIZE, CTRL_EQ_QSIZE = 128, @@ -241,15 +242,28 @@ struct port_info { uint8_t hw_addr[ETHER_ADDR_LEN]; /* factory MAC address, won't change */ }; -struct fl_sdesc { - bus_dmamap_t map; - caddr_t cl; - uint8_t tag_idx; /* the fl->tag entry this map comes from */ +/* Where the cluster came from, how it has been carved up. */ +struct cluster_layout { + int8_t zidx; + int8_t hwidx; + uint16_t region1; /* mbufs laid out within this region */ + /* region2 is the DMA region */ + uint16_t region3; /* cluster_metadata within this region */ +}; + +struct cluster_metadata { + u_int refcount; #ifdef INVARIANTS - __be64 ba_hwtag; + struct fl_sdesc *sd; /* For debug only. Could easily be stale */ #endif }; +struct fl_sdesc { + caddr_t cl; + uint8_t nmbuf; + struct cluster_layout cll; +}; + struct tx_desc { __be64 flit[8]; }; @@ -368,17 +382,19 @@ struct sge_eq { uint32_t unstalled; /* recovered from stall */ }; -struct fl_buf_info { - u_int size; - int type; - int hwtag:4; /* tag in low 4 bits of the pa. */ - uma_zone_t zone; -}; -#define FL_BUF_SIZES(sc) (sc->sge.fl_buf_sizes) -#define FL_BUF_SIZE(sc, x) (sc->sge.fl_buf_info[x].size) -#define FL_BUF_TYPE(sc, x) (sc->sge.fl_buf_info[x].type) -#define FL_BUF_HWTAG(sc, x) (sc->sge.fl_buf_info[x].hwtag) -#define FL_BUF_ZONE(sc, x) (sc->sge.fl_buf_info[x].zone) +struct sw_zone_info { + uma_zone_t zone; /* zone that this cluster comes from */ + int size; /* size of cluster: 2K, 4K, 9K, 16K, etc. */ + int type; /* EXT_xxx type of the cluster */ + int8_t head_hwidx; + int8_t tail_hwidx; +}; + +struct hw_buf_info { + int8_t zidx; /* backpointer to zone; -ve means unused */ + int8_t next; /* next hwidx for this zone; -1 means no more */ + int size; +}; enum { FL_STARVING = (1 << 0), /* on the adapter's list of starving fl's */ @@ -392,9 +408,8 @@ enum { struct sge_fl { bus_dma_tag_t desc_tag; bus_dmamap_t desc_map; - bus_dma_tag_t tag[FL_BUF_SIZES_MAX]; /* only first FL_BUF_SIZES(sc) are - valid */ - uint8_t tag_idx; + struct cluster_layout cll_def; /* default refill zone, layout */ + struct cluster_layout cll_alt; /* alternate refill zone, layout */ struct mtx fl_lock; char lockname[16]; int flags; @@ -411,9 +426,17 @@ struct sge_fl { uint32_t needed; /* # of buffers needed to fill up fl. */ uint32_t lowat; /* # of buffers <= this means fl needs help */ uint32_t pending; /* # of bufs allocated since last doorbell */ - u_int dmamap_failed; - struct mbuf *mstash[8]; TAILQ_ENTRY(sge_fl) link; /* All starving freelists */ + + struct mbuf *m0; + struct mbuf **pnext; + u_int remaining; + + uint64_t mbuf_allocated;/* # of mbuf allocated from zone_mbuf */ + uint64_t mbuf_inlined; /* # of mbuf created within clusters */ + uint64_t cl_allocated; /* # of clusters allocated */ + uint64_t cl_recycled; /* # of clusters recycled */ + uint64_t cl_fast_recycled; /* # of clusters recycled (fast) */ }; /* txq: SGE egress queue + what's needed for Ethernet NIC */ @@ -547,8 +570,11 @@ struct sge { struct sge_iq **iqmap; /* iq->cntxt_id to iq mapping */ struct sge_eq **eqmap; /* eq->cntxt_id to eq mapping */ - u_int fl_buf_sizes __aligned(CACHE_LINE_SIZE); - struct fl_buf_info fl_buf_info[FL_BUF_SIZES_MAX]; + int pack_boundary; + int8_t safe_hwidx1; /* may not have room for metadata */ + int8_t safe_hwidx2; /* with room for metadata and maybe more */ + struct sw_zone_info sw_zone_info[SW_ZONE_SIZES]; + struct hw_buf_info hw_buf_info[SGE_FLBUF_SIZES]; }; struct rss_header; Modified: head/sys/dev/cxgbe/common/t4_hw.h ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.h Tue Mar 18 20:05:55 2014 (r263316) +++ head/sys/dev/cxgbe/common/t4_hw.h Tue Mar 18 20:14:13 2014 (r263317) @@ -87,6 +87,7 @@ enum { SGE_NTIMERS = 6, /* # of interrupt holdoff timer values */ SGE_NCOUNTERS = 4, /* # of interrupt packet counter values */ SGE_MAX_IQ_SIZE = 65520, + SGE_FLBUF_SIZES = 16, }; struct sge_qstat { /* data written to SGE queue status entries */ Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Mar 18 20:05:55 2014 (r263316) +++ head/sys/dev/cxgbe/t4_main.c Tue Mar 18 20:14:13 2014 (r263317) @@ -494,6 +494,8 @@ CTASSERT(offsetof(struct sge_ofld_rxq, f CTASSERT(nitems(((struct adapter *)0)->cpl_handler) == NUM_CPL_CMDS); CTASSERT(nitems(((struct adapter *)0)->fw_msg_handler) == NUM_FW6_TYPES); +CTASSERT(sizeof(struct cluster_metadata) <= CL_METADATA_SIZE); + static int t4_probe(device_t dev) { Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Mar 18 20:05:55 2014 (r263316) +++ head/sys/dev/cxgbe/t4_sge.c Tue Mar 18 20:14:13 2014 (r263317) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -52,6 +53,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include "common/common.h" #include "common/t4_regs.h" @@ -124,6 +127,27 @@ static int t4_fl_pack; static int t5_fl_pack; TUNABLE_INT("hw.cxgbe.fl_pack", &fl_pack); +/* + * Allow the driver to create mbuf(s) in a cluster allocated for rx. + * 0: never; always allocate mbufs from the zone_mbuf UMA zone. + * 1: ok to create mbuf(s) within a cluster if there is room. + */ +static int allow_mbufs_in_cluster = 1; +TUNABLE_INT("hw.cxgbe.allow_mbufs_in_cluster", &allow_mbufs_in_cluster); + +/* + * Largest rx cluster size that the driver is allowed to allocate. + */ +static int largest_rx_cluster = MJUM16BYTES; +TUNABLE_INT("hw.cxgbe.largest_rx_cluster", &largest_rx_cluster); + +/* + * Size of cluster allocation that's most likely to succeed. The driver will + * fall back to this size if it fails to allocate clusters larger than this. + */ +static int safest_rx_cluster = PAGE_SIZE; +TUNABLE_INT("hw.cxgbe.safest_rx_cluster", &safest_rx_cluster); + /* Used to track coalesced tx work request */ struct txpkts { uint64_t *flitp; /* ptr to flit where next pkt should start */ @@ -140,9 +164,7 @@ struct sgl { }; static int service_iq(struct sge_iq *, int); -static struct mbuf *get_fl_payload1(struct adapter *, struct sge_fl *, uint32_t, - int *); -static struct mbuf *get_fl_payload2(struct adapter *, struct sge_fl *, uint32_t, +static struct mbuf *get_fl_payload(struct adapter *, struct sge_fl *, uint32_t, int *); static int t4_eth_rx(struct sge_iq *, const struct rss_header *, struct mbuf *); static inline void init_iq(struct sge_iq *, struct adapter *, int, int, int, @@ -158,6 +180,8 @@ static int free_ring(struct adapter *, b static int alloc_iq_fl(struct port_info *, struct sge_iq *, struct sge_fl *, int, int); static int free_iq_fl(struct port_info *, struct sge_iq *, struct sge_fl *); +static void add_fl_sysctls(struct sysctl_ctx_list *, struct sysctl_oid *, + struct sge_fl *); static int alloc_fwq(struct adapter *); static int free_fwq(struct adapter *); static int alloc_mgmtq(struct adapter *); @@ -191,7 +215,8 @@ static int refill_fl(struct adapter *, s static void refill_sfl(void *); static int alloc_fl_sdesc(struct sge_fl *); static void free_fl_sdesc(struct adapter *, struct sge_fl *); -static void set_fl_tag_idx(struct adapter *, struct sge_fl *, int); +static void find_best_refill_source(struct adapter *, struct sge_fl *, int); +static void find_safe_refill_source(struct adapter *, struct sge_fl *); static void add_fl_to_sfl(struct adapter *, struct sge_fl *); static int get_pkt_sgl(struct sge_txq *, struct mbuf **, struct sgl *, int); @@ -216,6 +241,7 @@ static int handle_fw_msg(struct sge_iq * struct mbuf *); static int sysctl_uint16(SYSCTL_HANDLER_ARGS); +static int sysctl_bufsizes(SYSCTL_HANDLER_ARGS); /* * Called on MOD_LOAD. Validates and calculates the SGE tunables. @@ -264,7 +290,7 @@ t4_sge_modload(void) /* T5's pack boundary is independent of the pad boundary. */ if (fl_pack < 16 || fl_pack == 32 || fl_pack > 4096 || !powerof2(fl_pack)) - t5_fl_pack = max(pad, 64); + t5_fl_pack = max(pad, CACHE_LINE_SIZE); else t5_fl_pack = fl_pack; @@ -313,14 +339,18 @@ t4_tweak_chip_settings(struct adapter *s int timer_max = M_TIMERVALUE0 * 1000 / sc->params.vpd.cclk; int intr_pktcount[SGE_NCOUNTERS] = {1, 8, 16, 32}; /* 63 max */ uint16_t indsz = min(RX_COPY_THRESHOLD - 1, M_INDICATESIZE); - int sw_flbuf_sizes[] = { + static int sge_flbuf_sizes[] = { MCLBYTES, #if MJUMPAGESIZE != MCLBYTES MJUMPAGESIZE, + MJUMPAGESIZE - CL_METADATA_SIZE, + MJUMPAGESIZE - 2 * MSIZE - CL_METADATA_SIZE, #endif MJUM9BYTES, MJUM16BYTES, - MJUMPAGESIZE - MSIZE + MCLBYTES - MSIZE - CL_METADATA_SIZE, + MJUM9BYTES - CL_METADATA_SIZE, + MJUM16BYTES - CL_METADATA_SIZE, }; KASSERT(sc->flags & MASTER_PF, @@ -358,9 +388,11 @@ t4_tweak_chip_settings(struct adapter *s V_HOSTPAGESIZEPF7(PAGE_SHIFT - 10); t4_write_reg(sc, A_SGE_HOST_PAGE_SIZE, v); - for (i = 0; i < min(nitems(sw_flbuf_sizes), 16); i++) { + KASSERT(nitems(sge_flbuf_sizes) <= SGE_FLBUF_SIZES, + ("%s: hw buffer size table too big", __func__)); + for (i = 0; i < min(nitems(sge_flbuf_sizes), SGE_FLBUF_SIZES); i++) { t4_write_reg(sc, A_SGE_FL_BUFFER_SIZE0 + (4 * i), - sw_flbuf_sizes[i]); + sge_flbuf_sizes[i]); } v = V_THRESHOLD_0(intr_pktcount[0]) | V_THRESHOLD_1(intr_pktcount[1]) | @@ -415,6 +447,18 @@ t4_tweak_chip_settings(struct adapter *s } /* + * SGE wants the buffer to be at least 64B and then a multiple of the pad + * boundary or 16, whichever is greater. + */ +static inline int +hwsz_ok(int hwsz) +{ + int mask = max(fl_pad, 16) - 1; + + return (hwsz >= 64 && (hwsz & mask) == 0); +} + +/* * XXX: driver really should be able to deal with unexpected settings. */ int @@ -424,7 +468,7 @@ t4_read_chip_settings(struct adapter *sc int i, j, n, rc = 0; uint32_t m, v, r; uint16_t indsz = min(RX_COPY_THRESHOLD - 1, M_INDICATESIZE); - uint32_t sge_flbuf_sizes[16], sw_flbuf_sizes[] = { + static int sw_buf_sizes[] = { /* Sorted by size */ MCLBYTES, #if MJUMPAGESIZE != MCLBYTES MJUMPAGESIZE, @@ -432,6 +476,8 @@ t4_read_chip_settings(struct adapter *sc MJUM9BYTES, MJUM16BYTES }; + struct sw_zone_info *swz, *safe_swz; + struct hw_buf_info *hwb; m = V_PKTSHIFT(M_PKTSHIFT) | F_RXPKTCPLMODE | F_EGRSTATUSPAGESIZE; v = V_PKTSHIFT(fl_pktshift) | F_RXPKTCPLMODE | @@ -462,6 +508,7 @@ t4_read_chip_settings(struct adapter *sc rc = EINVAL; } } + s->pack_boundary = is_t4(sc) ? t4_fl_pack : t5_fl_pack; v = V_HOSTPAGESIZEPF0(PAGE_SHIFT - 10) | V_HOSTPAGESIZEPF1(PAGE_SHIFT - 10) | @@ -477,45 +524,93 @@ t4_read_chip_settings(struct adapter *sc rc = EINVAL; } - /* - * Make a list of SGE FL buffer sizes programmed in the chip and tally - * it with the FL buffer sizes that we'd like to use. - */ - n = 0; - for (i = 0; i < nitems(sge_flbuf_sizes); i++) { + /* Filter out unusable hw buffer sizes entirely (mark with -2). */ + hwb = &s->hw_buf_info[0]; + for (i = 0; i < nitems(s->hw_buf_info); i++, hwb++) { r = t4_read_reg(sc, A_SGE_FL_BUFFER_SIZE0 + (4 * i)); - sge_flbuf_sizes[i] = r; - if (r == MJUMPAGESIZE - MSIZE && - (sc->flags & BUF_PACKING_OK) == 0) { - sc->flags |= BUF_PACKING_OK; - FL_BUF_HWTAG(sc, n) = i; - FL_BUF_SIZE(sc, n) = MJUMPAGESIZE - MSIZE; - FL_BUF_TYPE(sc, n) = m_gettype(MJUMPAGESIZE); - FL_BUF_ZONE(sc, n) = m_getzone(MJUMPAGESIZE); - n++; - } + hwb->size = r; + hwb->zidx = hwsz_ok(r) ? -1 : -2; + hwb->next = -1; } - for (i = 0; i < nitems(sw_flbuf_sizes); i++) { - for (j = 0; j < nitems(sge_flbuf_sizes); j++) { - if (sw_flbuf_sizes[i] != sge_flbuf_sizes[j]) + + /* + * Create a sorted list in decreasing order of hw buffer sizes (and so + * increasing order of spare area) for each software zone. + */ + n = 0; /* no usable buffer size to begin with */ + swz = &s->sw_zone_info[0]; + safe_swz = NULL; + for (i = 0; i < SW_ZONE_SIZES; i++, swz++) { + int8_t head = -1, tail = -1; + + swz->size = sw_buf_sizes[i]; + swz->zone = m_getzone(swz->size); + swz->type = m_gettype(swz->size); + + if (swz->size == safest_rx_cluster) + safe_swz = swz; + + hwb = &s->hw_buf_info[0]; + for (j = 0; j < SGE_FLBUF_SIZES; j++, hwb++) { + if (hwb->zidx != -1 || hwb->size > swz->size) continue; - FL_BUF_HWTAG(sc, n) = j; - FL_BUF_SIZE(sc, n) = sw_flbuf_sizes[i]; - FL_BUF_TYPE(sc, n) = m_gettype(sw_flbuf_sizes[i]); - FL_BUF_ZONE(sc, n) = m_getzone(sw_flbuf_sizes[i]); + hwb->zidx = i; + if (head == -1) + head = tail = j; + else if (hwb->size < s->hw_buf_info[tail].size) { + s->hw_buf_info[tail].next = j; + tail = j; + } else { + int8_t *cur; + struct hw_buf_info *t; + + for (cur = &head; *cur != -1; cur = &t->next) { + t = &s->hw_buf_info[*cur]; + if (hwb->size == t->size) { + hwb->zidx = -2; + break; + } + if (hwb->size > t->size) { + hwb->next = *cur; + *cur = j; + break; + } + } + } + } + swz->head_hwidx = head; + swz->tail_hwidx = tail; + + if (tail != -1) { n++; - break; + if (swz->size - s->hw_buf_info[tail].size >= + CL_METADATA_SIZE) + sc->flags |= BUF_PACKING_OK; } } if (n == 0) { device_printf(sc->dev, "no usable SGE FL buffer size.\n"); rc = EINVAL; - } else if (n == 1 && (sc->flags & BUF_PACKING_OK)) { - device_printf(sc->dev, - "no usable SGE FL buffer size when not packing buffers.\n"); - rc = EINVAL; } - FL_BUF_SIZES(sc) = n; + + s->safe_hwidx1 = -1; + s->safe_hwidx2 = -1; + if (safe_swz != NULL) { + s->safe_hwidx1 = safe_swz->head_hwidx; + for (i = safe_swz->head_hwidx; i != -1; i = hwb->next) { + int spare; + + hwb = &s->hw_buf_info[i]; + spare = safe_swz->size - hwb->size; + if (spare < CL_METADATA_SIZE) + continue; + if (s->safe_hwidx2 == -1 || + spare == CL_METADATA_SIZE + MSIZE) + s->safe_hwidx2 = i; + if (spare >= CL_METADATA_SIZE + MSIZE) + break; + } + } r = t4_read_reg(sc, A_SGE_INGRESS_RX_THRESHOLD); s->counter_val[0] = G_THRESHOLD_0(r); @@ -627,6 +722,10 @@ t4_sge_sysctls(struct adapter *sc, struc struct sysctl_oid_list *children) { + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "buffer_sizes", + CTLTYPE_STRING | CTLFLAG_RD, &sc->sge, 0, sysctl_bufsizes, "A", + "freelist buffer sizes"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "fl_pktshift", CTLFLAG_RD, NULL, fl_pktshift, "payload DMA offset in rx buffer (bytes)"); @@ -644,8 +743,7 @@ t4_sge_sysctls(struct adapter *sc, struc "pack multiple frames in one fl buffer"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "fl_pack", CTLFLAG_RD, - NULL, is_t5(sc) ? t5_fl_pack : t4_fl_pack, - "payload pack boundary (bytes)"); + NULL, sc->sge.pack_boundary, "payload pack boundary (bytes)"); } int @@ -765,7 +863,7 @@ port_intr_iq(struct port_info *pi, int i #ifdef TCP_OFFLOAD if (sc->flags & INTR_DIRECT) { idx %= pi->nrxq + pi->nofldrxq; - + if (idx >= pi->nrxq) { idx -= pi->nrxq; iq = &s->ofld_rxq[pi->first_ofld_rxq + idx].iq; @@ -796,29 +894,28 @@ port_intr_iq(struct port_info *pi, int i return (iq); } +/* Maximum payload that can be delivered with a single iq descriptor */ static inline int -mtu_to_bufsize(int mtu) +mtu_to_max_payload(struct adapter *sc, int mtu, const int toe) { - int bufsize; - - /* large enough for a frame even when VLAN extraction is disabled */ - bufsize = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + mtu; - bufsize = roundup2(bufsize + fl_pktshift, fl_pad); - - return (bufsize); -} + int payload; #ifdef TCP_OFFLOAD -static inline int -mtu_to_bufsize_toe(struct adapter *sc, int mtu) -{ - - if (sc->tt.rx_coalesce) - return (G_RXCOALESCESIZE(t4_read_reg(sc, A_TP_PARA_REG2))); + if (toe) { + payload = sc->tt.rx_coalesce ? + G_RXCOALESCESIZE(t4_read_reg(sc, A_TP_PARA_REG2)) : mtu; + } else { +#endif + /* large enough even when hw VLAN extraction is disabled */ + payload = fl_pktshift + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + + mtu; +#ifdef TCP_OFFLOAD + } +#endif + payload = roundup2(payload, fl_pad); - return (mtu); + return (payload); } -#endif int t4_setup_port_queues(struct port_info *pi) @@ -837,7 +934,7 @@ t4_setup_port_queues(struct port_info *p struct ifnet *ifp = pi->ifp; struct sysctl_oid *oid = device_get_sysctl_tree(pi->dev); struct sysctl_oid_list *children = SYSCTL_CHILDREN(oid); - int bufsize, pack; + int maxp, pack, mtu = ifp->if_mtu; oid = SYSCTL_ADD_NODE(&pi->ctx, children, OID_AUTO, "rxq", CTLFLAG_RD, NULL, "rx queues"); @@ -858,7 +955,7 @@ t4_setup_port_queues(struct port_info *p * a) initialize iq and fl * b) allocate queue iff it will take direct interrupts. */ - bufsize = mtu_to_bufsize(ifp->if_mtu); + maxp = mtu_to_max_payload(sc, mtu, 0); pack = enable_buffer_packing(sc); for_each_rxq(pi, i, rxq) { @@ -867,7 +964,7 @@ t4_setup_port_queues(struct port_info *p snprintf(name, sizeof(name), "%s rxq%d-fl", device_get_nameunit(pi->dev), i); - init_fl(sc, &rxq->fl, pi->qsize_rxq / 8, bufsize, pack, name); + init_fl(sc, &rxq->fl, pi->qsize_rxq / 8, maxp, pack, name); if (sc->flags & INTR_DIRECT #ifdef TCP_OFFLOAD @@ -883,8 +980,7 @@ t4_setup_port_queues(struct port_info *p } #ifdef TCP_OFFLOAD - bufsize = mtu_to_bufsize_toe(sc, ifp->if_mtu); - pack = 0; /* XXX: think about this some more */ + maxp = mtu_to_max_payload(sc, mtu, 1); for_each_ofld_rxq(pi, i, ofld_rxq) { init_iq(&ofld_rxq->iq, sc, pi->tmr_idx, pi->pktc_idx, @@ -892,8 +988,7 @@ t4_setup_port_queues(struct port_info *p snprintf(name, sizeof(name), "%s ofld_rxq%d-fl", device_get_nameunit(pi->dev), i); - init_fl(sc, &ofld_rxq->fl, pi->qsize_rxq / 8, bufsize, pack, - name); + init_fl(sc, &ofld_rxq->fl, pi->qsize_rxq / 8, maxp, pack, name); if (sc->flags & INTR_DIRECT || (sc->intr_count > 1 && pi->nofldrxq > pi->nrxq)) { @@ -1170,10 +1265,7 @@ service_iq(struct sge_iq *iq, int budget ("%s: data for an iq (%p) with no freelist", __func__, iq)); - m0 = fl->flags & FL_BUF_PACKING ? - get_fl_payload1(sc, fl, lq, &fl_bufs_used) : - get_fl_payload2(sc, fl, lq, &fl_bufs_used); - + m0 = get_fl_payload(sc, fl, lq, &fl_bufs_used); if (__predict_false(m0 == NULL)) goto process_iql; #ifdef T4_PKT_TIMESTAMP @@ -1246,6 +1338,14 @@ service_iq(struct sge_iq *iq, int budget break; } + if (fl_bufs_used >= 16) { + FL_LOCK(fl); + fl->needed += fl_bufs_used; + refill_fl(sc, fl, 32); + FL_UNLOCK(fl); + fl_bufs_used = 0; + } + iq_next(iq); if (++ndescs == limit) { t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS), @@ -1262,14 +1362,6 @@ service_iq(struct sge_iq *iq, int budget } #endif - if (fl_bufs_used > 0) { - FL_LOCK(fl); - fl->needed += fl_bufs_used; - refill_fl(sc, fl, fl->cap / 8); - FL_UNLOCK(fl); - fl_bufs_used = 0; - } - if (budget) return (EINPROGRESS); } @@ -1312,7 +1404,7 @@ process_iql: FL_LOCK(fl); fl->needed += fl_bufs_used; - starved = refill_fl(sc, fl, fl->cap / 4); + starved = refill_fl(sc, fl, 64); FL_UNLOCK(fl); if (__predict_false(starved != 0)) add_fl_to_sfl(sc, fl); @@ -1321,74 +1413,28 @@ process_iql: return (0); } -static int -fill_mbuf_stash(struct sge_fl *fl) -{ - int i; - - for (i = 0; i < nitems(fl->mstash); i++) { - if (fl->mstash[i] == NULL) { - struct mbuf *m; - if ((m = m_get(M_NOWAIT, MT_NOINIT)) == NULL) - return (ENOBUFS); - fl->mstash[i] = m; - } - } - return (0); -} - -static struct mbuf * -get_mbuf_from_stash(struct sge_fl *fl) +static inline int +cl_has_metadata(struct sge_fl *fl, struct cluster_layout *cll) { - int i; + int rc = fl->flags & FL_BUF_PACKING || cll->region1 > 0; - for (i = 0; i < nitems(fl->mstash); i++) { - if (fl->mstash[i] != NULL) { - struct mbuf *m; - - m = fl->mstash[i]; - fl->mstash[i] = NULL; - return (m); - } else - fl->mstash[i] = m_get(M_NOWAIT, MT_NOINIT); - } + if (rc) + MPASS(cll->region3 >= CL_METADATA_SIZE); - return (m_get(M_NOWAIT, MT_NOINIT)); + return (rc); } -static void -return_mbuf_to_stash(struct sge_fl *fl, struct mbuf *m) +static inline struct cluster_metadata * +cl_metadata(struct adapter *sc, struct sge_fl *fl, struct cluster_layout *cll, + caddr_t cl) { - int i; - if (m == NULL) - return; + if (cl_has_metadata(fl, cll)) { + struct sw_zone_info *swz = &sc->sge.sw_zone_info[cll->zidx]; - for (i = 0; i < nitems(fl->mstash); i++) { - if (fl->mstash[i] == NULL) { - fl->mstash[i] = m; - return; - } + return ((struct cluster_metadata *)(cl + swz->size) - 1); } - m_init(m, NULL, 0, M_NOWAIT, MT_DATA, 0); - m_free(m); -} - -/* buf can be any address within the buffer */ -static inline u_int * -find_buf_refcnt(caddr_t buf) -{ - uintptr_t ptr = (uintptr_t)buf; - - return ((u_int *)((ptr & ~(MJUMPAGESIZE - 1)) + MSIZE - sizeof(u_int))); -} - -static inline struct mbuf * -find_buf_mbuf(caddr_t buf) -{ - uintptr_t ptr = (uintptr_t)buf; - - return ((struct mbuf *)(ptr & ~(MJUMPAGESIZE - 1))); + return (NULL); } static int @@ -1396,179 +1442,117 @@ rxb_free(struct mbuf *m, void *arg1, voi { uma_zone_t zone = arg1; caddr_t cl = arg2; -#ifdef notyet - u_int refcount; - refcount = *find_buf_refcnt(cl); - KASSERT(refcount == 0, ("%s: cl %p refcount is %u", __func__, - cl - MSIZE, refcount)); -#endif - cl -= MSIZE; uma_zfree(zone, cl); return (EXT_FREE_OK); } +/* + * The mbuf returned by this function could be allocated from zone_mbuf or + * constructed in spare room in the cluster. + * + * The mbuf carries the payload in one of these ways + * a) frame inside the mbuf (mbuf from zone_mbuf) + * b) m_cljset (for clusters without metadata) zone_mbuf + * c) m_extaddref (cluster with metadata) inline mbuf + * d) m_extaddref (cluster with metadata) zone_mbuf + */ static struct mbuf * -get_fl_payload1(struct adapter *sc, struct sge_fl *fl, uint32_t len_newbuf, - int *fl_bufs_used) +get_scatter_segment(struct adapter *sc, struct sge_fl *fl, int total, int flags) { - struct mbuf *m0, *m; + struct mbuf *m; struct fl_sdesc *sd = &fl->sdesc[fl->cidx]; - unsigned int nbuf, len; - int pack_boundary = is_t4(sc) ? t4_fl_pack : t5_fl_pack; + struct cluster_layout *cll = &sd->cll; + struct sw_zone_info *swz = &sc->sge.sw_zone_info[cll->zidx]; + struct hw_buf_info *hwb = &sc->sge.hw_buf_info[cll->hwidx]; + struct cluster_metadata *clm = cl_metadata(sc, fl, cll, sd->cl); + int len, padded_len; + caddr_t payload; + + len = min(total, hwb->size - fl->rx_offset); + padded_len = roundup2(len, fl_pad); + payload = sd->cl + cll->region1 + fl->rx_offset; - /* - * No assertion for the fl lock because we don't need it. This routine - * is called only from the rx interrupt handler and it only updates - * fl->cidx. (Contrast that with fl->pidx/fl->needed which could be - * updated in the rx interrupt handler or the starvation helper routine. - * That's why code that manipulates fl->pidx/fl->needed needs the fl - * lock but this routine does not). - */ + if (sc->sc_do_rxcopy && len < RX_COPY_THRESHOLD) { - KASSERT(fl->flags & FL_BUF_PACKING, - ("%s: buffer packing disabled for fl %p", __func__, fl)); - - len = G_RSPD_LEN(len_newbuf); + /* + * Copy payload into a freshly allocated mbuf. + */ - if ((len_newbuf & F_RSPD_NEWBUF) == 0) { - KASSERT(fl->rx_offset > 0, - ("%s: packed frame but driver at offset=0", __func__)); - - /* A packed frame is guaranteed to fit entirely in this buf. */ - KASSERT(FL_BUF_SIZE(sc, sd->tag_idx) - fl->rx_offset >= len, - ("%s: packing error. bufsz=%u, offset=%u, len=%u", - __func__, FL_BUF_SIZE(sc, sd->tag_idx), fl->rx_offset, - len)); - - m0 = get_mbuf_from_stash(fl); - if (m0 == NULL || - m_init(m0, NULL, 0, M_NOWAIT, MT_DATA, M_PKTHDR) != 0) { - return_mbuf_to_stash(fl, m0); + m = flags & M_PKTHDR ? + m_gethdr(M_NOWAIT, MT_DATA) : m_get(M_NOWAIT, MT_DATA); + if (m == NULL) return (NULL); - } - - bus_dmamap_sync(fl->tag[sd->tag_idx], sd->map, - BUS_DMASYNC_POSTREAD); - if (sc->sc_do_rxcopy && (len < RX_COPY_THRESHOLD)) { + fl->mbuf_allocated++; #ifdef T4_PKT_TIMESTAMP - /* Leave room for a timestamp */ - m0->m_data += 8; + /* Leave room for a timestamp */ + m->m_data += 8; #endif - bcopy(sd->cl + fl->rx_offset, mtod(m0, caddr_t), len); - m0->m_pkthdr.len = len; - m0->m_len = len; - } else { - m0->m_pkthdr.len = len; - m0->m_len = len; - m_extaddref(m0, sd->cl + fl->rx_offset, - roundup2(m0->m_len, fl_pad), - find_buf_refcnt(sd->cl), rxb_free, - FL_BUF_ZONE(sc, sd->tag_idx), sd->cl); - } - fl->rx_offset += len; - fl->rx_offset = roundup2(fl->rx_offset, fl_pad); - fl->rx_offset = roundup2(fl->rx_offset, pack_boundary); - if (fl->rx_offset >= FL_BUF_SIZE(sc, sd->tag_idx)) { - fl->rx_offset = 0; - (*fl_bufs_used) += 1; - if (__predict_false(++fl->cidx == fl->cap)) - fl->cidx = 0; - } + /* copy data to mbuf */ + bcopy(payload, mtod(m, caddr_t), len); - return (m0); - } + } else if (sd->nmbuf * MSIZE < cll->region1) { - KASSERT(len_newbuf & F_RSPD_NEWBUF, - ("%s: only new buffer handled here", __func__)); + /* + * There's spare room in the cluster for an mbuf. Create one + * and associate it with the payload that's in the cluster too. + */ - nbuf = 0; + MPASS(clm != NULL); + m = (struct mbuf *)(sd->cl + sd->nmbuf * MSIZE); + /* No bzero required */ + if (m_init(m, NULL, 0, M_NOWAIT, MT_DATA, flags | M_NOFREE)) + return (NULL); + fl->mbuf_inlined++; + m_extaddref(m, payload, padded_len, &clm->refcount, rxb_free, + swz->zone, sd->cl); + sd->nmbuf++; - /* - * Move to the start of the next buffer if we are still in the middle of - * some buffer. This is the case where there was some room left in the - * previous buffer but not enough to fit this frame in its entirety. - */ - if (fl->rx_offset > 0) { - KASSERT(roundup2(len, fl_pad) > FL_BUF_SIZE(sc, sd->tag_idx) - - fl->rx_offset, ("%s: frame (%u bytes) should have fit at " - "cidx %u offset %u bufsize %u", __func__, len, fl->cidx, - fl->rx_offset, FL_BUF_SIZE(sc, sd->tag_idx))); - nbuf++; - fl->rx_offset = 0; - sd++; - if (__predict_false(++fl->cidx == fl->cap)) { - sd = fl->sdesc; - fl->cidx = 0; - } - } + } else { - m0 = find_buf_mbuf(sd->cl); - if (m_init(m0, NULL, 0, M_NOWAIT, MT_DATA, M_PKTHDR | M_NOFREE)) - goto done; - bus_dmamap_sync(fl->tag[sd->tag_idx], sd->map, BUS_DMASYNC_POSTREAD); - m0->m_len = min(len, FL_BUF_SIZE(sc, sd->tag_idx)); - m_extaddref(m0, sd->cl, roundup2(m0->m_len, fl_pad), - find_buf_refcnt(sd->cl), rxb_free, FL_BUF_ZONE(sc, sd->tag_idx), - sd->cl); - m0->m_pkthdr.len = len; - - fl->rx_offset = roundup2(m0->m_len, fl_pad); - fl->rx_offset = roundup2(fl->rx_offset, pack_boundary); - if (fl->rx_offset >= FL_BUF_SIZE(sc, sd->tag_idx)) { - fl->rx_offset = 0; - nbuf++; - sd++; - if (__predict_false(++fl->cidx == fl->cap)) { - sd = fl->sdesc; - fl->cidx = 0; + /* + * Grab an mbuf from zone_mbuf and associate it with the + * payload in the cluster. + */ + + m = flags & M_PKTHDR ? + m_gethdr(M_NOWAIT, MT_DATA) : m_get(M_NOWAIT, MT_DATA); + if (m == NULL) + return (NULL); + fl->mbuf_allocated++; + if (clm != NULL) + m_extaddref(m, payload, padded_len, &clm->refcount, + rxb_free, swz->zone, sd->cl); + else { + m_cljset(m, sd->cl, swz->type); + sd->cl = NULL; /* consumed, not a recycle candidate */ } } + if (flags & M_PKTHDR) + m->m_pkthdr.len = total; + m->m_len = len; - m = m0; - len -= m->m_len; - - while (len > 0) { - m->m_next = find_buf_mbuf(sd->cl); - m = m->m_next; - - bus_dmamap_sync(fl->tag[sd->tag_idx], sd->map, - BUS_DMASYNC_POSTREAD); + if (fl->flags & FL_BUF_PACKING) { + fl->rx_offset += roundup2(padded_len, sc->sge.pack_boundary); + MPASS(fl->rx_offset <= hwb->size); + if (fl->rx_offset < hwb->size) + return (m); /* without advancing the cidx */ + } - /* m_init for !M_PKTHDR can't fail so don't bother */ - m_init(m, NULL, 0, M_NOWAIT, MT_DATA, M_NOFREE); - m->m_len = min(len, FL_BUF_SIZE(sc, sd->tag_idx)); - m_extaddref(m, sd->cl, roundup2(m->m_len, fl_pad), - find_buf_refcnt(sd->cl), rxb_free, - FL_BUF_ZONE(sc, sd->tag_idx), sd->cl); - - fl->rx_offset = roundup2(m->m_len, fl_pad); - fl->rx_offset = roundup2(fl->rx_offset, pack_boundary); - if (fl->rx_offset >= FL_BUF_SIZE(sc, sd->tag_idx)) { - fl->rx_offset = 0; - nbuf++; - sd++; - if (__predict_false(++fl->cidx == fl->cap)) { - sd = fl->sdesc; - fl->cidx = 0; - } - } + if (__predict_false(++fl->cidx == fl->cap)) + fl->cidx = 0; + fl->rx_offset = 0; - len -= m->m_len; - } -done: - (*fl_bufs_used) += nbuf; - return (m0); + return (m); } static struct mbuf * -get_fl_payload2(struct adapter *sc, struct sge_fl *fl, uint32_t len_newbuf, +get_fl_payload(struct adapter *sc, struct sge_fl *fl, uint32_t len_newbuf, int *fl_bufs_used) { - struct mbuf *m0, *m; - struct fl_sdesc *sd = &fl->sdesc[fl->cidx]; - unsigned int nbuf, len; + struct mbuf *m0, *m, **pnext; + u_int nbuf, len; /* * No assertion for the fl lock because we don't need it. This routine @@ -1579,87 +1563,54 @@ get_fl_payload2(struct adapter *sc, stru * lock but this routine does not). */ - KASSERT((fl->flags & FL_BUF_PACKING) == 0, - ("%s: buffer packing enabled for fl %p", __func__, fl)); - if (__predict_false((len_newbuf & F_RSPD_NEWBUF) == 0)) - panic("%s: cannot handle packed frames", __func__); + nbuf = 0; len = G_RSPD_LEN(len_newbuf); - - /* - * We never want to run out of mbufs in between a frame when a frame - * spans multiple fl buffers. If the fl's mbuf stash isn't full and - * can't be filled up to the brim then fail early. - */ - if (len > FL_BUF_SIZE(sc, sd->tag_idx) && fill_mbuf_stash(fl) != 0) - return (NULL); - - m0 = get_mbuf_from_stash(fl); - if (m0 == NULL || - m_init(m0, NULL, 0, M_NOWAIT, MT_DATA, M_PKTHDR) != 0) { - return_mbuf_to_stash(fl, m0); - return (NULL); + if (__predict_false(fl->m0 != NULL)) { + MPASS(len == fl->m0->m_pkthdr.len); + MPASS(fl->remaining < len); + + m0 = fl->m0; + pnext = fl->pnext; + len = fl->remaining; + fl->m0 = NULL; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 21:32:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45E078D4; Tue, 18 Mar 2014 21:32:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 310CC138; Tue, 18 Mar 2014 21:32:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2ILW5G4060907; Tue, 18 Mar 2014 21:32:05 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2ILW33e060898; Tue, 18 Mar 2014 21:32:03 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201403182132.s2ILW33e060898@svn.freebsd.org> From: Attilio Rao Date: Tue, 18 Mar 2014 21:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263318 - in head: sys/compat/freebsd32 sys/kern sys/sys usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 21:32:05 -0000 Author: attilio Date: Tue Mar 18 21:32:03 2014 New Revision: 263318 URL: http://svnweb.freebsd.org/changeset/base/263318 Log: Remove dead code from umtx support: - Retire long time unused (basically always unused) sys__umtx_lock() and sys__umtx_unlock() syscalls - struct umtx and their supporting definitions - UMUTEX_ERROR_CHECK flag - Retire UMTX_OP_LOCK/UMTX_OP_UNLOCK from _umtx_op() syscall __FreeBSD_version is not bumped yet because it is expected that further breakages to the umtx interface will follow up in the next days. However there will be a final bump when necessary. Sponsored by: EMC / Isilon storage division Reviewed by: jhb Modified: head/sys/compat/freebsd32/syscalls.master head/sys/kern/kern_umtx.c head/sys/kern/syscalls.master head/sys/sys/_umtx.h head/sys/sys/umtx.h head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Tue Mar 18 20:14:13 2014 (r263317) +++ head/sys/compat/freebsd32/syscalls.master Tue Mar 18 21:32:03 2014 (r263318) @@ -775,8 +775,8 @@ 431 AUE_NULL NOPROTO { void thr_exit(long *state); } 432 AUE_NULL NOPROTO { int thr_self(long *id); } 433 AUE_NULL NOPROTO { int thr_kill(long id, int sig); } -434 AUE_NULL STD { int freebsd32_umtx_lock(struct umtx *umtx); } -435 AUE_NULL STD { int freebsd32_umtx_unlock(struct umtx *umtx); } +434 AUE_NULL UNIMPL nosys +435 AUE_NULL UNIMPL nosys 436 AUE_NULL NOPROTO { int jail_attach(int jid); } 437 AUE_EXTATTR_LIST_FD NOPROTO { ssize_t extattr_list_fd(int fd, \ int attrnamespace, void *data, \ Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Tue Mar 18 20:14:13 2014 (r263317) +++ head/sys/kern/kern_umtx.c Tue Mar 18 21:32:03 2014 (r263318) @@ -838,367 +838,6 @@ umtx_key_release(struct umtx_key *key) } /* - * Lock a umtx object. - */ -static int -do_lock_umtx(struct thread *td, struct umtx *umtx, u_long id, - const struct timespec *timeout) -{ - struct abs_timeout timo; - struct umtx_q *uq; - u_long owner; - u_long old; - int error = 0; - - uq = td->td_umtxq; - if (timeout != NULL) - abs_timeout_init(&timo, CLOCK_REALTIME, 0, timeout); - - /* - * Care must be exercised when dealing with umtx structure. It - * can fault on any access. - */ - for (;;) { - /* - * Try the uncontested case. This should be done in userland. - */ - owner = casuword(&umtx->u_owner, UMTX_UNOWNED, id); - - /* The acquire succeeded. */ - if (owner == UMTX_UNOWNED) - return (0); - - /* The address was invalid. */ - if (owner == -1) - return (EFAULT); - - /* If no one owns it but it is contested try to acquire it. */ - if (owner == UMTX_CONTESTED) { - owner = casuword(&umtx->u_owner, - UMTX_CONTESTED, id | UMTX_CONTESTED); - - if (owner == UMTX_CONTESTED) - return (0); - - /* The address was invalid. */ - if (owner == -1) - return (EFAULT); - - error = umtxq_check_susp(td); - if (error != 0) - break; - - /* If this failed the lock has changed, restart. */ - continue; - } - - /* - * If we caught a signal, we have retried and now - * exit immediately. - */ - if (error != 0) - break; - - if ((error = umtx_key_get(umtx, TYPE_SIMPLE_LOCK, - AUTO_SHARE, &uq->uq_key)) != 0) - return (error); - - umtxq_lock(&uq->uq_key); - umtxq_busy(&uq->uq_key); - umtxq_insert(uq); - umtxq_unbusy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); - - /* - * Set the contested bit so that a release in user space - * knows to use the system call for unlock. If this fails - * either some one else has acquired the lock or it has been - * released. - */ - old = casuword(&umtx->u_owner, owner, owner | UMTX_CONTESTED); - - /* The address was invalid. */ - if (old == -1) { - umtxq_lock(&uq->uq_key); - umtxq_remove(uq); - umtxq_unlock(&uq->uq_key); - umtx_key_release(&uq->uq_key); - return (EFAULT); - } - - /* - * We set the contested bit, sleep. Otherwise the lock changed - * and we need to retry or we lost a race to the thread - * unlocking the umtx. - */ - umtxq_lock(&uq->uq_key); - if (old == owner) - error = umtxq_sleep(uq, "umtx", timeout == NULL ? NULL : - &timo); - umtxq_remove(uq); - umtxq_unlock(&uq->uq_key); - umtx_key_release(&uq->uq_key); - - if (error == 0) - error = umtxq_check_susp(td); - } - - if (timeout == NULL) { - /* Mutex locking is restarted if it is interrupted. */ - if (error == EINTR) - error = ERESTART; - } else { - /* Timed-locking is not restarted. */ - if (error == ERESTART) - error = EINTR; - } - return (error); -} - -/* - * Unlock a umtx object. - */ -static int -do_unlock_umtx(struct thread *td, struct umtx *umtx, u_long id) -{ - struct umtx_key key; - u_long owner; - u_long old; - int error; - int count; - - /* - * Make sure we own this mtx. - */ - owner = fuword(__DEVOLATILE(u_long *, &umtx->u_owner)); - if (owner == -1) - return (EFAULT); - - if ((owner & ~UMTX_CONTESTED) != id) - return (EPERM); - - /* This should be done in userland */ - if ((owner & UMTX_CONTESTED) == 0) { - old = casuword(&umtx->u_owner, owner, UMTX_UNOWNED); - if (old == -1) - return (EFAULT); - if (old == owner) - return (0); - owner = old; - } - - /* We should only ever be in here for contested locks */ - if ((error = umtx_key_get(umtx, TYPE_SIMPLE_LOCK, AUTO_SHARE, - &key)) != 0) - return (error); - - umtxq_lock(&key); - umtxq_busy(&key); - count = umtxq_count(&key); - umtxq_unlock(&key); - - /* - * When unlocking the umtx, it must be marked as unowned if - * there is zero or one thread only waiting for it. - * Otherwise, it must be marked as contested. - */ - old = casuword(&umtx->u_owner, owner, - count <= 1 ? UMTX_UNOWNED : UMTX_CONTESTED); - umtxq_lock(&key); - umtxq_signal(&key,1); - umtxq_unbusy(&key); - umtxq_unlock(&key); - umtx_key_release(&key); - if (old == -1) - return (EFAULT); - if (old != owner) - return (EINVAL); - return (0); -} - -#ifdef COMPAT_FREEBSD32 - -/* - * Lock a umtx object. - */ -static int -do_lock_umtx32(struct thread *td, uint32_t *m, uint32_t id, - const struct timespec *timeout) -{ - struct abs_timeout timo; - struct umtx_q *uq; - uint32_t owner; - uint32_t old; - int error = 0; - - uq = td->td_umtxq; - - if (timeout != NULL) - abs_timeout_init(&timo, CLOCK_REALTIME, 0, timeout); - - /* - * Care must be exercised when dealing with umtx structure. It - * can fault on any access. - */ - for (;;) { - /* - * Try the uncontested case. This should be done in userland. - */ - owner = casuword32(m, UMUTEX_UNOWNED, id); - - /* The acquire succeeded. */ - if (owner == UMUTEX_UNOWNED) - return (0); - - /* The address was invalid. */ - if (owner == -1) - return (EFAULT); - - /* If no one owns it but it is contested try to acquire it. */ - if (owner == UMUTEX_CONTESTED) { - owner = casuword32(m, - UMUTEX_CONTESTED, id | UMUTEX_CONTESTED); - if (owner == UMUTEX_CONTESTED) - return (0); - - /* The address was invalid. */ - if (owner == -1) - return (EFAULT); - - error = umtxq_check_susp(td); - if (error != 0) - break; - - /* If this failed the lock has changed, restart. */ - continue; - } - - /* - * If we caught a signal, we have retried and now - * exit immediately. - */ - if (error != 0) - return (error); - - if ((error = umtx_key_get(m, TYPE_SIMPLE_LOCK, - AUTO_SHARE, &uq->uq_key)) != 0) - return (error); - - umtxq_lock(&uq->uq_key); - umtxq_busy(&uq->uq_key); - umtxq_insert(uq); - umtxq_unbusy(&uq->uq_key); - umtxq_unlock(&uq->uq_key); - - /* - * Set the contested bit so that a release in user space - * knows to use the system call for unlock. If this fails - * either some one else has acquired the lock or it has been - * released. - */ - old = casuword32(m, owner, owner | UMUTEX_CONTESTED); - - /* The address was invalid. */ - if (old == -1) { - umtxq_lock(&uq->uq_key); - umtxq_remove(uq); - umtxq_unlock(&uq->uq_key); - umtx_key_release(&uq->uq_key); - return (EFAULT); - } - - /* - * We set the contested bit, sleep. Otherwise the lock changed - * and we need to retry or we lost a race to the thread - * unlocking the umtx. - */ - umtxq_lock(&uq->uq_key); - if (old == owner) - error = umtxq_sleep(uq, "umtx", timeout == NULL ? - NULL : &timo); - umtxq_remove(uq); - umtxq_unlock(&uq->uq_key); - umtx_key_release(&uq->uq_key); - - if (error == 0) - error = umtxq_check_susp(td); - } - - if (timeout == NULL) { - /* Mutex locking is restarted if it is interrupted. */ - if (error == EINTR) - error = ERESTART; - } else { - /* Timed-locking is not restarted. */ - if (error == ERESTART) - error = EINTR; - } - return (error); -} - -/* - * Unlock a umtx object. - */ -static int -do_unlock_umtx32(struct thread *td, uint32_t *m, uint32_t id) -{ - struct umtx_key key; - uint32_t owner; - uint32_t old; - int error; - int count; - - /* - * Make sure we own this mtx. - */ - owner = fuword32(m); - if (owner == -1) - return (EFAULT); - - if ((owner & ~UMUTEX_CONTESTED) != id) - return (EPERM); - - /* This should be done in userland */ - if ((owner & UMUTEX_CONTESTED) == 0) { - old = casuword32(m, owner, UMUTEX_UNOWNED); - if (old == -1) - return (EFAULT); - if (old == owner) - return (0); - owner = old; - } - - /* We should only ever be in here for contested locks */ - if ((error = umtx_key_get(m, TYPE_SIMPLE_LOCK, AUTO_SHARE, - &key)) != 0) - return (error); - - umtxq_lock(&key); - umtxq_busy(&key); - count = umtxq_count(&key); - umtxq_unlock(&key); - - /* - * When unlocking the umtx, it must be marked as unowned if - * there is zero or one thread only waiting for it. - * Otherwise, it must be marked as contested. - */ - old = casuword32(m, owner, - count <= 1 ? UMUTEX_UNOWNED : UMUTEX_CONTESTED); - umtxq_lock(&key); - umtxq_signal(&key,1); - umtxq_unbusy(&key); - umtxq_unlock(&key); - umtx_key_release(&key); - if (old == -1) - return (EFAULT); - if (old != owner) - return (EINVAL); - return (0); -} -#endif - -/* * Fetch and compare value, sleep on the address if value is not changed. */ static int @@ -1321,10 +960,6 @@ do_lock_normal(struct thread *td, struct } } - if ((flags & UMUTEX_ERROR_CHECK) != 0 && - (owner & ~UMUTEX_CONTESTED) == id) - return (EDEADLK); - if (mode == _UMUTEX_TRY) return (EBUSY); @@ -2026,12 +1661,6 @@ do_lock_pi(struct thread *td, struct umu continue; } - if ((flags & UMUTEX_ERROR_CHECK) != 0 && - (owner & ~UMUTEX_CONTESTED) == id) { - error = EDEADLK; - break; - } - if (try != 0) { error = EBUSY; break; @@ -2257,12 +1886,6 @@ do_lock_pp(struct thread *td, struct umu break; } - if ((flags & UMUTEX_ERROR_CHECK) != 0 && - (owner & ~UMUTEX_CONTESTED) == id) { - error = EDEADLK; - break; - } - if (try != 0) { error = EBUSY; break; @@ -3171,20 +2794,6 @@ do_sem_wake(struct thread *td, struct _u return (error); } -int -sys__umtx_lock(struct thread *td, struct _umtx_lock_args *uap) - /* struct umtx *umtx */ -{ - return do_lock_umtx(td, uap->umtx, td->td_tid, 0); -} - -int -sys__umtx_unlock(struct thread *td, struct _umtx_unlock_args *uap) - /* struct umtx *umtx */ -{ - return do_unlock_umtx(td, uap->umtx, td->td_tid); -} - inline int umtx_copyin_timeout(const void *addr, struct timespec *tsp) { @@ -3220,27 +2829,10 @@ umtx_copyin_umtx_time(const void *addr, } static int -__umtx_op_lock_umtx(struct thread *td, struct _umtx_op_args *uap) +__umtx_op_unimpl(struct thread *td, struct _umtx_op_args *uap) { - struct timespec *ts, timeout; - int error; - /* Allow a null timespec (wait forever). */ - if (uap->uaddr2 == NULL) - ts = NULL; - else { - error = umtx_copyin_timeout(uap->uaddr2, &timeout); - if (error != 0) - return (error); - ts = &timeout; - } - return (do_lock_umtx(td, uap->obj, uap->val, ts)); -} - -static int -__umtx_op_unlock_umtx(struct thread *td, struct _umtx_op_args *uap) -{ - return (do_unlock_umtx(td, uap->obj, uap->val)); + return (EOPNOTSUPP); } static int @@ -3506,8 +3098,8 @@ __umtx_op_wake2_umutex(struct thread *td typedef int (*_umtx_op_func)(struct thread *td, struct _umtx_op_args *uap); static _umtx_op_func op_table[] = { - __umtx_op_lock_umtx, /* UMTX_OP_LOCK */ - __umtx_op_unlock_umtx, /* UMTX_OP_UNLOCK */ + __umtx_op_unimpl, /* UMTX_OP_RESERVED0 */ + __umtx_op_unimpl, /* UMTX_OP_RESERVED1 */ __umtx_op_wait, /* UMTX_OP_WAIT */ __umtx_op_wake, /* UMTX_OP_WAKE */ __umtx_op_trylock_umutex, /* UMTX_OP_MUTEX_TRYLOCK */ @@ -3540,19 +3132,6 @@ sys__umtx_op(struct thread *td, struct _ } #ifdef COMPAT_FREEBSD32 -int -freebsd32_umtx_lock(struct thread *td, struct freebsd32_umtx_lock_args *uap) - /* struct umtx *umtx */ -{ - return (do_lock_umtx32(td, (uint32_t *)uap->umtx, td->td_tid, NULL)); -} - -int -freebsd32_umtx_unlock(struct thread *td, struct freebsd32_umtx_unlock_args *uap) - /* struct umtx *umtx */ -{ - return (do_unlock_umtx32(td, (uint32_t *)uap->umtx, td->td_tid)); -} struct timespec32 { int32_t tv_sec; @@ -3610,30 +3189,6 @@ umtx_copyin_umtx_time32(const void *addr } static int -__umtx_op_lock_umtx_compat32(struct thread *td, struct _umtx_op_args *uap) -{ - struct timespec *ts, timeout; - int error; - - /* Allow a null timespec (wait forever). */ - if (uap->uaddr2 == NULL) - ts = NULL; - else { - error = umtx_copyin_timeout32(uap->uaddr2, &timeout); - if (error != 0) - return (error); - ts = &timeout; - } - return (do_lock_umtx32(td, uap->obj, uap->val, ts)); -} - -static int -__umtx_op_unlock_umtx_compat32(struct thread *td, struct _umtx_op_args *uap) -{ - return (do_unlock_umtx32(td, uap->obj, (uint32_t)uap->val)); -} - -static int __umtx_op_wait_compat32(struct thread *td, struct _umtx_op_args *uap) { struct _umtx_time *tm_p, timeout; @@ -3809,8 +3364,8 @@ __umtx_op_nwake_private32(struct thread } static _umtx_op_func op_table_compat32[] = { - __umtx_op_lock_umtx_compat32, /* UMTX_OP_LOCK */ - __umtx_op_unlock_umtx_compat32, /* UMTX_OP_UNLOCK */ + __umtx_op_unimpl, /* UMTX_OP_RESERVED0 */ + __umtx_op_unimpl, /* UMTX_OP_RESERVED1 */ __umtx_op_wait_compat32, /* UMTX_OP_WAIT */ __umtx_op_wake, /* UMTX_OP_WAKE */ __umtx_op_trylock_umutex, /* UMTX_OP_MUTEX_LOCK */ Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Tue Mar 18 20:14:13 2014 (r263317) +++ head/sys/kern/syscalls.master Tue Mar 18 21:32:03 2014 (r263318) @@ -773,8 +773,8 @@ 431 AUE_NULL STD { void thr_exit(long *state); } 432 AUE_NULL STD { int thr_self(long *id); } 433 AUE_NULL STD { int thr_kill(long id, int sig); } -434 AUE_NULL STD { int _umtx_lock(struct umtx *umtx); } -435 AUE_NULL STD { int _umtx_unlock(struct umtx *umtx); } +434 AUE_NULL UNIMPL nosys +435 AUE_NULL UNIMPL nosys 436 AUE_NULL STD { int jail_attach(int jid); } 437 AUE_EXTATTR_LIST_FD STD { ssize_t extattr_list_fd(int fd, \ int attrnamespace, void *data, \ Modified: head/sys/sys/_umtx.h ============================================================================== --- head/sys/sys/_umtx.h Tue Mar 18 20:14:13 2014 (r263317) +++ head/sys/sys/_umtx.h Tue Mar 18 21:32:03 2014 (r263318) @@ -33,10 +33,6 @@ #include #include -struct umtx { - volatile unsigned long u_owner; /* Owner of the mutex. */ -}; - struct umutex { volatile __lwpid_t m_owner; /* Owner of the mutex */ __uint32_t m_flags; /* Flags of the mutex */ Modified: head/sys/sys/umtx.h ============================================================================== --- head/sys/sys/umtx.h Tue Mar 18 20:14:13 2014 (r263317) +++ head/sys/sys/umtx.h Tue Mar 18 21:32:03 2014 (r263318) @@ -31,17 +31,12 @@ #define _SYS_UMTX_H_ #include -#include - -#define UMTX_UNOWNED 0x0 -#define UMTX_CONTESTED LONG_MIN #define USYNC_PROCESS_SHARED 0x0001 /* Process shared sync objs */ #define UMUTEX_UNOWNED 0x0 #define UMUTEX_CONTESTED 0x80000000U -#define UMUTEX_ERROR_CHECK 0x0002 /* Error-checking mutex */ #define UMUTEX_PRIO_INHERIT 0x0004 /* Priority inherited mutex */ #define UMUTEX_PRIO_PROTECT 0x0008 /* Priority protect mutex */ @@ -58,8 +53,8 @@ #define SEM_NAMED 0x0002 /* op code for _umtx_op */ -#define UMTX_OP_LOCK 0 -#define UMTX_OP_UNLOCK 1 +#define UMTX_OP_RESERVED0 0 +#define UMTX_OP_RESERVED1 1 #define UMTX_OP_WAIT 2 #define UMTX_OP_WAKE 3 #define UMTX_OP_MUTEX_TRYLOCK 4 @@ -96,82 +91,6 @@ int _umtx_op(void *obj, int op, u_long val, void *uaddr, void *uaddr2); -/* - * Old (deprecated) userland mutex system calls. - */ -int _umtx_lock(struct umtx *mtx); -int _umtx_unlock(struct umtx *mtx); - -/* - * Standard api. Try uncontested acquire/release and asks the - * kernel to resolve failures. - */ -static __inline void -umtx_init(struct umtx *umtx) -{ - umtx->u_owner = UMTX_UNOWNED; -} - -static __inline u_long -umtx_owner(struct umtx *umtx) -{ - return (umtx->u_owner & ~LONG_MIN); -} - -static __inline int -umtx_lock(struct umtx *umtx, u_long id) -{ - if (atomic_cmpset_acq_long(&umtx->u_owner, UMTX_UNOWNED, id) == 0) - if (_umtx_lock(umtx) == -1) - return (errno); - return (0); -} - -static __inline int -umtx_trylock(struct umtx *umtx, u_long id) -{ - if (atomic_cmpset_acq_long(&umtx->u_owner, UMTX_UNOWNED, id) == 0) - return (EBUSY); - return (0); -} - -static __inline int -umtx_timedlock(struct umtx *umtx, u_long id, const struct timespec *timeout) -{ - if (atomic_cmpset_acq_long(&umtx->u_owner, UMTX_UNOWNED, id) == 0) - if (_umtx_op(umtx, UMTX_OP_LOCK, id, 0, - __DECONST(void *, timeout)) == -1) - return (errno); - return (0); -} - -static __inline int -umtx_unlock(struct umtx *umtx, u_long id) -{ - if (atomic_cmpset_rel_long(&umtx->u_owner, id, UMTX_UNOWNED) == 0) - if (_umtx_unlock(umtx) == -1) - return (errno); - return (0); -} - -static __inline int -umtx_wait(u_long *p, long val, const struct timespec *timeout) -{ - if (_umtx_op(p, UMTX_OP_WAIT, val, 0, - __DECONST(void *, timeout)) == -1) - return (errno); - return (0); -} - -/* Wake threads waiting on a user address. */ -static __inline int -umtx_wake(u_long *p, int nr_wakeup) -{ - if (_umtx_op(p, UMTX_OP_WAKE, nr_wakeup, 0, 0) == -1) - return (errno); - return (0); -} - #else /* Modified: head/usr.bin/truss/syscall.h ============================================================================== --- head/usr.bin/truss/syscall.h Tue Mar 18 20:14:13 2014 (r263317) +++ head/usr.bin/truss/syscall.h Tue Mar 18 21:32:03 2014 (r263318) @@ -21,7 +21,6 @@ * Pollfd -- a pointer to an array of struct pollfd. Prints .fd and .events. * Fd_set -- a pointer to an array of fd_set. Prints the fds that are set. * Sigaction -- a pointer to a struct sigaction. Prints all elements. - * Umtx -- a pointer to a struct umtx. Prints the value of owner. * Sigset -- a pointer to a sigset_t. Prints the signals that are set. * Sigprocmask -- the first argument to sigprocmask(). Prints the name. * Kevent -- a pointer to an array of struct kevents. Prints all elements. @@ -38,7 +37,7 @@ enum Argtype { None = 1, Hex, Octal, Int, Name, Ptr, Stat, Ioctl, Quad, Signal, Sockaddr, StringArray, Timespec, Timeval, Itimerval, Pollfd, Fd_set, Sigaction, Fcntl, Mprot, Mmapflags, Whence, Readlinkres, - Umtx, Sigset, Sigprocmask, Kevent, Sockdomain, Socktype, Open, + Sigset, Sigprocmask, Kevent, Sockdomain, Socktype, Open, Fcntlflag, Rusage, BinString, Shutdown, Resource, Rlimit, Timeval2, Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl }; Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Tue Mar 18 20:14:13 2014 (r263317) +++ head/usr.bin/truss/syscalls.c Tue Mar 18 21:32:03 2014 (r263318) @@ -215,10 +215,6 @@ static struct syscall syscalls[] = { .args = { { Timespec, 0 } } }, { .name = "kevent", .ret_type = 0, .nargs = 6, .args = { { Int, 0 }, { Kevent, 1 }, { Int, 2 }, { Kevent | OUT, 3 }, { Int, 4 }, { Timespec, 5 } } }, - { .name = "_umtx_lock", .ret_type = 0, .nargs = 1, - .args = { { Umtx, 0 } } }, - { .name = "_umtx_unlock", .ret_type = 0, .nargs = 1, - .args = { { Umtx, 0 } } }, { .name = "sigprocmask", .ret_type = 0, .nargs = 3, .args = { { Sigprocmask, 0 }, { Sigset, 1 }, { Sigset | OUT, 2 } } }, { .name = "unmount", .ret_type = 1, .nargs = 2, @@ -723,15 +719,6 @@ print_arg(struct syscall_args *sc, unsig } break; } - case Umtx: { - struct umtx umtx; - if (get_struct(pid, (void *)args[sc->offset], &umtx, - sizeof(umtx)) != -1) - asprintf(&tmp, "{ 0x%lx }", (long)umtx.u_owner); - else - asprintf(&tmp, "0x%lx", args[sc->offset]); - break; - } case Timespec: { struct timespec ts; if (get_struct(pid, (void *)args[sc->offset], &ts, From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 21:34:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0525DA54; Tue, 18 Mar 2014 21:34:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E464C155; Tue, 18 Mar 2014 21:34:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2ILYDlo061227; Tue, 18 Mar 2014 21:34:13 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2ILYBeS061215; Tue, 18 Mar 2014 21:34:11 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201403182134.s2ILYBeS061215@svn.freebsd.org> From: Attilio Rao Date: Tue, 18 Mar 2014 21:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263319 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 21:34:14 -0000 Author: attilio Date: Tue Mar 18 21:34:11 2014 New Revision: 263319 URL: http://svnweb.freebsd.org/changeset/base/263319 Log: Regen per r263318. Sponsored by: EMC / Isilon storage division Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Tue Mar 18 21:32:03 2014 (r263318) +++ head/sys/compat/freebsd32/freebsd32_proto.h Tue Mar 18 21:34:11 2014 (r263319) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 255708 2013-09-19 18:53:42Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 263318 2014-03-18 21:32:03Z attilio */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -367,12 +367,6 @@ struct freebsd32_swapcontext_args { char oucp_l_[PADL_(struct freebsd32_ucontext *)]; struct freebsd32_ucontext * oucp; char oucp_r_[PADR_(struct freebsd32_ucontext *)]; char ucp_l_[PADL_(const struct freebsd32_ucontext *)]; const struct freebsd32_ucontext * ucp; char ucp_r_[PADR_(const struct freebsd32_ucontext *)]; }; -struct freebsd32_umtx_lock_args { - char umtx_l_[PADL_(struct umtx *)]; struct umtx * umtx; char umtx_r_[PADR_(struct umtx *)]; -}; -struct freebsd32_umtx_unlock_args { - char umtx_l_[PADL_(struct umtx *)]; struct umtx * umtx; char umtx_r_[PADR_(struct umtx *)]; -}; struct freebsd32_ksem_timedwait_args { char id_l_[PADL_(semid_t)]; semid_t id; char id_r_[PADR_(semid_t)]; char abstime_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * abstime; char abstime_r_[PADR_(const struct timespec32 *)]; @@ -758,8 +752,6 @@ int freebsd32_sigreturn(struct thread *, int freebsd32_getcontext(struct thread *, struct freebsd32_getcontext_args *); int freebsd32_setcontext(struct thread *, struct freebsd32_setcontext_args *); int freebsd32_swapcontext(struct thread *, struct freebsd32_swapcontext_args *); -int freebsd32_umtx_lock(struct thread *, struct freebsd32_umtx_lock_args *); -int freebsd32_umtx_unlock(struct thread *, struct freebsd32_umtx_unlock_args *); int freebsd32_ksem_timedwait(struct thread *, struct freebsd32_ksem_timedwait_args *); int freebsd32_thr_suspend(struct thread *, struct freebsd32_thr_suspend_args *); int freebsd32_umtx_op(struct thread *, struct freebsd32_umtx_op_args *); @@ -1185,8 +1177,6 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_getcontext AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_setcontext AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_swapcontext AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_umtx_lock AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_umtx_unlock AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_ksem_timedwait AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_thr_suspend AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_umtx_op AUE_NULL Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Tue Mar 18 21:32:03 2014 (r263318) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Tue Mar 18 21:34:11 2014 (r263319) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 255708 2013-09-19 18:53:42Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 263318 2014-03-18 21:32:03Z attilio */ #define FREEBSD32_SYS_syscall 0 @@ -339,8 +339,6 @@ #define FREEBSD32_SYS_thr_exit 431 #define FREEBSD32_SYS_thr_self 432 #define FREEBSD32_SYS_thr_kill 433 -#define FREEBSD32_SYS_freebsd32_umtx_lock 434 -#define FREEBSD32_SYS_freebsd32_umtx_unlock 435 #define FREEBSD32_SYS_jail_attach 436 #define FREEBSD32_SYS_extattr_list_fd 437 #define FREEBSD32_SYS_extattr_list_file 438 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Tue Mar 18 21:32:03 2014 (r263318) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Tue Mar 18 21:34:11 2014 (r263319) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 255708 2013-09-19 18:53:42Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 263318 2014-03-18 21:32:03Z attilio */ const char *freebsd32_syscallnames[] = { @@ -444,8 +444,8 @@ const char *freebsd32_syscallnames[] = { "thr_exit", /* 431 = thr_exit */ "thr_self", /* 432 = thr_self */ "thr_kill", /* 433 = thr_kill */ - "freebsd32_umtx_lock", /* 434 = freebsd32_umtx_lock */ - "freebsd32_umtx_unlock", /* 435 = freebsd32_umtx_unlock */ + "#434", /* 434 = nosys */ + "#435", /* 435 = nosys */ "jail_attach", /* 436 = jail_attach */ "extattr_list_fd", /* 437 = extattr_list_fd */ "extattr_list_file", /* 438 = extattr_list_file */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Tue Mar 18 21:32:03 2014 (r263318) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Tue Mar 18 21:34:11 2014 (r263319) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 255708 2013-09-19 18:53:42Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 263318 2014-03-18 21:32:03Z attilio */ #include "opt_compat.h" @@ -481,8 +481,8 @@ struct sysent freebsd32_sysent[] = { { AS(thr_exit_args), (sy_call_t *)sys_thr_exit, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 431 = thr_exit */ { AS(thr_self_args), (sy_call_t *)sys_thr_self, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 432 = thr_self */ { AS(thr_kill_args), (sy_call_t *)sys_thr_kill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 433 = thr_kill */ - { AS(freebsd32_umtx_lock_args), (sy_call_t *)freebsd32_umtx_lock, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 434 = freebsd32_umtx_lock */ - { AS(freebsd32_umtx_unlock_args), (sy_call_t *)freebsd32_umtx_unlock, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 435 = freebsd32_umtx_unlock */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 434 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 435 = nosys */ { AS(jail_attach_args), (sy_call_t *)sys_jail_attach, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 436 = jail_attach */ { AS(extattr_list_fd_args), (sy_call_t *)sys_extattr_list_fd, AUE_EXTATTR_LIST_FD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 437 = extattr_list_fd */ { AS(extattr_list_file_args), (sy_call_t *)sys_extattr_list_file, AUE_EXTATTR_LIST_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 438 = extattr_list_file */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Tue Mar 18 21:32:03 2014 (r263318) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Tue Mar 18 21:34:11 2014 (r263319) @@ -2229,20 +2229,6 @@ systrace_args(int sysnum, void *params, *n_args = 2; break; } - /* freebsd32_umtx_lock */ - case 434: { - struct freebsd32_umtx_lock_args *p = params; - uarg[0] = (intptr_t) p->umtx; /* struct umtx * */ - *n_args = 1; - break; - } - /* freebsd32_umtx_unlock */ - case 435: { - struct freebsd32_umtx_unlock_args *p = params; - uarg[0] = (intptr_t) p->umtx; /* struct umtx * */ - *n_args = 1; - break; - } /* jail_attach */ case 436: { struct jail_attach_args *p = params; @@ -6905,26 +6891,6 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* freebsd32_umtx_lock */ - case 434: - switch(ndx) { - case 0: - p = "struct umtx *"; - break; - default: - break; - }; - break; - /* freebsd32_umtx_unlock */ - case 435: - switch(ndx) { - case 0: - p = "struct umtx *"; - break; - default: - break; - }; - break; /* jail_attach */ case 436: switch(ndx) { @@ -10182,16 +10148,6 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* freebsd32_umtx_lock */ - case 434: - if (ndx == 0 || ndx == 1) - p = "int"; - break; - /* freebsd32_umtx_unlock */ - case 435: - if (ndx == 0 || ndx == 1) - p = "int"; - break; /* jail_attach */ case 436: if (ndx == 0 || ndx == 1) Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Tue Mar 18 21:32:03 2014 (r263318) +++ head/sys/kern/init_sysent.c Tue Mar 18 21:34:11 2014 (r263319) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 255708 2013-09-19 18:53:42Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 263318 2014-03-18 21:32:03Z attilio */ #include "opt_compat.h" @@ -468,8 +468,8 @@ struct sysent sysent[] = { { AS(thr_exit_args), (sy_call_t *)sys_thr_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 431 = thr_exit */ { AS(thr_self_args), (sy_call_t *)sys_thr_self, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 432 = thr_self */ { AS(thr_kill_args), (sy_call_t *)sys_thr_kill, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 433 = thr_kill */ - { AS(_umtx_lock_args), (sy_call_t *)sys__umtx_lock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 434 = _umtx_lock */ - { AS(_umtx_unlock_args), (sy_call_t *)sys__umtx_unlock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 435 = _umtx_unlock */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 434 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 435 = nosys */ { AS(jail_attach_args), (sy_call_t *)sys_jail_attach, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 436 = jail_attach */ { AS(extattr_list_fd_args), (sy_call_t *)sys_extattr_list_fd, AUE_EXTATTR_LIST_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 437 = extattr_list_fd */ { AS(extattr_list_file_args), (sy_call_t *)sys_extattr_list_file, AUE_EXTATTR_LIST_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 438 = extattr_list_file */ Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Tue Mar 18 21:32:03 2014 (r263318) +++ head/sys/kern/syscalls.c Tue Mar 18 21:34:11 2014 (r263319) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 255708 2013-09-19 18:53:42Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 263318 2014-03-18 21:32:03Z attilio */ const char *syscallnames[] = { @@ -441,8 +441,8 @@ const char *syscallnames[] = { "thr_exit", /* 431 = thr_exit */ "thr_self", /* 432 = thr_self */ "thr_kill", /* 433 = thr_kill */ - "_umtx_lock", /* 434 = _umtx_lock */ - "_umtx_unlock", /* 435 = _umtx_unlock */ + "#434", /* 434 = nosys */ + "#435", /* 435 = nosys */ "jail_attach", /* 436 = jail_attach */ "extattr_list_fd", /* 437 = extattr_list_fd */ "extattr_list_file", /* 438 = extattr_list_file */ Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Tue Mar 18 21:32:03 2014 (r263318) +++ head/sys/kern/systrace_args.c Tue Mar 18 21:34:11 2014 (r263319) @@ -2454,20 +2454,6 @@ systrace_args(int sysnum, void *params, *n_args = 2; break; } - /* _umtx_lock */ - case 434: { - struct _umtx_lock_args *p = params; - uarg[0] = (intptr_t) p->umtx; /* struct umtx * */ - *n_args = 1; - break; - } - /* _umtx_unlock */ - case 435: { - struct _umtx_unlock_args *p = params; - uarg[0] = (intptr_t) p->umtx; /* struct umtx * */ - *n_args = 1; - break; - } /* jail_attach */ case 436: { struct jail_attach_args *p = params; @@ -7373,26 +7359,6 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* _umtx_lock */ - case 434: - switch(ndx) { - case 0: - p = "struct umtx *"; - break; - default: - break; - }; - break; - /* _umtx_unlock */ - case 435: - switch(ndx) { - case 0: - p = "struct umtx *"; - break; - default: - break; - }; - break; /* jail_attach */ case 436: switch(ndx) { @@ -10455,16 +10421,6 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* _umtx_lock */ - case 434: - if (ndx == 0 || ndx == 1) - p = "int"; - break; - /* _umtx_unlock */ - case 435: - if (ndx == 0 || ndx == 1) - p = "int"; - break; /* jail_attach */ case 436: if (ndx == 0 || ndx == 1) Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Tue Mar 18 21:32:03 2014 (r263318) +++ head/sys/sys/syscall.h Tue Mar 18 21:34:11 2014 (r263319) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 255708 2013-09-19 18:53:42Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 263318 2014-03-18 21:32:03Z attilio */ #define SYS_syscall 0 @@ -359,8 +359,6 @@ #define SYS_thr_exit 431 #define SYS_thr_self 432 #define SYS_thr_kill 433 -#define SYS__umtx_lock 434 -#define SYS__umtx_unlock 435 #define SYS_jail_attach 436 #define SYS_extattr_list_fd 437 #define SYS_extattr_list_file 438 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Tue Mar 18 21:32:03 2014 (r263318) +++ head/sys/sys/syscall.mk Tue Mar 18 21:34:11 2014 (r263319) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 255708 2013-09-19 18:53:42Z jhb +# created from FreeBSD: head/sys/kern/syscalls.master 263318 2014-03-18 21:32:03Z attilio MIASM = \ syscall.o \ exit.o \ @@ -308,8 +308,6 @@ MIASM = \ thr_exit.o \ thr_self.o \ thr_kill.o \ - _umtx_lock.o \ - _umtx_unlock.o \ jail_attach.o \ extattr_list_fd.o \ extattr_list_file.o \ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Tue Mar 18 21:32:03 2014 (r263318) +++ head/sys/sys/sysproto.h Tue Mar 18 21:34:11 2014 (r263319) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 255708 2013-09-19 18:53:42Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 263318 2014-03-18 21:32:03Z attilio */ #ifndef _SYS_SYSPROTO_H_ @@ -1301,12 +1301,6 @@ struct thr_kill_args { char id_l_[PADL_(long)]; long id; char id_r_[PADR_(long)]; char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; }; -struct _umtx_lock_args { - char umtx_l_[PADL_(struct umtx *)]; struct umtx * umtx; char umtx_r_[PADR_(struct umtx *)]; -}; -struct _umtx_unlock_args { - char umtx_l_[PADL_(struct umtx *)]; struct umtx * umtx; char umtx_r_[PADR_(struct umtx *)]; -}; struct jail_attach_args { char jid_l_[PADL_(int)]; int jid; char jid_r_[PADR_(int)]; }; @@ -2108,8 +2102,6 @@ int sys_thr_create(struct thread *, stru int sys_thr_exit(struct thread *, struct thr_exit_args *); int sys_thr_self(struct thread *, struct thr_self_args *); int sys_thr_kill(struct thread *, struct thr_kill_args *); -int sys__umtx_lock(struct thread *, struct _umtx_lock_args *); -int sys__umtx_unlock(struct thread *, struct _umtx_unlock_args *); int sys_jail_attach(struct thread *, struct jail_attach_args *); int sys_extattr_list_fd(struct thread *, struct extattr_list_fd_args *); int sys_extattr_list_file(struct thread *, struct extattr_list_file_args *); @@ -2815,8 +2807,6 @@ int freebsd7_shmctl(struct thread *, str #define SYS_AUE_thr_exit AUE_NULL #define SYS_AUE_thr_self AUE_NULL #define SYS_AUE_thr_kill AUE_NULL -#define SYS_AUE__umtx_lock AUE_NULL -#define SYS_AUE__umtx_unlock AUE_NULL #define SYS_AUE_jail_attach AUE_NULL #define SYS_AUE_extattr_list_fd AUE_EXTATTR_LIST_FD #define SYS_AUE_extattr_list_file AUE_EXTATTR_LIST_FILE From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 22:07:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 785D17BC; Tue, 18 Mar 2014 22:07:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 61741689; Tue, 18 Mar 2014 22:07:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2IM7mA0074405; Tue, 18 Mar 2014 22:07:48 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2IM7jWr074387; Tue, 18 Mar 2014 22:07:45 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403182207.s2IM7jWr074387@svn.freebsd.org> From: Dimitry Andric Date: Tue, 18 Mar 2014 22:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263320 - head/contrib/llvm/patches X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 22:07:48 -0000 Author: dim Date: Tue Mar 18 22:07:45 2014 New Revision: 263320 URL: http://svnweb.freebsd.org/changeset/base/263320 Log: Add separate patch files for all the customizations we have currently applied to our copy of llvm/clang. These can be applied in alphabetical order to a pristine llvm/clang 3.4 release source tree, to result in the same version used in FreeBSD. This is intended to clearly document all the changes until now, which mostly consist of cherry pickings from the respective upstream trunks, plus a number of hand-written FreeBSD-specific ones. Hopefully those can eventually be cleaned up and sent upstream too. MFC after: 1 week X-MFC-With: r263313 Added: head/contrib/llvm/patches/ head/contrib/llvm/patches/README.TXT (contents, props changed) head/contrib/llvm/patches/patch-r208961-clang-version-include.diff (contents, props changed) head/contrib/llvm/patches/patch-r208987-format-extensions.diff (contents, props changed) head/contrib/llvm/patches/patch-r209107-clang-vendor-suffix.diff (contents, props changed) head/contrib/llvm/patches/patch-r213492-amd64-multi-os-dot.diff (contents, props changed) head/contrib/llvm/patches/patch-r221503-default-target-triple.diff (contents, props changed) head/contrib/llvm/patches/patch-r243830-arm-disable-clear-cache.diff (contents, props changed) head/contrib/llvm/patches/patch-r252503-arm-transient-stack-alignment.diff (contents, props changed) head/contrib/llvm/patches/patch-r257109-add-CC-aliases.diff (contents, props changed) head/contrib/llvm/patches/patch-r259053-gcc-installation-detector.diff (contents, props changed) head/contrib/llvm/patches/patch-r259498-add-fxsave.diff (contents, props changed) head/contrib/llvm/patches/patch-r261680-clang-r200899-fix-security-quantis.diff (contents, props changed) head/contrib/llvm/patches/patch-r261991-llvm-r195391-fix-dwarf2.diff (contents, props changed) head/contrib/llvm/patches/patch-r261991-llvm-r198385-fix-dwarf2.diff (contents, props changed) head/contrib/llvm/patches/patch-r261991-llvm-r198389-fix-dwarf2.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198028-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198029-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198030-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198145-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198149-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198157-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198280-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198281-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198286-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198480-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198484-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198533-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198565-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198567-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198580-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198591-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198592-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198658-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198681-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198738-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198739-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198740-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198893-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198909-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r198910-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r199014-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r199024-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r199028-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r199031-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r199033-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r199061-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r199186-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r199187-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r199775-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r199781-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r199786-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r199940-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r199974-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r199975-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r199977-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r200103-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r200104-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r200112-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r200130-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r200131-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r200141-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r200282-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r200368-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r200373-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r200376-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r200509-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r200617-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r200960-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r200961-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r200962-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r200963-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262261-llvm-r200965-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262262-clang-r198311-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262262-clang-r198312-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262262-clang-r198911-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262262-clang-r198912-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262262-clang-r198918-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262262-clang-r198923-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262262-clang-r199012-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262262-clang-r199034-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262262-clang-r199037-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262262-clang-r199188-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262262-clang-r199399-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262262-clang-r200452-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262264-llvm-r200453-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262265-llvm-r201718-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262303-enable-ppc-integrated-as.diff (contents, props changed) head/contrib/llvm/patches/patch-r262415-llvm-r201994-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262460-llvm-r202059-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262535-clang-r202177-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262536-clang-r202179-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262582-llvm-r202422-sparc.diff (contents, props changed) head/contrib/llvm/patches/patch-r262611-llvm-r196874-fix-invalid-pwd-crash.diff (contents, props changed) head/contrib/llvm/patches/patch-r262809-clang-r203007-destructor-calling-conv.diff (contents, props changed) head/contrib/llvm/patches/patch-r263048-clang-r203624-fix-CC-aliases.diff (contents, props changed) head/contrib/llvm/patches/patch-r263312-llvm-r169939-inline-asm-with-realign.diff (contents, props changed) head/contrib/llvm/patches/patch-r263312-llvm-r196940-update-inline-asm-test.diff (contents, props changed) head/contrib/llvm/patches/patch-r263312-llvm-r196986-allow-realign-alloca.diff (contents, props changed) head/contrib/llvm/patches/patch-r263312-llvm-r202930-fix-alloca-esi-clobber.diff (contents, props changed) head/contrib/llvm/patches/patch-r263313-llvm-r203311-fix-sse1-oom.diff (contents, props changed) Added: head/contrib/llvm/patches/README.TXT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/README.TXT Tue Mar 18 22:07:45 2014 (r263320) @@ -0,0 +1,16 @@ +This is a set of individual patches, which contain all the customizations to +llvm/clang currently in the FreeBSD base system. These can be applied in +alphabetical order to a pristine llvm/clang 3.4 release source tree, for example +by doing: + +svn co https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_34/final llvm-3.4-final +svn co https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_34/final llvm-3.4-final/tools/clang +cd llvm-3.4-final +for p in /usr/src/contrib/llvm/patches/patch-*.diff; do + patch -p0 -f -F0 -E -i $p -s || break +done + +A number of these consist of hand-written modifications, specifically for +FreeBSD, while most others are cherry pickings off the llvm and clang trunks. +When a new version of llvm/clang is eventually imported, those latter ones will +largely disappear. Added: head/contrib/llvm/patches/patch-r208961-clang-version-include.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r208961-clang-version-include.diff Tue Mar 18 22:07:45 2014 (r263320) @@ -0,0 +1,39 @@ +This patch adjusts clang's default include paths to add FreeBSD-specific +directories. + +Introduced here: http://svn.freebsd.org/changeset/base/208961 + +Index: tools/clang/lib/Frontend/InitHeaderSearch.cpp +=================================================================== +--- tools/clang/lib/Frontend/InitHeaderSearch.cpp ++++ tools/clang/lib/Frontend/InitHeaderSearch.cpp +@@ -14,6 +14,7 @@ + #include "clang/Frontend/Utils.h" + #include "clang/Basic/FileManager.h" + #include "clang/Basic/LangOptions.h" ++#include "clang/Basic/Version.h" + #include "clang/Config/config.h" // C_INCLUDE_DIRS + #include "clang/Lex/HeaderSearch.h" + #include "clang/Lex/HeaderSearchOptions.h" +@@ -333,6 +334,9 @@ void InitHeaderSearch::AddDefaultCIncludePaths(con + #endif + } + break; ++ case llvm::Triple::FreeBSD: ++ AddPath("/usr/include/clang/" CLANG_VERSION_STRING, System, false); ++ break; + + default: + break; +@@ -423,11 +427,6 @@ AddDefaultCPlusPlusIncludePaths(const llvm::Triple + else + AddPath("/usr/include/c++/4.4", CXXSystem, false); + break; +- case llvm::Triple::FreeBSD: +- // FreeBSD 8.0 +- // FreeBSD 7.3 +- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2", "", "", "", triple); +- break; + case llvm::Triple::OpenBSD: { + std::string t = triple.getTriple(); + if (t.substr(0, 6) == "x86_64") Added: head/contrib/llvm/patches/patch-r208987-format-extensions.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r208987-format-extensions.diff Tue Mar 18 22:07:45 2014 (r263320) @@ -0,0 +1,214 @@ +This patch adds support for the FreeBSD-specific -fformat-extension option, +which enables additional printf modifiers for the kernel. + +Introduced here: http://svn.freebsd.org/changeset/base/208987 + +Index: tools/clang/lib/Frontend/CompilerInvocation.cpp +=================================================================== +--- tools/clang/lib/Frontend/CompilerInvocation.cpp ++++ tools/clang/lib/Frontend/CompilerInvocation.cpp +@@ -1319,6 +1319,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgLi + Opts.ShortWChar = Args.hasArg(OPT_fshort_wchar); + Opts.ShortEnums = Args.hasArg(OPT_fshort_enums); + Opts.Freestanding = Args.hasArg(OPT_ffreestanding); ++ Opts.FormatExtensions = Args.hasArg(OPT_fformat_extensions); + Opts.NoBuiltin = Args.hasArg(OPT_fno_builtin) || Opts.Freestanding; + Opts.NoMathBuiltin = Args.hasArg(OPT_fno_math_builtin); + Opts.AssumeSaneOperatorNew = !Args.hasArg(OPT_fno_assume_sane_operator_new); +Index: tools/clang/lib/Analysis/FormatString.cpp +=================================================================== +--- tools/clang/lib/Analysis/FormatString.cpp ++++ tools/clang/lib/Analysis/FormatString.cpp +@@ -548,6 +548,11 @@ const char *ConversionSpecifier::toString() const + // Objective-C specific specifiers. + case ObjCObjArg: return "@"; + ++ // FreeBSD specific specifiers. ++ case FreeBSDbArg: return "b"; ++ case FreeBSDDArg: return "D"; ++ case FreeBSDrArg: return "r"; ++ + // GlibC specific specifiers. + case PrintErrno: return "m"; + } +@@ -626,6 +631,7 @@ bool FormatSpecifier::hasValidLengthModifier(const + case ConversionSpecifier::xArg: + case ConversionSpecifier::XArg: + case ConversionSpecifier::nArg: ++ case ConversionSpecifier::FreeBSDrArg: + return true; + default: + return false; +@@ -654,6 +660,7 @@ bool FormatSpecifier::hasValidLengthModifier(const + case ConversionSpecifier::nArg: + case ConversionSpecifier::cArg: + case ConversionSpecifier::sArg: ++ case ConversionSpecifier::FreeBSDrArg: + case ConversionSpecifier::ScanListArg: + return true; + default: +@@ -774,6 +781,9 @@ bool FormatSpecifier::hasStandardConversionSpecifi + case ConversionSpecifier::SArg: + return LangOpt.ObjC1 || LangOpt.ObjC2; + case ConversionSpecifier::InvalidSpecifier: ++ case ConversionSpecifier::FreeBSDbArg: ++ case ConversionSpecifier::FreeBSDDArg: ++ case ConversionSpecifier::FreeBSDrArg: + case ConversionSpecifier::PrintErrno: + case ConversionSpecifier::DArg: + case ConversionSpecifier::OArg: +Index: tools/clang/lib/Analysis/PrintfFormatString.cpp +=================================================================== +--- tools/clang/lib/Analysis/PrintfFormatString.cpp ++++ tools/clang/lib/Analysis/PrintfFormatString.cpp +@@ -198,10 +198,25 @@ static PrintfSpecifierResult ParsePrintfSpecifier( + case '@': k = ConversionSpecifier::ObjCObjArg; break; + // Glibc specific. + case 'm': k = ConversionSpecifier::PrintErrno; break; ++ // FreeBSD format extensions ++ case 'b': ++ if (LO.FormatExtensions) ++ k = ConversionSpecifier::FreeBSDbArg; // int followed by char * ++ break; ++ case 'r': ++ if (LO.FormatExtensions) ++ k = ConversionSpecifier::FreeBSDrArg; ++ break; ++ case 'y': ++ if (LO.FormatExtensions) ++ k = ConversionSpecifier::iArg; ++ break; + // Apple-specific + case 'D': + if (Target.getTriple().isOSDarwin()) + k = ConversionSpecifier::DArg; ++ else if (LO.FormatExtensions) ++ k = ConversionSpecifier::FreeBSDDArg; // u_char * followed by char * + break; + case 'O': + if (Target.getTriple().isOSDarwin()) +@@ -216,6 +231,10 @@ static PrintfSpecifierResult ParsePrintfSpecifier( + FS.setConversionSpecifier(CS); + if (CS.consumesDataArgument() && !FS.usesPositionalArg()) + FS.setArgIndex(argIndex++); ++ // FreeBSD extension ++ if (k == ConversionSpecifier::FreeBSDbArg || ++ k == ConversionSpecifier::FreeBSDDArg) ++ argIndex++; + + if (k == ConversionSpecifier::InvalidSpecifier) { + // Assume the conversion takes one argument. +@@ -618,6 +637,7 @@ bool PrintfSpecifier::hasValidPlusPrefix() const { + case ConversionSpecifier::GArg: + case ConversionSpecifier::aArg: + case ConversionSpecifier::AArg: ++ case ConversionSpecifier::FreeBSDrArg: + return true; + + default: +@@ -643,6 +663,7 @@ bool PrintfSpecifier::hasValidAlternativeForm() co + case ConversionSpecifier::FArg: + case ConversionSpecifier::gArg: + case ConversionSpecifier::GArg: ++ case ConversionSpecifier::FreeBSDrArg: + return true; + + default: +Index: tools/clang/lib/Sema/SemaChecking.cpp +=================================================================== +--- tools/clang/lib/Sema/SemaChecking.cpp ++++ tools/clang/lib/Sema/SemaChecking.cpp +@@ -2980,6 +2980,40 @@ CheckPrintfHandler::HandlePrintfSpecifier(const an + CoveredArgs.set(argIndex); + } + ++ // FreeBSD extensions ++ if (CS.getKind() == ConversionSpecifier::FreeBSDbArg || ++ CS.getKind() == ConversionSpecifier::FreeBSDDArg) { ++ // claim the second argument ++ CoveredArgs.set(argIndex + 1); ++ ++ // Now type check the data expression that matches the ++ // format specifier. ++ const Expr *Ex = getDataArg(argIndex); ++ const analyze_printf::ArgType &AT = ++ (CS.getKind() == ConversionSpecifier::FreeBSDbArg) ? ++ ArgType(S.Context.IntTy) : ArgType::CStrTy; ++ if (AT.isValid() && !AT.matchesType(S.Context, Ex->getType())) ++ S.Diag(getLocationOfByte(CS.getStart()), ++ diag::warn_printf_conversion_argument_type_mismatch) ++ << AT.getRepresentativeType(S.Context) << Ex->getType() ++ << getSpecifierRange(startSpecifier, specifierLen) ++ << Ex->getSourceRange(); ++ ++ // Now type check the data expression that matches the ++ // format specifier. ++ Ex = getDataArg(argIndex + 1); ++ const analyze_printf::ArgType &AT2 = ArgType::CStrTy; ++ if (AT2.isValid() && !AT2.matchesType(S.Context, Ex->getType())) ++ S.Diag(getLocationOfByte(CS.getStart()), ++ diag::warn_printf_conversion_argument_type_mismatch) ++ << AT2.getRepresentativeType(S.Context) << Ex->getType() ++ << getSpecifierRange(startSpecifier, specifierLen) ++ << Ex->getSourceRange(); ++ ++ return true; ++ } ++ // END OF FREEBSD EXTENSIONS ++ + // Check for using an Objective-C specific conversion specifier + // in a non-ObjC literal. + if (!ObjCContext && CS.isObjCArg()) { +Index: tools/clang/lib/Driver/Tools.cpp +=================================================================== +--- tools/clang/lib/Driver/Tools.cpp ++++ tools/clang/lib/Driver/Tools.cpp +@@ -2991,6 +2991,7 @@ void Clang::ConstructJob(Compilation &C, const Job + + // Forward -f (flag) options which we can pass directly. + Args.AddLastArg(CmdArgs, options::OPT_femit_all_decls); ++ Args.AddLastArg(CmdArgs, options::OPT_fformat_extensions); + Args.AddLastArg(CmdArgs, options::OPT_fheinous_gnu_extensions); + Args.AddLastArg(CmdArgs, options::OPT_flimit_debug_info); + Args.AddLastArg(CmdArgs, options::OPT_fno_limit_debug_info); +Index: tools/clang/include/clang/Basic/LangOptions.def +=================================================================== +--- tools/clang/include/clang/Basic/LangOptions.def ++++ tools/clang/include/clang/Basic/LangOptions.def +@@ -84,6 +84,7 @@ LANGOPT(TraditionalCPP , 1, 0, "traditional CPP + LANGOPT(RTTI , 1, 1, "run-time type information") + LANGOPT(MSBitfields , 1, 0, "Microsoft-compatible structure layout") + LANGOPT(Freestanding, 1, 0, "freestanding implementation") ++LANGOPT(FormatExtensions , 1, 0, "FreeBSD format extensions") + LANGOPT(NoBuiltin , 1, 0, "disable builtin functions") + LANGOPT(NoMathBuiltin , 1, 0, "disable math builtin functions") + +Index: tools/clang/include/clang/Analysis/Analyses/FormatString.h +=================================================================== +--- tools/clang/include/clang/Analysis/Analyses/FormatString.h ++++ tools/clang/include/clang/Analysis/Analyses/FormatString.h +@@ -158,6 +158,11 @@ class ConversionSpecifier { + ObjCObjArg, // '@' + ObjCBeg = ObjCObjArg, ObjCEnd = ObjCObjArg, + ++ // FreeBSD specific specifiers ++ FreeBSDbArg, ++ FreeBSDDArg, ++ FreeBSDrArg, ++ + // GlibC specific specifiers. + PrintErrno, // 'm' + +Index: tools/clang/include/clang/Driver/Options.td +=================================================================== +--- tools/clang/include/clang/Driver/Options.td ++++ tools/clang/include/clang/Driver/Options.td +@@ -530,6 +530,8 @@ def fno_rewrite_includes : Flag<["-"], "fno-rewrit + + def ffreestanding : Flag<["-"], "ffreestanding">, Group, Flags<[CC1Option]>, + HelpText<"Assert that the compilation takes place in a freestanding environment">; ++def fformat_extensions: Flag<["-"], "fformat-extensions">, Group, Flags<[CC1Option]>, ++ HelpText<"Enable FreeBSD kernel specific format string extensions">; + def fgnu_keywords : Flag<["-"], "fgnu-keywords">, Group, Flags<[CC1Option]>, + HelpText<"Allow GNU-extension keywords regardless of language standard">; + def fgnu89_inline : Flag<["-"], "fgnu89-inline">, Group, Flags<[CC1Option]>, Added: head/contrib/llvm/patches/patch-r209107-clang-vendor-suffix.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r209107-clang-vendor-suffix.diff Tue Mar 18 22:07:45 2014 (r263320) @@ -0,0 +1,22 @@ +This patch adds a FreeBSD-specific suffix to clang's version string. This is +usually of the form "(yyyyddmm)", representing the date when the compiler was +last updated. + +Introduced here: http://svn.freebsd.org/changeset/base/209107 + +Index: tools/clang/lib/Basic/Version.cpp +=================================================================== +--- tools/clang/lib/Basic/Version.cpp ++++ tools/clang/lib/Basic/Version.cpp +@@ -124,8 +124,10 @@ std::string getClangFullVersion() { + OS << "clang version " CLANG_VERSION_STRING " " + << getClangFullRepositoryVersion(); + ++#ifdef CLANG_VENDOR_SUFFIX ++ OS << CLANG_VENDOR_SUFFIX; ++#elif defined(CLANG_VENDOR) + // If vendor supplied, include the base LLVM version as well. +-#ifdef CLANG_VENDOR + OS << " (based on LLVM " << PACKAGE_VERSION << ")"; + #endif + Added: head/contrib/llvm/patches/patch-r213492-amd64-multi-os-dot.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r213492-amd64-multi-os-dot.diff Tue Mar 18 22:07:45 2014 (r263320) @@ -0,0 +1,18 @@ +This patch makes "clang -print-multi-os-directory" print "." on amd64, which is +required by certain ports. + +Introduced here: http://svn.freebsd.org/changeset/base/213492 + +Index: tools/clang/lib/Driver/Driver.cpp +=================================================================== +--- tools/clang/lib/Driver/Driver.cpp ++++ tools/clang/lib/Driver/Driver.cpp +@@ -780,7 +780,7 @@ bool Driver::HandleImmediateArgs(const Compilation + break; + + case llvm::Triple::x86_64: +- llvm::outs() << "x86_64" << "\n"; ++ llvm::outs() << "." << "\n"; + break; + + case llvm::Triple::ppc64: Added: head/contrib/llvm/patches/patch-r221503-default-target-triple.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r221503-default-target-triple.diff Tue Mar 18 22:07:45 2014 (r263320) @@ -0,0 +1,26 @@ +This patch ensures the target triple that is passed during the compiler build is +respected, instead of mangling it. + +Introduced here: http://svn.freebsd.org/changeset/base/221503 + +Index: lib/Support/Unix/Host.inc +=================================================================== +--- lib/Support/Unix/Host.inc ++++ lib/Support/Unix/Host.inc +@@ -26,6 +26,11 @@ + + using namespace llvm; + ++#ifdef __FreeBSD__ ++std::string sys::getDefaultTargetTriple() { ++ return LLVM_DEFAULT_TARGET_TRIPLE; ++} ++#else // __FreeBSD__ + static std::string getOSVersion() { + struct utsname info; + +@@ -61,3 +66,4 @@ std::string sys::getDefaultTargetTriple() { + + return Triple; + } ++#endif // __FreeBSD__ Added: head/contrib/llvm/patches/patch-r243830-arm-disable-clear-cache.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r243830-arm-disable-clear-cache.diff Tue Mar 18 22:07:45 2014 (r263320) @@ -0,0 +1,19 @@ +This patch ensures __clear_cache is not called on arm. In earlier versions of +clang, this special builtin was emitted as a function call, leading to link +errors. + +Introduced here: http://svn.freebsd.org/changeset/base/243830 + +Index: lib/Support/Unix/Memory.inc +=================================================================== +--- lib/Support/Unix/Memory.inc ++++ lib/Support/Unix/Memory.inc +@@ -332,7 +332,7 @@ void Memory::InvalidateInstructionCache(const void + for (intptr_t Line = StartLine; Line < EndLine; Line += LineSize) + asm volatile("icbi 0, %0" : : "r"(Line)); + asm volatile("isync"); +-# elif (defined(__arm__) || defined(__aarch64__)) && defined(__GNUC__) ++# elif (defined(__arm__) || defined(__aarch64__)) && defined(__GNUC__) && !defined(__FreeBSD__) + // FIXME: Can we safely always call this for __GNUC__ everywhere? + const char *Start = static_cast(Addr); + const char *End = Start + Len; Added: head/contrib/llvm/patches/patch-r252503-arm-transient-stack-alignment.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r252503-arm-transient-stack-alignment.diff Tue Mar 18 22:07:45 2014 (r263320) @@ -0,0 +1,79 @@ +This patch applies a workaround for an ARM EABI issue, where clang would +sometimes incorrectly align the stack in a leaf function that uses TLS. + +Introduced here: http://svn.freebsd.org/changeset/base/252503 + +Index: test/CodeGen/Thumb2/large-stack.ll +=================================================================== +--- test/CodeGen/Thumb2/large-stack.ll ++++ test/CodeGen/Thumb2/large-stack.ll +@@ -13,7 +13,7 @@ define void @test1() { + define void @test2() { + ; DARWIN-LABEL: test2: + ; DARWIN: sub.w sp, sp, #4160 +-; DARWIN: sub sp, #8 ++; DARWIN: sub sp, #12 + ; LINUX-LABEL: test2: + ; LINUX: sub.w sp, sp, #4160 + ; LINUX: sub sp, #8 +Index: test/CodeGen/ARM/2009-10-30.ll +=================================================================== +--- test/CodeGen/ARM/2009-10-30.ll ++++ test/CodeGen/ARM/2009-10-30.ll +@@ -4,9 +4,10 @@ + + define void @f(i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, ...) { + entry: +-;CHECK: sub sp, sp, #4 +-;CHECK: add r{{[0-9]+}}, sp, #8 +-;CHECK: str r{{[0-9]+}}, [sp], #4 ++;CHECK: sub sp, sp, #8 ++;CHECK: add r{{[0-9]+}}, sp, #12 ++;CHECK: str r{{[0-9]+}}, [sp, #4] ++;CHECK: add sp, sp, #8 + ;CHECK: bx lr + %ap = alloca i8*, align 4 + %ap1 = bitcast i8** %ap to i8* +Index: test/CodeGen/ARM/vargs_align.ll +=================================================================== +--- test/CodeGen/ARM/vargs_align.ll ++++ test/CodeGen/ARM/vargs_align.ll +@@ -15,8 +15,8 @@ entry: + return: ; preds = %entry + %retval2 = load i32* %retval ; [#uses=1] + ret i32 %retval2 +-; EABI: add sp, sp, #12 + ; EABI: add sp, sp, #16 ++; EABI: add sp, sp, #16 ++; OABI: add sp, sp, #16 + ; OABI: add sp, sp, #12 +-; OABI: add sp, sp, #12 + } +Index: test/CodeGen/ARM/prefetch-thumb.ll +=================================================================== +--- test/CodeGen/ARM/prefetch-thumb.ll ++++ test/CodeGen/ARM/prefetch-thumb.ll +@@ -10,8 +10,8 @@ entry: + ;ARM: pld [sp, #50] + + ;THUMB2: t6: +-;THUMB2: pld [sp] +-;THUMB2: pld [sp, #50] ++;THUMB2: pld [sp, #4] ++;THUMB2: pld [sp, #54] + + %red = alloca [100 x i8], align 1 + %0 = getelementptr inbounds [100 x i8]* %red, i32 0, i32 0 +Index: lib/Target/ARM/ARMFrameLowering.h +=================================================================== +--- lib/Target/ARM/ARMFrameLowering.h ++++ lib/Target/ARM/ARMFrameLowering.h +@@ -27,7 +27,7 @@ class ARMFrameLowering : public TargetFrameLowerin + + public: + explicit ARMFrameLowering(const ARMSubtarget &sti) +- : TargetFrameLowering(StackGrowsDown, sti.getStackAlignment(), 0, 4), ++ : TargetFrameLowering(StackGrowsDown, sti.getStackAlignment(), 0, 8), + STI(sti) { + } + Added: head/contrib/llvm/patches/patch-r257109-add-CC-aliases.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r257109-add-CC-aliases.diff Tue Mar 18 22:07:45 2014 (r263320) @@ -0,0 +1,25 @@ +This patch adds "CC" and "clang-CC" to the list of program name aliases which +invoke the C++ compiler. + +Introduced here: http://svn.freebsd.org/changeset/base/257109 + +Index: tools/clang/tools/driver/driver.cpp +=================================================================== +--- tools/clang/tools/driver/driver.cpp ++++ tools/clang/tools/driver/driver.cpp +@@ -215,6 +215,7 @@ static void ParseProgName(SmallVectorImpl CandidateGCCInstallPaths; + + public: +- GCCInstallationDetector(const Driver &D, const llvm::Triple &TargetTriple, +- const llvm::opt::ArgList &Args); ++ GCCInstallationDetector(const Driver &D) : IsValid(false), D(D) {} ++ void init(const llvm::Triple &TargetTriple, const llvm::opt::ArgList &Args); + + /// \brief Check whether we detected a valid GCC install. + bool isValid() const { return IsValid; } Added: head/contrib/llvm/patches/patch-r259498-add-fxsave.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r259498-add-fxsave.diff Tue Mar 18 22:07:45 2014 (r263320) @@ -0,0 +1,16 @@ +This patch adds the alias bit_FXSAVE for bit_FXSR to cpuid.h. + +Introduced here: http://svn.freebsd.org/changeset/base/259498 + +Index: tools/clang/lib/Headers/cpuid.h +=================================================================== +--- tools/clang/lib/Headers/cpuid.h ++++ tools/clang/lib/Headers/cpuid.h +@@ -79,6 +79,7 @@ + #define bit_ACPI 0x00400000 + #define bit_MMX 0x00800000 + #define bit_FXSR 0x01000000 ++#define bit_FXSAVE bit_FXSR /* for gcc compat */ + #define bit_SSE 0x02000000 + #define bit_SSE2 0x04000000 + #define bit_SS 0x08000000 Added: head/contrib/llvm/patches/patch-r261680-clang-r200899-fix-security-quantis.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r261680-clang-r200899-fix-security-quantis.diff Tue Mar 18 22:07:45 2014 (r263320) @@ -0,0 +1,63 @@ +Pull in r200899 from upstream clang trunk (by Serge Pavlov): + + Allow transformation of VariableArray to ConstantArray. + + In the following code: + + struct A { static const int sz; }; + template void f() { T arr[A::sz]; } + + the array 'arr' is represented as a variable size array in the template. + If 'A::sz' gets value below in the translation unit, the array in + instantiation can turn into constant size array. + + This change fixes PR18633. + + Differential Revision: http://llvm-reviews.chandlerc.com/D2688 + +Introduced here: http://svn.freebsd.org/changeset/base/261680 + +Index: tools/clang/test/SemaCXX/c99-variable-length-array.cpp +=================================================================== +--- tools/clang/test/SemaCXX/c99-variable-length-array.cpp ++++ tools/clang/test/SemaCXX/c99-variable-length-array.cpp +@@ -140,3 +140,24 @@ namespace PR11744 { + } + int test = f(0); // expected-note {{instantiation of}} + } ++ ++namespace pr18633 { ++ struct A1 { ++ static const int sz; ++ static const int sz2; ++ }; ++ const int A1::sz2 = 11; ++ template ++ void func () { ++ int arr[A1::sz]; // expected-warning{{variable length arrays are a C99 feature}} ++ } ++ template ++ void func2 () { ++ int arr[A1::sz2]; ++ } ++ const int A1::sz = 12; ++ void func2() { ++ func(); ++ func2(); ++ } ++} +Index: tools/clang/lib/Sema/TreeTransform.h +=================================================================== +--- tools/clang/lib/Sema/TreeTransform.h ++++ tools/clang/lib/Sema/TreeTransform.h +@@ -3966,7 +3966,9 @@ TreeTransform::TransformVariableArrayType + return QualType(); + } + +- VariableArrayTypeLoc NewTL = TLB.push(Result); ++ // We might have constant size array now, but fortunately it has the same ++ // location layout. ++ ArrayTypeLoc NewTL = TLB.push(Result); + NewTL.setLBracketLoc(TL.getLBracketLoc()); + NewTL.setRBracketLoc(TL.getRBracketLoc()); + NewTL.setSizeExpr(Size); Added: head/contrib/llvm/patches/patch-r261991-llvm-r195391-fix-dwarf2.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r261991-llvm-r195391-fix-dwarf2.diff Tue Mar 18 22:07:45 2014 (r263320) @@ -0,0 +1,540 @@ +Pull in r195391 from upstream llvm trunk (by Eric Christopher): + + In Dwarf 3 (and Dwarf 2) attributes whose value are offsets into a + section use the form DW_FORM_data4 whilst in Dwarf 4 and later they + use the form DW_FORM_sec_offset. + + This patch updates the places where such attributes are generated to + use the appropriate form depending on the Dwarf version. The DIE entries + affected have the following tags: + DW_AT_stmt_list, DW_AT_ranges, DW_AT_location, DW_AT_GNU_pubnames, + DW_AT_GNU_pubtypes, DW_AT_GNU_addr_base, DW_AT_GNU_ranges_base + + It also adds a hidden command line option "--dwarf-version=" + to llc which allows the version of Dwarf to be generated to override + what is specified in the metadata; this makes it possible to update + existing tests to check the debugging information generated for both + Dwarf 4 (the default) and Dwarf 3 using the same metadata. + + Patch (slightly modified) by Keith Walker! + +Introduced here: http://svn.freebsd.org/changeset/base/261991 + +Index: lib/CodeGen/AsmPrinter/DIE.cpp +=================================================================== +--- lib/CodeGen/AsmPrinter/DIE.cpp ++++ lib/CodeGen/AsmPrinter/DIE.cpp +@@ -338,6 +338,7 @@ void DIEDelta::EmitValue(AsmPrinter *AP, dwarf::Fo + /// + unsigned DIEDelta::SizeOf(AsmPrinter *AP, dwarf::Form Form) const { + if (Form == dwarf::DW_FORM_data4) return 4; ++ if (Form == dwarf::DW_FORM_sec_offset) return 4; + if (Form == dwarf::DW_FORM_strp) return 4; + return AP->getDataLayout().getPointerSize(); + } +Index: lib/CodeGen/AsmPrinter/DwarfDebug.cpp +=================================================================== +--- lib/CodeGen/AsmPrinter/DwarfDebug.cpp ++++ lib/CodeGen/AsmPrinter/DwarfDebug.cpp +@@ -105,6 +105,11 @@ DwarfPubSections("generate-dwarf-pub-sections", cl + clEnumVal(Disable, "Disabled"), clEnumValEnd), + cl::init(Default)); + ++static cl::opt ++DwarfVersionNumber("dwarf-version", cl::Hidden, ++ cl::desc("Generate DWARF for dwarf version."), ++ cl::init(0)); ++ + static const char *const DWARFGroupName = "DWARF Emission"; + static const char *const DbgTimerName = "DWARF Debug Writer"; + +@@ -215,7 +220,9 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M) + else + HasDwarfPubSections = DwarfPubSections == Enable; + +- DwarfVersion = getDwarfVersionFromModule(MMI->getModule()); ++ DwarfVersion = DwarfVersionNumber ++ ? DwarfVersionNumber ++ : getDwarfVersionFromModule(MMI->getModule()); + + { + NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled); +@@ -470,9 +477,9 @@ DIE *DwarfDebug::constructLexicalScopeDIE(CompileU + // .debug_range section has not been laid out yet. Emit offset in + // .debug_range as a uint, size 4, for now. emitDIE will handle + // DW_AT_ranges appropriately. +- TheCU->addUInt(ScopeDIE, dwarf::DW_AT_ranges, dwarf::DW_FORM_data4, +- DebugRangeSymbols.size() +- * Asm->getDataLayout().getPointerSize()); ++ TheCU->addSectionOffset(ScopeDIE, dwarf::DW_AT_ranges, ++ DebugRangeSymbols.size() * ++ Asm->getDataLayout().getPointerSize()); + for (SmallVectorImpl::const_iterator RI = Ranges.begin(), + RE = Ranges.end(); RI != RE; ++RI) { + DebugRangeSymbols.push_back(getLabelBeforeInsn(RI->first)); +@@ -525,9 +532,9 @@ DIE *DwarfDebug::constructInlinedScopeDIE(CompileU + // .debug_range section has not been laid out yet. Emit offset in + // .debug_range as a uint, size 4, for now. emitDIE will handle + // DW_AT_ranges appropriately. +- TheCU->addUInt(ScopeDIE, dwarf::DW_AT_ranges, dwarf::DW_FORM_data4, +- DebugRangeSymbols.size() +- * Asm->getDataLayout().getPointerSize()); ++ TheCU->addSectionOffset(ScopeDIE, dwarf::DW_AT_ranges, ++ DebugRangeSymbols.size() * ++ Asm->getDataLayout().getPointerSize()); + for (SmallVectorImpl::const_iterator RI = Ranges.begin(), + RE = Ranges.end(); RI != RE; ++RI) { + DebugRangeSymbols.push_back(getLabelBeforeInsn(RI->first)); +@@ -758,14 +765,15 @@ CompileUnit *DwarfDebug::constructCompileUnit(DICo + // The line table entries are not always emitted in assembly, so it + // is not okay to use line_table_start here. + if (Asm->MAI->doesDwarfUseRelocationsAcrossSections()) +- NewCU->addLabel(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_sec_offset, +- UseTheFirstCU ? Asm->GetTempSymbol("section_line") +- : LineTableStartSym); ++ NewCU->addSectionLabel( ++ Die, dwarf::DW_AT_stmt_list, ++ UseTheFirstCU ? Asm->GetTempSymbol("section_line") ++ : LineTableStartSym); + else if (UseTheFirstCU) +- NewCU->addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0); ++ NewCU->addSectionOffset(Die, dwarf::DW_AT_stmt_list, 0); + else +- NewCU->addDelta(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, +- LineTableStartSym, DwarfLineSectionSym); ++ NewCU->addSectionDelta(Die, dwarf::DW_AT_stmt_list, ++ LineTableStartSym, DwarfLineSectionSym); + + // If we're using split dwarf the compilation dir is going to be in the + // skeleton CU and so we don't need to duplicate it here. +@@ -776,26 +784,24 @@ CompileUnit *DwarfDebug::constructCompileUnit(DICo + // emit it here if we don't have a skeleton CU for split dwarf. + if (GenerateGnuPubSections) { + if (Asm->MAI->doesDwarfUseRelocationsAcrossSections()) +- NewCU->addLabel(Die, dwarf::DW_AT_GNU_pubnames, +- dwarf::DW_FORM_sec_offset, +- Asm->GetTempSymbol("gnu_pubnames", +- NewCU->getUniqueID())); ++ NewCU->addSectionLabel( ++ Die, dwarf::DW_AT_GNU_pubnames, ++ Asm->GetTempSymbol("gnu_pubnames", NewCU->getUniqueID())); + else +- NewCU->addDelta(Die, dwarf::DW_AT_GNU_pubnames, dwarf::DW_FORM_data4, +- Asm->GetTempSymbol("gnu_pubnames", +- NewCU->getUniqueID()), +- DwarfGnuPubNamesSectionSym); ++ NewCU->addSectionDelta( ++ Die, dwarf::DW_AT_GNU_pubnames, ++ Asm->GetTempSymbol("gnu_pubnames", NewCU->getUniqueID()), ++ DwarfGnuPubNamesSectionSym); + + if (Asm->MAI->doesDwarfUseRelocationsAcrossSections()) +- NewCU->addLabel(Die, dwarf::DW_AT_GNU_pubtypes, +- dwarf::DW_FORM_sec_offset, +- Asm->GetTempSymbol("gnu_pubtypes", +- NewCU->getUniqueID())); ++ NewCU->addSectionLabel( ++ Die, dwarf::DW_AT_GNU_pubtypes, ++ Asm->GetTempSymbol("gnu_pubtypes", NewCU->getUniqueID())); + else +- NewCU->addDelta(Die, dwarf::DW_AT_GNU_pubtypes, dwarf::DW_FORM_data4, +- Asm->GetTempSymbol("gnu_pubtypes", +- NewCU->getUniqueID()), +- DwarfGnuPubTypesSectionSym); ++ NewCU->addSectionDelta( ++ Die, dwarf::DW_AT_GNU_pubtypes, ++ Asm->GetTempSymbol("gnu_pubtypes", NewCU->getUniqueID()), ++ DwarfGnuPubTypesSectionSym); + } + } + +@@ -2956,11 +2962,10 @@ CompileUnit *DwarfDebug::constructSkeletonCU(const + // Relocate to the beginning of the addr_base section, else 0 for the + // beginning of the one for this compile unit. + if (Asm->MAI->doesDwarfUseRelocationsAcrossSections()) +- NewCU->addLabel(Die, dwarf::DW_AT_GNU_addr_base, dwarf::DW_FORM_sec_offset, +- DwarfAddrSectionSym); ++ NewCU->addSectionLabel(Die, dwarf::DW_AT_GNU_addr_base, ++ DwarfAddrSectionSym); + else +- NewCU->addUInt(Die, dwarf::DW_AT_GNU_addr_base, +- dwarf::DW_FORM_sec_offset, 0); ++ NewCU->addSectionOffset(Die, dwarf::DW_AT_GNU_addr_base, 0); + + // 2.17.1 requires that we use DW_AT_low_pc for a single entry point + // into an entity. We're using 0, or a NULL label for this. +@@ -2970,10 +2975,10 @@ CompileUnit *DwarfDebug::constructSkeletonCU(const + // compile unit in debug_line section. + // FIXME: Should handle multiple compile units. + if (Asm->MAI->doesDwarfUseRelocationsAcrossSections()) +- NewCU->addLabel(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_sec_offset, +- DwarfLineSectionSym); ++ NewCU->addSectionLabel(Die, dwarf::DW_AT_stmt_list, ++ DwarfLineSectionSym); + else +- NewCU->addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_sec_offset, 0); ++ NewCU->addSectionOffset(Die, dwarf::DW_AT_stmt_list, 0); + + if (!CompilationDir.empty()) + NewCU->addLocalString(Die, dwarf::DW_AT_comp_dir, CompilationDir); +@@ -2981,27 +2986,31 @@ CompileUnit *DwarfDebug::constructSkeletonCU(const + // Flags to let the linker know we have emitted new style pubnames. + if (GenerateGnuPubSections) { + if (Asm->MAI->doesDwarfUseRelocationsAcrossSections()) +- NewCU->addLabel(Die, dwarf::DW_AT_GNU_pubnames, dwarf::DW_FORM_sec_offset, +- Asm->GetTempSymbol("gnu_pubnames", NewCU->getUniqueID())); ++ NewCU->addSectionLabel( ++ Die, dwarf::DW_AT_GNU_pubnames, ++ Asm->GetTempSymbol("gnu_pubnames", NewCU->getUniqueID())); + else +- NewCU->addDelta(Die, dwarf::DW_AT_GNU_pubnames, dwarf::DW_FORM_data4, +- Asm->GetTempSymbol("gnu_pubnames", NewCU->getUniqueID()), +- DwarfGnuPubNamesSectionSym); ++ NewCU->addSectionDelta( ++ Die, dwarf::DW_AT_GNU_pubnames, ++ Asm->GetTempSymbol("gnu_pubnames", NewCU->getUniqueID()), ++ DwarfGnuPubNamesSectionSym); + + if (Asm->MAI->doesDwarfUseRelocationsAcrossSections()) +- NewCU->addLabel(Die, dwarf::DW_AT_GNU_pubtypes, dwarf::DW_FORM_sec_offset, +- Asm->GetTempSymbol("gnu_pubtypes", NewCU->getUniqueID())); ++ NewCU->addSectionLabel( ++ Die, dwarf::DW_AT_GNU_pubtypes, ++ Asm->GetTempSymbol("gnu_pubtypes", NewCU->getUniqueID())); + else +- NewCU->addDelta(Die, dwarf::DW_AT_GNU_pubtypes, dwarf::DW_FORM_data4, +- Asm->GetTempSymbol("gnu_pubtypes", NewCU->getUniqueID()), +- DwarfGnuPubTypesSectionSym); ++ NewCU->addSectionDelta( ++ Die, dwarf::DW_AT_GNU_pubtypes, ++ Asm->GetTempSymbol("gnu_pubtypes", NewCU->getUniqueID()), ++ DwarfGnuPubTypesSectionSym); + } + + // Flag if we've emitted any ranges and their location for the compile unit. + if (DebugRangeSymbols.size()) { + if (Asm->MAI->doesDwarfUseRelocationsAcrossSections()) +- NewCU->addLabel(Die, dwarf::DW_AT_GNU_ranges_base, +- dwarf::DW_FORM_sec_offset, DwarfDebugRangeSectionSym); ++ NewCU->addSectionLabel(Die, dwarf::DW_AT_GNU_ranges_base, ++ DwarfDebugRangeSectionSym); + else + NewCU->addUInt(Die, dwarf::DW_AT_GNU_ranges_base, dwarf::DW_FORM_data4, + 0); +Index: lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +=================================================================== +--- lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp ++++ lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +@@ -227,6 +227,26 @@ void CompileUnit::addLabel(DIEBlock *Die, dwarf::F + addLabel(Die, (dwarf::Attribute)0, Form, Label); + } + ++/// addSectionLabel - Add a Dwarf section label attribute data and value. ++/// ++void CompileUnit::addSectionLabel(DIE *Die, dwarf::Attribute Attribute, ++ const MCSymbol *Label) { ++ if (DD->getDwarfVersion() >= 4) ++ addLabel(Die, Attribute, dwarf::DW_FORM_sec_offset, Label); ++ else ++ addLabel(Die, Attribute, dwarf::DW_FORM_data4, Label); ++} ++ ++/// addSectionOffset - Add an offset into a section attribute data and value. ++/// ++void CompileUnit::addSectionOffset(DIE *Die, dwarf::Attribute Attribute, ++ uint64_t Integer) { ++ if (DD->getDwarfVersion() >= 4) ++ addUInt(Die, Attribute, dwarf::DW_FORM_sec_offset, Integer); ++ else ++ addUInt(Die, Attribute, dwarf::DW_FORM_data4, Integer); ++} ++ + /// addLabelAddress - Add a dwarf label attribute data and value using + /// DW_FORM_addr or DW_FORM_GNU_addr_index. + /// +@@ -264,13 +284,15 @@ void CompileUnit::addOpAddress(DIEBlock *Die, cons + } + } + +-/// addDelta - Add a label delta attribute data and value. ++/// addSectionDelta - Add a section label delta attribute data and value. + /// +-void CompileUnit::addDelta(DIE *Die, dwarf::Attribute Attribute, +- dwarf::Form Form, const MCSymbol *Hi, +- const MCSymbol *Lo) { ++void CompileUnit::addSectionDelta(DIE *Die, dwarf::Attribute Attribute, ++ const MCSymbol *Hi, const MCSymbol *Lo) { + DIEValue *Value = new (DIEValueAllocator) DIEDelta(Hi, Lo); +- Die->addValue(Attribute, Form, Value); ++ if (DD->getDwarfVersion() >= 4) ++ Die->addValue(Attribute, dwarf::DW_FORM_sec_offset, Value); ++ else ++ Die->addValue(Attribute, dwarf::DW_FORM_data4, Value); + } + + /// addDIEEntry - Add a DIE attribute data and value. +@@ -1768,10 +1790,8 @@ DIE *CompileUnit::constructVariableDIE(DbgVariable + + unsigned Offset = DV.getDotDebugLocOffset(); + if (Offset != ~0U) { +- addLabel(VariableDie, dwarf::DW_AT_location, +- DD->getDwarfVersion() >= 4 ? dwarf::DW_FORM_sec_offset +- : dwarf::DW_FORM_data4, +- Asm->GetTempSymbol("debug_loc", Offset)); ++ addSectionLabel(VariableDie, dwarf::DW_AT_location, ++ Asm->GetTempSymbol("debug_loc", Offset)); + DV.setDIE(VariableDie); + return VariableDie; + } +Index: lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +=================================================================== +--- lib/CodeGen/AsmPrinter/DwarfCompileUnit.h ++++ lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +@@ -209,6 +209,14 @@ class CompileUnit { + + void addLabel(DIEBlock *Die, dwarf::Form Form, const MCSymbol *Label); + ++ /// addSectionLabel - Add a Dwarf section label attribute data and value. ++ /// ++ void addSectionLabel(DIE *Die, dwarf::Attribute Attribute, const MCSymbol *Label); ++ ++ /// addSectionOffset - Add an offset into a section attribute data and value. ++ /// ++ void addSectionOffset(DIE *Die, dwarf::Attribute Attribute, uint64_t Integer); ++ + /// addLabelAddress - Add a dwarf label attribute data and value using + /// either DW_FORM_addr or DW_FORM_GNU_addr_index. + /// +@@ -219,10 +227,9 @@ class CompileUnit { + /// + void addOpAddress(DIEBlock *Die, const MCSymbol *Label); + +- /// addDelta - Add a label delta attribute data and value. +- /// +- void addDelta(DIE *Die, dwarf::Attribute Attribute, dwarf::Form Form, const MCSymbol *Hi, +- const MCSymbol *Lo); ++ /// addSectionDelta - Add a label delta attribute data and value. ++ void addSectionDelta(DIE *Die, dwarf::Attribute Attribute, const MCSymbol *Hi, ++ const MCSymbol *Lo); + + /// addDIEEntry - Add a DIE attribute data and value. + /// +Index: test/DebugInfo/X86/gnu-public-names.ll +=================================================================== +--- test/DebugInfo/X86/gnu-public-names.ll ++++ test/DebugInfo/X86/gnu-public-names.ll +@@ -1,5 +1,6 @@ + ; RUN: llc -mtriple=x86_64-pc-linux-gnu -generate-gnu-dwarf-pub-sections < %s | FileCheck -check-prefix=ASM %s + ; RUN: llc -mtriple=x86_64-pc-linux-gnu -generate-gnu-dwarf-pub-sections -filetype=obj < %s | llvm-dwarfdump - | FileCheck %s ++; RUN: llc -mtriple=x86_64-pc-linux-gnu -generate-gnu-dwarf-pub-sections -filetype=obj -dwarf-version=3 < %s | llvm-dwarfdump - | FileCheck %s -check-prefix=DWARF3 + ; ModuleID = 'dwarf-public-names.cpp' + ; + ; Generated from: +@@ -123,6 +124,85 @@ + ; CHECK-DAG: [[D]] EXTERNAL TYPE "ns::D" + ; CHECK-DAG: [[INT]] STATIC TYPE "int" + ++; DWARF3: .debug_info contents: ++; DWARF3: DW_AT_GNU_pubnames [DW_FORM_data4] (0x00000000) ++; DWARF3: DW_AT_GNU_pubtypes [DW_FORM_data4] (0x00000000) ++ ++; DWARF3: [[C:[0-9a-f]+]]: DW_TAG_structure_type ++; DWARF3-NEXT: DW_AT_name {{.*}} "C" ++ ++; DWARF3: [[STATIC_MEM_DECL:[0-9a-f]+]]: DW_TAG_member ++; DWARF3-NEXT: DW_AT_name {{.*}} "static_member_variable" ++ ++; DWARF3: [[MEM_FUNC_DECL:[0-9a-f]+]]: DW_TAG_subprogram ++; DWARF3-NEXT: DW_AT_MIPS_linkage_name ++; DWARF3-NEXT: DW_AT_name {{.*}} "member_function" ++ ++; DWARF3: [[STATIC_MEM_FUNC_DECL:[0-9a-f]+]]: DW_TAG_subprogram ++; DWARF3-NEXT: DW_AT_MIPS_linkage_name ++; DWARF3-NEXT: DW_AT_name {{.*}} "static_member_function" ++ ++; DWARF3: [[INT:[0-9a-f]+]]: DW_TAG_base_type ++; DWARF3-NEXT: DW_AT_name {{.*}} "int" ++ ++; DWARF3: [[STATIC_MEM_VAR:[0-9a-f]+]]: DW_TAG_variable ++; DWARF3-NEXT: DW_AT_specification {{.*}}[[STATIC_MEM_DECL]] ++ ++; DWARF3: [[GLOB_VAR:[0-9a-f]+]]: DW_TAG_variable *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 22:22:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98D5FFF8; Tue, 18 Mar 2014 22:22:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 856668DB; Tue, 18 Mar 2014 22:22:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2IMMmR7081930; Tue, 18 Mar 2014 22:22:48 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2IMMmOM081929; Tue, 18 Mar 2014 22:22:48 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201403182222.s2IMMmOM081929@svn.freebsd.org> From: Aleksandr Rybalko Date: Tue, 18 Mar 2014 22:22:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263321 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 22:22:48 -0000 Author: ray Date: Tue Mar 18 22:22:47 2014 New Revision: 263321 URL: http://svnweb.freebsd.org/changeset/base/263321 Log: Switch kern.vt.suspendswitch to 0 by default (disabled). kern.vt.suspendswitch - sysctl/tunable which enable switch to VT0 before going to suspend and switch back after resume. MFC after: 7 days Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Tue Mar 18 22:07:45 2014 (r263320) +++ head/sys/dev/vt/vt_core.c Tue Mar 18 22:22:47 2014 (r263321) @@ -118,7 +118,7 @@ static SYSCTL_NODE(_kern, OID_AUTO, vt, VT_SYSCTL_INT(enable_altgr, 1, "Enable AltGr key (Do not assume R.Alt as Alt)"); VT_SYSCTL_INT(debug, 0, "vt(9) debug level"); VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode"); -VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend"); +VT_SYSCTL_INT(suspendswitch, 0, "Switch to VT0 before suspend"); static unsigned int vt_unit = 0; static MALLOC_DEFINE(M_VT, "vt", "vt device"); From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 23:25:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42DE6BCC; Tue, 18 Mar 2014 23:25:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2F275DDE; Tue, 18 Mar 2014 23:25:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2INPas1006281; Tue, 18 Mar 2014 23:25:36 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2INPaPO006280; Tue, 18 Mar 2014 23:25:36 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201403182325.s2INPaPO006280@svn.freebsd.org> From: Tycho Nightingale Date: Tue, 18 Mar 2014 23:25:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263322 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 23:25:36 -0000 Author: tychon Date: Tue Mar 18 23:25:35 2014 New Revision: 263322 URL: http://svnweb.freebsd.org/changeset/base/263322 Log: Don't reissue in-flight commands. Approved by: neel (co-mentor) Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Tue Mar 18 22:22:47 2014 (r263321) +++ head/usr.sbin/bhyve/pci_ahci.c Tue Mar 18 23:25:35 2014 (r263322) @@ -134,6 +134,7 @@ struct ahci_port { uint8_t xfermode; uint8_t sense_key; uint8_t asc; + uint32_t pending; uint32_t clb; uint32_t clbu; @@ -471,6 +472,10 @@ ahci_handle_dma(struct ahci_port *p, int if (iovcnt > BLOCKIF_IOV_MAX) { aior->prdtl = iovcnt - BLOCKIF_IOV_MAX; iovcnt = BLOCKIF_IOV_MAX; + /* + * Mark this command in-flight. + */ + p->pending |= 1 << slot; } else aior->prdtl = 0; breq->br_iovcnt = iovcnt; @@ -494,7 +499,7 @@ ahci_handle_dma(struct ahci_port *p, int err = blockif_write(p->bctx, breq); assert(err == 0); - if (!aior->prdtl && ncq) + if (ncq) p->ci &= ~(1 << slot); } @@ -1327,8 +1332,12 @@ ahci_handle_port(struct ahci_port *p) if (!(p->cmd & AHCI_P_CMD_ST)) return; + /* + * Search for any new commands to issue ignoring those that + * are already in-flight. + */ for (i = 0; (i < 32) && p->ci; i++) { - if (p->ci & (1 << i)) + if ((p->ci & (1 << i)) && !(p->pending & (1 << i))) ahci_handle_slot(p, i); } } @@ -1389,6 +1398,11 @@ ata_ioreq_cb(struct blockif_req *br, int p->serr |= (1 << slot); } + /* + * This command is now complete. + */ + p->pending &= ~(1 << slot); + if (ncq) { p->sact &= ~(1 << slot); ahci_write_fis_sdb(p, slot, tfd); From owner-svn-src-head@FreeBSD.ORG Tue Mar 18 23:51:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE845133; Tue, 18 Mar 2014 23:51:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B95076F; Tue, 18 Mar 2014 23:51:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2INpbHr015974; Tue, 18 Mar 2014 23:51:37 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2INpZY1015959; Tue, 18 Mar 2014 23:51:35 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403182351.s2INpZY1015959@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 18 Mar 2014 23:51:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263323 - in head/sys: conf ia64/ia64 ia64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Mar 2014 23:51:37 -0000 Author: marcel Date: Tue Mar 18 23:51:34 2014 New Revision: 263323 URL: http://svnweb.freebsd.org/changeset/base/263323 Log: Fix and improve exception tracing: 1. Name the kernel option XTRACE instead of EXCEPTION_TRACING 2. Put support functions in ia64/ia64/xtrace.c 3. Make it work with SMP by giving each CPU its own buffer 4. Save 16 key registers in the buffer for every exception 5. In ia64_handle_intr() and trap() transfer the trace record to the KTR trace buffer using CTRx() and with some basic information for now 6. Use a tunable to anble tracing and stop tracing as soon as we enter the debugger Room for improvements: 1. Transferring exception-relevant information to KTR 2. Add a sysctl to enable/disable tracing Added: head/sys/ia64/ia64/xtrace.c (contents, props changed) Modified: head/sys/conf/files.ia64 head/sys/conf/options.ia64 head/sys/ia64/ia64/db_machdep.c head/sys/ia64/ia64/exception.S head/sys/ia64/ia64/interrupt.c head/sys/ia64/ia64/machdep.c head/sys/ia64/ia64/mp_machdep.c head/sys/ia64/ia64/trap.c head/sys/ia64/include/md_var.h head/sys/ia64/include/pcpu.h head/sys/ia64/include/smp.h Modified: head/sys/conf/files.ia64 ============================================================================== --- head/sys/conf/files.ia64 Tue Mar 18 23:25:35 2014 (r263322) +++ head/sys/conf/files.ia64 Tue Mar 18 23:51:34 2014 (r263323) @@ -110,6 +110,7 @@ ia64/ia64/uma_machdep.c standard ia64/ia64/unaligned.c standard ia64/ia64/unwind.c standard ia64/ia64/vm_machdep.c standard +ia64/ia64/xtrace.c optional xtrace ia64/isa/isa.c optional isa ia64/isa/isa_dma.c optional isa ia64/pci/pci_cfgreg.c optional pci Modified: head/sys/conf/options.ia64 ============================================================================== --- head/sys/conf/options.ia64 Tue Mar 18 23:25:35 2014 (r263322) +++ head/sys/conf/options.ia64 Tue Mar 18 23:51:34 2014 (r263323) @@ -13,7 +13,7 @@ COMPAT_FREEBSD32 opt_compat.h PV_STATS opt_pmap.h -EXCEPTION_TRACING opt_xtrace.h +XTRACE VGA_ALT_SEQACCESS opt_vga.h VGA_DEBUG opt_vga.h Modified: head/sys/ia64/ia64/db_machdep.c ============================================================================== --- head/sys/ia64/ia64/db_machdep.c Tue Mar 18 23:25:35 2014 (r263322) +++ head/sys/ia64/ia64/db_machdep.c Tue Mar 18 23:51:34 2014 (r263323) @@ -26,11 +26,11 @@ * SUCH DAMAGE. */ +#include "opt_xtrace.h" + #include __FBSDID("$FreeBSD$"); -#include "opt_xtrace.h" - #include #include #include @@ -585,6 +585,10 @@ db_show_mdpcpu(struct pcpu *pc) db_printf("MD: clock_load = %#lx\n", md->clock_load); db_printf("MD: stats = %p\n", &md->stats); db_printf("MD: pmap = %p\n", md->current_pmap); +#ifdef XTRACE + db_printf("MD: xtrace_buffer = %p\n", md->xtrace_buffer); + db_printf("MD: xtrace_tail = %#lx\n", md->xtrace_tail); +#endif } void @@ -604,29 +608,3 @@ db_trace_thread(struct thread *td, int c ctx = kdb_thr_ctx(td); return (db_backtrace(td, ctx, count)); } - -#ifdef EXCEPTION_TRACING - -extern long xtrace[]; -extern long *xhead; - -DB_COMMAND(xtrace, db_xtrace) -{ - long *p; - - p = (*xhead == 0) ? xtrace : xhead; - - db_printf("ITC\t\t IVT\t\t IIP\t\t IFA\t\t ISR\n"); - if (*p == 0) - return; - - do { - db_printf("%016lx %016lx %016lx %016lx %016lx\n", p[0], p[1], - p[2], p[3], p[4]); - p += 5; - if (p == (void *)&xhead) - p = xtrace; - } while (p != xhead); -} - -#endif Modified: head/sys/ia64/ia64/exception.S ============================================================================== --- head/sys/ia64/ia64/exception.S Tue Mar 18 23:25:35 2014 (r263322) +++ head/sys/ia64/ia64/exception.S Tue Mar 18 23:51:34 2014 (r263323) @@ -50,63 +50,185 @@ __FBSDID("$FreeBSD$"); .section .ivt.data, "aw" + .align 8 .global ia64_kptdir + .size ia64_kptdir, 8 ia64_kptdir: data8 0 -#ifdef EXCEPTION_TRACING +#ifdef XTRACE - .global xtrace, xhead -xtrace: .space 1024*5*8 -xhead: data8 xtrace + .align 8 + .global ia64_xtrace_mask + .size ia64_xtrace_mask, 8 +ia64_xtrace_mask: data8 0 + + .align 4 + .global ia64_xtrace_enabled + .size ia64_xtrace_enabled, 4 +ia64_xtrace_enabled: data4 0 -#define XTRACE(offset) \ -{ .mmi ; \ - mov r24=ar.itc ; \ - mov r25=cr.iip ; \ - mov r27=offset ; \ -} ; \ -{ .mlx ; \ - mov r28=cr.ifa ; \ - movl r29=xhead ;; \ -} ; \ -{ .mmi ; \ - ld8 r29=[r29] ;; \ - st8 [r29]=r24,8 ; \ - nop 0 ;; \ -} ; \ -{ .mmi ; \ - st8 [r29]=r27,8 ;; \ - mov r24=cr.isr ; \ - add r27=8,r29 ;; \ -} ; \ -{ .mmi ; \ - st8 [r29]=r25,16 ;; \ - st8 [r27]=r28,16 ; \ - mov r25=pr ;; \ +#define XTRACE_HOOK(offset) \ +{ .mii ; \ + nop 0 ; \ + mov r31 = b7 ; \ + mov r28 = pr ; \ } ; \ -{ .mlx ; \ - st8 [r29]=r24 ; \ - movl r28=xhead ;; \ +{ .mib ; \ + nop 0 ; \ + mov r25 = ip ; \ + br.sptk ia64_xtrace_write ;; \ } ; \ { .mii ; \ - cmp.eq p15,p0=r27,r28 ; \ - addl r29=1024*5*8,r0 ;; \ -(p15) sub r27=r28,r29 ;; \ -} ; \ -{ .mmi ; \ - st8 [r28]=r27 ; \ - nop 0 ; \ - mov pr=r25,0x1ffff ;; \ + nop 0 ; \ + mov b7 = r31 ; \ + mov pr = r28, 0x1ffff ;; \ } -#else + .section .ivt.text, "ax" + +// We can only use r25, r26 & r27 +ENTRY_NOPROFILE(ia64_xtrace_write, 0) +{ .mlx + add r25 = 16, r25 + movl r26 = ia64_xtrace_enabled + ;; +} +{ .mmi + mov r27 = ar.k3 + ld4 r26 = [r26] + mov b7 = r25 + ;; +} +{ .mib + add r25 = -32, r25 + cmp.eq p15,p0 = r0, r26 +(p15) br.dptk.few b7 + ;; +} +{ .mib + nop 0 + cmp.eq p15,p0 = r0, r27 +(p15) br.dptk.few b7 + ;; +} +{ .mmi + st8 [r27] = r25, 8 // 0x00 IVT + mov r26 = ar.itc + nop 0 + ;; +} +{ .mmi + st8 [r27] = r26, 8 // 0x08 ITC + mov r25 = cr.iip + nop 0 + ;; +} +{ .mmi + st8 [r27] = r25, 8 // 0x10 IIP + mov r26 = cr.ifa + nop 0 + ;; +} +{ .mmi + st8 [r27] = r26, 8 // 0x18 IFA + mov r25 = cr.isr + nop 0 + ;; +} +{ .mmi + st8 [r27] = r25, 8 // 0x20 ISR + mov r26 = cr.ipsr + nop 0 + ;; +} +{ .mmi + st8 [r27] = r26, 8 // 0x28 IPSR + mov r25 = cr.itir + nop 0 + ;; +} +{ .mmi + st8 [r27] = r25, 8 // 0x30 ITIR + mov r26 = cr.iipa + nop 0 + ;; +} +{ .mmi + st8 [r27] = r26, 8 // 0x38 IIPA + mov r25 = cr.ifs + nop 0 + ;; +} +{ .mmi + st8 [r27] = r25, 8 // 0x40 IFS + mov r26 = cr.iim + nop 0 + ;; +} +{ .mmi + st8 [r27] = r26, 8 // 0x48 IIM + mov r25 = cr.iha + nop 0 + ;; +} +{ .mmi + st8 [r27] = r25, 8 // 0x50 IHA + mov r26 = ar.unat + nop 0 + ;; +} +{ .mmi + st8 [r27] = r26, 8 // 0x58 UNAT + mov r25 = ar.rsc + nop 0 + ;; +} +{ .mmi + st8 [r27] = r25, 8 // 0x60 RSC + mov r26 = ar.bsp + nop 0 + ;; +} +{ .mmi + st8 [r27] = r26, 8 // 0x68 BSP + mov r25 = r13 + nop 0 + ;; +} +{ .mmi + st8 [r27] = r25, 8 // 0x70 PCPU/TLS + mov r26 = r12 + nop 0 + ;; +} +{ .mlx + st8 [r27] = r26, 8 // 0x78 SP + movl r25 = ia64_xtrace_mask + ;; +} +{ .mmi + ld8 r26 = [r25] + ;; + and r25 = r27, r26 + nop 0 + ;; +} +{ .mib + mov ar.k3 = r25 + nop 0 + br.sptk b7 + ;; +} +END(ia64_xtrace_write) -#define XTRACE(offset) +#else /* XTRACE */ -#endif +#define XTRACE_HOOK(offset) .section .ivt.text, "ax" +#endif /* XTRACE */ + /* * exception_save: save interrupted state * @@ -632,6 +754,7 @@ ENTRY_NOPROFILE(exception_restore, 0) ssm psr.dt ;; srlz.d + mov r16 = r25 exception_restore_restart: { .mmi @@ -649,20 +772,21 @@ exception_restore_restart: ;; } { .mmi + mov cr.ifs=r16 mov ar.k6=r31 - mov ar.rnat=r21 - nop 0 + mov pr=r18,0x1ffff ;; } { .mmi - mov ar.unat=r17 mov cr.iip=r19 + mov ar.unat=r17 nop 0 + ;; } { .mmi mov cr.ipsr=r24 - mov cr.ifs=r25 - mov pr=r18,0x1ffff + mov ar.rnat=r21 + nop 0 ;; } { .mmb @@ -713,7 +837,7 @@ END(exception_restore) .save rp, r0; \ .body; \ ivt_##name: \ - XTRACE(offset) + XTRACE_HOOK(offset) #define IVT_END(name) \ .endp ivt_##name Modified: head/sys/ia64/ia64/interrupt.c ============================================================================== --- head/sys/ia64/ia64/interrupt.c Tue Mar 18 23:25:35 2014 (r263322) +++ head/sys/ia64/ia64/interrupt.c Tue Mar 18 23:51:34 2014 (r263323) @@ -25,6 +25,7 @@ */ #include "opt_ddb.h" +#include "opt_xtrace.h" #include __FBSDID("$FreeBSD$"); @@ -305,6 +306,11 @@ ia64_handle_intr(struct trapframe *tf) td = curthread; ia64_set_fpsr(IA64_FPSR_DEFAULT); + +#ifdef XTRACE + ia64_xtrace_save(); +#endif + PCPU_INC(cnt.v_intr); xiv = ia64_get_ivr(); Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Tue Mar 18 23:25:35 2014 (r263322) +++ head/sys/ia64/ia64/machdep.c Tue Mar 18 23:51:34 2014 (r263323) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_kstack_pages.h" #include "opt_sched.h" +#include "opt_xtrace.h" #include #include @@ -177,9 +178,6 @@ void (*cpu_idle_hook)(sbintime_t) = NULL struct kva_md_info kmi; -#define Mhz 1000000L -#define Ghz (1000L*Mhz) - static void identifycpu(void) { @@ -566,6 +564,9 @@ void kdb_cpu_trap(int vector, int code __unused) { +#ifdef XTRACE + ia64_xtrace_stop(); +#endif __asm __volatile("flushrs;;"); /* Restart after the break instruction. */ @@ -892,6 +893,10 @@ ia64_init(void) */ pmap_bootstrap(); +#ifdef XTRACE + ia64_xtrace_init_bsp(); +#endif + /* * Initialize debuggers, and break into them if appropriate. */ Modified: head/sys/ia64/ia64/mp_machdep.c ============================================================================== --- head/sys/ia64/ia64/mp_machdep.c Tue Mar 18 23:25:35 2014 (r263322) +++ head/sys/ia64/ia64/mp_machdep.c Tue Mar 18 23:51:34 2014 (r263323) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include "opt_kstack_pages.h" +#include "opt_xtrace.h" #include #include @@ -236,6 +237,10 @@ ia64_ap_startup(void) ia64_set_fpsr(IA64_FPSR_DEFAULT); +#ifdef XTRACE + ia64_xtrace_init_ap(ia64_ap_state.as_xtrace_buffer); +#endif + /* Wait until it's time for us to be unleashed */ while (ia64_ap_state.as_spin) cpu_spinwait(); @@ -398,6 +403,10 @@ cpu_mp_start() ia64_ap_state.as_kstack = stp; ia64_ap_state.as_kstack_top = stp + KSTACK_PAGES * PAGE_SIZE; +#ifdef XTRACE + ia64_ap_state.as_xtrace_buffer = ia64_xtrace_alloc(); +#endif + ia64_ap_state.as_trace = 0; ia64_ap_state.as_delay = 2000; ia64_ap_state.as_awake = 0; Modified: head/sys/ia64/ia64/trap.c ============================================================================== --- head/sys/ia64/ia64/trap.c Tue Mar 18 23:25:35 2014 (r263322) +++ head/sys/ia64/ia64/trap.c Tue Mar 18 23:51:34 2014 (r263323) @@ -354,6 +354,12 @@ trap(int vector, struct trapframe *tf) ksiginfo_t ksi; user = TRAPF_USERMODE(tf) ? 1 : 0; + if (user) + ia64_set_fpsr(IA64_FPSR_DEFAULT); + +#ifdef XTRACE + ia64_xtrace_save(); +#endif PCPU_INC(cnt.v_trap); @@ -362,7 +368,6 @@ trap(int vector, struct trapframe *tf) ucode = 0; if (user) { - ia64_set_fpsr(IA64_FPSR_DEFAULT); td->td_pticks = 0; td->td_frame = tf; if (td->td_ucred != p->p_ucred) Added: head/sys/ia64/ia64/xtrace.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/ia64/ia64/xtrace.c Tue Mar 18 23:51:34 2014 (r263323) @@ -0,0 +1,220 @@ +/*- + * Copyright (c) 2014 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_ddb.h" +#include "opt_xtrace.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define XTRACE_LOG2SZ 14 /* 16KB trace buffers */ + +struct ia64_xtrace_record { + uint64_t ivt; + uint64_t itc; + uint64_t iip; + uint64_t ifa; + uint64_t isr; + uint64_t ipsr; + uint64_t itir; + uint64_t iipa; + + uint64_t ifs; + uint64_t iim; + uint64_t iha; + uint64_t unat; + uint64_t rsc; + uint64_t bsp; + uint64_t tp; + uint64_t sp; +}; + +extern uint32_t ia64_xtrace_enabled; +extern uint64_t ia64_xtrace_mask; + +static uint64_t ia64_xtrace_base; + +static void +ia64_xtrace_init_common(vm_paddr_t pa) +{ + uint64_t psr; + pt_entry_t pte; + + pte = PTE_PRESENT | PTE_MA_WB | PTE_ACCESSED | PTE_DIRTY | + PTE_PL_KERN | PTE_AR_RW; + pte |= pa & PTE_PPN_MASK; + + __asm __volatile("ptr.d %0,%1" :: "r"(ia64_xtrace_base), + "r"(XTRACE_LOG2SZ << 2)); + + __asm __volatile("mov %0=psr" : "=r"(psr)); + __asm __volatile("rsm psr.ic|psr.i"); + ia64_srlz_i(); + + ia64_set_ifa(ia64_xtrace_base); + ia64_set_itir(XTRACE_LOG2SZ << 2); + ia64_srlz_d(); + __asm __volatile("itr.d dtr[%0]=%1" :: "r"(6), "r"(pte)); + + __asm __volatile("mov psr.l=%0" :: "r" (psr)); + ia64_srlz_i(); + + PCPU_SET(md.xtrace_tail, ia64_xtrace_base); + ia64_set_k3(ia64_xtrace_base); +} + +void * +ia64_xtrace_alloc(void) +{ + uintptr_t buf; + size_t sz; + + sz = 1UL << XTRACE_LOG2SZ; + buf = kmem_alloc_contig(kernel_arena, sz, M_WAITOK | M_ZERO, + 0UL, ~0UL, sz, 0, VM_MEMATTR_DEFAULT); + return ((void *)buf); +} + +void +ia64_xtrace_init_ap(void *buf) +{ + vm_paddr_t pa; + + if (buf == NULL) { + ia64_set_k3(0); + return; + } + PCPU_SET(md.xtrace_buffer, buf); + pa = ia64_tpa((uintptr_t)buf); + ia64_xtrace_init_common(pa); +} + +void +ia64_xtrace_init_bsp(void) +{ + void *buf; + vm_paddr_t pa; + size_t sz; + + sz = 1UL << XTRACE_LOG2SZ; + ia64_xtrace_base = VM_MIN_KERNEL_ADDRESS + (sz << 1); + ia64_xtrace_mask = ~sz; + + buf = ia64_physmem_alloc(sz, sz); + if (buf == NULL) { + ia64_set_k3(0); + return; + } + PCPU_SET(md.xtrace_buffer, buf); + pa = IA64_RR_MASK((uintptr_t)buf); + ia64_xtrace_init_common(pa); +} + +static void +ia64_xtrace_init(void *dummy __unused) +{ + + TUNABLE_INT_FETCH("machdep.xtrace.enabled", &ia64_xtrace_enabled); +} +SYSINIT(xtrace, SI_SUB_CPU, SI_ORDER_ANY, ia64_xtrace_init, NULL); + +void +ia64_xtrace_save(void) +{ + struct ia64_xtrace_record *rec; + uint64_t head, tail; + + critical_enter(); + head = ia64_get_k3(); + tail = PCPU_GET(md.xtrace_tail); + if (head == 0 || tail == 0) { + critical_exit(); + return; + } + while (head != tail) { + rec = (void *)(uintptr_t)tail; + CTR6(KTR_TRAP, "XTRACE: itc=%lu, ticks=%d: " + "IVT=%#lx, IIP=%#lx, IFA=%#lx, ISR=%#lx", + rec->itc, ticks, + rec->ivt, rec->iip, rec->ifa, rec->isr); + tail += sizeof(*rec); + tail &= ia64_xtrace_mask; + } + PCPU_SET(md.xtrace_tail, tail); + critical_exit(); +} + +void +ia64_xtrace_stop(void) +{ + ia64_xtrace_enabled = 0; +} + +#if 0 +#ifdef DDB + +#include + +DB_SHOW_COMMAND(xtrace, db_xtrace) +{ + struct ia64_xtrace_record *p, *r; + + p = (ia64_xtptr == 0) ? ia64_xtptr1 : ia64_xtptr; + if (p == 0) { + db_printf("Exception trace buffer not allocated\n"); + return; + } + + r = (p->ivt == 0) ? ia64_xtbase : p; + if (r->ivt == 0) { + db_printf("No exception trace records written\n"); + return; + } + + db_printf("IVT\t\t ITC\t\t IIP\t\t IFA\n"); + do { + db_printf("%016lx %016lx %016lx %016lx\n", + r->ivt, r->itc, r->iip, r->ifa); + r++; + if (r == ia64_xtlim) + r = ia64_xtbase; + } while (r != p); +} + +#endif /* DDB */ +#endif Modified: head/sys/ia64/include/md_var.h ============================================================================== --- head/sys/ia64/include/md_var.h Tue Mar 18 23:25:35 2014 (r263322) +++ head/sys/ia64/include/md_var.h Tue Mar 18 23:51:34 2014 (r263323) @@ -102,6 +102,11 @@ int ia64_physmem_init(void); int ia64_physmem_track(vm_paddr_t, vm_size_t); void ia64_probe_sapics(void); void ia64_sync_icache(vm_offset_t, vm_size_t); +void *ia64_xtrace_alloc(void); +void ia64_xtrace_init_ap(void *); +void ia64_xtrace_init_bsp(void); +void ia64_xtrace_save(void); +void ia64_xtrace_stop(void); void interrupt(struct trapframe *); void map_gateway_page(void); void map_pal_code(void); Modified: head/sys/ia64/include/pcpu.h ============================================================================== --- head/sys/ia64/include/pcpu.h Tue Mar 18 23:25:35 2014 (r263322) +++ head/sys/ia64/include/pcpu.h Tue Mar 18 23:51:34 2014 (r263323) @@ -56,6 +56,8 @@ struct pcpu_md { uint32_t clock_mode; /* Clock ET mode */ uint32_t awake:1; /* CPU is awake? */ struct pcpu_stats stats; /* Interrupt stats. */ + void *xtrace_buffer; + uint64_t xtrace_tail; #ifdef _KERNEL struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; @@ -65,7 +67,7 @@ struct pcpu_md { #define PCPU_MD_FIELDS \ uint32_t pc_acpi_id; /* ACPI CPU id. */ \ struct pcpu_md pc_md; /* MD fields. */ \ - char __pad[1265] + char __pad[10*128] #ifdef _KERNEL Modified: head/sys/ia64/include/smp.h ============================================================================== --- head/sys/ia64/include/smp.h Tue Mar 18 23:25:35 2014 (r263322) +++ head/sys/ia64/include/smp.h Tue Mar 18 23:51:34 2014 (r263323) @@ -32,6 +32,7 @@ struct ia64_ap_state { void *as_kstack; void *as_kstack_top; struct pcpu *as_pcpu; + void *as_xtrace_buffer; volatile int as_delay; volatile u_int as_awake; volatile u_int as_spin; From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 00:38:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BFEF9A58; Wed, 19 Mar 2014 00:38:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC6BE699; Wed, 19 Mar 2014 00:38:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2J0cSCJ035196; Wed, 19 Mar 2014 00:38:28 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2J0cSLf035195; Wed, 19 Mar 2014 00:38:28 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201403190038.s2J0cSLf035195@svn.freebsd.org> From: Attilio Rao Date: Wed, 19 Mar 2014 00:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263324 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 00:38:28 -0000 Author: attilio Date: Wed Mar 19 00:38:27 2014 New Revision: 263324 URL: http://svnweb.freebsd.org/changeset/base/263324 Log: Fix GENERIC build. Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Tue Mar 18 23:51:34 2014 (r263323) +++ head/sys/kern/sched_ule.c Wed Mar 19 00:38:27 2014 (r263324) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 01:13:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A942706; Wed, 19 Mar 2014 01:13:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 565719FE; Wed, 19 Mar 2014 01:13:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2J1DhRP051460; Wed, 19 Mar 2014 01:13:43 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2J1Dgla051458; Wed, 19 Mar 2014 01:13:42 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201403190113.s2J1Dgla051458@svn.freebsd.org> From: Attilio Rao Date: Wed, 19 Mar 2014 01:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263328 - in head/sys: dev/md vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 01:13:43 -0000 Author: attilio Date: Wed Mar 19 01:13:42 2014 New Revision: 263328 URL: http://svnweb.freebsd.org/changeset/base/263328 Log: vm_page_grab() and vm_pager_get_pages() can drop the vm_object lock, then threads can sleep on the pip condition. Avoid to deadlock such threads by correctly awakening the sleeping ones after the pip is finished. swapoff side of the bug can likely result in shutdown deadlocks. Sponsored by: EMC / Isilon Storage Division Reported by: pho, pluknet Tested by: pho Modified: head/sys/dev/md/md.c head/sys/vm/swap_pager.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Wed Mar 19 00:55:12 2014 (r263327) +++ head/sys/dev/md/md.c Wed Mar 19 01:13:42 2014 (r263328) @@ -903,7 +903,7 @@ mdstart_swap(struct md_s *sc, struct bio offs = 0; ma_offs += len; } - vm_object_pip_subtract(sc->object, 1); + vm_object_pip_wakeup(sc->object); VM_OBJECT_WUNLOCK(sc->object); return (rv != VM_PAGER_ERROR ? 0 : ENOSPC); } Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Wed Mar 19 00:55:12 2014 (r263327) +++ head/sys/vm/swap_pager.c Wed Mar 19 01:13:42 2014 (r263328) @@ -1713,7 +1713,7 @@ swp_pager_force_pagein(vm_object_t objec vm_object_pip_add(object, 1); m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL); if (m->valid == VM_PAGE_BITS_ALL) { - vm_object_pip_subtract(object, 1); + vm_object_pip_wakeup(object); vm_page_dirty(m); vm_page_lock(m); vm_page_activate(m); @@ -1725,7 +1725,7 @@ swp_pager_force_pagein(vm_object_t objec if (swap_pager_getpages(object, &m, 1, 0) != VM_PAGER_OK) panic("swap_pager_force_pagein: read from swap failed");/*XXX*/ - vm_object_pip_subtract(object, 1); + vm_object_pip_wakeup(object); vm_page_dirty(m); vm_page_lock(m); vm_page_deactivate(m); From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 01:27:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1BF62AC7; Wed, 19 Mar 2014 01:27:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EFCDDAE8; Wed, 19 Mar 2014 01:27:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2J1RuuF055917; Wed, 19 Mar 2014 01:27:56 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2J1Ru6i055915; Wed, 19 Mar 2014 01:27:56 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201403190127.s2J1Ru6i055915@svn.freebsd.org> From: Mark Johnston Date: Wed, 19 Mar 2014 01:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263329 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 01:27:57 -0000 Author: markj Date: Wed Mar 19 01:27:56 2014 New Revision: 263329 URL: http://svnweb.freebsd.org/changeset/base/263329 Log: Only invoke fasttrap hooks for traps from user mode, and ensure that they're called with interrupts enabled. Calling fasttrap_pid_probe() with interrupts disabled can lead to deadlock if fasttrap writes to the process' address space. Reviewed by: rpaulo MFC after: 3 weeks Modified: head/sys/amd64/amd64/trap.c head/sys/i386/i386/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Wed Mar 19 01:13:42 2014 (r263328) +++ head/sys/amd64/amd64/trap.c Wed Mar 19 01:27:56 2014 (r263329) @@ -192,6 +192,9 @@ SYSCTL_INT(_machdep, OID_AUTO, uprintf_s void trap(struct trapframe *frame) { +#ifdef KDTRACE_HOOKS + struct reg regs; +#endif struct thread *td = curthread; struct proc *p = td->td_proc; int i = 0, ucode = 0, code; @@ -243,28 +246,10 @@ trap(struct trapframe *frame) /* * A trap can occur while DTrace executes a probe. Before * executing the probe, DTrace blocks re-scheduling and sets - * a flag in it's per-cpu flags to indicate that it doesn't + * a flag in its per-cpu flags to indicate that it doesn't * want to fault. On returning from the probe, the no-fault * flag is cleared and finally re-scheduling is enabled. - * - * If the DTrace kernel module has registered a trap handler, - * call it and if it returns non-zero, assume that it has - * handled the trap and modified the trap frame so that this - * function can return normally. */ - if (type == T_DTRACE_RET || type == T_BPTFLT) { - struct reg regs; - - fill_frame_regs(frame, ®s); - if (type == T_BPTFLT && - dtrace_pid_probe_ptr != NULL && - dtrace_pid_probe_ptr(®s) == 0) - goto out; - else if (type == T_DTRACE_RET && - dtrace_return_probe_ptr != NULL && - dtrace_return_probe_ptr(®s) == 0) - goto out; - } if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) goto out; #endif @@ -319,6 +304,14 @@ trap(struct trapframe *frame) case T_BPTFLT: /* bpt instruction fault */ case T_TRCTRAP: /* trace trap */ enable_intr(); +#ifdef KDTRACE_HOOKS + if (type == T_BPTFLT) { + fill_frame_regs(frame, ®s); + if (dtrace_pid_probe_ptr != NULL && + dtrace_pid_probe_ptr(®s) == 0) + goto out; + } +#endif frame->tf_rflags &= ~PSL_T; i = SIGTRAP; ucode = (type == T_TRCTRAP ? TRAP_TRACE : TRAP_BRKPT); @@ -444,6 +437,15 @@ trap(struct trapframe *frame) goto userout; i = SIGFPE; break; +#ifdef KDTRACE_HOOKS + case T_DTRACE_RET: + enable_intr(); + fill_frame_regs(frame, ®s); + if (dtrace_return_probe_ptr != NULL && + dtrace_return_probe_ptr(®s) == 0) + goto out; + break; +#endif } } else { /* kernel trap */ Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Wed Mar 19 01:13:42 2014 (r263328) +++ head/sys/i386/i386/trap.c Wed Mar 19 01:27:56 2014 (r263329) @@ -206,6 +206,9 @@ SYSCTL_INT(_machdep, OID_AUTO, uprintf_s void trap(struct trapframe *frame) { +#ifdef KDTRACE_HOOKS + struct reg regs; +#endif struct thread *td = curthread; struct proc *p = td->td_proc; int i = 0, ucode = 0, code; @@ -262,28 +265,10 @@ trap(struct trapframe *frame) /* * A trap can occur while DTrace executes a probe. Before * executing the probe, DTrace blocks re-scheduling and sets - * a flag in it's per-cpu flags to indicate that it doesn't + * a flag in its per-cpu flags to indicate that it doesn't * want to fault. On returning from the probe, the no-fault * flag is cleared and finally re-scheduling is enabled. - * - * If the DTrace kernel module has registered a trap handler, - * call it and if it returns non-zero, assume that it has - * handled the trap and modified the trap frame so that this - * function can return normally. */ - if (type == T_DTRACE_RET || type == T_BPTFLT) { - struct reg regs; - - fill_frame_regs(frame, ®s); - if (type == T_BPTFLT && - dtrace_pid_probe_ptr != NULL && - dtrace_pid_probe_ptr(®s) == 0) - goto out; - if (type == T_DTRACE_RET && - dtrace_return_probe_ptr != NULL && - dtrace_return_probe_ptr(®s) == 0) - goto out; - } if ((type == T_PROTFLT || type == T_PAGEFLT) && dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) goto out; @@ -357,6 +342,14 @@ trap(struct trapframe *frame) case T_BPTFLT: /* bpt instruction fault */ case T_TRCTRAP: /* trace trap */ enable_intr(); +#ifdef KDTRACE_HOOKS + if (type == T_BPTFLT) { + fill_frame_regs(frame, ®s); + if (dtrace_pid_probe_ptr != NULL && + dtrace_pid_probe_ptr(®s) == 0) + goto out; + } +#endif frame->tf_eflags &= ~PSL_T; i = SIGTRAP; ucode = (type == T_TRCTRAP ? TRAP_TRACE : TRAP_BRKPT); @@ -536,6 +529,15 @@ trap(struct trapframe *frame) #endif i = SIGFPE; break; +#ifdef KDTRACE_HOOKS + case T_DTRACE_RET: + enable_intr(); + fill_frame_regs(frame, ®s); + if (dtrace_return_probe_ptr != NULL && + dtrace_return_probe_ptr(®s) == 0) + goto out; + break; +#endif } } else { /* kernel trap */ From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 03:33:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4DE2F219; Wed, 19 Mar 2014 03:33:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 209657F9; Wed, 19 Mar 2014 03:33:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2J3XWPw008448; Wed, 19 Mar 2014 03:33:32 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2J3XWOU008447; Wed, 19 Mar 2014 03:33:32 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403190333.s2J3XWOU008447@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 19 Mar 2014 03:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263331 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 03:33:33 -0000 Author: glebius Date: Wed Mar 19 03:33:32 2014 New Revision: 263331 URL: http://svnweb.freebsd.org/changeset/base/263331 Log: Now, after r263102 we have ifi_oqdrops in if_data, restore printing of output queue drops in netstat(1). No driver, neither kernel fills this field in if_data, yet. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/usr.bin/netstat/if.c Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Wed Mar 19 01:43:03 2014 (r263330) +++ head/usr.bin/netstat/if.c Wed Mar 19 03:33:32 2014 (r263331) @@ -249,7 +249,7 @@ intpr(int interval, void (*pfunc)(char * printf(" %10.10s","Obytes"); printf(" %5s", "Coll"); if (dflag) - printf(" %s", "Drop"); + printf(" %s", "Drop"); putchar('\n'); } @@ -358,7 +358,8 @@ intpr(int interval, void (*pfunc)(char * if (bflag) show_stat("lu", 10, IFA_STAT(obytes), link|network); show_stat("NRSlu", 5, IFA_STAT(collisions), link); - /* XXXGL: output queue drops */ + if (dflag) + show_stat("LSlu", 5, IFA_STAT(oqdrops), link); putchar('\n'); if (!aflag) @@ -438,6 +439,7 @@ struct iftot { u_long ift_id; /* input drops */ u_long ift_op; /* output packets */ u_long ift_oe; /* output errors */ + u_long ift_od; /* output drops */ u_long ift_co; /* collisions */ u_long ift_ib; /* input bytes */ u_long ift_ob; /* output bytes */ @@ -473,6 +475,7 @@ fill_iftot(struct iftot *st) st->ift_ib += IFA_STAT(ibytes); st->ift_op += IFA_STAT(opackets); st->ift_oe += IFA_STAT(oerrors); + st->ift_od += IFA_STAT(oqdrops); st->ift_ob += IFA_STAT(obytes); st->ift_co += IFA_STAT(collisions); } @@ -551,7 +554,8 @@ loop: show_stat("lu", 5, new->ift_oe - old->ift_oe, 1); show_stat("lu", 10, new->ift_ob - old->ift_ob, 1); show_stat("NRSlu", 5, new->ift_co - old->ift_co, 1); - /* XXXGL: output queue drops */ + if (dflag) + show_stat("LSlu", 5, new->ift_od - old->ift_od, 1); putchar('\n'); fflush(stdout); From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 06:03:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E5278C8; Wed, 19 Mar 2014 06:03:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 518C277F; Wed, 19 Mar 2014 06:03:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2J63RKB068469; Wed, 19 Mar 2014 06:03:27 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2J63QF7068466; Wed, 19 Mar 2014 06:03:26 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403190603.s2J63QF7068466@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 19 Mar 2014 06:03:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263332 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 06:03:27 -0000 Author: glebius Date: Wed Mar 19 06:03:26 2014 New Revision: 263332 URL: http://svnweb.freebsd.org/changeset/base/263332 Log: Add counter for Tx errors returned from if_transmit. Submitted-by: Boris Misenov Sponsored by: Solarflare Communications, Inc. Modified: head/sys/dev/sfxge/sfxge_tx.c head/sys/dev/sfxge/sfxge_tx.h Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Wed Mar 19 03:33:32 2014 (r263331) +++ head/sys/dev/sfxge/sfxge_tx.c Wed Mar 19 06:03:26 2014 (r263332) @@ -500,6 +500,11 @@ sfxge_tx_packet_add(struct sfxge_txq *tx int locked; int rc; + if (!SFXGE_LINK_UP(txq->sc)) { + rc = ENETDOWN; + goto fail; + } + /* * Try to grab the txq lock. If we are able to get the lock, * the packet will be appended to the "get list" of the deferred @@ -537,6 +542,7 @@ sfxge_tx_packet_add(struct sfxge_txq *tx fail: m_freem(m); + atomic_add_long(&txq->early_drops, 1); return (rc); } @@ -587,11 +593,6 @@ sfxge_if_transmit(struct ifnet *ifp, str KASSERT(ifp->if_flags & IFF_UP, ("interface not up")); - if (!SFXGE_LINK_UP(sc)) { - m_freem(m); - return (ENETDOWN); - } - /* Pick the desired transmit queue. */ if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_TSO)) { int index = 0; @@ -1391,6 +1392,7 @@ static const struct { SFXGE_TX_STAT(tso_long_headers, tso_long_headers), SFXGE_TX_STAT(tx_collapses, collapses), SFXGE_TX_STAT(tx_drops, drops), + SFXGE_TX_STAT(tx_early_drops, early_drops), }; static int Modified: head/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.h Wed Mar 19 03:33:32 2014 (r263331) +++ head/sys/dev/sfxge/sfxge_tx.h Wed Mar 19 06:03:26 2014 (r263332) @@ -159,6 +159,7 @@ struct sfxge_txq { unsigned long tso_long_headers; unsigned long collapses; unsigned long drops; + unsigned long early_drops; /* The following fields change more often, and are used mostly * on the completion path From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 06:08:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA66BB16; Wed, 19 Mar 2014 06:08:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D80507CF; Wed, 19 Mar 2014 06:08:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2J683ob069413; Wed, 19 Mar 2014 06:08:03 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2J68370069412; Wed, 19 Mar 2014 06:08:03 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403190608.s2J68370069412@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 19 Mar 2014 06:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263333 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 06:08:04 -0000 Author: glebius Date: Wed Mar 19 06:08:03 2014 New Revision: 263333 URL: http://svnweb.freebsd.org/changeset/base/263333 Log: When exporting ifnet via sysctl, add ifqueue(9) drop count to the ifi_oqdrops. This is a temporary workaround until ifqueue(9) vanishes. While here, remove the pointless ifi_vhid assignment. It has sense only when we are exporting ifaddrs, not ifnets. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Wed Mar 19 06:03:26 2014 (r263332) +++ head/sys/net/rtsock.c Wed Mar 19 06:08:03 2014 (r263333) @@ -1598,9 +1598,8 @@ sysctl_iflist_ifml(struct ifnet *ifp, st *ifd = ifp->if_data; - /* Fixup if_data carp(4) vhid. */ - if (carp_get_vhid_p != NULL) - ifd->ifi_vhid = (*carp_get_vhid_p)(ifp->if_addr); + /* Some drivers still use ifqueue(9), add its stats. */ + ifd->ifi_oqdrops += ifp->if_snd.ifq_drops; return (SYSCTL_OUT(w->w_req, (caddr_t)ifm, len)); } @@ -1633,9 +1632,9 @@ sysctl_iflist_ifm(struct ifnet *ifp, str } *ifd = ifp->if_data; - /* Fixup if_data carp(4) vhid. */ - if (carp_get_vhid_p != NULL) - ifd->ifi_vhid = (*carp_get_vhid_p)(ifp->if_addr); + + /* Some drivers still use ifqueue(9), add its stats. */ + ifd->ifi_oqdrops += ifp->if_snd.ifq_drops; return (SYSCTL_OUT(w->w_req, (caddr_t)ifm, len)); } From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 09:41:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10AB3391; Wed, 19 Mar 2014 09:41:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F17B2D4B; Wed, 19 Mar 2014 09:41:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2J9fCHf057030; Wed, 19 Mar 2014 09:41:12 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2J9fCla057029; Wed, 19 Mar 2014 09:41:12 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201403190941.s2J9fCla057029@svn.freebsd.org> From: Peter Holm Date: Wed, 19 Mar 2014 09:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263336 - head/tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 09:41:13 -0000 Author: pho Date: Wed Mar 19 09:41:12 2014 New Revision: 263336 URL: http://svnweb.freebsd.org/changeset/base/263336 Log: Added sysctl kern.maxfiles increase test, do not use /etc/passwd for tests and use volatile sig_atomic_t for signal handler variable. Reviewed by: asomers (previous version) Sponsored by: EMC / Isilon storage division Modified: head/tests/sys/kern/kern_descrip_test.c Modified: head/tests/sys/kern/kern_descrip_test.c ============================================================================== --- head/tests/sys/kern/kern_descrip_test.c Wed Mar 19 09:36:29 2014 (r263335) +++ head/tests/sys/kern/kern_descrip_test.c Wed Mar 19 09:41:12 2014 (r263336) @@ -29,22 +29,31 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include +#include #include #include +static volatile sig_atomic_t done; + +#define AFILE "afile" +#define EXPANDBY 1000 +#define PARALLEL 4 +#define RENDEZVOUS "rendezvous" +#define VALUE "value" + ATF_TC_WITHOUT_HEAD(dup2__simple); ATF_TC_BODY(dup2__simple, tc) { int fd1, fd2; struct stat sb1, sb2; - fd1 = open("/etc/passwd", O_RDONLY); - ATF_REQUIRE(fd1 >= 0); + ATF_REQUIRE((fd1 = open(AFILE, O_CREAT, 0644)) != -1); fd2 = 27; ATF_REQUIRE(dup2(fd1, fd2) != -1); ATF_REQUIRE(fstat(fd1, &sb1) != -1); @@ -57,22 +66,125 @@ ATF_TC_HEAD(dup2__ebadf_when_2nd_arg_out { atf_tc_set_md_var(tc, "descr", "Regression test for r234131"); } + ATF_TC_BODY(dup2__ebadf_when_2nd_arg_out_of_range, tc) { int fd1, fd2, ret; - fd1 = open("/etc/passwd", O_RDONLY); + ATF_REQUIRE((fd1 = open(AFILE, O_CREAT, 0644)) != -1); fd2 = INT_MAX; ret = dup2(fd1, fd2); ATF_CHECK_EQ(-1, ret); ATF_CHECK_EQ(EBADF, errno); } +static void +handler(int s __unused) +{ + done++; +} + +static void +openfiles2(size_t n) +{ + size_t i; + int r; + + errno = 0; + for (i = 0; i < n; i++) + ATF_REQUIRE((r = open(AFILE, O_RDONLY)) != -1); + kill(getppid(), SIGUSR1); + + for (;;) { + if (access(RENDEZVOUS, R_OK) != 0) + break; + usleep(1000); + } + _exit(0); +} + +static void +openfiles(size_t n) +{ + int i, fd; + + signal(SIGUSR1, handler); + ATF_REQUIRE((fd = open(AFILE, O_CREAT, 0644)) != -1); + close(fd); + ATF_REQUIRE((fd = open(RENDEZVOUS, O_CREAT, 0644)) != -1); + close(fd); + done = 0; + for (i = 0; i < PARALLEL; i++) + if (fork() == 0) + openfiles2(n / PARALLEL); + while (done != PARALLEL) + usleep(1000); + unlink(RENDEZVOUS); + usleep(40000); +} + +ATF_TC_WITH_CLEANUP(kern_maxfiles__increase); +ATF_TC_HEAD(kern_maxfiles__increase, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); + atf_tc_set_md_var(tc, "require.config", "allow_sysctl_side_effects"); + atf_tc_set_md_var(tc, "descr", + "Check kern.maxfiles expansion"); +} + +ATF_TC_BODY(kern_maxfiles__increase, tc) +{ + size_t oldlen; + int maxfiles, oldmaxfiles, current; + char buf[80]; + + oldlen = sizeof(maxfiles); + if (sysctlbyname("kern.maxfiles", &maxfiles, &oldlen, NULL, 0) == -1) + atf_tc_fail("getsysctlbyname(%s): %s", "kern.maxfiles", + strerror(errno)); + if (sysctlbyname("kern.openfiles", ¤t, &oldlen, NULL, 0) == -1) + atf_tc_fail("getsysctlbyname(%s): %s", "kern.openfiles", + strerror(errno)); + + oldmaxfiles = maxfiles; + + /* Store old kern.maxfiles in a symlink for cleanup */ + snprintf(buf, sizeof(buf), "%d", oldmaxfiles); + if (symlink(buf, VALUE) == 1) + atf_tc_fail("symlink(%s, %s): %s", buf, VALUE, + strerror(errno)); + + maxfiles += EXPANDBY; + if (sysctlbyname("kern.maxfiles", NULL, 0, &maxfiles, oldlen) == -1) + atf_tc_fail("getsysctlbyname(%s): %s", "kern.maxfiles", + strerror(errno)); + + openfiles(oldmaxfiles - current + 1); + (void)unlink(VALUE); +} + +ATF_TC_CLEANUP(kern_maxfiles__increase, tc) +{ + size_t oldlen; + int n, oldmaxfiles; + char buf[80]; + + if ((n = readlink(VALUE, buf, sizeof(buf))) > 0) { + buf[n] = '\0'; + if (sscanf(buf, "%d", &oldmaxfiles) == 1) { + oldlen = sizeof(oldmaxfiles); + (void) sysctlbyname("kern.maxfiles", NULL, 0, + &oldmaxfiles, oldlen); + } + } +} + ATF_TP_ADD_TCS(tp) { - ATF_TP_ADD_TC(tp, dup2__simple); - ATF_TP_ADD_TC(tp, dup2__ebadf_when_2nd_arg_out_of_range); + ATF_TP_ADD_TC(tp, dup2__simple); + ATF_TP_ADD_TC(tp, dup2__ebadf_when_2nd_arg_out_of_range); + ATF_TP_ADD_TC(tp, kern_maxfiles__increase); - return atf_no_error(); + return (atf_no_error()); } From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 12:06:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DDC68941; Wed, 19 Mar 2014 12:06:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CB0E6CD5; Wed, 19 Mar 2014 12:06:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JC6pf7016097; Wed, 19 Mar 2014 12:06:51 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JC6pob016096; Wed, 19 Mar 2014 12:06:51 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403191206.s2JC6pob016096@svn.freebsd.org> From: Julio Merino Date: Wed, 19 Mar 2014 12:06:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263345 - head/etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 12:06:51 -0000 Author: jmmv Date: Wed Mar 19 12:06:51 2014 New Revision: 263345 URL: http://svnweb.freebsd.org/changeset/base/263345 Log: Expand tabs that sneaked in into spaces. Problem introduced by r263227. Spotted by Alan Somers. Modified: head/etc/mtree/BSD.tests.dist Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Wed Mar 19 10:42:10 2014 (r263344) +++ head/etc/mtree/BSD.tests.dist Wed Mar 19 12:06:51 2014 (r263345) @@ -116,8 +116,8 @@ printf .. sed - regress.multitest.out - .. + regress.multitest.out + .. .. tr .. From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 12:29:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F9EF2AD; Wed, 19 Mar 2014 12:29:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 17147EDD; Wed, 19 Mar 2014 12:29:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JCTO8A024640; Wed, 19 Mar 2014 12:29:24 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JCTLDp024608; Wed, 19 Mar 2014 12:29:21 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403191229.s2JCTLDp024608@svn.freebsd.org> From: Julio Merino Date: Wed, 19 Mar 2014 12:29:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263346 - in head: etc/mtree tools/build/mk tools/regression/usr.bin/make usr.bin/make usr.bin/make/tests usr.bin/make/tests/archives/fmt_44bsd usr.bin/make/tests/archives/fmt_44bsd_mod... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 12:29:25 -0000 Author: jmmv Date: Wed Mar 19 12:29:20 2014 New Revision: 263346 URL: http://svnweb.freebsd.org/changeset/base/263346 Log: Migrate tools/regression/usr.bin/make/ to the new tests layout. Note that these tests are for fmake, not bmake, and thus they are not installed nor run when bmake is selected (the default). Yes, I have wasted a *ton* of time on moving tests for no real reason other than ensuring they are not left behind. But maybe, just maybe, it was not work in vain: the majority of these tests also work with bmake and the few that don't may point at broken stuff. For example, the tests for the "archive" feature do not work with bmake, but bmake's manpage and source tree seem to imply that they should. So... to be investigated later; need to poke sjg@. Added: head/usr.bin/make/tests/ - copied from r263227, head/tools/regression/usr.bin/make/ head/usr.bin/make/tests/archives/fmt_44bsd/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/archives/fmt_44bsd/Makefile head/usr.bin/make/tests/archives/fmt_44bsd/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/archives/fmt_44bsd/test.t head/usr.bin/make/tests/archives/fmt_44bsd_mod/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/Makefile head/usr.bin/make/tests/archives/fmt_44bsd_mod/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/test.t head/usr.bin/make/tests/archives/fmt_oldbsd/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/archives/fmt_oldbsd/Makefile head/usr.bin/make/tests/archives/fmt_oldbsd/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/archives/fmt_oldbsd/test.t head/usr.bin/make/tests/basic/t0/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/basic/t0/test.t head/usr.bin/make/tests/basic/t1/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/basic/t1/Makefile head/usr.bin/make/tests/basic/t1/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/basic/t1/test.t head/usr.bin/make/tests/basic/t2/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/basic/t2/Makefile head/usr.bin/make/tests/basic/t2/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/basic/t2/test.t head/usr.bin/make/tests/basic/t3/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/basic/t3/test.t head/usr.bin/make/tests/execution/ellipsis/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/execution/ellipsis/Makefile head/usr.bin/make/tests/execution/ellipsis/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/execution/ellipsis/test.t head/usr.bin/make/tests/execution/empty/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/execution/empty/Makefile head/usr.bin/make/tests/execution/empty/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/execution/empty/test.t head/usr.bin/make/tests/execution/joberr/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/execution/joberr/Makefile head/usr.bin/make/tests/execution/joberr/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/execution/joberr/test.t head/usr.bin/make/tests/execution/plus/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/execution/plus/Makefile head/usr.bin/make/tests/execution/plus/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/execution/plus/test.t head/usr.bin/make/tests/shell/builtin/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/shell/builtin/Makefile head/usr.bin/make/tests/shell/builtin/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/shell/builtin/test.t head/usr.bin/make/tests/shell/meta/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/shell/meta/Makefile head/usr.bin/make/tests/shell/meta/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/shell/meta/test.t head/usr.bin/make/tests/shell/path/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/shell/path/Makefile head/usr.bin/make/tests/shell/path/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/shell/path/test.t head/usr.bin/make/tests/shell/path_select/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/shell/path_select/Makefile head/usr.bin/make/tests/shell/path_select/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/shell/path_select/test.t head/usr.bin/make/tests/shell/replace/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/shell/replace/Makefile head/usr.bin/make/tests/shell/replace/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/shell/replace/test.t head/usr.bin/make/tests/shell/select/Makefile.test - copied, changed from r263227, head/tools/regression/usr.bin/make/shell/select/Makefile head/usr.bin/make/tests/shell/select/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/shell/select/test.t head/usr.bin/make/tests/suffixes/basic/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/suffixes/basic/Makefile head/usr.bin/make/tests/suffixes/basic/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/suffixes/basic/test.t head/usr.bin/make/tests/suffixes/src_wild1/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/suffixes/src_wild1/Makefile head/usr.bin/make/tests/suffixes/src_wild1/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/suffixes/src_wild1/test.t head/usr.bin/make/tests/suffixes/src_wild2/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/suffixes/src_wild2/Makefile head/usr.bin/make/tests/suffixes/src_wild2/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/suffixes/src_wild2/test.t head/usr.bin/make/tests/syntax/directive-t0/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/syntax/directive-t0/Makefile head/usr.bin/make/tests/syntax/directive-t0/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/syntax/directive-t0/test.t head/usr.bin/make/tests/syntax/enl/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/syntax/enl/Makefile head/usr.bin/make/tests/syntax/enl/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/syntax/enl/test.t head/usr.bin/make/tests/syntax/funny-targets/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/syntax/funny-targets/Makefile head/usr.bin/make/tests/syntax/funny-targets/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/syntax/funny-targets/test.t head/usr.bin/make/tests/syntax/semi/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/syntax/semi/Makefile head/usr.bin/make/tests/syntax/semi/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/syntax/semi/test.t head/usr.bin/make/tests/sysmk/t0/2/1/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/sysmk/t0/2/1/Makefile head/usr.bin/make/tests/sysmk/t0/2/1/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/sysmk/t0/2/1/test.t head/usr.bin/make/tests/sysmk/t0/mk/sys.mk.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/sysmk/t0/mk/sys.mk head/usr.bin/make/tests/sysmk/t1/2/1/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/sysmk/t1/2/1/test.t head/usr.bin/make/tests/sysmk/t1/mk/sys.mk.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/sysmk/t1/mk/sys.mk head/usr.bin/make/tests/sysmk/t2/2/1/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/sysmk/t2/2/1/test.t head/usr.bin/make/tests/sysmk/t2/mk/sys.mk.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/sysmk/t2/mk/sys.mk head/usr.bin/make/tests/variables/modifier_M/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/variables/modifier_M/Makefile head/usr.bin/make/tests/variables/modifier_M/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/variables/modifier_M/test.t head/usr.bin/make/tests/variables/modifier_t/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/variables/modifier_t/Makefile head/usr.bin/make/tests/variables/modifier_t/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/variables/modifier_t/test.t head/usr.bin/make/tests/variables/opt_V/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/variables/opt_V/Makefile head/usr.bin/make/tests/variables/opt_V/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/variables/opt_V/test.t head/usr.bin/make/tests/variables/t0/Makefile.test - copied unchanged from r263227, head/tools/regression/usr.bin/make/variables/t0/Makefile head/usr.bin/make/tests/variables/t0/legacy_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/make/variables/t0/test.t Deleted: head/tools/regression/usr.bin/make/ head/usr.bin/make/tests/all.sh head/usr.bin/make/tests/archives/fmt_44bsd/Makefile head/usr.bin/make/tests/archives/fmt_44bsd/test.t head/usr.bin/make/tests/archives/fmt_44bsd_mod/Makefile head/usr.bin/make/tests/archives/fmt_44bsd_mod/test.t head/usr.bin/make/tests/archives/fmt_oldbsd/Makefile head/usr.bin/make/tests/archives/fmt_oldbsd/test.t head/usr.bin/make/tests/basic/t0/test.t head/usr.bin/make/tests/basic/t1/Makefile head/usr.bin/make/tests/basic/t1/test.t head/usr.bin/make/tests/basic/t2/Makefile head/usr.bin/make/tests/basic/t2/test.t head/usr.bin/make/tests/basic/t3/test.t head/usr.bin/make/tests/execution/ellipsis/Makefile head/usr.bin/make/tests/execution/ellipsis/test.t head/usr.bin/make/tests/execution/empty/Makefile head/usr.bin/make/tests/execution/empty/test.t head/usr.bin/make/tests/execution/joberr/Makefile head/usr.bin/make/tests/execution/joberr/test.t head/usr.bin/make/tests/execution/plus/Makefile head/usr.bin/make/tests/execution/plus/test.t head/usr.bin/make/tests/shell/builtin/Makefile head/usr.bin/make/tests/shell/builtin/test.t head/usr.bin/make/tests/shell/meta/Makefile head/usr.bin/make/tests/shell/meta/test.t head/usr.bin/make/tests/shell/path/Makefile head/usr.bin/make/tests/shell/path/test.t head/usr.bin/make/tests/shell/path_select/Makefile head/usr.bin/make/tests/shell/path_select/test.t head/usr.bin/make/tests/shell/replace/Makefile head/usr.bin/make/tests/shell/replace/test.t head/usr.bin/make/tests/shell/select/Makefile head/usr.bin/make/tests/shell/select/test.t head/usr.bin/make/tests/suffixes/basic/Makefile head/usr.bin/make/tests/suffixes/basic/test.t head/usr.bin/make/tests/suffixes/src_wild1/Makefile head/usr.bin/make/tests/suffixes/src_wild1/test.t head/usr.bin/make/tests/suffixes/src_wild2/Makefile head/usr.bin/make/tests/suffixes/src_wild2/test.t head/usr.bin/make/tests/syntax/directive-t0/Makefile head/usr.bin/make/tests/syntax/directive-t0/test.t head/usr.bin/make/tests/syntax/enl/Makefile head/usr.bin/make/tests/syntax/enl/test.t head/usr.bin/make/tests/syntax/funny-targets/Makefile head/usr.bin/make/tests/syntax/funny-targets/test.t head/usr.bin/make/tests/syntax/semi/Makefile head/usr.bin/make/tests/syntax/semi/test.t head/usr.bin/make/tests/sysmk/t0/2/1/Makefile head/usr.bin/make/tests/sysmk/t0/2/1/test.t head/usr.bin/make/tests/sysmk/t0/mk/sys.mk head/usr.bin/make/tests/sysmk/t1/2/1/test.t head/usr.bin/make/tests/sysmk/t1/mk/sys.mk head/usr.bin/make/tests/sysmk/t2/2/1/test.t head/usr.bin/make/tests/sysmk/t2/mk/sys.mk head/usr.bin/make/tests/variables/modifier_M/Makefile head/usr.bin/make/tests/variables/modifier_M/test.t head/usr.bin/make/tests/variables/modifier_t/Makefile head/usr.bin/make/tests/variables/modifier_t/test.t head/usr.bin/make/tests/variables/opt_V/Makefile head/usr.bin/make/tests/variables/opt_V/test.t head/usr.bin/make/tests/variables/t0/Makefile head/usr.bin/make/tests/variables/t0/test.t Modified: head/etc/mtree/BSD.tests.dist head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/make/Makefile head/usr.bin/make/tests/README head/usr.bin/make/tests/common.sh Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Wed Mar 19 12:06:51 2014 (r263345) +++ head/etc/mtree/BSD.tests.dist Wed Mar 19 12:29:20 2014 (r263346) @@ -111,6 +111,104 @@ .. m4 .. + make + archives + fmt_44bsd + .. + fmt_44bsd_mod + .. + fmt_oldbsd + .. + .. + basic + t0 + .. + t1 + .. + t2 + .. + t3 + .. + .. + execution + ellipsis + .. + empty + .. + joberr + .. + plus + .. + .. + shell + builtin + .. + meta + .. + path + .. + path_select + .. + replace + .. + select + .. + .. + suffixes + basic + .. + src_wild1 + .. + src_wild2 + .. + .. + syntax + directive-t0 + .. + enl + .. + funny-targets + .. + semi + .. + .. + sysmk + t0 + 2 + 1 + .. + .. + mk + .. + .. + t1 + 2 + 1 + .. + .. + mk + .. + .. + t2 + 2 + 1 + .. + .. + mk + .. + .. + .. + variables + modifier_M + .. + modifier_t + .. + opt_V + .. + t0 + .. + .. + .. ncal .. printf Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Mar 19 12:06:51 2014 (r263345) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Mar 19 12:29:20 2014 (r263346) @@ -4129,6 +4129,376 @@ OLD_FILES+=usr/tests/lib/atf/libatf-c/pr OLD_FILES+=usr/tests/lib/atf/libatf-c/sanity_test OLD_FILES+=usr/tests/lib/atf/libatf-c/text_test OLD_FILES+=usr/tests/lib/atf/libatf-c/user_test +.if ${MK_MAKE} == yes && ${MK_BMAKE} == yes +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.status.3 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.status.4 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.status.5 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.status.6 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.status.7 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stderr.3 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stderr.4 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stderr.5 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stderr.6 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stderr.7 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stdout.3 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stdout.4 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stdout.5 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stdout.6 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/expected.stdout.7 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/libtest.a +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.status.3 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.status.4 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.status.5 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.status.6 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.status.7 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.3 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.4 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.5 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.6 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stderr.7 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.3 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.4 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.5 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.6 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/expected.stdout.7 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod/libtest.a +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.status.3 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.status.4 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.status.5 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.status.6 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.status.7 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stderr.3 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stderr.4 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stderr.5 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stderr.6 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stderr.7 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stdout.3 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stdout.4 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stdout.5 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stdout.6 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/expected.stdout.7 +OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_oldbsd/libtest.a +OLD_FILES+=usr/tests/usr.bin/make/archives/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/basic/t0/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/basic/t0/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/basic/t0/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t0/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t0/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t1/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/basic/t1/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/basic/t1/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/basic/t1/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t1/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t1/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t2/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/basic/t2/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/basic/t2/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/basic/t2/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t2/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t2/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t3/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/basic/t3/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/basic/t3/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t3/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/t3/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/basic/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/execution/ellipsis/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/execution/ellipsis/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/execution/ellipsis/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/execution/ellipsis/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/ellipsis/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/ellipsis/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/empty/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/execution/empty/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/execution/empty/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/execution/empty/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/empty/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/empty/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/joberr/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/execution/joberr/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/execution/joberr/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/execution/joberr/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/joberr/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/joberr/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/plus/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/execution/plus/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/execution/plus/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/execution/plus/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/plus/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/plus/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/execution/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/builtin/sh +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/meta/sh +OLD_FILES+=usr/tests/usr.bin/make/shell/path/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/shell/path/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/shell/path/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/shell/path/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/path/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/path/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/path/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/path/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/path/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/path/sh +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/path_select/shell +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/replace/shell +OLD_FILES+=usr/tests/usr.bin/make/shell/select/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/shell/select/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/shell/select/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/shell/select/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/select/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/select/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/select/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/select/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/shell/select/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/shell/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/suffixes/basic/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/suffixes/basic/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/suffixes/basic/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/suffixes/basic/TEST1.a +OLD_FILES+=usr/tests/usr.bin/make/suffixes/basic/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/suffixes/basic/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/suffixes/basic/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild1/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild1/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild1/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild1/TEST1.a +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild1/TEST2.a +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild1/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild1/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild1/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild2/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild2/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild2/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild2/TEST1.a +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild2/TEST2.a +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild2/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild2/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/suffixes/src_wild2/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/suffixes/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/syntax/directive-t0/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/syntax/directive-t0/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/syntax/directive-t0/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/syntax/directive-t0/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/directive-t0/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/directive-t0/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.status.3 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.status.4 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.status.5 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stderr.3 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stderr.4 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stderr.5 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stdout.3 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stdout.4 +OLD_FILES+=usr/tests/usr.bin/make/syntax/enl/expected.stdout.5 +OLD_FILES+=usr/tests/usr.bin/make/syntax/funny-targets/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/syntax/funny-targets/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/syntax/funny-targets/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/syntax/funny-targets/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/funny-targets/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/syntax/funny-targets/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/funny-targets/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/syntax/funny-targets/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/funny-targets/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/syntax/semi/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/syntax/semi/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/syntax/semi/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/syntax/semi/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/semi/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/syntax/semi/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/semi/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/syntax/semi/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/syntax/semi/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/syntax/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/2/1/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/2/1/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/2/1/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/2/1/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/2/1/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/2/1/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/2/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/mk/sys.mk +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/mk/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t0/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/2/1/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/2/1/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/2/1/cleanup +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/2/1/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/2/1/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/2/1/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/2/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/mk/sys.mk +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/mk/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t1/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/2/1/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/2/1/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/2/1/cleanup +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/2/1/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/2/1/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/2/1/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/2/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/mk/sys.mk +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/mk/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/t2/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/sysmk/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_M/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_M/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_M/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_M/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_M/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_M/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/expected.status.3 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/expected.stderr.3 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/variables/modifier_t/expected.stdout.3 +OLD_FILES+=usr/tests/usr.bin/make/variables/opt_V/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/variables/opt_V/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/variables/opt_V/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/variables/opt_V/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/opt_V/expected.status.2 +OLD_FILES+=usr/tests/usr.bin/make/variables/opt_V/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/opt_V/expected.stderr.2 +OLD_FILES+=usr/tests/usr.bin/make/variables/opt_V/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/opt_V/expected.stdout.2 +OLD_FILES+=usr/tests/usr.bin/make/variables/t0/legacy_test +OLD_FILES+=usr/tests/usr.bin/make/variables/t0/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/variables/t0/Makefile.test +OLD_FILES+=usr/tests/usr.bin/make/variables/t0/expected.status.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/t0/expected.stderr.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/t0/expected.stdout.1 +OLD_FILES+=usr/tests/usr.bin/make/variables/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/Kyuafile +OLD_FILES+=usr/tests/usr.bin/make/common.sh +OLD_FILES+=usr/tests/usr.bin/make/test-new.mk +OLD_DIRS+=usr/tests/usr.bin/make/variables/t0 +OLD_DIRS+=usr/tests/usr.bin/make/variables/opt_V +OLD_DIRS+=usr/tests/usr.bin/make/variables/modifier_t +OLD_DIRS+=usr/tests/usr.bin/make/variables/modifier_M +OLD_DIRS+=usr/tests/usr.bin/make/variables +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t2/mk +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t2/2/1 +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t2/2 +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t2 +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t1/mk +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t1/2/1 +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t1/2 +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t1 +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t0/mk +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t0/2/1 +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t0/2 +OLD_DIRS+=usr/tests/usr.bin/make/sysmk/t0 +OLD_DIRS+=usr/tests/usr.bin/make/sysmk +OLD_DIRS+=usr/tests/usr.bin/make/syntax/semi +OLD_DIRS+=usr/tests/usr.bin/make/syntax/funny-targets +OLD_DIRS+=usr/tests/usr.bin/make/syntax/enl +OLD_DIRS+=usr/tests/usr.bin/make/syntax/directive-t0 +OLD_DIRS+=usr/tests/usr.bin/make/syntax +OLD_DIRS+=usr/tests/usr.bin/make/suffixes/src_wild2 +OLD_DIRS+=usr/tests/usr.bin/make/suffixes/src_wild1 +OLD_DIRS+=usr/tests/usr.bin/make/suffixes/basic +OLD_DIRS+=usr/tests/usr.bin/make/suffixes +OLD_DIRS+=usr/tests/usr.bin/make/shell/select +OLD_DIRS+=usr/tests/usr.bin/make/shell/replace +OLD_DIRS+=usr/tests/usr.bin/make/shell/path_select +OLD_DIRS+=usr/tests/usr.bin/make/shell/path +OLD_DIRS+=usr/tests/usr.bin/make/shell/meta +OLD_DIRS+=usr/tests/usr.bin/make/shell/builtin +OLD_DIRS+=usr/tests/usr.bin/make/shell +OLD_DIRS+=usr/tests/usr.bin/make/execution/plus +OLD_DIRS+=usr/tests/usr.bin/make/execution/joberr +OLD_DIRS+=usr/tests/usr.bin/make/execution/empty +OLD_DIRS+=usr/tests/usr.bin/make/execution/ellipsis +OLD_DIRS+=usr/tests/usr.bin/make/execution +OLD_DIRS+=usr/tests/usr.bin/make/basic/t3 +OLD_DIRS+=usr/tests/usr.bin/make/basic/t2 +OLD_DIRS+=usr/tests/usr.bin/make/basic/t1 +OLD_DIRS+=usr/tests/usr.bin/make/basic/t0 +OLD_DIRS+=usr/tests/usr.bin/make/basic +OLD_DIRS+=usr/tests/usr.bin/make/archives/fmt_oldbsd +OLD_DIRS+=usr/tests/usr.bin/make/archives/fmt_44bsd_mod +OLD_DIRS+=usr/tests/usr.bin/make/archives/fmt_44bsd +OLD_DIRS+=usr/tests/usr.bin/make/archives +OLD_DIRS+=usr/tests/usr.bin/make +.endif .else # ATF libraries. OLD_FILES+=usr/bin/atf-sh Modified: head/usr.bin/make/Makefile ============================================================================== --- head/usr.bin/make/Makefile Wed Mar 19 12:06:51 2014 (r263345) +++ head/usr.bin/make/Makefile Wed Mar 19 12:29:20 2014 (r263346) @@ -118,4 +118,8 @@ fmake.1: make.1 cp ${.ALLSRC} ${.TARGET} .endif +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: head/usr.bin/make/tests/README ============================================================================== --- head/tools/regression/usr.bin/make/README Sun Mar 16 08:04:06 2014 (r263227) +++ head/usr.bin/make/tests/README Wed Mar 19 12:29:20 2014 (r263346) @@ -2,9 +2,7 @@ $FreeBSD$ This directory contains regression tests for make(1). -To invoke the tests install prove(1) from ports/devel/p5-Test-Harness and -run 'prove -r'. Alternatively one can use 'sh ./all.sh test' and scan the -output for '^not ok'. +To invoke the tests, please refer to tests(7). ---------------------------------------------------------------------------- Copied: head/usr.bin/make/tests/archives/fmt_44bsd/Makefile.test (from r263227, head/tools/regression/usr.bin/make/archives/fmt_44bsd/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/archives/fmt_44bsd/Makefile.test Wed Mar 19 12:29:20 2014 (r263346, copy of r263227, head/tools/regression/usr.bin/make/archives/fmt_44bsd/Makefile) @@ -0,0 +1,61 @@ +# $FreeBSD$ +# This test checks the code reading archive files. The archive file +# is a BSD4.4 file with __.SYMTAB and #1/N long file names. + +############################################################################# + +# should be ok +test1: libtest.a(short.o) + @: + +libtest.a(short.o): ood + @: + +############################################################################# + +# should be ok +test2: libtest.a(exactly15char.o) + @: + +libtest.a(exactly15char.o): ood + @: + +############################################################################# + +# should be ok +test3: libtest.a(exactly16chars.o) + @: + +libtest.a(exactly16chars.o): ood + @: + +############################################################################# + +# should be ok +test4: libtest.a(verylongobjectname.o) + @: + +libtest.a(verylongobjectname.o): ood + @: + +############################################################################# + +# Truncated to 16 characters +# should fail +test5: libtest.a(verylongobjectna) + @: + +############################################################################# + +# Truncated to 15 characters +# should fail +test6: libtest.a(verylongobjectn) + @: + +############################################################################# + +# should fail +test7: libtest.a(\#1/20) + @: + +ood: Copied and modified: head/usr.bin/make/tests/archives/fmt_44bsd/legacy_test.sh (from r263227, head/tools/regression/usr.bin/make/archives/fmt_44bsd/test.t) ============================================================================== --- head/tools/regression/usr.bin/make/archives/fmt_44bsd/test.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/usr.bin/make/tests/archives/fmt_44bsd/legacy_test.sh Wed Mar 19 12:29:20 2014 (r263346) @@ -1,9 +1,7 @@ -#!/bin/sh - +#! /bin/sh # $FreeBSD$ -cd `dirname $0` -. ../../common.sh +. $(dirname $0)/../../common.sh # Description DESC="Archive parsing (BSD4.4 format)." Copied: head/usr.bin/make/tests/archives/fmt_44bsd_mod/Makefile.test (from r263227, head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/archives/fmt_44bsd_mod/Makefile.test Wed Mar 19 12:29:20 2014 (r263346, copy of r263227, head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/Makefile) @@ -0,0 +1,64 @@ +# $FreeBSD$ +# This test checks the code reading archive files. The archive file +# is a BSD4.4 file with __.SYMTAB and #1/N long file names. +# +# The modification of the archive consists in slashes appended to short names. +# + +############################################################################# + +# must be ok +test1: libtest.a(short.o) + @: + +libtest.a(short.o): ood + @: + +############################################################################# + +# must be ok +test2: libtest.a(exactly15char.o) + @: + +libtest.a(exactly15char.o): ood + @: + +############################################################################# + +# must be ok +test3: libtest.a(exactly16chars.o) + @: + +libtest.a(exactly16chars.o): ood + @: + +############################################################################# + +# must be ok +test4: libtest.a(verylongobjectname.o) + @: + +libtest.a(verylongobjectname.o): ood + @: + +############################################################################# + +# Truncated to 16 characters +# must fail +test5: libtest.a(verylongobjectna) + @: + +############################################################################# + +# Truncated to 15 characters +# must fail +test6: libtest.a(verylongobjectn) + @: + +############################################################################# + +# must fail +test7: libtest.a(\#1/20) + @: + +ood: Copied and modified: head/usr.bin/make/tests/archives/fmt_44bsd_mod/legacy_test.sh (from r263227, head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/test.t) ============================================================================== --- head/tools/regression/usr.bin/make/archives/fmt_44bsd_mod/test.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/usr.bin/make/tests/archives/fmt_44bsd_mod/legacy_test.sh Wed Mar 19 12:29:20 2014 (r263346) @@ -1,9 +1,7 @@ -#!/bin/sh - +#! /bin/sh # $FreeBSD$ -cd `dirname $0` -. ../../common.sh +. $(dirname $0)/../../common.sh # Description DESC="Archive parsing (modified BSD4.4 format)." Copied: head/usr.bin/make/tests/archives/fmt_oldbsd/Makefile.test (from r263227, head/tools/regression/usr.bin/make/archives/fmt_oldbsd/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/archives/fmt_oldbsd/Makefile.test Wed Mar 19 12:29:20 2014 (r263346, copy of r263227, head/tools/regression/usr.bin/make/archives/fmt_oldbsd/Makefile) @@ -0,0 +1,62 @@ +# $FreeBSD$ +# This test checks the code reading archive files. The archive file +# is an old BSD file with __.SYMTAB and no long file names. Filenames +# are truncated to 16 characters. + +############################################################################# + +# must be ok +test1: libtest.a(short.o) + @: + +libtest.a(short.o): ood + @: + +############################################################################# + +# must be ok +test2: libtest.a(exactly15char.o) + @: + +libtest.a(exactly15char.o): ood + @: + +############################################################################# + +# must be ok +test3: libtest.a(exactly16chars.o) + @: + +libtest.a(exactly16chars.o): ood + @: + +############################################################################# + +# must be ok +test4: libtest.a(verylongobjectname.o) + @: + +libtest.a(verylongobjectname.o): ood + @: + +############################################################################# + +# Truncated to 16 characters +# must be ok +test5: libtest.a(verylongobjectna) + @: + +############################################################################# + +# Truncated to 15 characters +# must fail +test6: libtest.a(verylongobjectn) + @: + +############################################################################# + +# must fail +test7: libtest.a(\#1/20) + @: + +ood: Copied and modified: head/usr.bin/make/tests/archives/fmt_oldbsd/legacy_test.sh (from r263227, head/tools/regression/usr.bin/make/archives/fmt_oldbsd/test.t) ============================================================================== --- head/tools/regression/usr.bin/make/archives/fmt_oldbsd/test.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/usr.bin/make/tests/archives/fmt_oldbsd/legacy_test.sh Wed Mar 19 12:29:20 2014 (r263346) @@ -1,9 +1,7 @@ -#!/bin/sh - +#! /bin/sh # $FreeBSD$ -cd `dirname $0` -. ../../common.sh +. $(dirname $0)/../../common.sh # Description DESC="Archive parsing (old BSD format)." Copied and modified: head/usr.bin/make/tests/basic/t0/legacy_test.sh (from r263227, head/tools/regression/usr.bin/make/basic/t0/test.t) ============================================================================== --- head/tools/regression/usr.bin/make/basic/t0/test.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/usr.bin/make/tests/basic/t0/legacy_test.sh Wed Mar 19 12:29:20 2014 (r263346) @@ -1,9 +1,7 @@ -#!/bin/sh - +#! /bin/sh # $FreeBSD$ -cd `dirname $0` -. ../../common.sh +. $(dirname $0)/../../common.sh # Description DESC="An empty Makefile file and no target given." Copied: head/usr.bin/make/tests/basic/t1/Makefile.test (from r263227, head/tools/regression/usr.bin/make/basic/t1/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/basic/t1/Makefile.test Wed Mar 19 12:29:20 2014 (r263346, copy of r263227, head/tools/regression/usr.bin/make/basic/t1/Makefile) @@ -0,0 +1,5 @@ +# $FreeBSD$ +# +# Just a target and nothing else. No target on command line. +# +all: Copied and modified: head/usr.bin/make/tests/basic/t1/legacy_test.sh (from r263227, head/tools/regression/usr.bin/make/basic/t1/test.t) ============================================================================== --- head/tools/regression/usr.bin/make/basic/t1/test.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/usr.bin/make/tests/basic/t1/legacy_test.sh Wed Mar 19 12:29:20 2014 (r263346) @@ -1,9 +1,7 @@ -#!/bin/sh - +#! /bin/sh # $FreeBSD$ -cd `dirname $0` -. ../../common.sh +. $(dirname $0)/../../common.sh # Description DESC="A Makefile file with only a 'all:' file dependency specification." Copied: head/usr.bin/make/tests/basic/t2/Makefile.test (from r263227, head/tools/regression/usr.bin/make/basic/t2/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/basic/t2/Makefile.test Wed Mar 19 12:29:20 2014 (r263346, copy of r263227, head/tools/regression/usr.bin/make/basic/t2/Makefile) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# +# Just a target and a command. No command line targets. +# +all: + echo hello Copied and modified: head/usr.bin/make/tests/basic/t2/legacy_test.sh (from r263227, head/tools/regression/usr.bin/make/basic/t2/test.t) ============================================================================== --- head/tools/regression/usr.bin/make/basic/t2/test.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/usr.bin/make/tests/basic/t2/legacy_test.sh Wed Mar 19 12:29:20 2014 (r263346) @@ -1,9 +1,7 @@ -#!/bin/sh - +#! /bin/sh # $FreeBSD$ -cd `dirname $0` -. ../../common.sh +. $(dirname $0)/../../common.sh # Description DESC="A Makefile file with only a 'all:' file dependency specification, and shell command." Copied and modified: head/usr.bin/make/tests/basic/t3/legacy_test.sh (from r263227, head/tools/regression/usr.bin/make/basic/t3/test.t) ============================================================================== --- head/tools/regression/usr.bin/make/basic/t3/test.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/usr.bin/make/tests/basic/t3/legacy_test.sh Wed Mar 19 12:29:20 2014 (r263346) @@ -1,9 +1,7 @@ -#!/bin/sh - +#! /bin/sh # $FreeBSD$ -cd `dirname $0` -. ../../common.sh +. $(dirname $0)/../../common.sh # Description DESC="No Makefile file, no command line target." Modified: head/usr.bin/make/tests/common.sh ============================================================================== --- head/tools/regression/usr.bin/make/common.sh Sun Mar 16 08:04:06 2014 (r263227) +++ head/usr.bin/make/tests/common.sh Wed Mar 19 12:29:20 2014 (r263346) @@ -1,8 +1,6 @@ -#!/bin/sh +# $FreeBSD$ # # Common code used run regression tests for usr.bin/make. -# -# $FreeBSD$ # # Output a message and exit with an error. @@ -99,8 +97,8 @@ common_setup() # # If a Makefile exists in the source directory - copy it over # - if [ -e Makefile -a ! -e ${WORK_DIR}/Makefile ] ; then - cp Makefile ${WORK_DIR}/Makefile + if [ -e ${SRC_DIR}/Makefile.test -a ! -e ${WORK_DIR}/Makefile ] ; then + cp ${SRC_DIR}/Makefile.test ${WORK_DIR}/Makefile fi # @@ -123,10 +121,11 @@ common_setup() # set -- ${TEST_COPY_FILES} while [ $# -ne 0 ] ; do - if [ ! -e ${WORK_DIR}/${1} ] ; then - cp ${1} ${WORK_DIR}/${1} + local dstname="$(echo ${1} | sed -e 's,Makefile.test,Makefile,')" + if [ ! -e ${WORK_DIR}/${dstname} ] ; then + cp ${SRC_DIR}/${1} ${WORK_DIR}/${dstname} fi - chmod ${2} ${WORK_DIR}/${1} + chmod ${2} ${WORK_DIR}/${dstname} shift ; shift done @@ -338,23 +337,24 @@ eval_compare() else eval skip=\${TEST_${N}_SKIP} fi + msg= if [ ! -z "$fail" ]; then - echo -n "not " + msg="${msg}not " fi - echo -n "ok ${N} ${SUBDIR}/${N}" + msg="${msg}ok ${N} ${SUBDIR}/${N}" if [ ! -z "$fail" -o ! -z "$todo" -o ! -z "$skip" ]; then - echo -n " # " + msg="${msg} # " fi if [ ! -z "$skip" ] ; then - echo -n "skip $skip; " + msg="${msg}skip ${skip}; " fi if [ ! -z "$todo" ] ; then - echo -n "TODO $todo; " + msg="${msg}TODO ${todo}; " fi if [ ! -z "$fail" ] ; then - echo "reason: ${fail}" + msg="${msg}reason: ${fail}" fi - echo + echo ${msg} N=$((N + 1)) done } @@ -368,11 +368,13 @@ eval_compare() do_compare() { local EXPECTED RESULT - EXPECTED="expected.$1.$2" + EXPECTED="${SRC_DIR}/expected.$1.$2" RESULT="${OUTPUT_DIR}/$1.$2" if [ -f $EXPECTED ]; then - diff -q $EXPECTED $RESULT 1>/dev/null 2>/dev/null + cat $RESULT | sed -e "s,^$(basename $MAKE_PROG):,make:," | \ + diff -u $EXPECTED - + #diff -q $EXPECTED - 1>/dev/null 2>/dev/null return $? else return 1 # FAIL @@ -412,7 +414,7 @@ eval_diff() do_diff() { local EXPECTED RESULT - EXPECTED="expected.$1.$2" + EXPECTED="${SRC_DIR}/expected.$1.$2" RESULT="${OUTPUT_DIR}/$1.$2" echo diff -u $EXPECTED $RESULT @@ -513,49 +515,16 @@ eval_cmd() # # -# Parse command line arguments. -# -args=`getopt m:w:v $*` -if [ $? != 0 ]; then - echo 'Usage: ...' - exit 2 -fi -set -- $args -for i; do - case "$i" in - -m) - MAKE_PROG="$2" - shift - shift - ;; - -w) - WORK_BASE="$2" - shift - shift - ;; - -v) - VERBOSE=1 - shift - ;; - --) - shift - break - ;; - esac -done - -# # Determine our sub-directory. Argh. # -SRC_DIR=`pwd` -SRC_BASE=`while [ ! -f common.sh ] ; do cd .. ; done ; pwd` +SRC_DIR=$(dirname $0) +SRC_BASE=`cd ${SRC_DIR} ; while [ ! -f common.sh ] ; do cd .. ; done ; pwd` SUBDIR=`echo ${SRC_DIR} | sed "s@${SRC_BASE}/@@"` # # Construct working directory # -WORK_BASE=${WORK_BASE:-"/tmp/$USER.make.test"} -WORK_DIR=${WORK_BASE}/${SUBDIR} +WORK_DIR=$(pwd)/work/${SUBDIR} OUTPUT_DIR=${WORK_DIR}.OUTPUT # Copied: head/usr.bin/make/tests/execution/ellipsis/Makefile.test (from r263227, head/tools/regression/usr.bin/make/execution/ellipsis/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/execution/ellipsis/Makefile.test Wed Mar 19 12:29:20 2014 (r263346, copy of r263227, head/tools/regression/usr.bin/make/execution/ellipsis/Makefile) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +ELLIPSIS= ... + +check-ellipsis: + @${MAKE} -f ${MAKEFILE} do-$@ + @${MAKE} -f ${MAKEFILE} -j2 do-$@ + @${MAKE} -f ${MAKEFILE} -j2 -B do-$@ + +do-check-ellipsis: do-check-ellipsis-1 do-check-ellipsis-2 +.ORDER: do-check-ellipsis-1 do-check-ellipsis-2 + +do-check-ellipsis-1: + @echo before $@ + ${ELLIPSIS} + @echo after $@ + +do-check-ellipsis-2: + @echo before $@ + ${ELLIPSIS} + @echo after $@ Copied and modified: head/usr.bin/make/tests/execution/ellipsis/legacy_test.sh (from r263227, head/tools/regression/usr.bin/make/execution/ellipsis/test.t) ============================================================================== --- head/tools/regression/usr.bin/make/execution/ellipsis/test.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/usr.bin/make/tests/execution/ellipsis/legacy_test.sh Wed Mar 19 12:29:20 2014 (r263346) @@ -1,9 +1,7 @@ -#!/bin/sh - +#! /bin/sh # $FreeBSD$ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 12:33:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 272A263F; Wed, 19 Mar 2014 12:33:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1075CF6D; Wed, 19 Mar 2014 12:33:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JCX1FF028233; Wed, 19 Mar 2014 12:33:01 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JCWoal028107; Wed, 19 Mar 2014 12:32:50 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403191232.s2JCWoal028107@svn.freebsd.org> From: Julio Merino Date: Wed, 19 Mar 2014 12:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263348 - in head/usr.bin/make/tests: . archives archives/fmt_44bsd archives/fmt_44bsd_mod archives/fmt_oldbsd basic basic/t0 basic/t1 basic/t2 basic/t3 execution execution/ellipsis exe... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 12:33:01 -0000 Author: jmmv Date: Wed Mar 19 12:32:50 2014 New Revision: 263348 URL: http://svnweb.freebsd.org/changeset/base/263348 Log: Add Makefiles missed in r263346. Grrr, I wish svn clearly displayed files not yet added when about to commit. Added: head/usr.bin/make/tests/Makefile (contents, props changed) head/usr.bin/make/tests/archives/Makefile (contents, props changed) head/usr.bin/make/tests/archives/fmt_44bsd/Makefile (contents, props changed) head/usr.bin/make/tests/archives/fmt_44bsd_mod/Makefile (contents, props changed) head/usr.bin/make/tests/archives/fmt_oldbsd/Makefile (contents, props changed) head/usr.bin/make/tests/basic/Makefile (contents, props changed) head/usr.bin/make/tests/basic/t0/Makefile (contents, props changed) head/usr.bin/make/tests/basic/t1/Makefile (contents, props changed) head/usr.bin/make/tests/basic/t2/Makefile (contents, props changed) head/usr.bin/make/tests/basic/t3/Makefile (contents, props changed) head/usr.bin/make/tests/execution/Makefile (contents, props changed) head/usr.bin/make/tests/execution/ellipsis/Makefile (contents, props changed) head/usr.bin/make/tests/execution/empty/Makefile (contents, props changed) head/usr.bin/make/tests/execution/joberr/Makefile (contents, props changed) head/usr.bin/make/tests/execution/plus/Makefile (contents, props changed) head/usr.bin/make/tests/shell/Makefile (contents, props changed) head/usr.bin/make/tests/shell/builtin/Makefile (contents, props changed) head/usr.bin/make/tests/shell/meta/Makefile (contents, props changed) head/usr.bin/make/tests/shell/path/Makefile (contents, props changed) head/usr.bin/make/tests/shell/path_select/Makefile (contents, props changed) head/usr.bin/make/tests/shell/replace/Makefile (contents, props changed) head/usr.bin/make/tests/shell/select/Makefile (contents, props changed) head/usr.bin/make/tests/suffixes/Makefile (contents, props changed) head/usr.bin/make/tests/suffixes/basic/Makefile (contents, props changed) head/usr.bin/make/tests/suffixes/src_wild1/Makefile (contents, props changed) head/usr.bin/make/tests/suffixes/src_wild2/Makefile (contents, props changed) head/usr.bin/make/tests/syntax/Makefile (contents, props changed) head/usr.bin/make/tests/syntax/directive-t0/Makefile (contents, props changed) head/usr.bin/make/tests/syntax/enl/Makefile (contents, props changed) head/usr.bin/make/tests/syntax/funny-targets/Makefile (contents, props changed) head/usr.bin/make/tests/syntax/semi/Makefile (contents, props changed) head/usr.bin/make/tests/sysmk/Makefile (contents, props changed) head/usr.bin/make/tests/sysmk/t0/2/1/Makefile (contents, props changed) head/usr.bin/make/tests/sysmk/t0/2/Makefile (contents, props changed) head/usr.bin/make/tests/sysmk/t0/Makefile (contents, props changed) head/usr.bin/make/tests/sysmk/t0/mk/Makefile (contents, props changed) head/usr.bin/make/tests/sysmk/t1/2/1/Makefile (contents, props changed) head/usr.bin/make/tests/sysmk/t1/2/Makefile (contents, props changed) head/usr.bin/make/tests/sysmk/t1/Makefile (contents, props changed) head/usr.bin/make/tests/sysmk/t1/mk/Makefile (contents, props changed) head/usr.bin/make/tests/sysmk/t2/2/1/Makefile (contents, props changed) head/usr.bin/make/tests/sysmk/t2/2/Makefile (contents, props changed) head/usr.bin/make/tests/sysmk/t2/Makefile (contents, props changed) head/usr.bin/make/tests/sysmk/t2/mk/Makefile (contents, props changed) head/usr.bin/make/tests/variables/Makefile (contents, props changed) head/usr.bin/make/tests/variables/modifier_M/Makefile (contents, props changed) head/usr.bin/make/tests/variables/modifier_t/Makefile (contents, props changed) head/usr.bin/make/tests/variables/opt_V/Makefile (contents, props changed) head/usr.bin/make/tests/variables/t0/Makefile (contents, props changed) Added: head/usr.bin/make/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,18 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make + +FILESDIR= ${TESTSDIR} +FILES= common.sh +FILES+= test-new.mk + +TESTS_SUBDIRS= archives +TESTS_SUBDIRS+= basic +TESTS_SUBDIRS+= execution +TESTS_SUBDIRS+= shell +TESTS_SUBDIRS+= suffixes +TESTS_SUBDIRS+= syntax +TESTS_SUBDIRS+= sysmk +TESTS_SUBDIRS+= variables + +.include Added: head/usr.bin/make/tests/archives/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/archives/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/archives + +TESTS_SUBDIRS= fmt_44bsd fmt_44bsd_mod fmt_oldbsd + +.include Added: head/usr.bin/make/tests/archives/fmt_44bsd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/archives/fmt_44bsd/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,32 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/archives/fmt_44bsd + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.status.2 +FILES+= expected.status.3 +FILES+= expected.status.4 +FILES+= expected.status.5 +FILES+= expected.status.6 +FILES+= expected.status.7 +FILES+= expected.stderr.1 +FILES+= expected.stderr.2 +FILES+= expected.stderr.3 +FILES+= expected.stderr.4 +FILES+= expected.stderr.5 +FILES+= expected.stderr.6 +FILES+= expected.stderr.7 +FILES+= expected.stdout.1 +FILES+= expected.stdout.2 +FILES+= expected.stdout.3 +FILES+= expected.stdout.4 +FILES+= expected.stdout.5 +FILES+= expected.stdout.6 +FILES+= expected.stdout.7 +FILES+= libtest.a + +.include Added: head/usr.bin/make/tests/archives/fmt_44bsd_mod/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/archives/fmt_44bsd_mod/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,32 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/archives/fmt_44bsd_mod + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.status.2 +FILES+= expected.status.3 +FILES+= expected.status.4 +FILES+= expected.status.5 +FILES+= expected.status.6 +FILES+= expected.status.7 +FILES+= expected.stderr.1 +FILES+= expected.stderr.2 +FILES+= expected.stderr.3 +FILES+= expected.stderr.4 +FILES+= expected.stderr.5 +FILES+= expected.stderr.6 +FILES+= expected.stderr.7 +FILES+= expected.stdout.1 +FILES+= expected.stdout.2 +FILES+= expected.stdout.3 +FILES+= expected.stdout.4 +FILES+= expected.stdout.5 +FILES+= expected.stdout.6 +FILES+= expected.stdout.7 +FILES+= libtest.a + +.include Added: head/usr.bin/make/tests/archives/fmt_oldbsd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/archives/fmt_oldbsd/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,32 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/archives/fmt_oldbsd + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.status.2 +FILES+= expected.status.3 +FILES+= expected.status.4 +FILES+= expected.status.5 +FILES+= expected.status.6 +FILES+= expected.status.7 +FILES+= expected.stderr.1 +FILES+= expected.stderr.2 +FILES+= expected.stderr.3 +FILES+= expected.stderr.4 +FILES+= expected.stderr.5 +FILES+= expected.stderr.6 +FILES+= expected.stderr.7 +FILES+= expected.stdout.1 +FILES+= expected.stdout.2 +FILES+= expected.stdout.3 +FILES+= expected.stdout.4 +FILES+= expected.stdout.5 +FILES+= expected.stdout.6 +FILES+= expected.stdout.7 +FILES+= libtest.a + +.include Added: head/usr.bin/make/tests/basic/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/basic/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/basic + +TESTS_SUBDIRS= t0 t1 t2 t3 + +.include Added: head/usr.bin/make/tests/basic/t0/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/basic/t0/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/basic/t0 + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= expected.status.1 +FILES+= expected.stderr.1 +FILES+= expected.stdout.1 + +.include Added: head/usr.bin/make/tests/basic/t1/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/basic/t1/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/basic/t1 + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.stderr.1 +FILES+= expected.stdout.1 + +.include Added: head/usr.bin/make/tests/basic/t2/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/basic/t2/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/basic/t2 + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.stderr.1 +FILES+= expected.stdout.1 + +.include Added: head/usr.bin/make/tests/basic/t3/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/basic/t3/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/basic/t3 + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= expected.status.1 +FILES+= expected.stderr.1 +FILES+= expected.stdout.1 + +.include Added: head/usr.bin/make/tests/execution/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/execution/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/execution + +TESTS_SUBDIRS= ellipsis empty joberr plus + +.include Added: head/usr.bin/make/tests/execution/ellipsis/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/execution/ellipsis/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/execution/ellipsis + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.stderr.1 +FILES+= expected.stdout.1 + +.include Added: head/usr.bin/make/tests/execution/empty/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/execution/empty/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/execution/empty + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.stderr.1 +FILES+= expected.stdout.1 + +.include Added: head/usr.bin/make/tests/execution/joberr/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/execution/joberr/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/execution/joberr + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.stderr.1 +FILES+= expected.stdout.1 + +.include Added: head/usr.bin/make/tests/execution/plus/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/execution/plus/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/execution/plus + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.stderr.1 +FILES+= expected.stdout.1 + +.include Added: head/usr.bin/make/tests/shell/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/shell/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/shell + +TESTS_SUBDIRS= builtin meta path path_select replace select + +.include Added: head/usr.bin/make/tests/shell/builtin/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/shell/builtin/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/shell/builtin + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.status.2 +FILES+= expected.stderr.1 +FILES+= expected.stderr.2 +FILES+= expected.stdout.1 +FILES+= expected.stdout.2 +FILES+= sh + +.include Added: head/usr.bin/make/tests/shell/meta/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/shell/meta/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/shell/meta + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.status.2 +FILES+= expected.stderr.1 +FILES+= expected.stderr.2 +FILES+= expected.stdout.1 +FILES+= expected.stdout.2 +FILES+= sh + +.include Added: head/usr.bin/make/tests/shell/path/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/shell/path/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/shell/path + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.status.2 +FILES+= expected.stderr.1 +FILES+= expected.stderr.2 +FILES+= expected.stdout.1 +FILES+= expected.stdout.2 +FILES+= sh + +.include Added: head/usr.bin/make/tests/shell/path_select/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/shell/path_select/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/shell/path_select + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.status.2 +FILES+= expected.stderr.1 +FILES+= expected.stderr.2 +FILES+= expected.stdout.1 +FILES+= expected.stdout.2 +FILES+= shell + +.include Added: head/usr.bin/make/tests/shell/replace/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/shell/replace/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/shell/replace + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.status.2 +FILES+= expected.stderr.1 +FILES+= expected.stderr.2 +FILES+= expected.stdout.1 +FILES+= expected.stdout.2 +FILES+= shell + +.include Added: head/usr.bin/make/tests/shell/select/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/shell/select/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/shell/select + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.status.2 +FILES+= expected.stderr.1 +FILES+= expected.stderr.2 +FILES+= expected.stdout.1 +FILES+= expected.stdout.2 + +.include Added: head/usr.bin/make/tests/suffixes/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/suffixes/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/suffixes + +TESTS_SUBDIRS= basic src_wild1 src_wild2 + +.include Added: head/usr.bin/make/tests/suffixes/basic/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/suffixes/basic/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/suffixes/basic + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= TEST1.a +FILES+= expected.status.1 +FILES+= expected.stderr.1 +FILES+= expected.stdout.1 + +.include Added: head/usr.bin/make/tests/suffixes/src_wild1/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/suffixes/src_wild1/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/suffixes/src_wild1 + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= TEST1.a +FILES+= TEST2.a +FILES+= expected.status.1 +FILES+= expected.stderr.1 +FILES+= expected.stdout.1 + +.include Added: head/usr.bin/make/tests/suffixes/src_wild2/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/suffixes/src_wild2/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/suffixes/src_wild2 + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= TEST1.a +FILES+= TEST2.a +FILES+= expected.status.1 +FILES+= expected.stderr.1 +FILES+= expected.stdout.1 + +.include Added: head/usr.bin/make/tests/syntax/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/syntax/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/syntax + +TESTS_SUBDIRS= directive-t0 enl funny-targets semi + +.include Added: head/usr.bin/make/tests/syntax/directive-t0/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/syntax/directive-t0/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/syntax/directive-t0 + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.stderr.1 +FILES+= expected.stdout.1 + +.include Added: head/usr.bin/make/tests/syntax/enl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/syntax/enl/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,25 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/syntax/enl + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.status.2 +FILES+= expected.status.3 +FILES+= expected.status.4 +FILES+= expected.status.5 +FILES+= expected.stderr.1 +FILES+= expected.stderr.2 +FILES+= expected.stderr.3 +FILES+= expected.stderr.4 +FILES+= expected.stderr.5 +FILES+= expected.stdout.1 +FILES+= expected.stdout.2 +FILES+= expected.stdout.3 +FILES+= expected.stdout.4 +FILES+= expected.stdout.5 + +.include Added: head/usr.bin/make/tests/syntax/funny-targets/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/syntax/funny-targets/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/syntax/funny-targets + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.status.2 +FILES+= expected.stderr.1 +FILES+= expected.stderr.2 +FILES+= expected.stdout.1 +FILES+= expected.stdout.2 + +.include Added: head/usr.bin/make/tests/syntax/semi/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/syntax/semi/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/syntax/semi + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.status.2 +FILES+= expected.stderr.1 +FILES+= expected.stderr.2 +FILES+= expected.stdout.1 +FILES+= expected.stdout.2 + +.include Added: head/usr.bin/make/tests/sysmk/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/sysmk/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk + +TESTS_SUBDIRS= t0 t1 t2 + +.include Added: head/usr.bin/make/tests/sysmk/t0/2/1/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/sysmk/t0/2/1/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t0/2/1 + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.stderr.1 +FILES+= expected.stdout.1 + +.include Added: head/usr.bin/make/tests/sysmk/t0/2/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/sysmk/t0/2/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t0/2 + +TESTS_SUBDIRS= 1 + +.include Added: head/usr.bin/make/tests/sysmk/t0/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/sysmk/t0/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t0 + +TESTS_SUBDIRS= 2 +SUBDIR= mk + +.include Added: head/usr.bin/make/tests/sysmk/t0/mk/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/sysmk/t0/mk/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t0/mk + +FILESDIR= ${TESTSDIR} +FILES= sys.mk.test +FILESNAME_sys.mk.test= sys.mk + +.include Added: head/usr.bin/make/tests/sysmk/t1/2/1/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/sysmk/t1/2/1/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t1/2/1 + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= cleanup +FILES+= expected.status.1 +FILES+= expected.stderr.1 +FILES+= expected.stdout.1 + +.include Added: head/usr.bin/make/tests/sysmk/t1/2/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/sysmk/t1/2/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t1/2 + +TESTS_SUBDIRS= 1 + +.include Added: head/usr.bin/make/tests/sysmk/t1/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/sysmk/t1/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t1 + +TESTS_SUBDIRS= 2 +SUBDIR= mk + +.include Added: head/usr.bin/make/tests/sysmk/t1/mk/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/sysmk/t1/mk/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t1/mk + +FILESDIR= ${TESTSDIR} +FILES= sys.mk.test +FILESNAME_sys.mk.test= sys.mk + +.include Added: head/usr.bin/make/tests/sysmk/t2/2/1/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/sysmk/t2/2/1/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t2/2/1 + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= cleanup +FILES+= expected.status.1 +FILES+= expected.stderr.1 +FILES+= expected.stdout.1 + +.include Added: head/usr.bin/make/tests/sysmk/t2/2/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/sysmk/t2/2/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t2/2 + +TESTS_SUBDIRS= 1 + +.include Added: head/usr.bin/make/tests/sysmk/t2/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/sysmk/t2/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t2 + +TESTS_SUBDIRS= 2 +SUBDIR= mk + +.include Added: head/usr.bin/make/tests/sysmk/t2/mk/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/sysmk/t2/mk/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t2/mk + +FILESDIR= ${TESTSDIR} +FILES= sys.mk.test +FILESNAME_sys.mk.test= sys.mk + +.include Added: head/usr.bin/make/tests/variables/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/variables/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/variables + +TESTS_SUBDIRS= modifier_M modifier_t opt_V t0 + +.include Added: head/usr.bin/make/tests/variables/modifier_M/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/variables/modifier_M/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/variables/modifier_M + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.stderr.1 +FILES+= expected.stdout.1 + +.include Added: head/usr.bin/make/tests/variables/modifier_t/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/variables/modifier_t/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,19 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/variables/modifier_t + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.status.2 +FILES+= expected.status.3 +FILES+= expected.stderr.1 +FILES+= expected.stderr.2 +FILES+= expected.stderr.3 +FILES+= expected.stdout.1 +FILES+= expected.stdout.2 +FILES+= expected.stdout.3 + +.include Added: head/usr.bin/make/tests/variables/opt_V/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/variables/opt_V/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/variables/opt_V + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.status.2 +FILES+= expected.stderr.1 +FILES+= expected.stderr.2 +FILES+= expected.stdout.1 +FILES+= expected.stdout.2 + +.include Added: head/usr.bin/make/tests/variables/t0/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/make/tests/variables/t0/Makefile Wed Mar 19 12:32:50 2014 (r263348) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/make/variables/t0 + +TAP_TESTS_SH= legacy_test + +FILESDIR= ${TESTSDIR} +FILES= Makefile.test +FILES+= expected.status.1 +FILES+= expected.stderr.1 +FILES+= expected.stdout.1 + +.include From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 12:35:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A58879A; Wed, 19 Mar 2014 12:35:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 46AE4F78; Wed, 19 Mar 2014 12:35:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JCZ5Sf028529; Wed, 19 Mar 2014 12:35:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JCZ4vv028522; Wed, 19 Mar 2014 12:35:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403191235.s2JCZ4vv028522@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 19 Mar 2014 12:35:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263349 - in head/sys: compat/freebsd32 kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 12:35:05 -0000 Author: kib Date: Wed Mar 19 12:35:04 2014 New Revision: 263349 URL: http://svnweb.freebsd.org/changeset/base/263349 Log: Make the array pointed to by AT_PAGESIZES auxv properly aligned. Also, remove the expression which calculated the location of the strings for a new image and grown over the time to be non-comprehensible. Instead, calculate the offsets by steps, which also makes fixing the alignments much cleaner. Reported and reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/kern_exec.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Wed Mar 19 12:32:50 2014 (r263348) +++ head/sys/compat/freebsd32/freebsd32_misc.c Wed Mar 19 12:35:04 2014 (r263349) @@ -2822,7 +2822,8 @@ freebsd32_copyout_strings(struct image_p { int argc, envc, i; u_int32_t *vectp; - char *stringp, *destp; + char *stringp; + uintptr_t destp; u_int32_t *stack_base; struct freebsd32_ps_strings *arginfo; char canary[sizeof(long) * 8]; @@ -2844,35 +2845,34 @@ freebsd32_copyout_strings(struct image_p szsigcode = *(imgp->proc->p_sysent->sv_szsigcode); else szsigcode = 0; - destp = (caddr_t)arginfo - szsigcode - SPARE_USRSPACE - - roundup(execpath_len, sizeof(char *)) - - roundup(sizeof(canary), sizeof(char *)) - - roundup(sizeof(pagesizes32), sizeof(char *)) - - roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); + destp = (uintptr_t)arginfo; /* * install sigcode */ - if (szsigcode != 0) - copyout(imgp->proc->p_sysent->sv_sigcode, - ((caddr_t)arginfo - szsigcode), szsigcode); + if (szsigcode != 0) { + destp -= szsigcode; + destp = rounddown2(destp, sizeof(uint32_t)); + copyout(imgp->proc->p_sysent->sv_sigcode, (void *)destp, + szsigcode); + } /* * Copy the image path for the rtld. */ if (execpath_len != 0) { - imgp->execpathp = (uintptr_t)arginfo - szsigcode - execpath_len; - copyout(imgp->execpath, (void *)imgp->execpathp, - execpath_len); + destp -= execpath_len; + imgp->execpathp = destp; + copyout(imgp->execpath, (void *)destp, execpath_len); } /* * Prepare the canary for SSP. */ arc4rand(canary, sizeof(canary), 0); - imgp->canary = (uintptr_t)arginfo - szsigcode - execpath_len - - sizeof(canary); - copyout(canary, (void *)imgp->canary, sizeof(canary)); + destp -= sizeof(canary); + imgp->canary = destp; + copyout(canary, (void *)destp, sizeof(canary)); imgp->canarylen = sizeof(canary); /* @@ -2880,11 +2880,15 @@ freebsd32_copyout_strings(struct image_p */ for (i = 0; i < MAXPAGESIZES; i++) pagesizes32[i] = (uint32_t)pagesizes[i]; - imgp->pagesizes = (uintptr_t)arginfo - szsigcode - execpath_len - - roundup(sizeof(canary), sizeof(char *)) - sizeof(pagesizes32); - copyout(pagesizes32, (void *)imgp->pagesizes, sizeof(pagesizes32)); + destp -= sizeof(pagesizes32); + destp = rounddown2(destp, sizeof(uint32_t)); + imgp->pagesizes = destp; + copyout(pagesizes32, (void *)destp, sizeof(pagesizes32)); imgp->pagesizeslen = sizeof(pagesizes32); + destp -= ARG_MAX - imgp->args->stringspace; + destp = rounddown2(destp, sizeof(uint32_t)); + /* * If we have a valid auxargs ptr, prepare some room * on the stack. @@ -2904,13 +2908,14 @@ freebsd32_copyout_strings(struct image_p vectp = (u_int32_t *) (destp - (imgp->args->argc + imgp->args->envc + 2 + imgp->auxarg_size + execpath_len) * sizeof(u_int32_t)); - } else + } else { /* * The '+ 2' is for the null pointers at the end of each of * the arg and env vector sets */ - vectp = (u_int32_t *) - (destp - (imgp->args->argc + imgp->args->envc + 2) * sizeof(u_int32_t)); + vectp = (u_int32_t *)(destp - (imgp->args->argc + + imgp->args->envc + 2) * sizeof(u_int32_t)); + } /* * vectp also becomes our initial stack base @@ -2923,7 +2928,7 @@ freebsd32_copyout_strings(struct image_p /* * Copy out strings - arguments and environment. */ - copyout(stringp, destp, ARG_MAX - imgp->args->stringspace); + copyout(stringp, (void *)destp, ARG_MAX - imgp->args->stringspace); /* * Fill in "ps_strings" struct for ps, w, etc. Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Wed Mar 19 12:32:50 2014 (r263348) +++ head/sys/kern/kern_exec.c Wed Mar 19 12:35:04 2014 (r263349) @@ -1231,7 +1231,8 @@ exec_copyout_strings(imgp) { int argc, envc; char **vectp; - char *stringp, *destp; + char *stringp; + uintptr_t destp; register_t *stack_base; struct ps_strings *arginfo; struct proc *p; @@ -1255,45 +1256,47 @@ exec_copyout_strings(imgp) if (p->p_sysent->sv_szsigcode != NULL) szsigcode = *(p->p_sysent->sv_szsigcode); } - destp = (caddr_t)arginfo - szsigcode - SPARE_USRSPACE - - roundup(execpath_len, sizeof(char *)) - - roundup(sizeof(canary), sizeof(char *)) - - roundup(szps, sizeof(char *)) - - roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); + destp = (uintptr_t)arginfo; /* * install sigcode */ - if (szsigcode != 0) - copyout(p->p_sysent->sv_sigcode, ((caddr_t)arginfo - - szsigcode), szsigcode); + if (szsigcode != 0) { + destp -= szsigcode; + destp = rounddown2(destp, sizeof(void *)); + copyout(p->p_sysent->sv_sigcode, (void *)destp, szsigcode); + } /* * Copy the image path for the rtld. */ if (execpath_len != 0) { - imgp->execpathp = (uintptr_t)arginfo - szsigcode - execpath_len; - copyout(imgp->execpath, (void *)imgp->execpathp, - execpath_len); + destp -= execpath_len; + imgp->execpathp = destp; + copyout(imgp->execpath, (void *)destp, execpath_len); } /* * Prepare the canary for SSP. */ arc4rand(canary, sizeof(canary), 0); - imgp->canary = (uintptr_t)arginfo - szsigcode - execpath_len - - sizeof(canary); - copyout(canary, (void *)imgp->canary, sizeof(canary)); + destp -= sizeof(canary); + imgp->canary = destp; + copyout(canary, (void *)destp, sizeof(canary)); imgp->canarylen = sizeof(canary); /* * Prepare the pagesizes array. */ - imgp->pagesizes = (uintptr_t)arginfo - szsigcode - execpath_len - - roundup(sizeof(canary), sizeof(char *)) - szps; - copyout(pagesizes, (void *)imgp->pagesizes, szps); + destp -= szps; + destp = rounddown2(destp, sizeof(void *)); + imgp->pagesizes = destp; + copyout(pagesizes, (void *)destp, szps); imgp->pagesizeslen = szps; + destp -= ARG_MAX - imgp->args->stringspace; + destp = rounddown2(destp, sizeof(void *)); + /* * If we have a valid auxargs ptr, prepare some room * on the stack. @@ -1318,8 +1321,8 @@ exec_copyout_strings(imgp) * The '+ 2' is for the null pointers at the end of each of * the arg and env vector sets */ - vectp = (char **)(destp - (imgp->args->argc + imgp->args->envc + 2) * - sizeof(char *)); + vectp = (char **)(destp - (imgp->args->argc + imgp->args->envc + + 2) * sizeof(char *)); } /* @@ -1334,7 +1337,7 @@ exec_copyout_strings(imgp) /* * Copy out strings - arguments and environment. */ - copyout(stringp, destp, ARG_MAX - imgp->args->stringspace); + copyout(stringp, (void *)destp, ARG_MAX - imgp->args->stringspace); /* * Fill in "ps_strings" struct for ps, w, etc. From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 12:45:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CAA78B47; Wed, 19 Mar 2014 12:45:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B5463BB; Wed, 19 Mar 2014 12:45:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JCjeR6032708; Wed, 19 Mar 2014 12:45:40 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JCjeJn032707; Wed, 19 Mar 2014 12:45:40 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201403191245.s2JCjeJn032707@svn.freebsd.org> From: Attilio Rao Date: Wed, 19 Mar 2014 12:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263350 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 12:45:40 -0000 Author: attilio Date: Wed Mar 19 12:45:40 2014 New Revision: 263350 URL: http://svnweb.freebsd.org/changeset/base/263350 Log: Fix comments. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Wed Mar 19 12:35:04 2014 (r263349) +++ head/sys/kern/kern_umtx.c Wed Mar 19 12:45:40 2014 (r263350) @@ -3115,12 +3115,12 @@ static _umtx_op_func op_table[] = { __umtx_op_rw_unlock, /* UMTX_OP_RW_UNLOCK */ __umtx_op_wait_uint_private, /* UMTX_OP_WAIT_UINT_PRIVATE */ __umtx_op_wake_private, /* UMTX_OP_WAKE_PRIVATE */ - __umtx_op_wait_umutex, /* UMTX_OP_UMUTEX_WAIT */ - __umtx_op_wake_umutex, /* UMTX_OP_UMUTEX_WAKE */ + __umtx_op_wait_umutex, /* UMTX_OP_MUTEX_WAIT */ + __umtx_op_wake_umutex, /* UMTX_OP_MUTEX_WAKE */ __umtx_op_sem_wait, /* UMTX_OP_SEM_WAIT */ __umtx_op_sem_wake, /* UMTX_OP_SEM_WAKE */ __umtx_op_nwake_private, /* UMTX_OP_NWAKE_PRIVATE */ - __umtx_op_wake2_umutex /* UMTX_OP_UMUTEX_WAKE2 */ + __umtx_op_wake2_umutex /* UMTX_OP_MUTEX_WAKE2 */ }; int @@ -3381,12 +3381,12 @@ static _umtx_op_func op_table_compat32[] __umtx_op_rw_unlock, /* UMTX_OP_RW_UNLOCK */ __umtx_op_wait_uint_private_compat32, /* UMTX_OP_WAIT_UINT_PRIVATE */ __umtx_op_wake_private, /* UMTX_OP_WAKE_PRIVATE */ - __umtx_op_wait_umutex_compat32, /* UMTX_OP_UMUTEX_WAIT */ - __umtx_op_wake_umutex, /* UMTX_OP_UMUTEX_WAKE */ + __umtx_op_wait_umutex_compat32, /* UMTX_OP_MUTEX_WAIT */ + __umtx_op_wake_umutex, /* UMTX_OP_MUTEX_WAKE */ __umtx_op_sem_wait_compat32, /* UMTX_OP_SEM_WAIT */ __umtx_op_sem_wake, /* UMTX_OP_SEM_WAKE */ __umtx_op_nwake_private32, /* UMTX_OP_NWAKE_PRIVATE */ - __umtx_op_wake2_umutex /* UMTX_OP_UMUTEX_WAKE2 */ + __umtx_op_wake2_umutex /* UMTX_OP_MUTEX_WAKE2 */ }; int From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 12:46:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E0D57C8F; Wed, 19 Mar 2014 12:46:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CAA24C0; Wed, 19 Mar 2014 12:46:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JCkBYi032847; Wed, 19 Mar 2014 12:46:11 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JCk5JQ032802; Wed, 19 Mar 2014 12:46:05 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403191246.s2JCk5JQ032802@svn.freebsd.org> From: Julio Merino Date: Wed, 19 Mar 2014 12:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263351 - in head: bin/pkill bin/pkill/tests etc/mtree tools/regression/usr.bin/pkill X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 12:46:12 -0000 Author: jmmv Date: Wed Mar 19 12:46:04 2014 New Revision: 263351 URL: http://svnweb.freebsd.org/changeset/base/263351 Log: Migrate tools/regression/usr.bin/pkill to the new tests layout. Interestingly, the pkill tool lives in bin, not usr.bin. Haven't bothered to check if this is because the tool moved or because the tests were originally added in the wrong place. Added: head/bin/pkill/tests/ - copied from r263227, head/tools/regression/usr.bin/pkill/ head/bin/pkill/tests/Makefile (contents, props changed) head/bin/pkill/tests/pgrep-F_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pgrep-F.t head/bin/pkill/tests/pgrep-LF_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pgrep-LF.t head/bin/pkill/tests/pgrep-P_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pgrep-P.t head/bin/pkill/tests/pgrep-U_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pgrep-U.t head/bin/pkill/tests/pgrep-_g_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pgrep-_g.t head/bin/pkill/tests/pgrep-_s_test.sh - copied unchanged from r263227, head/tools/regression/usr.bin/pkill/pgrep-_s.t head/bin/pkill/tests/pgrep-g_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pgrep-g.t head/bin/pkill/tests/pgrep-i_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pgrep-i.t head/bin/pkill/tests/pgrep-j_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pgrep-j.t head/bin/pkill/tests/pgrep-l_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pgrep-l.t head/bin/pkill/tests/pgrep-n_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pgrep-n.t head/bin/pkill/tests/pgrep-o_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pgrep-o.t head/bin/pkill/tests/pgrep-q_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pgrep-q.t head/bin/pkill/tests/pgrep-s_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pgrep-s.t head/bin/pkill/tests/pgrep-t_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pgrep-t.t head/bin/pkill/tests/pgrep-v_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pgrep-v.t head/bin/pkill/tests/pgrep-x_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pgrep-x.t head/bin/pkill/tests/pkill-F_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pkill-F.t head/bin/pkill/tests/pkill-LF_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pkill-LF.t head/bin/pkill/tests/pkill-P_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pkill-P.t head/bin/pkill/tests/pkill-U_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pkill-U.t head/bin/pkill/tests/pkill-_g_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pkill-_g.t head/bin/pkill/tests/pkill-g_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pkill-g.t head/bin/pkill/tests/pkill-i_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pkill-i.t head/bin/pkill/tests/pkill-j_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pkill-j.t head/bin/pkill/tests/pkill-s_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pkill-s.t head/bin/pkill/tests/pkill-t_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pkill-t.t head/bin/pkill/tests/pkill-x_test.sh - copied, changed from r263227, head/tools/regression/usr.bin/pkill/pkill-x.t Deleted: head/bin/pkill/tests/pgrep-F.t head/bin/pkill/tests/pgrep-LF.t head/bin/pkill/tests/pgrep-P.t head/bin/pkill/tests/pgrep-U.t head/bin/pkill/tests/pgrep-_g.t head/bin/pkill/tests/pgrep-_s.t head/bin/pkill/tests/pgrep-g.t head/bin/pkill/tests/pgrep-i.t head/bin/pkill/tests/pgrep-j.t head/bin/pkill/tests/pgrep-l.t head/bin/pkill/tests/pgrep-n.t head/bin/pkill/tests/pgrep-o.t head/bin/pkill/tests/pgrep-q.t head/bin/pkill/tests/pgrep-s.t head/bin/pkill/tests/pgrep-t.t head/bin/pkill/tests/pgrep-v.t head/bin/pkill/tests/pgrep-x.t head/bin/pkill/tests/pkill-F.t head/bin/pkill/tests/pkill-LF.t head/bin/pkill/tests/pkill-P.t head/bin/pkill/tests/pkill-U.t head/bin/pkill/tests/pkill-_g.t head/bin/pkill/tests/pkill-g.t head/bin/pkill/tests/pkill-i.t head/bin/pkill/tests/pkill-j.t head/bin/pkill/tests/pkill-s.t head/bin/pkill/tests/pkill-t.t head/bin/pkill/tests/pkill-x.t head/tools/regression/usr.bin/pkill/ Modified: head/bin/pkill/Makefile head/etc/mtree/BSD.tests.dist Modified: head/bin/pkill/Makefile ============================================================================== --- head/bin/pkill/Makefile Wed Mar 19 12:45:40 2014 (r263350) +++ head/bin/pkill/Makefile Wed Mar 19 12:46:04 2014 (r263351) @@ -1,6 +1,8 @@ # $NetBSD: Makefile,v 1.1 2002/03/01 11:21:58 ad Exp $ # $FreeBSD$ +.include + PROG= pkill DPADD= ${LIBKVM} @@ -17,4 +19,8 @@ MLINKS= pkill.1 pgrep.1 SYMLINKS= ${BINDIR}/pkill /usr/bin/pkill SYMLINKS+= ${BINDIR}/pgrep /usr/bin/pgrep +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/bin/pkill/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/pkill/tests/Makefile Wed Mar 19 12:46:04 2014 (r263351) @@ -0,0 +1,38 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/bin/pkill + +TAP_TESTS_SH= pgrep-F_test +TAP_TESTS_SH+= pgrep-LF_test +TAP_TESTS_SH+= pgrep-P_test +TAP_TESTS_SH+= pgrep-U_test +TAP_TESTS_SH+= pgrep-_g_test +TAP_TESTS_SH+= pgrep-_s_test +TAP_TESTS_SH+= pgrep-g_test +TAP_TESTS_SH+= pgrep-i_test +TAP_TESTS_SH+= pgrep-j_test +TEST_METADATA.pgrep-j_test+= required_user="root" +TAP_TESTS_SH+= pgrep-l_test +TAP_TESTS_SH+= pgrep-n_test +TAP_TESTS_SH+= pgrep-o_test +TAP_TESTS_SH+= pgrep-q_test +TAP_TESTS_SH+= pgrep-s_test +TAP_TESTS_SH+= pgrep-t_test +TAP_TESTS_SH+= pgrep-v_test +TAP_TESTS_SH+= pgrep-x_test +TAP_TESTS_SH+= pkill-F_test +TAP_TESTS_SH+= pkill-LF_test +TAP_TESTS_SH+= pkill-P_test +TAP_TESTS_SH+= pkill-U_test +TAP_TESTS_SH+= pkill-_g_test +TAP_TESTS_SH+= pkill-g_test +TAP_TESTS_SH+= pkill-i_test +TAP_TESTS_SH+= pkill-j_test +TEST_METADATA.pkill-j_test+= required_user="root" +TAP_TESTS_SH+= pkill-s_test +TAP_TESTS_SH+= pkill-t_test +TAP_TESTS_SH+= pkill-x_test + +.include Copied and modified: head/bin/pkill/tests/pgrep-F_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pgrep-F.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pgrep-F.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pgrep-F_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -6,8 +6,8 @@ base=`basename $0` echo "1..1" name="pgrep -F " -pidfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +pidfile=$(pwd)/pidfile.txt +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 Copied and modified: head/bin/pkill/tests/pgrep-LF_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pgrep-LF.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pgrep-LF.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pgrep-LF_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -6,8 +6,8 @@ base=`basename $0` echo "1..2" name="pgrep -LF " -pidfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +pidfile=$(pwd)/pidfile.txt +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep daemon -p $pidfile $sleep 5 sleep 0.3 Copied and modified: head/bin/pkill/tests/pgrep-P_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pgrep-P.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pgrep-P.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pgrep-P_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -7,7 +7,7 @@ echo "1..1" name="pgrep -P " ppid=$$ -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 Copied and modified: head/bin/pkill/tests/pgrep-U_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pgrep-U.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pgrep-U.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pgrep-U_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -7,7 +7,7 @@ echo "1..2" name="pgrep -U " ruid=`id -ur` -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 @@ -23,7 +23,7 @@ rm -f $sleep name="pgrep -U " ruid=`id -urn` -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 Copied and modified: head/bin/pkill/tests/pgrep-_g_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pgrep-_g.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pgrep-_g.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pgrep-_g_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -7,7 +7,7 @@ echo "1..2" name="pgrep -G " rgid=`id -gr` -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 @@ -23,7 +23,7 @@ rm -f $sleep name="pgrep -G " rgid=`id -grn` -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 Copied: head/bin/pkill/tests/pgrep-_s_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pgrep-_s.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/pkill/tests/pgrep-_s_test.sh Wed Mar 19 12:46:04 2014 (r263351, copy of r263227, head/tools/regression/usr.bin/pkill/pgrep-_s.t) @@ -0,0 +1,22 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` + +echo "1..2" + +exp_pid="$(ps ax | grep '\[idle\]' | awk '{print $1}')" + +name="pgrep -S" +pid=`pgrep -Sx idle` +if [ "$pid" = "$exp_pid" ]; then + echo "ok 1 - $name" +else + echo "not ok 1 - $name" +fi +pid=`pgrep -x idle` +if [ "$pid" != "$exp_pid" ]; then + echo "ok 2 - $name" +else + echo "not ok 2 - $name" +fi Copied and modified: head/bin/pkill/tests/pgrep-g_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pgrep-g.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pgrep-g.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pgrep-g_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -7,7 +7,7 @@ echo "1..2" name="pgrep -g " pgrp=`ps -o tpgid -p $$ | tail -1` -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 @@ -22,7 +22,7 @@ kill $chpid rm -f $sleep name="pgrep -g 0" -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 Copied and modified: head/bin/pkill/tests/pgrep-i_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pgrep-i.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pgrep-i.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pgrep-i_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -6,7 +6,7 @@ base=`basename $0` echo "1..1" name="pgrep -i" -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt usleep="${sleep}XXX" touch $usleep lsleep="${sleep}xxx" Copied and modified: head/bin/pkill/tests/pgrep-j_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pgrep-j.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pgrep-j.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pgrep-j_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -7,7 +7,7 @@ echo "1..3" name="pgrep -j " if [ `id -u` -eq 0 ]; then - sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 + sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep jail / $base-1 127.0.0.1 $sleep 5 & chpid=$! @@ -31,7 +31,7 @@ fi name="pgrep -j any" if [ `id -u` -eq 0 ]; then - sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 + sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep jail / $base-1 127.0.0.1 $sleep 5 & chpid=$! @@ -55,7 +55,7 @@ fi name="pgrep -j none" if [ `id -u` -eq 0 ]; then - sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 + sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & chpid=$! Copied and modified: head/bin/pkill/tests/pgrep-l_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pgrep-l.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pgrep-l.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pgrep-l_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -6,7 +6,7 @@ base=`basename $0` echo "1..1" name="pgrep -l" -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 Copied and modified: head/bin/pkill/tests/pgrep-n_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pgrep-n.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pgrep-n.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pgrep-n_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -6,7 +6,7 @@ base=`basename $0` echo "1..1" name="pgrep -n" -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & oldpid=$! Copied and modified: head/bin/pkill/tests/pgrep-o_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pgrep-o.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pgrep-o.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pgrep-o_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -6,7 +6,7 @@ base=`basename $0` echo "1..1" name="pgrep -o" -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & oldpid=$! Copied and modified: head/bin/pkill/tests/pgrep-q_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pgrep-q.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pgrep-q.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pgrep-q_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -6,8 +6,8 @@ base=`basename $0` echo "1..4" name="pgrep -q" -sleep0=`mktemp /tmp/$base.XXXXXX` || exit 1 -sleep1=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep0=$(pwd)/sleep0.txt +sleep1=$(pwd)/sleep1.txt ln -sf /bin/sleep $sleep0 $sleep0 5 & sleep 0.3 Copied and modified: head/bin/pkill/tests/pgrep-s_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pgrep-s.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pgrep-s.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pgrep-s_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -7,7 +7,7 @@ echo "1..2" name="pgrep -s " sid=`ps -o tsid -p $$ | tail -1` -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 @@ -22,7 +22,7 @@ kill $chpid rm -f $sleep name="pgrep -s 0" -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 Copied and modified: head/bin/pkill/tests/pgrep-t_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pgrep-t.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pgrep-t.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pgrep-t_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -6,8 +6,8 @@ base=`basename $0` echo "1..2" name="pgrep -t " -tty=`ps -o tty -p $$ | tail -1` -if [ "$tty" = "??" ]; then +tty=`ps -x -o tty -p $$ | tail -1` +if [ "$tty" = "??" -o "$tty" = "-" ]; then tty="-" ttyshort="-" else @@ -16,7 +16,7 @@ else *) ttyshort=`echo $tty | cut -c 4-` ;; esac fi -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 Copied and modified: head/bin/pkill/tests/pgrep-v_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pgrep-v.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pgrep-v.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pgrep-v_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -6,7 +6,7 @@ base=`basename $0` echo "1..2" name="pgrep -v" -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 Copied and modified: head/bin/pkill/tests/pgrep-x_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pgrep-x.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pgrep-x.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pgrep-x_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -6,7 +6,7 @@ base=`basename $0` echo "1..4" name="pgrep -x" -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 Copied and modified: head/bin/pkill/tests/pkill-F_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pkill-F.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pkill-F.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pkill-F_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -6,8 +6,8 @@ base=`basename $0` echo "1..1" name="pkill -F " -pidfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +pidfile=$(pwd)/pidfile.txt +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 Copied and modified: head/bin/pkill/tests/pkill-LF_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pkill-LF.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pkill-LF.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pkill-LF_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -6,8 +6,8 @@ base=`basename $0` echo "1..2" name="pkill -LF " -pidfile=`mktemp /tmp/$base.XXXXXX` || exit 1 -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +pidfile=$(pwd)/pidfile.txt +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep daemon -p $pidfile $sleep 5 sleep 0.3 Copied and modified: head/bin/pkill/tests/pkill-P_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pkill-P.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pkill-P.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pkill-P_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -7,7 +7,7 @@ echo "1..1" name="pkill -P " ppid=$$ -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 Copied and modified: head/bin/pkill/tests/pkill-U_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pkill-U.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pkill-U.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pkill-U_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -7,7 +7,7 @@ echo "1..2" name="pkill -U " ruid=`id -ur` -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 @@ -25,7 +25,7 @@ rm -f $sleep name="pkill -U " ruid=`id -urn` -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 Copied and modified: head/bin/pkill/tests/pkill-_g_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pkill-_g.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pkill-_g.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pkill-_g_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -7,7 +7,7 @@ echo "1..2" name="pkill -G " rgid=`id -gr` -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 @@ -25,7 +25,7 @@ rm -f $sleep name="pkill -G " rgid=`id -grn` -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 Copied and modified: head/bin/pkill/tests/pkill-g_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pkill-g.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pkill-g.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pkill-g_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -7,7 +7,7 @@ echo "1..2" name="pkill -g " pgrp=`ps -o tpgid -p $$ | tail -1` -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 @@ -24,7 +24,7 @@ esac rm -f $sleep name="pkill -g 0" -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 Copied and modified: head/bin/pkill/tests/pkill-i_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pkill-i.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pkill-i.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pkill-i_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -6,7 +6,7 @@ base=`basename $0` echo "1..1" name="pkill -i" -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt usleep="${sleep}XXX" touch $usleep lsleep="${sleep}xxx" Copied and modified: head/bin/pkill/tests/pkill-j_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pkill-j.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pkill-j.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pkill-j_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -7,7 +7,7 @@ echo "1..3" name="pkill -j " if [ `id -u` -eq 0 ]; then - sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 + sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep jail / $base-1 127.0.0.1 $sleep 5 & chpid=$! @@ -30,7 +30,7 @@ fi name="pkill -j any" if [ `id -u` -eq 0 ]; then - sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 + sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep jail / $base-1 127.0.0.1 $sleep 5 & chpid=$! @@ -52,7 +52,7 @@ fi name="pkill -j none" if [ `id -u` -eq 0 ]; then - sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 + sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & chpid=$! Copied and modified: head/bin/pkill/tests/pkill-s_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pkill-s.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pkill-s.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pkill-s_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -7,7 +7,7 @@ echo "1..2" name="pkill -s " sid=`ps -o tsid -p $$ | tail -1` -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 @@ -24,7 +24,7 @@ esac rm -f $sleep name="pkill -s 0" -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 Copied and modified: head/bin/pkill/tests/pkill-t_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pkill-t.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pkill-t.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pkill-t_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -6,8 +6,8 @@ base=`basename $0` echo "1..2" name="pkill -t " -tty=`ps -o tty -p $$ | tail -1` -if [ "$tty" = "??" ]; then +tty=`ps -x -o tty -p $$ | tail -1` +if [ "$tty" = "??" -o "$tty" = "-" ]; then tty="-" ttyshort="-" else @@ -16,7 +16,7 @@ else *) ttyshort=`echo $tty | cut -c 4-` ;; esac fi -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 Copied and modified: head/bin/pkill/tests/pkill-x_test.sh (from r263227, head/tools/regression/usr.bin/pkill/pkill-x.t) ============================================================================== --- head/tools/regression/usr.bin/pkill/pkill-x.t Sun Mar 16 08:04:06 2014 (r263227, copy source) +++ head/bin/pkill/tests/pkill-x_test.sh Wed Mar 19 12:46:04 2014 (r263351) @@ -6,7 +6,7 @@ base=`basename $0` echo "1..4" name="pkill -x" -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 @@ -25,7 +25,7 @@ fi rm -f $sleep name="pkill -x -f" -sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep $sleep 5 & sleep 0.3 Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Wed Mar 19 12:45:40 2014 (r263350) +++ head/etc/mtree/BSD.tests.dist Wed Mar 19 12:46:04 2014 (r263351) @@ -27,6 +27,8 @@ .. pax .. + pkill + .. sh builtins .. From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 12:51:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82C62EDA; Wed, 19 Mar 2014 12:51:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 55BDE1A3; Wed, 19 Mar 2014 12:51:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JCpfPU036009; Wed, 19 Mar 2014 12:51:41 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JCpfnT036008; Wed, 19 Mar 2014 12:51:41 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403191251.s2JCpfnT036008@svn.freebsd.org> From: Julio Merino Date: Wed, 19 Mar 2014 12:51:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263352 - head/tools/regression/priv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 12:51:41 -0000 Author: jmmv Date: Wed Mar 19 12:51:40 2014 New Revision: 263352 URL: http://svnweb.freebsd.org/changeset/base/263352 Log: Make the priv test program exit with non-zero if any failures are detected. And, mind you, this already returns a failure :-/ Modified: head/tools/regression/priv/main.c Modified: head/tools/regression/priv/main.c ============================================================================== --- head/tools/regression/priv/main.c Wed Mar 19 12:46:04 2014 (r263351) +++ head/tools/regression/priv/main.c Wed Mar 19 12:51:40 2014 (r263352) @@ -53,6 +53,16 @@ #include "main.h" /* + * If true, some test or preparatory step failed along the execution of this + * program. + * + * Intuitively, we would define a counter instead of a boolean. However, + * we fork to run the subtests and keeping proper track of the number of + * failed tests would be tricky and not provide any real value. + */ +static int something_failed = 0; + +/* * Registration table of privilege tests. Each test registers a name, a test * function, and a cleanup function to run after the test has completed, * regardless of success/failure. @@ -358,13 +368,18 @@ expect(const char *test, int error, int { if (error == 0) { - if (expected_error != 0) + if (expected_error != 0) { + something_failed = 1; warnx("%s: returned 0", test); + } } else { - if (expected_error == 0) + if (expected_error == 0) { + something_failed = 1; warn("%s: returned (%d, %d)", test, error, errno); - else if (expected_errno != errno) + } else if (expected_errno != errno) { + something_failed = 1; warn("%s: returned (%d, %d)", test, error, errno); + } } } @@ -488,14 +503,24 @@ run(struct test *test, int asroot, int i run_child(test, asroot, injail); fflush(stdout); fflush(stderr); - exit(0); + exit(something_failed ? EXIT_FAILURE : EXIT_SUCCESS); } else { while (1) { - pid = waitpid(childpid, NULL, 0); - if (pid == -1) + int status; + pid = waitpid(childpid, &status, 0); + if (pid == -1) { + something_failed = 1; warn("test: waitpid %s", test->t_name); - if (pid == childpid) + } + if (pid == childpid) { + if (WIFEXITED(status) && + WEXITSTATUS(status) == EXIT_SUCCESS) { + /* All good in the subprocess! */ + } else { + something_failed = 1; + } break; + } } } fflush(stdout); @@ -530,5 +555,5 @@ main(int argc, char *argv[]) run(&tests[i], 1, 0); run(&tests[i], 1, 1); } - return (0); + return (something_failed ? EXIT_FAILURE : EXIT_SUCCESS); } From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 12:52:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 487DB157; Wed, 19 Mar 2014 12:52:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3592D1C2; Wed, 19 Mar 2014 12:52:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JCqoC8036497; Wed, 19 Mar 2014 12:52:50 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JCqoFl036496; Wed, 19 Mar 2014 12:52:50 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403191252.s2JCqoFl036496@svn.freebsd.org> From: Julio Merino Date: Wed, 19 Mar 2014 12:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263353 - head/tools/regression/priv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 12:52:50 -0000 Author: jmmv Date: Wed Mar 19 12:52:49 2014 New Revision: 263353 URL: http://svnweb.freebsd.org/changeset/base/263353 Log: errx prepends the program name to the message; don't do it by hand. Modified: head/tools/regression/priv/main.c Modified: head/tools/regression/priv/main.c ============================================================================== --- head/tools/regression/priv/main.c Wed Mar 19 12:51:40 2014 (r263352) +++ head/tools/regression/priv/main.c Wed Mar 19 12:52:49 2014 (r263353) @@ -543,7 +543,7 @@ main(int argc, char *argv[]) * force the use of privilege, and will likely need checking. */ if (getuid() != 0 && geteuid() != 0) - errx(-1, "priv: must be run as root"); + errx(-1, "must be run as root"); /* * Run each test four times, varying whether the process is running From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 13:00:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38F7669B; Wed, 19 Mar 2014 13:00:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 26A6426F; Wed, 19 Mar 2014 13:00:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JD0jUI039802; Wed, 19 Mar 2014 13:00:45 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JD0jhX039801; Wed, 19 Mar 2014 13:00:45 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403191300.s2JD0jhX039801@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 19 Mar 2014 13:00:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263356 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 13:00:45 -0000 Author: trasz Date: Wed Mar 19 13:00:44 2014 New Revision: 263356 URL: http://svnweb.freebsd.org/changeset/base/263356 Log: Make the error message more clear. Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/login.c Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Wed Mar 19 12:57:13 2014 (r263355) +++ head/usr.sbin/ctld/login.c Wed Mar 19 13:00:44 2014 (r263356) @@ -1032,7 +1032,7 @@ login(struct connection *conn) if (ag->ag_type == AG_TYPE_DENY) { login_send_error(request, 0x02, 0x01); - log_errx(1, "auth-group type is \"deny\""); + log_errx(1, "auth-type is \"deny\""); } if (ag->ag_type == AG_TYPE_UNKNOWN) { @@ -1040,7 +1040,7 @@ login(struct connection *conn) * This can happen with empty auth-group. */ login_send_error(request, 0x02, 0x01); - log_errx(1, "auth-group type not set, denying access"); + log_errx(1, "auth-type not set, denying access"); } log_debugx("CHAP authentication required"); From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 13:10:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2890513F; Wed, 19 Mar 2014 13:10:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 158FA325; Wed, 19 Mar 2014 13:10:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JDAPLK042928; Wed, 19 Mar 2014 13:10:25 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JDAPVQ042927; Wed, 19 Mar 2014 13:10:25 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403191310.s2JDAPVQ042927@svn.freebsd.org> From: Julio Merino Date: Wed, 19 Mar 2014 13:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263362 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 13:10:26 -0000 Author: jmmv Date: Wed Mar 19 13:10:25 2014 New Revision: 263362 URL: http://svnweb.freebsd.org/changeset/base/263362 Log: Include strings.h so that bpf_filter.c can be built in userland. This is to bring in a definition for bzero(3), which in turn allows the tests in tools/regression/bpf/ to build again. Modified: head/sys/net/bpf_filter.c Modified: head/sys/net/bpf_filter.c ============================================================================== --- head/sys/net/bpf_filter.c Wed Mar 19 13:09:38 2014 (r263361) +++ head/sys/net/bpf_filter.c Wed Mar 19 13:10:25 2014 (r263362) @@ -39,6 +39,9 @@ __FBSDID("$FreeBSD$"); #include +#if !defined(_KERNEL) +#include +#endif #if !defined(_KERNEL) || defined(sun) #include #endif From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 13:29:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C50ACF6E; Wed, 19 Mar 2014 13:29:45 +0000 (UTC) Received: from smtp9.server.rpi.edu (gateway.canit.rpi.edu [128.113.2.229]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5E33D75E; Wed, 19 Mar 2014 13:29:44 +0000 (UTC) Received: from smtp-auth1.server.rpi.edu (smtp-auth1.server.rpi.edu [128.113.2.231]) by smtp9.server.rpi.edu (8.14.3/8.14.3/Debian-9.4) with ESMTP id s2JDTbRl002756; Wed, 19 Mar 2014 09:29:37 -0400 Received: from smtp-auth1.server.rpi.edu (localhost [127.0.0.1]) by smtp-auth1.server.rpi.edu (Postfix) with ESMTP id 8B45858163; Wed, 19 Mar 2014 09:29:37 -0400 (EDT) Received: from [172.16.61.1] (gilead.netel.rpi.edu [128.113.124.121]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: drosih) by smtp-auth1.server.rpi.edu (Postfix) with ESMTPSA id 7A4D058158; Wed, 19 Mar 2014 09:29:37 -0400 (EDT) From: "Garance A Drosehn" To: "Julio Merino" Subject: Re: svn commit: r263351 - in head: bin/pkill bin/pkill/tests etc/mtree tools/regression/usr.bin/pkill Date: Wed, 19 Mar 2014 09:29:25 -0400 Message-ID: <9A9315B6-2CD2-41F0-B080-95351A0C9D1E@rpi.edu> In-Reply-To: <201403191246.s2JCk5JQ032802@svn.freebsd.org> References: <201403191246.s2JCk5JQ032802@svn.freebsd.org> MIME-Version: 1.0 X-Mailer: MailMate Trial (1.7.2r3905) X-Virus-Scanned: ClamAV using ClamSMTP X-Bayes-Prob: 0.0001 (Score 0, tokens from: outgoing, @@RPTN) X-Spam-Score: -0.01 () [Hold at 15.10] T_RP_MATCHES_RCVD:-0.01 X-CanIt-Incident-Id: 02LDptBRT X-CanIt-Geo: ip=128.113.124.121; country=US; region=New York; city=Troy; latitude=42.7495; longitude=-73.5951; http://maps.google.com/maps?q=42.7495,-73.5951&z=6 X-CanItPRO-Stream: outgoing X-Canit-Stats-ID: Bayes signature not available X-Scanned-By: CanIt (www . roaringpenguin . com) on 128.113.2.229 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 13:29:45 -0000 On 19 Mar 2014, at 8:46, Julio Merino wrote: > Author: jmmv > Date: Wed Mar 19 12:46:04 2014 > New Revision: 263351 > URL: http://svnweb.freebsd.org/changeset/base/263351 > > Log: > Migrate tools/regression/usr.bin/pkill to the new tests layout. > > Interestingly, the pkill tool lives in bin, not usr.bin. Haven't bothered > to check if this is because the tool moved or because the tests were > originally added in the wrong place. FWIW: pkill was originally in usr.bin, because it was in usr.bin in other BSD projects (particularly NetBSD, where it came from). I thought some kind of marker had been left behind in usr.bin after it was moved, just because people from other projects might look for it there. But I guess that did not happen. -- Garance Alistair Drosehn = drosih@rpi.edu Senior Systems Programmer or gad@FreeBSD.org Rensselaer Polytechnic Institute; Troy, NY; USA From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 16:31:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 162C272C; Wed, 19 Mar 2014 16:31:23 +0000 (UTC) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C870ED28; Wed, 19 Mar 2014 16:31:22 +0000 (UTC) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.14.5/8.14.5) with SMTP id s2JGRSEp021003; Wed, 19 Mar 2014 11:31:21 -0500 Received: from mh2.mail.rice.edu (mh2.mail.rice.edu [128.42.201.21]) by pp2.rice.edu with ESMTP id 1jqcvc03r6-1; Wed, 19 Mar 2014 11:31:20 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh2.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh2.mail.rice.edu (Postfix) with ESMTPSA id 428F0500152; Wed, 19 Mar 2014 11:31:20 -0500 (CDT) Message-ID: <5329C657.3000705@rice.edu> Date: Wed, 19 Mar 2014 11:31:19 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: John-Mark Gurney , Adrian Chadd Subject: Re: svn commit: r263214 - in head/sys: compat/freebsd32 kern sys References: <201403160053.s2G0rfmA073668@svn.freebsd.org> <20140316012609.GY32089@funkthat.com> In-Reply-To: <20140316012609.GY32089@funkthat.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 kscore.compositescore=0 circleOfTrustscore=0 compositescore=0.248919945447816 urlsuspect_oldscore=0.248919945447816 suspectscore=11 recipient_domain_to_sender_totalscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=0 rbsscore=0.248919945447816 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1305240000 definitions=main-1403190076 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 16:31:23 -0000 On 03/15/2014 20:26, John-Mark Gurney wrote: > Adrian Chadd wrote this message on Sat, Mar 15, 2014 at 18:17 -0700: >> How far along does it get? > It rarely gets to multiuser, and even if it does, it panics very > shortly afterward: > panic: vm_page_alloc: page 0xc0805db0 is wired > > I did finally get around to dumping the vm_page struct for it (the > CTF crazyness) and I did send it to alc and kib, but neither one has > replied... > > here is a dump in case someone else has some vm_page clue: > {'act_count': '\x00', > 'aflags': '\x00', > 'busy_lock': 1, > 'dirty': '\xff', > 'flags': 0, > 'hold_count': 0, > 'listq': {'tqe_next': 0xc0805e00, 'tqe_prev': 0xc06d18a0}, > 'md': {'pv_kva': 3235856384, > 'pv_list': {'tqh_first': 0x0, 'tqh_last': 0xc0805de0}, > 'pv_memattr': '\x00', > 'pvh_attrs': 0}, > 'object': 0xc06d1878, > 'oflags': '\x04', > 'order': '\t', > 'phys_addr': 17776640, > 'pindex': 3572, > 'plinks': {'memguard': {'p': 0, 'v': 3228376932}, > 'q': {'tqe_next': 0x0, 'tqe_prev': 0xc06d1f64}, > 's': {'pv': 0xc06d1f64, 'ss': {'sle_next': 0x0}}}, > 'pool': '\x00', > 'queue': '\xff', > 'segind': '\x01', > 'valid': '\xff', > 'wire_count': 1} > > and as you can see, wire_count is not 0... but looks resonable... There are several things wrong with this page. Two lines later, this assertion would also fail: KASSERT(m->dirty == 0, ("vm_page_alloc: page %p is dirty", m)); because a page in the cache/free lists should never be dirty. The page's flags field doesn't include PG_CACHED. So, the object field should be NULL and the valid field should be 0, but they are not. All of these fields are (explicitly) cleared when a page is freed (cf. vm_page_free_toq()). Can you determine if the value of the object field matches the address of either kernel_object or kmem_object? The oflags field containing VPO_UNMANAGED makes that likely. In a nutshell, this looks like the same page is simultaneously in use by one part of the kernel and free in another part. I doubt that it's a simple case of use after free. In that case, the dirty, object, and valid fields would be zero, and the crash would be in a different part of the kernel. > So, I'm blocked until someone w/ clue tells me what more I need to do > to debug this... > From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 17:34:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8EF17421; Wed, 19 Mar 2014 17:34:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7AE23620; Wed, 19 Mar 2014 17:34:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JHYcIQ051649; Wed, 19 Mar 2014 17:34:38 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JHYcDQ051648; Wed, 19 Mar 2014 17:34:38 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403191734.s2JHYcDQ051648@svn.freebsd.org> From: Warner Losh Date: Wed, 19 Mar 2014 17:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263371 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 17:34:38 -0000 Author: imp Date: Wed Mar 19 17:34:37 2014 New Revision: 263371 URL: http://svnweb.freebsd.org/changeset/base/263371 Log: Add my humble request for reviews before nanobsd changes happen. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Wed Mar 19 13:37:51 2014 (r263370) +++ head/MAINTAINERS Wed Mar 19 17:34:37 2014 (r263371) @@ -131,3 +131,4 @@ nvd(4) jimharris Pre-commit review requ nvmecontrol(8) jimharris Pre-commit review requested. release/release.sh gjb Pre-commit review and regression tests requested. +nanobsd imp Pre-commit review requested for coordination. From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 17:53:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 269949E7; Wed, 19 Mar 2014 17:53:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 138BF883; Wed, 19 Mar 2014 17:53:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JHr9e2059428; Wed, 19 Mar 2014 17:53:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JHr9ne059427; Wed, 19 Mar 2014 17:53:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403191753.s2JHr9ne059427@svn.freebsd.org> From: Warner Losh Date: Wed, 19 Mar 2014 17:53:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263372 - head/sys/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 17:53:10 -0000 Author: imp Date: Wed Mar 19 17:53:09 2014 New Revision: 263372 URL: http://svnweb.freebsd.org/changeset/base/263372 Log: Remove redunant declaration. gcc complains while clang doesn't. Modified: head/sys/xen/xen-os.h Modified: head/sys/xen/xen-os.h ============================================================================== --- head/sys/xen/xen-os.h Wed Mar 19 17:34:37 2014 (r263371) +++ head/sys/xen/xen-os.h Wed Mar 19 17:53:09 2014 (r263372) @@ -54,7 +54,6 @@ extern shared_info_t *HYPERVISOR_shared_ extern start_info_t *HYPERVISOR_start_info; /* XXX: we need to get rid of this and use HYPERVISOR_start_info directly */ -extern struct xenstore_domain_interface *xen_store; extern char *console_page; enum xen_domain_type { From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 18:10:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB01DF27; Wed, 19 Mar 2014 18:10:53 +0000 (UTC) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9EA19A26; Wed, 19 Mar 2014 18:10:53 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 79DC93592D9; Wed, 19 Mar 2014 19:10:51 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 5742D28497; Wed, 19 Mar 2014 19:10:51 +0100 (CET) Date: Wed, 19 Mar 2014 19:10:51 +0100 From: Jilles Tjoelker To: Attilio Rao Subject: Re: svn commit: r263318 - in head: sys/compat/freebsd32 sys/kern sys/sys usr.bin/truss Message-ID: <20140319181051.GA86549@stack.nl> References: <201403182132.s2ILW33e060898@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201403182132.s2ILW33e060898@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 18:10:53 -0000 On Tue, Mar 18, 2014 at 09:32:03PM +0000, Attilio Rao wrote: > Author: attilio > Date: Tue Mar 18 21:32:03 2014 > New Revision: 263318 > URL: http://svnweb.freebsd.org/changeset/base/263318 > Log: > Remove dead code from umtx support: > - Retire long time unused (basically always unused) sys__umtx_lock() > and sys__umtx_unlock() syscalls > - struct umtx and their supporting definitions > - UMUTEX_ERROR_CHECK flag > - Retire UMTX_OP_LOCK/UMTX_OP_UNLOCK from _umtx_op() syscall > __FreeBSD_version is not bumped yet because it is expected that further > breakages to the umtx interface will follow up in the next days. > However there will be a final bump when necessary. > Sponsored by: EMC / Isilon storage division > Reviewed by: jhb > [snip] > Modified: head/sys/sys/umtx.h > ============================================================================== > --- head/sys/sys/umtx.h Tue Mar 18 20:14:13 2014 (r263317) > +++ head/sys/sys/umtx.h Tue Mar 18 21:32:03 2014 (r263318) > [snip] > -static __inline int > -umtx_wait(u_long *p, long val, const struct timespec *timeout) > -{ > - if (_umtx_op(p, UMTX_OP_WAIT, val, 0, > - __DECONST(void *, timeout)) == -1) > - return (errno); > - return (0); > -} > - > -/* Wake threads waiting on a user address. */ > -static __inline int > -umtx_wake(u_long *p, int nr_wakeup) > -{ > - if (_umtx_op(p, UMTX_OP_WAKE, nr_wakeup, 0, 0) == -1) > - return (errno); > - return (0); > -} > - These two do not use struct umtx, are not obsolete and are used by some ports, such as lang/sbcl with certain options. They are similar to the Linux futex system call. The relatively recent libxshmfence uses the underlying umtx_op directly, mainly because there is no static inline function for UMTX_OP_WAIT_UINT. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 18:54:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74F256AA; Wed, 19 Mar 2014 18:54:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 46964E88; Wed, 19 Mar 2014 18:54:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JIssia083889; Wed, 19 Mar 2014 18:54:54 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JIsrNG083887; Wed, 19 Mar 2014 18:54:53 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201403191854.s2JIsrNG083887@svn.freebsd.org> From: Ian Lepore Date: Wed, 19 Mar 2014 18:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263373 - in head/share: examples/etc mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 18:54:54 -0000 Author: ian Date: Wed Mar 19 18:54:53 2014 New Revision: 263373 URL: http://svnweb.freebsd.org/changeset/base/263373 Log: Add a way to apply CFLAGS only when building the given architecture. This is useful primarily on a system used for cross-building, when you have a set of flags to apply to the TARGET_ARCH being cross-built but don't want those settings applied to building the cross-tools or other components that run on the build host machine. Modified: head/share/examples/etc/make.conf head/share/mk/bsd.cpu.mk Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Wed Mar 19 17:53:09 2014 (r263372) +++ head/share/examples/etc/make.conf Wed Mar 19 18:54:53 2014 (r263373) @@ -60,6 +60,12 @@ # nonstandard optimization settings # before submitting bug reports without patches to the developers. # +# CFLAGS.arch provides a mechanism for applying CFLAGS only when building +# the given architecture. This is useful primarily on a system used for +# cross-building, when you have a set of flags to apply to the TARGET_ARCH +# being cross-built but don't want those settings applied to building the +# cross-tools or other components that run on the build host machine. +# # CXXFLAGS controls the compiler settings used when compiling C++ code. # Note that CXXFLAGS is initially set to the value of CFLAGS. If you wish # to add to CXXFLAGS value, "+=" must be used rather than "=". Using "=" @@ -71,6 +77,7 @@ # # CFLAGS+= -msse3 # CXXFLAGS+= -msse3 +# CFLAGS.armv6+= -mfloat-abi=softfp # # MAKE_SHELL controls the shell used internally by make(1) to process the # command scripts in makefiles. Three shells are supported, sh, ksh, and Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Wed Mar 19 17:53:09 2014 (r263372) +++ head/share/mk/bsd.cpu.mk Wed Mar 19 18:54:53 2014 (r263373) @@ -260,3 +260,7 @@ CFLAGS += -G0 .if !defined(NO_CPU_CFLAGS) CFLAGS += ${_CPUCFLAGS} .endif + +# Add in any architecture-specific CFLAGS. +# These come from make.conf or the command line or the environment. +CFLAGS += ${CFLAGS.${MACHINE_ARCH}} From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 19:49:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92C50C9D; Wed, 19 Mar 2014 19:49:02 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6A25D3EF; Wed, 19 Mar 2014 19:49:02 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 15BBEB946; Wed, 19 Mar 2014 15:49:01 -0400 (EDT) From: John Baldwin To: Aleksandr Rybalko Subject: Re: svn commit: r263321 - head/sys/dev/vt Date: Wed, 19 Mar 2014 14:53:47 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201403182222.s2IMMmOM081929@svn.freebsd.org> In-Reply-To: <201403182222.s2IMMmOM081929@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201403191453.47690.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 19 Mar 2014 15:49:01 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 19:49:02 -0000 On Tuesday, March 18, 2014 6:22:48 pm Aleksandr Rybalko wrote: > Author: ray > Date: Tue Mar 18 22:22:47 2014 > New Revision: 263321 > URL: http://svnweb.freebsd.org/changeset/base/263321 > > Log: > Switch kern.vt.suspendswitch to 0 by default (disabled). > kern.vt.suspendswitch - sysctl/tunable which enable switch to VT0 before going > to suspend and switch back after resume. > > MFC after: 7 days I think it is fine to change the default, but I'm not certain that this fixes the panics on resume. So far no one has reported back that this did fix them after I suggested it. It would be good to fix the panics as well if possible. The last time I looked at it in detail, it seemed like the callout for only ttyv0 had been zero'd. Other ttyv timers used in switching still had the correct contents. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 19:57:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 987BB369; Wed, 19 Mar 2014 19:57:03 +0000 (UTC) Received: from mail-we0-x232.google.com (mail-we0-x232.google.com [IPv6:2a00:1450:400c:c03::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB92C6C4; Wed, 19 Mar 2014 19:57:02 +0000 (UTC) Received: by mail-we0-f178.google.com with SMTP id u56so7253859wes.23 for ; Wed, 19 Mar 2014 12:57:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=jHvQEbrprj623o50YvLYxUPWbTC4fmNDb6+881rSr+4=; b=i5OFA2nXfnoNzMdv7wr9uNVjViVJ8jvbbOEPLGcVa900gNGp/sWBRD4ncDx3YJBFkK 4vlrTSFlkzNhAjMIE1GPW6xgP4Wu+TlGLrH6EhFnkRZHZQpUG9Vll0wHjaTAiMZNF0ie Dk9INADI8WCQA0EynBt0mPTKltAg8Mj4+9GTZE5MN44xmLexYIXX7uS0EysJthYai4kb sul0I3TUroz1CnQMYp5tXG60Q6RBeX0lbqdSEtz0UmyozPrFIfK8vMZ/E0Ed/pKjMc0c 2LTbQj/6/c1/KpLWZY6mTSrPenfnpKE9fJhlBphTBirrYbcH9EQPSltu4pdd+WY36Ugc OBEw== MIME-Version: 1.0 X-Received: by 10.180.12.233 with SMTP id b9mr21273120wic.8.1395259021296; Wed, 19 Mar 2014 12:57:01 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.217.61.196 with HTTP; Wed, 19 Mar 2014 12:57:01 -0700 (PDT) In-Reply-To: <20140319181051.GA86549@stack.nl> References: <201403182132.s2ILW33e060898@svn.freebsd.org> <20140319181051.GA86549@stack.nl> Date: Wed, 19 Mar 2014 20:57:01 +0100 X-Google-Sender-Auth: gclyKRDbcgcTV9wzWtSNeBE8QN4 Message-ID: Subject: Re: svn commit: r263318 - in head: sys/compat/freebsd32 sys/kern sys/sys usr.bin/truss From: Attilio Rao To: Jilles Tjoelker Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 19:57:03 -0000 On Wed, Mar 19, 2014 at 7:10 PM, Jilles Tjoelker wrote: > On Tue, Mar 18, 2014 at 09:32:03PM +0000, Attilio Rao wrote: >> Author: attilio >> Date: Tue Mar 18 21:32:03 2014 >> New Revision: 263318 >> URL: http://svnweb.freebsd.org/changeset/base/263318 > >> Log: >> Remove dead code from umtx support: >> - Retire long time unused (basically always unused) sys__umtx_lock() >> and sys__umtx_unlock() syscalls >> - struct umtx and their supporting definitions >> - UMUTEX_ERROR_CHECK flag >> - Retire UMTX_OP_LOCK/UMTX_OP_UNLOCK from _umtx_op() syscall > >> __FreeBSD_version is not bumped yet because it is expected that further >> breakages to the umtx interface will follow up in the next days. >> However there will be a final bump when necessary. > >> Sponsored by: EMC / Isilon storage division >> Reviewed by: jhb > >> [snip] >> Modified: head/sys/sys/umtx.h >> ============================================================================== >> --- head/sys/sys/umtx.h Tue Mar 18 20:14:13 2014 (r263317) >> +++ head/sys/sys/umtx.h Tue Mar 18 21:32:03 2014 (r263318) >> [snip] >> -static __inline int >> -umtx_wait(u_long *p, long val, const struct timespec *timeout) >> -{ >> - if (_umtx_op(p, UMTX_OP_WAIT, val, 0, >> - __DECONST(void *, timeout)) == -1) >> - return (errno); >> - return (0); >> -} >> - >> -/* Wake threads waiting on a user address. */ >> -static __inline int >> -umtx_wake(u_long *p, int nr_wakeup) >> -{ >> - if (_umtx_op(p, UMTX_OP_WAKE, nr_wakeup, 0, 0) == -1) >> - return (errno); >> - return (0); >> -} >> - > > These two do not use struct umtx, are not obsolete and are used by some > ports, such as lang/sbcl with certain options. They are similar to the > Linux futex system call. The relatively recent libxshmfence uses the > underlying umtx_op directly, mainly because there is no static inline > function for UMTX_OP_WAIT_UINT. They can just use _umtx_op() straight off. I already mentioned in the commit message that I will bump __FreeBSD_version appropriately when more API breakage will be introduced and we will have a relatively "stable" API situation of umtx. At that point ports maintainer can fix the ports. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 20:40:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 302EB146; Wed, 19 Mar 2014 20:40:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D5CBAAB; Wed, 19 Mar 2014 20:40:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JKevf0027840; Wed, 19 Mar 2014 20:40:57 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JKev1k027839; Wed, 19 Mar 2014 20:40:57 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403192040.s2JKev1k027839@svn.freebsd.org> From: Warner Losh Date: Wed, 19 Mar 2014 20:40:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263377 - head/sys/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 20:40:58 -0000 Author: imp Date: Wed Mar 19 20:40:57 2014 New Revision: 263377 URL: http://svnweb.freebsd.org/changeset/base/263377 Log: Revert last change, it breaks other things. Modified: head/sys/xen/xen-os.h Modified: head/sys/xen/xen-os.h ============================================================================== --- head/sys/xen/xen-os.h Wed Mar 19 19:33:55 2014 (r263376) +++ head/sys/xen/xen-os.h Wed Mar 19 20:40:57 2014 (r263377) @@ -54,6 +54,7 @@ extern shared_info_t *HYPERVISOR_shared_ extern start_info_t *HYPERVISOR_start_info; /* XXX: we need to get rid of this and use HYPERVISOR_start_info directly */ +extern struct xenstore_domain_interface *xen_store; extern char *console_page; enum xen_domain_type { From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 21:03:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80C4C8EF; Wed, 19 Mar 2014 21:03:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C9C9D0D; Wed, 19 Mar 2014 21:03:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JL37AR037928; Wed, 19 Mar 2014 21:03:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JL35NB037915; Wed, 19 Mar 2014 21:03:05 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403192103.s2JL35NB037915@svn.freebsd.org> From: Warner Losh Date: Wed, 19 Mar 2014 21:03:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263379 - in head/sys: amd64/amd64 i386/i386 i386/xen isa pc98/cbus x86/isa x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 21:03:07 -0000 Author: imp Date: Wed Mar 19 21:03:04 2014 New Revision: 263379 URL: http://svnweb.freebsd.org/changeset/base/263379 Log: Remove vestiges of knowing the ISA bus, which we gave up on around 20 years ago. Remove redunant copy of isaregs.h. Deleted: head/sys/x86/isa/isa.h Modified: head/sys/amd64/amd64/vm_machdep.c head/sys/i386/i386/vm_machdep.c head/sys/i386/xen/clock.c head/sys/isa/isareg.h head/sys/pc98/cbus/cbus.h head/sys/pc98/cbus/cbus_dma.c head/sys/x86/isa/atpic.c head/sys/x86/isa/isa_dma.c head/sys/x86/x86/intr_machdep.c head/sys/x86/x86/nexus.c Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Wed Mar 19 20:46:02 2014 (r263378) +++ head/sys/amd64/amd64/vm_machdep.c Wed Mar 19 21:03:04 2014 (r263379) @@ -80,7 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include static void cpu_reset_real(void); #ifdef SMP Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Wed Mar 19 20:46:02 2014 (r263378) +++ head/sys/i386/i386/vm_machdep.c Wed Mar 19 21:03:04 2014 (r263379) @@ -95,7 +95,7 @@ __FBSDID("$FreeBSD$"); #ifdef PC98 #include #else -#include +#include #endif #ifdef XBOX Modified: head/sys/i386/xen/clock.c ============================================================================== --- head/sys/i386/xen/clock.c Wed Mar 19 20:46:02 2014 (r263378) +++ head/sys/i386/xen/clock.c Wed Mar 19 21:03:04 2014 (r263379) @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include Modified: head/sys/isa/isareg.h ============================================================================== --- head/sys/isa/isareg.h Wed Mar 19 20:46:02 2014 (r263378) +++ head/sys/isa/isareg.h Wed Mar 19 21:03:04 2014 (r263379) @@ -40,8 +40,6 @@ #ifndef _ISA_ISA_H_ #define _ISA_ISA_H_ -/* BEWARE: Included in both assembler and C code */ - /* * ISA Bus conventions */ @@ -51,134 +49,22 @@ */ #ifndef IO_ISABEGIN #define IO_ISABEGIN 0x000 /* 0x000 - Beginning of I/O Registers */ - - /* CPU Board */ #define IO_ICU1 0x020 /* 8259A Interrupt Controller #1 */ -#define IO_PMP1 0x026 /* 82347 Power Management Peripheral */ #define IO_KBD 0x060 /* 8042 Keyboard */ #define IO_RTC 0x070 /* RTC */ -#define IO_NMI IO_RTC /* NMI Control */ #define IO_ICU2 0x0A0 /* 8259A Interrupt Controller #2 */ - /* Cards */ - /* 0x100 - 0x16F Open */ - -#define IO_WD2 0x170 /* Secondary Fixed Disk Controller */ - -#define IO_PMP2 0x178 /* 82347 Power Management Peripheral */ - - /* 0x17A - 0x1EF Open */ - -#define IO_WD1 0x1F0 /* Primary Fixed Disk Controller */ -#define IO_GAME 0x201 /* Game Controller */ - - /* 0x202 - 0x22A Open */ - -#define IO_ASC2 0x22B /* AmiScan addr.grp. 2 */ - - /* 0x230 - 0x26A Open */ - -#define IO_ASC3 0x26B /* AmiScan addr.grp. 3 */ -#define IO_GSC1 0x270 /* -- 0x27B! GeniScan GS-4500 addr.grp. 1 */ -#define IO_LPT2 0x278 /* Parallel Port #2 */ - - /* 0x280 - 0x2AA Open */ - -#define IO_ASC4 0x2AB /* AmiScan addr.grp. 4 */ - - /* 0x2B0 - 0x2DF Open */ - -#define IO_GSC2 0x2E0 /* GeniScan GS-4500 addr.grp. 2 */ -#define IO_COM4 0x2E8 /* COM4 i/o address */ -#define IO_ASC5 0x2EB /* AmiScan addr.grp. 5 */ - - /* 0x2F0 - 0x2F7 Open */ - -#define IO_COM2 0x2F8 /* COM2 i/o address */ - - /* 0x300 - 0x32A Open */ - -#define IO_ASC6 0x32B /* AmiScan addr.grp. 6 */ -#define IO_AHA0 0x330 /* adaptec 1542 default addr. */ -#define IO_BT0 0x330 /* bustek 742a default addr. */ -#define IO_UHA0 0x330 /* ultrastore 14f default addr. */ -#define IO_AHA1 0x334 /* adaptec 1542 default addr. */ -#define IO_BT1 0x334 /* bustek 742a default addr. */ - - /* 0x340 - 0x36A Open */ - -#define IO_ASC7 0x36B /* AmiScan addr.grp. 7 */ -#define IO_GSC3 0x370 /* GeniScan GS-4500 addr.grp. 3 */ -#define IO_FD2 0x370 /* secondary base i/o address */ -#define IO_LPT1 0x378 /* Parallel Port #1 */ - - /* 0x380 - 0x3AA Open */ - -#define IO_ASC8 0x3AB /* AmiScan addr.grp. 8 */ #define IO_MDA 0x3B0 /* Monochome Adapter */ -#define IO_LPT3 0x3BC /* Monochome Adapter Printer Port */ #define IO_VGA 0x3C0 /* E/VGA Ports */ #define IO_CGA 0x3D0 /* CGA Ports */ -#define IO_GSC4 0x3E0 /* GeniScan GS-4500 addr.grp. 4 */ -#define IO_COM3 0x3E8 /* COM3 i/o address */ -#define IO_ASC1 0x3EB /* AmiScan addr.grp. 1 */ -#define IO_FD1 0x3F0 /* primary base i/o address */ -#define IO_COM1 0x3F8 /* COM1 i/o address */ -#define IO_ISAEND 0x3FF /* End (actually Max) of I/O Regs */ #endif /* !IO_ISABEGIN */ /* - * Input / Output Port Sizes - these are from several sources, and tend - * to be the larger of what was found. + * Input / Output Port Sizes */ -#ifndef IO_ISASIZES -#define IO_ISASIZES - -#define IO_ASCSIZE 5 /* AmiScan GI1904-based hand scanner */ #define IO_CGASIZE 12 /* CGA controllers */ -#define IO_EISASIZE 256 /* EISA controllers */ -#define IO_FDCSIZE 8 /* Nec765 floppy controllers */ -#define IO_GAMSIZE 16 /* AT compatible game controllers */ -#define IO_GSCSIZE 8 /* GeniScan GS-4500G hand scanner */ -#define IO_ICUSIZE 16 /* 8259A interrupt controllers */ -#define IO_KBDSIZE 16 /* 8042 Keyboard controllers */ - -/* The following line was changed to support more architectures (simpler - chipsets (like those for Alpha) only use 4, but more complex controllers - (usually modern i386's) can use an additional 4; the probe to see if - the additional 4 can be used by the specific chipset is now done in the ppc - code by ppc_probe()... */ - -#define IO_LPTSIZE_EXTENDED 8 /* "Extended" LPT controllers */ -#define IO_LPTSIZE_NORMAL 4 /* "Normal" LPT controllers */ - #define IO_MDASIZE 12 /* Monochrome display controllers */ -#define IO_PMPSIZE 2 /* 82347 power management peripheral */ -#define IO_PSMSIZE 5 /* 8042 Keyboard controllers */ -#define IO_RTCSIZE 16 /* CMOS real time clock, NMI control */ -#define IO_TMRSIZE 16 /* 8253 programmable timers */ #define IO_VGASIZE 16 /* VGA controllers */ -#define IO_WDCSIZE 8 /* WD compatible disk controllers */ - -#endif /* !IO_ISASIZES */ - -/* - * Input / Output Memory Physical Addresses - */ -#ifndef IOM_BEGIN -#define IOM_BEGIN 0x0A0000 /* Start of I/O Memory "hole" */ -#define IOM_END 0x100000 /* End of I/O Memory "hole" */ -#define IOM_SIZE (IOM_END - IOM_BEGIN) -#endif /* !IOM_BEGIN */ - -/* - * RAM Physical Address Space (ignoring the above mentioned "hole") - */ -#ifndef RAM_BEGIN -#define RAM_BEGIN 0x0000000 /* Start of RAM Memory */ -#define RAM_END 0x1000000 /* End of RAM Memory */ -#define RAM_SIZE (RAM_END - RAM_BEGIN) -#endif /* !RAM_BEGIN */ #endif /* !_ISA_ISA_H_ */ Modified: head/sys/pc98/cbus/cbus.h ============================================================================== --- head/sys/pc98/cbus/cbus.h Wed Mar 19 20:46:02 2014 (r263378) +++ head/sys/pc98/cbus/cbus.h Wed Mar 19 21:03:04 2014 (r263379) @@ -36,8 +36,6 @@ #ifndef _PC98_PC98_PC98_H_ #define _PC98_PC98_PC98_H_ -/* BEWARE: Included in both assembler and C code */ - /* * PC98 Bus conventions * modified for PC9801 by A.Kojima F.Ukai M.Ishii @@ -45,12 +43,8 @@ */ /* - * Input / Output Port Assignments + * Input / Output Port Assignments -- PC98 IO address ... very dirty (^_^; */ -#ifndef IO_ISABEGIN -#define IO_ISABEGIN 0x000 /* 0x000 - Beginning of I/O Registers */ - -/* PC98 IO address ... very dirty (^_^; */ #define IO_ICU1 0x000 /* 8259A Interrupt Controller #1 */ #define IO_ICU2 0x008 /* 8259A Interrupt Controller #2 */ @@ -60,45 +54,10 @@ #define IO_COM2 0x0B1 /* 8251A RS232C serial I/O (ext) */ #define IO_COM3 0x0B9 /* 8251A RS232C serial I/O (ext) */ #define IO_FDPORT 0x0BE /* FD I/F port (1M<->640K,EMTON) */ -#define IO_WD1_EPSON 0x80 /* 386note Hard disk controller */ -#define IO_ISAEND 0xFFFF /* - 0x3FF End of I/O Registers */ -#endif /* !IO_ISABEGIN */ /* - * Input / Output Port Sizes - these are from several sources, and tend - * to be the larger of what was found, ie COM ports can be 4, but some - * boards do not fully decode the address, thus 8 ports are used. + * Input / Output Port Sizes */ -#ifndef IO_ISASIZES -#define IO_ISASIZES - #define IO_KBDSIZE 16 /* 8042 Keyboard controllers */ -#define IO_LPTSIZE 8 /* LPT controllers, some use only 4 */ -#define IO_LPTSIZE_EXTENDED 8 /* "Extended" LPT controllers */ -#define IO_LPTSIZE_NORMAL 4 /* "Normal" LPT controllers */ - -#endif /* !IO_ISASIZES */ - -/* - * Input / Output Memory Physical Addresses - */ -#ifndef IOM_BEGIN -#define IOM_BEGIN 0x0A0000 /* Start of I/O Memory "hole" */ -#define IOM_END 0x100000 /* End of I/O Memory "hole" */ -#define IOM_SIZE (IOM_END - IOM_BEGIN) -#endif /* !IOM_BEGIN */ - -/* - * RAM Physical Address Space (ignoring the above mentioned "hole") - */ -#ifndef RAM_BEGIN -#define RAM_BEGIN 0x0000000 /* Start of RAM Memory */ -#ifdef EPSON_BOUNCEDMA -#define RAM_END 0x0f00000 /* End of EPSON GR?? RAM Memory */ -#else -#define RAM_END 0x1000000 /* End of RAM Memory */ -#endif -#define RAM_SIZE (RAM_END - RAM_BEGIN) -#endif /* !RAM_BEGIN */ #endif /* !_PC98_PC98_PC98_H_ */ Modified: head/sys/pc98/cbus/cbus_dma.c ============================================================================== --- head/sys/pc98/cbus/cbus_dma.c Wed Mar 19 20:46:02 2014 (r263378) +++ head/sys/pc98/cbus/cbus_dma.c Wed Mar 19 21:03:04 2014 (r263379) @@ -336,9 +336,9 @@ isa_dmarangecheck(caddr_t va, u_int leng for (; va < (caddr_t) endva ; va += PAGE_SIZE) { phys = trunc_page(pmap_extract(kernel_pmap, (vm_offset_t)va)); #ifdef EPSON_BOUNCEDMA -#define ISARAM_END 0xf00000 +#define ISARAM_END 0x0f00000 #else -#define ISARAM_END RAM_END +#define ISARAM_END 0x1000000 #endif if (phys == 0) panic("isa_dmacheck: no physical page present"); Modified: head/sys/x86/isa/atpic.c ============================================================================== --- head/sys/x86/isa/atpic.c Wed Mar 19 20:46:02 2014 (r263378) +++ head/sys/x86/isa/atpic.c Wed Mar 19 21:03:04 2014 (r263379) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #ifdef PC98 #include #else -#include +#include #endif #include Modified: head/sys/x86/isa/isa_dma.c ============================================================================== --- head/sys/x86/isa/isa_dma.c Wed Mar 19 20:46:02 2014 (r263378) +++ head/sys/x86/isa/isa_dma.c Wed Mar 19 21:03:04 2014 (r263379) @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define ISARAM_END RAM_END +#define ISARAM_END 0x1000000 static int isa_dmarangecheck(caddr_t va, u_int length, int chan); Modified: head/sys/x86/x86/intr_machdep.c ============================================================================== --- head/sys/x86/x86/intr_machdep.c Wed Mar 19 20:46:02 2014 (r263378) +++ head/sys/x86/x86/intr_machdep.c Wed Mar 19 21:03:04 2014 (r263379) @@ -63,7 +63,7 @@ #ifdef PC98 #include #else -#include +#include #endif #endif Modified: head/sys/x86/x86/nexus.c ============================================================================== --- head/sys/x86/x86/nexus.c Wed Mar 19 20:46:02 2014 (r263378) +++ head/sys/x86/x86/nexus.c Wed Mar 19 21:03:04 2014 (r263379) @@ -79,7 +79,7 @@ __FBSDID("$FreeBSD$"); #ifdef PC98 #include #else -#include +#include #endif #endif #include From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 21:30:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36B5EFEF; Wed, 19 Mar 2014 21:30:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 17BADF94; Wed, 19 Mar 2014 21:30:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JLUB7m046694; Wed, 19 Mar 2014 21:30:11 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JLUAV3046691; Wed, 19 Mar 2014 21:30:10 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403192130.s2JLUAV3046691@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 19 Mar 2014 21:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263380 - in head/sys/ia64: ia64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 21:30:11 -0000 Author: marcel Date: Wed Mar 19 21:30:10 2014 New Revision: 263380 URL: http://svnweb.freebsd.org/changeset/base/263380 Log: Add KTR events for the PMAP interface functions 1. move unmapped_buf_allowed to machdep.c. 2. map both pmap_mapbios() and pmap_mapdev() to pmap_mapdev_attr() and have the actual work done by pmap_mapdev_priv() (renamed from pmap_mapdev()). Use pmap_mapdev_priv() to map the I/O port space because we can't use CTR() that early. 3. add pmap_pinit_common() that's used by both pmap_pinit0() and pmap_pinit(). Previously pmap_pinit0() would call pmap_pinit(), but that would create 2 KTR events. While here, use pmap_t instead of "struct pmap *". 4. fix pmap_kenter() to use vm_paddr_t as the type for the physical. 5. various white-space adjustments for consistency. 6. use C99 and KNF for function definitions where appropriate. 7. slightly re-order prototypes and defines in No functional change (other than the creation of KTR_PMAP events). Modified: head/sys/ia64/ia64/machdep.c head/sys/ia64/ia64/pmap.c head/sys/ia64/include/pmap.h Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Wed Mar 19 21:03:04 2014 (r263379) +++ head/sys/ia64/ia64/machdep.c Wed Mar 19 21:30:10 2014 (r263380) @@ -133,6 +133,7 @@ SYSCTL_UINT(_hw_freq, OID_AUTO, itc, CTL "ITC frequency"); int cold = 1; +int unmapped_buf_allowed = 0; struct bootinfo *bootinfo; @@ -746,8 +747,8 @@ ia64_init(void) mdlen = md->md_pages * EFI_PAGE_SIZE; switch (md->md_type) { case EFI_MD_TYPE_IOPORT: - ia64_port_base = (uintptr_t)pmap_mapdev(md->md_phys, - mdlen); + ia64_port_base = pmap_mapdev_priv(md->md_phys, + mdlen, VM_MEMATTR_UNCACHEABLE); break; case EFI_MD_TYPE_PALCODE: ia64_pal_base = md->md_phys; Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Wed Mar 19 21:03:04 2014 (r263379) +++ head/sys/ia64/ia64/pmap.c Wed Mar 19 21:30:10 2014 (r263380) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -484,6 +485,8 @@ void pmap_page_init(vm_page_t m) { + CTR2(KTR_PMAP, "%s(%p)", __func__, m); + TAILQ_INIT(&m->md.pv_list); m->md.memattr = VM_MEMATTR_DEFAULT; } @@ -497,6 +500,8 @@ void pmap_init(void) { + CTR1(KTR_PMAP, "%s()", __func__); + ptezone = uma_zcreate("PT ENTRY", sizeof (struct ia64_lpte), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM|UMA_ZONE_NOFREE); } @@ -604,13 +609,25 @@ pmap_free_rid(uint32_t rid) * Page table page management routines..... ***************************************************/ +static void +pmap_pinit_common(pmap_t pmap) +{ + int i; + + for (i = 0; i < IA64_VM_MINKERN_REGION; i++) + pmap->pm_rid[i] = pmap_allocate_rid(); + TAILQ_INIT(&pmap->pm_pvchunk); + bzero(&pmap->pm_stats, sizeof pmap->pm_stats); +} + void -pmap_pinit0(struct pmap *pmap) +pmap_pinit0(pmap_t pmap) { + CTR2(KTR_PMAP, "%s(%p)", __func__, pmap); + PMAP_LOCK_INIT(pmap); - /* kernel_pmap is the same as any other pmap. */ - pmap_pinit(pmap); + pmap_pinit_common(pmap); } /* @@ -618,14 +635,12 @@ pmap_pinit0(struct pmap *pmap) * such as one in a vmspace structure. */ int -pmap_pinit(struct pmap *pmap) +pmap_pinit(pmap_t pmap) { - int i; - for (i = 0; i < IA64_VM_MINKERN_REGION; i++) - pmap->pm_rid[i] = pmap_allocate_rid(); - TAILQ_INIT(&pmap->pm_pvchunk); - bzero(&pmap->pm_stats, sizeof pmap->pm_stats); + CTR2(KTR_PMAP, "%s(%p)", __func__, pmap); + + pmap_pinit_common(pmap); return (1); } @@ -643,6 +658,8 @@ pmap_release(pmap_t pmap) { int i; + CTR2(KTR_PMAP, "%s(%p)", __func__, pmap); + for (i = 0; i < IA64_VM_MINKERN_REGION; i++) if (pmap->pm_rid[i]) pmap_free_rid(pmap->pm_rid[i]); @@ -658,6 +675,8 @@ pmap_growkernel(vm_offset_t addr) struct ia64_lpte *leaf; vm_page_t nkpg; + CTR2(KTR_PMAP, "%s(%#x)", __func__, addr); + while (kernel_vm_end <= addr) { if (nkpt == PAGE_SIZE/8 + PAGE_SIZE*PAGE_SIZE/64) panic("%s: out of kernel address space", __func__); @@ -1152,6 +1171,8 @@ pmap_extract(pmap_t pmap, vm_offset_t va pmap_t oldpmap; vm_paddr_t pa; + CTR3(KTR_PMAP, "%s(%p, %#x)", __func__, pmap, va); + pa = 0; PMAP_LOCK(pmap); oldpmap = pmap_switch(pmap); @@ -1178,6 +1199,8 @@ pmap_extract_and_hold(pmap_t pmap, vm_of vm_page_t m; vm_paddr_t pa; + CTR4(KTR_PMAP, "%s(%p, %#x, %#x)", __func__, pmap, va, prot); + pa = 0; m = NULL; PMAP_LOCK(pmap); @@ -1359,6 +1382,8 @@ pmap_kextract(vm_offset_t va) vm_paddr_t pa; u_int idx; + CTR2(KTR_PMAP, "%s(%#x)", __func__, va); + KASSERT(va >= VM_MAXUSER_ADDRESS, ("Must be kernel VA")); /* Regions 6 and 7 are direct mapped. */ @@ -1419,6 +1444,8 @@ pmap_qenter(vm_offset_t va, vm_page_t *m struct ia64_lpte *pte; int i; + CTR4(KTR_PMAP, "%s(%#x, %p, %d)", __func__, va, m, count); + for (i = 0; i < count; i++) { pte = pmap_find_kpte(va); if (pmap_present(pte)) @@ -1442,6 +1469,8 @@ pmap_qremove(vm_offset_t va, int count) struct ia64_lpte *pte; int i; + CTR3(KTR_PMAP, "%s(%#x, %d)", __func__, va, count); + for (i = 0; i < count; i++) { pte = pmap_find_kpte(va); if (pmap_present(pte)) { @@ -1458,10 +1487,12 @@ pmap_qremove(vm_offset_t va, int count) * to not have the PTE reflect that, nor update statistics. */ void -pmap_kenter(vm_offset_t va, vm_offset_t pa) +pmap_kenter(vm_offset_t va, vm_paddr_t pa) { struct ia64_lpte *pte; + CTR3(KTR_PMAP, "%s(%#x, %#x)", __func__, va, pa); + pte = pmap_find_kpte(va); if (pmap_present(pte)) pmap_invalidate_page(va); @@ -1480,6 +1511,8 @@ pmap_kremove(vm_offset_t va) { struct ia64_lpte *pte; + CTR2(KTR_PMAP, "%s(%#x)", __func__, va); + pte = pmap_find_kpte(va); if (pmap_present(pte)) { pmap_remove_vhpt(va); @@ -1503,6 +1536,10 @@ pmap_kremove(vm_offset_t va) vm_offset_t pmap_map(vm_offset_t *virt, vm_offset_t start, vm_offset_t end, int prot) { + + CTR5(KTR_PMAP, "%s(%p, %#x, %#x, %#x)", __func__, virt, start, end, + prot); + return IA64_PHYS_TO_RR7(start); } @@ -1522,6 +1559,8 @@ pmap_remove(pmap_t pmap, vm_offset_t sva vm_offset_t va; struct ia64_lpte *pte; + CTR4(KTR_PMAP, "%s(%p, %#x, %#x)", __func__, pmap, sva, eva); + /* * Perform an unsynchronized read. This is, however, safe. */ @@ -1553,13 +1592,14 @@ pmap_remove(pmap_t pmap, vm_offset_t sva * inefficient because they iteratively called * pmap_remove (slow...) */ - void pmap_remove_all(vm_page_t m) { pmap_t oldpmap; pv_entry_t pv; + CTR2(KTR_PMAP, "%s(%p)", __func__, m); + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_all: page %p is not managed", m)); rw_wlock(&pvh_global_lock); @@ -1592,6 +1632,9 @@ pmap_protect(pmap_t pmap, vm_offset_t sv pmap_t oldpmap; struct ia64_lpte *pte; + CTR5(KTR_PMAP, "%s(%p, %#x, %#x, %#x)", __func__, pmap, sva, eva, + prot); + if ((prot & VM_PROT_READ) == VM_PROT_NONE) { pmap_remove(pmap, sva, eva); return; @@ -1658,6 +1701,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, struct ia64_lpte *pte; boolean_t icache_inval, managed; + CTR6(KTR_PMAP, "pmap_enter(%p, %#x, %#x, %p, %#x, %u)", pmap, va, + access, m, prot, wired); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); oldpmap = pmap_switch(pmap); @@ -1789,6 +1835,9 @@ pmap_enter_object(pmap_t pmap, vm_offset vm_page_t m; vm_pindex_t diff, psize; + CTR6(KTR_PMAP, "%s(%p, %#x, %#x, %p, %#x)", __func__, pmap, start, + end, m_start, prot); + VM_OBJECT_ASSERT_LOCKED(m_start->object); psize = atop(end - start); @@ -1813,12 +1862,13 @@ pmap_enter_object(pmap_t pmap, vm_offset * 4. No page table pages. * but is *MUCH* faster than pmap_enter... */ - void pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot) { pmap_t oldpmap; + CTR5(KTR_PMAP, "%s(%p, %#x, %p, %#x)", __func__, pmap, va, m, prot); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); oldpmap = pmap_switch(pmap); @@ -1876,11 +1926,13 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ * faults on process startup and immediately after an mmap. */ void -pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, - vm_object_t object, vm_pindex_t pindex, - vm_size_t size) +pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, vm_object_t object, + vm_pindex_t pindex, vm_size_t size) { + CTR6(KTR_PMAP, "%s(%p, %#x, %p, %u, %#x)", __func__, pmap, addr, + object, pindex, size); + VM_OBJECT_ASSERT_WLOCKED(object); KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG, ("pmap_object_init_pt: non-device object")); @@ -1894,14 +1946,13 @@ pmap_object_init_pt(pmap_t pmap, vm_offs * The mapping must already exist in the pmap. */ void -pmap_change_wiring(pmap, va, wired) - register pmap_t pmap; - vm_offset_t va; - boolean_t wired; +pmap_change_wiring(pmap_t pmap, vm_offset_t va, boolean_t wired) { pmap_t oldpmap; struct ia64_lpte *pte; + CTR4(KTR_PMAP, "%s(%p, %#x, %u)", __func__, pmap, va, wired); + PMAP_LOCK(pmap); oldpmap = pmap_switch(pmap); @@ -1919,8 +1970,6 @@ pmap_change_wiring(pmap, va, wired) PMAP_UNLOCK(pmap); } - - /* * Copy the range specified by src_addr/len * from the source map to the range dst_addr/len @@ -1928,30 +1977,31 @@ pmap_change_wiring(pmap, va, wired) * * This routine is only advisory and need not do anything. */ - void -pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len, - vm_offset_t src_addr) +pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_va, vm_size_t len, + vm_offset_t src_va) { -} + CTR6(KTR_PMAP, "%s(%p, %p, %#x, %#x, %#x)", __func__, dst_pmap, + src_pmap, dst_va, len, src_va); +} /* * pmap_zero_page zeros the specified hardware page by * mapping it into virtual memory and using bzero to clear * its contents. */ - void pmap_zero_page(vm_page_t m) { void *p; + CTR2(KTR_PMAP, "%s(%p)", __func__, m); + p = (void *)pmap_page_to_va(m); bzero(p, PAGE_SIZE); } - /* * pmap_zero_page_area zeros the specified hardware page by * mapping it into virtual memory and using bzero to clear @@ -1959,33 +2009,33 @@ pmap_zero_page(vm_page_t m) * * off and size must reside within a single page. */ - void pmap_zero_page_area(vm_page_t m, int off, int size) { char *p; + CTR4(KTR_PMAP, "%s(%p, %d, %d)", __func__, m, off, size); + p = (void *)pmap_page_to_va(m); bzero(p + off, size); } - /* * pmap_zero_page_idle zeros the specified hardware page by * mapping it into virtual memory and using bzero to clear * its contents. This is for the vm_idlezero process. */ - void pmap_zero_page_idle(vm_page_t m) { void *p; + CTR2(KTR_PMAP, "%s(%p)", __func__, m); + p = (void *)pmap_page_to_va(m); bzero(p, PAGE_SIZE); } - /* * pmap_copy_page copies the specified (machine independent) * page by mapping the page into virtual memory and using @@ -1997,13 +2047,13 @@ pmap_copy_page(vm_page_t msrc, vm_page_t { void *dst, *src; + CTR3(KTR_PMAP, "%s(%p, %p)", __func__, msrc, mdst); + src = (void *)pmap_page_to_va(msrc); dst = (void *)pmap_page_to_va(mdst); bcopy(src, dst, PAGE_SIZE); } -int unmapped_buf_allowed; - void pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[], vm_offset_t b_offset, int xfersize) @@ -2012,6 +2062,9 @@ pmap_copy_pages(vm_page_t ma[], vm_offse vm_offset_t a_pg_offset, b_pg_offset; int cnt; + CTR6(KTR_PMAP, "%s(%p, %#x, %p, %#x, %#x)", __func__, ma, + a_offset, mb, b_offset, xfersize); + while (xfersize > 0) { a_pg_offset = a_offset & PAGE_MASK; cnt = min(xfersize, PAGE_SIZE - a_pg_offset); @@ -2042,6 +2095,8 @@ pmap_page_exists_quick(pmap_t pmap, vm_p int loops = 0; boolean_t rv; + CTR3(KTR_PMAP, "%s(%p, %p)", __func__, pmap, m); + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_page_exists_quick: page %p is not managed", m)); rv = FALSE; @@ -2073,6 +2128,8 @@ pmap_page_wired_mappings(vm_page_t m) pv_entry_t pv; int count; + CTR2(KTR_PMAP, "%s(%p)", __func__, m); + count = 0; if ((m->oflags & VPO_UNMANAGED) != 0) return (count); @@ -2112,6 +2169,8 @@ pmap_remove_pages(pmap_t pmap) u_long inuse, bitmask; int allfree, bit, field, idx; + CTR2(KTR_PMAP, "%s(%p)", __func__, pmap); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); oldpmap = pmap_switch(pmap); @@ -2179,6 +2238,8 @@ pmap_ts_referenced(vm_page_t m) pv_entry_t pv; int count = 0; + CTR2(KTR_PMAP, "%s(%p)", __func__, m); + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_ts_referenced: page %p is not managed", m)); rw_wlock(&pvh_global_lock); @@ -2214,6 +2275,8 @@ pmap_is_modified(vm_page_t m) pv_entry_t pv; boolean_t rv; + CTR2(KTR_PMAP, "%s(%p)", __func__, m); + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_modified: page %p is not managed", m)); rv = FALSE; @@ -2254,6 +2317,8 @@ pmap_is_prefaultable(pmap_t pmap, vm_off { struct ia64_lpte *pte; + CTR3(KTR_PMAP, "%s(%p, %#x)", __func__, pmap, addr); + pte = pmap_find_vhpt(addr); if (pte != NULL && pmap_present(pte)) return (FALSE); @@ -2274,6 +2339,8 @@ pmap_is_referenced(vm_page_t m) pv_entry_t pv; boolean_t rv; + CTR2(KTR_PMAP, "%s(%p)", __func__, m); + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_is_referenced: page %p is not managed", m)); rv = FALSE; @@ -2306,6 +2373,9 @@ pmap_advise(pmap_t pmap, vm_offset_t sva pmap_t oldpmap; vm_page_t m; + CTR5(KTR_PMAP, "%s(%p, %#x, %#x, %d)", __func__, pmap, sva, eva, + advice); + PMAP_LOCK(pmap); oldpmap = pmap_switch(pmap); for (; sva < eva; sva += PAGE_SIZE) { @@ -2348,6 +2418,8 @@ pmap_clear_modify(vm_page_t m) pmap_t oldpmap, pmap; pv_entry_t pv; + CTR2(KTR_PMAP, "%s(%p)", __func__, m); + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); VM_OBJECT_ASSERT_WLOCKED(m->object); @@ -2389,6 +2461,8 @@ pmap_remove_write(vm_page_t m) pv_entry_t pv; vm_prot_t prot; + CTR2(KTR_PMAP, "%s(%p)", __func__, m); + KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_write: page %p is not managed", m)); @@ -2425,20 +2499,13 @@ pmap_remove_write(vm_page_t m) rw_wunlock(&pvh_global_lock); } -/* - * Map a set of physical memory pages into the kernel virtual - * address space. Return a pointer to where it is mapped. This - * routine is intended to be used for mapping device memory, - * NOT real memory. - */ -void * -pmap_mapdev(vm_paddr_t pa, vm_size_t sz) +vm_offset_t +pmap_mapdev_priv(vm_paddr_t pa, vm_size_t sz, vm_memattr_t attr) { - static void *last_va = NULL; - static vm_paddr_t last_pa = 0; + static vm_offset_t last_va = 0; + static vm_paddr_t last_pa = ~0UL; static vm_size_t last_sz = 0; struct efi_md *md; - vm_offset_t va; if (pa == last_pa && sz == last_sz) return (last_va); @@ -2447,30 +2514,47 @@ pmap_mapdev(vm_paddr_t pa, vm_size_t sz) if (md == NULL) { printf("%s: [%#lx..%#lx] not covered by memory descriptor\n", __func__, pa, pa + sz - 1); - return ((void *)IA64_PHYS_TO_RR6(pa)); + return (IA64_PHYS_TO_RR6(pa)); } if (md->md_type == EFI_MD_TYPE_FREE) { printf("%s: [%#lx..%#lx] is in DRAM\n", __func__, pa, pa + sz - 1); - return (NULL); + return (0); } - va = (md->md_attr & EFI_MD_ATTR_WB) ? IA64_PHYS_TO_RR7(pa) : + last_va = (md->md_attr & EFI_MD_ATTR_WB) ? IA64_PHYS_TO_RR7(pa) : IA64_PHYS_TO_RR6(pa); - - last_va = (void *)va; last_pa = pa; last_sz = sz; return (last_va); } /* - * 'Unmap' a range mapped by pmap_mapdev(). + * Map a set of physical memory pages into the kernel virtual + * address space. Return a pointer to where it is mapped. This + * routine is intended to be used for mapping device memory, + * NOT real memory. + */ +void * +pmap_mapdev_attr(vm_paddr_t pa, vm_size_t sz, vm_memattr_t attr) +{ + vm_offset_t va; + + CTR4(KTR_PMAP, "%s(%#x, %#x, %#x)", __func__, pa, sz, attr); + + va = pmap_mapdev_priv(pa, sz, attr); + return ((void *)(uintptr_t)va); +} + +/* + * 'Unmap' a range mapped by pmap_mapdev_attr(). */ void pmap_unmapdev(vm_offset_t va, vm_size_t size) { + + CTR3(KTR_PMAP, "%s(%#x, %#x)", __func__, va, size); } /* @@ -2496,6 +2580,8 @@ pmap_page_set_memattr(vm_page_t m, vm_me pv_entry_t pv; void *va; + CTR3(KTR_PMAP, "%s(%p, %#x)", __func__, m, ma); + rw_wlock(&pvh_global_lock); m->md.memattr = ma; TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { @@ -2542,6 +2628,8 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad vm_paddr_t pa; int val; + CTR4(KTR_PMAP, "%s(%p, %#x, %p)", __func__, pmap, addr, locked_pa); + PMAP_LOCK(pmap); retry: oldpmap = pmap_switch(pmap); @@ -2574,9 +2662,15 @@ out: return (val); } +/* + * + */ void pmap_activate(struct thread *td) { + + CTR2(KTR_PMAP, "%s(%p)", __func__, td); + pmap_switch(vmspace_pmap(td->td_proc->p_vmspace)); } @@ -2609,6 +2703,9 @@ out: return (prevpm); } +/* + * + */ void pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz) { @@ -2617,6 +2714,8 @@ pmap_sync_icache(pmap_t pm, vm_offset_t vm_offset_t lim; vm_size_t len; + CTR4(KTR_PMAP, "%s(%p, %#x, %#x)", __func__, pm, va, sz); + sz += va & 31; va &= ~31; sz = (sz + 31) & ~31; @@ -2644,6 +2743,9 @@ void pmap_align_superpage(vm_object_t object, vm_ooffset_t offset, vm_offset_t *addr, vm_size_t size) { + + CTR5(KTR_PMAP, "%s(%p, %#x, %p, %#x)", __func__, object, offset, addr, + size); } #include "opt_ddb.h" Modified: head/sys/ia64/include/pmap.h ============================================================================== --- head/sys/ia64/include/pmap.h Wed Mar 19 21:03:04 2014 (r263379) +++ head/sys/ia64/include/pmap.h Wed Mar 19 21:30:10 2014 (r263380) @@ -114,24 +114,29 @@ extern vm_offset_t virtual_end; extern uint64_t pmap_vhpt_base[]; extern int pmap_vhpt_log2size; +#define pmap_mapbios(pa,sz) pmap_mapdev_attr(pa,sz,VM_MEMATTR_UNCACHEABLE) +#define pmap_mapdev(pa,sz) pmap_mapdev_attr(pa,sz,VM_MEMATTR_UNCACHEABLE) +#define pmap_unmapbios(va,sz) pmap_unmapdev(va,sz) + #define pmap_page_get_memattr(m) ((m)->md.memattr) -#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) +#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) #define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) -#define pmap_mapbios(pa, sz) pmap_mapdev(pa, sz) -#define pmap_unmapbios(va, sz) pmap_unmapdev(va, sz) -vm_offset_t pmap_alloc_vhpt(void); -void pmap_bootstrap(void); -void pmap_invalidate_all(void); -void pmap_kenter(vm_offset_t va, vm_offset_t pa); +void pmap_kenter(vm_offset_t va, vm_paddr_t pa); vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kremove(vm_offset_t); -void *pmap_mapdev(vm_paddr_t, vm_size_t); +void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, vm_memattr_t); void pmap_page_set_memattr(vm_page_t, vm_memattr_t); +void pmap_unmapdev(vm_offset_t, vm_size_t); + +/* Machine-architecture private */ +vm_offset_t pmap_alloc_vhpt(void); +void pmap_bootstrap(void); +void pmap_invalidate_all(void); +vm_offset_t pmap_mapdev_priv(vm_paddr_t, vm_size_t, vm_memattr_t); vm_offset_t pmap_page_to_va(vm_page_t); vm_offset_t pmap_steal_memory(vm_size_t); struct pmap *pmap_switch(struct pmap *pmap); -void pmap_unmapdev(vm_offset_t, vm_size_t); #endif /* _KERNEL */ From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 22:43:20 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1023E5CF; Wed, 19 Mar 2014 22:43:20 +0000 (UTC) Received: from gw.catspoiler.org (gw.catspoiler.org [75.1.14.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CADA6960; Wed, 19 Mar 2014 22:43:19 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s2JMh4iP088793; Wed, 19 Mar 2014 14:43:08 -0800 (PST) (envelope-from truckman@FreeBSD.org) Message-Id: <201403192243.s2JMh4iP088793@gw.catspoiler.org> Date: Wed, 19 Mar 2014 15:43:04 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r263379 - in head/sys: amd64/amd64 i386/i386 i386/xen isa pc98/cbus x86/isa x86/x86 To: imp@FreeBSD.org In-Reply-To: <201403192103.s2JL35NB037915@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 22:43:20 -0000 On 19 Mar, Warner Losh wrote: > Author: imp > Date: Wed Mar 19 21:03:04 2014 > New Revision: 263379 > URL: http://svnweb.freebsd.org/changeset/base/263379 > > Log: > Remove vestiges of knowing the ISA bus, which we gave up on around 20 > years ago. Remove redunant copy of isaregs.h. It hasn't been that long ... At $ork we were still running a number of FreeBSD machines with ISA slots in 2002. I don't think we were using any ISA cards, except an Etinc ET/5025 to connect to a T-1. I've still got a FreeBSD box here in daily use that has ISA slots. From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 22:53:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EE80B7F for ; Wed, 19 Mar 2014 22:53:56 +0000 (UTC) Received: from mail-pb0-f49.google.com (mail-pb0-f49.google.com [209.85.160.49]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 11B6CA4C for ; Wed, 19 Mar 2014 22:53:55 +0000 (UTC) Received: by mail-pb0-f49.google.com with SMTP id jt11so23615pbb.8 for ; Wed, 19 Mar 2014 15:53:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=l+dvuzCCq8+k52ryYygGwMBu92m+pxp+HLKrZQOuV+E=; b=V9Mkt4lYTEj6umWHY4WXaXo3z2GA3NM02Bj+qb/T/qn+jIJ+oKoH99p8MiW+Uywsdi oz3OADyjLWlajYiHM58n4AnGF8UUWzqN53t2LqR+wdSwQfghVIugjuxQEQer0AMIYrxh rNaADbgixGbrSqi2gUopLskAVUWE/sDii3MMpCLm9Jcjxz61v7SMUcr6mYw+dI1dnKyX +0w85uMjHQMBZ7YJDVIPS81k5Vhybb9LFkZa+VwCyfRfQaGzu4qiHccC0zYceLlTvfK8 Yarw7uznQTLpapVs6IFBKdoeM9otshy67f1QRtnqcdd47eTB+QBL8XvvLknF9FuZh3Dr uoWA== X-Gm-Message-State: ALoCoQmXzXHnP5bdbyIstW5dToI35Lwia6crUsUCA2T08BECYuchBsW13kx2BbnRZGzVOTfjHuV6 X-Received: by 10.68.201.10 with SMTP id jw10mr42641467pbc.25.1395269635500; Wed, 19 Mar 2014 15:53:55 -0700 (PDT) Received: from bsdimp.corp.netflix.com ([69.53.237.72]) by mx.google.com with ESMTPSA id y4sm546704pbk.76.2014.03.19.15.53.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Mar 2014 15:53:54 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263379 - in head/sys: amd64/amd64 i386/i386 i386/xen isa pc98/cbus x86/isa x86/x86 From: Warner Losh In-Reply-To: <201403192243.s2JMh4iP088793@gw.catspoiler.org> Date: Wed, 19 Mar 2014 15:53:52 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <3B6D3522-BAA4-4FBF-9B5B-367D98D9763B@bsdimp.com> References: <201403192243.s2JMh4iP088793@gw.catspoiler.org> To: Don Lewis X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, imp@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 22:53:56 -0000 On Mar 19, 2014, at 3:43 PM, Don Lewis wrote: > On 19 Mar, Warner Losh wrote: >> Author: imp >> Date: Wed Mar 19 21:03:04 2014 >> New Revision: 263379 >> URL: http://svnweb.freebsd.org/changeset/base/263379 >>=20 >> Log: >> Remove vestiges of knowing the ISA bus, which we gave up on around = 20 >> years ago. Remove redunant copy of isaregs.h. >=20 > It hasn't been that long ... >=20 > At $ork we were still running a number of FreeBSD machines with ISA > slots in 2002. I don't think we were using any ISA cards, except an > Etinc ET/5025 to connect to a T-1. >=20 > I've still got a FreeBSD box here in daily use that has ISA slots. We still support ISA cards, and this doesn=92t change that at all. This = just retires a bunch of #defines that haven=92t been used in about 20 years (well, = maybe only 15 years) and removes a redundant copy of what remains... Warner From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 23:04:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73A94E81; Wed, 19 Mar 2014 23:04:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 60E4AB24; Wed, 19 Mar 2014 23:04:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JN4rPF086712; Wed, 19 Mar 2014 23:04:53 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JN4reH086711; Wed, 19 Mar 2014 23:04:53 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403192304.s2JN4reH086711@svn.freebsd.org> From: Xin LI Date: Wed, 19 Mar 2014 23:04:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263385 - head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 23:04:53 -0000 Author: delphij Date: Wed Mar 19 23:04:52 2014 New Revision: 263385 URL: http://svnweb.freebsd.org/changeset/base/263385 Log: Remove unused option -r from zpool. Submitted by: Richard Yao MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Mar 19 22:50:14 2014 (r263384) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Mar 19 23:04:52 2014 (r263385) @@ -1969,7 +1969,7 @@ zpool_do_import(int argc, char **argv) char *endptr; /* check options */ - while ((c = getopt(argc, argv, ":aCc:d:DEfFmnNo:rR:T:VX")) != -1) { + while ((c = getopt(argc, argv, ":aCc:d:DEfFmnNo:R:T:VX")) != -1) { switch (c) { case 'a': do_all = B_TRUE; From owner-svn-src-head@FreeBSD.ORG Wed Mar 19 23:29:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB84E902; Wed, 19 Mar 2014 23:29:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9917AD12; Wed, 19 Mar 2014 23:29:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2JNT0ZP095431; Wed, 19 Mar 2014 23:29:00 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2JNT0OE095430; Wed, 19 Mar 2014 23:29:00 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403192329.s2JNT0OE095430@svn.freebsd.org> From: Julio Merino Date: Wed, 19 Mar 2014 23:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263388 - head/usr.bin/sed/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 23:29:00 -0000 Author: jmmv Date: Wed Mar 19 23:29:00 2014 New Revision: 263388 URL: http://svnweb.freebsd.org/changeset/base/263388 Log: Mark multi_test as requiring /usr/share/dict/words. The file may not be present if MK_DICT=no. Pointed out by Casey Peel. Modified: head/usr.bin/sed/tests/Makefile Modified: head/usr.bin/sed/tests/Makefile ============================================================================== --- head/usr.bin/sed/tests/Makefile Wed Mar 19 23:22:25 2014 (r263387) +++ head/usr.bin/sed/tests/Makefile Wed Mar 19 23:29:00 2014 (r263388) @@ -4,6 +4,7 @@ TESTSDIR= ${TESTSBASE}/usr.bin/sed TAP_TESTS_SH= legacy_test TAP_TESTS_SH+= multi_test +TEST_METADATA.multi_test+= required_files="/usr/share/dict/words" TAP_TESTS_SH+= inplace_race_test FILESDIR= ${TESTSDIR} From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 01:58:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CAB89B7; Thu, 20 Mar 2014 01:58:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6956FDB8; Thu, 20 Mar 2014 01:58:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2K1w5Fv058132; Thu, 20 Mar 2014 01:58:05 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2K1w5Rt058130; Thu, 20 Mar 2014 01:58:05 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201403200158.s2K1w5Rt058130@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 20 Mar 2014 01:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263412 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 01:58:05 -0000 Author: np Date: Thu Mar 20 01:58:04 2014 New Revision: 263412 URL: http://svnweb.freebsd.org/changeset/base/263412 Log: cxgbe(4): if_iqdrops statistic should include tunnel congestion drops. MFC after: 1 week Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Mar 20 00:46:25 2014 (r263411) +++ head/sys/dev/cxgbe/t4_main.c Thu Mar 20 01:58:04 2014 (r263412) @@ -4085,6 +4085,7 @@ static void cxgbe_tick(void *arg) { struct port_info *pi = arg; + struct adapter *sc = pi->adapter; struct ifnet *ifp = pi->ifp; struct sge_txq *txq; int i, drops; @@ -4096,7 +4097,7 @@ cxgbe_tick(void *arg) return; /* without scheduling another callout */ } - t4_get_port_stats(pi->adapter, pi->tx_chan, s); + t4_get_port_stats(sc, pi->tx_chan, s); ifp->if_opackets = s->tx_frames - s->tx_pause; ifp->if_ipackets = s->rx_frames - s->rx_pause; @@ -4107,6 +4108,19 @@ cxgbe_tick(void *arg) ifp->if_iqdrops = s->rx_ovflow0 + s->rx_ovflow1 + s->rx_ovflow2 + s->rx_ovflow3 + s->rx_trunc0 + s->rx_trunc1 + s->rx_trunc2 + s->rx_trunc3; + for (i = 0; i < 4; i++) { + if (pi->rx_chan_map & (1 << i)) { + uint32_t v; + + /* + * XXX: indirect reads from the same ADDR/DATA pair can + * race with each other. + */ + t4_read_indirect(sc, A_TP_MIB_INDEX, A_TP_MIB_DATA, &v, + 1, A_TP_MIB_TNL_CNG_DROP_0 + i); + ifp->if_iqdrops += v; + } + } drops = s->tx_drop; for_each_txq(pi, i, txq) From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 02:23:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6A59D29; Thu, 20 Mar 2014 02:23:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A2085FDA; Thu, 20 Mar 2014 02:23:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2K2NqKO069803; Thu, 20 Mar 2014 02:23:52 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2K2NqHK069802; Thu, 20 Mar 2014 02:23:52 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201403200223.s2K2NqHK069802@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 20 Mar 2014 02:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263413 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 02:23:52 -0000 Author: np Date: Thu Mar 20 02:23:52 2014 New Revision: 263413 URL: http://svnweb.freebsd.org/changeset/base/263413 Log: Add a shorter alias for if_data.ifi_oqdrops. Modified: head/sys/net/if_var.h Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Mar 20 01:58:04 2014 (r263412) +++ head/sys/net/if_var.h Thu Mar 20 02:23:52 2014 (r263413) @@ -226,6 +226,7 @@ struct ifnet { #define if_imcasts if_data.ifi_imcasts #define if_omcasts if_data.ifi_omcasts #define if_iqdrops if_data.ifi_iqdrops +#define if_oqdrops if_data.ifi_oqdrops #define if_noproto if_data.ifi_noproto #define if_lastchange if_data.ifi_lastchange From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 02:28:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3FD7F97; Thu, 20 Mar 2014 02:28:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B140F9; Thu, 20 Mar 2014 02:28:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2K2S5ML070344; Thu, 20 Mar 2014 02:28:05 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2K2S5jv070343; Thu, 20 Mar 2014 02:28:05 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201403200228.s2K2S5jv070343@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 20 Mar 2014 02:28:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263415 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 02:28:05 -0000 Author: np Date: Thu Mar 20 02:28:05 2014 New Revision: 263415 URL: http://svnweb.freebsd.org/changeset/base/263415 Log: cxgbe(4): Use ifi_oqdrops in if_data to count drops in the tx path. Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Mar 20 02:27:25 2014 (r263414) +++ head/sys/dev/cxgbe/t4_main.c Thu Mar 20 02:28:05 2014 (r263415) @@ -4125,7 +4125,7 @@ cxgbe_tick(void *arg) drops = s->tx_drop; for_each_txq(pi, i, txq) drops += txq->br->br_drops; - ifp->if_snd.ifq_drops = drops; + ifp->if_oqdrops = drops; ifp->if_oerrors = s->tx_error_frames; ifp->if_ierrors = s->rx_jabber + s->rx_runt + s->rx_too_long + From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 04:47:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3256F63D; Thu, 20 Mar 2014 04:47:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1F8E0DF1; Thu, 20 Mar 2014 04:47:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2K4lYxT027138; Thu, 20 Mar 2014 04:47:34 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2K4lY2c027137; Thu, 20 Mar 2014 04:47:34 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403200447.s2K4lY2c027137@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Mar 2014 04:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263416 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 04:47:35 -0000 Author: adrian Date: Thu Mar 20 04:47:34 2014 New Revision: 263416 URL: http://svnweb.freebsd.org/changeset/base/263416 Log: Don't call ath_init() inside the lock. Yes, this means that sc_invalid is slightly racy, but there are other issues here which need fixing. This fixes a source of eventual LORs - ath_init() grabs ATH_LOCK to do work and releases it before it calls ieee80211_start_all(). ieee80211_start_all() will grab the net80211 comlock to iterate over the VAPs. TODO: * .. I should just migrate the ieee80211_start_all() work to a deferred task so it can be done later; it doesn't have to be immediately done. Tested: * AR5416, STA mode Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Mar 20 02:28:05 2014 (r263415) +++ head/sys/dev/ath/if_ath.c Thu Mar 20 04:47:34 2014 (r263416) @@ -5948,14 +5948,15 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, switch (cmd) { case SIOCSIFFLAGS: - ATH_LOCK(sc); if (IS_RUNNING(ifp)) { /* * To avoid rescanning another access point, * do not call ath_init() here. Instead, * only reflect promisc mode settings. */ + ATH_LOCK(sc); ath_mode_init(sc); + ATH_UNLOCK(sc); } else if (ifp->if_flags & IFF_UP) { /* * Beware of being called during attach/detach @@ -5969,14 +5970,15 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, if (!sc->sc_invalid) ath_init(sc); /* XXX lose error */ } else { + ATH_LOCK(sc); ath_stop_locked(ifp); #ifdef notyet /* XXX must wakeup in places like ath_vap_delete */ if (!sc->sc_invalid) ath_hal_setpower(sc->sc_ah, HAL_PM_FULL_SLEEP); #endif + ATH_UNLOCK(sc); } - ATH_UNLOCK(sc); break; case SIOCGIFMEDIA: case SIOCSIFMEDIA: From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 05:08:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE11B96A; Thu, 20 Mar 2014 05:08:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9AF0CF44; Thu, 20 Mar 2014 05:08:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2K58VgP035356; Thu, 20 Mar 2014 05:08:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2K58V6g035355; Thu, 20 Mar 2014 05:08:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403200508.s2K58V6g035355@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Mar 2014 05:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263417 - head/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 05:08:31 -0000 Author: adrian Date: Thu Mar 20 05:08:31 2014 New Revision: 263417 URL: http://svnweb.freebsd.org/changeset/base/263417 Log: Shuffle ah_powerMode to be in a sane spot for the given power operation. This way the state changes from sleep->awake before the registers are poked and from awake->sleep after the registers are poked. This way spurious warnings aren't printed by my (to be committed) debugging code. Tested: * AR5416, STA Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c Thu Mar 20 04:47:34 2014 (r263416) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c Thu Mar 20 05:08:31 2014 (r263417) @@ -140,20 +140,22 @@ ar5416SetPowerMode(struct ath_hal *ah, H modes[ah->ah_powerMode], modes[mode], setChip ? "set chip " : ""); switch (mode) { case HAL_PM_AWAKE: + ah->ah_powerMode = mode; status = ar5416SetPowerModeAwake(ah, setChip); break; case HAL_PM_FULL_SLEEP: ar5416SetPowerModeSleep(ah, setChip); + ah->ah_powerMode = mode; break; case HAL_PM_NETWORK_SLEEP: ar5416SetPowerModeNetworkSleep(ah, setChip); + ah->ah_powerMode = mode; break; default: HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unknown power mode 0x%x\n", __func__, mode); return AH_FALSE; } - ah->ah_powerMode = mode; return status; } From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 05:10:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61FA1AE7; Thu, 20 Mar 2014 05:10:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 35F14F9A; Thu, 20 Mar 2014 05:10:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2K5AIjg035656; Thu, 20 Mar 2014 05:10:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2K5AIj5035655; Thu, 20 Mar 2014 05:10:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403200510.s2K5AIj5035655@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Mar 2014 05:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263418 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 05:10:18 -0000 Author: adrian Date: Thu Mar 20 05:10:17 2014 New Revision: 263418 URL: http://svnweb.freebsd.org/changeset/base/263418 Log: Add some debugging code to print out if registers are touched whilst the device is asleep. This doesn't avoid logging errors for things that are actually OK to access whilst the chip is asleep (eg, the RTC registers (0x7000->0x70ff on the AR5416 and later.) But, this is a pretty good indicator if things are accessed incorrectly. Tested: * AR5416, STA Modified: head/sys/dev/ath/ah_osdep.c Modified: head/sys/dev/ath/ah_osdep.c ============================================================================== --- head/sys/dev/ath/ah_osdep.c Thu Mar 20 05:08:31 2014 (r263417) +++ head/sys/dev/ath/ah_osdep.c Thu Mar 20 05:10:17 2014 (r263418) @@ -253,6 +253,12 @@ ath_hal_reg_write(struct ath_hal *ah, u_ bus_space_tag_t tag = BUSTAG(ah); bus_space_handle_t h = ah->ah_sh; + /* Debug - complain if we haven't fully waken things up */ + if (ah->ah_powerMode != HAL_PM_AWAKE) { + ath_hal_printf(ah, "%s: reg=0x%08x, val=0x%08x, pm=%d\n", + __func__, reg, val, ah->ah_powerMode); + } + if (ath_hal_alq) { struct ale *ale = ath_hal_alq_get(ah); if (ale) { @@ -278,6 +284,12 @@ ath_hal_reg_read(struct ath_hal *ah, u_i bus_space_handle_t h = ah->ah_sh; u_int32_t val; + /* Debug - complain if we haven't fully waken things up */ + if (ah->ah_powerMode != HAL_PM_AWAKE) { + ath_hal_printf(ah, "%s: reg=0x%08x, pm=%d\n", + __func__, reg, ah->ah_powerMode); + } + if (ah->ah_config.ah_serialise_reg_war) mtx_lock_spin(&ah_regser_mtx); val = bus_space_read_4(tag, h, reg); @@ -330,6 +342,12 @@ ath_hal_reg_write(struct ath_hal *ah, u_ bus_space_tag_t tag = BUSTAG(ah); bus_space_handle_t h = ah->ah_sh; + /* Debug - complain if we haven't fully waken things up */ + if (ah->ah_powerMode != HAL_PM_AWAKE) { + ath_hal_printf(ah, "%s: reg=0x%08x, val=0x%08x, pm=%d\n", + __func__, reg, val, ah->ah_powerMode); + } + if (ah->ah_config.ah_serialise_reg_war) mtx_lock_spin(&ah_regser_mtx); bus_space_write_4(tag, h, reg, val); @@ -344,6 +362,12 @@ ath_hal_reg_read(struct ath_hal *ah, u_i bus_space_handle_t h = ah->ah_sh; u_int32_t val; + /* Debug - complain if we haven't fully waken things up */ + if (ah->ah_powerMode != HAL_PM_AWAKE) { + ath_hal_printf(ah, "%s: reg=0x%08x, pm=%d\n", + __func__, reg, ah->ah_powerMode); + } + if (ah->ah_config.ah_serialise_reg_war) mtx_lock_spin(&ah_regser_mtx); val = bus_space_read_4(tag, h, reg); From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 05:59:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EBF7DF41; Thu, 20 Mar 2014 05:59:11 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 75783647; Thu, 20 Mar 2014 05:59:10 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s2K5x7xp016539 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 20 Mar 2014 09:59:07 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s2K5x7Xh016538; Thu, 20 Mar 2014 09:59:07 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 20 Mar 2014 09:59:07 +0400 From: Gleb Smirnoff To: Navdeep Parhar Subject: Re: svn commit: r263415 - head/sys/dev/cxgbe Message-ID: <20140320055907.GH1499@FreeBSD.org> References: <201403200228.s2K2S5jv070343@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201403200228.s2K2S5jv070343@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 05:59:12 -0000 On Thu, Mar 20, 2014 at 02:28:05AM +0000, Navdeep Parhar wrote: N> Author: np N> Date: Thu Mar 20 02:28:05 2014 N> New Revision: 263415 N> URL: http://svnweb.freebsd.org/changeset/base/263415 N> N> Log: N> cxgbe(4): Use ifi_oqdrops in if_data to count drops in the tx path. Thanks for this one and for r263413 :) -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 06:22:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1241E2F8; Thu, 20 Mar 2014 06:22:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F384389B; Thu, 20 Mar 2014 06:22:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2K6MdD1066517; Thu, 20 Mar 2014 06:22:39 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2K6MdST066516; Thu, 20 Mar 2014 06:22:39 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403200622.s2K6MdST066516@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 20 Mar 2014 06:22:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263419 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 06:22:40 -0000 Author: glebius Date: Thu Mar 20 06:22:39 2014 New Revision: 263419 URL: http://svnweb.freebsd.org/changeset/base/263419 Log: Since mlaier has been inactive for a long time, grab maintainership on pf. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Thu Mar 20 05:10:17 2014 (r263418) +++ head/MAINTAINERS Thu Mar 20 06:22:39 2014 (r263419) @@ -77,7 +77,7 @@ ntp roberto Pre-commit review r inetd dwmalone Recommends pre-commit review. contrib/smbfs bp Open for in-tree committs. In case of functional changes pre-commit review requested. -contrib/pf mlaier Pre-commit review requested. +contrib/pf glebius Pre-commit review recommended. binutils obrien Insists on BU blocked from unapproved commits file obrien Insists to keep file blocked from other's unapproved commits From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 07:26:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44EE5A3E; Thu, 20 Mar 2014 07:26:41 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1F660CF3; Thu, 20 Mar 2014 07:26:40 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s2K7QYEn055867 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 20 Mar 2014 00:26:34 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s2K7QXEX055866; Thu, 20 Mar 2014 00:26:33 -0700 (PDT) (envelope-from jmg) Date: Thu, 20 Mar 2014 00:26:33 -0700 From: John-Mark Gurney To: Alan Cox Subject: Re: svn commit: r263214 - in head/sys: compat/freebsd32 kern sys Message-ID: <20140320072633.GJ32089@funkthat.com> References: <201403160053.s2G0rfmA073668@svn.freebsd.org> <20140316012609.GY32089@funkthat.com> <5329C657.3000705@rice.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5329C657.3000705@rice.edu> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 20 Mar 2014 00:26:34 -0700 (PDT) Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 07:26:41 -0000 Alan Cox wrote this message on Wed, Mar 19, 2014 at 11:31 -0500: > On 03/15/2014 20:26, John-Mark Gurney wrote: > > Adrian Chadd wrote this message on Sat, Mar 15, 2014 at 18:17 -0700: > >> How far along does it get? > > It rarely gets to multiuser, and even if it does, it panics very > > shortly afterward: > > panic: vm_page_alloc: page 0xc0805db0 is wired > > > > I did finally get around to dumping the vm_page struct for it (the > > CTF crazyness) and I did send it to alc and kib, but neither one has > > replied... > > > > here is a dump in case someone else has some vm_page clue: > > {'act_count': '\x00', > > 'aflags': '\x00', > > 'busy_lock': 1, > > 'dirty': '\xff', > > 'flags': 0, > > 'hold_count': 0, > > 'listq': {'tqe_next': 0xc0805e00, 'tqe_prev': 0xc06d18a0}, > > 'md': {'pv_kva': 3235856384, > > 'pv_list': {'tqh_first': 0x0, 'tqh_last': 0xc0805de0}, > > 'pv_memattr': '\x00', > > 'pvh_attrs': 0}, > > 'object': 0xc06d1878, > > 'oflags': '\x04', > > 'order': '\t', > > 'phys_addr': 17776640, > > 'pindex': 3572, > > 'plinks': {'memguard': {'p': 0, 'v': 3228376932}, > > 'q': {'tqe_next': 0x0, 'tqe_prev': 0xc06d1f64}, > > 's': {'pv': 0xc06d1f64, 'ss': {'sle_next': 0x0}}}, > > 'pool': '\x00', > > 'queue': '\xff', > > 'segind': '\x01', > > 'valid': '\xff', > > 'wire_count': 1} > > > > and as you can see, wire_count is not 0... but looks resonable... > > There are several things wrong with this page. > > Two lines later, this assertion would also fail: > > KASSERT(m->dirty == 0, ("vm_page_alloc: page %p is dirty", m)); > > because a page in the cache/free lists should never be dirty. > > The page's flags field doesn't include PG_CACHED. So, the object field > should be NULL and the valid field should be 0, but they are not. > > All of these fields are (explicitly) cleared when a page is freed (cf. > vm_page_free_toq()). > > Can you determine if the value of the object field matches the address > of either kernel_object or kmem_object? The oflags field containing > VPO_UNMANAGED makes that likely. Looks like it's kmem_object: $ /usr/armeb-freebsd/usr/bin/nm /tftpboot/kernel.avila.avila | grep object_store c06d17d8 B kernel_object_store c06d1878 B kmem_object_store 0xc06d18a0 (the listq->tqe_prev is in the kmem_object_store... Probably the memq member... I followed a link to another page, and it is also a kmem_object page, and the other pages around it appear to be kmem_object... > In a nutshell, this looks like the same page is simultaneously in use by > one part of the kernel and free in another part. I doubt that it's a > simple case of use after free. In that case, the dirty, object, and > valid fields would be zero, and the crash would be in a different part > of the kernel. Interesting... Deos this mean a page ended up on the incorrect list? One thing I haven't tried is to run w/o INVARIANTS yet... obviously that would get me farther, but hid the problem... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 13:53:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ADAD7397; Thu, 20 Mar 2014 13:53:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 98C22870; Thu, 20 Mar 2014 13:53:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KDrPFK048024; Thu, 20 Mar 2014 13:53:25 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KDrOxZ048019; Thu, 20 Mar 2014 13:53:24 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201403201353.s2KDrOxZ048019@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 20 Mar 2014 13:53:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263423 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 13:53:25 -0000 Author: hselasky Date: Thu Mar 20 13:53:24 2014 New Revision: 263423 URL: http://svnweb.freebsd.org/changeset/base/263423 Log: Try to resolve a possible deadlock when detaching USB devices which create character devices. The deadlock can happen if an application is issuing IOCTLs which require USB refcounting, at the same time the USB device is detaching. There is already a counter in place in the USB device structure to detect this situation, but it was not always checked ahead of invoking functions that might destroy character devices, like detach, set configuration, set alternate interface or detach active kernel driver. Reported by: Daniel O'Connor MFC after: 1 week Modified: head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_process.c head/sys/dev/usb/usb_process.h Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Thu Mar 20 11:09:20 2014 (r263422) +++ head/sys/dev/usb/usb_dev.c Thu Mar 20 13:53:24 2014 (r263423) @@ -214,12 +214,13 @@ usb_ref_device(struct usb_cdev_privdata DPRINTFN(2, "device is detached\n"); goto error; } - if (cpd->udev->refcount == USB_DEV_REF_MAX) { - DPRINTFN(2, "no dev ref\n"); - goto error; - } if (need_uref) { DPRINTFN(2, "ref udev - needed\n"); + + if (cpd->udev->refcount == USB_DEV_REF_MAX) { + DPRINTFN(2, "no dev ref\n"); + goto error; + } cpd->udev->refcount++; mtx_unlock(&usb_ref_lock); @@ -293,9 +294,8 @@ error: usbd_enum_unlock(cpd->udev); if (crd->is_uref) { - if (--(cpd->udev->refcount) == 0) { - cv_signal(&cpd->udev->ref_cv); - } + cpd->udev->refcount--; + cv_broadcast(&cpd->udev->ref_cv); } mtx_unlock(&usb_ref_lock); DPRINTFN(2, "fail\n"); @@ -361,10 +361,9 @@ usb_unref_device(struct usb_cdev_privdat crd->is_write = 0; } if (crd->is_uref) { - if (--(cpd->udev->refcount) == 0) { - cv_signal(&cpd->udev->ref_cv); - } crd->is_uref = 0; + cpd->udev->refcount--; + cv_broadcast(&cpd->udev->ref_cv); } mtx_unlock(&usb_ref_lock); } Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Thu Mar 20 11:09:20 2014 (r263422) +++ head/sys/dev/usb/usb_device.c Thu Mar 20 13:53:24 2014 (r263423) @@ -452,6 +452,65 @@ usb_endpoint_foreach(struct usb_device * } /*------------------------------------------------------------------------* + * usb_wait_pending_ref_locked + * + * This function will wait for any USB references to go away before + * returning and disable further USB device refcounting on the + * specified USB device. This function is used when detaching a USB + * device. + *------------------------------------------------------------------------*/ +static void +usb_wait_pending_ref_locked(struct usb_device *udev) +{ +#if USB_HAVE_UGEN + const uint16_t refcount = + usb_proc_is_called_from( + USB_BUS_EXPLORE_PROC(udev->bus)) ? 1 : 2; + + DPRINTF("Refcount = %d\n", (int)refcount); + + while (1) { + /* wait for any pending references to go away */ + mtx_lock(&usb_ref_lock); + if (udev->refcount == refcount) { + /* prevent further refs being taken */ + udev->refcount = USB_DEV_REF_MAX; + mtx_unlock(&usb_ref_lock); + break; + } + usbd_enum_unlock(udev); + cv_wait(&udev->ref_cv, &usb_ref_lock); + mtx_unlock(&usb_ref_lock); + (void) usbd_enum_lock(udev); + } +#endif +} + +/*------------------------------------------------------------------------* + * usb_ref_restore_locked + * + * This function will restore the reference count value after a call + * to "usb_wait_pending_ref_locked()". + *------------------------------------------------------------------------*/ +static void +usb_ref_restore_locked(struct usb_device *udev) +{ +#if USB_HAVE_UGEN + const uint16_t refcount = + usb_proc_is_called_from( + USB_BUS_EXPLORE_PROC(udev->bus)) ? 1 : 2; + + DPRINTF("Refcount = %d\n", (int)refcount); + + /* restore reference count and wakeup waiters, if any */ + mtx_lock(&usb_ref_lock); + udev->refcount = refcount; + cv_broadcast(&udev->ref_cv); + mtx_unlock(&usb_ref_lock); +#endif +} + +/*------------------------------------------------------------------------* * usb_unconfigure * * This function will free all USB interfaces and USB endpoints belonging @@ -1121,6 +1180,9 @@ usb_detach_device(struct usb_device *ude sx_assert(&udev->enum_sx, SA_LOCKED); + /* wait for pending refs to go away */ + usb_wait_pending_ref_locked(udev); + /* * First detach the child to give the child's detach routine a * chance to detach the sub-devices in the correct order. @@ -1147,6 +1209,8 @@ usb_detach_device(struct usb_device *ude usb_detach_device_sub(udev, &iface->subdev, &iface->pnpinfo, flag); } + + usb_ref_restore_locked(udev); } /*------------------------------------------------------------------------* @@ -2088,14 +2152,6 @@ usb_free_device(struct usb_device *udev, udev->ugen_symlink = NULL; } - /* wait for all pending references to go away: */ - mtx_lock(&usb_ref_lock); - udev->refcount--; - while (udev->refcount != 0) { - cv_wait(&udev->ref_cv, &usb_ref_lock); - } - mtx_unlock(&usb_ref_lock); - usb_destroy_dev(udev->ctrl_dev); #endif @@ -2612,8 +2668,14 @@ usb_fifo_free_wrap(struct usb_device *ud /* no need to free this FIFO */ continue; } + /* wait for pending refs to go away */ + usb_wait_pending_ref_locked(udev); + /* free this FIFO */ usb_fifo_free(f); + + /* restore refcount */ + usb_ref_restore_locked(udev); } } #endif Modified: head/sys/dev/usb/usb_process.c ============================================================================== --- head/sys/dev/usb/usb_process.c Thu Mar 20 11:09:20 2014 (r263422) +++ head/sys/dev/usb/usb_process.c Thu Mar 20 13:53:24 2014 (r263423) @@ -501,3 +501,15 @@ usb_proc_rewakeup(struct usb_process *up cv_signal(&up->up_cv); } } + +/*------------------------------------------------------------------------* + * usb_proc_is_called_from + * + * This function will return non-zero if called from inside the USB + * process passed as first argument. Else this function returns zero. + *------------------------------------------------------------------------*/ +int +usb_proc_is_called_from(struct usb_process *up) +{ + return (up->up_curtd == curthread); +} Modified: head/sys/dev/usb/usb_process.h ============================================================================== --- head/sys/dev/usb/usb_process.h Thu Mar 20 11:09:20 2014 (r263422) +++ head/sys/dev/usb/usb_process.h Thu Mar 20 13:53:24 2014 (r263423) @@ -81,6 +81,7 @@ void usb_proc_mwait(struct usb_process * void usb_proc_free(struct usb_process *up); void *usb_proc_msignal(struct usb_process *up, void *pm0, void *pm1); void usb_proc_rewakeup(struct usb_process *up); +int usb_proc_is_called_from(struct usb_process *up); void usb_proc_explore_mwait(struct usb_device *, void *, void *); void *usb_proc_explore_msignal(struct usb_device *, void *, void *); From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 17:01:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B788F525; Thu, 20 Mar 2014 17:01:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A4B42BF; Thu, 20 Mar 2014 17:01:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KH1LRw024045; Thu, 20 Mar 2014 17:01:21 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KH1L84024044; Thu, 20 Mar 2014 17:01:21 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201403201701.s2KH1L84024044@svn.freebsd.org> From: Ruslan Bukin Date: Thu, 20 Mar 2014 17:01:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263424 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 17:01:21 -0000 Author: br Date: Thu Mar 20 17:01:21 2014 New Revision: 263424 URL: http://svnweb.freebsd.org/changeset/base/263424 Log: Disable debugging by default. Modified: head/sys/arm/conf/ARNDALE Modified: head/sys/arm/conf/ARNDALE ============================================================================== --- head/sys/arm/conf/ARNDALE Thu Mar 20 13:53:24 2014 (r263423) +++ head/sys/arm/conf/ARNDALE Thu Mar 20 17:01:21 2014 (r263424) @@ -60,11 +60,11 @@ options BREAK_TO_DEBUGGER #options VERBOSE_SYSINIT # Enable verbose sysinit messages options KDB options DDB # Enable the kernel debugger -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options DIAGNOSTIC +#options DIAGNOSTIC # NFS support options NFSCL # Network Filesystem Client From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 17:03:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66C86738; Thu, 20 Mar 2014 17:03:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3AF6F119; Thu, 20 Mar 2014 17:03:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KH3jIl025996; Thu, 20 Mar 2014 17:03:45 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KH3iS8025994; Thu, 20 Mar 2014 17:03:44 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201403201703.s2KH3iS8025994@svn.freebsd.org> From: Ruslan Bukin Date: Thu, 20 Mar 2014 17:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263425 - in head/sys: arm/samsung/exynos boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 17:03:45 -0000 Author: br Date: Thu Mar 20 17:03:44 2014 New Revision: 263425 URL: http://svnweb.freebsd.org/changeset/base/263425 Log: - Add display-related and clk devices to the tree - Prevent resources intersection with EHCI driver Modified: head/sys/arm/samsung/exynos/ehci_exynos5.c head/sys/boot/fdt/dts/arm/exynos5250.dtsi Modified: head/sys/arm/samsung/exynos/ehci_exynos5.c ============================================================================== --- head/sys/arm/samsung/exynos/ehci_exynos5.c Thu Mar 20 17:01:21 2014 (r263424) +++ head/sys/arm/samsung/exynos/ehci_exynos5.c Thu Mar 20 17:03:44 2014 (r263425) @@ -61,8 +61,8 @@ __FBSDID("$FreeBSD$"); #define GPIO_MASK 0xf #define GPIO_OUTPUT 1 #define GPIO_INPUT 0 -#define GPX3CON 0x0C60 -#define GPX3DAT 0x0C64 +#define GPX3CON 0x0 +#define GPX3DAT 0x4 #define PIN_USB 5 /* PWR control */ @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); #define PHY_POWER_OFF 0 /* SYSREG */ -#define EXYNOS5_SYSREG_USB2_PHY 0x230 +#define EXYNOS5_SYSREG_USB2_PHY 0x0 #define USB2_MODE_HOST 0x1 /* USB HOST */ Modified: head/sys/boot/fdt/dts/arm/exynos5250.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/exynos5250.dtsi Thu Mar 20 17:01:21 2014 (r263424) +++ head/sys/boot/fdt/dts/arm/exynos5250.dtsi Thu Mar 20 17:03:44 2014 (r263425) @@ -32,7 +32,16 @@ #size-cells = <1>; interrupt-parent = <&GIC>; - Exynos5@0 { + aliases { + soc = &SOC; + serial0 = &serial0; + serial1 = &serial1; + clk0 = &clk0; + dp0 = &dp0; + fimd0 = &fimd0; + }; + + SOC: Exynos5@0 { #address-cells = <1>; #size-cells = <1>; compatible = "simple-bus"; @@ -48,6 +57,11 @@ #interrupt-cells = <1>; }; + clk0: clk@10010000 { + compatible = "exynos,clk"; + reg = < 0x10020000 0x20000 >; + }; + mct { compatible = "exynos,mct"; reg = < 0x101C0000 0x1000 >; @@ -72,8 +86,8 @@ reg = <0x12110000 0x1000>, /* EHCI */ <0x12130000 0x1000>, /* EHCI host ctrl */ <0x10040000 0x1000>, /* Power */ - <0x10050000 0x1000>, /* Sysreg */ - <0x11400000 0x1000>; /* GPIO left */ + <0x10050230 0x10>, /* Sysreg */ + <0x11400C60 0x10>; /* GPIO left */ interrupts = < 103 >; interrupt-parent = <&GIC>; }; @@ -153,5 +167,21 @@ current-speed = <115200>; }; + fimd0: fimd@14400000 { + compatible = "exynos,fimd"; + status = "disabled"; + reg = < 0x14400000 0x10000 >, /* fimd */ + < 0x14420000 0x10000 >, /* disp */ + < 0x10050000 0x220 >; /* sysreg */ + interrupt-parent = <&GIC>; + }; + + dp0: dp@145B0000 { + compatible = "exynos,dp"; + status = "disabled"; + reg = < 0x145B0000 0x10000 >, + < 0x10040720 0x10 >; /* PHY */ + interrupt-parent = <&GIC>; + }; }; }; From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 17:07:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C386C9C9; Thu, 20 Mar 2014 17:07:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 95C7515A; Thu, 20 Mar 2014 17:07:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KH7Fp3026424; Thu, 20 Mar 2014 17:07:15 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KH7FG8026417; Thu, 20 Mar 2014 17:07:15 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201403201707.s2KH7FG8026417@svn.freebsd.org> From: Ruslan Bukin Date: Thu, 20 Mar 2014 17:07:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263426 - head/sys/arm/samsung/exynos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 17:07:15 -0000 Author: br Date: Thu Mar 20 17:07:14 2014 New Revision: 263426 URL: http://svnweb.freebsd.org/changeset/base/263426 Log: Add driver for Display Controller. Added: head/sys/arm/samsung/exynos/exynos5_common.h (contents, props changed) head/sys/arm/samsung/exynos/exynos5_fimd.c (contents, props changed) Modified: head/sys/arm/samsung/exynos/files.exynos5 Added: head/sys/arm/samsung/exynos/exynos5_common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/samsung/exynos/exynos5_common.h Thu Mar 20 17:07:14 2014 (r263426) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define READ4(_sc, _reg) \ + bus_space_read_4(_sc->bst, _sc->bsh, _reg) +#define WRITE4(_sc, _reg, _val) \ + bus_space_write_4(_sc->bst, _sc->bsh, _reg, _val) +#define READ2(_sc, _reg) \ + bus_space_read_2(_sc->bst, _sc->bsh, _reg) +#define WRITE2(_sc, _reg, _val) \ + bus_space_write_2(_sc->bst, _sc->bsh, _reg, _val) +#define READ1(_sc, _reg) \ + bus_space_read_1(_sc->bst, _sc->bsh, _reg) +#define WRITE1(_sc, _reg, _val) \ + bus_space_write_1(_sc->bst, _sc->bsh, _reg, _val) Added: head/sys/arm/samsung/exynos/exynos5_fimd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/samsung/exynos/exynos5_fimd.c Thu Mar 20 17:07:14 2014 (r263426) @@ -0,0 +1,413 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Samsung Exynos 5 Display Controller + * Chapter 15, Exynos 5 Dual User's Manual Public Rev 1.00 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + +#include "gpio_if.h" + +#include +#include +#include +#include + +#include "fb_if.h" + +#define FIMDBYPASS_DISP1 (1 << 15) + +#define VIDCON0 (0x0) +#define VIDCON0_ENVID (1 << 1) +#define VIDCON0_ENVID_F (1 << 0) +#define CLKVAL_F 0xb +#define CLKVAL_F_OFFSET 6 + +#define WINCON0 0x0020 +#define WINCON1 0x0024 +#define WINCON2 0x0028 +#define WINCON3 0x002C +#define WINCON4 0x0030 + +#define ENLOCAL_F (1 << 22) +#define BPPMODE_F_RGB_16BIT_565 0x5 +#define BPPMODE_F_OFFSET 2 +#define ENWIN_F_ENABLE (1 << 0) +#define HALF_WORD_SWAP_EN (1 << 16) + +#define SHADOWCON 0x0034 +#define CHANNEL0_EN (1 << 0) + +#define VIDOSD0A 0x0040 +#define VIDOSD0B 0x0044 +#define VIDOSD0C 0x0048 + +#define VIDW00ADD0B0 0x00A0 +#define VIDW00ADD0B1 0x00A4 +#define VIDW00ADD0B2 0x20A0 +#define VIDW00ADD1B0 0x00D0 +#define VIDW00ADD1B1 0x00D4 +#define VIDW00ADD1B2 0x20D0 + +#define VIDW00ADD2 0x0100 +#define VIDW01ADD2 0x0104 +#define VIDW02ADD2 0x0108 +#define VIDW03ADD2 0x010C +#define VIDW04ADD2 0x0110 + +#define VIDCON1 (0x04) +#define VIDTCON0 0x0010 +#define VIDTCON1 0x0014 +#define VIDTCON2 0x0018 +#define VIDTCON3 0x001C + +#define VIDINTCON0 0x0130 +#define VIDINTCON1 0x0134 + +#define VSYNC_PULSE_WIDTH_VAL 0x3 +#define VSYNC_PULSE_WIDTH_OFFSET 0 +#define V_FRONT_PORCH_VAL 0x3 +#define V_FRONT_PORCH_OFFSET 8 +#define V_BACK_PORCH_VAL 0x3 +#define V_BACK_PORCH_OFFSET 16 + +#define HSYNC_PULSE_WIDTH_VAL 0x3 +#define HSYNC_PULSE_WIDTH_OFFSET 0 +#define H_FRONT_PORCH_VAL 0x3 +#define H_FRONT_PORCH_OFFSET 8 +#define H_BACK_PORCH_VAL 0x3 +#define H_BACK_PORCH_OFFSET 16 + +#define HOZVAL_OFFSET 0 +#define LINEVAL_OFFSET 11 + +#define OSD_RIGHTBOTX_F_OFFSET 11 +#define OSD_RIGHTBOTY_F_OFFSET 0 + +#define DPCLKCON 0x27c +#define DPCLKCON_EN (1 << 1) + +#define DREAD4(_sc, _reg) \ + bus_space_read_4(_sc->bst_disp, _sc->bsh_disp, _reg) +#define DWRITE4(_sc, _reg, _val) \ + bus_space_write_4(_sc->bst_disp, _sc->bsh_disp, _reg, _val) + +struct panel_info { + uint32_t width; + uint32_t height; + uint32_t h_back_porch; + uint32_t h_pulse_width; + uint32_t h_front_porch; + uint32_t v_back_porch; + uint32_t v_pulse_width; + uint32_t v_front_porch; + uint32_t clk_div; + uint32_t backlight_pin; + uint32_t fixvclk; + uint32_t ivclk; + uint32_t clkval_f; +}; + +struct fimd_softc { + struct resource *res[3]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + bus_space_tag_t bst_disp; + bus_space_handle_t bsh_disp; + bus_space_tag_t bst_sysreg; + bus_space_handle_t bsh_sysreg; + + void *ih; + device_t dev; + device_t sc_fbd; /* fbd child */ + struct fb_info sc_info; + struct panel_info *panel; +}; + +static struct resource_spec fimd_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* Timer registers */ + { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* FIMD */ + { SYS_RES_MEMORY, 2, RF_ACTIVE }, /* DISP */ + { -1, 0 } +}; + +static int +fimd_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "exynos,fimd")) + return (ENXIO); + + device_set_desc(dev, "Samsung Exynos 5 Display Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +get_panel_info(struct fimd_softc *sc, struct panel_info *panel) +{ + phandle_t node; + pcell_t dts_value[3]; + int len; + + if ((node = ofw_bus_get_node(sc->dev)) == -1) + return (ENXIO); + + /* panel size */ + if ((len = OF_getproplen(node, "panel-size")) <= 0) + return (ENXIO); + OF_getprop(node, "panel-size", &dts_value, len); + panel->width = fdt32_to_cpu(dts_value[0]); + panel->height = fdt32_to_cpu(dts_value[1]); + + /* hsync */ + if ((len = OF_getproplen(node, "panel-hsync")) <= 0) + return (ENXIO); + OF_getprop(node, "panel-hsync", &dts_value, len); + panel->h_back_porch = fdt32_to_cpu(dts_value[0]); + panel->h_pulse_width = fdt32_to_cpu(dts_value[1]); + panel->h_front_porch = fdt32_to_cpu(dts_value[2]); + + /* vsync */ + if ((len = OF_getproplen(node, "panel-vsync")) <= 0) + return (ENXIO); + OF_getprop(node, "panel-vsync", &dts_value, len); + panel->v_back_porch = fdt32_to_cpu(dts_value[0]); + panel->v_pulse_width = fdt32_to_cpu(dts_value[1]); + panel->v_front_porch = fdt32_to_cpu(dts_value[2]); + + /* clk divider */ + if ((len = OF_getproplen(node, "panel-clk-div")) <= 0) + return (ENXIO); + OF_getprop(node, "panel-clk-div", &dts_value, len); + panel->clk_div = fdt32_to_cpu(dts_value[0]); + + /* backlight pin */ + if ((len = OF_getproplen(node, "panel-backlight-pin")) <= 0) + return (ENXIO); + OF_getprop(node, "panel-backlight-pin", &dts_value, len); + panel->backlight_pin = fdt32_to_cpu(dts_value[0]); + + return (0); +} + +static int +fimd_init(struct fimd_softc *sc) +{ + struct panel_info *panel; + int reg; + + panel = sc->panel; + + /* fb_init */ + reg = panel->ivclk | panel->fixvclk; + DWRITE4(sc,VIDCON1,reg); + + printf("print to VIDCON0\n"); + reg = (VIDCON0_ENVID | VIDCON0_ENVID_F); + reg |= (panel->clkval_f << CLKVAL_F_OFFSET); + WRITE4(sc,VIDCON0,reg); + + printf("print to VIDCON0 2nd\n"); + reg = (panel->v_pulse_width << VSYNC_PULSE_WIDTH_OFFSET); + reg |= (panel->v_front_porch << V_FRONT_PORCH_OFFSET); + reg |= (panel->v_back_porch << V_BACK_PORCH_OFFSET); + DWRITE4(sc,VIDTCON0,reg); + + reg = (panel->h_pulse_width << HSYNC_PULSE_WIDTH_OFFSET); + reg |= (panel->h_front_porch << H_FRONT_PORCH_OFFSET); + reg |= (panel->h_back_porch << H_BACK_PORCH_OFFSET); + DWRITE4(sc,VIDTCON1,reg); + + reg = ((panel->width - 1) << HOZVAL_OFFSET); + reg |= ((panel->height - 1) << LINEVAL_OFFSET); + DWRITE4(sc,VIDTCON2,reg); + + printf("set pbase\n"); + printf("vbase is 0x%08x\n", sc->sc_info.fb_vbase); + printf("pbase is 0x%08x\n", sc->sc_info.fb_pbase); + + WRITE4(sc,VIDW00ADD0B0, sc->sc_info.fb_pbase); + WRITE4(sc,VIDW00ADD1B0, sc->sc_info.fb_pbase + sc->sc_info.fb_size); + WRITE4(sc,VIDW00ADD2, panel->width * 2); + + reg = ((panel->width - 1) << OSD_RIGHTBOTX_F_OFFSET); + reg |= ((panel->height - 1) << OSD_RIGHTBOTY_F_OFFSET); + WRITE4(sc,VIDOSD0B,reg); + + reg = panel->width * panel->height; + WRITE4(sc,VIDOSD0C,reg); + + reg = READ4(sc, SHADOWCON); + reg |= CHANNEL0_EN; + reg &= ~(1 << 5); /* disable local path for channel0 */ + WRITE4(sc,SHADOWCON,reg); + + reg = BPPMODE_F_RGB_16BIT_565 << BPPMODE_F_OFFSET; + reg |= ENWIN_F_ENABLE | HALF_WORD_SWAP_EN; /* Note: swap=0 when ENLOCAL==1 */ + reg &= ~ENLOCAL_F; /* use DMA */ + WRITE4(sc,WINCON0,reg); + + /* Enable DisplayPort Clk */ + WRITE4(sc, DPCLKCON, DPCLKCON_EN); + + return (0); +} + +static int +fimd_attach(device_t dev) +{ + struct panel_info panel; + struct fimd_softc *sc; + device_t gpio_dev; + int reg; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (bus_alloc_resources(dev, fimd_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + sc->bst_disp = rman_get_bustag(sc->res[1]); + sc->bsh_disp = rman_get_bushandle(sc->res[1]); + sc->bst_sysreg = rman_get_bustag(sc->res[2]); + sc->bsh_sysreg = rman_get_bushandle(sc->res[2]); + + if (get_panel_info(sc, &panel)) { + device_printf(dev, "Can't get panel info\n"); + return (ENXIO); + } + + panel.fixvclk = 0; + panel.ivclk = 0; + panel.clkval_f = 2; + + sc->panel = &panel; + + /* Get the GPIO device, we need this to give power to USB */ + gpio_dev = devclass_get_device(devclass_find("gpio"), 0); + if (gpio_dev == NULL) { + /* TODO */ + } + + reg = bus_space_read_4(sc->bst_sysreg, sc->bsh_sysreg, 0x214); + reg |= FIMDBYPASS_DISP1; + bus_space_write_4(sc->bst_sysreg, sc->bsh_sysreg, 0x214, reg); + + sc->sc_info.fb_width = panel.width; + sc->sc_info.fb_height = panel.height; + sc->sc_info.fb_stride = sc->sc_info.fb_width * 2; + sc->sc_info.fb_bpp = sc->sc_info.fb_depth = 16; + sc->sc_info.fb_size = sc->sc_info.fb_height * sc->sc_info.fb_stride; + sc->sc_info.fb_vbase = (intptr_t)contigmalloc(sc->sc_info.fb_size, + M_DEVBUF, M_ZERO, 0, ~0, PAGE_SIZE, 0); + sc->sc_info.fb_pbase = (intptr_t)vtophys(sc->sc_info.fb_vbase); + +#if 0 + printf("%dx%d [%d]\n", sc->sc_info.fb_width, sc->sc_info.fb_height, + sc->sc_info.fb_stride); + printf("pbase == 0x%08x\n", sc->sc_info.fb_pbase); +#endif + + memset((int8_t *)sc->sc_info.fb_vbase, 0x0, sc->sc_info.fb_size); + + fimd_init(sc); + + sc->sc_info.fb_name = device_get_nameunit(dev); + + /* Ask newbus to attach framebuffer device to me. */ + sc->sc_fbd = device_add_child(dev, "fbd", device_get_unit(dev)); + if (sc->sc_fbd == NULL) + device_printf(dev, "Can't attach fbd device\n"); + + if (device_probe_and_attach(sc->sc_fbd) != 0) { + device_printf(sc->dev, "Failed to attach fbd device\n"); + } + + return (0); +} + +static struct fb_info * +fimd_fb_getinfo(device_t dev) +{ + struct fimd_softc *sc = device_get_softc(dev); + + return (&sc->sc_info); +} + +static device_method_t fimd_methods[] = { + DEVMETHOD(device_probe, fimd_probe), + DEVMETHOD(device_attach, fimd_attach), + + /* Framebuffer service methods */ + DEVMETHOD(fb_getinfo, fimd_fb_getinfo), + { 0, 0 } +}; + +static driver_t fimd_driver = { + "fb", + fimd_methods, + sizeof(struct fimd_softc), +}; + +static devclass_t fimd_devclass; + +DRIVER_MODULE(fb, simplebus, fimd_driver, fimd_devclass, 0, 0); Modified: head/sys/arm/samsung/exynos/files.exynos5 ============================================================================== --- head/sys/arm/samsung/exynos/files.exynos5 Thu Mar 20 17:03:44 2014 (r263425) +++ head/sys/arm/samsung/exynos/files.exynos5 Thu Mar 20 17:07:14 2014 (r263426) @@ -19,5 +19,6 @@ arm/samsung/exynos/exynos5_common.c sta arm/samsung/exynos/exynos5_machdep.c standard arm/samsung/exynos/uart.c optional uart arm/samsung/exynos/ehci_exynos5.c optional ehci +arm/samsung/exynos/exynos5_fimd.c optional vt #dev/sdhci/sdhci_fdt.c optional sdhci From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 17:10:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33820BBE; Thu, 20 Mar 2014 17:10:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 20CD9180; Thu, 20 Mar 2014 17:10:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KHA15f026826; Thu, 20 Mar 2014 17:10:02 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KHA1Sg026823; Thu, 20 Mar 2014 17:10:01 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201403201710.s2KHA1Sg026823@svn.freebsd.org> From: Ruslan Bukin Date: Thu, 20 Mar 2014 17:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263427 - in head/sys: arm/conf boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 17:10:02 -0000 Author: br Date: Thu Mar 20 17:10:01 2014 New Revision: 263427 URL: http://svnweb.freebsd.org/changeset/base/263427 Log: Add support for Samsung Chromebook (ARM Cortex A15 machine). Added: head/sys/arm/conf/CHROMEBOOK (contents, props changed) head/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts (contents, props changed) Added: head/sys/arm/conf/CHROMEBOOK ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/CHROMEBOOK Thu Mar 20 17:10:01 2014 (r263427) @@ -0,0 +1,146 @@ +# Kernel configuration for Samsung Chromebook (Exynos5 Dual machine). +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident CHROMEBOOK + +include "../samsung/exynos/std.exynos5" + +makeoptions MODULES_OVERRIDE="" +makeoptions WITHOUT_MODULES="ahc" + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions WERROR="-Werror" + +options HZ=100 +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options TMPFS # Efficient memory filesystem +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV +options PREEMPTION +options FREEBSD_BOOT_LOADER +options VFP # vfp/neon + +# Debugging +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +options BREAK_TO_DEBUGGER +#options VERBOSE_SYSINIT # Enable verbose sysinit messages +options KDB +options DDB # Enable the kernel debugger +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options DIAGNOSTIC + +# NFS support +options NFSCL # Network Filesystem Client +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCLIENT + +# Uncomment this for NFS root +#options NFS_ROOT # NFS usable as /, requires NFSCL +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=cpsw0 + +device mmc # mmc/sd bus +device mmcsd # mmc/sd flash cards +device sdhci # generic sdhci + +options ROOTDEVNAME=\"ufs:/dev/da0\" + +#options SMP + +# Pseudo devices + +device loop +device random +device pty +device md +device gpio + +# USB support +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. +device usb +options USB_DEBUG +#options USB_REQ_DEBUG +#options USB_VERBOSE +#device musb +device ehci +#device ohci + +device umass +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device pass + +# SATA +#device ata +#device atadisk +#device mvs + +# Serial ports +device uart + +# Framebuffer +device vt +device kbdmux +options SC_DFLT_FONT # compile font in +makeoptions SC_DFLT_FONT=cp437 +device ukbd + +# I2C (TWSI) +#device iic +#device iicbus + +# Ethernet +device ether +device mii +device smsc +device smscphy + +# USB ethernet support, requires miibus +device miibus +device axe # ASIX Electronics USB Ethernet +device bpf # Berkeley packet filter + +#FDT +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=exynos5250-chromebook.dts Added: head/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts Thu Mar 20 17:10:01 2014 (r263427) @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/include/ "exynos5250.dtsi" + +/ { + model = "Samsung Chromebook"; + + memory { + device_type = "memory"; + reg = < 0x40000000 0x80000000 >; /* 2G */ + }; + + SOC: Exynos5@0 { + + fimd0: fimd@14400000 { + status = "okay"; + + panel-size = < 1366 768 >; + panel-hsync = < 80 32 48 >; + panel-vsync = < 14 5 3 >; + panel-clk-div = < 17 >; + panel-backlight-pin = < 25 >; + }; + + }; + + chosen { + stdin = &serial2; + stdout = &serial2; + }; +}; From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 17:13:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D733DA4; Thu, 20 Mar 2014 17:13:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2F0AF20E; Thu, 20 Mar 2014 17:13:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KHD8MP030079; Thu, 20 Mar 2014 17:13:08 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KHD8gx030078; Thu, 20 Mar 2014 17:13:08 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201403201713.s2KHD8gx030078@svn.freebsd.org> From: Alan Somers Date: Thu, 20 Mar 2014 17:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263428 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 17:13:08 -0000 Author: asomers Date: Thu Mar 20 17:13:07 2014 New Revision: 263428 URL: http://svnweb.freebsd.org/changeset/base/263428 Log: share/man/man7/tests.7 Added a section on test suite configuration, and cleaned up up grammar errors and awkward prose. The config variables were discussed on freebsd-testing. Discussed with: Garrett Cooper, jmmv MFC after: 2 weeks Sponsored by: Spectra Logic Corporation Modified: head/share/man/man7/tests.7 Modified: head/share/man/man7/tests.7 ============================================================================== --- head/share/man/man7/tests.7 Thu Mar 20 17:10:01 2014 (r263427) +++ head/share/man/man7/tests.7 Thu Mar 20 17:13:07 2014 (r263428) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 19, 2013 +.Dd March 20, 2014 .Dt TESTS 7 .Os .Sh NAME @@ -36,30 +36,29 @@ The .Fx test suite provides a collection of automated tests for two major purposes. -On the one hand, the test suite aids +On one hand, the test suite aids .Em developers -in catching bugs and regressions in the code when they performing modifications -to the source tree. -On the other hand, the test suite allows +to detect bugs and regressions when they modify the source tree. On the other +hand, it allows .Em end users (and, in particular, system administrators) to verify that fresh installations of the .Fx -operating system behave correctly in their hardware platform and also to ensure -that the system does not suffer from regressions during regular system -operation and maintenance. +operating system behave correctly on their hardware platform and also to ensure +that the system does not suffer from regressions during regular operation and +maintenance. .Pp The .Fx -test suite is installed under the +test suite is installed in the .Pa /usr/tests hierarchy. .Pp -This manual page describes how to execute the test suite and how to configure +This manual page describes how to run the test suite and how to configure some of its optional features. .Ss When to run the tests? Before diving into the details of how to run the test suite, here are some -scenarios in which you should be running them: +scenarios in which you should run it: .Bl -bullet -offset indent .It After a fresh installation of @@ -72,8 +71,7 @@ to a different version to ensure that th hardware platform and that the upgrade did not introduce regressions in your configuration. .It -After performing changes to the source tree to catch any bugs and/or regressions -introduced by the modifications. +After modifying the source tree to detect any new bugs and/or regressions. .It Periodically, maybe from a .Xr cron 8 @@ -82,18 +80,18 @@ third-party packages or manual modificat introduce unexpected failures. .El .Ss Running the tests -First of all, you will need to install the -.Sq ports/devel/kyua -package. -.Pp -Use the following command to run the whole test suite: +First, you will need to install the +.Sq devel/kyua +package from +.Xr ports 7 . +Then use the following command to run the whole test suite: .Bd -literal -offset indent $ kyua test -k /usr/tests/Kyuafile .Ed .Pp -The above will go through all test programs in +The above will iterate through all test programs in .Pa /usr/tests -recursively, execute them, store their results and debugging data in Kyua +recursively, execute them, store their results and debugging data in Kyua's database (by default in .Pa ~/.kyua/store.db ) , and print a summary of the results. @@ -111,15 +109,15 @@ utilities: $ kyua test -k /usr/tests/Kyuafile bin/cp usr.bin/cut .Ed .Ss Obtaining reports of the tests execution -Additional information of the results of the execution can be later extracted -from the database by using the various reporting commands of Kyua. -For example, the following would extract a plain-text report of the executed +Additional information about the test results can be retrieved +by using Kyua's various reporting commands. +For example, the following would print a plain-text report of the executed tests and show which ones failed: .Bd -literal -offset indent $ kyua report .Ed .Pp -This other example would generate an HTML report ready to be published on a +This example would generate an HTML report ready to be published on a web server: .Bd -literal -offset indent $ kyua report-html --output ~/public_html/tests @@ -128,30 +126,47 @@ $ kyua report-html --output ~/public_htm For further details on the command-line interface of Kyua, please refer to its manual page .Xr kyua 1 . -.\".Ss Configuring the tests -.\"Some test cases in the -.\".Fx -.\"test suite require the administrator to manually set up some configuration -.\"properties before they can run. -.\"Unless these properties are defined, the tests that require them will be marked -.\"as skipped and thus they will not be really executed. -.\".Pp -.\"Test suites are configured by defining the values to their configuration -.\"variables in -.\".Pa /usr/local/etc/kyua/kyua.conf . -.\"The format of this file is detailed in -.\".Xr kyua.conf 5 . -.\".Pp -.\"The following configuration variables are available in the -.\".Fx -.\"test suite: -.\".Bl -tag -.\".It NONE REGISTERED YET -.\"TBD. +.Ss Configuring the tests +Some test cases in the +.Fx +test suite require manual configuration by the administrator before they can be +run. Unless certain properties are defined, the tests that require them will +be skipped. +.Pp +Test suites are configured by defining their configuration +variables in +.Pa /usr/local/etc/kyua/kyua.conf . +The format of this file is detailed in +.Xr kyua.conf 5 . +.Pp +The following configuration variables are available in the +.Fx +test suite: +.Bl -tag -width "allow_sysctl_side_effects" +.It allow_devfs_side_effects +If defined, enables tests that may destroy and recreate semipermanent device +nodes, like disk devices. Without this variable, tests may still create and +destroy devices nodes that are normally transient, like /dev/tap* and +/dev/pts*, as long as they clean them up afterwards. However, tests that +require this variable have a relaxed cleanup requirement; they must recreate +any devices that they destroyed, but not necessarily with the same devnames. +.It allow_sysctl_side_effects +Enables tests that change globally significant +.Xr sysctl 8 +variables. The tests will undo any changes in their cleanup phases. +.It disks +Must be set to a space delimited list of disk device nodes. Tests that need +destructive access to disks must use these devices. Tests are not required to +preserve any data present on these disks. +.It fibs +Must be set to a space delimited list of FIBs (routing tables). Tests that +need to modify a routing table may use any of these. Tests will cleanup any +new routes that they create. +.El .Ss What to do if something fails? If there is .Em any failure -during the execution of the test suite, please considering reporting it to the +during the execution of the test suite, please consider reporting it to the .Fx developers so that the failure can be analyzed and fixed. To do so, either send a message to the appropriate mailing list or file a @@ -173,7 +188,7 @@ User-specific configuration file for .Xr kyua 1 ; overrides the system file. .It Pa ~/.kyua/store.db -Default database used by Kyua to maintain the data of the executed tests. +Default result database used by Kyua. .It Pa /usr/tests/ Location of the .Fx @@ -184,9 +199,7 @@ Top-level test suite definition file. .Sh SEE ALSO .Xr kyua 1 . .Sh HISTORY -The collection of test programs in -.Pa /usr/tests -first appeared in +This test suite first appeared in .Fx 11.0 . .Pp The From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 17:30:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B698336; Thu, 20 Mar 2014 17:30:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2C2AC3EB; Thu, 20 Mar 2014 17:30:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KHUBMk034910; Thu, 20 Mar 2014 17:30:11 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KHUA6g034902; Thu, 20 Mar 2014 17:30:10 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201403201730.s2KHUA6g034902@svn.freebsd.org> From: Alan Somers Date: Thu, 20 Mar 2014 17:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263429 - in head: . usr.sbin/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 17:30:11 -0000 Author: asomers Date: Thu Mar 20 17:30:09 2014 New Revision: 263429 URL: http://svnweb.freebsd.org/changeset/base/263429 Log: Fix kern/187712: config(8) does not respect KERNCONFDIR. The impact of this bug is that you cannot build a kernel if both of the following are true: 1) The kernel config file is in a non-default location 2) The kernel config file uses the "include" statement from config(5). usr.sbin/config/main.c usr.sbin/config/config.8 usr.sbin/config/config.h usr.sbin/config/lang.l Added a "-I path" option to config(8). By analogy to cc(1), it adds an extra path in which the "include" statement will search for files. Makefile.inc1 Pass "-I ${KERNCONFDIR}" to config(8). PR: kern/187712 Reviewed by: will, imp (previous version) MFC after: 3 weeks Sponsored by: Spectra Logic Corporation Modified: head/Makefile.inc1 head/usr.sbin/config/config.8 head/usr.sbin/config/config.h head/usr.sbin/config/lang.l head/usr.sbin/config/main.c Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Mar 20 17:13:07 2014 (r263428) +++ head/Makefile.inc1 Thu Mar 20 17:30:09 2014 (r263429) @@ -1015,7 +1015,7 @@ buildkernel: cd ${KRNLCONFDIR}; \ PATH=${TMPPATH} \ config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \ - ${KERNCONFDIR}/${_kernel} + -I ${KERNCONFDIR} ${KERNCONFDIR}/${_kernel} .endif .if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN) @echo Modified: head/usr.sbin/config/config.8 ============================================================================== --- head/usr.sbin/config/config.8 Thu Mar 20 17:13:07 2014 (r263428) +++ head/usr.sbin/config/config.8 Thu Mar 20 17:30:09 2014 (r263429) @@ -37,6 +37,7 @@ .Sh SYNOPSIS .Nm .Op Fl CVgp +.Op Fl I Ar path .Op Fl d Ar destdir .Ar SYSTEM_NAME .Nm @@ -69,6 +70,12 @@ If the INCLUDE_CONFIG_FILE is present in kernel image will contain full configuration files included literally (preserving comments). This flag is kept for backward compatibility. +.It Fl I Ar path +Search in +.Ar path +for any file included by the +.Ic include +directive. This option may be specified more than once. .It Fl d Ar destdir Use .Ar destdir Modified: head/usr.sbin/config/config.h ============================================================================== --- head/usr.sbin/config/config.h Thu Mar 20 17:13:07 2014 (r263428) +++ head/usr.sbin/config/config.h Thu Mar 20 17:30:09 2014 (r263429) @@ -144,6 +144,13 @@ struct hint { STAILQ_HEAD(hint_head, hint) hints; +struct includepath { + char *path; + SLIST_ENTRY(includepath) path_next; +}; + +SLIST_HEAD(, includepath) includepath; + /* * Tag present in the kernelconf.tmlp template file. It's mandatory for those * two strings to be the same. Otherwise you'll get into trouble. Modified: head/usr.sbin/config/lang.l ============================================================================== --- head/usr.sbin/config/lang.l Thu Mar 20 17:13:07 2014 (r263428) +++ head/usr.sbin/config/lang.l Thu Mar 20 17:30:09 2014 (r263429) @@ -34,6 +34,7 @@ #include #include #include +#include #include #include "y.tab.h" #include "config.h" @@ -257,6 +258,7 @@ include(const char *fname, int ateof) { FILE *fp; struct incl *in; + struct includepath* ipath; char *fnamebuf; fnamebuf = NULL; @@ -269,6 +271,17 @@ include(const char *fname, int ateof) } } if (fp == NULL) { + SLIST_FOREACH(ipath, &includepath, path_next) { + asprintf(&fnamebuf, "%s/%s", ipath->path, fname); + if (fnamebuf != NULL) { + fp = fopen(fnamebuf, "r"); + free(fnamebuf); + } + if (fp != NULL) + break; + } + } + if (fp == NULL) { yyerror("cannot open included file"); return (-1); } Modified: head/usr.sbin/config/main.c ============================================================================== --- head/usr.sbin/config/main.c Thu Mar 20 17:13:07 2014 (r263428) +++ head/usr.sbin/config/main.c Thu Mar 20 17:30:09 2014 (r263429) @@ -110,15 +110,25 @@ main(int argc, char **argv) int ch, len; char *p; char *kernfile; + struct includepath* ipath; int printmachine; printmachine = 0; kernfile = NULL; - while ((ch = getopt(argc, argv, "Cd:gmpVx:")) != -1) + SLIST_INIT(&includepath); + while ((ch = getopt(argc, argv, "CI:d:gmpVx:")) != -1) switch (ch) { case 'C': filebased = 1; break; + case 'I': + ipath = (struct includepath *) \ + calloc(1, sizeof (struct includepath)); + if (ipath == NULL) + err(EXIT_FAILURE, "calloc"); + ipath->path = optarg; + SLIST_INSERT_HEAD(&includepath, ipath, path_next); + break; case 'm': printmachine = 1; break; From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 17:33:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 465AA607; Thu, 20 Mar 2014 17:33:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3394B61E; Thu, 20 Mar 2014 17:33:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KHX2rW038109; Thu, 20 Mar 2014 17:33:02 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KHX2VJ038108; Thu, 20 Mar 2014 17:33:02 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201403201733.s2KHX2VJ038108@svn.freebsd.org> From: Ruslan Bukin Date: Thu, 20 Mar 2014 17:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263430 - head/sys/arm/samsung/exynos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 17:33:02 -0000 Author: br Date: Thu Mar 20 17:33:01 2014 New Revision: 263430 URL: http://svnweb.freebsd.org/changeset/base/263430 Log: Remove printf's. Modified: head/sys/arm/samsung/exynos/exynos5_fimd.c Modified: head/sys/arm/samsung/exynos/exynos5_fimd.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_fimd.c Thu Mar 20 17:30:09 2014 (r263429) +++ head/sys/arm/samsung/exynos/exynos5_fimd.c Thu Mar 20 17:33:01 2014 (r263430) @@ -256,12 +256,10 @@ fimd_init(struct fimd_softc *sc) reg = panel->ivclk | panel->fixvclk; DWRITE4(sc,VIDCON1,reg); - printf("print to VIDCON0\n"); reg = (VIDCON0_ENVID | VIDCON0_ENVID_F); reg |= (panel->clkval_f << CLKVAL_F_OFFSET); WRITE4(sc,VIDCON0,reg); - printf("print to VIDCON0 2nd\n"); reg = (panel->v_pulse_width << VSYNC_PULSE_WIDTH_OFFSET); reg |= (panel->v_front_porch << V_FRONT_PORCH_OFFSET); reg |= (panel->v_back_porch << V_BACK_PORCH_OFFSET); @@ -276,10 +274,6 @@ fimd_init(struct fimd_softc *sc) reg |= ((panel->height - 1) << LINEVAL_OFFSET); DWRITE4(sc,VIDTCON2,reg); - printf("set pbase\n"); - printf("vbase is 0x%08x\n", sc->sc_info.fb_vbase); - printf("pbase is 0x%08x\n", sc->sc_info.fb_pbase); - WRITE4(sc,VIDW00ADD0B0, sc->sc_info.fb_pbase); WRITE4(sc,VIDW00ADD1B0, sc->sc_info.fb_pbase + sc->sc_info.fb_size); WRITE4(sc,VIDW00ADD2, panel->width * 2); From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 17:53:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE7B4EEF; Thu, 20 Mar 2014 17:53:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BB0B18A2; Thu, 20 Mar 2014 17:53:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KHrvdL046103; Thu, 20 Mar 2014 17:53:57 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KHrvHh046100; Thu, 20 Mar 2014 17:53:57 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201403201753.s2KHrvHh046100@svn.freebsd.org> From: Ruslan Bukin Date: Thu, 20 Mar 2014 17:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263431 - head/sys/arm/samsung/exynos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 17:53:57 -0000 Author: br Date: Thu Mar 20 17:53:56 2014 New Revision: 263431 URL: http://svnweb.freebsd.org/changeset/base/263431 Log: Rename mct and ehci drivers files to match common naming. Added: head/sys/arm/samsung/exynos/exynos5_ehci.c - copied unchanged from r263425, head/sys/arm/samsung/exynos/ehci_exynos5.c head/sys/arm/samsung/exynos/exynos5_mct.c - copied, changed from r263423, head/sys/arm/samsung/exynos/arch_timer.c Deleted: head/sys/arm/samsung/exynos/arch_timer.c head/sys/arm/samsung/exynos/ehci_exynos5.c Modified: head/sys/arm/samsung/exynos/files.exynos5 Copied: head/sys/arm/samsung/exynos/exynos5_ehci.c (from r263425, head/sys/arm/samsung/exynos/ehci_exynos5.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/samsung/exynos/exynos5_ehci.c Thu Mar 20 17:53:56 2014 (r263431, copy of r263425, head/sys/arm/samsung/exynos/ehci_exynos5.c) @@ -0,0 +1,370 @@ +/*- + * Copyright (c) 2013 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_bus.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include "opt_platform.h" + +/* GPIO control */ +#define GPIO_CON(x, v) ((v) << ((x) * 4)) +#define GPIO_MASK 0xf +#define GPIO_OUTPUT 1 +#define GPIO_INPUT 0 +#define GPX3CON 0x0 +#define GPX3DAT 0x4 +#define PIN_USB 5 + +/* PWR control */ +#define EXYNOS5_PWR_USBHOST_PHY 0x708 +#define PHY_POWER_ON 1 +#define PHY_POWER_OFF 0 + +/* SYSREG */ +#define EXYNOS5_SYSREG_USB2_PHY 0x0 +#define USB2_MODE_HOST 0x1 + +/* USB HOST */ +#define HOST_CTRL_CLK_24MHZ (5 << 16) +#define HOST_CTRL_CLK_MASK (7 << 16) +#define HOST_CTRL_SIDDQ (1 << 6) +#define HOST_CTRL_SLEEP (1 << 5) +#define HOST_CTRL_SUSPEND (1 << 4) +#define HOST_CTRL_RESET_LINK (1 << 1) +#define HOST_CTRL_RESET_PHY (1 << 0) +#define HOST_CTRL_RESET_PHY_ALL (1U << 31) + +/* Forward declarations */ +static int exynos_ehci_attach(device_t dev); +static int exynos_ehci_detach(device_t dev); +static int exynos_ehci_probe(device_t dev); + +struct exynos_ehci_softc { + ehci_softc_t base; + struct resource *res[6]; + bus_space_tag_t host_bst; + bus_space_tag_t pwr_bst; + bus_space_tag_t sysreg_bst; + bus_space_tag_t gpio_bst; + bus_space_handle_t host_bsh; + bus_space_handle_t pwr_bsh; + bus_space_handle_t sysreg_bsh; + bus_space_handle_t gpio_bsh; + +}; + +static struct resource_spec exynos_ehci_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_MEMORY, 1, RF_ACTIVE }, + { SYS_RES_MEMORY, 2, RF_ACTIVE }, + { SYS_RES_MEMORY, 3, RF_ACTIVE }, + { SYS_RES_MEMORY, 4, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static device_method_t ehci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, exynos_ehci_probe), + DEVMETHOD(device_attach, exynos_ehci_attach), + DEVMETHOD(device_detach, exynos_ehci_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + + { 0, 0 } +}; + +/* kobj_class definition */ +static driver_t ehci_driver = { + "ehci", + ehci_methods, + sizeof(ehci_softc_t) +}; + +static devclass_t ehci_devclass; + +DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); +MODULE_DEPEND(ehci, usb, 1, 1, 1); + +/* + * Public methods + */ +static int +exynos_ehci_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_is_compatible(dev, "exynos,usb-ehci") == 0) + return (ENXIO); + + device_set_desc(dev, "Exynos integrated USB controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +gpio_ctrl(struct exynos_ehci_softc *esc, int dir, int power) +{ + int reg; + + /* Power control */ + reg = bus_space_read_4(esc->gpio_bst, esc->gpio_bsh, GPX3DAT); + reg &= ~(1 << PIN_USB); + reg |= (power << PIN_USB); + bus_space_write_4(esc->gpio_bst, esc->gpio_bsh, GPX3DAT, reg); + + /* Input/Output control */ + reg = bus_space_read_4(esc->gpio_bst, esc->gpio_bsh, GPX3CON); + reg &= ~GPIO_CON(PIN_USB, GPIO_MASK); + reg |= GPIO_CON(PIN_USB, dir); + bus_space_write_4(esc->gpio_bst, esc->gpio_bsh, GPX3CON, reg); + + return (0); +} + +static int +phy_init(struct exynos_ehci_softc *esc) +{ + int reg; + + gpio_ctrl(esc, GPIO_INPUT, 1); + + /* set USB HOST mode */ + bus_space_write_4(esc->sysreg_bst, esc->sysreg_bsh, + EXYNOS5_SYSREG_USB2_PHY, USB2_MODE_HOST); + + /* Power ON phy */ + bus_space_write_4(esc->pwr_bst, esc->pwr_bsh, + EXYNOS5_PWR_USBHOST_PHY, PHY_POWER_ON); + + reg = bus_space_read_4(esc->host_bst, esc->host_bsh, 0x0); + reg &= ~(HOST_CTRL_CLK_MASK | + HOST_CTRL_RESET_PHY | + HOST_CTRL_RESET_PHY_ALL | + HOST_CTRL_SIDDQ | + HOST_CTRL_SUSPEND | + HOST_CTRL_SLEEP); + + reg |= (HOST_CTRL_CLK_24MHZ | + HOST_CTRL_RESET_LINK); + bus_space_write_4(esc->host_bst, esc->host_bsh, 0x0, reg); + + DELAY(10); + + reg = bus_space_read_4(esc->host_bst, esc->host_bsh, 0x0); + reg &= ~(HOST_CTRL_RESET_LINK); + bus_space_write_4(esc->host_bst, esc->host_bsh, 0x0, reg); + + gpio_ctrl(esc, GPIO_OUTPUT, 1); + + return (0); +} + +static int +exynos_ehci_attach(device_t dev) +{ + struct exynos_ehci_softc *esc; + ehci_softc_t *sc; + bus_space_handle_t bsh; + int err; + + esc = device_get_softc(dev); + sc = &esc->base; + sc->sc_bus.parent = dev; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = EHCI_MAX_DEVICES; + + if (bus_alloc_resources(dev, exynos_ehci_spec, esc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* EHCI registers */ + sc->sc_io_tag = rman_get_bustag(esc->res[0]); + bsh = rman_get_bushandle(esc->res[0]); + sc->sc_io_size = rman_get_size(esc->res[0]); + + /* EHCI HOST ctrl registers */ + esc->host_bst = rman_get_bustag(esc->res[1]); + esc->host_bsh = rman_get_bushandle(esc->res[1]); + + /* PWR registers */ + esc->pwr_bst = rman_get_bustag(esc->res[2]); + esc->pwr_bsh = rman_get_bushandle(esc->res[2]); + + /* SYSREG */ + esc->sysreg_bst = rman_get_bustag(esc->res[3]); + esc->sysreg_bsh = rman_get_bushandle(esc->res[3]); + + /* GPIO */ + esc->gpio_bst = rman_get_bustag(esc->res[4]); + esc->gpio_bsh = rman_get_bushandle(esc->res[4]); + + /* get all DMA memory */ + if (usb_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(dev), + &ehci_iterate_hw_softc)) + return (ENXIO); + + /* + * Set handle to USB related registers subregion used by + * generic EHCI driver. + */ + err = bus_space_subregion(sc->sc_io_tag, bsh, 0x0, + sc->sc_io_size, &sc->sc_io_hdl); + if (err != 0) + return (ENXIO); + + phy_init(esc); + + /* Setup interrupt handler */ + err = bus_setup_intr(dev, esc->res[5], INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)ehci_interrupt, sc, + &sc->sc_intr_hdl); + if (err) { + device_printf(dev, "Could not setup irq, " + "%d\n", err); + return (1); + } + + /* Add USB device */ + sc->sc_bus.bdev = device_add_child(dev, "usbus", -1); + if (!sc->sc_bus.bdev) { + device_printf(dev, "Could not add USB device\n"); + err = bus_teardown_intr(dev, esc->res[5], + sc->sc_intr_hdl); + if (err) + device_printf(dev, "Could not tear down irq," + " %d\n", err); + return (1); + } + device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); + + strlcpy(sc->sc_vendor, "Samsung", sizeof(sc->sc_vendor)); + + err = ehci_init(sc); + if (!err) { + sc->sc_flags |= EHCI_SCFLG_DONEINIT; + err = device_probe_and_attach(sc->sc_bus.bdev); + } else { + device_printf(dev, "USB init failed err=%d\n", err); + + device_delete_child(dev, sc->sc_bus.bdev); + sc->sc_bus.bdev = NULL; + + err = bus_teardown_intr(dev, esc->res[5], + sc->sc_intr_hdl); + if (err) + device_printf(dev, "Could not tear down irq," + " %d\n", err); + return (1); + } + return (0); +} + +static int +exynos_ehci_detach(device_t dev) +{ + struct exynos_ehci_softc *esc; + ehci_softc_t *sc; + int err; + + esc = device_get_softc(dev); + sc = &esc->base; + + if (sc->sc_flags & EHCI_SCFLG_DONEINIT) + return (0); + + /* + * only call ehci_detach() after ehci_init() + */ + if (sc->sc_flags & EHCI_SCFLG_DONEINIT) { + ehci_detach(sc); + sc->sc_flags &= ~EHCI_SCFLG_DONEINIT; + } + + /* + * Disable interrupts that might have been switched on in + * ehci_init. + */ + if (sc->sc_io_tag && sc->sc_io_hdl) + bus_space_write_4(sc->sc_io_tag, sc->sc_io_hdl, + EHCI_USBINTR, 0); + + if (esc->res[5] && sc->sc_intr_hdl) { + err = bus_teardown_intr(dev, esc->res[5], + sc->sc_intr_hdl); + if (err) { + device_printf(dev, "Could not tear down irq," + " %d\n", err); + return (err); + } + sc->sc_intr_hdl = NULL; + } + + if (sc->sc_bus.bdev) { + device_delete_child(dev, sc->sc_bus.bdev); + sc->sc_bus.bdev = NULL; + } + + /* During module unload there are lots of children leftover */ + device_delete_children(dev); + + bus_release_resources(dev, exynos_ehci_spec, esc->res); + + return (0); +} Copied and modified: head/sys/arm/samsung/exynos/exynos5_mct.c (from r263423, head/sys/arm/samsung/exynos/arch_timer.c) ============================================================================== --- head/sys/arm/samsung/exynos/arch_timer.c Thu Mar 20 13:53:24 2014 (r263423, copy source) +++ head/sys/arm/samsung/exynos/exynos5_mct.c Thu Mar 20 17:53:56 2014 (r263431) @@ -129,11 +129,11 @@ static device_method_t arm_tmr_methods[] }; static driver_t arm_tmr_driver = { - "arch_timer", + "mct", arm_tmr_methods, sizeof(struct arm_tmr_softc), }; static devclass_t arm_tmr_devclass; -DRIVER_MODULE(arch_timer, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0); +DRIVER_MODULE(mct, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0); Modified: head/sys/arm/samsung/exynos/files.exynos5 ============================================================================== --- head/sys/arm/samsung/exynos/files.exynos5 Thu Mar 20 17:33:01 2014 (r263430) +++ head/sys/arm/samsung/exynos/files.exynos5 Thu Mar 20 17:53:56 2014 (r263431) @@ -13,12 +13,12 @@ arm/arm/bus_space-v6.c standard arm/arm/gic.c standard arm/arm/generic_timer.c standard -arm/samsung/exynos/arch_timer.c standard +arm/samsung/exynos/exynos5_mct.c standard arm/samsung/exynos/exynos5_mp.c optional smp arm/samsung/exynos/exynos5_common.c standard arm/samsung/exynos/exynos5_machdep.c standard arm/samsung/exynos/uart.c optional uart -arm/samsung/exynos/ehci_exynos5.c optional ehci +arm/samsung/exynos/exynos5_ehci.c optional ehci arm/samsung/exynos/exynos5_fimd.c optional vt #dev/sdhci/sdhci_fdt.c optional sdhci From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 18:15:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9C83C34; Thu, 20 Mar 2014 18:15:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B658CB86; Thu, 20 Mar 2014 18:15:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KIFc9S054901; Thu, 20 Mar 2014 18:15:38 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KIFcMP054896; Thu, 20 Mar 2014 18:15:38 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201403201815.s2KIFcMP054896@svn.freebsd.org> From: Neel Natu Date: Thu, 20 Mar 2014 18:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263432 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 18:15:39 -0000 Author: neel Date: Thu Mar 20 18:15:37 2014 New Revision: 263432 URL: http://svnweb.freebsd.org/changeset/base/263432 Log: Use 'cpuset_t' to represent the vcpus active in a virtual machine. Modified: head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/bhyverun.h head/usr.sbin/bhyve/spinup_ap.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Thu Mar 20 17:53:56 2014 (r263431) +++ head/usr.sbin/bhyve/bhyverun.c Thu Mar 20 18:15:37 2014 (r263432) @@ -98,7 +98,7 @@ static int acpi; static char *progname; static const int BSP = 0; -static int cpumask; +static cpuset_t cpumask; static void vm_loop(struct vmctx *ctx, int vcpu, uint64_t rip); @@ -199,30 +199,26 @@ fbsdrun_start_thread(void *param) } void -fbsdrun_addcpu(struct vmctx *ctx, int vcpu, uint64_t rip) +fbsdrun_addcpu(struct vmctx *ctx, int fromcpu, int newcpu, uint64_t rip) { int error; - if (cpumask & (1 << vcpu)) { - fprintf(stderr, "addcpu: attempting to add existing cpu %d\n", - vcpu); - exit(1); - } + assert(fromcpu == BSP); - atomic_set_int(&cpumask, 1 << vcpu); + CPU_SET_ATOMIC(newcpu, &cpumask); /* * Set up the vmexit struct to allow execution to start * at the given RIP */ - vmexit[vcpu].rip = rip; - vmexit[vcpu].inst_length = 0; + vmexit[newcpu].rip = rip; + vmexit[newcpu].inst_length = 0; - mt_vmm_info[vcpu].mt_ctx = ctx; - mt_vmm_info[vcpu].mt_vcpu = vcpu; + mt_vmm_info[newcpu].mt_ctx = ctx; + mt_vmm_info[newcpu].mt_vcpu = newcpu; - error = pthread_create(&mt_vmm_info[vcpu].mt_thr, NULL, - fbsdrun_start_thread, &mt_vmm_info[vcpu]); + error = pthread_create(&mt_vmm_info[newcpu].mt_thr, NULL, + fbsdrun_start_thread, &mt_vmm_info[newcpu]); assert(error == 0); } @@ -230,14 +226,14 @@ static int fbsdrun_deletecpu(struct vmctx *ctx, int vcpu) { - if ((cpumask & (1 << vcpu)) == 0) { + if (!CPU_ISSET(vcpu, &cpumask)) { fprintf(stderr, "addcpu: attempting to delete unknown cpu %d\n", vcpu); exit(1); } - atomic_clear_int(&cpumask, 1 << vcpu); - return (cpumask == 0); + CPU_CLR_ATOMIC(vcpu, &cpumask); + return (CPU_EMPTY(&cpumask)); } static int @@ -745,7 +741,7 @@ main(int argc, char *argv[]) /* * Add CPU 0 */ - fbsdrun_addcpu(ctx, BSP, rip); + fbsdrun_addcpu(ctx, BSP, BSP, rip); /* * Head off to the main event dispatch loop Modified: head/usr.sbin/bhyve/bhyverun.h ============================================================================== --- head/usr.sbin/bhyve/bhyverun.h Thu Mar 20 17:53:56 2014 (r263431) +++ head/usr.sbin/bhyve/bhyverun.h Thu Mar 20 18:15:37 2014 (r263432) @@ -43,7 +43,7 @@ extern char *vmname; void *paddr_guest2host(struct vmctx *ctx, uintptr_t addr, size_t len); void fbsdrun_set_capabilities(struct vmctx *ctx, int cpu); -void fbsdrun_addcpu(struct vmctx *ctx, int cpu, uint64_t rip); +void fbsdrun_addcpu(struct vmctx *ctx, int fromcpu, int newcpu, uint64_t rip); int fbsdrun_muxed(void); int fbsdrun_vmexit_on_hlt(void); int fbsdrun_vmexit_on_pause(void); Modified: head/usr.sbin/bhyve/spinup_ap.c ============================================================================== --- head/usr.sbin/bhyve/spinup_ap.c Thu Mar 20 17:53:56 2014 (r263431) +++ head/usr.sbin/bhyve/spinup_ap.c Thu Mar 20 18:15:37 2014 (r263432) @@ -98,7 +98,7 @@ spinup_ap(struct vmctx *ctx, int vcpu, i spinup_ap_realmode(ctx, newcpu, &rip); - fbsdrun_addcpu(ctx, newcpu, rip); + fbsdrun_addcpu(ctx, vcpu, newcpu, rip); return (newcpu); } From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 18:44:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16CDCC30; Thu, 20 Mar 2014 18:44:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE25AECA; Thu, 20 Mar 2014 18:44:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KIibX6067137; Thu, 20 Mar 2014 18:44:37 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KIibdd067136; Thu, 20 Mar 2014 18:44:37 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201403201844.s2KIibdd067136@svn.freebsd.org> From: Glen Barber Date: Thu, 20 Mar 2014 18:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263434 - head/contrib/subversion/subversion/svn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 18:44:38 -0000 Author: gjb Date: Thu Mar 20 18:44:37 2014 New Revision: 263434 URL: http://svnweb.freebsd.org/changeset/base/263434 Log: - Update commit template to include 'Relnotes:' tag, to help re@ track release notes candidates. Discussed with: re Reviewed by: peter MFC after: 3 days X-MFC-To: stable/10 only Sponsored by: The FreeBSD Foundation Modified: head/contrib/subversion/subversion/svn/util.c Modified: head/contrib/subversion/subversion/svn/util.c ============================================================================== --- head/contrib/subversion/subversion/svn/util.c Thu Mar 20 18:43:57 2014 (r263433) +++ head/contrib/subversion/subversion/svn/util.c Thu Mar 20 18:44:37 2014 (r263434) @@ -338,6 +338,7 @@ static const char *prefixes[] = { "Approved by:", "Obtained from:", "MFC after:", + "Relnotes:", "Security:", "Sponsored by:" }; @@ -408,6 +409,7 @@ svn_cl__get_log_message(const char **log svn_stringbuf_appendcstr(default_msg, "Approved by:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Obtained from:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "MFC after:\t" APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "Relnotes:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Security:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Sponsored by:\t" #ifdef HAS_ORGANIZATION_NAME @@ -423,6 +425,7 @@ svn_cl__get_log_message(const char **log svn_stringbuf_appendcstr(default_msg, "> Approved by: If you needed approval for this commit." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Obtained from: If the change is from a third party." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email." APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "> Relnotes: Set to 'yes' for mention in release notes." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Security: Vulnerability reference (one per line) or description." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Sponsored by: If the change was sponsored by an organization." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Empty fields above will be automatically removed." APR_EOL_STR); From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 19:17:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 237D1BBA; Thu, 20 Mar 2014 19:17:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 03FE6319; Thu, 20 Mar 2014 19:17:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KJHkck079862; Thu, 20 Mar 2014 19:17:46 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KJHkGk079860; Thu, 20 Mar 2014 19:17:46 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201403201917.s2KJHkGk079860@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 20 Mar 2014 19:17:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263435 - in head/share: examples/etc mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 19:17:47 -0000 Author: jkim Date: Thu Mar 20 19:17:46 2014 New Revision: 263435 URL: http://svnweb.freebsd.org/changeset/base/263435 Log: Add new CPUTYPEs supported by Clang 3.4, i.e., AMD Steamroller (bdver3) and Intel Silvermont (slm) processors. Modified: head/share/examples/etc/make.conf head/share/mk/bsd.cpu.mk Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Thu Mar 20 18:44:37 2014 (r263434) +++ head/share/examples/etc/make.conf Thu Mar 20 19:17:46 2014 (r263435) @@ -45,8 +45,8 @@ # if omitted), ultrasparc3 # Additionally the following CPU types are recognized by clang: # Intel x86 architecture (for both amd64 and i386): -# (AMD CPUs) bdver2, bdver1, btver2, btver1 -# (Intel CPUs) core-avx2, core-avx-i, corei7-avx, corei7, atom +# (AMD CPUs) bdver3, bdver2, bdver1, btver2, btver1 +# (Intel CPUs) slm, core-avx2, core-avx-i, corei7-avx, corei7, atom # # (?= allows to buildworld for a different CPUTYPE.) # Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Thu Mar 20 18:44:37 2014 (r263434) +++ head/share/mk/bsd.cpu.mk Thu Mar 20 19:17:46 2014 (r263435) @@ -142,7 +142,8 @@ _CPUCFLAGS = -mcpu=ultrasparc3 # presence of a CPU feature. . if ${MACHINE_CPUARCH} == "i386" -. if ${CPUTYPE} == "bdver2" || ${CPUTYPE} == "bdver1" +. if ${CPUTYPE} == "bdver3" || ${CPUTYPE} == "bdver2" || \ + ${CPUTYPE} == "bdver1" MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 . elif ${CPUTYPE} == "btver2" MACHINE_CPU = avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 @@ -170,7 +171,7 @@ MACHINE_CPU = k5 i586 MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "core-avx-i" || ${CPUTYPE} == "corei7-avx" MACHINE_CPU = avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 -. elif ${CPUTYPE} == "corei7" +. elif ${CPUTYPE} == "slm" || ${CPUTYPE} == "corei7" MACHINE_CPU = sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "penryn" MACHINE_CPU = sse41 ssse3 sse3 sse2 sse i686 mmx i586 @@ -204,7 +205,8 @@ MACHINE_CPU = mmx . endif MACHINE_CPU += i486 . elif ${MACHINE_CPUARCH} == "amd64" -. if ${CPUTYPE} == "bdver2" || ${CPUTYPE} == "bdver1" +. if ${CPUTYPE} == "bdver3" || ${CPUTYPE} == "bdver2" || \ + ${CPUTYPE} == "bdver1" MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3 . elif ${CPUTYPE} == "btver2" MACHINE_CPU = avx sse42 sse41 ssse3 sse4a sse3 @@ -222,7 +224,7 @@ MACHINE_CPU = k8 3dnow MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 . elif ${CPUTYPE} == "core-avx-i" || ${CPUTYPE} == "corei7-avx" MACHINE_CPU = avx sse42 sse41 ssse3 sse3 -. elif ${CPUTYPE} == "corei7" +. elif ${CPUTYPE} == "slm" || ${CPUTYPE} == "corei7" MACHINE_CPU = sse42 sse41 ssse3 sse3 . elif ${CPUTYPE} == "penryn" MACHINE_CPU = sse41 ssse3 sse3 From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 20:00:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 059CE562; Thu, 20 Mar 2014 20:00:16 +0000 (UTC) Received: from mail-qc0-x234.google.com (mail-qc0-x234.google.com [IPv6:2607:f8b0:400d:c01::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 88116A83; Thu, 20 Mar 2014 20:00:15 +0000 (UTC) Received: by mail-qc0-f180.google.com with SMTP id w7so1661362qcr.39 for ; Thu, 20 Mar 2014 13:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=rRyL3JY6r5fezDYxH4za8J0FdqELVCO0C/UrwxgAt3s=; b=k6OcEk+5vvdnapf8pdUMPfw4m7TWfHA9/N9T6/iXmhbv795PgdT2z8G6m6a4cqpR8s 1m9BeVeVAjdiwCnKxGBBC6KRg0ehP7YVPA5czbzm03ESj+VADEPZLe3gRPJnBYcR52Wr 2yTShDolCYkdDsQQ7XGnya/SeDeY1eEc0t89hMclnHl/hmWgnC5F9zbyMCRVCbZIWz7v 9aLo49FvM3kqOEJjxLRfXo5grlxuxn6vSFPDOgoGYFGFK8Djy26zLj9FC4P/nudp6zwH LHPiCm+A+EX/bc7gzea+Qvrs7NUHAtMuVse+9CrJRiyQiAKHVQYCxbs0UGsF/ra1QyAv 3ZlA== MIME-Version: 1.0 X-Received: by 10.140.42.9 with SMTP id b9mr26365324qga.87.1395345614649; Thu, 20 Mar 2014 13:00:14 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.8.137 with HTTP; Thu, 20 Mar 2014 13:00:14 -0700 (PDT) In-Reply-To: <201403201710.s2KHA1Sg026823@svn.freebsd.org> References: <201403201710.s2KHA1Sg026823@svn.freebsd.org> Date: Thu, 20 Mar 2014 13:00:14 -0700 X-Google-Sender-Auth: mx-8SNdJy7VColxt4QWy2MIeU_M Message-ID: Subject: Re: svn commit: r263427 - in head/sys: arm/conf boot/fdt/dts/arm From: Adrian Chadd To: Ruslan Bukin Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 20:00:16 -0000 Hi, Would you mind renaming this to something other than CHROMEBOOK? There's likely going to be many flavours of it.. -a On 20 March 2014 10:10, Ruslan Bukin wrote: > Author: br > Date: Thu Mar 20 17:10:01 2014 > New Revision: 263427 > URL: http://svnweb.freebsd.org/changeset/base/263427 > > Log: > Add support for Samsung Chromebook (ARM Cortex A15 machine). > > Added: > head/sys/arm/conf/CHROMEBOOK (contents, props changed) > head/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts (contents, props changed) > > Added: head/sys/arm/conf/CHROMEBOOK > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/arm/conf/CHROMEBOOK Thu Mar 20 17:10:01 2014 (r263427) > @@ -0,0 +1,146 @@ > +# Kernel configuration for Samsung Chromebook (Exynos5 Dual machine). > +# > +# For more information on this file, please read the config(5) manual page, > +# and/or the handbook section on Kernel Configuration Files: > +# > +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html > +# > +# The handbook is also available locally in /usr/share/doc/handbook > +# if you've installed the doc distribution, otherwise always see the > +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the > +# latest information. > +# > +# An exhaustive list of options and more detailed explanations of the > +# device lines is also present in the ../../conf/NOTES and NOTES files. > +# If you are in doubt as to the purpose or necessity of a line, check first > +# in NOTES. > +# > +# $FreeBSD$ > + > +ident CHROMEBOOK > + > +include "../samsung/exynos/std.exynos5" > + > +makeoptions MODULES_OVERRIDE="" > +makeoptions WITHOUT_MODULES="ahc" > + > +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > +makeoptions WERROR="-Werror" > + > +options HZ=100 > +options SCHED_4BSD # 4BSD scheduler > +options INET # InterNETworking > +options INET6 # IPv6 communications protocols > +options GEOM_PART_BSD # BSD partition scheme > +options GEOM_PART_MBR # MBR partition scheme > +options TMPFS # Efficient memory filesystem > +options FFS # Berkeley Fast Filesystem > +options SOFTUPDATES > +options UFS_ACL # Support for access control lists > +options UFS_DIRHASH # Improve performance on big directories > +options MSDOSFS # MSDOS Filesystem > +options CD9660 # ISO 9660 Filesystem > +options PROCFS # Process filesystem (requires PSEUDOFS) > +options PSEUDOFS # Pseudo-filesystem framework > +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] > +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI > +options KTRACE > +options SYSVSHM # SYSV-style shared memory > +options SYSVMSG # SYSV-style message queues > +options SYSVSEM # SYSV-style semaphores > +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions > +options KBD_INSTALL_CDEV > +options PREEMPTION > +options FREEBSD_BOOT_LOADER > +options VFP # vfp/neon > + > +# Debugging > +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > +options BREAK_TO_DEBUGGER > +#options VERBOSE_SYSINIT # Enable verbose sysinit messages > +options KDB > +options DDB # Enable the kernel debugger > +#options INVARIANTS # Enable calls of extra sanity checking > +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS > +#options WITNESS # Enable checks to detect deadlocks and cycles > +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed > +#options DIAGNOSTIC > + > +# NFS support > +options NFSCL # Network Filesystem Client > +options NFSLOCKD # Network Lock Manager > +options NFS_ROOT # NFS usable as /, requires NFSCLIENT > + > +# Uncomment this for NFS root > +#options NFS_ROOT # NFS usable as /, requires NFSCL > +#options BOOTP_NFSROOT > +#options BOOTP_COMPAT > +#options BOOTP > +#options BOOTP_NFSV3 > +#options BOOTP_WIRED_TO=cpsw0 > + > +device mmc # mmc/sd bus > +device mmcsd # mmc/sd flash cards > +device sdhci # generic sdhci > + > +options ROOTDEVNAME=\"ufs:/dev/da0\" > + > +#options SMP > + > +# Pseudo devices > + > +device loop > +device random > +device pty > +device md > +device gpio > + > +# USB support > +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. > +device usb > +options USB_DEBUG > +#options USB_REQ_DEBUG > +#options USB_VERBOSE > +#device musb > +device ehci > +#device ohci > + > +device umass > +device scbus # SCSI bus (required for SCSI) > +device da # Direct Access (disks) > +device pass > + > +# SATA > +#device ata > +#device atadisk > +#device mvs > + > +# Serial ports > +device uart > + > +# Framebuffer > +device vt > +device kbdmux > +options SC_DFLT_FONT # compile font in > +makeoptions SC_DFLT_FONT=cp437 > +device ukbd > + > +# I2C (TWSI) > +#device iic > +#device iicbus > + > +# Ethernet > +device ether > +device mii > +device smsc > +device smscphy > + > +# USB ethernet support, requires miibus > +device miibus > +device axe # ASIX Electronics USB Ethernet > +device bpf # Berkeley packet filter > + > +#FDT > +options FDT > +options FDT_DTB_STATIC > +makeoptions FDT_DTS_FILE=exynos5250-chromebook.dts > > Added: head/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts Thu Mar 20 17:10:01 2014 (r263427) > @@ -0,0 +1,59 @@ > +/*- > + * Copyright (c) 2014 Ruslan Bukin > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +/dts-v1/; > + > +/include/ "exynos5250.dtsi" > + > +/ { > + model = "Samsung Chromebook"; > + > + memory { > + device_type = "memory"; > + reg = < 0x40000000 0x80000000 >; /* 2G */ > + }; > + > + SOC: Exynos5@0 { > + > + fimd0: fimd@14400000 { > + status = "okay"; > + > + panel-size = < 1366 768 >; > + panel-hsync = < 80 32 48 >; > + panel-vsync = < 14 5 3 >; > + panel-clk-div = < 17 >; > + panel-backlight-pin = < 25 >; > + }; > + > + }; > + > + chosen { > + stdin = &serial2; > + stdout = &serial2; > + }; > +}; > From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 20:14:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 829EFE00; Thu, 20 Mar 2014 20:14:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6FC68C3D; Thu, 20 Mar 2014 20:14:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KKE5OD004093; Thu, 20 Mar 2014 20:14:05 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KKE5rk004092; Thu, 20 Mar 2014 20:14:05 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201403202014.s2KKE5rk004092@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 20 Mar 2014 20:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263441 - head/sys/fs/msdosfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 20:14:05 -0000 Author: pfg Date: Thu Mar 20 20:14:04 2014 New Revision: 263441 URL: http://svnweb.freebsd.org/changeset/base/263441 Log: msdosfs: minor format fix - spaces vs tab MFC after: 3 days Modified: head/sys/fs/msdosfs/msdosfs_fileno.c Modified: head/sys/fs/msdosfs/msdosfs_fileno.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_fileno.c Thu Mar 20 19:37:30 2014 (r263440) +++ head/sys/fs/msdosfs/msdosfs_fileno.c Thu Mar 20 20:14:04 2014 (r263441) @@ -75,7 +75,7 @@ msdosfs_fileno_init(mp) RB_INIT(&pmp->pm_filenos); pmp->pm_nfileno = FILENO_FIRST_DYN; - if (pmp->pm_HugeSectors > 0xffffffff / + if (pmp->pm_HugeSectors > 0xffffffff / (pmp->pm_BytesPerSec / sizeof(struct direntry)) + 1) pmp->pm_flags |= MSDOSFS_LARGEFS; } From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 20:26:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F10E789; Thu, 20 Mar 2014 20:26:58 +0000 (UTC) Received: from mail.machdep.com (mail.machdep.com [195.91.211.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1EBCFDB0; Thu, 20 Mar 2014 20:26:57 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=machdep.com) by mail.machdep.com with smtp (Exim 4.82 (FreeBSD)) (envelope-from ) id 1WQjXV-000LS9-JP; Fri, 21 Mar 2014 00:26:09 +0400 Received: by machdep.com (nbSMTP-1.00) for uid 1001 br@machdep.com; Fri, 21 Mar 2014 00:26:09 +0400 (MSK) Date: Fri, 21 Mar 2014 00:26:09 +0400 From: Ruslan Bukin To: Adrian Chadd Subject: Re: svn commit: r263427 - in head/sys: arm/conf boot/fdt/dts/arm Message-ID: <20140320202609.GA82451@machdep.com> References: <201403201710.s2KHA1Sg026823@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 20:26:58 -0000 Hi. okay. suggestions? may be CHROMEBOOK-XE303 ? -Ruslan On Thu, Mar 20, 2014 at 01:00:14PM -0700, Adrian Chadd wrote: > Hi, > > Would you mind renaming this to something other than CHROMEBOOK? > There's likely going to be many flavours of it.. > > -a > > > On 20 March 2014 10:10, Ruslan Bukin wrote: > > Author: br > > Date: Thu Mar 20 17:10:01 2014 > > New Revision: 263427 > > URL: http://svnweb.freebsd.org/changeset/base/263427 > > > > Log: > > Add support for Samsung Chromebook (ARM Cortex A15 machine). > > > > Added: > > head/sys/arm/conf/CHROMEBOOK (contents, props changed) > > head/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts (contents, props changed) > > > > Added: head/sys/arm/conf/CHROMEBOOK > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/arm/conf/CHROMEBOOK Thu Mar 20 17:10:01 2014 (r263427) > > @@ -0,0 +1,146 @@ > > +# Kernel configuration for Samsung Chromebook (Exynos5 Dual machine). > > +# > > +# For more information on this file, please read the config(5) manual page, > > +# and/or the handbook section on Kernel Configuration Files: > > +# > > +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html > > +# > > +# The handbook is also available locally in /usr/share/doc/handbook > > +# if you've installed the doc distribution, otherwise always see the > > +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the > > +# latest information. > > +# > > +# An exhaustive list of options and more detailed explanations of the > > +# device lines is also present in the ../../conf/NOTES and NOTES files. > > +# If you are in doubt as to the purpose or necessity of a line, check first > > +# in NOTES. > > +# > > +# $FreeBSD$ > > + > > +ident CHROMEBOOK > > + > > +include "../samsung/exynos/std.exynos5" > > + > > +makeoptions MODULES_OVERRIDE="" > > +makeoptions WITHOUT_MODULES="ahc" > > + > > +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > > +makeoptions WERROR="-Werror" > > + > > +options HZ=100 > > +options SCHED_4BSD # 4BSD scheduler > > +options INET # InterNETworking > > +options INET6 # IPv6 communications protocols > > +options GEOM_PART_BSD # BSD partition scheme > > +options GEOM_PART_MBR # MBR partition scheme > > +options TMPFS # Efficient memory filesystem > > +options FFS # Berkeley Fast Filesystem > > +options SOFTUPDATES > > +options UFS_ACL # Support for access control lists > > +options UFS_DIRHASH # Improve performance on big directories > > +options MSDOSFS # MSDOS Filesystem > > +options CD9660 # ISO 9660 Filesystem > > +options PROCFS # Process filesystem (requires PSEUDOFS) > > +options PSEUDOFS # Pseudo-filesystem framework > > +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] > > +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI > > +options KTRACE > > +options SYSVSHM # SYSV-style shared memory > > +options SYSVMSG # SYSV-style message queues > > +options SYSVSEM # SYSV-style semaphores > > +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions > > +options KBD_INSTALL_CDEV > > +options PREEMPTION > > +options FREEBSD_BOOT_LOADER > > +options VFP # vfp/neon > > + > > +# Debugging > > +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > > +options BREAK_TO_DEBUGGER > > +#options VERBOSE_SYSINIT # Enable verbose sysinit messages > > +options KDB > > +options DDB # Enable the kernel debugger > > +#options INVARIANTS # Enable calls of extra sanity checking > > +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS > > +#options WITNESS # Enable checks to detect deadlocks and cycles > > +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed > > +#options DIAGNOSTIC > > + > > +# NFS support > > +options NFSCL # Network Filesystem Client > > +options NFSLOCKD # Network Lock Manager > > +options NFS_ROOT # NFS usable as /, requires NFSCLIENT > > + > > +# Uncomment this for NFS root > > +#options NFS_ROOT # NFS usable as /, requires NFSCL > > +#options BOOTP_NFSROOT > > +#options BOOTP_COMPAT > > +#options BOOTP > > +#options BOOTP_NFSV3 > > +#options BOOTP_WIRED_TO=cpsw0 > > + > > +device mmc # mmc/sd bus > > +device mmcsd # mmc/sd flash cards > > +device sdhci # generic sdhci > > + > > +options ROOTDEVNAME=\"ufs:/dev/da0\" > > + > > +#options SMP > > + > > +# Pseudo devices > > + > > +device loop > > +device random > > +device pty > > +device md > > +device gpio > > + > > +# USB support > > +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. > > +device usb > > +options USB_DEBUG > > +#options USB_REQ_DEBUG > > +#options USB_VERBOSE > > +#device musb > > +device ehci > > +#device ohci > > + > > +device umass > > +device scbus # SCSI bus (required for SCSI) > > +device da # Direct Access (disks) > > +device pass > > + > > +# SATA > > +#device ata > > +#device atadisk > > +#device mvs > > + > > +# Serial ports > > +device uart > > + > > +# Framebuffer > > +device vt > > +device kbdmux > > +options SC_DFLT_FONT # compile font in > > +makeoptions SC_DFLT_FONT=cp437 > > +device ukbd > > + > > +# I2C (TWSI) > > +#device iic > > +#device iicbus > > + > > +# Ethernet > > +device ether > > +device mii > > +device smsc > > +device smscphy > > + > > +# USB ethernet support, requires miibus > > +device miibus > > +device axe # ASIX Electronics USB Ethernet > > +device bpf # Berkeley packet filter > > + > > +#FDT > > +options FDT > > +options FDT_DTB_STATIC > > +makeoptions FDT_DTS_FILE=exynos5250-chromebook.dts > > > > Added: head/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts Thu Mar 20 17:10:01 2014 (r263427) > > @@ -0,0 +1,59 @@ > > +/*- > > + * Copyright (c) 2014 Ruslan Bukin > > + * All rights reserved. > > + * > > + * Redistribution and use in source and binary forms, with or without > > + * modification, are permitted provided that the following conditions > > + * are met: > > + * 1. Redistributions of source code must retain the above copyright > > + * notice, this list of conditions and the following disclaimer. > > + * 2. Redistributions in binary form must reproduce the above copyright > > + * notice, this list of conditions and the following disclaimer in the > > + * documentation and/or other materials provided with the distribution. > > + * > > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > > + * SUCH DAMAGE. > > + * > > + * $FreeBSD$ > > + */ > > + > > +/dts-v1/; > > + > > +/include/ "exynos5250.dtsi" > > + > > +/ { > > + model = "Samsung Chromebook"; > > + > > + memory { > > + device_type = "memory"; > > + reg = < 0x40000000 0x80000000 >; /* 2G */ > > + }; > > + > > + SOC: Exynos5@0 { > > + > > + fimd0: fimd@14400000 { > > + status = "okay"; > > + > > + panel-size = < 1366 768 >; > > + panel-hsync = < 80 32 48 >; > > + panel-vsync = < 14 5 3 >; > > + panel-clk-div = < 17 >; > > + panel-backlight-pin = < 25 >; > > + }; > > + > > + }; > > + > > + chosen { > > + stdin = &serial2; > > + stdout = &serial2; > > + }; > > +}; > > > From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 20:39:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3386E5B; Thu, 20 Mar 2014 20:39:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CE925F1A; Thu, 20 Mar 2014 20:39:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KKdhX1012913; Thu, 20 Mar 2014 20:39:43 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KKdgAl012905; Thu, 20 Mar 2014 20:39:42 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201403202039.s2KKdgAl012905@svn.freebsd.org> From: Alan Somers Date: Thu, 20 Mar 2014 20:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263445 - in head: etc/mtree sbin/ifconfig sbin/ifconfig/tests tests/sys tests/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 20:39:44 -0000 Author: asomers Date: Thu Mar 20 20:39:41 2014 New Revision: 263445 URL: http://svnweb.freebsd.org/changeset/base/263445 Log: Add several ATF tests that deal with multiple fibs. They're described in several different PRs, but the tests share some common code, so I'm committing them together. sbin/ifconfig/tests sbin/ifconfig/tests/fibs_test.sh sbin/ifconfig/tests/Makefile sbin/ifconfig/Makefile Add fibs_test.sh, which regresses bin/187551 tests/sys/netinet tests/sys/netinet/fibs_test.sh tests/sys/netinet/udp_dontroute.c tests/sys/netinet/Makefile tests/sys/Makefile Add fibs_test.sh, which regresses kern/167947, kern/187552 kern/187549, kern/187550, and kern/187553 etc/mtree/BSD.tests.dist Add newly created directories PR: bin/187551 PR: kern/167947 PR: kern/187552 PR: kern/187549 PR: kern/187550 PR: kern/187553 Discussed with: melifaro MFC after: 3 weeks Sponsored by: Spectra Logic Corporation Added: head/sbin/ifconfig/tests/ head/sbin/ifconfig/tests/Makefile (contents, props changed) head/sbin/ifconfig/tests/fibs_test.sh (contents, props changed) head/tests/sys/netinet/ head/tests/sys/netinet/Makefile (contents, props changed) head/tests/sys/netinet/fibs_test.sh (contents, props changed) head/tests/sys/netinet/udp_dontroute.c (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/sbin/ifconfig/Makefile head/tests/sys/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Thu Mar 20 20:33:18 2014 (r263444) +++ head/etc/mtree/BSD.tests.dist Thu Mar 20 20:39:41 2014 (r263445) @@ -75,6 +75,8 @@ .. growfs .. + ifconfig + .. mdconfig .. .. @@ -91,6 +93,8 @@ sys kern .. + netinet + .. .. usr.bin apply Modified: head/sbin/ifconfig/Makefile ============================================================================== --- head/sbin/ifconfig/Makefile Thu Mar 20 20:33:18 2014 (r263444) +++ head/sbin/ifconfig/Makefile Thu Mar 20 20:39:41 2014 (r263445) @@ -63,4 +63,8 @@ MAN= ifconfig.8 CFLAGS+= -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs WARNS?= 2 +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/sbin/ifconfig/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/ifconfig/tests/Makefile Thu Mar 20 20:39:41 2014 (r263445) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/sbin/ifconfig + +ATF_TESTS_SH= fibs_test + +.include Added: head/sbin/ifconfig/tests/fibs_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/ifconfig/tests/fibs_test.sh Thu Mar 20 20:39:41 2014 (r263445) @@ -0,0 +1,126 @@ +# +# Copyright (c) 2014 Spectra Logic Corporation +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions, and the following disclaimer, +# without modification. +# 2. Redistributions in binary form must reproduce at minimum a disclaimer +# substantially similar to the "NO WARRANTY" disclaimer below +# ("Disclaimer") and any redistribution must be conditioned upon +# including a substantially similar Disclaimer requirement for further +# binary redistribution. +# +# NO WARRANTY +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGES. +# +# Authors: Alan Somers (Spectra Logic Corporation) +# +# $FreeBSD$ + + +# Regression test for bin/187551 +atf_test_case process_fib cleanup +process_fib_head() +{ + atf_set "descr" "ifconfig will set its process fib whenever configuring an interface with nondefault fib" + atf_set "require.user" "root" + atf_set "require.config" "fibs" +} +process_fib_body() +{ + atf_expect_fail "bin/187551 ifconfig should change its process fib when configuring an interface with nondefault fib" + # Configure the TAP interface to use an RFC5737 nonrouteable address + # and a non-default fib + ADDR="192.0.2.2" + SUBNET="192.0.2.0" + MASK="24" + + # Check system configuration + if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then + atf_skip "This test requires net.add_addr_allfibs=0" + fi + get_fibs 1 + + # Configure a TAP interface + get_tap + ktrace ifconfig $TAP ${ADDR}/${MASK} fib $FIB0 + if kdump -s | egrep -q 'CALL[[:space:]]+setfib'; then + atf_pass + else + atf_fail "ifconfig never called setfib(2)" + fi +} + +process_fib_cleanup() +{ + cleanup_tap +} + +atf_init_test_cases() +{ + atf_add_test_case process_fib +} + + +# parameter numfibs The number of fibs to lookup +get_fibs() +{ + NUMFIBS=$1 + net_fibs=`sysctl -n net.fibs` + i=0 + while [ $i -lt "$NUMFIBS" ]; do + fib=`atf_config_get "fibs" | \ + awk -v i=$(( i + 1 )) '{print $i}'` + echo "fib is ${fib}" + eval FIB${i}=${fib} + if [ "$fib" -ge "$net_fibs" ]; then + atf_skip "The ${i}th configured fib is ${fib}, which is not less than net.fibs, which is ${net_fibs}" + fi + i=$(( $i + 1 )) + done +} + + + +# Creates a new tap(4) interface, registers it for cleanup, and returns the +# name via the environment variable TAP +get_tap() +{ + local TAPN=0 + while ! ifconfig tap${TAPN} create > /dev/null 2>&1; do + if [ "$TAPN" -ge 8 ]; then + atf_skip "Could not create a tap(4) interface" + else + TAPN=$(($TAPN + 1)) + fi + done + local TAPD=tap${TAPN} + # Record the TAP device so we can clean it up later + echo ${TAPD} >> "tap_devices_to_cleanup" + TAP=${TAPD} +} + + + + +cleanup_tap() +{ + for TAPD in `cat "tap_devices_to_cleanup"`; do + ifconfig ${TAPD} destroy + done +} + Modified: head/tests/sys/Makefile ============================================================================== --- head/tests/sys/Makefile Thu Mar 20 20:33:18 2014 (r263444) +++ head/tests/sys/Makefile Thu Mar 20 20:39:41 2014 (r263445) @@ -5,6 +5,7 @@ .PATH: ${.CURDIR}/.. TESTS_SUBDIRS+= kern +TESTS_SUBDIRS+= netinet TESTSDIR= ${TESTSBASE}/sys KYUAFILE= yes Added: head/tests/sys/netinet/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netinet/Makefile Thu Mar 20 20:39:41 2014 (r263445) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/sys/netinet +BINDIR= ${TESTSDIR} + +ATF_TESTS_SH+= fibs_test +PROG= udp_dontroute +SRCS= udp_dontroute.c +NO_MAN= +WARNS?= 6 + +.include Added: head/tests/sys/netinet/fibs_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netinet/fibs_test.sh Thu Mar 20 20:39:41 2014 (r263445) @@ -0,0 +1,371 @@ +# +# Copyright (c) 2014 Spectra Logic Corporation +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions, and the following disclaimer, +# without modification. +# 2. Redistributions in binary form must reproduce at minimum a disclaimer +# substantially similar to the "NO WARRANTY" disclaimer below +# ("Disclaimer") and any redistribution must be conditioned upon +# including a substantially similar Disclaimer requirement for further +# binary redistribution. +# +# NO WARRANTY +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGES. +# +# Authors: Alan Somers (Spectra Logic Corporation) +# +# $FreeBSD$ + +# All of the tests in this file requires the test-suite config variable "fibs" +# to be defined to a space-delimited list of FIBs that may be used for testing. + +# arpresolve should check the interface fib for routes to a target when +# creating an ARP table entry. This is a regression for kern/167947, where +# arpresolve only checked the default route. +# +# Outline: +# Create two tap(4) interfaces +# Simulate a crossover cable between them by using net/socat +# Use nping (from security/nmap) to send an ICMP echo request from one +# interface to the other, spoofing the source IP. The source IP must be +# spoofed, or else it will already have an entry in the arp table. +# Check whether an arp entry exists for the spoofed IP +atf_test_case arpresolve_checks_interface_fib cleanup +arpresolve_checks_interface_fib_head() +{ + atf_set "descr" "arpresolve should check the interface fib, not the default fib, for routes" + atf_set "require.user" "root" + atf_set "require.config" "fibs" + atf_set "require.progs" "socat nping" +} +arpresolve_checks_interface_fib_body() +{ + atf_expect_fail "kern/167947 arpresolve checks only the default FIB for the interface route" + # Configure the TAP interfaces to use a RFC5737 nonrouteable addresses + # and a non-default fib + ADDR0="192.0.2.2" + ADDR1="192.0.2.3" + SUBNET="192.0.2.0" + # Due to bug TBD (regressed by multiple_fibs_on_same_subnet) we need + # diffferent subnet masks, or FIB1 won't have a subnet route. + MASK0="24" + MASK1="25" + # Spoof a MAC that is reserved per RFC7042 + SPOOF_ADDR="192.0.2.4" + SPOOF_MAC="00:00:5E:00:53:00" + + # Check system configuration + if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then + atf_skip "This test requires net.add_addr_allfibs=0" + fi + get_fibs 2 + + # Configure TAP interfaces + setup_tap "$FIB0" ${ADDR0} ${MASK0} + TAP0=$TAP + setup_tap "$FIB1" ${ADDR1} ${MASK1} + TAP1=$TAP + + # Simulate a crossover cable + socat /dev/${TAP0} /dev/${TAP1} & + SOCAT_PID=$! + echo ${SOCAT_PID} >> "processes_to_kill" + + # Send an ICMP echo request with a spoofed source IP + setfib 2 nping -c 1 -e ${TAP0} -S ${SPOOF_ADDR} \ + --source-mac ${SPOOF_MAC} --icmp --icmp-type "echo-request" \ + --icmp-code 0 --icmp-id 0xdead --icmp-seq 1 --data 0xbeef \ + ${ADDR1} + # For informational and debugging purposes only, look for the + # characteristic error message + dmesg | grep "llinfo.*${SPOOF_ADDR}" + # Check that the ARP entry exists + atf_check -o match:"${SPOOF_ADDR}.*expires" setfib 3 arp ${SPOOF_ADDR} +} +arpresolve_checks_interface_fib_cleanup() +{ + for PID in `cat "processes_to_kill"`; do + kill $PID + done + cleanup_tap +} + + +# Regression test for kern/187549 +atf_test_case loopback_and_network_routes_on_nondefault_fib cleanup +loopback_and_network_routes_on_nondefault_fib_head() +{ + atf_set "descr" "When creating and deleting loopback routes, use the interface's fib" + atf_set "require.user" "root" + atf_set "require.config" "fibs" +} + +loopback_and_network_routes_on_nondefault_fib_body() +{ + atf_expect_fail "kern/187549 Host and network routes for a new interface appear in the wrong FIB" + # Configure the TAP interface to use an RFC5737 nonrouteable address + # and a non-default fib + ADDR="192.0.2.2" + SUBNET="192.0.2.0" + MASK="24" + + # Check system configuration + if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then + atf_skip "This test requires net.add_addr_allfibs=0" + fi + get_fibs 1 + + # Configure a TAP interface + setup_tap ${FIB0} ${ADDR} ${MASK} + + # Check whether the host route exists in only the correct FIB + setfib ${FIB0} netstat -rn -f inet | grep -q "^${ADDR}.*UHS.*lo0" + if [ 0 -ne $? ]; then + setfib ${FIB0} netstat -rn -f inet + atf_fail "Host route did not appear in the correct FIB" + fi + setfib 0 netstat -rn -f inet | grep -q "^${ADDR}.*UHS.*lo0" + if [ 0 -eq $? ]; then + setfib 0 netstat -rn -f inet + atf_fail "Host route appeared in the wrong FIB" + fi + + # Check whether the network route exists in only the correct FIB + setfib ${FIB0} netstat -rn -f inet | \ + grep -q "^${SUBNET}/${MASK}.*${TAPD}" + if [ 0 -ne $? ]; then + setfib ${FIB0} netstat -rn -f inet + atf_fail "Network route did not appear in the correct FIB" + fi + setfib 0 netstat -rn -f inet | \ + grep -q "^${SUBNET}/${MASK}.*${TAPD}" + if [ 0 -eq $? ]; then + setfib ${FIB0} netstat -rn -f inet + atf_fail "Network route appeared in the wrong FIB" + fi +} + +loopback_and_network_routes_on_nondefault_fib_cleanup() +{ + cleanup_tap +} + + +# Regression test for kern/187552 +atf_test_case default_route_with_multiple_fibs_on_same_subnet cleanup +default_route_with_multiple_fibs_on_same_subnet_head() +{ + atf_set "descr" "Multiple interfaces on the same subnet but with different fibs can both have default routes" + atf_set "require.user" "root" + atf_set "require.config" "fibs" +} + +default_route_with_multiple_fibs_on_same_subnet_body() +{ + atf_expect_fail "kern/187552 default route uses the wrong interface when multiple interfaces have the same subnet but different fibs" + # Configure the TAP interfaces to use a RFC5737 nonrouteable addresses + # and a non-default fib + ADDR0="192.0.2.2" + ADDR1="192.0.2.3" + GATEWAY="192.0.2.1" + SUBNET="192.0.2.0" + MASK="24" + + # Check system configuration + if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then + atf_skip "This test requires net.add_addr_allfibs=0" + fi + get_fibs 2 + + # Configure TAP interfaces + setup_tap "$FIB0" ${ADDR0} ${MASK} + TAP0=$TAP + setup_tap "$FIB1" ${ADDR1} ${MASK} + TAP1=$TAP + + # Attempt to add default routes + setfib ${FIB0} route add default ${GATEWAY} + setfib ${FIB1} route add default ${GATEWAY} + + # Verify that the default route exists for both fibs, with their + # respective interfaces. + atf_check -o match:"^default.*${TAP0}$" \ + setfib ${FIB0} netstat -rn -f inet + atf_check -o match:"^default.*${TAP1}$" \ + setfib ${FIB1} netstat -rn -f inet +} + +default_route_with_multiple_fibs_on_same_subnet_cleanup() +{ + cleanup_tap +} + + +# Regression test for kern/187550 +atf_test_case subnet_route_with_multiple_fibs_on_same_subnet cleanup +subnet_route_with_multiple_fibs_on_same_subnet_head() +{ + atf_set "descr" "Multiple FIBs can have subnet routes for the same subnet" + atf_set "require.user" "root" + atf_set "require.config" "fibs" +} + +subnet_route_with_multiple_fibs_on_same_subnet_body() +{ + atf_expect_fail "kern/187550 Multiple interfaces on different FIBs but the same subnet don't all have a subnet route" + # Configure the TAP interfaces to use a RFC5737 nonrouteable addresses + # and a non-default fib + ADDR0="192.0.2.2" + ADDR1="192.0.2.3" + SUBNET="192.0.2.0" + MASK="24" + + # Check system configuration + if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then + atf_skip "This test requires net.add_addr_allfibs=0" + fi + get_fibs 2 + + # Configure TAP interfaces + setup_tap "$FIB0" ${ADDR0} ${MASK} + setup_tap "$FIB1" ${ADDR1} ${MASK} + + # Check that a subnet route exists on both fibs + atf_check -o ignore setfib "$FIB0" route get $ADDR1 + atf_check -o ignore setfib "$FIB1" route get $ADDR0 +} + +subnet_route_with_multiple_fibs_on_same_subnet_cleanup() +{ + cleanup_tap +} + +# Test that source address selection works correctly for UDP packets with +# SO_DONTROUTE set that are sent on non-default FIBs. +# This bug was discovered with "setfib 1 netperf -t UDP_STREAM -H some_host" +# Regression test for kern/187553 +atf_test_case udp_dontroute cleanup +udp_dontroute_head() +{ + atf_set "descr" "Source address selection for UDP packets with SO_DONTROUTE on non-default FIBs works" + atf_set "require.user" "root" + atf_set "require.config" "fibs" +} + +udp_dontroute_body() +{ + atf_expect_fail "kern/187553 Source address selection for UDP packets with SO_DONTROUTE uses the default FIB" + # Configure the TAP interface to use an RFC5737 nonrouteable address + # and a non-default fib + ADDR="192.0.2.2" + SUBNET="192.0.2.0" + MASK="24" + # Use a different IP on the same subnet as the target + TARGET="192.0.2.100" + + # Check system configuration + if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then + atf_skip "This test requires net.add_addr_allfibs=0" + fi + get_fibs 1 + + # Configure a TAP interface + setup_tap ${FIB0} ${ADDR} ${MASK} + + # Send a UDP packet with SO_DONTROUTE. In the failure case, it will + # return ENETUNREACH + SRCDIR=`atf_get_srcdir` + atf_check -o ignore setfib ${FIB0} ${SRCDIR}/udp_dontroute ${TARGET} +} + +udp_dontroute_cleanup() +{ + cleanup_tap +} + + +atf_init_test_cases() +{ + atf_add_test_case arpresolve_checks_interface_fib + atf_add_test_case loopback_and_network_routes_on_nondefault_fib + atf_add_test_case default_route_with_multiple_fibs_on_same_subnet + atf_add_test_case subnet_route_with_multiple_fibs_on_same_subnet + atf_add_test_case udp_dontroute +} + +# Looks up one or more fibs from the configuration data and validates them. +# Returns the results in the env varilables FIB0, FIB1, etc. + +# parameter numfibs The number of fibs to lookup +get_fibs() +{ + NUMFIBS=$1 + net_fibs=`sysctl -n net.fibs` + i=0 + while [ $i -lt "$NUMFIBS" ]; do + fib=`atf_config_get "fibs" | \ + awk -v i=$(( i + 1 )) '{print $i}'` + echo "fib is ${fib}" + eval FIB${i}=${fib} + if [ "$fib" -ge "$net_fibs" ]; then + atf_skip "The ${i}th configured fib is ${fib}, which is not less than net.fibs, which is ${net_fibs}" + fi + i=$(( $i + 1 )) + done +} + +# Creates a new tap(4) interface, registers it for cleanup, and returns the +# name via the environment variable TAP +get_tap() +{ + local TAPN=0 + while ! ifconfig tap${TAPN} create > /dev/null 2>&1; do + if [ "$TAPN" -ge 8 ]; then + atf_skip "Could not create a tap(4) interface" + else + TAPN=$(($TAPN + 1)) + fi + done + local TAPD=tap${TAPN} + # Record the TAP device so we can clean it up later + echo ${TAPD} >> "tap_devices_to_cleanup" + TAP=${TAPD} +} + +# Create a tap(4) interface, configure it, and register it for cleanup. +# parameters: +# fib +# IP address +# Netmask in number of bits (eg 24 or 8) +# Return: the tap interface name as the env variable TAP +setup_tap() +{ + local FIB=$1 + local ADDR=$2 + local MASK=$3 + get_tap + echo setfib ${FIB} ifconfig $TAP ${ADDR}/${MASK} fib $FIB + setfib ${FIB} ifconfig $TAP ${ADDR}/${MASK} fib $FIB +} + +cleanup_tap() +{ + for TAPD in `cat "tap_devices_to_cleanup"`; do + ifconfig ${TAPD} destroy + done +} Added: head/tests/sys/netinet/udp_dontroute.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netinet/udp_dontroute.c Thu Mar 20 20:39:41 2014 (r263445) @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2014 Spectra Logic Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * Authors: Alan Somers (Spectra Logic Corporation) + * + * $FreeBSD$ + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +/* + * Sends a single UDP packet to the provided address, with SO_DONTROUTE set + * I couldn't find a way to do this with builtin utilities like nc(1) + */ +int main(int argc, char **argv) +{ + struct sockaddr_in dst; + int s; + int opt; + int ret; + const char* buf = "Hello, World!"; + + if (argc != 2) { + fprintf(stderr, "Usage: %s ip_address\n", argv[0]); + exit(2); + } + s = socket(PF_INET, SOCK_DGRAM, 0); + if (s < 0) + err(errno, "socket"); + opt = 1; + + ret = setsockopt(s, SOL_SOCKET, SO_DONTROUTE, &opt, sizeof(opt)); + if (ret == -1) + err(errno, "setsockopt(SO_DONTROUTE)"); + + dst.sin_len = sizeof(dst); + dst.sin_family = AF_INET; + dst.sin_port = htons(46120); + dst.sin_addr.s_addr = inet_addr(argv[1]); + if (dst.sin_addr.s_addr == htonl(INADDR_NONE)) { + fprintf(stderr, "Invalid address: %s\n", argv[1]); + exit(2); + } + ret = sendto(s, buf, strlen(buf), 0, (struct sockaddr*)&dst, + dst.sin_len); + if (ret == -1) + err(errno, "sendto"); + + return (0); +} From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 20:45:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AF4029D; Thu, 20 Mar 2014 20:45:08 +0000 (UTC) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id 48F82B; Thu, 20 Mar 2014 20:45:08 +0000 (UTC) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by alto.onthenet.com.au (Postfix) with ESMTPS id D43F11240A; Fri, 21 Mar 2014 06:45:00 +1000 (EST) Received: from Peter-Grehans-MacBook-Pro-2.local ([64.245.0.210]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BST21635 (AUTH peterg@ptree32.com.au); Fri, 21 Mar 2014 06:44:59 +1000 Message-ID: <532B5349.2080408@freebsd.org> Date: Thu, 20 Mar 2014 13:44:57 -0700 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Ruslan Bukin Subject: Re: svn commit: r263427 - in head/sys: arm/conf boot/fdt/dts/arm References: <201403201710.s2KHA1Sg026823@svn.freebsd.org> <20140320202609.GA82451@machdep.com> In-Reply-To: <20140320202609.GA82451@machdep.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 20:45:08 -0000 > okay. suggestions? > may be CHROMEBOOK-XE303 ? The new ones look to be called 'chromebook 2', so CHROMEBOOK looks fine in implying v1. later, Peter. From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 20:51:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3865351D; Thu, 20 Mar 2014 20:51:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 236D413B; Thu, 20 Mar 2014 20:51:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KKpADA017490; Thu, 20 Mar 2014 20:51:10 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KKp8RC017479; Thu, 20 Mar 2014 20:51:08 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201403202051.s2KKp8RC017479@svn.freebsd.org> From: Hiren Panchasara Date: Thu, 20 Mar 2014 20:51:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263446 - in head: lib/libpmc sys/dev/hwpmc sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 20:51:10 -0000 Author: hiren Date: Thu Mar 20 20:51:08 2014 New Revision: 263446 URL: http://svnweb.freebsd.org/changeset/base/263446 Log: Update hwpmc to support core events for Atom Silvermont microarchitecture. (Model 0x4D as per Intel document 330061-001 01/2014) Tested by: Olivier Cochard-Labbe MFC after: 4 weeks Added: head/lib/libpmc/pmc.atomsilvermont.3 (contents, props changed) Modified: head/lib/libpmc/Makefile head/lib/libpmc/libpmc.c head/lib/libpmc/pmc.atom.3 head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/hwpmc_intel.c head/sys/dev/hwpmc/pmc_events.h head/sys/sys/pmc.h Modified: head/lib/libpmc/Makefile ============================================================================== --- head/lib/libpmc/Makefile Thu Mar 20 20:39:41 2014 (r263445) +++ head/lib/libpmc/Makefile Thu Mar 20 20:51:08 2014 (r263446) @@ -24,6 +24,7 @@ MAN+= pmc.soft.3 # PMC-dependent manual pages MAN+= pmc.atom.3 +MAN+= pmc.atomsilvermont.3 MAN+= pmc.core.3 MAN+= pmc.core2.3 MAN+= pmc.corei7.3 Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Thu Mar 20 20:39:41 2014 (r263445) +++ head/lib/libpmc/libpmc.c Thu Mar 20 20:51:08 2014 (r263446) @@ -169,6 +169,11 @@ static const struct pmc_event_descr atom __PMC_EV_ALIAS_ATOM() }; +static const struct pmc_event_descr atom_silvermont_event_table[] = +{ + __PMC_EV_ALIAS_ATOM_SILVERMONT() +}; + static const struct pmc_event_descr core_event_table[] = { __PMC_EV_ALIAS_CORE() @@ -246,6 +251,7 @@ static const struct pmc_event_descr west } PMC_MDEP_TABLE(atom, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); +PMC_MDEP_TABLE(atom_silvermont, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(core, IAP, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); @@ -288,6 +294,7 @@ static const struct pmc_class_descr NAME #if defined(__i386__) || defined(__amd64__) PMC_CLASS_TABLE_DESC(iaf, IAF, iaf, iaf); PMC_CLASS_TABLE_DESC(atom, IAP, atom, iap); +PMC_CLASS_TABLE_DESC(atom_silvermont, IAP, atom_silvermont, iap); PMC_CLASS_TABLE_DESC(core, IAP, core, iap); PMC_CLASS_TABLE_DESC(core2, IAP, core2, iap); PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap); @@ -597,6 +604,8 @@ static struct pmc_event_alias core2_alia #define atom_aliases core2_aliases #define atom_aliases_without_iaf core2_aliases_without_iaf +#define atom_silvermont_aliases core2_aliases +#define atom_silvermont_aliases_without_iaf core2_aliases_without_iaf #define corei7_aliases core2_aliases #define corei7_aliases_without_iaf core2_aliases_without_iaf #define haswell_aliases core2_aliases @@ -842,6 +851,7 @@ iap_allocate_pmc(enum pmc_event pe, char if (n != 1) return (-1); } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_ATOM || + cpu_info.pm_cputype == PMC_CPU_INTEL_ATOM_SILVERMONT || cpu_info.pm_cputype == PMC_CPU_INTEL_CORE2 || cpu_info.pm_cputype == PMC_CPU_INTEL_CORE2EXTREME) { if (KWPREFIXMATCH(p, IAP_KW_SNOOPRESPONSE "=")) { @@ -2733,6 +2743,10 @@ pmc_event_names_of_class(enum pmc_class ev = atom_event_table; count = PMC_EVENT_TABLE_SIZE(atom); break; + case PMC_CPU_INTEL_ATOM_SILVERMONT: + ev = atom_silvermont_event_table; + count = PMC_EVENT_TABLE_SIZE(atom_silvermont); + break; case PMC_CPU_INTEL_CORE: ev = core_event_table; count = PMC_EVENT_TABLE_SIZE(core); @@ -3049,6 +3063,9 @@ pmc_init(void) case PMC_CPU_INTEL_ATOM: PMC_MDEP_INIT_INTEL_V2(atom); break; + case PMC_CPU_INTEL_ATOM_SILVERMONT: + PMC_MDEP_INIT_INTEL_V2(atom_silvermont); + break; case PMC_CPU_INTEL_CORE: PMC_MDEP_INIT(core); pmc_class_table[n] = &core_class_table_descr; @@ -3202,6 +3219,11 @@ _pmc_name_of_event(enum pmc_event pe, en ev = atom_event_table; evfence = atom_event_table + PMC_EVENT_TABLE_SIZE(atom); break; + case PMC_CPU_INTEL_ATOM_SILVERMONT: + ev = atom_silvermont_event_table; + evfence = atom_silvermont_event_table + + PMC_EVENT_TABLE_SIZE(atom_silvermont); + break; case PMC_CPU_INTEL_CORE: ev = core_event_table; evfence = core_event_table + PMC_EVENT_TABLE_SIZE(core); Modified: head/lib/libpmc/pmc.atom.3 ============================================================================== --- head/lib/libpmc/pmc.atom.3 Thu Mar 20 20:39:41 2014 (r263445) +++ head/lib/libpmc/pmc.atom.3 Thu Mar 20 20:51:08 2014 (r263446) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2008 +.Dd March 20, 2014 .Dt PMC.ATOM 3 .Os .Sh NAME @@ -1168,6 +1168,7 @@ and the underlying hardware events used .El .Sh SEE ALSO .Xr pmc 3 , +.Xr pmc.atomsilvermont 3 , .Xr pmc.core 3 , .Xr pmc.core2 3 , .Xr pmc.iaf 3 , Added: head/lib/libpmc/pmc.atomsilvermont.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libpmc/pmc.atomsilvermont.3 Thu Mar 20 20:51:08 2014 (r263446) @@ -0,0 +1,535 @@ +.\" Copyright (c) 2014 Hiren Panchasara +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 20, 2014 +.Dt PMC.ATOMSILVERMONT 3 +.Os +.Sh NAME +.Nm pmc.atomsilvermont +.Nd measurement events for +.Tn Intel +.Tn Atom Silvermont +family CPUs +.Sh LIBRARY +.Lb libpmc +.Sh SYNOPSIS +.In pmc.h +.Sh DESCRIPTION +.Tn Intel +.Tn Atom Silvermont +CPUs contain PMCs conforming to version 3 of the +.Tn Intel +performance measurement architecture. +These CPUs contains two classes of PMCs: +.Bl -tag -width "Li PMC_CLASS_IAP" +.It Li PMC_CLASS_IAF +Fixed-function counters that count only one hardware event per counter. +.It Li PMC_CLASS_IAP +Programmable counters that may be configured to count one of a defined +set of hardware events. +.El +.Pp +The number of PMCs available in each class and their widths need to be +determined at run time by calling +.Xr pmc_cpuinfo 3 . +.Pp +Intel Atom Silvermont PMCs are documented in +.Rs +.%B "Intel 64 and IA-32 Intel(R) Architecture Software Developer's Manual" +.%T "Combined Volumes" +.%N "Order Number 325462-050US" +.%D February 2014 +.%Q "Intel Corporation" +.Re +.Ss ATOM SILVERMONT FIXED FUNCTION PMCS +These PMCs and their supported events are documented in +.Xr pmc.iaf 3 . +.Ss ATOM SILVERMONT PROGRAMMABLE PMCS +The programmable PMCs support the following capabilities: +.Bl -column "PMC_CAP_INTERRUPT" "Support" +.It Em Capability Ta Em Support +.It PMC_CAP_CASCADE Ta \&No +.It PMC_CAP_EDGE Ta Yes +.It PMC_CAP_INTERRUPT Ta Yes +.It PMC_CAP_INVERT Ta Yes +.It PMC_CAP_READ Ta Yes +.It PMC_CAP_PRECISE Ta \&No +.It PMC_CAP_SYSTEM Ta Yes +.It PMC_CAP_TAGGING Ta \&No +.It PMC_CAP_THRESHOLD Ta Yes +.It PMC_CAP_USER Ta Yes +.It PMC_CAP_WRITE Ta Yes +.El +.Ss Event Qualifiers +Event specifiers for these PMCs support the following common +qualifiers: +.Bl -tag -width indent +.It Li any +Count matching events seen on any logical processor in a package. +.It Li cmask= Ns Ar value +Configure the PMC to increment only if the number of configured +events measured in a cycle is greater than or equal to +.Ar value . +.It Li edge +Configure the PMC to count the number of de-asserted to asserted +transitions of the conditions expressed by the other qualifiers. +If specified, the counter will increment only once whenever a +condition becomes true, irrespective of the number of clocks during +which the condition remains true. +.It Li inv +Invert the sense of comparison when the +.Dq Li cmask +qualifier is present, making the counter increment when the number of +events per cycle is less than the value specified by the +.Dq Li cmask +qualifier. +.It Li os +Configure the PMC to count events happening at processor privilege +level 0. +.It Li usr +Configure the PMC to count events occurring at privilege levels 1, 2 +or 3. +.El +.Pp +If neither of the +.Dq Li os +or +.Dq Li usr +qualifiers are specified, the default is to enable both. +.Pp +Events that require core-specificity to be specified use a +additional qualifier +.Dq Li core= Ns Ar core , +where argument +.Ar core +is one of: +.Bl -tag -width indent +.It Li all +Measure event conditions on all cores. +.It Li this +Measure event conditions on this core. +.El +.Pp +The default is +.Dq Li this . +.Pp +Events that require an agent qualifier to be specified use an +additional qualifier +.Dq Li agent= Ns agent , +where argument +.Ar agent +is one of: +.Bl -tag -width indent +.It Li this +Measure events associated with this bus agent. +.It Li any +Measure events caused by any bus agent. +.El +.Pp +The default is +.Dq Li this . +.Pp +Events that require a hardware prefetch qualifier to be specified use an +additional qualifier +.Dq Li prefetch= Ns Ar prefetch , +where argument +.Ar prefetch +is one of: +.Bl -tag -width "exclude" +.It Li both +Include all prefetches. +.It Li only +Only count hardware prefetches. +.It Li exclude +Exclude hardware prefetches. +.El +.Pp +The default is +.Dq Li both . +.Pp +Events that require a cache coherence qualifier to be specified use an +additional qualifier +.Dq Li cachestate= Ns Ar state , +where argument +.Ar state +contains one or more of the following letters: +.Bl -tag -width indent +.It Li e +Count cache lines in the exclusive state. +.It Li i +Count cache lines in the invalid state. +.It Li m +Count cache lines in the modified state. +.It Li s +Count cache lines in the shared state. +.El +.Pp +The default is +.Dq Li eims . +.Pp +Events that require a snoop response qualifier to be specified use an +additional qualifier +.Dq Li snoopresponse= Ns Ar response , +where argument +.Ar response +comprises of the following keywords separated by +.Dq + +signs: +.Bl -tag -width indent +.It Li clean +Measure CLEAN responses. +.It Li hit +Measure HIT responses. +.It Li hitm +Measure HITM responses. +.El +.Pp +The default is to measure all the above responses. +.Pp +Events that require a snoop type qualifier use an additional qualifier +.Dq Li snooptype= Ns Ar type , +where argument +.Ar type +comprises the one of the following keywords: +.Bl -tag -width indent +.It Li cmp2i +Measure CMP2I snoops. +.It Li cmp2s +Measure CMP2S snoops. +.El +.Pp +The default is to measure both snoops. +.Ss Event Specifiers (Programmable PMCs) +Atom Silvermont programmable PMCs support the following events: +.Bl -tag -width indent +.It Li REHABQ.LD_BLOCK_ST_FORWARD +.Pq Event 03H , Umask 01H +The number of retired loads that were +prohibited from receiving forwarded data from the store +because of address mismatch. +.It Li REHABQ.LD_BLOCK_STD_NOTREADY +.Pq Event 03H , Umask 02H +The cases where a forward was technically possible, +but did not occur because the store data was not available +at the right time. +.It Li REHABQ.ST_SPLITS +.Pq Event 03H , Umask 04H +The number of retire stores that experienced. +cache line boundary splits. +.It Li REHABQ.LD_SPLITS +.Pq Event 03H , Umask 08H +The number of retire loads that experienced. +cache line boundary splits. +.It Li REHABQ.LOCK +.Pq Event 03H , Umask 10H +The number of retired memory operations with lock semantics. +These are either implicit locked instructions such as the +XCHG instruction or instructions with an explicit LOCK +prefix (0xF0). +.It Li REHABQ.STA_FULL +.Pq Event 03H , Umask 20H +The number of retired stores that are delayed +because there is not a store address buffer available. +.It Li REHABQ.ANY_LD +.Pq Event 03H , Umask 40H +The number of load uops reissued from Rehabq. +.It Li REHABQ.ANY_ST +.Pq Event 03H , Umask 80H +The number of store uops reissued from Rehabq. +.It Li MEM_UOPS_RETIRED.L1_MISS_LOADS +.Pq Event 04H , Umask 01H +The number of load ops retired that miss in L1 +Data cache. Note that prefetch misses will not be counted. +.It Li MEM_UOPS_RETIRED.L2_HIT_LOADS +.Pq Event 04H , Umask 02H +The number of load micro-ops retired that hit L2. +.It Li MEM_UOPS_RETIRED.L2_MISS_LOADS +.Pq Event 04H , Umask 04H +The number of load micro-ops retired that missed L2. +.It Li MEM_UOPS_RETIRED.DTLB_MISS_LOADS +.Pq Event 04H , Umask 08H +The number of load ops retired that had DTLB miss. +.It Li MEM_UOPS_RETIRED.UTLB_MISS +.Pq Event 04H , Umask 10H +The number of load ops retired that had UTLB miss. +.It Li MEM_UOPS_RETIRED.HITM +.Pq Event 04H , Umask 20H +The number of load ops retired that got data +from the other core or from the other module. +.It Li MEM_UOPS_RETIRED.ALL_LOADS +.Pq Event 04H , Umask 40H +The number of load ops retired. +.It Li MEM_UOP_RETIRED.ALL_STORES +.Pq Event 04H , Umask 80H +The number of store ops retired. +.It Li PAGE_WALKS.D_SIDE_CYCLES +.Pq Event 05H , Umask 01H +Every cycle when a D-side (walks due to a load) page walk +is in progress. Page walk duration divided by +number of page walks is the average duration of page-walks. +Edge trigger bit must be cleared. Set Edge to count the number +of page walks. +.It Li PAGE_WALKS.I_SIDE_CYCLES +.Pq Event 05H , Umask 02H +Every cycle when a I-side (walks due to an instruction fetch) +page walk is in progress. Page walk duration divided by number +of page walks is the average duration of page-walks. +.It Li PAGE_WALKS.WALKS +.Pq Event 05H , Umask 03H +The number of times a data (D) page walk or an instruction (I) +page walk is completed or started. Since a page walk implies a +TLB miss, the number of TLB misses can be counted by counting +the number of pagewalks. +.It Li LONGEST_LAT_CACHE.MISS +.Pq Event 2EH , Umask 41H +the total number of L2 cache references and +The number of L2 cache misses respectively. +L3 is not supported in Silvermont microarchitecture. +.It Li LONGEST_LAT_CACHE.REFERENCE +.Pq Event 2EH , Umask 4FH +The number of requests originating from the core that +references a cache line in the L2 cache. +L3 is not supported in Silvermont microarchitecture. +.It Li L2_REJECT_XQ.ALL +.Pq Event 30H , Umask 00H +The number of demand and prefetch +transactions that the L2 XQ rejects due to a full or near full +condition which likely indicates back pressure from the IDI link. +The XQ may reject transactions from the L2Q (non-cacheable +requests), BBS (L2 misses) and WOB (L2 write-back victims) +.It Li CORE_REJECT_L2Q.ALL +.Pq Event 31H , Umask 00H +The number of demand and L1 prefetcher +requests rejected by the L2Q due to a full or nearly full +condition which likely indicates back pressure from L2Q. +It also counts requests that would have gone directly to +the XQ, but are rejected due to a full or nearly full condition, +indicating back pressure from the IDI link. The L2Q may also +reject transactions from a core to insure fairness between +cores, or to delay a core's dirty eviction when the address +conflicts incoming external snoops. (Note that L2 prefetcher +requests that are dropped are not counted by this event.). +.It Li CPU_CLK_UNHALTED.CORE_P +.Pq Event 3CH , Umask 00H +The number of core cycles while the core is not in a halt +state. The core enters the halt state when it is running +the HLT instruction. In mobile systems the core frequency +may change from time to time. For this reason this event +may have a changing ratio with regards to time. +.It Li CPU_CLK_UNHALTED.REF_P +.Pq Event 3CH , Umask 01H +The number of reference cycles that the core is not in a halt +state. The core enters the halt state when it is running +the HLT instruction. +In mobile systems the core frequency may change from time. +This event is not affected by core frequency changes but counts +as if the core is running at the maximum frequency all the time. +.It Li ICACHE.HIT +.Pq Event 80H , Umask 01H +The number of instruction fetches from the instruction cache. +.It Li ICACHE.MISSES +.Pq Event 80H , Umask 02H +The number of instruction fetches that miss the +Instruction cache or produce memory requests. This includes +uncacheable fetches. An instruction fetch miss is counted only +once and not once for every cycle it is outstanding. +.It Li ICACHE.ACCESSES +.Pq Event 80H , Umask 03H +The number of instruction fetches, including uncacheable fetches. +.It Li NIP_STALL.ICACHE_MISS +.Pq Event B6H , Umask 04H +The number of cycles the NIP stalls because of an icache miss. +This is a cumulative count of cycles the NIP stalled for all +icache misses. +.It Li OFFCORE_RESPONSE_0 +.Pq Event B7H , Umask 01H +Requires MSR_OFFCORE_RESP0 to specify request type and response. +.It Li OFFCORE_RESPONSE_1 +.Pq Event B7H , Umask 02H +Requires MSR_OFFCORE_RESP to specify request type and response. +.It Li INST_RETIRED.ANY_P +.Pq Event C0H , Umask 00H +The number of instructions that retire execution. For instructions +that consist of multiple micro-ops, this event counts the +retirement of the last micro-op of the instruction. The counter +continues counting during hardware interrupts, traps, and inside +interrupt handlers. +.It Li UOPS_RETIRED.MS +.Pq Event C2H , Umask 01H +The number of micro-ops retired that were supplied from MSROM. +.It Li UOPS_RETIRED.ALL +.Pq Event C2H , Umask 10H +The number of micro-ops retired. +.It Li MACHINE_CLEARS.SMC +.Pq Event C3H , Umask 01H +The number of times that a program writes to a code section. +Self-modifying code causes a severe penalty in all Intel +architecture processors. +.It Li MACHINE_CLEARS.MEMORY_ORDERING +.Pq Event C3H , Umask 02H +The number of times that pipeline was cleared due to memory +ordering issues. +.It Li MACHINE_CLEARS.FP_ASSIST +.Pq Event C3H , Umask 04H +The number of times that pipeline stalled due to FP operations +needing assists. +.It Li MACHINE_CLEARS.ALL +.Pq Event C3H , Umask 08H +The number of times that pipeline stalled due to due to any causes +(including SMC, MO, FP assist, etc). +.It Li BR_INST_RETIRED.ALL_BRANCHES +.Pq Event C4H , Umask 00H +The number of branch instructions retired. +.It Li BR_INST_RETIRED.JCC +.Pq Event C4H , Umask 7EH +The number of branch instructions retired that were conditional +jumps. +.It Li BR_INST_RETIRED.FAR_BRANCH +.Pq Event C4H , Umask BFH +The number of far branch instructions retired. +.It Li BR_INST_RETIRED.NON_RETURN_IND +.Pq Event C4H , Umask EBH +The number of branch instructions retired that were near indirect +call or near indirect jmp. +.It Li BR_INST_RETIRED.RETURN +.Pq Event C4H , Umask F7H +The number of near RET branch instructions retired. +.It Li BR_INST_RETIRED.CALL +.Pq Event C4H , Umask F9H +The number of near CALL branch instructions retired. +.It Li BR_INST_RETIRED.IND_CALL +.Pq Event C4H , Umask FBH +The number of near indirect CALL branch instructions retired. +.It Li BR_INST_RETIRED.REL_CALL +.Pq Event C4H , Umask FDH +The number of near relative CALL branch instructions retired. +.It Li BR_INST_RETIRED.TAKEN_JCC +.Pq Event C4H , Umask FEH +The number of branch instructions retired that were conditional +jumps and predicted taken. +.It Li BR_MISP_RETIRED.ALL_BRANCHES +.Pq Event C5H , Umask 00H +The number of mispredicted branch instructions retired. +.It Li BR_MISP_RETIRED.JCC +.Pq Event C5H , Umask 7EH +The number of mispredicted branch instructions retired that were +conditional jumps. +.It Li BR_MISP_RETIRED.FAR +.Pq Event C5H , Umask BFH +The number of mispredicted far branch instructions retired. +.It Li BR_MISP_RETIRED.NON_RETURN_IND +.Pq Event C5H , Umask EBH +The number of mispredicted branch instructions retired that were +near indirect call or near indirect jmp. +.It Li BR_MISP_RETIRED.RETURN +.Pq Event C5H , Umask F7H +The number of mispredicted near RET branch instructions retired. +.It Li BR_MISP_RETIRED.CALL +.Pq Event C5H , Umask F9H +The number of mispredicted near CALL branch instructions retired. +.It Li BR_MISP_RETIRED.IND_CALL +.Pq Event C5H , Umask FBH +The number of mispredicted near indirect CALL branch instructions +retired. +.It Li BR_MISP_RETIRED.REL_CALL +.Pq Event C5H , Umask FDH +The number of mispredicted near relative CALL branch instructions +retired. +.It Li BR_MISP_RETIRED.TAKEN_JCC +.Pq Event C5H , Umask FEH +The number of mispredicted branch instructions retired that were +conditional jumps and predicted taken. +.It Li NO_ALLOC_CYCLES.ROB_FULL +.Pq Event CAH , Umask 01H +The number of cycles when no uops are allocated and the ROB is full +(less than 2 entries available). +.It Li NO_ALLOC_CYCLES.RAT_STALL +.Pq Event CAH , Umask 20H +The number of cycles when no uops are allocated and a RATstall is +asserted. +.It Li NO_ALLOC_CYCLES.ALL +.Pq Event CAH , Umask 3FH +The number of cycles when the front-end does not provide any +instructions to be allocated for any reason. +.It Li NO_ALLOC_CYCLES.NOT_DELIVERED +.Pq Event CAH , Umask 50H +The number of cycles when the front-end does not provide any +instructions to be allocated but the back end is not stalled. +.It Li RS_FULL_STALL.MEC +.Pq Event CBH , Umask 01H +The number of cycles the allocation pipe line stalled due to +the RS for the MEC cluster is full. +.It Li RS_FULL_STALL.ALL +.Pq Event CBH , Umask 1FH +The number of cycles that the allocation pipe line stalled due +to any one of the RS is full. +.It Li CYCLES_DIV_BUSY.ANY +.Pq Event CDH , Umask 01H +The number of cycles the divider is busy. +.It Li BACLEARS.ALL +.Pq Event E6H , Umask 01H +The number of baclears for any type of branch. +.It Li BACLEARS.RETURN +.Pq Event E6H , Umask 08H +The number of baclears for return branches. +.It Li BACLEARS.COND +.Pq Event E6H , Umask 10H +The number of baclears for conditional branches. +.It Li MS_DECODED.MS_ENTRY +.Pq Event E7H , Umask 01H) +The number of times the MSROM starts a flow of UOPS. +.El +.Sh SEE ALSO +.Xr pmc 3 , +.Xr pmc.atom 3 , +.Xr pmc.core 3 , +.Xr pmc.core2 3 , +.Xr pmc.iaf 3 , +.Xr pmc.k7 3 , +.Xr pmc.k8 3 , +.Xr pmc.p4 3 , +.Xr pmc.p5 3 , +.Xr pmc.p6 3 , +.Xr pmc.soft 3 , +.Xr pmc.tsc 3 , +.Xr pmc_cpuinfo 3 , +.Xr pmclog 3 , +.Xr hwpmc 4 +.Sh HISTORY +The +.Nm pmc +library first appeared in +.Fx 6.0 . +.Sh AUTHORS +The +.Lb libpmc +library was written by +.An "Joseph Koshy" +.Aq jkoshy@FreeBSD.org . +The support for the Atom Silvermont +microarchitecture was written by +.An "Hiren Panchasara" +.Aq hiren@FreeBSD.org . Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Thu Mar 20 20:39:41 2014 (r263445) +++ head/sys/dev/hwpmc/hwpmc_core.c Thu Mar 20 20:51:08 2014 (r263446) @@ -245,7 +245,8 @@ iaf_allocate_pmc(int cpu, int ri, struct validflags = IAF_MASK; - if (core_cputype != PMC_CPU_INTEL_ATOM) + if (core_cputype != PMC_CPU_INTEL_ATOM && + core_cputype != PMC_CPU_INTEL_ATOM_SILVERMONT) validflags &= ~IAF_ANY; if ((flags & ~validflags) != 0) @@ -434,7 +435,8 @@ iaf_stop_pmc(int cpu, int ri) fc = (IAF_MASK << (ri * 4)); - if (core_cputype != PMC_CPU_INTEL_ATOM) + if (core_cputype != PMC_CPU_INTEL_ATOM && + core_cputype != PMC_CPU_INTEL_ATOM_SILVERMONT) fc &= ~IAF_ANY; iafc->pc_iafctrl &= ~fc; @@ -566,7 +568,8 @@ struct iap_event_descr { #define IAP_F_SBX (1 << 8) /* CPU: Sandy Bridge Xeon */ #define IAP_F_IBX (1 << 9) /* CPU: Ivy Bridge Xeon */ #define IAP_F_HW (1 << 10) /* CPU: Haswell */ -#define IAP_F_FM (1 << 11) /* Fixed mask */ +#define IAP_F_CAS (1 << 11) /* CPU: Atom Silvermont */ +#define IAP_F_FM (1 << 12) /* Fixed mask */ #define IAP_F_ALLCPUSCORE2 \ (IAP_F_CC | IAP_F_CC2 | IAP_F_CC2E | IAP_F_CA) @@ -607,28 +610,38 @@ static struct iap_event_descr iap_events IAPDESCR(03H_00H, 0x03, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(03H_01H, 0x03, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SB | - IAP_F_SBX), + IAP_F_SBX | IAP_F_CAS), IAPDESCR(03H_02H, 0x03, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - IAPDESCR(03H_04H, 0x03, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | + IAP_F_CAS), + IAPDESCR(03H_04H, 0x03, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O | + IAP_F_CAS), IAPDESCR(03H_08H, 0x03, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | - IAP_F_SBX), + IAP_F_SBX | IAP_F_CAS), IAPDESCR(03H_10H, 0x03, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | - IAP_F_SBX), - IAPDESCR(03H_20H, 0x03, 0x20, IAP_F_FM | IAP_F_CA | IAP_F_CC2), - - IAPDESCR(04H_00H, 0x04, 0x00, IAP_F_FM | IAP_F_CC), - IAPDESCR(04H_01H, 0x04, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O), - IAPDESCR(04H_02H, 0x04, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2), + IAP_F_SBX | IAP_F_CAS), + IAPDESCR(03H_20H, 0x03, 0x20, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_CAS), + IAPDESCR(03H_40H, 0x03, 0x40, IAP_F_CAS), + IAPDESCR(03H_80H, 0x03, 0x80, IAP_F_CAS), + + IAPDESCR(04H_00H, 0x04, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CAS), + IAPDESCR(04H_01H, 0x04, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O | + IAP_F_CAS), + IAPDESCR(04H_02H, 0x04, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_CAS), + IAPDESCR(04H_04H, 0x04, 0x04, IAP_F_CAS), IAPDESCR(04H_07H, 0x04, 0x07, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(04H_08H, 0x04, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2), + IAPDESCR(04H_08H, 0x04, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_CAS), + IAPDESCR(04H_10H, 0x04, 0x10, IAP_F_CAS), + IAPDESCR(04H_20H, 0x04, 0x20, IAP_F_CAS), + IAPDESCR(04H_40H, 0x04, 0x40, IAP_F_CAS), + IAPDESCR(04H_80H, 0x04, 0x80, IAP_F_CAS), IAPDESCR(05H_00H, 0x05, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(05H_01H, 0x05, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS), IAPDESCR(05H_02H, 0x05, 0x02, IAP_F_FM | IAP_F_I7O | IAP_F_WM | IAP_F_SB | - IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), - IAPDESCR(05H_03H, 0x05, 0x03, IAP_F_FM | IAP_F_I7O), + IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS), + IAPDESCR(05H_03H, 0x05, 0x03, IAP_F_FM | IAP_F_I7O | IAP_F_CAS), IAPDESCR(06H_00H, 0x06, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2 | IAP_F_CC2E | IAP_F_CA), @@ -864,12 +877,16 @@ static struct iap_event_descr iap_events IAPDESCR(2EH_01H, 0x2E, 0x01, IAP_F_FM | IAP_F_WM), IAPDESCR(2EH_02H, 0x2E, 0x02, IAP_F_FM | IAP_F_WM), IAPDESCR(2EH_41H, 0x2E, 0x41, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | - IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | + IAP_F_CAS), IAPDESCR(2EH_4FH, 0x2E, 0x4F, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | - IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | + IAP_F_CAS), IAPDESCR(30H, 0x30, IAP_M_CORE | IAP_M_MESI | IAP_M_PREFETCH, IAP_F_ALLCPUSCORE2), + IAPDESCR(30H_00H, 0x30, 0x00, IAP_F_CAS), + IAPDESCR(31H_00H, 0x31, 0x00, IAP_F_CAS), IAPDESCR(32H, 0x32, IAP_M_CORE | IAP_M_MESI | IAP_M_PREFETCH, IAP_F_CC), IAPDESCR(32H, 0x32, IAP_M_CORE, IAP_F_CA | IAP_F_CC2), @@ -880,10 +897,10 @@ static struct iap_event_descr iap_events IAPDESCR(3CH_00H, 0x3C, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | - IAP_F_HW), + IAP_F_HW | IAP_F_CAS), IAPDESCR(3CH_01H, 0x3C, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | - IAP_F_HW), + IAP_F_HW | IAP_F_CAS), IAPDESCR(3CH_02H, 0x3C, 0x02, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(3DH_01H, 0x3D, 0x01, IAP_F_FM | IAP_F_I7O), @@ -1100,11 +1117,12 @@ static struct iap_event_descr iap_events IAPDESCR(7FH, 0x7F, IAP_M_CORE, IAP_F_CA | IAP_F_CC2), IAPDESCR(80H_00H, 0x80, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), - IAPDESCR(80H_01H, 0x80, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), + IAPDESCR(80H_01H, 0x80, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_CAS), IAPDESCR(80H_02H, 0x80, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_I7 | - IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | + IAP_F_CAS), IAPDESCR(80H_03H, 0x80, 0x03, IAP_F_FM | IAP_F_CA | IAP_F_I7 | - IAP_F_WM), + IAP_F_WM | IAP_F_CAS), IAPDESCR(80H_04H, 0x80, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(81H_00H, 0x81, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), @@ -1332,9 +1350,11 @@ static struct iap_event_descr iap_events IAPDESCR(B4H_04H, 0xB4, 0x04, IAP_F_FM | IAP_F_WM), IAPDESCR(B6H_01H, 0xB6, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_SBX), + IAPDESCR(B6H_04H, 0xB6, 0x04, IAP_F_CAS), IAPDESCR(B7H_01H, 0xB7, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS), + IAPDESCR(B7H_02H, 0xB7, 0x02, IAP_F_CAS), IAPDESCR(B8H_01H, 0xB8, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(B8H_02H, 0xB8, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -1363,7 +1383,8 @@ static struct iap_event_descr iap_events IAPDESCR(BFH_05H, 0xBF, 0x05, IAP_F_FM | IAP_F_SB | IAP_F_SBX), IAPDESCR(C0H_00H, 0xC0, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | - IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | + IAP_F_CAS), IAPDESCR(C0H_01H, 0xC0, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), @@ -1388,7 +1409,7 @@ static struct iap_event_descr iap_events IAPDESCR(C2H_00H, 0xC2, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(C2H_01H, 0xC2, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_CAS), IAPDESCR(C2H_02H, 0xC2, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), @@ -1397,23 +1418,24 @@ static struct iap_event_descr iap_events IAPDESCR(C2H_07H, 0xC2, 0x07, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(C2H_08H, 0xC2, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(C2H_0FH, 0xC2, 0x0F, IAP_F_FM | IAP_F_CC2), - IAPDESCR(C2H_10H, 0xC2, 0x10, IAP_F_FM | IAP_F_CA), + IAPDESCR(C2H_10H, 0xC2, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CAS), IAPDESCR(C3H_00H, 0xC3, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(C3H_01H, 0xC3, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM), + IAP_F_I7 | IAP_F_WM | IAP_F_CAS), IAPDESCR(C3H_02H, 0xC3, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS), IAPDESCR(C3H_04H, 0xC3, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_CAS), + IAPDESCR(C3H_08H, 0xC3, 0x08, IAP_F_CAS), IAPDESCR(C3H_10H, 0xC3, 0x10, IAP_F_FM | IAP_F_I7O), IAPDESCR(C3H_20H, 0xC3, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(C4H_00H, 0xC4, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_CAS), IAPDESCR(C4H_01H, 0xC4, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), @@ -1433,10 +1455,18 @@ static struct iap_event_descr iap_events IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(C4H_40H, 0xC4, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAPDESCR(C4H_7EH, 0xC4, 0x7E, IAP_F_CAS), + IAPDESCR(C4H_BFH, 0xC4, 0xBF, IAP_F_CAS), + IAPDESCR(C4H_EBH, 0xC4, 0xEB, IAP_F_CAS), + IAPDESCR(C4H_F7H, 0xC4, 0xF7, IAP_F_CAS), + IAPDESCR(C4H_F9H, 0xC4, 0xF9, IAP_F_CAS), + IAPDESCR(C4H_FBH, 0xC4, 0xFB, IAP_F_CAS), + IAPDESCR(C4H_FDH, 0xC4, 0xFD, IAP_F_CAS), + IAPDESCR(C4H_FEH, 0xC4, 0xFE, IAP_F_CAS), IAPDESCR(C5H_00H, 0xC5, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | - IAP_F_IBX | IAP_F_HW), + IAP_F_IBX | IAP_F_HW | IAP_F_CAS), IAPDESCR(C5H_01H, 0xC5, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(C5H_02H, 0xC5, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | @@ -1447,6 +1477,14 @@ static struct iap_event_descr iap_events IAP_F_SBX | IAP_F_IBX), IAPDESCR(C5H_20H, 0xC5, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), + IAPDESCR(C5H_7EH, 0xC5, 0x7E, IAP_F_CAS), + IAPDESCR(C5H_BFH, 0xC5, 0xBF, IAP_F_CAS), + IAPDESCR(C5H_EBH, 0xC5, 0xEB, IAP_F_CAS), + IAPDESCR(C5H_F7H, 0xC5, 0xF7, IAP_F_CAS), + IAPDESCR(C5H_F9H, 0xC5, 0xF9, IAP_F_CAS), + IAPDESCR(C5H_FBH, 0xC5, 0xFB, IAP_F_CAS), + IAPDESCR(C5H_FDH, 0xC5, 0xFD, IAP_F_CAS), + IAPDESCR(C5H_FEH, 0xC5, 0xFE, IAP_F_CAS), IAPDESCR(C6H_00H, 0xC6, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(C6H_01H, 0xC6, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2), @@ -1471,7 +1509,7 @@ static struct iap_event_descr iap_events IAPDESCR(C9H_00H, 0xC9, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(CAH_00H, 0xCA, 0x00, IAP_F_FM | IAP_F_CC), - IAPDESCR(CAH_01H, 0xCA, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2), + IAPDESCR(CAH_01H, 0xCA, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_CAS), IAPDESCR(CAH_02H, 0xCA, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(CAH_04H, 0xCA, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | @@ -1482,9 +1520,12 @@ static struct iap_event_descr iap_events IAP_F_SBX | IAP_F_IBX | IAP_F_HW), IAPDESCR(CAH_1EH, 0xCA, 0x1E, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAPDESCR(CAH_20H, 0xCA, 0x20, IAP_F_CAS), + IAPDESCR(CAH_3FH, 0xCA, 0x3F, IAP_F_CAS), + IAPDESCR(CAH_50H, 0xCA, 0x50, IAP_F_CAS), IAPDESCR(CBH_01H, 0xCB, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | - IAP_F_I7 | IAP_F_WM), + IAP_F_I7 | IAP_F_WM | IAP_F_CAS), IAPDESCR(CBH_02H, 0xCB, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM), IAPDESCR(CBH_04H, 0xCB, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | @@ -1493,6 +1534,7 @@ static struct iap_event_descr iap_events IAP_F_I7 | IAP_F_WM), IAPDESCR(CBH_10H, 0xCB, 0x10, IAP_F_FM | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM), + IAPDESCR(CBH_1FH, 0xCB, 0x1F, IAP_F_CAS), IAPDESCR(CBH_40H, 0xCB, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(CBH_80H, 0xCB, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -1507,7 +1549,7 @@ static struct iap_event_descr iap_events IAPDESCR(CDH_00H, 0xCD, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(CDH_01H, 0xCD, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | - IAP_F_SBX | IAP_F_IBX | IAP_F_HW), + IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS), IAPDESCR(CDH_02H, 0xCD, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), @@ -1622,10 +1664,14 @@ static struct iap_event_descr iap_events IAPDESCR(E6H_00H, 0xE6, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2), IAPDESCR(E6H_01H, 0xE6, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_I7 | - IAP_F_WM | IAP_F_SBX), + IAP_F_WM | IAP_F_SBX | IAP_F_CAS), IAPDESCR(E6H_02H, 0xE6, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), + IAPDESCR(E6H_08H, 0xE6, 0x08, IAP_F_CAS), + IAPDESCR(E6H_10H, 0xE6, 0x10, IAP_F_CAS), IAPDESCR(E6H_1FH, 0xE6, 0x1F, IAP_F_FM | IAP_F_IBX | IAP_F_HW), + IAPDESCR(E7H_01H, 0xE7, 0x01, IAP_F_CAS), + IAPDESCR(E8H_01H, 0xE8, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(E8H_02H, 0xE8, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(E8H_03H, 0xE8, 0x03, IAP_F_FM | IAP_F_I7O), @@ -2005,6 +2051,9 @@ iap_allocate_pmc(int cpu, int ri, struct case PMC_CPU_INTEL_ATOM: cpuflag = IAP_F_CA; break; + case PMC_CPU_INTEL_ATOM_SILVERMONT: + cpuflag = IAP_F_CAS; + break; case PMC_CPU_INTEL_CORE: cpuflag = IAP_F_CC; break; @@ -2119,6 +2168,7 @@ iap_allocate_pmc(int cpu, int ri, struct * Only Atom and SandyBridge CPUs support the 'ANY' qualifier. */ if (core_cputype == PMC_CPU_INTEL_ATOM || + core_cputype == PMC_CPU_INTEL_ATOM_SILVERMONT || core_cputype == PMC_CPU_INTEL_SANDYBRIDGE || core_cputype == PMC_CPU_INTEL_SANDYBRIDGE_XEON) evsel |= (config & IAP_ANY); Modified: head/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_intel.c Thu Mar 20 20:39:41 2014 (r263445) +++ head/sys/dev/hwpmc/hwpmc_intel.c Thu Mar 20 20:51:08 2014 (r263446) @@ -177,6 +177,10 @@ pmc_intel_initialize(void) cputype = PMC_CPU_INTEL_HASWELL; nclasses = 5; break; + case 0x4D: /* Per Intel document 330061-001 01/2014. */ + cputype = PMC_CPU_INTEL_ATOM_SILVERMONT; + nclasses = 3; + break; } break; #if defined(__i386__) || defined(__amd64__) @@ -209,6 +213,7 @@ pmc_intel_initialize(void) * Intel Core, Core 2 and Atom processors. */ case PMC_CPU_INTEL_ATOM: + case PMC_CPU_INTEL_ATOM_SILVERMONT: case PMC_CPU_INTEL_CORE: case PMC_CPU_INTEL_CORE2: case PMC_CPU_INTEL_CORE2EXTREME: @@ -297,6 +302,7 @@ pmc_intel_finalize(struct pmc_mdep *md) switch (md->pmd_cputype) { #if defined(__i386__) || defined(__amd64__) case PMC_CPU_INTEL_ATOM: + case PMC_CPU_INTEL_ATOM_SILVERMONT: case PMC_CPU_INTEL_CORE: case PMC_CPU_INTEL_CORE2: case PMC_CPU_INTEL_CORE2EXTREME: Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Thu Mar 20 20:39:41 2014 (r263445) +++ head/sys/dev/hwpmc/pmc_events.h Thu Mar 20 20:51:08 2014 (r263446) @@ -484,11 +484,18 @@ __PMC_EV(IAP, EVENT_03H_04H) \ __PMC_EV(IAP, EVENT_03H_08H) \ __PMC_EV(IAP, EVENT_03H_10H) \ __PMC_EV(IAP, EVENT_03H_20H) \ +__PMC_EV(IAP, EVENT_03H_40H) \ +__PMC_EV(IAP, EVENT_03H_80H) \ __PMC_EV(IAP, EVENT_04H_00H) \ __PMC_EV(IAP, EVENT_04H_01H) \ __PMC_EV(IAP, EVENT_04H_02H) \ +__PMC_EV(IAP, EVENT_04H_04H) \ __PMC_EV(IAP, EVENT_04H_07H) \ __PMC_EV(IAP, EVENT_04H_08H) \ +__PMC_EV(IAP, EVENT_04H_10H) \ +__PMC_EV(IAP, EVENT_04H_20H) \ +__PMC_EV(IAP, EVENT_04H_40H) \ +__PMC_EV(IAP, EVENT_04H_80H) \ __PMC_EV(IAP, EVENT_05H_00H) \ __PMC_EV(IAP, EVENT_05H_01H) \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 21:19:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6891B348; Thu, 20 Mar 2014 21:19:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3CB5B3F7; Thu, 20 Mar 2014 21:19:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KLJE3j029162; Thu, 20 Mar 2014 21:19:14 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KLJEsK029161; Thu, 20 Mar 2014 21:19:14 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201403202119.s2KLJEsK029161@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 20 Mar 2014 21:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263449 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 21:19:14 -0000 Author: pfg Date: Thu Mar 20 21:19:13 2014 New Revision: 263449 URL: http://svnweb.freebsd.org/changeset/base/263449 Log: ext2fs: minor update to the dirpref policy. Bring in a minor change to the dirpref policy based on r248623. This is pretty minimal change to keep the implementation in sync with UFS but other parts from the original change are not directly applicable so don't expect improvements in fsck times. MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_alloc.c Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Thu Mar 20 21:12:23 2014 (r263448) +++ head/sys/fs/ext2fs/ext2_alloc.c Thu Mar 20 21:19:13 2014 (r263449) @@ -510,6 +510,22 @@ ext2_dirpref(struct inode *pip) * Limit number of dirs in one cg and reserve space for * regular files, but only if we have no deficit in * inodes or space. + * + * We are trying to find a suitable cylinder group nearby + * our preferred cylinder group to place a new directory. + * We scan from our preferred cylinder group forward looking + * for a cylinder group that meets our criterion. If we get + * to the final cylinder group and do not find anything, + * we start scanning backwards from our preferred cylinder + * group. The ideal would be to alternate looking forward + * and backward, but that is just too complex to code for + * the gain it would get. The most likely place where the + * backward scan would take effect is when we start near + * the end of the filesystem and do not find anything from + * where we are to the end. In that case, scanning backward + * will likely find us a suitable cylinder group much closer + * to our desired location than if we were to start scanning + * forward from the beginning of the filesystem. */ prefcg = ino_to_cg(fs, pip->i_number); for (cg = prefcg; cg < fs->e2fs_gcount; cg++) @@ -519,7 +535,7 @@ ext2_dirpref(struct inode *pip) if (fs->e2fs_contigdirs[cg] < maxcontigdirs) return (cg); } - for (cg = 0; cg < prefcg; cg++) + for (cg = prefcg - 1; cg >= 0; cg--) if (fs->e2fs_gd[cg].ext2bgd_ndirs < maxndir && fs->e2fs_gd[cg].ext2bgd_nifree >= minifree && fs->e2fs_gd[cg].ext2bgd_nbfree >= minbfree) { @@ -532,7 +548,7 @@ ext2_dirpref(struct inode *pip) for (cg = prefcg; cg < fs->e2fs_gcount; cg++) if (fs->e2fs_gd[cg].ext2bgd_nifree >= avgifree) return (cg); - for (cg = 0; cg < prefcg; cg++) + for (cg = prefcg - 1; cg >= 0; cg--) if (fs->e2fs_gd[cg].ext2bgd_nifree >= avgifree) break; return (cg); From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 21:57:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B58803A0; Thu, 20 Mar 2014 21:57:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A1DEAA5B; Thu, 20 Mar 2014 21:57:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KLvA7X044967; Thu, 20 Mar 2014 21:57:10 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KLvARa044966; Thu, 20 Mar 2014 21:57:10 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201403202157.s2KLvARa044966@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 20 Mar 2014 21:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263451 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 21:57:10 -0000 Author: np Date: Thu Mar 20 21:57:10 2014 New Revision: 263451 URL: http://svnweb.freebsd.org/changeset/base/263451 Log: cxgbe(4): man page updates. Modified: head/share/man/man4/cxgbe.4 Modified: head/share/man/man4/cxgbe.4 ============================================================================== --- head/share/man/man4/cxgbe.4 Thu Mar 20 21:49:24 2014 (r263450) +++ head/share/man/man4/cxgbe.4 Thu Mar 20 21:57:10 2014 (r263451) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011-2013, Chelsio Inc +.\" Copyright (c) 2011-2014, Chelsio Inc .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 18, 2013 +.Dd March 20, 2014 .Dt CXGBE 4 .Os .Sh NAME @@ -140,11 +140,11 @@ prompt before booting the kernel or stor .Xr loader.conf 5 . .Bl -tag -width indent .It Va hw.cxgbe.ntxq10g -The number of tx queues to use for a 10Gb port. +The number of tx queues to use for a 10Gb or 40Gb port. The default is 16 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nrxq10g -The number of rx queues to use for a 10Gb port. +The number of rx queues to use for a 10Gb or 40Gb port. The default is 8 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.ntxq1g @@ -156,11 +156,11 @@ The number of rx queues to use for a 1Gb The default is 2 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldtxq10g -The number of TOE tx queues to use for a 10Gb port. +The number of TOE tx queues to use for a 10Gb or 40Gb port. The default is 8 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldrxq10g -The number of TOE rx queues to use for a 10Gb port. +The number of TOE rx queues to use for a 10Gb or 40Gb port. The default is 2 or the number of CPU cores in the system, whichever is less. .It Va hw.cxgbe.nofldtxq1g @@ -176,8 +176,7 @@ The timer index value to use to delay in The holdoff timer list has the values 1, 5, 10, 50, 100, and 200 by default (all values are in microseconds) and the index selects a value from this list. -The default value is 1 for both 10Gb and 1Gb ports, which means the -timer value is 5us. +The default value is 1 which means the timer value is 5us. Different interfaces can be assigned different values at any time via the dev.cxgbe.X.holdoff_tmr_idx or dev.cxl.X.holdoff_tmr_idx sysctl. .It Va hw.cxgbe.holdoff_pktc_idx_10G @@ -185,9 +184,8 @@ dev.cxgbe.X.holdoff_tmr_idx or dev.cxl.X The packet-count index value to use to delay interrupts. The packet-count list has the values 1, 8, 16, and 32 by default and the index selects a value from this list. -The default value is -1 for both 10Gb and 1Gb ports, which means packet -counting is disabled and interrupts are generated based solely on the -holdoff timer value. +The default value is -1 which means packet counting is disabled and interrupts +are generated based solely on the holdoff timer value. Different interfaces can be assigned different values via the dev.cxgbe.X.holdoff_pktc_idx or dev.cxl.X.holdoff_pktc_idx sysctl. This sysctl works only when the interface has never been marked up (as done by @@ -227,6 +225,43 @@ already on the card. long as it is compatible with the driver and is a different version than the one already on the card. The default is 1. +.It Va hw.cxgbe.fl_pktshift +The number of bytes of padding inserted before the begining of an Ethernet +frame in the receive buffer. +The default value of 2 ensures that the Ethernet payload (usually the IP header) +is at a 4 byte aligned address. +0-7 are all valid values. +.It Va hw.cxgbe.fl_pad +A non-zero value ensures that writes from the hardware to a receive buffer are +padded up to the specified boundary. +The default is -1 which lets the driver pick a pad boundary. +0 disables trailer padding completely. +.It Va hw.cxgbe.cong_drop +Controls the hardware response to congestion. +-1 disables congestion feedback and is not recommended. +0 instructs the hardware to backpressure its pipeline on congestion. +This usually results in the port emitting pause frames. +1 instructs the hardware to drop frames destined for congested queues. +.It Va hw.cxgbe.buffer_packing +Allow the hardware to deliver multiple frames in the same receive buffer +opportunistically. +The default is -1 which lets the driver decide. +0 or 1 explicitly disable or enable this feature. +.It Va hw.cxgbe.allow_mbufs_in_cluster +1 allows the driver to lay down one or more mbufs within the receive buffer +opportunistically. This is the default. +0 prohibits the driver from doing so. +.It Va hw.cxgbe.largest_rx_cluster +.It Va hw.cxgbe.safest_rx_cluster +Sizes of rx clusters. Each of these must be set to one of the sizes available +(usually 2048, 4096, 9216, and 16384) and largest_rx_cluster must be greater +than or equal to safest_rx_cluster. +The defaults are 16384 and 4096 respectively. +The driver will never attempt to allocate a receive buffer larger than +largest_rx_cluster and will fall back to allocating buffers of +safest_rx_cluster size if an allocation larger than safest_rx_cluster fails. +Note that largest_rx_cluster merely establishes a ceiling -- the driver is +allowed to allocate buffers of smaller sizes. .It Va hw.cxgbe.config_file Select a pre-packaged device configuration file. A configuration file contains a recipe for partitioning and configuring the @@ -234,7 +269,7 @@ hardware resources on the card. This tunable is for specialized applications only and should not be used in normal operation. The configuration profile currently in use is available in the dev.t4nex.X.cf -and dev.t4nex.X.cfcsum sysctls. +and dev.t4nex.X.cfcsum (dev.t5nex for T5 cards) sysctls. .It Va hw.cxgbe.linkcaps_allowed .It Va hw.cxgbe.niccaps_allowed .It Va hw.cxgbe.toecaps_allowed @@ -248,7 +283,7 @@ capability. This tunable is for specialized applications only and should not be used in normal operation. The capabilities for which hardware resources have been reserved are listed in -dev.t4nex.X.*caps sysctls. +dev.t4nex.X.*caps or dev.t5nex.X.*caps sysctls. .El .Sh SUPPORT For general information and support, From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 22:38:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5B56387; Thu, 20 Mar 2014 22:38:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C22A8E63; Thu, 20 Mar 2014 22:38:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KMcDTh061377; Thu, 20 Mar 2014 22:38:13 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KMcDBJ061376; Thu, 20 Mar 2014 22:38:13 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201403202238.s2KMcDBJ061376@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 20 Mar 2014 22:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263453 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 22:38:13 -0000 Author: jilles Date: Thu Mar 20 22:38:13 2014 New Revision: 263453 URL: http://svnweb.freebsd.org/changeset/base/263453 Log: sh: Don't overwrite old exit status if a PID is reused. Only store exit status for a process if that process has not terminated yet. Test (slow): exit 7 & p1=$!; until exit 8 & p2=$!; [ "$p1" = "$p2" ]; do wait "$p2"; done; sleep 0.1; wait %1; echo $? should write "7". Modified: head/bin/sh/jobs.c Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Thu Mar 20 22:03:37 2014 (r263452) +++ head/bin/sh/jobs.c Thu Mar 20 22:38:13 2014 (r263453) @@ -1121,7 +1121,8 @@ dowait(int mode, struct job *job) for (sp = jp->ps ; sp < jp->ps + jp->nprocs ; sp++) { if (sp->pid == -1) continue; - if (sp->pid == pid) { + if (sp->pid == pid && (sp->status == -1 || + WIFSTOPPED(sp->status))) { TRACE(("Changing status of proc %d from 0x%x to 0x%x\n", (int)pid, sp->status, status)); From owner-svn-src-head@FreeBSD.ORG Thu Mar 20 23:16:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DAE6FB4; Thu, 20 Mar 2014 23:16:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D4543271; Thu, 20 Mar 2014 23:16:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2KNGwh0077321; Thu, 20 Mar 2014 23:16:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2KNGwvT077320; Thu, 20 Mar 2014 23:16:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403202316.s2KNGwvT077320@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Mar 2014 23:16:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263454 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Mar 2014 23:16:59 -0000 Author: adrian Date: Thu Mar 20 23:16:58 2014 New Revision: 263454 URL: http://svnweb.freebsd.org/changeset/base/263454 Log: Throw the flush messages behind ATH_DEBUG_RESET as well. These are needed to diagnose TX hangs that I and hiren are seeing. Without it, the only way we'll see debugging is by having ATH_DEBUG_SW_TX enabled and that is going to be very, very spammy. ATH_DEBUG_RESET is fine; it's only going to be done during stuck beacon situations in AP mode. Whilst I'm here, and now that it's behind debugging, let's just disable the "print only one" conditional. I'll eventually make it more tunable. Tested: * AR9220, hostap mode. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Thu Mar 20 22:38:13 2014 (r263453) +++ head/sys/dev/ath/if_ath_tx.c Thu Mar 20 23:16:58 2014 (r263454) @@ -3719,7 +3719,7 @@ ath_tx_tid_drain_print(struct ath_softc txq = sc->sc_ac2q[tid->ac]; tap = ath_tx_get_tx_tid(an, tid->tid); - DPRINTF(sc, ATH_DEBUG_SW_TX, + DPRINTF(sc, ATH_DEBUG_SW_TX | ATH_DEBUG_RESET, "%s: %s: %6D: bf=%p: addbaw=%d, dobaw=%d, " "seqno=%d, retry=%d\n", __func__, @@ -3731,7 +3731,7 @@ ath_tx_tid_drain_print(struct ath_softc bf->bf_state.bfs_dobaw, SEQNO(bf->bf_state.bfs_seqno), bf->bf_state.bfs_retries); - DPRINTF(sc, ATH_DEBUG_SW_TX, + DPRINTF(sc, ATH_DEBUG_SW_TX | ATH_DEBUG_RESET, "%s: %s: %6D: bf=%p: txq[%d] axq_depth=%d, axq_aggr_depth=%d\n", __func__, pfx, @@ -3741,7 +3741,7 @@ ath_tx_tid_drain_print(struct ath_softc txq->axq_qnum, txq->axq_depth, txq->axq_aggr_depth); - DPRINTF(sc, ATH_DEBUG_SW_TX, + DPRINTF(sc, ATH_DEBUG_SW_TX | ATH_DEBUG_RESET, "%s: %s: %6D: bf=%p: tid txq_depth=%d hwq_depth=%d, bar_wait=%d, " "isfiltered=%d\n", __func__, @@ -3753,7 +3753,7 @@ ath_tx_tid_drain_print(struct ath_softc tid->hwq_depth, tid->bar_wait, tid->isfiltered); - DPRINTF(sc, ATH_DEBUG_SW_TX, + DPRINTF(sc, ATH_DEBUG_SW_TX | ATH_DEBUG_RESET, "%s: %s: %6D: tid %d: " "sched=%d, paused=%d, " "incomp=%d, baw_head=%d, " @@ -3813,7 +3813,7 @@ ath_tx_tid_drain(struct ath_softc *sc, s if (t == 0) { ath_tx_tid_drain_print(sc, an, "norm", tid, bf); - t = 1; +// t = 1; } ATH_TID_REMOVE(tid, bf, bf_list); @@ -3829,7 +3829,7 @@ ath_tx_tid_drain(struct ath_softc *sc, s if (t == 0) { ath_tx_tid_drain_print(sc, an, "filt", tid, bf); - t = 1; +// t = 1; } ATH_TID_FILT_REMOVE(tid, bf, bf_list); From owner-svn-src-head@FreeBSD.ORG Fri Mar 21 00:56:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2E1FCA9; Fri, 21 Mar 2014 00:56:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8FE5EECF; Fri, 21 Mar 2014 00:56:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2L0uumx018099; Fri, 21 Mar 2014 00:56:56 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2L0uuTm018098; Fri, 21 Mar 2014 00:56:56 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201403210056.s2L0uuTm018098@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 21 Mar 2014 00:56:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263457 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 00:56:56 -0000 Author: np Date: Fri Mar 21 00:56:56 2014 New Revision: 263457 URL: http://svnweb.freebsd.org/changeset/base/263457 Log: cxgbe(4): Recognize the "spider" configuration where a T5 card's 40G QSFP port is presented as 4 distinct 10G SFP+ ports to the driver. MFC after: 2 weeks Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Mar 21 00:19:20 2014 (r263456) +++ head/sys/dev/cxgbe/t4_main.c Fri Mar 21 00:56:56 2014 (r263457) @@ -2669,6 +2669,7 @@ build_medialist(struct port_info *pi) ifmedia_set(media, m | IFM_10G_CX4); break; + case FW_PORT_TYPE_QSFP_10G: case FW_PORT_TYPE_SFP: case FW_PORT_TYPE_FIBER_XFI: case FW_PORT_TYPE_FIBER_XAUI: From owner-svn-src-head@FreeBSD.ORG Fri Mar 21 01:30:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D5482F8; Fri, 21 Mar 2014 01:30:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8B1771ED; Fri, 21 Mar 2014 01:30:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2L1UY3B030561; Fri, 21 Mar 2014 01:30:34 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2L1UXH9030560; Fri, 21 Mar 2014 01:30:33 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201403210130.s2L1UXH9030560@svn.freebsd.org> From: Mateusz Guzik Date: Fri, 21 Mar 2014 01:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263458 - head/sys/security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 01:30:34 -0000 Author: mjg Date: Fri Mar 21 01:30:33 2014 New Revision: 263458 URL: http://svnweb.freebsd.org/changeset/base/263458 Log: audit: plug FILEDESC_LOCK leak in audit_canon_path. MFC after: 3 days Modified: head/sys/security/audit/audit_bsm_klib.c Modified: head/sys/security/audit/audit_bsm_klib.c ============================================================================== --- head/sys/security/audit/audit_bsm_klib.c Fri Mar 21 00:56:56 2014 (r263457) +++ head/sys/security/audit/audit_bsm_klib.c Fri Mar 21 01:30:33 2014 (r263458) @@ -497,6 +497,7 @@ audit_canon_path(struct thread *td, int /* XXX: fgetvp() that vhold()s vnode instead of vref()ing it would be better */ error = fgetvp(td, dirfd, NULL, &cvnp); if (error) { + FILEDESC_SUNLOCK(fdp); cpath[0] = '\0'; if (rvnp != NULL) vdrop(rvnp); From owner-svn-src-head@FreeBSD.ORG Fri Mar 21 01:32:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43E7546F; Fri, 21 Mar 2014 01:32:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2E6F226B; Fri, 21 Mar 2014 01:32:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2L1WQRB033638; Fri, 21 Mar 2014 01:32:26 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2L1WPcJ033635; Fri, 21 Mar 2014 01:32:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403210132.s2L1WPcJ033635@svn.freebsd.org> From: Xin LI Date: Fri, 21 Mar 2014 01:32:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263459 - in head/cddl/contrib/opensolaris/cmd: zdb zfs zpool X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 01:32:26 -0000 Author: delphij Date: Fri Mar 21 01:32:25 2014 New Revision: 263459 URL: http://svnweb.freebsd.org/changeset/base/263459 Log: MFV 263436-263438: 3947 zpool(1M) references nonexistent zfs-features(5) 4540 zpool(1M) man page doesn't describe "readonly" property 3948 zfs sync=default is not accepted 4611 zfs(1M) still mentions 'send -r' in synopsis 4415 zpool(1M) man page missing "import -m" description 4570 Document dedupditto pool property 4572 Dedup-related documentation additions for zpool and zdb. 1371 Add -D option description to zpool(1M) manpage 4571 Add documentation for -T and interval to "zpool list" MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/ (props changed) head/cddl/contrib/opensolaris/cmd/zfs/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Fri Mar 21 01:30:33 2014 (r263458) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Fri Mar 21 01:32:25 2014 (r263459) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 31, 2013 +.Dd March 20, 2014 .Dt ZDB 8 .Os .Sh NAME @@ -127,6 +127,12 @@ compression ratio (compress), inflation If specified twice, display a histogram of deduplication statistics, showing the allocated (physically present on disk) and referenced (logically referenced in the pool) block counts and sizes by reference count. +.Pp +If specified a third time, display the statistics independently for each deduplication table. +.Pp +If specified a fourth time, dump the contents of the deduplication tables describing duplicate blocks. +.Pp +If specified a fifth time, also dump the contents of the deduplication tables describing unique blocks. .It Fl h Display pool history similar to .Cm zpool history , Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Mar 21 01:30:33 2014 (r263458) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Mar 21 01:32:25 2014 (r263459) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 2, 2014 +.Dd March 20, 2014 .Dt ZFS 8 .Os .Sh NAME @@ -1335,10 +1335,21 @@ features being supported, the new file s these properties. .Bl -tag -width 4n .It Sy casesensitivity Ns = Ns Cm sensitive | insensitive | mixed +Indicates whether the file name matching algorithm used by the file system +should be case-sensitive, case-insensitive, or allow a combination of both +styles of matching. The default value for the +.Sy casesensitivity +property is +.Cm sensitive . +Traditionally, UNIX and POSIX file systems have case-sensitive file names. +.Pp The +.Cm mixed +value for the .Sy casesensitivity -property is currently not supported on -.Fx . +property indicates that the +file system can support requests for both case-sensitive and case-insensitive +matching behavior. .It Sy normalization Ns = Ns Cm none | formC | formD | formKC | formKD Indicates whether the file system should perform a .Sy unicode Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Mar 21 01:30:33 2014 (r263458) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Mar 21 01:32:25 2014 (r263459) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 31, 2013 +.Dd March 20, 2014 .Dt ZPOOL 8 .Os .Sh NAME @@ -624,6 +624,9 @@ Datasets of this pool can only be mounte .It To write to a read-only pool, a export and import of the pool is required. .El +.Pp +This property can also be referred to by its shortened column name, +.Sy rdonly . .El .Pp The following properties can be set at creation time and import time, and later @@ -682,7 +685,9 @@ property. Threshold for the number of block ditto copies. If the reference count for a deduplicated block increases above this number, a new ditto copy of this block is automatically stored. Default setting is -.Cm 0 . +.Cm 0 +which causes no ditto copies to be created for deduplicated blocks. +The miniumum legal nonzero setting is 100. .It Sy delegation Ns = Ns Cm on No | Cm off Controls whether a non-privileged user is granted access based on the dataset permissions defined on the dataset. See @@ -1152,9 +1157,10 @@ option is also required. .It Fl f Forces import, even if the pool appears to be potentially active. .It Fl m -Enables import with missing log devices. +Allows a pool to import when there is a missing log device. Recent transactions +can be lost because the log device will be discarded. .It Fl N -Do not mount any filesystems from the imported pool. +Import the pool without mounting any file systems. .It Fl R Ar root Sets the .Qq Sy cachefile @@ -1245,9 +1251,10 @@ option is also required. .It Fl f Forces import, even if the pool appears to be potentially active. .It Fl m -Enables import with missing log devices. +Allows a pool to import when there is a missing log device. Recent transactions +can be lost because the log device will be discarded. .It Fl N -Do not mount any filesystems from the imported pool. +Import the pool without mounting any file systems. .It Fl R Ar root Equivalent to .Qq Fl o Cm cachefile=none,altroot= Ns Pa root @@ -1336,8 +1343,9 @@ Treat exported or foreign devices as ina .Op Ar inverval Op Ar count .Xc .Pp -Lists the given pools along with a health status and space usage. When given no -arguments, all pools in the system are listed. +Lists the given pools along with a health status and space usage. If no +.Ar pools +are specified, all pools in the system are listed. .Pp When given an interval, the output is printed every .Ar interval @@ -1349,6 +1357,17 @@ is specified, the command exits after .Ar count reports are printed. .Bl -tag -width indent +.It Fl T Cm d Ns | Ns Cm u +Print a timestamp. +.Pp +Use modifier +.Cm d +for standard date format. See +.Xr date 1 . +Use modifier +.Cm u +for unixtime +.Pq equals Qq Ic date +%s . .It Fl H Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space. @@ -1677,7 +1696,7 @@ Once this is done, the pool will no long not support feature flags. See .Xr zpool-features 7 -for details on compatability with system sthat support feature flags, but do +for details on compatibility with systems that support feature flags, but do not support all features enabled on the pool. .Bl -tag -width indent .It Fl a From owner-svn-src-head@FreeBSD.ORG Fri Mar 21 01:34:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FFDE5D3; Fri, 21 Mar 2014 01:34:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4DA39279; Fri, 21 Mar 2014 01:34:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2L1YKow033915; Fri, 21 Mar 2014 01:34:20 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2L1YKWT033914; Fri, 21 Mar 2014 01:34:20 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201403210134.s2L1YKWT033914@svn.freebsd.org> From: Mateusz Guzik Date: Fri, 21 Mar 2014 01:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263460 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 01:34:20 -0000 Author: mjg Date: Fri Mar 21 01:34:19 2014 New Revision: 263460 URL: http://svnweb.freebsd.org/changeset/base/263460 Log: Take filedesc lock only for reading when allocating new fdtable. Code populating the table does this already. MFC after: 1 week Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Mar 21 01:32:25 2014 (r263459) +++ head/sys/kern/kern_descrip.c Fri Mar 21 01:34:19 2014 (r263460) @@ -1808,7 +1808,7 @@ fdinit(struct filedesc *fdp) newfdp = malloc(sizeof *newfdp, M_FILEDESC, M_WAITOK | M_ZERO); FILEDESC_LOCK_INIT(&newfdp->fd_fd); if (fdp != NULL) { - FILEDESC_XLOCK(fdp); + FILEDESC_SLOCK(fdp); newfdp->fd_fd.fd_cdir = fdp->fd_cdir; if (newfdp->fd_fd.fd_cdir) VREF(newfdp->fd_fd.fd_cdir); @@ -1818,7 +1818,7 @@ fdinit(struct filedesc *fdp) newfdp->fd_fd.fd_jdir = fdp->fd_jdir; if (newfdp->fd_fd.fd_jdir) VREF(newfdp->fd_fd.fd_jdir); - FILEDESC_XUNLOCK(fdp); + FILEDESC_SUNLOCK(fdp); } /* Create the file descriptor table. */ From owner-svn-src-head@FreeBSD.ORG Fri Mar 21 04:33:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCF30122; Fri, 21 Mar 2014 04:33:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8FCE82C9; Fri, 21 Mar 2014 04:33:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2L4XcBE006941; Fri, 21 Mar 2014 04:33:38 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2L4XcHn006940; Fri, 21 Mar 2014 04:33:38 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201403210433.s2L4XcHn006940@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 21 Mar 2014 04:33:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263463 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 04:33:38 -0000 Author: pfg Date: Fri Mar 21 04:33:38 2014 New Revision: 263463 URL: http://svnweb.freebsd.org/changeset/base/263463 Log: Revert r263449; ext2fs: minor update to the dirpref policy. The change in UFS r254996, reverted the change as the older code seems to work better. This was not visible in local testing but we can trust UFS is vastly more exercised in diferent environments. Modified: head/sys/fs/ext2fs/ext2_alloc.c Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Fri Mar 21 04:14:26 2014 (r263462) +++ head/sys/fs/ext2fs/ext2_alloc.c Fri Mar 21 04:33:38 2014 (r263463) @@ -510,22 +510,6 @@ ext2_dirpref(struct inode *pip) * Limit number of dirs in one cg and reserve space for * regular files, but only if we have no deficit in * inodes or space. - * - * We are trying to find a suitable cylinder group nearby - * our preferred cylinder group to place a new directory. - * We scan from our preferred cylinder group forward looking - * for a cylinder group that meets our criterion. If we get - * to the final cylinder group and do not find anything, - * we start scanning backwards from our preferred cylinder - * group. The ideal would be to alternate looking forward - * and backward, but that is just too complex to code for - * the gain it would get. The most likely place where the - * backward scan would take effect is when we start near - * the end of the filesystem and do not find anything from - * where we are to the end. In that case, scanning backward - * will likely find us a suitable cylinder group much closer - * to our desired location than if we were to start scanning - * forward from the beginning of the filesystem. */ prefcg = ino_to_cg(fs, pip->i_number); for (cg = prefcg; cg < fs->e2fs_gcount; cg++) @@ -535,7 +519,7 @@ ext2_dirpref(struct inode *pip) if (fs->e2fs_contigdirs[cg] < maxcontigdirs) return (cg); } - for (cg = prefcg - 1; cg >= 0; cg--) + for (cg = 0; cg < prefcg; cg++) if (fs->e2fs_gd[cg].ext2bgd_ndirs < maxndir && fs->e2fs_gd[cg].ext2bgd_nifree >= minifree && fs->e2fs_gd[cg].ext2bgd_nbfree >= minbfree) { @@ -548,7 +532,7 @@ ext2_dirpref(struct inode *pip) for (cg = prefcg; cg < fs->e2fs_gcount; cg++) if (fs->e2fs_gd[cg].ext2bgd_nifree >= avgifree) return (cg); - for (cg = prefcg - 1; cg >= 0; cg--) + for (cg = 0; cg < prefcg; cg++) if (fs->e2fs_gd[cg].ext2bgd_nifree >= avgifree) break; return (cg); From owner-svn-src-head@FreeBSD.ORG Fri Mar 21 04:45:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0021F4FB; Fri, 21 Mar 2014 04:45:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E05323C7; Fri, 21 Mar 2014 04:45:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2L4jv6T011308; Fri, 21 Mar 2014 04:45:57 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2L4jvEP011307; Fri, 21 Mar 2014 04:45:57 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201403210445.s2L4jvEP011307@svn.freebsd.org> From: Justin Hibbits Date: Fri, 21 Mar 2014 04:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263464 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 04:45:58 -0000 Author: jhibbits Date: Fri Mar 21 04:45:57 2014 New Revision: 263464 URL: http://svnweb.freebsd.org/changeset/base/263464 Log: Mask out SRR1 bits that aren't exported to the MSR. This appears to fix a strange condition with X on 32-bit PowerBooks I observed, caused by one of these bits getting set in the mcontext, but not set in the thread, which may be a symptom of another problem, more difficult to diagnose. Since these bits aren't exported anyway, this change makes it more explicit that the bits aren't MSR-related in SRR1. MFC after: 3 weeks Modified: head/sys/powerpc/include/psl.h Modified: head/sys/powerpc/include/psl.h ============================================================================== --- head/sys/powerpc/include/psl.h Fri Mar 21 04:33:38 2014 (r263463) +++ head/sys/powerpc/include/psl.h Fri Mar 21 04:45:57 2014 (r263464) @@ -88,15 +88,17 @@ #define PSL_KERNSET (PSL_CE | PSL_ME | PSL_EE) #elif defined(BOOKE_PPC4XX) #define PSL_KERNSET (PSL_CE | PSL_ME | PSL_EE | PSL_FP) +#define PSL_SRR1_MASK 0x00000000UL /* No mask on Book-E */ #elif defined(AIM) #ifdef __powerpc64__ #define PSL_KERNSET (PSL_SF | PSL_EE | PSL_ME | PSL_IR | PSL_DR | PSL_RI) #else #define PSL_KERNSET (PSL_EE | PSL_ME | PSL_IR | PSL_DR | PSL_RI) #endif +#define PSL_SRR1_MASK 0x78300000UL /* Bits 1-4, 10-15 (ppc32), 33-36, 42-47 (ppc64) */ #endif #define PSL_USERSET (PSL_KERNSET | PSL_PR) -#define PSL_USERSTATIC ~(PSL_VEC | PSL_FP | PSL_FE0 | PSL_FE1) +#define PSL_USERSTATIC (~(PSL_VEC | PSL_FP | PSL_FE0 | PSL_FE1) & ~PSL_SRR1_MASK) #endif /* _MACHINE_PSL_H_ */ From owner-svn-src-head@FreeBSD.ORG Fri Mar 21 08:07:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1152D25; Fri, 21 Mar 2014 08:07:43 +0000 (UTC) Received: from mail-wg0-x22f.google.com (mail-wg0-x22f.google.com [IPv6:2a00:1450:400c:c00::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1C52D88F; Fri, 21 Mar 2014 08:07:42 +0000 (UTC) Received: by mail-wg0-f47.google.com with SMTP id x12so1326795wgg.18 for ; Fri, 21 Mar 2014 01:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=NX0abAL6miggLHa6phu/LTQIWVtf+hTHajRbBHVxVPc=; b=jhnBnT124lpakmD/w8oAGoD1ugVqcRIy+Ptj8G/d26xf6OmpZQLzj9IrXxeJazmib0 /TJxm3aAms6Ne+ke3X9D9T7EQEu+P+LX9z4VbTS7wDjKQuEwP+jxtRT2Z7qWa9ItWuCc D75xd8d3MjerNgll6vkpJ936pSboNM6brsoVDXDdrIUI2n1fLbzU8zeVy3rCpTYPmdJa bX0qTx6L9SJqTI8YyvgKttt/pbfEO5vt6EHk2YksuA8BPm9Ydha2n1KkH7yRB6hRlWqz OOYj2aIy7HaXMwa0U+tzhX9qOBX+H+OAIHpokusT/DOHsMw8BvdzBQPV3iOfETpX19oX XC7Q== X-Received: by 10.194.2.70 with SMTP id 6mr37453353wjs.25.1395389261541; Fri, 21 Mar 2014 01:07:41 -0700 (PDT) Received: from [172.16.1.30] (39.Red-2-136-52.dynamicIP.rima-tde.net. [2.136.52.39]) by mx.google.com with ESMTPSA id fs8sm2608884wib.8.2014.03.21.01.07.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Mar 2014 01:07:40 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Message-ID: <532BF348.8090503@FreeBSD.org> Date: Fri, 21 Mar 2014 09:07:36 +0100 From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r263377 - head/sys/xen References: <201403192040.s2JKev1k027839@svn.freebsd.org> In-Reply-To: <201403192040.s2JKev1k027839@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 08:07:44 -0000 On 19/03/14 21:40, Warner Losh wrote: > Author: imp > Date: Wed Mar 19 20:40:57 2014 > New Revision: 263377 > URL: http://svnweb.freebsd.org/changeset/base/263377 > > Log: > Revert last change, it breaks other things. Could you try the following patch instead: >From 3f66e884bef1ba16ee31897016b2ef9158202eb1 Mon Sep 17 00:00:00 2001 From: Roger Pau Monne Date: Thu, 20 Mar 2014 09:40:25 +0100 Subject: [PATCH] xen: fix duplicate declaration of xen_store Sponsored by: Citrix Systems R&D --- sys/i386/xen/xen_machdep.c | 4 +--- sys/x86/xen/pv.c | 1 + sys/xen/xen-os.h | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/i386/xen/xen_machdep.c b/sys/i386/xen/xen_machdep.c index d67406d..46409a5 100644 --- a/sys/i386/xen/xen_machdep.c +++ b/sys/i386/xen/xen_machdep.c @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -710,9 +711,6 @@ char *bootmem_start, *bootmem_current, *bootmem_end; pteinfo_t *pteinfo_list; void initvalues(start_info_t *startinfo); -struct xenstore_domain_interface; -extern struct xenstore_domain_interface *xen_store; - void * bootmem_alloc(unsigned int size) { diff --git a/sys/x86/xen/pv.c b/sys/x86/xen/pv.c index 96420e3..fa36f3a 100644 --- a/sys/x86/xen/pv.c +++ b/sys/x86/xen/pv.c @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include diff --git a/sys/xen/xen-os.h b/sys/xen/xen-os.h index 7dd9c7e..c982d55 100644 --- a/sys/xen/xen-os.h +++ b/sys/xen/xen-os.h @@ -54,7 +54,6 @@ extern shared_info_t *HYPERVISOR_shared_info; extern start_info_t *HYPERVISOR_start_info; /* XXX: we need to get rid of this and use HYPERVISOR_start_info directly */ -extern struct xenstore_domain_interface *xen_store; extern char *console_page; enum xen_domain_type { -- 1.7.7.5 (Apple Git-26) From owner-svn-src-head@FreeBSD.ORG Fri Mar 21 09:29:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A99CE89; Fri, 21 Mar 2014 09:29:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EC745F0D; Fri, 21 Mar 2014 09:29:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2L9T1Ea024895; Fri, 21 Mar 2014 09:29:01 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2L9T1BY024894; Fri, 21 Mar 2014 09:29:01 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201403210929.s2L9T1BY024894@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 21 Mar 2014 09:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263468 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 09:29:02 -0000 Author: ae Date: Fri Mar 21 09:29:01 2014 New Revision: 263468 URL: http://svnweb.freebsd.org/changeset/base/263468 Log: When loader(8) inspects MBR, it chooses GPT as main partition table, when MBR contains only PMBR entry or it is bootcamp-compatible. If MBR has PMBR entry and some other, the loader rejects it. Make these checks to be less strict. If loader decided that PMBR isn't suitable for GPT, it will use MBR. Reported by: Paul Thornton Tested by: Paul Thornton MFC after: 1 week Modified: head/sys/boot/common/part.c Modified: head/sys/boot/common/part.c ============================================================================== --- head/sys/boot/common/part.c Fri Mar 21 05:37:25 2014 (r263467) +++ head/sys/boot/common/part.c Fri Mar 21 09:29:01 2014 (r263468) @@ -634,7 +634,7 @@ ptable_open(void *dev, off_t sectors, ui for (i = 0, count = 0; i < NDOSPART; i++) { if (dp[i].dp_flag != 0 && dp[i].dp_flag != 0x80) { DEBUG("invalid partition flag %x", dp[i].dp_flag); - break; + goto out; } #ifdef LOADER_GPT_SUPPORT if (dp[i].dp_typ == DOSPTYP_PMBR) { @@ -646,15 +646,12 @@ ptable_open(void *dev, off_t sectors, ui count++; } /* Do we have some invalid values? */ - if (i != NDOSPART || - (table->type == PTABLE_GPT && count > 1)) { + if (table->type == PTABLE_GPT && count > 1) { if (dp[1].dp_typ != DOSPTYP_HFS) { table->type = PTABLE_NONE; - DEBUG("invalid values detected, ignore " - "partition table"); - goto out; - } - DEBUG("Bootcamp detected"); + DEBUG("Incorrect PMBR, ignore it"); + } else + DEBUG("Bootcamp detected"); } #ifdef LOADER_GPT_SUPPORT if (table->type == PTABLE_GPT) { From owner-svn-src-head@FreeBSD.ORG Fri Mar 21 09:43:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83F2C319; Fri, 21 Mar 2014 09:43:25 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id 669CD12F; Fri, 21 Mar 2014 09:43:24 +0000 (UTC) Received: from bender.Home (97e07ba1.skybroadband.com [151.224.123.161]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 58C345C682; Fri, 21 Mar 2014 09:43:23 +0000 (UTC) Date: Fri, 21 Mar 2014 09:43:16 +0000 From: Andrew Turner To: Ruslan Bukin Subject: Re: svn commit: r263424 - head/sys/arm/conf Message-ID: <20140321094316.76ccf459@bender.Home> In-Reply-To: <201403201701.s2KH1L84024044@svn.freebsd.org> References: <201403201701.s2KH1L84024044@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 09:43:25 -0000 On Thu, 20 Mar 2014 17:01:21 +0000 (UTC) Ruslan Bukin wrote: > Author: br > Date: Thu Mar 20 17:01:21 2014 > New Revision: 263424 > URL: http://svnweb.freebsd.org/changeset/base/263424 > > Log: > Disable debugging by default. I don't like this on head. I have found a number of issues that were hidden because the kernel config most people were using for development had WITNESS, INVARIANTS and DIAGNOSTIC disabled. Andrew From owner-svn-src-head@FreeBSD.ORG Fri Mar 21 13:55:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D55913AF; Fri, 21 Mar 2014 13:55:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C2680CBB; Fri, 21 Mar 2014 13:55:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2LDtv53032396; Fri, 21 Mar 2014 13:55:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2LDtvBT032395; Fri, 21 Mar 2014 13:55:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403211355.s2LDtvBT032395@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 21 Mar 2014 13:55:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263471 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 13:55:57 -0000 Author: kib Date: Fri Mar 21 13:55:57 2014 New Revision: 263471 URL: http://svnweb.freebsd.org/changeset/base/263471 Log: Initialize vm_map_entry member wiring_thread on the map entry creation. This was missed in r253190. Reported by: hps, peter Tested by: hps Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Fri Mar 21 13:31:56 2014 (r263470) +++ head/sys/vm/vm_map.c Fri Mar 21 13:55:57 2014 (r263471) @@ -1275,6 +1275,7 @@ charged: new_entry->protection = prot; new_entry->max_protection = max; new_entry->wired_count = 0; + new_entry->wiring_thread = NULL; new_entry->read_ahead = VM_FAULT_READ_AHEAD_INIT; new_entry->next_read = OFF_TO_IDX(offset); From owner-svn-src-head@FreeBSD.ORG Fri Mar 21 14:25:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A11D674E; Fri, 21 Mar 2014 14:25:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7E4E486; Fri, 21 Mar 2014 14:25:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2LEPAvx044607; Fri, 21 Mar 2014 14:25:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2LEP98p044601; Fri, 21 Mar 2014 14:25:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403211425.s2LEP98p044601@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 21 Mar 2014 14:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263475 - in head/sys: amd64/amd64 kern sys vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 14:25:10 -0000 Author: kib Date: Fri Mar 21 14:25:09 2014 New Revision: 263475 URL: http://svnweb.freebsd.org/changeset/base/263475 Log: Fix two issues with /dev/mem access on amd64, both causing kernel page faults. First, for accesses to direct map region should check for the limit by which direct map is instantiated. Second, for accesses to the kernel map, success returned from the kernacc(9) does not guarantee that consequent attempt to read or write to the checked address succeed, since other thread might invalidate the address meantime. Add a new thread private flag TDP_DEVMEMIO, which instructs vm_fault() to return error when fault happens on the MAP_ENTRY_NOFAULT entry, instead of panicing. The trap handler would then see a page fault from access, and recover in normal way, making /dev/mem access safer. Remove GIANT_REQUIRED from the amd64 memrw(), since it is not needed and having Giant locked does not solve issues for amd64. Note that at least the second issue exists on other architectures, and requires similar patching for md code. Reported and tested by: clusteradm (gjb, sbruno) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/mem.c head/sys/amd64/amd64/trap.c head/sys/kern/subr_trap.c head/sys/sys/proc.h head/sys/vm/vm_fault.c Modified: head/sys/amd64/amd64/mem.c ============================================================================== --- head/sys/amd64/amd64/mem.c Fri Mar 21 14:19:47 2014 (r263474) +++ head/sys/amd64/amd64/mem.c Fri Mar 21 14:25:09 2014 (r263475) @@ -76,14 +76,16 @@ MALLOC_DEFINE(M_MEMDESC, "memdesc", "mem int memrw(struct cdev *dev, struct uio *uio, int flags) { - int o; - u_long c = 0, v; struct iovec *iov; - int error = 0; + u_long c, v; + int error, o, sflags; vm_offset_t addr, eaddr; GIANT_REQUIRED; + error = 0; + c = 0; + sflags = curthread_pflags_set(TDP_DEVMEMIO); while (uio->uio_resid > 0 && error == 0) { iov = uio->uio_iov; if (iov->iov_len == 0) { @@ -98,7 +100,15 @@ memrw(struct cdev *dev, struct uio *uio, kmemphys: o = v & PAGE_MASK; c = min(uio->uio_resid, (u_int)(PAGE_SIZE - o)); - error = uiomove((void *)PHYS_TO_DMAP(v), (int)c, uio); + v = PHYS_TO_DMAP(v); + if (v < DMAP_MIN_ADDRESS || + (v > DMAP_MIN_ADDRESS + dmaplimit && + v <= DMAP_MAX_ADDRESS) || + pmap_kextract(v) == 0) { + error = EFAULT; + goto ret; + } + error = uiomove((void *)v, (int)c, uio); continue; } else if (dev2unit(dev) == CDEV_MINOR_KMEM) { @@ -119,22 +129,30 @@ kmemphys: addr = trunc_page(v); eaddr = round_page(v + c); - if (addr < VM_MIN_KERNEL_ADDRESS) - return (EFAULT); - for (; addr < eaddr; addr += PAGE_SIZE) - if (pmap_extract(kernel_pmap, addr) == 0) - return (EFAULT); - + if (addr < VM_MIN_KERNEL_ADDRESS) { + error = EFAULT; + goto ret; + } + for (; addr < eaddr; addr += PAGE_SIZE) { + if (pmap_extract(kernel_pmap, addr) == 0) { + error = EFAULT; + goto ret; + } + } if (!kernacc((caddr_t)(long)v, c, uio->uio_rw == UIO_READ ? - VM_PROT_READ : VM_PROT_WRITE)) - return (EFAULT); + VM_PROT_READ : VM_PROT_WRITE)) { + error = EFAULT; + goto ret; + } error = uiomove((caddr_t)(long)v, (int)c, uio); continue; } /* else panic! */ } +ret: + curthread_pflags_restore(sflags); return (error); } Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Fri Mar 21 14:19:47 2014 (r263474) +++ head/sys/amd64/amd64/trap.c Fri Mar 21 14:25:09 2014 (r263475) @@ -789,6 +789,12 @@ nogo: frame->tf_rip = (long)curpcb->pcb_onfault; return (0); } + if ((td->td_pflags & TDP_DEVMEMIO) != 0) { + KASSERT(curpcb->pcb_onfault != NULL, + ("/dev/mem without pcb_onfault")); + frame->tf_rip = (long)curpcb->pcb_onfault; + return (0); + } trap_fatal(frame, eva); return (-1); } Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Fri Mar 21 14:19:47 2014 (r263474) +++ head/sys/kern/subr_trap.c Fri Mar 21 14:25:09 2014 (r263475) @@ -157,6 +157,8 @@ userret(struct thread *td, struct trapfr td->td_rw_rlocks)); KASSERT((td->td_pflags & TDP_NOFAULTING) == 0, ("userret: Returning with pagefaults disabled")); + KASSERT((td->td_pflags & TDP_DEVMEMIO) == 0, + ("userret: Returning with /dev/mem i/o leaked")); KASSERT(td->td_no_sleeping == 0, ("userret: Returning with sleep disabled")); KASSERT(td->td_pinned == 0 || (td->td_pflags & TDP_CALLCHAIN) != 0, Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Fri Mar 21 14:19:47 2014 (r263474) +++ head/sys/sys/proc.h Fri Mar 21 14:25:09 2014 (r263475) @@ -428,6 +428,7 @@ do { \ #define TDP_RESETSPUR 0x04000000 /* Reset spurious page fault history. */ #define TDP_NERRNO 0x08000000 /* Last errno is already in td_errno */ #define TDP_UIOHELD 0x10000000 /* Current uio has pages held in td_ma */ +#define TDP_DEVMEMIO 0x20000000 /* Accessing memory for /dev/mem */ /* * Reasons that the current thread can not be run yet. Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Fri Mar 21 14:19:47 2014 (r263474) +++ head/sys/vm/vm_fault.c Fri Mar 21 14:25:09 2014 (r263475) @@ -269,6 +269,10 @@ RetryFault:; map_generation = fs.map->timestamp; if (fs.entry->eflags & MAP_ENTRY_NOFAULT) { + if ((curthread->td_pflags & TDP_DEVMEMIO) != 0) { + vm_map_unlock_read(fs.map); + return (KERN_FAILURE); + } panic("vm_fault: fault on nofault entry, addr: %lx", (u_long)vaddr); } From owner-svn-src-head@FreeBSD.ORG Fri Mar 21 14:28:02 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8E2C92F; Fri, 21 Mar 2014 14:28:02 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AA339AD; Fri, 21 Mar 2014 14:28:02 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WR0QN-000Ea2-33; Fri, 21 Mar 2014 14:27:55 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s2LERpdA071876; Fri, 21 Mar 2014 08:27:51 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/MrxV0eXxEA5toRmEiJJ4x Subject: Re: svn commit: r263424 - head/sys/arm/conf From: Ian Lepore To: Andrew Turner In-Reply-To: <20140321094316.76ccf459@bender.Home> References: <201403201701.s2KH1L84024044@svn.freebsd.org> <20140321094316.76ccf459@bender.Home> Content-Type: text/plain; charset="us-ascii" Date: Fri, 21 Mar 2014 08:27:50 -0600 Message-ID: <1395412070.81853.8.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Ruslan Bukin , src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 14:28:02 -0000 On Fri, 2014-03-21 at 09:43 +0000, Andrew Turner wrote: > On Thu, 20 Mar 2014 17:01:21 +0000 (UTC) > Ruslan Bukin wrote: > > > Author: br > > Date: Thu Mar 20 17:01:21 2014 > > New Revision: 263424 > > URL: http://svnweb.freebsd.org/changeset/base/263424 > > > > Log: > > Disable debugging by default. > > I don't like this on head. I have found a number of issues that were > hidden because the kernel config most people were using for development > had WITNESS, INVARIANTS and DIAGNOSTIC disabled. > > Andrew > I disagree. Witness is essentially useless anymore, because there are so many known LORs that nobody cares about when you report them that all it does is spews noise. Maybe it's useful when you're looking for a particular problem, but leaving it on all the time has just lost its value. -- Ian From owner-svn-src-head@FreeBSD.ORG Fri Mar 21 15:30:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58F93246; Fri, 21 Mar 2014 15:30:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 45B409B6; Fri, 21 Mar 2014 15:30:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2LFUWik071088; Fri, 21 Mar 2014 15:30:32 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2LFUWZH071087; Fri, 21 Mar 2014 15:30:32 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403211530.s2LFUWZH071087@svn.freebsd.org> From: Bryan Drewery Date: Fri, 21 Mar 2014 15:30:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263479 - head/lib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 15:30:32 -0000 Author: bdrewery Date: Fri Mar 21 15:30:31 2014 New Revision: 263479 URL: http://svnweb.freebsd.org/changeset/base/263479 Log: nv(3) was not in 10.0. It might be MFC'd to stable/10 for 10.1, but for now update the manual to avoid confusion on its availability. Discussed with: pjd Modified: head/lib/libnv/nv.3 Modified: head/lib/libnv/nv.3 ============================================================================== --- head/lib/libnv/nv.3 Fri Mar 21 15:15:30 2014 (r263478) +++ head/lib/libnv/nv.3 Fri Mar 21 15:30:31 2014 (r263479) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 8, 2013 +.Dd March 21, 2014 .Dt NV 3 .Os .Sh NAME @@ -594,7 +594,7 @@ while ((name = nvlist_next(nvl, &type, & The .Nm libnv library appeared in -.Fx 10.0 . +.Fx 11.0 . .Sh AUTHORS .An -nosplit The From owner-svn-src-head@FreeBSD.ORG Fri Mar 21 17:07:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA99BB05; Fri, 21 Mar 2014 17:07:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B77E4681; Fri, 21 Mar 2014 17:07:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2LH7IDl010203; Fri, 21 Mar 2014 17:07:18 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2LH7IBN010202; Fri, 21 Mar 2014 17:07:18 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403211707.s2LH7IBN010202@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 21 Mar 2014 17:07:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263497 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 17:07:18 -0000 Author: glebius Date: Fri Mar 21 17:07:18 2014 New Revision: 263497 URL: http://svnweb.freebsd.org/changeset/base/263497 Log: Fix breakage in ipfw+VIMAGE after r261590. PR: kern/187665 Sponsored by: Nginx, Inc. Modified: head/sys/netpfil/ipfw/ip_fw_pfil.c Modified: head/sys/netpfil/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_pfil.c Fri Mar 21 16:57:34 2014 (r263496) +++ head/sys/netpfil/ipfw/ip_fw_pfil.c Fri Mar 21 17:07:18 2014 (r263497) @@ -536,30 +536,22 @@ ipfw_attach_hooks(int arg) int ipfw_chg_hook(SYSCTL_HANDLER_ARGS) { - int *enable; int newval; int error; int af; - if (arg1 == &VNET_NAME(fw_enable)) { - enable = &V_fw_enable; + if (arg1 == &V_fw_enable) af = AF_INET; - } #ifdef INET6 - else if (arg1 == &VNET_NAME(fw6_enable)) { - enable = &V_fw6_enable; + else if (arg1 == &V_fw6_enable) af = AF_INET6; - } #endif - else if (arg1 == &VNET_NAME(fwlink_enable)) { - enable = &V_fwlink_enable; + else if (arg1 == &V_fwlink_enable) af = AF_LINK; - } else return (EINVAL); - newval = *enable; - + newval = *(int *)arg1; /* Handle sysctl change */ error = sysctl_handle_int(oidp, &newval, 0, req); @@ -569,13 +561,13 @@ ipfw_chg_hook(SYSCTL_HANDLER_ARGS) /* Formalize new value */ newval = (newval) ? 1 : 0; - if (*enable == newval) + if (*(int *)arg1 == newval) return (0); error = ipfw_hook(newval, af); if (error) return (error); - *enable = newval; + *(int *)arg1 = newval; return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Mar 21 17:17:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76B02DBA; Fri, 21 Mar 2014 17:17:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 63C917C3; Fri, 21 Mar 2014 17:17:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2LHHK9c014299; Fri, 21 Mar 2014 17:17:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2LHHK3L014295; Fri, 21 Mar 2014 17:17:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403211717.s2LHHK3L014295@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 21 Mar 2014 17:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263498 - in head/sys/amd64: amd64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 17:17:20 -0000 Author: kib Date: Fri Mar 21 17:17:19 2014 New Revision: 263498 URL: http://svnweb.freebsd.org/changeset/base/263498 Log: Add change forgotten in r263475. Make dmaplimit accessible outside amd64/pmap.c. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/include/pmap.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Mar 21 17:07:18 2014 (r263497) +++ head/sys/amd64/amd64/pmap.c Fri Mar 21 17:17:19 2014 (r263498) @@ -321,7 +321,7 @@ SYSCTL_INT(_machdep, OID_AUTO, nkpt, CTL "Number of kernel page table pages allocated on bootup"); static int ndmpdp; -static vm_paddr_t dmaplimit; +vm_paddr_t dmaplimit; vm_offset_t kernel_vm_end = VM_MIN_KERNEL_ADDRESS; pt_entry_t pg_nx; Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Fri Mar 21 17:07:18 2014 (r263497) +++ head/sys/amd64/include/pmap.h Fri Mar 21 17:17:19 2014 (r263498) @@ -369,6 +369,7 @@ extern vm_paddr_t phys_avail[]; extern vm_paddr_t dump_avail[]; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; +extern vm_paddr_t dmaplimit; #define pmap_page_get_memattr(m) ((vm_memattr_t)(m)->md.pat_mode) #define pmap_page_is_write_mapped(m) (((m)->aflags & PGA_WRITEABLE) != 0) From owner-svn-src-head@FreeBSD.ORG Fri Mar 21 18:39:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B1C337C; Fri, 21 Mar 2014 18:39:56 +0000 (UTC) Received: from mail-qa0-x22a.google.com (mail-qa0-x22a.google.com [IPv6:2607:f8b0:400d:c00::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 076A16D; Fri, 21 Mar 2014 18:39:55 +0000 (UTC) Received: by mail-qa0-f42.google.com with SMTP id k15so2884798qaq.29 for ; Fri, 21 Mar 2014 11:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=36b0eKFTN6WUOwcgdZ5CFHtSRhL1t3cKxrB7tK9m+tw=; b=IQOAkRY5cRuROT+K2xXr14vAD0jo6hWbEqD/fjiazWxhl97RLXmtrJletBhZg259AH CfN4c18ZBiEF/PDYyQWIk8eE6A/C1KtNGaQqrXzqxPGLJeUuNJ2KvoqDDTXUchNRXWEw NJxMyImhQdtZ8KLwLzNsSp8VxS4RNmGkwmaOH/KPvaeIhNr0cap9cjG+lhH0UiHToK2R X8LAce33P3SDQ2qU0lgusKLiF6HszCxLeWFAh9j63wYAOmX99iEcZRqDwXQeG4EESc4x 24Zfq1IQKGqB/JtzP94bT07Sbi4OEn3deEseL7MJet04vO1jEBzFu/AnVNmj/lqqnTfx XJ0A== MIME-Version: 1.0 X-Received: by 10.224.29.4 with SMTP id o4mr38065533qac.55.1395427195244; Fri, 21 Mar 2014 11:39:55 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.8.137 with HTTP; Fri, 21 Mar 2014 11:39:55 -0700 (PDT) In-Reply-To: <1395412070.81853.8.camel@revolution.hippie.lan> References: <201403201701.s2KH1L84024044@svn.freebsd.org> <20140321094316.76ccf459@bender.Home> <1395412070.81853.8.camel@revolution.hippie.lan> Date: Fri, 21 Mar 2014 11:39:55 -0700 X-Google-Sender-Auth: pIGb74-EuiI7nNOEYg2_mr_JXo0 Message-ID: Subject: Re: svn commit: r263424 - head/sys/arm/conf From: Adrian Chadd To: Ian Lepore Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Ruslan Bukin , "src-committers@freebsd.org" , Andrew Turner X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 18:39:56 -0000 On 21 March 2014 07:27, Ian Lepore wrote: > On Fri, 2014-03-21 at 09:43 +0000, Andrew Turner wrote: >> On Thu, 20 Mar 2014 17:01:21 +0000 (UTC) >> Ruslan Bukin wrote: >> >> > Author: br >> > Date: Thu Mar 20 17:01:21 2014 >> > New Revision: 263424 >> > URL: http://svnweb.freebsd.org/changeset/base/263424 >> > >> > Log: >> > Disable debugging by default. >> >> I don't like this on head. I have found a number of issues that were >> hidden because the kernel config most people were using for development >> had WITNESS, INVARIANTS and DIAGNOSTIC disabled. >> >> Andrew >> > > I disagree. Witness is essentially useless anymore, because there are > so many known LORs that nobody cares about when you report them that all > it does is spews noise. Maybe it's useful when you're looking for a > particular problem, but leaving it on all the time has just lost its > value. Which LORs? I actively chase down and squish net80211/ath LORs when it's not too difficult (and I know of some rather-difficult ones I'm still trying to solve.) But besides the handful of filesystem LORs that are claimed to be fine, what LORs are you seeing spewed out? -a From owner-svn-src-head@FreeBSD.ORG Fri Mar 21 19:12:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70626D3F; Fri, 21 Mar 2014 19:12:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5DE1E64E; Fri, 21 Mar 2014 19:12:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2LJC6pZ063664; Fri, 21 Mar 2014 19:12:06 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2LJC6Cc063663; Fri, 21 Mar 2014 19:12:06 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201403211912.s2LJC6Cc063663@svn.freebsd.org> From: Mateusz Guzik Date: Fri, 21 Mar 2014 19:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263530 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 19:12:06 -0000 Author: mjg Date: Fri Mar 21 19:12:05 2014 New Revision: 263530 URL: http://svnweb.freebsd.org/changeset/base/263530 Log: Mark the following sysctls as MPSAFE: kern.file kern.proc.filedesc kern.proc.ofiledesc MFC after: 7 days Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Mar 21 19:03:28 2014 (r263529) +++ head/sys/kern/kern_descrip.c Fri Mar 21 19:12:05 2014 (r263530) @@ -2975,7 +2975,7 @@ sysctl_kern_file(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_kern, KERN_FILE, file, CTLTYPE_OPAQUE|CTLFLAG_RD, +SYSCTL_PROC(_kern, KERN_FILE, file, CTLTYPE_OPAQUE|CTLFLAG_RD|CTLFLAG_MPSAFE, 0, 0, sysctl_kern_file, "S,xfile", "Entire file table"); #ifdef KINFO_OFILE_SIZE @@ -3231,8 +3231,9 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE return (0); } -static SYSCTL_NODE(_kern_proc, KERN_PROC_OFILEDESC, ofiledesc, CTLFLAG_RD, - sysctl_kern_proc_ofiledesc, "Process ofiledesc entries"); +static SYSCTL_NODE(_kern_proc, KERN_PROC_OFILEDESC, ofiledesc, + CTLFLAG_RD||CTLFLAG_MPSAFE, sysctl_kern_proc_ofiledesc, + "Process ofiledesc entries"); #endif /* COMPAT_FREEBSD7 */ #ifdef KINFO_FILE_SIZE @@ -3742,8 +3743,9 @@ fill_shm_info(struct file *fp, struct ki return (0); } -static SYSCTL_NODE(_kern_proc, KERN_PROC_FILEDESC, filedesc, CTLFLAG_RD, - sysctl_kern_proc_filedesc, "Process filedesc entries"); +static SYSCTL_NODE(_kern_proc, KERN_PROC_FILEDESC, filedesc, + CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc_filedesc, + "Process filedesc entries"); #ifdef DDB /* From owner-svn-src-head@FreeBSD.ORG Fri Mar 21 19:13:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24FE4EC2; Fri, 21 Mar 2014 19:13:28 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D329E669; Fri, 21 Mar 2014 19:13:27 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s2LJ42UJ084804 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 21 Mar 2014 12:04:02 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s2LJ42tN084803; Fri, 21 Mar 2014 12:04:02 -0700 (PDT) (envelope-from jmg) Date: Fri, 21 Mar 2014 12:04:02 -0700 From: John-Mark Gurney To: Ian Lepore Subject: Re: svn commit: r263424 - head/sys/arm/conf Message-ID: <20140321190402.GT32089@funkthat.com> References: <201403201701.s2KH1L84024044@svn.freebsd.org> <20140321094316.76ccf459@bender.Home> <1395412070.81853.8.camel@revolution.hippie.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1395412070.81853.8.camel@revolution.hippie.lan> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Fri, 21 Mar 2014 12:04:03 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Ruslan Bukin , src-committers@freebsd.org, Andrew Turner X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2014 19:13:28 -0000 Ian Lepore wrote this message on Fri, Mar 21, 2014 at 08:27 -0600: > On Fri, 2014-03-21 at 09:43 +0000, Andrew Turner wrote: > > On Thu, 20 Mar 2014 17:01:21 +0000 (UTC) > > Ruslan Bukin wrote: > > > > > Author: br > > > Date: Thu Mar 20 17:01:21 2014 > > > New Revision: 263424 > > > URL: http://svnweb.freebsd.org/changeset/base/263424 > > > > > > Log: > > > Disable debugging by default. > > > > I don't like this on head. I have found a number of issues that were > > hidden because the kernel config most people were using for development > > had WITNESS, INVARIANTS and DIAGNOSTIC disabled. I agree... HEAD needs these to make sure they are production ready... > I disagree. Witness is essentially useless anymore, because there are > so many known LORs that nobody cares about when you report them that all > it does is spews noise. Maybe it's useful when you're looking for a > particular problem, but leaving it on all the time has just lost its > value. I wouldn't be tracking down an AVILA bug if it wasn't for INVARIANTS.. Also, your complaint is solely about WITNESS not the other ones... Considering how many people are writing new drivers for ARM, and might be introducing locking issues w/ those new drivers, WITNESS should be included, plus, if you disable INVARIANTS, it means that all the lock assert functions will be turned off, and we might miss an odd calling stack which doesn't hold a lock or something... If you're using HEAD for performance, it's easy to turn these off.. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Sat Mar 22 03:36:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 852EC9E4; Sat, 22 Mar 2014 03:36:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 71D27A90; Sat, 22 Mar 2014 03:36:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2M3a8Kv073933; Sat, 22 Mar 2014 03:36:08 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2M3a8qG073932; Sat, 22 Mar 2014 03:36:08 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403220336.s2M3a8qG073932@svn.freebsd.org> From: Adrian Chadd Date: Sat, 22 Mar 2014 03:36:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263618 - head/sys/dev/ath/ath_hal/ar5212 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 03:36:08 -0000 Author: adrian Date: Sat Mar 22 03:36:07 2014 New Revision: 263618 URL: http://svnweb.freebsd.org/changeset/base/263618 Log: Also set the AR5212 HAL power mode tracking in the right spot. Tested: * D-Link DWL-G650 NIC (AR2413), STA mode Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c Sat Mar 22 02:30:38 2014 (r263617) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c Sat Mar 22 03:36:07 2014 (r263618) @@ -134,20 +134,22 @@ ar5212SetPowerMode(struct ath_hal *ah, H setChip ? "set chip " : ""); switch (mode) { case HAL_PM_AWAKE: + ah->ah_powerMode = mode; status = ar5212SetPowerModeAwake(ah, setChip); break; case HAL_PM_FULL_SLEEP: ar5212SetPowerModeSleep(ah, setChip); + ah->ah_powerMode = mode; break; case HAL_PM_NETWORK_SLEEP: ar5212SetPowerModeNetworkSleep(ah, setChip); + ah->ah_powerMode = mode; break; default: HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unknown power mode %u\n", __func__, mode); return AH_FALSE; } - ah->ah_powerMode = mode; return status; } From owner-svn-src-head@FreeBSD.ORG Sat Mar 22 05:32:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E77D6725; Sat, 22 Mar 2014 05:32:10 +0000 (UTC) Received: from mail.machdep.com (mail.machdep.com [195.91.211.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C3BB354; Sat, 22 Mar 2014 05:32:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=machdep.com) by mail.machdep.com with smtp (Exim 4.82 (FreeBSD)) (envelope-from ) id 1WREVJ-000683-G5; Sat, 22 Mar 2014 09:29:57 +0400 Received: by machdep.com (nbSMTP-1.00) for uid 1001 br@machdep.com; Sat, 22 Mar 2014 09:29:57 +0400 (MSK) Date: Sat, 22 Mar 2014 09:29:57 +0400 From: Ruslan Bukin To: Andrew Turner Subject: Re: svn commit: r263424 - head/sys/arm/conf Message-ID: <20140322052957.GA23556@machdep.com> References: <201403201701.s2KH1L84024044@svn.freebsd.org> <20140321094316.76ccf459@bender.Home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20140321094316.76ccf459@bender.Home> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 05:32:11 -0000 On Fri, Mar 21, 2014 at 09:43:16AM +0000, Andrew Turner wrote: > On Thu, 20 Mar 2014 17:01:21 +0000 (UTC) > Ruslan Bukin wrote: > > > Author: br > > Date: Thu Mar 20 17:01:21 2014 > > New Revision: 263424 > > URL: http://svnweb.freebsd.org/changeset/base/263424 > > > > Log: > > Disable debugging by default. > > I don't like this on head. I have found a number of issues that were > hidden because the kernel config most people were using for development > had WITNESS, INVARIANTS and DIAGNOSTIC disabled. > I think arm codebase is so small, so every commit is like a huge evolutional update... Is anyone merging every commit to stable? no so I think arm users prefered to run -current, not stable. (say they need fb driver for chromebook). Developer can set debug locally any time, but users no idea about debugging is ON, so they get running slow system, and then got disappointed. -Ruslan From owner-svn-src-head@FreeBSD.ORG Sat Mar 22 06:10:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFD3ED65; Sat, 22 Mar 2014 06:10:25 +0000 (UTC) Received: from smtpauth4.wiscmail.wisc.edu (wmauth4.doit.wisc.edu [144.92.197.145]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BCAB47BE; Sat, 22 Mar 2014 06:10:25 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth4.wiscmail.wisc.edu by smtpauth4.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0N2T00J00N83GO00@smtpauth4.wiscmail.wisc.edu>; Sat, 22 Mar 2014 01:10:18 -0500 (CDT) X-Spam-PmxInfo: Server=avs-4, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2014.3.22.60015, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from comporellon.tachypleus.net (75-101-50-44.dsl.static.sonic.net [75.101.50.44]) by smtpauth4.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0N2T00GLGQH5LY10@smtpauth4.wiscmail.wisc.edu>; Sat, 22 Mar 2014 01:10:18 -0500 (CDT) Message-id: <532D2948.9050606@freebsd.org> Date: Fri, 21 Mar 2014 23:10:16 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 To: Ruslan Bukin , Andrew Turner Subject: Re: svn commit: r263424 - head/sys/arm/conf References: <201403201701.s2KH1L84024044@svn.freebsd.org> <20140321094316.76ccf459@bender.Home> <20140322052957.GA23556@machdep.com> In-reply-to: <20140322052957.GA23556@machdep.com> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 06:10:26 -0000 On 03/21/14 22:29, Ruslan Bukin wrote: > On Fri, Mar 21, 2014 at 09:43:16AM +0000, Andrew Turner wrote: >> On Thu, 20 Mar 2014 17:01:21 +0000 (UTC) >> Ruslan Bukin wrote: >> >>> Author: br >>> Date: Thu Mar 20 17:01:21 2014 >>> New Revision: 263424 >>> URL: http://svnweb.freebsd.org/changeset/base/263424 >>> >>> Log: >>> Disable debugging by default. >> I don't like this on head. I have found a number of issues that were >> hidden because the kernel config most people were using for development >> had WITNESS, INVARIANTS and DIAGNOSTIC disabled. >> > I think arm codebase is so small, so every commit is like > a huge evolutional update... > Is anyone merging every commit to stable? no > so I think arm users prefered to run -current, not stable. > (say they need fb driver for chromebook). > > Developer can set debug locally any time, but users no idea > about debugging is ON, so they get running slow system, > and then got disappointed. > > -Ruslan > > It's still super dangerous. For one thing, it means the debug code will bitrot since it is never turned on. For another, the beginning of /usr/src/UPDATING has a huge banner about this and what to do about it already. -Nathan From owner-svn-src-head@FreeBSD.ORG Sat Mar 22 08:34:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32E25AD4; Sat, 22 Mar 2014 08:34:39 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0AD00257; Sat, 22 Mar 2014 08:34:38 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s2M8YbGW095501 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 22 Mar 2014 01:34:37 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s2M8YbqS095500; Sat, 22 Mar 2014 01:34:37 -0700 (PDT) (envelope-from jmg) Date: Sat, 22 Mar 2014 01:34:37 -0700 From: John-Mark Gurney To: Ruslan Bukin Subject: Re: svn commit: r263424 - head/sys/arm/conf Message-ID: <20140322083437.GX32089@funkthat.com> References: <201403201701.s2KH1L84024044@svn.freebsd.org> <20140321094316.76ccf459@bender.Home> <20140322052957.GA23556@machdep.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140322052957.GA23556@machdep.com> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Sat, 22 Mar 2014 01:34:38 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrew Turner X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 08:34:39 -0000 Ruslan Bukin wrote this message on Sat, Mar 22, 2014 at 09:29 +0400: > On Fri, Mar 21, 2014 at 09:43:16AM +0000, Andrew Turner wrote: > > On Thu, 20 Mar 2014 17:01:21 +0000 (UTC) > > Ruslan Bukin wrote: > > > > > Author: br > > > Date: Thu Mar 20 17:01:21 2014 > > > New Revision: 263424 > > > URL: http://svnweb.freebsd.org/changeset/base/263424 > > > > > > Log: > > > Disable debugging by default. > > > > I don't like this on head. I have found a number of issues that were > > hidden because the kernel config most people were using for development > > had WITNESS, INVARIANTS and DIAGNOSTIC disabled. > > > > I think arm codebase is so small, so every commit is like > a huge evolutional update... > Is anyone merging every commit to stable? no > so I think arm users prefered to run -current, not stable. > (say they need fb driver for chromebook). Heck, it even warns on every boot: WARNING: WITNESS option enabled, expect reduced performance. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Sat Mar 22 09:23:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C352AFD; Sat, 22 Mar 2014 09:23:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0048C89D; Sat, 22 Mar 2014 09:23:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2M9NDHq022434; Sat, 22 Mar 2014 09:23:13 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2M9NDs8022432; Sat, 22 Mar 2014 09:23:13 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201403220923.s2M9NDs8022432@svn.freebsd.org> From: Andrew Turner Date: Sat, 22 Mar 2014 09:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263619 - head/contrib/llvm/tools/clang/lib/Driver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 09:23:14 -0000 Author: andrew Date: Sat Mar 22 09:23:13 2014 New Revision: 263619 URL: http://svnweb.freebsd.org/changeset/base/263619 Log: Pull in r201662 from upstream clang trunk: Add FreeBSD ARM EABI hard-float support Patch by Andrew Turner. Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Sat Mar 22 03:36:07 2014 (r263618) +++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Sat Mar 22 09:23:13 2014 (r263619) @@ -2034,6 +2034,7 @@ Tool *FreeBSD::buildLinker() const { bool FreeBSD::UseSjLjExceptions() const { // FreeBSD uses SjLj exceptions on ARM oabi. switch (getTriple().getEnvironment()) { + case llvm::Triple::GNUEABIHF: case llvm::Triple::GNUEABI: case llvm::Triple::EABI: return false; Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sat Mar 22 03:36:07 2014 (r263618) +++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sat Mar 22 09:23:13 2014 (r263619) @@ -737,8 +737,15 @@ static StringRef getARMFloatABI(const Dr } case llvm::Triple::FreeBSD: - // FreeBSD defaults to soft float - FloatABI = "soft"; + switch(Triple.getEnvironment()) { + case llvm::Triple::GNUEABIHF: + FloatABI = "hard"; + break; + default: + // FreeBSD defaults to soft float + FloatABI = "soft"; + break; + } break; default: @@ -5776,8 +5783,18 @@ void freebsd::Assemble::ConstructJob(Com } } else if (getToolChain().getArch() == llvm::Triple::arm || getToolChain().getArch() == llvm::Triple::thumb) { - CmdArgs.push_back("-mfpu=softvfp"); + const Driver &D = getToolChain().getDriver(); + llvm::Triple Triple = getToolChain().getTriple(); + StringRef FloatABI = getARMFloatABI(D, Args, Triple); + + if (FloatABI == "hard") { + CmdArgs.push_back("-mfpu=vfp"); + } else { + CmdArgs.push_back("-mfpu=softvfp"); + } + switch(getToolChain().getTriple().getEnvironment()) { + case llvm::Triple::GNUEABIHF: case llvm::Triple::GNUEABI: case llvm::Triple::EABI: CmdArgs.push_back("-meabi=5"); From owner-svn-src-head@FreeBSD.ORG Sat Mar 22 10:26:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C5EE178B; Sat, 22 Mar 2014 10:26:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AEC48CD9; Sat, 22 Mar 2014 10:26:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2MAQKbf047477; Sat, 22 Mar 2014 10:26:20 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2MAQA0d047419; Sat, 22 Mar 2014 10:26:10 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403221026.s2MAQA0d047419@svn.freebsd.org> From: Bryan Drewery Date: Sat, 22 Mar 2014 10:26:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263620 - in head: share/man/man9 sys/amd64/amd64 sys/arm/arm sys/cddl/compat/opensolaris/kern sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs sys/compat/linux sys/c... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 10:26:20 -0000 Author: bdrewery Date: Sat Mar 22 10:26:09 2014 New Revision: 263620 URL: http://svnweb.freebsd.org/changeset/base/263620 Log: Rename global cnt to vm_cnt to avoid shadowing. To reduce the diff struct pcu.cnt field was not renamed, so PCPU_OP(cnt.field) is still used. pc_cnt and pcpu are also used in kvm(3) and vmstat(8). The goal was to not affect externally used KPI. Bump __FreeBSD_version_ in case some out-of-tree module/code relies on the the global cnt variable. Exp-run revealed no ports using it directly. No objection from: arch@ Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man9/memguard.9 head/share/man/man9/vm_set_page_size.9 head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/uma_machdep.c head/sys/arm/arm/machdep.c head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/compat/linprocfs/linprocfs.c head/sys/compat/linux/linux_misc.c head/sys/compat/svr4/svr4_misc.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/i386/i386/machdep.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/ia64/ia64/machdep.c head/sys/ia64/ia64/uma_machdep.c head/sys/kern/init_main.c head/sys/kern/kern_malloc.c head/sys/kern/kern_mib.c head/sys/kern/vfs_bio.c head/sys/kern/vfs_subr.c head/sys/mips/mips/machdep.c head/sys/mips/mips/pmap.c head/sys/mips/mips/uma_machdep.c head/sys/ofed/drivers/infiniband/core/umem.c head/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c head/sys/pc98/pc98/machdep.c head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/uma_machdep.c head/sys/powerpc/booke/machdep.c head/sys/powerpc/booke/pmap.c head/sys/sparc64/sparc64/machdep.c head/sys/sparc64/sparc64/pmap.c head/sys/sparc64/sparc64/vm_machdep.c head/sys/sys/param.h head/sys/sys/vmmeter.h head/sys/vm/memguard.c head/sys/vm/swap_pager.c head/sys/vm/vm_glue.c head/sys/vm/vm_map.c head/sys/vm/vm_meter.c head/sys/vm/vm_mmap.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_pageout.c head/sys/vm/vm_param.h head/sys/vm/vm_phys.c head/sys/vm/vm_phys.h head/sys/vm/vm_radix.c head/sys/vm/vm_zeroidle.c head/sys/vm/vnode_pager.c Modified: head/share/man/man9/memguard.9 ============================================================================== --- head/share/man/man9/memguard.9 Sat Mar 22 09:23:13 2014 (r263619) +++ head/share/man/man9/memguard.9 Sat Mar 22 10:26:09 2014 (r263620) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 21, 2011 +.Dd March 21, 2014 .Dt MEMGUARD 9 .Os .Sh NAME @@ -129,7 +129,7 @@ memory .Nm is allowed to consume. The default is 10, so up to -.Va cnt.v_page_count Ns /10 +.Va vm_cnt.v_page_count Ns /10 pages can be used. .Nm will reserve Modified: head/share/man/man9/vm_set_page_size.9 ============================================================================== --- head/share/man/man9/vm_set_page_size.9 Sat Mar 22 09:23:13 2014 (r263619) +++ head/share/man/man9/vm_set_page_size.9 Sat Mar 22 10:26:09 2014 (r263620) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 17, 2001 +.Dd March 21, 2014 .Dt VM_SET_PAGE_SIZE 9 .Os .Sh NAME @@ -43,16 +43,16 @@ The .Fn vm_set_page_size function initializes the system page size. If -.Va cnt.v_page_size +.Va vm_cnt.v_page_size (see .In sys/vmmeter.h ) equals 0, .Dv PAGE_SIZE is used; otherwise, the value stored in -.Va cnt.v_page_size +.Va vm_cnt.v_page_size is used. If -.Va cnt.v_page_size +.Va vm_cnt.v_page_size is not a power of two, the system will panic. .Pp .Fn vm_set_page_size Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/amd64/amd64/machdep.c Sat Mar 22 10:26:09 2014 (r263620) @@ -284,7 +284,7 @@ cpu_startup(dummy) memsize = (uintmax_t)strtoul(sysenv, (char **)NULL, 10) << 10; freeenv(sysenv); } - if (memsize < ptoa((uintmax_t)cnt.v_free_count)) + if (memsize < ptoa((uintmax_t)vm_cnt.v_free_count)) memsize = ptoa((uintmax_t)Maxmem); printf("real memory = %ju (%ju MB)\n", memsize, memsize >> 20); realmem = atop(memsize); @@ -311,8 +311,8 @@ cpu_startup(dummy) vm_ksubmap_init(&kmi); printf("avail memory = %ju (%ju MB)\n", - ptoa((uintmax_t)cnt.v_free_count), - ptoa((uintmax_t)cnt.v_free_count) / 1048576); + ptoa((uintmax_t)vm_cnt.v_free_count), + ptoa((uintmax_t)vm_cnt.v_free_count) / 1048576); /* * Set up buffers, so they can be used to read disk labels. Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/amd64/amd64/pmap.c Sat Mar 22 10:26:09 2014 (r263620) @@ -2135,7 +2135,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_offset_ * the page table page is globally performed before TLB shoot- * down is begun. */ - atomic_subtract_rel_int(&cnt.v_wire_count, 1); + atomic_subtract_rel_int(&vm_cnt.v_wire_count, 1); /* * Put page on a list so that it is released after @@ -2328,7 +2328,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t if (_pmap_allocpte(pmap, NUPDE + NUPDPE + pml4index, lockp) == NULL) { --m->wire_count; - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); vm_page_free_zero(m); return (NULL); } @@ -2361,7 +2361,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t if (_pmap_allocpte(pmap, NUPDE + pdpindex, lockp) == NULL) { --m->wire_count; - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); vm_page_free_zero(m); return (NULL); } @@ -2375,7 +2375,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t if (_pmap_allocpte(pmap, NUPDE + pdpindex, lockp) == NULL) { --m->wire_count; - atomic_subtract_int(&cnt.v_wire_count, + atomic_subtract_int(&vm_cnt.v_wire_count, 1); vm_page_free_zero(m); return (NULL); @@ -2515,7 +2515,7 @@ pmap_release(pmap_t pmap) pmap->pm_pml4[PML4PML4I] = 0; /* Recursive Mapping */ m->wire_count--; - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); vm_page_free_zero(m); if (pmap->pm_pcid != -1) free_unr(&pcid_unr, pmap->pm_pcid); @@ -2814,7 +2814,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, str SLIST_REMOVE_HEAD(&free, plinks.s.ss); /* Recycle a freed page table page. */ m_pc->wire_count = 1; - atomic_add_int(&cnt.v_wire_count, 1); + atomic_add_int(&vm_cnt.v_wire_count, 1); } pmap_free_zero_pages(&free); return (m_pc); @@ -3484,7 +3484,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t ("pmap_remove_pde: pte page wire count error")); mpte->wire_count = 0; pmap_add_delayed_free_list(mpte, free, FALSE); - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); } } return (pmap_unuse_pt(pmap, sva, *pmap_pdpe(pmap, sva), free)); @@ -5288,7 +5288,7 @@ pmap_remove_pages(pmap_t pmap) ("pmap_remove_pages: pte page wire count error")); mpte->wire_count = 0; pmap_add_delayed_free_list(mpte, &free, FALSE); - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); } } else { pmap_resident_count_dec(pmap, 1); Modified: head/sys/amd64/amd64/uma_machdep.c ============================================================================== --- head/sys/amd64/amd64/uma_machdep.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/amd64/amd64/uma_machdep.c Sat Mar 22 10:26:09 2014 (r263620) @@ -80,5 +80,5 @@ uma_small_free(void *mem, int size, u_in m = PHYS_TO_VM_PAGE(pa); m->wire_count--; vm_page_free(m); - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); } Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/arm/arm/machdep.c Sat Mar 22 10:26:09 2014 (r263620) @@ -366,8 +366,8 @@ cpu_startup(void *dummy) (uintmax_t)arm32_ptob(realmem), (uintmax_t)arm32_ptob(realmem) / mbyte); printf("avail memory = %ju (%ju MB)\n", - (uintmax_t)arm32_ptob(cnt.v_free_count), - (uintmax_t)arm32_ptob(cnt.v_free_count) / mbyte); + (uintmax_t)arm32_ptob(vm_cnt.v_free_count), + (uintmax_t)arm32_ptob(vm_cnt.v_free_count) / mbyte); if (bootverbose) { arm_physmem_print_tables(); arm_devmap_print_table(); Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/arm/arm/pmap-v6.c Sat Mar 22 10:26:09 2014 (r263620) @@ -1348,7 +1348,7 @@ pmap_init(void) */ TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); - pv_entry_max = shpgperproc * maxproc + cnt.v_page_count; + pv_entry_max = shpgperproc * maxproc + vm_cnt.v_page_count; TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max); pv_entry_max = roundup(pv_entry_max, _NPCPV); pv_entry_high_water = 9 * (pv_entry_max / 10); Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/arm/arm/pmap.c Sat Mar 22 10:26:09 2014 (r263620) @@ -1790,7 +1790,7 @@ pmap_init(void) pvzone = uma_zcreate("PV ENTRY", sizeof (struct pv_entry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); - pv_entry_max = shpgperproc * maxproc + cnt.v_page_count; + pv_entry_max = shpgperproc * maxproc + vm_cnt.v_page_count; uma_zone_reserve_kva(pvzone, pv_entry_max); pv_entry_high_water = 9 * (pv_entry_max / 10); Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Sat Mar 22 10:26:09 2014 (r263620) @@ -120,7 +120,7 @@ static void kmem_size_init(void *unused __unused) { - kmem_size_val = (uint64_t)cnt.v_page_count * PAGE_SIZE; + kmem_size_val = (uint64_t)vm_cnt.v_page_count * PAGE_SIZE; if (kmem_size_val > vm_kmem_size) kmem_size_val = vm_kmem_size; } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Mar 22 10:26:09 2014 (r263620) @@ -3877,7 +3877,7 @@ arc_memory_throttle(uint64_t reserve, ui { #ifdef _KERNEL uint64_t available_memory = - ptoa((uintmax_t)cnt.v_free_count + cnt.v_cache_count); + ptoa((uintmax_t)vm_cnt.v_free_count + vm_cnt.v_cache_count); static uint64_t page_load = 0; static uint64_t last_txg = 0; @@ -3888,7 +3888,7 @@ arc_memory_throttle(uint64_t reserve, ui #endif #endif /* sun */ - if (cnt.v_free_count + cnt.v_cache_count > + if (vm_cnt.v_free_count + vm_cnt.v_cache_count > (uint64_t)physmem * arc_lotsfree_percent / 100) return (0); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Mar 22 10:26:09 2014 (r263620) @@ -2347,7 +2347,7 @@ zfs_vnodes_adjust(void) * vntblinit(). If it is equal to desiredvnodes, it means that * it wasn't tuned by the administrator and we can tune it down. */ - newdesiredvnodes = min(maxproc + cnt.v_page_count / 4, 2 * + newdesiredvnodes = min(maxproc + vm_cnt.v_page_count / 4, 2 * vm_kmem_size / (5 * (sizeof(struct vm_object) + sizeof(struct vnode)))); if (newdesiredvnodes == desiredvnodes) Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/compat/linprocfs/linprocfs.c Sat Mar 22 10:26:09 2014 (r263620) @@ -159,14 +159,14 @@ linprocfs_domeminfo(PFS_FILL_ARGS) /* * The correct thing here would be: * - memfree = cnt.v_free_count * PAGE_SIZE; + memfree = vm_cnt.v_free_count * PAGE_SIZE; memused = memtotal - memfree; * * but it might mislead linux binaries into thinking there * is very little memory left, so we cheat and tell them that * all memory that isn't wired down is free. */ - memused = cnt.v_wire_count * PAGE_SIZE; + memused = vm_cnt.v_wire_count * PAGE_SIZE; memfree = memtotal - memused; swap_pager_status(&i, &j); swaptotal = (unsigned long long)i * PAGE_SIZE; @@ -188,7 +188,7 @@ linprocfs_domeminfo(PFS_FILL_ARGS) * like unstaticizing it just for linprocfs's sake. */ buffers = 0; - cached = cnt.v_cache_count * PAGE_SIZE; + cached = vm_cnt.v_cache_count * PAGE_SIZE; sbuf_printf(sb, " total: used: free: shared: buffers: cached:\n" @@ -486,12 +486,12 @@ linprocfs_dostat(PFS_FILL_ARGS) "intr %u\n" "ctxt %u\n" "btime %lld\n", - cnt.v_vnodepgsin, - cnt.v_vnodepgsout, - cnt.v_swappgsin, - cnt.v_swappgsout, - cnt.v_intr, - cnt.v_swtch, + vm_cnt.v_vnodepgsin, + vm_cnt.v_vnodepgsout, + vm_cnt.v_swappgsin, + vm_cnt.v_swappgsout, + vm_cnt.v_intr, + vm_cnt.v_swtch, (long long)boottime.tv_sec); return (0); } Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/compat/linux/linux_misc.c Sat Mar 22 10:26:09 2014 (r263620) @@ -148,7 +148,7 @@ linux_sysinfo(struct thread *td, struct LINUX_SYSINFO_LOADS_SCALE / averunnable.fscale; sysinfo.totalram = physmem * PAGE_SIZE; - sysinfo.freeram = sysinfo.totalram - cnt.v_wire_count * PAGE_SIZE; + sysinfo.freeram = sysinfo.totalram - vm_cnt.v_wire_count * PAGE_SIZE; sysinfo.sharedram = 0; mtx_lock(&vm_object_list_mtx); Modified: head/sys/compat/svr4/svr4_misc.c ============================================================================== --- head/sys/compat/svr4/svr4_misc.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/compat/svr4/svr4_misc.c Sat Mar 22 10:26:09 2014 (r263620) @@ -773,14 +773,14 @@ svr4_sys_sysconfig(td, uap) #if defined(UVM) *retval = uvmexp.free; /* XXX: free instead of total */ #else - *retval = cnt.v_free_count; /* XXX: free instead of total */ + *retval = vm_cnt.v_free_count; /* XXX: free instead of total */ #endif break; case SVR4_CONFIG_AVPHYS_PAGES: #if defined(UVM) *retval = uvmexp.active; /* XXX: active instead of avg */ #else - *retval = cnt.v_active_count; /* XXX: active instead of avg */ + *retval = vm_cnt.v_active_count;/* XXX: active instead of avg */ #endif break; #endif /* NOTYET */ Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/fs/tmpfs/tmpfs_subr.c Sat Mar 22 10:26:09 2014 (r263620) @@ -104,7 +104,7 @@ tmpfs_mem_avail(void) { vm_ooffset_t avail; - avail = swap_pager_avail + cnt.v_free_count + cnt.v_cache_count - + avail = swap_pager_avail + vm_cnt.v_free_count + vm_cnt.v_cache_count - tmpfs_pages_reserved; if (__predict_false(avail < 0)) avail = 0; Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/i386/i386/machdep.c Sat Mar 22 10:26:09 2014 (r263620) @@ -308,7 +308,7 @@ cpu_startup(dummy) memsize = (uintmax_t)strtoul(sysenv, (char **)NULL, 10) << 10; freeenv(sysenv); } - if (memsize < ptoa((uintmax_t)cnt.v_free_count)) + if (memsize < ptoa((uintmax_t)vm_cnt.v_free_count)) memsize = ptoa((uintmax_t)Maxmem); printf("real memory = %ju (%ju MB)\n", memsize, memsize >> 20); realmem = atop(memsize); @@ -335,8 +335,8 @@ cpu_startup(dummy) vm_ksubmap_init(&kmi); printf("avail memory = %ju (%ju MB)\n", - ptoa((uintmax_t)cnt.v_free_count), - ptoa((uintmax_t)cnt.v_free_count) / 1048576); + ptoa((uintmax_t)vm_cnt.v_free_count), + ptoa((uintmax_t)vm_cnt.v_free_count) / 1048576); /* * Set up buffers, so they can be used to read disk labels. Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/i386/i386/pmap.c Sat Mar 22 10:26:09 2014 (r263620) @@ -744,7 +744,7 @@ pmap_init(void) * numbers of pv entries. */ TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); - pv_entry_max = shpgperproc * maxproc + cnt.v_page_count; + pv_entry_max = shpgperproc * maxproc + vm_cnt.v_page_count; TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max); pv_entry_max = roundup(pv_entry_max, _NPCPV); pv_entry_high_water = 9 * (pv_entry_max / 10); @@ -1674,7 +1674,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_page_t * the page table page is globally performed before TLB shoot- * down is begun. */ - atomic_subtract_rel_int(&cnt.v_wire_count, 1); + atomic_subtract_rel_int(&vm_cnt.v_wire_count, 1); /* * Do an invltlb to make the invalidated mapping @@ -2050,7 +2050,7 @@ pmap_release(pmap_t pmap) ("pmap_release: got wrong ptd page")); #endif m->wire_count--; - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); vm_page_free_zero(m); } } @@ -2313,7 +2313,7 @@ out: SLIST_REMOVE_HEAD(&free, plinks.s.ss); /* Recycle a freed page table page. */ m_pc->wire_count = 1; - atomic_add_int(&cnt.v_wire_count, 1); + atomic_add_int(&vm_cnt.v_wire_count, 1); } pmap_free_zero_pages(&free); return (m_pc); @@ -2862,7 +2862,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t ("pmap_remove_pde: pte page wire count error")); mpte->wire_count = 0; pmap_add_delayed_free_list(mpte, free, FALSE); - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); } } } @@ -4523,7 +4523,7 @@ pmap_remove_pages(pmap_t pmap) ("pmap_remove_pages: pte page wire count error")); mpte->wire_count = 0; pmap_add_delayed_free_list(mpte, &free, FALSE); - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); } } else { pmap->pm_stats.resident_count--; Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/i386/xen/pmap.c Sat Mar 22 10:26:09 2014 (r263620) @@ -614,7 +614,7 @@ pmap_init(void) * numbers of pv entries. */ TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); - pv_entry_max = shpgperproc * maxproc + cnt.v_page_count; + pv_entry_max = shpgperproc * maxproc + vm_cnt.v_page_count; TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max); pv_entry_max = roundup(pv_entry_max, _NPCPV); pv_entry_high_water = 9 * (pv_entry_max / 10); @@ -1380,7 +1380,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_page_t * the page table page is globally performed before TLB shoot- * down is begun. */ - atomic_subtract_rel_int(&cnt.v_wire_count, 1); + atomic_subtract_rel_int(&vm_cnt.v_wire_count, 1); /* * Do an invltlb to make the invalidated mapping @@ -1813,7 +1813,7 @@ pmap_release(pmap_t pmap) ("pmap_release: got wrong ptd page")); #endif m->wire_count--; - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); vm_page_free(m); } #ifdef PAE @@ -2089,7 +2089,7 @@ out: free = (void *)m_pc->object; /* Recycle a freed page table page. */ m_pc->wire_count = 1; - atomic_add_int(&cnt.v_wire_count, 1); + atomic_add_int(&vm_cnt.v_wire_count, 1); } pmap_free_zero_pages(free); return (m_pc); Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/ia64/ia64/machdep.c Sat Mar 22 10:26:09 2014 (r263620) @@ -281,8 +281,8 @@ cpu_startup(void *dummy) vm_ksubmap_init(&kmi); - printf("avail memory = %ld (%ld MB)\n", ptoa(cnt.v_free_count), - ptoa(cnt.v_free_count) / 1048576); + printf("avail memory = %ld (%ld MB)\n", ptoa(vm_cnt.v_free_count), + ptoa(vm_cnt.v_free_count) / 1048576); if (fpswa_iface == NULL) printf("Warning: no FPSWA package supplied\n"); Modified: head/sys/ia64/ia64/uma_machdep.c ============================================================================== --- head/sys/ia64/ia64/uma_machdep.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/ia64/ia64/uma_machdep.c Sat Mar 22 10:26:09 2014 (r263620) @@ -73,5 +73,5 @@ uma_small_free(void *mem, int size, u_in m = PHYS_TO_VM_PAGE(IA64_RR_MASK((u_int64_t)mem)); m->wire_count--; vm_page_free(m); - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); } Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/kern/init_main.c Sat Mar 22 10:26:09 2014 (r263620) @@ -544,7 +544,7 @@ proc0_init(void *dummy __unused) p->p_limit->pl_rlimit[RLIMIT_STACK].rlim_cur = dflssiz; p->p_limit->pl_rlimit[RLIMIT_STACK].rlim_max = maxssiz; /* Cast to avoid overflow on i386/PAE. */ - pageablemem = ptoa((vm_paddr_t)cnt.v_free_count); + pageablemem = ptoa((vm_paddr_t)vm_cnt.v_free_count); p->p_limit->pl_rlimit[RLIMIT_RSS].rlim_cur = p->p_limit->pl_rlimit[RLIMIT_RSS].rlim_max = pageablemem; p->p_limit->pl_rlimit[RLIMIT_MEMLOCK].rlim_cur = pageablemem / 3; Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/kern/kern_malloc.c Sat Mar 22 10:26:09 2014 (r263620) @@ -711,7 +711,7 @@ kmeminit(void) * VM_KMEM_SIZE_MAX is itself a function of the available KVA space on * a given architecture. */ - mem_size = cnt.v_page_count; + mem_size = vm_cnt.v_page_count; vm_kmem_size_scale = VM_KMEM_SIZE_SCALE; TUNABLE_INT_FETCH("vm.kmem_size_scale", &vm_kmem_size_scale); @@ -819,7 +819,7 @@ malloc_init(void *data) struct malloc_type_internal *mtip; struct malloc_type *mtp; - KASSERT(cnt.v_page_count != 0, ("malloc_register before vm_init")); + KASSERT(vm_cnt.v_page_count != 0, ("malloc_register before vm_init")); mtp = data; if (mtp->ks_magic != M_MAGIC) Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/kern/kern_mib.c Sat Mar 22 10:26:09 2014 (r263620) @@ -199,7 +199,7 @@ sysctl_hw_usermem(SYSCTL_HANDLER_ARGS) { u_long val; - val = ctob(physmem - cnt.v_wire_count); + val = ctob(physmem - vm_cnt.v_wire_count); return (sysctl_handle_long(oidp, &val, 0, req)); } Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/kern/vfs_bio.c Sat Mar 22 10:26:09 2014 (r263620) @@ -4290,7 +4290,7 @@ vm_hold_free_pages(struct buf *bp, int n (intmax_t)bp->b_blkno, (intmax_t)bp->b_lblkno); p->wire_count--; vm_page_free(p); - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); } bp->b_npages = newnpages; } Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/kern/vfs_subr.c Sat Mar 22 10:26:09 2014 (r263620) @@ -330,8 +330,8 @@ vntblinit(void *dummy __unused) * size. The memory required by desiredvnodes vnodes and vm objects * may not exceed one seventh of the kernel's heap size. */ - physvnodes = maxproc + cnt.v_page_count / 16 + 3 * min(98304 * 4, - cnt.v_page_count) / 16; + physvnodes = maxproc + vm_cnt.v_page_count / 16 + 3 * min(98304 * 4, + vm_cnt.v_page_count) / 16; virtvnodes = vm_kmem_size / (7 * (sizeof(struct vm_object) + sizeof(struct vnode))); desiredvnodes = min(physvnodes, virtvnodes); @@ -708,7 +708,7 @@ vlrureclaim(struct mount *mp) usevnodes = desiredvnodes; if (usevnodes <= 0) usevnodes = 1; - trigger = cnt.v_page_count * 2 / usevnodes; + trigger = vm_cnt.v_page_count * 2 / usevnodes; done = 0; vn_start_write(NULL, &mp, V_WAIT); MNT_ILOCK(mp); Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/mips/mips/machdep.c Sat Mar 22 10:26:09 2014 (r263620) @@ -211,8 +211,8 @@ cpu_startup(void *dummy) vm_ksubmap_init(&kmi); printf("avail memory = %ju (%juMB)\n", - ptoa((uintmax_t)cnt.v_free_count), - ptoa((uintmax_t)cnt.v_free_count) / 1048576); + ptoa((uintmax_t)vm_cnt.v_free_count), + ptoa((uintmax_t)vm_cnt.v_free_count) / 1048576); cpu_init_interrupts(); /* Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/mips/mips/pmap.c Sat Mar 22 10:26:09 2014 (r263620) @@ -995,7 +995,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_offset_ * If the page is finally unwired, simply free it. */ vm_page_free_zero(m); - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); } /* @@ -1144,7 +1144,7 @@ _pmap_allocpte(pmap_t pmap, unsigned pte flags) == NULL) { /* alloc failed, release current */ --m->wire_count; - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); vm_page_free_zero(m); return (NULL); } @@ -1227,7 +1227,7 @@ pmap_release(pmap_t pmap) ptdpg = PHYS_TO_VM_PAGE(MIPS_DIRECT_TO_PHYS(ptdva)); ptdpg->wire_count--; - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); vm_page_free_zero(ptdpg); } Modified: head/sys/mips/mips/uma_machdep.c ============================================================================== --- head/sys/mips/mips/uma_machdep.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/mips/mips/uma_machdep.c Sat Mar 22 10:26:09 2014 (r263620) @@ -79,5 +79,5 @@ uma_small_free(void *mem, int size, u_in m = PHYS_TO_VM_PAGE(pa); m->wire_count--; vm_page_free(m); - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); } Modified: head/sys/ofed/drivers/infiniband/core/umem.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/umem.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/ofed/drivers/infiniband/core/umem.c Sat Mar 22 10:26:09 2014 (r263620) @@ -347,7 +347,7 @@ out: return ERR_PTR(-ENOMEM); } PROC_UNLOCK(proc); - if (npages + cnt.v_wire_count > vm_page_max_wired) { + if (npages + vm_cnt.v_wire_count > vm_page_max_wired) { kfree(umem); return ERR_PTR(-EAGAIN); } Modified: head/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c ============================================================================== --- head/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/ofed/drivers/infiniband/hw/mthca/mthca_memfree.c Sat Mar 22 10:26:09 2014 (r263620) @@ -559,7 +559,7 @@ out: goto out; } PROC_UNLOCK(proc); - if (cnt.v_wire_count + 1 > vm_page_max_wired) { + if (vm_cnt.v_wire_count + 1 > vm_page_max_wired) { ret = -EAGAIN; goto out; } Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/pc98/pc98/machdep.c Sat Mar 22 10:26:09 2014 (r263620) @@ -270,8 +270,8 @@ cpu_startup(dummy) vm_ksubmap_init(&kmi); printf("avail memory = %ju (%ju MB)\n", - ptoa((uintmax_t)cnt.v_free_count), - ptoa((uintmax_t)cnt.v_free_count) / 1048576); + ptoa((uintmax_t)vm_cnt.v_free_count), + ptoa((uintmax_t)vm_cnt.v_free_count) / 1048576); /* * Set up buffers, so they can be used to read disk labels. Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/powerpc/aim/machdep.c Sat Mar 22 10:26:09 2014 (r263620) @@ -217,8 +217,8 @@ cpu_startup(void *dummy) vm_ksubmap_init(&kmi); - printf("avail memory = %ld (%ld MB)\n", ptoa(cnt.v_free_count), - ptoa(cnt.v_free_count) / 1048576); + printf("avail memory = %ld (%ld MB)\n", ptoa(vm_cnt.v_free_count), + ptoa(vm_cnt.v_free_count) / 1048576); /* * Set up buffers, so they can be used to read disk labels. Modified: head/sys/powerpc/aim/uma_machdep.c ============================================================================== --- head/sys/powerpc/aim/uma_machdep.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/powerpc/aim/uma_machdep.c Sat Mar 22 10:26:09 2014 (r263620) @@ -93,6 +93,6 @@ uma_small_free(void *mem, int size, u_in m = PHYS_TO_VM_PAGE((vm_offset_t)mem); m->wire_count--; vm_page_free(m); - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); atomic_subtract_int(&hw_uma_mdpages, 1); } Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/powerpc/booke/machdep.c Sat Mar 22 10:26:09 2014 (r263620) @@ -220,8 +220,8 @@ cpu_booke_startup(void *dummy) vm_ksubmap_init(&kmi); - printf("avail memory = %lu (%ld MB)\n", ptoa(cnt.v_free_count), - ptoa(cnt.v_free_count) / 1048576); + printf("avail memory = %lu (%ld MB)\n", ptoa(vm_cnt.v_free_count), + ptoa(vm_cnt.v_free_count) / 1048576); /* Set up buffers, so they can be used to read disk labels. */ bufinit(); Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/powerpc/booke/pmap.c Sat Mar 22 10:26:09 2014 (r263620) @@ -649,7 +649,7 @@ ptbl_free(mmu_t mmu, pmap_t pmap, unsign pa = pte_vatopa(mmu, kernel_pmap, va); m = PHYS_TO_VM_PAGE(pa); vm_page_free_zero(m); - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); mmu_booke_kremove(mmu, va); } @@ -1385,7 +1385,7 @@ mmu_booke_init(mmu_t mmu) NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); - pv_entry_max = shpgperproc * maxproc + cnt.v_page_count; + pv_entry_max = shpgperproc * maxproc + vm_cnt.v_page_count; TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max); pv_entry_high_water = 9 * (pv_entry_max / 10); Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/sparc64/sparc64/machdep.c Sat Mar 22 10:26:09 2014 (r263620) @@ -190,8 +190,8 @@ cpu_startup(void *arg) EVENTHANDLER_REGISTER(shutdown_final, sparc64_shutdown_final, NULL, SHUTDOWN_PRI_LAST); - printf("avail memory = %lu (%lu MB)\n", cnt.v_free_count * PAGE_SIZE, - cnt.v_free_count / ((1024 * 1024) / PAGE_SIZE)); + printf("avail memory = %lu (%lu MB)\n", vm_cnt.v_free_count * PAGE_SIZE, + vm_cnt.v_free_count / ((1024 * 1024) / PAGE_SIZE)); if (bootverbose) printf("machine: %s\n", sparc64_model); Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/sparc64/sparc64/pmap.c Sat Mar 22 10:26:09 2014 (r263620) @@ -1293,7 +1293,7 @@ pmap_release(pmap_t pm) m = TAILQ_FIRST(&obj->memq); m->md.pmap = NULL; m->wire_count--; - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); vm_page_free_zero(m); } VM_OBJECT_WUNLOCK(obj); Modified: head/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/vm_machdep.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/sparc64/sparc64/vm_machdep.c Sat Mar 22 10:26:09 2014 (r263620) @@ -548,5 +548,5 @@ uma_small_free(void *mem, int size, u_in m = PHYS_TO_VM_PAGE(TLB_DIRECT_TO_PHYS((vm_offset_t)mem)); m->wire_count--; vm_page_free(m); - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); } Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/sys/param.h Sat Mar 22 10:26:09 2014 (r263620) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100014 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100015 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/sys/vmmeter.h Sat Mar 22 10:26:09 2014 (r263620) @@ -116,7 +116,7 @@ struct vmmeter { }; #ifdef _KERNEL -extern struct vmmeter cnt; +extern struct vmmeter vm_cnt; extern int vm_pageout_wakeup_thresh; @@ -131,7 +131,8 @@ static __inline int vm_page_count_severe(void) { - return (cnt.v_free_severe > (cnt.v_free_count + cnt.v_cache_count)); + return (vm_cnt.v_free_severe > (vm_cnt.v_free_count + + vm_cnt.v_cache_count)); } /* @@ -148,7 +149,7 @@ static __inline int vm_page_count_min(void) { - return (cnt.v_free_min > (cnt.v_free_count + cnt.v_cache_count)); + return (vm_cnt.v_free_min > (vm_cnt.v_free_count + vm_cnt.v_cache_count)); } /* @@ -160,7 +161,8 @@ static __inline int vm_page_count_target(void) { - return (cnt.v_free_target > (cnt.v_free_count + cnt.v_cache_count)); + return (vm_cnt.v_free_target > (vm_cnt.v_free_count + + vm_cnt.v_cache_count)); } /* @@ -172,7 +174,8 @@ static __inline int vm_paging_target(void) { - return (cnt.v_free_target - (cnt.v_free_count + cnt.v_cache_count)); + return (vm_cnt.v_free_target - (vm_cnt.v_free_count + + vm_cnt.v_cache_count)); } /* @@ -183,7 +186,8 @@ static __inline int vm_paging_needed(void) { - return (cnt.v_free_count + cnt.v_cache_count < vm_pageout_wakeup_thresh); + return (vm_cnt.v_free_count + vm_cnt.v_cache_count < + vm_pageout_wakeup_thresh); } #endif Modified: head/sys/vm/memguard.c ============================================================================== --- head/sys/vm/memguard.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/vm/memguard.c Sat Mar 22 10:26:09 2014 (r263620) @@ -181,7 +181,7 @@ memguard_fudge(unsigned long km_size, co * This prevents memguard's page promotions from completely * using up memory, since most malloc(9) calls are sub-page. */ - mem_pgs = cnt.v_page_count; + mem_pgs = vm_cnt.v_page_count; memguard_physlimit = (mem_pgs / vm_memguard_divisor) * PAGE_SIZE; /* * We want as much KVA as we can take safely. Use at most our Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/vm/swap_pager.c Sat Mar 22 10:26:09 2014 (r263620) @@ -203,7 +203,7 @@ swap_reserve_by_cred(vm_ooffset_t incr, mtx_lock(&sw_dev_mtx); r = swap_reserved + incr; if (overcommit & SWAP_RESERVE_ALLOW_NONWIRED) { - s = cnt.v_page_count - cnt.v_free_reserved - cnt.v_wire_count; + s = vm_cnt.v_page_count - vm_cnt.v_free_reserved - vm_cnt.v_wire_count; s *= PAGE_SIZE; } else s = 0; @@ -545,7 +545,7 @@ swap_pager_swap_init(void) * can hold 16 pages, so this is probably overkill. This reservation * is typically limited to around 32MB by default. */ - n = cnt.v_page_count / 2; + n = vm_cnt.v_page_count / 2; if (maxswzone && n > maxswzone / sizeof(struct swblock)) n = maxswzone / sizeof(struct swblock); n2 = n; @@ -2316,7 +2316,7 @@ swapoff_one(struct swdevt *sp, struct uc * of data we will have to page back in, plus an epsilon so * the system doesn't become critically low on swap space. */ - if (cnt.v_free_count + cnt.v_cache_count + swap_pager_avail < + if (vm_cnt.v_free_count + vm_cnt.v_cache_count + swap_pager_avail < nblks + nswap_lowat) { return (ENOMEM); } Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/vm/vm_glue.c Sat Mar 22 10:26:09 2014 (r263620) @@ -197,7 +197,7 @@ vslock(void *addr, size_t len) * Also, the sysctl code, which is the only present user * of vslock(), does a hard loop on EAGAIN. */ - if (npages + cnt.v_wire_count > vm_page_max_wired) + if (npages + vm_cnt.v_wire_count > vm_page_max_wired) return (EAGAIN); #endif error = vm_map_wire(&curproc->p_vmspace->vm_map, start, end, Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/vm/vm_map.c Sat Mar 22 10:26:09 2014 (r263620) @@ -1840,7 +1840,7 @@ vm_map_pmap_enter(vm_map_t map, vm_offse * free pages allocating pv entries. */ if ((flags & MAP_PREFAULT_MADVISE) && - cnt.v_free_count < cnt.v_free_reserved) { + vm_cnt.v_free_count < vm_cnt.v_free_reserved) { psize = tmpidx; break; } Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/vm/vm_meter.c Sat Mar 22 10:26:09 2014 (r263620) @@ -53,24 +53,24 @@ __FBSDID("$FreeBSD$"); #include #include -struct vmmeter cnt; +struct vmmeter vm_cnt; SYSCTL_UINT(_vm, VM_V_FREE_MIN, v_free_min, - CTLFLAG_RW, &cnt.v_free_min, 0, "Minimum low-free-pages threshold"); + CTLFLAG_RW, &vm_cnt.v_free_min, 0, "Minimum low-free-pages threshold"); SYSCTL_UINT(_vm, VM_V_FREE_TARGET, v_free_target, - CTLFLAG_RW, &cnt.v_free_target, 0, "Desired free pages"); + CTLFLAG_RW, &vm_cnt.v_free_target, 0, "Desired free pages"); SYSCTL_UINT(_vm, VM_V_FREE_RESERVED, v_free_reserved, - CTLFLAG_RW, &cnt.v_free_reserved, 0, "Pages reserved for deadlock"); + CTLFLAG_RW, &vm_cnt.v_free_reserved, 0, "Pages reserved for deadlock"); SYSCTL_UINT(_vm, VM_V_INACTIVE_TARGET, v_inactive_target, - CTLFLAG_RW, &cnt.v_inactive_target, 0, "Pages desired inactive"); + CTLFLAG_RW, &vm_cnt.v_inactive_target, 0, "Pages desired inactive"); SYSCTL_UINT(_vm, VM_V_CACHE_MIN, v_cache_min, - CTLFLAG_RW, &cnt.v_cache_min, 0, "Min pages on cache queue"); + CTLFLAG_RW, &vm_cnt.v_cache_min, 0, "Min pages on cache queue"); SYSCTL_UINT(_vm, VM_V_CACHE_MAX, v_cache_max, - CTLFLAG_RW, &cnt.v_cache_max, 0, "Max pages on cache queue"); + CTLFLAG_RW, &vm_cnt.v_cache_max, 0, "Max pages on cache queue"); SYSCTL_UINT(_vm, VM_V_PAGEOUT_FREE_MIN, v_pageout_free_min, - CTLFLAG_RW, &cnt.v_pageout_free_min, 0, "Min pages reserved for kernel"); + CTLFLAG_RW, &vm_cnt.v_pageout_free_min, 0, "Min pages reserved for kernel"); SYSCTL_UINT(_vm, OID_AUTO, v_free_severe, - CTLFLAG_RW, &cnt.v_free_severe, 0, "Severe page depletion point"); + CTLFLAG_RW, &vm_cnt.v_free_severe, 0, "Severe page depletion point"); static int sysctl_vm_loadavg(SYSCTL_HANDLER_ARGS) @@ -231,7 +231,7 @@ vmtotal(SYSCTL_HANDLER_ARGS) } } mtx_unlock(&vm_object_list_mtx); - total.t_free = cnt.v_free_count + cnt.v_cache_count; + total.t_free = vm_cnt.v_free_count + vm_cnt.v_cache_count; return (sysctl_handle_opaque(oidp, &total, sizeof(total), req)); } @@ -251,7 +251,7 @@ static int vcnt(SYSCTL_HANDLER_ARGS) { int count = *(int *)arg1; - int offset = (char *)arg1 - (char *)&cnt; + int offset = (char *)arg1 - (char *)&vm_cnt; int i; CPU_FOREACH(i) { @@ -273,7 +273,7 @@ SYSCTL_NODE(_vm_stats, OID_AUTO, misc, C #define VM_STATS(parent, var, descr) \ SYSCTL_PROC(parent, OID_AUTO, var, \ - CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, &cnt.var, 0, vcnt, \ + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, &vm_cnt.var, 0, vcnt, \ "IU", descr) #define VM_STATS_VM(var, descr) VM_STATS(_vm_stats_vm, var, descr) #define VM_STATS_SYS(var, descr) VM_STATS(_vm_stats_sys, var, descr) Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/vm/vm_mmap.c Sat Mar 22 10:26:09 2014 (r263620) @@ -1090,7 +1090,7 @@ vm_mlock(struct proc *proc, struct ucred return (ENOMEM); } PROC_UNLOCK(proc); - if (npages + cnt.v_wire_count > vm_page_max_wired) + if (npages + vm_cnt.v_wire_count > vm_page_max_wired) return (EAGAIN); #ifdef RACCT PROC_LOCK(proc); Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/vm/vm_object.c Sat Mar 22 10:26:09 2014 (r263620) @@ -1957,7 +1957,7 @@ again: ("inconsistent wire count %d %d %p", p->wire_count, wirings, p)); p->wire_count = 0; - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); } } vm_page_free(p); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Mar 22 09:23:13 2014 (r263619) +++ head/sys/vm/vm_page.c Sat Mar 22 10:26:09 2014 (r263620) @@ -209,9 +209,9 @@ vm_page_pa_tryrelock(pmap_t pmap, vm_pad void vm_set_page_size(void) { - if (cnt.v_page_size == 0) - cnt.v_page_size = PAGE_SIZE; - if (((cnt.v_page_size - 1) & cnt.v_page_size) != 0) + if (vm_cnt.v_page_size == 0) + vm_cnt.v_page_size = PAGE_SIZE; + if (((vm_cnt.v_page_size - 1) & vm_cnt.v_page_size) != 0) panic("vm_set_page_size: page size not a power of two"); } @@ -254,11 +254,11 @@ vm_page_domain_init(struct vm_domain *vm *__DECONST(char **, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_name) = "vm inactive pagequeue"; *__DECONST(int **, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_vcnt) = - &cnt.v_inactive_count; + &vm_cnt.v_inactive_count; *__DECONST(char **, &vmd->vmd_pagequeues[PQ_ACTIVE].pq_name) = "vm active pagequeue"; *__DECONST(int **, &vmd->vmd_pagequeues[PQ_ACTIVE].pq_vcnt) = - &cnt.v_active_count; + &vm_cnt.v_active_count; vmd->vmd_page_count = 0; vmd->vmd_free_count = 0; vmd->vmd_segs = 0; @@ -452,8 +452,8 @@ vm_page_startup(vm_offset_t vaddr) * Add every available physical page that is not blacklisted to * the free lists. */ - cnt.v_page_count = 0; - cnt.v_free_count = 0; + vm_cnt.v_page_count = 0; + vm_cnt.v_free_count = 0; list = getenv("vm.blacklist"); for (i = 0; phys_avail[i + 1] != 0; i += 2) { pa = phys_avail[i]; @@ -1339,7 +1339,7 @@ vm_page_cache_remove(vm_page_t m) ("vm_page_cache_remove: page %p is not cached", m)); vm_radix_remove(&m->object->cache, m->pindex); m->object = NULL; - cnt.v_cache_count--; + vm_cnt.v_cache_count--; } /* @@ -1482,11 +1482,11 @@ vm_page_alloc(vm_object_t object, vm_pin * vm_page_cache(). */ mtx_lock_flags(&vm_page_queue_free_mtx, MTX_RECURSE); - if (cnt.v_free_count + cnt.v_cache_count > cnt.v_free_reserved || + if (vm_cnt.v_free_count + vm_cnt.v_cache_count > vm_cnt.v_free_reserved || (req_class == VM_ALLOC_SYSTEM && - cnt.v_free_count + cnt.v_cache_count > cnt.v_interrupt_free_min) || + vm_cnt.v_free_count + vm_cnt.v_cache_count > vm_cnt.v_interrupt_free_min) || (req_class == VM_ALLOC_INTERRUPT && - cnt.v_free_count + cnt.v_cache_count > 0)) { + vm_cnt.v_free_count + vm_cnt.v_cache_count > 0)) { /* * Allocate from the free queue if the number of free pages * exceeds the minimum for the request class. @@ -1557,7 +1557,7 @@ vm_page_alloc(vm_object_t object, vm_pin KASSERT(m->valid != 0, ("vm_page_alloc: cached page %p is invalid", m)); if (m->object == object && m->pindex == pindex) - cnt.v_reactivated++; + vm_cnt.v_reactivated++; else m->valid = 0; m_object = m->object; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Mar 22 11:26:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3A03D01; Sat, 22 Mar 2014 11:26:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B63BA22E; Sat, 22 Mar 2014 11:26:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2MBQd1j072185; Sat, 22 Mar 2014 11:26:39 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2MBQdml072184; Sat, 22 Mar 2014 11:26:39 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201403221126.s2MBQdml072184@svn.freebsd.org> From: Kirk McKusick Date: Sat, 22 Mar 2014 11:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263628 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 11:26:40 -0000 Author: mckusick Date: Sat Mar 22 11:26:39 2014 New Revision: 263628 URL: http://svnweb.freebsd.org/changeset/base/263628 Log: Update comment to explain search order reverted to historical order in -r254996. Suggested by: Pedro Giffuni MFC: 3 days Modified: head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sat Mar 22 10:54:02 2014 (r263627) +++ head/sys/ufs/ffs/ffs_alloc.c Sat Mar 22 11:26:39 2014 (r263628) @@ -1167,16 +1167,17 @@ ffs_dirpref(pip) * We scan from our preferred cylinder group forward looking * for a cylinder group that meets our criterion. If we get * to the final cylinder group and do not find anything, - * we start scanning backwards from our preferred cylinder - * group. The ideal would be to alternate looking forward - * and backward, but that is just too complex to code for - * the gain it would get. The most likely place where the - * backward scan would take effect is when we start near - * the end of the filesystem and do not find anything from - * where we are to the end. In that case, scanning backward - * will likely find us a suitable cylinder group much closer - * to our desired location than if we were to start scanning - * forward from the beginning of the filesystem. + * we start scanning forwards from the beginning of the + * filesystem. While it might seem sensible to start scanning + * backwards or even to alternate looking forward and backward, + * this approach fails badly when the filesystem is nearly full. + * Specifically, we first search all the areas that have no space + * and finally try the one preceeding that. We repeat this on + * every request and in the case of the final block end up + * searching the entire filesystem. By jumping to the front + * of the filesystem, our future forward searches always look + * in new cylinder groups so finds every possible block after + * one pass over the filesystem. */ prefcg = ino_to_cg(fs, pip->i_number); for (cg = prefcg; cg < fs->fs_ncg; cg++) From owner-svn-src-head@FreeBSD.ORG Sat Mar 22 12:28:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74D63ED7; Sat, 22 Mar 2014 12:28:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 60C7493E; Sat, 22 Mar 2014 12:28:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2MCSM2D096789; Sat, 22 Mar 2014 12:28:22 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2MCSM4b096788; Sat, 22 Mar 2014 12:28:22 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201403221228.s2MCSM4b096788@svn.freebsd.org> From: Andrew Turner Date: Sat, 22 Mar 2014 12:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263631 - head/lib/libc/arm/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 12:28:22 -0000 Author: andrew Date: Sat Mar 22 12:28:21 2014 New Revision: 263631 URL: http://svnweb.freebsd.org/changeset/base/263631 Log: Implement __flt_rounds for ARMv6 hard-float. The fpscr register stores the current rounding mode used by the VFP unit. Modified: head/lib/libc/arm/gen/flt_rounds.c Modified: head/lib/libc/arm/gen/flt_rounds.c ============================================================================== --- head/lib/libc/arm/gen/flt_rounds.c Sat Mar 22 11:49:44 2014 (r263630) +++ head/lib/libc/arm/gen/flt_rounds.c Sat Mar 22 12:28:21 2014 (r263631) @@ -30,20 +30,32 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef __ARM_PCS_VFP #include "softfloat-for-gcc.h" #include "milieu.h" #include "softfloat.h" +#endif int __flt_rounds(void) { + int mode; -#ifndef ARM_HARD_FLOAT +#ifndef __ARM_PCS_VFP /* * Translate our rounding modes to the unnamed * manifest constants required by C99 et. al. */ - switch (__softfloat_float_rounding_mode) { + mode = __softfloat_float_rounding_mode; +#else /* __ARM_PCS_VFP */ + /* + * Read the floating-point status and control register + */ + __asm __volatile("vmrs %0, fpscr" : "=&r"(mode)); + mode &= _ROUND_MASK; +#endif /* __ARM_PCS_VFP */ + + switch (mode) { case FE_TOWARDZERO: return (0); case FE_TONEAREST: @@ -54,12 +66,4 @@ __flt_rounds(void) return (3); } return (-1); -#else /* ARM_HARD_FLOAT */ - /* - * Apparently, the rounding mode is specified as part of the - * instruction format on ARM, so the dynamic rounding mode is - * indeterminate. Some FPUs may differ. - */ - return (-1); -#endif /* ARM_HARD_FLOAT */ } From owner-svn-src-head@FreeBSD.ORG Sat Mar 22 13:06:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 946FB59F; Sat, 22 Mar 2014 13:06:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 812CFBCE; Sat, 22 Mar 2014 13:06:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2MD6XIL013084; Sat, 22 Mar 2014 13:06:33 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2MD6XrG013082; Sat, 22 Mar 2014 13:06:33 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201403221306.s2MD6XrG013082@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 22 Mar 2014 13:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263632 - in head/sys: boot/fdt/dts/mips mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 13:06:33 -0000 Author: bz Date: Sat Mar 22 13:06:32 2014 New Revision: 263632 URL: http://svnweb.freebsd.org/changeset/base/263632 Log: For BERI on NetFPGA assume HZ=100 by default. Remove the uart support in favour of a "jtag-uart" interface imitation providing a much simpler interface, directly exported to the host, allowing the toolchain to be shared with BERI on Altera. [1] Submitted by: Jong Hun HAN (jong.han cl.cam.ac.uk) [1] MFC after: 2 weeks Modified: head/sys/boot/fdt/dts/mips/beri-netfpga.dts head/sys/mips/conf/BERI_NETFPGA_MDROOT Modified: head/sys/boot/fdt/dts/mips/beri-netfpga.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beri-netfpga.dts Sat Mar 22 12:28:21 2014 (r263631) +++ head/sys/boot/fdt/dts/mips/beri-netfpga.dts Sat Mar 22 13:06:32 2014 (r263632) @@ -113,6 +113,14 @@ soft-interrupt-sources = <64>; }; + serial0: serial@7f000000 { + compatible = "altera,jtag_uart-11_0"; + reg = <0x7f000000 0x40>; + interrupts = <0>; + interrupt-parent = <&beripic>; + }; + +/* serial0: serial@7f002100 { compatible = "ns16550"; reg = <0x7f002100 0x20>; @@ -121,6 +129,7 @@ interrupts = <8>; interrupt-parent = <&beripic>; }; +*/ }; aliases { Modified: head/sys/mips/conf/BERI_NETFPGA_MDROOT ============================================================================== --- head/sys/mips/conf/BERI_NETFPGA_MDROOT Sat Mar 22 12:28:21 2014 (r263631) +++ head/sys/mips/conf/BERI_NETFPGA_MDROOT Sat Mar 22 13:06:32 2014 (r263632) @@ -10,11 +10,14 @@ include "BERI_TEMPLATE" ident BERI_NETFPGA_MDROOT +options HZ=100 + options FDT options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=beri-netfpga.dts -device uart +#device uart +device altera_jtag_uart # # This kernel configuration uses an embedded memory root file system. From owner-svn-src-head@FreeBSD.ORG Sat Mar 22 13:26:00 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D30507E1; Sat, 22 Mar 2014 13:26:00 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A16F5D14; Sat, 22 Mar 2014 13:26:00 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WRLvz-000BW6-HC; Sat, 22 Mar 2014 13:25:59 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s2MDPt9s073290; Sat, 22 Mar 2014 07:25:55 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/lfGRKiDO7k3ixk5gKqzv/ Subject: Re: svn commit: r263424 - head/sys/arm/conf From: Ian Lepore To: John-Mark Gurney In-Reply-To: <20140321190402.GT32089@funkthat.com> References: <201403201701.s2KH1L84024044@svn.freebsd.org> <20140321094316.76ccf459@bender.Home> <1395412070.81853.8.camel@revolution.hippie.lan> <20140321190402.GT32089@funkthat.com> Content-Type: text/plain; charset="us-ascii" Date: Sat, 22 Mar 2014 07:25:55 -0600 Message-ID: <1395494755.81853.38.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Ruslan Bukin , src-committers@FreeBSD.org, Andrew Turner X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 13:26:00 -0000 On Fri, 2014-03-21 at 12:04 -0700, John-Mark Gurney wrote: > Ian Lepore wrote this message on Fri, Mar 21, 2014 at 08:27 -0600: > > On Fri, 2014-03-21 at 09:43 +0000, Andrew Turner wrote: > > > On Thu, 20 Mar 2014 17:01:21 +0000 (UTC) > > > Ruslan Bukin wrote: > > > > > > > Author: br > > > > Date: Thu Mar 20 17:01:21 2014 > > > > New Revision: 263424 > > > > URL: http://svnweb.freebsd.org/changeset/base/263424 > > > > > > > > Log: > > > > Disable debugging by default. > > > > > > I don't like this on head. I have found a number of issues that were > > > hidden because the kernel config most people were using for development > > > had WITNESS, INVARIANTS and DIAGNOSTIC disabled. > > I agree... HEAD needs these to make sure they are production ready... > > > I disagree. Witness is essentially useless anymore, because there are > > so many known LORs that nobody cares about when you report them that all > > it does is spews noise. Maybe it's useful when you're looking for a > > particular problem, but leaving it on all the time has just lost its > > value. > > I wouldn't be tracking down an AVILA bug if it wasn't for INVARIANTS.. > > Also, your complaint is solely about WITNESS not the other ones... > > Considering how many people are writing new drivers for ARM, and might > be introducing locking issues w/ those new drivers, WITNESS should be > included, plus, if you disable INVARIANTS, it means that all the > lock assert functions will be turned off, and we might miss an odd > calling stack which doesn't hold a lock or something... > > If you're using HEAD for performance, it's easy to turn these off.. > My complaint is only about witness. But... about being easy to turn off... how do they get turned off on non-head branches? Does re@ really have to go grovel through 77 config files turning off diagnostic options? Do we have to handle that difference when merging things to stable branches? Last time I tried to put something into arm/conf/DEFAULTS I got my hand slapped, but... putting the diagnostic options in there on head and not on stable branches would make the "touch 77 config files" problem go away. -- Ian From owner-svn-src-head@FreeBSD.ORG Sat Mar 22 15:59:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8402E19A; Sat, 22 Mar 2014 15:59:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 71869B64; Sat, 22 Mar 2014 15:59:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2MFxJP1081687; Sat, 22 Mar 2014 15:59:19 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2MFxJnq081686; Sat, 22 Mar 2014 15:59:19 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201403221559.s2MFxJnq081686@svn.freebsd.org> From: Andrew Turner Date: Sat, 22 Mar 2014 15:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263637 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 15:59:19 -0000 Author: andrew Date: Sat Mar 22 15:59:18 2014 New Revision: 263637 URL: http://svnweb.freebsd.org/changeset/base/263637 Log: Simplify how we build MACHINE_ARCH. There are 3 options that may be set however only arm, armeb, armv6, and soon armv6hf will be used. Modified: head/sys/arm/include/param.h Modified: head/sys/arm/include/param.h ============================================================================== --- head/sys/arm/include/param.h Sat Mar 22 15:24:37 2014 (r263636) +++ head/sys/arm/include/param.h Sat Mar 22 15:59:18 2014 (r263637) @@ -52,23 +52,29 @@ #define __PCI_REROUTE_INTERRUPT -#ifndef MACHINE -#define MACHINE "arm" -#endif -#ifndef MACHINE_ARCH #if defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6) -#ifdef __ARMEB__ -#define MACHINE_ARCH "armv6eb" +#define _V6_SUFFIX "v6" #else -#define MACHINE_ARCH "armv6" +#define _V6_SUFFIX "" #endif + +#ifdef __ARM_PCS_VFP +#define _HF_SUFFIX "hf" #else +#define _HF_SUFFIX "" +#endif + #ifdef __ARMEB__ -#define MACHINE_ARCH "armeb" +#define _EB_SUFFIX "eb" #else -#define MACHINE_ARCH "arm" +#define _EB_SUFFIX "" #endif + +#ifndef MACHINE +#define MACHINE "arm" #endif +#ifndef MACHINE_ARCH +#define MACHINE_ARCH "arm" _V6_SUFFIX _HF_SUFFIX _EB_SUFFIX #endif #if defined(SMP) || defined(KLD_MODULE) From owner-svn-src-head@FreeBSD.ORG Sat Mar 22 15:59:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A3CC12CF; Sat, 22 Mar 2014 15:59:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 90CBEB65; Sat, 22 Mar 2014 15:59:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2MFxQfs081739; Sat, 22 Mar 2014 15:59:26 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2MFxQwQ081738; Sat, 22 Mar 2014 15:59:26 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403221559.s2MFxQwQ081738@svn.freebsd.org> From: Bryan Drewery Date: Sat, 22 Mar 2014 15:59:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263638 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 15:59:26 -0000 Author: bdrewery Date: Sat Mar 22 15:59:26 2014 New Revision: 263638 URL: http://svnweb.freebsd.org/changeset/base/263638 Log: Create a root dataset so that /root is outside of the boot environment. Discussed with: dteske on sysinstall@ MFC after: 1 month Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Sat Mar 22 15:59:18 2014 (r263637) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Sat Mar 22 15:59:26 2014 (r263638) @@ -129,6 +129,8 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATA # Home directories separated so they are common to all BEs /usr/home # NB: /home is a symlink to /usr/home + /root mountpoint=/root + # Ports tree /usr/ports compression=lz4,setuid=off From owner-svn-src-head@FreeBSD.ORG Sat Mar 22 17:28:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A2AACD9; Sat, 22 Mar 2014 17:28:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 732E32FE; Sat, 22 Mar 2014 17:28:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2MHSG7g018836; Sat, 22 Mar 2014 17:28:16 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2MHSEC4018825; Sat, 22 Mar 2014 17:28:14 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201403221728.s2MHSEC4018825@svn.freebsd.org> From: Baptiste Daroussin Date: Sat, 22 Mar 2014 17:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263648 - in head: contrib/libucl contrib/libucl/cmake contrib/libucl/doc contrib/libucl/include contrib/libucl/src contrib/libucl/tests contrib/libucl/tests/basic contrib/libucl/tests/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 17:28:16 -0000 Author: bapt Date: Sat Mar 22 17:28:14 2014 New Revision: 263648 URL: http://svnweb.freebsd.org/changeset/base/263648 Log: Update to 20140321 This brings schema validation MFC after: 1 week Added: head/contrib/libucl/Makefile.am - copied unchanged from r263647, vendor/libucl/dist/Makefile.am head/contrib/libucl/autogen.sh - copied unchanged from r263647, vendor/libucl/dist/autogen.sh head/contrib/libucl/cmake/ - copied from r263647, vendor/libucl/dist/cmake/ head/contrib/libucl/configure.ac - copied unchanged from r263647, vendor/libucl/dist/configure.ac head/contrib/libucl/doc/Makefile.am - copied unchanged from r263647, vendor/libucl/dist/doc/Makefile.am head/contrib/libucl/doc/libucl.3 - copied unchanged from r263647, vendor/libucl/dist/doc/libucl.3 head/contrib/libucl/doc/pandoc.template - copied unchanged from r263647, vendor/libucl/dist/doc/pandoc.template head/contrib/libucl/libucl.pc.in - copied unchanged from r263647, vendor/libucl/dist/libucl.pc.in head/contrib/libucl/src/Makefile.am - copied unchanged from r263647, vendor/libucl/dist/src/Makefile.am head/contrib/libucl/src/tree.h - copied unchanged from r263647, vendor/libucl/dist/src/tree.h head/contrib/libucl/src/ucl_schema.c - copied unchanged from r263647, vendor/libucl/dist/src/ucl_schema.c head/contrib/libucl/stamp-h.in - copied unchanged from r263647, vendor/libucl/dist/stamp-h.in head/contrib/libucl/tests/.gitignore - copied unchanged from r263647, vendor/libucl/dist/tests/.gitignore head/contrib/libucl/tests/Makefile.am - copied unchanged from r263647, vendor/libucl/dist/tests/Makefile.am head/contrib/libucl/tests/basic/ - copied from r263647, vendor/libucl/dist/tests/basic/ head/contrib/libucl/tests/basic.test - copied unchanged from r263647, vendor/libucl/dist/tests/basic.test head/contrib/libucl/tests/generate.test - copied unchanged from r263647, vendor/libucl/dist/tests/generate.test head/contrib/libucl/tests/schema/ - copied from r263647, vendor/libucl/dist/tests/schema/ head/contrib/libucl/tests/schema.test - copied unchanged from r263647, vendor/libucl/dist/tests/schema.test head/contrib/libucl/tests/speed.test - copied unchanged from r263647, vendor/libucl/dist/tests/speed.test head/contrib/libucl/tests/test_schema.c - copied unchanged from r263647, vendor/libucl/dist/tests/test_schema.c head/contrib/libucl/utils/Makefile.am - copied unchanged from r263647, vendor/libucl/dist/utils/Makefile.am Deleted: head/contrib/libucl/.gitignore head/contrib/libucl/tests/1.in head/contrib/libucl/tests/1.res head/contrib/libucl/tests/10.in head/contrib/libucl/tests/2.in head/contrib/libucl/tests/2.res head/contrib/libucl/tests/3.in head/contrib/libucl/tests/3.res head/contrib/libucl/tests/4.in head/contrib/libucl/tests/4.res head/contrib/libucl/tests/5.in head/contrib/libucl/tests/5.res head/contrib/libucl/tests/6.in head/contrib/libucl/tests/6.res head/contrib/libucl/tests/7.in head/contrib/libucl/tests/7.res head/contrib/libucl/tests/8.in head/contrib/libucl/tests/8.res head/contrib/libucl/tests/9-comment.inc head/contrib/libucl/tests/9-empty.inc head/contrib/libucl/tests/9.in head/contrib/libucl/tests/9.inc head/contrib/libucl/tests/9.res Modified: head/contrib/libucl/Makefile.unix head/contrib/libucl/Makefile.w32 head/contrib/libucl/README.md head/contrib/libucl/doc/api.md head/contrib/libucl/include/ucl.h head/contrib/libucl/src/ucl_emitter.c head/contrib/libucl/src/ucl_hash.c head/contrib/libucl/src/ucl_internal.h head/contrib/libucl/src/ucl_parser.c head/contrib/libucl/src/ucl_util.c head/contrib/libucl/tests/run_tests.sh head/contrib/libucl/tests/test_basic.c head/contrib/libucl/tests/test_speed.c head/lib/libucl/Makefile Directory Properties: head/contrib/libucl/ (props changed) Copied: head/contrib/libucl/Makefile.am (from r263647, vendor/libucl/dist/Makefile.am) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libucl/Makefile.am Sat Mar 22 17:28:14 2014 (r263648, copy of r263647, vendor/libucl/dist/Makefile.am) @@ -0,0 +1,7 @@ +ACLOCAL_AMFLAGS = -I m4 +EXTRA_DIST = uthash README.md + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libucl.pc + +SUBDIRS = src tests utils doc \ No newline at end of file Modified: head/contrib/libucl/Makefile.unix ============================================================================== --- head/contrib/libucl/Makefile.unix Sat Mar 22 17:25:01 2014 (r263647) +++ head/contrib/libucl/Makefile.unix Sat Mar 22 17:28:14 2014 (r263648) @@ -4,7 +4,7 @@ LD ?= gcc C_COMMON_FLAGS ?= -fPIC -Wall -W -Wno-unused-parameter -Wno-pointer-sign -I./include -I./uthash -I./src MAJOR_VERSION = 0 MINOR_VERSION = 2 -PATCH_VERSION = 8 +PATCH_VERSION = 9 VERSION = "$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)" SONAME = libucl.so SONAME_FULL = $(SONAME).$(MAJOR_VERSION) @@ -21,8 +21,17 @@ LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl LD_ADD ?= -lrt COPT_FLAGS ?= -O2 -HDEPS = $(SRCDIR)/ucl_hash.h $(SRCDIR)/ucl_chartable.h $(SRCDIR)/ucl_internal.h $(INCLUDEDIR)/ucl.h $(SRCDIR)/xxhash.h -OBJECTS = $(OBJDIR)/ucl_hash.o $(OBJDIR)/ucl_util.o $(OBJDIR)/ucl_parser.o $(OBJDIR)/ucl_emitter.o $(OBJDIR)/xxhash.o +HDEPS = $(SRCDIR)/ucl_hash.h \ + $(SRCDIR)/ucl_chartable.h \ + $(SRCDIR)/ucl_internal.h \ + $(INCLUDEDIR)/ucl.h \ + $(SRCDIR)/xxhash.h +OBJECTS = $(OBJDIR)/ucl_hash.o \ + $(OBJDIR)/ucl_util.o \ + $(OBJDIR)/ucl_parser.o \ + $(OBJDIR)/ucl_emitter.o \ + $(OBJDIR)/ucl_schema.o \ + $(OBJDIR)/xxhash.o all: $(OBJDIR) $(OBJDIR)/$(SONAME) @@ -44,11 +53,13 @@ $(OBJDIR)/ucl_emitter.o: $(SRCDIR)/ucl_e $(CC) -o $(OBJDIR)/ucl_emitter.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter.c $(OBJDIR)/ucl_hash.o: $(SRCDIR)/ucl_hash.c $(HDEPS) $(CC) -o $(OBJDIR)/ucl_hash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_hash.c +$(OBJDIR)/ucl_schema.o: $(SRCDIR)/ucl_schema.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_schema.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_schema.c $(OBJDIR)/xxhash.o: $(SRCDIR)/xxhash.c $(HDEPS) $(CC) -o $(OBJDIR)/xxhash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/xxhash.c clean: - $(RM) $(OBJDIR)/*.o $(OBJDIR)/$(SONAME_FULL) $(OBJDIR)/$(SONAME) $(OBJDIR)/chargen $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/objdump $(OBJDIR)/test_generate + $(RM) $(OBJDIR)/*.o $(OBJDIR)/$(SONAME_FULL) $(OBJDIR)/$(SONAME) $(OBJDIR)/chargen $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/objdump $(OBJDIR)/test_generate $(OBJDIR)/test_schema || true $(RMDIR) $(OBJDIR) # Utils @@ -60,13 +71,15 @@ objdump: utils/objdump.c $(OBJDIR)/$(SON # Tests -test: $(OBJDIR) $(OBJDIR)/$(SONAME) $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate +test: $(OBJDIR) $(OBJDIR)/$(SONAME) $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate $(OBJDIR)/test_schema run-test: test - TEST_DIR=$(TESTDIR) $(TESTDIR)/run_tests.sh $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate + TEST_DIR=$(TESTDIR) $(TESTDIR)/run_tests.sh $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate $(OBJDIR)/test_schema $(OBJDIR)/test_basic: $(TESTDIR)/test_basic.c $(OBJDIR)/$(SONAME) $(CC) -o $(OBJDIR)/test_basic $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_basic.c $(LD_UCL_FLAGS) +$(OBJDIR)/test_schema: $(TESTDIR)/test_schema.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/test_schema $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_schema.c $(LD_UCL_FLAGS) $(OBJDIR)/test_speed: $(TESTDIR)/test_speed.c $(OBJDIR)/$(SONAME) $(CC) -o $(OBJDIR)/test_speed $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_speed.c $(LD_UCL_FLAGS) $(LD_ADD) $(OBJDIR)/test_generate: $(TESTDIR)/test_generate.c $(OBJDIR)/$(SONAME) Modified: head/contrib/libucl/Makefile.w32 ============================================================================== --- head/contrib/libucl/Makefile.w32 Sat Mar 22 17:25:01 2014 (r263647) +++ head/contrib/libucl/Makefile.w32 Sat Mar 22 17:28:14 2014 (r263648) @@ -4,7 +4,7 @@ LD ?= gcc C_COMMON_FLAGS ?= -fPIC -Wall -W -Wno-unused-parameter -Wno-pointer-sign -I./include -I./uthash -I./src MAJOR_VERSION = 0 MINOR_VERSION = 2 -PATCH_VERSION = 8 +PATCH_VERSION = 9 VERSION = "$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)" SONAME = libucl.dll OBJDIR ?= .obj @@ -24,8 +24,17 @@ LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl LD_ADD ?= -lrt COPT_FLAGS ?= -O2 -HDEPS = $(SRCDIR)/ucl_hash.h $(SRCDIR)/ucl_chartable.h $(SRCDIR)/ucl_internal.h $(INCLUDEDIR)/ucl.h $(SRCDIR)/xxhash.h -OBJECTS = $(OBJDIR)/ucl_hash.o $(OBJDIR)/ucl_util.o $(OBJDIR)/ucl_parser.o $(OBJDIR)/ucl_emitter.o $(OBJDIR)/xxhash.o +HDEPS = $(SRCDIR)/ucl_hash.h \ + $(SRCDIR)/ucl_chartable.h \ + $(SRCDIR)/ucl_internal.h \ + $(INCLUDEDIR)/ucl.h \ + $(SRCDIR)/xxhash.h +OBJECTS = $(OBJDIR)/ucl_hash.o \ + $(OBJDIR)/ucl_util.o \ + $(OBJDIR)/ucl_parser.o \ + $(OBJDIR)/ucl_emitter.o \ + $(OBJDIR)/ucl_schema.o \ + $(OBJDIR)/xxhash.o all: $(OBJDIR) $(OBJDIR)/$(SONAME) @@ -44,6 +53,8 @@ $(OBJDIR)/ucl_emitter.o: $(SRCDIR)/ucl_e $(CC) -o $(OBJDIR)/ucl_emitter.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter.c $(OBJDIR)/ucl_hash.o: $(SRCDIR)/ucl_hash.c $(HDEPS) $(CC) -o $(OBJDIR)/ucl_hash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_hash.c +$(OBJDIR)/ucl_schema.o: $(SRCDIR)/ucl_schema.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_schema.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_schema.c $(OBJDIR)/xxhash.o: $(SRCDIR)/xxhash.c $(HDEPS) $(CC) -o $(OBJDIR)/xxhash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/xxhash.c Modified: head/contrib/libucl/README.md ============================================================================== --- head/contrib/libucl/README.md Sat Mar 22 17:25:01 2014 (r263647) +++ head/contrib/libucl/README.md Sat Mar 22 17:28:14 2014 (r263648) @@ -1,3 +1,26 @@ +# LIBUCL + +[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl) + +**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* + +- [Introduction](#introduction) +- [Basic structure](#basic-structure) +- [Improvements to the json notation](#improvements-to-the-json-notation) + - [General syntax sugar](#general-syntax-sugar) + - [Automatic arrays creation](#automatic-arrays-creation) + - [Named keys hierarchy](#named-keys-hierarchy) + - [Convenient numbers and booleans](#convenient-numbers-and-booleans) +- [General improvements](#general-improvements) + - [Commments](#commments) + - [Macros support](#macros-support) + - [Variables support](#variables-support) + - [Multiline strings](#multiline-strings) +- [Emitter](#emitter) +- [Validation](#validation) +- [Performance](#performance) +- [Conclusion](#conclusion) + ## Introduction This document describes the main features and principles of the configuration @@ -262,6 +285,10 @@ Each UCL object can be serialized to one * `Configuration` - nginx like notation; * `YAML` - yaml inlined notation. +## Validation + +UCL allows validation of objects. It uses the same schema that is used for json: [json schema v4](http://json-schema.org). UCL supports the full set of json schema with the exception of remote references. This feature is unlikely useful for configuration objects. Of course, schema definition can be in UCL format instead of JSON that sinplifies schemas writing. Moreover, since UCL supports multiple values for keys in an object it is possible to specify generic integer constraints `maxValues` and `minValues` to define the limits of values in a single key. UCL currently is not absolutely strict about validation schemas themselves, therefore UCL users should supply valid schemas (as it is defined in json-schema draft v4) to ensure that input is validated properly. + ## Performance Are UCL parser and emitter fast enough? Well, there are some numbers. Copied: head/contrib/libucl/autogen.sh (from r263647, vendor/libucl/dist/autogen.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libucl/autogen.sh Sat Mar 22 17:28:14 2014 (r263648, copy of r263647, vendor/libucl/dist/autogen.sh) @@ -0,0 +1,2 @@ +#!/bin/sh +autoreconf -i Copied: head/contrib/libucl/configure.ac (from r263647, vendor/libucl/dist/configure.ac) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libucl/configure.ac Sat Mar 22 17:28:14 2014 (r263648, copy of r263647, vendor/libucl/dist/configure.ac) @@ -0,0 +1,124 @@ +m4_define([maj_ver], [0]) +m4_define([med_ver], [3]) +m4_define([min_ver], [0]) +m4_define([so_version], [maj_ver:med_ver]) +m4_define([ucl_version], [maj_ver.med_ver.min_ver]) + +AC_INIT([libucl],[ucl_version],[https://github.com/vstakhov/libucl],[libucl]) +AC_CONFIG_SRCDIR([configure.ac]) +AM_INIT_AUTOMAKE([1.11 foreign silent-rules -Wall -Wportability no-dist-gzip dist-xz]) + +UCL_VERSION=ucl_version +SO_VERSION=so_version + +AC_SUBST(UCL_VERSION) +AC_SUBST(SO_VERSION) + +AC_PROG_CC_C99 +AM_PROG_CC_C_O +AM_PROG_AR +LT_INIT +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_HEADERS([config.h]) + +AC_C_CONST +AC_TYPE_SIZE_T + +AC_CHECK_HEADERS_ONCE([fcntl.h unistd.h]) +AC_TYPE_OFF_T +AC_FUNC_MMAP +AC_CHECK_HEADERS_ONCE([fcntl.h]) +AC_CHECK_HEADERS_ONCE([sys/types.h]) +AC_CHECK_HEADERS_ONCE([sys/stat.h]) +AC_CHECK_HEADERS_ONCE([sys/param.h]) +AC_CHECK_HEADERS_ONCE([sys/mman.h]) +AC_CHECK_HEADERS_ONCE([stdlib.h]) +AC_CHECK_HEADERS_ONCE([stddef.h]) +AC_CHECK_HEADERS_ONCE([stdarg.h]) +AC_CHECK_HEADERS_ONCE([stdbool.h]) +AC_CHECK_HEADERS_ONCE([stdint.h]) +AC_CHECK_HEADERS_ONCE([string.h]) +AC_CHECK_HEADERS_ONCE([unistd.h]) +AC_CHECK_HEADERS_ONCE([ctype.h]) +AC_CHECK_HEADERS_ONCE([errno.h]) +AC_CHECK_HEADERS_ONCE([limits.h]) +AC_CHECK_HEADERS_ONCE([libgen.h]) +AC_CHECK_HEADERS_ONCE([stdio.h]) +AC_CHECK_HEADERS_ONCE([float.h]) +AC_CHECK_HEADERS_ONCE([math.h]) + +dnl Example of default-disabled feature +AC_ARG_ENABLE([urls], AS_HELP_STRING([--enable-urls], [Enable URLs fetch (requires libfetch or libcurl)])) +AC_ARG_ENABLE([signatures], AS_HELP_STRING([--enable-signatures], + [Enable signatures check (requires openssl)])) +AC_ARG_ENABLE([utils], + [--enable-utils Build and install utils], + [case "${enableval}" in + yes) utils=true ;; + no) utils=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-utils]) ;; + esac],[utils=false]) +AM_CONDITIONAL([UTILS], [test x$utils = xtrue]) + +AS_IF([test "x$enable_signatures" = "xyes"], [ + AC_SEARCH_LIBS([EVP_MD_CTX_create], [crypto], [ + AC_DEFINE(HAVE_OPENSSL, 1, [Define to 1 if you have the 'crypto' library (-lcrypto).]) + LIBSSL_LIB="-lcrypto" + LIBS_EXTRA="${LIBS_EXTRA} -lcrypto" + ], [AC_MSG_ERROR([unable to find the EVP_MD_CTX_create() function])]) +]) + +AC_PATH_PROG(PANDOC, pandoc, [/non/existent]) + +AC_SEARCH_LIBS([clock_gettime], [rt], [], [ + AC_CHECK_HEADER([mach/mach_time.h], [ + AC_DEFINE(HAVE_MACH_MACH_TIME_H, 1, [Define to 1 on Darwin]) + ], [AC_MSG_ERROR([unable to find clock_gettime or mach_absolute_time])]) +]) +AC_SEARCH_LIBS([remainder], [m], [], [AC_MSG_ERROR([unable to find remainder() function])]) + +AC_CHECK_HEADER([regex.h], [ + AC_DEFINE(HAVE_REGEX_H, 1, [Define to 1 if you have the header file.]) + ], + [AC_MSG_ERROR([unable to find the regex.h header])], + [#include ]) + +AS_IF([test "x$enable_urls" = "xyes"], [ + AC_CHECK_HEADER([fetch.h], [ + AC_DEFINE(HAVE_FETCH_H, 1, [Define to 1 if you have the header file.]) + AC_CHECK_LIB(fetch, fetchXGet, [ + AC_DEFINE(HAVE_LIBFETCH, 1, [Define to 1 if you have the 'fetch' library (-lfetch).]) + LIBFETCH_LIBS="-lfetch" + have_libfetch="yes" + LIBS_EXTRA="${LIBS_EXTRA} -lfetch" + ]) + ], [],[ + #include + #ifdef HAVE_SYS_PARAM_H + #include + #endif + ]) + AC_SUBST(LIBFETCH_LIBS) + + AS_IF([ test "x$have_libfetch" != "xyes"], [ + dnl Fallback to libcurl + PKG_CHECK_MODULES([CURL], [libcurl], [ + AC_DEFINE(CURL_FOUND, 1, [Use libcurl]) + LIBS_EXTRA="${LIBS_EXTRA} -lcurl"], + [AC_MSG_ERROR([unable to find neither libfetch nor libcurl])]) + ]) + AC_SUBST(CURL_FOUND) + AC_SUBST(CURL_LIBS) + AC_SUBST(CURL_CFLAGS) +]) + +AC_SUBST(LIBS_EXTRA) + +AC_CONFIG_FILES(Makefile \ + src/Makefile \ + tests/Makefile \ + utils/Makefile \ + doc/Makefile \ + libucl.pc) +AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) +AC_OUTPUT Copied: head/contrib/libucl/doc/Makefile.am (from r263647, vendor/libucl/dist/doc/Makefile.am) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libucl/doc/Makefile.am Sat Mar 22 17:28:14 2014 (r263648, copy of r263647, vendor/libucl/dist/doc/Makefile.am) @@ -0,0 +1,8 @@ +EXTRA_DIST = api.md + +dist_man_MANS = libucl.3 + +gen-man: @PANDOC@ + tail -n +$$(grep -n '# Synopsis' api.md | cut -d':' -f1) api.md | \ + cat pandoc.template - | sed -e 's/^# \(.*\)/# \U\1/' | \ + @PANDOC@ -s -f markdown -t man -o libucl.3 \ No newline at end of file Modified: head/contrib/libucl/doc/api.md ============================================================================== --- head/contrib/libucl/doc/api.md Sat Mar 22 17:25:01 2014 (r263647) +++ head/contrib/libucl/doc/api.md Sat Mar 22 17:28:14 2014 (r263648) @@ -1,30 +1,75 @@ -Synopsis -======== +# API documentation + +**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* + +- [Synopsis](#synopsis) +- [Description](#description) + - [Parser functions](#parser-functions) + - [Emitting functions](#emitting-functions) + - [Conversion functions](#conversion-functions) + - [Generation functions](#generation-functions) + - [Iteration functions](#iteration-functions) + - [Validation functions](#validation-functions) + - [Utility functions](#utility-functions) +- [Parser functions](#parser-functions-1) + - [ucl_parser_new](#ucl_parser_new) + - [ucl_parser_register_macro](#ucl_parser_register_macro) + - [ucl_parser_register_variable](#ucl_parser_register_variable) + - [ucl_parser_add_chunk](#ucl_parser_add_chunk) + - [ucl_parser_add_string](#ucl_parser_add_string) + - [ucl_parser_add_file](#ucl_parser_add_file) + - [ucl_parser_get_object](#ucl_parser_get_object) + - [ucl_parser_get_error](#ucl_parser_get_error) + - [ucl_parser_free](#ucl_parser_free) + - [ucl_pubkey_add](#ucl_pubkey_add) + - [ucl_parser_set_filevars](#ucl_parser_set_filevars) + - [Parser usage example](#parser-usage-example) +- [Emitting functions](#emitting-functions-1) + - [ucl_object_emit](#ucl_object_emit) + - [ucl_object_emit_full](#ucl_object_emit_full) +- [Conversion functions](#conversion-functions-1) +- [Generation functions](#generation-functions-1) + - [ucl_object_new](#ucl_object_new) + - [ucl_object_typed_new](#ucl_object_typed_new) + - [Primitive objects generation](#primitive-objects-generation) + - [ucl_object_fromstring_common](#ucl_object_fromstring_common) +- [Iteration functions](#iteration-functions-1) + - [ucl_iterate_object](#ucl_iterate_object) +- [Validation functions](#validation-functions-1) + - [ucl_object_validate](#ucl_object_validate) + +# Synopsis `#include ` -Description -=========== +# Description Libucl is a parser and `C` API to parse and generate `ucl` objects. Libucl consist of several groups of functions: ### Parser functions -Used to parse `ucl` files and provide interface to extract `ucl` object +Used to parse `ucl` files and provide interface to extract `ucl` object. Currently, `libucl` can parse only full `ucl` documents, for instance, it is impossible to parse a part of document and therefore it is impossible to use `libucl` as a streaming parser. In future, this limitation can be removed. ### Emitting functions -Convert `ucl` objects to some textual or binary representation. +Convert `ucl` objects to some textual or binary representation. Currently, libucl supports the following exports: + +- `JSON` - valid json format (can possibly loose some original data, such as implicit arrays) +- `Config` - human-readable configuration format (losseless) +- `YAML` - embedded yaml format (has the same limitations as `json` output) ### Conversion functions -Help to convert `ucl` objects to C types +Help to convert `ucl` objects to C types. These functions are used to convert `ucl_object_t` to C primitive types, such as numbers, strings or boolean values. ### Generation functions -Allow creating of `ucl` objects from C types +Allow creating of `ucl` objects from C types and creating of complex `ucl` objects, such as hashes or arrays from primitive `ucl` objects, such as numbers or strings. ### Iteration functions -Iterate over `ucl` objects +Iterate over `ucl` complex objects or over a chain of values, for example when a key in an object has multiple values (that can be treated as implicit array or implicit consolidation). + +### Validation functions +Validation functions are used to validate some object `obj` using json-schema compatible object `schema`. Both input and schema must be UCL objects to perform validation. ### Utility functions -Provide basic utilities to manage `ucl` objects +Provide basic utilities to manage `ucl` objects: creating, removing, retaining and releasing reference count and so on. # Parser functions @@ -40,6 +85,7 @@ Creates new parser with the specified fl - `UCL_PARSER_KEY_LOWERCASE` - lowercase keys parsed - `UCL_PARSER_ZEROCOPY` - try to use zero-copy mode when reading files (in zero-copy mode text chunk being parsed without copying strings so it should exist till any object parsed is used) +- `UCL_PARSER_NO_TIME` - treat time values as strings without parsing them as floats ### ucl_parser_register_macro @@ -87,6 +133,14 @@ while this one won't be parsed correctly This limitation may possible be removed in future. +### ucl_parser_add_string +~~~C +bool ucl_parser_add_string (struct ucl_parser *parser, + const char *data, size_t len); +~~~ + +This function acts exactly like `ucl_parser_add_chunk` does but if `len` argument is zero, then the string `data` must be zero-terminated and the actual length is calculated up to `\0` character. + ### ucl_parser_add_file ~~~C @@ -314,13 +368,14 @@ This function is used to convert a strin - `UCL_STRING_PARSE_BOOLEAN` - parse passed string and detect boolean - `UCL_STRING_PARSE_INT` - parse passed string and detect integer number - `UCL_STRING_PARSE_DOUBLE` - parse passed string and detect integer or float number -- `UCL_STRING_PARSE_NUMBER` - parse passed string and detect number (both float or integer types) -- `UCL_STRING_PARSE` - parse passed string (and detect booleans and numbers) +- `UCL_STRING_PARSE_TIME` - parse time values as floating point numbers +- `UCL_STRING_PARSE_NUMBER` - parse passed string and detect number (both float, integer and time types) +- `UCL_STRING_PARSE` - parse passed string (and detect booleans, numbers and time values) - `UCL_STRING_PARSE_BYTES` - assume that numeric multipliers are in bytes notation, for example `10k` means `10*1024` and not `10*1000` as assumed without this flag If parsing operations fail then the resulting UCL object will be a `UCL_STRING`. A caller should always check the type of the returned object and release it after using. -# Iteration function +# Iteration functions Iteration are used to iterate over UCL compound types: arrays and objects. Moreover, iterations could be performed over the keys with multiple values (implicit arrays). To iterate over an object, an array or a key with multiple values there is a function `ucl_iterate_object`. @@ -345,4 +400,40 @@ while ((obj = ucl_iterate_object (top, & ucl_object_tostring_forced (cur)); } } -~~~ \ No newline at end of file +~~~ + +# Validation functions + +Currently, there is only one validation function called `ucl_object_validate`. It performs validation of object using the specified schema. This function is defined as following: + +## ucl_object_validate +~~~C +bool ucl_object_validate (ucl_object_t *schema, + ucl_object_t *obj, struct ucl_schema_error *err); +~~~ + +This function uses ucl object `schema`, that must be valid in terms of `json-schema` draft v4, to validate input object `obj`. If this function returns `true` then validation procedure has been succeed. Otherwise, `false` is returned and `err` is set to a specific value. If caller set `err` to NULL then this function does not set any error just returning `false`. Error is the structure defined as following: + +~~~C +struct ucl_schema_error { + enum ucl_schema_error_code code; /* error code */ + char msg[128]; /* error message */ + ucl_object_t *obj; /* object where error occured */ +}; +~~~ + +Caller may use `code` field to get a numeric error code: + +~~~C +enum ucl_schema_error_code { + UCL_SCHEMA_OK = 0, /* no error */ + UCL_SCHEMA_TYPE_MISMATCH, /* type of object is incorrect */ + UCL_SCHEMA_INVALID_SCHEMA, /* schema is invalid */ + UCL_SCHEMA_MISSING_PROPERTY,/* missing properties */ + UCL_SCHEMA_CONSTRAINT, /* constraint found */ + UCL_SCHEMA_MISSING_DEPENDENCY, /* missing dependency */ + UCL_SCHEMA_UNKNOWN /* generic error */ +}; +~~~ + +`msg` is a stiring description of an error and `obj` is an object where error has been occurred. Error object is not allocated by libucl, so there is no need to free it after validation (a static object should thus be used). \ No newline at end of file Copied: head/contrib/libucl/doc/libucl.3 (from r263647, vendor/libucl/dist/doc/libucl.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libucl/doc/libucl.3 Sat Mar 22 17:28:14 2014 (r263648, copy of r263647, vendor/libucl/dist/doc/libucl.3) @@ -0,0 +1,634 @@ +.TH LIBUCL 5 "March 20, 2014" "Libucl manual" +.SH NAME +.PP +\f[B]ucl_parser_new\f[], \f[B]ucl_parser_register_macro\f[], +\f[B]ucl_parser_register_variable\f[], \f[B]ucl_parser_add_chunk\f[], +\f[B]ucl_parser_add_string\f[], \f[B]ucl_parser_add_file\f[], +\f[B]ucl_parser_get_object\f[], \f[B]ucl_parser_get_error\f[], +\f[B]ucl_parser_free\f[], \f[B]ucl_pubkey_add\f[], +\f[B]ucl_parser_set_filevars\f[] - universal configuration library +parser and utility functions +.SH LIBRARY +.PP +UCL library (libucl, -lucl) +.SH SYNOPSIS +.PP +\f[C]#include\ \f[] +.SH DESCRIPTION +.PP +Libucl is a parser and \f[C]C\f[] API to parse and generate \f[C]ucl\f[] +objects. +Libucl consist of several groups of functions: +.SS Parser functions +.PP +Used to parse \f[C]ucl\f[] files and provide interface to extract +\f[C]ucl\f[] object. +Currently, \f[C]libucl\f[] can parse only full \f[C]ucl\f[] documents, +for instance, it is impossible to parse a part of document and therefore +it is impossible to use \f[C]libucl\f[] as a streaming parser. +In future, this limitation can be removed. +.SS Emitting functions +.PP +Convert \f[C]ucl\f[] objects to some textual or binary representation. +Currently, libucl supports the following exports: +.IP \[bu] 2 +\f[C]JSON\f[] - valid json format (can possibly loose some original +data, such as implicit arrays) +.IP \[bu] 2 +\f[C]Config\f[] - human-readable configuration format (losseless) +.IP \[bu] 2 +\f[C]YAML\f[] - embedded yaml format (has the same limitations as +\f[C]json\f[] output) +.SS Conversion functions +.PP +Help to convert \f[C]ucl\f[] objects to C types. +These functions are used to convert \f[C]ucl_object_t\f[] to C primitive +types, such as numbers, strings or boolean values. +.SS Generation functions +.PP +Allow creating of \f[C]ucl\f[] objects from C types and creating of +complex \f[C]ucl\f[] objects, such as hashes or arrays from primitive +\f[C]ucl\f[] objects, such as numbers or strings. +.SS Iteration functions +.PP +Iterate over \f[C]ucl\f[] complex objects or over a chain of values, for +example when a key in an object has multiple values (that can be treated +as implicit array or implicit consolidation). +.SS Validation functions +.PP +Validation functions are used to validate some object \f[C]obj\f[] using +json-schema compatible object \f[C]schema\f[]. +Both input and schema must be UCL objects to perform validation. +.SS Utility functions +.PP +Provide basic utilities to manage \f[C]ucl\f[] objects: creating, +removing, retaining and releasing reference count and so on. +.SH PARSER FUNCTIONS +.PP +Parser functions operates with \f[C]struct\ ucl_parser\f[]. +.SS ucl_parser_new +.IP +.nf +\f[C] +struct\ ucl_parser*\ ucl_parser_new\ (int\ flags); +\f[] +.fi +.PP +Creates new parser with the specified flags: +.IP \[bu] 2 +\f[C]UCL_PARSER_KEY_LOWERCASE\f[] - lowercase keys parsed +.IP \[bu] 2 +\f[C]UCL_PARSER_ZEROCOPY\f[] - try to use zero-copy mode when reading +files (in zero-copy mode text chunk being parsed without copying strings +so it should exist till any object parsed is used) +.IP \[bu] 2 +\f[C]UCL_PARSER_NO_TIME\f[] - treat time values as strings without +parsing them as floats +.SS ucl_parser_register_macro +.IP +.nf +\f[C] +void\ ucl_parser_register_macro\ (struct\ ucl_parser\ *parser, +\ \ \ \ const\ char\ *macro,\ ucl_macro_handler\ handler,\ void*\ ud); +\f[] +.fi +.PP +Register new macro with name .\f[C]macro\f[] parsed by handler +\f[C]handler\f[] that accepts opaque data pointer \f[C]ud\f[]. +Macro handler should be of the following type: +.IP +.nf +\f[C] +bool\ (*ucl_macro_handler)\ (const\ unsigned\ char\ *data, +\ \ \ \ size_t\ len,\ void*\ ud);` +\f[] +.fi +.PP +Handler function accepts macro text \f[C]data\f[] of length \f[C]len\f[] +and the opaque pointer \f[C]ud\f[]. +If macro is parsed successfully the handler should return \f[C]true\f[]. +\f[C]false\f[] indicates parsing failure and the parser can be +terminated. +.SS ucl_parser_register_variable +.IP +.nf +\f[C] +void\ ucl_parser_register_variable\ (struct\ ucl_parser\ *parser, +\ \ \ \ const\ char\ *var,\ const\ char\ *value); +\f[] +.fi +.PP +Register new variable $\f[C]var\f[] that should be replaced by the +parser to the \f[C]value\f[] string. +.SS ucl_parser_add_chunk +.IP +.nf +\f[C] +bool\ ucl_parser_add_chunk\ (struct\ ucl_parser\ *parser,\ +\ \ \ \ const\ unsigned\ char\ *data,\ size_t\ len); +\f[] +.fi +.PP +Add new text chunk with \f[C]data\f[] of length \f[C]len\f[] to the +parser. +At the moment, \f[C]libucl\f[] parser is not a streamlined parser and +chunk \f[I]must\f[] contain the \f[I]valid\f[] ucl object. +For example, this object should be valid: +.IP +.nf +\f[C] +{\ "var":\ "value"\ } +\f[] +.fi +.PP +while this one won\[aq]t be parsed correctly: +.IP +.nf +\f[C] +{\ "var":\ +\f[] +.fi +.PP +This limitation may possible be removed in future. +.SS ucl_parser_add_string +.IP +.nf +\f[C] +bool\ ucl_parser_add_string\ (struct\ ucl_parser\ *parser,\ +\ \ \ \ const\ char\ *data,\ size_t\ len); +\f[] +.fi +.PP +This function acts exactly like \f[C]ucl_parser_add_chunk\f[] does but +if \f[C]len\f[] argument is zero, then the string \f[C]data\f[] must be +zero-terminated and the actual length is calculated up to \f[C]\\0\f[] +character. +.SS ucl_parser_add_file +.IP +.nf +\f[C] +bool\ ucl_parser_add_file\ (struct\ ucl_parser\ *parser,\ +\ \ \ \ const\ char\ *filename); +\f[] +.fi +.PP +Load file \f[C]filename\f[] and parse it with the specified +\f[C]parser\f[]. +This function uses \f[C]mmap\f[] call to load file, therefore, it should +not be \f[C]shrinked\f[] during parsing. +Otherwise, \f[C]libucl\f[] can cause memory corruption and terminate the +calling application. +This function is also used by the internal handler of \f[C]include\f[] +macro, hence, this macro has the same limitation. +.SS ucl_parser_get_object +.IP +.nf +\f[C] +ucl_object_t*\ ucl_parser_get_object\ (struct\ ucl_parser\ *parser); +\f[] +.fi +.PP +If the \f[C]ucl\f[] data has been parsed correctly this function returns +the top object for the parser. +Otherwise, this function returns the \f[C]NULL\f[] pointer. +The reference count for \f[C]ucl\f[] object returned is increased by +one, therefore, a caller should decrease reference by using +\f[C]ucl_object_unref\f[] to free object after usage. +.SS ucl_parser_get_error +.IP +.nf +\f[C] +const\ char\ *ucl_parser_get_error(struct\ ucl_parser\ *parser); +\f[] +.fi +.PP +Returns the constant error string for the parser object. +If no error occurred during parsing a \f[C]NULL\f[] object is returned. +A caller should not try to free or modify this string. +.SS ucl_parser_free +.IP +.nf +\f[C] +void\ ucl_parser_free\ (struct\ ucl_parser\ *parser); +\f[] +.fi +.PP +Frees memory occupied by the parser object. +The reference count for top object is decreased as well, however if the +function \f[C]ucl_parser_get_object\f[] was called previously then the +top object won\[aq]t be freed. +.SS ucl_pubkey_add +.IP +.nf +\f[C] +bool\ ucl_pubkey_add\ (struct\ ucl_parser\ *parser,\ +\ \ \ \ const\ unsigned\ char\ *key,\ size_t\ len); +\f[] +.fi +.PP +This function adds a public key from text blob \f[C]key\f[] of length +\f[C]len\f[] to the \f[C]parser\f[] object. +This public key should be in the \f[C]PEM\f[] format and can be used by +\f[C].includes\f[] macro for checking signatures of files included. +\f[C]Openssl\f[] support should be enabled to make this function +working. +If a key cannot be added (e.g. +due to format error) or \f[C]openssl\f[] was not linked to +\f[C]libucl\f[] then this function returns \f[C]false\f[]. +.SS ucl_parser_set_filevars +.IP +.nf +\f[C] +bool\ ucl_parser_set_filevars\ (struct\ ucl_parser\ *parser,\ +\ \ \ \ const\ char\ *filename,\ bool\ need_expand); +\f[] +.fi +.PP +Add the standard file variables to the \f[C]parser\f[] based on the +\f[C]filename\f[] specified: +.IP \[bu] 2 +\f[C]$FILENAME\f[] - a filename of \f[C]ucl\f[] input +.IP \[bu] 2 +\f[C]$CURDIR\f[] - a current directory of the input +.PP +For example, if a \f[C]filename\f[] param is \f[C]../something.conf\f[] +then the variables will have the following values: +.IP \[bu] 2 +\f[C]$FILENAME\f[] - "../something.conf" +.IP \[bu] 2 +\f[C]$CURDIR\f[] - ".." +.PP +if \f[C]need_expand\f[] parameter is \f[C]true\f[] then all relative +paths are expanded using \f[C]realpath\f[] call. +In this example if \f[C]..\f[] is \f[C]/etc/dir\f[] then variables will +have these values: +.IP \[bu] 2 +\f[C]$FILENAME\f[] - "/etc/something.conf" +.IP \[bu] 2 +\f[C]$CURDIR\f[] - "/etc" +.SS Parser usage example +.PP +The following example loads, parses and extracts \f[C]ucl\f[] object +from stdin using \f[C]libucl\f[] parser functions (the length of input +is limited to 8K): +.IP +.nf +\f[C] +char\ inbuf[8192]; +struct\ ucl_parser\ *parser\ =\ NULL; +int\ ret\ =\ 0,\ r\ =\ 0; +ucl_object_t\ *obj\ =\ NULL; +FILE\ *in; + +in\ =\ stdin; +parser\ =\ ucl_parser_new\ (0); +while\ (!feof\ (in)\ &&\ r\ <\ (int)sizeof\ (inbuf))\ { +\ \ \ \ r\ +=\ fread\ (inbuf\ +\ r,\ 1,\ sizeof\ (inbuf)\ -\ r,\ in); +} +ucl_parser_add_chunk\ (parser,\ inbuf,\ r); +fclose\ (in); + +if\ (ucl_parser_get_error\ (parser))\ { +\ \ \ \ printf\ ("Error\ occured:\ %s\\n",\ ucl_parser_get_error\ (parser)); +\ \ \ \ ret\ =\ 1; +} +else\ { +\ \ \ \ obj\ =\ ucl_parser_get_object\ (parser); +} + +if\ (parser\ !=\ NULL)\ { +\ \ \ \ ucl_parser_free\ (parser); +} +if\ (obj\ !=\ NULL)\ { +\ \ \ \ ucl_object_unref\ (obj); +} +return\ ret; +\f[] +.fi +.SH EMITTING FUNCTIONS +.PP +Libucl can transform UCL objects to a number of tectual formats: +.IP \[bu] 2 +configuration (\f[C]UCL_EMIT_CONFIG\f[]) - nginx like human readable +configuration file where implicit arrays are transformed to the +duplicate keys +.IP \[bu] 2 +compact json: \f[C]UCL_EMIT_JSON_COMPACT\f[] - single line valid json +without spaces +.IP \[bu] 2 +formatted json: \f[C]UCL_EMIT_JSON\f[] - pretty formatted JSON with +newlines and spaces +.IP \[bu] 2 +compact yaml: \f[C]UCL_EMIT_YAML\f[] - compact YAML output +.PP +Moreover, libucl API allows to select a custom set of emitting functions +allowing efficent and zero-copy output of libucl objects. +Libucl uses the following structure to support this feature: +.IP +.nf +\f[C] +struct\ ucl_emitter_functions\ { +\ \ \ \ /**\ Append\ a\ single\ character\ */ +\ \ \ \ int\ (*ucl_emitter_append_character)\ (unsigned\ char\ c,\ size_t\ nchars,\ void\ *ud); +\ \ \ \ /**\ Append\ a\ string\ of\ a\ specified\ length\ */ +\ \ \ \ int\ (*ucl_emitter_append_len)\ (unsigned\ const\ char\ *str,\ size_t\ len,\ void\ *ud); +\ \ \ \ /**\ Append\ a\ 64\ bit\ integer\ */ +\ \ \ \ int\ (*ucl_emitter_append_int)\ (int64_t\ elt,\ void\ *ud); +\ \ \ \ /**\ Append\ floating\ point\ element\ */ +\ \ \ \ int\ (*ucl_emitter_append_double)\ (double\ elt,\ void\ *ud); +\ \ \ \ /**\ Opaque\ userdata\ pointer\ */ +\ \ \ \ void\ *ud; +}; +\f[] +.fi +.PP +This structure defines the following callbacks: +.IP \[bu] 2 +\f[C]ucl_emitter_append_character\f[] - a function that is called to +append \f[C]nchars\f[] characters equal to \f[C]c\f[] +.IP \[bu] 2 +\f[C]ucl_emitter_append_len\f[] - used to append a string of length +\f[C]len\f[] starting from pointer \f[C]str\f[] +.IP \[bu] 2 +\f[C]ucl_emitter_append_int\f[] - this function applies to integer +numbers +.IP \[bu] 2 +\f[C]ucl_emitter_append_double\f[] - this function is intended to output +floating point variable +.PP +The set of these functions could be used to output text formats of +\f[C]UCL\f[] objects to different structures or streams. +.PP +Libucl provides the following functions for emitting UCL objects: +.SS ucl_object_emit +.IP +.nf +\f[C] +unsigned\ char\ *ucl_object_emit\ (ucl_object_t\ *obj,\ enum\ ucl_emitter\ emit_type); +\f[] +.fi +.PP +Allocate a string that is suitable to fit the underlying UCL object +\f[C]obj\f[] and fill it with the textual representation of the object +\f[C]obj\f[] according to style \f[C]emit_type\f[]. +The caller should free the returned string after using. +.SS ucl_object_emit_full +.IP +.nf +\f[C] +bool\ ucl_object_emit_full\ (ucl_object_t\ *obj,\ enum\ ucl_emitter\ emit_type, +\ \ \ \ \ \ \ \ struct\ ucl_emitter_functions\ *emitter); +\f[] +.fi +.PP +This function is similar to the previous with the exception that it +accepts the additional argument \f[C]emitter\f[] that defines the +concrete set of output functions. +This emit function could be useful for custom structures or streams +emitters (including C++ ones, for example). +.SH CONVERSION FUNCTIONS +.PP +Conversion functions are used to convert UCL objects to primitive types, +such as strings, numbers or boolean values. +There are two types of conversion functions: +.IP \[bu] 2 +safe: try to convert an ucl object to a primitive type and fail if such +a conversion is not possible +.IP \[bu] 2 +unsafe: return primitive type without additional checks, if the object +cannot be converted then some reasonable default is returned (NULL for +strings and 0 for numbers) +.PP +Also there is a single \f[C]ucl_object_tostring_forced\f[] function that +converts any UCL object (including compound types - arrays and objects) +to a string representation. +For compound and numeric types this function performs emitting to a +compact json format actually. +.PP +Here is a list of all conversion functions: +.IP \[bu] 2 +\f[C]ucl_object_toint\f[] - returns \f[C]int64_t\f[] of UCL object +.IP \[bu] 2 +\f[C]ucl_object_todouble\f[] - returns \f[C]double\f[] of UCL object +.IP \[bu] 2 +\f[C]ucl_object_toboolean\f[] - returns \f[C]bool\f[] of UCL object +.IP \[bu] 2 +\f[C]ucl_object_tostring\f[] - returns \f[C]const\ char\ *\f[] of UCL +object (this string is NULL terminated) +.IP \[bu] 2 +\f[C]ucl_object_tolstring\f[] - returns \f[C]const\ char\ *\f[] and +\f[C]size_t\f[] len of UCL object (string can be not NULL terminated) +.IP \[bu] 2 +\f[C]ucl_object_tostring_forced\f[] - returns string representation of +any UCL object +.PP +Strings returned by these pointers are associated with the UCL object +and exist over its lifetime. +A caller should not free this memory. +.SH GENERATION FUNCTIONS +.PP +It is possible to generate UCL objects from C primitive types. +Moreover, libucl permits to create and modify complex UCL objects, such +as arrays or associative objects. +.SS ucl_object_new +.IP +.nf +\f[C] +ucl_object_t\ *\ ucl_object_new\ (void) +\f[] +.fi +.PP +Creates new object of type \f[C]UCL_NULL\f[]. +This object should be released by caller. +.SS ucl_object_typed_new +.IP +.nf +\f[C] +ucl_object_t\ *\ ucl_object_typed_new\ (unsigned\ int\ type) +\f[] +.fi +.PP +Create an object of a specified type: - \f[C]UCL_OBJECT\f[] - UCL object +- key/value pairs - \f[C]UCL_ARRAY\f[] - UCL array - \f[C]UCL_INT\f[] - +integer number - \f[C]UCL_FLOAT\f[] - floating point number - +\f[C]UCL_STRING\f[] - NULL terminated string - \f[C]UCL_BOOLEAN\f[] - +boolean value - \f[C]UCL_TIME\f[] - time value (floating point number of +seconds) - \f[C]UCL_USERDATA\f[] - opaque userdata pointer (may be used +in macros) - \f[C]UCL_NULL\f[] - null value +.PP +This object should be released by caller. +.SS Primitive objects generation +.PP +Libucl provides the functions similar to inverse conversion functions +called with the specific C type: - \f[C]ucl_object_fromint\f[] - +converts \f[C]int64_t\f[] to UCL object - \f[C]ucl_object_fromdouble\f[] +- converts \f[C]double\f[] to UCL object - +\f[C]ucl_object_fromboolean\f[] - converts \f[C]bool\f[] to UCL object - +\f[C]ucl_object_fromstring\f[] - converts \f[C]const\ char\ *\f[] to UCL +object (this string is NULL terminated) - +\f[C]ucl_object_fromlstring\f[] - converts \f[C]const\ char\ *\f[] and +\f[C]size_t\f[] len to UCL object (string can be not NULL terminated) +.PP +Also there is a function to generate UCL object from a string performing +various parsing or conversion operations called +\f[C]ucl_object_fromstring_common\f[]. +.SS ucl_object_fromstring_common +.IP +.nf +\f[C] +ucl_object_t\ *\ ucl_object_fromstring_common\ (const\ char\ *str,\ +\ \ \ \ size_t\ len,\ enum\ ucl_string_flags\ flags) +\f[] +.fi +.PP +This function is used to convert a string \f[C]str\f[] of size +\f[C]len\f[] to an UCL objects applying \f[C]flags\f[] conversions. +If \f[C]len\f[] is equal to zero then a \f[C]str\f[] is assumed as +NULL-terminated. +This function supports the following flags (a set of flags can be +specified using logical \f[C]OR\f[] operation): +.IP \[bu] 2 +\f[C]UCL_STRING_ESCAPE\f[] - perform JSON escape +.IP \[bu] 2 +\f[C]UCL_STRING_TRIM\f[] - trim leading and trailing whitespaces +.IP \[bu] 2 +\f[C]UCL_STRING_PARSE_BOOLEAN\f[] - parse passed string and detect +boolean +.IP \[bu] 2 +\f[C]UCL_STRING_PARSE_INT\f[] - parse passed string and detect integer +number +.IP \[bu] 2 +\f[C]UCL_STRING_PARSE_DOUBLE\f[] - parse passed string and detect +integer or float number +.IP \[bu] 2 +\f[C]UCL_STRING_PARSE_TIME\f[] - parse time values as floating point +numbers +.IP \[bu] 2 +\f[C]UCL_STRING_PARSE_NUMBER\f[] - parse passed string and detect number +(both float, integer and time types) +.IP \[bu] 2 +\f[C]UCL_STRING_PARSE\f[] - parse passed string (and detect booleans, +numbers and time values) +.IP \[bu] 2 +\f[C]UCL_STRING_PARSE_BYTES\f[] - assume that numeric multipliers are in +bytes notation, for example \f[C]10k\f[] means \f[C]10*1024\f[] and not +\f[C]10*1000\f[] as assumed without this flag +.PP +If parsing operations fail then the resulting UCL object will be a +\f[C]UCL_STRING\f[]. +A caller should always check the type of the returned object and release +it after using. +.SH ITERATION FUNCTIONS +.PP +Iteration are used to iterate over UCL compound types: arrays and +objects. +Moreover, iterations could be performed over the keys with multiple *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Mar 22 18:01:53 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCFE4238; Sat, 22 Mar 2014 18:01:53 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 946D37FD; Sat, 22 Mar 2014 18:01:53 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s2MI1q5k002942 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 22 Mar 2014 11:01:53 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s2MI1q14002941; Sat, 22 Mar 2014 11:01:52 -0700 (PDT) (envelope-from jmg) Date: Sat, 22 Mar 2014 11:01:52 -0700 From: John-Mark Gurney To: Ian Lepore Subject: Re: svn commit: r263424 - head/sys/arm/conf Message-ID: <20140322180151.GY32089@funkthat.com> References: <201403201701.s2KH1L84024044@svn.freebsd.org> <20140321094316.76ccf459@bender.Home> <1395412070.81853.8.camel@revolution.hippie.lan> <20140321190402.GT32089@funkthat.com> <1395494755.81853.38.camel@revolution.hippie.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1395494755.81853.38.camel@revolution.hippie.lan> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Sat, 22 Mar 2014 11:01:53 -0700 (PDT) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Ruslan Bukin , src-committers@FreeBSD.org, Andrew Turner X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 18:01:53 -0000 Ian Lepore wrote this message on Sat, Mar 22, 2014 at 07:25 -0600: > On Fri, 2014-03-21 at 12:04 -0700, John-Mark Gurney wrote: > > Ian Lepore wrote this message on Fri, Mar 21, 2014 at 08:27 -0600: > > > On Fri, 2014-03-21 at 09:43 +0000, Andrew Turner wrote: > > > > On Thu, 20 Mar 2014 17:01:21 +0000 (UTC) > > > > Ruslan Bukin wrote: > > > > > > > > > Author: br > > > > > Date: Thu Mar 20 17:01:21 2014 > > > > > New Revision: 263424 > > > > > URL: http://svnweb.freebsd.org/changeset/base/263424 > > > > > > > > > > Log: > > > > > Disable debugging by default. > > > > > > > > I don't like this on head. I have found a number of issues that were > > > > hidden because the kernel config most people were using for development > > > > had WITNESS, INVARIANTS and DIAGNOSTIC disabled. > > > > I agree... HEAD needs these to make sure they are production ready... > > > > > I disagree. Witness is essentially useless anymore, because there are > > > so many known LORs that nobody cares about when you report them that all > > > it does is spews noise. Maybe it's useful when you're looking for a > > > particular problem, but leaving it on all the time has just lost its > > > value. > > > > I wouldn't be tracking down an AVILA bug if it wasn't for INVARIANTS.. > > > > Also, your complaint is solely about WITNESS not the other ones... > > > > Considering how many people are writing new drivers for ARM, and might > > be introducing locking issues w/ those new drivers, WITNESS should be > > included, plus, if you disable INVARIANTS, it means that all the > > lock assert functions will be turned off, and we might miss an odd > > calling stack which doesn't hold a lock or something... > > > > If you're using HEAD for performance, it's easy to turn these off.. > > > > My complaint is only about witness. echo debug.witness.watch=0 >> /etc/sysctl.conf :) Not as fast as completely turning it off, but almost there.. > But... about being easy to turn off... how do they get turned off on > non-head branches? Does re@ really have to go grovel through 77 config > files turning off diagnostic options? Do we have to handle that > difference when merging things to stable branches? Apparently they do: https://svnweb.freebsd.org/base?view=revision&revision=256283 Though, handling merging is an issue for all arches... possibly more anoying for ARM since it's so actively developed... > Last time I tried to put something into arm/conf/DEFAULTS I got my hand > slapped, but... putting the diagnostic options in there on head and not > on stable branches would make the "touch 77 config files" problem go > away. Yes, I agree this is a problem and needs a solution, and I do agree DEFAULTS would be a resonable place, but since there are others that feel more strongly about what goes in DEFAULTS, they should speak about it.. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Sat Mar 22 18:16:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 862E77A8 for ; Sat, 22 Mar 2014 18:16:34 +0000 (UTC) Received: from mail-ie0-f170.google.com (mail-ie0-f170.google.com [209.85.223.170]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4C22C8EC for ; Sat, 22 Mar 2014 18:16:34 +0000 (UTC) Received: by mail-ie0-f170.google.com with SMTP id rd18so3849088iec.15 for ; Sat, 22 Mar 2014 11:16:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=724Ss+HDYcKE3AVHGJ7IgVRV8+CUN/vTJXwN/++YS6c=; b=KoW9qPQYMwQJM/ZTkFHbwXRr34qEgArSWw1a64HRDEI74c/3ptSigoAD/2KzWjstAs QnNZnxi7V/Mr2vXGwReea971GjSAUU1nLEfCsvKoW6ZzbTrvrHa7yj9Z1xQ3U8n/BIoR ZRBxwZQNkpf22e3Byd6Ub4+m5DT82yvjHrRefesbnQOnoZepakMRYwtuiaIuhHM1XWzB 2brXl2LguUaKJ0DEGFPrnj17/x2+pshxP3N8sMzGBWyE+t0DVcdZpoQKhS8DZWBTKWuD peZwnzbXSJyFoDLDdKLirG/DnxqUgDmcx2OIwuDj3KN74FAk+21y7P+lLMe2RV04IS/z 3JpA== X-Gm-Message-State: ALoCoQmuf0i8EtvSlAADD3Mq8TdhiDBFdyaWyHd9lXG0SHjaS/UWKDNpWvR/DI8Ex/a0S9F6kAuM X-Received: by 10.50.83.38 with SMTP id n6mr3743290igy.30.1395512193288; Sat, 22 Mar 2014 11:16:33 -0700 (PDT) Received: from netflix-mac.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id s9sm11644044igw.16.2014.03.22.11.16.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 22 Mar 2014 11:16:32 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263424 - head/sys/arm/conf From: Warner Losh In-Reply-To: <20140322180151.GY32089@funkthat.com> Date: Sat, 22 Mar 2014 12:16:30 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201403201701.s2KH1L84024044@svn.freebsd.org> <20140321094316.76ccf459@bender.Home> <1395412070.81853.8.camel@revolution.hippie.lan> <20140321190402.GT32089@funkthat.com> <1395494755.81853.38.camel@revolution.hippie.lan> <20140322180151.GY32089@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.1874) Cc: src-committers@FreeBSD.org, Ian Lepore , svn-src-all@FreeBSD.org, Andrew Turner , svn-src-head@FreeBSD.org, Ruslan Bukin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 18:16:34 -0000 On Mar 22, 2014, at 12:01 PM, John-Mark Gurney wrote: > Ian Lepore wrote this message on Sat, Mar 22, 2014 at 07:25 -0600: >> On Fri, 2014-03-21 at 12:04 -0700, John-Mark Gurney wrote: >>> Ian Lepore wrote this message on Fri, Mar 21, 2014 at 08:27 -0600: >>>> On Fri, 2014-03-21 at 09:43 +0000, Andrew Turner wrote: >>>>> On Thu, 20 Mar 2014 17:01:21 +0000 (UTC) >>>>> Ruslan Bukin wrote: >>>>>=20 >>>>>> Author: br >>>>>> Date: Thu Mar 20 17:01:21 2014 >>>>>> New Revision: 263424 >>>>>> URL: http://svnweb.freebsd.org/changeset/base/263424 >>>>>>=20 >>>>>> Log: >>>>>> Disable debugging by default. >>>>>=20 >>>>> I don't like this on head. I have found a number of issues that = were >>>>> hidden because the kernel config most people were using for = development >>>>> had WITNESS, INVARIANTS and DIAGNOSTIC disabled. >>>=20 >>> I agree... HEAD needs these to make sure they are production = ready... >>>=20 >>>> I disagree. Witness is essentially useless anymore, because there = are >>>> so many known LORs that nobody cares about when you report them = that all >>>> it does is spews noise. Maybe it's useful when you're looking for = a >>>> particular problem, but leaving it on all the time has just lost = its >>>> value. >>>=20 >>> I wouldn't be tracking down an AVILA bug if it wasn't for = INVARIANTS.. >>>=20 >>> Also, your complaint is solely about WITNESS not the other ones... >>>=20 >>> Considering how many people are writing new drivers for ARM, and = might >>> be introducing locking issues w/ those new drivers, WITNESS should = be >>> included, plus, if you disable INVARIANTS, it means that all the >>> lock assert functions will be turned off, and we might miss an odd >>> calling stack which doesn't hold a lock or something... >>>=20 >>> If you're using HEAD for performance, it's easy to turn these off.. >>>=20 >>=20 >> My complaint is only about witness. >=20 > echo debug.witness.watch=3D0 >> /etc/sysctl.conf >=20 > :) Not as fast as completely turning it off, but almost there.. >=20 >> But... about being easy to turn off... how do they get turned off on >> non-head branches? Does re@ really have to go grovel through 77 = config >> files turning off diagnostic options? Do we have to handle that >> difference when merging things to stable branches? >=20 > Apparently they do: > https://svnweb.freebsd.org/base?view=3Drevision&revision=3D256283 >=20 > Though, handling merging is an issue for all arches... possibly more > anoying for ARM since it's so actively developed... >=20 >> Last time I tried to put something into arm/conf/DEFAULTS I got my = hand >> slapped, but... putting the diagnostic options in there on head and = not >> on stable branches would make the "touch 77 config files" problem go >> away. >=20 > Yes, I agree this is a problem and needs a solution, and I do agree > DEFAULTS would be a resonable place, but since there are others that > feel more strongly about what goes in DEFAULTS, they should speak = about > it.. DEFAULTS is only for mandatory options. WITNESS isn=92t a mandatory = option so it doesn=92t belong there. That was the agreement when we created = DEFAULTS and if we want to have another file that=92s always included, we should = go the std.all route. Or better yet, switch to a system that=92s not so creaky = and cranky that we can more easily expand... Warner= From owner-svn-src-head@FreeBSD.ORG Sat Mar 22 18:20:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 737569A7 for ; Sat, 22 Mar 2014 18:20:42 +0000 (UTC) Received: from mail-ig0-f179.google.com (mail-ig0-f179.google.com [209.85.213.179]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3A0EF90D for ; Sat, 22 Mar 2014 18:20:42 +0000 (UTC) Received: by mail-ig0-f179.google.com with SMTP id t19so4364732igi.0 for ; Sat, 22 Mar 2014 11:20:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=RGq86dMqdJzrO9QUrySEl/w8kxuXC0N8QsaxgxNveTc=; b=gyosl8+TKrS5HXnfKxF34eFNAsykGncbSsP8F5AK8uZbPXszZ8tMZkWVspfwIpfGhW Nyoqyh5bHIlRb/loEReT6osdpkJEATUUR82FAc0IELbgGrZ3R4NwGAY1f2MRRC/+7T9D afCiHsd/azeXyBN+BWSAxm8DHAelJqwjieI70kPzu7ba982w3iuqKNC9bZ3ioID4cSZ8 Hqqy0K2/y/PvvRON01pRTpa3067fNURE8m1PTiD/D0JEWlwtaZfZcwWbA8UkrCgJeQS9 gaWBlJQAvqBfH3UFmP1d7DCFz1wdEKjLXL//CuHz8oChGKjkVSVHhydhg/jgI+7KKVES 1mKA== X-Gm-Message-State: ALoCoQmA5rIbmjjpVRp9f4Y4H9FxSeKiB0b5gCL3oyisOizqDptK6hGee0gibRBUF6jXKngiAPxn X-Received: by 10.43.79.66 with SMTP id zp2mr1347409icb.76.1395512008176; Sat, 22 Mar 2014 11:13:28 -0700 (PDT) Received: from netflix-mac.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id c10sm11590803igj.17.2014.03.22.11.13.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 22 Mar 2014 11:13:27 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263424 - head/sys/arm/conf From: Warner Losh In-Reply-To: <1395494755.81853.38.camel@revolution.hippie.lan> Date: Sat, 22 Mar 2014 12:13:24 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <4112C2A8-2658-4962-A247-6E12257BC4F5@gmail.com> References: <201403201701.s2KH1L84024044@svn.freebsd.org> <20140321094316.76ccf459@bender.Home> <1395412070.81853.8.camel@revolution.hippie.lan> <20140321190402.GT32089@funkthat.com> <1395494755.81853.38.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1874) Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Andrew Turner , svn-src-head@FreeBSD.org, Ruslan Bukin , John-Mark Gurney X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 18:20:42 -0000 On Mar 22, 2014, at 7:25 AM, Ian Lepore wrote: > On Fri, 2014-03-21 at 12:04 -0700, John-Mark Gurney wrote: >> Ian Lepore wrote this message on Fri, Mar 21, 2014 at 08:27 -0600: >>> On Fri, 2014-03-21 at 09:43 +0000, Andrew Turner wrote: >>>> On Thu, 20 Mar 2014 17:01:21 +0000 (UTC) >>>> Ruslan Bukin wrote: >>>>=20 >>>>> Author: br >>>>> Date: Thu Mar 20 17:01:21 2014 >>>>> New Revision: 263424 >>>>> URL: http://svnweb.freebsd.org/changeset/base/263424 >>>>>=20 >>>>> Log: >>>>> Disable debugging by default. >>>>=20 >>>> I don't like this on head. I have found a number of issues that = were >>>> hidden because the kernel config most people were using for = development >>>> had WITNESS, INVARIANTS and DIAGNOSTIC disabled. >>=20 >> I agree... HEAD needs these to make sure they are production = ready... >>=20 >>> I disagree. Witness is essentially useless anymore, because there = are >>> so many known LORs that nobody cares about when you report them that = all >>> it does is spews noise. Maybe it's useful when you're looking for a >>> particular problem, but leaving it on all the time has just lost its >>> value. >>=20 >> I wouldn't be tracking down an AVILA bug if it wasn't for = INVARIANTS.. >>=20 >> Also, your complaint is solely about WITNESS not the other ones... >>=20 >> Considering how many people are writing new drivers for ARM, and = might >> be introducing locking issues w/ those new drivers, WITNESS should be >> included, plus, if you disable INVARIANTS, it means that all the >> lock assert functions will be turned off, and we might miss an odd >> calling stack which doesn't hold a lock or something... >>=20 >> If you're using HEAD for performance, it's easy to turn these off.. >>=20 >=20 > My complaint is only about witness. WItness is actually useful... > But... about being easy to turn off... how do they get turned off on > non-head branches? Does re@ really have to go grovel through 77 = config > files turning off diagnostic options? Do we have to handle that > difference when merging things to stable branches? It=92s done with a sed script, iirc. Writing the one liner took me just = a few minutes: dir sys/*/conf/[A-Z]* | grep -v NOTES | grep -v hints | grep -v Makefile = | grep -v DEFAULTS | xargs sed -i.bak -e=92/^options.*WITNESS/s=3D^=3D#=3D= /=91 would do the trick (for each option, add a clause at the end). But it is = uglier than it needs to be :) > Last time I tried to put something into arm/conf/DEFAULTS I got my = hand > slapped, but... putting the diagnostic options in there on head and = not > on stable branches would make the "touch 77 config files" problem go > away. That=92s a separate problem. DEFAULTS isn=92t the solution to that = problem. The solution lies either in a revamp of the config system, or people = dropping the resistance to std.foo that we partially do in arm, but should fully do = in arm (and elsewhere too). That system has worked well for NetBSD and there=92s no = reason for us not to go that route. However, efforts in this area quickly = degrade into the bikeshed from hell, and we get silly things like FOO.common instead = that more properly would be part of an expanded std.foo system. Of course, = our config system isn=92t quite up for the std.foo for everything, since = conditional includes and/or conditionals in general is an area where it is quite = weak, so when you expand it to a new axis other than board -> soc -> = soc-family -> core -> cpu it gets dicy (and most of the FOO.common stuff is for = that first step, while std.foo is done for almost all the rest). But honestly, the radical revamp is the proper path forward, since it = could also help us with the duplicate information for modules we have now, the massive duplication in config files and about a dozen kludges of varying degrees that are good enough for now, but showing signs of strain. = Putting the effort into the std.XXX system would help some, but we=92d have a = lot of effort to something that=92s crazy silly in a different way than what we = have now. Warner= From owner-svn-src-head@FreeBSD.ORG Sat Mar 22 18:24:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C5D2A40; Sat, 22 Mar 2014 18:24:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5FB2B996; Sat, 22 Mar 2014 18:24:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2MIOjVF042541; Sat, 22 Mar 2014 18:24:45 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2MIOjq8042539; Sat, 22 Mar 2014 18:24:45 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403221824.s2MIOjq8042539@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 22 Mar 2014 18:24:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263649 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 18:24:45 -0000 Author: glebius Date: Sat Mar 22 18:24:44 2014 New Revision: 263649 URL: http://svnweb.freebsd.org/changeset/base/263649 Log: sfxge: limit software Tx queue size. Previous implementation limits put queue size only (when Tx lock can't be acquired), but get queue may grow unboundedly which results in mbuf pools exhaustion and latency growth. Submitted by: Andrew Rybchenko Sponsored by: Solarflare Communications, Inc. Modified: head/sys/dev/sfxge/sfxge_tx.c head/sys/dev/sfxge/sfxge_tx.h Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Sat Mar 22 17:28:14 2014 (r263648) +++ head/sys/dev/sfxge/sfxge_tx.c Sat Mar 22 18:24:44 2014 (r263649) @@ -461,6 +461,9 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, sfxge_tx_qdpl_swizzle(txq); + if (stdp->std_count >= SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT) + return (ENOBUFS); + *(stdp->std_getp) = mbuf; stdp->std_getp = &mbuf->m_nextpkt; stdp->std_count++; @@ -480,8 +483,8 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, old_len = mp->m_pkthdr.csum_data; } else old_len = 0; - if (old_len >= SFXGE_TX_MAX_DEFERRED) - return ENOBUFS; + if (old_len >= SFXGE_TX_DPL_PUT_PKT_LIMIT_DEFAULT) + return (ENOBUFS); mbuf->m_pkthdr.csum_data = old_len + 1; mbuf->m_nextpkt = (void *)old; } while (atomic_cmpset_ptr(putp, old, new) == 0); @@ -512,12 +515,9 @@ sfxge_tx_packet_add(struct sfxge_txq *tx */ locked = mtx_trylock(&txq->lock); - /* - * Can only fail if we weren't able to get the lock. - */ if (sfxge_tx_qdpl_put(txq, m, locked) != 0) { - KASSERT(!locked, - ("sfxge_tx_qdpl_put() failed locked")); + if (locked) + mtx_unlock(&txq->lock); rc = ENOBUFS; goto fail; } Modified: head/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.h Sat Mar 22 17:28:14 2014 (r263648) +++ head/sys/dev/sfxge/sfxge_tx.h Sat Mar 22 18:24:44 2014 (r263649) @@ -75,7 +75,8 @@ struct sfxge_tx_mapping { enum sfxge_tx_buf_flags flags; }; -#define SFXGE_TX_MAX_DEFERRED 64 +#define SFXGE_TX_DPL_GET_PKT_LIMIT_DEFAULT 64 +#define SFXGE_TX_DPL_PUT_PKT_LIMIT_DEFAULT 64 /* * Deferred packet list. From owner-svn-src-head@FreeBSD.ORG Sat Mar 22 22:20:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 416A9E67; Sat, 22 Mar 2014 22:20:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2E1C2CDD; Sat, 22 Mar 2014 22:20:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2MMKhlZ036456; Sat, 22 Mar 2014 22:20:43 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2MMKh1J036455; Sat, 22 Mar 2014 22:20:43 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403222220.s2MMKh1J036455@svn.freebsd.org> From: Bryan Drewery Date: Sat, 22 Mar 2014 22:20:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263650 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 22:20:44 -0000 Author: bdrewery Date: Sat Mar 22 22:20:43 2014 New Revision: 263650 URL: http://svnweb.freebsd.org/changeset/base/263650 Log: Fix build with libucl 20140321 Modified: head/usr.sbin/pkg/Makefile Modified: head/usr.sbin/pkg/Makefile ============================================================================== --- head/usr.sbin/pkg/Makefile Sat Mar 22 18:24:44 2014 (r263649) +++ head/usr.sbin/pkg/Makefile Sat Mar 22 22:20:43 2014 (r263650) @@ -8,7 +8,7 @@ CFLAGS+=-I${.CURDIR}/../../contrib/libuc .PATH: ${.CURDIR}/../../contrib/libucl/include DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBUCL} ${LIBSBUF} ${LIBSSL} \ ${LIBCRYPTO} -LDADD= -larchive -lelf -lfetch -lucl -lsbuf -lssl -lcrypto +LDADD= -larchive -lelf -lfetch -lucl -lsbuf -lssl -lcrypto -lm USEPRIVATELIB= ucl .include From owner-svn-src-head@FreeBSD.ORG Sat Mar 22 22:35:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CC1C5CC; Sat, 22 Mar 2014 22:35:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 29E62E4D; Sat, 22 Mar 2014 22:35:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2MMZwcs043585; Sat, 22 Mar 2014 22:35:58 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2MMZwt7043584; Sat, 22 Mar 2014 22:35:58 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201403222235.s2MMZwt7043584@svn.freebsd.org> From: Neel Natu Date: Sat, 22 Mar 2014 22:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263651 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2014 22:35:58 -0000 Author: neel Date: Sat Mar 22 22:35:57 2014 New Revision: 263651 URL: http://svnweb.freebsd.org/changeset/base/263651 Log: Don't lose track of the KTR entries copied from 'ktr_buf_init[]' to the dynamically allocated 'ktr_buf[]'. The memcpy arranges 'ktr_buf[]' such that the latest KTR entry is at 'KTR_BOOT_ENTRIES - 1'. Modified: head/sys/kern/kern_ktr.c Modified: head/sys/kern/kern_ktr.c ============================================================================== --- head/sys/kern/kern_ktr.c Sat Mar 22 22:20:43 2014 (r263650) +++ head/sys/kern/kern_ktr.c Sat Mar 22 22:35:57 2014 (r263651) @@ -212,9 +212,11 @@ ktr_entries_initializer(void *dummy __un M_WAITOK | M_ZERO); memcpy(ktr_buf, ktr_buf_init + ktr_idx, (KTR_BOOT_ENTRIES - ktr_idx) * sizeof(*ktr_buf)); - if (ktr_idx != 0) + if (ktr_idx != 0) { memcpy(ktr_buf + KTR_BOOT_ENTRIES - ktr_idx, ktr_buf_init, ktr_idx * sizeof(*ktr_buf)); + ktr_idx = KTR_BOOT_ENTRIES; + } ktr_entries = KTR_ENTRIES; ktr_mask = mask; } From owner-svn-src-head@FreeBSD.ORG Sun Mar 23 09:15:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54C9C8F8; Sun, 23 Mar 2014 09:15:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4182B24A; Sun, 23 Mar 2014 09:15:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2N9FFNZ005283; Sun, 23 Mar 2014 09:15:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2N9FFF7005282; Sun, 23 Mar 2014 09:15:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403230915.s2N9FFF7005282@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 23 Mar 2014 09:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263658 - head/usr.sbin/route6d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 09:15:15 -0000 Author: glebius Date: Sun Mar 23 09:15:14 2014 New Revision: 263658 URL: http://svnweb.freebsd.org/changeset/base/263658 Log: Remove unneeded fake _KERNEL definition. Modified: head/usr.sbin/route6d/route6d.c Modified: head/usr.sbin/route6d/route6d.c ============================================================================== --- head/usr.sbin/route6d/route6d.c Sun Mar 23 06:05:58 2014 (r263657) +++ head/usr.sbin/route6d/route6d.c Sun Mar 23 09:15:14 2014 (r263658) @@ -64,9 +64,7 @@ static const char _rcsid[] = "$KAME: rou #include #include #include -#define _KERNEL 1 #include -#undef _KERNEL #include #include #include From owner-svn-src-head@FreeBSD.ORG Sun Mar 23 11:52:06 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA667503; Sun, 23 Mar 2014 11:52:06 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id C91F7F5C; Sun, 23 Mar 2014 11:52:06 +0000 (UTC) Received: from bender.Home (97e07ba1.skybroadband.com [151.224.123.161]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 117AE5DEB7; Sun, 23 Mar 2014 11:51:56 +0000 (UTC) Date: Sun, 23 Mar 2014 11:51:50 +0000 From: Andrew Turner To: Ian Lepore Subject: Re: svn commit: r263424 - head/sys/arm/conf Message-ID: <20140323115150.51e68e2a@bender.Home> In-Reply-To: <1395494755.81853.38.camel@revolution.hippie.lan> References: <201403201701.s2KH1L84024044@svn.freebsd.org> <20140321094316.76ccf459@bender.Home> <1395412070.81853.8.camel@revolution.hippie.lan> <20140321190402.GT32089@funkthat.com> <1395494755.81853.38.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, John-Mark Gurney , Ruslan Bukin , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 11:52:07 -0000 On Sat, 22 Mar 2014 07:25:55 -0600 Ian Lepore wrote: > Last time I tried to put something into arm/conf/DEFAULTS I got my > hand slapped, but... putting the diagnostic options in there on head > and not on stable branches would make the "touch 77 config files" > problem go away. This is another problem we have on ARM, we are abusing FDT_DTS_FILE. We should work to reduce the number of kernel configs we have where possible. My preference would be for no more than one config for each SoC/SoC family, however the granularity depends on the hardware and SoC specific code. Andrew From owner-svn-src-head@FreeBSD.ORG Sun Mar 23 12:02:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9B10B3B; Sun, 23 Mar 2014 12:02:44 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id 89798A3; Sun, 23 Mar 2014 12:02:44 +0000 (UTC) Received: from bender.Home (97e07ba1.skybroadband.com [151.224.123.161]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 075CC5DEB7; Sun, 23 Mar 2014 12:02:42 +0000 (UTC) Date: Sun, 23 Mar 2014 12:02:36 +0000 From: Andrew Turner To: Ruslan Bukin Subject: Re: svn commit: r263424 - head/sys/arm/conf Message-ID: <20140323120236.185b6cdc@bender.Home> In-Reply-To: <20140322052957.GA23556@machdep.com> References: <201403201701.s2KH1L84024044@svn.freebsd.org> <20140321094316.76ccf459@bender.Home> <20140322052957.GA23556@machdep.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 12:02:44 -0000 On Sat, 22 Mar 2014 09:29:57 +0400 Ruslan Bukin wrote: > I think arm codebase is so small, so every commit is like > a huge evolutional update... > Is anyone merging every commit to stable? no > so I think arm users prefered to run -current, not stable. > (say they need fb driver for chromebook). Changes should be merged into the stable branches where appropriate. It would be useful to look through the ARM changes to see what can be merged to 10 in preparation for 10.1. Andrew From owner-svn-src-head@FreeBSD.ORG Sun Mar 23 12:49:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54ABD6C4; Sun, 23 Mar 2014 12:49:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 247B3634; Sun, 23 Mar 2014 12:49:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2NCnU0Z091303; Sun, 23 Mar 2014 12:49:30 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2NCnQqT091282; Sun, 23 Mar 2014 12:49:26 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201403231249.s2NCnQqT091282@svn.freebsd.org> From: Andrew Turner Date: Sun, 23 Mar 2014 12:49:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263660 - in head: . contrib/binutils/bfd gnu/usr.bin/binutils gnu/usr.bin/cc gnu/usr.bin/gdb gnu/usr.bin/gdb/libgdb lib/clang lib/libc lib/libc/arm/aeabi lib/libcompiler_rt lib/libkvm ... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 12:49:30 -0000 Author: andrew Date: Sun Mar 23 12:49:25 2014 New Revision: 263660 URL: http://svnweb.freebsd.org/changeset/base/263660 Log: Add a new ARM TARGET_ARCH, armv6hf. This is considered experimental. This targets the existing ARMv6 and ARMv7 SoCs that contain a VFP unit. This is an optional coprocessors may not be present in all devices, however it appears to be in all current SoCs we support. armv6hf targets the VFP variant of the ARM EABI and our copy of gcc is too old to support this. Because of this there are a number of WITH/WITHOUT options that are unsupported and must be left as the default value. The options and their required value are: * WITH_ARM_EABI * WITHOUT_GCC * WITHOUT_GNUCXX In addition, without an external toolchain, the following need to be left as their default: * WITH_CLANG * WITH_CLANG_IS_CC As there is a different method of passing float and double values to functions the ABI is incompatible with existing armv6 binaries. To use this a full rebuild of world is required. Because no floating point values are passed into the kernel an armv6 kernel with VFP enabled will work with an armv6hf userland and vice versa. Modified: head/Makefile head/Makefile.inc1 head/contrib/binutils/bfd/config.bfd head/gnu/usr.bin/binutils/Makefile.inc0 head/gnu/usr.bin/cc/Makefile.tgt head/gnu/usr.bin/gdb/Makefile.inc head/gnu/usr.bin/gdb/libgdb/Makefile head/lib/clang/clang.build.mk head/lib/libc/Makefile head/lib/libc/arm/aeabi/Makefile.inc head/lib/libcompiler_rt/Makefile head/lib/libkvm/Makefile head/share/mk/bsd.endian.mk head/share/mk/bsd.own.mk head/share/mk/sys.mk head/sys/sys/param.h head/usr.bin/xlint/Makefile.inc Modified: head/Makefile ============================================================================== --- head/Makefile Sun Mar 23 11:57:25 2014 (r263659) +++ head/Makefile Sun Mar 23 12:49:25 2014 (r263660) @@ -164,7 +164,7 @@ _MAKE= PATH=${PATH} ${SUB_MAKE} -f Makef _TARGET_ARCH= ${TARGET:S/pc98/i386/} .elif !defined(TARGET) && defined(TARGET_ARCH) && \ ${TARGET_ARCH} != ${MACHINE_ARCH} -_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/} +_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/} .endif # Legacy names, for another transition period mips:mips(n32|64)?eb -> mips:mips\1 .if defined(TARGET) && defined(TARGET_ARCH) && \ @@ -374,7 +374,7 @@ kernel-toolchains: # .if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets) TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 -TARGET_ARCHES_arm?= arm armeb armv6 +TARGET_ARCHES_arm?= arm armeb armv6 armv6hf TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 TARGET_ARCHES_powerpc?= powerpc powerpc64 TARGET_ARCHES_pc98?= i386 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Mar 23 11:57:25 2014 (r263659) +++ head/Makefile.inc1 Sun Mar 23 12:49:25 2014 (r263660) @@ -139,7 +139,7 @@ SRCRELDATE!= awk '/^\#define[[:space:]]* VERSION= FreeBSD ${REVISION}-${BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDATE} .endif -KNOWN_ARCHES?= amd64 arm armeb/arm armv6/arm i386 i386/pc98 ia64 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64 +KNOWN_ARCHES?= amd64 arm armeb/arm armv6/arm armv6hf/arm i386 i386/pc98 ia64 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64 .if ${TARGET} == ${TARGET_ARCH} _t= ${TARGET} .else @@ -351,6 +351,8 @@ XFLAGS+= -B${WORLDTMP}/usr/bin .if (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "armv6") && \ ${MK_ARM_EABI} != "no" TARGET_ABI= gnueabi +.elif ${TARGET_ARCH} == "armv6hf" +TARGET_ABI= gnueabihf .else TARGET_ABI= unknown .endif Modified: head/contrib/binutils/bfd/config.bfd ============================================================================== --- head/contrib/binutils/bfd/config.bfd Sun Mar 23 11:57:25 2014 (r263659) +++ head/contrib/binutils/bfd/config.bfd Sun Mar 23 12:49:25 2014 (r263660) @@ -281,7 +281,7 @@ case "${targ}" in targ_defvec=bfd_elf32_bigarm_vec targ_selvecs=bfd_elf32_littlearm_vec ;; - armv6-*-freebsd*) + armv6-*-freebsd* | armv6hf-*-freebsd*) targ_defvec=bfd_elf32_littlearm_vec targ_selvecs=bfd_elf32_bigarm_vec ;; Modified: head/gnu/usr.bin/binutils/Makefile.inc0 ============================================================================== --- head/gnu/usr.bin/binutils/Makefile.inc0 Sun Mar 23 11:57:25 2014 (r263659) +++ head/gnu/usr.bin/binutils/Makefile.inc0 Sun Mar 23 12:49:25 2014 (r263660) @@ -7,7 +7,7 @@ VERSION= "2.17.50 [FreeBSD] 2007-07-03" .if defined(TARGET_ARCH) -TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} +TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/} .else TARGET_CPUARCH=${MACHINE_CPUARCH} .endif Modified: head/gnu/usr.bin/cc/Makefile.tgt ============================================================================== --- head/gnu/usr.bin/cc/Makefile.tgt Sun Mar 23 11:57:25 2014 (r263659) +++ head/gnu/usr.bin/cc/Makefile.tgt Sun Mar 23 12:49:25 2014 (r263660) @@ -4,7 +4,7 @@ # MACHINE_CPUARCH, but there's no easy way to export make functions... .if defined(TARGET_ARCH) -TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} +TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/} .else TARGET_CPUARCH=${MACHINE_CPUARCH} .endif Modified: head/gnu/usr.bin/gdb/Makefile.inc ============================================================================== --- head/gnu/usr.bin/gdb/Makefile.inc Sun Mar 23 11:57:25 2014 (r263659) +++ head/gnu/usr.bin/gdb/Makefile.inc Sun Mar 23 12:49:25 2014 (r263660) @@ -20,7 +20,7 @@ OBJ_GDB= ${OBJ_ROOT}/gdb # MACHINE_CPUARCH, but there's no easy way to export make functions... .if defined(TARGET_ARCH) -TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} +TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/} .else TARGET_CPUARCH=${MACHINE_CPUARCH} .endif Modified: head/gnu/usr.bin/gdb/libgdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/libgdb/Makefile Sun Mar 23 11:57:25 2014 (r263659) +++ head/gnu/usr.bin/gdb/libgdb/Makefile Sun Mar 23 12:49:25 2014 (r263660) @@ -4,7 +4,7 @@ # MACHINE_CPUARCH, but there's no easy way to export make functions... .if defined(TARGET_ARCH) -TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} +TARGET_CPUARCH=${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/} .else TARGET_CPUARCH=${MACHINE_CPUARCH} .endif Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Sun Mar 23 11:57:25 2014 (r263659) +++ head/lib/clang/clang.build.mk Sun Mar 23 12:49:25 2014 (r263660) @@ -23,12 +23,14 @@ BUILD_ARCH?= ${MACHINE_ARCH} .if (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "armv6") && \ ${MK_ARM_EABI} != "no" TARGET_ABI= gnueabi +.elif ${TARGET_ARCH} == "armv6hf" +TARGET_ABI= gnueabihf .else TARGET_ABI= unknown .endif -TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0 -BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/}-unknown-freebsd11.0 +TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/:C/armv6hf/armv6/}-${TARGET_ABI}-freebsd11.0 +BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/:C/armv6hf/armv6/}-unknown-freebsd11.0 CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\" \ -DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\" \ -DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\" Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Sun Mar 23 11:57:25 2014 (r263659) +++ head/lib/libc/Makefile Sun Mar 23 12:49:25 2014 (r263660) @@ -98,7 +98,8 @@ NOASM= .include "${LIBC_SRCTOP}/rpc/Makefile.inc" .include "${LIBC_SRCTOP}/uuid/Makefile.inc" .include "${LIBC_SRCTOP}/xdr/Makefile.inc" -.if ${LIBC_ARCH} == "arm" || ${LIBC_ARCH} == "mips" +.if (${LIBC_ARCH} == "arm" && ${MACHINE_ARCH} != "armv6hf") ||\ + ${LIBC_ARCH} == "mips" .include "${LIBC_SRCTOP}/softfloat/Makefile.inc" .endif .if ${MK_NIS} != "no" Modified: head/lib/libc/arm/aeabi/Makefile.inc ============================================================================== --- head/lib/libc/arm/aeabi/Makefile.inc Sun Mar 23 11:57:25 2014 (r263659) +++ head/lib/libc/arm/aeabi/Makefile.inc Sun Mar 23 12:49:25 2014 (r263660) @@ -3,9 +3,11 @@ .PATH: ${LIBC_SRCTOP}/arm/aeabi SRCS+= aeabi_atexit.c \ - aeabi_double.c \ - aeabi_float.c \ aeabi_unwind_cpp.c +.if ${MACHINE_ARCH} != "armv6hf" +SRCS+= aeabi_double.c \ + aeabi_float.c +.endif .if ${MACHINE_ARCH:Marmv6*} SRCS+= aeabi_vfp_double.S \ aeabi_vfp_float.S Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Sun Mar 23 11:57:25 2014 (r263659) +++ head/lib/libcompiler_rt/Makefile Sun Mar 23 12:49:25 2014 (r263660) @@ -165,7 +165,9 @@ SRCF+= stdatomic .endif .for file in ${SRCF} -. if ${MACHINE_CPUARCH} != "arm" && exists(${CRTSRC}/${CRTARCH}/${file}.S) +. if ${MACHINE_ARCH} == "armv6hf" && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) +SRCS+= ${file}vfp.S +. elif (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH} == "armv6hf") && exists(${CRTSRC}/${CRTARCH}/${file}.S) SRCS+= ${file}.S . else SRCS+= ${file}.c Modified: head/lib/libkvm/Makefile ============================================================================== --- head/lib/libkvm/Makefile Sun Mar 23 11:57:25 2014 (r263659) +++ head/lib/libkvm/Makefile Sun Mar 23 12:49:25 2014 (r263660) @@ -3,7 +3,7 @@ .if defined(TARGET_ARCH) && !defined(COMPAT_32BIT) KVM_XARCH=${TARGET_ARCH} -KVM_XCPUARCH=${KVM_XARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} +KVM_XCPUARCH=${KVM_XARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/} .else KVM_XARCH=${MACHINE_ARCH} KVM_XCPUARCH=${MACHINE_CPUARCH} Modified: head/share/mk/bsd.endian.mk ============================================================================== --- head/share/mk/bsd.endian.mk Sun Mar 23 11:57:25 2014 (r263659) +++ head/share/mk/bsd.endian.mk Sun Mar 23 12:49:25 2014 (r263660) @@ -5,6 +5,7 @@ ${MACHINE_ARCH} == "ia64" || \ ${MACHINE_ARCH} == "arm" || \ ${MACHINE_ARCH} == "armv6" || \ + ${MACHINE_ARCH} == "armv6hf" || \ ${MACHINE_ARCH:Mmips*el} != "" TARGET_ENDIANNESS= 1234 .elif ${MACHINE_ARCH} == "powerpc" || \ Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sun Mar 23 11:57:25 2014 (r263659) +++ head/share/mk/bsd.own.mk Sun Mar 23 12:49:25 2014 (r263660) @@ -400,7 +400,7 @@ __TT=${MACHINE} # Clang is only for x86, powerpc and little-endian arm right now, by default. .if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*} __DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL -.elif ${__T} == "arm" || ${__T} == "armv6" +.elif ${__T} == "arm" || ${__T} == "armv6" || ${__T} == "armv6hf" __DEFAULT_YES_OPTIONS+=CLANG # GCC is unable to build the full clang on arm, disable it by default. __DEFAULT_NO_OPTIONS+=CLANG_FULL @@ -409,7 +409,7 @@ __DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL .endif # Clang the default system compiler only on little-endian arm and x86. .if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \ - ${__T} == "i386" + ${__T} == "armv6hf" || ${__T} == "i386" __DEFAULT_YES_OPTIONS+=CLANG_IS_CC # The pc98 bootloader requires gcc to build and so we must leave gcc enabled # for pc98 for now. Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Sun Mar 23 11:57:25 2014 (r263659) +++ head/share/mk/sys.mk Sun Mar 23 12:49:25 2014 (r263660) @@ -13,7 +13,7 @@ unix ?= We run FreeBSD, not UNIX. # and/or endian. This is called MACHINE_CPU in NetBSD, but that's used # for something different in FreeBSD. # -MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} +MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/} .endif # Set any local definitions first. Place this early, but it needs Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Mar 23 11:57:25 2014 (r263659) +++ head/sys/sys/param.h Sun Mar 23 12:49:25 2014 (r263660) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100015 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100016 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/usr.bin/xlint/Makefile.inc ============================================================================== --- head/usr.bin/xlint/Makefile.inc Sun Mar 23 11:57:25 2014 (r263659) +++ head/usr.bin/xlint/Makefile.inc Sun Mar 23 12:49:25 2014 (r263660) @@ -8,7 +8,7 @@ WARNS?= 0 # These assignments duplicate much of the functionality of # MACHINE_CPUARCH, but there's no easy way to export make functions... .if defined(TARGET_ARCH) -TARGET_CPUARCH= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/} +TARGET_CPUARCH= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/} .else TARGET_CPUARCH= ${MACHINE_CPUARCH} TARGET_ARCH= ${MACHINE_ARCH} From owner-svn-src-head@FreeBSD.ORG Sun Mar 23 13:20:17 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43917CA; Sun, 23 Mar 2014 13:20:17 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 12D9B907; Sun, 23 Mar 2014 13:20:16 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WRiJu-000J1A-HZ; Sun, 23 Mar 2014 13:20:10 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s2NDK6Yj074259; Sun, 23 Mar 2014 07:20:06 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/j2Jm0ZRTk8kUS3cCMjL3l Subject: Re: svn commit: r263424 - head/sys/arm/conf From: Ian Lepore To: Andrew Turner In-Reply-To: <20140323115150.51e68e2a@bender.Home> References: <201403201701.s2KH1L84024044@svn.freebsd.org> <20140321094316.76ccf459@bender.Home> <1395412070.81853.8.camel@revolution.hippie.lan> <20140321190402.GT32089@funkthat.com> <1395494755.81853.38.camel@revolution.hippie.lan> <20140323115150.51e68e2a@bender.Home> Content-Type: text/plain; charset="us-ascii" Date: Sun, 23 Mar 2014 07:20:06 -0600 Message-ID: <1395580806.81853.51.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, John-Mark Gurney , Ruslan Bukin , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 13:20:17 -0000 On Sun, 2014-03-23 at 11:51 +0000, Andrew Turner wrote: > On Sat, 22 Mar 2014 07:25:55 -0600 > Ian Lepore wrote: > > Last time I tried to put something into arm/conf/DEFAULTS I got my > > hand slapped, but... putting the diagnostic options in there on head > > and not on stable branches would make the "touch 77 config files" > > problem go away. > > This is another problem we have on ARM, we are abusing FDT_DTS_FILE. We > should work to reduce the number of kernel configs we have where > possible. My preference would be for no more than one config for each > SoC/SoC family, however the granularity depends on the hardware and SoC > specific code. > > Andrew I made a single imx6 kernel work for all flavors of soc, but I can't get rid of the WANDBOARD* configs until we have an alternate mechanism for requesting that a given DTB (or several of them) gets compiled and installed without being set in the kernel config. Warner said he was working on something to allow that. But our plethora of arm configs isn't going to be reduced all that much. We have 77 config files, 30 of them have FDT_DTS_FILE. If we eliminated all the configs that differ only in the FDT_DTS_FILE=, we'd get rid of maybe 8 or 10 of them. -- Ian From owner-svn-src-head@FreeBSD.ORG Sun Mar 23 13:22:02 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA0E12F9; Sun, 23 Mar 2014 13:22:02 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB70198C; Sun, 23 Mar 2014 13:22:01 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WRiLb-000BYf-4R; Sun, 23 Mar 2014 13:21:55 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s2NDLoOF074268; Sun, 23 Mar 2014 07:21:50 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18ztlSFQv+af8SPtvf+kJej Subject: Re: svn commit: r263424 - head/sys/arm/conf From: Ian Lepore To: Andrew Turner In-Reply-To: <20140323120236.185b6cdc@bender.Home> References: <201403201701.s2KH1L84024044@svn.freebsd.org> <20140321094316.76ccf459@bender.Home> <20140322052957.GA23556@machdep.com> <20140323120236.185b6cdc@bender.Home> Content-Type: text/plain; charset="us-ascii" Date: Sun, 23 Mar 2014 07:21:50 -0600 Message-ID: <1395580910.81853.53.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Ruslan Bukin , src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 13:22:02 -0000 On Sun, 2014-03-23 at 12:02 +0000, Andrew Turner wrote: > On Sat, 22 Mar 2014 09:29:57 +0400 > Ruslan Bukin wrote: > > I think arm codebase is so small, so every commit is like > > a huge evolutional update... > > Is anyone merging every commit to stable? no > > so I think arm users prefered to run -current, not stable. > > (say they need fb driver for chromebook). > > Changes should be merged into the stable branches where appropriate. It > would be useful to look through the ARM changes to see what can be > merged to 10 in preparation for 10.1. > > Andrew > I'm planning on doing a bunch of ARM merging once we have SMP solidified a bit. We're pretty close, just trying to work out a last glitch or two in the TLB flush code. -- Ian From owner-svn-src-head@FreeBSD.ORG Sun Mar 23 14:06:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6912198; Sun, 23 Mar 2014 14:06:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A2A07CB5; Sun, 23 Mar 2014 14:06:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2NE69sX023498; Sun, 23 Mar 2014 14:06:09 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2NE69Qp023497; Sun, 23 Mar 2014 14:06:09 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201403231406.s2NE69Qp023497@svn.freebsd.org> From: Andrew Turner Date: Sun, 23 Mar 2014 14:06:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263664 - head/contrib/llvm/patches X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 14:06:09 -0000 Author: andrew Date: Sun Mar 23 14:06:09 2014 New Revision: 263664 URL: http://svnweb.freebsd.org/changeset/base/263664 Log: Add the llvm/clang patch for r263619. Added: head/contrib/llvm/patches/patch-r263619-clang-r201662-arm-gnueabihf.diff Added: head/contrib/llvm/patches/patch-r263619-clang-r201662-arm-gnueabihf.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r263619-clang-r201662-arm-gnueabihf.diff Sun Mar 23 14:06:09 2014 (r263664) @@ -0,0 +1,81 @@ +Index: tools/clang/lib/Driver/ToolChains.cpp +=================================================================== +--- tools/clang/lib/Driver/ToolChains.cpp ++++ tools/clang/lib/Driver/ToolChains.cpp +@@ -2034,6 +2034,7 @@ + bool FreeBSD::UseSjLjExceptions() const { + // FreeBSD uses SjLj exceptions on ARM oabi. + switch (getTriple().getEnvironment()) { ++ case llvm::Triple::GNUEABIHF: + case llvm::Triple::GNUEABI: + case llvm::Triple::EABI: + return false; +Index: tools/clang/lib/Driver/Tools.cpp +=================================================================== +--- tools/clang/lib/Driver/Tools.cpp ++++ tools/clang/lib/Driver/Tools.cpp +@@ -737,8 +737,15 @@ + } + + case llvm::Triple::FreeBSD: +- // FreeBSD defaults to soft float +- FloatABI = "soft"; ++ switch(Triple.getEnvironment()) { ++ case llvm::Triple::GNUEABIHF: ++ FloatABI = "hard"; ++ break; ++ default: ++ // FreeBSD defaults to soft float ++ FloatABI = "soft"; ++ break; ++ } + break; + + default: +@@ -5776,8 +5783,18 @@ + } + } else if (getToolChain().getArch() == llvm::Triple::arm || + getToolChain().getArch() == llvm::Triple::thumb) { +- CmdArgs.push_back("-mfpu=softvfp"); ++ const Driver &D = getToolChain().getDriver(); ++ llvm::Triple Triple = getToolChain().getTriple(); ++ StringRef FloatABI = getARMFloatABI(D, Args, Triple); ++ ++ if (FloatABI == "hard") { ++ CmdArgs.push_back("-mfpu=vfp"); ++ } else { ++ CmdArgs.push_back("-mfpu=softvfp"); ++ } ++ + switch(getToolChain().getTriple().getEnvironment()) { ++ case llvm::Triple::GNUEABIHF: + case llvm::Triple::GNUEABI: + case llvm::Triple::EABI: + CmdArgs.push_back("-meabi=5"); +Index: tools/clang/test/Driver/freebsd.c +=================================================================== +--- tools/clang/test/Driver/freebsd.c ++++ tools/clang/test/Driver/freebsd.c +@@ -101,13 +101,22 @@ + // RUN: | FileCheck --check-prefix=CHECK-ARM %s + // CHECK-ARM: clang{{.*}}" "-cc1"{{.*}}" "-fsjlj-exceptions" + // CHECK-ARM: as{{.*}}" "-mfpu=softvfp"{{.*}}"-matpcs" ++// CHECK-ARM-EABI-NOT: as{{.*}}" "-mfpu=vfp" + + // RUN: %clang %s -### -target arm-gnueabi-freebsd10.0 2>&1 \ + // RUN: | FileCheck --check-prefix=CHECK-ARM-EABI %s + // CHECK-ARM-EABI-NOT: clang{{.*}}" "-cc1"{{.*}}" "-fsjlj-exceptions" + // CHECK-ARM-EABI: as{{.*}}" "-mfpu=softvfp" "-meabi=5" ++// CHECK-ARM-EABI-NOT: as{{.*}}" "-mfpu=vfp" + // CHECK-ARM-EABI-NOT: as{{.*}}" "-matpcs" + ++// RUN: %clang %s -### -o %t.o -target arm-gnueabihf-freebsd10.0 -no-integrated-as 2>&1 \ ++// RUN: | FileCheck --check-prefix=CHECK-ARM-EABIHF %s ++// CHECK-ARM-EABIHF-NOT: clang{{.*}}" "-cc1"{{.*}}" "-fsjlj-exceptions" ++// CHECK-ARM-EABIHF: as{{.*}}" "-mfpu=vfp" "-meabi=5" ++// CHECK-ARM-EABIHF-NOT: as{{.*}}" "-mfpu=softvfp" ++// CHECK-ARM-EABIHF-NOT: as{{.*}}" "-matpcs" ++ + // RUN: %clang -target x86_64-pc-freebsd8 %s -### -flto -o %t.o 2>&1 \ + // RUN: | FileCheck --check-prefix=CHECK-LTO %s + // CHECK-LTO: ld{{.*}}" "-plugin{{.*}}LLVMgold.so From owner-svn-src-head@FreeBSD.ORG Sun Mar 23 17:39:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0FA9F1A for ; Sun, 23 Mar 2014 17:39:37 +0000 (UTC) Received: from mail-ie0-f173.google.com (mail-ie0-f173.google.com [209.85.223.173]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 97A5EFB for ; Sun, 23 Mar 2014 17:39:37 +0000 (UTC) Received: by mail-ie0-f173.google.com with SMTP id rl12so4520594iec.32 for ; Sun, 23 Mar 2014 10:39:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=JEr/MrpeeU9SEtH21A1xA0xnEhkZqKR+mQOksg4AEbI=; b=FJnKqdPLr1cHGVVWvx2LFuw+LOVy0FPSQBf4yOtdEQnw8SC8VzbeLhD+OD9wWePjIE PoVt80hHs9l28PbIOWgIbQK5fVWGRQ55tIxSvB/RFU+MWyXtk+46jrfKkUJ9BzdEE/ok yLfhbOzzjQCtZo9EeGAFoXiccrqpM9wTAfkWmGht4uI8NthJHfeN5z36/5uKyqu7OrWl 8Wgn0w05hxxqKAu0VKTGZS/mN91ngw0gEP84394CTsUaWqnyrct+VGXwBTHudhkN0m1a ps97dbVSTlQI5d8RjBqAvPO7aN3pMaMkpKe/cHQ81MnmWldHfOSMVXKmNtk/VvFrwcux 8meQ== X-Gm-Message-State: ALoCoQnVB6yqCaYrsCRdWEzVvd6T4wsTOU8K7fEfiyuVmHle8phpDLnEo1wQRRqB18S4twd7/QH7 X-Received: by 10.42.92.194 with SMTP id u2mr46226632icm.19.1395596371350; Sun, 23 Mar 2014 10:39:31 -0700 (PDT) Received: from netflix-mac.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id vu3sm18096874igc.6.2014.03.23.10.39.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 23 Mar 2014 10:39:30 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263424 - head/sys/arm/conf From: Warner Losh In-Reply-To: <20140323115150.51e68e2a@bender.Home> Date: Sun, 23 Mar 2014 11:39:21 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <5569B0FF-F4D9-4788-943A-3C3BDB10196B@bsdimp.com> References: <201403201701.s2KH1L84024044@svn.freebsd.org> <20140321094316.76ccf459@bender.Home> <1395412070.81853.8.camel@revolution.hippie.lan> <20140321190402.GT32089@funkthat.com> <1395494755.81853.38.camel@revolution.hippie.lan> <20140323115150.51e68e2a@bender.Home> To: Andrew Turner X-Mailer: Apple Mail (2.1874) Cc: src-committers@FreeBSD.org, Ian Lepore , John-Mark Gurney , svn-src-head@FreeBSD.org, Ruslan Bukin , svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 17:39:37 -0000 On Mar 23, 2014, at 5:51 AM, Andrew Turner wrote: > On Sat, 22 Mar 2014 07:25:55 -0600 > Ian Lepore wrote: >> Last time I tried to put something into arm/conf/DEFAULTS I got my >> hand slapped, but... putting the diagnostic options in there on head >> and not on stable branches would make the "touch 77 config files" >> problem go away. >=20 > This is another problem we have on ARM, we are abusing FDT_DTS_FILE. = We > should work to reduce the number of kernel configs we have where > possible. My preference would be for no more than one config for each > SoC/SoC family, however the granularity depends on the hardware and = SoC > specific code. I have some WIP changes that will allow us to build multiple dtb files = for a single kernel config file that will help this. Warner From owner-svn-src-head@FreeBSD.ORG Sun Mar 23 18:29:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1905AF1C; Sun, 23 Mar 2014 18:29:31 +0000 (UTC) Received: from mail.soaustin.net (pancho.soaustin.net [76.74.250.40]) by mx1.freebsd.org (Postfix) with ESMTP id E6ABD768; Sun, 23 Mar 2014 18:29:30 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id 420FA5607C; Sun, 23 Mar 2014 13:29:30 -0500 (CDT) Date: Sun, 23 Mar 2014 13:29:30 -0500 From: Mark Linimon To: Adrian Chadd Subject: Re: svn commit: r263424 - head/sys/arm/conf Message-ID: <20140323182930.GB24520@lonesome.com> References: <201403201701.s2KH1L84024044@svn.freebsd.org> <20140321094316.76ccf459@bender.Home> <1395412070.81853.8.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "src-committers@freebsd.org" , Ian Lepore , "svn-src-all@freebsd.org" , Andrew Turner , "svn-src-head@freebsd.org" , Ruslan Bukin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 18:29:31 -0000 On Fri, Mar 21, 2014 at 11:39:55AM -0700, Adrian Chadd wrote: > Which LORs? I actively chase down and squish net80211/ath LORs when > it's not too difficult (and I know of some rather-difficult ones I'm > still trying to solve.) But besides the handful of filesystem LORs > that are claimed to be fine, what LORs are you seeing spewed out? fwiw, the following page is still being updated: http://people.freebsd.org/~linimon/studies/prs/lor_prs.html If there are PRs that are about LORs that are not on that page, please let me know off-list and I'll fix them. mcl From owner-svn-src-head@FreeBSD.ORG Sun Mar 23 20:35:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46EA073B; Sun, 23 Mar 2014 20:35:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 33EBB260; Sun, 23 Mar 2014 20:35:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2NKZx9E085050; Sun, 23 Mar 2014 20:35:59 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2NKZxaF085049; Sun, 23 Mar 2014 20:35:59 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201403232035.s2NKZxaF085049@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 23 Mar 2014 20:35:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263675 - head/sys/boot/fdt/dts/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 20:35:59 -0000 Author: bz Date: Sun Mar 23 20:35:58 2014 New Revision: 263675 URL: http://svnweb.freebsd.org/changeset/base/263675 Log: For the moment also disable interrupts on the altera-jtag-uart imitation and force polling mode. Modified: head/sys/boot/fdt/dts/mips/beri-netfpga.dts Modified: head/sys/boot/fdt/dts/mips/beri-netfpga.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beri-netfpga.dts Sun Mar 23 20:17:38 2014 (r263674) +++ head/sys/boot/fdt/dts/mips/beri-netfpga.dts Sun Mar 23 20:35:58 2014 (r263675) @@ -116,8 +116,10 @@ serial0: serial@7f000000 { compatible = "altera,jtag_uart-11_0"; reg = <0x7f000000 0x40>; +/* interrupts = <0>; interrupt-parent = <&beripic>; +*/ }; /* From owner-svn-src-head@FreeBSD.ORG Sun Mar 23 21:08:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DCA142AA; Sun, 23 Mar 2014 21:08:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C9B686DD; Sun, 23 Mar 2014 21:08:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2NL8I6M097518; Sun, 23 Mar 2014 21:08:18 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2NL8IOH097517; Sun, 23 Mar 2014 21:08:18 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201403232108.s2NL8IOH097517@svn.freebsd.org> From: Andrew Turner Date: Sun, 23 Mar 2014 21:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263676 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 21:08:19 -0000 Author: andrew Date: Sun Mar 23 21:08:18 2014 New Revision: 263676 URL: http://svnweb.freebsd.org/changeset/base/263676 Log: Reorder the pmap macros so "ARM_MMU_V6 + ARM_MMU_V7" is first. As they are identical this allows us to build for both v6 and v7 together. Modified: head/sys/arm/include/pmap.h Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Sun Mar 23 20:35:58 2014 (r263675) +++ head/sys/arm/include/pmap.h Sun Mar 23 21:08:18 2014 (r263676) @@ -341,47 +341,7 @@ extern int pmap_needs_pte_sync; #define L2_AP(x) (L2_AP0(x) | L2_AP1(x) | L2_AP2(x) | L2_AP3(x)) #endif -#if ARM_NMMUS > 1 -/* More than one MMU class configured; use variables. */ -#define L2_S_PROT_U pte_l2_s_prot_u -#define L2_S_PROT_W pte_l2_s_prot_w -#define L2_S_PROT_MASK pte_l2_s_prot_mask - -#define L1_S_CACHE_MASK pte_l1_s_cache_mask -#define L2_L_CACHE_MASK pte_l2_l_cache_mask -#define L2_S_CACHE_MASK pte_l2_s_cache_mask - -#define L1_S_PROTO pte_l1_s_proto -#define L1_C_PROTO pte_l1_c_proto -#define L2_S_PROTO pte_l2_s_proto - -#elif ARM_MMU_GENERIC != 0 -#define L2_S_PROT_U L2_S_PROT_U_generic -#define L2_S_PROT_W L2_S_PROT_W_generic -#define L2_S_PROT_MASK L2_S_PROT_MASK_generic - -#define L1_S_CACHE_MASK L1_S_CACHE_MASK_generic -#define L2_L_CACHE_MASK L2_L_CACHE_MASK_generic -#define L2_S_CACHE_MASK L2_S_CACHE_MASK_generic - -#define L1_S_PROTO L1_S_PROTO_generic -#define L1_C_PROTO L1_C_PROTO_generic -#define L2_S_PROTO L2_S_PROTO_generic - -#elif ARM_MMU_XSCALE == 1 -#define L2_S_PROT_U L2_S_PROT_U_xscale -#define L2_S_PROT_W L2_S_PROT_W_xscale -#define L2_S_PROT_MASK L2_S_PROT_MASK_xscale - -#define L1_S_CACHE_MASK L1_S_CACHE_MASK_xscale -#define L2_L_CACHE_MASK L2_L_CACHE_MASK_xscale -#define L2_S_CACHE_MASK L2_S_CACHE_MASK_xscale - -#define L1_S_PROTO L1_S_PROTO_xscale -#define L1_C_PROTO L1_C_PROTO_xscale -#define L2_S_PROTO L2_S_PROTO_xscale - -#elif (ARM_MMU_V6 + ARM_MMU_V7) != 0 +#if (ARM_MMU_V6 + ARM_MMU_V7) != 0 /* * AP[2:1] access permissions model: * @@ -461,6 +421,47 @@ extern int pmap_needs_pte_sync; #define ARM_L2S_NRML_IWT_OWT (L2_C) #define ARM_L2S_NRML_IWB_OWB (L2_C|L2_B) #define ARM_L2S_NRML_IWBA_OWBA (L2_S_TEX(1)|L2_C|L2_B) + +#elif ARM_NMMUS > 1 +/* More than one MMU class configured; use variables. */ +#define L2_S_PROT_U pte_l2_s_prot_u +#define L2_S_PROT_W pte_l2_s_prot_w +#define L2_S_PROT_MASK pte_l2_s_prot_mask + +#define L1_S_CACHE_MASK pte_l1_s_cache_mask +#define L2_L_CACHE_MASK pte_l2_l_cache_mask +#define L2_S_CACHE_MASK pte_l2_s_cache_mask + +#define L1_S_PROTO pte_l1_s_proto +#define L1_C_PROTO pte_l1_c_proto +#define L2_S_PROTO pte_l2_s_proto + +#elif ARM_MMU_GENERIC != 0 +#define L2_S_PROT_U L2_S_PROT_U_generic +#define L2_S_PROT_W L2_S_PROT_W_generic +#define L2_S_PROT_MASK L2_S_PROT_MASK_generic + +#define L1_S_CACHE_MASK L1_S_CACHE_MASK_generic +#define L2_L_CACHE_MASK L2_L_CACHE_MASK_generic +#define L2_S_CACHE_MASK L2_S_CACHE_MASK_generic + +#define L1_S_PROTO L1_S_PROTO_generic +#define L1_C_PROTO L1_C_PROTO_generic +#define L2_S_PROTO L2_S_PROTO_generic + +#elif ARM_MMU_XSCALE == 1 +#define L2_S_PROT_U L2_S_PROT_U_xscale +#define L2_S_PROT_W L2_S_PROT_W_xscale +#define L2_S_PROT_MASK L2_S_PROT_MASK_xscale + +#define L1_S_CACHE_MASK L1_S_CACHE_MASK_xscale +#define L2_L_CACHE_MASK L2_L_CACHE_MASK_xscale +#define L2_S_CACHE_MASK L2_S_CACHE_MASK_xscale + +#define L1_S_PROTO L1_S_PROTO_xscale +#define L1_C_PROTO L1_C_PROTO_xscale +#define L2_S_PROTO L2_S_PROTO_xscale + #else #define ARM_L1S_STRONG_ORD (0) #define ARM_L1S_DEVICE_NOSHARE (L1_S_TEX(2)) From owner-svn-src-head@FreeBSD.ORG Sun Mar 23 22:23:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A147F50; Sun, 23 Mar 2014 22:23:10 +0000 (UTC) Received: from mail-qc0-x236.google.com (mail-qc0-x236.google.com [IPv6:2607:f8b0:400d:c01::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C9E69CF6; Sun, 23 Mar 2014 22:23:09 +0000 (UTC) Received: by mail-qc0-f182.google.com with SMTP id e16so5019099qcx.41 for ; Sun, 23 Mar 2014 15:23:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=+dEaNuJLjb87vh6n4Oq/pfaQ0r4YNS4YKSVPy3QdWmI=; b=P2Xhl5ix6vLJ9wJh/xGCksfBtr3AeTzj/0++ST9ZxNFzHX5D+/SkMM5ImtJGrxogzS tTVoyZXWPUHNV4Is4w+GnjY44qnpQoMEB37VcbQ5SN+tO2TY9MvwSWgFnQJZk0hrd/Jb SgaCyRfU9Ta0fTxiaPLXOIweo2PE4Xr6u8tvwc++0Tsv4v8lW6DSivxHpgbknJzm2lQC duOZJgtYHntKt8xwNDIETSMHugyoKgzLGMm80/PMybVfOFLi5fE8uZnS9lAVIuaPD160 6dsOXDfMC6p8KkLvzpCFdEu6OzVzX2b2dYivu73h10Rf3Khx8+buyRZabY27sL0i4l/C BvUg== MIME-Version: 1.0 X-Received: by 10.140.92.201 with SMTP id b67mr16051120qge.58.1395613389076; Sun, 23 Mar 2014 15:23:09 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.8.137 with HTTP; Sun, 23 Mar 2014 15:23:09 -0700 (PDT) In-Reply-To: <201403191453.47690.jhb@freebsd.org> References: <201403182222.s2IMMmOM081929@svn.freebsd.org> <201403191453.47690.jhb@freebsd.org> Date: Sun, 23 Mar 2014 15:23:09 -0700 X-Google-Sender-Auth: LAEpax31rOzttMvOo-zf7PZGBwI Message-ID: Subject: Re: svn commit: r263321 - head/sys/dev/vt From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , Aleksandr Rybalko , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2014 22:23:10 -0000 It doesn't fix the panic. Also, I'm going ot run with it =1 for now to see if it fixes the resume issues I've been seeing. -a On 19 March 2014 11:53, John Baldwin wrote: > On Tuesday, March 18, 2014 6:22:48 pm Aleksandr Rybalko wrote: >> Author: ray >> Date: Tue Mar 18 22:22:47 2014 >> New Revision: 263321 >> URL: http://svnweb.freebsd.org/changeset/base/263321 >> >> Log: >> Switch kern.vt.suspendswitch to 0 by default (disabled). >> kern.vt.suspendswitch - sysctl/tunable which enable switch to VT0 before going >> to suspend and switch back after resume. >> >> MFC after: 7 days > > I think it is fine to change the default, but I'm not certain that this fixes > the panics on resume. So far no one has reported back that this did fix them > after I suggested it. It would be good to fix the panics as well if possible. > The last time I looked at it in detail, it seemed like the callout for only > ttyv0 had been zero'd. Other ttyv timers used in switching still had the correct > contents. > > -- > John Baldwin > From owner-svn-src-head@FreeBSD.ORG Mon Mar 24 00:19:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41A8A882; Mon, 24 Mar 2014 00:19:56 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 101F7826; Mon, 24 Mar 2014 00:19:55 +0000 (UTC) Received: from glenbarber.us (70.15.88.86.res-cmts.sewb.ptd.net [70.15.88.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 8174B15980; Mon, 24 Mar 2014 00:19:47 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 8174B15980 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Sun, 23 Mar 2014 20:19:44 -0400 From: Glen Barber To: John Baldwin Subject: Re: svn commit: r263321 - head/sys/dev/vt Message-ID: <20140324001944.GT3452@glenbarber.us> References: <201403182222.s2IMMmOM081929@svn.freebsd.org> <201403191453.47690.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="o6aug3O60clXg2rj" Content-Disposition: inline In-Reply-To: <201403191453.47690.jhb@freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, Aleksandr Rybalko , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 00:19:56 -0000 --o6aug3O60clXg2rj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 19, 2014 at 02:53:47PM -0400, John Baldwin wrote: > On Tuesday, March 18, 2014 6:22:48 pm Aleksandr Rybalko wrote: > > Author: ray > > Date: Tue Mar 18 22:22:47 2014 > > New Revision: 263321 > > URL: http://svnweb.freebsd.org/changeset/base/263321 > >=20 > > Log: > > Switch kern.vt.suspendswitch to 0 by default (disabled). > > kern.vt.suspendswitch - sysctl/tunable which enable switch to VT0 bef= ore going > > to suspend and switch back after resume. > > =20 > > MFC after: 7 days >=20 > I think it is fine to change the default, but I'm not certain that this f= ixes > the panics on resume. So far no one has reported back that this did fix = them > after I suggested it. It would be good to fix the panics as well if poss= ible. > The last time I looked at it in detail, it seemed like the callout for on= ly > ttyv0 had been zero'd. Other ttyv timers used in switching still had the= correct > contents. >=20 I can confirm setting kern.vt.suspendswitch=3D0 fixes the panic for me. Glen --o6aug3O60clXg2rj Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTL3ogAAoJELls3eqvi17QxzgP/AmZVO626hZem9epvvYCQrHc 7LkZrJIQTEZkVcfsUxssqSHwwdL2A+Rk3qDYPKtGRdkazCBrZ43dQlCJMrXNoE1P GDkRwu+a930v5VHc5McIMRLpT+yrEju+iOeGCdBkn+/jAE7y6wJSPLJqtGixcbvy eThYpwlQOKNNJKp3lSeJpyLft5ZPG544qHfer07mCURDtx9JTasGAvEqhF34s0/K +W1sAW/eqdAM6S9DLY5DTtwJUip68TA8O8ecVdWGxbgKpCj5B49bNyTn/D6NaBmm N8lxKgGLW3ScdCauWcf8P8Sg+ndSXpXU4PjQ6uOznYKlyZDrcK/odzYrD/jM8DnT 1Yl2+0sAAaBsg7nSsLDjGdFIa+j5oNtNfGTeRSW0O+hJAoHH656rJYE6fXalJEMK WYlsn5p5JsNCaAerg+IpMnOcARbzB2QCNlYHCAyjuDeo5Kbliu88Jt4jqbBBvbhR S4XhCYVy4Uoop6QENtVN0gP8P+YGpNSDtd5yiOg0cLrv1OQbiOy/r9Pdzzg0oljr jdZ+45VR0VThxIqngxJ4TPgaVBd1YGOvPl4BssYl/X+ZmnNr6JwrI9c3Hz8KpO0w MBoZDCIjKzKmnACkJNoNfxAZzpxHdNBonO+MBLP6qSIDHin4kjB3frDqSEV+iInO zatMuZRUzmc3M0Lc3G5X =qAQa -----END PGP SIGNATURE----- --o6aug3O60clXg2rj-- From owner-svn-src-head@FreeBSD.ORG Mon Mar 24 01:21:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03023BAB; Mon, 24 Mar 2014 01:21:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E34E1D1C; Mon, 24 Mar 2014 01:21:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2O1LbPv005018; Mon, 24 Mar 2014 01:21:37 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2O1Lbkd005016; Mon, 24 Mar 2014 01:21:37 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403240121.s2O1Lbkd005016@svn.freebsd.org> From: Ed Maste Date: Mon, 24 Mar 2014 01:21:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263678 - head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 01:21:38 -0000 Author: emaste Date: Mon Mar 24 01:21:37 2014 New Revision: 263678 URL: http://svnweb.freebsd.org/changeset/base/263678 Log: lldb: Invoke PT_KILL from ProcessPosix::DoDestroy We previously sent SIGKILL to the debuggee in DoDestroy, but did not actually detach or kill via ptrace. It seems that this somehow didn't matter on Linux, but did on FreeBSD. This would happen when quitting LLDB while stopped at a breakpoint, for example. The debuggee remained stopped in ptrace (with the signal either pending or lost). After a timeout of a second or two LLDB exits, which caused the debuggee to resume and dump core from an unhandled SIGTRAP. BringProcessIntoLimbo is a poorly named wrapper for ptrace(PT_KILL) which is the desired behaviour from DoDestroy. http://llvm.org/pr18894 Sponsored by: DARPA, AFRL Modified: head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp Modified: head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp Mon Mar 24 00:50:12 2014 (r263677) +++ head/contrib/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp Mon Mar 24 01:21:37 2014 (r263678) @@ -335,11 +335,9 @@ ProcessPOSIX::DoDestroy() if (!HasExited()) { - // Drive the exit event to completion (do not keep the inferior in - // limbo). + assert (m_monitor); m_exit_now = true; - - if ((m_monitor == NULL || kill(m_monitor->GetPID(), SIGKILL)) && error.Success()) + if (m_monitor->BringProcessIntoLimbo()) { error.SetErrorToErrno(); return error; From owner-svn-src-head@FreeBSD.ORG Mon Mar 24 05:44:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 53693692; Mon, 24 Mar 2014 05:44:42 +0000 (UTC) Date: Mon, 24 Mar 2014 05:44:42 +0000 From: Alexey Dokuchaev To: Justin Hibbits Subject: Re: svn commit: r261342 - in head: lib/libpmc sys/conf sys/dev/hwpmc sys/powerpc/include sys/sys Message-ID: <20140324054442.GA98485@FreeBSD.org> References: <201402010203.s1123pjF019150@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="cWoXeonUoKmBZSoM" Content-Disposition: inline In-Reply-To: <201402010203.s1123pjF019150@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 05:44:42 -0000 --cWoXeonUoKmBZSoM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Feb 01, 2014 at 02:03:51AM +0000, Justin Hibbits wrote: > New Revision: 261342 > URL: http://svnweb.freebsd.org/changeset/base/261342 > > Log: > Add hwpmc(4) support for the PowerPC 970 class processors, direct events. > This also fixes asserts on removal of the module for the mpc74xx. Hmm, -CURRENT does not build for me after this commit apparently; take a look at the log excerpt. Could it be that r261342 relies on some earlier revision which I'm missing (that is, my r260369'ish -CURRENT is too old)? What's the best way to catch up? Thanks, ./danfe --cWoXeonUoKmBZSoM Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="bw.log" ===> lib/libpmc (all) /usr/local/libexec/ccache/world/cc -O2 -pipe -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /usr/src/lib/libpmc/libpmc.c -o libpmc.o cc1: warnings being treated as errors /usr/src/lib/libpmc/libpmc.c:160: warning: implicit declaration of function '__PMC_EV_PPC970' /usr/src/lib/libpmc/libpmc.c:160: warning: missing braces around initializer /usr/src/lib/libpmc/libpmc.c:160: warning: (near initialization for 'ppc970_event_table[0]') /usr/src/lib/libpmc/libpmc.c:160: error: initializer element is not constant /usr/src/lib/libpmc/libpmc.c:160: error: (near initialization for 'ppc970_event_table[0].pm_ev_name') /usr/src/lib/libpmc/libpmc.c:160: warning: missing initializer /usr/src/lib/libpmc/libpmc.c:160: warning: (near initialization for 'ppc970_event_table[0].pm_ev_name') /usr/src/lib/libpmc/libpmc.c:174: warning: implicit declaration of function '__PMC_EV_ALIAS_ATOM_SILVERMONT' /usr/src/lib/libpmc/libpmc.c:175: warning: missing braces around initializer /usr/src/lib/libpmc/libpmc.c:175: warning: (near initialization for 'atom_silvermont_event_table[0]') /usr/src/lib/libpmc/libpmc.c:175: error: initializer element is not constant /usr/src/lib/libpmc/libpmc.c:175: error: (near initialization for 'atom_silvermont_event_table[0].pm_ev_name') /usr/src/lib/libpmc/libpmc.c:175: warning: missing initializer /usr/src/lib/libpmc/libpmc.c:175: warning: (near initialization for 'atom_silvermont_event_table[0].pm_ev_name') /usr/src/lib/libpmc/libpmc.c:273: error: 'PMC_CLASS_PPC970' undeclared here (not in a function) /usr/src/lib/libpmc/libpmc.c:273: error: initializer element is not constant /usr/src/lib/libpmc/libpmc.c:273: error: (near initialization for 'ppc970_pmc_classes[0]') /usr/src/lib/libpmc/libpmc.c:273: error: initializer element is not constant /usr/src/lib/libpmc/libpmc.c:273: error: (near initialization for 'ppc970_pmc_classes[2]') /usr/src/lib/libpmc/libpmc.c:336: error: initializer element is not constant /usr/src/lib/libpmc/libpmc.c:336: error: (near initialization for 'ppc970_class_table_descr.pm_evc_class') /usr/src/lib/libpmc/libpmc.c: In function 'pmc_event_names_of_class': /usr/src/lib/libpmc/libpmc.c:2746: error: 'PMC_CPU_INTEL_ATOM_SILVERMONT' undeclared (first use in this function) /usr/src/lib/libpmc/libpmc.c:2746: error: (Each undeclared identifier is reported only once /usr/src/lib/libpmc/libpmc.c:2746: error: for each function it appears in.) /usr/src/lib/libpmc/libpmc.c: In function 'pmc_init': /usr/src/lib/libpmc/libpmc.c:3135: error: 'PMC_CPU_PPC_970' undeclared (first use in this function) /usr/src/lib/libpmc/libpmc.c: In function '_pmc_name_of_event': /usr/src/lib/libpmc/libpmc.c:3222: error: 'PMC_CPU_INTEL_ATOM_SILVERMONT' undeclared (first use in this function) /usr/src/lib/libpmc/libpmc.c:3314: error: 'PMC_EV_PPC970_FIRST' undeclared (first use in this function) /usr/src/lib/libpmc/libpmc.c:3314: warning: comparison between pointer and integer /usr/src/lib/libpmc/libpmc.c:3314: error: 'PMC_EV_PPC970_LAST' undeclared (first use in this function) /usr/src/lib/libpmc/libpmc.c:3314: warning: comparison between pointer and integer *** Error code 1 --cWoXeonUoKmBZSoM-- From owner-svn-src-head@FreeBSD.ORG Mon Mar 24 05:58:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15F8B975; Mon, 24 Mar 2014 05:58:25 +0000 (UTC) Received: from mail-yh0-x22e.google.com (mail-yh0-x22e.google.com [IPv6:2607:f8b0:4002:c01::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C1F83B4; Mon, 24 Mar 2014 05:58:24 +0000 (UTC) Received: by mail-yh0-f46.google.com with SMTP id b6so4702471yha.19 for ; Sun, 23 Mar 2014 22:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=CRJE9VX4//MXrM0VLUrBkD4EpDAi2GmyAuIvgK7lmjE=; b=ydjF7kGlchvJE2pFVs83xUYGYijkngpLhULZTP7cstZsKUe8Rhghg9O6KDl+GN4vtm Z2z7UNYcK6CQ4hoyZDusHMS/uFWwTqlNtcs6OKBZJ+eDGXnfRuerQQgIrFTg8dnq3Cx5 vQb3vwxUMdR9XFnovaekE57DDiovfeCho1sIc5/0te6eR6MibxD3+zLmrt2TGWMtKqvf SmYBBar8j/qdqHXFYhe3GZnbC4vzBmWSDEs1855jECc+EnkQ517YOle9PIFh48JG3kwN KDl/2iVssLviPV4LbS28vFP8qQ+HhOJHfhvZhN9yDOerLlxqv+YyjWEeQNbRSjR2Fa6Q 7Lsg== X-Received: by 10.236.162.65 with SMTP id x41mr62308466yhk.25.1395640703091; Sun, 23 Mar 2014 22:58:23 -0700 (PDT) Received: from zhabar.att.net (107-222-186-3.lightspeed.sntcca.sbcglobal.net. [107.222.186.3]) by mx.google.com with ESMTPSA id e5sm21880624yhj.14.2014.03.23.22.58.22 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Sun, 23 Mar 2014 22:58:23 -0700 (PDT) Date: Sun, 23 Mar 2014 22:58:18 -0700 From: Justin Hibbits To: Alexey Dokuchaev Subject: Re: svn commit: r261342 - in head: lib/libpmc sys/conf sys/dev/hwpmc sys/powerpc/include sys/sys Message-ID: <20140323225818.58f41de3@zhabar.att.net> In-Reply-To: <20140324054442.GA98485@FreeBSD.org> References: <201402010203.s1123pjF019150@svn.freebsd.org> <20140324054442.GA98485@FreeBSD.org> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.22; powerpc64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 05:58:25 -0000 On Mon, 24 Mar 2014 05:44:42 +0000 Alexey Dokuchaev wrote: > On Sat, Feb 01, 2014 at 02:03:51AM +0000, Justin Hibbits wrote: > > New Revision: 261342 > > URL: http://svnweb.freebsd.org/changeset/base/261342 > > > > Log: > > Add hwpmc(4) support for the PowerPC 970 class processors, direct > > events. This also fixes asserts on removal of the module for the > > mpc74xx. > > Hmm, -CURRENT does not build for me after this commit apparently; > take a look at the log excerpt. Could it be that r261342 relies on > some earlier revision which I'm missing (that is, my r260369'ish > -CURRENT is too old)? What's the best way to catch up? Thanks, > > ./danfe It looks to me like it's picking up your old PMC header files. Did you try doing a full buildworld (without a -DNO_CLEAN)? I've built world multiple times since and it works just fine for me. - Justin From owner-svn-src-head@FreeBSD.ORG Mon Mar 24 08:24:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02A12CC3; Mon, 24 Mar 2014 08:24:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D65C71B1; Mon, 24 Mar 2014 08:24:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2O8OWN8075947; Mon, 24 Mar 2014 08:24:32 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2O8OWjo075946; Mon, 24 Mar 2014 08:24:32 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201403240824.s2O8OWjo075946@svn.freebsd.org> From: Andrew Turner Date: Mon, 24 Mar 2014 08:24:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263679 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 08:24:33 -0000 Author: andrew Date: Mon Mar 24 08:24:32 2014 New Revision: 263679 URL: http://svnweb.freebsd.org/changeset/base/263679 Log: Move an else case that was missed in r263676 Modified: head/sys/arm/include/pmap.h Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Mon Mar 24 01:21:37 2014 (r263678) +++ head/sys/arm/include/pmap.h Mon Mar 24 08:24:32 2014 (r263679) @@ -421,6 +421,31 @@ extern int pmap_needs_pte_sync; #define ARM_L2S_NRML_IWT_OWT (L2_C) #define ARM_L2S_NRML_IWB_OWB (L2_C|L2_B) #define ARM_L2S_NRML_IWBA_OWBA (L2_S_TEX(1)|L2_C|L2_B) +#else +#define ARM_L1S_STRONG_ORD (0) +#define ARM_L1S_DEVICE_NOSHARE (L1_S_TEX(2)) +#define ARM_L1S_DEVICE_SHARE (L1_S_B) +#define ARM_L1S_NRML_NOCACHE (L1_S_TEX(1)|L1_SHARED) +#define ARM_L1S_NRML_IWT_OWT (L1_S_C|L1_SHARED) +#define ARM_L1S_NRML_IWB_OWB (L1_S_C|L1_S_B|L1_SHARED) +#define ARM_L1S_NRML_IWBA_OWBA (L1_S_TEX(1)|L1_S_C|L1_S_B|L1_SHARED) + +#define ARM_L2L_STRONG_ORD (0) +#define ARM_L2L_DEVICE_NOSHARE (L2_L_TEX(2)) +#define ARM_L2L_DEVICE_SHARE (L2_B) +#define ARM_L2L_NRML_NOCACHE (L2_L_TEX(1)|L2_SHARED) +#define ARM_L2L_NRML_IWT_OWT (L2_C|L2_SHARED) +#define ARM_L2L_NRML_IWB_OWB (L2_C|L2_B|L2_SHARED) +#define ARM_L2L_NRML_IWBA_OWBA (L2_L_TEX(1)|L2_C|L2_B|L2_SHARED) + +#define ARM_L2S_STRONG_ORD (0) +#define ARM_L2S_DEVICE_NOSHARE (L2_S_TEX(2)) +#define ARM_L2S_DEVICE_SHARE (L2_B) +#define ARM_L2S_NRML_NOCACHE (L2_S_TEX(1)|L2_SHARED) +#define ARM_L2S_NRML_IWT_OWT (L2_C|L2_SHARED) +#define ARM_L2S_NRML_IWB_OWB (L2_C|L2_B|L2_SHARED) +#define ARM_L2S_NRML_IWBA_OWBA (L2_S_TEX(1)|L2_C|L2_B|L2_SHARED) +#endif /* SMP */ #elif ARM_NMMUS > 1 /* More than one MMU class configured; use variables. */ @@ -462,31 +487,6 @@ extern int pmap_needs_pte_sync; #define L1_C_PROTO L1_C_PROTO_xscale #define L2_S_PROTO L2_S_PROTO_xscale -#else -#define ARM_L1S_STRONG_ORD (0) -#define ARM_L1S_DEVICE_NOSHARE (L1_S_TEX(2)) -#define ARM_L1S_DEVICE_SHARE (L1_S_B) -#define ARM_L1S_NRML_NOCACHE (L1_S_TEX(1)|L1_SHARED) -#define ARM_L1S_NRML_IWT_OWT (L1_S_C|L1_SHARED) -#define ARM_L1S_NRML_IWB_OWB (L1_S_C|L1_S_B|L1_SHARED) -#define ARM_L1S_NRML_IWBA_OWBA (L1_S_TEX(1)|L1_S_C|L1_S_B|L1_SHARED) - -#define ARM_L2L_STRONG_ORD (0) -#define ARM_L2L_DEVICE_NOSHARE (L2_L_TEX(2)) -#define ARM_L2L_DEVICE_SHARE (L2_B) -#define ARM_L2L_NRML_NOCACHE (L2_L_TEX(1)|L2_SHARED) -#define ARM_L2L_NRML_IWT_OWT (L2_C|L2_SHARED) -#define ARM_L2L_NRML_IWB_OWB (L2_C|L2_B|L2_SHARED) -#define ARM_L2L_NRML_IWBA_OWBA (L2_L_TEX(1)|L2_C|L2_B|L2_SHARED) - -#define ARM_L2S_STRONG_ORD (0) -#define ARM_L2S_DEVICE_NOSHARE (L2_S_TEX(2)) -#define ARM_L2S_DEVICE_SHARE (L2_B) -#define ARM_L2S_NRML_NOCACHE (L2_S_TEX(1)|L2_SHARED) -#define ARM_L2S_NRML_IWT_OWT (L2_C|L2_SHARED) -#define ARM_L2S_NRML_IWB_OWB (L2_C|L2_B|L2_SHARED) -#define ARM_L2S_NRML_IWBA_OWBA (L2_S_TEX(1)|L2_C|L2_B|L2_SHARED) -#endif /* SMP */ #endif /* ARM_NMMUS > 1 */ #if defined(CPU_XSCALE_81342) || ARM_ARCH_6 || ARM_ARCH_7A From owner-svn-src-head@FreeBSD.ORG Mon Mar 24 13:13:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31BDA178; Mon, 24 Mar 2014 13:13:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1ED8B231; Mon, 24 Mar 2014 13:13:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2ODDqmu098317; Mon, 24 Mar 2014 13:13:52 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2ODDqBA098316; Mon, 24 Mar 2014 13:13:52 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403241313.s2ODDqBA098316@svn.freebsd.org> From: Bryan Drewery Date: Mon, 24 Mar 2014 13:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263686 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 13:13:53 -0000 Author: bdrewery Date: Mon Mar 24 13:13:52 2014 New Revision: 263686 URL: http://svnweb.freebsd.org/changeset/base/263686 Log: Add missing LIBM to DPADD from r263650 Reported by: jilles Modified: head/usr.sbin/pkg/Makefile Modified: head/usr.sbin/pkg/Makefile ============================================================================== --- head/usr.sbin/pkg/Makefile Mon Mar 24 12:41:00 2014 (r263685) +++ head/usr.sbin/pkg/Makefile Mon Mar 24 13:13:52 2014 (r263686) @@ -7,7 +7,7 @@ MAN= pkg.7 CFLAGS+=-I${.CURDIR}/../../contrib/libucl/include .PATH: ${.CURDIR}/../../contrib/libucl/include DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBUCL} ${LIBSBUF} ${LIBSSL} \ - ${LIBCRYPTO} + ${LIBCRYPTO} ${LIBM} LDADD= -larchive -lelf -lfetch -lucl -lsbuf -lssl -lcrypto -lm USEPRIVATELIB= ucl From owner-svn-src-head@FreeBSD.ORG Mon Mar 24 16:50:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BE803B7; Mon, 24 Mar 2014 16:50:51 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id 6461CC81; Mon, 24 Mar 2014 16:50:51 +0000 (UTC) Received: from c0181.aw.cl.cam.ac.uk (c0181.aw.cl.cam.ac.uk [128.232.100.181]) by cyrus.watson.org (Postfix) with ESMTPSA id 82DD146B35; Mon, 24 Mar 2014 12:50:46 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263252 - head/sys/sys From: "Robert N. M. Watson" In-Reply-To: Date: Mon, 24 Mar 2014 16:50:44 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <4240E32C-E0D8-4178-A278-4F5E20040E18@FreeBSD.org> References: <201403162105.s2GL50QJ064272@svn.freebsd.org> To: Eitan Adler X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 16:50:51 -0000 On 17 Mar 2014, at 01:48, Eitan Adler wrote: >> Fix a comment in capability.h: it got renamed to capsicum.h, not >> capability.h. >=20 > Perhaps it makes to sense to add a #warning statement to the file as = well? >=20 > Additionally, is it intended that this file live forever or will be > removed as some point in the future? Sorry about not following up more quickly. I don't want to add a #warning until after all in-tree consumers are = converted, and I'm not yet ready to merge a new OpenBSM. I also want to = wait until after the new header is available in 10-STABLE ... and = possibly has appeared in a release. But it is something I plan to do in = due course. Robert= From owner-svn-src-head@FreeBSD.ORG Mon Mar 24 18:13:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97AE68D2; Mon, 24 Mar 2014 18:13:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8468A850; Mon, 24 Mar 2014 18:13:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2OIDfHv024722; Mon, 24 Mar 2014 18:13:41 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2OIDfEd024721; Mon, 24 Mar 2014 18:13:41 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201403241813.s2OIDfEd024721@svn.freebsd.org> From: Maksim Yevmenkin Date: Mon, 24 Mar 2014 18:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263690 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 18:13:41 -0000 Author: emax Date: Mon Mar 24 18:13:41 2014 New Revision: 263690 URL: http://svnweb.freebsd.org/changeset/base/263690 Log: change defaule permissions on /dev/devstat. while i'm here remove D_NEEDGIANT flag Submitted by: jhb Reviewed by: jhb, scottl, rwatson, delphij, phk MFC after: 1 week Modified: head/sys/kern/subr_devstat.c Modified: head/sys/kern/subr_devstat.c ============================================================================== --- head/sys/kern/subr_devstat.c Mon Mar 24 15:22:22 2014 (r263689) +++ head/sys/kern/subr_devstat.c Mon Mar 24 18:13:41 2014 (r263690) @@ -460,7 +460,6 @@ static d_mmap_t devstat_mmap; static struct cdevsw devstat_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, .d_mmap = devstat_mmap, .d_name = "devstat", }; @@ -482,13 +481,16 @@ devstat_mmap(struct cdev *dev, vm_ooffse if (nprot != VM_PROT_READ) return (-1); + mtx_lock(&devstat_mutex); TAILQ_FOREACH(spp, &pagelist, list) { if (offset == 0) { *paddr = vtophys(spp->stat); + mtx_unlock(&devstat_mutex); return (0); } offset -= PAGE_SIZE; } + mtx_unlock(&devstat_mutex); return (-1); } @@ -503,7 +505,7 @@ devstat_alloc(void) mtx_assert(&devstat_mutex, MA_NOTOWNED); if (!once) { make_dev_credf(MAKEDEV_ETERNAL | MAKEDEV_CHECKNAME, - &devstat_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0400, + &devstat_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0444, DEVSTAT_DEVICE_NAME); once = 1; } From owner-svn-src-head@FreeBSD.ORG Mon Mar 24 18:59:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 347A7649; Mon, 24 Mar 2014 18:59:51 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1002CC35; Mon, 24 Mar 2014 18:59:50 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s2OIxooX041940 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 24 Mar 2014 11:59:50 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s2OIxoQB041939; Mon, 24 Mar 2014 11:59:50 -0700 (PDT) (envelope-from jmg) Date: Mon, 24 Mar 2014 11:59:50 -0700 From: John-Mark Gurney To: Maksim Yevmenkin Subject: Re: svn commit: r263690 - head/sys/kern Message-ID: <20140324185949.GR32089@funkthat.com> References: <201403241813.s2OIDfEd024721@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201403241813.s2OIDfEd024721@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Mon, 24 Mar 2014 11:59:50 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 18:59:51 -0000 Maksim Yevmenkin wrote this message on Mon, Mar 24, 2014 at 18:13 +0000: > Author: emax > Date: Mon Mar 24 18:13:41 2014 > New Revision: 263690 > URL: http://svnweb.freebsd.org/changeset/base/263690 > > Log: > change defaule permissions on /dev/devstat. while i'm here remove > D_NEEDGIANT flag I know that the following change is part of the remove D_NEEDGIANT, but I'm puzzled how this code either worked before, or continues to work.. It looks like pagelist was suppose to be protected by devstat_mutex, but previously wasn't and that this is fixing that bug, is this correct? > @@ -482,13 +481,16 @@ devstat_mmap(struct cdev *dev, vm_ooffse > > if (nprot != VM_PROT_READ) > return (-1); > + mtx_lock(&devstat_mutex); > TAILQ_FOREACH(spp, &pagelist, list) { > if (offset == 0) { > *paddr = vtophys(spp->stat); > + mtx_unlock(&devstat_mutex); > return (0); > } > offset -= PAGE_SIZE; > } > + mtx_unlock(&devstat_mutex); > return (-1); > } > -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Mon Mar 24 19:15:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 020389BB; Mon, 24 Mar 2014 19:15:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E0E11DB4; Mon, 24 Mar 2014 19:15:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2OJFKri049289; Mon, 24 Mar 2014 19:15:20 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2OJFEb4049250; Mon, 24 Mar 2014 19:15:14 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201403241915.s2OJFEb4049250@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 24 Mar 2014 19:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263691 - in head/crypto/openssh: . contrib openbsd-compat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 19:15:21 -0000 Author: des Date: Mon Mar 24 19:15:13 2014 New Revision: 263691 URL: http://svnweb.freebsd.org/changeset/base/263691 Log: Add a pre-merge script which reverts mechanical changes such as added $FreeBSD$ tags and man page dates. Add a post-merge script which reapplies these changes. Run both scripts to normalize the existing code base. As a result, many files which should have had $FreeBSD$ tags but didn't now have them. Partly rewrite the upgrade instructions and remove the now outdated list of tricks. Added: head/crypto/openssh/freebsd-post-merge.sh (contents, props changed) head/crypto/openssh/freebsd-pre-merge.sh (contents, props changed) Deleted: head/crypto/openssh/FREEBSD-tricks Modified: head/crypto/openssh/FREEBSD-upgrade head/crypto/openssh/auth.c head/crypto/openssh/auth2.c head/crypto/openssh/buffer.c head/crypto/openssh/channels.c head/crypto/openssh/cipher.c head/crypto/openssh/clientloop.c head/crypto/openssh/compat.c head/crypto/openssh/contrib/ssh-copy-id.1 (contents, props changed) head/crypto/openssh/kex.c head/crypto/openssh/misc.c head/crypto/openssh/moduli.5 (contents, props changed) head/crypto/openssh/mux.c (contents, props changed) head/crypto/openssh/openbsd-compat/blowfish.c (contents, props changed) head/crypto/openssh/openbsd-compat/bsd-misc.h (contents, props changed) head/crypto/openssh/packet.c head/crypto/openssh/pathnames.h (contents, props changed) head/crypto/openssh/sandbox-capsicum.c (contents, props changed) head/crypto/openssh/schnorr.c head/crypto/openssh/scp.1 (contents, props changed) head/crypto/openssh/serverloop.c head/crypto/openssh/sftp-common.c (contents, props changed) head/crypto/openssh/sftp.c head/crypto/openssh/ssh-add.1 (contents, props changed) head/crypto/openssh/ssh-agent.c head/crypto/openssh/ssh-gss.h (contents, props changed) head/crypto/openssh/ssh-keysign.8 (contents, props changed) head/crypto/openssh/ssh-pkcs11-helper.8 (contents, props changed) head/crypto/openssh/sshconnect.c head/crypto/openssh/sshconnect2.c Modified: head/crypto/openssh/FREEBSD-upgrade ============================================================================== --- head/crypto/openssh/FREEBSD-upgrade Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/FREEBSD-upgrade Mon Mar 24 19:15:13 2014 (r263691) @@ -3,81 +3,97 @@ FreeBSD maintainer's guide to OpenSSH-portable ============================================== -XXX -XXX this needs a complete rewrite -XXX svn merge from vendor branch, resolve conflicts manually -XXX (see FREEBSD-tricks for tips on how to reduce conflicts) -XXX run freebsd-configure.sh to generate config.h and krb5_config.h -XXX svn diff Makefile.in to see if the Makefiles need adjusting -XXX +00) Make sure your mail spool has plenty of free space. It'll fill up + pretty fast once you're done with this checklist. -0) Make sure your mail spool has plenty of free space. It'll fill up - pretty fast once you're done with this checklist. +01) Download the latest OpenSSH-portable tarball and signature from + OpenBSD (ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/). -1) Grab the latest OpenSSH-portable tarball from the OpenBSD FTP - site (ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/) +02) Verify the signature: -2) Unpack the tarball in a suitable directory. + $ gpg --verify openssh-X.YpZ.tar.gz.asc - $ tar xf openssh-X.YpZ.tar.gz \ - -X /usr/src/crypto/openssh/FREEBSD-Xlist +03) Unpack the tarball in a suitable directory: -3) Remove trash: + $ tar xf openssh-X.YpZ.tar.gz - Make sure -X took care of everything, and if it didn't, make sure - to update FREEBSD-Xlist so you won't miss it the next time. A good - way to do this is to run a test import and see if any new files - show up: +04) Copy to the vendor directory: - $ cvs -n import src/crypto/openssh OPENSSH x | grep \^N + $ svn co svn+ssh://svn.freebsd.org/base/vendor-crypto/openssh/dist + $ rsync --archive --delete openssh-X.YpZ/ dist/ -4) Import the sources: +05) Take care of added / deleted files: - $ cvs import src/crypto/openssh OPENSSH OpenSSH_X_YpZ + $ svn rm $(svn stat dist | awk '$1 == "!" { print $2 }') + $ svn add --no-auto-props $(svn stat dist | awk '$1 == "?" { print $2 }') -5) Resolve conflicts. Remember to bump the version number and - addendum in version.h, and update the default value in - ssh{,d}_config and ssh{,d}_config.5. +06) Commit: -6) Generate configure and config.h.in: + $ svn commit -m "Vendor import of OpenSSH X.YpZ." dist - $ autoconf - $ autoheader +07) Tag: - Note: this requires a recent version of autoconf, not autoconf213. + $ svn copy -m "Tag OpenSSH X.YpZ." \ + svn+ssh://svn.freebsd.org/base/vendor-crypto/openssh/dist \ + svn+ssh://svn.freebsd.org/base/vendor-crypto/openssh/X.YpZ -7) Run configure with the appropriate arguments: +08) Check out head and run the pre-merge script: - $ ./configure --prefix=/usr --sysconfdir=/etc/ssh \ - --with-pam --with-tcp-wrappers --with-libedit \ - --with-ssl-engine + $ svn co svn+ssh://svn.freebsd.org/base/head + $ cd head/crypto/openssh + $ sh freebsd-pre-merge.sh - This will regenerate config.h, which must be committed along with - the rest. +09) Merge from the vendor branch: - Note that we don't want to configure OpenSSH for Kerberos using - configure since we have to be able to turn it on or off depending - on the value of MK_KERBEROS. Our Makefiles take care of this. + $ svn merge -cNNNNNN \^/vendor-crypto/openssh/dist . -8) If source files have been added or removed, update the appropriate - makefiles to reflect changes in the vendor's Makefile.in. +0A) Resolve conflicts. Remember to bump the version addendum in + version.h, and update the default value in ssh{,d}_config and + ssh{,d}_config.5. -9) Build libssh. Follow the instructions in ssh_namespace.h to get a - list of new symbols. Update ssh_namespace.h, build everything, - install and test. +0B) Diff against the vendor branch: -A) Build and test the pam_ssh PAM module. It gropes around libssh's - internals and will break if something significant changes or if - ssh_namespace.h is out of whack. + $ svn diff \^/vendor-crypto/openssh/dist . -B) Re-commit everything on repoman (you *did* use a test repo for - this, didn't you?) + Files that have modifications relative to the vendor code, and + only those files, must have the svn:keywords property set to + FreeBSD=%H and be listed in the 'keywords' file created by the + pre-merge script. + +0C) Run the post-merge script: + + $ sh freebsd-post-merge.sh + +0D) Run the configure script: + + $ sh freebsd-configure.sh + +0E) Check config.h very carefully. + +0F) If source files have been added or removed, update the appropriate + makefiles to reflect changes in the vendor's Makefile.in. + +10) Build libssh: + + $ cd ../../secure/lib/libssh && make obj && make depend && make + +11) Follow the instructions in ssh_namespace.h to get a list of new + symbols, and them to ssh_namespace.h. Keep it sorted! + +12) Build and install world, reboot, test. Pay particular attention + to pam_ssh(8), which gropes inside libssh and will break if + something significant changes or if ssh_namespace.h is out of + whack. + +13) Commit, and hunker down for the inevitable storm of complaints. An overview of FreeBSD changes to OpenSSH-portable ================================================== +XXX This section is out of date + 0) VersionAddendum The SSH protocol allows for a human-readable version string of up Modified: head/crypto/openssh/auth.c ============================================================================== --- head/crypto/openssh/auth.c Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/auth.c Mon Mar 24 19:15:13 2014 (r263691) @@ -1,4 +1,5 @@ /* $OpenBSD: auth.c,v 1.103 2013/05/19 02:42:42 djm Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Modified: head/crypto/openssh/auth2.c ============================================================================== --- head/crypto/openssh/auth2.c Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/auth2.c Mon Mar 24 19:15:13 2014 (r263691) @@ -1,4 +1,5 @@ /* $OpenBSD: auth2.c,v 1.129 2013/05/19 02:42:42 djm Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Modified: head/crypto/openssh/buffer.c ============================================================================== --- head/crypto/openssh/buffer.c Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/buffer.c Mon Mar 24 19:15:13 2014 (r263691) @@ -14,6 +14,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include Modified: head/crypto/openssh/channels.c ============================================================================== --- head/crypto/openssh/channels.c Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/channels.c Mon Mar 24 19:15:13 2014 (r263691) @@ -41,6 +41,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: head/crypto/openssh/cipher.c ============================================================================== --- head/crypto/openssh/cipher.c Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/cipher.c Mon Mar 24 19:15:13 2014 (r263691) @@ -37,6 +37,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include Modified: head/crypto/openssh/clientloop.c ============================================================================== --- head/crypto/openssh/clientloop.c Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/clientloop.c Mon Mar 24 19:15:13 2014 (r263691) @@ -61,6 +61,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: head/crypto/openssh/compat.c ============================================================================== --- head/crypto/openssh/compat.c Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/compat.c Mon Mar 24 19:15:13 2014 (r263691) @@ -25,6 +25,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include Modified: head/crypto/openssh/contrib/ssh-copy-id.1 ============================================================================== --- head/crypto/openssh/contrib/ssh-copy-id.1 Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/contrib/ssh-copy-id.1 Mon Mar 24 19:15:13 2014 (r263691) @@ -21,7 +21,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .. -.Dd $Mdocdate: June 17 2010 $ +.Dd June 17, 2010 .Dt SSH-COPY-ID 1 .Os .Sh NAME Added: head/crypto/openssh/freebsd-post-merge.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/crypto/openssh/freebsd-post-merge.sh Mon Mar 24 19:15:13 2014 (r263691) @@ -0,0 +1,14 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +xargs perl -n -i -e ' + print; + s/\$(Id|OpenBSD): [^\$]*/\$FreeBSD/ && print; + m/^\#include "includes.h"/ && print "__RCSID(\"\$FreeBSD\$\");\n"; +' keywords +xargs perl -n -i -e ' + $strip = $ARGV if /\$(Id|OpenBSD):.*\$/; + print unless ($strip eq $ARGV && /\$FreeBSD.*\$/); +' mdocdates +xargs perl -p -i -e ' + s/^\.Dd (\w+) (\d+), (\d+)$/.Dd \$Mdocdate: $1 $2 $3 \$/; +' Modified: head/crypto/openssh/misc.c ============================================================================== --- head/crypto/openssh/misc.c Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/misc.c Mon Mar 24 19:15:13 2014 (r263691) @@ -26,6 +26,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: head/crypto/openssh/moduli.5 ============================================================================== --- head/crypto/openssh/moduli.5 Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/moduli.5 Mon Mar 24 19:15:13 2014 (r263691) @@ -1,4 +1,5 @@ .\" $OpenBSD: moduli.5,v 1.17 2012/09/26 17:34:38 jmc Exp $ +.\" $FreeBSD$ .\" .\" Copyright (c) 2008 Damien Miller .\" Modified: head/crypto/openssh/mux.c ============================================================================== --- head/crypto/openssh/mux.c Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/mux.c Mon Mar 24 19:15:13 2014 (r263691) @@ -1,4 +1,5 @@ /* $OpenBSD: mux.c,v 1.44 2013/07/12 00:19:58 djm Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 2002-2008 Damien Miller * @@ -31,6 +32,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: head/crypto/openssh/openbsd-compat/blowfish.c ============================================================================== --- head/crypto/openssh/openbsd-compat/blowfish.c Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/openbsd-compat/blowfish.c Mon Mar 24 19:15:13 2014 (r263691) @@ -1,4 +1,5 @@ /* $OpenBSD: blowfish.c,v 1.18 2004/11/02 17:23:26 hshoexer Exp $ */ +/* $FreeBSD$ */ /* * Blowfish block cipher for OpenBSD * Copyright 1997 Niels Provos @@ -40,6 +41,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #if !defined(HAVE_BCRYPT_PBKDF) && (!defined(HAVE_BLOWFISH_INITSTATE) || \ !defined(HAVE_BLOWFISH_EXPAND0STATE) || !defined(HAVE_BLF_ENC)) Modified: head/crypto/openssh/openbsd-compat/bsd-misc.h ============================================================================== --- head/crypto/openssh/openbsd-compat/bsd-misc.h Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/openbsd-compat/bsd-misc.h Mon Mar 24 19:15:13 2014 (r263691) @@ -1,4 +1,5 @@ /* $Id: bsd-misc.h,v 1.25 2013/08/04 11:48:41 dtucker Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 1999-2004 Damien Miller @@ -20,6 +21,7 @@ #define _BSD_MISC_H #include "includes.h" +__RCSID("$FreeBSD$"); char *ssh_get_progname(char *); Modified: head/crypto/openssh/packet.c ============================================================================== --- head/crypto/openssh/packet.c Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/packet.c Mon Mar 24 19:15:13 2014 (r263691) @@ -1,4 +1,5 @@ /* $OpenBSD: packet.c,v 1.191 2013/12/06 13:34:54 markus Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -38,6 +39,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include "openbsd-compat/sys-queue.h" Modified: head/crypto/openssh/pathnames.h ============================================================================== --- head/crypto/openssh/pathnames.h Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/pathnames.h Mon Mar 24 19:15:13 2014 (r263691) @@ -1,4 +1,5 @@ /* $OpenBSD: pathnames.h,v 1.24 2013/12/06 13:39:49 markus Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen Modified: head/crypto/openssh/sandbox-capsicum.c ============================================================================== --- head/crypto/openssh/sandbox-capsicum.c Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/sandbox-capsicum.c Mon Mar 24 19:15:13 2014 (r263691) @@ -15,6 +15,8 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); +__RCSID("$FreeBSD$"); #ifdef SANDBOX_CAPSICUM Modified: head/crypto/openssh/schnorr.c ============================================================================== --- head/crypto/openssh/schnorr.c Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/schnorr.c Mon Mar 24 19:15:13 2014 (r263691) @@ -27,6 +27,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include Modified: head/crypto/openssh/scp.1 ============================================================================== --- head/crypto/openssh/scp.1 Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/scp.1 Mon Mar 24 19:15:13 2014 (r263691) @@ -9,6 +9,7 @@ .\" Created: Sun May 7 00:14:37 1995 ylo .\" .\" $OpenBSD: scp.1,v 1.61 2013/10/20 09:51:26 djm Exp $ +.\" $FreeBSD$ .\" .Dd October 20, 2013 .Dt SCP 1 Modified: head/crypto/openssh/serverloop.c ============================================================================== --- head/crypto/openssh/serverloop.c Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/serverloop.c Mon Mar 24 19:15:13 2014 (r263691) @@ -37,6 +37,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: head/crypto/openssh/sftp-common.c ============================================================================== --- head/crypto/openssh/sftp-common.c Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/sftp-common.c Mon Mar 24 19:15:13 2014 (r263691) @@ -1,4 +1,5 @@ /* $OpenBSD: sftp-common.c,v 1.26 2014/01/09 03:26:00 guenther Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. * Copyright (c) 2001 Damien Miller. All rights reserved. @@ -25,6 +26,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: head/crypto/openssh/sftp.c ============================================================================== --- head/crypto/openssh/sftp.c Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/sftp.c Mon Mar 24 19:15:13 2014 (r263691) @@ -17,6 +17,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: head/crypto/openssh/ssh-add.1 ============================================================================== --- head/crypto/openssh/ssh-add.1 Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/ssh-add.1 Mon Mar 24 19:15:13 2014 (r263691) @@ -1,4 +1,5 @@ .\" $OpenBSD: ssh-add.1,v 1.59 2013/12/07 11:58:46 naddy Exp $ +.\" $FreeBSD$ .\" .\" Author: Tatu Ylonen .\" Copyright (c) 1995 Tatu Ylonen , Espoo, Finland Modified: head/crypto/openssh/ssh-agent.c ============================================================================== --- head/crypto/openssh/ssh-agent.c Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/ssh-agent.c Mon Mar 24 19:15:13 2014 (r263691) @@ -1,4 +1,5 @@ /* $OpenBSD: ssh-agent.c,v 1.181 2013/12/19 01:19:41 djm Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland Modified: head/crypto/openssh/ssh-gss.h ============================================================================== --- head/crypto/openssh/ssh-gss.h Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/ssh-gss.h Mon Mar 24 19:15:13 2014 (r263691) @@ -1,4 +1,5 @@ /* $OpenBSD: ssh-gss.h,v 1.10 2007/06/12 08:20:00 djm Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. * Modified: head/crypto/openssh/ssh-keysign.8 ============================================================================== --- head/crypto/openssh/ssh-keysign.8 Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/ssh-keysign.8 Mon Mar 24 19:15:13 2014 (r263691) @@ -1,4 +1,5 @@ .\" $OpenBSD: ssh-keysign.8,v 1.14 2013/12/07 11:58:46 naddy Exp $ +.\" $FreeBSD$ .\" .\" Copyright (c) 2002 Markus Friedl. All rights reserved. .\" Modified: head/crypto/openssh/ssh-pkcs11-helper.8 ============================================================================== --- head/crypto/openssh/ssh-pkcs11-helper.8 Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/ssh-pkcs11-helper.8 Mon Mar 24 19:15:13 2014 (r263691) @@ -1,4 +1,5 @@ .\" $OpenBSD: ssh-pkcs11-helper.8,v 1.4 2013/07/16 00:07:52 schwarze Exp $ +.\" $FreeBSD$ .\" .\" Copyright (c) 2010 Markus Friedl. All rights reserved. .\" Modified: head/crypto/openssh/sshconnect.c ============================================================================== --- head/crypto/openssh/sshconnect.c Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/sshconnect.c Mon Mar 24 19:15:13 2014 (r263691) @@ -15,6 +15,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: head/crypto/openssh/sshconnect2.c ============================================================================== --- head/crypto/openssh/sshconnect2.c Mon Mar 24 18:13:41 2014 (r263690) +++ head/crypto/openssh/sshconnect2.c Mon Mar 24 19:15:13 2014 (r263691) @@ -26,6 +26,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include From owner-svn-src-head@FreeBSD.ORG Mon Mar 24 19:21:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C44EE6E; Mon, 24 Mar 2014 19:21:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 39AB9E6A; Mon, 24 Mar 2014 19:21:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2OJLF4U050414; Mon, 24 Mar 2014 19:21:15 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2OJLFuh050413; Mon, 24 Mar 2014 19:21:15 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403241921.s2OJLFuh050413@svn.freebsd.org> From: Dimitry Andric Date: Mon, 24 Mar 2014 19:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263692 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 19:21:15 -0000 Author: dim Date: Mon Mar 24 19:21:14 2014 New Revision: 263692 URL: http://svnweb.freebsd.org/changeset/base/263692 Log: Add a note to UPDATING about customized kernel configuration files now requiring -gdwarf-2 for debug info, when using clang 3.4. Suggested by: adrian MFC after: 3 days Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Mar 24 19:15:13 2014 (r263691) +++ head/UPDATING Mon Mar 24 19:21:14 2014 (r263692) @@ -44,7 +44,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 to do so. Set WITHOUT_GPL_DTC if you require the BSDL compiler. 20140216: - Clang and llvm have been upgraded to 3.4 release. + Clang and llvm have been upgraded to 3.4 release. Please note that + clang 3.4 now defaults to DWARF4 debug information format when you + specify -g. Since kgdb(1) only supports DWARF2, you should update any + customized kernel configurations which include debug information to + explicitly use -gdwarf-2, e.g: + + makeoptions DEBUG=-gdwarf-2 + + This has already been applied to the appropriate GENERIC configuration + files, so if you inherit from those, no changes are required. 20140216: The nve(4) driver has been removed. Please use the nfe(4) driver From owner-svn-src-head@FreeBSD.ORG Mon Mar 24 19:36:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6140764 for ; Mon, 24 Mar 2014 19:36:43 +0000 (UTC) Received: from mail-ie0-f177.google.com (mail-ie0-f177.google.com [209.85.223.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 905C1FC1 for ; Mon, 24 Mar 2014 19:36:43 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id rl12so6049656iec.22 for ; Mon, 24 Mar 2014 12:36:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=0Q9IN72tBWChgZWoT5PNmMpuJXzo5/jqjiJLuCc3aNY=; b=aPNQWdd49xI0rE2iWlWr5d99izCFnPBvxtYsgtARxV0RCE4LvDNCNkf2gx+tpYNvgU bfafjNJEvvXw/zX7TKCBt8YyW15XASYad0FOb591vjwheHsjoA0WwpRTr4XisYQxkeIx EDwS6apJd4Z8ZAdU1+Ss+AcsM19hvtvz9QLX7aYENucHed12/wiTPGhUwynhY6xDmC/Y UtmTjHjlbnJXDagsjxSiQ6fbR/nmYAzAZuFoeN/7vZ9ag3NAqY2DHPr88mL5K/dcSo6e YNHOhNuF39uWyU9ogkJcHtANwQMH8Wz8nok83ST/Dlfiz2cmPDUf4SOhSu+INCGuh7rB 6e8Q== X-Gm-Message-State: ALoCoQnlTTpe3BhCk/fFrXe6uigulq/qOgAZgkQlNk0jTOdKg2dhUIkc7mrPj22fZVm6B/KiHNz9 X-Received: by 10.50.253.227 with SMTP id ad3mr13698662igd.23.1395689797312; Mon, 24 Mar 2014 12:36:37 -0700 (PDT) Received: from netflix-mac.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id l7sm25307929igv.4.2014.03.24.12.36.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Mar 2014 12:36:19 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263692 - head From: Warner Losh In-Reply-To: <201403241921.s2OJLFuh050413@svn.freebsd.org> Date: Mon, 24 Mar 2014 13:36:03 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201403241921.s2OJLFuh050413@svn.freebsd.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 19:36:43 -0000 Makes we wonder why we didn=92t put this in kmod.mk=85 Is there any = reason not do? Warner On Mar 24, 2014, at 1:21 PM, Dimitry Andric wrote: > Author: dim > Date: Mon Mar 24 19:21:14 2014 > New Revision: 263692 > URL: http://svnweb.freebsd.org/changeset/base/263692 >=20 > Log: > Add a note to UPDATING about customized kernel configuration files = now > requiring -gdwarf-2 for debug info, when using clang 3.4. >=20 > Suggested by: adrian > MFC after: 3 days >=20 > Modified: > head/UPDATING >=20 > Modified: head/UPDATING > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/UPDATING Mon Mar 24 19:15:13 2014 (r263691) > +++ head/UPDATING Mon Mar 24 19:21:14 2014 (r263692) > @@ -44,7 +44,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 > to do so. Set WITHOUT_GPL_DTC if you require the BSDL compiler. >=20 > 20140216: > - Clang and llvm have been upgraded to 3.4 release. > + Clang and llvm have been upgraded to 3.4 release. Please note = that > + clang 3.4 now defaults to DWARF4 debug information format when = you > + specify -g. Since kgdb(1) only supports DWARF2, you should = update any > + customized kernel configurations which include debug information = to > + explicitly use -gdwarf-2, e.g: > + > + makeoptions DEBUG=3D-gdwarf-2 > + > + This has already been applied to the appropriate GENERIC = configuration > + files, so if you inherit from those, no changes are required. >=20 > 20140216: > The nve(4) driver has been removed. Please use the nfe(4) = driver >=20 From owner-svn-src-head@FreeBSD.ORG Mon Mar 24 19:47:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22A2BB9B; Mon, 24 Mar 2014 19:47:35 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D336B154; Mon, 24 Mar 2014 19:47:34 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::e82e:bf55:92ff:49fe] (unknown [IPv6:2001:7b8:3a7:0:e82e:bf55:92ff:49fe]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 1BFD05C43; Mon, 24 Mar 2014 20:47:25 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_3445E057-A629-4C5A-8DE8-57323A6AFDBE"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263692 - head From: Dimitry Andric In-Reply-To: Date: Mon, 24 Mar 2014 20:47:11 +0100 Message-Id: <75AEE837-AD15-4310-B318-80BC12D9F89E@FreeBSD.org> References: <201403241921.s2OJLFuh050413@svn.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 19:47:35 -0000 --Apple-Mail=_3445E057-A629-4C5A-8DE8-57323A6AFDBE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 24 Mar 2014, at 20:36, Warner Losh wrote: > On Mar 24, 2014, at 1:21 PM, Dimitry Andric wrote: >> Author: dim >> Date: Mon Mar 24 19:21:14 2014 >> New Revision: 263692 >> URL: http://svnweb.freebsd.org/changeset/base/263692 >>=20 >> Log: >> Add a note to UPDATING about customized kernel configuration files = now >> requiring -gdwarf-2 for debug info, when using clang 3.4. >=20 > Makes we wonder why we didn=92t put this in kmod.mk=85 Is there any = reason not do? For modules, you can just DEBUG_FLAGS, like for world. But there is no default value of DEBUG_FLAGS in kmod.mk, at least I don't see any. -Dimitry --Apple-Mail=_3445E057-A629-4C5A-8DE8-57323A6AFDBE Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlMwi8wACgkQsF6jCi4glqOMtQCdEjZKAOraWEl+UKUAknJv4Tc0 h/0AoKKrIOIdpD/vQfiWYLQrH/MsXDQa =03HM -----END PGP SIGNATURE----- --Apple-Mail=_3445E057-A629-4C5A-8DE8-57323A6AFDBE-- From owner-svn-src-head@FreeBSD.ORG Mon Mar 24 20:01:50 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81A65169; Mon, 24 Mar 2014 20:01:50 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4ECA12B9; Mon, 24 Mar 2014 20:01:49 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WSB43-00030C-BT; Mon, 24 Mar 2014 20:01:43 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s2OK1fJn075456; Mon, 24 Mar 2014 14:01:41 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+Tfbpe6iaznA5bN56t+epl Subject: Re: svn commit: r263692 - head From: Ian Lepore To: Dimitry Andric In-Reply-To: <75AEE837-AD15-4310-B318-80BC12D9F89E@FreeBSD.org> References: <201403241921.s2OJLFuh050413@svn.freebsd.org> <75AEE837-AD15-4310-B318-80BC12D9F89E@FreeBSD.org> Content-Type: multipart/mixed; boundary="=-0/AsZsbLGY1dOja0fiDt" Date: Mon, 24 Mar 2014 14:01:41 -0600 Message-ID: <1395691301.81853.61.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 20:01:50 -0000 --=-0/AsZsbLGY1dOja0fiDt Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by damnhippie.dyndns.org id s2OK1fJn075456 On Mon, 2014-03-24 at 20:47 +0100, Dimitry Andric wrote: > On 24 Mar 2014, at 20:36, Warner Losh wrote: > > On Mar 24, 2014, at 1:21 PM, Dimitry Andric wrote: > >> Author: dim > >> Date: Mon Mar 24 19:21:14 2014 > >> New Revision: 263692 > >> URL: http://svnweb.freebsd.org/changeset/base/263692 > >>=20 > >> Log: > >> Add a note to UPDATING about customized kernel configuration files n= ow > >> requiring -gdwarf-2 for debug info, when using clang 3.4. > >=20 > > Makes we wonder why we didn=92t put this in kmod.mk=85 Is there any = reason not do? >=20 > For modules, you can just DEBUG_FLAGS, like for world. But there is no > default value of DEBUG_FLAGS in kmod.mk, at least I don't see any. >=20 > -Dimitry >=20 I guessing he meant kern.mk so that it would be in effect for both kernel and modules build. Something like this (which I've tested only for building an arm kernel without modules so far)... -- Ian --=-0/AsZsbLGY1dOja0fiDt Content-Disposition: inline; filename="gdwarf2.diff" Content-Type: text/x-patch; name="gdwarf2.diff"; charset="us-ascii" Content-Transfer-Encoding: 7bit Index: sys/conf/kern.mk =================================================================== --- sys/conf/kern.mk (revision 263112) +++ sys/conf/kern.mk (working copy) @@ -162,3 +162,7 @@ CFLAGS+= -ffreestanding ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" CFLAGS+= -fstack-protector .endif + +.if ${COMPILER_TYPE} == "clang" && !empty(CFLAGS:M-g*) && empty(CFLAGS:M-gdwarf*) +CFLAGS+= -gdwarf-2 +.endif --=-0/AsZsbLGY1dOja0fiDt-- From owner-svn-src-head@FreeBSD.ORG Mon Mar 24 20:06:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DF85470; Mon, 24 Mar 2014 20:06:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8637C2EE; Mon, 24 Mar 2014 20:06:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2OK6TuH070573; Mon, 24 Mar 2014 20:06:29 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2OK6RVA070560; Mon, 24 Mar 2014 20:06:27 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201403242006.s2OK6RVA070560@svn.freebsd.org> From: Luiz Otavio O Souza Date: Mon, 24 Mar 2014 20:06:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263693 - in head: share/man/man4/man4.arm sys/arm/conf sys/arm/ti sys/arm/ti/am335x sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 20:06:29 -0000 Author: loos Date: Mon Mar 24 20:06:27 2014 New Revision: 263693 URL: http://svnweb.freebsd.org/changeset/base/263693 Log: Adds the ADC driver for TI AM3xxx SoC family. The ADC has a 12bit resolution and its raw output can be read via sysctl(8) interface. The driver allows the setup of ADC clock, samples average and open delay (the number of clock cycles to wait before start the conversion). The TSC_ADC module is set in the general purpose mode (no touchscreen support). Tested on Beaglebone-black. Written based on AM335x TRM. Reviewed by: rpaulo Approved by: adrian (mentor) Tested by: me, Brian J. McGovern, Sulev-Madis Silber (ketas) Added: head/share/man/man4/man4.arm/ti_adc.4 (contents, props changed) head/sys/arm/ti/ti_adc.c (contents, props changed) head/sys/arm/ti/ti_adcreg.h (contents, props changed) head/sys/arm/ti/ti_adcvar.h (contents, props changed) Modified: head/share/man/man4/man4.arm/Makefile head/sys/arm/conf/BEAGLEBONE head/sys/arm/ti/am335x/am335x_prcm.c head/sys/arm/ti/files.ti head/sys/arm/ti/ti_prcm.h head/sys/boot/fdt/dts/arm/am335x.dtsi Modified: head/share/man/man4/man4.arm/Makefile ============================================================================== --- head/share/man/man4/man4.arm/Makefile Mon Mar 24 19:21:14 2014 (r263692) +++ head/share/man/man4/man4.arm/Makefile Mon Mar 24 20:06:27 2014 (r263693) @@ -1,6 +1,9 @@ # $FreeBSD$ -MAN= mge.4 npe.4 devcfg.4 +MAN= devcfg.4 \ + mge.4 \ + npe.4 \ + ti_adc.4 MLINKS= mge.4 if_mge.4 MLINKS+=npe.4 if_npe.4 Added: head/share/man/man4/man4.arm/ti_adc.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.arm/ti_adc.4 Mon Mar 24 20:06:27 2014 (r263693) @@ -0,0 +1,119 @@ +.\" +.\" Copyright (c) 2014 Luiz Otavio O Souza +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 21, 2014 +.Dt TI_ADC 4 +.Os +.Sh NAME +.Nm ti_adc +.Nd TI AM3XXX analog to digital converter driver +.Sh SYNOPSIS +.Cd "device ti_adc" +.Sh DESCRIPTION +The +.Nm +driver provides access to the AIN (analog inputs) on am3xxx SoCs. +.Pp +It provides raw readings of the converted values for each analog inputs. +.Pp +The access to +.Nm +data is made via the +.Xr sysctl 8 +interface: +.Bd -literal +dev.ti_adc.0.%desc: TI ADC controller +dev.ti_adc.0.%driver: ti_adc +dev.ti_adc.0.%pnpinfo: name=adc@44E0D000 compat=ti,adc +dev.ti_adc.0.%parent: simplebus0 +dev.ti_adc.0.clockdiv: 2400 +dev.ti_adc.0.ain.0.enable: 0 +dev.ti_adc.0.ain.0.open_delay: 0 +dev.ti_adc.0.ain.0.samples_avg: 0 +dev.ti_adc.0.ain.0.input: 0 +dev.ti_adc.0.ain.1.enable: 0 +dev.ti_adc.0.ain.1.open_delay: 0 +dev.ti_adc.0.ain.1.samples_avg: 0 +dev.ti_adc.0.ain.1.input: 0 +dev.ti_adc.0.ain.2.enable: 0 +dev.ti_adc.0.ain.2.open_delay: 0 +dev.ti_adc.0.ain.2.samples_avg: 0 +dev.ti_adc.0.ain.2.input: 0 +dev.ti_adc.0.ain.3.enable: 0 +dev.ti_adc.0.ain.3.open_delay: 0 +dev.ti_adc.0.ain.3.samples_avg: 0 +dev.ti_adc.0.ain.3.input: 0 +dev.ti_adc.0.ain.4.enable: 0 +dev.ti_adc.0.ain.4.open_delay: 0 +dev.ti_adc.0.ain.4.samples_avg: 0 +dev.ti_adc.0.ain.4.input: 0 +dev.ti_adc.0.ain.5.enable: 0 +dev.ti_adc.0.ain.5.open_delay: 0 +dev.ti_adc.0.ain.5.samples_avg: 0 +dev.ti_adc.0.ain.5.input: 0 +dev.ti_adc.0.ain.6.enable: 1 +dev.ti_adc.0.ain.6.open_delay: 0 +dev.ti_adc.0.ain.6.samples_avg: 4 +dev.ti_adc.0.ain.6.input: 2308 +.Ed +.Pp +Global settings: +.Bl -tag -width ".Va dev.ti_adc.0.clockdiv" +.It Va dev.ti_adc.0.clockdiv +Sets the ADC clock prescaler. +The minimum value is 10 and the maximum is 65535. +The ADC clock is based on CLK_M_OSC (24Mhz) / clockdiv. +This gives a maximum of ~2.4Mhz for the ADC clock and ~10Khz for the default +setting (clockdiv = 2400). +.El +.Pp +Settings per input: +.Bl -tag -width ".Va dev.ti_adc.0.ain.%d.samples_avg" +.It Va dev.ti_adc.0.ain.%d.enable +Enable the conversion for the input. +Each input should be individually enabled before it can be used. +When all the inputs are disabled, the ADC is turned off. +.It Va dev.ti_adc.0.ain.%d.open_delay +Sets the number of ADC clock cycles to wait after applying the input +configuration and before start the ADC conversion. +.It Va dev.ti_adc.0.ain.%d.samples_avg +Sets the number of samples average used on each input, it can be set to 0 +(no samples average), 2, 4, 8, or 16. +.It Va dev.ti_adc.0.ain.%d.input +Is the converted raw value of the voltage applied on the analog input. +It is made of a 12 bit value (0 ~ 4095). +.El +.Sh SEE ALSO +.Xr sysctl 8 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 11.0 . +.Sh AUTHORS +.An -nosplit +The driver and this manual page was written by +.An Luiz Otavio O Souza Aq loos@FreeBSD.org Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Mon Mar 24 19:21:14 2014 (r263692) +++ head/sys/arm/conf/BEAGLEBONE Mon Mar 24 20:06:27 2014 (r263693) @@ -105,6 +105,9 @@ device am335x_pmic # AM335x Power Mana device gpio device gpioled +# ADC support +device ti_adc + # USB support device usb options USB_HOST_ALIGN=64 # Cacheline size is 64 on AM335x. Modified: head/sys/arm/ti/am335x/am335x_prcm.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_prcm.c Mon Mar 24 19:21:14 2014 (r263692) +++ head/sys/arm/ti/am335x/am335x_prcm.c Mon Mar 24 20:06:27 2014 (r263693) @@ -107,6 +107,7 @@ __FBSDID("$FreeBSD$"); #define CM_WKUP_CM_CLKDCOLDO_DPLL_PER (CM_WKUP + 0x07C) #define CM_WKUP_CM_CLKMODE_DPLL_DISP (CM_WKUP + 0x098) #define CM_WKUP_I2C0_CLKCTRL (CM_WKUP + 0x0B8) +#define CM_WKUP_ADC_TSC_CLKCTRL (CM_WKUP + 0x0BC) #define CM_DPLL 0x500 #define CLKSEL_TIMER7_CLK (CM_DPLL + 0x004) @@ -260,6 +261,9 @@ struct ti_clock_dev ti_clk_devmap[] = { AM335X_GENERIC_CLOCK_DEV(I2C1_CLK), AM335X_GENERIC_CLOCK_DEV(I2C2_CLK), + /* TSC_ADC */ + AM335X_GENERIC_CLOCK_DEV(TSC_ADC_CLK), + /* EDMA */ AM335X_GENERIC_CLOCK_DEV(EDMA_TPCC_CLK), AM335X_GENERIC_CLOCK_DEV(EDMA_TPTC0_CLK), @@ -337,6 +341,9 @@ static struct am335x_clk_details g_am335 _CLK_DETAIL(I2C1_CLK, CM_PER_I2C1_CLKCTRL, 0), _CLK_DETAIL(I2C2_CLK, CM_PER_I2C2_CLKCTRL, 0), + /* TSC_ADC module */ + _CLK_DETAIL(TSC_ADC_CLK, CM_WKUP_ADC_TSC_CLKCTRL, 0), + /* EDMA modules */ _CLK_DETAIL(EDMA_TPCC_CLK, CM_PER_TPCC_CLKCTRL, 0), _CLK_DETAIL(EDMA_TPTC0_CLK, CM_PER_TPTC0_CLKCTRL, 0), Modified: head/sys/arm/ti/files.ti ============================================================================== --- head/sys/arm/ti/files.ti Mon Mar 24 19:21:14 2014 (r263692) +++ head/sys/arm/ti/files.ti Mon Mar 24 20:06:27 2014 (r263693) @@ -19,6 +19,7 @@ dev/mbox/mbox_if.m standard arm/ti/ti_mbox.c standard arm/ti/ti_pruss.c standard +arm/ti/ti_adc.c optional ti_adc arm/ti/ti_gpio.c optional gpio arm/ti/ti_i2c.c optional ti_i2c Added: head/sys/arm/ti/ti_adc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/ti_adc.c Mon Mar 24 20:06:27 2014 (r263693) @@ -0,0 +1,593 @@ +/*- + * Copyright 2014 Luiz Otavio O Souza + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include + +/* Define our 7 steps, one for each input channel. */ +static struct ti_adc_input ti_adc_inputs[TI_ADC_NPINS] = { + { .stepconfig = ADC_STEPCFG1, .stepdelay = ADC_STEPDLY1 }, + { .stepconfig = ADC_STEPCFG2, .stepdelay = ADC_STEPDLY2 }, + { .stepconfig = ADC_STEPCFG3, .stepdelay = ADC_STEPDLY3 }, + { .stepconfig = ADC_STEPCFG4, .stepdelay = ADC_STEPDLY4 }, + { .stepconfig = ADC_STEPCFG5, .stepdelay = ADC_STEPDLY5 }, + { .stepconfig = ADC_STEPCFG6, .stepdelay = ADC_STEPDLY6 }, + { .stepconfig = ADC_STEPCFG7, .stepdelay = ADC_STEPDLY7 }, +}; + +static int ti_adc_samples[5] = { 0, 2, 4, 8, 16 }; + +static void +ti_adc_enable(struct ti_adc_softc *sc) +{ + + TI_ADC_LOCK_ASSERT(sc); + + if (sc->sc_last_state == 1) + return; + + /* Enable the FIFO0 threshold and the end of sequence interrupt. */ + ADC_WRITE4(sc, ADC_IRQENABLE_SET, + ADC_IRQ_FIFO0_THRES | ADC_IRQ_END_OF_SEQ); + + /* Enable the ADC. Run thru enabled steps, start the conversions. */ + ADC_WRITE4(sc, ADC_CTRL, ADC_READ4(sc, ADC_CTRL) | ADC_CTRL_ENABLE); + + sc->sc_last_state = 1; +} + +static void +ti_adc_disable(struct ti_adc_softc *sc) +{ + int count; + uint32_t data; + + TI_ADC_LOCK_ASSERT(sc); + + if (sc->sc_last_state == 0) + return; + + /* Disable all the enabled steps. */ + ADC_WRITE4(sc, ADC_STEPENABLE, 0); + + /* Disable the ADC. */ + ADC_WRITE4(sc, ADC_CTRL, ADC_READ4(sc, ADC_CTRL) & ~ADC_CTRL_ENABLE); + + /* Disable the FIFO0 threshold and the end of sequence interrupt. */ + ADC_WRITE4(sc, ADC_IRQENABLE_CLR, + ADC_IRQ_FIFO0_THRES | ADC_IRQ_END_OF_SEQ); + + /* ACK any pending interrupt. */ + ADC_WRITE4(sc, ADC_IRQSTATUS, ADC_READ4(sc, ADC_IRQSTATUS)); + + /* Drain the FIFO data. */ + count = ADC_READ4(sc, ADC_FIFO0COUNT) & ADC_FIFO_COUNT_MSK; + while (count > 0) { + data = ADC_READ4(sc, ADC_FIFO0DATA); + count = ADC_READ4(sc, ADC_FIFO0COUNT) & ADC_FIFO_COUNT_MSK; + } + + sc->sc_last_state = 0; +} + +static int +ti_adc_setup(struct ti_adc_softc *sc) +{ + int ain; + uint32_t enabled; + + TI_ADC_LOCK_ASSERT(sc); + + /* Check for enabled inputs. */ + enabled = 0; + for (ain = 0; ain < TI_ADC_NPINS; ain++) { + if (ti_adc_inputs[ain].enable) + enabled |= (1U << (ain + 1)); + } + + /* Set the ADC global status. */ + if (enabled != 0) { + ti_adc_enable(sc); + /* Update the enabled steps. */ + if (enabled != ADC_READ4(sc, ADC_STEPENABLE)) + ADC_WRITE4(sc, ADC_STEPENABLE, enabled); + } else + ti_adc_disable(sc); + + return (0); +} + +static void +ti_adc_input_setup(struct ti_adc_softc *sc, int32_t ain) +{ + struct ti_adc_input *input; + uint32_t reg, val; + + TI_ADC_LOCK_ASSERT(sc); + + input = &ti_adc_inputs[ain]; + reg = input->stepconfig; + val = ADC_READ4(sc, reg); + + /* Set single ended operation. */ + val &= ~ADC_STEP_DIFF_CNTRL; + + /* Set the negative voltage reference. */ + val &= ~ADC_STEP_RFM_MSK; + val |= ADC_STEP_RFM_VREFN << ADC_STEP_RFM_SHIFT; + + /* Set the positive voltage reference. */ + val &= ~ADC_STEP_RFP_MSK; + val |= ADC_STEP_RFP_VREFP << ADC_STEP_RFP_SHIFT; + + /* Set the samples average. */ + val &= ~ADC_STEP_AVG_MSK; + val |= input->samples << ADC_STEP_AVG_SHIFT; + + /* Select the desired input. */ + val &= ~ADC_STEP_INP_MSK; + val |= ain << ADC_STEP_INP_SHIFT; + + /* Set the ADC to one-shot mode. */ + val &= ~ADC_STEP_MODE_MSK; + + ADC_WRITE4(sc, reg, val); +} + +static void +ti_adc_reset(struct ti_adc_softc *sc) +{ + int ain; + + TI_ADC_LOCK_ASSERT(sc); + + /* Disable all the inputs. */ + for (ain = 0; ain < TI_ADC_NPINS; ain++) + ti_adc_inputs[ain].enable = 0; +} + +static int +ti_adc_clockdiv_proc(SYSCTL_HANDLER_ARGS) +{ + int error, reg; + struct ti_adc_softc *sc; + + sc = (struct ti_adc_softc *)arg1; + + TI_ADC_LOCK(sc); + reg = (int)ADC_READ4(sc, ADC_CLKDIV) + 1; + TI_ADC_UNLOCK(sc); + + error = sysctl_handle_int(oidp, ®, sizeof(reg), req); + if (error != 0 || req->newptr == NULL) + return (error); + + /* + * The actual written value is the prescaler setting - 1. + * Enforce a minimum value of 10 (i.e. 9) which limits the maximum + * ADC clock to ~2.4Mhz (CLK_M_OSC / 10). + */ + reg--; + if (reg < 9) + reg = 9; + if (reg > USHRT_MAX) + reg = USHRT_MAX; + + TI_ADC_LOCK(sc); + /* Disable the ADC. */ + ti_adc_disable(sc); + /* Update the ADC prescaler setting. */ + ADC_WRITE4(sc, ADC_CLKDIV, reg); + /* Enable the ADC again. */ + ti_adc_setup(sc); + TI_ADC_UNLOCK(sc); + + return (0); +} + +static int +ti_adc_enable_proc(SYSCTL_HANDLER_ARGS) +{ + int error; + int32_t enable; + struct ti_adc_softc *sc; + struct ti_adc_input *input; + + input = (struct ti_adc_input *)arg1; + sc = input->sc; + + enable = input->enable; + error = sysctl_handle_int(oidp, &enable, sizeof(enable), + req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (enable) + enable = 1; + + TI_ADC_LOCK(sc); + /* Setup the ADC as needed. */ + if (input->enable != enable) { + input->enable = enable; + ti_adc_setup(sc); + if (input->enable == 0) + input->value = 0; + } + TI_ADC_UNLOCK(sc); + + return (0); +} + +static int +ti_adc_open_delay_proc(SYSCTL_HANDLER_ARGS) +{ + int error, reg; + struct ti_adc_softc *sc; + struct ti_adc_input *input; + + input = (struct ti_adc_input *)arg1; + sc = input->sc; + + TI_ADC_LOCK(sc); + reg = (int)ADC_READ4(sc, input->stepdelay) & ADC_STEP_OPEN_DELAY; + TI_ADC_UNLOCK(sc); + + error = sysctl_handle_int(oidp, ®, sizeof(reg), req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (reg < 0) + reg = 0; + + TI_ADC_LOCK(sc); + ADC_WRITE4(sc, input->stepdelay, reg & ADC_STEP_OPEN_DELAY); + TI_ADC_UNLOCK(sc); + + return (0); +} + +static int +ti_adc_samples_avg_proc(SYSCTL_HANDLER_ARGS) +{ + int error, samples, i; + struct ti_adc_softc *sc; + struct ti_adc_input *input; + + input = (struct ti_adc_input *)arg1; + sc = input->sc; + + if (input->samples > nitems(ti_adc_samples)) + input->samples = nitems(ti_adc_samples); + samples = ti_adc_samples[input->samples]; + + error = sysctl_handle_int(oidp, &samples, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + TI_ADC_LOCK(sc); + if (samples != ti_adc_samples[input->samples]) { + input->samples = 0; + for (i = 0; i < nitems(ti_adc_samples); i++) + if (samples >= ti_adc_samples[i]) + input->samples = i; + ti_adc_input_setup(sc, input->input); + } + TI_ADC_UNLOCK(sc); + + return (error); +} + +static void +ti_adc_read_data(struct ti_adc_softc *sc) +{ + int count, ain; + struct ti_adc_input *input; + uint32_t data; + + TI_ADC_LOCK_ASSERT(sc); + + /* Read the available data. */ + count = ADC_READ4(sc, ADC_FIFO0COUNT) & ADC_FIFO_COUNT_MSK; + while (count > 0) { + data = ADC_READ4(sc, ADC_FIFO0DATA); + ain = (data & ADC_FIFO_STEP_ID_MSK) >> ADC_FIFO_STEP_ID_SHIFT; + input = &ti_adc_inputs[ain]; + if (input->enable == 0) + input->value = 0; + else + input->value = (int32_t)(data & ADC_FIFO_DATA_MSK); + count = ADC_READ4(sc, ADC_FIFO0COUNT) & ADC_FIFO_COUNT_MSK; + } +} + +static void +ti_adc_intr(void *arg) +{ + struct ti_adc_softc *sc; + uint32_t status; + + sc = (struct ti_adc_softc *)arg; + + status = ADC_READ4(sc, ADC_IRQSTATUS); + if (status == 0) + return; + if (status & ~(ADC_IRQ_FIFO0_THRES | ADC_IRQ_END_OF_SEQ)) + device_printf(sc->sc_dev, "stray interrupt: %#x\n", status); + + TI_ADC_LOCK(sc); + /* ACK the interrupt. */ + ADC_WRITE4(sc, ADC_IRQSTATUS, status); + + /* Read the available data. */ + if (status & ADC_IRQ_FIFO0_THRES) + ti_adc_read_data(sc); + + /* Start the next conversion ? */ + if (status & ADC_IRQ_END_OF_SEQ) + ti_adc_setup(sc); + TI_ADC_UNLOCK(sc); +} + +static void +ti_adc_sysctl_init(struct ti_adc_softc *sc) +{ + char pinbuf[3]; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree_node, *inp_node, *inpN_node; + struct sysctl_oid_list *tree, *inp_tree, *inpN_tree; + int ain; + + /* + * Add per-pin sysctl tree/handlers. + */ + ctx = device_get_sysctl_ctx(sc->sc_dev); + tree_node = device_get_sysctl_tree(sc->sc_dev); + tree = SYSCTL_CHILDREN(tree_node); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "clockdiv", + CTLFLAG_RW | CTLTYPE_UINT, sc, 0, + ti_adc_clockdiv_proc, "IU", "ADC clock prescaler"); + inp_node = SYSCTL_ADD_NODE(ctx, tree, OID_AUTO, "ain", + CTLFLAG_RD, NULL, "ADC inputs"); + inp_tree = SYSCTL_CHILDREN(inp_node); + + for (ain = 0; ain < TI_ADC_NPINS; ain++) { + + snprintf(pinbuf, sizeof(pinbuf), "%d", ain); + inpN_node = SYSCTL_ADD_NODE(ctx, inp_tree, OID_AUTO, pinbuf, + CTLFLAG_RD, NULL, "ADC input"); + inpN_tree = SYSCTL_CHILDREN(inpN_node); + + SYSCTL_ADD_PROC(ctx, inpN_tree, OID_AUTO, "enable", + CTLFLAG_RW | CTLTYPE_UINT, &ti_adc_inputs[ain], 0, + ti_adc_enable_proc, "IU", "Enable ADC input"); + SYSCTL_ADD_PROC(ctx, inpN_tree, OID_AUTO, "open_delay", + CTLFLAG_RW | CTLTYPE_UINT, &ti_adc_inputs[ain], 0, + ti_adc_open_delay_proc, "IU", "ADC open delay"); + SYSCTL_ADD_PROC(ctx, inpN_tree, OID_AUTO, "samples_avg", + CTLFLAG_RW | CTLTYPE_UINT, &ti_adc_inputs[ain], 0, + ti_adc_samples_avg_proc, "IU", "ADC samples average"); + SYSCTL_ADD_INT(ctx, inpN_tree, OID_AUTO, "input", + CTLFLAG_RD, &ti_adc_inputs[ain].value, 0, + "Converted raw value for the ADC input"); + } +} + +static void +ti_adc_inputs_init(struct ti_adc_softc *sc) +{ + int ain; + struct ti_adc_input *input; + + TI_ADC_LOCK(sc); + for (ain = 0; ain < TI_ADC_NPINS; ain++) { + input = &ti_adc_inputs[ain]; + input->sc = sc; + input->input = ain; + input->value = 0; + input->enable = 0; + input->samples = 0; + ti_adc_input_setup(sc, ain); + } + TI_ADC_UNLOCK(sc); +} + +static void +ti_adc_idlestep_init(struct ti_adc_softc *sc) +{ + uint32_t val; + + val = ADC_READ4(sc, ADC_IDLECONFIG); + + /* Set single ended operation. */ + val &= ~ADC_STEP_DIFF_CNTRL; + + /* Set the negative voltage reference. */ + val &= ~ADC_STEP_RFM_MSK; + val |= ADC_STEP_RFM_VREFN << ADC_STEP_RFM_SHIFT; + + /* Set the positive voltage reference. */ + val &= ~ADC_STEP_RFP_MSK; + val |= ADC_STEP_RFP_VREFP << ADC_STEP_RFP_SHIFT; + + /* Connect the input to VREFN. */ + val &= ~ADC_STEP_INP_MSK; + val |= ADC_STEP_IN_VREFN << ADC_STEP_INP_SHIFT; + + ADC_WRITE4(sc, ADC_IDLECONFIG, val); +} + +static int +ti_adc_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "ti,adc")) + return (ENXIO); + device_set_desc(dev, "TI ADC controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +ti_adc_attach(device_t dev) +{ + int err, rid; + struct ti_adc_softc *sc; + uint32_t reg, rev; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_mem_res) { + device_printf(dev, "cannot allocate memory window\n"); + return (ENXIO); + } + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (!sc->sc_irq_res) { + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + device_printf(dev, "cannot allocate interrupt\n"); + return (ENXIO); + } + + if (bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, ti_adc_intr, sc, &sc->sc_intrhand) != 0) { + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + device_printf(dev, "Unable to setup the irq handler.\n"); + return (ENXIO); + } + + /* Activate the ADC_TSC module. */ + err = ti_prcm_clk_enable(TSC_ADC_CLK); + if (err) + return (err); + + /* Check the ADC revision. */ + rev = ADC_READ4(sc, ADC_REVISION); + device_printf(dev, + "scheme: %#x func: %#x rtl: %d rev: %d.%d custom rev: %d\n", + (rev & ADC_REV_SCHEME_MSK) >> ADC_REV_SCHEME_SHIFT, + (rev & ADC_REV_FUNC_MSK) >> ADC_REV_FUNC_SHIFT, + (rev & ADC_REV_RTL_MSK) >> ADC_REV_RTL_SHIFT, + (rev & ADC_REV_MAJOR_MSK) >> ADC_REV_MAJOR_SHIFT, + rev & ADC_REV_MINOR_MSK, + (rev & ADC_REV_CUSTOM_MSK) >> ADC_REV_CUSTOM_SHIFT); + + /* + * Disable the step write protect and make it store the step ID for + * the captured data on FIFO. + */ + reg = ADC_READ4(sc, ADC_CTRL); + ADC_WRITE4(sc, ADC_CTRL, reg | ADC_CTRL_STEP_WP | ADC_CTRL_STEP_ID); + + /* + * Set the ADC prescaler to 2400 (yes, the actual value written here + * is 2400 - 1). + * This sets the ADC clock to ~10Khz (CLK_M_OSC / 2400). + */ + ADC_WRITE4(sc, ADC_CLKDIV, 2399); + + TI_ADC_LOCK_INIT(sc); + + ti_adc_idlestep_init(sc); + ti_adc_inputs_init(sc); + ti_adc_sysctl_init(sc); + + return (0); +} + +static int +ti_adc_detach(device_t dev) +{ + struct ti_adc_softc *sc; + + sc = device_get_softc(dev); + + /* Turn off the ADC. */ + TI_ADC_LOCK(sc); + ti_adc_reset(sc); + ti_adc_setup(sc); + TI_ADC_UNLOCK(sc); + + TI_ADC_LOCK_DESTROY(sc); + + if (sc->sc_intrhand) + bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intrhand); + if (sc->sc_irq_res) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + if (sc->sc_mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + + return (bus_generic_detach(dev)); +} + +static device_method_t ti_adc_methods[] = { + DEVMETHOD(device_probe, ti_adc_probe), + DEVMETHOD(device_attach, ti_adc_attach), + DEVMETHOD(device_detach, ti_adc_detach), + + DEVMETHOD_END +}; + +static driver_t ti_adc_driver = { + "ti_adc", + ti_adc_methods, + sizeof(struct ti_adc_softc), +}; + +static devclass_t ti_adc_devclass; + +DRIVER_MODULE(ti_adc, simplebus, ti_adc_driver, ti_adc_devclass, 0, 0); +MODULE_VERSION(ti_adc, 1); +MODULE_DEPEND(ti_adc, simplebus, 1, 1, 1); Added: head/sys/arm/ti/ti_adcreg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/ti_adcreg.h Mon Mar 24 20:06:27 2014 (r263693) @@ -0,0 +1,118 @@ +/*- + * Copyright 2014 Luiz Otavio O Souza + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _TI_ADCREG_H_ +#define _TI_ADCREG_H_ + +#define ADC_REVISION 0x000 +#define ADC_REV_SCHEME_MSK 0xc0000000 +#define ADC_REV_SCHEME_SHIFT 30 +#define ADC_REV_FUNC_MSK 0x0fff0000 +#define ADC_REV_FUNC_SHIFT 16 +#define ADC_REV_RTL_MSK 0x0000f800 +#define ADC_REV_RTL_SHIFT 11 +#define ADC_REV_MAJOR_MSK 0x00000700 +#define ADC_REV_MAJOR_SHIFT 8 +#define ADC_REV_CUSTOM_MSK 0x000000c0 +#define ADC_REV_CUSTOM_SHIFT 6 +#define ADC_REV_MINOR_MSK 0x0000003f +#define ADC_SYSCFG 0x010 +#define ADC_SYSCFG_IDLE_MSK 0x000000c0 +#define ADC_SYSCFG_IDLE_SHIFT 2 +#define ADC_IRQSTATUS_RAW 0x024 +#define ADC_IRQSTATUS 0x028 +#define ADC_IRQENABLE_SET 0x02c +#define ADC_IRQENABLE_CLR 0x030 +#define ADC_IRQ_HW_PEN_SYNC (1 << 10) +#define ADC_IRQ_PEN_UP (1 << 9) +#define ADC_IRQ_OUT_RANGE (1 << 8) +#define ADC_IRQ_FIFO1_UNDR (1 << 7) +#define ADC_IRQ_FIFO1_OVERR (1 << 6) +#define ADC_IRQ_FIFO1_THRES (1 << 5) +#define ADC_IRQ_FIFO0_UNDR (1 << 4) +#define ADC_IRQ_FIFO0_OVERR (1 << 3) +#define ADC_IRQ_FIFO0_THRES (1 << 2) +#define ADC_IRQ_END_OF_SEQ (1 << 1) +#define ADC_IRQ_HW_PEN_ASYNC (1 << 0) +#define ADC_CTRL 0x040 +#define ADC_CTRL_STEP_WP (1 << 2) +#define ADC_CTRL_STEP_ID (1 << 1) +#define ADC_CTRL_ENABLE (1 << 0) +#define ADC_STAT 0x044 +#define ADC_CLKDIV 0x04c +#define ADC_STEPENABLE 0x054 +#define ADC_IDLECONFIG 0x058 +#define ADC_STEPCFG1 0x064 +#define ADC_STEPDLY1 0x068 +#define ADC_STEPCFG2 0x06c +#define ADC_STEPDLY2 0x070 +#define ADC_STEPCFG3 0x074 +#define ADC_STEPDLY3 0x078 +#define ADC_STEPCFG4 0x07c +#define ADC_STEPDLY4 0x080 +#define ADC_STEPCFG5 0x084 +#define ADC_STEPDLY5 0x088 +#define ADC_STEPCFG6 0x08c +#define ADC_STEPDLY6 0x090 +#define ADC_STEPCFG7 0x094 +#define ADC_STEPDLY7 0x098 +#define ADC_STEP_DIFF_CNTRL (1 << 25) +#define ADC_STEP_RFM_MSK 0x01800000 +#define ADC_STEP_RFM_SHIFT 23 +#define ADC_STEP_RFM_VSSA 0 +#define ADC_STEP_RFM_XNUR 1 +#define ADC_STEP_RFM_YNLR 2 +#define ADC_STEP_RFM_VREFN 3 +#define ADC_STEP_INP_MSK 0x00780000 +#define ADC_STEP_INP_SHIFT 19 +#define ADC_STEP_INM_MSK 0x00078000 +#define ADC_STEP_INM_SHIFT 15 +#define ADC_STEP_IN_VREFN 8 +#define ADC_STEP_RFP_MSK 0x00007000 +#define ADC_STEP_RFP_SHIFT 12 +#define ADC_STEP_RFP_VDDA 0 +#define ADC_STEP_RFP_XPUL 1 +#define ADC_STEP_RFP_YPLL 2 +#define ADC_STEP_RFP_VREFP 3 +#define ADC_STEP_RFP_INTREF 4 +#define ADC_STEP_AVG_MSK 0x0000001c +#define ADC_STEP_AVG_SHIFT 2 +#define ADC_STEP_MODE_MSK 0x00000003 +#define ADC_STEP_MODE_ONESHOT 0x00000000 +#define ADC_STEP_MODE_CONTINUOUS 0x00000001 +#define ADC_STEP_SAMPLE_DELAY 0xff000000 +#define ADC_STEP_OPEN_DELAY 0x0003ffff +#define ADC_FIFO0COUNT 0x0e4 +#define ADC_FIFO0THRESHOLD 0x0e8 +#define ADC_FIFO0DATA 0x100 +#define ADC_FIFO_COUNT_MSK 0x0000007f +#define ADC_FIFO_STEP_ID_MSK 0x000f0000 +#define ADC_FIFO_STEP_ID_SHIFT 16 +#define ADC_FIFO_DATA_MSK 0x00000fff + +#endif /* _TI_ADCREG_H_ */ Added: head/sys/arm/ti/ti_adcvar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/ti_adcvar.h Mon Mar 24 20:06:27 2014 (r263693) @@ -0,0 +1,69 @@ +/*- + * Copyright 2014 Luiz Otavio O Souza + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _TI_ADCVAR_H_ +#define _TI_ADCVAR_H_ + +#define TI_ADC_NPINS 7 + +#define ADC_READ4(_sc, reg) bus_read_4((_sc)->sc_mem_res, reg) +#define ADC_WRITE4(_sc, reg, value) \ + bus_write_4((_sc)->sc_mem_res, reg, value) + +struct ti_adc_softc { + device_t sc_dev; + int sc_last_state; + struct mtx sc_mtx; + struct resource *sc_mem_res; + struct resource *sc_irq_res; + void *sc_intrhand; +}; + +struct ti_adc_input { + int32_t enable; /* input enabled */ + int32_t samples; /* samples average */ + int32_t input; /* input number */ + int32_t value; /* raw converted value */ + uint32_t stepconfig; /* step config register */ + uint32_t stepdelay; /* step delay register */ + struct ti_adc_softc *sc; /* pointer to adc softc */ +}; + +#define TI_ADC_LOCK(_sc) \ + mtx_lock(&(_sc)->sc_mtx) +#define TI_ADC_UNLOCK(_sc) \ + mtx_unlock(&(_sc)->sc_mtx) +#define TI_ADC_LOCK_INIT(_sc) \ + mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), \ + "ti_adc", MTX_DEF) +#define TI_ADC_LOCK_DESTROY(_sc) \ + mtx_destroy(&_sc->sc_mtx); +#define TI_ADC_LOCK_ASSERT(_sc) \ + mtx_assert(&(_sc)->sc_mtx, MA_OWNED) + +#endif /* _TI_ADCVAR_H_ */ Modified: head/sys/arm/ti/ti_prcm.h ============================================================================== --- head/sys/arm/ti/ti_prcm.h Mon Mar 24 19:21:14 2014 (r263692) +++ head/sys/arm/ti/ti_prcm.h Mon Mar 24 20:06:27 2014 (r263693) @@ -162,6 +162,8 @@ typedef enum { PRUSS_CLK = 1700, + TSC_ADC_CLK = 1800, + INVALID_CLK_IDENT } clk_ident_t; Modified: head/sys/boot/fdt/dts/arm/am335x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/am335x.dtsi Mon Mar 24 19:21:14 2014 (r263692) +++ head/sys/boot/fdt/dts/arm/am335x.dtsi Mon Mar 24 20:06:27 2014 (r263693) @@ -75,6 +75,13 @@ interrupt-parent = <&AINTC>; }; + adc0: adc@44E0D000 { + compatible = "ti,adc"; + reg = <0x44E0D000 0x2000>; + interrupts = < 16 >; + interrupt-parent = <&AINTC>; + }; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Mar 24 20:09:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 161E069C for ; Mon, 24 Mar 2014 20:09:59 +0000 (UTC) Received: from mail-qa0-f50.google.com (mail-qa0-f50.google.com [209.85.216.50]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C3EE932F for ; Mon, 24 Mar 2014 20:09:58 +0000 (UTC) Received: by mail-qa0-f50.google.com with SMTP id o15so6019674qap.9 for ; Mon, 24 Mar 2014 13:09:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=x9GDeKVcSPkE7Mvovmn3zM4ELbArpe3l/WLbukVqCgw=; b=Qrv2NWgdyhXDeo9Dr/mXFKjZsihzK9hESEZaSGFDylAEkbDS1zmJug9bxCmB30+1dH jcJMeIgFt7RBS1o9hFx6Wee1GI7bzqlW3RIdCLkNofrln4WmWZQo7lpA1Fu6Dpm9qRCE Lu6teE6CvcIVhooIUH0oXJbRLU82tFHk7TE4yigJHnhPYOfUCQOrTPULj08R2oNFkL7r d/D0wCT+7RL9TtY+1+lDzzVkx2GsXvofVyjcanYUYbtVarnXvs8cPAPFadE5UOxDAIV1 A1Ssq/8vwd2F8NZkDlKqivJdknluzCXTULJEfXtr+PYZqDmnZu6t1KNAHCkd8qWD2akC 7dHA== X-Gm-Message-State: ALoCoQlR41HTYhtiEfm995zzammniczQbjTc+vvr+6VCYKeD3/9NblviMDCUI/xA7dMC/VTryWAQ X-Received: by 10.140.95.230 with SMTP id i93mr74345785qge.1.1395691792135; Mon, 24 Mar 2014 13:09:52 -0700 (PDT) Received: from netflix-mac.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id b16sm28060655qag.14.2014.03.24.13.09.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Mar 2014 13:09:51 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1251 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263692 - head From: Warner Losh In-Reply-To: <1395691301.81853.61.camel@revolution.hippie.lan> Date: Mon, 24 Mar 2014 14:09:50 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <78B026E6-219F-436A-92F1-0C913344899C@bsdimp.com> References: <201403241921.s2OJLFuh050413@svn.freebsd.org> <75AEE837-AD15-4310-B318-80BC12D9F89E@FreeBSD.org> <1395691301.81853.61.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Dimitry Andric X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 20:09:59 -0000 On Mar 24, 2014, at 2:01 PM, Ian Lepore wrote: > On Mon, 2014-03-24 at 20:47 +0100, Dimitry Andric wrote: >> On 24 Mar 2014, at 20:36, Warner Losh wrote: >>> On Mar 24, 2014, at 1:21 PM, Dimitry Andric wrote: >>>> Author: dim >>>> Date: Mon Mar 24 19:21:14 2014 >>>> New Revision: 263692 >>>> URL: http://svnweb.freebsd.org/changeset/base/263692 >>>>=20 >>>> Log: >>>> Add a note to UPDATING about customized kernel configuration files = now >>>> requiring -gdwarf-2 for debug info, when using clang 3.4. >>>=20 >>> Makes we wonder why we didn=92t put this in kmod.mk=85 Is there any = reason not do? >>=20 >> For modules, you can just DEBUG_FLAGS, like for world. But there is = no >> default value of DEBUG_FLAGS in kmod.mk, at least I don't see any. >>=20 >> -Dimitry >>=20 >=20 > I guessing he meant kern.mk so that it would be in effect for both > kernel and modules build. Something like this (which I've tested only > for building an arm kernel without modules so far)... >=20 > -- Ian >=20 > Index: sys/conf/kern.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/conf/kern.mk (revision 263112) > +++ sys/conf/kern.mk (working copy) > @@ -162,3 +162,7 @@ CFLAGS+=3D -ffreestanding > ${MACHINE_CPUARCH} !=3D "arm" && ${MACHINE_CPUARCH} !=3D "mips" > CFLAGS+=3D -fstack-protector > .endif > + > +.if ${COMPILER_TYPE} =3D=3D "clang" && !empty(CFLAGS:M-g*) && = empty(CFLAGS:M-gdwarf*) > +CFLAGS+=3D -gdwarf-2 > +.endif Exactly. We don=92t need more kludge-o-ramas for this in the config = files, we need fewer. Since clang doesn=92t play well with the kernel on = this detail, and since the kernel makefiles can cope, we should make = them rather than having it hard-coded in lots of config files (or std.* = files) that we=92ll just need to remove later when we have a dwarf 4 = solution. Warner= From owner-svn-src-head@FreeBSD.ORG Mon Mar 24 20:30:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 049C21AA; Mon, 24 Mar 2014 20:30:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E5DA1786; Mon, 24 Mar 2014 20:30:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2OKUdto080842; Mon, 24 Mar 2014 20:30:39 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2OKUd8Y080841; Mon, 24 Mar 2014 20:30:39 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403242030.s2OKUd8Y080841@svn.freebsd.org> From: Dimitry Andric Date: Mon, 24 Mar 2014 20:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263694 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 20:30:40 -0000 Author: dim Date: Mon Mar 24 20:30:39 2014 New Revision: 263694 URL: http://svnweb.freebsd.org/changeset/base/263694 Log: Apply a temporary band-aid for building devd with clang 3.4, libstdc++ and -Wsystem-headers enabled (which is the default for any non-zero WARNS level, crazily enough!). This is primarily meant to be MFC'd as soon as possible. MFC after: 3 days Modified: head/sbin/devd/Makefile Modified: head/sbin/devd/Makefile ============================================================================== --- head/sbin/devd/Makefile Mon Mar 24 20:06:27 2014 (r263693) +++ head/sbin/devd/Makefile Mon Mar 24 20:30:39 2014 (r263694) @@ -13,6 +13,7 @@ LDADD= -ll -lutil YFLAGS+=-v CFLAGS+=-I. -I${.CURDIR} +CFLAGS.clang+=-Wno-keyword-compat CLEANFILES= y.output From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 01:34:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44319366; Tue, 25 Mar 2014 01:34:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3058C36B; Tue, 25 Mar 2014 01:34:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2P1Ye5l008462; Tue, 25 Mar 2014 01:34:40 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2P1YdsU008458; Tue, 25 Mar 2014 01:34:39 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201403250134.s2P1YdsU008458@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Tue, 25 Mar 2014 01:34:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263698 - in head/sys/arm: allwinner/a20 conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 01:34:40 -0000 Author: ganbold Date: Tue Mar 25 01:34:39 2014 New Revision: 263698 URL: http://svnweb.freebsd.org/changeset/base/263698 Log: Add code for enabling second CPU core for A20 SoC. Enable SMP on Cubieboard2. Approved by: stas (mentor) Added: head/sys/arm/allwinner/a20/a20_mp.c (contents, props changed) Modified: head/sys/arm/allwinner/a20/files.a20 head/sys/arm/conf/CUBIEBOARD2 Added: head/sys/arm/allwinner/a20/a20_mp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a20/a20_mp.c Tue Mar 25 01:34:39 2014 (r263698) @@ -0,0 +1,158 @@ +/*- + * Copyright (c) 2014 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define CPUCFG_BASE 0x01c25c00 +#define CPUCFG_SIZE 0x400 + +#define CPU0_RST_CTL 0x40 +#define CPU0_CTL 0x44 +#define CPU0_STATUS 0x48 +#define CPU1_RST_CTL 0x80 +#define CPU1_CTL 0x84 +#define CPU1_STATUS 0x88 +#define CPUCFG_GENCTL 0x184 +#define CPUCFG_P_REG0 0x1a4 +#define CPU1_PWR_CLAMP 0x1b0 +#define CPU1_PWROFF_REG 0x1b4 +#define CPUCFG_DBGCTL0 0x1e0 +#define CPUCFG_DBGCTL1 0x1e4 + +void +platform_mp_init_secondary(void) +{ + + gic_init_secondary(); +} + +void +platform_mp_setmaxid(void) +{ + int ncpu; + + if (mp_ncpus != 0) + return; + + /* Read current CP15 Cache Size ID Register */ + __asm __volatile("mrc p15, 1, %0, c9, c0, 2" : "=r" (ncpu)); + ncpu = ((ncpu >> 24) & 0x3) + 1; + + mp_ncpus = ncpu; + mp_maxid = ncpu - 1; +} + +int +platform_mp_probe(void) +{ + + if (mp_ncpus == 0) + platform_mp_setmaxid(); + + return (mp_ncpus > 1); +} + +void +platform_mp_start_ap(void) +{ + bus_space_handle_t cpucfg; + + uint32_t val; + + if (bus_space_map(fdtbus_bs_tag, CPUCFG_BASE, CPUCFG_SIZE, 0, + &cpucfg) != 0) + panic("Couldn't map the CPUCFG\n"); + + cpu_idcache_wbinv_all(); + cpu_l2cache_wbinv_all(); + + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPUCFG_P_REG0, + pmap_kextract((vm_offset_t)mpentry)); + + /* + * Assert nCOREPORESET low and set L1RSTDISABLE low. + * Ensure DBGPWRDUP is set to LOW to prevent any external + * debug access to the processor. + */ + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_RST_CTL, 0); + + /* Set L1RSTDISABLE low */ + val = bus_space_read_4(fdtbus_bs_tag, cpucfg, CPUCFG_GENCTL); + val &= ~(1 << 1); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPUCFG_GENCTL, val); + + /* Set DBGPWRDUP low */ + val = bus_space_read_4(fdtbus_bs_tag, cpucfg, CPUCFG_DBGCTL1); + val &= ~(1 << 1); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPUCFG_DBGCTL1, val); + + /* Release power clamp */ + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWR_CLAMP, 0xff); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWR_CLAMP, 0x7f); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWR_CLAMP, 0x3f); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWR_CLAMP, 0x1f); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWR_CLAMP, 0x0f); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWR_CLAMP, 0x07); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWR_CLAMP, 0x03); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWR_CLAMP, 0x01); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWR_CLAMP, 0x00); + DELAY(10000); + + /* Clear power-off gating */ + val = bus_space_read_4(fdtbus_bs_tag, cpucfg, CPU1_PWROFF_REG); + val &= ~(1 << 0); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_PWROFF_REG, val); + DELAY(1000); + + /* De-assert cpu core reset */ + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPU1_RST_CTL, 3); + + /* Assert DBGPWRDUP signal */ + val = bus_space_read_4(fdtbus_bs_tag, cpucfg, CPUCFG_DBGCTL1); + val |= (1 << 1); + bus_space_write_4(fdtbus_bs_tag, cpucfg, CPUCFG_DBGCTL1, val); + + armv7_sev(); + bus_space_unmap(fdtbus_bs_tag, cpucfg, CPUCFG_SIZE); +} + +void +platform_ipi_send(cpuset_t cpus, u_int ipi) +{ + + pic_ipi_send(cpus, ipi); +} Modified: head/sys/arm/allwinner/a20/files.a20 ============================================================================== --- head/sys/arm/allwinner/a20/files.a20 Tue Mar 25 00:29:56 2014 (r263697) +++ head/sys/arm/allwinner/a20/files.a20 Tue Mar 25 01:34:39 2014 (r263698) @@ -20,3 +20,4 @@ arm/allwinner/timer.c standard arm/arm/bus_space-v6.c standard arm/allwinner/a10_common.c standard arm/allwinner/a10_machdep.c standard +arm/allwinner/a20/a20_mp.c optional smp Modified: head/sys/arm/conf/CUBIEBOARD2 ============================================================================== --- head/sys/arm/conf/CUBIEBOARD2 Tue Mar 25 00:29:56 2014 (r263697) +++ head/sys/arm/conf/CUBIEBOARD2 Tue Mar 25 01:34:39 2014 (r263698) @@ -138,3 +138,4 @@ options FDT options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=cubieboard2.dts +options SMP # Enable multiple cores From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 02:17:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48E8A9F8; Tue, 25 Mar 2014 02:17:27 +0000 (UTC) Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [IPv6:2a00:1450:400c:c00::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 911258AA; Tue, 25 Mar 2014 02:17:26 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id k14so3925684wgh.23 for ; Mon, 24 Mar 2014 19:17:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=X0mc3uAYoEqQLgzRYZinlSGj/lhhiEkO2L2XD0petgI=; b=tKXO+9T5bQygh2a8thp/1kLEUF10SZnwI8x7VIMQ/sl9WkUCvJt37DOCzKSoPwZf/M KR0AoojilV7nZ5Qjgs1INs6jsBeS99Ux665yTfDlyC9JQCDJ2I0FGvcRkDQWHuOSmes/ Xu7HZhwl7fVV/wg1p+66ZnzMgCb8ld60PHaVosekX4eJ7JF8pVehNc5RnxNt9fyYjex3 LoL9ntMY+LigjFnKwA9mlgHlL4HqxkQyortO9n+S4c1ok4KvtN6RHggC6kmdficMMFiY FKb+H+LzuRZ0eVMvwf315Ujo8Y9wjlcDHMhmEyM1McXPnpRb37gOEBy2nDbxbMnAfUIR /vWw== MIME-Version: 1.0 X-Received: by 10.180.189.169 with SMTP id gj9mr20007905wic.17.1395713845067; Mon, 24 Mar 2014 19:17:25 -0700 (PDT) Sender: maksim.yevmenkin@gmail.com Received: by 10.227.72.130 with HTTP; Mon, 24 Mar 2014 19:17:25 -0700 (PDT) In-Reply-To: <20140324185949.GR32089@funkthat.com> References: <201403241813.s2OIDfEd024721@svn.freebsd.org> <20140324185949.GR32089@funkthat.com> Date: Mon, 24 Mar 2014 19:17:25 -0700 X-Google-Sender-Auth: wAI5q0OkvUbBMIL4YP9gG9u0UaU Message-ID: Subject: Re: svn commit: r263690 - head/sys/kern From: Maksim Yevmenkin To: John-Mark Gurney Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 02:17:27 -0000 On Mon, Mar 24, 2014 at 11:59 AM, John-Mark Gurney wrote: > Maksim Yevmenkin wrote this message on Mon, Mar 24, 2014 at 18:13 +0000: >> Author: emax >> Date: Mon Mar 24 18:13:41 2014 >> New Revision: 263690 >> URL: http://svnweb.freebsd.org/changeset/base/263690 >> >> Log: >> change defaule permissions on /dev/devstat. while i'm here remove >> D_NEEDGIANT flag > > I know that the following change is part of the remove D_NEEDGIANT, but > I'm puzzled how this code either worked before, or continues to work.. hmm... beats me too... pagelist is only growing and never shrinking, and new pages are added to the of the list, so may be that the reason, i.e. window for race is very small > It looks like pagelist was suppose to be protected by devstat_mutex, > but previously wasn't and that this is fixing that bug, is this > correct? it should fix it, yes. thanks max From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 03:28:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A9897A6; Tue, 25 Mar 2014 03:28:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D1C4CE6F; Tue, 25 Mar 2014 03:28:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2P3SwdN054559; Tue, 25 Mar 2014 03:28:58 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2P3Swsl054558; Tue, 25 Mar 2014 03:28:58 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201403250328.s2P3Swsl054558@svn.freebsd.org> From: Mateusz Guzik Date: Tue, 25 Mar 2014 03:28:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263704 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 03:28:59 -0000 Author: mjg Date: Tue Mar 25 03:28:58 2014 New Revision: 263704 URL: http://svnweb.freebsd.org/changeset/base/263704 Log: Make /dev/devctl mpsafe. MFC after: 1 week Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue Mar 25 03:25:30 2014 (r263703) +++ head/sys/kern/subr_bus.c Tue Mar 25 03:28:58 2014 (r263704) @@ -358,15 +358,16 @@ device_sysctl_fini(device_t dev) /* Deprecated way to adjust queue length */ static int sysctl_devctl_disable(SYSCTL_HANDLER_ARGS); /* XXX Need to support old-style tunable hw.bus.devctl_disable" */ -SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW, NULL, - 0, sysctl_devctl_disable, "I", "devctl disable -- deprecated"); +SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW | + CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_disable, "I", + "devctl disable -- deprecated"); #define DEVCTL_DEFAULT_QUEUE_LEN 1000 static int sysctl_devctl_queue(SYSCTL_HANDLER_ARGS); static int devctl_queue_length = DEVCTL_DEFAULT_QUEUE_LEN; TUNABLE_INT("hw.bus.devctl_queue", &devctl_queue_length); -SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_queue, CTLTYPE_INT | CTLFLAG_RW, NULL, - 0, sysctl_devctl_queue, "I", "devctl queue length"); +SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_queue, CTLTYPE_INT | CTLFLAG_RW | + CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_queue, "I", "devctl queue length"); static d_open_t devopen; static d_close_t devclose; @@ -376,7 +377,6 @@ static d_poll_t devpoll; static struct cdevsw dev_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, .d_open = devopen, .d_close = devclose, .d_read = devread, @@ -420,23 +420,31 @@ devinit(void) static int devopen(struct cdev *dev, int oflags, int devtype, struct thread *td) { + if (devsoftc.inuse) return (EBUSY); + mtx_lock(&devsoftc.mtx); + if (devsoftc.inuse) { + mtx_unlock(&devsoftc.mtx); + return (EBUSY); + } /* move to init */ devsoftc.inuse = 1; devsoftc.nonblock = 0; devsoftc.async_proc = NULL; + mtx_unlock(&devsoftc.mtx); return (0); } static int devclose(struct cdev *dev, int fflag, int devtype, struct thread *td) { - devsoftc.inuse = 0; + mtx_lock(&devsoftc.mtx); + devsoftc.inuse = 0; + devsoftc.async_proc = NULL; cv_broadcast(&devsoftc.cv); mtx_unlock(&devsoftc.mtx); - devsoftc.async_proc = NULL; return (0); } From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 06:55:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 340A8544; Tue, 25 Mar 2014 06:55:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1F54A61; Tue, 25 Mar 2014 06:55:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2P6tskv040483; Tue, 25 Mar 2014 06:55:54 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2P6tsZ0040479; Tue, 25 Mar 2014 06:55:54 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201403250655.s2P6tsZ0040479@svn.freebsd.org> From: Martin Matuska Date: Tue, 25 Mar 2014 06:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263710 - in head/sys: net netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 06:55:55 -0000 Author: mm Date: Tue Mar 25 06:55:53 2014 New Revision: 263710 URL: http://svnweb.freebsd.org/changeset/base/263710 Log: Merge from projects/pf r251993 (glebius@): De-vnet hash sizes and hash masks. Submitted by: Nikos Vassiliadis Reviewed by: trociny MFC after: 1 month Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/if_pfsync.c head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_ioctl.c Directory Properties: head/sys/ (props changed) Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Tue Mar 25 04:45:55 2014 (r263709) +++ head/sys/net/pfvar.h Tue Mar 25 06:55:53 2014 (r263710) @@ -1488,19 +1488,17 @@ struct pf_idhash { struct mtx lock; }; +extern u_long pf_hashmask; +extern u_long pf_srchashmask; #define PF_HASHSIZ (32768) VNET_DECLARE(struct pf_keyhash *, pf_keyhash); VNET_DECLARE(struct pf_idhash *, pf_idhash); -VNET_DECLARE(u_long, pf_hashmask); #define V_pf_keyhash VNET(pf_keyhash) #define V_pf_idhash VNET(pf_idhash) -#define V_pf_hashmask VNET(pf_hashmask) VNET_DECLARE(struct pf_srchash *, pf_srchash); -VNET_DECLARE(u_long, pf_srchashmask); #define V_pf_srchash VNET(pf_srchash) -#define V_pf_srchashmask VNET(pf_srchashmask) -#define PF_IDHASH(s) (be64toh((s)->id) % (V_pf_hashmask + 1)) +#define PF_IDHASH(s) (be64toh((s)->id) % (pf_hashmask + 1)) VNET_DECLARE(void *, pf_swi_cookie); #define V_pf_swi_cookie VNET(pf_swi_cookie) Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Tue Mar 25 04:45:55 2014 (r263709) +++ head/sys/netpfil/pf/if_pfsync.c Tue Mar 25 06:55:53 2014 (r263710) @@ -683,7 +683,7 @@ pfsync_in_clr(struct pfsync_pkt *pkt, st pfi_kif_find(clr[i].ifname) == NULL) continue; - for (int i = 0; i <= V_pf_hashmask; i++) { + for (int i = 0; i <= pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; struct pf_state *s; relock: @@ -2048,7 +2048,7 @@ pfsync_bulk_update(void *arg) else i = sc->sc_bulk_hashid; - for (; i <= V_pf_hashmask; i++) { + for (; i <= pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; if (s != NULL) Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Tue Mar 25 04:45:55 2014 (r263709) +++ head/sys/netpfil/pf/pf.c Tue Mar 25 06:55:53 2014 (r263710) @@ -361,21 +361,19 @@ enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI static MALLOC_DEFINE(M_PFHASH, "pf_hash", "pf(4) hash header structures"); VNET_DEFINE(struct pf_keyhash *, pf_keyhash); VNET_DEFINE(struct pf_idhash *, pf_idhash); -VNET_DEFINE(u_long, pf_hashmask); VNET_DEFINE(struct pf_srchash *, pf_srchash); -VNET_DEFINE(u_long, pf_srchashmask); SYSCTL_NODE(_net, OID_AUTO, pf, CTLFLAG_RW, 0, "pf(4)"); -VNET_DEFINE(u_long, pf_hashsize); -#define V_pf_hashsize VNET(pf_hashsize) -SYSCTL_VNET_UINT(_net_pf, OID_AUTO, states_hashsize, CTLFLAG_RDTUN, - &VNET_NAME(pf_hashsize), 0, "Size of pf(4) states hashtable"); - -VNET_DEFINE(u_long, pf_srchashsize); -#define V_pf_srchashsize VNET(pf_srchashsize) -SYSCTL_VNET_UINT(_net_pf, OID_AUTO, source_nodes_hashsize, CTLFLAG_RDTUN, - &VNET_NAME(pf_srchashsize), 0, "Size of pf(4) source nodes hashtable"); +u_long pf_hashmask; +u_long pf_srchashmask; +static u_long pf_hashsize; +static u_long pf_srchashsize; + +SYSCTL_UINT(_net_pf, OID_AUTO, states_hashsize, CTLFLAG_RDTUN, + &pf_hashsize, 0, "Size of pf(4) states hashtable"); +SYSCTL_UINT(_net_pf, OID_AUTO, source_nodes_hashsize, CTLFLAG_RDTUN, + &pf_srchashsize, 0, "Size of pf(4) source nodes hashtable"); VNET_DEFINE(void *, pf_swi_cookie); @@ -391,7 +389,7 @@ pf_hashkey(struct pf_state_key *sk) sizeof(struct pf_state_key_cmp)/sizeof(uint32_t), V_pf_hashseed); - return (h & V_pf_hashmask); + return (h & pf_hashmask); } static __inline uint32_t @@ -412,7 +410,7 @@ pf_hashsrc(struct pf_addr *addr, sa_fami panic("%s: unknown address family %u", __func__, af); } - return (h & V_pf_srchashmask); + return (h & pf_srchashmask); } #ifdef INET6 @@ -574,7 +572,7 @@ pf_overload_task(void *c, int pending) if (SLIST_EMPTY(&queue)) return; - for (int i = 0; i <= V_pf_hashmask; i++) { + for (int i = 0; i <= pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; struct pf_state_key *sk; struct pf_state *s; @@ -739,12 +737,12 @@ pf_initialize() struct pf_srchash *sh; u_int i; - TUNABLE_ULONG_FETCH("net.pf.states_hashsize", &V_pf_hashsize); - if (V_pf_hashsize == 0 || !powerof2(V_pf_hashsize)) - V_pf_hashsize = PF_HASHSIZ; - TUNABLE_ULONG_FETCH("net.pf.source_nodes_hashsize", &V_pf_srchashsize); - if (V_pf_srchashsize == 0 || !powerof2(V_pf_srchashsize)) - V_pf_srchashsize = PF_HASHSIZ / 4; + TUNABLE_ULONG_FETCH("net.pf.states_hashsize", &pf_hashsize); + if (pf_hashsize == 0 || !powerof2(pf_hashsize)) + pf_hashsize = PF_HASHSIZ; + TUNABLE_ULONG_FETCH("net.pf.source_nodes_hashsize", &pf_srchashsize); + if (pf_srchashsize == 0 || !powerof2(pf_srchashsize)) + pf_srchashsize = PF_HASHSIZ / 4; V_pf_hashseed = arc4random(); @@ -758,12 +756,12 @@ pf_initialize() V_pf_state_key_z = uma_zcreate("pf state keys", sizeof(struct pf_state_key), pf_state_key_ctor, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - V_pf_keyhash = malloc(V_pf_hashsize * sizeof(struct pf_keyhash), + V_pf_keyhash = malloc(pf_hashsize * sizeof(struct pf_keyhash), M_PFHASH, M_WAITOK | M_ZERO); - V_pf_idhash = malloc(V_pf_hashsize * sizeof(struct pf_idhash), + V_pf_idhash = malloc(pf_hashsize * sizeof(struct pf_idhash), M_PFHASH, M_WAITOK | M_ZERO); - V_pf_hashmask = V_pf_hashsize - 1; - for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= V_pf_hashmask; + pf_hashmask = pf_hashsize - 1; + for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= pf_hashmask; i++, kh++, ih++) { mtx_init(&kh->lock, "pf_keyhash", NULL, MTX_DEF | MTX_DUPOK); mtx_init(&ih->lock, "pf_idhash", NULL, MTX_DEF); @@ -776,10 +774,10 @@ pf_initialize() V_pf_limits[PF_LIMIT_SRC_NODES].zone = V_pf_sources_z; uma_zone_set_max(V_pf_sources_z, PFSNODE_HIWAT); uma_zone_set_warning(V_pf_sources_z, "PF source nodes limit reached"); - V_pf_srchash = malloc(V_pf_srchashsize * sizeof(struct pf_srchash), + V_pf_srchash = malloc(pf_srchashsize * sizeof(struct pf_srchash), M_PFHASH, M_WAITOK|M_ZERO); - V_pf_srchashmask = V_pf_srchashsize - 1; - for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) + pf_srchashmask = pf_srchashsize - 1; + for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) mtx_init(&sh->lock, "pf_srchash", NULL, MTX_DEF); /* ALTQ */ @@ -816,7 +814,7 @@ pf_cleanup() struct pf_send_entry *pfse, *next; u_int i; - for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= V_pf_hashmask; + for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= pf_hashmask; i++, kh++, ih++) { KASSERT(LIST_EMPTY(&kh->keys), ("%s: key hash not empty", __func__)); @@ -828,7 +826,7 @@ pf_cleanup() free(V_pf_keyhash, M_PFHASH); free(V_pf_idhash, M_PFHASH); - for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { + for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) { KASSERT(LIST_EMPTY(&sh->nodes), ("%s: source node hash not empty", __func__)); mtx_destroy(&sh->lock); @@ -1218,7 +1216,7 @@ pf_find_state_byid(uint64_t id, uint32_t V_pf_status.fcounters[FCNT_STATE_SEARCH]++; - ih = &V_pf_idhash[(be64toh(id) % (V_pf_hashmask + 1))]; + ih = &V_pf_idhash[(be64toh(id) % (pf_hashmask + 1))]; PF_HASHROW_LOCK(ih); LIST_FOREACH(s, &ih->states, entry) @@ -1414,7 +1412,7 @@ pf_purge_thread(void *v) /* * Now purge everything. */ - pf_purge_expired_states(0, V_pf_hashmask); + pf_purge_expired_states(0, pf_hashmask); pf_purge_expired_fragments(); pf_purge_expired_src_nodes(); @@ -1437,7 +1435,7 @@ pf_purge_thread(void *v) PF_RULES_RUNLOCK(); /* Process 1/interval fraction of the state table every run. */ - idx = pf_purge_expired_states(idx, V_pf_hashmask / + idx = pf_purge_expired_states(idx, pf_hashmask / (V_pf_default_rule.timeout[PFTM_INTERVAL] * 10)); /* Purge other expired types every PFTM_INTERVAL seconds. */ @@ -1503,7 +1501,7 @@ pf_purge_expired_src_nodes() int i; LIST_INIT(&freelist); - for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { + for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH_SAFE(cur, &sh->nodes, entry, next) if (cur->states == 0 && cur->expire <= time_uptime) { @@ -1649,7 +1647,7 @@ relock: PF_HASHROW_UNLOCK(ih); /* Return when we hit end of hash. */ - if (++i > V_pf_hashmask) { + if (++i > pf_hashmask) { V_pf_status.states = uma_zone_get_cur(V_pf_state_z); return (0); } Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Tue Mar 25 04:45:55 2014 (r263709) +++ head/sys/netpfil/pf/pf_ioctl.c Tue Mar 25 06:55:53 2014 (r263710) @@ -1601,7 +1601,7 @@ DIOCCHANGERULE_error: struct pfioc_state_kill *psk = (struct pfioc_state_kill *)addr; u_int i, killed = 0; - for (i = 0; i <= V_pf_hashmask; i++) { + for (i = 0; i <= pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; relock_DIOCCLRSTATES: @@ -1646,7 +1646,7 @@ relock_DIOCCLRSTATES: break; } - for (i = 0; i <= V_pf_hashmask; i++) { + for (i = 0; i <= pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; relock_DIOCKILLSTATES: @@ -1749,7 +1749,7 @@ relock_DIOCKILLSTATES: p = pstore = malloc(ps->ps_len, M_TEMP, M_WAITOK); nr = 0; - for (i = 0; i <= V_pf_hashmask; i++) { + for (i = 0; i <= pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; PF_HASHROW_LOCK(ih); @@ -3095,7 +3095,7 @@ DIOCCHANGEADDR_error: uint32_t i, nr = 0; if (psn->psn_len == 0) { - for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; + for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH(n, &sh->nodes, entry) @@ -3107,7 +3107,7 @@ DIOCCHANGEADDR_error: } p = pstore = malloc(psn->psn_len, M_TEMP, M_WAITOK); - for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; + for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH(n, &sh->nodes, entry) { @@ -3312,7 +3312,7 @@ pf_clear_states(void) struct pf_state *s; u_int i; - for (i = 0; i <= V_pf_hashmask; i++) { + for (i = 0; i <= pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; relock: PF_HASHROW_LOCK(ih); @@ -3347,7 +3347,7 @@ pf_clear_srcnodes(struct pf_src_node *n) struct pf_state *s; int i; - for (i = 0; i <= V_pf_hashmask; i++) { + for (i = 0; i <= pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; PF_HASHROW_LOCK(ih); @@ -3363,7 +3363,7 @@ pf_clear_srcnodes(struct pf_src_node *n) if (n == NULL) { struct pf_srchash *sh; - for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; + for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH(n, &sh->nodes, entry) { @@ -3385,7 +3385,7 @@ pf_kill_srcnodes(struct pfioc_src_node_k struct pf_src_node_list kill; LIST_INIT(&kill); - for (int i = 0; i <= V_pf_srchashmask; i++) { + for (int i = 0; i <= pf_srchashmask; i++) { struct pf_srchash *sh = &V_pf_srchash[i]; struct pf_src_node *sn, *tmp; @@ -3406,7 +3406,7 @@ pf_kill_srcnodes(struct pfioc_src_node_k PF_HASHROW_UNLOCK(sh); } - for (int i = 0; i <= V_pf_hashmask; i++) { + for (int i = 0; i <= pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; struct pf_state *s; From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 08:31:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D87B3CE2; Tue, 25 Mar 2014 08:31:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C28CEAEE; Tue, 25 Mar 2014 08:31:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2P8VrNp081324; Tue, 25 Mar 2014 08:31:53 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2P8VlcL079592; Tue, 25 Mar 2014 08:31:47 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201403250831.s2P8VlcL079592@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Tue, 25 Mar 2014 08:31:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263711 - in head/sys: arm/allwinner arm/allwinner/a20 arm/rockchip boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 08:31:53 -0000 Author: ganbold Date: Tue Mar 25 08:31:47 2014 New Revision: 263711 URL: http://svnweb.freebsd.org/changeset/base/263711 Log: Switch to my freebsd.org emal address in copyright. Approved by: stas (mentor) Modified: head/sys/arm/allwinner/a10_clk.c head/sys/arm/allwinner/a10_clk.h head/sys/arm/allwinner/a10_common.c head/sys/arm/allwinner/a10_ehci.c head/sys/arm/allwinner/a10_gpio.c head/sys/arm/allwinner/a10_gpio.h head/sys/arm/allwinner/a10_machdep.c head/sys/arm/allwinner/a10_sramc.c head/sys/arm/allwinner/a10_sramc.h head/sys/arm/allwinner/a20/a20_cpu_cfg.c head/sys/arm/allwinner/a20/a20_cpu_cfg.h head/sys/arm/allwinner/aintc.c head/sys/arm/allwinner/console.c head/sys/arm/allwinner/if_emac.c head/sys/arm/allwinner/if_emacreg.h head/sys/arm/allwinner/timer.c head/sys/arm/rockchip/rk30xx_common.c head/sys/arm/rockchip/rk30xx_gpio.c head/sys/arm/rockchip/rk30xx_grf.c head/sys/arm/rockchip/rk30xx_grf.h head/sys/arm/rockchip/rk30xx_machdep.c head/sys/arm/rockchip/rk30xx_pmu.c head/sys/arm/rockchip/rk30xx_pmu.h head/sys/arm/rockchip/rk30xx_wdog.c head/sys/arm/rockchip/rk30xx_wdog.h head/sys/boot/fdt/dts/arm/cubieboard.dts head/sys/boot/fdt/dts/arm/cubieboard2.dts head/sys/boot/fdt/dts/arm/rk3188-radxa.dts head/sys/boot/fdt/dts/arm/rk3188.dtsi Modified: head/sys/arm/allwinner/a10_clk.c ============================================================================== --- head/sys/arm/allwinner/a10_clk.c Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/allwinner/a10_clk.c Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/a10_clk.h ============================================================================== --- head/sys/arm/allwinner/a10_clk.h Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/allwinner/a10_clk.h Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/a10_common.c ============================================================================== --- head/sys/arm/allwinner/a10_common.c Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/allwinner/a10_common.c Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2012 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/allwinner/a10_ehci.c Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2012 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/allwinner/a10_gpio.c Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * Copyright (c) 2012 Oleksandr Tymoshenko * Copyright (c) 2012 Luiz Otavio O Souza. * All rights reserved. Modified: head/sys/arm/allwinner/a10_gpio.h ============================================================================== --- head/sys/arm/allwinner/a10_gpio.h Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/allwinner/a10_gpio.h Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/a10_machdep.c ============================================================================== --- head/sys/arm/allwinner/a10_machdep.c Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/allwinner/a10_machdep.c Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2012 Ganbold Tsagaankhuu * All rights reserved. * * This code is derived from software written for Brini by Mark Brinicombe Modified: head/sys/arm/allwinner/a10_sramc.c ============================================================================== --- head/sys/arm/allwinner/a10_sramc.c Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/allwinner/a10_sramc.c Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/a10_sramc.h ============================================================================== --- head/sys/arm/allwinner/a10_sramc.h Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/allwinner/a10_sramc.h Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/a20/a20_cpu_cfg.c ============================================================================== --- head/sys/arm/allwinner/a20/a20_cpu_cfg.c Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/allwinner/a20/a20_cpu_cfg.c Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/a20/a20_cpu_cfg.h ============================================================================== --- head/sys/arm/allwinner/a20/a20_cpu_cfg.h Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/allwinner/a20/a20_cpu_cfg.h Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/aintc.c ============================================================================== --- head/sys/arm/allwinner/aintc.c Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/allwinner/aintc.c Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2012 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/console.c ============================================================================== --- head/sys/arm/allwinner/console.c Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/allwinner/console.c Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2012 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/if_emac.c ============================================================================== --- head/sys/arm/allwinner/if_emac.c Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/allwinner/if_emac.c Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/if_emacreg.h ============================================================================== --- head/sys/arm/allwinner/if_emacreg.h Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/allwinner/if_emacreg.h Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Ganbold Tsagaankhuu + * Copyright (C) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/timer.c ============================================================================== --- head/sys/arm/allwinner/timer.c Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/allwinner/timer.c Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2012 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/rockchip/rk30xx_common.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_common.c Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/rockchip/rk30xx_common.c Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/rockchip/rk30xx_gpio.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_gpio.c Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/rockchip/rk30xx_gpio.c Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * Copyright (c) 2012 Oleksandr Tymoshenko * Copyright (c) 2012 Luiz Otavio O Souza. * All rights reserved. Modified: head/sys/arm/rockchip/rk30xx_grf.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_grf.c Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/rockchip/rk30xx_grf.c Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/rockchip/rk30xx_grf.h ============================================================================== --- head/sys/arm/rockchip/rk30xx_grf.h Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/rockchip/rk30xx_grf.h Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/rockchip/rk30xx_machdep.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_machdep.c Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/rockchip/rk30xx_machdep.c Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * This code is derived from software written for Brini by Mark Brinicombe Modified: head/sys/arm/rockchip/rk30xx_pmu.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_pmu.c Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/rockchip/rk30xx_pmu.c Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/rockchip/rk30xx_pmu.h ============================================================================== --- head/sys/arm/rockchip/rk30xx_pmu.h Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/rockchip/rk30xx_pmu.h Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/rockchip/rk30xx_wdog.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_wdog.c Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/rockchip/rk30xx_wdog.c Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/rockchip/rk30xx_wdog.h ============================================================================== --- head/sys/arm/rockchip/rk30xx_wdog.h Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/arm/rockchip/rk30xx_wdog.h Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/fdt/dts/arm/cubieboard.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/cubieboard.dts Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/boot/fdt/dts/arm/cubieboard.dts Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2012 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/fdt/dts/arm/cubieboard2.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/cubieboard2.dts Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/boot/fdt/dts/arm/cubieboard2.dts Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/fdt/dts/arm/rk3188-radxa.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/rk3188-radxa.dts Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/boot/fdt/dts/arm/rk3188-radxa.dts Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/fdt/dts/arm/rk3188.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/rk3188.dtsi Tue Mar 25 06:55:53 2014 (r263710) +++ head/sys/boot/fdt/dts/arm/rk3188.dtsi Tue Mar 25 08:31:47 2014 (r263711) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ganbold Tsagaankhuu + * Copyright (c) 2013 Ganbold Tsagaankhuu * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 09:06:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 295FD695; Tue, 25 Mar 2014 09:06:25 +0000 (UTC) Date: Tue, 25 Mar 2014 09:06:25 +0000 From: Alexey Dokuchaev To: Justin Hibbits Subject: Re: svn commit: r261342 - in head: lib/libpmc sys/conf sys/dev/hwpmc sys/powerpc/include sys/sys Message-ID: <20140325090625.GA93175@FreeBSD.org> References: <201402010203.s1123pjF019150@svn.freebsd.org> <20140324054442.GA98485@FreeBSD.org> <20140323225818.58f41de3@zhabar.att.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140323225818.58f41de3@zhabar.att.net> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 09:06:25 -0000 On Sun, Mar 23, 2014 at 10:58:18PM -0700, Justin Hibbits wrote: > On Mon, 24 Mar 2014 05:44:42 +0000 Alexey Dokuchaev wrote: > > Hmm, -CURRENT does not build for me after this commit apparently; > > take a look at the log excerpt. Could it be that r261342 relies on > > some earlier revision which I'm missing (that is, my r260369'ish > > -CURRENT is too old)? What's the best way to catch up? Thanks, > > It looks to me like it's picking up your old PMC header files. Did you > try doing a full buildworld (without a -DNO_CLEAN)? I've built world > multiple times since and it works just fine for me. It turned out to be ccache's fault. Once I've resumed the build with -DNO_CLEAN -DNO_CCACHE, it finished just fine. ./danfe From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 11:05:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09C2B392; Tue, 25 Mar 2014 11:05:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E7025B94; Tue, 25 Mar 2014 11:05:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2PB5dKo043079; Tue, 25 Mar 2014 11:05:39 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PB5ZAU043047; Tue, 25 Mar 2014 11:05:35 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201403251105.s2PB5ZAU043047@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 25 Mar 2014 11:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263712 - in head: crypto/openssh crypto/openssh/contrib/caldera crypto/openssh/contrib/redhat crypto/openssh/contrib/suse crypto/openssh/openbsd-compat crypto/openssh/regress secure/li... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 11:05:40 -0000 Author: des Date: Tue Mar 25 11:05:34 2014 New Revision: 263712 URL: http://svnweb.freebsd.org/changeset/base/263712 Log: Upgrade to OpenSSH 6.6p1. Added: head/crypto/openssh/digest-libc.c - copied unchanged from r263635, vendor-crypto/openssh/dist/digest-libc.c head/crypto/openssh/digest-openssl.c - copied unchanged from r263635, vendor-crypto/openssh/dist/digest-openssl.c head/crypto/openssh/hmac.c - copied unchanged from r263635, vendor-crypto/openssh/dist/hmac.c head/crypto/openssh/hmac.h - copied unchanged from r263635, vendor-crypto/openssh/dist/hmac.h head/crypto/openssh/openbsd-compat/explicit_bzero.c - copied unchanged from r263635, vendor-crypto/openssh/dist/openbsd-compat/explicit_bzero.c head/crypto/openssh/regress/dhgex.sh - copied unchanged from r263635, vendor-crypto/openssh/dist/regress/dhgex.sh Deleted: head/crypto/openssh/auth2-jpake.c head/crypto/openssh/digest.c head/crypto/openssh/jpake.c head/crypto/openssh/jpake.h head/crypto/openssh/schnorr.h Modified: head/crypto/openssh/ChangeLog head/crypto/openssh/Makefile.in head/crypto/openssh/README head/crypto/openssh/auth-rsa.c head/crypto/openssh/auth.h head/crypto/openssh/auth1.c head/crypto/openssh/auth2-chall.c head/crypto/openssh/auth2-gss.c head/crypto/openssh/auth2-passwd.c head/crypto/openssh/auth2.c head/crypto/openssh/authfd.c head/crypto/openssh/authfile.c head/crypto/openssh/bufaux.c head/crypto/openssh/bufbn.c head/crypto/openssh/bufec.c head/crypto/openssh/buffer.c head/crypto/openssh/canohost.c head/crypto/openssh/channels.c head/crypto/openssh/cipher-3des1.c head/crypto/openssh/cipher-chachapoly.c head/crypto/openssh/cipher.c head/crypto/openssh/clientloop.c head/crypto/openssh/config.h head/crypto/openssh/config.h.in head/crypto/openssh/configure head/crypto/openssh/configure.ac head/crypto/openssh/contrib/caldera/openssh.spec head/crypto/openssh/contrib/redhat/openssh.spec head/crypto/openssh/contrib/suse/openssh.spec head/crypto/openssh/digest.h head/crypto/openssh/gss-serv.c head/crypto/openssh/hostfile.c head/crypto/openssh/kex.c head/crypto/openssh/kex.h head/crypto/openssh/kexc25519.c head/crypto/openssh/kexdhc.c head/crypto/openssh/kexdhs.c head/crypto/openssh/kexecdhc.c head/crypto/openssh/kexecdhs.c head/crypto/openssh/kexgexc.c head/crypto/openssh/kexgexs.c head/crypto/openssh/key.c head/crypto/openssh/krl.c head/crypto/openssh/mac.c head/crypto/openssh/moduli.0 head/crypto/openssh/monitor.c head/crypto/openssh/monitor.h head/crypto/openssh/monitor_wrap.c head/crypto/openssh/monitor_wrap.h head/crypto/openssh/openbsd-compat/Makefile.in head/crypto/openssh/openbsd-compat/bsd-poll.c head/crypto/openssh/openbsd-compat/openbsd-compat.h head/crypto/openssh/openbsd-compat/openssl-compat.c head/crypto/openssh/openbsd-compat/openssl-compat.h head/crypto/openssh/packet.c head/crypto/openssh/readconf.c head/crypto/openssh/readconf.h head/crypto/openssh/readpass.c head/crypto/openssh/regress/Makefile head/crypto/openssh/regress/agent-ptrace.sh head/crypto/openssh/regress/agent.sh head/crypto/openssh/regress/cert-hostkey.sh head/crypto/openssh/regress/host-expand.sh head/crypto/openssh/regress/login-timeout.sh head/crypto/openssh/regress/scp-ssh-wrapper.sh head/crypto/openssh/regress/scp.sh head/crypto/openssh/regress/setuid-allowed.c head/crypto/openssh/regress/sftp-chroot.sh head/crypto/openssh/rsa.c head/crypto/openssh/sandbox-capsicum.c head/crypto/openssh/sandbox-seccomp-filter.c head/crypto/openssh/sandbox-systrace.c head/crypto/openssh/scp.0 head/crypto/openssh/servconf.c head/crypto/openssh/servconf.h head/crypto/openssh/serverloop.c head/crypto/openssh/session.c head/crypto/openssh/sftp-client.c head/crypto/openssh/sftp-server.0 head/crypto/openssh/sftp.0 head/crypto/openssh/ssh-add.0 head/crypto/openssh/ssh-add.c head/crypto/openssh/ssh-agent.0 head/crypto/openssh/ssh-agent.c head/crypto/openssh/ssh-dss.c head/crypto/openssh/ssh-ecdsa.c head/crypto/openssh/ssh-ed25519.c head/crypto/openssh/ssh-gss.h head/crypto/openssh/ssh-keygen.0 head/crypto/openssh/ssh-keygen.1 head/crypto/openssh/ssh-keygen.c head/crypto/openssh/ssh-keyscan.0 head/crypto/openssh/ssh-keyscan.1 head/crypto/openssh/ssh-keysign.0 head/crypto/openssh/ssh-pkcs11-helper.0 head/crypto/openssh/ssh-rsa.c head/crypto/openssh/ssh.0 head/crypto/openssh/ssh.c head/crypto/openssh/ssh2.h head/crypto/openssh/ssh_config head/crypto/openssh/ssh_config.0 head/crypto/openssh/ssh_config.5 head/crypto/openssh/ssh_namespace.h head/crypto/openssh/sshconnect.c head/crypto/openssh/sshconnect1.c head/crypto/openssh/sshconnect2.c head/crypto/openssh/sshd.0 head/crypto/openssh/sshd.c head/crypto/openssh/sshd_config head/crypto/openssh/sshd_config.0 head/crypto/openssh/sshd_config.5 head/crypto/openssh/sshlogin.c head/crypto/openssh/version.h head/secure/lib/libssh/Makefile head/secure/usr.sbin/sshd/Makefile Directory Properties: head/crypto/openssh/ (props changed) Modified: head/crypto/openssh/ChangeLog ============================================================================== --- head/crypto/openssh/ChangeLog Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/ChangeLog Tue Mar 25 11:05:34 2014 (r263712) @@ -1,3 +1,224 @@ +20140313 + - (djm) Release OpenSSH 6.6 + +20140304 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2014/03/03 22:22:30 + [session.c] + ignore enviornment variables with embedded '=' or '\0' characters; + spotted by Jann Horn; ok deraadt@ + +20140301 + - (djm) [regress/Makefile] Disable dhgex regress test; it breaks when + no moduli file exists at the expected location. + +20140228 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2014/02/27 00:41:49 + [bufbn.c] + fix unsigned overflow that could lead to reading a short ssh protocol + 1 bignum value; found by Ben Hawkes; ok deraadt@ + - djm@cvs.openbsd.org 2014/02/27 08:25:09 + [bufbn.c] + off by one in range check + - djm@cvs.openbsd.org 2014/02/27 22:47:07 + [sshd_config.5] + bz#2184 clarify behaviour of a keyword that appears in multiple + matching Match blocks; ok dtucker@ + - djm@cvs.openbsd.org 2014/02/27 22:57:40 + [version.h] + openssh-6.6 + - dtucker@cvs.openbsd.org 2014/01/19 23:43:02 + [regress/sftp-chroot.sh] + Don't use -q on sftp as it suppresses logging, instead redirect the + output to the regress logfile. + - dtucker@cvs.openbsd.org 2014/01/20 00:00:30 + [sregress/ftp-chroot.sh] + append to rather than truncating the log file + - dtucker@cvs.openbsd.org 2014/01/25 04:35:32 + [regress/Makefile regress/dhgex.sh] + Add a test for DH GEX sizes + - djm@cvs.openbsd.org 2014/01/26 10:22:10 + [regress/cert-hostkey.sh] + automatically generate revoked keys from listed keys rather than + manually specifying each type; from portable + (Id sync only) + - djm@cvs.openbsd.org 2014/01/26 10:49:17 + [scp-ssh-wrapper.sh scp.sh] + make sure $SCP is tested on the remote end rather than whichever one + happens to be in $PATH; from portable + (Id sync only) + - djm@cvs.openbsd.org 2014/02/27 20:04:16 + [login-timeout.sh] + remove any existing LoginGraceTime from sshd_config before adding + a specific one for the test back in + - djm@cvs.openbsd.org 2014/02/27 21:21:25 + [agent-ptrace.sh agent.sh] + keep return values that are printed in error messages; + from portable + (Id sync only) + - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec] + [contrib/suse/openssh.spec] Crank version numbers + - (djm) [regress/host-expand.sh] Add RCS Id + +20140227 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2014/02/26 20:18:37 + [ssh.c] + bz#2205: avoid early hostname lookups unless canonicalisation is enabled; + ok dtucker@ markus@ + - djm@cvs.openbsd.org 2014/02/26 20:28:44 + [auth2-gss.c gss-serv.c ssh-gss.h sshd.c] + bz#2107 - cache OIDs of supported GSSAPI mechanisms before privsep + sandboxing, as running this code in the sandbox can cause violations; + ok markus@ + - djm@cvs.openbsd.org 2014/02/26 20:29:29 + [channels.c] + don't assume that the socks4 username is \0 terminated; + spotted by Ben Hawkes; ok markus@ + - markus@cvs.openbsd.org 2014/02/26 21:53:37 + [sshd.c] + ssh_gssapi_prepare_supported_oids needs GSSAPI + +20140224 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2014/02/07 06:55:54 + [cipher.c mac.c] + remove some logging that makes ssh debugging output very verbose; + ok markus + - djm@cvs.openbsd.org 2014/02/15 23:05:36 + [channels.c] + avoid spurious "getsockname failed: Bad file descriptor" errors in ssh -W; + bz#2200, debian#738692 via Colin Watson; ok dtucker@ + - djm@cvs.openbsd.org 2014/02/22 01:32:19 + [readconf.c] + when processing Match blocks, skip 'exec' clauses if previous predicates + failed to match; ok markus@ + - djm@cvs.openbsd.org 2014/02/23 20:03:42 + [ssh-ed25519.c] + check for unsigned overflow; not reachable in OpenSSH but others might + copy our code... + - djm@cvs.openbsd.org 2014/02/23 20:11:36 + [readconf.c readconf.h ssh.c ssh_config.5] + reparse ssh_config and ~/.ssh/config if hostname canonicalisation changes + the hostname. This allows users to write configurations that always + refer to canonical hostnames, e.g. + + CanonicalizeHostname yes + CanonicalDomains int.example.org example.org + CanonicalizeFallbackLocal no + + Host *.int.example.org + Compression off + Host *.example.org + User djm + + ok markus@ + +20140213 + - (dtucker) [configure.ac openbsd-compat/openssl-compat.{c,h}] Add compat + code for older OpenSSL versions that don't have EVP_MD_CTX_copy_ex. + +20140207 + - OpenBSD CVS Sync + - naddy@cvs.openbsd.org 2014/02/05 20:13:25 + [ssh-keygen.1 ssh-keygen.c] + tweak synopsis: calling ssh-keygen without any arguments is fine; ok jmc@ + while here, fix ordering in usage(); requested by jmc@ + - djm@cvs.openbsd.org 2014/02/06 22:21:01 + [sshconnect.c] + in ssh_create_socket(), only do the getaddrinfo for BindAddress when + BindAddress is actually specified. Fixes regression in 6.5 for + UsePrivilegedPort=yes; patch from Corinna Vinschen + +20140206 + - (dtucker) [openbsd-compat/bsd-poll.c] Don't bother checking for non-NULL + before freeing since free(NULL) is a no-op. ok djm. + - (djm) [sandbox-seccomp-filter.c] Not all Linux architectures define + __NR_shutdown; some go via the socketcall(2) multiplexer. + +20140205 + - (djm) [sandbox-capsicum.c] Don't fatal if Capsicum is offered by + headers/libc but not supported by the kernel. Patch from Loganaden + Velvindron @ AfriNIC + +20140204 + - OpenBSD CVS Sync + - markus@cvs.openbsd.org 2014/01/27 18:58:14 + [Makefile.in digest.c digest.h hostfile.c kex.h mac.c hmac.c hmac.h] + replace openssl HMAC with an implementation based on our ssh_digest_* + ok and feedback djm@ + - markus@cvs.openbsd.org 2014/01/27 19:18:54 + [auth-rsa.c cipher.c ssh-agent.c sshconnect1.c sshd.c] + replace openssl MD5 with our ssh_digest_*; ok djm@ + - markus@cvs.openbsd.org 2014/01/27 20:13:46 + [digest.c digest-openssl.c digest-libc.c Makefile.in] + rename digest.c to digest-openssl.c and add libc variant; ok djm@ + - jmc@cvs.openbsd.org 2014/01/28 14:13:39 + [ssh-keyscan.1] + kill some bad Pa; + From: Jan Stary + - djm@cvs.openbsd.org 2014/01/29 00:19:26 + [sshd.c] + use kill(0, ...) instead of killpg(0, ...); on most operating systems + they are equivalent, but SUSv2 describes the latter as having undefined + behaviour; from portable; ok dtucker + (Id sync only; change is already in portable) + - djm@cvs.openbsd.org 2014/01/29 06:18:35 + [Makefile.in auth.h auth2-jpake.c auth2.c jpake.c jpake.h monitor.c] + [monitor.h monitor_wrap.c monitor_wrap.h readconf.c readconf.h] + [schnorr.c schnorr.h servconf.c servconf.h ssh2.h sshconnect2.c] + remove experimental, never-enabled JPAKE code; ok markus@ + - jmc@cvs.openbsd.org 2014/01/29 14:04:51 + [sshd_config.5] + document kbdinteractiveauthentication; + requested From: Ross L Richardson + + dtucker/markus helped explain its workings; + - djm@cvs.openbsd.org 2014/01/30 22:26:14 + [sandbox-systrace.c] + allow shutdown(2) syscall in sandbox - it may be called by packet_close() + from portable + (Id sync only; change is already in portable) + - tedu@cvs.openbsd.org 2014/01/31 16:39:19 + [auth2-chall.c authfd.c authfile.c bufaux.c bufec.c canohost.c] + [channels.c cipher-chachapoly.c clientloop.c configure.ac hostfile.c] + [kexc25519.c krl.c monitor.c sandbox-systrace.c session.c] + [sftp-client.c ssh-keygen.c ssh.c sshconnect2.c sshd.c sshlogin.c] + [openbsd-compat/explicit_bzero.c openbsd-compat/openbsd-compat.h] + replace most bzero with explicit_bzero, except a few that cna be memset + ok djm dtucker + - djm@cvs.openbsd.org 2014/02/02 03:44:32 + [auth1.c auth2-chall.c auth2-passwd.c authfile.c bufaux.c bufbn.c] + [buffer.c cipher-3des1.c cipher.c clientloop.c gss-serv.c kex.c] + [kexdhc.c kexdhs.c kexecdhc.c kexgexc.c kexecdhs.c kexgexs.c key.c] + [monitor.c monitor_wrap.c packet.c readpass.c rsa.c serverloop.c] + [ssh-add.c ssh-agent.c ssh-dss.c ssh-ecdsa.c ssh-ed25519.c] + [ssh-keygen.c ssh-rsa.c sshconnect.c sshconnect1.c sshconnect2.c] + [sshd.c] + convert memset of potentially-private data to explicit_bzero() + - djm@cvs.openbsd.org 2014/02/03 23:28:00 + [ssh-ecdsa.c] + fix memory leak; ECDSA_SIG_new() allocates 'r' and 's' for us, unlike + DSA_SIG_new. Reported by Batz Spear; ok markus@ + - djm@cvs.openbsd.org 2014/02/02 03:44:31 + [digest-libc.c digest-openssl.c] + convert memset of potentially-private data to explicit_bzero() + - djm@cvs.openbsd.org 2014/02/04 00:24:29 + [ssh.c] + delay lowercasing of hostname until right before hostname + canonicalisation to unbreak case-sensitive matching of ssh_config; + reported by Ike Devolder; ok markus@ + - (djm) [openbsd-compat/Makefile.in] Add missing explicit_bzero.o + - (djm) [regress/setuid-allowed.c] Missing string.h for strerror() + +20140131 + - (djm) [sandbox-seccomp-filter.c sandbox-systrace.c] Allow shutdown(2) + syscall from sandboxes; it may be called by packet_close. + - (dtucker) [readconf.c] Include for the hton macros. Fixes + build with HP-UX's compiler. Patch from Kevin Brott. + - (tim) [Makefile.in] build regress/setuid-allow. + 20140130 - (djm) [configure.ac] Only check for width-specified integer types in headers that actually exist. patch from Tom G. Christensen; @@ -2663,3 +2884,4 @@ [contrib/suse/openssh.spec] Update for release 6.0 - (djm) [README] Update URL to release notes. - (djm) Release openssh-6.0 + Modified: head/crypto/openssh/Makefile.in ============================================================================== --- head/crypto/openssh/Makefile.in Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/Makefile.in Tue Mar 25 11:05:34 2014 (r263712) @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.352 2014/01/27 06:35:04 dtucker Exp $ +# $Id: Makefile.in,v 1.356 2014/02/04 00:12:56 djm Exp $ # uncomment if you run a non bourne compatable shell. Ie. csh #SHELL = @SH@ @@ -73,9 +73,9 @@ LIBSSH_OBJS=authfd.o authfile.o bufaux.o monitor_fdpass.o rijndael.o ssh-dss.o ssh-ecdsa.o ssh-rsa.o dh.o \ kexdh.o kexgex.o kexdhc.o kexgexc.o bufec.o kexecdh.o kexecdhc.o \ msg.o progressmeter.o dns.o entropy.o gss-genr.o umac.o umac128.o \ - jpake.o schnorr.o ssh-pkcs11.o krl.o smult_curve25519_ref.o \ + ssh-pkcs11.o krl.o smult_curve25519_ref.o \ kexc25519.o kexc25519c.o poly1305.o chacha.o cipher-chachapoly.o \ - ssh-ed25519.o digest.o \ + ssh-ed25519.o digest-openssl.o hmac.o \ sc25519.o ge25519.o fe25519.o ed25519.o verify.o hash.o blocks.o SSHOBJS= ssh.o readconf.o clientloop.o sshtty.o \ @@ -88,7 +88,7 @@ SSHDOBJS=sshd.o auth-rhosts.o auth-passw auth.o auth1.o auth2.o auth-options.o session.o \ auth-chall.o auth2-chall.o groupaccess.o \ auth-skey.o auth-bsdauth.o auth2-hostbased.o auth2-kbdint.o \ - auth2-none.o auth2-passwd.o auth2-pubkey.o auth2-jpake.o \ + auth2-none.o auth2-passwd.o auth2-pubkey.o \ monitor_mm.o monitor.o monitor_wrap.o kexdhs.o kexgexs.o kexecdhs.o \ kexc25519s.o auth-krb5.o \ auth2-gss.o gss-serv.o gss-serv-krb5.o \ @@ -408,7 +408,7 @@ regress/setuid-allowed$(EXEEXT): $(srcdi $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $? \ $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) -tests interop-tests: $(TARGETS) regress/modpipe$(EXEEXT) +tests interop-tests: $(TARGETS) regress/modpipe$(EXEEXT) regress/setuid-allowed$(EXEEXT) BUILDDIR=`pwd`; \ TEST_SHELL="@TEST_SHELL@"; \ TEST_SSH_SCP="$${BUILDDIR}/scp"; \ Modified: head/crypto/openssh/README ============================================================================== --- head/crypto/openssh/README Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/README Tue Mar 25 11:05:34 2014 (r263712) @@ -1,4 +1,4 @@ -See http://www.openssh.com/txt/release-6.5 for the release notes. +See http://www.openssh.com/txt/release-6.6 for the release notes. - A Japanese translation of this document and of the OpenSSH FAQ is - available at http://www.unixuser.org/~haruyama/security/openssh/index.html @@ -62,4 +62,4 @@ References - [6] http://www.openbsd.org/cgi-bin/man.cgi?query=style&sektion=9 [7] http://www.openssh.com/faq.html -$Id: README,v 1.85 2014/01/16 07:51:45 djm Exp $ +$Id: README,v 1.86 2014/02/27 23:03:53 djm Exp $ Modified: head/crypto/openssh/auth-rsa.c ============================================================================== --- head/crypto/openssh/auth-rsa.c Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/auth-rsa.c Tue Mar 25 11:05:34 2014 (r263712) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth-rsa.c,v 1.85 2013/07/12 00:19:58 djm Exp $ */ +/* $OpenBSD: auth-rsa.c,v 1.86 2014/01/27 19:18:54 markus Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -20,7 +20,6 @@ #include #include -#include #include #include @@ -48,6 +47,8 @@ #include "ssh.h" #include "misc.h" +#include "digest.h" + /* import */ extern ServerOptions options; @@ -91,12 +92,13 @@ int auth_rsa_verify_response(Key *key, BIGNUM *challenge, u_char response[16]) { u_char buf[32], mdbuf[16]; - MD5_CTX md; + struct ssh_digest_ctx *md; int len; /* don't allow short keys */ if (BN_num_bits(key->rsa->n) < SSH_RSA_MINIMUM_MODULUS_SIZE) { - error("auth_rsa_verify_response: RSA modulus too small: %d < minimum %d bits", + error("%s: RSA modulus too small: %d < minimum %d bits", + __func__, BN_num_bits(key->rsa->n), SSH_RSA_MINIMUM_MODULUS_SIZE); return (0); } @@ -104,13 +106,15 @@ auth_rsa_verify_response(Key *key, BIGNU /* The response is MD5 of decrypted challenge plus session id. */ len = BN_num_bytes(challenge); if (len <= 0 || len > 32) - fatal("auth_rsa_verify_response: bad challenge length %d", len); + fatal("%s: bad challenge length %d", __func__, len); memset(buf, 0, 32); BN_bn2bin(challenge, buf + 32 - len); - MD5_Init(&md); - MD5_Update(&md, buf, 32); - MD5_Update(&md, session_id, 16); - MD5_Final(mdbuf, &md); + if ((md = ssh_digest_start(SSH_DIGEST_MD5)) == NULL || + ssh_digest_update(md, buf, 32) < 0 || + ssh_digest_update(md, session_id, 16) < 0 || + ssh_digest_final(md, mdbuf, sizeof(mdbuf)) < 0) + fatal("%s: md5 failed", __func__); + ssh_digest_free(md); /* Verify that the response is the original challenge. */ if (timingsafe_bcmp(response, mdbuf, 16) != 0) { Modified: head/crypto/openssh/auth.h ============================================================================== --- head/crypto/openssh/auth.h Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/auth.h Tue Mar 25 11:05:34 2014 (r263712) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth.h,v 1.76 2013/07/19 07:37:48 markus Exp $ */ +/* $OpenBSD: auth.h,v 1.77 2014/01/29 06:18:35 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. @@ -61,7 +61,6 @@ struct Authctxt { char *style; void *kbdintctxt; char *info; /* Extra info for next auth_log */ - void *jpake_ctx; #ifdef BSD_AUTH auth_session_t *as; #endif @@ -175,9 +174,6 @@ int bsdauth_respond(void *, u_int, char int skey_query(void *, char **, char **, u_int *, char ***, u_int **); int skey_respond(void *, u_int, char **); -void auth2_jpake_get_pwdata(Authctxt *, BIGNUM **, char **, char **); -void auth2_jpake_stop(Authctxt *); - int allowed_user(struct passwd *); struct passwd * getpwnamallow(const char *user); Modified: head/crypto/openssh/auth1.c ============================================================================== --- head/crypto/openssh/auth1.c Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/auth1.c Tue Mar 25 11:05:34 2014 (r263712) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth1.c,v 1.79 2013/05/19 02:42:42 djm Exp $ */ +/* $OpenBSD: auth1.c,v 1.80 2014/02/02 03:44:31 djm Exp $ */ /* * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved @@ -129,7 +129,7 @@ auth1_process_password(Authctxt *authctx /* Try authentication with the password. */ authenticated = PRIVSEP(auth_password(authctxt, password)); - memset(password, 0, dlen); + explicit_bzero(password, dlen); free(password); return (authenticated); @@ -222,7 +222,7 @@ auth1_process_tis_response(Authctxt *aut response = packet_get_string(&dlen); packet_check_eom(); authenticated = verify_response(authctxt, response); - memset(response, 'r', dlen); + explicit_bzero(response, dlen); free(response); return (authenticated); Modified: head/crypto/openssh/auth2-chall.c ============================================================================== --- head/crypto/openssh/auth2-chall.c Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/auth2-chall.c Tue Mar 25 11:05:34 2014 (r263712) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth2-chall.c,v 1.39 2013/11/08 00:39:14 djm Exp $ */ +/* $OpenBSD: auth2-chall.c,v 1.41 2014/02/02 03:44:31 djm Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. * Copyright (c) 2001 Per Allansson. All rights reserved. @@ -148,7 +148,7 @@ kbdint_free(KbdintAuthctxt *kbdintctxt) if (kbdintctxt->device) kbdint_reset_device(kbdintctxt); free(kbdintctxt->devices); - bzero(kbdintctxt, sizeof(*kbdintctxt)); + explicit_bzero(kbdintctxt, sizeof(*kbdintctxt)); free(kbdintctxt); } /* get next device */ @@ -312,7 +312,7 @@ input_userauth_info_response(int type, u res = kbdintctxt->device->respond(kbdintctxt->ctxt, nresp, response); for (i = 0; i < nresp; i++) { - memset(response[i], 'r', strlen(response[i])); + explicit_bzero(response[i], strlen(response[i])); free(response[i]); } free(response); Modified: head/crypto/openssh/auth2-gss.c ============================================================================== --- head/crypto/openssh/auth2-gss.c Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/auth2-gss.c Tue Mar 25 11:05:34 2014 (r263712) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth2-gss.c,v 1.20 2013/05/17 00:13:13 djm Exp $ */ +/* $OpenBSD: auth2-gss.c,v 1.21 2014/02/26 20:28:44 djm Exp $ */ /* * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. @@ -62,7 +62,6 @@ userauth_gssapi(Authctxt *authctxt) gss_OID_desc goid = {0, NULL}; Gssctxt *ctxt = NULL; int mechs; - gss_OID_set supported; int present; OM_uint32 ms; u_int len; @@ -77,7 +76,6 @@ userauth_gssapi(Authctxt *authctxt) return (0); } - ssh_gssapi_supported_oids(&supported); do { mechs--; @@ -90,15 +88,12 @@ userauth_gssapi(Authctxt *authctxt) doid[1] == len - 2) { goid.elements = doid + 2; goid.length = len - 2; - gss_test_oid_set_member(&ms, &goid, supported, - &present); + ssh_gssapi_test_oid_supported(&ms, &goid, &present); } else { logit("Badly formed OID received"); } } while (mechs > 0 && !present); - gss_release_oid_set(&ms, &supported); - if (!present) { free(doid); authctxt->server_caused_failure = 1; Modified: head/crypto/openssh/auth2-passwd.c ============================================================================== --- head/crypto/openssh/auth2-passwd.c Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/auth2-passwd.c Tue Mar 25 11:05:34 2014 (r263712) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth2-passwd.c,v 1.10 2013/05/17 00:13:13 djm Exp $ */ +/* $OpenBSD: auth2-passwd.c,v 1.11 2014/02/02 03:44:31 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * @@ -59,7 +59,7 @@ userauth_passwd(Authctxt *authctxt) if (change) { /* discard new password from packet */ newpass = packet_get_string(&newlen); - memset(newpass, 0, newlen); + explicit_bzero(newpass, newlen); free(newpass); } packet_check_eom(); @@ -68,7 +68,7 @@ userauth_passwd(Authctxt *authctxt) logit("password change not supported"); else if (PRIVSEP(auth_password(authctxt, password)) == 1) authenticated = 1; - memset(password, 0, len); + explicit_bzero(password, len); free(password); return authenticated; } Modified: head/crypto/openssh/auth2.c ============================================================================== --- head/crypto/openssh/auth2.c Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/auth2.c Tue Mar 25 11:05:34 2014 (r263712) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth2.c,v 1.129 2013/05/19 02:42:42 djm Exp $ */ +/* $OpenBSD: auth2.c,v 1.130 2014/01/29 06:18:35 djm Exp $ */ /* $FreeBSD$ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. @@ -74,9 +74,6 @@ extern Authmethod method_hostbased; #ifdef GSSAPI extern Authmethod method_gssapi; #endif -#ifdef JPAKE -extern Authmethod method_jpake; -#endif Authmethod *authmethods[] = { &method_none, @@ -84,9 +81,6 @@ Authmethod *authmethods[] = { #ifdef GSSAPI &method_gssapi, #endif -#ifdef JPAKE - &method_jpake, -#endif &method_passwd, &method_kbdint, &method_hostbased, @@ -301,9 +295,6 @@ input_userauth_request(int type, u_int32 /* reset state */ auth2_challenge_stop(authctxt); -#ifdef JPAKE - auth2_jpake_stop(authctxt); -#endif #ifdef GSSAPI /* XXX move to auth2_gssapi_stop() */ Modified: head/crypto/openssh/authfd.c ============================================================================== --- head/crypto/openssh/authfd.c Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/authfd.c Tue Mar 25 11:05:34 2014 (r263712) @@ -1,4 +1,4 @@ -/* $OpenBSD: authfd.c,v 1.91 2013/12/29 04:29:25 djm Exp $ */ +/* $OpenBSD: authfd.c,v 1.92 2014/01/31 16:39:19 tedu Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -102,7 +102,7 @@ ssh_get_authentication_socket(void) if (!authsocket) return -1; - bzero(&sunaddr, sizeof(sunaddr)); + memset(&sunaddr, 0, sizeof(sunaddr)); sunaddr.sun_family = AF_UNIX; strlcpy(sunaddr.sun_path, authsocket, sizeof(sunaddr.sun_path)); Modified: head/crypto/openssh/authfile.c ============================================================================== --- head/crypto/openssh/authfile.c Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/authfile.c Tue Mar 25 11:05:34 2014 (r263712) @@ -1,4 +1,4 @@ -/* $OpenBSD: authfile.c,v 1.101 2013/12/29 04:35:50 djm Exp $ */ +/* $OpenBSD: authfile.c,v 1.103 2014/02/02 03:44:31 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -131,7 +131,7 @@ key_private_to_blob2(Key *prv, Buffer *b buffer_put_int(&kdf, rounds); } cipher_init(&ctx, c, key, keylen, key + keylen , ivlen, 1); - memset(key, 0, keylen + ivlen); + explicit_bzero(key, keylen + ivlen); free(key); buffer_init(&encoded); @@ -143,7 +143,7 @@ key_private_to_blob2(Key *prv, Buffer *b key_to_blob(prv, &cp, &len); /* public key */ buffer_put_string(&encoded, cp, len); - memset(cp, 0, len); + explicit_bzero(cp, len); free(cp); buffer_free(&kdf); @@ -409,7 +409,7 @@ key_parse_private2(Buffer *blob, int typ free(salt); free(comment); if (key) - memset(key, 0, keylen + ivlen); + explicit_bzero(key, keylen + ivlen); free(key); buffer_free(&encoded); buffer_free(©); @@ -496,10 +496,10 @@ key_private_rsa1_to_blob(Key *key, Buffe buffer_ptr(&buffer), buffer_len(&buffer), 0, 0) != 0) fatal("%s: cipher_crypt failed", __func__); cipher_cleanup(&ciphercontext); - memset(&ciphercontext, 0, sizeof(ciphercontext)); + explicit_bzero(&ciphercontext, sizeof(ciphercontext)); /* Destroy temporary data. */ - memset(buf, 0, sizeof(buf)); + explicit_bzero(buf, sizeof(buf)); buffer_free(&buffer); buffer_append(blob, buffer_ptr(&encrypted), buffer_len(&encrypted)); @@ -703,17 +703,17 @@ key_load_file(int fd, const char *filena __func__, filename == NULL ? "" : filename, filename == NULL ? "" : " ", strerror(errno)); buffer_clear(blob); - bzero(buf, sizeof(buf)); + explicit_bzero(buf, sizeof(buf)); return 0; } buffer_append(blob, buf, len); if (buffer_len(blob) > MAX_KEY_FILE_SIZE) { buffer_clear(blob); - bzero(buf, sizeof(buf)); + explicit_bzero(buf, sizeof(buf)); goto toobig; } } - bzero(buf, sizeof(buf)); + explicit_bzero(buf, sizeof(buf)); if ((st.st_mode & (S_IFSOCK|S_IFCHR|S_IFIFO)) == 0 && st.st_size != buffer_len(blob)) { debug("%s: key file %.200s%schanged size while reading", @@ -831,7 +831,7 @@ key_parse_private_rsa1(Buffer *blob, con buffer_ptr(©), buffer_len(©), 0, 0) != 0) fatal("%s: cipher_crypt failed", __func__); cipher_cleanup(&ciphercontext); - memset(&ciphercontext, 0, sizeof(ciphercontext)); + explicit_bzero(&ciphercontext, sizeof(ciphercontext)); buffer_free(©); check1 = buffer_get_char(&decrypted); Modified: head/crypto/openssh/bufaux.c ============================================================================== --- head/crypto/openssh/bufaux.c Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/bufaux.c Tue Mar 25 11:05:34 2014 (r263712) @@ -1,4 +1,4 @@ -/* $OpenBSD: bufaux.c,v 1.54 2014/01/12 08:13:13 djm Exp $ */ +/* $OpenBSD: bufaux.c,v 1.56 2014/02/02 03:44:31 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -216,7 +216,7 @@ buffer_get_cstring_ret(Buffer *buffer, u if (cp == ret + length - 1) error("buffer_get_cstring_ret: string contains \\0"); else { - bzero(ret, length); + explicit_bzero(ret, length); free(ret); return NULL; } @@ -346,7 +346,7 @@ buffer_get_bignum2_as_string_ret(Buffer } ret = xmalloc(len); memcpy(ret, p, len); - memset(p, '\0', len); + explicit_bzero(p, len); free(bin); return ret; } @@ -383,7 +383,7 @@ buffer_put_bignum2_from_string(Buffer *b } memcpy(p, s, l); buffer_put_string(buffer, buf, l + pad); - memset(buf, '\0', l + pad); + explicit_bzero(buf, l + pad); free(buf); } Modified: head/crypto/openssh/bufbn.c ============================================================================== --- head/crypto/openssh/bufbn.c Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/bufbn.c Tue Mar 25 11:05:34 2014 (r263712) @@ -1,4 +1,4 @@ -/* $OpenBSD: bufbn.c,v 1.8 2013/11/08 11:15:19 dtucker Exp $*/ +/* $OpenBSD: bufbn.c,v 1.11 2014/02/27 08:25:09 djm Exp $*/ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -80,7 +80,7 @@ buffer_put_bignum_ret(Buffer *buffer, co /* Store the binary data. */ buffer_append(buffer, buf, oi); - memset(buf, 0, bin_size); + explicit_bzero(buf, bin_size); free(buf); return (0); @@ -108,6 +108,11 @@ buffer_get_bignum_ret(Buffer *buffer, BI return (-1); } bits = get_u16(buf); + if (bits > 65535-7) { + error("buffer_get_bignum_ret: cannot handle BN of size %d", + bits); + return (-1); + } /* Compute the number of binary bytes that follow. */ bytes = (bits + 7) / 8; if (bytes > 8 * 1024) { @@ -173,7 +178,7 @@ buffer_put_bignum2_ret(Buffer *buffer, c } hasnohigh = (buf[1] & 0x80) ? 0 : 1; buffer_put_string(buffer, buf+hasnohigh, bytes-hasnohigh); - memset(buf, 0, bytes); + explicit_bzero(buf, bytes); free(buf); return (0); } Modified: head/crypto/openssh/bufec.c ============================================================================== --- head/crypto/openssh/bufec.c Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/bufec.c Tue Mar 25 11:05:34 2014 (r263712) @@ -1,4 +1,4 @@ -/* $OpenBSD: bufec.c,v 1.2 2013/05/17 00:13:13 djm Exp $ */ +/* $OpenBSD: bufec.c,v 1.3 2014/01/31 16:39:19 tedu Exp $ */ /* * Copyright (c) 2010 Damien Miller * @@ -77,7 +77,7 @@ buffer_put_ecpoint_ret(Buffer *buffer, c ret = 0; out: if (buf != NULL) { - bzero(buf, len); + explicit_bzero(buf, len); free(buf); } BN_CTX_free(bnctx); @@ -130,7 +130,7 @@ buffer_get_ecpoint_ret(Buffer *buffer, c ret = 0; out: BN_CTX_free(bnctx); - bzero(buf, len); + explicit_bzero(buf, len); free(buf); return ret; } Modified: head/crypto/openssh/buffer.c ============================================================================== --- head/crypto/openssh/buffer.c Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/buffer.c Tue Mar 25 11:05:34 2014 (r263712) @@ -1,4 +1,4 @@ -/* $OpenBSD: buffer.c,v 1.34 2013/11/08 11:15:19 dtucker Exp $ */ +/* $OpenBSD: buffer.c,v 1.35 2014/02/02 03:44:31 djm Exp $ */ /* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -51,7 +51,7 @@ void buffer_free(Buffer *buffer) { if (buffer->alloc > 0) { - memset(buffer->buf, 0, buffer->alloc); + explicit_bzero(buffer->buf, buffer->alloc); buffer->alloc = 0; free(buffer->buf); } Modified: head/crypto/openssh/canohost.c ============================================================================== --- head/crypto/openssh/canohost.c Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/canohost.c Tue Mar 25 11:05:34 2014 (r263712) @@ -192,7 +192,7 @@ ipv64_normalise_mapped(struct sockaddr_s memcpy(&inaddr, ((char *)&a6->sin6_addr) + 12, sizeof(inaddr)); port = a6->sin6_port; - bzero(a4, sizeof(*a4)); + memset(a4, 0, sizeof(*a4)); a4->sin_family = AF_INET; *len = sizeof(*a4); Modified: head/crypto/openssh/channels.c ============================================================================== --- head/crypto/openssh/channels.c Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/channels.c Tue Mar 25 11:05:34 2014 (r263712) @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.328 2013/12/19 01:04:36 djm Exp $ */ +/* $OpenBSD: channels.c,v 1.331 2014/02/26 20:29:29 djm Exp $ */ /* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -431,7 +431,7 @@ channel_free(Channel *c) if (cc->abandon_cb != NULL) cc->abandon_cb(c, cc->ctx); TAILQ_REMOVE(&c->status_confirms, cc, entry); - bzero(cc, sizeof(*cc)); + explicit_bzero(cc, sizeof(*cc)); free(cc); } if (c->filter_cleanup != NULL && c->filter_ctx != NULL) @@ -1115,6 +1115,9 @@ channel_decode_socks4(Channel *c, fd_set buffer_get(&c->input, (char *)&s4_req.dest_addr, 4); have = buffer_len(&c->input); p = buffer_ptr(&c->input); + if (memchr(p, '\0', have) == NULL) + fatal("channel %d: decode socks4: user not nul terminated", + c->self); len = strlen(p); debug2("channel %d: decode socks4: user %s/%d", c->self, p, len); len++; /* trailing '\0' */ @@ -1429,7 +1432,7 @@ port_open_helper(Channel *c, char *rtype int direct; char buf[1024]; char *local_ipaddr = get_local_ipaddr(c->sock); - int local_port = get_sock_port(c->sock, 1); + int local_port = c->sock == -1 ? 65536 : get_sock_port(c->sock, 1); char *remote_ipaddr = get_peer_ipaddr(c->sock); int remote_port = get_peer_port(c->sock); @@ -2725,7 +2728,7 @@ channel_input_status_confirm(int type, u return; cc->cb(type, c, cc->ctx); TAILQ_REMOVE(&c->status_confirms, cc, entry); - bzero(cc, sizeof(*cc)); + explicit_bzero(cc, sizeof(*cc)); free(cc); } @@ -3374,9 +3377,7 @@ channel_connect_ctx_free(struct channel_ free(cctx->host); if (cctx->aitop) freeaddrinfo(cctx->aitop); - bzero(cctx, sizeof(*cctx)); - cctx->host = NULL; - cctx->ai = cctx->aitop = NULL; + memset(cctx, 0, sizeof(*cctx)); } /* Return CONNECTING channel to remote host, port */ Modified: head/crypto/openssh/cipher-3des1.c ============================================================================== --- head/crypto/openssh/cipher-3des1.c Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/cipher-3des1.c Tue Mar 25 11:05:34 2014 (r263712) @@ -1,4 +1,4 @@ -/* $OpenBSD: cipher-3des1.c,v 1.9 2013/11/08 00:39:15 djm Exp $ */ +/* $OpenBSD: cipher-3des1.c,v 1.10 2014/02/02 03:44:31 djm Exp $ */ /* * Copyright (c) 2003 Markus Friedl. All rights reserved. * @@ -93,7 +93,7 @@ ssh1_3des_init(EVP_CIPHER_CTX *ctx, cons if (EVP_CipherInit(&c->k1, EVP_des_cbc(), k1, NULL, enc) == 0 || EVP_CipherInit(&c->k2, EVP_des_cbc(), k2, NULL, !enc) == 0 || EVP_CipherInit(&c->k3, EVP_des_cbc(), k3, NULL, enc) == 0) { - memset(c, 0, sizeof(*c)); + explicit_bzero(c, sizeof(*c)); free(c); EVP_CIPHER_CTX_set_app_data(ctx, NULL); return (0); @@ -134,7 +134,7 @@ ssh1_3des_cleanup(EVP_CIPHER_CTX *ctx) EVP_CIPHER_CTX_cleanup(&c->k1); EVP_CIPHER_CTX_cleanup(&c->k2); EVP_CIPHER_CTX_cleanup(&c->k3); - memset(c, 0, sizeof(*c)); + explicit_bzero(c, sizeof(*c)); free(c); EVP_CIPHER_CTX_set_app_data(ctx, NULL); } Modified: head/crypto/openssh/cipher-chachapoly.c ============================================================================== --- head/crypto/openssh/cipher-chachapoly.c Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/cipher-chachapoly.c Tue Mar 25 11:05:34 2014 (r263712) @@ -14,7 +14,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $OpenBSD: cipher-chachapoly.c,v 1.3 2013/12/15 21:42:35 djm Exp $ */ +/* $OpenBSD: cipher-chachapoly.c,v 1.4 2014/01/31 16:39:19 tedu Exp $ */ #include "includes.h" @@ -58,7 +58,7 @@ chachapoly_crypt(struct chachapoly_ctx * * Run ChaCha20 once to generate the Poly1305 key. The IV is the * packet sequence number. */ - bzero(poly_key, sizeof(poly_key)); + memset(poly_key, 0, sizeof(poly_key)); put_u64(seqbuf, seqnr); chacha_ivsetup(&ctx->main_ctx, seqbuf, NULL); chacha_encrypt_bytes(&ctx->main_ctx, @@ -90,9 +90,9 @@ chachapoly_crypt(struct chachapoly_ctx * r = 0; out: - bzero(expected_tag, sizeof(expected_tag)); - bzero(seqbuf, sizeof(seqbuf)); - bzero(poly_key, sizeof(poly_key)); + explicit_bzero(expected_tag, sizeof(expected_tag)); + explicit_bzero(seqbuf, sizeof(seqbuf)); + explicit_bzero(poly_key, sizeof(poly_key)); return r; } Modified: head/crypto/openssh/cipher.c ============================================================================== --- head/crypto/openssh/cipher.c Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/cipher.c Tue Mar 25 11:05:34 2014 (r263712) @@ -1,4 +1,4 @@ -/* $OpenBSD: cipher.c,v 1.94 2014/01/25 10:12:50 dtucker Exp $ */ +/* $OpenBSD: cipher.c,v 1.97 2014/02/07 06:55:54 djm Exp $ */ /* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -41,8 +41,6 @@ __RCSID("$FreeBSD$"); #include -#include - #include #include #include @@ -51,6 +49,8 @@ __RCSID("$FreeBSD$"); #include "log.h" #include "misc.h" #include "cipher.h" +#include "buffer.h" +#include "digest.h" /* compatibility with old or broken OpenSSL versions */ #include "openbsd-compat/openssl-compat.h" @@ -235,8 +235,6 @@ ciphers_valid(const char *names) debug("bad cipher %s [%s]", p, names); free(cipher_list); return 0; - } else { - debug3("cipher ok: %s [%s]", p, names); } } debug3("ciphers ok: [%s]", names); @@ -344,7 +342,7 @@ cipher_init(CipherContext *cc, const Cip if (EVP_Cipher(&cc->evp, discard, junk, cipher->discard_len) == 0) fatal("evp_crypt: EVP_Cipher failed during discard"); - memset(discard, 0, cipher->discard_len); + explicit_bzero(discard, cipher->discard_len); free(junk); free(discard); } @@ -429,7 +427,7 @@ void cipher_cleanup(CipherContext *cc) { if ((cc->cipher->flags & CFLAG_CHACHAPOLY) != 0) - memset(&cc->cp_ctx, 0, sizeof(cc->cp_ctx)); + explicit_bzero(&cc->cp_ctx, sizeof(cc->cp_ctx)); else if (EVP_CIPHER_CTX_cleanup(&cc->evp) == 0) error("cipher_cleanup: EVP_CIPHER_CTX_cleanup failed"); } @@ -443,17 +441,15 @@ void cipher_set_key_string(CipherContext *cc, const Cipher *cipher, const char *passphrase, int do_encrypt) { - MD5_CTX md; u_char digest[16]; - MD5_Init(&md); - MD5_Update(&md, (const u_char *)passphrase, strlen(passphrase)); - MD5_Final(digest, &md); + if (ssh_digest_memory(SSH_DIGEST_MD5, passphrase, strlen(passphrase), + digest, sizeof(digest)) < 0) + fatal("%s: md5 failed", __func__); cipher_init(cc, cipher, digest, 16, NULL, 0, do_encrypt); - memset(digest, 0, sizeof(digest)); - memset(&md, 0, sizeof(md)); + explicit_bzero(digest, sizeof(digest)); } /* Modified: head/crypto/openssh/clientloop.c ============================================================================== --- head/crypto/openssh/clientloop.c Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/clientloop.c Tue Mar 25 11:05:34 2014 (r263712) @@ -1,4 +1,4 @@ -/* $OpenBSD: clientloop.c,v 1.256 2013/11/20 20:54:10 deraadt Exp $ */ +/* $OpenBSD: clientloop.c,v 1.258 2014/02/02 03:44:31 djm Exp $ */ /* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -551,7 +551,7 @@ client_global_request_reply(int type, u_ gc->cb(type, seq, gc->ctx); if (--gc->ref_count <= 0) { TAILQ_REMOVE(&global_confirms, gc, entry); - bzero(gc, sizeof(*gc)); + explicit_bzero(gc, sizeof(*gc)); free(gc); } @@ -878,7 +878,7 @@ process_cmdline(void) int cancel_port, ok; Forward fwd; - bzero(&fwd, sizeof(fwd)); + memset(&fwd, 0, sizeof(fwd)); fwd.listen_host = fwd.connect_host = NULL; leave_raw_mode(options.request_tty == REQUEST_TTY_FORCE); @@ -1763,7 +1763,7 @@ client_input_stdout_data(int type, u_int char *data = packet_get_string(&data_len); packet_check_eom(); buffer_append(&stdout_buffer, data, data_len); - memset(data, 0, data_len); + explicit_bzero(data, data_len); free(data); } static void @@ -1773,7 +1773,7 @@ client_input_stderr_data(int type, u_int char *data = packet_get_string(&data_len); packet_check_eom(); buffer_append(&stderr_buffer, data, data_len); - memset(data, 0, data_len); + explicit_bzero(data, data_len); free(data); } static void Modified: head/crypto/openssh/config.h ============================================================================== --- head/crypto/openssh/config.h Tue Mar 25 08:31:47 2014 (r263711) +++ head/crypto/openssh/config.h Tue Mar 25 11:05:34 2014 (r263712) @@ -415,6 +415,9 @@ /* Define to 1 if you have the `EVP_MD_CTX_cleanup' function. */ #define HAVE_EVP_MD_CTX_CLEANUP 1 +/* Define to 1 if you have the `EVP_MD_CTX_copy_ex' function. */ +#define HAVE_EVP_MD_CTX_COPY_EX 1 + /* Define to 1 if you have the `EVP_MD_CTX_init' function. */ #define HAVE_EVP_MD_CTX_INIT 1 @@ -424,6 +427,9 @@ /* Define if you have ut_exit in utmp.h */ /* #undef HAVE_EXIT_IN_UTMP */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 14:03:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3DE1EAC for ; Tue, 25 Mar 2014 14:03:16 +0000 (UTC) Received: from mail-ob0-f181.google.com (mail-ob0-f181.google.com [209.85.214.181]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8EDCEF45 for ; Tue, 25 Mar 2014 14:03:16 +0000 (UTC) Received: by mail-ob0-f181.google.com with SMTP id wp4so596060obc.12 for ; Tue, 25 Mar 2014 07:03:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=T94UrMpUxnPhFiQr2B+0LAxP53UJV7hsH5CSClDOW0s=; b=DzUokKshTBjgjdXflF+fdx4O87zRAkJGBUx4vTfMVlHBlpH2IUiMWmm+qtEbWlm6pI +u6rf0S7VRRsssx4gRId2VtWSFHlBGMWH85Icv3vovGiFSwOpWmY2veKm+i01vL7uPOh ouW/9K86eArtbiBLL5eG9aYhyVKI2eIZwUyWHUIBqj2wQFCGI2lP8Cn6dxZxp0OKheu/ zcr66Nhyc7mU5BDSExo+DpnX5v5BLBJ4cMywoXCAJvmasJv2YNJzFH9E1Ij0N45w4jlC VKZdXnNIciQO/PteH0g2LYtrUPj7GyHL5V4H5iVSDGFm0//Dc9297HSZiFHzlFcxy6lo XYEA== X-Gm-Message-State: ALoCoQl8w67MdrBZx+Y7+5wRZNaagyC/yu0dzg3hk9HOH9AnL09mLzLvnEgw+b6dpPq2UeFLJWZ4 X-Received: by 10.60.33.229 with SMTP id u5mr748299oei.85.1395756195681; Tue, 25 Mar 2014 07:03:15 -0700 (PDT) Received: from netflix-mac.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id ii8sm30538479obb.11.2014.03.25.07.03.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Mar 2014 07:03:15 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263704 - head/sys/kern From: Warner Losh In-Reply-To: <201403250328.s2P3Swsl054558@svn.freebsd.org> Date: Tue, 25 Mar 2014 08:03:13 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201403250328.s2P3Swsl054558@svn.freebsd.org> To: Mateusz Guzik X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 14:03:16 -0000 On Mar 24, 2014, at 9:28 PM, Mateusz Guzik wrote: > Author: mjg > Date: Tue Mar 25 03:28:58 2014 > New Revision: 263704 > URL: http://svnweb.freebsd.org/changeset/base/263704 >=20 > Log: > Make /dev/devctl mpsafe. >=20 > MFC after: 1 week >=20 > Modified: > head/sys/kern/subr_bus.c >=20 > Modified: head/sys/kern/subr_bus.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/kern/subr_bus.c Tue Mar 25 03:25:30 2014 = (r263703) > +++ head/sys/kern/subr_bus.c Tue Mar 25 03:28:58 2014 = (r263704) > @@ -358,15 +358,16 @@ device_sysctl_fini(device_t dev) > /* Deprecated way to adjust queue length */ > static int sysctl_devctl_disable(SYSCTL_HANDLER_ARGS); > /* XXX Need to support old-style tunable hw.bus.devctl_disable" */ > -SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | = CTLFLAG_RW, NULL, > - 0, sysctl_devctl_disable, "I", "devctl disable -- deprecated"); > +SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | = CTLFLAG_RW | > + CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_disable, "I", > + "devctl disable -- deprecated=94); This can likely be deleted now... > #define DEVCTL_DEFAULT_QUEUE_LEN 1000 > static int sysctl_devctl_queue(SYSCTL_HANDLER_ARGS); > static int devctl_queue_length =3D DEVCTL_DEFAULT_QUEUE_LEN; > TUNABLE_INT("hw.bus.devctl_queue", &devctl_queue_length); > -SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_queue, CTLTYPE_INT | = CTLFLAG_RW, NULL, > - 0, sysctl_devctl_queue, "I", "devctl queue length"); > +SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_queue, CTLTYPE_INT | CTLFLAG_RW = | > + CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_queue, "I", "devctl queue = length"); >=20 > static d_open_t devopen; > static d_close_t devclose; > @@ -376,7 +377,6 @@ static d_poll_t devpoll; >=20 > static struct cdevsw dev_cdevsw =3D { > .d_version =3D D_VERSION, > - .d_flags =3D D_NEEDGIANT, > .d_open =3D devopen, > .d_close =3D devclose, > .d_read =3D devread, > @@ -420,23 +420,31 @@ devinit(void) > static int > devopen(struct cdev *dev, int oflags, int devtype, struct thread *td) > { > + > if (devsoftc.inuse) > return (EBUSY); Why not delete these two lines? Since this isn=92t a performance = critical part of the code, it is clearer and safer to just test inuse inside the locked section. > + mtx_lock(&devsoftc.mtx); > + if (devsoftc.inuse) { > + mtx_unlock(&devsoftc.mtx); > + return (EBUSY); > + } > /* move to init */ > devsoftc.inuse =3D 1; > devsoftc.nonblock =3D 0; > devsoftc.async_proc =3D NULL; > + mtx_unlock(&devsoftc.mtx); > return (0); > } >=20 > static int > devclose(struct cdev *dev, int fflag, int devtype, struct thread *td) > { > - devsoftc.inuse =3D 0; > + > mtx_lock(&devsoftc.mtx); > + devsoftc.inuse =3D 0; > + devsoftc.async_proc =3D NULL; > cv_broadcast(&devsoftc.cv); > mtx_unlock(&devsoftc.mtx); > - devsoftc.async_proc =3D NULL; > return (0); > } From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 15:03:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3248FF8; Tue, 25 Mar 2014 15:03:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 12BC28A3; Tue, 25 Mar 2014 15:03:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2PF38FY043601; Tue, 25 Mar 2014 15:03:08 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PF38BE043599; Tue, 25 Mar 2014 15:03:08 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201403251503.s2PF38BE043599@svn.freebsd.org> From: Alan Somers Date: Tue, 25 Mar 2014 15:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263738 - head/tests/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 15:03:09 -0000 Author: asomers Date: Tue Mar 25 15:03:08 2014 New Revision: 263738 URL: http://svnweb.freebsd.org/changeset/base/263738 Log: tests/sys/netinet/Makefile tests/sys/netinet/fibs.sh Replace fibs:udp_dontroute with fibs:src_addr_selection_by_subnet. The original test was poorly written; it was actually testing kern/167947 instead of the desired kern/187553. The root cause of the bug is that ifa_ifwithnet did not have a fib argument. The new test more directly targets that behavior. tests/sys/netinet/udp_dontroute.c Delete the auxilliary binary used by the old test PR: kern/187553 MFC after: 3 weeks Sponsored by: Spectra Logic Corporation Deleted: head/tests/sys/netinet/udp_dontroute.c Modified: head/tests/sys/netinet/Makefile head/tests/sys/netinet/fibs_test.sh Modified: head/tests/sys/netinet/Makefile ============================================================================== --- head/tests/sys/netinet/Makefile Tue Mar 25 13:41:55 2014 (r263737) +++ head/tests/sys/netinet/Makefile Tue Mar 25 15:03:08 2014 (r263738) @@ -1,12 +1,7 @@ # $FreeBSD$ TESTSDIR= ${TESTSBASE}/sys/netinet -BINDIR= ${TESTSDIR} ATF_TESTS_SH+= fibs_test -PROG= udp_dontroute -SRCS= udp_dontroute.c -NO_MAN= -WARNS?= 6 .include Modified: head/tests/sys/netinet/fibs_test.sh ============================================================================== --- head/tests/sys/netinet/fibs_test.sh Tue Mar 25 13:41:55 2014 (r263737) +++ head/tests/sys/netinet/fibs_test.sh Tue Mar 25 15:03:08 2014 (r263738) @@ -255,45 +255,66 @@ subnet_route_with_multiple_fibs_on_same_ cleanup_tap } -# Test that source address selection works correctly for UDP packets with -# SO_DONTROUTE set that are sent on non-default FIBs. +# Regression test for kern/187553 "Source address selection for UDP packets +# with SO_DONTROUTE uses the default FIB". The original complaint was that a +# UDP packet with SO_DONTROUTE set would select a source address from an +# interface on the default FIB instead of the process FIB. # This bug was discovered with "setfib 1 netperf -t UDP_STREAM -H some_host" # Regression test for kern/187553 -atf_test_case udp_dontroute cleanup -udp_dontroute_head() + +# The root cause was that ifa_ifwithnet() did not have a fib argument. It +# would return an address from an interface on any FIB that had a subnet route +# for the destination. If more than one were available, it would choose the +# most specific. The root cause is most easily tested by creating two +# interfaces with overlapping subnet routes, adding a default route to the +# interface with the less specific subnet route, and looking up a host that +# requires the default route using the FIB of the interface with the less +# specific subnet route. "route get" should provide a route that uses the +# interface on the chosen FIB. However, absent the patch for this bug it will +# instead use the other interface. +atf_test_case src_addr_selection_by_subnet cleanup +src_addr_selection_by_subnet_head() { atf_set "descr" "Source address selection for UDP packets with SO_DONTROUTE on non-default FIBs works" atf_set "require.user" "root" atf_set "require.config" "fibs" } -udp_dontroute_body() +src_addr_selection_by_subnet_body() { atf_expect_fail "kern/187553 Source address selection for UDP packets with SO_DONTROUTE uses the default FIB" # Configure the TAP interface to use an RFC5737 nonrouteable address # and a non-default fib - ADDR="192.0.2.2" + ADDR0="192.0.2.2" + ADDR1="192.0.2.3" + GATEWAY0="192.0.2.1" + TARGET="192.0.2.128" SUBNET="192.0.2.0" - MASK="24" - # Use a different IP on the same subnet as the target - TARGET="192.0.2.100" + MASK0="25" + MASK1="26" # Check system configuration if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then atf_skip "This test requires net.add_addr_allfibs=0" fi - get_fibs 1 + get_fibs 2 # Configure a TAP interface - setup_tap ${FIB0} ${ADDR} ${MASK} + setup_tap ${FIB0} ${ADDR0} ${MASK0} + TAP0=${TAP} + setup_tap ${FIB1} ${ADDR1} ${MASK1} + TAP1=${TAP} + + # Add a gateway to the interface with the less specific subnet route + setfib ${FIB0} route add default ${GATEWAY0} - # Send a UDP packet with SO_DONTROUTE. In the failure case, it will - # return ENETUNREACH - SRCDIR=`atf_get_srcdir` - atf_check -o ignore setfib ${FIB0} ${SRCDIR}/udp_dontroute ${TARGET} + # Lookup a route + echo "Looking up route to ${TARGET} with fib ${FIB0}" + echo "Expected behavior is to use interface ${TAP0}" + atf_check -o match:"interface:.${TAP0}" setfib ${FIB0} route -n get ${TARGET} } -udp_dontroute_cleanup() +src_addr_selection_by_subnet_cleanup() { cleanup_tap } @@ -305,7 +326,7 @@ atf_init_test_cases() atf_add_test_case loopback_and_network_routes_on_nondefault_fib atf_add_test_case default_route_with_multiple_fibs_on_same_subnet atf_add_test_case subnet_route_with_multiple_fibs_on_same_subnet - atf_add_test_case udp_dontroute + atf_add_test_case src_addr_selection_by_subnet } # Looks up one or more fibs from the configuration data and validates them. From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 15:08:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65CD1216; Tue, 25 Mar 2014 15:08:35 +0000 (UTC) Received: from mail-vc0-x22b.google.com (mail-vc0-x22b.google.com [IPv6:2607:f8b0:400c:c03::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E2427957; Tue, 25 Mar 2014 15:08:34 +0000 (UTC) Received: by mail-vc0-f171.google.com with SMTP id lg15so728244vcb.30 for ; Tue, 25 Mar 2014 08:08:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=QoTDEutoLcmAeVzu+p64z2cGCrBL6Nk1+P1e3wV0PNY=; b=CacMJaTBPhY8wjEPe7QKuPZ/5f6pFbpyRijHkoTch8Zg3m5Bn9jq2ZKSwERxfXhwbe FlXNZB7EQnaT59yd9Fp/I/CowvBesHOz2n8YK0jE5x/nXTtGorr7jt9A1hj15Wr1UXQK 9ZPnpHN6XGIYwKgHgMNPZ2G8x4kqW6UEUKCWF+4nznaJcIFg1fQtIpvoHPfj1bCB7JIy gg3hzAZAPc+rDXGd5qwOnOgqfMV5W2Mbd/QkeajlKRe+x9qsjbf/1uX+jRhN0qmdwM1H Bg/dMYHqhHNzLGVH8TCeH1q8iV8TAC64QjBaK2e2SG/8CTIBQmGjhm+J5OdhHFhT/AHY SQJw== MIME-Version: 1.0 X-Received: by 10.52.8.225 with SMTP id u1mr17603vda.64.1395760114063; Tue, 25 Mar 2014 08:08:34 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.58.231.105 with HTTP; Tue, 25 Mar 2014 08:08:34 -0700 (PDT) In-Reply-To: <201310190959.r9J9xBI1036988@svn.freebsd.org> References: <201310190959.r9J9xBI1036988@svn.freebsd.org> Date: Tue, 25 Mar 2014 09:08:34 -0600 X-Google-Sender-Auth: fFfV77nkg4q3W9JoKDoB-JLuc4I Message-ID: Subject: Re: svn commit: r256768 - head/sbin/ifconfig From: Alan Somers To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 15:08:35 -0000 On Sat, Oct 19, 2013 at 3:59 AM, Dag-Erling Sm=F8rgrav wr= ote: > Author: des > Date: Sat Oct 19 09:59:11 2013 > New Revision: 256768 > URL: http://svnweb.freebsd.org/changeset/base/256768 > > Log: > Do not error out when adding an interface to a group to which it > already belongs or removing it from a group to which it does not > belong. This makes it possible to include group memberships in > ifconfig_foo0 in rc.conf without fear of breaking "service netif > restart foo0". > > MFC after: 3 days > > Modified: > head/sbin/ifconfig/ifgroup.c > > Modified: head/sbin/ifconfig/ifgroup.c Is there any reason why this can't be MFCed to stable/9 ? -Alan From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 15:25:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 205A69C1; Tue, 25 Mar 2014 15:25:23 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id D35DAB40; Tue, 25 Mar 2014 15:25:22 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 343DC6190; Tue, 25 Mar 2014 15:25:21 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 96BE71A2; Tue, 25 Mar 2014 16:25:20 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Julio Merino Subject: Re: svn commit: r263346 - in head: etc/mtree tools/build/mk tools/regression/usr.bin/make usr.bin/make usr.bin/make/tests usr.bin/make/tests/archives/fmt_44bsd usr.bin/make/tests/archives/fmt_44bsd_mod... References: <201403191229.s2JCTLDp024608@svn.freebsd.org> Date: Tue, 25 Mar 2014 16:25:20 +0100 In-Reply-To: <201403191229.s2JCTLDp024608@svn.freebsd.org> (Julio Merino's message of "Wed, 19 Mar 2014 12:29:21 +0000 (UTC)") Message-ID: <864n2mxpun.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 15:25:23 -0000 Julio Merino writes: > Log: > Migrate tools/regression/usr.bin/make/ to the new tests layout. >=20=20=20 > Note that these tests are for fmake, not bmake, and thus they are not > installed nor run when bmake is selected (the default). Yes, I have > wasted a *ton* of time on moving tests for no real reason other than > ensuring they are not left behind. >=20=20=20 > But maybe, just maybe, it was not work in vain: the majority of these > tests also work with bmake and the few that don't may point at broken > stuff. For example, the tests for the "archive" feature do not work > with bmake, but bmake's manpage and source tree seem to imply that they > should. So... to be investigated later; need to poke sjg@. This, or a subsequent but related commit, broke the WITHOUT_BMAKE build: TB --- 2014-03-25 15:10:28 - tinderbox 2.20 running on worker02.tb.des.no TB --- 2014-03-25 15:10:28 - FreeBSD worker02.tb.des.no 9.1-RELEASE-p4 Free= BSD 9.1-RELEASE-p4 #0: Mon Jun 17 11:42:37 UTC 2013 root@amd64-builder.= daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 TB --- 2014-03-25 15:10:28 - starting HEAD tinderbox run for amd64/amd64 TB --- 2014-03-25 15:10:28 - cleaning the object tree TB --- 2014-03-25 15:10:28 - /usr/local/bin/svn stat --no-ignore /src TB --- 2014-03-25 15:10:47 - At svn revision 263738 TB --- 2014-03-25 15:10:48 - building world TB --- 2014-03-25 15:10:48 - CROSS_BUILD_TESTING=3DYES TB --- 2014-03-25 15:10:48 - MAKEOBJDIRPREFIX=3D/obj TB --- 2014-03-25 15:10:48 - PATH=3D/usr/bin:/usr/sbin:/bin:/sbin TB --- 2014-03-25 15:10:48 - SRCCONF=3D/dev/null TB --- 2014-03-25 15:10:48 - TARGET=3Damd64 TB --- 2014-03-25 15:10:48 - TARGET_ARCH=3Damd64 TB --- 2014-03-25 15:10:48 - TZ=3DUTC TB --- 2014-03-25 15:10:48 - WITHOUT_BMAKE=3DYES TB --- 2014-03-25 15:10:48 - __MAKE_CONF=3D/dev/null TB --- 2014-03-25 15:10:48 - cd /src TB --- 2014-03-25 15:10:48 - /usr/bin/make -B buildworld >>> Building an up-to-date make(1) -------------------------------------------------------------- "Makefile", line 121: Malformed conditional (${MK_TESTS} !=3D "no") "Makefile", line 123: if-less endif make: fatal errors encountered -- cannot continue *** [make] Error code 1 Stop in /src. *** [upgrade_checks] Error code 1 Stop in /src. TB --- 2014-03-25 15:10:48 - WARNING: /usr/bin/make returned exit code 1=20 TB --- 2014-03-25 15:10:48 - ERROR: failed to build world TB --- 2014-03-25 15:10:48 - 2.07 user 16.82 system 20.05 real tinderbox returned exit code 1 DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 15:32:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED06ED57; Tue, 25 Mar 2014 15:32:25 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id AACCBC2D; Tue, 25 Mar 2014 15:32:25 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 728B061DE; Tue, 25 Mar 2014 15:32:24 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 492101B4; Tue, 25 Mar 2014 16:32:23 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Alan Somers Subject: Re: svn commit: r256768 - head/sbin/ifconfig References: <201310190959.r9J9xBI1036988@svn.freebsd.org> Date: Tue, 25 Mar 2014 16:32:23 +0100 In-Reply-To: (Alan Somers's message of "Tue, 25 Mar 2014 09:08:34 -0600") Message-ID: <86vbv2wayg.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 15:32:26 -0000 Alan Somers writes: > Is there any reason why this can't be MFCed to stable/9 ? I thought I had, but apparently I only did stable/10. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 18:30:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA4882D8; Tue, 25 Mar 2014 18:30:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8ABE22B9; Tue, 25 Mar 2014 18:30:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2PIUwWT029797; Tue, 25 Mar 2014 18:30:58 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PIUvIu029793; Tue, 25 Mar 2014 18:30:57 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251830.s2PIUvIu029793@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 18:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263740 - in head/sys: cam/ctl dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 18:30:58 -0000 Author: trasz Date: Tue Mar 25 18:30:57 2014 New Revision: 263740 URL: http://svnweb.freebsd.org/changeset/base/263740 Log: Use a less unusual syntax in debug printfs. Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/dev/iscsi/icl.c head/sys/dev/iscsi/iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Mar 25 15:35:33 2014 (r263739) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Mar 25 18:30:57 2014 (r263740) @@ -98,29 +98,38 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO &maxcmdsn_delta, 256, "Number of commands the initiator can send " "without confirmation"); -#define CFISCSI_DEBUG(X, ...) \ - if (debug > 1) { \ - printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ +#define CFISCSI_DEBUG(X, ...) \ + do { \ + if (debug > 1) { \ + printf("%s: " X "\n", \ + __func__, ## __VA_ARGS__); \ + } \ } while (0) -#define CFISCSI_WARN(X, ...) \ - if (debug > 0) { \ - printf("WARNING: %s: " X "\n", \ - __func__, ## __VA_ARGS__); \ +#define CFISCSI_WARN(X, ...) \ + do { \ + if (debug > 0) { \ + printf("WARNING: %s: " X "\n", \ + __func__, ## __VA_ARGS__); \ + } \ } while (0) -#define CFISCSI_SESSION_DEBUG(S, X, ...) \ - if (debug > 1) { \ - printf("%s: %s (%s): " X "\n", \ - __func__, S->cs_initiator_addr, \ - S->cs_initiator_name, ## __VA_ARGS__); \ +#define CFISCSI_SESSION_DEBUG(S, X, ...) \ + do { \ + if (debug > 1) { \ + printf("%s: %s (%s): " X "\n", \ + __func__, S->cs_initiator_addr, \ + S->cs_initiator_name, ## __VA_ARGS__); \ + } \ } while (0) -#define CFISCSI_SESSION_WARN(S, X, ...) \ - if (debug > 0) { \ - printf("WARNING: %s (%s): " X "\n", \ - S->cs_initiator_addr, \ - S->cs_initiator_name, ## __VA_ARGS__); \ +#define CFISCSI_SESSION_WARN(S, X, ...) \ + do { \ + if (debug > 0) { \ + printf("WARNING: %s (%s): " X "\n", \ + S->cs_initiator_addr, \ + S->cs_initiator_name, ## __VA_ARGS__); \ + } \ } while (0) #define CFISCSI_SESSION_LOCK(X) mtx_lock(&X->cs_lock) Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Tue Mar 25 15:35:33 2014 (r263739) +++ head/sys/dev/iscsi/icl.c Tue Mar 25 18:30:57 2014 (r263740) @@ -74,15 +74,18 @@ static uma_zone_t icl_pdu_zone; static volatile u_int icl_ncons; -#define ICL_DEBUG(X, ...) \ - if (debug > 1) { \ - printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ +#define ICL_DEBUG(X, ...) \ + do { \ + if (debug > 1) \ + printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ } while (0) -#define ICL_WARN(X, ...) \ - if (debug > 0) { \ - printf("WARNING: %s: " X "\n", \ - __func__, ## __VA_ARGS__); \ +#define ICL_WARN(X, ...) \ + do { \ + if (debug > 0) { \ + printf("WARNING: %s: " X "\n", \ + __func__, ## __VA_ARGS__); \ + } \ } while (0) #define ICL_CONN_LOCK(X) mtx_lock(&X->ic_lock) Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Tue Mar 25 15:35:33 2014 (r263739) +++ head/sys/dev/iscsi/iscsi.c Tue Mar 25 18:30:57 2014 (r263740) @@ -99,29 +99,36 @@ static uma_zone_t iscsi_outstanding_zone #define CONN_SESSION(X) ((struct iscsi_session *)X->ic_prv0) #define PDU_SESSION(X) (CONN_SESSION(X->ip_conn)) -#define ISCSI_DEBUG(X, ...) \ - if (debug > 1) { \ - printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ +#define ISCSI_DEBUG(X, ...) \ + do { \ + if (debug > 1) \ + printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ } while (0) -#define ISCSI_WARN(X, ...) \ - if (debug > 0) { \ - printf("WARNING: %s: " X "\n", \ - __func__, ## __VA_ARGS__); \ +#define ISCSI_WARN(X, ...) \ + do { \ + if (debug > 0) { \ + printf("WARNING: %s: " X "\n", \ + __func__, ## __VA_ARGS__); \ + } \ } while (0) -#define ISCSI_SESSION_DEBUG(S, X, ...) \ - if (debug > 1) { \ - printf("%s: %s (%s): " X "\n", \ - __func__, S->is_conf.isc_target_addr, \ - S->is_conf.isc_target, ## __VA_ARGS__); \ +#define ISCSI_SESSION_DEBUG(S, X, ...) \ + do { \ + if (debug > 1) { \ + printf("%s: %s (%s): " X "\n", \ + __func__, S->is_conf.isc_target_addr, \ + S->is_conf.isc_target, ## __VA_ARGS__); \ + } \ } while (0) -#define ISCSI_SESSION_WARN(S, X, ...) \ - if (debug > 0) { \ - printf("WARNING: %s (%s): " X "\n", \ - S->is_conf.isc_target_addr, \ - S->is_conf.isc_target, ## __VA_ARGS__); \ +#define ISCSI_SESSION_WARN(S, X, ...) \ + do { \ + if (debug > 0) { \ + printf("WARNING: %s (%s): " X "\n", \ + S->is_conf.isc_target_addr, \ + S->is_conf.isc_target, ## __VA_ARGS__); \ + } \ } while (0) #define ISCSI_SESSION_LOCK(X) mtx_lock(&X->is_lock) From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 18:39:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC6F3560; Tue, 25 Mar 2014 18:39:39 +0000 (UTC) Received: from mail-qg0-x22f.google.com (mail-qg0-x22f.google.com [IPv6:2607:f8b0:400d:c04::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3ADB4333; Tue, 25 Mar 2014 18:39:39 +0000 (UTC) Received: by mail-qg0-f47.google.com with SMTP id 63so2202364qgz.6 for ; Tue, 25 Mar 2014 11:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=A5DHIJgfLPINbbRrYdHlzkbhE3KtDuXAqwQdbSTNwrU=; b=w04ISIGQX2HjUeB5G3XS/FGFi9CBsKZCrvgJG0XkAZyx5oD+6KIKpiRvxOBPvnfDMd ey8IdBhKm3ZOuwbcSpffJSMwyklEv/2t5NhEPYJeqesi8lXaeR4uFDhOcnNvtQqG0hto 3tM+hpvMzwBjQW/GY6pOS/OYE5UHNR2NG9w4YXkymV4Cfe5s5wENRXeaFJSW75rMzNP0 LsgScp4Lvq2VfCGsHJwuBYUWMZtPjelvRyZH1CMoWZFffs+KaqFXyZgSWzRUblWzY00E /4M45wrX/Sq3f7o/TatB3Qp6m0+cw0npOB4YrcQdH7kld7AQVQ3odzA5c9RgCy+uvYLS R4pw== MIME-Version: 1.0 X-Received: by 10.140.86.36 with SMTP id o33mr73809607qgd.67.1395772778454; Tue, 25 Mar 2014 11:39:38 -0700 (PDT) Received: by 10.140.37.227 with HTTP; Tue, 25 Mar 2014 11:39:38 -0700 (PDT) In-Reply-To: <20140325090625.GA93175@FreeBSD.org> References: <201402010203.s1123pjF019150@svn.freebsd.org> <20140324054442.GA98485@FreeBSD.org> <20140323225818.58f41de3@zhabar.att.net> <20140325090625.GA93175@FreeBSD.org> Date: Tue, 25 Mar 2014 11:39:38 -0700 Message-ID: Subject: Re: svn commit: r261342 - in head: lib/libpmc sys/conf sys/dev/hwpmc sys/powerpc/include sys/sys From: Justin Hibbits To: Alexey Dokuchaev Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 18:39:39 -0000 On Tue, Mar 25, 2014 at 2:06 AM, Alexey Dokuchaev wrote: > On Sun, Mar 23, 2014 at 10:58:18PM -0700, Justin Hibbits wrote: >> On Mon, 24 Mar 2014 05:44:42 +0000 Alexey Dokuchaev wrote: >> > Hmm, -CURRENT does not build for me after this commit apparently; >> > take a look at the log excerpt. Could it be that r261342 relies on >> > some earlier revision which I'm missing (that is, my r260369'ish >> > -CURRENT is too old)? What's the best way to catch up? Thanks, >> >> It looks to me like it's picking up your old PMC header files. Did you >> try doing a full buildworld (without a -DNO_CLEAN)? I've built world >> multiple times since and it works just fine for me. > > It turned out to be ccache's fault. Once I've resumed the build with > -DNO_CLEAN -DNO_CCACHE, it finished just fine. > > ./danfe Good to hear. I've never used ccache myself. - Justin From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 19:05:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 962FAE64; Tue, 25 Mar 2014 19:05:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6955983D; Tue, 25 Mar 2014 19:05:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2PJ56Hm043059; Tue, 25 Mar 2014 19:05:06 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PJ56il043058; Tue, 25 Mar 2014 19:05:06 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251905.s2PJ56il043058@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 19:05:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263741 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 19:05:06 -0000 Author: trasz Date: Tue Mar 25 19:05:05 2014 New Revision: 263741 URL: http://svnweb.freebsd.org/changeset/base/263741 Log: Use newly added extended LUN support in CAM. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Tue Mar 25 18:30:57 2014 (r263740) +++ head/sys/dev/iscsi/iscsi.c Tue Mar 25 19:05:05 2014 (r263741) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -1817,40 +1818,6 @@ iscsi_ioctl(struct cdev *dev, u_long cmd } } -static uint64_t -iscsi_encode_lun(uint32_t lun) -{ - uint8_t encoded[8]; - uint64_t result; - - memset(encoded, 0, sizeof(encoded)); - - if (lun < 256) { - /* - * Peripheral device addressing. - */ - encoded[1] = lun; - } else if (lun < 16384) { - /* - * Flat space addressing. - */ - encoded[0] = 0x40; - encoded[0] |= (lun >> 8) & 0x3f; - encoded[1] = lun & 0xff; - } else { - /* - * Extended flat space addressing. - */ - encoded[0] = 0xd2; - encoded[1] = lun >> 16; - encoded[2] = lun >> 8; - encoded[3] = lun; - } - - memcpy(&result, encoded, sizeof(result)); - return (result); -} - static struct iscsi_outstanding * iscsi_outstanding_find(struct iscsi_session *is, uint32_t initiator_task_tag) { @@ -1965,7 +1932,7 @@ iscsi_action_scsiio(struct iscsi_session break; } - bhssc->bhssc_lun = iscsi_encode_lun(csio->ccb_h.target_lun); + bhssc->bhssc_lun = htobe64(CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun)); bhssc->bhssc_initiator_task_tag = is->is_initiator_task_tag; is->is_initiator_task_tag++; bhssc->bhssc_expected_data_transfer_length = htonl(csio->dxfer_len); @@ -2037,13 +2004,11 @@ iscsi_action(struct cam_sim *sim, union cpi->version_num = 1; cpi->hba_inquiry = PI_TAG_ABLE; cpi->target_sprt = 0; - //cpi->hba_misc = PIM_NOBUSRESET; - cpi->hba_misc = 0; + cpi->hba_misc = PIM_EXTLUNS; cpi->hba_eng_cnt = 0; cpi->max_target = 0; - cpi->max_lun = 255; - //cpi->initiator_id = 0; /* XXX */ - cpi->initiator_id = 64; /* XXX */ + cpi->max_lun = 0; + cpi->initiator_id = ~0; strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strlcpy(cpi->hba_vid, "iSCSI", HBA_IDLEN); strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 19:09:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF1D86E; Tue, 25 Mar 2014 19:09:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC54E87B; Tue, 25 Mar 2014 19:09:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2PJ9qf8043556; Tue, 25 Mar 2014 19:09:52 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PJ9q5c043555; Tue, 25 Mar 2014 19:09:52 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251909.s2PJ9q5c043555@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 19:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263742 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 19:09:52 -0000 Author: trasz Date: Tue Mar 25 19:09:52 2014 New Revision: 263742 URL: http://svnweb.freebsd.org/changeset/base/263742 Log: Fix harmless warning after reconnecting a session and not doing anything with it. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Tue Mar 25 19:05:05 2014 (r263741) +++ head/sys/dev/iscsi/iscsi.c Tue Mar 25 19:09:52 2014 (r263742) @@ -1288,8 +1288,8 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ is->is_conn->ic_data_crc32c = false; is->is_cmdsn = 0; - is->is_expcmdsn = 1; - is->is_maxcmdsn = 1; + is->is_expcmdsn = 0; + is->is_maxcmdsn = 0; is->is_waiting_for_iscsid = false; is->is_login_phase = false; is->is_timeout = 0; From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 19:17:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E8EB30F; Tue, 25 Mar 2014 19:17:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D61B094C; Tue, 25 Mar 2014 19:17:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2PJHMGp047380; Tue, 25 Mar 2014 19:17:22 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PJHMB6047378; Tue, 25 Mar 2014 19:17:22 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251917.s2PJHMB6047378@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 19:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263743 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 19:17:23 -0000 Author: trasz Date: Tue Mar 25 19:17:22 2014 New Revision: 263743 URL: http://svnweb.freebsd.org/changeset/base/263743 Log: Move the ic_outstanding_count under #ifdef DIAGNOSTIC. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.c head/sys/dev/iscsi/icl.h Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Tue Mar 25 19:09:52 2014 (r263742) +++ head/sys/dev/iscsi/icl.c Tue Mar 25 19:17:22 2014 (r263743) @@ -138,11 +138,15 @@ icl_pdu_new(struct icl_conn *ic, int fla { struct icl_pdu *ip; +#ifdef DIAGNOSTIC refcount_acquire(&ic->ic_outstanding_pdus); +#endif ip = uma_zalloc(icl_pdu_zone, flags | M_ZERO); if (ip == NULL) { ICL_WARN("failed to allocate %zd bytes", sizeof(*ip)); +#ifdef DIAGNOSTIC refcount_release(&ic->ic_outstanding_pdus); +#endif return (NULL); } @@ -162,7 +166,9 @@ icl_pdu_free(struct icl_pdu *ip) m_freem(ip->ip_ahs_mbuf); m_freem(ip->ip_data_mbuf); uma_zfree(icl_pdu_zone, ip); +#ifdef DIAGNOSTIC refcount_release(&ic->ic_outstanding_pdus); +#endif } /* @@ -980,7 +986,9 @@ icl_conn_new(void) mtx_init(&ic->ic_lock, "icl_lock", NULL, MTX_DEF); cv_init(&ic->ic_send_cv, "icl_tx"); cv_init(&ic->ic_receive_cv, "icl_rx"); +#ifdef DIAGNOSTIC refcount_init(&ic->ic_outstanding_pdus, 0); +#endif ic->ic_max_data_segment_length = ICL_MAX_DATA_SEGMENT_LENGTH; return (ic); Modified: head/sys/dev/iscsi/icl.h ============================================================================== --- head/sys/dev/iscsi/icl.h Tue Mar 25 19:09:52 2014 (r263742) +++ head/sys/dev/iscsi/icl.h Tue Mar 25 19:17:22 2014 (r263743) @@ -76,7 +76,9 @@ void icl_pdu_free(struct icl_pdu *ip); struct icl_conn { struct mtx ic_lock; struct socket *ic_socket; +#ifdef DIAGNOSTIC volatile u_int ic_outstanding_pdus; +#endif TAILQ_HEAD(, icl_pdu) ic_to_send; size_t ic_receive_len; int ic_receive_state; From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 19:20:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C5E1558E; Tue, 25 Mar 2014 19:20:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B17489D5; Tue, 25 Mar 2014 19:20:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2PJKZis047902; Tue, 25 Mar 2014 19:20:35 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PJKYnX047892; Tue, 25 Mar 2014 19:20:34 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201403251920.s2PJKYnX047892@svn.freebsd.org> From: Tycho Nightingale Date: Tue, 25 Mar 2014 19:20:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263744 - in head: sys/amd64/include sys/amd64/vmm sys/amd64/vmm/io sys/modules/vmm usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 19:20:35 -0000 Author: tychon Date: Tue Mar 25 19:20:34 2014 New Revision: 263744 URL: http://svnweb.freebsd.org/changeset/base/263744 Log: Move the atpit device model from userspace into vmm.ko for better precision and lower latency. Approved by: grehan (co-mentor) Added: head/sys/amd64/vmm/io/vatpit.c (contents, props changed) head/sys/amd64/vmm/io/vatpit.h (contents, props changed) Deleted: head/usr.sbin/bhyve/pit_8254.c head/usr.sbin/bhyve/pit_8254.h Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_ioport.c head/sys/modules/vmm/Makefile head/usr.sbin/bhyve/Makefile Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Tue Mar 25 19:17:22 2014 (r263743) +++ head/sys/amd64/include/vmm.h Tue Mar 25 19:20:34 2014 (r263744) @@ -191,6 +191,7 @@ struct vmspace *vm_get_vmspace(struct vm int vm_assign_pptdev(struct vm *vm, int bus, int slot, int func); int vm_unassign_pptdev(struct vm *vm, int bus, int slot, int func); struct vatpic *vm_atpic(struct vm *vm); +struct vatpit *vm_atpit(struct vm *vm); /* * Inject exception 'vme' into the guest vcpu. This function returns 0 on Added: head/sys/amd64/vmm/io/vatpit.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/vmm/io/vatpit.c Tue Mar 25 19:20:34 2014 (r263744) @@ -0,0 +1,370 @@ +/*- + * Copyright (c) 2014 Tycho Nightingale + * Copyright (c) 2011 NetApp, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "vmm_ktr.h" +#include "vatpic.h" +#include "vioapic.h" +#include "vatpit.h" + +static MALLOC_DEFINE(M_VATPIT, "atpit", "bhyve virtual atpit (8254)"); + +#define VATPIT_LOCK(vatpit) mtx_lock_spin(&((vatpit)->mtx)) +#define VATPIT_UNLOCK(vatpit) mtx_unlock_spin(&((vatpit)->mtx)) +#define VATPIT_LOCKED(vatpit) mtx_owned(&((vatpit)->mtx)) + +#define TIMER_SEL_MASK 0xc0 +#define TIMER_RW_MASK 0x30 +#define TIMER_MODE_MASK 0x0f +#define TIMER_SEL_READBACK 0xc0 + +#define PIT_8254_FREQ 1193182 +#define TIMER_DIV(freq, hz) (((freq) + (hz) / 2) / (hz)) + +struct vatpit_callout_arg { + struct vatpit *vatpit; + int channel_num; +}; + + +struct channel { + int mode; + uint16_t initial; /* initial counter value */ + sbintime_t now_sbt; /* uptime when counter was loaded */ + uint8_t cr[2]; + uint8_t ol[2]; + int crbyte; + int olbyte; + int frbyte; + struct callout callout; + sbintime_t callout_sbt; /* target time */ + struct vatpit_callout_arg callout_arg; +}; + +struct vatpit { + struct vm *vm; + struct mtx mtx; + + sbintime_t freq_sbt; + + struct channel channel[3]; +}; + +#define VATPIT_CTR0(vatpit, fmt) \ + VM_CTR0((vatpit)->vm, fmt) + +#define VATPIT_CTR1(vatpit, fmt, a1) \ + VM_CTR1((vatpit)->vm, fmt, a1) + +#define VATPIT_CTR2(vatpit, fmt, a1, a2) \ + VM_CTR2((vatpit)->vm, fmt, a1, a2) + +#define VATPIT_CTR3(vatpit, fmt, a1, a2, a3) \ + VM_CTR3((vatpit)->vm, fmt, a1, a2, a3) + +#define VATPIT_CTR4(vatpit, fmt, a1, a2, a3, a4) \ + VM_CTR4((vatpit)->vm, fmt, a1, a2, a3, a4) + +static void pit_timer_start_cntr0(struct vatpit *vatpit); + +static void +vatpit_callout_handler(void *a) +{ + struct vatpit_callout_arg *arg = a; + struct vatpit *vatpit; + struct callout *callout; + struct channel *c; + + vatpit = arg->vatpit; + c = &vatpit->channel[arg->channel_num]; + callout = &c->callout; + + VATPIT_CTR1(vatpit, "atpit t%d fired", arg->channel_num); + + VATPIT_LOCK(vatpit); + + if (callout_pending(callout)) /* callout was reset */ + goto done; + + if (!callout_active(callout)) /* callout was stopped */ + goto done; + + callout_deactivate(callout); + + if (c->mode == TIMER_RATEGEN) { + pit_timer_start_cntr0(vatpit); + } + + vatpic_pulse_irq(vatpit->vm, 0); + vioapic_pulse_irq(vatpit->vm, 2); + +done: + VATPIT_UNLOCK(vatpit); + return; +} + +static void +pit_timer_start_cntr0(struct vatpit *vatpit) +{ + struct channel *c; + sbintime_t delta, precision; + + c = &vatpit->channel[0]; + if (c->initial != 0) { + delta = c->initial * vatpit->freq_sbt; + precision = delta >> tc_precexp; + c->callout_sbt = c->callout_sbt + delta; + + callout_reset_sbt(&c->callout, c->callout_sbt, + precision, vatpit_callout_handler, &c->callout_arg, + C_ABSOLUTE); + } +} + +static uint16_t +pit_update_counter(struct vatpit *vatpit, struct channel *c, bool latch) +{ + uint16_t lval; + sbintime_t delta_ticks; + + /* cannot latch a new value until the old one has been consumed */ + if (latch && c->olbyte != 0) + return (0); + + if (c->initial == 0) { + /* + * This is possibly an o/s bug - reading the value of + * the timer without having set up the initial value. + * + * The original user-space version of this code set + * the timer to 100hz in this condition; do the same + * here. + */ + c->initial = TIMER_DIV(PIT_8254_FREQ, 100); + c->now_sbt = sbinuptime(); + } + + delta_ticks = (sbinuptime() - c->now_sbt) / vatpit->freq_sbt; + + lval = c->initial - delta_ticks % c->initial; + + if (latch) { + c->olbyte = 2; + c->ol[1] = lval; /* LSB */ + c->ol[0] = lval >> 8; /* MSB */ + } + + return (lval); +} + +static int +vatpit_update_mode(struct vatpit *vatpit, uint8_t val) +{ + struct channel *c; + int sel, rw, mode; + + sel = val & TIMER_SEL_MASK; + rw = val & TIMER_RW_MASK; + mode = val & TIMER_MODE_MASK; + + if (sel == TIMER_SEL_READBACK) + return (-1); + + if (rw != TIMER_LATCH && rw != TIMER_16BIT) + return (-1); + + if (rw != TIMER_LATCH) { + /* + * Counter mode is not affected when issuing a + * latch command. + */ + if (mode != TIMER_INTTC && + mode != TIMER_RATEGEN && + mode != TIMER_SQWAVE && + mode != TIMER_SWSTROBE) + return (-1); + } + + c = &vatpit->channel[sel >> 6]; + if (rw == TIMER_LATCH) + pit_update_counter(vatpit, c, true); + else { + c->mode = mode; + c->olbyte = 0; /* reset latch after reprogramming */ + } + + return (0); +} + +static int +vatpit_get_out(struct vatpit *vatpit, int channel) +{ + struct channel *c; + sbintime_t delta_ticks; + int out; + + c = &vatpit->channel[channel]; + + switch (c->mode) { + case TIMER_INTTC: + delta_ticks = (sbinuptime() - c->now_sbt) / vatpit->freq_sbt; + out = ((c->initial - delta_ticks) <= 0); + break; + default: + out = 0; + break; + } + + return (out); +} + +int +vatpit_handler(void *vm, int vcpuid, struct vm_exit *vmexit) +{ + struct vatpit *vatpit; + struct channel *c; + int port; + uint8_t val; + int error; + + vatpit = vm_atpit(vm); + + if (vmexit->u.inout.bytes != 1) + return (-1); + + val = vmexit->u.inout.eax; + port = vmexit->u.inout.port; + + if (port == TIMER_MODE) { + if (vmexit->u.inout.in != 0) { + VATPIT_CTR0(vatpit, "vatpit attempt to read mode"); + return (-1); + } + + VATPIT_LOCK(vatpit); + error = vatpit_update_mode(vatpit, val); + VATPIT_UNLOCK(vatpit); + + return (error); + } + + /* counter ports */ + KASSERT(port >= TIMER_CNTR0 && vmexit->u.inout.port <= TIMER_CNTR2, + ("invalid port 0x%x", port)); + c = &vatpit->channel[port - TIMER_CNTR0]; + + VATPIT_LOCK(vatpit); + if (vmexit->u.inout.in) { + /* + * The spec says that once the output latch is completely + * read it should revert to "following" the counter. Use + * the free running counter for this case (i.e. Linux + * TSC calibration). Assuming the access mode is 16-bit, + * toggle the MSB/LSB bit on each read. + */ + if (c->olbyte == 0) { + uint16_t tmp; + + tmp = pit_update_counter(vatpit, c, false); + if (c->frbyte) + tmp >>= 8; + tmp &= 0xff; + vmexit->u.inout.eax = tmp; + c->frbyte ^= 1; + } else + vmexit->u.inout.eax = c->ol[--c->olbyte]; + } else { + c->cr[c->crbyte++] = vmexit->u.inout.eax; + if (c->crbyte == 2) { + c->frbyte = 0; + c->crbyte = 0; + c->initial = c->cr[0] | (uint16_t)c->cr[1] << 8; + c->now_sbt = sbinuptime(); + /* Start an interval timer for channel 0 */ + if (port == TIMER_CNTR0) { + c->callout_sbt = c->now_sbt; + pit_timer_start_cntr0(vatpit); + } + if (c->initial == 0) + c->initial = 0xffff; + } + } + VATPIT_UNLOCK(vatpit); + + return (0); +} + +struct vatpit * +vatpit_init(struct vm *vm) +{ + struct vatpit *vatpit; + struct bintime bt; + struct vatpit_callout_arg *arg; + int i; + + vatpit = malloc(sizeof(struct vatpit), M_VATPIT, M_WAITOK | M_ZERO); + vatpit->vm = vm; + + mtx_init(&vatpit->mtx, "vatpit lock", NULL, MTX_SPIN); + + FREQ2BT(PIT_8254_FREQ, &bt); + vatpit->freq_sbt = bttosbt(bt); + + for (i = 0; i < 3; i++) { + callout_init(&vatpit->channel[i].callout, true); + arg = &vatpit->channel[i].callout_arg; + arg->vatpit = vatpit; + arg->channel_num = i; + } + + return (vatpit); +} + +void +vatpit_cleanup(struct vatpit *vatpit) +{ + int i; + + for (i = 0; i < 3; i++) + callout_drain(&vatpit->channel[i].callout); + + free(vatpit, M_VATPIT); +} Added: head/sys/amd64/vmm/io/vatpit.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/vmm/io/vatpit.h Tue Mar 25 19:20:34 2014 (r263744) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2014 Tycho Nightingale + * Copyright (c) 2011 NetApp, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _VATPIT_H_ +#define _VATPIT_H_ + +#include + +struct vatpit *vatpit_init(struct vm *vm); +void vatpit_cleanup(struct vatpit *vatpit); + +int vatpit_handler(void *vm, int vcpuid, struct vm_exit *vmexit); + +#endif /* _VATPIT_H_ */ Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Tue Mar 25 19:17:22 2014 (r263743) +++ head/sys/amd64/vmm/vmm.c Tue Mar 25 19:20:34 2014 (r263744) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include "vmm_mem.h" #include "vmm_util.h" #include "vatpic.h" +#include "vatpit.h" #include "vhpet.h" #include "vioapic.h" #include "vlapic.h" @@ -119,6 +120,7 @@ struct vm { struct vhpet *vhpet; /* virtual HPET */ struct vioapic *vioapic; /* virtual ioapic */ struct vatpic *vatpic; /* virtual atpic */ + struct vatpit *vatpit; /* virtual atpit */ struct vmspace *vmspace; /* guest's address space */ struct vcpu vcpu[VM_MAXCPU]; int num_mem_segs; @@ -349,6 +351,7 @@ vm_create(const char *name, struct vm ** vm->vioapic = vioapic_init(vm); vm->vhpet = vhpet_init(vm); vm->vatpic = vatpic_init(vm); + vm->vatpit = vatpit_init(vm); for (i = 0; i < VM_MAXCPU; i++) { vcpu_init(vm, i); @@ -381,6 +384,7 @@ vm_destroy(struct vm *vm) if (vm->iommu != NULL) iommu_destroy_domain(vm->iommu); + vatpit_cleanup(vm->vatpit); vhpet_cleanup(vm->vhpet); vatpic_cleanup(vm->vatpic); vioapic_cleanup(vm->vioapic); @@ -1740,3 +1744,9 @@ vm_atpic(struct vm *vm) { return (vm->vatpic); } + +struct vatpit * +vm_atpit(struct vm *vm) +{ + return (vm->vatpit); +} Modified: head/sys/amd64/vmm/vmm_ioport.c ============================================================================== --- head/sys/amd64/vmm/vmm_ioport.c Tue Mar 25 19:17:22 2014 (r263743) +++ head/sys/amd64/vmm/vmm_ioport.c Tue Mar 25 19:20:34 2014 (r263744) @@ -36,11 +36,16 @@ __FBSDID("$FreeBSD$"); #include #include "vatpic.h" +#include "vatpit.h" #include "vmm_ioport.h" #define MAX_IOPORTS 1280 ioport_handler_func_t ioport_handler[MAX_IOPORTS] = { + [TIMER_MODE] = vatpit_handler, + [TIMER_CNTR0] = vatpit_handler, + [TIMER_CNTR1] = vatpit_handler, + [TIMER_CNTR2] = vatpit_handler, [IO_ICU1] = vatpic_master_handler, [IO_ICU1 + ICU_IMR_OFFSET] = vatpic_master_handler, [IO_ICU2] = vatpic_slave_handler, Modified: head/sys/modules/vmm/Makefile ============================================================================== --- head/sys/modules/vmm/Makefile Tue Mar 25 19:17:22 2014 (r263743) +++ head/sys/modules/vmm/Makefile Tue Mar 25 19:20:34 2014 (r263744) @@ -29,6 +29,7 @@ SRCS+= vmm.c \ SRCS+= iommu.c \ ppt.c \ vatpic.c \ + vatpit.c \ vhpet.c \ vioapic.c \ vlapic.c Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Tue Mar 25 19:17:22 2014 (r263743) +++ head/usr.sbin/bhyve/Makefile Tue Mar 25 19:20:34 2014 (r263744) @@ -27,7 +27,6 @@ SRCS= \ pci_virtio_block.c \ pci_virtio_net.c \ pci_uart.c \ - pit_8254.c \ pm.c \ pmtmr.c \ post.c \ From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 19:28:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A5818C2; Tue, 25 Mar 2014 19:28:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 47600A55; Tue, 25 Mar 2014 19:28:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2PJSfvp051648; Tue, 25 Mar 2014 19:28:41 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PJSfui051647; Tue, 25 Mar 2014 19:28:41 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403251928.s2PJSfui051647@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 25 Mar 2014 19:28:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263745 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 19:28:41 -0000 Author: trasz Date: Tue Mar 25 19:28:40 2014 New Revision: 263745 URL: http://svnweb.freebsd.org/changeset/base/263745 Log: Target Transfer Tag is opaque; no need to htonl(3) it. Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Mar 25 19:20:34 2014 (r263744) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Mar 25 19:28:40 2014 (r263745) @@ -2500,7 +2500,7 @@ cfiscsi_datamove_out(union ctl_io *io) return; } cdw->cdw_ctl_io = io; - cdw->cdw_target_transfer_tag = htonl(target_transfer_tag); + cdw->cdw_target_transfer_tag = target_transfer_tag; cdw->cdw_initiator_task_tag = bhssc->bhssc_initiator_task_tag; if (cs->cs_immediate_data && icl_pdu_data_segment_length(request) > 0) { @@ -2540,7 +2540,7 @@ cfiscsi_datamove_out(union ctl_io *io) bhsr2t->bhsr2t_flags = 0x80; bhsr2t->bhsr2t_lun = bhssc->bhssc_lun; bhsr2t->bhsr2t_initiator_task_tag = bhssc->bhssc_initiator_task_tag; - bhsr2t->bhsr2t_target_transfer_tag = htonl(target_transfer_tag); + bhsr2t->bhsr2t_target_transfer_tag = target_transfer_tag; /* * XXX: Here we assume that cfiscsi_datamove() won't ever * be running concurrently on several CPUs for a given From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 19:34:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 573F22AC; Tue, 25 Mar 2014 19:34:16 +0000 (UTC) Received: from mail-vc0-x233.google.com (mail-vc0-x233.google.com [IPv6:2607:f8b0:400c:c03::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4DDB4B0E; Tue, 25 Mar 2014 19:34:16 +0000 (UTC) Received: by mail-vc0-f179.google.com with SMTP id ij19so1210754vcb.10 for ; Tue, 25 Mar 2014 12:34:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=7WGewqVYRHB8heKW+1hM5GdBqyhL9OBqn6AqD9SD49E=; b=D3ITIXJ0qsfw4iDnAo+1L1ThsnJjDxqviw0emU9FVZ8X78Akn67ZYx5aAr+lN7yeLS EotyU24yAaHVh1fnmpMe2EIwJWUp2mz4UbYpt7OYWigTulRUa2VFHiy2Psm3iRdcGd6K ujKqOPIUrZnUd5QXjc0enspywn2BGwc33UyFAgUVk3/xknw4nd8fagHedEZ7DEBQJCnd JiHe8K12w3eJsbZqwlCs/hkE9M70dQs/8l5AArQZrP1gXQERE81D2MQbQAq5+Gwo5HmR coMTerVR4HDUwTDeyPUu23qmgMh8ksSyqQEf7qvTjD9uZsdVX8Gi+kJt+spn89mzByrd /tQA== MIME-Version: 1.0 X-Received: by 10.58.152.142 with SMTP id uy14mr24350831veb.4.1395776055397; Tue, 25 Mar 2014 12:34:15 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.58.231.105 with HTTP; Tue, 25 Mar 2014 12:34:15 -0700 (PDT) In-Reply-To: <201306200229.r5K2TnfR085621@svn.freebsd.org> References: <201306200229.r5K2TnfR085621@svn.freebsd.org> Date: Tue, 25 Mar 2014 13:34:15 -0600 X-Google-Sender-Auth: zxg94X9Iz-g6BndVV8-Bid0am78 Message-ID: Subject: Re: svn commit: r252015 - in head: etc share/man/man5 From: Alan Somers To: Hiroki Sato Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 19:34:17 -0000 On Wed, Jun 19, 2013 at 8:29 PM, Hiroki Sato wrote: > Author: hrs > Date: Thu Jun 20 02:29:49 2013 > New Revision: 252015 > URL: http://svnweb.freebsd.org/changeset/base/252015 > > Log: > - Add CIDR notation support like 192.168.1-2.10-16/24 to $ifconfig_IF_aliasN. > This is an extended version of ipv4_addr_IF which supports both IPv4 and > IPv6, and multiple range specifications. To avoid to generate too many > addresses, the maximum number of the generated addresses is currently > limited to 31. > > - Add $ifconfig_IF_aliases, which accepts multiple IP aliases in a variable. > > - ipv6_prefix_IF now supports !/64 prefix length. In addition to the old > 64-bit format (2001:db8:1:1), a full 128-bit format like 2001:db8:1:1::/64 > is supported. > > - Replace ifconfig command with $IFCONFIG_CMD variable to support > a dry-run mode in the future. > > - Remove IP aliases before removing all of IPv4 addresses when doing > "rc.d/netif down". > > - Add a DAD wait to network6_getladdr() because it is possible to fail to > configure an EUI64 address when ipv6_prefix_IF is specified. > > A summary of the supported ifconfig_* variables is as follows: > > # IPv4 configuration. > ifconfig_em0="inet 192.168.0.1" > # IPv6 configuration. > ifconfig_em0_ipv6="inet6 2001:db8::1/64" > # IPv4 address range spec. Now deprecated. > ipv4_addr_em0="10.2.1.1-10" > # IPv6 alias. > ifconfig_em0_alias0="inet6 2001:db8:5::1 prefixlen 70" > # IPv4 alias. > ifconfig_em0_alias1="inet 10.2.2.1/24" > # IPv4 alias with range spec w/o AF keyword (backward compat). > ifconfig_em0_alias2="10.3.1.1-10/32" > # IPv6 alias with range spec. > ifconfig_em0_alias3="inet6 2001:db8:20-2f::1/64" > # ifconfig_IF_aliases is just like ifconfig_IF_aliasN. > ifconfig_em0_aliases="inet 10.3.3.201-204/24 inet6 2001:db8:210-213::1/64 inet 10.1.1.1/24" > # IPv6 alias (backward compat) > ipv6_ifconfig_em0_alias0="inet6 2001:db8:f::1/64" > # IPv6 alias w/o AF keyword (backward compat) > ipv6_ifconfig_em0_alias1="2001:db8:f:1::1/64" > # IPv6 prefix. > ipv6_prefix_em0="2001:db8::/64" > > Tested by: Kimmo Paasiala > > Modified: > head/etc/network.subr > head/share/man/man5/rc.conf.5 > > Modified: head/etc/network.subr > ============================================================================== > --- head/etc/network.subr Thu Jun 20 02:26:32 2013 (r252014) > +++ head/etc/network.subr Thu Jun 20 02:29:49 2013 (r252015) > @@ -24,6 +24,10 @@ ... > + for _c in $_args; do > + case $_c in > + ${_af}) > + case $_tmpargs in > + ${_af}\ *-*) > + ifalias_af_common_handler $_if $_af $_action \ > + `ifalias_expand_addr $_af $_action ${_tmpargs#${_af}\ }` > ;; > - "") ... > + # Process the last component if any. > + if [ -n "$_tmpargs}" ]; then > + case $_tmpargs in > + ${_af}\ *-*) > + ifalias_af_common_handler $_if $_af $_action \ > + `ifalias_expand_addr $_af $_action ${_tmpargs#${_af}\ }` > + ;; The "${_af}/ *-*" globbing pattern is too greedy. It matches - characters that are not part of the IP address specification. The example I found was "ifalias_af_common_handler igb1 inet -alias inet 192.168.34.45/20 fib 1 vhid 8 pass TtZeYgnyslwK6k6cItngoQAh1-E advskew 250". Note the "-" in the CARP password. This caused ifalias_af_common_handler to get stuck in an infinite recursive loop. In my case, the workaround was easy; I just used a CARP password with no "-". But I can imagine other situations that might trigger this same behavior, like "ifalias_af_common_handler igb1 inet 192.168.0.2/24 -group foo". It would be best if you tightened up the globbing pattern. -Alan From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 20:55:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01FAC21C; Tue, 25 Mar 2014 20:55:31 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7B36533E; Tue, 25 Mar 2014 20:55:30 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s2PKtOot062735 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 25 Mar 2014 13:55:24 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s2PKtO5P062734; Tue, 25 Mar 2014 13:55:24 -0700 (PDT) (envelope-from jmg) Date: Tue, 25 Mar 2014 13:55:23 -0700 From: John-Mark Gurney To: Edward Tomasz Napierala Subject: Re: svn commit: r263740 - in head/sys: cam/ctl dev/iscsi Message-ID: <20140325205523.GA60889@funkthat.com> References: <201403251830.s2PIUvIu029793@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201403251830.s2PIUvIu029793@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 25 Mar 2014 13:55:24 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 20:55:31 -0000 Edward Tomasz Napierala wrote this message on Tue, Mar 25, 2014 at 18:30 +0000: > Author: trasz > Date: Tue Mar 25 18:30:57 2014 > New Revision: 263740 > URL: http://svnweb.freebsd.org/changeset/base/263740 > > Log: > Use a less unusual syntax in debug printfs. Just for reference, this is partly a bug fix... if { xxx } while (0) is two statements, and if you tried to use the macros as such: if (something) MACRO(param) else somethingelse; You would get a compile error: t.c:11: error: expected expression before 'else' Now it'll compile properly... Thanks for the fix! > @@ -98,29 +98,38 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO > &maxcmdsn_delta, 256, "Number of commands the initiator can send " > "without confirmation"); > > -#define CFISCSI_DEBUG(X, ...) \ > - if (debug > 1) { \ > - printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ > +#define CFISCSI_DEBUG(X, ...) \ > + do { \ > + if (debug > 1) { \ > + printf("%s: " X "\n", \ > + __func__, ## __VA_ARGS__); \ > + } \ > } while (0) > -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 21:57:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 571531AF; Tue, 25 Mar 2014 21:57:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 444EAA6D; Tue, 25 Mar 2014 21:57:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2PLvpAZ015273; Tue, 25 Mar 2014 21:57:51 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PLvphv015272; Tue, 25 Mar 2014 21:57:51 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201403252157.s2PLvphv015272@svn.freebsd.org> From: Hiren Panchasara Date: Tue, 25 Mar 2014 21:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263748 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 21:57:51 -0000 Author: hiren Date: Tue Mar 25 21:57:50 2014 New Revision: 263748 URL: http://svnweb.freebsd.org/changeset/base/263748 Log: Correct the comments as support for RFC 1644 has been removed for a long time. Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Mar 25 20:17:57 2014 (r263747) +++ head/sys/netinet/tcp_input.c Tue Mar 25 21:57:50 2014 (r263748) @@ -1990,13 +1990,11 @@ tcp_do_segment(struct mbuf *m, struct tc } else { /* * Received initial SYN in SYN-SENT[*] state => - * simultaneous open. If segment contains CC option - * and there is a cached CC, apply TAO test. + * simultaneous open. * If it succeeds, connection is * half-synchronized. * Otherwise, do 3-way handshake: * SYN-SENT -> SYN-RECEIVED * SYN-SENT* -> SYN-RECEIVED* - * If there was no CC option, clear cached CC value. */ tp->t_flags |= (TF_ACKNOW | TF_NEEDSYN); tcp_timer_activate(tp, TT_REXMT, 0); From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 22:08:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 438F054D; Tue, 25 Mar 2014 22:08:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 23C65B7C; Tue, 25 Mar 2014 22:08:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2PM8XV7019667; Tue, 25 Mar 2014 22:08:33 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PM8VXj019660; Tue, 25 Mar 2014 22:08:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403252208.s2PM8VXj019660@svn.freebsd.org> From: Warner Losh Date: Tue, 25 Mar 2014 22:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263749 - in head: . sys/amd64/conf sys/conf sys/i386/conf sys/sparc64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 22:08:33 -0000 Author: imp Date: Tue Mar 25 22:08:31 2014 New Revision: 263749 URL: http://svnweb.freebsd.org/changeset/base/263749 Log: Rather than require a makeoptions DEBUG to get debug correct, add it in kern.mk, but only if we're using clang. While this option is supported by both clang and gcc, in the future there may be changes to clang which change the defaults that require a tweak to build our kernel such that other tools in our tree will work. Set a good example by forcing -gdwarf-2 only for clang builds, and only if the user hasn't specified another dwarf level already. Update UPDATING to reflect the changed state of affairs. This also keeps us from having to update all the ARM kernels to add this, and also keeps us from in the future having to update all the MIPS kernels and is one less place the user will have to know to do something special for clang and one less thing developers will need to do when moving an architecture to clang. Reviewed by: ian@ MFC after: 1 week Modified: head/UPDATING head/sys/amd64/conf/GENERIC head/sys/conf/kern.mk head/sys/i386/conf/GENERIC head/sys/i386/conf/XEN head/sys/sparc64/conf/GENERIC Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Mar 25 21:57:50 2014 (r263748) +++ head/UPDATING Tue Mar 25 22:08:31 2014 (r263749) @@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20140325: + It is no longer necessary to include the dwarf version in your DEBUG + options in your kernel config file. The bug that required it to be + placed in the config file has bene fixed. DEBUG should now just + contain -g. The build system will automatically update things + to do the right thing. Ignore the entry from 20140216. + 20140306: Support for libwrap (TCP wrappers) in rpcbind was disabled by default to improve performance. To re-enable it, if needed, run rpcbind @@ -44,16 +51,18 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 to do so. Set WITHOUT_GPL_DTC if you require the BSDL compiler. 20140216: - Clang and llvm have been upgraded to 3.4 release. Please note that - clang 3.4 now defaults to DWARF4 debug information format when you - specify -g. Since kgdb(1) only supports DWARF2, you should update any - customized kernel configurations which include debug information to - explicitly use -gdwarf-2, e.g: + Clang and llvm have been upgraded to 3.4 release. + + Please note that clang 3.4 now defaults to DWARF4 debug information + format when you specify -g. Since kgdb(1) only supports DWARF2, you + should update any customized kernel configurations which include debug + information to explicitly use -gdwarf-2, e.g: makeoptions DEBUG=-gdwarf-2 This has already been applied to the appropriate GENERIC configuration files, so if you inherit from those, no changes are required. + Please note: this bug has been fixed, please see 20140325. 20140216: The nve(4) driver has been removed. Please use the nfe(4) driver Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Tue Mar 25 21:57:50 2014 (r263748) +++ head/sys/amd64/conf/GENERIC Tue Mar 25 22:08:31 2014 (r263749) @@ -21,7 +21,7 @@ cpu HAMMER ident GENERIC -makeoptions DEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support options SCHED_ULE # ULE scheduler Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Tue Mar 25 21:57:50 2014 (r263748) +++ head/sys/conf/kern.mk Tue Mar 25 22:08:31 2014 (r263749) @@ -162,3 +162,10 @@ CFLAGS+= -ffreestanding ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" CFLAGS+= -fstack-protector .endif + +# +# Add -gdwarf-2 when compiling -g +# +.if ${COMPILER_TYPE} == "clang" && ${CFLAGS:M-g} != "" && ${CFLAGS:M-gdwarf} == "" +CFLAGS+= -gdwarf-2 +.endif Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Tue Mar 25 21:57:50 2014 (r263748) +++ head/sys/i386/conf/GENERIC Tue Mar 25 22:08:31 2014 (r263749) @@ -23,7 +23,7 @@ cpu I586_CPU cpu I686_CPU ident GENERIC -makeoptions DEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support options SCHED_ULE # ULE scheduler Modified: head/sys/i386/conf/XEN ============================================================================== --- head/sys/i386/conf/XEN Tue Mar 25 21:57:50 2014 (r263748) +++ head/sys/i386/conf/XEN Tue Mar 25 22:08:31 2014 (r263749) @@ -6,7 +6,7 @@ cpu I686_CPU ident XEN -makeoptions DEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g makeoptions WITHOUT_MODULES="aha ahb amd ctl cxgb dpt drm drm2 hptnr hptmv ida malo mps mwl rdma sound sym trm xfs" options SCHED_ULE # ULE scheduler Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Tue Mar 25 21:57:50 2014 (r263748) +++ head/sys/sparc64/conf/GENERIC Tue Mar 25 22:08:31 2014 (r263749) @@ -21,7 +21,7 @@ cpu SUN4U ident GENERIC -makeoptions DEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Platforms supported # At this time all platforms are supported, as-is. From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 22:32:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6F82F24; Tue, 25 Mar 2014 22:32:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 93C30DF8; Tue, 25 Mar 2014 22:32:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2PMWDLT031034; Tue, 25 Mar 2014 22:32:13 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PMWDkE031033; Tue, 25 Mar 2014 22:32:13 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403252232.s2PMWDkE031033@svn.freebsd.org> From: Warner Losh Date: Tue, 25 Mar 2014 22:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263750 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 22:32:13 -0000 Author: imp Date: Tue Mar 25 22:32:13 2014 New Revision: 263750 URL: http://svnweb.freebsd.org/changeset/base/263750 Log: Add a '*' to the M modifier string so we match any -gdwarf string (even though it works w/o it for some reason, contrary to our reading of make(1)). Also add a comment explaining things a bit better so there's one less mystery that must be answered with svn blame. Submitted by: ian@ Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Tue Mar 25 22:08:31 2014 (r263749) +++ head/sys/conf/kern.mk Tue Mar 25 22:32:13 2014 (r263750) @@ -164,8 +164,10 @@ CFLAGS+= -fstack-protector .endif # -# Add -gdwarf-2 when compiling -g +# Add -gdwarf-2 when compiling -g on clang. The default starting in v3.4 +# is to generate DWARF version 4. However, our tools don't cope well with +# DWARF 4, so force it to genereate DWARF2, which they understand. # -.if ${COMPILER_TYPE} == "clang" && ${CFLAGS:M-g} != "" && ${CFLAGS:M-gdwarf} == "" +.if ${COMPILER_TYPE} == "clang" && ${CFLAGS:M-g} != "" && ${CFLAGS:M-gdwarf*} == "" CFLAGS+= -gdwarf-2 .endif From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 22:49:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C97A781; Tue, 25 Mar 2014 22:49:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 89EC1F0B; Tue, 25 Mar 2014 22:49:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2PMnXZI036004; Tue, 25 Mar 2014 22:49:33 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PMnX2R036003; Tue, 25 Mar 2014 22:49:33 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403252249.s2PMnX2R036003@svn.freebsd.org> From: Warner Losh Date: Tue, 25 Mar 2014 22:49:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263752 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 22:49:33 -0000 Author: imp Date: Tue Mar 25 22:49:33 2014 New Revision: 263752 URL: http://svnweb.freebsd.org/changeset/base/263752 Log: Define PSL_SRR1_MASK for BOOK-E too so MPC85XX compiles again. Modified: head/sys/powerpc/include/psl.h Modified: head/sys/powerpc/include/psl.h ============================================================================== --- head/sys/powerpc/include/psl.h Tue Mar 25 22:43:34 2014 (r263751) +++ head/sys/powerpc/include/psl.h Tue Mar 25 22:49:33 2014 (r263752) @@ -86,6 +86,7 @@ /* Initial kernel MSR, use IS=1 ad DS=1. */ #define PSL_KERNSET_INIT (PSL_IS | PSL_DS) #define PSL_KERNSET (PSL_CE | PSL_ME | PSL_EE) +#define PSL_SRR1_MASK 0x00000000UL /* No mask on Book-E */ #elif defined(BOOKE_PPC4XX) #define PSL_KERNSET (PSL_CE | PSL_ME | PSL_EE | PSL_FP) #define PSL_SRR1_MASK 0x00000000UL /* No mask on Book-E */ From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 22:55:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A53A19F4; Tue, 25 Mar 2014 22:55:42 +0000 (UTC) Received: from mail-qa0-x236.google.com (mail-qa0-x236.google.com [IPv6:2607:f8b0:400d:c00::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 351CFFC3; Tue, 25 Mar 2014 22:55:42 +0000 (UTC) Received: by mail-qa0-f54.google.com with SMTP id w8so1411336qac.27 for ; Tue, 25 Mar 2014 15:55:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=h4Fa5Eof0oOCdre2hwUamRD56A6klKmRlS6uk++EQpY=; b=yGoKht/Ezr6RGiRehDxSooU2ViwmZBVTXRa0m0f8U9gw8FtUkEUR/Bf4zP15ISaf/r LgzwESKwCfsPFZuLoDB7ZYteDLlZYy8YJ3m2peOzkDSKiOFbs+50kDl3JIdk/oS5R1rk WetsjaeqJi2nKcRQ3cBm8bFA3rZwPeR9Ysz31+CXeFzUq/KZiM6Dfu9VBc0K7jGZIjQs PRvlFQN951Xbbvlhan168N6Y8mfW5NNYQPXU+xLIGV8hyc9K7cgSwujJVdUuMGLmmM7z 4cPrby23+l8nk3vDgUMki2je0xFw67O2dPSGexc9BjzpZO/dZx7khNWLpCNOMGQMAe6D igYA== MIME-Version: 1.0 X-Received: by 10.140.31.6 with SMTP id e6mr5304143qge.101.1395788141433; Tue, 25 Mar 2014 15:55:41 -0700 (PDT) Sender: chmeeedalf@gmail.com Received: by 10.140.37.227 with HTTP; Tue, 25 Mar 2014 15:55:41 -0700 (PDT) In-Reply-To: <201403252249.s2PMnX2R036003@svn.freebsd.org> References: <201403252249.s2PMnX2R036003@svn.freebsd.org> Date: Tue, 25 Mar 2014 15:55:41 -0700 X-Google-Sender-Auth: DezOGkLDRdGgbwUe5o_Es3nD-VQ Message-ID: Subject: Re: svn commit: r263752 - head/sys/powerpc/include From: Justin Hibbits To: Warner Losh Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 22:55:42 -0000 On Tue, Mar 25, 2014 at 3:49 PM, Warner Losh wrote: > Author: imp > Date: Tue Mar 25 22:49:33 2014 > New Revision: 263752 > URL: http://svnweb.freebsd.org/changeset/base/263752 > > Log: > Define PSL_SRR1_MASK for BOOK-E too so MPC85XX compiles again. > > Modified: > head/sys/powerpc/include/psl.h > > Modified: head/sys/powerpc/include/psl.h > ============================================================================== > --- head/sys/powerpc/include/psl.h Tue Mar 25 22:43:34 2014 (r263751) > +++ head/sys/powerpc/include/psl.h Tue Mar 25 22:49:33 2014 (r263752) > @@ -86,6 +86,7 @@ > /* Initial kernel MSR, use IS=1 ad DS=1. */ > #define PSL_KERNSET_INIT (PSL_IS | PSL_DS) > #define PSL_KERNSET (PSL_CE | PSL_ME | PSL_EE) > +#define PSL_SRR1_MASK 0x00000000UL /* No mask on Book-E */ > #elif defined(BOOKE_PPC4XX) > #define PSL_KERNSET (PSL_CE | PSL_ME | PSL_EE | PSL_FP) > #define PSL_SRR1_MASK 0x00000000UL /* No mask on Book-E */ > D'oh, thanks! From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 23:13:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92FFADF; Tue, 25 Mar 2014 23:13:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 805AB1EF; Tue, 25 Mar 2014 23:13:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2PNDk2a047416; Tue, 25 Mar 2014 23:13:46 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PNDkT6047415; Tue, 25 Mar 2014 23:13:46 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201403252313.s2PNDkT6047415@svn.freebsd.org> From: Mateusz Guzik Date: Tue, 25 Mar 2014 23:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263753 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 23:13:46 -0000 Author: mjg Date: Tue Mar 25 23:13:46 2014 New Revision: 263753 URL: http://svnweb.freebsd.org/changeset/base/263753 Log: Remove lockless check in devopen, while correct it does not make much sense. Suggested by: imp MFC after: 6 days Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue Mar 25 22:49:33 2014 (r263752) +++ head/sys/kern/subr_bus.c Tue Mar 25 23:13:46 2014 (r263753) @@ -421,8 +421,6 @@ static int devopen(struct cdev *dev, int oflags, int devtype, struct thread *td) { - if (devsoftc.inuse) - return (EBUSY); mtx_lock(&devsoftc.mtx); if (devsoftc.inuse) { mtx_unlock(&devsoftc.mtx); From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 23:19:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD61737E; Tue, 25 Mar 2014 23:19:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 90957229; Tue, 25 Mar 2014 23:19:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2PNJjFE048114; Tue, 25 Mar 2014 23:19:45 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PNJjIM048113; Tue, 25 Mar 2014 23:19:45 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201403252319.s2PNJjIM048113@svn.freebsd.org> From: Mateusz Guzik Date: Tue, 25 Mar 2014 23:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263754 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 23:19:45 -0000 Author: mjg Date: Tue Mar 25 23:19:45 2014 New Revision: 263754 URL: http://svnweb.freebsd.org/changeset/base/263754 Log: Remove long obsolete sysctl hw.bus.devctl_disable. Suggested by: imp Relnotes: yes Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue Mar 25 23:13:46 2014 (r263753) +++ head/sys/kern/subr_bus.c Tue Mar 25 23:19:45 2014 (r263754) @@ -355,13 +355,6 @@ device_sysctl_fini(device_t dev) * tested since 3.4 or 2.2.8! */ -/* Deprecated way to adjust queue length */ -static int sysctl_devctl_disable(SYSCTL_HANDLER_ARGS); -/* XXX Need to support old-style tunable hw.bus.devctl_disable" */ -SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW | - CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_disable, "I", - "devctl disable -- deprecated"); - #define DEVCTL_DEFAULT_QUEUE_LEN 1000 static int sysctl_devctl_queue(SYSCTL_HANDLER_ARGS); static int devctl_queue_length = DEVCTL_DEFAULT_QUEUE_LEN; @@ -652,9 +645,9 @@ devctl_notify(const char *system, const * Common routine that tries to make sending messages as easy as possible. * We allocate memory for the data, copy strings into that, but do not * free it unless there's an error. The dequeue part of the driver should - * free the data. We don't send data when the device is disabled. We do - * send data, even when we have no listeners, because we wish to avoid - * races relating to startup and restart of listening applications. + * free the data. We don't send data when queue length is 0. We do send + * data, even when we have no listeners, because we wish to avoid races + * relating to startup and restart of listening applications. * * devaddq is designed to string together the type of event, with the * object of that event, plus the plug and play info and location info @@ -746,33 +739,6 @@ devnomatch(device_t dev) } static int -sysctl_devctl_disable(SYSCTL_HANDLER_ARGS) -{ - struct dev_event_info *n1; - int dis, error; - - dis = devctl_queue_length == 0; - error = sysctl_handle_int(oidp, &dis, 0, req); - if (error || !req->newptr) - return (error); - mtx_lock(&devsoftc.mtx); - if (dis) { - while (!TAILQ_EMPTY(&devsoftc.devq)) { - n1 = TAILQ_FIRST(&devsoftc.devq); - TAILQ_REMOVE(&devsoftc.devq, n1, dei_link); - free(n1->dei_data, M_BUS); - free(n1, M_BUS); - } - devsoftc.queued = 0; - devctl_queue_length = 0; - } else { - devctl_queue_length = DEVCTL_DEFAULT_QUEUE_LEN; - } - mtx_unlock(&devsoftc.mtx); - return (0); -} - -static int sysctl_devctl_queue(SYSCTL_HANDLER_ARGS) { struct dev_event_info *n1; From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 23:26:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F061C5BF; Tue, 25 Mar 2014 23:26:54 +0000 (UTC) Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [IPv6:2a00:1450:400c:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 19A2A2DD; Tue, 25 Mar 2014 23:26:53 +0000 (UTC) Received: by mail-wg0-f46.google.com with SMTP id b13so703252wgh.17 for ; Tue, 25 Mar 2014 16:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=bZbVAIjrmabKKcOD4b7JdJzI63ol+tRcwQuGTyUPHRY=; b=ZHNFmmLernJOxhQ5CkQnmdpdrXj3D5IYxFFhkIXXB4lykaxcGfcIlFzs00AUy7U3P2 SH20TUWC5Z/DdyrmwUyowyBT7tUujRFHVEZI8HOJOaW059NFtZnt1YwIvcWTXqLz6Whu RwiGh+Q82Ef0bHrbiHkhY+jCCgNCVpmPjTlAfWO48z1uhqswRZBZ+2M6pFSbMyQuaLnk +HBb71gAf4RiZp/+LbfGPdZdgbE8dWAvNICX/eT9OTvy811VwmRKMcAfAVc/oILKalWe i/ssbPXUziGynCMPGBytmCSo0B2se/Wiw8pM+XVUSqlAd0k6+soJkwBNyLi1u62CBeee XZFg== X-Received: by 10.180.188.66 with SMTP id fy2mr25359279wic.45.1395790012512; Tue, 25 Mar 2014 16:26:52 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id qg3sm54626787wic.10.2014.03.25.16.26.50 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 25 Mar 2014 16:26:51 -0700 (PDT) Date: Wed, 26 Mar 2014 00:26:48 +0100 From: Mateusz Guzik To: Warner Losh Subject: Re: svn commit: r263704 - head/sys/kern Message-ID: <20140325232648.GA19412@dft-labs.eu> References: <201403250328.s2P3Swsl054558@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 23:26:55 -0000 On Tue, Mar 25, 2014 at 08:03:13AM -0600, Warner Losh wrote: > On Mar 24, 2014, at 9:28 PM, Mateusz Guzik wrote: > > Author: mjg > > Date: Tue Mar 25 03:28:58 2014 > > New Revision: 263704 > > URL: http://svnweb.freebsd.org/changeset/base/263704 > > > > Log: > > Make /dev/devctl mpsafe. > > > > MFC after: 1 week > > > > static int sysctl_devctl_disable(SYSCTL_HANDLER_ARGS); > > /* XXX Need to support old-style tunable hw.bus.devctl_disable" */ > > -SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW, NULL, > > - 0, sysctl_devctl_disable, "I", "devctl disable -- deprecated"); > > +SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW | > > + CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_disable, "I", > > + "devctl disable -- deprecatedâ€); > > This can likely be deleted now... > http://svnweb.freebsd.org/changeset/base/263754 > > @@ -420,23 +420,31 @@ devinit(void) > > static int > > devopen(struct cdev *dev, int oflags, int devtype, struct thread *td) > > { > > + > > if (devsoftc.inuse) > > return (EBUSY); > > Why not delete these two lines? Since this isn’t a performance critical part of the code, > it is clearer and safer to just test inuse inside the locked section. > http://svnweb.freebsd.org/changeset/base/263753 -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 23:30:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 559D878B; Tue, 25 Mar 2014 23:30:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4351A30F; Tue, 25 Mar 2014 23:30:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2PNUa5f052960; Tue, 25 Mar 2014 23:30:36 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PNUaei052956; Tue, 25 Mar 2014 23:30:36 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201403252330.s2PNUaei052956@svn.freebsd.org> From: Mateusz Guzik Date: Tue, 25 Mar 2014 23:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263755 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 23:30:36 -0000 Author: mjg Date: Tue Mar 25 23:30:35 2014 New Revision: 263755 URL: http://svnweb.freebsd.org/changeset/base/263755 Log: Document a known problem with handling the process intended to receive SIGIO in /dev/devctl. Suggested by: adrian MFC after: 6 days Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue Mar 25 23:19:45 2014 (r263754) +++ head/sys/kern/subr_bus.c Tue Mar 25 23:30:35 2014 (r263755) @@ -490,6 +490,21 @@ devioctl(struct cdev *dev, u_long cmd, c devsoftc.nonblock = 0; return (0); case FIOASYNC: + /* + * FIXME: + * Since this is a simple assignment there is no guarantee that + * devsoftc.async_proc consumers will get a valid pointer. + * + * Example scenario where things break (processes A and B): + * 1. A opens devctl + * 2. A sends fd to B + * 3. B sets itself as async_proc + * 4. B exits + * + * However, normally this requires root privileges and the only + * in-tree consumer does not behave in a dangerous way so the + * issue is not critical. + */ if (*(int*)data) devsoftc.async_proc = td->td_proc; else @@ -575,6 +590,7 @@ devctl_queue_data_f(char *data, int flag cv_broadcast(&devsoftc.cv); mtx_unlock(&devsoftc.mtx); selwakeup(&devsoftc.sel); + /* XXX see a comment in devioctl */ p = devsoftc.async_proc; if (p != NULL) { PROC_LOCK(p); From owner-svn-src-head@FreeBSD.ORG Tue Mar 25 23:37:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A30FAAE; Tue, 25 Mar 2014 23:37:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6A7393CC; Tue, 25 Mar 2014 23:37:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2PNbw8u055928; Tue, 25 Mar 2014 23:37:58 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2PNbwAp055927; Tue, 25 Mar 2014 23:37:58 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201403252337.s2PNbwAp055927@svn.freebsd.org> From: Maxim Sobolev Date: Tue, 25 Mar 2014 23:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263756 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Mar 2014 23:37:58 -0000 Author: sobomax Date: Tue Mar 25 23:37:57 2014 New Revision: 263756 URL: http://svnweb.freebsd.org/changeset/base/263756 Log: Make `-R', `-T' and `-E' options mutially non-exclusive. It is often useful to see two or three types at the same time when inspecting the dump. MFC after: 1 month Sponsored by: Sippy Software, Inc. Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Tue Mar 25 23:30:35 2014 (r263755) +++ head/usr.bin/kdump/kdump.c Tue Mar 25 23:37:57 2014 (r263756) @@ -117,6 +117,11 @@ void limitfd(int fd); void usage(void); void ioctlname(unsigned long, int); +#define TIMESTAMP_NONE 0x0 +#define TIMESTAMP_ABSOLUTE 0x1 +#define TIMESTAMP_ELAPSED 0x2 +#define TIMESTAMP_RELATIVE 0x4 + int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata, resolv = 0, abiflag = 0; const char *tracefile = DEF_TRACEFILE; @@ -254,6 +259,8 @@ main(int argc, char *argv[]) setlocale(LC_CTYPE, ""); + timestamp = TIMESTAMP_NONE; + while ((ch = getopt(argc,argv,"f:dElm:np:AHRrsTt:")) != -1) switch (ch) { case 'A': @@ -284,16 +291,16 @@ main(int argc, char *argv[]) suppressdata = 1; break; case 'E': - timestamp = 3; /* elapsed timestamp */ + timestamp |= TIMESTAMP_ELAPSED; break; case 'H': threads = 1; break; case 'R': - timestamp = 2; /* relative timestamp */ + timestamp |= TIMESTAMP_RELATIVE; break; case 'T': - timestamp = 1; + timestamp |= TIMESTAMP_ABSOLUTE; break; case 't': trpoints = getpoints(optarg); @@ -567,7 +574,7 @@ void dumpheader(struct ktr_header *kth) { static char unknown[64]; - static struct timeval prevtime, temp; + static struct timeval prevtime, prevtime_e, temp; const char *type; switch (kth->ktr_type) { @@ -631,19 +638,26 @@ dumpheader(struct ktr_header *kth) else printf("%6jd %-8.*s ", (intmax_t)kth->ktr_pid, MAXCOMLEN, kth->ktr_comm); - if (timestamp) { - if (timestamp == 3) { - if (prevtime.tv_sec == 0) - prevtime = kth->ktr_time; - timevalsub(&kth->ktr_time, &prevtime); + if (timestamp) { + if (timestamp & TIMESTAMP_ABSOLUTE) { + printf("%jd.%06ld ", (intmax_t)kth->ktr_time.tv_sec, + kth->ktr_time.tv_usec); + } + if (timestamp & TIMESTAMP_ELAPSED) { + if (prevtime_e.tv_sec == 0) + prevtime_e = kth->ktr_time; + timevalsub(&kth->ktr_time, &prevtime_e); + printf("%jd.%06ld ", (intmax_t)kth->ktr_time.tv_sec, + kth->ktr_time.tv_usec); + timevaladd(&kth->ktr_time, &prevtime_e); } - if (timestamp == 2) { + if (timestamp & TIMESTAMP_RELATIVE) { temp = kth->ktr_time; timevalsub(&kth->ktr_time, &prevtime); prevtime = temp; + printf("%jd.%06ld ", (intmax_t)kth->ktr_time.tv_sec, + kth->ktr_time.tv_usec); } - printf("%jd.%06ld ", (intmax_t)kth->ktr_time.tv_sec, - kth->ktr_time.tv_usec); } printf("%s ", type); } From owner-svn-src-head@FreeBSD.ORG Wed Mar 26 01:36:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21F97911; Wed, 26 Mar 2014 01:36:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0E911E75; Wed, 26 Mar 2014 01:36:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2Q1a08S005081; Wed, 26 Mar 2014 01:36:00 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2Q1a0a3005080; Wed, 26 Mar 2014 01:36:00 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201403260136.s2Q1a0a3005080@svn.freebsd.org> From: Glen Barber Date: Wed, 26 Mar 2014 01:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263757 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 01:36:01 -0000 Author: gjb Date: Wed Mar 26 01:36:00 2014 New Revision: 263757 URL: http://svnweb.freebsd.org/changeset/base/263757 Log: Document r263754 Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Mar 25 23:37:57 2014 (r263756) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed Mar 26 01:36:00 2014 (r263757) @@ -104,6 +104,10 @@ Kernel Changes + The &man.sysctl.8; + hw.bus.devctl_disable has been + removed. + Support for GPS ports has been added to &man.uhso.4;. From owner-svn-src-head@FreeBSD.ORG Wed Mar 26 02:25:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A44F82C9; Wed, 26 Mar 2014 02:25:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 84A238DC; Wed, 26 Mar 2014 02:25:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2Q2Pfo7025723; Wed, 26 Mar 2014 02:25:41 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2Q2PeTM025717; Wed, 26 Mar 2014 02:25:40 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201403260225.s2Q2PeTM025717@svn.freebsd.org> From: Mateusz Guzik Date: Wed, 26 Mar 2014 02:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263758 - in head: etc/rc.d sbin/devd share/man/man4 tools/tools/sysdoc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 02:25:41 -0000 Author: mjg Date: Wed Mar 26 02:25:40 2014 New Revision: 263758 URL: http://svnweb.freebsd.org/changeset/base/263758 Log: Update userspace users of hw.bus.devctl_disable. This fixes breakage resulting from r263754. Reported by: AN Reviewed by: imp Pointy hat to: me Modified: head/etc/rc.d/devd head/sbin/devd/devd.cc head/share/man/man4/devctl.4 head/tools/tools/sysdoc/tunables.mdoc Modified: head/etc/rc.d/devd ============================================================================== --- head/etc/rc.d/devd Wed Mar 26 01:36:00 2014 (r263757) +++ head/etc/rc.d/devd Wed Mar 26 02:25:40 2014 (r263758) @@ -30,9 +30,10 @@ devd_prestart() { find_pidfile - # If devd is disabled, turn it off in the kernel to avoid memory leaks. + # If devd is disabled, turn it off in the kernel to avoid unnecessary + # memory usage. if ! checkyesno ${rcvar}; then - $SYSCTL hw.bus.devctl_disable=1 + $SYSCTL hw.bus.devctl_queue=0 fi } Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Wed Mar 26 01:36:00 2014 (r263757) +++ head/sbin/devd/devd.cc Wed Mar 26 02:25:40 2014 (r263758) @@ -102,7 +102,7 @@ __FBSDID("$FreeBSD$"); #define PIPE "/var/run/devd.pipe" #define CF "/etc/devd.conf" -#define SYSCTL "hw.bus.devctl_disable" +#define SYSCTL "hw.bus.devctl_queue" /* * Since the client socket is nonblocking, we must increase its send buffer to @@ -1164,9 +1164,9 @@ check_devd_enabled() len = sizeof(val); if (sysctlbyname(SYSCTL, &val, &len, NULL, 0) != 0) errx(1, "devctl sysctl missing from kernel!"); - if (val) { - warnx("Setting " SYSCTL " to 0"); - val = 0; + if (val == 0) { + warnx("Setting " SYSCTL " to 1000"); + val = 1000; sysctlbyname(SYSCTL, NULL, NULL, &val, sizeof(val)); } } Modified: head/share/man/man4/devctl.4 ============================================================================== --- head/share/man/man4/devctl.4 Wed Mar 26 01:36:00 2014 (r263757) +++ head/share/man/man4/devctl.4 Wed Mar 26 02:25:40 2014 (r263758) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 11, 2003 +.Dd March 26, 2014 .Dt DEVCTL 4 .Os .Sh NAME @@ -73,9 +73,9 @@ If you try to read this device a charact the rest of the data. Listening programs are expected to cope. .Pp -The sysctl and boot parameter -.Va hw.bus.devctl_disable -is used to disable +The sysctl +.Va hw.bus.devctl_queue +can be used to control queue length. It is set to 0 to disable .Nm when no .Xr devd 8 Modified: head/tools/tools/sysdoc/tunables.mdoc ============================================================================== --- head/tools/tools/sysdoc/tunables.mdoc Wed Mar 26 01:36:00 2014 (r263757) +++ head/tools/tools/sysdoc/tunables.mdoc Wed Mar 26 02:25:40 2014 (r263758) @@ -233,16 +233,6 @@ See for more information. --- -hw.bus.devctl_disable -bool - -This can be used to turn off -.Xr devctl 4 -when no -.Xr devd 8 -is running. - ---- hw.bus.devices --- From owner-svn-src-head@FreeBSD.ORG Wed Mar 26 03:18:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 995B36D; Wed, 26 Mar 2014 03:18:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 85304D5F; Wed, 26 Mar 2014 03:18:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2Q3IR5f047284; Wed, 26 Mar 2014 03:18:27 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2Q3IRf8047283; Wed, 26 Mar 2014 03:18:27 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201403260318.s2Q3IRf8047283@svn.freebsd.org> From: John-Mark Gurney Date: Wed, 26 Mar 2014 03:18:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263759 - head/usr.bin/brandelf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 03:18:27 -0000 Author: jmg Date: Wed Mar 26 03:18:27 2014 New Revision: 263759 URL: http://svnweb.freebsd.org/changeset/base/263759 Log: udpate VERY old email address.. I haven't had this email address for well over 8 years... roll the clock forward 16 years since there have been other changes deserving of a bump, but never happened.. Submitted by: feld Obtained from: 1 week Modified: head/usr.bin/brandelf/brandelf.1 Modified: head/usr.bin/brandelf/brandelf.1 ============================================================================== --- head/usr.bin/brandelf/brandelf.1 Wed Mar 26 02:25:40 2014 (r263758) +++ head/usr.bin/brandelf/brandelf.1 Wed Mar 26 03:18:27 2014 (r263759) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 6, 1997 +.Dd March 25, 2014 .Dt BRANDELF 1 .Os .Sh NAME @@ -101,4 +101,4 @@ manual page first appeared in .Fx 2.2 . .Sh AUTHORS This manual page was written by -.An John-Mark Gurney Aq gurney_j@efn.org . +.An John-Mark Gurney Aq jmg@FreeBSD.org . From owner-svn-src-head@FreeBSD.ORG Wed Mar 26 03:20:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47A471E5; Wed, 26 Mar 2014 03:20:35 +0000 (UTC) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 085A1D6C; Wed, 26 Mar 2014 03:20:34 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 86B5D1A5534; Wed, 26 Mar 2014 13:58:58 +1100 (EST) Date: Wed, 26 Mar 2014 13:58:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John-Mark Gurney Subject: Re: svn commit: r263740 - in head/sys: cam/ctl dev/iscsi In-Reply-To: <20140325205523.GA60889@funkthat.com> Message-ID: <20140326134456.V1525@besplex.bde.org> References: <201403251830.s2PIUvIu029793@svn.freebsd.org> <20140325205523.GA60889@funkthat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PqKqMW83 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=mhVUI_e9FtMA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=rDVvgjhvMZaOE9O5LnMA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Edward Tomasz Napierala X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 03:20:35 -0000 On Tue, 25 Mar 2014, John-Mark Gurney wrote: > Edward Tomasz Napierala wrote this message on Tue, Mar 25, 2014 at 18:30 +0000: >> Author: trasz >> Date: Tue Mar 25 18:30:57 2014 >> New Revision: 263740 >> URL: http://svnweb.freebsd.org/changeset/base/263740 >> >> Log: >> Use a less unusual syntax in debug printfs. > > Just for reference, this is partly a bug fix... > > if { xxx } while (0) > > is two statements, and if you tried to use the macros as such: > if (something) > MACRO(param) > else > somethingelse; It seems to be entirely this bug fix, except for massive churning of the indentation. >> @@ -98,29 +98,38 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO >> &maxcmdsn_delta, 256, "Number of commands the initiator can send " >> "without confirmation"); >> >> -#define CFISCSI_DEBUG(X, ...) \ >> - if (debug > 1) { \ >> - printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ >> +#define CFISCSI_DEBUG(X, ...) \ >> + do { \ >> + if (debug > 1) { \ >> + printf("%s: " X "\n", \ >> + __func__, ## __VA_ARGS__); \ >> + } \ >> } while (0) >> Normal style is as in sys/queue.h. It doesn't make the code less readable by pushing the non-do-while parts of it to the right, and didn't churn the indentation when adding do-while. Normal style is also used for the more directly related KASSERT()... BTW, KASSERT() is still dumbed down to work K&R compilers that don't support __VA_ARGS__. This is hard to fix since its collateral bad syntax is used in thousands of callers. Automatic printing of the function names was intentionally left out of KASSERT(), so that callers could omit it if they wanted, but this has resulted in lots of ugly syntax and source code bloat in callers. Here the ugly syntax is hidden in the macro, and the bloat is mostly at runtime. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Mar 26 05:49:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49493C34; Wed, 26 Mar 2014 05:49:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1C48FA89; Wed, 26 Mar 2014 05:49:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2Q5n9lC011765; Wed, 26 Mar 2014 05:49:09 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2Q5n91C011763; Wed, 26 Mar 2014 05:49:09 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201403260549.s2Q5n91C011763@svn.freebsd.org> From: John-Mark Gurney Date: Wed, 26 Mar 2014 05:49:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263760 - in head/share/man: man4 man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 05:49:10 -0000 Author: jmg Date: Wed Mar 26 05:49:09 2014 New Revision: 263760 URL: http://svnweb.freebsd.org/changeset/base/263760 Log: fix up an old email address and drop clause 3 of my copyright... bump date.. MFC after: 1 week Modified: head/share/man/man4/sysmouse.4 head/share/man/man9/cd.9 Modified: head/share/man/man4/sysmouse.4 ============================================================================== --- head/share/man/man4/sysmouse.4 Wed Mar 26 03:18:27 2014 (r263759) +++ head/share/man/man4/sysmouse.4 Wed Mar 26 05:49:09 2014 (r263760) @@ -8,9 +8,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. Neither the name of the author nor the names of any co-contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY John-Mark Gurney AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -26,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2010 +.Dd March 25, 2014 .Dt SYSMOUSE 4 .Os .Sh NAME @@ -471,6 +468,6 @@ driver first appeared in .An -nosplit This manual page was written by -.An John-Mark Gurney Aq gurney_j@efn.org +.An John-Mark Gurney Aq jmg@FreeBSD.org and .An Kazutaka Yokota Aq yokota@FreeBSD.org . Modified: head/share/man/man9/cd.9 ============================================================================== --- head/share/man/man9/cd.9 Wed Mar 26 03:18:27 2014 (r263759) +++ head/share/man/man9/cd.9 Wed Mar 26 05:49:09 2014 (r263760) @@ -9,9 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. Neither the name of the author nor the names of any co-contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY John-Mark Gurney AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -27,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 2, 2003 +.Dd March 25, 2014 .Dt CD 9 .Os .Sh NAME @@ -119,7 +116,7 @@ manual page first appeared in .An -nosplit This manual page was written by -.An John-Mark Gurney Aq gurney_j@efn.org . +.An John-Mark Gurney Aq jmg@FreeBSD.org . It was updated for CAM and .Fx 3.0 by From owner-svn-src-head@FreeBSD.ORG Wed Mar 26 13:41:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D459719; Wed, 26 Mar 2014 13:41:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3A292F82; Wed, 26 Mar 2014 13:41:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2QDfVVb005083; Wed, 26 Mar 2014 13:41:31 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2QDfVIj005082; Wed, 26 Mar 2014 13:41:31 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403261341.s2QDfVIj005082@svn.freebsd.org> From: Bryan Drewery Date: Wed, 26 Mar 2014 13:41:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263768 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 13:41:31 -0000 Author: bdrewery Date: Wed Mar 26 13:41:30 2014 New Revision: 263768 URL: http://svnweb.freebsd.org/changeset/base/263768 Log: Revert r263638 (create /root dataset) for now as it breaks install and needs more work in cases such as single-user mode. Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Wed Mar 26 10:17:17 2014 (r263767) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Wed Mar 26 13:41:30 2014 (r263768) @@ -129,8 +129,6 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATA # Home directories separated so they are common to all BEs /usr/home # NB: /home is a symlink to /usr/home - /root mountpoint=/root - # Ports tree /usr/ports compression=lz4,setuid=off From owner-svn-src-head@FreeBSD.ORG Wed Mar 26 17:40:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D08252EE; Wed, 26 Mar 2014 17:40:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE12814C; Wed, 26 Mar 2014 17:40:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2QHeDM3001551; Wed, 26 Mar 2014 17:40:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2QHeDwm001550; Wed, 26 Mar 2014 17:40:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201403261740.s2QHeDwm001550@svn.freebsd.org> From: John Baldwin Date: Wed, 26 Mar 2014 17:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263772 - head/sys/x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 17:40:13 -0000 Author: jhb Date: Wed Mar 26 17:40:13 2014 New Revision: 263772 URL: http://svnweb.freebsd.org/changeset/base/263772 Log: Fix build without SMP. PR: kern/187854 MFC after: 1 week Modified: head/sys/x86/xen/hvm.c Modified: head/sys/x86/xen/hvm.c ============================================================================== --- head/sys/x86/xen/hvm.c Wed Mar 26 17:00:37 2014 (r263771) +++ head/sys/x86/xen/hvm.c Wed Mar 26 17:40:13 2014 (r263772) @@ -71,9 +71,9 @@ static driver_filter_t xen_ipi_bitmap_ha static driver_filter_t xen_cpustop_handler; static driver_filter_t xen_cpususpend_handler; static driver_filter_t xen_cpustophard_handler; -#endif static void xen_ipi_vectored(u_int vector, int dest); static void xen_hvm_cpu_resume(void); +#endif static void xen_hvm_cpu_init(void); /*---------------------------- Extern Declarations ---------------------------*/ @@ -106,11 +106,13 @@ struct xen_ipi_handler /*-------------------------------- Global Data -------------------------------*/ enum xen_domain_type xen_domain_type = XEN_NATIVE; +#ifdef SMP struct cpu_ops xen_hvm_cpu_ops = { .ipi_vectored = lapic_ipi_vectored, .cpu_init = xen_hvm_cpu_init, .cpu_resume = xen_hvm_cpu_resume }; +#endif static MALLOC_DEFINE(M_XENHVM, "xen_hvm", "Xen HVM PV Support"); @@ -551,7 +553,9 @@ xen_hvm_init(enum xen_hvm_init_type init } setup_xen_features(); +#ifdef SMP cpu_ops = xen_hvm_cpu_ops; +#endif break; case XEN_HVM_INIT_RESUME: if (error != 0) From owner-svn-src-head@FreeBSD.ORG Wed Mar 26 19:31:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68DFAB5B; Wed, 26 Mar 2014 19:31:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 554EBFCB; Wed, 26 Mar 2014 19:31:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2QJVYhv049201; Wed, 26 Mar 2014 19:31:34 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2QJVXgt049099; Wed, 26 Mar 2014 19:31:33 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403261931.s2QJVXgt049099@svn.freebsd.org> From: Dimitry Andric Date: Wed, 26 Mar 2014 19:31:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263774 - in head: contrib/libstdc++/include/bits sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 19:31:34 -0000 Author: dim Date: Wed Mar 26 19:31:33 2014 New Revision: 263774 URL: http://svnweb.freebsd.org/changeset/base/263774 Log: Revert r263694, and apply a better fix to squelch unnecessary warnings from clang about possible keywords being treated as identifiers for the remainder of the translation unit (a.k.a. -Wkeyword-compat), when using libstdc++ in combination with -Wsystem-headers. This will not only fix devd, but any C++ program using libstdc++. MFC after: 3 days X-MFC-With: r263694 Modified: head/contrib/libstdc++/include/bits/cpp_type_traits.h head/sbin/devd/Makefile Modified: head/contrib/libstdc++/include/bits/cpp_type_traits.h ============================================================================== --- head/contrib/libstdc++/include/bits/cpp_type_traits.h Wed Mar 26 17:43:24 2014 (r263773) +++ head/contrib/libstdc++/include/bits/cpp_type_traits.h Wed Mar 26 19:31:33 2014 (r263774) @@ -80,6 +80,13 @@ _GLIBCXX_END_NAMESPACE _GLIBCXX_BEGIN_NAMESPACE(std) +#ifdef __clang__ +// When using clang, suppress warnings about possible keywords (such as +// __is_void, __is_pod, etc) being used as identifiers. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-compat" +#endif + namespace __detail { // NB: g++ can not compile these if declared within the class @@ -398,6 +405,10 @@ namespace __detail }; #endif +#ifdef __clang__ +#pragma clang diagnostic pop +#endif + _GLIBCXX_END_NAMESPACE #endif //_CPP_TYPE_TRAITS_H Modified: head/sbin/devd/Makefile ============================================================================== --- head/sbin/devd/Makefile Wed Mar 26 17:43:24 2014 (r263773) +++ head/sbin/devd/Makefile Wed Mar 26 19:31:33 2014 (r263774) @@ -13,7 +13,6 @@ LDADD= -ll -lutil YFLAGS+=-v CFLAGS+=-I. -I${.CURDIR} -CFLAGS.clang+=-Wno-keyword-compat CLEANFILES= y.output From owner-svn-src-head@FreeBSD.ORG Wed Mar 26 19:57:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE3D8430; Wed, 26 Mar 2014 19:57:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA8972C9; Wed, 26 Mar 2014 19:57:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2QJvoob058473; Wed, 26 Mar 2014 19:57:50 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2QJvoW6058472; Wed, 26 Mar 2014 19:57:50 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403261957.s2QJvoW6058472@svn.freebsd.org> From: Dimitry Andric Date: Wed, 26 Mar 2014 19:57:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263775 - head/contrib/gcclibs/libcpp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 19:57:50 -0000 Author: dim Date: Wed Mar 26 19:57:50 2014 New Revision: 263775 URL: http://svnweb.freebsd.org/changeset/base/263775 Log: Avoid "cc1: warning: is shorter than expected" when using GNU cpp in combination with dtrace scripts, which have "#!/usr/sbin/dtrace -Cs" shebang lines. This is because dtrace positions the file pointer after the shebang line, before passing the file to GNU cpp. To fix the warning, adjust the size downwards by the current position, after a bit of sanity checking. Suggested by: avg MFC after: 1 week Modified: head/contrib/gcclibs/libcpp/files.c Modified: head/contrib/gcclibs/libcpp/files.c ============================================================================== --- head/contrib/gcclibs/libcpp/files.c Wed Mar 26 19:31:33 2014 (r263774) +++ head/contrib/gcclibs/libcpp/files.c Wed Mar 26 19:57:50 2014 (r263775) @@ -546,6 +546,7 @@ static bool read_file_guts (cpp_reader *pfile, _cpp_file *file) { ssize_t size, total, count; + off_t offset; uchar *buf; bool regular; @@ -573,6 +574,21 @@ read_file_guts (cpp_reader *pfile, _cpp_ } size = file->st.st_size; + + if ((offset = lseek(file->fd, 0, SEEK_CUR)) < 0) + { + cpp_error (pfile, CPP_DL_ERROR, "%s has no current position", + file->path); + return false; + } + else if (offset > INTTYPE_MAXIMUM (ssize_t) || (ssize_t)offset > size) + { + cpp_error (pfile, CPP_DL_ERROR, "current position of %s is too large", + file->path); + return false; + } + + size -= (ssize_t)offset; } else /* 8 kilobytes is a sensible starting size. It ought to be bigger From owner-svn-src-head@FreeBSD.ORG Wed Mar 26 20:43:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D58AD944; Wed, 26 Mar 2014 20:43:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2111A39; Wed, 26 Mar 2014 20:43:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2QKhfxZ078840; Wed, 26 Mar 2014 20:43:41 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2QKhefB078835; Wed, 26 Mar 2014 20:43:40 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201403262043.s2QKhefB078835@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 26 Mar 2014 20:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263777 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 20:43:41 -0000 Author: jilles Date: Wed Mar 26 20:43:40 2014 New Revision: 263777 URL: http://svnweb.freebsd.org/changeset/base/263777 Log: sh: Fix possible memory leaks and double frees with unexpected SIGINT. Modified: head/bin/sh/alias.c head/bin/sh/exec.c head/bin/sh/expand.c head/bin/sh/redir.c head/bin/sh/var.c Modified: head/bin/sh/alias.c ============================================================================== --- head/bin/sh/alias.c Wed Mar 26 20:10:07 2014 (r263776) +++ head/bin/sh/alias.c Wed Mar 26 20:43:40 2014 (r263777) @@ -180,6 +180,7 @@ printaliases(void) int i, j; struct alias **sorted, *ap; + INTOFF; sorted = ckmalloc(aliases * sizeof(*sorted)); j = 0; for (i = 0; i < ATABSIZE; i++) @@ -187,9 +188,13 @@ printaliases(void) if (*ap->name != '\0') sorted[j++] = ap; qsort(sorted, aliases, sizeof(*sorted), comparealiases); - for (i = 0; i < aliases; i++) + for (i = 0; i < aliases; i++) { printalias(sorted[i]); + if (int_pending()) + break; + } ckfree(sorted); + INTON; } int Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Wed Mar 26 20:10:07 2014 (r263776) +++ head/bin/sh/exec.c Wed Mar 26 20:43:40 2014 (r263777) @@ -612,6 +612,7 @@ defun(const char *name, union node *func /* * Delete a function if it exists. + * Called with interrupts off. */ int Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Wed Mar 26 20:10:07 2014 (r263776) +++ head/bin/sh/expand.c Wed Mar 26 20:43:40 2014 (r263777) @@ -956,6 +956,7 @@ recordregion(int start, int end, int inq { struct ifsregion *ifsp; + INTOFF; if (ifslastp == NULL) { ifsp = &ifsfirst; } else { @@ -963,6 +964,7 @@ recordregion(int start, int end, int inq && ifslastp->inquotes == inquotes) { /* extend previous area */ ifslastp->endoff = end; + INTON; return; } ifsp = (struct ifsregion *)ckmalloc(sizeof (struct ifsregion)); @@ -973,6 +975,7 @@ recordregion(int start, int end, int inq ifslastp->begoff = start; ifslastp->endoff = end; ifslastp->inquotes = inquotes; + INTON; } Modified: head/bin/sh/redir.c ============================================================================== --- head/bin/sh/redir.c Wed Mar 26 20:10:07 2014 (r263776) +++ head/bin/sh/redir.c Wed Mar 26 20:43:40 2014 (r263777) @@ -92,6 +92,13 @@ static int openhere(union node *); * undone by calling popredir. If the REDIR_BACKQ flag is set, then the * standard output, and the standard error if it becomes a duplicate of * stdout, is saved in memory. +* + * We suppress interrupts so that we won't leave open file + * descriptors around. Because the signal handler remains + * installed and we do not use system call restart, interrupts + * will still abort blocking opens such as fifos (they will fail + * with EINTR). There is, however, a race condition if an interrupt + * arrives after INTOFF and before open blocks. */ void @@ -103,6 +110,7 @@ redirect(union node *redir, int flags) int fd; char memory[10]; /* file descriptors to write to memory */ + INTOFF; for (i = 10 ; --i >= 0 ; ) memory[i] = 0; memory[1] = flags & REDIR_BACKQ; @@ -139,11 +147,14 @@ redirect(union node *redir, int flags) INTON; } openredirect(n, memory); + INTON; + INTOFF; } if (memory[1]) out1 = &memout; if (memory[2]) out2 = &memout; + INTON; } @@ -156,15 +167,6 @@ openredirect(union node *redir, char mem int f; int e; - /* - * We suppress interrupts so that we won't leave open file - * descriptors around. Because the signal handler remains - * installed and we do not use system call restart, interrupts - * will still abort blocking opens such as fifos (they will fail - * with EINTR). There is, however, a race condition if an interrupt - * arrives after INTOFF and before open blocks. - */ - INTOFF; memory[fd] = 0; switch (redir->nfile.type) { case NFROM: @@ -237,7 +239,6 @@ movefd: default: abort(); } - INTON; } Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Wed Mar 26 20:10:07 2014 (r263776) +++ head/bin/sh/var.c Wed Mar 26 20:43:40 2014 (r263777) @@ -249,6 +249,7 @@ setvar(const char *name, const char *val vallen = strlen(val); len += vallen; } + INTOFF; nameeq = ckmalloc(len); memcpy(nameeq, name, namelen); nameeq[namelen] = '='; @@ -257,6 +258,7 @@ setvar(const char *name, const char *val else nameeq[namelen + 1] = '\0'; setvareq(nameeq, flags); + INTON; } static int @@ -289,6 +291,7 @@ change_env(const char *s, int set) char *eqp; char *ss; + INTOFF; ss = savestr(s); if ((eqp = strchr(ss, '=')) != NULL) *eqp = '\0'; @@ -297,6 +300,7 @@ change_env(const char *s, int set) else (void) unsetenv(ss); ckfree(ss); + INTON; return; } @@ -359,13 +363,13 @@ setvareq(char *s, int flags) /* not found */ if (flags & VNOSET) return; + INTOFF; vp = ckmalloc(sizeof (*vp)); vp->flags = flags; vp->text = s; vp->name_len = nlen; vp->next = *vpp; vp->func = NULL; - INTOFF; *vpp = vp; if ((vp->flags & VEXPORT) && localevar(s)) { change_env(s, 1); @@ -773,6 +777,7 @@ poplocalvars(void) struct localvar *lvp; struct var *vp; + INTOFF; while ((lvp = localvars) != NULL) { localvars = lvp->next; vp = lvp->vp; @@ -790,6 +795,7 @@ poplocalvars(void) } ckfree(lvp); } + INTON; } @@ -828,18 +834,21 @@ unsetcmd(int argc __unused, char **argv if (flg_func == 0 && flg_var == 0) flg_var = 1; + INTOFF; for (ap = argptr; *ap ; ap++) { if (flg_func) ret |= unsetfunc(*ap); if (flg_var) ret |= unsetvar(*ap); } + INTON; return ret; } /* * Unset the specified variable. + * Called with interrupts off. */ int @@ -853,7 +862,6 @@ unsetvar(const char *s) return (0); if (vp->flags & VREADONLY) return (1); - INTOFF; if (vp->text[vp->name_len + 1] != '\0') setvar(s, nullstr, 0); if ((vp->flags & VEXPORT) && localevar(vp->text)) { @@ -869,7 +877,6 @@ unsetvar(const char *s) *vpp = vp->next; ckfree(vp); } - INTON; return (0); } From owner-svn-src-head@FreeBSD.ORG Wed Mar 26 22:30:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E17A7861; Wed, 26 Mar 2014 22:30:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD4A86BC; Wed, 26 Mar 2014 22:30:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2QMUeZ9021951; Wed, 26 Mar 2014 22:30:40 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2QMUdH6021943; Wed, 26 Mar 2014 22:30:39 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403262230.s2QMUdH6021943@svn.freebsd.org> From: Dimitry Andric Date: Wed, 26 Mar 2014 22:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263778 - in head: bin lib lib/clang sbin share/mk usr.bin usr.sbin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 22:30:41 -0000 Author: dim Date: Wed Mar 26 22:30:38 2014 New Revision: 263778 URL: http://svnweb.freebsd.org/changeset/base/263778 Log: Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to process all the SUBDIR entries in parallel, instead of serially. Apply this option to a selected number of Makefiles, which can greatly speed up the build on multi-core machines, when using make -j. This can be extended to more Makefiles later on, whenever they are verified to work correctly with parallel building. I tested this on a 24-core machine, with make -j48 buildworld (N = 6): before stddev after stddev ======= ====== ======= ====== real time 1741.1 16.5 959.8 2.7 user time 12468.7 16.4 14393.0 16.8 sys time 1825.0 54.8 2110.6 22.8 (user+sys)/real 8.2 17.1 E.g. the build was approximately 45% faster in real time. On machines with less cores, or with lower -j settings, the speedup will not be as impressive. But at least you can now almost max out a machine with buildworld! Submitted by: jilles MFC after: 2 weeks Modified: head/bin/Makefile head/lib/Makefile head/lib/clang/Makefile head/sbin/Makefile head/share/mk/bsd.subdir.mk head/usr.bin/Makefile head/usr.sbin/Makefile Modified: head/bin/Makefile ============================================================================== --- head/bin/Makefile Wed Mar 26 20:43:40 2014 (r263777) +++ head/bin/Makefile Wed Mar 26 22:30:38 2014 (r263778) @@ -60,4 +60,6 @@ SUBDIR+= tests SUBDIR:= ${SUBDIR:O} +SUBDIR_PARALLEL= + .include Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Wed Mar 26 20:43:40 2014 (r263777) +++ head/lib/Makefile Wed Mar 26 22:30:38 2014 (r263778) @@ -276,4 +276,8 @@ afterinstall: ${INSTALL_SYMLINK} ../include ${DESTDIR}/usr/lib/include .endif +.if !make(install) +SUBDIR_PARALLEL= +.endif + .include Modified: head/lib/clang/Makefile ============================================================================== --- head/lib/clang/Makefile Wed Mar 26 20:43:40 2014 (r263777) +++ head/lib/clang/Makefile Wed Mar 26 22:30:38 2014 (r263778) @@ -147,4 +147,6 @@ SUBDIR+=liblldb \ SUBDIR+= include +SUBDIR_PARALLEL= + .include Modified: head/sbin/Makefile ============================================================================== --- head/sbin/Makefile Wed Mar 26 20:43:40 2014 (r263777) +++ head/sbin/Makefile Wed Mar 26 22:30:38 2014 (r263778) @@ -126,4 +126,6 @@ SUBDIR+= tests SUBDIR:= ${SUBDIR:O} +SUBDIR_PARALLEL= + .include Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Wed Mar 26 20:43:40 2014 (r263777) +++ head/share/mk/bsd.subdir.mk Wed Mar 26 22:30:38 2014 (r263778) @@ -71,7 +71,26 @@ ${SUBDIR}: .PHONY .MAKE .for __target in all all-man checkdpadd clean cleandepend cleandir \ cleanilinks depend distribute lint maninstall manlint obj objlink \ realinstall regress tags ${SUBDIR_TARGETS} +.ifdef SUBDIR_PARALLEL +.for __dir in ${SUBDIR} +${__target}: ${__target}_subdir_${__dir} +${__target}_subdir_${__dir}: .MAKE + @${_+_}set -e; \ + if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ + ${ECHODIR} "===> ${DIRPRFX}${__dir}.${MACHINE_ARCH} (${__target:realinstall=install})"; \ + edir=${__dir}.${MACHINE_ARCH}; \ + cd ${.CURDIR}/$${edir}; \ + else \ + ${ECHODIR} "===> ${DIRPRFX}${__dir} (${__target:realinstall=install})"; \ + edir=${__dir}; \ + cd ${.CURDIR}/$${edir}; \ + fi; \ + ${MAKE} ${__target:realinstall=install} \ + DIRPRFX=${DIRPRFX}$$edir/ +.endfor +.else ${__target}: _SUBDIR +.endif .endfor .for __target in files includes Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Wed Mar 26 20:43:40 2014 (r263777) +++ head/usr.bin/Makefile Wed Mar 26 22:30:38 2014 (r263778) @@ -379,4 +379,6 @@ SUBDIR+= svn SUBDIR:= ${SUBDIR:O} +SUBDIR_PARALLEL= + .include Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Wed Mar 26 20:43:40 2014 (r263777) +++ head/usr.sbin/Makefile Wed Mar 26 22:30:38 2014 (r263778) @@ -320,4 +320,6 @@ SUBDIR+= wpa SUBDIR:= ${SUBDIR:O} +SUBDIR_PARALLEL= + .include From owner-svn-src-head@FreeBSD.ORG Wed Mar 26 22:46:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFFBDFA6; Wed, 26 Mar 2014 22:46:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B09CD85C; Wed, 26 Mar 2014 22:46:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2QMk4Ck029173; Wed, 26 Mar 2014 22:46:04 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2QMk4Nk029170; Wed, 26 Mar 2014 22:46:04 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201403262246.s2QMk4Nk029170@svn.freebsd.org> From: Alan Somers Date: Wed, 26 Mar 2014 22:46:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263779 - in head: sys/netinet tests/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 22:46:05 -0000 Author: asomers Date: Wed Mar 26 22:46:03 2014 New Revision: 263779 URL: http://svnweb.freebsd.org/changeset/base/263779 Log: Correct ARP update handling when the routes for network interfaces are restricted to a single FIB in a multifib system. Restricting an interface's routes to the FIB to which it is assigned (by setting net.add_addr_allfibs=0) causes ARP updates to fail with "arpresolve: can't allocate llinfo for x.x.x.x". This is due to the ARP update code hard coding it's lookup for existing routing entries to FIB 0. sys/netinet/in.c: When dealing with RTM_ADD (add route) requests for an interface, use the interface's assigned FIB instead of the default (FIB 0). sys/netinet/if_ether.c: In arpresolve(), enhance error message generated when an lla_lookup() fails so that the interface causing the error is visible in logs. tests/sys/netinet/fibs_test.sh Clear ATF expected error. PR: kern/167947 Submitted by: Nikolay Denev (previous version) Reviewed by: melifaro MFC after: 3 weeks Sponsored by: Spectra Logic Corporation Modified: head/sys/netinet/if_ether.c head/sys/netinet/in.c head/tests/sys/netinet/fibs_test.sh Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Wed Mar 26 22:30:38 2014 (r263778) +++ head/sys/netinet/if_ether.c Wed Mar 26 22:46:03 2014 (r263779) @@ -334,8 +334,8 @@ retry: if (la == NULL) { if (flags & LLE_CREATE) log(LOG_DEBUG, - "arpresolve: can't allocate llinfo for %s\n", - inet_ntoa(SIN(dst)->sin_addr)); + "arpresolve: can't allocate llinfo for %s on %s\n", + inet_ntoa(SIN(dst)->sin_addr), ifp->if_xname); m_freem(m); return (EINVAL); } Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Wed Mar 26 22:30:38 2014 (r263778) +++ head/sys/netinet/in.c Wed Mar 26 22:46:03 2014 (r263779) @@ -994,8 +994,9 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ KASSERT(l3addr->sa_family == AF_INET, ("sin_family %d", l3addr->sa_family)); - /* XXX rtalloc1 should take a const param */ - rt = rtalloc1(__DECONST(struct sockaddr *, l3addr), 0, 0); + /* XXX rtalloc1_fib should take a const param */ + rt = rtalloc1_fib(__DECONST(struct sockaddr *, l3addr), 0, 0, + ifp->if_fib); if (rt == NULL) return (EINVAL); Modified: head/tests/sys/netinet/fibs_test.sh ============================================================================== --- head/tests/sys/netinet/fibs_test.sh Wed Mar 26 22:30:38 2014 (r263778) +++ head/tests/sys/netinet/fibs_test.sh Wed Mar 26 22:46:03 2014 (r263779) @@ -55,7 +55,6 @@ arpresolve_checks_interface_fib_head() } arpresolve_checks_interface_fib_body() { - atf_expect_fail "kern/167947 arpresolve checks only the default FIB for the interface route" # Configure the TAP interfaces to use a RFC5737 nonrouteable addresses # and a non-default fib ADDR0="192.0.2.2" From owner-svn-src-head@FreeBSD.ORG Wed Mar 26 23:34:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9420DC21; Wed, 26 Mar 2014 23:34:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7428CC2E; Wed, 26 Mar 2014 23:34:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2QNYT2H049393; Wed, 26 Mar 2014 23:34:29 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2QNYRTl049381; Wed, 26 Mar 2014 23:34:27 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201403262334.s2QNYRTl049381@svn.freebsd.org> From: Neel Natu Date: Wed, 26 Mar 2014 23:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263780 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/amd sys/amd64/vmm/intel usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2014 23:34:29 -0000 Author: neel Date: Wed Mar 26 23:34:27 2014 New Revision: 263780 URL: http://svnweb.freebsd.org/changeset/base/263780 Log: Add an ioctl to suspend a virtual machine (VM_SUSPEND). The ioctl can be called from any context i.e., it is not required to be called from a vcpu thread. The ioctl simply sets a state variable 'vm->suspend' to '1' and returns. The vcpus inspect 'vm->suspend' in the run loop and if it is set to '1' the vcpu breaks out of the loop with a reason of 'VM_EXITCODE_SUSPENDED'. The suspend handler waits until all 'vm->active_cpus' have transitioned to 'vm->suspended_cpus' before returning to userspace. Discussed with: grehan Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/amd/amdv.c head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_dev.c head/usr.sbin/bhyve/bhyverun.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Wed Mar 26 22:46:03 2014 (r263779) +++ head/lib/libvmmapi/vmmapi.c Wed Mar 26 23:34:27 2014 (r263780) @@ -342,6 +342,13 @@ vm_run(struct vmctx *ctx, int vcpu, uint return (error); } +int +vm_suspend(struct vmctx *ctx) +{ + + return (ioctl(ctx->fd, VM_SUSPEND, 0)); +} + static int vm_inject_exception_real(struct vmctx *ctx, int vcpu, int vector, int error_code, int error_code_valid) Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Wed Mar 26 22:46:03 2014 (r263779) +++ head/lib/libvmmapi/vmmapi.h Wed Mar 26 23:34:27 2014 (r263780) @@ -61,6 +61,7 @@ int vm_set_register(struct vmctx *ctx, i int vm_get_register(struct vmctx *ctx, int vcpu, int reg, uint64_t *retval); int vm_run(struct vmctx *ctx, int vcpu, uint64_t rip, struct vm_exit *ret_vmexit); +int vm_suspend(struct vmctx *ctx); int vm_apicid2vcpu(struct vmctx *ctx, int apicid); int vm_inject_exception(struct vmctx *ctx, int vcpu, int vec); int vm_inject_exception2(struct vmctx *ctx, int vcpu, int vec, int errcode); Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Wed Mar 26 22:46:03 2014 (r263779) +++ head/sys/amd64/include/vmm.h Wed Mar 26 23:34:27 2014 (r263780) @@ -53,7 +53,8 @@ typedef int (*vmm_cleanup_func_t)(void); typedef void (*vmm_resume_func_t)(void); typedef void * (*vmi_init_func_t)(struct vm *vm, struct pmap *pmap); typedef int (*vmi_run_func_t)(void *vmi, int vcpu, register_t rip, - struct pmap *pmap, void *rendezvous_cookie); + struct pmap *pmap, void *rendezvous_cookie, + void *suspend_cookie); typedef void (*vmi_cleanup_func_t)(void *vmi); typedef int (*vmi_get_register_t)(void *vmi, int vcpu, int num, uint64_t *retval); @@ -114,6 +115,7 @@ int vm_get_seg_desc(struct vm *vm, int v int vm_set_seg_desc(struct vm *vm, int vcpu, int reg, struct seg_desc *desc); int vm_run(struct vm *vm, struct vm_run *vmrun); +int vm_suspend(struct vm *vm); int vm_inject_nmi(struct vm *vm, int vcpu); int vm_nmi_pending(struct vm *vm, int vcpuid); void vm_nmi_clear(struct vm *vm, int vcpuid); @@ -158,6 +160,13 @@ vcpu_rendezvous_pending(void *rendezvous return (*(uintptr_t *)rendezvous_cookie != 0); } +static __inline int +vcpu_suspended(void *suspend_cookie) +{ + + return (*(int *)suspend_cookie); +} + /* * Return 1 if device indicated by bus/slot/func is supposed to be a * pci passthrough device. @@ -311,6 +320,7 @@ enum vm_exitcode { VM_EXITCODE_SPINDOWN_CPU, VM_EXITCODE_RENDEZVOUS, VM_EXITCODE_IOAPIC_EOI, + VM_EXITCODE_SUSPENDED, VM_EXITCODE_MAX }; Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Wed Mar 26 22:46:03 2014 (r263779) +++ head/sys/amd64/include/vmm_dev.h Wed Mar 26 23:34:27 2014 (r263780) @@ -165,6 +165,7 @@ enum { IOCNUM_RUN = 1, IOCNUM_SET_CAPABILITY = 2, IOCNUM_GET_CAPABILITY = 3, + IOCNUM_SUSPEND = 4, /* memory apis */ IOCNUM_MAP_MEMORY = 10, @@ -212,6 +213,8 @@ enum { #define VM_RUN \ _IOWR('v', IOCNUM_RUN, struct vm_run) +#define VM_SUSPEND \ + _IO('v', IOCNUM_SUSPEND) #define VM_MAP_MEMORY \ _IOWR('v', IOCNUM_MAP_MEMORY, struct vm_memory_segment) #define VM_GET_MEMORY_SEG \ Modified: head/sys/amd64/vmm/amd/amdv.c ============================================================================== --- head/sys/amd64/vmm/amd/amdv.c Wed Mar 26 22:46:03 2014 (r263779) +++ head/sys/amd64/vmm/amd/amdv.c Wed Mar 26 23:34:27 2014 (r263780) @@ -67,7 +67,8 @@ amdv_vminit(struct vm *vm, struct pmap * } static int -amdv_vmrun(void *arg, int vcpu, register_t rip, struct pmap *pmap, void *cookie) +amdv_vmrun(void *arg, int vcpu, register_t rip, struct pmap *pmap, + void *rptr, void *sptr) { printf("amdv_vmrun: not implemented\n"); Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Wed Mar 26 22:46:03 2014 (r263779) +++ head/sys/amd64/vmm/intel/vmx.c Wed Mar 26 23:34:27 2014 (r263780) @@ -2038,6 +2038,16 @@ vmx_exit_rendezvous(struct vmx *vmx, int } static __inline int +vmx_exit_suspended(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) +{ + + vmexit->rip = vmcs_guest_rip(); + vmexit->inst_length = 0; + vmexit->exitcode = VM_EXITCODE_SUSPENDED; + return (UNHANDLED); +} + +static __inline int vmx_exit_inst_error(struct vmxctx *vmxctx, int rc, struct vm_exit *vmexit) { @@ -2097,7 +2107,7 @@ vmx_exit_handle_nmi(struct vmx *vmx, int static int vmx_run(void *arg, int vcpu, register_t startrip, pmap_t pmap, - void *rendezvous_cookie) + void *rendezvous_cookie, void *suspend_cookie) { int rc, handled, launched; struct vmx *vmx; @@ -2154,9 +2164,9 @@ vmx_run(void *arg, int vcpu, register_t * pmap_invalidate_ept(). */ disable_intr(); - if (curthread->td_flags & (TDF_ASTPENDING | TDF_NEEDRESCHED)) { + if (vcpu_suspended(suspend_cookie)) { enable_intr(); - handled = vmx_exit_astpending(vmx, vcpu, vmexit); + handled = vmx_exit_suspended(vmx, vcpu, vmexit); break; } @@ -2166,6 +2176,12 @@ vmx_run(void *arg, int vcpu, register_t break; } + if (curthread->td_flags & (TDF_ASTPENDING | TDF_NEEDRESCHED)) { + enable_intr(); + handled = vmx_exit_astpending(vmx, vcpu, vmexit); + break; + } + vmx_inject_interrupts(vmx, vcpu, vlapic); vmx_run_trace(vmx, vcpu); rc = vmx_enter_guest(vmxctx, vmx, launched); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Wed Mar 26 22:46:03 2014 (r263779) +++ head/sys/amd64/vmm/vmm.c Wed Mar 26 23:34:27 2014 (r263780) @@ -139,6 +139,9 @@ struct vm { cpuset_t rendezvous_done_cpus; void *rendezvous_arg; vm_rendezvous_func_t rendezvous_func; + + int suspend; + volatile cpuset_t suspended_cpus; }; static int vmm_initialized; @@ -149,8 +152,8 @@ static struct vmm_ops *ops; #define VMM_RESUME() (ops != NULL ? (*ops->resume)() : 0) #define VMINIT(vm, pmap) (ops != NULL ? (*ops->vminit)(vm, pmap): NULL) -#define VMRUN(vmi, vcpu, rip, pmap, rptr) \ - (ops != NULL ? (*ops->vmrun)(vmi, vcpu, rip, pmap, rptr) : ENXIO) +#define VMRUN(vmi, vcpu, rip, pmap, rptr, sptr) \ + (ops != NULL ? (*ops->vmrun)(vmi, vcpu, rip, pmap, rptr, sptr) : ENXIO) #define VMCLEANUP(vmi) (ops != NULL ? (*ops->vmcleanup)(vmi) : NULL) #define VMSPACE_ALLOC(min, max) \ (ops != NULL ? (*ops->vmspace_alloc)(min, max) : NULL) @@ -1019,7 +1022,8 @@ vm_handle_hlt(struct vm *vm, int vcpuid, * These interrupts could have happened any time after we * returned from VMRUN() and before we grabbed the vcpu lock. */ - if (!vm_nmi_pending(vm, vcpuid) && + if (vm->rendezvous_func == NULL && + !vm_nmi_pending(vm, vcpuid) && (intr_disabled || !vlapic_pending_intr(vcpu->vlapic, NULL))) { t = ticks; vcpu_require_state_locked(vcpu, VCPU_SLEEPING); @@ -1152,6 +1156,71 @@ vm_handle_inst_emul(struct vm *vm, int v return (error); } +static int +vm_handle_suspend(struct vm *vm, int vcpuid, bool *retu) +{ + int i, done; + struct vcpu *vcpu; + + done = 0; + vcpu = &vm->vcpu[vcpuid]; + + CPU_SET_ATOMIC(vcpuid, &vm->suspended_cpus); + + /* + * Wait until all 'active_cpus' have suspended themselves. + * + * Since a VM may be suspended at any time including when one or + * more vcpus are doing a rendezvous we need to call the rendezvous + * handler while we are waiting to prevent a deadlock. + */ + vcpu_lock(vcpu); + while (1) { + if (CPU_CMP(&vm->suspended_cpus, &vm->active_cpus) == 0) { + VCPU_CTR0(vm, vcpuid, "All vcpus suspended"); + break; + } + + if (vm->rendezvous_func == NULL) { + VCPU_CTR0(vm, vcpuid, "Sleeping during suspend"); + vcpu_require_state_locked(vcpu, VCPU_SLEEPING); + msleep_spin(vcpu, &vcpu->mtx, "vmsusp", hz); + vcpu_require_state_locked(vcpu, VCPU_FROZEN); + } else { + VCPU_CTR0(vm, vcpuid, "Rendezvous during suspend"); + vcpu_unlock(vcpu); + vm_handle_rendezvous(vm, vcpuid); + vcpu_lock(vcpu); + } + } + vcpu_unlock(vcpu); + + /* + * Wakeup the other sleeping vcpus and return to userspace. + */ + for (i = 0; i < VM_MAXCPU; i++) { + if (CPU_ISSET(i, &vm->suspended_cpus)) { + vcpu_notify_event(vm, i, false); + } + } + + *retu = true; + return (0); +} + +int +vm_suspend(struct vm *vm) +{ + + if (atomic_cmpset_int(&vm->suspend, 0, 1)) { + VM_CTR0(vm, "virtual machine suspended"); + return (0); + } else { + VM_CTR0(vm, "virtual machine already suspended"); + return (EALREADY); + } +} + int vm_run(struct vm *vm, struct vm_run *vmrun) { @@ -1162,12 +1231,15 @@ vm_run(struct vm *vm, struct vm_run *vmr struct vm_exit *vme; bool retu, intr_disabled; pmap_t pmap; + void *rptr, *sptr; vcpuid = vmrun->cpuid; if (vcpuid < 0 || vcpuid >= VM_MAXCPU) return (EINVAL); + rptr = &vm->rendezvous_func; + sptr = &vm->suspend; pmap = vmspace_pmap(vm->vmspace); vcpu = &vm->vcpu[vcpuid]; vme = &vcpu->exitinfo; @@ -1187,7 +1259,7 @@ restart: restore_guest_fpustate(vcpu); vcpu_require_state(vm, vcpuid, VCPU_RUNNING); - error = VMRUN(vm->cookie, vcpuid, rip, pmap, &vm->rendezvous_func); + error = VMRUN(vm->cookie, vcpuid, rip, pmap, rptr, sptr); vcpu_require_state(vm, vcpuid, VCPU_FROZEN); save_guest_fpustate(vcpu); @@ -1200,6 +1272,9 @@ restart: if (error == 0) { retu = false; switch (vme->exitcode) { + case VM_EXITCODE_SUSPENDED: + error = vm_handle_suspend(vm, vcpuid, &retu); + break; case VM_EXITCODE_IOAPIC_EOI: vioapic_process_eoi(vm, vcpuid, vme->u.ioapic_eoi.vector); Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Wed Mar 26 22:46:03 2014 (r263779) +++ head/sys/amd64/vmm/vmm_dev.c Wed Mar 26 23:34:27 2014 (r263780) @@ -239,6 +239,9 @@ vmmdev_ioctl(struct cdev *cdev, u_long c vmrun = (struct vm_run *)data; error = vm_run(sc->vm, vmrun); break; + case VM_SUSPEND: + error = vm_suspend(sc->vm); + break; case VM_STAT_DESC: { statdesc = (struct vm_stat_desc *)data; error = vmm_stat_desc_copy(statdesc->index, Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Wed Mar 26 22:46:03 2014 (r263779) +++ head/usr.sbin/bhyve/bhyverun.c Wed Mar 26 23:34:27 2014 (r263780) @@ -463,6 +463,33 @@ vmexit_inst_emul(struct vmctx *ctx, stru return (VMEXIT_CONTINUE); } +static pthread_mutex_t resetcpu_mtx = PTHREAD_MUTEX_INITIALIZER; +static pthread_cond_t resetcpu_cond = PTHREAD_COND_INITIALIZER; +static int resetcpu = -1; + +static int +vmexit_suspend(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) +{ + + assert(resetcpu != -1); + + fbsdrun_deletecpu(ctx, *pvcpu); + + if (*pvcpu != resetcpu) { + pthread_mutex_lock(&resetcpu_mtx); + pthread_cond_signal(&resetcpu_cond); + pthread_mutex_unlock(&resetcpu_mtx); + pthread_exit(NULL); + } + + pthread_mutex_lock(&resetcpu_mtx); + while (!CPU_EMPTY(&cpumask)) { + pthread_cond_wait(&resetcpu_cond, &resetcpu_mtx); + } + pthread_mutex_unlock(&resetcpu_mtx); + exit(0); +} + static vmexit_handler_t handler[VM_EXITCODE_MAX] = { [VM_EXITCODE_INOUT] = vmexit_inout, [VM_EXITCODE_VMX] = vmexit_vmx, @@ -473,6 +500,7 @@ static vmexit_handler_t handler[VM_EXITC [VM_EXITCODE_INST_EMUL] = vmexit_inst_emul, [VM_EXITCODE_SPINUP_AP] = vmexit_spinup_ap, [VM_EXITCODE_SPINDOWN_CPU] = vmexit_spindown_cpu, + [VM_EXITCODE_SUSPENDED] = vmexit_suspend }; static void @@ -514,7 +542,12 @@ vm_loop(struct vmctx *ctx, int vcpu, uin rip = vmexit[vcpu].rip; break; case VMEXIT_RESET: - exit(0); + if (vm_suspend(ctx) == 0) { + assert(resetcpu == -1); + resetcpu = vcpu; + } + rip = vmexit[vcpu].rip + vmexit[vcpu].inst_length; + break; default: exit(1); } From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 06:08:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96B74A3B; Thu, 27 Mar 2014 06:08:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8379C1C6; Thu, 27 Mar 2014 06:08:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2R68773012804; Thu, 27 Mar 2014 06:08:07 GMT (envelope-from takawata@svn.freebsd.org) Received: (from takawata@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2R687hi012803; Thu, 27 Mar 2014 06:08:07 GMT (envelope-from takawata@svn.freebsd.org) Message-Id: <201403270608.s2R687hi012803@svn.freebsd.org> From: Takanori Watanabe Date: Thu, 27 Mar 2014 06:08:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263794 - head/sys/x86/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 06:08:07 -0000 Author: takawata Date: Thu Mar 27 06:08:07 2014 New Revision: 263794 URL: http://svnweb.freebsd.org/changeset/base/263794 Log: To check polarity, check ACPI_MADT_POLARITY_CONFORMS, instead of ACPI_MADT_TRIGGER_CONFORMS. PR:amd64/188010 Submitted by: syuu Modified: head/sys/x86/acpica/madt.c Modified: head/sys/x86/acpica/madt.c ============================================================================== --- head/sys/x86/acpica/madt.c Thu Mar 27 04:30:07 2014 (r263793) +++ head/sys/x86/acpica/madt.c Thu Mar 27 06:08:07 2014 (r263794) @@ -492,7 +492,7 @@ madt_parse_nmi(ACPI_MADT_NMI_SOURCE *nmi if (!(nmi->IntiFlags & ACPI_MADT_TRIGGER_CONFORMS)) ioapic_set_triggermode(ioapic, pin, interrupt_trigger(nmi->IntiFlags, 0)); - if (!(nmi->IntiFlags & ACPI_MADT_TRIGGER_CONFORMS)) + if (!(nmi->IntiFlags & ACPI_MADT_POLARITY_CONFORMS)) ioapic_set_polarity(ioapic, pin, interrupt_polarity(nmi->IntiFlags, 0)); } From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 06:36:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D6A4D7B; Thu, 27 Mar 2014 06:36:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49CA93DF; Thu, 27 Mar 2014 06:36:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2R6adFg024746; Thu, 27 Mar 2014 06:36:39 GMT (envelope-from takawata@svn.freebsd.org) Received: (from takawata@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2R6adgZ024745; Thu, 27 Mar 2014 06:36:39 GMT (envelope-from takawata@svn.freebsd.org) Message-Id: <201403270636.s2R6adgZ024745@svn.freebsd.org> From: Takanori Watanabe Date: Thu, 27 Mar 2014 06:36:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263795 - head/sys/x86/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 06:36:39 -0000 Author: takawata Date: Thu Mar 27 06:36:38 2014 New Revision: 263795 URL: http://svnweb.freebsd.org/changeset/base/263795 Log: Strict value checking will cause problem. Bay trail DN2820FYKH is supported on Linux but does not work on FreeBSD. This behaviour is bug-compatible with Linux-3.13.5. References: http://d.hatena.ne.jp/syuu1228/20140326 http://lxr.linux.no/linux+v3.13.5/arch/x86/kernel/acpi/boot.c#L1094 Submitted by: syuu Modified: head/sys/x86/acpica/madt.c Modified: head/sys/x86/acpica/madt.c ============================================================================== --- head/sys/x86/acpica/madt.c Thu Mar 27 06:08:07 2014 (r263794) +++ head/sys/x86/acpica/madt.c Thu Mar 27 06:36:38 2014 (r263795) @@ -306,10 +306,11 @@ interrupt_polarity(UINT16 IntiFlags, UIN case ACPI_MADT_POLARITY_ACTIVE_HIGH: return (INTR_POLARITY_HIGH); case ACPI_MADT_POLARITY_ACTIVE_LOW: - return (INTR_POLARITY_LOW); + break; default: - panic("Bogus Interrupt Polarity"); + printf("WARNING: Bogus Interrupt Polarity. Assume POLALITY LOW"); } + return (INTR_POLARITY_LOW); } static enum intr_trigger @@ -325,10 +326,13 @@ interrupt_trigger(UINT16 IntiFlags, UINT case ACPI_MADT_TRIGGER_EDGE: return (INTR_TRIGGER_EDGE); case ACPI_MADT_TRIGGER_LEVEL: - return (INTR_TRIGGER_LEVEL); + break; default: - panic("Bogus Interrupt Trigger Mode"); + printf("WARNING: Bogus Interrupt Trigger Mode. Assume Level trigger."); + + break; } + return (INTR_TRIGGER_LEVEL); } /* From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 07:44:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A523AF5; Thu, 27 Mar 2014 07:44:35 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03268B78; Thu, 27 Mar 2014 07:44:35 +0000 (UTC) Received: from xyf.my.dom (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s2R7iWBv077098; Thu, 27 Mar 2014 07:44:33 GMT (envelope-from davidxu@freebsd.org) Message-ID: <5333D70D.7050306@freebsd.org> Date: Thu, 27 Mar 2014 15:45:17 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r263755 - head/sys/kern References: <201403252330.s2PNUaei052956@svn.freebsd.org> In-Reply-To: <201403252330.s2PNUaei052956@svn.freebsd.org> Content-Type: multipart/mixed; boundary="------------000008090800090909020404" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 07:44:35 -0000 This is a multi-part message in MIME format. --------------000008090800090909020404 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2014/03/26 07:30, Mateusz Guzik wrote: > Author: mjg > Date: Tue Mar 25 23:30:35 2014 > New Revision: 263755 > URL: http://svnweb.freebsd.org/changeset/base/263755 > > Log: > Document a known problem with handling the process intended to receive > SIGIO in /dev/devctl. > > Suggested by: adrian > MFC after: 6 days > > Modified: > head/sys/kern/subr_bus.c > > Modified: head/sys/kern/subr_bus.c > ============================================================================== > --- head/sys/kern/subr_bus.c Tue Mar 25 23:19:45 2014 (r263754) > +++ head/sys/kern/subr_bus.c Tue Mar 25 23:30:35 2014 (r263755) > @@ -490,6 +490,21 @@ devioctl(struct cdev *dev, u_long cmd, c > devsoftc.nonblock = 0; > return (0); > case FIOASYNC: > + /* > + * FIXME: > + * Since this is a simple assignment there is no guarantee that > + * devsoftc.async_proc consumers will get a valid pointer. > + * > + * Example scenario where things break (processes A and B): > + * 1. A opens devctl > + * 2. A sends fd to B > + * 3. B sets itself as async_proc > + * 4. B exits > + * > + * However, normally this requires root privileges and the only > + * in-tree consumer does not behave in a dangerous way so the > + * issue is not critical. > + */ > if (*(int*)data) > devsoftc.async_proc = td->td_proc; > else > @@ -575,6 +590,7 @@ devctl_queue_data_f(char *data, int flag > cv_broadcast(&devsoftc.cv); > mtx_unlock(&devsoftc.mtx); > selwakeup(&devsoftc.sel); > + /* XXX see a comment in devioctl */ > p = devsoftc.async_proc; > if (p != NULL) { > PROC_LOCK(p); > > I think the async process pointer can be cleared when a process exits by registering an event handler. please see attached patch. --------------000008090800090909020404 Content-Type: text/x-patch; name="dev_sigio.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dev_sigio.patch" # HG changeset patch # Parent 53b614ff2cae108f27e4475989d3a86997017268 diff -r 53b614ff2cae sys/kern/subr_bus.c --- a/sys/kern/subr_bus.c Thu Mar 27 10:03:50 2014 +0800 +++ b/sys/kern/subr_bus.c Thu Mar 27 15:38:40 2014 +0800 @@ -54,6 +54,7 @@ #include #include #include +#include #include @@ -399,6 +400,18 @@ } devsoftc; static struct cdev *devctl_dev; +static eventhandler_tag devctl_eh; + +static void +devctl_proc_clear(void *arg, struct proc *p, struct image_params *imgp __unused) +{ + if (devsoftc.async_proc == p) { + mtx_lock(&devsoftc.mtx); + if (devsoftc.async_proc == p) + devsoftc.async_proc = NULL; + mtx_unlock(&devsoftc.mtx); + } +} static void devinit(void) @@ -408,6 +421,8 @@ mtx_init(&devsoftc.mtx, "dev mtx", "devd", MTX_DEF); cv_init(&devsoftc.cv, "dev cv"); TAILQ_INIT(&devsoftc.devq); + devctl_eh = EVENTHANDLER_REGISTER(process_exit, devctl_proc_clear, NULL, + EVENTHANDLER_PRI_ANY); } static int @@ -490,25 +505,12 @@ devsoftc.nonblock = 0; return (0); case FIOASYNC: - /* - * FIXME: - * Since this is a simple assignment there is no guarantee that - * devsoftc.async_proc consumers will get a valid pointer. - * - * Example scenario where things break (processes A and B): - * 1. A opens devctl - * 2. A sends fd to B - * 3. B sets itself as async_proc - * 4. B exits - * - * However, normally this requires root privileges and the only - * in-tree consumer does not behave in a dangerous way so the - * issue is not critical. - */ + mtx_lock(&devsoftc.mtx); if (*(int*)data) devsoftc.async_proc = td->td_proc; else devsoftc.async_proc = NULL; + mtx_unlock(&devsoftc.mtx); return (0); /* (un)Support for other fcntl() calls. */ @@ -588,15 +590,14 @@ TAILQ_INSERT_TAIL(&devsoftc.devq, n1, dei_link); devsoftc.queued++; cv_broadcast(&devsoftc.cv); - mtx_unlock(&devsoftc.mtx); selwakeup(&devsoftc.sel); - /* XXX see a comment in devioctl */ p = devsoftc.async_proc; if (p != NULL) { PROC_LOCK(p); kern_psignal(p, SIGIO); PROC_UNLOCK(p); } + mtx_unlock(&devsoftc.mtx); return; out: /* @@ -4503,7 +4504,7 @@ return (0); case MOD_SHUTDOWN: - device_shutdown(root_bus); + EVENTHANDLER_DEREGISTER(process_exit, devctl_eh); return (0); default: return (EOPNOTSUPP); --------------000008090800090909020404-- From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 08:37:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26C1B2D7; Thu, 27 Mar 2014 08:37:38 +0000 (UTC) Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com [IPv6:2a00:1450:400c:c05::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 236D0F73; Thu, 27 Mar 2014 08:37:36 +0000 (UTC) Received: by mail-wi0-f177.google.com with SMTP id cc10so2862209wib.10 for ; Thu, 27 Mar 2014 01:37:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=bEnc+uWDtge/cTZWGqxVz8encmFwq7Y25N20+zY0ons=; b=eXzCu1tPQZmdxz6K0r8FinBtnj0DutIbVH0G00TLCvZgUP16Sjh668rW+9W7xLLHf5 vMncjlHB8B0TJCYkpmQNF9Qh7KfxazlYq3NNUonW9FlL/FnmIXtftnko7TKRF1qyQnEt 1Miz38HePP/ZdtZCS5m1CMNlESpNSmUmtqoWk8blJkn0LtMOySYM+fvf5+sz09TED/jR 97Ic/S2vLS+47rFCcFa2JO5j2C4Pt1QYRR7ZjZs49g3XyPXvu96i+pdgwfwCz3MFPBWs CDbD+Ub91zxNosk8d05lluapFDcz7QZ5f+YoZRRK05a5yafF0hV+oQ/79G+/7G28WWZM 664w== X-Received: by 10.180.7.227 with SMTP id m3mr2850095wia.59.1395909455470; Thu, 27 Mar 2014 01:37:35 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id fb6sm10192375wib.2.2014.03.27.01.37.32 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 27 Mar 2014 01:37:33 -0700 (PDT) Date: Thu, 27 Mar 2014 09:37:30 +0100 From: Mateusz Guzik To: David Xu Subject: Re: svn commit: r263755 - head/sys/kern Message-ID: <20140327083730.GA22942@dft-labs.eu> References: <201403252330.s2PNUaei052956@svn.freebsd.org> <5333D70D.7050306@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5333D70D.7050306@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 08:37:38 -0000 On Thu, Mar 27, 2014 at 03:45:17PM +0800, David Xu wrote: > I think the async process pointer can be cleared when a process exits > by registering an event handler. please see attached patch. > Sure, but I'm not very fond of this solution. This is a rather obscure bug you wont hit unless you explicitly try, and even then you need root privs by default. As such writing a callback function which will be executed for all exiting processes seems unjustified for me. Ideally we would get some mechanism which would allow to register callbacks for events related to given entity. Then it could be used to provide a "call this function when process p exits", amongst other things. -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 08:46:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D784B770; Thu, 27 Mar 2014 08:46:15 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1D45B6; Thu, 27 Mar 2014 08:46:15 +0000 (UTC) Received: from xyf.my.dom (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s2R8kD8j000523; Thu, 27 Mar 2014 08:46:14 GMT (envelope-from davidxu@freebsd.org) Message-ID: <5333E581.1000100@freebsd.org> Date: Thu, 27 Mar 2014 16:46:57 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Mateusz Guzik Subject: Re: svn commit: r263755 - head/sys/kern References: <201403252330.s2PNUaei052956@svn.freebsd.org> <5333D70D.7050306@freebsd.org> <20140327083730.GA22942@dft-labs.eu> In-Reply-To: <20140327083730.GA22942@dft-labs.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 08:46:15 -0000 On 2014/03/27 16:37, Mateusz Guzik wrote: > On Thu, Mar 27, 2014 at 03:45:17PM +0800, David Xu wrote: >> I think the async process pointer can be cleared when a process exits >> by registering an event handler. please see attached patch. >> > > Sure, but I'm not very fond of this solution. > > This is a rather obscure bug you wont hit unless you explicitly try, > and even then you need root privs by default. > OK, but I don't like the bug exists in kernel. It is not obscure for me, I can run "shutdown now" command, and insert a device, and then the kernel will write garbage data into freed memory space. > As such writing a callback function which will be executed for all exiting > processes seems unjustified for me. > > Ideally we would get some mechanism which would allow to register > callbacks for events related to given entity. Then it could be used to > provide a "call this function when process p exits", amongst other things. > Yes, but the callback itself is cheap enough and is not worth to be per-entity entry. From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 09:24:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1A0B803; Thu, 27 Mar 2014 09:24:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE776653; Thu, 27 Mar 2014 09:24:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2R9O9RJ094509; Thu, 27 Mar 2014 09:24:09 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2R9O9t1094508; Thu, 27 Mar 2014 09:24:09 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201403270924.s2R9O9t1094508@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 27 Mar 2014 09:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263809 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 09:24:10 -0000 Author: ray Date: Thu Mar 27 09:24:09 2014 New Revision: 263809 URL: http://svnweb.freebsd.org/changeset/base/263809 Log: Fix crash on resume in vt(9). Statically allocated terminal window have not initialized callout handler, so we have to initialize it even for existing window if it is console window. Reported by: gjb and many Tested by: gjb MFC after: 7 days Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Thu Mar 27 08:52:48 2014 (r263808) +++ head/sys/dev/vt/vt_core.c Thu Mar 27 09:24:09 2014 (r263809) @@ -1872,6 +1872,9 @@ vt_upgrade(struct vt_device *vd) if (vw == NULL) { /* New window. */ vw = vt_allocate_window(vd, i); + } else if (vw->vw_flags & VWF_CONSOLE) { + /* For existing console window. */ + callout_init(&vw->vw_proc_dead_timer, 0); } if (i == VT_CONSWINDOW) { /* Console window. */ From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 09:40:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82C32CD2; Thu, 27 Mar 2014 09:40:06 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 3E2937CD; Thu, 27 Mar 2014 09:40:06 +0000 (UTC) Received: from terran (unknown [192.168.99.1]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPA id 44501C496D; Thu, 27 Mar 2014 11:39:59 +0200 (EET) Date: Thu, 27 Mar 2014 11:41:48 +0200 From: Aleksandr Rybalko To: John Baldwin Subject: Re: svn commit: r263321 - head/sys/dev/vt Message-Id: <20140327114148.3368cea00ad2a0994315c5b0@freebsd.org> In-Reply-To: <201403191453.47690.jhb@freebsd.org> References: <201403182222.s2IMMmOM081929@svn.freebsd.org> <201403191453.47690.jhb@freebsd.org> X-Mailer: Sylpheed 3.3.1 (GTK+ 2.24.22; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 09:40:06 -0000 On Wed, 19 Mar 2014 14:53:47 -0400 John Baldwin wrote: > On Tuesday, March 18, 2014 6:22:48 pm Aleksandr Rybalko wrote: > > Author: ray > > Date: Tue Mar 18 22:22:47 2014 > > New Revision: 263321 > > URL: http://svnweb.freebsd.org/changeset/base/263321 > > > > Log: > > Switch kern.vt.suspendswitch to 0 by default (disabled). > > kern.vt.suspendswitch - sysctl/tunable which enable switch to VT0 before going > > to suspend and switch back after resume. > > > > MFC after: 7 days > > I think it is fine to change the default, but I'm not certain that this fixes > the panics on resume. So far no one has reported back that this did fix them > after I suggested it. It would be good to fix the panics as well if possible. > The last time I looked at it in detail, it seemed like the callout for only > ttyv0 had been zero'd. Other ttyv timers used in switching still had the correct > contents. > > -- > John Baldwin Yeah, thanks for pointing on it. Your hint about ttyv0 point to the difference between ttyv0 and others. Window structure for VT1 defined statically for early stage drivers (like vt_vga), so I forget to initialize callout for that window :) Now it was fixed by r263809. And since we still have problem with puzzling Xorg screen after suspend/resume - I will revert this commit. My research on that problem (puzzling Xorg screen) point on two possible problems: 1. maybe Xorg lack of APM module, or it is broken somehow. 2. maybe problem in drm2, so Xorg's framebuffer rearranged by drm2, but Xorg don't know about that. Many thanks! WBW -- Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 10:15:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 516423B2; Thu, 27 Mar 2014 10:15:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C844AA1; Thu, 27 Mar 2014 10:15:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2RAFa9A015136; Thu, 27 Mar 2014 10:15:36 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2RAFaOW015135; Thu, 27 Mar 2014 10:15:36 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403271015.s2RAFaOW015135@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 27 Mar 2014 10:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263810 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 10:15:36 -0000 Author: trasz Date: Thu Mar 27 10:15:35 2014 New Revision: 263810 URL: http://svnweb.freebsd.org/changeset/base/263810 Log: Rework cfiscsi_datamove_in() to obey expected data transfer length received from the initiator. Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Thu Mar 27 09:24:09 2014 (r263809) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Thu Mar 27 10:15:35 2014 (r263810) @@ -2315,8 +2315,8 @@ cfiscsi_datamove_in(union ctl_io *io) const struct iscsi_bhs_scsi_command *bhssc; struct iscsi_bhs_data_in *bhsdi; struct ctl_sg_entry ctl_sg_entry, *ctl_sglist; - size_t copy_len, len, off; - const char *addr; + size_t len, expected_len, sg_len, buffer_offset; + const char *sg_addr; int ctl_sg_count, error, i; request = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; @@ -2338,26 +2338,49 @@ cfiscsi_datamove_in(union ctl_io *io) } /* - * We need to record it so that we can properly report + * This is the total amount of data to be transferred within the current + * SCSI command. We need to record it so that we can properly report * underflow/underflow. */ PDU_TOTAL_TRANSFER_LEN(request) = io->scsiio.kern_total_len; /* - * This is the offset within the current SCSI command; - * i.e. for the first call of datamove(), it will be 0, - * and for subsequent ones it will be the sum of lengths - * of previous ones. + * This is the offset within the current SCSI command; for the first + * call to cfiscsi_datamove() it will be 0, and for subsequent ones + * it will be the sum of lengths of previous ones. It's being + * incremented as we append data to the data segment. */ - off = htonl(io->scsiio.kern_rel_offset); + buffer_offset = io->scsiio.kern_rel_offset; + + /* + * This is the transfer length expected by the initiator. In theory, + * it could be different from the correct amount of data from the SCSI + * point of view, even if that doesn't make any sense. + */ + expected_len = ntohl(bhssc->bhssc_expected_data_transfer_length); +#if 0 + if (expected_len != io->scsiio.kern_total_len) + CFISCSI_SESSION_DEBUG(cs, "expected transfer length = %zd, " + "actual length = %zd", expected_len, + io->scsiio.kern_total_len); +#endif + + if (buffer_offset >= expected_len) { +#if 0 + CFISCSI_SESSION_DEBUG(cs, "buffer_offset = %zd, " + "already sent the expected len", buffer_offset); +#endif + io->scsiio.ext_data_filled = io->scsiio.kern_total_len; + io->scsiio.be_move_done(io); + return; + } i = 0; - addr = NULL; - len = 0; + sg_addr = NULL; + sg_len = 0; response = NULL; bhsdi = NULL; for (;;) { - KASSERT(i < ctl_sg_count, ("i >= ctl_sg_count")); if (response == NULL) { response = cfiscsi_pdu_new_response(request, M_NOWAIT); if (response == NULL) { @@ -2374,22 +2397,43 @@ cfiscsi_datamove_in(union ctl_io *io) bhssc->bhssc_initiator_task_tag; bhsdi->bhsdi_datasn = htonl(PDU_EXPDATASN(request)); PDU_EXPDATASN(request)++; - bhsdi->bhsdi_buffer_offset = htonl(off); + bhsdi->bhsdi_buffer_offset = htonl(buffer_offset); } - if (len == 0) { - addr = ctl_sglist[i].addr; - len = ctl_sglist[i].len; - KASSERT(len > 0, ("len <= 0")); + KASSERT(i < ctl_sg_count, ("i >= ctl_sg_count")); + if (sg_len == 0) { + sg_addr = ctl_sglist[i].addr; + sg_len = ctl_sglist[i].len; + KASSERT(sg_len > 0, ("sg_len <= 0")); } - copy_len = len; - if (response->ip_data_len + copy_len > + len = sg_len; + + /* + * Truncate to maximum data segment length. + */ + KASSERT(response->ip_data_len < cs->cs_max_data_segment_length, + ("max_data_segment_length %zd >= ip_data_len %zd", + response->ip_data_len, cs->cs_max_data_segment_length)); + if (response->ip_data_len + len > cs->cs_max_data_segment_length) - copy_len = cs->cs_max_data_segment_length - + len = cs->cs_max_data_segment_length - response->ip_data_len; - KASSERT(copy_len <= len, ("copy_len > len")); - error = icl_pdu_append_data(response, addr, copy_len, M_NOWAIT); + + /* + * Truncate to expected data transfer length. + */ + KASSERT(buffer_offset + response->ip_data_len < expected_len, + ("%zd >= %zd", buffer_offset + response->ip_data_len, expected_len)); + if (buffer_offset + response->ip_data_len + len > expected_len) { + CFISCSI_SESSION_DEBUG(cs, "truncating from %zd " + "to expected data transfer length %zd", + buffer_offset + response->ip_data_len + len, expected_len); + len = expected_len - (buffer_offset + response->ip_data_len); + } + + KASSERT(len <= sg_len, ("len > sg_len")); + error = icl_pdu_append_data(response, sg_addr, len, M_NOWAIT); if (error != 0) { CFISCSI_SESSION_WARN(cs, "failed to " "allocate memory; dropping connection"); @@ -2399,12 +2443,19 @@ cfiscsi_datamove_in(union ctl_io *io) cfiscsi_session_terminate(cs); return; } - addr += copy_len; - len -= copy_len; - off += copy_len; - io->scsiio.ext_data_filled += copy_len; + sg_addr += len; + sg_len -= len; + buffer_offset += len; + io->scsiio.ext_data_filled += len; + + if (buffer_offset == expected_len) { + /* + * Already have the amount of data the initiator wanted. + */ + break; + } - if (len == 0) { + if (sg_len == 0) { /* * End of scatter-gather segment; * proceed to the next one... @@ -2427,27 +2478,18 @@ cfiscsi_datamove_in(union ctl_io *io) * call to cfiscsi_datamove(), and we want * to set the F flag only on the last of them. */ - if (off == io->scsiio.kern_total_len) + if (buffer_offset == io->scsiio.kern_total_len || + buffer_offset == expected_len) bhsdi->bhsdi_flags |= BHSDI_FLAGS_F; - KASSERT(response->ip_data_len > 0, - ("sending empty Data-In")); cfiscsi_pdu_queue(response); response = NULL; bhsdi = NULL; } } - KASSERT(i == ctl_sg_count - 1, ("missed SG segment")); - KASSERT(len == 0, ("missed data from SG segment")); if (response != NULL) { - if (off == io->scsiio.kern_total_len) { + if (buffer_offset == io->scsiio.kern_total_len || + buffer_offset == expected_len) bhsdi->bhsdi_flags |= BHSDI_FLAGS_F; -#if 0 - } else { - CFISCSI_SESSION_DEBUG(cs, "not setting the F flag; " - "have %zd, need %zd", off, - (size_t)io->scsiio.kern_total_len); -#endif - } KASSERT(response->ip_data_len > 0, ("sending empty Data-In")); cfiscsi_pdu_queue(response); } From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 11:10:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B587C04; Thu, 27 Mar 2014 11:10:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 474DCEEF; Thu, 27 Mar 2014 11:10:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2RBAF1U035666; Thu, 27 Mar 2014 11:10:15 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2RBAEZg035654; Thu, 27 Mar 2014 11:10:14 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403271110.s2RBAEZg035654@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 27 Mar 2014 11:10:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263811 - in head/sys: cam/ctl conf modules/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 11:10:15 -0000 Author: trasz Date: Thu Mar 27 11:10:13 2014 New Revision: 263811 URL: http://svnweb.freebsd.org/changeset/base/263811 Log: Remove ctl_mem_pool.{c,h}. Sponsored by: The FreeBSD Foundation Deleted: head/sys/cam/ctl/ctl_mem_pool.c head/sys/cam/ctl/ctl_mem_pool.h Modified: head/sys/cam/ctl/README.ctl.txt head/sys/cam/ctl/ctl_frontend_cam_sim.c head/sys/cam/ctl/ctl_frontend_internal.c head/sys/conf/files head/sys/modules/ctl/Makefile Modified: head/sys/cam/ctl/README.ctl.txt ============================================================================== --- head/sys/cam/ctl/README.ctl.txt Thu Mar 27 10:15:35 2014 (r263810) +++ head/sys/cam/ctl/README.ctl.txt Thu Mar 27 11:10:13 2014 (r263811) @@ -394,14 +394,6 @@ ctl_ioctl.h: This defines all ioctls available through the CTL character device, and the data structures needed for those ioctls. -ctl_mem_pool.c -ctl_mem_pool.h: --------------- - -Generic memory pool implementation. This is currently only used by the -internal frontend. The internal frontend can probably be rewritten to use -UMA zones and this can be removed. - ctl_private.h: ------------- Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_cam_sim.c Thu Mar 27 10:15:35 2014 (r263810) +++ head/sys/cam/ctl/ctl_frontend_cam_sim.c Thu Mar 27 11:10:13 2014 (r263811) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #define io_ptr spriv_ptr1 Modified: head/sys/cam/ctl/ctl_frontend_internal.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_internal.c Thu Mar 27 10:15:35 2014 (r263810) +++ head/sys/cam/ctl/ctl_frontend_internal.c Thu Mar 27 11:10:13 2014 (r263811) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -73,7 +74,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -118,7 +118,6 @@ struct cfi_metatask { cfi_tasktype tasktype; cfi_mt_status status; union cfi_taskinfo taskinfo; - struct ctl_mem_element *element; void *cfi_context; STAILQ_ENTRY(cfi_metatask) links; }; @@ -153,7 +152,6 @@ struct cfi_lun { int blocksize_powerof2; uint32_t cur_tag_num; cfi_lun_state state; - struct ctl_mem_element *element; struct cfi_softc *softc; STAILQ_HEAD(, cfi_lun_io) io_list; STAILQ_ENTRY(cfi_lun) links; @@ -181,12 +179,13 @@ struct cfi_softc { cfi_flags flags; STAILQ_HEAD(, cfi_lun) lun_list; STAILQ_HEAD(, cfi_metatask) metatask_list; - struct ctl_mem_pool lun_pool; - struct ctl_mem_pool metatask_pool; }; MALLOC_DEFINE(M_CTL_CFI, "ctlcfi", "CTL CFI"); +static uma_zone_t cfi_lun_zone; +static uma_zone_t cfi_metatask_zone; + static struct cfi_softc fetd_internal_softc; int cfi_init(void); @@ -275,48 +274,15 @@ cfi_init(void) if (ctl_frontend_register(fe, (softc->flags & CTL_FLAG_MASTER_SHELF)) != 0) { printf("%s: internal frontend registration failed\n", __func__); - retval = 1; - goto bailout; + return (0); } - if (ctl_init_mem_pool(&softc->lun_pool, - sizeof(struct cfi_lun), - CTL_MEM_POOL_PERM_GROW, /*grow_inc*/ 3, - /* initial_pool_size */ CTL_MAX_LUNS) != 0) { - printf("%s: can't initialize LUN memory pool\n", __func__); - retval = 1; - goto bailout_error; - } - - if (ctl_init_mem_pool(&softc->metatask_pool, - sizeof(struct cfi_metatask), - CTL_MEM_POOL_PERM_GROW, /*grow_inc*/ 3, - /*initial_pool_size*/ 10) != 0) { - printf("%s: can't initialize metatask memory pool\n", __func__); - retval = 2; - goto bailout_error; - } -bailout: + cfi_lun_zone = uma_zcreate("cfi_lun", sizeof(struct cfi_lun), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); + cfi_metatask_zone = uma_zcreate("cfi_metatask", sizeof(struct cfi_metatask), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); return (0); - -bailout_error: - - switch (retval) { - case 3: - ctl_shrink_mem_pool(&softc->metatask_pool); - /* FALLTHROUGH */ - case 2: - ctl_shrink_mem_pool(&softc->lun_pool); - /* FALLTHROUGH */ - case 1: - ctl_frontend_deregister(fe); - break; - default: - break; - } - - return (ENOMEM); } void @@ -332,11 +298,8 @@ cfi_shutdown(void) if (ctl_frontend_deregister(&softc->fe) != 0) printf("%s: ctl_frontend_deregister() failed\n", __func__); - if (ctl_shrink_mem_pool(&softc->lun_pool) != 0) - printf("%s: error shrinking LUN pool\n", __func__); - - if (ctl_shrink_mem_pool(&softc->metatask_pool) != 0) - printf("%s: error shrinking LUN pool\n", __func__); + uma_zdestroy(cfi_lun_zone); + uma_zdestroy(cfi_metatask_zone); } static int @@ -398,7 +361,6 @@ cfi_targ_disable(void *arg, struct ctl_i static int cfi_lun_enable(void *arg, struct ctl_id target_id, int lun_id) { - struct ctl_mem_element *element; struct cfi_softc *softc; struct cfi_lun *lun; int found; @@ -423,16 +385,12 @@ cfi_lun_enable(void *arg, struct ctl_id if (found != 0) return (0); - element = ctl_alloc_mem_element(&softc->lun_pool, /*can_wait*/ 0); - - if (element == NULL) { + lun = uma_zalloc(cfi_lun_zone, M_NOWAIT | M_ZERO); + if (lun == NULL) { printf("%s: unable to allocate LUN structure\n", __func__); return (1); } - lun = (struct cfi_lun *)element->bytes; - - lun->element = element; lun->target_id = target_id; lun->lun_id = lun_id; lun->cur_tag_num = 0; @@ -485,7 +443,7 @@ cfi_lun_disable(void *arg, struct ctl_id return (1); } - ctl_free_mem_element(lun->element); + uma_zfree(cfi_lun_zone, lun); return (0); } @@ -1682,106 +1640,20 @@ cfi_action(struct cfi_metatask *metatask } } -#ifdef oldapi -void -cfi_shutdown_shelf(cfi_cb_t callback, void *callback_arg) -{ - struct ctl_mem_element *element; - struct cfi_softc *softc; - struct cfi_metatask *metatask; - - softc = &fetd_internal_softc; - - element = ctl_alloc_mem_element(&softc->metatask_pool, /*can_wait*/ 0); - if (element == NULL) { - callback(callback_arg, - /*status*/ CFI_MT_ERROR, - /*sluns_found*/ 0, - /*sluns_complete*/ 0, - /*sluns_failed*/ 0); - return; - } - - metatask = (struct cfi_metatask *)element->bytes; - - memset(metatask, 0, sizeof(*metatask)); - metatask->tasktype = CFI_TASK_SHUTDOWN; - metatask->status = CFI_MT_NONE; - metatask->taskinfo.startstop.callback = callback; - metatask->taskinfo.startstop.callback_arg = callback_arg; - metatask->element = element; - - cfi_action(softc, metatask); - - /* - * - send a report luns to lun 0, get LUN list. - * - send an inquiry to each lun - * - send a stop/offline to each direct access LUN - * - if we get a reservation conflict, reset the LUN and then - * retry sending the stop/offline - * - return status back to the caller - */ -} - -void -cfi_start_shelf(cfi_cb_t callback, void *callback_arg) -{ - struct ctl_mem_element *element; - struct cfi_softc *softc; - struct cfi_metatask *metatask; - - softc = &fetd_internal_softc; - - element = ctl_alloc_mem_element(&softc->metatask_pool, /*can_wait*/ 0); - if (element == NULL) { - callback(callback_arg, - /*status*/ CFI_MT_ERROR, - /*sluns_found*/ 0, - /*sluns_complete*/ 0, - /*sluns_failed*/ 0); - return; - } - - metatask = (struct cfi_metatask *)element->bytes; - - memset(metatask, 0, sizeof(*metatask)); - metatask->tasktype = CFI_TASK_STARTUP; - metatask->status = CFI_MT_NONE; - metatask->taskinfo.startstop.callback = callback; - metatask->taskinfo.startstop.callback_arg = callback_arg; - metatask->element = element; - - cfi_action(softc, metatask); - - /* - * - send a report luns to lun 0, get LUN list. - * - send an inquiry to each lun - * - send a stop/offline to each direct access LUN - * - if we get a reservation conflict, reset the LUN and then - * retry sending the stop/offline - * - return status back to the caller - */ -} - -#endif - struct cfi_metatask * cfi_alloc_metatask(int can_wait) { - struct ctl_mem_element *element; struct cfi_metatask *metatask; struct cfi_softc *softc; softc = &fetd_internal_softc; - element = ctl_alloc_mem_element(&softc->metatask_pool, can_wait); - if (element == NULL) + metatask = uma_zalloc(cfi_metatask_zone, + (can_wait ? M_WAITOK : M_NOWAIT) | M_ZERO); + if (metatask == NULL) return (NULL); - metatask = (struct cfi_metatask *)element->bytes; - memset(metatask, 0, sizeof(*metatask)); metatask->status = CFI_MT_NONE; - metatask->element = element; return (metatask); } @@ -1789,7 +1661,8 @@ cfi_alloc_metatask(int can_wait) void cfi_free_metatask(struct cfi_metatask *metatask) { - ctl_free_mem_element(metatask->element); + + uma_zfree(cfi_metatask_zone, metatask); } /* Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Mar 27 10:15:35 2014 (r263810) +++ head/sys/conf/files Thu Mar 27 11:10:13 2014 (r263811) @@ -85,7 +85,6 @@ cam/ctl/ctl_frontend.c optional ctl cam/ctl/ctl_frontend_cam_sim.c optional ctl cam/ctl/ctl_frontend_internal.c optional ctl cam/ctl/ctl_frontend_iscsi.c optional ctl -cam/ctl/ctl_mem_pool.c optional ctl cam/ctl/ctl_scsi_all.c optional ctl cam/ctl/ctl_error.c optional ctl cam/ctl/ctl_util.c optional ctl Modified: head/sys/modules/ctl/Makefile ============================================================================== --- head/sys/modules/ctl/Makefile Thu Mar 27 10:15:35 2014 (r263810) +++ head/sys/modules/ctl/Makefile Thu Mar 27 11:10:13 2014 (r263811) @@ -13,7 +13,6 @@ SRCS+= ctl_frontend.c SRCS+= ctl_frontend_cam_sim.c SRCS+= ctl_frontend_internal.c SRCS+= ctl_frontend_iscsi.c -SRCS+= ctl_mem_pool.c SRCS+= ctl_scsi_all.c SRCS+= ctl_error.c SRCS+= ctl_util.c From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 11:12:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0BA67DE1; Thu, 27 Mar 2014 11:12:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBB13F90; Thu, 27 Mar 2014 11:12:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2RBCZ9x038821; Thu, 27 Mar 2014 11:12:35 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2RBCZVl038820; Thu, 27 Mar 2014 11:12:35 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403271112.s2RBCZVl038820@svn.freebsd.org> From: Bryan Drewery Date: Thu, 27 Mar 2014 11:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263812 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 11:12:36 -0000 Author: bdrewery Date: Thu Mar 27 11:12:35 2014 New Revision: 263812 URL: http://svnweb.freebsd.org/changeset/base/263812 Log: Update build(7) with LOCAL_* vars PR: docs/178286 Submitted by: Garrett Cooper Sponsored by: EMC / Isilon Storage Division MFC after: 1 week Modified: head/share/man/man7/build.7 Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Thu Mar 27 11:10:13 2014 (r263811) +++ head/share/man/man7/build.7 Thu Mar 27 11:12:35 2014 (r263812) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 10, 2012 +.Dd March 27, 2014 .Dt BUILD 7 .Os .Sh NAME @@ -411,8 +411,25 @@ then is set to the value of .Va KERNFAST . .It Va LOCAL_DIRS -If set, this variable supplies a list of additional directories to -build, relative to the root of the source tree. +If set, this variable supplies a list of additional directories relative to +the root of the source tree to build as part of the +.Cm everything +target. +.It Va LOCAL_LIB_DIRS +If set, this variable supplies a list of additional directories relative to +the root of the source tree to build as part of the +.Cm libraries +target. +.It Va LOCAL_MTREE +If set, this variable supplies a list of additional mtrees relative to the +root of the source tree to use as part of the +.Cm hierarchy +target. +.It Va LOCAL_TOOL_DIRS +If set, this variable supplies a list of additional directories relative to +the root of the source tree to build as part of the +.Cm build-tools +target. .It Va PORTS_MODULES A list of ports with kernel modules that should be built and installed as part of the From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 13:15:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3416FC8; Thu, 27 Mar 2014 13:15:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFD0EEC5; Thu, 27 Mar 2014 13:15:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2RDFM52088231; Thu, 27 Mar 2014 13:15:22 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2RDFMK2088230; Thu, 27 Mar 2014 13:15:22 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201403271315.s2RDFMK2088230@svn.freebsd.org> From: Julio Merino Date: Thu, 27 Mar 2014 13:15:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263814 - head/sbin/mdconfig/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 13:15:22 -0000 Author: jmmv Date: Thu Mar 27 13:15:22 2014 New Revision: 263814 URL: http://svnweb.freebsd.org/changeset/base/263814 Log: Fix path to the run.pl script to let these tests run. Submitted by: Peel, Casey Obtained from: freebsd-testing Modified: head/sbin/mdconfig/tests/legacy_test.sh Modified: head/sbin/mdconfig/tests/legacy_test.sh ============================================================================== --- head/sbin/mdconfig/tests/legacy_test.sh Thu Mar 27 12:59:23 2014 (r263813) +++ head/sbin/mdconfig/tests/legacy_test.sh Thu Mar 27 13:15:22 2014 (r263814) @@ -38,7 +38,7 @@ fi TESTDIR=$(dirname $(realpath $0)) -__PERL__ -w -U $TESTDIR/run $TESTDIR/mdconfig.test > /dev/null +__PERL__ -w -U $TESTDIR/run.pl $TESTDIR/mdconfig.test > /dev/null if [ $? -eq 0 ]; then echo "ok 1" From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 13:57:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBB27D02; Thu, 27 Mar 2014 13:57:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D2812D4; Thu, 27 Mar 2014 13:57:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2RDv3eG004624; Thu, 27 Mar 2014 13:57:03 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2RDv1h1004609; Thu, 27 Mar 2014 13:57:01 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403271357.s2RDv1h1004609@svn.freebsd.org> From: Ed Maste Date: Thu, 27 Mar 2014 13:57:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263815 - in head/sys: ia64/acpica ia64/ia64 ia64/include sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 13:57:03 -0000 Author: emaste Date: Thu Mar 27 13:57:00 2014 New Revision: 263815 URL: http://svnweb.freebsd.org/changeset/base/263815 Log: Move ia64 efi.h to sys in preparation for amd64 UEFI support Prototypes specific to ia64 have been left in this file for now, under __ia64__, rather than moving them to a new header under sys/ia64. I anticipate that (some of) the corresponding functions will be shared by the amd64, arm64, i386, and ia64 architectures, and we can adjust this as EFI support on other than ia64 continues to develop. Sponsored by: The FreeBSD Foundation Added: head/sys/sys/efi.h - copied, changed from r263814, head/sys/ia64/include/efi.h Deleted: head/sys/ia64/include/efi.h Modified: head/sys/ia64/acpica/OsdEnvironment.c head/sys/ia64/ia64/clock.c head/sys/ia64/ia64/dump_machdep.c head/sys/ia64/ia64/efi.c head/sys/ia64/ia64/iodev_machdep.c head/sys/ia64/ia64/machdep.c head/sys/ia64/ia64/nexus.c head/sys/ia64/ia64/pmap.c head/sys/ia64/ia64/sal.c head/sys/ia64/ia64/trap.c Modified: head/sys/ia64/acpica/OsdEnvironment.c ============================================================================== --- head/sys/ia64/acpica/OsdEnvironment.c Thu Mar 27 13:15:22 2014 (r263814) +++ head/sys/ia64/acpica/OsdEnvironment.c Thu Mar 27 13:57:00 2014 (r263815) @@ -29,8 +29,8 @@ __FBSDID("$FreeBSD$"); #include +#include #include -#include #include Modified: head/sys/ia64/ia64/clock.c ============================================================================== --- head/sys/ia64/ia64/clock.c Thu Mar 27 13:15:22 2014 (r263814) +++ head/sys/ia64/ia64/clock.c Thu Mar 27 13:57:00 2014 (r263815) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -41,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/ia64/ia64/dump_machdep.c ============================================================================== --- head/sys/ia64/ia64/dump_machdep.c Thu Mar 27 13:15:22 2014 (r263814) +++ head/sys/ia64/ia64/dump_machdep.c Thu Mar 27 13:57:00 2014 (r263815) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #ifdef SW_WATCHDOG @@ -41,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/ia64/ia64/efi.c ============================================================================== --- head/sys/ia64/ia64/efi.c Thu Mar 27 13:15:22 2014 (r263814) +++ head/sys/ia64/ia64/efi.c Thu Mar 27 13:57:00 2014 (r263815) @@ -29,9 +29,9 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include -#include #include #include #include Modified: head/sys/ia64/ia64/iodev_machdep.c ============================================================================== --- head/sys/ia64/ia64/iodev_machdep.c Thu Mar 27 13:15:22 2014 (r263814) +++ head/sys/ia64/ia64/iodev_machdep.c Thu Mar 27 13:57:00 2014 (r263815) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -37,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include static int iodev_efivar_getvar(struct iodev_efivar_req *req); Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Thu Mar 27 13:15:22 2014 (r263814) +++ head/sys/ia64/ia64/machdep.c Thu Mar 27 13:57:00 2014 (r263815) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -83,7 +84,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/ia64/ia64/nexus.c ============================================================================== --- head/sys/ia64/ia64/nexus.c Thu Mar 27 13:15:22 2014 (r263814) +++ head/sys/ia64/ia64/nexus.c Thu Mar 27 13:57:00 2014 (r263815) @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -55,7 +56,6 @@ #include #include -#include #include #include #include Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Thu Mar 27 13:15:22 2014 (r263814) +++ head/sys/ia64/ia64/pmap.c Thu Mar 27 13:57:00 2014 (r263815) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include "opt_pmap.h" #include +#include #include #include #include @@ -71,7 +72,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/ia64/ia64/sal.c ============================================================================== --- head/sys/ia64/ia64/sal.c Thu Mar 27 13:15:22 2014 (r263814) +++ head/sys/ia64/ia64/sal.c Thu Mar 27 13:57:00 2014 (r263815) @@ -30,11 +30,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include -#include #include #include #include Modified: head/sys/ia64/ia64/trap.c ============================================================================== --- head/sys/ia64/ia64/trap.c Thu Mar 27 13:15:22 2014 (r263814) +++ head/sys/ia64/ia64/trap.c Thu Mar 27 13:57:00 2014 (r263815) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -60,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #ifdef SMP #include Copied and modified: head/sys/sys/efi.h (from r263814, head/sys/ia64/include/efi.h) ============================================================================== --- head/sys/ia64/include/efi.h Thu Mar 27 13:15:22 2014 (r263814, copy source) +++ head/sys/sys/efi.h Thu Mar 27 13:57:00 2014 (r263815) @@ -26,8 +26,8 @@ * $FreeBSD$ */ -#ifndef _MACHINE_EFI_H_ -#define _MACHINE_EFI_H_ +#ifndef _SYS_EFI_H_ +#define _SYS_EFI_H_ #include @@ -151,7 +151,7 @@ struct efi_systbl { uint64_t st_cfgtbl; }; -#ifdef _KERNEL +#if defined(_KERNEL) && defined(__ia64__) typedef u_long (*ia64_efi_f)(u_long, u_long, u_long, u_long); @@ -172,6 +172,6 @@ int efi_var_get(efi_char *, struct uuid int efi_var_nextname(size_t *, efi_char *, struct uuid *); int efi_var_set(efi_char *, struct uuid *, uint32_t, size_t, void *); -#endif /* _KERNEL */ +#endif /* _KERNEL && __ia64__ */ -#endif /* _MACHINE_EFI_H_ */ +#endif /* _SYS_EFI_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 14:07:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62936FD0; Thu, 27 Mar 2014 14:07:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F7A73F0; Thu, 27 Mar 2014 14:07:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2RE7bDx008763; Thu, 27 Mar 2014 14:07:37 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2RE7bJT008762; Thu, 27 Mar 2014 14:07:37 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201403271407.s2RE7bJT008762@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 27 Mar 2014 14:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263816 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 14:07:37 -0000 Author: ray Date: Thu Mar 27 14:07:36 2014 New Revision: 263816 URL: http://svnweb.freebsd.org/changeset/base/263816 Log: Revert r263321. vt(9) crash on resume fixed, but Xorg still have damaged screen on resume (at least with i915kms), so better to switch to VT0 before suspend and back on resume. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Thu Mar 27 13:57:00 2014 (r263815) +++ head/sys/dev/vt/vt_core.c Thu Mar 27 14:07:36 2014 (r263816) @@ -118,7 +118,7 @@ static SYSCTL_NODE(_kern, OID_AUTO, vt, VT_SYSCTL_INT(enable_altgr, 1, "Enable AltGr key (Do not assume R.Alt as Alt)"); VT_SYSCTL_INT(debug, 0, "vt(9) debug level"); VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode"); -VT_SYSCTL_INT(suspendswitch, 0, "Switch to VT0 before suspend"); +VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend"); static unsigned int vt_unit = 0; static MALLOC_DEFINE(M_VT, "vt", "vt device"); From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 14:58:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F3E22C0; Thu, 27 Mar 2014 14:58:26 +0000 (UTC) Received: from mail-we0-x22f.google.com (mail-we0-x22f.google.com [IPv6:2a00:1450:400c:c03::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13E4CB17; Thu, 27 Mar 2014 14:58:24 +0000 (UTC) Received: by mail-we0-f175.google.com with SMTP id q58so1828263wes.20 for ; Thu, 27 Mar 2014 07:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=XmHjkQUcqSWN0ZAPXerCTvjScdXok6r7d5KusLJefOM=; b=gG4b6BTphDcx0okWxD9shK2WhzNP/+McW+Nod/dlLVPyVsN3bDKUjqBAAoQ18/+yqp o8XXD+GoxhNBTEt649FPduDuacnHdJn/7RJdB5Md2N/AGyJI7Yk95q4EfgriYgTmogHg gqQ7w4WTbJVPuHxy4BQhoZgi76uCHpB9KDHrn33Zvh60EyZ5mv9y2Bqr2YI2OQ2OCOMp TJWpnPshKeryaNvdkylT3NO+lmgrd17mNfkMfDCL2+6OL69Piv0yStgIxB6c3mqKA8Hp bXI3V/g3kIP1dMU6SsneDUzu1HAmwvrH+duxtLdT1A62mp19bZ4EixgKtDuZ64Dn97Pd qP2A== X-Received: by 10.180.101.40 with SMTP id fd8mr5655687wib.1.1395932303288; Thu, 27 Mar 2014 07:58:23 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id t10sm13032649wiw.19.2014.03.27.07.58.21 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 27 Mar 2014 07:58:22 -0700 (PDT) Date: Thu, 27 Mar 2014 15:58:19 +0100 From: Mateusz Guzik To: David Xu Subject: Re: svn commit: r263755 - head/sys/kern Message-ID: <20140327145819.GA4730@dft-labs.eu> References: <201403252330.s2PNUaei052956@svn.freebsd.org> <5333D70D.7050306@freebsd.org> <20140327083730.GA22942@dft-labs.eu> <5333E581.1000100@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5333E581.1000100@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 14:58:26 -0000 On Thu, Mar 27, 2014 at 04:46:57PM +0800, David Xu wrote: > On 2014/03/27 16:37, Mateusz Guzik wrote: > >On Thu, Mar 27, 2014 at 03:45:17PM +0800, David Xu wrote: > >>I think the async process pointer can be cleared when a process exits > >>by registering an event handler. please see attached patch. > >> > > > >Sure, but I'm not very fond of this solution. > > > >This is a rather obscure bug you wont hit unless you explicitly try, > >and even then you need root privs by default. > > > OK, but I don't like the bug exists in kernel. It is not obscure for me, > I can run "shutdown now" command, and insert a device, and then the > kernel will write garbage data into freed memory space. > Not sure what you mean. devd does not use this feature, and even if it did async_proc is cleared on close, which happens while signal delivery is still legal. That said, you are not going to encounter this bug unless you code something up to specifically trigger it. fwiw, I think we could axe this feature if there was no way to fix it without introducing a check for every process. > >As such writing a callback function which will be executed for all exiting > >processes seems unjustified for me. > > > >Ideally we would get some mechanism which would allow to register > >callbacks for events related to given entity. Then it could be used to > >provide a "call this function when process p exits", amongst other things. > > > > Yes, but the callback itself is cheap enough and is not worth to be > per-entity entry. > There is other code in the kernel which would benefit from such functionality - dev/syscons/scmouse, dev/vt/vt_core.c, aio and possibly more. As such I think this is worth pursuing. -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 15:05:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 849FD576; Thu, 27 Mar 2014 15:05:19 +0000 (UTC) Received: from mail-we0-x22a.google.com (mail-we0-x22a.google.com [IPv6:2a00:1450:400c:c03::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78253BD2; Thu, 27 Mar 2014 15:05:18 +0000 (UTC) Received: by mail-we0-f170.google.com with SMTP id w61so1893268wes.15 for ; Thu, 27 Mar 2014 08:05:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=4LTqV07O4s18dEEpLfT6btMYOd7EB2/8DFhFMRHewdg=; b=BzIzwukBQBdaUNcbRu0BohpfQzxEPmaDi5wLmYkQYx9haHazF9F9HsPJTihLIVHjp1 zyVzNmr3K0TG39cSS3YNDYozdbC73PPsF9+rJJa67OTl5xv8F8jTbAnUyXUimyb38ico D9ltftfFrHyOZCaFjSWxI0OVc34ftnhnlj4dg+y2ZFbbZncHKsIA5RPJ0aNRidlKU2cd TiTSmC17vIsAJsbg0qDQqyjXgWGapC7CXm2i9912hyU3LyyPqqtQZR/gDY6ekbGDHbch ehJHQhNnPE6pCxomuumI5s4p/3VWeH9xF8zSjjDfCxW4nWBci6+msHSbMxKd5/0Jiti8 42qQ== X-Received: by 10.180.19.98 with SMTP id d2mr40412329wie.57.1395932716518; Thu, 27 Mar 2014 08:05:16 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id bi8sm13103945wib.3.2014.03.27.08.05.14 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 27 Mar 2014 08:05:15 -0700 (PDT) Date: Thu, 27 Mar 2014 16:05:12 +0100 From: Mateusz Guzik To: David Xu Subject: Re: svn commit: r263755 - head/sys/kern Message-ID: <20140327150512.GB4730@dft-labs.eu> References: <201403252330.s2PNUaei052956@svn.freebsd.org> <5333D70D.7050306@freebsd.org> <20140327083730.GA22942@dft-labs.eu> <5333E581.1000100@freebsd.org> <20140327145819.GA4730@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20140327145819.GA4730@dft-labs.eu> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 15:05:19 -0000 On Thu, Mar 27, 2014 at 03:58:19PM +0100, Mateusz Guzik wrote: > On Thu, Mar 27, 2014 at 04:46:57PM +0800, David Xu wrote: > > On 2014/03/27 16:37, Mateusz Guzik wrote: > > >On Thu, Mar 27, 2014 at 03:45:17PM +0800, David Xu wrote: > > >>I think the async process pointer can be cleared when a process exits > > >>by registering an event handler. please see attached patch. > > >> > > > > > >Sure, but I'm not very fond of this solution. > > > > > >This is a rather obscure bug you wont hit unless you explicitly try, > > >and even then you need root privs by default. > > > > > OK, but I don't like the bug exists in kernel. It is not obscure for me, > > I can run "shutdown now" command, and insert a device, and then the > > kernel will write garbage data into freed memory space. > > > > Not sure what you mean. devd does not use this feature, and even if it > did async_proc is cleared on close, which happens while signal delivery > is still legal. > > That said, you are not going to encounter this bug unless you code > something up to specifically trigger it. > > fwiw, I think we could axe this feature if there was no way to fix it > without introducing a check for every process. > > > >As such writing a callback function which will be executed for all exiting > > >processes seems unjustified for me. > > > > > >Ideally we would get some mechanism which would allow to register > > >callbacks for events related to given entity. Then it could be used to > > >provide a "call this function when process p exits", amongst other things. > > > > > > > Yes, but the callback itself is cheap enough and is not worth to be > > per-entity entry. > > > > There is other code in the kernel which would benefit from such > functionality - dev/syscons/scmouse, dev/vt/vt_core.c, aio and possibly > more. > > As such I think this is worth pursuing. > We can hack around this one the way the other code is doing - apart from from proc pointer you store pid and then compare result of pfind(pid). This is still buggy as both proc and pid pointer can be recycled and end up being the same (but you have an entrirely new process). However, then in absolutely worst cae you send SIGIO to incorrect process, always an existing process so no more corruption. Would you be ok with such hack for the time being? -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 15:28:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6528CFA; Thu, 27 Mar 2014 15:28:02 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD1B7DCF; Thu, 27 Mar 2014 15:28:02 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9C508B918; Thu, 27 Mar 2014 11:28:00 -0400 (EDT) From: John Baldwin To: Takanori Watanabe Subject: Re: svn commit: r263795 - head/sys/x86/acpica Date: Thu, 27 Mar 2014 10:39:26 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201403270636.s2R6adgZ024745@svn.freebsd.org> In-Reply-To: <201403270636.s2R6adgZ024745@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201403271039.26897.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 27 Mar 2014 11:28:00 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 15:28:02 -0000 On Thursday, March 27, 2014 2:36:39 am Takanori Watanabe wrote: > Author: takawata > Date: Thu Mar 27 06:36:38 2014 > New Revision: 263795 > URL: http://svnweb.freebsd.org/changeset/base/263795 > > Log: > Strict value checking will cause problem. > Bay trail DN2820FYKH is supported on Linux but does not work on FreeBSD. > This behaviour is bug-compatible with Linux-3.13.5. > > References: > http://d.hatena.ne.jp/syuu1228/20140326 > http://lxr.linux.no/linux+v3.13.5/arch/x86/kernel/acpi/boot.c#L1094 > > Submitted by: syuu I think the problem with changing it at this level is that you don't know what the default should be. These are used both for local NMI but also for interrupt override entries for ISA interrupts in the local APIC, so hardcoding I think you should instead treat invalid values as "conforms". You can do this by mostly reverting your change and moving default to the top of the case and have it print a warning but fall through to the conforms cases. > Modified: > head/sys/x86/acpica/madt.c > > Modified: head/sys/x86/acpica/madt.c > ============================================================================== > --- head/sys/x86/acpica/madt.c Thu Mar 27 06:08:07 2014 (r263794) > +++ head/sys/x86/acpica/madt.c Thu Mar 27 06:36:38 2014 (r263795) > @@ -306,10 +306,11 @@ interrupt_polarity(UINT16 IntiFlags, UIN > case ACPI_MADT_POLARITY_ACTIVE_HIGH: > return (INTR_POLARITY_HIGH); > case ACPI_MADT_POLARITY_ACTIVE_LOW: > - return (INTR_POLARITY_LOW); > + break; I am not a fan of this at all. If we fixed default's logic to be different (e.g. as I suggested above), then falling through could result in the wrong thing. POLARITY_LOW should always explicitly return POLARITY_LOW. > default: > - panic("Bogus Interrupt Polarity"); > + printf("WARNING: Bogus Interrupt Polarity. Assume POLALITY LOW"); > } > + return (INTR_POLARITY_LOW); > } > > static enum intr_trigger -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 15:28:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 922FCCFF; Thu, 27 Mar 2014 15:28:05 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68966DD1; Thu, 27 Mar 2014 15:28:05 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 60AA5B93B; Thu, 27 Mar 2014 11:28:04 -0400 (EDT) From: John Baldwin To: Dimitry Andric Subject: Re: svn commit: r263778 - in head: bin lib lib/clang sbin share/mk usr.bin usr.sbin Date: Thu, 27 Mar 2014 10:41:01 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201403262230.s2QMUdH6021943@svn.freebsd.org> In-Reply-To: <201403262230.s2QMUdH6021943@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201403271041.01760.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 27 Mar 2014 11:28:04 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 15:28:05 -0000 On Wednesday, March 26, 2014 6:30:39 pm Dimitry Andric wrote: > Author: dim > Date: Wed Mar 26 22:30:38 2014 > New Revision: 263778 > URL: http://svnweb.freebsd.org/changeset/base/263778 > > Log: > Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to process > all the SUBDIR entries in parallel, instead of serially. Apply this > option to a selected number of Makefiles, which can greatly speed up the > build on multi-core machines, when using make -j. > > This can be extended to more Makefiles later on, whenever they are > verified to work correctly with parallel building. > > I tested this on a 24-core machine, with make -j48 buildworld (N = 6): > > before stddev after stddev > ======= ====== ======= ====== > real time 1741.1 16.5 959.8 2.7 > user time 12468.7 16.4 14393.0 16.8 > sys time 1825.0 54.8 2110.6 22.8 > > (user+sys)/real 8.2 17.1 > > E.g. the build was approximately 45% faster in real time. On machines > with less cores, or with lower -j settings, the speedup will not be as > impressive. But at least you can now almost max out a machine with > buildworld! > > Submitted by: jilles > MFC after: 2 weeks Nice! -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 15:39:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 164414C7; Thu, 27 Mar 2014 15:39:26 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "theravensnest.org", Issuer "theravensnest.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D827FF1F; Thu, 27 Mar 2014 15:39:25 +0000 (UTC) Received: from dhcp-172-17-152-181.eduroam.lapwing.private.cam.ac.uk (global-1-26.nat.csx.cam.ac.uk [131.111.184.26]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.5) with ESMTP id s2RFdLFt002262 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 27 Mar 2014 15:39:23 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263778 - in head: bin lib lib/clang sbin share/mk usr.bin usr.sbin From: David Chisnall In-Reply-To: <201403262230.s2QMUdH6021943@svn.freebsd.org> Date: Thu, 27 Mar 2014 15:39:16 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <5172B6F9-132D-4DEC-8936-970915AD1AC0@FreeBSD.org> References: <201403262230.s2QMUdH6021943@svn.freebsd.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 15:39:26 -0000 On 26 Mar 2014, at 22:30, Dimitry Andric wrote: > Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to = process > all the SUBDIR entries in parallel, instead of serially. Apply this > option to a selected number of Makefiles, which can greatly speed up = the > build on multi-core machines, when using make -j. THANK YOU! That's really excellent. We can probably parallelise pretty = much all of usr.lib and usr.bin as well, but going from using 8 cores to = 17 is a very nice improvement. This should help tinderbox / Jenkins = build a LOT! David From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 15:47:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16265AA5 for ; Thu, 27 Mar 2014 15:47:46 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE8FC89 for ; Thu, 27 Mar 2014 15:47:45 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s2RFljYf030243 for ; Thu, 27 Mar 2014 15:47:45 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s2RFljMo030234 for svn-src-head@freebsd.org; Thu, 27 Mar 2014 15:47:45 GMT (envelope-from bdrewery) Received: (qmail 65281 invoked from network); 27 Mar 2014 10:47:43 -0500 Received: from unknown (HELO roundcube.xk42.net) (10.10.5.5) by sweb.xzibition.com with SMTP; 27 Mar 2014 10:47:43 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 27 Mar 2014 10:47:43 -0500 From: Bryan Drewery To: David Chisnall Subject: Re: svn commit: r263778 - in head: bin lib lib/clang sbin share/mk usr.bin usr.sbin Organization: FreeBSD In-Reply-To: <5172B6F9-132D-4DEC-8936-970915AD1AC0@FreeBSD.org> References: <201403262230.s2QMUdH6021943@svn.freebsd.org> <5172B6F9-132D-4DEC-8936-970915AD1AC0@FreeBSD.org> Message-ID: <5a6b6db36eedb97db12d4b2d4aa8d086@shatow.net> X-Sender: bdrewery@FreeBSD.org User-Agent: Roundcube Webmail/0.9.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric , owner-src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 15:47:46 -0000 On 2014-03-27 10:39, David Chisnall wrote: > On 26 Mar 2014, at 22:30, Dimitry Andric wrote: > >> Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to >> process >> all the SUBDIR entries in parallel, instead of serially. Apply this >> option to a selected number of Makefiles, which can greatly speed up >> the >> build on multi-core machines, when using make -j. > > THANK YOU! That's really excellent. We can probably parallelise > pretty much all of usr.lib and usr.bin as well, but going from using 8 > cores to 17 is a very nice improvement. This should help tinderbox / > Jenkins build a LOT! > > David I'll do some wider tests on the portmgr boxes. We have some 32 cpu systems. -- Regards, Bryan Drewery From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 16:23:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82BAA61B; Thu, 27 Mar 2014 16:23:51 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05D9E623; Thu, 27 Mar 2014 16:23:50 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.8/8.14.8) with ESMTP id s2RGNkfh005254; Thu, 27 Mar 2014 18:23:46 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s2RGNkfh005254 Received: (from kostik@localhost) by tom.home (8.14.8/8.14.8/Submit) id s2RGNkBT005253; Thu, 27 Mar 2014 18:23:46 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 27 Mar 2014 18:23:46 +0200 From: Konstantin Belousov To: Mateusz Guzik Subject: Re: svn commit: r263755 - head/sys/kern Message-ID: <20140327162346.GR21331@kib.kiev.ua> References: <201403252330.s2PNUaei052956@svn.freebsd.org> <5333D70D.7050306@freebsd.org> <20140327083730.GA22942@dft-labs.eu> <5333E581.1000100@freebsd.org> <20140327145819.GA4730@dft-labs.eu> <20140327150512.GB4730@dft-labs.eu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Dx1O6sYEs5STvSrm" Content-Disposition: inline In-Reply-To: <20140327150512.GB4730@dft-labs.eu> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Xu , Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 16:23:51 -0000 --Dx1O6sYEs5STvSrm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 27, 2014 at 04:05:12PM +0100, Mateusz Guzik wrote: > On Thu, Mar 27, 2014 at 03:58:19PM +0100, Mateusz Guzik wrote: > > On Thu, Mar 27, 2014 at 04:46:57PM +0800, David Xu wrote: > > > On 2014/03/27 16:37, Mateusz Guzik wrote: > > > >On Thu, Mar 27, 2014 at 03:45:17PM +0800, David Xu wrote: > > > >>I think the async process pointer can be cleared when a process exi= ts > > > >>by registering an event handler. please see attached patch. > > > >> > > > > > > > >Sure, but I'm not very fond of this solution. > > > > > > > >This is a rather obscure bug you wont hit unless you explicitly try, > > > >and even then you need root privs by default. > > > > > > > OK, but I don't like the bug exists in kernel. It is not obscure for = me, > > > I can run "shutdown now" command, and insert a device, and then the > > > kernel will write garbage data into freed memory space. > > >=20 > >=20 > > Not sure what you mean. devd does not use this feature, and even if it > > did async_proc is cleared on close, which happens while signal delivery > > is still legal. > >=20 > > That said, you are not going to encounter this bug unless you code > > something up to specifically trigger it. > >=20 > > fwiw, I think we could axe this feature if there was no way to fix it > > without introducing a check for every process. > >=20 > > > >As such writing a callback function which will be executed for all e= xiting > > > >processes seems unjustified for me. > > > > > > > >Ideally we would get some mechanism which would allow to register > > > >callbacks for events related to given entity. Then it could be used = to > > > >provide a "call this function when process p exits", amongst other t= hings. > > > > > > >=20 > > > Yes, but the callback itself is cheap enough and is not worth to be > > > per-entity entry. > > >=20 > >=20 > > There is other code in the kernel which would benefit from such > > functionality - dev/syscons/scmouse, dev/vt/vt_core.c, aio and possibly > > more. > >=20 > > As such I think this is worth pursuing. > >=20 >=20 > We can hack around this one the way the other code is doing - apart from > from proc pointer you store pid and then compare result of pfind(pid). >=20 > This is still buggy as both proc and pid pointer can be recycled and end > up being the same (but you have an entrirely new process). >=20 > However, then in absolutely worst cae you send SIGIO to incorrect > process, always an existing process so no more corruption. >=20 > Would you be ok with such hack for the time being? Isn't p_sigiolist and fsetown(9) already provide the neccessary registration and cleanup on the process exit ? The KPI might require some generalizatio= n, but I think that the mechanism itself is enough. --Dx1O6sYEs5STvSrm Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJTNFCRAAoJEJDCuSvBvK1BRQ4P/1PXSIzOOABjwrDZbHzOLnd5 AlE/LbJ73FNQ3QXyQL0Lk/iLMvpgkwiTjkf37XoYb+CoUZlohRajeB1YB1FCHh10 Lkd+AAYd1lGa8s6ZdAn+luiIpO8TaPjKKFj2rkpju2n9OuiK6uCjsYopTu90UMAF SHp7qAjVcIBxguKOJaOiFCOhW+Amg0lWq1lbG+yawVr6lZW5kraQlxQQQmnRCm41 8cOoekkWbRcRV39sAO+FN1WF2JkVYCkaxk1Z5XvBEJT38piOVHMAJrFfkDy1ASOY OzCFEi8Z64E4I2JunjvU8LKMrQoLhaX8emA7sKawa2t66MGlycdptEyFN+wFUrvM Rkikg5Qc9WuHSeEgYVTVSerpxXI7miKCa2EJJb2qH76a7NWbLpZJ3fCbZAxnYVnm IBTgoPmXAbivCqr0Dnk/O3afu0UdrGbJPwEWx8IlLL0iHl7UBz/OS3k28vU7G2Yj 33KkgDSKEWYFLkzku1kf8cGVKGuAKManKbPN31s5vPw6rZcSixRrJgP5o3TQPYiP 4EL5PJUmGYEOgK+LNezSAQ5bAqaHoH5RbpiCMWJ61SWT6ZzpFmkFHnkvwrAaY4GH k05k1bUppDnUrt7LESD9RbTBqft2dpLpdlIkz00hXLt4fqBdaQ/H5S2/viVan3zp EJXqOieP3hFkuKW2h3Nk =AwI1 -----END PGP SIGNATURE----- --Dx1O6sYEs5STvSrm-- From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 17:05:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB4C7AC5 for ; Thu, 27 Mar 2014 17:05:09 +0000 (UTC) Received: from mail-pb0-f52.google.com (mail-pb0-f52.google.com [209.85.160.52]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CEE2A65 for ; Thu, 27 Mar 2014 17:05:09 +0000 (UTC) Received: by mail-pb0-f52.google.com with SMTP id rr13so3775997pbb.11 for ; Thu, 27 Mar 2014 10:05:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=r4Ao21kA+0eBnLZF1BHneQwZB7UMcJwFgi70IBJPKi4=; b=YZeph2lqBMzlr5SrEyQNWYOcxxTkotckxaI7irImFbYycB36Ok7uV+qWkgjVm4Z6Mo kDTgjibQ6djw3dTPt9ISPcEqy+8NWb/5IX4hUQBualuUBOwK1ez0M9iTksfLPdpSg0Xu IMk6NxV6g+tbMyAnNQiWlyJkn5kaZhrxKsUe34cp7pLjbZbPG64Bd5O9SYTHCjn/3f2G P6IR+439dfasGwCwxr3QO+mnXjyW3lo3oqyDFEL+hN3PQTPUJxnLvncV9o96/MnjBbF+ tAcjJnx9sFXjaF2vFvCncaVXmnJ0EwX4b2BKtq3JrpxtlLKC2soN4Q5e6y+RM35ebLne vGZw== X-Gm-Message-State: ALoCoQmt5uPyjqje7EHeAm3qZNa6f7kxJUCuAnixeWQWsk/2Je/Z2Kuu68D89ZRuPtDWACYjgthe X-Received: by 10.67.1.202 with SMTP id bi10mr3076190pad.68.1395939903721; Thu, 27 Mar 2014 10:05:03 -0700 (PDT) Received: from [10.64.26.19] (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id hw8sm11319542pbc.62.2014.03.27.10.05.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Mar 2014 10:05:03 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263778 - in head: bin lib lib/clang sbin share/mk usr.bin usr.sbin From: Warner Losh In-Reply-To: <201403262230.s2QMUdH6021943@svn.freebsd.org> Date: Thu, 27 Mar 2014 11:05:00 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201403262230.s2QMUdH6021943@svn.freebsd.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 17:05:09 -0000 Why not have this =91opt out=92 rather than =91opt in=92 like it is now? = Are there any known bad dependencies this introduces? Warner On Mar 26, 2014, at 4:30 PM, Dimitry Andric wrote: > Author: dim > Date: Wed Mar 26 22:30:38 2014 > New Revision: 263778 > URL: http://svnweb.freebsd.org/changeset/base/263778 >=20 > Log: > Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to = process > all the SUBDIR entries in parallel, instead of serially. Apply this > option to a selected number of Makefiles, which can greatly speed up = the > build on multi-core machines, when using make -j. >=20 > This can be extended to more Makefiles later on, whenever they are > verified to work correctly with parallel building. >=20 > I tested this on a 24-core machine, with make -j48 buildworld (N =3D = 6): >=20 > before stddev after stddev > =3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D = =3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D > real time 1741.1 16.5 959.8 2.7 > user time 12468.7 16.4 14393.0 16.8 > sys time 1825.0 54.8 2110.6 22.8 >=20 > (user+sys)/real 8.2 17.1 >=20 > E.g. the build was approximately 45% faster in real time. On = machines > with less cores, or with lower -j settings, the speedup will not be = as > impressive. But at least you can now almost max out a machine with > buildworld! >=20 > Submitted by: jilles > MFC after: 2 weeks >=20 > Modified: > head/bin/Makefile > head/lib/Makefile > head/lib/clang/Makefile > head/sbin/Makefile > head/share/mk/bsd.subdir.mk > head/usr.bin/Makefile > head/usr.sbin/Makefile >=20 > Modified: head/bin/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/bin/Makefile Wed Mar 26 20:43:40 2014 (r263777) > +++ head/bin/Makefile Wed Mar 26 22:30:38 2014 (r263778) > @@ -60,4 +60,6 @@ SUBDIR+=3D tests >=20 > SUBDIR:=3D ${SUBDIR:O} >=20 > +SUBDIR_PARALLEL=3D > + > .include >=20 > Modified: head/lib/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/lib/Makefile Wed Mar 26 20:43:40 2014 (r263777) > +++ head/lib/Makefile Wed Mar 26 22:30:38 2014 (r263778) > @@ -276,4 +276,8 @@ afterinstall: > ${INSTALL_SYMLINK} ../include ${DESTDIR}/usr/lib/include > .endif >=20 > +.if !make(install) > +SUBDIR_PARALLEL=3D > +.endif > + > .include >=20 > Modified: head/lib/clang/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/lib/clang/Makefile Wed Mar 26 20:43:40 2014 = (r263777) > +++ head/lib/clang/Makefile Wed Mar 26 22:30:38 2014 = (r263778) > @@ -147,4 +147,6 @@ SUBDIR+=3Dliblldb \ >=20 > SUBDIR+=3D include >=20 > +SUBDIR_PARALLEL=3D > + > .include >=20 > Modified: head/sbin/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sbin/Makefile Wed Mar 26 20:43:40 2014 = (r263777) > +++ head/sbin/Makefile Wed Mar 26 22:30:38 2014 = (r263778) > @@ -126,4 +126,6 @@ SUBDIR+=3D tests >=20 > SUBDIR:=3D ${SUBDIR:O} >=20 > +SUBDIR_PARALLEL=3D > + > .include >=20 > Modified: head/share/mk/bsd.subdir.mk > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/share/mk/bsd.subdir.mk Wed Mar 26 20:43:40 2014 = (r263777) > +++ head/share/mk/bsd.subdir.mk Wed Mar 26 22:30:38 2014 = (r263778) > @@ -71,7 +71,26 @@ ${SUBDIR}: .PHONY .MAKE > .for __target in all all-man checkdpadd clean cleandepend cleandir \ > cleanilinks depend distribute lint maninstall manlint obj objlink = \ > realinstall regress tags ${SUBDIR_TARGETS} > +.ifdef SUBDIR_PARALLEL > +.for __dir in ${SUBDIR} > +${__target}: ${__target}_subdir_${__dir} > +${__target}_subdir_${__dir}: .MAKE > + @${_+_}set -e; \ > + if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ > + ${ECHODIR} "=3D=3D=3D> = ${DIRPRFX}${__dir}.${MACHINE_ARCH} (${__target:realinstall=3Dinstall})"; = \ > + edir=3D${__dir}.${MACHINE_ARCH}; \ > + cd ${.CURDIR}/$${edir}; \ > + else \ > + ${ECHODIR} "=3D=3D=3D> ${DIRPRFX}${__dir} = (${__target:realinstall=3Dinstall})"; \ > + edir=3D${__dir}; \ > + cd ${.CURDIR}/$${edir}; \ > + fi; \ > + ${MAKE} ${__target:realinstall=3Dinstall} \ > + DIRPRFX=3D${DIRPRFX}$$edir/ > +.endfor > +.else > ${__target}: _SUBDIR > +.endif > .endfor >=20 > .for __target in files includes >=20 > Modified: head/usr.bin/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/usr.bin/Makefile Wed Mar 26 20:43:40 2014 = (r263777) > +++ head/usr.bin/Makefile Wed Mar 26 22:30:38 2014 = (r263778) > @@ -379,4 +379,6 @@ SUBDIR+=3D svn >=20 > SUBDIR:=3D ${SUBDIR:O} >=20 > +SUBDIR_PARALLEL=3D > + > .include >=20 > Modified: head/usr.sbin/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/usr.sbin/Makefile Wed Mar 26 20:43:40 2014 = (r263777) > +++ head/usr.sbin/Makefile Wed Mar 26 22:30:38 2014 = (r263778) > @@ -320,4 +320,6 @@ SUBDIR+=3D wpa >=20 > SUBDIR:=3D ${SUBDIR:O} >=20 > +SUBDIR_PARALLEL=3D > + > .include >=20 From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 17:08:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD916F4D for ; Thu, 27 Mar 2014 17:08:42 +0000 (UTC) Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EFBFAA9 for ; Thu, 27 Mar 2014 17:08:42 +0000 (UTC) Received: by mail-pd0-f177.google.com with SMTP id y10so3629603pdj.36 for ; Thu, 27 Mar 2014 10:08:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=c8CLuA2tXjO9SW9UEPplJ5YWSZ++boTWJSl2XAba3Fw=; b=VBSQWQo+I5YPOwJc28yF/BvbYt/kb2t75eRBVT2Va/E4QIOOa2NDtXHGdhLfgXGGZ5 xXrgSm+DyYZiYDNR2whhL7XapmfYD2B3b7qKJHFAHmBnPtMs1aal80+UVbtSQlJXJ0GO fXyFNJNQbXWCiIbjWLjK4ht+8VUBpr0uYNroX9NsQnD1AAe2Y0OWTK580r881rFj2BnR 0eyuNEKvtHinbQzG4jwGSPQcT/ga41mPvoFt+LHT48p9QNGnuCgfrqOsL0jbQY8S7YR0 fHpxkj4e4MvDcSvcMISD8z9rHCA54D6RXdULgG31RTIzAOF5BwEuh5K6Q/yb1Z/vejwm s+Dw== X-Gm-Message-State: ALoCoQkcgOqbm/VptQEos/QMXesurBbHlIuoig8FIVgB3qBtmeuOiaCKKrfqiAS6cvpxganAUu+w X-Received: by 10.66.164.229 with SMTP id yt5mr3017101pab.67.1395940116627; Thu, 27 Mar 2014 10:08:36 -0700 (PDT) Received: from [10.64.26.19] (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id oa3sm11406402pbb.15.2014.03.27.10.08.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Mar 2014 10:08:36 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263755 - head/sys/kern From: Warner Losh In-Reply-To: <20140327083730.GA22942@dft-labs.eu> Date: Thu, 27 Mar 2014 11:08:34 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <54C6CC48-3B3B-412C-8C74-1A0A32534CC4@gmail.com> References: <201403252330.s2PNUaei052956@svn.freebsd.org> <5333D70D.7050306@freebsd.org> <20140327083730.GA22942@dft-labs.eu> To: Mateusz Guzik X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Xu , Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 17:08:42 -0000 On Mar 27, 2014, at 2:37 AM, Mateusz Guzik wrote: > On Thu, Mar 27, 2014 at 03:45:17PM +0800, David Xu wrote: >> I think the async process pointer can be cleared when a process exits >> by registering an event handler. please see attached patch. >>=20 >=20 > Sure, but I'm not very fond of this solution. >=20 > This is a rather obscure bug you wont hit unless you explicitly try, > and even then you need root privs by default. >=20 > As such writing a callback function which will be executed for all = exiting > processes seems unjustified for me. >=20 > Ideally we would get some mechanism which would allow to register > callbacks for events related to given entity. Then it could be used to > provide a "call this function when process p exits", amongst other = things. I=92m wondering why the FD isn=92t getting closed and the close() = routine being called which should clear this pointer. Since we can only ever have one opener, = we know the close will always be called. What am I missing? Seems like an invented non-issue. Warner From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 17:25:02 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4749E500; Thu, 27 Mar 2014 17:25:02 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04F33C4C; Thu, 27 Mar 2014 17:25:01 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WTE2x-0005v0-3V; Thu, 27 Mar 2014 17:24:55 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s2RHOq1U078904; Thu, 27 Mar 2014 11:24:52 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX194mRqHL0ne6w3r7WYTMvtO Subject: Re: svn commit: r263778 - in head: bin lib lib/clang sbin share/mk usr.bin usr.sbin From: Ian Lepore To: Warner Losh In-Reply-To: References: <201403262230.s2QMUdH6021943@svn.freebsd.org> Content-Type: text/plain; charset="windows-1251" Date: Thu, 27 Mar 2014 11:24:52 -0600 Message-ID: <1395941092.81853.115.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by damnhippie.dyndns.org id s2RHOq1U078904 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Dimitry Andric X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 17:25:02 -0000 It's also a bit odd that the way of opting in makes it appear as if you're opting out. -- Ian On Thu, 2014-03-27 at 11:05 -0600, Warner Losh wrote: > Why not have this =91opt out=92 rather than =91opt in=92 like it is now= ? Are there any known bad dependencies this introduces? >=20 > Warner >=20 > On Mar 26, 2014, at 4:30 PM, Dimitry Andric wrote: >=20 > > Author: dim > > Date: Wed Mar 26 22:30:38 2014 > > New Revision: 263778 > > URL: http://svnweb.freebsd.org/changeset/base/263778 > >=20 > > Log: > > Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to proc= ess > > all the SUBDIR entries in parallel, instead of serially. Apply this > > option to a selected number of Makefiles, which can greatly speed up= the > > build on multi-core machines, when using make -j. > >=20 > > This can be extended to more Makefiles later on, whenever they are > > verified to work correctly with parallel building. > >=20 > > I tested this on a 24-core machine, with make -j48 buildworld (N =3D= 6): > >=20 > > before stddev after stddev > > =3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D =3D= =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D > > real time 1741.1 16.5 959.8 2.7 > > user time 12468.7 16.4 14393.0 16.8 > > sys time 1825.0 54.8 2110.6 22.8 > >=20 > > (user+sys)/real 8.2 17.1 > >=20 > > E.g. the build was approximately 45% faster in real time. On machin= es > > with less cores, or with lower -j settings, the speedup will not be = as > > impressive. But at least you can now almost max out a machine with > > buildworld! > >=20 > > Submitted by: jilles > > MFC after: 2 weeks > >=20 > > Modified: > > head/bin/Makefile > > head/lib/Makefile > > head/lib/clang/Makefile > > head/sbin/Makefile > > head/share/mk/bsd.subdir.mk > > head/usr.bin/Makefile > > head/usr.sbin/Makefile > >=20 > > Modified: head/bin/Makefile > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/bin/Makefile Wed Mar 26 20:43:40 2014 (r263777) > > +++ head/bin/Makefile Wed Mar 26 22:30:38 2014 (r263778) > > @@ -60,4 +60,6 @@ SUBDIR+=3D tests > >=20 > > SUBDIR:=3D ${SUBDIR:O} > >=20 > > +SUBDIR_PARALLEL=3D > > + > > .include > >=20 > > Modified: head/lib/Makefile > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/lib/Makefile Wed Mar 26 20:43:40 2014 (r263777) > > +++ head/lib/Makefile Wed Mar 26 22:30:38 2014 (r263778) > > @@ -276,4 +276,8 @@ afterinstall: > > ${INSTALL_SYMLINK} ../include ${DESTDIR}/usr/lib/include > > .endif > >=20 > > +.if !make(install) > > +SUBDIR_PARALLEL=3D > > +.endif > > + > > .include > >=20 > > Modified: head/lib/clang/Makefile > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/lib/clang/Makefile Wed Mar 26 20:43:40 2014 (r263777) > > +++ head/lib/clang/Makefile Wed Mar 26 22:30:38 2014 (r263778) > > @@ -147,4 +147,6 @@ SUBDIR+=3Dliblldb \ > >=20 > > SUBDIR+=3D include > >=20 > > +SUBDIR_PARALLEL=3D > > + > > .include > >=20 > > Modified: head/sbin/Makefile > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sbin/Makefile Wed Mar 26 20:43:40 2014 (r263777) > > +++ head/sbin/Makefile Wed Mar 26 22:30:38 2014 (r263778) > > @@ -126,4 +126,6 @@ SUBDIR+=3D tests > >=20 > > SUBDIR:=3D ${SUBDIR:O} > >=20 > > +SUBDIR_PARALLEL=3D > > + > > .include > >=20 > > Modified: head/share/mk/bsd.subdir.mk > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/share/mk/bsd.subdir.mk Wed Mar 26 20:43:40 2014 (r263777) > > +++ head/share/mk/bsd.subdir.mk Wed Mar 26 22:30:38 2014 (r263778) > > @@ -71,7 +71,26 @@ ${SUBDIR}: .PHONY .MAKE > > .for __target in all all-man checkdpadd clean cleandepend cleandir \ > > cleanilinks depend distribute lint maninstall manlint obj objlink= \ > > realinstall regress tags ${SUBDIR_TARGETS} > > +.ifdef SUBDIR_PARALLEL > > +.for __dir in ${SUBDIR} > > +${__target}: ${__target}_subdir_${__dir} > > +${__target}_subdir_${__dir}: .MAKE > > + @${_+_}set -e; \ > > + if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ > > + ${ECHODIR} "=3D=3D=3D> ${DIRPRFX}${__dir}.${MACHINE_ARCH} (${__ta= rget:realinstall=3Dinstall})"; \ > > + edir=3D${__dir}.${MACHINE_ARCH}; \ > > + cd ${.CURDIR}/$${edir}; \ > > + else \ > > + ${ECHODIR} "=3D=3D=3D> ${DIRPRFX}${__dir} (${__target:realinstall= =3Dinstall})"; \ > > + edir=3D${__dir}; \ > > + cd ${.CURDIR}/$${edir}; \ > > + fi; \ > > + ${MAKE} ${__target:realinstall=3Dinstall} \ > > + DIRPRFX=3D${DIRPRFX}$$edir/ > > +.endfor > > +.else > > ${__target}: _SUBDIR > > +.endif > > .endfor > >=20 > > .for __target in files includes > >=20 > > Modified: head/usr.bin/Makefile > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/usr.bin/Makefile Wed Mar 26 20:43:40 2014 (r263777) > > +++ head/usr.bin/Makefile Wed Mar 26 22:30:38 2014 (r263778) > > @@ -379,4 +379,6 @@ SUBDIR+=3D svn > >=20 > > SUBDIR:=3D ${SUBDIR:O} > >=20 > > +SUBDIR_PARALLEL=3D > > + > > .include > >=20 > > Modified: head/usr.sbin/Makefile > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/usr.sbin/Makefile Wed Mar 26 20:43:40 2014 (r263777) > > +++ head/usr.sbin/Makefile Wed Mar 26 22:30:38 2014 (r263778) > > @@ -320,4 +320,6 @@ SUBDIR+=3D wpa > >=20 > > SUBDIR:=3D ${SUBDIR:O} > >=20 > > +SUBDIR_PARALLEL=3D > > + > > .include > >=20 >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 18:12:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88A4B497; Thu, 27 Mar 2014 18:12:49 +0000 (UTC) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BCA14D; Thu, 27 Mar 2014 18:12:49 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id F2DCEB8069; Thu, 27 Mar 2014 19:12:45 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id E0FEB28497; Thu, 27 Mar 2014 19:12:45 +0100 (CET) Date: Thu, 27 Mar 2014 19:12:45 +0100 From: Jilles Tjoelker To: Warner Losh Subject: Re: svn commit: r263778 - in head: bin lib lib/clang sbin share/mk usr.bin usr.sbin Message-ID: <20140327181245.GA69977@stack.nl> References: <201403262230.s2QMUdH6021943@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 18:12:49 -0000 On Thu, Mar 27, 2014 at 11:05:00AM -0600, Warner Losh wrote: > On Mar 26, 2014, at 4:30 PM, Dimitry Andric wrote: > > Author: dim > > Date: Wed Mar 26 22:30:38 2014 > > New Revision: 263778 > > URL: http://svnweb.freebsd.org/changeset/base/263778 > > Log: > > Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to process > > all the SUBDIR entries in parallel, instead of serially. Apply this > > option to a selected number of Makefiles, which can greatly speed up the > > build on multi-core machines, when using make -j. > > This can be extended to more Makefiles later on, whenever they are > > verified to work correctly with parallel building. > Why not have this ‘opt out’ rather than ‘opt in’ like it is now? Are > there any known bad dependencies this introduces? I'm paranoid about build systems ;) It is easy to add dependencies across directories and as long as directories are built in sequence, nothing goes wrong. In fact, I had enabled SUBDIR_PARALLEL in sys/modules/Makefile as well, but this caused mysterious failures with some kernels such as mips ADM5120. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 18:23:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C9A568C; Thu, 27 Mar 2014 18:23:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C8CF215; Thu, 27 Mar 2014 18:23:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2RIN2TE013788; Thu, 27 Mar 2014 18:23:02 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2RIN2Y3013784; Thu, 27 Mar 2014 18:23:02 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403271823.s2RIN2Y3013784@svn.freebsd.org> From: Ed Maste Date: Thu, 27 Mar 2014 18:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263822 - in head/sys/amd64: amd64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 18:23:03 -0000 Author: emaste Date: Thu Mar 27 18:23:02 2014 New Revision: 263822 URL: http://svnweb.freebsd.org/changeset/base/263822 Log: amd64: Parse the EFI memory map if present With this change (and loader.efi from the projects/uefi branch) we can now boot under qemu using the OVMF UEFI firmware image with the limitation that a serial console is required. (This is largely r246337 from the projects/uefi branch.) Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/include/metadata.h Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu Mar 27 16:55:12 2014 (r263821) +++ head/sys/amd64/amd64/machdep.c Thu Mar 27 18:23:02 2014 (r263822) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1431,10 +1432,105 @@ bios_add_smap_entries(struct bios_smap * } } +#define efi_next_descriptor(ptr, size) \ + ((struct efi_md *)(((uint8_t *) ptr) + size)) + +static void +add_efi_map_entries(struct efi_map_header *efihdr, vm_paddr_t *physmap, + int *physmap_idx) +{ + struct efi_md *map, *p; + const char *type; + size_t efisz; + int ndesc, i; + + static const char *types[] = { + "Reserved", + "LoaderCode", + "LoaderData", + "BootServicesCode", + "BootServicesData", + "RuntimeServicesCode", + "RuntimeServicesData", + "ConventionalMemory", + "UnusableMemory", + "ACPIReclaimMemory", + "ACPIMemoryNVS", + "MemoryMappedIO", + "MemoryMappedIOPortSpace", + "PalCode" + }; + + /* + * Memory map data provided by UEFI via the GetMemoryMap + * Boot Services API. + */ + efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf; + map = (struct efi_md *)((uint8_t *)efihdr + efisz); + + if (efihdr->descriptor_size == 0) + return; + ndesc = efihdr->memory_size / efihdr->descriptor_size; + + if (boothowto & RB_VERBOSE) + printf("%23s %12s %12s %8s %4s\n", + "Type", "Physical", "Virtual", "#Pages", "Attr"); + + for (i = 0, p = map; i < ndesc; i++, + p = efi_next_descriptor(p, efihdr->descriptor_size)) { + if (boothowto & RB_VERBOSE) { + if (p->md_type <= EFI_MD_TYPE_PALCODE) + type = types[p->md_type]; + else + type = ""; + printf("%23s %012lx %12p %08lx ", type, p->md_phys, + p->md_virt, p->md_pages); + if (p->md_attr & EFI_MD_ATTR_UC) + printf("UC "); + if (p->md_attr & EFI_MD_ATTR_WC) + printf("WC "); + if (p->md_attr & EFI_MD_ATTR_WT) + printf("WT "); + if (p->md_attr & EFI_MD_ATTR_WB) + printf("WB "); + if (p->md_attr & EFI_MD_ATTR_UCE) + printf("UCE "); + if (p->md_attr & EFI_MD_ATTR_WP) + printf("WP "); + if (p->md_attr & EFI_MD_ATTR_RP) + printf("RP "); + if (p->md_attr & EFI_MD_ATTR_XP) + printf("XP "); + if (p->md_attr & EFI_MD_ATTR_RT) + printf("RUNTIME"); + printf("\n"); + } + + switch (p->md_type) { + case EFI_MD_TYPE_CODE: + case EFI_MD_TYPE_DATA: + case EFI_MD_TYPE_BS_CODE: + case EFI_MD_TYPE_BS_DATA: + case EFI_MD_TYPE_FREE: + /* + * We're allowed to use any entry with these types. + */ + break; + default: + continue; + } + + if (!add_physmap_entry(p->md_phys, (p->md_pages * PAGE_SIZE), + physmap, physmap_idx)) + break; + } +} + static void native_parse_memmap(caddr_t kmdp, vm_paddr_t *physmap, int *physmap_idx) { struct bios_smap *smap; + struct efi_map_header *efihdr; u_int32_t size; /* @@ -1445,13 +1541,19 @@ native_parse_memmap(caddr_t kmdp, vm_pad * ie: an int32_t immediately precedes smap. */ + efihdr = (struct efi_map_header *)preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_EFI_MAP); smap = (struct bios_smap *)preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_SMAP); - if (smap == NULL) - panic("No BIOS smap info from loader!"); - size = *((u_int32_t *)smap - 1); + if (efihdr == NULL && smap == NULL) + panic("No BIOS smap or EFI map info from loader!"); - bios_add_smap_entries(smap, size, physmap, physmap_idx); + if (efihdr != NULL) { + add_efi_map_entries(efihdr, physmap, physmap_idx); + } else { + size = *((u_int32_t *)smap - 1); + bios_add_smap_entries(smap, size, physmap, physmap_idx); + } } /* Modified: head/sys/amd64/include/metadata.h ============================================================================== --- head/sys/amd64/include/metadata.h Thu Mar 27 16:55:12 2014 (r263821) +++ head/sys/amd64/include/metadata.h Thu Mar 27 18:23:02 2014 (r263822) @@ -32,5 +32,12 @@ #define MODINFOMD_SMAP 0x1001 #define MODINFOMD_SMAP_XATTR 0x1002 #define MODINFOMD_DTBP 0x1003 +#define MODINFOMD_EFI_MAP 0x1004 + +struct efi_map_header { + size_t memory_size; + size_t descriptor_size; + uint32_t descriptor_version; +}; #endif /* !_MACHINE_METADATA_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 18:46:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA9A279; Thu, 27 Mar 2014 18:46:57 +0000 (UTC) Received: from mail-we0-x235.google.com (mail-we0-x235.google.com [IPv6:2a00:1450:400c:c03::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62F7D635; Thu, 27 Mar 2014 18:46:56 +0000 (UTC) Received: by mail-we0-f181.google.com with SMTP id q58so1983805wes.26 for ; Thu, 27 Mar 2014 11:46:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=iZ3RedeEzUsSAazlSJnzG5Aivi5TXo+WQWqFv1zqx5c=; b=iV1xtgWT3IvydspzgDEjgYzJZffMQgEfOrlUU2SXLqt/Yuw5viMgei7zHB8jsFXgt7 sQ0Jx+UAXxUQFYlmT0Xq+39SRLJYyfIbvnNGDBJR8Tsh+V3QynsJDl8kqrPZIIFVwZGq onlzELlDAlYiUU19pylIxrnd8nAylmBmyN7ZwlQ2u0Fo9WO312iPVjOrVSec6ItlAauR QtKL6jv0KfUSzRQj3zxMJ7n8mcTLPj84b3z3b18A4HArUJv8O4YRrL4qhtD3xS+YnQYN NrDafJ4IqBb+tS5SHUMXtpgwVRAVMzBhZvZgdpwRpQ65gJ1f9+J9tQTVyugxxWsJOYCc JzJA== X-Received: by 10.180.12.233 with SMTP id b9mr41568464wic.8.1395946014632; Thu, 27 Mar 2014 11:46:54 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id h19sm9684716wiw.17.2014.03.27.11.46.52 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 27 Mar 2014 11:46:53 -0700 (PDT) Date: Thu, 27 Mar 2014 19:46:50 +0100 From: Mateusz Guzik To: Warner Losh Subject: Re: svn commit: r263755 - head/sys/kern Message-ID: <20140327184650.GC4730@dft-labs.eu> References: <201403252330.s2PNUaei052956@svn.freebsd.org> <5333D70D.7050306@freebsd.org> <20140327083730.GA22942@dft-labs.eu> <54C6CC48-3B3B-412C-8C74-1A0A32534CC4@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <54C6CC48-3B3B-412C-8C74-1A0A32534CC4@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Xu , Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 18:46:57 -0000 On Thu, Mar 27, 2014 at 11:08:34AM -0600, Warner Losh wrote: > > On Mar 27, 2014, at 2:37 AM, Mateusz Guzik wrote: > > > On Thu, Mar 27, 2014 at 03:45:17PM +0800, David Xu wrote: > >> I think the async process pointer can be cleared when a process exits > >> by registering an event handler. please see attached patch. > >> > > > > Sure, but I'm not very fond of this solution. > > > > This is a rather obscure bug you wont hit unless you explicitly try, > > and even then you need root privs by default. > > > > As such writing a callback function which will be executed for all exiting > > processes seems unjustified for me. > > > > Ideally we would get some mechanism which would allow to register > > callbacks for events related to given entity. Then it could be used to > > provide a "call this function when process p exits", amongst other things. > > I’m wondering why the FD isn’t getting closed and the close() routine being called > which should clear this pointer. Since we can only ever have one opener, we > know the close will always be called. > > What am I missing? Seems like an invented non-issue. > This happens if you set yourself as async_proc and fork (so the child has the fd as well) or pass the fd to some other process before exiting. As was noted, this is not the case with devd so no rush. -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 19:43:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B38266E5; Thu, 27 Mar 2014 19:43:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 866AFC11; Thu, 27 Mar 2014 19:43:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2RJhdlK046523; Thu, 27 Mar 2014 19:43:39 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2RJhdpF046521; Thu, 27 Mar 2014 19:43:39 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403271943.s2RJhdpF046521@svn.freebsd.org> From: Ed Maste Date: Thu, 27 Mar 2014 19:43:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263826 - in head/sys: amd64/include dev/vt/hw/efifb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 19:43:39 -0000 Author: emaste Date: Thu Mar 27 19:43:38 2014 New Revision: 263826 URL: http://svnweb.freebsd.org/changeset/base/263826 Log: Update EFI framebuffer handoff from loader Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/include/metadata.h head/sys/dev/vt/hw/efifb/efifb.c Modified: head/sys/amd64/include/metadata.h ============================================================================== --- head/sys/amd64/include/metadata.h Thu Mar 27 19:16:28 2014 (r263825) +++ head/sys/amd64/include/metadata.h Thu Mar 27 19:43:38 2014 (r263826) @@ -33,11 +33,24 @@ #define MODINFOMD_SMAP_XATTR 0x1002 #define MODINFOMD_DTBP 0x1003 #define MODINFOMD_EFI_MAP 0x1004 +#define MODINFOMD_EFI_FB 0x1005 -struct efi_map_header { +struct efi_map_header { size_t memory_size; size_t descriptor_size; uint32_t descriptor_version; }; +struct efi_fb { + uint64_t fb_addr; + uint64_t fb_size; + int fb_height; + int fb_width; + int fb_stride; + uint32_t fb_mask_red; + uint32_t fb_mask_green; + uint32_t fb_mask_blue; + uint32_t fb_mask_reserved; +}; + #endif /* !_MACHINE_METADATA_H_ */ Modified: head/sys/dev/vt/hw/efifb/efifb.c ============================================================================== --- head/sys/dev/vt/hw/efifb/efifb.c Thu Mar 27 19:16:28 2014 (r263825) +++ head/sys/dev/vt/hw/efifb/efifb.c Thu Mar 27 19:43:38 2014 (r263826) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_platform.h" -#include #include #include #include @@ -85,8 +84,8 @@ vt_efb_init(struct vt_device *vd) kmdp = preload_search_by_type("elf kernel"); if (kmdp == NULL) kmdp = preload_search_by_type("elf64 kernel"); - efifb = (struct efi_fb *)preload_search_info(kmdp, - MODINFO_METADATA | MODINFOMD_EFI_FB); + efifb = (struct efi_fb *)preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_EFI_FB); if (efifb == NULL) return (CN_DEAD); From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 19:45:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97A07856; Thu, 27 Mar 2014 19:45:20 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "CAcert Class 3 Root" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 517E9C2C; Thu, 27 Mar 2014 19:45:20 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::4597:60bd:daa3:e698] (unknown [IPv6:2001:7b8:3a7:0:4597:60bd:daa3:e698]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 5EAAE5C43; Thu, 27 Mar 2014 20:45:17 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_4ABB0343-EB17-4279-B172-D88A99B7369C"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263778 - in head: bin lib lib/clang sbin share/mk usr.bin usr.sbin From: Dimitry Andric In-Reply-To: <20140327181245.GA69977@stack.nl> Date: Thu, 27 Mar 2014 20:44:58 +0100 Message-Id: <7A86F5E9-DBE9-4D3F-B166-C02F8386B722@FreeBSD.org> References: <201403262230.s2QMUdH6021943@svn.freebsd.org> <20140327181245.GA69977@stack.nl> To: Jilles Tjoelker X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 19:45:20 -0000 --Apple-Mail=_4ABB0343-EB17-4279-B172-D88A99B7369C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 27 Mar 2014, at 19:12, Jilles Tjoelker wrote: > On Thu, Mar 27, 2014 at 11:05:00AM -0600, Warner Losh wrote: >> On Mar 26, 2014, at 4:30 PM, Dimitry Andric wrote: >>> Author: dim >>> Date: Wed Mar 26 22:30:38 2014 >>> New Revision: 263778 >>> URL: http://svnweb.freebsd.org/changeset/base/263778 >=20 >>> Log: >>> Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to = process >>> all the SUBDIR entries in parallel, instead of serially. Apply this >>> option to a selected number of Makefiles, which can greatly speed up = the >>> build on multi-core machines, when using make -j. >=20 >>> This can be extended to more Makefiles later on, whenever they are >>> verified to work correctly with parallel building. >=20 >> Why not have this =91opt out=92 rather than =91opt in=92 like it is = now? Are >> there any known bad dependencies this introduces? >=20 > I'm paranoid about build systems ;) It is easy to add dependencies > across directories and as long as directories are built in sequence, > nothing goes wrong. >=20 > In fact, I had enabled SUBDIR_PARALLEL in sys/modules/Makefile as = well, > but this caused mysterious failures with some kernels such as mips > ADM5120. There are a bunch of other parts that don't really like parallel builds at the moment. For example, gnu/usr.bin/binutils needs its libraries (libbfd.a, etc) built first, before it can link the programs. Similar for gnu/usr.bin/cc, which needs libiberty, libcpp, etc before being able to build the rest of gcc. Most of these cases can hopefully be solved by adding .WAIT targets at strategic points in the SUBDIR lists, but this also needs a bit of extra logic in bsd.subdir.mk. -Dimitry =20 --Apple-Mail=_4ABB0343-EB17-4279-B172-D88A99B7369C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlM0f8sACgkQsF6jCi4glqOTfQCaAkGJu5927wUpXeC6pdZVbRpN wBQAoMvQEgXk7FN66EWB0z2vlxDcabyC =DEBK -----END PGP SIGNATURE----- --Apple-Mail=_4ABB0343-EB17-4279-B172-D88A99B7369C-- From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 20:15:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE6B2AF6; Thu, 27 Mar 2014 20:15:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BA5CF15; Thu, 27 Mar 2014 20:15:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2RKFYv1059803; Thu, 27 Mar 2014 20:15:34 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2RKFY67059800; Thu, 27 Mar 2014 20:15:34 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403272015.s2RKFY67059800@svn.freebsd.org> From: Dimitry Andric Date: Thu, 27 Mar 2014 20:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263833 - in head: gnu/usr.bin usr.bin/clang X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 20:15:34 -0000 Author: dim Date: Thu Mar 27 20:15:33 2014 New Revision: 263833 URL: http://svnweb.freebsd.org/changeset/base/263833 Log: Enable parallel building for gnu/usr.bin and usr.bin/clang too. MFC after: 2 weeks X-MFC-With: r263778 Modified: head/gnu/usr.bin/Makefile head/usr.bin/clang/Makefile Modified: head/gnu/usr.bin/Makefile ============================================================================== --- head/gnu/usr.bin/Makefile Thu Mar 27 20:14:50 2014 (r263832) +++ head/gnu/usr.bin/Makefile Thu Mar 27 20:15:33 2014 (r263833) @@ -46,4 +46,6 @@ _cc= cc _gdb= gdb .endif +SUBDIR_PARALLEL= + .include Modified: head/usr.bin/clang/Makefile ============================================================================== --- head/usr.bin/clang/Makefile Thu Mar 27 20:14:50 2014 (r263832) +++ head/usr.bin/clang/Makefile Thu Mar 27 20:15:33 2014 (r263833) @@ -29,4 +29,6 @@ SUBDIR+=lldb .endif .endif # TOOLS_PREFIX +SUBDIR_PARALLEL= + .include From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 21:43:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C8AE2FE; Thu, 27 Mar 2014 21:43:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC283A76; Thu, 27 Mar 2014 21:43:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2RLh1pR096735; Thu, 27 Mar 2014 21:43:01 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2RLh0f2096707; Thu, 27 Mar 2014 21:43:00 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201403272143.s2RLh0f2096707@svn.freebsd.org> From: Robert Watson Date: Thu, 27 Mar 2014 21:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263842 - in head/lib/libc: capability gen sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 21:43:02 -0000 Author: rwatson Date: Thu Mar 27 21:43:00 2014 New Revision: 263842 URL: http://svnweb.freebsd.org/changeset/base/263842 Log: Update system man pages for s/capability.h/capsicum.h/. MFC after: 3 weeks Modified: head/lib/libc/capability/cap_rights_init.3 head/lib/libc/gen/cap_rights_get.3 head/lib/libc/gen/cap_sandboxed.3 head/lib/libc/sys/cap_enter.2 head/lib/libc/sys/cap_fcntls_limit.2 head/lib/libc/sys/cap_ioctls_limit.2 head/lib/libc/sys/cap_rights_limit.2 Modified: head/lib/libc/capability/cap_rights_init.3 ============================================================================== --- head/lib/libc/capability/cap_rights_init.3 Thu Mar 27 21:32:02 2014 (r263841) +++ head/lib/libc/capability/cap_rights_init.3 Thu Mar 27 21:43:00 2014 (r263842) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 23, 2013 +.Dd March 27, 2014 .Dt CAP_RIGHTS_INIT 3 .Os .Sh NAME @@ -44,7 +44,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/capability.h +.In sys/capsicum.h .Ft cap_rights_t * .Fn cap_rights_init "cap_rights_t *rights" "..." .Ft cap_rights_t * Modified: head/lib/libc/gen/cap_rights_get.3 ============================================================================== --- head/lib/libc/gen/cap_rights_get.3 Thu Mar 27 21:32:02 2014 (r263841) +++ head/lib/libc/gen/cap_rights_get.3 Thu Mar 27 21:43:00 2014 (r263842) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 23, 2013 +.Dd March 27, 2014 .Dt CAP_RIGHTS_GET 3 .Os .Sh NAME @@ -37,7 +37,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/capability.h +.In sys/capsicum.h .Ft int .Fn cap_rights_get "int fd" "cap_rights_t *rights" .Sh DESCRIPTION Modified: head/lib/libc/gen/cap_sandboxed.3 ============================================================================== --- head/lib/libc/gen/cap_sandboxed.3 Thu Mar 27 21:32:02 2014 (r263841) +++ head/lib/libc/gen/cap_sandboxed.3 Thu Mar 27 21:43:00 2014 (r263842) @@ -1,3 +1,4 @@ +.\" .\" Copyright (c) 2012 The FreeBSD Foundation .\" All rights reserved. .\" @@ -27,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 18, 2012 +.Dd March 27, 2014 .Dt CAP_SANDBOXED 3 .Os .Sh NAME @@ -36,7 +37,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/capability.h +.In sys/capsicum.h .In stdbool.h .Ft bool .Fn cap_sandboxed "void" Modified: head/lib/libc/sys/cap_enter.2 ============================================================================== --- head/lib/libc/sys/cap_enter.2 Thu Mar 27 21:32:02 2014 (r263841) +++ head/lib/libc/sys/cap_enter.2 Thu Mar 27 21:43:00 2014 (r263842) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2012 +.Dd March 27, 2014 .Dt CAP_ENTER 2 .Os .Sh NAME @@ -38,7 +38,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/capability.h +.In sys/capsicum.h .Ft int .Fn cap_enter "void" .Ft int Modified: head/lib/libc/sys/cap_fcntls_limit.2 ============================================================================== --- head/lib/libc/sys/cap_fcntls_limit.2 Thu Mar 27 21:32:02 2014 (r263841) +++ head/lib/libc/sys/cap_fcntls_limit.2 Thu Mar 27 21:43:00 2014 (r263842) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2012 +.Dd March 27, 2014 .Dt CAP_FCNTLS_LIMIT 2 .Os .Sh NAME @@ -38,7 +38,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/capability.h +.In sys/capsicum.h .Ft int .Fn cap_fcntls_limit "int fd" "uint32_t fcntlrights" .Ft int Modified: head/lib/libc/sys/cap_ioctls_limit.2 ============================================================================== --- head/lib/libc/sys/cap_ioctls_limit.2 Thu Mar 27 21:32:02 2014 (r263841) +++ head/lib/libc/sys/cap_ioctls_limit.2 Thu Mar 27 21:43:00 2014 (r263842) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2012 +.Dd March 27, 2014 .Dt CAP_IOCTLS_LIMIT 2 .Os .Sh NAME @@ -38,7 +38,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/capability.h +.In sys/capsicum.h .Ft int .Fn cap_ioctls_limit "int fd" "const unsigned long *cmds" "size_t ncmds" .Ft ssize_t Modified: head/lib/libc/sys/cap_rights_limit.2 ============================================================================== --- head/lib/libc/sys/cap_rights_limit.2 Thu Mar 27 21:32:02 2014 (r263841) +++ head/lib/libc/sys/cap_rights_limit.2 Thu Mar 27 21:43:00 2014 (r263842) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 23, 2013 +.Dd March 27, 2014 .Dt CAP_RIGHTS_LIMIT 2 .Os .Sh NAME @@ -41,7 +41,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/capability.h +.In sys/capsicum.h .Ft int .Fn cap_rights_limit "int fd" "const cap_rights_t *rights" .Sh DESCRIPTION From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 22:31:49 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1EFDA3DA; Thu, 27 Mar 2014 22:31:49 +0000 (UTC) Received: from gw.catspoiler.org (gw.catspoiler.org [75.1.14.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAC43F4C; Thu, 27 Mar 2014 22:31:48 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s2RMVUu0008735; Thu, 27 Mar 2014 14:31:34 -0800 (PST) (envelope-from truckman@FreeBSD.org) Message-Id: <201403272231.s2RMVUu0008735@gw.catspoiler.org> Date: Thu, 27 Mar 2014 15:31:30 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r263755 - head/sys/kern To: kostikbel@gmail.com In-Reply-To: <20140327162346.GR21331@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: mjguzik@gmail.com, mjg@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, davidxu@FreeBSD.org, svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 22:31:49 -0000 On 27 Mar, Konstantin Belousov wrote: > On Thu, Mar 27, 2014 at 04:05:12PM +0100, Mateusz Guzik wrote: >> On Thu, Mar 27, 2014 at 03:58:19PM +0100, Mateusz Guzik wrote: >> > On Thu, Mar 27, 2014 at 04:46:57PM +0800, David Xu wrote: >> > > On 2014/03/27 16:37, Mateusz Guzik wrote: >> > > >On Thu, Mar 27, 2014 at 03:45:17PM +0800, David Xu wrote: >> > > >>I think the async process pointer can be cleared when a process exits >> > > >>by registering an event handler. please see attached patch. >> > > >> >> > > > >> > > >Sure, but I'm not very fond of this solution. >> > > > >> > > >This is a rather obscure bug you wont hit unless you explicitly try, >> > > >and even then you need root privs by default. >> > > > >> > > OK, but I don't like the bug exists in kernel. It is not obscure for me, >> > > I can run "shutdown now" command, and insert a device, and then the >> > > kernel will write garbage data into freed memory space. >> > > >> > >> > Not sure what you mean. devd does not use this feature, and even if it >> > did async_proc is cleared on close, which happens while signal delivery >> > is still legal. >> > >> > That said, you are not going to encounter this bug unless you code >> > something up to specifically trigger it. >> > >> > fwiw, I think we could axe this feature if there was no way to fix it >> > without introducing a check for every process. >> > >> > > >As such writing a callback function which will be executed for all exiting >> > > >processes seems unjustified for me. >> > > > >> > > >Ideally we would get some mechanism which would allow to register >> > > >callbacks for events related to given entity. Then it could be used to >> > > >provide a "call this function when process p exits", amongst other things. >> > > > >> > > >> > > Yes, but the callback itself is cheap enough and is not worth to be >> > > per-entity entry. >> > > >> > >> > There is other code in the kernel which would benefit from such >> > functionality - dev/syscons/scmouse, dev/vt/vt_core.c, aio and possibly >> > more. >> > >> > As such I think this is worth pursuing. >> > >> >> We can hack around this one the way the other code is doing - apart from >> from proc pointer you store pid and then compare result of pfind(pid). >> >> This is still buggy as both proc and pid pointer can be recycled and end >> up being the same (but you have an entrirely new process). >> >> However, then in absolutely worst cae you send SIGIO to incorrect >> process, always an existing process so no more corruption. >> >> Would you be ok with such hack for the time being? > > Isn't p_sigiolist and fsetown(9) already provide the neccessary registration > and cleanup on the process exit ? The KPI might require some generalization, > but I think that the mechanism itself is enough. That's the correct mechanism, but it's not being used here. Something like the following untested patch should do the trick: Index: sys/kern/subr_bus.c =================================================================== --- sys/kern/subr_bus.c (revision 263289) +++ sys/kern/subr_bus.c (working copy) @@ -402,7 +402,7 @@ struct cv cv; struct selinfo sel; struct devq devq; - struct proc *async_proc; + struct sigio *sigio; } devsoftc; static struct cdev *devctl_dev; @@ -425,7 +425,7 @@ /* move to init */ devsoftc.inuse = 1; devsoftc.nonblock = 0; - devsoftc.async_proc = NULL; + funsetown(&devsoftc.sigio); return (0); } @@ -436,7 +436,7 @@ mtx_lock(&devsoftc.mtx); cv_broadcast(&devsoftc.cv); mtx_unlock(&devsoftc.mtx); - devsoftc.async_proc = NULL; + funsetown(&devsoftc.sigio); return (0); } @@ -492,9 +492,8 @@ return (0); case FIOASYNC: if (*(int*)data) - devsoftc.async_proc = td->td_proc; - else - devsoftc.async_proc = NULL; + return (fsetown(td->td_proc->p_pid, &devsoftc.sigio)); + funsetown(&devsoftc.sigio); return (0); /* (un)Support for other fcntl() calls. */ @@ -546,7 +545,6 @@ devctl_queue_data_f(char *data, int flags) { struct dev_event_info *n1 = NULL, *n2 = NULL; - struct proc *p; if (strlen(data) == 0) goto out; @@ -576,12 +574,8 @@ cv_broadcast(&devsoftc.cv); mtx_unlock(&devsoftc.mtx); selwakeup(&devsoftc.sel); - p = devsoftc.async_proc; - if (p != NULL) { - PROC_LOCK(p); - kern_psignal(p, SIGIO); - PROC_UNLOCK(p); - } + if (devsoftc.sigio != NULL) + pgsigio(&devsoftc.sigio, SIGIO, 0); return; out: /* From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 22:52:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75CC5F51; Thu, 27 Mar 2014 22:52:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62B6E1F6; Thu, 27 Mar 2014 22:52:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2RMqRSD025253; Thu, 27 Mar 2014 22:52:27 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2RMqRgB025252; Thu, 27 Mar 2014 22:52:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201403272252.s2RMqRgB025252@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 27 Mar 2014 22:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263846 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 22:52:27 -0000 Author: jilles Date: Thu Mar 27 22:52:26 2014 New Revision: 263846 URL: http://svnweb.freebsd.org/changeset/base/263846 Log: sh: Fix memory leak when trying to set a read only variable. MFC after: 1 week Modified: head/bin/sh/var.c Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Thu Mar 27 22:48:48 2014 (r263845) +++ head/bin/sh/var.c Thu Mar 27 22:52:26 2014 (r263846) @@ -325,8 +325,11 @@ setvareq(char *s, int flags) mklocal(s); vp = find_var(s, &vpp, &nlen); if (vp != NULL) { - if (vp->flags & VREADONLY) + if (vp->flags & VREADONLY) { + if ((flags & (VTEXTFIXED|VSTACK)) == 0) + ckfree(s); error("%.*s: is read only", vp->name_len, s); + } if (flags & VNOSET) return; INTOFF; From owner-svn-src-head@FreeBSD.ORG Thu Mar 27 22:57:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0214129E; Thu, 27 Mar 2014 22:57:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E335B247; Thu, 27 Mar 2014 22:57:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2RMvNGR025857; Thu, 27 Mar 2014 22:57:23 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2RMvNg7025856; Thu, 27 Mar 2014 22:57:23 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201403272257.s2RMvNg7025856@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 27 Mar 2014 22:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263847 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 22:57:24 -0000 Author: jilles Date: Thu Mar 27 22:57:23 2014 New Revision: 263847 URL: http://svnweb.freebsd.org/changeset/base/263847 Log: sh: Fix memory leak with an assignment before a regular builtin. MFC after: 1 week Modified: head/bin/sh/var.c Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Thu Mar 27 22:52:26 2014 (r263846) +++ head/bin/sh/var.c Thu Mar 27 22:57:23 2014 (r263847) @@ -330,8 +330,11 @@ setvareq(char *s, int flags) ckfree(s); error("%.*s: is read only", vp->name_len, s); } - if (flags & VNOSET) + if (flags & VNOSET) { + if ((flags & (VTEXTFIXED|VSTACK)) == 0) + ckfree(s); return; + } INTOFF; if (vp->func && (flags & VNOFUNC) == 0) @@ -364,8 +367,11 @@ setvareq(char *s, int flags) return; } /* not found */ - if (flags & VNOSET) + if (flags & VNOSET) { + if ((flags & (VTEXTFIXED|VSTACK)) == 0) + ckfree(s); return; + } INTOFF; vp = ckmalloc(sizeof (*vp)); vp->flags = flags; From owner-svn-src-head@FreeBSD.ORG Fri Mar 28 01:43:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB615488; Fri, 28 Mar 2014 01:43:37 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBBC965E; Fri, 28 Mar 2014 01:43:37 +0000 (UTC) Received: from xyf.my.dom (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s2S1hZ3Q025053; Fri, 28 Mar 2014 01:43:36 GMT (envelope-from davidxu@freebsd.org) Message-ID: <5334D3F4.8080000@freebsd.org> Date: Fri, 28 Mar 2014 09:44:20 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Mateusz Guzik Subject: Re: svn commit: r263755 - head/sys/kern References: <201403252330.s2PNUaei052956@svn.freebsd.org> <5333D70D.7050306@freebsd.org> <20140327083730.GA22942@dft-labs.eu> <5333E581.1000100@freebsd.org> <20140327145819.GA4730@dft-labs.eu> In-Reply-To: <20140327145819.GA4730@dft-labs.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 01:43:38 -0000 On 2014/03/27 22:58, Mateusz Guzik wrote: > On Thu, Mar 27, 2014 at 04:46:57PM +0800, David Xu wrote: >> On 2014/03/27 16:37, Mateusz Guzik wrote: >>> On Thu, Mar 27, 2014 at 03:45:17PM +0800, David Xu wrote: >>>> I think the async process pointer can be cleared when a process exits >>>> by registering an event handler. please see attached patch. >>>> >>> >>> Sure, but I'm not very fond of this solution. >>> >>> This is a rather obscure bug you wont hit unless you explicitly try, >>> and even then you need root privs by default. >>> >> OK, but I don't like the bug exists in kernel. It is not obscure for me, >> I can run "shutdown now" command, and insert a device, and then the >> kernel will write garbage data into freed memory space. >> > > Not sure what you mean. devd does not use this feature, and even if it > did async_proc is cleared on close, which happens while signal delivery > is still legal. > Thers is no race conidtion when using lock to protect it. > That said, you are not going to encounter this bug unless you code > something up to specifically trigger it. > > fwiw, I think we could axe this feature if there was no way to fix it > without introducing a check for every process. > If you added a feature, you can not assume people won't use it. >>> As such writing a callback function which will be executed for all exiting >>> processes seems unjustified for me. >>> >>> Ideally we would get some mechanism which would allow to register >>> callbacks for events related to given entity. Then it could be used to >>> provide a "call this function when process p exits", amongst other things. >>> >> >> Yes, but the callback itself is cheap enough and is not worth to be >> per-entity entry. >> > > There is other code in the kernel which would benefit from such > functionality - dev/syscons/scmouse, dev/vt/vt_core.c, aio and possibly > more. > > As such I think this is worth pursuing. > I can not say more, it seems it is an extension. From owner-svn-src-head@FreeBSD.ORG Fri Mar 28 01:47:32 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C16D4604; Fri, 28 Mar 2014 01:47:32 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB725684; Fri, 28 Mar 2014 01:47:32 +0000 (UTC) Received: from xyf.my.dom (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s2S1lUQr025173; Fri, 28 Mar 2014 01:47:30 GMT (envelope-from davidxu@freebsd.org) Message-ID: <5334D4DF.4050901@freebsd.org> Date: Fri, 28 Mar 2014 09:48:15 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Don Lewis , kostikbel@gmail.com Subject: Re: svn commit: r263755 - head/sys/kern References: <201403272231.s2RMVUu0008735@gw.catspoiler.org> In-Reply-To: <201403272231.s2RMVUu0008735@gw.catspoiler.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, mjguzik@gmail.com, src-committers@FreeBSD.org, mjg@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 01:47:32 -0000 On 2014/03/28 06:31, Don Lewis wrote: > On 27 Mar, Konstantin Belousov wrote: >> On Thu, Mar 27, 2014 at 04:05:12PM +0100, Mateusz Guzik wrote: >>> On Thu, Mar 27, 2014 at 03:58:19PM +0100, Mateusz Guzik wrote: >>>> On Thu, Mar 27, 2014 at 04:46:57PM +0800, David Xu wrote: >>>>> On 2014/03/27 16:37, Mateusz Guzik wrote: >>>>>> On Thu, Mar 27, 2014 at 03:45:17PM +0800, David Xu wrote: >>>>>>> I think the async process pointer can be cleared when a process exits >>>>>>> by registering an event handler. please see attached patch. >>>>>>> >>>>>> >>>>>> Sure, but I'm not very fond of this solution. >>>>>> >>>>>> This is a rather obscure bug you wont hit unless you explicitly try, >>>>>> and even then you need root privs by default. >>>>>> >>>>> OK, but I don't like the bug exists in kernel. It is not obscure for me, >>>>> I can run "shutdown now" command, and insert a device, and then the >>>>> kernel will write garbage data into freed memory space. >>>>> >>>> >>>> Not sure what you mean. devd does not use this feature, and even if it >>>> did async_proc is cleared on close, which happens while signal delivery >>>> is still legal. >>>> >>>> That said, you are not going to encounter this bug unless you code >>>> something up to specifically trigger it. >>>> >>>> fwiw, I think we could axe this feature if there was no way to fix it >>>> without introducing a check for every process. >>>> >>>>>> As such writing a callback function which will be executed for all exiting >>>>>> processes seems unjustified for me. >>>>>> >>>>>> Ideally we would get some mechanism which would allow to register >>>>>> callbacks for events related to given entity. Then it could be used to >>>>>> provide a "call this function when process p exits", amongst other things. >>>>>> >>>>> >>>>> Yes, but the callback itself is cheap enough and is not worth to be >>>>> per-entity entry. >>>>> >>>> >>>> There is other code in the kernel which would benefit from such >>>> functionality - dev/syscons/scmouse, dev/vt/vt_core.c, aio and possibly >>>> more. >>>> >>>> As such I think this is worth pursuing. >>>> >>> >>> We can hack around this one the way the other code is doing - apart from >>> from proc pointer you store pid and then compare result of pfind(pid). >>> >>> This is still buggy as both proc and pid pointer can be recycled and end >>> up being the same (but you have an entrirely new process). >>> >>> However, then in absolutely worst cae you send SIGIO to incorrect >>> process, always an existing process so no more corruption. >>> >>> Would you be ok with such hack for the time being? >> >> Isn't p_sigiolist and fsetown(9) already provide the neccessary registration >> and cleanup on the process exit ? The KPI might require some generalization, >> but I think that the mechanism itself is enough. > > That's the correct mechanism, but it's not being used here. > > Something like the following untested patch should do the trick: > > Index: sys/kern/subr_bus.c > =================================================================== > --- sys/kern/subr_bus.c (revision 263289) > +++ sys/kern/subr_bus.c (working copy) > @@ -402,7 +402,7 @@ > struct cv cv; > struct selinfo sel; > struct devq devq; > - struct proc *async_proc; > + struct sigio *sigio; > } devsoftc; > > static struct cdev *devctl_dev; > @@ -425,7 +425,7 @@ > /* move to init */ > devsoftc.inuse = 1; > devsoftc.nonblock = 0; > - devsoftc.async_proc = NULL; > + funsetown(&devsoftc.sigio); > return (0); > } > > @@ -436,7 +436,7 @@ > mtx_lock(&devsoftc.mtx); > cv_broadcast(&devsoftc.cv); > mtx_unlock(&devsoftc.mtx); > - devsoftc.async_proc = NULL; > + funsetown(&devsoftc.sigio); > return (0); > } > > @@ -492,9 +492,8 @@ > return (0); > case FIOASYNC: > if (*(int*)data) > - devsoftc.async_proc = td->td_proc; > - else > - devsoftc.async_proc = NULL; > + return (fsetown(td->td_proc->p_pid, &devsoftc.sigio)); > + funsetown(&devsoftc.sigio); > return (0); > > /* (un)Support for other fcntl() calls. */ > @@ -546,7 +545,6 @@ > devctl_queue_data_f(char *data, int flags) > { > struct dev_event_info *n1 = NULL, *n2 = NULL; > - struct proc *p; > > if (strlen(data) == 0) > goto out; > @@ -576,12 +574,8 @@ > cv_broadcast(&devsoftc.cv); > mtx_unlock(&devsoftc.mtx); > selwakeup(&devsoftc.sel); > - p = devsoftc.async_proc; > - if (p != NULL) { > - PROC_LOCK(p); > - kern_psignal(p, SIGIO); > - PROC_UNLOCK(p); > - } > + if (devsoftc.sigio != NULL) > + pgsigio(&devsoftc.sigio, SIGIO, 0); > return; > out: > /* > > Hope this works. From owner-svn-src-head@FreeBSD.ORG Fri Mar 28 02:38:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7EDD6B2; Fri, 28 Mar 2014 02:38:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4250AB3; Fri, 28 Mar 2014 02:38:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2S2cEKg020828; Fri, 28 Mar 2014 02:38:14 GMT (envelope-from takawata@svn.freebsd.org) Received: (from takawata@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2S2cEQS020827; Fri, 28 Mar 2014 02:38:14 GMT (envelope-from takawata@svn.freebsd.org) Message-Id: <201403280238.s2S2cEQS020827@svn.freebsd.org> From: Takanori Watanabe Date: Fri, 28 Mar 2014 02:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263859 - head/sys/x86/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 02:38:14 -0000 Author: takawata Date: Fri Mar 28 02:38:14 2014 New Revision: 263859 URL: http://svnweb.freebsd.org/changeset/base/263859 Log: Change default logic to CONFORM because this routine is shared with SCI polarity setting. Reviewed by: jhb Modified: head/sys/x86/acpica/madt.c Modified: head/sys/x86/acpica/madt.c ============================================================================== --- head/sys/x86/acpica/madt.c Fri Mar 28 02:06:51 2014 (r263858) +++ head/sys/x86/acpica/madt.c Fri Mar 28 02:38:14 2014 (r263859) @@ -298,6 +298,9 @@ interrupt_polarity(UINT16 IntiFlags, UIN { switch (IntiFlags & ACPI_MADT_POLARITY_MASK) { + default: + printf("WARNING: Bogus Interrupt Polarity. Assume CONFORMS"); + /* FALLTHROUGH*/ case ACPI_MADT_POLARITY_CONFORMS: if (Source == AcpiGbl_FADT.SciInterrupt) return (INTR_POLARITY_LOW); @@ -306,11 +309,8 @@ interrupt_polarity(UINT16 IntiFlags, UIN case ACPI_MADT_POLARITY_ACTIVE_HIGH: return (INTR_POLARITY_HIGH); case ACPI_MADT_POLARITY_ACTIVE_LOW: - break; - default: - printf("WARNING: Bogus Interrupt Polarity. Assume POLALITY LOW"); + return (INTR_POLARITY_LOW); } - return (INTR_POLARITY_LOW); } static enum intr_trigger @@ -318,6 +318,9 @@ interrupt_trigger(UINT16 IntiFlags, UINT { switch (IntiFlags & ACPI_MADT_TRIGGER_MASK) { + default: + printf("WARNING: Bogus Interrupt Trigger Mode. Assume CONFORMS."); + /*FALLTHROUGH*/ case ACPI_MADT_TRIGGER_CONFORMS: if (Source == AcpiGbl_FADT.SciInterrupt) return (INTR_TRIGGER_LEVEL); @@ -326,13 +329,8 @@ interrupt_trigger(UINT16 IntiFlags, UINT case ACPI_MADT_TRIGGER_EDGE: return (INTR_TRIGGER_EDGE); case ACPI_MADT_TRIGGER_LEVEL: - break; - default: - printf("WARNING: Bogus Interrupt Trigger Mode. Assume Level trigger."); - - break; + return (INTR_TRIGGER_LEVEL); } - return (INTR_TRIGGER_LEVEL); } /* From owner-svn-src-head@FreeBSD.ORG Fri Mar 28 04:19:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E384AF2A; Fri, 28 Mar 2014 04:19:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8A65352; Fri, 28 Mar 2014 04:19:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2S4J7Y9062397; Fri, 28 Mar 2014 04:19:07 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2S4J6Yr062393; Fri, 28 Mar 2014 04:19:06 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201403280419.s2S4J6Yr062393@svn.freebsd.org> From: Glen Barber Date: Fri, 28 Mar 2014 04:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263863 - head/lib/libmd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 04:19:08 -0000 Author: gjb Date: Fri Mar 28 04:19:06 2014 New Revision: 263863 URL: http://svnweb.freebsd.org/changeset/base/263863 Log: Dereference nonexistent md2(3) manual. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/lib/libmd/ripemd.3 head/lib/libmd/sha.3 head/lib/libmd/sha256.3 head/lib/libmd/sha512.3 Modified: head/lib/libmd/ripemd.3 ============================================================================== --- head/lib/libmd/ripemd.3 Fri Mar 28 04:14:40 2014 (r263862) +++ head/lib/libmd/ripemd.3 Fri Mar 28 04:19:06 2014 (r263863) @@ -9,7 +9,7 @@ .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" $FreeBSD$ .\" -.Dd February 26, 1999 +.Dd March 28, 2014 .Dt RIPEMD 3 .Os .Sh NAME @@ -123,7 +123,6 @@ If the .Fa buf argument is non-null it must point to at least 41 characters of buffer space. .Sh SEE ALSO -.Xr md2 3 , .Xr md4 3 , .Xr md5 3 , .Xr sha 3 Modified: head/lib/libmd/sha.3 ============================================================================== --- head/lib/libmd/sha.3 Fri Mar 28 04:14:40 2014 (r263862) +++ head/lib/libmd/sha.3 Fri Mar 28 04:19:06 2014 (r263863) @@ -9,7 +9,7 @@ .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" $FreeBSD$ .\" -.Dd February 25, 1999 +.Dd March 28, 2014 .Dt SHA 3 .Os .Sh NAME @@ -154,7 +154,6 @@ If the .Fa buf argument is non-null it must point to at least 41 characters of buffer space. .Sh SEE ALSO -.Xr md2 3 , .Xr md4 3 , .Xr md5 3 , .Xr ripemd 3 , Modified: head/lib/libmd/sha256.3 ============================================================================== --- head/lib/libmd/sha256.3 Fri Mar 28 04:14:40 2014 (r263862) +++ head/lib/libmd/sha256.3 Fri Mar 28 04:19:06 2014 (r263863) @@ -9,7 +9,7 @@ .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" $FreeBSD$ .\" -.Dd September 14, 2005 +.Dd March 28, 2014 .Dt SHA256 3 .Os .Sh NAME @@ -120,7 +120,6 @@ If the .Fa buf argument is non-null it must point to at least 65 characters of buffer space. .Sh SEE ALSO -.Xr md2 3 , .Xr md4 3 , .Xr md5 3 , .Xr ripemd 3 , Modified: head/lib/libmd/sha512.3 ============================================================================== --- head/lib/libmd/sha512.3 Fri Mar 28 04:14:40 2014 (r263862) +++ head/lib/libmd/sha512.3 Fri Mar 28 04:19:06 2014 (r263863) @@ -9,7 +9,7 @@ .\" From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp .\" $FreeBSD$ .\" -.Dd April 1, 2011 +.Dd March 28, 2014 .Dt SHA512 3 .Os .Sh NAME @@ -120,7 +120,6 @@ If the .Fa buf argument is non-null it must point to at least 65 characters of buffer space. .Sh SEE ALSO -.Xr md2 3 , .Xr md4 3 , .Xr md5 3 , .Xr ripemd 3 , From owner-svn-src-head@FreeBSD.ORG Fri Mar 28 06:26:05 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E95483D9; Fri, 28 Mar 2014 06:26:05 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3A6671; Fri, 28 Mar 2014 06:26:05 +0000 (UTC) Received: from xyf.my.dom (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s2S6Q2KV012370; Fri, 28 Mar 2014 06:26:03 GMT (envelope-from davidxu@freebsd.org) Message-ID: <53351627.9000703@freebsd.org> Date: Fri, 28 Mar 2014 14:26:47 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Don Lewis , kostikbel@gmail.com Subject: Re: svn commit: r263755 - head/sys/kern References: <201403272231.s2RMVUu0008735@gw.catspoiler.org> In-Reply-To: <201403272231.s2RMVUu0008735@gw.catspoiler.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, mjguzik@gmail.com, src-committers@FreeBSD.org, mjg@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 06:26:06 -0000 On 2014/03/28 06:31, Don Lewis wrote: > On 27 Mar, Konstantin Belousov wrote: >> On Thu, Mar 27, 2014 at 04:05:12PM +0100, Mateusz Guzik wrote: >>> On Thu, Mar 27, 2014 at 03:58:19PM +0100, Mateusz Guzik wrote: >>>> On Thu, Mar 27, 2014 at 04:46:57PM +0800, David Xu wrote: >>>>> On 2014/03/27 16:37, Mateusz Guzik wrote: >>>>>> On Thu, Mar 27, 2014 at 03:45:17PM +0800, David Xu wrote: >>>>>>> I think the async process pointer can be cleared when a process exits >>>>>>> by registering an event handler. please see attached patch. >>>>>>> >>>>>> >>>>>> Sure, but I'm not very fond of this solution. >>>>>> >>>>>> This is a rather obscure bug you wont hit unless you explicitly try, >>>>>> and even then you need root privs by default. >>>>>> >>>>> OK, but I don't like the bug exists in kernel. It is not obscure for me, >>>>> I can run "shutdown now" command, and insert a device, and then the >>>>> kernel will write garbage data into freed memory space. >>>>> >>>> >>>> Not sure what you mean. devd does not use this feature, and even if it >>>> did async_proc is cleared on close, which happens while signal delivery >>>> is still legal. >>>> >>>> That said, you are not going to encounter this bug unless you code >>>> something up to specifically trigger it. >>>> >>>> fwiw, I think we could axe this feature if there was no way to fix it >>>> without introducing a check for every process. >>>> >>>>>> As such writing a callback function which will be executed for all exiting >>>>>> processes seems unjustified for me. >>>>>> >>>>>> Ideally we would get some mechanism which would allow to register >>>>>> callbacks for events related to given entity. Then it could be used to >>>>>> provide a "call this function when process p exits", amongst other things. >>>>>> >>>>> >>>>> Yes, but the callback itself is cheap enough and is not worth to be >>>>> per-entity entry. >>>>> >>>> >>>> There is other code in the kernel which would benefit from such >>>> functionality - dev/syscons/scmouse, dev/vt/vt_core.c, aio and possibly >>>> more. >>>> >>>> As such I think this is worth pursuing. >>>> >>> >>> We can hack around this one the way the other code is doing - apart from >>> from proc pointer you store pid and then compare result of pfind(pid). >>> >>> This is still buggy as both proc and pid pointer can be recycled and end >>> up being the same (but you have an entrirely new process). >>> >>> However, then in absolutely worst cae you send SIGIO to incorrect >>> process, always an existing process so no more corruption. >>> >>> Would you be ok with such hack for the time being? >> >> Isn't p_sigiolist and fsetown(9) already provide the neccessary registration >> and cleanup on the process exit ? The KPI might require some generalization, >> but I think that the mechanism itself is enough. > > That's the correct mechanism, but it's not being used here. > > Something like the following untested patch should do the trick: > > Index: sys/kern/subr_bus.c > =================================================================== > --- sys/kern/subr_bus.c (revision 263289) > +++ sys/kern/subr_bus.c (working copy) > @@ -402,7 +402,7 @@ > struct cv cv; > struct selinfo sel; > struct devq devq; > - struct proc *async_proc; > + struct sigio *sigio; > } devsoftc; > > static struct cdev *devctl_dev; > @@ -425,7 +425,7 @@ > /* move to init */ > devsoftc.inuse = 1; > devsoftc.nonblock = 0; > - devsoftc.async_proc = NULL; > + funsetown(&devsoftc.sigio); > return (0); > } > > @@ -436,7 +436,7 @@ > mtx_lock(&devsoftc.mtx); > cv_broadcast(&devsoftc.cv); > mtx_unlock(&devsoftc.mtx); > - devsoftc.async_proc = NULL; > + funsetown(&devsoftc.sigio); > return (0); > } > > @@ -492,9 +492,8 @@ > return (0); > case FIOASYNC: > if (*(int*)data) > - devsoftc.async_proc = td->td_proc; > - else > - devsoftc.async_proc = NULL; > + return (fsetown(td->td_proc->p_pid, &devsoftc.sigio)); > + funsetown(&devsoftc.sigio); > return (0); > > /* (un)Support for other fcntl() calls. */ > @@ -546,7 +545,6 @@ > devctl_queue_data_f(char *data, int flags) > { > struct dev_event_info *n1 = NULL, *n2 = NULL; > - struct proc *p; > > if (strlen(data) == 0) > goto out; > @@ -576,12 +574,8 @@ > cv_broadcast(&devsoftc.cv); > mtx_unlock(&devsoftc.mtx); > selwakeup(&devsoftc.sel); > - p = devsoftc.async_proc; > - if (p != NULL) { > - PROC_LOCK(p); > - kern_psignal(p, SIGIO); > - PROC_UNLOCK(p); > - } > + if (devsoftc.sigio != NULL) > + pgsigio(&devsoftc.sigio, SIGIO, 0); > return; > out: > /* > > I have tweaked it a bit, is this okay ? # HG changeset patch # Parent 53b614ff2cae108f27e4475989d3a86997017268 diff -r 53b614ff2cae sys/kern/subr_bus.c --- a/sys/kern/subr_bus.c Thu Mar 27 10:03:50 2014 +0800 +++ b/sys/kern/subr_bus.c Fri Mar 28 14:22:29 2014 +0800 @@ -391,11 +391,12 @@ int inuse; int nonblock; int queued; + int async; struct mtx mtx; struct cv cv; struct selinfo sel; struct devq devq; - struct proc *async_proc; + struct sigio *sigio; } devsoftc; static struct cdev *devctl_dev; @@ -422,7 +423,8 @@ /* move to init */ devsoftc.inuse = 1; devsoftc.nonblock = 0; - devsoftc.async_proc = NULL; + devsoftc.async = 0; + devsoftc.sigio = NULL; mtx_unlock(&devsoftc.mtx); return (0); } @@ -433,8 +435,9 @@ mtx_lock(&devsoftc.mtx); devsoftc.inuse = 0; - devsoftc.async_proc = NULL; + devsoftc.async = 0; cv_broadcast(&devsoftc.cv); + funsetown(&devsoftc.sigio); mtx_unlock(&devsoftc.mtx); return (0); } @@ -490,33 +493,21 @@ devsoftc.nonblock = 0; return (0); case FIOASYNC: - /* - * FIXME: - * Since this is a simple assignment there is no guarantee that - * devsoftc.async_proc consumers will get a valid pointer. - * - * Example scenario where things break (processes A and B): - * 1. A opens devctl - * 2. A sends fd to B - * 3. B sets itself as async_proc - * 4. B exits - * - * However, normally this requires root privileges and the only - * in-tree consumer does not behave in a dangerous way so the - * issue is not critical. - */ if (*(int*)data) - devsoftc.async_proc = td->td_proc; + devsoftc.async = 1; else - devsoftc.async_proc = NULL; + devsoftc.async = 0; + return (0); + case FIOSETOWN: + return fsetown(*(int *)data, &devsoftc.sigio); + case FIOGETOWN: + *(int *)data = fgetown(&devsoftc.sigio); return (0); /* (un)Support for other fcntl() calls. */ case FIOCLEX: case FIONCLEX: case FIONREAD: - case FIOSETOWN: - case FIOGETOWN: default: break; } @@ -560,7 +551,6 @@ devctl_queue_data_f(char *data, int flags) { struct dev_event_info *n1 = NULL, *n2 = NULL; - struct proc *p; if (strlen(data) == 0) goto out; @@ -590,13 +580,8 @@ cv_broadcast(&devsoftc.cv); mtx_unlock(&devsoftc.mtx); selwakeup(&devsoftc.sel); - /* XXX see a comment in devioctl */ - p = devsoftc.async_proc; - if (p != NULL) { - PROC_LOCK(p); - kern_psignal(p, SIGIO); - PROC_UNLOCK(p); - } + if (devsoftc.async && devsoftc.sigio != NULL) + pgsigio(&devsoftc.sigio, SIGIO, 0); return; out: /* From owner-svn-src-head@FreeBSD.ORG Fri Mar 28 08:32:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DD56A1B for ; Fri, 28 Mar 2014 08:32:49 +0000 (UTC) Received: from mail-qc0-f178.google.com (mail-qc0-f178.google.com [209.85.216.178]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A82BDDD for ; Fri, 28 Mar 2014 08:32:48 +0000 (UTC) Received: by mail-qc0-f178.google.com with SMTP id i8so5498363qcq.23 for ; Fri, 28 Mar 2014 01:32:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=4nRdcjbapjrtSShgp+UtKy0xKvQ8sVkhL00IL2OVP0s=; b=YfMl6UVbEFaH7THmOcXMUw/U1IsZc14fG5QCdVAK4v//kZAGw6V2oHGODCrJisPYr4 S4gB6REgDb304ZZrfz4glJYrlaWXFeXguRMmocsiIZ/t0QUiViJv6BP4dUlImoac/r5n BJdg6jbEQo2zbIkmyMSMr0fE3lrHrmuceEOufnjMq/g1/hwwm7VUrGBm53k/tKucvnJ3 M2EvSPNZAnoWeNy78/pblcdSwJbKaObRwgIhozk9fNUMaKhSmEiwyBlnrkwKmZBJ+/LD 1IoL7CAnS37l9r3OgGduCMmPHPkUSuiCRmfjEonqy1KNAIpFKoLJGdbLIshK1VZxdQ+s hgXw== X-Gm-Message-State: ALoCoQk61ZpVF0aoaiWQMrz1f4Df2U3WKPQTtZq3i+IPf6Oyc/Wl5AztuO9iLhI8/20TSLSsggey X-Received: by 10.224.25.2 with SMTP id x2mr7769033qab.37.1395995568044; Fri, 28 Mar 2014 01:32:48 -0700 (PDT) MIME-Version: 1.0 Sender: jmmv@meroh.net Received: by 10.96.83.102 with HTTP; Fri, 28 Mar 2014 01:32:27 -0700 (PDT) X-Originating-IP: [2401:fa00:d:c:c54e:32b8:1d2a:b775] In-Reply-To: <864n2mxpun.fsf@nine.des.no> References: <201403191229.s2JCTLDp024608@svn.freebsd.org> <864n2mxpun.fsf@nine.des.no> From: Julio Merino Date: Fri, 28 Mar 2014 17:32:27 +0900 X-Google-Sender-Auth: vdgpFMXwFHRJEzWD_jleJ0E7CGI Message-ID: Subject: Re: svn commit: r263346 - in head: etc/mtree tools/build/mk tools/regression/usr.bin/make usr.bin/make usr.bin/make/tests usr.bin/make/tests/archives/fmt_44bsd usr.bin/make/tests/archives/fmt_44bsd_mod... To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 08:32:49 -0000 On Wed, Mar 26, 2014 at 12:25 AM, Dag-Erling Sm=F8rgrav wrote: > Julio Merino writes: >> Log: >> Migrate tools/regression/usr.bin/make/ to the new tests layout. >> >> Note that these tests are for fmake, not bmake, and thus they are not >> installed nor run when bmake is selected (the default). Yes, I have >> wasted a *ton* of time on moving tests for no real reason other than >> ensuring they are not left behind. >> >> But maybe, just maybe, it was not work in vain: the majority of these >> tests also work with bmake and the few that don't may point at broken >> stuff. For example, the tests for the "archive" feature do not work >> with bmake, but bmake's manpage and source tree seem to imply that the= y >> should. So... to be investigated later; need to poke sjg@. > > This, or a subsequent but related commit, broke the WITHOUT_BMAKE build: Apologies for not having gotten to this yet. Will try to deal with it during the weekend or next week when I'm back home. (Still traveling after AsiaBSDCon and been focusing on fixing some other issues in the testing cluster.) In the meantime: could someone enlighten me as to why !bmake is still suppo= rted? Thanks! From owner-svn-src-head@FreeBSD.ORG Fri Mar 28 11:46:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C32D2F8B; Fri, 28 Mar 2014 11:46:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFE0CB8; Fri, 28 Mar 2014 11:46:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2SBksH5044060; Fri, 28 Mar 2014 11:46:54 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2SBksQR044059; Fri, 28 Mar 2014 11:46:54 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403281146.s2SBksQR044059@svn.freebsd.org> From: Ed Maste Date: Fri, 28 Mar 2014 11:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263872 - head/sys/ia64/ia64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 11:46:54 -0000 Author: emaste Date: Fri Mar 28 11:46:54 2014 New Revision: 263872 URL: http://svnweb.freebsd.org/changeset/base/263872 Log: Fix missed efi.h header change in r263815 Pointy hat to: emaste Modified: head/sys/ia64/ia64/mem.c Modified: head/sys/ia64/ia64/mem.c ============================================================================== --- head/sys/ia64/ia64/mem.c Fri Mar 28 10:06:14 2014 (r263871) +++ head/sys/ia64/ia64/mem.c Fri Mar 28 11:46:54 2014 (r263872) @@ -45,13 +45,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include #include -#include #include #include From owner-svn-src-head@FreeBSD.ORG Fri Mar 28 12:50:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24E30E51; Fri, 28 Mar 2014 12:50:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DC658F4; Fri, 28 Mar 2014 12:50:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2SCod3k072268; Fri, 28 Mar 2014 12:50:39 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2SCodUb072267; Fri, 28 Mar 2014 12:50:39 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201403281250.s2SCodUb072267@svn.freebsd.org> From: Aleksandr Rybalko Date: Fri, 28 Mar 2014 12:50:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263873 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 12:50:40 -0000 Author: ray Date: Fri Mar 28 12:50:39 2014 New Revision: 263873 URL: http://svnweb.freebsd.org/changeset/base/263873 Log: Enable to build UEFI framebuffer driver for vt(4). It can be enabled by "device vt_efifb" in kernel config. Requested by: emaste Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Mar 28 11:46:54 2014 (r263872) +++ head/sys/conf/files Fri Mar 28 12:50:39 2014 (r263873) @@ -2471,6 +2471,7 @@ dev/vr/if_vr.c optional vr pci dev/vt/colors/vt_termcolors.c optional vt dev/vt/font/vt_font_default.c optional vt dev/vt/font/vt_mouse_cursor.c optional vt +dev/vt/hw/efifb/efifb.c optional vt_efifb dev/vt/hw/fb/vt_fb.c optional vt dev/vt/hw/vga/vga.c optional vt vt_vga dev/vt/logo/logo_freebsd.c optional vt splash From owner-svn-src-head@FreeBSD.ORG Fri Mar 28 16:07:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A45C8BC; Fri, 28 Mar 2014 16:07:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AACAE5F; Fri, 28 Mar 2014 16:07:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2SG7Sgj052924; Fri, 28 Mar 2014 16:07:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2SG7Ri9052922; Fri, 28 Mar 2014 16:07:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403281607.s2SG7Ri9052922@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 28 Mar 2014 16:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263878 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 16:07:28 -0000 Author: kib Date: Fri Mar 28 16:07:27 2014 New Revision: 263878 URL: http://svnweb.freebsd.org/changeset/base/263878 Log: Several fixes for the PCID implementation: - When clearing a bit for a cpuid in pmap->pm_save, ensure that the cpuid is not set in pm_active. The pm_save indicates which CPUs may have cached translations for given PCID, which implies that a CPU executing with the given pmap active have the translations cached. [1] - In smp_masked_invltlb(), pass pmap to smp_targeted_tlb_shootdown(). [1] - In invlrng_handler(), check for the special values of pcid (0 and -1) and do corresponding global or total invalidations before checking for performing PCID-specific range invalidation with INVPCID_ADDR. [2] - In invltlb_pcid_handler(), do not read %cr3 unless needed. [2] - Do minor style tweaks. [2] Submitted by: Henrik Gulbrandsen [1] Other parts sponsored by: The FreeBSD Foundation [2] Tested by: Henrik Gulbrandsen, pho MFC after: 1 week Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Fri Mar 28 15:41:04 2014 (r263877) +++ head/sys/amd64/amd64/mp_machdep.c Fri Mar 28 16:07:27 2014 (r263878) @@ -1257,7 +1257,7 @@ smp_masked_invltlb(cpuset_t mask, pmap_t { if (smp_started) { - smp_targeted_tlb_shootdown(mask, IPI_INVLTLB, NULL, 0, 0); + smp_targeted_tlb_shootdown(mask, IPI_INVLTLB, pmap, 0, 0); #ifdef COUNT_XINVLTLB_HITS ipi_masked_global++; #endif @@ -1517,6 +1517,7 @@ void invltlb_pcid_handler(void) { uint64_t cr3; + u_int cpuid; #ifdef COUNT_XINVLTLB_HITS xhits_gbl[PCPU_GET(cpuid)]++; #endif /* COUNT_XINVLTLB_HITS */ @@ -1524,14 +1525,13 @@ invltlb_pcid_handler(void) (*ipi_invltlb_counts[PCPU_GET(cpuid)])++; #endif /* COUNT_IPIS */ - cr3 = rcr3(); if (smp_tlb_invpcid.pcid != (uint64_t)-1 && smp_tlb_invpcid.pcid != 0) { - if (invpcid_works) { invpcid(&smp_tlb_invpcid, INVPCID_CTX); } else { /* Otherwise reload %cr3 twice. */ + cr3 = rcr3(); if (cr3 != pcid_cr3) { load_cr3(pcid_cr3); cr3 |= CR3_PCID_SAVE; @@ -1541,8 +1541,11 @@ invltlb_pcid_handler(void) } else { invltlb_globpcid(); } - if (smp_tlb_pmap != NULL) - CPU_CLR_ATOMIC(PCPU_GET(cpuid), &smp_tlb_pmap->pm_save); + if (smp_tlb_pmap != NULL) { + cpuid = PCPU_GET(cpuid); + if (!CPU_ISSET(cpuid, &smp_tlb_pmap->pm_active)) + CPU_CLR_ATOMIC(cpuid, &smp_tlb_pmap->pm_save); + } atomic_add_int(&smp_tlb_wait, 1); } @@ -1608,7 +1611,10 @@ invlpg_range(vm_offset_t start, vm_offse void invlrng_handler(void) { + struct invpcid_descr d; vm_offset_t addr; + uint64_t cr3; + u_int cpuid; #ifdef COUNT_XINVLTLB_HITS xhits_rng[PCPU_GET(cpuid)]++; #endif /* COUNT_XINVLTLB_HITS */ @@ -1618,15 +1624,7 @@ invlrng_handler(void) addr = smp_tlb_invpcid.addr; if (pmap_pcid_enabled) { - if (invpcid_works) { - struct invpcid_descr d; - - d = smp_tlb_invpcid; - do { - invpcid(&d, INVPCID_ADDR); - d.addr += PAGE_SIZE; - } while (d.addr < smp_tlb_addr2); - } else if (smp_tlb_invpcid.pcid == 0) { + if (smp_tlb_invpcid.pcid == 0) { /* * kernel pmap - use invlpg to invalidate * global mapping. @@ -1635,12 +1633,18 @@ invlrng_handler(void) } else if (smp_tlb_invpcid.pcid == (uint64_t)-1) { invltlb_globpcid(); if (smp_tlb_pmap != NULL) { - CPU_CLR_ATOMIC(PCPU_GET(cpuid), - &smp_tlb_pmap->pm_save); + cpuid = PCPU_GET(cpuid); + if (!CPU_ISSET(cpuid, &smp_tlb_pmap->pm_active)) + CPU_CLR_ATOMIC(cpuid, + &smp_tlb_pmap->pm_save); } + } else if (invpcid_works) { + d = smp_tlb_invpcid; + do { + invpcid(&d, INVPCID_ADDR); + d.addr += PAGE_SIZE; + } while (d.addr <= smp_tlb_addr2); } else { - uint64_t cr3; - cr3 = rcr3(); if (cr3 != pcid_cr3) load_cr3(pcid_cr3 | CR3_PCID_SAVE); Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Mar 28 15:41:04 2014 (r263877) +++ head/sys/amd64/amd64/pmap.c Fri Mar 28 16:07:27 2014 (r263878) @@ -838,7 +838,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) kernel_pmap->pm_pml4 = (pdp_entry_t *)PHYS_TO_DMAP(KPML4phys); kernel_pmap->pm_cr3 = KPML4phys; CPU_FILL(&kernel_pmap->pm_active); /* don't allow deactivation */ - CPU_ZERO(&kernel_pmap->pm_save); + CPU_FILL(&kernel_pmap->pm_save); /* always superset of pm_active */ TAILQ_INIT(&kernel_pmap->pm_pvchunk); kernel_pmap->pm_flags = pmap_flags; @@ -1494,7 +1494,8 @@ pmap_invalidate_all(pmap_t pmap) } else { invltlb_globpcid(); } - CPU_CLR_ATOMIC(cpuid, &pmap->pm_save); + if (!CPU_ISSET(cpuid, &pmap->pm_active)) + CPU_CLR_ATOMIC(cpuid, &pmap->pm_save); smp_invltlb(pmap); } else { other_cpus = all_cpus; @@ -1528,7 +1529,8 @@ pmap_invalidate_all(pmap_t pmap) } } else if (CPU_ISSET(cpuid, &pmap->pm_active)) invltlb(); - CPU_CLR_ATOMIC(cpuid, &pmap->pm_save); + if (!CPU_ISSET(cpuid, &pmap->pm_active)) + CPU_CLR_ATOMIC(cpuid, &pmap->pm_save); if (pmap_pcid_enabled) CPU_AND(&other_cpus, &pmap->pm_save); else From owner-svn-src-head@FreeBSD.ORG Fri Mar 28 16:11:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB156AA5; Fri, 28 Mar 2014 16:11:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7436F06; Fri, 28 Mar 2014 16:11:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2SGBKle054644; Fri, 28 Mar 2014 16:11:20 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2SGBK6Q054642; Fri, 28 Mar 2014 16:11:20 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403281611.s2SGBK6Q054642@svn.freebsd.org> From: Bryan Drewery Date: Fri, 28 Mar 2014 16:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263879 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 16:11:21 -0000 Author: bdrewery Date: Fri Mar 28 16:11:20 2014 New Revision: 263879 URL: http://svnweb.freebsd.org/changeset/base/263879 Log: Add `-S' to display syscall numbers in the output as well. This is useful for debugging compat modules. Sponsored by: EMC / Isilon Storage Division Obtained from: Isilon OneFS (based on work by Jeff Hughes) MFC after: 2 weeks Modified: head/usr.bin/kdump/kdump.1 head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.1 ============================================================================== --- head/usr.bin/kdump/kdump.1 Fri Mar 28 16:07:27 2014 (r263878) +++ head/usr.bin/kdump/kdump.1 Fri Mar 28 16:11:20 2014 (r263879) @@ -28,7 +28,7 @@ .\" @(#)kdump.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 4, 2012 +.Dd March 28, 2014 .Dt KDUMP 1 .Os .Sh NAME @@ -36,7 +36,7 @@ .Nd display kernel trace data .Sh SYNOPSIS .Nm -.Op Fl dEnlHRsTA +.Op Fl dEnlHRSsTA .Op Fl f Ar trfile .Op Fl m Ar maxdata .Op Fl p Ar pid @@ -95,6 +95,8 @@ Display relative timestamps (time since .It Fl r When decoding STRU records, display structure members such as UIDs, GIDs, dates etc. symbolically instead of numerically. +.It Fl S +Display system call numbers. .It Fl s Suppress display of I/O data. .It Fl T Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Fri Mar 28 16:07:27 2014 (r263878) +++ head/usr.bin/kdump/kdump.c Fri Mar 28 16:11:20 2014 (r263879) @@ -123,7 +123,7 @@ void ioctlname(unsigned long, int); #define TIMESTAMP_RELATIVE 0x4 int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata, - resolv = 0, abiflag = 0; + resolv = 0, abiflag = 0, syscallno = 0; const char *tracefile = DEF_TRACEFILE; struct ktr_header ktr_header; @@ -261,7 +261,7 @@ main(int argc, char *argv[]) timestamp = TIMESTAMP_NONE; - while ((ch = getopt(argc,argv,"f:dElm:np:AHRrsTt:")) != -1) + while ((ch = getopt(argc,argv,"f:dElm:np:AHRrSsTt:")) != -1) switch (ch) { case 'A': abiflag = 1; @@ -287,6 +287,9 @@ main(int argc, char *argv[]) case 'r': resolv = 1; break; + case 'S': + syscallno = 1; + break; case 's': suppressdata = 1; break; @@ -678,8 +681,11 @@ ktrsyscall(struct ktr_syscall *ktr, u_in if ((flags != 0 && ((flags & SV_ABI_MASK) != SV_ABI_FREEBSD)) || (ktr->ktr_code >= nsyscalls || ktr->ktr_code < 0)) printf("[%d]", ktr->ktr_code); - else + else { printf("%s", syscallnames[ktr->ktr_code]); + if (syscallno) + printf("[%d]", ktr->ktr_code); + } ip = &ktr->ktr_args[0]; if (narg) { char c = '('; @@ -1271,8 +1277,12 @@ ktrsysret(struct ktr_sysret *ktr, u_int if ((flags != 0 && ((flags & SV_ABI_MASK) != SV_ABI_FREEBSD)) || (code >= nsyscalls || code < 0)) printf("[%d] ", code); - else - printf("%s ", syscallnames[code]); + else { + printf("%s", syscallnames[code]); + if (syscallno) + printf("[%d]", code); + printf(" "); + } if (error == 0) { if (fancy) { @@ -1910,8 +1920,11 @@ linux_ktrsyscall(struct ktr_syscall *ktr if (ktr->ktr_code >= nlinux_syscalls || ktr->ktr_code < 0) printf("[%d]", ktr->ktr_code); - else + else { printf("%s", linux_syscallnames[ktr->ktr_code]); + if (syscallno) + printf("[%d]", ktr->ktr_code); + } ip = &ktr->ktr_args[0]; if (narg) { char c = '('; @@ -1931,8 +1944,12 @@ linux_ktrsysret(struct ktr_sysret *ktr) if (code >= nlinux_syscalls || code < 0) printf("[%d] ", code); - else - printf("%s ", linux_syscallnames[code]); + else { + printf("%s", linux_syscallnames[code]); + if (syscallno) + printf("[%d]", code); + printf(" "); + } if (error == 0) { if (fancy) { @@ -1965,7 +1982,7 @@ linux_ktrsysret(struct ktr_sysret *ktr) void usage(void) { - fprintf(stderr, "usage: kdump [-dEnlHRrsTA] [-f trfile] " + fprintf(stderr, "usage: kdump [-dEnlHRrSsTA] [-f trfile] " "[-m maxdata] [-p pid] [-t trstr]\n"); exit(1); } From owner-svn-src-head@FreeBSD.ORG Fri Mar 28 16:13:33 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68CC4C66; Fri, 28 Mar 2014 16:13:33 +0000 (UTC) Received: from gw.catspoiler.org (gw.catspoiler.org [75.1.14.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 234E8F24; Fri, 28 Mar 2014 16:13:33 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s2SGDKpk010871; Fri, 28 Mar 2014 08:13:24 -0800 (PST) (envelope-from truckman@FreeBSD.org) Message-Id: <201403281613.s2SGDKpk010871@gw.catspoiler.org> Date: Fri, 28 Mar 2014 09:13:20 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r263755 - head/sys/kern To: davidxu@FreeBSD.org In-Reply-To: <53351627.9000703@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: mjguzik@gmail.com, mjg@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, src-committers@FreeBSD.org, kostikbel@gmail.com X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 16:13:33 -0000 On 28 Mar, David Xu wrote: > On 2014/03/28 06:31, Don Lewis wrote: >> On 27 Mar, Konstantin Belousov wrote: >>> On Thu, Mar 27, 2014 at 04:05:12PM +0100, Mateusz Guzik wrote: >>>> On Thu, Mar 27, 2014 at 03:58:19PM +0100, Mateusz Guzik wrote: >>>>> On Thu, Mar 27, 2014 at 04:46:57PM +0800, David Xu wrote: >>>>>> On 2014/03/27 16:37, Mateusz Guzik wrote: >>>>>>> On Thu, Mar 27, 2014 at 03:45:17PM +0800, David Xu wrote: >>>>>>>> I think the async process pointer can be cleared when a process exits >>>>>>>> by registering an event handler. please see attached patch. >>>>>>>> >>>>>>> >>>>>>> Sure, but I'm not very fond of this solution. >>>>>>> >>>>>>> This is a rather obscure bug you wont hit unless you explicitly try, >>>>>>> and even then you need root privs by default. >>>>>>> >>>>>> OK, but I don't like the bug exists in kernel. It is not obscure for me, >>>>>> I can run "shutdown now" command, and insert a device, and then the >>>>>> kernel will write garbage data into freed memory space. >>>>>> >>>>> >>>>> Not sure what you mean. devd does not use this feature, and even if it >>>>> did async_proc is cleared on close, which happens while signal delivery >>>>> is still legal. >>>>> >>>>> That said, you are not going to encounter this bug unless you code >>>>> something up to specifically trigger it. >>>>> >>>>> fwiw, I think we could axe this feature if there was no way to fix it >>>>> without introducing a check for every process. >>>>> >>>>>>> As such writing a callback function which will be executed for all exiting >>>>>>> processes seems unjustified for me. >>>>>>> >>>>>>> Ideally we would get some mechanism which would allow to register >>>>>>> callbacks for events related to given entity. Then it could be used to >>>>>>> provide a "call this function when process p exits", amongst other things. >>>>>>> >>>>>> >>>>>> Yes, but the callback itself is cheap enough and is not worth to be >>>>>> per-entity entry. >>>>>> >>>>> >>>>> There is other code in the kernel which would benefit from such >>>>> functionality - dev/syscons/scmouse, dev/vt/vt_core.c, aio and possibly >>>>> more. >>>>> >>>>> As such I think this is worth pursuing. >>>>> >>>> >>>> We can hack around this one the way the other code is doing - apart from >>>> from proc pointer you store pid and then compare result of pfind(pid). >>>> >>>> This is still buggy as both proc and pid pointer can be recycled and end >>>> up being the same (but you have an entrirely new process). >>>> >>>> However, then in absolutely worst cae you send SIGIO to incorrect >>>> process, always an existing process so no more corruption. >>>> >>>> Would you be ok with such hack for the time being? >>> >>> Isn't p_sigiolist and fsetown(9) already provide the neccessary registration >>> and cleanup on the process exit ? The KPI might require some generalization, >>> but I think that the mechanism itself is enough. >> >> That's the correct mechanism, but it's not being used here. >> >> Something like the following untested patch should do the trick: >> >> Index: sys/kern/subr_bus.c >> =================================================================== >> --- sys/kern/subr_bus.c (revision 263289) >> +++ sys/kern/subr_bus.c (working copy) >> @@ -402,7 +402,7 @@ >> struct cv cv; >> struct selinfo sel; >> struct devq devq; >> - struct proc *async_proc; >> + struct sigio *sigio; >> } devsoftc; >> >> static struct cdev *devctl_dev; >> @@ -425,7 +425,7 @@ >> /* move to init */ >> devsoftc.inuse = 1; >> devsoftc.nonblock = 0; >> - devsoftc.async_proc = NULL; >> + funsetown(&devsoftc.sigio); >> return (0); >> } >> >> @@ -436,7 +436,7 @@ >> mtx_lock(&devsoftc.mtx); >> cv_broadcast(&devsoftc.cv); >> mtx_unlock(&devsoftc.mtx); >> - devsoftc.async_proc = NULL; >> + funsetown(&devsoftc.sigio); >> return (0); >> } >> >> @@ -492,9 +492,8 @@ >> return (0); >> case FIOASYNC: >> if (*(int*)data) >> - devsoftc.async_proc = td->td_proc; >> - else >> - devsoftc.async_proc = NULL; >> + return (fsetown(td->td_proc->p_pid, &devsoftc.sigio)); >> + funsetown(&devsoftc.sigio); >> return (0); >> >> /* (un)Support for other fcntl() calls. */ >> @@ -546,7 +545,6 @@ >> devctl_queue_data_f(char *data, int flags) >> { >> struct dev_event_info *n1 = NULL, *n2 = NULL; >> - struct proc *p; >> >> if (strlen(data) == 0) >> goto out; >> @@ -576,12 +574,8 @@ >> cv_broadcast(&devsoftc.cv); >> mtx_unlock(&devsoftc.mtx); >> selwakeup(&devsoftc.sel); >> - p = devsoftc.async_proc; >> - if (p != NULL) { >> - PROC_LOCK(p); >> - kern_psignal(p, SIGIO); >> - PROC_UNLOCK(p); >> - } >> + if (devsoftc.sigio != NULL) >> + pgsigio(&devsoftc.sigio, SIGIO, 0); >> return; >> out: >> /* >> >> > I have tweaked it a bit, is this okay ? > > # HG changeset patch > # Parent 53b614ff2cae108f27e4475989d3a86997017268 > > diff -r 53b614ff2cae sys/kern/subr_bus.c > --- a/sys/kern/subr_bus.c Thu Mar 27 10:03:50 2014 +0800 > +++ b/sys/kern/subr_bus.c Fri Mar 28 14:22:29 2014 +0800 > @@ -391,11 +391,12 @@ > int inuse; > int nonblock; > int queued; > + int async; > struct mtx mtx; > struct cv cv; > struct selinfo sel; > struct devq devq; > - struct proc *async_proc; > + struct sigio *sigio; > } devsoftc; > > static struct cdev *devctl_dev; > @@ -422,7 +423,8 @@ > /* move to init */ > devsoftc.inuse = 1; > devsoftc.nonblock = 0; > - devsoftc.async_proc = NULL; > + devsoftc.async = 0; > + devsoftc.sigio = NULL; > mtx_unlock(&devsoftc.mtx); > return (0); > } > @@ -433,8 +435,9 @@ > > mtx_lock(&devsoftc.mtx); > devsoftc.inuse = 0; > - devsoftc.async_proc = NULL; > + devsoftc.async = 0; > cv_broadcast(&devsoftc.cv); > + funsetown(&devsoftc.sigio); > mtx_unlock(&devsoftc.mtx); > return (0); > } > @@ -490,33 +493,21 @@ > devsoftc.nonblock = 0; > return (0); > case FIOASYNC: > - /* > - * FIXME: > - * Since this is a simple assignment there is no guarantee that > - * devsoftc.async_proc consumers will get a valid pointer. > - * > - * Example scenario where things break (processes A and B): > - * 1. A opens devctl > - * 2. A sends fd to B > - * 3. B sets itself as async_proc > - * 4. B exits > - * > - * However, normally this requires root privileges and the only > - * in-tree consumer does not behave in a dangerous way so the > - * issue is not critical. > - */ > if (*(int*)data) > - devsoftc.async_proc = td->td_proc; > + devsoftc.async = 1; > else > - devsoftc.async_proc = NULL; > + devsoftc.async = 0; > + return (0); > + case FIOSETOWN: > + return fsetown(*(int *)data, &devsoftc.sigio); > + case FIOGETOWN: > + *(int *)data = fgetown(&devsoftc.sigio); > return (0); > > /* (un)Support for other fcntl() calls. */ > case FIOCLEX: > case FIONCLEX: > case FIONREAD: > - case FIOSETOWN: > - case FIOGETOWN: > default: > break; > } > @@ -560,7 +551,6 @@ > devctl_queue_data_f(char *data, int flags) > { > struct dev_event_info *n1 = NULL, *n2 = NULL; > - struct proc *p; > > if (strlen(data) == 0) > goto out; > @@ -590,13 +580,8 @@ > cv_broadcast(&devsoftc.cv); > mtx_unlock(&devsoftc.mtx); > selwakeup(&devsoftc.sel); > - /* XXX see a comment in devioctl */ > - p = devsoftc.async_proc; > - if (p != NULL) { > - PROC_LOCK(p); > - kern_psignal(p, SIGIO); > - PROC_UNLOCK(p); > - } > + if (devsoftc.async && devsoftc.sigio != NULL) > + pgsigio(&devsoftc.sigio, SIGIO, 0); > return; > out: > /* > > That makes it work more like the other users of fsetown(), which is probably a good thing. The downside is that two syscalls are needed to activate it, which I was trying to avoid that with my patch. I noticed that logopen() in subr_log.c unconditionally calls fsetown(), which would avoid the need for an extra syscall. That also avoids the direct manipulation of the pointer in your patch, which makes me nervous about the possibility of a leak. I wonder if FIOASYNC should fail if td->td_proc != devsoftc.sigio.sio_proc (or the equivalent for other instances) to prevent a process from maniuplating the async flag for a device "owned" by another process. I think this check would need to be wrapped in SIGIO_LOCK()/SIGIO_UNLOCK() to be safe. From owner-svn-src-head@FreeBSD.ORG Fri Mar 28 16:31:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9336499; Fri, 28 Mar 2014 16:31:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D680B181; Fri, 28 Mar 2014 16:31:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2SGVCkW062179; Fri, 28 Mar 2014 16:31:12 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2SGVCEj062178; Fri, 28 Mar 2014 16:31:12 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403281631.s2SGVCEj062178@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Mar 2014 16:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263881 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 16:31:13 -0000 Author: imp Date: Fri Mar 28 16:31:12 2014 New Revision: 263881 URL: http://svnweb.freebsd.org/changeset/base/263881 Log: Only set XDDESTDIR if it wasn't already set to allow people to override it. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Mar 28 16:27:48 2014 (r263880) +++ head/Makefile.inc1 Fri Mar 28 16:31:12 2014 (r263881) @@ -1899,7 +1899,7 @@ CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CDTMP= ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN} CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} ${MAKE} ${NOFUN} -XDDESTDIR=${DESTDIR}/${XDTP} +XDDESTDIR?=${DESTDIR}/${XDTP} .if !defined(OSREL) OSREL!= uname -r | sed -e 's/[-(].*//' .endif From owner-svn-src-head@FreeBSD.ORG Fri Mar 28 17:23:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B0C68B7; Fri, 28 Mar 2014 17:23:07 +0000 (UTC) Received: from mail-qc0-x231.google.com (mail-qc0-x231.google.com [IPv6:2607:f8b0:400d:c01::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 299A69C6; Fri, 28 Mar 2014 17:23:07 +0000 (UTC) Received: by mail-qc0-f177.google.com with SMTP id w7so6165581qcr.8 for ; Fri, 28 Mar 2014 10:23:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=W8qomkqz7z7IL4mzTdR0hSp1ejqnsogoqPzpC4F1TXQ=; b=i7eva+w3cCk+YA1IKCaBakws6GtGkDszLi7l1EcDKa6lgCUSHX5BPMxqvuhF0ClKqC o1mmM0yyI5DFbsAXMKKaiTWGj7F22zvzUFrtoVkscfGREaZ2S5zo20uUaYUSRT+1hR5/ szi0JY2HrecpmO2U52XcL0+jiN7y7jn3c5QCS6yP42jqzc/jiichPVpoLICXLtOvMRsT a1XzmPfw0o9O6o2XEAI08lHUPhzspfkcIpGV2BDCOcbU8s/8pY7odCIraUOiShBetIVx zAN9tEjNXVHi/+gBqRcK9Azi0bgbVoH1arMk++BTTWctzj1AQQdo8ypYbfaA7lYRHUdS My/g== MIME-Version: 1.0 X-Received: by 10.229.17.69 with SMTP id r5mr10766152qca.7.1396027386343; Fri, 28 Mar 2014 10:23:06 -0700 (PDT) Sender: carpeddiem@gmail.com Received: by 10.140.88.105 with HTTP; Fri, 28 Mar 2014 10:23:06 -0700 (PDT) In-Reply-To: <201403281607.s2SG7Ri9052922@svn.freebsd.org> References: <201403281607.s2SG7Ri9052922@svn.freebsd.org> Date: Fri, 28 Mar 2014 13:23:06 -0400 X-Google-Sender-Auth: N4C2KzNt9FtsL2a3S4vfdB9YB2E Message-ID: Subject: Re: svn commit: r263878 - head/sys/amd64/amd64 From: Ed Maste To: Konstantin Belousov Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 17:23:07 -0000 On 28 March 2014 12:07, Konstantin Belousov wrote: > Author: kib > Date: Fri Mar 28 16:07:27 2014 > New Revision: 263878 > URL: http://svnweb.freebsd.org/changeset/base/263878 > > Log: > Several fixes for the PCID implementation: I'd like to revert r262765 (where I disabled it by default) to get broader testing on this; do you see any reason I should wait instead? -Ed From owner-svn-src-head@FreeBSD.ORG Fri Mar 28 18:31:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 055AEBDD; Fri, 28 Mar 2014 18:31:01 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92FE71BB; Fri, 28 Mar 2014 18:31:00 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.8/8.14.8) with ESMTP id s2SIUtBp067160; Fri, 28 Mar 2014 20:30:55 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s2SIUtBp067160 Received: (from kostik@localhost) by tom.home (8.14.8/8.14.8/Submit) id s2SIUt4R067148; Fri, 28 Mar 2014 20:30:55 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 28 Mar 2014 20:30:55 +0200 From: Konstantin Belousov To: Ed Maste Subject: Re: svn commit: r263878 - head/sys/amd64/amd64 Message-ID: <20140328183055.GA21331@kib.kiev.ua> References: <201403281607.s2SG7Ri9052922@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="l+LxDeyHMCBjwres" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 18:31:01 -0000 --l+LxDeyHMCBjwres Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 28, 2014 at 01:23:06PM -0400, Ed Maste wrote: > On 28 March 2014 12:07, Konstantin Belousov wrote: > > Author: kib > > Date: Fri Mar 28 16:07:27 2014 > > New Revision: 263878 > > URL: http://svnweb.freebsd.org/changeset/base/263878 > > > > Log: > > Several fixes for the PCID implementation: >=20 > I'd like to revert r262765 (where I disabled it by default) to get > broader testing on this; do you see any reason I should wait instead? I am on edge there. =46rom one side, enabling PCID degrades the pgbench (?) by 10% at least on many-cores machines. This is understandable, since committed implementation keeps track of the cpus which has translation information cached for the given pmap, and invalidation IPIs must be broadcasted to the whole set of the cpus. The set is larger than the set of cpus for which the pmap is active, so the overhead from TLB shootdown is larger. On the other side, on the desktop-class hw, i.e. 4 cores/8 threads, there is no significant degradation, AFAIR. And, in microbenchmarks, the context switch latency is improved up to 2 times regardless of the machine class. So I initially delayed disabling the PCID, after the pgbench results were published, but now I similarly do now want much to change the defaults back to enabled. Might be, do it in HEAD only ? --l+LxDeyHMCBjwres Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJTNb/eAAoJEJDCuSvBvK1BykwP/RJMCcelv1LTYL4OloehWPl6 4ZFrSYEo+sLGNw6NfOYY5e4/uTyb52WmB3nJVuFEiw7PPeCcL8EpTn7Gb6tmRmtU ya1shp0zbxc2dhuLLvw/U4eXt3Qr3rG4k1LuUsEAT8rRw+B55gRvpy8lTJJSRPEk QLKrUEHPM8ND8hl1rw4h+c8jlGQ4Q4VCeVgZUVaKwOdEM1gDom8JBqUMtpdVEi1R VEdHflg1u4ghIzgqmCTHIa+I1e9VrJzJtm1x9DatBtgp2xyq4lzhxRjtxh+kDKUv ouqLJ4L8LG48ADtpfvK2+/OgVqnrm7yDu2986/2hZv2WGc3uSMkbmR2ECAeS+zUC T7rPdAsx0z8EKH7Vap/veGo2juwN/3SzNmru/hWHFVwtnFxeQQ5rYlClzAtwiGEd 17e4toYRiZa8Dq+kkNKlFu+pblkC0jZVWPqdgovLpI7TECWYZR6r/Znu2qF1rEj7 /ANjdnZRkbwu1UUEgUDYVJGMpijUaAqonqU7LfUFG7L9teRe0w695LRtfmn5gAIQ N3m+ZDd9Dn5Ce29WXBmumu6gaknB6mS5VqG1IARyUpCyDF6htX9Jzid/GR+zkW32 Mk3wLWSpbG0x5MYjEu+xwkpZTx9UPNOScMSGcBspGDH6JhEh/7YSv5lNG0Wf0PA0 TtMN7llsnNg2m19FMkGA =CeEG -----END PGP SIGNATURE----- --l+LxDeyHMCBjwres-- From owner-svn-src-head@FreeBSD.ORG Fri Mar 28 22:04:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04AFE521; Fri, 28 Mar 2014 22:04:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E46EBB26; Fri, 28 Mar 2014 22:04:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2SM4SFl001159; Fri, 28 Mar 2014 22:04:28 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2SM4SeN001155; Fri, 28 Mar 2014 22:04:28 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201403282204.s2SM4SeN001155@svn.freebsd.org> From: Aleksandr Rybalko Date: Fri, 28 Mar 2014 22:04:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263885 - in head/sys/dev/vt: . hw/vga X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 22:04:29 -0000 Author: ray Date: Fri Mar 28 22:04:27 2014 New Revision: 263885 URL: http://svnweb.freebsd.org/changeset/base/263885 Log: o Add new vd_driver method to do bitblt with mask, named vd_maskbitbltchr. o Move vd_bitbltchr vga's driver method to vd_maskbitbltchr. o Implement new vd_bitbltchr method for vga driver. (It do single write for 8 pixels, have to be a bit faster). MFC after: 7 days Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/hw/vga/vga.c head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/hw/vga/vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vga.c Fri Mar 28 21:25:19 2014 (r263884) +++ head/sys/dev/vt/hw/vga/vga.c Fri Mar 28 22:04:27 2014 (r263885) @@ -74,6 +74,7 @@ struct vga_softc { static vd_init_t vga_init; static vd_blank_t vga_blank; static vd_bitbltchr_t vga_bitbltchr; +static vd_maskbitbltchr_t vga_maskbitbltchr; static vd_drawrect_t vga_drawrect; static vd_setpixel_t vga_setpixel; static vd_putchar_t vga_putchar; @@ -83,6 +84,7 @@ static const struct vt_driver vt_vga_dri .vd_init = vga_init, .vd_blank = vga_blank, .vd_bitbltchr = vga_bitbltchr, + .vd_maskbitbltchr = vga_maskbitbltchr, .vd_drawrect = vga_drawrect, .vd_setpixel = vga_setpixel, .vd_putchar = vga_putchar, @@ -204,6 +206,34 @@ vga_bitbltchr(struct vt_device *vd, cons int bpl, vt_axis_t top, vt_axis_t left, unsigned int width, unsigned int height, term_color_t fg, term_color_t bg) { + u_long dst, ldst; + int w; + + /* Don't try to put off screen pixels */ + if (((left + width) > VT_VGA_WIDTH) || ((top + height) > + VT_VGA_HEIGHT)) + return; + + dst = (VT_VGA_WIDTH * top + left) / 8; + + for (; height > 0; height--) { + ldst = dst; + for (w = width; w > 0; w -= 8) { + vga_bitblt_put(vd, ldst, fg, *src); + vga_bitblt_put(vd, ldst, bg, ~*src); + ldst++; + src++; + } + dst += VT_VGA_WIDTH / 8; + } +} + +/* Bitblt with mask support. Slow. */ +static void +vga_maskbitbltchr(struct vt_device *vd, const uint8_t *src, const uint8_t *mask, + int bpl, vt_axis_t top, vt_axis_t left, unsigned int width, + unsigned int height, term_color_t fg, term_color_t bg) +{ struct vga_softc *sc = vd->vd_softc; u_long dst; uint8_t shift; Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Fri Mar 28 21:25:19 2014 (r263884) +++ head/sys/dev/vt/vt.h Fri Mar 28 22:04:27 2014 (r263885) @@ -282,6 +282,9 @@ typedef void vd_blank_t(struct vt_device typedef void vd_bitbltchr_t(struct vt_device *vd, const uint8_t *src, const uint8_t *mask, int bpl, vt_axis_t top, vt_axis_t left, unsigned int width, unsigned int height, term_color_t fg, term_color_t bg); +typedef void vd_maskbitbltchr_t(struct vt_device *vd, const uint8_t *src, + const uint8_t *mask, int bpl, vt_axis_t top, vt_axis_t left, + unsigned int width, unsigned int height, term_color_t fg, term_color_t bg); typedef void vd_putchar_t(struct vt_device *vd, term_char_t, vt_axis_t top, vt_axis_t left, term_color_t fg, term_color_t bg); typedef int vd_fb_ioctl_t(struct vt_device *, u_long, caddr_t, struct thread *); @@ -298,6 +301,7 @@ struct vt_driver { /* Drawing. */ vd_blank_t *vd_blank; vd_bitbltchr_t *vd_bitbltchr; + vd_maskbitbltchr_t *vd_maskbitbltchr; vd_drawrect_t *vd_drawrect; vd_setpixel_t *vd_setpixel; Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Fri Mar 28 21:25:19 2014 (r263884) +++ head/sys/dev/vt/vt_core.c Fri Mar 28 22:04:27 2014 (r263885) @@ -775,7 +775,7 @@ vt_flush(struct vt_device *vd) if ((vd->vd_my + m->h) > (size.tp_row * vf->vf_height)) h = (size.tp_row * vf->vf_height) - vd->vd_my - 1; - vd->vd_driver->vd_bitbltchr(vd, m->map, m->mask, bpl, + vd->vd_driver->vd_maskbitbltchr(vd, m->map, m->mask, bpl, vd->vd_offset.tp_row + vd->vd_my, vd->vd_offset.tp_col + vd->vd_mx, w, h, TC_WHITE, TC_BLACK); @@ -1930,6 +1930,8 @@ vt_allocate(struct vt_driver *drv, void printf("%s: Replace existing VT driver.\n", __func__); } vd = main_vd; + if (drv->vd_maskbitbltchr == NULL) + drv->vd_maskbitbltchr = drv->vd_bitbltchr; /* Stop vt_flush periodic task. */ if (vd->vd_curwindow != NULL) From owner-svn-src-head@FreeBSD.ORG Fri Mar 28 22:49:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B2D566B; Fri, 28 Mar 2014 22:49:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2118EE0; Fri, 28 Mar 2014 22:49:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2SMnA4u018511; Fri, 28 Mar 2014 22:49:10 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2SMnAJD018510; Fri, 28 Mar 2014 22:49:10 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403282249.s2SMnAJD018510@svn.freebsd.org> From: Xin LI Date: Fri, 28 Mar 2014 22:49:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263888 - head/cddl/contrib/opensolaris X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 22:49:11 -0000 Author: delphij Date: Fri Mar 28 22:49:10 2014 New Revision: 263888 URL: http://svnweb.freebsd.org/changeset/base/263888 Log: Dummy MFV r263886: 4573 ZFS snapshot alias Modified: Directory Properties: head/cddl/contrib/opensolaris/ (props changed) From owner-svn-src-head@FreeBSD.ORG Fri Mar 28 23:12:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08E28E06; Fri, 28 Mar 2014 23:12:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC84917A; Fri, 28 Mar 2014 23:12:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2SNC1Tr029953; Fri, 28 Mar 2014 23:12:01 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2SNC0Kh029938; Fri, 28 Mar 2014 23:12:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201403282312.s2SNC0Kh029938@svn.freebsd.org> From: Xin LI Date: Fri, 28 Mar 2014 23:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263889 - in head/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 23:12:02 -0000 Author: delphij Date: Fri Mar 28 23:12:00 2014 New Revision: 263889 URL: http://svnweb.freebsd.org/changeset/base/263889 Log: MFV r263887: 3993 zpool(1M) and zfs(1M) should support -p for "list" and "get" 4700 "zpool get" doesn't support -H or -o options MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Mar 28 22:49:10 2014 (r263888) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Mar 28 23:12:00 2014 (r263889) @@ -1,5 +1,6 @@ '\" te .\" Copyright (c) 2012, Martin Matuska . +.\" Copyright (c) 2013-2014, Xin Li . .\" All Rights Reserved. .\" .\" The contents of this file are subject to the terms of the @@ -25,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 20, 2014 +.Dd March 28, 2014 .Dt ZPOOL 8 .Os .Sh NAME @@ -70,6 +71,8 @@ .Ar pool ... .Nm .Cm get +.Op Fl Hp +.Op Fl o Ar field Ns Op , Ns Ar ... .Ar all | property Ns Op , Ns Ar ... .Ar pool ... .Nm @@ -120,7 +123,7 @@ .Ar device .Nm .Cm list -.Op Fl H +.Op Fl Hpv .Op Fl o Ar property Ns Op , Ns Ar ... .Op Fl T Cm d Ns | Ns Cm u .Op Ar pool @@ -1018,6 +1021,8 @@ is currently being used. This may lead t .It Xo .Nm .Cm get +.Op Fl Hp +.Op Fl o Ar field Ns Op , Ns Ar ... .Ar all | property Ns Op , Ns Ar ... .Ar pool ... .Xc @@ -1036,6 +1041,19 @@ the following fields: See the .Qq Sx Properties section for more information on the available pool properties. +.Pp +.It Fl H +Scripted mode. Do not display headers, and separate fields by a single tab +instead of arbitrary space. +.It Fl p +Display numbers in parsable (exact) values. +.It Fl o Ar field +A comma-separated list of columns to display. +.Sy name Ns , Ns +.Sy property Ns , Ns +.Sy value Ns , Ns +.Sy source +is the default value. .It Xo .Nm .Cm history @@ -1335,7 +1353,7 @@ Treat exported or foreign devices as ina .It Xo .Nm .Cm list -.Op Fl Hv +.Op Fl Hpv .Op Fl o Ar property Ns Op , Ns Ar ... .Op Fl T Cm d Ns | Ns Cm u .Op Ar pool @@ -1371,6 +1389,8 @@ for unixtime .It Fl H Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space. +.It Fl p +Display numbers in parsable (exact) values. .It Fl v Show more detailed information. .It Fl o Ar property Ns Op , Ns Ar ... Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Mar 28 22:49:10 2014 (r263888) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Mar 28 23:12:00 2014 (r263889) @@ -236,7 +236,7 @@ get_usage(zpool_help_t idx) { case HELP_LABELCLEAR: return (gettext("\tlabelclear [-f] \n")); case HELP_LIST: - return (gettext("\tlist [-Hv] [-o property[,...]] " + return (gettext("\tlist [-Hpv] [-o property[,...]] " "[-T d|u] [pool] ... [interval [count]]\n")); case HELP_OFFLINE: return (gettext("\toffline [-t] ...\n")); @@ -258,8 +258,8 @@ get_usage(zpool_help_t idx) { return (gettext("\tupgrade [-v]\n" "\tupgrade [-V version] <-a | pool ...>\n")); case HELP_GET: - return (gettext("\tget <\"all\" | property[,...]> " - " ...\n")); + return (gettext("\tget [-Hp] [-o \"all\" | field[,...]] " + "<\"all\" | property[,...]> ...\n")); case HELP_SET: return (gettext("\tset \n")); case HELP_SPLIT: @@ -2765,6 +2765,7 @@ typedef struct list_cbdata { int cb_namewidth; boolean_t cb_scripted; zprop_list_t *cb_proplist; + boolean_t cb_literal; } list_cbdata_t; /* @@ -2860,7 +2861,7 @@ print_pool(zpool_handle_t *zhp, list_cbd zpool_get_prop_int(zhp, pl->pl_prop, NULL) == 0) propstr = "-"; else if (zpool_get_prop(zhp, pl->pl_prop, property, - sizeof (property), NULL) != 0) + sizeof (property), NULL, cb->cb_literal) != 0) propstr = "-"; else propstr = property; @@ -3011,12 +3012,13 @@ list_callback(zpool_handle_t *zhp, void } /* - * zpool list [-H] [-o prop[,prop]*] [-T d|u] [pool] ... [interval [count]] + * zpool list [-Hp] [-o prop[,prop]*] [-T d|u] [pool] ... [interval [count]] * * -H Scripted mode. Don't display headers, and separate properties * by a single tab. * -o List of properties to display. Defaults to * "name,size,allocated,free,capacity,health,altroot" + * -p Diplay values in parsable (exact) format. * -T Display a timestamp in date(1) or Unix format * * List all pools in the system, whether or not they're healthy. Output space @@ -3037,7 +3039,7 @@ zpool_do_list(int argc, char **argv) boolean_t first = B_TRUE; /* check options */ - while ((c = getopt(argc, argv, ":Ho:T:v")) != -1) { + while ((c = getopt(argc, argv, ":Ho:pT:v")) != -1) { switch (c) { case 'H': cb.cb_scripted = B_TRUE; @@ -3045,6 +3047,9 @@ zpool_do_list(int argc, char **argv) case 'o': props = optarg; break; + case 'p': + cb.cb_literal = B_TRUE; + break; case 'T': get_timestamp_arg(*optarg); break; @@ -5199,7 +5204,7 @@ get_callback(zpool_handle_t *zhp, void * } } else { if (zpool_get_prop(zhp, pl->pl_prop, value, - sizeof (value), &srctype) != 0) + sizeof (value), &srctype, cbp->cb_literal) != 0) continue; zprop_print_one_property(zpool_get_name(zhp), cbp, @@ -5210,20 +5215,32 @@ get_callback(zpool_handle_t *zhp, void * return (0); } +/* + * zpool get [-Hp] [-o "all" | field[,...]] <"all" | property[,...]> ... + * + * -H Scripted mode. Don't display headers, and separate properties + * by a single tab. + * -o List of columns to display. Defaults to + * "name,property,value,source". + * -p Diplay values in parsable (exact) format. + * + * Get properties of pools in the system. Output space statistics + * for each one as well as other attributes. + */ int zpool_do_get(int argc, char **argv) { zprop_get_cbdata_t cb = { 0 }; zprop_list_t fake_name = { 0 }; int ret; - - if (argc < 2) { - (void) fprintf(stderr, gettext("missing property " - "argument\n")); - usage(B_FALSE); - } + int c, i; + char *value; cb.cb_first = B_TRUE; + + /* + * Set up default columns and sources. + */ cb.cb_sources = ZPROP_SRC_ALL; cb.cb_columns[0] = GET_COL_NAME; cb.cb_columns[1] = GET_COL_PROPERTY; @@ -5231,10 +5248,89 @@ zpool_do_get(int argc, char **argv) cb.cb_columns[3] = GET_COL_SOURCE; cb.cb_type = ZFS_TYPE_POOL; - if (zprop_get_list(g_zfs, argv[1], &cb.cb_proplist, + /* check options */ + while ((c = getopt(argc, argv, ":Hpo:")) != -1) { + switch (c) { + case 'p': + cb.cb_literal = B_TRUE; + break; + case 'H': + cb.cb_scripted = B_TRUE; + break; + case 'o': + bzero(&cb.cb_columns, sizeof (cb.cb_columns)); + i = 0; + while (*optarg != '\0') { + static char *col_subopts[] = + { "name", "property", "value", "source", + "all", NULL }; + + if (i == ZFS_GET_NCOLS) { + (void) fprintf(stderr, gettext("too " + "many fields given to -o " + "option\n")); + usage(B_FALSE); + } + + switch (getsubopt(&optarg, col_subopts, + &value)) { + case 0: + cb.cb_columns[i++] = GET_COL_NAME; + break; + case 1: + cb.cb_columns[i++] = GET_COL_PROPERTY; + break; + case 2: + cb.cb_columns[i++] = GET_COL_VALUE; + break; + case 3: + cb.cb_columns[i++] = GET_COL_SOURCE; + break; + case 4: + if (i > 0) { + (void) fprintf(stderr, + gettext("\"all\" conflicts " + "with specific fields " + "given to -o option\n")); + usage(B_FALSE); + } + cb.cb_columns[0] = GET_COL_NAME; + cb.cb_columns[1] = GET_COL_PROPERTY; + cb.cb_columns[2] = GET_COL_VALUE; + cb.cb_columns[3] = GET_COL_SOURCE; + i = ZFS_GET_NCOLS; + break; + default: + (void) fprintf(stderr, + gettext("invalid column name " + "'%s'\n"), value); + usage(B_FALSE); + } + } + break; + case '?': + (void) fprintf(stderr, gettext("invalid option '%c'\n"), + optopt); + usage(B_FALSE); + } + } + + argc -= optind; + argv += optind; + + if (argc < 1) { + (void) fprintf(stderr, gettext("missing property " + "argument\n")); + usage(B_FALSE); + } + + if (zprop_get_list(g_zfs, argv[0], &cb.cb_proplist, ZFS_TYPE_POOL) != 0) usage(B_FALSE); + argc--; + argv++; + if (cb.cb_proplist != NULL) { fake_name.pl_prop = ZPOOL_PROP_NAME; fake_name.pl_width = strlen(gettext("NAME")); @@ -5242,7 +5338,7 @@ zpool_do_get(int argc, char **argv) cb.cb_proplist = &fake_name; } - ret = for_each_pool(argc - 2, argv + 2, B_TRUE, &cb.cb_proplist, + ret = for_each_pool(argc, argv, B_TRUE, &cb.cb_proplist, get_callback, &cb); if (cb.cb_proplist == &fake_name) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Mar 28 22:49:10 2014 (r263888) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Mar 28 23:12:00 2014 (r263889) @@ -270,7 +270,7 @@ extern int zpool_label_disk(libzfs_handl */ extern int zpool_set_prop(zpool_handle_t *, const char *, const char *); extern int zpool_get_prop(zpool_handle_t *, zpool_prop_t, char *, - size_t proplen, zprop_source_t *); + size_t proplen, zprop_source_t *, boolean_t); extern uint64_t zpool_get_prop_int(zpool_handle_t *, zpool_prop_t, zprop_source_t *); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Mar 28 22:49:10 2014 (r263888) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Mar 28 23:12:00 2014 (r263889) @@ -2237,8 +2237,8 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop } if ((zpool_get_prop(zhp->zpool_hdl, - ZPOOL_PROP_ALTROOT, buf, MAXPATHLEN, NULL)) || - (strcmp(root, "-") == 0)) + ZPOOL_PROP_ALTROOT, buf, MAXPATHLEN, NULL, + B_FALSE)) || (strcmp(root, "-") == 0)) root[0] = '\0'; /* * Special case an alternate root of '/'. This will Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Mar 28 22:49:10 2014 (r263888) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Mar 28 23:12:00 2014 (r263889) @@ -240,7 +240,7 @@ zpool_pool_state_to_name(pool_state_t st */ int zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len, - zprop_source_t *srctype) + zprop_source_t *srctype, boolean_t literal) { uint64_t intval; const char *strval; @@ -272,9 +272,7 @@ zpool_get_prop(zpool_handle_t *zhp, zpoo (void) strlcpy(buf, zpool_get_prop_string(zhp, prop, &src), len); - if (srctype != NULL) - *srctype = src; - return (0); + break; } /* FALLTHROUGH */ default: @@ -306,12 +304,22 @@ zpool_get_prop(zpool_handle_t *zhp, zpoo case ZPOOL_PROP_FREE: case ZPOOL_PROP_FREEING: case ZPOOL_PROP_EXPANDSZ: - (void) zfs_nicenum(intval, buf, len); + if (literal) { + (void) snprintf(buf, len, "%llu", + (u_longlong_t)intval); + } else { + (void) zfs_nicenum(intval, buf, len); + } break; case ZPOOL_PROP_CAPACITY: - (void) snprintf(buf, len, "%llu%%", - (u_longlong_t)intval); + if (literal) { + (void) snprintf(buf, len, "%llu", + (u_longlong_t)intval); + } else { + (void) snprintf(buf, len, "%llu%%", + (u_longlong_t)intval); + } break; case ZPOOL_PROP_DEDUPRATIO: @@ -407,7 +415,7 @@ zpool_is_bootable(zpool_handle_t *zhp) char bootfs[ZPOOL_MAXNAMELEN]; return (zpool_get_prop(zhp, ZPOOL_PROP_BOOTFS, bootfs, - sizeof (bootfs), NULL) == 0 && strncmp(bootfs, "-", + sizeof (bootfs), NULL, B_FALSE) == 0 && strncmp(bootfs, "-", sizeof (bootfs)) != 0); } @@ -806,7 +814,7 @@ zpool_expand_proplist(zpool_handle_t *zh if (entry->pl_prop != ZPROP_INVAL && zpool_get_prop(zhp, entry->pl_prop, buf, sizeof (buf), - NULL) == 0) { + NULL, B_FALSE) == 0) { if (strlen(buf) > entry->pl_width) entry->pl_width = strlen(buf); } From owner-svn-src-head@FreeBSD.ORG Fri Mar 28 23:20:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F18BF29E; Fri, 28 Mar 2014 23:20:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDDC122F; Fri, 28 Mar 2014 23:20:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2SNKuMf031419; Fri, 28 Mar 2014 23:20:56 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2SNKuco031418; Fri, 28 Mar 2014 23:20:56 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403282320.s2SNKuco031418@svn.freebsd.org> From: Warner Losh Date: Fri, 28 Mar 2014 23:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263890 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Mar 2014 23:20:57 -0000 Author: imp Date: Fri Mar 28 23:20:56 2014 New Revision: 263890 URL: http://svnweb.freebsd.org/changeset/base/263890 Log: Dump default media size to 1GB to reflect a fatter environment and larger base media. Submitted by: Michael Dexter Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri Mar 28 23:12:00 2014 (r263889) +++ head/tools/tools/nanobsd/nanobsd.sh Fri Mar 28 23:20:56 2014 (r263890) @@ -92,7 +92,7 @@ NANO_NEWFS="-b 4096 -f 512 -i 8192 -U" NANO_DRIVE=ad0 # Target media size in 512 bytes sectors -NANO_MEDIASIZE=1500000 +NANO_MEDIASIZE=2000000 # Number of code images on media (1 or 2) NANO_IMAGES=2 From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 00:25:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6ABAB408; Sat, 29 Mar 2014 00:25:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 566A49F2; Sat, 29 Mar 2014 00:25:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2T0PSUQ060327; Sat, 29 Mar 2014 00:25:28 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2T0PSgd060326; Sat, 29 Mar 2014 00:25:28 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403290025.s2T0PSgd060326@svn.freebsd.org> From: Dimitry Andric Date: Sat, 29 Mar 2014 00:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263891 - head/contrib/llvm/tools/clang/lib/Driver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 00:25:28 -0000 Author: dim Date: Sat Mar 29 00:25:27 2014 New Revision: 263891 URL: http://svnweb.freebsd.org/changeset/base/263891 Log: Make clang default to DWARF2 debug info format for FreeBSD 10.x and earlier. For head, this commit does not change anything, but it is purely meant to be MFC'd. MFC after: 3 days Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Fri Mar 28 23:20:56 2014 (r263890) +++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sat Mar 29 00:25:27 2014 (r263891) @@ -2635,8 +2635,10 @@ void Clang::ConstructJob(Compilation &C, CmdArgs.push_back("-gdwarf-4"); else if (!A->getOption().matches(options::OPT_g0) && !A->getOption().matches(options::OPT_ggdb0)) { - // Default is dwarf-2 for darwin. - if (getToolChain().getTriple().isOSDarwin()) + // Default is dwarf-2 for darwin and FreeBSD <= 10. + const llvm::Triple &Triple = getToolChain().getTriple(); + if (Triple.isOSDarwin() || (Triple.getOS() == llvm::Triple::FreeBSD && + Triple.getOSMajorVersion() <= 10)) CmdArgs.push_back("-gdwarf-2"); else CmdArgs.push_back("-g"); From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 00:48:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 337CFB19; Sat, 29 Mar 2014 00:48:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F59BC13; Sat, 29 Mar 2014 00:48:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2T0moqw068720; Sat, 29 Mar 2014 00:48:50 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2T0moSh068719; Sat, 29 Mar 2014 00:48:50 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201403290048.s2T0moSh068719@svn.freebsd.org> From: Dimitry Andric Date: Sat, 29 Mar 2014 00:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263892 - head/contrib/llvm/patches X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 00:48:51 -0000 Author: dim Date: Sat Mar 29 00:48:50 2014 New Revision: 263892 URL: http://svnweb.freebsd.org/changeset/base/263892 Log: Add the llvm/clang patch for r263891. Added: head/contrib/llvm/patches/patch-r263891-dwarf2-freebsd10.diff Added: head/contrib/llvm/patches/patch-r263891-dwarf2-freebsd10.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r263891-dwarf2-freebsd10.diff Sat Mar 29 00:48:50 2014 (r263892) @@ -0,0 +1,22 @@ +This patch makes clang default to DWARF2 debug info format for FreeBSD +10.x and earlier. + +Introduced here: http://svnweb.freebsd.org/changeset/base/263891 + +Index: tools/clang/lib/Driver/Tools.cpp +=================================================================== +--- tools/clang/lib/Driver/Tools.cpp ++++ tools/clang/lib/Driver/Tools.cpp +@@ -2628,8 +2628,10 @@ void Clang::ConstructJob(Compilation &C, const Job + CmdArgs.push_back("-gdwarf-4"); + else if (!A->getOption().matches(options::OPT_g0) && + !A->getOption().matches(options::OPT_ggdb0)) { +- // Default is dwarf-2 for darwin. +- if (getToolChain().getTriple().isOSDarwin()) ++ // Default is dwarf-2 for darwin and FreeBSD <= 10. ++ const llvm::Triple &Triple = getToolChain().getTriple(); ++ if (Triple.isOSDarwin() || (Triple.getOS() == llvm::Triple::FreeBSD && ++ Triple.getOSMajorVersion() <= 10)) + CmdArgs.push_back("-gdwarf-2"); + else + CmdArgs.push_back("-g"); From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 02:56:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DEAF3EF; Sat, 29 Mar 2014 02:56:11 +0000 (UTC) Received: from mail-wi0-x22d.google.com (mail-wi0-x22d.google.com [IPv6:2a00:1450:400c:c05::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 012138E2; Sat, 29 Mar 2014 02:56:09 +0000 (UTC) Received: by mail-wi0-f173.google.com with SMTP id f8so1410327wiw.6 for ; Fri, 28 Mar 2014 19:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=Xwko+P9hVoBZo8IrtmsiexAh/aAt2k73WiRPcMwpJPg=; b=GgcYiy28vajYYNQB6k7kRKpfioHwic7URWTQyUQhsah74k4T6fxEgwf2UzLGHocwGK T0ZyFpwO0ZC6nZeltPOHz+9qnU3AFrke6gQXBOh7cwvnLUC3jCp2VFPMvj/Ckx1pBGdD sCdmDrwHA34acwCLtsfIZPR2r7Tb0UhZpxbSpmwo8ZbtXViEoVlkUUdAbu0f52PPJf/g CCEjAoEelT0obWyLO9ePKnKyQLbwhgkX00CiJBX0L7adaoPZDykOT6k9kwdgKK4WmaND jEviCaWDV0Bi7vKB1pwPbt2W8kOKehXocOHfrpmau7TO2Ypp5MBQOukIn5nDB0zZO0i0 0lJw== X-Received: by 10.180.77.74 with SMTP id q10mr137904wiw.39.1396061768170; Fri, 28 Mar 2014 19:56:08 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id er4sm1415669wjd.38.2014.03.28.19.56.05 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 28 Mar 2014 19:56:05 -0700 (PDT) Date: Sat, 29 Mar 2014 03:56:02 +0100 From: Mateusz Guzik To: Don Lewis Subject: Re: svn commit: r263755 - head/sys/kern Message-ID: <20140329025602.GB29296@dft-labs.eu> References: <53351627.9000703@freebsd.org> <201403281613.s2SGDKpk010871@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201403281613.s2SGDKpk010871@gw.catspoiler.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@FreeBSD.org, mjg@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, davidxu@FreeBSD.org, kostikbel@gmail.com X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 02:56:11 -0000 On Fri, Mar 28, 2014 at 09:13:20AM -0700, Don Lewis wrote: > On 28 Mar, David Xu wrote: > > I have tweaked it a bit, is this okay ? > > > > # HG changeset patch > > # Parent 53b614ff2cae108f27e4475989d3a86997017268 > > > > diff -r 53b614ff2cae sys/kern/subr_bus.c > > --- a/sys/kern/subr_bus.c Thu Mar 27 10:03:50 2014 +0800 > > +++ b/sys/kern/subr_bus.c Fri Mar 28 14:22:29 2014 +0800 > > @@ -391,11 +391,12 @@ > > int inuse; > > int nonblock; > > int queued; > > + int async; > > struct mtx mtx; > > struct cv cv; > > struct selinfo sel; > > struct devq devq; > > - struct proc *async_proc; > > + struct sigio *sigio; > > } devsoftc; > > > > static struct cdev *devctl_dev; > > @@ -422,7 +423,8 @@ > > /* move to init */ > > devsoftc.inuse = 1; > > devsoftc.nonblock = 0; > > - devsoftc.async_proc = NULL; > > + devsoftc.async = 0; > > + devsoftc.sigio = NULL; > > mtx_unlock(&devsoftc.mtx); > > return (0); > > } > > @@ -433,8 +435,9 @@ > > > > mtx_lock(&devsoftc.mtx); > > devsoftc.inuse = 0; > > - devsoftc.async_proc = NULL; > > + devsoftc.async = 0; > > cv_broadcast(&devsoftc.cv); > > + funsetown(&devsoftc.sigio); > > mtx_unlock(&devsoftc.mtx); > > return (0); > > } > > @@ -490,33 +493,21 @@ > > devsoftc.nonblock = 0; > > return (0); > > case FIOASYNC: > > - /* > > - * FIXME: > > - * Since this is a simple assignment there is no guarantee that > > - * devsoftc.async_proc consumers will get a valid pointer. > > - * > > - * Example scenario where things break (processes A and B): > > - * 1. A opens devctl > > - * 2. A sends fd to B > > - * 3. B sets itself as async_proc > > - * 4. B exits > > - * > > - * However, normally this requires root privileges and the only > > - * in-tree consumer does not behave in a dangerous way so the > > - * issue is not critical. > > - */ > > if (*(int*)data) > > - devsoftc.async_proc = td->td_proc; > > + devsoftc.async = 1; > > else > > - devsoftc.async_proc = NULL; > > + devsoftc.async = 0; > > + return (0); > > + case FIOSETOWN: > > + return fsetown(*(int *)data, &devsoftc.sigio); > > + case FIOGETOWN: > > + *(int *)data = fgetown(&devsoftc.sigio); > > return (0); > > > > /* (un)Support for other fcntl() calls. */ > > case FIOCLEX: > > case FIONCLEX: > > case FIONREAD: > > - case FIOSETOWN: > > - case FIOGETOWN: > > default: > > break; > > } > > @@ -560,7 +551,6 @@ > > devctl_queue_data_f(char *data, int flags) > > { > > struct dev_event_info *n1 = NULL, *n2 = NULL; > > - struct proc *p; > > > > if (strlen(data) == 0) > > goto out; > > @@ -590,13 +580,8 @@ > > cv_broadcast(&devsoftc.cv); > > mtx_unlock(&devsoftc.mtx); > > selwakeup(&devsoftc.sel); > > - /* XXX see a comment in devioctl */ > > - p = devsoftc.async_proc; > > - if (p != NULL) { > > - PROC_LOCK(p); > > - kern_psignal(p, SIGIO); > > - PROC_UNLOCK(p); > > - } > > + if (devsoftc.async && devsoftc.sigio != NULL) > > + pgsigio(&devsoftc.sigio, SIGIO, 0); > > return; > > out: > > /* > > > > > > That makes it work more like the other users of fsetown(), which is > probably a good thing. The downside is that two syscalls are needed to > activate it, which I was trying to avoid that with my patch. I noticed > that logopen() in subr_log.c unconditionally calls fsetown(), which > would avoid the need for an extra syscall. That also avoids the direct > manipulation of the pointer in your patch, which makes me nervous about > the possibility of a leak. > > I wonder if FIOASYNC should fail if > td->td_proc != devsoftc.sigio.sio_proc > (or the equivalent for other instances) to prevent a process from > maniuplating the async flag for a device "owned" by another process. I > think this check would need to be wrapped in SIGIO_LOCK()/SIGIO_UNLOCK() > to be safe. > But this patch would mean that current consumers (if any) would break - just calling FIOASYNC would not result in receiving SIGIO. Original patch by Don seems to work fine though, but I'm unsure about one thing (present in this patch as well): There is one devsoftc.sigio instance and one can get multiple processes with devctl fd. Is it safe from kernel perspective to have multiple processes call fsetown(*(int *)data, &devsoftc.sigio)? -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 02:56:40 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03FEC544; Sat, 29 Mar 2014 02:56:40 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1C778EB; Sat, 29 Mar 2014 02:56:39 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s2T2uYKO024058; Sat, 29 Mar 2014 02:56:35 GMT (envelope-from davidxu@freebsd.org) Message-ID: <53363660.3080404@freebsd.org> Date: Sat, 29 Mar 2014 10:56:32 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Don Lewis Subject: Re: svn commit: r263755 - head/sys/kern References: <201403281613.s2SGDKpk010871@gw.catspoiler.org> In-Reply-To: <201403281613.s2SGDKpk010871@gw.catspoiler.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: mjguzik@gmail.com, mjg@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, src-committers@FreeBSD.org, kostikbel@gmail.com X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 02:56:40 -0000 On 2014/03/29 00:13, Don Lewis wrote: > On 28 Mar, David Xu wrote: >> On 2014/03/28 06:31, Don Lewis wrote: >>> On 27 Mar, Konstantin Belousov wrote: >>>> On Thu, Mar 27, 2014 at 04:05:12PM +0100, Mateusz Guzik wrote: >>>>> On Thu, Mar 27, 2014 at 03:58:19PM +0100, Mateusz Guzik wrote: >>>>>> On Thu, Mar 27, 2014 at 04:46:57PM +0800, David Xu wrote: >>>>>>> On 2014/03/27 16:37, Mateusz Guzik wrote: >>>>>>>> On Thu, Mar 27, 2014 at 03:45:17PM +0800, David Xu wrote: >>>>>>>>> I think the async process pointer can be cleared when a process exits >>>>>>>>> by registering an event handler. please see attached patch. >>>>>>>>> >>>>>>>> Sure, but I'm not very fond of this solution. >>>>>>>> >>>>>>>> This is a rather obscure bug you wont hit unless you explicitly try, >>>>>>>> and even then you need root privs by default. >>>>>>>> >>>>>>> OK, but I don't like the bug exists in kernel. It is not obscure for me, >>>>>>> I can run "shutdown now" command, and insert a device, and then the >>>>>>> kernel will write garbage data into freed memory space. >>>>>>> >>>>>> Not sure what you mean. devd does not use this feature, and even if it >>>>>> did async_proc is cleared on close, which happens while signal delivery >>>>>> is still legal. >>>>>> >>>>>> That said, you are not going to encounter this bug unless you code >>>>>> something up to specifically trigger it. >>>>>> >>>>>> fwiw, I think we could axe this feature if there was no way to fix it >>>>>> without introducing a check for every process. >>>>>> >>>>>>>> As such writing a callback function which will be executed for all exiting >>>>>>>> processes seems unjustified for me. >>>>>>>> >>>>>>>> Ideally we would get some mechanism which would allow to register >>>>>>>> callbacks for events related to given entity. Then it could be used to >>>>>>>> provide a "call this function when process p exits", amongst other things. >>>>>>>> >>>>>>> Yes, but the callback itself is cheap enough and is not worth to be >>>>>>> per-entity entry. >>>>>>> >>>>>> There is other code in the kernel which would benefit from such >>>>>> functionality - dev/syscons/scmouse, dev/vt/vt_core.c, aio and possibly >>>>>> more. >>>>>> >>>>>> As such I think this is worth pursuing. >>>>>> >>>>> We can hack around this one the way the other code is doing - apart from >>>>> from proc pointer you store pid and then compare result of pfind(pid). >>>>> >>>>> This is still buggy as both proc and pid pointer can be recycled and end >>>>> up being the same (but you have an entrirely new process). >>>>> >>>>> However, then in absolutely worst cae you send SIGIO to incorrect >>>>> process, always an existing process so no more corruption. >>>>> >>>>> Would you be ok with such hack for the time being? >>>> Isn't p_sigiolist and fsetown(9) already provide the neccessary registration >>>> and cleanup on the process exit ? The KPI might require some generalization, >>>> but I think that the mechanism itself is enough. >>> That's the correct mechanism, but it's not being used here. >>> >>> Something like the following untested patch should do the trick: >>> >>> Index: sys/kern/subr_bus.c >>> =================================================================== >>> --- sys/kern/subr_bus.c (revision 263289) >>> +++ sys/kern/subr_bus.c (working copy) >>> @@ -402,7 +402,7 @@ >>> struct cv cv; >>> struct selinfo sel; >>> struct devq devq; >>> - struct proc *async_proc; >>> + struct sigio *sigio; >>> } devsoftc; >>> >>> static struct cdev *devctl_dev; >>> @@ -425,7 +425,7 @@ >>> /* move to init */ >>> devsoftc.inuse = 1; >>> devsoftc.nonblock = 0; >>> - devsoftc.async_proc = NULL; >>> + funsetown(&devsoftc.sigio); >>> return (0); >>> } >>> >>> @@ -436,7 +436,7 @@ >>> mtx_lock(&devsoftc.mtx); >>> cv_broadcast(&devsoftc.cv); >>> mtx_unlock(&devsoftc.mtx); >>> - devsoftc.async_proc = NULL; >>> + funsetown(&devsoftc.sigio); >>> return (0); >>> } >>> >>> @@ -492,9 +492,8 @@ >>> return (0); >>> case FIOASYNC: >>> if (*(int*)data) >>> - devsoftc.async_proc = td->td_proc; >>> - else >>> - devsoftc.async_proc = NULL; >>> + return (fsetown(td->td_proc->p_pid, &devsoftc.sigio)); >>> + funsetown(&devsoftc.sigio); >>> return (0); >>> >>> /* (un)Support for other fcntl() calls. */ >>> @@ -546,7 +545,6 @@ >>> devctl_queue_data_f(char *data, int flags) >>> { >>> struct dev_event_info *n1 = NULL, *n2 = NULL; >>> - struct proc *p; >>> >>> if (strlen(data) == 0) >>> goto out; >>> @@ -576,12 +574,8 @@ >>> cv_broadcast(&devsoftc.cv); >>> mtx_unlock(&devsoftc.mtx); >>> selwakeup(&devsoftc.sel); >>> - p = devsoftc.async_proc; >>> - if (p != NULL) { >>> - PROC_LOCK(p); >>> - kern_psignal(p, SIGIO); >>> - PROC_UNLOCK(p); >>> - } >>> + if (devsoftc.sigio != NULL) >>> + pgsigio(&devsoftc.sigio, SIGIO, 0); >>> return; >>> out: >>> /* >>> >>> >> I have tweaked it a bit, is this okay ? >> >> # HG changeset patch >> # Parent 53b614ff2cae108f27e4475989d3a86997017268 >> >> diff -r 53b614ff2cae sys/kern/subr_bus.c >> --- a/sys/kern/subr_bus.c Thu Mar 27 10:03:50 2014 +0800 >> +++ b/sys/kern/subr_bus.c Fri Mar 28 14:22:29 2014 +0800 >> @@ -391,11 +391,12 @@ >> int inuse; >> int nonblock; >> int queued; >> + int async; >> struct mtx mtx; >> struct cv cv; >> struct selinfo sel; >> struct devq devq; >> - struct proc *async_proc; >> + struct sigio *sigio; >> } devsoftc; >> >> static struct cdev *devctl_dev; >> @@ -422,7 +423,8 @@ >> /* move to init */ >> devsoftc.inuse = 1; >> devsoftc.nonblock = 0; >> - devsoftc.async_proc = NULL; >> + devsoftc.async = 0; >> + devsoftc.sigio = NULL; >> mtx_unlock(&devsoftc.mtx); >> return (0); >> } >> @@ -433,8 +435,9 @@ >> >> mtx_lock(&devsoftc.mtx); >> devsoftc.inuse = 0; >> - devsoftc.async_proc = NULL; >> + devsoftc.async = 0; >> cv_broadcast(&devsoftc.cv); >> + funsetown(&devsoftc.sigio); >> mtx_unlock(&devsoftc.mtx); >> return (0); >> } >> @@ -490,33 +493,21 @@ >> devsoftc.nonblock = 0; >> return (0); >> case FIOASYNC: >> - /* >> - * FIXME: >> - * Since this is a simple assignment there is no guarantee that >> - * devsoftc.async_proc consumers will get a valid pointer. >> - * >> - * Example scenario where things break (processes A and B): >> - * 1. A opens devctl >> - * 2. A sends fd to B >> - * 3. B sets itself as async_proc >> - * 4. B exits >> - * >> - * However, normally this requires root privileges and the only >> - * in-tree consumer does not behave in a dangerous way so the >> - * issue is not critical. >> - */ >> if (*(int*)data) >> - devsoftc.async_proc = td->td_proc; >> + devsoftc.async = 1; >> else >> - devsoftc.async_proc = NULL; >> + devsoftc.async = 0; >> + return (0); >> + case FIOSETOWN: >> + return fsetown(*(int *)data, &devsoftc.sigio); >> + case FIOGETOWN: >> + *(int *)data = fgetown(&devsoftc.sigio); >> return (0); >> >> /* (un)Support for other fcntl() calls. */ >> case FIOCLEX: >> case FIONCLEX: >> case FIONREAD: >> - case FIOSETOWN: >> - case FIOGETOWN: >> default: >> break; >> } >> @@ -560,7 +551,6 @@ >> devctl_queue_data_f(char *data, int flags) >> { >> struct dev_event_info *n1 = NULL, *n2 = NULL; >> - struct proc *p; >> >> if (strlen(data) == 0) >> goto out; >> @@ -590,13 +580,8 @@ >> cv_broadcast(&devsoftc.cv); >> mtx_unlock(&devsoftc.mtx); >> selwakeup(&devsoftc.sel); >> - /* XXX see a comment in devioctl */ >> - p = devsoftc.async_proc; >> - if (p != NULL) { >> - PROC_LOCK(p); >> - kern_psignal(p, SIGIO); >> - PROC_UNLOCK(p); >> - } >> + if (devsoftc.async && devsoftc.sigio != NULL) >> + pgsigio(&devsoftc.sigio, SIGIO, 0); >> return; >> out: >> /* >> >> > That makes it work more like the other users of fsetown(), which is > probably a good thing. The downside is that two syscalls are needed to > activate it, which I was trying to avoid that with my patch. I noticed > that logopen() in subr_log.c unconditionally calls fsetown(), which > would avoid the need for an extra syscall. This is incompatible with POSIX, at least "man 2 open" does not say a process opened the file will immediately be the owner. Two syscalls are necessary, because fsetown is expensive, so using a light weight fioasync to temporally disable and enable it is more flexible. > That also avoids the direct > manipulation of the pointer in your patch, which makes me nervous about > the possibility of a leak. fsetown() does already guard the leak problem. > I wonder if FIOASYNC should fail if > td->td_proc != devsoftc.sigio.sio_proc > (or the equivalent for other instances) to prevent a process from > maniuplating the async flag for a device "owned" by another process. I > think this check would need to be wrapped in SIGIO_LOCK()/SIGIO_UNLOCK() > to be safe. > > > most code in the kernel do not check ownership, I can not find one in kern/ sub-directory. From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 03:09:40 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22A68B1E; Sat, 29 Mar 2014 03:09:40 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02635A65; Sat, 29 Mar 2014 03:09:40 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s2T39afq028048; Sat, 29 Mar 2014 03:09:36 GMT (envelope-from davidxu@freebsd.org) Message-ID: <5336396E.7000801@freebsd.org> Date: Sat, 29 Mar 2014 11:09:34 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Mateusz Guzik , Don Lewis Subject: Re: svn commit: r263755 - head/sys/kern References: <53351627.9000703@freebsd.org> <201403281613.s2SGDKpk010871@gw.catspoiler.org> <20140329025602.GB29296@dft-labs.eu> In-Reply-To: <20140329025602.GB29296@dft-labs.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: kostikbel@gmail.com, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, mjg@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 03:09:40 -0000 On 2014/03/29 10:56, Mateusz Guzik wrote: > On Fri, Mar 28, 2014 at 09:13:20AM -0700, Don Lewis wrote: >> On 28 Mar, David Xu wrote: >>> I have tweaked it a bit, is this okay ? >>> >>> # HG changeset patch >>> # Parent 53b614ff2cae108f27e4475989d3a86997017268 >>> >>> diff -r 53b614ff2cae sys/kern/subr_bus.c >>> --- a/sys/kern/subr_bus.c Thu Mar 27 10:03:50 2014 +0800 >>> +++ b/sys/kern/subr_bus.c Fri Mar 28 14:22:29 2014 +0800 >>> @@ -391,11 +391,12 @@ >>> int inuse; >>> int nonblock; >>> int queued; >>> + int async; >>> struct mtx mtx; >>> struct cv cv; >>> struct selinfo sel; >>> struct devq devq; >>> - struct proc *async_proc; >>> + struct sigio *sigio; >>> } devsoftc; >>> >>> static struct cdev *devctl_dev; >>> @@ -422,7 +423,8 @@ >>> /* move to init */ >>> devsoftc.inuse = 1; >>> devsoftc.nonblock = 0; >>> - devsoftc.async_proc = NULL; >>> + devsoftc.async = 0; >>> + devsoftc.sigio = NULL; >>> mtx_unlock(&devsoftc.mtx); >>> return (0); >>> } >>> @@ -433,8 +435,9 @@ >>> >>> mtx_lock(&devsoftc.mtx); >>> devsoftc.inuse = 0; >>> - devsoftc.async_proc = NULL; >>> + devsoftc.async = 0; >>> cv_broadcast(&devsoftc.cv); >>> + funsetown(&devsoftc.sigio); >>> mtx_unlock(&devsoftc.mtx); >>> return (0); >>> } >>> @@ -490,33 +493,21 @@ >>> devsoftc.nonblock = 0; >>> return (0); >>> case FIOASYNC: >>> - /* >>> - * FIXME: >>> - * Since this is a simple assignment there is no guarantee that >>> - * devsoftc.async_proc consumers will get a valid pointer. >>> - * >>> - * Example scenario where things break (processes A and B): >>> - * 1. A opens devctl >>> - * 2. A sends fd to B >>> - * 3. B sets itself as async_proc >>> - * 4. B exits >>> - * >>> - * However, normally this requires root privileges and the only >>> - * in-tree consumer does not behave in a dangerous way so the >>> - * issue is not critical. >>> - */ >>> if (*(int*)data) >>> - devsoftc.async_proc = td->td_proc; >>> + devsoftc.async = 1; >>> else >>> - devsoftc.async_proc = NULL; >>> + devsoftc.async = 0; >>> + return (0); >>> + case FIOSETOWN: >>> + return fsetown(*(int *)data, &devsoftc.sigio); >>> + case FIOGETOWN: >>> + *(int *)data = fgetown(&devsoftc.sigio); >>> return (0); >>> >>> /* (un)Support for other fcntl() calls. */ >>> case FIOCLEX: >>> case FIONCLEX: >>> case FIONREAD: >>> - case FIOSETOWN: >>> - case FIOGETOWN: >>> default: >>> break; >>> } >>> @@ -560,7 +551,6 @@ >>> devctl_queue_data_f(char *data, int flags) >>> { >>> struct dev_event_info *n1 = NULL, *n2 = NULL; >>> - struct proc *p; >>> >>> if (strlen(data) == 0) >>> goto out; >>> @@ -590,13 +580,8 @@ >>> cv_broadcast(&devsoftc.cv); >>> mtx_unlock(&devsoftc.mtx); >>> selwakeup(&devsoftc.sel); >>> - /* XXX see a comment in devioctl */ >>> - p = devsoftc.async_proc; >>> - if (p != NULL) { >>> - PROC_LOCK(p); >>> - kern_psignal(p, SIGIO); >>> - PROC_UNLOCK(p); >>> - } >>> + if (devsoftc.async && devsoftc.sigio != NULL) >>> + pgsigio(&devsoftc.sigio, SIGIO, 0); >>> return; >>> out: >>> /* >>> >>> >> That makes it work more like the other users of fsetown(), which is >> probably a good thing. The downside is that two syscalls are needed to >> activate it, which I was trying to avoid that with my patch. I noticed >> that logopen() in subr_log.c unconditionally calls fsetown(), which >> would avoid the need for an extra syscall. That also avoids the direct >> manipulation of the pointer in your patch, which makes me nervous about >> the possibility of a leak. >> >> I wonder if FIOASYNC should fail if >> td->td_proc != devsoftc.sigio.sio_proc >> (or the equivalent for other instances) to prevent a process from >> maniuplating the async flag for a device "owned" by another process. I >> think this check would need to be wrapped in SIGIO_LOCK()/SIGIO_UNLOCK() >> to be safe. >> > But this patch would mean that current consumers (if any) would break - > just calling FIOASYNC would not result in receiving SIGIO. The old behavior is inconsistent with other piece of code in the kernel and may be incompatible with POSIX. > Original patch by Don seems to work fine though, but I'm unsure about > one thing (present in this patch as well): > > There is one devsoftc.sigio instance and one can get multiple processes > with devctl fd. Is it safe from kernel perspective to have multiple > processes call fsetown(*(int *)data, &devsoftc.sigio)? > There is an inuse variable guarding this problem, you can not open it multiple times, you can only do it in the forked process which inherited the fd. if you don't trust the child process, you can close it before executing real code in the child process. From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 03:25:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36229FEC; Sat, 29 Mar 2014 03:25:20 +0000 (UTC) Received: from mail-we0-x22e.google.com (mail-we0-x22e.google.com [IPv6:2a00:1450:400c:c03::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0947EBE9; Sat, 29 Mar 2014 03:25:18 +0000 (UTC) Received: by mail-we0-f174.google.com with SMTP id t60so3100350wes.33 for ; Fri, 28 Mar 2014 20:25:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=4FrWv6y0nMs3ySwD9AlF93ezbZ3V1PEGrEpCJPIA5Rk=; b=cZ3/iAsObMMWA01z2Jj9GtXhGuI35jLMVSK3N2T0w5pR0HmMpNJjncdz4k8tMYtIsw zbsqVaHcPlSpv5x+8l/suRMrxXA+UkAitoXC9Wd4x4d0lv4Lmf75Tneix8RKDMkrqmCf rhe39EgrFHwspMwfJpDiXHhNRiXLfB91PIK4ok2APn7nU5355Ug3ET4KilR+jBW1eLfL yrsNkQfH9icM7FMI0O/VEj1RIm8lAISwTzDMHDaSAltJ8y0amhsBDLmtmd1ly31ofrey h5Qb4Ymc5kjq0WyWOmCvJysgkrB/a3zPmIlMmIjwtUTKdmz139v0EcXb0/MoR1R9IREo VDJg== X-Received: by 10.194.6.106 with SMTP id z10mr1657036wjz.1.1396063517347; Fri, 28 Mar 2014 20:25:17 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id bm8sm2074519wjc.12.2014.03.28.20.25.15 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 28 Mar 2014 20:25:16 -0700 (PDT) Date: Sat, 29 Mar 2014 04:25:13 +0100 From: Mateusz Guzik To: David Xu Subject: Re: svn commit: r263755 - head/sys/kern Message-ID: <20140329032513.GC29296@dft-labs.eu> References: <53351627.9000703@freebsd.org> <201403281613.s2SGDKpk010871@gw.catspoiler.org> <20140329025602.GB29296@dft-labs.eu> <5336396E.7000801@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5336396E.7000801@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@FreeBSD.org, mjg@FreeBSD.org, Don Lewis , svn-src-head@FreeBSD.org, kostikbel@gmail.com, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 03:25:20 -0000 On Sat, Mar 29, 2014 at 11:09:34AM +0800, David Xu wrote: > On 2014/03/29 10:56, Mateusz Guzik wrote: > >But this patch would mean that current consumers (if any) would break - > >just calling FIOASYNC would not result in receiving SIGIO. > The old behavior is inconsistent with other piece of code in the kernel and > may be incompatible with POSIX. > Oh, I didn't know that. Unsure what to do in this case. > >Original patch by Don seems to work fine though, but I'm unsure about > >one thing (present in this patch as well): > > > >There is one devsoftc.sigio instance and one can get multiple processes > >with devctl fd. Is it safe from kernel perspective to have multiple > >processes call fsetown(*(int *)data, &devsoftc.sigio)? > > > > There is an inuse variable guarding this problem, you can not open it > multiple times, you can only do it in the forked process which inherited > the fd. if you don't trust the child process, you can close it before > executing real code in the child process. > This does not answer my question. I can easily imagine devctl extended in the future so that there are per-jail instances (could be handy to monitor e.g. vnet related events like link changes). If fsetown handling like this is insecure this would bite us in that scenario (and few others). In short, if we can avoid giving another way to corrupt stuff in the kernel to userspace, we should. -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 03:52:14 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBC65626; Sat, 29 Mar 2014 03:52:14 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C469CDF9; Sat, 29 Mar 2014 03:52:14 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s2T3qBEw044359; Sat, 29 Mar 2014 03:52:12 GMT (envelope-from davidxu@freebsd.org) Message-ID: <53364369.10500@freebsd.org> Date: Sat, 29 Mar 2014 11:52:09 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Mateusz Guzik Subject: Re: svn commit: r263755 - head/sys/kern References: <53351627.9000703@freebsd.org> <201403281613.s2SGDKpk010871@gw.catspoiler.org> <20140329025602.GB29296@dft-labs.eu> <5336396E.7000801@freebsd.org> <20140329032513.GC29296@dft-labs.eu> In-Reply-To: <20140329032513.GC29296@dft-labs.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, mjg@FreeBSD.org, Don Lewis , svn-src-head@FreeBSD.org, kostikbel@gmail.com, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 03:52:14 -0000 On 2014/03/29 11:25, Mateusz Guzik wrote: > On Sat, Mar 29, 2014 at 11:09:34AM +0800, David Xu wrote: >> On 2014/03/29 10:56, Mateusz Guzik wrote: >>> But this patch would mean that current consumers (if any) would break - >>> just calling FIOASYNC would not result in receiving SIGIO. >> The old behavior is inconsistent with other piece of code in the kernel and >> may be incompatible with POSIX. >> > Oh, I didn't know that. Unsure what to do in this case. > >>> Original patch by Don seems to work fine though, but I'm unsure about >>> one thing (present in this patch as well): >>> >>> There is one devsoftc.sigio instance and one can get multiple processes >>> with devctl fd. Is it safe from kernel perspective to have multiple >>> processes call fsetown(*(int *)data, &devsoftc.sigio)? >>> >> There is an inuse variable guarding this problem, you can not open it >> multiple times, you can only do it in the forked process which inherited >> the fd. if you don't trust the child process, you can close it before >> executing real code in the child process. >> > This does not answer my question. > > I can easily imagine devctl extended in the future so that there are > per-jail instances (could be handy to monitor e.g. vnet related events > like link changes). > > If fsetown handling like this is insecure this would bite us in that > scenario (and few others). In short, if we can avoid giving another way > to corrupt stuff in the kernel to userspace, we should. > I can not see what you said, where is the security problem with fsetown ? if you have per-jail instance of devsoftc, they all are operating on their own instance. but I don't think this patch should address jail now, there are many things are not jail ready. From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 04:14:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6964E0E; Sat, 29 Mar 2014 04:14:47 +0000 (UTC) Received: from mail-we0-x233.google.com (mail-we0-x233.google.com [IPv6:2a00:1450:400c:c03::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA6D7F76; Sat, 29 Mar 2014 04:14:46 +0000 (UTC) Received: by mail-we0-f179.google.com with SMTP id x48so3002437wes.24 for ; Fri, 28 Mar 2014 21:14:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=jfe7MpdnaefwYL4LnhE+GslYjk5kvhY7KTF+5U8N4B8=; b=Ur+iSsXWLrK/+NCrygcLyn7g4EJwvkwCK/u+pjZqESIYihEFhguqZj0gfc0rL+bnXc djXiqFUbxctcpDjKPHO3ycjNBH3DAGcLdUY3ziqQE/tMQOtCkBGTXVkWAqDXWDK2VSSp jzK+P84z27qgHjqmcL+cMxF/deu4CDivZHShcplF9A6SoGyFA9wIeDZVY+1vmT2wmYOd lOHB4XuM4aXSkpCzueYJ2sEb39kCxgjNJp41HmyMPCV9s1mYNxbx/JfLvq0vj6TH7Op8 6fuzfAtMjzszNPXzVv3IiWkf1VaGMWXBpTIhINAaUzR9r6CzQkdBJzqOad+fFCA48AQD ru7g== X-Received: by 10.180.185.232 with SMTP id ff8mr342784wic.25.1396066484905; Fri, 28 Mar 2014 21:14:44 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id fs4sm11717847wib.11.2014.03.28.21.14.43 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 28 Mar 2014 21:14:43 -0700 (PDT) Date: Sat, 29 Mar 2014 05:14:41 +0100 From: Mateusz Guzik To: David Xu Subject: Re: svn commit: r263755 - head/sys/kern Message-ID: <20140329041441.GD29296@dft-labs.eu> References: <53351627.9000703@freebsd.org> <201403281613.s2SGDKpk010871@gw.catspoiler.org> <20140329025602.GB29296@dft-labs.eu> <5336396E.7000801@freebsd.org> <20140329032513.GC29296@dft-labs.eu> <53364369.10500@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <53364369.10500@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@FreeBSD.org, mjg@FreeBSD.org, Don Lewis , svn-src-head@FreeBSD.org, kostikbel@gmail.com, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 04:14:47 -0000 On Sat, Mar 29, 2014 at 11:52:09AM +0800, David Xu wrote: > >If fsetown handling like this is insecure this would bite us in that > >scenario (and few others). In short, if we can avoid giving another way > >to corrupt stuff in the kernel to userspace, we should. > > > I can not see what you said, where is the security problem with fsetown ? > if you have per-jail instance of devsoftc, they all are operating on their > own instance. but I don't think this patch should address jail now, there > are many things are not jail ready. > I asked if multpiple concurrent calls to fsetown(.., &pointer) could result in some corruption in the kernel - if they could, we would have a problem in the future. I decided to read the code once more and fsetown seems to be safe in this regard after all and with that in mind the patch looks good to me. This thread is too long already, so I'm stepping down on this one in case there are some futher concerns. -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 04:15:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41CC716B; Sat, 29 Mar 2014 04:15:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22B8AFE0; Sat, 29 Mar 2014 04:15:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2T4FCZl059390; Sat, 29 Mar 2014 04:15:12 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2T4FBDx059383; Sat, 29 Mar 2014 04:15:11 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201403290415.s2T4FBDx059383@svn.freebsd.org> From: Edwin Groothuis Date: Sat, 29 Mar 2014 04:15:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263901 - head/contrib/tzdata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 04:15:13 -0000 Author: edwin Date: Sat Mar 29 04:15:11 2014 New Revision: 263901 URL: http://svnweb.freebsd.org/changeset/base/263901 Log: MFV for 263899, tzdata2014b - Update antartica. - Comments about historical data for Hawaii. - Update details for Crimea on 30 March - Move location data Simferopol. Modified: head/contrib/tzdata/africa head/contrib/tzdata/antarctica head/contrib/tzdata/australasia head/contrib/tzdata/europe head/contrib/tzdata/zone.tab Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/africa ============================================================================== --- head/contrib/tzdata/africa Sat Mar 29 04:12:34 2014 (r263900) +++ head/contrib/tzdata/africa Sat Mar 29 04:15:11 2014 (r263901) @@ -868,7 +868,10 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # Another source (specifying the time for start and end in the decree): # http://www.lemag.ma/Heure-d-ete-au-Maroc-jusqu-au-27-octobre_a75620.html -# From Paul Eggert (2013-10-03): +# From Sebastien Willemijns (2014-03-18): +# http://www.afriquinfos.com/articles/2014/3/18/maroc-heure-dete-avancez-tous-horloges-247891.asp + +# From Paul Eggert (2014-03-19): # To estimate what the Moroccan government will do in future years, # transition dates for 2014 through 2038 were determined by running # the following program under GNU Emacs 24.3: Modified: head/contrib/tzdata/antarctica ============================================================================== --- head/contrib/tzdata/antarctica Sat Mar 29 04:12:34 2014 (r263900) +++ head/contrib/tzdata/antarctica Sat Mar 29 04:15:11 2014 (r263901) @@ -230,24 +230,41 @@ Zone Antarctica/Syowa 0 - zzz 1957 Jan 2 # year-round base # Scott Base, Ross Island, since 1957-01. # See Pacific/Auckland. -# -# These rules for New Zealand are stolen from the 'australasia' file. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule NZAQ 1974 only - Nov 3 2:00s 1:00 D -Rule NZAQ 1975 1988 - Oct lastSun 2:00s 1:00 D -Rule NZAQ 1989 only - Oct 8 2:00s 1:00 D -Rule NZAQ 1990 2006 - Oct Sun>=1 2:00s 1:00 D -Rule NZAQ 1975 only - Feb 23 2:00s 0 S -Rule NZAQ 1976 1989 - Mar Sun>=1 2:00s 0 S -Rule NZAQ 1990 2007 - Mar Sun>=15 2:00s 0 S -Rule NZAQ 2007 max - Sep lastSun 2:00s 1:00 D -Rule NZAQ 2008 max - Apr Sun>=1 2:00s 0 S # Norway - territories # Bouvet (never inhabited) # # claims # Peter I Island (never inhabited) +# +# year-round base +# Troll, Queen Maud Land, -720041+0023206, since 2005-02-12 +# +# From Paul-Inge Flakstad (2014-03-10): +# I recently had a long dialog about this with the developer of timegenie.com. +# In the absence of specific dates, he decided to choose some likely ones: +# GMT +1 - From March 1 to the last Sunday in March +# GMT +2 - From the last Sunday in March until the last Sunday in October +# GMT +1 - From the last Sunday in October until November 7 +# GMT +0 - From November 7 until March 1 +# The dates for switching to and from UTC+0 will probably not be absolutely +# correct, but they should be quite close to the actual dates. +# +# From Paul Eggert (2014-03-21): +# The CET-switching Troll rules require zic from tzcode 2014b or later, so as +# suggested by Bengt-Inge Larsson comment them out for now, and approximate +# with only UTC and CEST. Uncomment them when 2014b is more prevalent. +# +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +#Rule Troll 2005 max - Mar 1 1:00u 1:00 CET +Rule Troll 2005 max - Mar lastSun 1:00u 2:00 CEST +#Rule Troll 2005 max - Oct lastSun 1:00u 1:00 CET +#Rule Troll 2004 max - Nov 7 1:00u 0:00 UTC +# Remove the following line when uncommenting the above '#Rule' lines. +Rule Troll 2004 max - Oct lastSun 1:00u 0:00 UTC +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Antarctica/Troll 0 - zzz 2005 Feb 12 + 0:00 Troll %s # Poland - year-round base # Arctowski, King George Island, -620945-0582745, since 1977 Modified: head/contrib/tzdata/australasia ============================================================================== --- head/contrib/tzdata/australasia Sat Mar 29 04:12:34 2014 (r263900) +++ head/contrib/tzdata/australasia Sat Mar 29 04:15:11 2014 (r263901) @@ -763,14 +763,29 @@ Zone Pacific/Funafuti 11:56:52 - LMT 190 # Johnston # -# From Paul Eggert (2013-09-03): +# From Paul Eggert (2014-03-11): +# Sometimes Johnston kept Hawaii time, and sometimes it was an hour behind. +# Details are uncertain. We have no data for Johnston after 1970, so +# treat it like Hawaii for now. +# # In his memoirs of June 6th to October 4, 1945 # (2005), Herbert C. Bach writes, # "We started our letdown to Kwajalein Atoll and landed there at 5:00 AM # Johnston time, 1:30 AM Kwajalein time." This was in June 1945, and # confirms that Johnston kept the same time as Honolulu in summer 1945. -# We have no better information, so for now, assume this has been true -# indefinitely into the past. +# +# From Lyle McElhaney (2014-03-11): +# [W]hen JI was being used for that [atomic bomb] testing, the time being used +# was not Hawaiian time but rather the same time being used on the ships, +# which had a GMT offset of -11 hours. This apparently applied to at least the +# time from Operation Newsreel (Hardtack I/Teak shot, 1958-08-01) to the last +# Operation Fishbowl shot (Tightrope, 1962-11-04).... [See] Herman Hoerlin, +# "The United States High-Altitude Test Experience: A Review Emphasizing the +# Impact on the Environment", Los Alamos LA-6405, Oct 1976 +# . +# See the table on page 4 where he lists GMT and local times for the tests; a +# footnote for the JI tests reads that local time is "JI time = Hawaii Time +# Minus One Hour". # # See 'northamerica' for Pacific/Johnston. Modified: head/contrib/tzdata/europe ============================================================================== --- head/contrib/tzdata/europe Sat Mar 29 04:12:34 2014 (r263900) +++ head/contrib/tzdata/europe Sat Mar 29 04:15:11 2014 (r263901) @@ -2963,7 +2963,11 @@ Zone Europe/Simferopol 2:16:24 - LMT 188 # Assume it happened in March by not changing the clocks. 3:00 Russia MSK/MSD 1997 3:00 - MSK 1997 Mar lastSun 1:00u - 2:00 EU EE%sT +# From Alexander Krivenyshev (2014-03-17): +# time change at 2:00 (2am) on March 30, 2014 +# http://vz.ru/news/2014/3/17/677464.html + 2:00 EU EE%sT 2014 Mar 30 2:00 + 4:00 - MSK # Vatican City # See Europe/Rome. Modified: head/contrib/tzdata/zone.tab ============================================================================== --- head/contrib/tzdata/zone.tab Sat Mar 29 04:12:34 2014 (r263900) +++ head/contrib/tzdata/zone.tab Sat Mar 29 04:15:11 2014 (r263901) @@ -52,6 +52,7 @@ AQ -6617+11031 Antarctica/Casey Casey St AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I +AQ -720041+0023206 Antarctica/Troll Troll Station, Queen Maud Land AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF) AR -3124-06411 America/Argentina/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF) AR -2447-06525 America/Argentina/Salta (SA, LP, NQ, RN) @@ -344,6 +345,7 @@ RU +5443+02030 Europe/Kaliningrad Moscow RU +5545+03735 Europe/Moscow Moscow+00 - west Russia RU +4844+04425 Europe/Volgograd Moscow+00 - Caspian Sea RU +5312+05009 Europe/Samara Moscow+00 - Samara, Udmurtia +RU +4457+03406 Europe/Simferopol Moscow+00 - Crimea RU +5651+06036 Asia/Yekaterinburg Moscow+02 - Urals RU +5500+07324 Asia/Omsk Moscow+03 - west Siberia RU +5502+08255 Asia/Novosibirsk Moscow+03 - Novosibirsk @@ -399,7 +401,6 @@ TZ -0648+03917 Africa/Dar_es_Salaam UA +5026+03031 Europe/Kiev most locations UA +4837+02218 Europe/Uzhgorod Ruthenia UA +4750+03510 Europe/Zaporozhye Zaporozh'ye, E Lugansk / Zaporizhia, E Luhansk -UA +4457+03406 Europe/Simferopol central Crimea UG +0019+03225 Africa/Kampala UM +1645-16931 Pacific/Johnston Johnston Atoll UM +2813-17722 Pacific/Midway Midway Islands From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 04:31:11 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C6C7B98; Sat, 29 Mar 2014 04:31:11 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05A3D220; Sat, 29 Mar 2014 04:31:11 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s2T4V6f2058504; Sat, 29 Mar 2014 04:31:08 GMT (envelope-from davidxu@freebsd.org) Message-ID: <53364C88.5080706@freebsd.org> Date: Sat, 29 Mar 2014 12:31:04 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Mateusz Guzik Subject: Re: svn commit: r263755 - head/sys/kern References: <53351627.9000703@freebsd.org> <201403281613.s2SGDKpk010871@gw.catspoiler.org> <20140329025602.GB29296@dft-labs.eu> <5336396E.7000801@freebsd.org> <20140329032513.GC29296@dft-labs.eu> <53364369.10500@freebsd.org> <20140329041441.GD29296@dft-labs.eu> In-Reply-To: <20140329041441.GD29296@dft-labs.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, mjg@FreeBSD.org, Don Lewis , svn-src-head@FreeBSD.org, kostikbel@gmail.com, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 04:31:11 -0000 On 2014/03/29 12:14, Mateusz Guzik wrote: > I asked if multpiple concurrent calls to fsetown(.., &pointer) could > result in some corruption in the kernel - if they could, we would have > a problem in the future. I decided to read the code once more and > fsetown seems to be safe in this regard after all and with that in > mind the patch looks good to me. This thread is too long already, so > I'm stepping down on this one in case there are some futher concerns. This thread is really long, but things must be clarified, so it was not long enough. :-) Previously I supposed you had read the fsetown code, if not, I was wrong, lol. From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 07:53:06 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 664C94F4; Sat, 29 Mar 2014 07:53:06 +0000 (UTC) Received: from gw.catspoiler.org (gw.catspoiler.org [75.1.14.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43F2E17F; Sat, 29 Mar 2014 07:53:05 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s2T7qldY012467; Fri, 28 Mar 2014 23:52:51 -0800 (PST) (envelope-from truckman@FreeBSD.org) Message-Id: <201403290752.s2T7qldY012467@gw.catspoiler.org> Date: Sat, 29 Mar 2014 00:52:47 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r263755 - head/sys/kern To: mjguzik@gmail.com In-Reply-To: <20140329041441.GD29296@dft-labs.eu> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: src-committers@FreeBSD.org, mjg@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, davidxu@FreeBSD.org, kostikbel@gmail.com X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 07:53:06 -0000 On 29 Mar, Mateusz Guzik wrote: > On Sat, Mar 29, 2014 at 11:52:09AM +0800, David Xu wrote: >> >If fsetown handling like this is insecure this would bite us in that >> >scenario (and few others). In short, if we can avoid giving another way >> >to corrupt stuff in the kernel to userspace, we should. >> > >> I can not see what you said, where is the security problem with fsetown ? >> if you have per-jail instance of devsoftc, they all are operating on their >> own instance. but I don't think this patch should address jail now, there >> are many things are not jail ready. >> > > I asked if multpiple concurrent calls to fsetown(.., &pointer) could > result in some corruption in the kernel - if they could, we would have a > problem in the future. > > I decided to read the code once more and fsetown seems to be safe in > this regard after all and with that in mind the patch looks good to me. The fsetown() implementation does sufficient locking to prevent the kernel from getting into a bad state. The issue is that the device can only have at most one owner (which may be a process group). If multiple processes are allowed to open the device, or if a process that opened the device shares the descriptor with another process, the last call to fsetown() wins. That means that one process could steal ownership from another if they both have the same device open. The reason that I suggested checking ownership when handling FIOASYNC is that in the case of two processes sharing access to a device, there is currently nothing that prevents a non-owner of the device from enabling this mode and causing SIGIO signals to be sent to the owner, which might not be expecting to receive them. From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 10:11:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C085EB36; Sat, 29 Mar 2014 10:11:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE0A5ED1; Sat, 29 Mar 2014 10:11:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2TABJvs008250; Sat, 29 Mar 2014 10:11:19 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2TABJSR008249; Sat, 29 Mar 2014 10:11:19 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201403291011.s2TABJSR008249@svn.freebsd.org> From: Andrew Turner Date: Sat, 29 Mar 2014 10:11:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263910 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 10:11:19 -0000 Author: andrew Date: Sat Mar 29 10:11:19 2014 New Revision: 263910 URL: http://svnweb.freebsd.org/changeset/base/263910 Log: Add more flags for the fpexc register from the ARM1176JZF-S Manual Modified: head/sys/arm/include/vfp.h Modified: head/sys/arm/include/vfp.h ============================================================================== --- head/sys/arm/include/vfp.h Sat Mar 29 09:27:08 2014 (r263909) +++ head/sys/arm/include/vfp.h Sat Mar 29 10:11:19 2014 (r263910) @@ -92,6 +92,11 @@ /* VFPEXC */ #define VFPEXC_EX (0x80000000) /* exception v1 v2 */ #define VFPEXC_EN (0x40000000) /* vfp enable */ +#define VFPEXC_FP2V (0x10000000) /* FPINST2 valid */ +#define VFPEXC_INV (0x00000080) /* Input exception */ +#define VFPEXC_UFC (0x00000008) /* Underflow exception */ +#define VFPEXC_OFC (0x00000004) /* Overflow exception */ +#define VFPEXC_IOC (0x00000001) /* Invlaid operation */ /* version 3 registers */ /* VMVFR0 */ From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 11:56:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77618F49; Sat, 29 Mar 2014 11:56:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AD0F905; Sat, 29 Mar 2014 11:56:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2TBuYuF050727; Sat, 29 Mar 2014 11:56:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2TBuXC3050725; Sat, 29 Mar 2014 11:56:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201403291156.s2TBuXC3050725@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 29 Mar 2014 11:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263912 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 11:56:34 -0000 Author: kib Date: Sat Mar 29 11:56:33 2014 New Revision: 263912 URL: http://svnweb.freebsd.org/changeset/base/263912 Log: Clear the kernel grab of the FPU state on fork. The pcb_save pointer is already correctly reset to the FPU user save area, only PCB_KERNFPU flag might leak from old thread state into the new state. For creation of the user-mode thread, the change is nop since corresponding syscall code does not use FPU. On the other hand, creation of a kernel thread forks from a thread selected arbitrary from proc0, which might use FPU. Reported and tested by: Chris Torek Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/vm_machdep.c head/sys/i386/i386/vm_machdep.c Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Sat Mar 29 11:33:52 2014 (r263911) +++ head/sys/amd64/amd64/vm_machdep.c Sat Mar 29 11:56:33 2014 (r263912) @@ -446,7 +446,8 @@ cpu_set_upcall(struct thread *td, struct * values here. */ bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); - clear_pcb_flags(pcb2, PCB_FPUINITDONE | PCB_USERFPUINITDONE); + clear_pcb_flags(pcb2, PCB_FPUINITDONE | PCB_USERFPUINITDONE | + PCB_KERNFPU); pcb2->pcb_save = get_pcb_user_save_pcb(pcb2); bcopy(get_pcb_user_save_td(td0), pcb2->pcb_save, cpu_max_ext_state_size); Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Sat Mar 29 11:33:52 2014 (r263911) +++ head/sys/i386/i386/vm_machdep.c Sat Mar 29 11:56:33 2014 (r263912) @@ -457,7 +457,8 @@ cpu_set_upcall(struct thread *td, struct * values here. */ bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); - pcb2->pcb_flags &= ~(PCB_NPXINITDONE | PCB_NPXUSERINITDONE); + pcb2->pcb_flags &= ~(PCB_NPXINITDONE | PCB_NPXUSERINITDONE | + PCB_KERNNPX); pcb2->pcb_save = &pcb2->pcb_user_save; /* From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 12:31:36 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E65B0B3E; Sat, 29 Mar 2014 12:31:36 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7D28BBD; Sat, 29 Mar 2014 12:31:36 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s2TCVWPd034887; Sat, 29 Mar 2014 12:31:33 GMT (envelope-from davidxu@freebsd.org) Message-ID: <5336BD22.1040906@freebsd.org> Date: Sat, 29 Mar 2014 20:31:30 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Don Lewis , mjguzik@gmail.com Subject: Re: svn commit: r263755 - head/sys/kern References: <201403290752.s2T7qldY012467@gw.catspoiler.org> In-Reply-To: <201403290752.s2T7qldY012467@gw.catspoiler.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kostikbel@gmail.com, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, mjg@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 12:31:37 -0000 On 2014/03/29 15:52, Don Lewis wrote: > On 29 Mar, Mateusz Guzik wrote: >> On Sat, Mar 29, 2014 at 11:52:09AM +0800, David Xu wrote: >>>> If fsetown handling like this is insecure this would bite us in that >>>> scenario (and few others). In short, if we can avoid giving another way >>>> to corrupt stuff in the kernel to userspace, we should. >>>> >>> I can not see what you said, where is the security problem with fsetown ? >>> if you have per-jail instance of devsoftc, they all are operating on their >>> own instance. but I don't think this patch should address jail now, there >>> are many things are not jail ready. >>> >> I asked if multpiple concurrent calls to fsetown(.., &pointer) could >> result in some corruption in the kernel - if they could, we would have a >> problem in the future. >> >> I decided to read the code once more and fsetown seems to be safe in >> this regard after all and with that in mind the patch looks good to me. > > > The fsetown() implementation does sufficient locking to prevent the > kernel from getting into a bad state. The issue is that the device can > only have at most one owner (which may be a process group). If multiple > processes are allowed to open the device, or if a process that opened > the device shares the descriptor with another process, the last call to > fsetown() wins. That means that one process could steal ownership from > another if they both have the same device open. > > The reason that I suggested checking ownership when handling FIOASYNC is > that in the case of two processes sharing access to a device, there is > currently nothing that prevents a non-owner of the device from enabling > this mode and causing SIGIO signals to be sent to the owner, which might > not be expecting to receive them. I think if you add ownership checking, it will be incompatible with other code, people have to change their mind when dealing with this special file descriptor, my recommendation is people don't need to refresh their brain. OTOH, if it is a problem, we should have already been flooded by the problem, but in the past years, I saw zero complaining in the mailing lists. From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 14:17:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6945E315; Sat, 29 Mar 2014 14:17:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 561586C8; Sat, 29 Mar 2014 14:17:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2TEH5f6009589; Sat, 29 Mar 2014 14:17:05 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2TEH4R3009586; Sat, 29 Mar 2014 14:17:04 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201403291417.s2TEH4R3009586@svn.freebsd.org> From: Andrew Turner Date: Sat, 29 Mar 2014 14:17:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263913 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 14:17:05 -0000 Author: andrew Date: Sat Mar 29 14:17:04 2014 New Revision: 263913 URL: http://svnweb.freebsd.org/changeset/base/263913 Log: Initialise fpscr to a sane value when we create the pcb. This sets NaNs to be the default NaN and for denormalised numbers to be flushed to zero. Modified: head/sys/arm/arm/machdep.c head/sys/arm/arm/vm_machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Mar 29 11:56:33 2014 (r263912) +++ head/sys/arm/arm/machdep.c Sat Mar 29 14:17:04 2014 (r263913) @@ -101,6 +101,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -990,6 +991,7 @@ init_proc0(vm_offset_t kstack) (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; thread0.td_pcb->pcb_flags = 0; thread0.td_pcb->pcb_vfpcpu = -1; + thread0.td_pcb->pcb_vfpstate.fpscr = VFPSCR_DN | VFPSCR_FZ; thread0.td_frame = &proc0_tf; pcpup->pc_curpcb = thread0.td_pcb; } Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Sat Mar 29 11:56:33 2014 (r263912) +++ head/sys/arm/arm/vm_machdep.c Sat Mar 29 14:17:04 2014 (r263913) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* * struct switchframe and trapframe must both be a multiple of 8 @@ -147,6 +148,7 @@ cpu_fork(register struct thread *td1, re pcb2->un_32.pcb32_sp = td2->td_kstack + USPACE_SVC_STACK_TOP - sizeof(*pcb2); pcb2->pcb_vfpcpu = -1; + pcb2->pcb_vfpstate.fpscr = VFPSCR_DN | VFPSCR_FZ; pmap_activate(td2); td2->td_frame = tf = (struct trapframe *)STACKALIGN( pcb2->un_32.pcb32_sp - sizeof(struct trapframe)); From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 14:35:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB7859F1; Sat, 29 Mar 2014 14:35:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB60C8BD; Sat, 29 Mar 2014 14:35:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2TEZaXM017642; Sat, 29 Mar 2014 14:35:36 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2TEZaPR017640; Sat, 29 Mar 2014 14:35:36 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201403291435.s2TEZaPR017640@svn.freebsd.org> From: Andrew Turner Date: Sat, 29 Mar 2014 14:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263914 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 14:35:36 -0000 Author: andrew Date: Sat Mar 29 14:35:36 2014 New Revision: 263914 URL: http://svnweb.freebsd.org/changeset/base/263914 Log: VFP fixes/cleanups for ARM11: * Save the required VFP registers on context switch. If the exception bit is set we need to save and restore the FPINST register, and if the fp2v bit is also set we need to save and restore FPINST2. * Move saving and restoring the floating point control registers to C. * Clear the fpexc exception and fp2v flags on a floating-point exception. * Signal a SIGFPE if the fpexc exception flag is set on an undefined instruction. This is how the ARM core signals to software there is a floating-point exception. Modified: head/sys/arm/arm/vfp.c head/sys/arm/include/fp.h Modified: head/sys/arm/arm/vfp.c ============================================================================== --- head/sys/arm/arm/vfp.c Sat Mar 29 14:17:04 2014 (r263913) +++ head/sys/arm/arm/vfp.c Sat Mar 29 14:35:36 2014 (r263914) @@ -149,6 +149,7 @@ vfp_bounce(u_int addr, u_int insn, struc { u_int cpu, fpexc; struct pcb *curpcb; + ksiginfo_t ksi; if ((code & FAULT_USER) == 0) panic("undefined floating point instruction in supervisor mode"); @@ -162,9 +163,27 @@ vfp_bounce(u_int addr, u_int insn, struc */ fpexc = fmrx(VFPEXC); if (fpexc & VFPEXC_EN) { + /* Clear any exceptions */ + fmxr(VFPEXC, fpexc & ~(VFPEXC_EX | VFPEXC_FP2V)); + /* kill the process - we do not handle emulation */ critical_exit(); - killproc(curthread->td_proc, "vfp emulation"); + + if (fpexc & VFPEXC_EX) { + /* We have an exception, signal a SIGFPE */ + ksiginfo_init_trap(&ksi); + ksi.ksi_signo = SIGFPE; + if (fpexc & VFPEXC_UFC) + ksi.ksi_code = FPE_FLTUND; + else if (fpexc & VFPEXC_OFC) + ksi.ksi_code = FPE_FLTOVF; + else if (fpexc & VFPEXC_IOC) + ksi.ksi_code = FPE_FLTINV; + ksi.ksi_addr = (void *)addr; + trapsignal(curthread, &ksi); + return 0; + } + return 1; } @@ -192,15 +211,24 @@ vfp_bounce(u_int addr, u_int insn, struc static void vfp_restore(struct vfp_state *vfpsave) { - u_int vfpscr = 0; + uint32_t fpexc; + + /* On VFPv2 we may need to restore FPINST and FPINST2 */ + fpexc = vfpsave->fpexec; + if (fpexc & VFPEXC_EX) { + fmxr(VFPINST, vfpsave->fpinst); + if (fpexc & VFPEXC_FP2V) + fmxr(VFPINST2, vfpsave->fpinst2); + } + fmxr(VFPSCR, vfpsave->fpscr); - __asm __volatile("ldc p10, c0, [%1], #128\n" /* d0-d15 */ - "cmp %2, #0\n" /* -D16 or -D32? */ - LDCLNE "p11, c0, [%1], #128\n" /* d16-d31 */ - "addeq %1, %1, #128\n" /* skip missing regs */ - "ldr %0, [%1]\n" /* set old vfpscr */ - "mcr p10, 7, %0, cr1, c0, 0\n" - : "=&r" (vfpscr) : "r" (vfpsave), "r" (is_d32) : "cc"); + __asm __volatile("ldc p10, c0, [%0], #128\n" /* d0-d15 */ + "cmp %1, #0\n" /* -D16 or -D32? */ + LDCLNE "p11, c0, [%0], #128\n" /* d16-d31 */ + "addeq %0, %0, #128\n" /* skip missing regs */ + : : "r" (vfpsave), "r" (is_d32) : "cc"); + + fmxr(VFPEXC, fpexc); } /* @@ -211,20 +239,30 @@ vfp_restore(struct vfp_state *vfpsave) void vfp_store(struct vfp_state *vfpsave, boolean_t disable_vfp) { - u_int tmp, vfpscr; + uint32_t fpexc; + + fpexc = fmrx(VFPEXC); /* Is the vfp enabled? */ + if (fpexc & VFPEXC_EN) { + vfpsave->fpexec = fpexc; + vfpsave->fpscr = fmrx(VFPSCR); + + /* On VFPv2 we may need to save FPINST and FPINST2 */ + if (fpexc & VFPEXC_EX) { + vfpsave->fpinst = fmrx(VFPINST); + if (fpexc & VFPEXC_FP2V) + vfpsave->fpinst2 = fmrx(VFPINST2); + fpexc &= ~VFPEXC_EX; + } - tmp = fmrx(VFPEXC); /* Is the vfp enabled? */ - if (tmp & VFPEXC_EN) { __asm __volatile( - "stc p11, c0, [%1], #128\n" /* d0-d15 */ - "cmp %2, #0\n" /* -D16 or -D32? */ - STCLNE "p11, c0, [%1], #128\n" /* d16-d31 */ - "addeq %1, %1, #128\n" /* skip missing regs */ - "mrc p10, 7, %0, cr1, c0, 0\n" /* fmxr(VFPSCR) */ - "str %0, [%1]\n" /* save vfpscr */ - : "=&r" (vfpscr) : "r" (vfpsave), "r" (is_d32) : "cc"); + "stc p11, c0, [%0], #128\n" /* d0-d15 */ + "cmp %1, #0\n" /* -D16 or -D32? */ + STCLNE "p11, c0, [%0], #128\n" /* d16-d31 */ + "addeq %0, %0, #128\n" /* skip missing regs */ + : : "r" (vfpsave), "r" (is_d32) : "cc"); + if (disable_vfp) - fmxr(VFPEXC , tmp & ~VFPEXC_EN); + fmxr(VFPEXC , fpexc & ~VFPEXC_EN); } } Modified: head/sys/arm/include/fp.h ============================================================================== --- head/sys/arm/include/fp.h Sat Mar 29 14:17:04 2014 (r263913) +++ head/sys/arm/include/fp.h Sat Mar 29 14:35:36 2014 (r263914) @@ -69,6 +69,9 @@ typedef struct fp_extended_precision fp_ struct vfp_state { u_int64_t reg[32]; u_int32_t fpscr; + u_int32_t fpexec; + u_int32_t fpinst; + u_int32_t fpinst2; }; /* From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 15:42:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D69B4A24 for ; Sat, 29 Mar 2014 15:42:16 +0000 (UTC) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3543E3C for ; Sat, 29 Mar 2014 15:42:16 +0000 (UTC) Received: by mail-pd0-f174.google.com with SMTP id y13so6085201pdi.19 for ; Sat, 29 Mar 2014 08:42:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=adU1kMR6mtYwsfX//GKZmacJA3I1fI3XnjaxyKrUgI4=; b=KvRIridKmtHJH7O/fHBw2zrbQqkoDgtDNOSUtnZk915OejszbuRhtgxDwzM9yO6a7l Vd4nC5BHDed/7k2A89IM9v0xkcl5hmkljDNgK6GEGDttT29boqdjLpSfLnQunRFisFCy bY28LhoxRGytBM82Ng2XU1qWw85M5U5H/msk1tpiSrQD00AClb5gEOn5bf6sW6OQZn+S K5vTQiPNbff/3iBoZoIFF+76/32wvh423i0odFTjwFrlQ4T+9b+5FZrsHVRK/UVnEL7a 1Xv3Mq1u4K+nHUtSH/ERjKjbzmgON6LjBY4nxr/vIQ5imbJ67G6uwANw5dqYM9oIgTAI Sdsg== X-Gm-Message-State: ALoCoQkLT95Gin1lzj1Sd/ZWaTPWwwafA/mkHvD4Fh7XWHdjTUgQOCoJlJ8VUviihKKpjSQFMJyO X-Received: by 10.68.163.197 with SMTP id yk5mr14830483pbb.57.1396107730690; Sat, 29 Mar 2014 08:42:10 -0700 (PDT) Received: from [10.64.26.19] (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id ac5sm32134407pbc.37.2014.03.29.08.42.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 29 Mar 2014 08:42:10 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263755 - head/sys/kern From: Warner Losh In-Reply-To: <5336BD22.1040906@freebsd.org> Date: Sat, 29 Mar 2014 09:42:08 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201403290752.s2T7qldY012467@gw.catspoiler.org> <5336BD22.1040906@freebsd.org> To: David Xu X-Mailer: Apple Mail (2.1874) Cc: Mateusz Guzik , Mateusz Guzik , Don Lewis , svn-src-head@FreeBSD.org, src-committers@FreeBSD.org, kostikbel@gmail.com, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 15:42:17 -0000 On Mar 29, 2014, at 6:31 AM, David Xu wrote: >=20 > On 2014/03/29 15:52, Don Lewis wrote: >> On 29 Mar, Mateusz Guzik wrote: >>> On Sat, Mar 29, 2014 at 11:52:09AM +0800, David Xu wrote: >>>>> If fsetown handling like this is insecure this would bite us in = that >>>>> scenario (and few others). In short, if we can avoid giving = another way >>>>> to corrupt stuff in the kernel to userspace, we should. >>>>>=20 >>>> I can not see what you said, where is the security problem with = fsetown ? >>>> if you have per-jail instance of devsoftc, they all are operating = on their >>>> own instance. but I don't think this patch should address jail now, = there >>>> are many things are not jail ready. >>>>=20 >>> I asked if multpiple concurrent calls to fsetown(.., &pointer) could >>> result in some corruption in the kernel - if they could, we would = have a >>> problem in the future. >>>=20 >>> I decided to read the code once more and fsetown seems to be safe in >>> this regard after all and with that in mind the patch looks good to = me. >> =20 >> The fsetown() implementation does sufficient locking to prevent the >> kernel from getting into a bad state. The issue is that the device = can >> only have at most one owner (which may be a process group). If = multiple >> processes are allowed to open the device, or if a process that opened >> the device shares the descriptor with another process, the last call = to >> fsetown() wins. That means that one process could steal ownership = from >> another if they both have the same device open. >>=20 >> The reason that I suggested checking ownership when handling FIOASYNC = is >> that in the case of two processes sharing access to a device, there = is >> currently nothing that prevents a non-owner of the device from = enabling >> this mode and causing SIGIO signals to be sent to the owner, which = might >> not be expecting to receive them. > I think if you add ownership checking, it will be incompatible with > other code, people have to change their mind when dealing with > this special file descriptor, my recommendation is people don't need > to refresh their brain. > OTOH, if it is a problem, we should have already been flooded by > the problem, but in the past years, I saw zero complaining in the = mailing > lists. I believe that the SIGIO code was cut and pasted from a driver I was = working on in the 4.x time frame. devd is the only consumer, and it doesn=92t do = the FIOASYNC stuff at all. So I=92d be strongly biased to either (a) remove support for this or (b) = make the support correct, even at the cost of speed or performance. Warner= From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 17:18:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E5DF272; Sat, 29 Mar 2014 17:18:14 +0000 (UTC) Received: from smtpauth2.wiscmail.wisc.edu (wmauth2.doit.wisc.edu [144.92.197.222]) (using TLSv1 with cipher DES-CBC3-SHA (168/168 bits)) (Client CN "smtpauth.wiscmail.wisc.edu", Issuer "InCommon Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EECF8854; Sat, 29 Mar 2014 17:18:13 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0N3700L00H9S9800@smtpauth2.wiscmail.wisc.edu>; Sat, 29 Mar 2014 11:18:05 -0500 (CDT) X-Spam-PmxInfo: Server=avs-2, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2014.3.29.160915, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by smtpauth2.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0N37001E1HA4QR30@smtpauth2.wiscmail.wisc.edu>; Sat, 29 Mar 2014 11:18:05 -0500 (CDT) Message-id: <5336F23B.9080402@freebsd.org> Date: Sat, 29 Mar 2014 09:18:03 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 To: Aleksandr Rybalko , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r263885 - in head/sys/dev/vt: . hw/vga References: <201403282204.s2SM4SeN001155@svn.freebsd.org> In-reply-to: <201403282204.s2SM4SeN001155@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 17:18:14 -0000 On 03/28/14 15:04, Aleksandr Rybalko wrote: > Author: ray > Date: Fri Mar 28 22:04:27 2014 > New Revision: 263885 > URL: http://svnweb.freebsd.org/changeset/base/263885 > > Log: > o Add new vd_driver method to do bitblt with mask, named vd_maskbitbltchr. > o Move vd_bitbltchr vga's driver method to vd_maskbitbltchr. > o Implement new vd_bitbltchr method for vga driver. (It do single write for 8 > pixels, have to be a bit faster). > Can you describe what this does? From the commit message, it sounds like it might repair vt performance on cards with 8-bit framebuffers generally, but I can't figure out the code. -Nathan From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 18:56:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31F0C12B; Sat, 29 Mar 2014 18:56:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DE21FE4; Sat, 29 Mar 2014 18:56:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2TIuBOr029413; Sat, 29 Mar 2014 18:56:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2TIuBQ5029412; Sat, 29 Mar 2014 18:56:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403291856.s2TIuBQ5029412@svn.freebsd.org> From: Adrian Chadd Date: Sat, 29 Mar 2014 18:56:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263917 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 18:56:12 -0000 Author: adrian Date: Sat Mar 29 18:56:11 2014 New Revision: 263917 URL: http://svnweb.freebsd.org/changeset/base/263917 Log: Fix ah_powerMode setting. Reported by: sbruno Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c Sat Mar 29 18:13:22 2014 (r263916) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c Sat Mar 29 18:56:11 2014 (r263917) @@ -669,6 +669,7 @@ ar9300_set_power_mode(struct ath_hal *ah switch (mode) { case HAL_PM_AWAKE: + ah->ah_powerMode = mode; status = ar9300_set_power_mode_awake(ah, set_chip); #if ATH_SUPPORT_MCI if (AH_PRIVATE(ah)->ah_caps.halMciSupport) { @@ -699,6 +700,7 @@ ar9300_set_power_mode(struct ath_hal *ah #endif ar9300_set_power_mode_sleep(ah, set_chip); ahp->ah_chip_full_sleep = AH_TRUE; + ah->ah_powerMode = mode; break; case HAL_PM_NETWORK_SLEEP: #if ATH_SUPPORT_MCI @@ -707,13 +709,13 @@ ar9300_set_power_mode(struct ath_hal *ah } #endif ar9300_set_power_mode_network_sleep(ah, set_chip); + ah->ah_powerMode = mode; break; default: HALDEBUG(ah, HAL_DEBUG_POWER_MGMT, "%s: unknown power mode %u\n", __func__, mode); return AH_FALSE; } - ah->ah_powerMode = status; return status; } From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 19:03:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A532F465; Sat, 29 Mar 2014 19:03:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 786FBF8; Sat, 29 Mar 2014 19:03:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2TJ3BbC033390; Sat, 29 Mar 2014 19:03:11 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2TJ3BBh033389; Sat, 29 Mar 2014 19:03:11 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403291903.s2TJ3BBh033389@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 29 Mar 2014 19:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263918 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 19:03:11 -0000 Author: marcel Date: Sat Mar 29 19:03:10 2014 New Revision: 263918 URL: http://svnweb.freebsd.org/changeset/base/263918 Log: Add mkimg, a utility for making disk images from raw partition contents. The partitioning scheme can be one of the schemes supported by gpart. Reviewed by: sjg Obtained from: Juniper Networks, Inc. Added: head/usr.bin/mkimg/ - copied from r263917, user/marcel/mkimg/ From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 19:04:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0ECF5AF; Sat, 29 Mar 2014 19:04:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93BEC106; Sat, 29 Mar 2014 19:04:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2TJ4csV033577; Sat, 29 Mar 2014 19:04:38 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2TJ4c82033576; Sat, 29 Mar 2014 19:04:38 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403291904.s2TJ4c82033576@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 29 Mar 2014 19:04:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263919 - head/usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 19:04:38 -0000 Author: marcel Date: Sat Mar 29 19:04:38 2014 New Revision: 263919 URL: http://svnweb.freebsd.org/changeset/base/263919 Log: Hook mkimg(1) to the build. Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Sat Mar 29 19:03:10 2014 (r263918) +++ head/usr.bin/Makefile Sat Mar 29 19:04:38 2014 (r263919) @@ -106,6 +106,7 @@ SUBDIR= alias \ mkdep \ ${_mkesdb} \ mkfifo \ + mkimg \ mklocale \ mktemp \ mkulzma \ From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 19:53:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C243B252; Sat, 29 Mar 2014 19:53:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE6766B8; Sat, 29 Mar 2014 19:53:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2TJr5dv053574; Sat, 29 Mar 2014 19:53:05 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2TJr43L053568; Sat, 29 Mar 2014 19:53:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403291953.s2TJr43L053568@svn.freebsd.org> From: Adrian Chadd Date: Sat, 29 Mar 2014 19:53:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263920 - head/sys/dev/iwi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 19:53:05 -0000 Author: adrian Date: Sat Mar 29 19:53:04 2014 New Revision: 263920 URL: http://svnweb.freebsd.org/changeset/base/263920 Log: Add support to export the contents of the notification updates from the firmware. Right now the NIC isn't actually exporting useful data. I'm not quite sure why this is. :( Added: head/sys/dev/iwi/if_iwi_ioctl.h (contents, props changed) Modified: head/sys/dev/iwi/if_iwi.c head/sys/dev/iwi/if_iwireg.h head/sys/dev/iwi/if_iwivar.h Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Sat Mar 29 19:04:38 2014 (r263919) +++ head/sys/dev/iwi/if_iwi.c Sat Mar 29 19:53:04 2014 (r263920) @@ -84,6 +84,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #define IWI_DEBUG #ifdef IWI_DEBUG @@ -1373,6 +1374,33 @@ iwi_checkforqos(struct ieee80211vap *vap #undef SUBTYPE } +static void +iwi_notif_link_quality(struct iwi_softc *sc, struct iwi_notif *notif) +{ + struct iwi_notif_link_quality *lq; + int len; + + len = le16toh(notif->len); + + DPRINTFN(5, ("Notification (%u) - len=%d, sizeof=%d\n", + notif->type, + len, + sizeof(struct iwi_notif_link_quality) + )); + + /* enforce length */ + if (len != sizeof(struct iwi_notif_link_quality)) { + DPRINTFN(5, ("Notification: (%u) too short (%d)\n", + notif->type, + len)); + return; + } + + lq = (struct iwi_notif_link_quality *)(notif + 1); + memcpy(&sc->sc_linkqual, lq, sizeof(sc->sc_linkqual)); + sc->sc_linkqual_valid = 1; +} + /* * Task queue callbacks for iwi_notification_intr used to avoid LOR's. */ @@ -1542,9 +1570,12 @@ iwi_notification_intr(struct iwi_softc * case IWI_NOTIF_TYPE_CALIBRATION: case IWI_NOTIF_TYPE_NOISE: - case IWI_NOTIF_TYPE_LINK_QUALITY: + /* XXX handle? */ DPRINTFN(5, ("Notification (%u)\n", notif->type)); break; + case IWI_NOTIF_TYPE_LINK_QUALITY: + iwi_notif_link_quality(sc, notif); + break; default: DPRINTF(("unknown notification type %u flags 0x%x len %u\n", @@ -2063,11 +2094,25 @@ iwi_ioctl(struct ifnet *ifp, u_long cmd, case SIOCGIFADDR: error = ether_ioctl(ifp, cmd, data); break; + case SIOCGIWISTATS: + IWI_LOCK(sc); + /* XXX validate permissions/memory/etc? */ + error = copyout(&sc->sc_linkqual, ifr->ifr_data, + sizeof(struct iwi_notif_link_quality)); + IWI_UNLOCK(sc); + break; + case SIOCZIWISTATS: + IWI_LOCK(sc); + memset(&sc->sc_linkqual, 0, + sizeof(struct iwi_notif_link_quality)); + IWI_UNLOCK(sc); + error = 0; + break; default: error = EINVAL; break; } - return error; + return error; } static void Added: head/sys/dev/iwi/if_iwi_ioctl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iwi/if_iwi_ioctl.h Sat Mar 29 19:53:04 2014 (r263920) @@ -0,0 +1,25 @@ +/*- + * Copyright (c) 2014 Adrian Chadd + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ +#ifndef __IF_IWI_IOCTL_H__ +#define __IF_IWI_IOCTL_H__ + +/* XXX how should I pick appropriate ioctl numbers? */ +#define SIOCGIWISTATS _IOWR('i', 147, struct ifreq) +#define SIOCZIWISTATS _IOWR('i', 148, struct ifreq) + +#endif /* __IF_IWI_IOCTL_H__ */ Modified: head/sys/dev/iwi/if_iwireg.h ============================================================================== --- head/sys/dev/iwi/if_iwireg.h Sat Mar 29 19:04:38 2014 (r263919) +++ head/sys/dev/iwi/if_iwireg.h Sat Mar 29 19:53:04 2014 (r263920) @@ -221,6 +221,7 @@ struct iwi_notif_association { /* structure for notification IWI_NOTIF_TYPE_SCAN_CHANNEL */ struct iwi_notif_scan_channel { uint8_t nchan; + /* XXX this is iwi_cmd_stats, and a u8 reserved field */ uint8_t reserved[47]; } __packed; @@ -239,6 +240,68 @@ struct iwi_notif_beacon_state { uint32_t number; } __packed; +/* structure(s) for notification IWI_NOTIF_TYPE_LINK_QUALITY */ + +#define RX_FREE_BUFFERS 32 +#define RX_LOW_WATERMARK 8 + +#define SUP_RATE_11A_MAX_NUM_CHANNELS 8 +#define SUP_RATE_11B_MAX_NUM_CHANNELS 4 +#define SUP_RATE_11G_MAX_NUM_CHANNELS 12 + +// Used for passing to driver number of successes and failures per rate +struct iwi_rate_histogram { + union { + uint32_t a[SUP_RATE_11A_MAX_NUM_CHANNELS]; + uint32_t b[SUP_RATE_11B_MAX_NUM_CHANNELS]; + uint32_t g[SUP_RATE_11G_MAX_NUM_CHANNELS]; + } success; + union { + uint32_t a[SUP_RATE_11A_MAX_NUM_CHANNELS]; + uint32_t b[SUP_RATE_11B_MAX_NUM_CHANNELS]; + uint32_t g[SUP_RATE_11G_MAX_NUM_CHANNELS]; + } failed; +} __packed; + +/* statistics command response */ +struct iwi_cmd_stats { + uint8_t cmd_id; + uint8_t seq_num; + uint16_t good_sfd; + uint16_t bad_plcp; + uint16_t wrong_bssid; + uint16_t valid_mpdu; + uint16_t bad_mac_header; + uint16_t reserved_frame_types; + uint16_t rx_ina; + uint16_t bad_crc32; + uint16_t invalid_cts; + uint16_t invalid_acks; + uint16_t long_distance_ina_fina; + uint16_t dsp_silence_unreachable; + uint16_t accumulated_rssi; + uint16_t rx_ovfl_frame_tossed; + uint16_t rssi_silence_threshold; + uint16_t rx_ovfl_frame_supplied; + uint16_t last_rx_frame_signal; + uint16_t last_rx_frame_noise; + uint16_t rx_autodetec_no_ofdm; + uint16_t rx_autodetec_no_barker; + uint16_t reserved; +} __packed; + +#define SILENCE_OVER_THRESH (1) +#define SILENCE_UNDER_THRESH (2) + +struct iwi_notif_link_quality { + struct iwi_cmd_stats stats; + uint8_t rate; + uint8_t modulation; + struct iwi_rate_histogram histogram; + uint8_t silence_notification_type; /* SILENCE_OVER/UNDER_THRESH */ + uint16_t silence_count; +} __packed; + /* received frame header */ struct iwi_frame { uint32_t reserved1[2]; Modified: head/sys/dev/iwi/if_iwivar.h ============================================================================== --- head/sys/dev/iwi/if_iwivar.h Sat Mar 29 19:04:38 2014 (r263919) +++ head/sys/dev/iwi/if_iwivar.h Sat Mar 29 19:53:04 2014 (r263920) @@ -215,6 +215,9 @@ struct iwi_softc { struct iwi_rx_radiotap_header sc_rxtap; struct iwi_tx_radiotap_header sc_txtap; + + struct iwi_notif_link_quality sc_linkqual; + int sc_linkqual_valid; }; #define IWI_STATE_BEGIN(_sc, _state) do { \ From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 20:21:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 432B683C; Sat, 29 Mar 2014 20:21:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 301A18C0; Sat, 29 Mar 2014 20:21:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2TKLbsG065927; Sat, 29 Mar 2014 20:21:37 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2TKLa0n065925; Sat, 29 Mar 2014 20:21:36 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201403292021.s2TKLa0n065925@svn.freebsd.org> From: Michael Tuexen Date: Sat, 29 Mar 2014 20:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263921 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 20:21:37 -0000 Author: tuexen Date: Sat Mar 29 20:21:36 2014 New Revision: 263921 URL: http://svnweb.freebsd.org/changeset/base/263921 Log: Use SCTP_OVER_UDP_TUNNELING_PORT more consistently. MFC after: 3 days Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_sysctl.h Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Sat Mar 29 19:53:04 2014 (r263920) +++ head/sys/netinet/sctp_constants.h Sat Mar 29 20:21:36 2014 (r263921) @@ -36,16 +36,10 @@ __FBSDID("$FreeBSD$"); #ifndef _NETINET_SCTP_CONSTANTS_H_ #define _NETINET_SCTP_CONSTANTS_H_ + /* IANA assigned port number for SCTP over UDP encapsulation */ -/* For freebsd we cannot bind the port at - * startup. Otherwise what will happen is - * we really won't be bound. The user must - * put it into the sysctl... or we need - * to build a special timer for this to allow - * us to wait 1 second or so after the system - * comes up. - */ -#define SCTP_OVER_UDP_TUNNELING_PORT 0 +#define SCTP_OVER_UDP_TUNNELING_PORT 9899 + /* Number of packets to get before sack sent by default */ #define SCTP_DEFAULT_SACK_FREQ 2 Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Sat Mar 29 19:53:04 2014 (r263920) +++ head/sys/netinet/sctp_sysctl.h Sat Mar 29 20:21:36 2014 (r263921) @@ -466,7 +466,7 @@ struct sctp_sysctl { #define SCTPCTL_UDP_TUNNELING_PORT_DESC "Set the SCTP/UDP tunneling port" #define SCTPCTL_UDP_TUNNELING_PORT_MIN 0 #define SCTPCTL_UDP_TUNNELING_PORT_MAX 65535 -#define SCTPCTL_UDP_TUNNELING_PORT_DEFAULT SCTP_OVER_UDP_TUNNELING_PORT +#define SCTPCTL_UDP_TUNNELING_PORT_DEFAULT 0 /* Enable sending of the SACK-IMMEDIATELY bit */ #define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC "Enable sending of the SACK-IMMEDIATELY-bit." From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 20:38:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D446CBD; Sat, 29 Mar 2014 20:38:55 +0000 (UTC) Received: from smtpauth3.wiscmail.wisc.edu (wmauth3.doit.wisc.edu [144.92.197.226]) (using TLSv1 with cipher DES-CBC3-SHA (168/168 bits)) (Client CN "smtpauth.wiscmail.wisc.edu", Issuer "InCommon Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2F6DA1D; Sat, 29 Mar 2014 20:38:54 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0N3700H00SFHPH00@smtpauth3.wiscmail.wisc.edu>; Sat, 29 Mar 2014 15:38:51 -0500 (CDT) X-Spam-PmxInfo: Server=avs-3, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2014.3.29.203020, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by smtpauth3.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0N3700FURTCQJ700@smtpauth3.wiscmail.wisc.edu>; Sat, 29 Mar 2014 15:38:51 -0500 (CDT) Message-id: <53372F59.7010805@freebsd.org> Date: Sat, 29 Mar 2014 13:38:49 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 To: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r263918 - head/usr.bin/mkimg References: <201403291903.s2TJ3BBh033389@svn.freebsd.org> In-reply-to: <201403291903.s2TJ3BBh033389@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 20:38:55 -0000 On 03/29/14 12:03, Marcel Moolenaar wrote: > Author: marcel > Date: Sat Mar 29 19:03:10 2014 > New Revision: 263918 > URL: http://svnweb.freebsd.org/changeset/base/263918 > > Log: > Add mkimg, a utility for making disk images from raw partition contents. > The partitioning scheme can be one of the schemes supported by gpart. > > Reviewed by: sjg > Obtained from: Juniper Networks, Inc. > > Added: > head/usr.bin/mkimg/ > - copied from r263917, user/marcel/mkimg/ > This is very cool. Thanks! -Nathan From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 21:26:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6F22441; Sat, 29 Mar 2014 21:26:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3BF2D7C; Sat, 29 Mar 2014 21:26:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2TLQj08090485; Sat, 29 Mar 2014 21:26:45 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2TLQjV2090484; Sat, 29 Mar 2014 21:26:45 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201403292126.s2TLQjV2090484@svn.freebsd.org> From: Michael Tuexen Date: Sat, 29 Mar 2014 21:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263922 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 21:26:45 -0000 Author: tuexen Date: Sat Mar 29 21:26:45 2014 New Revision: 263922 URL: http://svnweb.freebsd.org/changeset/base/263922 Log: Handle an edge case of address management similar to TCP. This needs to be reconsidered when the address handling will be reimplemented. The patch is from rrs@. MFC after: 3 days Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sat Mar 29 20:21:36 2014 (r263921) +++ head/sys/netinet/sctp_pcb.c Sat Mar 29 21:26:45 2014 (r263922) @@ -772,7 +772,14 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, } SCTPDBG(SCTP_DEBUG_PCB4, "Deleting ifa %p\n", (void *)sctp_ifap); sctp_ifap->localifa_flags &= SCTP_ADDR_VALID; - sctp_ifap->localifa_flags |= SCTP_BEING_DELETED; + /* + * We don't set the flag. This means that the structure will + * hang around in EP's that have bound specific to it until + * they close. This gives us TCP like behavior if someone + * removes an address (or for that matter adds it right + * back). + */ + /* sctp_ifap->localifa_flags |= SCTP_BEING_DELETED; */ vrf->total_ifa_count--; LIST_REMOVE(sctp_ifap, next_bucket); sctp_remove_ifa_from_ifn(sctp_ifap); From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 22:02:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0ED7887; Sat, 29 Mar 2014 22:02:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDCD38B; Sat, 29 Mar 2014 22:02:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2TM2P1L006264; Sat, 29 Mar 2014 22:02:25 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2TM2PGx006263; Sat, 29 Mar 2014 22:02:25 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403292202.s2TM2PGx006263@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 29 Mar 2014 22:02:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263923 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 22:02:26 -0000 Author: marcel Date: Sat Mar 29 22:02:25 2014 New Revision: 263923 URL: http://svnweb.freebsd.org/changeset/base/263923 Log: Fix build on FreeBSD 9 where has the same defines as and not the unique defines introduced later. Modified: head/usr.bin/mkimg/pc98.c Modified: head/usr.bin/mkimg/pc98.c ============================================================================== --- head/usr.bin/mkimg/pc98.c Sat Mar 29 21:26:45 2014 (r263922) +++ head/usr.bin/mkimg/pc98.c Sat Mar 29 22:02:25 2014 (r263923) @@ -38,6 +38,19 @@ __FBSDID("$FreeBSD$"); #include "mkimg.h" #include "scheme.h" +#ifndef PC98_MAGIC +#define PC98_MAGIC 0xaa55 +#endif +#ifndef PC98_MAGICOFS +#define PC98_MAGICOFS 510 +#endif +#ifndef PC98_NPARTS +#define PC98_NPARTS 16 +#endif +#ifndef PC98_PTYP_386BSD +#define PC98_PTYP_386BSD 0xc494 +#endif + #define PC98_BOOTCODESZ 8192 static struct mkimg_alias pc98_aliases[] = { From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 22:10:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A65FBD9; Sat, 29 Mar 2014 22:10:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DF19ED; Sat, 29 Mar 2014 22:10:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2TMAtYG007833; Sat, 29 Mar 2014 22:10:55 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2TMAtO6007827; Sat, 29 Mar 2014 22:10:55 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403292210.s2TMAtO6007827@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 29 Mar 2014 22:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263924 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 22:10:56 -0000 Author: marcel Date: Sat Mar 29 22:10:54 2014 New Revision: 263924 URL: http://svnweb.freebsd.org/changeset/base/263924 Log: Fix build on FreeBSD 8 where partition types for nandfs do not exist. Modified: head/usr.bin/mkimg/apm.c head/usr.bin/mkimg/bsd.c head/usr.bin/mkimg/gpt.c head/usr.bin/mkimg/vtoc8.c Modified: head/usr.bin/mkimg/apm.c ============================================================================== --- head/usr.bin/mkimg/apm.c Sat Mar 29 22:02:25 2014 (r263923) +++ head/usr.bin/mkimg/apm.c Sat Mar 29 22:10:54 2014 (r263924) @@ -38,6 +38,10 @@ __FBSDID("$FreeBSD$"); #include "mkimg.h" #include "scheme.h" +#ifndef APM_ENT_TYPE_FREEBSD_NANDFS +#define APM_ENT_TYPE_FREEBSD_NANDFS "FreeBSD-nandfs" +#endif + static struct mkimg_alias apm_aliases[] = { { ALIAS_FREEBSD, ALIAS_PTR2TYPE(APM_ENT_TYPE_FREEBSD) }, { ALIAS_FREEBSD_NANDFS, ALIAS_PTR2TYPE(APM_ENT_TYPE_FREEBSD_NANDFS) }, Modified: head/usr.bin/mkimg/bsd.c ============================================================================== --- head/usr.bin/mkimg/bsd.c Sat Mar 29 22:02:25 2014 (r263923) +++ head/usr.bin/mkimg/bsd.c Sat Mar 29 22:10:54 2014 (r263924) @@ -38,6 +38,10 @@ __FBSDID("$FreeBSD$"); #include "mkimg.h" #include "scheme.h" +#ifndef FS_NANDFS +#define FS_NANDFS 30 +#endif + static struct mkimg_alias bsd_aliases[] = { { ALIAS_FREEBSD_NANDFS, ALIAS_INT2TYPE(FS_NANDFS) }, { ALIAS_FREEBSD_SWAP, ALIAS_INT2TYPE(FS_SWAP) }, Modified: head/usr.bin/mkimg/gpt.c ============================================================================== --- head/usr.bin/mkimg/gpt.c Sat Mar 29 22:02:25 2014 (r263923) +++ head/usr.bin/mkimg/gpt.c Sat Mar 29 22:10:54 2014 (r263924) @@ -42,6 +42,11 @@ __FBSDID("$FreeBSD$"); #include "mkimg.h" #include "scheme.h" +#ifndef GPT_ENT_TYPE_FREEBSD_NANDFS +#define GPT_ENT_TYPE_FREEBSD_NANDFS \ + {0x74ba7dd9,0xa689,0x11e1,0xbd,0x04,{0x00,0xe0,0x81,0x28,0x6a,0xcf}} +#endif + static uuid_t gpt_uuid_efi = GPT_ENT_TYPE_EFI; static uuid_t gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; static uuid_t gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; Modified: head/usr.bin/mkimg/vtoc8.c ============================================================================== --- head/usr.bin/mkimg/vtoc8.c Sat Mar 29 22:02:25 2014 (r263923) +++ head/usr.bin/mkimg/vtoc8.c Sat Mar 29 22:10:54 2014 (r263924) @@ -39,6 +39,10 @@ __FBSDID("$FreeBSD$"); #include "mkimg.h" #include "scheme.h" +#ifndef VTOC_TAG_FREEBSD_NANDFS +#define VTOC_TAG_FREEBSD_NANDFS 0x0905 +#endif + static struct mkimg_alias vtoc8_aliases[] = { { ALIAS_FREEBSD_NANDFS, ALIAS_INT2TYPE(VTOC_TAG_FREEBSD_NANDFS) }, { ALIAS_FREEBSD_SWAP, ALIAS_INT2TYPE(VTOC_TAG_FREEBSD_SWAP) }, From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 22:35:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA3A5E0B; Sat, 29 Mar 2014 22:35:57 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 609802BA; Sat, 29 Mar 2014 22:35:57 +0000 (UTC) Received: from rnote.ddteam.net (36-61-133-95.pool.ukrtel.net [95.133.61.36]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPSA id E5FD1C493D; Sun, 30 Mar 2014 00:35:48 +0200 (EET) Date: Sun, 30 Mar 2014 00:35:23 +0200 From: Aleksandr Rybalko To: Nathan Whitehorn Subject: Re: svn commit: r263885 - in head/sys/dev/vt: . hw/vga Message-Id: <20140330003523.791b9ed3.ray@freebsd.org> In-Reply-To: <5336F23B.9080402@freebsd.org> References: <201403282204.s2SM4SeN001155@svn.freebsd.org> <5336F23B.9080402@freebsd.org> Organization: FreeBSD.ORG X-Mailer: Sylpheed 3.1.2 (GTK+ 2.24.5; amd64-portbld-freebsd9.0) X-Operating-System: FreeBSD Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 22:35:57 -0000 On Sat, 29 Mar 2014 09:18:03 -0700 Nathan Whitehorn wrote: > On 03/28/14 15:04, Aleksandr Rybalko wrote: > > Author: ray > > Date: Fri Mar 28 22:04:27 2014 > > New Revision: 263885 > > URL: http://svnweb.freebsd.org/changeset/base/263885 > > > > Log: > > o Add new vd_driver method to do bitblt with mask, named > > vd_maskbitbltchr. o Move vd_bitbltchr vga's driver method to > > vd_maskbitbltchr. o Implement new vd_bitbltchr method for vga > > driver. (It do single write for 8 pixels, have to be a bit faster). > > > > Can you describe what this does? From the commit message, it sounds > like it might repair vt performance on cards with 8-bit framebuffers > generally, but I can't figure out the code. > -Nathan > Hi Nathan! np, it is result of our discussion with jhibbits@. vt(4) have to use bitblt like method which is able to do masked write, since mouse cursor have to left visible characters under itself. But masked bitblt quite expensive due to read from framebuffer to apply mask or due to VGA graphics mode problem (described here [1], lot of small read and writes which can't be well optimized). Characters can be drown with simple (not masked) method, so vd_bitbltchr used most frequently. Mouse cursor only one (at least vt(4) can care about one :) ). And currently mouse support only single consumer for masked method. I did both methods have same set of arguments, to not reimplement vd_bitbltchr method for all drivers. And driver can implement only vd_bitbltchr or both. W/o vd_maskbitbltchr, vd_bitbltchr will be used. Currently only one driver implement both methods, it is vt_vga. Its not masked method do write 8 pixels at once, but masked method continue to use 1 bit at once. Other drivers (f.e. vt_ofwfb) in TODO list. Thanks! [1]http://lists.freebsd.org/pipermail/freebsd-arch/2014-March/015108.html WBW -- Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 23:16:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B85B698; Sat, 29 Mar 2014 23:16:45 +0000 (UTC) Received: from smtpauth2.wiscmail.wisc.edu (wmauth2.doit.wisc.edu [144.92.197.222]) (using TLSv1 with cipher DES-CBC3-SHA (168/168 bits)) (Client CN "smtpauth.wiscmail.wisc.edu", Issuer "InCommon Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAA5B7D2; Sat, 29 Mar 2014 23:16:44 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) id <0N3800L000IOW400@smtpauth2.wiscmail.wisc.edu>; Sat, 29 Mar 2014 18:16:42 -0500 (CDT) X-Spam-PmxInfo: Server=avs-2, Version=6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2014.3.29.230915, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by smtpauth2.wiscmail.wisc.edu (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTPSA id <0N38008TK0NTCF00@smtpauth2.wiscmail.wisc.edu>; Sat, 29 Mar 2014 18:16:42 -0500 (CDT) Message-id: <53375459.6070801@freebsd.org> Date: Sat, 29 Mar 2014 16:16:41 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 To: Aleksandr Rybalko Subject: Re: svn commit: r263885 - in head/sys/dev/vt: . hw/vga References: <201403282204.s2SM4SeN001155@svn.freebsd.org> <5336F23B.9080402@freebsd.org> <20140330003523.791b9ed3.ray@freebsd.org> In-reply-to: <20140330003523.791b9ed3.ray@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 23:16:45 -0000 On 03/29/14 15:35, Aleksandr Rybalko wrote: > On Sat, 29 Mar 2014 09:18:03 -0700 > Nathan Whitehorn wrote: > >> On 03/28/14 15:04, Aleksandr Rybalko wrote: >>> Author: ray >>> Date: Fri Mar 28 22:04:27 2014 >>> New Revision: 263885 >>> URL: http://svnweb.freebsd.org/changeset/base/263885 >>> >>> Log: >>> o Add new vd_driver method to do bitblt with mask, named >>> vd_maskbitbltchr. o Move vd_bitbltchr vga's driver method to >>> vd_maskbitbltchr. o Implement new vd_bitbltchr method for vga >>> driver. (It do single write for 8 pixels, have to be a bit faster). >>> >> Can you describe what this does? From the commit message, it sounds >> like it might repair vt performance on cards with 8-bit framebuffers >> generally, but I can't figure out the code. >> -Nathan >> > Hi Nathan! > > np, it is result of our discussion with jhibbits@. > > vt(4) have to use bitblt like method which is able to do masked write, > since mouse cursor have to left visible characters under itself. > But masked bitblt quite expensive due to read from framebuffer to apply > mask or due to VGA graphics mode problem (described here [1], lot of > small read and writes which can't be well optimized). > > Characters can be drown with simple (not masked) method, so vd_bitbltchr > used most frequently. > Mouse cursor only one (at least vt(4) can care about one :) ). And > currently mouse support only single consumer for masked method. > > I did both methods have same set of arguments, to not reimplement > vd_bitbltchr method for all drivers. And driver can implement only > vd_bitbltchr or both. W/o vd_maskbitbltchr, vd_bitbltchr will be used. > > Currently only one driver implement both methods, it is vt_vga. > Its not masked method do write 8 pixels at once, but masked method > continue to use 1 bit at once. > > Other drivers (f.e. vt_ofwfb) in TODO list. > > Thanks! > > [1]http://lists.freebsd.org/pipermail/freebsd-arch/2014-March/015108.html > > WBW Very nice! I noticed that vt_efifb has precisely the same slow scrolling issue on my Haswell laptop as vt_ofwfb, so I'm quite excited about this. Thanks for all your work on this. -nathan From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 23:25:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10655816; Sat, 29 Mar 2014 23:25:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F141787A; Sat, 29 Mar 2014 23:25:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2TNP9Ol039068; Sat, 29 Mar 2014 23:25:09 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2TNP9it039067; Sat, 29 Mar 2014 23:25:09 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201403292325.s2TNP9it039067@svn.freebsd.org> From: Rui Paulo Date: Sat, 29 Mar 2014 23:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263925 - head/contrib/wpa/src/drivers X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 23:25:10 -0000 Author: rpaulo Date: Sat Mar 29 23:25:09 2014 New Revision: 263925 URL: http://svnweb.freebsd.org/changeset/base/263925 Log: Enable all cryptocaps because net80211 can do software encryption. MFC after: 1 week Modified: head/contrib/wpa/src/drivers/driver_bsd.c Modified: head/contrib/wpa/src/drivers/driver_bsd.c ============================================================================== --- head/contrib/wpa/src/drivers/driver_bsd.c Sat Mar 29 22:10:54 2014 (r263924) +++ head/contrib/wpa/src/drivers/driver_bsd.c Sat Mar 29 23:25:09 2014 (r263925) @@ -1446,6 +1446,17 @@ static int wpa_driver_bsd_capa(struct bs drv->capa.key_mgmt = WPA_DRIVER_CAPA_KEY_MGMT_WPA2 | WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK; +#ifdef __FreeBSD__ + drv->capa.enc |= WPA_DRIVER_CAPA_ENC_WEP40 | + WPA_DRIVER_CAPA_ENC_WEP104 | + WPA_DRIVER_CAPA_ENC_TKIP | + WPA_DRIVER_CAPA_ENC_CCMP; +#else + /* + * XXX + * FreeBSD exports hardware cryptocaps. These have no meaning for wpa + * since net80211 performs software crypto. + */ if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_WEP) drv->capa.enc |= WPA_DRIVER_CAPA_ENC_WEP40 | WPA_DRIVER_CAPA_ENC_WEP104; @@ -1453,6 +1464,7 @@ static int wpa_driver_bsd_capa(struct bs drv->capa.enc |= WPA_DRIVER_CAPA_ENC_TKIP; if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_AES_CCM) drv->capa.enc |= WPA_DRIVER_CAPA_ENC_CCMP; +#endif if (devcaps.dc_drivercaps & IEEE80211_C_HOSTAP) drv->capa.flags |= WPA_DRIVER_FLAGS_AP; From owner-svn-src-head@FreeBSD.ORG Sat Mar 29 23:46:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1951AE13; Sat, 29 Mar 2014 23:46:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE10E9F6; Sat, 29 Mar 2014 23:46:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2TNk1UJ047657; Sat, 29 Mar 2014 23:46:01 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2TNk1fR047652; Sat, 29 Mar 2014 23:46:01 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403292346.s2TNk1fR047652@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 29 Mar 2014 23:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263926 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 23:46:02 -0000 Author: marcel Date: Sat Mar 29 23:46:01 2014 New Revision: 263926 URL: http://svnweb.freebsd.org/changeset/base/263926 Log: Fix build on FreeBSD 7 where: 1. DOSPTYP_FAT32 is not defined in 2. uuid_enc_le() does not exist in libc. Modified: head/usr.bin/mkimg/ebr.c head/usr.bin/mkimg/gpt.c head/usr.bin/mkimg/mbr.c Modified: head/usr.bin/mkimg/ebr.c ============================================================================== --- head/usr.bin/mkimg/ebr.c Sat Mar 29 23:25:09 2014 (r263925) +++ head/usr.bin/mkimg/ebr.c Sat Mar 29 23:46:01 2014 (r263926) @@ -38,6 +38,10 @@ __FBSDID("$FreeBSD$"); #include "mkimg.h" #include "scheme.h" +#ifndef DOSPTYP_FAT32 +#define DOSPTYP_FAT32 0x0b +#endif + static struct mkimg_alias ebr_aliases[] = { { ALIAS_FAT32, ALIAS_INT2TYPE(DOSPTYP_FAT32) }, { ALIAS_FREEBSD, ALIAS_INT2TYPE(DOSPTYP_386BSD) }, Modified: head/usr.bin/mkimg/gpt.c ============================================================================== --- head/usr.bin/mkimg/gpt.c Sat Mar 29 23:25:09 2014 (r263925) +++ head/usr.bin/mkimg/gpt.c Sat Mar 29 23:46:01 2014 (r263926) @@ -128,6 +128,21 @@ crc32(const void *buf, size_t sz) return (crc ^ ~0U); } +static void +gpt_uuid_enc(void *buf, const uuid_t *uuid) +{ + uint8_t *p = buf; + int i; + + le32enc(p, uuid->time_low); + le16enc(p + 4, uuid->time_mid); + le16enc(p + 6, uuid->time_hi_and_version); + p[8] = uuid->clock_seq_hi_and_reserved; + p[9] = uuid->clock_seq_low; + for (i = 0; i < _UUID_NODE_LEN; i++) + p[10 + i] = uuid->node[i]; +} + static u_int gpt_tblsz(void) { @@ -207,9 +222,9 @@ gpt_mktbl(u_int tblsz) STAILQ_FOREACH(part, &partlist, link) { ent = tbl + part->index; - uuid_enc_le(&ent->ent_type, ALIAS_TYPE2PTR(part->type)); + gpt_uuid_enc(&ent->ent_type, ALIAS_TYPE2PTR(part->type)); uuidgen(&uuid, 1); - uuid_enc_le(&ent->ent_uuid, &uuid); + gpt_uuid_enc(&ent->ent_uuid, &uuid); le64enc(&ent->ent_lba_start, part->block); le64enc(&ent->ent_lba_end, part->block + part->size - 1); if (part->label != NULL) { @@ -278,7 +293,7 @@ gpt_write(int fd, lba_t imgsz, void *boo le64enc(&hdr->hdr_lba_start, 2 + tblsz); le64enc(&hdr->hdr_lba_end, imgsz - tblsz - 2); uuidgen(&uuid, 1); - uuid_enc_le(&hdr->hdr_uuid, &uuid); + gpt_uuid_enc(&hdr->hdr_uuid, &uuid); le32enc(&hdr->hdr_entries, nparts); le32enc(&hdr->hdr_entsz, sizeof(struct gpt_ent)); crc = crc32(tbl, nparts * sizeof(struct gpt_ent)); Modified: head/usr.bin/mkimg/mbr.c ============================================================================== --- head/usr.bin/mkimg/mbr.c Sat Mar 29 23:25:09 2014 (r263925) +++ head/usr.bin/mkimg/mbr.c Sat Mar 29 23:46:01 2014 (r263926) @@ -38,6 +38,10 @@ __FBSDID("$FreeBSD$"); #include "mkimg.h" #include "scheme.h" +#ifndef DOSPTYP_FAT32 +#define DOSPTYP_FAT32 0x0b +#endif + static struct mkimg_alias mbr_aliases[] = { { ALIAS_EBR, ALIAS_INT2TYPE(DOSPTYP_EXT) }, { ALIAS_FAT32, ALIAS_INT2TYPE(DOSPTYP_FAT32) }, From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 00:04:46 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E54D310; Sun, 30 Mar 2014 00:04:46 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D9EAB6E; Sun, 30 Mar 2014 00:04:46 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s2U04cDI065583; Sun, 30 Mar 2014 00:04:42 GMT (envelope-from davidxu@freebsd.org) Message-ID: <53375F93.9070502@freebsd.org> Date: Sun, 30 Mar 2014 08:04:35 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Warner Losh Subject: Re: svn commit: r263755 - head/sys/kern References: <201403290752.s2T7qldY012467@gw.catspoiler.org> <5336BD22.1040906@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Cc: Mateusz Guzik , Mateusz Guzik , Don Lewis , svn-src-head@FreeBSD.org, src-committers@FreeBSD.org, kostikbel@gmail.com, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 00:04:46 -0000 On 2014/03/29 23:42, Warner Losh wrote: > On Mar 29, 2014, at 6:31 AM, David Xu wrote: > >> On 2014/03/29 15:52, Don Lewis wrote: >>> On 29 Mar, Mateusz Guzik wrote: >>>> On Sat, Mar 29, 2014 at 11:52:09AM +0800, David Xu wrote: >>>>>> If fsetown handling like this is insecure this would bite us in that >>>>>> scenario (and few others). In short, if we can avoid giving another way >>>>>> to corrupt stuff in the kernel to userspace, we should. >>>>>> >>>>> I can not see what you said, where is the security problem with fsetown ? >>>>> if you have per-jail instance of devsoftc, they all are operating on their >>>>> own instance. but I don't think this patch should address jail now, there >>>>> are many things are not jail ready. >>>>> >>>> I asked if multpiple concurrent calls to fsetown(.., &pointer) could >>>> result in some corruption in the kernel - if they could, we would have a >>>> problem in the future. >>>> >>>> I decided to read the code once more and fsetown seems to be safe in >>>> this regard after all and with that in mind the patch looks good to me. >>> >>> The fsetown() implementation does sufficient locking to prevent the >>> kernel from getting into a bad state. The issue is that the device can >>> only have at most one owner (which may be a process group). If multiple >>> processes are allowed to open the device, or if a process that opened >>> the device shares the descriptor with another process, the last call to >>> fsetown() wins. That means that one process could steal ownership from >>> another if they both have the same device open. >>> >>> The reason that I suggested checking ownership when handling FIOASYNC is >>> that in the case of two processes sharing access to a device, there is >>> currently nothing that prevents a non-owner of the device from enabling >>> this mode and causing SIGIO signals to be sent to the owner, which might >>> not be expecting to receive them. >> I think if you add ownership checking, it will be incompatible with >> other code, people have to change their mind when dealing with >> this special file descriptor, my recommendation is people don't need >> to refresh their brain. >> OTOH, if it is a problem, we should have already been flooded by >> the problem, but in the past years, I saw zero complaining in the mailing >> lists. > I believe that the SIGIO code was cut and pasted from a driver I was working > on in the 4.x time frame. devd is the only consumer, and it doesn’t do the > FIOASYNC stuff at all. > > So I’d be strongly biased to either (a) remove support for this or (b) make > the support correct, even at the cost of speed or performance. > > Warner Even with my patch, I think there is a race condition, suppose owner was set, and now I turn on FIOASYNC, should SIGIO signal be sent now if input or output becomes possible ? if it is true, I found the bug in several piece of kernel code, socket, pipe etcs are all infected. From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 00:25:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2548B709; Sun, 30 Mar 2014 00:25:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1217ECA8; Sun, 30 Mar 2014 00:25:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2U0PVHE064707; Sun, 30 Mar 2014 00:25:31 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2U0PVSL064706; Sun, 30 Mar 2014 00:25:31 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403300025.s2U0PVSL064706@svn.freebsd.org> From: Eitan Adler Date: Sun, 30 Mar 2014 00:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263927 - head/sys/dev/iwi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 00:25:32 -0000 Author: eadler Date: Sun Mar 30 00:25:31 2014 New Revision: 263927 URL: http://svnweb.freebsd.org/changeset/base/263927 Log: Fix sizeof modifier for sizeof() in printf Modified: head/sys/dev/iwi/if_iwi.c Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Sat Mar 29 23:46:01 2014 (r263926) +++ head/sys/dev/iwi/if_iwi.c Sun Mar 30 00:25:31 2014 (r263927) @@ -1382,7 +1382,7 @@ iwi_notif_link_quality(struct iwi_softc len = le16toh(notif->len); - DPRINTFN(5, ("Notification (%u) - len=%d, sizeof=%d\n", + DPRINTFN(5, ("Notification (%u) - len=%d, sizeof=%zu\n", notif->type, len, sizeof(struct iwi_notif_link_quality) From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 04:40:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A3501BF; Sun, 30 Mar 2014 04:40:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 631C5FF5; Sun, 30 Mar 2014 04:40:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2U4eglo070548; Sun, 30 Mar 2014 04:40:42 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2U4eg42070547; Sun, 30 Mar 2014 04:40:42 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403300440.s2U4eg42070547@svn.freebsd.org> From: Eitan Adler Date: Sun, 30 Mar 2014 04:40:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263928 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 04:40:42 -0000 Author: eadler Date: Sun Mar 30 04:40:41 2014 New Revision: 263928 URL: http://svnweb.freebsd.org/changeset/base/263928 Log: Use the correct variable name in the example code. Modified: head/lib/libc/sys/cap_rights_limit.2 Modified: head/lib/libc/sys/cap_rights_limit.2 ============================================================================== --- head/lib/libc/sys/cap_rights_limit.2 Sun Mar 30 00:25:31 2014 (r263927) +++ head/lib/libc/sys/cap_rights_limit.2 Sun Mar 30 04:40:41 2014 (r263928) @@ -86,7 +86,7 @@ manual page. The following example demonstrates how to limit file descriptor capability rights to allow reading only. .Bd -literal -cap_rights_t rights; +cap_rights_t setrights; char buf[1]; int fd; From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 04:55:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30AB239B; Sun, 30 Mar 2014 04:55:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0211519B; Sun, 30 Mar 2014 04:55:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2U4tXSK075977; Sun, 30 Mar 2014 04:55:33 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2U4tXGn075976; Sun, 30 Mar 2014 04:55:33 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403300455.s2U4tXGn075976@svn.freebsd.org> From: Eitan Adler Date: Sun, 30 Mar 2014 04:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263929 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 04:55:34 -0000 Author: eadler Date: Sun Mar 30 04:55:33 2014 New Revision: 263929 URL: http://svnweb.freebsd.org/changeset/base/263929 Log: Teach units(1) that an erg and ergon are the same thing. Modified: head/usr.bin/units/units.lib Modified: head/usr.bin/units/units.lib ============================================================================== --- head/usr.bin/units/units.lib Sun Mar 30 04:40:41 2014 (r263928) +++ head/usr.bin/units/units.lib Sun Mar 30 04:55:33 2014 (r263929) @@ -298,6 +298,7 @@ N newton joule nt-m J joule cal 4.1868 joule +ergon erg / Electrical From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 05:06:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BD955EE; Sun, 30 Mar 2014 05:06:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7933F233; Sun, 30 Mar 2014 05:06:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2U567Z3080196; Sun, 30 Mar 2014 05:06:07 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2U567nH080195; Sun, 30 Mar 2014 05:06:07 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403300506.s2U567nH080195@svn.freebsd.org> From: Eitan Adler Date: Sun, 30 Mar 2014 05:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263930 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 05:06:07 -0000 Author: eadler Date: Sun Mar 30 05:06:06 2014 New Revision: 263930 URL: http://svnweb.freebsd.org/changeset/base/263930 Log: units(1): Add some missing units Modified: head/usr.bin/units/units.lib Modified: head/usr.bin/units/units.lib ============================================================================== --- head/usr.bin/units/units.lib Sun Mar 30 04:55:33 2014 (r263929) +++ head/usr.bin/units/units.lib Sun Mar 30 05:06:06 2014 (r263930) @@ -439,6 +439,7 @@ bakersdozen 13 bar 1e+5 nt/m2 barie 1e-1 nt/m2 barleycorn 1|3 in +beardsecond 5 nm barn 1e-28 m2 oilbarrel 42 gal barrel oilbarrel @@ -527,6 +528,7 @@ hogshead 63 gallon hd hogshead homestead 1|4 mi2 horsepower 735.50 watt +donkeypower 250 watt hp horsepower hubble 1e9 ly hyl gm force sec2/m @@ -595,6 +597,7 @@ poise gm/cm-sec P poise pole rd pond 9.80665e-3 nt +potrzebie 2.263348517438173216473 mm poundal ft-lb/sec2 pdl poundal proof 1|200 From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 07:04:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 86C0FCFC; Sun, 30 Mar 2014 07:04:44 +0000 (UTC) Date: Sun, 30 Mar 2014 07:04:44 +0000 From: Alexey Dokuchaev To: Aleksandr Rybalko Subject: Re: svn commit: r263885 - in head/sys/dev/vt: . hw/vga Message-ID: <20140330070444.GA30090@FreeBSD.org> References: <201403282204.s2SM4SeN001155@svn.freebsd.org> <5336F23B.9080402@freebsd.org> <20140330003523.791b9ed3.ray@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140330003523.791b9ed3.ray@freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Nathan Whitehorn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 07:04:44 -0000 On Sun, Mar 30, 2014 at 12:35:23AM +0200, Aleksandr Rybalko wrote: > vt(4) have to use bitblt like method which is able to do masked write, > since mouse cursor have to left visible characters under itself. > But masked bitblt quite expensive due to read from framebuffer to apply > mask or due to VGA graphics mode problem (described here [1], lot of > small read and writes which can't be well optimized). > > Characters can be drown with simple (not masked) method, so vd_bitbltchr > used most frequently. > Mouse cursor only one (at least vt(4) can care about one :) ). And > currently mouse support only single consumer for masked method. I've always wondered why FreeBSD *ever* had this ugly "look-we-can-make-it- like-in-wind0ze" mouse pointer on the console. I've been always building kernel with SC_ALT_MOUSE_IMAGE; I'm really hoping (if this nonsense has to stay) there will be an option to completely disable it and all related code paths when vt(4) eventually replaces syscons(4). ./danfe From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 14:25:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5906F5A8; Sun, 30 Mar 2014 14:25:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45E6837F; Sun, 30 Mar 2014 14:25:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2UEPFrI010988; Sun, 30 Mar 2014 14:25:15 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2UEPEdW010985; Sun, 30 Mar 2014 14:25:14 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201403301425.s2UEPEdW010985@svn.freebsd.org> From: Ruslan Bukin Date: Sun, 30 Mar 2014 14:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263933 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 14:25:15 -0000 Author: br Date: Sun Mar 30 14:25:14 2014 New Revision: 263933 URL: http://svnweb.freebsd.org/changeset/base/263933 Log: - Merge SoC-common parts - Enable iicbus device Added: head/sys/arm/conf/EXYNOS5250 (contents, props changed) Modified: head/sys/arm/conf/ARNDALE head/sys/arm/conf/CHROMEBOOK Modified: head/sys/arm/conf/ARNDALE ============================================================================== --- head/sys/arm/conf/ARNDALE Sun Mar 30 09:47:49 2014 (r263932) +++ head/sys/arm/conf/ARNDALE Sun Mar 30 14:25:14 2014 (r263933) @@ -17,122 +17,9 @@ # # $FreeBSD$ +include "EXYNOS5250" ident ARNDALE -include "../samsung/exynos/std.exynos5" - -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -makeoptions WERROR="-Werror" - -options HZ=100 -options SCHED_4BSD # 4BSD scheduler -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options KBD_INSTALL_CDEV -options PREEMPTION -options FREEBSD_BOOT_LOADER -options VFP # vfp/neon - -# Debugging -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB -options DDB # Enable the kernel debugger -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - -# NFS support -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCLIENT - -# Uncomment this for NFS root -#options NFS_ROOT # NFS usable as /, requires NFSCL -#options BOOTP_NFSROOT -#options BOOTP_COMPAT -#options BOOTP -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=cpsw0 - -device mmc # mmc/sd bus -device mmcsd # mmc/sd flash cards -device sdhci # generic sdhci - -options ROOTDEVNAME=\"ufs:/dev/da0\" - -#options SMP - -# Pseudo devices - -device loop -device random -device pty -device md -device gpio - -# USB support -options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. -device usb -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE -#device musb -device ehci -#device ohci - -device umass -device scbus # SCSI bus (required for SCSI) -device da # Direct Access (disks) -device pass - -# SATA -#device ata -#device atadisk -#device mvs - -# Serial ports -device uart - -# I2C (TWSI) -#device iic -#device iicbus - -# Ethernet -device ether -device mii -device smsc -device smscphy - -# USB ethernet support, requires miibus -device miibus -device axe # ASIX Electronics USB Ethernet -device bpf # Berkeley packet filter - #FDT options FDT options FDT_DTB_STATIC Modified: head/sys/arm/conf/CHROMEBOOK ============================================================================== --- head/sys/arm/conf/CHROMEBOOK Sun Mar 30 09:47:49 2014 (r263932) +++ head/sys/arm/conf/CHROMEBOOK Sun Mar 30 14:25:14 2014 (r263933) @@ -17,107 +17,9 @@ # # $FreeBSD$ +include "EXYNOS5250" ident CHROMEBOOK -include "../samsung/exynos/std.exynos5" - -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -makeoptions WERROR="-Werror" - -options HZ=100 -options SCHED_4BSD # 4BSD scheduler -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options KBD_INSTALL_CDEV -options PREEMPTION -options FREEBSD_BOOT_LOADER -options VFP # vfp/neon - -# Debugging -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB -options DDB # Enable the kernel debugger -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - -# NFS support -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCLIENT - -# Uncomment this for NFS root -#options NFS_ROOT # NFS usable as /, requires NFSCL -#options BOOTP_NFSROOT -#options BOOTP_COMPAT -#options BOOTP -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=cpsw0 - -device mmc # mmc/sd bus -device mmcsd # mmc/sd flash cards -device sdhci # generic sdhci - -options ROOTDEVNAME=\"ufs:/dev/da0\" - -#options SMP - -# Pseudo devices - -device loop -device random -device pty -device md -device gpio - -# USB support -options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. -device usb -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE -#device musb -device ehci -#device ohci - -device umass -device scbus # SCSI bus (required for SCSI) -device da # Direct Access (disks) -device pass - -# SATA -#device ata -#device atadisk -#device mvs - -# Serial ports -device uart - # Framebuffer device vt device kbdmux @@ -125,21 +27,6 @@ options SC_DFLT_FONT # compile font in makeoptions SC_DFLT_FONT=cp437 device ukbd -# I2C (TWSI) -#device iic -#device iicbus - -# Ethernet -device ether -device mii -device smsc -device smscphy - -# USB ethernet support, requires miibus -device miibus -device axe # ASIX Electronics USB Ethernet -device bpf # Berkeley packet filter - #FDT options FDT options FDT_DTB_STATIC Added: head/sys/arm/conf/EXYNOS5250 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/EXYNOS5250 Sun Mar 30 14:25:14 2014 (r263933) @@ -0,0 +1,132 @@ +# Kernel configuration for Samsung Exynos 5250 boards. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include "../samsung/exynos/std.exynos5" + +makeoptions MODULES_OVERRIDE="" +makeoptions WITHOUT_MODULES="ahc" + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions WERROR="-Werror" + +options HZ=100 +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options TMPFS # Efficient memory filesystem +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV +options PREEMPTION +options FREEBSD_BOOT_LOADER +options VFP # vfp/neon + +# Debugging +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +options BREAK_TO_DEBUGGER +#options VERBOSE_SYSINIT # Enable verbose sysinit messages +options KDB +options DDB # Enable the kernel debugger +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options DIAGNOSTIC + +# NFS support +options NFSCL # Network Filesystem Client +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCLIENT + +# Uncomment this for NFS root +#options NFS_ROOT # NFS usable as /, requires NFSCL +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ue0 + +device mmc # mmc/sd bus +device mmcsd # mmc/sd flash cards +device sdhci # generic sdhci + +options ROOTDEVNAME=\"ufs:/dev/da0\" + +#options SMP + +# Pseudo devices + +device loop +device random +device pty +device md +device gpio + +# USB support +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. +device usb +options USB_DEBUG +#options USB_REQ_DEBUG +#options USB_VERBOSE +#device musb +device ehci +#device ohci + +device umass +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device pass + +# SATA +#device ata +#device atadisk +#device mvs + +# Serial ports +device uart + +# I2C (TWSI) +device iic +device iicbus + +# Ethernet +device ether +device mii +device smsc +device smscphy + +# USB ethernet support, requires miibus +device miibus +device axe # ASIX Electronics USB Ethernet +device bpf # Berkeley packet filter From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 14:42:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2C02AF8; Sun, 30 Mar 2014 14:42:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F1FD6E8; Sun, 30 Mar 2014 14:42:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2UEgr9n018884; Sun, 30 Mar 2014 14:42:53 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2UEgrGK018883; Sun, 30 Mar 2014 14:42:53 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201403301442.s2UEgrGK018883@svn.freebsd.org> From: Ruslan Bukin Date: Sun, 30 Mar 2014 14:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263934 - head/sys/arm/samsung/exynos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 14:42:53 -0000 Author: br Date: Sun Mar 30 14:42:53 2014 New Revision: 263934 URL: http://svnweb.freebsd.org/changeset/base/263934 Log: Directly call kmem_alloc_contig to allocate framebuffer memory and pass VM_MEMATTR_UNCACHEABLE (no-cache, no-buffer). This fixes screen refreshing problem when data is updated too slowly. Discussed with: ian Modified: head/sys/arm/samsung/exynos/exynos5_fimd.c Modified: head/sys/arm/samsung/exynos/exynos5_fimd.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_fimd.c Sun Mar 30 14:25:14 2014 (r263933) +++ head/sys/arm/samsung/exynos/exynos5_fimd.c Sun Mar 30 14:42:53 2014 (r263934) @@ -47,6 +47,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include + #include #include #include @@ -351,8 +355,8 @@ fimd_attach(device_t dev) sc->sc_info.fb_stride = sc->sc_info.fb_width * 2; sc->sc_info.fb_bpp = sc->sc_info.fb_depth = 16; sc->sc_info.fb_size = sc->sc_info.fb_height * sc->sc_info.fb_stride; - sc->sc_info.fb_vbase = (intptr_t)contigmalloc(sc->sc_info.fb_size, - M_DEVBUF, M_ZERO, 0, ~0, PAGE_SIZE, 0); + sc->sc_info.fb_vbase = (intptr_t)kmem_alloc_contig(kernel_arena, + sc->sc_info.fb_size, M_ZERO, 0, ~0, PAGE_SIZE, 0, VM_MEMATTR_UNCACHEABLE); sc->sc_info.fb_pbase = (intptr_t)vtophys(sc->sc_info.fb_vbase); #if 0 From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 14:57:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B5F334E; Sun, 30 Mar 2014 14:57:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B77E84A; Sun, 30 Mar 2014 14:57:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2UEv1KP024037; Sun, 30 Mar 2014 14:57:01 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2UEv0DR024030; Sun, 30 Mar 2014 14:57:00 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201403301457.s2UEv0DR024030@svn.freebsd.org> From: Ruslan Bukin Date: Sun, 30 Mar 2014 14:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263935 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 14:57:01 -0000 Author: br Date: Sun Mar 30 14:57:00 2014 New Revision: 263935 URL: http://svnweb.freebsd.org/changeset/base/263935 Log: Add lowercase postfix, so SoC-common file will be ignored by tinderbox. Added: head/sys/arm/conf/EXYNOS5250.common - copied unchanged from r263933, head/sys/arm/conf/EXYNOS5250 Deleted: head/sys/arm/conf/EXYNOS5250 Modified: head/sys/arm/conf/ARNDALE head/sys/arm/conf/CHROMEBOOK Modified: head/sys/arm/conf/ARNDALE ============================================================================== --- head/sys/arm/conf/ARNDALE Sun Mar 30 14:42:53 2014 (r263934) +++ head/sys/arm/conf/ARNDALE Sun Mar 30 14:57:00 2014 (r263935) @@ -17,7 +17,7 @@ # # $FreeBSD$ -include "EXYNOS5250" +include "EXYNOS5250.common" ident ARNDALE #FDT Modified: head/sys/arm/conf/CHROMEBOOK ============================================================================== --- head/sys/arm/conf/CHROMEBOOK Sun Mar 30 14:42:53 2014 (r263934) +++ head/sys/arm/conf/CHROMEBOOK Sun Mar 30 14:57:00 2014 (r263935) @@ -17,7 +17,7 @@ # # $FreeBSD$ -include "EXYNOS5250" +include "EXYNOS5250.common" ident CHROMEBOOK # Framebuffer Copied: head/sys/arm/conf/EXYNOS5250.common (from r263933, head/sys/arm/conf/EXYNOS5250) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/EXYNOS5250.common Sun Mar 30 14:57:00 2014 (r263935, copy of r263933, head/sys/arm/conf/EXYNOS5250) @@ -0,0 +1,132 @@ +# Kernel configuration for Samsung Exynos 5250 boards. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include "../samsung/exynos/std.exynos5" + +makeoptions MODULES_OVERRIDE="" +makeoptions WITHOUT_MODULES="ahc" + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions WERROR="-Werror" + +options HZ=100 +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options TMPFS # Efficient memory filesystem +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV +options PREEMPTION +options FREEBSD_BOOT_LOADER +options VFP # vfp/neon + +# Debugging +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +options BREAK_TO_DEBUGGER +#options VERBOSE_SYSINIT # Enable verbose sysinit messages +options KDB +options DDB # Enable the kernel debugger +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options DIAGNOSTIC + +# NFS support +options NFSCL # Network Filesystem Client +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCLIENT + +# Uncomment this for NFS root +#options NFS_ROOT # NFS usable as /, requires NFSCL +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ue0 + +device mmc # mmc/sd bus +device mmcsd # mmc/sd flash cards +device sdhci # generic sdhci + +options ROOTDEVNAME=\"ufs:/dev/da0\" + +#options SMP + +# Pseudo devices + +device loop +device random +device pty +device md +device gpio + +# USB support +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. +device usb +options USB_DEBUG +#options USB_REQ_DEBUG +#options USB_VERBOSE +#device musb +device ehci +#device ohci + +device umass +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device pass + +# SATA +#device ata +#device atadisk +#device mvs + +# Serial ports +device uart + +# I2C (TWSI) +device iic +device iicbus + +# Ethernet +device ether +device mii +device smsc +device smscphy + +# USB ethernet support, requires miibus +device miibus +device axe # ASIX Electronics USB Ethernet +device bpf # Berkeley packet filter From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 15:22:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28730A03; Sun, 30 Mar 2014 15:22:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08DCDA72; Sun, 30 Mar 2014 15:22:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2UFMb2E036005; Sun, 30 Mar 2014 15:22:37 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2UFMbPa035998; Sun, 30 Mar 2014 15:22:37 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201403301522.s2UFMbPa035998@svn.freebsd.org> From: Ruslan Bukin Date: Sun, 30 Mar 2014 15:22:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263936 - in head/sys: arm/conf arm/samsung/exynos boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 15:22:38 -0000 Author: br Date: Sun Mar 30 15:22:36 2014 New Revision: 263936 URL: http://svnweb.freebsd.org/changeset/base/263936 Log: Add support for keyboard used in Samsung Chromebook (ARM machine) Support covers device drivers for: - Interrupt Combiner - gpio/pad, External Interrupts Controller (pad) - I2C Interface - Chrome Embedded Controller - Chrome Keyboard Also: - Use new gpio dev class in EHCI driver - Expand device tree information Added: head/sys/arm/conf/CHROMEBOOK.hints (contents, props changed) head/sys/arm/samsung/exynos/chrome_ec.c (contents, props changed) head/sys/arm/samsung/exynos/chrome_ec.h (contents, props changed) head/sys/arm/samsung/exynos/chrome_kb.c (contents, props changed) head/sys/arm/samsung/exynos/chrome_kb.h (contents, props changed) head/sys/arm/samsung/exynos/exynos5_combiner.c (contents, props changed) head/sys/arm/samsung/exynos/exynos5_combiner.h (contents, props changed) head/sys/arm/samsung/exynos/exynos5_i2c.c (contents, props changed) head/sys/arm/samsung/exynos/exynos5_pad.c (contents, props changed) head/sys/arm/samsung/exynos/exynos5_pad.h (contents, props changed) Modified: head/sys/arm/conf/CHROMEBOOK head/sys/arm/samsung/exynos/exynos5_ehci.c head/sys/arm/samsung/exynos/files.exynos5 head/sys/boot/fdt/dts/arm/exynos5250-arndale.dts head/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts head/sys/boot/fdt/dts/arm/exynos5250.dtsi Modified: head/sys/arm/conf/CHROMEBOOK ============================================================================== --- head/sys/arm/conf/CHROMEBOOK Sun Mar 30 14:57:00 2014 (r263935) +++ head/sys/arm/conf/CHROMEBOOK Sun Mar 30 15:22:36 2014 (r263936) @@ -20,6 +20,11 @@ include "EXYNOS5250.common" ident CHROMEBOOK +hints "CHROMEBOOK.hints" + +device chrome_ec # Chrome Embedded Controller +device chrome_kb # Chrome Keyboard + # Framebuffer device vt device kbdmux Added: head/sys/arm/conf/CHROMEBOOK.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/CHROMEBOOK.hints Sun Mar 30 15:22:36 2014 (r263936) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +# Chrome Embedded Controller +hint.chrome_ec.0.at="iicbus0" +hint.chrome_ec.0.addr=0x1e Added: head/sys/arm/samsung/exynos/chrome_ec.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/samsung/exynos/chrome_ec.c Sun Mar 30 15:22:36 2014 (r263936) @@ -0,0 +1,253 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPREC OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNEC FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINEC INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Samsung Chromebook Embedded Controller + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "iicbus_if.h" +#include "gpio_if.h" + +#include + +/* TODO: export to DTS */ +#define OUR_GPIO 177 +#define EC_GPIO 168 + +struct ec_softc { + device_t dev; +}; + +struct ec_softc *ec_sc; + +/* + * bus_claim, bus_release + * both functions used for bus arbitration + * in multi-master mode + */ + +static int +bus_claim(struct ec_softc *sc) +{ + device_t gpio_dev; + int status; + + gpio_dev = devclass_get_device(devclass_find("gpio"), 0); + if (gpio_dev == NULL) { + device_printf(sc->dev, "cant find gpio_dev\n"); + return (1); + } + + /* Say we want the bus */ + GPIO_PIN_SET(gpio_dev, OUR_GPIO, GPIO_PIN_LOW); + + /* Check EC decision */ + GPIO_PIN_GET(gpio_dev, EC_GPIO, &status); + + if (status == 1) { + /* Okay. We have bus */ + return (0); + } + + /* EC is master */ + return (-1); +} + +static int +bus_release(struct ec_softc *sc) +{ + device_t gpio_dev; + + gpio_dev = devclass_get_device(devclass_find("gpio"), 0); + if (gpio_dev == NULL) { + device_printf(sc->dev, "cant find gpio_dev\n"); + return (1); + } + + GPIO_PIN_SET(gpio_dev, OUR_GPIO, GPIO_PIN_HIGH); + + return (0); +} + +static int +ec_probe(device_t dev) +{ + + device_set_desc(dev, "Chromebook Embedded Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +fill_checksum(uint8_t *data_out, int len) +{ + int res; + int i; + + res = 0; + for (i = 0; i < len; i++) { + res += data_out[i]; + } + + data_out[len] = (res & 0xff); + + return (0); +} + +int +ec_command(uint8_t cmd, uint8_t *dout, uint8_t dout_len, + uint8_t *dinp, uint8_t dinp_len) +{ + struct ec_softc *sc; + uint8_t *msg_dout; + uint8_t *msg_dinp; + int ret; + int i; + + msg_dout = malloc(dout_len + 4, M_DEVBUF, M_NOWAIT); + msg_dinp = malloc(dinp_len + 4, M_DEVBUF, M_NOWAIT); + + if (ec_sc == NULL) + return (-1); + + sc = ec_sc; + + msg_dout[0] = EC_CMD_VERSION0; + msg_dout[1] = cmd; + msg_dout[2] = dout_len; + + for (i = 0; i < dout_len; i++) { + msg_dout[i + 3] = dout[i]; + }; + + fill_checksum(msg_dout, dout_len + 3); + + struct iic_msg msgs[] = { + { 0x1e, IIC_M_WR, dout_len + 4, msg_dout, }, + { 0x1e, IIC_M_RD, dinp_len + 4, msg_dinp, }, + }; + + ret = iicbus_transfer(sc->dev, msgs, 2); + if (ret != 0) { + device_printf(sc->dev, "i2c transfer returned %d\n", ret); + free(msg_dout, M_DEVBUF); + free(msg_dinp, M_DEVBUF); + return (-1); + } + + for (i = 0; i < dinp_len; i++) { + dinp[i] = msg_dinp[i + 3]; + }; + + free(msg_dout, M_DEVBUF); + free(msg_dinp, M_DEVBUF); + return (0); +} + +int ec_hello(void) +{ + uint8_t data_in[4]; + uint8_t data_out[4]; + + data_in[0] = 0x40; + data_in[1] = 0x30; + data_in[2] = 0x20; + data_in[3] = 0x10; + + ec_command(EC_CMD_MKBP_STATE, data_in, 4, + data_out, 4); + + return (0); +} + +static int +ec_attach(device_t dev) +{ + struct ec_softc *sc; + + sc = device_get_softc(dev); + sc->dev = dev; + + ec_sc = sc; + + /* + * Claim the bus. + * + * We don't know cases when EC is master, + * so hold the bus forever for us. + * + */ + + if (bus_claim(sc) != 0) { + return (ENXIO); + } + + return (0); +} + +static device_method_t ec_methods[] = { + DEVMETHOD(device_probe, ec_probe), + DEVMETHOD(device_attach, ec_attach), + { 0, 0 } +}; + +static driver_t ec_driver = { + "chrome_ec", + ec_methods, + sizeof(struct ec_softc), +}; + +static devclass_t ec_devclass; + +DRIVER_MODULE(chrome_ec, iicbus, ec_driver, ec_devclass, 0, 0); +MODULE_VERSION(chrome_ec, 1); +MODULE_DEPEND(chrome_ec, iicbus, 1, 1, 1); Added: head/sys/arm/samsung/exynos/chrome_ec.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/samsung/exynos/chrome_ec.h Sun Mar 30 15:22:36 2014 (r263936) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define EC_CMD_HELLO 0x01 +#define EC_CMD_GET_VERSION 0x02 +#define EC_CMD_MKBP_STATE 0x60 +#define EC_CMD_VERSION0 0xdc + +int ec_command(uint8_t cmd, uint8_t *dout, uint8_t dout_len, + uint8_t *dinp, uint8_t dinp_len); +int ec_hello(void); Added: head/sys/arm/samsung/exynos/chrome_kb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/samsung/exynos/chrome_kb.c Sun Mar 30 15:22:36 2014 (r263936) @@ -0,0 +1,792 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Samsung Chromebook Keyboard + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "gpio_if.h" + +#include +#include + +#include +#include + +#define CKB_LOCK() mtx_lock(&Giant) +#define CKB_UNLOCK() mtx_unlock(&Giant) + +#ifdef INVARIANTS +/* + * Assert that the lock is held in all contexts + * where the code can be executed. + */ +#define CKB_LOCK_ASSERT() mtx_assert(&Giant, MA_OWNED) +/* + * Assert that the lock is held in the contexts + * where it really has to be so. + */ +#define CKB_CTX_LOCK_ASSERT() \ + do { \ + if (!kdb_active && panicstr == NULL) \ + mtx_assert(&Giant, MA_OWNED); \ + } while (0) +#else +#define CKB_LOCK_ASSERT() (void)0 +#define CKB_CTX_LOCK_ASSERT() (void)0 +#endif + +/* + * Define a stub keyboard driver in case one hasn't been + * compiled into the kernel + */ +#include +#include +#include + +#define CKB_NFKEY 12 +#define CKB_FLAG_COMPOSE 0x1 +#define CKB_FLAG_POLLING 0x2 +#define KBD_DRIVER_NAME "ckbd" + +/* TODO: take interrupt from DTS */ +#define KB_GPIO_INT 146 + +struct ckb_softc { + keyboard_t sc_kbd; + keymap_t sc_keymap; + accentmap_t sc_accmap; + fkeytab_t sc_fkeymap[CKB_NFKEY]; + + struct resource* sc_mem_res; + struct resource* sc_irq_res; + void* sc_intr_hl; + + int sc_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */ + int sc_state; /* shift/lock key state */ + int sc_accents; /* accent key index (> 0) */ + int sc_flags; /* flags */ + + struct callout sc_repeat_callout; + int sc_repeat_key; + int sc_repeating; + + int flag; + int rows; + int cols; + device_t dev; + struct thread *sc_poll_thread; + + uint8_t *scan_local; + uint8_t *scan; +}; + +/* prototypes */ +static void ckb_set_leds(struct ckb_softc *, uint8_t); +static int ckb_set_typematic(keyboard_t *, int); +static uint32_t ckb_read_char(keyboard_t *, int); +static void ckb_clear_state(keyboard_t *); +static int ckb_ioctl(keyboard_t *, u_long, caddr_t); +static int ckb_enable(keyboard_t *); +static int ckb_disable(keyboard_t *); + +static void +ckb_repeat(void *arg) +{ + struct ckb_softc *sc; + + sc = arg; + + if (KBD_IS_ACTIVE(&sc->sc_kbd) && KBD_IS_BUSY(&sc->sc_kbd)) { + if (sc->sc_repeat_key != -1) { + sc->sc_repeating = 1; + sc->sc_kbd.kb_callback.kc_func(&sc->sc_kbd, + KBDIO_KEYINPUT, sc->sc_kbd.kb_callback.kc_arg); + } + } +} + +/* detect a keyboard, not used */ +static int +ckb__probe(int unit, void *arg, int flags) +{ + + return (ENXIO); +} + +/* reset and initialize the device, not used */ +static int +ckb_init(int unit, keyboard_t **kbdp, void *arg, int flags) +{ + + return (ENXIO); +} + +/* test the interface to the device, not used */ +static int +ckb_test_if(keyboard_t *kbd) +{ + + return (0); +} + +/* finish using this keyboard, not used */ +static int +ckb_term(keyboard_t *kbd) +{ + + return (ENXIO); +} + +/* keyboard interrupt routine, not used */ +static int +ckb_intr(keyboard_t *kbd, void *arg) +{ + + return (0); +} + +/* lock the access to the keyboard, not used */ +static int +ckb_lock(keyboard_t *kbd, int lock) +{ + + return (1); +} + +/* clear the internal state of the keyboard */ +static void +ckb_clear_state(keyboard_t *kbd) +{ + struct ckb_softc *sc; + + sc = kbd->kb_data; + + CKB_CTX_LOCK_ASSERT(); + + sc->sc_flags &= ~(CKB_FLAG_COMPOSE | CKB_FLAG_POLLING); + sc->sc_state &= LOCK_MASK; /* preserve locking key state */ + sc->sc_accents = 0; +} + +/* save the internal state, not used */ +static int +ckb_get_state(keyboard_t *kbd, void *buf, size_t len) +{ + + return (len == 0) ? 1 : -1; +} + +/* set the internal state, not used */ +static int +ckb_set_state(keyboard_t *kbd, void *buf, size_t len) +{ + + return (EINVAL); +} + + +/* check if data is waiting */ +static int +ckb_check(keyboard_t *kbd) +{ + struct ckb_softc *sc; + int i; + + sc = kbd->kb_data; + + CKB_CTX_LOCK_ASSERT(); + + if (!KBD_IS_ACTIVE(kbd)) + return (0); + + if (sc->sc_flags & CKB_FLAG_POLLING) { + return (1); + }; + + for (i = 0; i < sc->cols; i++) + if (sc->scan_local[i] != sc->scan[i]) { + return (1); + }; + + if (sc->sc_repeating) + return (1); + + return (0); +} + +/* check if char is waiting */ +static int +ckb_check_char_locked(keyboard_t *kbd) +{ + CKB_CTX_LOCK_ASSERT(); + + if (!KBD_IS_ACTIVE(kbd)) + return (0); + + return (ckb_check(kbd)); +} + +static int +ckb_check_char(keyboard_t *kbd) +{ + int result; + + CKB_LOCK(); + result = ckb_check_char_locked(kbd); + CKB_UNLOCK(); + + return (result); +} + +/* read one byte from the keyboard if it's allowed */ +/* Currently unused. */ +static int +ckb_read(keyboard_t *kbd, int wait) +{ + CKB_CTX_LOCK_ASSERT(); + + if (!KBD_IS_ACTIVE(kbd)) + return (-1); + + printf("Implement ME: %s\n", __func__); + return (0); +} + +int scantokey(int i, int j); + +int +scantokey(int i, int j) +{ + int k; + + for (k = 0; k < KEYMAP_LEN; k++) + if ((keymap[k].col == i) && (keymap[k].row == j)) + return (keymap[k].key); + + return (0); +} + +/* read char from the keyboard */ +static uint32_t +ckb_read_char_locked(keyboard_t *kbd, int wait) +{ + struct ckb_softc *sc; + int i,j; + uint16_t key; + int oldbit; + int newbit; + + sc = kbd->kb_data; + + CKB_CTX_LOCK_ASSERT(); + + if (!KBD_IS_ACTIVE(kbd)) + return (NOKEY); + + if (sc->sc_repeating) { + sc->sc_repeating = 0; + callout_reset(&sc->sc_repeat_callout, hz / 10, + ckb_repeat, sc); + return (sc->sc_repeat_key); + }; + + if (sc->sc_flags & CKB_FLAG_POLLING) { + /* TODO */ + }; + + for (i = 0; i < sc->cols; i++) { + for (j = 0; j < sc->rows; j++) { + oldbit = (sc->scan_local[i] & (1 << j)); + newbit = (sc->scan[i] & (1 << j)); + + if (oldbit == newbit) + continue; + + key = scantokey(i,j); + if (key == 0) { + continue; + }; + + if (newbit > 0) { + /* key pressed */ + sc->scan_local[i] |= (1 << j); + + /* setup repeating */ + sc->sc_repeat_key = key; + callout_reset(&sc->sc_repeat_callout, + hz / 2, ckb_repeat, sc); + + } else { + /* key released */ + sc->scan_local[i] &= ~(1 << j); + + /* release flag */ + key |= 0x80; + + /* unsetup repeating */ + sc->sc_repeat_key = -1; + callout_stop(&sc->sc_repeat_callout); + } + + return (key); + } + } + + return (NOKEY); +} + +/* Currently wait is always false. */ +static uint32_t +ckb_read_char(keyboard_t *kbd, int wait) +{ + uint32_t keycode; + + CKB_LOCK(); + keycode = ckb_read_char_locked(kbd, wait); + CKB_UNLOCK(); + + return (keycode); +} + + +/* some useful control functions */ +static int +ckb_ioctl_locked(keyboard_t *kbd, u_long cmd, caddr_t arg) +{ + struct ckb_softc *sc; + int i; + + sc = kbd->kb_data; + + CKB_LOCK_ASSERT(); + + switch (cmd) { + case KDGKBMODE: /* get keyboard mode */ + *(int *)arg = sc->sc_mode; + break; + + case KDSKBMODE: /* set keyboard mode */ + switch (*(int *)arg) { + case K_XLATE: + if (sc->sc_mode != K_XLATE) { + /* make lock key state and LED state match */ + sc->sc_state &= ~LOCK_MASK; + sc->sc_state |= KBD_LED_VAL(kbd); + } + /* FALLTHROUGH */ + case K_RAW: + case K_CODE: + if (sc->sc_mode != *(int *)arg) { + if ((sc->sc_flags & CKB_FLAG_POLLING) == 0) + ckb_clear_state(kbd); + sc->sc_mode = *(int *)arg; + } + break; + default: + return (EINVAL); + } + break; + + case KDGETLED: /* get keyboard LED */ + *(int *)arg = KBD_LED_VAL(kbd); + break; + + case KDSETLED: /* set keyboard LED */ + /* NOTE: lock key state in "sc_state" won't be changed */ + if (*(int *)arg & ~LOCK_MASK) + return (EINVAL); + + i = *(int *)arg; + + /* replace CAPS LED with ALTGR LED for ALTGR keyboards */ + if (sc->sc_mode == K_XLATE && + kbd->kb_keymap->n_keys > ALTGR_OFFSET) { + if (i & ALKED) + i |= CLKED; + else + i &= ~CLKED; + } + if (KBD_HAS_DEVICE(kbd)) { + /* Configure LED */ + } + + KBD_LED_VAL(kbd) = *(int *)arg; + break; + case KDGKBSTATE: /* get lock key state */ + *(int *)arg = sc->sc_state & LOCK_MASK; + break; + + case KDSKBSTATE: /* set lock key state */ + if (*(int *)arg & ~LOCK_MASK) { + return (EINVAL); + } + sc->sc_state &= ~LOCK_MASK; + sc->sc_state |= *(int *)arg; + + /* set LEDs and quit */ + return (ckb_ioctl(kbd, KDSETLED, arg)); + + case KDSETREPEAT: /* set keyboard repeat rate (new + * interface) */ + + if (!KBD_HAS_DEVICE(kbd)) { + return (0); + } + if (((int *)arg)[1] < 0) { + return (EINVAL); + } + if (((int *)arg)[0] < 0) { + return (EINVAL); + } + if (((int *)arg)[0] < 200) /* fastest possible value */ + kbd->kb_delay1 = 200; + else + kbd->kb_delay1 = ((int *)arg)[0]; + kbd->kb_delay2 = ((int *)arg)[1]; + return (0); + + case KDSETRAD: /* set keyboard repeat rate (old + * interface) */ + return (ckb_set_typematic(kbd, *(int *)arg)); + + case PIO_KEYMAP: /* set keyboard translation table */ + case OPIO_KEYMAP: /* set keyboard translation table + * (compat) */ + case PIO_KEYMAPENT: /* set keyboard translation table + * entry */ + case PIO_DEADKEYMAP: /* set accent key translation table */ + sc->sc_accents = 0; + /* FALLTHROUGH */ + default: + return (genkbd_commonioctl(kbd, cmd, arg)); + } + + return (0); +} + +static int +ckb_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) +{ + int result; + + /* + * XXX KDGKBSTATE, KDSKBSTATE and KDSETLED can be called from any + * context where printf(9) can be called, which among other things + * includes interrupt filters and threads with any kinds of locks + * already held. For this reason it would be dangerous to acquire + * the Giant here unconditionally. On the other hand we have to + * have it to handle the ioctl. + * So we make our best effort to auto-detect whether we can grab + * the Giant or not. Blame syscons(4) for this. + */ + switch (cmd) { + case KDGKBSTATE: + case KDSKBSTATE: + case KDSETLED: + if (!mtx_owned(&Giant) && !SCHEDULER_STOPPED()) + return (EDEADLK); /* best I could come up with */ + /* FALLTHROUGH */ + default: + CKB_LOCK(); + result = ckb_ioctl_locked(kbd, cmd, arg); + CKB_UNLOCK(); + return (result); + } +} + + +/* + * Enable the access to the device; until this function is called, + * the client cannot read from the keyboard. + */ +static int +ckb_enable(keyboard_t *kbd) +{ + + CKB_LOCK(); + KBD_ACTIVATE(kbd); + CKB_UNLOCK(); + + return (0); +} + +/* disallow the access to the device */ +static int +ckb_disable(keyboard_t *kbd) +{ + + CKB_LOCK(); + KBD_DEACTIVATE(kbd); + CKB_UNLOCK(); + + return (0); +} + +/* local functions */ + +static int +ckb_set_typematic(keyboard_t *kbd, int code) +{ + static const int delays[] = {250, 500, 750, 1000}; + static const int rates[] = {34, 38, 42, 46, 50, 55, 59, 63, + 68, 76, 84, 92, 100, 110, 118, 126, + 136, 152, 168, 184, 200, 220, 236, 252, + 272, 304, 336, 368, 400, 440, 472, 504}; + + if (code & ~0x7f) { + return (EINVAL); + } + kbd->kb_delay1 = delays[(code >> 5) & 3]; + kbd->kb_delay2 = rates[code & 0x1f]; + return (0); +} + +static int +ckb_poll(keyboard_t *kbd, int on) +{ + struct ckb_softc *sc; + + sc = kbd->kb_data; + + CKB_LOCK(); + if (on) { + sc->sc_flags |= CKB_FLAG_POLLING; + sc->sc_poll_thread = curthread; + } else { + sc->sc_flags &= ~CKB_FLAG_POLLING; + } + CKB_UNLOCK(); + + return (0); +} + +/* local functions */ + +static int dummy_kbd_configure(int flags); + +keyboard_switch_t ckbdsw = { + .probe = &ckb__probe, + .init = &ckb_init, + .term = &ckb_term, + .intr = &ckb_intr, + .test_if = &ckb_test_if, + .enable = &ckb_enable, + .disable = &ckb_disable, + .read = &ckb_read, + .check = &ckb_check, + .read_char = &ckb_read_char, + .check_char = &ckb_check_char, + .ioctl = &ckb_ioctl, + .lock = &ckb_lock, + .clear_state = &ckb_clear_state, + .get_state = &ckb_get_state, + .set_state = &ckb_set_state, + .get_fkeystr = &genkbd_get_fkeystr, + .poll = &ckb_poll, + .diag = &genkbd_diag, +}; + +static int +dummy_kbd_configure(int flags) +{ + + return (0); +} + +KEYBOARD_DRIVER(ckbd, ckbdsw, dummy_kbd_configure); + +static int +parse_dts(struct ckb_softc *sc) +{ + phandle_t node; + pcell_t dts_value; + int len; + + if ((node = ofw_bus_get_node(sc->dev)) == -1) + return (ENXIO); + + if ((len = OF_getproplen(node, "keypad,num-rows")) <= 0) + return (ENXIO); + OF_getprop(node, "keypad,num-rows", &dts_value, len); + sc->rows = fdt32_to_cpu(dts_value); + + if ((len = OF_getproplen(node, "keypad,num-columns")) <= 0) + return (ENXIO); + OF_getprop(node, "keypad,num-columns", &dts_value, len); + sc->cols = fdt32_to_cpu(dts_value); + + if ((sc->rows == 0) || (sc->cols == 0)) + return (ENXIO); + + return (0); +} + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 15:24:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3FA5B50; Sun, 30 Mar 2014 15:24:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0BF0A7D; Sun, 30 Mar 2014 15:24:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2UFOH5Z036216; Sun, 30 Mar 2014 15:24:17 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2UFOHQZ036215; Sun, 30 Mar 2014 15:24:17 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201403301524.s2UFOHQZ036215@svn.freebsd.org> From: Bryan Drewery Date: Sun, 30 Mar 2014 15:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263937 - head/etc/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 15:24:17 -0000 Author: bdrewery Date: Sun Mar 30 15:24:17 2014 New Revision: 263937 URL: http://svnweb.freebsd.org/changeset/base/263937 Log: Give hint on how to disable the default repository. Discussed with: bapt MFC after: instantly (preparing EN) Modified: head/etc/pkg/FreeBSD.conf Modified: head/etc/pkg/FreeBSD.conf ============================================================================== --- head/etc/pkg/FreeBSD.conf Sun Mar 30 15:22:36 2014 (r263936) +++ head/etc/pkg/FreeBSD.conf Sun Mar 30 15:24:17 2014 (r263937) @@ -1,4 +1,12 @@ # $FreeBSD$ +# +# To disable this repository, instead of modifying or removing this file, +# create a /usr/local/etc/pkg/repos/FreeBSD.conf file: +# +# mkdir -p /usr/local/etc/pkg/repos +# echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf +# + FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", mirror_type: "srv", From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 16:04:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A8CD9F1; Sun, 30 Mar 2014 16:04:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 404A3D5D; Sun, 30 Mar 2014 16:04:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2UG4mQl053408; Sun, 30 Mar 2014 16:04:48 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2UG4mjn053407; Sun, 30 Mar 2014 16:04:48 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201403301604.s2UG4mjn053407@svn.freebsd.org> From: Eitan Adler Date: Sun, 30 Mar 2014 16:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263940 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 16:04:48 -0000 Author: eadler Date: Sun Mar 30 16:04:47 2014 New Revision: 263940 URL: http://svnweb.freebsd.org/changeset/base/263940 Log: add capsicum to units(1) Modified: head/usr.bin/units/units.c Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Sun Mar 30 15:30:33 2014 (r263939) +++ head/usr.bin/units/units.c Sun Mar 30 16:04:47 2014 (r263940) @@ -22,11 +22,14 @@ static const char rcsid[] = #include #include +#include #include #include #include #include +#include + #include "pathnames.h" #define VERSION "1.0" @@ -112,6 +115,7 @@ readunits(const char *userfile) FILE *unitfile; char line[512], *lineptr; int len, linenum, i; + cap_rights_t unitfilerights; unitcount = 0; linenum = 0; @@ -143,6 +147,12 @@ readunits(const char *userfile) errx(1, "can't find units file '%s'", UNITSFILE); } } + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "unable to enter capability mode"); + cap_rights_init(&unitfilerights, CAP_READ, CAP_FSTAT); + if (cap_rights_limit(fileno(unitfile), &unitfilerights) < 0 + && errno != ENOSYS) + err(1, "cap_rights_limit() failed"); while (!feof(unitfile)) { if (!fgets(line, sizeof(line), unitfile)) break; From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 20:38:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57A418A2; Sun, 30 Mar 2014 20:38:53 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 0ED568F0; Sun, 30 Mar 2014 20:38:52 +0000 (UTC) Received: from rnote.ddteam.net (126-57-133-95.pool.ukrtel.net [95.133.57.126]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPSA id E0758C4983; Sun, 30 Mar 2014 23:38:50 +0300 (EEST) Date: Sun, 30 Mar 2014 23:38:24 +0300 From: Aleksandr Rybalko To: Alexey Dokuchaev Subject: Re: svn commit: r263885 - in head/sys/dev/vt: . hw/vga Message-Id: <20140330233824.12632c5f.ray@freebsd.org> In-Reply-To: <20140330070444.GA30090@FreeBSD.org> References: <201403282204.s2SM4SeN001155@svn.freebsd.org> <5336F23B.9080402@freebsd.org> <20140330003523.791b9ed3.ray@freebsd.org> <20140330070444.GA30090@FreeBSD.org> Organization: FreeBSD.ORG X-Mailer: Sylpheed 3.1.2 (GTK+ 2.24.5; amd64-portbld-freebsd9.0) X-Operating-System: FreeBSD Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Nathan Whitehorn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 20:38:53 -0000 On Sun, 30 Mar 2014 07:04:44 +0000 Alexey Dokuchaev wrote: > On Sun, Mar 30, 2014 at 12:35:23AM +0200, Aleksandr Rybalko wrote: > > vt(4) have to use bitblt like method which is able to do masked > > write, since mouse cursor have to left visible characters under > > itself. But masked bitblt quite expensive due to read from > > framebuffer to apply mask or due to VGA graphics mode problem > > (described here [1], lot of small read and writes which can't be > > well optimized). > > > > Characters can be drown with simple (not masked) method, so > > vd_bitbltchr used most frequently. > > Mouse cursor only one (at least vt(4) can care about one :) ). And > > currently mouse support only single consumer for masked method. > > I've always wondered why FreeBSD *ever* had this ugly > "look-we-can-make-it- like-in-wind0ze" mouse pointer on the console. > I've been always building kernel with SC_ALT_MOUSE_IMAGE; I'm really > hoping (if this nonsense has to stay) there will be an option to > completely disable it and all related code paths when vt(4) > eventually replaces syscons(4). > > ./danfe its name SC_NO_CUTPASTE for both syscons(4) and vt(4). -- Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 21:56:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EEB43D41; Sun, 30 Mar 2014 21:56:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBEC3ECB; Sun, 30 Mar 2014 21:56:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2ULuDaF098996; Sun, 30 Mar 2014 21:56:13 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2ULuDCg098995; Sun, 30 Mar 2014 21:56:13 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201403302156.s2ULuDCg098995@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 30 Mar 2014 21:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263948 - head/contrib/byacc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 21:56:14 -0000 Author: bapt Date: Sun Mar 30 21:56:13 2014 New Revision: 263948 URL: http://svnweb.freebsd.org/changeset/base/263948 Log: Convert an unused banner from skeleton.c into a comment. It is added to every generated files and fix build at certain warning level with clang 3.4 Submitted by: Thomas Dickey (byacc upstream) Spotted by: glebius Modified: head/contrib/byacc/skeleton.c Directory Properties: head/contrib/byacc/ (props changed) Modified: head/contrib/byacc/skeleton.c ============================================================================== --- head/contrib/byacc/skeleton.c Sun Mar 30 21:48:49 2014 (r263947) +++ head/contrib/byacc/skeleton.c Sun Mar 30 21:56:13 2014 (r263948) @@ -16,9 +16,9 @@ const char *const banner[] = { - "#ifndef lint", - "static const char yysccsid[] = \"@(#)yaccpar 1.9 (Berkeley) 02/21/93\";", - "#endif", + "/* original parser id follows */", + "/* yysccsid[] = \"@(#)yaccpar 1.9 (Berkeley) 02/21/93\" */", + "/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */", "", "#define YYBYACC 1", CONCAT1("#define YYMAJOR ", YYMAJOR), From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 22:24:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E38F5857; Sun, 30 Mar 2014 22:24:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D13701B2; Sun, 30 Mar 2014 22:24:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2UMObnh013705; Sun, 30 Mar 2014 22:24:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2UMObJV013704; Sun, 30 Mar 2014 22:24:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403302224.s2UMObJV013704@svn.freebsd.org> From: Warner Losh Date: Sun, 30 Mar 2014 22:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263949 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 22:24:38 -0000 Author: imp Date: Sun Mar 30 22:24:37 2014 New Revision: 263949 URL: http://svnweb.freebsd.org/changeset/base/263949 Log: When building g++, we need to build libsupc earlier to avoid a race with libproc. Not sure why people didn't see this before now, but I get it often for higher (20-30) -j builds, but never for -j1 builds. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Mar 30 21:56:13 2014 (r263948) +++ head/Makefile.inc1 Sun Mar 30 22:24:37 2014 (r263949) @@ -1502,6 +1502,9 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_lib_libldns} \ ${_secure_lib_libssh} ${_secure_lib_libssl} +.if ${MK_GNUCXX} != no +_prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++ +.endif .if defined(WITH_ATF) || ${MK_TESTS} != "no" .if !defined(WITH_ATF) From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 22:24:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 773D398C; Sun, 30 Mar 2014 22:24:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6450F1B5; Sun, 30 Mar 2014 22:24:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2UMOkcE013764; Sun, 30 Mar 2014 22:24:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2UMOknE013762; Sun, 30 Mar 2014 22:24:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403302224.s2UMOknE013762@svn.freebsd.org> From: Warner Losh Date: Sun, 30 Mar 2014 22:24:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263950 - in head: . share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 22:24:46 -0000 Author: imp Date: Sun Mar 30 22:24:45 2014 New Revision: 263950 URL: http://svnweb.freebsd.org/changeset/base/263950 Log: Allow the build system to safely set MK_FOO to avoid the ambiguity when both WITH_FOO and WITHOUT_FOO are set. Use this where possible. Only disallow setting of MK_FOO on the command line. This was preferable to inventing a new mechanism or fixing the undef bug (bin/183762) which precludes users from turning off anything we turn off for parts of the build with WITHOUT_FOO prior to this. Modified: head/Makefile.inc1 head/share/mk/bsd.own.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Mar 30 22:24:37 2014 (r263949) +++ head/Makefile.inc1 Sun Mar 30 22:24:45 2014 (r263950) @@ -247,7 +247,7 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ DESTDIR= \ BOOTSTRAPPING=${OSRELDATE} \ SSP_CFLAGS= \ - -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \ + MK_HTML=no MK_INFO=no NO_LINT=yes MK_MAN=no \ -DNO_PIC -DNO_PROFILE -DNO_SHARED \ -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD -DNO_TESTS @@ -264,7 +264,7 @@ TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ # cross-tools stage XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ - -DWITHOUT_GDB -DNO_TESTS + MK_GDB=no -DNO_TESTS # kernel-tools stage KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ @@ -277,7 +277,7 @@ KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOB DESTDIR= \ BOOTSTRAPPING=${OSRELDATE} \ SSP_CFLAGS= \ - -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \ + MK_HTML=no MK_INFO=no -DNO_LINT MK_MAN=no \ -DNO_PIC -DNO_PROFILE -DNO_SHARED \ -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD @@ -423,7 +423,7 @@ LIB32WMAKEFLAGS+= \ -DNO_TESTS LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} ${LIB32WMAKEFLAGS} \ - -DWITHOUT_MAN -DWITHOUT_INFO -DWITHOUT_HTML + MK_MAN=no MK_INFO=no MK_HTML=no LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS \ ${IMAKE_INSTALL} .endif @@ -574,8 +574,8 @@ _libraries: @echo ">>> stage 4.2: building libraries" @echo "--------------------------------------------------------------" ${_+_}cd ${.CURDIR}; \ - ${WMAKE} -DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \ - -DWITHOUT_MAN -DNO_PROFILE -DNO_TESTS libraries + ${WMAKE} -DNO_FSCHG MK_HTML=no MK_INFO=no -DNO_LINT MK_MAN=no \ + -DNO_PROFILE -DNO_TESTS libraries _depend: @echo @echo "--------------------------------------------------------------" @@ -1881,9 +1881,9 @@ XDEV_CPUTYPE?=${CPUTYPE} XDEV_CPUTYPE?=${TARGET_CPUTYPE} .endif -NOFUN=-DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \ - -DWITHOUT_MAN -DWITHOUT_NLS -DNO_PROFILE \ - -DWITHOUT_KERBEROS -DWITHOUT_RESCUE -DNO_TESTS -DNO_WARNS \ +NOFUN=-DNO_FSCHG MK_HTML=no MK_INFO=no -DNO_LINT \ + MK_MAN=no MK_NLS=no -DNO_PROFILE \ + MK_KERBEROS=no MK_RESCUE=no -DNO_TESTS -DNO_WARNS \ TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \ CPUTYPE=${XDEV_CPUTYPE} Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sun Mar 30 22:24:37 2014 (r263949) +++ head/share/mk/bsd.own.mk Sun Mar 30 22:24:45 2014 (r263950) @@ -229,10 +229,7 @@ COMPRESS_EXT?= .gz MAN \ PROFILE .if defined(NO_${var}) -.if defined(WITH_${var}) -.undef WITH_${var} -.endif -WITHOUT_${var}= +MK_${var}:=no .endif .endfor @@ -446,13 +443,16 @@ __DEFAULT_NO_OPTIONS+=FDT .error WITH_${var} and WITHOUT_${var} can't both be set. .endif .if defined(MK_${var}) +.if ${.MAKE.LEVEL} == 0 .error MK_${var} can't be set by a user. .endif +.else .if defined(WITHOUT_${var}) MK_${var}:= no .else MK_${var}:= yes .endif +.endif .endfor .undef __DEFAULT_YES_OPTIONS @@ -464,13 +464,16 @@ MK_${var}:= yes .error WITH_${var} and WITHOUT_${var} can't both be set. .endif .if defined(MK_${var}) +.if ${.MAKE.LEVEL} == 0 .error MK_${var} can't be set by a user. .endif +.else .if defined(WITH_${var}) MK_${var}:= yes .else MK_${var}:= no .endif +.endif .endfor .undef __DEFAULT_NO_OPTIONS @@ -620,8 +623,10 @@ MK_${vv:H}:= ${MK_${vv:T}} .error WITH_${var} and WITHOUT_${var} can't both be set. .endif .if defined(MK_${var}) +.if ${.MAKE.LEVEL} == 0 .error MK_${var} can't be set by a user. .endif +.else .if ${COMPILER_FEATURES:Mc++11} .if defined(WITHOUT_${var}) MK_${var}:= no @@ -635,6 +640,7 @@ MK_${var}:= yes MK_${var}:= no .endif .endif +.endif .endfor .if !${COMPILER_FEATURES:Mc++11} From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 22:24:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 190EAAC4; Sun, 30 Mar 2014 22:24:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B85BF1B8; Sun, 30 Mar 2014 22:24:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2UMOshW013827; Sun, 30 Mar 2014 22:24:54 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2UMOspc013823; Sun, 30 Mar 2014 22:24:54 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403302224.s2UMOspc013823@svn.freebsd.org> From: Warner Losh Date: Sun, 30 Mar 2014 22:24:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263951 - in head: . share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 22:24:55 -0000 Author: imp Date: Sun Mar 30 22:24:53 2014 New Revision: 263951 URL: http://svnweb.freebsd.org/changeset/base/263951 Log: Kill NO_TESTS and use MK_TESTS=no when we want to skip them. Modified: head/Makefile.inc1 head/share/mk/bsd.own.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Mar 30 22:24:45 2014 (r263950) +++ head/Makefile.inc1 Sun Mar 30 22:24:53 2014 (r263951) @@ -249,7 +249,7 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ SSP_CFLAGS= \ MK_HTML=no MK_INFO=no NO_LINT=yes MK_MAN=no \ -DNO_PIC -DNO_PROFILE -DNO_SHARED \ - -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD -DNO_TESTS + -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD MK_TESTS=no # build-tools stage TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ @@ -259,12 +259,12 @@ TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ BOOTSTRAPPING=${OSRELDATE} \ SSP_CFLAGS= \ -DNO_LINT \ - -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD -DNO_TESTS + -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD MK_TESTS=no # cross-tools stage XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ - MK_GDB=no -DNO_TESTS + MK_GDB=no MK_TESTS=no # kernel-tools stage KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ @@ -420,7 +420,7 @@ LIB32WMAKEFLAGS+= \ -DNO_CPU_CFLAGS \ -DNO_CTF \ -DNO_LINT \ - -DNO_TESTS + MK_TESTS=no LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} ${LIB32WMAKEFLAGS} \ MK_MAN=no MK_INFO=no MK_HTML=no @@ -575,7 +575,7 @@ _libraries: @echo "--------------------------------------------------------------" ${_+_}cd ${.CURDIR}; \ ${WMAKE} -DNO_FSCHG MK_HTML=no MK_INFO=no -DNO_LINT MK_MAN=no \ - -DNO_PROFILE -DNO_TESTS libraries + -DNO_PROFILE MK_TESTS=no libraries _depend: @echo @echo "--------------------------------------------------------------" @@ -1509,7 +1509,7 @@ _prebuild_libs+= gnu/lib/libstdc++ gnu/l .if defined(WITH_ATF) || ${MK_TESTS} != "no" .if !defined(WITH_ATF) # Ensure that the ATF libraries will be built during make libraries, even -# though they will have -DNO_TESTS +# though they will have WITHOUT_TESTS MAKE+= -DWITH_ATF .endif _lib_atf= lib/atf @@ -1624,11 +1624,11 @@ ${_lib}__PL: .PHONY .MAKE .if exists(${.CURDIR}/${_lib}) ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_lib} && \ - ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ obj && \ - ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ depend && \ - ${MAKE} -DNO_TESTS -DNO_PROFILE -DNO_PIC \ + ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj && \ + ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend && \ + ${MAKE} MK_TESTS=no -DNO_PROFILE -DNO_PIC \ DIRPRFX=${_lib}/ all && \ - ${MAKE} -DNO_TESTS -DNO_PROFILE -DNO_PIC \ + ${MAKE} MK_TESTS=no -DNO_PROFILE -DNO_PIC \ DIRPRFX=${_lib}/ install .endif .endfor @@ -1638,10 +1638,10 @@ ${_lib}__L: .PHONY .MAKE .if exists(${.CURDIR}/${_lib}) ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_lib} && \ - ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ obj && \ - ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ depend && \ - ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ all && \ - ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ install + ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj && \ + ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend && \ + ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ all && \ + ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ install .endif .endfor @@ -1651,11 +1651,11 @@ ${_lib}__L: .PHONY .MAKE lib/libpam__L: .PHONY .MAKE ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \ cd ${.CURDIR}/lib/libpam && \ - ${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ obj && \ - ${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ depend && \ - ${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ \ + ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ obj && \ + ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ depend && \ + ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \ -D_NO_LIBPAM_SO_YET all && \ - ${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ \ + ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \ -D_NO_LIBPAM_SO_YET install _prereq_libs: ${_prereq_libs:S/$/__PL/} @@ -1883,7 +1883,7 @@ XDEV_CPUTYPE?=${TARGET_CPUTYPE} NOFUN=-DNO_FSCHG MK_HTML=no MK_INFO=no -DNO_LINT \ MK_MAN=no MK_NLS=no -DNO_PROFILE \ - MK_KERBEROS=no MK_RESCUE=no -DNO_TESTS -DNO_WARNS \ + MK_KERBEROS=no MK_RESCUE=no MK_TESTS=no -DNO_WARNS \ TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \ CPUTYPE=${XDEV_CPUTYPE} Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sun Mar 30 22:24:45 2014 (r263950) +++ head/share/mk/bsd.own.mk Sun Mar 30 22:24:53 2014 (r263951) @@ -547,20 +547,6 @@ MK_CLANG_EXTRAS:= no MK_CLANG_FULL:= no .endif -.if defined(NO_TESTS) -# This should be handled above along the handling of all other NO_* options. -# However, the above is broken when WITH_*=yes are passed to make(1) as -# command line arguments. See PR bin/183762. -# -# Because the TESTS option is new and it will default to yes, it's likely -# that people will pass WITHOUT_TESTS=yes to make(1) directly and get a broken -# build. So, just in case, it's better to explicitly handle this case here. -# -# TODO(jmmv): Either fix make to allow us putting this override where it -# belongs above or fix this file to cope with the make bug. -MK_TESTS:= no -.endif - # # Set defaults for the MK_*_SUPPORT variables. # From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 22:25:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03F56BF9; Sun, 30 Mar 2014 22:25:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E61B01BA; Sun, 30 Mar 2014 22:25:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2UMP1Sq013921; Sun, 30 Mar 2014 22:25:01 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2UMP1Ft013920; Sun, 30 Mar 2014 22:25:01 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403302225.s2UMP1Ft013920@svn.freebsd.org> From: Warner Losh Date: Sun, 30 Mar 2014 22:25:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263952 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 22:25:02 -0000 Author: imp Date: Sun Mar 30 22:25:01 2014 New Revision: 263952 URL: http://svnweb.freebsd.org/changeset/base/263952 Log: Move stray targets out of the xdev section. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Mar 30 22:24:53 2014 (r263951) +++ head/Makefile.inc1 Sun Mar 30 22:25:01 2014 (r263952) @@ -992,6 +992,8 @@ INSTALLKERNEL= ${_kernel} .endif .endfor +buildkernel ${WMAKE_TGTS} ${.ALLTARGETS:M_*}: .MAKE + # # buildkernel # @@ -1993,5 +1995,3 @@ _xi-links: xdev xdev-build xdev-install: @echo "*** Error: Both XDEV and XDEV_ARCH must be defined for \"${.TARGET}\" target" .endif - -buildkernel ${WMAKE_TGTS} ${.ALLTARGETS:M_*}: .MAKE From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 23:43:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 876698B8; Sun, 30 Mar 2014 23:43:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72225A3B; Sun, 30 Mar 2014 23:43:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2UNhdRs046273; Sun, 30 Mar 2014 23:43:39 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2UNhaVl046256; Sun, 30 Mar 2014 23:43:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403302343.s2UNhaVl046256@svn.freebsd.org> From: Warner Losh Date: Sun, 30 Mar 2014 23:43:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263954 - in head/sys: cam/scsi compat/freebsd32 dev/aacraid dev/acpica dev/advansys dev/aic7xxx sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 23:43:39 -0000 Author: imp Date: Sun Mar 30 23:43:36 2014 New Revision: 263954 URL: http://svnweb.freebsd.org/changeset/base/263954 Log: Remove instances of variables that were set, but never used. gcc 4.9 warns about these by default. Modified: head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_enc_ses.c head/sys/cam/scsi/scsi_pass.c head/sys/compat/freebsd32/freebsd32_misc.c head/sys/dev/aacraid/aacraid_cam.c head/sys/dev/aacraid/aacraid_pci.c head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_resource.c head/sys/dev/acpica/acpi_smbat.c head/sys/dev/advansys/advansys.c head/sys/dev/advansys/advlib.c head/sys/dev/advansys/adwcam.c head/sys/dev/aic7xxx/aic79xx.c head/sys/sys/buf_ring.h Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Sun Mar 30 23:43:30 2014 (r263953) +++ head/sys/cam/scsi/scsi_da.c Sun Mar 30 23:43:36 2014 (r263954) @@ -3013,13 +3013,11 @@ dadone(struct cam_periph *periph, union struct disk_params *dp; uint32_t block_size; uint64_t maxsector; - u_int lbppbe; /* LB per physical block exponent. */ u_int lalba; /* Lowest aligned LBA. */ if (state == DA_CCB_PROBE_RC) { block_size = scsi_4btoul(rdcap->length); maxsector = scsi_4btoul(rdcap->addr); - lbppbe = 0; lalba = 0; /* @@ -3040,7 +3038,6 @@ dadone(struct cam_periph *periph, union } else { block_size = scsi_4btoul(rcaplong->length); maxsector = scsi_8btou64(rcaplong->addr); - lbppbe = rcaplong->prot_lbppbe & SRC16_LBPPBE; lalba = scsi_2btoul(rcaplong->lalba_lbp); } Modified: head/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_ses.c Sun Mar 30 23:43:30 2014 (r263953) +++ head/sys/cam/scsi/scsi_enc_ses.c Sun Mar 30 23:43:36 2014 (r263954) @@ -1162,7 +1162,6 @@ ses_page_cdb(char *cdb, int bufsiz, SesD static int ses_set_timed_completion(enc_softc_t *enc, uint8_t tc_en) { - int err; union ccb *ccb; struct cam_periph *periph; struct ses_mgmt_mode_page *mgmt; @@ -1187,7 +1186,7 @@ ses_set_timed_completion(enc_softc_t *en * Ignore illegal request errors, as they are quite common and we * will print something out in that case anyway. */ - err = cam_periph_runccb(ccb, enc_error, ENC_CFLAGS, + cam_periph_runccb(ccb, enc_error, ENC_CFLAGS, ENC_FLAGS|SF_QUIET_IR, NULL); if (ccb->ccb_h.status != CAM_REQ_CMP) { ENC_VLOG(enc, "Timed Completion Unsupported\n"); @@ -1211,7 +1210,7 @@ ses_set_timed_completion(enc_softc_t *en /*page_fmt*/FALSE, /*save_pages*/TRUE, mode_buf, mode_buf_len, SSD_FULL_SIZE, /*timeout*/60 * 1000); - err = cam_periph_runccb(ccb, enc_error, ENC_CFLAGS, ENC_FLAGS, NULL); + cam_periph_runccb(ccb, enc_error, ENC_CFLAGS, ENC_FLAGS, NULL); if (ccb->ccb_h.status != CAM_REQ_CMP) { ENC_VLOG(enc, "Timed Completion Set Failed\n"); goto release; @@ -1881,11 +1880,9 @@ ses_publish_physpaths(enc_softc_t *enc, { struct ses_iterator iter; enc_cache_t *enc_cache; - ses_cache_t *ses_cache; enc_element_t *element; enc_cache = &enc->enc_daemon_cache; - ses_cache = enc_cache->private; ses_iter_init(enc, enc_cache, &iter); while ((element = ses_iter_next(&iter)) != NULL) { Modified: head/sys/cam/scsi/scsi_pass.c ============================================================================== --- head/sys/cam/scsi/scsi_pass.c Sun Mar 30 23:43:30 2014 (r263953) +++ head/sys/cam/scsi/scsi_pass.c Sun Mar 30 23:43:36 2014 (r263954) @@ -540,7 +540,6 @@ static int passdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) { struct cam_periph *periph; - struct pass_softc *softc; int error; uint32_t priority; @@ -549,7 +548,6 @@ passdoioctl(struct cdev *dev, u_long cmd return(ENXIO); cam_periph_lock(periph); - softc = (struct pass_softc *)periph->softc; error = 0; Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sun Mar 30 23:43:30 2014 (r263953) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sun Mar 30 23:43:36 2014 (r263954) @@ -1664,15 +1664,12 @@ freebsd32_do_sendfile(struct thread *td, off_t offset; int error; off_t sbytes; - struct sendfile_sync *sfs; - int do_kqueue = 0; offset = PAIR32TO64(off_t, uap->offset); if (offset < 0) return (EINVAL); hdr_uio = trl_uio = NULL; - sfs = NULL; if (uap->hdtr != NULL) { error = copyin(uap->hdtr, &hdtr32, sizeof(hdtr32)); @@ -1714,7 +1711,6 @@ freebsd32_do_sendfile(struct thread *td, CP(hdtr_kq32, hdtr_kq, kq_flags); PTRIN_CP(hdtr_kq32, hdtr_kq, kq_udata); CP(hdtr_kq32, hdtr_kq, kq_ident); - do_kqueue = 1; } } Modified: head/sys/dev/aacraid/aacraid_cam.c ============================================================================== --- head/sys/dev/aacraid/aacraid_cam.c Sun Mar 30 23:43:30 2014 (r263953) +++ head/sys/dev/aacraid/aacraid_cam.c Sun Mar 30 23:43:36 2014 (r263954) @@ -242,13 +242,11 @@ aac_cam_event(struct aac_softc *sc, stru static int aac_cam_probe(device_t dev) { - struct aac_softc *sc; struct aac_cam *camsc; camsc = (struct aac_cam *)device_get_softc(dev); if (!camsc->inf) return (0); - sc = camsc->inf->aac_sc; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); return (0); } @@ -1133,11 +1131,9 @@ aac_cam_poll(struct cam_sim *sim) static void aac_container_complete(struct aac_command *cm) { - struct aac_softc *sc; union ccb *ccb; u_int32_t status; - sc = cm->cm_sc; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); ccb = cm->cm_ccb; status = ((u_int32_t *)cm->cm_fib->data)[0]; Modified: head/sys/dev/aacraid/aacraid_pci.c ============================================================================== --- head/sys/dev/aacraid/aacraid_pci.c Sun Mar 30 23:43:30 2014 (r263953) +++ head/sys/dev/aacraid/aacraid_pci.c Sun Mar 30 23:43:36 2014 (r263954) @@ -111,12 +111,10 @@ static struct aac_ident * aac_find_ident(device_t dev) { struct aac_ident *m; - u_int16_t vendid, devid, sub_vendid, sub_devid; + u_int16_t vendid, devid; vendid = pci_get_vendor(dev); devid = pci_get_device(dev); - sub_vendid = pci_get_subvendor(dev); - sub_devid = pci_get_subdevice(dev); for (m = aacraid_family_identifiers; m->vendor != 0; m++) { if ((m->vendor == vendid) && (m->device == devid)) Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Sun Mar 30 23:43:30 2014 (r263953) +++ head/sys/dev/acpica/acpi.c Sun Mar 30 23:43:36 2014 (r263954) @@ -696,7 +696,6 @@ acpi_set_power_children(device_t dev, in { device_t child, parent; device_t *devlist; - struct pci_devinfo *dinfo; int dstate, i, numdevs; if (device_get_children(dev, &devlist, &numdevs) != 0) @@ -709,7 +708,6 @@ acpi_set_power_children(device_t dev, in parent = device_get_parent(dev); for (i = 0; i < numdevs; i++) { child = devlist[i]; - dinfo = device_get_ivars(child); dstate = state; if (device_is_attached(child) && acpi_device_pwr_for_sleep(parent, dev, &dstate) == 0) Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Sun Mar 30 23:43:30 2014 (r263953) +++ head/sys/dev/acpica/acpi_resource.c Sun Mar 30 23:43:36 2014 (r263954) @@ -183,7 +183,6 @@ acpi_parse_resource(ACPI_RESOURCE *res, struct acpi_parse_resource_set *set; struct acpi_resource_context *arc; UINT64 min, max, length, gran; - const char *name; device_t dev; arc = context; @@ -300,21 +299,18 @@ acpi_parse_resource(ACPI_RESOURCE *res, min = res->Data.Address16.Minimum; max = res->Data.Address16.Maximum; length = res->Data.Address16.AddressLength; - name = "Address16"; break; case ACPI_RESOURCE_TYPE_ADDRESS32: gran = res->Data.Address32.Granularity; min = res->Data.Address32.Minimum; max = res->Data.Address32.Maximum; length = res->Data.Address32.AddressLength; - name = "Address32"; break; case ACPI_RESOURCE_TYPE_ADDRESS64: gran = res->Data.Address64.Granularity; min = res->Data.Address64.Minimum; max = res->Data.Address64.Maximum; length = res->Data.Address64.AddressLength; - name = "Address64"; break; default: KASSERT(res->Type == ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64, @@ -323,7 +319,6 @@ acpi_parse_resource(ACPI_RESOURCE *res, min = res->Data.ExtAddress64.Minimum; max = res->Data.ExtAddress64.Maximum; length = res->Data.ExtAddress64.AddressLength; - name = "ExtAddress64"; break; } if (length <= 0) Modified: head/sys/dev/acpica/acpi_smbat.c ============================================================================== --- head/sys/dev/acpica/acpi_smbat.c Sun Mar 30 23:43:30 2014 (r263953) +++ head/sys/dev/acpica/acpi_smbat.c Sun Mar 30 23:43:36 2014 (r263954) @@ -345,7 +345,7 @@ acpi_smbat_get_bst(device_t dev, struct { struct acpi_smbat_softc *sc; int error; - uint32_t cap_units, factor; + uint32_t factor; int16_t val; uint8_t addr; @@ -362,13 +362,10 @@ acpi_smbat_get_bst(device_t dev, struct if (acpi_smbus_read_2(sc, addr, SMBATT_CMD_BATTERY_MODE, &val)) goto out; - if (val & SMBATT_BM_CAPACITY_MODE) { + if (val & SMBATT_BM_CAPACITY_MODE) factor = 10; - cap_units = ACPI_BIF_UNITS_MW; - } else { + else factor = 1; - cap_units = ACPI_BIF_UNITS_MA; - } /* get battery status */ if (acpi_smbus_read_2(sc, addr, SMBATT_CMD_BATTERY_STATUS, &val)) Modified: head/sys/dev/advansys/advansys.c ============================================================================== --- head/sys/dev/advansys/advansys.c Sun Mar 30 23:43:30 2014 (r263953) +++ head/sys/dev/advansys/advansys.c Sun Mar 30 23:43:36 2014 (r263954) @@ -1005,7 +1005,6 @@ adv_run_doneq(struct adv_softc *adv) struct adv_ccb_info *cinfo; u_int done_qaddr; u_int sg_queue_cnt; - int aborted; done_qaddr = ADV_QNO_TO_QADDR(done_qno); @@ -1050,8 +1049,6 @@ adv_run_doneq(struct adv_softc *adv) #endif adv->cur_active -= sg_queue_cnt + 1; - aborted = (scsiq.q_status & QS_ABORTED) != 0; - if ((scsiq.q_status != QS_DONE) && (scsiq.q_status & QS_ABORTED) == 0) panic("adv_qdone: completed scsiq with unknown status"); Modified: head/sys/dev/advansys/advlib.c ============================================================================== --- head/sys/dev/advansys/advlib.c Sun Mar 30 23:43:30 2014 (r263953) +++ head/sys/dev/advansys/advlib.c Sun Mar 30 23:43:36 2014 (r263954) @@ -1051,12 +1051,10 @@ adv_isr_chip_halted(struct adv_softc *ad q_cntl &= ~QC_MSG_OUT; adv_write_lram_8(adv, halt_q_addr + ADV_SCSIQ_B_CNTL, q_cntl); } else if (int_halt_code == ADV_HALT_SS_QUEUE_FULL) { - u_int8_t scsi_status; union ccb *ccb; u_int32_t cinfo_index; - scsi_status = adv_read_lram_8(adv, halt_q_addr - + ADV_SCSIQ_SCSI_STATUS); + adv_read_lram_8(adv, halt_q_addr + ADV_SCSIQ_SCSI_STATUS); cinfo_index = adv_read_lram_32(adv, halt_q_addr + ADV_SCSIQ_D_CINFO_IDX); ccb = adv->ccb_infos[cinfo_index].ccb; @@ -1714,13 +1712,9 @@ adv_send_scsi_queue(struct adv_softc *ad { u_int8_t free_q_head; u_int8_t next_qp; - u_int8_t tid_no; - u_int8_t target_ix; int retval; retval = 1; - target_ix = scsiq->q2.target_ix; - tid_no = ADV_TIX_TO_TID(target_ix); free_q_head = adv_read_lram_16(adv, ADVV_FREE_Q_HEAD_W) & 0xFF; if ((next_qp = adv_alloc_free_queues(adv, free_q_head, n_q_required)) != ADV_QLINK_END) { Modified: head/sys/dev/advansys/adwcam.c ============================================================================== --- head/sys/dev/advansys/adwcam.c Sun Mar 30 23:43:30 2014 (r263953) +++ head/sys/dev/advansys/adwcam.c Sun Mar 30 23:43:36 2014 (r263954) @@ -344,12 +344,10 @@ adw_action(struct cam_sim *sim, union cc case XPT_SCSI_IO: /* Execute the requested I/O operation */ { struct ccb_scsiio *csio; - struct ccb_hdr *ccbh; struct acb *acb; int error; csio = &ccb->csio; - ccbh = &ccb->ccb_h; /* Max supported CDB length is 12 bytes */ if (csio->cdb_len > 12) { Modified: head/sys/dev/aic7xxx/aic79xx.c ============================================================================== --- head/sys/dev/aic7xxx/aic79xx.c Sun Mar 30 23:43:30 2014 (r263953) +++ head/sys/dev/aic7xxx/aic79xx.c Sun Mar 30 23:43:36 2014 (r263954) @@ -1059,9 +1059,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, { struct ahd_devinfo devinfo; struct scb *scb; - struct ahd_initiator_tinfo *targ_info; struct ahd_tmode_tstate *tstate; - struct ahd_transinfo *tinfo; u_int scbid; /* @@ -1090,12 +1088,11 @@ ahd_handle_seqint(struct ahd_softc *ahd, SCB_GET_LUN(scb), SCB_GET_CHANNEL(ahd, scb), ROLE_INITIATOR); - targ_info = ahd_fetch_transinfo(ahd, - devinfo.channel, - devinfo.our_scsiid, - devinfo.target, - &tstate); - tinfo = &targ_info->curr; + ahd_fetch_transinfo(ahd, + devinfo.channel, + devinfo.our_scsiid, + devinfo.target, + &tstate); ahd_set_width(ahd, &devinfo, MSG_EXT_WDTR_BUS_8_BIT, AHD_TRANS_ACTIVE, /*paused*/TRUE); ahd_set_syncrate(ahd, &devinfo, /*period*/0, @@ -1817,7 +1814,6 @@ ahd_handle_transmission_error(struct ahd struct scb *scb; u_int scbid; u_int lqistat1; - u_int lqistat2; u_int msg_out; u_int curphase; u_int lastphase; @@ -1828,7 +1824,7 @@ ahd_handle_transmission_error(struct ahd scb = NULL; ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); lqistat1 = ahd_inb(ahd, LQISTAT1) & ~(LQIPHASE_LQ|LQIPHASE_NLQ); - lqistat2 = ahd_inb(ahd, LQISTAT2); + ahd_inb(ahd, LQISTAT2); if ((lqistat1 & (LQICRCI_NLQ|LQICRCI_LQ)) == 0 && (ahd->bugs & AHD_NLQICRC_DELAYED_BUG) != 0) { u_int lqistate; @@ -2780,10 +2776,8 @@ ahd_dump_sglist(struct scb *scb) sg_list = (struct ahd_dma64_seg*)scb->sg_list; for (i = 0; i < scb->sg_count; i++) { uint64_t addr; - uint32_t len; addr = aic_le64toh(sg_list[i].addr); - len = aic_le32toh(sg_list[i].len); printf("sg[%d] - Addr 0x%x%x : Length %d%s\n", i, (uint32_t)((addr >> 32) & 0xFFFFFFFF), @@ -3418,13 +3412,12 @@ ahd_update_pending_scbs(struct ahd_softc pending_scb_count = 0; LIST_FOREACH(pending_scb, &ahd->pending_scbs, pending_links) { struct ahd_devinfo devinfo; - struct ahd_initiator_tinfo *tinfo; struct ahd_tmode_tstate *tstate; ahd_scb_devinfo(ahd, &devinfo, pending_scb); - tinfo = ahd_fetch_transinfo(ahd, devinfo.channel, - devinfo.our_scsiid, - devinfo.target, &tstate); + ahd_fetch_transinfo(ahd, devinfo.channel, + devinfo.our_scsiid, + devinfo.target, &tstate); if ((tstate->auto_negotiate & devinfo.target_mask) == 0 && (pending_scb->flags & SCB_AUTO_NEGOTIATE) != 0) { pending_scb->flags &= ~SCB_AUTO_NEGOTIATE; Modified: head/sys/sys/buf_ring.h ============================================================================== --- head/sys/sys/buf_ring.h Sun Mar 30 23:43:30 2014 (r263953) +++ head/sys/sys/buf_ring.h Sun Mar 30 23:43:36 2014 (r263954) @@ -172,7 +172,10 @@ buf_ring_dequeue_mc(struct buf_ring *br) static __inline void * buf_ring_dequeue_sc(struct buf_ring *br) { - uint32_t cons_head, cons_next, cons_next_next; + uint32_t cons_head, cons_next; +#ifdef PREFETCH_DEFINED + uint32_t cons_next_next; +#endif uint32_t prod_tail; void *buf; @@ -180,7 +183,9 @@ buf_ring_dequeue_sc(struct buf_ring *br) prod_tail = br->br_prod_tail; cons_next = (cons_head + 1) & br->br_cons_mask; +#ifdef PREFETCH_DEFINED cons_next_next = (cons_head + 2) & br->br_cons_mask; +#endif if (cons_head == prod_tail) return (NULL); From owner-svn-src-head@FreeBSD.ORG Sun Mar 30 23:43:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 514B58B7; Sun, 30 Mar 2014 23:43:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DBA1A3A; Sun, 30 Mar 2014 23:43:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2UNhVYI046204; Sun, 30 Mar 2014 23:43:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2UNhUgC046202; Sun, 30 Mar 2014 23:43:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403302343.s2UNhUgC046202@svn.freebsd.org> From: Warner Losh Date: Sun, 30 Mar 2014 23:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263953 - in head: . share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2014 23:43:31 -0000 Author: imp Date: Sun Mar 30 23:43:30 2014 New Revision: 263953 URL: http://svnweb.freebsd.org/changeset/base/263953 Log: There's no need to guess at the COMPILER_TYPE to pass it down. We guess wrong for buildkernel when CC=gcc49, say. Eliminate all the guessing. COMPILER_TYPE propigates properly on its own, if specified, and we guess it correctly otherwise lower in the build. Also, fix conditionals for armv6hf when using an external compiler chain. They were broken before, but unused. Also, prefer checking the compiler type over CLANG_IS_CC since the latter is only supposed to be used to determine what symlinks to install (more fixes to follow). Modified: head/Makefile.inc1 head/share/mk/bsd.prog.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Mar 30 22:25:01 2014 (r263952) +++ head/Makefile.inc1 Sun Mar 30 23:43:30 2014 (r263953) @@ -240,8 +240,7 @@ BMAKEENV= INSTALL="sh ${.CURDIR}/tools/i PATH=${BPATH}:${PATH} \ WORLDTMP=${WORLDTMP} \ VERSION="${VERSION}" \ - MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ - COMPILER_TYPE=${COMPILER_TYPE} + MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ DESTDIR= \ @@ -270,8 +269,7 @@ XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ PATH=${BPATH}:${PATH} \ WORLDTMP=${WORLDTMP} \ - VERSION="${VERSION}" \ - COMPILER_TYPE=${COMPILER_TYPE} + VERSION="${VERSION}" KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOBJDIRPREFIX=${WORLDTMP} \ ${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ DESTDIR= \ @@ -324,17 +322,6 @@ WMAKEENV+= CC="${XCC} ${XFLAGS}" CXX="${ AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \ OBJDUMP=${XOBJDUMP} RANLIB=${XRANLIB} STRINGS=${XSTRINGS} -.if ${XCC:T:Mgcc} == "gcc" -WMAKE_COMPILER_TYPE= gcc -.elif ${XCC:T:Mclang} == "clang" -WMAKE_COMPILER_TYPE= clang -.elif ${MK_CLANG_IS_CC} == "no" -WMAKE_COMPILER_TYPE= gcc -.else -WMAKE_COMPILER_TYPE= clang -.endif -IMAKE_COMPILER_TYPE= COMPILER_TYPE=${WMAKE_COMPILER_TYPE} - .if ${XCC:M/*} XFLAGS= --sysroot=${WORLDTMP} .if defined(CROSS_BINUTILS_PREFIX) @@ -347,21 +334,18 @@ XFLAGS+= -B${CROSS_BINUTILS_PREFIX} .else XFLAGS+= -B${WORLDTMP}/usr/bin .endif -.if ${TARGET_ARCH} != ${MACHINE_ARCH} && ${WMAKE_COMPILER_TYPE} == "clang" -.if (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "armv6") && \ -${MK_ARM_EABI} != "no" +.if ${TARGET} == "arm" && ${MK_ARM_EABI} != "no" +.if ${TARGET_ARCH:M*eb*} == "" TARGET_ABI= gnueabi .elif ${TARGET_ARCH} == "armv6hf" TARGET_ABI= gnueabihf -.else -TARGET_ABI= unknown .endif +.endif +TARGET_ABI?= unknown TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0 XFLAGS+= -target ${TARGET_TRIPLE} .endif -.endif -WMAKEENV+= COMPILER_TYPE=${WMAKE_COMPILER_TYPE} WMAKE= ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 DESTDIR=${WORLDTMP} .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" @@ -409,10 +393,8 @@ LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${OBJTR PATH=${TMPPATH} \ LIBDIR=/usr/lib32 \ SHLIBDIR=/usr/lib32 \ - LIBPRIVATEDIR=/usr/lib32/private \ - COMPILER_TYPE=${WMAKE_COMPILER_TYPE} -LIB32WMAKEFLAGS+= \ - CC="${XCC} ${LIB32FLAGS}" \ + LIBPRIVATEDIR=/usr/lib32/private +LIB32WMAKEFLAGS+= CC="${XCC} ${LIB32FLAGS}" \ CXX="${XCXX} ${LIB32FLAGS}" \ DESTDIR=${LIB32TMP} \ -DCOMPAT_32BIT \ @@ -430,7 +412,7 @@ LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDES IMAKEENV= ${CROSSENV:N_LDSCRIPTROOT=*} IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \ - ${IMAKE_INSTALL} ${IMAKE_MTREE} ${IMAKE_COMPILER_TYPE} + ${IMAKE_INSTALL} ${IMAKE_MTREE} .if empty(.MAKEFLAGS:M-n) IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \ LD_LIBRARY_PATH=${INSTALLTMP} \ Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Sun Mar 30 22:25:01 2014 (r263952) +++ head/share/mk/bsd.prog.mk Sun Mar 30 23:43:30 2014 (r263953) @@ -173,7 +173,7 @@ _EXTRADEPEND: .else echo ${PROG}: ${LIBC} ${DPADD} >> ${DEPENDFILE} .if defined(PROG_CXX) && !defined(EARLY_BUILD) -.if ${MK_CLANG_IS_CC} != "no" && empty(CXXFLAGS:M-stdlib=libstdc++) +.if ${COMPILER_TYPE} == "clang" && empty(CXXFLAGS:M-stdlib=libstdc++) echo ${PROG}: ${LIBCPLUSPLUS} >> ${DEPENDFILE} .else echo ${PROG}: ${LIBSTDCPLUSPLUS} >> ${DEPENDFILE} From owner-svn-src-head@FreeBSD.ORG Mon Mar 31 00:17:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id B37EEFA; Mon, 31 Mar 2014 00:17:34 +0000 (UTC) Date: Mon, 31 Mar 2014 00:17:34 +0000 From: Alexey Dokuchaev To: Aleksandr Rybalko Subject: Re: svn commit: r263885 - in head/sys/dev/vt: . hw/vga Message-ID: <20140331001734.GA15296@FreeBSD.org> References: <201403282204.s2SM4SeN001155@svn.freebsd.org> <5336F23B.9080402@freebsd.org> <20140330003523.791b9ed3.ray@freebsd.org> <20140330070444.GA30090@FreeBSD.org> <20140330233824.12632c5f.ray@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140330233824.12632c5f.ray@freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Nathan Whitehorn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 00:17:34 -0000 On Sun, Mar 30, 2014 at 11:38:24PM +0300, Aleksandr Rybalko wrote: > > I've always wondered why FreeBSD *ever* had this ugly > > "look-we-can-make-it- like-in-wind0ze" mouse pointer on the console. > > I've been always building kernel with SC_ALT_MOUSE_IMAGE; I'm really > > hoping (if this nonsense has to stay) there will be an option to > > completely disable it and all related code paths when vt(4) > > eventually replaces syscons(4). > > its name SC_NO_CUTPASTE for both syscons(4) and vt(4). Hmm, doesn't seem so. I've never had this option in kernel config, and its name suggest it's for disabling cut-n-paste buffer, which is not what I want (and find it very convenient, FWIW). I'm pretty sure that SC_ALT_MOUSE_IMAGE gives me that standard, "inverted" nice text-mode mouse pointer we all used to since early DOS years. ./danfe From owner-svn-src-head@FreeBSD.ORG Mon Mar 31 01:55:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20CC3363; Mon, 31 Mar 2014 01:55:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C70E610; Mon, 31 Mar 2014 01:55:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2V1t1sb010932; Mon, 31 Mar 2014 01:55:01 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2V1sxXY010836; Mon, 31 Mar 2014 01:54:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201403310154.s2V1sxXY010836@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 31 Mar 2014 01:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263957 - in head/sys: dev/age dev/alc dev/ale dev/bce dev/bge dev/fxp dev/jme dev/msk dev/nfe dev/sge pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 01:55:02 -0000 Author: yongari Date: Mon Mar 31 01:54:59 2014 New Revision: 263957 URL: http://svnweb.freebsd.org/changeset/base/263957 Log: Increase the number of TX DMA segments from 32 to 35. It turned out 32 is not enough to support a full sized TSO packet. While I'm here fix a long standing bug introduced in r169632 in bce(4) where it didn't include L2 header length of TSO packet in the maximum DMA segment size calculation. In collaboration with: rmacklem MFC after: 2 weeks Modified: head/sys/dev/age/if_agevar.h head/sys/dev/alc/if_alcvar.h head/sys/dev/ale/if_alevar.h head/sys/dev/bce/if_bcereg.h head/sys/dev/bge/if_bgereg.h head/sys/dev/fxp/if_fxpreg.h head/sys/dev/jme/if_jmevar.h head/sys/dev/msk/if_mskreg.h head/sys/dev/nfe/if_nfereg.h head/sys/dev/sge/if_sgereg.h head/sys/pci/if_rlreg.h Modified: head/sys/dev/age/if_agevar.h ============================================================================== --- head/sys/dev/age/if_agevar.h Mon Mar 31 01:04:40 2014 (r263956) +++ head/sys/dev/age/if_agevar.h Mon Mar 31 01:54:59 2014 (r263957) @@ -42,7 +42,7 @@ #define AGE_TSO_MAXSEGSIZE 4096 #define AGE_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) -#define AGE_MAXTXSEGS 32 +#define AGE_MAXTXSEGS 35 #define AGE_RX_BUF_ALIGN 8 #ifndef __NO_STRICT_ALIGNMENT #define AGE_RX_BUF_SIZE (MCLBYTES - AGE_RX_BUF_ALIGN) Modified: head/sys/dev/alc/if_alcvar.h ============================================================================== --- head/sys/dev/alc/if_alcvar.h Mon Mar 31 01:04:40 2014 (r263956) +++ head/sys/dev/alc/if_alcvar.h Mon Mar 31 01:54:59 2014 (r263957) @@ -42,7 +42,7 @@ #define ALC_TSO_MAXSEGSIZE 4096 #define ALC_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) -#define ALC_MAXTXSEGS 32 +#define ALC_MAXTXSEGS 35 #define ALC_ADDR_LO(x) ((uint64_t) (x) & 0xFFFFFFFF) #define ALC_ADDR_HI(x) ((uint64_t) (x) >> 32) Modified: head/sys/dev/ale/if_alevar.h ============================================================================== --- head/sys/dev/ale/if_alevar.h Mon Mar 31 01:04:40 2014 (r263956) +++ head/sys/dev/ale/if_alevar.h Mon Mar 31 01:54:59 2014 (r263957) @@ -40,7 +40,7 @@ #define ALE_TSO_MAXSEGSIZE 4096 #define ALE_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) -#define ALE_MAXTXSEGS 32 +#define ALE_MAXTXSEGS 35 #define ALE_ADDR_LO(x) ((uint64_t) (x) & 0xFFFFFFFF) #define ALE_ADDR_HI(x) ((uint64_t) (x) >> 32) Modified: head/sys/dev/bce/if_bcereg.h ============================================================================== --- head/sys/dev/bce/if_bcereg.h Mon Mar 31 01:04:40 2014 (r263956) +++ head/sys/dev/bce/if_bcereg.h Mon Mar 31 01:54:59 2014 (r263957) @@ -6309,8 +6309,8 @@ struct fw_info { #define BCE_TX_TIMEOUT 5 -#define BCE_MAX_SEGMENTS 32 -#define BCE_TSO_MAX_SIZE 65536 +#define BCE_MAX_SEGMENTS 35 +#define BCE_TSO_MAX_SIZE (65535 + sizeof(struct ether_vlan_header)) #define BCE_TSO_MAX_SEG_SIZE 4096 #define BCE_DMA_ALIGN 8 Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Mon Mar 31 01:04:40 2014 (r263956) +++ head/sys/dev/bge/if_bgereg.h Mon Mar 31 01:54:59 2014 (r263957) @@ -2852,7 +2852,7 @@ struct bge_gib { */ #define BGE_NSEG_JUMBO 4 -#define BGE_NSEG_NEW 32 +#define BGE_NSEG_NEW 35 #define BGE_TSOSEG_SZ 4096 /* Maximum DMA address for controllers that have 40bit DMA address bug. */ Modified: head/sys/dev/fxp/if_fxpreg.h ============================================================================== --- head/sys/dev/fxp/if_fxpreg.h Mon Mar 31 01:04:40 2014 (r263956) +++ head/sys/dev/fxp/if_fxpreg.h Mon Mar 31 01:54:59 2014 (r263957) @@ -250,7 +250,7 @@ struct fxp_cb_ucode { /* * Number of DMA segments in a TxCB. */ -#define FXP_NTXSEG 32 +#define FXP_NTXSEG 35 struct fxp_tbd { uint32_t tb_addr; Modified: head/sys/dev/jme/if_jmevar.h ============================================================================== --- head/sys/dev/jme/if_jmevar.h Mon Mar 31 01:04:40 2014 (r263956) +++ head/sys/dev/jme/if_jmevar.h Mon Mar 31 01:54:59 2014 (r263957) @@ -49,7 +49,7 @@ #define JME_RX_RING_ALIGN 16 #define JME_TSO_MAXSEGSIZE 4096 #define JME_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) -#define JME_MAXTXSEGS 32 +#define JME_MAXTXSEGS 35 #define JME_RX_BUF_ALIGN sizeof(uint64_t) #define JME_SSB_ALIGN 16 Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Mon Mar 31 01:04:40 2014 (r263956) +++ head/sys/dev/msk/if_mskreg.h Mon Mar 31 01:54:59 2014 (r263957) @@ -2338,7 +2338,7 @@ struct msk_stat_desc { #endif #define MSK_RX_BUF_ALIGN 8 #define MSK_JUMBO_RX_RING_CNT MSK_RX_RING_CNT -#define MSK_MAXTXSEGS 32 +#define MSK_MAXTXSEGS 35 #define MSK_TSO_MAXSGSIZE 4096 #define MSK_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) Modified: head/sys/dev/nfe/if_nfereg.h ============================================================================== --- head/sys/dev/nfe/if_nfereg.h Mon Mar 31 01:04:40 2014 (r263956) +++ head/sys/dev/nfe/if_nfereg.h Mon Mar 31 01:54:59 2014 (r263957) @@ -40,7 +40,7 @@ (NFE_JUMBO_FRAMELEN - NFE_RX_HEADERS) #define NFE_MIN_FRAMELEN (ETHER_MIN_LEN - ETHER_CRC_LEN) -#define NFE_MAX_SCATTER 32 +#define NFE_MAX_SCATTER 35 #define NFE_TSO_MAXSGSIZE 4096 #define NFE_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) Modified: head/sys/dev/sge/if_sgereg.h ============================================================================== --- head/sys/dev/sge/if_sgereg.h Mon Mar 31 01:04:40 2014 (r263956) +++ head/sys/dev/sge/if_sgereg.h Mon Mar 31 01:54:59 2014 (r263957) @@ -284,7 +284,7 @@ struct sge_desc { #define SGE_RX_RING_CNT 256 /* [8, 1024] */ #define SGE_TX_RING_CNT 256 /* [8, 8192] */ #define SGE_DESC_ALIGN 16 -#define SGE_MAXTXSEGS 32 +#define SGE_MAXTXSEGS 35 #define SGE_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) #define SGE_TSO_MAXSEGSIZE 4096 #define SGE_RX_BUF_ALIGN sizeof(uint64_t) Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Mon Mar 31 01:04:40 2014 (r263956) +++ head/sys/pci/if_rlreg.h Mon Mar 31 01:54:59 2014 (r263957) @@ -776,7 +776,7 @@ struct rl_stats { #define RL_TX_DESC_CNT RL_8169_TX_DESC_CNT #define RL_RX_DESC_CNT RL_8169_RX_DESC_CNT #define RL_RX_JUMBO_DESC_CNT RL_RX_DESC_CNT -#define RL_NTXSEGS 32 +#define RL_NTXSEGS 35 #define RL_RING_ALIGN 256 #define RL_DUMP_ALIGN 64 From owner-svn-src-head@FreeBSD.ORG Mon Mar 31 03:11:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2AB249A for ; Mon, 31 Mar 2014 03:11:30 +0000 (UTC) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27924CCD for ; Mon, 31 Mar 2014 03:11:29 +0000 (UTC) Received: by mail-lb0-f181.google.com with SMTP id c11so5397590lbj.12 for ; Sun, 30 Mar 2014 20:11:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=KBALKmTXxuOTbqVukNZgPCKm0U5TPV3lQNnkXA19S0o=; b=jnl7BLnNtbikZ+by4mkxC9yMHx+EGmNiq/+dbZaQL5QAwkJSUufFSPdUA8a5ZRzGAX 2V1C35M4LGyMYlGNcFEjMPcLW98IFntHitjvOu/JhWfR/aUsyx9tilExx8cGUATIv082 v6L+QE3cCYmdFPX0gT2g646SHHVeF9BYkqsMoIxcQxkSv2SP6SI2P5FJ7ztlAIY+2xPF TXklxUhNORISbi+AJkmZBFZOoIEAHpof64LGEXK5aZJjBa04lqNtaQUloLVBm1E8d6PW jNNcb0D141epA2X/5qlyyrbFoGp+ixXDgTbxJgjKZDjfpUNy1eugTQ6sNx/B1o5doFYh /4Vg== X-Gm-Message-State: ALoCoQlU0Y78oeNJ8cliiapdet0VB3LjgfUjbc/nXlY5eD/ozW2tvepgJ6f/teTBehn17LZsGw0u X-Received: by 10.112.24.9 with SMTP id q9mr16106609lbf.23.1396235482024; Sun, 30 Mar 2014 20:11:22 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id md15sm8980993lbb.28.2014.03.30.20.11.21 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 30 Mar 2014 20:11:21 -0700 (PDT) Message-ID: <5338DCD8.5090909@freebsd.org> Date: Mon, 31 Mar 2014 07:11:20 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r263953 - in head: . share/mk References: <201403302343.s2UNhUgC046202@svn.freebsd.org> In-Reply-To: <201403302343.s2UNhUgC046202@svn.freebsd.org> X-Enigmail-Version: 1.7a1pre Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 03:11:30 -0000 On 31.03.2014 3:43, Warner Losh wrote: > Author: imp > Date: Sun Mar 30 23:43:30 2014 > New Revision: 263953 > URL: http://svnweb.freebsd.org/changeset/base/263953 Somewhere after your mk changes (I think, previous files) typing 'make' in /usr/src/lib produce that: make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: duplicate script for target "all_subdir_libnv" ignored make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: using previous script for "all_subdir_libnv" defined here make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: duplicate script for target "all-man_subdir_libnv" ignored make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: using previous script for "all-man_subdir_libnv" defined here make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: duplicate script for target "checkdpadd_subdir_libnv" ignored make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: using previous script for "checkdpadd_subdir_libnv" defined here make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: duplicate script for target "clean_subdir_libnv" ignored make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: using previous script for "clean_subdir_libnv" defined here make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: duplicate script for target "cleandepend_subdir_libnv" ignored make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: using previous script for "cleandepend_subdir_libnv" defined here make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: duplicate script for target "cleandir_subdir_libnv" ignored make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: using previous script for "cleandir_subdir_libnv" defined here make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: duplicate script for target "cleanilinks_subdir_libnv" ignored make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: using previous script for "cleanilinks_subdir_libnv" defined here make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: duplicate script for target "depend_subdir_libnv" ignored make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: using previous script for "depend_subdir_libnv" defined here make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: duplicate script for target "distribute_subdir_libnv" ignored make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: using previous script for "distribute_subdir_libnv" defined here make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: duplicate script for target "lint_subdir_libnv" ignored make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: using previous script for "lint_subdir_libnv" defined here make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: duplicate script for target "maninstall_subdir_libnv" ignored make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: using previous script for "maninstall_subdir_libnv" defined here make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: duplicate script for target "manlint_subdir_libnv" ignored make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: using previous script for "manlint_subdir_libnv" defined here make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: duplicate script for target "obj_subdir_libnv" ignored make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: using previous script for "obj_subdir_libnv" defined here make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: duplicate script for target "objlink_subdir_libnv" ignored make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: using previous script for "objlink_subdir_libnv" defined here make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: duplicate script for target "realinstall_subdir_libnv" ignored make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: using previous script for "realinstall_subdir_libnv" defined here make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: duplicate script for target "regress_subdir_libnv" ignored make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: using previous script for "regress_subdir_libnv" defined here make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: duplicate script for target "tags_subdir_libnv" ignored make: "/usr/share/mk/bsd.subdir.mk" line 89: warning: using previous script for "tags_subdir_libnv" defined here -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Mon Mar 31 04:01:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E483DD0D; Mon, 31 Mar 2014 04:01:00 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BE75B156; Mon, 31 Mar 2014 04:01:00 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s2V40xeT064821 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 30 Mar 2014 21:00:59 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s2V40x7N064820; Sun, 30 Mar 2014 21:00:59 -0700 (PDT) (envelope-from jmg) Date: Sun, 30 Mar 2014 21:00:59 -0700 From: John-Mark Gurney To: Pyun YongHyeon Subject: Re: svn commit: r263957 - in head/sys: dev/age dev/alc dev/ale dev/bce dev/bge dev/fxp dev/jme dev/msk dev/nfe dev/sge pci Message-ID: <20140331040058.GV60889@funkthat.com> References: <201403310154.s2V1sxXY010836@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201403310154.s2V1sxXY010836@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Sun, 30 Mar 2014 21:00:59 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 04:01:01 -0000 Pyun YongHyeon wrote this message on Mon, Mar 31, 2014 at 01:54 +0000: > Author: yongari > Date: Mon Mar 31 01:54:59 2014 > New Revision: 263957 > URL: http://svnweb.freebsd.org/changeset/base/263957 > > Log: > Increase the number of TX DMA segments from 32 to 35. It turned > out 32 is not enough to support a full sized TSO packet. > While I'm here fix a long standing bug introduced in r169632 in > bce(4) where it didn't include L2 header length of TSO packet in > the maximum DMA segment size calculation. I assume all of the hardware supports this increase? Also, is there a reason to only increase up to 35 and not something larger, like 64? Is there a memory or performance penalty? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Mon Mar 31 04:25:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C7BEF93; Mon, 31 Mar 2014 04:25:45 +0000 (UTC) Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [IPv6:2607:f8b0:400e:c03::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DDCD346; Mon, 31 Mar 2014 04:25:45 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id lf10so7657229pab.13 for ; Sun, 30 Mar 2014 21:25:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=rHdcdKRCTQJ5W+yF41MLiZcsxANoqSWAReL1Jh3FEYg=; b=O3pKoTgOuHl3SQV7iouB+Xih+acl9ai582ZmILyR+eQ8+gTXTy7zV0NS4A4c5QQcZY /hygRl669pH6qeslfPiLCoNYQIy8nQhH7gd7t3xE3/qme4xG/11i987d5z8Qcxsp3cRp DKK/2iDloz1/q7QiUJ1pHBwmAO/eb6IhOfHEnEyhprHjOtxppop5YKG9c8zQwdlV/BSd x95Rmmu23GBW94EscpDfJxz6Eqbye7oYZVfK2ES1qNEodxnmRE2A84xDEx9FnNqJWKQs oX0JZkwCWnc+J7T4wdT9AEoKFBZNO/Ubt/mw8B/bgMc6rnz7eaqhzXen0vK9dS9lIzoa IGsA== X-Received: by 10.68.237.133 with SMTP id vc5mr22665457pbc.92.1396239944742; Sun, 30 Mar 2014 21:25:44 -0700 (PDT) Received: from pyunyh@gmail.com (lpe4.p59-icn.cdngp.net. [114.111.62.249]) by mx.google.com with ESMTPSA id lh13sm34523855pab.4.2014.03.30.21.25.41 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 30 Mar 2014 21:25:43 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 31 Mar 2014 13:25:35 +0900 From: Yonghyeon PYUN Date: Mon, 31 Mar 2014 13:25:35 +0900 To: John-Mark Gurney Subject: Re: svn commit: r263957 - in head/sys: dev/age dev/alc dev/ale dev/bce dev/bge dev/fxp dev/jme dev/msk dev/nfe dev/sge pci Message-ID: <20140331042535.GA1359@michelle.cdnetworks.com> References: <201403310154.s2V1sxXY010836@svn.freebsd.org> <20140331040058.GV60889@funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140331040058.GV60889@funkthat.com> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 04:25:45 -0000 On Sun, Mar 30, 2014 at 09:00:59PM -0700, John-Mark Gurney wrote: > Pyun YongHyeon wrote this message on Mon, Mar 31, 2014 at 01:54 +0000: > > Author: yongari > > Date: Mon Mar 31 01:54:59 2014 > > New Revision: 263957 > > URL: http://svnweb.freebsd.org/changeset/base/263957 > > > > Log: > > Increase the number of TX DMA segments from 32 to 35. It turned > > out 32 is not enough to support a full sized TSO packet. > > While I'm here fix a long standing bug introduced in r169632 in > > bce(4) where it didn't include L2 header length of TSO packet in > > the maximum DMA segment size calculation. > > I assume all of the hardware supports this increase? > Yes. Data sheet does not mention about such limitation. txp(4) has a limitation on the number of TX segments but I didn't implement TSO in txp(4). > Also, is there a reason to only increase up to 35 and not something > larger, like 64? Is there a memory or performance penalty? > If 64 does not overflow kernel stack we can also bump the number to 64. From owner-svn-src-head@FreeBSD.ORG Mon Mar 31 04:36:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0AE573BE; Mon, 31 Mar 2014 04:36:20 +0000 (UTC) Received: from mail-pd0-x229.google.com (mail-pd0-x229.google.com [IPv6:2607:f8b0:400e:c02::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEDB861B; Mon, 31 Mar 2014 04:36:19 +0000 (UTC) Received: by mail-pd0-f169.google.com with SMTP id fp1so7482777pdb.28 for ; Sun, 30 Mar 2014 21:36:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=KB6o/G/orI7pgPH+03ox0PoiEdn2eYwVlkToxe+Q8So=; b=pjzQXmy3Fjxwxg5mpGe7ErO1V6aPKZObJmtv/Hi+QNDj6Kvt79kcYq4yWM3mqhHz/R EYdLk6Q4P7FHirovWXXhhug3yKdW7jrMJ8l6/54FwfiO0jO/vlIKll1Q3HWSb7GGIRmk 0d1EZD+TJEyWKhf9zTMJKKBDqzxHuVir6HJsWbjL0wPnt56I1DLqpDsGflXNRl116L2M Z3EpsUq4IH83/eEJR0rppAfREYolzXJiUAnv0Ndchdo2k6nFn+UF3zsI59aLrIU6FjDc FSJg+07msvOke1VXDHifsSgjUg2C8KqIN7SxAAfU5wlrI2aZbzyyWIVBNIC3uylhDFgc Mtzw== X-Received: by 10.66.240.130 with SMTP id wa2mr23001332pac.73.1396240579018; Sun, 30 Mar 2014 21:36:19 -0700 (PDT) Received: from pyunyh@gmail.com (lpe4.p59-icn.cdngp.net. [114.111.62.249]) by mx.google.com with ESMTPSA id nc1sm40465086pbc.32.2014.03.30.21.36.16 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 30 Mar 2014 21:36:18 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 31 Mar 2014 13:36:12 +0900 From: Yonghyeon PYUN Date: Mon, 31 Mar 2014 13:36:12 +0900 To: John-Mark Gurney Subject: Re: svn commit: r263957 - in head/sys: dev/age dev/alc dev/ale dev/bce dev/bge dev/fxp dev/jme dev/msk dev/nfe dev/sge pci Message-ID: <20140331043612.GB1359@michelle.cdnetworks.com> References: <201403310154.s2V1sxXY010836@svn.freebsd.org> <20140331040058.GV60889@funkthat.com> <20140331042535.GA1359@michelle.cdnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140331042535.GA1359@michelle.cdnetworks.com> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 04:36:20 -0000 On Mon, Mar 31, 2014 at 01:25:35PM +0900, Yonghyeon PYUN wrote: > On Sun, Mar 30, 2014 at 09:00:59PM -0700, John-Mark Gurney wrote: > > Pyun YongHyeon wrote this message on Mon, Mar 31, 2014 at 01:54 +0000: > > > Author: yongari > > > Date: Mon Mar 31 01:54:59 2014 > > > New Revision: 263957 > > > URL: http://svnweb.freebsd.org/changeset/base/263957 > > > > > > Log: > > > Increase the number of TX DMA segments from 32 to 35. It turned > > > out 32 is not enough to support a full sized TSO packet. > > > While I'm here fix a long standing bug introduced in r169632 in > > > bce(4) where it didn't include L2 header length of TSO packet in > > > the maximum DMA segment size calculation. > > > > I assume all of the hardware supports this increase? > > > > Yes. Data sheet does not mention about such limitation. txp(4) > has a limitation on the number of TX segments but I didn't > implement TSO in txp(4). > > > Also, is there a reason to only increase up to 35 and not something > > larger, like 64? Is there a memory or performance penalty? > > > > If 64 does not overflow kernel stack we can also bump the number to > 64. Hmm, I think I didn't answer on performance penalty. If hardware allows only a single outstanding DMA read operation, having multiple TX buffers would result in lower performance. However it's common to have multiple TX buffers in TSO so I don't think it could change performance number in TSO path. And I think most high end server NICs support multiple outstanding DMA read operation. From owner-svn-src-head@FreeBSD.ORG Mon Mar 31 13:00:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 250A583B; Mon, 31 Mar 2014 13:00:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1233D9ED; Mon, 31 Mar 2014 13:00:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2VD0niP083628; Mon, 31 Mar 2014 13:00:49 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2VD0nVU083627; Mon, 31 Mar 2014 13:00:49 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201403311300.s2VD0nVU083627@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 31 Mar 2014 13:00:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263966 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 13:00:50 -0000 Author: ae Date: Mon Mar 31 13:00:49 2014 New Revision: 263966 URL: http://svnweb.freebsd.org/changeset/base/263966 Log: Don't copy the MF flag from original IP header to ICMP error message. PR: 188092 MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netinet/ip_icmp.c Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Mon Mar 31 09:37:11 2014 (r263965) +++ head/sys/netinet/ip_icmp.c Mon Mar 31 13:00:49 2014 (r263966) @@ -348,6 +348,7 @@ stdreply: icmpelen = max(8, min(V_icmp_q nip->ip_hl = 5; nip->ip_p = IPPROTO_ICMP; nip->ip_tos = 0; + nip->ip_off = 0; icmp_reflect(m); freeit: From owner-svn-src-head@FreeBSD.ORG Mon Mar 31 14:04:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CAADCCC; Mon, 31 Mar 2014 14:04:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28B5F163; Mon, 31 Mar 2014 14:04:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2VE4wMK010932; Mon, 31 Mar 2014 14:04:58 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2VE4vK6010931; Mon, 31 Mar 2014 14:04:57 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201403311404.s2VE4vK6010931@svn.freebsd.org> From: Glen Barber Date: Mon, 31 Mar 2014 14:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263967 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 14:04:58 -0000 Author: gjb Date: Mon Mar 31 14:04:57 2014 New Revision: 263967 URL: http://svnweb.freebsd.org/changeset/base/263967 Log: Document r263140, removal of IPX. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Mar 31 13:00:49 2014 (r263966) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Mar 31 14:04:57 2014 (r263967) @@ -191,7 +191,9 @@ Network Protocols -   + Support for the IPX network transport protocol has + been removed, and will not be supported in &os; 11 + and later releases. From owner-svn-src-head@FreeBSD.ORG Mon Mar 31 14:12:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6873E7A6; Mon, 31 Mar 2014 14:12:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5581726B; Mon, 31 Mar 2014 14:12:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2VECSDo015473; Mon, 31 Mar 2014 14:12:28 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2VECSgs015472; Mon, 31 Mar 2014 14:12:28 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201403311412.s2VECSgs015472@svn.freebsd.org> From: Ed Maste Date: Mon, 31 Mar 2014 14:12:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263968 - head/sys/boot/i386/efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 14:12:28 -0000 Author: emaste Date: Mon Mar 31 14:12:27 2014 New Revision: 263968 URL: http://svnweb.freebsd.org/changeset/base/263968 Log: Merge r246607 by benno from projects/uefi Use EFI types for EFI values (silences warnings). EFI UINTN is actually a 64-bit type on 64-bit processors. Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/i386/efi/main.c Modified: head/sys/boot/i386/efi/main.c ============================================================================== --- head/sys/boot/i386/efi/main.c Mon Mar 31 14:04:57 2014 (r263967) +++ head/sys/boot/i386/efi/main.c Mon Mar 31 14:12:27 2014 (r263968) @@ -273,7 +273,8 @@ COMMAND_SET(mode, "mode", "change or dis static int command_mode(int argc, char *argv[]) { - unsigned int cols, rows, mode; + UINTN cols, rows; + unsigned int mode; int i; char *cp; char rowenv[8]; @@ -327,8 +328,7 @@ command_nvram(int argc, char *argv[]) CHAR16 *data; EFI_STATUS status; EFI_GUID varguid = { 0,0,0,{0,0,0,0,0,0,0,0} }; - unsigned int varsz; - unsigned int datasz; + UINTN varsz, datasz; SIMPLE_TEXT_OUTPUT_INTERFACE *conout; int i; From owner-svn-src-head@FreeBSD.ORG Mon Mar 31 14:27:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C83B15F; Mon, 31 Mar 2014 14:27:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 477645E2; Mon, 31 Mar 2014 14:27:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2VERNJW020551; Mon, 31 Mar 2014 14:27:23 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2VERNXP020550; Mon, 31 Mar 2014 14:27:23 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201403311427.s2VERNXP020550@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 31 Mar 2014 14:27:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263969 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 14:27:23 -0000 Author: ae Date: Mon Mar 31 14:27:22 2014 New Revision: 263969 URL: http://svnweb.freebsd.org/changeset/base/263969 Log: Don't generate an ICMPv6 error message if packet was consumed by filter. MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netinet6/ip6_forward.c Modified: head/sys/netinet6/ip6_forward.c ============================================================================== --- head/sys/netinet6/ip6_forward.c Mon Mar 31 14:12:27 2014 (r263968) +++ head/sys/netinet6/ip6_forward.c Mon Mar 31 14:27:22 2014 (r263969) @@ -564,10 +564,8 @@ skip_routing: odst = ip6->ip6_dst; /* Run through list of hooks for output packets. */ error = pfil_run_hooks(&V_inet6_pfil_hook, &m, rt->rt_ifp, PFIL_OUT, NULL); - if (error != 0) - goto senderr; - if (m == NULL) - goto freecopy; + if (error != 0 || m == NULL) + goto freecopy; /* consumed by filter */ ip6 = mtod(m, struct ip6_hdr *); /* See if destination IP address was changed by packet filter. */ From owner-svn-src-head@FreeBSD.ORG Mon Mar 31 14:40:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05CA39BD; Mon, 31 Mar 2014 14:40:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB0927E6; Mon, 31 Mar 2014 14:40:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2VEeZoo025297; Mon, 31 Mar 2014 14:40:35 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2VEeZY0025296; Mon, 31 Mar 2014 14:40:35 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201403311440.s2VEeZY0025296@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 31 Mar 2014 14:40:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263971 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 14:40:36 -0000 Author: ae Date: Mon Mar 31 14:40:35 2014 New Revision: 263971 URL: http://svnweb.freebsd.org/changeset/base/263971 Log: Remove unused label. MFC after: 1 week Modified: head/sys/netinet6/ip6_forward.c Modified: head/sys/netinet6/ip6_forward.c ============================================================================== --- head/sys/netinet6/ip6_forward.c Mon Mar 31 14:39:56 2014 (r263970) +++ head/sys/netinet6/ip6_forward.c Mon Mar 31 14:40:35 2014 (r263971) @@ -634,7 +634,6 @@ pass: } } -senderr: if (mcopy == NULL) goto out; switch (error) { From owner-svn-src-head@FreeBSD.ORG Mon Mar 31 16:37:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3407C8C; Mon, 31 Mar 2014 16:37:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFC02810; Mon, 31 Mar 2014 16:37:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2VGbgbS074546; Mon, 31 Mar 2014 16:37:42 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2VGbgso074542; Mon, 31 Mar 2014 16:37:42 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201403311637.s2VGbgso074542@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 31 Mar 2014 16:37:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263973 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 16:37:43 -0000 Author: pfg Date: Mon Mar 31 16:37:41 2014 New Revision: 263973 URL: http://svnweb.freebsd.org/changeset/base/263973 Log: ddb: Minor style cleanups. #define should be followed by tab. MFC after: 1 week Modified: head/sys/ddb/db_break.h head/sys/ddb/db_sym.h head/sys/ddb/db_variables.h head/sys/ddb/ddb.h Modified: head/sys/ddb/db_break.h ============================================================================== --- head/sys/ddb/db_break.h Mon Mar 31 14:51:45 2014 (r263972) +++ head/sys/ddb/db_break.h Mon Mar 31 16:37:41 2014 (r263973) @@ -38,7 +38,7 @@ */ #ifndef BKPT_INST_TYPE -#define BKPT_INST_TYPE int +#define BKPT_INST_TYPE int #endif struct db_breakpoint { Modified: head/sys/ddb/db_sym.h ============================================================================== --- head/sys/ddb/db_sym.h Mon Mar 31 14:51:45 2014 (r263972) +++ head/sys/ddb/db_sym.h Mon Mar 31 16:37:41 2014 (r263973) @@ -63,8 +63,8 @@ typedef const char * c_db_sym_t; /* cons typedef int db_strategy_t; /* search strategy */ #define DB_STGY_ANY 0 /* anything goes */ -#define DB_STGY_XTRN 1 /* only external symbols */ -#define DB_STGY_PROC 2 /* only procedures */ +#define DB_STGY_XTRN 1 /* only external symbols */ +#define DB_STGY_PROC 2 /* only procedures */ /* * Functions exported by the symtable module @@ -78,11 +78,11 @@ c_db_sym_t db_search_symbol(db_addr_t, d void db_symbol_values(c_db_sym_t, const char **, db_expr_t *); /* return name and value of symbol */ -#define db_find_sym_and_offset(val,namep,offp) \ +#define db_find_sym_and_offset(val,namep,offp) \ db_symbol_values(db_search_symbol(val,DB_STGY_ANY,offp),namep,0) /* find name&value given approx val */ -#define db_find_xtrn_sym_and_offset(val,namep,offp) \ +#define db_find_xtrn_sym_and_offset(val,namep,offp) \ db_symbol_values(db_search_symbol(val,DB_STGY_XTRN,offp),namep,0) /* ditto, but no locals */ Modified: head/sys/ddb/db_variables.h ============================================================================== --- head/sys/ddb/db_variables.h Mon Mar 31 14:51:45 2014 (r263972) +++ head/sys/ddb/db_variables.h Mon Mar 31 16:37:41 2014 (r263973) @@ -44,8 +44,8 @@ struct db_variable { db_expr_t *valuep; /* value of variable */ /* function to call when reading/writing */ db_varfcn_t *fcn; -#define DB_VAR_GET 0 -#define DB_VAR_SET 1 +#define DB_VAR_GET 0 +#define DB_VAR_SET 1 }; #define FCN_NULL ((db_varfcn_t *)0) Modified: head/sys/ddb/ddb.h ============================================================================== --- head/sys/ddb/ddb.h Mon Mar 31 14:51:45 2014 (r263972) +++ head/sys/ddb/ddb.h Mon Mar 31 16:37:41 2014 (r263973) @@ -118,7 +118,7 @@ struct command { * in modules in which case they will be available only when * the module is loaded. */ -#define _DB_SET(_suffix, _name, _func, list, _flag, _more) \ +#define _DB_SET(_suffix, _name, _func, list, _flag, _more) \ static struct command __CONCAT(_name,_suffix) = { \ .name = __STRING(_name), \ .fcn = _func, \ @@ -145,27 +145,27 @@ SYSUNINIT(__CONCAT(_name,_suffix), SI_SU * This macro is mostly used to define commands placed in one of * the ddb command tables; see DB_COMMAND, etc. below. */ -#define _DB_FUNC(_suffix, _name, _func, list, _flag, _more) \ +#define _DB_FUNC(_suffix, _name, _func, list, _flag, _more) \ static db_cmdfcn_t _func; \ _DB_SET(_suffix, _name, _func, list, _flag, _more); \ static void \ _func(db_expr_t addr, boolean_t have_addr, db_expr_t count, char *modif) /* common idom provided for backwards compatibility */ -#define DB_FUNC(_name, _func, list, _flag, _more) \ +#define DB_FUNC(_name, _func, list, _flag, _more) \ _DB_FUNC(_cmd, _name, _func, list, _flag, _more) -#define DB_COMMAND(cmd_name, func_name) \ +#define DB_COMMAND(cmd_name, func_name) \ _DB_FUNC(_cmd, cmd_name, func_name, db_cmd_table, 0, NULL) -#define DB_ALIAS(alias_name, func_name) \ +#define DB_ALIAS(alias_name, func_name) \ _DB_SET(_cmd, alias_name, func_name, db_cmd_table, 0, NULL) -#define DB_SHOW_COMMAND(cmd_name, func_name) \ +#define DB_SHOW_COMMAND(cmd_name, func_name) \ _DB_FUNC(_show, cmd_name, func_name, db_show_table, 0, NULL) -#define DB_SHOW_ALIAS(alias_name, func_name) \ +#define DB_SHOW_ALIAS(alias_name, func_name) \ _DB_SET(_show, alias_name, func_name, db_show_table, 0, NULL) -#define DB_SHOW_ALL_COMMAND(cmd_name, func_name) \ +#define DB_SHOW_ALL_COMMAND(cmd_name, func_name) \ _DB_FUNC(_show_all, cmd_name, func_name, db_show_all_table, 0, NULL) -#define DB_SHOW_ALL_ALIAS(alias_name, func_name) \ +#define DB_SHOW_ALL_ALIAS(alias_name, func_name) \ _DB_SET(_show_all, alias_name, func_name, db_show_all_table, 0, NULL) extern db_expr_t db_maxoff; From owner-svn-src-head@FreeBSD.ORG Mon Mar 31 17:04:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A71D76B; Mon, 31 Mar 2014 17:04:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74BFEAAA; Mon, 31 Mar 2014 17:04:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2VH4739086657; Mon, 31 Mar 2014 17:04:07 GMT (envelope-from jasone@svn.freebsd.org) Received: (from jasone@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2VH44vp086634; Mon, 31 Mar 2014 17:04:04 GMT (envelope-from jasone@svn.freebsd.org) Message-Id: <201403311704.s2VH44vp086634@svn.freebsd.org> From: Jason Evans Date: Mon, 31 Mar 2014 17:04:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263974 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 17:04:07 -0000 Author: jasone Date: Mon Mar 31 17:04:04 2014 New Revision: 263974 URL: http://svnweb.freebsd.org/changeset/base/263974 Log: Update jemalloc to version 3.6.0. Modified: head/contrib/jemalloc/ChangeLog head/contrib/jemalloc/FREEBSD-diffs head/contrib/jemalloc/VERSION head/contrib/jemalloc/doc/jemalloc.3 head/contrib/jemalloc/include/jemalloc/internal/hash.h head/contrib/jemalloc/include/jemalloc/internal/huge.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h head/contrib/jemalloc/include/jemalloc/jemalloc.h head/contrib/jemalloc/src/arena.c head/contrib/jemalloc/src/huge.c head/contrib/jemalloc/src/jemalloc.c head/contrib/jemalloc/src/prof.c Modified: head/contrib/jemalloc/ChangeLog ============================================================================== --- head/contrib/jemalloc/ChangeLog Mon Mar 31 16:37:41 2014 (r263973) +++ head/contrib/jemalloc/ChangeLog Mon Mar 31 17:04:04 2014 (r263974) @@ -5,6 +5,30 @@ found in the git revision history: https://github.com/jemalloc/jemalloc +* 3.6.0 (March 31, 2014) + + This version contains a critical bug fix for a regression present in 3.5.0 and + 3.5.1. + + Bug fixes: + - Fix a regression in arena_chunk_alloc() that caused crashes during + small/large allocation if chunk allocation failed. In the absence of this + bug, chunk allocation failure would result in allocation failure, e.g. NULL + return from malloc(). This regression was introduced in 3.5.0. + - Fix backtracing for gcc intrinsics-based backtracing by specifying + -fno-omit-frame-pointer to gcc. Note that the application (and all the + libraries it links to) must also be compiled with this option for + backtracing to be reliable. + - Use dss allocation precedence for huge allocations as well as small/large + allocations. + - Fix test assertion failure message formatting. This bug did not manifect on + x86_64 systems because of implementation subtleties in va_list. + - Fix inconsequential test failures for hash and SFMT code. + + New features: + - Support heap profiling on FreeBSD. This feature depends on the proc + filesystem being mounted during heap profile dumping. + * 3.5.1 (February 25, 2014) This version primarily addresses minor bugs in test code. Modified: head/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- head/contrib/jemalloc/FREEBSD-diffs Mon Mar 31 16:37:41 2014 (r263973) +++ head/contrib/jemalloc/FREEBSD-diffs Mon Mar 31 17:04:04 2014 (r263974) @@ -1,5 +1,5 @@ diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in -index c7e2e87..2bd59f0 100644 +index d8e2e71..330ba2a 100644 --- a/doc/jemalloc.xml.in +++ b/doc/jemalloc.xml.in @@ -57,12 +57,23 @@ @@ -27,7 +27,7 @@ index c7e2e87..2bd59f0 100644 Standard API -@@ -2338,4 +2349,19 @@ malloc_conf = "lg_chunk:24";]]> +@@ -2342,4 +2353,19 @@ malloc_conf = "lg_chunk:24";]]> The posix_memalign function conforms to IEEE Std 1003.1-2001 (“POSIX.1”). @@ -48,7 +48,7 @@ index c7e2e87..2bd59f0 100644 + diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in -index d24a1fe..d101c3d 100644 +index 574bbb1..e3eafdf 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in @@ -1,5 +1,8 @@ @@ -100,10 +100,10 @@ index de44e14..564d604 100644 bool malloc_mutex_init(malloc_mutex_t *mutex); diff --git a/include/jemalloc/internal/private_symbols.txt b/include/jemalloc/internal/private_symbols.txt -index 1e64ed5..29ddba3 100644 +index 93516d2..22f9af9 100644 --- a/include/jemalloc/internal/private_symbols.txt +++ b/include/jemalloc/internal/private_symbols.txt -@@ -225,7 +225,6 @@ iralloc +@@ -226,7 +226,6 @@ iralloc iralloct iralloct_realign isalloc @@ -263,7 +263,7 @@ index f943891..47d032c 100755 +#include "jemalloc_FreeBSD.h" EOF diff --git a/src/jemalloc.c b/src/jemalloc.c -index 563d99f..42f97b4 100644 +index 204778b..9e5f2df 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -8,6 +8,10 @@ malloc_tsd_data(, arenas, arena_t *, NULL) Modified: head/contrib/jemalloc/VERSION ============================================================================== --- head/contrib/jemalloc/VERSION Mon Mar 31 16:37:41 2014 (r263973) +++ head/contrib/jemalloc/VERSION Mon Mar 31 17:04:04 2014 (r263974) @@ -1 +1 @@ -3.5.1-0-g7709a64c59daf0b1f938be49472fcc499e1bd136 +3.6.0-0-g46c0af68bd248b04df75e4f92d5fb804c3d75340 Modified: head/contrib/jemalloc/doc/jemalloc.3 ============================================================================== --- head/contrib/jemalloc/doc/jemalloc.3 Mon Mar 31 16:37:41 2014 (r263973) +++ head/contrib/jemalloc/doc/jemalloc.3 Mon Mar 31 17:04:04 2014 (r263974) @@ -2,12 +2,12 @@ .\" Title: JEMALLOC .\" Author: Jason Evans .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 02/25/2014 +.\" Date: 03/31/2014 .\" Manual: User Manual -.\" Source: jemalloc 3.5.1-0-g7709a64c59daf0b1f938be49472fcc499e1bd136 +.\" Source: jemalloc 3.6.0-0-g46c0af68bd248b04df75e4f92d5fb804c3d75340 .\" Language: English .\" -.TH "JEMALLOC" "3" "02/25/2014" "jemalloc 3.5.1-0-g7709a64c59da" "User Manual" +.TH "JEMALLOC" "3" "03/31/2014" "jemalloc 3.6.0-0-g46c0af68bd24" "User Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -31,7 +31,7 @@ jemalloc \- general purpose memory allocation functions .SH "LIBRARY" .PP -This manual describes jemalloc 3\&.5\&.1\-0\-g7709a64c59daf0b1f938be49472fcc499e1bd136\&. More information can be found at the +This manual describes jemalloc 3\&.6\&.0\-0\-g46c0af68bd248b04df75e4f92d5fb804c3d75340\&. More information can be found at the \m[blue]\fBjemalloc website\fR\m[]\&\s-2\u[1]\d\s+2\&. .PP The following configuration options are enabled in libc\*(Aqs built\-in jemalloc: @@ -1035,7 +1035,7 @@ Purge unused dirty pages for arena , "arena\&.\&.dss" (\fBconst char *\fR) rw .RS 4 Set the precedence of dss allocation as related to mmap allocation for arena , or for all arenas if equals -"arenas\&.narenas"\&. See +"arenas\&.narenas"\&. Note that even during huge allocation this setting is read from the arena that would be chosen for small or large allocation so that applications can depend on consistent dss versus mmap allocation regardless of allocation size\&. See "opt\&.dss" for supported settings\&. .RE Modified: head/contrib/jemalloc/include/jemalloc/internal/hash.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/hash.h Mon Mar 31 16:37:41 2014 (r263973) +++ head/contrib/jemalloc/include/jemalloc/internal/hash.h Mon Mar 31 17:04:04 2014 (r263974) @@ -320,7 +320,7 @@ hash_x64_128(const void *key, const int JEMALLOC_INLINE void hash(const void *key, size_t len, const uint32_t seed, size_t r_hash[2]) { -#if (LG_SIZEOF_PTR == 3) +#if (LG_SIZEOF_PTR == 3 && !defined(JEMALLOC_BIG_ENDIAN)) hash_x64_128(key, len, seed, (uint64_t *)r_hash); #else uint64_t hashes[2]; Modified: head/contrib/jemalloc/include/jemalloc/internal/huge.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/huge.h Mon Mar 31 16:37:41 2014 (r263973) +++ head/contrib/jemalloc/include/jemalloc/internal/huge.h Mon Mar 31 17:04:04 2014 (r263974) @@ -17,18 +17,20 @@ extern size_t huge_allocated; /* Protects chunk-related data structures. */ extern malloc_mutex_t huge_mtx; -void *huge_malloc(size_t size, bool zero); -void *huge_palloc(size_t size, size_t alignment, bool zero); +void *huge_malloc(size_t size, bool zero, dss_prec_t dss_prec); +void *huge_palloc(size_t size, size_t alignment, bool zero, + dss_prec_t dss_prec); bool huge_ralloc_no_move(void *ptr, size_t oldsize, size_t size, size_t extra); void *huge_ralloc(void *ptr, size_t oldsize, size_t size, size_t extra, - size_t alignment, bool zero, bool try_tcache_dalloc); + size_t alignment, bool zero, bool try_tcache_dalloc, dss_prec_t dss_prec); #ifdef JEMALLOC_JET typedef void (huge_dalloc_junk_t)(void *, size_t); extern huge_dalloc_junk_t *huge_dalloc_junk; #endif void huge_dalloc(void *ptr, bool unmap); size_t huge_salloc(const void *ptr); +dss_prec_t huge_dss_prec_get(arena_t *arena); prof_ctx_t *huge_prof_ctx_get(const void *ptr); void huge_prof_ctx_set(const void *ptr, prof_ctx_t *ctx); bool huge_boot(void); Modified: head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h Mon Mar 31 16:37:41 2014 (r263973) +++ head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h Mon Mar 31 17:04:04 2014 (r263974) @@ -770,7 +770,7 @@ imalloct(size_t size, bool try_tcache, a if (size <= arena_maxclass) return (arena_malloc(arena, size, false, try_tcache)); else - return (huge_malloc(size, false)); + return (huge_malloc(size, false, huge_dss_prec_get(arena))); } JEMALLOC_ALWAYS_INLINE void * @@ -787,7 +787,7 @@ icalloct(size_t size, bool try_tcache, a if (size <= arena_maxclass) return (arena_malloc(arena, size, true, try_tcache)); else - return (huge_malloc(size, true)); + return (huge_malloc(size, true, huge_dss_prec_get(arena))); } JEMALLOC_ALWAYS_INLINE void * @@ -813,9 +813,9 @@ ipalloct(size_t usize, size_t alignment, ret = arena_palloc(choose_arena(arena), usize, alignment, zero); } else if (alignment <= chunksize) - ret = huge_malloc(usize, zero); + ret = huge_malloc(usize, zero, huge_dss_prec_get(arena)); else - ret = huge_palloc(usize, alignment, zero); + ret = huge_palloc(usize, alignment, zero, huge_dss_prec_get(arena)); } assert(ALIGNMENT_ADDR2BASE(ret, alignment) == ret); @@ -984,7 +984,7 @@ iralloct(void *ptr, size_t size, size_t try_tcache_dalloc)); } else { return (huge_ralloc(ptr, oldsize, size, extra, - alignment, zero, try_tcache_dalloc)); + alignment, zero, try_tcache_dalloc, huge_dss_prec_get(arena))); } } Modified: head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h Mon Mar 31 16:37:41 2014 (r263973) +++ head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h Mon Mar 31 17:04:04 2014 (r263974) @@ -191,6 +191,9 @@ /* C99 restrict keyword supported. */ #define JEMALLOC_HAS_RESTRICT 1 +/* For use by hash code. */ +/* #undef JEMALLOC_BIG_ENDIAN */ + /* sizeof(int) == 2^LG_SIZEOF_INT. */ #define LG_SIZEOF_INT 2 Modified: head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h Mon Mar 31 16:37:41 2014 (r263973) +++ head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h Mon Mar 31 17:04:04 2014 (r263974) @@ -197,6 +197,7 @@ #define huge_boot JEMALLOC_N(huge_boot) #define huge_dalloc JEMALLOC_N(huge_dalloc) #define huge_dalloc_junk JEMALLOC_N(huge_dalloc_junk) +#define huge_dss_prec_get JEMALLOC_N(huge_dss_prec_get) #define huge_malloc JEMALLOC_N(huge_malloc) #define huge_mtx JEMALLOC_N(huge_mtx) #define huge_ndalloc JEMALLOC_N(huge_ndalloc) Modified: head/contrib/jemalloc/include/jemalloc/jemalloc.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/jemalloc.h Mon Mar 31 16:37:41 2014 (r263973) +++ head/contrib/jemalloc/include/jemalloc/jemalloc.h Mon Mar 31 17:04:04 2014 (r263974) @@ -67,12 +67,12 @@ extern "C" { #include #include -#define JEMALLOC_VERSION "3.5.1-0-g7709a64c59daf0b1f938be49472fcc499e1bd136" +#define JEMALLOC_VERSION "3.6.0-0-g46c0af68bd248b04df75e4f92d5fb804c3d75340" #define JEMALLOC_VERSION_MAJOR 3 -#define JEMALLOC_VERSION_MINOR 5 -#define JEMALLOC_VERSION_BUGFIX 1 +#define JEMALLOC_VERSION_MINOR 6 +#define JEMALLOC_VERSION_BUGFIX 0 #define JEMALLOC_VERSION_NREV 0 -#define JEMALLOC_VERSION_GID "7709a64c59daf0b1f938be49472fcc499e1bd136" +#define JEMALLOC_VERSION_GID "46c0af68bd248b04df75e4f92d5fb804c3d75340" # define MALLOCX_LG_ALIGN(la) (la) # if LG_SIZEOF_PTR == 2 Modified: head/contrib/jemalloc/src/arena.c ============================================================================== --- head/contrib/jemalloc/src/arena.c Mon Mar 31 16:37:41 2014 (r263973) +++ head/contrib/jemalloc/src/arena.c Mon Mar 31 17:04:04 2014 (r263974) @@ -614,8 +614,11 @@ arena_chunk_alloc(arena_t *arena) if (arena->spare != NULL) chunk = arena_chunk_init_spare(arena); - else + else { chunk = arena_chunk_init_hard(arena); + if (chunk == NULL) + return (NULL); + } /* Insert the run into the runs_avail tree. */ arena_avail_insert(arena, chunk, map_bias, chunk_npages-map_bias, Modified: head/contrib/jemalloc/src/huge.c ============================================================================== --- head/contrib/jemalloc/src/huge.c Mon Mar 31 16:37:41 2014 (r263973) +++ head/contrib/jemalloc/src/huge.c Mon Mar 31 17:04:04 2014 (r263974) @@ -16,14 +16,14 @@ malloc_mutex_t huge_mtx; static extent_tree_t huge; void * -huge_malloc(size_t size, bool zero) +huge_malloc(size_t size, bool zero, dss_prec_t dss_prec) { - return (huge_palloc(size, chunksize, zero)); + return (huge_palloc(size, chunksize, zero, dss_prec)); } void * -huge_palloc(size_t size, size_t alignment, bool zero) +huge_palloc(size_t size, size_t alignment, bool zero, dss_prec_t dss_prec) { void *ret; size_t csize; @@ -48,8 +48,7 @@ huge_palloc(size_t size, size_t alignmen * it is possible to make correct junk/zero fill decisions below. */ is_zeroed = zero; - ret = chunk_alloc(csize, alignment, false, &is_zeroed, - chunk_dss_prec_get()); + ret = chunk_alloc(csize, alignment, false, &is_zeroed, dss_prec); if (ret == NULL) { base_node_dealloc(node); return (NULL); @@ -98,7 +97,7 @@ huge_ralloc_no_move(void *ptr, size_t ol void * huge_ralloc(void *ptr, size_t oldsize, size_t size, size_t extra, - size_t alignment, bool zero, bool try_tcache_dalloc) + size_t alignment, bool zero, bool try_tcache_dalloc, dss_prec_t dss_prec) { void *ret; size_t copysize; @@ -113,18 +112,18 @@ huge_ralloc(void *ptr, size_t oldsize, s * space and copying. */ if (alignment > chunksize) - ret = huge_palloc(size + extra, alignment, zero); + ret = huge_palloc(size + extra, alignment, zero, dss_prec); else - ret = huge_malloc(size + extra, zero); + ret = huge_malloc(size + extra, zero, dss_prec); if (ret == NULL) { if (extra == 0) return (NULL); /* Try again, this time without extra. */ if (alignment > chunksize) - ret = huge_palloc(size, alignment, zero); + ret = huge_palloc(size, alignment, zero, dss_prec); else - ret = huge_malloc(size, zero); + ret = huge_malloc(size, zero, dss_prec); if (ret == NULL) return (NULL); @@ -264,6 +263,13 @@ huge_salloc(const void *ptr) return (ret); } +dss_prec_t +huge_dss_prec_get(arena_t *arena) +{ + + return (arena_dss_prec_get(choose_arena(arena))); +} + prof_ctx_t * huge_prof_ctx_get(const void *ptr) { Modified: head/contrib/jemalloc/src/jemalloc.c ============================================================================== --- head/contrib/jemalloc/src/jemalloc.c Mon Mar 31 16:37:41 2014 (r263973) +++ head/contrib/jemalloc/src/jemalloc.c Mon Mar 31 17:04:04 2014 (r263974) @@ -2081,7 +2081,7 @@ a0alloc(size_t size, bool zero) if (size <= arena_maxclass) return (arena_malloc(arenas[0], size, zero, false)); else - return (huge_malloc(size, zero)); + return (huge_malloc(size, zero, huge_dss_prec_get(arenas[0]))); } void * Modified: head/contrib/jemalloc/src/prof.c ============================================================================== --- head/contrib/jemalloc/src/prof.c Mon Mar 31 16:37:41 2014 (r263973) +++ head/contrib/jemalloc/src/prof.c Mon Mar 31 17:04:04 2014 (r263974) @@ -935,9 +935,12 @@ prof_dump_maps(bool propagate_err) char filename[PATH_MAX + 1]; cassert(config_prof); - +#ifdef __FreeBSD__ + malloc_snprintf(filename, sizeof(filename), "/proc/curproc/map"); +#else malloc_snprintf(filename, sizeof(filename), "/proc/%d/maps", (int)getpid()); +#endif mfd = open(filename, O_RDONLY); if (mfd != -1) { ssize_t nread; From owner-svn-src-head@FreeBSD.ORG Mon Mar 31 19:37:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF44AA1C; Mon, 31 Mar 2014 19:37:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC6D6BBE; Mon, 31 Mar 2014 19:37:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2VJbdun049121; Mon, 31 Mar 2014 19:37:39 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2VJbdBZ049120; Mon, 31 Mar 2014 19:37:39 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403311937.s2VJbdBZ049120@svn.freebsd.org> From: Warner Losh Date: Mon, 31 Mar 2014 19:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263975 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 19:37:39 -0000 Author: imp Date: Mon Mar 31 19:37:39 2014 New Revision: 263975 URL: http://svnweb.freebsd.org/changeset/base/263975 Log: Turns out name was used here when ACPI_DEBUG was defined, so refine my previous patch. Modified: head/sys/dev/acpica/acpi_resource.c Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Mon Mar 31 17:04:04 2014 (r263974) +++ head/sys/dev/acpica/acpi_resource.c Mon Mar 31 19:37:39 2014 (r263975) @@ -183,6 +183,9 @@ acpi_parse_resource(ACPI_RESOURCE *res, struct acpi_parse_resource_set *set; struct acpi_resource_context *arc; UINT64 min, max, length, gran; +#ifdef ACPI_DEBUG + const char *name; +#endif device_t dev; arc = context; @@ -299,18 +302,27 @@ acpi_parse_resource(ACPI_RESOURCE *res, min = res->Data.Address16.Minimum; max = res->Data.Address16.Maximum; length = res->Data.Address16.AddressLength; +#ifdef ACPI_DEBUG + name = "Address16"; +#endif break; case ACPI_RESOURCE_TYPE_ADDRESS32: gran = res->Data.Address32.Granularity; min = res->Data.Address32.Minimum; max = res->Data.Address32.Maximum; length = res->Data.Address32.AddressLength; +#ifdef ACPI_DEBUG + name = "Address32"; +#endif break; case ACPI_RESOURCE_TYPE_ADDRESS64: gran = res->Data.Address64.Granularity; min = res->Data.Address64.Minimum; max = res->Data.Address64.Maximum; length = res->Data.Address64.AddressLength; +#ifdef ACPI_DEBUG + name = "Address64"; +#endif break; default: KASSERT(res->Type == ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64, @@ -319,6 +331,9 @@ acpi_parse_resource(ACPI_RESOURCE *res, min = res->Data.ExtAddress64.Minimum; max = res->Data.ExtAddress64.Maximum; length = res->Data.ExtAddress64.AddressLength; +#ifdef ACPI_DEBUG + name = "ExtAddress64"; +#endif break; } if (length <= 0) From owner-svn-src-head@FreeBSD.ORG Mon Mar 31 20:49:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C46D7773; Mon, 31 Mar 2014 20:49:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B13B9313; Mon, 31 Mar 2014 20:49:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2VKnXk6079030; Mon, 31 Mar 2014 20:49:33 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2VKnXLr079029; Mon, 31 Mar 2014 20:49:33 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403312049.s2VKnXLr079029@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 31 Mar 2014 20:49:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263978 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 20:49:33 -0000 Author: trasz Date: Mon Mar 31 20:49:33 2014 New Revision: 263978 URL: http://svnweb.freebsd.org/changeset/base/263978 Log: Make it possible to have multiple CTL worker threads. Leave the default of 1 for now. Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Mon Mar 31 19:58:08 2014 (r263977) +++ head/sys/cam/ctl/ctl.c Mon Mar 31 20:49:33 2014 (r263978) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -320,6 +321,10 @@ static int ctl_is_single = 1; static int index_to_aps_page; SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); +static int worker_threads = 1; +TUNABLE_INT("kern.cam.ctl.worker_threads", &worker_threads); +SYSCTL_INT(_kern_cam_ctl, OID_AUTO, worker_threads, CTLFLAG_RDTUN, + &worker_threads, 1, "Number of worker threads"); /* * Serial number (0x80), device id (0x83), and supported pages (0x00) @@ -950,10 +955,7 @@ ctl_init(void) struct ctl_frontend *fe; struct ctl_lun *lun; uint8_t sc_id =0; -#if 0 - int i; -#endif - int error, retval; + int i, error, retval; //int isc_retval; retval = 0; @@ -1085,17 +1087,35 @@ ctl_init(void) mtx_unlock(&softc->ctl_lock); #endif - error = kproc_create(ctl_work_thread, softc, &softc->work_thread, 0, 0, - "ctl_thrd"); - if (error != 0) { - printf("error creating CTL work thread!\n"); - mtx_lock(&softc->ctl_lock); - ctl_free_lun(lun); - mtx_unlock(&softc->ctl_lock); - ctl_pool_free(internal_pool); - ctl_pool_free(emergency_pool); - ctl_pool_free(other_pool); - return (error); + if (worker_threads > MAXCPU || worker_threads == 0) { + printf("invalid kern.cam.ctl.worker_threads value; " + "setting to 1"); + worker_threads = 1; + } else if (worker_threads < 0) { + if (mp_ncpus > 2) { + /* + * Using more than two worker threads actually hurts + * performance due to lock contention. + */ + worker_threads = 2; + } else { + worker_threads = 1; + } + } + + for (i = 0; i < worker_threads; i++) { + error = kproc_create(ctl_work_thread, softc, &softc->work_thread, 0, 0, + "ctl_thrd%d", i); + if (error != 0) { + printf("error creating CTL work thread!\n"); + mtx_lock(&softc->ctl_lock); + ctl_free_lun(lun); + mtx_unlock(&softc->ctl_lock); + ctl_pool_free(internal_pool); + ctl_pool_free(emergency_pool); + ctl_pool_free(other_pool); + return (error); + } } if (bootverbose) printf("ctl: CAM Target Layer loaded\n"); @@ -12991,7 +13011,11 @@ ctl_work_thread(void *arg) if (io != NULL) { STAILQ_REMOVE_HEAD(&softc->rtr_queue, links); mtx_unlock(&softc->ctl_lock); - goto execute; + retval = ctl_scsiio(&io->scsiio); + if (retval != CTL_RETVAL_COMPLETE) + CTL_DEBUG_PRINT(("ctl_scsiio failed\n")); + mtx_lock(&softc->ctl_lock); + continue; } } io = (union ctl_io *)STAILQ_FIRST(&softc->incoming_queue); @@ -13022,19 +13046,6 @@ ctl_work_thread(void *arg) /* Back to the top of the loop to see what woke us up. */ continue; - -execute: - retval = ctl_scsiio(&io->scsiio); - switch (retval) { - case CTL_RETVAL_COMPLETE: - break; - default: - /* - * Probably need to make sure this doesn't happen. - */ - break; - } - mtx_lock(&softc->ctl_lock); } } From owner-svn-src-head@FreeBSD.ORG Mon Mar 31 20:49:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB7258A5; Mon, 31 Mar 2014 20:49:46 +0000 (UTC) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E685A31B; Mon, 31 Mar 2014 20:49:45 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.7/8.14.7) with ESMTP id s2VKnbRW061652; Mon, 31 Mar 2014 15:49:37 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.7/8.14.7/Submit) id s2VKnb5h061651; Mon, 31 Mar 2014 15:49:37 -0500 (CDT) (envelope-from brooks) Date: Mon, 31 Mar 2014 15:49:37 -0500 From: Brooks Davis To: Warner Losh Subject: Re: svn commit: r263949 - head Message-ID: <20140331204937.GC23094@lor.one-eyed-alien.net> References: <201403302224.s2UMObJV013704@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XMCwj5IQnwKtuyBG" Content-Disposition: inline In-Reply-To: <201403302224.s2UMObJV013704@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 20:49:46 -0000 --XMCwj5IQnwKtuyBG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 30, 2014 at 10:24:37PM +0000, Warner Losh wrote: > Author: imp > Date: Sun Mar 30 22:24:37 2014 > New Revision: 263949 > URL: http://svnweb.freebsd.org/changeset/base/263949 >=20 > Log: > When building g++, we need to build libsupc earlier to avoid a race > with libproc. Not sure why people didn't see this before now, but I > get it often for higher (20-30) -j builds, but never for -j1 builds. Thanks Warner! I bumped into this on Friday afternoon and didn't quite get to the point of characterizing it. -- Brooks --XMCwj5IQnwKtuyBG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iKYEARECAGYFAlM51OBfFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl bnBncC5maWZ0aGhvcnNlbWFuLm5ldDY1NUQ1MTlDMjZBNzgyRTcyNTI5OUJGMDVE OEU4QkU5RjIzODFBRDQACgkQXY6L6fI4GtRSbgCfTJX29Kmj5kar+quGfhXdEUWe ysQAoMAPYcaHv4JxxpTC7X3Xmln8hep5 =VoTa -----END PGP SIGNATURE----- --XMCwj5IQnwKtuyBG-- From owner-svn-src-head@FreeBSD.ORG Mon Mar 31 21:04:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07769C8A; Mon, 31 Mar 2014 21:04:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E89D8689; Mon, 31 Mar 2014 21:04:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2VL4FuD086646; Mon, 31 Mar 2014 21:04:15 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2VL4FUS086645; Mon, 31 Mar 2014 21:04:15 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201403312104.s2VL4FUS086645@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 31 Mar 2014 21:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263979 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 21:04:16 -0000 Author: trasz Date: Mon Mar 31 21:04:15 2014 New Revision: 263979 URL: http://svnweb.freebsd.org/changeset/base/263979 Log: Hide CTL messages about SCSI error responses. Too many users take them for actual target errors. They can be enabled back by setting kern.cam.ctl.verbose=1, or booting with bootverbose. Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Mon Mar 31 20:49:33 2014 (r263978) +++ head/sys/cam/ctl/ctl.c Mon Mar 31 21:04:15 2014 (r263979) @@ -325,6 +325,10 @@ static int worker_threads = 1; TUNABLE_INT("kern.cam.ctl.worker_threads", &worker_threads); SYSCTL_INT(_kern_cam_ctl, OID_AUTO, worker_threads, CTLFLAG_RDTUN, &worker_threads, 1, "Number of worker threads"); +static int verbose = 0; +TUNABLE_INT("kern.cam.ctl.verbose", &verbose); +SYSCTL_INT(_kern_cam_ctl, OID_AUTO, verbose, CTLFLAG_RWTUN, + &verbose, 0, "Show SCSI errors returned to initiator"); /* * Serial number (0x80), device id (0x83), and supported pages (0x00) @@ -12349,7 +12353,8 @@ ctl_process_done(union ctl_io *io, int h case CTL_IO_SCSI: break; case CTL_IO_TASK: - ctl_io_error_print(io, NULL); + if (bootverbose || verbose > 0) + ctl_io_error_print(io, NULL); if (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) ctl_free_io(io); else @@ -12605,7 +12610,8 @@ ctl_process_done(union ctl_io *io, int h "skipped", skipped_prints); #endif } - ctl_io_error_print(io, NULL); + if (bootverbose || verbose > 0) + ctl_io_error_print(io, NULL); } } else { if (have_lock == 0) @@ -12616,7 +12622,8 @@ ctl_process_done(union ctl_io *io, int h case CTL_IO_TASK: if (have_lock == 0) mtx_unlock(&ctl_softc->ctl_lock); - ctl_io_error_print(io, NULL); + if (bootverbose || verbose > 0) + ctl_io_error_print(io, NULL); break; default: if (have_lock == 0) From owner-svn-src-head@FreeBSD.ORG Mon Mar 31 21:14:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A2C41B3; Mon, 31 Mar 2014 21:14:30 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C2647EC; Mon, 31 Mar 2014 21:14:30 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9A679B918; Mon, 31 Mar 2014 17:14:25 -0400 (EDT) From: John Baldwin To: Takanori Watanabe Subject: Re: svn commit: r263859 - head/sys/x86/acpica Date: Mon, 31 Mar 2014 11:37:02 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201403280238.s2S2cEQS020827@svn.freebsd.org> In-Reply-To: <201403280238.s2S2cEQS020827@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201403311137.02232.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 31 Mar 2014 17:14:25 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 21:14:30 -0000 On Thursday, March 27, 2014 10:38:14 pm Takanori Watanabe wrote: > Author: takawata > Date: Fri Mar 28 02:38:14 2014 > New Revision: 263859 > URL: http://svnweb.freebsd.org/changeset/base/263859 > > Log: > Change default logic to CONFORM because this routine is shared > with SCI polarity setting. > > Reviewed by: jhb Thanks! -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 00:01:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7207D598; Tue, 1 Apr 2014 00:01:50 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.glenbarber.us", Issuer "RapidSSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9B9E7DA; Tue, 1 Apr 2014 00:01:49 +0000 (UTC) Received: from glenbarber.us (70.15.88.86.res-cmts.sewb.ptd.net [70.15.88.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 161F87E2A; Tue, 1 Apr 2014 00:01:32 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 161F87E2A Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Mon, 31 Mar 2014 20:01:30 -0400 From: Glen Barber To: src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: svn commit: r263979 - in head: . contrib usr.bin Message-ID: <20140401000130.GC21299@glenbarber.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-SVN-Group: head X-SVN-Alt-Group: fake X-Happy-April-First: sorry-could-not-resist User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 00:01:50 -0000 Author: gjb Date: Tue Apr 1 00:01:56 2014 New Revision: 263979 URL: http://svnweb.freebsd.org/changeset/base/263979 Log: Import ruby19. Added: head/contrib/ruby19/enc/make_encmake.rb head/contrib/ruby19/enc/prelude.rb head/contrib/ruby19/enc/shift_jis.c head/contrib/ruby19/enc/utf_8.c head/contrib/ruby19/enc/big5.c head/contrib/ruby19/enc/euc_tw.c head/contrib/ruby19/enc/unicode.c head/contrib/ruby19/enc/iso_8859_10.c head/contrib/ruby19/enc/iso_8859_11.c head/contrib/ruby19/enc/ascii.c head/contrib/ruby19/enc/utf_7.h head/contrib/ruby19/enc/iso_8859_13.c head/contrib/ruby19/enc/iso_8859_14.c head/contrib/ruby19/enc/iso_8859_15.c head/contrib/ruby19/enc/iso_8859_16.c head/contrib/ruby19/enc/us_ascii.c head/contrib/ruby19/enc/gb2312.c head/contrib/ruby19/enc/windows_1251.c head/contrib/ruby19/enc/trans/iso2022.c head/contrib/ruby19/enc/trans/JIS/JISX0208UDC%UCS.src head/contrib/ruby19/enc/trans/JIS/UCS%JISX0208UDC.src head/contrib/ruby19/enc/trans/JIS/JISX0208@MS%UCS.src head/contrib/ruby19/enc/trans/JIS/UCS%JISX0208@MS.src head/contrib/ruby19/enc/trans/JIS/JISX0201-KANA%UCS.src head/contrib/ruby19/enc/trans/JIS/UCS%JISX0201-KANA.src head/contrib/ruby19/enc/trans/JIS/UCS%JISX0212VDC@IBM.src head/contrib/ruby19/enc/trans/JIS/JISX0212VDC@IBM%UCS.src head/contrib/ruby19/enc/trans/JIS/JISX0208@1990%UCS.src head/contrib/ruby19/enc/trans/JIS/JISX0208VDC@NEC%UCS.src head/contrib/ruby19/enc/trans/JIS/UCS%JISX0208@1990.src head/contrib/ruby19/enc/trans/JIS/UCS%JISX0208VDC@NEC.src head/contrib/ruby19/enc/trans/JIS/JISX0212UDC%UCS.src head/contrib/ruby19/enc/trans/JIS/UCS%JISX0212UDC.src head/contrib/ruby19/enc/trans/JIS/JISX0212%UCS.src head/contrib/ruby19/enc/trans/JIS/JISX0212@MS%UCS.src head/contrib/ruby19/enc/trans/JIS/UCS%JISX0212.src head/contrib/ruby19/enc/trans/JIS/UCS%JISX0212@MS.src head/contrib/ruby19/enc/trans/iso-8859-2-tbl.rb head/contrib/ruby19/enc/trans/single_byte.c head/contrib/ruby19/enc/trans/iso2022.trans head/contrib/ruby19/enc/trans/ibm860-tbl.rb head/contrib/ruby19/enc/trans/GB/GB12345%UCS.src head/contrib/ruby19/enc/trans/GB/UCS%GB12345.src head/contrib/ruby19/enc/trans/GB/GB2312%UCS.src head/contrib/ruby19/enc/trans/GB/UCS%GB2312.src head/contrib/ruby19/enc/trans/iso-8859-6-tbl.rb head/contrib/ruby19/enc/trans/ibm737-tbl.rb head/contrib/ruby19/enc/trans/single_byte.trans head/contrib/ruby19/enc/trans/koi8-u-tbl.rb head/contrib/ruby19/enc/trans/macukraine-tbl.rb head/contrib/ruby19/enc/trans/windows-1252-tbl.rb head/contrib/ruby19/enc/trans/maccroatian-tbl.rb head/contrib/ruby19/enc/trans/CP/CP932VDC@IBM%UCS.src head/contrib/ruby19/enc/trans/CP/UCS%CP932VDC@IBM.src head/contrib/ruby19/enc/trans/CP/CP932UDA%UCS.src head/contrib/ruby19/enc/trans/CP/CP932VDC@NEC_IBM%UCS.src head/contrib/ruby19/enc/trans/CP/UCS%CP932UDA.src head/contrib/ruby19/enc/trans/CP/UCS%CP932VDC@NEC_IBM.src head/contrib/ruby19/enc/trans/EMOJI/EMOJI_SHIFT_JIS-KDDI%UCS.src head/contrib/ruby19/enc/trans/EMOJI/UCS%EMOJI_SHIFT_JIS-KDDI.src head/contrib/ruby19/enc/trans/EMOJI/EMOJI_ISO-2022-JP-KDDI%UCS.src head/contrib/ruby19/enc/trans/EMOJI/UCS%EMOJI_ISO-2022-JP-KDDI.src head/contrib/ruby19/enc/trans/EMOJI/EMOJI_SHIFT_JIS-DOCOMO%UCS.src head/contrib/ruby19/enc/trans/EMOJI/UCS%EMOJI_SHIFT_JIS-DOCOMO.src head/contrib/ruby19/enc/trans/EMOJI/EMOJI_SHIFT_JIS-KDDI-UNDOC%UCS.src head/contrib/ruby19/enc/trans/EMOJI/UCS%EMOJI_SHIFT_JIS-KDDI-UNDOC.src head/contrib/ruby19/enc/trans/EMOJI/UCS%EMOJI_ISO-2022-JP-KDDI-UNDOC.src head/contrib/ruby19/enc/trans/EMOJI/EMOJI_SHIFT_JIS-SOFTBANK%UCS.src head/contrib/ruby19/enc/trans/EMOJI/UCS%EMOJI_SHIFT_JIS-SOFTBANK.src head/contrib/ruby19/enc/trans/emoji-exchange-tbl.rb head/contrib/ruby19/enc/trans/iso-8859-11-tbl.rb head/contrib/ruby19/enc/trans/gb18030-tbl.rb head/contrib/ruby19/enc/trans/windows-1256-tbl.rb head/contrib/ruby19/enc/trans/iso-8859-15-tbl.rb head/contrib/ruby19/enc/trans/cp852-tbl.rb head/contrib/ruby19/enc/trans/newline.c head/contrib/ruby19/enc/trans/iso-8859-1-tbl.rb head/contrib/ruby19/enc/trans/ibm437-tbl.rb head/contrib/ruby19/enc/trans/newline.trans head/contrib/ruby19/enc/trans/iso-8859-5-tbl.rb head/contrib/ruby19/enc/trans/utf_16_32.c head/contrib/ruby19/enc/trans/ibm863-tbl.rb head/contrib/ruby19/enc/trans/euckr-tbl.rb head/contrib/ruby19/enc/trans/macturkish-tbl.rb head/contrib/ruby19/enc/trans/ibm857-tbl.rb head/contrib/ruby19/enc/trans/iso-8859-9-tbl.rb head/contrib/ruby19/enc/trans/utf_16_32.trans head/contrib/ruby19/enc/trans/emoji_iso2022_kddi.c head/contrib/ruby19/enc/trans/korean.c head/contrib/ruby19/enc/trans/windows-1251-tbl.rb head/contrib/ruby19/enc/trans/emoji_sjis_softbank.c head/contrib/ruby19/enc/trans/iso-8859-10-tbl.rb head/contrib/ruby19/enc/trans/emoji_iso2022_kddi.trans head/contrib/ruby19/enc/trans/windows-1255-tbl.rb head/contrib/ruby19/enc/trans/korean.trans head/contrib/ruby19/enc/trans/emoji_sjis_kddi.c head/contrib/ruby19/enc/trans/iso-8859-14-tbl.rb head/contrib/ruby19/enc/trans/emoji_sjis_softbank.trans head/contrib/ruby19/enc/trans/maccyrillic-tbl.rb head/contrib/ruby19/enc/trans/emoji_sjis_kddi.trans head/contrib/ruby19/enc/trans/emoji_sjis_docomo.c head/contrib/ruby19/enc/trans/transdb.c head/contrib/ruby19/enc/trans/emoji_sjis_docomo.trans head/contrib/ruby19/enc/trans/gbk-tbl.rb head/contrib/ruby19/enc/trans/gbk.c head/contrib/ruby19/enc/trans/emoji.c head/contrib/ruby19/enc/trans/tis-620-tbl.rb head/contrib/ruby19/enc/trans/cp855-tbl.rb head/contrib/ruby19/enc/trans/ibm852-tbl.rb head/contrib/ruby19/enc/trans/iso-8859-4-tbl.rb head/contrib/ruby19/enc/trans/utf8_mac-tbl.rb head/contrib/ruby19/enc/trans/ibm862-tbl.rb head/contrib/ruby19/enc/trans/gbk.trans head/contrib/ruby19/enc/trans/big5-uao-tbl.rb head/contrib/ruby19/enc/trans/emoji.trans head/contrib/ruby19/enc/trans/windows-874-tbl.rb head/contrib/ruby19/enc/trans/ibm775-tbl.rb head/contrib/ruby19/enc/trans/iso-8859-8-tbl.rb head/contrib/ruby19/enc/trans/ibm866-tbl.rb head/contrib/ruby19/enc/trans/chinese.c head/contrib/ruby19/enc/trans/windows-1250-tbl.rb head/contrib/ruby19/enc/trans/chinese.trans head/contrib/ruby19/enc/trans/windows-1254-tbl.rb head/contrib/ruby19/enc/trans/japanese.c head/contrib/ruby19/enc/trans/iso-8859-13-tbl.rb head/contrib/ruby19/enc/trans/japanese.trans head/contrib/ruby19/enc/trans/big5-hkscs-tbl.rb head/contrib/ruby19/enc/trans/cp850-tbl.rb head/contrib/ruby19/enc/trans/escape.c head/contrib/ruby19/enc/trans/ucm/windows-950_hkscs-2001.ucm head/contrib/ruby19/enc/trans/ucm/glibc-BIG5HKSCS-2.3.3.ucm head/contrib/ruby19/enc/trans/ucm/windows-950-2000.ucm head/contrib/ruby19/enc/trans/ucm/glibc-BIG5-2.3.3.ucm head/contrib/ruby19/enc/trans/iso-8859-3-tbl.rb head/contrib/ruby19/enc/trans/escape.trans head/contrib/ruby19/enc/trans/ibm861-tbl.rb head/contrib/ruby19/enc/trans/utf8_mac.c head/contrib/ruby19/enc/trans/macromania-tbl.rb head/contrib/ruby19/enc/trans/cp949-tbl.rb head/contrib/ruby19/enc/trans/koi8-r-tbl.rb head/contrib/ruby19/enc/trans/ibm855-tbl.rb head/contrib/ruby19/enc/trans/iso-8859-7-tbl.rb head/contrib/ruby19/enc/trans/ibm865-tbl.rb head/contrib/ruby19/enc/trans/utf8_mac.trans head/contrib/ruby19/enc/trans/ibm869-tbl.rb head/contrib/ruby19/enc/trans/macgreek-tbl.rb head/contrib/ruby19/enc/trans/japanese_sjis.c head/contrib/ruby19/enc/trans/maciceland-tbl.rb head/contrib/ruby19/enc/trans/windows-1253-tbl.rb head/contrib/ruby19/enc/trans/japanese_euc.c head/contrib/ruby19/enc/trans/japanese_sjis.trans head/contrib/ruby19/enc/trans/gb18030.c head/contrib/ruby19/enc/trans/windows-1257-tbl.rb head/contrib/ruby19/enc/trans/big5.c head/contrib/ruby19/enc/trans/japanese_euc.trans head/contrib/ruby19/enc/trans/gb18030.trans head/contrib/ruby19/enc/trans/big5.trans head/contrib/ruby19/enc/trans/macroman-tbl.rb head/contrib/ruby19/enc/iso_8859_1.c head/contrib/ruby19/enc/iso_8859_2.c head/contrib/ruby19/enc/euc_kr.c head/contrib/ruby19/enc/iso_8859_3.c head/contrib/ruby19/enc/utf_32be.c head/contrib/ruby19/enc/iso_8859_4.c head/contrib/ruby19/enc/emacs_mule.c head/contrib/ruby19/enc/iso_8859_5.c head/contrib/ruby19/enc/utf_16be.c head/contrib/ruby19/enc/iso_8859_6.c head/contrib/ruby19/enc/utf_16_32.h head/contrib/ruby19/enc/iso_8859_7.c head/contrib/ruby19/enc/depend head/contrib/ruby19/enc/iso_8859_8.c head/contrib/ruby19/enc/iso_8859_9.c head/contrib/ruby19/enc/utf_32le.c head/contrib/ruby19/enc/gb18030.c head/contrib/ruby19/enc/utf_16le.c head/contrib/ruby19/enc/koi8_r.c head/contrib/ruby19/enc/iso_2022_jp.h head/contrib/ruby19/enc/koi8_u.c head/contrib/ruby19/enc/x_emoji.h head/contrib/ruby19/enc/Makefile.in head/contrib/ruby19/enc/gbk.c head/contrib/ruby19/enc/unicode/name2ctype.kwd head/contrib/ruby19/enc/unicode/name2ctype.h head/contrib/ruby19/enc/unicode/name2ctype.h.blt head/contrib/ruby19/enc/unicode/name2ctype.src head/contrib/ruby19/enc/euc_jp.c head/contrib/ruby19/enc/cp949.c head/contrib/ruby19/enc/encdb.c head/contrib/ruby19/sprintf.c head/contrib/ruby19/method.h head/contrib/ruby19/inits.c head/contrib/ruby19/golf_prelude.rb head/contrib/ruby19/vsnprintf.c head/contrib/ruby19/NEWS head/contrib/ruby19/constant.h head/contrib/ruby19/proc.c head/contrib/ruby19/regenc.c head/contrib/ruby19/addr2line.c head/contrib/ruby19/regenc.h head/contrib/ruby19/rational.c head/contrib/ruby19/vm_insnhelper.c head/contrib/ruby19/addr2line.h head/contrib/ruby19/eval_intern.h head/contrib/ruby19/README head/contrib/ruby19/vm_insnhelper.h head/contrib/ruby19/process.c head/contrib/ruby19/thread_pthread.c head/contrib/ruby19/known_errors.inc head/contrib/ruby19/cygwin/GNUmakefile.in head/contrib/ruby19/insns.inc head/contrib/ruby19/vm.c head/contrib/ruby19/regexec.c head/contrib/ruby19/thread_pthread.h head/contrib/ruby19/main.c head/contrib/ruby19/lib/uri/generic.rb head/contrib/ruby19/lib/uri/http.rb head/contrib/ruby19/lib/uri/ldap.rb head/contrib/ruby19/lib/uri/https.rb head/contrib/ruby19/lib/uri/ldaps.rb head/contrib/ruby19/lib/uri/mailto.rb head/contrib/ruby19/lib/uri/common.rb head/contrib/ruby19/lib/uri/ftp.rb head/contrib/ruby19/lib/optparse.rb head/contrib/ruby19/lib/uri.rb head/contrib/ruby19/lib/cgi/session.rb head/contrib/ruby19/lib/cgi/html.rb head/contrib/ruby19/lib/cgi/core.rb head/contrib/ruby19/lib/cgi/cookie.rb head/contrib/ruby19/lib/cgi/util.rb head/contrib/ruby19/lib/cgi/session/pstore.rb head/contrib/ruby19/lib/yaml.rb head/contrib/ruby19/lib/xmlrpc/datetime.rb head/contrib/ruby19/lib/xmlrpc/parser.rb head/contrib/ruby19/lib/xmlrpc/client.rb head/contrib/ruby19/lib/xmlrpc/utils.rb head/contrib/ruby19/lib/xmlrpc/README.rdoc head/contrib/ruby19/lib/xmlrpc/create.rb head/contrib/ruby19/lib/xmlrpc/base64.rb head/contrib/ruby19/lib/xmlrpc/config.rb head/contrib/ruby19/lib/xmlrpc/httpserver.rb head/contrib/ruby19/lib/xmlrpc/server.rb head/contrib/ruby19/lib/xmlrpc/marshal.rb head/contrib/ruby19/lib/xmlrpc/README.txt head/contrib/ruby19/lib/prettyprint.rb head/contrib/ruby19/lib/shell/builtin-command.rb head/contrib/ruby19/lib/shell/filter.rb head/contrib/ruby19/lib/shell/version.rb head/contrib/ruby19/lib/shell/error.rb head/contrib/ruby19/lib/shell/command-processor.rb head/contrib/ruby19/lib/shell/process-controller.rb head/contrib/ruby19/lib/shell/system-command.rb head/contrib/ruby19/lib/thread.rb head/contrib/ruby19/lib/shell.rb head/contrib/ruby19/lib/tsort.rb head/contrib/ruby19/lib/tracer.rb head/contrib/ruby19/lib/un.rb head/contrib/ruby19/lib/rake.rb head/contrib/ruby19/lib/net/protocol.rb head/contrib/ruby19/lib/net/https.rb head/contrib/ruby19/lib/net/smtp.rb head/contrib/ruby19/lib/net/imap.rb head/contrib/ruby19/lib/net/ftp.rb head/contrib/ruby19/lib/net/.document head/contrib/ruby19/lib/net/telnet.rb head/contrib/ruby19/lib/net/pop.rb head/contrib/ruby19/lib/net/http.rb head/contrib/ruby19/lib/weakref.rb head/contrib/ruby19/lib/securerandom.rb head/contrib/ruby19/lib/monitor.rb head/contrib/ruby19/lib/benchmark.rb head/contrib/ruby19/lib/rinda/rinda.rb head/contrib/ruby19/lib/rinda/ring.rb head/contrib/ruby19/lib/rinda/tuplespace.rb head/contrib/ruby19/lib/csv.rb head/contrib/ruby19/lib/rubygems/validator.rb head/contrib/ruby19/lib/rubygems/builder.rb head/contrib/ruby19/lib/rubygems/old_format.rb head/contrib/ruby19/lib/rubygems/installer_test_case.rb head/contrib/ruby19/lib/rubygems/path_support.rb head/contrib/ruby19/lib/rubygems/format.rb head/contrib/ruby19/lib/rubygems/gemcutter_utilities.rb head/contrib/ruby19/lib/rubygems/spec_fetcher.rb head/contrib/ruby19/lib/rubygems/dependency_installer.rb head/contrib/ruby19/lib/rubygems/deprecate.rb head/contrib/ruby19/lib/rubygems/indexer.rb head/contrib/ruby19/lib/rubygems/ext/builder.rb head/contrib/ruby19/lib/rubygems/ext/configure_builder.rb head/contrib/ruby19/lib/rubygems/ext/rake_builder.rb head/contrib/ruby19/lib/rubygems/ext/ext_conf_builder.rb head/contrib/ruby19/lib/rubygems/syck_hack.rb head/contrib/ruby19/lib/rubygems/doc_manager.rb head/contrib/ruby19/lib/rubygems/gem_runner.rb head/contrib/ruby19/lib/rubygems/config_file.rb head/contrib/ruby19/lib/rubygems/custom_require.rb head/contrib/ruby19/lib/rubygems/errors.rb head/contrib/ruby19/lib/rubygems/package_task.rb head/contrib/ruby19/lib/rubygems/version_option.rb head/contrib/ruby19/lib/rubygems/specification.rb head/contrib/ruby19/lib/rubygems/exceptions.rb head/contrib/ruby19/lib/rubygems/require_paths_builder.rb head/contrib/ruby19/lib/rubygems/platform.rb head/contrib/ruby19/lib/rubygems/text.rb head/contrib/ruby19/lib/rubygems/version.rb head/contrib/ruby19/lib/rubygems/source_index.rb head/contrib/ruby19/lib/rubygems/package/tar_writer.rb head/contrib/ruby19/lib/rubygems/package/tar_input.rb head/contrib/ruby19/lib/rubygems/package/tar_output.rb head/contrib/ruby19/lib/rubygems/package/tar_reader/entry.rb head/contrib/ruby19/lib/rubygems/package/tar_reader.rb head/contrib/ruby19/lib/rubygems/package/tar_header.rb head/contrib/ruby19/lib/rubygems/package/f_sync_dir.rb head/contrib/ruby19/lib/rubygems/package/tar_test_case.rb head/contrib/ruby19/lib/rubygems/remote_fetcher.rb head/contrib/ruby19/lib/rubygems/package.rb head/contrib/ruby19/lib/rubygems/installer.rb head/contrib/ruby19/lib/rubygems/ssl_certs/ca-bundle.pem head/contrib/ruby19/lib/rubygems/commands/check_command.rb head/contrib/ruby19/lib/rubygems/commands/dependency_command.rb head/contrib/ruby19/lib/rubygems/commands/push_command.rb head/contrib/ruby19/lib/rubygems/commands/specification_command.rb head/contrib/ruby19/lib/rubygems/commands/unpack_command.rb head/contrib/ruby19/lib/rubygems/commands/generate_index_command.rb head/contrib/ruby19/lib/rubygems/commands/update_command.rb head/contrib/ruby19/lib/rubygems/commands/sources_command.rb head/contrib/ruby19/lib/rubygems/commands/rdoc_command.rb head/contrib/ruby19/lib/rubygems/commands/cleanup_command.rb head/contrib/ruby19/lib/rubygems/commands/help_command.rb head/contrib/ruby19/lib/rubygems/commands/lock_command.rb head/contrib/ruby19/lib/rubygems/commands/fetch_command.rb head/contrib/ruby19/lib/rubygems/commands/owner_command.rb head/contrib/ruby19/lib/rubygems/commands/pristine_command.rb head/contrib/ruby19/lib/rubygems/commands/contents_command.rb head/contrib/ruby19/lib/rubygems/commands/cert_command.rb head/contrib/ruby19/lib/rubygems/commands/build_command.rb head/contrib/ruby19/lib/rubygems/commands/setup_command.rb head/contrib/ruby19/lib/rubygems/commands/which_command.rb head/contrib/ruby19/lib/rubygems/commands/environment_command.rb head/contrib/ruby19/lib/rubygems/commands/query_command.rb head/contrib/ruby19/lib/rubygems/commands/search_command.rb head/contrib/ruby19/lib/rubygems/commands/install_command.rb head/contrib/ruby19/lib/rubygems/commands/server_command.rb head/contrib/ruby19/lib/rubygems/commands/stale_command.rb head/contrib/ruby19/lib/rubygems/commands/outdated_command.rb head/contrib/ruby19/lib/rubygems/commands/uninstall_command.rb head/contrib/ruby19/lib/rubygems/commands/list_command.rb head/contrib/ruby19/lib/rubygems/gem_path_searcher.rb head/contrib/ruby19/lib/rubygems/ext.rb head/contrib/ruby19/lib/rubygems/requirement.rb head/contrib/ruby19/lib/rubygems/uninstaller.rb head/contrib/ruby19/lib/rubygems/psych_tree.rb head/contrib/ruby19/lib/rubygems/server.rb head/contrib/ruby19/lib/rubygems/security.rb head/contrib/ruby19/lib/rubygems/defaults.rb head/contrib/ruby19/lib/rubygems/command_manager.rb head/contrib/ruby19/lib/rubygems/dependency_list.rb head/contrib/ruby19/lib/rubygems/test_utilities.rb head/contrib/ruby19/lib/rubygems/test_case.rb head/contrib/ruby19/lib/rubygems/gem_openssl.rb head/contrib/ruby19/lib/rubygems/user_interaction.rb head/contrib/ruby19/lib/rubygems/dependency.rb head/contrib/ruby19/lib/rubygems/mock_gem_ui.rb head/contrib/ruby19/lib/rubygems/command.rb head/contrib/ruby19/lib/rubygems/local_remote_options.rb head/contrib/ruby19/lib/rubygems/install_update_options.rb head/contrib/ruby19/lib/rubygems/psych_additions.rb head/contrib/ruby19/lib/time.rb head/contrib/ruby19/lib/tmpdir.rb head/contrib/ruby19/lib/fileutils.rb head/contrib/ruby19/lib/abbrev.rb head/contrib/ruby19/lib/cgi.rb head/contrib/ruby19/lib/singleton.rb head/contrib/ruby19/lib/matrix.rb head/contrib/ruby19/lib/drb/timeridconv.rb head/contrib/ruby19/lib/drb/unix.rb head/contrib/ruby19/lib/drb/eq.rb head/contrib/ruby19/lib/drb/drb.rb head/contrib/ruby19/lib/drb/observer.rb head/contrib/ruby19/lib/drb/invokemethod.rb head/contrib/ruby19/lib/drb/extservm.rb head/contrib/ruby19/lib/drb/gw.rb head/contrib/ruby19/lib/drb/acl.rb head/contrib/ruby19/lib/drb/extserv.rb head/contrib/ruby19/lib/drb/ssl.rb head/contrib/ruby19/lib/drb.rb head/contrib/ruby19/lib/mathn.rb head/contrib/ruby19/lib/ubygems.rb head/contrib/ruby19/lib/sync.rb head/contrib/ruby19/lib/find.rb head/contrib/ruby19/lib/base64.rb head/contrib/ruby19/lib/rdoc/cross_reference.rb head/contrib/ruby19/lib/rdoc/known_classes.rb head/contrib/ruby19/lib/rdoc/class_module.rb head/contrib/ruby19/lib/rdoc/method_attr.rb head/contrib/ruby19/lib/rdoc/normal_class.rb head/contrib/ruby19/lib/rdoc/ruby_token.rb head/contrib/ruby19/lib/rdoc/text.rb head/contrib/ruby19/lib/rdoc/ghost_method.rb head/contrib/ruby19/lib/rdoc/context.rb head/contrib/ruby19/lib/rdoc/encoding.rb head/contrib/ruby19/lib/rdoc/any_method.rb head/contrib/ruby19/lib/rdoc/top_level.rb head/contrib/ruby19/lib/rdoc/ruby_lex.rb head/contrib/ruby19/lib/rdoc/token_stream.rb head/contrib/ruby19/lib/rdoc/stats/verbose.rb head/contrib/ruby19/lib/rdoc/stats/quiet.rb head/contrib/ruby19/lib/rdoc/stats/normal.rb head/contrib/ruby19/lib/rdoc/normal_module.rb head/contrib/ruby19/lib/rdoc/markup/to_rdoc.rb head/contrib/ruby19/lib/rdoc/markup/list_item.rb head/contrib/ruby19/lib/rdoc/markup/raw.rb head/contrib/ruby19/lib/rdoc/markup/to_tt_only.rb head/contrib/ruby19/lib/rdoc/markup/to_ansi.rb head/contrib/ruby19/lib/rdoc/markup/parser.rb head/contrib/ruby19/lib/rdoc/markup/attribute_manager.rb head/contrib/ruby19/lib/rdoc/markup/formatter_test_case.rb head/contrib/ruby19/lib/rdoc/markup/blank_line.rb head/contrib/ruby19/lib/rdoc/markup/heading.rb head/contrib/ruby19/lib/rdoc/markup/text_formatter_test_case.rb head/contrib/ruby19/lib/rdoc/markup/formatter.rb head/contrib/ruby19/lib/rdoc/markup/paragraph.rb head/contrib/ruby19/lib/rdoc/markup/to_html.rb head/contrib/ruby19/lib/rdoc/markup/to_bs.rb head/contrib/ruby19/lib/rdoc/markup/rule.rb head/contrib/ruby19/lib/rdoc/markup/verbatim.rb head/contrib/ruby19/lib/rdoc/markup/list.rb head/contrib/ruby19/lib/rdoc/markup/to_html_crossref.rb head/contrib/ruby19/lib/rdoc/markup/inline.rb head/contrib/ruby19/lib/rdoc/markup/document.rb head/contrib/ruby19/lib/rdoc/markup/indented_paragraph.rb head/contrib/ruby19/lib/rdoc/markup/to_test.rb head/contrib/ruby19/lib/rdoc/markup/pre_process.rb head/contrib/ruby19/lib/rdoc/stats.rb head/contrib/ruby19/lib/rdoc/code_object.rb head/contrib/ruby19/lib/rdoc/erbio.rb head/contrib/ruby19/lib/rdoc/task.rb head/contrib/ruby19/lib/rdoc/single_class.rb head/contrib/ruby19/lib/rdoc/ri/formatter.rb head/contrib/ruby19/lib/rdoc/ri/driver.rb head/contrib/ruby19/lib/rdoc/ri/store.rb head/contrib/ruby19/lib/rdoc/ri/paths.rb head/contrib/ruby19/lib/rdoc/ri.rb head/contrib/ruby19/lib/rdoc/attr.rb head/contrib/ruby19/lib/rdoc/require.rb head/contrib/ruby19/lib/rdoc/rubygems_hook.rb head/contrib/ruby19/lib/rdoc/anon_class.rb head/contrib/ruby19/lib/rdoc/code_objects.rb head/contrib/ruby19/lib/rdoc/include.rb head/contrib/ruby19/lib/rdoc/generator/markup.rb head/contrib/ruby19/lib/rdoc/generator/template/darkfish/rdoc.css head/contrib/ruby19/lib/rdoc/generator/template/darkfish/filepage.rhtml head/contrib/ruby19/lib/rdoc/generator/template/darkfish/filepage.rhtml head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/brick_link.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/brick_link.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/page_white_width.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/page_white_width.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/macFFBgHack.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/macFFBgHack.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/bug.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/bug.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/date.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/date.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/find.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/find.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/page_white_text.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/page_white_text.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/wrench_orange.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/wrench_orange.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/ruby.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/ruby.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/bullet_black.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/bullet_black.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/zoom.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/zoom.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/wrench.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/wrench.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/brick.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/brick.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/tag_green.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/tag_green.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/package.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/package.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/page_green.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/page_green.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/plugin.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/plugin.png head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif head/contrib/ruby19/lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif head/contrib/ruby19/lib/rdoc/generator/template/darkfish/classpage.rhtml head/contrib/ruby19/lib/rdoc/generator/template/darkfish/classpage.rhtml head/contrib/ruby19/lib/rdoc/generator/template/darkfish/.document head/contrib/ruby19/lib/rdoc/generator/template/darkfish/index.rhtml head/contrib/ruby19/lib/rdoc/generator/template/darkfish/index.rhtml head/contrib/ruby19/lib/rdoc/generator/template/darkfish/js/darkfish.js head/contrib/ruby19/lib/rdoc/generator/template/darkfish/js/thickbox-compressed.js head/contrib/ruby19/lib/rdoc/generator/template/darkfish/js/jquery.js head/contrib/ruby19/lib/rdoc/generator/template/darkfish/js/quicksearch.js head/contrib/ruby19/lib/rdoc/generator/ri.rb head/contrib/ruby19/lib/rdoc/generator/darkfish.rb head/contrib/ruby19/lib/rdoc/meta_method.rb head/contrib/ruby19/lib/rdoc/generator.rb head/contrib/ruby19/lib/rdoc/rdoc.rb head/contrib/ruby19/lib/rdoc/alias.rb head/contrib/ruby19/lib/rdoc/constant.rb head/contrib/ruby19/lib/rdoc/parser/simple.rb head/contrib/ruby19/lib/rdoc/parser/ruby.rb head/contrib/ruby19/lib/rdoc/parser/ruby_tools.rb head/contrib/ruby19/lib/rdoc/parser/c.rb head/contrib/ruby19/lib/rdoc/options.rb head/contrib/ruby19/lib/rdoc/parser.rb head/contrib/ruby19/lib/rdoc/markup.rb head/contrib/ruby19/lib/timeout.rb head/contrib/ruby19/lib/shellwords.rb head/contrib/ruby19/lib/rbconfig/datadir.rb head/contrib/ruby19/lib/rbconfig/.document head/contrib/ruby19/lib/rbconfig/obsolete.rb head/contrib/ruby19/lib/rdoc.rb head/contrib/ruby19/lib/observer.rb head/contrib/ruby19/lib/optparse/date.rb head/contrib/ruby19/lib/optparse/time.rb head/contrib/ruby19/lib/optparse/uri.rb head/contrib/ruby19/lib/optparse/version.rb head/contrib/ruby19/lib/optparse/shellwords.rb head/contrib/ruby19/lib/cmath.rb head/contrib/ruby19/lib/profile.rb head/contrib/ruby19/lib/matrix/lup_decomposition.rb head/contrib/ruby19/lib/matrix/eigenvalue_decomposition.rb head/contrib/ruby19/lib/ostruct.rb head/contrib/ruby19/lib/erb.rb head/contrib/ruby19/lib/rational.rb head/contrib/ruby19/lib/resolv.rb head/contrib/ruby19/lib/irb.rb head/contrib/ruby19/lib/prime.rb head/contrib/ruby19/lib/test/unit/assertions.rb head/contrib/ruby19/lib/test/unit/testcase.rb head/contrib/ruby19/lib/test/unit/parallel.rb head/contrib/ruby19/lib/test/unit.rb head/contrib/ruby19/lib/pp.rb head/contrib/ruby19/lib/e2mmap.rb head/contrib/ruby19/lib/profiler.rb head/contrib/ruby19/lib/resolv-replace.rb head/contrib/ruby19/lib/webrick/httpresponse.rb head/contrib/ruby19/lib/webrick/httpauth/userdb.rb head/contrib/ruby19/lib/webrick/httpauth/htgroup.rb head/contrib/ruby19/lib/webrick/httpauth/authenticator.rb head/contrib/ruby19/lib/webrick/httpauth/htdigest.rb head/contrib/ruby19/lib/webrick/httpauth/htpasswd.rb head/contrib/ruby19/lib/webrick/httpauth/digestauth.rb head/contrib/ruby19/lib/webrick/httpauth/basicauth.rb head/contrib/ruby19/lib/webrick/utils.rb head/contrib/ruby19/lib/webrick/httputils.rb head/contrib/ruby19/lib/webrick/ssl.rb head/contrib/ruby19/lib/webrick/httpauth.rb head/contrib/ruby19/lib/webrick/cgi.rb head/contrib/ruby19/lib/webrick/https.rb head/contrib/ruby19/lib/webrick/accesslog.rb head/contrib/ruby19/lib/webrick/config.rb head/contrib/ruby19/lib/webrick/httpserver.rb head/contrib/ruby19/lib/webrick/server.rb head/contrib/ruby19/lib/webrick/cookie.rb head/contrib/ruby19/lib/webrick/httpproxy.rb head/contrib/ruby19/lib/webrick/log.rb head/contrib/ruby19/lib/webrick/httpservlet/cgi_runner.rb head/contrib/ruby19/lib/webrick/httpservlet/filehandler.rb head/contrib/ruby19/lib/webrick/httpservlet/cgihandler.rb head/contrib/ruby19/lib/webrick/httpservlet/prochandler.rb head/contrib/ruby19/lib/webrick/httpservlet/abstract.rb head/contrib/ruby19/lib/webrick/httpservlet/erbhandler.rb head/contrib/ruby19/lib/webrick/compat.rb head/contrib/ruby19/lib/webrick/httpstatus.rb head/contrib/ruby19/lib/webrick/httpservlet.rb head/contrib/ruby19/lib/webrick/version.rb head/contrib/ruby19/lib/webrick/httpversion.rb head/contrib/ruby19/lib/webrick/htmlutils.rb head/contrib/ruby19/lib/webrick/httprequest.rb head/contrib/ruby19/lib/rexml/light/node.rb head/contrib/ruby19/lib/rexml/dtd/entitydecl.rb head/contrib/ruby19/lib/rexml/dtd/dtd.rb head/contrib/ruby19/lib/rexml/dtd/attlistdecl.rb head/contrib/ruby19/lib/rexml/dtd/elementdecl.rb head/contrib/ruby19/lib/rexml/dtd/notationdecl.rb head/contrib/ruby19/lib/rexml/attlistdecl.rb head/contrib/ruby19/lib/rexml/parsers/xpathparser.rb head/contrib/ruby19/lib/rexml/parsers/lightparser.rb head/contrib/ruby19/lib/rexml/parsers/baseparser.rb head/contrib/ruby19/lib/rexml/parsers/streamparser.rb head/contrib/ruby19/lib/rexml/parsers/pullparser.rb head/contrib/ruby19/lib/rexml/parsers/sax2parser.rb head/contrib/ruby19/lib/rexml/parsers/treeparser.rb head/contrib/ruby19/lib/rexml/parsers/ultralightparser.rb head/contrib/ruby19/lib/rexml/document.rb head/contrib/ruby19/lib/rexml/instruction.rb head/contrib/ruby19/lib/rexml/child.rb head/contrib/ruby19/lib/rexml/xpath.rb head/contrib/ruby19/lib/rexml/xmltokens.rb head/contrib/ruby19/lib/rexml/validation/validationexception.rb head/contrib/ruby19/lib/rexml/validation/validation.rb head/contrib/ruby19/lib/rexml/validation/relaxng.rb head/contrib/ruby19/lib/rexml/xmldecl.rb head/contrib/ruby19/lib/rexml/element.rb head/contrib/ruby19/lib/rexml/parent.rb head/contrib/ruby19/lib/rexml/parseexception.rb head/contrib/ruby19/lib/rexml/quickpath.rb head/contrib/ruby19/lib/rexml/undefinednamespaceexception.rb head/contrib/ruby19/lib/rexml/source.rb head/contrib/ruby19/lib/rexml/output.rb head/contrib/ruby19/lib/rexml/streamlistener.rb head/contrib/ruby19/lib/rexml/comment.rb head/contrib/ruby19/lib/rexml/attribute.rb head/contrib/ruby19/lib/rexml/doctype.rb head/contrib/ruby19/lib/rexml/functions.rb head/contrib/ruby19/lib/rexml/cdata.rb head/contrib/ruby19/lib/rexml/entity.rb head/contrib/ruby19/lib/rexml/syncenumerator.rb head/contrib/ruby19/lib/rexml/sax2listener.rb head/contrib/ruby19/lib/rexml/text.rb head/contrib/ruby19/lib/rexml/formatters/pretty.rb head/contrib/ruby19/lib/rexml/formatters/transitive.rb head/contrib/ruby19/lib/rexml/formatters/default.rb head/contrib/ruby19/lib/rexml/node.rb head/contrib/ruby19/lib/rexml/encoding.rb head/contrib/ruby19/lib/rexml/rexml.rb head/contrib/ruby19/lib/rexml/namespace.rb head/contrib/ruby19/lib/rexml/xpath_parser.rb head/contrib/ruby19/lib/debug.rb head/contrib/ruby19/lib/English.rb head/contrib/ruby19/lib/minitest/README.txt head/contrib/ruby19/lib/minitest/mock.rb head/contrib/ruby19/lib/minitest/benchmark.rb head/contrib/ruby19/lib/minitest/spec.rb head/contrib/ruby19/lib/minitest/autorun.rb head/contrib/ruby19/lib/minitest/unit.rb head/contrib/ruby19/lib/minitest/pride.rb head/contrib/ruby19/lib/README head/contrib/ruby19/lib/set.rb head/contrib/ruby19/lib/rubygems.rb head/contrib/ruby19/lib/open-uri.rb head/contrib/ruby19/lib/thwait.rb head/contrib/ruby19/lib/yaml/dbm.rb head/contrib/ruby19/lib/yaml/store.rb head/contrib/ruby19/lib/ipaddr.rb head/contrib/ruby19/lib/rss/content/2.0.rb head/contrib/ruby19/lib/rss/content/1.0.rb head/contrib/ruby19/lib/rss/content.rb head/contrib/ruby19/lib/rss/slash.rb head/contrib/ruby19/lib/rss/xmlscanner.rb head/contrib/ruby19/lib/rss/xmlparser.rb head/contrib/ruby19/lib/rss/taxonomy.rb head/contrib/ruby19/lib/rss/image.rb head/contrib/ruby19/lib/rss/syndication.rb head/contrib/ruby19/lib/rss/dublincore/1.0.rb head/contrib/ruby19/lib/rss/dublincore/2.0.rb head/contrib/ruby19/lib/rss/dublincore/atom.rb head/contrib/ruby19/lib/rss/trackback.rb head/contrib/ruby19/lib/rss/dublincore.rb head/contrib/ruby19/lib/rss/xml-stylesheet.rb head/contrib/ruby19/lib/rss/parser.rb head/contrib/ruby19/lib/rss/maker/1.0.rb head/contrib/ruby19/lib/rss/maker/taxonomy.rb head/contrib/ruby19/lib/rss/maker/2.0.rb head/contrib/ruby19/lib/rss/maker/atom.rb head/contrib/ruby19/lib/rss/maker/entry.rb head/contrib/ruby19/lib/rss/maker/image.rb head/contrib/ruby19/lib/rss/maker/feed.rb head/contrib/ruby19/lib/rss/maker/syndication.rb head/contrib/ruby19/lib/rss/maker/trackback.rb head/contrib/ruby19/lib/rss/maker/0.9.rb head/contrib/ruby19/lib/rss/maker/dublincore.rb head/contrib/ruby19/lib/rss/maker/itunes.rb head/contrib/ruby19/lib/rss/maker/base.rb head/contrib/ruby19/lib/rss/maker/content.rb head/contrib/ruby19/lib/rss/maker/slash.rb head/contrib/ruby19/lib/rss/1.0.rb head/contrib/ruby19/lib/rss/2.0.rb head/contrib/ruby19/lib/rss/maker.rb head/contrib/ruby19/lib/rss/xml.rb head/contrib/ruby19/lib/rss/utils.rb head/contrib/ruby19/lib/rss/atom.rb head/contrib/ruby19/lib/rss/rexmlparser.rb head/contrib/ruby19/lib/rss/0.9.rb head/contrib/ruby19/lib/rss/rss.rb head/contrib/ruby19/lib/rss/itunes.rb head/contrib/ruby19/lib/rss/converter.rb head/contrib/ruby19/lib/tempfile.rb head/contrib/ruby19/lib/racc/parser.rb head/contrib/ruby19/lib/rss.rb head/contrib/ruby19/lib/complex.rb head/contrib/ruby19/lib/delegate.rb head/contrib/ruby19/lib/irb/help.rb head/contrib/ruby19/lib/irb/frame.rb head/contrib/ruby19/lib/irb/lc/help-message head/contrib/ruby19/lib/irb/lc/ja/help-message head/contrib/ruby19/lib/irb/lc/ja/error.rb head/contrib/ruby19/lib/irb/lc/ja/encoding_aliases.rb head/contrib/ruby19/lib/irb/lc/error.rb head/contrib/ruby19/lib/irb/src_encoding.rb head/contrib/ruby19/lib/irb/magic-file.rb head/contrib/ruby19/lib/irb/workspace.rb head/contrib/ruby19/lib/irb/ext/change-ws.rb head/contrib/ruby19/lib/irb/ext/save-history.rb head/contrib/ruby19/lib/irb/ext/tracer.rb head/contrib/ruby19/lib/irb/ext/use-loader.rb head/contrib/ruby19/lib/irb/ext/history.rb head/contrib/ruby19/lib/irb/ext/workspaces.rb head/contrib/ruby19/lib/irb/ext/multi-irb.rb head/contrib/ruby19/lib/irb/ext/loader.rb head/contrib/ruby19/lib/irb/ext/math-mode.rb head/contrib/ruby19/lib/irb/ruby-token.rb head/contrib/ruby19/lib/irb/locale.rb head/contrib/ruby19/lib/irb/cmd/load.rb head/contrib/ruby19/lib/irb/cmd/fork.rb head/contrib/ruby19/lib/irb/cmd/chws.rb head/contrib/ruby19/lib/irb/cmd/subirb.rb head/contrib/ruby19/lib/irb/cmd/help.rb head/contrib/ruby19/lib/irb/cmd/pushws.rb head/contrib/ruby19/lib/irb/cmd/nop.rb head/contrib/ruby19/lib/irb/extend-command.rb head/contrib/ruby19/lib/irb/init.rb head/contrib/ruby19/lib/irb/xmp.rb head/contrib/ruby19/lib/irb/inspector.rb head/contrib/ruby19/lib/irb/ruby-lex.rb head/contrib/ruby19/lib/irb/completion.rb head/contrib/ruby19/lib/irb/slex.rb head/contrib/ruby19/lib/irb/input-method.rb head/contrib/ruby19/lib/irb/output-method.rb head/contrib/ruby19/lib/irb/notifier.rb head/contrib/ruby19/lib/irb/context.rb head/contrib/ruby19/lib/irb/ws-for-case-2.rb head/contrib/ruby19/lib/irb/version.rb head/contrib/ruby19/lib/pstore.rb head/contrib/ruby19/lib/gserver.rb head/contrib/ruby19/lib/mutex_m.rb head/contrib/ruby19/lib/logger.rb head/contrib/ruby19/lib/rake/dsl_definition.rb head/contrib/ruby19/lib/rake/invocation_exception_mixin.rb head/contrib/ruby19/lib/rake/classic_namespace.rb head/contrib/ruby19/lib/rake/ext/string.rb head/contrib/ruby19/lib/rake/ext/core.rb head/contrib/ruby19/lib/rake/ext/time.rb head/contrib/ruby19/lib/rake/ext/module.rb head/contrib/ruby19/lib/rake/file_utils.rb head/contrib/ruby19/lib/rake/testtask.rb head/contrib/ruby19/lib/rake/pseudo_status.rb head/contrib/ruby19/lib/rake/lib/project.rake head/contrib/ruby19/lib/rake/runtest.rb head/contrib/ruby19/lib/rake/file_list.rb head/contrib/ruby19/lib/rake/file_utils_ext.rb head/contrib/ruby19/lib/rake/clean.rb head/contrib/ruby19/lib/rake/alt_system.rb head/contrib/ruby19/lib/rake/file_creation_task.rb head/contrib/ruby19/lib/rake/task_arguments.rb head/contrib/ruby19/lib/rake/tasklib.rb head/contrib/ruby19/lib/rake/early_time.rb head/contrib/ruby19/lib/rake/pathmap.rb head/contrib/ruby19/lib/rake/name_space.rb head/contrib/ruby19/lib/rake/rule_recursion_overflow_error.rb head/contrib/ruby19/lib/rake/task_manager.rb head/contrib/ruby19/lib/rake/contrib/ftptools.rb head/contrib/ruby19/lib/rake/contrib/sshpublisher.rb head/contrib/ruby19/lib/rake/contrib/publisher.rb head/contrib/ruby19/lib/rake/contrib/sys.rb head/contrib/ruby19/lib/rake/contrib/compositepublisher.rb head/contrib/ruby19/lib/rake/contrib/rubyforgepublisher.rb head/contrib/ruby19/lib/rake/file_task.rb head/contrib/ruby19/lib/rake/task.rb head/contrib/ruby19/lib/rake/win32.rb head/contrib/ruby19/lib/rake/application.rb head/contrib/ruby19/lib/rake/rake_test_loader.rb head/contrib/ruby19/lib/rake/gempackagetask.rb head/contrib/ruby19/lib/rake/rdoctask.rb head/contrib/ruby19/lib/rake/default_loader.rb head/contrib/ruby19/lib/rake/invocation_chain.rb head/contrib/ruby19/lib/rake/multi_task.rb head/contrib/ruby19/lib/rake/task_argument_error.rb head/contrib/ruby19/lib/rake/packagetask.rb head/contrib/ruby19/lib/rake/ruby182_test_unit_fix.rb head/contrib/ruby19/lib/rake/cloneable.rb head/contrib/ruby19/lib/rake/version.rb head/contrib/ruby19/lib/rake/rake_module.rb head/contrib/ruby19/lib/rake/loaders/makefile.rb head/contrib/ruby19/lib/getoptlong.rb head/contrib/ruby19/lib/open3.rb head/contrib/ruby19/lib/webrick.rb head/contrib/ruby19/lib/forwardable.rb head/contrib/ruby19/lib/mkmf.rb head/contrib/ruby19/lib/scanf.rb head/contrib/ruby19/vm_exec.c head/contrib/ruby19/eval.c head/contrib/ruby19/vm_exec.h head/contrib/ruby19/vm_opts.h head/contrib/ruby19/numeric.c head/contrib/ruby19/LEGAL head/contrib/ruby19/string.c head/contrib/ruby19/object.c head/contrib/ruby19/regparse.c head/contrib/ruby19/dmyext.c head/contrib/ruby19/README.EXT head/contrib/ruby19/node_name.inc head/contrib/ruby19/util.c head/contrib/ruby19/regparse.h head/contrib/ruby19/dln_find.c head/contrib/ruby19/prelude.rb head/contrib/ruby19/eval_jump.c head/contrib/ruby19/vm_method.c head/contrib/ruby19/hash.c head/contrib/ruby19/version.c head/contrib/ruby19/encoding.c head/contrib/ruby19/missing/strchr.c head/contrib/ruby19/missing/memmove.c head/contrib/ruby19/missing/close.c head/contrib/ruby19/missing/tgamma.c head/contrib/ruby19/missing/isinf.c head/contrib/ruby19/missing/isnan.c head/contrib/ruby19/missing/dup2.c head/contrib/ruby19/missing/strlcat.c head/contrib/ruby19/missing/erf.c head/contrib/ruby19/missing/fileblocks.c head/contrib/ruby19/missing/finite.c head/contrib/ruby19/missing/ffs.c head/contrib/ruby19/missing/memcmp.c head/contrib/ruby19/missing/lgamma_r.c head/contrib/ruby19/missing/setproctitle.c head/contrib/ruby19/missing/strerror.c head/contrib/ruby19/missing/file.h head/contrib/ruby19/missing/strtol.c head/contrib/ruby19/missing/cbrt.c head/contrib/ruby19/missing/alloca.c head/contrib/ruby19/missing/langinfo.c head/contrib/ruby19/missing/acosh.c head/contrib/ruby19/missing/flock.c head/contrib/ruby19/missing/signbit.c head/contrib/ruby19/missing/strlcpy.c head/contrib/ruby19/missing/strstr.c head/contrib/ruby19/missing/crypt.c head/contrib/ruby19/missing/x86_64-chkstk.s head/contrib/ruby19/missing/os2.c head/contrib/ruby19/missing/hypot.c head/contrib/ruby19/timev.h head/contrib/ruby19/version.h head/contrib/ruby19/tool/runruby.rb head/contrib/ruby19/tool/compile_prelude.rb head/contrib/ruby19/tool/update-deps head/contrib/ruby19/tool/asm_parse.rb head/contrib/ruby19/tool/test/test_jisx0208.rb head/contrib/ruby19/tool/build-transcode head/contrib/ruby19/tool/insns2vm.rb head/contrib/ruby19/tool/rubytest.rb head/contrib/ruby19/tool/enc-emoji-citrus-gen.rb head/contrib/ruby19/tool/strip-rdoc.rb head/contrib/ruby19/tool/jisx0208.rb head/contrib/ruby19/tool/eval.rb head/contrib/ruby19/tool/rbinstall.rb head/contrib/ruby19/tool/mkconfig.rb head/contrib/ruby19/tool/enc-emoji4unicode.rb head/contrib/ruby19/tool/ifchange head/contrib/ruby19/tool/file2lastrev.rb head/contrib/ruby19/tool/change_maker.rb head/contrib/ruby19/tool/ytab.sed head/contrib/ruby19/tool/make-snapshot head/contrib/ruby19/tool/parse.rb head/contrib/ruby19/tool/install-sh head/contrib/ruby19/tool/vtlh.rb head/contrib/ruby19/tool/instruction.rb head/contrib/ruby19/tool/merger.rb head/contrib/ruby19/tool/node_name.rb head/contrib/ruby19/tool/config.guess head/contrib/ruby19/tool/enc-unicode.rb head/contrib/ruby19/tool/transcode-tblgen.rb head/contrib/ruby19/tool/config.sub head/contrib/ruby19/tool/rmdirs head/contrib/ruby19/tool/mdoc2man.rb head/contrib/ruby19/tool/generic_erb.rb head/contrib/ruby19/bootstraptest/test_thread.rb head/contrib/ruby19/bootstraptest/test_flow.rb head/contrib/ruby19/bootstraptest/test_io.rb head/contrib/ruby19/bootstraptest/test_autoload.rb head/contrib/ruby19/bootstraptest/runner.rb head/contrib/ruby19/bootstraptest/test_attr.rb head/contrib/ruby19/bootstraptest/test_jump.rb head/contrib/ruby19/bootstraptest/test_load.rb head/contrib/ruby19/bootstraptest/test_method.rb head/contrib/ruby19/bootstraptest/test_objectspace.rb head/contrib/ruby19/bootstraptest/test_finalizer.rb head/contrib/ruby19/bootstraptest/test_struct.rb head/contrib/ruby19/bootstraptest/pending.rb head/contrib/ruby19/bootstraptest/test_syntax.rb head/contrib/ruby19/bootstraptest/test_marshal.rb head/contrib/ruby19/bootstraptest/test_eval.rb head/contrib/ruby19/bootstraptest/test_gc.rb head/contrib/ruby19/bootstraptest/test_flip.rb head/contrib/ruby19/bootstraptest/test_block.rb head/contrib/ruby19/bootstraptest/test_literal.rb head/contrib/ruby19/bootstraptest/test_exception.rb head/contrib/ruby19/bootstraptest/test_fork.rb head/contrib/ruby19/bootstraptest/test_massign.rb head/contrib/ruby19/bootstraptest/test_proc.rb head/contrib/ruby19/bootstraptest/test_class.rb head/contrib/ruby19/test/stringio/test_stringio.rb head/contrib/ruby19/test/ripper/test_filter.rb head/contrib/ruby19/test/ripper/dummyparser.rb head/contrib/ruby19/test/ripper/test_scanner_events.rb head/contrib/ruby19/test/ripper/test_parser_events.rb head/contrib/ruby19/test/ripper/test_ripper.rb head/contrib/ruby19/test/ripper/test_files.rb head/contrib/ruby19/test/io/console/test_io_console.rb head/contrib/ruby19/test/io/wait/test_io_wait.rb head/contrib/ruby19/test/io/nonblock/test_flush.rb head/contrib/ruby19/test/rss/test_content.rb head/contrib/ruby19/test/rss/test_parser_1.0.rb head/contrib/ruby19/test/rss/test_maker_sy.rb head/contrib/ruby19/test/rss/test_maker_2.0.rb head/contrib/ruby19/test/rss/test_setup_maker_atom_entry.rb head/contrib/ruby19/test/rss/rss-testcase.rb head/contrib/ruby19/test/rss/test_setup_maker_atom_feed.rb head/contrib/ruby19/test/rss/test_maker_slash.rb head/contrib/ruby19/test/rss/test_setup_maker_1.0.rb head/contrib/ruby19/test/rss/test_parser_atom_entry.rb head/contrib/ruby19/test/rss/test_2.0.rb head/contrib/ruby19/test/rss/test_maker_atom_entry.rb head/contrib/ruby19/test/rss/rss-assertions.rb head/contrib/ruby19/test/rss/test_maker_image.rb head/contrib/ruby19/test/rss/test_accessor.rb head/contrib/ruby19/test/rss/test_maker_atom_feed.rb head/contrib/ruby19/test/rss/test_inherit.rb head/contrib/ruby19/test/rss/test_to_s.rb head/contrib/ruby19/test/rss/test_maker_trackback.rb head/contrib/ruby19/test/rss/test_maker_dc.rb head/contrib/ruby19/test/rss/test_setup_maker_0.9.rb head/contrib/ruby19/test/rss/test_setup_maker_itunes.rb head/contrib/ruby19/test/rss/test_itunes.rb head/contrib/ruby19/test/rss/dot.png head/contrib/ruby19/test/rss/dot.png head/contrib/ruby19/test/rss/test_slash.rb head/contrib/ruby19/test/rss/test_parser_2.0.rb head/contrib/ruby19/test/rss/test_maker_1.0.rb head/contrib/ruby19/test/rss/test_taxonomy.rb head/contrib/ruby19/test/rss/test_image.rb head/contrib/ruby19/test/rss/test_syndication.rb head/contrib/ruby19/test/rss/test_maker_0.9.rb head/contrib/ruby19/test/rss/test_trackback.rb head/contrib/ruby19/test/rss/test_version.rb head/contrib/ruby19/test/rss/test_dublincore.rb head/contrib/ruby19/test/rss/test_maker_itunes.rb head/contrib/ruby19/test/rss/test_xml-stylesheet.rb head/contrib/ruby19/test/rss/test_maker_content.rb head/contrib/ruby19/test/rss/test_maker_taxo.rb head/contrib/ruby19/test/rss/test_parser.rb head/contrib/ruby19/test/rss/test_1.0.rb head/contrib/ruby19/test/rss/test_setup_maker_2.0.rb head/contrib/ruby19/test/rss/test_parser_atom_feed.rb head/contrib/ruby19/test/rss/test_atom.rb head/contrib/ruby19/test/rss/test_maker_xml-stylesheet.rb head/contrib/ruby19/test/rss/test_setup_maker_slash.rb head/contrib/ruby19/test/erb/test_erb_m17n.rb head/contrib/ruby19/test/erb/test_erb.rb head/contrib/ruby19/test/erb/hello.erb head/contrib/ruby19/test/gdbm/test_gdbm.rb head/contrib/ruby19/test/syck/test_boolean.rb head/contrib/ruby19/test/syck/test_yamlstore.rb head/contrib/ruby19/test/syck/test_hash.rb head/contrib/ruby19/test/syck/test_struct.rb head/contrib/ruby19/test/syck/test_set.rb head/contrib/ruby19/test/syck/test_omap.rb head/contrib/ruby19/test/syck/test_exception.rb head/contrib/ruby19/test/syck/test_time.rb head/contrib/ruby19/test/syck/test_engine_manager.rb head/contrib/ruby19/test/syck/test_yaml.rb head/contrib/ruby19/test/syck/test_class.rb head/contrib/ruby19/test/syck/test_symbol.rb head/contrib/ruby19/test/syck/test_string.rb head/contrib/ruby19/test/syck/test_null.rb head/contrib/ruby19/test/syck/test_array.rb head/contrib/ruby19/test/syck/test_yaml_properties.rb head/contrib/ruby19/test/runner.rb head/contrib/ruby19/test/irb/test_option.rb head/contrib/ruby19/test/irb/test_completion.rb head/contrib/ruby19/test/strscan/test_stringscanner.rb head/contrib/ruby19/test/iconv/test_option.rb head/contrib/ruby19/test/iconv/test_partial.rb head/contrib/ruby19/test/iconv/test_basic.rb head/contrib/ruby19/test/iconv/utils.rb head/contrib/ruby19/test/logger/test_logger.rb head/contrib/ruby19/test/ruby/endblockwarn_rb head/contrib/ruby19/test/ruby/test_rational2.rb head/contrib/ruby19/test/ruby/test_trace.rb head/contrib/ruby19/test/ruby/test_basicinstructions.rb head/contrib/ruby19/test/ruby/test_io_m17n.rb head/contrib/ruby19/test/ruby/test_continuation.rb head/contrib/ruby19/test/ruby/test_call.rb head/contrib/ruby19/test/ruby/test_require.rb head/contrib/ruby19/test/ruby/test_array.rb head/contrib/ruby19/test/ruby/marshaltestlib.rb head/contrib/ruby19/test/ruby/test_bignum.rb head/contrib/ruby19/test/ruby/test_objectspace.rb head/contrib/ruby19/test/ruby/test_struct.rb head/contrib/ruby19/test/ruby/test_file_exhaustive.rb head/contrib/ruby19/test/ruby/test_sprintf.rb head/contrib/ruby19/test/ruby/test_condition.rb head/contrib/ruby19/test/ruby/test_beginendblock.rb head/contrib/ruby19/test/ruby/test_alias.rb head/contrib/ruby19/test/ruby/test_math.rb head/contrib/ruby19/test/ruby/test_regexp.rb head/contrib/ruby19/test/ruby/test_range.rb head/contrib/ruby19/test/ruby/test_literal.rb head/contrib/ruby19/test/ruby/test_integer.rb head/contrib/ruby19/test/ruby/lbtest.rb head/contrib/ruby19/test/ruby/test_undef.rb head/contrib/ruby19/test/ruby/test_proc.rb head/contrib/ruby19/test/ruby/enc/test_shift_jis.rb head/contrib/ruby19/test/ruby/enc/test_windows_1251.rb head/contrib/ruby19/test/ruby/enc/test_emoji.rb head/contrib/ruby19/test/ruby/enc/test_gbk.rb head/contrib/ruby19/test/ruby/enc/test_utf32.rb head/contrib/ruby19/test/ruby/enc/test_gb18030.rb head/contrib/ruby19/test/ruby/enc/test_euc_jp.rb head/contrib/ruby19/test/ruby/enc/test_utf16.rb head/contrib/ruby19/test/ruby/enc/test_big5.rb head/contrib/ruby19/test/ruby/enc/test_euc_tw.rb head/contrib/ruby19/test/ruby/enc/test_iso_8859.rb head/contrib/ruby19/test/ruby/enc/test_cp949.rb head/contrib/ruby19/test/ruby/enc/test_euc_kr.rb head/contrib/ruby19/test/ruby/enc/test_koi8.rb head/contrib/ruby19/test/ruby/test_enum.rb head/contrib/ruby19/test/ruby/test_float.rb head/contrib/ruby19/test/ruby/test_string.rb head/contrib/ruby19/test/ruby/test_object.rb head/contrib/ruby19/test/ruby/test_notimp.rb head/contrib/ruby19/test/ruby/test_assignment.rb head/contrib/ruby19/test/ruby/test_metaclass.rb head/contrib/ruby19/test/ruby/test_signal.rb head/contrib/ruby19/test/ruby/test_dir.rb head/contrib/ruby19/test/ruby/test_file.rb head/contrib/ruby19/test/ruby/test_method.rb head/contrib/ruby19/test/ruby/beginmainend.rb head/contrib/ruby19/test/ruby/test_m17n_comb.rb head/contrib/ruby19/test/ruby/test_whileuntil.rb head/contrib/ruby19/test/ruby/test_sprintf_comb.rb head/contrib/ruby19/test/ruby/test_variable.rb head/contrib/ruby19/test/ruby/test_encoding.rb head/contrib/ruby19/test/ruby/test_const.rb head/contrib/ruby19/test/ruby/test_settracefunc.rb head/contrib/ruby19/test/ruby/test_marshal.rb head/contrib/ruby19/test/ruby/test_eval.rb head/contrib/ruby19/test/ruby/test_readpartial.rb head/contrib/ruby19/test/ruby/test_gc.rb head/contrib/ruby19/test/ruby/test_complex2.rb head/contrib/ruby19/test/ruby/test_flip.rb head/contrib/ruby19/test/ruby/test_integer_comb.rb head/contrib/ruby19/test/ruby/test_pipe.rb head/contrib/ruby19/test/ruby/test_defined.rb head/contrib/ruby19/test/ruby/test_super.rb head/contrib/ruby19/test/ruby/test_time.rb head/contrib/ruby19/test/ruby/test_complexrational.rb head/contrib/ruby19/test/ruby/test_stringchar.rb head/contrib/ruby19/test/ruby/sentence.rb head/contrib/ruby19/test/ruby/test_symbol.rb head/contrib/ruby19/test/ruby/test_yield.rb head/contrib/ruby19/test/ruby/test_io.rb head/contrib/ruby19/test/ruby/test_autoload.rb head/contrib/ruby19/test/ruby/allpairs.rb head/contrib/ruby19/test/ruby/test_primitive.rb head/contrib/ruby19/test/ruby/test_sleep.rb head/contrib/ruby19/test/ruby/test_econv.rb head/contrib/ruby19/test/ruby/memory_status.rb head/contrib/ruby19/test/ruby/test_process.rb head/contrib/ruby19/test/ruby/test_mixed_unicode_escapes.rb head/contrib/ruby19/test/ruby/test_dir_m17n.rb head/contrib/ruby19/test/ruby/ut_eof.rb head/contrib/ruby19/test/ruby/test_hash.rb head/contrib/ruby19/test/ruby/test_rand.rb head/contrib/ruby19/test/ruby/test_syntax.rb head/contrib/ruby19/test/ruby/envutil.rb head/contrib/ruby19/test/ruby/test_env.rb head/contrib/ruby19/test/ruby/test_path.rb head/contrib/ruby19/test/ruby/test_rubyoptions.rb head/contrib/ruby19/test/ruby/test_exception.rb head/contrib/ruby19/test/ruby/test_clone.rb head/contrib/ruby19/test/ruby/test_numeric.rb head/contrib/ruby19/test/ruby/test_comparable.rb head/contrib/ruby19/test/ruby/test_class.rb head/contrib/ruby19/test/ruby/test_unicode_escape.rb head/contrib/ruby19/test/ruby/test_fixnum.rb head/contrib/ruby19/test/ruby/test_thread.rb head/contrib/ruby19/test/ruby/test_complex.rb head/contrib/ruby19/test/ruby/test_rational.rb head/contrib/ruby19/test/ruby/test_parse.rb head/contrib/ruby19/test/ruby/test_time_tz.rb head/contrib/ruby19/test/ruby/test_case.rb head/contrib/ruby19/test/ruby/test_pack.rb head/contrib/ruby19/test/ruby/test_argf.rb head/contrib/ruby19/test/ruby/test_lambda.rb head/contrib/ruby19/test/ruby/test_fnmatch.rb head/contrib/ruby19/test/ruby/test_enumerator.rb head/contrib/ruby19/test/ruby/test_m17n.rb head/contrib/ruby19/test/ruby/test_transcode.rb head/contrib/ruby19/test/ruby/test_system.rb head/contrib/ruby19/test/ruby/test_module.rb head/contrib/ruby19/test/ruby/test_optimization.rb head/contrib/ruby19/test/ruby/test_fiber.rb head/contrib/ruby19/test/ruby/test_ifunless.rb head/contrib/ruby19/test/ruby/test_iterator.rb head/contrib/ruby19/test/test_tracer.rb head/contrib/ruby19/test/rake/test_rake_extension.rb head/contrib/ruby19/test/rake/test_rake_require.rb head/contrib/ruby19/test/rake/test_rake_multi_task.rb head/contrib/ruby19/test/rake/test_rake_application_options.rb head/contrib/ruby19/test/rake/test_rake.rb head/contrib/ruby19/test/rake/test_rake_task_with_arguments.rb head/contrib/ruby19/test/rake/test_rake_directory_task.rb head/contrib/ruby19/test/rake/test_rake_task_lib.rb head/contrib/ruby19/test/rake/test_rake_path_map.rb head/contrib/ruby19/test/rake/test_rake_file_utils.rb head/contrib/ruby19/test/rake/test_rake_functional.rb head/contrib/ruby19/test/rake/test_rake_pseudo_status.rb head/contrib/ruby19/test/rake/test_rake_rdoc_task.rb head/contrib/ruby19/test/rake/test_rake_file_list.rb head/contrib/ruby19/test/rake/test_sys.rb head/contrib/ruby19/test/rake/test_rake_package_task.rb head/contrib/ruby19/test/rake/helper.rb head/contrib/ruby19/test/rake/test_rake_top_level_functions.rb head/contrib/ruby19/test/rake/test_rake_task_manager_argument_resolution.rb head/contrib/ruby19/test/rake/test_rake_clean.rb head/contrib/ruby19/test/rake/test_rake_dsl.rb head/contrib/ruby19/test/rake/test_rake_file_list_path_map.rb head/contrib/ruby19/test/rake/test_rake_file_creation_task.rb head/contrib/ruby19/test/rake/test_rake_task_argument_parsing.rb head/contrib/ruby19/test/rake/test_rake_task_arguments.rb head/contrib/ruby19/test/rake/test_rake_ftp_file.rb head/contrib/ruby19/test/rake/test_rake_rules.rb head/contrib/ruby19/test/rake/test_rake_early_time.rb head/contrib/ruby19/test/rake/test_rake_name_space.rb head/contrib/ruby19/test/rake/test_rake_task_manager.rb head/contrib/ruby19/test/rake/test_rake_test_task.rb head/contrib/ruby19/test/rake/test_rake_file_task.rb head/contrib/ruby19/test/rake/test_rake_win32.rb head/contrib/ruby19/test/rake/file_creation.rb head/contrib/ruby19/test/rake/test_rake_task.rb head/contrib/ruby19/test/rake/test_rake_application.rb head/contrib/ruby19/test/rake/test_rake_makefile_loader.rb head/contrib/ruby19/test/rake/test_rake_path_map_partial.rb head/contrib/ruby19/test/rake/test_rake_rake_test_loader.rb head/contrib/ruby19/test/rake/test_rake_path_map_explode.rb head/contrib/ruby19/test/rake/test_rake_definitions.rb head/contrib/ruby19/test/rake/test_rake_invocation_chain.rb head/contrib/ruby19/test/sdbm/test_sdbm.rb head/contrib/ruby19/test/test_open3.rb head/contrib/ruby19/test/test_timeout.rb head/contrib/ruby19/test/profile_test_all.rb head/contrib/ruby19/test/benchmark/test_benchmark.rb head/contrib/ruby19/test/uri/test_http.rb head/contrib/ruby19/test/uri/test_ldap.rb head/contrib/ruby19/test/uri/test_mailto.rb head/contrib/ruby19/test/uri/test_common.rb head/contrib/ruby19/test/uri/test_ftp.rb head/contrib/ruby19/test/uri/test_generic.rb head/contrib/ruby19/test/uri/test_parser.rb head/contrib/ruby19/test/zlib/test_zlib.rb head/contrib/ruby19/test/cgi/test_cgi_util.rb head/contrib/ruby19/test/cgi/test_cgi_modruby.rb head/contrib/ruby19/test/cgi/test_cgi_multipart.rb head/contrib/ruby19/test/cgi/test_cgi_session.rb head/contrib/ruby19/test/cgi/testdata/file1.html head/contrib/ruby19/test/cgi/testdata/small.png head/contrib/ruby19/test/cgi/testdata/small.png head/contrib/ruby19/test/cgi/testdata/large.png head/contrib/ruby19/test/cgi/testdata/large.png head/contrib/ruby19/test/cgi/test_cgi_core.rb head/contrib/ruby19/test/cgi/test_cgi_header.rb head/contrib/ruby19/test/cgi/test_cgi_cookie.rb head/contrib/ruby19/test/cgi/test_cgi_tag_helper.rb head/contrib/ruby19/test/win32ole/test_win32ole_param.rb head/contrib/ruby19/test/win32ole/orig_data.csv head/contrib/ruby19/test/win32ole/test_win32ole_variant.rb head/contrib/ruby19/test/win32ole/test_err_in_callback.rb head/contrib/ruby19/test/win32ole/test_win32ole_typelib.rb head/contrib/ruby19/test/win32ole/err_in_callback.rb head/contrib/ruby19/test/win32ole/test_nil2vtempty.rb head/contrib/ruby19/test/win32ole/test_win32ole_variant_m.rb head/contrib/ruby19/test/win32ole/test_ole_methods.rb head/contrib/ruby19/test/win32ole/test_win32ole.rb head/contrib/ruby19/test/win32ole/test_win32ole_method.rb head/contrib/ruby19/test/win32ole/test_win32ole_event.rb head/contrib/ruby19/test/win32ole/test_win32ole_type.rb head/contrib/ruby19/test/win32ole/test_folderitem2_invokeverb.rb head/contrib/ruby19/test/win32ole/test_win32ole_variant_outarg.rb head/contrib/ruby19/test/win32ole/test_thread.rb head/contrib/ruby19/test/win32ole/test_win32ole_variable.rb head/contrib/ruby19/test/win32ole/test_propertyputref.rb head/contrib/ruby19/test/win32ole/test_word.rb head/contrib/ruby19/test/xmlrpc/htpasswd head/contrib/ruby19/test/xmlrpc/test_datetime.rb head/contrib/ruby19/test/xmlrpc/test_parser.rb head/contrib/ruby19/test/xmlrpc/test_webrick_server.rb head/contrib/ruby19/test/xmlrpc/test_features.rb head/contrib/ruby19/test/xmlrpc/webrick_testing.rb head/contrib/ruby19/test/xmlrpc/test_marshal.rb head/contrib/ruby19/test/xmlrpc/data/bug_covert.xml head/contrib/ruby19/test/xmlrpc/data/bug_covert.xml head/contrib/ruby19/test/xmlrpc/data/bug_covert.expected head/contrib/ruby19/test/xmlrpc/data/xml1.xml head/contrib/ruby19/test/xmlrpc/data/xml1.xml head/contrib/ruby19/test/xmlrpc/data/xml1.expected head/contrib/ruby19/test/xmlrpc/data/datetime_iso8601.xml head/contrib/ruby19/test/xmlrpc/data/datetime_iso8601.xml head/contrib/ruby19/test/xmlrpc/data/bug_bool.xml head/contrib/ruby19/test/xmlrpc/data/bug_bool.xml head/contrib/ruby19/test/xmlrpc/data/bug_bool.expected head/contrib/ruby19/test/xmlrpc/data/bug_cdata.xml head/contrib/ruby19/test/xmlrpc/data/bug_cdata.xml head/contrib/ruby19/test/xmlrpc/data/bug_cdata.expected head/contrib/ruby19/test/xmlrpc/data/fault.xml head/contrib/ruby19/test/xmlrpc/data/fault.xml head/contrib/ruby19/test/xmlrpc/data/value.xml head/contrib/ruby19/test/xmlrpc/data/value.xml head/contrib/ruby19/test/xmlrpc/data/value.expected head/contrib/ruby19/test/xmlrpc/test_cookie.rb head/contrib/ruby19/test/test_tempfile.rb head/contrib/ruby19/test/thread/test_queue.rb head/contrib/ruby19/test/json/test_json_encoding.rb head/contrib/ruby19/test/json/test_json_unicode.rb head/contrib/ruby19/test/json/test_json_fixtures.rb head/contrib/ruby19/test/json/test_json_generate.rb head/contrib/ruby19/test/json/test_json_addition.rb head/contrib/ruby19/test/json/setup_variant.rb head/contrib/ruby19/test/json/fixtures/pass2.json head/contrib/ruby19/test/json/fixtures/pass3.json head/contrib/ruby19/test/json/fixtures/fail1.json head/contrib/ruby19/test/json/fixtures/fail2.json head/contrib/ruby19/test/json/fixtures/fail3.json head/contrib/ruby19/test/json/fixtures/fail4.json head/contrib/ruby19/test/json/fixtures/fail5.json head/contrib/ruby19/test/json/fixtures/fail6.json head/contrib/ruby19/test/json/fixtures/fail7.json head/contrib/ruby19/test/json/fixtures/fail8.json head/contrib/ruby19/test/json/fixtures/fail9.json head/contrib/ruby19/test/json/fixtures/fail10.json head/contrib/ruby19/test/json/fixtures/pass15.json head/contrib/ruby19/test/json/fixtures/fail20.json head/contrib/ruby19/test/json/fixtures/fail11.json head/contrib/ruby19/test/json/fixtures/pass16.json head/contrib/ruby19/test/json/fixtures/fail21.json head/contrib/ruby19/test/json/fixtures/fail12.json head/contrib/ruby19/test/json/fixtures/pass17.json head/contrib/ruby19/test/json/fixtures/pass26.json head/contrib/ruby19/test/json/fixtures/fail22.json head/contrib/ruby19/test/json/fixtures/fail13.json head/contrib/ruby19/test/json/fixtures/fail23.json head/contrib/ruby19/test/json/fixtures/fail14.json head/contrib/ruby19/test/json/fixtures/fail24.json head/contrib/ruby19/test/json/fixtures/fail25.json head/contrib/ruby19/test/json/fixtures/fail18.json head/contrib/ruby19/test/json/fixtures/fail27.json head/contrib/ruby19/test/json/fixtures/fail28.json head/contrib/ruby19/test/json/fixtures/fail19.json head/contrib/ruby19/test/json/fixtures/pass1.json head/contrib/ruby19/test/json/test_json.rb head/contrib/ruby19/test/json/test_json_string_matching.rb head/contrib/ruby19/test/with_different_ofs.rb head/contrib/ruby19/test/test_delegate.rb head/contrib/ruby19/test/test_tsort.rb head/contrib/ruby19/test/testunit/test_rake_integration.rb head/contrib/ruby19/test/testunit/test_assertion.rb head/contrib/ruby19/test/testunit/test_parallel.rb head/contrib/ruby19/test/testunit/test_hideskip.rb head/contrib/ruby19/test/testunit/tests_for_parallel/ptest_third.rb head/contrib/ruby19/test/testunit/tests_for_parallel/runner.rb head/contrib/ruby19/test/testunit/tests_for_parallel/ptest_second.rb head/contrib/ruby19/test/testunit/tests_for_parallel/ptest_forth.rb head/contrib/ruby19/test/testunit/tests_for_parallel/ptest_first.rb head/contrib/ruby19/test/testunit/test4test_hideskip.rb head/contrib/ruby19/test/inlinetest.rb head/contrib/ruby19/test/net/pop/test_pop.rb head/contrib/ruby19/test/net/http/test_httpheader.rb head/contrib/ruby19/test/net/http/test_buffered_io.rb head/contrib/ruby19/test/net/http/test_httpresponse.rb head/contrib/ruby19/test/net/http/test_http.rb head/contrib/ruby19/test/net/http/utils.rb head/contrib/ruby19/test/net/http/test_https.rb head/contrib/ruby19/test/net/http/test_https_proxy.rb head/contrib/ruby19/test/net/protocol/test_protocol.rb head/contrib/ruby19/test/net/smtp/test_response.rb head/contrib/ruby19/test/net/smtp/test_smtp.rb head/contrib/ruby19/test/net/smtp/test_ssl_socket.rb head/contrib/ruby19/test/net/imap/test_imap.rb head/contrib/ruby19/test/net/imap/server.crt head/contrib/ruby19/test/net/imap/server.key head/contrib/ruby19/test/net/imap/cacert.pem head/contrib/ruby19/test/net/imap/test_imap_response_parser.rb head/contrib/ruby19/test/psych/test_hash.rb head/contrib/ruby19/test/psych/test_struct.rb head/contrib/ruby19/test/psych/test_psych.rb head/contrib/ruby19/test/psych/test_tainted.rb head/contrib/ruby19/test/psych/test_merge_keys.rb head/contrib/ruby19/test/psych/test_stream.rb head/contrib/ruby19/test/psych/test_date_time.rb head/contrib/ruby19/test/psych/test_omap.rb head/contrib/ruby19/test/psych/test_parser.rb head/contrib/ruby19/test/psych/test_deprecated.rb head/contrib/ruby19/test/psych/test_yaml.rb head/contrib/ruby19/test/psych/test_scalar.rb head/contrib/ruby19/test/psych/test_alias_and_anchor.rb head/contrib/ruby19/test/psych/test_string.rb head/contrib/ruby19/test/psych/test_object.rb head/contrib/ruby19/test/psych/nodes/test_enumerable.rb head/contrib/ruby19/test/psych/test_null.rb head/contrib/ruby19/test/psych/test_serialize_subclasses.rb head/contrib/ruby19/test/psych/test_scalar_scanner.rb head/contrib/ruby19/test/psych/test_array.rb head/contrib/ruby19/test/psych/test_boolean.rb head/contrib/ruby19/test/psych/helper.rb head/contrib/ruby19/test/psych/test_to_yaml_properties.rb head/contrib/ruby19/test/psych/test_encoding.rb head/contrib/ruby19/test/psych/test_json_tree.rb head/contrib/ruby19/test/psych/test_set.rb head/contrib/ruby19/test/psych/test_coder.rb head/contrib/ruby19/test/psych/test_exception.rb head/contrib/ruby19/test/psych/test_engine_manager.rb head/contrib/ruby19/test/psych/test_numeric.rb head/contrib/ruby19/test/psych/test_symbol.rb head/contrib/ruby19/test/psych/test_tree_builder.rb head/contrib/ruby19/test/psych/test_class.rb head/contrib/ruby19/test/psych/test_object_references.rb head/contrib/ruby19/test/psych/json/test_stream.rb head/contrib/ruby19/test/psych/test_emitter.rb head/contrib/ruby19/test/psych/test_document.rb head/contrib/ruby19/test/psych/visitors/test_to_ruby.rb head/contrib/ruby19/test/psych/visitors/test_emitter.rb head/contrib/ruby19/test/psych/visitors/test_depth_first.rb head/contrib/ruby19/test/psych/visitors/test_yaml_tree.rb head/contrib/ruby19/test/psych/test_nil.rb head/contrib/ruby19/test/monitor/test_monitor.rb head/contrib/ruby19/test/test_shellwords.rb head/contrib/ruby19/test/fiddle/helper.rb head/contrib/ruby19/test/fiddle/test_function.rb head/contrib/ruby19/test/fiddle/test_fiddle.rb head/contrib/ruby19/test/fiddle/test_closure.rb head/contrib/ruby19/test/misc/test_ruby_mode.rb head/contrib/ruby19/test/csv/test_row.rb head/contrib/ruby19/test/csv/test_table.rb head/contrib/ruby19/test/csv/test_encodings.rb head/contrib/ruby19/test/csv/base.rb head/contrib/ruby19/test/csv/test_headers.rb head/contrib/ruby19/test/csv/line_endings.gz head/contrib/ruby19/test/csv/line_endings.gz head/contrib/ruby19/test/csv/test_serialization.rb head/contrib/ruby19/test/csv/test_csv_parsing.rb head/contrib/ruby19/test/csv/test_csv_writing.rb head/contrib/ruby19/test/csv/test_features.rb head/contrib/ruby19/test/csv/ts_all.rb head/contrib/ruby19/test/csv/test_interface.rb head/contrib/ruby19/test/csv/test_data_converters.rb head/contrib/ruby19/test/test_set.rb head/contrib/ruby19/test/pathname/test_pathname.rb head/contrib/ruby19/test/rubygems/test_gem_gem_path_searcher.rb head/contrib/ruby19/test/rubygems/test_gem_commands_generate_index_command.rb head/contrib/ruby19/test/rubygems/test_gem_uninstaller.rb head/contrib/ruby19/test/rubygems/plugin/standarderror/rubygems_plugin.rb head/contrib/ruby19/test/rubygems/plugin/exception/rubygems_plugin.rb head/contrib/ruby19/test/rubygems/plugin/load/rubygems_plugin.rb head/contrib/ruby19/test/rubygems/test_gem_ext_configure_builder.rb head/contrib/ruby19/test/rubygems/test_gem_commands_lock_command.rb head/contrib/ruby19/test/rubygems/test_gem_command_manager.rb head/contrib/ruby19/test/rubygems/test_gem_ext_rake_builder.rb head/contrib/ruby19/test/rubygems/test_gem_dependency_list.rb head/contrib/ruby19/test/rubygems/test_gem_commands_contents_command.rb head/contrib/ruby19/test/rubygems/test_config.rb head/contrib/ruby19/test/rubygems/test_gem_package_task.rb head/contrib/ruby19/test/rubygems/data/gem-public_cert.pem head/contrib/ruby19/test/rubygems/data/null-type.gemspec.rz head/contrib/ruby19/test/rubygems/data/null-type.gemspec.rz head/contrib/ruby19/test/rubygems/data/gem-private_key.pem head/contrib/ruby19/test/rubygems/test_gem_package_tar_output.rb head/contrib/ruby19/test/rubygems/fake_certlib/openssl.rb head/contrib/ruby19/test/rubygems/insure_session.rb head/contrib/ruby19/test/rubygems/test_gem_platform.rb head/contrib/ruby19/test/rubygems/test_gem_builder.rb head/contrib/ruby19/test/rubygems/test_gem_source_index.rb head/contrib/ruby19/test/rubygems/ca_cert.pem head/contrib/ruby19/test/rubygems/test_gem_stream_ui.rb head/contrib/ruby19/test/rubygems/foo/discover.rb head/contrib/ruby19/test/rubygems/test_gem_gemcutter_utilities.rb head/contrib/ruby19/test/rubygems/bogussources.rb head/contrib/ruby19/test/rubygems/test_gem_config_file.rb head/contrib/ruby19/test/rubygems/test_gem_server.rb head/contrib/ruby19/test/rubygems/test_gem_security.rb head/contrib/ruby19/test/rubygems/test_gem_commands_help_command.rb head/contrib/ruby19/test/rubygems/test_gem_commands_fetch_command.rb head/contrib/ruby19/test/rubygems/private_key.pem head/contrib/ruby19/test/rubygems/test_gem_commands_owner_command.rb head/contrib/ruby19/test/rubygems/test_gem_commands_pristine_command.rb head/contrib/ruby19/test/rubygems/test_gem_dependency.rb head/contrib/ruby19/test/rubygems/test_gem.rb head/contrib/ruby19/test/rubygems/test_gem_local_remote_options.rb head/contrib/ruby19/test/rubygems/public_cert.pem head/contrib/ruby19/test/rubygems/test_gem_install_update_options.rb head/contrib/ruby19/test/rubygems/sff/discover.rb head/contrib/ruby19/test/rubygems/test_gem_path_support.rb head/contrib/ruby19/test/rubygems/test_gem_commands_uninstall_command.rb head/contrib/ruby19/test/rubygems/test_kernel.rb head/contrib/ruby19/test/rubygems/test_gem_spec_fetcher.rb head/contrib/ruby19/test/rubygems/test_gem_commands_list_command.rb head/contrib/ruby19/test/rubygems/test_gem_dependency_installer.rb head/contrib/ruby19/test/rubygems/test_gem_silent_ui.rb head/contrib/ruby19/test/rubygems/test_gem_installer.rb head/contrib/ruby19/test/rubygems/test_gem_commands_push_command.rb head/contrib/ruby19/test/rubygems/test_gem_requirement.rb head/contrib/ruby19/test/rubygems/test_gem_gem_runner.rb head/contrib/ruby19/test/rubygems/test_gem_commands_cleanup_command.rb head/contrib/ruby19/test/rubygems/test_gem_package_tar_header.rb head/contrib/ruby19/test/rubygems/test_gem_version_option.rb head/contrib/ruby19/test/rubygems/test_gem_commands_build_command.rb head/contrib/ruby19/test/rubygems/test_gem_command.rb head/contrib/ruby19/test/rubygems/test_gem_package_tar_input.rb head/contrib/ruby19/test/rubygems/test_gem_commands_environment_command.rb head/contrib/ruby19/test/rubygems/test_gem_package_tar_reader.rb head/contrib/ruby19/test/rubygems/test_gem_text.rb head/contrib/ruby19/test/rubygems/rubygems_plugin.rb head/contrib/ruby19/test/rubygems/test_gem_validator.rb head/contrib/ruby19/test/rubygems/test_gem_commands_server_command.rb head/contrib/ruby19/test/rubygems/test_gem_commands_stale_command.rb head/contrib/ruby19/test/rubygems/test_gem_commands_outdated_command.rb head/contrib/ruby19/test/rubygems/simple_gem.rb head/contrib/ruby19/test/rubygems/test_gem_remote_fetcher.rb head/contrib/ruby19/test/rubygems/test_gem_package_tar_writer.rb head/contrib/ruby19/test/rubygems/test_gem_commands_dependency_command.rb head/contrib/ruby19/test/rubygems/test_gem_indexer.rb head/contrib/ruby19/test/rubygems/test_gem_doc_manager.rb head/contrib/ruby19/test/rubygems/test_gem_commands_unpack_command.rb head/contrib/ruby19/test/rubygems/ssl_key.pem head/contrib/ruby19/test/rubygems/test_gem_commands_update_command.rb head/contrib/ruby19/test/rubygems/test_gem_commands_sources_command.rb head/contrib/ruby19/test/rubygems/test_gem_package_tar_reader_entry.rb head/contrib/ruby19/test/rubygems/rubygems/commands/crash_command.rb head/contrib/ruby19/test/rubygems/ssl_cert.pem head/contrib/ruby19/test/rubygems/fix_openssl_warnings.rb head/contrib/ruby19/test/rubygems/test_gem_commands_cert_command.rb head/contrib/ruby19/test/rubygems/test_gem_specification.rb head/contrib/ruby19/test/rubygems/test_gem_commands_which_command.rb head/contrib/ruby19/test/rubygems/test_gem_commands_query_command.rb head/contrib/ruby19/test/rubygems/test_gem_version.rb head/contrib/ruby19/test/rubygems/test_gem_commands_install_command.rb head/contrib/ruby19/test/rubygems/test_gem_format.rb head/contrib/ruby19/test/rubygems/test_gem_ext_ext_conf_builder.rb head/contrib/ruby19/test/rubygems/test_gem_commands_check_command.rb head/contrib/ruby19/test/rubygems/test_gem_commands_specification_command.rb head/contrib/ruby19/test/rinda/test_tuplebag.rb head/contrib/ruby19/test/rinda/test_rinda.rb head/contrib/ruby19/test/dbm/test_dbm.rb head/contrib/ruby19/test/test_singleton.rb head/contrib/ruby19/test/drb/test_acl.rb head/contrib/ruby19/test/drb/ut_array_drbssl.rb head/contrib/ruby19/test/drb/ut_eval.rb head/contrib/ruby19/test/drb/ut_large.rb head/contrib/ruby19/test/drb/test_drb.rb head/contrib/ruby19/test/drb/ut_safe1.rb head/contrib/ruby19/test/drb/drbtest.rb head/contrib/ruby19/test/drb/ignore_test_drb.rb head/contrib/ruby19/test/drb/test_drbunix.rb head/contrib/ruby19/test/drb/ut_drb_drbunix.rb head/contrib/ruby19/test/drb/ut_eq.rb head/contrib/ruby19/test/drb/ut_drb.rb head/contrib/ruby19/test/drb/ut_array_drbunix.rb head/contrib/ruby19/test/drb/ut_timerholder.rb head/contrib/ruby19/test/drb/ut_array.rb head/contrib/ruby19/test/drb/ut_drb_drbssl.rb head/contrib/ruby19/test/drb/test_drbssl.rb head/contrib/ruby19/test/drb/ut_port.rb head/contrib/ruby19/test/test_mathn.rb head/contrib/ruby19/test/resolv/test_dns.rb head/contrib/ruby19/test/resolv/test_addr.rb head/contrib/ruby19/test/etc/test_etc.rb head/contrib/ruby19/test/test_pty.rb head/contrib/ruby19/test/digest/test_digest.rb head/contrib/ruby19/test/digest/test_digest_extend.rb head/contrib/ruby19/test/digest/test_digest_hmac.rb head/contrib/ruby19/test/test_mutex_m.rb head/contrib/ruby19/test/bigdecimal/test_bigmath.rb head/contrib/ruby19/test/bigdecimal/testbase.rb head/contrib/ruby19/test/bigdecimal/test_bigdecimal_util.rb head/contrib/ruby19/test/bigdecimal/test_bigdecimal.rb head/contrib/ruby19/test/test_pp.rb head/contrib/ruby19/test/test_syslog.rb head/contrib/ruby19/test/objspace/test_objspace.rb head/contrib/ruby19/test/rdoc/test_rdoc_markup_parser.rb head/contrib/ruby19/test/rdoc/test_rdoc_markup_to_ansi.rb head/contrib/ruby19/test/rdoc/test_rdoc_require.rb head/contrib/ruby19/test/rdoc/test_rdoc_rubygems_hook.rb head/contrib/ruby19/test/rdoc/test_rdoc_normal_class.rb head/contrib/ruby19/test/rdoc/test.ja.txt head/contrib/ruby19/test/rdoc/test.ja.txt head/contrib/ruby19/test/rdoc/test_rdoc_markup_formatter.rb head/contrib/ruby19/test/rdoc/test_rdoc_include.rb head/contrib/ruby19/test/rdoc/test_rdoc_markup_paragraph.rb head/contrib/ruby19/test/rdoc/test_rdoc_text.rb head/contrib/ruby19/test/rdoc/test.txt head/contrib/ruby19/test/rdoc/README head/contrib/ruby19/test/rdoc/test_rdoc_ri_driver.rb head/contrib/ruby19/test/rdoc/test_rdoc_encoding.rb head/contrib/ruby19/test/rdoc/test_rdoc_ri_store.rb head/contrib/ruby19/test/rdoc/test.ja.rdoc head/contrib/ruby19/test/rdoc/test.ja.rdoc head/contrib/ruby19/test/rdoc/test_rdoc_any_method.rb head/contrib/ruby19/test/rdoc/xref_data.rb head/contrib/ruby19/test/rdoc/test_rdoc_ruby_lex.rb head/contrib/ruby19/test/rdoc/test_rdoc_alias.rb head/contrib/ruby19/test/rdoc/test_rdoc_options.rb head/contrib/ruby19/test/rdoc/test_rdoc_parser_ruby.rb head/contrib/ruby19/test/rdoc/test_rdoc_parser_c.rb head/contrib/ruby19/test/rdoc/test_rdoc_generator_darkfish.rb head/contrib/ruby19/test/rdoc/test_rdoc_task.rb head/contrib/ruby19/test/rdoc/hidden.zip.txt head/contrib/ruby19/test/rdoc/hidden.zip.txt head/contrib/ruby19/test/rdoc/test_rdoc_parser_simple.rb head/contrib/ruby19/test/rdoc/test_rdoc_single_class.rb head/contrib/ruby19/test/rdoc/test_rdoc_cross_reference.rb head/contrib/ruby19/test/rdoc/test_rdoc_context_section.rb head/contrib/ruby19/test/rdoc/test_rdoc_markup_to_tt_only.rb head/contrib/ruby19/test/rdoc/test_rdoc_attr.rb head/contrib/ruby19/test/rdoc/test_rdoc_method_attr.rb head/contrib/ruby19/test/rdoc/test_rdoc_markup_attribute_manager.rb head/contrib/ruby19/test/rdoc/test.ja.large.rdoc head/contrib/ruby19/test/rdoc/test.ja.large.rdoc head/contrib/ruby19/test/rdoc/test_rdoc_generator_ri.rb head/contrib/ruby19/test/rdoc/binary.dat head/contrib/ruby19/test/rdoc/binary.dat head/contrib/ruby19/test/rdoc/test_rdoc_context.rb head/contrib/ruby19/test/rdoc/test_rdoc_markup_to_html.rb head/contrib/ruby19/test/rdoc/test_rdoc_markup_to_bs.rb head/contrib/ruby19/test/rdoc/test_attribute_manager.rb head/contrib/ruby19/test/rdoc/test_rdoc_rdoc.rb head/contrib/ruby19/test/rdoc/xref_test_case.rb head/contrib/ruby19/test/rdoc/test_rdoc_top_level.rb head/contrib/ruby19/test/rdoc/test_rdoc_constant.rb head/contrib/ruby19/test/rdoc/test_rdoc_markup_to_html_crossref.rb head/contrib/ruby19/test/rdoc/test_rdoc_parser.rb head/contrib/ruby19/test/rdoc/test_rdoc_markup_document.rb head/contrib/ruby19/test/rdoc/test_rdoc_normal_module.rb head/contrib/ruby19/test/rdoc/test_rdoc_markup_indented_paragraph.rb head/contrib/ruby19/test/rdoc/test_rdoc_stats.rb head/contrib/ruby19/test/rdoc/test_rdoc_markup.rb head/contrib/ruby19/test/rdoc/test_rdoc_code_object.rb head/contrib/ruby19/test/rdoc/test_rdoc_markup_pre_process.rb head/contrib/ruby19/test/rdoc/test_rdoc_markup_raw.rb head/contrib/ruby19/test/rdoc/test_rdoc_markup_to_rdoc.rb head/contrib/ruby19/test/rdoc/test_rdoc_ri_paths.rb head/contrib/ruby19/test/rdoc/test_rdoc_class_module.rb head/contrib/ruby19/test/test_securerandom.rb head/contrib/ruby19/test/-ext-/test_bug-3571.rb head/contrib/ruby19/test/-ext-/test_bug-3662.rb head/contrib/ruby19/test/-ext-/array/test_resize.rb head/contrib/ruby19/test/-ext-/load/test_dot_dot.rb head/contrib/ruby19/test/-ext-/win32/test_dln.rb head/contrib/ruby19/test/-ext-/win32/test_fd_setsize.rb head/contrib/ruby19/test/-ext-/funcall/test_passing_block.rb head/contrib/ruby19/test/-ext-/old_thread_select/test_old_thread_select.rb head/contrib/ruby19/test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb head/contrib/ruby19/test/-ext-/st/test_numhash.rb head/contrib/ruby19/test/-ext-/string/test_modify_expand.rb head/contrib/ruby19/test/-ext-/string/test_set_len.rb head/contrib/ruby19/test/-ext-/string/test_cstr.rb head/contrib/ruby19/test/-ext-/string/test_ellipsize.rb head/contrib/ruby19/test/-ext-/string/test_enc_associate.rb head/contrib/ruby19/test/coverage/test_coverage.rb head/contrib/ruby19/test/test_cmath.rb head/contrib/ruby19/test/optparse/test_optarg.rb head/contrib/ruby19/test/optparse/test_optparse.rb head/contrib/ruby19/test/optparse/test_summary.rb head/contrib/ruby19/test/optparse/test_zsh_completion.rb head/contrib/ruby19/test/optparse/test_placearg.rb head/contrib/ruby19/test/optparse/test_reqarg.rb head/contrib/ruby19/test/optparse/test_getopts.rb head/contrib/ruby19/test/optparse/test_bash_completion.rb head/contrib/ruby19/test/optparse/test_noarg.rb head/contrib/ruby19/test/open-uri/test_open-uri.rb head/contrib/ruby19/test/open-uri/test_ssl.rb head/contrib/ruby19/test/test_time.rb head/contrib/ruby19/test/dl/test_cptr.rb head/contrib/ruby19/test/dl/test_base.rb head/contrib/ruby19/test/dl/test_import.rb head/contrib/ruby19/test/dl/test_func.rb head/contrib/ruby19/test/dl/test_handle.rb head/contrib/ruby19/test/dl/test_callback.rb head/contrib/ruby19/test/dl/test_cfunc.rb head/contrib/ruby19/test/dl/test_cparser.rb head/contrib/ruby19/test/dl/test_dl2.rb head/contrib/ruby19/test/dl/test_win32.rb head/contrib/ruby19/test/fileutils/test_fileutils.rb head/contrib/ruby19/test/fileutils/test_dryrun.rb head/contrib/ruby19/test/fileutils/fileasserts.rb head/contrib/ruby19/test/fileutils/test_verbose.rb head/contrib/ruby19/test/fileutils/test_nowrite.rb head/contrib/ruby19/test/fileutils/clobber.rb head/contrib/ruby19/test/ostruct/test_ostruct.rb head/contrib/ruby19/test/test_ipaddr.rb head/contrib/ruby19/test/matrix/test_vector.rb head/contrib/ruby19/test/matrix/test_matrix.rb head/contrib/ruby19/test/test_prettyprint.rb head/contrib/ruby19/test/test_prime.rb head/contrib/ruby19/test/date/test_date_new.rb head/contrib/ruby19/test/date/test_date_attr.rb head/contrib/ruby19/test/date/test_date_base.rb head/contrib/ruby19/test/date/test_date_parse.rb head/contrib/ruby19/test/date/test_date_strftime.rb head/contrib/ruby19/test/date/test_date.rb head/contrib/ruby19/test/date/test_date_compat.rb head/contrib/ruby19/test/date/test_switch_hitter.rb head/contrib/ruby19/test/date/test_date_conv.rb head/contrib/ruby19/test/date/test_date_arith.rb head/contrib/ruby19/test/date/test_date_marshal.rb head/contrib/ruby19/test/date/test_date_strptime.rb head/contrib/ruby19/test/test_pstore.rb head/contrib/ruby19/test/nkf/test_kconv.rb head/contrib/ruby19/test/nkf/test_nkf.rb head/contrib/ruby19/test/test_find.rb head/contrib/ruby19/test/readline/test_readline.rb head/contrib/ruby19/test/readline/test_readline_history.rb head/contrib/ruby19/test/openssl/test_cipher.rb head/contrib/ruby19/test/openssl/test_pkey_rsa.rb head/contrib/ruby19/test/openssl/test_x509req.rb head/contrib/ruby19/test/openssl/test_pkey_ec.rb head/contrib/ruby19/test/openssl/test_digest.rb head/contrib/ruby19/test/openssl/test_x509store.rb head/contrib/ruby19/test/openssl/test_x509cert.rb head/contrib/ruby19/test/openssl/test_pkey_dh.rb head/contrib/ruby19/test/openssl/test_x509ext.rb head/contrib/ruby19/test/openssl/test_pkcs7.rb head/contrib/ruby19/test/openssl/ssl_server.rb head/contrib/ruby19/test/openssl/test_pair.rb head/contrib/ruby19/test/openssl/test_bn.rb head/contrib/ruby19/test/openssl/test_pkey_dsa.rb head/contrib/ruby19/test/openssl/utils.rb head/contrib/ruby19/test/openssl/test_ssl.rb head/contrib/ruby19/test/openssl/test_asn1.rb head/contrib/ruby19/test/openssl/test_pkcs12.rb head/contrib/ruby19/test/openssl/test_ocsp.rb head/contrib/ruby19/test/openssl/test_ssl_session.rb head/contrib/ruby19/test/openssl/test_engine.rb head/contrib/ruby19/test/openssl/test_config.rb head/contrib/ruby19/test/openssl/test_ns_spki.rb head/contrib/ruby19/test/openssl/test_x509crl.rb head/contrib/ruby19/test/openssl/test_x509name.rb head/contrib/ruby19/test/openssl/test_buffering.rb head/contrib/ruby19/test/openssl/test_hmac.rb head/contrib/ruby19/test/base64/test_base64.rb head/contrib/ruby19/test/webrick/test_filehandler.rb head/contrib/ruby19/test/webrick/test_httputils.rb head/contrib/ruby19/test/webrick/test_utils.rb head/contrib/ruby19/test/webrick/test_httpauth.rb head/contrib/ruby19/test/webrick/test_httpproxy.rb head/contrib/ruby19/test/webrick/utils.rb head/contrib/ruby19/test/webrick/test_cgi.rb head/contrib/ruby19/test/webrick/test_httpversion.rb head/contrib/ruby19/test/webrick/webrick_long_filename.cgi head/contrib/ruby19/test/webrick/test_httpserver.rb head/contrib/ruby19/test/webrick/test_server.rb head/contrib/ruby19/test/webrick/webrick.cgi head/contrib/ruby19/test/webrick/test_httprequest.rb head/contrib/ruby19/test/webrick/test_cookie.rb head/contrib/ruby19/test/webrick/.htaccess head/contrib/ruby19/test/rexml/test_xpathtext.rb head/contrib/ruby19/test/rexml/test_ticket_80.rb head/contrib/ruby19/test/rexml/test_attributes_mixin.rb head/contrib/ruby19/test/rexml/test_stream.rb head/contrib/ruby19/test/rexml/test_sax.rb head/contrib/ruby19/test/rexml/test_rexml_issuezilla.rb head/contrib/ruby19/test/rexml/test_namespace.rb head/contrib/ruby19/test/rexml/test_xpath_attribute_query.rb head/contrib/ruby19/test/rexml/test_xpath_pred.rb head/contrib/ruby19/test/rexml/test_light.rb head/contrib/ruby19/test/rexml/rexml_test_utils.rb head/contrib/ruby19/test/rexml/test_martin_fowler.rb head/contrib/ruby19/test/rexml/test_xpath_msw.rb head/contrib/ruby19/test/rexml/test_order.rb head/contrib/ruby19/test/rexml/test_elements.rb head/contrib/ruby19/test/rexml/test_entity.rb head/contrib/ruby19/test/rexml/test_functions_number.rb head/contrib/ruby19/test/rexml/test_xml_declaration_parent_child.rb head/contrib/ruby19/test/rexml/test_lightparser.rb head/contrib/ruby19/test/rexml/test_changing_encoding.rb head/contrib/ruby19/test/rexml/test_xpath.rb head/contrib/ruby19/test/rexml/listener.rb head/contrib/ruby19/test/rexml/test_attributes.rb head/contrib/ruby19/test/rexml/test_encoding.rb head/contrib/ruby19/test/rexml/test_notationdecl_mixin.rb head/contrib/ruby19/test/rexml/test_core.rb head/contrib/ruby19/test/rexml/test_pullparser.rb head/contrib/ruby19/test/rexml/test_validation_rng.rb head/contrib/ruby19/test/rexml/test_contrib.rb head/contrib/ruby19/test/rexml/test_comment.rb head/contrib/ruby19/test/rexml/test_jaxen.rb head/contrib/ruby19/test/rexml/test_encoding_2.rb head/contrib/ruby19/test/rexml/test_doctype.rb head/contrib/ruby19/test/rexml/test_preceding_sibling.rb head/contrib/ruby19/test/rexml/test_functions.rb head/contrib/ruby19/test/rexml/data/jaxen3.xml head/contrib/ruby19/test/rexml/data/jaxen3.xml head/contrib/ruby19/test/rexml/data/ticket_61.xml head/contrib/ruby19/test/rexml/data/ticket_61.xml head/contrib/ruby19/test/rexml/data/simple.xml head/contrib/ruby19/test/rexml/data/simple.xml head/contrib/ruby19/test/rexml/data/ticket_110_utf16.xml head/contrib/ruby19/test/rexml/data/ticket_110_utf16.xml head/contrib/ruby19/test/rexml/data/moreover.xml head/contrib/ruby19/test/rexml/data/moreover.xml head/contrib/ruby19/test/rexml/data/web2.xml head/contrib/ruby19/test/rexml/data/web2.xml head/contrib/ruby19/test/rexml/data/ticket_68.xml head/contrib/ruby19/test/rexml/data/ticket_68.xml head/contrib/ruby19/test/rexml/data/lang0.xml head/contrib/ruby19/test/rexml/data/tutorial.xml head/contrib/ruby19/test/rexml/data/tutorial.xml head/contrib/ruby19/test/rexml/data/doctype_test.xml head/contrib/ruby19/test/rexml/data/project.xml head/contrib/ruby19/test/rexml/data/pi.xml head/contrib/ruby19/test/rexml/data/pi.xml head/contrib/ruby19/test/rexml/data/t63-1.xml head/contrib/ruby19/test/rexml/data/t63-1.xml head/contrib/ruby19/test/rexml/data/numbers.xml head/contrib/ruby19/test/rexml/data/numbers.xml head/contrib/ruby19/test/rexml/data/google.2.xml head/contrib/ruby19/test/rexml/data/euc.xml head/contrib/ruby19/test/rexml/data/euc.xml head/contrib/ruby19/test/rexml/data/web.xml head/contrib/ruby19/test/rexml/data/web.xml head/contrib/ruby19/test/rexml/data/namespaces.xml head/contrib/ruby19/test/rexml/data/namespaces.xml head/contrib/ruby19/test/rexml/data/much_ado.xml head/contrib/ruby19/test/rexml/data/much_ado.xml head/contrib/ruby19/test/rexml/data/fibo.xml head/contrib/ruby19/test/rexml/data/fibo.xml head/contrib/ruby19/test/rexml/data/testNamespaces.xml head/contrib/ruby19/test/rexml/data/yahoo.xml head/contrib/ruby19/test/rexml/data/yahoo.xml head/contrib/ruby19/test/rexml/data/lang.xml head/contrib/ruby19/test/rexml/data/lang.xml head/contrib/ruby19/test/rexml/data/foo.xml head/contrib/ruby19/test/rexml/data/foo.xml head/contrib/ruby19/test/rexml/data/basicupdate.xml head/contrib/ruby19/test/rexml/data/basicupdate.xml head/contrib/ruby19/test/rexml/data/iso8859-1.xml head/contrib/ruby19/test/rexml/data/iso8859-1.xml head/contrib/ruby19/test/rexml/data/LostineRiver.kml.gz head/contrib/ruby19/test/rexml/data/LostineRiver.kml.gz head/contrib/ruby19/test/rexml/data/testsrc.xml head/contrib/ruby19/test/rexml/data/testsrc.xml head/contrib/ruby19/test/rexml/data/pi2.xml head/contrib/ruby19/test/rexml/data/pi2.xml head/contrib/ruby19/test/rexml/data/stream_accents.xml head/contrib/ruby19/test/rexml/data/stream_accents.xml head/contrib/ruby19/test/rexml/data/id.xml head/contrib/ruby19/test/rexml/data/id.xml head/contrib/ruby19/test/rexml/data/contents.xml head/contrib/ruby19/test/rexml/data/contents.xml head/contrib/ruby19/test/rexml/data/ofbiz-issues-full-177.xml head/contrib/ruby19/test/rexml/data/ofbiz-issues-full-177.xml head/contrib/ruby19/test/rexml/data/nitf.xml head/contrib/ruby19/test/rexml/data/nitf.xml head/contrib/ruby19/test/rexml/data/xp.tst head/contrib/ruby19/test/rexml/data/defaultNamespace.xml head/contrib/ruby19/test/rexml/data/defaultNamespace.xml head/contrib/ruby19/test/rexml/data/axis.xml head/contrib/ruby19/test/rexml/data/axis.xml head/contrib/ruby19/test/rexml/data/evaluate.xml head/contrib/ruby19/test/rexml/data/evaluate.xml head/contrib/ruby19/test/rexml/data/documentation.xml head/contrib/ruby19/test/rexml/data/documentation.xml head/contrib/ruby19/test/rexml/data/underscore.xml head/contrib/ruby19/test/rexml/data/underscore.xml head/contrib/ruby19/test/rexml/data/t63-2.svg head/contrib/ruby19/test/rexml/data/jaxen24.xml head/contrib/ruby19/test/rexml/data/jaxen24.xml head/contrib/ruby19/test/rexml/data/xmlfile-bug.xml head/contrib/ruby19/test/rexml/data/xmlfile-bug.xml head/contrib/ruby19/test/rexml/data/t75.xml head/contrib/ruby19/test/rexml/data/t75.xml head/contrib/ruby19/test/rexml/data/dash.xml head/contrib/ruby19/test/rexml/data/dash.xml head/contrib/ruby19/test/rexml/data/test/tests.xsl head/contrib/ruby19/test/rexml/data/test/tests.xml head/contrib/ruby19/test/rexml/data/test/tests.xml head/contrib/ruby19/test/rexml/data/basic.xml head/contrib/ruby19/test/rexml/data/basic.xml head/contrib/ruby19/test/rexml/data/ProductionSupport.xml head/contrib/ruby19/test/rexml/data/ProductionSupport.xml head/contrib/ruby19/test/rexml/data/message.xml head/contrib/ruby19/test/rexml/data/message.xml head/contrib/ruby19/test/rexml/data/text.xml head/contrib/ruby19/test/rexml/data/text.xml head/contrib/ruby19/test/rexml/data/bad.xml head/contrib/ruby19/test/rexml/data/working.rss head/contrib/ruby19/test/rexml/data/working.rss head/contrib/ruby19/test/rexml/data/broken.rss head/contrib/ruby19/test/rexml/data/broken.rss head/contrib/ruby19/test/rexml/test_notationdecl_parsetest.rb head/contrib/ruby19/test/rexml/test_document.rb head/contrib/ruby19/test/rexml/test_listener.rb head/contrib/ruby19/test/socket/test_sockopt.rb head/contrib/ruby19/test/socket/test_unix.rb head/contrib/ruby19/test/socket/test_nonblock.rb head/contrib/ruby19/test/socket/test_addrinfo.rb head/contrib/ruby19/test/socket/test_tcp.rb head/contrib/ruby19/test/socket/test_socket.rb head/contrib/ruby19/test/socket/test_udp.rb head/contrib/ruby19/test/socket/test_basicsocket.rb head/contrib/ruby19/test/socket/test_ancdata.rb head/contrib/ruby19/test/mkmf/base.rb head/contrib/ruby19/test/mkmf/test_convertible.rb head/contrib/ruby19/test/mkmf/test_flags.rb head/contrib/ruby19/test/mkmf/test_framework.rb head/contrib/ruby19/test/mkmf/test_sizeof.rb head/contrib/ruby19/test/mkmf/test_find_executable.rb head/contrib/ruby19/test/mkmf/test_signedness.rb head/contrib/ruby19/test/scanf/test_scanfio.rb head/contrib/ruby19/test/scanf/data.txt head/contrib/ruby19/test/scanf/test_scanfblocks.rb head/contrib/ruby19/test/scanf/test_scanf.rb head/contrib/ruby19/test/minitest/test_minitest_unit.rb head/contrib/ruby19/test/minitest/test_minitest_mock.rb head/contrib/ruby19/test/minitest/test_minitest_benchmark.rb head/contrib/ruby19/test/minitest/test_minitest_spec.rb head/contrib/ruby19/dmyversion.c head/contrib/ruby19/siphash.c head/contrib/ruby19/configure head/contrib/ruby19/vmtc.inc head/contrib/ruby19/Makefile.in head/contrib/ruby19/cont.c head/contrib/ruby19/siphash.h head/contrib/ruby19/vm_dump.c head/contrib/ruby19/thread.c head/contrib/ruby19/benchmark/prepare_so_k_nucleotide.rb head/contrib/ruby19/benchmark/bm_vm2_poly_method.rb head/contrib/ruby19/benchmark/bm_vm_thread_alive_check1.rb head/contrib/ruby19/benchmark/bm_vm_thread_create_join.rb head/contrib/ruby19/benchmark/bm_so_nsieve_bits.rb head/contrib/ruby19/benchmark/bm_vm2_poly_method_ov.rb head/contrib/ruby19/benchmark/bm_vm_thread_mutex1.rb head/contrib/ruby19/benchmark/bm_so_nbody.rb head/contrib/ruby19/benchmark/bm_so_nested_loop.rb head/contrib/ruby19/benchmark/bm_so_array.rb head/contrib/ruby19/benchmark/bm_loop_for.rb head/contrib/ruby19/benchmark/bm_app_tak.rb head/contrib/ruby19/benchmark/other-lang/tak.py head/contrib/ruby19/benchmark/other-lang/ack.pl head/contrib/ruby19/benchmark/other-lang/fib.pl head/contrib/ruby19/benchmark/other-lang/loop.rb head/contrib/ruby19/benchmark/other-lang/fact.rb head/contrib/ruby19/benchmark/other-lang/ack.scm head/contrib/ruby19/benchmark/other-lang/tak.rb head/contrib/ruby19/benchmark/other-lang/fib.scm head/contrib/ruby19/benchmark/other-lang/loop.pl head/contrib/ruby19/benchmark/other-lang/ack.py head/contrib/ruby19/benchmark/other-lang/fact.pl head/contrib/ruby19/benchmark/other-lang/fib.py head/contrib/ruby19/benchmark/other-lang/tak.pl head/contrib/ruby19/benchmark/other-lang/eval.rb head/contrib/ruby19/benchmark/other-lang/loop.scm head/contrib/ruby19/benchmark/other-lang/loop2.rb head/contrib/ruby19/benchmark/other-lang/fact.scm head/contrib/ruby19/benchmark/other-lang/tak.scm head/contrib/ruby19/benchmark/other-lang/ack.rb head/contrib/ruby19/benchmark/other-lang/loop.py head/contrib/ruby19/benchmark/other-lang/fib.rb head/contrib/ruby19/benchmark/other-lang/fact.py head/contrib/ruby19/benchmark/bm_vm_thread_pass_flood.rb head/contrib/ruby19/benchmark/bm_vm1_not.rb head/contrib/ruby19/benchmark/bm_app_mandelbrot.rb head/contrib/ruby19/benchmark/runc.rb head/contrib/ruby19/benchmark/bm_loop_whileloop.rb head/contrib/ruby19/benchmark/bm_so_meteor_contest.rb head/contrib/ruby19/benchmark/bm_vm1_swap.rb head/contrib/ruby19/benchmark/make_fasta_output.rb head/contrib/ruby19/benchmark/bm_vm2_case.rb head/contrib/ruby19/benchmark/prepare_so_reverse_complement.rb head/contrib/ruby19/benchmark/bm_app_strconcat.rb head/contrib/ruby19/benchmark/bm_so_partial_sums.rb head/contrib/ruby19/benchmark/bm_so_matrix.rb head/contrib/ruby19/benchmark/bm_io_select.rb head/contrib/ruby19/benchmark/bm_so_count_words.rb head/contrib/ruby19/benchmark/bm_vm1_rescue.rb head/contrib/ruby19/benchmark/bm_vm1_simplereturn.rb head/contrib/ruby19/benchmark/bm_vm3_gc.rb head/contrib/ruby19/benchmark/bm_so_random.rb head/contrib/ruby19/benchmark/bm_vm1_ivar.rb head/contrib/ruby19/benchmark/bm_so_mandelbrot.rb head/contrib/ruby19/benchmark/bm_io_select3.rb head/contrib/ruby19/benchmark/bm_io_file_create.rb head/contrib/ruby19/benchmark/report.rb head/contrib/ruby19/benchmark/bm_vm_thread_pass.rb head/contrib/ruby19/benchmark/bm_so_fasta.rb head/contrib/ruby19/benchmark/bm_io_file_read.rb head/contrib/ruby19/benchmark/bm_vm2_array.rb head/contrib/ruby19/benchmark/bm_app_factorial.rb head/contrib/ruby19/benchmark/bm_so_k_nucleotide.rb head/contrib/ruby19/benchmark/bm_so_object.rb head/contrib/ruby19/benchmark/bm_app_erb.rb head/contrib/ruby19/benchmark/bm_vm1_const.rb head/contrib/ruby19/benchmark/bm_vm2_zsuper.rb head/contrib/ruby19/benchmark/bm_vm2_send.rb head/contrib/ruby19/benchmark/bm_vm1_block.rb head/contrib/ruby19/benchmark/bm_so_pidigits.rb head/contrib/ruby19/benchmark/bm_vm2_regexp.rb head/contrib/ruby19/benchmark/bm_vm_thread_mutex3.rb head/contrib/ruby19/benchmark/bm_vm2_defined_method.rb head/contrib/ruby19/benchmark/bm_vm1_ensure.rb head/contrib/ruby19/benchmark/bm_so_concatenate.rb head/contrib/ruby19/benchmark/run.rb head/contrib/ruby19/benchmark/bm_vm2_proc.rb head/contrib/ruby19/benchmark/bm_so_binary_trees.rb head/contrib/ruby19/benchmark/bm_io_select2.rb head/contrib/ruby19/benchmark/bm_so_nsieve.rb head/contrib/ruby19/benchmark/bmx_temp.rb head/contrib/ruby19/benchmark/bm_so_reverse_complement.rb head/contrib/ruby19/benchmark/bm_so_lists.rb head/contrib/ruby19/benchmark/bm_so_exception.rb head/contrib/ruby19/benchmark/bm_app_tarai.rb head/contrib/ruby19/benchmark/bm_app_fib.rb head/contrib/ruby19/benchmark/bm_vm2_method.rb head/contrib/ruby19/benchmark/bm_vm2_unif1.rb head/contrib/ruby19/benchmark/bm_vm1_neq.rb head/contrib/ruby19/benchmark/prepare_so_count_words.rb head/contrib/ruby19/benchmark/bm_app_pentomino.rb head/contrib/ruby19/benchmark/bm_loop_times.rb head/contrib/ruby19/benchmark/bm_so_spectralnorm.rb head/contrib/ruby19/benchmark/bm_vm2_eval.rb head/contrib/ruby19/benchmark/bm_so_sieve.rb head/contrib/ruby19/benchmark/driver.rb head/contrib/ruby19/benchmark/bm_loop_whileloop2.rb head/contrib/ruby19/benchmark/bm_vm_thread_mutex2.rb head/contrib/ruby19/benchmark/bm_loop_generator.rb head/contrib/ruby19/benchmark/bm_io_file_write.rb head/contrib/ruby19/benchmark/bm_vm2_super.rb head/contrib/ruby19/benchmark/bm_vm2_mutex.rb head/contrib/ruby19/benchmark/bm_vm_thread_pipe.rb head/contrib/ruby19/benchmark/bm_so_fannkuch.rb head/contrib/ruby19/benchmark/bm_vm1_ivar_set.rb head/contrib/ruby19/benchmark/bm_app_uri.rb head/contrib/ruby19/benchmark/bm_app_answer.rb head/contrib/ruby19/benchmark/bm_vm3_clearmethodcache.rb head/contrib/ruby19/benchmark/bm_so_ackermann.rb head/contrib/ruby19/benchmark/wc.input.base head/contrib/ruby19/benchmark/bm_app_raise.rb head/contrib/ruby19/benchmark/bm_vm1_length.rb head/contrib/ruby19/opt_sc.inc head/contrib/ruby19/array.c head/contrib/ruby19/ext/io/console/console.c head/contrib/ruby19/ext/io/console/lib/console/size.rb head/contrib/ruby19/ext/io/console/extconf.rb head/contrib/ruby19/ext/io/console/io-console.gemspec head/contrib/ruby19/ext/io/wait/extconf.rb head/contrib/ruby19/ext/io/wait/wait.c head/contrib/ruby19/ext/io/nonblock/nonblock.c head/contrib/ruby19/ext/io/nonblock/extconf.rb head/contrib/ruby19/ext/racc/cparse/README head/contrib/ruby19/ext/racc/cparse/cparse.c head/contrib/ruby19/ext/racc/cparse/depend head/contrib/ruby19/ext/racc/cparse/extconf.rb head/contrib/ruby19/ext/gdbm/gdbm.c head/contrib/ruby19/ext/gdbm/README head/contrib/ruby19/ext/gdbm/depend head/contrib/ruby19/ext/gdbm/extconf.rb head/contrib/ruby19/ext/syck/bytecode.c head/contrib/ruby19/ext/syck/rubyext.c head/contrib/ruby19/ext/syck/yaml2byte.c head/contrib/ruby19/ext/syck/emitter.c head/contrib/ruby19/ext/syck/syck.c head/contrib/ruby19/ext/syck/implicit.c head/contrib/ruby19/ext/syck/handler.c head/contrib/ruby19/ext/syck/depend head/contrib/ruby19/ext/syck/syck.h head/contrib/ruby19/ext/syck/token.c head/contrib/ruby19/ext/syck/lib/syck/baseemitter.rb head/contrib/ruby19/ext/syck/lib/syck/types.rb head/contrib/ruby19/ext/syck/lib/syck/ypath.rb head/contrib/ruby19/ext/syck/lib/syck/encoding.rb head/contrib/ruby19/ext/syck/lib/syck/loader.rb head/contrib/ruby19/ext/syck/lib/syck/rubytypes.rb head/contrib/ruby19/ext/syck/lib/syck/yamlnode.rb head/contrib/ruby19/ext/syck/lib/syck/error.rb head/contrib/ruby19/ext/syck/lib/syck/syck.rb head/contrib/ruby19/ext/syck/lib/syck/stream.rb head/contrib/ruby19/ext/syck/lib/syck/tag.rb head/contrib/ruby19/ext/syck/lib/syck/constants.rb head/contrib/ruby19/ext/syck/lib/syck/stringio.rb head/contrib/ruby19/ext/syck/lib/syck/basenode.rb head/contrib/ruby19/ext/syck/lib/syck.rb head/contrib/ruby19/ext/syck/lib/yaml/syck.rb head/contrib/ruby19/ext/syck/node.c head/contrib/ruby19/ext/syck/gram.c head/contrib/ruby19/ext/syck/extconf.rb head/contrib/ruby19/ext/syck/gram.h head/contrib/ruby19/ext/syck/yamlbyte.h head/contrib/ruby19/ext/pty/pty.c head/contrib/ruby19/ext/pty/depend head/contrib/ruby19/ext/pty/lib/expect.rb head/contrib/ruby19/ext/pty/extconf.rb head/contrib/ruby19/ext/nkf/nkf-utf8/config.h head/contrib/ruby19/ext/nkf/nkf-utf8/utf8tbl.h head/contrib/ruby19/ext/nkf/nkf-utf8/nkf.c head/contrib/ruby19/ext/nkf/nkf-utf8/nkf.h head/contrib/ruby19/ext/nkf/nkf-utf8/utf8tbl.c head/contrib/ruby19/ext/nkf/lib/kconv.rb head/contrib/ruby19/ext/nkf/extconf.rb head/contrib/ruby19/ext/nkf/depend head/contrib/ruby19/ext/nkf/nkf.c head/contrib/ruby19/ext/digest/defs.h head/contrib/ruby19/ext/digest/extconf.rb head/contrib/ruby19/ext/digest/test.sh head/contrib/ruby19/ext/digest/rmd160/rmd160ossl.c head/contrib/ruby19/ext/digest/rmd160/rmd160init.c head/contrib/ruby19/ext/digest/rmd160/depend head/contrib/ruby19/ext/digest/rmd160/rmd160.h head/contrib/ruby19/ext/digest/rmd160/rmd160ossl.h head/contrib/ruby19/ext/digest/rmd160/extconf.rb head/contrib/ruby19/ext/digest/rmd160/rmd160.c head/contrib/ruby19/ext/digest/sha1/sha1ossl.c head/contrib/ruby19/ext/digest/sha1/depend head/contrib/ruby19/ext/digest/sha1/sha1init.c head/contrib/ruby19/ext/digest/sha1/sha1.h head/contrib/ruby19/ext/digest/sha1/sha1ossl.h head/contrib/ruby19/ext/digest/sha1/extconf.rb head/contrib/ruby19/ext/digest/sha1/sha1.c head/contrib/ruby19/ext/digest/sha2/depend head/contrib/ruby19/ext/digest/sha2/sha2ossl.c head/contrib/ruby19/ext/digest/sha2/sha2init.c head/contrib/ruby19/ext/digest/sha2/sha2.h head/contrib/ruby19/ext/digest/sha2/sha2ossl.h head/contrib/ruby19/ext/digest/sha2/lib/sha2.rb head/contrib/ruby19/ext/digest/sha2/extconf.rb head/contrib/ruby19/ext/digest/sha2/sha2.c head/contrib/ruby19/ext/digest/depend head/contrib/ruby19/ext/digest/digest.c head/contrib/ruby19/ext/digest/bubblebabble/bubblebabble.c head/contrib/ruby19/ext/digest/bubblebabble/extconf.rb head/contrib/ruby19/ext/digest/bubblebabble/depend head/contrib/ruby19/ext/digest/digest.h head/contrib/ruby19/ext/digest/md5/md5.c head/contrib/ruby19/ext/digest/md5/md5ossl.c head/contrib/ruby19/ext/digest/md5/extconf.rb head/contrib/ruby19/ext/digest/md5/md5init.c head/contrib/ruby19/ext/digest/md5/md5.h head/contrib/ruby19/ext/digest/md5/md5ossl.h head/contrib/ruby19/ext/digest/md5/depend head/contrib/ruby19/ext/digest/lib/digest.rb head/contrib/ruby19/ext/digest/lib/digest/hmac.rb head/contrib/ruby19/ext/Setup.nt head/contrib/ruby19/ext/bigdecimal/bigdecimal.c head/contrib/ruby19/ext/bigdecimal/sample/pi.rb head/contrib/ruby19/ext/bigdecimal/sample/linear.rb head/contrib/ruby19/ext/bigdecimal/sample/nlsolve.rb head/contrib/ruby19/ext/bigdecimal/bigdecimal.gemspec head/contrib/ruby19/ext/bigdecimal/bigdecimal_en.html head/contrib/ruby19/ext/bigdecimal/bigdecimal.h head/contrib/ruby19/ext/bigdecimal/lib/bigdecimal/ludcmp.rb head/contrib/ruby19/ext/bigdecimal/lib/bigdecimal/jacobian.rb head/contrib/ruby19/ext/bigdecimal/lib/bigdecimal/math.rb head/contrib/ruby19/ext/bigdecimal/lib/bigdecimal/newton.rb head/contrib/ruby19/ext/bigdecimal/lib/bigdecimal/util.rb head/contrib/ruby19/ext/bigdecimal/extconf.rb head/contrib/ruby19/ext/bigdecimal/README head/contrib/ruby19/ext/bigdecimal/bigdecimal_ja.html head/contrib/ruby19/ext/bigdecimal/depend head/contrib/ruby19/ext/syslog/extconf.rb head/contrib/ruby19/ext/syslog/syslog.txt head/contrib/ruby19/ext/syslog/depend head/contrib/ruby19/ext/syslog/syslog.c head/contrib/ruby19/ext/openssl/ossl_bn.c head/contrib/ruby19/ext/openssl/ossl_asn1.c head/contrib/ruby19/ext/openssl/ossl_pkcs12.c head/contrib/ruby19/ext/openssl/ossl_bn.h head/contrib/ruby19/ext/openssl/ossl_ssl_session.c head/contrib/ruby19/ext/openssl/ossl_x509.c head/contrib/ruby19/ext/openssl/ossl_ns_spki.c head/contrib/ruby19/ext/openssl/ossl_x509crl.c head/contrib/ruby19/ext/openssl/ossl_x509name.c head/contrib/ruby19/ext/openssl/ossl_asn1.h head/contrib/ruby19/ext/openssl/ossl_pkcs12.h head/contrib/ruby19/ext/openssl/ossl_pkey.c head/contrib/ruby19/ext/openssl/ossl_bio.c head/contrib/ruby19/ext/openssl/ossl_x509.h head/contrib/ruby19/ext/openssl/ossl_ns_spki.h head/contrib/ruby19/ext/openssl/openssl_missing.c head/contrib/ruby19/ext/openssl/ossl_pkey.h head/contrib/ruby19/ext/openssl/ossl_bio.h head/contrib/ruby19/ext/openssl/openssl_missing.h head/contrib/ruby19/ext/openssl/ossl_pkey_dh.c head/contrib/ruby19/ext/openssl/ossl_x509cert.c head/contrib/ruby19/ext/openssl/ossl_rand.c head/contrib/ruby19/ext/openssl/ossl_pkcs5.c head/contrib/ruby19/ext/openssl/ossl_x509revoked.c head/contrib/ruby19/ext/openssl/ossl_x509ext.c head/contrib/ruby19/ext/openssl/ossl_pkcs7.c head/contrib/ruby19/ext/openssl/extconf.rb head/contrib/ruby19/ext/openssl/ossl_rand.h head/contrib/ruby19/ext/openssl/ossl_pkcs5.h head/contrib/ruby19/ext/openssl/ossl_version.h head/contrib/ruby19/ext/openssl/ossl_pkcs7.h head/contrib/ruby19/ext/openssl/ossl_pkey_dsa.c head/contrib/ruby19/ext/openssl/ossl_x509attr.c head/contrib/ruby19/ext/openssl/ossl_ssl.c head/contrib/ruby19/ext/openssl/ossl_ocsp.c head/contrib/ruby19/ext/openssl/ossl_config.c head/contrib/ruby19/ext/openssl/ossl_engine.c head/contrib/ruby19/ext/openssl/ossl_ssl.h head/contrib/ruby19/ext/openssl/ossl_hmac.c head/contrib/ruby19/ext/openssl/ossl_ocsp.h head/contrib/ruby19/ext/openssl/ossl_config.h head/contrib/ruby19/ext/openssl/ossl_cipher.c head/contrib/ruby19/ext/openssl/ossl_engine.h head/contrib/ruby19/ext/openssl/ossl_x509req.c head/contrib/ruby19/ext/openssl/ossl_pkey_rsa.c head/contrib/ruby19/ext/openssl/ossl_hmac.h head/contrib/ruby19/ext/openssl/ruby_missing.h head/contrib/ruby19/ext/openssl/ossl_pkey_ec.c head/contrib/ruby19/ext/openssl/ossl_cipher.h head/contrib/ruby19/ext/openssl/ossl_digest.c head/contrib/ruby19/ext/openssl/ossl.c head/contrib/ruby19/ext/openssl/ossl_x509store.c head/contrib/ruby19/ext/openssl/ossl_digest.h head/contrib/ruby19/ext/openssl/lib/openssl/config.rb head/contrib/ruby19/ext/openssl/lib/openssl/x509.rb head/contrib/ruby19/ext/openssl/lib/openssl/buffering.rb head/contrib/ruby19/ext/openssl/lib/openssl/cipher.rb head/contrib/ruby19/ext/openssl/lib/openssl/ssl-internal.rb head/contrib/ruby19/ext/openssl/lib/openssl/bn.rb head/contrib/ruby19/ext/openssl/lib/openssl/digest.rb head/contrib/ruby19/ext/openssl/lib/openssl/x509-internal.rb head/contrib/ruby19/ext/openssl/lib/openssl/ssl.rb head/contrib/ruby19/ext/openssl/lib/openssl.rb head/contrib/ruby19/ext/openssl/ossl.h head/contrib/ruby19/ext/sdbm/depend head/contrib/ruby19/ext/sdbm/init.c head/contrib/ruby19/ext/sdbm/_sdbm.c head/contrib/ruby19/ext/sdbm/extconf.rb head/contrib/ruby19/ext/sdbm/sdbm.h head/contrib/ruby19/ext/psych/extconf.rb head/contrib/ruby19/ext/psych/to_ruby.h head/contrib/ruby19/ext/psych/emitter.c head/contrib/ruby19/ext/psych/psych.h head/contrib/ruby19/ext/psych/parser.c head/contrib/ruby19/ext/psych/emitter.h head/contrib/ruby19/ext/psych/parser.h head/contrib/ruby19/ext/psych/yaml_tree.c head/contrib/ruby19/ext/psych/to_ruby.c head/contrib/ruby19/ext/psych/lib/psych/tree_builder.rb head/contrib/ruby19/ext/psych/lib/psych/nodes/node.rb head/contrib/ruby19/ext/psych/lib/psych/nodes/scalar.rb head/contrib/ruby19/ext/psych/lib/psych/nodes/sequence.rb head/contrib/ruby19/ext/psych/lib/psych/nodes/alias.rb head/contrib/ruby19/ext/psych/lib/psych/nodes/mapping.rb head/contrib/ruby19/ext/psych/lib/psych/nodes/stream.rb head/contrib/ruby19/ext/psych/lib/psych/nodes/document.rb head/contrib/ruby19/ext/psych/lib/psych/json/ruby_events.rb head/contrib/ruby19/ext/psych/lib/psych/json/tree_builder.rb head/contrib/ruby19/ext/psych/lib/psych/json/yaml_events.rb head/contrib/ruby19/ext/psych/lib/psych/json/stream.rb head/contrib/ruby19/ext/psych/lib/psych/core_ext.rb head/contrib/ruby19/ext/psych/lib/psych/nodes.rb head/contrib/ruby19/ext/psych/lib/psych/handler.rb head/contrib/ruby19/ext/psych/lib/psych/scalar_scanner.rb head/contrib/ruby19/ext/psych/lib/psych/visitors/to_ruby.rb head/contrib/ruby19/ext/psych/lib/psych/visitors/json_tree.rb head/contrib/ruby19/ext/psych/lib/psych/visitors/emitter.rb head/contrib/ruby19/ext/psych/lib/psych/visitors/depth_first.rb head/contrib/ruby19/ext/psych/lib/psych/visitors/visitor.rb head/contrib/ruby19/ext/psych/lib/psych/visitors/yaml_tree.rb head/contrib/ruby19/ext/psych/lib/psych/visitors.rb head/contrib/ruby19/ext/psych/lib/psych/streaming.rb head/contrib/ruby19/ext/psych/lib/psych/stream.rb head/contrib/ruby19/ext/psych/lib/psych/set.rb head/contrib/ruby19/ext/psych/lib/psych/coder.rb head/contrib/ruby19/ext/psych/lib/psych/omap.rb head/contrib/ruby19/ext/psych/lib/psych/parser.rb head/contrib/ruby19/ext/psych/lib/psych/handlers/document_stream.rb head/contrib/ruby19/ext/psych/lib/psych/syntax_error.rb head/contrib/ruby19/ext/psych/lib/psych/deprecated.rb head/contrib/ruby19/ext/psych/lib/psych.rb head/contrib/ruby19/ext/psych/psych.c head/contrib/ruby19/ext/psych/yaml_tree.h head/contrib/ruby19/ext/objspace/objspace.c head/contrib/ruby19/ext/objspace/extconf.rb head/contrib/ruby19/ext/objspace/depend head/contrib/ruby19/ext/Setup.emx head/contrib/ruby19/ext/coverage/coverage.c head/contrib/ruby19/ext/coverage/extconf.rb head/contrib/ruby19/ext/dl/cptr.c head/contrib/ruby19/ext/dl/callback/extconf.rb head/contrib/ruby19/ext/dl/callback/depend head/contrib/ruby19/ext/dl/callback/mkcallback.rb head/contrib/ruby19/ext/dl/handle.c head/contrib/ruby19/ext/dl/cfunc.c head/contrib/ruby19/ext/dl/depend head/contrib/ruby19/ext/dl/dl.c head/contrib/ruby19/ext/dl/win32/lib/win32/registry.rb head/contrib/ruby19/ext/dl/win32/lib/win32/resolv.rb head/contrib/ruby19/ext/dl/win32/lib/win32/sspi.rb head/contrib/ruby19/ext/dl/win32/lib/Win32API.rb head/contrib/ruby19/ext/dl/win32/extconf.rb head/contrib/ruby19/ext/dl/dl.h head/contrib/ruby19/ext/dl/lib/dl/struct.rb head/contrib/ruby19/ext/dl/lib/dl/types.rb head/contrib/ruby19/ext/dl/lib/dl/stack.rb head/contrib/ruby19/ext/dl/lib/dl/import.rb head/contrib/ruby19/ext/dl/lib/dl/func.rb head/contrib/ruby19/ext/dl/lib/dl/callback.rb head/contrib/ruby19/ext/dl/lib/dl/value.rb head/contrib/ruby19/ext/dl/lib/dl/pack.rb head/contrib/ruby19/ext/dl/lib/dl/cparser.rb head/contrib/ruby19/ext/dl/lib/dl.rb head/contrib/ruby19/ext/dl/extconf.rb head/contrib/ruby19/ext/zlib/zlib.c head/contrib/ruby19/ext/zlib/extconf.rb head/contrib/ruby19/ext/dbm/dbm.c head/contrib/ruby19/ext/dbm/extconf.rb head/contrib/ruby19/ext/dbm/depend head/contrib/ruby19/ext/win32ole/lib/win32ole.rb head/contrib/ruby19/ext/win32ole/lib/win32ole/property.rb head/contrib/ruby19/ext/win32ole/extconf.rb head/contrib/ruby19/ext/win32ole/depend head/contrib/ruby19/ext/win32ole/sample/excel2.rb head/contrib/ruby19/ext/win32ole/sample/excel3.rb head/contrib/ruby19/ext/win32ole/sample/ieconst.rb head/contrib/ruby19/ext/win32ole/sample/olegen.rb head/contrib/ruby19/ext/win32ole/sample/ienavi.rb head/contrib/ruby19/ext/win32ole/sample/ie.rb head/contrib/ruby19/ext/win32ole/sample/ienavi2.rb head/contrib/ruby19/ext/win32ole/sample/xml.rb head/contrib/ruby19/ext/win32ole/sample/excel1.rb head/contrib/ruby19/ext/win32ole/sample/oledirs.rb head/contrib/ruby19/ext/win32ole/win32ole.c head/contrib/ruby19/ext/curses/extconf.rb head/contrib/ruby19/ext/curses/mouse.rb head/contrib/ruby19/ext/curses/rain.rb head/contrib/ruby19/ext/curses/view.rb head/contrib/ruby19/ext/curses/view2.rb head/contrib/ruby19/ext/curses/depend head/contrib/ruby19/ext/curses/curses.c head/contrib/ruby19/ext/curses/hello.rb head/contrib/ruby19/ext/fcntl/fcntl.c head/contrib/ruby19/ext/fcntl/extconf.rb head/contrib/ruby19/ext/fcntl/depend head/contrib/ruby19/ext/mathn/complex/complex.c head/contrib/ruby19/ext/mathn/complex/extconf.rb head/contrib/ruby19/ext/mathn/rational/extconf.rb head/contrib/ruby19/ext/mathn/rational/rational.c head/contrib/ruby19/ext/json/generator/generator.h head/contrib/ruby19/ext/json/generator/depend head/contrib/ruby19/ext/json/generator/generator.c head/contrib/ruby19/ext/json/generator/extconf.rb head/contrib/ruby19/ext/json/lib/json.rb head/contrib/ruby19/ext/json/lib/json/common.rb head/contrib/ruby19/ext/json/lib/json/ext.rb head/contrib/ruby19/ext/json/lib/json/version.rb head/contrib/ruby19/ext/json/lib/json/add/complex.rb head/contrib/ruby19/ext/json/lib/json/add/core.rb head/contrib/ruby19/ext/json/lib/json/add/rational.rb head/contrib/ruby19/ext/json/extconf.rb head/contrib/ruby19/ext/json/parser/extconf.rb head/contrib/ruby19/ext/json/parser/parser.rl head/contrib/ruby19/ext/json/parser/parser.c head/contrib/ruby19/ext/json/parser/depend head/contrib/ruby19/ext/json/parser/parser.h head/contrib/ruby19/ext/json/parser/prereq.mk head/contrib/ruby19/ext/-test-/funcall/extconf.rb head/contrib/ruby19/ext/-test-/funcall/passing_block.c head/contrib/ruby19/ext/-test-/old_thread_select/extconf.rb head/contrib/ruby19/ext/-test-/old_thread_select/depend head/contrib/ruby19/ext/-test-/old_thread_select/old_thread_select.c head/contrib/ruby19/ext/-test-/wait_for_single_fd/wait_for_single_fd.c head/contrib/ruby19/ext/-test-/wait_for_single_fd/extconf.rb head/contrib/ruby19/ext/-test-/wait_for_single_fd/depend head/contrib/ruby19/ext/-test-/st/numhash/numhash.c head/contrib/ruby19/ext/-test-/st/numhash/extconf.rb head/contrib/ruby19/ext/-test-/string/extconf.rb head/contrib/ruby19/ext/-test-/string/modify.c head/contrib/ruby19/ext/-test-/string/set_len.c head/contrib/ruby19/ext/-test-/string/cstr.c head/contrib/ruby19/ext/-test-/string/ellipsize.c head/contrib/ruby19/ext/-test-/string/enc_associate.c head/contrib/ruby19/ext/-test-/string/init.c head/contrib/ruby19/ext/-test-/bug-3571/extconf.rb head/contrib/ruby19/ext/-test-/bug-3571/bug.c head/contrib/ruby19/ext/-test-/bug-3662/extconf.rb head/contrib/ruby19/ext/-test-/bug-3662/bug.c head/contrib/ruby19/ext/-test-/array/resize/extconf.rb head/contrib/ruby19/ext/-test-/array/resize/resize.c head/contrib/ruby19/ext/-test-/load/dot.dot/extconf.rb head/contrib/ruby19/ext/-test-/load/dot.dot/dot.dot.c head/contrib/ruby19/ext/-test-/win32/dln/libdlntest.def head/contrib/ruby19/ext/-test-/win32/dln/libdlntest.c head/contrib/ruby19/ext/-test-/win32/dln/extconf.rb head/contrib/ruby19/ext/-test-/win32/dln/dlntest.c head/contrib/ruby19/ext/-test-/win32/fd_setsize/extconf.rb head/contrib/ruby19/ext/-test-/win32/fd_setsize/depend head/contrib/ruby19/ext/-test-/win32/fd_setsize/fd_setsize.c head/contrib/ruby19/ext/continuation/extconf.rb head/contrib/ruby19/ext/continuation/continuation.c head/contrib/ruby19/ext/etc/extconf.rb head/contrib/ruby19/ext/etc/etc.c head/contrib/ruby19/ext/etc/depend head/contrib/ruby19/ext/date/date_strptime.c head/contrib/ruby19/ext/date/date_core.c head/contrib/ruby19/ext/date/lib/date/format.rb head/contrib/ruby19/ext/date/lib/date.rb head/contrib/ruby19/ext/date/date_parse.c head/contrib/ruby19/ext/date/extconf.rb head/contrib/ruby19/ext/date/date_strftime.c head/contrib/ruby19/ext/date/date_tmx.h head/contrib/ruby19/ext/date/depend head/contrib/ruby19/ext/strscan/strscan.c head/contrib/ruby19/ext/strscan/depend head/contrib/ruby19/ext/strscan/extconf.rb head/contrib/ruby19/ext/tk/tcltklib.c head/contrib/ruby19/ext/tk/MANUAL_tcltklib.eucj head/contrib/ruby19/ext/tk/README.fork head/contrib/ruby19/ext/tk/depend head/contrib/ruby19/ext/tk/README.1st head/contrib/ruby19/ext/tk/README.tcltklib head/contrib/ruby19/ext/tk/config_list.in head/contrib/ruby19/ext/tk/old-README.tcltklib.eucj head/contrib/ruby19/ext/tk/lib/tcltk.rb head/contrib/ruby19/ext/tk/lib/tktext.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkDND/tkdnd.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkDND/setup.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkDND/shape.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkDND.rb head/contrib/ruby19/ext/tk/lib/tkextlib/pkg_checker.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tclx/tclx.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tclx/setup.rb head/contrib/ruby19/ext/tk/lib/tkextlib/ICONS/setup.rb head/contrib/ruby19/ext/tk/lib/tkextlib/ICONS/icons.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkimg/xpm.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkimg/gif.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkimg/sun.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkimg/window.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkimg/ico.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkimg/tga.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkimg/bmp.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkimg/ps.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkimg/sgi.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkimg/png.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkimg/jpeg.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkimg/xbm.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkimg/tiff.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkimg/pcx.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkimg/README head/contrib/ruby19/ext/tk/lib/tkextlib/tkimg/ppm.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkimg/pixmap.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkimg/setup.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tclx.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/labeledframe.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/scopedobject.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/fileselectiondialog.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/watch.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/canvasprintdialog.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/combobox.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/calendar.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/hierarchy.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/spinner.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/extfileselectionbox.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/timeentry.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/datefield.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/tabset.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/buttonbox.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/feedback.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/extfileselectiondialog.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/dialogshell.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/disjointlistbox.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/menubar.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/labeledwidget.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/scrolledhtml.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/messagebox.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/fileselectionbox.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/dateentry.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/setup.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/toolbar.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/messagedialog.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/selectiondialog.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/entryfield.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/shell.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/tabnotebook.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/radiobox.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/spindate.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/pushbutton.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/scrolledwidget.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/mainwindow.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/panedwindow.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/notebook.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/scrolledframe.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/spinint.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/checkbox.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/spintime.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/extbutton.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/optionmenu.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/selectionbox.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/dialog.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/finddialog.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/hyperhelp.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/canvasprintbox.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/promptdialog.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets/timefield.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/label.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/spinbox.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/widget.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/buttonbox.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/scrollview.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/labelframe.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/progressdlg.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/titleframe.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/tree.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/setup.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/selectfont.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/panelframe.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/messagedlg.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/panedwindow.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/notebook.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/listbox.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/arrowbutton.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/passwddlg.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/progressbar.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/dropsite.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/pagesmanager.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/dynamichelp.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/scrollableframe.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/mainframe.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/dialog.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/scrolledwindow.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/separator.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/labelentry.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/entry.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/dragsite.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/combobox.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/statusbar.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/button.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/bitmap.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget/selectcolor.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tktable/setup.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tktable/tktable.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tktrans/tktrans.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tktrans/setup.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tktrans.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tktable.rb head/contrib/ruby19/ext/tk/lib/tkextlib/winico/winico.rb head/contrib/ruby19/ext/tk/lib/tkextlib/winico/setup.rb head/contrib/ruby19/ext/tk/lib/tkextlib/itk.rb head/contrib/ruby19/ext/tk/lib/tkextlib/winico.rb head/contrib/ruby19/ext/tk/lib/tkextlib/itcl.rb head/contrib/ruby19/ext/tk/lib/tkextlib/trofs/trofs.rb head/contrib/ruby19/ext/tk/lib/tkextlib/trofs/setup.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile.rb head/contrib/ruby19/ext/tk/lib/tkextlib/setup.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkHTML.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/chatwidget.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/ctext.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/ruler.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/screenruler.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/ip_entry.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/tooltip.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/README head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/tablelist_core.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/tkpiechart.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/scrolledwindow.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/dialog.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/tablelist_tile.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/plotchart.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/history.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/swaplist.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/getstring.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/statusbar.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/calendar.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/superframe.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/ico.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/canvas_sqmap.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/canvas_zoom.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/datefield.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/widget.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/tablelist.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/menuentry.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/diagrams.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/autoscroll.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/khim.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/crosshair.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/dateentry.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/style.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/setup.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/toolbar.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/ntext.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/panelframe.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/scrollwin.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tcllib/cursor.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkimg.rb head/contrib/ruby19/ext/tk/lib/tkextlib/ICONS.rb head/contrib/ruby19/ext/tk/lib/tkextlib/SUPPORT_STATUS head/contrib/ruby19/ext/tk/lib/tkextlib/blt/ted.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/bitmap.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/tabset.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/container.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/busy.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/stripchart.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/cutbuffer.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/barchart.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/table.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/eps.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/spline.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/treeview.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/tile/scrollbar.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/tile/checkbutton.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/tile/frame.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/tile/radiobutton.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/tile/toplevel.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/tile/button.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/tile/label.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/winop.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/htext.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/tile.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/tree.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/win_printer.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/setup.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/graph.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/vector.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/component.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/dragdrop.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/watch.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/tabnotebook.rb head/contrib/ruby19/ext/tk/lib/tkextlib/blt/unix_dnd.rb head/contrib/ruby19/ext/tk/lib/tkextlib/iwidgets.rb head/contrib/ruby19/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb head/contrib/ruby19/ext/tk/lib/tkextlib/treectrl/setup.rb head/contrib/ruby19/ext/tk/lib/tkextlib/treectrl.rb head/contrib/ruby19/ext/tk/lib/tkextlib/bwidget.rb head/contrib/ruby19/ext/tk/lib/tkextlib/itk/incr_tk.rb head/contrib/ruby19/ext/tk/lib/tkextlib/itk/setup.rb head/contrib/ruby19/ext/tk/lib/tkextlib/version.rb head/contrib/ruby19/ext/tk/lib/tkextlib/vu/dial.rb head/contrib/ruby19/ext/tk/lib/tkextlib/vu/pie.rb head/contrib/ruby19/ext/tk/lib/tkextlib/vu/setup.rb head/contrib/ruby19/ext/tk/lib/tkextlib/vu/spinbox.rb head/contrib/ruby19/ext/tk/lib/tkextlib/vu/charts.rb head/contrib/ruby19/ext/tk/lib/tkextlib/vu/bargraph.rb head/contrib/ruby19/ext/tk/lib/tkextlib/itcl/incr_tcl.rb head/contrib/ruby19/ext/tk/lib/tkextlib/itcl/setup.rb head/contrib/ruby19/ext/tk/lib/tkextlib/vu.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/tnotebook.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/tspinbox.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/tscrollbar.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/tpaned.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/tscale.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/tprogressbar.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/tradiobutton.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/tlabelframe.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/tframe.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/tsquare.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/tseparator.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/tmenubutton.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/tentry.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/treeview.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/sizegrip.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/tcombobox.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/tcheckbutton.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/dialog.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/tbutton.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/setup.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/style.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tile/tlabel.rb head/contrib/ruby19/ext/tk/lib/tkextlib/trofs.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkHTML/setup.rb head/contrib/ruby19/ext/tk/lib/tkextlib/tkHTML/htmlwidget.rb head/contrib/ruby19/ext/tk/lib/tkvirtevent.rb head/contrib/ruby19/ext/tk/lib/tkmenubar.rb head/contrib/ruby19/ext/tk/lib/README head/contrib/ruby19/ext/tk/lib/tkpalette.rb head/contrib/ruby19/ext/tk/lib/tkwinpkg.rb head/contrib/ruby19/ext/tk/lib/tkdialog.rb head/contrib/ruby19/ext/tk/lib/tkafter.rb head/contrib/ruby19/ext/tk/lib/tkentry.rb head/contrib/ruby19/ext/tk/lib/tkmacpkg.rb head/contrib/ruby19/ext/tk/lib/tkconsole.rb head/contrib/ruby19/ext/tk/lib/tkbgerror.rb head/contrib/ruby19/ext/tk/lib/tkclass.rb head/contrib/ruby19/ext/tk/lib/tkfont.rb head/contrib/ruby19/ext/tk/lib/multi-tk.rb head/contrib/ruby19/ext/tk/lib/tkscrollbox.rb head/contrib/ruby19/ext/tk/lib/remote-tk.rb head/contrib/ruby19/ext/tk/lib/tkcanvas.rb head/contrib/ruby19/ext/tk/lib/tk/after.rb head/contrib/ruby19/ext/tk/lib/tk/tagfont.rb head/contrib/ruby19/ext/tk/lib/tk/composite.rb head/contrib/ruby19/ext/tk/lib/tk/optionobj.rb head/contrib/ruby19/ext/tk/lib/tk/scrollbox.rb head/contrib/ruby19/ext/tk/lib/tk/bindtag.rb head/contrib/ruby19/ext/tk/lib/tk/pack.rb head/contrib/ruby19/ext/tk/lib/tk/timer.rb head/contrib/ruby19/ext/tk/lib/tk/mngfocus.rb head/contrib/ruby19/ext/tk/lib/tk/spinbox.rb head/contrib/ruby19/ext/tk/lib/tk/text.rb head/contrib/ruby19/ext/tk/lib/tk/itemfont.rb head/contrib/ruby19/ext/tk/lib/tk/menubar.rb head/contrib/ruby19/ext/tk/lib/tk/fontchooser.rb head/contrib/ruby19/ext/tk/lib/tk/frame.rb head/contrib/ruby19/ext/tk/lib/tk/palette.rb head/contrib/ruby19/ext/tk/lib/tk/dialog.rb head/contrib/ruby19/ext/tk/lib/tk/ttk_selector.rb head/contrib/ruby19/ext/tk/lib/tk/bgerror.rb head/contrib/ruby19/ext/tk/lib/tk/console.rb head/contrib/ruby19/ext/tk/lib/tk/macpkg.rb head/contrib/ruby19/ext/tk/lib/tk/menu.rb head/contrib/ruby19/ext/tk/lib/tk/checkbutton.rb head/contrib/ruby19/ext/tk/lib/tk/canvas.rb head/contrib/ruby19/ext/tk/lib/tk/button.rb head/contrib/ruby19/ext/tk/lib/tk/textwindow.rb head/contrib/ruby19/ext/tk/lib/tk/msgcat.rb head/contrib/ruby19/ext/tk/lib/tk/panedwindow.rb head/contrib/ruby19/ext/tk/lib/tk/menuspec.rb head/contrib/ruby19/ext/tk/lib/tk/texttag.rb head/contrib/ruby19/ext/tk/lib/tk/winfo.rb head/contrib/ruby19/ext/tk/lib/tk/wm.rb head/contrib/ruby19/ext/tk/lib/tk/scrollbar.rb head/contrib/ruby19/ext/tk/lib/tk/scale.rb head/contrib/ruby19/ext/tk/lib/tk/radiobutton.rb head/contrib/ruby19/ext/tk/lib/tk/labelframe.rb head/contrib/ruby19/ext/tk/lib/tk/package.rb head/contrib/ruby19/ext/tk/lib/tk/namespace.rb head/contrib/ruby19/ext/tk/lib/tk/xim.rb head/contrib/ruby19/ext/tk/lib/tk/textmark.rb head/contrib/ruby19/ext/tk/lib/tk/entry.rb head/contrib/ruby19/ext/tk/lib/tk/font.rb head/contrib/ruby19/ext/tk/lib/tk/txtwin_abst.rb head/contrib/ruby19/ext/tk/lib/tk/label.rb head/contrib/ruby19/ext/tk/lib/tk/root.rb head/contrib/ruby19/ext/tk/lib/tk/place.rb head/contrib/ruby19/ext/tk/lib/tk/variable.rb head/contrib/ruby19/ext/tk/lib/tk/grid.rb head/contrib/ruby19/ext/tk/lib/tk/validation.rb head/contrib/ruby19/ext/tk/lib/tk/clipboard.rb head/contrib/ruby19/ext/tk/lib/tk/canvastag.rb head/contrib/ruby19/ext/tk/lib/tk/autoload.rb head/contrib/ruby19/ext/tk/lib/tk/kinput.rb head/contrib/ruby19/ext/tk/lib/tk/optiondb.rb head/contrib/ruby19/ext/tk/lib/tk/event.rb head/contrib/ruby19/ext/tk/lib/tk/image.rb head/contrib/ruby19/ext/tk/lib/tk/busy.rb head/contrib/ruby19/ext/tk/lib/tk/scrollable.rb head/contrib/ruby19/ext/tk/lib/tk/listbox.rb head/contrib/ruby19/ext/tk/lib/tk/message.rb head/contrib/ruby19/ext/tk/lib/tk/itemconfig.rb head/contrib/ruby19/ext/tk/lib/tk/selection.rb head/contrib/ruby19/ext/tk/lib/tk/virtevent.rb head/contrib/ruby19/ext/tk/lib/tk/textimage.rb head/contrib/ruby19/ext/tk/lib/tk/toplevel.rb head/contrib/ruby19/ext/tk/lib/tk/encodedstr.rb head/contrib/ruby19/ext/tk/lib/tk/clock.rb head/contrib/ruby19/ext/tk/lib/tk/winpkg.rb head/contrib/ruby19/ext/tk/lib/tk.rb head/contrib/ruby19/ext/tk/lib/tkmngfocus.rb head/contrib/ruby19/ext/tk/extconf.rb head/contrib/ruby19/ext/tk/README.ActiveTcl head/contrib/ruby19/ext/tk/README.macosx-aqua head/contrib/ruby19/ext/tk/tkutil/tkutil.c head/contrib/ruby19/ext/tk/tkutil/depend head/contrib/ruby19/ext/tk/tkutil/extconf.rb head/contrib/ruby19/ext/tk/ChangeLog.tkextlib head/contrib/ruby19/ext/tk/MANUAL_tcltklib.eng head/contrib/ruby19/ext/tk/stubs.c head/contrib/ruby19/ext/tk/sample/resource.en head/contrib/ruby19/ext/tk/sample/iso2022-kr.txt head/contrib/ruby19/ext/tk/sample/iso2022-kr.txt head/contrib/ruby19/ext/tk/sample/cd_timer.rb head/contrib/ruby19/ext/tk/sample/tkline.rb head/contrib/ruby19/ext/tk/sample/tkmsgcat-load_tk.rb head/contrib/ruby19/ext/tk/sample/irbtkw.rbw head/contrib/ruby19/ext/tk/sample/safe-tk.rb head/contrib/ruby19/ext/tk/sample/msgs_rb/nl.msg head/contrib/ruby19/ext/tk/sample/msgs_rb/en_gb.msg head/contrib/ruby19/ext/tk/sample/msgs_rb/ja.msg head/contrib/ruby19/ext/tk/sample/msgs_rb/pl.msg head/contrib/ruby19/ext/tk/sample/msgs_rb/it.msg head/contrib/ruby19/ext/tk/sample/msgs_rb/el.msg head/contrib/ruby19/ext/tk/sample/msgs_rb/en.msg head/contrib/ruby19/ext/tk/sample/msgs_rb/eo.msg head/contrib/ruby19/ext/tk/sample/msgs_rb/cs.msg head/contrib/ruby19/ext/tk/sample/msgs_rb/ru.msg head/contrib/ruby19/ext/tk/sample/msgs_rb/es.msg head/contrib/ruby19/ext/tk/sample/msgs_rb/fr.msg head/contrib/ruby19/ext/tk/sample/msgs_rb/README head/contrib/ruby19/ext/tk/sample/msgs_rb/de.msg head/contrib/ruby19/ext/tk/sample/tkdialog.rb head/contrib/ruby19/ext/tk/sample/tkmultilistbox.rb head/contrib/ruby19/ext/tk/sample/tkmenubutton.rb head/contrib/ruby19/ext/tk/sample/tkmultilistframe.rb head/contrib/ruby19/ext/tk/sample/multi-ip_sample.rb head/contrib/ruby19/ext/tk/sample/tkalignbox.rb head/contrib/ruby19/ext/tk/sample/tkhello.rb head/contrib/ruby19/ext/tk/sample/tktimer3.rb head/contrib/ruby19/ext/tk/sample/ttk_wrapper.rb head/contrib/ruby19/ext/tk/sample/images/noletter.xbm head/contrib/ruby19/ext/tk/sample/images/pattern.xbm head/contrib/ruby19/ext/tk/sample/images/face.xbm head/contrib/ruby19/ext/tk/sample/images/flagup.xbm head/contrib/ruby19/ext/tk/sample/images/earthris.gif head/contrib/ruby19/ext/tk/sample/images/earthris.gif head/contrib/ruby19/ext/tk/sample/images/flagdown.xbm head/contrib/ruby19/ext/tk/sample/images/earth.gif head/contrib/ruby19/ext/tk/sample/images/earth.gif head/contrib/ruby19/ext/tk/sample/images/letters.xbm head/contrib/ruby19/ext/tk/sample/images/tcllogo.gif head/contrib/ruby19/ext/tk/sample/images/tcllogo.gif head/contrib/ruby19/ext/tk/sample/images/teapot.ppm head/contrib/ruby19/ext/tk/sample/images/teapot.ppm head/contrib/ruby19/ext/tk/sample/images/grey.5 head/contrib/ruby19/ext/tk/sample/images/grey.25 head/contrib/ruby19/ext/tk/sample/images/gray25.xbm head/contrib/ruby19/ext/tk/sample/msgs_tk/el.msg head/contrib/ruby19/ext/tk/sample/msgs_tk/en.msg head/contrib/ruby19/ext/tk/sample/msgs_tk/eo.msg head/contrib/ruby19/ext/tk/sample/msgs_tk/cs.msg head/contrib/ruby19/ext/tk/sample/msgs_tk/license.terms head/contrib/ruby19/ext/tk/sample/msgs_tk/ru.msg head/contrib/ruby19/ext/tk/sample/msgs_tk/es.msg head/contrib/ruby19/ext/tk/sample/msgs_tk/fr.msg head/contrib/ruby19/ext/tk/sample/msgs_tk/README head/contrib/ruby19/ext/tk/sample/msgs_tk/de.msg head/contrib/ruby19/ext/tk/sample/msgs_tk/nl.msg head/contrib/ruby19/ext/tk/sample/msgs_tk/en_gb.msg head/contrib/ruby19/ext/tk/sample/msgs_tk/ja.msg head/contrib/ruby19/ext/tk/sample/msgs_tk/pl.msg head/contrib/ruby19/ext/tk/sample/msgs_tk/it.msg head/contrib/ruby19/ext/tk/sample/tkbiff.rb head/contrib/ruby19/ext/tk/sample/tcltklib/lines4.rb head/contrib/ruby19/ext/tk/sample/tcltklib/batsu.gif head/contrib/ruby19/ext/tk/sample/tcltklib/batsu.gif head/contrib/ruby19/ext/tk/sample/tcltklib/sample0.rb head/contrib/ruby19/ext/tk/sample/tcltklib/sample1.rb head/contrib/ruby19/ext/tk/sample/tcltklib/sample2.rb head/contrib/ruby19/ext/tk/sample/tcltklib/maru.gif head/contrib/ruby19/ext/tk/sample/tcltklib/maru.gif head/contrib/ruby19/ext/tk/sample/tcltklib/lines0.tcl head/contrib/ruby19/ext/tk/sample/tcltklib/lines1.rb head/contrib/ruby19/ext/tk/sample/tcltklib/lines2.rb head/contrib/ruby19/ext/tk/sample/tcltklib/lines3.rb head/contrib/ruby19/ext/tk/sample/tcltklib/safeTk.rb head/contrib/ruby19/ext/tk/sample/tkcombobox.rb head/contrib/ruby19/ext/tk/sample/tkoptdb.rb head/contrib/ruby19/ext/tk/sample/tksleep_sample.rb head/contrib/ruby19/ext/tk/sample/irbtk.rb head/contrib/ruby19/ext/tk/sample/binding_sample.rb head/contrib/ruby19/ext/tk/sample/menubar2.rb head/contrib/ruby19/ext/tk/sample/demos-jp/entry1.rb head/contrib/ruby19/ext/tk/sample/demos-jp/ttkmenu.rb head/contrib/ruby19/ext/tk/sample/demos-jp/icon.rb head/contrib/ruby19/ext/tk/sample/demos-jp/ttknote.rb head/contrib/ruby19/ext/tk/sample/demos-jp/doc.org/license.terms.tk80 head/contrib/ruby19/ext/tk/sample/demos-jp/doc.org/README.tk80 head/contrib/ruby19/ext/tk/sample/demos-jp/doc.org/README.JP head/contrib/ruby19/ext/tk/sample/demos-jp/doc.org/license.terms head/contrib/ruby19/ext/tk/sample/demos-jp/doc.org/README head/contrib/ruby19/ext/tk/sample/demos-jp/ixset head/contrib/ruby19/ext/tk/sample/demos-jp/labelframe.rb head/contrib/ruby19/ext/tk/sample/demos-jp/mclist.rb head/contrib/ruby19/ext/tk/sample/demos-jp/radio.rb head/contrib/ruby19/ext/tk/sample/demos-jp/hscale.rb head/contrib/ruby19/ext/tk/sample/demos-jp/combo.rb head/contrib/ruby19/ext/tk/sample/demos-jp/rolodex-j head/contrib/ruby19/ext/tk/sample/demos-jp/search.rb head/contrib/ruby19/ext/tk/sample/demos-jp/image3.rb head/contrib/ruby19/ext/tk/sample/demos-jp/vscale.rb head/contrib/ruby19/ext/tk/sample/demos-jp/items.rb head/contrib/ruby19/ext/tk/sample/demos-jp/widget head/contrib/ruby19/ext/tk/sample/demos-jp/knightstour.rb head/contrib/ruby19/ext/tk/sample/demos-jp/radio3.rb head/contrib/ruby19/ext/tk/sample/demos-jp/menu8x.rb head/contrib/ruby19/ext/tk/sample/demos-jp/goldberg.rb head/contrib/ruby19/ext/tk/sample/demos-jp/ttkprogress.rb head/contrib/ruby19/ext/tk/sample/demos-jp/pendulum.rb head/contrib/ruby19/ext/tk/sample/demos-jp/menubu.rb head/contrib/ruby19/ext/tk/sample/demos-jp/square head/contrib/ruby19/ext/tk/sample/demos-jp/style.rb head/contrib/ruby19/ext/tk/sample/demos-jp/rmt head/contrib/ruby19/ext/tk/sample/demos-jp/toolbar.rb head/contrib/ruby19/ext/tk/sample/demos-jp/states.rb head/contrib/ruby19/ext/tk/sample/demos-jp/image2.rb head/contrib/ruby19/ext/tk/sample/demos-jp/ttkpane.rb head/contrib/ruby19/ext/tk/sample/demos-jp/anilabel.rb head/contrib/ruby19/ext/tk/sample/demos-jp/spin.rb head/contrib/ruby19/ext/tk/sample/demos-jp/paned2.rb head/contrib/ruby19/ext/tk/sample/demos-jp/bind.rb head/contrib/ruby19/ext/tk/sample/demos-jp/bitmap.rb head/contrib/ruby19/ext/tk/sample/demos-jp/ixset2 head/contrib/ruby19/ext/tk/sample/demos-jp/check.rb head/contrib/ruby19/ext/tk/sample/demos-jp/plot.rb head/contrib/ruby19/ext/tk/sample/demos-jp/browse1 head/contrib/ruby19/ext/tk/sample/demos-jp/radio2.rb head/contrib/ruby19/ext/tk/sample/demos-jp/browse2 head/contrib/ruby19/ext/tk/sample/demos-jp/msgbox2.rb head/contrib/ruby19/ext/tk/sample/demos-jp/dialog2.rb head/contrib/ruby19/ext/tk/sample/demos-jp/entry3.rb head/contrib/ruby19/ext/tk/sample/demos-jp/ctext.rb head/contrib/ruby19/ext/tk/sample/demos-jp/filebox.rb head/contrib/ruby19/ext/tk/sample/demos-jp/ruler.rb head/contrib/ruby19/ext/tk/sample/demos-jp/aniwave.rb head/contrib/ruby19/ext/tk/sample/demos-jp/arrow.rb head/contrib/ruby19/ext/tk/sample/demos-jp/README head/contrib/ruby19/ext/tk/sample/demos-jp/tree.rb head/contrib/ruby19/ext/tk/sample/demos-jp/check2.rb head/contrib/ruby19/ext/tk/sample/demos-jp/image1.rb head/contrib/ruby19/ext/tk/sample/demos-jp/paned1.rb head/contrib/ruby19/ext/tk/sample/demos-jp/rolodex head/contrib/ruby19/ext/tk/sample/demos-jp/ttkbut.rb head/contrib/ruby19/ext/tk/sample/demos-jp/timer head/contrib/ruby19/ext/tk/sample/demos-jp/label.rb head/contrib/ruby19/ext/tk/sample/demos-jp/dialog1.rb head/contrib/ruby19/ext/tk/sample/demos-jp/menu84.rb head/contrib/ruby19/ext/tk/sample/demos-jp/floor.rb head/contrib/ruby19/ext/tk/sample/demos-jp/entry2.rb head/contrib/ruby19/ext/tk/sample/demos-jp/text.rb head/contrib/ruby19/ext/tk/sample/demos-jp/twind.rb head/contrib/ruby19/ext/tk/sample/demos-jp/clrpick.rb head/contrib/ruby19/ext/tk/sample/demos-jp/puzzle.rb head/contrib/ruby19/ext/tk/sample/demos-jp/msgbox.rb head/contrib/ruby19/ext/tk/sample/demos-jp/tcolor head/contrib/ruby19/ext/tk/sample/demos-jp/textpeer.rb head/contrib/ruby19/ext/tk/sample/demos-jp/hello head/contrib/ruby19/ext/tk/sample/demos-jp/colors.rb head/contrib/ruby19/ext/tk/sample/demos-jp/cscroll.rb head/contrib/ruby19/ext/tk/sample/demos-jp/README.1st head/contrib/ruby19/ext/tk/sample/demos-jp/floor2.rb head/contrib/ruby19/ext/tk/sample/demos-jp/form.rb head/contrib/ruby19/ext/tk/sample/demos-jp/menu.rb head/contrib/ruby19/ext/tk/sample/demos-jp/twind2.rb head/contrib/ruby19/ext/tk/sample/demos-jp/button.rb head/contrib/ruby19/ext/tk/sample/demos-jp/sayings.rb head/contrib/ruby19/ext/tk/sample/demos-jp/unicodeout.rb head/contrib/ruby19/ext/tk/sample/tkmsgcat-load_rb.rb head/contrib/ruby19/ext/tk/sample/resource.ja head/contrib/ruby19/ext/tk/sample/tktimer.rb head/contrib/ruby19/ext/tk/sample/encstr_usage.rb head/contrib/ruby19/ext/tk/sample/multi-ip_sample2.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/scrolledframe.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/spinint.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/checkbox.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/spintime.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/optionmenu.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/selectionbox.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/dialog.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/hyperhelp.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/finddialog.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintbox.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/promptdialog.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/notebook2.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/timefield.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/labeledframe.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-2.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/fileselectiondialog.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/watch.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/canvasprintdialog.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/combobox.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/calendar.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/menubar2.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/scrolledlistbox.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/scrolledtext.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/hierarchy.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/spinner.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectionbox.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/timeentry.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/datefield.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/tabset.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/feedback.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/buttonbox.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/extfileselectiondialog.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/dialogshell.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/disjointlistbox.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/menubar.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook2.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/labeledwidget.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/scrolledhtml.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/fileselectionbox.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/dateentry.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow2.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/toolbar.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/scrolledcanvas.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-1.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/messagedialog.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/selectiondialog.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/entryfield-3.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/tabnotebook.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/spindate.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/shell.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/radiobox.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/pushbutton.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/mainwindow.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/messagebox1.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/panedwindow.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/sample/notebook.rb head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/Orig_LICENSE.txt head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/find.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/find.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/oval.xbm head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/poly.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/poly.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/clear.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/clear.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/help.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/help.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/ruler.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/ruler.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/new.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/new.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/cut.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/cut.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/print.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/print.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/points.xbm head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/save.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/save.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/open.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/open.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/mag.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/mag.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/text.xbm head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/close.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/close.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/line.xbm head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/box.xbm head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/exit.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/exit.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/copy.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/copy.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/paste.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/paste.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/select.gif head/contrib/ruby19/ext/tk/sample/tkextlib/iwidgets/catalog_demo/images/select.gif head/contrib/ruby19/ext/tk/sample/tkextlib/blt/scripts/stipples.rb head/contrib/ruby19/ext/tk/sample/tkextlib/blt/graph6.rb head/contrib/ruby19/ext/tk/sample/tkextlib/blt/graph7.rb head/contrib/ruby19/ext/tk/sample/tkextlib/blt/calendar.rb head/contrib/ruby19/ext/tk/sample/tkextlib/blt/graph7a.rb head/contrib/ruby19/ext/tk/sample/tkextlib/blt/readme.txt head/contrib/ruby19/ext/tk/sample/tkextlib/blt/graph7b.rb head/contrib/ruby19/ext/tk/sample/tkextlib/blt/pareto.rb head/contrib/ruby19/ext/tk/sample/tkextlib/blt/barchart5.rb head/contrib/ruby19/ext/tk/sample/tkextlib/blt/graph7c.rb head/contrib/ruby19/ext/tk/sample/tkextlib/blt/winop1.rb head/contrib/ruby19/ext/tk/sample/tkextlib/blt/winop2.rb head/contrib/ruby19/ext/tk/sample/tkextlib/blt/plot1.rb head/contrib/ruby19/ext/tk/sample/tkextlib/blt/plot1b.rb head/contrib/ruby19/ext/tk/sample/tkextlib/blt/images/buckskin.gif head/contrib/ruby19/ext/tk/sample/tkextlib/blt/images/buckskin.gif head/contrib/ruby19/ext/tk/sample/tkextlib/blt/images/qv100.t.gif head/contrib/ruby19/ext/tk/sample/tkextlib/blt/images/qv100.t.gif head/contrib/ruby19/ext/tk/sample/tkextlib/blt/images/rain.gif head/contrib/ruby19/ext/tk/sample/tkextlib/blt/images/rain.gif head/contrib/ruby19/ext/tk/sample/tkextlib/blt/images/sample.gif head/contrib/ruby19/ext/tk/sample/tkextlib/blt/images/sample.gif head/contrib/ruby19/ext/tk/sample/tkextlib/blt/images/chalk.gif head/contrib/ruby19/ext/tk/sample/tkextlib/blt/images/chalk.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page4/image3 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page4/image3 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page4/image4 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page4/image4 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page4/image5 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page4/image5 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page4/image6 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page4/image6 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page4/image7 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page4/image7 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page4/image8 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page4/image8 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page4/index.html head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page4/image9 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page4/image9 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page4/image1 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page4/image1 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page4/image2 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page4/image2 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/Orig_COPYRIGHT.txt head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/ss.rb head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/README head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image1 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image1 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image10 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image10 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image11 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image11 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image2 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image2 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image12 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image12 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image3 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image3 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image13 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image13 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image4 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image4 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image14 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image14 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image5 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image5 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image6 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image6 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image7 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image7 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image8 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image8 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/index.html head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image9 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page1/image9 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image1 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image1 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image2 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image2 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image3 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image3 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image4 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image4 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image5 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image5 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image6 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image6 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image7 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image7 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image8 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image8 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image9 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image9 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image20 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image20 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image21 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image21 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image22 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image22 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image23 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image23 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image24 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image24 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image25 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image25 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image26 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image26 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image27 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image27 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image28 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image28 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image29 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image29 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/index.html head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image10 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image10 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image11 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image11 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image30 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image30 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image12 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image12 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image31 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image31 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image13 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image13 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image32 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image32 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image14 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image14 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image33 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image33 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image15 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image15 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image34 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image34 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image16 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image16 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image35 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image35 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image17 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image17 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image18 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image18 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image36 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image36 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image19 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image19 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image37 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image37 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image38 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image38 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image39 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page2/image39 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/hv.rb head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image13 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image13 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image4 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image4 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image14 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image14 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image5 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image5 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image6 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image6 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image7 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image7 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image8 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image8 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/index.html head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/index.html head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image9 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image9 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image1 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image1 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image10 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image10 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image11 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image11 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image2 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image2 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image12 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image12 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image3 head/contrib/ruby19/ext/tk/sample/tkextlib/tkHTML/page3/image3 head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/demo.rb head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/help.rb head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/imovie.rb head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/outlook-folders.rb head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/readme.txt head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/mailwasher.rb head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-folder.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-folder.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/imovie-01.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/imovie-01.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/imovie-02.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/imovie-02.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/imovie-03.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/imovie-03.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/imovie-04.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/imovie-04.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-inbox.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-inbox.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/imovie-05.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/imovie-05.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/big-dll.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/big-dll.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-outbox.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-outbox.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/imovie-06.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/imovie-06.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/imovie-07.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/imovie-07.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/mac-expand.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/mac-expand.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-main.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-main.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/help-book-open.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/help-book-open.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/big-exe.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/big-exe.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-clip.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-clip.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/folder-closed.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/folder-closed.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-arrow.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-arrow.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-local.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-local.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/small-txt.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/small-txt.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-group.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-group.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/unchecked.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/unchecked.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-draft.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-draft.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/internet-radio-off.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/internet-radio-off.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/internet-security.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/internet-security.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/mac-collapse.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/mac-collapse.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-watch.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-watch.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/help-page.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/help-page.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-read-2.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-read-2.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-read.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-read.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/sky.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/sky.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-unread.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-unread.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/folder-open.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/folder-open.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/big-folder.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/big-folder.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/internet-check-off.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/internet-check-off.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/internet-check-on.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/internet-check-on.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/big-txt.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/big-txt.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/big-file.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/big-file.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/file.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/file.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/small-folder.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/small-folder.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/small-dll.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/small-dll.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/internet-print.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/internet-print.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/small-file.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/small-file.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/checked.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/checked.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/small-exe.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/small-exe.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/help-book-closed.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/help-book-closed.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/internet-search.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/internet-search.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/internet-radio-on.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/internet-radio-on.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-deleted.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-deleted.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-server.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-server.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-sent.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/pics/outlook-sent.gif head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/layout.rb head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/www-options.rb head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/bitmaps.rb head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/explorer.rb head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/outlook-newgroup.rb head/contrib/ruby19/ext/tk/sample/tkextlib/treectrl/random.rb head/contrib/ruby19/ext/tk/sample/tkextlib/bwidget/select.rb head/contrib/ruby19/ext/tk/sample/tkextlib/bwidget/tree.rb head/contrib/ruby19/ext/tk/sample/tkextlib/bwidget/basic.rb head/contrib/ruby19/ext/tk/sample/tkextlib/bwidget/tmpldlg.rb head/contrib/ruby19/ext/tk/sample/tkextlib/bwidget/demo.rb head/contrib/ruby19/ext/tk/sample/tkextlib/bwidget/dnd.rb head/contrib/ruby19/ext/tk/sample/tkextlib/bwidget/bwidget.xbm head/contrib/ruby19/ext/tk/sample/tkextlib/bwidget/manager.rb head/contrib/ruby19/ext/tk/sample/tkextlib/bwidget/x1.xbm head/contrib/ruby19/ext/tk/sample/tkextlib/bwidget/Orig_LICENSE.txt head/contrib/ruby19/ext/tk/sample/tkextlib/tktable/spreadsheet.rb head/contrib/ruby19/ext/tk/sample/tkextlib/tktable/Orig_LICENSE.txt head/contrib/ruby19/ext/tk/sample/tkextlib/tktable/buttons.rb head/contrib/ruby19/ext/tk/sample/tkextlib/tktable/command.rb head/contrib/ruby19/ext/tk/sample/tkextlib/tktable/valid.rb head/contrib/ruby19/ext/tk/sample/tkextlib/tktable/maxsize.rb head/contrib/ruby19/ext/tk/sample/tkextlib/tktable/basic.rb head/contrib/ruby19/ext/tk/sample/tkextlib/tktable/tcllogo.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tktable/tcllogo.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tktable/debug.rb head/contrib/ruby19/ext/tk/sample/tkextlib/tktable/dynarows.rb head/contrib/ruby19/ext/tk/sample/tkextlib/tcllib/plotdemos3.rb head/contrib/ruby19/ext/tk/sample/tkextlib/tcllib/Orig_LICENSE.txt head/contrib/ruby19/ext/tk/sample/tkextlib/tcllib/xyplot.rb head/contrib/ruby19/ext/tk/sample/tkextlib/tcllib/datefield.rb head/contrib/ruby19/ext/tk/sample/tkextlib/tcllib/plotdemos1.rb head/contrib/ruby19/ext/tk/sample/tkextlib/tcllib/plotdemos2.rb head/contrib/ruby19/ext/tk/sample/tkextlib/vu/README.txt head/contrib/ruby19/ext/tk/sample/tkextlib/vu/canvItems.rb head/contrib/ruby19/ext/tk/sample/tkextlib/vu/m128_000.xbm head/contrib/ruby19/ext/tk/sample/tkextlib/vu/canvSticker.rb head/contrib/ruby19/ext/tk/sample/tkextlib/vu/dial_demo.rb head/contrib/ruby19/ext/tk/sample/tkextlib/vu/pie.rb head/contrib/ruby19/ext/tk/sample/tkextlib/vu/Orig_LICENSE.txt head/contrib/ruby19/ext/tk/sample/tkextlib/vu/canvSticker2.rb head/contrib/ruby19/ext/tk/sample/tkextlib/vu/oscilloscope.rb head/contrib/ruby19/ext/tk/sample/tkextlib/vu/vu_demo.rb head/contrib/ruby19/ext/tk/sample/tkextlib/ICONS/viewIcons.rb head/contrib/ruby19/ext/tk/sample/tkextlib/ICONS/tkIcons head/contrib/ruby19/ext/tk/sample/tkextlib/ICONS/tkIcons-sample.kde head/contrib/ruby19/ext/tk/sample/tkextlib/ICONS/tkIcons.kde head/contrib/ruby19/ext/tk/sample/tkextlib/ICONS/Orig_LICENSE.txt head/contrib/ruby19/ext/tk/sample/tkextlib/tkimg/demo.rb head/contrib/ruby19/ext/tk/sample/tkextlib/tkimg/license_terms_of_Img_extension head/contrib/ruby19/ext/tk/sample/tkextlib/tkimg/readme.txt head/contrib/ruby19/ext/tk/sample/tkextlib/tile/readme.txt head/contrib/ruby19/ext/tk/sample/tkextlib/tile/Orig_LICENSE.txt head/contrib/ruby19/ext/tk/sample/tkextlib/tile/iconlib.tcl head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-nu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-nu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-thumb-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-thumb-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-n.xcf head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-n.xcf head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-thumb.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-thumb.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowup-h.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowup-h.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowup-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowup-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowup.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowup.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-hc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-hc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/vslider-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/vslider-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowdown-h.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowdown-h.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/vslider.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/vslider.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-nc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-nc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowright-h.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowright-h.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/slider-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/slider-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowdown-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowdown-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/slider.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/slider.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowdown.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowdown.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowright-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowright-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-hc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-hc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-hu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-hu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowright.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowright.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowleft-h.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowleft-h.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-nc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-nc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-nu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/check-nu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-h.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-h.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowleft-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowleft-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-vthumb-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-vthumb-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowleft.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/arrowleft.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-vthumb.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/sb-vthumb.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/button-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-hu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue/radio-hu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/blue.tcl head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/blue/pkgIndex.tcl head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-nc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-nc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowup-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowup-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-nu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-nu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-pc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-pc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowleft-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowleft-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/button-h.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/button-h.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowleft-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowleft-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/vslider-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/vslider-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-hc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-hc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/button-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/button-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/hsb-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/hsb-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-hu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-hu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/button-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/button-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-nc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-nc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowdown-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowdown-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-pc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-pc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-nu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-nu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowdown-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowdown-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowright-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowright-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowright-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowright-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/hslider-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/hslider-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/vsb-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/vsb-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-hc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/radio-hc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-hu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/check-hu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowup-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik/arrowup-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/plastik.tcl head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/plastik/pkgIndex.tcl head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/pkgIndex.tcl head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-hu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-hu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/button-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/button-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-hu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-hu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-nc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-nc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-nc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-nc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-nu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-nu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-nu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-nu.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/button-h.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/button-h.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-hc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/check-hc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/button-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/button-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-hc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc/radio-hc.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc/kroc.tcl head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/kroc.rb head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/pkgIndex.tcl head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowleft-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowleft-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowleft-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowleft-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/radio-c.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/radio-c.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowright-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowright-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-a.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-a.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/hslider-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/hslider-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowright-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowright-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-d.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-d.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowup-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowup-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-d.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-d.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowup-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowup-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/check-c.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/check-c.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-h.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-h.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/radio-u.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/radio-u.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tab-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tab-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tab-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tab-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/vslider-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/vslider-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tbar-a.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tbar-a.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/hsb-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/hsb-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/hsb-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/hsb-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-s.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/button-s.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowdown-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowdown-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowdown-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/arrowdown-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/check-u.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/check-u.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tbar-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tbar-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/vsb-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/vsb-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tbar-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/tbar-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/vsb-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/vsb-p.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-arrow-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik/mbut-arrow-n.gif head/contrib/ruby19/ext/tk/sample/tkextlib/tile/themes/keramik/keramik.tcl head/contrib/ruby19/ext/tk/sample/tkextlib/tile/demo.rb head/contrib/ruby19/ext/tk/sample/tkextlib/tile/repeater.tcl head/contrib/ruby19/ext/tk/sample/tkextlib/tile/toolbutton.tcl head/contrib/ruby19/ext/tk/sample/figmemo_sample.rb head/contrib/ruby19/ext/tk/sample/remote-ip_sample2.rb head/contrib/ruby19/ext/tk/sample/btn_with_frame.rb head/contrib/ruby19/ext/tk/sample/24hr_clock.rb head/contrib/ruby19/ext/tk/sample/tkballoonhelp.rb head/contrib/ruby19/ext/tk/sample/optobj_sample.rb head/contrib/ruby19/ext/tk/sample/tktextframe.rb head/contrib/ruby19/ext/tk/sample/tktree.rb head/contrib/ruby19/ext/tk/sample/tkmsgcat-load_rb2.rb head/contrib/ruby19/ext/tk/sample/tkbrowse.rb head/contrib/ruby19/ext/tk/sample/tktimer2.rb head/contrib/ruby19/ext/tk/sample/remote-ip_sample.rb head/contrib/ruby19/ext/tk/sample/tkfrom.rb head/contrib/ruby19/ext/tk/sample/tkmulticolumnlist.rb head/contrib/ruby19/ext/tk/sample/demos-en/spin.rb head/contrib/ruby19/ext/tk/sample/demos-en/button.rb head/contrib/ruby19/ext/tk/sample/demos-en/bind.rb head/contrib/ruby19/ext/tk/sample/demos-en/plot.rb head/contrib/ruby19/ext/tk/sample/demos-en/unicodeout.rb head/contrib/ruby19/ext/tk/sample/demos-en/browse1 head/contrib/ruby19/ext/tk/sample/demos-en/dialog1.rb head/contrib/ruby19/ext/tk/sample/demos-en/browse2 head/contrib/ruby19/ext/tk/sample/demos-en/items.rb head/contrib/ruby19/ext/tk/sample/demos-en/entry1.rb head/contrib/ruby19/ext/tk/sample/demos-en/clrpick.rb head/contrib/ruby19/ext/tk/sample/demos-en/ixset head/contrib/ruby19/ext/tk/sample/demos-en/labelframe.rb head/contrib/ruby19/ext/tk/sample/demos-en/mclist.rb head/contrib/ruby19/ext/tk/sample/demos-en/tree.rb head/contrib/ruby19/ext/tk/sample/demos-en/hscale.rb head/contrib/ruby19/ext/tk/sample/demos-en/style.rb head/contrib/ruby19/ext/tk/sample/demos-en/tcolor head/contrib/ruby19/ext/tk/sample/demos-en/README.1st head/contrib/ruby19/ext/tk/sample/demos-en/cscroll.rb head/contrib/ruby19/ext/tk/sample/demos-en/image3.rb head/contrib/ruby19/ext/tk/sample/demos-en/search.rb head/contrib/ruby19/ext/tk/sample/demos-en/rolodex head/contrib/ruby19/ext/tk/sample/demos-en/vscale.rb head/contrib/ruby19/ext/tk/sample/demos-en/check.rb head/contrib/ruby19/ext/tk/sample/demos-en/sayings.rb head/contrib/ruby19/ext/tk/sample/demos-en/radio3.rb head/contrib/ruby19/ext/tk/sample/demos-en/text.rb head/contrib/ruby19/ext/tk/sample/demos-en/ChangeLog head/contrib/ruby19/ext/tk/sample/demos-en/ttkmenu.rb head/contrib/ruby19/ext/tk/sample/demos-en/ctext.rb head/contrib/ruby19/ext/tk/sample/demos-en/ttknote.rb head/contrib/ruby19/ext/tk/sample/demos-en/ruler.rb head/contrib/ruby19/ext/tk/sample/demos-en/arrow.rb head/contrib/ruby19/ext/tk/sample/demos-en/menubu.rb head/contrib/ruby19/ext/tk/sample/demos-en/textpeer.rb head/contrib/ruby19/ext/tk/sample/demos-en/ChangeLog.prev head/contrib/ruby19/ext/tk/sample/demos-en/states.rb head/contrib/ruby19/ext/tk/sample/demos-en/form.rb head/contrib/ruby19/ext/tk/sample/demos-en/menu.rb head/contrib/ruby19/ext/tk/sample/demos-en/image2.rb head/contrib/ruby19/ext/tk/sample/demos-en/paned2.rb head/contrib/ruby19/ext/tk/sample/demos-en/bitmap.rb head/contrib/ruby19/ext/tk/sample/demos-en/label.rb head/contrib/ruby19/ext/tk/sample/demos-en/README.tkencoding head/contrib/ruby19/ext/tk/sample/demos-en/radio2.rb head/contrib/ruby19/ext/tk/sample/demos-en/widget head/contrib/ruby19/ext/tk/sample/demos-en/floor.rb head/contrib/ruby19/ext/tk/sample/demos-en/knightstour.rb head/contrib/ruby19/ext/tk/sample/demos-en/entry3.rb head/contrib/ruby19/ext/tk/sample/demos-en/twind.rb head/contrib/ruby19/ext/tk/sample/demos-en/ttkprogress.rb head/contrib/ruby19/ext/tk/sample/demos-en/icon.rb head/contrib/ruby19/ext/tk/sample/demos-en/doc.org/license.terms head/contrib/ruby19/ext/tk/sample/demos-en/doc.org/README head/contrib/ruby19/ext/tk/sample/demos-en/doc.org/license.terms.tk80 head/contrib/ruby19/ext/tk/sample/demos-en/doc.org/README.tk80 head/contrib/ruby19/ext/tk/sample/demos-en/doc.org/README.JP head/contrib/ruby19/ext/tk/sample/demos-en/square head/contrib/ruby19/ext/tk/sample/demos-en/check2.rb head/contrib/ruby19/ext/tk/sample/demos-en/toolbar.rb head/contrib/ruby19/ext/tk/sample/demos-en/image1.rb head/contrib/ruby19/ext/tk/sample/demos-en/ttkpane.rb head/contrib/ruby19/ext/tk/sample/demos-en/paned1.rb head/contrib/ruby19/ext/tk/sample/demos-en/ixset2 head/contrib/ruby19/ext/tk/sample/demos-en/ttkbut.rb head/contrib/ruby19/ext/tk/sample/demos-en/timer head/contrib/ruby19/ext/tk/sample/demos-en/menu84.rb head/contrib/ruby19/ext/tk/sample/demos-en/dialog2.rb head/contrib/ruby19/ext/tk/sample/demos-en/msgbox2.rb head/contrib/ruby19/ext/tk/sample/demos-en/entry2.rb head/contrib/ruby19/ext/tk/sample/demos-en/tkencoding.rb head/contrib/ruby19/ext/tk/sample/demos-en/goldberg.rb head/contrib/ruby19/ext/tk/sample/demos-en/filebox.rb head/contrib/ruby19/ext/tk/sample/demos-en/pendulum.rb head/contrib/ruby19/ext/tk/sample/demos-en/puzzle.rb head/contrib/ruby19/ext/tk/sample/demos-en/aniwave.rb head/contrib/ruby19/ext/tk/sample/demos-en/README head/contrib/ruby19/ext/tk/sample/demos-en/radio.rb head/contrib/ruby19/ext/tk/sample/demos-en/combo.rb head/contrib/ruby19/ext/tk/sample/demos-en/msgbox.rb head/contrib/ruby19/ext/tk/sample/demos-en/rmt head/contrib/ruby19/ext/tk/sample/demos-en/colors.rb head/contrib/ruby19/ext/tk/sample/demos-en/hello head/contrib/ruby19/ext/tk/sample/demos-en/floor2.rb head/contrib/ruby19/ext/tk/sample/demos-en/anilabel.rb head/contrib/ruby19/ext/tk/sample/demos-en/twind2.rb head/contrib/ruby19/ext/tk/sample/cmd_resource head/contrib/ruby19/ext/tk/sample/bindtag_sample.rb head/contrib/ruby19/ext/tk/sample/scrollframe.rb head/contrib/ruby19/ext/tk/sample/menubar1.rb head/contrib/ruby19/ext/tk/sample/cmd_res_test.rb head/contrib/ruby19/ext/tk/sample/tktextio.rb head/contrib/ruby19/ext/tk/sample/msgs_rb2/ja.msg head/contrib/ruby19/ext/tk/sample/msgs_rb2/README head/contrib/ruby19/ext/tk/sample/msgs_rb2/de.msg head/contrib/ruby19/ext/tk/sample/menubar3.rb head/contrib/ruby19/ext/tk/sample/editable_listbox.rb head/contrib/ruby19/ext/tk/sample/tktree.tcl head/contrib/ruby19/ext/tk/sample/propagate.rb head/contrib/ruby19/ext/tk/sample/tkoptdb-safeTk.rb head/contrib/ruby19/ext/tk/sample/binstr_usage.rb head/contrib/ruby19/ext/tk/sample/tkrttimer.rb head/contrib/ruby19/ext/tk/old-extconf.rb head/contrib/ruby19/ext/tk/stubs.h head/contrib/ruby19/ext/iconv/charset_alias.rb head/contrib/ruby19/ext/iconv/extconf.rb head/contrib/ruby19/ext/iconv/mkwrapper.rb head/contrib/ruby19/ext/iconv/depend head/contrib/ruby19/ext/iconv/iconv.c head/contrib/ruby19/ext/Setup.atheos head/contrib/ruby19/ext/readline/README.ja head/contrib/ruby19/ext/readline/extconf.rb head/contrib/ruby19/ext/readline/README head/contrib/ruby19/ext/readline/depend head/contrib/ruby19/ext/readline/readline.c head/contrib/ruby19/ext/fiddle/closure.h head/contrib/ruby19/ext/fiddle/function.c head/contrib/ruby19/ext/fiddle/lib/fiddle.rb head/contrib/ruby19/ext/fiddle/lib/fiddle/function.rb head/contrib/ruby19/ext/fiddle/lib/fiddle/closure.rb head/contrib/ruby19/ext/fiddle/extconf.rb head/contrib/ruby19/ext/fiddle/fiddle.c head/contrib/ruby19/ext/fiddle/conversions.c head/contrib/ruby19/ext/fiddle/function.h head/contrib/ruby19/ext/fiddle/closure.c head/contrib/ruby19/ext/fiddle/fiddle.h head/contrib/ruby19/ext/fiddle/conversions.h head/contrib/ruby19/ext/fiber/extconf.rb head/contrib/ruby19/ext/fiber/fiber.c head/contrib/ruby19/ext/socket/raddrinfo.c head/contrib/ruby19/ext/socket/option.c head/contrib/ruby19/ext/socket/sockport.h head/contrib/ruby19/ext/socket/unixserver.c head/contrib/ruby19/ext/socket/.document head/contrib/ruby19/ext/socket/constants.c head/contrib/ruby19/ext/socket/tcpserver.c head/contrib/ruby19/ext/socket/depend head/contrib/ruby19/ext/socket/ipsocket.c head/contrib/ruby19/ext/socket/lib/socket.rb head/contrib/ruby19/ext/socket/mkconstants.rb head/contrib/ruby19/ext/socket/getaddrinfo.c head/contrib/ruby19/ext/socket/extconf.rb head/contrib/ruby19/ext/socket/socket.c head/contrib/ruby19/ext/socket/basicsocket.c head/contrib/ruby19/ext/socket/sockssocket.c head/contrib/ruby19/ext/socket/addrinfo.h head/contrib/ruby19/ext/socket/ancdata.c head/contrib/ruby19/ext/socket/getnameinfo.c head/contrib/ruby19/ext/socket/unixsocket.c head/contrib/ruby19/ext/socket/rubysocket.h head/contrib/ruby19/ext/socket/tcpsocket.c head/contrib/ruby19/ext/socket/udpsocket.c head/contrib/ruby19/ext/socket/init.c head/contrib/ruby19/ext/extmk.rb head/contrib/ruby19/ext/.document head/contrib/ruby19/ext/pathname/extconf.rb head/contrib/ruby19/ext/pathname/pathname.c head/contrib/ruby19/ext/pathname/lib/pathname.rb head/contrib/ruby19/ext/stringio/extconf.rb head/contrib/ruby19/ext/stringio/README head/contrib/ruby19/ext/stringio/depend head/contrib/ruby19/ext/stringio/stringio.c head/contrib/ruby19/ext/Setup head/contrib/ruby19/ext/ripper/eventids2table.c head/contrib/ruby19/ext/ripper/README head/contrib/ruby19/ext/ripper/depend head/contrib/ruby19/ext/ripper/tools/generate-param-macros.rb head/contrib/ruby19/ext/ripper/tools/generate.rb head/contrib/ruby19/ext/ripper/tools/preproc.rb head/contrib/ruby19/ext/ripper/tools/strip.rb head/contrib/ruby19/ext/ripper/ripper.c head/contrib/ruby19/ext/ripper/eventids1.c head/contrib/ruby19/ext/ripper/eventids2.c head/contrib/ruby19/ext/ripper/lib/ripper/filter.rb head/contrib/ruby19/ext/ripper/lib/ripper/core.rb head/contrib/ruby19/ext/ripper/lib/ripper/lexer.rb head/contrib/ruby19/ext/ripper/lib/ripper/sexp.rb head/contrib/ruby19/ext/ripper/lib/ripper.rb head/contrib/ruby19/ext/ripper/y.output head/contrib/ruby19/ext/ripper/extconf.rb head/contrib/ruby19/ext/ripper/ripper.y head/contrib/ruby19/COPYING.ja head/contrib/ruby19/ruby_atomic.h head/contrib/ruby19/struct.c head/contrib/ruby19/variable.c head/contrib/ruby19/debug.c head/contrib/ruby19/marshal.c head/contrib/ruby19/regerror.c head/contrib/ruby19/COPYING head/contrib/ruby19/man/ruby.1 head/contrib/ruby19/man/rake.1 head/contrib/ruby19/man/goruby.1 head/contrib/ruby19/man/erb.1 head/contrib/ruby19/man/ri.1 head/contrib/ruby19/man/irb.1 head/contrib/ruby19/debug.h head/contrib/ruby19/regint.h head/contrib/ruby19/GPL head/contrib/ruby19/include/ruby/oniguruma.h head/contrib/ruby19/include/ruby/re.h head/contrib/ruby19/include/ruby/io.h head/contrib/ruby19/include/ruby/missing.h head/contrib/ruby19/include/ruby/regex.h head/contrib/ruby19/include/ruby/defines.h head/contrib/ruby19/include/ruby/util.h head/contrib/ruby19/include/ruby/ruby.h head/contrib/ruby19/include/ruby/vm.h head/contrib/ruby19/include/ruby/version.h head/contrib/ruby19/include/ruby/encoding.h head/contrib/ruby19/include/ruby/st.h head/contrib/ruby19/include/ruby/backward/util.h head/contrib/ruby19/include/ruby/backward/rubysig.h head/contrib/ruby19/include/ruby/backward/classext.h head/contrib/ruby19/include/ruby/backward/st.h head/contrib/ruby19/include/ruby/backward/rubyio.h head/contrib/ruby19/include/ruby/intern.h head/contrib/ruby19/include/ruby/subst.h head/contrib/ruby19/include/ruby/win32.h head/contrib/ruby19/include/ruby.h head/contrib/ruby19/vm.inc head/contrib/ruby19/safe.c head/contrib/ruby19/dir.c head/contrib/ruby19/ruby.c head/contrib/ruby19/optinsn.inc head/contrib/ruby19/win32/resource.rb head/contrib/ruby19/win32/README.win32 head/contrib/ruby19/win32/mkexports.rb head/contrib/ruby19/win32/stub.c head/contrib/ruby19/win32/file.c head/contrib/ruby19/win32/dir.h head/contrib/ruby19/win32/makedirs.bat head/contrib/ruby19/win32/Makefile.sub head/contrib/ruby19/win32/rmdirs.bat head/contrib/ruby19/win32/setup.mak head/contrib/ruby19/win32/ifchange.bat head/contrib/ruby19/win32/enc-setup.mak head/contrib/ruby19/win32/rmall.bat head/contrib/ruby19/win32/winmain.c head/contrib/ruby19/win32/rm.bat head/contrib/ruby19/win32/win32.c head/contrib/ruby19/win32/configure.bat head/contrib/ruby19/lex.c head/contrib/ruby19/dmyencoding.c head/contrib/ruby19/defs/default_gems head/contrib/ruby19/defs/lex.c.src head/contrib/ruby19/defs/known_errors.def head/contrib/ruby19/defs/keywords head/contrib/ruby19/defs/opt_insn_unif.def head/contrib/ruby19/defs/opt_operand.def head/contrib/ruby19/transdb.h head/contrib/ruby19/BSDL head/contrib/ruby19/configure.in head/contrib/ruby19/re.c head/contrib/ruby19/complex.c head/contrib/ruby19/misc/rdoc-mode.el head/contrib/ruby19/misc/ruby-electric.el head/contrib/ruby19/misc/inf-ruby.el head/contrib/ruby19/misc/rb_optparse.bash head/contrib/ruby19/misc/README head/contrib/ruby19/misc/ruby-style.el head/contrib/ruby19/misc/rubydb2x.el head/contrib/ruby19/misc/rubydb3x.el head/contrib/ruby19/misc/ruby-mode.el head/contrib/ruby19/misc/rb_optparse.zsh head/contrib/ruby19/dln.c head/contrib/ruby19/file.c head/contrib/ruby19/encdb.h head/contrib/ruby19/compar.c head/contrib/ruby19/enumerator.c head/contrib/ruby19/dln.h head/contrib/ruby19/ia64.s head/contrib/ruby19/regsyntax.c head/contrib/ruby19/ToDo head/contrib/ruby19/node.c head/contrib/ruby19/bin/testrb head/contrib/ruby19/bin/rdoc head/contrib/ruby19/bin/erb head/contrib/ruby19/bin/gem head/contrib/ruby19/bin/ri head/contrib/ruby19/bin/irb head/contrib/ruby19/bin/rake head/contrib/ruby19/dmydln.c head/contrib/ruby19/node.h head/contrib/ruby19/range.c head/contrib/ruby19/regcomp.c head/contrib/ruby19/strftime.c head/contrib/ruby19/eval_error.c head/contrib/ruby19/revision.h head/contrib/ruby19/README.EXT.ja head/contrib/ruby19/insns.def head/contrib/ruby19/ChangeLog head/contrib/ruby19/io.c head/contrib/ruby19/lex.c.blt head/contrib/ruby19/parse.c head/contrib/ruby19/miniprelude.c head/contrib/ruby19/parse.h head/contrib/ruby19/transcode_data.h head/contrib/ruby19/bignum.c head/contrib/ruby19/symbian/README.SYMBIAN head/contrib/ruby19/symbian/setup head/contrib/ruby19/symbian/missing-pips.c head/contrib/ruby19/symbian/pre-build head/contrib/ruby19/symbian/configure.bat head/contrib/ruby19/symbian/missing-aeabi.c head/contrib/ruby19/transcode.c head/contrib/ruby19/st.c head/contrib/ruby19/math.c head/contrib/ruby19/thread_win32.c head/contrib/ruby19/insns_info.inc head/contrib/ruby19/thread_win32.h head/contrib/ruby19/time.c head/contrib/ruby19/vm_core.h head/contrib/ruby19/parse.y head/contrib/ruby19/class.c head/contrib/ruby19/spec/README head/contrib/ruby19/spec/default.mspec head/contrib/ruby19/gem_prelude.rb head/contrib/ruby19/bcc32/mkexports.rb head/contrib/ruby19/bcc32/Makefile.sub head/contrib/ruby19/bcc32/configure.bat head/contrib/ruby19/bcc32/setup.mak head/contrib/ruby19/bcc32/README.bcc32 head/contrib/ruby19/signal.c head/contrib/ruby19/random.c head/contrib/ruby19/internal.h head/contrib/ruby19/doc/images/boottime-classes.png head/contrib/ruby19/doc/images/boottime-classes.png head/contrib/ruby19/doc/ChangeLog-YARV head/contrib/ruby19/doc/etc.rd.ja head/contrib/ruby19/doc/shell.rd head/contrib/ruby19/doc/irb/irb-tools.rd.ja head/contrib/ruby19/doc/irb/irb.rd.ja head/contrib/ruby19/doc/irb/irb.rd head/contrib/ruby19/doc/pty/README.ja head/contrib/ruby19/doc/pty/README head/contrib/ruby19/doc/pty/README.expect.ja head/contrib/ruby19/doc/pty/README.expect head/contrib/ruby19/doc/etc.rd head/contrib/ruby19/doc/NEWS-1.9.1 head/contrib/ruby19/doc/NEWS-1.9.2 head/contrib/ruby19/doc/rake/jamis.rb head/contrib/ruby19/doc/rake/CHANGES head/contrib/ruby19/doc/rake/rakefile.rdoc head/contrib/ruby19/doc/rake/release_notes/rake-0.8.7.rdoc head/contrib/ruby19/doc/rake/glossary.rdoc head/contrib/ruby19/doc/rake/example/a.c head/contrib/ruby19/doc/rake/example/b.c head/contrib/ruby19/doc/rake/example/Rakefile1 head/contrib/ruby19/doc/rake/example/Rakefile2 head/contrib/ruby19/doc/rake/example/main.c head/contrib/ruby19/doc/rake/proto_rake.rdoc head/contrib/ruby19/doc/rake/README head/contrib/ruby19/doc/rake/command_line_usage.rdoc head/contrib/ruby19/doc/rake/rational.rdoc head/contrib/ruby19/doc/NEWS-1.8.7 head/contrib/ruby19/doc/forwardable.rd.ja head/contrib/ruby19/doc/ChangeLog-1.8.0 head/contrib/ruby19/doc/forwardable.rd head/contrib/ruby19/doc/re.rdoc head/contrib/ruby19/doc/ChangeLog-1.9.3 head/contrib/ruby19/doc/rubygems/LICENSE.txt head/contrib/ruby19/doc/rubygems/ChangeLog head/contrib/ruby19/doc/rubygems/README head/contrib/ruby19/doc/rubygems/History.txt head/contrib/ruby19/doc/shell.rd.ja head/contrib/ruby19/compile.c head/contrib/ruby19/error.c head/contrib/ruby19/vm_eval.c head/contrib/ruby19/gc.c head/contrib/ruby19/template/insns_info.inc.tmpl head/contrib/ruby19/template/minsns.inc.tmpl head/contrib/ruby19/template/optunifs.inc.tmpl head/contrib/ruby19/template/vmtc.inc.tmpl head/contrib/ruby19/template/id.h.tmpl head/contrib/ruby19/template/Doxyfile.tmpl head/contrib/ruby19/template/transdb.h.tmpl head/contrib/ruby19/template/vm.inc.tmpl head/contrib/ruby19/template/yarvarch.ja head/contrib/ruby19/template/opt_sc.inc.tmpl head/contrib/ruby19/template/known_errors.inc.tmpl head/contrib/ruby19/template/encdb.h.tmpl head/contrib/ruby19/template/fake.rb.in head/contrib/ruby19/template/insns.inc.tmpl head/contrib/ruby19/template/optinsn.inc.tmpl head/contrib/ruby19/template/yasmdata.rb.tmpl head/contrib/ruby19/template/yarvarch.en head/contrib/ruby19/template/ruby.pc.in head/contrib/ruby19/id.c head/contrib/ruby19/optunifs.inc head/contrib/ruby19/KNOWNBUGS.rb head/contrib/ruby19/gc.h head/contrib/ruby19/sample/rss/list_description.rb head/contrib/ruby19/sample/rss/convert.rb head/contrib/ruby19/sample/rss/re_read.rb head/contrib/ruby19/sample/rss/blend.rb head/contrib/ruby19/sample/rss/rss_recent.rb head/contrib/ruby19/sample/drb/speedc.rb head/contrib/ruby19/sample/drb/rinda_ts.rb head/contrib/ruby19/sample/drb/old_tuplespace.rb head/contrib/ruby19/sample/drb/gw_cu.rb head/contrib/ruby19/sample/drb/dhasenc.rb head/contrib/ruby19/sample/drb/drbc.rb head/contrib/ruby19/sample/drb/rindas.rb head/contrib/ruby19/sample/drb/darray.rb head/contrib/ruby19/sample/drb/drbch.rb head/contrib/ruby19/sample/drb/speeds.rb head/contrib/ruby19/sample/drb/namec.rb head/contrib/ruby19/sample/drb/drbm.rb head/contrib/ruby19/sample/drb/dchatc.rb head/contrib/ruby19/sample/drb/drbs-acl.rb head/contrib/ruby19/sample/drb/dlogc.rb head/contrib/ruby19/sample/drb/drbs.rb head/contrib/ruby19/sample/drb/dqlib.rb head/contrib/ruby19/sample/drb/drbssl_c.rb head/contrib/ruby19/sample/drb/dqin.rb head/contrib/ruby19/sample/drb/dqout.rb head/contrib/ruby19/sample/drb/ring_echo.rb head/contrib/ruby19/sample/drb/http0serv.rb head/contrib/ruby19/sample/drb/extserv_test.rb head/contrib/ruby19/sample/drb/dhasen.rb head/contrib/ruby19/sample/drb/simpletuple.rb head/contrib/ruby19/sample/drb/gw_ct.rb head/contrib/ruby19/sample/drb/ring_place.rb head/contrib/ruby19/sample/drb/dchats.rb head/contrib/ruby19/sample/drb/dbiff.rb head/contrib/ruby19/sample/drb/drbssl_s.rb head/contrib/ruby19/sample/drb/holderc.rb head/contrib/ruby19/sample/drb/name.rb head/contrib/ruby19/sample/drb/dcdbiff.rb head/contrib/ruby19/sample/drb/ring_inspect.rb head/contrib/ruby19/sample/drb/darrayc.rb head/contrib/ruby19/sample/drb/drbmc.rb head/contrib/ruby19/sample/drb/dqueue.rb head/contrib/ruby19/sample/drb/README.rd.ja head/contrib/ruby19/sample/drb/dlogd.rb head/contrib/ruby19/sample/drb/README.rd head/contrib/ruby19/sample/drb/gw_s.rb head/contrib/ruby19/sample/drb/http0.rb head/contrib/ruby19/sample/drb/rindac.rb head/contrib/ruby19/sample/drb/holders.rb head/contrib/ruby19/sample/less.rb head/contrib/ruby19/sample/rcs.awk head/contrib/ruby19/sample/pi.rb head/contrib/ruby19/sample/fib.pl head/contrib/ruby19/sample/svr.rb head/contrib/ruby19/sample/sieve.rb head/contrib/ruby19/sample/exyacc.rb head/contrib/ruby19/sample/logger/app.rb head/contrib/ruby19/sample/logger/log.rb head/contrib/ruby19/sample/logger/shifting.rb head/contrib/ruby19/sample/fact.rb head/contrib/ruby19/sample/dir.rb head/contrib/ruby19/sample/export.rb head/contrib/ruby19/sample/fib.py head/contrib/ruby19/sample/rdoc/markup/sample.rb head/contrib/ruby19/sample/rdoc/markup/rdoc2latex.rb head/contrib/ruby19/sample/timeout.rb head/contrib/ruby19/sample/optparse/opttest.rb head/contrib/ruby19/sample/optparse/subcommand.rb head/contrib/ruby19/sample/coverage.rb head/contrib/ruby19/sample/dualstack-httpd.rb head/contrib/ruby19/sample/list2.rb head/contrib/ruby19/sample/freq.rb head/contrib/ruby19/sample/occur2.rb head/contrib/ruby19/sample/trojan.rb head/contrib/ruby19/sample/cal.rb head/contrib/ruby19/sample/from.rb head/contrib/ruby19/sample/biorhythm.rb head/contrib/ruby19/sample/uumerge.rb head/contrib/ruby19/sample/pty/script.rb head/contrib/ruby19/sample/pty/shl.rb head/contrib/ruby19/sample/pty/expect_sample.rb head/contrib/ruby19/sample/list.rb head/contrib/ruby19/sample/occur.rb head/contrib/ruby19/sample/testunit/tc_subtracter.rb head/contrib/ruby19/sample/testunit/ts_examples.rb head/contrib/ruby19/sample/testunit/tc_adder.rb head/contrib/ruby19/sample/testunit/subtracter.rb head/contrib/ruby19/sample/testunit/adder.rb head/contrib/ruby19/sample/fullpath.rb head/contrib/ruby19/sample/fib.scm head/contrib/ruby19/sample/fib.awk head/contrib/ruby19/sample/test.rb head/contrib/ruby19/sample/openssl/gen_csr.rb head/contrib/ruby19/sample/openssl/cert2text.rb head/contrib/ruby19/sample/openssl/smime_write.rb head/contrib/ruby19/sample/openssl/echo_cli.rb head/contrib/ruby19/sample/openssl/smime_read.rb head/contrib/ruby19/sample/openssl/wget.rb head/contrib/ruby19/sample/openssl/echo_svr.rb head/contrib/ruby19/sample/openssl/certstore.rb head/contrib/ruby19/sample/openssl/cipher.rb head/contrib/ruby19/sample/openssl/c_rehash.rb head/contrib/ruby19/sample/openssl/crlstore.rb head/contrib/ruby19/sample/occur.pl head/contrib/ruby19/sample/mpart.rb head/contrib/ruby19/sample/webrick/httpproxy.rb head/contrib/ruby19/sample/webrick/demo-app.rb head/contrib/ruby19/sample/webrick/demo-multipart.cgi head/contrib/ruby19/sample/webrick/hello.cgi head/contrib/ruby19/sample/webrick/hello.rb head/contrib/ruby19/sample/webrick/httpd.rb head/contrib/ruby19/sample/webrick/demo-urlencoded.cgi head/contrib/ruby19/sample/webrick/demo-servlet.rb head/contrib/ruby19/sample/webrick/httpsd.rb head/contrib/ruby19/sample/eval.rb head/contrib/ruby19/sample/cbreak.rb head/contrib/ruby19/sample/rcs.rb head/contrib/ruby19/sample/mine.rb head/contrib/ruby19/sample/mkproto.rb head/contrib/ruby19/sample/README head/contrib/ruby19/sample/rcs.dat head/contrib/ruby19/sample/tsvr.rb head/contrib/ruby19/sample/time.rb head/contrib/ruby19/sample/philos.rb head/contrib/ruby19/sample/list3.rb head/contrib/ruby19/sample/ripper/ruby2html.rb head/contrib/ruby19/sample/ripper/strip-comment.rb head/contrib/ruby19/sample/clnt.rb head/contrib/ruby19/sample/observ.rb head/contrib/ruby19/sample/fib.rb head/contrib/ruby19/sample/dualstack-fetch.rb head/contrib/ruby19/id.h head/contrib/ruby19/iseq.c head/contrib/ruby19/newline.c head/contrib/ruby19/enum.c head/contrib/ruby19/README.ja head/contrib/ruby19/iseq.h head/contrib/ruby19/golf_prelude.c head/contrib/ruby19/goruby.c head/contrib/ruby19/sparc.c head/contrib/ruby19/common.mk head/contrib/ruby19/pack.c head/contrib/ruby19/load.c head/usr.bin/ruby/Makefile Index: head/contrib/ruby19/dir.c =================================================================== --- head/contrib/ruby19/dir.c (revision 0) +++ head/contrib/ruby19/dir.c (revision 263979) @@ -0,0 +1,2094 @@ +/********************************************************************** + + dir.c - + + $Author: usa $ + created at: Wed Jan 5 09:51:01 JST 1994 + + Copyright (C) 1993-2007 Yukihiro Matsumoto + Copyright (C) 2000 Network Applied Communication Laboratory, Inc. + Copyright (C) 2000 Information-technology Promotion Agency, Japan + +**********************************************************************/ + +#include "ruby/ruby.h" +#include "ruby/encoding.h" +#include "internal.h" + +#include +#include + +#ifdef HAVE_UNISTD_H +#include +#endif + +#if defined HAVE_DIRENT_H && !defined _WIN32 +# include +# define NAMLEN(dirent) strlen((dirent)->d_name) +#elif defined HAVE_DIRECT_H && !defined _WIN32 +# include +# define NAMLEN(dirent) strlen((dirent)->d_name) +#else +# define dirent direct +# if !defined __NeXT__ +# define NAMLEN(dirent) (dirent)->d_namlen +# else +# /* On some versions of NextStep, d_namlen is always zero, so avoid it. */ +# define NAMLEN(dirent) strlen((dirent)->d_name) +# endif +# if HAVE_SYS_NDIR_H +# include +# endif +# if HAVE_SYS_DIR_H +# include +# endif +# if HAVE_NDIR_H +# include +# endif +# ifdef _WIN32 +# include "win32/dir.h" +# endif +#endif + +#include + +#ifndef HAVE_STDLIB_H +char *getenv(); +#endif + +#ifndef HAVE_STRING_H +char *strchr(char*,char); +#endif + +#include + +#include "ruby/util.h" + +#if !defined HAVE_LSTAT && !defined lstat +#define lstat stat +#endif + +/* define system APIs */ +#ifdef _WIN32 +#undef chdir +#define chdir(p) rb_w32_uchdir(p) +#undef mkdir +#define mkdir(p, m) rb_w32_umkdir((p), (m)) +#undef rmdir +#define rmdir(p) rb_w32_urmdir(p) +#undef opendir +#define opendir(p) rb_w32_uopendir(p) +#endif + +#define rb_sys_fail_path(path) rb_sys_fail_str(path) + +#define FNM_NOESCAPE 0x01 +#define FNM_PATHNAME 0x02 +#define FNM_DOTMATCH 0x04 +#define FNM_CASEFOLD 0x08 +#if CASEFOLD_FILESYSTEM +#define FNM_SYSCASE FNM_CASEFOLD +#else +#define FNM_SYSCASE 0 +#endif + +#define FNM_NOMATCH 1 +#define FNM_ERROR 2 + +# define Next(p, e, enc) ((p)+ rb_enc_mbclen((p), (e), (enc))) +# define Inc(p, e, enc) ((p) = Next((p), (e), (enc))) + +static char * +bracket( + const char *p, /* pattern (next to '[') */ + const char *pend, + const char *s, /* string */ + const char *send, + int flags, + rb_encoding *enc) +{ + const int nocase = flags & FNM_CASEFOLD; + const int escape = !(flags & FNM_NOESCAPE); + unsigned int c1, c2; + int r; + int ok = 0, not = 0; + + if (p >= pend) return NULL; + if (*p == '!' || *p == '^') { + not = 1; + p++; + } + + while (*p != ']') { + const char *t1 = p; + if (escape && *t1 == '\\') + t1++; + if (!*t1) + return NULL; + p = t1 + (r = rb_enc_mbclen(t1, pend, enc)); + if (p >= pend) return NULL; + if (p[0] == '-' && p[1] != ']') { + const char *t2 = p + 1; + int r2; + if (escape && *t2 == '\\') + t2++; + if (!*t2) + return NULL; + p = t2 + (r2 = rb_enc_mbclen(t2, pend, enc)); + if (ok) continue; + if ((r <= (send-s) && memcmp(t1, s, r) == 0) || + (r2 <= (send-s) && memcmp(t2, s, r) == 0)) { + ok = 1; + continue; + } + c1 = rb_enc_codepoint(s, send, enc); + if (nocase) c1 = rb_enc_toupper(c1, enc); + c2 = rb_enc_codepoint(t1, pend, enc); + if (nocase) c2 = rb_enc_toupper(c2, enc); + if (c1 < c2) continue; + c2 = rb_enc_codepoint(t2, pend, enc); + if (nocase) c2 = rb_enc_toupper(c2, enc); + if (c1 > c2) continue; + } + else { + if (ok) continue; + if (r <= (send-s) && memcmp(t1, s, r) == 0) { + ok = 1; + continue; + } + if (!nocase) continue; + c1 = rb_enc_toupper(rb_enc_codepoint(s, send, enc), enc); + c2 = rb_enc_toupper(rb_enc_codepoint(p, pend, enc), enc); + if (c1 != c2) continue; + } + ok = 1; + } + + return ok == not ? NULL : (char *)p + 1; +} + +/* If FNM_PATHNAME is set, only path element will be matched. (upto '/' or '\0') + Otherwise, entire string will be matched. + End marker itself won't be compared. + And if function succeeds, *pcur reaches end marker. +*/ +#define UNESCAPE(p) (escape && *(p) == '\\' ? (p) + 1 : (p)) +#define ISEND(p) (!*(p) || (pathname && *(p) == '/')) +#define RETURN(val) return *pcur = p, *scur = s, (val); + +static int +fnmatch_helper( + const char **pcur, /* pattern */ + const char **scur, /* string */ + int flags, + rb_encoding *enc) +{ + const int period = !(flags & FNM_DOTMATCH); + const int pathname = flags & FNM_PATHNAME; + const int escape = !(flags & FNM_NOESCAPE); + const int nocase = flags & FNM_CASEFOLD; + + const char *ptmp = 0; + const char *stmp = 0; + + const char *p = *pcur; + const char *pend = p + strlen(p); + const char *s = *scur; + const char *send = s + strlen(s); + + int r; + + if (period && *s == '.' && *UNESCAPE(p) != '.') /* leading period */ + RETURN(FNM_NOMATCH); + + while (1) { + switch (*p) { + case '*': + do { p++; } while (*p == '*'); + if (ISEND(UNESCAPE(p))) { + p = UNESCAPE(p); + RETURN(0); + } + if (ISEND(s)) + RETURN(FNM_NOMATCH); + ptmp = p; + stmp = s; + continue; + + case '?': + if (ISEND(s)) + RETURN(FNM_NOMATCH); + p++; + Inc(s, send, enc); + continue; + + case '[': { + const char *t; + if (ISEND(s)) + RETURN(FNM_NOMATCH); + if ((t = bracket(p + 1, pend, s, send, flags, enc)) != 0) { + p = t; + Inc(s, send, enc); + continue; + } + goto failed; + } + } + + /* ordinary */ + p = UNESCAPE(p); + if (ISEND(s)) + RETURN(ISEND(p) ? 0 : FNM_NOMATCH); + if (ISEND(p)) + goto failed; + r = rb_enc_precise_mbclen(p, pend, enc); + if (!MBCLEN_CHARFOUND_P(r)) + goto failed; + if (r <= (send-s) && memcmp(p, s, r) == 0) { + p += r; + s += r; + continue; + } + if (!nocase) goto failed; + if (rb_enc_toupper(rb_enc_codepoint(p, pend, enc), enc) != + rb_enc_toupper(rb_enc_codepoint(s, send, enc), enc)) + goto failed; + p += r; + Inc(s, send, enc); + continue; + + failed: /* try next '*' position */ + if (ptmp && stmp) { + p = ptmp; + Inc(stmp, send, enc); /* !ISEND(*stmp) */ + s = stmp; + continue; + } + RETURN(FNM_NOMATCH); + } +} + +static int +fnmatch( + const char *pattern, + rb_encoding *enc, + const char *string, + int flags) +{ + const char *p = pattern; + const char *s = string; + const char *send = s + strlen(string); + const int period = !(flags & FNM_DOTMATCH); + const int pathname = flags & FNM_PATHNAME; + + const char *ptmp = 0; + const char *stmp = 0; + + if (pathname) { + while (1) { + if (p[0] == '*' && p[1] == '*' && p[2] == '/') { + do { p += 3; } while (p[0] == '*' && p[1] == '*' && p[2] == '/'); + ptmp = p; + stmp = s; + } + if (fnmatch_helper(&p, &s, flags, enc) == 0) { + while (*s && *s != '/') Inc(s, send, enc); + if (*p && *s) { + p++; + s++; + continue; + } + if (!*p && !*s) + return 0; + } + /* failed : try next recursion */ + if (ptmp && stmp && !(period && *stmp == '.')) { + while (*stmp && *stmp != '/') Inc(stmp, send, enc); + if (*stmp) { + p = ptmp; + stmp++; + s = stmp; + continue; + } + } + return FNM_NOMATCH; + } + } + else + return fnmatch_helper(&p, &s, flags, enc); +} + +VALUE rb_cDir; + +struct dir_data { + DIR *dir; + VALUE path; + rb_encoding *enc; +}; + +static void +dir_mark(void *ptr) +{ + struct dir_data *dir = ptr; + rb_gc_mark(dir->path); +} + +static void +dir_free(void *ptr) +{ + struct dir_data *dir = ptr; + if (dir) { + if (dir->dir) closedir(dir->dir); + } + xfree(dir); +} + +static size_t +dir_memsize(const void *ptr) +{ + return ptr ? sizeof(struct dir_data) : 0; +} + +static const rb_data_type_t dir_data_type = { + "dir", + {dir_mark, dir_free, dir_memsize,}, +}; + +static VALUE dir_close(VALUE); + +#define GlobPathValue(str, safe) \ + /* can contain null bytes as separators */ \ + (!RB_TYPE_P((str), T_STRING) ? \ + (void)FilePathValue(str) : \ + (void)(check_safe_glob((str), (safe)), \ + check_glob_encoding(str), (str))) +#define check_safe_glob(str, safe) ((safe) ? rb_check_safe_obj(str) : (void)0) +#define check_glob_encoding(str) rb_enc_check((str), rb_enc_from_encoding(rb_usascii_encoding())) + +static VALUE +dir_s_alloc(VALUE klass) +{ + struct dir_data *dirp; + VALUE obj = TypedData_Make_Struct(klass, struct dir_data, &dir_data_type, dirp); + + dirp->dir = NULL; + dirp->path = Qnil; + dirp->enc = NULL; + + return obj; +} + +/* + * call-seq: + * Dir.new( string ) -> aDir + * + * Returns a new directory object for the named directory. + */ +static VALUE +dir_initialize(int argc, VALUE *argv, VALUE dir) +{ + struct dir_data *dp; + rb_encoding *fsenc; + VALUE dirname, opt, orig; + static VALUE sym_enc; + + if (!sym_enc) { + sym_enc = ID2SYM(rb_intern("encoding")); + } + fsenc = rb_filesystem_encoding(); + + argc = rb_scan_args(argc, argv, "1:", &dirname, &opt); + + if (!NIL_P(opt)) { + VALUE enc = rb_hash_aref(opt, sym_enc); + if (!NIL_P(enc)) { + fsenc = rb_to_encoding(enc); + } + } + + GlobPathValue(dirname, FALSE); + orig = rb_str_dup_frozen(dirname); + dirname = rb_str_encode_ospath(dirname); + dirname = rb_str_dup_frozen(dirname); + + TypedData_Get_Struct(dir, struct dir_data, &dir_data_type, dp); + if (dp->dir) closedir(dp->dir); + dp->dir = NULL; + dp->path = Qnil; + dp->enc = fsenc; + dp->dir = opendir(RSTRING_PTR(dirname)); + if (dp->dir == NULL) { + if (errno == EMFILE || errno == ENFILE) { + rb_gc(); + dp->dir = opendir(RSTRING_PTR(dirname)); + } + if (dp->dir == NULL) { + rb_sys_fail_path(orig); + } + } + dp->path = orig; + + return dir; +} + +/* + * call-seq: + * Dir.open( string ) -> aDir + * Dir.open( string ) {| aDir | block } -> anObject + * + * With no block, open is a synonym for + * Dir::new. If a block is present, it is passed + * aDir as a parameter. The directory is closed at the end of + * the block, and Dir::open returns the value of the + * block. + */ +static VALUE +dir_s_open(int argc, VALUE *argv, VALUE klass) +{ + struct dir_data *dp; + VALUE dir = TypedData_Make_Struct(klass, struct dir_data, &dir_data_type, dp); + + dir_initialize(argc, argv, dir); + if (rb_block_given_p()) { + return rb_ensure(rb_yield, dir, dir_close, dir); + } + + return dir; +} + +static void +dir_closed(void) +{ + rb_raise(rb_eIOError, "closed directory"); +} + +static struct dir_data * +dir_check(VALUE dir) +{ + struct dir_data *dirp; + if (!OBJ_UNTRUSTED(dir) && rb_safe_level() >= 4) + rb_raise(rb_eSecurityError, "Insecure: operation on trusted Dir"); + rb_check_frozen(dir); + dirp = rb_check_typeddata(dir, &dir_data_type); + if (!dirp->dir) dir_closed(); + return dirp; +} + +#define GetDIR(obj, dirp) ((dirp) = dir_check(obj)) + + +/* + * call-seq: + * dir.inspect -> string + * + * Return a string describing this Dir object. + */ +static VALUE +dir_inspect(VALUE dir) +{ + struct dir_data *dirp; + + TypedData_Get_Struct(dir, struct dir_data, &dir_data_type, dirp); + if (!NIL_P(dirp->path)) { + VALUE str = rb_str_new_cstr("#<"); + rb_str_append(str, rb_class_name(CLASS_OF(dir))); + rb_str_cat2(str, ":"); + rb_str_append(str, dirp->path); + rb_str_cat2(str, ">"); + return str; + } + return rb_funcall(dir, rb_intern("to_s"), 0, 0); +} + +/* + * call-seq: + * dir.path -> string or nil + * + * Returns the path parameter passed to dir's constructor. + * + * d = Dir.new("..") + * d.path #=> ".." + */ +static VALUE +dir_path(VALUE dir) +{ + struct dir_data *dirp; + + TypedData_Get_Struct(dir, struct dir_data, &dir_data_type, dirp); + if (NIL_P(dirp->path)) return Qnil; + return rb_str_dup(dirp->path); +} + +#if defined HAVE_READDIR_R +# define READDIR(dir, enc, entry, dp) (readdir_r((dir), (entry), &(dp)) == 0 && (dp) != 0) +#elif defined _WIN32 +# define READDIR(dir, enc, entry, dp) (((dp) = rb_w32_readdir_with_enc((dir), (enc))) != 0) +#else +# define READDIR(dir, enc, entry, dp) (((dp) = readdir(dir)) != 0) +#endif +#if defined HAVE_READDIR_R +# define IF_HAVE_READDIR_R(something) something +#else +# define IF_HAVE_READDIR_R(something) /* nothing */ +#endif + +#if defined SIZEOF_STRUCT_DIRENT_TOO_SMALL +# include +# define NAME_MAX_FOR_STRUCT_DIRENT 255 +# if defined NAME_MAX +# if NAME_MAX_FOR_STRUCT_DIRENT < NAME_MAX +# undef NAME_MAX_FOR_STRUCT_DIRENT +# define NAME_MAX_FOR_STRUCT_DIRENT NAME_MAX +# endif +# endif +# if defined _POSIX_NAME_MAX +# if NAME_MAX_FOR_STRUCT_DIRENT < _POSIX_NAME_MAX +# undef NAME_MAX_FOR_STRUCT_DIRENT +# define NAME_MAX_FOR_STRUCT_DIRENT _POSIX_NAME_MAX +# endif +# endif +# if defined _XOPEN_NAME_MAX +# if NAME_MAX_FOR_STRUCT_DIRENT < _XOPEN_NAME_MAX +# undef NAME_MAX_FOR_STRUCT_DIRENT +# define NAME_MAX_FOR_STRUCT_DIRENT _XOPEN_NAME_MAX +# endif +# endif +# define DEFINE_STRUCT_DIRENT \ + union { \ + struct dirent dirent; \ + char dummy[offsetof(struct dirent, d_name) + \ + NAME_MAX_FOR_STRUCT_DIRENT + 1]; \ + } +# define STRUCT_DIRENT(entry) ((entry).dirent) +#else +# define DEFINE_STRUCT_DIRENT struct dirent +# define STRUCT_DIRENT(entry) (entry) +#endif + +/* + * call-seq: + * dir.read -> string or nil + * + * Reads the next entry from dir and returns it as a string. + * Returns nil at the end of the stream. + * + * d = Dir.new("testdir") + * d.read #=> "." + * d.read #=> ".." + * d.read #=> "config.h" + */ +static VALUE +dir_read(VALUE dir) +{ + struct dir_data *dirp; + struct dirent *dp; + IF_HAVE_READDIR_R(DEFINE_STRUCT_DIRENT entry); + + GetDIR(dir, dirp); + errno = 0; + if (READDIR(dirp->dir, dirp->enc, &STRUCT_DIRENT(entry), dp)) { + return rb_external_str_new_with_enc(dp->d_name, NAMLEN(dp), dirp->enc); + } + else if (errno == 0) { /* end of stream */ + return Qnil; + } + else { + rb_sys_fail(0); + } + return Qnil; /* not reached */ +} + +/* + * call-seq: + * dir.each { |filename| block } -> dir + * dir.each -> an_enumerator + * + * Calls the block once for each entry in this directory, passing the + * filename of each entry as a parameter to the block. + * + * If no block is given, an enumerator is returned instead. + * + * d = Dir.new("testdir") + * d.each {|x| puts "Got #{x}" } + * + * produces: + * + * Got . + * Got .. + * Got config.h + * Got main.rb + */ +static VALUE +dir_each(VALUE dir) +{ + struct dir_data *dirp; + struct dirent *dp; + IF_HAVE_READDIR_R(DEFINE_STRUCT_DIRENT entry); + + RETURN_ENUMERATOR(dir, 0, 0); + GetDIR(dir, dirp); + rewinddir(dirp->dir); + while (READDIR(dirp->dir, dirp->enc, &STRUCT_DIRENT(entry), dp)) { + rb_yield(rb_external_str_new_with_enc(dp->d_name, NAMLEN(dp), dirp->enc)); + if (dirp->dir == NULL) dir_closed(); + } + return dir; +} + +#ifdef HAVE_TELLDIR +/* + * call-seq: + * dir.pos -> integer + * dir.tell -> integer + * + * Returns the current position in dir. See also + * Dir#seek. + * + * d = Dir.new("testdir") + * d.tell #=> 0 + * d.read #=> "." + * d.tell #=> 12 + */ +static VALUE +dir_tell(VALUE dir) +{ + struct dir_data *dirp; + long pos; + + GetDIR(dir, dirp); + pos = telldir(dirp->dir); + return rb_int2inum(pos); +} +#else +#define dir_tell rb_f_notimplement +#endif + +#ifdef HAVE_SEEKDIR +/* + * call-seq: + * dir.seek( integer ) -> dir + * + * Seeks to a particular location in dir. integer + * must be a value returned by Dir#tell. + * + * d = Dir.new("testdir") #=> # + * d.read #=> "." + * i = d.tell #=> 12 + * d.read #=> ".." + * d.seek(i) #=> # + * d.read #=> ".." + */ +static VALUE +dir_seek(VALUE dir, VALUE pos) +{ + struct dir_data *dirp; + long p = NUM2LONG(pos); + + GetDIR(dir, dirp); + seekdir(dirp->dir, p); + return dir; +} +#else +#define dir_seek rb_f_notimplement +#endif + +/* + * call-seq: + * dir.pos( integer ) -> integer + * + * Synonym for Dir#seek, but returns the position + * parameter. + * + * d = Dir.new("testdir") #=> # + * d.read #=> "." + * i = d.pos #=> 12 + * d.read #=> ".." + * d.pos = i #=> 12 + * d.read #=> ".." + */ +static VALUE +dir_set_pos(VALUE dir, VALUE pos) +{ + dir_seek(dir, pos); + return pos; +} + +/* + * call-seq: + * dir.rewind -> dir + * + * Repositions dir to the first entry. + * + * d = Dir.new("testdir") + * d.read #=> "." + * d.rewind #=> # + * d.read #=> "." + */ +static VALUE +dir_rewind(VALUE dir) +{ + struct dir_data *dirp; + + if (rb_safe_level() >= 4 && !OBJ_UNTRUSTED(dir)) { + rb_raise(rb_eSecurityError, "Insecure: can't close"); + } + GetDIR(dir, dirp); + rewinddir(dirp->dir); + return dir; +} + +/* + * call-seq: + * dir.close -> nil + * + * Closes the directory stream. Any further attempts to access + * dir will raise an IOError. + * + * d = Dir.new("testdir") + * d.close #=> nil + */ +static VALUE +dir_close(VALUE dir) +{ + struct dir_data *dirp; + + GetDIR(dir, dirp); + closedir(dirp->dir); + dirp->dir = NULL; + + return Qnil; +} + +static void +dir_chdir(VALUE path) +{ + if (chdir(RSTRING_PTR(path)) < 0) + rb_sys_fail_path(path); +} + +static int chdir_blocking = 0; +static VALUE chdir_thread = Qnil; + +struct chdir_data { + VALUE old_path, new_path; + int done; +}; + +static VALUE +chdir_yield(struct chdir_data *args) +{ + dir_chdir(args->new_path); + args->done = TRUE; + chdir_blocking++; + if (chdir_thread == Qnil) + chdir_thread = rb_thread_current(); + return rb_yield(args->new_path); +} + +static VALUE +chdir_restore(struct chdir_data *args) +{ + if (args->done) { + chdir_blocking--; + if (chdir_blocking == 0) + chdir_thread = Qnil; + dir_chdir(args->old_path); + } + return Qnil; +} + +/* + * call-seq: + * Dir.chdir( [ string] ) -> 0 + * Dir.chdir( [ string] ) {| path | block } -> anObject + * + * Changes the current working directory of the process to the given + * string. When called without an argument, changes the directory to + * the value of the environment variable HOME, or + * LOGDIR. SystemCallError (probably + * Errno::ENOENT) if the target directory does not exist. + * + * If a block is given, it is passed the name of the new current + * directory, and the block is executed with that as the current + * directory. The original working directory is restored when the block + * exits. The return value of chdir is the value of the + * block. chdir blocks can be nested, but in a + * multi-threaded program an error will be raised if a thread attempts + * to open a chdir block while another thread has one + * open. + * + * Dir.chdir("/var/spool/mail") + * puts Dir.pwd + * Dir.chdir("/tmp") do + * puts Dir.pwd + * Dir.chdir("/usr") do + * puts Dir.pwd + * end + * puts Dir.pwd + * end + * puts Dir.pwd + * + * produces: + * + * /var/spool/mail + * /tmp + * /usr + * /tmp + * /var/spool/mail + */ +static VALUE +dir_s_chdir(int argc, VALUE *argv, VALUE obj) +{ + VALUE path = Qnil; + + rb_secure(2); + if (rb_scan_args(argc, argv, "01", &path) == 1) { + FilePathValue(path); + path = rb_str_encode_ospath(path); + } + else { + const char *dist = getenv("HOME"); + if (!dist) { + dist = getenv("LOGDIR"); + if (!dist) rb_raise(rb_eArgError, "HOME/LOGDIR not set"); + } + path = rb_str_new2(dist); + } + + if (chdir_blocking > 0) { + if (!rb_block_given_p() || rb_thread_current() != chdir_thread) + rb_warn("conflicting chdir during another chdir block"); + } + + if (rb_block_given_p()) { + struct chdir_data args; + + args.old_path = rb_str_encode_ospath(rb_dir_getwd()); + args.new_path = path; + args.done = FALSE; + return rb_ensure(chdir_yield, (VALUE)&args, chdir_restore, (VALUE)&args); + } + dir_chdir(path); + + return INT2FIX(0); +} + +VALUE +rb_dir_getwd(void) +{ + char *path; + VALUE cwd; + + rb_secure(4); + path = my_getcwd(); + cwd = rb_tainted_str_new2(path); + rb_enc_associate(cwd, rb_filesystem_encoding()); + + xfree(path); + return cwd; +} + +/* + * call-seq: + * Dir.getwd -> string + * Dir.pwd -> string + * + * Returns the path to the current working directory of this process as + * a string. + * + * Dir.chdir("/tmp") #=> 0 + * Dir.getwd #=> "/tmp" + */ +static VALUE +dir_s_getwd(VALUE dir) +{ + return rb_dir_getwd(); +} + +static void +check_dirname(volatile VALUE *dir) +{ + VALUE d = *dir; + char *path, *pend; + long len; + rb_encoding *enc; + + rb_secure(2); + FilePathValue(d); + enc = rb_enc_get(d); + RSTRING_GETMEM(d, path, len); + pend = path + len; + pend = rb_enc_path_end(rb_enc_path_skip_prefix(path, pend, enc), pend, enc); + if (pend - path < len) { + d = rb_str_subseq(d, 0, pend - path); + } + *dir = rb_str_encode_ospath(d); +} + +#if defined(HAVE_CHROOT) +/* + * call-seq: + * Dir.chroot( string ) -> 0 + * + * Changes this process's idea of the file system root. Only a + * privileged process may make this call. Not available on all + * platforms. On Unix systems, see chroot(2) for more + * information. + */ +static VALUE +dir_s_chroot(VALUE dir, VALUE path) +{ + check_dirname(&path); + if (chroot(RSTRING_PTR(path)) == -1) + rb_sys_fail_path(path); + + return INT2FIX(0); +} +#else +#define dir_s_chroot rb_f_notimplement +#endif + +/* + * call-seq: + * Dir.mkdir( string [, integer] ) -> 0 + * + * Makes a new directory named by string, with permissions + * specified by the optional parameter anInteger. The + * permissions may be modified by the value of + * File::umask, and are ignored on NT. Raises a + * SystemCallError if the directory cannot be created. See + * also the discussion of permissions in the class documentation for + * File. + * + * Dir.mkdir(File.join(Dir.home, ".foo"), 0700) #=> 0 + * + */ +static VALUE +dir_s_mkdir(int argc, VALUE *argv, VALUE obj) +{ + VALUE path, vmode; + int mode; + + if (rb_scan_args(argc, argv, "11", &path, &vmode) == 2) { + mode = NUM2INT(vmode); + } + else { + mode = 0777; + } + + check_dirname(&path); + if (mkdir(RSTRING_PTR(path), mode) == -1) + rb_sys_fail_path(path); + + return INT2FIX(0); +} + +/* + * call-seq: + * Dir.delete( string ) -> 0 + * Dir.rmdir( string ) -> 0 + * Dir.unlink( string ) -> 0 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 00:14:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90A4E897; Tue, 1 Apr 2014 00:14:14 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6EDAB8C5; Tue, 1 Apr 2014 00:14:14 +0000 (UTC) Received: from zeta.ixsystems.com (unknown [69.198.165.132]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 53FA22087C; Mon, 31 Mar 2014 17:14:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1396311252; bh=cJEyYVZHT72SgYiEdJcXuhswkyTijQk9r4Vhc/u0VYc=; h=Date:From:Reply-To:To:Subject:References:In-Reply-To; b=sx+iQCsr7XDg9YsEh0lrkOR/5MBGrUxdXgPWP6aC92rN+v4noXn3RaTNbDiig6CuD ZIb4M/58L8jWfgQoOx3iYc5YfFhlmwnzzquusKO1jMYXCoRALxX74Fz1Y1x2sHag6a qzZlok1sE7k2O/gnB4Z6zhDfs+4Rhfru8cR9ogIA= Message-ID: <533A04D2.5050201@delphij.net> Date: Mon, 31 Mar 2014 17:14:10 -0700 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: Glen Barber , src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r263979 - in head: . contrib usr.bin References: <20140401000130.GC21299@glenbarber.us> In-Reply-To: <20140401000130.GC21299@glenbarber.us> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 00:14:14 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 03/31/14 17:01, Glen Barber wrote: > Author: gjb Date: Tue Apr 1 00:01:56 2014 New Revision: 263979 URL: > http://svnweb.freebsd.org/changeset/base/263979 > > Log: Import ruby19. Yay! Now we can import OpenJDK too ;-) Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCgAGBQJTOgTSAAoJEJW2GBstM+nsF7YQAKLY4xRdPJY+bLimrabG0qxD JGtkjIm/NMUapPiLF2JqbAm4Kg+7h+a40w96PydBPsTCpgoK0lT/KGf6pOPb9sLm yrd3TDKB5hxGUyaewbKcEGv8tj+f9FgslGxvfyGvMV5xTRs6I4eLYYd6ggKM07Sr gozO4cvffq0OX+6M6RJlzBUSp6PiD8laKhFGyZff0zgXUd039CKJle3g5Q2Q0gcj LY16bVOgm6QJV4jwBaBaW2eaZDJK6XpynKW89fiSZ+d1DqQ6OoGmCHbCD6zXvPem UlGuBTkL4CufmPkZry9QKhLmyRtgrzm+GZ8/Y3ho0HkIr8/DCq06s+rhxFleOCtz AO4wnZSjEpPbYHtZDFySDH6j57Ru8jrVYKSVJyUfIJ9QU2uM5lQyt3anCTHek7BM PU+MKu7Cdk595SPj5L33Y5draBj9U/c74iJZm6qgi6IsSJxsr+C2RlORO7cH1/vZ swXZxDJR+pOOZUCRYo+dMWTYAwyQlmMHGsh8WbdRjPc62OfBOSQtc7suI9VIIr0Y 3xHXf7OApmK55sPkKMkgiNT4+aO5UyF9MQoUlJt8qCN8LHXvE54i0btJuwRmS/9/ DJVPdeZKbcfqdKv9tdB3gn3Z3ea+H2Zza5DyWgClcjrebUtuB+VVg4Y25NiAB9O8 8E6JnPHRuNqS6I9Dgn81 =XZ7D -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 00:56:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C81AF185; Tue, 1 Apr 2014 00:56:32 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask.apl.washington.edu", Issuer "troutmask.apl.washington.edu" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BC1BBC5; Tue, 1 Apr 2014 00:56:32 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.8/8.14.8) with ESMTP id s310uERT039923 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 31 Mar 2014 17:56:14 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.8/8.14.8/Submit) id s310uAcC039922; Mon, 31 Mar 2014 17:56:10 -0700 (PDT) (envelope-from sgk) Date: Mon, 31 Mar 2014 17:56:10 -0700 From: Steve Kargl To: Glen Barber Subject: Re: svn commit: r263979 - in head: . contrib usr.bin Message-ID: <20140401005610.GA39897@troutmask.apl.washington.edu> References: <20140401000130.GC21299@glenbarber.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140401000130.GC21299@glenbarber.us> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 00:56:32 -0000 On Mon, Mar 31, 2014 at 08:01:30PM -0400, Glen Barber wrote: > Author: gjb > Date: Tue Apr 1 00:01:56 2014 > New Revision: 263979 > URL: http://svnweb.freebsd.org/changeset/base/263979 > > Log: > Import ruby19. > head/contrib/ruby19/enc/utf_8.c Shouldn't this have been head/contrib/ruby? None of the other contrib directories encode the version number. -- steve From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 00:58:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 898F12E7; Tue, 1 Apr 2014 00:58:47 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.glenbarber.us", Issuer "RapidSSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5853CBD2; Tue, 1 Apr 2014 00:58:47 +0000 (UTC) Received: from glenbarber.us (70.15.88.86.res-cmts.sewb.ptd.net [70.15.88.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id AE61D537B; Tue, 1 Apr 2014 00:58:45 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us AE61D537B Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Mon, 31 Mar 2014 20:58:42 -0400 From: Glen Barber To: Steve Kargl Subject: Re: svn commit: r263979 - in head: . contrib usr.bin Message-ID: <20140401005842.GE21299@glenbarber.us> References: <20140401000130.GC21299@glenbarber.us> <20140401005610.GA39897@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DiL7RhKs8rK9YGuF" Content-Disposition: inline In-Reply-To: <20140401005610.GA39897@troutmask.apl.washington.edu> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 00:58:47 -0000 --DiL7RhKs8rK9YGuF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 31, 2014 at 05:56:10PM -0700, Steve Kargl wrote: > On Mon, Mar 31, 2014 at 08:01:30PM -0400, Glen Barber wrote: > > Author: gjb > > Date: Tue Apr 1 00:01:56 2014 > > New Revision: 263979 > > URL: http://svnweb.freebsd.org/changeset/base/263979 > >=20 > > Log: > > Import ruby19. > > head/contrib/ruby19/enc/utf_8.c >=20 > Shouldn't this have been head/contrib/ruby? None of the > other contrib directories encode the version number. >=20 I'm not sure this is an official policy, since the binary installs as /usr/bin/ruby. Glen --DiL7RhKs8rK9YGuF Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTOg9CAAoJELls3eqvi17QBioP/1alEduGav+vQSeyyxyd2eLV AaGd/N9yX+dijB6xyElEGtRFrQ/LsqGuUPhVs3F6UyVNd1kwL6EtwgPMeWQ+LG8j lTAdTiEAHBytZPp6tKuQHveLwDUjN7DhCfA24pnsH/PHPVjO1G9+R51ac3acO09S PPWMk32VA11zRDmktwfQQ38uP2eqpB/j+rTidgc2Bkou0wWxmkwWU17VDvi8RT/b hQYpoq61YuVGoRKkzwS9hO54phdxaEX2jOUuh/zVUzv6r1bnEX1y55LV7eMRzGK/ KQQmEHaA2DU82Z88nUKQT7sGf5nS3SfDPkvqXE23s4xO1p6HVlVX6W6NB1W+cPb7 W9fg8QGv8wso55PKhF9LNZwxSZFxQ9viko0E4z9G67yD553qLaOcudLADFEUcCmB FAGRm8UjenYOy/VDer13ja+L1sTZQrPx9z+Kb8Vj0fDFxskmWcPK38KcI7nyDicN WswP6VPBl6PYZKR7JD/nRv4sOFRHFlbaGCsBO06x2K4vKN1ojIYJmXr1c8iIrTKK GiPpy3d1ZVkS6v+fkTKuT5ugKDO3krpRW2Jek0TsA2130zrgOhcvd+M1HowWF1sQ lKeGCGh2aFKIqoiIzdE8BC/PX/UXSEMnuq/DB7k+fBPF+pJQ5CzR3+NDA9lk+s4V rqVxIQpLQbI/UmalHWVn =lrbH -----END PGP SIGNATURE----- --DiL7RhKs8rK9YGuF-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 01:25:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F4E4890; Tue, 1 Apr 2014 01:25:01 +0000 (UTC) Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [IPv6:2a00:1450:400c:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5DDADF1; Tue, 1 Apr 2014 01:25:00 +0000 (UTC) Received: by mail-wg0-f46.google.com with SMTP id b13so6756817wgh.5 for ; Mon, 31 Mar 2014 18:24:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=273sFTQPG3Br0mYOarLgJnkOpoxHBJrAnQl/iRpWwak=; b=FpesCDy73Suslqf9DLBF3LaDGDHuwXW3mL7kJaQuTgxoE9zrnSrhiLcfHVqDU49B7t 3GXCg+pLBZiubc4ffOxPDPzUHehmFL8D05wRs9vrKkQiyj0pp/N6RVRyyza9CbZZQIir piXmy2A2L5fbCmeWxFId628R9nvzwFY/GbVIxXDPHxY9gRb3qfrqZZLchlbR8YSDA+QE IScF2135oId4IqAIAW76fKxC6GJfisHc8ovETtFTInxhj7IZyHyHldFMoJaj7W2Z5nL2 F81UZo0ckIQEtEXsC/968PWXu7u1K8I1cDGM5BFbqoJPVX9LnYjtfsLeaTTOP/Jg+Rn4 8Elg== X-Received: by 10.194.190.42 with SMTP id gn10mr18702034wjc.9.1396315499303; Mon, 31 Mar 2014 18:24:59 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id ff9sm29888641wib.11.2014.03.31.18.24.57 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 31 Mar 2014 18:24:58 -0700 (PDT) Sender: Mateusz Guzik Date: Tue, 1 Apr 2014 03:24:55 +0200 From: Mateusz Guzik To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263981 - in head: lib/libc/gen sys/kern sys/sys Message-ID: <20140401012455.GA26117@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 01:25:01 -0000 Author: mjg Date: Tue Apr 1 03:20:35 2014 New Revision: 263981 URL: http://svnweb.freebsd.org/changeset/base/263981 Log: Add a new errno: EMACS - Editor too big. Make a best-effort to detect that Emacs is about to executed and return the error. MFC after: 1 week Modified: head/lib/libc/gen/errlst.c head/sys/kern/kern_exec.c head/sys/sys/errno.h Modified: lib/libc/gen/errlst.c =================================================================== --- head/lib/libc/gen/errlst.c (263980) +++ head/lib/libc/gen/errlst.c (263981) @@ -155,6 +155,7 @@ "Not permitted in capability mode", /* 94 - ECAPMODE */ "State not recoverable", /* 95 - ENOTRECOVERABLE */ "Previous owner died", /* 96 - EOWNERDEAD */ + "Editor too big", /* 97 - EMACS */ }; const int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]); Modified: sys/kern/kern_exec.c =================================================================== --- head/sys/kern/kern_exec.c (263980) +++ head/sys/kern/kern_exec.c (263981) @@ -337,6 +337,7 @@ int (*img_first)(struct image_params *); struct pargs *oldargs = NULL, *newargs = NULL; struct sigacts *oldsigacts, *newsigacts; + char *e; #ifdef KTRACE struct vnode *tracevp = NULL; struct ucred *tracecred = NULL; @@ -418,6 +419,19 @@ SDT_PROBE(proc, kernel, , exec, args->fname, 0, 0, 0, 0 ); + /* + * A best-effort to check whether the file to be run is EMACS + */ + if (args->fname != NULL) { + e = args->fname + strlen(args->fname); + while (e > args->fname && *e != '/') + e--; + if (strcasecmp(e, "/emacs") == 0) { + error = EMACS; + goto exec_fail; + } + } + interpret: if (args->fname != NULL) { #ifdef CAPABILITY_MODE Modified: sys/sys/errno.h =================================================================== --- head/sys/sys/errno.h (263980) +++ head/sys/sys/errno.h (263981) @@ -178,10 +178,11 @@ #define ECAPMODE 94 /* Not permitted in capability mode */ #define ENOTRECOVERABLE 95 /* State not recoverable */ #define EOWNERDEAD 96 /* Previous owner died */ +#define EMACS 97 /* Editor too big */ #endif /* _POSIX_SOURCE */ #ifndef _POSIX_SOURCE -#define ELAST 96 /* Must be equal largest errno */ +#define ELAST 97 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ #ifdef _KERNEL From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 01:26:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id B83219CE; Tue, 1 Apr 2014 01:26:57 +0000 (UTC) Date: Tue, 1 Apr 2014 01:26:57 +0000 From: Alexey Dokuchaev To: d@delphij.net Subject: Re: svn commit: r263979 - in head: . contrib usr.bin Message-ID: <20140401012657.GA52890@FreeBSD.org> References: <20140401000130.GC21299@glenbarber.us> <533A04D2.5050201@delphij.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <533A04D2.5050201@delphij.net> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 01:26:57 -0000 On Mon, Mar 31, 2014 at 05:14:10PM -0700, Xin Li wrote: > On 03/31/14 17:01, Glen Barber wrote: > > New Revision: 263979 > > URL: http://svnweb.freebsd.org/changeset/base/263979 > > > > Log: Import ruby19. > > Yay! Now we can import OpenJDK too ;-) I won't be exactly surprized when^Wif we do it one day. ./danfe From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 01:31:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D26DFC24; Tue, 1 Apr 2014 01:31:15 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask.apl.washington.edu", Issuer "troutmask.apl.washington.edu" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AEEFEE8D; Tue, 1 Apr 2014 01:31:15 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.8/8.14.8) with ESMTP id s311VFka040122 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 31 Mar 2014 18:31:15 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.8/8.14.8/Submit) id s311VFZK040121; Mon, 31 Mar 2014 18:31:15 -0700 (PDT) (envelope-from sgk) Date: Mon, 31 Mar 2014 18:31:15 -0700 From: Steve Kargl To: Glen Barber Subject: Re: svn commit: r263979 - in head: . contrib usr.bin Message-ID: <20140401013115.GA40073@troutmask.apl.washington.edu> References: <20140401000130.GC21299@glenbarber.us> <20140401005610.GA39897@troutmask.apl.washington.edu> <20140401005842.GE21299@glenbarber.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140401005842.GE21299@glenbarber.us> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 01:31:15 -0000 On Mon, Mar 31, 2014 at 08:58:42PM -0400, Glen Barber wrote: > On Mon, Mar 31, 2014 at 05:56:10PM -0700, Steve Kargl wrote: > > On Mon, Mar 31, 2014 at 08:01:30PM -0400, Glen Barber wrote: > > > Author: gjb > > > Date: Tue Apr 1 00:01:56 2014 > > > New Revision: 263979 > > > URL: http://svnweb.freebsd.org/changeset/base/263979 > > > > > > Log: > > > Import ruby19. > > > head/contrib/ruby19/enc/utf_8.c > > > > Shouldn't this have been head/contrib/ruby? None of the > > other contrib directories encode the version number. > > > > I'm not sure this is an official policy, since the binary installs as > /usr/bin/ruby. > I did a quick search, but didn't find anything either. But, down the road when someone upgrades to ruby 2.0, we now have head/contrib/ruby20 or a "svn mv ruby19" to head/contrib/ruby. -- Steve From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 01:33:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CFDCDF7; Tue, 1 Apr 2014 01:33:16 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.glenbarber.us", Issuer "RapidSSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B386E9F; Tue, 1 Apr 2014 01:33:15 +0000 (UTC) Received: from glenbarber.us (70.15.88.86.res-cmts.sewb.ptd.net [70.15.88.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id CF3775722; Tue, 1 Apr 2014 01:33:13 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us CF3775722 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Mon, 31 Mar 2014 21:33:11 -0400 From: Glen Barber To: Steve Kargl Subject: Re: svn commit: r263979 - in head: . contrib usr.bin Message-ID: <20140401013311.GF21299@glenbarber.us> References: <20140401000130.GC21299@glenbarber.us> <20140401005610.GA39897@troutmask.apl.washington.edu> <20140401005842.GE21299@glenbarber.us> <20140401013115.GA40073@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="SNIs70sCzqvszXB4" Content-Disposition: inline In-Reply-To: <20140401013115.GA40073@troutmask.apl.washington.edu> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 01:33:16 -0000 --SNIs70sCzqvszXB4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 31, 2014 at 06:31:15PM -0700, Steve Kargl wrote: > On Mon, Mar 31, 2014 at 08:58:42PM -0400, Glen Barber wrote: > > On Mon, Mar 31, 2014 at 05:56:10PM -0700, Steve Kargl wrote: > > > On Mon, Mar 31, 2014 at 08:01:30PM -0400, Glen Barber wrote: > > > > Author: gjb > > > > Date: Tue Apr 1 00:01:56 2014 > > > > New Revision: 263979 > > > > URL: http://svnweb.freebsd.org/changeset/base/263979 > > > >=20 > > > > Log: > > > > Import ruby19. > > > > head/contrib/ruby19/enc/utf_8.c > > >=20 > > > Shouldn't this have been head/contrib/ruby? None of the > > > other contrib directories encode the version number. > > >=20 > >=20 > > I'm not sure this is an official policy, since the binary installs as > > /usr/bin/ruby. > >=20 >=20 > I did a quick search, but didn't find anything either. But, > down the road when someone upgrades to ruby 2.0, we now have > head/contrib/ruby20 or a "svn mv ruby19" to head/contrib/ruby. >=20 Fair enough. Although the binary could be renamed easily in the Makefile. Either way, would you mind submitting a diff against the current revision to do the rename, if I cannot get to it sooner? Glen --SNIs70sCzqvszXB4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTOhdXAAoJELls3eqvi17QO4QQALObEubDJiOUCM6q1AccEuQz ZgqGqPqYF/NBxdRAnUzXj+DH307dRILQQ8aMSrVZVZBC3n0pDRUKDaKC2J1LmsOM 1HU5pVLQIHq1wAZfhE+ReNRC9oy3c0xTxNPc4oTrMVVoMaWKXoQRUx2Y0rbuxb+a D3XvE08kFv26xCZ/LRTKTiIEvBD1ieFtL1fLMgA0lPzeGRI0p0Ht8AdxDA1DmF4R of/85ThNugnX4NFxrcby5w48suUdfqTXJlCTw5W9TfHB6BPImW/G464IlRiHsUME m/VV6YmoomlYseFcqzpAHYS4F/b1DWfHslzY/DAT8bah1MU+UiZnWG7oPuk0qNyC Q9TnMzmAPmtWkFGreUhop7DYt7iXTGQ4oNgrKkiH7P/R12LwIp9O/91uZmqg+5hm CkjzQUTcgafUeQDN9HsIiyvLX9amkrVQEl1qgwC4WKB8IfRZYoWSoonkWByeW4Ov nudFsu6FCK2B+kRxKxpUm6LF23dFVXiy6v0hiSWEEWbBNFzwv9fd4CHTNXfUVEWv Jx24IfV27ojB63a4JWIBAcxRB3vikPeLZd7dykzQpU3CIZglotz//IXVnCaqutZU DvQZSxRBNXgt/65oMB1BrR5Vwu4qVPp2Aae2rK2Ak28euiRjat1khWya/6fmCw9g 6e4tc05yry47CGVEKav7 =YaGp -----END PGP SIGNATURE----- --SNIs70sCzqvszXB4-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 04:40:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 720D987C; Tue, 1 Apr 2014 04:40:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F46C192; Tue, 1 Apr 2014 04:40:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s314e9BN073355; Tue, 1 Apr 2014 04:40:09 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s314e9Da073354; Tue, 1 Apr 2014 04:40:09 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201404010440.s314e9Da073354@svn.freebsd.org> From: Ruslan Bukin Date: Tue, 1 Apr 2014 04:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263981 - head/sys/arm/samsung/exynos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 04:40:09 -0000 Author: br Date: Tue Apr 1 04:40:08 2014 New Revision: 263981 URL: http://svnweb.freebsd.org/changeset/base/263981 Log: Release i2c bus on detach. Modified: head/sys/arm/samsung/exynos/chrome_ec.c Modified: head/sys/arm/samsung/exynos/chrome_ec.c ============================================================================== --- head/sys/arm/samsung/exynos/chrome_ec.c Tue Apr 1 00:19:13 2014 (r263980) +++ head/sys/arm/samsung/exynos/chrome_ec.c Tue Apr 1 04:40:08 2014 (r263981) @@ -234,9 +234,22 @@ ec_attach(device_t dev) return (0); } +static int +ec_detach(device_t dev) +{ + struct ec_softc *sc; + + sc = device_get_softc(dev); + + bus_release(sc); + + return (0); +} + static device_method_t ec_methods[] = { DEVMETHOD(device_probe, ec_probe), DEVMETHOD(device_attach, ec_attach), + DEVMETHOD(device_detach, ec_detach), { 0, 0 } }; From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 04:56:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A3A0ADE; Tue, 1 Apr 2014 04:56:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F04BF2DB; Tue, 1 Apr 2014 04:56:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s314ueml080579; Tue, 1 Apr 2014 04:56:40 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s314ueam080576; Tue, 1 Apr 2014 04:56:40 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201404010456.s314ueam080576@svn.freebsd.org> From: Ruslan Bukin Date: Tue, 1 Apr 2014 04:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263982 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 04:56:41 -0000 Author: br Date: Tue Apr 1 04:56:40 2014 New Revision: 263982 URL: http://svnweb.freebsd.org/changeset/base/263982 Log: Add Cortex-A15 cpu id revisions. Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/arm/identcpu.c head/sys/arm/include/armreg.h Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Tue Apr 1 04:40:08 2014 (r263981) +++ head/sys/arm/arm/cpufunc.c Tue Apr 1 04:56:40 2014 (r263982) @@ -1056,7 +1056,10 @@ set_cpufuncs() cputype == CPU_ID_CORTEXA9R1 || cputype == CPU_ID_CORTEXA9R2 || cputype == CPU_ID_CORTEXA9R3 || - cputype == CPU_ID_CORTEXA15 || + cputype == CPU_ID_CORTEXA15R0 || + cputype == CPU_ID_CORTEXA15R1 || + cputype == CPU_ID_CORTEXA15R2 || + cputype == CPU_ID_CORTEXA15R3 || cputype == CPU_ID_KRAIT ) { cpufuncs = cortexa_cpufuncs; cpu_reset_needs_v4_MMU_disable = 1; /* V4 or higher */ Modified: head/sys/arm/arm/identcpu.c ============================================================================== --- head/sys/arm/arm/identcpu.c Tue Apr 1 04:40:08 2014 (r263981) +++ head/sys/arm/arm/identcpu.c Tue Apr 1 04:56:40 2014 (r263982) @@ -185,7 +185,13 @@ const struct cpuidtab cpuids[] = { generic_steppings }, { CPU_ID_CORTEXA9R3, CPU_CLASS_CORTEXA, "Cortex A9-r3", generic_steppings }, - { CPU_ID_CORTEXA15, CPU_CLASS_CORTEXA, "Cortex A15", + { CPU_ID_CORTEXA15R0, CPU_CLASS_CORTEXA, "Cortex A15-r0", + generic_steppings }, + { CPU_ID_CORTEXA15R1, CPU_CLASS_CORTEXA, "Cortex A15-r1", + generic_steppings }, + { CPU_ID_CORTEXA15R2, CPU_CLASS_CORTEXA, "Cortex A15-r2", + generic_steppings }, + { CPU_ID_CORTEXA15R3, CPU_CLASS_CORTEXA, "Cortex A15-r3", generic_steppings }, { CPU_ID_KRAIT, CPU_CLASS_KRAIT, "Krait", generic_steppings }, Modified: head/sys/arm/include/armreg.h ============================================================================== --- head/sys/arm/include/armreg.h Tue Apr 1 04:40:08 2014 (r263981) +++ head/sys/arm/include/armreg.h Tue Apr 1 04:56:40 2014 (r263982) @@ -123,7 +123,10 @@ #define CPU_ID_CORTEXA9R1 0x411fc090 #define CPU_ID_CORTEXA9R2 0x412fc090 #define CPU_ID_CORTEXA9R3 0x413fc090 -#define CPU_ID_CORTEXA15 0x410fc0f0 +#define CPU_ID_CORTEXA15R0 0x410fc0f0 +#define CPU_ID_CORTEXA15R1 0x411fc0f0 +#define CPU_ID_CORTEXA15R2 0x412fc0f0 +#define CPU_ID_CORTEXA15R3 0x413fc0f0 #define CPU_ID_KRAIT 0x510f06f0 /* Snapdragon S4 Pro/APQ8064 */ #define CPU_ID_TI925T 0x54029250 #define CPU_ID_MV88FR131 0x56251310 /* Marvell Feroceon 88FR131 Core */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 06:46:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC18F590; Tue, 1 Apr 2014 06:46:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98D316E1; Tue, 1 Apr 2014 06:46:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s316kxvH025525; Tue, 1 Apr 2014 06:46:59 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s316kxqK025524; Tue, 1 Apr 2014 06:46:59 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201404010646.s316kxqK025524@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 1 Apr 2014 06:46:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263983 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 06:46:59 -0000 Author: bapt Date: Tue Apr 1 06:46:59 2014 New Revision: 263983 URL: http://svnweb.freebsd.org/changeset/base/263983 Log: Ensure make xdev respect which compiler is CC and which compilers should be built according to standard build options Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Apr 1 04:56:40 2014 (r263982) +++ head/Makefile.inc1 Tue Apr 1 06:46:59 2014 (r263983) @@ -1919,11 +1919,11 @@ _xb-build-tools: _xb-cross-tools: .for _tool in \ - gnu/usr.bin/binutils \ - gnu/usr.bin/cc \ + ${_binutils} \ usr.bin/ar \ ${_clang_libs} \ - ${_clang} + ${_clang} \ + ${_cc} ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \ cd ${.CURDIR}/${_tool} && \ ${CDMAKE} DIRPRFX=${_tool}/ obj && \ @@ -1947,10 +1947,11 @@ xdev-install: xdev-build _xi-mtree _xi-c _xi-cross-tools: @echo "_xi-cross-tools" .for _tool in \ - gnu/usr.bin/binutils \ - gnu/usr.bin/cc \ + ${_binutils} \ usr.bin/ar \ - ${_clang} + ${_clang_libs} \ + ${_clang} \ + ${_cc} ${_+_}@${ECHODIR} "===> xdev ${_tool} (install)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ install DESTDIR=${XDDESTDIR} From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 08:09:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94225D41; Tue, 1 Apr 2014 08:09:02 +0000 (UTC) Received: from mail-pa0-x22f.google.com (mail-pa0-x22f.google.com [IPv6:2607:f8b0:400e:c03::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56924E12; Tue, 1 Apr 2014 08:09:02 +0000 (UTC) Received: by mail-pa0-f47.google.com with SMTP id lj1so9380067pab.6 for ; Tue, 01 Apr 2014 01:09:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=bAaaZVmgE8TwyOik6eG1FZCGuiGyGpyiDVyglSXeyQM=; b=DgLEuUqAoR49Rl5OFdIRTDP4agy1ANWLAIy8+54WC+F1CvLW+3z8rWX+mYGI5fXjMV OpFTpudqBdArXkvFKvOpFiiNhi5cslXerWcf5nvI7DJ9RiV2wxtYF0RRq6+wAM52/vLt x8QfKVnbdewzr6k/ahHnv7qK6hoBNVhODEZCCPaZrr0MLx4CGXefJ5kKvHdJWJOMgoEs oz1xxcdrYX6OWI/a7HbVgnhDB+coq8h2lwru3WnuEC0tRQJ1tu1i7ctKotpFf7x7SP4g Nx6HcbVKqk8fJchNLZJPcNxE9+7iQloOjL3X9jk/VRJdzUBOKaoZfH/nEDgQKqIsiqmH 5UHA== X-Received: by 10.68.217.234 with SMTP id pb10mr8254085pbc.142.1396339741831; Tue, 01 Apr 2014 01:09:01 -0700 (PDT) Received: from [192.168.1.7] (ppp59-167-128-11.static.internode.on.net. [59.167.128.11]) by mx.google.com with ESMTPSA id qq5sm48224891pbb.24.2014.04.01.01.08.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Apr 2014 01:09:01 -0700 (PDT) Message-ID: <533A7416.7030605@FreeBSD.org> Date: Tue, 01 Apr 2014 19:08:54 +1100 From: Kubilay Kocak User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Thunderbird/28.0 MIME-Version: 1.0 To: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r263978 - head/sys/cam/ctl References: <201403312049.s2VKnXLr079029@svn.freebsd.org> In-Reply-To: <201403312049.s2VKnXLr079029@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: koobs@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 08:09:02 -0000 On 1/04/2014 7:49 AM, Edward Tomasz Napierala wrote: > Author: trasz > Date: Mon Mar 31 20:49:33 2014 > New Revision: 263978 > URL: http://svnweb.freebsd.org/changeset/base/263978 > > Log: > Make it possible to have multiple CTL worker threads. Leave the default > of 1 for now. > > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/cam/ctl/ctl.c > > Modified: head/sys/cam/ctl/ctl.c > ============================================================================== > --- head/sys/cam/ctl/ctl.c Mon Mar 31 19:58:08 2014 (r263977) > +++ head/sys/cam/ctl/ctl.c Mon Mar 31 20:49:33 2014 (r263978) > @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > > @@ -320,6 +321,10 @@ static int ctl_is_single = 1; > static int index_to_aps_page; > > SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); > +static int worker_threads = 1; > +TUNABLE_INT("kern.cam.ctl.worker_threads", &worker_threads); > +SYSCTL_INT(_kern_cam_ctl, OID_AUTO, worker_threads, CTLFLAG_RDTUN, > + &worker_threads, 1, "Number of worker threads"); > > /* > * Serial number (0x80), device id (0x83), and supported pages (0x00) > @@ -950,10 +955,7 @@ ctl_init(void) > struct ctl_frontend *fe; > struct ctl_lun *lun; > uint8_t sc_id =0; > -#if 0 > - int i; > -#endif > - int error, retval; > + int i, error, retval; > //int isc_retval; > > retval = 0; > @@ -1085,17 +1087,35 @@ ctl_init(void) > mtx_unlock(&softc->ctl_lock); > #endif > > - error = kproc_create(ctl_work_thread, softc, &softc->work_thread, 0, 0, > - "ctl_thrd"); > - if (error != 0) { > - printf("error creating CTL work thread!\n"); > - mtx_lock(&softc->ctl_lock); > - ctl_free_lun(lun); > - mtx_unlock(&softc->ctl_lock); > - ctl_pool_free(internal_pool); > - ctl_pool_free(emergency_pool); > - ctl_pool_free(other_pool); > - return (error); > + if (worker_threads > MAXCPU || worker_threads == 0) { > + printf("invalid kern.cam.ctl.worker_threads value; " > + "setting to 1"); > + worker_threads = 1; > + } else if (worker_threads < 0) { Why is it that the < 0 case is special enough that it gets the mp_ncpus check below, but the == 0 and > MAXCPU cases don't? > + if (mp_ncpus > 2) { > + /* > + * Using more than two worker threads actually hurts > + * performance due to lock contention. > + */ > + worker_threads = 2; > + } else { > + worker_threads = 1; > + } Are printf("Setting to N")'s worthwhile here as well given worker_threads is set to a value that wasn't specified by the user, as above? > + } > + > + for (i = 0; i < worker_threads; i++) { > + error = kproc_create(ctl_work_thread, softc, &softc->work_thread, 0, 0, > + "ctl_thrd%d", i); > + if (error != 0) { > + printf("error creating CTL work thread!\n"); > + mtx_lock(&softc->ctl_lock); > + ctl_free_lun(lun); > + mtx_unlock(&softc->ctl_lock); > + ctl_pool_free(internal_pool); > + ctl_pool_free(emergency_pool); > + ctl_pool_free(other_pool); > + return (error); > + } > } > if (bootverbose) > printf("ctl: CAM Target Layer loaded\n"); > @@ -12991,7 +13011,11 @@ ctl_work_thread(void *arg) > if (io != NULL) { > STAILQ_REMOVE_HEAD(&softc->rtr_queue, links); > mtx_unlock(&softc->ctl_lock); > - goto execute; > + retval = ctl_scsiio(&io->scsiio); > + if (retval != CTL_RETVAL_COMPLETE) > + CTL_DEBUG_PRINT(("ctl_scsiio failed\n")); > + mtx_lock(&softc->ctl_lock); > + continue; > } > } > io = (union ctl_io *)STAILQ_FIRST(&softc->incoming_queue); > @@ -13022,19 +13046,6 @@ ctl_work_thread(void *arg) > > /* Back to the top of the loop to see what woke us up. */ > continue; > - > -execute: > - retval = ctl_scsiio(&io->scsiio); > - switch (retval) { > - case CTL_RETVAL_COMPLETE: > - break; > - default: > - /* > - * Probably need to make sure this doesn't happen. > - */ > - break; > - } > - mtx_lock(&softc->ctl_lock); > } > } > > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 08:43:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A9FEB1F; Tue, 1 Apr 2014 08:43:56 +0000 (UTC) Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com [IPv6:2a00:1450:400c:c00::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2802B26D; Tue, 1 Apr 2014 08:43:55 +0000 (UTC) Received: by mail-wg0-f42.google.com with SMTP id y10so6916874wgg.1 for ; Tue, 01 Apr 2014 01:43:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ql9IjHpxv2/y5yoI0snaA4NuNfo2Vj1RglKgg3DPfMg=; b=zmQpSLm/wEe4VMF4pS5KzjVNvoJve8QYqACyYZw1RqCfKvgvuL/bXbg2g5lEoK7vpK E7WrckqG21py5XM4QVjRl9QFw7X/EuQwDBPrncpcvynF3ULAUgb1wSGztcLUcTqfwrpd aMaIQzus/gRmofs5q0GP3WAMFqtOkF2HtS9j8e+7GOE59TJ3EDdL22lKyyP4BHu126xk kFObAgKDM3fjhLAhOP6ElwHSCmauunbHwu4ZNBP3Ql9lXWsIGfiabLd+hO+ULIDAX2hB hKQEL4vEc6IPkpoQD/1pc0Mig/Ahehe4tvqb1HrLEuhtRdAomOw0yNXiolB4sqj4UkAX VWNw== X-Received: by 10.194.86.7 with SMTP id l7mr20501698wjz.37.1396341833374; Tue, 01 Apr 2014 01:43:53 -0700 (PDT) Received: from strashydlo.home (agy254.neoplus.adsl.tpnet.pl. [83.25.180.254]) by mx.google.com with ESMTPSA id y7sm39007989eev.5.2014.04.01.01.43.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Apr 2014 01:43:52 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Subject: Re: svn commit: r263978 - head/sys/cam/ctl Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=iso-8859-2 From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= In-Reply-To: <533A7416.7030605@FreeBSD.org> Date: Tue, 1 Apr 2014 10:43:50 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201403312049.s2VKnXLr079029@svn.freebsd.org> <533A7416.7030605@FreeBSD.org> To: koobs@FreeBSD.org X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 08:43:56 -0000 Wiadomo=B6=E6 napisana przez Kubilay Kocak w dniu 1 kwi 2014, o godz. = 10:08: > On 1/04/2014 7:49 AM, Edward Tomasz Napierala wrote: >> Author: trasz >> Date: Mon Mar 31 20:49:33 2014 >> New Revision: 263978 >> URL: http://svnweb.freebsd.org/changeset/base/263978 >>=20 >> Log: >> Make it possible to have multiple CTL worker threads. Leave the = default >> of 1 for now. >>=20 >> Sponsored by: The FreeBSD Foundation >>=20 >> Modified: >> head/sys/cam/ctl/ctl.c >>=20 >> Modified: head/sys/cam/ctl/ctl.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/cam/ctl/ctl.c Mon Mar 31 19:58:08 2014 = (r263977) >> +++ head/sys/cam/ctl/ctl.c Mon Mar 31 20:49:33 2014 = (r263978) >> @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include >> #include >> #include >>=20 >> @@ -320,6 +321,10 @@ static int ctl_is_single =3D 1; >> static int index_to_aps_page; >>=20 >> SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target = Layer"); >> +static int worker_threads =3D 1; >> +TUNABLE_INT("kern.cam.ctl.worker_threads", &worker_threads); >> +SYSCTL_INT(_kern_cam_ctl, OID_AUTO, worker_threads, CTLFLAG_RDTUN, >> + &worker_threads, 1, "Number of worker threads"); >>=20 >> /* >> * Serial number (0x80), device id (0x83), and supported pages (0x00) >> @@ -950,10 +955,7 @@ ctl_init(void) >> struct ctl_frontend *fe; >> struct ctl_lun *lun; >> uint8_t sc_id =3D0; >> -#if 0 >> - int i; >> -#endif >> - int error, retval; >> + int i, error, retval; >> //int isc_retval; >>=20 >> retval =3D 0; >> @@ -1085,17 +1087,35 @@ ctl_init(void) >> mtx_unlock(&softc->ctl_lock); >> #endif >>=20 >> - error =3D kproc_create(ctl_work_thread, softc, = &softc->work_thread, 0, 0, >> - "ctl_thrd"); >> - if (error !=3D 0) { >> - printf("error creating CTL work thread!\n"); >> - mtx_lock(&softc->ctl_lock); >> - ctl_free_lun(lun); >> - mtx_unlock(&softc->ctl_lock); >> - ctl_pool_free(internal_pool); >> - ctl_pool_free(emergency_pool); >> - ctl_pool_free(other_pool); >> - return (error); >> + if (worker_threads > MAXCPU || worker_threads =3D=3D 0) { >> + printf("invalid kern.cam.ctl.worker_threads value; " >> + "setting to 1"); >> + worker_threads =3D 1; >> + } else if (worker_threads < 0) { >=20 > Why is it that the < 0 case is special enough that it gets the = mp_ncpus > check below, but the =3D=3D 0 and > MAXCPU cases don't? It's to be able to set it to -1 (which will probably become the new = default soon) and let the code figure out the right number by itself. >> + if (mp_ncpus > 2) { >> + /* >> + * Using more than two worker threads actually = hurts >> + * performance due to lock contention. >> + */ >=20 >> + worker_threads =3D 2; >> + } else { >> + worker_threads =3D 1; >> + } >=20 > Are printf("Setting to N")'s worthwhile here as well given > worker_threads is set to a value that wasn't specified by the user, as > above? The warning is to inform the user why the value supplied was ignored as invalid. The -1 setting is always valid. From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 10:34:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9CB0B7A9; Tue, 1 Apr 2014 10:34:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89684F03; Tue, 1 Apr 2014 10:34:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31AYejq019917; Tue, 1 Apr 2014 10:34:40 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31AYesN019915; Tue, 1 Apr 2014 10:34:40 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201404011034.s31AYesN019915@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 1 Apr 2014 10:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263985 - in head/sys/dev/usb: . wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 10:34:40 -0000 Author: hselasky Date: Tue Apr 1 10:34:39 2014 New Revision: 263985 URL: http://svnweb.freebsd.org/changeset/base/263985 Log: Add new USB ID. Submitted by: Tuomo Latto PR: usb/188046 MFC after: 1 week Modified: head/sys/dev/usb/usbdevs head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Apr 1 08:19:30 2014 (r263984) +++ head/sys/dev/usb/usbdevs Tue Apr 1 10:34:39 2014 (r263985) @@ -4535,5 +4535,6 @@ product ZYXEL G220V2 0x340f G-220 v2 product ZYXEL G202 0x3410 G-202 product ZYXEL RT2870_1 0x3416 RT2870 product ZYXEL RT2870_2 0x341a RT2870 +product ZYXEL RT3070 0x341e NWD2105 product ZYXEL RTL8192CU 0x341f RTL8192CU product ZYXEL NWD2705 0x3421 NWD2705 Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Tue Apr 1 08:19:30 2014 (r263984) +++ head/sys/dev/usb/wlan/if_run.c Tue Apr 1 10:34:39 2014 (r263985) @@ -316,6 +316,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(ZINWELL, RT3072_2), RUN_DEV(ZYXEL, RT2870_1), RUN_DEV(ZYXEL, RT2870_2), + RUN_DEV(ZYXEL, RT3070), RUN_DEV_EJECT(ZYXEL, NWD2705), RUN_DEV_EJECT(RALINK, RT_STOR), #undef RUN_DEV_EJECT From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 10:36:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFB488FE; Tue, 1 Apr 2014 10:36:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7DC8F10; Tue, 1 Apr 2014 10:36:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31AaGXs020195; Tue, 1 Apr 2014 10:36:16 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31AaCIZ020166; Tue, 1 Apr 2014 10:36:12 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201404011036.s31AaCIZ020166@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 1 Apr 2014 10:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263986 - in head/lib: libc/iconv libiconv_modules/BIG5 libiconv_modules/DECHanyu libiconv_modules/EUCTW libiconv_modules/ISO2022 libiconv_modules/UES libiconv_modules/VIQR libiconv_mod... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 10:36:17 -0000 Author: tijl Date: Tue Apr 1 10:36:11 2014 New Revision: 263986 URL: http://svnweb.freebsd.org/changeset/base/263986 Log: - In the libiconv module for ISO 2022 restore the original order of the fields of a private struct such that variables of this type are initialised correctly. Fixes conversion from ISO 2022. Also do this in the BIG5 module to prevent similar errors in the future. - In the libiconv module for EUC-TW replace 2^cs with 1<ci_ops->io_uninit_shared == NULL || ci->ci_ops->io_init_context == NULL || ci->ci_ops->io_uninit_context == NULL || - ci->ci_ops->io_convert == NULL) + ci->ci_ops->io_convert == NULL) { + ret = EINVAL; goto err; + } /* initialize the converter */ ret = (*ci->ci_ops->io_init_shared)(ci, src, dst); Modified: head/lib/libc/iconv/citrus_lookup.c ============================================================================== --- head/lib/libc/iconv/citrus_lookup.c Tue Apr 1 10:34:39 2014 (r263985) +++ head/lib/libc/iconv/citrus_lookup.c Tue Apr 1 10:36:11 2014 (r263986) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_lookup.c,v 1.6 2009/02/03 04:58:38 lukem Exp $ */ +/* $NetBSD: citrus_lookup.c,v 1.7 2012/05/04 16:45:05 joerg Exp $ */ /*- * Copyright (c)2003 Citrus Project, Modified: head/lib/libc/iconv/citrus_mapper.c ============================================================================== --- head/lib/libc/iconv/citrus_mapper.c Tue Apr 1 10:34:39 2014 (r263985) +++ head/lib/libc/iconv/citrus_mapper.c Tue Apr 1 10:36:11 2014 (r263986) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_mapper.c,v 1.7 2008/07/25 14:05:25 christos Exp $ */ +/* $NetBSD: citrus_mapper.c,v 1.10 2012/06/08 07:49:42 martin Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -244,8 +244,10 @@ mapper_open(struct _citrus_mapper_area * if (!cm->cm_ops->mo_init || !cm->cm_ops->mo_uninit || !cm->cm_ops->mo_convert || - !cm->cm_ops->mo_init_state) + !cm->cm_ops->mo_init_state) { + ret = EINVAL; goto err; + } /* allocate traits structure */ cm->cm_traits = malloc(sizeof(*cm->cm_traits)); Modified: head/lib/libc/iconv/citrus_memstream.c ============================================================================== --- head/lib/libc/iconv/citrus_memstream.c Tue Apr 1 10:34:39 2014 (r263985) +++ head/lib/libc/iconv/citrus_memstream.c Tue Apr 1 10:36:11 2014 (r263986) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_memstream.c,v 1.4 2009/02/03 05:02:12 lukem Exp $ */ +/* $NetBSD: citrus_memstream.c,v 1.5 2012/03/13 21:13:31 christos Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -44,8 +44,7 @@ _citrus_memory_stream_getln(struct _citr size_t * __restrict rlen) { const uint8_t *h, *p; - size_t ret; - int i; + size_t i, ret; if (ms->ms_pos>=_region_size(&ms->ms_region)) return (NULL); Modified: head/lib/libc/iconv/citrus_mmap.c ============================================================================== --- head/lib/libc/iconv/citrus_mmap.c Tue Apr 1 10:34:39 2014 (r263985) +++ head/lib/libc/iconv/citrus_mmap.c Tue Apr 1 10:36:11 2014 (r263986) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_mmap.c,v 1.3 2005/01/19 00:52:37 mycroft Exp $ */ +/* $NetBSD: citrus_mmap.c,v 1.4 2011/10/15 23:00:01 christos Exp $ */ /*- * Copyright (c)2003 Citrus Project, Modified: head/lib/libc/iconv/citrus_prop.c ============================================================================== --- head/lib/libc/iconv/citrus_prop.c Tue Apr 1 10:34:39 2014 (r263985) +++ head/lib/libc/iconv/citrus_prop.c Tue Apr 1 10:36:11 2014 (r263986) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_prop.c,v 1.3 2006/11/22 23:47:21 tnozaki Exp $ */ +/* $NetBSD: citrus_prop.c,v 1.4 2011/03/30 08:22:01 jruoho Exp $ */ /*- * Copyright (c)2006 Citrus Project, Modified: head/lib/libc/iconv/citrus_prop.h ============================================================================== --- head/lib/libc/iconv/citrus_prop.h Tue Apr 1 10:34:39 2014 (r263985) +++ head/lib/libc/iconv/citrus_prop.h Tue Apr 1 10:36:11 2014 (r263986) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_prop.h,v 1.3 2006/11/23 13:59:03 tnozaki Exp $ */ +/* $NetBSD: citrus_prop.h,v 1.5 2011/05/23 14:52:32 joerg Exp $ */ /*- * Copyright (c)2006 Citrus Project, @@ -82,7 +82,7 @@ struct _citrus_prop_hint_t { #define _CITRUS_PROP_HINT_NUM(name, cb) \ { name, _CITRUS_PROP_NUM, { .num = { cb } } } #define _CITRUS_PROP_HINT_END \ - { NULL, _CITRUS_PROP_NUM, { .num = { 0 } } } + { .name = NULL } __BEGIN_DECLS int _citrus_prop_parse_variable(const _citrus_prop_hint_t * __restrict, Modified: head/lib/libc/iconv/citrus_stdenc.c ============================================================================== --- head/lib/libc/iconv/citrus_stdenc.c Tue Apr 1 10:34:39 2014 (r263985) +++ head/lib/libc/iconv/citrus_stdenc.c Tue Apr 1 10:36:11 2014 (r263986) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_stdenc.c,v 1.3 2005/10/29 18:02:04 tshiozak Exp $ */ +/* $NetBSD: citrus_stdenc.c,v 1.4 2011/11/19 18:39:58 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -102,8 +102,10 @@ _citrus_stdenc_open(struct _citrus_stden ce->ce_ops->eo_cstomb == NULL || ce->ce_ops->eo_mbtowc == NULL || ce->ce_ops->eo_wctomb == NULL || - ce->ce_ops->eo_get_state_desc == NULL) + ce->ce_ops->eo_get_state_desc == NULL) { + ret = EINVAL; goto bad; + } /* allocate traits */ ce->ce_traits = malloc(sizeof(*ce->ce_traits)); Modified: head/lib/libiconv_modules/BIG5/citrus_big5.c ============================================================================== --- head/lib/libiconv_modules/BIG5/citrus_big5.c Tue Apr 1 10:34:39 2014 (r263985) +++ head/lib/libiconv_modules/BIG5/citrus_big5.c Tue Apr 1 10:36:11 2014 (r263986) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_big5.c,v 1.12 2008/06/14 16:01:07 tnozaki Exp $ */ +/* $NetBSD: citrus_big5.c,v 1.13 2011/05/23 14:53:46 joerg Exp $ */ /*- * Copyright (c)2002, 2006 Citrus Project, @@ -92,8 +92,8 @@ typedef struct { typedef struct _BIG5Exclude { TAILQ_ENTRY(_BIG5Exclude) entry; - wint_t end; wint_t start; + wint_t end; } _BIG5Exclude; typedef TAILQ_HEAD(_BIG5ExcludeList, _BIG5Exclude) _BIG5ExcludeList; @@ -358,7 +358,7 @@ _citrus_BIG5_wcrtomb_priv(_BIG5EncodingI size_t n, wchar_t wc, _BIG5State * __restrict psenc __unused, size_t * __restrict nresult) { - unsigned char l; + size_t l; int ret; /* check invalid sequence */ Modified: head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c ============================================================================== --- head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c Tue Apr 1 10:34:39 2014 (r263985) +++ head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c Tue Apr 1 10:36:11 2014 (r263986) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_dechanyu.c,v 1.3 2008/06/14 16:01:07 tnozaki Exp $ */ +/* $NetBSD: citrus_dechanyu.c,v 1.4 2011/11/19 18:20:13 tnozaki Exp $ */ /*- * Copyright (c)2007 Citrus Project, Modified: head/lib/libiconv_modules/EUCTW/citrus_euctw.c ============================================================================== --- head/lib/libiconv_modules/EUCTW/citrus_euctw.c Tue Apr 1 10:34:39 2014 (r263985) +++ head/lib/libiconv_modules/EUCTW/citrus_euctw.c Tue Apr 1 10:36:11 2014 (r263986) @@ -119,7 +119,7 @@ _citrus_EUCTW_count(int cs) case 1: /*FALLTHROUGH*/ case 2: - return (2^cs); + return (1 << cs); case 3: abort(); /*NOTREACHED*/ Modified: head/lib/libiconv_modules/ISO2022/citrus_iso2022.c ============================================================================== --- head/lib/libiconv_modules/ISO2022/citrus_iso2022.c Tue Apr 1 10:34:39 2014 (r263985) +++ head/lib/libiconv_modules/ISO2022/citrus_iso2022.c Tue Apr 1 10:36:11 2014 (r263986) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_iso2022.c,v 1.19 2008/06/14 16:01:07 tnozaki Exp $ */ +/* $NetBSD: citrus_iso2022.c,v 1.20 2010/12/07 22:01:45 joerg Exp $ */ /*- * Copyright (c)1999, 2002 Citrus Project, @@ -78,9 +78,9 @@ #define CS96MULTI (3U) typedef struct { - unsigned char interm; - unsigned char final; unsigned char type; + unsigned char final; + unsigned char interm; unsigned char vers; } _ISO2022Charset; Modified: head/lib/libiconv_modules/UES/citrus_ues.c ============================================================================== --- head/lib/libiconv_modules/UES/citrus_ues.c Tue Apr 1 10:34:39 2014 (r263985) +++ head/lib/libiconv_modules/UES/citrus_ues.c Tue Apr 1 10:36:11 2014 (r263986) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_ues.c,v 1.1 2006/11/13 15:16:31 tnozaki Exp $ */ +/* $NetBSD: citrus_ues.c,v 1.3 2012/02/12 13:51:29 wiz Exp $ */ /*- * Copyright (c)2006 Citrus Project, Modified: head/lib/libiconv_modules/VIQR/citrus_viqr.c ============================================================================== --- head/lib/libiconv_modules/VIQR/citrus_viqr.c Tue Apr 1 10:34:39 2014 (r263985) +++ head/lib/libiconv_modules/VIQR/citrus_viqr.c Tue Apr 1 10:36:11 2014 (r263986) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_viqr.c,v 1.4 2008/06/14 16:01:08 tnozaki Exp $ */ +/* $NetBSD: citrus_viqr.c,v 1.5 2011/11/19 18:20:13 tnozaki Exp $ */ /*- * Copyright (c)2006 Citrus Project, Modified: head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c ============================================================================== --- head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c Tue Apr 1 10:34:39 2014 (r263985) +++ head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c Tue Apr 1 10:36:11 2014 (r263986) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_iconv_none.c,v 1.2 2003/07/01 09:42:16 tshiozak Exp $ */ +/* $NetBSD: citrus_iconv_none.c,v 1.3 2011/05/23 14:45:44 joerg Exp $ */ /*- * Copyright (c)2003 Citrus Project, Modified: head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c ============================================================================== --- head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c Tue Apr 1 10:34:39 2014 (r263985) +++ head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c Tue Apr 1 10:36:11 2014 (r263986) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_iconv_std.c,v 1.15 2006/11/13 19:08:19 tnozaki Exp $ */ +/* $NetBSD: citrus_iconv_std.c,v 1.16 2012/02/12 13:51:29 wiz Exp $ */ /*- * Copyright (c)2003 Citrus Project, Modified: head/lib/libiconv_modules/mapper_std/citrus_mapper_std.c ============================================================================== --- head/lib/libiconv_modules/mapper_std/citrus_mapper_std.c Tue Apr 1 10:34:39 2014 (r263985) +++ head/lib/libiconv_modules/mapper_std/citrus_mapper_std.c Tue Apr 1 10:36:11 2014 (r263986) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_mapper_std.c,v 1.8 2006/09/11 13:06:33 tnozaki Exp $ */ +/* $NetBSD: citrus_mapper_std.c,v 1.10 2011/11/19 18:48:39 tnozaki Exp $ */ /*- * Copyright (c)2003, 2006 Citrus Project, @@ -174,8 +174,11 @@ rowcol_parse_variable_compat(struct _cit n = be32toh(rcx->rcx_src_row_end); if (m + n > 0) { ret = set_linear_zone(lz, m, n); - if (ret != 0) + if (ret != 0) { + free(rc->rc_src_rowcol); + rc->rc_src_rowcol = NULL; return (ret); + } ++rc->rc_src_rowcol_len, ++lz; } m = be32toh(rcx->rcx_src_col_begin); From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 13:47:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6C5C44D; Tue, 1 Apr 2014 13:47:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D06795E2; Tue, 1 Apr 2014 13:47:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31DlApu098356; Tue, 1 Apr 2014 13:47:10 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31Dl9VX098342; Tue, 1 Apr 2014 13:47:09 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201404011347.s31Dl9VX098342@svn.freebsd.org> From: Julio Merino Date: Tue, 1 Apr 2014 13:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263989 - in head: contrib/atf contrib/atf/atf-c contrib/atf/atf-c++ contrib/atf/atf-sh etc/mtree lib/atf/libatf-c lib/atf/libatf-c++ usr.bin/atf/atf-sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 13:47:11 -0000 Author: jmmv Date: Tue Apr 1 13:47:08 2014 New Revision: 263989 URL: http://svnweb.freebsd.org/changeset/base/263989 Log: Add atf m4 files from the vendor branch. These were originally deleted as "not important" but, actually we need them in place if we want to be able to use autoconf on software that provides atf-based tests. (That includes being able to rebuild autotest from scratch on the Kyua cluster machines, as the automated setup does.) Added: head/contrib/atf/atf-c++/atf-c++.m4 - copied unchanged from r261889, vendor/atf/dist/atf-c++/atf-c++.m4 head/contrib/atf/atf-c/atf-c.m4 - copied unchanged from r261889, vendor/atf/dist/atf-c/atf-c.m4 head/contrib/atf/atf-c/atf-common.m4 - copied unchanged from r261889, vendor/atf/dist/atf-c/atf-common.m4 head/contrib/atf/atf-sh/atf-sh.m4 - copied unchanged from r261889, vendor/atf/dist/atf-sh/atf-sh.m4 Modified: head/contrib/atf/FREEBSD-Xlist head/etc/mtree/BSD.tests.dist head/lib/atf/libatf-c++/Makefile head/lib/atf/libatf-c/Makefile head/usr.bin/atf/atf-sh/Makefile Modified: head/contrib/atf/FREEBSD-Xlist ============================================================================== --- head/contrib/atf/FREEBSD-Xlist Tue Apr 1 12:08:58 2014 (r263988) +++ head/contrib/atf/FREEBSD-Xlist Tue Apr 1 13:47:08 2014 (r263989) @@ -7,7 +7,6 @@ INSTALL Makefile* aclocal.m4 admin/ -atf-*/atf-*.m4 atf-config/ atf-report/ atf-run/ Copied: head/contrib/atf/atf-c++/atf-c++.m4 (from r261889, vendor/atf/dist/atf-c++/atf-c++.m4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/atf/atf-c++/atf-c++.m4 Tue Apr 1 13:47:08 2014 (r263989, copy of r261889, vendor/atf/dist/atf-c++/atf-c++.m4) @@ -0,0 +1,48 @@ +dnl +dnl Automated Testing Framework (atf) +dnl +dnl Copyright 2011 Google Inc. +dnl All rights reserved. +dnl +dnl Redistribution and use in source and binary forms, with or without +dnl modification, are permitted provided that the following conditions are +dnl met: +dnl +dnl * Redistributions of source code must retain the above copyright +dnl notice, this list of conditions and the following disclaimer. +dnl * Redistributions in binary form must reproduce the above copyright +dnl notice, this list of conditions and the following disclaimer in the +dnl documentation and/or other materials provided with the distribution. +dnl * Neither the name of Google Inc. nor the names of its contributors +dnl may be used to endorse or promote products derived from this software +dnl without specific prior written permission. +dnl +dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +dnl OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +dnl LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +dnl DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +dnl THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +dnl (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +dnl OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +dnl + +dnl ATF_CHECK_CXX([version-spec]) +dnl +dnl Checks if atf-c++ is present. If version-spec is provided, ensures that +dnl the installed version of atf-sh matches the required version. This +dnl argument must be something like '>= 0.14' and accepts any version +dnl specification supported by pkg-config. +dnl +dnl Defines and substitutes ATF_CXX_CFLAGS and ATF_CXX_LIBS with the compiler +dnl and linker flags need to build against atf-c++. +AC_DEFUN([ATF_CHECK_CXX], [ + spec="atf-c++[]m4_default_nblank([ $1], [])" + _ATF_CHECK_ARG_WITH( + [PKG_CHECK_MODULES([ATF_CXX], [${spec}], + [found=yes found_atf_cxx=yes], [found=no])], + [required ${spec} not found]) +]) Copied: head/contrib/atf/atf-c/atf-c.m4 (from r261889, vendor/atf/dist/atf-c/atf-c.m4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/atf/atf-c/atf-c.m4 Tue Apr 1 13:47:08 2014 (r263989, copy of r261889, vendor/atf/dist/atf-c/atf-c.m4) @@ -0,0 +1,48 @@ +dnl +dnl Automated Testing Framework (atf) +dnl +dnl Copyright 2011 Google Inc. +dnl All rights reserved. +dnl +dnl Redistribution and use in source and binary forms, with or without +dnl modification, are permitted provided that the following conditions are +dnl met: +dnl +dnl * Redistributions of source code must retain the above copyright +dnl notice, this list of conditions and the following disclaimer. +dnl * Redistributions in binary form must reproduce the above copyright +dnl notice, this list of conditions and the following disclaimer in the +dnl documentation and/or other materials provided with the distribution. +dnl * Neither the name of Google Inc. nor the names of its contributors +dnl may be used to endorse or promote products derived from this software +dnl without specific prior written permission. +dnl +dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +dnl OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +dnl LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +dnl DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +dnl THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +dnl (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +dnl OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +dnl + +dnl ATF_CHECK_C([version-spec]) +dnl +dnl Checks if atf-c is present. If version-spec is provided, ensures that +dnl the installed version of atf-sh matches the required version. This +dnl argument must be something like '>= 0.14' and accepts any version +dnl specification supported by pkg-config. +dnl +dnl Defines and substitutes ATF_C_CFLAGS and ATF_C_LIBS with the compiler +dnl and linker flags need to build against atf-c. +AC_DEFUN([ATF_CHECK_C], [ + spec="atf-c[]m4_default_nblank([ $1], [])" + _ATF_CHECK_ARG_WITH( + [PKG_CHECK_MODULES([ATF_C], [${spec}], + [found=yes found_atf_c=yes], [found=no])], + [required ${spec} not found]) +]) Copied: head/contrib/atf/atf-c/atf-common.m4 (from r261889, vendor/atf/dist/atf-c/atf-common.m4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/atf/atf-c/atf-common.m4 Tue Apr 1 13:47:08 2014 (r263989, copy of r261889, vendor/atf/dist/atf-c/atf-common.m4) @@ -0,0 +1,92 @@ +dnl +dnl Automated Testing Framework (atf) +dnl +dnl Copyright 2011 Google Inc. +dnl All rights reserved. +dnl +dnl Redistribution and use in source and binary forms, with or without +dnl modification, are permitted provided that the following conditions are +dnl met: +dnl +dnl * Redistributions of source code must retain the above copyright +dnl notice, this list of conditions and the following disclaimer. +dnl * Redistributions in binary form must reproduce the above copyright +dnl notice, this list of conditions and the following disclaimer in the +dnl documentation and/or other materials provided with the distribution. +dnl * Neither the name of Google Inc. nor the names of its contributors +dnl may be used to endorse or promote products derived from this software +dnl without specific prior written permission. +dnl +dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +dnl OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +dnl LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +dnl DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +dnl THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +dnl (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +dnl OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +dnl + +dnl ATF_ARG_WITH +dnl +dnl Adds a --with-atf flag to the configure script that allows the user to +dnl enable or disable atf support. +dnl +dnl The ATF_CHECK_{C,CXX,SH} macros honor the flag defined herein if +dnl instantiated. If not instantiated, they will request the presence of +dnl the libraries unconditionally. +dnl +dnl Defines the WITH_ATF Automake conditional if ATF has been found by any +dnl of the ATF_CHECK_{C,CXX,SH} macros. +AC_DEFUN([ATF_ARG_WITH], [ + m4_define([atf_arg_with_called], [yes]) + + m4_divert_text([DEFAULTS], [with_atf=auto]) + AC_ARG_WITH([atf], + [AS_HELP_STRING([--with-atf=], + [build atf-based test programs])], + [with_atf=${withval}], [with_atf=auto]) + + m4_divert_text([DEFAULTS], [ + found_atf_c=no + found_atf_cxx=no + found_atf_sh=no + ]) + AM_CONDITIONAL([WITH_ATF], [test x"${found_atf_c}" = x"yes" -o \ + x"${found_atf_cxx}" = x"yes" -o \ + x"${found_atf_sh}" = x"yes"]) +]) + +dnl _ATF_CHECK_ARG_WITH(check, error_message) +dnl +dnl Internal macro to execute a check conditional on the --with-atf flag +dnl and handle the result accordingly. +dnl +dnl 'check' specifies the piece of code to be run to detect the feature. +dnl This code must set the 'found' shell variable to yes or no depending +dnl on the raw result of the check. +AC_DEFUN([_ATF_CHECK_ARG_WITH], [ + m4_ifdef([atf_arg_with_called], [ + m4_fatal([ATF_ARG_WITH must be called after the ATF_CHECK_* checks]) + ]) + + m4_divert_text([DEFAULTS], [with_atf=yes]) + + if test x"${with_atf}" = x"no"; then + _found=no + else + $1 + if test x"${with_atf}" = x"auto"; then + _found="${found}" + else + if test x"${found}" = x"yes"; then + _found=yes + else + AC_MSG_ERROR([$2]) + fi + fi + fi +]) Copied: head/contrib/atf/atf-sh/atf-sh.m4 (from r261889, vendor/atf/dist/atf-sh/atf-sh.m4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/atf/atf-sh/atf-sh.m4 Tue Apr 1 13:47:08 2014 (r263989, copy of r261889, vendor/atf/dist/atf-sh/atf-sh.m4) @@ -0,0 +1,53 @@ +dnl +dnl Automated Testing Framework (atf) +dnl +dnl Copyright 2011 Google Inc. +dnl All rights reserved. +dnl +dnl Redistribution and use in source and binary forms, with or without +dnl modification, are permitted provided that the following conditions are +dnl met: +dnl +dnl * Redistributions of source code must retain the above copyright +dnl notice, this list of conditions and the following disclaimer. +dnl * Redistributions in binary form must reproduce the above copyright +dnl notice, this list of conditions and the following disclaimer in the +dnl documentation and/or other materials provided with the distribution. +dnl * Neither the name of Google Inc. nor the names of its contributors +dnl may be used to endorse or promote products derived from this software +dnl without specific prior written permission. +dnl +dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +dnl OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +dnl LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +dnl DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +dnl THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +dnl (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +dnl OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +dnl + +dnl ATF_CHECK_SH([version-spec]) +dnl +dnl Checks if atf-sh is present. If version-spec is provided, ensures that +dnl the installed version of atf-sh matches the required version. This +dnl argument must be something like '>= 0.14' and accepts any version +dnl specification supported by pkg-config. +dnl +dnl Defines and substitutes ATF_SH with the full path to the atf-sh interpreter. +AC_DEFUN([ATF_CHECK_SH], [ + spec="atf-sh[]m4_default_nblank([ $1], [])" + _ATF_CHECK_ARG_WITH( + [AC_MSG_CHECKING([for ${spec}]) + PKG_CHECK_EXISTS([${spec}], [found=yes], [found=no]) + if test "${found}" = yes; then + ATF_SH="$(${PKG_CONFIG} --variable=interpreter atf-sh)" + AC_SUBST([ATF_SH], [${ATF_SH}]) + found_atf_sh=yes + fi + AC_MSG_RESULT([${ATF_SH}])], + [required ${spec} not found]) +]) Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Tue Apr 1 12:08:58 2014 (r263988) +++ head/etc/mtree/BSD.tests.dist Tue Apr 1 13:47:08 2014 (r263989) @@ -12,6 +12,8 @@ .. .. share + aclocal + .. atf .. doc Modified: head/lib/atf/libatf-c++/Makefile ============================================================================== --- head/lib/atf/libatf-c++/Makefile Tue Apr 1 12:08:58 2014 (r263988) +++ head/lib/atf/libatf-c++/Makefile Tue Apr 1 13:47:08 2014 (r263989) @@ -83,6 +83,8 @@ atf-c++.pc: atf-c++.pc.in atf-version beforeinstall: ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ atf-c++.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + ${INSTALL} -C -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \ + ${ATF}/atf-c++/atf-c++.m4 ${DESTDIR}${SHAREDIR}/aclocal .if ${MK_TESTS} != "no" SUBDIR= tests Modified: head/lib/atf/libatf-c/Makefile ============================================================================== --- head/lib/atf/libatf-c/Makefile Tue Apr 1 12:08:58 2014 (r263988) +++ head/lib/atf/libatf-c/Makefile Tue Apr 1 13:47:08 2014 (r263989) @@ -85,6 +85,10 @@ atf-c.pc: atf-c.pc.in atf-version beforeinstall: ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ atf-c.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + ${INSTALL} -C -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \ + ${ATF}/atf-c/atf-common.m4 ${DESTDIR}${SHAREDIR}/aclocal + ${INSTALL} -C -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \ + ${ATF}/atf-c/atf-c.m4 ${DESTDIR}${SHAREDIR}/aclocal .if ${MK_TESTS} != "no" SUBDIR= tests Modified: head/usr.bin/atf/atf-sh/Makefile ============================================================================== --- head/usr.bin/atf/atf-sh/Makefile Tue Apr 1 12:08:58 2014 (r263988) +++ head/usr.bin/atf/atf-sh/Makefile Tue Apr 1 13:47:08 2014 (r263989) @@ -54,6 +54,8 @@ atf-sh.pc: atf-sh.pc.in atf-version beforeinstall: ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ atf-sh.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + ${INSTALL} -C -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \ + ${ATF}/atf-sh/atf-sh.m4 ${DESTDIR}${SHAREDIR}/aclocal .if ${MK_TESTS} != "no" SUBDIR+= tests From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 14:17:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52EFC454; Tue, 1 Apr 2014 14:17:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FC4998D; Tue, 1 Apr 2014 14:17:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31EHde6011133; Tue, 1 Apr 2014 14:17:39 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31EHdiH011132; Tue, 1 Apr 2014 14:17:39 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201404011417.s31EHdiH011132@svn.freebsd.org> From: Luiz Otavio O Souza Date: Tue, 1 Apr 2014 14:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263990 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 14:17:39 -0000 Author: loos Date: Tue Apr 1 14:17:38 2014 New Revision: 263990 URL: http://svnweb.freebsd.org/changeset/base/263990 Log: Add gpiobus(4) as a link to gpio(4). Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Apr 1 13:47:08 2014 (r263989) +++ head/share/man/man4/Makefile Tue Apr 1 14:17:38 2014 (r263990) @@ -636,6 +636,7 @@ MLINKS+=fxp.4 if_fxp.4 MLINKS+=gem.4 if_gem.4 MLINKS+=geom.4 GEOM.4 MLINKS+=gif.4 if_gif.4 +MLINKS+=gpio.4 gpiobus.4 MLINKS+=gre.4 if_gre.4 MLINKS+=hatm.4 if_hatm.4 MLINKS+=hme.4 if_hme.4 From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 14:23:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87F0A6A2; Tue, 1 Apr 2014 14:23:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74C39A38; Tue, 1 Apr 2014 14:23:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31ENx89014805; Tue, 1 Apr 2014 14:23:59 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31ENx5A014803; Tue, 1 Apr 2014 14:23:59 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404011423.s31ENx5A014803@svn.freebsd.org> From: Warner Losh Date: Tue, 1 Apr 2014 14:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263991 - in head: . gnu/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 14:23:59 -0000 Author: imp Date: Tue Apr 1 14:23:58 2014 New Revision: 263991 URL: http://svnweb.freebsd.org/changeset/base/263991 Log: It is possible that MK_GNUCXX is "yes" but MK_CXX is "no" so make sure MK_CXX isn't "no" before building these libraries. Modified: head/Makefile.inc1 head/gnu/lib/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Apr 1 14:17:38 2014 (r263990) +++ head/Makefile.inc1 Tue Apr 1 14:23:58 2014 (r263991) @@ -1486,7 +1486,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_lib_libldns} \ ${_secure_lib_libssh} ${_secure_lib_libssl} -.if ${MK_GNUCXX} != no +.if ${MK_GNUCXX} != "no" && ${MK_CXX} != "no" _prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++ .endif Modified: head/gnu/lib/Makefile ============================================================================== --- head/gnu/lib/Makefile Tue Apr 1 14:17:38 2014 (r263990) +++ head/gnu/lib/Makefile Tue Apr 1 14:23:58 2014 (r263991) @@ -10,7 +10,7 @@ SUBDIR+= libssp # libsupc++ uses libstdc++ headers, although 'make includes' should # have taken care of that already. -.if ${MK_GNUCXX} != "no" +.if ${MK_GNUCXX} != "no" && ${MK_CXX} != "no" SUBDIR+= libstdc++ libsupc++ .endif From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 14:24:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A46FD6A6; Tue, 1 Apr 2014 14:24:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91E4EA3B; Tue, 1 Apr 2014 14:24:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31EO8Pw014937; Tue, 1 Apr 2014 14:24:08 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31EO8An014936; Tue, 1 Apr 2014 14:24:08 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404011424.s31EO8An014936@svn.freebsd.org> From: Warner Losh Date: Tue, 1 Apr 2014 14:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263993 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 14:24:08 -0000 Author: imp Date: Tue Apr 1 14:24:08 2014 New Revision: 263993 URL: http://svnweb.freebsd.org/changeset/base/263993 Log: Eliminate FDT being treated specially. When the BSDL DTC was introduced, the meaning of WITH_FDT changed from 'do FDT in boot loader and build dtc compiler' to be simply 'do FDT things in the boot loader'. Now that we test for FDT in the architecture specific files, this test here is now redunant and encourages bad behavior, so just eliminate it and make it always yes. Those architectures whose boot loaders don't support FDT already omit it when it is set to yes anyway. Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Tue Apr 1 14:24:03 2014 (r263992) +++ head/share/mk/bsd.own.mk Tue Apr 1 14:24:08 2014 (r263993) @@ -272,6 +272,7 @@ __DEFAULT_YES_OPTIONS = \ DYNAMICROOT \ ED_CRYPTO \ EXAMPLES \ + FDT \ FLOPPY \ FMTREE \ FORMAT_EXTENSIONS \ @@ -381,8 +382,7 @@ __DEFAULT_NO_OPTIONS = \ # this means that we have to test TARGET_ARCH (the buildworld case) as well # as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not # used at all in bsd.*.mk, but we have to make an exception here if we want -# to allow defaults for some things like clang and fdt to vary by target -# architecture. +# to allow defaults for some things like clang to vary by target architecture. # .if defined(TARGET_ARCH) __T=${TARGET_ARCH} @@ -427,13 +427,6 @@ __DEFAULT_NO_OPTIONS+=GNUCXX __DEFAULT_YES_OPTIONS+=GNUCXX .endif .endif -# FDT is needed only for arm, mips and powerpc -.if ${__T:Marm*} || ${__T:Mpowerpc*} || ${__T:Mmips*} -__DEFAULT_YES_OPTIONS+=FDT -.else -__DEFAULT_NO_OPTIONS+=FDT -.endif -.undef __T # # MK_* options which default to "yes". From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 14:24:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 200006A5; Tue, 1 Apr 2014 14:24:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D665A3A; Tue, 1 Apr 2014 14:24:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31EO3HN014880; Tue, 1 Apr 2014 14:24:03 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31EO33t014879; Tue, 1 Apr 2014 14:24:03 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404011424.s31EO33t014879@svn.freebsd.org> From: Warner Losh Date: Tue, 1 Apr 2014 14:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263992 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 14:24:04 -0000 Author: imp Date: Tue Apr 1 14:24:03 2014 New Revision: 263992 URL: http://svnweb.freebsd.org/changeset/base/263992 Log: Test MK_ARM_ABI rather than if WITHOUT_ARM_ABI is defined. Modified: head/sys/conf/Makefile.arm Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Tue Apr 1 14:23:58 2014 (r263991) +++ head/sys/conf/Makefile.arm Tue Apr 1 14:24:03 2014 (r263992) @@ -44,10 +44,10 @@ CFLAGS += -mno-thumb-interwork .endif .if empty(DDB_ENABLED) -.if defined(WITHOUT_ARM_EABI) && ${COMPILER_TYPE} != "clang" +.if MK_ARM_EABI == "no" && ${COMPILER_TYPE} == "gcc" CFLAGS += -mno-apcs-frame .endif -.elif !defined(WITHOUT_ARM_EABI) +.elif MK_ARM_EABI != "no" CFLAGS += -funwind-tables .if ${COMPILER_TYPE} == "clang" # clang requires us to tell it to emit assembly with unwind information From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 14:24:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 742C09D6; Tue, 1 Apr 2014 14:24:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68F7CA3C; Tue, 1 Apr 2014 14:24:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31EOGRu015008; Tue, 1 Apr 2014 14:24:16 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31EOGRo015006; Tue, 1 Apr 2014 14:24:16 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404011424.s31EOGRo015006@svn.freebsd.org> From: Warner Losh Date: Tue, 1 Apr 2014 14:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263994 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 14:24:17 -0000 Author: imp Date: Tue Apr 1 14:24:15 2014 New Revision: 263994 URL: http://svnweb.freebsd.org/changeset/base/263994 Log: There's no need to set the default for GNUCXX based on WITHOUT_CXX being defined. The system works fine without it (because GNUCXX isn't built when WITHOUT_CXX is defined), and it is one of the few places we test WITHOUT_FOO instead of MK_FOO in the base system. Simply eliminate it to solve both problems. Also, minor tweak to make it clearer that the default is always NO for GNUGCC on i386. Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Tue Apr 1 14:24:08 2014 (r263993) +++ head/share/mk/bsd.own.mk Tue Apr 1 14:24:15 2014 (r263994) @@ -408,24 +408,18 @@ __DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL .if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \ ${__T} == "armv6hf" || ${__T} == "i386" __DEFAULT_YES_OPTIONS+=CLANG_IS_CC +__DEFAULT_NO_OPTIONS+=GNUCXX # The pc98 bootloader requires gcc to build and so we must leave gcc enabled # for pc98 for now. .if ${__TT} == "pc98" -__DEFAULT_NO_OPTIONS+=GNUCXX __DEFAULT_YES_OPTIONS+=GCC .else -__DEFAULT_NO_OPTIONS+=GCC GNUCXX +__DEFAULT_NO_OPTIONS+=GCC .endif .else # If clang is not cc, then build gcc by default __DEFAULT_NO_OPTIONS+=CLANG_IS_CC -__DEFAULT_YES_OPTIONS+=GCC -# And if g++ is c++, build the rest of the GNU C++ stack -.if defined(WITHOUT_CXX) -__DEFAULT_NO_OPTIONS+=GNUCXX -.else -__DEFAULT_YES_OPTIONS+=GNUCXX -.endif +__DEFAULT_YES_OPTIONS+=GCC GNUCXX .endif # From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 14:24:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D1D9B7B; Tue, 1 Apr 2014 14:24:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEFFDA3E; Tue, 1 Apr 2014 14:24:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31EOKwQ015067; Tue, 1 Apr 2014 14:24:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31EOKei015066; Tue, 1 Apr 2014 14:24:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404011424.s31EOKei015066@svn.freebsd.org> From: Warner Losh Date: Tue, 1 Apr 2014 14:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263995 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 14:24:21 -0000 Author: imp Date: Tue Apr 1 14:24:20 2014 New Revision: 263995 URL: http://svnweb.freebsd.org/changeset/base/263995 Log: Remove check for clang and expand the comment. Newer versions of gcc generate dwarf4 by default as well, so always force dwarf2 when generating debugging data. It is harmless on older versions of both clang and gcc, but required on newer ones. Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Tue Apr 1 14:24:15 2014 (r263994) +++ head/sys/conf/kern.mk Tue Apr 1 14:24:20 2014 (r263995) @@ -164,10 +164,12 @@ CFLAGS+= -fstack-protector .endif # -# Add -gdwarf-2 when compiling -g on clang. The default starting in v3.4 -# is to generate DWARF version 4. However, our tools don't cope well with -# DWARF 4, so force it to genereate DWARF2, which they understand. +# Add -gdwarf-2 when compiling -g. The default starting in clang v3.4 +# and gcc 4.8 is to generate DWARF version 4. However, our tools don't +# cope well with DWARF 4, so force it to genereate DWARF2, which they +# understand. Do this unconditionally as it is harmless when not needed, +# but critical for these newer versions. # -.if ${COMPILER_TYPE} == "clang" && ${CFLAGS:M-g} != "" && ${CFLAGS:M-gdwarf*} == "" +.if ${CFLAGS:M-g} != "" && ${CFLAGS:M-gdwarf*} == "" CFLAGS+= -gdwarf-2 .endif From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 14:24:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92F46CC8; Tue, 1 Apr 2014 14:24:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80862A47; Tue, 1 Apr 2014 14:24:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31EOPj0015128; Tue, 1 Apr 2014 14:24:25 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31EOPDc015127; Tue, 1 Apr 2014 14:24:25 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404011424.s31EOPDc015127@svn.freebsd.org> From: Warner Losh Date: Tue, 1 Apr 2014 14:24:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263996 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 14:24:25 -0000 Author: imp Date: Tue Apr 1 14:24:25 2014 New Revision: 263996 URL: http://svnweb.freebsd.org/changeset/base/263996 Log: Remove support for legacy mips*eb names. Remove tests for TARGET_BIG_ENDIAN. Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Tue Apr 1 14:24:20 2014 (r263995) +++ head/Makefile Tue Apr 1 14:24:25 2014 (r263996) @@ -166,20 +166,6 @@ _TARGET_ARCH= ${TARGET:S/pc98/i386/} ${TARGET_ARCH} != ${MACHINE_ARCH} _TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/} .endif -# Legacy names, for another transition period mips:mips(n32|64)?eb -> mips:mips\1 -.if defined(TARGET) && defined(TARGET_ARCH) && \ - ${TARGET} == "mips" && ${TARGET_ARCH:Mmips*eb} -_TARGET_ARCH= ${TARGET_ARCH:C/eb$//} -.warning "TARGET_ARCH of ${TARGET_ARCH} is deprecated in favor of ${_TARGET_ARCH}" -.endif -.if defined(TARGET) && ${TARGET} == "mips" && defined(TARGET_BIG_ENDIAN) -.warning "TARGET_BIG_ENDIAN is no longer necessary for MIPS. Big-endian is not the default." -.endif -# arm with TARGET_BIG_ENDIAN -> armeb -.if defined(TARGET_ARCH) && ${TARGET_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN) -.warning "TARGET_ARCH of arm with TARGET_BIG_ENDIAN is deprecated. use armeb" -_TARGET_ARCH=armeb -.endif .if defined(TARGET) && !defined(_TARGET) _TARGET=${TARGET} .endif From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 14:24:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECAD6E06; Tue, 1 Apr 2014 14:24:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9ADDA50; Tue, 1 Apr 2014 14:24:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31EOWlp015186; Tue, 1 Apr 2014 14:24:32 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31EOWZO015184; Tue, 1 Apr 2014 14:24:32 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404011424.s31EOWZO015184@svn.freebsd.org> From: Warner Losh Date: Tue, 1 Apr 2014 14:24:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263997 - in head: share/mk usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 14:24:33 -0000 Author: imp Date: Tue Apr 1 14:24:32 2014 New Revision: 263997 URL: http://svnweb.freebsd.org/changeset/base/263997 Log: Don't test WITHOUT_FOO in program makefiles, test MK_FOO instead. Modified: head/share/mk/bsd.own.mk head/usr.bin/grep/Makefile Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Tue Apr 1 14:24:25 2014 (r263996) +++ head/share/mk/bsd.own.mk Tue Apr 1 14:24:32 2014 (r263997) @@ -283,6 +283,7 @@ __DEFAULT_YES_OPTIONS = \ GCOV \ GDB \ GNU \ + GNU_GREP_COMPAT \ GPIB \ GPIO \ GPL_DTC \ @@ -310,6 +311,7 @@ __DEFAULT_YES_OPTIONS = \ LOCATE \ LPR \ LS_COLORS \ + LZMA_SUPPORT \ MAIL \ MAILWRAPPER \ MAKE \ Modified: head/usr.bin/grep/Makefile ============================================================================== --- head/usr.bin/grep/Makefile Tue Apr 1 14:24:25 2014 (r263996) +++ head/usr.bin/grep/Makefile Tue Apr 1 14:24:32 2014 (r263997) @@ -43,7 +43,7 @@ MLINKS= grep.1 egrep.1 \ LDADD= -lz DPADD= ${LIBZ} -.if !defined(WITHOUT_LZMA_SUPPORT) +.if ${MK_LZMA_SUPPORT} != "no" LDADD+= -llzma DPADD+= ${LIBLZMA} @@ -57,7 +57,7 @@ LINKS+= ${BINDIR}/${PROG} ${BINDIR}/xzgr CFLAGS+= -DWITHOUT_LZMA .endif -.if !defined(WITHOUT_BZIP2_SUPPORT) +.if ${MK_BZIP2_SUPPORT} != "no" LDADD+= -lbz2 DPADD+= ${LIBBZ2} @@ -73,13 +73,13 @@ MLINKS+= grep.1 bzgrep.1 \ CFLAGS+= -DWITHOUT_BZIP2 .endif -.if !defined(WITHOUT_GNU_COMPAT) +.if ${MK_GNU_GREP_COMPAT} != "no" CFLAGS+= -I${DESTDIR}/usr/include/gnu LDADD+= -lgnuregex DPADD+= ${LIBGNUREGEX} .endif -.if !defined(WITHOUT_NLS) +.if ${MK_NLS} != "no" .include "${.CURDIR}/nls/Makefile.inc" .else CFLAGS+= -DWITHOUT_NLS From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 14:45:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E22C66E for ; Tue, 1 Apr 2014 14:45:27 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1378BC55 for ; Tue, 1 Apr 2014 14:45:27 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s31EjQeV007201 for ; Tue, 1 Apr 2014 14:45:26 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s31EjQ4u007197 for svn-src-head@freebsd.org; Tue, 1 Apr 2014 14:45:26 GMT (envelope-from bdrewery) Received: (qmail 17690 invoked from network); 1 Apr 2014 09:45:22 -0500 Received: from unknown (HELO roundcube.xk42.net) (10.10.5.5) by sweb.xzibition.com with SMTP; 1 Apr 2014 09:45:22 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 01 Apr 2014 09:45:22 -0500 From: Bryan Drewery To: Mateusz Guzik Subject: Re: svn commit: r263981 - in head: lib/libc/gen sys/kern sys/sys Organization: FreeBSD In-Reply-To: <20140401012455.GA26117@dft-labs.eu> References: <20140401012455.GA26117@dft-labs.eu> Message-ID: <8fec12199b9480cbf1abaea126fa264e@shatow.net> X-Sender: bdrewery@FreeBSD.org User-Agent: Roundcube Webmail/0.9.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, owner-src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 14:45:27 -0000 On 2014-03-31 20:24, Mateusz Guzik wrote: > Author: mjg > Date: Tue Apr 1 03:20:35 2014 > > New Revision: 263981 > URL: http://svnweb.freebsd.org/changeset/base/263981 > > Log: > Add a new errno: EMACS - Editor too big. > > Make a best-effort to detect that Emacs is about to executed and > return > the error. > > MFC after: 1 week > > Modified: > head/lib/libc/gen/errlst.c > head/sys/kern/kern_exec.c > head/sys/sys/errno.h > > Modified: lib/libc/gen/errlst.c > =================================================================== > --- head/lib/libc/gen/errlst.c (263980) > +++ head/lib/libc/gen/errlst.c (263981) > @@ -155,6 +155,7 @@ > "Not permitted in capability mode", /* 94 - ECAPMODE */ > "State not recoverable", /* 95 - ENOTRECOVERABLE */ > "Previous owner died", /* 96 - EOWNERDEAD */ > + "Editor too big", /* 97 - EMACS */ > }; > const int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]); > > Modified: sys/kern/kern_exec.c > =================================================================== > --- head/sys/kern/kern_exec.c (263980) > +++ head/sys/kern/kern_exec.c (263981) > @@ -337,6 +337,7 @@ > int (*img_first)(struct image_params *); > struct pargs *oldargs = NULL, *newargs = NULL; > struct sigacts *oldsigacts, *newsigacts; > + char *e; > #ifdef KTRACE > struct vnode *tracevp = NULL; > struct ucred *tracecred = NULL; > @@ -418,6 +419,19 @@ > > SDT_PROBE(proc, kernel, , exec, args->fname, 0, 0, 0, 0 ); > > + /* > + * A best-effort to check whether the file to be run is EMACS > + */ > + if (args->fname != NULL) { > + e = args->fname + strlen(args->fname); > + while (e > args->fname && *e != '/') > + e--; > + if (strcasecmp(e, "/emacs") == 0) { > + error = EMACS; > + goto exec_fail; > + } > + } > + > interpret: > if (args->fname != NULL) { > #ifdef CAPABILITY_MODE > Modified: sys/sys/errno.h > =================================================================== > --- head/sys/sys/errno.h (263980) > +++ head/sys/sys/errno.h (263981) > @@ -178,10 +178,11 @@ > #define ECAPMODE 94 /* Not permitted in capability mode */ > #define ENOTRECOVERABLE 95 /* State not recoverable */ > #define EOWNERDEAD 96 /* Previous owner died */ > +#define EMACS 97 /* Editor too big */ > #endif /* _POSIX_SOURCE */ > > #ifndef _POSIX_SOURCE > -#define ELAST 96 /* Must be equal largest errno */ > +#define ELAST 97 /* Must be equal largest errno */ > #endif /* _POSIX_SOURCE */ > > #ifdef _KERNEL Don't forget errno(2): Index: lib/libc/sys/intro.2 =================================================================== --- lib/libc/sys/intro.2 (revision 263940) +++ lib/libc/sys/intro.2 (working copy) @@ -28,7 +28,7 @@ .\" @(#)intro.2 8.5 (Berkeley) 2/27/95 .\" $FreeBSD$ .\" -.Dd May 4, 2013 +.Dd April 1, 2014 .Dt INTRO 2 .Os .Sh NAME @@ -474,6 +474,8 @@ The state protected by a robust mutex is not recoverable. .It Er 96 EOWNERDEAD Em "Previous owner died" . The owner of a robust mutex terminated while holding the mutex lock. +.It Er 97 EMACS Em "Editor too big" . +Attempted to run EMACS. .El .Sh DEFINITIONS .Bl -tag -width Ds -- Regards, Bryan Drewery From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 14:46:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D01507BD; Tue, 1 Apr 2014 14:46:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAC7EC62; Tue, 1 Apr 2014 14:46:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31EkDsn023675; Tue, 1 Apr 2014 14:46:13 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31EkB81023663; Tue, 1 Apr 2014 14:46:11 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201404011446.s31EkB81023663@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 1 Apr 2014 14:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263998 - in head: include sys/arm/include sys/ia64/include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 14:46:13 -0000 Author: tijl Date: Tue Apr 1 14:46:11 2014 New Revision: 263998 URL: http://svnweb.freebsd.org/changeset/base/263998 Log: Rename __wchar_t so it no longer conflicts with __wchar_t from clang 3.4 -fms-extensions. MFC after: 2 weeks Modified: head/include/inttypes.h head/include/stddef.h head/include/stdlib.h head/include/wchar.h head/sys/arm/include/_types.h head/sys/ia64/include/_types.h head/sys/mips/include/_types.h head/sys/powerpc/include/_types.h head/sys/sparc64/include/_types.h head/sys/sys/stdatomic.h head/sys/x86/include/_types.h Modified: head/include/inttypes.h ============================================================================== --- head/include/inttypes.h Tue Apr 1 14:24:32 2014 (r263997) +++ head/include/inttypes.h Tue Apr 1 14:46:11 2014 (r263998) @@ -34,7 +34,7 @@ #ifndef __cplusplus #ifndef _WCHAR_T_DECLARED -typedef __wchar_t wchar_t; +typedef ___wchar_t wchar_t; #define _WCHAR_T_DECLARED #endif #endif Modified: head/include/stddef.h ============================================================================== --- head/include/stddef.h Tue Apr 1 14:24:32 2014 (r263997) +++ head/include/stddef.h Tue Apr 1 14:46:11 2014 (r263998) @@ -54,7 +54,7 @@ typedef __size_t size_t; #ifndef __cplusplus #ifndef _WCHAR_T_DECLARED -typedef __wchar_t wchar_t; +typedef ___wchar_t wchar_t; #define _WCHAR_T_DECLARED #endif #endif Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Tue Apr 1 14:24:32 2014 (r263997) +++ head/include/stdlib.h Tue Apr 1 14:46:11 2014 (r263998) @@ -51,7 +51,7 @@ typedef __size_t size_t; #ifndef __cplusplus #ifndef _WCHAR_T_DECLARED -typedef __wchar_t wchar_t; +typedef ___wchar_t wchar_t; #define _WCHAR_T_DECLARED #endif #endif Modified: head/include/wchar.h ============================================================================== --- head/include/wchar.h Tue Apr 1 14:24:32 2014 (r263997) +++ head/include/wchar.h Tue Apr 1 14:46:11 2014 (r263998) @@ -78,7 +78,7 @@ typedef __size_t size_t; #ifndef __cplusplus #ifndef _WCHAR_T_DECLARED -typedef __wchar_t wchar_t; +typedef ___wchar_t wchar_t; #define _WCHAR_T_DECLARED #endif #endif Modified: head/sys/arm/include/_types.h ============================================================================== --- head/sys/arm/include/_types.h Tue Apr 1 14:24:32 2014 (r263997) +++ head/sys/arm/include/_types.h Tue Apr 1 14:46:11 2014 (r263998) @@ -106,11 +106,11 @@ typedef __uint64_t __vm_pindex_t; typedef __uint32_t __vm_size_t; #ifdef __ARM_EABI__ -typedef unsigned int __wchar_t; +typedef unsigned int ___wchar_t; #define __WCHAR_MIN 0 /* min value for a wchar_t */ #define __WCHAR_MAX __UINT_MAX /* max value for a wchar_t */ #else -typedef int __wchar_t; +typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ #endif Modified: head/sys/ia64/include/_types.h ============================================================================== --- head/sys/ia64/include/_types.h Tue Apr 1 14:24:32 2014 (r263997) +++ head/sys/ia64/include/_types.h Tue Apr 1 14:46:11 2014 (r263998) @@ -96,7 +96,7 @@ typedef __int64_t __vm_ooffset_t; typedef __uint64_t __vm_paddr_t; typedef __uint64_t __vm_pindex_t; typedef __uint64_t __vm_size_t; -typedef int __wchar_t; +typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ Modified: head/sys/mips/include/_types.h ============================================================================== --- head/sys/mips/include/_types.h Tue Apr 1 14:24:32 2014 (r263997) +++ head/sys/mips/include/_types.h Tue Apr 1 14:46:11 2014 (r263998) @@ -145,7 +145,7 @@ typedef __uint32_t __vm_paddr_t; typedef __int64_t __vm_ooffset_t; typedef __uint64_t __vm_pindex_t; -typedef int __wchar_t; +typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ Modified: head/sys/powerpc/include/_types.h ============================================================================== --- head/sys/powerpc/include/_types.h Tue Apr 1 14:24:32 2014 (r263997) +++ head/sys/powerpc/include/_types.h Tue Apr 1 14:46:11 2014 (r263998) @@ -133,7 +133,7 @@ typedef __uint32_t __vm_size_t; #endif typedef __int64_t __vm_ooffset_t; typedef __uint64_t __vm_pindex_t; -typedef int __wchar_t; +typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ Modified: head/sys/sparc64/include/_types.h ============================================================================== --- head/sys/sparc64/include/_types.h Tue Apr 1 14:24:32 2014 (r263997) +++ head/sys/sparc64/include/_types.h Tue Apr 1 14:46:11 2014 (r263998) @@ -92,7 +92,7 @@ typedef __int64_t __vm_ooffset_t; typedef __uint64_t __vm_paddr_t; typedef __uint64_t __vm_pindex_t; typedef __uint64_t __vm_size_t; -typedef int __wchar_t; +typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ Modified: head/sys/sys/stdatomic.h ============================================================================== --- head/sys/sys/stdatomic.h Tue Apr 1 14:24:32 2014 (r263997) +++ head/sys/sys/stdatomic.h Tue Apr 1 14:46:11 2014 (r263998) @@ -198,7 +198,7 @@ typedef _Atomic(long long) atomic_llong typedef _Atomic(unsigned long long) atomic_ullong; typedef _Atomic(__char16_t) atomic_char16_t; typedef _Atomic(__char32_t) atomic_char32_t; -typedef _Atomic(__wchar_t) atomic_wchar_t; +typedef _Atomic(___wchar_t) atomic_wchar_t; typedef _Atomic(__int_least8_t) atomic_int_least8_t; typedef _Atomic(__uint_least8_t) atomic_uint_least8_t; typedef _Atomic(__int_least16_t) atomic_int_least16_t; Modified: head/sys/x86/include/_types.h ============================================================================== --- head/sys/x86/include/_types.h Tue Apr 1 14:24:32 2014 (r263997) +++ head/sys/x86/include/_types.h Tue Apr 1 14:46:11 2014 (r263998) @@ -142,7 +142,7 @@ typedef __uint32_t __vm_size_t; #endif typedef __int64_t __vm_ooffset_t; typedef __uint64_t __vm_pindex_t; -typedef int __wchar_t; +typedef int ___wchar_t; #define __WCHAR_MIN __INT_MIN /* min value for a wchar_t */ #define __WCHAR_MAX __INT_MAX /* max value for a wchar_t */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 14:48:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30DB0D19; Tue, 1 Apr 2014 14:48:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E189C96; Tue, 1 Apr 2014 14:48:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31EmG9f024000; Tue, 1 Apr 2014 14:48:16 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31EmGoa023999; Tue, 1 Apr 2014 14:48:16 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404011448.s31EmGoa023999@svn.freebsd.org> From: Glen Barber Date: Tue, 1 Apr 2014 14:48:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264000 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 14:48:17 -0000 Author: gjb Date: Tue Apr 1 14:48:16 2014 New Revision: 264000 URL: http://svnweb.freebsd.org/changeset/base/264000 Log: Add the svn revision number to the IPX note. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Apr 1 14:48:10 2014 (r263999) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Apr 1 14:48:16 2014 (r264000) @@ -191,9 +191,9 @@ Network Protocols - Support for the IPX network transport protocol has - been removed, and will not be supported in &os; 11 - and later releases. + Support for the IPX network transport + protocol has been removed, and will not be supported in + &os; 11 and later releases. From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 14:49:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1BA68E5E; Tue, 1 Apr 2014 14:49:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 074F4CA5; Tue, 1 Apr 2014 14:49:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31EnRis024194; Tue, 1 Apr 2014 14:49:27 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31EnQYx024184; Tue, 1 Apr 2014 14:49:26 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201404011449.s31EnQYx024184@svn.freebsd.org> From: Ryan Stone Date: Tue, 1 Apr 2014 14:49:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264001 - in head/sys: conf dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 14:49:28 -0000 Author: rstone Date: Tue Apr 1 14:49:25 2014 New Revision: 264001 URL: http://svnweb.freebsd.org/changeset/base/264001 Log: Add a method to get the PCI Routing ID for a device Reviewed by: kib Sponsored by: Sandvine, Inc Added: head/sys/dev/pci/pcib_support.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/pci/pci.c head/sys/dev/pci/pci_if.m head/sys/dev/pci/pci_pci.c head/sys/dev/pci/pcib_if.m head/sys/dev/pci/pcib_private.h head/sys/dev/pci/pcireg.h head/sys/dev/pci/pcivar.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Apr 1 14:48:16 2014 (r264000) +++ head/sys/conf/files Tue Apr 1 14:49:25 2014 (r264001) @@ -1951,6 +1951,7 @@ dev/pci/pci_pci.c optional pci dev/pci/pci_subr.c optional pci dev/pci/pci_user.c optional pci dev/pci/pcib_if.m standard +dev/pci/pcib_support.c standard dev/pci/vga_pci.c optional pci dev/pcn/if_pcn.c optional pcn pci dev/pdq/if_fea.c optional fea eisa Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Apr 1 14:48:16 2014 (r264000) +++ head/sys/dev/pci/pci.c Tue Apr 1 14:49:25 2014 (r264001) @@ -124,6 +124,8 @@ static void pci_resume_msix(device_t de static int pci_remap_intr_method(device_t bus, device_t dev, u_int irq); +static uint16_t pci_get_rid_method(device_t dev, device_t child); + static device_method_t pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, pci_probe), @@ -182,6 +184,7 @@ static device_method_t pci_methods[] = { DEVMETHOD(pci_release_msi, pci_release_msi_method), DEVMETHOD(pci_msi_count, pci_msi_count_method), DEVMETHOD(pci_msix_count, pci_msix_count_method), + DEVMETHOD(pci_get_rid, pci_get_rid_method), DEVMETHOD_END }; @@ -351,6 +354,11 @@ SYSCTL_INT(_hw_pci, OID_AUTO, clear_buse "Ignore firmware-assigned bus numbers."); #endif +static int pci_enable_ari = 1; +TUNABLE_INT("hw.pci.enable_ari", &pci_enable_ari); +SYSCTL_INT(_hw_pci, OID_AUTO, enable_ari, CTLFLAG_RDTUN, &pci_enable_ari, + 0, "Enable support for PCIe Alternative RID Interpretation"); + static int pci_has_quirk(uint32_t devid, int quirk) { @@ -3451,6 +3459,19 @@ pci_add_resources(device_t bus, device_t #endif } +static struct pci_devinfo * +pci_identify_function(device_t pcib, device_t dev, int domain, int busno, + int slot, int func, size_t dinfo_size) +{ + struct pci_devinfo *dinfo; + + dinfo = pci_read_device(pcib, domain, busno, slot, func, dinfo_size); + if (dinfo != NULL) + pci_add_child(dev, dinfo); + + return (dinfo); +} + void pci_add_children(device_t dev, int domain, int busno, size_t dinfo_size) { @@ -3460,6 +3481,24 @@ pci_add_children(device_t dev, int domai int maxslots; int s, f, pcifunchigh; uint8_t hdrtype; + int first_func; + + /* + * Try to detect a device at slot 0, function 0. If it exists, try to + * enable ARI. We must enable ARI before detecting the rest of the + * functions on this bus as ARI changes the set of slots and functions + * that are legal on this bus. + */ + dinfo = pci_identify_function(pcib, dev, domain, busno, 0, 0, + dinfo_size); + if (dinfo != NULL && pci_enable_ari) + PCIB_TRY_ENABLE_ARI(pcib, dinfo->cfg.dev); + + /* + * Start looking for new devices on slot 0 at function 1 because we + * just identified the device at slot 0, function 0. + */ + first_func = 1; KASSERT(dinfo_size >= sizeof(struct pci_devinfo), ("dinfo_size too small")); @@ -3472,14 +3511,13 @@ pci_add_children(device_t dev, int domai if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE) continue; if (hdrtype & PCIM_MFDEV) - pcifunchigh = PCI_FUNCMAX; - for (f = 0; f <= pcifunchigh; f++) { - dinfo = pci_read_device(pcib, domain, busno, s, f, + pcifunchigh = PCIB_MAXFUNCS(pcib); + for (f = first_func; f <= pcifunchigh; f++) + pci_identify_function(pcib, dev, domain, busno, s, f, dinfo_size); - if (dinfo != NULL) { - pci_add_child(dev, dinfo); - } - } + + /* For slots after slot 0 we need to check for function 0. */ + first_func = 0; } #undef REG } @@ -5055,3 +5093,10 @@ pci_restore_state(device_t dev) dinfo = device_get_ivars(dev); pci_cfg_restore(dev, dinfo); } + +static uint16_t +pci_get_rid_method(device_t dev, device_t child) +{ + + return (PCIB_GET_RID(device_get_parent(dev), child)); +} Modified: head/sys/dev/pci/pci_if.m ============================================================================== --- head/sys/dev/pci/pci_if.m Tue Apr 1 14:48:16 2014 (r264000) +++ head/sys/dev/pci/pci_if.m Tue Apr 1 14:49:25 2014 (r264001) @@ -159,3 +159,9 @@ METHOD int msix_count { device_t dev; device_t child; } DEFAULT null_msi_count; + +METHOD uint16_t get_rid { + device_t dev; + device_t child; +}; + Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Tue Apr 1 14:48:16 2014 (r264000) +++ head/sys/dev/pci/pci_pci.c Tue Apr 1 14:49:25 2014 (r264001) @@ -56,6 +56,14 @@ static int pcib_suspend(device_t dev); static int pcib_resume(device_t dev); static int pcib_power_for_sleep(device_t pcib, device_t dev, int *pstate); +static uint32_t pcib_read_config(device_t dev, u_int b, u_int s, + u_int f, u_int reg, int width); +static void pcib_write_config(device_t dev, u_int b, u_int s, + u_int f, u_int reg, uint32_t val, int width); +static int pcib_ari_maxslots(device_t dev); +static int pcib_ari_maxfuncs(device_t dev); +static int pcib_try_enable_ari(device_t pcib, device_t dev); + static device_method_t pcib_methods[] = { /* Device interface */ @@ -83,7 +91,8 @@ static device_method_t pcib_methods[] = DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), /* pcib interface */ - DEVMETHOD(pcib_maxslots, pcib_maxslots), + DEVMETHOD(pcib_maxslots, pcib_ari_maxslots), + DEVMETHOD(pcib_maxfuncs, pcib_ari_maxfuncs), DEVMETHOD(pcib_read_config, pcib_read_config), DEVMETHOD(pcib_write_config, pcib_write_config), DEVMETHOD(pcib_route_interrupt, pcib_route_interrupt), @@ -93,6 +102,7 @@ static device_method_t pcib_methods[] = DEVMETHOD(pcib_release_msix, pcib_release_msix), DEVMETHOD(pcib_map_msi, pcib_map_msi), DEVMETHOD(pcib_power_for_sleep, pcib_power_for_sleep), + DEVMETHOD(pcib_try_enable_ari, pcib_try_enable_ari), DEVMETHOD_END }; @@ -1802,27 +1812,103 @@ pcib_alloc_resource(device_t dev, device #endif /* + * If ARI is enabled on this downstream port, translate the function number + * to the non-ARI slot/function. The downstream port will convert it back in + * hardware. If ARI is not enabled slot and func are not modified. + */ +static __inline void +pcib_xlate_ari(device_t pcib, int bus, int *slot, int *func) +{ + struct pcib_softc *sc; + int ari_func; + + sc = device_get_softc(pcib); + ari_func = *func; + + if (sc->flags & PCIB_ENABLE_ARI) { + KASSERT(*slot == 0, + ("Non-zero slot number with ARI enabled!")); + *slot = PCIE_ARI_SLOT(ari_func); + *func = PCIE_ARI_FUNC(ari_func); + } +} + + +static void +pcib_enable_ari(struct pcib_softc *sc, uint32_t pcie_pos) +{ + uint32_t ctl2; + + ctl2 = pci_read_config(sc->dev, pcie_pos + PCIER_DEVICE_CTL2, 4); + ctl2 |= PCIEM_CTL2_ARI; + pci_write_config(sc->dev, pcie_pos + PCIER_DEVICE_CTL2, ctl2, 4); + + sc->flags |= PCIB_ENABLE_ARI; + + if (bootverbose) + device_printf(sc->dev, "Enable ARI\n"); +} + +/* * PCIB interface. */ int pcib_maxslots(device_t dev) { - return(PCI_SLOTMAX); + return (PCI_SLOTMAX); +} + +int +pcib_maxfuncs(device_t dev) +{ + return (PCI_FUNCMAX); +} + +static int +pcib_ari_maxslots(device_t dev) +{ + struct pcib_softc *sc; + + sc = device_get_softc(dev); + + if (sc->flags & PCIB_ENABLE_ARI) + return (PCIE_ARI_SLOTMAX); + else + return (PCI_SLOTMAX); +} + +static int +pcib_ari_maxfuncs(device_t dev) +{ + struct pcib_softc *sc; + + sc = device_get_softc(dev); + + if (sc->flags & PCIB_ENABLE_ARI) + return (PCIE_ARI_FUNCMAX); + else + return (PCI_FUNCMAX); } /* * Since we are a child of a PCI bus, its parent must support the pcib interface. */ -uint32_t +static uint32_t pcib_read_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, int width) { - return(PCIB_READ_CONFIG(device_get_parent(device_get_parent(dev)), b, s, f, reg, width)); + + pcib_xlate_ari(dev, b, &s, &f); + return(PCIB_READ_CONFIG(device_get_parent(device_get_parent(dev)), b, s, + f, reg, width)); } -void +static void pcib_write_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, uint32_t val, int width) { - PCIB_WRITE_CONFIG(device_get_parent(device_get_parent(dev)), b, s, f, reg, val, width); + + pcib_xlate_ari(dev, b, &s, &f); + PCIB_WRITE_CONFIG(device_get_parent(device_get_parent(dev)), b, s, f, + reg, val, width); } /* @@ -1934,3 +2020,61 @@ pcib_power_for_sleep(device_t pcib, devi bus = device_get_parent(pcib); return (PCIB_POWER_FOR_SLEEP(bus, dev, pstate)); } + + +/* + * Check that the downstream port (pcib) and the endpoint device (dev) both + * support ARI. If so, enable it and return 0, otherwise return an error. + */ +static int +pcib_try_enable_ari(device_t pcib, device_t dev) +{ + struct pcib_softc *sc; + int error; + uint32_t cap2; + int ari_cap_off; + uint32_t ari_ver; + uint32_t pcie_pos; + + sc = device_get_softc(pcib); + + /* + * ARI is controlled in a register in the PCIe capability structure. + * If the downstream port does not have the PCIe capability structure + * then it does not support ARI. + */ + error = pci_find_cap(pcib, PCIY_EXPRESS, &pcie_pos); + if (error != 0) + return (ENODEV); + + /* Check that the PCIe port advertises ARI support. */ + cap2 = pci_read_config(pcib, pcie_pos + PCIER_DEVICE_CAP2, 4); + if (!(cap2 & PCIEM_CAP2_ARI)) + return (ENODEV); + + /* + * Check that the endpoint device advertises ARI support via the ARI + * extended capability structure. + */ + error = pci_find_extcap(dev, PCIZ_ARI, &ari_cap_off); + if (error != 0) + return (ENODEV); + + /* + * Finally, check that the endpoint device supports the same version + * of ARI that we do. + */ + ari_ver = pci_read_config(dev, ari_cap_off, 4); + if (PCI_EXTCAP_VER(ari_ver) != PCIB_SUPPORTED_ARI_VER) { + if (bootverbose) + device_printf(pcib, + "Unsupported version of ARI (%d) detected\n", + PCI_EXTCAP_VER(ari_ver)); + + return (ENXIO); + } + + pcib_enable_ari(sc, pcie_pos); + + return (0); +} Modified: head/sys/dev/pci/pcib_if.m ============================================================================== --- head/sys/dev/pci/pcib_if.m Tue Apr 1 14:48:16 2014 (r264000) +++ head/sys/dev/pci/pcib_if.m Tue Apr 1 14:49:25 2014 (r264001) @@ -47,6 +47,14 @@ METHOD int maxslots { }; # +# +# Return the number of functions on the attached PCI bus. +# +METHOD int maxfuncs { + device_t dev; +} default pcib_maxfuncs; + +# # Read configuration space on the PCI bus. The bus, slot and func # arguments determine the device which is being read and the reg # argument is a byte offset into configuration space for that @@ -154,3 +162,21 @@ METHOD int power_for_sleep { device_t dev; int *pstate; }; + +# +# Return the PCI Routing Identifier (RID) for the device. +# +METHOD uint16_t get_rid { + device_t pcib; + device_t dev; +}; + + +# +# Enable Alternative RID Interpretation if both the downstream port (pcib) +# and the endpoint device (dev) both support it. +# +METHOD int try_enable_ari { + device_t pcib; + device_t dev; +}; Modified: head/sys/dev/pci/pcib_private.h ============================================================================== --- head/sys/dev/pci/pcib_private.h Tue Apr 1 14:48:16 2014 (r264000) +++ head/sys/dev/pci/pcib_private.h Tue Apr 1 14:49:25 2014 (r264001) @@ -105,6 +105,7 @@ struct pcib_softc #define PCIB_SUBTRACTIVE 0x1 #define PCIB_DISABLE_MSI 0x2 #define PCIB_DISABLE_MSIX 0x4 +#define PCIB_ENABLE_ARI 0x8 uint16_t command; /* command register */ u_int domain; /* domain number */ u_int pribus; /* primary bus number */ @@ -126,6 +127,8 @@ struct pcib_softc uint8_t seclat; /* secondary bus latency timer */ }; +#define PCIB_SUPPORTED_ARI_VER 1 + typedef uint32_t pci_read_config_fn(int b, int s, int f, int reg, int width); int host_pcib_get_busno(pci_read_config_fn read_config, int bus, @@ -159,13 +162,14 @@ int pcib_release_resource(device_t dev, struct resource *r); #endif int pcib_maxslots(device_t dev); -uint32_t pcib_read_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, int width); -void pcib_write_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, uint32_t val, int width); +int pcib_maxfuncs(device_t dev); int pcib_route_interrupt(device_t pcib, device_t dev, int pin); int pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs); int pcib_release_msi(device_t pcib, device_t dev, int count, int *irqs); int pcib_alloc_msix(device_t pcib, device_t dev, int *irq); int pcib_release_msix(device_t pcib, device_t dev, int irq); int pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data); +uint16_t pcib_get_rid(device_t pcib, device_t dev); + #endif Added: head/sys/dev/pci/pcib_support.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/pci/pcib_support.c Tue Apr 1 14:49:25 2014 (r264001) @@ -0,0 +1,62 @@ +/* + * Copyright (c) Sandvine Inc. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Support functions for the PCI:PCI bridge driver. This has to be in a + * separate file because kernel configurations end up referencing the functions + * here even when pci support is compiled out of the kernel. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "pcib_if.h" + +uint16_t +pcib_get_rid(device_t pcib, device_t dev) +{ + uint8_t bus, slot, func; + + bus = pci_get_bus(dev); + slot = pci_get_slot(dev); + func = pci_get_function(dev); + + return (PCI_RID(bus, slot, func)); +} + Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Tue Apr 1 14:48:16 2014 (r264000) +++ head/sys/dev/pci/pcireg.h Tue Apr 1 14:49:25 2014 (r264001) @@ -48,6 +48,29 @@ #define PCIE_REGMAX 4095 /* highest supported config register addr. */ #define PCI_MAXHDRTYPE 2 +#define PCIE_ARI_SLOTMAX 0 +#define PCIE_ARI_FUNCMAX 255 + +#define PCIE_ARI_SLOT(func) (((func) >> 3) & PCI_SLOTMAX) +#define PCIE_ARI_FUNC(func) ((func) & PCI_FUNCMAX) + +#define PCI_RID_BUS_SHIFT 8 +#define PCI_RID_SLOT_SHIFT 3 +#define PCI_RID_FUNC_SHIFT 0 + +#define PCI_RID(bus, slot, func) \ + ((((bus) & PCI_BUSMAX) << PCI_RID_BUS_SHIFT) | \ + (((slot) & PCI_SLOTMAX) << PCI_RID_SLOT_SHIFT) | \ + (((func) & PCI_FUNCMAX) << PCI_RID_FUNC_SHIFT)) + +#define PCI_ARI_RID(bus, func) \ + ((((bus) & PCI_BUSMAX) << PCI_RID_BUS_SHIFT) | \ + (((func) & PCIE_ARI_FUNCMAX) << PCI_RID_FUNC_SHIFT)) + +#define PCI_RID2BUS(rid) (((rid) >> PCI_RID_BUS_SHIFT) & PCI_BUSMAX) +#define PCI_RID2SLOT(rid) (((rid) >> PCI_RID_SLOT_SHIFT) & PCI_SLOTMAX) +#define PCI_RID2FUNC(rid) (((rid) >> PCI_RID_FUNC_SHIFT) & PCI_FUNCMAX) + /* PCI config header registers for all devices */ #define PCIR_DEVVENDOR 0x00 @@ -774,6 +797,7 @@ #define PCIEM_ROOT_STA_PME_STATUS 0x00010000 #define PCIEM_ROOT_STA_PME_PEND 0x00020000 #define PCIER_DEVICE_CAP2 0x24 +#define PCIEM_CAP2_ARI 0x20 #define PCIER_DEVICE_CTL2 0x28 #define PCIEM_CTL2_COMP_TIMEOUT_VAL 0x000f #define PCIEM_CTL2_COMP_TIMEOUT_DIS 0x0010 @@ -894,3 +918,4 @@ /* Serial Number definitions */ #define PCIR_SERIAL_LOW 0x04 #define PCIR_SERIAL_HIGH 0x08 + Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Tue Apr 1 14:48:16 2014 (r264000) +++ head/sys/dev/pci/pcivar.h Tue Apr 1 14:49:25 2014 (r264001) @@ -482,6 +482,12 @@ pci_msix_count(device_t dev) return (PCI_MSIX_COUNT(device_get_parent(dev), dev)); } +static __inline uint16_t +pci_get_rid(device_t dev) +{ + return (PCI_GET_RID(device_get_parent(dev), 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); From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 14:51:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B93B2BA; Tue, 1 Apr 2014 14:51:27 +0000 (UTC) Received: from mail-we0-x22e.google.com (mail-we0-x22e.google.com [IPv6:2a00:1450:400c:c03::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91151DA1; Tue, 1 Apr 2014 14:51:26 +0000 (UTC) Received: by mail-we0-f174.google.com with SMTP id t60so6483982wes.33 for ; Tue, 01 Apr 2014 07:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ZGgNAHS1psNty9OllNI158/FsecA1gHbWD8COWl4VOM=; b=QE4FCfSFfOFPuk4IOqwrh9PnKcgJT+MqcnXskv/XHN/ySEKYD79B6uuw1A8ni8oA79 wCtG7O/m6f9xeZQdrAVuPK2s+tCRvRmkTm8tZttW4TjGfD8RV8LXIXX1rv52Bgaqm2oq 0UaYn1pNRKmX+OeXiXdq71r+pScKeiIy4WHVXOspe6N6T9Tu4uicMmEqv2EGQ56AZRZX YsSy76Z0MlhBUnSnCNNtj9WvkPp+diLzd3ENMEbR2EVGYr+FoIFtxC/u2L9Co0veaXC9 SOxsDZkuqaCUTJ/8RO89lgQyQ82XJacb4sPupNQyNqXDfSjDIhk9ZAghhFWofV7In3B2 ixYQ== MIME-Version: 1.0 X-Received: by 10.180.89.102 with SMTP id bn6mr20576787wib.28.1396363884721; Tue, 01 Apr 2014 07:51:24 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.217.140.73 with HTTP; Tue, 1 Apr 2014 07:51:24 -0700 (PDT) In-Reply-To: <8fec12199b9480cbf1abaea126fa264e@shatow.net> References: <20140401012455.GA26117@dft-labs.eu> <8fec12199b9480cbf1abaea126fa264e@shatow.net> Date: Tue, 1 Apr 2014 18:51:24 +0400 X-Google-Sender-Auth: JYDltNJ2n7MLtR9tcznqyPvQWPs Message-ID: Subject: Re: svn commit: r263981 - in head: lib/libc/gen sys/kern sys/sys From: Sergey Kandaurov To: Bryan Drewery Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik , owner-src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 14:51:27 -0000 On 1 April 2014 18:45, Bryan Drewery wrote: > On 2014-03-31 20:24, Mateusz Guzik wrote: >> >> Author: mjg >> Date: Tue Apr 1 03:20:35 2014 >> >> New Revision: 263981 >> URL: http://svnweb.freebsd.org/changeset/base/263981 >> >> Log: >> Add a new errno: EMACS - Editor too big. >> >> Make a best-effort to detect that Emacs is about to executed and return >> the error. >> >> MFC after: 1 week >> >> Modified: >> head/lib/libc/gen/errlst.c >> head/sys/kern/kern_exec.c >> head/sys/sys/errno.h >> >> Modified: lib/libc/gen/errlst.c >> =================================================================== >> --- head/lib/libc/gen/errlst.c (263980) >> +++ head/lib/libc/gen/errlst.c (263981) >> @@ -155,6 +155,7 @@ >> "Not permitted in capability mode", /* 94 - ECAPMODE */ >> "State not recoverable", /* 95 - ENOTRECOVERABLE */ >> "Previous owner died", /* 96 - EOWNERDEAD */ >> + "Editor too big", /* 97 - EMACS */ >> }; >> const int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]); >> >> Modified: sys/kern/kern_exec.c >> =================================================================== >> --- head/sys/kern/kern_exec.c (263980) >> +++ head/sys/kern/kern_exec.c (263981) >> @@ -337,6 +337,7 @@ >> int (*img_first)(struct image_params *); >> struct pargs *oldargs = NULL, *newargs = NULL; >> struct sigacts *oldsigacts, *newsigacts; >> + char *e; >> #ifdef KTRACE >> struct vnode *tracevp = NULL; >> struct ucred *tracecred = NULL; >> @@ -418,6 +419,19 @@ >> >> SDT_PROBE(proc, kernel, , exec, args->fname, 0, 0, 0, 0 ); >> >> + /* >> + * A best-effort to check whether the file to be run is EMACS >> + */ >> + if (args->fname != NULL) { >> + e = args->fname + strlen(args->fname); >> + while (e > args->fname && *e != '/') >> + e--; >> + if (strcasecmp(e, "/emacs") == 0) { >> + error = EMACS; >> + goto exec_fail; >> + } >> + } >> + >> interpret: >> if (args->fname != NULL) { >> #ifdef CAPABILITY_MODE >> Modified: sys/sys/errno.h >> =================================================================== >> --- head/sys/sys/errno.h (263980) >> +++ head/sys/sys/errno.h (263981) >> @@ -178,10 +178,11 @@ >> #define ECAPMODE 94 /* Not permitted in >> capability mode */ >> #define ENOTRECOVERABLE 95 /* State not recoverable >> */ >> #define EOWNERDEAD 96 /* Previous owner died */ >> +#define EMACS 97 /* Editor too big */ >> #endif /* _POSIX_SOURCE */ >> >> #ifndef _POSIX_SOURCE >> -#define ELAST 96 /* Must be equal largest >> errno */ >> +#define ELAST 97 /* Must be equal largest >> errno */ >> #endif /* _POSIX_SOURCE */ >> >> #ifdef _KERNEL > > > Don't forget errno(2): > As well as lib/libc/nls/C.msg -- wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 14:51:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 172FC1FF; Tue, 1 Apr 2014 14:51:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 031ADDA9; Tue, 1 Apr 2014 14:51:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31Epked025945; Tue, 1 Apr 2014 14:51:46 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31Epj72025214; Tue, 1 Apr 2014 14:51:45 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201404011451.s31Epj72025214@svn.freebsd.org> From: Ryan Stone Date: Tue, 1 Apr 2014 14:51:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264002 - head/sys/x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 14:51:47 -0000 Author: rstone Date: Tue Apr 1 14:51:45 2014 New Revision: 264002 URL: http://svnweb.freebsd.org/changeset/base/264002 Log: Re-implement the DMAR I/O MMU code in terms of PCI RIDs Under the hood the VT-d spec is really implemented in terms of PCI RIDs instead of bus/slot/function, even though the spec makes pains to convert back to bus/slot/function in examples. However working with bus/slot/function is not correct when PCI ARI is in use, so convert to using RIDs in most cases. bus/slot/function will only be used when reporting errors to a user. Reviewed by: kib Sponsored by: Sandvine Inc. Modified: head/sys/x86/iommu/busdma_dmar.c head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_drv.c head/sys/x86/iommu/intel_fault.c head/sys/x86/iommu/intel_utils.c Modified: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Tue Apr 1 14:49:25 2014 (r264001) +++ head/sys/x86/iommu/busdma_dmar.c Tue Apr 1 14:51:45 2014 (r264002) @@ -93,7 +93,7 @@ dmar_bus_dma_is_dev_disabled(int domain, * bounce mapping. */ static device_t -dmar_get_requester(device_t dev, int *bus, int *slot, int *func) +dmar_get_requester(device_t dev, uint16_t *rid) { devclass_t pci_class; device_t pci, pcib, requester; @@ -102,9 +102,7 @@ dmar_get_requester(device_t dev, int *bu pci_class = devclass_find("pci"); requester = dev; - *bus = pci_get_bus(dev); - *slot = pci_get_slot(dev); - *func = pci_get_function(dev); + *rid = pci_get_rid(dev); /* * Walk the bridge hierarchy from the target device to the @@ -161,8 +159,7 @@ dmar_get_requester(device_t dev, int *bu * same page tables for taken and * non-taken transactions. */ - *bus = pci_get_bus(dev); - *slot = *func = 0; + *rid = PCI_RID(pci_get_bus(dev), 0, 0); } else { /* * Neither the device nor the bridge @@ -171,9 +168,7 @@ dmar_get_requester(device_t dev, int *bu * will use the bridge's BSF as the * requester ID. */ - *bus = pci_get_bus(pcib); - *slot = pci_get_slot(pcib); - *func = pci_get_function(pcib); + *rid = pci_get_rid(pcib); } } /* @@ -193,9 +188,9 @@ dmar_instantiate_ctx(struct dmar_unit *d device_t requester; struct dmar_ctx *ctx; bool disabled; - int bus, slot, func; + uint16_t rid; - requester = dmar_get_requester(dev, &bus, &slot, &func); + requester = dmar_get_requester(dev, &rid); /* * If the user requested the IOMMU disabled for the device, we @@ -204,9 +199,10 @@ dmar_instantiate_ctx(struct dmar_unit *d * Instead provide the identity mapping for the device * context. */ - disabled = dmar_bus_dma_is_dev_disabled(pci_get_domain(dev), bus, - slot, func); - ctx = dmar_get_ctx(dmar, requester, bus, slot, func, disabled, rmrr); + disabled = dmar_bus_dma_is_dev_disabled(pci_get_domain(requester), + pci_get_bus(requester), pci_get_slot(requester), + pci_get_function(requester)); + ctx = dmar_get_ctx(dmar, requester, rid, disabled, rmrr); if (ctx == NULL) return (NULL); if (disabled) { Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Tue Apr 1 14:49:25 2014 (r264001) +++ head/sys/x86/iommu/intel_ctx.c Tue Apr 1 14:51:45 2014 (r264002) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include static MALLOC_DEFINE(M_DMAR_CTX, "dmar_ctx", "Intel DMAR Context"); @@ -105,14 +106,14 @@ dmar_map_ctx_entry(struct dmar_ctx *ctx, { dmar_ctx_entry_t *ctxp; - ctxp = dmar_map_pgtbl(ctx->dmar->ctx_obj, 1 + ctx->bus, + ctxp = dmar_map_pgtbl(ctx->dmar->ctx_obj, 1 + PCI_RID2BUS(ctx->rid), DMAR_PGF_NOALLOC | DMAR_PGF_WAITOK, sfp); - ctxp += ((ctx->slot & 0x1f) << 3) + (ctx->func & 0x7); + ctxp += ctx->rid & 0xff; return (ctxp); } static void -ctx_tag_init(struct dmar_ctx *ctx) +ctx_tag_init(struct dmar_ctx *ctx, device_t dev) { bus_addr_t maxaddr; @@ -126,6 +127,7 @@ ctx_tag_init(struct dmar_ctx *ctx) ctx->ctx_tag.common.nsegments = BUS_SPACE_UNRESTRICTED; ctx->ctx_tag.common.maxsegsz = maxaddr; ctx->ctx_tag.ctx = ctx; + ctx->ctx_tag.owner = dev; /* XXXKIB initialize tag further */ } @@ -138,7 +140,10 @@ ctx_id_entry_init(struct dmar_ctx *ctx, unit = ctx->dmar; KASSERT(ctxp->ctx1 == 0 && ctxp->ctx2 == 0, ("dmar%d: initialized ctx entry %d:%d:%d 0x%jx 0x%jx", - unit->unit, ctx->bus, ctx->slot, ctx->func, ctxp->ctx1, + unit->unit, pci_get_bus(ctx->ctx_tag.owner), + pci_get_slot(ctx->ctx_tag.owner), + pci_get_function(ctx->ctx_tag.owner), + ctxp->ctx1, ctxp->ctx2)); ctxp->ctx2 = DMAR_CTX2_DID(ctx->domain); ctxp->ctx2 |= ctx->awlvl; @@ -227,7 +232,7 @@ ctx_init_rmrr(struct dmar_ctx *ctx, devi } static struct dmar_ctx * -dmar_get_ctx_alloc(struct dmar_unit *dmar, int bus, int slot, int func) +dmar_get_ctx_alloc(struct dmar_unit *dmar, uint16_t rid) { struct dmar_ctx *ctx; @@ -237,9 +242,7 @@ dmar_get_ctx_alloc(struct dmar_unit *dma TASK_INIT(&ctx->unload_task, 0, dmar_ctx_unload_task, ctx); mtx_init(&ctx->lock, "dmarctx", NULL, MTX_DEF); ctx->dmar = dmar; - ctx->bus = bus; - ctx->slot = slot; - ctx->func = func; + ctx->rid = rid; return (ctx); } @@ -262,19 +265,22 @@ dmar_ctx_dtr(struct dmar_ctx *ctx, bool } struct dmar_ctx * -dmar_get_ctx(struct dmar_unit *dmar, device_t dev, int bus, int slot, int func, - bool id_mapped, bool rmrr_init) +dmar_get_ctx(struct dmar_unit *dmar, device_t dev, uint16_t rid, bool id_mapped, + bool rmrr_init) { struct dmar_ctx *ctx, *ctx1; dmar_ctx_entry_t *ctxp; struct sf_buf *sf; - int error, mgaw; + int bus, slot, func, error, mgaw; bool enable; + bus = pci_get_bus(dev); + slot = pci_get_slot(dev); + func = pci_get_function(dev); enable = false; TD_PREP_PINNED_ASSERT; DMAR_LOCK(dmar); - ctx = dmar_find_ctx_locked(dmar, bus, slot, func); + ctx = dmar_find_ctx_locked(dmar, rid); error = 0; if (ctx == NULL) { /* @@ -283,7 +289,7 @@ dmar_get_ctx(struct dmar_unit *dmar, dev */ DMAR_UNLOCK(dmar); dmar_ensure_ctx_page(dmar, bus); - ctx1 = dmar_get_ctx_alloc(dmar, bus, slot, func); + ctx1 = dmar_get_ctx_alloc(dmar, rid); if (id_mapped) { /* @@ -351,7 +357,7 @@ dmar_get_ctx(struct dmar_unit *dmar, dev * Recheck the contexts, other thread might have * already allocated needed one. */ - ctx = dmar_find_ctx_locked(dmar, bus, slot, func); + ctx = dmar_find_ctx_locked(dmar, rid); if (ctx == NULL) { ctx = ctx1; ctx->ctx_tag.owner = dev; @@ -363,7 +369,7 @@ dmar_get_ctx(struct dmar_unit *dmar, dev TD_PINNED_ASSERT; return (NULL); } - ctx_tag_init(ctx); + ctx_tag_init(ctx, dev); /* * This is the first activated context for the @@ -524,14 +530,14 @@ dmar_free_ctx(struct dmar_ctx *ctx) } struct dmar_ctx * -dmar_find_ctx_locked(struct dmar_unit *dmar, int bus, int slot, int func) +dmar_find_ctx_locked(struct dmar_unit *dmar, uint16_t rid) { struct dmar_ctx *ctx; DMAR_ASSERT_LOCKED(dmar); LIST_FOREACH(ctx, &dmar->contexts, link) { - if (ctx->bus == bus && ctx->slot == slot && ctx->func == func) + if (ctx->rid == rid) return (ctx); } return (NULL); Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Tue Apr 1 14:49:25 2014 (r264001) +++ head/sys/x86/iommu/intel_dmar.h Tue Apr 1 14:51:45 2014 (r264002) @@ -74,9 +74,7 @@ RB_PROTOTYPE(dmar_gas_entries_tree, dmar #define DMAR_MAP_ENTRY_TM 0x8000 /* Transient */ struct dmar_ctx { - int bus; /* pci bus/slot/func */ - int slot; - int func; + uint16_t rid; /* pci RID */ int domain; /* DID */ int mgaw; /* Real max address width */ int agaw; /* Adjusted guest address width */ @@ -269,12 +267,11 @@ void ctx_free_pgtbl(struct dmar_ctx *ctx struct dmar_ctx *dmar_instantiate_ctx(struct dmar_unit *dmar, device_t dev, bool rmrr); -struct dmar_ctx *dmar_get_ctx(struct dmar_unit *dmar, device_t dev, - int bus, int slot, int func, bool id_mapped, bool rmrr_init); +struct dmar_ctx *dmar_get_ctx(struct dmar_unit *dmar, device_t dev, + uint16_t rid, bool id_mapped, bool rmrr_init); void dmar_free_ctx_locked(struct dmar_unit *dmar, struct dmar_ctx *ctx); void dmar_free_ctx(struct dmar_ctx *ctx); -struct dmar_ctx *dmar_find_ctx_locked(struct dmar_unit *dmar, int bus, - int slot, int func); +struct dmar_ctx *dmar_find_ctx_locked(struct dmar_unit *dmar, uint16_t rid); void dmar_ctx_unload_entry(struct dmar_map_entry *entry, bool free); void dmar_ctx_unload(struct dmar_ctx *ctx, struct dmar_map_entries_tailq *entries, bool cansleep); Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Tue Apr 1 14:49:25 2014 (r264001) +++ head/sys/x86/iommu/intel_drv.c Tue Apr 1 14:51:45 2014 (r264002) @@ -1005,7 +1005,9 @@ dmar_print_ctx(struct dmar_ctx *ctx, boo db_printf( " @%p pci%d:%d:%d dom %d mgaw %d agaw %d pglvl %d end %jx\n" " refs %d flags %x pgobj %p map_ents %u loads %lu unloads %lu\n", - ctx, ctx->bus, ctx->slot, ctx->func, ctx->domain, ctx->mgaw, + ctx, pci_get_bus(ctx->ctx_tag.owner), + pci_get_slot(ctx->ctx_tag.owner), + pci_get_function(ctx->ctx_tag.owner), ctx->domain, ctx->mgaw, ctx->agaw, ctx->pglvl, (uintmax_t)ctx->end, ctx->refs, ctx->flags, ctx->pgtbl_obj, ctx->entries_cnt, ctx->loads, ctx->unloads); @@ -1078,8 +1080,10 @@ DB_FUNC(dmar_ctx, db_dmar_print_ctx, db_ for (i = 0; i < dmar_devcnt; i++) { unit = device_get_softc(dmar_devs[i]); LIST_FOREACH(ctx, &unit->contexts, link) { - if (domain == unit->segment && bus == ctx->bus && - device == ctx->slot && function == ctx->func) { + if (domain == unit->segment && + bus == pci_get_bus(ctx->ctx_tag.owner) && + device == pci_get_slot(ctx->ctx_tag.owner) && + function == pci_get_function(ctx->ctx_tag.owner)) { dmar_print_ctx(ctx, show_mappings); goto out; } Modified: head/sys/x86/iommu/intel_fault.c ============================================================================== --- head/sys/x86/iommu/intel_fault.c Tue Apr 1 14:49:25 2014 (r264001) +++ head/sys/x86/iommu/intel_fault.c Tue Apr 1 14:51:45 2014 (r264002) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -203,19 +205,28 @@ dmar_fault_task(void *arg, int pending _ DMAR_FAULT_UNLOCK(unit); sid = DMAR_FRCD2_SID(fault_rec[1]); - bus = (sid >> 8) & 0xf; - slot = (sid >> 3) & 0x1f; - func = sid & 0x7; printf("DMAR%d: ", unit->unit); DMAR_LOCK(unit); - ctx = dmar_find_ctx_locked(unit, bus, slot, func); + ctx = dmar_find_ctx_locked(unit, sid); if (ctx == NULL) { printf(":"); + + /* + * Note that the slot and function will not be correct + * if ARI is in use, but without a ctx entry we have + * no way of knowing whether ARI is in use or not. + */ + bus = PCI_RID2BUS(sid); + slot = PCI_RID2SLOT(sid); + func = PCI_RID2FUNC(sid); } else { ctx->flags |= DMAR_CTX_FAULTED; ctx->last_fault_rec[0] = fault_rec[0]; ctx->last_fault_rec[1] = fault_rec[1]; device_print_prettyname(ctx->ctx_tag.owner); + bus = pci_get_bus(ctx->ctx_tag.owner); + slot = pci_get_slot(ctx->ctx_tag.owner); + func = pci_get_function(ctx->ctx_tag.owner); } DMAR_UNLOCK(unit); printf( Modified: head/sys/x86/iommu/intel_utils.c ============================================================================== --- head/sys/x86/iommu/intel_utils.c Tue Apr 1 14:49:25 2014 (r264001) +++ head/sys/x86/iommu/intel_utils.c Tue Apr 1 14:51:45 2014 (r264002) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -129,8 +130,10 @@ ctx_set_agaw(struct dmar_ctx *ctx, int m } device_printf(ctx->dmar->dev, "context request mgaw %d for pci%d:%d:%d:%d, " - "no agaw found, sagaw %x\n", mgaw, ctx->dmar->segment, ctx->bus, - ctx->slot, ctx->func, sagaw); + "no agaw found, sagaw %x\n", mgaw, ctx->dmar->segment, + pci_get_bus(ctx->ctx_tag.owner), + pci_get_slot(ctx->ctx_tag.owner), + pci_get_function(ctx->ctx_tag.owner), sagaw); return (EINVAL); } From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 14:54:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27CD75A0; Tue, 1 Apr 2014 14:54:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13EF9E41; Tue, 1 Apr 2014 14:54:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31EsiGQ027730; Tue, 1 Apr 2014 14:54:44 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31EsiA0027723; Tue, 1 Apr 2014 14:54:44 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201404011454.s31EsiA0027723@svn.freebsd.org> From: Ryan Stone Date: Tue, 1 Apr 2014 14:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264003 - in head/sys/amd64/vmm: amd intel io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 14:54:45 -0000 Author: rstone Date: Tue Apr 1 14:54:43 2014 New Revision: 264003 URL: http://svnweb.freebsd.org/changeset/base/264003 Log: Re-write bhyve's I/O MMU handling in terms of PCI RIDs Reviewed by: neel Sponsored by: Sandvine Inc Modified: head/sys/amd64/vmm/amd/amdv.c head/sys/amd64/vmm/intel/vtd.c head/sys/amd64/vmm/io/iommu.c head/sys/amd64/vmm/io/iommu.h head/sys/amd64/vmm/io/ppt.c Modified: head/sys/amd64/vmm/amd/amdv.c ============================================================================== --- head/sys/amd64/vmm/amd/amdv.c Tue Apr 1 14:51:45 2014 (r264002) +++ head/sys/amd64/vmm/amd/amdv.c Tue Apr 1 14:54:43 2014 (r264003) @@ -242,14 +242,14 @@ amd_iommu_remove_mapping(void *domain, v } static void -amd_iommu_add_device(void *domain, int bus, int slot, int func) +amd_iommu_add_device(void *domain, uint16_t rid) { printf("amd_iommu_add_device: not implemented\n"); } static void -amd_iommu_remove_device(void *domain, int bus, int slot, int func) +amd_iommu_remove_device(void *domain, uint16_t rid) { printf("amd_iommu_remove_device: not implemented\n"); Modified: head/sys/amd64/vmm/intel/vtd.c ============================================================================== --- head/sys/amd64/vmm/intel/vtd.c Tue Apr 1 14:51:45 2014 (r264002) +++ head/sys/amd64/vmm/intel/vtd.c Tue Apr 1 14:54:43 2014 (r264003) @@ -99,6 +99,8 @@ struct vtdmap { #define VTD_PTE_SUPERPAGE (1UL << 7) #define VTD_PTE_ADDR_M (0x000FFFFFFFFFF000UL) +#define VTD_RID2IDX(rid) (((rid) & 0xff) * 2) + struct domain { uint64_t *ptp; /* first level page table page */ int pt_levels; /* number of page table levels */ @@ -360,27 +362,24 @@ vtd_disable(void) } static void -vtd_add_device(void *arg, int bus, int slot, int func) +vtd_add_device(void *arg, uint16_t rid) { int idx; uint64_t *ctxp; struct domain *dom = arg; vm_paddr_t pt_paddr; struct vtdmap *vtdmap; - - if (bus < 0 || bus > PCI_BUSMAX || - slot < 0 || slot > PCI_SLOTMAX || - func < 0 || func > PCI_FUNCMAX) - panic("vtd_add_device: invalid bsf %d/%d/%d", bus, slot, func); + uint8_t bus; vtdmap = vtdmaps[0]; + bus = PCI_RID2BUS(rid); ctxp = ctx_tables[bus]; pt_paddr = vtophys(dom->ptp); - idx = (slot << 3 | func) * 2; + idx = VTD_RID2IDX(rid); if (ctxp[idx] & VTD_CTX_PRESENT) { - panic("vtd_add_device: device %d/%d/%d is already owned by " - "domain %d", bus, slot, func, + panic("vtd_add_device: device %x is already owned by " + "domain %d", rid, (uint16_t)(ctxp[idx + 1] >> 8)); } @@ -404,19 +403,16 @@ vtd_add_device(void *arg, int bus, int s } static void -vtd_remove_device(void *arg, int bus, int slot, int func) +vtd_remove_device(void *arg, uint16_t rid) { int i, idx; uint64_t *ctxp; struct vtdmap *vtdmap; + uint8_t bus; - if (bus < 0 || bus > PCI_BUSMAX || - slot < 0 || slot > PCI_SLOTMAX || - func < 0 || func > PCI_FUNCMAX) - panic("vtd_add_device: invalid bsf %d/%d/%d", bus, slot, func); - + bus = PCI_RID2BUS(rid); ctxp = ctx_tables[bus]; - idx = (slot << 3 | func) * 2; + idx = VTD_RID2IDX(rid); /* * Order is important. The 'present' bit is must be cleared first. Modified: head/sys/amd64/vmm/io/iommu.c ============================================================================== --- head/sys/amd64/vmm/io/iommu.c Tue Apr 1 14:51:45 2014 (r264002) +++ head/sys/amd64/vmm/io/iommu.c Tue Apr 1 14:54:43 2014 (r264003) @@ -109,19 +109,19 @@ IOMMU_REMOVE_MAPPING(void *domain, vm_pa } static __inline void -IOMMU_ADD_DEVICE(void *domain, int bus, int slot, int func) +IOMMU_ADD_DEVICE(void *domain, uint16_t rid) { if (ops != NULL && iommu_avail) - (*ops->add_device)(domain, bus, slot, func); + (*ops->add_device)(domain, rid); } static __inline void -IOMMU_REMOVE_DEVICE(void *domain, int bus, int slot, int func) +IOMMU_REMOVE_DEVICE(void *domain, uint16_t rid) { if (ops != NULL && iommu_avail) - (*ops->remove_device)(domain, bus, slot, func); + (*ops->remove_device)(domain, rid); } static __inline void @@ -196,7 +196,8 @@ iommu_init(void) continue; /* everything else belongs to the host domain */ - iommu_add_device(host_domain, bus, slot, func); + iommu_add_device(host_domain, + pci_get_rid(dev)); } } } @@ -263,17 +264,17 @@ iommu_host_domain(void) } void -iommu_add_device(void *dom, int bus, int slot, int func) +iommu_add_device(void *dom, uint16_t rid) { - IOMMU_ADD_DEVICE(dom, bus, slot, func); + IOMMU_ADD_DEVICE(dom, rid); } void -iommu_remove_device(void *dom, int bus, int slot, int func) +iommu_remove_device(void *dom, uint16_t rid) { - IOMMU_REMOVE_DEVICE(dom, bus, slot, func); + IOMMU_REMOVE_DEVICE(dom, rid); } void Modified: head/sys/amd64/vmm/io/iommu.h ============================================================================== --- head/sys/amd64/vmm/io/iommu.h Tue Apr 1 14:51:45 2014 (r264002) +++ head/sys/amd64/vmm/io/iommu.h Tue Apr 1 14:54:43 2014 (r264003) @@ -39,8 +39,8 @@ typedef uint64_t (*iommu_create_mapping_ vm_paddr_t hpa, uint64_t len); typedef uint64_t (*iommu_remove_mapping_t)(void *domain, vm_paddr_t gpa, uint64_t len); -typedef void (*iommu_add_device_t)(void *domain, int bus, int slot, int func); -typedef void (*iommu_remove_device_t)(void *dom, int bus, int slot, int func); +typedef void (*iommu_add_device_t)(void *domain, uint16_t rid); +typedef void (*iommu_remove_device_t)(void *dom, uint16_t rid); typedef void (*iommu_invalidate_tlb_t)(void *dom); struct iommu_ops { @@ -69,7 +69,7 @@ void iommu_destroy_domain(void *dom); void iommu_create_mapping(void *dom, vm_paddr_t gpa, vm_paddr_t hpa, size_t len); void iommu_remove_mapping(void *dom, vm_paddr_t gpa, size_t len); -void iommu_add_device(void *dom, int bus, int slot, int func); -void iommu_remove_device(void *dom, int bus, int slot, int func); +void iommu_add_device(void *dom, uint16_t rid); +void iommu_remove_device(void *dom, uint16_t rid); void iommu_invalidate_tlb(void *domain); #endif Modified: head/sys/amd64/vmm/io/ppt.c ============================================================================== --- head/sys/amd64/vmm/io/ppt.c Tue Apr 1 14:51:45 2014 (r264002) +++ head/sys/amd64/vmm/io/ppt.c Tue Apr 1 14:54:43 2014 (r264003) @@ -346,7 +346,7 @@ ppt_assign_device(struct vm *vm, int bus return (EBUSY); ppt->vm = vm; - iommu_add_device(vm_iommu_domain(vm), bus, slot, func); + iommu_add_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); return (0); } return (ENOENT); @@ -367,7 +367,7 @@ ppt_unassign_device(struct vm *vm, int b ppt_unmap_mmio(vm, ppt); ppt_teardown_msi(ppt); ppt_teardown_msix(ppt); - iommu_remove_device(vm_iommu_domain(vm), bus, slot, func); + iommu_remove_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); ppt->vm = NULL; return (0); } From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 15:06:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31C23D18; Tue, 1 Apr 2014 15:06:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AFD1F9D; Tue, 1 Apr 2014 15:06:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31F68j4032290; Tue, 1 Apr 2014 15:06:08 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31F641Z032264; Tue, 1 Apr 2014 15:06:04 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201404011506.s31F641Z032264@svn.freebsd.org> From: Ryan Stone Date: Tue, 1 Apr 2014 15:06:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264006 - in head/sys: amd64/vmm/amd amd64/vmm/intel amd64/vmm/io conf dev/pci x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 15:06:08 -0000 Author: rstone Date: Tue Apr 1 15:06:03 2014 New Revision: 264006 URL: http://svnweb.freebsd.org/changeset/base/264006 Log: Revert PCI RID changes. My PCI RID changes somehow got intermixed with my PCI ARI patch when I committed it. I may have accidentally applied a patch to a non-clean working tree. Revert everything while I figure out what went wrong. Pointy hat to: rstone Deleted: head/sys/dev/pci/pcib_support.c Modified: head/sys/amd64/vmm/amd/amdv.c head/sys/amd64/vmm/intel/vtd.c head/sys/amd64/vmm/io/iommu.c head/sys/amd64/vmm/io/iommu.h head/sys/amd64/vmm/io/ppt.c head/sys/conf/files head/sys/dev/pci/pci.c head/sys/dev/pci/pci_if.m head/sys/dev/pci/pci_pci.c head/sys/dev/pci/pcib_if.m head/sys/dev/pci/pcib_private.h head/sys/dev/pci/pcireg.h head/sys/dev/pci/pcivar.h head/sys/x86/iommu/busdma_dmar.c head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_drv.c head/sys/x86/iommu/intel_fault.c head/sys/x86/iommu/intel_utils.c Modified: head/sys/amd64/vmm/amd/amdv.c ============================================================================== --- head/sys/amd64/vmm/amd/amdv.c Tue Apr 1 14:55:29 2014 (r264005) +++ head/sys/amd64/vmm/amd/amdv.c Tue Apr 1 15:06:03 2014 (r264006) @@ -242,14 +242,14 @@ amd_iommu_remove_mapping(void *domain, v } static void -amd_iommu_add_device(void *domain, uint16_t rid) +amd_iommu_add_device(void *domain, int bus, int slot, int func) { printf("amd_iommu_add_device: not implemented\n"); } static void -amd_iommu_remove_device(void *domain, uint16_t rid) +amd_iommu_remove_device(void *domain, int bus, int slot, int func) { printf("amd_iommu_remove_device: not implemented\n"); Modified: head/sys/amd64/vmm/intel/vtd.c ============================================================================== --- head/sys/amd64/vmm/intel/vtd.c Tue Apr 1 14:55:29 2014 (r264005) +++ head/sys/amd64/vmm/intel/vtd.c Tue Apr 1 15:06:03 2014 (r264006) @@ -99,8 +99,6 @@ struct vtdmap { #define VTD_PTE_SUPERPAGE (1UL << 7) #define VTD_PTE_ADDR_M (0x000FFFFFFFFFF000UL) -#define VTD_RID2IDX(rid) (((rid) & 0xff) * 2) - struct domain { uint64_t *ptp; /* first level page table page */ int pt_levels; /* number of page table levels */ @@ -362,24 +360,27 @@ vtd_disable(void) } static void -vtd_add_device(void *arg, uint16_t rid) +vtd_add_device(void *arg, int bus, int slot, int func) { int idx; uint64_t *ctxp; struct domain *dom = arg; vm_paddr_t pt_paddr; struct vtdmap *vtdmap; - uint8_t bus; + + if (bus < 0 || bus > PCI_BUSMAX || + slot < 0 || slot > PCI_SLOTMAX || + func < 0 || func > PCI_FUNCMAX) + panic("vtd_add_device: invalid bsf %d/%d/%d", bus, slot, func); vtdmap = vtdmaps[0]; - bus = PCI_RID2BUS(rid); ctxp = ctx_tables[bus]; pt_paddr = vtophys(dom->ptp); - idx = VTD_RID2IDX(rid); + idx = (slot << 3 | func) * 2; if (ctxp[idx] & VTD_CTX_PRESENT) { - panic("vtd_add_device: device %x is already owned by " - "domain %d", rid, + panic("vtd_add_device: device %d/%d/%d is already owned by " + "domain %d", bus, slot, func, (uint16_t)(ctxp[idx + 1] >> 8)); } @@ -403,16 +404,19 @@ vtd_add_device(void *arg, uint16_t rid) } static void -vtd_remove_device(void *arg, uint16_t rid) +vtd_remove_device(void *arg, int bus, int slot, int func) { int i, idx; uint64_t *ctxp; struct vtdmap *vtdmap; - uint8_t bus; - bus = PCI_RID2BUS(rid); + if (bus < 0 || bus > PCI_BUSMAX || + slot < 0 || slot > PCI_SLOTMAX || + func < 0 || func > PCI_FUNCMAX) + panic("vtd_add_device: invalid bsf %d/%d/%d", bus, slot, func); + ctxp = ctx_tables[bus]; - idx = VTD_RID2IDX(rid); + idx = (slot << 3 | func) * 2; /* * Order is important. The 'present' bit is must be cleared first. Modified: head/sys/amd64/vmm/io/iommu.c ============================================================================== --- head/sys/amd64/vmm/io/iommu.c Tue Apr 1 14:55:29 2014 (r264005) +++ head/sys/amd64/vmm/io/iommu.c Tue Apr 1 15:06:03 2014 (r264006) @@ -109,19 +109,19 @@ IOMMU_REMOVE_MAPPING(void *domain, vm_pa } static __inline void -IOMMU_ADD_DEVICE(void *domain, uint16_t rid) +IOMMU_ADD_DEVICE(void *domain, int bus, int slot, int func) { if (ops != NULL && iommu_avail) - (*ops->add_device)(domain, rid); + (*ops->add_device)(domain, bus, slot, func); } static __inline void -IOMMU_REMOVE_DEVICE(void *domain, uint16_t rid) +IOMMU_REMOVE_DEVICE(void *domain, int bus, int slot, int func) { if (ops != NULL && iommu_avail) - (*ops->remove_device)(domain, rid); + (*ops->remove_device)(domain, bus, slot, func); } static __inline void @@ -196,8 +196,7 @@ iommu_init(void) continue; /* everything else belongs to the host domain */ - iommu_add_device(host_domain, - pci_get_rid(dev)); + iommu_add_device(host_domain, bus, slot, func); } } } @@ -264,17 +263,17 @@ iommu_host_domain(void) } void -iommu_add_device(void *dom, uint16_t rid) +iommu_add_device(void *dom, int bus, int slot, int func) { - IOMMU_ADD_DEVICE(dom, rid); + IOMMU_ADD_DEVICE(dom, bus, slot, func); } void -iommu_remove_device(void *dom, uint16_t rid) +iommu_remove_device(void *dom, int bus, int slot, int func) { - IOMMU_REMOVE_DEVICE(dom, rid); + IOMMU_REMOVE_DEVICE(dom, bus, slot, func); } void Modified: head/sys/amd64/vmm/io/iommu.h ============================================================================== --- head/sys/amd64/vmm/io/iommu.h Tue Apr 1 14:55:29 2014 (r264005) +++ head/sys/amd64/vmm/io/iommu.h Tue Apr 1 15:06:03 2014 (r264006) @@ -39,8 +39,8 @@ typedef uint64_t (*iommu_create_mapping_ vm_paddr_t hpa, uint64_t len); typedef uint64_t (*iommu_remove_mapping_t)(void *domain, vm_paddr_t gpa, uint64_t len); -typedef void (*iommu_add_device_t)(void *domain, uint16_t rid); -typedef void (*iommu_remove_device_t)(void *dom, uint16_t rid); +typedef void (*iommu_add_device_t)(void *domain, int bus, int slot, int func); +typedef void (*iommu_remove_device_t)(void *dom, int bus, int slot, int func); typedef void (*iommu_invalidate_tlb_t)(void *dom); struct iommu_ops { @@ -69,7 +69,7 @@ void iommu_destroy_domain(void *dom); void iommu_create_mapping(void *dom, vm_paddr_t gpa, vm_paddr_t hpa, size_t len); void iommu_remove_mapping(void *dom, vm_paddr_t gpa, size_t len); -void iommu_add_device(void *dom, uint16_t rid); -void iommu_remove_device(void *dom, uint16_t rid); +void iommu_add_device(void *dom, int bus, int slot, int func); +void iommu_remove_device(void *dom, int bus, int slot, int func); void iommu_invalidate_tlb(void *domain); #endif Modified: head/sys/amd64/vmm/io/ppt.c ============================================================================== --- head/sys/amd64/vmm/io/ppt.c Tue Apr 1 14:55:29 2014 (r264005) +++ head/sys/amd64/vmm/io/ppt.c Tue Apr 1 15:06:03 2014 (r264006) @@ -346,7 +346,7 @@ ppt_assign_device(struct vm *vm, int bus return (EBUSY); ppt->vm = vm; - iommu_add_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); + iommu_add_device(vm_iommu_domain(vm), bus, slot, func); return (0); } return (ENOENT); @@ -367,7 +367,7 @@ ppt_unassign_device(struct vm *vm, int b ppt_unmap_mmio(vm, ppt); ppt_teardown_msi(ppt); ppt_teardown_msix(ppt); - iommu_remove_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); + iommu_remove_device(vm_iommu_domain(vm), bus, slot, func); ppt->vm = NULL; return (0); } Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Apr 1 14:55:29 2014 (r264005) +++ head/sys/conf/files Tue Apr 1 15:06:03 2014 (r264006) @@ -1951,7 +1951,6 @@ dev/pci/pci_pci.c optional pci dev/pci/pci_subr.c optional pci dev/pci/pci_user.c optional pci dev/pci/pcib_if.m standard -dev/pci/pcib_support.c standard dev/pci/vga_pci.c optional pci dev/pcn/if_pcn.c optional pcn pci dev/pdq/if_fea.c optional fea eisa Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Apr 1 14:55:29 2014 (r264005) +++ head/sys/dev/pci/pci.c Tue Apr 1 15:06:03 2014 (r264006) @@ -124,8 +124,6 @@ static void pci_resume_msix(device_t de static int pci_remap_intr_method(device_t bus, device_t dev, u_int irq); -static uint16_t pci_get_rid_method(device_t dev, device_t child); - static device_method_t pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, pci_probe), @@ -184,7 +182,6 @@ static device_method_t pci_methods[] = { DEVMETHOD(pci_release_msi, pci_release_msi_method), DEVMETHOD(pci_msi_count, pci_msi_count_method), DEVMETHOD(pci_msix_count, pci_msix_count_method), - DEVMETHOD(pci_get_rid, pci_get_rid_method), DEVMETHOD_END }; @@ -354,11 +351,6 @@ SYSCTL_INT(_hw_pci, OID_AUTO, clear_buse "Ignore firmware-assigned bus numbers."); #endif -static int pci_enable_ari = 1; -TUNABLE_INT("hw.pci.enable_ari", &pci_enable_ari); -SYSCTL_INT(_hw_pci, OID_AUTO, enable_ari, CTLFLAG_RDTUN, &pci_enable_ari, - 0, "Enable support for PCIe Alternative RID Interpretation"); - static int pci_has_quirk(uint32_t devid, int quirk) { @@ -3459,19 +3451,6 @@ pci_add_resources(device_t bus, device_t #endif } -static struct pci_devinfo * -pci_identify_function(device_t pcib, device_t dev, int domain, int busno, - int slot, int func, size_t dinfo_size) -{ - struct pci_devinfo *dinfo; - - dinfo = pci_read_device(pcib, domain, busno, slot, func, dinfo_size); - if (dinfo != NULL) - pci_add_child(dev, dinfo); - - return (dinfo); -} - void pci_add_children(device_t dev, int domain, int busno, size_t dinfo_size) { @@ -3481,24 +3460,6 @@ pci_add_children(device_t dev, int domai int maxslots; int s, f, pcifunchigh; uint8_t hdrtype; - int first_func; - - /* - * Try to detect a device at slot 0, function 0. If it exists, try to - * enable ARI. We must enable ARI before detecting the rest of the - * functions on this bus as ARI changes the set of slots and functions - * that are legal on this bus. - */ - dinfo = pci_identify_function(pcib, dev, domain, busno, 0, 0, - dinfo_size); - if (dinfo != NULL && pci_enable_ari) - PCIB_TRY_ENABLE_ARI(pcib, dinfo->cfg.dev); - - /* - * Start looking for new devices on slot 0 at function 1 because we - * just identified the device at slot 0, function 0. - */ - first_func = 1; KASSERT(dinfo_size >= sizeof(struct pci_devinfo), ("dinfo_size too small")); @@ -3511,13 +3472,14 @@ pci_add_children(device_t dev, int domai if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE) continue; if (hdrtype & PCIM_MFDEV) - pcifunchigh = PCIB_MAXFUNCS(pcib); - for (f = first_func; f <= pcifunchigh; f++) - pci_identify_function(pcib, dev, domain, busno, s, f, + pcifunchigh = PCI_FUNCMAX; + for (f = 0; f <= pcifunchigh; f++) { + dinfo = pci_read_device(pcib, domain, busno, s, f, dinfo_size); - - /* For slots after slot 0 we need to check for function 0. */ - first_func = 0; + if (dinfo != NULL) { + pci_add_child(dev, dinfo); + } + } } #undef REG } @@ -5093,10 +5055,3 @@ pci_restore_state(device_t dev) dinfo = device_get_ivars(dev); pci_cfg_restore(dev, dinfo); } - -static uint16_t -pci_get_rid_method(device_t dev, device_t child) -{ - - return (PCIB_GET_RID(device_get_parent(dev), child)); -} Modified: head/sys/dev/pci/pci_if.m ============================================================================== --- head/sys/dev/pci/pci_if.m Tue Apr 1 14:55:29 2014 (r264005) +++ head/sys/dev/pci/pci_if.m Tue Apr 1 15:06:03 2014 (r264006) @@ -159,9 +159,3 @@ METHOD int msix_count { device_t dev; device_t child; } DEFAULT null_msi_count; - -METHOD uint16_t get_rid { - device_t dev; - device_t child; -}; - Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Tue Apr 1 14:55:29 2014 (r264005) +++ head/sys/dev/pci/pci_pci.c Tue Apr 1 15:06:03 2014 (r264006) @@ -56,14 +56,6 @@ static int pcib_suspend(device_t dev); static int pcib_resume(device_t dev); static int pcib_power_for_sleep(device_t pcib, device_t dev, int *pstate); -static uint32_t pcib_read_config(device_t dev, u_int b, u_int s, - u_int f, u_int reg, int width); -static void pcib_write_config(device_t dev, u_int b, u_int s, - u_int f, u_int reg, uint32_t val, int width); -static int pcib_ari_maxslots(device_t dev); -static int pcib_ari_maxfuncs(device_t dev); -static int pcib_try_enable_ari(device_t pcib, device_t dev); - static device_method_t pcib_methods[] = { /* Device interface */ @@ -91,8 +83,7 @@ static device_method_t pcib_methods[] = DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), /* pcib interface */ - DEVMETHOD(pcib_maxslots, pcib_ari_maxslots), - DEVMETHOD(pcib_maxfuncs, pcib_ari_maxfuncs), + DEVMETHOD(pcib_maxslots, pcib_maxslots), DEVMETHOD(pcib_read_config, pcib_read_config), DEVMETHOD(pcib_write_config, pcib_write_config), DEVMETHOD(pcib_route_interrupt, pcib_route_interrupt), @@ -102,7 +93,6 @@ static device_method_t pcib_methods[] = DEVMETHOD(pcib_release_msix, pcib_release_msix), DEVMETHOD(pcib_map_msi, pcib_map_msi), DEVMETHOD(pcib_power_for_sleep, pcib_power_for_sleep), - DEVMETHOD(pcib_try_enable_ari, pcib_try_enable_ari), DEVMETHOD_END }; @@ -1812,103 +1802,27 @@ pcib_alloc_resource(device_t dev, device #endif /* - * If ARI is enabled on this downstream port, translate the function number - * to the non-ARI slot/function. The downstream port will convert it back in - * hardware. If ARI is not enabled slot and func are not modified. - */ -static __inline void -pcib_xlate_ari(device_t pcib, int bus, int *slot, int *func) -{ - struct pcib_softc *sc; - int ari_func; - - sc = device_get_softc(pcib); - ari_func = *func; - - if (sc->flags & PCIB_ENABLE_ARI) { - KASSERT(*slot == 0, - ("Non-zero slot number with ARI enabled!")); - *slot = PCIE_ARI_SLOT(ari_func); - *func = PCIE_ARI_FUNC(ari_func); - } -} - - -static void -pcib_enable_ari(struct pcib_softc *sc, uint32_t pcie_pos) -{ - uint32_t ctl2; - - ctl2 = pci_read_config(sc->dev, pcie_pos + PCIER_DEVICE_CTL2, 4); - ctl2 |= PCIEM_CTL2_ARI; - pci_write_config(sc->dev, pcie_pos + PCIER_DEVICE_CTL2, ctl2, 4); - - sc->flags |= PCIB_ENABLE_ARI; - - if (bootverbose) - device_printf(sc->dev, "Enable ARI\n"); -} - -/* * PCIB interface. */ int pcib_maxslots(device_t dev) { - return (PCI_SLOTMAX); -} - -int -pcib_maxfuncs(device_t dev) -{ - return (PCI_FUNCMAX); -} - -static int -pcib_ari_maxslots(device_t dev) -{ - struct pcib_softc *sc; - - sc = device_get_softc(dev); - - if (sc->flags & PCIB_ENABLE_ARI) - return (PCIE_ARI_SLOTMAX); - else - return (PCI_SLOTMAX); -} - -static int -pcib_ari_maxfuncs(device_t dev) -{ - struct pcib_softc *sc; - - sc = device_get_softc(dev); - - if (sc->flags & PCIB_ENABLE_ARI) - return (PCIE_ARI_FUNCMAX); - else - return (PCI_FUNCMAX); + return(PCI_SLOTMAX); } /* * Since we are a child of a PCI bus, its parent must support the pcib interface. */ -static uint32_t +uint32_t pcib_read_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, int width) { - - pcib_xlate_ari(dev, b, &s, &f); - return(PCIB_READ_CONFIG(device_get_parent(device_get_parent(dev)), b, s, - f, reg, width)); + return(PCIB_READ_CONFIG(device_get_parent(device_get_parent(dev)), b, s, f, reg, width)); } -static void +void pcib_write_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, uint32_t val, int width) { - - pcib_xlate_ari(dev, b, &s, &f); - PCIB_WRITE_CONFIG(device_get_parent(device_get_parent(dev)), b, s, f, - reg, val, width); + PCIB_WRITE_CONFIG(device_get_parent(device_get_parent(dev)), b, s, f, reg, val, width); } /* @@ -2020,61 +1934,3 @@ pcib_power_for_sleep(device_t pcib, devi bus = device_get_parent(pcib); return (PCIB_POWER_FOR_SLEEP(bus, dev, pstate)); } - - -/* - * Check that the downstream port (pcib) and the endpoint device (dev) both - * support ARI. If so, enable it and return 0, otherwise return an error. - */ -static int -pcib_try_enable_ari(device_t pcib, device_t dev) -{ - struct pcib_softc *sc; - int error; - uint32_t cap2; - int ari_cap_off; - uint32_t ari_ver; - uint32_t pcie_pos; - - sc = device_get_softc(pcib); - - /* - * ARI is controlled in a register in the PCIe capability structure. - * If the downstream port does not have the PCIe capability structure - * then it does not support ARI. - */ - error = pci_find_cap(pcib, PCIY_EXPRESS, &pcie_pos); - if (error != 0) - return (ENODEV); - - /* Check that the PCIe port advertises ARI support. */ - cap2 = pci_read_config(pcib, pcie_pos + PCIER_DEVICE_CAP2, 4); - if (!(cap2 & PCIEM_CAP2_ARI)) - return (ENODEV); - - /* - * Check that the endpoint device advertises ARI support via the ARI - * extended capability structure. - */ - error = pci_find_extcap(dev, PCIZ_ARI, &ari_cap_off); - if (error != 0) - return (ENODEV); - - /* - * Finally, check that the endpoint device supports the same version - * of ARI that we do. - */ - ari_ver = pci_read_config(dev, ari_cap_off, 4); - if (PCI_EXTCAP_VER(ari_ver) != PCIB_SUPPORTED_ARI_VER) { - if (bootverbose) - device_printf(pcib, - "Unsupported version of ARI (%d) detected\n", - PCI_EXTCAP_VER(ari_ver)); - - return (ENXIO); - } - - pcib_enable_ari(sc, pcie_pos); - - return (0); -} Modified: head/sys/dev/pci/pcib_if.m ============================================================================== --- head/sys/dev/pci/pcib_if.m Tue Apr 1 14:55:29 2014 (r264005) +++ head/sys/dev/pci/pcib_if.m Tue Apr 1 15:06:03 2014 (r264006) @@ -47,14 +47,6 @@ METHOD int maxslots { }; # -# -# Return the number of functions on the attached PCI bus. -# -METHOD int maxfuncs { - device_t dev; -} default pcib_maxfuncs; - -# # Read configuration space on the PCI bus. The bus, slot and func # arguments determine the device which is being read and the reg # argument is a byte offset into configuration space for that @@ -162,21 +154,3 @@ METHOD int power_for_sleep { device_t dev; int *pstate; }; - -# -# Return the PCI Routing Identifier (RID) for the device. -# -METHOD uint16_t get_rid { - device_t pcib; - device_t dev; -}; - - -# -# Enable Alternative RID Interpretation if both the downstream port (pcib) -# and the endpoint device (dev) both support it. -# -METHOD int try_enable_ari { - device_t pcib; - device_t dev; -}; Modified: head/sys/dev/pci/pcib_private.h ============================================================================== --- head/sys/dev/pci/pcib_private.h Tue Apr 1 14:55:29 2014 (r264005) +++ head/sys/dev/pci/pcib_private.h Tue Apr 1 15:06:03 2014 (r264006) @@ -105,7 +105,6 @@ struct pcib_softc #define PCIB_SUBTRACTIVE 0x1 #define PCIB_DISABLE_MSI 0x2 #define PCIB_DISABLE_MSIX 0x4 -#define PCIB_ENABLE_ARI 0x8 uint16_t command; /* command register */ u_int domain; /* domain number */ u_int pribus; /* primary bus number */ @@ -127,8 +126,6 @@ struct pcib_softc uint8_t seclat; /* secondary bus latency timer */ }; -#define PCIB_SUPPORTED_ARI_VER 1 - typedef uint32_t pci_read_config_fn(int b, int s, int f, int reg, int width); int host_pcib_get_busno(pci_read_config_fn read_config, int bus, @@ -162,14 +159,13 @@ int pcib_release_resource(device_t dev, struct resource *r); #endif int pcib_maxslots(device_t dev); -int pcib_maxfuncs(device_t dev); +uint32_t pcib_read_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, int width); +void pcib_write_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, uint32_t val, int width); int pcib_route_interrupt(device_t pcib, device_t dev, int pin); int pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs); int pcib_release_msi(device_t pcib, device_t dev, int count, int *irqs); int pcib_alloc_msix(device_t pcib, device_t dev, int *irq); int pcib_release_msix(device_t pcib, device_t dev, int irq); int pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data); -uint16_t pcib_get_rid(device_t pcib, device_t dev); - #endif Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Tue Apr 1 14:55:29 2014 (r264005) +++ head/sys/dev/pci/pcireg.h Tue Apr 1 15:06:03 2014 (r264006) @@ -48,29 +48,6 @@ #define PCIE_REGMAX 4095 /* highest supported config register addr. */ #define PCI_MAXHDRTYPE 2 -#define PCIE_ARI_SLOTMAX 0 -#define PCIE_ARI_FUNCMAX 255 - -#define PCIE_ARI_SLOT(func) (((func) >> 3) & PCI_SLOTMAX) -#define PCIE_ARI_FUNC(func) ((func) & PCI_FUNCMAX) - -#define PCI_RID_BUS_SHIFT 8 -#define PCI_RID_SLOT_SHIFT 3 -#define PCI_RID_FUNC_SHIFT 0 - -#define PCI_RID(bus, slot, func) \ - ((((bus) & PCI_BUSMAX) << PCI_RID_BUS_SHIFT) | \ - (((slot) & PCI_SLOTMAX) << PCI_RID_SLOT_SHIFT) | \ - (((func) & PCI_FUNCMAX) << PCI_RID_FUNC_SHIFT)) - -#define PCI_ARI_RID(bus, func) \ - ((((bus) & PCI_BUSMAX) << PCI_RID_BUS_SHIFT) | \ - (((func) & PCIE_ARI_FUNCMAX) << PCI_RID_FUNC_SHIFT)) - -#define PCI_RID2BUS(rid) (((rid) >> PCI_RID_BUS_SHIFT) & PCI_BUSMAX) -#define PCI_RID2SLOT(rid) (((rid) >> PCI_RID_SLOT_SHIFT) & PCI_SLOTMAX) -#define PCI_RID2FUNC(rid) (((rid) >> PCI_RID_FUNC_SHIFT) & PCI_FUNCMAX) - /* PCI config header registers for all devices */ #define PCIR_DEVVENDOR 0x00 @@ -797,7 +774,6 @@ #define PCIEM_ROOT_STA_PME_STATUS 0x00010000 #define PCIEM_ROOT_STA_PME_PEND 0x00020000 #define PCIER_DEVICE_CAP2 0x24 -#define PCIEM_CAP2_ARI 0x20 #define PCIER_DEVICE_CTL2 0x28 #define PCIEM_CTL2_COMP_TIMEOUT_VAL 0x000f #define PCIEM_CTL2_COMP_TIMEOUT_DIS 0x0010 @@ -918,4 +894,3 @@ /* Serial Number definitions */ #define PCIR_SERIAL_LOW 0x04 #define PCIR_SERIAL_HIGH 0x08 - Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Tue Apr 1 14:55:29 2014 (r264005) +++ head/sys/dev/pci/pcivar.h Tue Apr 1 15:06:03 2014 (r264006) @@ -482,12 +482,6 @@ pci_msix_count(device_t dev) return (PCI_MSIX_COUNT(device_get_parent(dev), dev)); } -static __inline uint16_t -pci_get_rid(device_t dev) -{ - return (PCI_GET_RID(device_get_parent(dev), 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); Modified: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Tue Apr 1 14:55:29 2014 (r264005) +++ head/sys/x86/iommu/busdma_dmar.c Tue Apr 1 15:06:03 2014 (r264006) @@ -93,7 +93,7 @@ dmar_bus_dma_is_dev_disabled(int domain, * bounce mapping. */ static device_t -dmar_get_requester(device_t dev, uint16_t *rid) +dmar_get_requester(device_t dev, int *bus, int *slot, int *func) { devclass_t pci_class; device_t pci, pcib, requester; @@ -102,7 +102,9 @@ dmar_get_requester(device_t dev, uint16_ pci_class = devclass_find("pci"); requester = dev; - *rid = pci_get_rid(dev); + *bus = pci_get_bus(dev); + *slot = pci_get_slot(dev); + *func = pci_get_function(dev); /* * Walk the bridge hierarchy from the target device to the @@ -159,7 +161,8 @@ dmar_get_requester(device_t dev, uint16_ * same page tables for taken and * non-taken transactions. */ - *rid = PCI_RID(pci_get_bus(dev), 0, 0); + *bus = pci_get_bus(dev); + *slot = *func = 0; } else { /* * Neither the device nor the bridge @@ -168,7 +171,9 @@ dmar_get_requester(device_t dev, uint16_ * will use the bridge's BSF as the * requester ID. */ - *rid = pci_get_rid(pcib); + *bus = pci_get_bus(pcib); + *slot = pci_get_slot(pcib); + *func = pci_get_function(pcib); } } /* @@ -188,9 +193,9 @@ dmar_instantiate_ctx(struct dmar_unit *d device_t requester; struct dmar_ctx *ctx; bool disabled; - uint16_t rid; + int bus, slot, func; - requester = dmar_get_requester(dev, &rid); + requester = dmar_get_requester(dev, &bus, &slot, &func); /* * If the user requested the IOMMU disabled for the device, we @@ -199,10 +204,9 @@ dmar_instantiate_ctx(struct dmar_unit *d * Instead provide the identity mapping for the device * context. */ - disabled = dmar_bus_dma_is_dev_disabled(pci_get_domain(requester), - pci_get_bus(requester), pci_get_slot(requester), - pci_get_function(requester)); - ctx = dmar_get_ctx(dmar, requester, rid, disabled, rmrr); + disabled = dmar_bus_dma_is_dev_disabled(pci_get_domain(dev), bus, + slot, func); + ctx = dmar_get_ctx(dmar, requester, bus, slot, func, disabled, rmrr); if (ctx == NULL) return (NULL); if (disabled) { Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Tue Apr 1 14:55:29 2014 (r264005) +++ head/sys/x86/iommu/intel_ctx.c Tue Apr 1 15:06:03 2014 (r264006) @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include static MALLOC_DEFINE(M_DMAR_CTX, "dmar_ctx", "Intel DMAR Context"); @@ -106,14 +105,14 @@ dmar_map_ctx_entry(struct dmar_ctx *ctx, { dmar_ctx_entry_t *ctxp; - ctxp = dmar_map_pgtbl(ctx->dmar->ctx_obj, 1 + PCI_RID2BUS(ctx->rid), + ctxp = dmar_map_pgtbl(ctx->dmar->ctx_obj, 1 + ctx->bus, DMAR_PGF_NOALLOC | DMAR_PGF_WAITOK, sfp); - ctxp += ctx->rid & 0xff; + ctxp += ((ctx->slot & 0x1f) << 3) + (ctx->func & 0x7); return (ctxp); } static void -ctx_tag_init(struct dmar_ctx *ctx, device_t dev) +ctx_tag_init(struct dmar_ctx *ctx) { bus_addr_t maxaddr; @@ -127,7 +126,6 @@ ctx_tag_init(struct dmar_ctx *ctx, devic ctx->ctx_tag.common.nsegments = BUS_SPACE_UNRESTRICTED; ctx->ctx_tag.common.maxsegsz = maxaddr; ctx->ctx_tag.ctx = ctx; - ctx->ctx_tag.owner = dev; /* XXXKIB initialize tag further */ } @@ -140,10 +138,7 @@ ctx_id_entry_init(struct dmar_ctx *ctx, unit = ctx->dmar; KASSERT(ctxp->ctx1 == 0 && ctxp->ctx2 == 0, ("dmar%d: initialized ctx entry %d:%d:%d 0x%jx 0x%jx", - unit->unit, pci_get_bus(ctx->ctx_tag.owner), - pci_get_slot(ctx->ctx_tag.owner), - pci_get_function(ctx->ctx_tag.owner), - ctxp->ctx1, + unit->unit, ctx->bus, ctx->slot, ctx->func, ctxp->ctx1, ctxp->ctx2)); ctxp->ctx2 = DMAR_CTX2_DID(ctx->domain); ctxp->ctx2 |= ctx->awlvl; @@ -232,7 +227,7 @@ ctx_init_rmrr(struct dmar_ctx *ctx, devi } static struct dmar_ctx * -dmar_get_ctx_alloc(struct dmar_unit *dmar, uint16_t rid) +dmar_get_ctx_alloc(struct dmar_unit *dmar, int bus, int slot, int func) { struct dmar_ctx *ctx; @@ -242,7 +237,9 @@ dmar_get_ctx_alloc(struct dmar_unit *dma TASK_INIT(&ctx->unload_task, 0, dmar_ctx_unload_task, ctx); mtx_init(&ctx->lock, "dmarctx", NULL, MTX_DEF); ctx->dmar = dmar; - ctx->rid = rid; + ctx->bus = bus; + ctx->slot = slot; + ctx->func = func; return (ctx); } @@ -265,22 +262,19 @@ dmar_ctx_dtr(struct dmar_ctx *ctx, bool } struct dmar_ctx * -dmar_get_ctx(struct dmar_unit *dmar, device_t dev, uint16_t rid, bool id_mapped, - bool rmrr_init) +dmar_get_ctx(struct dmar_unit *dmar, device_t dev, int bus, int slot, int func, + bool id_mapped, bool rmrr_init) { struct dmar_ctx *ctx, *ctx1; dmar_ctx_entry_t *ctxp; struct sf_buf *sf; - int bus, slot, func, error, mgaw; + int error, mgaw; bool enable; - bus = pci_get_bus(dev); - slot = pci_get_slot(dev); - func = pci_get_function(dev); enable = false; TD_PREP_PINNED_ASSERT; DMAR_LOCK(dmar); - ctx = dmar_find_ctx_locked(dmar, rid); + ctx = dmar_find_ctx_locked(dmar, bus, slot, func); error = 0; if (ctx == NULL) { /* @@ -289,7 +283,7 @@ dmar_get_ctx(struct dmar_unit *dmar, dev */ DMAR_UNLOCK(dmar); dmar_ensure_ctx_page(dmar, bus); - ctx1 = dmar_get_ctx_alloc(dmar, rid); + ctx1 = dmar_get_ctx_alloc(dmar, bus, slot, func); if (id_mapped) { /* @@ -357,7 +351,7 @@ dmar_get_ctx(struct dmar_unit *dmar, dev * Recheck the contexts, other thread might have * already allocated needed one. */ - ctx = dmar_find_ctx_locked(dmar, rid); + ctx = dmar_find_ctx_locked(dmar, bus, slot, func); if (ctx == NULL) { ctx = ctx1; ctx->ctx_tag.owner = dev; @@ -369,7 +363,7 @@ dmar_get_ctx(struct dmar_unit *dmar, dev TD_PINNED_ASSERT; return (NULL); } - ctx_tag_init(ctx, dev); + ctx_tag_init(ctx); /* * This is the first activated context for the @@ -530,14 +524,14 @@ dmar_free_ctx(struct dmar_ctx *ctx) } struct dmar_ctx * -dmar_find_ctx_locked(struct dmar_unit *dmar, uint16_t rid) +dmar_find_ctx_locked(struct dmar_unit *dmar, int bus, int slot, int func) { struct dmar_ctx *ctx; DMAR_ASSERT_LOCKED(dmar); LIST_FOREACH(ctx, &dmar->contexts, link) { - if (ctx->rid == rid) + if (ctx->bus == bus && ctx->slot == slot && ctx->func == func) return (ctx); } return (NULL); Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Tue Apr 1 14:55:29 2014 (r264005) +++ head/sys/x86/iommu/intel_dmar.h Tue Apr 1 15:06:03 2014 (r264006) @@ -74,7 +74,9 @@ RB_PROTOTYPE(dmar_gas_entries_tree, dmar #define DMAR_MAP_ENTRY_TM 0x8000 /* Transient */ struct dmar_ctx { - uint16_t rid; /* pci RID */ + int bus; /* pci bus/slot/func */ + int slot; + int func; int domain; /* DID */ int mgaw; /* Real max address width */ int agaw; /* Adjusted guest address width */ @@ -267,11 +269,12 @@ void ctx_free_pgtbl(struct dmar_ctx *ctx struct dmar_ctx *dmar_instantiate_ctx(struct dmar_unit *dmar, device_t dev, bool rmrr); -struct dmar_ctx *dmar_get_ctx(struct dmar_unit *dmar, device_t dev, - uint16_t rid, bool id_mapped, bool rmrr_init); +struct dmar_ctx *dmar_get_ctx(struct dmar_unit *dmar, device_t dev, + int bus, int slot, int func, bool id_mapped, bool rmrr_init); void dmar_free_ctx_locked(struct dmar_unit *dmar, struct dmar_ctx *ctx); void dmar_free_ctx(struct dmar_ctx *ctx); -struct dmar_ctx *dmar_find_ctx_locked(struct dmar_unit *dmar, uint16_t rid); +struct dmar_ctx *dmar_find_ctx_locked(struct dmar_unit *dmar, int bus, + int slot, int func); void dmar_ctx_unload_entry(struct dmar_map_entry *entry, bool free); void dmar_ctx_unload(struct dmar_ctx *ctx, struct dmar_map_entries_tailq *entries, bool cansleep); Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Tue Apr 1 14:55:29 2014 (r264005) +++ head/sys/x86/iommu/intel_drv.c Tue Apr 1 15:06:03 2014 (r264006) @@ -1005,9 +1005,7 @@ dmar_print_ctx(struct dmar_ctx *ctx, boo db_printf( " @%p pci%d:%d:%d dom %d mgaw %d agaw %d pglvl %d end %jx\n" " refs %d flags %x pgobj %p map_ents %u loads %lu unloads %lu\n", - ctx, pci_get_bus(ctx->ctx_tag.owner), - pci_get_slot(ctx->ctx_tag.owner), - pci_get_function(ctx->ctx_tag.owner), ctx->domain, ctx->mgaw, + ctx, ctx->bus, ctx->slot, ctx->func, ctx->domain, ctx->mgaw, ctx->agaw, ctx->pglvl, (uintmax_t)ctx->end, ctx->refs, ctx->flags, ctx->pgtbl_obj, ctx->entries_cnt, ctx->loads, ctx->unloads); @@ -1080,10 +1078,8 @@ DB_FUNC(dmar_ctx, db_dmar_print_ctx, db_ for (i = 0; i < dmar_devcnt; i++) { unit = device_get_softc(dmar_devs[i]); LIST_FOREACH(ctx, &unit->contexts, link) { - if (domain == unit->segment && - bus == pci_get_bus(ctx->ctx_tag.owner) && - device == pci_get_slot(ctx->ctx_tag.owner) && - function == pci_get_function(ctx->ctx_tag.owner)) { + if (domain == unit->segment && bus == ctx->bus && + device == ctx->slot && function == ctx->func) { dmar_print_ctx(ctx, show_mappings); goto out; } Modified: head/sys/x86/iommu/intel_fault.c ============================================================================== --- head/sys/x86/iommu/intel_fault.c Tue Apr 1 14:55:29 2014 (r264005) +++ head/sys/x86/iommu/intel_fault.c Tue Apr 1 15:06:03 2014 (r264006) @@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include #include @@ -205,28 +203,19 @@ dmar_fault_task(void *arg, int pending _ DMAR_FAULT_UNLOCK(unit); sid = DMAR_FRCD2_SID(fault_rec[1]); + bus = (sid >> 8) & 0xf; + slot = (sid >> 3) & 0x1f; + func = sid & 0x7; printf("DMAR%d: ", unit->unit); DMAR_LOCK(unit); - ctx = dmar_find_ctx_locked(unit, sid); + ctx = dmar_find_ctx_locked(unit, bus, slot, func); if (ctx == NULL) { printf(":"); - - /* - * Note that the slot and function will not be correct - * if ARI is in use, but without a ctx entry we have - * no way of knowing whether ARI is in use or not. - */ - bus = PCI_RID2BUS(sid); - slot = PCI_RID2SLOT(sid); - func = PCI_RID2FUNC(sid); } else { ctx->flags |= DMAR_CTX_FAULTED; ctx->last_fault_rec[0] = fault_rec[0]; ctx->last_fault_rec[1] = fault_rec[1]; device_print_prettyname(ctx->ctx_tag.owner); - bus = pci_get_bus(ctx->ctx_tag.owner); - slot = pci_get_slot(ctx->ctx_tag.owner); - func = pci_get_function(ctx->ctx_tag.owner); } DMAR_UNLOCK(unit); printf( Modified: head/sys/x86/iommu/intel_utils.c ============================================================================== --- head/sys/x86/iommu/intel_utils.c Tue Apr 1 14:55:29 2014 (r264005) +++ head/sys/x86/iommu/intel_utils.c Tue Apr 1 15:06:03 2014 (r264006) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -130,10 +129,8 @@ ctx_set_agaw(struct dmar_ctx *ctx, int m } device_printf(ctx->dmar->dev, "context request mgaw %d for pci%d:%d:%d:%d, " - "no agaw found, sagaw %x\n", mgaw, ctx->dmar->segment, - pci_get_bus(ctx->ctx_tag.owner), - pci_get_slot(ctx->ctx_tag.owner), - pci_get_function(ctx->ctx_tag.owner), sagaw); + "no agaw found, sagaw %x\n", mgaw, ctx->dmar->segment, ctx->bus, + ctx->slot, ctx->func, sagaw); return (EINVAL); } From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 15:47:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9B801A8; Tue, 1 Apr 2014 15:47:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A4AF7B0; Tue, 1 Apr 2014 15:47:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31FlQLe048590; Tue, 1 Apr 2014 15:47:26 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31FlO2I048580; Tue, 1 Apr 2014 15:47:24 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201404011547.s31FlO2I048580@svn.freebsd.org> From: Ryan Stone Date: Tue, 1 Apr 2014 15:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264007 - in head/sys: conf dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 15:47:26 -0000 Author: rstone Date: Tue Apr 1 15:47:24 2014 New Revision: 264007 URL: http://svnweb.freebsd.org/changeset/base/264007 Log: Add a method to get the PCI RID for a device. Reviewed by: kib MFC after: 2 months Sponsored by: Sandvine Inc. Added: head/sys/dev/pci/pcib_support.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/pci/pci.c head/sys/dev/pci/pci_if.m head/sys/dev/pci/pci_pci.c head/sys/dev/pci/pcib_if.m head/sys/dev/pci/pcib_private.h head/sys/dev/pci/pcireg.h head/sys/dev/pci/pcivar.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Apr 1 15:06:03 2014 (r264006) +++ head/sys/conf/files Tue Apr 1 15:47:24 2014 (r264007) @@ -1951,6 +1951,7 @@ dev/pci/pci_pci.c optional pci dev/pci/pci_subr.c optional pci dev/pci/pci_user.c optional pci dev/pci/pcib_if.m standard +dev/pci/pcib_support.c standard dev/pci/vga_pci.c optional pci dev/pcn/if_pcn.c optional pcn pci dev/pdq/if_fea.c optional fea eisa Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Apr 1 15:06:03 2014 (r264006) +++ head/sys/dev/pci/pci.c Tue Apr 1 15:47:24 2014 (r264007) @@ -124,6 +124,8 @@ static void pci_resume_msix(device_t de static int pci_remap_intr_method(device_t bus, device_t dev, u_int irq); +static uint16_t pci_get_rid_method(device_t dev, device_t child); + static device_method_t pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, pci_probe), @@ -182,6 +184,7 @@ static device_method_t pci_methods[] = { DEVMETHOD(pci_release_msi, pci_release_msi_method), DEVMETHOD(pci_msi_count, pci_msi_count_method), DEVMETHOD(pci_msix_count, pci_msix_count_method), + DEVMETHOD(pci_get_rid, pci_get_rid_method), DEVMETHOD_END }; @@ -5055,3 +5058,10 @@ pci_restore_state(device_t dev) dinfo = device_get_ivars(dev); pci_cfg_restore(dev, dinfo); } + +static uint16_t +pci_get_rid_method(device_t dev, device_t child) +{ + + return (PCIB_GET_RID(device_get_parent(dev), child)); +} Modified: head/sys/dev/pci/pci_if.m ============================================================================== --- head/sys/dev/pci/pci_if.m Tue Apr 1 15:06:03 2014 (r264006) +++ head/sys/dev/pci/pci_if.m Tue Apr 1 15:47:24 2014 (r264007) @@ -159,3 +159,9 @@ METHOD int msix_count { device_t dev; device_t child; } DEFAULT null_msi_count; + +METHOD uint16_t get_rid { + device_t dev; + device_t child; +}; + Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Tue Apr 1 15:06:03 2014 (r264006) +++ head/sys/dev/pci/pci_pci.c Tue Apr 1 15:47:24 2014 (r264007) @@ -93,6 +93,7 @@ static device_method_t pcib_methods[] = DEVMETHOD(pcib_release_msix, pcib_release_msix), DEVMETHOD(pcib_map_msi, pcib_map_msi), DEVMETHOD(pcib_power_for_sleep, pcib_power_for_sleep), + DEVMETHOD(pcib_get_rid, pcib_get_rid), DEVMETHOD_END }; @@ -1934,3 +1935,4 @@ pcib_power_for_sleep(device_t pcib, devi bus = device_get_parent(pcib); return (PCIB_POWER_FOR_SLEEP(bus, dev, pstate)); } + Modified: head/sys/dev/pci/pcib_if.m ============================================================================== --- head/sys/dev/pci/pcib_if.m Tue Apr 1 15:06:03 2014 (r264006) +++ head/sys/dev/pci/pcib_if.m Tue Apr 1 15:47:24 2014 (r264007) @@ -154,3 +154,12 @@ METHOD int power_for_sleep { device_t dev; int *pstate; }; + +# +# Return the PCI Routing Identifier (RID) for the device. +# +METHOD uint16_t get_rid { + device_t pcib; + device_t dev; +}; + Modified: head/sys/dev/pci/pcib_private.h ============================================================================== --- head/sys/dev/pci/pcib_private.h Tue Apr 1 15:06:03 2014 (r264006) +++ head/sys/dev/pci/pcib_private.h Tue Apr 1 15:47:24 2014 (r264007) @@ -167,5 +167,7 @@ int pcib_release_msi(device_t pcib, dev int pcib_alloc_msix(device_t pcib, device_t dev, int *irq); int pcib_release_msix(device_t pcib, device_t dev, int irq); int pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data); +uint16_t pcib_get_rid(device_t pcib, device_t dev); + #endif Added: head/sys/dev/pci/pcib_support.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/pci/pcib_support.c Tue Apr 1 15:47:24 2014 (r264007) @@ -0,0 +1,62 @@ +/* + * Copyright (c) Sandvine Inc. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Support functions for the PCI:PCI bridge driver. This has to be in a + * separate file because kernel configurations end up referencing the functions + * here even when pci support is compiled out of the kernel. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "pcib_if.h" + +uint16_t +pcib_get_rid(device_t pcib, device_t dev) +{ + uint8_t bus, slot, func; + + bus = pci_get_bus(dev); + slot = pci_get_slot(dev); + func = pci_get_function(dev); + + return (PCI_RID(bus, slot, func)); +} + Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Tue Apr 1 15:06:03 2014 (r264006) +++ head/sys/dev/pci/pcireg.h Tue Apr 1 15:47:24 2014 (r264007) @@ -48,6 +48,23 @@ #define PCIE_REGMAX 4095 /* highest supported config register addr. */ #define PCI_MAXHDRTYPE 2 +#define PCI_RID_BUS_SHIFT 8 +#define PCI_RID_SLOT_SHIFT 3 +#define PCI_RID_FUNC_SHIFT 0 + +#define PCI_RID(bus, slot, func) \ + ((((bus) & PCI_BUSMAX) << PCI_RID_BUS_SHIFT) | \ + (((slot) & PCI_SLOTMAX) << PCI_RID_SLOT_SHIFT) | \ + (((func) & PCI_FUNCMAX) << PCI_RID_FUNC_SHIFT)) + +#define PCI_ARI_RID(bus, func) \ + ((((bus) & PCI_BUSMAX) << PCI_RID_BUS_SHIFT) | \ + (((func) & PCIE_ARI_FUNCMAX) << PCI_RID_FUNC_SHIFT)) + +#define PCI_RID2BUS(rid) (((rid) >> PCI_RID_BUS_SHIFT) & PCI_BUSMAX) +#define PCI_RID2SLOT(rid) (((rid) >> PCI_RID_SLOT_SHIFT) & PCI_SLOTMAX) +#define PCI_RID2FUNC(rid) (((rid) >> PCI_RID_FUNC_SHIFT) & PCI_FUNCMAX) + /* PCI config header registers for all devices */ #define PCIR_DEVVENDOR 0x00 Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Tue Apr 1 15:06:03 2014 (r264006) +++ head/sys/dev/pci/pcivar.h Tue Apr 1 15:47:24 2014 (r264007) @@ -482,6 +482,12 @@ pci_msix_count(device_t dev) return (PCI_MSIX_COUNT(device_get_parent(dev), dev)); } +static __inline uint16_t +pci_get_rid(device_t dev) +{ + return (PCI_GET_RID(device_get_parent(dev), 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); From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 15:48:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0AEC72F9; Tue, 1 Apr 2014 15:48:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAC377C0; Tue, 1 Apr 2014 15:48:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31FmlZc048788; Tue, 1 Apr 2014 15:48:47 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31FmktG048782; Tue, 1 Apr 2014 15:48:46 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201404011548.s31FmktG048782@svn.freebsd.org> From: Ryan Stone Date: Tue, 1 Apr 2014 15:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264008 - head/sys/x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 15:48:48 -0000 Author: rstone Date: Tue Apr 1 15:48:46 2014 New Revision: 264008 URL: http://svnweb.freebsd.org/changeset/base/264008 Log: Re-implement the DMAR I/O MMU code in terms of PCI RIDs Under the hood the VT-d spec is really implemented in terms of PCI RIDs instead of bus/slot/function, even though the spec makes pains to convert back to bus/slot/function in examples. However working with bus/slot/function is not correct when PCI ARI is in use, so convert to using RIDs in most cases. bus/slot/function will only be used when reporting errors to a user. Reviewed by: kib MFC after: 2 months Sponsored by: Sandvine Inc. Modified: head/sys/x86/iommu/busdma_dmar.c head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_drv.c head/sys/x86/iommu/intel_fault.c head/sys/x86/iommu/intel_utils.c Modified: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Tue Apr 1 15:47:24 2014 (r264007) +++ head/sys/x86/iommu/busdma_dmar.c Tue Apr 1 15:48:46 2014 (r264008) @@ -93,7 +93,7 @@ dmar_bus_dma_is_dev_disabled(int domain, * bounce mapping. */ static device_t -dmar_get_requester(device_t dev, int *bus, int *slot, int *func) +dmar_get_requester(device_t dev, uint16_t *rid) { devclass_t pci_class; device_t pci, pcib, requester; @@ -102,9 +102,7 @@ dmar_get_requester(device_t dev, int *bu pci_class = devclass_find("pci"); requester = dev; - *bus = pci_get_bus(dev); - *slot = pci_get_slot(dev); - *func = pci_get_function(dev); + *rid = pci_get_rid(dev); /* * Walk the bridge hierarchy from the target device to the @@ -161,8 +159,7 @@ dmar_get_requester(device_t dev, int *bu * same page tables for taken and * non-taken transactions. */ - *bus = pci_get_bus(dev); - *slot = *func = 0; + *rid = PCI_RID(pci_get_bus(dev), 0, 0); } else { /* * Neither the device nor the bridge @@ -171,9 +168,7 @@ dmar_get_requester(device_t dev, int *bu * will use the bridge's BSF as the * requester ID. */ - *bus = pci_get_bus(pcib); - *slot = pci_get_slot(pcib); - *func = pci_get_function(pcib); + *rid = pci_get_rid(pcib); } } /* @@ -193,9 +188,9 @@ dmar_instantiate_ctx(struct dmar_unit *d device_t requester; struct dmar_ctx *ctx; bool disabled; - int bus, slot, func; + uint16_t rid; - requester = dmar_get_requester(dev, &bus, &slot, &func); + requester = dmar_get_requester(dev, &rid); /* * If the user requested the IOMMU disabled for the device, we @@ -204,9 +199,10 @@ dmar_instantiate_ctx(struct dmar_unit *d * Instead provide the identity mapping for the device * context. */ - disabled = dmar_bus_dma_is_dev_disabled(pci_get_domain(dev), bus, - slot, func); - ctx = dmar_get_ctx(dmar, requester, bus, slot, func, disabled, rmrr); + disabled = dmar_bus_dma_is_dev_disabled(pci_get_domain(requester), + pci_get_bus(requester), pci_get_slot(requester), + pci_get_function(requester)); + ctx = dmar_get_ctx(dmar, requester, rid, disabled, rmrr); if (ctx == NULL) return (NULL); if (disabled) { Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Tue Apr 1 15:47:24 2014 (r264007) +++ head/sys/x86/iommu/intel_ctx.c Tue Apr 1 15:48:46 2014 (r264008) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include static MALLOC_DEFINE(M_DMAR_CTX, "dmar_ctx", "Intel DMAR Context"); @@ -105,14 +106,14 @@ dmar_map_ctx_entry(struct dmar_ctx *ctx, { dmar_ctx_entry_t *ctxp; - ctxp = dmar_map_pgtbl(ctx->dmar->ctx_obj, 1 + ctx->bus, + ctxp = dmar_map_pgtbl(ctx->dmar->ctx_obj, 1 + PCI_RID2BUS(ctx->rid), DMAR_PGF_NOALLOC | DMAR_PGF_WAITOK, sfp); - ctxp += ((ctx->slot & 0x1f) << 3) + (ctx->func & 0x7); + ctxp += ctx->rid & 0xff; return (ctxp); } static void -ctx_tag_init(struct dmar_ctx *ctx) +ctx_tag_init(struct dmar_ctx *ctx, device_t dev) { bus_addr_t maxaddr; @@ -126,6 +127,7 @@ ctx_tag_init(struct dmar_ctx *ctx) ctx->ctx_tag.common.nsegments = BUS_SPACE_UNRESTRICTED; ctx->ctx_tag.common.maxsegsz = maxaddr; ctx->ctx_tag.ctx = ctx; + ctx->ctx_tag.owner = dev; /* XXXKIB initialize tag further */ } @@ -138,7 +140,10 @@ ctx_id_entry_init(struct dmar_ctx *ctx, unit = ctx->dmar; KASSERT(ctxp->ctx1 == 0 && ctxp->ctx2 == 0, ("dmar%d: initialized ctx entry %d:%d:%d 0x%jx 0x%jx", - unit->unit, ctx->bus, ctx->slot, ctx->func, ctxp->ctx1, + unit->unit, pci_get_bus(ctx->ctx_tag.owner), + pci_get_slot(ctx->ctx_tag.owner), + pci_get_function(ctx->ctx_tag.owner), + ctxp->ctx1, ctxp->ctx2)); ctxp->ctx2 = DMAR_CTX2_DID(ctx->domain); ctxp->ctx2 |= ctx->awlvl; @@ -227,7 +232,7 @@ ctx_init_rmrr(struct dmar_ctx *ctx, devi } static struct dmar_ctx * -dmar_get_ctx_alloc(struct dmar_unit *dmar, int bus, int slot, int func) +dmar_get_ctx_alloc(struct dmar_unit *dmar, uint16_t rid) { struct dmar_ctx *ctx; @@ -237,9 +242,7 @@ dmar_get_ctx_alloc(struct dmar_unit *dma TASK_INIT(&ctx->unload_task, 0, dmar_ctx_unload_task, ctx); mtx_init(&ctx->lock, "dmarctx", NULL, MTX_DEF); ctx->dmar = dmar; - ctx->bus = bus; - ctx->slot = slot; - ctx->func = func; + ctx->rid = rid; return (ctx); } @@ -262,19 +265,22 @@ dmar_ctx_dtr(struct dmar_ctx *ctx, bool } struct dmar_ctx * -dmar_get_ctx(struct dmar_unit *dmar, device_t dev, int bus, int slot, int func, - bool id_mapped, bool rmrr_init) +dmar_get_ctx(struct dmar_unit *dmar, device_t dev, uint16_t rid, bool id_mapped, + bool rmrr_init) { struct dmar_ctx *ctx, *ctx1; dmar_ctx_entry_t *ctxp; struct sf_buf *sf; - int error, mgaw; + int bus, slot, func, error, mgaw; bool enable; + bus = pci_get_bus(dev); + slot = pci_get_slot(dev); + func = pci_get_function(dev); enable = false; TD_PREP_PINNED_ASSERT; DMAR_LOCK(dmar); - ctx = dmar_find_ctx_locked(dmar, bus, slot, func); + ctx = dmar_find_ctx_locked(dmar, rid); error = 0; if (ctx == NULL) { /* @@ -283,7 +289,7 @@ dmar_get_ctx(struct dmar_unit *dmar, dev */ DMAR_UNLOCK(dmar); dmar_ensure_ctx_page(dmar, bus); - ctx1 = dmar_get_ctx_alloc(dmar, bus, slot, func); + ctx1 = dmar_get_ctx_alloc(dmar, rid); if (id_mapped) { /* @@ -351,7 +357,7 @@ dmar_get_ctx(struct dmar_unit *dmar, dev * Recheck the contexts, other thread might have * already allocated needed one. */ - ctx = dmar_find_ctx_locked(dmar, bus, slot, func); + ctx = dmar_find_ctx_locked(dmar, rid); if (ctx == NULL) { ctx = ctx1; ctx->ctx_tag.owner = dev; @@ -363,7 +369,7 @@ dmar_get_ctx(struct dmar_unit *dmar, dev TD_PINNED_ASSERT; return (NULL); } - ctx_tag_init(ctx); + ctx_tag_init(ctx, dev); /* * This is the first activated context for the @@ -524,14 +530,14 @@ dmar_free_ctx(struct dmar_ctx *ctx) } struct dmar_ctx * -dmar_find_ctx_locked(struct dmar_unit *dmar, int bus, int slot, int func) +dmar_find_ctx_locked(struct dmar_unit *dmar, uint16_t rid) { struct dmar_ctx *ctx; DMAR_ASSERT_LOCKED(dmar); LIST_FOREACH(ctx, &dmar->contexts, link) { - if (ctx->bus == bus && ctx->slot == slot && ctx->func == func) + if (ctx->rid == rid) return (ctx); } return (NULL); Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Tue Apr 1 15:47:24 2014 (r264007) +++ head/sys/x86/iommu/intel_dmar.h Tue Apr 1 15:48:46 2014 (r264008) @@ -74,9 +74,7 @@ RB_PROTOTYPE(dmar_gas_entries_tree, dmar #define DMAR_MAP_ENTRY_TM 0x8000 /* Transient */ struct dmar_ctx { - int bus; /* pci bus/slot/func */ - int slot; - int func; + uint16_t rid; /* pci RID */ int domain; /* DID */ int mgaw; /* Real max address width */ int agaw; /* Adjusted guest address width */ @@ -269,12 +267,11 @@ void ctx_free_pgtbl(struct dmar_ctx *ctx struct dmar_ctx *dmar_instantiate_ctx(struct dmar_unit *dmar, device_t dev, bool rmrr); -struct dmar_ctx *dmar_get_ctx(struct dmar_unit *dmar, device_t dev, - int bus, int slot, int func, bool id_mapped, bool rmrr_init); +struct dmar_ctx *dmar_get_ctx(struct dmar_unit *dmar, device_t dev, + uint16_t rid, bool id_mapped, bool rmrr_init); void dmar_free_ctx_locked(struct dmar_unit *dmar, struct dmar_ctx *ctx); void dmar_free_ctx(struct dmar_ctx *ctx); -struct dmar_ctx *dmar_find_ctx_locked(struct dmar_unit *dmar, int bus, - int slot, int func); +struct dmar_ctx *dmar_find_ctx_locked(struct dmar_unit *dmar, uint16_t rid); void dmar_ctx_unload_entry(struct dmar_map_entry *entry, bool free); void dmar_ctx_unload(struct dmar_ctx *ctx, struct dmar_map_entries_tailq *entries, bool cansleep); Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Tue Apr 1 15:47:24 2014 (r264007) +++ head/sys/x86/iommu/intel_drv.c Tue Apr 1 15:48:46 2014 (r264008) @@ -1005,7 +1005,9 @@ dmar_print_ctx(struct dmar_ctx *ctx, boo db_printf( " @%p pci%d:%d:%d dom %d mgaw %d agaw %d pglvl %d end %jx\n" " refs %d flags %x pgobj %p map_ents %u loads %lu unloads %lu\n", - ctx, ctx->bus, ctx->slot, ctx->func, ctx->domain, ctx->mgaw, + ctx, pci_get_bus(ctx->ctx_tag.owner), + pci_get_slot(ctx->ctx_tag.owner), + pci_get_function(ctx->ctx_tag.owner), ctx->domain, ctx->mgaw, ctx->agaw, ctx->pglvl, (uintmax_t)ctx->end, ctx->refs, ctx->flags, ctx->pgtbl_obj, ctx->entries_cnt, ctx->loads, ctx->unloads); @@ -1078,8 +1080,10 @@ DB_FUNC(dmar_ctx, db_dmar_print_ctx, db_ for (i = 0; i < dmar_devcnt; i++) { unit = device_get_softc(dmar_devs[i]); LIST_FOREACH(ctx, &unit->contexts, link) { - if (domain == unit->segment && bus == ctx->bus && - device == ctx->slot && function == ctx->func) { + if (domain == unit->segment && + bus == pci_get_bus(ctx->ctx_tag.owner) && + device == pci_get_slot(ctx->ctx_tag.owner) && + function == pci_get_function(ctx->ctx_tag.owner)) { dmar_print_ctx(ctx, show_mappings); goto out; } Modified: head/sys/x86/iommu/intel_fault.c ============================================================================== --- head/sys/x86/iommu/intel_fault.c Tue Apr 1 15:47:24 2014 (r264007) +++ head/sys/x86/iommu/intel_fault.c Tue Apr 1 15:48:46 2014 (r264008) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -203,19 +205,28 @@ dmar_fault_task(void *arg, int pending _ DMAR_FAULT_UNLOCK(unit); sid = DMAR_FRCD2_SID(fault_rec[1]); - bus = (sid >> 8) & 0xf; - slot = (sid >> 3) & 0x1f; - func = sid & 0x7; printf("DMAR%d: ", unit->unit); DMAR_LOCK(unit); - ctx = dmar_find_ctx_locked(unit, bus, slot, func); + ctx = dmar_find_ctx_locked(unit, sid); if (ctx == NULL) { printf(":"); + + /* + * Note that the slot and function will not be correct + * if ARI is in use, but without a ctx entry we have + * no way of knowing whether ARI is in use or not. + */ + bus = PCI_RID2BUS(sid); + slot = PCI_RID2SLOT(sid); + func = PCI_RID2FUNC(sid); } else { ctx->flags |= DMAR_CTX_FAULTED; ctx->last_fault_rec[0] = fault_rec[0]; ctx->last_fault_rec[1] = fault_rec[1]; device_print_prettyname(ctx->ctx_tag.owner); + bus = pci_get_bus(ctx->ctx_tag.owner); + slot = pci_get_slot(ctx->ctx_tag.owner); + func = pci_get_function(ctx->ctx_tag.owner); } DMAR_UNLOCK(unit); printf( Modified: head/sys/x86/iommu/intel_utils.c ============================================================================== --- head/sys/x86/iommu/intel_utils.c Tue Apr 1 15:47:24 2014 (r264007) +++ head/sys/x86/iommu/intel_utils.c Tue Apr 1 15:48:46 2014 (r264008) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -129,8 +130,10 @@ ctx_set_agaw(struct dmar_ctx *ctx, int m } device_printf(ctx->dmar->dev, "context request mgaw %d for pci%d:%d:%d:%d, " - "no agaw found, sagaw %x\n", mgaw, ctx->dmar->segment, ctx->bus, - ctx->slot, ctx->func, sagaw); + "no agaw found, sagaw %x\n", mgaw, ctx->dmar->segment, + pci_get_bus(ctx->ctx_tag.owner), + pci_get_slot(ctx->ctx_tag.owner), + pci_get_function(ctx->ctx_tag.owner), sagaw); return (EINVAL); } From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 15:54:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CB064B7; Tue, 1 Apr 2014 15:54:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78E57865; Tue, 1 Apr 2014 15:54:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31Fs4wg052293; Tue, 1 Apr 2014 15:54:04 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31Fs3CF052288; Tue, 1 Apr 2014 15:54:03 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201404011554.s31Fs3CF052288@svn.freebsd.org> From: Ryan Stone Date: Tue, 1 Apr 2014 15:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264009 - in head/sys/amd64/vmm: amd intel io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 15:54:04 -0000 Author: rstone Date: Tue Apr 1 15:54:03 2014 New Revision: 264009 URL: http://svnweb.freebsd.org/changeset/base/264009 Log: Re-write bhyve's I/O MMU handling in terms of PCI RID. Reviewed by: neel MFC after: 2 months Sponsored by: Sandvine Inc. Modified: head/sys/amd64/vmm/amd/amdv.c head/sys/amd64/vmm/intel/vtd.c head/sys/amd64/vmm/io/iommu.c head/sys/amd64/vmm/io/iommu.h head/sys/amd64/vmm/io/ppt.c Modified: head/sys/amd64/vmm/amd/amdv.c ============================================================================== --- head/sys/amd64/vmm/amd/amdv.c Tue Apr 1 15:48:46 2014 (r264008) +++ head/sys/amd64/vmm/amd/amdv.c Tue Apr 1 15:54:03 2014 (r264009) @@ -242,14 +242,14 @@ amd_iommu_remove_mapping(void *domain, v } static void -amd_iommu_add_device(void *domain, int bus, int slot, int func) +amd_iommu_add_device(void *domain, uint16_t rid) { printf("amd_iommu_add_device: not implemented\n"); } static void -amd_iommu_remove_device(void *domain, int bus, int slot, int func) +amd_iommu_remove_device(void *domain, uint16_t rid) { printf("amd_iommu_remove_device: not implemented\n"); Modified: head/sys/amd64/vmm/intel/vtd.c ============================================================================== --- head/sys/amd64/vmm/intel/vtd.c Tue Apr 1 15:48:46 2014 (r264008) +++ head/sys/amd64/vmm/intel/vtd.c Tue Apr 1 15:54:03 2014 (r264009) @@ -99,6 +99,8 @@ struct vtdmap { #define VTD_PTE_SUPERPAGE (1UL << 7) #define VTD_PTE_ADDR_M (0x000FFFFFFFFFF000UL) +#define VTD_RID2IDX(rid) (((rid) & 0xff) * 2) + struct domain { uint64_t *ptp; /* first level page table page */ int pt_levels; /* number of page table levels */ @@ -360,27 +362,24 @@ vtd_disable(void) } static void -vtd_add_device(void *arg, int bus, int slot, int func) +vtd_add_device(void *arg, uint16_t rid) { int idx; uint64_t *ctxp; struct domain *dom = arg; vm_paddr_t pt_paddr; struct vtdmap *vtdmap; - - if (bus < 0 || bus > PCI_BUSMAX || - slot < 0 || slot > PCI_SLOTMAX || - func < 0 || func > PCI_FUNCMAX) - panic("vtd_add_device: invalid bsf %d/%d/%d", bus, slot, func); + uint8_t bus; vtdmap = vtdmaps[0]; + bus = PCI_RID2BUS(rid); ctxp = ctx_tables[bus]; pt_paddr = vtophys(dom->ptp); - idx = (slot << 3 | func) * 2; + idx = VTD_RID2IDX(rid); if (ctxp[idx] & VTD_CTX_PRESENT) { - panic("vtd_add_device: device %d/%d/%d is already owned by " - "domain %d", bus, slot, func, + panic("vtd_add_device: device %x is already owned by " + "domain %d", rid, (uint16_t)(ctxp[idx + 1] >> 8)); } @@ -404,19 +403,16 @@ vtd_add_device(void *arg, int bus, int s } static void -vtd_remove_device(void *arg, int bus, int slot, int func) +vtd_remove_device(void *arg, uint16_t rid) { int i, idx; uint64_t *ctxp; struct vtdmap *vtdmap; + uint8_t bus; - if (bus < 0 || bus > PCI_BUSMAX || - slot < 0 || slot > PCI_SLOTMAX || - func < 0 || func > PCI_FUNCMAX) - panic("vtd_add_device: invalid bsf %d/%d/%d", bus, slot, func); - + bus = PCI_RID2BUS(rid); ctxp = ctx_tables[bus]; - idx = (slot << 3 | func) * 2; + idx = VTD_RID2IDX(rid); /* * Order is important. The 'present' bit is must be cleared first. Modified: head/sys/amd64/vmm/io/iommu.c ============================================================================== --- head/sys/amd64/vmm/io/iommu.c Tue Apr 1 15:48:46 2014 (r264008) +++ head/sys/amd64/vmm/io/iommu.c Tue Apr 1 15:54:03 2014 (r264009) @@ -109,19 +109,19 @@ IOMMU_REMOVE_MAPPING(void *domain, vm_pa } static __inline void -IOMMU_ADD_DEVICE(void *domain, int bus, int slot, int func) +IOMMU_ADD_DEVICE(void *domain, uint16_t rid) { if (ops != NULL && iommu_avail) - (*ops->add_device)(domain, bus, slot, func); + (*ops->add_device)(domain, rid); } static __inline void -IOMMU_REMOVE_DEVICE(void *domain, int bus, int slot, int func) +IOMMU_REMOVE_DEVICE(void *domain, uint16_t rid) { if (ops != NULL && iommu_avail) - (*ops->remove_device)(domain, bus, slot, func); + (*ops->remove_device)(domain, rid); } static __inline void @@ -196,7 +196,8 @@ iommu_init(void) continue; /* everything else belongs to the host domain */ - iommu_add_device(host_domain, bus, slot, func); + iommu_add_device(host_domain, + pci_get_rid(dev)); } } } @@ -263,17 +264,17 @@ iommu_host_domain(void) } void -iommu_add_device(void *dom, int bus, int slot, int func) +iommu_add_device(void *dom, uint16_t rid) { - IOMMU_ADD_DEVICE(dom, bus, slot, func); + IOMMU_ADD_DEVICE(dom, rid); } void -iommu_remove_device(void *dom, int bus, int slot, int func) +iommu_remove_device(void *dom, uint16_t rid) { - IOMMU_REMOVE_DEVICE(dom, bus, slot, func); + IOMMU_REMOVE_DEVICE(dom, rid); } void Modified: head/sys/amd64/vmm/io/iommu.h ============================================================================== --- head/sys/amd64/vmm/io/iommu.h Tue Apr 1 15:48:46 2014 (r264008) +++ head/sys/amd64/vmm/io/iommu.h Tue Apr 1 15:54:03 2014 (r264009) @@ -39,8 +39,8 @@ typedef uint64_t (*iommu_create_mapping_ vm_paddr_t hpa, uint64_t len); typedef uint64_t (*iommu_remove_mapping_t)(void *domain, vm_paddr_t gpa, uint64_t len); -typedef void (*iommu_add_device_t)(void *domain, int bus, int slot, int func); -typedef void (*iommu_remove_device_t)(void *dom, int bus, int slot, int func); +typedef void (*iommu_add_device_t)(void *domain, uint16_t rid); +typedef void (*iommu_remove_device_t)(void *dom, uint16_t rid); typedef void (*iommu_invalidate_tlb_t)(void *dom); struct iommu_ops { @@ -69,7 +69,7 @@ void iommu_destroy_domain(void *dom); void iommu_create_mapping(void *dom, vm_paddr_t gpa, vm_paddr_t hpa, size_t len); void iommu_remove_mapping(void *dom, vm_paddr_t gpa, size_t len); -void iommu_add_device(void *dom, int bus, int slot, int func); -void iommu_remove_device(void *dom, int bus, int slot, int func); +void iommu_add_device(void *dom, uint16_t rid); +void iommu_remove_device(void *dom, uint16_t rid); void iommu_invalidate_tlb(void *domain); #endif Modified: head/sys/amd64/vmm/io/ppt.c ============================================================================== --- head/sys/amd64/vmm/io/ppt.c Tue Apr 1 15:48:46 2014 (r264008) +++ head/sys/amd64/vmm/io/ppt.c Tue Apr 1 15:54:03 2014 (r264009) @@ -346,7 +346,7 @@ ppt_assign_device(struct vm *vm, int bus return (EBUSY); ppt->vm = vm; - iommu_add_device(vm_iommu_domain(vm), bus, slot, func); + iommu_add_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); return (0); } return (ENOENT); @@ -367,7 +367,7 @@ ppt_unassign_device(struct vm *vm, int b ppt_unmap_mmio(vm, ppt); ppt_teardown_msi(ppt); ppt_teardown_msix(ppt); - iommu_remove_device(vm_iommu_domain(vm), bus, slot, func); + iommu_remove_device(vm_iommu_domain(vm), pci_get_rid(ppt->dev)); ppt->vm = NULL; return (0); } From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 15:56:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E08FD60E; Tue, 1 Apr 2014 15:56:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC30587B; Tue, 1 Apr 2014 15:56:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31FuVmw052663; Tue, 1 Apr 2014 15:56:31 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31FuVYk052661; Tue, 1 Apr 2014 15:56:31 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404011556.s31FuVYk052661@svn.freebsd.org> From: Ian Lepore Date: Tue, 1 Apr 2014 15:56:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264010 - head/sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 15:56:32 -0000 Author: ian Date: Tue Apr 1 15:56:31 2014 New Revision: 264010 URL: http://svnweb.freebsd.org/changeset/base/264010 Log: Support serial speeds up to 12mbaud with newer FTDI chips. Recent FDTI chips have the ability to operate at up to 12mbps. The newer chips with faster clocks have the same usb vendor/product IDs as the older chips; the bcdDevice field must be used to detect the newer versions. This change includes a new function to do that instead of using just the IDs from the vendor/product table. The code to choose the baud clock divisor is completely rewritten. In addition to supporting the new higher clock rates, the rewrite fixes a longstanding bug in the old code which put the high bits of the fractional part of the divisor into the wrong place in the wIndex field. That bug was mostly harmless -- it accidentally didn't affect standard baud rates and would only show up when using relatively fast non-standard rates. Modified: head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/serial/uftdi_reg.h Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Tue Apr 1 15:54:03 2014 (r264009) +++ head/sys/dev/usb/serial/uftdi.c Tue Apr 1 15:56:31 2014 (r264010) @@ -92,6 +92,21 @@ enum { UFTDI_N_TRANSFER, }; +enum { + DEVT_SIO, + DEVT_232A, + DEVT_232B, + DEVT_2232D, /* Includes 2232C */ + DEVT_232R, + DEVT_2232H, + DEVT_4232H, + DEVT_232H, + DEVT_230X, +}; + +#define DEVF_BAUDBITS_HINDEX 0x01 /* Baud bits in high byte of index. */ +#define DEVF_BAUDCLK_12M 0X02 /* Base baud clock is 12MHz. */ + struct uftdi_softc { struct ucom_super_softc sc_super_ucom; struct ucom_softc sc_ucom; @@ -105,15 +120,16 @@ struct uftdi_softc { uint16_t sc_last_lcr; - uint8_t sc_type; - uint8_t sc_iface_index; + uint8_t sc_devtype; + uint8_t sc_devflags; uint8_t sc_hdrlen; uint8_t sc_msr; uint8_t sc_lsr; }; struct uftdi_param_config { - uint16_t rate; + uint16_t baud_lobits; + uint16_t baud_hibits; uint16_t lcr; uint8_t v_start; uint8_t v_stop; @@ -135,8 +151,8 @@ static void uftdi_cfg_open(struct ucom_s static void uftdi_cfg_set_dtr(struct ucom_softc *, uint8_t); static void uftdi_cfg_set_rts(struct ucom_softc *, uint8_t); static void uftdi_cfg_set_break(struct ucom_softc *, uint8_t); -static int uftdi_set_parm_soft(struct termios *, - struct uftdi_param_config *, uint8_t); +static int uftdi_set_parm_soft(struct ucom_softc *, struct termios *, + struct uftdi_param_config *); static int uftdi_pre_param(struct ucom_softc *, struct termios *); static void uftdi_cfg_param(struct ucom_softc *, struct termios *); static void uftdi_cfg_get_status(struct ucom_softc *, uint8_t *, @@ -145,7 +161,6 @@ static void uftdi_start_read(struct ucom static void uftdi_stop_read(struct ucom_softc *); static void uftdi_start_write(struct ucom_softc *); static void uftdi_stop_write(struct ucom_softc *); -static uint8_t uftdi_8u232am_getrate(uint32_t, uint16_t *); static void uftdi_poll(struct ucom_softc *ucom); static const struct usb_config uftdi_config[UFTDI_N_TRANSFER] = { @@ -846,6 +861,80 @@ static const STRUCT_USB_HOST_ID uftdi_de #undef UFTDI_DEV }; +/* + * Set up softc fields whose value depends on the device type. + * + * Note that the 2232C and 2232D devices are the same for our purposes. In the + * silicon the difference is that the D series has CPU FIFO mode and C doesn't. + * I haven't found any way of determining the C/D difference from info provided + * by the chip other than trying to set CPU FIFO mode and having it work or not. + * + * Due to a hardware bug, a 232B chip without an eeprom reports itself as a + * 232A, but if the serial number is also zero we know it's really a 232B. + */ +static void +uftdi_devtype_setup(struct uftdi_softc *sc, struct usb_attach_arg *uaa) +{ + struct usb_device_descriptor *dd; + + switch (uaa->info.bcdDevice) { + case 0x200: + dd = usbd_get_device_descriptor(sc->sc_udev); + if (dd->iSerialNumber == 0) { + sc->sc_devtype = DEVT_232B; + } else { + sc->sc_devtype = DEVT_232A; + } + sc->sc_ucom.sc_portno = 0; + break; + case 0x400: + sc->sc_devtype = DEVT_232B; + sc->sc_ucom.sc_portno = 0; + break; + case 0x500: + sc->sc_devtype = DEVT_2232D; + sc->sc_devflags |= DEVF_BAUDBITS_HINDEX; + sc->sc_ucom.sc_portno = FTDI_PIT_SIOA + uaa->info.bIfaceNum; + break; + case 0x600: + sc->sc_devtype = DEVT_232R; + sc->sc_ucom.sc_portno = 0; + break; + case 0x700: + sc->sc_devtype = DEVT_2232H; + sc->sc_devflags |= DEVF_BAUDBITS_HINDEX | DEVF_BAUDCLK_12M; + sc->sc_ucom.sc_portno = FTDI_PIT_SIOA + uaa->info.bIfaceNum; + break; + case 0x800: + sc->sc_devtype = DEVT_4232H; + sc->sc_devflags |= DEVF_BAUDBITS_HINDEX | DEVF_BAUDCLK_12M; + sc->sc_ucom.sc_portno = FTDI_PIT_SIOA + uaa->info.bIfaceNum; + break; + case 0x900: + sc->sc_devtype = DEVT_232H; + sc->sc_devflags |= DEVF_BAUDBITS_HINDEX | DEVF_BAUDCLK_12M; + sc->sc_ucom.sc_portno = FTDI_PIT_SIOA + uaa->info.bIfaceNum; + break; + case 0x1000: + sc->sc_devtype = DEVT_230X; + sc->sc_devflags |= DEVF_BAUDBITS_HINDEX; + sc->sc_ucom.sc_portno = FTDI_PIT_SIOA + uaa->info.bIfaceNum; + break; + default: + if (uaa->info.bcdDevice < 0x200) { + sc->sc_devtype = DEVT_SIO; + sc->sc_hdrlen = 1; + } else { + sc->sc_devtype = DEVT_232R; + device_printf(sc->sc_dev, "Warning: unknown FTDI " + "device type, bcdDevice=0x%04x, assuming 232R", + uaa->info.bcdDevice); + } + sc->sc_ucom.sc_portno = 0; + break; + } +} + static int uftdi_probe(device_t dev) { @@ -885,6 +974,8 @@ uftdi_attach(device_t dev) struct uftdi_softc *sc = device_get_softc(dev); int error; + DPRINTF("\n"); + sc->sc_udev = uaa->device; sc->sc_dev = dev; sc->sc_unit = device_get_unit(dev); @@ -893,34 +984,11 @@ uftdi_attach(device_t dev) mtx_init(&sc->sc_mtx, "uftdi", NULL, MTX_DEF); ucom_ref(&sc->sc_super_ucom); - DPRINTF("\n"); - sc->sc_iface_index = uaa->info.bIfaceIndex; - sc->sc_type = USB_GET_DRIVER_INFO(uaa) & UFTDI_TYPE_MASK; - - switch (sc->sc_type) { - case UFTDI_TYPE_AUTO: - /* simplified type check */ - if (uaa->info.bcdDevice >= 0x0200 || - usbd_get_iface(uaa->device, 1) != NULL) { - sc->sc_type = UFTDI_TYPE_8U232AM; - sc->sc_hdrlen = 0; - } else { - sc->sc_type = UFTDI_TYPE_SIO; - sc->sc_hdrlen = 1; - } - break; - case UFTDI_TYPE_SIO: - sc->sc_hdrlen = 1; - break; - case UFTDI_TYPE_8U232AM: - default: - sc->sc_hdrlen = 0; - break; - } + uftdi_devtype_setup(sc, uaa); error = usbd_transfer_setup(uaa->device, - &sc->sc_iface_index, sc->sc_xfer, uftdi_config, + &uaa->info.bIfaceIndex, sc->sc_xfer, uftdi_config, UFTDI_N_TRANSFER, sc, &sc->sc_mtx); if (error) { @@ -928,8 +996,6 @@ uftdi_attach(device_t dev) "transfers failed\n"); goto detach; } - sc->sc_ucom.sc_portno = FTDI_PIT_SIOA + uaa->info.bIfaceNum; - /* clear stall at first run */ mtx_lock(&sc->sc_mtx); usbd_xfer_set_stall(sc->sc_xfer[UFTDI_BULK_DT_WR]); @@ -1192,57 +1258,161 @@ uftdi_cfg_set_break(struct ucom_softc *u &req, NULL, 0, 1000); } -static int -uftdi_set_parm_soft(struct termios *t, - struct uftdi_param_config *cfg, uint8_t type) +/* + * Return true if the given speed is within operational tolerance of the target + * speed. FTDI recommends that the hardware speed be within 3% of nominal. + */ +static inline boolean_t +uftdi_baud_within_tolerance(uint64_t speed, uint64_t target) { + return ((speed >= (target * 100) / 103) && + (speed <= (target * 100) / 97)); +} - memset(cfg, 0, sizeof(*cfg)); +static int +uftdi_sio_encode_baudrate(struct uftdi_softc *sc, speed_t speed, + struct uftdi_param_config *cfg) +{ + u_int i; + const speed_t sio_speeds[] = { + 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 + }; - switch (type) { - case UFTDI_TYPE_SIO: - switch (t->c_ospeed) { - case 300: - cfg->rate = ftdi_sio_b300; - break; - case 600: - cfg->rate = ftdi_sio_b600; - break; - case 1200: - cfg->rate = ftdi_sio_b1200; - break; - case 2400: - cfg->rate = ftdi_sio_b2400; - break; - case 4800: - cfg->rate = ftdi_sio_b4800; - break; - case 9600: - cfg->rate = ftdi_sio_b9600; - break; - case 19200: - cfg->rate = ftdi_sio_b19200; - break; - case 38400: - cfg->rate = ftdi_sio_b38400; - break; - case 57600: - cfg->rate = ftdi_sio_b57600; - break; - case 115200: - cfg->rate = ftdi_sio_b115200; - break; - default: - return (EINVAL); + /* + * The original SIO chips were limited to a small choice of speeds + * listed in an internal table of speeds chosen by an index value. + */ + for (i = 0; i < nitems(sio_speeds); ++i) { + if (speed == sio_speeds[i]) { + cfg->baud_lobits = i; + cfg->baud_hibits = 0; + return (0); } - break; + } + return (ERANGE); +} - case UFTDI_TYPE_8U232AM: - if (uftdi_8u232am_getrate(t->c_ospeed, &cfg->rate)) { - return (EINVAL); - } - break; +static int +uftdi_encode_baudrate(struct uftdi_softc *sc, speed_t speed, + struct uftdi_param_config *cfg) +{ + static const uint8_t encoded_fraction[8] = {0, 3, 2, 4, 1, 5, 6, 7}; + static const uint8_t roundoff_232a[16] = { + 0, 1, 0, 1, 0, -1, 2, 1, + 0, -1, -2, -3, 4, 3, 2, 1, + }; + uint32_t clk, divisor, fastclk_flag, frac, hwspeed; + + /* + * If this chip has the fast clock capability and the speed is within + * range, use the 12MHz clock, otherwise the standard clock is 3MHz. + */ + if ((sc->sc_devflags & DEVF_BAUDCLK_12M) && speed >= 1200) { + clk = 12000000; + fastclk_flag = (1 << 17); + } else { + clk = 3000000; + fastclk_flag = 0; + } + + /* + * Make sure the requested speed is reachable with the available clock + * and a 14-bit divisor. + */ + if (speed < (clk >> 14) || speed > clk) + return (ERANGE); + + /* + * Calculate the divisor, initially yielding a fixed point number with a + * 4-bit (1/16ths) fraction, then round it to the nearest fraction the + * hardware can handle. When the integral part of the divisor is + * greater than one, the fractional part is in 1/8ths of the base clock. + * The FT8U232AM chips can handle only 0.125, 0.250, and 0.5 fractions. + * Later chips can handle all 1/8th fractions. + * + * If the integral part of the divisor is 1, a special rule applies: the + * fractional part can only be .0 or .5 (this is a limitation of the + * hardware). We handle this by truncating the fraction rather than + * rounding, because this only applies to the two fastest speeds the + * chip can achieve and rounding doesn't matter, either you've asked for + * that exact speed or you've asked for something the chip can't do. + * + * For the FT8U232AM chips, use a roundoff table to adjust the result + * to the nearest 1/8th fraction that is supported by the hardware, + * leaving a fixed-point number with a 3-bit fraction which exactly + * represents the math the hardware divider will do. For later-series + * chips that support all 8 fractional divisors, just round 16ths to + * 8ths by adding 1 and dividing by 2. + */ + divisor = (clk << 4) / speed; + if ((divisor & 0xfffffff0) == 1) + divisor &= 0xfffffff8; + else if (sc->sc_devtype == DEVT_232A) + divisor += roundoff_232a[divisor & 0x0f]; + else + divisor += 1; /* Rounds odd 16ths up to next 8th. */ + divisor >>= 1; + + /* + * Ensure the resulting hardware speed will be within operational + * tolerance (within 3% of nominal). + */ + hwspeed = (clk << 3) / divisor; + if (!uftdi_baud_within_tolerance(hwspeed, speed)) + return (ERANGE); + + /* + * Re-pack the divisor into hardware format. The lower 14-bits hold the + * integral part, while the upper bits specify the fraction by indexing + * a table of fractions within the hardware which is laid out as: + * {0.0, 0.5, 0.25, 0.125, 0.325, 0.625, 0.725, 0.875} + * The A-series chips only have the first four table entries; the + * roundoff table logic above ensures that the fractional part for those + * chips will be one of the first four values. + * + * When the divisor is 1 a special encoding applies: 1.0 is encoded as + * 0.0, and 1.5 is encoded as 1.0. The rounding logic above has already + * ensured that the fraction is either .0 or .5 if the integral is 1. + */ + frac = divisor & 0x07; + divisor >>= 3; + if (divisor == 1) { + if (frac == 0) + divisor = 0; /* 1.0 becomes 0.0 */ + else + frac = 0; /* 1.5 becomes 1.0 */ } + divisor |= (encoded_fraction[frac] << 14) | fastclk_flag; + + cfg->baud_lobits = (uint16_t)divisor; + cfg->baud_hibits = (uint16_t)(divisor >> 16); + + /* + * If this chip requires the baud bits to be in the high byte of the + * index word, move the bits up to that location. + */ + if (sc->sc_devflags & DEVF_BAUDBITS_HINDEX) { + cfg->baud_hibits <<= 8; + } + + return (0); +} + +static int +uftdi_set_parm_soft(struct ucom_softc *ucom, struct termios *t, + struct uftdi_param_config *cfg) +{ + struct uftdi_softc *sc = ucom->sc_parent; + int err; + + memset(cfg, 0, sizeof(*cfg)); + + if (sc->sc_devtype == DEVT_SIO) + err = uftdi_sio_encode_baudrate(sc, t->c_ospeed, cfg); + else + err = uftdi_encode_baudrate(sc, t->c_ospeed, cfg); + if (err != 0) + return (err); if (t->c_cflag & CSTOPB) cfg->lcr = FTDI_SIO_SET_DATA_STOP_BITS_2; @@ -1293,12 +1463,11 @@ uftdi_set_parm_soft(struct termios *t, static int uftdi_pre_param(struct ucom_softc *ucom, struct termios *t) { - struct uftdi_softc *sc = ucom->sc_parent; struct uftdi_param_config cfg; DPRINTF("\n"); - return (uftdi_set_parm_soft(t, &cfg, sc->sc_type)); + return (uftdi_set_parm_soft(ucom, t, &cfg)); } static void @@ -1309,7 +1478,7 @@ uftdi_cfg_param(struct ucom_softc *ucom, struct uftdi_param_config cfg; struct usb_device_request req; - if (uftdi_set_parm_soft(t, &cfg, sc->sc_type)) { + if (uftdi_set_parm_soft(ucom, t, &cfg)) { /* should not happen */ return; } @@ -1319,8 +1488,8 @@ uftdi_cfg_param(struct ucom_softc *ucom, req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = FTDI_SIO_SET_BAUD_RATE; - USETW(req.wValue, cfg.rate); - USETW(req.wIndex, wIndex); + USETW(req.wValue, cfg.baud_lobits); + USETW(req.wIndex, cfg.baud_hibits | wIndex); USETW(req.wLength, 0); ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, NULL, 0, 1000); @@ -1386,75 +1555,6 @@ uftdi_stop_write(struct ucom_softc *ucom usbd_transfer_stop(sc->sc_xfer[UFTDI_BULK_DT_WR]); } -/*------------------------------------------------------------------------* - * uftdi_8u232am_getrate - * - * Return values: - * 0: Success - * Else: Failure - *------------------------------------------------------------------------*/ -static uint8_t -uftdi_8u232am_getrate(uint32_t speed, uint16_t *rate) -{ - /* Table of the nearest even powers-of-2 for values 0..15. */ - static const uint8_t roundoff[16] = { - 0, 2, 2, 4, 4, 4, 8, 8, - 8, 8, 8, 8, 16, 16, 16, 16, - }; - uint32_t d; - uint32_t freq; - uint16_t result; - - if ((speed < 178) || (speed > ((3000000 * 100) / 97))) - return (1); /* prevent numerical overflow */ - - /* Special cases for 2M and 3M. */ - if ((speed >= ((3000000 * 100) / 103)) && - (speed <= ((3000000 * 100) / 97))) { - result = 0; - goto done; - } - if ((speed >= ((2000000 * 100) / 103)) && - (speed <= ((2000000 * 100) / 97))) { - result = 1; - goto done; - } - d = (FTDI_8U232AM_FREQ << 4) / speed; - d = (d & ~15) + roundoff[d & 15]; - - if (d < FTDI_8U232AM_MIN_DIV) - d = FTDI_8U232AM_MIN_DIV; - else if (d > FTDI_8U232AM_MAX_DIV) - d = FTDI_8U232AM_MAX_DIV; - - /* - * Calculate the frequency needed for "d" to exactly divide down to - * our target "speed", and check that the actual frequency is within - * 3% of this. - */ - freq = (speed * d); - if ((freq < ((FTDI_8U232AM_FREQ * 1600ULL) / 103)) || - (freq > ((FTDI_8U232AM_FREQ * 1600ULL) / 97))) - return (1); - - /* - * Pack the divisor into the resultant value. The lower 14-bits - * hold the integral part, while the upper 2 bits encode the - * fractional component: either 0, 0.5, 0.25, or 0.125. - */ - result = (d >> 4); - if (d & 8) - result |= 0x4000; - else if (d & 4) - result |= 0x8000; - else if (d & 2) - result |= 0xc000; - -done: - *rate = result; - return (0); -} - static void uftdi_poll(struct ucom_softc *ucom) { Modified: head/sys/dev/usb/serial/uftdi_reg.h ============================================================================== --- head/sys/dev/usb/serial/uftdi_reg.h Tue Apr 1 15:54:03 2014 (r264009) +++ head/sys/dev/usb/serial/uftdi_reg.h Tue Apr 1 15:56:31 2014 (r264010) @@ -75,30 +75,12 @@ /* * BmRequestType: 0100 0000B * bRequest: FTDI_SIO_SET_BAUDRATE - * wValue: BaudRate value - see below - * wIndex: Port + * wValue: BaudRate low bits + * wIndex: Port and BaudRate high bits * wLength: 0 * Data: None */ /* FTDI_SIO_SET_BAUDRATE */ -enum { - ftdi_sio_b300 = 0, - ftdi_sio_b600 = 1, - ftdi_sio_b1200 = 2, - ftdi_sio_b2400 = 3, - ftdi_sio_b4800 = 4, - ftdi_sio_b9600 = 5, - ftdi_sio_b19200 = 6, - ftdi_sio_b38400 = 7, - ftdi_sio_b57600 = 8, - ftdi_sio_b115200 = 9 -}; - -#define FTDI_8U232AM_FREQ 3000000 - -/* Bounds for normal divisors as 4-bit fixed precision ints. */ -#define FTDI_8U232AM_MIN_DIV 0x20 -#define FTDI_8U232AM_MAX_DIV 0x3fff8 /* * BmRequestType: 0100 0000B From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 16:02:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 435FB7F8; Tue, 1 Apr 2014 16:02:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1552A92A; Tue, 1 Apr 2014 16:02:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31G23bV056334; Tue, 1 Apr 2014 16:02:03 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31G22QT056325; Tue, 1 Apr 2014 16:02:02 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201404011602.s31G22QT056325@svn.freebsd.org> From: Ryan Stone Date: Tue, 1 Apr 2014 16:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264011 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 16:02:04 -0000 Author: rstone Date: Tue Apr 1 16:02:02 2014 New Revision: 264011 URL: http://svnweb.freebsd.org/changeset/base/264011 Log: Add support for PCIe ARI PCIe Alternate RID Interpretation (ARI) is an optional feature that allows devices to have up to 256 different functions. It is implemented by always setting the PCI slot number to 0 and re-purposing the 5 bits used to encode the slot number to instead contain the function number. Combined with the original 3 bits allocated for the function number, this allows for 256 functions. This is enabled by default, but it's expected to be a no-op on currently supported hardware. It's a prerequisite for supporting PCI SR-IOV, and I want the ARI support to go in early to help shake out any bugs in it. ARI can be disabled by setting the tunable hw.pci.enable_ari=0. Reviewed by: kib MFC after: 2 months Sponsored by: Sandvine Inc. Modified: head/sys/dev/pci/pci.c head/sys/dev/pci/pci_pci.c head/sys/dev/pci/pcib_if.m head/sys/dev/pci/pcib_private.h head/sys/dev/pci/pcib_support.c head/sys/dev/pci/pcireg.h Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Apr 1 15:56:31 2014 (r264010) +++ head/sys/dev/pci/pci.c Tue Apr 1 16:02:02 2014 (r264011) @@ -354,6 +354,11 @@ SYSCTL_INT(_hw_pci, OID_AUTO, clear_buse "Ignore firmware-assigned bus numbers."); #endif +static int pci_enable_ari = 1; +TUNABLE_INT("hw.pci.enable_ari", &pci_enable_ari); +SYSCTL_INT(_hw_pci, OID_AUTO, enable_ari, CTLFLAG_RDTUN, &pci_enable_ari, + 0, "Enable support for PCIe Alternative RID Interpretation"); + static int pci_has_quirk(uint32_t devid, int quirk) { @@ -3454,6 +3459,19 @@ pci_add_resources(device_t bus, device_t #endif } +static struct pci_devinfo * +pci_identify_function(device_t pcib, device_t dev, int domain, int busno, + int slot, int func, size_t dinfo_size) +{ + struct pci_devinfo *dinfo; + + dinfo = pci_read_device(pcib, domain, busno, slot, func, dinfo_size); + if (dinfo != NULL) + pci_add_child(dev, dinfo); + + return (dinfo); +} + void pci_add_children(device_t dev, int domain, int busno, size_t dinfo_size) { @@ -3463,6 +3481,24 @@ pci_add_children(device_t dev, int domai int maxslots; int s, f, pcifunchigh; uint8_t hdrtype; + int first_func; + + /* + * Try to detect a device at slot 0, function 0. If it exists, try to + * enable ARI. We must enable ARI before detecting the rest of the + * functions on this bus as ARI changes the set of slots and functions + * that are legal on this bus. + */ + dinfo = pci_identify_function(pcib, dev, domain, busno, 0, 0, + dinfo_size); + if (dinfo != NULL && pci_enable_ari) + PCIB_TRY_ENABLE_ARI(pcib, dinfo->cfg.dev); + + /* + * Start looking for new devices on slot 0 at function 1 because we + * just identified the device at slot 0, function 0. + */ + first_func = 1; KASSERT(dinfo_size >= sizeof(struct pci_devinfo), ("dinfo_size too small")); @@ -3475,14 +3511,13 @@ pci_add_children(device_t dev, int domai if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE) continue; if (hdrtype & PCIM_MFDEV) - pcifunchigh = PCI_FUNCMAX; - for (f = 0; f <= pcifunchigh; f++) { - dinfo = pci_read_device(pcib, domain, busno, s, f, + pcifunchigh = PCIB_MAXFUNCS(pcib); + for (f = first_func; f <= pcifunchigh; f++) + pci_identify_function(pcib, dev, domain, busno, s, f, dinfo_size); - if (dinfo != NULL) { - pci_add_child(dev, dinfo); - } - } + + /* For slots after slot 0 we need to check for function 0. */ + first_func = 0; } #undef REG } Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Tue Apr 1 15:56:31 2014 (r264010) +++ head/sys/dev/pci/pci_pci.c Tue Apr 1 16:02:02 2014 (r264011) @@ -56,6 +56,14 @@ static int pcib_suspend(device_t dev); static int pcib_resume(device_t dev); static int pcib_power_for_sleep(device_t pcib, device_t dev, int *pstate); +static uint16_t pcib_ari_get_rid(device_t pcib, device_t dev); +static uint32_t pcib_read_config(device_t dev, u_int b, u_int s, + u_int f, u_int reg, int width); +static void pcib_write_config(device_t dev, u_int b, u_int s, + u_int f, u_int reg, uint32_t val, int width); +static int pcib_ari_maxslots(device_t dev); +static int pcib_ari_maxfuncs(device_t dev); +static int pcib_try_enable_ari(device_t pcib, device_t dev); static device_method_t pcib_methods[] = { /* Device interface */ @@ -83,7 +91,8 @@ static device_method_t pcib_methods[] = DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), /* pcib interface */ - DEVMETHOD(pcib_maxslots, pcib_maxslots), + DEVMETHOD(pcib_maxslots, pcib_ari_maxslots), + DEVMETHOD(pcib_maxfuncs, pcib_ari_maxfuncs), DEVMETHOD(pcib_read_config, pcib_read_config), DEVMETHOD(pcib_write_config, pcib_write_config), DEVMETHOD(pcib_route_interrupt, pcib_route_interrupt), @@ -93,7 +102,8 @@ static device_method_t pcib_methods[] = DEVMETHOD(pcib_release_msix, pcib_release_msix), DEVMETHOD(pcib_map_msi, pcib_map_msi), DEVMETHOD(pcib_power_for_sleep, pcib_power_for_sleep), - DEVMETHOD(pcib_get_rid, pcib_get_rid), + DEVMETHOD(pcib_get_rid, pcib_ari_get_rid), + DEVMETHOD(pcib_try_enable_ari, pcib_try_enable_ari), DEVMETHOD_END }; @@ -1803,27 +1813,94 @@ pcib_alloc_resource(device_t dev, device #endif /* + * If ARI is enabled on this downstream port, translate the function number + * to the non-ARI slot/function. The downstream port will convert it back in + * hardware. If ARI is not enabled slot and func are not modified. + */ +static __inline void +pcib_xlate_ari(device_t pcib, int bus, int *slot, int *func) +{ + struct pcib_softc *sc; + int ari_func; + + sc = device_get_softc(pcib); + ari_func = *func; + + if (sc->flags & PCIB_ENABLE_ARI) { + KASSERT(*slot == 0, + ("Non-zero slot number with ARI enabled!")); + *slot = PCIE_ARI_SLOT(ari_func); + *func = PCIE_ARI_FUNC(ari_func); + } +} + + +static void +pcib_enable_ari(struct pcib_softc *sc, uint32_t pcie_pos) +{ + uint32_t ctl2; + + ctl2 = pci_read_config(sc->dev, pcie_pos + PCIER_DEVICE_CTL2, 4); + ctl2 |= PCIEM_CTL2_ARI; + pci_write_config(sc->dev, pcie_pos + PCIER_DEVICE_CTL2, ctl2, 4); + + sc->flags |= PCIB_ENABLE_ARI; +} + +/* * PCIB interface. */ int pcib_maxslots(device_t dev) { - return(PCI_SLOTMAX); + return (PCI_SLOTMAX); +} + +static int +pcib_ari_maxslots(device_t dev) +{ + struct pcib_softc *sc; + + sc = device_get_softc(dev); + + if (sc->flags & PCIB_ENABLE_ARI) + return (PCIE_ARI_SLOTMAX); + else + return (PCI_SLOTMAX); +} + +static int +pcib_ari_maxfuncs(device_t dev) +{ + struct pcib_softc *sc; + + sc = device_get_softc(dev); + + if (sc->flags & PCIB_ENABLE_ARI) + return (PCIE_ARI_FUNCMAX); + else + return (PCI_FUNCMAX); } /* * Since we are a child of a PCI bus, its parent must support the pcib interface. */ -uint32_t +static uint32_t pcib_read_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, int width) { - return(PCIB_READ_CONFIG(device_get_parent(device_get_parent(dev)), b, s, f, reg, width)); + + pcib_xlate_ari(dev, b, &s, &f); + return(PCIB_READ_CONFIG(device_get_parent(device_get_parent(dev)), b, s, + f, reg, width)); } -void +static void pcib_write_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, uint32_t val, int width) { - PCIB_WRITE_CONFIG(device_get_parent(device_get_parent(dev)), b, s, f, reg, val, width); + + pcib_xlate_ari(dev, b, &s, &f); + PCIB_WRITE_CONFIG(device_get_parent(device_get_parent(dev)), b, s, f, + reg, val, width); } /* @@ -1936,3 +2013,82 @@ pcib_power_for_sleep(device_t pcib, devi return (PCIB_POWER_FOR_SLEEP(bus, dev, pstate)); } +static uint16_t +pcib_ari_get_rid(device_t pcib, device_t dev) +{ + struct pcib_softc *sc; + uint8_t bus, slot, func; + + sc = device_get_softc(pcib); + + if (sc->flags & PCIB_ENABLE_ARI) { + bus = pci_get_bus(dev); + func = pci_get_function(dev); + + return (PCI_ARI_RID(bus, func)); + } else { + bus = pci_get_bus(dev); + slot = pci_get_slot(dev); + func = pci_get_function(dev); + + return (PCI_RID(bus, slot, func)); + } +} + +/* + * Check that the downstream port (pcib) and the endpoint device (dev) both + * support ARI. If so, enable it and return 0, otherwise return an error. + */ +static int +pcib_try_enable_ari(device_t pcib, device_t dev) +{ + struct pcib_softc *sc; + int error; + uint32_t cap2; + int ari_cap_off; + uint32_t ari_ver; + uint32_t pcie_pos; + + sc = device_get_softc(pcib); + + /* + * ARI is controlled in a register in the PCIe capability structure. + * If the downstream port does not have the PCIe capability structure + * then it does not support ARI. + */ + error = pci_find_cap(pcib, PCIY_EXPRESS, &pcie_pos); + if (error != 0) + return (ENODEV); + + /* Check that the PCIe port advertises ARI support. */ + cap2 = pci_read_config(pcib, pcie_pos + PCIER_DEVICE_CAP2, 4); + if (!(cap2 & PCIEM_CAP2_ARI)) + return (ENODEV); + + /* + * Check that the endpoint device advertises ARI support via the ARI + * extended capability structure. + */ + error = pci_find_extcap(dev, PCIZ_ARI, &ari_cap_off); + if (error != 0) + return (ENODEV); + + /* + * Finally, check that the endpoint device supports the same version + * of ARI that we do. + */ + ari_ver = pci_read_config(dev, ari_cap_off, 4); + if (PCI_EXTCAP_VER(ari_ver) != PCIB_SUPPORTED_ARI_VER) { + if (bootverbose) + device_printf(pcib, + "Unsupported version of ARI (%d) detected\n", + PCI_EXTCAP_VER(ari_ver)); + + return (ENXIO); + } + + pcib_enable_ari(sc, pcie_pos); + + return (0); +} + Modified: head/sys/dev/pci/pcib_if.m ============================================================================== --- head/sys/dev/pci/pcib_if.m Tue Apr 1 15:56:31 2014 (r264010) +++ head/sys/dev/pci/pcib_if.m Tue Apr 1 16:02:02 2014 (r264011) @@ -27,7 +27,9 @@ # #include +#include #include +#include INTERFACE pcib; @@ -47,6 +49,14 @@ METHOD int maxslots { }; # +# +# Return the number of functions on the attached PCI bus. +# +METHOD int maxfuncs { + device_t dev; +} DEFAULT pcib_maxfuncs; + +# # Read configuration space on the PCI bus. The bus, slot and func # arguments determine the device which is being read and the reg # argument is a byte offset into configuration space for that @@ -161,5 +171,14 @@ METHOD int power_for_sleep { METHOD uint16_t get_rid { device_t pcib; device_t dev; +} DEFAULT pcib_get_rid; + +# +# Enable Alternative RID Interpretation if both the downstream port (pcib) +# and the endpoint device (dev) both support it. +# +METHOD int try_enable_ari { + device_t pcib; + device_t dev; }; Modified: head/sys/dev/pci/pcib_private.h ============================================================================== --- head/sys/dev/pci/pcib_private.h Tue Apr 1 15:56:31 2014 (r264010) +++ head/sys/dev/pci/pcib_private.h Tue Apr 1 16:02:02 2014 (r264011) @@ -105,6 +105,7 @@ struct pcib_softc #define PCIB_SUBTRACTIVE 0x1 #define PCIB_DISABLE_MSI 0x2 #define PCIB_DISABLE_MSIX 0x4 +#define PCIB_ENABLE_ARI 0x8 uint16_t command; /* command register */ u_int domain; /* domain number */ u_int pribus; /* primary bus number */ @@ -126,6 +127,8 @@ struct pcib_softc uint8_t seclat; /* secondary bus latency timer */ }; +#define PCIB_SUPPORTED_ARI_VER 1 + typedef uint32_t pci_read_config_fn(int b, int s, int f, int reg, int width); int host_pcib_get_busno(pci_read_config_fn read_config, int bus, @@ -159,8 +162,7 @@ int pcib_release_resource(device_t dev, struct resource *r); #endif int pcib_maxslots(device_t dev); -uint32_t pcib_read_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, int width); -void pcib_write_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, uint32_t val, int width); +int pcib_maxfuncs(device_t dev); int pcib_route_interrupt(device_t pcib, device_t dev, int pin); int pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs); int pcib_release_msi(device_t pcib, device_t dev, int count, int *irqs); @@ -169,5 +171,4 @@ int pcib_release_msix(device_t pcib, de int pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data); uint16_t pcib_get_rid(device_t pcib, device_t dev); - #endif Modified: head/sys/dev/pci/pcib_support.c ============================================================================== --- head/sys/dev/pci/pcib_support.c Tue Apr 1 15:56:31 2014 (r264010) +++ head/sys/dev/pci/pcib_support.c Tue Apr 1 16:02:02 2014 (r264011) @@ -48,6 +48,12 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" +int +pcib_maxfuncs(device_t dev) +{ + return (PCI_FUNCMAX); +} + uint16_t pcib_get_rid(device_t pcib, device_t dev) { Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Tue Apr 1 15:56:31 2014 (r264010) +++ head/sys/dev/pci/pcireg.h Tue Apr 1 16:02:02 2014 (r264011) @@ -48,6 +48,9 @@ #define PCIE_REGMAX 4095 /* highest supported config register addr. */ #define PCI_MAXHDRTYPE 2 +#define PCIE_ARI_SLOTMAX 0 +#define PCIE_ARI_FUNCMAX 255 + #define PCI_RID_BUS_SHIFT 8 #define PCI_RID_SLOT_SHIFT 3 #define PCI_RID_FUNC_SHIFT 0 @@ -65,6 +68,9 @@ #define PCI_RID2SLOT(rid) (((rid) >> PCI_RID_SLOT_SHIFT) & PCI_SLOTMAX) #define PCI_RID2FUNC(rid) (((rid) >> PCI_RID_FUNC_SHIFT) & PCI_FUNCMAX) +#define PCIE_ARI_SLOT(func) (((func) >> PCI_RID_SLOT_SHIFT) & PCI_SLOTMAX) +#define PCIE_ARI_FUNC(func) (((func) >> PCI_RID_FUNC_SHIFT) & PCI_FUNCMAX) + /* PCI config header registers for all devices */ #define PCIR_DEVVENDOR 0x00 @@ -791,6 +797,7 @@ #define PCIEM_ROOT_STA_PME_STATUS 0x00010000 #define PCIEM_ROOT_STA_PME_PEND 0x00020000 #define PCIER_DEVICE_CAP2 0x24 +#define PCIEM_CAP2_ARI 0x20 #define PCIER_DEVICE_CTL2 0x28 #define PCIEM_CTL2_COMP_TIMEOUT_VAL 0x000f #define PCIEM_CTL2_COMP_TIMEOUT_DIS 0x0010 @@ -911,3 +918,4 @@ /* Serial Number definitions */ #define PCIR_SERIAL_LOW 0x04 #define PCIR_SERIAL_HIGH 0x08 + From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 16:03:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5D0D95F; Tue, 1 Apr 2014 16:03:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90807942; Tue, 1 Apr 2014 16:03:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31G3qaU056559; Tue, 1 Apr 2014 16:03:52 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31G3qvl056558; Tue, 1 Apr 2014 16:03:52 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201404011603.s31G3qvl056558@svn.freebsd.org> From: Ryan Stone Date: Tue, 1 Apr 2014 16:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264012 - head/usr.sbin/pciconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 16:03:52 -0000 Author: rstone Date: Tue Apr 1 16:03:52 2014 New Revision: 264012 URL: http://svnweb.freebsd.org/changeset/base/264012 Log: Print status of ARI capability in pciconf -c Teach pciconf how to print out the status (enabled/disabled) of the ARI capability on PCI Root Complexes and Downstream Ports. MFC after: 2 months Sponsored by: Sandvine Inc. Modified: head/usr.sbin/pciconf/cap.c Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Tue Apr 1 16:02:02 2014 (r264011) +++ head/usr.sbin/pciconf/cap.c Tue Apr 1 16:03:52 2014 (r264012) @@ -410,7 +410,7 @@ aspm_string(uint8_t aspm) static void cap_express(int fd, struct pci_conf *p, uint8_t ptr) { - uint32_t cap; + uint32_t cap, cap2; uint16_t ctl, flags, sta; flags = read_config(fd, &p->pc_sel, ptr + PCIER_FLAGS, 2); @@ -452,6 +452,7 @@ cap_express(int fd, struct pci_conf *p, if (flags & PCIEM_FLAGS_IRQ) printf(" IRQ %d", (flags & PCIEM_FLAGS_IRQ) >> 9); cap = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CAP, 4); + cap2 = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CAP2, 4); ctl = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CTL, 2); printf(" max data %d(%d)", MAX_PAYLOAD((ctl & PCIEM_CTL_MAX_PAYLOAD) >> 5), @@ -474,6 +475,11 @@ cap_express(int fd, struct pci_conf *p, printf(" ASPM %s(%s)", aspm_string(ctl & PCIEM_LINK_CTL_ASPMC), aspm_string((cap & PCIEM_LINK_CAP_ASPM) >> 10)); } + if ((cap2 & PCIEM_CAP2_ARI) != 0) { + ctl = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CTL2, 4); + printf(" ARI %s", + (ctl & PCIEM_CTL2_ARI) ? "enabled" : "disabled"); + } } static void From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 17:35:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1135D961; Tue, 1 Apr 2014 17:35:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F23392D5; Tue, 1 Apr 2014 17:35:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31HZVMl094668; Tue, 1 Apr 2014 17:35:31 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31HZVFE094667; Tue, 1 Apr 2014 17:35:31 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201404011735.s31HZVFE094667@svn.freebsd.org> From: Ryan Stone Date: Tue, 1 Apr 2014 17:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264013 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 17:35:32 -0000 Author: rstone Date: Tue Apr 1 17:35:31 2014 New Revision: 264013 URL: http://svnweb.freebsd.org/changeset/base/264013 Log: Add missing copyright date. MFC after: 2 months Modified: head/sys/dev/pci/pcib_support.c Modified: head/sys/dev/pci/pcib_support.c ============================================================================== --- head/sys/dev/pci/pcib_support.c Tue Apr 1 16:03:52 2014 (r264012) +++ head/sys/dev/pci/pcib_support.c Tue Apr 1 17:35:31 2014 (r264013) @@ -1,5 +1,5 @@ /* - * Copyright (c) Sandvine Inc. All rights reserved. + * Copyright (c) 2014 Sandvine Inc. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 18:37:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D0932F1; Tue, 1 Apr 2014 18:37:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0ABE7B33; Tue, 1 Apr 2014 18:37:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31Ib0np020404; Tue, 1 Apr 2014 18:37:00 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31Ib0D7020403; Tue, 1 Apr 2014 18:37:00 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201404011837.s31Ib0D7020403@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 1 Apr 2014 18:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264016 - head/tools/test/ppsapi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 18:37:01 -0000 Author: gnn Date: Tue Apr 1 18:37:00 2014 New Revision: 264016 URL: http://svnweb.freebsd.org/changeset/base/264016 Log: Silence an unnecessary warning. MFC after: 2 weeks Modified: head/tools/test/ppsapi/Makefile Modified: head/tools/test/ppsapi/Makefile ============================================================================== --- head/tools/test/ppsapi/Makefile Tue Apr 1 18:24:40 2014 (r264015) +++ head/tools/test/ppsapi/Makefile Tue Apr 1 18:37:00 2014 (r264016) @@ -7,5 +7,7 @@ WARNS?= 5 .include +CFLAGS+=-Wno-format-security + test: ${PROG} ./${PROG} /dev/cuau0 From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 18:38:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0CB145E; Tue, 1 Apr 2014 18:38:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD77EB52; Tue, 1 Apr 2014 18:38:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31Ic4JO020578; Tue, 1 Apr 2014 18:38:04 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31Ic4Tj020577; Tue, 1 Apr 2014 18:38:04 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201404011838.s31Ic4Tj020577@svn.freebsd.org> From: Michael Tuexen Date: Tue, 1 Apr 2014 18:38:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264017 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 18:38:05 -0000 Author: tuexen Date: Tue Apr 1 18:38:04 2014 New Revision: 264017 URL: http://svnweb.freebsd.org/changeset/base/264017 Log: Increment the SSN only after processing the last fragment of an ordered user message. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue Apr 1 18:37:00 2014 (r264016) +++ head/sys/netinet/sctp_output.c Tue Apr 1 18:38:04 2014 (r264017) @@ -7367,7 +7367,8 @@ dont_do_it: chk->pad_inplace = 0; chk->no_fr_allowed = 0; chk->rec.data.stream_seq = strq->next_sequence_send; - if (rcv_flags & SCTP_DATA_LAST_FRAG) { + if ((rcv_flags & SCTP_DATA_LAST_FRAG) && + !(rcv_flags & SCTP_DATA_UNORDERED)) { strq->next_sequence_send++; } chk->rec.data.stream_number = sp->stream; From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 18:41:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 506D1864; Tue, 1 Apr 2014 18:41:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E35EBFE; Tue, 1 Apr 2014 18:41:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31IftDd023888; Tue, 1 Apr 2014 18:41:55 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31IftPV023887; Tue, 1 Apr 2014 18:41:55 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404011841.s31IftPV023887@svn.freebsd.org> From: Ian Lepore Date: Tue, 1 Apr 2014 18:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264018 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 18:41:55 -0000 Author: ian Date: Tue Apr 1 18:41:54 2014 New Revision: 264018 URL: http://svnweb.freebsd.org/changeset/base/264018 Log: Update the list of FTDI chips supported by uftdi(4). Modified: head/share/man/man4/uftdi.4 Modified: head/share/man/man4/uftdi.4 ============================================================================== --- head/share/man/man4/uftdi.4 Tue Apr 1 18:38:04 2014 (r264017) +++ head/share/man/man4/uftdi.4 Tue Apr 1 18:41:54 2014 (r264018) @@ -29,12 +29,13 @@ .\" .\" $FreeBSD$ .\" -.Dd November 20, 2011 +.Dd March 31, 2014 .Dt UFTDI 4 .Os .Sh NAME .Nm uftdi -.Nd USB support for serial adapters based on the FT8U100AX and FT8U232AM chips +.Nd USB support for serial adapters based on the FTDI family of USB +serial adapter chips. .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -54,8 +55,29 @@ uftdi_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for various serial adapters based on the FTDI -FT2232C, FT8U100AX and FT8U232AM chips. +driver provides support for various serial adapters based on the +following FTDI chips: +.Pp +.Bl -bullet -compact +.It +FT8U100AX +.It +FT8U232AM +.It +FT8U232BM +.It +FT232R +.It +FT2232C +.It +FT2232D +.It +FT2232H +.It +FT4232H +.It +FT230X +.El .Pp The device is accessed through the .Xr ucom 4 From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 18:46:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19A10BD5; Tue, 1 Apr 2014 18:46:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE5B6C45; Tue, 1 Apr 2014 18:46:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31IkuQu024650; Tue, 1 Apr 2014 18:46:56 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31IkuQj024648; Tue, 1 Apr 2014 18:46:56 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201404011846.s31IkuQj024648@svn.freebsd.org> From: Luiz Otavio O Souza Date: Tue, 1 Apr 2014 18:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264019 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 18:46:57 -0000 Author: loos Date: Tue Apr 1 18:46:56 2014 New Revision: 264019 URL: http://svnweb.freebsd.org/changeset/base/264019 Log: Fix some of the style(9) problems on ti_gpio. Note that this commit does not fix all the style(9) problems, but will open room for the next commits. Remove redundant code and declarations. No functional changes. Modified: head/sys/arm/ti/ti_gpio.c Modified: head/sys/arm/ti/ti_gpio.c ============================================================================== --- head/sys/arm/ti/ti_gpio.c Tue Apr 1 18:41:54 2014 (r264018) +++ head/sys/arm/ti/ti_gpio.c Tue Apr 1 18:46:56 2014 (r264019) @@ -66,92 +66,88 @@ __FBSDID("$FreeBSD$"); #include "gpio_if.h" - /* Register definitions */ -#define TI_GPIO_REVISION 0x0000 -#define TI_GPIO_SYSCONFIG 0x0010 +/* Register definitions */ +#define TI_GPIO_REVISION 0x0000 +#define TI_GPIO_SYSCONFIG 0x0010 #if defined(SOC_OMAP3) -#define TI_GPIO_REVISION 0x0000 -#define TI_GPIO_SYSCONFIG 0x0010 -#define TI_GPIO_SYSSTATUS 0x0014 -#define TI_GPIO_IRQSTATUS1 0x0018 -#define TI_GPIO_IRQENABLE1 0x001C -#define TI_GPIO_WAKEUPENABLE 0x0020 -#define TI_GPIO_IRQSTATUS2 0x0028 -#define TI_GPIO_IRQENABLE2 0x002C -#define TI_GPIO_CTRL 0x0030 -#define TI_GPIO_OE 0x0034 -#define TI_GPIO_DATAIN 0x0038 -#define TI_GPIO_DATAOUT 0x003C -#define TI_GPIO_LEVELDETECT0 0x0040 -#define TI_GPIO_LEVELDETECT1 0x0044 -#define TI_GPIO_RISINGDETECT 0x0048 -#define TI_GPIO_FALLINGDETECT 0x004C -#define TI_GPIO_DEBOUNCENABLE 0x0050 -#define TI_GPIO_DEBOUNCINGTIME 0x0054 -#define TI_GPIO_CLEARIRQENABLE1 0x0060 -#define TI_GPIO_SETIRQENABLE1 0x0064 -#define TI_GPIO_CLEARIRQENABLE2 0x0070 -#define TI_GPIO_SETIRQENABLE2 0x0074 -#define TI_GPIO_CLEARWKUENA 0x0080 -#define TI_GPIO_SETWKUENA 0x0084 -#define TI_GPIO_CLEARDATAOUT 0x0090 -#define TI_GPIO_SETDATAOUT 0x0094 +#define TI_GPIO_SYSSTATUS 0x0014 +#define TI_GPIO_IRQSTATUS1 0x0018 +#define TI_GPIO_IRQENABLE1 0x001C +#define TI_GPIO_WAKEUPENABLE 0x0020 +#define TI_GPIO_IRQSTATUS2 0x0028 +#define TI_GPIO_IRQENABLE2 0x002C +#define TI_GPIO_CTRL 0x0030 +#define TI_GPIO_OE 0x0034 +#define TI_GPIO_DATAIN 0x0038 +#define TI_GPIO_DATAOUT 0x003C +#define TI_GPIO_LEVELDETECT0 0x0040 +#define TI_GPIO_LEVELDETECT1 0x0044 +#define TI_GPIO_RISINGDETECT 0x0048 +#define TI_GPIO_FALLINGDETECT 0x004C +#define TI_GPIO_DEBOUNCENABLE 0x0050 +#define TI_GPIO_DEBOUNCINGTIME 0x0054 +#define TI_GPIO_CLEARIRQENABLE1 0x0060 +#define TI_GPIO_SETIRQENABLE1 0x0064 +#define TI_GPIO_CLEARIRQENABLE2 0x0070 +#define TI_GPIO_SETIRQENABLE2 0x0074 +#define TI_GPIO_CLEARWKUENA 0x0080 +#define TI_GPIO_SETWKUENA 0x0084 +#define TI_GPIO_CLEARDATAOUT 0x0090 +#define TI_GPIO_SETDATAOUT 0x0094 #elif defined(SOC_OMAP4) || defined(SOC_TI_AM335X) -#define TI_GPIO_IRQSTATUS_RAW_0 0x0024 -#define TI_GPIO_IRQSTATUS_RAW_1 0x0028 -#define TI_GPIO_IRQSTATUS_0 0x002C -#define TI_GPIO_IRQSTATUS_1 0x0030 -#define TI_GPIO_IRQSTATUS_SET_0 0x0034 -#define TI_GPIO_IRQSTATUS_SET_1 0x0038 -#define TI_GPIO_IRQSTATUS_CLR_0 0x003C -#define TI_GPIO_IRQSTATUS_CLR_1 0x0040 -#define TI_GPIO_IRQWAKEN_0 0x0044 -#define TI_GPIO_IRQWAKEN_1 0x0048 -#define TI_GPIO_SYSSTATUS 0x0114 -#define TI_GPIO_IRQSTATUS1 0x0118 -#define TI_GPIO_IRQENABLE1 0x011C -#define TI_GPIO_WAKEUPENABLE 0x0120 -#define TI_GPIO_IRQSTATUS2 0x0128 -#define TI_GPIO_IRQENABLE2 0x012C -#define TI_GPIO_CTRL 0x0130 -#define TI_GPIO_OE 0x0134 -#define TI_GPIO_DATAIN 0x0138 -#define TI_GPIO_DATAOUT 0x013C -#define TI_GPIO_LEVELDETECT0 0x0140 -#define TI_GPIO_LEVELDETECT1 0x0144 -#define TI_GPIO_RISINGDETECT 0x0148 -#define TI_GPIO_FALLINGDETECT 0x014C -#define TI_GPIO_DEBOUNCENABLE 0x0150 -#define TI_GPIO_DEBOUNCINGTIME 0x0154 -#define TI_GPIO_CLEARIRQENABLE1 0x0160 -#define TI_GPIO_SETIRQENABLE1 0x0164 -#define TI_GPIO_CLEARIRQENABLE2 0x0170 -#define TI_GPIO_SETIRQENABLE2 0x0174 -#define TI_GPIO_CLEARWKUPENA 0x0180 -#define TI_GPIO_SETWKUENA 0x0184 -#define TI_GPIO_CLEARDATAOUT 0x0190 -#define TI_GPIO_SETDATAOUT 0x0194 +#define TI_GPIO_IRQSTATUS_RAW_0 0x0024 +#define TI_GPIO_IRQSTATUS_RAW_1 0x0028 +#define TI_GPIO_IRQSTATUS_0 0x002C +#define TI_GPIO_IRQSTATUS_1 0x0030 +#define TI_GPIO_IRQSTATUS_SET_0 0x0034 +#define TI_GPIO_IRQSTATUS_SET_1 0x0038 +#define TI_GPIO_IRQSTATUS_CLR_0 0x003C +#define TI_GPIO_IRQSTATUS_CLR_1 0x0040 +#define TI_GPIO_IRQWAKEN_0 0x0044 +#define TI_GPIO_IRQWAKEN_1 0x0048 +#define TI_GPIO_SYSSTATUS 0x0114 +#define TI_GPIO_IRQSTATUS1 0x0118 +#define TI_GPIO_IRQENABLE1 0x011C +#define TI_GPIO_WAKEUPENABLE 0x0120 +#define TI_GPIO_IRQSTATUS2 0x0128 +#define TI_GPIO_IRQENABLE2 0x012C +#define TI_GPIO_CTRL 0x0130 +#define TI_GPIO_OE 0x0134 +#define TI_GPIO_DATAIN 0x0138 +#define TI_GPIO_DATAOUT 0x013C +#define TI_GPIO_LEVELDETECT0 0x0140 +#define TI_GPIO_LEVELDETECT1 0x0144 +#define TI_GPIO_RISINGDETECT 0x0148 +#define TI_GPIO_FALLINGDETECT 0x014C +#define TI_GPIO_DEBOUNCENABLE 0x0150 +#define TI_GPIO_DEBOUNCINGTIME 0x0154 +#define TI_GPIO_CLEARIRQENABLE1 0x0160 +#define TI_GPIO_SETIRQENABLE1 0x0164 +#define TI_GPIO_CLEARIRQENABLE2 0x0170 +#define TI_GPIO_SETIRQENABLE2 0x0174 +#define TI_GPIO_CLEARWKUPENA 0x0180 +#define TI_GPIO_SETWKUENA 0x0184 +#define TI_GPIO_CLEARDATAOUT 0x0190 +#define TI_GPIO_SETDATAOUT 0x0194 #else #error "Unknown SoC" #endif - /*Other SoC Specific definitions*/ +/* Other SoC Specific definitions */ #if defined(SOC_OMAP3) -#define MAX_GPIO_BANKS 6 -#define FIRST_GPIO_BANK 1 -#define PINS_PER_BANK 32 -#define TI_GPIO_REV 0x00000025 +#define MAX_GPIO_BANKS 6 +#define FIRST_GPIO_BANK 1 +#define TI_GPIO_REV 0x00000025 #elif defined(SOC_OMAP4) -#define MAX_GPIO_BANKS 6 -#define FIRST_GPIO_BANK 1 -#define PINS_PER_BANK 32 -#define TI_GPIO_REV 0x50600801 +#define MAX_GPIO_BANKS 6 +#define FIRST_GPIO_BANK 1 +#define TI_GPIO_REV 0x50600801 #elif defined(SOC_TI_AM335X) -#define MAX_GPIO_BANKS 4 -#define FIRST_GPIO_BANK 0 -#define PINS_PER_BANK 32 -#define TI_GPIO_REV 0x50600801 +#define MAX_GPIO_BANKS 4 +#define FIRST_GPIO_BANK 0 +#define TI_GPIO_REV 0x50600801 #endif +#define PINS_PER_BANK 32 /** * ti_gpio_mem_spec - Resource specification used when allocating resources @@ -189,34 +185,38 @@ static struct resource_spec ti_gpio_irq_ * This structure is allocated during driver attach. */ struct ti_gpio_softc { - device_t sc_dev; + device_t sc_dev; - /* The memory resource(s) for the PRCM register set, when the device is - * created the caller can assign up to 4 memory regions. + /* + * The memory resource(s) for the PRCM register set, when the device is + * created the caller can assign up to 6 memory regions depending on + * the SoC type. */ - struct resource* sc_mem_res[MAX_GPIO_BANKS]; - struct resource* sc_irq_res[MAX_GPIO_BANKS]; + struct resource *sc_mem_res[MAX_GPIO_BANKS]; + struct resource *sc_irq_res[MAX_GPIO_BANKS]; - /* The handle for the register IRQ handlers */ - void* sc_irq_hdl[MAX_GPIO_BANKS]; + /* The handle for the register IRQ handlers. */ + void *sc_irq_hdl[MAX_GPIO_BANKS]; - /* The following describes the H/W revision of each of the GPIO banks */ - uint32_t sc_revision[MAX_GPIO_BANKS]; + /* + * The following describes the H/W revision of each of the GPIO banks. + */ + uint32_t sc_revision[MAX_GPIO_BANKS]; - struct mtx sc_mtx; + struct mtx sc_mtx; }; /** * Macros for driver mutex locking */ -#define TI_GPIO_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) -#define TI_GPIO_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define TI_GPIO_LOCK_INIT(_sc) \ +#define TI_GPIO_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define TI_GPIO_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define TI_GPIO_LOCK_INIT(_sc) \ mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), \ - "ti_gpio", MTX_DEF) -#define TI_GPIO_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define TI_GPIO_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define TI_GPIO_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); + "ti_gpio", MTX_DEF) +#define TI_GPIO_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx) +#define TI_GPIO_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED) +#define TI_GPIO_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED) /** * ti_gpio_read_4 - reads a 16-bit value from one of the PADCONFS registers @@ -441,7 +441,6 @@ ti_gpio_pin_setflags(device_t dev, uint3 (GPIO_PIN_PULLUP|GPIO_PIN_PULLDOWN)) return (EINVAL); - TI_GPIO_LOCK(sc); /* Sanity check the pin number is valid */ @@ -464,7 +463,6 @@ ti_gpio_pin_setflags(device_t dev, uint3 reg_val &= ~mask; ti_gpio_write_4(sc, bank, TI_GPIO_OE, reg_val); - TI_GPIO_UNLOCK(sc); return (0); @@ -635,6 +633,7 @@ ti_gpio_probe(device_t dev) return (ENXIO); device_set_desc(dev, "TI General Purpose I/O (GPIO)"); + return (0); } @@ -665,7 +664,6 @@ ti_gpio_attach(device_t dev) TI_GPIO_LOCK_INIT(sc); - /* There are up to 6 different GPIO register sets located in different * memory areas on the chip. The memory range should have been set for * the driver when it was added as a child. @@ -684,7 +682,7 @@ ti_gpio_attach(device_t dev) } /* Setup the IRQ resources */ - for (i = 0; i < MAX_GPIO_BANKS; i++) { + for (i = 0; i < MAX_GPIO_BANKS; i++) { if (sc->sc_irq_res[i] == NULL) break; @@ -696,15 +694,12 @@ ti_gpio_attach(device_t dev) } } - /* Store the device handle back in the sc */ - sc->sc_dev = dev; - /* We need to go through each block and ensure the clocks are running and * the module is enabled. It might be better to do this only when the * pins are configured which would result in less power used if the GPIO * pins weren't used ... */ - for (i = 0; i < MAX_GPIO_BANKS; i++) { + for (i = 0; i < MAX_GPIO_BANKS; i++) { if (sc->sc_mem_res[i] != NULL) { /* Enable the interface and functional clocks for the module */ @@ -770,7 +765,7 @@ ti_gpio_detach(device_t dev) KASSERT(mtx_initialized(&sc->sc_mtx), ("gpio mutex not initialized")); /* Disable all interrupts */ - for (i = 0; i < MAX_GPIO_BANKS; i++) { + for (i = 0; i < MAX_GPIO_BANKS; i++) { if (sc->sc_mem_res[i] != NULL) { ti_gpio_write_4(sc, i, TI_GPIO_CLEARIRQENABLE1, 0xffffffff); ti_gpio_write_4(sc, i, TI_GPIO_CLEARIRQENABLE2, 0xffffffff); @@ -780,7 +775,7 @@ ti_gpio_detach(device_t dev) bus_generic_detach(dev); /* Release the memory and IRQ resources */ - for (i = 0; i < MAX_GPIO_BANKS; i++) { + for (i = 0; i < MAX_GPIO_BANKS; i++) { if (sc->sc_mem_res[i] != NULL) bus_release_resource(dev, SYS_RES_MEMORY, i, sc->sc_mem_res[i]); if (sc->sc_irq_res[i] != NULL) @@ -789,7 +784,7 @@ ti_gpio_detach(device_t dev) TI_GPIO_LOCK_DESTROY(sc); - return(0); + return (0); } static phandle_t From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 21:13:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC5FD9EF; Tue, 1 Apr 2014 21:13:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B970ECCD; Tue, 1 Apr 2014 21:13:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31LD5wD086338; Tue, 1 Apr 2014 21:13:05 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31LD54C086337; Tue, 1 Apr 2014 21:13:05 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404012113.s31LD54C086337@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 1 Apr 2014 21:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264020 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 21:13:06 -0000 Author: trasz Date: Tue Apr 1 21:13:05 2014 New Revision: 264020 URL: http://svnweb.freebsd.org/changeset/base/264020 Log: Remove the homegrown ctl_be_block_io allocator, replacing it with UMA. There is no performance difference. Reviewed by: mav@ Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Tue Apr 1 18:46:56 2014 (r264019) +++ head/sys/cam/ctl/ctl_backend_block.c Tue Apr 1 21:13:05 2014 (r264020) @@ -173,9 +173,7 @@ struct ctl_be_block_lun { * Overall softc structure for the block backend module. */ struct ctl_be_block_softc { - STAILQ_HEAD(, ctl_be_block_io) beio_free_queue; struct mtx lock; - int prealloc_beio; int num_disks; STAILQ_HEAD(, ctl_block_disk) disk_list; int num_luns; @@ -205,7 +203,6 @@ struct ctl_be_block_io { uint64_t io_offset; struct ctl_be_block_softc *softc; struct ctl_be_block_lun *lun; - STAILQ_ENTRY(ctl_be_block_io) links; }; static int cbb_num_threads = 14; @@ -217,10 +214,6 @@ SYSCTL_INT(_kern_cam_ctl_block, OID_AUTO static struct ctl_be_block_io *ctl_alloc_beio(struct ctl_be_block_softc *softc); static void ctl_free_beio(struct ctl_be_block_io *beio); -static int ctl_grow_beio(struct ctl_be_block_softc *softc, int count); -#if 0 -static void ctl_shrink_beio(struct ctl_be_block_softc *softc); -#endif static void ctl_complete_beio(struct ctl_be_block_io *beio); static int ctl_be_block_move_done(union ctl_io *io); static void ctl_be_block_biodone(struct bio *bio); @@ -282,68 +275,24 @@ static struct ctl_backend_driver ctl_be_ MALLOC_DEFINE(M_CTLBLK, "ctlblk", "Memory used for CTL block backend"); CTL_BACKEND_DECLARE(cbb, ctl_be_block_driver); +static uma_zone_t beio_zone; + static struct ctl_be_block_io * ctl_alloc_beio(struct ctl_be_block_softc *softc) { struct ctl_be_block_io *beio; - int count; - - mtx_lock(&softc->lock); - - beio = STAILQ_FIRST(&softc->beio_free_queue); - if (beio != NULL) { - STAILQ_REMOVE(&softc->beio_free_queue, beio, - ctl_be_block_io, links); - } - mtx_unlock(&softc->lock); - - if (beio != NULL) { - bzero(beio, sizeof(*beio)); - beio->softc = softc; - return (beio); - } - - for (;;) { - - count = ctl_grow_beio(softc, /*count*/ 10); - - /* - * This shouldn't be possible, since ctl_grow_beio() uses a - * blocking malloc. - */ - if (count == 0) - return (NULL); - - /* - * Since we have to drop the lock when we're allocating beio - * structures, it's possible someone else can come along and - * allocate the beio's we've just allocated. - */ - mtx_lock(&softc->lock); - beio = STAILQ_FIRST(&softc->beio_free_queue); - if (beio != NULL) { - STAILQ_REMOVE(&softc->beio_free_queue, beio, - ctl_be_block_io, links); - } - mtx_unlock(&softc->lock); - if (beio != NULL) { - bzero(beio, sizeof(*beio)); - beio->softc = softc; - break; - } - } + beio = uma_zalloc(beio_zone, M_WAITOK | M_ZERO); + beio->softc = softc; return (beio); } static void ctl_free_beio(struct ctl_be_block_io *beio) { - struct ctl_be_block_softc *softc; int duplicate_free; int i; - softc = beio->softc; duplicate_free = 0; for (i = 0; i < beio->num_segs; i++) { @@ -358,47 +307,10 @@ ctl_free_beio(struct ctl_be_block_io *be printf("%s: %d duplicate frees out of %d segments\n", __func__, duplicate_free, beio->num_segs); } - mtx_lock(&softc->lock); - STAILQ_INSERT_TAIL(&softc->beio_free_queue, beio, links); - mtx_unlock(&softc->lock); -} -static int -ctl_grow_beio(struct ctl_be_block_softc *softc, int count) -{ - int i; - - for (i = 0; i < count; i++) { - struct ctl_be_block_io *beio; - - beio = (struct ctl_be_block_io *)malloc(sizeof(*beio), - M_CTLBLK, - M_WAITOK | M_ZERO); - beio->softc = softc; - mtx_lock(&softc->lock); - STAILQ_INSERT_TAIL(&softc->beio_free_queue, beio, links); - mtx_unlock(&softc->lock); - } - - return (i); + uma_zfree(beio_zone, beio); } -#if 0 -static void -ctl_shrink_beio(struct ctl_be_block_softc *softc) -{ - struct ctl_be_block_io *beio, *beio_tmp; - - mtx_lock(&softc->lock); - STAILQ_FOREACH_SAFE(beio, &softc->beio_free_queue, links, beio_tmp) { - STAILQ_REMOVE(&softc->beio_free_queue, beio, - ctl_be_block_io, links); - free(beio, M_CTLBLK); - } - mtx_unlock(&softc->lock); -} -#endif - static void ctl_complete_beio(struct ctl_be_block_io *beio) { @@ -933,16 +845,7 @@ ctl_be_block_cw_dispatch(struct ctl_be_b softc = be_lun->softc; beio = ctl_alloc_beio(softc); - if (beio == NULL) { - /* - * This should not happen. ctl_alloc_beio() will call - * ctl_grow_beio() with a blocking malloc as needed. - * A malloc with M_WAITOK should not fail. - */ - ctl_set_busy(&io->scsiio); - ctl_done(io); - return; - } + KASSERT(beio != NULL, ("ctl_alloc_beio() failed")); beio->io = io; beio->softc = softc; @@ -1013,16 +916,7 @@ ctl_be_block_dispatch(struct ctl_be_bloc } beio = ctl_alloc_beio(softc); - if (beio == NULL) { - /* - * This should not happen. ctl_alloc_beio() will call - * ctl_grow_beio() with a blocking malloc as needed. - * A malloc with M_WAITOK should not fail. - */ - ctl_set_busy(&io->scsiio); - ctl_done(io); - return; - } + KASSERT(beio != NULL, ("ctl_alloc_beio() failed")); beio->io = io; beio->softc = softc; @@ -2342,10 +2236,10 @@ ctl_be_block_init(void) retval = 0; mtx_init(&softc->lock, "ctlblk", NULL, MTX_DEF); - STAILQ_INIT(&softc->beio_free_queue); + beio_zone = uma_zcreate("beio", sizeof(struct ctl_be_block_io), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); STAILQ_INIT(&softc->disk_list); STAILQ_INIT(&softc->lun_list); - ctl_grow_beio(softc, 200); return (retval); } From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 21:30:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BAF5F462; Tue, 1 Apr 2014 21:30:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7D1BE4E; Tue, 1 Apr 2014 21:30:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31LUsKe092604; Tue, 1 Apr 2014 21:30:54 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31LUsYu092603; Tue, 1 Apr 2014 21:30:54 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404012130.s31LUsYu092603@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 1 Apr 2014 21:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264021 - head/lib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 21:30:54 -0000 Author: jilles Date: Tue Apr 1 21:30:54 2014 New Revision: 264021 URL: http://svnweb.freebsd.org/changeset/base/264021 Log: libnv: Don't lose big-endian flag when receiving a message. A bug caused the "big endian" flag to be lost when receiving a message. As a result, the bits are interpreted as little endian and an extremely large allocation is attempted. This change fixes ping(8)'s communication to casperd(8) on big-endian architectures. Reported by: Anton Shterenlikht Tested by: danfe Modified: head/lib/libnv/nvlist.c Modified: head/lib/libnv/nvlist.c ============================================================================== --- head/lib/libnv/nvlist.c Tue Apr 1 21:13:05 2014 (r264020) +++ head/lib/libnv/nvlist.c Tue Apr 1 21:30:54 2014 (r264021) @@ -582,7 +582,7 @@ nvlist_check_header(struct nvlist_header errno = EINVAL; return (false); } - if ((nvlhdrp->nvlh_flags &= ~NV_FLAG_ALL_MASK) != 0) { + if ((nvlhdrp->nvlh_flags & ~NV_FLAG_ALL_MASK) != 0) { errno = EINVAL; return (false); } From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 21:40:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86B3D659; Tue, 1 Apr 2014 21:40:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 674B4F81; Tue, 1 Apr 2014 21:40:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31Lel2T098315; Tue, 1 Apr 2014 21:40:47 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31LekKi098309; Tue, 1 Apr 2014 21:40:46 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404012140.s31LekKi098309@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 1 Apr 2014 21:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264022 - in head/sys: cam/ctl dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 21:40:47 -0000 Author: trasz Date: Tue Apr 1 21:40:46 2014 New Revision: 264022 URL: http://svnweb.freebsd.org/changeset/base/264022 Log: Get rid of ICL lock; use upper-layer (initiator or target) lock instead. This avoids extra locking in icl_pdu_queue(); the upper layer needs to call it while holding its own lock anyway, to avoid sending PDUs out of order. Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/dev/iscsi/icl.c head/sys/dev/iscsi/icl.h head/sys/dev/iscsi/iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Apr 1 21:30:54 2014 (r264021) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Apr 1 21:40:46 2014 (r264022) @@ -1215,7 +1215,7 @@ cfiscsi_session_new(struct cfiscsi_softc cv_init(&cs->cs_login_cv, "cfiscsi_login"); #endif - cs->cs_conn = icl_conn_new(); + cs->cs_conn = icl_conn_new(&cs->cs_lock); cs->cs_conn->ic_receive = cfiscsi_receive_callback; cs->cs_conn->ic_error = cfiscsi_error_callback; cs->cs_conn->ic_prv0 = cs; Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Tue Apr 1 21:30:54 2014 (r264021) +++ head/sys/dev/iscsi/icl.c Tue Apr 1 21:40:46 2014 (r264022) @@ -88,9 +88,10 @@ static volatile u_int icl_ncons; } \ } while (0) -#define ICL_CONN_LOCK(X) mtx_lock(&X->ic_lock) -#define ICL_CONN_UNLOCK(X) mtx_unlock(&X->ic_lock) -#define ICL_CONN_LOCK_ASSERT(X) mtx_assert(&X->ic_lock, MA_OWNED) +#define ICL_CONN_LOCK(X) mtx_lock(X->ic_lock) +#define ICL_CONN_UNLOCK(X) mtx_unlock(X->ic_lock) +#define ICL_CONN_LOCK_ASSERT(X) mtx_assert(X->ic_lock, MA_OWNED) +#define ICL_CONN_LOCK_ASSERT_NOT(X) mtx_assert(X->ic_lock, MA_NOTOWNED) static void icl_conn_fail(struct icl_conn *ic) @@ -896,7 +897,7 @@ icl_send_thread(void *arg) break; } icl_conn_send_pdus(ic); - cv_wait(&ic->ic_send_cv, &ic->ic_lock); + cv_wait(&ic->ic_send_cv, ic->ic_lock); } ic->ic_send_running = false; @@ -961,20 +962,19 @@ icl_pdu_queue(struct icl_pdu *ip) ic = ip->ip_conn; - ICL_CONN_LOCK(ic); + ICL_CONN_LOCK_ASSERT(ic); + if (ic->ic_disconnecting || ic->ic_socket == NULL) { ICL_DEBUG("icl_pdu_queue on closed connection"); - ICL_CONN_UNLOCK(ic); icl_pdu_free(ip); return; } TAILQ_INSERT_TAIL(&ic->ic_to_send, ip, ip_next); - ICL_CONN_UNLOCK(ic); cv_signal(&ic->ic_send_cv); } struct icl_conn * -icl_conn_new(void) +icl_conn_new(struct mtx *lock) { struct icl_conn *ic; @@ -983,7 +983,7 @@ icl_conn_new(void) ic = uma_zalloc(icl_conn_zone, M_WAITOK | M_ZERO); TAILQ_INIT(&ic->ic_to_send); - mtx_init(&ic->ic_lock, "icl_lock", NULL, MTX_DEF); + ic->ic_lock = lock; cv_init(&ic->ic_send_cv, "icl_tx"); cv_init(&ic->ic_receive_cv, "icl_rx"); #ifdef DIAGNOSTIC @@ -998,7 +998,6 @@ void icl_conn_free(struct icl_conn *ic) { - mtx_destroy(&ic->ic_lock); cv_destroy(&ic->ic_send_cv); cv_destroy(&ic->ic_receive_cv); uma_zfree(icl_conn_zone, ic); @@ -1102,6 +1101,8 @@ icl_conn_handoff(struct icl_conn *ic, in cap_rights_t rights; int error; + ICL_CONN_LOCK_ASSERT_NOT(ic); + /* * Steal the socket from userland. */ @@ -1141,6 +1142,7 @@ icl_conn_handoff(struct icl_conn *ic, in void icl_conn_shutdown(struct icl_conn *ic) { + ICL_CONN_LOCK_ASSERT_NOT(ic); ICL_CONN_LOCK(ic); if (ic->ic_socket == NULL) { @@ -1157,6 +1159,8 @@ icl_conn_close(struct icl_conn *ic) { struct icl_pdu *pdu; + ICL_CONN_LOCK_ASSERT_NOT(ic); + ICL_CONN_LOCK(ic); if (ic->ic_socket == NULL) { ICL_CONN_UNLOCK(ic); @@ -1214,6 +1218,7 @@ icl_conn_close(struct icl_conn *ic) bool icl_conn_connected(struct icl_conn *ic) { + ICL_CONN_LOCK_ASSERT_NOT(ic); ICL_CONN_LOCK(ic); if (ic->ic_socket == NULL) { @@ -1234,6 +1239,8 @@ icl_conn_handoff_sock(struct icl_conn *i { int error; + ICL_CONN_LOCK_ASSERT_NOT(ic); + if (so->so_type != SOCK_STREAM) return (EINVAL); Modified: head/sys/dev/iscsi/icl.h ============================================================================== --- head/sys/dev/iscsi/icl.h Tue Apr 1 21:30:54 2014 (r264021) +++ head/sys/dev/iscsi/icl.h Tue Apr 1 21:40:46 2014 (r264022) @@ -74,7 +74,7 @@ void icl_pdu_free(struct icl_pdu *ip); #define ICL_MAX_DATA_SEGMENT_LENGTH (128 * 1024) struct icl_conn { - struct mtx ic_lock; + struct mtx *ic_lock; struct socket *ic_socket; #ifdef DIAGNOSTIC volatile u_int ic_outstanding_pdus; @@ -102,7 +102,7 @@ struct icl_conn { void *ic_prv0; }; -struct icl_conn *icl_conn_new(void); +struct icl_conn *icl_conn_new(struct mtx *lock); void icl_conn_free(struct icl_conn *ic); int icl_conn_handoff(struct icl_conn *ic, int fd); void icl_conn_shutdown(struct icl_conn *ic); Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Tue Apr 1 21:30:54 2014 (r264021) +++ head/sys/dev/iscsi/iscsi.c Tue Apr 1 21:40:46 2014 (r264022) @@ -1641,7 +1641,7 @@ iscsi_ioctl_session_add(struct iscsi_sof return (EBUSY); } - is->is_conn = icl_conn_new(); + is->is_conn = icl_conn_new(&is->is_lock); is->is_conn->ic_receive = iscsi_receive_callback; is->is_conn->ic_error = iscsi_error_callback; is->is_conn->ic_prv0 = is; From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 21:47:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91674847; Tue, 1 Apr 2014 21:47:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D8A2FCD; Tue, 1 Apr 2014 21:47:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31LlNIQ099481; Tue, 1 Apr 2014 21:47:23 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31LlMsO099477; Tue, 1 Apr 2014 21:47:22 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404012147.s31LlMsO099477@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 1 Apr 2014 21:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264023 - in head/sys: cam/ctl dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 21:47:23 -0000 Author: trasz Date: Tue Apr 1 21:47:22 2014 New Revision: 264023 URL: http://svnweb.freebsd.org/changeset/base/264023 Log: Instead of "icltx" and "iclrx", use thread names with prefix from upper layer, so that one can see which side of the stack the threads are for. Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/dev/iscsi/icl.c head/sys/dev/iscsi/icl.h head/sys/dev/iscsi/iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Apr 1 21:40:46 2014 (r264022) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Apr 1 21:47:22 2014 (r264023) @@ -1215,7 +1215,7 @@ cfiscsi_session_new(struct cfiscsi_softc cv_init(&cs->cs_login_cv, "cfiscsi_login"); #endif - cs->cs_conn = icl_conn_new(&cs->cs_lock); + cs->cs_conn = icl_conn_new("cfiscsi", &cs->cs_lock); cs->cs_conn->ic_receive = cfiscsi_receive_callback; cs->cs_conn->ic_error = cfiscsi_error_callback; cs->cs_conn->ic_prv0 = cs; Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Tue Apr 1 21:40:46 2014 (r264022) +++ head/sys/dev/iscsi/icl.c Tue Apr 1 21:47:22 2014 (r264023) @@ -974,7 +974,7 @@ icl_pdu_queue(struct icl_pdu *ip) } struct icl_conn * -icl_conn_new(struct mtx *lock) +icl_conn_new(const char *name, struct mtx *lock) { struct icl_conn *ic; @@ -990,6 +990,7 @@ icl_conn_new(struct mtx *lock) refcount_init(&ic->ic_outstanding_pdus, 0); #endif ic->ic_max_data_segment_length = ICL_MAX_DATA_SEGMENT_LENGTH; + ic->ic_name = name; return (ic); } @@ -1065,14 +1066,16 @@ icl_conn_start(struct icl_conn *ic) /* * Start threads. */ - error = kthread_add(icl_send_thread, ic, NULL, NULL, 0, 0, "icltx"); + error = kthread_add(icl_send_thread, ic, NULL, NULL, 0, 0, "%stx", + ic->ic_name); if (error != 0) { ICL_WARN("kthread_add(9) failed with error %d", error); icl_conn_close(ic); return (error); } - error = kthread_add(icl_receive_thread, ic, NULL, NULL, 0, 0, "iclrx"); + error = kthread_add(icl_receive_thread, ic, NULL, NULL, 0, 0, "%srx", + ic->ic_name); if (error != 0) { ICL_WARN("kthread_add(9) failed with error %d", error); icl_conn_close(ic); Modified: head/sys/dev/iscsi/icl.h ============================================================================== --- head/sys/dev/iscsi/icl.h Tue Apr 1 21:40:46 2014 (r264022) +++ head/sys/dev/iscsi/icl.h Tue Apr 1 21:47:22 2014 (r264023) @@ -92,6 +92,7 @@ struct icl_conn { size_t ic_max_data_segment_length; bool ic_disconnecting; bool ic_iser; + const char *ic_name; void (*ic_receive)(struct icl_pdu *); void (*ic_error)(struct icl_conn *); @@ -102,7 +103,7 @@ struct icl_conn { void *ic_prv0; }; -struct icl_conn *icl_conn_new(struct mtx *lock); +struct icl_conn *icl_conn_new(const char *name, struct mtx *lock); void icl_conn_free(struct icl_conn *ic); int icl_conn_handoff(struct icl_conn *ic, int fd); void icl_conn_shutdown(struct icl_conn *ic); Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Tue Apr 1 21:40:46 2014 (r264022) +++ head/sys/dev/iscsi/iscsi.c Tue Apr 1 21:47:22 2014 (r264023) @@ -1641,7 +1641,7 @@ iscsi_ioctl_session_add(struct iscsi_sof return (EBUSY); } - is->is_conn = icl_conn_new(&is->is_lock); + is->is_conn = icl_conn_new("iscsi", &is->is_lock); is->is_conn->ic_receive = iscsi_receive_callback; is->is_conn->ic_error = iscsi_error_callback; is->is_conn->ic_prv0 = is; From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 21:54:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45C60AD2; Tue, 1 Apr 2014 21:54:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32814109; Tue, 1 Apr 2014 21:54:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31LsLan003336; Tue, 1 Apr 2014 21:54:21 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31LsLDc003335; Tue, 1 Apr 2014 21:54:21 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404012154.s31LsLDc003335@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 1 Apr 2014 21:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264024 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 21:54:21 -0000 Author: trasz Date: Tue Apr 1 21:54:20 2014 New Revision: 264024 URL: http://svnweb.freebsd.org/changeset/base/264024 Log: Use atomic ops instead of mutexes where appropriate. Submitted by: mav@ Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Apr 1 21:47:22 2014 (r264023) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Apr 1 21:54:20 2014 (r264024) @@ -967,9 +967,7 @@ cfiscsi_callout(void *context) callout_schedule(&cs->cs_callout, 1 * hz); - CFISCSI_SESSION_LOCK(cs); - cs->cs_timeout++; - CFISCSI_SESSION_UNLOCK(cs); + atomic_add_int(&cs->cs_timeout, 1); #ifdef ICL_KERNEL_PROXY if (cs->cs_waiting_for_ctld || cs->cs_login_phase) { @@ -2522,10 +2520,8 @@ cfiscsi_datamove_out(union ctl_io *io) */ PDU_TOTAL_TRANSFER_LEN(request) = io->scsiio.kern_total_len; - CFISCSI_SESSION_LOCK(cs); - target_transfer_tag = cs->cs_target_transfer_tag; - cs->cs_target_transfer_tag++; - CFISCSI_SESSION_UNLOCK(cs); + target_transfer_tag = + atomic_fetchadd_32(&cs->cs_target_transfer_tag, 1); #if 0 CFISCSI_SESSION_DEBUG(cs, "expecting Data-Out with initiator " From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 22:03:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53E7CCBA; Tue, 1 Apr 2014 22:03:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33EE31C8; Tue, 1 Apr 2014 22:03:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31M34mW007385; Tue, 1 Apr 2014 22:03:04 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31M34Gr007384; Tue, 1 Apr 2014 22:03:04 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404012203.s31M34Gr007384@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 1 Apr 2014 22:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264025 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 22:03:05 -0000 Author: trasz Date: Tue Apr 1 22:03:03 2014 New Revision: 264025 URL: http://svnweb.freebsd.org/changeset/base/264025 Log: Get rid of the "autoscaling", instead just set socket buffer sizes in the usual way. The only thing the old code did was making things less predictable. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.c Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Tue Apr 1 21:54:20 2014 (r264024) +++ head/sys/dev/iscsi/icl.c Tue Apr 1 22:03:03 2014 (r264025) @@ -68,6 +68,14 @@ TUNABLE_INT("kern.icl.partial_receive_le SYSCTL_INT(_kern_icl, OID_AUTO, partial_receive_len, CTLFLAG_RW, &partial_receive_len, 1 * 1024, "Minimum read size for partially received " "data segment"); +static int sendspace = 1048576; +TUNABLE_INT("kern.icl.sendspace", &sendspace); +SYSCTL_INT(_kern_icl, OID_AUTO, sendspace, CTLFLAG_RW, + &sendspace, 1048576, "Default send socket buffer size"); +static int recvspace = 1048576; +TUNABLE_INT("kern.icl.recvspace", &recvspace); +SYSCTL_INT(_kern_icl, OID_AUTO, recvspace, CTLFLAG_RW, + &recvspace, 1048576, "Default receive socket buffer size"); static uma_zone_t icl_conn_zone; static uma_zone_t icl_pdu_zone; @@ -1008,7 +1016,7 @@ icl_conn_free(struct icl_conn *ic) static int icl_conn_start(struct icl_conn *ic) { - size_t bufsize; + size_t minspace; struct sockopt opt; int error, one = 1; @@ -1029,18 +1037,28 @@ icl_conn_start(struct icl_conn *ic) ICL_CONN_UNLOCK(ic); /* - * Use max available sockbuf size for sending. Do it manually - * instead of sbreserve(9) to work around resource limits. + * For sendspace, this is required because the current code cannot + * send a PDU in pieces; thus, the minimum buffer size is equal + * to the maximum PDU size. "+4" is to account for possible padding. * - * XXX: This kind of sucks. On one hand, we don't currently support - * sending a part of data segment; we always do it in one piece, - * so we have to make sure it can fit in the socket buffer. - * Once I've implemented partial send, we'll get rid of this - * and use autoscaling. + * What we should actually do here is to use autoscaling, but set + * some minimal buffer size to "minspace". I don't know a way to do + * that, though. */ - bufsize = (sizeof(struct iscsi_bhs) + - ic->ic_max_data_segment_length) * 8; - error = soreserve(ic->ic_socket, bufsize, bufsize); + minspace = sizeof(struct iscsi_bhs) + ic->ic_max_data_segment_length + + ISCSI_HEADER_DIGEST_SIZE + ISCSI_DATA_DIGEST_SIZE + 4; + if (sendspace < minspace) { + ICL_WARN("kern.icl.sendspace too low; must be at least %jd", + minspace); + sendspace = minspace; + } + if (recvspace < minspace) { + ICL_WARN("kern.icl.recvspace too low; must be at least %jd", + minspace); + recvspace = minspace; + } + + error = soreserve(ic->ic_socket, sendspace, recvspace); if (error != 0) { ICL_WARN("soreserve failed with error %d", error); icl_conn_close(ic); From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 22:21:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15696441; Tue, 1 Apr 2014 22:21:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02F4E371; Tue, 1 Apr 2014 22:21:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31MLu2B015423; Tue, 1 Apr 2014 22:21:56 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31MLuFG015422; Tue, 1 Apr 2014 22:21:56 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404012221.s31MLuFG015422@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 1 Apr 2014 22:21:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264026 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 22:21:57 -0000 Author: trasz Date: Tue Apr 1 22:21:56 2014 New Revision: 264026 URL: http://svnweb.freebsd.org/changeset/base/264026 Log: Enable a KASSERT. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.c Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Tue Apr 1 22:03:03 2014 (r264025) +++ head/sys/dev/iscsi/icl.c Tue Apr 1 22:21:56 2014 (r264026) @@ -1225,10 +1225,7 @@ icl_conn_close(struct icl_conn *ic) KASSERT(TAILQ_EMPTY(&ic->ic_to_send), ("destroying session with non-empty send queue")); - /* - * XXX - */ -#if 0 +#ifdef DIAGNOSTIC KASSERT(ic->ic_outstanding_pdus == 0, ("destroying session with %d outstanding PDUs", ic->ic_outstanding_pdus)); From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 22:41:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E879A81E; Tue, 1 Apr 2014 22:41:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3FA1763; Tue, 1 Apr 2014 22:41:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31MfRTF020688; Tue, 1 Apr 2014 22:41:27 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31MfRW6020684; Tue, 1 Apr 2014 22:41:27 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404012241.s31MfRW6020684@svn.freebsd.org> From: Glen Barber Date: Tue, 1 Apr 2014 22:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264027 - in head: release share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 22:41:28 -0000 Author: gjb Date: Tue Apr 1 22:41:26 2014 New Revision: 264027 URL: http://svnweb.freebsd.org/changeset/base/264027 Log: Add a new release build variable, WITH_COMPRESSED_IMAGES. When set to a non-empty value, the installation medium is compressed with gzip(1) as part of the 'install' target in the release/ directory. With gzip(1) compression, downloadable image are reduced in size quite significantly. Build test against head@263927 shows the following: bootonly.iso: 64% smaller disc1.iso: 44% smaller memstick.img: 47% smaller mini-memstick.img: 65% smaller dvd1.iso: untested This option is off by default, I would eventually like to turn it on by default, and remove the '-k' flag to gzip(1) so only compressed images are published on FTP. Requested by: wkoszek MFC After: 1 week Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile head/release/release.conf.sample head/release/release.sh head/share/man/man7/release.7 Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Tue Apr 1 22:21:56 2014 (r264026) +++ head/release/Makefile Tue Apr 1 22:41:26 2014 (r264027) @@ -21,6 +21,8 @@ # NOSRC: if set, do not distribute source tree # NODOC: if set, do not generate release documentation # WITH_DVD: if set, generate dvd1.iso +# WITH_COMPRESSED_IMAGES: if set, compress installation images with gzip(1) +# (uncompressed images are not removed) # TARGET/TARGET_ARCH: architecture of built release # @@ -251,6 +253,9 @@ install: cp -a ftp ${DESTDIR}/ .for I in ${IMAGES} cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I} +. if defined(WITH_COMPRESSED_IMAGES) || !empty(WITH_COMPRESSED_IMAGES) + gzip -k ${DESTDIR}/${OSRELEASE}-${I} +. endif .endfor cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256 cd ${DESTDIR} && md5 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.MD5 Modified: head/release/release.conf.sample ============================================================================== --- head/release/release.conf.sample Tue Apr 1 22:21:56 2014 (r264026) +++ head/release/release.conf.sample Tue Apr 1 22:41:26 2014 (r264027) @@ -46,6 +46,7 @@ PORTBRANCH="ports/head@rHEAD" #NODOC= #NOPORTS= #WITH_DVD= +#WITH_COMPRESSED_IMAGES= ## Set when building embedded images. #EMBEDDEDBUILD= Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Tue Apr 1 22:21:56 2014 (r264026) +++ head/release/release.sh Tue Apr 1 22:41:26 2014 (r264027) @@ -83,6 +83,7 @@ NOPORTS= # Set to non-empty value to build dvd1.iso as part of the release. WITH_DVD= +WITH_COMPRESSED_IMAGES= usage() { echo "Usage: $0 [-c release.conf]" @@ -128,6 +129,7 @@ if [ -n "${EMBEDDEDBUILD}" ]; then exit 1 fi WITH_DVD= + WITH_COMPRESSED_IMAGES= NODOC=yes fi @@ -262,4 +264,4 @@ eval chroot ${CHROOTDIR} make -C /usr/sr eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ release eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \ - install DESTDIR=/R + install DESTDIR=/R WITH_COMPRESSED_IMAGES=${WITH_COMPRESSED_IMAGES} Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Tue Apr 1 22:21:56 2014 (r264026) +++ head/share/man/man7/release.7 Tue Apr 1 22:41:26 2014 (r264027) @@ -250,6 +250,12 @@ Setting this also sets Set to a non-empty value to include the .Cm dvdrom target. +.It Va WITH_COMPRESSED_IMAGES +Set to a non-empty value to compress the release images with +.Xr gzip 1 . +The original +.Pq uncompressed +images are not removed. .It Va VCSCMD The command run to obtain the source trees. Defaults to From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 22:46:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50C3499E; Tue, 1 Apr 2014 22:46:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D20C788; Tue, 1 Apr 2014 22:46:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31Mkl92024180; Tue, 1 Apr 2014 22:46:47 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31Mkl6T024179; Tue, 1 Apr 2014 22:46:47 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404012246.s31Mkl6T024179@svn.freebsd.org> From: Glen Barber Date: Tue, 1 Apr 2014 22:46:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264028 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 22:46:47 -0000 Author: gjb Date: Tue Apr 1 22:46:46 2014 New Revision: 264028 URL: http://svnweb.freebsd.org/changeset/base/264028 Log: Clean up trailing whitespace in release/Makefile. MFC after: 1 week X-MFC-With: r264027 Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Tue Apr 1 22:41:26 2014 (r264027) +++ head/release/Makefile Tue Apr 1 22:46:46 2014 (r264028) @@ -1,7 +1,7 @@ # $FreeBSD$ # # Makefile for building releases and release media. -# +# # User-driven targets: # cdrom: Builds release CD-ROM media (disc1.iso) # dvdrom: Builds release DVD-ROM media (dvd1.iso) @@ -13,7 +13,7 @@ # # Variables affecting the build process: # WORLDDIR: location of src tree -- must have built world and default kernel -# (by default, the directory above this one) +# (by default, the directory above this one) # PORTSDIR: location of ports tree to distribute (default: /usr/ports) # DOCDIR: location of doc tree (default: /usr/doc) # NOPKG: if set, do not distribute third-party packages @@ -23,7 +23,7 @@ # WITH_DVD: if set, generate dvd1.iso # WITH_COMPRESSED_IMAGES: if set, compress installation images with gzip(1) # (uncompressed images are not removed) -# TARGET/TARGET_ARCH: architecture of built release +# TARGET/TARGET_ARCH: architecture of built release # WORLDDIR?= ${.CURDIR}/.. @@ -65,7 +65,7 @@ NODOC= true NOPORTS= true .endif -EXTRA_PACKAGES= +EXTRA_PACKAGES= .if !defined(NOPORTS) EXTRA_PACKAGES+= ports.txz .endif From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 22:52:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92388B39; Tue, 1 Apr 2014 22:52:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F773827; Tue, 1 Apr 2014 22:52:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31MqRND027702; Tue, 1 Apr 2014 22:52:27 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31MqRpu027701; Tue, 1 Apr 2014 22:52:27 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404012252.s31MqRpu027701@svn.freebsd.org> From: Glen Barber Date: Tue, 1 Apr 2014 22:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264029 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 22:52:27 -0000 Author: gjb Date: Tue Apr 1 22:52:27 2014 New Revision: 264029 URL: http://svnweb.freebsd.org/changeset/base/264029 Log: Fix logic error: s/||/&&/ Pointyhat: gjb MFC after: 1 week X-MFC-With: r264027,r264028 Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Tue Apr 1 22:46:46 2014 (r264028) +++ head/release/Makefile Tue Apr 1 22:52:27 2014 (r264029) @@ -253,7 +253,7 @@ install: cp -a ftp ${DESTDIR}/ .for I in ${IMAGES} cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I} -. if defined(WITH_COMPRESSED_IMAGES) || !empty(WITH_COMPRESSED_IMAGES) +. if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES) gzip -k ${DESTDIR}/${OSRELEASE}-${I} . endif .endfor From owner-svn-src-head@FreeBSD.ORG Tue Apr 1 22:54:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00B0EC93; Tue, 1 Apr 2014 22:54:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1C8C839; Tue, 1 Apr 2014 22:54:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s31MssaW028034; Tue, 1 Apr 2014 22:54:54 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s31Mss7b028033; Tue, 1 Apr 2014 22:54:54 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404012254.s31Mss7b028033@svn.freebsd.org> From: Glen Barber Date: Tue, 1 Apr 2014 22:54:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264030 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 22:54:55 -0000 Author: gjb Date: Tue Apr 1 22:54:54 2014 New Revision: 264030 URL: http://svnweb.freebsd.org/changeset/base/264030 Log: If WITH_COMPRESSED_IMAGES is set, add the compressed images to the CLEANFILES list. MFC after: 1 week X-MFC-With: r264027,r264028,r264029 Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Tue Apr 1 22:52:27 2014 (r264029) +++ head/release/Makefile Tue Apr 1 22:54:54 2014 (r264030) @@ -94,6 +94,11 @@ IMAGES+= mini-memstick.img .endif CLEANFILES= packagesystem *.txz MANIFEST system ${IMAGES} +.if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES) +. for I in ${IMAGES} +CLEANFILES+= ${I}.gz +. endfor +.endif CLEANDIRS= dist ftp release bootonly dvd beforeclean: chflags -R noschg . From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 01:58:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CCB94B16; Wed, 2 Apr 2014 01:58:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B891F809; Wed, 2 Apr 2014 01:58:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s321wsHq002051; Wed, 2 Apr 2014 01:58:54 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s321wsB0002050; Wed, 2 Apr 2014 01:58:54 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404020158.s321wsB0002050@svn.freebsd.org> From: Ian Lepore Date: Wed, 2 Apr 2014 01:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264031 - head/sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 01:58:55 -0000 Author: ian Date: Wed Apr 2 01:58:54 2014 New Revision: 264031 URL: http://svnweb.freebsd.org/changeset/base/264031 Log: Use 2K buffers for IO to help achieve full device speed, rather than the default wMaxPacketSize (64 or 512 bytes). This actually helps older FTDI devices (which were USB 1/full speed) more than the new H-series high speed, but even for the new chips it helps cut the number of interrupts when doing very high speed (3-12mbaud). Modified: head/sys/dev/usb/serial/uftdi.c Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Tue Apr 1 22:54:54 2014 (r264030) +++ head/sys/dev/usb/serial/uftdi.c Wed Apr 2 01:58:54 2014 (r264031) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "usbdevs.h" #define USB_DEBUG_VAR uftdi_debug @@ -83,8 +84,34 @@ SYSCTL_INT(_hw_usb_uftdi, OID_AUTO, debu #define UFTDI_CONFIG_INDEX 0 #define UFTDI_IFACE_INDEX_JTAG 0 -#define UFTDI_OBUFSIZE 64 /* bytes, cannot be increased due to - * do size encoding */ +/* + * IO buffer sizes and FTDI device procotol sizes. + * + * Note that the output packet size in the following defines is not the usb + * protocol packet size based on bus speed, it is the size dictated by the FTDI + * device itself, and is used only on older chips. + * + * We allocate buffers bigger than the hardware's packet size, and process + * multiple packets within each buffer. This allows the controller to make + * optimal use of the usb bus by conducting multiple transfers with the device + * during a single bus timeslice to fill or drain the chip's fifos. + * + * The output data on newer chips has no packet header, and we are able to pack + * any number of output bytes into a buffer. On some older chips, each output + * packet contains a 1-byte header and up to 63 bytes of payload. The size is + * encoded in 6 bits of the header, hence the 64-byte limit on packet size. We + * loop to fill the buffer with many of these header+payload packets. + * + * The input data on all chips consists of packets which contain a 2-byte header + * followed by data payload. The total size of the packet is wMaxPacketSize + * which can change based on the bus speed (e.g., 64 for full speed, 512 for + * high speed). We loop to extract the headers and payloads from the packets + * packed into an input buffer. + */ +#define UFTDI_IBUFSIZE 2048 +#define UFTDI_IHDRSIZE 2 +#define UFTDI_OBUFSIZE 2048 +#define UFTDI_OPKTSIZE 64 enum { UFTDI_BULK_DT_WR, @@ -178,7 +205,7 @@ static const struct usb_config uftdi_con .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .bufsize = 0, /* use wMaxPacketSize */ + .bufsize = UFTDI_IBUFSIZE, .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, .callback = &uftdi_read_callback, }, @@ -1096,35 +1123,47 @@ uftdi_write_callback(struct usb_xfer *xf { struct uftdi_softc *sc = usbd_xfer_softc(xfer); struct usb_page_cache *pc; - uint32_t actlen; + uint32_t pktlen; + uint32_t buflen; uint8_t buf[1]; switch (USB_GET_STATE(xfer)) { + default: /* Error */ + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + } + /* FALLTHROUGH */ case USB_ST_SETUP: case USB_ST_TRANSFERRED: -tr_setup: + /* + * If output packets don't require headers (the common case) we + * can just load the buffer up with payload bytes all at once. + * Otherwise, loop to format packets into the buffer while there + * is data available, and room for a packet header and at least + * one byte of payload. + */ pc = usbd_xfer_get_frame(xfer, 0); - if (ucom_get_data(&sc->sc_ucom, pc, - sc->sc_hdrlen, UFTDI_OBUFSIZE - sc->sc_hdrlen, - &actlen)) { - - if (sc->sc_hdrlen > 0) { - buf[0] = - FTDI_OUT_TAG(actlen, sc->sc_ucom.sc_portno); - usbd_copy_in(pc, 0, buf, 1); + if (sc->sc_hdrlen == 0) { + ucom_get_data(&sc->sc_ucom, pc, 0, UFTDI_OBUFSIZE, + &buflen); + } else { + buflen = 0; + while (buflen < UFTDI_OBUFSIZE - sc->sc_hdrlen - 1 && + ucom_get_data(&sc->sc_ucom, pc, buflen + + sc->sc_hdrlen, UFTDI_OPKTSIZE - sc->sc_hdrlen, + &pktlen) != 0) { + buf[0] = FTDI_OUT_TAG(pktlen, + sc->sc_ucom.sc_portno); + usbd_copy_in(pc, buflen, buf, 1); + buflen += pktlen + sc->sc_hdrlen; } - usbd_xfer_set_frame_len(xfer, 0, actlen + sc->sc_hdrlen); - usbd_transfer_submit(xfer); } - return; - - default: /* Error */ - if (error != USB_ERR_CANCELLED) { - /* try to clear stall first */ - usbd_xfer_set_stall(xfer); - goto tr_setup; + if (buflen != 0) { + usbd_xfer_set_frame_len(xfer, 0, buflen); + usbd_transfer_submit(xfer); } - return; + break; } } @@ -1137,23 +1176,47 @@ uftdi_read_callback(struct usb_xfer *xfe uint8_t ftdi_msr; uint8_t msr; uint8_t lsr; - int actlen; + int buflen; + int pktlen; + int pktmax; + int offset; - usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); + usbd_xfer_status(xfer, &buflen, NULL, NULL, NULL); switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - - if (actlen < 2) { + if (buflen < UFTDI_IHDRSIZE) goto tr_setup; - } pc = usbd_xfer_get_frame(xfer, 0); - usbd_copy_out(pc, 0, buf, 2); - + pktmax = xfer->max_packet_size - UFTDI_IHDRSIZE; + lsr = 0; + msr = 0; + offset = 0; + /* + * Extract packet headers and payload bytes from the buffer. + * Feed payload bytes to ucom/tty layer; OR-accumulate header + * status bits which are transient and could toggle with each + * packet. After processing all packets in the buffer, process + * the accumulated transient MSR and LSR values along with the + * non-transient bits from the last packet header. + */ + while (buflen >= UFTDI_IHDRSIZE) { + usbd_copy_out(pc, offset, buf, UFTDI_IHDRSIZE); + offset += UFTDI_IHDRSIZE; + buflen -= UFTDI_IHDRSIZE; + lsr |= FTDI_GET_LSR(buf); + if (FTDI_GET_MSR(buf) & FTDI_SIO_RI_MASK) + msr |= SER_RI; + pktlen = min(buflen, pktmax); + if (pktlen != 0) { + ucom_put_data(&sc->sc_ucom, pc, offset, + pktlen); + offset += pktlen; + buflen -= pktlen; + } + } ftdi_msr = FTDI_GET_MSR(buf); - lsr = FTDI_GET_LSR(buf); - msr = 0; if (ftdi_msr & FTDI_SIO_CTS_MASK) msr |= SER_CTS; if (ftdi_msr & FTDI_SIO_DSR_MASK) @@ -1174,11 +1237,7 @@ uftdi_read_callback(struct usb_xfer *xfe ucom_status_change(&sc->sc_ucom); } - actlen -= 2; - - if (actlen > 0) { - ucom_put_data(&sc->sc_ucom, pc, 2, actlen); - } + /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 02:48:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5028495; Wed, 2 Apr 2014 02:48:43 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id B55A9B80; Wed, 2 Apr 2014 02:48:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 9D8BB38060; Tue, 1 Apr 2014 21:38:56 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id 4BPfkLGngZ3x; Tue, 1 Apr 2014 21:38:56 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id A56F43805E; Tue, 1 Apr 2014 21:38:55 -0500 (CDT) Message-ID: <533B783E.50707@freebsd.org> Date: Tue, 01 Apr 2014 19:38:54 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Aleksandr Rybalko Subject: Re: svn commit: r263885 - in head/sys/dev/vt: . hw/vga References: <201403282204.s2SM4SeN001155@svn.freebsd.org> <5336F23B.9080402@freebsd.org> <20140330003523.791b9ed3.ray@freebsd.org> In-Reply-To: <20140330003523.791b9ed3.ray@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 02:48:44 -0000 On 03/29/14 15:35, Aleksandr Rybalko wrote: > On Sat, 29 Mar 2014 09:18:03 -0700 > Nathan Whitehorn wrote: > >> On 03/28/14 15:04, Aleksandr Rybalko wrote: >>> Author: ray >>> Date: Fri Mar 28 22:04:27 2014 >>> New Revision: 263885 >>> URL: http://svnweb.freebsd.org/changeset/base/263885 >>> >>> Log: >>> o Add new vd_driver method to do bitblt with mask, named >>> vd_maskbitbltchr. o Move vd_bitbltchr vga's driver method to >>> vd_maskbitbltchr. o Implement new vd_bitbltchr method for vga >>> driver. (It do single write for 8 pixels, have to be a bit faster). >>> >> Can you describe what this does? From the commit message, it sounds >> like it might repair vt performance on cards with 8-bit framebuffers >> generally, but I can't figure out the code. >> -Nathan >> > Hi Nathan! > > np, it is result of our discussion with jhibbits@. > > vt(4) have to use bitblt like method which is able to do masked write, > since mouse cursor have to left visible characters under itself. > But masked bitblt quite expensive due to read from framebuffer to apply > mask or due to VGA graphics mode problem (described here [1], lot of > small read and writes which can't be well optimized). > > Characters can be drown with simple (not masked) method, so vd_bitbltchr > used most frequently. > Mouse cursor only one (at least vt(4) can care about one :) ). And > currently mouse support only single consumer for masked method. > > I did both methods have same set of arguments, to not reimplement > vd_bitbltchr method for all drivers. And driver can implement only > vd_bitbltchr or both. W/o vd_maskbitbltchr, vd_bitbltchr will be used. > > Currently only one driver implement both methods, it is vt_vga. > Its not masked method do write 8 pixels at once, but masked method > continue to use 1 bit at once. > > Other drivers (f.e. vt_ofwfb) in TODO list. > > Thanks! > > [1]http://lists.freebsd.org/pipermail/freebsd-arch/2014-March/015108.html > > WBW Any chance you could give an example or sketch of what to do? This issue is at least doubling the boot time of my Thinkpad if I use an EFI kernel. -Nathan From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 11:10:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0390F4B8; Wed, 2 Apr 2014 11:10:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAFE4EAF; Wed, 2 Apr 2014 11:10:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s32BAkAS029988; Wed, 2 Apr 2014 11:10:46 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s32BAkaJ029986; Wed, 2 Apr 2014 11:10:46 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201404021110.s32BAkaJ029986@svn.freebsd.org> From: David Chisnall Date: Wed, 2 Apr 2014 11:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264038 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 11:10:47 -0000 Author: theraven Date: Wed Apr 2 11:10:46 2014 New Revision: 264038 URL: http://svnweb.freebsd.org/changeset/base/264038 Log: Fix an issue where the locale and rune locale could become out of sync, causing mb* functions (and similar) to be called with the wrong data (possibly a null pointer, causing a crash). PR: standards/188036 MFC after: 1 week Modified: head/lib/libc/locale/setrunelocale.c head/lib/libc/locale/xlocale.c Modified: head/lib/libc/locale/setrunelocale.c ============================================================================== --- head/lib/libc/locale/setrunelocale.c Wed Apr 2 10:57:11 2014 (r264037) +++ head/lib/libc/locale/setrunelocale.c Wed Apr 2 11:10:46 2014 (r264038) @@ -202,6 +202,8 @@ __set_thread_rune_locale(locale_t loc) if (loc == NULL) { _ThreadRuneLocale = &_DefaultRuneLocale; + } else if (loc == LC_GLOBAL_LOCALE) { + _ThreadRuneLocale = 0; } else { _ThreadRuneLocale = XLOCALE_CTYPE(loc)->runes; } Modified: head/lib/libc/locale/xlocale.c ============================================================================== --- head/lib/libc/locale/xlocale.c Wed Apr 2 10:57:11 2014 (r264037) +++ head/lib/libc/locale/xlocale.c Wed Apr 2 11:10:46 2014 (r264038) @@ -154,23 +154,24 @@ __get_locale(void) static void set_thread_locale(locale_t loc) { + locale_t l = (loc == LC_GLOBAL_LOCALE) ? 0 : loc; _once(&once_control, init_key); - if (NULL != loc) { - xlocale_retain((struct xlocale_refcounted*)loc); + if (NULL != l) { + xlocale_retain((struct xlocale_refcounted*)l); } locale_t old = pthread_getspecific(locale_info_key); - if ((NULL != old) && (loc != old)) { + if ((NULL != old) && (l != old)) { xlocale_release((struct xlocale_refcounted*)old); } if (fake_tls) { - thread_local_locale = loc; + thread_local_locale = l; } else { - pthread_setspecific(locale_info_key, loc); + pthread_setspecific(locale_info_key, l); } #ifndef __NO_TLS - __thread_locale = loc; + __thread_locale = l; __set_thread_rune_locale(loc); #endif } @@ -361,9 +362,6 @@ locale_t uselocale(locale_t loc) { locale_t old = get_thread_locale(); if (NULL != loc) { - if (LC_GLOBAL_LOCALE == loc) { - loc = NULL; - } set_thread_locale(loc); } return (old ? old : LC_GLOBAL_LOCALE); From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 11:12:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E888F656; Wed, 2 Apr 2014 11:12:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D528CF3B; Wed, 2 Apr 2014 11:12:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s32BCmxS032842; Wed, 2 Apr 2014 11:12:48 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s32BCmVO032841; Wed, 2 Apr 2014 11:12:48 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201404021112.s32BCmVO032841@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 2 Apr 2014 11:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264039 - head/sbin/geom/class/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 11:12:49 -0000 Author: ae Date: Wed Apr 2 11:12:48 2014 New Revision: 264039 URL: http://svnweb.freebsd.org/changeset/base/264039 Log: Document more parition types. Requested by: glebius MFC after: 1 week Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Wed Apr 2 11:10:46 2014 (r264038) +++ head/sbin/geom/class/part/gpart.8 Wed Apr 2 11:12:48 2014 (r264039) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2013 +.Dd April 2, 2014 .Dt GPART 8 .Os .Sh NAME @@ -557,6 +557,16 @@ Interface (EFI). In such cases, the GPT partitioning scheme is used and the actual partition type for the system partition can also be specified as .Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93b" . +.It Cm fat16 +A partition that contains a FAT16 filesystem. +The scheme-specific type is +.Qq Li "!6" +for MBR. +.It Cm fat32 +A partition that contains a FAT32 filesystem. +The scheme-specific type is +.Qq Li "!11" +for MBR. .It Cm freebsd A .Fx @@ -620,6 +630,16 @@ A partition that is sub-partitioned by a This type is known as .Qq Li "!024dee41-33e7-11d3-9d69-0008c781f39f" by GPT. +.It Cm ms-basic-data +A basic data partition (BDP) for Microsoft operating systems. +In the GPT this type is the equivalent to partition types +.Cm fat16 , fat32 +and +.Cm ntfs +in MBR. +The scheme-specific type is +.Qq Li "!ebd0a0a2-b9e5-4433-87c0-68b6b72699c7" +for GPT. .It Cm ms-ldm-data A partition that contains Logical Disk Manager (LDM) volumes. The scheme-specific types are @@ -632,6 +652,11 @@ A partition that contains Logical Disk M The scheme-specific type is .Qq Li "!5808c8aa-7e8f-42e0-85d2-e1e90434cfb3" for GPT. +.It Cm ntfs +A partition that contains a NTFS or exFAT filesystem. +The scheme-specific type is +.Qq Li "!7" +for MBR. .El .Sh ATTRIBUTES The scheme-specific attributes for EBR: From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 13:24:19 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9649D7C2; Wed, 2 Apr 2014 13:24:19 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 689DEF6B; Wed, 2 Apr 2014 13:24:19 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WVL9O-000HpC-B9; Wed, 02 Apr 2014 13:24:18 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s32DOGDQ085894; Wed, 2 Apr 2014 07:24:16 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/XrjcLd/duG2bujG03jVgs Subject: Re: svn commit: r264025 - head/sys/dev/iscsi From: Ian Lepore To: Edward Tomasz Napierala In-Reply-To: <201404012203.s31M34Gr007384@svn.freebsd.org> References: <201404012203.s31M34Gr007384@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Wed, 02 Apr 2014 07:24:15 -0600 Message-ID: <1396445055.81853.233.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 13:24:19 -0000 On Tue, 2014-04-01 at 22:03 +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Tue Apr 1 22:03:03 2014 > New Revision: 264025 > URL: http://svnweb.freebsd.org/changeset/base/264025 > > Log: > Get rid of the "autoscaling", instead just set socket buffer sizes > in the usual way. The only thing the old code did was making things > less predictable. > > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/dev/iscsi/icl.c > > Modified: head/sys/dev/iscsi/icl.c > ============================================================================== > --- head/sys/dev/iscsi/icl.c Tue Apr 1 21:54:20 2014 (r264024) > +++ head/sys/dev/iscsi/icl.c Tue Apr 1 22:03:03 2014 (r264025) > @@ -68,6 +68,14 @@ TUNABLE_INT("kern.icl.partial_receive_le > SYSCTL_INT(_kern_icl, OID_AUTO, partial_receive_len, CTLFLAG_RW, > &partial_receive_len, 1 * 1024, "Minimum read size for partially received " > "data segment"); > +static int sendspace = 1048576; > +TUNABLE_INT("kern.icl.sendspace", &sendspace); > +SYSCTL_INT(_kern_icl, OID_AUTO, sendspace, CTLFLAG_RW, > + &sendspace, 1048576, "Default send socket buffer size"); > +static int recvspace = 1048576; > +TUNABLE_INT("kern.icl.recvspace", &recvspace); > +SYSCTL_INT(_kern_icl, OID_AUTO, recvspace, CTLFLAG_RW, > + &recvspace, 1048576, "Default receive socket buffer size"); > > static uma_zone_t icl_conn_zone; > static uma_zone_t icl_pdu_zone; > @@ -1008,7 +1016,7 @@ icl_conn_free(struct icl_conn *ic) > static int > icl_conn_start(struct icl_conn *ic) > { > - size_t bufsize; > + size_t minspace; > struct sockopt opt; > int error, one = 1; > > @@ -1029,18 +1037,28 @@ icl_conn_start(struct icl_conn *ic) > ICL_CONN_UNLOCK(ic); > > /* > - * Use max available sockbuf size for sending. Do it manually > - * instead of sbreserve(9) to work around resource limits. > + * For sendspace, this is required because the current code cannot > + * send a PDU in pieces; thus, the minimum buffer size is equal > + * to the maximum PDU size. "+4" is to account for possible padding. > * > - * XXX: This kind of sucks. On one hand, we don't currently support > - * sending a part of data segment; we always do it in one piece, > - * so we have to make sure it can fit in the socket buffer. > - * Once I've implemented partial send, we'll get rid of this > - * and use autoscaling. > + * What we should actually do here is to use autoscaling, but set > + * some minimal buffer size to "minspace". I don't know a way to do > + * that, though. > */ > - bufsize = (sizeof(struct iscsi_bhs) + > - ic->ic_max_data_segment_length) * 8; > - error = soreserve(ic->ic_socket, bufsize, bufsize); > + minspace = sizeof(struct iscsi_bhs) + ic->ic_max_data_segment_length + > + ISCSI_HEADER_DIGEST_SIZE + ISCSI_DATA_DIGEST_SIZE + 4; > + if (sendspace < minspace) { > + ICL_WARN("kern.icl.sendspace too low; must be at least %jd", > + minspace); > + sendspace = minspace; > + } > + if (recvspace < minspace) { > + ICL_WARN("kern.icl.recvspace too low; must be at least %jd", > + minspace); > + recvspace = minspace; > + } > + The %jd on these is causing build failures on 32-bit arches due to size_t being only 32 bits. -- Ian > + error = soreserve(ic->ic_socket, sendspace, recvspace); > if (error != 0) { > ICL_WARN("soreserve failed with error %d", error); > icl_conn_close(ic); > From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 15:32:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78F20DEA; Wed, 2 Apr 2014 15:32:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58C39F2C; Wed, 2 Apr 2014 15:32:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s32FWjHl038242; Wed, 2 Apr 2014 15:32:45 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s32FWi4W038238; Wed, 2 Apr 2014 15:32:44 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201404021532.s32FWi4W038238@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 2 Apr 2014 15:32:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264040 - in head: cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 15:32:45 -0000 Author: pfg Date: Wed Apr 2 15:32:44 2014 New Revision: 264040 URL: http://svnweb.freebsd.org/changeset/base/264040 Log: MFV r258379; 4248 dtrace(1M) should never create DOF with empty probes section 4249 Only probes from the first DTrace object file will be included Illumos Revision: 4a20ab41aadcb81c53e72fc65886e964e9add59 Reference: https://www.illumos.org/issues/4248 https://www.illumos.org/issues/4249 Obtained from: Illumos MFC after: 1 month Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c Wed Apr 2 11:12:48 2014 (r264039) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c Wed Apr 2 15:32:44 2014 (r264040) @@ -22,6 +22,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include @@ -486,7 +487,7 @@ dof_add_probe(dt_idhash_t *dhp, dt_ident return (0); } -static void +static int dof_add_provider(dt_dof_t *ddo, const dt_provider_t *pvp) { dtrace_hdl_t *dtp = ddo->ddo_hdl; @@ -497,8 +498,12 @@ dof_add_provider(dt_dof_t *ddo, const dt size_t sz; id_t i; - if (pvp->pv_flags & DT_PROVIDER_IMPL) - return; /* ignore providers that are exported by dtrace(7D) */ + if (pvp->pv_flags & DT_PROVIDER_IMPL) { + /* + * ignore providers that are exported by dtrace(7D) + */ + return (0); + } nxr = dt_popcb(pvp->pv_xrefs, pvp->pv_xrmax); dofs = alloca(sizeof (dof_secidx_t) * (nxr + 1)); @@ -525,6 +530,9 @@ dof_add_provider(dt_dof_t *ddo, const dt (void) dt_idhash_iter(pvp->pv_probes, dof_add_probe, ddo); + if (dt_buf_len(&ddo->ddo_probes) == 0) + return (dt_set_errno(dtp, EDT_NOPROBES)); + dofpv.dofpv_probes = dof_add_lsect(ddo, NULL, DOF_SECT_PROBES, sizeof (uint64_t), 0, sizeof (dof_probe_t), dt_buf_len(&ddo->ddo_probes)); @@ -579,6 +587,8 @@ dof_add_provider(dt_dof_t *ddo, const dt sizeof (dof_secidx_t), 0, sizeof (dof_secidx_t), sizeof (dof_secidx_t) * (nxr + 1)); } + + return (0); } static int @@ -822,8 +832,10 @@ dtrace_dof_create(dtrace_hdl_t *dtp, dtr */ if (flags & DTRACE_D_PROBES) { for (pvp = dt_list_next(&dtp->dt_provlist); - pvp != NULL; pvp = dt_list_next(pvp)) - dof_add_provider(ddo, pvp); + pvp != NULL; pvp = dt_list_next(pvp)) { + if (dof_add_provider(ddo, pvp) != 0) + return (NULL); + } } /* Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c Wed Apr 2 11:12:48 2014 (r264039) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c Wed Apr 2 15:32:44 2014 (r264040) @@ -26,6 +26,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include @@ -109,7 +110,8 @@ static const struct { { EDT_BADSTACKPC, "Invalid stack program counter size" }, { EDT_BADAGGVAR, "Invalid aggregation variable identifier" }, { EDT_OVERSION, "Client requested deprecated version of library" }, - { EDT_ENABLING_ERR, "Failed to enable probe" } + { EDT_ENABLING_ERR, "Failed to enable probe" }, + { EDT_NOPROBES, "No probe sites found for declared provider" } }; static const int _dt_nerr = sizeof (_dt_errlist) / sizeof (_dt_errlist[0]); Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Wed Apr 2 11:12:48 2014 (r264039) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Wed Apr 2 15:32:44 2014 (r264040) @@ -25,7 +25,7 @@ */ /* - * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -535,7 +535,8 @@ enum { EDT_BADSTACKPC, /* invalid stack program counter size */ EDT_BADAGGVAR, /* invalid aggregation variable identifier */ EDT_OVERSION, /* client is requesting deprecated version */ - EDT_ENABLING_ERR /* failed to enable probe */ + EDT_ENABLING_ERR, /* failed to enable probe */ + EDT_NOPROBES /* no probes sites for declared provider */ }; /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Wed Apr 2 11:12:48 2014 (r264039) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Wed Apr 2 15:32:44 2014 (r264040) @@ -22,9 +22,9 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved - * Use is subject to license terms. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -14635,8 +14635,8 @@ dtrace_helper_provider_add(dof_helper_t * Check to make sure this isn't a duplicate. */ for (i = 0; i < help->dthps_nprovs; i++) { - if (dofhp->dofhp_addr == - help->dthps_provs[i]->dthp_prov.dofhp_addr) + if (dofhp->dofhp_dof == + help->dthps_provs[i]->dthp_prov.dofhp_dof) return (EALREADY); } From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 15:40:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7819E3EA; Wed, 2 Apr 2014 15:40:30 +0000 (UTC) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34E90FA0; Wed, 2 Apr 2014 15:40:28 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.7/8.14.7) with ESMTP id s32FeMXm039563; Wed, 2 Apr 2014 10:40:22 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.7/8.14.7/Submit) id s32FeMc4039562; Wed, 2 Apr 2014 10:40:22 -0500 (CDT) (envelope-from brooks) Date: Wed, 2 Apr 2014 10:40:22 -0500 From: Brooks Davis To: Glen Barber Subject: Re: svn commit: r264027 - in head: release share/man/man7 Message-ID: <20140402154022.GA70867@lor.one-eyed-alien.net> References: <201404012241.s31MfRW6020684@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k1lZvvs/B4yU6o8G" Content-Disposition: inline In-Reply-To: <201404012241.s31MfRW6020684@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 15:40:30 -0000 --k1lZvvs/B4yU6o8G Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 01, 2014 at 10:41:27PM +0000, Glen Barber wrote: > Author: gjb > Date: Tue Apr 1 22:41:26 2014 > New Revision: 264027 > URL: http://svnweb.freebsd.org/changeset/base/264027 >=20 > Log: > Add a new release build variable, WITH_COMPRESSED_IMAGES. > =20 > When set to a non-empty value, the installation medium is > compressed with gzip(1) as part of the 'install' target in > the release/ directory. > =20 > With gzip(1) compression, downloadable image are reduced in > size quite significantly. Build test against head@263927 > shows the following: > =20 > bootonly.iso: 64% smaller > disc1.iso: 44% smaller > memstick.img: 47% smaller > mini-memstick.img: 65% smaller > dvd1.iso: untested > =20 > This option is off by default, I would eventually like to > turn it on by default, and remove the '-k' flag to gzip(1) > so only compressed images are published on FTP. I'd recommend testing xz compression as well. With UFS images of a full world the savings vs gzip are significant (more than 30% IIRC, but it's need more than a year since I checked so I'm a bit unsure of the exact numbers). -- Brooks --k1lZvvs/B4yU6o8G Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iKYEARECAGYFAlM8L2VfFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl bnBncC5maWZ0aGhvcnNlbWFuLm5ldDY1NUQ1MTlDMjZBNzgyRTcyNTI5OUJGMDVE OEU4QkU5RjIzODFBRDQACgkQXY6L6fI4GtR7XACgygPHtutXc/4blGMmPbZCa0qj /JcAoLsnjdQJZ94WgGKLdQgVUIWNxfwb =GbYv -----END PGP SIGNATURE----- --k1lZvvs/B4yU6o8G-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 15:51:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 413E4990; Wed, 2 Apr 2014 15:51:39 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.glenbarber.us", Issuer "RapidSSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EEF461A7; Wed, 2 Apr 2014 15:51:38 +0000 (UTC) Received: from glenbarber.us (70.15.88.86.res-cmts.sewb.ptd.net [70.15.88.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 2DE85B74A; Wed, 2 Apr 2014 15:51:37 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 2DE85B74A Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Wed, 2 Apr 2014 11:51:34 -0400 From: Glen Barber To: Brooks Davis Subject: Re: svn commit: r264027 - in head: release share/man/man7 Message-ID: <20140402155134.GG14379@glenbarber.us> References: <201404012241.s31MfRW6020684@svn.freebsd.org> <20140402154022.GA70867@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GdbWtwDHkcXqP16f" Content-Disposition: inline In-Reply-To: <20140402154022.GA70867@lor.one-eyed-alien.net> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 15:51:39 -0000 --GdbWtwDHkcXqP16f Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: > On Tue, Apr 01, 2014 at 10:41:27PM +0000, Glen Barber wrote: > > Author: gjb > > Date: Tue Apr 1 22:41:26 2014 > > New Revision: 264027 > > URL: http://svnweb.freebsd.org/changeset/base/264027 > >=20 > > Log: > > Add a new release build variable, WITH_COMPRESSED_IMAGES. > > =20 > > When set to a non-empty value, the installation medium is > > compressed with gzip(1) as part of the 'install' target in > > the release/ directory. > > =20 > > With gzip(1) compression, downloadable image are reduced in > > size quite significantly. Build test against head@263927 > > shows the following: > > =20 > > bootonly.iso: 64% smaller > > disc1.iso: 44% smaller > > memstick.img: 47% smaller > > mini-memstick.img: 65% smaller > > dvd1.iso: untested > > =20 > > This option is off by default, I would eventually like to > > turn it on by default, and remove the '-k' flag to gzip(1) > > so only compressed images are published on FTP. >=20 > I'd recommend testing xz compression as well. With UFS images of a full > world the savings vs gzip are significant (more than 30% IIRC, but it's > need more than a year since I checked so I'm a bit unsure of the exact > numbers). >=20 delphij also brought this up. I have concerns with xz(1), since there was mention in IRC that Windows users may have problems decompressing xz-compressed images. So, gzip(1) is used because it seems to be the more commonly-supported archive mechanisms. The benefit of xz(1) over gzip(1) was only 50M-ish. -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz Glen --GdbWtwDHkcXqP16f Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTPDIGAAoJELls3eqvi17QnWoP+wb9RtzqD401dTgcqmvpp1sP Ak+YrL0FZ4C8gdnqmEvwOkjqfz24o3wacPvLXNFAkLuefvKJKJHMgohoG18BJp72 l7ozvJydnqSMsefVO0LMip7ClUPq3x9tA23ZAX+um1Sc/By6cOjHBnJ+9Ad/YxOs cu78wkIJDTbLyDkswhB9q7gl9QA5N0yraTP3crNop934JfD80wmGjRdqcn8vjvgf iJiUEHGXxMyL4XE9DmO/8W+w/i405dLBDFosz/+Ya6+g7IQeQQJGF8ill3okkn7M S81KOwL3uHO3KTVSyaMxqONYJ2ScwKZOm3rZdN5r4njD7XkMBfY9uuYdDo4XCc2P TJ3D/T00aiFhUz7rNw6mri07fI+PvmHjlOmhi21APrdbrsjNFQT4YKefy8Y0EVha BMo1eGZKOT7EiedE5YOIjNHSzs0UIH6AioLquJkjHogPgBhBqMA8uX6UKaFtREUb yR8QlNHruMvJEsv6R4b/zBo5wTN4FBHQCN91rnPPma6IkLvpZFknKu0TuSMXXDpi aT1qFAo6XuZP8GavHQiCREFvss74K6xbCBqSNU2SyzNyVVxR0NnRRVWvacri4pEr wJnQLa9NibPM1ChKQbM0ObEr4H4QlwwQbvq5OEvFEosHCnAe300vARgShMG3etK6 MNdKjB3MlAr1A90XpdD2 =yIbk -----END PGP SIGNATURE----- --GdbWtwDHkcXqP16f-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 15:56:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9F18B17; Wed, 2 Apr 2014 15:56:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5F72235; Wed, 2 Apr 2014 15:56:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s32FuCfc046880; Wed, 2 Apr 2014 15:56:12 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s32FuB88046873; Wed, 2 Apr 2014 15:56:11 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404021556.s32FuB88046873@svn.freebsd.org> From: Ian Lepore Date: Wed, 2 Apr 2014 15:56:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264041 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 15:56:13 -0000 Author: ian Date: Wed Apr 2 15:56:11 2014 New Revision: 264041 URL: http://svnweb.freebsd.org/changeset/base/264041 Log: Add support for event timers whose clock frequency can change while running. Modified: head/share/man/man9/eventtimers.9 head/sys/kern/kern_clocksource.c head/sys/kern/kern_et.c head/sys/sys/systm.h head/sys/sys/timeet.h Modified: head/share/man/man9/eventtimers.9 ============================================================================== --- head/share/man/man9/eventtimers.9 Wed Apr 2 15:32:44 2014 (r264040) +++ head/share/man/man9/eventtimers.9 Wed Apr 2 15:56:11 2014 (r264041) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2013 +.Dd April 2, 2014 .Dt EVENTTIMERS 9 .Os .Sh NAME @@ -68,6 +68,8 @@ struct eventtimer { .Fn et_register "struct eventtimer *et" .Ft int .Fn et_deregister "struct eventtimer *et" +.Ft void +.Fn et_change_frequency "struct eventtimer *et" "uint64_t newfreq" .Fn ET_LOCK .Fn ET_UNLOCK .Ft struct eventtimer * @@ -176,6 +178,21 @@ methods control timers associated with t .Pp Driver may deregister its functionality by calling .Fn et_deregister . +.Pp +If the frequency of the clock hardware can change while it is +running (for example, during power-saving modes), the driver must call +.Fn et_change_frequency +on each change. +If the given event timer is the active timer, +.Fn et_change_frequency +stops the timer on all CPUs, updates +.Va et->frequency , +then restarts the timer on all CPUs so that all +current events are rescheduled using the new frequency. +If the given timer is not currently active, +.Fn et_change_frequency +simply updates +.Va et->frequency . .Sh CONSUMER API .Fn et_find allows consumer to find available event timer, optionally matching specific Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Wed Apr 2 15:32:44 2014 (r264040) +++ head/sys/kern/kern_clocksource.c Wed Apr 2 15:56:11 2014 (r264041) @@ -799,6 +799,25 @@ cpu_activeclock(void) spinlock_exit(); } +/* + * Change the frequency of the given timer. This changes et->et_frequency and + * if et is the active timer it reconfigures the timer on all CPUs. This is + * intended to be a private interface for the use of et_change_frequency() only. + */ +void +cpu_et_frequency(struct eventtimer *et, uint64_t newfreq) +{ + + ET_LOCK(); + if (et == timer) { + configtimer(0); + et->et_frequency = newfreq; + configtimer(1); + } else + et->et_frequency = newfreq; + ET_UNLOCK(); +} + #ifdef KDTRACE_HOOKS void clocksource_cyc_set(const struct bintime *bt) Modified: head/sys/kern/kern_et.c ============================================================================== --- head/sys/kern/kern_et.c Wed Apr 2 15:32:44 2014 (r264040) +++ head/sys/kern/kern_et.c Wed Apr 2 15:56:11 2014 (r264041) @@ -113,6 +113,18 @@ et_deregister(struct eventtimer *et) } /* + * Change the frequency of the given timer. If it is the active timer, + * reconfigure it on all CPUs (reschedules all current events based on the new + * timer frequency). + */ +void +et_change_frequency(struct eventtimer *et, uint64_t newfreq) +{ + + cpu_et_frequency(et, newfreq); +} + +/* * Find free event timer hardware with specified parameters. */ struct eventtimer * Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Wed Apr 2 15:32:44 2014 (r264040) +++ head/sys/sys/systm.h Wed Apr 2 15:56:11 2014 (r264041) @@ -168,6 +168,7 @@ struct ucred; struct uio; struct _jmp_buf; struct trapframe; +struct eventtimer; int setjmp(struct _jmp_buf *) __returns_twice; void longjmp(struct _jmp_buf *, int) __dead2; @@ -286,6 +287,7 @@ void cpu_stopprofclock(void); sbintime_t cpu_idleclock(void); void cpu_activeclock(void); void cpu_new_callout(int cpu, sbintime_t bt, sbintime_t bt_opt); +void cpu_et_frequency(struct eventtimer *et, uint64_t newfreq); extern int cpu_can_deep_sleep; extern int cpu_disable_deep_sleep; Modified: head/sys/sys/timeet.h ============================================================================== --- head/sys/sys/timeet.h Wed Apr 2 15:32:44 2014 (r264040) +++ head/sys/sys/timeet.h Wed Apr 2 15:56:11 2014 (r264041) @@ -89,6 +89,7 @@ extern struct mtx et_eventtimers_mtx; /* Driver API */ int et_register(struct eventtimer *et); int et_deregister(struct eventtimer *et); +void et_change_frequency(struct eventtimer *et, uint64_t newfreq); /* Consumer API */ struct eventtimer *et_find(const char *name, int check, int want); int et_init(struct eventtimer *et, et_event_cb_t *event, From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 16:04:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44D88FFA; Wed, 2 Apr 2014 16:04:50 +0000 (UTC) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 226C2347; Wed, 2 Apr 2014 16:04:49 +0000 (UTC) Received: by mail.lifanov.com (Postfix, from userid 58) id 288A31AF4BF; Wed, 2 Apr 2014 11:55:55 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.lifanov.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from [10.1.3.5] (cnet520-windstream.mcclatchyinteractive.com [166.108.16.2]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.lifanov.com (Postfix) with ESMTPSA id BD9AC1A5943; Wed, 2 Apr 2014 11:55:37 -0400 (EDT) Message-ID: <533C32F5.9050809@mail.lifanov.com> Date: Wed, 02 Apr 2014 11:55:33 -0400 From: Nikolai Lifanov User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Glen Barber , Brooks Davis Subject: Re: svn commit: r264027 - in head: release share/man/man7 References: <201404012241.s31MfRW6020684@svn.freebsd.org> <20140402154022.GA70867@lor.one-eyed-alien.net> <20140402155134.GG14379@glenbarber.us> In-Reply-To: <20140402155134.GG14379@glenbarber.us> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 16:04:50 -0000 On 04/02/14 11:51, Glen Barber wrote: > On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: >> On Tue, Apr 01, 2014 at 10:41:27PM +0000, Glen Barber wrote: >>> Author: gjb >>> Date: Tue Apr 1 22:41:26 2014 >>> New Revision: 264027 >>> URL: http://svnweb.freebsd.org/changeset/base/264027 >>> >>> Log: >>> Add a new release build variable, WITH_COMPRESSED_IMAGES. >>> >>> When set to a non-empty value, the installation medium is >>> compressed with gzip(1) as part of the 'install' target in >>> the release/ directory. >>> >>> With gzip(1) compression, downloadable image are reduced in >>> size quite significantly. Build test against head@263927 >>> shows the following: >>> >>> bootonly.iso: 64% smaller >>> disc1.iso: 44% smaller >>> memstick.img: 47% smaller >>> mini-memstick.img: 65% smaller >>> dvd1.iso: untested >>> >>> This option is off by default, I would eventually like to >>> turn it on by default, and remove the '-k' flag to gzip(1) >>> so only compressed images are published on FTP. >> >> I'd recommend testing xz compression as well. With UFS images of a full >> world the savings vs gzip are significant (more than 30% IIRC, but it's >> need more than a year since I checked so I'm a bit unsure of the exact >> numbers). >> > > delphij also brought this up. > > I have concerns with xz(1), since there was mention in IRC that Windows > users may have problems decompressing xz-compressed images. So, gzip(1) > is used because it seems to be the more commonly-supported archive > mechanisms. > > The benefit of xz(1) over gzip(1) was only 50M-ish. > > -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso > -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 > -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz > -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz > > Glen > How about 7zip (Windows program, not file format)? What would a Windows user use that can decompress gzip and not xz? It was a problem around ~2007, but xz support is no longer rare or exotic. - Nikolai Lifanov From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 16:07:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C16A1F8; Wed, 2 Apr 2014 16:07:03 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.glenbarber.us", Issuer "RapidSSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05013362; Wed, 2 Apr 2014 16:07:03 +0000 (UTC) Received: from glenbarber.us (70.15.88.86.res-cmts.sewb.ptd.net [70.15.88.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id B172AB88D; Wed, 2 Apr 2014 16:06:58 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us B172AB88D Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Wed, 2 Apr 2014 12:06:50 -0400 From: Glen Barber To: Nikolai Lifanov Subject: Re: svn commit: r264027 - in head: release share/man/man7 Message-ID: <20140402160650.GH14379@glenbarber.us> References: <201404012241.s31MfRW6020684@svn.freebsd.org> <20140402154022.GA70867@lor.one-eyed-alien.net> <20140402155134.GG14379@glenbarber.us> <533C32F5.9050809@mail.lifanov.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="o71xDhNo7p97+qVi" Content-Disposition: inline In-Reply-To: <533C32F5.9050809@mail.lifanov.com> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Brooks Davis , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 16:07:03 -0000 --o71xDhNo7p97+qVi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 02, 2014 at 11:55:33AM -0400, Nikolai Lifanov wrote: > On 04/02/14 11:51, Glen Barber wrote: > > On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: > >> On Tue, Apr 01, 2014 at 10:41:27PM +0000, Glen Barber wrote: > >>> Author: gjb > >>> Date: Tue Apr 1 22:41:26 2014 > >>> New Revision: 264027 > >>> URL: http://svnweb.freebsd.org/changeset/base/264027 > >>> > >>> Log: > >>> Add a new release build variable, WITH_COMPRESSED_IMAGES. > >>> =20 > >>> When set to a non-empty value, the installation medium is > >>> compressed with gzip(1) as part of the 'install' target in > >>> the release/ directory. > >>> =20 > >>> With gzip(1) compression, downloadable image are reduced in > >>> size quite significantly. Build test against head@263927 > >>> shows the following: > >>> =20 > >>> bootonly.iso: 64% smaller > >>> disc1.iso: 44% smaller > >>> memstick.img: 47% smaller > >>> mini-memstick.img: 65% smaller > >>> dvd1.iso: untested > >>> =20 > >>> This option is off by default, I would eventually like to > >>> turn it on by default, and remove the '-k' flag to gzip(1) > >>> so only compressed images are published on FTP. > >> > >> I'd recommend testing xz compression as well. With UFS images of a fu= ll > >> world the savings vs gzip are significant (more than 30% IIRC, but it's > >> need more than a year since I checked so I'm a bit unsure of the exact > >> numbers). > >> > >=20 > > delphij also brought this up. > >=20 > > I have concerns with xz(1), since there was mention in IRC that Windows > > users may have problems decompressing xz-compressed images. So, gzip(1) > > is used because it seems to be the more commonly-supported archive > > mechanisms. > >=20 > > The benefit of xz(1) over gzip(1) was only 50M-ish. > >=20 > > -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso > > -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 > > -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz > > -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz > >=20 > > Glen > >=20 >=20 > How about 7zip (Windows program, not file format)? What would a Windows > user use that can decompress gzip and not xz? It was a problem around > ~2007, but xz support is no longer rare or exotic. >=20 I don't know, to be honest. I have no Windows machines to test, so I can only go by what I am told. Glen --o71xDhNo7p97+qVi Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTPDWaAAoJELls3eqvi17Q5OcQAJ29Xt4PIAgw3QNgrZUAm5WI jRxL9B7mpLbkD7OxsYoYIqGgxY2oOKuIjuqIog6GU4LZT3HuE1W/Blb2doqjVIg6 1sCwLQALOX3ypoEacy/nA5IMaoveV8ncp8L3YN4K+9/RcNLZZ6oWiXzaa1QD+jkT Co6Blb8OKMlmUk2HqC4R/lN03Tzqz3x3+k8jz3H3Wm/0LfmMb03/wrdw+5RpDngl ZiLnDe6FLINywYUZViY0seOx7fXSdu1hndUprmMbRZnKtk05u5/Rk93Eeg7MEe7f GYSJzyJBDDXubzE/UnQT3FVKSoO0I8b6CpK2GADh4XsppbPbVrENjPhr/Z0AHFvQ 8gtJCMOCI8n6eVH52Ml0rsNq+GGsPcH3M6pR9J9DQWsjX6vZRC3a9kEQULw/eYwi zk7nYQMbz3lDSxKh0yBylGvweYnaEIv/ZDNNQ1bKpIsHG4FLdflqMPqqlIZdvm4J OnUrlxv3oFNR23PMzcuDLZeu+dtjWkGVVgdCIPJvRa6FZtO+UgghJU65fn9iawq/ adWhAwC+rtYULuYzpTbipskiEqILuiiKWJxN2Ngfmhl4cHzRAbfo5aTYKy9aaKBy 3tX8DMO4GxN6LYvSMmcfKEnWm9PFWeepXpErNR4Vm87sxz0r0+5Zf8I565UyuwOr arikWoWE3p1FdZOsm5N/ =xLOR -----END PGP SIGNATURE----- --o71xDhNo7p97+qVi-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 16:07:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1C9F461; Wed, 2 Apr 2014 16:07:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC2EF393; Wed, 2 Apr 2014 16:07:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s32G7qj4051382; Wed, 2 Apr 2014 16:07:52 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s32G7mhw051355; Wed, 2 Apr 2014 16:07:48 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201404021607.s32G7mhw051355@svn.freebsd.org> From: David Chisnall Date: Wed, 2 Apr 2014 16:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 16:07:53 -0000 Author: theraven Date: Wed Apr 2 16:07:48 2014 New Revision: 264042 URL: http://svnweb.freebsd.org/changeset/base/264042 Log: Add support for some block functions that come from OS X. These are intended to build with any C compiler. Reviewed by: pfg MFC after: 3 weeks Added: head/lib/libc/gen/scandir_b.c (contents, props changed) head/lib/libc/include/block_abi.h (contents, props changed) head/lib/libc/stdlib/bsearch_b.c (contents, props changed) head/lib/libc/stdlib/heapsort_b.c (contents, props changed) head/lib/libc/stdlib/mergesort_b.c (contents, props changed) Modified: head/include/dirent.h head/include/stdlib.h head/lib/libc/gen/Symbol.map head/lib/libc/gen/scandir.3 head/lib/libc/gen/scandir.c head/lib/libc/stdlib/Makefile.inc head/lib/libc/stdlib/Symbol.map head/lib/libc/stdlib/atexit.3 head/lib/libc/stdlib/atexit.c head/lib/libc/stdlib/bsearch.c head/lib/libc/stdlib/heapsort.c head/lib/libc/stdlib/merge.c head/lib/libc/stdlib/qsort.3 head/lib/libc/stdlib/qsort_r.c Modified: head/include/dirent.h ============================================================================== --- head/include/dirent.h Wed Apr 2 15:56:11 2014 (r264041) +++ head/include/dirent.h Wed Apr 2 16:07:48 2014 (r264042) @@ -95,6 +95,11 @@ void rewinddir(DIR *); int scandir(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **)); +#ifdef __BLOCKS__ +int scandir_b(const char *, struct dirent ***, + int (^)(const struct dirent *), + int (^)(const struct dirent **, const struct dirent **)); +#endif #endif #if __XSI_VISIBLE void seekdir(DIR *, long); Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Wed Apr 2 15:56:11 2014 (r264041) +++ head/include/stdlib.h Wed Apr 2 16:07:48 2014 (r264042) @@ -82,6 +82,9 @@ extern int ___mb_cur_max(void); _Noreturn void abort(void); int abs(int) __pure2; int atexit(void (*)(void)); +#ifdef __BLOCKS__ +int atexit_b(void (^)(void)); +#endif double atof(const char *); int atoi(const char *); long atol(const char *); @@ -100,6 +103,10 @@ size_t mbstowcs(wchar_t * __restrict , int mbtowc(wchar_t * __restrict, const char * __restrict, size_t); void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); +#ifdef __BLOCKS__ +void qsort_b(void *, size_t, size_t, + int (^)(const void *, const void *)); +#endif int rand(void); void *realloc(void *, size_t); void srand(unsigned); @@ -280,8 +287,14 @@ const char * getprogname(void); int heapsort(void *, size_t, size_t, int (*)(const void *, const void *)); +#ifdef __BLOCKS__ +int heapsort_b(void *, size_t, size_t, int (^)(const void *, const void *)); +#endif int l64a_r(long, char *, int); int mergesort(void *, size_t, size_t, int (*)(const void *, const void *)); +#ifdef __BLOCKS__ +int mergesort_b(void *, size_t, size_t, int (^)(const void *, const void *)); +#endif int mkostemp(char *, int); int mkostemps(char *, int, int); void qsort_r(void *, size_t, size_t, void *, Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Wed Apr 2 15:56:11 2014 (r264041) +++ head/lib/libc/gen/Symbol.map Wed Apr 2 16:07:48 2014 (r264042) @@ -349,6 +349,7 @@ FBSD_1.1 { posix_spawnattr_setsigdefault; posix_spawnattr_setsigmask; posix_spawnp; + scandir_b; semctl; tcgetsid; tcsetsid; Modified: head/lib/libc/gen/scandir.3 ============================================================================== --- head/lib/libc/gen/scandir.3 Wed Apr 2 15:56:11 2014 (r264041) +++ head/lib/libc/gen/scandir.3 Wed Apr 2 16:07:48 2014 (r264042) @@ -42,6 +42,8 @@ .Ft int .Fn scandir "const char *dirname" "struct dirent ***namelist" "int \*(lp*select\*(rp\*(lpconst struct dirent *\*(rp" "int \*(lp*compar\*(rp\*(lpconst struct dirent **, const struct dirent **\*(rp" .Ft int +.Fn scandir_b "const char *dirname" "struct dirent ***namelist" "int \*(lp*select\^(rp\*(lpconst struct dirent *\*(rp" "int \*(lp^compar\*(rp\*(lpconst struct dirent **, const struct dirent **\*(rp" +.Ft int .Fn alphasort "const struct dirent **d1" "const struct dirent **d2" .Sh DESCRIPTION The @@ -87,6 +89,15 @@ argument to sort the array alphabeticall The memory allocated for the array can be deallocated with .Xr free 3 , by freeing each pointer in the array and then the array itself. +.Pp +The +.Fn scandir_b +function behaves in the same way as +.Fn scandir , +but takes blocks as arguments instead of function pointers and calls +.Fn qsort_b +rather than +.Fn qsort . .Sh DIAGNOSTICS Returns \-1 if the directory cannot be opened for reading or if .Xr malloc 3 Modified: head/lib/libc/gen/scandir.c ============================================================================== --- head/lib/libc/gen/scandir.c Wed Apr 2 15:56:11 2014 (r264041) +++ head/lib/libc/gen/scandir.c Wed Apr 2 16:07:48 2014 (r264042) @@ -46,6 +46,17 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" +#ifdef I_AM_SCANDIR_B +#include "block_abi.h" +#define SELECT(x) CALL_BLOCK(select, x) +#ifndef __BLOCKS__ +void +qsort_b(void *, size_t, size_t, void*); +#endif +#else +#define SELECT(x) select(x) +#endif + static int alphasort_thunk(void *thunk, const void *p1, const void *p2); /* @@ -60,9 +71,15 @@ static int alphasort_thunk(void *thunk, (((dp)->d_namlen + 1 + 3) &~ 3)) int +#ifdef I_AM_SCANDIR_B +scandir_b(const char *dirname, struct dirent ***namelist, + DECLARE_BLOCK(int, select, const struct dirent *), + DECLARE_BLOCK(int, dcomp, const struct dirent **, const struct dirent **)) +#else scandir(const char *dirname, struct dirent ***namelist, int (*select)(const struct dirent *), int (*dcomp)(const struct dirent **, const struct dirent **)) +#endif { struct dirent *d, *p, **names = NULL; size_t nitems = 0; @@ -78,7 +95,7 @@ scandir(const char *dirname, struct dire goto fail; while ((d = readdir(dirp)) != NULL) { - if (select != NULL && !(*select)(d)) + if (select != NULL && !SELECT(d)) continue; /* just selected names */ /* * Make a minimum size copy of the data @@ -111,8 +128,12 @@ scandir(const char *dirname, struct dire } closedir(dirp); if (nitems && dcomp != NULL) +#ifdef I_AM_SCANDIR_B + qsort_b(names, nitems, sizeof(struct dirent *), (void*)dcomp); +#else qsort_r(names, nitems, sizeof(struct dirent *), &dcomp, alphasort_thunk); +#endif *namelist = names; return (nitems); Added: head/lib/libc/gen/scandir_b.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/scandir_b.c Wed Apr 2 16:07:48 2014 (r264042) @@ -0,0 +1,29 @@ +/*- + * Copyright (c) 2014 David Chisnall + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#define I_AM_SCANDIR_B +#include "scandir.c" Added: head/lib/libc/include/block_abi.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/include/block_abi.h Wed Apr 2 16:07:48 2014 (r264042) @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2014 David T Chisnall + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifdef __BLOCKS__ +/** + * Declares a block variable. This macro is defined in the trivial way for + * compilers that support blocks and exposing the ABI in the source for other + * compilers. + */ +#define DECLARE_BLOCK(retTy, name, argTys, ...)\ + retTy(^name)(argTys, ## __VA_ARGS__) +/** + * Calls a block variable. This macro is defined in the trivial way for + * compilers that support blocks and exposing the ABI in the source for other + * compilers. + */ +#define CALL_BLOCK(name, ...) name(__VA_ARGS__) +#else // !__BLOCKS__ +#define DECLARE_BLOCK(retTy, name, argTys, ...)\ + struct {\ + void *isa;\ + int flags;\ + int reserved;\ + retTy (*invoke)(void *, ...);\ + } *name +#define CALL_BLOCK(name, ...) (name)->invoke(name, __VA_ARGS__) +#endif // __BLOCKS__ +/** + * Returns the pointer to the block-invoke function. This is used for passing + * blocks to functions that want a function pointer and a data pointer. + */ +#define GET_BLOCK_FUNCTION(x) \ + (((struct {\ + void *isa;\ + int flags;\ + int reserved;\ + void (*invoke)(void *, ...);\ + }*)x)->invoke) Modified: head/lib/libc/stdlib/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/Makefile.inc Wed Apr 2 15:56:11 2014 (r264041) +++ head/lib/libc/stdlib/Makefile.inc Wed Apr 2 16:07:48 2014 (r264042) @@ -6,9 +6,10 @@ MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \ bsearch.c div.c exit.c getenv.c getopt.c getopt_long.c \ - getsubopt.c hcreate.c heapsort.c imaxabs.c imaxdiv.c \ + getsubopt.c hcreate.c heapsort.c heapsort_b.c imaxabs.c imaxdiv.c \ insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c \ - merge.c ptsname.c qsort.c qsort_r.c quick_exit.c radixsort.c rand.c \ + merge.c mergesort_b.c ptsname.c qsort.c qsort_r.c quick_exit.c \ + radixsort.c rand.c \ random.c reallocf.c realpath.c remque.c strfmon.c strtoimax.c \ strtol.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \ strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c Modified: head/lib/libc/stdlib/Symbol.map ============================================================================== --- head/lib/libc/stdlib/Symbol.map Wed Apr 2 15:56:11 2014 (r264041) +++ head/lib/libc/stdlib/Symbol.map Wed Apr 2 16:07:48 2014 (r264042) @@ -86,10 +86,14 @@ FBSD_1.0 { FBSD_1.3 { at_quick_exit; + atexit_b; atof_l; atoi_l; atol_l; atoll_l; + heapsort_b; + mergesort_b; + qsort_b; quick_exit; strtod_l; strtof_l; Modified: head/lib/libc/stdlib/atexit.3 ============================================================================== --- head/lib/libc/stdlib/atexit.3 Wed Apr 2 15:56:11 2014 (r264041) +++ head/lib/libc/stdlib/atexit.3 Wed Apr 2 16:07:48 2014 (r264042) @@ -44,6 +44,8 @@ .In stdlib.h .Ft int .Fn atexit "void (*function)(void)" +.Ft int +.Fn atexit_b "void (^function)(void)" .Sh DESCRIPTION The .Fn atexit @@ -69,6 +71,12 @@ process termination, for example by call .Pp At least 32 functions can always be registered, and more are allowed as long as sufficient memory can be allocated. +.Pp +The +.Fn atexit_b +function behaves identically to +.Fn atexit , +except that it takes a block, rather than a function pointer. .\" XXX {ATEXIT_MAX} is not implemented yet .Sh RETURN VALUES .Rv -std atexit @@ -77,6 +85,12 @@ and more are allowed as long as sufficie .It Bq Er ENOMEM No memory was available to add the function to the list. The existing list of functions is unmodified. +.It Bq Er ENOSYS +The +.Fn atexit_b +function was called by a program that did not supply a +.Fn _Block_copy +implementation. .El .Sh SEE ALSO .Xr at_quick_exit 3 Modified: head/lib/libc/stdlib/atexit.c ============================================================================== --- head/lib/libc/stdlib/atexit.c Wed Apr 2 15:56:11 2014 (r264041) +++ head/lib/libc/stdlib/atexit.c Wed Apr 2 16:07:48 2014 (r264042) @@ -37,6 +37,7 @@ static char sccsid[] = "@(#)atexit.c 8.2 __FBSDID("$FreeBSD$"); #include "namespace.h" +#include #include #include #include @@ -44,9 +45,16 @@ __FBSDID("$FreeBSD$"); #include #include "atexit.h" #include "un-namespace.h" +#include "block_abi.h" #include "libc_private.h" +/** + * The _Block_copy() function is provided by the block runtime. + */ +__attribute__((weak)) void* +_Block_copy(void*); + #define ATEXIT_FN_EMPTY 0 #define ATEXIT_FN_STD 1 #define ATEXIT_FN_CXA 2 @@ -125,7 +133,32 @@ atexit(void (*func)(void)) fn.fn_arg = NULL; fn.fn_dso = NULL; - error = atexit_register(&fn); + error = atexit_register(&fn); + return (error); +} + +/** + * Register a block to be performed at exit. + */ +int +atexit_b(DECLARE_BLOCK(void, func, void)) +{ + struct atexit_fn fn; + int error; + if (_Block_copy == 0) { + errno = ENOSYS; + return -1; + } + func = _Block_copy(func); + + // Blocks are not C++ destructors, but they have the same signature (a + // single void* parameter), so we can pretend that they are. + fn.fn_type = ATEXIT_FN_CXA; + fn.fn_ptr.cxa_func = (void(*)(void*))GET_BLOCK_FUNCTION(func); + fn.fn_arg = func; + fn.fn_dso = NULL; + + error = atexit_register(&fn); return (error); } @@ -144,7 +177,7 @@ __cxa_atexit(void (*func)(void *), void fn.fn_arg = arg; fn.fn_dso = dso; - error = atexit_register(&fn); + error = atexit_register(&fn); return (error); } Modified: head/lib/libc/stdlib/bsearch.c ============================================================================== --- head/lib/libc/stdlib/bsearch.c Wed Apr 2 15:56:11 2014 (r264041) +++ head/lib/libc/stdlib/bsearch.c Wed Apr 2 16:07:48 2014 (r264042) @@ -36,6 +36,13 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef I_AM_BSEARCH_B +#include "block_abi.h" +#define COMPAR(x,y) CALL_BLOCK(compar, x, y) +#else +#define COMPAR(x,y) compar(x, y) +#endif + /* * Perform a binary search. * @@ -52,6 +59,15 @@ __FBSDID("$FreeBSD$"); * have to make lim 3, then halve, obtaining 1, so that we will only * look at item 3. */ +#ifdef I_AM_BSEARCH_B +void * +bsearch_b(key, base0, nmemb, size, compar) + const void *key; + const void *base0; + size_t nmemb; + size_t size; + DECLARE_BLOCK(int, compar, const void *, const void *); +#else void * bsearch(key, base0, nmemb, size, compar) const void *key; @@ -59,6 +75,7 @@ bsearch(key, base0, nmemb, size, compar) size_t nmemb; size_t size; int (*compar)(const void *, const void *); +#endif { const char *base = base0; size_t lim; @@ -67,7 +84,7 @@ bsearch(key, base0, nmemb, size, compar) for (lim = nmemb; lim != 0; lim >>= 1) { p = base + (lim >> 1) * size; - cmp = (*compar)(key, p); + cmp = COMPAR(key, p); if (cmp == 0) return ((void *)p); if (cmp > 0) { /* key > p: move right */ Added: head/lib/libc/stdlib/bsearch_b.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/stdlib/bsearch_b.c Wed Apr 2 16:07:48 2014 (r264042) @@ -0,0 +1,29 @@ +/*- + * Copyright (c) 2014 David Chisnall + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#define I_AM_BSEARCH_B +#include "bsearch.c" Modified: head/lib/libc/stdlib/heapsort.c ============================================================================== --- head/lib/libc/stdlib/heapsort.c Wed Apr 2 15:56:11 2014 (r264041) +++ head/lib/libc/stdlib/heapsort.c Wed Apr 2 16:07:48 2014 (r264042) @@ -1,6 +1,8 @@ /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. + * Copyright (c) 2014 David T. Chisnall + * All rights reserved. * * This code is derived from software contributed to Berkeley by * Ronnie Kon at Mindcraft Inc., Kevin Lew and Elmer Yglesias. @@ -40,6 +42,13 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef I_AM_HEAPSORT_B +#include "block_abi.h" +#define COMPAR(x, y) CALL_BLOCK(compar, x, y) +#else +#define COMPAR(x, y) compar(x, y) +#endif + /* * Swap two areas of size number of bytes. Although qsort(3) permits random * blocks of memory to be sorted, sorting pointers is almost certainly the @@ -77,12 +86,12 @@ __FBSDID("$FreeBSD$"); for (par_i = initval; (child_i = par_i * 2) <= nmemb; \ par_i = child_i) { \ child = base + child_i * size; \ - if (child_i < nmemb && compar(child, child + size) < 0) { \ + if (child_i < nmemb && COMPAR(child, child + size) < 0) { \ child += size; \ ++child_i; \ } \ par = base + par_i * size; \ - if (compar(child, par) <= 0) \ + if (COMPAR(child, par) <= 0) \ break; \ SWAP(par, child, count, size, tmp); \ } \ @@ -108,7 +117,7 @@ __FBSDID("$FreeBSD$"); #define SELECT(par_i, child_i, nmemb, par, child, size, k, count, tmp1, tmp2) { \ for (par_i = 1; (child_i = par_i * 2) <= nmemb; par_i = child_i) { \ child = base + child_i * size; \ - if (child_i < nmemb && compar(child, child + size) < 0) { \ + if (child_i < nmemb && COMPAR(child, child + size) < 0) { \ child += size; \ ++child_i; \ } \ @@ -120,7 +129,7 @@ __FBSDID("$FreeBSD$"); par_i = child_i / 2; \ child = base + child_i * size; \ par = base + par_i * size; \ - if (child_i == 1 || compar(k, par) < 0) { \ + if (child_i == 1 || COMPAR(k, par) < 0) { \ COPY(child, k, count, size, tmp1, tmp2); \ break; \ } \ @@ -135,11 +144,19 @@ __FBSDID("$FreeBSD$"); * a data set that will trigger the worst case is nonexistent. Heapsort's * only advantage over quicksort is that it requires little additional memory. */ +#ifdef I_AM_HEAPSORT_B +int +heapsort_b(vbase, nmemb, size, compar) + void *vbase; + size_t nmemb, size; + DECLARE_BLOCK(int, compar, const void *, const void *); +#else int heapsort(vbase, nmemb, size, compar) void *vbase; size_t nmemb, size; int (*compar)(const void *, const void *); +#endif { size_t cnt, i, j, l; char tmp, *tmp1, *tmp2; Added: head/lib/libc/stdlib/heapsort_b.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/stdlib/heapsort_b.c Wed Apr 2 16:07:48 2014 (r264042) @@ -0,0 +1,29 @@ +/*- + * Copyright (c) 2014 David Chisnall + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#define I_AM_HEAPSORT_B +#include "heapsort.c" Modified: head/lib/libc/stdlib/merge.c ============================================================================== --- head/lib/libc/stdlib/merge.c Wed Apr 2 15:56:11 2014 (r264041) +++ head/lib/libc/stdlib/merge.c Wed Apr 2 16:07:48 2014 (r264042) @@ -56,10 +56,18 @@ __FBSDID("$FreeBSD$"); #include #include -static void setup(u_char *, u_char *, size_t, size_t, - int (*)(const void *, const void *)); -static void insertionsort(u_char *, size_t, size_t, - int (*)(const void *, const void *)); +#ifdef I_AM_MERGESORT_B +#include "block_abi.h" +#define DECLARE_CMP DECLARE_BLOCK(int, cmp, const void *, const void *) +typedef DECLARE_BLOCK(int, cmp_t, const void *, const void *); +#define CMP(x, y) CALL_BLOCK(cmp, x, y) +#else +typedef int (*cmp_t)(const void *, const void *); +#define CMP(x, y) cmp(x, y) +#endif + +static void setup(u_char *, u_char *, size_t, size_t, cmp_t); +static void insertionsort(u_char *, size_t, size_t, cmp_t); #define ISIZE sizeof(int) #define PSIZE sizeof(u_char *) @@ -95,11 +103,15 @@ static void insertionsort(u_char *, size * Arguments are as for qsort. */ int +#ifdef I_AM_MERGESORT_B +mergesort_b(base, nmemb, size, cmp) +#else mergesort(base, nmemb, size, cmp) +#endif void *base; size_t nmemb; size_t size; - int (*cmp)(const void *, const void *); + cmp_t cmp; { size_t i; int sense; @@ -141,7 +153,7 @@ mergesort(base, nmemb, size, cmp) p2 = *EVAL(p2); l2 = list1 + (p2 - list2); while (f1 < l1 && f2 < l2) { - if ((*cmp)(f1, f2) <= 0) { + if (CMP(f1, f2) <= 0) { q = f2; b = f1, t = l1; sense = -1; @@ -151,7 +163,7 @@ mergesort(base, nmemb, size, cmp) sense = 0; } if (!big) { /* here i = 0 */ - while ((b += size) < t && cmp(q, b) >sense) + while ((b += size) < t && CMP(q, b) >sense) if (++i == 6) { big = 1; goto EXPONENTIAL; @@ -160,12 +172,12 @@ mergesort(base, nmemb, size, cmp) EXPONENTIAL: for (i = size; ; i <<= 1) if ((p = (b + i)) >= t) { if ((p = t - size) > b && - (*cmp)(q, p) <= sense) + CMP(q, p) <= sense) t = p; else b = p; break; - } else if ((*cmp)(q, p) <= sense) { + } else if (CMP(q, p) <= sense) { t = p; if (i == size) big = 0; @@ -174,14 +186,14 @@ EXPONENTIAL: for (i = size; ; i << b = p; while (t > b+size) { i = (((t - b) / size) >> 1) * size; - if ((*cmp)(q, p = b + i) <= sense) + if (CMP(q, p = b + i) <= sense) t = p; else b = p; } goto COPY; FASTCASE: while (i > size) - if ((*cmp)(q, + if (CMP(q, p = b + (i >>= 1)) <= sense) t = p; else @@ -261,8 +273,8 @@ COPY: b = t; void setup(list1, list2, n, size, cmp) size_t n, size; - int (*cmp)(const void *, const void *); u_char *list1, *list2; + cmp_t cmp; { int i, length, size2, tmp, sense; u_char *f1, *f2, *s, *l2, *last, *p2; @@ -285,12 +297,12 @@ setup(list1, list2, n, size, cmp) #ifdef NATURAL p2 = list2; f1 = list1; - sense = (cmp(f1, f1 + size) > 0); + sense = (CMP(f1, f1 + size) > 0); for (; f1 < last; sense = !sense) { length = 2; /* Find pairs with same sense. */ for (f2 = f1 + size2; f2 < last; f2 += size2) { - if ((cmp(f2, f2+ size) > 0) != sense) + if ((CMP(f2, f2+ size) > 0) != sense) break; length += 2; } @@ -303,7 +315,7 @@ setup(list1, list2, n, size, cmp) } else { /* Natural merge */ l2 = f2; for (f2 = f1 + size2; f2 < l2; f2 += size2) { - if ((cmp(f2-size, f2) > 0) != sense) { + if ((CMP(f2-size, f2) > 0) != sense) { p2 = *EVAL(p2) = f2 - list1 + list2; if (sense > 0) reverse(f1, f2-size); @@ -313,7 +325,7 @@ setup(list1, list2, n, size, cmp) if (sense > 0) reverse (f1, f2-size); f1 = f2; - if (f2 < last || cmp(f2 - size, f2) > 0) + if (f2 < last || CMP(f2 - size, f2) > 0) p2 = *EVAL(p2) = f2 - list1 + list2; else p2 = *EVAL(p2) = list2 + n*size; @@ -322,7 +334,7 @@ setup(list1, list2, n, size, cmp) #else /* pairwise merge only. */ for (f1 = list1, p2 = list2; f1 < last; f1 += size2) { p2 = *EVAL(p2) = p2 + size2; - if (cmp (f1, f1 + size) > 0) + if (CMP (f1, f1 + size) > 0) swap(f1, f1 + size); } #endif /* NATURAL */ @@ -336,7 +348,7 @@ static void insertionsort(a, n, size, cmp) u_char *a; size_t n, size; - int (*cmp)(const void *, const void *); + cmp_t cmp; { u_char *ai, *s, *t, *u, tmp; int i; @@ -344,7 +356,7 @@ insertionsort(a, n, size, cmp) for (ai = a+size; --n >= 1; ai += size) for (t = ai; t > a; t -= size) { u = t - size; - if (cmp(u, t) <= 0) + if (CMP(u, t) <= 0) break; swap(u, t); } Added: head/lib/libc/stdlib/mergesort_b.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/stdlib/mergesort_b.c Wed Apr 2 16:07:48 2014 (r264042) @@ -0,0 +1,29 @@ +/*- + * Copyright (c) 2014 David Chisnall + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#define I_AM_MERGESORT_B +#include "merge.c" Modified: head/lib/libc/stdlib/qsort.3 ============================================================================== --- head/lib/libc/stdlib/qsort.3 Wed Apr 2 15:56:11 2014 (r264041) +++ head/lib/libc/stdlib/qsort.3 Wed Apr 2 16:07:48 2014 (r264042) @@ -36,7 +36,7 @@ .Dt QSORT 3 .Os .Sh NAME -.Nm qsort , qsort_r , heapsort , mergesort +.Nm qsort , qsort_b , qsort_r , heapsort , heapsort_b , mergesort, mergesort_b .Nd sort functions .Sh LIBRARY .Lb libc @@ -50,6 +50,13 @@ .Fa "int \*[lp]*compar\*[rp]\*[lp]const void *, const void *\*[rp]" .Fc .Ft void +.Fo qsort_b +.Fa "void *base" +.Fa "size_t nmemb" +.Fa "size_t size" +.Fa "int \*[lp]^compar\*[rp]\*[lp]const void *, const void *\*[rp]" +.Fc +.Ft void .Fo qsort_r .Fa "void *base" .Fa "size_t nmemb" @@ -65,12 +72,26 @@ .Fa "int \*[lp]*compar\*[rp]\*[lp]const void *, const void *\*[rp]" .Fc .Ft int +.Fo heapsort_b +.Fa "void *base" +.Fa "size_t nmemb" +.Fa "size_t size" +.Fa "int \*[lp]^compar\*[rp]\*[lp]const void *, const void *\*[rp]" +.Fc +.Ft int .Fo mergesort .Fa "void *base" .Fa "size_t nmemb" .Fa "size_t size" .Fa "int \*[lp]*compar\*[rp]\*[lp]const void *, const void *\*[rp]" .Fc +.Ft int +.Fo mergesort_b +.Fa "void *base" +.Fa "size_t nmemb" +.Fa "size_t size" +.Fa "int \*[lp]^compar\*[rp]\*[lp]const void *, const void *\*[rp]" +.Fc .Sh DESCRIPTION The .Fn qsort @@ -127,6 +148,11 @@ This allows the comparison function to a data without using global variables, and thus .Fn qsort_r is suitable for use in functions which must be reentrant. +The +.Fn qsort_b +function behaves identically to +.Fn qsort , +except that it takes a block, rather than a function pointer. .Pp The algorithms implemented by .Fn qsort , @@ -138,8 +164,18 @@ are stable, that is, if two members compare as equal, their order in the sorted array is undefined. The +.Fn heapsort_b +function behaves identically to +.Fn heapsort , +except that it takes a block, rather than a function pointer. +The .Fn mergesort algorithm is stable. +The +.Fn mergesort_b +function behaves identically to +.Fn mergesort , +except that it takes a block, rather than a function pointer. .Pp The .Fn qsort @@ -324,3 +360,7 @@ The function conforms to .St -isoC . +.Sh HISTORY +The variants of these functions that take blocks as arguments first appeared in +Mac OS X. +This implementation was created by David Chisnall. Modified: head/lib/libc/stdlib/qsort_r.c ============================================================================== --- head/lib/libc/stdlib/qsort_r.c Wed Apr 2 15:56:11 2014 (r264041) +++ head/lib/libc/stdlib/qsort_r.c Wed Apr 2 16:07:48 2014 (r264042) @@ -4,5 +4,15 @@ * * $FreeBSD$ */ +#include "block_abi.h" #define I_AM_QSORT_R #include "qsort.c" + +void +qsort_b(void *base, size_t nel, size_t width, + DECLARE_BLOCK(int, compar, const void *, const void *)) +{ + qsort_r(base, nel, width, compar, + (int (*)(void *, const void *, const void *)) + GET_BLOCK_FUNCTION(compar)); +} From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 16:18:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05CD48D9; Wed, 2 Apr 2014 16:18:52 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6526A75C; Wed, 2 Apr 2014 16:18:51 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.8/8.14.8) with ESMTP id s32GIjvR028003; Wed, 2 Apr 2014 19:18:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s32GIjvR028003 Received: (from kostik@localhost) by tom.home (8.14.8/8.14.8/Submit) id s32GIj2G028002; Wed, 2 Apr 2014 19:18:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 2 Apr 2014 19:18:45 +0300 From: Konstantin Belousov To: David Chisnall Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib Message-ID: <20140402161845.GP21331@kib.kiev.ua> References: <201404021607.s32G7mhw051355@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wTzoGrkn2AhIv4sC" Content-Disposition: inline In-Reply-To: <201404021607.s32G7mhw051355@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 16:18:52 -0000 --wTzoGrkn2AhIv4sC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Apr 02, 2014 at 04:07:48PM +0000, David Chisnall wrote: > Modified: head/lib/libc/gen/Symbol.map > ============================================================================== > --- head/lib/libc/gen/Symbol.map Wed Apr 2 15:56:11 2014 (r264041) > +++ head/lib/libc/gen/Symbol.map Wed Apr 2 16:07:48 2014 (r264042) > @@ -349,6 +349,7 @@ FBSD_1.1 { > posix_spawnattr_setsigdefault; > posix_spawnattr_setsigmask; > posix_spawnp; > + scandir_b; > semctl; > tcgetsid; > tcsetsid; This is completely wrong. You cannot modify FreeBSD 8.x namespace in 11.x HEAD time. Also, the ABI of the libc now depends on the compiler which was used to build the library, which is also wrong and ugly. --wTzoGrkn2AhIv4sC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJTPDhkAAoJEJDCuSvBvK1Bi3kP/jbyBLYk1xvzQxGASQ+pYr4u /JsoS6nYiuUJp8rAbm8/uUgEUzzW6AHGnbynYXLmac5P7IND/F15CA5Qt5V2ieg2 otId4YgXpqYnqUQrL3/U5EQ+bLzgRo1hKsCSYKbC5sKYMaqlWpeYRqaPnHkUAeu9 u9eEHzR96CoDi7jXu8Gzj7h/cIgSsSyZuyb8k+JJwyZ4eOMUX6t/RMq/GBm/rvTe e2CW1gHL8VUghpUbd2u0EiTfzHqUXlWBc2ewW+kGtPMHrMJO9iRF11rdUtVq7fKc wTle4H05J0ASofikNrn9hZ/omrbjEqNiRPsoOf1ZlXTAISAJqMq/ki045uX+fBVv k+e720MpqOJ6+PC03eU/I75w26NrstLS4slH6q+NKb7EvjhluDpYr1cuae5r/HIM npQFZakp366AQrNtTUk8I9JZiWf198hM9voGE8I22IRY+62C8A4pGMnpBM+/YFEQ S67fjWO6oqMtXj/7gM/2pgdy640Xa+qgO4BSLWI++7QyivUyJL60ZRvTVKfElhUD +J5Wld0ixaVCkDYgmUVOYwjG8Mr5ypqgs+QbaMZuYCIbkzt3kLTad2ljn/EMXSCU CD3M4APdHbCq4VkZE+5us+zS80fHsjOifV4zbA0Cd1dGZ3gDqsfsOJEKonJFalXo D8+0t+kFXFwEjpqcrYkW =iYSy -----END PGP SIGNATURE----- --wTzoGrkn2AhIv4sC-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 16:23:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E4B7C20; Wed, 2 Apr 2014 16:23:49 +0000 (UTC) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AB36806; Wed, 2 Apr 2014 16:23:48 +0000 (UTC) Received: by mail.lifanov.com (Postfix, from userid 58) id A32311AF4CA; Wed, 2 Apr 2014 12:23:48 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.lifanov.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from [10.1.3.5] (cnet520-windstream.mcclatchyinteractive.com [166.108.16.2]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.lifanov.com (Postfix) with ESMTPSA id A91A11A5943; Wed, 2 Apr 2014 12:23:47 -0400 (EDT) Message-ID: <533C3992.9030203@mail.lifanov.com> Date: Wed, 02 Apr 2014 12:23:46 -0400 From: Nikolai Lifanov User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Glen Barber Subject: Re: svn commit: r264027 - in head: release share/man/man7 References: <201404012241.s31MfRW6020684@svn.freebsd.org> <20140402154022.GA70867@lor.one-eyed-alien.net> <20140402155134.GG14379@glenbarber.us> <533C32F5.9050809@mail.lifanov.com> <20140402160650.GH14379@glenbarber.us> In-Reply-To: <20140402160650.GH14379@glenbarber.us> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Brooks Davis , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 16:23:49 -0000 On 04/02/14 12:06, Glen Barber wrote: > On Wed, Apr 02, 2014 at 11:55:33AM -0400, Nikolai Lifanov wrote: >> On 04/02/14 11:51, Glen Barber wrote: >>> On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: >>>> On Tue, Apr 01, 2014 at 10:41:27PM +0000, Glen Barber wrote: >>>>> Author: gjb >>>>> Date: Tue Apr 1 22:41:26 2014 >>>>> New Revision: 264027 >>>>> URL: http://svnweb.freebsd.org/changeset/base/264027 >>>>> >>>>> Log: >>>>> Add a new release build variable, WITH_COMPRESSED_IMAGES. >>>>> >>>>> When set to a non-empty value, the installation medium is >>>>> compressed with gzip(1) as part of the 'install' target in >>>>> the release/ directory. >>>>> >>>>> With gzip(1) compression, downloadable image are reduced in >>>>> size quite significantly. Build test against head@263927 >>>>> shows the following: >>>>> >>>>> bootonly.iso: 64% smaller >>>>> disc1.iso: 44% smaller >>>>> memstick.img: 47% smaller >>>>> mini-memstick.img: 65% smaller >>>>> dvd1.iso: untested >>>>> >>>>> This option is off by default, I would eventually like to >>>>> turn it on by default, and remove the '-k' flag to gzip(1) >>>>> so only compressed images are published on FTP. >>>> >>>> I'd recommend testing xz compression as well. With UFS images of a full >>>> world the savings vs gzip are significant (more than 30% IIRC, but it's >>>> need more than a year since I checked so I'm a bit unsure of the exact >>>> numbers). >>>> >>> >>> delphij also brought this up. >>> >>> I have concerns with xz(1), since there was mention in IRC that Windows >>> users may have problems decompressing xz-compressed images. So, gzip(1) >>> is used because it seems to be the more commonly-supported archive >>> mechanisms. >>> >>> The benefit of xz(1) over gzip(1) was only 50M-ish. >>> >>> -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso >>> -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 >>> -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz >>> -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz >>> >>> Glen >>> >> >> How about 7zip (Windows program, not file format)? What would a Windows >> user use that can decompress gzip and not xz? It was a problem around >> ~2007, but xz support is no longer rare or exotic. >> > > I don't know, to be honest. I have no Windows machines to test, so > I can only go by what I am told. > > Glen > I just verified it with 7zip for Windows version 9.22. It extracts .tar.xz archives and decompresses .xz images. - Nikolai Lifanov From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 16:29:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F2CBE19; Wed, 2 Apr 2014 16:29:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F06D5845; Wed, 2 Apr 2014 16:29:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s32GTTAw059896; Wed, 2 Apr 2014 16:29:29 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s32GTT0f059895; Wed, 2 Apr 2014 16:29:29 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201404021629.s32GTT0f059895@svn.freebsd.org> From: David Chisnall Date: Wed, 2 Apr 2014 16:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264043 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 16:29:30 -0000 Author: theraven Date: Wed Apr 2 16:29:29 2014 New Revision: 264043 URL: http://svnweb.freebsd.org/changeset/base/264043 Log: Move scandir_b to a later symbol version. Modified: head/lib/libc/gen/Symbol.map Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Wed Apr 2 16:07:48 2014 (r264042) +++ head/lib/libc/gen/Symbol.map Wed Apr 2 16:29:29 2014 (r264043) @@ -349,7 +349,6 @@ FBSD_1.1 { posix_spawnattr_setsigdefault; posix_spawnattr_setsigmask; posix_spawnp; - scandir_b; semctl; tcgetsid; tcsetsid; @@ -393,6 +392,7 @@ FBSD_1.3 { nvis; pwcache_userdb; pwcache_groupdb; + scandir_b; snvis; strenvisx; strnunvis; From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 16:31:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77FEAF85; Wed, 2 Apr 2014 16:31:01 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "theravensnest.org", Issuer "theravensnest.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4274A8D0; Wed, 2 Apr 2014 16:31:00 +0000 (UTC) Received: from [192.168.0.100] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s32GUuY6056964 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 2 Apr 2014 16:30:58 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib From: David Chisnall In-Reply-To: <20140402161845.GP21331@kib.kiev.ua> Date: Wed, 2 Apr 2014 17:30:51 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <76A3F92F-18CB-4A9A-8CF5-3A86035C55BB@FreeBSD.org> References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140402161845.GP21331@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 16:31:01 -0000 On 2 Apr 2014, at 17:18, Konstantin Belousov = wrote: > This is completely wrong. You cannot modify FreeBSD 8.x namespace in > 11.x HEAD time. That was an error, however we are using symbol versioning completely = wrongly in FreeBSD anyway (see the last two DevSummit discussions and = the wiki page). New entries should *always* go in the version 0 = namespace (so that when they're MFCd the changes Just Work=99) and only = ever be moved out of there when they are replaced with versions with = different semantics. The weird hybrid we have that tries to conflate symbol versions and OS = releases manages to get the worst of both worlds. I've now moved it to the FBSD_1.3 namespace, but I would be more in = favour of going with the consensus from the last DevSummit and using = symbol versioning properly and move them all into the FBSD_1.0 = namespace. > Also, the ABI of the libc now depends on the compiler which was used = to > build the library, which is also wrong and ugly. No it doesn't. Read the patch. David From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 16:33:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5131265; Wed, 2 Apr 2014 16:33:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2AA08F1; Wed, 2 Apr 2014 16:33:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s32GX21c063343; Wed, 2 Apr 2014 16:33:02 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s32GX2PY063342; Wed, 2 Apr 2014 16:33:02 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404021633.s32GX2PY063342@svn.freebsd.org> From: Warner Losh Date: Wed, 2 Apr 2014 16:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264044 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 16:33:02 -0000 Author: imp Date: Wed Apr 2 16:33:02 2014 New Revision: 264044 URL: http://svnweb.freebsd.org/changeset/base/264044 Log: FreeBSD make (aka fmake) doesn't grok .MAKE.LEVEL. Failsafe and assume that it is OK to set MK_xxx flags. Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Wed Apr 2 16:29:29 2014 (r264043) +++ head/share/mk/bsd.own.mk Wed Apr 2 16:33:02 2014 (r264044) @@ -432,7 +432,7 @@ __DEFAULT_YES_OPTIONS+=GCC GNUCXX .error WITH_${var} and WITHOUT_${var} can't both be set. .endif .if defined(MK_${var}) -.if ${.MAKE.LEVEL} == 0 +.if defined(.MAKE.LEVEL) && ${.MAKE.LEVEL} == 0 .error MK_${var} can't be set by a user. .endif .else From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 16:33:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DD223A4; Wed, 2 Apr 2014 16:33:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67DB68F6; Wed, 2 Apr 2014 16:33:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s32GXBof063409; Wed, 2 Apr 2014 16:33:11 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s32GXBTc063408; Wed, 2 Apr 2014 16:33:11 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404021633.s32GXBTc063408@svn.freebsd.org> From: Warner Losh Date: Wed, 2 Apr 2014 16:33:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264045 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 16:33:11 -0000 Author: imp Date: Wed Apr 2 16:33:10 2014 New Revision: 264045 URL: http://svnweb.freebsd.org/changeset/base/264045 Log: Move setting of the MK_xxx variables based on NO_xxx to avoid triggering the "you aren't allowed to set this" warning when building stand alone in directories whose Makefile sets NO_MAN, for example. Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Wed Apr 2 16:33:02 2014 (r264044) +++ head/share/mk/bsd.own.mk Wed Apr 2 16:33:10 2014 (r264045) @@ -219,21 +219,6 @@ COMPRESS_EXT?= .gz # # -# Supported NO_* options (if defined, MK_* will be forced to "no", -# regardless of user's setting). -# -.for var in \ - CTF \ - DEBUG_FILES \ - INSTALLLIB \ - MAN \ - PROFILE -.if defined(NO_${var}) -MK_${var}:=no -.endif -.endfor - -# # Older-style variables that enabled behaviour when set. # .if defined(YES_HESIOD) @@ -466,6 +451,22 @@ MK_${var}:= no .endfor .undef __DEFAULT_NO_OPTIONS + +# +# Supported NO_* options (if defined, MK_* will be forced to "no", +# regardless of user's setting). +# +.for var in \ + CTF \ + DEBUG_FILES \ + INSTALLLIB \ + MAN \ + PROFILE +.if defined(NO_${var}) +MK_${var}:=no +.endif +.endfor + # # Force some options off if their dependencies are off. # Order is somewhat important. From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 16:33:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0731C4F4; Wed, 2 Apr 2014 16:33:55 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.glenbarber.us", Issuer "RapidSSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5D25907; Wed, 2 Apr 2014 16:33:54 +0000 (UTC) Received: from glenbarber.us (70.15.88.86.res-cmts.sewb.ptd.net [70.15.88.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 168C6BAD2; Wed, 2 Apr 2014 16:33:53 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 168C6BAD2 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Wed, 2 Apr 2014 12:33:50 -0400 From: Glen Barber To: Nikolai Lifanov Subject: Re: svn commit: r264027 - in head: release share/man/man7 Message-ID: <20140402163350.GI14379@glenbarber.us> References: <201404012241.s31MfRW6020684@svn.freebsd.org> <20140402154022.GA70867@lor.one-eyed-alien.net> <20140402155134.GG14379@glenbarber.us> <533C32F5.9050809@mail.lifanov.com> <20140402160650.GH14379@glenbarber.us> <533C3992.9030203@mail.lifanov.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="yzvKDKJiLNESc64M" Content-Disposition: inline In-Reply-To: <533C3992.9030203@mail.lifanov.com> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Brooks Davis , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 16:33:55 -0000 --yzvKDKJiLNESc64M Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 02, 2014 at 12:23:46PM -0400, Nikolai Lifanov wrote: > On 04/02/14 12:06, Glen Barber wrote: > > On Wed, Apr 02, 2014 at 11:55:33AM -0400, Nikolai Lifanov wrote: > >> On 04/02/14 11:51, Glen Barber wrote: > >>> On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: > >>>> On Tue, Apr 01, 2014 at 10:41:27PM +0000, Glen Barber wrote: > >>>>> Author: gjb > >>>>> Date: Tue Apr 1 22:41:26 2014 > >>>>> New Revision: 264027 > >>>>> URL: http://svnweb.freebsd.org/changeset/base/264027 > >>>>> > >>>>> Log: > >>>>> Add a new release build variable, WITH_COMPRESSED_IMAGES. > >>>>> =20 > >>>>> When set to a non-empty value, the installation medium is > >>>>> compressed with gzip(1) as part of the 'install' target in > >>>>> the release/ directory. > >>>>> =20 > >>>>> With gzip(1) compression, downloadable image are reduced in > >>>>> size quite significantly. Build test against head@263927 > >>>>> shows the following: > >>>>> =20 > >>>>> bootonly.iso: 64% smaller > >>>>> disc1.iso: 44% smaller > >>>>> memstick.img: 47% smaller > >>>>> mini-memstick.img: 65% smaller > >>>>> dvd1.iso: untested > >>>>> =20 > >>>>> This option is off by default, I would eventually like to > >>>>> turn it on by default, and remove the '-k' flag to gzip(1) > >>>>> so only compressed images are published on FTP. > >>>> > >>>> I'd recommend testing xz compression as well. With UFS images of a = full > >>>> world the savings vs gzip are significant (more than 30% IIRC, but i= t's > >>>> need more than a year since I checked so I'm a bit unsure of the exa= ct > >>>> numbers). > >>>> > >>> > >>> delphij also brought this up. > >>> > >>> I have concerns with xz(1), since there was mention in IRC that Windo= ws > >>> users may have problems decompressing xz-compressed images. So, gzip= (1) > >>> is used because it seems to be the more commonly-supported archive > >>> mechanisms. > >>> > >>> The benefit of xz(1) over gzip(1) was only 50M-ish. > >>> > >>> -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso > >>> -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 > >>> -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz > >>> -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz > >>> > >>> Glen > >>> > >> > >> How about 7zip (Windows program, not file format)? What would a Windows > >> user use that can decompress gzip and not xz? It was a problem around > >> ~2007, but xz support is no longer rare or exotic. > >> > >=20 > > I don't know, to be honest. I have no Windows machines to test, so > > I can only go by what I am told. > >=20 > > Glen > >=20 >=20 > I just verified it with 7zip for Windows version 9.22. It extracts > .tar.xz archives and decompresses .xz images. >=20 Great, thank you for confirming. So, the question I have now is, considering the time it takes to compress the image with xz(1) compared to gzip(1), is that worth saving the 50MB space? I do not object to using xz(1), but the compression time difference was quite significant. (I do not have numbers off-hand, but can run the compression again.) Glen --yzvKDKJiLNESc64M Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTPDvuAAoJELls3eqvi17QM1UP/1Je9M++uGqBmut+6mkMK2SW mickD3VWcx+XYhJ1obj2OlkaIfykbElz++uHlbrVMc5BVHbaV/K5WI1TO95XOdeP U/HlKNYXN+/yxq/bmAiYGl03/Qa9LbvAnd5wwqWQPpU+G2erzSYrz/lvS9Hau6EO ZF897QfAlxOq9lAEVZbIw6RKARFKZ0uUcCnJnrelHRMGg4RqQC6pguUKyA2uZ+QJ 9dS4f3tCF3q0mpBa6KdHzR9LqG8lr68oflTpgOoFp7WUGpoR5aPU01NFvbrZtXjd Zrk7Eds9daf5/W2D7WJtNk+FyauJqGqECtNZyMLXjlA/38kBBy6dI23ThF0pYMK3 J/zUKIfvS4RmUN6JxIZImJSBlUVo61dK8zQ6qJGSvBgZVgFQt8GrgGIJDKRR6roW swy/EzH0k/GlN7BVLkTi3os11p7Zz1+oxC8UnIQUq/WBUkj863Jzx8SwDGgvzqiw wWV+uwVPbKKC61gGHvuUGJiDf+dA6ZRob1SVHLoa4w3H6x0u7PnOShNpsRYCBkeg 3HRRX+U0/BkrIJhuVrRHSrm7zmivzfkPwqGytGHFdyUcPMEbJ/Z7CI8YI/jMbxNy kOysZKzwe6pkmbx9Ri8yY0j7MOYMvdVl6t1yLllitJCvZUoYGac883lWmbSM8bP+ d70lJSV1FQASKRVKrmjN =t7oh -----END PGP SIGNATURE----- --yzvKDKJiLNESc64M-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 16:40:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A7A26DF; Wed, 2 Apr 2014 16:40:16 +0000 (UTC) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AD1D9C9; Wed, 2 Apr 2014 16:40:15 +0000 (UTC) Received: by mail.lifanov.com (Postfix, from userid 58) id 4F5BD1AF4D4; Wed, 2 Apr 2014 12:40:15 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.lifanov.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from [10.1.3.5] (cnet520-windstream.mcclatchyinteractive.com [166.108.16.2]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.lifanov.com (Postfix) with ESMTPSA id 6C9F01A5943; Wed, 2 Apr 2014 12:40:14 -0400 (EDT) Message-ID: <533C3D6D.3060604@mail.lifanov.com> Date: Wed, 02 Apr 2014 12:40:13 -0400 From: Nikolai Lifanov User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Glen Barber Subject: Re: svn commit: r264027 - in head: release share/man/man7 References: <201404012241.s31MfRW6020684@svn.freebsd.org> <20140402154022.GA70867@lor.one-eyed-alien.net> <20140402155134.GG14379@glenbarber.us> <533C32F5.9050809@mail.lifanov.com> <20140402160650.GH14379@glenbarber.us> <533C3992.9030203@mail.lifanov.com> <20140402163350.GI14379@glenbarber.us> In-Reply-To: <20140402163350.GI14379@glenbarber.us> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Brooks Davis , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 16:40:16 -0000 On 04/02/14 12:33, Glen Barber wrote: > On Wed, Apr 02, 2014 at 12:23:46PM -0400, Nikolai Lifanov wrote: >> On 04/02/14 12:06, Glen Barber wrote: >>> On Wed, Apr 02, 2014 at 11:55:33AM -0400, Nikolai Lifanov wrote: >>>> On 04/02/14 11:51, Glen Barber wrote: >>>>> On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: >>>>>> On Tue, Apr 01, 2014 at 10:41:27PM +0000, Glen Barber wrote: >>>>>>> Author: gjb >>>>>>> Date: Tue Apr 1 22:41:26 2014 >>>>>>> New Revision: 264027 >>>>>>> URL: http://svnweb.freebsd.org/changeset/base/264027 >>>>>>> >>>>>>> Log: >>>>>>> Add a new release build variable, WITH_COMPRESSED_IMAGES. >>>>>>> >>>>>>> When set to a non-empty value, the installation medium is >>>>>>> compressed with gzip(1) as part of the 'install' target in >>>>>>> the release/ directory. >>>>>>> >>>>>>> With gzip(1) compression, downloadable image are reduced in >>>>>>> size quite significantly. Build test against head@263927 >>>>>>> shows the following: >>>>>>> >>>>>>> bootonly.iso: 64% smaller >>>>>>> disc1.iso: 44% smaller >>>>>>> memstick.img: 47% smaller >>>>>>> mini-memstick.img: 65% smaller >>>>>>> dvd1.iso: untested >>>>>>> >>>>>>> This option is off by default, I would eventually like to >>>>>>> turn it on by default, and remove the '-k' flag to gzip(1) >>>>>>> so only compressed images are published on FTP. >>>>>> >>>>>> I'd recommend testing xz compression as well. With UFS images of a full >>>>>> world the savings vs gzip are significant (more than 30% IIRC, but it's >>>>>> need more than a year since I checked so I'm a bit unsure of the exact >>>>>> numbers). >>>>>> >>>>> >>>>> delphij also brought this up. >>>>> >>>>> I have concerns with xz(1), since there was mention in IRC that Windows >>>>> users may have problems decompressing xz-compressed images. So, gzip(1) >>>>> is used because it seems to be the more commonly-supported archive >>>>> mechanisms. >>>>> >>>>> The benefit of xz(1) over gzip(1) was only 50M-ish. >>>>> >>>>> -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso >>>>> -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 >>>>> -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz >>>>> -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz >>>>> >>>>> Glen >>>>> >>>> >>>> How about 7zip (Windows program, not file format)? What would a Windows >>>> user use that can decompress gzip and not xz? It was a problem around >>>> ~2007, but xz support is no longer rare or exotic. >>>> >>> >>> I don't know, to be honest. I have no Windows machines to test, so >>> I can only go by what I am told. >>> >>> Glen >>> >> >> I just verified it with 7zip for Windows version 9.22. It extracts >> .tar.xz archives and decompresses .xz images. >> > > Great, thank you for confirming. > > So, the question I have now is, considering the time it takes to > compress the image with xz(1) compared to gzip(1), is that worth saving > the 50MB space? > > I do not object to using xz(1), but the compression time difference was > quite significant. (I do not have numbers off-hand, but can run the > compression again.) > > Glen > Compression is much more expensive. There are different levels too, so xz -9e my16Gfile.img on a 4 core i7 can take up to 8 hours. Other levels are cheaper. De-compression (for the end user) is as cheap or cheaper than gzip. Depending on the chosen compression level, the minimum amount of RAM required for decompression can also grow. The xz(1) explains these properties. - Nikolai Lifanov From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 16:41:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFCDD8B4; Wed, 2 Apr 2014 16:41:31 +0000 (UTC) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23E4D9E1; Wed, 2 Apr 2014 16:41:29 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.7/8.14.7) with ESMTP id s32GfT98039923; Wed, 2 Apr 2014 11:41:29 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.7/8.14.7/Submit) id s32GfTRO039922; Wed, 2 Apr 2014 11:41:29 -0500 (CDT) (envelope-from brooks) Date: Wed, 2 Apr 2014 11:41:29 -0500 From: Brooks Davis To: Glen Barber Subject: Re: svn commit: r264027 - in head: release share/man/man7 Message-ID: <20140402164128.GB70867@lor.one-eyed-alien.net> References: <201404012241.s31MfRW6020684@svn.freebsd.org> <20140402154022.GA70867@lor.one-eyed-alien.net> <20140402155134.GG14379@glenbarber.us> <533C32F5.9050809@mail.lifanov.com> <20140402160650.GH14379@glenbarber.us> <533C3992.9030203@mail.lifanov.com> <20140402163350.GI14379@glenbarber.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aVD9QWMuhilNxW9f" Content-Disposition: inline In-Reply-To: <20140402163350.GI14379@glenbarber.us> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Nikolai Lifanov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 16:41:31 -0000 --aVD9QWMuhilNxW9f Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 02, 2014 at 12:33:50PM -0400, Glen Barber wrote: > On Wed, Apr 02, 2014 at 12:23:46PM -0400, Nikolai Lifanov wrote: > > On 04/02/14 12:06, Glen Barber wrote: > > > On Wed, Apr 02, 2014 at 11:55:33AM -0400, Nikolai Lifanov wrote: > > >> On 04/02/14 11:51, Glen Barber wrote: > > >>> On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: > > >>>> On Tue, Apr 01, 2014 at 10:41:27PM +0000, Glen Barber wrote: > > >>>>> Author: gjb > > >>>>> Date: Tue Apr 1 22:41:26 2014 > > >>>>> New Revision: 264027 > > >>>>> URL: http://svnweb.freebsd.org/changeset/base/264027 > > >>>>> > > >>>>> Log: > > >>>>> Add a new release build variable, WITH_COMPRESSED_IMAGES. > > >>>>> =20 > > >>>>> When set to a non-empty value, the installation medium is > > >>>>> compressed with gzip(1) as part of the 'install' target in > > >>>>> the release/ directory. > > >>>>> =20 > > >>>>> With gzip(1) compression, downloadable image are reduced in > > >>>>> size quite significantly. Build test against head@263927 > > >>>>> shows the following: > > >>>>> =20 > > >>>>> bootonly.iso: 64% smaller > > >>>>> disc1.iso: 44% smaller > > >>>>> memstick.img: 47% smaller > > >>>>> mini-memstick.img: 65% smaller > > >>>>> dvd1.iso: untested > > >>>>> =20 > > >>>>> This option is off by default, I would eventually like to > > >>>>> turn it on by default, and remove the '-k' flag to gzip(1) > > >>>>> so only compressed images are published on FTP. > > >>>> > > >>>> I'd recommend testing xz compression as well. With UFS images of = a full > > >>>> world the savings vs gzip are significant (more than 30% IIRC, but= it's > > >>>> need more than a year since I checked so I'm a bit unsure of the e= xact > > >>>> numbers). > > >>>> > > >>> > > >>> delphij also brought this up. > > >>> > > >>> I have concerns with xz(1), since there was mention in IRC that Win= dows > > >>> users may have problems decompressing xz-compressed images. So, gz= ip(1) > > >>> is used because it seems to be the more commonly-supported archive > > >>> mechanisms. > > >>> > > >>> The benefit of xz(1) over gzip(1) was only 50M-ish. > > >>> > > >>> -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso > > >>> -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 > > >>> -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz > > >>> -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz > > >>> > > >>> Glen > > >>> > > >> > > >> How about 7zip (Windows program, not file format)? What would a Wind= ows > > >> user use that can decompress gzip and not xz? It was a problem around > > >> ~2007, but xz support is no longer rare or exotic. > > >> > > >=20 > > > I don't know, to be honest. I have no Windows machines to test, so > > > I can only go by what I am told. > > >=20 > > > Glen > > >=20 > >=20 > > I just verified it with 7zip for Windows version 9.22. It extracts > > .tar.xz archives and decompresses .xz images. > >=20 >=20 > Great, thank you for confirming. >=20 > So, the question I have now is, considering the time it takes to > compress the image with xz(1) compared to gzip(1), is that worth saving > the 50MB space? >=20 > I do not object to using xz(1), but the compression time difference was > quite significant. (I do not have numbers off-hand, but can run the > compression again.) xz is quite slow, but who cares if it's something we do once for the benefit of many. One thing I did do in my build system is use pxz from ports. It speeds things up quite a bit on many-core machines with lots of ram. -- Brooks --aVD9QWMuhilNxW9f Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iKYEARECAGYFAlM8PbhfFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl bnBncC5maWZ0aGhvcnNlbWFuLm5ldDY1NUQ1MTlDMjZBNzgyRTcyNTI5OUJGMDVE OEU4QkU5RjIzODFBRDQACgkQXY6L6fI4GtRMxgCghh9nyWP1Nk3ejp4yRKnGCLPV snEAoMYmk8CIjnNZ61JBJtUAarbZG5AX =9u7m -----END PGP SIGNATURE----- --aVD9QWMuhilNxW9f-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 16:48:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91524D56; Wed, 2 Apr 2014 16:48:13 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.glenbarber.us", Issuer "RapidSSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A568A50; Wed, 2 Apr 2014 16:48:13 +0000 (UTC) Received: from glenbarber.us (70.15.88.86.res-cmts.sewb.ptd.net [70.15.88.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 975C7BC12; Wed, 2 Apr 2014 16:48:11 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 975C7BC12 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Wed, 2 Apr 2014 12:48:08 -0400 From: Glen Barber To: Brooks Davis Subject: Re: svn commit: r264027 - in head: release share/man/man7 Message-ID: <20140402164808.GJ14379@glenbarber.us> References: <201404012241.s31MfRW6020684@svn.freebsd.org> <20140402154022.GA70867@lor.one-eyed-alien.net> <20140402155134.GG14379@glenbarber.us> <533C32F5.9050809@mail.lifanov.com> <20140402160650.GH14379@glenbarber.us> <533C3992.9030203@mail.lifanov.com> <20140402163350.GI14379@glenbarber.us> <20140402164128.GB70867@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tKy6e3LXpfmanBFM" Content-Disposition: inline In-Reply-To: <20140402164128.GB70867@lor.one-eyed-alien.net> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Nikolai Lifanov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 16:48:13 -0000 --tKy6e3LXpfmanBFM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 02, 2014 at 11:41:29AM -0500, Brooks Davis wrote: > On Wed, Apr 02, 2014 at 12:33:50PM -0400, Glen Barber wrote: > > On Wed, Apr 02, 2014 at 12:23:46PM -0400, Nikolai Lifanov wrote: > > > On 04/02/14 12:06, Glen Barber wrote: > > > > On Wed, Apr 02, 2014 at 11:55:33AM -0400, Nikolai Lifanov wrote: > > > >> On 04/02/14 11:51, Glen Barber wrote: > > > >>> On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: > > > >>>> On Tue, Apr 01, 2014 at 10:41:27PM +0000, Glen Barber wrote: > > > >>>>> Author: gjb > > > >>>>> Date: Tue Apr 1 22:41:26 2014 > > > >>>>> New Revision: 264027 > > > >>>>> URL: http://svnweb.freebsd.org/changeset/base/264027 > > > >>>>> > > > >>>>> Log: > > > >>>>> Add a new release build variable, WITH_COMPRESSED_IMAGES. > > > >>>>> =20 > > > >>>>> When set to a non-empty value, the installation medium is > > > >>>>> compressed with gzip(1) as part of the 'install' target in > > > >>>>> the release/ directory. > > > >>>>> =20 > > > >>>>> With gzip(1) compression, downloadable image are reduced in > > > >>>>> size quite significantly. Build test against head@263927 > > > >>>>> shows the following: > > > >>>>> =20 > > > >>>>> bootonly.iso: 64% smaller > > > >>>>> disc1.iso: 44% smaller > > > >>>>> memstick.img: 47% smaller > > > >>>>> mini-memstick.img: 65% smaller > > > >>>>> dvd1.iso: untested > > > >>>>> =20 > > > >>>>> This option is off by default, I would eventually like to > > > >>>>> turn it on by default, and remove the '-k' flag to gzip(1) > > > >>>>> so only compressed images are published on FTP. > > > >>>> > > > >>>> I'd recommend testing xz compression as well. With UFS images o= f a full > > > >>>> world the savings vs gzip are significant (more than 30% IIRC, b= ut it's > > > >>>> need more than a year since I checked so I'm a bit unsure of the= exact > > > >>>> numbers). > > > >>>> > > > >>> > > > >>> delphij also brought this up. > > > >>> > > > >>> I have concerns with xz(1), since there was mention in IRC that W= indows > > > >>> users may have problems decompressing xz-compressed images. So, = gzip(1) > > > >>> is used because it seems to be the more commonly-supported archive > > > >>> mechanisms. > > > >>> > > > >>> The benefit of xz(1) over gzip(1) was only 50M-ish. > > > >>> > > > >>> -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso > > > >>> -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 > > > >>> -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz > > > >>> -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz > > > >>> > > > >>> Glen > > > >>> > > > >> > > > >> How about 7zip (Windows program, not file format)? What would a Wi= ndows > > > >> user use that can decompress gzip and not xz? It was a problem aro= und > > > >> ~2007, but xz support is no longer rare or exotic. > > > >> > > > >=20 > > > > I don't know, to be honest. I have no Windows machines to test, so > > > > I can only go by what I am told. > > > >=20 > > > > Glen > > > >=20 > > >=20 > > > I just verified it with 7zip for Windows version 9.22. It extracts > > > .tar.xz archives and decompresses .xz images. > > >=20 > >=20 > > Great, thank you for confirming. > >=20 > > So, the question I have now is, considering the time it takes to > > compress the image with xz(1) compared to gzip(1), is that worth saving > > the 50MB space? > >=20 > > I do not object to using xz(1), but the compression time difference was > > quite significant. (I do not have numbers off-hand, but can run the > > compression again.) >=20 > xz is quite slow, but who cares if it's something we do once for the > benefit of many. One thing I did do in my build system is use pxz from > ports. It speeds things up quite a bit on many-core machines with lots > of ram. >=20 Based on the feedback received on this, I think it's clear that xz(1) is the better choice, so I'll make the relevant changes shortly. I was more worried about Windows users needing to go through pain to decompress the images, which seems like a non-issue now. Thanks Brooks and Nikolai for the input. Glen --tKy6e3LXpfmanBFM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTPD9IAAoJELls3eqvi17Q7m0P/RUHD/s6/knz2Bykl+cC6eQY ivfLgZAEN2ShFVp31dSOnE+3E3QJyQ4rorq9oLdYXwPEvqYVDLCDBqYY0ceIHYGy C76S+oSUR0Ox80zVqaW/hM6A37roTHLOa9+VXIf7W+jjSjBpzDmfvqNGMJzuarFi kp6mKdkg1W3J8v5Ivn/9AGwTQ/9acdVjC32KwYqLA9oKmJGE2bnKxd90wlnJ0DUs wVZPU5P0TuX0yDLck/vW25V6BCe8Nr2szKNjkkJzud5lHQRRL/DwpWuYUmX23h6m AtA5srXM4PmWBTutxl4RfNCgQIl/9udrpLcL1Afemm1vnSKI+x21Ut5/inbnp2JH 9rrQYUnpv3Ydoo/6aJu83lRnilp2xXiWFyP3V1Lq0RfHUfAujbw8HLNLSoEx/tGL Nv69DEDLDraVmuYdOJhft2RKuIl3qbwbLhDxPftPp5HgiPF/uMNKC1cNySwmwBmI YOEq4+ftfXtUwRHH2pY7NGIk8ddwJfmBCStIrjxWI8lLMFeYcBJIOCA9raKYBflX C0Fd9WDLW6GbYM+PGHjnLrzpoUae9FIT1ss8HVhY5zS+sNEErzPGrDTa10NYeKuP NMaJPVY02nMBb/kLfYGOz16sZZLogod1xxYPhSpUmGnutkdYbOD5eH529Gr2tmHO tIAt9FWuoJa9u5c3knEw =sPvA -----END PGP SIGNATURE----- --tKy6e3LXpfmanBFM-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 16:52:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4322E387 for ; Wed, 2 Apr 2014 16:52:51 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25CA8AF9 for ; Wed, 2 Apr 2014 16:52:51 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s32GqoYq001280 for ; Wed, 2 Apr 2014 16:52:50 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s32Gqo5M001277 for svn-src-head@freebsd.org; Wed, 2 Apr 2014 16:52:50 GMT (envelope-from bdrewery) Received: (qmail 50635 invoked from network); 2 Apr 2014 11:52:44 -0500 Received: from unknown (HELO roundcube.xk42.net) (10.10.5.5) by sweb.xzibition.com with SMTP; 2 Apr 2014 11:52:44 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 02 Apr 2014 11:52:44 -0500 From: Bryan Drewery To: Nikolai Lifanov , Glen Barber Subject: Re: svn commit: r264027 - in head: release share/man/man7 Organization: FreeBSD In-Reply-To: <533C3992.9030203@mail.lifanov.com> References: <201404012241.s31MfRW6020684@svn.freebsd.org> <20140402154022.GA70867@lor.one-eyed-alien.net> <20140402155134.GG14379@glenbarber.us> <533C32F5.9050809@mail.lifanov.com> <20140402160650.GH14379@glenbarber.us> <533C3992.9030203@mail.lifanov.com> Message-ID: <434d33e39cfb20eec115bb6aac30817d@shatow.net> X-Sender: bdrewery@FreeBSD.org User-Agent: Roundcube Webmail/0.9.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Brooks Davis , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 16:52:51 -0000 On 2014-04-02 11:23, Nikolai Lifanov wrote: > On 04/02/14 12:06, Glen Barber wrote: >> On Wed, Apr 02, 2014 at 11:55:33AM -0400, Nikolai Lifanov wrote: >>> On 04/02/14 11:51, Glen Barber wrote: >>>> On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: >>>>> On Tue, Apr 01, 2014 at 10:41:27PM +0000, Glen Barber wrote: >>>>>> Author: gjb >>>>>> Date: Tue Apr 1 22:41:26 2014 >>>>>> New Revision: 264027 >>>>>> URL: http://svnweb.freebsd.org/changeset/base/264027 >>>>>> >>>>>> Log: >>>>>> Add a new release build variable, WITH_COMPRESSED_IMAGES. >>>>>> >>>>>> When set to a non-empty value, the installation medium is >>>>>> compressed with gzip(1) as part of the 'install' target in >>>>>> the release/ directory. >>>>>> >>>>>> With gzip(1) compression, downloadable image are reduced in >>>>>> size quite significantly. Build test against head@263927 >>>>>> shows the following: >>>>>> >>>>>> bootonly.iso: 64% smaller >>>>>> disc1.iso: 44% smaller >>>>>> memstick.img: 47% smaller >>>>>> mini-memstick.img: 65% smaller >>>>>> dvd1.iso: untested >>>>>> >>>>>> This option is off by default, I would eventually like to >>>>>> turn it on by default, and remove the '-k' flag to gzip(1) >>>>>> so only compressed images are published on FTP. >>>>> >>>>> I'd recommend testing xz compression as well. With UFS images of a >>>>> full >>>>> world the savings vs gzip are significant (more than 30% IIRC, but >>>>> it's >>>>> need more than a year since I checked so I'm a bit unsure of the >>>>> exact >>>>> numbers). >>>>> >>>> >>>> delphij also brought this up. >>>> >>>> I have concerns with xz(1), since there was mention in IRC that >>>> Windows >>>> users may have problems decompressing xz-compressed images. So, >>>> gzip(1) >>>> is used because it seems to be the more commonly-supported archive >>>> mechanisms. >>>> >>>> The benefit of xz(1) over gzip(1) was only 50M-ish. >>>> >>>> -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso >>>> -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 >>>> -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz >>>> -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz >>>> >>>> Glen >>>> >>> >>> How about 7zip (Windows program, not file format)? What would a >>> Windows >>> user use that can decompress gzip and not xz? It was a problem around >>> ~2007, but xz support is no longer rare or exotic. >>> >> >> I don't know, to be honest. I have no Windows machines to test, so >> I can only go by what I am told. >> >> Glen >> > > I just verified it with 7zip for Windows version 9.22. It extracts > .tar.xz archives and decompresses .xz images. > > - Nikolai Lifanov My concern was requiring a *specific* tool to extract the ISO. However I do see that Winzip and Winrar both now support XZ as well. -- Regards, Bryan Drewery From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 16:53:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0D373A4; Wed, 2 Apr 2014 16:53:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84107AFE; Wed, 2 Apr 2014 16:53:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s32Gr8P3071607; Wed, 2 Apr 2014 16:53:08 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s32Gr8nl071605; Wed, 2 Apr 2014 16:53:08 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404021653.s32Gr8nl071605@svn.freebsd.org> From: Glen Barber Date: Wed, 2 Apr 2014 16:53:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264046 - in head: release share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 16:53:08 -0000 Author: gjb Date: Wed Apr 2 16:53:07 2014 New Revision: 264046 URL: http://svnweb.freebsd.org/changeset/base/264046 Log: Use xz(1) instead of gzip(1) to compress release images when WITH_COMPRESSED_IMAGES is used. Requested by: delphij, brooks, Nikolai Lifanov MFC After: 1 week X-MFC-With: r264027,r264028,r264029,r264030 Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile head/share/man/man7/release.7 Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Wed Apr 2 16:33:10 2014 (r264045) +++ head/release/Makefile Wed Apr 2 16:53:07 2014 (r264046) @@ -21,7 +21,7 @@ # NOSRC: if set, do not distribute source tree # NODOC: if set, do not generate release documentation # WITH_DVD: if set, generate dvd1.iso -# WITH_COMPRESSED_IMAGES: if set, compress installation images with gzip(1) +# WITH_COMPRESSED_IMAGES: if set, compress installation images with xz(1) # (uncompressed images are not removed) # TARGET/TARGET_ARCH: architecture of built release # @@ -96,7 +96,7 @@ IMAGES+= mini-memstick.img CLEANFILES= packagesystem *.txz MANIFEST system ${IMAGES} .if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES) . for I in ${IMAGES} -CLEANFILES+= ${I}.gz +CLEANFILES+= ${I}.xz . endfor .endif CLEANDIRS= dist ftp release bootonly dvd @@ -259,7 +259,7 @@ install: .for I in ${IMAGES} cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I} . if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES) - gzip -k ${DESTDIR}/${OSRELEASE}-${I} + xz -k ${DESTDIR}/${OSRELEASE}-${I} . endif .endfor cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256 Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Wed Apr 2 16:33:10 2014 (r264045) +++ head/share/man/man7/release.7 Wed Apr 2 16:53:07 2014 (r264046) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 5, 2014 +.Dd April 2, 2014 .Dt RELEASE 7 .Os .Sh NAME @@ -252,7 +252,7 @@ Set to a non-empty value to include the target. .It Va WITH_COMPRESSED_IMAGES Set to a non-empty value to compress the release images with -.Xr gzip 1 . +.Xr xz 1 . The original .Pq uncompressed images are not removed. From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 17:07:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D2AC89D; Wed, 2 Apr 2014 17:07:02 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.glenbarber.us", Issuer "RapidSSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4601EC21; Wed, 2 Apr 2014 17:07:02 +0000 (UTC) Received: from glenbarber.us (70.15.88.86.res-cmts.sewb.ptd.net [70.15.88.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 83299BDC2; Wed, 2 Apr 2014 17:06:59 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 83299BDC2 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Wed, 2 Apr 2014 13:06:57 -0400 From: Glen Barber To: Bryan Drewery Subject: Re: svn commit: r264027 - in head: release share/man/man7 Message-ID: <20140402170657.GK14379@glenbarber.us> References: <201404012241.s31MfRW6020684@svn.freebsd.org> <20140402154022.GA70867@lor.one-eyed-alien.net> <20140402155134.GG14379@glenbarber.us> <533C32F5.9050809@mail.lifanov.com> <20140402160650.GH14379@glenbarber.us> <533C3992.9030203@mail.lifanov.com> <434d33e39cfb20eec115bb6aac30817d@shatow.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8kI7hWEHMS8Z+7/0" Content-Disposition: inline In-Reply-To: <434d33e39cfb20eec115bb6aac30817d@shatow.net> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Brooks Davis , Nikolai Lifanov , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 17:07:02 -0000 --8kI7hWEHMS8Z+7/0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 02, 2014 at 11:52:44AM -0500, Bryan Drewery wrote: > On 2014-04-02 11:23, Nikolai Lifanov wrote: > >On 04/02/14 12:06, Glen Barber wrote: > >>On Wed, Apr 02, 2014 at 11:55:33AM -0400, Nikolai Lifanov wrote: > >>>On 04/02/14 11:51, Glen Barber wrote: > >>>>On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: > >>>>>On Tue, Apr 01, 2014 at 10:41:27PM +0000, Glen Barber wrote: > >>>>>>Author: gjb > >>>>>>Date: Tue Apr 1 22:41:26 2014 > >>>>>>New Revision: 264027 > >>>>>>URL: http://svnweb.freebsd.org/changeset/base/264027 > >>>>>> > >>>>>>Log: > >>>>>> Add a new release build variable, WITH_COMPRESSED_IMAGES. > >>>>>> > >>>>>> When set to a non-empty value, the installation medium is > >>>>>> compressed with gzip(1) as part of the 'install' target in > >>>>>> the release/ directory. > >>>>>> > >>>>>> With gzip(1) compression, downloadable image are reduced in > >>>>>> size quite significantly. Build test against head@263927 > >>>>>> shows the following: > >>>>>> > >>>>>> bootonly.iso: 64% smaller > >>>>>> disc1.iso: 44% smaller > >>>>>> memstick.img: 47% smaller > >>>>>> mini-memstick.img: 65% smaller > >>>>>> dvd1.iso: untested > >>>>>> > >>>>>> This option is off by default, I would eventually like to > >>>>>> turn it on by default, and remove the '-k' flag to gzip(1) > >>>>>> so only compressed images are published on FTP. > >>>>> > >>>>>I'd recommend testing xz compression as well. With UFS images of > >>>>>a full > >>>>>world the savings vs gzip are significant (more than 30% IIRC, but > >>>>>it's > >>>>>need more than a year since I checked so I'm a bit unsure of the > >>>>>exact > >>>>>numbers). > >>>>> > >>>> > >>>>delphij also brought this up. > >>>> > >>>>I have concerns with xz(1), since there was mention in IRC that > >>>>Windows > >>>>users may have problems decompressing xz-compressed images. So, > >>>>gzip(1) > >>>>is used because it seems to be the more commonly-supported archive > >>>>mechanisms. > >>>> > >>>>The benefit of xz(1) over gzip(1) was only 50M-ish. > >>>> > >>>> -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso > >>>> -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 > >>>> -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz > >>>> -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz > >>>> > >>>>Glen > >>>> > >>> > >>>How about 7zip (Windows program, not file format)? What would a > >>>Windows > >>>user use that can decompress gzip and not xz? It was a problem around > >>>~2007, but xz support is no longer rare or exotic. > >>> > >> > >>I don't know, to be honest. I have no Windows machines to test, so > >>I can only go by what I am told. > >> > >>Glen > >> > > > >I just verified it with 7zip for Windows version 9.22. It extracts > >.tar.xz archives and decompresses .xz images. > > > >- Nikolai Lifanov >=20 > My concern was requiring a *specific* tool to extract the ISO. However I = do > see that Winzip and Winrar both now support XZ as well. >=20 Indeed, this was another thing I wanted to avoid too (and meant to include that in the commit message). Glen --8kI7hWEHMS8Z+7/0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTPEOxAAoJELls3eqvi17QT0YP/iZkceDas5dUBZfmVZe25DOK wT2rPMtfxB2c9AEfY6zwq8In5IlCmGBxGRjnO4ssI6tai7mPAZQNuI4Qyb7UR91V DTqlNY7Tq+AbJ5OZnkc5y43MWTGTn7azTqddGpAuF8Boc/JgWUbJonYkwCcWylnY 7RSBNJXB8zZRAYrsDbBAJaUHpdLsUbuQZfnmKHCgb/koTTLKhp+dma16LdsyfODi M+4+4S5KsCW8TUd+IkjQrkE4PzAV4E1vQw3VcXnQpTTVXTcuN6yelPnNihfeO+BP y4wvsDCjou06qTAY4OT2lQTlF1Uo95Hos4LSUTSbPSPmAQvgyPsEHyydWdPsAUD2 v6Pznyv3yBFtmxCrbGVgQ4qMuHbw6ywv2aCwb2uslN0yBA9RjEmUSpW0I5dUtHWe ZlbMHP5g9PKzNaGdPgeoecpw9DjekrDhr60GR95KyRaZxiYewDCwKTrfLS5aMj8x 3PgFYS11k8ix1cE+uLADNZo0BypPu1F7Inga+VhlO1PbXYNdqD6jlASleVhRVGsx NYelnW3MmCoexrcN+ncJTZpeVkDdsLl3s4Hoqnu0uCSj3W/nEDYeISjkV36KF7S3 R90Va0AkmyMSpvaRbZLGtsyr8ydNq+RMdGWPClChDBbvi/26ng81lG7Xzcjjieai 9SSmdsyp87CfMFSmLDV2 =yml4 -----END PGP SIGNATURE----- --8kI7hWEHMS8Z+7/0-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 17:24:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7722DEBA; Wed, 2 Apr 2014 17:24:51 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 153F4DD3; Wed, 2 Apr 2014 17:24:50 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.8/8.14.8) with ESMTP id s32HOjZT041810; Wed, 2 Apr 2014 20:24:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s32HOjZT041810 Received: (from kostik@localhost) by tom.home (8.14.8/8.14.8/Submit) id s32HOj9K041808; Wed, 2 Apr 2014 20:24:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 2 Apr 2014 20:24:45 +0300 From: Konstantin Belousov To: David Chisnall Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib Message-ID: <20140402172445.GQ21331@kib.kiev.ua> References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140402161845.GP21331@kib.kiev.ua> <76A3F92F-18CB-4A9A-8CF5-3A86035C55BB@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BO2dbX1J/fdLEy+S" Content-Disposition: inline In-Reply-To: <76A3F92F-18CB-4A9A-8CF5-3A86035C55BB@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 17:24:51 -0000 --BO2dbX1J/fdLEy+S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 02, 2014 at 05:30:51PM +0100, David Chisnall wrote: > On 2 Apr 2014, at 17:18, Konstantin Belousov wrote: >=20 > > This is completely wrong. You cannot modify FreeBSD 8.x namespace in > > 11.x HEAD time. >=20 > That was an error, however we are using symbol versioning completely wron= gly in FreeBSD anyway (see the last two DevSummit discussions and the wiki = page). New entries should *always* go in the version 0 namespace (so that = when they're MFCd the changes Just Work?) and only ever be moved out of the= re when they are replaced with versions with different semantics. >=20 Regarding the 'version 0', breaking the ABI once more after the years of efforts by others to keep it usefully stable, best delegated to your private code. That said, 'version 0' by default is exactly opposite of what should be done to fully use the versioning facitily to guarantee the ABI stability. Instead, each batch of symbol addition must introduce a new version. This would allow rtld to fix the known defect in the lazy binding mode, where the application fails eventually instead of startup failure, on undefined symbol. > The weird hybrid we have that tries to conflate symbol versions and OS re= leases manages to get the worst of both worlds. >=20 Yes, there is one guarantee which full use of versioning would provide but our use does not, but your commit' breakage is unrelated. > I've now moved it to the FBSD_1.3 namespace, but I would be more in favou= r of going with the consensus from the last DevSummit and using symbol vers= ioning properly and move them all into the FBSD_1.0 namespace. >=20 Use of 1.3 is equally wrong. You followup 'fix' does not fix the problem. > > Also, the ABI of the libc now depends on the compiler which was used to > > build the library, which is also wrong and ugly. >=20 > No it doesn't. Read the patch. It does, I read it. Now libc depends on the non-standard ABI of non-standard C extension, implemented by only one compiler. I strongly suggest you to back this out, to have it widely discussed and properly reviewed. --BO2dbX1J/fdLEy+S Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJTPEfdAAoJEJDCuSvBvK1BUp0P/inf0b9gDZA7gVfrwPHLdwbW jf0ymg5O6wVpasy8chEtKVlWG+2uOsajHJY7iUXmWZR5kmihUv4TcAlFT+2GvYkF LIBrjVKUS7Jfhx4vyXeVx1J9KD6lZnScB8ZkflEifiEdJ9XgDmmjV1cMUX/WDyM4 +QXGZ0yLrvh/Eg80ksgVRqy258Jb3h+99dwrPlV6bynruw0FlHnLMFNPX6G1gZyG v5Hn2h3CXuoyr/KtUjO6GrDCE2VQv8tVlv/b1tR3bOMaeCM4MuzWx1ddiSXNaXWe k1BvdYycboxn/ExaRhb/0rRXMGzjuQoATWJaKNnOBMIA993stgxQ5IGQKgjRfVcs 5zQP3SgCOlaa0g+Q5XhPJ0XAhZ821DQx3hEtZYagPQbsgeWVPQrpthmnqDGfr0it n6GBhoFJjHz2DoAvxM0udY8nfWFFXadXHsHvm8kl1lBJfZo2dpAmgHoKZT6Lfcpd 7Fte2P1wH5OXCCRCvp/2qX9HMyp/GmwBd57prEbxqVfoiz20ViC6C95p+qHsRlj8 p5uTAEKAVXynRP1RpF42nMLNxCq09Un6P4gkZ1DeUH8njJ+3Na1PN0DSkiIiWW0k mv2OobGjNTHjn1RnlKCKRzssDzbOTNQBvdE7PO2WKsQGSTN4KIItV7PWswYgqqJP qv/9Ct2M9XMsUtsK3F4f =Mm5v -----END PGP SIGNATURE----- --BO2dbX1J/fdLEy+S-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 17:34:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 723D632D; Wed, 2 Apr 2014 17:34:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F251ED3; Wed, 2 Apr 2014 17:34:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s32HYIUe088233; Wed, 2 Apr 2014 17:34:18 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s32HYItk088232; Wed, 2 Apr 2014 17:34:18 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404021734.s32HYItk088232@svn.freebsd.org> From: Ian Lepore Date: Wed, 2 Apr 2014 17:34:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264048 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 17:34:18 -0000 Author: ian Date: Wed Apr 2 17:34:17 2014 New Revision: 264048 URL: http://svnweb.freebsd.org/changeset/base/264048 Log: Fix build breakage. Apparently all ARM configs build kern_et.c, but only a few of them also build kern_clocksource.c. That strikes me as insane, but maybe there's a good reason for it. Until I figure that out, un-break the build by not referencing functions in kern_clocksource if NO_EVENTTIMERS is defined. Modified: head/sys/kern/kern_et.c Modified: head/sys/kern/kern_et.c ============================================================================== --- head/sys/kern/kern_et.c Wed Apr 2 17:10:17 2014 (r264047) +++ head/sys/kern/kern_et.c Wed Apr 2 17:34:17 2014 (r264048) @@ -34,6 +34,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "opt_timer.h" + SLIST_HEAD(et_eventtimers_list, eventtimer); static struct et_eventtimers_list eventtimers = SLIST_HEAD_INITIALIZER(et_eventtimers); @@ -121,7 +123,9 @@ void et_change_frequency(struct eventtimer *et, uint64_t newfreq) { +#ifndef NO_EVENTTIMERS cpu_et_frequency(et, newfreq); +#endif } /* From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 18:07:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9047DB8 for ; Wed, 2 Apr 2014 18:07:44 +0000 (UTC) Received: from nm3-vm0.bullet.mail.bf1.yahoo.com (nm3-vm0.bullet.mail.bf1.yahoo.com [98.139.212.154]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5210A2DB for ; Wed, 2 Apr 2014 18:07:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1396462056; bh=lAxUJQ+SmU2lFL+2Aha0If5822Fv/npSOlW8QPp9j1A=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:Organization:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=sC7ckq57bRRPgF339LTNsgOmhYqbwR+ZSmth4rgK4rocYLWE4vim99kwtgPvJ/lDWuiDJ/Ya+zdY151HF++Wk0MG0ke7j1J6xQufgvGtD51ytB4K+7i7HqUGlyntnT8o7v8Llnc8Bmsf+WvEbnXfqnkfzZSpaNbkccYDS8RYUyEumFNtvsCti9Zw0/8rI0JCslzZQEj5uzKBt2/gd16RlYZ16wflmgOOub06rXX3Sk5bPSUFisnk02rgebAfcTAwIVD1P2kSbpiGo/cVC0Hqi0FNhYXQv/iVZl4O1gbYkhIFLnFyxhlnw90r9L1zZ43uyxoislUycGZEDYe91WZUgw== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=inQw1PDatqZkzL2hrkuplJaG6/kOziwTpFD3p4cuj4M8C/sx7bTDjyPAq0wUIye67O5Lrc+tw7ANvOtN7onIAcH6xEJQOwvKnEdmN4PuVgOiWWKyGVn4jtPq/I1BqEUe90pUc8zUHCiAM/Yf1q27xTZVWUVL16qw4cGxOZzHNrb0HuHrt0KgDaiVbVi4GCD+As2NmakFaPFnUSfRioj/Wrkw0syprmUJZoCGJQyaTUUFi9Cqh1alSpFEV7C0VWJzVEFZzo2Ygx8KDHf4VeUo0yVamD1HV6MFd2kBz1jOaeilHp+JwvK5jBEvADcGwm/1uNC4fus/3O+019dLm83seQ==; Received: from [98.139.214.32] by nm3.bullet.mail.bf1.yahoo.com with NNFMP; 02 Apr 2014 18:07:36 -0000 Received: from [98.139.213.15] by tm15.bullet.mail.bf1.yahoo.com with NNFMP; 02 Apr 2014 18:07:35 -0000 Received: from [127.0.0.1] by smtp115.mail.bf1.yahoo.com with NNFMP; 02 Apr 2014 18:07:35 -0000 X-Yahoo-Newman-Id: 623928.60871.bm@smtp115.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: vez8XcEVM1niAoMt07EEUfSIoSazso76tis7aRBxXPlLqC0 gPnEUPVMWkpgevgrmny3lhFoErVI19gHYPepU0fU03RdR981o6HWDslmZY7m XXHMG66wVceuu85.xvfUEpwBqaS9WwN2ojJ28UvM8TkUjGyIxEBRkCOhTF3r UFiopM3Zgv5xhRckkZ9faZ9BXl78eR.75AbZ2yXT4S7I4p8swi9gAQJV5ppB srS5jT8f5dstUL2KQESTU4NxISH3Vozw9OjnbE1KwVp2b9aZg_G52DuAuNt_ REiWht9fmAnhWc6FhuP5ozv8Or8DSqrUBwDdrOR2TIZanHiU5iNGBThAezgA 6DmII5XcI6z8404cCXM7HWhOQeK4Hiz1gqjqS6j0esxg8EriBzBpWNJcRSc_ ccOKdVdSVnkZj2SapeUbkxKKE5RVm1Pap1XiW4XprroH1sMHriVeXkmMjYhS FAVMpb9H0WPnYyW.ZlVY21pdiJE9zDlUzzCllzhMj_73yh0qihjyOl7oVPH3 JejCdTKL0c5W3KmlDVmYHk_oisHk- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain [63.250.193.228]) by smtp115.mail.bf1.yahoo.com with SMTP; 02 Apr 2014 11:07:35 -0700 PDT Message-ID: <533C51E3.2090900@FreeBSD.org> Date: Wed, 02 Apr 2014 13:07:31 -0500 From: Pedro Giffuni Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Konstantin Belousov , David Chisnall Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140402161845.GP21331@kib.kiev.ua> <76A3F92F-18CB-4A9A-8CF5-3A86035C55BB@FreeBSD.org> <20140402172445.GQ21331@kib.kiev.ua> In-Reply-To: <20140402172445.GQ21331@kib.kiev.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 18:07:44 -0000 El 02/04/2014 12:24, Konstantin Belousov escribió: ... > >>> Also, the ABI of the libc now depends on the compiler which was used to >>> build the library, which is also wrong and ugly. >> >> No it doesn't. Read the patch. > > It does, I read it. > Now libc depends on the non-standard ABI of non-standard C extension, > implemented by only one compiler. > Hmm ... *two* compilers, and both are in the tree :). David will argue that it is not a dependency though. Pedro. From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 18:32:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6DCF9E4; Wed, 2 Apr 2014 18:32:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3A1F8EE; Wed, 2 Apr 2014 18:32:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s32IWR17013397; Wed, 2 Apr 2014 18:32:27 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s32IWRX5013396; Wed, 2 Apr 2014 18:32:27 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404021832.s32IWRX5013396@svn.freebsd.org> From: Ian Lepore Date: Wed, 2 Apr 2014 18:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264049 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 18:32:27 -0000 Author: ian Date: Wed Apr 2 18:32:27 2014 New Revision: 264049 URL: http://svnweb.freebsd.org/changeset/base/264049 Log: Disable the timer and clear any pending bit, then setup the new counter register values, then restart the timer. This prevents a situation where an old event fires just as we're about to load a new value into the timer, when the start routine is called to change the time of the current event. Also re-nest the parens properly for casting the result of converting time and frequency to a count. This doesn't actually change the result of the calcs, but will some day prevent a loss-of-precision warning on the assignment, if that warning gets enabled. Modified: head/sys/arm/arm/mpcore_timer.c Modified: head/sys/arm/arm/mpcore_timer.c ============================================================================== --- head/sys/arm/arm/mpcore_timer.c Wed Apr 2 17:34:17 2014 (r264048) +++ head/sys/arm/arm/mpcore_timer.c Wed Apr 2 18:32:27 2014 (r264049) @@ -173,6 +173,9 @@ arm_tmr_start(struct eventtimer *et, sbi uint32_t load, count; uint32_t ctrl; + tmr_prv_write_4(PRV_TIMER_CTRL, 0); + tmr_prv_write_4(PRV_TIMER_INTR, PRV_TIMER_INTR_EVENT); + ctrl = PRV_TIMER_CTRL_IRQ_ENABLE | PRV_TIMER_CTRL_TIMER_ENABLE; if (period != 0) { @@ -182,14 +185,14 @@ arm_tmr_start(struct eventtimer *et, sbi load = 0; if (first != 0) - count = ((uint32_t)et->et_frequency * first) >> 32; + count = (uint32_t)((et->et_frequency * first) >> 32); else count = load; tmr_prv_write_4(PRV_TIMER_LOAD, load); tmr_prv_write_4(PRV_TIMER_COUNT, count); - tmr_prv_write_4(PRV_TIMER_CTRL, ctrl); + return (0); } From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 18:43:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78518CDB; Wed, 2 Apr 2014 18:43:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 64288A3E; Wed, 2 Apr 2014 18:43:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s32Ihv9a017566; Wed, 2 Apr 2014 18:43:57 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s32IhuXE017563; Wed, 2 Apr 2014 18:43:56 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404021843.s32IhuXE017563@svn.freebsd.org> From: Ian Lepore Date: Wed, 2 Apr 2014 18:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264050 - in head/sys/arm: arm ti/omap4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 18:43:57 -0000 Author: ian Date: Wed Apr 2 18:43:56 2014 New Revision: 264050 URL: http://svnweb.freebsd.org/changeset/base/264050 Log: Added: head/sys/arm/arm/mpcore_timervar.h (contents, props changed) Modified: head/sys/arm/arm/mpcore_timer.c head/sys/arm/ti/omap4/omap4_prcm_clks.c Modified: head/sys/arm/arm/mpcore_timer.c ============================================================================== --- head/sys/arm/arm/mpcore_timer.c Wed Apr 2 18:32:27 2014 (r264049) +++ head/sys/arm/arm/mpcore_timer.c Wed Apr 2 18:43:56 2014 (r264050) @@ -67,6 +67,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + /* Private (per-CPU) timer register map */ #define PRV_TIMER_LOAD 0x0000 #define PRV_TIMER_COUNT 0x0004 @@ -100,7 +102,7 @@ struct arm_tmr_softc { bus_space_tag_t gbl_bst; bus_space_handle_t prv_bsh; bus_space_handle_t gbl_bsh; - uint32_t clkfreq; + uint64_t clkfreq; struct eventtimer et; }; @@ -114,7 +116,7 @@ static struct resource_spec arm_tmr_spec static struct arm_tmr_softc *arm_tmr_sc = NULL; -uint32_t platform_arm_tmr_freq = 0; +static uint64_t platform_arm_tmr_freq = 0; #define tmr_prv_read_4(reg) \ bus_space_read_4(arm_tmr_sc->prv_bst, arm_tmr_sc->prv_bsh, reg) @@ -209,6 +211,7 @@ static int arm_tmr_stop(struct eventtimer *et) { tmr_prv_write_4(PRV_TIMER_CTRL, 0); + tmr_prv_write_4(PRV_TIMER_INTR, PRV_TIMER_INTR_EVENT); return (0); } @@ -278,24 +281,29 @@ arm_tmr_attach(device_t dev) phandle_t node; pcell_t clock; void *ihl; + boolean_t fixed_freq; if (arm_tmr_sc) return (ENXIO); - if (platform_arm_tmr_freq != 0) - sc->clkfreq = platform_arm_tmr_freq; - else { - /* Get the base clock frequency */ - node = ofw_bus_get_node(dev); - if ((OF_getprop(node, "clock-frequency", &clock, - sizeof(clock))) <= 0) { - device_printf(dev, "missing clock-frequency attribute in FDT\n"); - return (ENXIO); + if (platform_arm_tmr_freq == ARM_TMR_FREQUENCY_VARIES) { + fixed_freq = false; + } else { + fixed_freq = true; + if (platform_arm_tmr_freq != 0) { + sc->clkfreq = platform_arm_tmr_freq; + } else { + /* Get the base clock frequency */ + node = ofw_bus_get_node(dev); + if ((OF_getencprop(node, "clock-frequency", &clock, + sizeof(clock))) <= 0) { + device_printf(dev, "missing clock-frequency " + "attribute in FDT\n"); + return (ENXIO); + } } - sc->clkfreq = fdt32_to_cpu(clock); } - if (bus_alloc_resources(dev, arm_tmr_spec, sc->tmr_res)) { device_printf(dev, "could not allocate resources\n"); return (ENXIO); @@ -315,14 +323,6 @@ arm_tmr_attach(device_t dev) tmr_prv_write_4(PRV_TIMER_CTRL, 0x00000000); tmr_gbl_write_4(GBL_TIMER_CTRL, 0x00000000); - /* Setup and enable the global timer to use as the timecounter */ - tmr_gbl_write_4(GBL_TIMER_CTRL, (0x00 << GBL_TIMER_CTR_PRESCALER_SHIFT) | - GBL_TIMER_CTRL_TIMER_ENABLE); - - arm_tmr_timecount.tc_frequency = sc->clkfreq; - tc_init(&arm_tmr_timecount); - - /* Setup and enable the timer */ if (bus_setup_intr(dev, sc->tmr_res[3], INTR_TYPE_CLK, arm_tmr_intr, NULL, sc, &ihl) != 0) { bus_release_resources(dev, arm_tmr_spec, sc->tmr_res); @@ -330,13 +330,35 @@ arm_tmr_attach(device_t dev) return (ENXIO); } + /* + * If the clock is fixed-frequency, setup and enable the global timer to + * use as the timecounter. If it's variable frequency it won't work as + * a timecounter. We also can't use it for DELAY(), so hopefully the + * platform provides its own implementation. If it doesn't, ours will + * get used, but since the frequency isn't set, it will only use the + * bogus loop counter. + */ + if (fixed_freq) { + tmr_gbl_write_4(GBL_TIMER_CTRL, GBL_TIMER_CTRL_TIMER_ENABLE); + arm_tmr_timecount.tc_frequency = sc->clkfreq; + tc_init(&arm_tmr_timecount); + } + + /* + * Setup and register the eventtimer. Most event timers set their min + * and max period values to some value calculated from the clock + * frequency. We might not know yet what our runtime clock frequency + * will be, so we just use some safe values. A max of 2 seconds ensures + * that even if our base clock frequency is 2GHz (meaning a 4GHz CPU), + * we won't overflow our 32-bit timer count register. A min of 20 + * nanoseconds is pretty much completely arbitrary. + */ sc->et.et_name = "MPCore"; sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU; sc->et.et_quality = 1000; - sc->et.et_frequency = sc->clkfreq; - sc->et.et_min_period = (0x00000002LLU << 32) / sc->et.et_frequency; - sc->et.et_max_period = (0xfffffffeLLU << 32) / sc->et.et_frequency; + sc->et.et_min_period = 20 * SBT_1NS; + sc->et.et_max_period = 2 * SBT_1S; sc->et.et_start = arm_tmr_start; sc->et.et_stop = arm_tmr_stop; sc->et.et_priv = sc; @@ -361,6 +383,31 @@ static devclass_t arm_tmr_devclass; DRIVER_MODULE(mp_tmr, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0); +/* + * Handle a change in clock frequency. The mpcore timer runs at half the CPU + * frequency. When the CPU frequency changes due to power-saving or thermal + * managment, the platform-specific code that causes the frequency change calls + * this routine to inform the clock driver, and we in turn inform the event + * timer system, which actually updates the value in et->frequency for us and + * reschedules the current event(s) in a way that's atomic with respect to + * start/stop/intr code that may be running on various CPUs at the time of the + * call. + * + * This routine can also be called by a platform's early init code. If the + * value passed is ARM_TMR_FREQUENCY_VARIES, that will cause the attach() code + * to register as an eventtimer, but not a timecounter. If the value passed in + * is any other non-zero value it is used as the fixed frequency for the timer. + */ +void +arm_tmr_change_frequency(uint64_t newfreq) +{ + + if (arm_tmr_sc == NULL) + platform_arm_tmr_freq = newfreq; + else + et_change_frequency(&arm_tmr_sc->et, newfreq); +} + /** * DELAY - Delay for at least usec microseconds. * @usec: number of microseconds to delay by @@ -380,7 +427,7 @@ arm_tmr_DELAY(int usec) uint32_t first, last; /* Check the timers are setup, if not just use a for loop for the meantime */ - if (arm_tmr_sc == NULL) { + if (arm_tmr_sc == NULL || arm_tmr_timecount.tc_frequency == 0) { for (; usec > 0; usec--) for (counts = 200; counts > 0; counts--) cpufunc_nullop(); /* Prevent gcc from optimizing Added: head/sys/arm/arm/mpcore_timervar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/mpcore_timervar.h Wed Apr 2 18:43:56 2014 (r264050) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2014 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ARM_MPCORE_TIMERVAR_H_ +#define _ARM_MPCORE_TIMERVAR_H_ + +/* + * This value, passed to arm_tmr_change_frequency() any time before the mpcore + * timer device attaches, informs the driver that the mpcore clock frequency can + * change on the fly, and thus can't be used as a timecounter. The hardware can + * still be used as an eventtimer, as long as each frequency change is + * communicated to it with calls to arm_tmr_change_frequency(). + */ +#define ARM_TMR_FREQUENCY_VARIES -1ULL + +/* + * Inform the mpcore timer driver of a new clock frequency. This can be called + * both before and after the mpcore timer driver attaches. + */ +void arm_tmr_change_frequency(uint64_t newfreq); + +#endif Modified: head/sys/arm/ti/omap4/omap4_prcm_clks.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_prcm_clks.c Wed Apr 2 18:32:27 2014 (r264049) +++ head/sys/arm/ti/omap4/omap4_prcm_clks.c Wed Apr 2 18:43:56 2014 (r264050) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1404,7 +1405,7 @@ omap4_prcm_attach(device_t dev) omap4_prcm_sc = sc; ti_cpu_reset = omap4_prcm_reset; omap4_clk_get_arm_fclk_freq(NULL, &freq); - platform_arm_tmr_freq = freq / 2; + arm_tmr_change_frequency(freq / 2); return (0); } From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 18:49:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B667EFE; Wed, 2 Apr 2014 18:49:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC6EEAAD; Wed, 2 Apr 2014 18:49:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s32Ino4R018298; Wed, 2 Apr 2014 18:49:50 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s32Inosi018295; Wed, 2 Apr 2014 18:49:50 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404021849.s32Inosi018295@svn.freebsd.org> From: Ian Lepore Date: Wed, 2 Apr 2014 18:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264051 - in head/sys/arm: arm ti/omap4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 18:49:51 -0000 Author: ian Date: Wed Apr 2 18:49:50 2014 New Revision: 264051 URL: http://svnweb.freebsd.org/changeset/base/264051 Log: Trivial changes/forced-commit to document previous change r264050 whose description was eaten by the dog (or an editor crash or something). Add variable-frequency support to the arm mpcore eventtimer driver. This allows a platform's early init code to tell the mpcore driver that the clock frequency can vary. That causes the mpcore driver to register an eventtimer, but not a timecounter. The platform has to provide a time counter using some other fixed-frequency clock, but can still use the per-cpu goodness of the mpcore hardware for event timers. When the platform support code does something to change the frequency of the CPU clocks (power saving, thermal management) it must tell the mpcore driver code about it using arm_tmr_change_frequency(). Modified: head/sys/arm/arm/mpcore_timer.c head/sys/arm/arm/mpcore_timervar.h head/sys/arm/ti/omap4/omap4_prcm_clks.c Modified: head/sys/arm/arm/mpcore_timer.c ============================================================================== --- head/sys/arm/arm/mpcore_timer.c Wed Apr 2 18:43:56 2014 (r264050) +++ head/sys/arm/arm/mpcore_timer.c Wed Apr 2 18:49:50 2014 (r264051) @@ -30,16 +30,16 @@ */ /** - * The ARM Cortex-A9 core can support a global timer plus a private and - * watchdog timer per core. This driver reserves memory and interrupt - * resources for accessing both timer register sets, these resources are - * stored globally and used to setup the timecount and eventtimer. + * The ARM Cortex-A9 core can support a global timer plus a private and + * watchdog timer per core. This driver reserves memory and interrupt + * resources for accessing both timer register sets, these resources are + * stored globally and used to setup the timecount and eventtimer. * - * The timecount timer uses the global 64-bit counter, whereas the - * per-CPU eventtimer uses the private 32-bit counters. + * The timecount timer uses the global 64-bit counter, whereas the + * per-CPU eventtimer uses the private 32-bit counters. * * - * REF: ARM Cortex-A9 MPCore, Technical Reference Manual (rev. r2p2) + * REF: ARM Cortex-A9 MPCore, Technical Reference Manual (rev. r2p2) */ #include Modified: head/sys/arm/arm/mpcore_timervar.h ============================================================================== --- head/sys/arm/arm/mpcore_timervar.h Wed Apr 2 18:43:56 2014 (r264050) +++ head/sys/arm/arm/mpcore_timervar.h Wed Apr 2 18:49:50 2014 (r264051) @@ -42,6 +42,6 @@ * Inform the mpcore timer driver of a new clock frequency. This can be called * both before and after the mpcore timer driver attaches. */ -void arm_tmr_change_frequency(uint64_t newfreq); +void arm_tmr_change_frequency(uint64_t newfreq); #endif Modified: head/sys/arm/ti/omap4/omap4_prcm_clks.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_prcm_clks.c Wed Apr 2 18:43:56 2014 (r264050) +++ head/sys/arm/ti/omap4/omap4_prcm_clks.c Wed Apr 2 18:49:50 2014 (r264051) @@ -86,7 +86,6 @@ __FBSDID("$FreeBSD$"); * OMAP4 devices are different from the previous OMAP3 devices in that there * is no longer a separate functional and interface clock for each module, * instead there is typically an interface clock that spans many modules. - * */ #define FREQ_96MHZ 96000000 From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 18:58:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C75C019A; Wed, 2 Apr 2014 18:58:13 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "theravensnest.org", Issuer "theravensnest.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F4B5BCB; Wed, 2 Apr 2014 18:58:13 +0000 (UTC) Received: from [192.168.0.100] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s32Iw9qD057812 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 2 Apr 2014 18:58:10 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib From: David Chisnall In-Reply-To: <20140402172445.GQ21331@kib.kiev.ua> Date: Wed, 2 Apr 2014 19:58:03 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <743556FF-1473-4795-8419-80A8A3D22D13@FreeBSD.org> References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140402161845.GP21331@kib.kiev.ua> <76A3F92F-18CB-4A9A-8CF5-3A86035C55BB@FreeBSD.org> <20140402172445.GQ21331@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 18:58:13 -0000 On 2 Apr 2014, at 18:24, Konstantin Belousov = wrote: > It does, I read it. Read the code again. Or even just read the comments. In particular the = blocks_abi.h file contains a detailed description of why the rest of = what you say is wrong. > Now libc depends on the non-standard ABI Not true, the ABI is documented and is as standard as the C++ ABI. We = have code in ports and in the base system that relies on this ABI = already. > of non-standard C extension, The extension is non-standard, however (if you'd read the code, or the = comments in the code you'd already know that) the code in libc does not = require this extension to exist. > implemented by only one compiler. Actually, by two, both of which are in the base system. Well, three if = you count Apple-GCC as different from FSF-GCC. Oh, and a couple of = proprietary compilers. All of which are only required for *callers* of = these functions. libc itself still builds correctly (and is tested = building) with compilers that don't support blocks. If you have helpful comments, then I suggest you try to phrase them in a = less confrontational tone. David From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 19:06:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE9D7B0C; Wed, 2 Apr 2014 19:06:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC080CE8; Wed, 2 Apr 2014 19:06:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s32J6r5M026936; Wed, 2 Apr 2014 19:06:53 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s32J6rmp026935; Wed, 2 Apr 2014 19:06:53 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404021906.s32J6rmp026935@svn.freebsd.org> From: Ian Lepore Date: Wed, 2 Apr 2014 19:06:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264052 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 19:06:53 -0000 Author: ian Date: Wed Apr 2 19:06:53 2014 New Revision: 264052 URL: http://svnweb.freebsd.org/changeset/base/264052 Log: Don't call sdhci_init_slot() until after handling the FDT properties related to detecting card presence. This actually makes no difference now, but will when we get support for gpio-based card detection. Modified: head/sys/arm/freescale/imx/imx_sdhci.c Modified: head/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- head/sys/arm/freescale/imx/imx_sdhci.c Wed Apr 2 18:49:50 2014 (r264051) +++ head/sys/arm/freescale/imx/imx_sdhci.c Wed Apr 2 19:06:53 2014 (r264052) @@ -730,9 +730,6 @@ imx_sdhci_attach(device_t dev) sc->baseclk_hz = imx51_get_clock(IMX51CLK_PERCLK_ROOT); } - sdhci_init_slot(dev, &sc->slot, 0); - callout_init(&sc->r1bfix_callout, true); - /* * If the slot is flagged with the non-removable property, set our flag * to always force the SDHCI_CARD_PRESENT bit on. @@ -752,6 +749,9 @@ imx_sdhci_attach(device_t dev) sc->force_card_present = true; } + callout_init(&sc->r1bfix_callout, true); + sdhci_init_slot(dev, &sc->slot, 0); + bus_generic_probe(dev); bus_generic_attach(dev); From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 19:51:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57C332DA; Wed, 2 Apr 2014 19:51:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42AF2351; Wed, 2 Apr 2014 19:51:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s32JpUgp045478; Wed, 2 Apr 2014 19:51:30 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s32JpTBi045472; Wed, 2 Apr 2014 19:51:29 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404021951.s32JpTBi045472@svn.freebsd.org> From: Ian Lepore Date: Wed, 2 Apr 2014 19:51:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264054 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 19:51:30 -0000 Author: ian Date: Wed Apr 2 19:51:29 2014 New Revision: 264054 URL: http://svnweb.freebsd.org/changeset/base/264054 Log: Change NO_EVENTTIMERS from an arm-specific to an MI option, so that it can be used in MI code. This is intended as a temporary measure to unbreak the build. The real fix is to write event timer drivers for legacy arm hardware, then get rid of this option completely. That's going to take a few days. Modified: head/sys/conf/options head/sys/conf/options.arm Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Apr 2 19:41:48 2014 (r264053) +++ head/sys/conf/options Wed Apr 2 19:51:29 2014 (r264054) @@ -159,6 +159,7 @@ NEW_PCIB opt_global.h NO_ADAPTIVE_MUTEXES opt_adaptive_mutexes.h NO_ADAPTIVE_RWLOCKS NO_ADAPTIVE_SX +NO_EVENTTIMERS opt_timer.h NO_SYSCTL_DESCR opt_global.h NSWBUF_MIN opt_swap.h MBUF_PACKET_ZONE_DISABLE opt_global.h Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Wed Apr 2 19:41:48 2014 (r264053) +++ head/sys/conf/options.arm Wed Apr 2 19:51:29 2014 (r264054) @@ -30,7 +30,6 @@ KERNPHYSADDR opt_global.h KERNVIRTADDR opt_global.h LINUX_BOOT_ABI opt_global.h LOADERRAMADDR opt_global.h -NO_EVENTTIMERS opt_timer.h PHYSADDR opt_global.h SOCDEV_PA opt_global.h SOCDEV_VA opt_global.h From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 20:18:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BFC9B84; Wed, 2 Apr 2014 20:18:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47FC17F4; Wed, 2 Apr 2014 20:18:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s32KIIrv056707; Wed, 2 Apr 2014 20:18:18 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s32KIHp7056703; Wed, 2 Apr 2014 20:18:17 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201404022018.s32KIHp7056703@svn.freebsd.org> From: Peter Grehan Date: Wed, 2 Apr 2014 20:18:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264055 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 20:18:18 -0000 Author: grehan Date: Wed Apr 2 20:18:17 2014 New Revision: 264055 URL: http://svnweb.freebsd.org/changeset/base/264055 Log: Add support for the virtio RNG entropy-source device. Call through to /dev/random synchronously to fill virtio buffers with RNG data. Tested with FreeBSD-CURRENT and Ubuntu guests. Submitted by: Leon Dang Discussed with: markm MFC after: 3 weeks Sponsored by: Nahanni Systems Added: head/usr.sbin/bhyve/pci_virtio_rnd.c (contents, props changed) Modified: head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/bhyve.8 head/usr.sbin/bhyve/virtio.h Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Wed Apr 2 19:51:29 2014 (r264054) +++ head/usr.sbin/bhyve/Makefile Wed Apr 2 20:18:17 2014 (r264055) @@ -26,6 +26,7 @@ SRCS= \ pci_passthru.c \ pci_virtio_block.c \ pci_virtio_net.c \ + pci_virtio_rnd.c \ pci_uart.c \ pm.c \ pmtmr.c \ Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Wed Apr 2 19:51:29 2014 (r264054) +++ head/usr.sbin/bhyve/bhyve.8 Wed Apr 2 20:18:17 2014 (r264055) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 27, 2014 +.Dd April 2, 2014 .Dt BHYVE 8 .Os .Sh NAME @@ -129,6 +129,8 @@ PCI pass-through device. Virtio network interface. .It Li virtio-blk Virtio block storage interface. +.It Li virtio-rnd +Virtio RNG interface. .It Li ahci-cd AHCI controller attached to an ATAPI CD/DVD. .It Li ahci-hd Added: head/usr.sbin/bhyve/pci_virtio_rnd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/pci_virtio_rnd.c Wed Apr 2 20:18:17 2014 (r264055) @@ -0,0 +1,189 @@ +/*- + * Copyright (c) 2014 Nahanni Systems Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * virtio entropy device emulation. + * Randomness is sourced from /dev/random which does not block + * once it has been seeded at bootup. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bhyverun.h" +#include "pci_emul.h" +#include "virtio.h" + +#define VTRND_RINGSZ 64 + + +static int pci_vtrnd_debug; +#define DPRINTF(params) if (pci_vtrnd_debug) printf params +#define WPRINTF(params) printf params + +/* + * Per-device softc + */ +struct pci_vtrnd_softc { + struct virtio_softc vrsc_vs; + struct vqueue_info vrsc_vq; + pthread_mutex_t vrsc_mtx; + uint64_t vrsc_cfg; + int vrsc_fd; +}; + +static void pci_vtrnd_reset(void *); +static void pci_vtrnd_notify(void *, struct vqueue_info *); + +static struct virtio_consts vtrnd_vi_consts = { + "vtrnd", /* our name */ + 1, /* we support 1 virtqueue */ + 0, /* config reg size */ + pci_vtrnd_reset, /* reset */ + pci_vtrnd_notify, /* device-wide qnotify */ + NULL, /* read virtio config */ + NULL, /* write virtio config */ + 0, /* our capabilities */ +}; + + +static void +pci_vtrnd_reset(void *vsc) +{ + struct pci_vtrnd_softc *sc; + + sc = vsc; + + DPRINTF(("vtrnd: device reset requested !\n")); + vi_reset_dev(&sc->vrsc_vs); +} + + +static void +pci_vtrnd_notify(void *vsc, struct vqueue_info *vq) +{ + struct iovec iov; + struct pci_vtrnd_softc *sc; + int len; + + sc = vsc; + + vq_startchains(vq); + + if (sc->vrsc_fd < 0) { + vq_endchains(vq, 0); + return; + } + + while (vq_has_descs(vq)) { + vq_getchain(vq, &iov, 1, NULL); + + len = read(sc->vrsc_fd, iov.iov_base, iov.iov_len); + + DPRINTF(("vtrnd: vtrnd_notify(): %d\r\n", len)); + + /* Catastrophe if unable to read from /dev/random */ + assert(len > 0); + + /* + * Release this chain and handle more + */ + vq_relchain(vq, len); + } + vq_endchains(vq, 1); /* Generate interrupt if appropriate. */ +} + + +static int +pci_vtrnd_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) +{ + struct pci_vtrnd_softc *sc; + int fd; + int len; + uint8_t v; + + /* + * Should always be able to open /dev/random. + */ + fd = open("/dev/random", O_RDONLY | O_NONBLOCK); + + assert(fd >= 0); + + /* + * Check that device is seeded and non-blocking. + */ + len = read(fd, &v, sizeof(v)); + if (len <= 0) { + WPRINTF(("vtrnd: /dev/random not ready, read(): %d", len)); + return (1); + } + + sc = malloc(sizeof(struct pci_vtrnd_softc)); + memset(sc, 0, sizeof(struct pci_vtrnd_softc)); + + vi_softc_linkup(&sc->vrsc_vs, &vtrnd_vi_consts, sc, pi, &sc->vrsc_vq); + sc->vrsc_vs.vs_mtx = &sc->vrsc_mtx; + + sc->vrsc_vq.vq_qsize = VTRND_RINGSZ; + + /* keep /dev/random opened while emulating */ + sc->vrsc_fd = fd; + + /* initialize config space */ + pci_set_cfgdata16(pi, PCIR_DEVICE, VIRTIO_DEV_RANDOM); + pci_set_cfgdata16(pi, PCIR_VENDOR, VIRTIO_VENDOR); + pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_CRYPTO); + pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_ENTROPY); + + if (vi_intr_init(&sc->vrsc_vs, 1, fbsdrun_virtio_msix())) + return (1); + vi_set_io_bar(&sc->vrsc_vs, 0); + + return (0); +} + + +struct pci_devemu pci_de_vrnd = { + .pe_emu = "virtio-rnd", + .pe_init = pci_vtrnd_init, + .pe_barwrite = vi_pci_write, + .pe_barread = vi_pci_read +}; +PCI_EMUL_SET(pci_de_vrnd); Modified: head/usr.sbin/bhyve/virtio.h ============================================================================== --- head/usr.sbin/bhyve/virtio.h Wed Apr 2 19:51:29 2014 (r264054) +++ head/usr.sbin/bhyve/virtio.h Wed Apr 2 20:18:17 2014 (r264055) @@ -209,6 +209,7 @@ struct vring_used { #define VIRTIO_VENDOR 0x1AF4 #define VIRTIO_DEV_NET 0x1000 #define VIRTIO_DEV_BLOCK 0x1001 +#define VIRTIO_DEV_RANDOM 0x1002 /* * PCI config space constants. From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 21:06:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 404D2C26; Wed, 2 Apr 2014 21:06:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F013C2C; Wed, 2 Apr 2014 21:06:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s32L6iSQ076930; Wed, 2 Apr 2014 21:06:44 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s32L6iMn076926; Wed, 2 Apr 2014 21:06:44 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404022106.s32L6iMn076926@svn.freebsd.org> From: Ian Lepore Date: Wed, 2 Apr 2014 21:06:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264056 - in head/sys: arm/freescale/imx boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 21:06:45 -0000 Author: ian Date: Wed Apr 2 21:06:43 2014 New Revision: 264056 URL: http://svnweb.freebsd.org/changeset/base/264056 Log: Switch imx6 to using the mpcore per-cpu event timers, but continue to use the GPT timer, which is fixed-frequency, as a timecounter. Modified: head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/imx/imx6_anatop.c head/sys/arm/freescale/imx/imx6_machdep.c head/sys/boot/fdt/dts/arm/imx6.dtsi Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Wed Apr 2 20:18:17 2014 (r264055) +++ head/sys/arm/freescale/imx/files.imx6 Wed Apr 2 21:06:43 2014 (r264056) @@ -16,6 +16,7 @@ kern/kern_clocksource.c standard arm/arm/gic.c standard arm/arm/pl310.c standard arm/arm/bus_space-v6.c standard +arm/arm/mpcore_timer.c standard arm/freescale/fsl_ocotp.c standard arm/freescale/imx/imx6_anatop.c standard arm/freescale/imx/imx_common.c standard Modified: head/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_anatop.c Wed Apr 2 20:18:17 2014 (r264055) +++ head/sys/arm/freescale/imx/imx6_anatop.c Wed Apr 2 21:06:43 2014 (r264056) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -263,6 +264,8 @@ cpufreq_set_clock(struct imx6_anatop_sof imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_CLR, IMX6_ANALOG_CCM_PLL_ARM_BYPASS); + + arm_tmr_change_frequency(sc->cpu_curhz / 2); } static void Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Wed Apr 2 20:18:17 2014 (r264055) +++ head/sys/arm/freescale/imx/imx6_machdep.c Wed Apr 2 21:06:43 2014 (r264056) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -55,6 +56,8 @@ void initarm_early_init(void) { + /* Inform the MPCore timer driver that its clock is variable. */ + arm_tmr_change_frequency(ARM_TMR_FREQUENCY_VARIES); } void Modified: head/sys/boot/fdt/dts/arm/imx6.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/imx6.dtsi Wed Apr 2 20:18:17 2014 (r264055) +++ head/sys/boot/fdt/dts/arm/imx6.dtsi Wed Apr 2 21:06:43 2014 (r264056) @@ -71,6 +71,14 @@ 0x00a00100 0x00000100>; }; + mp_tmr0@00a00200 { + compatible = "arm,mpcore-timers"; + reg = <0x00a00200 0x100 + 0x00a00600 0x100>; + interrupts = <27 29>; + interrupt-parent = <&gic>; + }; + l2-cache@00a02000 { compatible = "arm,pl310-cache", "arm,pl310"; reg = <0xa02000 0x1000>; From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 21:34:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DD868F5; Wed, 2 Apr 2014 21:34:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20275EDC; Wed, 2 Apr 2014 21:34:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s32LYmc3089020; Wed, 2 Apr 2014 21:34:48 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s32LYm3g089019; Wed, 2 Apr 2014 21:34:48 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404022134.s32LYm3g089019@svn.freebsd.org> From: Ian Lepore Date: Wed, 2 Apr 2014 21:34:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264057 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 21:34:49 -0000 Author: ian Date: Wed Apr 2 21:34:48 2014 New Revision: 264057 URL: http://svnweb.freebsd.org/changeset/base/264057 Log: Rework the cpu frequency management code for imx6. This adds the concept of "operating points," combinations of frequency and voltage at which the cpu is known to work correctly. Some day these should come from FDT data, but for now the table is hard-coded. This also allows tuning the min and max operating frequencies. The min frequency is what the thermal management code will slow down to if the core temperature gets too high. The max frequency is what gets used if the temperature is okay. Normally the max cannot be set higher than the value burned into the ocotp fuses as the chip's rated max, but there is now a new sysctl+tunable cpu_overclock_enable; when set to non-zero it allows raising the frequency above the ocotp value: USE WITH CARE! (At least one of my imx6 boards has a cpu whose ocotp values never got set correctly; they claim a max of 792mhz, but the physical markings on the chip say it's good to 1ghz.) Because all these values affect the entire SoC, there is a new sysctl node, hw.imx6, where all these values live. The values that are currently under dev.imx6_anatop.0 should probably move to hw.imx6 too, because "anatop" doesn't even mean anything to me, let alone to an end user. Modified: head/sys/arm/freescale/imx/imx6_anatop.c Modified: head/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_anatop.c Wed Apr 2 21:06:43 2014 (r264056) +++ head/sys/arm/freescale/imx/imx6_anatop.c Wed Apr 2 21:34:48 2014 (r264057) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -74,6 +75,8 @@ __FBSDID("$FreeBSD$"); #include #include +static SYSCTL_NODE(_hw, OID_AUTO, imx6, CTLFLAG_RW, NULL, "i.MX6 container"); + static struct resource_spec imx6_anatop_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, { SYS_RES_IRQ, 0, RF_ACTIVE }, @@ -85,14 +88,15 @@ static struct resource_spec imx6_anatop_ struct imx6_anatop_softc { device_t dev; struct resource *res[2]; - uint32_t cpu_curhz; uint32_t cpu_curmhz; uint32_t cpu_curmv; - uint32_t cpu_minhz; + uint32_t cpu_minmhz; uint32_t cpu_minmv; - uint32_t cpu_maxhz; + uint32_t cpu_maxmhz; uint32_t cpu_maxmv; - uint32_t refosc_hz; + uint32_t cpu_maxmhz_hw; + boolean_t cpu_overclock_enable; + uint32_t refosc_mhz; void *temp_intrhand; uint32_t temp_high_val; uint32_t temp_high_cnt; @@ -108,16 +112,27 @@ struct imx6_anatop_softc { static struct imx6_anatop_softc *imx6_anatop_sc; /* - * Tables of CPU max frequencies and corresponding voltages. This is indexed by - * the max frequency value (0-3) from the ocotp CFG3 register. + * Table of "operating points". + * These are combinations of frequency and voltage blessed by Freescale. */ -static uint32_t imx6_cpu_maxhz_tab[] = { - 792000000, 852000000, 996000000, 1200000000 -}; -static uint32_t imx6_cpu_millivolt_tab[] = { - 1150, 1225, 1225, 1275 +static struct oppt { + uint32_t mhz; + uint32_t mv; +} imx6_oppt_table[] = { +/* { 396, 925}, XXX: need functional ccm code for this speed */ + { 792, 1150}, + { 852, 1225}, + { 996, 1225}, + {1200, 1275}, }; +/* + * Table of CPU max frequencies. This is used to translate the max frequency + * value (0-3) from the ocotp CFG3 register into a mhz value that can be looked + * up in the operating points table. + */ +static uint32_t imx6_ocotp_mhz_tab[] = {792, 852, 996, 1200}; + #define TZ_ZEROC 2732 /* deci-Kelvin <-> deci-Celcius offset. */ uint32_t @@ -193,49 +208,58 @@ vdd_set(struct imx6_anatop_softc *sc, in imx6_anatop_write_4(IMX6_ANALOG_PMU_REG_CORE, pmureg); DELAY(delay); sc->cpu_curmv = newtarg * 25 + 700; - device_printf(sc->dev, "voltage set to %u\n", sc->cpu_curmv); } static inline uint32_t -cpufreq_hz_from_div(struct imx6_anatop_softc *sc, uint32_t div) +cpufreq_mhz_from_div(struct imx6_anatop_softc *sc, uint32_t div) { - return (sc->refosc_hz * (div / 2)); + return (sc->refosc_mhz * (div / 2)); } static inline uint32_t -cpufreq_hz_to_div(struct imx6_anatop_softc *sc, uint32_t cpu_hz) +cpufreq_mhz_to_div(struct imx6_anatop_softc *sc, uint32_t cpu_mhz) { - return (cpu_hz / (sc->refosc_hz / 2)); + return (cpu_mhz / (sc->refosc_mhz / 2)); } static inline uint32_t -cpufreq_actual_hz(struct imx6_anatop_softc *sc, uint32_t cpu_hz) +cpufreq_actual_mhz(struct imx6_anatop_softc *sc, uint32_t cpu_mhz) +{ + + return (cpufreq_mhz_from_div(sc, cpufreq_mhz_to_div(sc, cpu_mhz))); +} + +static struct oppt * +cpufreq_nearest_oppt(struct imx6_anatop_softc *sc, uint32_t cpu_newmhz) { + int d, diff, i, nearest; - return (cpufreq_hz_from_div(sc, cpufreq_hz_to_div(sc, cpu_hz))); + if (cpu_newmhz > sc->cpu_maxmhz_hw && !sc->cpu_overclock_enable) + cpu_newmhz = sc->cpu_maxmhz_hw; + + diff = INT_MAX; + nearest = 0; + for (i = 0; i < nitems(imx6_oppt_table); ++i) { + d = abs((int)cpu_newmhz - (int)imx6_oppt_table[i].mhz); + if (diff > d) { + diff = d; + nearest = i; + } + } + return (&imx6_oppt_table[nearest]); } static void -cpufreq_set_clock(struct imx6_anatop_softc * sc, uint32_t cpu_newhz) +cpufreq_set_clock(struct imx6_anatop_softc * sc, struct oppt *op) { - uint32_t div, timeout, wrk32; - const uint32_t mindiv = 54; - const uint32_t maxdiv = 108; - - /* - * Clip the requested frequency to the configured max, then clip the - * resulting divisor to the documented min/max values. - */ - cpu_newhz = min(cpu_newhz, sc->cpu_maxhz); - div = cpufreq_hz_to_div(sc, cpu_newhz); - if (div < mindiv) - div = mindiv; - else if (div > maxdiv) - div = maxdiv; - sc->cpu_curhz = cpufreq_hz_from_div(sc, div); - sc->cpu_curmhz = sc->cpu_curhz / 1000000; + uint32_t timeout, wrk32; + + /* If increasing the frequency, we must first increase the voltage. */ + if (op->mhz > sc->cpu_curmhz) { + vdd_set(sc, op->mv); + } /* * I can't find a documented procedure for changing the ARM PLL divisor, @@ -244,7 +268,7 @@ cpufreq_set_clock(struct imx6_anatop_sof * - Set the PLL into bypass mode; cpu should now be running at 24mhz. * - Change the divisor. * - Wait for the LOCK bit to come on; it takes ~50 loop iterations. - * - Turn off bypass mode; cpu should now be running at cpu_newhz. + * - Turn off bypass mode; cpu should now be running at the new speed. */ imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_CLR, IMX6_ANALOG_CCM_PLL_ARM_CLK_SRC_MASK); @@ -253,7 +277,7 @@ cpufreq_set_clock(struct imx6_anatop_sof wrk32 = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM); wrk32 &= ~IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK; - wrk32 |= div; + wrk32 |= cpufreq_mhz_to_div(sc, op->mhz); imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM, wrk32); timeout = 10000; @@ -265,26 +289,113 @@ cpufreq_set_clock(struct imx6_anatop_sof imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_ARM_CLR, IMX6_ANALOG_CCM_PLL_ARM_BYPASS); - arm_tmr_change_frequency(sc->cpu_curhz / 2); + /* If lowering the frequency, it is now safe to lower the voltage. */ + if (op->mhz < sc->cpu_curmhz) + vdd_set(sc, op->mv); + sc->cpu_curmhz = op->mhz; + + /* Tell the mpcore timer that its frequency has changed. */ + arm_tmr_change_frequency( + cpufreq_actual_mhz(sc, sc->cpu_curmhz) * 1000000 / 2); +} + +static int +cpufreq_sysctl_minmhz(SYSCTL_HANDLER_ARGS) +{ + struct imx6_anatop_softc *sc; + struct oppt * op; + uint32_t temp; + int err; + + sc = arg1; + + temp = sc->cpu_minmhz; + err = sysctl_handle_int(oidp, &temp, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + op = cpufreq_nearest_oppt(sc, temp); + if (op->mhz > sc->cpu_maxmhz) + return (ERANGE); + else if (op->mhz == sc->cpu_minmhz) + return (0); + + /* + * Value changed, update softc. If the new min is higher than the + * current speed, raise the current speed to match. + */ + sc->cpu_minmhz = op->mhz; + if (sc->cpu_minmhz > sc->cpu_curmhz) { + cpufreq_set_clock(sc, op); + } + return (err); +} + +static int +cpufreq_sysctl_maxmhz(SYSCTL_HANDLER_ARGS) +{ + struct imx6_anatop_softc *sc; + struct oppt * op; + uint32_t temp; + int err; + + sc = arg1; + + temp = sc->cpu_maxmhz; + err = sysctl_handle_int(oidp, &temp, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + op = cpufreq_nearest_oppt(sc, temp); + if (op->mhz < sc->cpu_minmhz) + return (ERANGE); + else if (op->mhz == sc->cpu_maxmhz) + return (0); + + /* + * Value changed, update softc and hardware. The hardware update is + * unconditional. We always try to run at max speed, so any change of + * the max means we need to change the current speed too, regardless of + * whether it is higher or lower than the old max. + */ + sc->cpu_maxmhz = op->mhz; + cpufreq_set_clock(sc, op); + + return (err); } static void cpufreq_initialize(struct imx6_anatop_softc *sc) { uint32_t cfg3speed; - struct sysctl_ctx_list *ctx; + struct oppt * op; - ctx = device_get_sysctl_ctx(sc->dev); - SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), + SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), OID_AUTO, "cpu_mhz", CTLFLAG_RD, &sc->cpu_curmhz, 0, - "CPU frequency in MHz"); + "CPU frequency"); + + SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), + OID_AUTO, "cpu_minmhz", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + cpufreq_sysctl_minmhz, "IU", "Minimum CPU frequency"); + + SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), + OID_AUTO, "cpu_maxmhz", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + cpufreq_sysctl_maxmhz, "IU", "Maximum CPU frequency"); + + SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), + OID_AUTO, "cpu_maxmhz_hw", CTLFLAG_RD, &sc->cpu_maxmhz_hw, 0, + "Maximum CPU frequency allowed by hardware"); + + SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), + OID_AUTO, "cpu_overclock_enable", CTLFLAG_RW, &sc->cpu_overclock_enable, 0, + "Allow setting CPU frequency higher than cpu_maxmhz_hw"); /* * XXX 24mhz shouldn't be hard-coded, should get this from imx6_ccm * (even though in the real world it will always be 24mhz). Oh wait a * sec, I never wrote imx6_ccm. */ - sc->refosc_hz = 24000000; + sc->refosc_mhz = 24; /* * Get the maximum speed this cpu can be set to. The values in the @@ -294,14 +405,25 @@ cpufreq_initialize(struct imx6_anatop_so * - 2b'10: 996000000Hz; * - 2b'01: 852000000Hz; -- i.MX6Q Only, exclusive with 996MHz. * - 2b'00: 792000000Hz; + * The default hardware max speed can be overridden by a tunable. */ cfg3speed = (fsl_ocotp_read_4(FSL_OCOTP_CFG3) & FSL_OCOTP_CFG3_SPEED_MASK) >> FSL_OCOTP_CFG3_SPEED_SHIFT; + sc->cpu_maxmhz_hw = imx6_ocotp_mhz_tab[cfg3speed]; + sc->cpu_maxmhz = sc->cpu_maxmhz_hw; + + TUNABLE_INT_FETCH("hw.imx6.cpu_overclock_enable", + &sc->cpu_overclock_enable); - sc->cpu_minhz = cpufreq_actual_hz(sc, imx6_cpu_maxhz_tab[0]); - sc->cpu_minmv = imx6_cpu_millivolt_tab[0]; - sc->cpu_maxhz = cpufreq_actual_hz(sc, imx6_cpu_maxhz_tab[cfg3speed]); - sc->cpu_maxmv = imx6_cpu_millivolt_tab[cfg3speed]; + TUNABLE_INT_FETCH("hw.imx6.cpu_minmhz", &sc->cpu_minmhz); + op = cpufreq_nearest_oppt(sc, sc->cpu_minmhz); + sc->cpu_minmhz = op->mhz; + sc->cpu_minmv = op->mv; + + TUNABLE_INT_FETCH("hw.imx6.cpu_maxmhz", &sc->cpu_maxmhz); + op = cpufreq_nearest_oppt(sc, sc->cpu_maxmhz); + sc->cpu_maxmhz = op->mhz; + sc->cpu_maxmv = op->mv; /* * Set the CPU to maximum speed. @@ -311,9 +433,7 @@ cpufreq_initialize(struct imx6_anatop_so * basically assumes that a single core can't overheat before interrupts * are enabled; empirical testing shows that to be a safe assumption. */ - vdd_set(sc, sc->cpu_maxmv); - cpufreq_set_clock(sc, sc->cpu_maxhz); - device_printf(sc->dev, "CPU frequency %uMHz\n", sc->cpu_curmhz); + cpufreq_set_clock(sc, op); } static inline uint32_t @@ -391,9 +511,8 @@ static void tempmon_gofast(struct imx6_anatop_softc *sc) { - if (sc->cpu_curhz < sc->cpu_maxhz) { - vdd_set(sc, sc->cpu_maxmv); - cpufreq_set_clock(sc, sc->cpu_maxhz); + if (sc->cpu_curmhz < sc->cpu_maxmhz) { + cpufreq_set_clock(sc, cpufreq_nearest_oppt(sc, sc->cpu_maxmhz)); } } @@ -401,9 +520,8 @@ static void tempmon_goslow(struct imx6_anatop_softc *sc) { - if (sc->cpu_curhz > sc->cpu_minhz) { - cpufreq_set_clock(sc, sc->cpu_minhz); - vdd_set(sc, sc->cpu_minmv); + if (sc->cpu_curmhz > sc->cpu_minmhz) { + cpufreq_set_clock(sc, cpufreq_nearest_oppt(sc, sc->cpu_minmhz)); } } @@ -542,6 +660,10 @@ imx6_anatop_attach(device_t dev) cpufreq_initialize(sc); initialize_tempmon(sc); + if (bootverbose) { + device_printf(sc->dev, "CPU %uMHz @ %umV\n", sc->cpu_curmhz, + sc->cpu_curmv); + } err = 0; out: @@ -575,7 +697,7 @@ imx6_get_cpu_clock() div = imx6_anatop_read_4(IMX6_ANALOG_CCM_PLL_ARM) & IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK; - return (cpufreq_hz_from_div(imx6_anatop_sc, div)); + return (cpufreq_mhz_from_div(imx6_anatop_sc, div)); } static device_method_t imx6_anatop_methods[] = { From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 23:07:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D606979; Wed, 2 Apr 2014 23:07:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 060E28C8; Wed, 2 Apr 2014 23:07:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s32N7FFm025933; Wed, 2 Apr 2014 23:07:15 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s32N7FpZ025932; Wed, 2 Apr 2014 23:07:15 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404022307.s32N7FpZ025932@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 2 Apr 2014 23:07:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264058 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 23:07:16 -0000 Author: trasz Date: Wed Apr 2 23:07:15 2014 New Revision: 264058 URL: http://svnweb.freebsd.org/changeset/base/264058 Log: Fix build, broken by r264025. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.c Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Wed Apr 2 21:34:48 2014 (r264057) +++ head/sys/dev/iscsi/icl.c Wed Apr 2 23:07:15 2014 (r264058) @@ -1048,12 +1048,12 @@ icl_conn_start(struct icl_conn *ic) minspace = sizeof(struct iscsi_bhs) + ic->ic_max_data_segment_length + ISCSI_HEADER_DIGEST_SIZE + ISCSI_DATA_DIGEST_SIZE + 4; if (sendspace < minspace) { - ICL_WARN("kern.icl.sendspace too low; must be at least %jd", + ICL_WARN("kern.icl.sendspace too low; must be at least %zd", minspace); sendspace = minspace; } if (recvspace < minspace) { - ICL_WARN("kern.icl.recvspace too low; must be at least %jd", + ICL_WARN("kern.icl.recvspace too low; must be at least %zd", minspace); recvspace = minspace; } From owner-svn-src-head@FreeBSD.ORG Wed Apr 2 23:11:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FB08B1C; Wed, 2 Apr 2014 23:11:58 +0000 (UTC) Received: from mail-we0-x236.google.com (mail-we0-x236.google.com [IPv6:2a00:1450:400c:c03::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D3FE95B; Wed, 2 Apr 2014 23:11:57 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id p61so984206wes.13 for ; Wed, 02 Apr 2014 16:11:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=SS/iYsBzKJZH7vy237F7kG1q31XOI5gzUwBzKM32pi8=; b=W4o7JDJs41OMYAGxIjL/pwcobYPIV0QR0mgCO8auAyxmIjD2Kt1PXKg/mrf+k84B/C RfIefUm8Q3SRBuQwT+2qzUlPAQ05J7xGTt2EOOFDM/t03mX8r4kgtOhSzPs/sFTGYH6z LHIs8vhODgw7FBX1J/vQpC6adyzm7YUsVucq1INjcN9eUBxWQ9ZZJVeOyL/0eC2zK81i 03ajdZqjrd+C6WhJ9zGjjhhtzAlCoCt3MYiy8XwF5b8iK/FNCNoCS2brjmpTVXvirz5G GGacwSPVavnyWArtV+lwy7ffPziCw65efSzrDYPqtb9kuhYBVZK68ekc70fgarY+x4c4 D7Fw== X-Received: by 10.180.12.233 with SMTP id b9mr31796580wic.8.1396480315853; Wed, 02 Apr 2014 16:11:55 -0700 (PDT) Received: from strashydlo.home (adbf227.neoplus.adsl.tpnet.pl. [79.184.5.227]) by mx.google.com with ESMTPSA id u1sm7722490eex.31.2014.04.02.16.11.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Apr 2014 16:11:55 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Subject: Re: svn commit: r264025 - head/sys/dev/iscsi Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=iso-8859-2 From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= In-Reply-To: <1396445055.81853.233.camel@revolution.hippie.lan> Date: Thu, 3 Apr 2014 01:11:54 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201404012203.s31M34Gr007384@svn.freebsd.org> <1396445055.81853.233.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2014 23:11:58 -0000 Wiadomo=B6=E6 napisana przez Ian Lepore w dniu 2 kwi 2014, o godz. = 15:24: > On Tue, 2014-04-01 at 22:03 +0000, Edward Tomasz Napierala wrote: >> Author: trasz >> Date: Tue Apr 1 22:03:03 2014 >> New Revision: 264025 >> URL: http://svnweb.freebsd.org/changeset/base/264025 >>=20 >> Log: >> Get rid of the "autoscaling", instead just set socket buffer sizes >> in the usual way. The only thing the old code did was making things >> less predictable. >>=20 >> Sponsored by: The FreeBSD Foundation >>=20 >> Modified: >> head/sys/dev/iscsi/icl.c >>=20 >> Modified: head/sys/dev/iscsi/icl.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/dev/iscsi/icl.c Tue Apr 1 21:54:20 2014 = (r264024) >> +++ head/sys/dev/iscsi/icl.c Tue Apr 1 22:03:03 2014 = (r264025) >> @@ -68,6 +68,14 @@ TUNABLE_INT("kern.icl.partial_receive_le >> SYSCTL_INT(_kern_icl, OID_AUTO, partial_receive_len, CTLFLAG_RW, >> &partial_receive_len, 1 * 1024, "Minimum read size for partially = received " >> "data segment"); >> +static int sendspace =3D 1048576; >> +TUNABLE_INT("kern.icl.sendspace", &sendspace); >> +SYSCTL_INT(_kern_icl, OID_AUTO, sendspace, CTLFLAG_RW, >> + &sendspace, 1048576, "Default send socket buffer size"); >> +static int recvspace =3D 1048576; >> +TUNABLE_INT("kern.icl.recvspace", &recvspace); >> +SYSCTL_INT(_kern_icl, OID_AUTO, recvspace, CTLFLAG_RW, >> + &recvspace, 1048576, "Default receive socket buffer size"); >>=20 >> static uma_zone_t icl_conn_zone; >> static uma_zone_t icl_pdu_zone; >> @@ -1008,7 +1016,7 @@ icl_conn_free(struct icl_conn *ic) >> static int >> icl_conn_start(struct icl_conn *ic) >> { >> - size_t bufsize; >> + size_t minspace; >> struct sockopt opt; >> int error, one =3D 1; >>=20 >> @@ -1029,18 +1037,28 @@ icl_conn_start(struct icl_conn *ic) >> ICL_CONN_UNLOCK(ic); >>=20 >> /* >> - * Use max available sockbuf size for sending. Do it manually >> - * instead of sbreserve(9) to work around resource limits. >> + * For sendspace, this is required because the current code = cannot >> + * send a PDU in pieces; thus, the minimum buffer size is equal >> + * to the maximum PDU size. "+4" is to account for possible = padding. >> * >> - * XXX: This kind of sucks. On one hand, we don't currently = support >> - * sending a part of data segment; we always do it in one = piece, >> - * so we have to make sure it can fit in the socket buffer. >> - * Once I've implemented partial send, we'll get rid of = this >> - * and use autoscaling. >> + * What we should actually do here is to use autoscaling, but = set >> + * some minimal buffer size to "minspace". I don't know a way = to do >> + * that, though. >> */ >> - bufsize =3D (sizeof(struct iscsi_bhs) + >> - ic->ic_max_data_segment_length) * 8; >> - error =3D soreserve(ic->ic_socket, bufsize, bufsize); >> + minspace =3D sizeof(struct iscsi_bhs) + = ic->ic_max_data_segment_length + >> + ISCSI_HEADER_DIGEST_SIZE + ISCSI_DATA_DIGEST_SIZE + 4; >> + if (sendspace < minspace) { >> + ICL_WARN("kern.icl.sendspace too low; must be at least = %jd", >> + minspace); >> + sendspace =3D minspace; >> + } >> + if (recvspace < minspace) { >> + ICL_WARN("kern.icl.recvspace too low; must be at least = %jd", >> + minspace); >> + recvspace =3D minspace; >> + } >> + >=20 > The %jd on these is causing build failures on 32-bit arches due to > size_t being only 32 bits. Right. Should be fixed now, sorry for breakage. From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 00:55:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 444BB825; Thu, 3 Apr 2014 00:55:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30A39104; Thu, 3 Apr 2014 00:55:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s330tIqo070770; Thu, 3 Apr 2014 00:55:18 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s330tGCI070764; Thu, 3 Apr 2014 00:55:16 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404030055.s330tGCI070764@svn.freebsd.org> From: Xin LI Date: Thu, 3 Apr 2014 00:55:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264059 - head/bin/dd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 00:55:18 -0000 Author: delphij Date: Thu Apr 3 00:55:16 2014 New Revision: 264059 URL: http://svnweb.freebsd.org/changeset/base/264059 Log: Implement GNU's extension of 'status' operand. The GNU syntax is borrowed where syntax status=noxfer means no transfer statistics and status=none means no status information at all. This feature is useful because the statistics information can sometimes be annoying, and redirecting stderr to /dev/null would mean error messages also gets silenced. Obtained from: OpenBSD MFC after: 2 weeks Modified: head/bin/dd/args.c head/bin/dd/dd.1 head/bin/dd/dd.c head/bin/dd/dd.h head/bin/dd/extern.h head/bin/dd/misc.c Modified: head/bin/dd/args.c ============================================================================== --- head/bin/dd/args.c Wed Apr 2 23:07:15 2014 (r264058) +++ head/bin/dd/args.c Thu Apr 3 00:55:16 2014 (r264059) @@ -66,6 +66,7 @@ static void f_obs(char *); static void f_of(char *); static void f_seek(char *); static void f_skip(char *); +static void f_status(char *); static uintmax_t get_num(const char *); static off_t get_off_t(const char *); @@ -88,6 +89,7 @@ static const struct arg { { "oseek", f_seek, C_SEEK, C_SEEK }, { "seek", f_seek, C_SEEK, C_SEEK }, { "skip", f_skip, C_SKIP, C_SKIP }, + { "status", f_status, C_STATUS,C_STATUS }, }; static char *oper; @@ -292,6 +294,18 @@ f_skip(char *arg) in.offset = get_off_t(arg); } +static void +f_status(char *arg) +{ + + if (strcmp(arg, "none") == 0) + ddflags |= C_NOINFO; + else if (strcmp(arg, "noxfer") == 0) + ddflags |= C_NOXFER; + else + errx(1, "unknown status %s", arg); +} + static const struct conv { const char *name; u_int set, noset; Modified: head/bin/dd/dd.1 ============================================================================== --- head/bin/dd/dd.1 Wed Apr 2 23:07:15 2014 (r264058) +++ head/bin/dd/dd.1 Thu Apr 3 00:55:16 2014 (r264059) @@ -32,7 +32,7 @@ .\" @(#)dd.1 8.2 (Berkeley) 1/13/94 .\" $FreeBSD$ .\" -.Dd October 1, 2013 +.Dd April 2, 2014 .Dt DD 1 .Os .Sh NAME @@ -156,6 +156,17 @@ Otherwise, input data is read and discar For pipes, the correct number of bytes is read. For all other devices, the correct number of blocks is read without distinguishing between a partial or complete block being read. +.It Cm status Ns = Ns Ar value +Where +.Cm value +is one of the symbols from the following list. +.Bl -tag -width ".Cm noxfer" +.It Cm noxfer +Do not print the transfer statistics as the last line of status output. +.It Cm none +Do not print the status output. +Error messages are shown; informational messages are not. +.El .It Cm conv Ns = Ns Ar value Ns Op , Ns Ar value ... Where .Cm value @@ -410,7 +421,9 @@ utility is expected to be a superset of standard. The .Cm files -operand and the +and +.Cm status +operands and the .Cm ascii , .Cm ebcdic , .Cm ibm , Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Wed Apr 2 23:07:15 2014 (r264058) +++ head/bin/dd/dd.c Thu Apr 3 00:55:16 2014 (r264059) @@ -76,7 +76,7 @@ STAT st; /* statistics */ void (*cfunc)(void); /* conversion function */ uintmax_t cpy_cnt; /* # of blocks to copy */ static off_t pending = 0; /* pending seek if sparse */ -u_int ddflags = 0; /* conversion options */ +u_int64_t ddflags = 0; /* conversion options */ size_t cbsz; /* conversion block size */ uintmax_t files_cnt = 1; /* # of files to copy */ const u_char *ctab; /* conversion table */ Modified: head/bin/dd/dd.h ============================================================================== --- head/bin/dd/dd.h Wed Apr 2 23:07:15 2014 (r264058) +++ head/bin/dd/dd.h Thu Apr 3 00:55:16 2014 (r264059) @@ -68,32 +68,35 @@ typedef struct { } STAT; /* Flags (in ddflags). */ -#define C_ASCII 0x00001 -#define C_BLOCK 0x00002 -#define C_BS 0x00004 -#define C_CBS 0x00008 -#define C_COUNT 0x00010 -#define C_EBCDIC 0x00020 -#define C_FILES 0x00040 -#define C_IBS 0x00080 -#define C_IF 0x00100 -#define C_LCASE 0x00200 -#define C_NOERROR 0x00400 -#define C_NOTRUNC 0x00800 -#define C_OBS 0x01000 -#define C_OF 0x02000 -#define C_OSYNC 0x04000 -#define C_PAREVEN 0x08000 -#define C_PARNONE 0x100000 -#define C_PARODD 0x200000 -#define C_PARSET 0x400000 -#define C_SEEK 0x800000 -#define C_SKIP 0x1000000 -#define C_SPARSE 0x2000000 -#define C_SWAB 0x4000000 -#define C_SYNC 0x8000000 -#define C_UCASE 0x10000000 -#define C_UNBLOCK 0x20000000 -#define C_FILL 0x40000000 +#define C_ASCII 0x000000001 +#define C_BLOCK 0x000000002 +#define C_BS 0x000000004 +#define C_CBS 0x000000008 +#define C_COUNT 0x000000010 +#define C_EBCDIC 0x000000020 +#define C_FILES 0x000000040 +#define C_IBS 0x000000080 +#define C_IF 0x000000100 +#define C_LCASE 0x000000200 +#define C_NOERROR 0x000000400 +#define C_NOTRUNC 0x000000800 +#define C_OBS 0x000001000 +#define C_OF 0x000002000 +#define C_OSYNC 0x000004000 +#define C_PAREVEN 0x000008000 +#define C_PARNONE 0x000100000 +#define C_PARODD 0x000200000 +#define C_PARSET 0x000400000 +#define C_SEEK 0x000800000 +#define C_SKIP 0x001000000 +#define C_SPARSE 0x002000000 +#define C_SWAB 0x004000000 +#define C_SYNC 0x008000000 +#define C_UCASE 0x010000000 +#define C_UNBLOCK 0x020000000 +#define C_FILL 0x040000000 +#define C_STATUS 0x080000000 +#define C_NOXFER 0x100000000 +#define C_NOINFO 0x200000000 #define C_PARITY (C_PAREVEN | C_PARODD | C_PARNONE | C_PARSET) Modified: head/bin/dd/extern.h ============================================================================== --- head/bin/dd/extern.h Wed Apr 2 23:07:15 2014 (r264058) +++ head/bin/dd/extern.h Thu Apr 3 00:55:16 2014 (r264059) @@ -53,7 +53,7 @@ extern STAT st; extern void (*cfunc)(void); extern uintmax_t cpy_cnt; extern size_t cbsz; -extern u_int ddflags; +extern u_int64_t ddflags; extern uintmax_t files_cnt; extern const u_char *ctab; extern const u_char a2e_32V[], a2e_POSIX[]; Modified: head/bin/dd/misc.c ============================================================================== --- head/bin/dd/misc.c Wed Apr 2 23:07:15 2014 (r264058) +++ head/bin/dd/misc.c Thu Apr 3 00:55:16 2014 (r264059) @@ -59,6 +59,9 @@ summary(void) struct timeval tv; double secs; + if (ddflags & C_NOINFO) + return; + (void)gettimeofday(&tv, NULL); secs = tv.tv_sec + tv.tv_usec * 1e-6 - st.start; if (secs < 1e-6) @@ -72,9 +75,11 @@ summary(void) if (st.trunc) (void)fprintf(stderr, "%ju truncated %s\n", st.trunc, (st.trunc == 1) ? "block" : "blocks"); - (void)fprintf(stderr, - "%ju bytes transferred in %.6f secs (%.0f bytes/sec)\n", - st.bytes, secs, st.bytes / secs); + if (!(ddflags & C_NOXFER)) { + (void)fprintf(stderr, + "%ju bytes transferred in %.6f secs (%.0f bytes/sec)\n", + st.bytes, secs, st.bytes / secs); + } need_summary = 0; } From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 01:32:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A8283E6; Thu, 3 Apr 2014 01:32:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D0AD5E5; Thu, 3 Apr 2014 01:32:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s331WiYM087081; Thu, 3 Apr 2014 01:32:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s331Wibv087080; Thu, 3 Apr 2014 01:32:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201404030132.s331Wibv087080@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 3 Apr 2014 01:32:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264062 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 01:32:44 -0000 Author: yongari Date: Thu Apr 3 01:32:43 2014 New Revision: 264062 URL: http://svnweb.freebsd.org/changeset/base/264062 Log: Correct endianness handling in getting station address from EEPROM. While I'm here, remove aue_eeprom_getword() as its only usage is to read station address and make it more readable. This change is inspired by NetBSD. With this change, aue(4) should work on big endian architectures. PR: 188177 Modified: head/sys/dev/usb/net/if_aue.c Modified: head/sys/dev/usb/net/if_aue.c ============================================================================== --- head/sys/dev/usb/net/if_aue.c Thu Apr 3 01:02:14 2014 (r264061) +++ head/sys/dev/usb/net/if_aue.c Thu Apr 3 01:32:43 2014 (r264062) @@ -212,9 +212,7 @@ static uint8_t aue_csr_read_1(struct aue static uint16_t aue_csr_read_2(struct aue_softc *, uint16_t); static void aue_csr_write_1(struct aue_softc *, uint16_t, uint8_t); static void aue_csr_write_2(struct aue_softc *, uint16_t, uint16_t); -static void aue_eeprom_getword(struct aue_softc *, int, uint16_t *); -static void aue_read_eeprom(struct aue_softc *, uint8_t *, uint16_t, - uint16_t); +static uint16_t aue_eeprom_getword(struct aue_softc *, int); static void aue_reset(struct aue_softc *); static void aue_reset_pegasus_II(struct aue_softc *); @@ -376,11 +374,10 @@ aue_csr_write_2(struct aue_softc *sc, ui /* * Read a word of data stored in the EEPROM at address 'addr.' */ -static void -aue_eeprom_getword(struct aue_softc *sc, int addr, uint16_t *dest) +static uint16_t +aue_eeprom_getword(struct aue_softc *sc, int addr) { int i; - uint16_t word = 0; aue_csr_write_1(sc, AUE_EE_REG, addr); aue_csr_write_1(sc, AUE_EE_CTL, AUE_EECTL_READ); @@ -395,22 +392,23 @@ aue_eeprom_getword(struct aue_softc *sc, if (i == AUE_TIMEOUT) device_printf(sc->sc_ue.ue_dev, "EEPROM read timed out\n"); - word = aue_csr_read_2(sc, AUE_EE_DATA); - *dest = word; + return (aue_csr_read_2(sc, AUE_EE_DATA)); } /* - * Read a sequence of words from the EEPROM. + * Read station address(offset 0) from the EEPROM. */ static void -aue_read_eeprom(struct aue_softc *sc, uint8_t *dest, - uint16_t off, uint16_t len) +aue_read_mac(struct aue_softc *sc, uint8_t *eaddr) { - uint16_t *ptr = (uint16_t *)dest; - int i; + int i, offset; + uint16_t word; - for (i = 0; i != len; i++, ptr++) - aue_eeprom_getword(sc, off + i, ptr); + for (i = 0, offset = 0; i < ETHER_ADDR_LEN / 2; i++) { + word = aue_eeprom_getword(sc, offset + i); + eaddr[i * 2] = (uint8_t)word; + eaddr[i * 2 + 1] = (uint8_t)(word >> 8); + } } static int @@ -636,7 +634,7 @@ aue_attach_post(struct usb_ether *ue) aue_reset(sc); /* get station address from the EEPROM */ - aue_read_eeprom(sc, ue->ue_eaddr, 0, 3); + aue_read_mac(sc, ue->ue_eaddr); } /* From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 01:46:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4507DAA7; Thu, 3 Apr 2014 01:46:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31A2A6D7; Thu, 3 Apr 2014 01:46:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s331k4fv092373; Thu, 3 Apr 2014 01:46:04 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s331k4jq092372; Thu, 3 Apr 2014 01:46:04 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201404030146.s331k4jq092372@svn.freebsd.org> From: Hiren Panchasara Date: Thu, 3 Apr 2014 01:46:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264063 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 01:46:04 -0000 Author: hiren Date: Thu Apr 3 01:46:03 2014 New Revision: 264063 URL: http://svnweb.freebsd.org/changeset/base/264063 Log: Improve readability of comments for DELAY_ACK() macro. Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Apr 3 01:32:43 2014 (r264062) +++ head/sys/netinet/tcp_input.c Thu Apr 3 01:46:03 2014 (r264063) @@ -503,13 +503,14 @@ do { \ /* * Indicate whether this ack should be delayed. We can delay the ack if - * - there is no delayed ack timer in progress and - * - our last ack wasn't a 0-sized window. We never want to delay - * the ack that opens up a 0-sized window and - * - delayed acks are enabled or - * - this is a half-synchronized T/TCP connection. - * - the segment size is not larger than the MSS and LRO wasn't used - * for this segment. + * following conditions are met: + * - There is no delayed ack timer in progress. + * - Our last ack wasn't a 0-sized window. We never want to delay + * the ack that opens up a 0-sized window. + * - LRO wasn't used for this segment. We make sure by checking that the + * segment size is not larger than the MSS. + * - Delayed acks are enabled or this is a half-synchronized T/TCP + * connection. */ #define DELAY_ACK(tp, tlen) \ ((!tcp_timer_active(tp, TT_DELACK) && \ From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 04:46:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3B7D4C3; Thu, 3 Apr 2014 04:46:31 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 58AC76A2; Thu, 3 Apr 2014 04:46:30 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 2CDD878277F; Thu, 3 Apr 2014 15:46:21 +1100 (EST) Date: Thu, 3 Apr 2014 15:45:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Xin LI Subject: Re: svn commit: r264059 - head/bin/dd In-Reply-To: <201404030055.s330tGCI070764@svn.freebsd.org> Message-ID: <20140403150420.H959@besplex.bde.org> References: <201404030055.s330tGCI070764@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eojmkOZX c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=pzt8HfeZUOQA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=Q1bsXHo6M8dLFd9smawA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 04:46:31 -0000 On Thu, 3 Apr 2014, Xin LI wrote: > Log: > Implement GNU's extension of 'status' operand. The GNU syntax is > borrowed where syntax status=noxfer means no transfer statistics > and status=none means no status information at all. > > This feature is useful because the statistics information can > sometimes be annoying, and redirecting stderr to /dev/null would > mean error messages also gets silenced. > > Obtained from: OpenBSD > MFC after: 2 weeks > ... > Modified: head/bin/dd/dd.h > ============================================================================== > --- head/bin/dd/dd.h Wed Apr 2 23:07:15 2014 (r264058) > +++ head/bin/dd/dd.h Thu Apr 3 00:55:16 2014 (r264059) > @@ -68,32 +68,35 @@ typedef struct { > } STAT; > > /* Flags (in ddflags). */ > -#define C_ASCII 0x00001 > -#define C_BLOCK 0x00002 The table should have been reformatted separately, or better not at all. > -#define C_BS 0x00004 > -#define C_CBS 0x00008 > -#define C_COUNT 0x00010 > -#define C_EBCDIC 0x00020 > -#define C_FILES 0x00040 > -#define C_IBS 0x00080 > -#define C_IF 0x00100 > -#define C_LCASE 0x00200 > -#define C_NOERROR 0x00400 > -#define C_NOTRUNC 0x00800 > -#define C_OBS 0x01000 > -#define C_OF 0x02000 > -#define C_OSYNC 0x04000 > -#define C_PAREVEN 0x08000 > -#define C_PARNONE 0x100000 The previous formatting was not too good, and obfuscated a bug here. 4 bits are unused. Someone added this bug together with many others in 2004, and I missed it then when I committed a fix for the others. Most of the bugs that I fixed were unsorting of the table by adding to its end. Insertion sort tends to give large churn of the table by changing all the numbers, but for the 2004 fix there wasn't much churn except relative to the unsorted version because all the changes were near the end. > -#define C_PARODD 0x200000 > -#define C_PARSET 0x400000 > -#define C_SEEK 0x800000 > -#define C_SKIP 0x1000000 > -#define C_SPARSE 0x2000000 > -#define C_SWAB 0x4000000 > -#define C_SYNC 0x8000000 > -#define C_UCASE 0x10000000 > -#define C_UNBLOCK 0x20000000 > -#define C_FILL 0x40000000 > +#define C_ASCII 0x000000001 > +#define C_BLOCK 0x000000002 > +#define C_BS 0x000000004 > +#define C_CBS 0x000000008 > +#define C_COUNT 0x000000010 > +#define C_EBCDIC 0x000000020 > +#define C_FILES 0x000000040 > +#define C_IBS 0x000000080 > +#define C_IF 0x000000100 > +#define C_LCASE 0x000000200 > +#define C_NOERROR 0x000000400 > +#define C_NOTRUNC 0x000000800 > +#define C_OBS 0x000001000 > +#define C_OF 0x000002000 > +#define C_OSYNC 0x000004000 > +#define C_PAREVEN 0x000008000 > +#define C_PARNONE 0x000100000 > +#define C_PARODD 0x000200000 > +#define C_PARSET 0x000400000 > +#define C_SEEK 0x000800000 > +#define C_SKIP 0x001000000 > +#define C_SPARSE 0x002000000 > +#define C_SWAB 0x004000000 > +#define C_SYNC 0x008000000 > +#define C_UCASE 0x010000000 > +#define C_UNBLOCK 0x020000000 Unsorting of the table continued from here after I stopped policing the order. > +#define C_FILL 0x040000000 > +#define C_STATUS 0x080000000 The above 2 unsorted entries are old, but reformatting in this commit obfuscates the change. > +#define C_NOXFER 0x100000000 > +#define C_NOINFO 0x200000000 Latest unsorting. The 2 values above UINT_MAX also won't compile with compilers that warn that 'integer constant is too large for "long" type'. Mainly gcc without -std=c99. clang is too incompatible to warn about this even with -std=c89 -Wall. The fix is not to further churn the table by adding a ULL suffix to all entries. > > #define C_PARITY (C_PAREVEN | C_PARODD | C_PARNONE | C_PARSET) > > Modified: head/bin/dd/extern.h > ============================================================================== > --- head/bin/dd/extern.h Wed Apr 2 23:07:15 2014 (r264058) > +++ head/bin/dd/extern.h Thu Apr 3 00:55:16 2014 (r264059) > @@ -53,7 +53,7 @@ extern STAT st; > extern void (*cfunc)(void); > extern uintmax_t cpy_cnt; > extern size_t cbsz; > -extern u_int ddflags; > +extern u_int64_t ddflags; Not needed when the unused bits in the first 32 are used. There are only 30 flags now. > extern uintmax_t files_cnt; > extern const u_char *ctab; > extern const u_char a2e_32V[], a2e_POSIX[]; > Bruce From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 05:48:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52AA5F66; Thu, 3 Apr 2014 05:48:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25B51B53; Thu, 3 Apr 2014 05:48:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s335mSi1093493; Thu, 3 Apr 2014 05:48:28 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s335mSMb093491; Thu, 3 Apr 2014 05:48:28 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201404030548.s335mSMb093491@svn.freebsd.org> From: Greg Lehey Date: Thu, 3 Apr 2014 05:48:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264064 - head/bin/ls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 05:48:29 -0000 Author: grog Date: Thu Apr 3 05:48:28 2014 New Revision: 264064 URL: http://svnweb.freebsd.org/changeset/base/264064 Log: Make -f set -a, as required by the standard. From the original OpenBSD commit message: restore the traditional behavior of -f implying -a; apparently Keith Bostic forgot to restore it when the -f flag was put back on 2nd of September 1989, after being removed on 16th of August as a consequence of issues getting it working over NFS, so deviation from traditional UNIX behavior in all BSDs looks like an historical accident; as a side effect, this change accommodates behavior of this option to IEEE Std 1003.1-2008 (``POSIX.1''). joint work with jmc@ (who found the inaccuracy in our implementation), schwarze@ (who provided a detailed tracking of historical facts) and millert@ Submitted by: Igor Sobrado Discussed with: mckusick Obtained from: OpenBSD project MFC after: 2 weeks Modified: head/bin/ls/ls.1 head/bin/ls/ls.c Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Thu Apr 3 01:46:03 2014 (r264063) +++ head/bin/ls/ls.1 Thu Apr 3 05:48:28 2014 (r264064) @@ -194,6 +194,8 @@ Use time when file status was last chang Directories are listed as plain files (not searched recursively). .It Fl f Output is not sorted. +This option turns on +.Fl a . .It Fl g This option is deprecated and is only available for compatibility with Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Thu Apr 3 01:46:03 2014 (r264063) +++ head/bin/ls/ls.c Thu Apr 3 05:48:28 2014 (r264064) @@ -226,6 +226,9 @@ main(int argc, char *argv[]) f_accesstime = 0; f_statustime = 0; break; + case 'f': + f_nosort = 1; + /* FALLTHROUGH */ case 'a': fts_options |= FTS_SEEDOT; /* FALLTHROUGH */ @@ -300,9 +303,6 @@ main(int argc, char *argv[]) f_listdir = 1; f_recursive = 0; break; - case 'f': - f_nosort = 1; - break; case 'g': /* Compatibility with 4.3BSD. */ break; case 'h': From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 05:48:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A488012D; Thu, 3 Apr 2014 05:48:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90BA0B57; Thu, 3 Apr 2014 05:48:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s335mvYA093566; Thu, 3 Apr 2014 05:48:57 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s335mvKZ093564; Thu, 3 Apr 2014 05:48:57 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201404030548.s335mvKZ093564@svn.freebsd.org> From: Ruslan Bukin Date: Thu, 3 Apr 2014 05:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264065 - in head/sys: arm/arm boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 05:48:57 -0000 Author: br Date: Thu Apr 3 05:48:56 2014 New Revision: 264065 URL: http://svnweb.freebsd.org/changeset/base/264065 Log: - Setup both secure and non-secure timer IRQs. We don't know our ARM security state, so one of them will operate. - Don't set frequency, since it's unpossible in non-secure state. Only rely on DTS clock-frequency value or get clock from timer. Discussed with: ian, cognet Modified: head/sys/arm/arm/generic_timer.c head/sys/boot/fdt/dts/arm/exynos5250.dtsi Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Thu Apr 3 05:48:28 2014 (r264064) +++ head/sys/arm/arm/generic_timer.c Thu Apr 3 05:48:56 2014 (r264065) @@ -73,16 +73,23 @@ __FBSDID("$FreeBSD$"); #define GT_CNTKCTL_PL0VCTEN (1 << 1) /* PL0 CNTVCT and CNTFRQ access */ #define GT_CNTKCTL_PL0PCTEN (1 << 0) /* PL0 CNTPCT and CNTFRQ access */ -#define GT_CNTPSIRQ 29 - struct arm_tmr_softc { - struct resource *irq_res; + struct resource *res[4]; + void *ihl[4]; uint32_t clkfreq; struct eventtimer et; }; static struct arm_tmr_softc *arm_tmr_sc = NULL; +static struct resource_spec timer_spec[] = { + { SYS_RES_IRQ, 0, RF_ACTIVE }, /* Secure */ + { SYS_RES_IRQ, 1, RF_ACTIVE }, /* Non-secure */ + { SYS_RES_IRQ, 2, RF_ACTIVE }, /* Virt */ + { SYS_RES_IRQ, 3, RF_ACTIVE }, /* Hyp */ + { -1, 0 } +}; + static timecounter_get_t arm_tmr_get_timecount; static struct timecounter arm_tmr_timecount = { @@ -261,9 +268,8 @@ arm_tmr_attach(device_t dev) struct arm_tmr_softc *sc; phandle_t node; pcell_t clock; - void *ihl; - int rid; int error; + int i; sc = device_get_softc(dev); if (arm_tmr_sc) @@ -272,29 +278,37 @@ arm_tmr_attach(device_t dev) /* Get the base clock frequency */ node = ofw_bus_get_node(dev); error = OF_getprop(node, "clock-frequency", &clock, sizeof(clock)); - if (error <= 0) { - device_printf(dev, "missing clock-frequency " - "attribute in FDT\n"); + if (error > 0) { + sc->clkfreq = fdt32_to_cpu(clock); + } + + if (sc->clkfreq == 0) { + /* Try to get clock frequency from timer */ + sc->clkfreq = get_freq(); + } + + if (sc->clkfreq == 0) { + device_printf(dev, "No clock frequency specified\n"); return (ENXIO); } - sc->clkfreq = fdt32_to_cpu(clock); - rid = 0; - sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - GT_CNTPSIRQ, GT_CNTPSIRQ, - 1, RF_SHAREABLE | RF_ACTIVE); + if (bus_alloc_resources(dev, timer_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + }; arm_tmr_sc = sc; - /* Setup and enable the timer */ - if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CLK, arm_tmr_intr, - NULL, sc, &ihl) != 0) { - bus_release_resource(dev, SYS_RES_IRQ, rid, sc->irq_res); - device_printf(dev, "Unable to setup the CLK irq handler.\n"); - return (ENXIO); + /* Setup secure and non-secure IRQs handler */ + for (i = 0; i < 2; i++) { + error = bus_setup_intr(dev, sc->res[i], INTR_TYPE_CLK, + arm_tmr_intr, NULL, sc, &sc->ihl[i]); + if (error) { + device_printf(dev, "Unable to alloc int resource.\n"); + return (ENXIO); + } } - set_freq(sc->clkfreq); disable_user_access(); arm_tmr_timecount.tc_frequency = sc->clkfreq; Modified: head/sys/boot/fdt/dts/arm/exynos5250.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/exynos5250.dtsi Thu Apr 3 05:48:28 2014 (r264064) +++ head/sys/boot/fdt/dts/arm/exynos5250.dtsi Thu Apr 3 05:48:56 2014 (r264065) @@ -81,6 +81,8 @@ generic_timer { compatible = "arm,armv7-timer"; clock-frequency = <24000000>; + interrupts = < 29 30 27 26 >; + interrupt-parent = <&GIC>; }; pwm { From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 05:49:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3009426F; Thu, 3 Apr 2014 05:49:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 108C2B5F; Thu, 3 Apr 2014 05:49:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s335nS4O093673; Thu, 3 Apr 2014 05:49:28 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s335nSaO093672; Thu, 3 Apr 2014 05:49:28 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201404030549.s335nSaO093672@svn.freebsd.org> From: Greg Lehey Date: Thu, 3 Apr 2014 05:49:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264066 - head/bin/ls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 05:49:29 -0000 Author: grog Date: Thu Apr 3 05:49:28 2014 New Revision: 264066 URL: http://svnweb.freebsd.org/changeset/base/264066 Log: Add information on standards compliance of many options. MFC after: 2 weeks Modified: head/bin/ls/ls.1 Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Thu Apr 3 05:48:56 2014 (r264065) +++ head/bin/ls/ls.1 Thu Apr 3 05:49:28 2014 (r264066) @@ -87,6 +87,8 @@ and current locale settings) in file nam where .Va xxx is the numeric value of the character in octal. +This option is not defined in +.St -p1003.1-2001 . .It Fl C Force multi-column output; this is the default when output is to a terminal. .It Fl D Ar format @@ -104,6 +106,8 @@ different number of columns in the outpu This option overrides the .Fl T option. +This option is not defined in +.St -p1003.1-2001 . .It Fl F Display a slash .Pq Ql / @@ -132,6 +136,8 @@ in the environment. (See below.) This functionality can be compiled out by removing the definition of .Ev COLORLS . +This option is not defined in +.St -p1003.1-2001 . .It Fl H Symbolic links on the command line are followed. This option is assumed if @@ -144,6 +150,8 @@ options are specified. Prevent .Fl A from being automatically set for the super-user. +This option is not defined in +.St -p1003.1-2001 . .It Fl L If argument is a symbolic link, list the file or directory the link references rather than the link itself. @@ -171,13 +179,21 @@ month, day, hour, minute, second, and ye The .Fl D option gives even more control over the output format. +This option is not defined in +.St -p1003.1-2001 . .It Fl U Use time when file was created for sorting or printing. +This option is not defined in +.St -p1003.1-2001 . .It Fl W Display whiteouts when scanning directories. +This option is not defined in +.St -p1003.1-2001 . .It Fl Z Display each file's MAC label; see .Xr maclabel 7 . +This option is not defined in +.St -p1003.1-2001 . .It Fl a Include directory entries whose names begin with a dot @@ -188,6 +204,8 @@ As but use .Tn C escape codes whenever possible. +This option is not defined in +.St -p1003.1-2001 . .It Fl c Use time when file status was last changed for sorting or printing. .It Fl d @@ -196,19 +214,38 @@ Directories are listed as plain files (n Output is not sorted. This option turns on .Fl a . +It also negates the effect of the +.Fl r , +.Fl S +and +.Fl t +options. +As allowd by +.St -p1003.1-2001 , +this option has no effect on the +.Fl d , +.Fl l , +.Fl R +and +.Fl s +options. .It Fl g -This option is deprecated and is only available for compatibility -with -.Bx 4.3 ; -it was used to display the group name in the long +This option has no effect. +It is only available for compatibility with +.Bx 4.3 , +where it was used to display the group name in the long .Pq Fl l format output. +This option is incompatible with +.St -p1003.1-2001 . .It Fl h When used with the .Fl l option, use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce the number of digits to four or fewer using base 2 for sizes. +This option is not defined in +.St -p1003.1-2001 . .It Fl i For each file, print the file's file serial number (inode number). .It Fl k @@ -217,6 +254,8 @@ This has the same effect as setting envi to 1024, except that it also nullifies any .Fl h options to its left. +This option is not defined in +.St -p1003.1-2001 . .It Fl l (The lowercase letter .Dq ell . ) @@ -234,6 +273,8 @@ output. Include the file flags in a long .Pq Fl l output. +This option is incompatible with +.St -p1003.1-2001 . See .Xr chflags 1 for a list of file flags and their meanings. @@ -293,6 +334,8 @@ or printing Force raw printing of non-printable characters. This is the default when output is not to a terminal. +This option is not defined in +.St -p1003.1-2001 . .It Fl x The same as .Fl C , @@ -307,6 +350,8 @@ This has the same effect as setting See the description of the .Fl t option for more details. +This option is not defined in +.St -p1003.1-2001 . .It Fl 1 (The numeric digit .Dq one . ) @@ -323,6 +368,8 @@ non-monetary separator returned by typically a comma or period. If no locale is set, or the locale does not have a non-monetary separator, this option has no effect. +This option is not defined in +.St -p1003.1-2001 . .El .Pp The @@ -762,13 +809,19 @@ specification. .Xr getfmac 8 .Sh STANDARDS With the exception of options -.Fl I , g , n +.Fl g , n and .Fl o , the .Nm utility conforms to .St -p1003.1-2001 . +The options +.Fl B , D , G , I , T , U , W , Z , b , h , k , w , y +and +.Fl , +are compatible extensions not defined in +.St -p1003.1-2001 . .Pp The ACL support is compatible with .Tn IEEE From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 06:32:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE3A8946; Thu, 3 Apr 2014 06:32:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB8E1EE2; Thu, 3 Apr 2014 06:32:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s336W3Tx013331; Thu, 3 Apr 2014 06:32:03 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s336W3pU013327; Thu, 3 Apr 2014 06:32:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404030632.s336W3pU013327@svn.freebsd.org> From: Xin LI Date: Thu, 3 Apr 2014 06:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264067 - head/bin/dd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 06:32:04 -0000 Author: delphij Date: Thu Apr 3 06:32:02 2014 New Revision: 264067 URL: http://svnweb.freebsd.org/changeset/base/264067 Log: Make C_* contants fit in 32 bits again by using 4 unused bits. Noticed by: bde Modified: head/bin/dd/dd.c head/bin/dd/dd.h head/bin/dd/extern.h Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Thu Apr 3 05:49:28 2014 (r264066) +++ head/bin/dd/dd.c Thu Apr 3 06:32:02 2014 (r264067) @@ -76,7 +76,7 @@ STAT st; /* statistics */ void (*cfunc)(void); /* conversion function */ uintmax_t cpy_cnt; /* # of blocks to copy */ static off_t pending = 0; /* pending seek if sparse */ -u_int64_t ddflags = 0; /* conversion options */ +u_int ddflags = 0; /* conversion options */ size_t cbsz; /* conversion block size */ uintmax_t files_cnt = 1; /* # of files to copy */ const u_char *ctab; /* conversion table */ Modified: head/bin/dd/dd.h ============================================================================== --- head/bin/dd/dd.h Thu Apr 3 05:49:28 2014 (r264066) +++ head/bin/dd/dd.h Thu Apr 3 06:32:02 2014 (r264067) @@ -68,35 +68,35 @@ typedef struct { } STAT; /* Flags (in ddflags). */ -#define C_ASCII 0x000000001 -#define C_BLOCK 0x000000002 -#define C_BS 0x000000004 -#define C_CBS 0x000000008 -#define C_COUNT 0x000000010 -#define C_EBCDIC 0x000000020 -#define C_FILES 0x000000040 -#define C_IBS 0x000000080 -#define C_IF 0x000000100 -#define C_LCASE 0x000000200 -#define C_NOERROR 0x000000400 -#define C_NOTRUNC 0x000000800 -#define C_OBS 0x000001000 -#define C_OF 0x000002000 -#define C_OSYNC 0x000004000 -#define C_PAREVEN 0x000008000 -#define C_PARNONE 0x000100000 -#define C_PARODD 0x000200000 -#define C_PARSET 0x000400000 -#define C_SEEK 0x000800000 -#define C_SKIP 0x001000000 -#define C_SPARSE 0x002000000 -#define C_SWAB 0x004000000 -#define C_SYNC 0x008000000 -#define C_UCASE 0x010000000 -#define C_UNBLOCK 0x020000000 -#define C_FILL 0x040000000 -#define C_STATUS 0x080000000 -#define C_NOXFER 0x100000000 -#define C_NOINFO 0x200000000 +#define C_ASCII 0x00000001 +#define C_BLOCK 0x00000002 +#define C_BS 0x00000004 +#define C_CBS 0x00000008 +#define C_COUNT 0x00000010 +#define C_EBCDIC 0x00000020 +#define C_FILES 0x00000040 +#define C_IBS 0x00000080 +#define C_IF 0x00000100 +#define C_LCASE 0x00000200 +#define C_NOERROR 0x00000400 +#define C_NOTRUNC 0x00000800 +#define C_OBS 0x00001000 +#define C_OF 0x00002000 +#define C_OSYNC 0x00004000 +#define C_PAREVEN 0x00008000 +#define C_PARNONE 0x00010000 +#define C_PARODD 0x00020000 +#define C_PARSET 0x00040000 +#define C_SEEK 0x00080000 +#define C_SKIP 0x00100000 +#define C_SPARSE 0x00200000 +#define C_SWAB 0x00400000 +#define C_SYNC 0x00800000 +#define C_UCASE 0x01000000 +#define C_UNBLOCK 0x02000000 +#define C_FILL 0x04000000 +#define C_STATUS 0x08000000 +#define C_NOXFER 0x10000000 +#define C_NOINFO 0x20000000 #define C_PARITY (C_PAREVEN | C_PARODD | C_PARNONE | C_PARSET) Modified: head/bin/dd/extern.h ============================================================================== --- head/bin/dd/extern.h Thu Apr 3 05:49:28 2014 (r264066) +++ head/bin/dd/extern.h Thu Apr 3 06:32:02 2014 (r264067) @@ -53,7 +53,7 @@ extern STAT st; extern void (*cfunc)(void); extern uintmax_t cpy_cnt; extern size_t cbsz; -extern u_int64_t ddflags; +extern u_int ddflags; extern uintmax_t files_cnt; extern const u_char *ctab; extern const u_char a2e_32V[], a2e_POSIX[]; From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 06:43:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A689EFB; Thu, 3 Apr 2014 06:43:24 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 53A82FCE; Thu, 3 Apr 2014 06:43:24 +0000 (UTC) Received: from delphij-macbook.local (c-24-5-244-32.hsd1.ca.comcast.net [24.5.244.32]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 1F94513202; Wed, 2 Apr 2014 23:43:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1396507403; bh=BjHsV2hg7X4uXwrGtsrE270Qn5cKQkRBftQgl+OjO9w=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=08vyXA2qcNleZpwRNzg+e1uulNSDghNFX9cA9ROgsN+vPx9Qiksi15lGE8OM6T6JM VwsbYozJLsxymvBMycLwLP+uqQQHIf/H0H8ijTobEJ8kOqvdHL7d6D45mkLbApajC9 Mgnroc0goT1szbLuH6yIU+on9iKLwIF5rY09bEhE= Message-ID: <533D0307.6090509@delphij.net> Date: Wed, 02 Apr 2014 23:43:19 -0700 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: Bruce Evans , Xin LI Subject: Re: svn commit: r264059 - head/bin/dd References: <201404030055.s330tGCI070764@svn.freebsd.org> <20140403150420.H959@besplex.bde.org> In-Reply-To: <20140403150420.H959@besplex.bde.org> Content-Type: multipart/mixed; boundary="------------070702070804010603030108" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 06:43:24 -0000 This is a multi-part message in MIME format. --------------070702070804010603030108 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 4/2/14, 9:45 PM, Bruce Evans wrote: > On Thu, 3 Apr 2014, Xin LI wrote: > >> Log: Implement GNU's extension of 'status' operand. The GNU >> syntax is borrowed where syntax status=noxfer means no transfer >> statistics and status=none means no status information at all. >> >> This feature is useful because the statistics information can >> sometimes be annoying, and redirecting stderr to /dev/null would >> mean error messages also gets silenced. >> >> Obtained from: OpenBSD MFC after: 2 weeks ... Modified: >> head/bin/dd/dd.h >> ============================================================================== >> >> >> - --- head/bin/dd/dd.h Wed Apr 2 23:07:15 2014 (r264058) >> +++ head/bin/dd/dd.h Thu Apr 3 00:55:16 2014 (r264059) @@ >> -68,32 +68,35 @@ typedef struct { } STAT; >> >> /* Flags (in ddflags). */ -#define C_ASCII 0x00001 >> -#define C_BLOCK 0x00002 > > The table should have been reformatted separately, or better not at > all. > >> -#define C_BS 0x00004 -#define C_CBS 0x00008 >> -#define C_COUNT 0x00010 -#define C_EBCDIC >> 0x00020 -#define C_FILES 0x00040 -#define C_IBS >> 0x00080 -#define C_IF 0x00100 -#define C_LCASE >> 0x00200 -#define C_NOERROR 0x00400 -#define C_NOTRUNC >> 0x00800 -#define C_OBS 0x01000 -#define C_OF >> 0x02000 -#define C_OSYNC 0x04000 -#define C_PAREVEN >> 0x08000 -#define C_PARNONE 0x100000 > > The previous formatting was not too good, and obfuscated a bug > here. 4 bits are unused. Someone added this bug together with many > others in 2004, and I missed it then when I committed a fix for the > others. Most of the bugs that I fixed were unsorting of the table > by adding to its end. Insertion sort tends to give large churn of > the table by changing all the numbers, but for the 2004 fix there > wasn't much churn except relative to the unsorted version because > all the changes were near the end. > >> -#define C_PARODD 0x200000 -#define C_PARSET >> 0x400000 -#define C_SEEK 0x800000 -#define C_SKIP >> 0x1000000 -#define C_SPARSE 0x2000000 -#define C_SWAB >> 0x4000000 -#define C_SYNC 0x8000000 -#define C_UCASE >> 0x10000000 -#define C_UNBLOCK 0x20000000 -#define C_FILL >> 0x40000000 +#define C_ASCII 0x000000001 +#define >> C_BLOCK 0x000000002 +#define C_BS 0x000000004 >> +#define C_CBS 0x000000008 +#define C_COUNT >> 0x000000010 +#define C_EBCDIC 0x000000020 +#define >> C_FILES 0x000000040 +#define C_IBS 0x000000080 >> +#define C_IF 0x000000100 +#define C_LCASE >> 0x000000200 +#define C_NOERROR 0x000000400 +#define >> C_NOTRUNC 0x000000800 +#define C_OBS 0x000001000 >> +#define C_OF 0x000002000 +#define C_OSYNC >> 0x000004000 +#define C_PAREVEN 0x000008000 +#define >> C_PARNONE 0x000100000 +#define C_PARODD 0x000200000 >> +#define C_PARSET 0x000400000 +#define C_SEEK >> 0x000800000 +#define C_SKIP 0x001000000 +#define >> C_SPARSE 0x002000000 +#define C_SWAB 0x004000000 >> +#define C_SYNC 0x008000000 +#define C_UCASE >> 0x010000000 +#define C_UNBLOCK 0x020000000 > > Unsorting of the table continued from here after I stopped policing > the order. > >> +#define C_FILL 0x040000000 +#define C_STATUS >> 0x080000000 > > The above 2 unsorted entries are old, but reformatting in this > commit obfuscates the change. > >> +#define C_NOXFER 0x100000000 +#define C_NOINFO >> 0x200000000 > > Latest unsorting. Will it be an improvement if we have the attached change committed? Basically it redo the sort and use 1 <<'s instead of hardcoded heximal numbers. > > The 2 values above UINT_MAX also won't compile with compilers that > warn that 'integer constant is too large for "long" type'. Mainly > gcc without > -std=c99. clang is too incompatible to warn about this even with > -std=c89 -Wall. The fix is not to further churn the table by > adding a ULL suffix to all entries. Cheers, -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJTPQMHAAoJEJW2GBstM+ns1AAP+wY2LrODW+ouu1crQ8fyxf+g Naql1NNZyaCLMnhNHGlA0PI1F/EaP/F6RTX12z+yQ/d1xuS4B7BnffXZSxsWIT5y Hl82p4oq+ZuzuWd0dJ6yRqh98fASOflwogvAdV1SzU5ElaKXX+jUVDcKXFeB3jkz o/Hv6MQg+LUl0th2ZG5Khox25eQyX9q6whFNRPm8KqnYPP0HXBqPtJMLFAh/eMp6 bmiWbWrQtmLgOHXepa/PLrTmjbYJdef28EL6JWINa7hh2UyndihM5xAI3y2L6dTK WBBVNhH1dLIgDjme4t7j3tRDZuPaYxyI5ysTuAuDj4ycAzDI+e81E2iSNlfXJskW i8iTOYQl+C3gg1JWLkPaL4B+RupJXEIDUgkLw2f/cpZPRKz1tfteGKWu26rlPTzA 6aoKaXyy4HL9tKY0I3wrIEcAtg7p95PKuidKWgWYE0U+OhPAOPDCXFC1t74KKR3d sYDhKvELuhLv1jDT3mnUntKj0LXgLXwSiJDNoqXsa6b0YC6QX+b2uyGpzzxFxoHy 3GPk9Oq/gPF4t8n2m7N7jB6GAjL2IMQBvumrXgUFtL6noGbaesMr/02GlLtsa+cW fDYH5w1xfdZ4AWPmqiIjWJIoBK6ToQueF5/ggjF9/7xZ2yXVJbIarbmygs2K99TQ HvuWoapWq04vD4f3g303 =R4Fd -----END PGP SIGNATURE----- --------------070702070804010603030108 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="dd.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dd.diff" Index: bin/dd/dd.h =================================================================== --- bin/dd/dd.h (revision 264067) +++ bin/dd/dd.h (working copy) @@ -68,35 +68,35 @@ typedef struct { } STAT; /* Flags (in ddflags). */ -#define C_ASCII 0x00000001 -#define C_BLOCK 0x00000002 -#define C_BS 0x00000004 -#define C_CBS 0x00000008 -#define C_COUNT 0x00000010 -#define C_EBCDIC 0x00000020 -#define C_FILES 0x00000040 -#define C_IBS 0x00000080 -#define C_IF 0x00000100 -#define C_LCASE 0x00000200 -#define C_NOERROR 0x00000400 -#define C_NOTRUNC 0x00000800 -#define C_OBS 0x00001000 -#define C_OF 0x00002000 -#define C_OSYNC 0x00004000 -#define C_PAREVEN 0x00008000 -#define C_PARNONE 0x00010000 -#define C_PARODD 0x00020000 -#define C_PARSET 0x00040000 -#define C_SEEK 0x00080000 -#define C_SKIP 0x00100000 -#define C_SPARSE 0x00200000 -#define C_SWAB 0x00400000 -#define C_SYNC 0x00800000 -#define C_UCASE 0x01000000 -#define C_UNBLOCK 0x02000000 -#define C_FILL 0x04000000 -#define C_STATUS 0x08000000 -#define C_NOXFER 0x10000000 -#define C_NOINFO 0x20000000 +#define C_ASCII (1 << 0) +#define C_BLOCK (1 << 1) +#define C_BS (1 << 2) +#define C_CBS (1 << 3) +#define C_COUNT (1 << 4) +#define C_EBCDIC (1 << 5) +#define C_FILES (1 << 6) +#define C_FILL (1 << 7) +#define C_IBS (1 << 8) +#define C_IF (1 << 9) +#define C_LCASE (1 << 10) +#define C_NOERROR (1 << 11) +#define C_NOINFO (1 << 12) +#define C_NOTRUNC (1 << 13) +#define C_NOXFER (1 << 14) +#define C_OBS (1 << 15) +#define C_OF (1 << 16) +#define C_OSYNC (1 << 17) +#define C_PAREVEN (1 << 18) +#define C_PARNONE (1 << 19) +#define C_PARODD (1 << 20) +#define C_PARSET (1 << 21) +#define C_SEEK (1 << 22) +#define C_SKIP (1 << 23) +#define C_SPARSE (1 << 24) +#define C_STATUS (1 << 25) +#define C_SWAB (1 << 26) +#define C_SYNC (1 << 27) +#define C_UCASE (1 << 28) +#define C_UNBLOCK (1 << 29) #define C_PARITY (C_PAREVEN | C_PARODD | C_PARNONE | C_PARSET) --------------070702070804010603030108-- From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 07:28:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BFCA646A; Thu, 3 Apr 2014 07:28:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94BF9376; Thu, 3 Apr 2014 07:28:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s337Sauj034455; Thu, 3 Apr 2014 07:28:36 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s337Saqn034454; Thu, 3 Apr 2014 07:28:36 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201404030728.s337Saqn034454@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 3 Apr 2014 07:28:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264068 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 07:28:36 -0000 Author: bapt Date: Thu Apr 3 07:28:36 2014 New Revision: 264068 URL: http://svnweb.freebsd.org/changeset/base/264068 Log: Some xdev fixes: - if TARGET_ARCH is not defined and XDEV_ARCH is defined then early define TARGET_ARCH to the valud of XDEV_ARCH: This allow the xdev-build target to be able to correctly chose the compiler it needs to build - Allow overwriting XDTP to allow a user to not chose where the xdev env will live in - Fix build for gcc only xdev (like ia64) by providing the proper -B to the toolchain and not relying on gcc being installed already in base - Fix TOOLS_PREFIX so the generated toolchain has the right default sysroot when installed intead of getting the DESTDIR one - Fix supporting DESTDIR - Also overwrite CXX (needed for cross building c++ libraries with clang) and CPP (needed to cross build some libraries when gcc is the target default compiler but gcc is not installed on the building host) Discussed with: imp Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Apr 3 06:32:02 2014 (r264067) +++ head/Makefile.inc1 Thu Apr 3 07:28:36 2014 (r264068) @@ -1359,6 +1359,9 @@ kernel-tools: .MAKE # # cross-tools: Build cross-building tools # +.if !defined(TARGET_ARCH) && defined(XDEV_ARCH) +TARGET_ARCH= ${XDEV_ARCH} +.endif .if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 800035 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" _btxld= usr.sbin/btxld @@ -1872,15 +1875,17 @@ NOFUN=-DNO_FSCHG MK_HTML=no MK_INFO=no - CPUTYPE=${XDEV_CPUTYPE} XDDIR=${XDEV_ARCH}-freebsd -XDTP=usr/${XDDIR} +XDTP?=usr/${XDDIR} CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \ INSTALL="sh ${.CURDIR}/tools/install.sh" CDENV= ${CDBENV} \ _SHLIBDIRPREFIX=${XDDESTDIR} \ - TOOLS_PREFIX=${XDDESTDIR} + TOOLS_PREFIX=${XDTP} CD2CFLAGS=-isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib \ - -B${XDDESTDIR}/usr/lib -CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" \ + --sysroot=${XDDESTDIR}/ -B${XDDESTDIR}/usr/libexec \ + -B${XDDESTDIR}/usr/bin -B${XDDESTDIR}/usr/lib +CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CFLAGS}" \ + CPP="${CPP} ${CD2CFLAGS}" \ MACHINE=${XDEV} MACHINE_ARCH=${XDEV_ARCH} CDTMP= ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 07:52:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44B1AB82; Thu, 3 Apr 2014 07:52:04 +0000 (UTC) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 020FB808; Thu, 3 Apr 2014 07:52:02 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 1219D422B31; Thu, 3 Apr 2014 18:51:51 +1100 (EST) Date: Thu, 3 Apr 2014 18:51:43 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: d@delphij.net Subject: Re: svn commit: r264059 - head/bin/dd In-Reply-To: <533D0307.6090509@delphij.net> Message-ID: <20140403183237.I1546@besplex.bde.org> References: <201404030055.s330tGCI070764@svn.freebsd.org> <20140403150420.H959@besplex.bde.org> <533D0307.6090509@delphij.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=U6SrU4bu c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=pzt8HfeZUOQA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=9eILa-v36Y3XtNAoasQA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 07:52:04 -0000 On Wed, 2 Apr 2014, Xin Li wrote: > On 4/2/14, 9:45 PM, Bruce Evans wrote: >> On Thu, 3 Apr 2014, Xin LI wrote: >>> 0x00020 -#define C_FILES 0x00040 -#define C_IBS >>> 0x00080 -#define C_IF 0x00100 -#define C_LCASE >>> 0x00200 -#define C_NOERROR 0x00400 -#define C_NOTRUNC >>> 0x00800 -#define C_OBS 0x01000 -#define C_OF >>> 0x02000 -#define C_OSYNC 0x04000 -#define C_PAREVEN >>> 0x08000 -#define C_PARNONE 0x100000 >> >> The previous formatting was not too good, and obfuscated a bug >> here. 4 bits are unused. Someone added this bug together with many >> others in 2004, and I missed it then when I committed a fix for the >> others. Most of the bugs that I fixed were unsorting of the table >> by adding to its end. Insertion sort tends to give large churn of >> the table by changing all the numbers, but for the 2004 fix there >> wasn't much churn except relative to the unsorted version because >> all the changes were near the end. Actually it was me who added the unused bits. *Blush*. I see you committed a fix. >>> -#define C_PARODD 0x200000 -#define C_PARSET >>> 0x400000 -#define C_SEEK 0x800000 -#define C_SKIP >>> 0x1000000 -#define C_SPARSE 0x2000000 -#define C_SWAB >>> 0x4000000 -#define C_SYNC 0x8000000 -#define C_UCASE Mail programs keep getting worse. Here they destroyed the line wrapping together with rearranging the quotes. > Will it be an improvement if we have the attached change committed? > Basically it redo the sort and use 1 <<'s instead of hardcoded heximal > numbers. Too much style changing. dd still uses hex constants for smaller flag values elsewhere, even in the same file. >> The 2 values above UINT_MAX also won't compile with compilers that >> warn that 'integer constant is too large for "long" type'. Mainly >> gcc > without >> -std=c99. clang is too incompatible to warn about this even with >> -std=c89 -Wall. The fix is not to further churn the table by >> adding a ULL suffix to all entries. Using shifts gives a similar type problem for 32-bit types. From the patch: % -#define C_NOXFER 0x10000000 % -#define C_NOINFO 0x20000000 % ... % +#define C_UCASE (1 << 28) % +#define C_UNBLOCK (1 << 29) This works up to (1 << 30), assuming 32-bit ints, but (1 << 31) would overflow. It would have to be written as (1U << 31) (keep assuming 32-bit ints), but this would mess up the fancy formatting. Elswhere in the patch: % -#define C_ASCII 0x00000001 % -#define C_BLOCK 0x00000002 % ... % +#define C_ASCII (1 << 0) % +#define C_BLOCK (1 << 1) Fancy formatting like this (the extra space before the shift count to line things up) is hard to maintain since it is too fancy for indent(1) to produce or preserve. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 08:08:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D4252E6; Thu, 3 Apr 2014 08:08:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A63392C; Thu, 3 Apr 2014 08:08:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3388bPW050789; Thu, 3 Apr 2014 08:08:37 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3388b6T050788; Thu, 3 Apr 2014 08:08:37 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201404030808.s3388b6T050788@svn.freebsd.org> From: David Chisnall Date: Thu, 3 Apr 2014 08:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264069 - head/lib/libc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 08:08:37 -0000 Author: theraven Date: Thu Apr 3 08:08:36 2014 New Revision: 264069 URL: http://svnweb.freebsd.org/changeset/base/264069 Log: Add an extra void* cast to work around a bug in FreeBSD-gcc inherited from Apple. Modified: head/lib/libc/include/block_abi.h Modified: head/lib/libc/include/block_abi.h ============================================================================== --- head/lib/libc/include/block_abi.h Thu Apr 3 07:28:36 2014 (r264068) +++ head/lib/libc/include/block_abi.h Thu Apr 3 08:08:36 2014 (r264069) @@ -60,4 +60,4 @@ int flags;\ int reserved;\ void (*invoke)(void *, ...);\ - }*)x)->invoke) + }*)(void*)x)->invoke) From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 08:16:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76F48A70; Thu, 3 Apr 2014 08:16:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49D7FA04; Thu, 3 Apr 2014 08:16:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s338GkNr054960; Thu, 3 Apr 2014 08:16:46 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s338GjwS054957; Thu, 3 Apr 2014 08:16:45 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201404030816.s338GjwS054957@svn.freebsd.org> From: David Chisnall Date: Thu, 3 Apr 2014 08:16:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264070 - in head/lib/libc: . gen stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 08:16:46 -0000 Author: theraven Date: Thu Apr 3 08:16:45 2014 New Revision: 264070 URL: http://svnweb.freebsd.org/changeset/base/264070 Log: Move _b functions into the 11.x symbol version namespace. Modified: head/lib/libc/Versions.def head/lib/libc/gen/Symbol.map head/lib/libc/stdlib/Symbol.map Modified: head/lib/libc/Versions.def ============================================================================== --- head/lib/libc/Versions.def Thu Apr 3 08:08:36 2014 (r264069) +++ head/lib/libc/Versions.def Thu Apr 3 08:16:45 2014 (r264070) @@ -23,6 +23,11 @@ FBSD_1.2 { FBSD_1.3 { } FBSD_1.2; +# This version was first added to 11.0-current. +FBSD_1.4 { +} FBSD_1.3; + + # This is our private namespace. Any global interfaces that are # strictly for use only by other FreeBSD applications and libraries # are listed here. We use a separate namespace so we can write Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Thu Apr 3 08:08:36 2014 (r264069) +++ head/lib/libc/gen/Symbol.map Thu Apr 3 08:16:45 2014 (r264070) @@ -392,7 +392,6 @@ FBSD_1.3 { nvis; pwcache_userdb; pwcache_groupdb; - scandir_b; snvis; strenvisx; strnunvis; @@ -410,6 +409,10 @@ FBSD_1.3 { waitid; }; +FBSD_1.4 { + scandir_b; +}; + FBSDprivate_1.0 { /* needed by thread libraries */ __thr_jtable; Modified: head/lib/libc/stdlib/Symbol.map ============================================================================== --- head/lib/libc/stdlib/Symbol.map Thu Apr 3 08:08:36 2014 (r264069) +++ head/lib/libc/stdlib/Symbol.map Thu Apr 3 08:16:45 2014 (r264070) @@ -86,14 +86,10 @@ FBSD_1.0 { FBSD_1.3 { at_quick_exit; - atexit_b; atof_l; atoi_l; atol_l; atoll_l; - heapsort_b; - mergesort_b; - qsort_b; quick_exit; strtod_l; strtof_l; @@ -108,6 +104,13 @@ FBSD_1.3 { strtouq_l; }; +FBSD_1.4 { + atexit_b; + heapsort_b; + mergesort_b; + qsort_b; +}; + FBSDprivate_1.0 { __system; _system; From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 08:48:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B9B8205; Thu, 3 Apr 2014 08:48:38 +0000 (UTC) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CCC8C96; Thu, 3 Apr 2014 08:48:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id s338mCMO051832; Thu, 3 Apr 2014 12:48:12 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Thu, 3 Apr 2014 12:48:12 +0400 (MSK) From: Dmitry Morozovsky To: Glen Barber Subject: Re: svn commit: r264046 - in head: release share/man/man7 In-Reply-To: <201404021653.s32Gr8nl071605@svn.freebsd.org> Message-ID: References: <201404021653.s32Gr8nl071605@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Thu, 03 Apr 2014 12:48:12 +0400 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 08:48:38 -0000 Glen, On Wed, 2 Apr 2014, Glen Barber wrote: > Author: gjb > Date: Wed Apr 2 16:53:07 2014 > New Revision: 264046 > URL: http://svnweb.freebsd.org/changeset/base/264046 > > Log: > Use xz(1) instead of gzip(1) to compress release images > when WITH_COMPRESSED_IMAGES is used. Maybe invent some variable defaulting to /usr/bin/xz so admin could use /usr/local/bin/pxz or other compatible implementation? On 4-core not-too-fast machine I observed pxz more than 3 time faster than xz while only slighly (5-10%) worse in packing ratio -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 12:04:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D1609CC; Thu, 3 Apr 2014 12:04:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA0E032E; Thu, 3 Apr 2014 12:04:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s33C45BL059225; Thu, 3 Apr 2014 12:04:05 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33C457O059224; Thu, 3 Apr 2014 12:04:05 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404031204.s33C457O059224@svn.freebsd.org> From: Glen Barber Date: Thu, 3 Apr 2014 12:04:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264073 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 12:04:06 -0000 Author: gjb Date: Thu Apr 3 12:04:05 2014 New Revision: 264073 URL: http://svnweb.freebsd.org/changeset/base/264073 Log: Allow overriding xz(1) path. Requested by: marck MFC After: 5 days X-MFC-With: r264027,r264028,r264029,r264030,r264046 Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Thu Apr 3 12:03:30 2014 (r264072) +++ head/release/Makefile Thu Apr 3 12:04:05 2014 (r264073) @@ -30,6 +30,7 @@ WORLDDIR?= ${.CURDIR}/.. PORTSDIR?= /usr/ports DOCDIR?= /usr/doc RELNOTES_LANG?= en_US.ISO8859-1 +XZCMD?= /usr/bin/xz .if !defined(TARGET) || empty(TARGET) TARGET= ${MACHINE} @@ -259,7 +260,7 @@ install: .for I in ${IMAGES} cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I} . if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES) - xz -k ${DESTDIR}/${OSRELEASE}-${I} + ${XZCMD} -k ${DESTDIR}/${OSRELEASE}-${I} . endif .endfor cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256 From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 12:04:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42010B06; Thu, 3 Apr 2014 12:04:32 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.glenbarber.us", Issuer "RapidSSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11786332; Thu, 3 Apr 2014 12:04:32 +0000 (UTC) Received: from glenbarber.us (70.15.88.86.res-cmts.sewb.ptd.net [70.15.88.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 906AAB006; Thu, 3 Apr 2014 12:04:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 906AAB006 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Thu, 3 Apr 2014 08:04:28 -0400 From: Glen Barber To: Dmitry Morozovsky Subject: Re: svn commit: r264046 - in head: release share/man/man7 Message-ID: <20140403120428.GB14379@glenbarber.us> References: <201404021653.s32Gr8nl071605@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rsGyAQ90QqnfMsmV" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 12:04:32 -0000 --rsGyAQ90QqnfMsmV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 03, 2014 at 12:48:12PM +0400, Dmitry Morozovsky wrote: > Glen, >=20 > On Wed, 2 Apr 2014, Glen Barber wrote: >=20 > > Author: gjb > > Date: Wed Apr 2 16:53:07 2014 > > New Revision: 264046 > > URL: http://svnweb.freebsd.org/changeset/base/264046 > >=20 > > Log: > > Use xz(1) instead of gzip(1) to compress release images > > when WITH_COMPRESSED_IMAGES is used. >=20 > Maybe invent some variable defaulting to /usr/bin/xz so admin could use= =20 > /usr/local/bin/pxz or other compatible implementation?=20 >=20 > On 4-core not-too-fast machine I observed pxz more than 3 time faster tha= n xz=20 > while only slighly (5-10%) worse in packing ratio >=20 Committed as r264073. Glen --rsGyAQ90QqnfMsmV Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTPU5MAAoJELls3eqvi17QbgwP/3kWhmWdfHxMOR50GfebtjiU V2OxN3wai9tQukJDnNxJgOdGUHpRqftIeSXWwjPHpv/9n+Gj01+vArYsLJVvLKZD p8ZDP4JsfzyBRimxW/6oYV0iXi2TvzxwInvCnnLevVdJNNBUY1+RaRa5JLBYJPW0 kLq5QAaYA9SdcJi8FcPEe9/mDmPSx1mFYSpvul+H125ejJnDEAlv+Bmr4YnMQe+C FXawd1zohqYLExzjNWUVd4Rnf1vO7j307jkGokn6ua9NuKr8f2K3lPTQ7kO3JK3X +FH7RZ3MFEu3fkwi2UryWQfU/Q22k+nKOcdQtag+MBMKoZ8Un2Jh1N/N2bq4bH16 cN8+3HzaIUUjL8435sM/Dula38SKS9A2CQRYnJjbjnC5BTMRtIrlRceCI8XzmJ/I UdL1HXc3PTAA7q2RLvlFBQNtmZzv5Qbe23r//eCWG5nuSe3VbJY6rkc5U8+noO9s IpThZdkNyLSv9+Dq5Y2IEA0XCvmk3DnXg2LqDiBkpELU27G38bMdWtRkxYdUm3OA 6SqKZbBaD/O/ahGeheyV15nIkXVih+ZuFbUvjOvG0fpBDZVWxIxYsx85Jg1v1ds1 nLReQLsx++8G4xX6RjN4UBHJCUPzvmAj2beL9U1YQ0KV6y2eH1vyP0ZyiKcTUhGa jAq2WsMkJ4CQmtsfhPaU =eQVI -----END PGP SIGNATURE----- --rsGyAQ90QqnfMsmV-- From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 15:04:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DD4EB6F; Thu, 3 Apr 2014 15:04:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F48F8E7; Thu, 3 Apr 2014 15:04:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s33F4XWM035695; Thu, 3 Apr 2014 15:04:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33F4XZq035694; Thu, 3 Apr 2014 15:04:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404031504.s33F4XZq035694@svn.freebsd.org> From: Alexander Motin Date: Thu, 3 Apr 2014 15:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264077 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 15:04:33 -0000 Author: mav Date: Thu Apr 3 15:04:32 2014 New Revision: 264077 URL: http://svnweb.freebsd.org/changeset/base/264077 Log: Add BIO_DELETE support to ZVOL. It is an adapted merge from the vendor branch of: 701 UNMAP support for COMSTAR (in part related to ZFS) 2130 zvol DKIOCFREE uses nested DMU transactions Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Apr 3 14:58:52 2014 (r264076) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Apr 3 15:04:32 2014 (r264077) @@ -25,9 +25,12 @@ * All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * + * Portions Copyright 2010 Robert Milkowski + * + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. */ -/* Portions Copyright 2010 Robert Milkowski */ /* Portions Copyright 2011 Martin Matuska */ /* @@ -153,6 +156,8 @@ int zvol_maxphys = DMU_MAX_ACCESS/2; extern int zfs_set_prop_nvlist(const char *, zprop_source_t, nvlist_t *, nvlist_t *); +static void zvol_log_truncate(zvol_state_t *zv, dmu_tx_t *tx, uint64_t off, + uint64_t len, boolean_t sync); static int zvol_remove_zv(zvol_state_t *); static int zvol_get_data(void *arg, lr_write_t *lr, char *buf, zio_t *zio); static int zvol_dumpify(zvol_state_t *zv); @@ -386,6 +391,24 @@ zvol_create_cb(objset_t *os, void *arg, } /* + * Replay a TX_TRUNCATE ZIL transaction if asked. TX_TRUNCATE is how we + * implement DKIOCFREE/free-long-range. + */ +static int +zvol_replay_truncate(zvol_state_t *zv, lr_truncate_t *lr, boolean_t byteswap) +{ + uint64_t offset, length; + + if (byteswap) + byteswap_uint64_array(lr, sizeof (*lr)); + + offset = lr->lr_offset; + length = lr->lr_length; + + return (dmu_free_long_range(zv->zv_objset, ZVOL_OBJ, offset, length)); +} + +/* * Replay a TX_WRITE ZIL transaction that didn't get committed * after a system failure */ @@ -435,7 +458,7 @@ zvol_replay_err(zvol_state_t *zv, lr_t * /* * Callback vectors for replaying records. - * Only TX_WRITE is needed for zvol. + * Only TX_WRITE and TX_TRUNCATE are needed for zvol. */ zil_replay_func_t *zvol_replay_vector[TX_MAX_TYPE] = { zvol_replay_err, /* 0 no such transaction type */ @@ -448,7 +471,7 @@ zil_replay_func_t *zvol_replay_vector[TX zvol_replay_err, /* TX_LINK */ zvol_replay_err, /* TX_RENAME */ zvol_replay_write, /* TX_WRITE */ - zvol_replay_err, /* TX_TRUNCATE */ + zvol_replay_truncate, /* TX_TRUNCATE */ zvol_replay_err, /* TX_SETATTR */ zvol_replay_err, /* TX_ACL */ zvol_replay_err, /* TX_CREATE_ACL */ @@ -1316,6 +1339,21 @@ zvol_strategy(struct bio *bp) rl = zfs_range_lock(&zv->zv_znode, off, resid, doread ? RL_READER : RL_WRITER); + if (bp->bio_cmd == BIO_DELETE) { + dmu_tx_t *tx = dmu_tx_create(zv->zv_objset); + error = dmu_tx_assign(tx, TXG_WAIT); + if (error != 0) { + dmu_tx_abort(tx); + } else { + zvol_log_truncate(zv, tx, off, resid, B_TRUE); + dmu_tx_commit(tx); + error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ, + off, resid); + resid = 0; + } + goto unlock; + } + while (resid != 0 && off < volsize) { size_t size = MIN(resid, zvol_maxphys); #ifdef illumos @@ -1351,6 +1389,7 @@ zvol_strategy(struct bio *bp) addr += size; resid -= size; } +unlock: zfs_range_unlock(rl); bp->bio_completed = bp->bio_length - resid; @@ -1648,9 +1687,36 @@ zvol_log_write_minor(void *minor_hdl, dm /* * END entry points to allow external callers access to the volume. */ +#endif /* sun */ /* + * Log a DKIOCFREE/free-long-range to the ZIL with TX_TRUNCATE. + */ +static void +zvol_log_truncate(zvol_state_t *zv, dmu_tx_t *tx, uint64_t off, uint64_t len, + boolean_t sync) +{ + itx_t *itx; + lr_truncate_t *lr; + zilog_t *zilog = zv->zv_zilog; + + if (zil_replaying(zilog, tx)) + return; + + itx = zil_itx_create(TX_TRUNCATE, sizeof (*lr)); + lr = (lr_truncate_t *)&itx->itx_lr; + lr->lr_foid = ZVOL_OBJ; + lr->lr_offset = off; + lr->lr_length = len; + + itx->itx_sync = sync; + zil_itx_assign(zilog, itx, tx); +} + +#ifdef sun +/* * Dirtbag ioctls to support mkfs(1M) for UFS filesystems. See dkio(7I). + * Also a dirtbag dkio ioctl for unmap/free-block functionality. */ /*ARGSUSED*/ int @@ -2271,12 +2337,12 @@ zvol_geom_start(struct bio *bp) break; case BIO_READ: case BIO_WRITE: + case BIO_DELETE: if (!THREAD_CAN_SLEEP()) goto enqueue; zvol_strategy(bp); break; case BIO_GETATTR: - case BIO_DELETE: default: g_io_deliver(bp, EOPNOTSUPP); break; From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 16:21:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51C0E7F1; Thu, 3 Apr 2014 16:21:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3ED65C0; Thu, 3 Apr 2014 16:21:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s33GLcLH066279; Thu, 3 Apr 2014 16:21:38 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33GLc0x066278; Thu, 3 Apr 2014 16:21:38 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404031621.s33GLc0x066278@svn.freebsd.org> From: Ed Maste Date: Thu, 3 Apr 2014 16:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264078 - head/sys/boot/i386/efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 16:21:38 -0000 Author: emaste Date: Thu Apr 3 16:21:37 2014 New Revision: 264078 URL: http://svnweb.freebsd.org/changeset/base/264078 Log: Put each source file on a separate line This will simplify rebasing the amd64 UEFI patch set. Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/i386/efi/Makefile Modified: head/sys/boot/i386/efi/Makefile ============================================================================== --- head/sys/boot/i386/efi/Makefile Thu Apr 3 15:04:32 2014 (r264077) +++ head/sys/boot/i386/efi/Makefile Thu Apr 3 16:21:37 2014 (r264078) @@ -10,8 +10,18 @@ PROG= loader.sym INTERNALPROG= # architecture-specific loader code -SRCS= main.c exec.c conf.c vers.c reloc.c start.S elf32_freebsd.c -SRCS+= i386_copy.c bootinfo.c autoload.c devicename.c efimd.c +SRCS= autoload.c \ + bootinfo.c \ + conf.c \ + devicename.c \ + efimd.c \ + elf32_freebsd.c \ + exec.c \ + i386_copy.c \ + main.c \ + reloc.c \ + vers.c +SRCS+= start.S CFLAGS+= -I${.CURDIR}/../../efi/include CFLAGS+= -I${.CURDIR}/../../efi/include/i386 From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 17:31:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BF7F1BA; Thu, 3 Apr 2014 17:31:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 607C49AE; Thu, 3 Apr 2014 17:31:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s33HVdsp096395; Thu, 3 Apr 2014 17:31:39 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33HVdfS096394; Thu, 3 Apr 2014 17:31:39 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201404031731.s33HVdfS096394@svn.freebsd.org> From: David Chisnall Date: Thu, 3 Apr 2014 17:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264082 - head/lib/libc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 17:31:39 -0000 Author: theraven Date: Thu Apr 3 17:31:38 2014 New Revision: 264082 URL: http://svnweb.freebsd.org/changeset/base/264082 Log: Fix the inheritance of the FBSDprivate_1.0 namespace. Modified: head/lib/libc/Versions.def Modified: head/lib/libc/Versions.def ============================================================================== --- head/lib/libc/Versions.def Thu Apr 3 17:26:45 2014 (r264081) +++ head/lib/libc/Versions.def Thu Apr 3 17:31:38 2014 (r264082) @@ -35,4 +35,4 @@ FBSD_1.4 { # # Please do NOT increment the version of this namespace. FBSDprivate_1.0 { -} FBSD_1.3; +} FBSD_1.4; From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 17:55:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1C116D7; Thu, 3 Apr 2014 17:55:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9258BB5F; Thu, 3 Apr 2014 17:55:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s33Ht8C2005306; Thu, 3 Apr 2014 17:55:08 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33Ht8LV005305; Thu, 3 Apr 2014 17:55:08 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201404031755.s33Ht8LV005305@svn.freebsd.org> From: Luiz Otavio O Souza Date: Thu, 3 Apr 2014 17:55:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264083 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 17:55:08 -0000 Author: loos Date: Thu Apr 3 17:55:08 2014 New Revision: 264083 URL: http://svnweb.freebsd.org/changeset/base/264083 Log: Move the GPIO bank initialization to a new function to make easier to detect errors. Reset the GPIO module during the initialization. This is guaranteed to be the same as a hardware reset. Tested on AM335x (BBB) and checked against the omap3 and omap4 TRM. Do a better job freeing resources when there are errors and on ti_gpio_detach(). Modified: head/sys/arm/ti/ti_gpio.c Modified: head/sys/arm/ti/ti_gpio.c ============================================================================== --- head/sys/arm/ti/ti_gpio.c Thu Apr 3 17:31:38 2014 (r264082) +++ head/sys/arm/ti/ti_gpio.c Thu Apr 3 17:55:08 2014 (r264083) @@ -69,6 +69,9 @@ __FBSDID("$FreeBSD$"); /* Register definitions */ #define TI_GPIO_REVISION 0x0000 #define TI_GPIO_SYSCONFIG 0x0010 +#define TI_GPIO_SYSCONFIG_SOFTRESET (1 << 1) +#define TI_GPIO_SYSCONFIG_AUTOIDLE (1 << 0) +#define TI_GPIO_SYSSTATUS_RESETDONE (1 << 0) #if defined(SOC_OMAP3) #define TI_GPIO_SYSSTATUS 0x0014 #define TI_GPIO_IRQSTATUS1 0x0018 @@ -637,6 +640,107 @@ ti_gpio_probe(device_t dev) return (0); } +static int +ti_gpio_attach_intr(device_t dev) +{ + int i; + struct ti_gpio_softc *sc; + + sc = device_get_softc(dev); + for (i = 0; i < MAX_GPIO_BANKS; i++) { + if (sc->sc_irq_res[i] == NULL) + break; + + /* + * Register our interrupt handler for each of the IRQ resources. + */ + if (bus_setup_intr(dev, sc->sc_irq_res[i], + INTR_TYPE_MISC | INTR_MPSAFE, NULL, ti_gpio_intr, sc, + &sc->sc_irq_hdl[i]) != 0) { + device_printf(dev, + "WARNING: unable to register interrupt handler\n"); + return (-1); + } + } + + return (0); +} + +static int +ti_gpio_detach_intr(device_t dev) +{ + int i; + struct ti_gpio_softc *sc; + + /* Teardown our interrupt handlers. */ + sc = device_get_softc(dev); + for (i = 0; i < MAX_GPIO_BANKS; i++) { + if (sc->sc_irq_res[i] == NULL) + break; + + if (sc->sc_irq_hdl[i]) { + bus_teardown_intr(dev, sc->sc_irq_res[i], + sc->sc_irq_hdl[i]); + } + } + + return (0); +} + +static int +ti_gpio_bank_init(device_t dev, int bank) +{ + int pin, timeout; + struct ti_gpio_softc *sc; + uint32_t flags, reg_oe; + + sc = device_get_softc(dev); + + /* Enable the interface and functional clocks for the module. */ + ti_prcm_clk_enable(GPIO0_CLK + FIRST_GPIO_BANK + bank); + + /* Reset the GPIO module. */ + timeout = 0; + ti_gpio_write_4(sc, bank, TI_GPIO_SYSCONFIG, TI_GPIO_SYSCONFIG_SOFTRESET); + while ((ti_gpio_read_4(sc, bank, TI_GPIO_SYSSTATUS) & + TI_GPIO_SYSSTATUS_RESETDONE) == 0) { + if (timeout++ > 100) + return (EBUSY); + DELAY(100); + } + + /* + * Read the revision number of the module. TI don't publish the + * actual revision numbers, so instead the values have been + * determined by experimentation. + */ + sc->sc_revision[bank] = ti_gpio_read_4(sc, bank, TI_GPIO_REVISION); + + /* Check the revision. */ + if (sc->sc_revision[bank] != TI_GPIO_REV) { + device_printf(dev, "Warning: could not determine the revision " + "of %u GPIO module (revision:0x%08x)\n", + bank, sc->sc_revision[bank]); + return (EINVAL); + } + + /* Disable interrupts for all pins. */ + ti_gpio_write_4(sc, bank, TI_GPIO_CLEARIRQENABLE1, 0xffffffff); + ti_gpio_write_4(sc, bank, TI_GPIO_CLEARIRQENABLE2, 0xffffffff); + + /* Init OE register based on pads configuration. */ + reg_oe = 0xffffffff; + for (pin = 0; pin < PINS_PER_BANK; pin++) { + ti_scm_padconf_get_gpioflags(PINS_PER_BANK * bank + pin, + &flags); + if (flags & GPIO_PIN_OUTPUT) + reg_oe &= ~(1UL << pin); + } + ti_gpio_write_4(sc, bank, TI_GPIO_OE, reg_oe); + + return (0); +} + /** * ti_gpio_attach - attach function for the driver * @dev: gpio device handle @@ -653,13 +757,11 @@ ti_gpio_probe(device_t dev) static int ti_gpio_attach(device_t dev) { - struct ti_gpio_softc *sc = device_get_softc(dev); + struct ti_gpio_softc *sc; unsigned int i; - int err = 0; - int pin; - uint32_t flags; - uint32_t reg_oe; + int err; + sc = device_get_softc(dev); sc->sc_dev = dev; TI_GPIO_LOCK_INIT(sc); @@ -668,30 +770,24 @@ ti_gpio_attach(device_t dev) * memory areas on the chip. The memory range should have been set for * the driver when it was added as a child. */ - err = bus_alloc_resources(dev, ti_gpio_mem_spec, sc->sc_mem_res); - if (err) { + if (bus_alloc_resources(dev, ti_gpio_mem_spec, sc->sc_mem_res) != 0) { device_printf(dev, "Error: could not allocate mem resources\n"); return (ENXIO); } /* Request the IRQ resources */ - err = bus_alloc_resources(dev, ti_gpio_irq_spec, sc->sc_irq_res); - if (err) { + if (bus_alloc_resources(dev, ti_gpio_irq_spec, sc->sc_irq_res) != 0) { + bus_release_resources(dev, ti_gpio_mem_spec, sc->sc_mem_res); device_printf(dev, "Error: could not allocate irq resources\n"); return (ENXIO); } /* Setup the IRQ resources */ - for (i = 0; i < MAX_GPIO_BANKS; i++) { - if (sc->sc_irq_res[i] == NULL) - break; - - /* Register an interrupt handler for each of the IRQ resources */ - if ((bus_setup_intr(dev, sc->sc_irq_res[i], INTR_TYPE_MISC | INTR_MPSAFE, - NULL, ti_gpio_intr, sc, &(sc->sc_irq_hdl[i])))) { - device_printf(dev, "WARNING: unable to register interrupt handler\n"); - return (ENXIO); - } + if (ti_gpio_attach_intr(dev) != 0) { + ti_gpio_detach_intr(dev); + bus_release_resources(dev, ti_gpio_irq_spec, sc->sc_irq_res); + bus_release_resources(dev, ti_gpio_mem_spec, sc->sc_mem_res); + return (ENXIO); } /* We need to go through each block and ensure the clocks are running and @@ -701,38 +797,16 @@ ti_gpio_attach(device_t dev) */ for (i = 0; i < MAX_GPIO_BANKS; i++) { if (sc->sc_mem_res[i] != NULL) { - - /* Enable the interface and functional clocks for the module */ - ti_prcm_clk_enable(GPIO0_CLK + FIRST_GPIO_BANK + i); - - /* Read the revision number of the module. TI don't publish the - * actual revision numbers, so instead the values have been - * determined by experimentation. - */ - sc->sc_revision[i] = ti_gpio_read_4(sc, i, TI_GPIO_REVISION); - - /* Check the revision */ - if (sc->sc_revision[i] != TI_GPIO_REV) { - device_printf(dev, "Warning: could not determine the revision" - "of %u GPIO module (revision:0x%08x)\n", - i, sc->sc_revision[i]); - continue; - } - - /* Disable interrupts for all pins */ - ti_gpio_write_4(sc, i, TI_GPIO_CLEARIRQENABLE1, 0xffffffff); - ti_gpio_write_4(sc, i, TI_GPIO_CLEARIRQENABLE2, 0xffffffff); - - /* Init OE register based on pads configuration */ - reg_oe = 0xffffffff; - for (pin = 0; pin < 32; pin++) { - ti_scm_padconf_get_gpioflags( - PINS_PER_BANK*i + pin, &flags); - if (flags & GPIO_PIN_OUTPUT) - reg_oe &= ~(1U << pin); + /* Reset and initialize the GPIO module. */ + err = ti_gpio_bank_init(dev, i); + if (err != 0) { + ti_gpio_detach_intr(dev); + bus_release_resources(dev, ti_gpio_irq_spec, + sc->sc_irq_res); + bus_release_resources(dev, ti_gpio_mem_spec, + sc->sc_mem_res); + return (err); } - - ti_gpio_write_4(sc, i, TI_GPIO_OE, reg_oe); } } @@ -774,13 +848,10 @@ ti_gpio_detach(device_t dev) bus_generic_detach(dev); - /* Release the memory and IRQ resources */ - for (i = 0; i < MAX_GPIO_BANKS; i++) { - if (sc->sc_mem_res[i] != NULL) - bus_release_resource(dev, SYS_RES_MEMORY, i, sc->sc_mem_res[i]); - if (sc->sc_irq_res[i] != NULL) - bus_release_resource(dev, SYS_RES_IRQ, i, sc->sc_irq_res[i]); - } + /* Release the memory and IRQ resources. */ + ti_gpio_detach_intr(dev); + bus_release_resources(dev, ti_gpio_irq_spec, sc->sc_irq_res); + bus_release_resources(dev, ti_gpio_mem_spec, sc->sc_mem_res); TI_GPIO_LOCK_DESTROY(sc); From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 20:00:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88796E0F; Thu, 3 Apr 2014 20:00:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7629D894; Thu, 3 Apr 2014 20:00:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s33K03sb056108; Thu, 3 Apr 2014 20:00:03 GMT (envelope-from joerg@svn.freebsd.org) Received: (from joerg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33K03Eh056100; Thu, 3 Apr 2014 20:00:03 GMT (envelope-from joerg@svn.freebsd.org) Message-Id: <201404032000.s33K03Eh056100@svn.freebsd.org> From: Joerg Wunsch Date: Thu, 3 Apr 2014 20:00:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264084 - in head/sys/dev/usb: . serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 20:00:03 -0000 Author: joerg Date: Thu Apr 3 20:00:02 2014 New Revision: 264084 URL: http://svnweb.freebsd.org/changeset/base/264084 Log: Add the Dresden Elektronik "USB Levelshifter Stick Low Cost" to the list of known FTDI devices. https://shop.dresden-elektronik.de/accessories/levelshifter/usb-pegelwandler-stick-basic.html MFC after: 1 week Modified: head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Thu Apr 3 17:55:08 2014 (r264083) +++ head/sys/dev/usb/serial/uftdi.c Thu Apr 3 20:00:02 2014 (r264084) @@ -277,6 +277,7 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(CONTEC, COM1USBH, UFTDI_TYPE_AUTO), UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, UFTDI_TYPE_8U232AM), UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, UFTDI_TYPE_8U232AM), + UFTDI_DEV(DRESDENELEKTRONIK, LEVELSHIFTERSTICKLOWCOST, UFTDI_TYPE_8U232AM), UFTDI_DEV(ELEKTOR, FT323R, UFTDI_TYPE_AUTO), UFTDI_DEV(EVOLUTION, ER1, UFTDI_TYPE_AUTO), UFTDI_DEV(EVOLUTION, HYBRID, UFTDI_TYPE_AUTO), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Apr 3 17:55:08 2014 (r264083) +++ head/sys/dev/usb/usbdevs Thu Apr 3 20:00:02 2014 (r264084) @@ -1654,6 +1654,7 @@ product DRAYTEK VIGOR550 0x0550 Vigor550 /* dresden elektronik products */ product DRESDENELEKTRONIK SENSORTERMINALBOARD 0x0001 SensorTerminalBoard product DRESDENELEKTRONIK WIRELESSHANDHELDTERMINAL 0x0004 Wireless Handheld Terminal +product DRESDENELEKTRONIK LEVELSHIFTERSTICKLOWCOST 0x0022 Levelshifter Stick Low Cost /* Dynastream Innovations */ product DYNASTREAM ANTDEVBOARD 0x1003 ANT dev board From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 20:12:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8685A100; Thu, 3 Apr 2014 20:12:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72742A09; Thu, 3 Apr 2014 20:12:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s33KCeGW063319; Thu, 3 Apr 2014 20:12:40 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33KCeIb063317; Thu, 3 Apr 2014 20:12:40 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201404032012.s33KCeIb063317@svn.freebsd.org> From: Sean Bruno Date: Thu, 3 Apr 2014 20:12:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264085 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 20:12:40 -0000 Author: sbruno Date: Thu Apr 3 20:12:39 2014 New Revision: 264085 URL: http://svnweb.freebsd.org/changeset/base/264085 Log: Add support for the Dlink DIR-825C1 74k MIPS router based on Atheros wireless, bridge and CPU. Added: head/sys/mips/conf/DIR-825C1 (contents, props changed) head/sys/mips/conf/DIR-825C1.hints (contents, props changed) Added: head/sys/mips/conf/DIR-825C1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/DIR-825C1 Thu Apr 3 20:12:39 2014 (r264085) @@ -0,0 +1,66 @@ +# $FreeBSD$ +# +# Specific board setup for the D-Link DIR-825C1 router. +# +# The DIR-825C1 has the following hardware: +# +# + AR9344 CPU SoC 74k MIPS +# + ARxxx 2.4GHz 11n +# + ARXXX 5GHz 11n +# + AR8327 Gigabit switch +# + m25p80 based 16MB flash +# + 128MB RAM +# + uboot environment + +# Include the default AR934x parameters +include "AR934X_BASE" +ident DIR825C1 + +# Override hints with board values +hints "DIR-825C1.hints" + +# Force the board memory - the base DB120 has 128MB RAM +options AR71XX_REALMEM=(128*1024*1024) + +# i2c GPIO bus +device gpioiic +device iicbb +device iicbus +device iic + +# Options required for miiproxy and mdiobus +options ARGE_MDIO # Export an MDIO bus separate from arge +device miiproxy # MDIO bus <-> MII PHY rendezvous + +device etherswitch +device arswitch + +# read MSDOS formatted disks - USB +options MSDOSFS + +# Enable the uboot environment stuff rather then the +# redboot stuff. +options AR71XX_ENV_UBOOT + +# Used for the static uboot partition map +device geom_map + +# uzip - to boot natively from flash +options GEOM_UNCOMPRESS +options GEOM_PART_GPT + +# yes, this board has a PCI connected atheros device +device ath_pci +options AR71XX_ATH_EEPROM +device firmware # Used by the above +options ATH_EEPROM_FIRMWARE + +# Boot off of the rootfs, as defined in the geom_map setup. +options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" + +# In order to netboot, you have to build the mfsroot into the kernel +# 19443712 or 19M is the biggest rootfs via netboot this thing supports +#options MD_ROOT # md device usable as a potential root device +#options MD_ROOT_SIZE=19444 +#makeoptions MFS_IMAGE=/tftpboot/mfsroot-dir825c1.img.ulzma +#options ROOTDEVNAME=\"ufs:md0.uncompress\" Added: head/sys/mips/conf/DIR-825C1.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/DIR-825C1.hints Thu Apr 3 20:12:39 2014 (r264085) @@ -0,0 +1,130 @@ +# $FreeBSD$ + +# This is a placeholder until the hardware support is complete. + +# mdiobus0 on arge0 +hint.argemdio.0.at="nexus0" +hint.argemdio.0.maddr=0x19000000 +hint.argemdio.0.msize=0x1000 +hint.argemdio.0.order=0 + +# DIR-825C1 GMAC configuration +# + AR934X_ETH_CFG_RGMII_GMAC0 (1 << 0) +# Onboard AR9344 10/100 switch is not wired up +hint.ar934x_gmac.0.gmac_cfg=0x1 + +# GMAC0 here - connected to an AR8327 +hint.arswitch.0.at="mdio0" +hint.arswitch.0.is_7240=0 +hint.arswitch.0.is_9340=0 # not the internal switch! +hint.arswitch.0.numphys=5 +hint.arswitch.0.phy4cpu=0 +hint.arswitch.0.is_rgmii=1 +hint.arswitch.0.is_gmii=0 + +# Other AR8327 configuration parameters + +# AR8327_PAD_MAC_RGMII +hint.arswitch.0.pad.0.mode=6 +hint.arswitch.0.pad.0.txclk_delay_en=1 +hint.arswitch.0.pad.0.rxclk_delay_en=1 + +# AR8327_CLK_DELAY_SEL1 +hint.arswitch.0.pad.0.txclk_delay_sel=1 +# AR8327_CLK_DELAY_SEL2 +hint.arswitch.0.pad.0.rxclk_delay_sel=2 + +# XXX there's no LED management just yet! +hint.arswitch.0.led.ctrl0=0x00000000 +hint.arswitch.0.led.ctrl1=0xc737c737 +hint.arswitch.0.led.ctrl2=0x00000000 +hint.arswitch.0.led.ctrl3=0x00c30c00 +hint.arswitch.0.led.open_drain=1 + +# force_link=1 is required for the rest of the parameters +# to be configured. +hint.arswitch.0.port.0.force_link=1 +hint.arswitch.0.port.0.speed=1000 +hint.arswitch.0.port.0.duplex=1 +hint.arswitch.0.port.0.txpause=1 +hint.arswitch.0.port.0.rxpause=1 + +# XXX OpenWRT DB120 BSP doesn't have media/duplex set? +hint.arge.0.phymask=0x0 +hint.arge.0.media=1000 +hint.arge.0.fduplex=1 +hint.arge.0.miimode=3 # RGMII +hint.arge.0.pll_1000=0x06000000 + +# ath0: Where the ART is - last 64k in the flash +hint.ath.0.eepromaddr=0x1fff0000 +hint.ath.0.eepromsize=16384 + +# ath1: it's different; it's a PCIe attached device, so +# we instead need to teach the PCIe bridge code about it +# (ie, the 'early pci fixup' stuff that programs the PCIe +# host registers on the NIC) and then we teach ath where +# to find it. + +# ath1 hint - pcie slot 0 +hint.pcib.0.bus.0.0.0.ath_fixup_addr=0x1fff4000 +hint.pcib.0.bus.0.0.0.ath_fixup_size=16384 + +# ath0 - eeprom comes from here +hint.ath.1.eeprom_firmware="pcib.0.bus.0.0.0.eeprom_firmware" + +# flash layout: +# m25p80 spi0.0: mx25l12805d (16384 Kbytes) +# +# uBoot firmware variables: +# bootargs=console=ttyS0,115200 root=31:02 rootfstype=jffs2 init=/sbin/init +# mtdparts=ath-nor0:256k(u-boot),64k(u-boot-env),6336k(rootfs),1408k(uImage),64k(mib0),64k(ART) + +# 64KiB u-boot +hint.map.0.at="flash/spi0" +hint.map.0.start=0x00000000 +hint.map.0.end= 0x00010000 +hint.map.0.name="u-boot" +hint.map.0.readonly=1 + +# 64KiB u-boot-env +hint.map.1.at="flash/spi0" +hint.map.1.start=0x00010000 +hint.map.1.end= 0x00020000 +hint.map.1.name="u-boot-env" +hint.map.1.readonly=1 + +# 1344KiB kernel +hint.map.2.at="flash/spi0" +hint.map.2.start=0x00020000 +hint.map.2.end="search:0x00100000:0x10000:.!/bin/sh" +hint.map.2.name="kernel" +hint.map.2.readonly=1 + +# 14592KiB rootfs +hint.map.3.at="flash/spi0" +hint.map.3.start="search:0x00100000:0x10000:.!/bin/sh" +hint.map.3.end=0x00fb0000 +hint.map.3.name="rootfs" +hint.map.3.readonly=1 + +# 192KiB lang -- remapped to cfg +hint.map.4.at="flash/spi0" +hint.map.4.start=0x00fb0000 +hint.map.4.end= 0x00fe0000 +hint.map.4.name="cfg" +hint.map.4.readonly=0 + +# 64KiB mac +hint.map.5.at="flash/spi0" +hint.map.5.start=0x00fe0000 +hint.map.5.end= 0x00ff0000 +hint.map.5.name="mac" +hint.map.5.readonly=1 + +# 64KiB art +hint.map.6.at="flash/spi0" +hint.map.6.start=0x00ff0000 +hint.map.6.end= 0x01000000 +hint.map.6.name="art" +hint.map.6.readonly=1 From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 20:18:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D894635; Thu, 3 Apr 2014 20:18:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29A53A69; Thu, 3 Apr 2014 20:18:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s33KIu2N064623; Thu, 3 Apr 2014 20:18:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33KIuDS064622; Thu, 3 Apr 2014 20:18:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404032018.s33KIuDS064622@svn.freebsd.org> From: Alexander Motin Date: Thu, 3 Apr 2014 20:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264086 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 20:18:56 -0000 Author: mav Date: Thu Apr 3 20:18:55 2014 New Revision: 264086 URL: http://svnweb.freebsd.org/changeset/base/264086 Log: MFV r258922: 3580 Want zvols to return volblocksize when queried for physical block size illumos/illumos-gate@a0b60564dfc644f4bfaef1ce26d343b44cf68bc5 It is irrelevant for FreeBSD, just reducing diff. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Apr 3 20:12:39 2014 (r264085) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Apr 3 20:18:55 2014 (r264086) @@ -1723,8 +1723,6 @@ int zvol_ioctl(dev_t dev, int cmd, intptr_t arg, int flag, cred_t *cr, int *rvalp) { zvol_state_t *zv; - struct dk_cinfo dki; - struct dk_minfo dkm; struct dk_callback *dkc; int error = 0; rl_t *rl; @@ -1742,6 +1740,9 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t switch (cmd) { case DKIOCINFO: + { + struct dk_cinfo dki; + bzero(&dki, sizeof (dki)); (void) strcpy(dki.dki_cname, "zvol"); (void) strcpy(dki.dki_dname, "zvol"); @@ -1752,8 +1753,12 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t if (ddi_copyout(&dki, (void *)arg, sizeof (dki), flag)) error = SET_ERROR(EFAULT); return (error); + } case DKIOCGMEDIAINFO: + { + struct dk_minfo dkm; + bzero(&dkm, sizeof (dkm)); dkm.dki_lbsize = 1U << zv->zv_min_bs; dkm.dki_capacity = zv->zv_volsize >> zv->zv_min_bs; @@ -1762,16 +1767,32 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t if (ddi_copyout(&dkm, (void *)arg, sizeof (dkm), flag)) error = SET_ERROR(EFAULT); return (error); + } + + case DKIOCGMEDIAINFOEXT: + { + struct dk_minfo_ext dkmext; + + bzero(&dkmext, sizeof (dkmext)); + dkmext.dki_lbsize = 1U << zv->zv_min_bs; + dkmext.dki_pbsize = zv->zv_volblocksize; + dkmext.dki_capacity = zv->zv_volsize >> zv->zv_min_bs; + dkmext.dki_media_type = DK_UNKNOWN; + mutex_exit(&spa_namespace_lock); + if (ddi_copyout(&dkmext, (void *)arg, sizeof (dkmext), flag)) + error = SET_ERROR(EFAULT); + return (error); + } case DKIOCGETEFI: - { - uint64_t vs = zv->zv_volsize; - uint8_t bs = zv->zv_min_bs; + { + uint64_t vs = zv->zv_volsize; + uint8_t bs = zv->zv_min_bs; - mutex_exit(&spa_namespace_lock); - error = zvol_getefi((void *)arg, flag, vs, bs); - return (error); - } + mutex_exit(&spa_namespace_lock); + error = zvol_getefi((void *)arg, flag, vs, bs); + return (error); + } case DKIOCFLUSHWRITECACHE: dkc = (struct dk_callback *)arg; @@ -1784,31 +1805,31 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t return (error); case DKIOCGETWCE: - { - int wce = (zv->zv_flags & ZVOL_WCE) ? 1 : 0; - if (ddi_copyout(&wce, (void *)arg, sizeof (int), - flag)) - error = SET_ERROR(EFAULT); + { + int wce = (zv->zv_flags & ZVOL_WCE) ? 1 : 0; + if (ddi_copyout(&wce, (void *)arg, sizeof (int), + flag)) + error = SET_ERROR(EFAULT); + break; + } + case DKIOCSETWCE: + { + int wce; + if (ddi_copyin((void *)arg, &wce, sizeof (int), + flag)) { + error = SET_ERROR(EFAULT); break; } - case DKIOCSETWCE: - { - int wce; - if (ddi_copyin((void *)arg, &wce, sizeof (int), - flag)) { - error = SET_ERROR(EFAULT); - break; - } - if (wce) { - zv->zv_flags |= ZVOL_WCE; - mutex_exit(&spa_namespace_lock); - } else { - zv->zv_flags &= ~ZVOL_WCE; - mutex_exit(&spa_namespace_lock); - zil_commit(zv->zv_zilog, ZVOL_OBJ); - } - return (0); + if (wce) { + zv->zv_flags |= ZVOL_WCE; + mutex_exit(&spa_namespace_lock); + } else { + zv->zv_flags &= ~ZVOL_WCE; + mutex_exit(&spa_namespace_lock); + zil_commit(zv->zv_zilog, ZVOL_OBJ); } + return (0); + } case DKIOCGGEOM: case DKIOCGVTOC: From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 21:18:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C18C13EA; Thu, 3 Apr 2014 21:18:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A21F2F88; Thu, 3 Apr 2014 21:18:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s33LI4Gr097194; Thu, 3 Apr 2014 21:18:04 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33LI3v4097189; Thu, 3 Apr 2014 21:18:03 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404032118.s33LI3v4097189@svn.freebsd.org> From: Ed Maste Date: Thu, 3 Apr 2014 21:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264087 - in head/sys/boot: . ficl ficl32 ficl64 i386/efi i386/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 21:18:04 -0000 Author: emaste Date: Thu Apr 3 21:18:03 2014 New Revision: 264087 URL: http://svnweb.freebsd.org/changeset/base/264087 Log: Build boot/ficl as 64-bit library on amd64 The 32-bit bootloaders on amd64 now use the 32-bit version in ficl32, as is done with libstand32. The native 64-bit ficl will be used by the upcoming UEFI loader. Sponsored by: The FreeBSD Foundation Added: head/sys/boot/ficl32/ - copied from r264086, head/sys/boot/ficl64/ Deleted: head/sys/boot/ficl64/ Modified: head/sys/boot/Makefile.amd64 head/sys/boot/ficl/Makefile head/sys/boot/ficl32/Makefile head/sys/boot/i386/efi/Makefile head/sys/boot/i386/loader/Makefile Modified: head/sys/boot/Makefile.amd64 ============================================================================== --- head/sys/boot/Makefile.amd64 Thu Apr 3 20:18:55 2014 (r264086) +++ head/sys/boot/Makefile.amd64 Thu Apr 3 21:18:03 2014 (r264087) @@ -1,7 +1,10 @@ # $FreeBSD$ SUBDIR+= efi -SUBDIR+= ficl64 SUBDIR+= libstand32 SUBDIR+= zfs SUBDIR+= userboot + +.if ${MK_FORTH} != "no" +SUBDIR+= ficl32 +.endif Modified: head/sys/boot/ficl/Makefile ============================================================================== --- head/sys/boot/ficl/Makefile Thu Apr 3 20:18:55 2014 (r264086) +++ head/sys/boot/ficl/Makefile Thu Apr 3 21:18:03 2014 (r264087) @@ -3,7 +3,7 @@ FICLDIR?= ${.CURDIR} -.if !defined(FICL64) +.if defined(FICL32) .PATH: ${FICLDIR}/${MACHINE_CPUARCH:S/amd64/i386/} .elif ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "mips64el" .PATH: ${FICLDIR}/${MACHINE_ARCH} @@ -16,11 +16,12 @@ BASE_SRCS= dict.c ficl.c fileaccess.c fl SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o CFLAGS+= -ffreestanding -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -.if !defined(FICL64) +.if ${MACHINE_CPUARCH} == "i386" || \ + (${MACHINE_CPUARCH} == "amd64" && defined(FICL32)) CFLAGS+= -march=i386 CFLAGS.gcc+= -mpreferred-stack-boundary=2 .endif +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float .endif .if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" @@ -53,22 +54,32 @@ SOFTWORDS= softcore.fr jhlocal.fr marker # Optional OO extension softwords #SOFTWORDS+= oo.fr classes.fr -.if ${MACHINE_CPUARCH} == "amd64" && !defined(FICL64) +.if ${MACHINE_CPUARCH} == "amd64" +.if defined(FICL32) CFLAGS+= -m32 -I. +.else +CFLAGS+= -fPIC +.endif .endif .if ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -m32 -mcpu=powerpc -I. .endif -CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${MACHINE_CPUARCH:S/amd64/i386/} \ +.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) +FICL_CPUARCH= i386 +.else +FICL_CPUARCH= ${MACHINE_CPUARCH} +.endif + +CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} \ -I${FICLDIR}/../common softcore.c: ${SOFTWORDS} softcore.awk (cd ${FICLDIR}/softwords; cat ${SOFTWORDS} \ | awk -f softcore.awk -v datestamp="`LC_ALL=C date`") > ${.TARGET} -.if ${MACHINE_CPUARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) .if !exists(machine) ${SRCS:M*.c:R:S/$/.o/g}: machine Modified: head/sys/boot/ficl32/Makefile ============================================================================== --- head/sys/boot/ficl64/Makefile Thu Apr 3 20:18:55 2014 (r264086) +++ head/sys/boot/ficl32/Makefile Thu Apr 3 21:18:03 2014 (r264087) @@ -1,6 +1,6 @@ # $FreeBSD$ -FICL64= +FICL32= FICLDIR= ${.CURDIR}/../ficl .PATH: ${FICLDIR} Modified: head/sys/boot/i386/efi/Makefile ============================================================================== --- head/sys/boot/i386/efi/Makefile Thu Apr 3 20:18:55 2014 (r264086) +++ head/sys/boot/i386/efi/Makefile Thu Apr 3 21:18:03 2014 (r264087) @@ -31,8 +31,12 @@ BOOT_FORTH= yes CFLAGS+= -DBOOT_FORTH CFLAGS+= -I${.CURDIR}/../../ficl CFLAGS+= -I${.CURDIR}/../../ficl/i386 +.if ${MACHINE_CPUARCH} == "amd64" +LIBFICL= ${.OBJDIR}/../../ficl32/libficl.a +.else LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif +.endif # Include bcache code. HAVE_BCACHE= yes Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Thu Apr 3 20:18:55 2014 (r264086) +++ head/sys/boot/i386/loader/Makefile Thu Apr 3 21:18:03 2014 (r264087) @@ -41,8 +41,12 @@ HAVE_ISABUS= yes # Enable BootForth BOOT_FORTH= yes CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 +.if ${MACHINE_CPUARCH} == "amd64" +LIBFICL= ${.OBJDIR}/../../ficl32/libficl.a +.else LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif +.endif .if defined(LOADER_BZIP2_SUPPORT) CFLAGS+= -DLOADER_BZIP2_SUPPORT From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 21:40:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60D7B95A; Thu, 3 Apr 2014 21:40:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CD40195; Thu, 3 Apr 2014 21:40:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s33Le0Wl005793; Thu, 3 Apr 2014 21:40:00 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33LdxnT005742; Thu, 3 Apr 2014 21:39:59 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404032139.s33LdxnT005742@svn.freebsd.org> From: Ed Maste Date: Thu, 3 Apr 2014 21:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264088 - in head/sys/boot/efi: include libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 21:40:00 -0000 Author: emaste Date: Thu Apr 3 21:39:59 2014 New Revision: 264088 URL: http://svnweb.freebsd.org/changeset/base/264088 Log: Merge efilib changes from projects/uefi r247216: Add the ability for a device to have an "alias" handle. r247379: Fix network device registration. r247380: Adjust our load device when we boot from CD under UEFI. The process for booting from a CD under UEFI involves adding a FAT filesystem containing your loader code as an El Torito boot image. When UEFI detects this, it provides a block IO instance that points at the FAT filesystem as a child of the device that represents the CD itself. The problem being that the CD device is flagged as a "raw device" while the boot image is flagged as a "logical partition". The existing EFI partition code only looks for logical partitions and so the CD filesystem was rendered invisible. To fix this, check the type of each block IO device. If it's found to be a CD, and thus an El Torito boot image, look up its parent device and add that instead so that the loader will then load the kernel from the CD filesystem. This is done by using the handle for the boot filesystem as an alias. Something similar to this will be required for booting from other media as well as the loader will live in the EFI system partition, not on the partition containing the kernel. r247381: Remove a scatalogical debug printf that crept in. Modified: head/sys/boot/efi/include/efilib.h head/sys/boot/efi/libefi/efinet.c head/sys/boot/efi/libefi/efipart.c head/sys/boot/efi/libefi/handles.c Modified: head/sys/boot/efi/include/efilib.h ============================================================================== --- head/sys/boot/efi/include/efilib.h Thu Apr 3 21:18:03 2014 (r264087) +++ head/sys/boot/efi/include/efilib.h Thu Apr 3 21:39:59 2014 (r264088) @@ -41,7 +41,7 @@ extern struct netif_driver efinetif; void *efi_get_table(EFI_GUID *tbl); void efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table); -int efi_register_handles(struct devsw *, EFI_HANDLE *, int); +int efi_register_handles(struct devsw *, EFI_HANDLE *, EFI_HANDLE *, int); EFI_HANDLE efi_find_handle(struct devsw *, int); int efi_handle_lookup(EFI_HANDLE, struct devsw **, int *); Modified: head/sys/boot/efi/libefi/efinet.c ============================================================================== --- head/sys/boot/efi/libefi/efinet.c Thu Apr 3 21:18:03 2014 (r264087) +++ head/sys/boot/efi/libefi/efinet.c Thu Apr 3 21:39:59 2014 (r264088) @@ -274,7 +274,7 @@ efinet_dev_init() if (EFI_ERROR(status)) return (efi_status_to_errno(status)); nifs = sz / sizeof(EFI_HANDLE); - err = efi_register_handles(&efinet_dev, handles, nifs); + err = efi_register_handles(&efinet_dev, handles, NULL, nifs); free(handles); if (err != 0) return (err); Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Thu Apr 3 21:18:03 2014 (r264087) +++ head/sys/boot/efi/libefi/efipart.c Thu Apr 3 21:39:59 2014 (r264088) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include static EFI_GUID blkio_guid = BLOCK_IO_PROTOCOL; +static EFI_GUID devpath_guid = DEVICE_PATH_PROTOCOL; static int efipart_init(void); static int efipart_strategy(void *, int, daddr_t, size_t, char *, size_t *); @@ -62,9 +63,11 @@ static int efipart_init(void) { EFI_BLOCK_IO *blkio; - EFI_HANDLE *hin, *hout; + EFI_DEVICE_PATH *devpath, *node; + EFI_HANDLE *hin, *hout, *aliases, handle; EFI_STATUS status; UINTN sz; + CHAR16 *path; u_int n, nin, nout; int err; @@ -72,7 +75,7 @@ efipart_init(void) hin = NULL; status = BS->LocateHandle(ByProtocol, &blkio_guid, 0, &sz, 0); if (status == EFI_BUFFER_TOO_SMALL) { - hin = (EFI_HANDLE *)malloc(sz * 2); + hin = (EFI_HANDLE *)malloc(sz * 3); status = BS->LocateHandle(ByProtocol, &blkio_guid, 0, &sz, hin); if (EFI_ERROR(status)) @@ -84,19 +87,48 @@ efipart_init(void) /* Filter handles to only include FreeBSD partitions. */ nin = sz / sizeof(EFI_HANDLE); hout = hin + nin; + aliases = hout + nin; nout = 0; + bzero(aliases, nin * sizeof(EFI_HANDLE)); + for (n = 0; n < nin; n++) { + status = BS->HandleProtocol(hin[n], &devpath_guid, &devpath); + if (EFI_ERROR(status)) { + continue; + } + node = devpath; + while (!IsDevicePathEnd(NextDevicePathNode(node))) + node = NextDevicePathNode(node); status = BS->HandleProtocol(hin[n], &blkio_guid, &blkio); if (EFI_ERROR(status)) continue; if (!blkio->Media->LogicalPartition) continue; - hout[nout] = hin[n]; + + /* + * If we come across a logical partition of subtype CDROM + * it doesn't refer to the CD filesystem itself, but rather + * to any usable El Torito boot image on it. In this case + * we try to find the parent device and add that instead as + * that will be the CD filesystem. + */ + if (DevicePathType(node) == MEDIA_DEVICE_PATH && + DevicePathSubType(node) == MEDIA_CDROM_DP) { + node->Type = END_DEVICE_PATH_TYPE; + node->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE; + status = BS->LocateDevicePath(&blkio_guid, &devpath, + &handle); + if (EFI_ERROR(status)) + continue; + hout[nout] = handle; + aliases[nout] = hin[n]; + } else + hout[nout] = hin[n]; nout++; } - err = efi_register_handles(&efipart_dev, hout, nout); + err = efi_register_handles(&efipart_dev, hout, aliases, nout); free(hin); return (err); } Modified: head/sys/boot/efi/libefi/handles.c ============================================================================== --- head/sys/boot/efi/libefi/handles.c Thu Apr 3 21:18:03 2014 (r264087) +++ head/sys/boot/efi/libefi/handles.c Thu Apr 3 21:39:59 2014 (r264088) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); struct entry { EFI_HANDLE handle; + EFI_HANDLE alias; struct devsw *dev; int unit; }; @@ -40,7 +41,8 @@ struct entry *entry; int nentries; int -efi_register_handles(struct devsw *sw, EFI_HANDLE *handles, int count) +efi_register_handles(struct devsw *sw, EFI_HANDLE *handles, + EFI_HANDLE *aliases, int count) { size_t sz; int idx, unit; @@ -51,6 +53,10 @@ efi_register_handles(struct devsw *sw, E entry = (entry == NULL) ? malloc(sz) : realloc(entry, sz); for (unit = 0; idx < nentries; idx++, unit++) { entry[idx].handle = handles[unit]; + if (aliases != NULL) + entry[idx].alias = aliases[unit]; + else + entry[idx].alias = NULL; entry[idx].dev = sw; entry[idx].unit = unit; } @@ -78,7 +84,7 @@ efi_handle_lookup(EFI_HANDLE h, struct d int idx; for (idx = 0; idx < nentries; idx++) { - if (entry[idx].handle != h) + if (entry[idx].handle != h && entry[idx].alias != h) continue; if (dev != NULL) *dev = entry[idx].dev; From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 22:14:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9078E10F; Thu, 3 Apr 2014 22:14:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D16E644; Thu, 3 Apr 2014 22:14:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s33MEJbI021737; Thu, 3 Apr 2014 22:14:19 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33MEJgp021736; Thu, 3 Apr 2014 22:14:19 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404032214.s33MEJgp021736@svn.freebsd.org> From: Xin LI Date: Thu, 3 Apr 2014 22:14:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264089 - head/sbin/casperd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 22:14:19 -0000 Author: delphij Date: Thu Apr 3 22:14:18 2014 New Revision: 264089 URL: http://svnweb.freebsd.org/changeset/base/264089 Log: Detach from controlling session of parent. This is similar to what is done in daemon(3), which we can not use directly in this context. Reviewed by: pjd MFC after: 2 weeks Modified: head/sbin/casperd/zygote.c Modified: head/sbin/casperd/zygote.c ============================================================================== --- head/sbin/casperd/zygote.c Thu Apr 3 21:39:59 2014 (r264088) +++ head/sbin/casperd/zygote.c Thu Apr 3 22:14:18 2014 (r264089) @@ -63,6 +63,9 @@ stdnull(void) if (fd == -1) errx(1, "Unable to open %s", _PATH_DEVNULL); + if (setsid() == -1) + errx(1, "Unable to detach from session"); + if (dup2(fd, STDIN_FILENO) == -1) errx(1, "Unable to cover stdin"); if (dup2(fd, STDOUT_FILENO) == -1) From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 22:22:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF1473E4; Thu, 3 Apr 2014 22:22:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC72A75A; Thu, 3 Apr 2014 22:22:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s33MMAD2025636; Thu, 3 Apr 2014 22:22:10 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33MMANu025635; Thu, 3 Apr 2014 22:22:10 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201404032222.s33MMANu025635@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 3 Apr 2014 22:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264090 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 22:22:11 -0000 Author: bapt Date: Thu Apr 3 22:22:10 2014 New Revision: 264090 URL: http://svnweb.freebsd.org/changeset/base/264090 Log: XDDESTDIR should not be set by the user, instead the user might want to tweak XDTP and let the standard DESTDIR decide where to install. Discussed with: imp Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Apr 3 22:14:18 2014 (r264089) +++ head/Makefile.inc1 Thu Apr 3 22:22:10 2014 (r264090) @@ -1891,7 +1891,7 @@ CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CDTMP= ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN} CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} ${MAKE} ${NOFUN} -XDDESTDIR?=${DESTDIR}/${XDTP} +XDDESTDIR=${DESTDIR}/${XDTP} .if !defined(OSREL) OSREL!= uname -r | sed -e 's/[-(].*//' .endif From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 22:32:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CEB9754; Thu, 3 Apr 2014 22:32:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A3A5836; Thu, 3 Apr 2014 22:32:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s33MWDcI029642; Thu, 3 Apr 2014 22:32:13 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33MWDlj029641; Thu, 3 Apr 2014 22:32:13 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201404032232.s33MWDlj029641@svn.freebsd.org> From: Ryan Stone Date: Thu, 3 Apr 2014 22:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264091 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 22:32:13 -0000 Author: rstone Date: Thu Apr 3 22:32:12 2014 New Revision: 264091 URL: http://svnweb.freebsd.org/changeset/base/264091 Log: Correct a PCI enumeration bug introduced in r264011 Ensure that first_func is set to 0 on every iteration of the PCI slot enumeration loop after the first. There is a continue statement that would cause first_func to stay at 1 any PCI device where slot 0 has no functions until we find a slot that does have a function. This would cause us to not enumerate the first PCI function on the device. Credit to markj@ for spotting the bug. X-MFC-With: r264011 Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Thu Apr 3 22:22:10 2014 (r264090) +++ head/sys/dev/pci/pci.c Thu Apr 3 22:32:12 2014 (r264091) @@ -3503,7 +3503,7 @@ pci_add_children(device_t dev, int domai KASSERT(dinfo_size >= sizeof(struct pci_devinfo), ("dinfo_size too small")); maxslots = PCIB_MAXSLOTS(pcib); - for (s = 0; s <= maxslots; s++) { + for (s = 0; s <= maxslots; s++, first_func = 0) { pcifunchigh = 0; f = 0; DELAY(1); @@ -3515,9 +3515,6 @@ pci_add_children(device_t dev, int domai for (f = first_func; f <= pcifunchigh; f++) pci_identify_function(pcib, dev, domain, busno, s, f, dinfo_size); - - /* For slots after slot 0 we need to check for function 0. */ - first_func = 0; } #undef REG } From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 23:10:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 469B9EE8; Thu, 3 Apr 2014 23:10:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33AF3A8F; Thu, 3 Apr 2014 23:10:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s33NAOtJ043172; Thu, 3 Apr 2014 23:10:24 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33NAOpA043171; Thu, 3 Apr 2014 23:10:24 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404032310.s33NAOpA043171@svn.freebsd.org> From: Ed Maste Date: Thu, 3 Apr 2014 23:10:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264092 - head/sys/boot/efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 23:10:24 -0000 Author: emaste Date: Thu Apr 3 23:10:23 2014 New Revision: 264092 URL: http://svnweb.freebsd.org/changeset/base/264092 Log: Add -fPIC for amd64 Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/efi/libefi/Makefile Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Thu Apr 3 22:32:12 2014 (r264091) +++ head/sys/boot/efi/libefi/Makefile Thu Apr 3 23:10:23 2014 (r264092) @@ -6,6 +6,9 @@ INTERNALLIB= SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \ libefi.c time.c +.if ${MACHINE_ARCH} == "amd64" +CFLAGS+= -fPIC +.endif CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE_CPUARCH} CFLAGS+= -I${.CURDIR}/../../../../lib/libstand From owner-svn-src-head@FreeBSD.ORG Thu Apr 3 23:22:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6EBBF29A; Thu, 3 Apr 2014 23:22:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42B42BCB; Thu, 3 Apr 2014 23:22:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s33NM5RT050384; Thu, 3 Apr 2014 23:22:05 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s33NM5KG050383; Thu, 3 Apr 2014 23:22:05 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201404032322.s33NM5KG050383@svn.freebsd.org> From: Greg Lehey Date: Thu, 3 Apr 2014 23:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264093 - head/bin/ls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2014 23:22:05 -0000 Author: grog Date: Thu Apr 3 23:22:04 2014 New Revision: 264093 URL: http://svnweb.freebsd.org/changeset/base/264093 Log: Typo. Reported by: Igor Sobrado. Modified: head/bin/ls/ls.1 Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Thu Apr 3 23:10:23 2014 (r264092) +++ head/bin/ls/ls.1 Thu Apr 3 23:22:04 2014 (r264093) @@ -220,7 +220,7 @@ It also negates the effect of the and .Fl t options. -As allowd by +As allowed by .St -p1003.1-2001 , this option has no effect on the .Fl d , From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 00:00:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02CDF781; Fri, 4 Apr 2014 00:00:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE282E1E; Fri, 4 Apr 2014 00:00:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34005M3063418; Fri, 4 Apr 2014 00:00:05 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34005Di063417; Fri, 4 Apr 2014 00:00:05 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404040000.s34005Di063417@svn.freebsd.org> From: Ian Lepore Date: Fri, 4 Apr 2014 00:00:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264094 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 00:00:06 -0000 Author: ian Date: Fri Apr 4 00:00:05 2014 New Revision: 264094 URL: http://svnweb.freebsd.org/changeset/base/264094 Log: Actually save the clock frequency retrieved from fdt data. I fumbled this when I converted getprop to getencprop. Submitted by: Thomas Skibo Pointy hat to: ian Modified: head/sys/arm/arm/mpcore_timer.c Modified: head/sys/arm/arm/mpcore_timer.c ============================================================================== --- head/sys/arm/arm/mpcore_timer.c Thu Apr 3 23:22:04 2014 (r264093) +++ head/sys/arm/arm/mpcore_timer.c Fri Apr 4 00:00:05 2014 (r264094) @@ -301,6 +301,7 @@ arm_tmr_attach(device_t dev) "attribute in FDT\n"); return (ENXIO); } + sc->clkfreq = clock; } } From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 00:16:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CA6EBF3; Fri, 4 Apr 2014 00:16:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66CCAFAA; Fri, 4 Apr 2014 00:16:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s340GnUH072327; Fri, 4 Apr 2014 00:16:49 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s340GlJn072315; Fri, 4 Apr 2014 00:16:47 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404040016.s340GlJn072315@svn.freebsd.org> From: Ed Maste Date: Fri, 4 Apr 2014 00:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264095 - in head/sys/boot: amd64 amd64/efi efi/include i386/efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 00:16:49 -0000 Author: emaste Date: Fri Apr 4 00:16:46 2014 New Revision: 264095 URL: http://svnweb.freebsd.org/changeset/base/264095 Log: Support UEFI booting on amd64 via loader.efi This is largely the work from the projects/uefi branch, with some additional refinements. This is derived from (and replaces) the original i386 efi implementation; i386 support will be restored later. Specific revisions of note from projects/uefi: r247380: Adjust our load device when we boot from CD under UEFI. The process for booting from a CD under UEFI involves adding a FAT filesystem containing your loader code as an El Torito boot image. When UEFI detects this, it provides a block IO instance that points at the FAT filesystem as a child of the device that represents the CD itself. The problem being that the CD device is flagged as a "raw device" while the boot image is flagged as a "logical partition". The existing EFI partition code only looks for logical partitions and so the CD filesystem was rendered invisible. To fix this, check the type of each block IO device. If it's found to be a CD, and thus an El Torito boot image, look up its parent device and add that instead so that the loader will then load the kernel from the CD filesystem. This is done by using the handle for the boot filesystem as an alias. Something similar to this will be required for booting from other media as well as the loader will live in the EFI system partition, not on the partition containing the kernel. r246231: Add necessary code to hand off from loader to an amd64 kernel. r246335: Grab the EFI memory map and store it as module metadata on the kernel. This is the same approach used to provide the BIOS SMAP to the kernel. r246336: Pass the ACPI table metadata via hints so the kernel ACPI code can find them. r246608: Rework copy routines to ensure we always use memory allocated via EFI. The previous code assumed it could copy wherever it liked. This is not the case. The approach taken by this code is pretty ham-fisted in that it simply allocates a large (32MB) buffer area and stages into that, then copies the whole area into place when it's time to execute. A more elegant solution could be used but this works for now. r247214: Fix a number of problems preventing proper handover to the kernel. There were two issues at play here. Firstly, there was nothing preventing UEFI from placing the loader code above 1GB in RAM. This meant that when we switched in the page tables the kernel expects to be running on, we are suddenly unmapped and things no longer work. We solve this by making our trampoline code not dependent on being at any given position and simply copying it to a "safe" location before calling it. Secondly, UEFI could allocate our stack wherever it wants. As it happened on my PC, that was right where I was copying the kernel to. This did not cause happiness. The solution to this was to also switch to a temporary stack in a safe location before performing the final copy of the loaded kernel. r246231: Add necessary code to hand off from loader to an amd64 kernel. r246335: Grab the EFI memory map and store it as module metadata on the kernel. This is the same approach used to provide the BIOS SMAP to the kernel. r246336: Pass the ACPI table metadata via hints so the kernel ACPI code can find them. r246608: Rework copy routines to ensure we always use memory allocated via EFI. The previous code assumed it could copy wherever it liked. This is not the case. The approach taken by this code is pretty ham-fisted in that it simply allocates a large (32MB) buffer area and stages into that, then copies the whole area into place when it's time to execute. A more elegant solution could be used but this works for now. r247214: Fix a number of problems preventing proper handover to the kernel. There were two issues at play here. Firstly, there was nothing preventing UEFI from placing the loader code above 1GB in RAM. This meant that when we switched in the page tables the kernel expects to be running on, we are suddenly unmapped and things no longer work. We solve this by making our trampoline code not dependent on being at any given position and simply copying it to a "safe" location before calling it. Secondly, UEFI could allocate our stack wherever it wants. As it happened on my PC, that was right where I was copying the kernel to. This did not cause happiness. The solution to this was to also switch to a temporary stack in a safe location before performing the final copy of the loaded kernel. r247216: Use the UEFI Graphics Output Protocol to get the parameters of the framebuffer. Sponsored by: The FreeBSD Foundation Added: head/sys/boot/amd64/ head/sys/boot/amd64/Makefile (contents, props changed) head/sys/boot/amd64/Makefile.inc (contents, props changed) head/sys/boot/amd64/efi/ head/sys/boot/amd64/efi/Makefile - copied, changed from r264093, head/sys/boot/i386/efi/Makefile head/sys/boot/amd64/efi/amd64_tramp.S (contents, props changed) head/sys/boot/amd64/efi/autoload.c - copied, changed from r264093, head/sys/boot/i386/efi/autoload.c head/sys/boot/amd64/efi/bootinfo.c (contents, props changed) head/sys/boot/amd64/efi/conf.c - copied, changed from r264093, head/sys/boot/i386/efi/conf.c head/sys/boot/amd64/efi/copy.c (contents, props changed) head/sys/boot/amd64/efi/devicename.c - copied, changed from r264093, head/sys/boot/i386/efi/devicename.c head/sys/boot/amd64/efi/elf64_freebsd.c (contents, props changed) head/sys/boot/amd64/efi/framebuffer.c (contents, props changed) head/sys/boot/amd64/efi/framebuffer.h (contents, props changed) head/sys/boot/amd64/efi/ldscript.amd64 - copied, changed from r264093, head/sys/boot/i386/efi/ldscript.amd64 head/sys/boot/amd64/efi/main.c - copied, changed from r264093, head/sys/boot/i386/efi/main.c head/sys/boot/amd64/efi/reloc.c - copied unchanged from r264093, head/sys/boot/i386/efi/reloc.c head/sys/boot/amd64/efi/start.S (contents, props changed) head/sys/boot/amd64/efi/version - copied unchanged from r264093, head/sys/boot/i386/efi/version head/sys/boot/amd64/efi/x86_efi.h (contents, props changed) head/sys/boot/efi/include/efigop.h (contents, props changed) Deleted: head/sys/boot/i386/efi/Makefile head/sys/boot/i386/efi/autoload.c head/sys/boot/i386/efi/conf.c head/sys/boot/i386/efi/devicename.c head/sys/boot/i386/efi/ldscript.amd64 head/sys/boot/i386/efi/main.c head/sys/boot/i386/efi/reloc.c head/sys/boot/i386/efi/version Modified: head/sys/boot/efi/include/efi.h Added: head/sys/boot/amd64/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/amd64/Makefile Fri Apr 4 00:16:46 2014 (r264095) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +.include + +SUBDIR= efi + +.include Added: head/sys/boot/amd64/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/amd64/Makefile.inc Fri Apr 4 00:16:46 2014 (r264095) @@ -0,0 +1,11 @@ +# Common defines for all of /sys/boot/amd64/ +# +# $FreeBSD$ + +BINDIR?= /boot + +CFLAGS+= -ffreestanding +CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float +LDFLAGS+= -nostdlib + +.include "../Makefile.inc" Copied and modified: head/sys/boot/amd64/efi/Makefile (from r264093, head/sys/boot/i386/efi/Makefile) ============================================================================== --- head/sys/boot/i386/efi/Makefile Thu Apr 3 23:22:04 2014 (r264093, copy source) +++ head/sys/boot/amd64/efi/Makefile Fri Apr 4 00:16:46 2014 (r264095) @@ -1,7 +1,6 @@ # $FreeBSD$ NO_MAN= -BUILDING_EFI= .include MK_SSP= no @@ -13,30 +12,30 @@ INTERNALPROG= SRCS= autoload.c \ bootinfo.c \ conf.c \ + copy.c \ devicename.c \ - efimd.c \ - elf32_freebsd.c \ - exec.c \ - i386_copy.c \ + elf64_freebsd.c \ + framebuffer.c \ main.c \ reloc.c \ vers.c -SRCS+= start.S +SRCS+= amd64_tramp.S \ + start.S +CFLAGS+= -fPIC +CFLAGS+= -I. CFLAGS+= -I${.CURDIR}/../../efi/include -CFLAGS+= -I${.CURDIR}/../../efi/include/i386 +CFLAGS+= -I${.CURDIR}/../../efi/include/${MACHINE_CPUARCH} +CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include +CFLAGS+= -I${.CURDIR}/../../.. .if ${MK_FORTH} != "no" BOOT_FORTH= yes CFLAGS+= -DBOOT_FORTH CFLAGS+= -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/i386 -.if ${MACHINE_CPUARCH} == "amd64" -LIBFICL= ${.OBJDIR}/../../ficl32/libficl.a -.else +CFLAGS+= -I${.CURDIR}/../../ficl/${MACHINE_CPUARCH} LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif -.endif # Include bcache code. HAVE_BCACHE= yes @@ -49,14 +48,14 @@ CFLAGS+= -I${.CURDIR}/../../common FILES= loader.efi FILESMODE_loader.efi= ${BINMODE} -LDSCRIPT= ${.CURDIR}/ldscript.i386 -LDFLAGS= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared +LDSCRIPT= ${.CURDIR}/ldscript.${MACHINE_CPUARCH} +LDFLAGS= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared -Wl,-znocombreloc ${PROG}: ${LDSCRIPT} CLEANFILES= vers.c loader.efi -NEWVERSWHAT= "EFI loader" x86 +NEWVERSWHAT= "EFI loader" ${MACHINE_CPUARCH} vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} @@ -64,28 +63,36 @@ vers.c: ${.CURDIR}/../../common/newvers. OBJCOPY?= objcopy OBJDUMP?= objdump +.if ${MACHINE_CPUARCH} == "amd64" +EFI_TARGET= efi-app-x86_64 +.else +EFI_TARGET= efi-app-ia32 +.endif + loader.efi: loader.sym if [ `${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*' | wc -l` != 0 ]; then \ ${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*'; \ exit 1; \ fi - ${OBJCOPY} -j .data -j .dynamic -j .dynstr -j .dynsym -j .hash \ - -j .rel.dyn -j .reloc -j .sdata -j .text -j set_Xcommand_set \ - --target=efi-app-ia32 ${.ALLSRC} ${.TARGET} + ${OBJCOPY} -j .text -j .sdata -j .data \ + -j .dynamic -j .dynsym -j .rel.dyn \ + -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \ + --target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} LIBEFI= ${.OBJDIR}/../../efi/libefi/libefi.a -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a -CFLAGS+= -I${.CURDIR}/../libi386 -CFLAGS+= -I${.CURDIR}/../btx/lib +CFLAGS+= -I${.CURDIR}/../../common DPADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND} .include -.if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -I. -beforedepend ${OBJS}: machine +beforedepend ${OBJS}: machine x86 + +CLEANFILES+= machine x86 + machine: - ln -sf ${.CURDIR}/../../../i386/include machine -.endif + ln -sf ${.CURDIR}/../../../amd64/include machine + +x86: + ln -sf ${.CURDIR}/../../../x86/include x86 Added: head/sys/boot/amd64/efi/amd64_tramp.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/amd64/efi/amd64_tramp.S Fri Apr 4 00:16:46 2014 (r264095) @@ -0,0 +1,64 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Benno Rice under sponsorship from + * the FreeBSD Foundation. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + + .text + .globl amd64_tramp + +/* + * void amd64_tramp(uint64_t stack, void *copy_finish, uint64_t kernend, + * uint64_t modulep, uint64_t pagetable, uint64_t entry) + */ +amd64_tramp: + cli /* Make sure we don't get interrupted. */ + movq %rdi,%rsp /* Switch to our temporary stack. */ + + movq %rdx,%r12 /* Stash the kernel values for later. */ + movq %rcx,%r13 + movq %r8,%r14 + movq %r9,%r15 + + callq *%rsi /* Call copy_finish so we're all ready to go. */ + + pushq %r12 /* Push kernend. */ + salq $32,%r13 /* Shift modulep and push it. */ + pushq %r13 + pushq %r15 /* Push the entry address. */ + movq %r14,%cr3 /* Switch page tables. */ + ret /* "Return" to kernel entry. */ + + ALIGN_TEXT +amd64_tramp_end: + + .data + .globl amd64_tramp_size +amd64_tramp_size: + .long amd64_tramp_end-amd64_tramp Copied and modified: head/sys/boot/amd64/efi/autoload.c (from r264093, head/sys/boot/i386/efi/autoload.c) ============================================================================== --- head/sys/boot/i386/efi/autoload.c Thu Apr 3 23:22:04 2014 (r264093, copy source) +++ head/sys/boot/amd64/efi/autoload.c Fri Apr 4 00:16:46 2014 (r264095) @@ -28,7 +28,7 @@ __FBSDID("$FreeBSD$"); int -i386_autoload(void) +x86_efi_autoload(void) { return (0); Added: head/sys/boot/amd64/efi/bootinfo.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/amd64/efi/bootinfo.c Fri Apr 4 00:16:46 2014 (r264095) @@ -0,0 +1,360 @@ +/*- + * Copyright (c) 1998 Michael Smith + * Copyright (c) 2004, 2006 Marcel Moolenaar + * Copyright (c) 2014 The FreeBSD Foundation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "bootstrap.h" +#include "framebuffer.h" +#include "x86_efi.h" + +UINTN x86_efi_mapkey; + +static const char howto_switches[] = "aCdrgDmphsv"; +static int howto_masks[] = { + RB_ASKNAME, RB_CDROM, RB_KDB, RB_DFLTROOT, RB_GDB, RB_MULTIPLE, + RB_MUTE, RB_PAUSE, RB_SERIAL, RB_SINGLE, RB_VERBOSE +}; + +static int +bi_getboothowto(char *kargs) +{ + const char *sw; + char *opts; + int howto, i; + + howto = 0; + + /* Get the boot options from the environment first. */ + for (i = 0; howto_names[i].ev != NULL; i++) { + if (getenv(howto_names[i].ev) != NULL) + howto |= howto_names[i].mask; + } + + /* Parse kargs */ + if (kargs == NULL) + return (howto); + + opts = strchr(kargs, '-'); + while (opts != NULL) { + while (*(++opts) != '\0') { + sw = strchr(howto_switches, *opts); + if (sw == NULL) + break; + howto |= howto_masks[sw - howto_switches]; + } + opts = strchr(opts, '-'); + } + + return (howto); +} + +/* + * Copy the environment into the load area starting at (addr). + * Each variable is formatted as =, with a single nul + * separating each variable, and a double nul terminating the environment. + */ +static vm_offset_t +bi_copyenv(vm_offset_t start) +{ + struct env_var *ep; + vm_offset_t addr, last; + size_t len; + + addr = last = start; + + /* Traverse the environment. */ + for (ep = environ; ep != NULL; ep = ep->ev_next) { + len = strlen(ep->ev_name); + if (x86_efi_copyin(ep->ev_name, addr, len) != len) + break; + addr += len; + if (x86_efi_copyin("=", addr, 1) != 1) + break; + addr++; + if (ep->ev_value != NULL) { + len = strlen(ep->ev_value); + if (x86_efi_copyin(ep->ev_value, addr, len) != len) + break; + addr += len; + } + if (x86_efi_copyin("", addr, 1) != 1) + break; + last = ++addr; + } + + if (x86_efi_copyin("", last++, 1) != 1) + last = start; + return(last); +} + +/* + * Copy module-related data into the load area, where it can be + * used as a directory for loaded modules. + * + * Module data is presented in a self-describing format. Each datum + * is preceded by a 32-bit identifier and a 32-bit size field. + * + * Currently, the following data are saved: + * + * MOD_NAME (variable) module name (string) + * MOD_TYPE (variable) module type (string) + * MOD_ARGS (variable) module parameters (string) + * MOD_ADDR sizeof(vm_offset_t) module load address + * MOD_SIZE sizeof(size_t) module size + * MOD_METADATA (variable) type-specific metadata + */ +#define COPY32(v, a, c) { \ + uint32_t x = (v); \ + if (c) \ + x86_efi_copyin(&x, a, sizeof(x)); \ + a += sizeof(x); \ +} + +#define MOD_STR(t, a, s, c) { \ + COPY32(t, a, c); \ + COPY32(strlen(s) + 1, a, c); \ + if (c) \ + x86_efi_copyin(s, a, strlen(s) + 1); \ + a += roundup(strlen(s) + 1, sizeof(uint64_t)); \ +} + +#define MOD_NAME(a, s, c) MOD_STR(MODINFO_NAME, a, s, c) +#define MOD_TYPE(a, s, c) MOD_STR(MODINFO_TYPE, a, s, c) +#define MOD_ARGS(a, s, c) MOD_STR(MODINFO_ARGS, a, s, c) + +#define MOD_VAR(t, a, s, c) { \ + COPY32(t, a, c); \ + COPY32(sizeof(s), a, c); \ + if (c) \ + x86_efi_copyin(&s, a, sizeof(s)); \ + a += roundup(sizeof(s), sizeof(uint64_t)); \ +} + +#define MOD_ADDR(a, s, c) MOD_VAR(MODINFO_ADDR, a, s, c) +#define MOD_SIZE(a, s, c) MOD_VAR(MODINFO_SIZE, a, s, c) + +#define MOD_METADATA(a, mm, c) { \ + COPY32(MODINFO_METADATA | mm->md_type, a, c); \ + COPY32(mm->md_size, a, c); \ + if (c) \ + x86_efi_copyin(mm->md_data, a, mm->md_size); \ + a += roundup(mm->md_size, sizeof(uint64_t)); \ +} + +#define MOD_END(a, c) { \ + COPY32(MODINFO_END, a, c); \ + COPY32(0, a, c); \ +} + +static vm_offset_t +bi_copymodules(vm_offset_t addr) +{ + struct preloaded_file *fp; + struct file_metadata *md; + int c; + uint64_t v; + + c = addr != 0; + /* Start with the first module on the list, should be the kernel. */ + for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) { + MOD_NAME(addr, fp->f_name, c); /* This must come first. */ + MOD_TYPE(addr, fp->f_type, c); + if (fp->f_args) + MOD_ARGS(addr, fp->f_args, c); + v = fp->f_addr; + MOD_ADDR(addr, v, c); + v = fp->f_size; + MOD_SIZE(addr, v, c); + for (md = fp->f_metadata; md != NULL; md = md->md_next) + if (!(md->md_type & MODINFOMD_NOCOPY)) + MOD_METADATA(addr, md, c); + } + MOD_END(addr, c); + return(addr); +} + +static int +bi_load_efi_data(struct preloaded_file *kfp) +{ + EFI_MEMORY_DESCRIPTOR *mm; + EFI_PHYSICAL_ADDRESS addr; + EFI_STATUS status; + size_t efisz; + UINTN mmsz, pages, sz; + UINT32 mmver; + struct efi_map_header *efihdr; + struct efi_fb efifb; + + if (efi_find_framebuffer(&efifb) == 0) + file_addmetadata(kfp, MODINFOMD_EFI_FB, sizeof(efifb), &efifb); + + efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf; + + /* + * Allocate enough pages to hold the bootinfo block and the memory + * map EFI will return to us. The memory map has an unknown size, + * so we have to determine that first. Note that the AllocatePages + * call can itself modify the memory map, so we have to take that + * into account as well. The changes to the memory map are caused + * by splitting a range of free memory into two (AFAICT), so that + * one is marked as being loader data. + */ + sz = 0; + BS->GetMemoryMap(&sz, NULL, &x86_efi_mapkey, &mmsz, &mmver); + sz += mmsz; + sz = (sz + 0xf) & ~0xf; + pages = EFI_SIZE_TO_PAGES(sz + efisz); + status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, pages, + &addr); + if (EFI_ERROR(status)) { + printf("%s: AllocatePages() returned 0x%lx\n", __func__, + (long)status); + return (ENOMEM); + } + + /* + * Read the memory map and stash it after bootinfo. Align the + * memory map on a 16-byte boundary (the bootinfo block is page + * aligned). + */ + efihdr = (struct efi_map_header *)addr; + mm = (void *)((uint8_t *)efihdr + efisz); + sz = (EFI_PAGE_SIZE * pages) - efisz; + status = BS->GetMemoryMap(&sz, mm, &x86_efi_mapkey, &mmsz, &mmver); + if (EFI_ERROR(status)) { + printf("%s: GetMemoryMap() returned 0x%lx\n", __func__, + (long)status); + return (EINVAL); + } + + efihdr->memory_size = sz; + efihdr->descriptor_size = mmsz; + efihdr->descriptor_version = mmver; + + file_addmetadata(kfp, MODINFOMD_EFI_MAP, efisz + sz, efihdr); + + return (0); +} + +/* + * Load the information expected by an amd64 kernel. + * + * - The 'boothowto' argument is constructed. + * - The 'bootdev' argument is constructed. + * - The 'bootinfo' struct is constructed, and copied into the kernel space. + * - The kernel environment is copied into kernel space. + * - Module metadata are formatted and placed in kernel space. + */ +int +bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp) +{ + struct preloaded_file *xp, *kfp; + struct devdesc *rootdev; + struct file_metadata *md; + vm_offset_t addr; + uint64_t kernend; + uint64_t envp; + vm_offset_t size; + char *rootdevname; + int howto; + + howto = bi_getboothowto(args); + + /* + * Allow the environment variable 'rootdev' to override the supplied + * device. This should perhaps go to MI code and/or have $rootdev + * tested/set by MI code before launching the kernel. + */ + rootdevname = getenv("rootdev"); + x86_efi_getdev((void**)(&rootdev), rootdevname, NULL); + if (rootdev == NULL) { + printf("Can't determine root device.\n"); + return(EINVAL); + } + + /* Try reading the /etc/fstab file to select the root device */ + getrootmount(x86_efi_fmtdev((void *)rootdev)); + + addr = 0; + for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) { + if (addr < (xp->f_addr + xp->f_size)) + addr = xp->f_addr + xp->f_size; + } + + /* Pad to a page boundary. */ + addr = roundup(addr, PAGE_SIZE); + + /* Copy our environment. */ + envp = addr; + addr = bi_copyenv(addr); + + /* Pad to a page boundary. */ + addr = roundup(addr, PAGE_SIZE); + + kfp = file_findfile(NULL, "elf kernel"); + if (kfp == NULL) + kfp = file_findfile(NULL, "elf64 kernel"); + if (kfp == NULL) + panic("can't find kernel file"); + kernend = 0; /* fill it in later */ + file_addmetadata(kfp, MODINFOMD_HOWTO, sizeof howto, &howto); + file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); + file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); + + bi_load_efi_data(kfp); + + /* Figure out the size and location of the metadata. */ + *modulep = addr; + size = bi_copymodules(0); + kernend = roundup(addr + size, PAGE_SIZE); + *kernendp = kernend; + + /* patch MODINFOMD_KERNEND */ + md = file_findmetadata(kfp, MODINFOMD_KERNEND); + bcopy(&kernend, md->md_data, sizeof kernend); + + /* Copy module list and metadata. */ + (void)bi_copymodules(addr); + + return (0); +} Copied and modified: head/sys/boot/amd64/efi/conf.c (from r264093, head/sys/boot/i386/efi/conf.c) ============================================================================== --- head/sys/boot/i386/efi/conf.c Thu Apr 3 23:22:04 2014 (r264093, copy source) +++ head/sys/boot/amd64/efi/conf.c Fri Apr 4 00:16:46 2014 (r264095) @@ -52,20 +52,12 @@ struct netif_driver *netif_drivers[] = { NULL }; -#ifdef notyet extern struct file_format amd64_elf; extern struct file_format amd64_elf_obj; -#endif -extern struct file_format i386_elf; -extern struct file_format i386_elf_obj; struct file_format *file_formats[] = { -#ifdef notyet &amd64_elf, &amd64_elf_obj, -#endif - &i386_elf, - &i386_elf_obj, NULL }; Added: head/sys/boot/amd64/efi/copy.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/amd64/efi/copy.c Fri Apr 4 00:16:46 2014 (r264095) @@ -0,0 +1,102 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Benno Rice under sponsorship from + * the FreeBSD Foundation. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include + +#include +#include + +#define STAGE_PAGES 8192 /* 32MB */ + +EFI_PHYSICAL_ADDRESS staging; +int stage_offset_set = 0; +ssize_t stage_offset; + +int +x86_efi_copy_init(void) +{ + EFI_STATUS status; + + status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, + STAGE_PAGES, &staging); + if (EFI_ERROR(status)) { + printf("failed to allocate staging area: %d\n", + status & EFI_ERROR_MASK); + return (status); + } + + return (0); +} + +ssize_t +x86_efi_copyin(const void *src, vm_offset_t dest, const size_t len) +{ + + if (!stage_offset_set) { + stage_offset = (vm_offset_t)staging - dest; + stage_offset_set = 1; + } + + bcopy(src, (void *)(dest + stage_offset), len); + return (len); +} + +ssize_t +x86_efi_copyout(const vm_offset_t src, void *dest, const size_t len) +{ + + bcopy((void *)(src + stage_offset), dest, len); + return (len); +} + + +ssize_t +x86_efi_readin(const int fd, vm_offset_t dest, const size_t len) +{ + + return (read(fd, (void *)(dest + stage_offset), len)); +} + +void +x86_efi_copy_finish(void) +{ + uint64_t *src, *dst, *last; + + src = (uint64_t *)staging; + dst = (uint64_t *)(staging - stage_offset); + last = (uint64_t *)(staging + STAGE_PAGES * EFI_PAGE_SIZE); + + while (src < last) + *dst++ = *src++; +} Copied and modified: head/sys/boot/amd64/efi/devicename.c (from r264093, head/sys/boot/i386/efi/devicename.c) ============================================================================== --- head/sys/boot/i386/efi/devicename.c Thu Apr 3 23:22:04 2014 (r264093, copy source) +++ head/sys/boot/amd64/efi/devicename.c Fri Apr 4 00:16:46 2014 (r264095) @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include -static int i386_parsedev(struct devdesc **, const char *, const char **); +static int x86_efi_parsedev(struct devdesc **, const char *, const char **); /* * Point (dev) at an allocated device specifier for the device matching the @@ -44,7 +44,7 @@ static int i386_parsedev(struct devdesc * use that. If not, use the default device. */ int -i386_getdev(void **vdev, const char *devspec, const char **path) +x86_efi_getdev(void **vdev, const char *devspec, const char **path) { struct devdesc **dev = (struct devdesc **)vdev; int rv; @@ -54,14 +54,14 @@ i386_getdev(void **vdev, const char *dev * use the current device instead. */ if (devspec == NULL || *devspec == '/' || !strchr(devspec, ':')) { - rv = i386_parsedev(dev, getenv("currdev"), NULL); + rv = x86_efi_parsedev(dev, getenv("currdev"), NULL); if (rv == 0 && path != NULL) *path = devspec; return (rv); } /* Parse the device name off the beginning of the devspec. */ - return (i386_parsedev(dev, devspec, path)); + return (x86_efi_parsedev(dev, devspec, path)); } /* @@ -78,7 +78,7 @@ i386_getdev(void **vdev, const char *dev * fs: */ static int -i386_parsedev(struct devdesc **dev, const char *devspec, const char **path) +x86_efi_parsedev(struct devdesc **dev, const char *devspec, const char **path) { struct devdesc *idev; struct devsw *dv; @@ -132,7 +132,7 @@ i386_parsedev(struct devdesc **dev, cons } char * -i386_fmtdev(void *vdev) +x86_efi_fmtdev(void *vdev) { struct devdesc *dev = (struct devdesc *)vdev; static char buf[32]; /* XXX device length constant? */ @@ -154,12 +154,12 @@ i386_fmtdev(void *vdev) * Set currdev to suit the value being supplied in (value) */ int -i386_setcurrdev(struct env_var *ev, int flags, const void *value) +x86_efi_setcurrdev(struct env_var *ev, int flags, const void *value) { struct devdesc *ncurr; int rv; - rv = i386_parsedev(&ncurr, value, NULL); + rv = x86_efi_parsedev(&ncurr, value, NULL); if (rv != 0) return(rv); Added: head/sys/boot/amd64/efi/elf64_freebsd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/amd64/efi/elf64_freebsd.c Fri Apr 4 00:16:46 2014 (r264095) @@ -0,0 +1,189 @@ +/*- + * Copyright (c) 1998 Michael Smith + * Copyright (c) 2014 The FreeBSD Foundation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#define __ELF_WORD_SIZE 64 +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "bootstrap.h" + +#include "platform/acfreebsd.h" +#include "acconfig.h" +#define ACPI_SYSTEM_XFACE +#include "actypes.h" +#include "actbl.h" + +#include "x86_efi.h" + +static EFI_GUID acpi_guid = ACPI_TABLE_GUID; +static EFI_GUID acpi20_guid = ACPI_20_TABLE_GUID; + +extern int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp); + +static int elf64_exec(struct preloaded_file *amp); +static int elf64_obj_exec(struct preloaded_file *amp); + +struct file_format amd64_elf = { elf64_loadfile, elf64_exec }; +struct file_format amd64_elf_obj = { elf64_obj_loadfile, elf64_obj_exec }; + +#define PG_V 0x001 +#define PG_RW 0x002 +#define PG_U 0x004 +#define PG_PS 0x080 + +typedef u_int64_t p4_entry_t; +typedef u_int64_t p3_entry_t; +typedef u_int64_t p2_entry_t; +static p4_entry_t *PT4; +static p3_entry_t *PT3; +static p2_entry_t *PT2; + +static void (*trampoline)(uint64_t stack, void *copy_finish, uint64_t kernend, + uint64_t modulep, p4_entry_t *pagetable, + uint64_t entry); + +extern uintptr_t amd64_tramp; +extern uint32_t amd64_tramp_size; + +/* + * There is an ELF kernel and one or more ELF modules loaded. + * We wish to start executing the kernel image, so make such + * preparations as are required, and do so. + */ +static int +elf64_exec(struct preloaded_file *fp) +{ + struct file_metadata *md; + Elf_Ehdr *ehdr; + vm_offset_t modulep, kernend, trampcode, trampstack; + int err, i; + ACPI_TABLE_RSDP *rsdp; + char buf[24]; + int revision; + EFI_STATUS status; + + rsdp = efi_get_table(&acpi20_guid); + if (rsdp == NULL) { + rsdp = efi_get_table(&acpi_guid); + } + if (rsdp != NULL) { + sprintf(buf, "0x%016llx", rsdp); + setenv("hint.acpi.0.rsdp", buf, 1); + revision = rsdp->Revision; + if (revision == 0) + revision = 1; + sprintf(buf, "%d", revision); + setenv("hint.acpi.0.revision", buf, 1); + strncpy(buf, rsdp->OemId, sizeof(rsdp->OemId)); + buf[sizeof(rsdp->OemId)] = '\0'; + setenv("hint.acpi.0.oem", buf, 1); + sprintf(buf, "0x%016x", rsdp->RsdtPhysicalAddress); + setenv("hint.acpi.0.rsdt", buf, 1); + if (revision >= 2) { + /* XXX extended checksum? */ + sprintf(buf, "0x%016llx", rsdp->XsdtPhysicalAddress); + setenv("hint.acpi.0.xsdt", buf, 1); + sprintf(buf, "%d", rsdp->Length); + setenv("hint.acpi.0.xsdt_length", buf, 1); + } + } + + if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) + return(EFTYPE); + ehdr = (Elf_Ehdr *)&(md->md_data); + + trampcode = (vm_offset_t)0x0000000040000000; + err = BS->AllocatePages(AllocateMaxAddress, EfiLoaderData, 1, + (EFI_PHYSICAL_ADDRESS *)&trampcode); + bzero((void *)trampcode, EFI_PAGE_SIZE); + trampstack = trampcode + EFI_PAGE_SIZE - 8; + bcopy((void *)&amd64_tramp, (void *)trampcode, amd64_tramp_size); + trampoline = (void *)trampcode; + + PT4 = (p4_entry_t *)0x0000000040000000; + err = BS->AllocatePages(AllocateMaxAddress, EfiLoaderData, 3, + (EFI_PHYSICAL_ADDRESS *)&PT4); + bzero(PT4, 3 * EFI_PAGE_SIZE); + + PT3 = &PT4[512]; + PT2 = &PT3[512]; + + /* + * This is kinda brutal, but every single 1GB VM memory segment points + * to the same first 1GB of physical memory. But it is more than + * adequate. + */ + for (i = 0; i < 512; i++) { + /* Each slot of the L4 pages points to the same L3 page. */ + PT4[i] = (p4_entry_t)PT3; + PT4[i] |= PG_V | PG_RW | PG_U; + + /* Each slot of the L3 pages points to the same L2 page. */ + PT3[i] = (p3_entry_t)PT2; + PT3[i] |= PG_V | PG_RW | PG_U; + + /* The L2 page slots are mapped with 2MB pages for 1GB. */ + PT2[i] = i * (2 * 1024 * 1024); + PT2[i] |= PG_V | PG_RW | PG_PS | PG_U; + } + + printf("Start @ 0x%lx ...\n", ehdr->e_entry); + + err = bi_load(fp->f_args, &modulep, &kernend); + if (err != 0) + return(err); + + status = BS->ExitBootServices(IH, x86_efi_mapkey); + if (EFI_ERROR(status)) { + printf("%s: ExitBootServices() returned 0x%lx\n", __func__, + (long)status); + return (EINVAL); + } + + dev_cleanup(); + + trampoline(trampstack, x86_efi_copy_finish, kernend, modulep, PT4, + ehdr->e_entry); + + panic("exec returned"); +} + +static int +elf64_obj_exec(struct preloaded_file *fp) +{ + return (EFTYPE); +} Added: head/sys/boot/amd64/efi/framebuffer.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/amd64/efi/framebuffer.c Fri Apr 4 00:16:46 2014 (r264095) @@ -0,0 +1,85 @@ +/*- + * Copyright (c) 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Benno Rice under sponsorship from + * the FreeBSD Foundation. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 00:59:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46888254; Fri, 4 Apr 2014 00:59:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D10730D; Fri, 4 Apr 2014 00:59:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s340xfiZ090439; Fri, 4 Apr 2014 00:59:41 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s340xeYk090436; Fri, 4 Apr 2014 00:59:40 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404040059.s340xeYk090436@svn.freebsd.org> From: Ian Lepore Date: Fri, 4 Apr 2014 00:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264096 - in head/sys: arm/ti boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 00:59:41 -0000 Author: ian Date: Fri Apr 4 00:59:40 2014 New Revision: 264096 URL: http://svnweb.freebsd.org/changeset/base/264096 Log: Various fixes to the ti_sdhci driver, mostly to make it work on Pandaboard. - Don't allow high-speed mode on OMAP4 due to hardware erratum. - Check the proper bit in the status register when waiting for the controller to come out of reset. - Add handling for the "non-removable" fdt property by always returning "card is present" status. - Add the non-removable property for the MMC card on a Beaglebone Black. - Add the non-removable property for Pandaboard as a workaround. For Pandaboard the card detect pin is handled by the twl6030 fpga device which gets an interrupt on pin change and then has to query the fpga for the actual status. We don't have code to do that yet. Submitted by: Svatopluk Kraus Modified: head/sys/arm/ti/ti_sdhci.c head/sys/boot/fdt/dts/arm/beaglebone-black.dts head/sys/boot/fdt/dts/arm/pandaboard.dts Modified: head/sys/arm/ti/ti_sdhci.c ============================================================================== --- head/sys/arm/ti/ti_sdhci.c Fri Apr 4 00:16:46 2014 (r264095) +++ head/sys/arm/ti/ti_sdhci.c Fri Apr 4 00:59:40 2014 (r264096) @@ -72,6 +72,8 @@ struct ti_sdhci_softc { uint32_t wp_gpio_pin; uint32_t cmd_and_mode; uint32_t sdhci_clkdiv; + boolean_t disable_highspeed; + boolean_t force_card_present; }; /* @@ -105,6 +107,7 @@ static struct ofw_compat_data compat_dat #define MMCHS_SYSCONFIG 0x010 #define MMCHS_SYSCONFIG_RESET (1 << 1) #define MMCHS_SYSSTATUS 0x014 +#define MMCHS_SYSSTATUS_RESETDONE (1 << 0) #define MMCHS_CON 0x02C #define MMCHS_CON_DW8 (1 << 5) #define MMCHS_CON_DVAL_8_4MS (3 << 9) @@ -193,8 +196,24 @@ static uint32_t ti_sdhci_read_4(device_t dev, struct sdhci_slot *slot, bus_size_t off) { struct ti_sdhci_softc *sc = device_get_softc(dev); + uint32_t val32; + + val32 = RD4(sc, off); + + /* + * If we need to disallow highspeed mode due to the OMAP4 erratum, strip + * that flag from the returned capabilities. + */ + if (off == SDHCI_CAPABILITIES && sc->disable_highspeed) + val32 &= ~SDHCI_CAN_DO_HISPD; + + /* + * Force the card-present state if necessary. + */ + if (off == SDHCI_PRESENT_STATE && sc->force_card_present) + val32 |= SDHCI_CARD_PRESENT; - return (RD4(sc, off)); + return (val32); } static void @@ -358,7 +377,7 @@ ti_sdhci_hw_init(device_t dev) /* Issue a softreset to the controller */ ti_mmchs_write_4(sc, MMCHS_SYSCONFIG, MMCHS_SYSCONFIG_RESET); timeout = 1000; - while ((ti_mmchs_read_4(sc, MMCHS_SYSSTATUS) & MMCHS_SYSCONFIG_RESET)) { + while (!(ti_mmchs_read_4(sc, MMCHS_SYSSTATUS) & MMCHS_SYSSTATUS_RESETDONE)) { if (--timeout == 0) { device_printf(dev, "Error: Controller reset operation timed out\n"); break; @@ -458,12 +477,14 @@ ti_sdhci_attach(device_t dev) /* * Set the offset from the device's memory start to the MMCHS registers. + * Also for OMAP4 disable high speed mode due to erratum ID i626. */ if (ti_chip() == CHIP_OMAP_3) sc->mmchs_reg_off = OMAP3_MMCHS_REG_OFFSET; - else if (ti_chip() == CHIP_OMAP_4) + else if (ti_chip() == CHIP_OMAP_4) { sc->mmchs_reg_off = OMAP4_MMCHS_REG_OFFSET; - else if (ti_chip() == CHIP_AM335X) + sc->disable_highspeed = true; + } else if (ti_chip() == CHIP_AM335X) sc->mmchs_reg_off = AM335X_MMCHS_REG_OFFSET; else panic("Unknown OMAP device\n"); @@ -560,6 +581,14 @@ ti_sdhci_attach(device_t dev) } } + /* + * If the slot is flagged with the non-removable property, set our flag + * to always force the SDHCI_CARD_PRESENT bit on. + */ + node = ofw_bus_get_node(dev); + if (OF_hasprop(node, "non-removable")) + sc->force_card_present = true; + bus_generic_probe(dev); bus_generic_attach(dev); Modified: head/sys/boot/fdt/dts/arm/beaglebone-black.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/beaglebone-black.dts Fri Apr 4 00:16:46 2014 (r264095) +++ head/sys/boot/fdt/dts/arm/beaglebone-black.dts Fri Apr 4 00:59:40 2014 (r264096) @@ -142,6 +142,7 @@ mmchs1@481D8000 { bus-width = <8>; status = "okay"; + non-removable; }; Modified: head/sys/boot/fdt/dts/arm/pandaboard.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/pandaboard.dts Fri Apr 4 00:16:46 2014 (r264095) +++ head/sys/boot/fdt/dts/arm/pandaboard.dts Fri Apr 4 00:59:40 2014 (r264096) @@ -174,6 +174,7 @@ interrupts = <115>; interrupt-parent = <&GIC>; mmchs-device-id = <1>; + non-removable; /* XXX need real solution */ }; }; From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 01:10:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E282A594; Fri, 4 Apr 2014 01:10:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDB173F6; Fri, 4 Apr 2014 01:10:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s341A2Hn094708; Fri, 4 Apr 2014 01:10:02 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s341A2i9094707; Fri, 4 Apr 2014 01:10:02 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404040110.s341A2i9094707@svn.freebsd.org> From: Ian Lepore Date: Fri, 4 Apr 2014 01:10:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264097 - head/sys/dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 01:10:03 -0000 Author: ian Date: Fri Apr 4 01:10:02 2014 New Revision: 264097 URL: http://svnweb.freebsd.org/changeset/base/264097 Log: When changing the sd bus clock divisor, clear just the bus clock enable bit before changing the divisor bits in the register. We were writing a zero to the register, which clears the enable, but also cleared the divisor bits at the same time. That's a violation of the sdhci spec, which says the divisor can only be changed when the clock is disabled. This has worked okay on most hardware for years, but the TI OMAP controller would misbehave after changing the divisor improperly. Submitted by: Svatopluk Kraus Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Fri Apr 4 00:59:40 2014 (r264096) +++ head/sys/dev/sdhci/sdhci.c Fri Apr 4 01:10:02 2014 (r264097) @@ -235,7 +235,8 @@ sdhci_set_clock(struct sdhci_slot *slot, slot->clock = clock; /* Turn off the clock. */ - WR2(slot, SDHCI_CLOCK_CONTROL, 0); + clk = RD2(slot, SDHCI_CLOCK_CONTROL); + WR2(slot, SDHCI_CLOCK_CONTROL, clk & ~SDHCI_CLOCK_CARD_EN); /* If no clock requested - left it so. */ if (clock == 0) return; From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 01:48:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F2D0D8C; Fri, 4 Apr 2014 01:48:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AAFE927; Fri, 4 Apr 2014 01:48:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s341mQgb011130; Fri, 4 Apr 2014 01:48:26 GMT (envelope-from grog@svn.freebsd.org) Received: (from grog@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s341mQcl011129; Fri, 4 Apr 2014 01:48:26 GMT (envelope-from grog@svn.freebsd.org) Message-Id: <201404040148.s341mQcl011129@svn.freebsd.org> From: Greg Lehey Date: Fri, 4 Apr 2014 01:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264098 - head/bin/ls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 01:48:26 -0000 Author: grog Date: Fri Apr 4 01:48:25 2014 New Revision: 264098 URL: http://svnweb.freebsd.org/changeset/base/264098 Log: -k option is compliant with POSIX. Modified: head/bin/ls/ls.1 Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Fri Apr 4 01:10:02 2014 (r264097) +++ head/bin/ls/ls.1 Fri Apr 4 01:48:25 2014 (r264098) @@ -254,8 +254,6 @@ This has the same effect as setting envi to 1024, except that it also nullifies any .Fl h options to its left. -This option is not defined in -.St -p1003.1-2001 . .It Fl l (The lowercase letter .Dq ell . ) @@ -817,7 +815,7 @@ the utility conforms to .St -p1003.1-2001 . The options -.Fl B , D , G , I , T , U , W , Z , b , h , k , w , y +.Fl B , D , G , I , T , U , W , Z , b , h , w , y and .Fl , are compatible extensions not defined in From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 03:04:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1BE6988; Fri, 4 Apr 2014 03:04:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 826E5F7F; Fri, 4 Apr 2014 03:04:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3434U2A043612; Fri, 4 Apr 2014 03:04:30 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3434UY0043611; Fri, 4 Apr 2014 03:04:30 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404040304.s3434UY0043611@svn.freebsd.org> From: Ian Lepore Date: Fri, 4 Apr 2014 03:04:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264099 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 03:04:30 -0000 Author: ian Date: Fri Apr 4 03:04:29 2014 New Revision: 264099 URL: http://svnweb.freebsd.org/changeset/base/264099 Log: Fix the logic for translating between MMCHS and SDHCI clock divisors. Submitted by: Svatopluk Kraus Modified: head/sys/arm/ti/ti_sdhci.c Modified: head/sys/arm/ti/ti_sdhci.c ============================================================================== --- head/sys/arm/ti/ti_sdhci.c Fri Apr 4 01:48:25 2014 (r264098) +++ head/sys/arm/ti/ti_sdhci.c Fri Apr 4 03:04:29 2014 (r264099) @@ -111,6 +111,9 @@ static struct ofw_compat_data compat_dat #define MMCHS_CON 0x02C #define MMCHS_CON_DW8 (1 << 5) #define MMCHS_CON_DVAL_8_4MS (3 << 9) +#define MMCHS_SYSCTL 0x12C +#define MMCHS_SYSCTL_CLKD_MASK 0x3FF +#define MMCHS_SYSCTL_CLKD_SHIFT 6 #define MMCHS_SD_CAPA 0x140 #define MMCHS_SD_CAPA_VS18 (1 << 26) #define MMCHS_SD_CAPA_VS30 (1 << 25) @@ -174,9 +177,13 @@ ti_sdhci_read_2(device_t dev, struct sdh */ if (off == SDHCI_CLOCK_CONTROL) { val32 = RD4(sc, SDHCI_CLOCK_CONTROL); - clkdiv = (val32 >> SDHCI_DIVIDER_HI_SHIFT) & 0xff; - val32 &= ~(0xff << SDHCI_DIVIDER_HI_SHIFT); - val32 |= (clkdiv / 2) << SDHCI_DIVIDER_SHIFT; + clkdiv = ((val32 >> MMCHS_SYSCTL_CLKD_SHIFT) & + MMCHS_SYSCTL_CLKD_MASK) / 2; + val32 &= ~(MMCHS_SYSCTL_CLKD_MASK << MMCHS_SYSCTL_CLKD_SHIFT); + val32 |= (clkdiv & SDHCI_DIVIDER_MASK) << SDHCI_DIVIDER_SHIFT; + if (slot->version >= SDHCI_SPEC_300) + val32 |= ((clkdiv >> SDHCI_DIVIDER_MASK_LEN) & + SDHCI_DIVIDER_HI_MASK) << SDHCI_DIVIDER_HI_SHIFT; return (val32 & 0xffff); } @@ -252,10 +259,17 @@ ti_sdhci_write_2(device_t dev, struct sd */ if (off == SDHCI_CLOCK_CONTROL) { clkdiv = (val >> SDHCI_DIVIDER_SHIFT) & SDHCI_DIVIDER_MASK; + if (slot->version >= SDHCI_SPEC_300) + clkdiv |= ((val >> SDHCI_DIVIDER_HI_SHIFT) & + SDHCI_DIVIDER_HI_MASK) << SDHCI_DIVIDER_MASK_LEN; + clkdiv *= 2; + if (clkdiv > MMCHS_SYSCTL_CLKD_MASK) + clkdiv = MMCHS_SYSCTL_CLKD_MASK; val32 = RD4(sc, SDHCI_CLOCK_CONTROL); val32 &= 0xffff0000; - val32 |= val & ~(SDHCI_DIVIDER_MASK << SDHCI_DIVIDER_SHIFT); - val32 |= (clkdiv * 2) << SDHCI_DIVIDER_HI_SHIFT; + val32 |= val & ~(MMCHS_SYSCTL_CLKD_MASK << + MMCHS_SYSCTL_CLKD_SHIFT); + val32 |= clkdiv << MMCHS_SYSCTL_CLKD_SHIFT; WR4(sc, SDHCI_CLOCK_CONTROL, val32); return; } From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 03:11:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EFB7B49; Fri, 4 Apr 2014 03:11:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BCBDFCF; Fri, 4 Apr 2014 03:11:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s343B7QI046821; Fri, 4 Apr 2014 03:11:07 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s343B6X0046815; Fri, 4 Apr 2014 03:11:06 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404040311.s343B6X0046815@svn.freebsd.org> From: Ian Lepore Date: Fri, 4 Apr 2014 03:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264100 - head/sys/arm/ti/omap4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 03:11:07 -0000 Author: ian Date: Fri Apr 4 03:11:06 2014 New Revision: 264100 URL: http://svnweb.freebsd.org/changeset/base/264100 Log: Switch OMAP4 (Pandaboard et. al.) to use the ti_sdhci driver. Modified: head/sys/arm/ti/omap4/files.omap4 Modified: head/sys/arm/ti/omap4/files.omap4 ============================================================================== --- head/sys/arm/ti/omap4/files.omap4 Fri Apr 4 03:04:29 2014 (r264099) +++ head/sys/arm/ti/omap4/files.omap4 Fri Apr 4 03:11:06 2014 (r264100) @@ -7,6 +7,8 @@ arm/ti/ti_smc.S standard arm/ti/usb/omap_ehci.c optional usb ehci arm/ti/ti_sdma.c optional ti_sdma arm/ti/ti_mmchs.c optional mmc +arm/ti/ti_sdhci.c optional sdhci +#arm/ti/ti_mmchs.c optional mmc arm/ti/omap4/omap4_l2cache.c optional pl310 arm/ti/omap4/omap4_prcm_clks.c standard From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 03:24:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D907DBA; Fri, 4 Apr 2014 03:24:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A2D31A3; Fri, 4 Apr 2014 03:24:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s343OJI9052131; Fri, 4 Apr 2014 03:24:19 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s343OJqc052130; Fri, 4 Apr 2014 03:24:19 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404040324.s343OJqc052130@svn.freebsd.org> From: Ian Lepore Date: Fri, 4 Apr 2014 03:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264101 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 03:24:20 -0000 Author: ian Date: Fri Apr 4 03:24:19 2014 New Revision: 264101 URL: http://svnweb.freebsd.org/changeset/base/264101 Log: Use the sdhci driver for Pandaboard. Modified: head/sys/arm/conf/PANDABOARD Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Fri Apr 4 03:11:06 2014 (r264100) +++ head/sys/arm/conf/PANDABOARD Fri Apr 4 03:24:19 2014 (r264101) @@ -76,6 +76,7 @@ options PREEMPTION # MMC/SD/SDIO Card slot support device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards +device sdhci # mmc/sd host controller # I2C support device iicbus From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 03:48:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 143F322D; Fri, 4 Apr 2014 03:48:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00E95356; Fri, 4 Apr 2014 03:48:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s343mheF060780; Fri, 4 Apr 2014 03:48:43 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s343mhaO060779; Fri, 4 Apr 2014 03:48:43 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404040348.s343mhaO060779@svn.freebsd.org> From: Ian Lepore Date: Fri, 4 Apr 2014 03:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264102 - head/sys/arm/ti/omap4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 03:48:44 -0000 Author: ian Date: Fri Apr 4 03:48:43 2014 New Revision: 264102 URL: http://svnweb.freebsd.org/changeset/base/264102 Log: Let's try having just one mmc/sd controller driver. Pointed out by: gjb Modified: head/sys/arm/ti/omap4/files.omap4 Modified: head/sys/arm/ti/omap4/files.omap4 ============================================================================== --- head/sys/arm/ti/omap4/files.omap4 Fri Apr 4 03:24:19 2014 (r264101) +++ head/sys/arm/ti/omap4/files.omap4 Fri Apr 4 03:48:43 2014 (r264102) @@ -6,7 +6,6 @@ arm/ti/ti_smc.S standard arm/ti/usb/omap_ehci.c optional usb ehci arm/ti/ti_sdma.c optional ti_sdma -arm/ti/ti_mmchs.c optional mmc arm/ti/ti_sdhci.c optional sdhci #arm/ti/ti_mmchs.c optional mmc From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 05:05:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C9BC804; Fri, 4 Apr 2014 05:05:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5971EAEA; Fri, 4 Apr 2014 05:05:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3455iOI092768; Fri, 4 Apr 2014 05:05:44 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3455i6K092767; Fri, 4 Apr 2014 05:05:44 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201404040505.s3455i6K092767@svn.freebsd.org> From: Ruslan Bukin Date: Fri, 4 Apr 2014 05:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264103 - head/sys/arm/samsung/exynos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 05:05:44 -0000 Author: br Date: Fri Apr 4 05:05:43 2014 New Revision: 264103 URL: http://svnweb.freebsd.org/changeset/base/264103 Log: Remove unused prototype. Modified: head/sys/arm/samsung/exynos/chrome_kb.c Modified: head/sys/arm/samsung/exynos/chrome_kb.c ============================================================================== --- head/sys/arm/samsung/exynos/chrome_kb.c Fri Apr 4 03:48:43 2014 (r264102) +++ head/sys/arm/samsung/exynos/chrome_kb.c Fri Apr 4 05:05:43 2014 (r264103) @@ -138,7 +138,6 @@ struct ckb_softc { }; /* prototypes */ -static void ckb_set_leds(struct ckb_softc *, uint8_t); static int ckb_set_typematic(keyboard_t *, int); static uint32_t ckb_read_char(keyboard_t *, int); static void ckb_clear_state(keyboard_t *); From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 05:07:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3D78976; Fri, 4 Apr 2014 05:07:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C748AB0B; Fri, 4 Apr 2014 05:07:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3457aVd093025; Fri, 4 Apr 2014 05:07:36 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3457a3G093022; Fri, 4 Apr 2014 05:07:36 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201404040507.s3457a3G093022@svn.freebsd.org> From: Mateusz Guzik Date: Fri, 4 Apr 2014 05:07:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264104 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 05:07:37 -0000 Author: mjg Date: Fri Apr 4 05:07:36 2014 New Revision: 264104 URL: http://svnweb.freebsd.org/changeset/base/264104 Log: Garbage collect fdavail. It rarely returns an error and fdallocn handles the failure of fdalloc just fine. Modified: head/sys/kern/kern_descrip.c head/sys/sys/filedesc.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Apr 4 05:05:43 2014 (r264103) +++ head/sys/kern/kern_descrip.c Fri Apr 4 05:07:36 2014 (r264104) @@ -1650,9 +1650,6 @@ fdallocn(struct thread *td, int minfd, i FILEDESC_XLOCK_ASSERT(fdp); - if (!fdavail(td, n)) - return (EMFILE); - for (i = 0; i < n; i++) if (fdalloc(td, 0, &fds[i]) != 0) break; @@ -1667,35 +1664,6 @@ fdallocn(struct thread *td, int minfd, i } /* - * Check to see whether n user file descriptors are available to the process - * p. - */ -int -fdavail(struct thread *td, int n) -{ - struct proc *p = td->td_proc; - struct filedesc *fdp = td->td_proc->p_fd; - int i, lim, last; - - FILEDESC_LOCK_ASSERT(fdp); - - /* - * XXX: This is only called from uipc_usrreq.c:unp_externalize(); - * call racct_add() from there instead of dealing with containers - * here. - */ - lim = getmaxfd(p); - if ((i = lim - fdp->fd_nfiles) > 0 && (n -= i) <= 0) - return (1); - last = min(fdp->fd_nfiles, lim); - for (i = fdp->fd_freefile; i < last; i++) { - if (fdp->fd_ofiles[i].fde_file == NULL && --n <= 0) - return (1); - } - return (0); -} - -/* * Create a new open file structure and allocate a file decriptor for the * process that refers to it. We add one reference to the file for the * descriptor table and one reference for resultfp. This is to prevent us Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Fri Apr 4 05:05:43 2014 (r264103) +++ head/sys/sys/filedesc.h Fri Apr 4 05:07:36 2014 (r264104) @@ -148,7 +148,6 @@ int finstall(struct thread *td, struct f struct filecaps *fcaps); int fdalloc(struct thread *td, int minfd, int *result); int fdallocn(struct thread *td, int minfd, int *fds, int n); -int fdavail(struct thread *td, int n); int fdcheckstd(struct thread *td); void fdclose(struct filedesc *fdp, struct file *fp, int idx, struct thread *td); void fdcloseexec(struct thread *td); From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 07:02:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B35247DC; Fri, 4 Apr 2014 07:02:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8685661B; Fri, 4 Apr 2014 07:02:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3472dB5041059; Fri, 4 Apr 2014 07:02:39 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3472dcK041057; Fri, 4 Apr 2014 07:02:39 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404040702.s3472dcK041057@svn.freebsd.org> From: Glen Barber Date: Fri, 4 Apr 2014 07:02:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264105 - in head/release: arm tools/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 07:02:39 -0000 Author: gjb Date: Fri Apr 4 07:02:38 2014 New Revision: 264105 URL: http://svnweb.freebsd.org/changeset/base/264105 Log: Merge r262907 from ^/projects/release-embedded: Add ZEDBOARD support for release builds. Sponsored by: The FreeBSD Foundation Added: head/release/arm/ZEDBOARD.conf - copied unchanged from r262907, projects/release-embedded/release/arm/ZEDBOARD.conf head/release/tools/arm/crochet-ZEDBOARD.conf - copied unchanged from r262907, projects/release-embedded/release/tools/arm/crochet-ZEDBOARD.conf Copied: head/release/arm/ZEDBOARD.conf (from r262907, projects/release-embedded/release/arm/ZEDBOARD.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/arm/ZEDBOARD.conf Fri Apr 4 07:02:38 2014 (r264105, copy of r262907, projects/release-embedded/release/arm/ZEDBOARD.conf) @@ -0,0 +1,28 @@ +# +# $FreeBSD$ +# + +# Build chroot configuration +TARGET="amd64" +TARGET_ARCH="amd64" +SVNROOT="svn://svn.FreeBSD.org/" +SRCBRANCH="base/head@rHEAD" +DOCBRANCH="doc/head@rHEAD" +PORTBRANCH="ports/head@rHEAD" +NODOC=yes + +# Build target configuration +# Since this file is sourced by a script that runs another +# script, these must be exported. +set -a +WORLD_FLAGS="-j $(sysctl -n hw.ncpu)" +KERNEL_FLAGS="-j $(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2 ))" +CHROOTDIR="/scratch" +EMBEDDEDBUILD=1 +XDEV="arm" +XDEV_ARCH="armv6" +KERNEL="ZEDBOARD" +CROCHETSRC="https://github.com/kientzle/crochet-freebsd" +CROCHETBRANCH="trunk" +set +a + Copied: head/release/tools/arm/crochet-ZEDBOARD.conf (from r262907, projects/release-embedded/release/tools/arm/crochet-ZEDBOARD.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/tools/arm/crochet-ZEDBOARD.conf Fri Apr 4 07:02:38 2014 (r264105, copy of r262907, projects/release-embedded/release/tools/arm/crochet-ZEDBOARD.conf) @@ -0,0 +1,29 @@ +# +# $FreeBSD$ +# + +# This is the configuration file for use with crochet to produce +# FreeBSD ZedBoard images. + +board_setup ZedBoard +option ImageSize 1gb +option AutoSize + +export MAKEOBJDIRPREFIX=/usr/obj +FREEBSD_SRC=/usr/src +__MAKE_CONF=/dev/null +SRCCONF=/dev/null +WORKDIR=/usr/obj +_BRANCH=$(make -C ${FREEBSD_SRC}/release -V BRANCH) +_REVISION=$(make -C ${FREEBSD_SRC}/release -V REVISION) +KERNCONF=ZEDBOARD +TARGET=arm +TARGET_ARCH=armv6 +FREEBSD_BUILDWORLD_EXTRA_ARGS="${WORLD_FLAGS}" +FREEBSD_BUILDKERNEL_EXTRA_ARGS="${KERNEL_FLAGS}" +FREEBSD_INSTALLWORLD_EXTRA_ARGS="" +FREEBSD_INSTALLKERNEL_EXTRA_ARGS="" +FREEBSD_WORLD_EXTRA_ARGS="" +FREEBSD_KERNEL_EXTRA_ARGS="" +FREEBSD_EXTRA_ARGS="" +IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${TARGET}-${TARGET_ARCH}-${KERNCONF}.img From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 07:42:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90F5EF79; Fri, 4 Apr 2014 07:42:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CCB39B9; Fri, 4 Apr 2014 07:42:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s347gDFl057191; Fri, 4 Apr 2014 07:42:13 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s347gCJd057186; Fri, 4 Apr 2014 07:42:12 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404040742.s347gCJd057186@svn.freebsd.org> From: Glen Barber Date: Fri, 4 Apr 2014 07:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264107 - head/release/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 07:42:13 -0000 Author: gjb Date: Fri Apr 4 07:42:12 2014 New Revision: 264107 URL: http://svnweb.freebsd.org/changeset/base/264107 Log: Merge r262906 from ^/projects/release-embedded: Remove only-works-on-amd64 restriction. Sponsored by: The FreeBSD Foundation Modified: head/release/arm/BEAGLEBONE.conf head/release/arm/PANDABOARD.conf head/release/arm/RPI-B.conf head/release/arm/WANDBOARD-QUAD.conf Modified: head/release/arm/BEAGLEBONE.conf ============================================================================== --- head/release/arm/BEAGLEBONE.conf Fri Apr 4 07:34:46 2014 (r264106) +++ head/release/arm/BEAGLEBONE.conf Fri Apr 4 07:42:12 2014 (r264107) @@ -2,14 +2,6 @@ # $FreeBSD$ # -# This is only supported on amd64 right now. It may work on -# i386, but I do not have the hardware to test, so until I get -# a VM set up to make sure, be cautious and assume it will not. -if [ "$(uname -p)" != "amd64" ] || [ "$(uname -m)" != "amd64" ]; then - echo "This is only supported on amd64 right now." - exit 0 -fi - # Build chroot configuration TARGET="amd64" TARGET_ARCH="amd64" Modified: head/release/arm/PANDABOARD.conf ============================================================================== --- head/release/arm/PANDABOARD.conf Fri Apr 4 07:34:46 2014 (r264106) +++ head/release/arm/PANDABOARD.conf Fri Apr 4 07:42:12 2014 (r264107) @@ -2,14 +2,6 @@ # $FreeBSD$ # -# This is only supported on amd64 right now. It may work on -# i386, but I do not have the hardware to test, so until I get -# a VM set up to make sure, be cautious and assume it will not. -if [ "$(uname -p)" != "amd64" ] || [ "$(uname -m)" != "amd64" ]; then - echo "This is only supported on amd64 right now." - exit 0 -fi - # Build chroot configuration TARGET="amd64" TARGET_ARCH="amd64" Modified: head/release/arm/RPI-B.conf ============================================================================== --- head/release/arm/RPI-B.conf Fri Apr 4 07:34:46 2014 (r264106) +++ head/release/arm/RPI-B.conf Fri Apr 4 07:42:12 2014 (r264107) @@ -2,14 +2,6 @@ # $FreeBSD$ # -# This is only supported on amd64 right now. It may work on -# i386, but I do not have the hardware to test, so until I get -# a VM set up to make sure, be cautious and assume it will not. -if [ "$(uname -p)" != "amd64" ] || [ "$(uname -m)" != "amd64" ]; then - echo "This is only supported on amd64 right now." - exit 0 -fi - # Build chroot configuration TARGET="amd64" TARGET_ARCH="amd64" Modified: head/release/arm/WANDBOARD-QUAD.conf ============================================================================== --- head/release/arm/WANDBOARD-QUAD.conf Fri Apr 4 07:34:46 2014 (r264106) +++ head/release/arm/WANDBOARD-QUAD.conf Fri Apr 4 07:42:12 2014 (r264107) @@ -2,14 +2,6 @@ # $FreeBSD$ # -# This is only supported on amd64 right now. It may work on -# i386, but I do not have the hardware to test, so until I get -# a VM set up to make sure, be cautious and assume it will not. -if [ "$(uname -p)" != "amd64" ] || [ "$(uname -m)" != "amd64" ]; then - echo "This is only supported on amd64 right now." - exit 0 -fi - # Build chroot configuration TARGET="amd64" TARGET_ARCH="amd64" From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 08:43:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F4A42B2; Fri, 4 Apr 2014 08:43:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C2B0F1C; Fri, 4 Apr 2014 08:43:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s348hOZq082082; Fri, 4 Apr 2014 08:43:24 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s348hO79082078; Fri, 4 Apr 2014 08:43:24 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404040843.s348hO79082078@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 4 Apr 2014 08:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264109 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 08:43:25 -0000 Author: trasz Date: Fri Apr 4 08:43:23 2014 New Revision: 264109 URL: http://svnweb.freebsd.org/changeset/base/264109 Log: We don't need TAILQ for iSCSI PDUs; STAILQ is enough. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.c head/sys/dev/iscsi/icl.h head/sys/dev/iscsi/iscsi.c head/sys/dev/iscsi/iscsi.h Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Fri Apr 4 07:43:11 2014 (r264108) +++ head/sys/dev/iscsi/icl.c Fri Apr 4 08:43:23 2014 (r264109) @@ -854,11 +854,11 @@ icl_conn_send_pdus(struct icl_conn *ic) available = sbspace(&so->so_snd); SOCKBUF_UNLOCK(&so->so_snd); - while (!TAILQ_EMPTY(&ic->ic_to_send)) { + while (!STAILQ_EMPTY(&ic->ic_to_send)) { if (ic->ic_disconnecting) return; - request = TAILQ_FIRST(&ic->ic_to_send); + request = STAILQ_FIRST(&ic->ic_to_send); size = icl_pdu_size(request); if (available < size) { /* @@ -877,7 +877,7 @@ icl_conn_send_pdus(struct icl_conn *ic) return; } available -= size; - TAILQ_REMOVE(&ic->ic_to_send, request, ip_next); + STAILQ_REMOVE_HEAD(&ic->ic_to_send, ip_next); error = icl_pdu_send(request); if (error != 0) { ICL_DEBUG("failed to send PDU; " @@ -977,7 +977,7 @@ icl_pdu_queue(struct icl_pdu *ip) icl_pdu_free(ip); return; } - TAILQ_INSERT_TAIL(&ic->ic_to_send, ip, ip_next); + STAILQ_INSERT_TAIL(&ic->ic_to_send, ip, ip_next); cv_signal(&ic->ic_send_cv); } @@ -990,7 +990,7 @@ icl_conn_new(const char *name, struct mt ic = uma_zalloc(icl_conn_zone, M_WAITOK | M_ZERO); - TAILQ_INIT(&ic->ic_to_send); + STAILQ_INIT(&ic->ic_to_send); ic->ic_lock = lock; cv_init(&ic->ic_send_cv, "icl_tx"); cv_init(&ic->ic_receive_cv, "icl_rx"); @@ -1217,13 +1217,13 @@ icl_conn_close(struct icl_conn *ic) /* * Remove any outstanding PDUs from the send queue. */ - while (!TAILQ_EMPTY(&ic->ic_to_send)) { - pdu = TAILQ_FIRST(&ic->ic_to_send); - TAILQ_REMOVE(&ic->ic_to_send, pdu, ip_next); + while (!STAILQ_EMPTY(&ic->ic_to_send)) { + pdu = STAILQ_FIRST(&ic->ic_to_send); + STAILQ_REMOVE_HEAD(&ic->ic_to_send, ip_next); icl_pdu_free(pdu); } - KASSERT(TAILQ_EMPTY(&ic->ic_to_send), + KASSERT(STAILQ_EMPTY(&ic->ic_to_send), ("destroying session with non-empty send queue")); #ifdef DIAGNOSTIC KASSERT(ic->ic_outstanding_pdus == 0, Modified: head/sys/dev/iscsi/icl.h ============================================================================== --- head/sys/dev/iscsi/icl.h Fri Apr 4 07:43:11 2014 (r264108) +++ head/sys/dev/iscsi/icl.h Fri Apr 4 08:43:23 2014 (r264109) @@ -40,7 +40,7 @@ struct icl_conn; struct icl_pdu { - TAILQ_ENTRY(icl_pdu) ip_next; + STAILQ_ENTRY(icl_pdu) ip_next; struct icl_conn *ip_conn; struct iscsi_bhs *ip_bhs; struct mbuf *ip_bhs_mbuf; @@ -79,7 +79,7 @@ struct icl_conn { #ifdef DIAGNOSTIC volatile u_int ic_outstanding_pdus; #endif - TAILQ_HEAD(, icl_pdu) ic_to_send; + STAILQ_HEAD(, icl_pdu) ic_to_send; size_t ic_receive_len; int ic_receive_state; struct icl_pdu *ic_receive_pdu; Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Fri Apr 4 07:43:11 2014 (r264108) +++ head/sys/dev/iscsi/iscsi.c Fri Apr 4 08:43:23 2014 (r264109) @@ -217,12 +217,12 @@ iscsi_session_send_postponed(struct iscs ISCSI_SESSION_LOCK_ASSERT(is); - while (!TAILQ_EMPTY(&is->is_postponed)) { - request = TAILQ_FIRST(&is->is_postponed); + while (!STAILQ_EMPTY(&is->is_postponed)) { + request = STAILQ_FIRST(&is->is_postponed); postpone = iscsi_pdu_prepare(request); if (postpone) break; - TAILQ_REMOVE(&is->is_postponed, request, ip_next); + STAILQ_REMOVE_HEAD(&is->is_postponed, ip_next); icl_pdu_queue(request); } } @@ -238,7 +238,7 @@ iscsi_pdu_queue_locked(struct icl_pdu *r iscsi_session_send_postponed(is); postpone = iscsi_pdu_prepare(request); if (postpone) { - TAILQ_INSERT_TAIL(&is->is_postponed, request, ip_next); + STAILQ_INSERT_TAIL(&is->is_postponed, request, ip_next); return; } icl_pdu_queue(request); @@ -326,9 +326,9 @@ iscsi_maintenance_thread_reconnect(struc /* * Remove postponed PDUs. */ - while (!TAILQ_EMPTY(&is->is_postponed)) { - pdu = TAILQ_FIRST(&is->is_postponed); - TAILQ_REMOVE(&is->is_postponed, pdu, ip_next); + while (!STAILQ_EMPTY(&is->is_postponed)) { + pdu = STAILQ_FIRST(&is->is_postponed); + STAILQ_REMOVE_HEAD(&is->is_postponed, ip_next); icl_pdu_free(pdu); } @@ -340,7 +340,7 @@ iscsi_maintenance_thread_reconnect(struc KASSERT(TAILQ_EMPTY(&is->is_outstanding), ("destroying session with active tasks")); - KASSERT(TAILQ_EMPTY(&is->is_postponed), + KASSERT(STAILQ_EMPTY(&is->is_postponed), ("destroying session with postponed PDUs")); /* @@ -395,9 +395,9 @@ iscsi_maintenance_thread_terminate(struc /* * Remove postponed PDUs. */ - while (!TAILQ_EMPTY(&is->is_postponed)) { - pdu = TAILQ_FIRST(&is->is_postponed); - TAILQ_REMOVE(&is->is_postponed, pdu, ip_next); + while (!STAILQ_EMPTY(&is->is_postponed)) { + pdu = STAILQ_FIRST(&is->is_postponed); + STAILQ_REMOVE_HEAD(&is->is_postponed, ip_next); icl_pdu_free(pdu); } @@ -427,7 +427,7 @@ iscsi_maintenance_thread_terminate(struc KASSERT(TAILQ_EMPTY(&is->is_outstanding), ("destroying session with active tasks")); - KASSERT(TAILQ_EMPTY(&is->is_postponed), + KASSERT(STAILQ_EMPTY(&is->is_postponed), ("destroying session with postponed PDUs")); ISCSI_SESSION_UNLOCK(is); @@ -458,7 +458,7 @@ iscsi_maintenance_thread(void *arg) ISCSI_SESSION_LOCK(is); if (is->is_reconnecting == false && is->is_terminating == false && - TAILQ_EMPTY(&is->is_postponed)) + STAILQ_EMPTY(&is->is_postponed)) cv_wait(&is->is_maintenance_cv, &is->is_lock); if (is->is_reconnecting) { @@ -636,7 +636,7 @@ iscsi_pdu_update_statsn(const struct icl * Command window increased; kick the maintanance thread * to send out postponed commands. */ - if (!TAILQ_EMPTY(&is->is_postponed)) + if (!STAILQ_EMPTY(&is->is_postponed)) cv_signal(&is->is_maintenance_cv); } else if (maxcmdsn < is->is_maxcmdsn) { ISCSI_SESSION_DEBUG(is, "PDU MaxCmdSN %d < session MaxCmdSN %d; ignoring", @@ -1646,7 +1646,7 @@ iscsi_ioctl_session_add(struct iscsi_sof is->is_conn->ic_error = iscsi_error_callback; is->is_conn->ic_prv0 = is; TAILQ_INIT(&is->is_outstanding); - TAILQ_INIT(&is->is_postponed); + STAILQ_INIT(&is->is_postponed); mtx_init(&is->is_lock, "iscsi_lock", NULL, MTX_DEF); cv_init(&is->is_maintenance_cv, "iscsi_mt"); #ifdef ICL_KERNEL_PROXY Modified: head/sys/dev/iscsi/iscsi.h ============================================================================== --- head/sys/dev/iscsi/iscsi.h Fri Apr 4 07:43:11 2014 (r264108) +++ head/sys/dev/iscsi/iscsi.h Fri Apr 4 08:43:23 2014 (r264109) @@ -69,7 +69,7 @@ struct iscsi_session { char is_target_alias[ISCSI_ALIAS_LEN]; TAILQ_HEAD(, iscsi_outstanding) is_outstanding; - TAILQ_HEAD(, icl_pdu) is_postponed; + STAILQ_HEAD(, icl_pdu) is_postponed; struct callout is_callout; unsigned int is_timeout; From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 08:48:44 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B89EB452; Fri, 4 Apr 2014 08:48:44 +0000 (UTC) Received: from jenni2.inet.fi (mta-out.inet.fi [195.156.147.13]) by mx1.freebsd.org (Postfix) with ESMTP id 7BB8AF55; Fri, 4 Apr 2014 08:48:43 +0000 (UTC) Received: from jh (84.250.14.206) by jenni2.inet.fi (8.5.140.03) (authenticated as heinja-g6) id 52775C990CA8FD50; Fri, 4 Apr 2014 11:47:53 +0300 Date: Fri, 4 Apr 2014 11:47:51 +0300 From: Jaakko Heinonen To: Greg Lehey Subject: Re: svn commit: r264066 - head/bin/ls Message-ID: <20140404084750.GB1012@jh> References: <201404030549.s335nSaO093672@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201404030549.s335nSaO093672@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 08:48:44 -0000 Hi, On 2014-04-03, Greg Lehey wrote: > Add information on standards compliance of many options. -n and -A are in POSIX.1-2008. Please see this PR: http://www.freebsd.org/cgi/query-pr.cgi?pr=docs/140435 -- Jaakko From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 08:48:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0285B598; Fri, 4 Apr 2014 08:48:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D72A7F5B; Fri, 4 Apr 2014 08:48:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s348mujB082796; Fri, 4 Apr 2014 08:48:56 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s348mu7L082793; Fri, 4 Apr 2014 08:48:56 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404040848.s348mu7L082793@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 4 Apr 2014 08:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264110 - in head/sys: cam/ctl dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 08:48:57 -0000 Author: trasz Date: Fri Apr 4 08:48:55 2014 New Revision: 264110 URL: http://svnweb.freebsd.org/changeset/base/264110 Log: All the iSCSI sysctls are also tunables; advertise that. Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/dev/iscsi/icl.c head/sys/dev/iscsi/iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Fri Apr 4 08:43:23 2014 (r264109) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Fri Apr 4 08:48:55 2014 (r264110) @@ -82,19 +82,19 @@ SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, isc "CAM Target Layer iSCSI Frontend"); static int debug = 3; TUNABLE_INT("kern.cam.ctl.iscsi.debug", &debug); -SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, debug, CTLFLAG_RWTUN, &debug, 1, "Enable debug messages"); static int ping_timeout = 5; TUNABLE_INT("kern.cam.ctl.iscsi.ping_timeout", &ping_timeout); -SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, ping_timeout, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, ping_timeout, CTLFLAG_RWTUN, &ping_timeout, 5, "Interval between ping (NOP-Out) requests, in seconds"); static int login_timeout = 60; TUNABLE_INT("kern.cam.ctl.iscsi.login_timeout", &login_timeout); -SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, login_timeout, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, login_timeout, CTLFLAG_RWTUN, &login_timeout, 60, "Time to wait for ctld(8) to finish Login Phase, in seconds"); static int maxcmdsn_delta = 256; TUNABLE_INT("kern.cam.ctl.iscsi.maxcmdsn_delta", &maxcmdsn_delta); -SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, maxcmdsn_delta, CTLFLAG_RW, +SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, maxcmdsn_delta, CTLFLAG_RWTUN, &maxcmdsn_delta, 256, "Number of commands the initiator can send " "without confirmation"); Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Fri Apr 4 08:43:23 2014 (r264109) +++ head/sys/dev/iscsi/icl.c Fri Apr 4 08:48:55 2014 (r264110) @@ -61,20 +61,20 @@ SYSCTL_NODE(_kern, OID_AUTO, icl, CTLFLAG_RD, 0, "iSCSI Common Layer"); static int debug = 1; TUNABLE_INT("kern.icl.debug", &debug); -SYSCTL_INT(_kern_icl, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_kern_icl, OID_AUTO, debug, CTLFLAG_RWTUN, &debug, 1, "Enable debug messages"); static int partial_receive_len = 1 * 1024; /* XXX: More? */ TUNABLE_INT("kern.icl.partial_receive_len", &partial_receive_len); -SYSCTL_INT(_kern_icl, OID_AUTO, partial_receive_len, CTLFLAG_RW, +SYSCTL_INT(_kern_icl, OID_AUTO, partial_receive_len, CTLFLAG_RWTUN, &partial_receive_len, 1 * 1024, "Minimum read size for partially received " "data segment"); static int sendspace = 1048576; TUNABLE_INT("kern.icl.sendspace", &sendspace); -SYSCTL_INT(_kern_icl, OID_AUTO, sendspace, CTLFLAG_RW, +SYSCTL_INT(_kern_icl, OID_AUTO, sendspace, CTLFLAG_RWTUN, &sendspace, 1048576, "Default send socket buffer size"); static int recvspace = 1048576; TUNABLE_INT("kern.icl.recvspace", &recvspace); -SYSCTL_INT(_kern_icl, OID_AUTO, recvspace, CTLFLAG_RW, +SYSCTL_INT(_kern_icl, OID_AUTO, recvspace, CTLFLAG_RWTUN, &recvspace, 1048576, "Default receive socket buffer size"); static uma_zone_t icl_conn_zone; Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Fri Apr 4 08:43:23 2014 (r264109) +++ head/sys/dev/iscsi/iscsi.c Fri Apr 4 08:48:55 2014 (r264110) @@ -75,23 +75,23 @@ static struct iscsi_softc *sc; SYSCTL_NODE(_kern, OID_AUTO, iscsi, CTLFLAG_RD, 0, "iSCSI initiator"); static int debug = 1; TUNABLE_INT("kern.iscsi.debug", &debug); -SYSCTL_INT(_kern_iscsi, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_kern_iscsi, OID_AUTO, debug, CTLFLAG_RWTUN, &debug, 2, "Enable debug messages"); static int ping_timeout = 5; TUNABLE_INT("kern.iscsi.ping_timeout", &ping_timeout); -SYSCTL_INT(_kern_iscsi, OID_AUTO, ping_timeout, CTLFLAG_RW, &ping_timeout, +SYSCTL_INT(_kern_iscsi, OID_AUTO, ping_timeout, CTLFLAG_RWTUN, &ping_timeout, 5, "Timeout for ping (NOP-Out) requests, in seconds"); static int iscsid_timeout = 60; TUNABLE_INT("kern.iscsi.iscsid_timeout", &iscsid_timeout); -SYSCTL_INT(_kern_iscsi, OID_AUTO, iscsid_timeout, CTLFLAG_RW, &iscsid_timeout, +SYSCTL_INT(_kern_iscsi, OID_AUTO, iscsid_timeout, CTLFLAG_RWTUN, &iscsid_timeout, 60, "Time to wait for iscsid(8) to handle reconnection, in seconds"); static int login_timeout = 60; TUNABLE_INT("kern.iscsi.login_timeout", &login_timeout); -SYSCTL_INT(_kern_iscsi, OID_AUTO, login_timeout, CTLFLAG_RW, &login_timeout, +SYSCTL_INT(_kern_iscsi, OID_AUTO, login_timeout, CTLFLAG_RWTUN, &login_timeout, 60, "Time to wait for iscsid(8) to finish Login Phase, in seconds"); static int maxtags = 255; TUNABLE_INT("kern.iscsi.maxtags", &maxtags); -SYSCTL_INT(_kern_iscsi, OID_AUTO, maxtags, CTLFLAG_RW, &maxtags, +SYSCTL_INT(_kern_iscsi, OID_AUTO, maxtags, CTLFLAG_RWTUN, &maxtags, 255, "Max number of IO requests queued"); static MALLOC_DEFINE(M_ISCSI, "iSCSI", "iSCSI initiator"); From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 11:53:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CCF4DAC0; Fri, 4 Apr 2014 11:53:22 +0000 (UTC) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5C4B27E; Fri, 4 Apr 2014 11:53:21 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id d1so1085186wiv.13 for ; Fri, 04 Apr 2014 04:53:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=4mhnwdM6Thxt1Jm5AsmgE/eggdkeb+VKbaQw9nG4WCQ=; b=ehhSy21UDlfcLMPzPzQM7Of3eheCalZUTQ4MbO2FmcYViZB0422OIaQCBNiHIuqT+8 EK83ULg3PPnKcgAJzlS3+j87IQb+dIPUgZzpu1u7sYDCVvrWhYpOaTvuu8azR3eXEDHr TuyAYWo/Ov05OYrqGzdS9y8nCrSW/9U3BxQdqFJ8gvEX4zn+lZT+RyP5l3UAj0f9vS50 ZaFBt2C1WsNQRtMVlN0QEz/QiwxfAkfhN6fOQqDtOJvgWu90OzmuiG49+ET7V9wRTkey iidMXeFnwVezLNuc5VJWfMHiij93LhwEuvqwOysDOoXEpBh5D08Of/8c7jbWPd6L0fx0 /PVA== X-Received: by 10.180.91.164 with SMTP id cf4mr3856582wib.37.1396612400265; Fri, 04 Apr 2014 04:53:20 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id q2sm4234283wix.5.2014.04.04.04.53.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Apr 2014 04:53:19 -0700 (PDT) Sender: Baptiste Daroussin Date: Fri, 4 Apr 2014 13:52:56 +0200 From: Baptiste Daroussin To: David Chisnall Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib Message-ID: <20140404115256.GA85137@ivaldir.etoilebsd.net> References: <201404021607.s32G7mhw051355@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dDRMvlgZJXvWKvBx" Content-Disposition: inline In-Reply-To: <201404021607.s32G7mhw051355@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 11:53:22 -0000 --dDRMvlgZJXvWKvBx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 02, 2014 at 04:07:48PM +0000, David Chisnall wrote: > Author: theraven > Date: Wed Apr 2 16:07:48 2014 > New Revision: 264042 > URL: http://svnweb.freebsd.org/changeset/base/264042 >=20 > Log: > Add support for some block functions that come from OS X. These are > intended to build with any C compiler. > =20 > Reviewed by: pfg > MFC after: 3 weeks This breaks a couple of ports starting with cups, those ports do expect libdispatch to be available if _BLOCK_ exists. Do you plan to import libdispatch soon? regards, Bapt --dDRMvlgZJXvWKvBx Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iEYEARECAAYFAlM+nRgACgkQ8kTtMUmk6ExecwCeK8Fo4nNof5gaRRZsXNTlR/U8 NqwAn2ca7MEZudaPU7S9au0onXUjk4fE =7YV5 -----END PGP SIGNATURE----- --dDRMvlgZJXvWKvBx-- From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 11:59:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88E0BE40; Fri, 4 Apr 2014 11:59:16 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "theravensnest.org", Issuer "theravensnest.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 50E2D2EE; Fri, 4 Apr 2014 11:59:15 +0000 (UTC) Received: from [192.168.0.100] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s34BxBeH072575 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 4 Apr 2014 11:59:13 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib From: David Chisnall In-Reply-To: <20140404115256.GA85137@ivaldir.etoilebsd.net> Date: Fri, 4 Apr 2014 12:59:07 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140404115256.GA85137@ivaldir.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 11:59:16 -0000 On 4 Apr 2014, at 12:52, Baptiste Daroussin wrote: > On Wed, Apr 02, 2014 at 04:07:48PM +0000, David Chisnall wrote: >> Author: theraven >> Date: Wed Apr 2 16:07:48 2014 >> New Revision: 264042 >> URL: http://svnweb.freebsd.org/changeset/base/264042 >>=20 >> Log: >> Add support for some block functions that come from OS X. These are >> intended to build with any C compiler. >>=20 >> Reviewed by: pfg >> MFC after: 3 weeks >=20 > This breaks a couple of ports starting with cups, those ports do = expect > libdispatch to be available if _BLOCK_ exists. Do you plan to import > libdispatch soon? __BLOCKS__ is a compiler predefine, which this doesn't change - it just = exposes some other functions *if* __BLOCKS__ is defined. I'm not sure = what _BLOCK_ is - is it something that their configure script is = defining? We do currently have some inconsistency in the base system, because gcc = defaults to -fblocks, whereas clang defaults to -fno-blocks on FreeBSD. = This means that __BLOCKS__ is defined when building with gcc from base, = but with clang from base or gcc from ports, but that's independent of = this change. I believe that libdispatch most likely won't be imported until there is = an in-tree consumer, but it's in ports and there's nothing stopping = ports depending on it if they want to use it... David From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 12:10:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF160503; Fri, 4 Apr 2014 12:10:33 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "theravensnest.org", Issuer "theravensnest.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8840561B; Fri, 4 Apr 2014 12:10:33 +0000 (UTC) Received: from [192.168.0.100] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s34CAS8k072648 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 4 Apr 2014 12:10:30 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib From: David Chisnall In-Reply-To: <20140404115256.GA85137@ivaldir.etoilebsd.net> Date: Fri, 4 Apr 2014 13:10:24 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <384FF99D-A2CC-4744-8FBB-251773EA0B3C@FreeBSD.org> References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140404115256.GA85137@ivaldir.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 12:10:33 -0000 On 4 Apr 2014, at 12:52, Baptiste Daroussin wrote: > This breaks a couple of ports starting with cups, those ports do = expect > libdispatch to be available if _BLOCK_ exists. Do you plan to import > libdispatch soon? I've just tried building the print/cups-client port and it builds = correctly for me with base-clang, base-gcc, and ports-gcc47. Can you = provide any more steps to reproduce? David From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 12:14:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F3AC877; Fri, 4 Apr 2014 12:14:35 +0000 (UTC) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 989DD6D8; Fri, 4 Apr 2014 12:14:34 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id bs8so2518925wib.1 for ; Fri, 04 Apr 2014 05:14:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=KueJmZVRQUQn39SLljSQAsksE4G3GonYSf1iJ7fFW5k=; b=dQL/MZhJHEymmwWdwQcOneB+OenMB1Bf+bLgnXS2p/AJA/gu6+84gb3SzZw37zy482 i0e2hGFaZzZvHvzJbh4L3ukmPOAGqo/Qo8FF9BhR5FdIaFX4uD05BzfUtuyUFQTrNO4n bC55W7T5EHjJe5W7okMQQVo1v8Nxh+/ptyfJG3HLRlr4/s8Re7HgOd33X9+3qNQHJeQH p/hVI+eNjBY2lIPFAvKrORQQ6OOW3bCbQxpkvj9dmwz9PCAVVKTNF1BfSUS5sv3w6T5M YJaP5i7gvEVIlrN1mVZHJsq2QICRqpX5LV4m3ycNkio36r0GOg3nHdxRAHmOneQK3MO7 mUCg== X-Received: by 10.194.174.197 with SMTP id bu5mr18842465wjc.71.1396613672879; Fri, 04 Apr 2014 05:14:32 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id h19sm4323309wiw.17.2014.04.04.05.14.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Apr 2014 05:14:32 -0700 (PDT) Sender: Baptiste Daroussin Date: Fri, 4 Apr 2014 14:14:30 +0200 From: Baptiste Daroussin To: David Chisnall Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib Message-ID: <20140404121429.GD85325@ivaldir.etoilebsd.net> References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140404115256.GA85137@ivaldir.etoilebsd.net> <384FF99D-A2CC-4744-8FBB-251773EA0B3C@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tNQTSEo8WG/FKZ8E" Content-Disposition: inline In-Reply-To: <384FF99D-A2CC-4744-8FBB-251773EA0B3C@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 12:14:35 -0000 --tNQTSEo8WG/FKZ8E Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 04, 2014 at 01:10:24PM +0100, David Chisnall wrote: > On 4 Apr 2014, at 12:52, Baptiste Daroussin wrote: >=20 > > This breaks a couple of ports starting with cups, those ports do expect > > libdispatch to be available if _BLOCK_ exists. Do you plan to import > > libdispatch soon? >=20 > I've just tried building the print/cups-client port and it builds correct= ly for me with base-clang, base-gcc, and ports-gcc47. Can you provide any = more steps to reproduce? >=20 > David >=20 I have CCed you about this case regards, Bapt --tNQTSEo8WG/FKZ8E Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iEYEARECAAYFAlM+oiUACgkQ8kTtMUmk6EzSGQCePGKFRzx7R4l+vMMcjGYKcyKA 4ocAoJvFwslL61yKhkocpCYY20cDFLjG =bO3M -----END PGP SIGNATURE----- --tNQTSEo8WG/FKZ8E-- From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 12:16:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FF989CE; Fri, 4 Apr 2014 12:16:00 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "theravensnest.org", Issuer "theravensnest.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DA67B6EE; Fri, 4 Apr 2014 12:15:59 +0000 (UTC) Received: from [192.168.0.100] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s34CFtbN072699 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 4 Apr 2014 12:15:57 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib From: David Chisnall In-Reply-To: <20140404121429.GD85325@ivaldir.etoilebsd.net> Date: Fri, 4 Apr 2014 13:15:51 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140404115256.GA85137@ivaldir.etoilebsd.net> <384FF99D-A2CC-4744-8FBB-251773EA0B3C@FreeBSD.org> <20140404121429.GD85325@ivaldir.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 12:16:00 -0000 On 4 Apr 2014, at 13:14, Baptiste Daroussin wrote: > On Fri, Apr 04, 2014 at 01:10:24PM +0100, David Chisnall wrote: >> On 4 Apr 2014, at 12:52, Baptiste Daroussin wrote: >>=20 >>> This breaks a couple of ports starting with cups, those ports do = expect >>> libdispatch to be available if _BLOCK_ exists. Do you plan to import >>> libdispatch soon? >>=20 >> I've just tried building the print/cups-client port and it builds = correctly for me with base-clang, base-gcc, and ports-gcc47. Can you = provide any more steps to reproduce? >>=20 >> David >>=20 > I have CCed you about this case Thanks. It looks like it's unrelated to this commit, but due to the = earlier addition of blocks support to base-gcc. David From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 12:24:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FA83BC8; Fri, 4 Apr 2014 12:24:10 +0000 (UTC) Received: from mail.iXsystems.com (newknight.ixsystems.com [206.40.55.70]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B72847FE; Fri, 4 Apr 2014 12:24:09 +0000 (UTC) Received: from localhost (mail.ixsystems.com [10.2.55.1]) by mail.iXsystems.com (Postfix) with ESMTP id 3C06B735E8; Fri, 4 Apr 2014 05:24:09 -0700 (PDT) Received: from mail.iXsystems.com ([10.2.55.1]) by localhost (mail.ixsystems.com [10.2.55.1]) (maiad, port 10024) with ESMTP id 88788-08; Fri, 4 Apr 2014 05:24:09 -0700 (PDT) Received: from [192.168.3.175] (unknown [124.195.210.70]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.iXsystems.com (Postfix) with ESMTPSA id CCD3C735E2; Fri, 4 Apr 2014 05:24:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ixsystems.com; s=newknight0; t=1396614248; bh=VWy2a38d8raAOTaPSJm2ijZ+UPUpanJMPEiQl8Ifr3w=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=wr5FMiHYTDsuqY3sYdmO56vb5TeKFudyXQ9E14D5KEzbdUM4x3EGWLM/c4ycw5gPJ Jj7K4grBtV0Y7mRickyNIwJ/SwmHJL1Dae6E8GLxipV6Lv/QnQZ3QpP/QVUOEquD3I kLl727z9KDpPv16y/XNi9mgYPZpJC5PjDvbcuwfI= Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib From: Jordan Hubbard In-Reply-To: Date: Fri, 4 Apr 2014 17:23:53 +0500 Content-Transfer-Encoding: quoted-printable Message-Id: <8D6AF193-A5A3-4A28-A230-97A543395ACA@ixsystems.com> References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140404115256.GA85137@ivaldir.etoilebsd.net> To: David Chisnall X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 12:24:10 -0000 On Apr 4, 2014, at 4:59 PM, David Chisnall wrote: > I believe that libdispatch most likely won't be imported until there = is an in-tree consumer, but it's in ports and there's nothing stopping = ports depending on it if they want to use it... I certainly get and even generally agree with that point of view. It = seems like putting the cart before the horse to bring in any technology = before there is a use case demanding said technology, right? Right. However, I think there are also occasional exceptions to that = rule. The strlcpy() / strlcat() / =85 family of functions, for example. = Until they existed (outside of OpenBSD), nobody really used them = pervasively enough to achieve their intended purpose (death to buffer = overflows in string handling) and it took bringing them in and = essentially saying =93see? there! use those now please!=94 for = adoption and conversion of existing string handling code to eventually, = over the course of years, become second nature. I think libdispatch is in a very similar category, and you=92ll just = have to trust me when I say that I=92ve had the benefit of watching = multiple years worth of slow adoption work its magic there, too. = Without libdispatch, you just use pthreads whenever you need to do = something in the background. Without libdispatch, you don=92t write = code (in libraries or applications) which assumes any sort of run loop = at all because, well, there isn=92t one. Without libdispatch, you still = write careful and limited signal handling functions because there=92s no = signal trampoline to save your butt if you try to do to much in a signal = handler. I could go on at length! Libdispatch (with blocks) is, in short, more akin to a programming idiom = than a library. Without them, you simply write an entirely different = style of synchronous, multi-threaded code with mutex locks and pthread = join and cancellation points, yada yada yada. Once libdispatch and = blocks are part of the runtime, you slowly leave the old style stuff = behind because it=92s limited, painful and just nowhere near as = sophisticated. To paraphrase something I heard from more than a few = dozen software engineers over the years: =93Libdispatch is the = multithreaded programming paradigm I never knew I always wanted.=94 There=92s a reason it=92s been ported to everything from Windows to = Android. It=92s hard to go back, once you have made the switch. Back to my point, however: I don=92t think FreeBSD programmers are ever = going to embrace an idiomatic change of that nature (and it=92s pretty = significant) until it is part of base, so there=92s really a deadlock = here. What=92s worse, I also don=92t think anyone in *BSD-land is = writing code that=92s particularly event-aware (the lack of system-wide = notifications kind of speaks to that) largely *because* it=92s a PITA to = do that without a runloop or handy glue code which makes it trivial, the = alternative being to use a background thread that tries to coordinate = said events with the foreground and that=92s just icky. The end-result = of this is that an entire somewhat more modern style of programming, = where things are more dynamic in the face of things changing on the = system, simply doesn=92t happen at the OS level and that=92s a shame, = because the OS *is* a dynamic environment, particularly in the mobile = space. I guess what I=92m advocating is nothing less than a leap of faith? - Jordan From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 12:31:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F08BE3A; Fri, 4 Apr 2014 12:31:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F375B8C9; Fri, 4 Apr 2014 12:31:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34CVD0K078020; Fri, 4 Apr 2014 12:31:13 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34CVD2Y078019; Fri, 4 Apr 2014 12:31:13 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201404041231.s34CVD2Y078019@svn.freebsd.org> From: David Xu Date: Fri, 4 Apr 2014 12:31:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264114 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 12:31:14 -0000 Author: davidxu Date: Fri Apr 4 12:31:13 2014 New Revision: 264114 URL: http://svnweb.freebsd.org/changeset/base/264114 Log: Fix SIGIO delivery. Use fsetown() to handle file descriptor owner ioctl and use pgsigio() to send SIGIO. Submitted by: truckman Reviewed by: mjg Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Fri Apr 4 11:19:02 2014 (r264113) +++ head/sys/kern/subr_bus.c Fri Apr 4 12:31:13 2014 (r264114) @@ -391,11 +391,12 @@ static struct dev_softc int inuse; int nonblock; int queued; + int async; struct mtx mtx; struct cv cv; struct selinfo sel; struct devq devq; - struct proc *async_proc; + struct sigio *sigio; } devsoftc; static struct cdev *devctl_dev; @@ -422,7 +423,7 @@ devopen(struct cdev *dev, int oflags, in /* move to init */ devsoftc.inuse = 1; devsoftc.nonblock = 0; - devsoftc.async_proc = NULL; + devsoftc.async = 0; mtx_unlock(&devsoftc.mtx); return (0); } @@ -433,8 +434,8 @@ devclose(struct cdev *dev, int fflag, in mtx_lock(&devsoftc.mtx); devsoftc.inuse = 0; - devsoftc.async_proc = NULL; cv_broadcast(&devsoftc.cv); + funsetown(&devsoftc.sigio); mtx_unlock(&devsoftc.mtx); return (0); } @@ -490,33 +491,21 @@ devioctl(struct cdev *dev, u_long cmd, c devsoftc.nonblock = 0; return (0); case FIOASYNC: - /* - * FIXME: - * Since this is a simple assignment there is no guarantee that - * devsoftc.async_proc consumers will get a valid pointer. - * - * Example scenario where things break (processes A and B): - * 1. A opens devctl - * 2. A sends fd to B - * 3. B sets itself as async_proc - * 4. B exits - * - * However, normally this requires root privileges and the only - * in-tree consumer does not behave in a dangerous way so the - * issue is not critical. - */ if (*(int*)data) - devsoftc.async_proc = td->td_proc; + devsoftc.async = 1; else - devsoftc.async_proc = NULL; + devsoftc.async = 0; + return (0); + case FIOSETOWN: + return fsetown(*(int *)data, &devsoftc.sigio); + case FIOGETOWN: + *(int *)data = fgetown(&devsoftc.sigio); return (0); /* (un)Support for other fcntl() calls. */ case FIOCLEX: case FIONCLEX: case FIONREAD: - case FIOSETOWN: - case FIOGETOWN: default: break; } @@ -560,7 +549,6 @@ void devctl_queue_data_f(char *data, int flags) { struct dev_event_info *n1 = NULL, *n2 = NULL; - struct proc *p; if (strlen(data) == 0) goto out; @@ -590,13 +578,8 @@ devctl_queue_data_f(char *data, int flag cv_broadcast(&devsoftc.cv); mtx_unlock(&devsoftc.mtx); selwakeup(&devsoftc.sel); - /* XXX see a comment in devioctl */ - p = devsoftc.async_proc; - if (p != NULL) { - PROC_LOCK(p); - kern_psignal(p, SIGIO); - PROC_UNLOCK(p); - } + if (devsoftc.async && devsoftc.sigio != NULL) + pgsigio(&devsoftc.sigio, SIGIO, 0); return; out: /* From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 12:31:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5DA8F72 for ; Fri, 4 Apr 2014 12:31:35 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C207F8D1 for ; Fri, 4 Apr 2014 12:31:35 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s34CVZa7097466 for ; Fri, 4 Apr 2014 12:31:35 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s34CVZbL097464 for svn-src-head@freebsd.org; Fri, 4 Apr 2014 12:31:35 GMT (envelope-from bdrewery) Received: (qmail 99957 invoked from network); 4 Apr 2014 07:31:33 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 4 Apr 2014 07:31:33 -0500 Message-ID: <533EA61F.7030300@FreeBSD.org> Date: Fri, 04 Apr 2014 07:31:27 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Jordan Hubbard , David Chisnall Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140404115256.GA85137@ivaldir.etoilebsd.net> <8D6AF193-A5A3-4A28-A230-97A543395ACA@ixsystems.com> In-Reply-To: <8D6AF193-A5A3-4A28-A230-97A543395ACA@ixsystems.com> X-Enigmail-Version: 1.6 OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SQAM8aBUqO9vfUmFSwwxErIQn4hx4FUKt" Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 12:31:36 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SQAM8aBUqO9vfUmFSwwxErIQn4hx4FUKt Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 4/4/2014 7:23 AM, Jordan Hubbard wrote: > On Apr 4, 2014, at 4:59 PM, David Chisnall wrote= : >=20 >> I believe that libdispatch most likely won't be imported until there i= s an in-tree consumer, but it's in ports and there's nothing stopping por= ts depending on it if they want to use it... >=20 > I certainly get and even generally agree with that point of view. It s= eems like putting the cart before the horse to bring in any technology be= fore there is a use case demanding said technology, right? >=20 > Right. However, I think there are also occasional exceptions to that r= ule. The strlcpy() / strlcat() / =85 family of functions, for example. = Until they existed (outside of OpenBSD), nobody really used them pervasiv= ely enough to achieve their intended purpose (death to buffer overflows i= n string handling) and it took bringing them in and essentially saying =93= see? there! use those now please!=94 for adoption and conversion of exi= sting string handling code to eventually, over the course of years, becom= e second nature. >=20 > I think libdispatch is in a very similar category, and you=92ll just ha= ve to trust me when I say that I=92ve had the benefit of watching multipl= e years worth of slow adoption work its magic there, too. Without libdis= patch, you just use pthreads whenever you need to do something in the bac= kground. Without libdispatch, you don=92t write code (in libraries or ap= plications) which assumes any sort of run loop at all because, well, ther= e isn=92t one. Without libdispatch, you still write careful and limited = signal handling functions because there=92s no signal trampoline to save = your butt if you try to do to much in a signal handler. I could go on at= length! >=20 > Libdispatch (with blocks) is, in short, more akin to a programming idio= m than a library. Without them, you simply write an entirely different s= tyle of synchronous, multi-threaded code with mutex locks and pthread joi= n and cancellation points, yada yada yada. Once libdispatch and blocks a= re part of the runtime, you slowly leave the old style stuff behind becau= se it=92s limited, painful and just nowhere near as sophisticated. To pa= raphrase something I heard from more than a few dozen software engineers = over the years: =93Libdispatch is the multithreaded programming paradigm= I never knew I always wanted.=94 >=20 > There=92s a reason it=92s been ported to everything from Windows to And= roid. It=92s hard to go back, once you have made the switch. >=20 > Back to my point, however: I don=92t think FreeBSD programmers are eve= r going to embrace an idiomatic change of that nature (and it=92s pretty = significant) until it is part of base, so there=92s really a deadlock her= e. What=92s worse, I also don=92t think anyone in *BSD-land is writing c= ode that=92s particularly event-aware (the lack of system-wide notificati= ons kind of speaks to that) largely *because* it=92s a PITA to do that wi= thout a runloop or handy glue code which makes it trivial, the alternativ= e being to use a background thread that tries to coordinate said events w= ith the foreground and that=92s just icky. The end-result of this is th= at an entire somewhat more modern style of programming, where things are = more dynamic in the face of things changing on the system, simply doesn=92= t happen at the OS level and that=92s a shame, because the OS *is* a dyna= mic environment, particularly in the mobile space. >=20 > I guess what I=92m advocating is nothing less than a leap of faith? >=20 > - Jordan >=20 Respectfully, as a developer, why would I want to use libdispatch and not libevent? Libevent looks far more portable. When I bring up the libdispatch page, I get no sense that picking it for my project makes sense. I'm not even clear what it is from looking at the page. When I pull up libevent's page, I get a much different picture right away, "Currently, libevent supports /dev/poll, kqueue(2), event ports, POSIX select(2), Windows select(), poll(2), and epoll(4)." --=20 Regards, Bryan Drewery --SQAM8aBUqO9vfUmFSwwxErIQn4hx4FUKt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJTPqYfAAoJEDXXcbtuRpfPCeQH/RMWX58fLhbVXN3TNrOxWHCR CrDKDVAug0osSYdGpUAvJuBtA3wcp8/MhH1BK37Q9Jjz8segrto2baULH4ZBOrFY uvQKjADJ9UNt27H/lruvrFlvnqRW9zTeI53m0dmcq4sRT0rFP+rLIEU7wgwUDKaL eYsTmX+cVHQVoo54SuamKKFqtBAPGrag1L0KZc2ZGdYq3aYWpnuCbx9+B+2/c0X5 5GqWsv7fsS3BqRgqDrzdTAumydk6Bmk4KFu5IIBADlQ4ZrXgg8zIpvyRElvFn+pf 2cl7IS0EmxqI1yDyikx4WqTzxOPl5SH/T0F/gXvL74jUi+Yp/Jr+ugcCSWLsNBE= =OOEn -----END PGP SIGNATURE----- --SQAM8aBUqO9vfUmFSwwxErIQn4hx4FUKt-- From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 12:33:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DEA482BD; Fri, 4 Apr 2014 12:33:43 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "theravensnest.org", Issuer "theravensnest.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D19B8F2; Fri, 4 Apr 2014 12:33:43 +0000 (UTC) Received: from [192.168.0.100] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s34CXckJ072814 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 4 Apr 2014 12:33:40 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib From: David Chisnall In-Reply-To: <8D6AF193-A5A3-4A28-A230-97A543395ACA@ixsystems.com> Date: Fri, 4 Apr 2014 13:33:34 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <2E0EC8CB-B3EE-4DB8-A33D-58FD2107F14D@FreeBSD.org> References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140404115256.GA85137@ivaldir.etoilebsd.net> <8D6AF193-A5A3-4A28-A230-97A543395ACA@ixsystems.com> To: Jordan Hubbard X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 12:33:44 -0000 On 4 Apr 2014, at 13:23, Jordan Hubbard wrote: > On Apr 4, 2014, at 4:59 PM, David Chisnall = wrote: >=20 >> I believe that libdispatch most likely won't be imported until there = is an in-tree consumer, but it's in ports and there's nothing stopping = ports depending on it if they want to use it... >=20 > I certainly get and even generally agree with that point of view. It = seems like putting the cart before the horse to bring in any technology = before there is a use case demanding said technology, right? >=20 > Right. However, I think there are also occasional exceptions to that = rule. The strlcpy() / strlcat() / =85 family of functions, for example. = Until they existed (outside of OpenBSD), nobody really used them = pervasively enough to achieve their intended purpose (death to buffer = overflows in string handling) and it took bringing them in and = essentially saying =93see? there! use those now please!=94 for = adoption and conversion of existing string handling code to eventually, = over the course of years, become second nature. >=20 > I think libdispatch is in a very similar category, and you=92ll just = have to trust me when I say that I=92ve had the benefit of watching = multiple years worth of slow adoption work its magic there, too. = Without libdispatch, you just use pthreads whenever you need to do = something in the background. Without libdispatch, you don=92t write = code (in libraries or applications) which assumes any sort of run loop = at all because, well, there isn=92t one. Without libdispatch, you still = write careful and limited signal handling functions because there=92s no = signal trampoline to save your butt if you try to do to much in a signal = handler. I could go on at length! >=20 > Libdispatch (with blocks) is, in short, more akin to a programming = idiom than a library. Without them, you simply write an entirely = different style of synchronous, multi-threaded code with mutex locks and = pthread join and cancellation points, yada yada yada. Once libdispatch = and blocks are part of the runtime, you slowly leave the old style stuff = behind because it=92s limited, painful and just nowhere near as = sophisticated. To paraphrase something I heard from more than a few = dozen software engineers over the years: =93Libdispatch is the = multithreaded programming paradigm I never knew I always wanted.=94 >=20 > There=92s a reason it=92s been ported to everything from Windows to = Android. It=92s hard to go back, once you have made the switch. >=20 > Back to my point, however: I don=92t think FreeBSD programmers are = ever going to embrace an idiomatic change of that nature (and it=92s = pretty significant) until it is part of base, so there=92s really a = deadlock here. What=92s worse, I also don=92t think anyone in *BSD-land = is writing code that=92s particularly event-aware (the lack of = system-wide notifications kind of speaks to that) largely *because* it=92s= a PITA to do that without a runloop or handy glue code which makes it = trivial, the alternative being to use a background thread that tries to = coordinate said events with the foreground and that=92s just icky. The = end-result of this is that an entire somewhat more modern style of = programming, where things are more dynamic in the face of things = changing on the system, simply doesn=92t happen at the OS level and = that=92s a shame, because the OS *is* a dynamic environment, = particularly in the mobile space. >=20 > I guess what I=92m advocating is nothing less than a leap of faith? I would certainly be in favour of importing it. The package seems to be = on every FreeBSD machine that I use, so I've become accustomed to having = it there and just work. =20 The slight problem, however, is that we would still like to be able to = build the base system with a more or less standard C compiler. Blocks = are in clang and are slowly making their way into commercial compilers, = but the only two versions of gcc that support them are the ones shipped = by Apple and FreeBSD. =20 In the commit that started this thread, I was careful to ensure that the = code that consumes blocks works correctly with a C compiler that doesn't = support blocks. Unfortunately, libdispatch just does #ifdef __BLOCKS__ = all over the place, and so you get a binary with a different interface. =20= This gets worse when we start to actually use blocks in the base system. = Hopefully, gcc upstream will gain blocks support soon (apparently = someone at Mentor Embedded is working on it?), and then we can start to = more seriously consider them for things in the base system. David From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 12:41:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C65C562; Fri, 4 Apr 2014 12:41:45 +0000 (UTC) Received: from mail.iXsystems.com (newknight.ixsystems.com [206.40.55.70]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7513A9B1; Fri, 4 Apr 2014 12:41:44 +0000 (UTC) Received: from localhost (mail.ixsystems.com [10.2.55.1]) by mail.iXsystems.com (Postfix) with ESMTP id 163417387A; Fri, 4 Apr 2014 05:41:44 -0700 (PDT) Received: from mail.iXsystems.com ([10.2.55.1]) by localhost (mail.ixsystems.com [10.2.55.1]) (maiad, port 10024) with ESMTP id 89215-03; Fri, 4 Apr 2014 05:41:43 -0700 (PDT) Received: from [192.168.3.175] (unknown [124.195.210.70]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.iXsystems.com (Postfix) with ESMTPSA id B747573874; Fri, 4 Apr 2014 05:41:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ixsystems.com; s=newknight0; t=1396615303; bh=5U5FnSL+bUGtGhu0eR1O10icgvEP+P7aIWhvvVIKvQU=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=cwaRBwpDkNQJP7owzWXJAeo9mT4/gFEU9tvG3mwVksTHCffpd6NulYT8HnDtazYxZ dYRTwExYtlGgmYE+VzAMrC8rEf9KdHAfvuw555RCJXW0g11JYnI+77i/9mYkqXCI9m wUX1FEHiEDbU3wOK4VuJRzc6gAShdZL2Y5wLWWcc= Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib From: Jordan Hubbard In-Reply-To: <533EA61F.7030300@FreeBSD.org> Date: Fri, 4 Apr 2014 17:41:28 +0500 Content-Transfer-Encoding: quoted-printable Message-Id: <08AC0639-1467-4CA6-A4DA-1903CA11F827@ixsystems.com> References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140404115256.GA85137@ivaldir.etoilebsd.net> <8D6AF193-A5A3-4A28-A230-97A543395ACA@ixsystems.com> <533EA61F.7030300@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, David Chisnall , svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 12:41:45 -0000 On Apr 4, 2014, at 5:31 PM, Bryan Drewery wrote: > Respectfully, as a developer, why would I want to use libdispatch and > not libevent? Libevent looks far more portable. Equally respectfully, if you=92re comparing libevent and libdispatch at = all, then you=92re only getting about 10% of what libdispatch actually = is. The event handling piece is really just a small fraction of it. = For a really nice overview written by someone *not* from Apple, I = recommend: http://arstechnica.com/apple/2009/08/mac-os-x-10-6/12/ Libdispatch is also highly portable. I don=92t think there=92s an OS = flavor it *hasn=92t* been ported to at this point. - Jordan From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 12:44:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD1B994B; Fri, 4 Apr 2014 12:44:16 +0000 (UTC) Received: from mail.iXsystems.com (newknight.ixsystems.com [206.40.55.70]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95FCF9E6; Fri, 4 Apr 2014 12:44:16 +0000 (UTC) Received: from localhost (mail.ixsystems.com [10.2.55.1]) by mail.iXsystems.com (Postfix) with ESMTP id E7627738BF; Fri, 4 Apr 2014 05:44:15 -0700 (PDT) Received: from mail.iXsystems.com ([10.2.55.1]) by localhost (mail.ixsystems.com [10.2.55.1]) (maiad, port 10024) with ESMTP id 89218-06; Fri, 4 Apr 2014 05:44:15 -0700 (PDT) Received: from [192.168.3.175] (unknown [124.195.210.70]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.iXsystems.com (Postfix) with ESMTPSA id C60E1738BA; Fri, 4 Apr 2014 05:44:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ixsystems.com; s=newknight0; t=1396615455; bh=qcYHio5HMzH6ONi3hRd/iGiLOvfhsGGyzlYp5neJ7l0=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=HYROcAk4qWKuHPVgoHoazhdfpZVe2igjzYBUyAJHW8DS0MaZfPsowHxlHHuCvG0si fAiZdEkiLPiFTrY8x7pGBxBKXzpGG+5HcfLkrOkSWlaUGvc8FSbEEpBte1I4jAA7Vb UDdO0Ux6kUcF9ISlZ7LcymPSChN2TSNMAWoRVbRc= Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib From: Jordan Hubbard In-Reply-To: <2E0EC8CB-B3EE-4DB8-A33D-58FD2107F14D@FreeBSD.org> Date: Fri, 4 Apr 2014 17:44:02 +0500 Content-Transfer-Encoding: quoted-printable Message-Id: <6A02504F-5543-4F91-92F6-7B4FB9A34DC4@ixsystems.com> References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140404115256.GA85137@ivaldir.etoilebsd.net> <8D6AF193-A5A3-4A28-A230-97A543395ACA@ixsystems.com> <2E0EC8CB-B3EE-4DB8-A33D-58FD2107F14D@FreeBSD.org> To: David Chisnall X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 12:44:16 -0000 On Apr 4, 2014, at 5:33 PM, David Chisnall wrote: > The slight problem, however, is that we would still like to be able to = build the base system with a more or less standard C compiler. Blocks = are in clang and are slowly making their way into commercial compilers, = but the only two versions of gcc that support them are the ones shipped = by Apple and FreeBSD. =20 Huh. Can I ask what specific need is driving that? As you point out, = you=92ve got clang and you=92ve also got the blocks support from Apple = gcc back-ported, so that covers all the architectures you could possibly = want to generate code for. Wanting to hold base to some retro K&R = standard for its own sake seems=85 weird=85 so I must be missing some = part of the need statement, hence my question? Thanks, - Jordan From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 12:55:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFFB5F2F; Fri, 4 Apr 2014 12:55:59 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "theravensnest.org", Issuer "theravensnest.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C8ACACB; Fri, 4 Apr 2014 12:55:58 +0000 (UTC) Received: from [192.168.0.100] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s34CtsHR072960 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 4 Apr 2014 12:55:56 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib From: David Chisnall In-Reply-To: <6A02504F-5543-4F91-92F6-7B4FB9A34DC4@ixsystems.com> Date: Fri, 4 Apr 2014 13:55:50 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <152D73EE-DF9E-4757-B547-F1F22B12C824@FreeBSD.org> References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140404115256.GA85137@ivaldir.etoilebsd.net> <8D6AF193-A5A3-4A28-A230-97A543395ACA@ixsystems.com> <2E0EC8CB-B3EE-4DB8-A33D-58FD2107F14D@FreeBSD.org> <6A02504F-5543-4F91-92F6-7B4FB9A34DC4@ixsystems.com> To: Jordan Hubbard X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 12:56:00 -0000 On 4 Apr 2014, at 13:44, Jordan Hubbard wrote: > On Apr 4, 2014, at 5:33 PM, David Chisnall = wrote: >=20 >> The slight problem, however, is that we would still like to be able = to build the base system with a more or less standard C compiler. = Blocks are in clang and are slowly making their way into commercial = compilers, but the only two versions of gcc that support them are the = ones shipped by Apple and FreeBSD. =20 >=20 > Huh. Can I ask what specific need is driving that? As you point out, = you=92ve got clang and you=92ve also got the blocks support from Apple = gcc back-ported, so that covers all the architectures you could possibly = want to generate code for. Wanting to hold base to some retro K&R = standard for its own sake seems=85 weird=85 so I must be missing some = part of the need statement, hence my question? There are two requirements: We'd like to kill off gcc 4.2.1 in base, because it doesn't support C11 = or C++11. The lack of C++11 support is a problem because it means gcc = architectures can't build libc++, so they need to use an old libstdc++ = to build C++ things in the base system (which also means that these = things can't take advantage of C++11, which cleans up the language a = huge amount). The prerequisite for this is the availability of external = toolchains for the non-clang platforms. If we could build base with = gcc47 from ports, that would be okay, because then we'd have a modern = C/C++ compiler in the base system and a modern(ish - 4.8 / 4.9 would be = better, but 4.7 is a reasonable baseline) C/C++ compiler in ports to = drive an external toolchain. For embedded uses, we'd also like to build FreeBSD with = vendor's-ugly-hacked-up-gcc-of-the-week. This is less of an issue now = for ARM, but MIPS vendors still hack up gcc in such a way that there's = no way that they can get their changes upstreamed and then ship the = result with their chips. David From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 12:59:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69EDE312 for ; Fri, 4 Apr 2014 12:59:23 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 290BAAF5 for ; Fri, 4 Apr 2014 12:59:23 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s34CxNSa003466 for ; Fri, 4 Apr 2014 12:59:23 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s34CxMQn003457 for svn-src-head@freebsd.org; Fri, 4 Apr 2014 12:59:22 GMT (envelope-from bdrewery) Received: (qmail 93196 invoked from network); 4 Apr 2014 07:59:20 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 4 Apr 2014 07:59:20 -0500 Message-ID: <533EACA2.1050803@FreeBSD.org> Date: Fri, 04 Apr 2014 07:59:14 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Jordan Hubbard Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140404115256.GA85137@ivaldir.etoilebsd.net> <8D6AF193-A5A3-4A28-A230-97A543395ACA@ixsystems.com> <533EA61F.7030300@FreeBSD.org> <08AC0639-1467-4CA6-A4DA-1903CA11F827@ixsystems.com> In-Reply-To: <08AC0639-1467-4CA6-A4DA-1903CA11F827@ixsystems.com> X-Enigmail-Version: 1.6 OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aDa0uLIQFdat1O6ugbcA1CgHU00GaJ4P6" Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, David Chisnall , svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 12:59:23 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --aDa0uLIQFdat1O6ugbcA1CgHU00GaJ4P6 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 4/4/2014 7:41 AM, Jordan Hubbard wrote: >=20 > On Apr 4, 2014, at 5:31 PM, Bryan Drewery wrote:= >=20 >> Respectfully, as a developer, why would I want to use libdispatch and >> not libevent? Libevent looks far more portable. >=20 > Equally respectfully, if you=92re comparing libevent and libdispatch at= all, then you=92re only getting about 10% of what libdispatch actually i= s. The event handling piece is really just a small fraction of it. For = a really nice overview written by someone *not* from Apple, I recommend: = http://arstechnica.com/apple/2009/08/mac-os-x-10-6/12/ >=20 > Libdispatch is also highly portable. I don=92t think there=92s an OS f= lavor it *hasn=92t* been ported to at this point. >=20 > - Jordan >=20 Ah, thanks! The homepage doesn't explain well, and the link to GCD on apple.com is broken. --=20 Regards, Bryan Drewery --aDa0uLIQFdat1O6ugbcA1CgHU00GaJ4P6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJTPqyiAAoJEDXXcbtuRpfPfUIIAMmIae11hGDw/FWlqLRA257d CbH4BP5DeE8Wa7leZC+qmkW4DVjZQ0BZ7IobIaTNuyAhyruaYoxDwt7tMgPIN0n3 0wCR4Fj8/3jc1RF7RwUP50MGspzD6DOOxCgqja7n/996DtBMGN/Ziccsh/dhYzPc 9WamuHIfbdeL1iDjiR0qZOVZnjr7cd5AnlVFiaHE8umvL+YYdWTMZJ+N+vwfbwqL +VPOVcA421HV7Ox9YIc8iIgrFdPcodYhNoOHsgvAfizHo3coNM7JPq1g0xhdsSW4 K7C3xZbVRYIA4+ITM/sqrS0ifD+vpS3u7rA10SNSV/Hr/zqX+osXucljhUVO4Rg= =+QkS -----END PGP SIGNATURE----- --aDa0uLIQFdat1O6ugbcA1CgHU00GaJ4P6-- From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 13:35:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54EC81C2; Fri, 4 Apr 2014 13:35:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25B1EEB7; Fri, 4 Apr 2014 13:35:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34DZbUG004647; Fri, 4 Apr 2014 13:35:37 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34DZa6M004644; Fri, 4 Apr 2014 13:35:36 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404041335.s34DZa6M004644@svn.freebsd.org> From: Ed Maste Date: Fri, 4 Apr 2014 13:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264115 - head/sys/boot/amd64/efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 13:35:37 -0000 Author: emaste Date: Fri Apr 4 13:35:36 2014 New Revision: 264115 URL: http://svnweb.freebsd.org/changeset/base/264115 Log: Fix printf format mismatches Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/amd64/efi/copy.c head/sys/boot/amd64/efi/elf64_freebsd.c head/sys/boot/amd64/efi/main.c Modified: head/sys/boot/amd64/efi/copy.c ============================================================================== --- head/sys/boot/amd64/efi/copy.c Fri Apr 4 12:31:13 2014 (r264114) +++ head/sys/boot/amd64/efi/copy.c Fri Apr 4 13:35:36 2014 (r264115) @@ -51,8 +51,8 @@ x86_efi_copy_init(void) status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, STAGE_PAGES, &staging); if (EFI_ERROR(status)) { - printf("failed to allocate staging area: %d\n", - status & EFI_ERROR_MASK); + printf("failed to allocate staging area: %lu\n", + (unsigned long)(status & EFI_ERROR_MASK)); return (status); } Modified: head/sys/boot/amd64/efi/elf64_freebsd.c ============================================================================== --- head/sys/boot/amd64/efi/elf64_freebsd.c Fri Apr 4 12:31:13 2014 (r264114) +++ head/sys/boot/amd64/efi/elf64_freebsd.c Fri Apr 4 13:35:36 2014 (r264115) @@ -101,7 +101,7 @@ elf64_exec(struct preloaded_file *fp) rsdp = efi_get_table(&acpi_guid); } if (rsdp != NULL) { - sprintf(buf, "0x%016llx", rsdp); + sprintf(buf, "0x%016llx", (unsigned long long)rsdp); setenv("hint.acpi.0.rsdp", buf, 1); revision = rsdp->Revision; if (revision == 0) @@ -115,7 +115,8 @@ elf64_exec(struct preloaded_file *fp) setenv("hint.acpi.0.rsdt", buf, 1); if (revision >= 2) { /* XXX extended checksum? */ - sprintf(buf, "0x%016llx", rsdp->XsdtPhysicalAddress); + sprintf(buf, "0x%016llx", + (unsigned long long)rsdp->XsdtPhysicalAddress); setenv("hint.acpi.0.xsdt", buf, 1); sprintf(buf, "%d", rsdp->Length); setenv("hint.acpi.0.xsdt_length", buf, 1); Modified: head/sys/boot/amd64/efi/main.c ============================================================================== --- head/sys/boot/amd64/efi/main.c Fri Apr 4 12:31:13 2014 (r264114) +++ head/sys/boot/amd64/efi/main.c Fri Apr 4 13:35:36 2014 (r264115) @@ -304,7 +304,7 @@ command_mode(int argc, char *argv[]) printf("couldn't set mode %d\n", mode); return (CMD_ERROR); } - sprintf(rowenv, "%d", rows); + sprintf(rowenv, "%u", (unsigned)rows); setenv("LINES", rowenv, 1); return (CMD_OK); @@ -314,7 +314,8 @@ command_mode(int argc, char *argv[]) status = conout->QueryMode(conout, i, &cols, &rows); if (EFI_ERROR(status)) break; - printf("Mode %d: %d columns, %d rows\n", i, cols, rows); + printf("Mode %d: %u columns, %u rows\n", i, (unsigned)cols, + (unsigned)rows); } if (i != 0) From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 13:44:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C13B986A; Fri, 4 Apr 2014 13:44:32 +0000 (UTC) Received: from mail.iXsystems.com (newknight.ixsystems.com [206.40.55.70]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1DA9FC8; Fri, 4 Apr 2014 13:44:31 +0000 (UTC) Received: from localhost (mail.ixsystems.com [10.2.55.1]) by mail.iXsystems.com (Postfix) with ESMTP id 73A1673157; Fri, 4 Apr 2014 06:44:31 -0700 (PDT) Received: from mail.iXsystems.com ([10.2.55.1]) by localhost (mail.ixsystems.com [10.2.55.1]) (maiad, port 10024) with ESMTP id 93289-09; Fri, 4 Apr 2014 06:44:31 -0700 (PDT) Received: from [192.168.3.175] (unknown [124.195.210.70]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.iXsystems.com (Postfix) with ESMTPSA id D28C573151; Fri, 4 Apr 2014 06:44:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ixsystems.com; s=newknight0; t=1396619071; bh=CTVVSPcINMXkct7D02OQcPbCF2IiR8QqbWTO550tASA=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=NevmQWgJNX2ds8VLDrhkqGtKb2CbhV1uhurUNzkNAVqV3UIVNSvJeYXzhB3piKtMt TTr6tEc6GbznzeBDZX6qyZcjs/jmdgLclCHae6ysYtD+PHuvGAdW5rXzhwnOGvc5XN EKh6gsuSS8by+gvtBpEwr5QAIYI6lIiYwjR8b19A= Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib From: Jordan Hubbard In-Reply-To: <152D73EE-DF9E-4757-B547-F1F22B12C824@FreeBSD.org> Date: Fri, 4 Apr 2014 18:44:08 +0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140404115256.GA85137@ivaldir.etoilebsd.net> <8D6AF193-A5A3-4A28-A230-97A543395ACA@ixsystems.com> <2E0EC8CB-B3EE-4DB8-A33D-58FD2107F14D@FreeBSD.org> <6A02504F-5543-4F91-92F6-7B4FB9A34DC4@ixsystems.com> <152D73EE-DF9E-4757-B547-F1F22B12C824@FreeBSD.org> To: David Chisnall X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 13:44:32 -0000 On Apr 4, 2014, at 5:55 PM, David Chisnall wrote: > We'd like to kill off gcc 4.2.1 in base, because it doesn't support = C11 or C++11. The lack of C++11 support is a problem because it means = gcc architectures can't build libc++, so they need to use an old = libstdc++ to build C++ things in the base system (which also means that = these things can't take advantage of C++11, which cleans up the language = a huge amount). The prerequisite for this is the availability of = external toolchains for the non-clang platforms. If we could build base = with gcc47 from ports, that would be okay, because then we'd have a = modern C/C++ compiler in the base system and a modern(ish - 4.8 / 4.9 = would be better, but 4.7 is a reasonable baseline) C/C++ compiler in = ports to drive an external toolchain. Ah, OK. And I=92m guessing there=92s been no interest in = forward-porting the blocks support to 4.7? That=92s kind of=85 a = bummer. I=92m guessing the great white hope for all the platforms is a = slow convergence on clang then? What is the compiler toolchain master = plan? If there=92s a wiki somewhere describing it, I=92d also be happy = to just go read that. > For embedded uses, we'd also like to build FreeBSD with = vendor's-ugly-hacked-up-gcc-of-the-week. This is less of an issue now = for ARM, but MIPS vendors still hack up gcc in such a way that there's = no way that they can get their changes upstreamed and then ship the = result with their chips. I see. That=92s pretty ugly indeed - is there a list of FreeBSD MIPS = folks doing this somewhere? I ask out of curiosity to know if there=92s = any collective attempt to chain them all together and insist that they = improve clang/MIPS to the point where they can stop doing ugly-ass gcc = ports. :) Thanks for all the info. It=92s very helpful! - Jordan From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 14:04:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FE51213; Fri, 4 Apr 2014 14:04:06 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "theravensnest.org", Issuer "theravensnest.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 70F30236; Fri, 4 Apr 2014 14:04:04 +0000 (UTC) Received: from [192.168.0.100] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s34E3rLl073427 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 4 Apr 2014 14:03:55 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib From: David Chisnall In-Reply-To: Date: Fri, 4 Apr 2014 15:03:49 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <8E3BD3C1-A441-48C5-97BC-45EF67513096@FreeBSD.org> References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140404115256.GA85137@ivaldir.etoilebsd.net> <8D6AF193-A5A3-4A28-A230-97A543395ACA@ixsystems.com> <2E0EC8CB-B3EE-4DB8-A33D-58FD2107F14D@FreeBSD.org> <6A02504F-5543-4F91-92F6-7B4FB9A34DC4@ixsystems.com> <152D73EE-DF9E-4757-B547-F1F22B12C824@FreeBSD.org> To: Jordan Hubbard X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 14:04:06 -0000 On 4 Apr 2014, at 14:44, Jordan Hubbard wrote: > Ah, OK. And I=92m guessing there=92s been no interest in = forward-porting the blocks support to 4.7? That=92s kind of=85 a = bummer. I don't think so. Warner has been forward-porting some of the FreeBSD = binutils changes, but even Pedro (who did the blocks port to FreeBSD gcc = 4.2.1) doesn't want to touch gcc anymore. =20 > I=92m guessing the great white hope for all the platforms is a slow = convergence on clang then? What is the compiler toolchain master plan? = If there=92s a wiki somewhere describing it, I=92d also be happy to just = go read that. Not really. Converging on clang is nice, but even then it's good to = have (at least) a second working compiler for several reasons: - As we discovered with gcc, having a single source for a core component = is usually not ideal, as they can change the rules suddenly - If there's a bug in clang (and, given that it's getting on for a = million lines of C++ code now, the odds are good that there are always = going to be a few), it's helpful to have another compiler for testing. - Periodic testing with another compiler stops us shipping code that = relies on non-conformant behaviour. The amount of effort that it's = required to get the Linux kernel to build with clang should be a warning = for us - we don't want to fall into the same trap. That said, I think we're increasingly going to be using LLVM for things = that are beyond just simple AOT compilation, so platforms with no LLVM = back end are likely to be left behind. >> For embedded uses, we'd also like to build FreeBSD with = vendor's-ugly-hacked-up-gcc-of-the-week. This is less of an issue now = for ARM, but MIPS vendors still hack up gcc in such a way that there's = no way that they can get their changes upstreamed and then ship the = result with their chips. >=20 > I see. That=92s pretty ugly indeed - is there a list of FreeBSD MIPS = folks doing this somewhere? I ask out of curiosity to know if there=92s = any collective attempt to chain them all together and insist that they = improve clang/MIPS to the point where they can stop doing ugly-ass gcc = ports. :) I'm working with the MIPS people (who are now Imagination Technologies = people) to get my MIPS improvements upstreamed. You can see quite a few = of them in the commit log over the past week or two: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/?view=3Dlog= Since we also have a hacked-up LLVM that adds support for a custom MIPS = chip, I'm also looking at improving the general infrastructure in the = MIPS back end, so that we can minimise diffs and make it easy for = vendors to push their custom code upstream to LLVM without breaking = everyone else. Or, at the very least, make it cheaper to ship a = hacked-up LLVM toolchain than a hacked-up GCC toolchain... The MIPS people are working hard to get Linux/MIPS building with Clang, = so there's a good chance that they'll convince their downstream people = to go with it. I imagine that they're in more or less the same = situation as ARM, which can divide their customers nearly into two = categories: - Those that won't touch gcc over the license - Those that don't care what their compiler is as long as it works ARM has noticed that LLVM makes both of these groups happy (and is = actually using it as the basis for their proprietary compiler as well = now). Hopefully MIPS will too... David From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 14:18:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2CE75B5; Fri, 4 Apr 2014 14:18:09 +0000 (UTC) Received: from mail.iXsystems.com (newknight.ixsystems.com [206.40.55.70]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42FCD34B; Fri, 4 Apr 2014 14:18:09 +0000 (UTC) Received: from localhost (mail.ixsystems.com [10.2.55.1]) by mail.iXsystems.com (Postfix) with ESMTP id CF9B073541; Fri, 4 Apr 2014 07:18:08 -0700 (PDT) Received: from mail.iXsystems.com ([10.2.55.1]) by localhost (mail.ixsystems.com [10.2.55.1]) (maiad, port 10024) with ESMTP id 96844-02; Fri, 4 Apr 2014 07:18:08 -0700 (PDT) Received: from [192.168.3.175] (unknown [124.195.210.70]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.iXsystems.com (Postfix) with ESMTPSA id 28F507352E; Fri, 4 Apr 2014 07:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ixsystems.com; s=newknight0; t=1396621088; bh=W5D7V4lmpRjEWnTvlG6rKObKP88xyAzMmTEIGWmXxC0=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=SFXxyBujibCKzyMG4TViPUQ+guYKFNZJUJxbQbXSxZUrmZuQ0Kgnwo8c4EAWg4wzF wcbuc7RIUfHe33L0/jwpkwN0/ZmizDnkahpxZH0vnuOp8RpH/NwerziWUjJOU8tIjM upoT5g9MhXB81otqZPrIxV0EEVViGd5S79yIIcN4= Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib From: Jordan Hubbard In-Reply-To: <8E3BD3C1-A441-48C5-97BC-45EF67513096@FreeBSD.org> Date: Fri, 4 Apr 2014 19:17:54 +0500 Content-Transfer-Encoding: quoted-printable Message-Id: <6418BE83-BE78-473B-9311-C849507FA885@ixsystems.com> References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140404115256.GA85137@ivaldir.etoilebsd.net> <8D6AF193-A5A3-4A28-A230-97A543395ACA@ixsystems.com> <2E0EC8CB-B3EE-4DB8-A33D-58FD2107F14D@FreeBSD.org> <6A02504F-5543-4F91-92F6-7B4FB9A34DC4@ixsystems.com> <152D73EE-DF9E-4757-B547-F1F22B12C824@FreeBSD.org> <8E3BD3C1-A441-48C5-97BC-45EF67513096@FreeBSD.org> To: David Chisnall X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 14:18:10 -0000 On Apr 4, 2014, at 7:03 PM, David Chisnall wrote: > That said, I think we're increasingly going to be using LLVM for = things that are beyond just simple AOT compilation, so platforms with no = LLVM back end are likely to be left behind. Amen, and a topic worth an entire discussion in its own right, but I=92ll = spare us that and leave the topic with just one quick anecdote: When we = ported MacRuby to LLVM, thus creating in effect a ruby JIT compiler, we = were pretty amazed at how quickly the work progressed and how good the = performance of the resulting code was. MacRuby later died for other = reasons, but its JIT/AOT compilation abilities were amazing enough that = we were left wondered why the Python and Perl folks weren=92t stampeding = over themselves to follow suit. I think the answer there was that they=92d already rolled their own = bytecode systems, as ultimately did Ruby, and had too much invested in = those technologies, but I=92m still holding out hope that the =93everyone = but C/C++=94 world of languages will eventually converge on LLVM, as = seems to be slowly happening with projects like Rubinius and Numba. Not = relevant to FreeBSD right now, but who knows the future? - Jordan From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 14:46:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B64F02BD for ; Fri, 4 Apr 2014 14:46:33 +0000 (UTC) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 834D884E for ; Fri, 4 Apr 2014 14:46:33 +0000 (UTC) Received: by mail-pa0-f53.google.com with SMTP id ld10so3541530pab.40 for ; Fri, 04 Apr 2014 07:46:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=GKUpb46x3qUTyecFtJDnUerhQYWdM1qIGKIjO+RPa64=; b=XMhPyZaKFZyneeJVImOn7YbJHjjdkeIsEr4MJj+6kwMHF6E3fVa6UQag+EbKHcI7WM 49Ygn596jQPNIgbtauOk2L2dh/vMMYcShXTIIxQxYQ3FKaVc9mhjfOoKQ9RztIkyOxEE EUQrAuFXRGmaHRRlxapCWhsYSnUxKqkoL6bkgKe0oSq7M/c6pHavYQp/nuxTcaso524g TL0o0pUTjPdb7rMh0wqqCDZYGrINeFvLV3YbF5dRjaicyTu3R0hs2Nhi/cxG83t3b8Yr /v5bZfo8dRstflqZ2XInXR/j4pmCjv3pdncTxs5KPrZAjiQMcXiH+Ik4L5QZoQRhhnjt H5fQ== X-Gm-Message-State: ALoCoQlB3ERsTFAnC4USa5AtfS1ADsNXde8WfYR8fRsCbf3WxhhyRfcNzKE5MW2l4qvVya+NqdLQ X-Received: by 10.68.138.227 with SMTP id qt3mr15744299pbb.6.1396622792584; Fri, 04 Apr 2014 07:46:32 -0700 (PDT) Received: from lgmac-josharris.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id ha11sm18288886pbd.17.2014.04.04.07.46.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 07:46:31 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib From: Warner Losh In-Reply-To: <152D73EE-DF9E-4757-B547-F1F22B12C824@FreeBSD.org> Date: Fri, 4 Apr 2014 08:46:29 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140404115256.GA85137@ivaldir.etoilebsd.net> <8D6AF193-A5A3-4A28-A230-97A543395ACA@ixsystems.com> <2E0EC8CB-B3EE-4DB8-A33D-58FD2107F14D@FreeBSD.org> <6A02504F-5543-4F91-92F6-7B4FB9A34DC4@ixsystems.com> <152D73EE-DF9E-4757-B547-F1F22B12C824@FreeBSD.org> To: David Chisnall X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, Jordan Hubbard , svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 14:46:33 -0000 On Apr 4, 2014, at 6:55 AM, David Chisnall wrote: > If we could build base with gcc47 from ports, that would be okay, = because then we'd have a modern C/C++ compiler in the base system and a = modern(ish - 4.8 / 4.9 would be better, but 4.7 is a reasonable = baseline) C/C++ compiler in ports to drive an external toolchain. I=92m targeting forward porting the =93interesting=94 FreeBSD specific = gcc to 4.8 and 4.9, and then working out the uber-ugly bootstrap we need = to do if we are going to support building the tree from scratch with it. =93Interesting=94 doesn=92t include: new instruction support, apple = changes, etc. Someone else will need to do that. The former isn=92t that = big a deal, since we mostly back ported that stuff. The latter was added = after I started this project and I decided IDGAS about that = functionality and it would be a distraction to the main thrust of the = project. I=92m happy of SEGAS on it though. Warner IDGAS =97 I don=92t Give =85 SEGAS =97 Someone else gives=85 From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 15:03:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B90B2AC1; Fri, 4 Apr 2014 15:03:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89441A3E; Fri, 4 Apr 2014 15:03:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34F341g043633; Fri, 4 Apr 2014 15:03:04 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34F34Yj043632; Fri, 4 Apr 2014 15:03:04 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404041503.s34F34Yj043632@svn.freebsd.org> From: Ian Lepore Date: Fri, 4 Apr 2014 15:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264119 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 15:03:04 -0000 Author: ian Date: Fri Apr 4 15:03:03 2014 New Revision: 264119 URL: http://svnweb.freebsd.org/changeset/base/264119 Log: Adjust the comments about translating clock divisor bits to match recent code changes. Modified: head/sys/arm/ti/ti_sdhci.c Modified: head/sys/arm/ti/ti_sdhci.c ============================================================================== --- head/sys/arm/ti/ti_sdhci.c Fri Apr 4 14:54:54 2014 (r264118) +++ head/sys/arm/ti/ti_sdhci.c Fri Apr 4 15:03:03 2014 (r264119) @@ -167,13 +167,12 @@ ti_sdhci_read_2(device_t dev, struct sdh * but doesn't split them into low:high fields. Instead they're a * single number in the range 0..1023 and the number is exactly the * clock divisor (with 0 and 1 both meaning divide by 1). The SDHCI - * driver code expects a v2.0 divisor (value N is power of two in the - * range 0..128 and clock is divided by 2N). The shifting and masking + * driver code expects a v2.0 or v3.0 divisor. The shifting and masking * here extracts the MMCHS representation from the hardware word, cleans - * those bits out, applies the 2N adjustment, and plugs that into the - * bit positions for the 2.0 divisor in the returned register value. The - * ti_sdhci_write_2() routine performs the opposite transformation when - * the SDHCI driver writes to the register. + * those bits out, applies the 2N adjustment, and plugs the result into + * the bit positions for the 2.0 or 3.0 divisor in the returned register + * value. The ti_sdhci_write_2() routine performs the opposite + * transformation when the SDHCI driver writes to the register. */ if (off == SDHCI_CLOCK_CONTROL) { val32 = RD4(sc, SDHCI_CLOCK_CONTROL); @@ -254,8 +253,9 @@ ti_sdhci_write_2(device_t dev, struct sd uint32_t clkdiv, val32; /* - * Translate between the hardware and SDHCI 2.0 representations of the - * clock divisor. See the comments in ti_sdhci_read_2() for details. + * Translate between the hardware and SDHCI 2.0 or 3.0 representations + * of the clock divisor. See the comments in ti_sdhci_read_2() for + * details. */ if (off == SDHCI_CLOCK_CONTROL) { clkdiv = (val >> SDHCI_DIVIDER_SHIFT) & SDHCI_DIVIDER_MASK; From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 15:31:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DF728BD; Fri, 4 Apr 2014 15:31:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEDF0D3B; Fri, 4 Apr 2014 15:31:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34FVv69056069; Fri, 4 Apr 2014 15:31:57 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34FVvPo056068; Fri, 4 Apr 2014 15:31:57 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404041531.s34FVvPo056068@svn.freebsd.org> From: Ian Lepore Date: Fri, 4 Apr 2014 15:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264120 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 15:31:58 -0000 Author: ian Date: Fri Apr 4 15:31:57 2014 New Revision: 264120 URL: http://svnweb.freebsd.org/changeset/base/264120 Log: Flag several sysctl variables as tunables. Modified: head/sys/arm/freescale/imx/imx6_anatop.c Modified: head/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_anatop.c Fri Apr 4 15:03:03 2014 (r264119) +++ head/sys/arm/freescale/imx/imx6_anatop.c Fri Apr 4 15:31:57 2014 (r264120) @@ -375,11 +375,11 @@ cpufreq_initialize(struct imx6_anatop_so "CPU frequency"); SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), - OID_AUTO, "cpu_minmhz", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + OID_AUTO, "cpu_minmhz", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0, cpufreq_sysctl_minmhz, "IU", "Minimum CPU frequency"); SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), - OID_AUTO, "cpu_maxmhz", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + OID_AUTO, "cpu_maxmhz", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0, cpufreq_sysctl_maxmhz, "IU", "Maximum CPU frequency"); SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), @@ -387,7 +387,8 @@ cpufreq_initialize(struct imx6_anatop_so "Maximum CPU frequency allowed by hardware"); SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), - OID_AUTO, "cpu_overclock_enable", CTLFLAG_RW, &sc->cpu_overclock_enable, 0, + OID_AUTO, "cpu_overclock_enable", CTLFLAG_RWTUN, + &sc->cpu_overclock_enable, 0, "Allow setting CPU frequency higher than cpu_maxmhz_hw"); /* From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 15:49:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA296CDB; Fri, 4 Apr 2014 15:49:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7998E7F; Fri, 4 Apr 2014 15:49:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34FnNmu060955; Fri, 4 Apr 2014 15:49:23 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34FnNQd060953; Fri, 4 Apr 2014 15:49:23 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201404041549.s34FnNQd060953@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 4 Apr 2014 15:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264121 - in head: contrib/gcc sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 15:49:24 -0000 Author: pfg Date: Fri Apr 4 15:49:23 2014 New Revision: 264121 URL: http://svnweb.freebsd.org/changeset/base/264121 Log: gcc: define __block when block support is enabled This mimics the behaviour in clang and lets us build cleanly the libdispatch port on platforms where the base gcc is still the default compiler. Bump __FreeBSD_version for ports. Tested by: theraven MFC after: 3 days Modified: head/contrib/gcc/c-cppbuiltin.c head/sys/sys/param.h Modified: head/contrib/gcc/c-cppbuiltin.c ============================================================================== --- head/contrib/gcc/c-cppbuiltin.c Fri Apr 4 15:31:57 2014 (r264120) +++ head/contrib/gcc/c-cppbuiltin.c Fri Apr 4 15:49:23 2014 (r264121) @@ -504,7 +504,10 @@ c_cpp_builtins (cpp_reader *pfile) /* APPLE LOCAL begin blocks */ /* APPLE LOCAL radar 5868913 */ if (flag_blocks) - cpp_define (pfile, "__BLOCKS__=1"); + { + cpp_define (pfile, "__block=__attribute__((__blocks__(byref)))"); + cpp_define (pfile, "__BLOCKS__=1"); + } /* APPLE LOCAL end blocks */ if (optimize_size) cpp_define (pfile, "__OPTIMIZE_SIZE__"); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Apr 4 15:31:57 2014 (r264120) +++ head/sys/sys/param.h Fri Apr 4 15:49:23 2014 (r264121) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100016 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100017 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 15:49:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95F92E16; Fri, 4 Apr 2014 15:49:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8211EE85; Fri, 4 Apr 2014 15:49:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34Fnc73061019; Fri, 4 Apr 2014 15:49:38 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34Fncqp061017; Fri, 4 Apr 2014 15:49:38 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404041549.s34Fncqp061017@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 4 Apr 2014 15:49:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264122 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 15:49:38 -0000 Author: trasz Date: Fri Apr 4 15:49:37 2014 New Revision: 264122 URL: http://svnweb.freebsd.org/changeset/base/264122 Log: Rework the iSCSI PDU transmit code to avoid lock contention and coalesce PDUs before sending. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.c head/sys/dev/iscsi/icl.h Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Fri Apr 4 15:49:23 2014 (r264121) +++ head/sys/dev/iscsi/icl.c Fri Apr 4 15:49:37 2014 (r264122) @@ -63,6 +63,10 @@ static int debug = 1; TUNABLE_INT("kern.icl.debug", &debug); SYSCTL_INT(_kern_icl, OID_AUTO, debug, CTLFLAG_RWTUN, &debug, 1, "Enable debug messages"); +static int coalesce = 1; +TUNABLE_INT("kern.icl.coalesce", &coalesce); +SYSCTL_INT(_kern_icl, OID_AUTO, coalesce, CTLFLAG_RWTUN, + &coalesce, 1, "Try to coalesce PDUs before sending"); static int partial_receive_len = 1 * 1024; /* XXX: More? */ TUNABLE_INT("kern.icl.partial_receive_len", &partial_receive_len); SYSCTL_INT(_kern_icl, OID_AUTO, partial_receive_len, CTLFLAG_RWTUN, @@ -772,18 +776,14 @@ icl_soupcall_receive(struct socket *so, } static int -icl_pdu_send(struct icl_pdu *request) +icl_pdu_finalize(struct icl_pdu *request) { size_t padding, pdu_len; uint32_t digest, zero = 0; - int error, ok; - struct socket *so; + int ok; struct icl_conn *ic; ic = request->ip_conn; - so = request->ip_conn->ic_socket; - - ICL_CONN_LOCK_ASSERT(ic); icl_pdu_set_data_segment_length(request, request->ip_data_len); @@ -816,7 +816,7 @@ icl_pdu_send(struct icl_pdu *request) ok = m_append(request->ip_data_mbuf, sizeof(digest), (void *)&digest); if (ok != 1) { - ICL_WARN("failed to append header digest"); + ICL_WARN("failed to append data digest"); return (1); } } @@ -827,64 +827,114 @@ icl_pdu_send(struct icl_pdu *request) request->ip_bhs_mbuf->m_pkthdr.len = pdu_len; - error = sosend(so, NULL, NULL, request->ip_bhs_mbuf, - NULL, MSG_DONTWAIT, curthread); - request->ip_bhs_mbuf = NULL; /* Sosend consumes the mbuf. */ - if (error != 0) { - ICL_DEBUG("sosend error %d", error); - return (error); - } - return (0); } static void -icl_conn_send_pdus(struct icl_conn *ic) +icl_conn_send_pdus(struct icl_conn *ic, void *fts) { - struct icl_pdu *request; + STAILQ_HEAD(, icl_pdu) *queue = fts; /* XXX */ + struct icl_pdu *request, *request2; struct socket *so; - size_t available, size; - int error; + size_t available, size, size2; + int coalesced, error; - ICL_CONN_LOCK_ASSERT(ic); + ICL_CONN_LOCK_ASSERT_NOT(ic); so = ic->ic_socket; SOCKBUF_LOCK(&so->so_snd); + /* + * Check how much space do we have for transmit. We can't just + * call sosend() and retry when we get EWOULDBLOCK or EMSGSIZE, + * as it always frees the mbuf chain passed to it, even in case + * of error. + */ available = sbspace(&so->so_snd); + + /* + * Notify the socket layer that it doesn't need to call + * send socket upcall for the time being. + */ + so->so_snd.sb_lowat = so->so_snd.sb_hiwat; SOCKBUF_UNLOCK(&so->so_snd); - while (!STAILQ_EMPTY(&ic->ic_to_send)) { + while (!STAILQ_EMPTY(queue)) { if (ic->ic_disconnecting) return; - - request = STAILQ_FIRST(&ic->ic_to_send); + request = STAILQ_FIRST(queue); size = icl_pdu_size(request); if (available < size) { +#if 1 + ICL_DEBUG("no space to send; " + "have %zd, need %zd", + available, size); +#endif + /* * Set the low watermark on the socket, - * to avoid waking up until there is enough - * space. + * to avoid unneccessary wakeups until there + * is enough space for the PDU to fit. */ SOCKBUF_LOCK(&so->so_snd); so->so_snd.sb_lowat = size; SOCKBUF_UNLOCK(&so->so_snd); -#if 1 - ICL_DEBUG("no space to send; " - "have %zd, need %zd", - available, size); -#endif return; } - available -= size; - STAILQ_REMOVE_HEAD(&ic->ic_to_send, ip_next); - error = icl_pdu_send(request); + STAILQ_REMOVE_HEAD(queue, ip_next); + error = icl_pdu_finalize(request); if (error != 0) { - ICL_DEBUG("failed to send PDU; " + ICL_DEBUG("failed to finalize PDU; " "dropping connection"); icl_conn_fail(ic); + icl_pdu_free(request); return; - } + } + if (coalesce) { + coalesced = 1; + for (;;) { + request2 = STAILQ_FIRST(queue); + if (request2 == NULL) + break; + size2 = icl_pdu_size(request2); + if (available < size + size2) + break; + STAILQ_REMOVE_HEAD(queue, ip_next); + error = icl_pdu_finalize(request2); + if (error != 0) { + ICL_DEBUG("failed to finalize PDU; " + "dropping connection"); + icl_conn_fail(ic); + icl_pdu_free(request); + icl_pdu_free(request2); + return; + } + m_cat(request->ip_bhs_mbuf, request2->ip_bhs_mbuf); + request2->ip_bhs_mbuf = NULL; + request->ip_bhs_mbuf->m_pkthdr.len += size2; + size += size2; + STAILQ_REMOVE_AFTER(queue, request, ip_next); + icl_pdu_free(request2); + coalesced++; + } +#if 0 + if (coalesced > 1) { + ICL_DEBUG("coalesced %d PDUs into %zd bytes", + coalesced, size); + } +#endif + } + available -= size; + error = sosend(so, NULL, NULL, request->ip_bhs_mbuf, + NULL, MSG_DONTWAIT, curthread); + request->ip_bhs_mbuf = NULL; /* Sosend consumes the mbuf. */ + if (error != 0) { + ICL_DEBUG("failed to send PDU, error %d; " + "dropping connection", error); + icl_conn_fail(ic); + icl_pdu_free(request); + return; + } icl_pdu_free(request); } } @@ -893,9 +943,12 @@ static void icl_send_thread(void *arg) { struct icl_conn *ic; + STAILQ_HEAD(, icl_pdu) queue; ic = arg; + STAILQ_INIT(&queue); + ICL_CONN_LOCK(ic); ic->ic_send_running = true; @@ -904,10 +957,54 @@ icl_send_thread(void *arg) //ICL_DEBUG("terminating"); break; } - icl_conn_send_pdus(ic); + + for (;;) { + /* + * If the local queue is empty, populate it from + * the main one. This way the icl_conn_send_pdus() + * can go through all the queued PDUs without holding + * any locks. + */ + if (STAILQ_EMPTY(&queue)) + STAILQ_SWAP(&ic->ic_to_send, &queue, icl_pdu); + + ic->ic_check_send_space = false; + ICL_CONN_UNLOCK(ic); + icl_conn_send_pdus(ic, &queue); + ICL_CONN_LOCK(ic); + + /* + * The icl_soupcall_send() was called since the last + * call to sbspace(); go around; + */ + if (ic->ic_check_send_space) + continue; + + /* + * Local queue is empty, but we still have PDUs + * in the main one; go around. + */ + if (STAILQ_EMPTY(&queue) && + !STAILQ_EMPTY(&ic->ic_to_send)) + continue; + + /* + * There might be some stuff in the local queue, + * which didn't get sent due to not having enough send + * space. Wait for socket upcall. + */ + break; + } + cv_wait(&ic->ic_send_cv, ic->ic_lock); } + /* + * We're exiting; move PDUs back to the main queue, so they can + * get freed properly. At this point ordering doesn't matter. + */ + STAILQ_CONCAT(&ic->ic_to_send, &queue); + ic->ic_send_running = false; ICL_CONN_UNLOCK(ic); kthread_exit(); @@ -919,12 +1016,19 @@ icl_soupcall_send(struct socket *so, voi struct icl_conn *ic; ic = arg; + + ICL_CONN_LOCK(ic); + ic->ic_check_send_space = true; + ICL_CONN_UNLOCK(ic); + cv_signal(&ic->ic_send_cv); + return (SU_OK); } int -icl_pdu_append_data(struct icl_pdu *request, const void *addr, size_t len, int flags) +icl_pdu_append_data(struct icl_pdu *request, const void *addr, size_t len, + int flags) { struct mbuf *mb, *newmb; size_t copylen, off = 0; @@ -977,6 +1081,17 @@ icl_pdu_queue(struct icl_pdu *ip) icl_pdu_free(ip); return; } + + if (!STAILQ_EMPTY(&ic->ic_to_send)) { + STAILQ_INSERT_TAIL(&ic->ic_to_send, ip, ip_next); + /* + * If the queue is not empty, someone else had already + * signaled the send thread; no need to do that again, + * just return. + */ + return; + } + STAILQ_INSERT_TAIL(&ic->ic_to_send, ip, ip_next); cv_signal(&ic->ic_send_cv); } @@ -1188,6 +1303,20 @@ icl_conn_close(struct icl_conn *ic) return; } + /* + * Deregister socket upcalls. + */ + ICL_CONN_UNLOCK(ic); + SOCKBUF_LOCK(&ic->ic_socket->so_snd); + if (ic->ic_socket->so_snd.sb_upcall != NULL) + soupcall_clear(ic->ic_socket, SO_SND); + SOCKBUF_UNLOCK(&ic->ic_socket->so_snd); + SOCKBUF_LOCK(&ic->ic_socket->so_rcv); + if (ic->ic_socket->so_rcv.sb_upcall != NULL) + soupcall_clear(ic->ic_socket, SO_RCV); + SOCKBUF_UNLOCK(&ic->ic_socket->so_rcv); + ICL_CONN_LOCK(ic); + ic->ic_disconnecting = true; /* @@ -1205,7 +1334,9 @@ icl_conn_close(struct icl_conn *ic) } //ICL_DEBUG("send/receive threads terminated"); + ICL_CONN_UNLOCK(ic); soclose(ic->ic_socket); + ICL_CONN_LOCK(ic); ic->ic_socket = NULL; if (ic->ic_receive_pdu != NULL) { Modified: head/sys/dev/iscsi/icl.h ============================================================================== --- head/sys/dev/iscsi/icl.h Fri Apr 4 15:49:23 2014 (r264121) +++ head/sys/dev/iscsi/icl.h Fri Apr 4 15:49:37 2014 (r264122) @@ -80,6 +80,7 @@ struct icl_conn { volatile u_int ic_outstanding_pdus; #endif STAILQ_HEAD(, icl_pdu) ic_to_send; + bool ic_check_send_space; size_t ic_receive_len; int ic_receive_state; struct icl_pdu *ic_receive_pdu; From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 15:52:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6512AD2; Fri, 4 Apr 2014 15:52:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51BF8F4F; Fri, 4 Apr 2014 15:52:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34Fqk54064317; Fri, 4 Apr 2014 15:52:46 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34FqkRC064315; Fri, 4 Apr 2014 15:52:46 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201404041552.s34FqkRC064315@svn.freebsd.org> From: Sean Bruno Date: Fri, 4 Apr 2014 15:52:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264123 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 15:52:46 -0000 Author: sbruno Date: Fri Apr 4 15:52:45 2014 New Revision: 264123 URL: http://svnweb.freebsd.org/changeset/base/264123 Log: Change kernel/rootfs hints to use search patterns instead of absolute locations. Modified: head/sys/mips/conf/WZR-300HP.hints Modified: head/sys/mips/conf/WZR-300HP.hints ============================================================================== --- head/sys/mips/conf/WZR-300HP.hints Fri Apr 4 15:49:37 2014 (r264122) +++ head/sys/mips/conf/WZR-300HP.hints Fri Apr 4 15:52:45 2014 (r264123) @@ -97,12 +97,12 @@ hint.map.2.readonly=1 hint.map.3.at="flash/spi0" hint.map.3.start=0x00060000 -hint.map.3.end= 0x00160000 +hint.map.3.end= "search:0x00100000:0x10000:.!/bin/sh" hint.map.3.name="kernel" hint.map.3.readonly=1 hint.map.4.at="flash/spi0" -hint.map.4.start=0x00160000 +hint.map.4.start="search:0x00100000:0x10000:.!/bin/sh" hint.map.4.end= 0x00FF0000 hint.map.4.name="rootfs" hint.map.4.readonly=1 From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 15:55:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E1CA22B; Fri, 4 Apr 2014 15:55:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B257F60; Fri, 4 Apr 2014 15:55:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34FtcN1064726; Fri, 4 Apr 2014 15:55:38 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34FtcXb064725; Fri, 4 Apr 2014 15:55:38 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201404041555.s34FtcXb064725@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 4 Apr 2014 15:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264124 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 15:55:38 -0000 Author: ae Date: Fri Apr 4 15:55:38 2014 New Revision: 264124 URL: http://svnweb.freebsd.org/changeset/base/264124 Log: Remove dead code. MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netipsec/xform_ipip.c Modified: head/sys/netipsec/xform_ipip.c ============================================================================== --- head/sys/netipsec/xform_ipip.c Fri Apr 4 15:52:45 2014 (r264123) +++ head/sys/netipsec/xform_ipip.c Fri Apr 4 15:55:38 2014 (r264124) @@ -65,9 +65,6 @@ #include #include #include -#ifdef MROUTING -#include -#endif #include #include @@ -208,18 +205,8 @@ _ipip_input(struct mbuf *m, int iphlen, return; } } - ipo = mtod(m, struct ip *); -#ifdef MROUTING - if (ipo->ip_v == IPVERSION && ipo->ip_p == IPPROTO_IPV4) { - if (IN_MULTICAST(((struct ip *)((char *) ipo + iphlen))->ip_dst.s_addr)) { - ipip_mroute_input (m, iphlen); - return; - } - } -#endif /* MROUTING */ - /* Keep outer ecn field. */ switch (v >> 4) { #ifdef INET From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 15:57:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D8D8475; Fri, 4 Apr 2014 15:57:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AAE9F77; Fri, 4 Apr 2014 15:57:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34FvRgc065052; Fri, 4 Apr 2014 15:57:27 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34FvR8J065051; Fri, 4 Apr 2014 15:57:27 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201404041557.s34FvR8J065051@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 4 Apr 2014 15:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264125 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 15:57:28 -0000 Author: ae Date: Fri Apr 4 15:57:27 2014 New Revision: 264125 URL: http://svnweb.freebsd.org/changeset/base/264125 Log: Remove unused variable. MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netipsec/xform_ipip.c Modified: head/sys/netipsec/xform_ipip.c ============================================================================== --- head/sys/netipsec/xform_ipip.c Fri Apr 4 15:55:38 2014 (r264124) +++ head/sys/netipsec/xform_ipip.c Fri Apr 4 15:57:27 2014 (r264125) @@ -170,7 +170,6 @@ _ipip_input(struct mbuf *m, int iphlen, struct ip6_hdr *ip6 = NULL; u_int8_t itos; #endif - u_int8_t nxt; int isr; u_int8_t otos; u_int8_t v; @@ -275,14 +274,12 @@ _ipip_input(struct mbuf *m, int iphlen, #ifdef INET case 4: ipo = mtod(m, struct ip *); - nxt = ipo->ip_p; ip_ecn_egress(V_ip4_ipsec_ecn, &otos, &ipo->ip_tos); break; #endif /* INET */ #ifdef INET6 case 6: ip6 = (struct ip6_hdr *) ipo; - nxt = ip6->ip6_nxt; itos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; ip_ecn_egress(V_ip6_ipsec_ecn, &otos, &itos); ip6->ip6_flow &= ~htonl(0xff << 20); From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 16:24:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2E0FE02 for ; Fri, 4 Apr 2014 16:24:18 +0000 (UTC) Received: from mail-pd0-f180.google.com (mail-pd0-f180.google.com [209.85.192.180]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E221276 for ; Fri, 4 Apr 2014 16:24:18 +0000 (UTC) Received: by mail-pd0-f180.google.com with SMTP id v10so3540975pde.39 for ; Fri, 04 Apr 2014 09:24:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=uSJHKpJ4H5BI6IBnthfUzmhbjiwF54zCJg46y2Agpl8=; b=FHeEoJMbS5RANfeOt9KRnEQZv2acvlleE+TEcRUVhaLPNXGheg3GsVnuKUGxMb3EMP 1Efv6/1eXp0ORHhQzzZIS0efnRfVhyF2ncsXIfocEjUd3HKEza24ZN6rn7lXvV237xEJ sFjyO5Rd9sxOKDmui0NucsKiJF822ZmAq3Mlk9ejMYms8A5Jr0Yo1PWzPgyrOjd4f+0k PYaar+NXn498W6VRTI77mh9/Lz41BiryCsCBLmEYrQ6HI+RE/tP/f7i06RwZSwLdzi9E ryZ8lQRibE8d/LcPnxjmCAEvHOeVBWi5+k95yNFS8dp0WJVtVgNmRYoyUVIlUNSnrtTW 2lUw== X-Gm-Message-State: ALoCoQlU7vyFC1QLlgvZeZsX74j3M+Zj9xctk2N26EihCvL0Oo+JQ9T94MEUXrTruz0irPbldRKo X-Received: by 10.66.162.74 with SMTP id xy10mr16164312pab.4.1396628652408; Fri, 04 Apr 2014 09:24:12 -0700 (PDT) Received: from lgmac-josharris.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id hw8sm18734382pbc.62.2014.04.04.09.24.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 09:24:11 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib From: Warner Losh In-Reply-To: Date: Fri, 4 Apr 2014 10:24:09 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140404115256.GA85137@ivaldir.etoilebsd.net> <8D6AF193-A5A3-4A28-A230-97A543395ACA@ixsystems.com> <2E0EC8CB-B3EE-4DB8-A33D-58FD2107F14D@FreeBSD.org> <6A02504F-5543-4F91-92F6-7B4FB9A34DC4@ixsystems.com> <152D73EE-DF9E-4757-B547-F1F22B12C824@FreeBSD.org> To: Jordan Hubbard X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, David Chisnall , svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 16:24:18 -0000 On Apr 4, 2014, at 7:44 AM, Jordan Hubbard wrote: >> For embedded uses, we'd also like to build FreeBSD with = vendor's-ugly-hacked-up-gcc-of-the-week. This is less of an issue now = for ARM, but MIPS vendors still hack up gcc in such a way that there's = no way that they can get their changes upstreamed and then ship the = result with their chips. >=20 > I see. That=92s pretty ugly indeed - is there a list of FreeBSD MIPS = folks doing this somewhere? I ask out of curiosity to know if there=92s = any collective attempt to chain them all together and insist that they = improve clang/MIPS to the point where they can stop doing ugly-ass gcc = ports. :) Good luck with that. There are some vendors that have good engagement = with FreeBSD and the community. There are others where the engagement is = sporadic at best. FreeBSD is a second tier item, and gcc works well = enough for Linux, so what=92s your problem? Also, it is more culturally = acceptable in Linux land to get your compiler from a vendor supplied = SDK. There=92s some motion to bring that support back to the original = (though the horrible term =93upstreaming=94), but that lags = significantly, and often results in a compiler that=92s not quite as = optimal as the vendor hacked ones, so those tend to live on and on. ARM has been good about making sure there=92s good, clean support for = their designs in gcc and clang. MIPS has been adrift for a while, so = hasn=92t been a driving force in that area (although to their credit, = some funding has happened). There are more MIPS variations out there = that have been evolving for a long time than with ARM, since most ARM = SoC vendors get the core from ARM and do little to nothing with the base = core, instead innovating on the peripherals. The long and the short of this means that we=92ll need external = toolchain support for FreeBSD, and not only external toolchain support, = but better compiler support in the base than we have. Right now we have = clang and gcc. At a minimum, we=92ll need to grow a version notion (as = switches differ), and may need different levels of external toolchain = support: just build the system with a pre-built (by magic!) toolchain = with sysroot, same without sysroot and the ability to bootstrap the = external toolchain... Warner From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 16:27:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A17E1F8C for ; Fri, 4 Apr 2014 16:27:52 +0000 (UTC) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52BED292 for ; Fri, 4 Apr 2014 16:27:52 +0000 (UTC) Received: by mail-pa0-f45.google.com with SMTP id kl14so3693020pab.4 for ; Fri, 04 Apr 2014 09:27:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=oLrSV/jleu2j5l0ryQ2F5D2GU6c2aOLuEGGdtOi26bA=; b=LUZrZtRwj60crU2d1FjisXYJA8ZhIfjSdqGQp71htVa0123mZQ8x8NaHwn9NJ/fYuj P5cvzvSNp5qnsneTWYqo+oWijiAv9RGMBMKb5fgcfkTeCqeWbx5IIb1OiDg7i4e3RDWq hcnw85dkZlAX3gAueuyz78hDTOXYieO+E1FXbKVUO1ilUoypewhZNog/GV2TzWFXB34d klmNSIZMXVeIHAyTX1uZ4V1zm4q5V3wPQldR1u4am0W60JMqcGtIT/YBsrvf6yUHT/fL /bxU0Isy2U5572UuYilTfdMNpjI4gZByPH/RRKIEPRFVoVtu/xaV96MnyFA0RDa/wpXd 6hpg== X-Gm-Message-State: ALoCoQlWt4b7K2YTPDdtxlTOvFK8ataSVmsFA0lxiU1NaqQJlYzcVNqch8w+IUdrkGHo93oWirSn X-Received: by 10.66.164.70 with SMTP id yo6mr16013168pab.85.1396628866478; Fri, 04 Apr 2014 09:27:46 -0700 (PDT) Received: from lgmac-josharris.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id qh2sm42795028pab.13.2014.04.04.09.27.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 09:27:45 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib From: Warner Losh In-Reply-To: <8E3BD3C1-A441-48C5-97BC-45EF67513096@FreeBSD.org> Date: Fri, 4 Apr 2014 10:27:44 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <9E916835-C870-4F7E-B594-EB4671C404B2@gmail.com> References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140404115256.GA85137@ivaldir.etoilebsd.net> <8D6AF193-A5A3-4A28-A230-97A543395ACA@ixsystems.com> <2E0EC8CB-B3EE-4DB8-A33D-58FD2107F14D@FreeBSD.org> <6A02504F-5543-4F91-92F6-7B4FB9A34DC4@ixsystems.com> <152D73EE-DF9E-4757-B547-F1F22B12C824@FreeBSD.org> <8E3BD3C1-A441-48C5-97BC-45EF67513096@FreeBSD.org> To: David Chisnall X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, Jordan Hubbard , svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 16:27:52 -0000 On Apr 4, 2014, at 8:03 AM, David Chisnall wrote: > On 4 Apr 2014, at 14:44, Jordan Hubbard wrote: >=20 >> Ah, OK. And I=92m guessing there=92s been no interest in = forward-porting the blocks support to 4.7? That=92s kind of=85 a = bummer. >=20 > I don't think so. Warner has been forward-porting some of the FreeBSD = binutils changes, but even Pedro (who did the blocks port to FreeBSD gcc = 4.2.1) doesn't want to touch gcc anymore. =20 As far as I can tell, all the binutils stuff is upstream. It=92s the gcc = hacks that we=92ve done that I=92m working on. >> I=92m guessing the great white hope for all the platforms is a slow = convergence on clang then? What is the compiler toolchain master plan? = If there=92s a wiki somewhere describing it, I=92d also be happy to just = go read that. >=20 > Not really. Converging on clang is nice, but even then it's good to = have (at least) a second working compiler for several reasons: >=20 > - As we discovered with gcc, having a single source for a core = component is usually not ideal, as they can change the rules suddenly >=20 > - If there's a bug in clang (and, given that it's getting on for a = million lines of C++ code now, the odds are good that there are always = going to be a few), it's helpful to have another compiler for testing. >=20 > - Periodic testing with another compiler stops us shipping code that = relies on non-conformant behaviour. The amount of effort that it's = required to get the Linux kernel to build with clang should be a warning = for us - we don't want to fall into the same trap. >=20 > That said, I think we're increasingly going to be using LLVM for = things that are beyond just simple AOT compilation, so platforms with no = LLVM back end are likely to be left behind. I image there will be a slow rollout of the LLVM features, where they = replace current features to make them faster, the non-clang platforms = get less optimal performance. For new features, the non-clang platforms = might get reduced functionality in that area. I doubt that we=92ll have = any core, mandatory feature requiring LLVM for some time, though that = day may come=85 I doubt it will be a sudden switch. In the mean time, things like gcc x86 kernel builds start to decay=85 = They are broken right now=85 Warner= From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 16:58:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C6B9C6C; Fri, 4 Apr 2014 16:58:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F39277A; Fri, 4 Apr 2014 16:58:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34GwW1o089912; Fri, 4 Apr 2014 16:58:32 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34GwWkW089911; Fri, 4 Apr 2014 16:58:32 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201404041658.s34GwWkW089911@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 4 Apr 2014 16:58:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264126 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 16:58:33 -0000 Author: ae Date: Fri Apr 4 16:58:32 2014 New Revision: 264126 URL: http://svnweb.freebsd.org/changeset/base/264126 Log: The check for local address spoofing lacks ifaddr locking. Remove these loops and use in_localip() and in6_localip() functions instead. MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netipsec/xform_ipip.c Modified: head/sys/netipsec/xform_ipip.c ============================================================================== --- head/sys/netipsec/xform_ipip.c Fri Apr 4 15:57:27 2014 (r264125) +++ head/sys/netipsec/xform_ipip.c Fri Apr 4 16:58:32 2014 (r264126) @@ -159,14 +159,8 @@ ip4_input(struct mbuf *m, int off) static void _ipip_input(struct mbuf *m, int iphlen, struct ifnet *gifp) { -#ifdef INET - register struct sockaddr_in *sin; -#endif - register struct ifnet *ifp; - register struct ifaddr *ifa; struct ip *ipo; #ifdef INET6 - register struct sockaddr_in6 *sin6; struct ip6_hdr *ip6 = NULL; u_int8_t itos; #endif @@ -294,47 +288,22 @@ _ipip_input(struct mbuf *m, int iphlen, if ((m->m_pkthdr.rcvif == NULL || !(m->m_pkthdr.rcvif->if_flags & IFF_LOOPBACK)) && V_ipip_allow != 2) { - IFNET_RLOCK_NOSLEEP(); - TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { -#ifdef INET - if (ipo) { - if (ifa->ifa_addr->sa_family != - AF_INET) - continue; - - sin = (struct sockaddr_in *) ifa->ifa_addr; - - if (sin->sin_addr.s_addr == - ipo->ip_src.s_addr) { - IPIPSTAT_INC(ipips_spoof); - m_freem(m); - IFNET_RUNLOCK_NOSLEEP(); - return; - } - } -#endif /* INET */ - +#ifdef INET + if ((v >> 4) == IPVERSION && + in_localip(ipo->ip_src) != 0) { + IPIPSTAT_INC(ipips_spoof); + m_freem(m); + return; + } +#endif #ifdef INET6 - if (ip6) { - if (ifa->ifa_addr->sa_family != - AF_INET6) - continue; - - sin6 = (struct sockaddr_in6 *) ifa->ifa_addr; - - if (IN6_ARE_ADDR_EQUAL(&sin6->sin6_addr, &ip6->ip6_src)) { - IPIPSTAT_INC(ipips_spoof); - m_freem(m); - IFNET_RUNLOCK_NOSLEEP(); - return; - } - - } -#endif /* INET6 */ - } + if ((v & IPV6_VERSION_MASK) == IPV6_VERSION && + in6_localip(&ip6->ip6_src) != 0) { + IPIPSTAT_INC(ipips_spoof); + m_freem(m); + return; } - IFNET_RUNLOCK_NOSLEEP(); +#endif } /* Statistics */ From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 17:01:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5AF315C; Fri, 4 Apr 2014 17:01:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2EB5817; Fri, 4 Apr 2014 17:01:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34H1ncx093432; Fri, 4 Apr 2014 17:01:49 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34H1nmt093431; Fri, 4 Apr 2014 17:01:49 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201404041701.s34H1nmt093431@svn.freebsd.org> From: Sean Bruno Date: Fri, 4 Apr 2014 17:01:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264127 - head/sys/dev/ciss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 17:01:50 -0000 Author: sbruno Date: Fri Apr 4 17:01:49 2014 New Revision: 264127 URL: http://svnweb.freebsd.org/changeset/base/264127 Log: Add PCI-IDs for TBD Gen9 RAID controller HBAs from HP to ciss(4) Submitted by: Benesh, Scott MFC after: 2 weeks Sponsored by: Yahoo! Inc. Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Fri Apr 4 16:58:32 2014 (r264126) +++ head/sys/dev/ciss/ciss.c Fri Apr 4 17:01:49 2014 (r264127) @@ -347,6 +347,21 @@ static struct { 0x103C, 0x1928, CISS_BOARD_SA5, "HP Smart Array P230i" }, { 0x103C, 0x1929, CISS_BOARD_SA5, "HP Smart Array P530" }, { 0x103C, 0x192A, CISS_BOARD_SA5, "HP Smart Array P531" }, + { 0x103C, 0x21BD, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21BE, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21BF, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21C0, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21C2, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21C3, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21C5, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21C6, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21C7, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21C8, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21CA, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21CB, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21CC, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21CD, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21CE, CISS_BOARD_SA5, "HP Smart Array TBD" }, { 0, 0, 0, NULL } }; From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 17:39:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C59B8C1F; Fri, 4 Apr 2014 17:39:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3365B10; Fri, 4 Apr 2014 17:39:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34Hd5LN006650; Fri, 4 Apr 2014 17:39:05 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34Hd5cY006649; Fri, 4 Apr 2014 17:39:05 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404041739.s34Hd5cY006649@svn.freebsd.org> From: Ian Lepore Date: Fri, 4 Apr 2014 17:39:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264128 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 17:39:05 -0000 Author: ian Date: Fri Apr 4 17:39:05 2014 New Revision: 264128 URL: http://svnweb.freebsd.org/changeset/base/264128 Log: Fix TTB set operation for armv7. Perform sychronization (by "isb" barrier) after TTB is set. This is done to ensure that TLB invalidation always executes after TTB modification and operates on valid CP15 data (per specification). Submitted by: Wojciech Macek Reviewed by: ian@, cognet@ Modified: head/sys/arm/arm/cpufunc_asm_armv7.S Modified: head/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_armv7.S Fri Apr 4 17:01:49 2014 (r264127) +++ head/sys/arm/arm/cpufunc_asm_armv7.S Fri Apr 4 17:39:05 2014 (r264128) @@ -71,6 +71,7 @@ ENTRY(armv7_setttb) orr r0, r0, #PT_ATTR mcr p15, 0, r0, c2, c0, 0 /* Translation Table Base Register 0 (TTBR0) */ + isb #ifdef SMP mcr p15, 0, r0, c8, c3, 0 /* invalidate I+D TLBs Inner Shareable*/ #else @@ -273,6 +274,7 @@ ENTRY(armv7_context_switch) orr r0, r0, #PT_ATTR mcr p15, 0, r0, c2, c0, 0 /* set the new TTB */ + isb #ifdef SMP mcr p15, 0, r0, c8, c3, 0 /* and flush the I+D tlbs Inner Sharable */ #else From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 17:45:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E4B7F50; Fri, 4 Apr 2014 17:45:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E48CBCE; Fri, 4 Apr 2014 17:45:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34HjeNr010399; Fri, 4 Apr 2014 17:45:40 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34HjeUE010398; Fri, 4 Apr 2014 17:45:40 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404041745.s34HjeUE010398@svn.freebsd.org> From: Ian Lepore Date: Fri, 4 Apr 2014 17:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264129 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 17:45:40 -0000 Author: ian Date: Fri Apr 4 17:45:39 2014 New Revision: 264129 URL: http://svnweb.freebsd.org/changeset/base/264129 Log: Fix TLB maintenance issues for armv6 and armv7. - Add cpu_cpwait to comply with the convention. - Add missing TLB invalidations, especially in pmap_kenter & pmap_kremove with distinguishing between D and ID pages. - Modify pmap init/bootstrap invalidations to ID, just to be safe. - Fix TLB-inv and PTE_SYNC ordering. This combines changes submitted by ian@, cognet@, and Wojciech Macek, which have all been tested together as a unit. Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Fri Apr 4 17:39:05 2014 (r264128) +++ head/sys/arm/arm/pmap-v6.c Fri Apr 4 17:45:39 2014 (r264129) @@ -1047,6 +1047,7 @@ small_mappings: cpu_tlb_flushID_SE(pv->pv_va); else if (PTE_BEEN_REFD(opte)) cpu_tlb_flushD_SE(pv->pv_va); + cpu_cpwait(); } PMAP_UNLOCK(pmap); @@ -1134,8 +1135,8 @@ vector_page_setprot(int prot) *ptep |= L2_S_REF; pmap_set_prot(ptep, prot|VM_PROT_EXECUTE, 0); - - cpu_tlb_flushD_SE(vector_page); + PTE_SYNC(ptep); + cpu_tlb_flushID_SE(vector_page); cpu_cpwait(); } @@ -1643,8 +1644,8 @@ pmap_postinit(void) pte = (pte & ~L2_S_CACHE_MASK) | pte_l2_s_cache_mode_pt; *ptep = pte; PTE_SYNC(ptep); - cpu_tlb_flushD_SE(va); - + cpu_tlb_flushID_SE(va); + cpu_cpwait(); va += PAGE_SIZE; } pmap_init_l1(l1, pl1pt); @@ -1948,6 +1949,8 @@ pmap_bootstrap(vm_offset_t firstaddr, st pmap_init_l1(l1, kernel_l1pt); cpu_dcache_wbinv_all(); cpu_l2cache_wbinv_all(); + cpu_tlb_flushID(); + cpu_cpwait(); virtual_avail = round_page(virtual_avail); virtual_end = vm_max_kernel_address; @@ -2034,6 +2037,8 @@ pmap_grow_map(vm_offset_t va, pt_entry_t *ptep = L2_S_PROTO | pa | cache_mode | L2_S_REF; pmap_set_prot(ptep, VM_PROT_READ | VM_PROT_WRITE, 0); PTE_SYNC(ptep); + cpu_tlb_flushD_SE(va); + cpu_cpwait(); return (0); } @@ -2348,6 +2353,8 @@ pmap_kenter_section(vm_offset_t va, vm_o l1->l1_kva[L1_IDX(va)] = pd; PTE_SYNC(&l1->l1_kva[L1_IDX(va)]); } + cpu_tlb_flushID_SE(va); + cpu_cpwait(); } /* @@ -2387,13 +2394,6 @@ pmap_kenter_internal(vm_offset_t va, vm_ ptep = &l2b->l2b_kva[l2pte_index(va)]; opte = *ptep; - if (l2pte_valid(opte)) { - cpu_tlb_flushD_SE(va); - cpu_cpwait(); - } else { - if (opte == 0) - l2b->l2b_occupancy++; - } if (flags & KENTER_CACHE) { *ptep = L2_S_PROTO | pa | pte_l2_s_cache_mode | L2_S_REF; @@ -2405,10 +2405,19 @@ pmap_kenter_internal(vm_offset_t va, vm_ 0); } + PTE_SYNC(ptep); + if (l2pte_valid(opte)) { + if (L2_S_EXECUTABLE(opte) || L2_S_EXECUTABLE(*ptep)) + cpu_tlb_flushID_SE(va); + else + cpu_tlb_flushD_SE(va); + } else { + if (opte == 0) + l2b->l2b_occupancy++; + } + PDEBUG(1, printf("pmap_kenter: pte = %08x, opte = %08x, npte = %08x\n", (uint32_t) ptep, opte, *ptep)); - PTE_SYNC(ptep); - cpu_cpwait(); } void @@ -2474,10 +2483,13 @@ pmap_kremove(vm_offset_t va) opte = *ptep; if (l2pte_valid(opte)) { va = va & ~PAGE_MASK; - cpu_tlb_flushD_SE(va); - cpu_cpwait(); *ptep = 0; PTE_SYNC(ptep); + if (L2_S_EXECUTABLE(opte)) + cpu_tlb_flushID_SE(va); + else + cpu_tlb_flushD_SE(va); + cpu_cpwait(); } } @@ -2710,6 +2722,7 @@ small_mappings: cpu_tlb_flushID(); else cpu_tlb_flushD(); + cpu_cpwait(); } vm_page_aflag_clear(m, PGA_WRITEABLE); rw_wunlock(&pvh_global_lock); @@ -2763,6 +2776,7 @@ pmap_change_attr(vm_offset_t sva, vm_siz pmap_l2cache_wbinv_range(tmpva, pte & L2_S_FRAME, PAGE_SIZE); *ptep = pte; cpu_tlb_flushID_SE(tmpva); + cpu_cpwait(); dprintf("%s: for va:%x ptep:%x pte:%x\n", __func__, tmpva, (uint32_t)ptep, pte); @@ -2900,6 +2914,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv else if (is_refd) cpu_tlb_flushD(); + cpu_cpwait(); } rw_wunlock(&pvh_global_lock); @@ -3166,6 +3181,7 @@ validate: cpu_tlb_flushID_SE(va); else if (is_refd) cpu_tlb_flushD_SE(va); + cpu_cpwait(); } if ((pmap != pmap_kernel()) && (pmap == &curproc->p_vmspace->vm_pmap)) @@ -3713,6 +3729,7 @@ pmap_remove_section(pmap_t pmap, vm_offs cpu_tlb_flushID_SE(sva); else cpu_tlb_flushD_SE(sva); + cpu_cpwait(); } /* @@ -3885,6 +3902,7 @@ pmap_promote_section(pmap_t pmap, vm_off cpu_tlb_flushID(); else cpu_tlb_flushD(); + cpu_cpwait(); pmap_section_promotions++; CTR2(KTR_PMAP, "pmap_promote_section: success for va %#x" @@ -4009,6 +4027,7 @@ pmap_demote_section(pmap_t pmap, vm_offs cpu_tlb_flushID_SE(va); else if (L1_S_REFERENCED(l1pd)) cpu_tlb_flushD_SE(va); + cpu_cpwait(); pmap_section_demotions++; CTR2(KTR_PMAP, "pmap_demote_section: success for va %#x" @@ -4380,6 +4399,8 @@ pmap_remove(pmap_t pmap, vm_offset_t sva } } + *ptep = 0; + PTE_SYNC(ptep); if (pmap_is_current(pmap)) { total++; if (total < PMAP_REMOVE_CLEAN_LIST_SIZE) { @@ -4390,8 +4411,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva } else if (total == PMAP_REMOVE_CLEAN_LIST_SIZE) flushall = 1; } - *ptep = 0; - PTE_SYNC(ptep); sva += PAGE_SIZE; ptep++; @@ -4404,6 +4423,8 @@ pmap_remove(pmap_t pmap, vm_offset_t sva rw_wunlock(&pvh_global_lock); if (flushall) cpu_tlb_flushID(); + cpu_cpwait(); + PMAP_UNLOCK(pmap); } @@ -4920,6 +4941,7 @@ pmap_advise(pmap_t pmap, vm_offset_t sva cpu_tlb_flushID_SE(sva); else if (PTE_BEEN_REFD(opte)) cpu_tlb_flushD_SE(sva); + cpu_cpwait(); } } } From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 17:57:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C261464; Fri, 4 Apr 2014 17:57:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18399CFA; Fri, 4 Apr 2014 17:57:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34Hvn4U014607; Fri, 4 Apr 2014 17:57:49 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34HvnFe014606; Fri, 4 Apr 2014 17:57:49 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404041757.s34HvnFe014606@svn.freebsd.org> From: Ian Lepore Date: Fri, 4 Apr 2014 17:57:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264130 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 17:57:50 -0000 Author: ian Date: Fri Apr 4 17:57:49 2014 New Revision: 264130 URL: http://svnweb.freebsd.org/changeset/base/264130 Log: Allocate per-cpu resources for doing pmap_zero_page() and pmap_copy_page(). This is performance enhancement rather than bugfix. Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Fri Apr 4 17:45:39 2014 (r264129) +++ head/sys/arm/arm/pmap-v6.c Fri Apr 4 17:57:49 2014 (r264130) @@ -265,9 +265,18 @@ vm_offset_t vm_max_kernel_address; struct pmap kernel_pmap_store; -static pt_entry_t *csrc_pte, *cdst_pte; -static vm_offset_t csrcp, cdstp; -static struct mtx cmtx; +/* + * Resources for quickly copying and zeroing pages using virtual address space + * and page table entries that are pre-allocated per-CPU by pmap_init(). + */ +struct czpages { + struct mtx lock; + pt_entry_t *srcptep; + pt_entry_t *dstptep; + vm_offset_t srcva; + vm_offset_t dstva; +}; +static struct czpages cpu_czpages[MAXCPU]; static void pmap_init_l1(struct l1_ttable *, pd_entry_t *); /* @@ -1803,13 +1812,14 @@ pmap_bootstrap(vm_offset_t firstaddr, st struct l1_ttable *l1 = &static_l1; struct l2_dtable *l2; struct l2_bucket *l2b; + struct czpages *czp; pd_entry_t pde; pd_entry_t *kernel_l1pt = (pd_entry_t *)l1pt->pv_va; pt_entry_t *ptep; vm_paddr_t pa; vm_offset_t va; vm_size_t size; - int l1idx, l2idx, l2next = 0; + int i, l1idx, l2idx, l2next = 0; PDEBUG(1, printf("firstaddr = %08x, lastaddr = %08x\n", firstaddr, vm_max_kernel_address)); @@ -1921,13 +1931,16 @@ pmap_bootstrap(vm_offset_t firstaddr, st /* * Reserve some special page table entries/VA space for temporary - * mapping of pages. + * mapping of pages that are being copied or zeroed. */ + for (czp = cpu_czpages, i = 0; i < MAXCPU; ++i, ++czp) { + mtx_init(&czp->lock, "czpages", NULL, MTX_DEF); + pmap_alloc_specials(&virtual_avail, 1, &czp->srcva, &czp->srcptep); + pmap_set_pt_cache_mode(kernel_l1pt, (vm_offset_t)czp->srcptep); + pmap_alloc_specials(&virtual_avail, 1, &czp->dstva, &czp->dstptep); + pmap_set_pt_cache_mode(kernel_l1pt, (vm_offset_t)czp->dstptep); + } - pmap_alloc_specials(&virtual_avail, 1, &csrcp, &csrc_pte); - pmap_set_pt_cache_mode(kernel_l1pt, (vm_offset_t)csrc_pte); - pmap_alloc_specials(&virtual_avail, 1, &cdstp, &cdst_pte); - pmap_set_pt_cache_mode(kernel_l1pt, (vm_offset_t)cdst_pte); size = ((vm_max_kernel_address - pmap_curmaxkvaddr) + L1_S_OFFSET) / L1_S_SIZE; pmap_alloc_specials(&virtual_avail, @@ -1955,7 +1968,6 @@ pmap_bootstrap(vm_offset_t firstaddr, st virtual_avail = round_page(virtual_avail); virtual_end = vm_max_kernel_address; kernel_vm_end = pmap_curmaxkvaddr; - mtx_init(&cmtx, "TMP mappings mtx", NULL, MTX_DEF); pmap_set_pcb_pagedir(kernel_pmap, thread0.td_pcb); } @@ -4439,39 +4451,42 @@ pmap_remove(pmap_t pmap, vm_offset_t sva static void pmap_zero_page_gen(vm_page_t m, int off, int size) { + struct czpages *czp; + + KASSERT(TAILQ_EMPTY(&m->md.pv_list), + ("pmap_zero_page_gen: page has mappings")); vm_paddr_t phys = VM_PAGE_TO_PHYS(m); - if (!TAILQ_EMPTY(&m->md.pv_list)) - panic("pmap_zero_page: page has mappings"); - mtx_lock(&cmtx); + sched_pin(); + czp = &cpu_czpages[PCPU_GET(cpuid)]; + mtx_lock(&czp->lock); + /* - * Hook in the page, zero it, invalidate the TLB as needed. - * - * Note the temporary zero-page mapping must be a non-cached page in - * order to work without corruption when write-allocate is enabled. + * Hook in the page, zero it. */ - *cdst_pte = L2_S_PROTO | phys | pte_l2_s_cache_mode | L2_S_REF; - pmap_set_prot(cdst_pte, VM_PROT_WRITE, 0); - PTE_SYNC(cdst_pte); - cpu_tlb_flushD_SE(cdstp); + *czp->dstptep = L2_S_PROTO | phys | pte_l2_s_cache_mode | L2_S_REF; + pmap_set_prot(czp->dstptep, VM_PROT_WRITE, 0); + PTE_SYNC(czp->dstptep); + cpu_tlb_flushD_SE(czp->dstva); cpu_cpwait(); + if (off || size != PAGE_SIZE) - bzero((void *)(cdstp + off), size); + bzero((void *)(czp->dstva + off), size); else - bzero_page(cdstp); + bzero_page(czp->dstva); /* - * Although aliasing is not possible if we use - * cdstp temporary mappings with memory that - * will be mapped later as non-cached or with write-through - * caches we might end up overwriting it when calling wbinv_all - * So make sure caches are clean after copy operation + * Although aliasing is not possible, if we use temporary mappings with + * memory that will be mapped later as non-cached or with write-through + * caches, we might end up overwriting it when calling wbinv_all. So + * make sure caches are clean after the operation. */ - cpu_idcache_wbinv_range(cdstp, size); - pmap_l2cache_wbinv_range(cdstp, phys, size); + cpu_idcache_wbinv_range(czp->dstva, size); + pmap_l2cache_wbinv_range(czp->dstva, phys, size); - mtx_unlock(&cmtx); + mtx_unlock(&czp->lock); + sched_unpin(); } /* @@ -4529,45 +4544,39 @@ pmap_zero_page_idle(vm_page_t m) void pmap_copy_page_generic(vm_paddr_t src, vm_paddr_t dst) { - /* - * Hold the source page's lock for the duration of the copy - * so that no other mappings can be created while we have a - * potentially aliased mapping. - * Map the pages into the page hook points, copy them, and purge - * the cache for the appropriate page. Invalidate the TLB - * as required. - */ - mtx_lock(&cmtx); - - /* For ARMv6 using System bit is deprecated and mapping with AP - * bits set to 0x0 makes page not accessible. csrc_pte is mapped - * read/write until proper mapping defines are created for ARMv6. - */ - *csrc_pte = L2_S_PROTO | src | pte_l2_s_cache_mode | L2_S_REF; - pmap_set_prot(csrc_pte, VM_PROT_READ, 0); - PTE_SYNC(csrc_pte); - - *cdst_pte = L2_S_PROTO | dst | pte_l2_s_cache_mode | L2_S_REF; - pmap_set_prot(cdst_pte, VM_PROT_READ | VM_PROT_WRITE, 0); - PTE_SYNC(cdst_pte); + struct czpages *czp; - cpu_tlb_flushD_SE(csrcp); - cpu_tlb_flushD_SE(cdstp); + sched_pin(); + czp = &cpu_czpages[PCPU_GET(cpuid)]; + mtx_lock(&czp->lock); + + /* + * Map the pages into the page hook points, copy them, and purge the + * cache for the appropriate page. + */ + *czp->srcptep = L2_S_PROTO | src | pte_l2_s_cache_mode | L2_S_REF; + pmap_set_prot(czp->srcptep, VM_PROT_READ, 0); + PTE_SYNC(czp->srcptep); + cpu_tlb_flushD_SE(czp->srcva); + *czp->dstptep = L2_S_PROTO | dst | pte_l2_s_cache_mode | L2_S_REF; + pmap_set_prot(czp->dstptep, VM_PROT_READ | VM_PROT_WRITE, 0); + PTE_SYNC(czp->dstptep); + cpu_tlb_flushD_SE(czp->dstva); cpu_cpwait(); + bcopy_page(czp->srcva, czp->dstva); + /* - * Although aliasing is not possible if we use - * cdstp temporary mappings with memory that - * will be mapped later as non-cached or with write-through - * caches we might end up overwriting it when calling wbinv_all - * So make sure caches are clean after copy operation + * Although aliasing is not possible, if we use temporary mappings with + * memory that will be mapped later as non-cached or with write-through + * caches, we might end up overwriting it when calling wbinv_all. So + * make sure caches are clean after the operation. */ - bcopy_page(csrcp, cdstp); - - cpu_idcache_wbinv_range(cdstp, PAGE_SIZE); - pmap_l2cache_wbinv_range(cdstp, dst, PAGE_SIZE); + cpu_idcache_wbinv_range(czp->dstva, PAGE_SIZE); + pmap_l2cache_wbinv_range(czp->dstva, dst, PAGE_SIZE); - mtx_unlock(&cmtx); + mtx_unlock(&czp->lock); + sched_unpin(); } int unmapped_buf_allowed = 1; @@ -4579,8 +4588,12 @@ pmap_copy_pages(vm_page_t ma[], vm_offse vm_page_t a_pg, b_pg; vm_offset_t a_pg_offset, b_pg_offset; int cnt; + struct czpages *czp; + + sched_pin(); + czp = &cpu_czpages[PCPU_GET(cpuid)]; + mtx_lock(&czp->lock); - mtx_lock(&cmtx); while (xfersize > 0) { a_pg = ma[a_offset >> PAGE_SHIFT]; a_pg_offset = a_offset & PAGE_MASK; @@ -4588,27 +4601,29 @@ pmap_copy_pages(vm_page_t ma[], vm_offse b_pg = mb[b_offset >> PAGE_SHIFT]; b_pg_offset = b_offset & PAGE_MASK; cnt = min(cnt, PAGE_SIZE - b_pg_offset); - *csrc_pte = L2_S_PROTO | VM_PAGE_TO_PHYS(a_pg) | + *czp->srcptep = L2_S_PROTO | VM_PAGE_TO_PHYS(a_pg) | pte_l2_s_cache_mode | L2_S_REF; - pmap_set_prot(csrc_pte, VM_PROT_READ, 0); - PTE_SYNC(csrc_pte); - *cdst_pte = L2_S_PROTO | VM_PAGE_TO_PHYS(b_pg) | + pmap_set_prot(czp->srcptep, VM_PROT_READ, 0); + PTE_SYNC(czp->srcptep); + cpu_tlb_flushD_SE(czp->srcva); + *czp->dstptep = L2_S_PROTO | VM_PAGE_TO_PHYS(b_pg) | pte_l2_s_cache_mode | L2_S_REF; - pmap_set_prot(cdst_pte, VM_PROT_READ | VM_PROT_WRITE, 0); - PTE_SYNC(cdst_pte); - cpu_tlb_flushD_SE(csrcp); - cpu_tlb_flushD_SE(cdstp); + pmap_set_prot(czp->dstptep, VM_PROT_READ | VM_PROT_WRITE, 0); + PTE_SYNC(czp->dstptep); + cpu_tlb_flushD_SE(czp->dstva); cpu_cpwait(); - bcopy((char *)csrcp + a_pg_offset, (char *)cdstp + b_pg_offset, + bcopy((char *)czp->srcva + a_pg_offset, (char *)czp->dstva + b_pg_offset, cnt); - cpu_idcache_wbinv_range(cdstp + b_pg_offset, cnt); - pmap_l2cache_wbinv_range(cdstp + b_pg_offset, + cpu_idcache_wbinv_range(czp->dstva + b_pg_offset, cnt); + pmap_l2cache_wbinv_range(czp->dstva + b_pg_offset, VM_PAGE_TO_PHYS(b_pg) + b_pg_offset, cnt); xfersize -= cnt; a_offset += cnt; b_offset += cnt; } - mtx_unlock(&cmtx); + + mtx_unlock(&czp->lock); + sched_unpin(); } void From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 17:58:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D3E95FB; Fri, 4 Apr 2014 17:58:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A638D07; Fri, 4 Apr 2014 17:58:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34HwYbT014731; Fri, 4 Apr 2014 17:58:34 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34HwYOp014730; Fri, 4 Apr 2014 17:58:34 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201404041758.s34HwYOp014730@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 4 Apr 2014 17:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264131 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 17:58:34 -0000 Author: bapt Date: Fri Apr 4 17:58:33 2014 New Revision: 264131 URL: http://svnweb.freebsd.org/changeset/base/264131 Log: Prevent XDTP from being a relative path XDTP is used as the default SYSROOT for clang and thus should be an absolute path. PR: arm/188249 Submitted by: Edgar Martinez Reviewed by: imp Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Apr 4 17:57:49 2014 (r264130) +++ head/Makefile.inc1 Fri Apr 4 17:58:33 2014 (r264131) @@ -1875,7 +1875,11 @@ NOFUN=-DNO_FSCHG MK_HTML=no MK_INFO=no - CPUTYPE=${XDEV_CPUTYPE} XDDIR=${XDEV_ARCH}-freebsd -XDTP?=usr/${XDDIR} +XDTP?=/usr/${XDDIR} +.if ${XDTP:N/*} +.error XDTP variable should be an absolute path +.endif + CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \ INSTALL="sh ${.CURDIR}/tools/install.sh" CDENV= ${CDBENV} \ From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 18:07:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 252028FF; Fri, 4 Apr 2014 18:07:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 125FCDF7; Fri, 4 Apr 2014 18:07:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34I7Lcq018800; Fri, 4 Apr 2014 18:07:21 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34I7LXU018799; Fri, 4 Apr 2014 18:07:21 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404041807.s34I7LXU018799@svn.freebsd.org> From: Ed Maste Date: Fri, 4 Apr 2014 18:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264132 - head/sys/boot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 18:07:22 -0000 Author: emaste Date: Fri Apr 4 18:07:21 2014 New Revision: 264132 URL: http://svnweb.freebsd.org/changeset/base/264132 Log: Connect sys/boot/amd64 to the build Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/Makefile Modified: head/sys/boot/Makefile ============================================================================== --- head/sys/boot/Makefile Fri Apr 4 17:58:33 2014 (r264131) +++ head/sys/boot/Makefile Fri Apr 4 18:07:21 2014 (r264132) @@ -9,9 +9,12 @@ SUBDIR+= ficl .endif # Pick the machine-dependent subdir based on the target architecture. -ADIR= ${MACHINE:S/amd64/i386/:S/powerpc64/powerpc/} +ADIR= ${MACHINE:S/powerpc64/powerpc/} .if exists(${.CURDIR}/${ADIR}/.) SUBDIR+= ${ADIR} .endif +.if ${MACHINE} == "amd64" +SUBDIR+= i386 +.endif .include From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 18:10:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A3E33AAF; Fri, 4 Apr 2014 18:10:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91B92E13; Fri, 4 Apr 2014 18:10:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34IABVM019199; Fri, 4 Apr 2014 18:10:11 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34IABr2019198; Fri, 4 Apr 2014 18:10:11 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201404041810.s34IABr2019198@svn.freebsd.org> From: Julio Merino Date: Fri, 4 Apr 2014 18:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264133 - head/tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 18:10:11 -0000 Author: jmmv Date: Fri Apr 4 18:10:11 2014 New Revision: 264133 URL: http://svnweb.freebsd.org/changeset/base/264133 Log: Fix variable type to avoid printf formatter warning. This fixes the build under powerpc64 where gcc complains about a mismatch between a %zd printf formatter and an int variable passed to it. Modified: head/tests/sys/kern/unix_seqpacket_test.c Modified: head/tests/sys/kern/unix_seqpacket_test.c ============================================================================== --- head/tests/sys/kern/unix_seqpacket_test.c Fri Apr 4 18:07:21 2014 (r264132) +++ head/tests/sys/kern/unix_seqpacket_test.c Fri Apr 4 18:10:11 2014 (r264133) @@ -872,7 +872,7 @@ ATF_TC_BODY(rcvbuf_oversized, tc) { int i; int sv[2]; - const int pktsize = 1024; + const ssize_t pktsize = 1024; const size_t sndbufsize = 8192; const size_t rcvbufsize = 131072; const size_t geometric_mean_bufsize = 32768; From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 19:35:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 045AEABC; Fri, 4 Apr 2014 19:35:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5F54911; Fri, 4 Apr 2014 19:35:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34JZcXt056293; Fri, 4 Apr 2014 19:35:38 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34JZcfv056292; Fri, 4 Apr 2014 19:35:38 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404041935.s34JZcfv056292@svn.freebsd.org> From: Ian Lepore Date: Fri, 4 Apr 2014 19:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264135 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 19:35:39 -0000 Author: ian Date: Fri Apr 4 19:35:38 2014 New Revision: 264135 URL: http://svnweb.freebsd.org/changeset/base/264135 Log: We don't support any ARM systems with an ISA bus and don't need a freelist of memory to support ISA addressing limitations. Modified: head/sys/arm/include/vmparam.h Modified: head/sys/arm/include/vmparam.h ============================================================================== --- head/sys/arm/include/vmparam.h Fri Apr 4 19:17:33 2014 (r264134) +++ head/sys/arm/include/vmparam.h Fri Apr 4 19:35:38 2014 (r264135) @@ -93,15 +93,10 @@ #define VM_FREEPOOL_DIRECT 0 /* - * we support 2 free lists: - * - * - DEFAULT for all systems - * - ISADMA for the ISA DMA range on Sharks only + * We need just one free list: DEFAULT. */ - -#define VM_NFREELIST 2 +#define VM_NFREELIST 1 #define VM_FREELIST_DEFAULT 0 -#define VM_FREELIST_ISADMA 1 /* * The largest allocation size is 1MB. From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 19:53:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A70553B; Fri, 4 Apr 2014 19:53:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBD24AB3; Fri, 4 Apr 2014 19:53:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34Jrj9D064433; Fri, 4 Apr 2014 19:53:45 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34JrjxC064431; Fri, 4 Apr 2014 19:53:45 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201404041953.s34JrjxC064431@svn.freebsd.org> From: Ed Schouten Date: Fri, 4 Apr 2014 19:53:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264136 - in head: lib/libc/sys sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 19:53:46 -0000 Author: ed Date: Fri Apr 4 19:53:45 2014 New Revision: 264136 URL: http://svnweb.freebsd.org/changeset/base/264136 Log: Correct return type of pdfork(2). The pdfork(2) man page states: "pdfork() returns a PID, 0 or -1, as fork(2) does." As it returns a PID, the return type should obviously be pid_t. As int and pid_t have the same size on all architectures, this change does not affect the ABI in any way. Modified: head/lib/libc/sys/pdfork.2 head/sys/sys/procdesc.h Modified: head/lib/libc/sys/pdfork.2 ============================================================================== --- head/lib/libc/sys/pdfork.2 Fri Apr 4 19:35:38 2014 (r264135) +++ head/lib/libc/sys/pdfork.2 Fri Apr 4 19:53:45 2014 (r264136) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 28, 2013 +.Dd April 4, 2014 .Dt PDFORK 2 .Os .Sh NAME @@ -45,7 +45,7 @@ .Lb libc .Sh SYNOPSIS .In sys/procdesc.h -.Ft int +.Ft pid_t .Fn pdfork "int *fdp" "int flags" .Ft int .Fn pdgetpid "int fd" "pid_t *pidp" Modified: head/sys/sys/procdesc.h ============================================================================== --- head/sys/sys/procdesc.h Fri Apr 4 19:35:38 2014 (r264135) +++ head/sys/sys/procdesc.h Fri Apr 4 19:53:45 2014 (r264136) @@ -105,7 +105,7 @@ void procdesc_reap(struct proc *); * Process descriptor system calls. */ struct rusage; -int pdfork(int *, int); +pid_t pdfork(int *, int); int pdkill(int, int); int pdgetpid(int, pid_t *); From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 20:42:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7B438BC; Fri, 4 Apr 2014 20:42:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B31EF1D; Fri, 4 Apr 2014 20:42:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34Kgj77085920; Fri, 4 Apr 2014 20:42:45 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34KgiXZ085911; Fri, 4 Apr 2014 20:42:44 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404042042.s34KgiXZ085911@svn.freebsd.org> From: Ian Lepore Date: Fri, 4 Apr 2014 20:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264137 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 20:42:45 -0000 Author: ian Date: Fri Apr 4 20:42:44 2014 New Revision: 264137 URL: http://svnweb.freebsd.org/changeset/base/264137 Log: Switch wandboards over to the common IMX6 kernel config, which has SMP enabled. Also switch IMX6 to use SCHED_ULE. The now-unreferenced WANDBOARD.common config will be deleted after giving folks who may be including it a heads-up to switch to IMX6. Modified: head/sys/arm/conf/IMX6 head/sys/arm/conf/WANDBOARD-DUAL head/sys/arm/conf/WANDBOARD-QUAD head/sys/arm/conf/WANDBOARD-SOLO Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Fri Apr 4 19:53:45 2014 (r264136) +++ head/sys/arm/conf/IMX6 Fri Apr 4 20:42:44 2014 (r264137) @@ -1,4 +1,4 @@ -# Kernel configuration for Wandboard +# Kernel configuration for Freescale i.MX6 systems. # # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: @@ -20,8 +20,8 @@ ident IMX6 include "../freescale/imx/std.imx6" -options HZ=250 # Scheduling quantum is 4 milliseconds. -options SCHED_4BSD # 4BSD scheduler +options HZ=500 # Scheduling quantum is 2 milliseconds. +options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols Modified: head/sys/arm/conf/WANDBOARD-DUAL ============================================================================== --- head/sys/arm/conf/WANDBOARD-DUAL Fri Apr 4 19:53:45 2014 (r264136) +++ head/sys/arm/conf/WANDBOARD-DUAL Fri Apr 4 20:42:44 2014 (r264137) @@ -17,7 +17,7 @@ # # $FreeBSD$ -include "WANDBOARD.common" +include "IMX6" ident WANDBOARD-DUAL # Flattened Device Tree Modified: head/sys/arm/conf/WANDBOARD-QUAD ============================================================================== --- head/sys/arm/conf/WANDBOARD-QUAD Fri Apr 4 19:53:45 2014 (r264136) +++ head/sys/arm/conf/WANDBOARD-QUAD Fri Apr 4 20:42:44 2014 (r264137) @@ -17,7 +17,7 @@ # # $FreeBSD$ -include "WANDBOARD.common" +include "IMX6" ident WANDBOARD-QUAD # Flattened Device Tree Modified: head/sys/arm/conf/WANDBOARD-SOLO ============================================================================== --- head/sys/arm/conf/WANDBOARD-SOLO Fri Apr 4 19:53:45 2014 (r264136) +++ head/sys/arm/conf/WANDBOARD-SOLO Fri Apr 4 20:42:44 2014 (r264137) @@ -17,7 +17,7 @@ # # $FreeBSD$ -include "WANDBOARD.common" +include "IMX6" ident WANDBOARD-SOLO # Flattened Device Tree From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 20:58:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D69A6E; Fri, 4 Apr 2014 20:58:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60987AE; Fri, 4 Apr 2014 20:58:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34Kwk7Z090896; Fri, 4 Apr 2014 20:58:46 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34KwkdU090895; Fri, 4 Apr 2014 20:58:46 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404042058.s34KwkdU090895@svn.freebsd.org> From: Ian Lepore Date: Fri, 4 Apr 2014 20:58:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264138 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 20:58:46 -0000 Author: ian Date: Fri Apr 4 20:58:45 2014 New Revision: 264138 URL: http://svnweb.freebsd.org/changeset/base/264138 Log: Enable SMP for Pandaboard. Modified: head/sys/arm/conf/PANDABOARD Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Fri Apr 4 20:42:44 2014 (r264137) +++ head/sys/arm/conf/PANDABOARD Fri Apr 4 20:58:45 2014 (r264138) @@ -146,3 +146,4 @@ options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=pandaboard.dts options VFP # vfp/neon +options SMP # Enable multiple cores From owner-svn-src-head@FreeBSD.ORG Fri Apr 4 21:09:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 489DA4D4; Fri, 4 Apr 2014 21:09:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35FC319D; Fri, 4 Apr 2014 21:09:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s34L97Qs095072; Fri, 4 Apr 2014 21:09:07 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s34L97Ex095071; Fri, 4 Apr 2014 21:09:07 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404042109.s34L97Ex095071@svn.freebsd.org> From: Ed Maste Date: Fri, 4 Apr 2014 21:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264139 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 21:09:07 -0000 Author: emaste Date: Fri Apr 4 21:09:06 2014 New Revision: 264139 URL: http://svnweb.freebsd.org/changeset/base/264139 Log: Initialise m_pkthdr via bzero instead of explicitly zeroing each member Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Fri Apr 4 20:58:45 2014 (r264138) +++ head/sys/kern/kern_mbuf.c Fri Apr 4 21:09:06 2014 (r264139) @@ -647,20 +647,7 @@ m_pkthdr_init(struct mbuf *m, int how) int error; #endif m->m_data = m->m_pktdat; - m->m_pkthdr.rcvif = NULL; - SLIST_INIT(&m->m_pkthdr.tags); - m->m_pkthdr.len = 0; - m->m_pkthdr.flowid = 0; - m->m_pkthdr.csum_flags = 0; - m->m_pkthdr.fibnum = 0; - m->m_pkthdr.cosqos = 0; - m->m_pkthdr.rsstype = 0; - m->m_pkthdr.l2hlen = 0; - m->m_pkthdr.l3hlen = 0; - m->m_pkthdr.l4hlen = 0; - m->m_pkthdr.l5hlen = 0; - m->m_pkthdr.PH_per.sixtyfour[0] = 0; - m->m_pkthdr.PH_loc.sixtyfour[0] = 0; + bzero(&m->m_pkthdr, sizeof(m->m_pkthdr)); #ifdef MAC /* If the label init fails, fail the alloc */ error = mac_mbuf_init(m, how); From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 03:01:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3695484D; Sat, 5 Apr 2014 03:01:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23D9027D; Sat, 5 Apr 2014 03:01:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3531T9D043312; Sat, 5 Apr 2014 03:01:29 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3531TjN043311; Sat, 5 Apr 2014 03:01:29 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201404050301.s3531TjN043311@svn.freebsd.org> From: Bryan Drewery Date: Sat, 5 Apr 2014 03:01:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264142 - head/sys/geom/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 03:01:30 -0000 Author: bdrewery Date: Sat Apr 5 03:01:29 2014 New Revision: 264142 URL: http://svnweb.freebsd.org/changeset/base/264142 Log: Show error code when failing to destroy a mirror on delay Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Fri Apr 4 22:20:33 2014 (r264141) +++ head/sys/geom/mirror/g_mirror.c Sat Apr 5 03:01:29 2014 (r264142) @@ -2824,7 +2824,8 @@ g_mirror_destroy_delayed(void *arg, int G_MIRROR_DEBUG(1, "Destroying %s (delayed).", sc->sc_name); error = g_mirror_destroy(sc, G_MIRROR_DESTROY_SOFT); if (error != 0) { - G_MIRROR_DEBUG(0, "Cannot destroy %s.", sc->sc_name); + G_MIRROR_DEBUG(0, "Cannot destroy %s (error=%d).", + sc->sc_name, error); sx_xunlock(&sc->sc_lock); } g_topology_lock(); From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 08:17:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D9C2EAF; Sat, 5 Apr 2014 08:17:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60519EBB; Sat, 5 Apr 2014 08:17:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s358HnGV070941; Sat, 5 Apr 2014 08:17:49 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s358HmsL070938; Sat, 5 Apr 2014 08:17:48 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201404050817.s358HmsL070938@svn.freebsd.org> From: David Chisnall Date: Sat, 5 Apr 2014 08:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264143 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 08:17:49 -0000 Author: theraven Date: Sat Apr 5 08:17:48 2014 New Revision: 264143 URL: http://svnweb.freebsd.org/changeset/base/264143 Log: Silence a warning with GCC that was breaking the build with Juniper's GCC. Reviewed by: marcel Modified: head/lib/libc/stdlib/atexit.c head/lib/libc/stdlib/heapsort.c head/lib/libc/stdlib/qsort_r.c Modified: head/lib/libc/stdlib/atexit.c ============================================================================== --- head/lib/libc/stdlib/atexit.c Sat Apr 5 03:01:29 2014 (r264142) +++ head/lib/libc/stdlib/atexit.c Sat Apr 5 08:17:48 2014 (r264143) @@ -80,6 +80,7 @@ struct atexit { }; static struct atexit *__atexit; /* points to head of LIFO stack */ +typedef DECLARE_BLOCK(void, atexit_block, void); /* * Register the function described by 'fptr' to be called at application @@ -141,7 +142,7 @@ atexit(void (*func)(void)) * Register a block to be performed at exit. */ int -atexit_b(DECLARE_BLOCK(void, func, void)) +atexit_b(atexit_block func) { struct atexit_fn fn; int error; Modified: head/lib/libc/stdlib/heapsort.c ============================================================================== --- head/lib/libc/stdlib/heapsort.c Sat Apr 5 03:01:29 2014 (r264142) +++ head/lib/libc/stdlib/heapsort.c Sat Apr 5 08:17:48 2014 (r264143) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #ifdef I_AM_HEAPSORT_B #include "block_abi.h" #define COMPAR(x, y) CALL_BLOCK(compar, x, y) +typedef DECLARE_BLOCK(int, heapsort_block, const void *, const void *); #else #define COMPAR(x, y) compar(x, y) #endif @@ -149,7 +150,7 @@ int heapsort_b(vbase, nmemb, size, compar) void *vbase; size_t nmemb, size; - DECLARE_BLOCK(int, compar, const void *, const void *); + heapsort_block compar; #else int heapsort(vbase, nmemb, size, compar) Modified: head/lib/libc/stdlib/qsort_r.c ============================================================================== --- head/lib/libc/stdlib/qsort_r.c Sat Apr 5 03:01:29 2014 (r264142) +++ head/lib/libc/stdlib/qsort_r.c Sat Apr 5 08:17:48 2014 (r264143) @@ -8,9 +8,10 @@ #define I_AM_QSORT_R #include "qsort.c" +typedef DECLARE_BLOCK(int, qsort_block, const void *, const void *); + void -qsort_b(void *base, size_t nel, size_t width, - DECLARE_BLOCK(int, compar, const void *, const void *)) +qsort_b(void *base, size_t nel, size_t width, qsort_block compar) { qsort_r(base, nel, width, compar, (int (*)(void *, const void *, const void *)) From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 11:37:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 150A3A5B; Sat, 5 Apr 2014 11:37:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 026F2A0; Sat, 5 Apr 2014 11:37:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35Bbw4t052270; Sat, 5 Apr 2014 11:37:58 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35Bbwxe052269; Sat, 5 Apr 2014 11:37:58 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201404051137.s35Bbwxe052269@svn.freebsd.org> From: Ed Schouten Date: Sat, 5 Apr 2014 11:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264144 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 11:37:59 -0000 Author: ed Date: Sat Apr 5 11:37:58 2014 New Revision: 264144 URL: http://svnweb.freebsd.org/changeset/base/264144 Log: Add missing userspace bits to . - Include and define pid_t. - Add __BEGIN_DECLS/__END_DECLS. In my opinion we should have considered putting the userspace bits in a different header (e.g., ), but I think we've already passed that point. Modified: head/sys/sys/procdesc.h Modified: head/sys/sys/procdesc.h ============================================================================== --- head/sys/sys/procdesc.h Sat Apr 5 08:17:48 2014 (r264143) +++ head/sys/sys/procdesc.h Sat Apr 5 11:37:58 2014 (r264144) @@ -33,6 +33,7 @@ #define _SYS_PROCDESC_H_ #ifdef _KERNEL + #include /* struct selinfo */ #include #include @@ -101,13 +102,23 @@ void procdesc_reap(struct proc *); #else /* !_KERNEL */ +#include + +#ifndef _PID_T_DECLARED +typedef __pid_t pid_t; +#define _PID_T_DECLARED +#endif + +struct rusage; + /* * Process descriptor system calls. */ -struct rusage; +__BEGIN_DECLS pid_t pdfork(int *, int); int pdkill(int, int); int pdgetpid(int, pid_t *); +__END_DECLS #endif /* _KERNEL */ From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 14:09:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 799AF1B3; Sat, 5 Apr 2014 14:09:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A0AD197; Sat, 5 Apr 2014 14:09:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35E9HhJ013477; Sat, 5 Apr 2014 14:09:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35E9GYD013475; Sat, 5 Apr 2014 14:09:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201404051409.s35E9GYD013475@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 5 Apr 2014 14:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264146 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 14:09:17 -0000 Author: kib Date: Sat Apr 5 14:09:16 2014 New Revision: 264146 URL: http://svnweb.freebsd.org/changeset/base/264146 Log: When KN_INFLUX is set on the knote due to kqueue_register() or kqueue_scan() unlocking the kqueue to call f_event, knote() or knote_fork() should not skip the knote. The knote is not going to disappear during the influx time, and the mutual exclusion between scan and knote() is ensured by both code pathes taking knlist lock. The race appears since knlist lock is before kq lock, so KN_INFLUX must be set, kq lock must be dropped and only then knlist lock can be taken. The window between kq unlock and knlist lock causes lost events. Add a flag KN_SCAN to indicate that KN_INFLUX is set in a manner safe for the knote(), and check for it to ignore KN_INFLUX in the knote*() as needed. Also, in knote(), remove the lockless check for the KN_INFLUX flag, which could also result in the lost notification. Reported and tested by: Kohji Okuno Discussed with: jmg Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_event.c head/sys/sys/event.h Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sat Apr 5 13:01:44 2014 (r264145) +++ head/sys/kern/kern_event.c Sat Apr 5 14:09:16 2014 (r264146) @@ -474,7 +474,7 @@ knote_fork(struct knlist *list, int pid) continue; kq = kn->kn_kq; KQ_LOCK(kq); - if ((kn->kn_status & KN_INFLUX) == KN_INFLUX) { + if ((kn->kn_status & (KN_INFLUX | KN_SCAN)) == KN_INFLUX) { KQ_UNLOCK(kq); continue; } @@ -1174,7 +1174,7 @@ findkn: * but doing so will not reset any filter which has already been * triggered. */ - kn->kn_status |= KN_INFLUX; + kn->kn_status |= KN_INFLUX | KN_SCAN; KQ_UNLOCK(kq); KN_LIST_LOCK(kn); kn->kn_kevent.udata = kev->udata; @@ -1197,7 +1197,7 @@ done_ev_add: KQ_LOCK(kq); if (event) KNOTE_ACTIVATE(kn, 1); - kn->kn_status &= ~KN_INFLUX; + kn->kn_status &= ~(KN_INFLUX | KN_SCAN); KN_LIST_UNLOCK(kn); if ((kev->flags & EV_DISABLE) && @@ -1506,7 +1506,7 @@ retry: KQ_LOCK(kq); kn = NULL; } else { - kn->kn_status |= KN_INFLUX; + kn->kn_status |= KN_INFLUX | KN_SCAN; KQ_UNLOCK(kq); if ((kn->kn_status & KN_KQUEUE) == KN_KQUEUE) KQ_GLOBAL_LOCK(&kq_global, haskqglobal); @@ -1515,7 +1515,8 @@ retry: KQ_LOCK(kq); KQ_GLOBAL_UNLOCK(&kq_global, haskqglobal); kn->kn_status &= - ~(KN_QUEUED | KN_ACTIVE | KN_INFLUX); + ~(KN_QUEUED | KN_ACTIVE | KN_INFLUX | + KN_SCAN); kq->kq_count--; KN_LIST_UNLOCK(kn); influx = 1; @@ -1545,7 +1546,7 @@ retry: } else TAILQ_INSERT_TAIL(&kq->kq_head, kn, kn_tqe); - kn->kn_status &= ~(KN_INFLUX); + kn->kn_status &= ~(KN_INFLUX | KN_SCAN); KN_LIST_UNLOCK(kn); influx = 1; } @@ -1865,28 +1866,33 @@ knote(struct knlist *list, long hint, in */ SLIST_FOREACH(kn, &list->kl_list, kn_selnext) { kq = kn->kn_kq; - if ((kn->kn_status & KN_INFLUX) != KN_INFLUX) { + KQ_LOCK(kq); + if ((kn->kn_status & (KN_INFLUX | KN_SCAN)) == KN_INFLUX) { + /* + * Do not process the influx notes, except for + * the influx coming from the kq unlock in the + * kqueue_scan(). In the later case, we do + * not interfere with the scan, since the code + * fragment in kqueue_scan() locks the knlist, + * and cannot proceed until we finished. + */ + KQ_UNLOCK(kq); + } else if ((lockflags & KNF_NOKQLOCK) != 0) { + kn->kn_status |= KN_INFLUX; + KQ_UNLOCK(kq); + error = kn->kn_fop->f_event(kn, hint); KQ_LOCK(kq); - if ((kn->kn_status & KN_INFLUX) == KN_INFLUX) { - KQ_UNLOCK(kq); - } else if ((lockflags & KNF_NOKQLOCK) != 0) { - kn->kn_status |= KN_INFLUX; - KQ_UNLOCK(kq); - error = kn->kn_fop->f_event(kn, hint); - KQ_LOCK(kq); - kn->kn_status &= ~KN_INFLUX; - if (error) - KNOTE_ACTIVATE(kn, 1); - KQ_UNLOCK_FLUX(kq); - } else { - kn->kn_status |= KN_HASKQLOCK; - if (kn->kn_fop->f_event(kn, hint)) - KNOTE_ACTIVATE(kn, 1); - kn->kn_status &= ~KN_HASKQLOCK; - KQ_UNLOCK(kq); - } + kn->kn_status &= ~KN_INFLUX; + if (error) + KNOTE_ACTIVATE(kn, 1); + KQ_UNLOCK_FLUX(kq); + } else { + kn->kn_status |= KN_HASKQLOCK; + if (kn->kn_fop->f_event(kn, hint)) + KNOTE_ACTIVATE(kn, 1); + kn->kn_status &= ~KN_HASKQLOCK; + KQ_UNLOCK(kq); } - kq = NULL; } if ((lockflags & KNF_LISTLOCKED) == 0) list->kl_unlock(list->kl_lockarg); Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Sat Apr 5 13:01:44 2014 (r264145) +++ head/sys/sys/event.h Sat Apr 5 14:09:16 2014 (r264146) @@ -207,6 +207,7 @@ struct knote { #define KN_MARKER 0x20 /* ignore this knote */ #define KN_KQUEUE 0x40 /* this knote belongs to a kq */ #define KN_HASKQLOCK 0x80 /* for _inevent */ +#define KN_SCAN 0x100 /* flux set in kqueue_scan() */ int kn_sfflags; /* saved filter flags */ intptr_t kn_sdata; /* saved data field */ union { From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 14:13:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1812153C; Sat, 5 Apr 2014 14:13:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED6872AD; Sat, 5 Apr 2014 14:13:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35D1jO2087426; Sat, 5 Apr 2014 13:01:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35D1jx0086674; Sat, 5 Apr 2014 13:01:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404051301.s35D1jx0086674@svn.freebsd.org> From: Alexander Motin Date: Sat, 5 Apr 2014 13:01:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264145 - in head: cddl/contrib/opensolaris/cmd/zfs sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/sys/fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 14:13:01 -0000 Author: mav Date: Sat Apr 5 13:01:44 2014 New Revision: 264145 URL: http://svnweb.freebsd.org/changeset/base/264145 Log: Add property and sysctl to control how ZVOLs are exposed to OS. New ZFS property volmode and sysctl vfs.zfs.vol.mode allow switching ZVOL between three modes: geom -- existing fully functional behavior (default); dev -- exposing volumes only as raw disk device file in devfs; none -- not exposing volumes outside ZFS. The "dev" mode is less functional (can't be partitioned, mounted, etc), but it is faster, and in some scenarios with untrusted consumers safer. It can be useful for NAS, VM block storages, etc. The "none" mode may be convenient for backup servers, etc. that don't need direct data access. Due to the way ZVOL is integrated with main ZFS code, those property and sysctl are checked only during pool import and volume creation. MFC after: 1 month Sponsored by: iXsystems, Inc. Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sat Apr 5 11:37:58 2014 (r264144) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sat Apr 5 13:01:44 2014 (r264145) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 20, 2014 +.Dd April 5, 2014 .Dt ZFS 8 .Os .Sh NAME @@ -1306,6 +1306,38 @@ Consequently, writes to a sparse volume when the pool is low on space. For a sparse volume, changes to .Sy volsize are not reflected in the reservation. +.It Sy volmode Ns = Ns Cm default | geom | dev | none +This property specifies how volumes should be exposed to the OS. +Setting it to +.Sy geom +exposes volumes as +.Xr geom 4 +providers, providing maximal functionality. +Setting it to +.Sy dev +exposes volumes only as cdev device in devfs. +Such volumes can be accessed only as raw disk device files, i.e. they +can not be partitioned, mounted, participate in RAIDs, etc, but they +are faster, and in some use scenarios with untrusted consumer, such as +NAS or VM storage, can be more safe. +Volumes with property set to +.Sy none +are not exposed outside ZFS, but can be snapshoted, cloned, replicated, etc, +that can be suitable for backup purposes. +Value +.Sy default +means that volumes exposition is controlled by system-wide sysctl/tunable +.Va vfs.zfs.vol.mode , +where +.Sy geom , +.Sy dev +and +.Sy none +are encoded as 1, 2 and 3 respectively. +The default values is +.Sy geom . +This property can be changed any time, but so far it is processed only +during volume creation and pool import. .It Sy vscan Ns = Ns Cm off | on The .Sy vscan Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Sat Apr 5 11:37:58 2014 (r264144) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Sat Apr 5 13:01:44 2014 (r264145) @@ -198,6 +198,14 @@ zfs_prop_init(void) { NULL } }; + static zprop_index_t volmode_table[] = { + { "default", ZFS_VOLMODE_DEFAULT }, + { "geom", ZFS_VOLMODE_GEOM }, + { "dev", ZFS_VOLMODE_DEV }, + { "none", ZFS_VOLMODE_NONE }, + { NULL } + }; + /* inherit index properties */ zprop_register_index(ZFS_PROP_SYNC, "sync", ZFS_SYNC_STANDARD, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, @@ -242,6 +250,10 @@ zfs_prop_init(void) zprop_register_index(ZFS_PROP_LOGBIAS, "logbias", ZFS_LOGBIAS_LATENCY, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "latency | throughput", "LOGBIAS", logbias_table); + zprop_register_index(ZFS_PROP_VOLMODE, "volmode", + ZFS_VOLMODE_DEFAULT, PROP_INHERIT, + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_VOLUME, + "default | geom | dev | none", "VOLMODE", volmode_table); /* inherit index (boolean) properties */ zprop_register_index(ZFS_PROP_ATIME, "atime", 1, PROP_INHERIT, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sat Apr 5 11:37:58 2014 (r264144) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sat Apr 5 13:01:44 2014 (r264145) @@ -66,6 +66,7 @@ #include #include #include +#include #include #include #include @@ -75,6 +76,7 @@ #include #include #include +#include #include #include #include @@ -114,6 +116,13 @@ static char *zvol_tag = "zvol_tag"; */ static uint32_t zvol_minors; +SYSCTL_DECL(_vfs_zfs); +SYSCTL_NODE(_vfs_zfs, OID_AUTO, vol, CTLFLAG_RW, 0, "ZFS VOLUME"); +static int volmode = ZFS_VOLMODE_GEOM; +TUNABLE_INT("vfs.zfs.vol.mode", &volmode); +SYSCTL_INT(_vfs_zfs_vol, OID_AUTO, mode, CTLFLAG_RWTUN, &volmode, 0, + "Expose as GEOM providers (1), device files (2) or neither"); + typedef struct zvol_extent { list_node_t ze_node; dva_t ze_dva; /* dva associated with this extent */ @@ -124,9 +133,11 @@ typedef struct zvol_extent { * The in-core state of each volume. */ typedef struct zvol_state { + LIST_ENTRY(zvol_state) zv_links; char zv_name[MAXPATHLEN]; /* pool/dd name */ uint64_t zv_volsize; /* amount of space we advertise */ uint64_t zv_volblocksize; /* volume block size */ + struct cdev *zv_dev; /* non-GEOM device */ struct g_provider *zv_provider; /* GEOM provider */ uint8_t zv_min_bs; /* minimum addressable block shift */ uint8_t zv_flags; /* readonly, dumpified, etc. */ @@ -137,10 +148,13 @@ typedef struct zvol_state { znode_t zv_znode; /* for range locking */ dmu_buf_t *zv_dbuf; /* bonus handle */ int zv_state; + int zv_volmode; /* Provide GEOM or cdev */ struct bio_queue_head zv_queue; struct mtx zv_queue_mtx; /* zv_queue mutex */ } zvol_state_t; +static LIST_HEAD(, zvol_state) all_zvols; + /* * zvol specific flags */ @@ -154,6 +168,25 @@ typedef struct zvol_state { */ int zvol_maxphys = DMU_MAX_ACCESS/2; +static d_open_t zvol_d_open; +static d_close_t zvol_d_close; +static d_read_t zvol_read; +static d_write_t zvol_write; +static d_ioctl_t zvol_d_ioctl; +static d_strategy_t zvol_strategy; + +static struct cdevsw zvol_cdevsw = { + .d_version = D_VERSION, + .d_open = zvol_d_open, + .d_close = zvol_d_close, + .d_read = zvol_read, + .d_write = zvol_write, + .d_ioctl = zvol_d_ioctl, + .d_strategy = zvol_strategy, + .d_name = "zvol", + .d_flags = D_DISK | D_TRACKCLOSE, +}; + extern int zfs_set_prop_nvlist(const char *, zprop_source_t, nvlist_t *, nvlist_t *); static void zvol_log_truncate(zvol_state_t *zv, dmu_tx_t *tx, uint64_t off, @@ -164,7 +197,6 @@ static int zvol_dumpify(zvol_state_t *zv static int zvol_dump_fini(zvol_state_t *zv); static int zvol_dump_init(zvol_state_t *zv, boolean_t resize); -static zvol_state_t *zvol_geom_create(const char *name); static void zvol_geom_run(zvol_state_t *zv); static void zvol_geom_destroy(zvol_state_t *zv); static int zvol_geom_access(struct g_provider *pp, int acr, int acw, int ace); @@ -186,14 +218,16 @@ zvol_size_changed(zvol_state_t *zv) spec_size_invalidate(dev, VBLK); spec_size_invalidate(dev, VCHR); #else /* !sun */ - struct g_provider *pp; + if (zv->zv_volmode == ZFS_VOLMODE_GEOM) { + struct g_provider *pp; - pp = zv->zv_provider; - if (pp == NULL) - return; - g_topology_lock(); - g_resize_provider(pp, zv->zv_volsize); - g_topology_unlock(); + pp = zv->zv_provider; + if (pp == NULL) + return; + g_topology_lock(); + g_resize_provider(pp, zv->zv_volsize); + g_topology_unlock(); + } #endif /* !sun */ } @@ -250,26 +284,16 @@ zvol_get_stats(objset_t *os, nvlist_t *n static zvol_state_t * zvol_minor_lookup(const char *name) { - struct g_provider *pp; - struct g_geom *gp; - zvol_state_t *zv = NULL; + zvol_state_t *zv; ASSERT(MUTEX_HELD(&spa_namespace_lock)); - g_topology_lock(); - LIST_FOREACH(gp, &zfs_zvol_class.geom, geom) { - pp = LIST_FIRST(&gp->provider); - if (pp == NULL) - continue; - zv = pp->private; - if (zv == NULL) - continue; + LIST_FOREACH(zv, &all_zvols, zv_links) { if (strcmp(zv->zv_name, name) == 0) break; } - g_topology_unlock(); - return (gp != NULL ? zv : NULL); + return (zv); } /* extent mapping arg */ @@ -507,8 +531,11 @@ zvol_create_minor(const char *name) zfs_soft_state_t *zs; zvol_state_t *zv; objset_t *os; + struct cdev *dev; + struct g_provider *pp; + struct g_geom *gp; dmu_object_info_t doi; - uint64_t volsize; + uint64_t volsize, mode; int error; ZFS_LOG(1, "Creating ZVOL %s...", name); @@ -569,20 +596,51 @@ zvol_create_minor(const char *name) zv = zs->zss_data = kmem_zalloc(sizeof (zvol_state_t), KM_SLEEP); #else /* !sun */ + zv = kmem_zalloc(sizeof(*zv), KM_SLEEP); + zv->zv_state = 0; error = zap_lookup(os, ZVOL_ZAP_OBJ, "size", 8, 1, &volsize); if (error) { - ASSERT(error == 0); + kmem_free(zv, sizeof(*zv)); dmu_objset_disown(os, zvol_tag); mutex_exit(&spa_namespace_lock); return (error); } + error = dsl_prop_get_integer(name, + zfs_prop_to_name(ZFS_PROP_VOLMODE), &mode, NULL); + if (error != 0 || mode == ZFS_VOLMODE_DEFAULT) + mode = volmode; DROP_GIANT(); - g_topology_lock(); - zv = zvol_geom_create(name); zv->zv_volsize = volsize; - zv->zv_provider->mediasize = zv->zv_volsize; + zv->zv_volmode = mode; + if (zv->zv_volmode == ZFS_VOLMODE_GEOM) { + g_topology_lock(); + gp = g_new_geomf(&zfs_zvol_class, "zfs::zvol::%s", name); + gp->start = zvol_geom_start; + gp->access = zvol_geom_access; + pp = g_new_providerf(gp, "%s/%s", ZVOL_DRIVER, name); + pp->flags |= G_PF_DIRECT_RECEIVE | G_PF_DIRECT_SEND; + pp->sectorsize = DEV_BSIZE; + pp->mediasize = zv->zv_volsize; + pp->private = zv; + zv->zv_provider = pp; + bioq_init(&zv->zv_queue); + mtx_init(&zv->zv_queue_mtx, "zvol", NULL, MTX_DEF); + } else if (zv->zv_volmode == ZFS_VOLMODE_DEV) { + if (make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, + &dev, &zvol_cdevsw, NULL, UID_ROOT, GID_OPERATOR, + 0640, "%s/%s", ZVOL_DRIVER, name) != 0) { + kmem_free(zv, sizeof(*zv)); + dmu_objset_disown(os, FTAG); + mutex_exit(&spa_namespace_lock); + return (SET_ERROR(ENXIO)); + } + zv->zv_dev = dev; + dev->si_iosize_max = MAXPHYS; + dev->si_drv2 = zv; + } + LIST_INSERT_HEAD(&all_zvols, zv, zv_links); #endif /* !sun */ (void) strlcpy(zv->zv_name, name, MAXPATHLEN); @@ -613,10 +671,13 @@ zvol_create_minor(const char *name) mutex_exit(&spa_namespace_lock); - zvol_geom_run(zv); - - g_topology_unlock(); +#ifndef sun + if (zv->zv_volmode == ZFS_VOLMODE_GEOM) { + zvol_geom_run(zv); + g_topology_unlock(); + } PICKUP_GIANT(); +#endif ZFS_LOG(1, "ZVOL %s created.", name); @@ -642,12 +703,20 @@ zvol_remove_zv(zvol_state_t *zv) #ifdef sun (void) snprintf(nmbuf, sizeof (nmbuf), "%u,raw", minor); ddi_remove_minor_node(zfs_dip, nmbuf); +#else + LIST_REMOVE(zv, zv_links); + if (zv->zv_volmode == ZFS_VOLMODE_GEOM) { + g_topology_lock(); + zvol_geom_destroy(zv); + g_topology_unlock(); + } else if (zv->zv_volmode == ZFS_VOLMODE_DEV) + destroy_dev(zv->zv_dev); #endif /* sun */ avl_destroy(&zv->zv_znode.z_range_avl); mutex_destroy(&zv->zv_znode.z_range_lock); - zvol_geom_destroy(zv); + kmem_free(zv, sizeof(*zv)); zvol_minors--; return (0); @@ -664,9 +733,7 @@ zvol_remove_minor(const char *name) mutex_exit(&spa_namespace_lock); return (SET_ERROR(ENXIO)); } - g_topology_lock(); rc = zvol_remove_zv(zv); - g_topology_unlock(); mutex_exit(&spa_namespace_lock); return (rc); } @@ -802,24 +869,15 @@ zvol_update_volsize(objset_t *os, uint64 void zvol_remove_minors(const char *name) { - struct g_geom *gp, *gptmp; - struct g_provider *pp; - zvol_state_t *zv; + zvol_state_t *zv, *tzv; size_t namelen; namelen = strlen(name); DROP_GIANT(); mutex_enter(&spa_namespace_lock); - g_topology_lock(); - LIST_FOREACH_SAFE(gp, &zfs_zvol_class.geom, geom, gptmp) { - pp = LIST_FIRST(&gp->provider); - if (pp == NULL) - continue; - zv = pp->private; - if (zv == NULL) - continue; + LIST_FOREACH_SAFE(zv, &all_zvols, zv_links, tzv) { if (strcmp(zv->zv_name, name) == 0 || (strncmp(zv->zv_name, name, namelen) == 0 && zv->zv_name[namelen] == '/')) { @@ -827,7 +885,6 @@ zvol_remove_minors(const char *name) } } - g_topology_unlock(); mutex_exit(&spa_namespace_lock); PICKUP_GIANT(); } @@ -1286,28 +1343,46 @@ zvol_dumpio(zvol_state_t *zv, void *addr } #endif /* sun */ -int +void zvol_strategy(struct bio *bp) { - zvol_state_t *zv = bp->bio_to->private; + zvol_state_t *zv; uint64_t off, volsize; size_t resid; char *addr; objset_t *os; rl_t *rl; int error = 0; - boolean_t doread = (bp->bio_cmd == BIO_READ); + boolean_t doread = 0; boolean_t is_dumpified; boolean_t sync; + if (bp->bio_to) + zv = bp->bio_to->private; + else + zv = bp->bio_dev->si_drv2; + if (zv == NULL) { - g_io_deliver(bp, ENXIO); - return (0); + error = ENXIO; + goto out; } if (bp->bio_cmd != BIO_READ && (zv->zv_flags & ZVOL_RDONLY)) { - g_io_deliver(bp, EROFS); - return (0); + error = EROFS; + goto out; + } + + switch (bp->bio_cmd) { + case BIO_FLUSH: + goto sync; + case BIO_READ: + doread = 1; + case BIO_WRITE: + case BIO_DELETE: + break; + default: + error = EOPNOTSUPP; + goto out; } off = bp->bio_offset; @@ -1320,8 +1395,8 @@ zvol_strategy(struct bio *bp) resid = bp->bio_length; if (resid > 0 && (off < 0 || off >= volsize)) { - g_io_deliver(bp, EIO); - return (0); + error = EIO; + goto out; } #ifdef illumos @@ -1393,14 +1468,18 @@ unlock: zfs_range_unlock(rl); bp->bio_completed = bp->bio_length - resid; - if (bp->bio_completed < bp->bio_length) - bp->bio_error = (off > volsize ? EINVAL : error); + if (bp->bio_completed < bp->bio_length && off > volsize) + error = EINVAL; - if (sync) + if (sync) { +sync: zil_commit(zv->zv_zilog, ZVOL_OBJ); - g_io_deliver(bp, 0); - - return (0); + } +out: + if (bp->bio_to) + g_io_deliver(bp, error); + else + biofinish(bp, NULL, error); } #ifdef sun @@ -1459,25 +1538,36 @@ int zvol_read(dev_t dev, uio_t *uio, cred_t *cr) { minor_t minor = getminor(dev); +#else +int +zvol_read(struct cdev *dev, struct uio *uio, int ioflag) +{ +#endif zvol_state_t *zv; uint64_t volsize; rl_t *rl; int error = 0; +#ifdef sun zv = zfsdev_get_soft_state(minor, ZSST_ZVOL); if (zv == NULL) return (SET_ERROR(ENXIO)); +#else + zv = dev->si_drv2; +#endif volsize = zv->zv_volsize; if (uio->uio_resid > 0 && - (uio->uio_loffset < 0 || uio->uio_loffset >= volsize)) + (uio->uio_loffset < 0 || uio->uio_loffset > volsize)) return (SET_ERROR(EIO)); +#ifdef illumos if (zv->zv_flags & ZVOL_DUMPIFIED) { error = physio(zvol_strategy, NULL, dev, B_READ, zvol_minphys, uio); return (error); } +#endif rl = zfs_range_lock(&zv->zv_znode, uio->uio_loffset, uio->uio_resid, RL_READER); @@ -1500,31 +1590,43 @@ zvol_read(dev_t dev, uio_t *uio, cred_t return (error); } +#ifdef sun /*ARGSUSED*/ int zvol_write(dev_t dev, uio_t *uio, cred_t *cr) { minor_t minor = getminor(dev); +#else +int +zvol_write(struct cdev *dev, struct uio *uio, int ioflag) +{ +#endif zvol_state_t *zv; uint64_t volsize; rl_t *rl; int error = 0; boolean_t sync; +#ifdef sun zv = zfsdev_get_soft_state(minor, ZSST_ZVOL); if (zv == NULL) return (SET_ERROR(ENXIO)); +#else + zv = dev->si_drv2; +#endif volsize = zv->zv_volsize; if (uio->uio_resid > 0 && - (uio->uio_loffset < 0 || uio->uio_loffset >= volsize)) + (uio->uio_loffset < 0 || uio->uio_loffset > volsize)) return (SET_ERROR(EIO)); +#ifdef illumos if (zv->zv_flags & ZVOL_DUMPIFIED) { error = physio(zvol_strategy, NULL, dev, B_WRITE, zvol_minphys, uio); return (error); } +#endif sync = !(zv->zv_flags & ZVOL_WCE) || (zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS); @@ -1559,6 +1661,7 @@ zvol_write(dev_t dev, uio_t *uio, cred_t return (error); } +#ifdef sun int zvol_getefi(void *arg, int flag, uint64_t vs, uint8_t bs) { @@ -2232,31 +2335,6 @@ zvol_dump_fini(zvol_state_t *zv) } #endif /* sun */ -static zvol_state_t * -zvol_geom_create(const char *name) -{ - struct g_provider *pp; - struct g_geom *gp; - zvol_state_t *zv; - - gp = g_new_geomf(&zfs_zvol_class, "zfs::zvol::%s", name); - gp->start = zvol_geom_start; - gp->access = zvol_geom_access; - pp = g_new_providerf(gp, "%s/%s", ZVOL_DRIVER, name); - pp->flags |= G_PF_DIRECT_RECEIVE | G_PF_DIRECT_SEND; - pp->sectorsize = DEV_BSIZE; - - zv = kmem_zalloc(sizeof(*zv), KM_SLEEP); - zv->zv_provider = pp; - zv->zv_state = 0; - bioq_init(&zv->zv_queue); - mtx_init(&zv->zv_queue_mtx, "zvol", NULL, MTX_DEF); - - pp->private = zv; - - return (zv); -} - static void zvol_geom_run(zvol_state_t *zv) { @@ -2287,8 +2365,6 @@ zvol_geom_destroy(zvol_state_t *zv) zv->zv_provider = NULL; pp->private = NULL; g_wither_geom(pp->geom, ENXIO); - - kmem_free(zv, sizeof(*zv)); } static int @@ -2534,30 +2610,47 @@ zvol_create_minors(const char *name) } static void -zvol_rename_minor(struct g_geom *gp, const char *newname) +zvol_rename_minor(zvol_state_t *zv, const char *newname) { + struct g_geom *gp; struct g_provider *pp; - zvol_state_t *zv; + struct cdev *dev; ASSERT(MUTEX_HELD(&spa_namespace_lock)); - g_topology_assert(); - - pp = LIST_FIRST(&gp->provider); - ASSERT(pp != NULL); - zv = pp->private; - ASSERT(zv != NULL); - zv->zv_provider = NULL; - g_wither_provider(pp, ENXIO); - - pp = g_new_providerf(gp, "%s/%s", ZVOL_DRIVER, newname); - pp->flags |= G_PF_DIRECT_RECEIVE | G_PF_DIRECT_SEND; - pp->sectorsize = DEV_BSIZE; - pp->mediasize = zv->zv_volsize; - pp->private = zv; - zv->zv_provider = pp; + if (zv->zv_volmode == ZFS_VOLMODE_GEOM) { + g_topology_lock(); + pp = zv->zv_provider; + ASSERT(pp != NULL); + gp = pp->geom; + ASSERT(gp != NULL); + + zv->zv_provider = NULL; + g_wither_provider(pp, ENXIO); + + pp = g_new_providerf(gp, "%s/%s", ZVOL_DRIVER, newname); + pp->flags |= G_PF_DIRECT_RECEIVE | G_PF_DIRECT_SEND; + pp->sectorsize = DEV_BSIZE; + pp->mediasize = zv->zv_volsize; + pp->private = zv; + zv->zv_provider = pp; + g_error_provider(pp, 0); + g_topology_unlock(); + } else if (zv->zv_volmode == ZFS_VOLMODE_DEV) { + dev = zv->zv_dev; + ASSERT(dev != NULL); + zv->zv_dev = NULL; + destroy_dev(dev); + + if (make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, + &dev, &zvol_cdevsw, NULL, UID_ROOT, GID_OPERATOR, + 0640, "%s/%s", ZVOL_DRIVER, newname) == 0) { + zv->zv_dev = dev; + dev->si_iosize_max = MAXPHYS; + dev->si_drv2 = zv; + } + } strlcpy(zv->zv_name, newname, sizeof(zv->zv_name)); - g_error_provider(pp, 0); } void @@ -2575,28 +2668,169 @@ zvol_rename_minors(const char *oldname, DROP_GIANT(); mutex_enter(&spa_namespace_lock); - g_topology_lock(); - LIST_FOREACH(gp, &zfs_zvol_class.geom, geom) { - pp = LIST_FIRST(&gp->provider); - if (pp == NULL) - continue; - zv = pp->private; - if (zv == NULL) - continue; + LIST_FOREACH(zv, &all_zvols, zv_links) { if (strcmp(zv->zv_name, oldname) == 0) { - zvol_rename_minor(gp, newname); + zvol_rename_minor(zv, newname); } else if (strncmp(zv->zv_name, oldname, oldnamelen) == 0 && (zv->zv_name[oldnamelen] == '/' || zv->zv_name[oldnamelen] == '@')) { snprintf(name, sizeof(name), "%s%c%s", newname, zv->zv_name[oldnamelen], zv->zv_name + oldnamelen + 1); - zvol_rename_minor(gp, name); + zvol_rename_minor(zv, name); } } - g_topology_unlock(); mutex_exit(&spa_namespace_lock); PICKUP_GIANT(); } + +static int +zvol_d_open(struct cdev *dev, int flags, int fmt, struct thread *td) +{ + zvol_state_t *zv; + int err = 0; + + mutex_enter(&spa_namespace_lock); + zv = dev->si_drv2; + if (zv == NULL) { + mutex_exit(&spa_namespace_lock); + return(ENXIO); /* zvol_create_minor() not done yet */ + } + + if (zv->zv_total_opens == 0) + err = zvol_first_open(zv); + if (err) { + mutex_exit(&spa_namespace_lock); + return (err); + } + if ((flags & FWRITE) && (zv->zv_flags & ZVOL_RDONLY)) { + err = SET_ERROR(EROFS); + goto out; + } + if (zv->zv_flags & ZVOL_EXCL) { + err = SET_ERROR(EBUSY); + goto out; + } +#ifdef FEXCL + if (flags & FEXCL) { + if (zv->zv_total_opens != 0) { + err = SET_ERROR(EBUSY); + goto out; + } + zv->zv_flags |= ZVOL_EXCL; + } +#endif + + zv->zv_total_opens++; + mutex_exit(&spa_namespace_lock); + return (err); +out: + if (zv->zv_total_opens == 0) + zvol_last_close(zv); + mutex_exit(&spa_namespace_lock); + return (err); +} + +static int +zvol_d_close(struct cdev *dev, int flags, int fmt, struct thread *td) +{ + zvol_state_t *zv; + int err = 0; + + mutex_enter(&spa_namespace_lock); + zv = dev->si_drv2; + if (zv == NULL) { + mutex_exit(&spa_namespace_lock); + return(ENXIO); + } + + if (zv->zv_flags & ZVOL_EXCL) { + ASSERT(zv->zv_total_opens == 1); + zv->zv_flags &= ~ZVOL_EXCL; + } + + /* + * If the open count is zero, this is a spurious close. + * That indicates a bug in the kernel / DDI framework. + */ + ASSERT(zv->zv_total_opens != 0); + + /* + * You may get multiple opens, but only one close. + */ + zv->zv_total_opens--; + + if (zv->zv_total_opens == 0) + zvol_last_close(zv); + + mutex_exit(&spa_namespace_lock); + return (0); +} + +static int +zvol_d_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) +{ + zvol_state_t *zv; + rl_t *rl; + off_t offset, length, chunk; + int i, error; + u_int u; + + zv = dev->si_drv2; + + error = 0; + KASSERT(zv->zv_total_opens > 0, + ("Device with zero access count in zvol_d_ioctl")); + + i = IOCPARM_LEN(cmd); + switch (cmd) { + case DIOCGSECTORSIZE: + *(u_int *)data = DEV_BSIZE; + break; + case DIOCGMEDIASIZE: + *(off_t *)data = zv->zv_volsize; + break; + case DIOCGFLUSH: + zil_commit(zv->zv_zilog, ZVOL_OBJ); + break; + case DIOCGDELETE: + offset = ((off_t *)data)[0]; + length = ((off_t *)data)[1]; + if ((offset % DEV_BSIZE) != 0 || (length % DEV_BSIZE) != 0 || + offset < 0 || offset >= zv->zv_volsize || + length <= 0) { + printf("%s: offset=%jd length=%jd\n", __func__, offset, + length); + error = EINVAL; + break; + } + + rl = zfs_range_lock(&zv->zv_znode, offset, length, RL_WRITER); + dmu_tx_t *tx = dmu_tx_create(zv->zv_objset); + error = dmu_tx_assign(tx, TXG_WAIT); + if (error != 0) { + dmu_tx_abort(tx); + } else { + zvol_log_truncate(zv, tx, offset, length, B_TRUE); + dmu_tx_commit(tx); + error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ, + offset, length); + } + zfs_range_unlock(rl); + if (zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS) + zil_commit(zv->zv_zilog, ZVOL_OBJ); + break; + case DIOCGSTRIPESIZE: + *(off_t *)data = zv->zv_volblocksize; + break; + case DIOCGSTRIPEOFFSET: + *(off_t *)data = 0; + break; + default: + error = ENOIOCTL; + } + + return (error); +} Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Sat Apr 5 11:37:58 2014 (r264144) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Sat Apr 5 13:01:44 2014 (r264145) @@ -145,6 +145,7 @@ typedef enum { ZFS_PROP_LOGICALUSED, ZFS_PROP_LOGICALREFERENCED, ZFS_PROP_INCONSISTENT, /* not exposed to the user */ + ZFS_PROP_VOLMODE, ZFS_NUM_PROPS } zfs_prop_t; @@ -337,6 +338,12 @@ typedef enum { ZFS_SYNC_DISABLED = 2 } zfs_sync_type_t; +typedef enum { + ZFS_VOLMODE_DEFAULT = 0, + ZFS_VOLMODE_GEOM = 1, + ZFS_VOLMODE_DEV = 2, + ZFS_VOLMODE_NONE = 3 +} zfs_volmode_t; /* * On-disk version number. From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 16:08:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A61945C; Sat, 5 Apr 2014 16:08:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8448ACF; Sat, 5 Apr 2014 16:08:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35G8ECm062399; Sat, 5 Apr 2014 16:08:14 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35G8DuY062395; Sat, 5 Apr 2014 16:08:13 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404051608.s35G8DuY062395@svn.freebsd.org> From: Ian Lepore Date: Sat, 5 Apr 2014 16:08:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264149 - in head: share/man/man4 sys/dev/usb sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 16:08:14 -0000 Author: ian Date: Sat Apr 5 16:08:13 2014 New Revision: 264149 URL: http://svnweb.freebsd.org/changeset/base/264149 Log: Add ioctl(2) calls to uftdi(4) to access bitbang, MPSSE, CPU_FIFO, and other modes supported by the FTDI serial adapter chips. In addition to adding the new ioctls, this change removes all the code that reset the chip at attach and open/close time, and also the code that turned on RTS/CTS flow control on open without any permission to do so (that was just always a bug in the driver). When FTDI chips are configured as GPIO or MPSSE or other special-purpose uses by an attached serial eeprom, the chip will power on with certain pins driven or floating, and it's important that the driver not do anything to the chip to perturb that unless it receives a specific command to do so. When used for "plain old serial comms" the chip powers on into the right mode and never needs to be reset while it's running to operate properly, so this change is transparent to most users. Added: head/sys/dev/usb/uftdiio.h (contents, props changed) Modified: head/share/man/man4/uftdi.4 head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/serial/uftdi_reg.h Modified: head/share/man/man4/uftdi.4 ============================================================================== --- head/share/man/man4/uftdi.4 Sat Apr 5 14:24:45 2014 (r264148) +++ head/share/man/man4/uftdi.4 Sat Apr 5 16:08:13 2014 (r264149) @@ -83,6 +83,87 @@ The device is accessed through the .Xr ucom 4 driver which makes it behave like a .Xr tty 4 . +.Pp +Many of the supported chips provide additional functionality +such as bitbang mode and the MPSSE engine for serial bus emulation. +The +.Nm +driver provides access to that functionality with the following +.Xr ioctl 2 +calls, defined in +.In dev/usb/uftdiio.h : +.Bl -tag -width indent +.It Dv UFTDIIOC_RESET_IO Pq Vt int +Reset the channel to its default configuration, flush RX and TX FIFOs. +.It Dv UFTDIIOC_RESET_RX Pq Vt int +Flush the RX FIFO. +.It Dv UFTDIIOC_RESET_TX Pq Vt int +Flush the TX FIFO. +.It Dv UFTDIIOC_SET_BITMODE Pq Vt "struct uftdi_bitmode" +Put the channel into the operating mode specified in +.Va mode , +and set the pins indicated by ones in +.Va iomask +to output mode. +The +.Va mode +must be one of the +.Va uftdi_bitmodes +values. +.Bd -literal +enum uftdi_bitmodes +{ + UFTDI_BITMODE_ASYNC = 0, + UFTDI_BITMODE_MPSSE = 1, + UFTDI_BITMODE_SYNC = 2, + UFTDI_BITMODE_CPU_EMUL = 3, + UFTDI_BITMODE_FAST_SERIAL = 4, + UFTDI_BITMODE_CBUS = 5, + UFTDI_BITMODE_NONE = 0xff, +}; + +struct uftdi_bitmode +{ + uint8_t mode; + uint8_t iomask; +}; +.Ed +.Pp +Manuals and application notes published by FTDI describe these +modes in detail. +To use most of these modes, you first put the channel into +the desired mode, then you +.Xr read 2 +and +.Xr write 2 +data which either reflects pin state or is interpreted +as MPSSE commands and parameters, depending on the mode. +.It Dv UFTDIIOC_GET_BITMODE Pq Vt "struct uftdi_bitmode" +Return the state of the bitbang pins at the time of the call in the +.Va iomask +member. +The +.Va mode +member is unused. +.It Dv UFTDIIOC_SET_ERROR_CHAR Pq Vt int +Set the character which is inserted into the buffer to mark +the point of an error such as FIFO overflow. +.It Dv UFTDIIOC_SET_EVENT_CHAR Pq Vt int +Set the character which causes a partial FIFO full of data +to be returned immediately even if the FIFO is not full. +.It Dv UFTDIIOC_SET_LATENCY Pq Vt int +Set the amount of time to wait for a full FIFO, +in milliseconds. +If more than this much time elapses without receiving a new +character, any characters in the FIFO are returned. +.It Dv UFTDIIOC_GET_LATENCY Pq Vt int +Get the current value of the latency timer. +.It Dv UFTDIIOC_GET_HWREV Pq Vt int +Get the hardware revision number. +This is the +.Va bcdDevice +value from the +.Va usb_device_descriptor . .Sh HARDWARE The .Nm Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Sat Apr 5 14:24:45 2014 (r264148) +++ head/sys/dev/usb/serial/uftdi.c Sat Apr 5 16:08:13 2014 (r264149) @@ -38,7 +38,14 @@ __FBSDID("$FreeBSD$"); */ /* - * FTDI FT2232x, FT8U100AX and FT8U232AM serial adapter driver + * FTDI FT232x, FT2232x, FT4232x, FT8U100AX and FT8U232xM serial adapters. + * + * Note that we specifically do not do a reset or otherwise alter the state of + * the chip during attach, detach, open, and close, because it could be + * pre-initialized (via an attached serial eeprom) to power-on into a mode such + * as bitbang in which the pins are being driven to a specific state which we + * must not perturb. The device gets reset at power-on, and doesn't need to be + * reset again after that to function, except as directed by ioctl() calls. */ #include @@ -64,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "usbdevs.h" #define USB_DEBUG_VAR uftdi_debug @@ -72,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #ifdef USB_DEBUG static int uftdi_debug = 0; @@ -146,6 +155,7 @@ struct uftdi_softc { uint32_t sc_unit; uint16_t sc_last_lcr; + uint16_t sc_bcdDevice; uint8_t sc_devtype; uint8_t sc_devflags; @@ -175,6 +185,7 @@ static usb_callback_t uftdi_read_callbac static void uftdi_free(struct ucom_softc *); static void uftdi_cfg_open(struct ucom_softc *); +static void uftdi_cfg_close(struct ucom_softc *); static void uftdi_cfg_set_dtr(struct ucom_softc *, uint8_t); static void uftdi_cfg_set_rts(struct ucom_softc *, uint8_t); static void uftdi_cfg_set_break(struct ucom_softc *, uint8_t); @@ -184,6 +195,15 @@ static int uftdi_pre_param(struct ucom_s static void uftdi_cfg_param(struct ucom_softc *, struct termios *); static void uftdi_cfg_get_status(struct ucom_softc *, uint8_t *, uint8_t *); +static int uftdi_reset(struct ucom_softc *, int); +static int uftdi_set_bitmode(struct ucom_softc *, uint8_t, uint8_t); +static int uftdi_get_bitmode(struct ucom_softc *, uint8_t *); +static int uftdi_set_latency(struct ucom_softc *, int); +static int uftdi_get_latency(struct ucom_softc *, int *); +static int uftdi_set_event_char(struct ucom_softc *, int); +static int uftdi_set_error_char(struct ucom_softc *, int); +static int uftdi_ioctl(struct ucom_softc *, uint32_t, caddr_t, int, + struct thread *); static void uftdi_start_read(struct ucom_softc *); static void uftdi_stop_read(struct ucom_softc *); static void uftdi_start_write(struct ucom_softc *); @@ -218,7 +238,9 @@ static const struct ucom_callback uftdi_ .ucom_cfg_set_break = &uftdi_cfg_set_break, .ucom_cfg_param = &uftdi_cfg_param, .ucom_cfg_open = &uftdi_cfg_open, + .ucom_cfg_close = &uftdi_cfg_close, .ucom_pre_param = &uftdi_pre_param, + .ucom_ioctl = &uftdi_ioctl, .ucom_start_read = &uftdi_start_read, .ucom_stop_read = &uftdi_stop_read, .ucom_start_write = &uftdi_start_write, @@ -905,6 +927,8 @@ uftdi_devtype_setup(struct uftdi_softc * { struct usb_device_descriptor *dd; + sc->sc_bcdDevice = uaa->info.bcdDevice; + switch (uaa->info.bcdDevice) { case 0x200: dd = usbd_get_device_descriptor(sc->sc_udev); @@ -1086,37 +1110,25 @@ uftdi_free(struct ucom_softc *ucom) static void uftdi_cfg_open(struct ucom_softc *ucom) { - struct uftdi_softc *sc = ucom->sc_parent; - uint16_t wIndex = ucom->sc_portno; - struct usb_device_request req; + /* + * This do-nothing open routine exists for the sole purpose of this + * DPRINTF() so that you can see the point at which open gets called + * when debugging is enabled. + */ DPRINTF(""); +} - /* perform a full reset on the device */ - - req.bmRequestType = UT_WRITE_VENDOR_DEVICE; - req.bRequest = FTDI_SIO_RESET; - USETW(req.wValue, FTDI_SIO_RESET_SIO); - USETW(req.wIndex, wIndex); - USETW(req.wLength, 0); - ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, - &req, NULL, 0, 1000); - - /* turn on RTS/CTS flow control */ - - req.bmRequestType = UT_WRITE_VENDOR_DEVICE; - req.bRequest = FTDI_SIO_SET_FLOW_CTRL; - USETW(req.wValue, 0); - USETW2(req.wIndex, FTDI_SIO_RTS_CTS_HS, wIndex); - USETW(req.wLength, 0); - ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, - &req, NULL, 0, 1000); +static void +uftdi_cfg_close(struct ucom_softc *ucom) +{ /* - * NOTE: with the new UCOM layer there will always be a - * "uftdi_cfg_param()" call after "open()", so there is no need for - * "open()" to configure anything + * This do-nothing close routine exists for the sole purpose of this + * DPRINTF() so that you can see the point at which close gets called + * when debugging is enabled. */ + DPRINTF(""); } static void @@ -1583,6 +1595,186 @@ uftdi_cfg_get_status(struct ucom_softc * *lsr = sc->sc_lsr; } +static int +uftdi_reset(struct ucom_softc *ucom, int reset_type) +{ + struct uftdi_softc *sc = ucom->sc_parent; + usb_device_request_t req; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = FTDI_SIO_RESET; + + USETW(req.wIndex, sc->sc_ucom.sc_portno); + USETW(req.wLength, 0); + USETW(req.wValue, reset_type); + + return (usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL)); +} + +static int +uftdi_set_bitmode(struct ucom_softc *ucom, uint8_t bitmode, uint8_t iomask) +{ + struct uftdi_softc *sc = ucom->sc_parent; + usb_device_request_t req; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = FTDI_SIO_SET_BITMODE; + + USETW(req.wIndex, sc->sc_ucom.sc_portno); + USETW(req.wLength, 0); + + if (bitmode == UFTDI_BITMODE_NONE) + USETW2(req.wValue, 0, 0); + else + USETW2(req.wValue, (1 << bitmode), iomask); + + return (usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL)); +} + +static int +uftdi_get_bitmode(struct ucom_softc *ucom, uint8_t *iomask) +{ + struct uftdi_softc *sc = ucom->sc_parent; + usb_device_request_t req; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = FTDI_SIO_GET_BITMODE; + + USETW(req.wIndex, sc->sc_ucom.sc_portno); + USETW(req.wLength, 1); + USETW(req.wValue, 0); + + return (usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, iomask)); +} + +static int +uftdi_set_latency(struct ucom_softc *ucom, int latency) +{ + struct uftdi_softc *sc = ucom->sc_parent; + usb_device_request_t req; + + if (latency < 0 || latency > 255) + return (USB_ERR_INVAL); + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = FTDI_SIO_SET_LATENCY; + + USETW(req.wIndex, sc->sc_ucom.sc_portno); + USETW(req.wLength, 0); + USETW2(req.wValue, 0, latency); + + return (usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL)); +} + +static int +uftdi_get_latency(struct ucom_softc *ucom, int *latency) +{ + struct uftdi_softc *sc = ucom->sc_parent; + usb_device_request_t req; + usb_error_t err; + uint8_t buf; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = FTDI_SIO_GET_LATENCY; + + USETW(req.wIndex, sc->sc_ucom.sc_portno); + USETW(req.wLength, 1); + USETW(req.wValue, 0); + + err = usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, &buf); + *latency = buf; + + return (err); +} + +static int +uftdi_set_event_char(struct ucom_softc *ucom, int echar) +{ + struct uftdi_softc *sc = ucom->sc_parent; + usb_device_request_t req; + uint8_t enable; + + enable = (echar == -1) ? 0 : 1; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = FTDI_SIO_SET_EVENT_CHAR; + + USETW(req.wIndex, sc->sc_ucom.sc_portno); + USETW(req.wLength, 0); + USETW2(req.wValue, enable, echar & 0xff); + + return (usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL)); +} + +static int +uftdi_set_error_char(struct ucom_softc *ucom, int echar) +{ + struct uftdi_softc *sc = ucom->sc_parent; + usb_device_request_t req; + uint8_t enable; + + enable = (echar == -1) ? 0 : 1; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = FTDI_SIO_SET_ERROR_CHAR; + + USETW(req.wIndex, sc->sc_ucom.sc_portno); + USETW(req.wLength, 0); + USETW2(req.wValue, enable, echar & 0xff); + + return (usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, NULL)); +} + +static int +uftdi_ioctl(struct ucom_softc *ucom, uint32_t cmd, caddr_t data, + int flag, struct thread *td) +{ + struct uftdi_softc *sc = ucom->sc_parent; + int err; + struct uftdi_bitmode * mode; + + DPRINTF("portno: %d cmd: %#x\n", ucom->sc_portno, cmd); + + switch (cmd) { + case UFTDIIOC_RESET_IO: + case UFTDIIOC_RESET_RX: + case UFTDIIOC_RESET_TX: + err = uftdi_reset(ucom, + cmd == UFTDIIOC_RESET_IO ? FTDI_SIO_RESET_SIO : + (cmd == UFTDIIOC_RESET_RX ? FTDI_SIO_RESET_PURGE_RX : + FTDI_SIO_RESET_PURGE_TX)); + break; + case UFTDIIOC_SET_BITMODE: + mode = (struct uftdi_bitmode *)data; + err = uftdi_set_bitmode(ucom, mode->mode, mode->iomask); + break; + case UFTDIIOC_GET_BITMODE: + mode = (struct uftdi_bitmode *)data; + err = uftdi_get_bitmode(ucom, &mode->iomask); + break; + case UFTDIIOC_SET_LATENCY: + err = uftdi_set_latency(ucom, *((int *)data)); + break; + case UFTDIIOC_GET_LATENCY: + err = uftdi_get_latency(ucom, (int *)data); + break; + case UFTDIIOC_SET_ERROR_CHAR: + err = uftdi_set_event_char(ucom, *(int *)data); + break; + case UFTDIIOC_SET_EVENT_CHAR: + err = uftdi_set_error_char(ucom, *(int *)data); + case UFTDIIOC_GET_HWREV: + *(int *)data = sc->sc_bcdDevice; + err = 0; + break; + default: + return (ENOIOCTL); + } + if (err != USB_ERR_NORMAL_COMPLETION) + return (EIO); + return (0); +} + static void uftdi_start_read(struct ucom_softc *ucom) { Modified: head/sys/dev/usb/serial/uftdi_reg.h ============================================================================== --- head/sys/dev/usb/serial/uftdi_reg.h Sat Apr 5 14:24:45 2014 (r264148) +++ head/sys/dev/usb/serial/uftdi_reg.h Sat Apr 5 16:08:13 2014 (r264149) @@ -28,6 +28,10 @@ * reg */ #define FTDI_SIO_SET_EVENT_CHAR 6 /* Set the event character */ #define FTDI_SIO_SET_ERROR_CHAR 7 /* Set the error character */ +#define FTDI_SIO_SET_LATENCY 9 /* Set the latency timer */ +#define FTDI_SIO_GET_LATENCY 10 /* Read the latency timer */ +#define FTDI_SIO_SET_BITMODE 11 /* Set the bit bang I/O mode */ +#define FTDI_SIO_GET_BITMODE 12 /* Read pin states in bit bang mode */ /* Port Identifier Table */ #define FTDI_PIT_DEFAULT 0 /* SIOA */ Added: head/sys/dev/usb/uftdiio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/uftdiio.h Sat Apr 5 16:08:13 2014 (r264149) @@ -0,0 +1,75 @@ +/*- + * Copyright 2008-2012 - Symmetricom, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * FTDI USB serial converter chip ioctl commands. + */ + +#ifndef _USB_UFTDIIO_H_ +#define _USB_UFTDIIO_H_ + +#include + +enum uftdi_bitmodes +{ + UFTDI_BITMODE_ASYNC = 0, + UFTDI_BITMODE_MPSSE = 1, + UFTDI_BITMODE_SYNC = 2, + UFTDI_BITMODE_CPU_EMUL = 3, + UFTDI_BITMODE_FAST_SERIAL = 4, + UFTDI_BITMODE_CBUS = 5, + UFTDI_BITMODE_NONE = 0xff, +}; + +/* + * For UFTDIIOC_SET_BITMODE: + * mode = One of the uftdi_bitmodes enum values. + * iomask = Mask of bits enabled for bitbang output. + * + * For UFTDIIOC_GET_BITMODE: + * mode = Unused. + * iomask = Returned snapshot of bitbang pin states at time of call. + */ +struct uftdi_bitmode +{ + uint8_t mode; + uint8_t iomask; +}; + +#define UFTDIIOC_RESET_IO _IO('c', 0) /* Reset config, flush fifos.*/ +#define UFTDIIOC_RESET_RX _IO('c', 1) /* Flush input fifo. */ +#define UFTDIIOC_RESET_TX _IO('c', 2) /* Flush output fifo. */ +#define UFTDIIOC_SET_BITMODE _IOW('c', 3, struct uftdi_bitmode) +#define UFTDIIOC_GET_BITMODE _IOR('c', 4, struct uftdi_bitmode) +#define UFTDIIOC_SET_ERROR_CHAR _IOW('c', 5, int) /* -1 to disable */ +#define UFTDIIOC_SET_EVENT_CHAR _IOW('c', 6, int) /* -1 to disable */ +#define UFTDIIOC_SET_LATENCY _IOW('c', 7, int) /* 1-255 ms */ +#define UFTDIIOC_GET_LATENCY _IOR('c', 8, int) +#define UFTDIIOC_GET_HWREV _IOR('c', 9, int) + +#endif From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 16:38:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99897FE2; Sat, 5 Apr 2014 16:38:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 865A537F; Sat, 5 Apr 2014 16:38:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35GcRVl075034; Sat, 5 Apr 2014 16:38:27 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35GcRBv075033; Sat, 5 Apr 2014 16:38:27 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201404051638.s35GcRBv075033@svn.freebsd.org> From: Ruslan Bukin Date: Sat, 5 Apr 2014 16:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264150 - head/sys/arm/samsung/exynos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 16:38:27 -0000 Author: br Date: Sat Apr 5 16:38:27 2014 New Revision: 264150 URL: http://svnweb.freebsd.org/changeset/base/264150 Log: Correct the end address of the video frame buffer. This fixes problem that sometimes display suddenly goes blank. Modified: head/sys/arm/samsung/exynos/exynos5_fimd.c Modified: head/sys/arm/samsung/exynos/exynos5_fimd.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_fimd.c Sat Apr 5 16:08:13 2014 (r264149) +++ head/sys/arm/samsung/exynos/exynos5_fimd.c Sat Apr 5 16:38:27 2014 (r264150) @@ -278,9 +278,11 @@ fimd_init(struct fimd_softc *sc) reg |= ((panel->height - 1) << LINEVAL_OFFSET); DWRITE4(sc,VIDTCON2,reg); - WRITE4(sc,VIDW00ADD0B0, sc->sc_info.fb_pbase); - WRITE4(sc,VIDW00ADD1B0, sc->sc_info.fb_pbase + sc->sc_info.fb_size); - WRITE4(sc,VIDW00ADD2, panel->width * 2); + reg = sc->sc_info.fb_pbase; + WRITE4(sc, VIDW00ADD0B0, reg); + reg += (sc->sc_info.fb_stride * (sc->sc_info.fb_height + 1)); + WRITE4(sc, VIDW00ADD1B0, reg); + WRITE4(sc, VIDW00ADD2, sc->sc_info.fb_stride); reg = ((panel->width - 1) << OSD_RIGHTBOTX_F_OFFSET); reg |= ((panel->height - 1) << OSD_RIGHTBOTY_F_OFFSET); From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 16:54:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4866A49C; Sat, 5 Apr 2014 16:54:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 315166C8; Sat, 5 Apr 2014 16:54:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35GsmBH082767; Sat, 5 Apr 2014 16:54:48 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35GsmgT082766; Sat, 5 Apr 2014 16:54:48 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201404051654.s35GsmgT082766@svn.freebsd.org> From: Dmitry Chagin Date: Sat, 5 Apr 2014 16:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264151 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 16:54:48 -0000 Author: dchagin Date: Sat Apr 5 16:54:47 2014 New Revision: 264151 URL: http://svnweb.freebsd.org/changeset/base/264151 Log: Prevent alq from panic when the invalid alq_file path specified. MFC after: 1 week Modified: head/sys/kern/kern_alq.c Modified: head/sys/kern/kern_alq.c ============================================================================== --- head/sys/kern/kern_alq.c Sat Apr 5 16:38:27 2014 (r264150) +++ head/sys/kern/kern_alq.c Sat Apr 5 16:54:47 2014 (r264151) @@ -488,10 +488,12 @@ alq_open(struct alq **alqp, const char * KASSERT((count >= 0), ("%s: count < 0", __func__)); if (count > 0) { - ret = alq_open_flags(alqp, file, cred, cmode, size*count, 0); - (*alqp)->aq_flags |= AQ_LEGACY; - (*alqp)->aq_entmax = count; - (*alqp)->aq_entlen = size; + if ((ret = alq_open_flags(alqp, file, cred, cmode, + size*count, 0)) == 0) { + (*alqp)->aq_flags |= AQ_LEGACY; + (*alqp)->aq_entmax = count; + (*alqp)->aq_entlen = size; + } } else ret = alq_open_flags(alqp, file, cred, cmode, size, 0); From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 17:54:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7EF2330D; Sat, 5 Apr 2014 17:54:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EF2DBAE; Sat, 5 Apr 2014 17:54:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35Hs0lp007380; Sat, 5 Apr 2014 17:54:00 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35Hs0fQ007379; Sat, 5 Apr 2014 17:54:00 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201404051754.s35Hs0fQ007379@svn.freebsd.org> From: Luiz Otavio O Souza Date: Sat, 5 Apr 2014 17:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264153 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 17:54:00 -0000 Author: loos Date: Sat Apr 5 17:53:59 2014 New Revision: 264153 URL: http://svnweb.freebsd.org/changeset/base/264153 Log: - Fix the setup of interrupts for banks 2 and 3 on AM335x. On AM335x each one of the four GPIO banks has two physical interrupt lines, so we now allocate resources and setup our interrupt handler for all the (8) available interrupts. On OMAP3 and OMAP4 there is only one interrupt for each GPIO bank (6 banks, 6 interrupts), but there are two set of registers where the first one is used to setup the delivery of interrupts to the MPU and the second set, setup the delivery of interrupts to the DSP. On AM335x, each set of registers controls each one of the interrupt lines. - Remove nonexistent registers for OMAP4 and AM335x, replace their use with the correct ones for these SoCs. - Remove stray whitespace. Based on OMAP3, OMAP4 and AM335x TRMs. Tested on Beaglebone-black. Modified: head/sys/arm/ti/ti_gpio.c Modified: head/sys/arm/ti/ti_gpio.c ============================================================================== --- head/sys/arm/ti/ti_gpio.c Sat Apr 5 17:29:40 2014 (r264152) +++ head/sys/arm/ti/ti_gpio.c Sat Apr 5 17:53:59 2014 (r264153) @@ -124,10 +124,6 @@ __FBSDID("$FreeBSD$"); #define TI_GPIO_FALLINGDETECT 0x014C #define TI_GPIO_DEBOUNCENABLE 0x0150 #define TI_GPIO_DEBOUNCINGTIME 0x0154 -#define TI_GPIO_CLEARIRQENABLE1 0x0160 -#define TI_GPIO_SETIRQENABLE1 0x0164 -#define TI_GPIO_CLEARIRQENABLE2 0x0170 -#define TI_GPIO_SETIRQENABLE2 0x0174 #define TI_GPIO_CLEARWKUPENA 0x0180 #define TI_GPIO_SETWKUENA 0x0184 #define TI_GPIO_CLEARDATAOUT 0x0190 @@ -140,17 +136,21 @@ __FBSDID("$FreeBSD$"); #if defined(SOC_OMAP3) #define MAX_GPIO_BANKS 6 #define FIRST_GPIO_BANK 1 +#define INTR_PER_BANK 1 #define TI_GPIO_REV 0x00000025 #elif defined(SOC_OMAP4) #define MAX_GPIO_BANKS 6 #define FIRST_GPIO_BANK 1 +#define INTR_PER_BANK 1 #define TI_GPIO_REV 0x50600801 #elif defined(SOC_TI_AM335X) #define MAX_GPIO_BANKS 4 #define FIRST_GPIO_BANK 0 +#define INTR_PER_BANK 2 #define TI_GPIO_REV 0x50600801 #endif #define PINS_PER_BANK 32 +#define MAX_GPIO_INTRS MAX_GPIO_BANKS * INTR_PER_BANK /** * ti_gpio_mem_spec - Resource specification used when allocating resources @@ -158,6 +158,15 @@ __FBSDID("$FreeBSD$"); * * This driver module can have up to six independent memory regions, each * region typically controls 32 GPIO pins. + * + * On OMAP3 and OMAP4 there is only one physical interrupt line per bank, + * but there are two set of registers which control the interrupt delivery + * to internal subsystems. The first set of registers control the + * interrupts delivery to the MPU and the second set control the + * interrupts delivery to the DSP. + * + * On AM335x there are two physical interrupt lines for each GPIO module. + * Each interrupt line is controlled by a set of registers. */ static struct resource_spec ti_gpio_mem_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, @@ -175,9 +184,11 @@ static struct resource_spec ti_gpio_irq_ { SYS_RES_IRQ, 1, RF_ACTIVE | RF_OPTIONAL }, { SYS_RES_IRQ, 2, RF_ACTIVE | RF_OPTIONAL }, { SYS_RES_IRQ, 3, RF_ACTIVE | RF_OPTIONAL }, -#if !defined(SOC_TI_AM335X) { SYS_RES_IRQ, 4, RF_ACTIVE | RF_OPTIONAL }, { SYS_RES_IRQ, 5, RF_ACTIVE | RF_OPTIONAL }, +#if defined(SOC_TI_AM335X) + { SYS_RES_IRQ, 6, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 7, RF_ACTIVE | RF_OPTIONAL }, #endif { -1, 0, 0 } }; @@ -196,10 +207,10 @@ struct ti_gpio_softc { * the SoC type. */ struct resource *sc_mem_res[MAX_GPIO_BANKS]; - struct resource *sc_irq_res[MAX_GPIO_BANKS]; + struct resource *sc_irq_res[MAX_GPIO_INTRS]; /* The handle for the register IRQ handlers. */ - void *sc_irq_hdl[MAX_GPIO_BANKS]; + void *sc_irq_hdl[MAX_GPIO_INTRS]; /* * The following describes the H/W revision of each of the GPIO banks. @@ -254,6 +265,20 @@ ti_gpio_write_4(struct ti_gpio_softc *sc bus_write_4(sc->sc_mem_res[bank], off, val); } +static inline void +ti_gpio_intr_clr(struct ti_gpio_softc *sc, unsigned int bank, uint32_t mask) +{ + + /* We clear both set of registers. */ +#if defined(SOC_OMAP4) || defined(SOC_TI_AM335X) + ti_gpio_write_4(sc, bank, TI_GPIO_IRQSTATUS_CLR_0, mask); + ti_gpio_write_4(sc, bank, TI_GPIO_IRQSTATUS_CLR_1, mask); +#else + ti_gpio_write_4(sc, bank, TI_GPIO_CLEARIRQENABLE1, mask); + ti_gpio_write_4(sc, bank, TI_GPIO_CLEARIRQENABLE2, mask); +#endif +} + /** * ti_gpio_pin_max - Returns the maximum number of GPIO pins * @dev: gpio device handle @@ -647,7 +672,7 @@ ti_gpio_attach_intr(device_t dev) struct ti_gpio_softc *sc; sc = device_get_softc(dev); - for (i = 0; i < MAX_GPIO_BANKS; i++) { + for (i = 0; i < MAX_GPIO_INTRS; i++) { if (sc->sc_irq_res[i] == NULL) break; @@ -674,7 +699,7 @@ ti_gpio_detach_intr(device_t dev) /* Teardown our interrupt handlers. */ sc = device_get_softc(dev); - for (i = 0; i < MAX_GPIO_BANKS; i++) { + for (i = 0; i < MAX_GPIO_INTRS; i++) { if (sc->sc_irq_res[i] == NULL) break; @@ -725,8 +750,7 @@ ti_gpio_bank_init(device_t dev, int bank } /* Disable interrupts for all pins. */ - ti_gpio_write_4(sc, bank, TI_GPIO_CLEARIRQENABLE1, 0xffffffff); - ti_gpio_write_4(sc, bank, TI_GPIO_CLEARIRQENABLE2, 0xffffffff); + ti_gpio_intr_clr(sc, bank, 0xffffffff); /* Init OE register based on pads configuration. */ reg_oe = 0xffffffff; @@ -737,7 +761,7 @@ ti_gpio_bank_init(device_t dev, int bank reg_oe &= ~(1UL << pin); } ti_gpio_write_4(sc, bank, TI_GPIO_OE, reg_oe); - + return (0); } @@ -840,10 +864,8 @@ ti_gpio_detach(device_t dev) /* Disable all interrupts */ for (i = 0; i < MAX_GPIO_BANKS; i++) { - if (sc->sc_mem_res[i] != NULL) { - ti_gpio_write_4(sc, i, TI_GPIO_CLEARIRQENABLE1, 0xffffffff); - ti_gpio_write_4(sc, i, TI_GPIO_CLEARIRQENABLE2, 0xffffffff); - } + if (sc->sc_mem_res[i] != NULL) + ti_gpio_intr_clr(sc, i, 0xffffffff); } bus_generic_detach(dev); From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 17:54:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 186FC452; Sat, 5 Apr 2014 17:54:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE0ECBB6; Sat, 5 Apr 2014 17:54:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35HsbVP007505; Sat, 5 Apr 2014 17:54:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35HsaSq007498; Sat, 5 Apr 2014 17:54:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404051754.s35HsaSq007498@svn.freebsd.org> From: Warner Losh Date: Sat, 5 Apr 2014 17:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264154 - in head: lib/libproc lib/libproc/test/t1-bkpt lib/libproc/test/t2-name2map lib/libproc/test/t3-name2sym share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 17:54:38 -0000 Author: imp Date: Sat Apr 5 17:54:36 2014 New Revision: 264154 URL: http://svnweb.freebsd.org/changeset/base/264154 Log: The proper way to request no man pages currently is NO_MAN=xxx. Use it in preference to the user WITHOUT_MAN knob, which should never be set in normal src Makefiles. Modified: head/lib/libproc/Makefile head/lib/libproc/test/t1-bkpt/Makefile head/lib/libproc/test/t2-name2map/Makefile head/lib/libproc/test/t3-name2sym/Makefile head/share/mk/bsd.test.mk Modified: head/lib/libproc/Makefile ============================================================================== --- head/lib/libproc/Makefile Sat Apr 5 17:53:59 2014 (r264153) +++ head/lib/libproc/Makefile Sat Apr 5 17:54:36 2014 (r264154) @@ -25,6 +25,6 @@ DPADD+= ${LIBSTDCPLUSPLUS} SHLIB_MAJOR= 2 -WITHOUT_MAN= +NO_MAN= .include Modified: head/lib/libproc/test/t1-bkpt/Makefile ============================================================================== --- head/lib/libproc/test/t1-bkpt/Makefile Sat Apr 5 17:53:59 2014 (r264153) +++ head/lib/libproc/test/t1-bkpt/Makefile Sat Apr 5 17:54:36 2014 (r264154) @@ -7,6 +7,6 @@ SRCS= t1-bkpt.c LDADD= -lproc -lelf -lrtld_db -lutil DPADD= ${LIBPROC} ${LIBELF} -WITHOUT_MAN= +NO_MAN= .include Modified: head/lib/libproc/test/t2-name2map/Makefile ============================================================================== --- head/lib/libproc/test/t2-name2map/Makefile Sat Apr 5 17:53:59 2014 (r264153) +++ head/lib/libproc/test/t2-name2map/Makefile Sat Apr 5 17:54:36 2014 (r264154) @@ -7,6 +7,6 @@ SRCS= t2-name2map.c LDADD= -lproc -lelf -lrtld_db -lutil DPADD= ${LIBPROC} ${LIBELF} -WITHOUT_MAN= +NO_MAN= .include Modified: head/lib/libproc/test/t3-name2sym/Makefile ============================================================================== --- head/lib/libproc/test/t3-name2sym/Makefile Sat Apr 5 17:53:59 2014 (r264153) +++ head/lib/libproc/test/t3-name2sym/Makefile Sat Apr 5 17:54:36 2014 (r264154) @@ -7,6 +7,6 @@ SRCS= t3-name2sym.c LDADD= -lproc -lelf -lrtld_db -lutil DPADD= ${LIBPROC} ${LIBELF} -WITHOUT_MAN= +NO_MAN= .include Modified: head/share/mk/bsd.test.mk ============================================================================== --- head/share/mk/bsd.test.mk Sat Apr 5 17:53:59 2014 (r264153) +++ head/share/mk/bsd.test.mk Sat Apr 5 17:54:36 2014 (r264154) @@ -51,8 +51,8 @@ SUBDIR+= ${TESTS_SUBDIRS} # it is rare for test cases to have man pages .if !defined(MAN) -WITHOUT_MAN=yes -.export WITHOUT_MAN +NO_MAN=yes +.export NO_MAN .endif # tell progs.mk we might want to install things From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 17:54:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6BD4D584; Sat, 5 Apr 2014 17:54:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 563F8BB7; Sat, 5 Apr 2014 17:54:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35HskRK007583; Sat, 5 Apr 2014 17:54:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35HsiWU007565; Sat, 5 Apr 2014 17:54:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404051754.s35HsiWU007565@svn.freebsd.org> From: Warner Losh Date: Sat, 5 Apr 2014 17:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264155 - in head: lib/libc/amd64/sys lib/libc/arm/sys lib/libc/i386/sys lib/libc/ia64/sys lib/libc/mips/sys lib/libc/powerpc/sys lib/libc/powerpc64/sys lib/libc/sparc64/sys lib/libc/sy... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 17:54:46 -0000 Author: imp Date: Sat Apr 5 17:54:43 2014 New Revision: 264155 URL: http://svnweb.freebsd.org/changeset/base/264155 Log: Convert from WITHOUT_SYSCALL_COMPAT to MK_SYSCALL_COMPAT. Modified: head/lib/libc/amd64/sys/Makefile.inc head/lib/libc/arm/sys/Makefile.inc head/lib/libc/i386/sys/Makefile.inc head/lib/libc/ia64/sys/Makefile.inc head/lib/libc/mips/sys/Makefile.inc head/lib/libc/powerpc/sys/Makefile.inc head/lib/libc/powerpc64/sys/Makefile.inc head/lib/libc/sparc64/sys/Makefile.inc head/lib/libc/sys/Makefile.inc head/lib/libthr/Makefile head/share/mk/bsd.own.mk Modified: head/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- head/lib/libc/amd64/sys/Makefile.inc Sat Apr 5 17:54:36 2014 (r264154) +++ head/lib/libc/amd64/sys/Makefile.inc Sat Apr 5 17:54:43 2014 (r264155) @@ -11,6 +11,6 @@ MDASM= vfork.S brk.S cerror.S exect.S ge NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o PSEUDO= _getlogin.o _exit.o -.if !defined(WITHOUT_SYSCALL_COMPAT) +.if ${MK_SYSCALL_COMPAT} != "no" PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o .endif Modified: head/lib/libc/arm/sys/Makefile.inc ============================================================================== --- head/lib/libc/arm/sys/Makefile.inc Sat Apr 5 17:54:36 2014 (r264154) +++ head/lib/libc/arm/sys/Makefile.inc Sat Apr 5 17:54:43 2014 (r264155) @@ -8,6 +8,6 @@ MDASM= Ovfork.S brk.S cerror.S pipe.S pt NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o PSEUDO= _exit.o _getlogin.o -.if !defined(WITHOUT_SYSCALL_COMPAT) +.if ${MK_SYSCALL_COMPAT} != "no" PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o .endif Modified: head/lib/libc/i386/sys/Makefile.inc ============================================================================== --- head/lib/libc/i386/sys/Makefile.inc Sat Apr 5 17:54:36 2014 (r264154) +++ head/lib/libc/i386/sys/Makefile.inc Sat Apr 5 17:54:43 2014 (r264155) @@ -15,7 +15,7 @@ MDASM= Ovfork.S brk.S cerror.S exect.S g NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o PSEUDO= _getlogin.o _exit.o -.if !defined(WITHOUT_SYSCALL_COMPAT) +.if ${MK_SYSCALL_COMPAT} != "no" PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o .endif Modified: head/lib/libc/ia64/sys/Makefile.inc ============================================================================== --- head/lib/libc/ia64/sys/Makefile.inc Sat Apr 5 17:54:36 2014 (r264154) +++ head/lib/libc/ia64/sys/Makefile.inc Sat Apr 5 17:54:43 2014 (r264155) @@ -9,6 +9,6 @@ MDASM+= Ovfork.S brk.S cerror.S exect.S NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o PSEUDO= _getlogin.o _exit.o -.if !defined(WITHOUT_SYSCALL_COMPAT) +.if ${MK_SYSCALL_COMPAT} != "no" PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o .endif Modified: head/lib/libc/mips/sys/Makefile.inc ============================================================================== --- head/lib/libc/mips/sys/Makefile.inc Sat Apr 5 17:54:36 2014 (r264154) +++ head/lib/libc/mips/sys/Makefile.inc Sat Apr 5 17:54:43 2014 (r264155) @@ -10,6 +10,6 @@ NOASM= break.o exit.o ftruncate.o getlog openbsd_poll.o pread.o pwrite.o sstk.o truncate.o vfork.o yield.o PSEUDO= _exit.o _getlogin.o -.if !defined(WITHOUT_SYSCALL_COMPAT) +.if ${MK_SYSCALL_COMPAT} != "no" PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o .endif Modified: head/lib/libc/powerpc/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc/sys/Makefile.inc Sat Apr 5 17:54:36 2014 (r264154) +++ head/lib/libc/powerpc/sys/Makefile.inc Sat Apr 5 17:54:43 2014 (r264155) @@ -6,6 +6,6 @@ MDASM+= brk.S cerror.S exect.S pipe.S pt NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o PSEUDO= _getlogin.o _exit.o -.if !defined(WITHOUT_SYSCALL_COMPAT) +.if ${MK_SYSCALL_COMPAT} != "no" PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o .endif Modified: head/lib/libc/powerpc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc64/sys/Makefile.inc Sat Apr 5 17:54:36 2014 (r264154) +++ head/lib/libc/powerpc64/sys/Makefile.inc Sat Apr 5 17:54:43 2014 (r264155) @@ -6,6 +6,6 @@ MDASM+= brk.S cerror.S exect.S pipe.S pt NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o PSEUDO= _getlogin.o _exit.o -.if !defined(WITHOUT_SYSCALL_COMPAT) +.if ${MK_SYSCALL_COMPAT} != "no" PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o .endif Modified: head/lib/libc/sparc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/sparc64/sys/Makefile.inc Sat Apr 5 17:54:36 2014 (r264154) +++ head/lib/libc/sparc64/sys/Makefile.inc Sat Apr 5 17:54:43 2014 (r264155) @@ -18,6 +18,6 @@ MDASM+= brk.S cerror.S exect.S pipe.S pt NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o PSEUDO= _getlogin.o _exit.o -.if !defined(WITHOUT_SYSCALL_COMPAT) +.if ${MK_SYSCALL_COMPAT} != "no" PSEUDO+= _pread.o _pwrite.o _lseek.o _mmap.o _ftruncate.o _truncate.o .endif Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Sat Apr 5 17:54:36 2014 (r264154) +++ head/lib/libc/sys/Makefile.inc Sat Apr 5 17:54:43 2014 (r264155) @@ -21,7 +21,7 @@ PSEUDO+= _clock_gettime.o _gettimeofday. # Sources common to both syscall interfaces: SRCS+= stack_protector.c stack_protector_compat.c __error.c -.if !defined(WITHOUT_SYSCALL_COMPAT) +.if ${MK_SYSCALL_COMPAT} != "no" SYSCALL_COMPAT_SRCS= fcntl.c ftruncate.c lseek.c mmap.c pread.c \ pwrite.c truncate.c SRCS+= ${SYSCALL_COMPAT_SRCS} Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Sat Apr 5 17:54:36 2014 (r264154) +++ head/lib/libthr/Makefile Sat Apr 5 17:54:43 2014 (r264155) @@ -60,7 +60,7 @@ SYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthr SYMLINKS+=lib${LIB}_p.a ${LIBDIR}/libpthread_p.a .endif -.if !defined(WITHOUT_SYSCALL_COMPAT) +.if ${MK_SYSCALL_COMPAT} != "no" CFLAGS+=-DSYSCALL_COMPAT .endif Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sat Apr 5 17:54:36 2014 (r264154) +++ head/share/mk/bsd.own.mk Sat Apr 5 17:54:43 2014 (r264155) @@ -334,6 +334,7 @@ __DEFAULT_YES_OPTIONS = \ SSP \ SVNLITE \ SYMVER \ + SYSCALL_COMPAT \ SYSCONS \ SYSINSTALL \ TCSH \ From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 17:54:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39F866C0; Sat, 5 Apr 2014 17:54:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27A42BB9; Sat, 5 Apr 2014 17:54:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35HspV7007639; Sat, 5 Apr 2014 17:54:51 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35HsoSg007637; Sat, 5 Apr 2014 17:54:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404051754.s35HsoSg007637@svn.freebsd.org> From: Warner Losh Date: Sat, 5 Apr 2014 17:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264156 - in head: kerberos5 tools/bsdbox X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 17:54:51 -0000 Author: imp Date: Sat Apr 5 17:54:50 2014 New Revision: 264156 URL: http://svnweb.freebsd.org/changeset/base/264156 Log: use MK_KERBEROS=no in preference to WITHOUT_KERBEROS Modified: head/kerberos5/Makefile head/tools/bsdbox/Makefile.telnetd Modified: head/kerberos5/Makefile ============================================================================== --- head/kerberos5/Makefile Sat Apr 5 17:54:43 2014 (r264155) +++ head/kerberos5/Makefile Sat Apr 5 17:54:50 2014 (r264156) @@ -21,11 +21,11 @@ kerberize: dekerberize: .for entry in ${KPROGS} cd ${.CURDIR}/../${entry}; \ - ${MAKE} -DWITHOUT_KERBEROS cleandir; \ - ${MAKE} -DWITHOUT_KERBEROS obj; \ - ${MAKE} -DWITHOUT_KERBEROS depend; \ - ${MAKE} -DWITHOUT_KERBEROS all; \ - ${MAKE} -DWITHOUT_KERBEROS install + ${MAKE} MK_KERBEROS=no cleandir; \ + ${MAKE} MK_KERBEROS=no obj; \ + ${MAKE} MK_KERBEROS=no depend; \ + ${MAKE} MK_KERBEROS=no all; \ + ${MAKE} MK_KERBEROS=no install .endfor .include Modified: head/tools/bsdbox/Makefile.telnetd ============================================================================== --- head/tools/bsdbox/Makefile.telnetd Sat Apr 5 17:54:43 2014 (r264155) +++ head/tools/bsdbox/Makefile.telnetd Sat Apr 5 17:54:50 2014 (r264156) @@ -11,4 +11,4 @@ CRUNCH_PROGS_libexec+= telnetd CRUNCH_PROGS_usr.bin+= telnet CRUNCH_LIBS+= -lkrb5 -lhx509 -lasn1 -lcom_err -lroken -ltelnetd -# CRUNCH_BUILDOPTS_telnetd= WITHOUT_KERBEROS_SUPPORT=yes +# CRUNCH_BUILDOPTS_telnetd= MK_KERBEROS_SUPPORT=no From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 17:54:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD1AC7F8; Sat, 5 Apr 2014 17:54:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAC2ABBB; Sat, 5 Apr 2014 17:54:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35Hstmw007695; Sat, 5 Apr 2014 17:54:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35Hst9N007694; Sat, 5 Apr 2014 17:54:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404051754.s35Hst9N007694@svn.freebsd.org> From: Warner Losh Date: Sat, 5 Apr 2014 17:54:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264157 - head/secure X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 17:54:55 -0000 Author: imp Date: Sat Apr 5 17:54:55 2014 New Revision: 264157 URL: http://svnweb.freebsd.org/changeset/base/264157 Log: Use MK_CRYPT=no in preference to WITHOUT_CRYPT here. Modified: head/secure/Makefile Modified: head/secure/Makefile ============================================================================== --- head/secure/Makefile Sat Apr 5 17:54:50 2014 (r264156) +++ head/secure/Makefile Sat Apr 5 17:54:55 2014 (r264157) @@ -27,11 +27,11 @@ secure: insecure: .for entry in ${SPROGS} cd ${.CURDIR}/../${entry}; \ - ${MAKE} -DWITHOUT_CRYPT cleandir; \ - ${MAKE} -DWITHOUT_CRYPT obj; \ - ${MAKE} -DWITHOUT_CRYPT depend; \ - ${MAKE} -DWITHOUT_CRYPT all; \ - ${MAKE} -DWITHOUT_CRYPT install + ${MAKE} MK_CRYPT=no cleandir; \ + ${MAKE} MK_CRYPT=no obj; \ + ${MAKE} MK_CRYPT=no depend; \ + ${MAKE} MK_CRYPT=no all; \ + ${MAKE} MK_CRYPT=no install .endfor .include From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 18:00:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF4D6A6E; Sat, 5 Apr 2014 18:00:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81EB6C61; Sat, 5 Apr 2014 18:00:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35I0jSI008688; Sat, 5 Apr 2014 18:00:45 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35I0jtb008687; Sat, 5 Apr 2014 18:00:45 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404051800.s35I0jtb008687@svn.freebsd.org> From: Warner Losh Date: Sat, 5 Apr 2014 18:00:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264158 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 18:00:45 -0000 Author: imp Date: Sat Apr 5 18:00:45 2014 New Revision: 264158 URL: http://svnweb.freebsd.org/changeset/base/264158 Log: Document upcoming build option WITH_SORT_THREADS Added: head/tools/build/options/WITH_SORT_THREADS (contents, props changed) Added: head/tools/build/options/WITH_SORT_THREADS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_SORT_THREADS Sat Apr 5 18:00:45 2014 (r264158) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to enable threads in +.Xr sort 1 . From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 18:01:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A00F4BAE; Sat, 5 Apr 2014 18:01:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D645C6A; Sat, 5 Apr 2014 18:01:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35I1og9011379; Sat, 5 Apr 2014 18:01:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35I1oPj011377; Sat, 5 Apr 2014 18:01:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404051801.s35I1oPj011377@svn.freebsd.org> From: Warner Losh Date: Sat, 5 Apr 2014 18:01:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264159 - in head: share/mk usr.bin/sort X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 18:01:50 -0000 Author: imp Date: Sat Apr 5 18:01:49 2014 New Revision: 264159 URL: http://svnweb.freebsd.org/changeset/base/264159 Log: Convert sort to using newer MK_ convention. Modified: head/share/mk/bsd.own.mk head/usr.bin/sort/Makefile Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sat Apr 5 18:00:45 2014 (r264158) +++ head/share/mk/bsd.own.mk Sat Apr 5 18:01:49 2014 (r264159) @@ -361,6 +361,7 @@ __DEFAULT_NO_OPTIONS = \ OFED \ OPENSSH_NONE_CIPHER \ SHARED_TOOLCHAIN \ + SORT_THREADS \ SVN \ TESTS \ USB_GADGET_EXAMPLES Modified: head/usr.bin/sort/Makefile ============================================================================== --- head/usr.bin/sort/Makefile Sat Apr 5 18:00:45 2014 (r264158) +++ head/usr.bin/sort/Makefile Sat Apr 5 18:01:49 2014 (r264159) @@ -11,7 +11,7 @@ sort.1: sort.1.in CLEANFILES+= sort.1 -.if defined(WITH_THREADS) +.if ${MK_SORT_THREADS} != "no" CFLAGS+= -DSORT_THREADS LDFLAGS+= -lpthread -lmd MAN_SUB+= -e 's|%%THREADS%%||g' @@ -20,7 +20,7 @@ LDFLAGS+= -lmd MAN_SUB+= -e 's|%%THREADS%%|\.\\"|g' .endif -.if !defined(WITHOUT_NLS) +.if ${MK_NLS} != "no" NLS+= hu_HU.ISO8859-2 NLSSRCFILES= ${NLS:S@$@.msg@} MAN_SUB+= -e 's|%%NLS%%||g' From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 18:13:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2A62F34; Sat, 5 Apr 2014 18:13:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B56E3D61; Sat, 5 Apr 2014 18:13:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35IDTaA015970; Sat, 5 Apr 2014 18:13:29 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35IDTgU015967; Sat, 5 Apr 2014 18:13:29 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201404051813.s35IDTgU015967@svn.freebsd.org> From: Rui Paulo Date: Sat, 5 Apr 2014 18:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264160 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 18:13:30 -0000 Author: rpaulo Date: Sat Apr 5 18:13:28 2014 New Revision: 264160 URL: http://svnweb.freebsd.org/changeset/base/264160 Log: Remove code under PMAP_CACHE_VIVT that is not compiled anymore. This is for ARMv4/ARMv5 and it doesn't belong in ARMv6 code. Reviewed by: ian Modified: head/sys/arm/arm/cpufunc_asm_arm11.S head/sys/arm/arm/cpufunc_asm_arm11x6.S head/sys/arm/arm/cpufunc_asm_armv6.S Modified: head/sys/arm/arm/cpufunc_asm_arm11.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_arm11.S Sat Apr 5 18:01:49 2014 (r264159) +++ head/sys/arm/arm/cpufunc_asm_arm11.S Sat Apr 5 18:13:28 2014 (r264160) @@ -44,12 +44,6 @@ __FBSDID("$FreeBSD$"); * addresses that are about to change. */ ENTRY(arm11_setttb) -#ifdef PMAP_CACHE_VIVT - stmfd sp!, {r0, lr} - bl _C_LABEL(armv5_idcache_wbinv_all) - ldmfd sp!, {r0, lr} -#endif - mcr p15, 0, r0, c2, c0, 0 /* load new TTB */ mcr p15, 0, r0, c8, c7, 0 /* invalidate I+D TLBs */ Modified: head/sys/arm/arm/cpufunc_asm_arm11x6.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_arm11x6.S Sat Apr 5 18:01:49 2014 (r264159) +++ head/sys/arm/arm/cpufunc_asm_arm11x6.S Sat Apr 5 18:13:28 2014 (r264160) @@ -114,12 +114,7 @@ __FBSDID("$FreeBSD$"); #endif ENTRY(arm11x6_setttb) -#ifdef PMAP_CACHE_VIVT - Flush_D_cache(r1) - Invalidate_I_cache(r1, r2) -#else mov r1, #0 -#endif mcr p15, 0, r0, c2, c0, 0 /* load new TTB */ mcr p15, 0, r1, c8, c7, 0 /* invalidate I+D TLBs */ mcr p15, 0, r1, c7, c10, 4 /* drain write buffer */ Modified: head/sys/arm/arm/cpufunc_asm_armv6.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_armv6.S Sat Apr 5 18:01:49 2014 (r264159) +++ head/sys/arm/arm/cpufunc_asm_armv6.S Sat Apr 5 18:13:28 2014 (r264160) @@ -49,10 +49,6 @@ * addresses that are about to change. */ ENTRY(armv6_setttb) -#ifdef PMAP_CACHE_VIVT - mcr p15, 0, r0, c7, c5, 0 /* Flush I cache */ - mcr p15, 0, r0, c7, c14, 0 /* clean and invalidate D cache */ -#endif mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ mcr p15, 0, r0, c2, c0, 0 /* load new TTB */ From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 18:14:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27EB71FD; Sat, 5 Apr 2014 18:14:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 151E4D70; Sat, 5 Apr 2014 18:14:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35IEwxp016393; Sat, 5 Apr 2014 18:14:58 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35IEwfl016392; Sat, 5 Apr 2014 18:14:58 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201404051814.s35IEwfl016392@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 5 Apr 2014 18:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264161 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 18:14:59 -0000 Author: marcel Date: Sat Apr 5 18:14:58 2014 New Revision: 264161 URL: http://svnweb.freebsd.org/changeset/base/264161 Log: The getlogin_basic() function can return a 0 status with a NULL pointer for the login name (result). Make sure to handle that case properly. Improve robustness by checking namelen and then nul-terminating the provided buffer to simplify subsequent logic. Obtained from: Juniper Networks, Inc. MFC after: 1 week Modified: head/lib/libc/gen/getlogin.c Modified: head/lib/libc/gen/getlogin.c ============================================================================== --- head/lib/libc/gen/getlogin.c Sat Apr 5 18:13:28 2014 (r264160) +++ head/lib/libc/gen/getlogin.c Sat Apr 5 18:14:58 2014 (r264161) @@ -87,11 +87,16 @@ getlogin_r(char *logname, int namelen) char *result; int len; int status; - + + if (namelen < 1) + return (ERANGE); + logname[0] = '\0'; + THREAD_LOCK(); result = getlogin_basic(&status); - if (status == 0) { - if ((len = strlen(result) + 1) > namelen) + if (status == 0 && result != NULL) { + len = strlen(result) + 1; + if (len > namelen) status = ERANGE; else strncpy(logname, result, len); From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 18:32:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC5B65B1; Sat, 5 Apr 2014 18:32:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8FAFEBC; Sat, 5 Apr 2014 18:32:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35IWepK024264; Sat, 5 Apr 2014 18:32:40 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35IWeI2024263; Sat, 5 Apr 2014 18:32:40 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201404051832.s35IWeI2024263@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 5 Apr 2014 18:32:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264162 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 18:32:41 -0000 Author: marcel Date: Sat Apr 5 18:32:40 2014 New Revision: 264162 URL: http://svnweb.freebsd.org/changeset/base/264162 Log: Accept RFC 2292 option values so that RFC 2292 compliant programs that are unaware of RFC 3542 can construct control messages. The kernel disallows mixing RFC 2292 behaviour with RFC 3542 behaviour. Only sockets that have specifically been marked as using the RFC 2292 API can use RFC 2292 specific options. This is all good and well, but libc itself seems inconsistent with this. The root cause of this inconsistency seems to relate to the definitions of IPV6_HOPOPTS and IPV6_DSTOPTS. They are defined in RFC 2292 and re-used in RFC 3542, yet have distinct values in the kernel. It's for this reason that the kernel also has definitions for IPV6_2292HOPOPTS and IPV6_2292DSTOPTS. Not so in libc. For example: some program calls inet6_option_init() (defined by RFC 2292) with the RFC 2292 defined IPV6_HOPOPTS and IPV6_DSTOPTS. Before RFC 3542, this was translated to values of 22 and 23 (resp.) The libc implementation correctly checks that only options IPV6_HOPOPTS and IPV6_DSTOPTS are given (as per RFC 2292) but since these defines have taken on the values defined by RFC 3542 (values 49 and 50 resp,) rejects the correct option values (22 and 23) passed said program and returns -1. The precisie fix is to have inet6_option_init() and friends only accept the RFC 2292 defined IPV6_HOPOPTS & IPV6_DSTOPTS, but that breaks other code (like mld6query(8)), which seem to not be aware of RFC 3542 and how it hi-jacked the option names. So the best fix is to accept the options from both. Obtained from: Juniper Networks, Inc. MFC after: 1 week Modified: head/lib/libc/net/ip6opt.c Modified: head/lib/libc/net/ip6opt.c ============================================================================== --- head/lib/libc/net/ip6opt.c Sat Apr 5 18:14:58 2014 (r264161) +++ head/lib/libc/net/ip6opt.c Sat Apr 5 18:32:40 2014 (r264162) @@ -45,6 +45,18 @@ __FBSDID("$FreeBSD$"); static int ip6optlen(u_int8_t *opt, u_int8_t *lim); static void inet6_insert_padopt(u_char *p, int len); +#ifndef IPV6_2292HOPOPTS +#define IPV6_2292HOPOPTS 22 +#endif +#ifndef IPV6_2292DSTOPTS +#define IPV6_2292DSTOPTS 23 +#endif + +#define is_ipv6_hopopts(x) \ + ((x) == IPV6_HOPOPTS || (x) == IPV6_2292HOPOPTS) +#define is_ipv6_dstopts(x) \ + ((x) == IPV6_DSTOPTS || (x) == IPV6_2292DSTOPTS) + /* * This function returns the number of bytes required to hold an option * when it is stored as ancillary data, including the cmsghdr structure @@ -72,9 +84,9 @@ inet6_option_init(void *bp, struct cmsgh struct cmsghdr *ch = (struct cmsghdr *)bp; /* argument validation */ - if (type != IPV6_HOPOPTS && type != IPV6_DSTOPTS) + if (!is_ipv6_hopopts(type) && !is_ipv6_dstopts(type)) return(-1); - + ch->cmsg_level = IPPROTO_IPV6; ch->cmsg_type = type; ch->cmsg_len = CMSG_LEN(0); @@ -234,8 +246,8 @@ inet6_option_next(const struct cmsghdr * u_int8_t *lim; if (cmsg->cmsg_level != IPPROTO_IPV6 || - (cmsg->cmsg_type != IPV6_HOPOPTS && - cmsg->cmsg_type != IPV6_DSTOPTS)) + (!is_ipv6_hopopts(cmsg->cmsg_type) && + !is_ipv6_dstopts(cmsg->cmsg_type))) return(-1); /* message length validation */ @@ -290,8 +302,8 @@ inet6_option_find(const struct cmsghdr * u_int8_t *optp, *lim; if (cmsg->cmsg_level != IPPROTO_IPV6 || - (cmsg->cmsg_type != IPV6_HOPOPTS && - cmsg->cmsg_type != IPV6_DSTOPTS)) + (!is_ipv6_hopopts(cmsg->cmsg_type) && + !is_ipv6_dstopts(cmsg->cmsg_type))) return(-1); /* message length validation */ From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 18:41:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABC167AA; Sat, 5 Apr 2014 18:41:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98D21F6F; Sat, 5 Apr 2014 18:41:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35If8cv027383; Sat, 5 Apr 2014 18:41:08 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35If88l027382; Sat, 5 Apr 2014 18:41:08 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404051841.s35If88l027382@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 5 Apr 2014 18:41:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264163 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 18:41:08 -0000 Author: trasz Date: Sat Apr 5 18:41:08 2014 New Revision: 264163 URL: http://svnweb.freebsd.org/changeset/base/264163 Log: Remove hack to pass STAILQ to a function and do it properly instead. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.c Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Sat Apr 5 18:32:40 2014 (r264162) +++ head/sys/dev/iscsi/icl.c Sat Apr 5 18:41:08 2014 (r264163) @@ -105,6 +105,8 @@ static volatile u_int icl_ncons; #define ICL_CONN_LOCK_ASSERT(X) mtx_assert(X->ic_lock, MA_OWNED) #define ICL_CONN_LOCK_ASSERT_NOT(X) mtx_assert(X->ic_lock, MA_NOTOWNED) +STAILQ_HEAD(icl_pdu_stailq, icl_pdu); + static void icl_conn_fail(struct icl_conn *ic) { @@ -831,9 +833,8 @@ icl_pdu_finalize(struct icl_pdu *request } static void -icl_conn_send_pdus(struct icl_conn *ic, void *fts) +icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue) { - STAILQ_HEAD(, icl_pdu) *queue = fts; /* XXX */ struct icl_pdu *request, *request2; struct socket *so; size_t available, size, size2; @@ -943,7 +944,7 @@ static void icl_send_thread(void *arg) { struct icl_conn *ic; - STAILQ_HEAD(, icl_pdu) queue; + struct icl_pdu_stailq queue; ic = arg; From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 18:56:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D575B9C; Sat, 5 Apr 2014 18:56:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D755F4; Sat, 5 Apr 2014 18:56:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35Iu2Ns032921; Sat, 5 Apr 2014 18:56:02 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35Iu2TV032920; Sat, 5 Apr 2014 18:56:02 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201404051856.s35Iu2TV032920@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 5 Apr 2014 18:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264164 - head/sys/compat/freebsd32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 18:56:02 -0000 Author: marcel Date: Sat Apr 5 18:56:01 2014 New Revision: 264164 URL: http://svnweb.freebsd.org/changeset/base/264164 Log: In freebsd32_sendmsg(), replace the call to sockargs() followed by a call to freebsd32_convert_msg_in() with freebsd32_copyin_control() to readin and convert in a single step. This makes it simpler to put all the control messages in a single mbuf or mbuf cluster as per the limitations imposed upon us by ip6_setpktopts(). The logic is as follows: 1. Go over the array of control messages to determine overall size and include extra padding for proper alignment as we go. 2. Get a mbuf or mbuf cluster as needed or fail if the overall (adjusted) size is larger than a cluster. 3. Go over the array of control messages again, but now copy them into kernel space and into aligned offsets. 4. Update the length of the control message to take padding between the header and the data into account (but not for padding added between one control message and the next). Obtained from: Juniper Networks, Inc. MFC after: 1 week Modified: head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sat Apr 5 18:41:08 2014 (r264163) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sat Apr 5 18:56:01 2014 (r264164) @@ -1137,47 +1137,91 @@ freebsd32_recvmsg(td, uap) return (error); } - +/* + * Copy-in the array of control messages constructed using alignment + * and padding suitable for a 32-bit environment and construct an + * mbuf using alignment and padding suitable for a 64-bit kernel. + * The alignment and padding are defined indirectly by CMSG_DATA(), + * CMSG_SPACE() and CMSG_LEN(). + */ static int -freebsd32_convert_msg_in(struct mbuf **controlp) +freebsd32_copyin_control(struct mbuf **mp, caddr_t buf, u_int buflen) { - struct mbuf *control = *controlp; - struct cmsghdr *cm = mtod(control, struct cmsghdr *); - void *data; - socklen_t clen = control->m_len, datalen; + struct mbuf *m; + void *md; + u_int idx, len, msglen; int error; - error = 0; - *controlp = NULL; + buflen = FREEBSD32_ALIGN(buflen); - while (cm != NULL) { - if (sizeof(struct cmsghdr) > clen || cm->cmsg_len > clen) { - error = EINVAL; - break; - } + if (buflen > MCLBYTES) + return (EINVAL); - data = FREEBSD32_CMSG_DATA(cm); - datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; + /* + * Iterate over the buffer and get the length of each message + * in there. This has 32-bit alignment and padding. Use it to + * determine the length of these messages when using 64-bit + * alignment and padding. + */ + idx = 0; + len = 0; + while (idx < buflen) { + error = copyin(buf + idx, &msglen, sizeof(msglen)); + if (error) + return (error); + if (msglen < sizeof(struct cmsghdr)) + return (EINVAL); + msglen = FREEBSD32_ALIGN(msglen); + if (idx + msglen > buflen) + return (EINVAL); + idx += msglen; + msglen += CMSG_ALIGN(sizeof(struct cmsghdr)) - + FREEBSD32_ALIGN(sizeof(struct cmsghdr)); + len += CMSG_ALIGN(msglen); + } - *controlp = sbcreatecontrol(data, datalen, cm->cmsg_type, - cm->cmsg_level); - controlp = &(*controlp)->m_next; - - if (FREEBSD32_CMSG_SPACE(datalen) < clen) { - clen -= FREEBSD32_CMSG_SPACE(datalen); - cm = (struct cmsghdr *) - ((caddr_t)cm + FREEBSD32_CMSG_SPACE(datalen)); - } else { - clen = 0; - cm = NULL; + if (len > MCLBYTES) + return (EINVAL); + + m = m_get(M_WAITOK, MT_CONTROL); + if (len > MLEN) + MCLGET(m, M_WAITOK); + m->m_len = len; + + md = mtod(m, void *); + while (buflen > 0) { + error = copyin(buf, md, sizeof(struct cmsghdr)); + if (error) + break; + msglen = *(u_int *)md; + msglen = FREEBSD32_ALIGN(msglen); + + /* Modify the message length to account for alignment. */ + *(u_int *)md = msglen + CMSG_ALIGN(sizeof(struct cmsghdr)) - + FREEBSD32_ALIGN(sizeof(struct cmsghdr)); + + md = (char *)md + CMSG_ALIGN(sizeof(struct cmsghdr)); + buf += FREEBSD32_ALIGN(sizeof(struct cmsghdr)); + buflen -= FREEBSD32_ALIGN(sizeof(struct cmsghdr)); + + msglen -= FREEBSD32_ALIGN(sizeof(struct cmsghdr)); + if (msglen > 0) { + error = copyin(buf, md, msglen); + if (error) + break; + md = (char *)md + CMSG_ALIGN(msglen); + buf += msglen; + buflen -= msglen; } } - m_freem(control); + if (error) + m_free(m); + else + *mp = m; return (error); } - int freebsd32_sendmsg(struct thread *td, struct freebsd32_sendmsg_args *uap) @@ -1215,14 +1259,13 @@ freebsd32_sendmsg(struct thread *td, goto out; } - error = sockargs(&control, msg.msg_control, - msg.msg_controllen, MT_CONTROL); - if (error) - goto out; - - error = freebsd32_convert_msg_in(&control); + error = freebsd32_copyin_control(&control, msg.msg_control, + msg.msg_controllen); if (error) goto out; + + msg.msg_control = NULL; + msg.msg_controllen = 0; } error = kern_sendit(td, uap->s, &msg, uap->flags, control, From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 19:08:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1C0FF83; Sat, 5 Apr 2014 19:08:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9ED281EB; Sat, 5 Apr 2014 19:08:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35J8GVE037281; Sat, 5 Apr 2014 19:08:16 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35J8Gpn037280; Sat, 5 Apr 2014 19:08:16 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404051908.s35J8Gpn037280@svn.freebsd.org> From: Eitan Adler Date: Sat, 5 Apr 2014 19:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264165 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 19:08:16 -0000 Author: eadler Date: Sat Apr 5 19:08:16 2014 New Revision: 264165 URL: http://svnweb.freebsd.org/changeset/base/264165 Log: run.4: D1 is an mdoc macro, so we have to escape it. Obtained from: DragonFlyBSD (357f4b5) Modified: head/share/man/man4/run.4 Modified: head/share/man/man4/run.4 ============================================================================== --- head/share/man/man4/run.4 Sat Apr 5 18:56:01 2014 (r264164) +++ head/share/man/man4/run.4 Sat Apr 5 19:08:16 2014 (r264165) @@ -143,7 +143,7 @@ driver supports the following wireless a .It Corega CG-WLUSB300AGN .It Corega CG-WLUSB300GNM .It D-Link DWA-130 rev B1 -.It D-Link DWA-140 rev B1, B2, B3, D1 +.It D-Link DWA-140 rev B1, B2, B3, \&D1 .It D-Link DWA-160 rev B2 .It D-Link DWA-162 .It DrayTek Vigor N61 From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 19:48:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C007A54; Sat, 5 Apr 2014 19:48:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 586C076F; Sat, 5 Apr 2014 19:48:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35JmKih053506; Sat, 5 Apr 2014 19:48:20 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35JmK7c053505; Sat, 5 Apr 2014 19:48:20 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404051948.s35JmK7c053505@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 5 Apr 2014 19:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264167 - head/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 19:48:20 -0000 Author: jilles Date: Sat Apr 5 19:48:19 2014 New Revision: 264167 URL: http://svnweb.freebsd.org/changeset/base/264167 Log: lib: Remove duplicate SUBDIR libnv. With SUBDIR_PARALLEL, duplicates in ${SUBDIR} cause harmless but verbose warnings. Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sat Apr 5 19:43:47 2014 (r264166) +++ head/lib/Makefile Sat Apr 5 19:48:19 2014 (r264167) @@ -99,7 +99,6 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libnandfs} \ libnetbsd \ ${_libngatm} \ - libnv \ libopie \ libpam \ libpcap \ From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 20:44:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FE05BFF; Sat, 5 Apr 2014 20:44:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D8C3C09; Sat, 5 Apr 2014 20:44:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35KirID078507; Sat, 5 Apr 2014 20:44:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35KirsT078506; Sat, 5 Apr 2014 20:44:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201404052044.s35KirsT078506@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 5 Apr 2014 20:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264173 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 20:44:53 -0000 Author: kib Date: Sat Apr 5 20:44:52 2014 New Revision: 264173 URL: http://svnweb.freebsd.org/changeset/base/264173 Log: Use realloc(9) instead of doing the reallocation inline. Submitted by: bde MFC after: 1 week Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Sat Apr 5 20:26:17 2014 (r264172) +++ head/sys/kern/kern_linker.c Sat Apr 5 20:44:52 2014 (r264173) @@ -725,14 +725,8 @@ linker_file_add_dependency(linker_file_t linker_file_t *newdeps; sx_assert(&kld_sx, SA_XLOCKED); - newdeps = malloc((file->ndeps + 1) * sizeof(*newdeps), M_LINKER, - M_WAITOK | M_ZERO); - - if (file->deps) { - bcopy(file->deps, newdeps, file->ndeps * sizeof(*newdeps)); - free(file->deps, M_LINKER); - } - file->deps = newdeps; + file->deps = realloc(file->deps, (file->ndeps + 1) * sizeof(*newdeps), + M_LINKER, M_WAITOK | M_ZERO); file->deps[file->ndeps] = dep; file->ndeps++; KLD_DPF(FILE, ("linker_file_add_dependency:" From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 22:13:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00EC3F6E; Sat, 5 Apr 2014 22:13:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C847A2A7; Sat, 5 Apr 2014 22:13:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35MDWEk015678; Sat, 5 Apr 2014 22:13:32 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35MDWoE015677; Sat, 5 Apr 2014 22:13:32 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201404052213.s35MDWoE015677@svn.freebsd.org> From: "George V. Neville-Neil" Date: Sat, 5 Apr 2014 22:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264174 - head/usr.sbin/arp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 22:13:33 -0000 Author: gnn Date: Sat Apr 5 22:13:32 2014 New Revision: 264174 URL: http://svnweb.freebsd.org/changeset/base/264174 Log: Speed up the lookup of interfaces when there are a large number of them, such in a system with a large number of VLANs. Submitted by: Nick Rogers MFC after: 2 weeks Modified: head/usr.sbin/arp/arp.c Modified: head/usr.sbin/arp/arp.c ============================================================================== --- head/usr.sbin/arp/arp.c Sat Apr 5 20:44:52 2014 (r264173) +++ head/usr.sbin/arp/arp.c Sat Apr 5 22:13:32 2014 (r264174) @@ -104,6 +104,8 @@ static char *rifname; static time_t expire_time; static int flags, doing_proxy; +struct if_nameindex *ifnameindex; + /* which function we're supposed to do */ #define F_GET 1 #define F_SET 2 @@ -200,6 +202,9 @@ main(int argc, char *argv[]) break; } + if (ifnameindex != NULL) + if_freenameindex(ifnameindex); + return (rtn); } @@ -558,8 +563,6 @@ search(u_long addr, action_fn *action) /* * Display an arp entry */ -static char lifname[IF_NAMESIZE]; -static int64_t lifindex = -1; static void print_entry(struct sockaddr_dl *sdl, @@ -568,8 +571,13 @@ print_entry(struct sockaddr_dl *sdl, const char *host; struct hostent *hp; struct iso88025_sockaddr_dl_data *trld; + struct if_nameindex *p; int seg; + if (ifnameindex == NULL) + if ((ifnameindex = if_nameindex()) == NULL) + err(1, "cannot retrieve interface names"); + if (nflag == 0) hp = gethostbyaddr((caddr_t)&(addr->sin_addr), sizeof addr->sin_addr, AF_INET); @@ -596,12 +604,15 @@ print_entry(struct sockaddr_dl *sdl, } } else printf("(incomplete)"); - if (sdl->sdl_index != lifindex && - if_indextoname(sdl->sdl_index, lifname) != NULL) { - lifindex = sdl->sdl_index; - printf(" on %s", lifname); - } else if (sdl->sdl_index == lifindex) - printf(" on %s", lifname); + + for (p = ifnameindex; p && ifnameindex->if_index && + ifnameindex->if_name; p++) { + if (p->if_index == sdl->sdl_index) { + printf(" on %s", p->if_name); + break; + } + } + if (rtm->rtm_rmx.rmx_expire == 0) printf(" permanent"); else { From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 22:25:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79194339; Sat, 5 Apr 2014 22:25:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BC3B3DC; Sat, 5 Apr 2014 22:25:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35MPBs2019926; Sat, 5 Apr 2014 22:25:11 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35MPAb7019924; Sat, 5 Apr 2014 22:25:10 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201404052225.s35MPAb7019924@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 5 Apr 2014 22:25:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264175 - in head: . sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 22:25:11 -0000 Author: marcel Date: Sat Apr 5 22:25:10 2014 New Revision: 264175 URL: http://svnweb.freebsd.org/changeset/base/264175 Log: Do not prevent processes from making changes to the baudrate or the CLOCAL and HUPCL control flags. There are legit reasons for allowing those to be changed. When /etc/ttys has the "3wire" type (without a baudrate) for the serial port that is the low-level console, then this change has no effect. Obtained from: Juniper Networks, Inc. Modified: head/UPDATING head/sys/dev/uart/uart_tty.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Apr 5 22:13:32 2014 (r264174) +++ head/UPDATING Sat Apr 5 22:25:10 2014 (r264175) @@ -31,6 +31,20 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20140405: + The uart(4) driver has been changed with respect to its handling + of the low-level console. Previously the uart(4) driver prevented + any process from changing the baudrate or the CLOCAL and HUPCL + control flags. By removing the restrictions, operators can make + changes to the serial console port without having to reboot. + However, when getty(8) is started on the serial device that is + associated with the low-level console, a misconfigured terminal + line in /etc/ttys will now have a real impact. + Before upgrading the kernel, make sure that /etc/ttys has the + serial console device configured as 3wire without baudrate to + preserve teh previous behaviour. E.g: + ttyu0 "/usr/libexec/getty 3wire" vt100 on secure + 20140325: It is no longer necessary to include the dwarf version in your DEBUG options in your kernel config file. The bug that required it to be Modified: head/sys/dev/uart/uart_tty.c ============================================================================== --- head/sys/dev/uart/uart_tty.c Sat Apr 5 22:13:32 2014 (r264174) +++ head/sys/dev/uart/uart_tty.c Sat Apr 5 22:25:10 2014 (r264175) @@ -244,12 +244,6 @@ uart_tty_param(struct tty *tp, struct te return (ENODEV); if (t->c_ispeed != t->c_ospeed && t->c_ospeed != 0) return (EINVAL); - /* Fixate certain parameters for system devices. */ - if (sc->sc_sysdev != NULL) { - t->c_ispeed = t->c_ospeed = sc->sc_sysdev->baudrate; - t->c_cflag |= CLOCAL; - t->c_cflag &= ~HUPCL; - } if (t->c_ospeed == 0) { UART_SETSIG(sc, SER_DDTR | SER_DRTS); return (0); From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 22:28:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24A415CE; Sat, 5 Apr 2014 22:28:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11C5D5EC; Sat, 5 Apr 2014 22:28:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35MSkiX020303; Sat, 5 Apr 2014 22:28:46 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35MSkwN020302; Sat, 5 Apr 2014 22:28:46 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201404052228.s35MSkwN020302@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 5 Apr 2014 22:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264176 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 22:28:47 -0000 Author: marcel Date: Sat Apr 5 22:28:46 2014 New Revision: 264176 URL: http://svnweb.freebsd.org/changeset/base/264176 Log: Fix typo (s/teh/the/) in previous commit. Pointed out by: rpaulo (thanks!) Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Apr 5 22:25:10 2014 (r264175) +++ head/UPDATING Sat Apr 5 22:28:46 2014 (r264176) @@ -42,7 +42,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 line in /etc/ttys will now have a real impact. Before upgrading the kernel, make sure that /etc/ttys has the serial console device configured as 3wire without baudrate to - preserve teh previous behaviour. E.g: + preserve the previous behaviour. E.g: ttyu0 "/usr/libexec/getty 3wire" vt100 on secure 20140325: From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 22:42:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D902857; Sat, 5 Apr 2014 22:42:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E35AF7B8; Sat, 5 Apr 2014 22:42:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35Mg1OW027725; Sat, 5 Apr 2014 22:42:01 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35Mg1ES027714; Sat, 5 Apr 2014 22:42:01 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404052242.s35Mg1ES027714@svn.freebsd.org> From: Warner Losh Date: Sat, 5 Apr 2014 22:42:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264177 - in head/sys/dev/hyperv: netvsc storvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 22:42:02 -0000 Author: imp Date: Sat Apr 5 22:42:00 2014 New Revision: 264177 URL: http://svnweb.freebsd.org/changeset/base/264177 Log: Make some unwise casts. On i386 these casts wind up being safe. Rather than disturb the API, go with these casts to shut gcc up. Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Sat Apr 5 22:28:46 2014 (r264176) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Sat Apr 5 22:42:00 2014 (r264177) @@ -182,7 +182,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct /* Send the gpadl notification request */ ret = hv_vmbus_channel_send_packet(device->channel, init_pkt, - sizeof(nvsp_msg), (uint64_t)init_pkt, + sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); if (ret != 0) { @@ -280,7 +280,7 @@ hv_nv_init_send_buffer_with_net_vsp(stru /* Send the gpadl notification request */ ret = hv_vmbus_channel_send_packet(device->channel, init_pkt, - sizeof(nvsp_msg), (uint64_t)init_pkt, + sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); if (ret != 0) { @@ -334,7 +334,7 @@ hv_nv_destroy_rx_buffer(netvsc_dev *net_ ret = hv_vmbus_channel_send_packet(net_dev->dev->channel, revoke_pkt, sizeof(nvsp_msg), - (uint64_t)revoke_pkt, + (uint64_t)(uintptr_t)revoke_pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, 0); /* @@ -402,7 +402,7 @@ hv_nv_destroy_send_buffer(netvsc_dev *ne ret = hv_vmbus_channel_send_packet(net_dev->dev->channel, revoke_pkt, sizeof(nvsp_msg), - (uint64_t)revoke_pkt, + (uint64_t)(uintptr_t)revoke_pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, 0); /* * If we failed here, we might as well return and have a leak @@ -464,7 +464,7 @@ hv_nv_negotiate_nvsp_protocol(struct hv_ /* Send the init request */ ret = hv_vmbus_channel_send_packet(device->channel, init_pkt, - sizeof(nvsp_msg), (uint64_t)init_pkt, + sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); if (ret != 0) @@ -508,7 +508,7 @@ hv_nv_send_ndis_config(struct hv_device /* Send the configuration packet */ ret = hv_vmbus_channel_send_packet(device->channel, init_pkt, - sizeof(nvsp_msg), (uint64_t)init_pkt, + sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, 0); if (ret != 0) return (-EINVAL); @@ -580,7 +580,7 @@ hv_nv_connect_to_vsp(struct hv_device *d /* Send the init request */ ret = hv_vmbus_channel_send_packet(device->channel, init_pkt, - sizeof(nvsp_msg), (uint64_t)init_pkt, + sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, 0); if (ret != 0) { goto cleanup; @@ -830,10 +830,10 @@ hv_nv_on_send(struct hv_device *device, if (pkt->page_buf_count) { ret = hv_vmbus_channel_send_packet_pagebuffer(device->channel, pkt->page_buffers, pkt->page_buf_count, - &send_msg, sizeof(nvsp_msg), (uint64_t)pkt); + &send_msg, sizeof(nvsp_msg), (uint64_t)(uintptr_t)pkt); } else { ret = hv_vmbus_channel_send_packet(device->channel, - &send_msg, sizeof(nvsp_msg), (uint64_t)pkt, + &send_msg, sizeof(nvsp_msg), (uint64_t)(uintptr_t)pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); } Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Sat Apr 5 22:28:46 2014 (r264176) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Sat Apr 5 22:42:00 2014 (r264177) @@ -344,7 +344,7 @@ netvsc_xmit_completion(void *context) struct mbuf *mb; uint8_t *buf; - mb = (struct mbuf *)packet->compl.send.send_completion_tid; + mb = (struct mbuf *)(uintptr_t)packet->compl.send.send_completion_tid; buf = ((uint8_t *)packet) - HV_NV_PACKET_OFFSET_IN_BUF; free(buf, M_DEVBUF); @@ -494,7 +494,7 @@ retry_send: /* Set the completion routine */ packet->compl.send.on_send_completion = netvsc_xmit_completion; packet->compl.send.send_completion_context = packet; - packet->compl.send.send_completion_tid = (uint64_t)m_head; + packet->compl.send.send_completion_tid = (uint64_t)(uintptr_t)m_head; /* Removed critical_enter(), does not appear necessary */ ret = hv_rf_on_send(device_ctx, packet); @@ -682,7 +682,7 @@ netvsc_recv(struct hv_device *device_ctx */ for (i=0; i < packet->page_buf_count; i++) { /* Shift virtual page number to form virtual page address */ - uint8_t *vaddr = (uint8_t *) + uint8_t *vaddr = (uint8_t *)(uintptr_t) (packet->page_buffers[i].pfn << PAGE_SHIFT); hv_m_append(m_new, packet->page_buffers[i].length, Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Sat Apr 5 22:28:46 2014 (r264176) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Sat Apr 5 22:42:00 2014 (r264177) @@ -26,6 +26,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -334,7 +337,7 @@ hv_rf_on_receive(struct hv_device *devic return (EINVAL); /* Shift virtual page number to form virtual page address */ - rndis_hdr = (rndis_msg *)(pkt->page_buffers[0].pfn << PAGE_SHIFT); + rndis_hdr = (rndis_msg *)(uintptr_t)(pkt->page_buffers[0].pfn << PAGE_SHIFT); rndis_hdr = (void *)((unsigned long)rndis_hdr + pkt->page_buffers[0].offset); Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Sat Apr 5 22:28:46 2014 (r264176) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Sat Apr 5 22:42:00 2014 (r264177) @@ -296,7 +296,7 @@ hv_storvsc_channel_init(struct hv_device dev->channel, vstor_packet, sizeof(struct vstor_packet), - (uint64_t)request, + (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -330,7 +330,7 @@ hv_storvsc_channel_init(struct hv_device dev->channel, vstor_packet, sizeof(struct vstor_packet), - (uint64_t)request, + (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -361,7 +361,7 @@ hv_storvsc_channel_init(struct hv_device dev->channel, vstor_packet, sizeof(struct vstor_packet), - (uint64_t)request, + (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -389,7 +389,7 @@ hv_storvsc_channel_init(struct hv_device dev->channel, vstor_packet, sizeof(struct vstor_packet), - (uint64_t)request, + (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -482,7 +482,7 @@ hv_storvsc_host_reset(struct hv_device * ret = hv_vmbus_channel_send_packet(dev->channel, vstor_packet, sizeof(struct vstor_packet), - (uint64_t)&sc->hs_reset_req, + (uint64_t)(uintptr_t)&sc->hs_reset_req, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -547,14 +547,14 @@ hv_storvsc_io_request(struct hv_device * &request->data_buf, vstor_packet, sizeof(struct vstor_packet), - (uint64_t)request); + (uint64_t)(uintptr_t)request); } else { ret = hv_vmbus_channel_send_packet( device->channel, vstor_packet, sizeof(struct vstor_packet), - (uint64_t)request, + (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); } @@ -634,7 +634,7 @@ hv_storvsc_on_channel_callback(void *con &request_id); while ((ret == 0) && (bytes_recvd > 0)) { - request = (struct hv_storvsc_request *)request_id; + request = (struct hv_storvsc_request *)(uintptr_t)request_id; KASSERT(request, ("request")); if ((request == &sc->hs_init_req) || From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 22:43:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06322997; Sat, 5 Apr 2014 22:43:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6E777C2; Sat, 5 Apr 2014 22:43:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35MhIdT027924; Sat, 5 Apr 2014 22:43:18 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35MhIxv027921; Sat, 5 Apr 2014 22:43:18 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404052243.s35MhIxv027921@svn.freebsd.org> From: Warner Losh Date: Sat, 5 Apr 2014 22:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264178 - in head/sys: i386/xen x86/xen xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 22:43:19 -0000 Author: imp Date: Sat Apr 5 22:43:18 2014 New Revision: 264178 URL: http://svnweb.freebsd.org/changeset/base/264178 Log: Make this compile with gcc. Submitted by: royger@ Modified: head/sys/i386/xen/xen_machdep.c head/sys/x86/xen/pv.c head/sys/xen/xen-os.h Modified: head/sys/i386/xen/xen_machdep.c ============================================================================== --- head/sys/i386/xen/xen_machdep.c Sat Apr 5 22:42:00 2014 (r264177) +++ head/sys/i386/xen/xen_machdep.c Sat Apr 5 22:43:18 2014 (r264178) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -710,9 +711,6 @@ char *bootmem_start, *bootmem_current, * pteinfo_t *pteinfo_list; void initvalues(start_info_t *startinfo); -struct xenstore_domain_interface; -extern struct xenstore_domain_interface *xen_store; - void * bootmem_alloc(unsigned int size) { Modified: head/sys/x86/xen/pv.c ============================================================================== --- head/sys/x86/xen/pv.c Sat Apr 5 22:42:00 2014 (r264177) +++ head/sys/x86/xen/pv.c Sat Apr 5 22:43:18 2014 (r264178) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include Modified: head/sys/xen/xen-os.h ============================================================================== --- head/sys/xen/xen-os.h Sat Apr 5 22:42:00 2014 (r264177) +++ head/sys/xen/xen-os.h Sat Apr 5 22:43:18 2014 (r264178) @@ -54,7 +54,6 @@ extern shared_info_t *HYPERVISOR_shared_ extern start_info_t *HYPERVISOR_start_info; /* XXX: we need to get rid of this and use HYPERVISOR_start_info directly */ -extern struct xenstore_domain_interface *xen_store; extern char *console_page; enum xen_domain_type { From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 22:43:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E1DBAD0; Sat, 5 Apr 2014 22:43:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DC0B7C5; Sat, 5 Apr 2014 22:43:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35MhOFm027985; Sat, 5 Apr 2014 22:43:24 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35MhNiL027981; Sat, 5 Apr 2014 22:43:23 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404052243.s35MhNiL027981@svn.freebsd.org> From: Warner Losh Date: Sat, 5 Apr 2014 22:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264179 - in head/sys/amd64/vmm: . intel io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 22:43:24 -0000 Author: imp Date: Sat Apr 5 22:43:23 2014 New Revision: 264179 URL: http://svnweb.freebsd.org/changeset/base/264179 Log: Make the vmm code compile with gcc too. Not entirely sure things are correct for the pirbase test (since I'd have thought we'd need to do something even when the offset is 0 and that test looks like a misguided attempt to not use an uninitialized variable), but it is at least the same as today. Modified: head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/io/vatpic.c head/sys/amd64/vmm/io/vatpit.c head/sys/amd64/vmm/vmm_dev.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sat Apr 5 22:43:18 2014 (r264178) +++ head/sys/amd64/vmm/intel/vmx.c Sat Apr 5 22:43:23 2014 (r264179) @@ -1048,6 +1048,7 @@ vmx_set_pcpu_defaults(struct vmx *vmx, i invvpid_desc._res1 = 0; invvpid_desc._res2 = 0; invvpid_desc.vpid = vmxstate->vpid; + invvpid_desc.linear_addr = 0; invvpid(INVVPID_TYPE_SINGLE_CONTEXT, invvpid_desc); } else { /* @@ -2742,7 +2743,7 @@ vmx_inject_pir(struct vlapic *vlapic) struct pir_desc *pir_desc; struct LAPIC *lapic; uint64_t val, pirval; - int rvi, pirbase; + int rvi, pirbase = -1; uint16_t intr_status_old, intr_status_new; vlapic_vtx = (struct vlapic_vtx *)vlapic; @@ -2787,6 +2788,11 @@ vmx_inject_pir(struct vlapic *vlapic) pirbase = 192; pirval = val; } + if (pirbase == -1) { + VCPU_CTR0(vlapic->vm, vlapic->vcpuid, "vmx_inject_pir: " + "no posted interrupt found"); + return; + } VLAPIC_CTR_IRR(vlapic, "vmx_inject_pir"); /* Modified: head/sys/amd64/vmm/io/vatpic.c ============================================================================== --- head/sys/amd64/vmm/io/vatpic.c Sat Apr 5 22:43:18 2014 (r264178) +++ head/sys/amd64/vmm/io/vatpic.c Sat Apr 5 22:43:23 2014 (r264179) @@ -473,7 +473,7 @@ vatpic_master_handler(void *vm, int vcpu { struct vatpic *vatpic; struct atpic *atpic; - int error; + int error = 0;; uint8_t val; vatpic = vm_atpic(vm); Modified: head/sys/amd64/vmm/io/vatpit.c ============================================================================== --- head/sys/amd64/vmm/io/vatpit.c Sat Apr 5 22:43:18 2014 (r264178) +++ head/sys/amd64/vmm/io/vatpit.c Sat Apr 5 22:43:23 2014 (r264179) @@ -234,28 +234,6 @@ vatpit_update_mode(struct vatpit *vatpit return (0); } -static int -vatpit_get_out(struct vatpit *vatpit, int channel) -{ - struct channel *c; - sbintime_t delta_ticks; - int out; - - c = &vatpit->channel[channel]; - - switch (c->mode) { - case TIMER_INTTC: - delta_ticks = (sbinuptime() - c->now_sbt) / vatpit->freq_sbt; - out = ((c->initial - delta_ticks) <= 0); - break; - default: - out = 0; - break; - } - - return (out); -} - int vatpit_handler(void *vm, int vcpuid, struct vm_exit *vmexit) { Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Sat Apr 5 22:43:18 2014 (r264178) +++ head/sys/amd64/vmm/vmm_dev.c Sat Apr 5 22:43:23 2014 (r264179) @@ -231,6 +231,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c break; default: + error = EINVAL; break; } From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 23:16:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E06CE108; Sat, 5 Apr 2014 23:16:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD6209E7; Sat, 5 Apr 2014 23:16:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35NGpD8043793; Sat, 5 Apr 2014 23:16:51 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35NGpi3043792; Sat, 5 Apr 2014 23:16:51 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201404052316.s35NGpi3043792@svn.freebsd.org> From: Rui Paulo Date: Sat, 5 Apr 2014 23:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264180 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 23:16:52 -0000 Author: rpaulo Date: Sat Apr 5 23:16:51 2014 New Revision: 264180 URL: http://svnweb.freebsd.org/changeset/base/264180 Log: Follow files.imx51 and add vt support. Modified: head/sys/arm/freescale/imx/files.imx53 Modified: head/sys/arm/freescale/imx/files.imx53 ============================================================================== --- head/sys/arm/freescale/imx/files.imx53 Sat Apr 5 22:43:23 2014 (r264179) +++ head/sys/arm/freescale/imx/files.imx53 Sat Apr 5 23:16:51 2014 (r264180) @@ -48,6 +48,8 @@ arm/freescale/imx/i2c.c optional fslii # IPU - Image Processing Unit (frame buffer also) arm/freescale/imx/imx51_ipuv3.c optional sc +arm/freescale/imx/imx51_ipuv3_fbd.c optional vt +dev/vt/hw/fb/vt_early_fb.c optional vt # Fast Ethernet Controller dev/ffec/if_ffec.c optional ffec From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 23:20:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B418A259; Sat, 5 Apr 2014 23:20:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A13509F3; Sat, 5 Apr 2014 23:20:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35NK4MC044823; Sat, 5 Apr 2014 23:20:04 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35NK4xr044822; Sat, 5 Apr 2014 23:20:04 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201404052320.s35NK4xr044822@svn.freebsd.org> From: Rui Paulo Date: Sat, 5 Apr 2014 23:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264181 - head/sys/dev/ata/chipsets X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 23:20:04 -0000 Author: rpaulo Date: Sat Apr 5 23:20:04 2014 New Revision: 264181 URL: http://svnweb.freebsd.org/changeset/base/264181 Log: Add fsl,imx53. Modified: head/sys/dev/ata/chipsets/ata-fsl.c Modified: head/sys/dev/ata/chipsets/ata-fsl.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-fsl.c Sat Apr 5 23:16:51 2014 (r264180) +++ head/sys/dev/ata/chipsets/ata-fsl.c Sat Apr 5 23:20:04 2014 (r264181) @@ -72,7 +72,8 @@ imx_ata_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "fsl,imx51-ata")) + if (!ofw_bus_is_compatible(dev, "fsl,imx51-ata") && + !ofw_bus_is_compatible(dev, "fsl,imx53-ata")) return (ENXIO); ctrl = device_get_softc(dev); From owner-svn-src-head@FreeBSD.ORG Sat Apr 5 23:20:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 147E34D5; Sat, 5 Apr 2014 23:20:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F34EFA02; Sat, 5 Apr 2014 23:20:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s35NKnRJ045149; Sat, 5 Apr 2014 23:20:49 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s35NKnUk045147; Sat, 5 Apr 2014 23:20:49 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201404052320.s35NKnUk045147@svn.freebsd.org> From: Rui Paulo Date: Sat, 5 Apr 2014 23:20:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264182 - head/sys/dev/vt/hw/fb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2014 23:20:50 -0000 Author: rpaulo Date: Sat Apr 5 23:20:49 2014 New Revision: 264182 URL: http://svnweb.freebsd.org/changeset/base/264182 Log: Need to include machine/fdt.h. Modified: head/sys/dev/vt/hw/fb/vt_early_fb.c Modified: head/sys/dev/vt/hw/fb/vt_early_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_early_fb.c Sat Apr 5 23:20:04 2014 (r264181) +++ head/sys/dev/vt/hw/fb/vt_early_fb.c Sat Apr 5 23:20:49 2014 (r264182) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #endif #include From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 00:17:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6668E96; Sun, 6 Apr 2014 00:17:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2DE1E0C; Sun, 6 Apr 2014 00:17:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s360Hfc9072008; Sun, 6 Apr 2014 00:17:41 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s360Hfej072007; Sun, 6 Apr 2014 00:17:41 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404060017.s360Hfej072007@svn.freebsd.org> From: Ian Lepore Date: Sun, 6 Apr 2014 00:17:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264183 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 00:17:41 -0000 Author: ian Date: Sun Apr 6 00:17:41 2014 New Revision: 264183 URL: http://svnweb.freebsd.org/changeset/base/264183 Log: Add a couple more required TLB flushes. These should have been part of r264129, they are part of the overall set of changes that got several weeks of testing. I must have fumbled them while merging various patchsets. Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sat Apr 5 23:20:49 2014 (r264182) +++ head/sys/arm/arm/pmap-v6.c Sun Apr 6 00:17:41 2014 (r264183) @@ -853,6 +853,8 @@ pmap_free_l2_bucket(pmap_t pmap, struct if (l1pd == (L1_C_DOM(pmap->pm_domain) | L1_TYPE_C)) { *pl1pd = 0; PTE_SYNC(pl1pd); + cpu_tlb_flushD_SE((vm_offset_t)ptep); + cpu_cpwait(); } /* @@ -2147,6 +2149,8 @@ pmap_grow_l2_bucket(pmap_t pmap, vm_offs L1_C_PROTO; PTE_SYNC(pl1pd); } + cpu_tlb_flushID_SE(va); + cpu_cpwait(); return (l2b); } @@ -2427,6 +2431,7 @@ pmap_kenter_internal(vm_offset_t va, vm_ if (opte == 0) l2b->l2b_occupancy++; } + cpu_cpwait(); PDEBUG(1, printf("pmap_kenter: pte = %08x, opte = %08x, npte = %08x\n", (uint32_t) ptep, opte, *ptep)); @@ -4956,10 +4961,10 @@ pmap_advise(pmap_t pmap, vm_offset_t sva cpu_tlb_flushID_SE(sva); else if (PTE_BEEN_REFD(opte)) cpu_tlb_flushD_SE(sva); - cpu_cpwait(); } } } + cpu_cpwait(); rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 02:20:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C24792F; Sun, 6 Apr 2014 02:20:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECB278B2; Sun, 6 Apr 2014 02:20:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s362KgaS020402; Sun, 6 Apr 2014 02:20:42 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s362KgYZ020401; Sun, 6 Apr 2014 02:20:42 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201404060220.s362KgYZ020401@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 6 Apr 2014 02:20:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264184 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 02:20:43 -0000 Author: marcel Date: Sun Apr 6 02:20:42 2014 New Revision: 264184 URL: http://svnweb.freebsd.org/changeset/base/264184 Log: Make sure we don't free memory that's already been freed by setting the geom->softc pounter to NULL before freeing the g_slicer softc. In g_slicer_free() the pointer is checked first. Obtained from: Juniper Networks, Inc. Modified: head/sys/geom/geom_slice.c Modified: head/sys/geom/geom_slice.c ============================================================================== --- head/sys/geom/geom_slice.c Sun Apr 6 00:17:41 2014 (r264183) +++ head/sys/geom/geom_slice.c Sun Apr 6 02:20:42 2014 (r264184) @@ -534,11 +534,14 @@ g_slice_new(struct g_class *mp, u_int sl void g_slice_orphan(struct g_consumer *cp) { + struct g_slicer *gsp; g_trace(G_T_TOPOLOGY, "g_slice_orphan(%p/%s)", cp, cp->provider->name); g_topology_assert(); /* XXX: Not good enough we leak the softc and its suballocations */ - g_slice_free(cp->geom->softc); + gsp = cp->geom->softc; + cp->geom->softc = NULL; + g_slice_free(gsp); g_wither_geom(cp->geom, ENXIO); } From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 02:44:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A1B8D0F; Sun, 6 Apr 2014 02:44:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2589BA0A; Sun, 6 Apr 2014 02:44:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s362idnZ031485; Sun, 6 Apr 2014 02:44:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s362icEb031481; Sun, 6 Apr 2014 02:44:38 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201404060244.s362icEb031481@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 6 Apr 2014 02:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264185 - in head/sys: conf geom/label modules/geom/geom_label X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 02:44:39 -0000 Author: marcel Date: Sun Apr 6 02:44:37 2014 New Revision: 264185 URL: http://svnweb.freebsd.org/changeset/base/264185 Log: An all-or-nothing approach to labels isn't flexible enough. Embedded systems need fine-grained control over what's in and what's out. That's ideal. For now, separate GPT labels from the rest and allow g_label to be built with just GPT labels. Obtained from: Juniper Networks, Inc. Modified: head/sys/conf/files head/sys/conf/options head/sys/geom/label/g_label.c head/sys/modules/geom/geom_label/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Apr 6 02:20:42 2014 (r264184) +++ head/sys/conf/files Sun Apr 6 02:44:37 2014 (r264185) @@ -2684,14 +2684,14 @@ geom/geom_vfs.c standard geom/geom_vol_ffs.c optional geom_vol geom/journal/g_journal.c optional geom_journal geom/journal/g_journal_ufs.c optional geom_journal -geom/label/g_label.c optional geom_label +geom/label/g_label.c optional geom_label | geom_label_gpt geom/label/g_label_ext2fs.c optional geom_label geom/label/g_label_iso9660.c optional geom_label geom/label/g_label_msdosfs.c optional geom_label geom/label/g_label_ntfs.c optional geom_label geom/label/g_label_reiserfs.c optional geom_label geom/label/g_label_ufs.c optional geom_label -geom/label/g_label_gpt.c optional geom_label +geom/label/g_label_gpt.c optional geom_label | geom_label_gpt geom/label/g_label_disk_ident.c optional geom_label geom/linux_lvm/g_linux_lvm.c optional geom_linux_lvm geom/mirror/g_mirror.c optional geom_mirror Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Apr 6 02:20:42 2014 (r264184) +++ head/sys/conf/options Sun Apr 6 02:44:37 2014 (r264185) @@ -102,6 +102,7 @@ GEOM_FOX opt_geom.h GEOM_GATE opt_geom.h GEOM_JOURNAL opt_geom.h GEOM_LABEL opt_geom.h +GEOM_LABEL_GPT opt_geom.h GEOM_LINUX_LVM opt_geom.h GEOM_MBR opt_geom.h GEOM_MIRROR opt_geom.h Modified: head/sys/geom/label/g_label.c ============================================================================== --- head/sys/geom/label/g_label.c Sun Apr 6 02:20:42 2014 (r264184) +++ head/sys/geom/label/g_label.c Sun Apr 6 02:44:37 2014 (r264185) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_geom.h" + #include #include #include @@ -80,6 +82,9 @@ struct g_class g_label_class = { * 6. Add your file system to manual page sbin/geom/class/label/glabel.8. */ const struct g_label_desc *g_labels[] = { + &g_label_gpt, + &g_label_gpt_uuid, +#ifdef GEOM_LABEL &g_label_ufs_id, &g_label_ufs_volume, &g_label_iso9660, @@ -87,9 +92,8 @@ const struct g_label_desc *g_labels[] = &g_label_ext2fs, &g_label_reiserfs, &g_label_ntfs, - &g_label_gpt, - &g_label_gpt_uuid, &g_label_disk_ident, +#endif NULL }; Modified: head/sys/modules/geom/geom_label/Makefile ============================================================================== --- head/sys/modules/geom/geom_label/Makefile Sun Apr 6 02:20:42 2014 (r264184) +++ head/sys/modules/geom/geom_label/Makefile Sun Apr 6 02:44:37 2014 (r264185) @@ -12,5 +12,9 @@ SRCS+= g_label_msdosfs.c SRCS+= g_label_ntfs.c SRCS+= g_label_reiserfs.c SRCS+= g_label_ufs.c +SRCS+= opt_geom.h + +opt_geom.h: + echo "#define GEOM_LABEL 1" > ${.TARGET} .include From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 02:57:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC0ACEEC; Sun, 6 Apr 2014 02:57:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98E88ABE; Sun, 6 Apr 2014 02:57:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s362vn6f035847; Sun, 6 Apr 2014 02:57:49 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s362vnpB035846; Sun, 6 Apr 2014 02:57:49 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201404060257.s362vnpB035846@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 6 Apr 2014 02:57:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264186 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 02:57:49 -0000 Author: marcel Date: Sun Apr 6 02:57:49 2014 New Revision: 264186 URL: http://svnweb.freebsd.org/changeset/base/264186 Log: Timestamps may not have a decimal point. While here, consistently use sbuf_new_auto(). Modified: head/usr.sbin/makefs/mtree.c Modified: head/usr.sbin/makefs/mtree.c ============================================================================== --- head/usr.sbin/makefs/mtree.c Sun Apr 6 02:44:37 2014 (r264185) +++ head/usr.sbin/makefs/mtree.c Sun Apr 6 02:57:49 2014 (r264186) @@ -157,7 +157,7 @@ mtree_file_path(fsnode *node) rp[++depth] = pnode->name; } - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); if (sb == NULL) { errno = ENOMEM; return (NULL); @@ -667,6 +667,8 @@ read_mtree_keywords(FILE *fp, fsnode *no st->st_atime = num; st->st_ctime = num; st->st_mtime = num; + if (p == NULL) + break; error = read_number(p, 10, &num, 0, INTMAX_MAX); if (error) From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 06:18:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F57D448; Sun, 6 Apr 2014 06:18:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CAE0B73; Sun, 6 Apr 2014 06:18:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s366Ii8B023111; Sun, 6 Apr 2014 06:18:44 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s366IiRE023110; Sun, 6 Apr 2014 06:18:44 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201404060618.s366IiRE023110@svn.freebsd.org> From: Justin Hibbits Date: Sun, 6 Apr 2014 06:18:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264189 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 06:18:44 -0000 Author: jhibbits Date: Sun Apr 6 06:18:43 2014 New Revision: 264189 URL: http://svnweb.freebsd.org/changeset/base/264189 Log: Correct the SRR1 mask, it's 10-15 not 10-11. X-MFC-with: r263464,r263752 Modified: head/sys/powerpc/include/psl.h Modified: head/sys/powerpc/include/psl.h ============================================================================== --- head/sys/powerpc/include/psl.h Sun Apr 6 05:45:43 2014 (r264188) +++ head/sys/powerpc/include/psl.h Sun Apr 6 06:18:43 2014 (r264189) @@ -96,7 +96,7 @@ #else #define PSL_KERNSET (PSL_EE | PSL_ME | PSL_IR | PSL_DR | PSL_RI) #endif -#define PSL_SRR1_MASK 0x78300000UL /* Bits 1-4, 10-15 (ppc32), 33-36, 42-47 (ppc64) */ +#define PSL_SRR1_MASK 0x783f0000UL /* Bits 1-4, 10-15 (ppc32), 33-36, 42-47 (ppc64) */ #endif #define PSL_USERSET (PSL_KERNSET | PSL_PR) From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 08:57:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69A923FD; Sun, 6 Apr 2014 08:57:55 +0000 (UTC) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 1181F887; Sun, 6 Apr 2014 08:57:54 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id A29C21A28C7; Sun, 6 Apr 2014 18:57:47 +1000 (EST) Date: Sun, 6 Apr 2014 18:57:46 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh Subject: Re: svn commit: r264177 - in head/sys/dev/hyperv: netvsc storvsc In-Reply-To: <201404052242.s35Mg1ES027714@svn.freebsd.org> Message-ID: <20140406183716.N5281@besplex.bde.org> References: <201404052242.s35Mg1ES027714@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eojmkOZX c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=hhxHlBTYTMkA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=fr98tUtQFgwMT2tNaHwA:9 a=XS83lCpg9cdRuOTd:21 a=6n9Cz6lIPdhr3v_N:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 08:57:55 -0000 On Sat, 5 Apr 2014, Warner Losh wrote: > Log: > Make some unwise casts. On i386 these casts wind up being safe. Rather > than disturb the API, go with these casts to shut gcc up. These casts seem to be correct, while the old ones were just wrong. Now the old ones are still there, but seem to be just style bugs -- they have no effect except to bloat the code and give some collateral style bugs (long lines). > Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c > ============================================================================== > --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Sat Apr 5 22:28:46 2014 (r264176) > +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Sat Apr 5 22:42:00 2014 (r264177) > @@ -182,7 +182,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct > /* Send the gpadl notification request */ > > ret = hv_vmbus_channel_send_packet(device->channel, init_pkt, > - sizeof(nvsp_msg), (uint64_t)init_pkt, > + sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt, > HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, > HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); > if (ret != 0) { The cast was presumably to pass a pointer to a function expectly a uint64_t. Casting to uint64_t was wrong for this. Pointer to integer casts should only use uintptr_t or intptr_t. After changing to the correct cast, the cast to uint64_t has no effect. Conversion from one integer type to another is done automatically by the prototype. It even works correctly on amd64 and i386, since uintptr_t is no larger than uint64_t. Conversion from pointer to integer is not done automatically by prototypes, even if it would work correctly. I forget it the C standard requires this of if it is just a warning. Probably the former. > @@ -280,7 +280,7 @@ hv_nv_init_send_buffer_with_net_vsp(stru > /* Send the gpadl notification request */ > > ret = hv_vmbus_channel_send_packet(device->channel, init_pkt, > - sizeof(nvsp_msg), (uint64_t)init_pkt, > + sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt, > HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, > HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); > if (ret != 0) { All the changes keep the bogus cast. > ... > Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c > ============================================================================== > --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Sat Apr 5 22:28:46 2014 (r264176) > +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Sat Apr 5 22:42:00 2014 (r264177) > ... > @@ -494,7 +494,7 @@ retry_send: > /* Set the completion routine */ > packet->compl.send.on_send_completion = netvsc_xmit_completion; > packet->compl.send.send_completion_context = packet; > - packet->compl.send.send_completion_tid = (uint64_t)m_head; > + packet->compl.send.send_completion_tid = (uint64_t)(uintptr_t)m_head; > > /* Removed critical_enter(), does not appear necessary */ > ret = hv_rf_on_send(device_ctx, packet); Here the changes also break the formatting. > @@ -682,7 +682,7 @@ netvsc_recv(struct hv_device *device_ctx > */ > for (i=0; i < packet->page_buf_count; i++) { > /* Shift virtual page number to form virtual page address */ > - uint8_t *vaddr = (uint8_t *) > + uint8_t *vaddr = (uint8_t *)(uintptr_t) > (packet->page_buffers[i].pfn << PAGE_SHIFT); > > hv_m_append(m_new, packet->page_buffers[i].length, > This one is a little different, and still broken. Oops, probably all the casts are still broken. This one is just more obviously broken. uintptr_t is only specified to work on pointers of type void *, but here the pointer has type uint8_t *. From C99 (n869.txt draft): % 7.18.1.4 Integer types capable of holding object pointers % % [#1] The following type designates a signed integer type % with the property that any valid pointer to void can be % converted to this type, then converted back to pointer to % void, and the result will compare equal to the original % pointer: % % intptr_t % % The following type designates an unsigned integer type with % the property that any valid pointer to void can be converted % to this type, then converted back to pointer to void, and % the result will compare equal to the original pointer: % % uintptr_t So almost all correct uses of uintptr_t need a pre- or post-cast of the pointer to void * (or vice versa), and the code is verbose for another reason. In practice, uintptr_t and intptr_t work for casts of all pointer types, and compilers only warn if there is a size mismatch. The C standard requires just about all casts between pointers and integers to give a result and doesn't require any warnings, but it only requires conversions between void * and [u]intptr_t to be reversible. When abusing APIs to pass pointers as integers, reversibility is exactly what is required. > Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c > ============================================================================== > --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Sat Apr 5 22:28:46 2014 (r264176) > +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Sat Apr 5 22:42:00 2014 (r264177) > @@ -26,6 +26,9 @@ > * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > > +#include > +__FBSDID("$FreeBSD$"); > + > #include > #include > #include > @@ -334,7 +337,7 @@ hv_rf_on_receive(struct hv_device *devic > return (EINVAL); > > /* Shift virtual page number to form virtual page address */ > - rndis_hdr = (rndis_msg *)(pkt->page_buffers[0].pfn << PAGE_SHIFT); > + rndis_hdr = (rndis_msg *)(uintptr_t)(pkt->page_buffers[0].pfn << PAGE_SHIFT); > > rndis_hdr = (void *)((unsigned long)rndis_hdr > + pkt->page_buffers[0].offset); > Long line. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 09:07:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DAC16D7; Sun, 6 Apr 2014 09:07:39 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id F153B932; Sun, 6 Apr 2014 09:07:38 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 32D6DD62029; Sun, 6 Apr 2014 19:07:31 +1000 (EST) Date: Sun, 6 Apr 2014 19:07:30 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh Subject: Re: svn commit: r264177 - in head/sys/dev/hyperv: netvsc storvsc In-Reply-To: <201404052242.s35Mg1ES027714@svn.freebsd.org> Message-ID: <20140406190024.V5281@besplex.bde.org> References: <201404052242.s35Mg1ES027714@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=U6SrU4bu c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=hhxHlBTYTMkA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=cMwDT-I2r2K7gtRvf_sA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 09:07:39 -0000 On Sat, 5 Apr 2014, Warner Losh wrote: > Log: > Make some unwise casts. On i386 these casts wind up being safe. Rather > than disturb the API, go with these casts to shut gcc up. Another reply. The bug is mostly in clang. It doesn't complain about casting pointers to integers that are neither uintptr_t or intptr_t, even when the cast is to a smaller size, so it doesn't detect the wrong casts being used here. So the bugs build up until they are detected by compiling with gcc (or coverity?). Here the casts are to a larger size. The style bug is still very large, since the casts are used to suppress the warning for conversion from pointer to integer without an explicit cast. Casts to break warnings should be correct. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 09:14:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9876F936; Sun, 6 Apr 2014 09:14:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 851CD9D2; Sun, 6 Apr 2014 09:14:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s369EB0m095280; Sun, 6 Apr 2014 09:14:11 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s369EBRN095279; Sun, 6 Apr 2014 09:14:11 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201404060914.s369EBRN095279@svn.freebsd.org> From: Andrew Turner Date: Sun, 6 Apr 2014 09:14:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264190 - head/contrib/compiler-rt/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 09:14:11 -0000 Author: andrew Date: Sun Apr 6 09:14:11 2014 New Revision: 264190 URL: http://svnweb.freebsd.org/changeset/base/264190 Log: Mark __fixdfdi/__aeabi_d2lz with COMPILER_RT_ABI so it uses the correct calling convention for __aeabi_* functions. Modified: head/contrib/compiler-rt/lib/fixdfdi.c Modified: head/contrib/compiler-rt/lib/fixdfdi.c ============================================================================== --- head/contrib/compiler-rt/lib/fixdfdi.c Sun Apr 6 06:18:43 2014 (r264189) +++ head/contrib/compiler-rt/lib/fixdfdi.c Sun Apr 6 09:14:11 2014 (r264190) @@ -25,7 +25,7 @@ ARM_EABI_FNALIAS(d2lz, fixdfdi) -di_int +COMPILER_RT_ABI di_int __fixdfdi(double a) { double_bits fb; From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 09:34:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6AB74DBD; Sun, 6 Apr 2014 09:34:24 +0000 (UTC) Received: from mail-qc0-x235.google.com (mail-qc0-x235.google.com [IPv6:2607:f8b0:400d:c01::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3377B1F; Sun, 6 Apr 2014 09:34:23 +0000 (UTC) Received: by mail-qc0-f181.google.com with SMTP id x3so5144920qcv.26 for ; Sun, 06 Apr 2014 02:34:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=eB7naAKRNm/cGvsKsBtM+d0aFN8QPQrW7TjXbTY8beY=; b=k2lQGMSxBo+pi4Sh4ZKWLp2DQuM69JkrnUtB6SSe3jkP/e4Selj1L7fdcuvSgwTNk8 voHzBlElBYKH2epVHT35M8G8ZBAo4F0hgrnA2of++QO90S7tlOm9NmOywmg017h08Ejl h7Bb18x/FjYY7uE+uI4aeUvOuJQUVQYdhW7jcYmJdPXij1AXgJKY+mNwyABHmbAhAyYt uScoBFE/plIGJXVQiYEt1km75cASDvBSh3xIPFLllYoN53t5MdkpJfUcvGQVlo/URkuB yJzt/la8oVxTRetUgjHYFqQumEa8IPeSq5yJJxNF2Wl9EM/vwHUe/1W8Lw3HcUX+Ioxb +NhQ== MIME-Version: 1.0 X-Received: by 10.224.29.141 with SMTP id q13mr26498963qac.8.1396776861671; Sun, 06 Apr 2014 02:34:21 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.50.206 with HTTP; Sun, 6 Apr 2014 02:34:21 -0700 (PDT) In-Reply-To: <6418BE83-BE78-473B-9311-C849507FA885@ixsystems.com> References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140404115256.GA85137@ivaldir.etoilebsd.net> <8D6AF193-A5A3-4A28-A230-97A543395ACA@ixsystems.com> <2E0EC8CB-B3EE-4DB8-A33D-58FD2107F14D@FreeBSD.org> <6A02504F-5543-4F91-92F6-7B4FB9A34DC4@ixsystems.com> <152D73EE-DF9E-4757-B547-F1F22B12C824@FreeBSD.org> <8E3BD3C1-A441-48C5-97BC-45EF67513096@FreeBSD.org> <6418BE83-BE78-473B-9311-C849507FA885@ixsystems.com> Date: Sun, 6 Apr 2014 02:34:21 -0700 X-Google-Sender-Auth: eQfORJSTR3WU_31BaazQ7IhsvYo Message-ID: Subject: Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib From: Adrian Chadd To: Jordan Hubbard Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , Baptiste Daroussin , "src-committers@freebsd.org" , David Chisnall , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 09:34:24 -0000 Although non-LLVM may just die, I'd like people to please consider what it takes to bring a new CPU architecture/platform up and how, well, that support typically doesn't make it into the public LLVM source straight away. So if we want to be taken seriously by those funny companies that make CPUs, then: * we still need external toolchain support; * .. and that may be LLVM, but it may not be the LLVM that you currently have in HEAD, with the current set of expected features in our LLVM. -a On 4 April 2014 07:17, Jordan Hubbard wrote: > > On Apr 4, 2014, at 7:03 PM, David Chisnall wrote: > >> That said, I think we're increasingly going to be using LLVM for things = that are beyond just simple AOT compilation, so platforms with no LLVM back= end are likely to be left behind. > > Amen, and a topic worth an entire discussion in its own right, but I'll s= pare us that and leave the topic with just one quick anecdote: When we por= ted MacRuby to LLVM, thus creating in effect a ruby JIT compiler, we were p= retty amazed at how quickly the work progressed and how good the performanc= e of the resulting code was. MacRuby later died for other reasons, but its= JIT/AOT compilation abilities were amazing enough that we were left wonder= ed why the Python and Perl folks weren't stampeding over themselves to foll= ow suit. > > I think the answer there was that they'd already rolled their own bytecod= e systems, as ultimately did Ruby, and had too much invested in those techn= ologies, but I'm still holding out hope that the "everyone but C/C++" world= of languages will eventually converge on LLVM, as seems to be slowly happe= ning with projects like Rubinius and Numba. Not relevant to FreeBSD right = now, but who knows the future? > > - Jordan > > > > From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 10:13:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE248725; Sun, 6 Apr 2014 10:13:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A867DE01; Sun, 6 Apr 2014 10:13:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s36ADFgb020635; Sun, 6 Apr 2014 10:13:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s36ADFE8020632; Sun, 6 Apr 2014 10:13:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404061013.s36ADFE8020632@svn.freebsd.org> From: Alexander Motin Date: Sun, 6 Apr 2014 10:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264191 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 10:13:15 -0000 Author: mav Date: Sun Apr 6 10:13:14 2014 New Revision: 264191 URL: http://svnweb.freebsd.org/changeset/base/264191 Log: Report stripe size and offset of the backing device in READ CAPACITY (16) as physical sector size and offset. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend.h head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sun Apr 6 09:14:11 2014 (r264190) +++ head/sys/cam/ctl/ctl.c Sun Apr 6 10:13:14 2014 (r264191) @@ -6907,6 +6907,8 @@ ctl_read_capacity_16(struct ctl_scsiio * scsi_u64to8b(lun->be_lun->maxlba, data->addr); /* XXX KDM this may not be 512 bytes... */ scsi_ulto4b(lun->be_lun->blocksize, data->length); + data->prot_lbppbe = lun->be_lun->pblockexp & SRC16_LBPPBE; + scsi_ulto2b(lun->be_lun->pblockoff & SRC16_LALBA_A, data->lalba_lbp); ctsio->scsi_status = SCSI_STATUS_OK; Modified: head/sys/cam/ctl/ctl_backend.h ============================================================================== --- head/sys/cam/ctl/ctl_backend.h Sun Apr 6 09:14:11 2014 (r264190) +++ head/sys/cam/ctl/ctl_backend.h Sun Apr 6 10:13:14 2014 (r264191) @@ -137,6 +137,10 @@ typedef void (*be_lun_config_t)(void *be * this should be 512. In theory CTL should be able to handle other block * sizes. Host application software may not deal with it very well, though. * + * pblockexp is the log2() of number of LBAs on the LUN per physical sector. + * + * pblockoff is the lowest LBA on the LUN aligned ot physical sector. + * * req_lun_id is the requested LUN ID. CTL only pays attention to this * field if the CTL_LUN_FLAG_ID_REQ flag is set. If the requested LUN ID is * not available, the LUN addition will fail. If a particular LUN ID isn't @@ -185,6 +189,8 @@ struct ctl_be_lun { void *be_lun; /* passed to CTL */ uint64_t maxlba; /* passed to CTL */ uint32_t blocksize; /* passed to CTL */ + uint16_t pblockexp; /* passed to CTL */ + uint16_t pblockoff; /* passed to CTL */ uint32_t req_lun_id; /* passed to CTL */ uint32_t lun_id; /* returned from CTL */ uint8_t serial_num[CTL_SN_LEN]; /* passed to CTL */ Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Sun Apr 6 09:14:11 2014 (r264190) +++ head/sys/cam/ctl/ctl_backend_block.c Sun Apr 6 10:13:14 2014 (r264191) @@ -156,6 +156,8 @@ struct ctl_be_block_lun { uint64_t size_bytes; uint32_t blocksize; int blocksize_shift; + uint16_t pblockexp; + uint16_t pblockoff; struct ctl_be_block_softc *softc; struct devstat *disk_stats; ctl_be_block_lun_flags flags; @@ -1262,6 +1264,7 @@ ctl_be_block_open_dev(struct ctl_be_bloc struct cdev *dev; struct cdevsw *devsw; int error; + off_t ps, pss, po, pos; params = &req->reqdata.create; @@ -1359,6 +1362,24 @@ ctl_be_block_open_dev(struct ctl_be_bloc be_lun->size_bytes = params->lun_size_bytes; } + error = devsw->d_ioctl(dev, DIOCGSTRIPESIZE, + (caddr_t)&ps, FREAD, curthread); + if (error) + ps = po = 0; + else { + error = devsw->d_ioctl(dev, DIOCGSTRIPEOFFSET, + (caddr_t)&po, FREAD, curthread); + if (error) + po = 0; + } + pss = ps / be_lun->blocksize; + pos = po / be_lun->blocksize; + if ((pss > 0) && (pss * be_lun->blocksize == ps) && (pss >= pos) && + ((pss & (pss - 1)) == 0) && (pos * be_lun->blocksize == po)) { + be_lun->pblockexp = fls(pss) - 1; + be_lun->pblockoff = (pss - pos) % pss; + } + return (0); } @@ -1583,6 +1604,8 @@ ctl_be_block_create(struct ctl_be_block_ * For processor devices, we don't have any size. */ be_lun->blocksize = 0; + be_lun->pblockexp = 0; + be_lun->pblockoff = 0; be_lun->size_blocks = 0; be_lun->size_bytes = 0; be_lun->ctl_be_lun.maxlba = 0; @@ -1643,6 +1666,8 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->ctl_be_lun.flags = CTL_LUN_FLAG_PRIMARY; be_lun->ctl_be_lun.be_lun = be_lun; be_lun->ctl_be_lun.blocksize = be_lun->blocksize; + be_lun->ctl_be_lun.pblockexp = be_lun->pblockexp; + be_lun->ctl_be_lun.pblockoff = be_lun->pblockoff; /* Tell the user the blocksize we ended up using */ params->blocksize_bytes = be_lun->blocksize; if (params->flags & CTL_LUN_FLAG_ID_REQ) { From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 10:16:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 556A989E; Sun, 6 Apr 2014 10:16:42 +0000 (UTC) Received: from mail.iXsystems.com (newknight.ixsystems.com [206.40.55.70]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27DE4E1B; Sun, 6 Apr 2014 10:16:41 +0000 (UTC) Received: from localhost (mail.ixsystems.com [10.2.55.1]) by mail.iXsystems.com (Postfix) with ESMTP id 20CEB6F1AF; Sun, 6 Apr 2014 03:16:41 -0700 (PDT) Received: from mail.iXsystems.com ([10.2.55.1]) by localhost (mail.ixsystems.com [10.2.55.1]) (maiad, port 10024) with ESMTP id 84012-03; Sun, 6 Apr 2014 03:16:40 -0700 (PDT) Received: from [10.8.0.22] (unknown [10.8.0.22]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.iXsystems.com (Postfix) with ESMTPSA id 619D86F1A8; Sun, 6 Apr 2014 03:16:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ixsystems.com; s=newknight0; t=1396779400; bh=7EIQpR/1DgsxiDuFcPMO/I5gLPwEG62QogQyIlQyiMU=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=hUGYhWbpapamQOe6jSOf2TZ8Zbw18LdCErNu3IwOqSk5MHoM2CciiBa3EiX3gauhe Jl+HBvkAuuaZKa/kSDN966tY2RqjpOtRINPe4m8PXUTPoFglW4X/9epndoT6lsSU/s vdYIlOlm38vegup17Kd2r7tXvwdNcvL8EB11/PgM= Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Compiler toolchain roadmap From: Jordan Hubbard In-Reply-To: Date: Sun, 6 Apr 2014 15:16:23 +0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201404021607.s32G7mhw051355@svn.freebsd.org> <20140404115256.GA85137@ivaldir.etoilebsd.net> <8D6AF193-A5A3-4A28-A230-97A543395ACA@ixsystems.com> <2E0EC8CB-B3EE-4DB8-A33D-58FD2107F14D@FreeBSD.org> <6A02504F-5543-4F91-92F6-7B4FB9A34DC4@ixsystems.com> <152D73EE-DF9E-4757-B547-F1F22B12C824@FreeBSD.org> <8E3BD3C1-A441-48C5-97BC-45EF67513096@FreeBSD.org> <6418BE83-BE78-473B-9311-C849507FA885@ixsystems.com> To: Adrian Chadd X-Mailer: Apple Mail (2.1874) Cc: "svn-src-head@freebsd.org" , Baptiste Daroussin , "src-committers@freebsd.org" , David Chisnall , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 10:16:42 -0000 On Apr 6, 2014, at 2:34 PM, Adrian Chadd wrote: > So if we want to be taken seriously by those funny companies that make = CPUs, then: Not really religious about that at all, I just wonder the following: 1. How long will it be considered worthwhile to not be able to have = various advanced features in base (like blocks, or someday perhaps, more = advanced C++ features / GC / yada yada yada) because the lowest common = denominator compiler technology, probably not even under control of the = project itself (those =93weird-ass compiler ports=94 David mentioned), = simply doesn=92t support those things? Moreover, there=92s not much incentive for the companies in question to = modernize their toolchains if FreeBSD is happy to remain somewhere in = the 1990s in terms of what compiler features it leverages, and it=92s = not particularly clear to me how the presence / participation (?) of = those companies is being valued in the overall scheme of things. If one = lone MIPS R3000 vendor was holding back because it was using the = Mongoose-V radiation-hardened part (yeah, that=92s a real thing) and = FreeBSD for some solution, would that be worth holding the entire = project back? No? How about two such vendors? Three? Where do you = draw the line? I don=92t even pretend to have the answer to that = question, I just think it=92s a question worth asking. Also, JFYI, I don=92t really have any strong personal agenda where this = is concerned - I can just keep taking FreeBSD and hacking it up every = which way such that =93what=92s in base=94 becomes increasingly = irrelevant to me, but the more I diverge, the less easy it becomes to = upstream stuff back. I already had that experience once at Apple, and = it ultimately didn=92t hold me back at all so the =93omg the cost of = forking=94 argument is no longer one that holds much fear for me, but = it=92s a shame that all the I18N / UNIX03 / numerics optimization / =85 = work that occurred in the open over the first 3-5 years I was there was = never able to benefit FreeBSD because of said divergence, either. 2. What=92s the long-term prognosis on a multi-architecture ecosystem? = I certainly remember the =93good old days=94 when any company that knew = how to solder two transistors together had their own CPU architecture, = but those folks have been dying off for decades now. Now we have Intel = as the long-dominant 900 pound gorilla, which is why FreeBSD originally = chose to focus almost exclusively on that architecture (and I think that = was a smart decision), and the smaller but still feisty ARM = architecture. That=92s about it. Yes, I know about the others, but = just because a port *can* be done doesn=92t necessarily mean it *should* = be, and I=92ll cite the Alpha and Itanium ports as existence proofs of = that. Heck, I was a huge proponent of the Alpha port - I wanted a 64 = bit version of FreeBSD back then so badly I could taste it, and I = personally thought the Alpha was pretty damn cool - I even had one of my = own. Didn=92t make it such a good idea in hindsight, however. Again, if there=92s a common theme in my two bullets there, it=92s =93show= me the numbers!=94 Sure, I know of vendors who use MIPS and, for that = matter, PowerPC and a few other far more obscure architectures as well. = I=92m familiar with Juniper and Cisco=92s interest. I even read = Warner=92s slides from BSDCan 2008, where a fairly long and slightly = sordid tale is told of MIPS support trying repeatedly to get into the = tree, being repeatedly rebuffed until it finally somehow took root = through a semi-cabalistic effort with dark rituals involving dead = chickens and Perforce. Now it=92s 2014 and apparently we can=92t have = nice things in the tree because of MIPS? Maybe I=92m over-simplifying = the argument, but even simplistically I would easily understand it if = you substituted =93ARM=94 or =93Intel=94 because I can count those = numbers easily and know without even trying that there are at least 7 = zeros involved in the total. Every PC ever shipped. Every Samsung = phone. Big and impressive numbers that can=92t be argued with. I=92m = just not getting the same impression from the other architectures under = discussion here. - Jordan From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 16:31:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF906EB8; Sun, 6 Apr 2014 16:31:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCAAAE22; Sun, 6 Apr 2014 16:31:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s36GVSnV075376; Sun, 6 Apr 2014 16:31:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s36GVSpa075375; Sun, 6 Apr 2014 16:31:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404061631.s36GVSpa075375@svn.freebsd.org> From: Alexander Motin Date: Sun, 6 Apr 2014 16:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264193 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 16:31:28 -0000 Author: mav Date: Sun Apr 6 16:31:28 2014 New Revision: 264193 URL: http://svnweb.freebsd.org/changeset/base/264193 Log: In addition to r264077, tell GEOM that we do support BIO_DELETE now. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sun Apr 6 10:56:27 2014 (r264192) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sun Apr 6 16:31:28 2014 (r264193) @@ -2440,6 +2440,9 @@ zvol_geom_start(struct bio *bp) zvol_strategy(bp); break; case BIO_GETATTR: + if (g_handleattr_int(bp, "GEOM::candelete", 1)) + return; + /* FALLTHROUGH */ default: g_io_deliver(bp, EOPNOTSUPP); break; From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 16:35:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9B1393; Sun, 6 Apr 2014 16:35:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A718BE3B; Sun, 6 Apr 2014 16:35:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s36GZnQK076592; Sun, 6 Apr 2014 16:35:49 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s36GZnGo076591; Sun, 6 Apr 2014 16:35:49 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201404061635.s36GZnGo076591@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 6 Apr 2014 16:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264194 - head/usr.sbin/daemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 16:35:49 -0000 Author: jh Date: Sun Apr 6 16:35:49 2014 New Revision: 264194 URL: http://svnweb.freebsd.org/changeset/base/264194 Log: Fork a child process and wait until the process terminates when the -P option is specified. This behavior is documented on the manual page. PR: bin/187265 Submitted by: Kimo R MFC after: 2 weeks Modified: head/usr.sbin/daemon/daemon.c Modified: head/usr.sbin/daemon/daemon.c ============================================================================== --- head/usr.sbin/daemon/daemon.c Sun Apr 6 16:31:28 2014 (r264193) +++ head/usr.sbin/daemon/daemon.c Sun Apr 6 16:35:49 2014 (r264194) @@ -139,7 +139,7 @@ main(int argc, char *argv[]) * get SIGCHLD eventually. */ pid = -1; - if (pidfile != NULL || restart) { + if (pidfile != NULL || ppidfile != NULL || restart) { /* * Restore default action for SIGTERM in case the * parent process decided to ignore it. From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 16:38:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD0923A3; Sun, 6 Apr 2014 16:38:48 +0000 (UTC) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id 8E053E85; Sun, 6 Apr 2014 16:38:48 +0000 (UTC) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by alto.onthenet.com.au (Postfix) with ESMTPS id 4233312308; Mon, 7 Apr 2014 02:38:41 +1000 (EST) Received: from Peter-Grehans-MacBook-Pro-2.local (c-174-51-225-141.hsd1.co.comcast.net [174.51.225.141]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BTD90449 (AUTH peterg@ptree32.com.au); Mon, 7 Apr 2014 02:38:40 +1000 Message-ID: <53418310.7010702@freebsd.org> Date: Sun, 06 Apr 2014 10:38:40 -0600 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r264179 - in head/sys/amd64/vmm: . intel io References: <201404052243.s35MhNiL027981@svn.freebsd.org> In-Reply-To: <201404052243.s35MhNiL027981@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 16:38:48 -0000 > Make the vmm code compile with gcc too. Not entirely sure things are > correct for the pirbase test Then why not contact the authors/maintainers of this code ? We'll take it from here and will revert/rework this change, as well as making sure it compiles with gcc and also testing it, which for some reason you seem to think you are immune from. Not happy, Peter. From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 16:48:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99B1C76D; Sun, 6 Apr 2014 16:48:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8725BF52; Sun, 6 Apr 2014 16:48:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s36Gm0Nu080841; Sun, 6 Apr 2014 16:48:00 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s36Gm0kG080840; Sun, 6 Apr 2014 16:48:00 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201404061648.s36Gm0kG080840@svn.freebsd.org> From: Peter Grehan Date: Sun, 6 Apr 2014 16:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264195 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 16:48:00 -0000 Author: grehan Date: Sun Apr 6 16:48:00 2014 New Revision: 264195 URL: http://svnweb.freebsd.org/changeset/base/264195 Log: This should have been obvious, but make it so. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Sun Apr 6 16:35:49 2014 (r264194) +++ head/MAINTAINERS Sun Apr 6 16:48:00 2014 (r264195) @@ -132,3 +132,4 @@ nvmecontrol(8) jimharris Pre-commit revi release/release.sh gjb Pre-commit review and regression tests requested. nanobsd imp Pre-commit review requested for coordination. +vmm(4) neel,grehan Pre-commit review requested. From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 16:59:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8731AAC5; Sun, 6 Apr 2014 16:59:31 +0000 (UTC) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id 47977B9; Sun, 6 Apr 2014 16:59:31 +0000 (UTC) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by alto.onthenet.com.au (Postfix) with ESMTPS id 72CE2122D7; Mon, 7 Apr 2014 02:59:30 +1000 (EST) Received: from Peter-Grehans-MacBook-Pro-2.local (c-174-51-225-141.hsd1.co.comcast.net [174.51.225.141]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BTD90677 (AUTH peterg@ptree32.com.au); Mon, 7 Apr 2014 02:59:28 +1000 Message-ID: <534187F2.7050806@freebsd.org> Date: Sun, 06 Apr 2014 10:59:30 -0600 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r264179 - in head/sys/amd64/vmm: . intel io References: <201404052243.s35MhNiL027981@svn.freebsd.org> <53418310.7010702@freebsd.org> In-Reply-To: <53418310.7010702@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 16:59:31 -0000 >> Make the vmm code compile with gcc too. Not entirely sure things are >> correct for the pirbase test Warner has contacted me privately; we have a way forward and I now consider the issue closed. later, Peter. From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 17:06:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0EECCD0B; Sun, 6 Apr 2014 17:06:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F00DD165; Sun, 6 Apr 2014 17:06:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s36H6Rpd088774; Sun, 6 Apr 2014 17:06:27 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s36H6RIC088772; Sun, 6 Apr 2014 17:06:27 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201404061706.s36H6RIC088772@svn.freebsd.org> From: David Chisnall Date: Sun, 6 Apr 2014 17:06:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264196 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 17:06:28 -0000 Author: theraven Date: Sun Apr 6 17:06:27 2014 New Revision: 264196 URL: http://svnweb.freebsd.org/changeset/base/264196 Log: Move definitions out of rpc_com so that the linker doesn't complain about multiple definitions. Reported by: sbruno Modified: head/lib/libc/rpc/rpc_com.h head/lib/libc/rpc/svc.c Modified: head/lib/libc/rpc/rpc_com.h ============================================================================== --- head/lib/libc/rpc/rpc_com.h Sun Apr 6 16:48:00 2014 (r264195) +++ head/lib/libc/rpc/rpc_com.h Sun Apr 6 17:06:27 2014 (r264196) @@ -86,8 +86,8 @@ bool_t __xdrrec_setnonblock(XDR *, int); bool_t __xdrrec_getrec(XDR *, enum xprt_stat *, bool_t); void __xprt_unregister_unlocked(SVCXPRT *); -SVCXPRT **__svc_xports; -int __svc_maxrec; +extern SVCXPRT **__svc_xports; +extern int __svc_maxrec; __END_DECLS Modified: head/lib/libc/rpc/svc.c ============================================================================== --- head/lib/libc/rpc/svc.c Sun Apr 6 16:48:00 2014 (r264195) +++ head/lib/libc/rpc/svc.c Sun Apr 6 17:06:27 2014 (r264196) @@ -84,6 +84,9 @@ static struct svc_callout { void (*sc_dispatch)(struct svc_req *, SVCXPRT *); } *svc_head; +SVCXPRT **__svc_xports; +int __svc_maxrec; + static struct svc_callout *svc_find(rpcprog_t, rpcvers_t, struct svc_callout **, char *); static void __xprt_do_unregister (SVCXPRT *xprt, bool_t dolock); From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 17:09:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3368BEBA; Sun, 6 Apr 2014 17:09:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06EA118A; Sun, 6 Apr 2014 17:09:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s36H9pZI089148; Sun, 6 Apr 2014 17:09:51 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s36H9pk9089147; Sun, 6 Apr 2014 17:09:51 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201404061709.s36H9pk9089147@svn.freebsd.org> From: Luiz Otavio O Souza Date: Sun, 6 Apr 2014 17:09:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264197 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 17:09:52 -0000 Author: loos Date: Sun Apr 6 17:09:51 2014 New Revision: 264197 URL: http://svnweb.freebsd.org/changeset/base/264197 Log: Partially revert r264083. While it is the recommended initialization procedure, it hangs on the reset of the second GPIO module on pandaboard. Removes the module reset for now as more investigation would be needed. Reported by: jceel Modified: head/sys/arm/ti/ti_gpio.c Modified: head/sys/arm/ti/ti_gpio.c ============================================================================== --- head/sys/arm/ti/ti_gpio.c Sun Apr 6 17:06:27 2014 (r264196) +++ head/sys/arm/ti/ti_gpio.c Sun Apr 6 17:09:51 2014 (r264197) @@ -69,9 +69,6 @@ __FBSDID("$FreeBSD$"); /* Register definitions */ #define TI_GPIO_REVISION 0x0000 #define TI_GPIO_SYSCONFIG 0x0010 -#define TI_GPIO_SYSCONFIG_SOFTRESET (1 << 1) -#define TI_GPIO_SYSCONFIG_AUTOIDLE (1 << 0) -#define TI_GPIO_SYSSTATUS_RESETDONE (1 << 0) #if defined(SOC_OMAP3) #define TI_GPIO_SYSSTATUS 0x0014 #define TI_GPIO_IRQSTATUS1 0x0018 @@ -715,7 +712,7 @@ ti_gpio_detach_intr(device_t dev) static int ti_gpio_bank_init(device_t dev, int bank) { - int pin, timeout; + int pin; struct ti_gpio_softc *sc; uint32_t flags, reg_oe; @@ -724,16 +721,6 @@ ti_gpio_bank_init(device_t dev, int bank /* Enable the interface and functional clocks for the module. */ ti_prcm_clk_enable(GPIO0_CLK + FIRST_GPIO_BANK + bank); - /* Reset the GPIO module. */ - timeout = 0; - ti_gpio_write_4(sc, bank, TI_GPIO_SYSCONFIG, TI_GPIO_SYSCONFIG_SOFTRESET); - while ((ti_gpio_read_4(sc, bank, TI_GPIO_SYSSTATUS) & - TI_GPIO_SYSSTATUS_RESETDONE) == 0) { - if (timeout++ > 100) - return (EBUSY); - DELAY(100); - } - /* * Read the revision number of the module. TI don't publish the * actual revision numbers, so instead the values have been @@ -821,7 +808,7 @@ ti_gpio_attach(device_t dev) */ for (i = 0; i < MAX_GPIO_BANKS; i++) { if (sc->sc_mem_res[i] != NULL) { - /* Reset and initialize the GPIO module. */ + /* Initialize the GPIO module. */ err = ti_gpio_bank_init(dev, i); if (err != 0) { ti_gpio_detach_intr(dev); From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 19:51:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49C913A6; Sun, 6 Apr 2014 19:51:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 365DE3D4; Sun, 6 Apr 2014 19:51:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s36Jpwjf059016; Sun, 6 Apr 2014 19:51:58 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s36JpwQ0059015; Sun, 6 Apr 2014 19:51:58 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404061951.s36JpwQ0059015@svn.freebsd.org> From: Warner Losh Date: Sun, 6 Apr 2014 19:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264199 - head/sys/boot/ficl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 19:51:58 -0000 Author: imp Date: Sun Apr 6 19:51:57 2014 New Revision: 264199 URL: http://svnweb.freebsd.org/changeset/base/264199 Log: Fix the mips64el build: mips64el should use the mips64 directory, not the mips64el directory. Modified: head/sys/boot/ficl/Makefile Modified: head/sys/boot/ficl/Makefile ============================================================================== --- head/sys/boot/ficl/Makefile Sun Apr 6 19:19:25 2014 (r264198) +++ head/sys/boot/ficl/Makefile Sun Apr 6 19:51:57 2014 (r264199) @@ -6,7 +6,7 @@ FICLDIR?= ${.CURDIR} .if defined(FICL32) .PATH: ${FICLDIR}/${MACHINE_CPUARCH:S/amd64/i386/} .elif ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "mips64el" -.PATH: ${FICLDIR}/${MACHINE_ARCH} +.PATH: ${FICLDIR}/mips64 .else .PATH: ${FICLDIR}/${MACHINE_CPUARCH} .endif From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 20:00:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B857614; Sun, 6 Apr 2014 20:00:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFDC2635; Sun, 6 Apr 2014 20:00:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s36K0g2Z060917; Sun, 6 Apr 2014 20:00:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s36K0gOv060915; Sun, 6 Apr 2014 20:00:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201404062000.s36K0gOv060915@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Apr 2014 20:00:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264200 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 20:00:43 -0000 Author: ed Date: Sun Apr 6 20:00:42 2014 New Revision: 264200 URL: http://svnweb.freebsd.org/changeset/base/264200 Log: Nit: fix locking of p->p_state in procdesc_close(). According to , this field needs to be locked with either the p_mtx or the p_slock. In this case the damage was quite small. Instead of being reaped, the process would just be reparented to init, so it could be reaped from there. Modified: head/sys/kern/sys_procdesc.c Modified: head/sys/kern/sys_procdesc.c ============================================================================== --- head/sys/kern/sys_procdesc.c Sun Apr 6 19:51:57 2014 (r264199) +++ head/sys/kern/sys_procdesc.c Sun Apr 6 20:00:42 2014 (r264200) @@ -364,39 +364,41 @@ procdesc_close(struct file *fp, struct t * collected and procdesc_reap() was already called. */ sx_xunlock(&proctree_lock); - } else if (p->p_state == PRS_ZOMBIE) { - /* - * If the process is already dead and just awaiting reaping, - * do that now. This will release the process's reference to - * the process descriptor when it calls back into - * procdesc_reap(). - */ - PROC_LOCK(p); - PROC_SLOCK(p); - proc_reap(curthread, p, NULL, 0); } else { - /* - * If the process is not yet dead, we need to kill it, but we - * can't wait around synchronously for it to go away, as that - * path leads to madness (and deadlocks). First, detach the - * process from its descriptor so that its exit status will - * be reported normally. - */ PROC_LOCK(p); - pd->pd_proc = NULL; - p->p_procdesc = NULL; - procdesc_free(pd); - - /* - * Next, reparent it to init(8) so that there's someone to - * pick up the pieces; finally, terminate with prejudice. - */ - p->p_sigparent = SIGCHLD; - proc_reparent(p, initproc); - if ((pd->pd_flags & PDF_DAEMON) == 0) - kern_psignal(p, SIGKILL); - PROC_UNLOCK(p); - sx_xunlock(&proctree_lock); + if (p->p_state == PRS_ZOMBIE) { + /* + * If the process is already dead and just awaiting + * reaping, do that now. This will release the + * process's reference to the process descriptor when it + * calls back into procdesc_reap(). + */ + PROC_SLOCK(p); + proc_reap(curthread, p, NULL, 0); + } else { + /* + * If the process is not yet dead, we need to kill it, + * but we can't wait around synchronously for it to go + * away, as that path leads to madness (and deadlocks). + * First, detach the process from its descriptor so that + * its exit status will be reported normally. + */ + pd->pd_proc = NULL; + p->p_procdesc = NULL; + procdesc_free(pd); + + /* + * Next, reparent it to init(8) so that there's someone + * to pick up the pieces; finally, terminate with + * prejudice. + */ + p->p_sigparent = SIGCHLD; + proc_reparent(p, initproc); + if ((pd->pd_flags & PDF_DAEMON) == 0) + kern_psignal(p, SIGKILL); + PROC_UNLOCK(p); + sx_xunlock(&proctree_lock); + } } /* From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 20:04:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9849775; Sun, 6 Apr 2014 20:04:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5FE46BF; Sun, 6 Apr 2014 20:04:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s36K4XqA063548; Sun, 6 Apr 2014 20:04:33 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s36K4XQX063547; Sun, 6 Apr 2014 20:04:33 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404062004.s36K4XQX063547@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 6 Apr 2014 20:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264201 - head/usr.bin/find X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 20:04:33 -0000 Author: jilles Date: Sun Apr 6 20:04:33 2014 New Revision: 264201 URL: http://svnweb.freebsd.org/changeset/base/264201 Log: find: Treat errno from fts_read() more carefully. fts_read() leaves errno unchanged on EOF and sets it on error, so set errno to 0 before calling it. Also, don't trust finish_execplus() to leave errno unchanged. Modified: head/usr.bin/find/find.c Modified: head/usr.bin/find/find.c ============================================================================== --- head/usr.bin/find/find.c Sun Apr 6 20:00:42 2014 (r264200) +++ head/usr.bin/find/find.c Sun Apr 6 20:04:33 2014 (r264201) @@ -175,13 +175,13 @@ find_execute(PLAN *plan, char *paths[]) { FTSENT *entry; PLAN *p; - int rval; + int e, rval; tree = fts_open(paths, ftsoptions, (issort ? find_compare : NULL)); if (tree == NULL) err(1, "ftsopen"); - for (rval = 0; (entry = fts_read(tree)) != NULL;) { + for (rval = 0; errno = 0, (entry = fts_read(tree)) != NULL;) { if (maxdepth != -1 && entry->fts_level >= maxdepth) { if (fts_set(tree, entry, FTS_SKIP)) err(1, "%s", entry->fts_path); @@ -231,8 +231,9 @@ find_execute(PLAN *plan, char *paths[]) */ for (p = plan; p && (p->execute)(p, entry); p = p->next); } + e = errno; finish_execplus(); - if (errno && (!ignore_readdir_race || errno != ENOENT)) - err(1, "fts_read"); + if (e && (!ignore_readdir_race || e != ENOENT)) + errc(1, e, "fts_read"); return (rval); } From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 20:20:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3006B59; Sun, 6 Apr 2014 20:20:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0621801; Sun, 6 Apr 2014 20:20:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s36KK7ZH069848; Sun, 6 Apr 2014 20:20:07 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s36KK7uj069847; Sun, 6 Apr 2014 20:20:07 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201404062020.s36KK7uj069847@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Apr 2014 20:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264202 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 20:20:07 -0000 Author: ed Date: Sun Apr 6 20:20:07 2014 New Revision: 264202 URL: http://svnweb.freebsd.org/changeset/base/264202 Log: Fix a typo. The function name is pdfork; not pfork. Modified: head/sys/kern/sys_procdesc.c Modified: head/sys/kern/sys_procdesc.c ============================================================================== --- head/sys/kern/sys_procdesc.c Sun Apr 6 20:04:33 2014 (r264201) +++ head/sys/kern/sys_procdesc.c Sun Apr 6 20:20:07 2014 (r264202) @@ -55,7 +55,7 @@ * * - How to handle ptrace(2)? * - Will we want to add a pidtoprocdesc(2) system call to allow process - * descriptors to be created for processes without pfork(2)? + * descriptors to be created for processes without pdfork(2)? */ #include From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 21:40:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82C3880; Sun, 6 Apr 2014 21:40:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F54DEEC; Sun, 6 Apr 2014 21:40:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s36LeeGs046841; Sun, 6 Apr 2014 21:40:40 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s36Lee7G046823; Sun, 6 Apr 2014 21:40:40 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404062140.s36Lee7G046823@svn.freebsd.org> From: Ian Lepore Date: Sun, 6 Apr 2014 21:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264203 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 21:40:40 -0000 Author: ian Date: Sun Apr 6 21:40:39 2014 New Revision: 264203 URL: http://svnweb.freebsd.org/changeset/base/264203 Log: Tell VM we now have ARM platforms with physically discontiguous memory. Modified: head/sys/arm/include/vmparam.h Modified: head/sys/arm/include/vmparam.h ============================================================================== --- head/sys/arm/include/vmparam.h Sun Apr 6 20:20:07 2014 (r264202) +++ head/sys/arm/include/vmparam.h Sun Apr 6 21:40:39 2014 (r264203) @@ -77,9 +77,9 @@ #define VM_PHYSSEG_MAX 32 /* - * The physical address space is densely populated. + * The physical address space may be sparsely populated on some ARM systems. */ -#define VM_PHYSSEG_DENSE +#define VM_PHYSSEG_SPARSE /* * Create two free page pools. Since the ARM kernel virtual address From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 21:45:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC4A72AC; Sun, 6 Apr 2014 21:45:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9989EF82; Sun, 6 Apr 2014 21:45:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s36Ljc12066091; Sun, 6 Apr 2014 21:45:38 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s36LjcYI066090; Sun, 6 Apr 2014 21:45:38 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404062145.s36LjcYI066090@svn.freebsd.org> From: Ian Lepore Date: Sun, 6 Apr 2014 21:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264204 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 21:45:38 -0000 Author: ian Date: Sun Apr 6 21:45:38 2014 New Revision: 264204 URL: http://svnweb.freebsd.org/changeset/base/264204 Log: Define the full 1024M of ram on the imx53 QSB board. Modified: head/sys/boot/fdt/dts/arm/imx53-qsb.dts Modified: head/sys/boot/fdt/dts/arm/imx53-qsb.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/imx53-qsb.dts Sun Apr 6 21:40:39 2014 (r264203) +++ head/sys/boot/fdt/dts/arm/imx53-qsb.dts Sun Apr 6 21:45:38 2014 (r264204) @@ -41,8 +41,9 @@ compatible = "fsl,imx53-qsb", "fsl,imx53"; memory { - /* RAM 512M */ - reg = <0x70000000 0x20000000>; + /* RAM is 2 banks of 512M each. */ + reg = <0x70000000 0x20000000 + 0xb0000000 0x20000000>; }; localbus@18000000 { From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 21:48:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51D653FB; Sun, 6 Apr 2014 21:48:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33B83F94; Sun, 6 Apr 2014 21:48:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s36LmkB4009052; Sun, 6 Apr 2014 21:48:46 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s36Lmk33009036; Sun, 6 Apr 2014 21:48:46 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201404062148.s36Lmk33009036@svn.freebsd.org> From: Justin Hibbits Date: Sun, 6 Apr 2014 21:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264205 - head/sys/powerpc/powermac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 21:48:46 -0000 Author: jhibbits Date: Sun Apr 6 21:48:45 2014 New Revision: 264205 URL: http://svnweb.freebsd.org/changeset/base/264205 Log: Fix the ATI backlight driver off/on handling. Now this driver works correctly with the ATI Radeon 9700 in the PowerBook G4 1.67GHz. Code shamelessly taken in spirit from the radeonkms driver, which I hope will make this driver redundant in the future. MFC after: 2 weeks Modified: head/sys/powerpc/powermac/atibl.c Modified: head/sys/powerpc/powermac/atibl.c ============================================================================== --- head/sys/powerpc/powermac/atibl.c Sun Apr 6 21:45:38 2014 (r264204) +++ head/sys/powerpc/powermac/atibl.c Sun Apr 6 21:48:45 2014 (r264205) @@ -57,6 +57,12 @@ __FBSDID("$FreeBSD$"); #define RADEON_LVDS_PLL_RESET (1 << 17) #define RADEON_PIXCLKS_CNTL 0x002d #define RADEON_PIXCLK_LVDS_ALWAYS_ONb (1 << 14) +#define RADEON_DISP_PWR_MAN 0x0d08 +#define RADEON_AUTO_PWRUP_EN (1 << 26) +#define RADEON_CLOCK_CNTL_DATA 0x000c +#define RADEON_CLOCK_CNTL_INDEX 0x0008 +#define RADEON_PLL_WR_EN (1 << 7) +#define RADEON_CRTC_GEN_CNTL 0x0050 struct atibl_softc { struct resource *sc_memr; @@ -151,12 +157,56 @@ atibl_attach(device_t dev) return (0); } +static uint32_t __inline +atibl_pll_rreg(struct atibl_softc *sc, uint32_t reg) +{ + uint32_t data, save, tmp; + + bus_write_1(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX, + ((reg & 0x3f) | RADEON_PLL_WR_EN)); + (void)bus_read_4(sc->sc_memr, RADEON_CLOCK_CNTL_DATA); + (void)bus_read_4(sc->sc_memr, RADEON_CRTC_GEN_CNTL); + + data = bus_read_4(sc->sc_memr, RADEON_CLOCK_CNTL_DATA); + + /* Only necessary on R300, bt won't hurt others. */ + save = bus_read_4(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX); + tmp = save & (~0x3f | RADEON_PLL_WR_EN); + bus_write_4(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX, tmp); + tmp = bus_read_4(sc->sc_memr, RADEON_CLOCK_CNTL_DATA); + bus_write_4(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX, save); + + return data; +} + +static void __inline +atibl_pll_wreg(struct atibl_softc *sc, uint32_t reg, uint32_t val) +{ + uint32_t save, tmp; + + bus_write_1(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX, + ((reg & 0x3f) | RADEON_PLL_WR_EN)); + (void)bus_read_4(sc->sc_memr, RADEON_CLOCK_CNTL_DATA); + (void)bus_read_4(sc->sc_memr, RADEON_CRTC_GEN_CNTL); + + bus_write_4(sc->sc_memr, RADEON_CLOCK_CNTL_DATA, val); + DELAY(5000); + + /* Only necessary on R300, bt won't hurt others. */ + save = bus_read_4(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX); + tmp = save & (~0x3f | RADEON_PLL_WR_EN); + bus_write_4(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX, tmp); + tmp = bus_read_4(sc->sc_memr, RADEON_CLOCK_CNTL_DATA); + bus_write_4(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX, save); +} + static int atibl_setlevel(struct atibl_softc *sc, int newlevel) { uint32_t lvds_gen_cntl; uint32_t lvds_pll_cntl; uint32_t pixclks_cntl; + uint32_t disp_pwr_reg; if (newlevel > 100) newlevel = 100; @@ -168,11 +218,15 @@ atibl_setlevel(struct atibl_softc *sc, i if (newlevel > 0) { newlevel = (newlevel * 5) / 2 + 5; + disp_pwr_reg = bus_read_4(sc->sc_memr, RADEON_DISP_PWR_MAN); + disp_pwr_reg |= RADEON_AUTO_PWRUP_EN; + bus_write_4(sc->sc_memr, RADEON_DISP_PWR_MAN, disp_pwr_reg); lvds_pll_cntl = bus_read_4(sc->sc_memr, RADEON_LVDS_PLL_CNTL); lvds_pll_cntl |= RADEON_LVDS_PLL_EN; bus_write_4(sc->sc_memr, RADEON_LVDS_PLL_CNTL, lvds_pll_cntl); lvds_pll_cntl &= ~RADEON_LVDS_PLL_RESET; bus_write_4(sc->sc_memr, RADEON_LVDS_PLL_CNTL, lvds_pll_cntl); + DELAY(1000); lvds_gen_cntl &= ~(RADEON_LVDS_DISPLAY_DIS | RADEON_LVDS_BL_MOD_LEVEL_MASK); @@ -181,20 +235,21 @@ atibl_setlevel(struct atibl_softc *sc, i lvds_gen_cntl |= (newlevel << RADEON_LVDS_BL_MOD_LEVEL_SHIFT) & RADEON_LVDS_BL_MOD_LEVEL_MASK; lvds_gen_cntl |= RADEON_LVDS_BL_MOD_EN; - DELAY(2000); + DELAY(2000000); bus_write_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); } else { - pixclks_cntl = bus_read_4(sc->sc_memr, RADEON_PIXCLKS_CNTL); - bus_write_4(sc->sc_memr, RADEON_PIXCLKS_CNTL, + pixclks_cntl = atibl_pll_rreg(sc, RADEON_PIXCLKS_CNTL); + atibl_pll_wreg(sc, RADEON_PIXCLKS_CNTL, pixclks_cntl & ~RADEON_PIXCLK_LVDS_ALWAYS_ONb); lvds_gen_cntl |= RADEON_LVDS_DISPLAY_DIS; - lvds_gen_cntl &= RADEON_LVDS_BL_MOD_EN; + lvds_gen_cntl &= ~RADEON_LVDS_BL_MOD_EN; bus_write_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); lvds_gen_cntl &= ~(RADEON_LVDS_ON | RADEON_LVDS_EN); - DELAY(2000); + DELAY(2000000); bus_write_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); - bus_write_4(sc->sc_memr, RADEON_PIXCLKS_CNTL, pixclks_cntl); + atibl_pll_wreg(sc, RADEON_PIXCLKS_CNTL, pixclks_cntl); + DELAY(2000000); } return (0); From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 23:22:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF0E4438; Sun, 6 Apr 2014 23:22:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC091A14; Sun, 6 Apr 2014 23:22:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s36NMg34002226; Sun, 6 Apr 2014 23:22:42 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s36NMgnd002225; Sun, 6 Apr 2014 23:22:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201404062322.s36NMgnd002225@svn.freebsd.org> From: Rui Paulo Date: Sun, 6 Apr 2014 23:22:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264206 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 23:22:42 -0000 Author: rpaulo Date: Sun Apr 6 23:22:42 2014 New Revision: 264206 URL: http://svnweb.freebsd.org/changeset/base/264206 Log: Fix the memory region. This board has two memory regions. Modified: head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts Modified: head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts Sun Apr 6 21:48:45 2014 (r264205) +++ head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts Sun Apr 6 23:22:42 2014 (r264206) @@ -41,7 +41,8 @@ memory { /* RAM 512M */ - reg = <0x70000000 0x20000000>; + reg = <0x70000000 0x10000000 + 0xB0000000 0x10000000>; }; localbus@18000000 { From owner-svn-src-head@FreeBSD.ORG Sun Apr 6 23:57:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 936F38DF; Sun, 6 Apr 2014 23:57:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80B28C8C; Sun, 6 Apr 2014 23:57:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s36NvKai015943; Sun, 6 Apr 2014 23:57:20 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s36NvKaE015942; Sun, 6 Apr 2014 23:57:20 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201404062357.s36NvKaE015942@svn.freebsd.org> From: Justin Hibbits Date: Sun, 6 Apr 2014 23:57:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264207 - head/sys/powerpc/powermac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2014 23:57:20 -0000 Author: jhibbits Date: Sun Apr 6 23:57:19 2014 New Revision: 264207 URL: http://svnweb.freebsd.org/changeset/base/264207 Log: Clear the backlight level when it's turned off. Also, reduce the delay times to less conservative values, also found in the radeonkms driver. MFC after: 2 weeks X-MFC-with: r264205 Modified: head/sys/powerpc/powermac/atibl.c Modified: head/sys/powerpc/powermac/atibl.c ============================================================================== --- head/sys/powerpc/powermac/atibl.c Sun Apr 6 23:22:42 2014 (r264206) +++ head/sys/powerpc/powermac/atibl.c Sun Apr 6 23:57:19 2014 (r264207) @@ -235,21 +235,21 @@ atibl_setlevel(struct atibl_softc *sc, i lvds_gen_cntl |= (newlevel << RADEON_LVDS_BL_MOD_LEVEL_SHIFT) & RADEON_LVDS_BL_MOD_LEVEL_MASK; lvds_gen_cntl |= RADEON_LVDS_BL_MOD_EN; - DELAY(2000000); + DELAY(200000); bus_write_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); } else { pixclks_cntl = atibl_pll_rreg(sc, RADEON_PIXCLKS_CNTL); atibl_pll_wreg(sc, RADEON_PIXCLKS_CNTL, pixclks_cntl & ~RADEON_PIXCLK_LVDS_ALWAYS_ONb); lvds_gen_cntl |= RADEON_LVDS_DISPLAY_DIS; - lvds_gen_cntl &= ~RADEON_LVDS_BL_MOD_EN; + lvds_gen_cntl &= ~(RADEON_LVDS_BL_MOD_EN | RADEON_LVDS_BL_MOD_LEVEL_MASK); bus_write_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); lvds_gen_cntl &= ~(RADEON_LVDS_ON | RADEON_LVDS_EN); - DELAY(2000000); + DELAY(200000); bus_write_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); atibl_pll_wreg(sc, RADEON_PIXCLKS_CNTL, pixclks_cntl); - DELAY(2000000); + DELAY(200000); } return (0); From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 00:49:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C668BC5; Mon, 7 Apr 2014 00:49:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79EA2FC5; Mon, 7 Apr 2014 00:49:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s370nGWG037399; Mon, 7 Apr 2014 00:49:16 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s370nGl0037398; Mon, 7 Apr 2014 00:49:16 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404070049.s370nGl0037398@svn.freebsd.org> From: Ed Maste Date: Mon, 7 Apr 2014 00:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264208 - head/sys/boot/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 00:49:16 -0000 Author: emaste Date: Mon Apr 7 00:49:15 2014 New Revision: 264208 URL: http://svnweb.freebsd.org/changeset/base/264208 Log: Do not build the amd64 UEFI loader with GCC The UEFI loader causes buildworld to fail when building with (in-tree) GCC, due to a typedef redefinition. As it happens the in-tree GCC cannot successfully build the UEFI loader anyhow, as it does not support __attribute__((ms_abi)). Thus, just avoid trying to build it with GCC, rather than disconnecting it from the build until the underlying issue is fixed. Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/amd64/Makefile Modified: head/sys/boot/amd64/Makefile ============================================================================== --- head/sys/boot/amd64/Makefile Sun Apr 6 23:57:19 2014 (r264207) +++ head/sys/boot/amd64/Makefile Mon Apr 7 00:49:15 2014 (r264208) @@ -2,6 +2,10 @@ .include +# In-tree GCC does not support __attribute__((ms_abi)), required by the +# UEFI loader. +.if ${COMPILER_TYPE} != "gcc" SUBDIR= efi +.endif .include From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 01:46:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7CF3376; Mon, 7 Apr 2014 01:46:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C524D760; Mon, 7 Apr 2014 01:46:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s371kUhI061206; Mon, 7 Apr 2014 01:46:30 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s371kUAt061205; Mon, 7 Apr 2014 01:46:30 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404070146.s371kUAt061205@svn.freebsd.org> From: Eitan Adler Date: Mon, 7 Apr 2014 01:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264209 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 01:46:30 -0000 Author: eadler Date: Mon Apr 7 01:46:30 2014 New Revision: 264209 URL: http://svnweb.freebsd.org/changeset/base/264209 Log: units(1): Add some some additional units Most of these are also recognized by GNU units Modified: head/usr.bin/units/units.lib Modified: head/usr.bin/units/units.lib ============================================================================== --- head/usr.bin/units/units.lib Mon Apr 7 00:49:15 2014 (r264208) +++ head/usr.bin/units/units.lib Mon Apr 7 01:46:30 2014 (r264209) @@ -39,8 +39,13 @@ zopto- 1e-21 zepto- zopto yocto- 1e-24 +quarter- 1|4 semi- .5 demi- .5 +hemi- .5 +half- .5 +double- 2 +tripple- 3 Y- yotta Z- zetta @@ -55,6 +60,7 @@ da- deka d- deci c- centi m- milli +u- micro n- nano p- pico f- femto From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 01:52:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16FDA79A; Mon, 7 Apr 2014 01:52:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE5B5834; Mon, 7 Apr 2014 01:52:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s371qZ9K064814; Mon, 7 Apr 2014 01:52:35 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s371qZso064813; Mon, 7 Apr 2014 01:52:35 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404070152.s371qZso064813@svn.freebsd.org> From: Eitan Adler Date: Mon, 7 Apr 2014 01:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264211 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 01:52:36 -0000 Author: eadler Date: Mon Apr 7 01:52:35 2014 New Revision: 264211 URL: http://svnweb.freebsd.org/changeset/base/264211 Log: units(1): fix spelling Pointyhat to: me Modified: head/usr.bin/units/units.lib Modified: head/usr.bin/units/units.lib ============================================================================== --- head/usr.bin/units/units.lib Mon Apr 7 01:49:30 2014 (r264210) +++ head/usr.bin/units/units.lib Mon Apr 7 01:52:35 2014 (r264211) @@ -45,7 +45,7 @@ demi- .5 hemi- .5 half- .5 double- 2 -tripple- 3 +triple- 3 Y- yotta Z- zetta From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 01:53:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C5D68DC; Mon, 7 Apr 2014 01:53:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0804283D; Mon, 7 Apr 2014 01:53:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s371r5T0064927; Mon, 7 Apr 2014 01:53:05 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s371r3Gn064909; Mon, 7 Apr 2014 01:53:03 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201404070153.s371r3Gn064909@svn.freebsd.org> From: Kevin Lo Date: Mon, 7 Apr 2014 01:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264212 - in head: lib/libc/net sys/netinet sys/netinet6 sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 01:53:06 -0000 Author: kevlo Date: Mon Apr 7 01:53:03 2014 New Revision: 264212 URL: http://svnweb.freebsd.org/changeset/base/264212 Log: Add support for UDP-Lite protocol (RFC 3828) to IPv4 and IPv6 stacks. Tested with vlc and a test suite [1]. [1] http://www.erg.abdn.ac.uk/~gerrit/udp-lite/files/udplite_linux.tar.gz Reviewed by: jhb, glebius, adrian Added: head/sys/netinet/udplite.h (contents, props changed) Modified: head/lib/libc/net/getaddrinfo.c head/sys/netinet/in.c head/sys/netinet/in.h head/sys/netinet/in_pcb.c head/sys/netinet/in_proto.c head/sys/netinet/udp_usrreq.c head/sys/netinet/udp_var.h head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_proto.c head/sys/netinet6/udp6_usrreq.c head/sys/netinet6/udp6_var.h head/sys/sys/param.h Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Mon Apr 7 01:52:35 2014 (r264211) +++ head/lib/libc/net/getaddrinfo.c Mon Apr 7 01:53:03 2014 (r264212) @@ -170,12 +170,14 @@ static const struct explore explore[] = { PF_INET6, SOCK_STREAM, IPPROTO_TCP, 0x07 }, { PF_INET6, SOCK_STREAM, IPPROTO_SCTP, 0x03 }, { PF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP, 0x07 }, + { PF_INET6, SOCK_DGRAM, IPPROTO_UDPLITE, 0x03 }, { PF_INET6, SOCK_RAW, ANY, 0x05 }, #endif { PF_INET, SOCK_DGRAM, IPPROTO_UDP, 0x07 }, { PF_INET, SOCK_STREAM, IPPROTO_TCP, 0x07 }, { PF_INET, SOCK_STREAM, IPPROTO_SCTP, 0x03 }, { PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP, 0x07 }, + { PF_INET, SOCK_DGRAM, IPPROTO_UDPLITE, 0x03 }, { PF_INET, SOCK_RAW, ANY, 0x05 }, { -1, 0, 0, 0 }, }; @@ -1477,6 +1479,9 @@ get_port(struct addrinfo *ai, const char case IPPROTO_SCTP: proto = "sctp"; break; + case IPPROTO_UDPLITE: + proto = "udplite"; + break; default: proto = NULL; break; Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Mon Apr 7 01:52:35 2014 (r264211) +++ head/sys/netinet/in.c Mon Apr 7 01:53:03 2014 (r264212) @@ -859,6 +859,7 @@ in_ifdetach(struct ifnet *ifp) in_pcbpurgeif0(&V_ripcbinfo, ifp); in_pcbpurgeif0(&V_udbinfo, ifp); + in_pcbpurgeif0(&V_ulitecbinfo, ifp); in_purgemaddrs(ifp); } Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Mon Apr 7 01:52:35 2014 (r264211) +++ head/sys/netinet/in.h Mon Apr 7 01:53:03 2014 (r264212) @@ -237,6 +237,7 @@ __END_DECLS #define IPPROTO_IPCOMP 108 /* payload compression (IPComp) */ #define IPPROTO_SCTP 132 /* SCTP */ #define IPPROTO_MH 135 /* IPv6 Mobility Header */ +#define IPPROTO_UDPLITE 136 /* UDP-Lite */ #define IPPROTO_HIP 139 /* IP6 Host Identity Protocol */ #define IPPROTO_SHIM6 140 /* IP6 Shim6 Protocol */ /* 101-254: Partly Unassigned */ Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Mon Apr 7 01:52:35 2014 (r264211) +++ head/sys/netinet/in_pcb.c Mon Apr 7 01:53:03 2014 (r264212) @@ -389,13 +389,14 @@ in_pcb_lport(struct inpcb *inp, struct i lastport = &pcbinfo->ipi_lastport; } /* - * For UDP, use random port allocation as long as the user + * For UDP(-Lite), use random port allocation as long as the user * allows it. For TCP (and as of yet unknown) connections, * use random port allocation only if the user allows it AND * ipport_tick() allows it. */ if (V_ipport_randomized && - (!V_ipport_stoprandom || pcbinfo == &V_udbinfo)) + (!V_ipport_stoprandom || pcbinfo == &V_udbinfo || + pcbinfo == &V_ulitecbinfo)) dorandom = 1; else dorandom = 0; @@ -405,8 +406,8 @@ in_pcb_lport(struct inpcb *inp, struct i */ if (first == last) dorandom = 0; - /* Make sure to not include UDP packets in the count. */ - if (pcbinfo != &V_udbinfo) + /* Make sure to not include UDP(-Lite) packets in the count. */ + if (pcbinfo != &V_udbinfo || pcbinfo != &V_ulitecbinfo) V_ipport_tcpallocs++; /* * Instead of having two loops further down counting up or down Modified: head/sys/netinet/in_proto.c ============================================================================== --- head/sys/netinet/in_proto.c Mon Apr 7 01:52:35 2014 (r264211) +++ head/sys/netinet/in_proto.c Mon Apr 7 01:53:03 2014 (r264212) @@ -184,6 +184,20 @@ struct protosw inetsw[] = { }, #endif /* SCTP */ { + .pr_type = SOCK_DGRAM, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_UDPLITE, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = udp_input, + .pr_ctlinput = udplite_ctlinput, + .pr_ctloutput = udp_ctloutput, + .pr_init = udplite_init, +#ifdef VIMAGE + .pr_destroy = udplite_destroy, +#endif + .pr_usrreqs = &udp_usrreqs +}, +{ .pr_type = SOCK_RAW, .pr_domain = &inetdomain, .pr_protocol = IPPROTO_RAW, Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Mon Apr 7 01:52:35 2014 (r264211) +++ head/sys/netinet/udp_usrreq.c Mon Apr 7 01:53:03 2014 (r264212) @@ -3,6 +3,7 @@ * The Regents of the University of California. * Copyright (c) 2008 Robert N. M. Watson * Copyright (c) 2010-2011 Juniper Networks, Inc. + * Copyright (c) 2014 Kevin Lo * All rights reserved. * * Portions of this software were developed by Robert N. M. Watson under @@ -87,6 +88,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#include #ifdef IPSEC #include @@ -98,8 +100,9 @@ __FBSDID("$FreeBSD$"); #include /* - * UDP protocol implementation. + * UDP and UDP-Lite protocols implementation. * Per RFC 768, August, 1980. + * Per RFC 3828, July, 2004. */ /* @@ -139,6 +142,8 @@ SYSCTL_ULONG(_net_inet_udp, UDPCTL_RECVS VNET_DEFINE(struct inpcbhead, udb); /* from udp_var.h */ VNET_DEFINE(struct inpcbinfo, udbinfo); +VNET_DEFINE(struct inpcbhead, ulitecb); +VNET_DEFINE(struct inpcbinfo, ulitecbinfo); static VNET_DEFINE(uma_zone_t, udpcb_zone); #define V_udpcb_zone VNET(udpcb_zone) @@ -187,6 +192,16 @@ udp_inpcb_init(void *mem, int size, int return (0); } +static int +udplite_inpcb_init(void *mem, int size, int flags) +{ + struct inpcb *inp; + + inp = mem; + INP_LOCK_INIT(inp, "inp", "udpliteinp"); + return (0); +} + void udp_init(void) { @@ -202,6 +217,15 @@ udp_init(void) EVENTHANDLER_PRI_ANY); } +void +udplite_init(void) +{ + + in_pcbinfo_init(&V_ulitecbinfo, "udplite", &V_ulitecb, UDBHASHSIZE, + UDBHASHSIZE, "udplite_inpcb", udplite_inpcb_init, NULL, + UMA_ZONE_NOFREE, IPI_HASHFIELDS_2TUPLE); +} + /* * Kernel module interface for updating udpstat. The argument is an index * into udpstat treated as an array of u_long. While this encodes the @@ -243,6 +267,13 @@ udp_destroy(void) in_pcbinfo_destroy(&V_udbinfo); uma_zdestroy(V_udpcb_zone); } + +void +udplite_destroy(void) +{ + + in_pcbinfo_destroy(&V_ulitecbinfo); +} #endif #ifdef INET @@ -346,10 +377,14 @@ udp_input(struct mbuf *m, int off) struct ifnet *ifp; struct inpcb *inp; uint16_t len, ip_len; + struct inpcbinfo *pcbinfo; struct ip save_ip; struct sockaddr_in udp_in; struct m_tag *fwd_tag; + int cscov_partial; + uint8_t pr; + iphlen = off; ifp = m->m_pkthdr.rcvif; UDPSTAT_INC(udps_ipackets); @@ -375,6 +410,8 @@ udp_input(struct mbuf *m, int off) ip = mtod(m, struct ip *); } uh = (struct udphdr *)((caddr_t)ip + iphlen); + pr = ip->ip_p; + cscov_partial = (pr == IPPROTO_UDPLITE) ? 1 : 0; /* * Destination port of 0 is illegal, based on RFC768. @@ -398,12 +435,18 @@ udp_input(struct mbuf *m, int off) */ len = ntohs((u_short)uh->uh_ulen); ip_len = ntohs(ip->ip_len) - iphlen; + if (pr == IPPROTO_UDPLITE && len == 0) { + /* Zero means checksum over the complete packet. */ + len = ip_len; + cscov_partial = 0; + } if (ip_len != len) { if (len > ip_len || len < sizeof(struct udphdr)) { UDPSTAT_INC(udps_badlen); goto badunlocked; } - m_adj(m, len - ip_len); + if (pr == IPPROTO_UDP) + m_adj(m, len - ip_len); } /* @@ -421,20 +464,22 @@ udp_input(struct mbuf *m, int off) if (uh->uh_sum) { u_short uh_sum; - if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { + if ((m->m_pkthdr.csum_flags & CSUM_DATA_VALID) && + !cscov_partial) { if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) uh_sum = m->m_pkthdr.csum_data; else uh_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htonl((u_short)len + - m->m_pkthdr.csum_data + IPPROTO_UDP)); + m->m_pkthdr.csum_data + pr)); uh_sum ^= 0xffff; } else { char b[9]; bcopy(((struct ipovly *)ip)->ih_x1, b, 9); bzero(((struct ipovly *)ip)->ih_x1, 9); - ((struct ipovly *)ip)->ih_len = uh->uh_ulen; + ((struct ipovly *)ip)->ih_len = (pr == IPPROTO_UDP) ? + uh->uh_ulen : htons(ip_len); uh_sum = in_cksum(m, len + sizeof (struct ip)); bcopy(b, ((struct ipovly *)ip)->ih_x1, 9); } @@ -446,14 +491,17 @@ udp_input(struct mbuf *m, int off) } else UDPSTAT_INC(udps_nosum); + pcbinfo = get_inpcbinfo(pr); if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || in_broadcast(ip->ip_dst, ifp)) { struct inpcb *last; + struct inpcbhead *pcblist; struct ip_moptions *imo; - INP_INFO_RLOCK(&V_udbinfo); + INP_INFO_RLOCK(pcbinfo); + pcblist = get_pcblist(pr); last = NULL; - LIST_FOREACH(inp, &V_udb, inp_list) { + LIST_FOREACH(inp, pcblist, inp_list) { if (inp->inp_lport != uh->uh_dport) continue; #ifdef INET6 @@ -539,12 +587,12 @@ udp_input(struct mbuf *m, int off) UDPSTAT_INC(udps_noportbcast); if (inp) INP_RUNLOCK(inp); - INP_INFO_RUNLOCK(&V_udbinfo); + INP_INFO_RUNLOCK(pcbinfo); goto badunlocked; } udp_append(last, ip, m, iphlen, &udp_in); INP_RUNLOCK(last); - INP_INFO_RUNLOCK(&V_udbinfo); + INP_INFO_RUNLOCK(pcbinfo); return; } @@ -565,7 +613,7 @@ udp_input(struct mbuf *m, int off) * Transparently forwarded. Pretend to be the destination. * Already got one like this? */ - inp = in_pcblookup_mbuf(&V_udbinfo, ip->ip_src, uh->uh_sport, + inp = in_pcblookup_mbuf(pcbinfo, ip->ip_src, uh->uh_sport, ip->ip_dst, uh->uh_dport, INPLOOKUP_RLOCKPCB, ifp, m); if (!inp) { /* @@ -573,7 +621,7 @@ udp_input(struct mbuf *m, int off) * Because we've rewritten the destination address, * any hardware-generated hash is ignored. */ - inp = in_pcblookup(&V_udbinfo, ip->ip_src, + inp = in_pcblookup(pcbinfo, ip->ip_src, uh->uh_sport, next_hop->sin_addr, next_hop->sin_port ? htons(next_hop->sin_port) : uh->uh_dport, INPLOOKUP_WILDCARD | @@ -583,7 +631,7 @@ udp_input(struct mbuf *m, int off) m_tag_delete(m, fwd_tag); m->m_flags &= ~M_IP_NEXTHOP; } else - inp = in_pcblookup_mbuf(&V_udbinfo, ip->ip_src, uh->uh_sport, + inp = in_pcblookup_mbuf(pcbinfo, ip->ip_src, uh->uh_sport, ip->ip_dst, uh->uh_dport, INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, ifp, m); if (inp == NULL) { @@ -619,6 +667,16 @@ udp_input(struct mbuf *m, int off) m_freem(m); return; } + if (cscov_partial) { + struct udpcb *up; + + up = intoudpcb(inp); + if (up->u_rxcslen > len) { + INP_RUNLOCK(inp); + m_freem(m); + return; + } + } UDP_PROBE(receive, NULL, inp, ip, inp, uh); udp_append(inp, ip, m, iphlen, &udp_in); @@ -653,8 +711,9 @@ udp_notify(struct inpcb *inp, int errno) } #ifdef INET -void -udp_ctlinput(int cmd, struct sockaddr *sa, void *vip) +static void +udp_common_ctlinput(int cmd, struct sockaddr *sa, void *vip, + struct inpcbinfo *pcbinfo) { struct ip *ip = vip; struct udphdr *uh; @@ -683,7 +742,7 @@ udp_ctlinput(int cmd, struct sockaddr *s return; if (ip != NULL) { uh = (struct udphdr *)((caddr_t)ip + (ip->ip_hl << 2)); - inp = in_pcblookup(&V_udbinfo, faddr, uh->uh_dport, + inp = in_pcblookup(pcbinfo, faddr, uh->uh_dport, ip->ip_src, uh->uh_sport, INPLOOKUP_RLOCKPCB, NULL); if (inp != NULL) { INP_RLOCK_ASSERT(inp); @@ -693,9 +752,22 @@ udp_ctlinput(int cmd, struct sockaddr *s INP_RUNLOCK(inp); } } else - in_pcbnotifyall(&V_udbinfo, faddr, inetctlerrmap[cmd], + in_pcbnotifyall(pcbinfo, faddr, inetctlerrmap[cmd], udp_notify); } +void +udp_ctlinput(int cmd, struct sockaddr *sa, void *vip) +{ + + return (udp_common_ctlinput(cmd, sa, vip, &V_udbinfo)); +} + +void +udplite_ctlinput(int cmd, struct sockaddr *sa, void *vip) +{ + + return (udp_common_ctlinput(cmd, sa, vip, &V_ulitecbinfo)); +} #endif /* INET */ static int @@ -851,16 +923,16 @@ SYSCTL_PROC(_net_inet_udp, OID_AUTO, get int udp_ctloutput(struct socket *so, struct sockopt *sopt) { - int error = 0, optval; struct inpcb *inp; -#ifdef IPSEC_NAT_T struct udpcb *up; -#endif + int isudplite, error, optval; + error = 0; + isudplite = (so->so_proto->pr_protocol == IPPROTO_UDPLITE) ? 1 : 0; inp = sotoinpcb(so); KASSERT(inp != NULL, ("%s: inp == NULL", __func__)); INP_WLOCK(inp); - if (sopt->sopt_level != IPPROTO_UDP) { + if (sopt->sopt_level != so->so_proto->pr_protocol) { #ifdef INET6 if (INP_CHECK_SOCKAF(so, AF_INET6)) { INP_WUNLOCK(inp); @@ -918,6 +990,34 @@ udp_ctloutput(struct socket *so, struct } INP_WUNLOCK(inp); break; + case UDPLITE_SEND_CSCOV: + case UDPLITE_RECV_CSCOV: + if (!isudplite) { + INP_WUNLOCK(inp); + error = ENOPROTOOPT; + break; + } + INP_WUNLOCK(inp); + error = sooptcopyin(sopt, &optval, sizeof(optval), + sizeof(optval)); + if (error != 0) + break; + inp = sotoinpcb(so); + KASSERT(inp != NULL, ("%s: inp == NULL", __func__)); + INP_WLOCK(inp); + up = intoudpcb(inp); + KASSERT(up != NULL, ("%s: up == NULL", __func__)); + if (optval != 0 && optval < 8) { + INP_WUNLOCK(inp); + error = EINVAL; + break; + } + if (sopt->sopt_name == UDPLITE_SEND_CSCOV) + up->u_txcslen = optval; + else + up->u_rxcslen = optval; + INP_WUNLOCK(inp); + break; default: INP_WUNLOCK(inp); error = ENOPROTOOPT; @@ -935,6 +1035,22 @@ udp_ctloutput(struct socket *so, struct error = sooptcopyout(sopt, &optval, sizeof optval); break; #endif + case UDPLITE_SEND_CSCOV: + case UDPLITE_RECV_CSCOV: + if (!isudplite) { + INP_WUNLOCK(inp); + error = ENOPROTOOPT; + break; + } + up = intoudpcb(inp); + KASSERT(up != NULL, ("%s: up == NULL", __func__)); + if (sopt->sopt_name == UDPLITE_SEND_CSCOV) + optval = up->u_txcslen; + else + optval = up->u_rxcslen; + INP_WUNLOCK(inp); + error = sooptcopyout(sopt, &optval, sizeof(optval)); + break; default: INP_WUNLOCK(inp); error = ENOPROTOOPT; @@ -957,12 +1073,16 @@ udp_output(struct inpcb *inp, struct mbu int len = m->m_pkthdr.len; struct in_addr faddr, laddr; struct cmsghdr *cm; + struct inpcbinfo *pcbinfo; struct sockaddr_in *sin, src; + int cscov_partial = 0; int error = 0; int ipflags; u_short fport, lport; int unlock_udbinfo; u_char tos; + uint8_t pr; + uint16_t cscov = 0; /* * udp_output() may need to temporarily bind or connect the current @@ -1057,12 +1177,14 @@ udp_output(struct inpcb *inp, struct mbu * * XXXRW: Check that hash locking update here is correct. */ + pr = inp->inp_socket->so_proto->pr_protocol; + pcbinfo = get_inpcbinfo(pr); sin = (struct sockaddr_in *)addr; if (sin != NULL && (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) { INP_RUNLOCK(inp); INP_WLOCK(inp); - INP_HASH_WLOCK(&V_udbinfo); + INP_HASH_WLOCK(pcbinfo); unlock_udbinfo = UH_WLOCKED; } else if ((sin != NULL && ( (sin->sin_addr.s_addr == INADDR_ANY) || @@ -1070,7 +1192,7 @@ udp_output(struct inpcb *inp, struct mbu (inp->inp_laddr.s_addr == INADDR_ANY) || (inp->inp_lport == 0))) || (src.sin_family == AF_INET)) { - INP_HASH_RLOCK(&V_udbinfo); + INP_HASH_RLOCK(pcbinfo); unlock_udbinfo = UH_RLOCKED; } else unlock_udbinfo = UH_UNLOCKED; @@ -1083,7 +1205,7 @@ udp_output(struct inpcb *inp, struct mbu laddr = inp->inp_laddr; lport = inp->inp_lport; if (src.sin_family == AF_INET) { - INP_HASH_LOCK_ASSERT(&V_udbinfo); + INP_HASH_LOCK_ASSERT(pcbinfo); if ((lport == 0) || (laddr.s_addr == INADDR_ANY && src.sin_addr.s_addr == INADDR_ANY)) { @@ -1134,7 +1256,7 @@ udp_output(struct inpcb *inp, struct mbu inp->inp_lport == 0 || sin->sin_addr.s_addr == INADDR_ANY || sin->sin_addr.s_addr == INADDR_BROADCAST) { - INP_HASH_LOCK_ASSERT(&V_udbinfo); + INP_HASH_LOCK_ASSERT(pcbinfo); error = in_pcbconnect_setup(inp, addr, &laddr.s_addr, &lport, &faddr.s_addr, &fport, NULL, td->td_ucred); @@ -1149,7 +1271,7 @@ udp_output(struct inpcb *inp, struct mbu if (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0) { INP_WLOCK_ASSERT(inp); - INP_HASH_WLOCK_ASSERT(&V_udbinfo); + INP_HASH_WLOCK_ASSERT(pcbinfo); /* * Remember addr if jailed, to prevent * rebinding. @@ -1198,13 +1320,30 @@ udp_output(struct inpcb *inp, struct mbu */ ui = mtod(m, struct udpiphdr *); bzero(ui->ui_x1, sizeof(ui->ui_x1)); /* XXX still needed? */ - ui->ui_v = IPVERSION << 4; - ui->ui_pr = IPPROTO_UDP; + ui->ui_pr = pr; ui->ui_src = laddr; ui->ui_dst = faddr; ui->ui_sport = lport; ui->ui_dport = fport; ui->ui_ulen = htons((u_short)len + sizeof(struct udphdr)); + if (pr == IPPROTO_UDPLITE) { + struct udpcb *up; + uint16_t plen; + + up = intoudpcb(inp); + cscov = up->u_txcslen; + plen = (u_short)len + sizeof(struct udphdr); + if (cscov >= plen) + cscov = 0; + ui->ui_len = htons(plen); + ui->ui_ulen = htons(cscov); + /* + * For UDP-Lite, checksum coverage length of zero means + * the entire UDPLite packet is covered by the checksum. + */ + cscov_partial = (cscov == 0) ? 0 : 1; + } else + ui->ui_v = IPVERSION << 4; /* * Set the Don't Fragment bit in the IP header. @@ -1231,24 +1370,29 @@ udp_output(struct inpcb *inp, struct mbu /* * Set up checksum and output datagram. */ - if (V_udp_cksum) { + ui->ui_sum = 0; + if (cscov_partial) { + if (inp->inp_flags & INP_ONESBCAST) + faddr.s_addr = INADDR_BROADCAST; + if ((ui->ui_sum = in_cksum(m, sizeof(struct ip) + cscov)) == 0) + ui->ui_sum = 0xffff; + } else if (V_udp_cksum || !cscov_partial) { if (inp->inp_flags & INP_ONESBCAST) faddr.s_addr = INADDR_BROADCAST; ui->ui_sum = in_pseudo(ui->ui_src.s_addr, faddr.s_addr, - htons((u_short)len + sizeof(struct udphdr) + IPPROTO_UDP)); + htons((u_short)len + sizeof(struct udphdr) + pr)); m->m_pkthdr.csum_flags = CSUM_UDP; m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum); - } else - ui->ui_sum = 0; + } ((struct ip *)ui)->ip_len = htons(sizeof(struct udpiphdr) + len); ((struct ip *)ui)->ip_ttl = inp->inp_ip_ttl; /* XXX */ ((struct ip *)ui)->ip_tos = tos; /* XXX */ UDPSTAT_INC(udps_opackets); if (unlock_udbinfo == UH_WLOCKED) - INP_HASH_WUNLOCK(&V_udbinfo); + INP_HASH_WUNLOCK(pcbinfo); else if (unlock_udbinfo == UH_RLOCKED) - INP_HASH_RUNLOCK(&V_udbinfo); + INP_HASH_RUNLOCK(pcbinfo); UDP_PROBE(send, NULL, inp, &ui->ui_i, inp, &ui->ui_u); error = ip_output(m, inp->inp_options, NULL, ipflags, inp->inp_moptions, inp); @@ -1260,10 +1404,10 @@ udp_output(struct inpcb *inp, struct mbu release: if (unlock_udbinfo == UH_WLOCKED) { - INP_HASH_WUNLOCK(&V_udbinfo); + INP_HASH_WUNLOCK(pcbinfo); INP_WUNLOCK(inp); } else if (unlock_udbinfo == UH_RLOCKED) { - INP_HASH_RUNLOCK(&V_udbinfo); + INP_HASH_RUNLOCK(pcbinfo); INP_RUNLOCK(inp); } else INP_RUNLOCK(inp); @@ -1410,15 +1554,17 @@ static void udp_abort(struct socket *so) { struct inpcb *inp; + struct inpcbinfo *pcbinfo; + pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_abort: inp == NULL")); INP_WLOCK(inp); if (inp->inp_faddr.s_addr != INADDR_ANY) { - INP_HASH_WLOCK(&V_udbinfo); + INP_HASH_WLOCK(pcbinfo); in_pcbdisconnect(inp); inp->inp_laddr.s_addr = INADDR_ANY; - INP_HASH_WUNLOCK(&V_udbinfo); + INP_HASH_WUNLOCK(pcbinfo); soisdisconnected(so); } INP_WUNLOCK(inp); @@ -1428,17 +1574,19 @@ static int udp_attach(struct socket *so, int proto, struct thread *td) { struct inpcb *inp; + struct inpcbinfo *pcbinfo; int error; + pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp == NULL, ("udp_attach: inp != NULL")); error = soreserve(so, udp_sendspace, udp_recvspace); if (error) return (error); - INP_INFO_WLOCK(&V_udbinfo); - error = in_pcballoc(so, &V_udbinfo); + INP_INFO_WLOCK(pcbinfo); + error = in_pcballoc(so, pcbinfo); if (error) { - INP_INFO_WUNLOCK(&V_udbinfo); + INP_INFO_WUNLOCK(pcbinfo); return (error); } @@ -1450,12 +1598,12 @@ udp_attach(struct socket *so, int proto, if (error) { in_pcbdetach(inp); in_pcbfree(inp); - INP_INFO_WUNLOCK(&V_udbinfo); + INP_INFO_WUNLOCK(pcbinfo); return (error); } INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_udbinfo); + INP_INFO_WUNLOCK(pcbinfo); return (0); } #endif /* INET */ @@ -1486,14 +1634,16 @@ static int udp_bind(struct socket *so, struct sockaddr *nam, struct thread *td) { struct inpcb *inp; + struct inpcbinfo *pcbinfo; int error; + pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_bind: inp == NULL")); INP_WLOCK(inp); - INP_HASH_WLOCK(&V_udbinfo); + INP_HASH_WLOCK(pcbinfo); error = in_pcbbind(inp, nam, td->td_ucred); - INP_HASH_WUNLOCK(&V_udbinfo); + INP_HASH_WUNLOCK(pcbinfo); INP_WUNLOCK(inp); return (error); } @@ -1502,15 +1652,17 @@ static void udp_close(struct socket *so) { struct inpcb *inp; + struct inpcbinfo *pcbinfo; + pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_close: inp == NULL")); INP_WLOCK(inp); if (inp->inp_faddr.s_addr != INADDR_ANY) { - INP_HASH_WLOCK(&V_udbinfo); + INP_HASH_WLOCK(pcbinfo); in_pcbdisconnect(inp); inp->inp_laddr.s_addr = INADDR_ANY; - INP_HASH_WUNLOCK(&V_udbinfo); + INP_HASH_WUNLOCK(pcbinfo); soisdisconnected(so); } INP_WUNLOCK(inp); @@ -1520,9 +1672,11 @@ static int udp_connect(struct socket *so, struct sockaddr *nam, struct thread *td) { struct inpcb *inp; - int error; + struct inpcbinfo *pcbinfo; struct sockaddr_in *sin; + int error; + pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_connect: inp == NULL")); INP_WLOCK(inp); @@ -1536,9 +1690,9 @@ udp_connect(struct socket *so, struct so INP_WUNLOCK(inp); return (error); } - INP_HASH_WLOCK(&V_udbinfo); + INP_HASH_WLOCK(pcbinfo); error = in_pcbconnect(inp, nam, td->td_ucred); - INP_HASH_WUNLOCK(&V_udbinfo); + INP_HASH_WUNLOCK(pcbinfo); if (error == 0) soisconnected(so); INP_WUNLOCK(inp); @@ -1549,20 +1703,22 @@ static void udp_detach(struct socket *so) { struct inpcb *inp; + struct inpcbinfo *pcbinfo; struct udpcb *up; + pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_detach: inp == NULL")); KASSERT(inp->inp_faddr.s_addr == INADDR_ANY, ("udp_detach: not disconnected")); - INP_INFO_WLOCK(&V_udbinfo); + INP_INFO_WLOCK(pcbinfo); INP_WLOCK(inp); up = intoudpcb(inp); KASSERT(up != NULL, ("%s: up == NULL", __func__)); inp->inp_ppcb = NULL; in_pcbdetach(inp); in_pcbfree(inp); - INP_INFO_WUNLOCK(&V_udbinfo); + INP_INFO_WUNLOCK(pcbinfo); udp_discardcb(up); } @@ -1570,7 +1726,9 @@ static int udp_disconnect(struct socket *so) { struct inpcb *inp; + struct inpcbinfo *pcbinfo; + pcbinfo = get_inpcbinfo(so->so_proto->pr_protocol); inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_disconnect: inp == NULL")); INP_WLOCK(inp); @@ -1578,10 +1736,10 @@ udp_disconnect(struct socket *so) INP_WUNLOCK(inp); return (ENOTCONN); } - INP_HASH_WLOCK(&V_udbinfo); + INP_HASH_WLOCK(pcbinfo); in_pcbdisconnect(inp); inp->inp_laddr.s_addr = INADDR_ANY; - INP_HASH_WUNLOCK(&V_udbinfo); + INP_HASH_WUNLOCK(pcbinfo); SOCK_LOCK(so); so->so_state &= ~SS_ISCONNECTED; /* XXX */ SOCK_UNLOCK(so); Modified: head/sys/netinet/udp_var.h ============================================================================== --- head/sys/netinet/udp_var.h Mon Apr 7 01:52:35 2014 (r264211) +++ head/sys/netinet/udp_var.h Mon Apr 7 01:53:03 2014 (r264212) @@ -63,6 +63,8 @@ typedef void(*udp_tun_func_t)(struct mbu struct udpcb { udp_tun_func_t u_tun_func; /* UDP kernel tunneling callback. */ u_int u_flags; /* Generic UDP flags. */ + uint16_t u_rxcslen; /* Coverage for incoming datagrams. */ + uint16_t u_txcslen; /* Coverage for outgoing datagrams. */ }; #define intoudpcb(ip) ((struct udpcb *)(ip)->inp_ppcb) @@ -129,8 +131,12 @@ SYSCTL_DECL(_net_inet_udp); extern struct pr_usrreqs udp_usrreqs; VNET_DECLARE(struct inpcbhead, udb); VNET_DECLARE(struct inpcbinfo, udbinfo); +VNET_DECLARE(struct inpcbhead, ulitecb); +VNET_DECLARE(struct inpcbinfo, ulitecbinfo); #define V_udb VNET(udb) #define V_udbinfo VNET(udbinfo) +#define V_ulitecb VNET(ulitecb) +#define V_ulitecbinfo VNET(ulitecbinfo) extern u_long udp_sendspace; extern u_long udp_recvspace; @@ -140,20 +146,37 @@ VNET_DECLARE(int, udp_blackhole); #define V_udp_blackhole VNET(udp_blackhole) extern int udp_log_in_vain; +static __inline struct inpcbinfo * +get_inpcbinfo(uint8_t protocol) +{ + return (protocol == IPPROTO_UDP) ? &V_udbinfo : &V_ulitecbinfo; +} + +static __inline struct inpcbhead * +get_pcblist(uint8_t protocol) +{ + return (protocol == IPPROTO_UDP) ? &V_udb : &V_ulitecb; +} + int udp_newudpcb(struct inpcb *); void udp_discardcb(struct udpcb *); void udp_ctlinput(int, struct sockaddr *, void *); +void udplite_ctlinput(int, struct sockaddr *, void *); int udp_ctloutput(struct socket *, struct sockopt *); void udp_init(void); +void udplite_init(void); #ifdef VIMAGE void udp_destroy(void); +void udplite_destroy(void); #endif void udp_input(struct mbuf *, int); +void udplite_input(struct mbuf *, int); struct inpcb *udp_notify(struct inpcb *inp, int errno); int udp_shutdown(struct socket *so); int udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f); -#endif -#endif +#endif /* _KERNEL */ + +#endif /* _NETINET_UDP_VAR_H_ */ Added: head/sys/netinet/udplite.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/udplite.h Mon Apr 7 01:53:03 2014 (r264212) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2014, Kevin Lo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NETINET_UDPLITE_H_ +#define _NETINET_UDPLITE_H_ + +/* + * User-settable options (used with setsockopt). + */ +#define UDPLITE_SEND_CSCOV 2 /* Sender checksum coverage. */ +#define UDPLITE_RECV_CSCOV 4 /* Receiver checksum coverage. */ + +#endif /* !_NETINET_UDPLITE_H_ */ Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Mon Apr 7 01:52:35 2014 (r264211) +++ head/sys/netinet6/in6_ifattach.c Mon Apr 7 01:53:03 2014 (r264212) @@ -829,6 +829,7 @@ in6_ifdetach(struct ifnet *ifp) } in6_pcbpurgeif0(&V_udbinfo, ifp); + in6_pcbpurgeif0(&V_ulitecbinfo, ifp); in6_pcbpurgeif0(&V_ripcbinfo, ifp); /* leave from all multicast groups joined */ in6_purgemaddrs(ifp); Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Mon Apr 7 01:52:35 2014 (r264211) +++ head/sys/netinet6/in6_proto.c Mon Apr 7 01:53:03 2014 (r264212) @@ -215,6 +215,19 @@ struct ip6protosw inet6sw[] = { }, #endif /* SCTP */ { + .pr_type = SOCK_DGRAM, + .pr_domain = &inet6domain, + .pr_protocol = IPPROTO_UDPLITE, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = udp6_input, + .pr_ctlinput = udplite6_ctlinput, + .pr_ctloutput = udp_ctloutput, +#ifndef INET /* Do not call initialization twice. */ + .pr_init = udplite_init, +#endif + .pr_usrreqs = &udp6_usrreqs, +}, +{ .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_RAW, Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Mon Apr 7 01:52:35 2014 (r264211) +++ head/sys/netinet6/udp6_usrreq.c Mon Apr 7 01:53:03 2014 (r264212) @@ -1,6 +1,7 @@ /*- * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * Copyright (c) 2010-2011 Juniper Networks, Inc. + * Copyright (c) 2014 Kevin Lo * All rights reserved. * * Portions of this software were developed by Robert N. M. Watson under @@ -109,6 +110,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -181,12 +183,15 @@ udp6_input(struct mbuf **mp, int *offp, struct ip6_hdr *ip6; struct udphdr *uh; struct inpcb *inp; + struct inpcbinfo *pcbinfo; struct udpcb *up; int off = *offp; + int cscov_partial; int plen, ulen; struct sockaddr_in6 fromsa; struct m_tag *fwd_tag; uint16_t uh_sum; + uint8_t nxt; ifp = m->m_pkthdr.rcvif; ip6 = mtod(m, struct ip6_hdr *); @@ -218,6 +223,13 @@ udp6_input(struct mbuf **mp, int *offp, plen = ntohs(ip6->ip6_plen) - off + sizeof(*ip6); ulen = ntohs((u_short)uh->uh_ulen); + nxt = ip6->ip6_nxt; + cscov_partial = (nxt == IPPROTO_UDPLITE) ? 1 : 0; + if (nxt == IPPROTO_UDPLITE && ulen == 0) { + /* Zero means checksum over the complete packet. */ + ulen = plen; + cscov_partial = 0; + } if (plen != ulen) { UDPSTAT_INC(udps_badlen); goto badunlocked; @@ -227,19 +239,22 @@ udp6_input(struct mbuf **mp, int *offp, * Checksum extended UDP header and data. */ if (uh->uh_sum == 0) { - UDPSTAT_INC(udps_nosum); - goto badunlocked; + if (ulen > plen || ulen < sizeof(struct udphdr)) { + UDPSTAT_INC(udps_nosum); + goto badunlocked; + } } - if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID_IPV6) { + if ((m->m_pkthdr.csum_flags & CSUM_DATA_VALID_IPV6) && + !cscov_partial) { if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) uh_sum = m->m_pkthdr.csum_data; else - uh_sum = in6_cksum_pseudo(ip6, ulen, - IPPROTO_UDP, m->m_pkthdr.csum_data); + uh_sum = in6_cksum_pseudo(ip6, ulen, nxt, + m->m_pkthdr.csum_data); uh_sum ^= 0xffff; } else - uh_sum = in6_cksum(m, IPPROTO_UDP, off, ulen); + uh_sum = in6_cksum(m, nxt, off, ulen); if (uh_sum != 0) { UDPSTAT_INC(udps_badsum); @@ -252,11 +267,13 @@ udp6_input(struct mbuf **mp, int *offp, init_sin6(&fromsa, m); fromsa.sin6_port = uh->uh_sport; + pcbinfo = get_inpcbinfo(nxt); if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { struct inpcb *last; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 01:55:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD116A45; Mon, 7 Apr 2014 01:55:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 810A0854; Mon, 7 Apr 2014 01:55:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s371tsK3065329; Mon, 7 Apr 2014 01:55:54 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s371trr1065312; Mon, 7 Apr 2014 01:55:53 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201404070155.s371trr1065312@svn.freebsd.org> From: Kevin Lo Date: Mon, 7 Apr 2014 01:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264213 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 01:55:54 -0000 Author: kevlo Date: Mon Apr 7 01:55:53 2014 New Revision: 264213 URL: http://svnweb.freebsd.org/changeset/base/264213 Log: Minor style cleanups. Modified: head/sys/netinet/udp_usrreq.c head/sys/netinet/udp_var.h head/sys/netinet6/in6_proto.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Mon Apr 7 01:53:03 2014 (r264212) +++ head/sys/netinet/udp_usrreq.c Mon Apr 7 01:55:53 2014 (r264213) @@ -403,7 +403,7 @@ udp_input(struct mbuf *m, int off) */ ip = mtod(m, struct ip *); if (m->m_len < iphlen + sizeof(struct udphdr)) { - if ((m = m_pullup(m, iphlen + sizeof(struct udphdr))) == 0) { + if ((m = m_pullup(m, iphlen + sizeof(struct udphdr))) == NULL) { UDPSTAT_INC(udps_hdrops); return; } Modified: head/sys/netinet/udp_var.h ============================================================================== --- head/sys/netinet/udp_var.h Mon Apr 7 01:53:03 2014 (r264212) +++ head/sys/netinet/udp_var.h Mon Apr 7 01:55:53 2014 (r264213) @@ -158,24 +158,24 @@ get_pcblist(uint8_t protocol) return (protocol == IPPROTO_UDP) ? &V_udb : &V_ulitecb; } -int udp_newudpcb(struct inpcb *); -void udp_discardcb(struct udpcb *); +int udp_newudpcb(struct inpcb *); +void udp_discardcb(struct udpcb *); -void udp_ctlinput(int, struct sockaddr *, void *); -void udplite_ctlinput(int, struct sockaddr *, void *); -int udp_ctloutput(struct socket *, struct sockopt *); -void udp_init(void); -void udplite_init(void); +void udp_ctlinput(int, struct sockaddr *, void *); +void udplite_ctlinput(int, struct sockaddr *, void *); +int udp_ctloutput(struct socket *, struct sockopt *); +void udp_init(void); +void udplite_init(void); #ifdef VIMAGE -void udp_destroy(void); -void udplite_destroy(void); +void udp_destroy(void); +void udplite_destroy(void); #endif -void udp_input(struct mbuf *, int); -void udplite_input(struct mbuf *, int); +void udp_input(struct mbuf *, int); +void udplite_input(struct mbuf *, int); struct inpcb *udp_notify(struct inpcb *inp, int errno); -int udp_shutdown(struct socket *so); +int udp_shutdown(struct socket *so); -int udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f); +int udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f); #endif /* _KERNEL */ Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Mon Apr 7 01:53:03 2014 (r264212) +++ head/sys/netinet6/in6_proto.c Mon Apr 7 01:55:53 2014 (r264213) @@ -208,7 +208,7 @@ struct ip6protosw inet6sw[] = { .pr_protocol = IPPROTO_SCTP, .pr_flags = PR_WANTRCVD, .pr_input = sctp6_input, - .pr_ctlinput = sctp6_ctlinput, + .pr_ctlinput = sctp6_ctlinput, .pr_ctloutput = sctp_ctloutput, .pr_drain = sctp_drain, .pr_usrreqs = &sctp6_usrreqs From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 01:57:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD892CD4; Mon, 7 Apr 2014 01:57:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA40B868; Mon, 7 Apr 2014 01:57:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s371vqHB065598; Mon, 7 Apr 2014 01:57:52 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s371vqfB065596; Mon, 7 Apr 2014 01:57:52 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201404070157.s371vqfB065596@svn.freebsd.org> From: Kevin Lo Date: Mon, 7 Apr 2014 01:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264215 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 01:57:52 -0000 Author: kevlo Date: Mon Apr 7 01:57:51 2014 New Revision: 264215 URL: http://svnweb.freebsd.org/changeset/base/264215 Log: Add man page for udplite(4). Added: head/share/man/man4/udplite.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Apr 7 01:55:54 2014 (r264214) +++ head/share/man/man4/Makefile Mon Apr 7 01:57:51 2014 (r264215) @@ -510,6 +510,7 @@ MAN= aac.4 \ udav.4 \ udbp.4 \ udp.4 \ + udplite.4 \ uep.4 \ ufm.4 \ ufoma.4 \ Added: head/share/man/man4/udplite.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/udplite.4 Mon Apr 7 01:57:51 2014 (r264215) @@ -0,0 +1,96 @@ +.\" Copyright (c) 2014, Kevin Lo. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 7, 2014 +.Dt UDPLITE 4 +.Os +.Sh NAME +.Nm udplite +.Nd Lightweight User Datagram Protocol +.Sh SYNOPSIS +.In sys/types.h +.In sys/socket.h +.In netinet/udplite.h +.Ft int +.Fn socket AF_INET SOCK_STREAM IPPROTO_UDPLITE +.Sh DESCRIPTION +The +.Tn UDP-Lite +protocol provides a partial checksum which allows +corrupted packets to be transmitted to the receiving +application. +This has advantages for some types of multimedia +transport that may be able to make use of slightly +damaged datagrams, rather than having them discarded +by lower-layer protocols. +.Pp +.Tn UDP-Lite +supports a number of socket options which can be set with +.Xr setsockopt 2 +and tested with +.Xr getsockopt 2 : +.Bl -tag -width ".Dv SCTP_SET_PEER_PRIMARY_ADDR" +.It Dv UDPLITE_SEND_CSCOV +This option sets the sender checksum coverage. +A value of zero indicates that the entire packet +is covered by the checksum. +A value of 1 to 7 must be discarded by the receiver. +.It Dv UDPLITE_RECV_CSCOV +This option is the receiver-side analogue. +It is truly optional, i.e. not required to enable traffic +with partial checksum coverage. +Its function is that of a traffic filter: +when enabled, it instructs the kernel to drop +all packets which have a coverage less than this value. +.El +.Sh ERRORS +A socket operation may fail with one of the following errors returned: +.Bl -tag -width Er +.It Bq Er EISCONN +when trying to establish a connection on a socket which +already has one, or when trying to send a datagram with the destination +address specified and the socket is already connected; +.It Bq Er ENOTCONN +when trying to send a datagram, but +no destination address is specified, and the socket has not been +connected; +.It Bq Er ENOBUFS +when the system runs out of memory for +an internal data structure; +.It Bq Er EADDRINUSE +when an attempt +is made to create a socket with a port which has already been +allocated; +.It Bq Er EADDRNOTAVAIL +when an attempt is made to create a +socket with a network address for which no network interface +exists. +.El +.Sh SEE ALSO +.Xr getsockopt 2 , +.Xr recv 2 , +.Xr send 2 , +.Xr socket 2 From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 02:31:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2E8B2C7; Mon, 7 Apr 2014 02:31:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5E34AF4; Mon, 7 Apr 2014 02:31:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s372VAMO080279; Mon, 7 Apr 2014 02:31:10 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s372VAW8080275; Mon, 7 Apr 2014 02:31:10 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404070231.s372VAW8080275@svn.freebsd.org> From: Eitan Adler Date: Mon, 7 Apr 2014 02:31:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264216 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 02:31:11 -0000 Author: eadler Date: Mon Apr 7 02:31:10 2014 New Revision: 264216 URL: http://svnweb.freebsd.org/changeset/base/264216 Log: units(1): make -V print version instead of -v The units program is likely little used. It is even less likely that a script will want the units program to print out its version number by passing -v. GNU units uses -V for version and -v for verbosity. Increase compatibility between these two versions (written by the same author) by switching our flag as well. Take this opportunity to remove bogus information about the version number and just call it 'FreeBSD units'. Discussed with: cperciva, rwatson Modified: head/usr.bin/units/units.1 head/usr.bin/units/units.c Modified: head/usr.bin/units/units.1 ============================================================================== --- head/usr.bin/units/units.1 Mon Apr 7 01:57:51 2014 (r264215) +++ head/usr.bin/units/units.1 Mon Apr 7 02:31:10 2014 (r264216) @@ -8,7 +8,7 @@ .Sh SYNOPSIS .Nm .Op Fl f Ar filename -.Op Fl qv +.Op Fl qV .Op Ar from-unit to-unit .Sh OPTIONS The following options are available: @@ -18,8 +18,8 @@ Specify the name of the units data file .It Fl q Suppress prompting of the user for units and the display of statistics about the number of units loaded. -.It Fl v -Print the version number. +.It Fl V +Print the version number, usage, and then exit. .It Ar from-unit to-unit Allow a single unit conversion to be done directly from the command line. Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Mon Apr 7 01:57:51 2014 (r264215) +++ head/usr.bin/units/units.c Mon Apr 7 02:31:10 2014 (r264216) @@ -32,8 +32,6 @@ static const char rcsid[] = #include "pathnames.h" -#define VERSION "1.0" - #ifndef UNITSFILE #define UNITSFILE _PATH_UNITSLIB #endif @@ -689,7 +687,7 @@ main(int argc, char **argv) char *userfile = 0; int quiet = 0; - while ((optchar = getopt(argc, argv, "vqf:")) != -1) { + while ((optchar = getopt(argc, argv, "Vqf:")) != -1) { switch (optchar) { case 'f': userfile = optarg; @@ -697,14 +695,12 @@ main(int argc, char **argv) case 'q': quiet = 1; break; - case 'v': - fprintf(stderr, "\n units version %s Copyright (c) 1993 by Adrian Mariano\n", - VERSION); - fprintf(stderr, " This program may be freely distributed\n"); + case 'V': + fprintf(stderr, "FreeBSD units\n"); usage(); + break; default: usage(); - break; } } From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 05:18:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9A1F6C3; Mon, 7 Apr 2014 05:18:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6918A49; Mon, 7 Apr 2014 05:18:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s375IRck047700; Mon, 7 Apr 2014 05:18:27 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s375IRqW047699; Mon, 7 Apr 2014 05:18:27 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201404070518.s375IRqW047699@svn.freebsd.org> From: Rui Paulo Date: Mon, 7 Apr 2014 05:18:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264218 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 05:18:27 -0000 Author: rpaulo Date: Mon Apr 7 05:18:27 2014 New Revision: 264218 URL: http://svnweb.freebsd.org/changeset/base/264218 Log: Use a more professional device description. Modified: head/sys/dev/uart/uart_dev_imx.c Modified: head/sys/dev/uart/uart_dev_imx.c ============================================================================== --- head/sys/dev/uart/uart_dev_imx.c Mon Apr 7 02:36:30 2014 (r264217) +++ head/sys/dev/uart/uart_dev_imx.c Mon Apr 7 05:18:27 2014 (r264218) @@ -352,7 +352,7 @@ imx_uart_bus_probe(struct uart_softc *sc sc->sc_rxfifosz = 1; sc->sc_txfifosz = 1; - device_set_desc(sc->sc_dev, "imx_uart"); + device_set_desc(sc->sc_dev, "Freescale i.MX UART"); return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 05:33:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C8CAA24; Mon, 7 Apr 2014 05:33:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C321AD9; Mon, 7 Apr 2014 05:33:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s375XXRh051417; Mon, 7 Apr 2014 05:33:33 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s375XVs3051406; Mon, 7 Apr 2014 05:33:31 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201404070533.s375XVs3051406@svn.freebsd.org> From: Rui Paulo Date: Mon, 7 Apr 2014 05:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264219 - in head/sys/arm: cavium cavium/cns11xx conf econa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 05:33:33 -0000 Author: rpaulo Date: Mon Apr 7 05:33:30 2014 New Revision: 264219 URL: http://svnweb.freebsd.org/changeset/base/264219 Log: Move sys/arm/econa to sys/arm/cavium/cns11xx. Added: head/sys/arm/cavium/ head/sys/arm/cavium/cns11xx/ - copied from r264142, head/sys/arm/econa/ Deleted: head/sys/arm/econa/ Modified: head/sys/arm/cavium/cns11xx/cfi_bus_econa.c head/sys/arm/cavium/cns11xx/files.econa head/sys/arm/cavium/cns11xx/if_ece.c head/sys/arm/cavium/cns11xx/ohci_ec.c head/sys/arm/cavium/cns11xx/std.econa head/sys/arm/cavium/cns11xx/uart_bus_ec.c head/sys/arm/cavium/cns11xx/uart_cpu_ec.c head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/NOTES Modified: head/sys/arm/cavium/cns11xx/cfi_bus_econa.c ============================================================================== --- head/sys/arm/econa/cfi_bus_econa.c Sat Apr 5 03:01:29 2014 (r264142) +++ head/sys/arm/cavium/cns11xx/cfi_bus_econa.c Mon Apr 7 05:33:30 2014 (r264219) @@ -40,8 +40,8 @@ __FBSDID("$FreeBSD$"); #include -#include -#include +#include +#include static int cfi_econa_probe(device_t dev) Modified: head/sys/arm/cavium/cns11xx/files.econa ============================================================================== --- head/sys/arm/econa/files.econa Sat Apr 5 03:01:29 2014 (r264142) +++ head/sys/arm/cavium/cns11xx/files.econa Mon Apr 7 05:33:30 2014 (r264219) @@ -1,13 +1,13 @@ # $FreeBSD$ arm/arm/cpufunc_asm_fa526.S standard -arm/econa/econa_machdep.c standard -arm/econa/econa.c standard -arm/econa/timer.c standard -arm/econa/uart_bus_ec.c optional uart -arm/econa/uart_cpu_ec.c optional uart +arm/cavium/cns11xx/econa_machdep.c standard +arm/cavium/cns11xx/econa.c standard +arm/cavium/cns11xx/timer.c standard +arm/cavium/cns11xx/uart_bus_ec.c optional uart +arm/cavium/cns11xx/uart_cpu_ec.c optional uart dev/uart/uart_dev_ns8250.c optional uart arm/arm/bus_space_generic.c standard -arm/econa/ehci_ebus.c optional ehci -arm/econa/ohci_ec.c optional ohci -arm/econa/if_ece.c standard -arm/econa/cfi_bus_econa.c optional cfi +arm/cavium/cns11xx/ehci_ebus.c optional ehci +arm/cavium/cns11xx/ohci_ec.c optional ohci +arm/cavium/cns11xx/if_ece.c standard +arm/cavium/cns11xx/cfi_bus_econa.c optional cfi Modified: head/sys/arm/cavium/cns11xx/if_ece.c ============================================================================== --- head/sys/arm/econa/if_ece.c Sat Apr 5 03:01:29 2014 (r264142) +++ head/sys/arm/cavium/cns11xx/if_ece.c Mon Apr 7 05:33:30 2014 (r264219) @@ -62,9 +62,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include +#include +#include +#include #include #include Modified: head/sys/arm/cavium/cns11xx/ohci_ec.c ============================================================================== --- head/sys/arm/econa/ohci_ec.c Sat Apr 5 03:01:29 2014 (r264142) +++ head/sys/arm/cavium/cns11xx/ohci_ec.c Mon Apr 7 05:33:30 2014 (r264219) @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #define MEM_RID 0 Modified: head/sys/arm/cavium/cns11xx/std.econa ============================================================================== --- head/sys/arm/econa/std.econa Sat Apr 5 03:01:29 2014 (r264142) +++ head/sys/arm/cavium/cns11xx/std.econa Mon Apr 7 05:33:30 2014 (r264219) @@ -1,6 +1,6 @@ # $FreeBSD$ -files "../econa/files.econa" +files "../cavium/cns11xx/files.econa" cpu CPU_FA526 machine arm makeoptions CONF_CFLAGS=-march=armv4 Modified: head/sys/arm/cavium/cns11xx/uart_bus_ec.c ============================================================================== --- head/sys/arm/econa/uart_bus_ec.c Sat Apr 5 03:01:29 2014 (r264142) +++ head/sys/arm/cavium/cns11xx/uart_bus_ec.c Mon Apr 7 05:33:30 2014 (r264219) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include static int uart_ec_probe(device_t dev); Modified: head/sys/arm/cavium/cns11xx/uart_cpu_ec.c ============================================================================== --- head/sys/arm/econa/uart_cpu_ec.c Sat Apr 5 03:01:29 2014 (r264142) +++ head/sys/arm/cavium/cns11xx/uart_cpu_ec.c Mon Apr 7 05:33:30 2014 (r264219) @@ -43,8 +43,8 @@ __FBSDID("$FreeBSD$"); #include -#include -#include +#include +#include bus_space_tag_t uart_bus_space_io; bus_space_tag_t uart_bus_space_mem; Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Mon Apr 7 05:18:27 2014 (r264218) +++ head/sys/arm/conf/CNS11XXNAS Mon Apr 7 05:33:30 2014 (r264219) @@ -26,7 +26,7 @@ ident CNS11XXNAS #options FLASHADDR=0x50000000 #options LOADERRAMADDR=0x00000000 -include "../econa/std.econa" +include "../cavium/cns11xx/std.econa" makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/conf/NOTES ============================================================================== --- head/sys/arm/conf/NOTES Mon Apr 7 05:18:27 2014 (r264218) +++ head/sys/arm/conf/NOTES Mon Apr 7 05:33:30 2014 (r264219) @@ -13,7 +13,7 @@ cpu CPU_XSCALE_IXP435 cpu CPU_XSCALE_PXA2X0 files "../at91/files.at91" -files "../econa/files.econa" +files "../cavium/cns11xx/files.econa" files "../mv/files.mv" files "../mv/discovery/files.db78xxx" files "../mv/kirkwood/files.kirkwood" From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 07:06:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 061CE8EF; Mon, 7 Apr 2014 07:06:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCA44220; Mon, 7 Apr 2014 07:06:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3776Dbn087035; Mon, 7 Apr 2014 07:06:13 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3776D05087034; Mon, 7 Apr 2014 07:06:13 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201404070706.s3776D05087034@svn.freebsd.org> From: Martin Matuska Date: Mon, 7 Apr 2014 07:06:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264220 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 07:06:14 -0000 Author: mm Date: Mon Apr 7 07:06:13 2014 New Revision: 264220 URL: http://svnweb.freebsd.org/changeset/base/264220 Log: Merge from projects/pf r264198: Execute pf_overload_task() in vnet context. Fixes a vnet kernel panic. Reviewed by: trociny MFC after: 1 week Modified: head/sys/netpfil/pf/pf.c Directory Properties: head/sys/ (props changed) Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Mon Apr 7 05:33:30 2014 (r264219) +++ head/sys/netpfil/pf/pf.c Mon Apr 7 07:06:13 2014 (r264220) @@ -284,7 +284,7 @@ static int pf_addr_wrap_neq(struct pf_ static struct pf_state *pf_find_state(struct pfi_kif *, struct pf_state_key_cmp *, u_int); static int pf_src_connlimit(struct pf_state **); -static void pf_overload_task(void *c, int pending); +static void pf_overload_task(void *v, int pending); static int pf_insert_src_node(struct pf_src_node **, struct pf_rule *, struct pf_addr *, sa_family_t); static u_int pf_purge_expired_states(u_int, int); @@ -516,16 +516,18 @@ pf_src_connlimit(struct pf_state **state } static void -pf_overload_task(void *c, int pending) +pf_overload_task(void *v, int pending) { struct pf_overload_head queue; struct pfr_addr p; struct pf_overload_entry *pfoe, *pfoe1; uint32_t killed = 0; + CURVNET_SET((struct vnet *)v); + PF_OVERLOADQ_LOCK(); - queue = *(struct pf_overload_head *)c; - SLIST_INIT((struct pf_overload_head *)c); + queue = V_pf_overloadqueue; + SLIST_INIT(&V_pf_overloadqueue); PF_OVERLOADQ_UNLOCK(); bzero(&p, sizeof(p)); @@ -569,8 +571,10 @@ pf_overload_task(void *c, int pending) V_pf_status.lcounters[LCNT_OVERLOAD_FLUSH]++; /* If nothing to flush, return. */ - if (SLIST_EMPTY(&queue)) + if (SLIST_EMPTY(&queue)) { + CURVNET_RESTORE(); return; + } for (int i = 0; i <= pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; @@ -599,6 +603,8 @@ pf_overload_task(void *c, int pending) free(pfoe, M_PFTEMP); if (V_pf_status.debug >= PF_DEBUG_MISC) printf("%s: %u states killed", __func__, killed); + + CURVNET_RESTORE(); } /* @@ -795,7 +801,7 @@ pf_initialize() /* Send & overload+flush queues. */ STAILQ_INIT(&V_pf_sendqueue); SLIST_INIT(&V_pf_overloadqueue); - TASK_INIT(&V_pf_overloadtask, 0, pf_overload_task, &V_pf_overloadqueue); + TASK_INIT(&V_pf_overloadtask, 0, pf_overload_task, curvnet); mtx_init(&pf_sendqueue_mtx, "pf send queue", NULL, MTX_DEF); mtx_init(&pf_overloadqueue_mtx, "pf overload/flush queue", NULL, MTX_DEF); From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 15:13:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD3E048E; Mon, 7 Apr 2014 15:13:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DCF3BD7; Mon, 7 Apr 2014 15:13:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s37FDPsY000493; Mon, 7 Apr 2014 15:13:25 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s37FDPGG000491; Mon, 7 Apr 2014 15:13:25 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201404071513.s37FDPGG000491@svn.freebsd.org> From: Scott Long Date: Mon, 7 Apr 2014 15:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264229 - head/sys/dev/mps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 15:13:25 -0000 Author: scottl Date: Mon Apr 7 15:13:24 2014 New Revision: 264229 URL: http://svnweb.freebsd.org/changeset/base/264229 Log: Add some assertions to ensure that the target array doesn't get accessed out of bounds. Obtained from: Netflix, Inc. MFC after: 3 days Modified: head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_sas.h Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Mon Apr 7 13:03:58 2014 (r264228) +++ head/sys/dev/mps/mps_sas.c Mon Apr 7 15:13:24 2014 (r264229) @@ -154,7 +154,7 @@ mpssas_find_target_by_handle(struct mpss struct mpssas_target *target; int i; - for (i = start; i < sassc->sc->facts->MaxTargets; i++) { + for (i = start; i < sassc->maxtargets; i++) { target = &sassc->targets[i]; if (target->handle == handle) return (target); @@ -709,8 +709,16 @@ mps_attach_sas(struct mps_softc *sc) __func__, __LINE__); return (ENOMEM); } + + /* + * XXX MaxTargets could change during a reinit. Since we don't + * resize the targets[] array during such an event, cache the value + * of MaxTargets here so that we don't get into trouble later. This + * should move into the reinit logic. + */ + sassc->maxtargets = sc->facts->MaxTargets; sassc->targets = malloc(sizeof(struct mpssas_target) * - sc->facts->MaxTargets, M_MPT2, M_WAITOK|M_ZERO); + sassc->maxtargets, M_MPT2, M_WAITOK|M_ZERO); if(!sassc->targets) { device_printf(sc->mps_dev, "Cannot allocate memory %s %d\n", __func__, __LINE__); @@ -868,7 +876,7 @@ mps_detach_sas(struct mps_softc *sc) if (sassc->devq != NULL) cam_simq_free(sassc->devq); - for(i=0; i< sc->facts->MaxTargets ;i++) { + for(i=0; i< sassc->maxtargets ;i++) { targ = &sassc->targets[i]; SLIST_FOREACH_SAFE(lun, &targ->luns, lun_link, lun_tmp) { free(lun, M_MPT2); @@ -959,9 +967,9 @@ mpssas_action(struct cam_sim *sim, union cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; #endif cpi->hba_eng_cnt = 0; - cpi->max_target = sassc->sc->facts->MaxTargets - 1; + cpi->max_target = sassc->maxtargets - 1; cpi->max_lun = 255; - cpi->initiator_id = sassc->sc->facts->MaxTargets - 1; + cpi->initiator_id = sassc->maxtargets - 1; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "LSILogic", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); @@ -992,6 +1000,9 @@ mpssas_action(struct cam_sim *sim, union sas = &cts->xport_specific.sas; scsi = &cts->proto_specific.scsi; + KASSERT(cts->ccb_h.target_id < sassc->maxtargets, + ("Target %d out of bounds in XPT_GET_TRANS_SETTINGS\n", + cts->ccb_h.target_id)); targ = &sassc->targets[cts->ccb_h.target_id]; if (targ->handle == 0x0) { cts->ccb_h.status = CAM_SEL_TIMEOUT; @@ -1155,7 +1166,7 @@ mpssas_handle_reinit(struct mps_softc *s * reset, and we have to rediscover all the targets and use the new * handles. */ - for (i = 0; i < sc->facts->MaxTargets; i++) { + for (i = 0; i < sc->sassc->maxtargets; i++) { if (sc->sassc->targets[i].outstanding != 0) mps_dprint(sc, MPS_INIT, "target %u outstanding %u\n", i, sc->sassc->targets[i].outstanding); @@ -1631,6 +1642,9 @@ mpssas_action_scsiio(struct mpssas_softc mtx_assert(&sc->mps_mtx, MA_OWNED); csio = &ccb->csio; + KASSERT(csio->ccb_h.target_id < sassc->maxtargets, + ("Target %d out of bounds in XPT_SCSI_IO\n", + csio->ccb_h.target_id)); targ = &sassc->targets[csio->ccb_h.target_id]; mps_dprint(sc, MPS_TRACE, "ccb %p target flag %x\n", ccb, targ->flags); if (targ->handle == 0x0) { @@ -2929,6 +2943,8 @@ mpssas_action_smpio(struct mpssas_softc /* * Make sure the target exists. */ + KASSERT(ccb->ccb_h.target_id < sassc->maxtargets, + ("Target %d out of bounds in XPT_SMP_IO\n", ccb->ccb_h.target_id)); targ = &sassc->targets[ccb->ccb_h.target_id]; if (targ->handle == 0x0) { mps_dprint(sc, MPS_ERROR, @@ -3063,6 +3079,9 @@ mpssas_action_resetdev(struct mpssas_sof MPS_FUNCTRACE(sassc->sc); mtx_assert(&sassc->sc->mps_mtx, MA_OWNED); + KASSERT(ccb->ccb_h.target_id < sassc->maxtargets, + ("Target %d out of bounds in XPT_RESET_DEV\n", + ccb->ccb_h.target_id)); sc = sassc->sc; tm = mps_alloc_command(sc); if (tm == NULL) { @@ -3191,6 +3210,9 @@ mpssas_async(void *callback_arg, uint32_ /* * We should have a handle for this, but check to make sure. */ + KASSERT(xpt_path_target_id(path) < sassc->maxtargets, + ("Target %d out of bounds in mpssas_async\n", + xpt_path_target_id(path))); target = &sassc->targets[xpt_path_target_id(path)]; if (target->handle == 0) break; @@ -3278,6 +3300,9 @@ mpssas_check_eedp(struct mps_softc *sc, targetid = xpt_path_target_id(path); lunid = xpt_path_lun_id(path); + KASSERT(targetid < sassc->maxtargets, + ("Target %d out of bounds in mpssas_check_eedp\n", + targetid)); target = &sassc->targets[targetid]; if (target->handle == 0x0) return; @@ -3413,6 +3438,9 @@ mpssas_read_cap_done(struct cam_periph * * target. */ sassc = (struct mpssas_softc *)done_ccb->ccb_h.ppriv_ptr1; + KASSERT(done_ccb->ccb_h.target_id < sassc->maxtargets, + ("Target %d out of bounds in mpssas_read_cap_done\n", + done_ccb->ccb_h.target_id)); target = &sassc->targets[done_ccb->ccb_h.target_id]; SLIST_FOREACH(lun, &target->luns, lun_link) { if (lun->lun_id != done_ccb->ccb_h.target_lun) Modified: head/sys/dev/mps/mps_sas.h ============================================================================== --- head/sys/dev/mps/mps_sas.h Mon Apr 7 13:03:58 2014 (r264228) +++ head/sys/dev/mps/mps_sas.h Mon Apr 7 15:13:24 2014 (r264229) @@ -87,6 +87,7 @@ struct mpssas_softc { #define MPSSAS_DISCOVERY_TIMEOUT_PENDING (1 << 2) #define MPSSAS_QUEUE_FROZEN (1 << 3) #define MPSSAS_SHUTDOWN (1 << 4) + u_int maxtargets; struct mpssas_target *targets; struct cam_devq *devq; struct cam_sim *sim; From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 16:38:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6124122D; Mon, 7 Apr 2014 16:38:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31DC46B9; Mon, 7 Apr 2014 16:38:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s37GcXmh036027; Mon, 7 Apr 2014 16:38:33 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s37GcWHX036022; Mon, 7 Apr 2014 16:38:32 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404071638.s37GcWHX036022@svn.freebsd.org> From: Warner Losh Date: Mon, 7 Apr 2014 16:38:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264230 - in head/sys/boot/fdt/dts: arm powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 16:38:33 -0000 Author: imp Date: Mon Apr 7 16:38:31 2014 New Revision: 264230 URL: http://svnweb.freebsd.org/changeset/base/264230 Log: These were bogusly placed in the arm directory. Move them to their proper location in powerpc directory. Added: head/sys/boot/fdt/dts/powerpc/p1020rdb.dts - copied, changed from r264229, head/sys/boot/fdt/dts/arm/p1020rdb.dts head/sys/boot/fdt/dts/powerpc/p2020ds.dts - copied, changed from r264229, head/sys/boot/fdt/dts/arm/p2020ds.dts head/sys/boot/fdt/dts/powerpc/p2041si.dtsi - copied, changed from r264229, head/sys/boot/fdt/dts/arm/p2041si.dtsi head/sys/boot/fdt/dts/powerpc/p3041si.dtsi - copied, changed from r264229, head/sys/boot/fdt/dts/arm/p3041si.dtsi head/sys/boot/fdt/dts/powerpc/p5020si.dtsi - copied, changed from r264229, head/sys/boot/fdt/dts/arm/p5020si.dtsi Deleted: head/sys/boot/fdt/dts/arm/p1020rdb.dts head/sys/boot/fdt/dts/arm/p2020ds.dts head/sys/boot/fdt/dts/arm/p2041si.dtsi head/sys/boot/fdt/dts/arm/p3041si.dtsi head/sys/boot/fdt/dts/arm/p5020si.dtsi Copied and modified: head/sys/boot/fdt/dts/powerpc/p1020rdb.dts (from r264229, head/sys/boot/fdt/dts/arm/p1020rdb.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/powerpc/p2020ds.dts (from r264229, head/sys/boot/fdt/dts/arm/p2020ds.dts) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/powerpc/p2041si.dtsi (from r264229, head/sys/boot/fdt/dts/arm/p2041si.dtsi) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/powerpc/p3041si.dtsi (from r264229, head/sys/boot/fdt/dts/arm/p3041si.dtsi) ============================================================================== Copied and modified: head/sys/boot/fdt/dts/powerpc/p5020si.dtsi (from r264229, head/sys/boot/fdt/dts/arm/p5020si.dtsi) ============================================================================== From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 18:10:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E07F8A0; Mon, 7 Apr 2014 18:10:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A528FBF; Mon, 7 Apr 2014 18:10:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s37IAoYV075925; Mon, 7 Apr 2014 18:10:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s37IAn6k075919; Mon, 7 Apr 2014 18:10:49 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201404071810.s37IAn6k075919@svn.freebsd.org> From: Ed Schouten Date: Mon, 7 Apr 2014 18:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264231 - in head: lib/libc/sys sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 18:10:51 -0000 Author: ed Date: Mon Apr 7 18:10:49 2014 New Revision: 264231 URL: http://svnweb.freebsd.org/changeset/base/264231 Log: Implement kqueue(2) for procdesc(4). kqueue(2) already supports EVFILT_PROC. Add an EVFILT_PROCDESC that behaves the same, but operates on a procdesc(4) instead. Only implement NOTE_EXIT for now. The nice thing about NOTE_EXIT is that it also returns the exit status of the process, meaning that we can now obtain this value, even if pdwait4(2) is still unimplemented. Notes: - Simply reuse EVFILT_NETDEV for EVFILT_PROCDESC. As both of these will be used on totally different descriptor types, this should not clash. - Let procdesc_kqops_event() reuse the same structure as filt_proc(). The only difference is that procdesc_kqops_event() should also be able to deal with the case where the process was already terminated after registration. Simply test this when hint == 0. - Fix some style(9) issues in filt_proc() to keep it consistent with the newly added procdesc_kqops_event(). - Save the exit status of the process in pd->pd_xstat, as we cannot pick up the proctree_lock from within procdesc_kqops_event(). Discussed on: arch@ Reviewed by: kib@ Modified: head/lib/libc/sys/kqueue.2 head/lib/libc/sys/pdfork.2 head/sys/kern/kern_event.c head/sys/kern/sys_procdesc.c head/sys/sys/event.h head/sys/sys/procdesc.h Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Mon Apr 7 16:38:31 2014 (r264230) +++ head/lib/libc/sys/kqueue.2 Mon Apr 7 18:10:49 2014 (r264231) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 4, 2013 +.Dd April 7, 2014 .Dt KQUEUE 2 .Os .Sh NAME @@ -412,6 +412,24 @@ and the child process will not signal a On return, .Va fflags contains the events which triggered the filter. +.It EVFILT_PROCDESC +Takes the process descriptor created by +.Xr pdfork 2 +to monitor as the identifier and the events to watch for in +.Va fflags , +and returns when the associated process performs one or more of the +requested events. +The events to monitor are: +.Bl -tag -width XXNOTE_EXIT +.It NOTE_EXIT +The process has exited. +The exit status will be stored in +.Va data . +.El +.Pp +On return, +.Va fflags +contains the events which triggered the filter. .It EVFILT_SIGNAL Takes the signal number to monitor as the identifier and returns when the given signal is delivered to the process. Modified: head/lib/libc/sys/pdfork.2 ============================================================================== --- head/lib/libc/sys/pdfork.2 Mon Apr 7 16:38:31 2014 (r264230) +++ head/lib/libc/sys/pdfork.2 Mon Apr 7 18:10:49 2014 (r264231) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 2014 +.Dd April 7, 2014 .Dt PDFORK 2 .Os .Sh NAME @@ -117,6 +117,13 @@ and allow waiting for process state transitions; currently only .Dv POLLHUP is defined, and will be raised when the process dies. +Process state transitions can also be monitored using +.Xr kqueue 2 +filter +.Dv EVFILT_PROCDESC ; +currently only +.Dv NOTE_EXIT +is implemented. .Pp .Xr close 2 will close the process descriptor unless Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Mon Apr 7 16:38:31 2014 (r264230) +++ head/sys/kern/kern_event.c Mon Apr 7 18:10:49 2014 (r264231) @@ -290,7 +290,7 @@ static struct { { &proc_filtops }, /* EVFILT_PROC */ { &sig_filtops }, /* EVFILT_SIGNAL */ { &timer_filtops }, /* EVFILT_TIMER */ - { &null_filtops }, /* former EVFILT_NETDEV */ + { &file_filtops }, /* EVFILT_PROCDESC */ { &fs_filtops }, /* EVFILT_FS */ { &null_filtops }, /* EVFILT_LIO */ { &user_filtops }, /* EVFILT_USER */ @@ -417,27 +417,22 @@ filt_procdetach(struct knote *kn) static int filt_proc(struct knote *kn, long hint) { - struct proc *p = kn->kn_ptr.p_proc; + struct proc *p; u_int event; - /* - * mask off extra data - */ + p = kn->kn_ptr.p_proc; + /* Mask off extra data. */ event = (u_int)hint & NOTE_PCTRLMASK; - /* - * if the user is interested in this event, record it. - */ + /* If the user is interested in this event, record it. */ if (kn->kn_sfflags & event) kn->kn_fflags |= event; - /* - * process is gone, so flag the event as finished. - */ + /* Process is gone, so flag the event as finished. */ if (event == NOTE_EXIT) { if (!(kn->kn_status & KN_DETACHED)) knlist_remove_inevent(&p->p_klist, kn); - kn->kn_flags |= (EV_EOF | EV_ONESHOT); + kn->kn_flags |= EV_EOF | EV_ONESHOT; kn->kn_ptr.p_proc = NULL; if (kn->kn_fflags & NOTE_EXIT) kn->kn_data = p->p_xstat; Modified: head/sys/kern/sys_procdesc.c ============================================================================== --- head/sys/kern/sys_procdesc.c Mon Apr 7 16:38:31 2014 (r264230) +++ head/sys/kern/sys_procdesc.c Mon Apr 7 18:10:49 2014 (r264231) @@ -236,6 +236,7 @@ procdesc_new(struct proc *p, int flags) if (flags & PD_DAEMON) pd->pd_flags |= PDF_DAEMON; PROCDESC_LOCK_INIT(pd); + knlist_init_mtx(&pd->pd_selinfo.si_note, &pd->pd_lock); /* * Process descriptors start out with two references: one from their @@ -270,6 +271,7 @@ procdesc_free(struct procdesc *pd) KASSERT((pd->pd_flags & PDF_CLOSED), ("procdesc_free: !PDF_CLOSED")); + knlist_destroy(&pd->pd_selinfo.si_note); PROCDESC_LOCK_DESTROY(pd); uma_zfree(procdesc_zone, pd); } @@ -296,6 +298,7 @@ procdesc_exit(struct proc *p) ("procdesc_exit: closed && parent not init")); pd->pd_flags |= PDF_EXITED; + pd->pd_xstat = p->p_xstat; /* * If the process descriptor has been closed, then we have nothing @@ -314,6 +317,7 @@ procdesc_exit(struct proc *p) pd->pd_flags &= ~PDF_SELECTED; selwakeup(&pd->pd_selinfo); } + KNOTE_LOCKED(&pd->pd_selinfo.si_note, NOTE_EXIT); PROCDESC_UNLOCK(pd); return (0); } @@ -460,11 +464,71 @@ procdesc_poll(struct file *fp, int event return (revents); } +static void +procdesc_kqops_detach(struct knote *kn) +{ + struct procdesc *pd; + + pd = kn->kn_fp->f_data; + knlist_remove(&pd->pd_selinfo.si_note, kn, 0); +} + +static int +procdesc_kqops_event(struct knote *kn, long hint) +{ + struct procdesc *pd; + u_int event; + + pd = kn->kn_fp->f_data; + if (hint == 0) { + /* + * Initial test after registration. Generate a NOTE_EXIT in + * case the process already terminated before registration. + */ + event = pd->pd_flags & PDF_EXITED ? NOTE_EXIT : 0; + } else { + /* Mask off extra data. */ + event = (u_int)hint & NOTE_PCTRLMASK; + } + + /* If the user is interested in this event, record it. */ + if (kn->kn_sfflags & event) + kn->kn_fflags |= event; + + /* Process is gone, so flag the event as finished. */ + if (event == NOTE_EXIT) { + kn->kn_flags |= EV_EOF | EV_ONESHOT; + if (kn->kn_fflags & NOTE_EXIT) + kn->kn_data = pd->pd_xstat; + if (kn->kn_fflags == 0) + kn->kn_flags |= EV_DROP; + return (1); + } + + return (kn->kn_fflags != 0); +} + +static struct filterops procdesc_kqops = { + .f_isfd = 1, + .f_detach = procdesc_kqops_detach, + .f_event = procdesc_kqops_event, +}; + static int procdesc_kqfilter(struct file *fp, struct knote *kn) { + struct procdesc *pd; - return (EOPNOTSUPP); + pd = fp->f_data; + switch (kn->kn_filter) { + case EVFILT_PROCDESC: + kn->kn_fop = &procdesc_kqops; + kn->kn_flags |= EV_CLEAR; + knlist_add(&pd->pd_selinfo.si_note, kn, 0); + return (0); + default: + return (EINVAL); + } } static int Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Mon Apr 7 16:38:31 2014 (r264230) +++ head/sys/sys/event.h Mon Apr 7 18:10:49 2014 (r264231) @@ -38,7 +38,7 @@ #define EVFILT_PROC (-5) /* attached to struct proc */ #define EVFILT_SIGNAL (-6) /* attached to struct proc */ #define EVFILT_TIMER (-7) /* timers */ -/* EVFILT_NETDEV (-8) no longer supported */ +#define EVFILT_PROCDESC (-8) /* attached to process descriptors */ #define EVFILT_FS (-9) /* filesystem events */ #define EVFILT_LIO (-10) /* attached to lio requests */ #define EVFILT_USER (-11) /* User events */ @@ -120,7 +120,7 @@ struct kevent { #define NOTE_REVOKE 0x0040 /* vnode access was revoked */ /* - * data/hint flags for EVFILT_PROC, shared with userspace + * data/hint flags for EVFILT_PROC and EVFILT_PROCDESC, shared with userspace */ #define NOTE_EXIT 0x80000000 /* process exited */ #define NOTE_FORK 0x40000000 /* process forked */ Modified: head/sys/sys/procdesc.h ============================================================================== --- head/sys/sys/procdesc.h Mon Apr 7 16:38:31 2014 (r264230) +++ head/sys/sys/procdesc.h Mon Apr 7 18:10:49 2014 (r264231) @@ -68,6 +68,7 @@ struct procdesc { * In-flight data and notification of events. */ int pd_flags; /* (p) PD_ flags. */ + u_short pd_xstat; /* (p) Exit status. */ struct selinfo pd_selinfo; /* (p) Event notification. */ struct mtx pd_lock; /* Protect data + events. */ }; From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 18:17:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A71ABB04; Mon, 7 Apr 2014 18:17:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 942CE6C; Mon, 7 Apr 2014 18:17:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s37IHVZI077453; Mon, 7 Apr 2014 18:17:31 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s37IHVfF077452; Mon, 7 Apr 2014 18:17:31 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201404071817.s37IHVfF077452@svn.freebsd.org> From: Ed Schouten Date: Mon, 7 Apr 2014 18:17:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264232 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 18:17:31 -0000 Author: ed Date: Mon Apr 7 18:17:31 2014 New Revision: 264232 URL: http://svnweb.freebsd.org/changeset/base/264232 Log: Fix table alignment. EVFILT_PROCDESC is longer than the existing filters. Modified: head/lib/libc/sys/kqueue.2 Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Mon Apr 7 18:10:49 2014 (r264231) +++ head/lib/libc/sys/kqueue.2 Mon Apr 7 18:17:31 2014 (r264232) @@ -245,7 +245,7 @@ Arguments may be passed to and from the and .Va data fields in the kevent structure. -.Bl -tag -width EVFILT_SIGNAL +.Bl -tag -width EVFILT_PROCDESC .It EVFILT_READ Takes a descriptor as the identifier, and returns whenever there is data available to read. From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 19:05:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C114D8; Mon, 7 Apr 2014 19:05:16 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D72DE7CD; Mon, 7 Apr 2014 19:05:15 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E4132B96E; Mon, 7 Apr 2014 15:05:14 -0400 (EDT) From: John Baldwin To: Warner Losh Subject: Re: svn commit: r263749 - in head: . sys/amd64/conf sys/conf sys/i386/conf sys/sparc64/conf Date: Mon, 7 Apr 2014 15:05:09 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201403252208.s2PM8VXj019660@svn.freebsd.org> In-Reply-To: <201403252208.s2PM8VXj019660@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201404071505.09468.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 07 Apr 2014 15:05:15 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 19:05:16 -0000 On Tuesday, March 25, 2014 6:08:31 pm Warner Losh wrote: > Author: imp > Date: Tue Mar 25 22:08:31 2014 > New Revision: 263749 > URL: http://svnweb.freebsd.org/changeset/base/263749 > > Log: > Rather than require a makeoptions DEBUG to get debug correct, > add it in kern.mk, but only if we're using clang. While this > ... > Modified: head/sys/amd64/conf/GENERIC > ============================================================================== > --- head/sys/amd64/conf/GENERIC Tue Mar 25 21:57:50 2014 (r263748) > +++ head/sys/amd64/conf/GENERIC Tue Mar 25 22:08:31 2014 (r263749) > @@ -21,7 +21,7 @@ > cpu HAMMER > ident GENERIC > > -makeoptions DEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols > +makeoptions DEBUG=-g > makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support Did you mean to lose this comment in all these files? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 19:32:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FBE69C8; Mon, 7 Apr 2014 19:32:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B460A59; Mon, 7 Apr 2014 19:32:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s37JWv6g009905; Mon, 7 Apr 2014 19:32:57 GMT (envelope-from cy@svn.freebsd.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s37JWuIl009900; Mon, 7 Apr 2014 19:32:56 GMT (envelope-from cy@svn.freebsd.org) Message-Id: <201404071932.s37JWuIl009900@svn.freebsd.org> From: Cy Schubert Date: Mon, 7 Apr 2014 19:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264235 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 19:32:57 -0000 Author: cy Date: Mon Apr 7 19:32:56 2014 New Revision: 264235 URL: http://svnweb.freebsd.org/changeset/base/264235 Log: Implement the final missing sysctls by moving ipf_auth_softc_t from ip_auth.c to ip_auth.h. ip_frag_soft_t moves from ip_frag.c to ip_frag.h. mlfk_ipl.c creates sysctl MIBs that reference control blocks that are dynamically created when IP Filter is loaded. This necessitated creating them on-the-fly rather than statically at compile time. Approved by: glebius (mentor) Modified: head/sys/contrib/ipfilter/netinet/ip_auth.c head/sys/contrib/ipfilter/netinet/ip_auth.h head/sys/contrib/ipfilter/netinet/ip_frag.c head/sys/contrib/ipfilter/netinet/ip_frag.h head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Modified: head/sys/contrib/ipfilter/netinet/ip_auth.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_auth.c Mon Apr 7 19:02:47 2014 (r264234) +++ head/sys/contrib/ipfilter/netinet/ip_auth.c Mon Apr 7 19:32:56 2014 (r264235) @@ -131,33 +131,6 @@ static const char rcsid[] = "@(#)$FreeBS #endif - -typedef struct ipf_auth_softc_s { -#if SOLARIS && defined(_KERNEL) - kcondvar_t ipf_auth_wait; -#endif /* SOLARIS */ -#if defined(linux) && defined(_KERNEL) - wait_queue_head_t ipf_auth_next_linux; -#endif - ipfrwlock_t ipf_authlk; - ipfmutex_t ipf_auth_mx; - int ipf_auth_size; - int ipf_auth_used; - int ipf_auth_replies; - int ipf_auth_defaultage; - int ipf_auth_lock; - ipf_authstat_t ipf_auth_stats; - frauth_t *ipf_auth; - mb_t **ipf_auth_pkts; - int ipf_auth_start; - int ipf_auth_end; - int ipf_auth_next; - frauthent_t *ipf_auth_entries; - frentry_t *ipf_auth_ip; - frentry_t *ipf_auth_rules; -} ipf_auth_softc_t; - - static void ipf_auth_deref __P((frauthent_t **)); static void ipf_auth_deref_unlocked __P((ipf_auth_softc_t *, frauthent_t **)); static int ipf_auth_geniter __P((ipf_main_softc_t *, ipftoken_t *, Modified: head/sys/contrib/ipfilter/netinet/ip_auth.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_auth.h Mon Apr 7 19:02:47 2014 (r264234) +++ head/sys/contrib/ipfilter/netinet/ip_auth.h Mon Apr 7 19:32:56 2014 (r264235) @@ -49,6 +49,24 @@ typedef struct ipf_authstat { frauthent_t *fas_faelist; } ipf_authstat_t; +typedef struct ipf_auth_softc_s { + ipfrwlock_t ipf_authlk; + ipfmutex_t ipf_auth_mx; + int ipf_auth_size; + int ipf_auth_used; + int ipf_auth_replies; + int ipf_auth_defaultage; + int ipf_auth_lock; + ipf_authstat_t ipf_auth_stats; + frauth_t *ipf_auth; + mb_t **ipf_auth_pkts; + int ipf_auth_start; + int ipf_auth_end; + int ipf_auth_next; + frauthent_t *ipf_auth_entries; + frentry_t *ipf_auth_ip; + frentry_t *ipf_auth_rules; +} ipf_auth_softc_t; extern frentry_t *ipf_auth_check __P((fr_info_t *, u_32_t *)); extern void ipf_auth_expire __P((ipf_main_softc_t *)); Modified: head/sys/contrib/ipfilter/netinet/ip_frag.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_frag.c Mon Apr 7 19:02:47 2014 (r264234) +++ head/sys/contrib/ipfilter/netinet/ip_frag.c Mon Apr 7 19:32:56 2014 (r264235) @@ -91,27 +91,6 @@ static const char rcsid[] = "@(#)$FreeBS #endif -typedef struct ipf_frag_softc_s { - ipfrwlock_t ipfr_ipidfrag; - ipfrwlock_t ipfr_frag; - ipfrwlock_t ipfr_natfrag; - int ipfr_size; - int ipfr_ttl; - int ipfr_lock; - int ipfr_inited; - ipfr_t *ipfr_list; - ipfr_t **ipfr_tail; - ipfr_t *ipfr_natlist; - ipfr_t **ipfr_nattail; - ipfr_t *ipfr_ipidlist; - ipfr_t **ipfr_ipidtail; - ipfr_t **ipfr_heads; - ipfr_t **ipfr_nattab; - ipfr_t **ipfr_ipidtab; - ipfrstat_t ipfr_stats; -} ipf_frag_softc_t; - - #ifdef USE_MUTEXES static ipfr_t *ipfr_frag_new __P((ipf_main_softc_t *, ipf_frag_softc_t *, fr_info_t *, u_32_t, ipfr_t **, Modified: head/sys/contrib/ipfilter/netinet/ip_frag.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_frag.h Mon Apr 7 19:02:47 2014 (r264234) +++ head/sys/contrib/ipfilter/netinet/ip_frag.h Mon Apr 7 19:32:56 2014 (r264235) @@ -70,6 +70,26 @@ typedef struct ipfrstat { struct ipfr **ifs_nattab; } ipfrstat_t; +typedef struct ipf_frag_softc_s { + ipfrwlock_t ipfr_ipidfrag; + ipfrwlock_t ipfr_frag; + ipfrwlock_t ipfr_natfrag; + int ipfr_size; + int ipfr_ttl; + int ipfr_lock; + int ipfr_inited; + ipfr_t *ipfr_list; + ipfr_t **ipfr_tail; + ipfr_t *ipfr_natlist; + ipfr_t **ipfr_nattail; + ipfr_t *ipfr_ipidlist; + ipfr_t **ipfr_ipidtail; + ipfr_t **ipfr_heads; + ipfr_t **ipfr_nattab; + ipfr_t **ipfr_ipidtab; + ipfrstat_t ipfr_stats; +} ipf_frag_softc_t; + #define IPFR_CMPSZ (offsetof(ipfr_t, ipfr_pass) - \ offsetof(ipfr_t, ipfr_ifp)) Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Mon Apr 7 19:02:47 2014 (r264234) +++ head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Mon Apr 7 19:32:56 2014 (r264235) @@ -44,6 +44,8 @@ static dev_t ipf_devs[IPL_LOGSIZE]; static int sysctl_ipf_int ( SYSCTL_HANDLER_ARGS ); static int ipf_modload(void); static int ipf_modunload(void); +static int ipf_fbsd_sysctl_create(ipf_main_softc_t*); +static int ipf_fbsd_sysctl_destroy(ipf_main_softc_t*); #if (__FreeBSD_version >= 500024) # if (__FreeBSD_version >= 502116) @@ -70,59 +72,36 @@ SYSCTL_DECL(_net_inet); #define SYSCTL_IPF(parent, nbr, name, access, ptr, val, descr) \ SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, \ ptr, val, sysctl_ipf_int, "I", descr); +#define SYSCTL_DYN_IPF(parent, nbr, name, access,ptr, val, descr) \ + SYSCTL_ADD_OID(&ipf_clist, SYSCTL_STATIC_CHILDREN(parent), nbr, name, \ + CTLFLAG_DYN|CTLTYPE_INT|access, ptr, val, sysctl_ipf_int, "I", descr) +static struct sysctl_ctx_list ipf_clist; #define CTLFLAG_OFF 0x00800000 /* IPFilter must be disabled */ #define CTLFLAG_RWO (CTLFLAG_RW|CTLFLAG_OFF) SYSCTL_NODE(_net_inet, OID_AUTO, ipf, CTLFLAG_RW, 0, "IPF"); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_flags, CTLFLAG_RW, &ipfmain.ipf_flags, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, ipf_pass, CTLFLAG_RW, &ipfmain.ipf_pass, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_active, CTLFLAG_RD, &ipfmain.ipf_active, 0, ""); +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_flags, CTLFLAG_RW, &ipfmain.ipf_flags, 0, "IPF flags"); +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, ipf_pass, CTLFLAG_RW, &ipfmain.ipf_pass, 0, "default pass/block"); +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_active, CTLFLAG_RD, &ipfmain.ipf_active, 0, "IPF is active"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_tcpidletimeout, CTLFLAG_RWO, - &ipfmain.ipf_tcpidletimeout, 0, ""); + &ipfmain.ipf_tcpidletimeout, 0, "TCP idle timeout in seconds"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_tcphalfclosed, CTLFLAG_RWO, - &ipfmain.ipf_tcphalfclosed, 0, ""); + &ipfmain.ipf_tcphalfclosed, 0, "timeout for half closed TCP sessions"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_tcpclosewait, CTLFLAG_RWO, - &ipfmain.ipf_tcpclosewait, 0, ""); + &ipfmain.ipf_tcpclosewait, 0, "timeout for TCP sessions in closewait status"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_tcplastack, CTLFLAG_RWO, - &ipfmain.ipf_tcplastack, 0, ""); + &ipfmain.ipf_tcplastack, 0, "timeout for TCP sessions in last ack status"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_tcptimeout, CTLFLAG_RWO, &ipfmain.ipf_tcptimeout, 0, ""); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_tcpclosed, CTLFLAG_RWO, &ipfmain.ipf_tcpclosed, 0, ""); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_udptimeout, CTLFLAG_RWO, - &ipfmain.ipf_udptimeout, 0, ""); + &ipfmain.ipf_udptimeout, 0, "UDP timeout"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_udpacktimeout, CTLFLAG_RWO, &ipfmain.ipf_udpacktimeout, 0, ""); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_icmptimeout, CTLFLAG_RWO, - &ipfmain.ipf_icmptimeout, 0, ""); -#if 0 -/* this needs to be resolved at compile time */ -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_defnatage, CTLFLAG_RWO, - &((ipf_nat_softc_t *)ipfmain.ipf_nat_soft)->ipf_nat_defage, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_ipfrttl, CTLFLAG_RW, - &ipf_ipfrttl, 0, ""); -#endif -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, ipf_running, CTLFLAG_RD, - &ipfmain.ipf_running, 0, ""); -#if 0 -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_statesize, CTLFLAG_RWO, - &ipfmain.ipf_state_soft)->ipf_state_size, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_statemax, CTLFLAG_RWO, - &(ipfmain.ipf_state_soft)->ipf_state_max, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, ipf_nattable_sz, CTLFLAG_RWO, - &(ipfmain.ipf_nat_soft)->ipf_nat_table_sz, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, ipf_natrules_sz, CTLFLAG_RWO, - &(ipfmain.ipf_nat_soft)->ipf_nat_maprules_sz, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, ipf_rdrrules_sz, CTLFLAG_RWO, - &(ipfmain.ipf_nat_soft)->ipf_nat_rdrrules_sz, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, ipf_hostmap_sz, CTLFLAG_RWO, - &(ipfmain.ipf_nat_soft)->ipf_nat_hostmap_sz, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_authsize, CTLFLAG_RWO, - &ipf_auth_size, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_authused, CTLFLAG_RD, - &ipf_auth_used, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_defaultauthage, CTLFLAG_RW, - &ipf_auth_defaultage, 0, ""); -#endif + &ipfmain.ipf_icmptimeout, 0, "ICMP timeout"); +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_running, CTLFLAG_RD, + &ipfmain.ipf_running, 0, "IPF is running"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_chksrc, CTLFLAG_RW, &ipfmain.ipf_chksrc, 0, ""); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_minttl, CTLFLAG_RW, &ipfmain.ipf_minttl, 0, ""); @@ -177,7 +156,6 @@ static struct cdevsw ipf_cdevsw = { static char *ipf_devfiles[] = { IPL_NAME, IPNAT_NAME, IPSTATE_NAME, IPAUTH_NAME, IPSYNC_NAME, IPSCAN_NAME, IPLOOKUP_NAME, NULL }; - static int ipfilter_modevent(module_t mod, int type, void *unused) { @@ -212,6 +190,9 @@ ipf_modload() if (ipf_create_all(&ipfmain) == NULL) return EIO; + if (ipf_fbsd_sysctl_create(&ipfmain) != 0) + return EIO; + error = ipfattach(&ipfmain); if (error) return error; @@ -268,6 +249,9 @@ ipf_modunload() if (ipfmain.ipf_refcnt) return EBUSY; + if (ipf_fbsd_sysctl_destroy(&ipfmain) != 0) + return EIO; + error = ipf_pfil_unhook(); if (error != 0) return error; @@ -277,6 +261,7 @@ ipf_modunload() if (error != 0) return error; + ipf_fbsd_sysctl_destroy(&ipfmain); ipf_destroy_all(&ipfmain); ipf_unload_all(); } else @@ -526,3 +511,58 @@ static int ipfwrite(dev, uio) return ipf_sync_write(&ipfmain, uio); return ENXIO; } + +static int +ipf_fbsd_sysctl_create(main_softc) + ipf_main_softc_t *main_softc; +{ + ipf_nat_softc_t *nat_softc; + ipf_state_softc_t *state_softc; + ipf_auth_softc_t *auth_softc; + ipf_frag_softc_t *frag_softc; + + nat_softc = main_softc->ipf_nat_soft; + state_softc = main_softc->ipf_state_soft; + auth_softc = main_softc->ipf_auth_soft; + frag_softc = main_softc->ipf_frag_soft; + + sysctl_ctx_init(&ipf_clist); + + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "fr_defnatage", CTLFLAG_RWO, + &nat_softc->ipf_nat_defage, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "fr_statesize", CTLFLAG_RWO, + &state_softc->ipf_state_size, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "fr_statemax", CTLFLAG_RWO, + &state_softc->ipf_state_max, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "ipf_nattable_max", CTLFLAG_RWO, + &nat_softc->ipf_nat_table_max, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "ipf_nattable_sz", CTLFLAG_RWO, + &nat_softc->ipf_nat_table_sz, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "ipf_natrules_sz", CTLFLAG_RWO, + &nat_softc->ipf_nat_maprules_sz, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "ipf_rdrrules_sz", CTLFLAG_RWO, + &nat_softc->ipf_nat_rdrrules_sz, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "ipf_hostmap_sz", CTLFLAG_RWO, + &nat_softc->ipf_nat_hostmap_sz, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "fr_authsize", CTLFLAG_RWO, + &auth_softc->ipf_auth_size, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "fr_authused", CTLFLAG_RD, + &auth_softc->ipf_auth_used, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "fr_defaultauthage", CTLFLAG_RW, + &auth_softc->ipf_auth_defaultage, 0, ""); + SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "fr_ipfrttl", CTLFLAG_RW, + &frag_softc->ipfr_ttl, 0, ""); + return 0; +} + +static int +ipf_fbsd_sysctl_destroy(main_softc) + ipf_main_softc_t *main_softc; +{ + if (sysctl_ctx_free(&ipf_clist)) { + printf("sysctl_ctx_free failed"); + return(ENOTEMPTY); + } + return 0; +} + From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 20:44:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D227AF2; Mon, 7 Apr 2014 20:44:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AA5395; Mon, 7 Apr 2014 20:44:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s37Ki1mk038875; Mon, 7 Apr 2014 20:44:01 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s37Ki1BR038874; Mon, 7 Apr 2014 20:44:01 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201404072044.s37Ki1BR038874@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 7 Apr 2014 20:44:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264236 - head/sys/bsm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 20:44:01 -0000 Author: pjd Date: Mon Apr 7 20:44:00 2014 New Revision: 264236 URL: http://svnweb.freebsd.org/changeset/base/264236 Log: IFp4 @1192291: - Don't include sys/caprights.h, leverage the fact that cap_rights_t is also defined in sys/types.h. - Include sys/types.h directly. - For systems that do not have cap_rights_t, define it, so we can use it in au_to_rights() prototype. Discussed with: rwatson Modified: head/sys/bsm/audit_record.h Modified: head/sys/bsm/audit_record.h ============================================================================== --- head/sys/bsm/audit_record.h Mon Apr 7 19:32:56 2014 (r264235) +++ head/sys/bsm/audit_record.h Mon Apr 7 20:44:00 2014 (r264236) @@ -33,8 +33,8 @@ #ifndef _BSM_AUDIT_RECORD_H_ #define _BSM_AUDIT_RECORD_H_ +#include #include /* struct timeval */ -#include /* cap_rights_t */ /* * Token type identifiers. @@ -191,6 +191,13 @@ struct sockaddr_un; struct vnode_au_info; #endif +#ifndef _CAP_RIGHTS_T_DECLARED +#define _CAP_RIGHTS_T_DECLARED +struct cap_rights; + +typedef struct cap_rights cap_rights_t; +#endif + int au_open(void); int au_write(int d, token_t *m); int au_close(int d, int keep, short event); From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 21:11:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D613B1C0; Mon, 7 Apr 2014 21:11:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A991133F; Mon, 7 Apr 2014 21:11:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s37LBTNL050770; Mon, 7 Apr 2014 21:11:29 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s37LBTFU050769; Mon, 7 Apr 2014 21:11:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201404072111.s37LBTFU050769@svn.freebsd.org> From: Ed Schouten Date: Mon, 7 Apr 2014 21:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264237 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 21:11:29 -0000 Author: ed Date: Mon Apr 7 21:11:29 2014 New Revision: 264237 URL: http://svnweb.freebsd.org/changeset/base/264237 Log: Clean up shutdown_nice(). Just send the right signal to init(8). Right now, init(8) cannot distinguish between an ACPI power button press or a Ctrl+Alt+Del sequence on the keyboard. This is because shutdown_nice() sends SIGINT to init(8) unconditionally, but later modifies the arguments to reboot(2) to force a certain behaviour. Instead of doing this, patch up the code to just forward the appropriate signal to userspace. SIGUSR1 and SIGUSR2 can already be used to halt the system. While there, move waittime to the function where it's used; kern_reboot(). Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Mon Apr 7 20:44:00 2014 (r264236) +++ head/sys/kern/kern_shutdown.c Mon Apr 7 21:11:29 2014 (r264237) @@ -202,26 +202,26 @@ sys_reboot(struct thread *td, struct reb /* * Called by events that want to shut down.. e.g on a PC */ -static int shutdown_howto = 0; - void shutdown_nice(int howto) { - shutdown_howto = howto; - - /* Send a signal to init(8) and have it shutdown the world */ if (initproc != NULL) { + /* Send a signal to init(8) and have it shutdown the world. */ PROC_LOCK(initproc); - kern_psignal(initproc, SIGINT); + if (howto & RB_POWEROFF) + kern_psignal(initproc, SIGUSR2); + else if (howto & RB_HALT) + kern_psignal(initproc, SIGUSR1); + else + kern_psignal(initproc, SIGINT); PROC_UNLOCK(initproc); } else { - /* No init(8) running, so simply reboot */ + /* No init(8) running, so simply reboot. */ kern_reboot(RB_NOSYNC); } return; } -static int waittime = -1; static void print_uptime(void) @@ -295,6 +295,7 @@ void kern_reboot(int howto) { static int first_buf_printf = 1; + static int waittime = -1; #if defined(SMP) /* @@ -312,9 +313,6 @@ kern_reboot(int howto) /* We're in the process of rebooting. */ rebooting = 1; - /* collect extra flags that shutdown_nice might have set */ - howto |= shutdown_howto; - /* We are out of the debugger now. */ kdb_active = 0; From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 21:12:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DEAA02FC; Mon, 7 Apr 2014 21:12:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB5C3347; Mon, 7 Apr 2014 21:12:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s37LC9cA050904; Mon, 7 Apr 2014 21:12:09 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s37LC9IA050902; Mon, 7 Apr 2014 21:12:09 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201404072112.s37LC9IA050902@svn.freebsd.org> From: Dimitry Andric Date: Mon, 7 Apr 2014 21:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264238 - head/contrib/binutils/opcodes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 21:12:10 -0000 Author: dim Date: Mon Apr 7 21:12:09 2014 New Revision: 264238 URL: http://svnweb.freebsd.org/changeset/base/264238 Log: For GNU as, add two missing modes for each of the fcomip and fucomip instructions. Partially obtained from OpenBSD by Pedro Giffuni, while I added the fcomip variants. Apparently this should help with compiling certain variants of WebKit. MFC after: 3 days Modified: head/contrib/binutils/opcodes/i386-opc.tbl head/contrib/binutils/opcodes/i386-tbl.h Modified: head/contrib/binutils/opcodes/i386-opc.tbl ============================================================================== --- head/contrib/binutils/opcodes/i386-opc.tbl Mon Apr 7 21:11:29 2014 (r264237) +++ head/contrib/binutils/opcodes/i386-opc.tbl Mon Apr 7 21:12:09 2014 (r264238) @@ -895,10 +895,14 @@ fucomi, 2, 0xdbe8, None, Cpu686, ShortFo fucomi, 0, 0xdbe9, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { 0 } fucomi, 1, 0xdbe8, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg } fcomip, 2, 0xdff0, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg, FloatAcc } +fcomip, 0, 0xdff1, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { 0 } +fcomip, 1, 0xdff0, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg } fcompi, 2, 0xdff0, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg, FloatAcc } fcompi, 0, 0xdff1, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { 0 } fcompi, 1, 0xdff0, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg } fucomip, 2, 0xdfe8, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg, FloatAcc } +fucomip, 0, 0xdfe9, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { 0 } +fucomip, 1, 0xdfe8, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg } fucompi, 2, 0xdfe8, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg, FloatAcc } fucompi, 0, 0xdfe9, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { 0 } fucompi, 1, 0xdfe8, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg } Modified: head/contrib/binutils/opcodes/i386-tbl.h ============================================================================== --- head/contrib/binutils/opcodes/i386-tbl.h Mon Apr 7 21:11:29 2014 (r264237) +++ head/contrib/binutils/opcodes/i386-tbl.h Mon Apr 7 21:12:09 2014 (r264238) @@ -2236,6 +2236,12 @@ const template i386_optab[] = ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg, FloatAcc } }, + { "fcomip", 0, 0xdff1, None, Cpu686, + ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, + { 0 } }, + { "fcomip", 1, 0xdff0, None, Cpu686, + ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, + { FloatReg } }, { "fcompi", 2, 0xdff0, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg, @@ -2250,6 +2256,12 @@ const template i386_optab[] = ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg, FloatAcc } }, + { "fucomip", 0, 0xdfe9, None, Cpu686, + ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, + { 0 } }, + { "fucomip", 1, 0xdfe8, None, Cpu686, + ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, + { FloatReg } }, { "fucompi", 2, 0xdfe8, None, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { FloatReg, From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 21:12:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51CF9440 for ; Mon, 7 Apr 2014 21:12:44 +0000 (UTC) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14AF9351 for ; Mon, 7 Apr 2014 21:12:43 +0000 (UTC) Received: by mail-ob0-f182.google.com with SMTP id uz6so19310obc.13 for ; Mon, 07 Apr 2014 14:12:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=+2ApFXDbPAhxoFKN3RL2YDSSoSb2ESt4NbXO6wbz6WI=; b=loiNYfpfxA49s01qQy0afNl5sPZ4Cwg9+ybOuWQr0bIn/DR2bQH3vs4pJ0s37uBqHz u2dCNJvwkUuvomDviEYTnCEy1BexxOVS20L+/hHMNv0e/DGdy7TcglqXlWrzFEuxrVo0 VfmJHN/Utp3HQI+j0sk2oag1aRd1Qzz+35Qnaf/ynpfdPa7+uWjAnBk4mrfEV4ekPTml Brmn+eguJ1Y5mYoQbicWR1xyuX30pdbd+K9uCdd/oAoqtf5gURNJE9U2pKWWjL2Hvjlr gTOxBsnkzC/smVd6AMHndClct+oAJSJRxij+McNxOwzkDG9sPR3nwP4CiAtJUI8aU0hf 30fw== X-Gm-Message-State: ALoCoQnLlc72S//Jp8DceP9EU2vvwN4X2/6uGOHn6gN/BMBKPOoHsxbaviLvab4rF5nlpzhrGW8e X-Received: by 10.60.115.68 with SMTP id jm4mr354433oeb.57.1396905156681; Mon, 07 Apr 2014 14:12:36 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id ii8sm32050262obb.11.2014.04.07.14.12.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Apr 2014 14:12:36 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263749 - in head: . sys/amd64/conf sys/conf sys/i386/conf sys/sparc64/conf From: Warner Losh In-Reply-To: <201404071505.09468.jhb@freebsd.org> Date: Mon, 7 Apr 2014 15:12:34 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201403252208.s2PM8VXj019660@svn.freebsd.org> <201404071505.09468.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 21:12:44 -0000 On Apr 7, 2014, at 1:05 PM, John Baldwin wrote: > On Tuesday, March 25, 2014 6:08:31 pm Warner Losh wrote: >> Author: imp >> Date: Tue Mar 25 22:08:31 2014 >> New Revision: 263749 >> URL: http://svnweb.freebsd.org/changeset/base/263749 >>=20 >> Log: >> Rather than require a makeoptions DEBUG to get debug correct, >> add it in kern.mk, but only if we're using clang. While this >> ... >> Modified: head/sys/amd64/conf/GENERIC >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/amd64/conf/GENERIC Tue Mar 25 21:57:50 2014 = (r263748) >> +++ head/sys/amd64/conf/GENERIC Tue Mar 25 22:08:31 2014 = (r263749) >> @@ -21,7 +21,7 @@ >> cpu HAMMER >> ident GENERIC >>=20 >> -makeoptions DEBUG=3D-gdwarf-2 # Build kernel with = gdb(1) debug symbols >> +makeoptions DEBUG=3D-g >> makeoptions WITH_CTF=3D1 # Run ctfconvert(1) for DTrace = support >=20 > Did you mean to lose this comment in all these files? No. I didn=92t mean to loose it. Damn. Thanks! Warner From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 21:16:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DB14747; Mon, 7 Apr 2014 21:16:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AD08391; Mon, 7 Apr 2014 21:16:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s37LGpjT051564; Mon, 7 Apr 2014 21:16:51 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s37LGp93051563; Mon, 7 Apr 2014 21:16:51 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404072116.s37LGp93051563@svn.freebsd.org> From: Warner Losh Date: Mon, 7 Apr 2014 21:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264239 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 21:16:52 -0000 Author: imp Date: Mon Apr 7 21:16:51 2014 New Revision: 264239 URL: http://svnweb.freebsd.org/changeset/base/264239 Log: Need to test .MAKE.LEVEL everywhere before using it for bootstrapping issues between fmake and bmake. Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Mon Apr 7 21:12:09 2014 (r264238) +++ head/share/mk/bsd.own.mk Mon Apr 7 21:16:51 2014 (r264239) @@ -440,7 +440,7 @@ MK_${var}:= yes .error WITH_${var} and WITHOUT_${var} can't both be set. .endif .if defined(MK_${var}) -.if ${.MAKE.LEVEL} == 0 +.if defined(.MAKE.LEVEL) && ${.MAKE.LEVEL} == 0 .error MK_${var} can't be set by a user. .endif .else @@ -601,7 +601,7 @@ MK_${vv:H}:= ${MK_${vv:T}} .error WITH_${var} and WITHOUT_${var} can't both be set. .endif .if defined(MK_${var}) -.if ${.MAKE.LEVEL} == 0 +.if defined(.MAKE.LEVEL) && ${.MAKE.LEVEL} == 0 .error MK_${var} can't be set by a user. .endif .else From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 21:18:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9443188A; Mon, 7 Apr 2014 21:18:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81225398; Mon, 7 Apr 2014 21:18:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s37LICZ5051795; Mon, 7 Apr 2014 21:18:12 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s37LICaj051794; Mon, 7 Apr 2014 21:18:12 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201404072118.s37LICaj051794@svn.freebsd.org> From: Ed Schouten Date: Mon, 7 Apr 2014 21:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264240 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 21:18:12 -0000 Author: ed Date: Mon Apr 7 21:18:12 2014 New Revision: 264240 URL: http://svnweb.freebsd.org/changeset/base/264240 Log: Thinko: don't forget to apply 'howto' in case init(8) isn't running. Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Mon Apr 7 21:16:51 2014 (r264239) +++ head/sys/kern/kern_shutdown.c Mon Apr 7 21:18:12 2014 (r264240) @@ -218,9 +218,8 @@ shutdown_nice(int howto) PROC_UNLOCK(initproc); } else { /* No init(8) running, so simply reboot. */ - kern_reboot(RB_NOSYNC); + kern_reboot(howto | RB_NOSYNC); } - return; } static void From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 21:28:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B64D7A8D; Mon, 7 Apr 2014 21:28:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A30E465F; Mon, 7 Apr 2014 21:28:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s37LSLPn055832; Mon, 7 Apr 2014 21:28:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s37LSLnY055831; Mon, 7 Apr 2014 21:28:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201404072128.s37LSLnY055831@svn.freebsd.org> From: Michael Tuexen Date: Mon, 7 Apr 2014 21:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264241 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 21:28:21 -0000 Author: tuexen Date: Mon Apr 7 21:28:21 2014 New Revision: 264241 URL: http://svnweb.freebsd.org/changeset/base/264241 Log: Call sctp_addr_change() from rt_addrmsg() instead of rt_newaddrmsg_fib(), since rt_addrmsg() gets also called from other functions. MFC after: 3 days Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Apr 7 21:18:12 2014 (r264240) +++ head/sys/net/route.c Mon Apr 7 21:28:21 2014 (r264241) @@ -1773,6 +1773,16 @@ rt_addrmsg(int cmd, struct ifaddr *ifa, KASSERT(fibnum == RT_ALL_FIBS || (fibnum >= 0 && fibnum < rt_numfibs), ("%s: fib out of range 0 <=%d<%d", __func__, fibnum, rt_numfibs)); +#if defined(INET) || defined(INET6) +#ifdef SCTP + /* + * notify the SCTP stack + * this will only get called when an address is added/deleted + * XXX pass the ifaddr struct instead if ifa->ifa_addr... + */ + sctp_addr_change(ifa, cmd); +#endif /* SCTP */ +#endif return (rtsock_addrmsg(cmd, ifa, fibnum)); } @@ -1823,16 +1833,6 @@ rt_newaddrmsg_fib(int cmd, struct ifaddr KASSERT(fibnum == RT_ALL_FIBS || (fibnum >= 0 && fibnum < rt_numfibs), ("%s: fib out of range 0 <=%d<%d", __func__, fibnum, rt_numfibs)); -#if defined(INET) || defined(INET6) -#ifdef SCTP - /* - * notify the SCTP stack - * this will only get called when an address is added/deleted - * XXX pass the ifaddr struct instead if ifa->ifa_addr... - */ - sctp_addr_change(ifa, cmd); -#endif /* SCTP */ -#endif if (cmd == RTM_ADD) { rt_addrmsg(cmd, ifa, fibnum); if (rt != NULL) From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 22:37:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00966CD1; Mon, 7 Apr 2014 22:37:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1933D2B; Mon, 7 Apr 2014 22:37:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s37MbD0q084702; Mon, 7 Apr 2014 22:37:13 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s37MbDwj084701; Mon, 7 Apr 2014 22:37:13 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201404072237.s37MbDwj084701@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 7 Apr 2014 22:37:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264242 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 22:37:14 -0000 Author: ray Date: Mon Apr 7 22:37:13 2014 New Revision: 264242 URL: http://svnweb.freebsd.org/changeset/base/264242 Log: Do not fill screen, while muted. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/subr_terminal.c Modified: head/sys/kern/subr_terminal.c ============================================================================== --- head/sys/kern/subr_terminal.c Mon Apr 7 21:28:21 2014 (r264241) +++ head/sys/kern/subr_terminal.c Mon Apr 7 22:37:13 2014 (r264242) @@ -208,7 +208,7 @@ terminal_set_winsize_blank(struct termin teken_set_winsize(&tm->tm_emulator, &r.tr_end); TERMINAL_UNLOCK(tm); - if (blank != 0) + if ((blank != 0) && !(tm->tm_flags & TF_MUTE)) tm->tm_class->tc_fill(tm, &r, TCHAR_CREATE((teken_char_t)' ', &default_message)); From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 22:40:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F7F8E25; Mon, 7 Apr 2014 22:40:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C439D39; Mon, 7 Apr 2014 22:40:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s37MeUX4085289; Mon, 7 Apr 2014 22:40:30 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s37MeTqo085123; Mon, 7 Apr 2014 22:40:29 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201404072240.s37MeTqo085123@svn.freebsd.org> From: Devin Teske Date: Mon, 7 Apr 2014 22:40:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264243 - in head/etc: . rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 22:40:30 -0000 Author: dteske Date: Mon Apr 7 22:40:29 2014 New Revision: 264243 URL: http://svnweb.freebsd.org/changeset/base/264243 Log: Loosen the processing of *_IF_aliasN vars to be less strict. Previously, the first alias had to be _alias0 and processing stopped at the first non- defined variable (preventing gaps). Allowing gaps gives the administrator the ability to group aliases in an adhoc manner and also lifts the requirement to renumber aliases simply to comment-out an existing one. Aliases are processed in numerical ascending order. Discussed on: -rc MFC after: 1 week Modified: head/etc/network.subr head/etc/rc.d/mdconfig head/etc/rc.d/mdconfig2 head/etc/rc.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Mon Apr 7 22:37:13 2014 (r264242) +++ head/etc/network.subr Mon Apr 7 22:40:29 2014 (r264243) @@ -283,10 +283,8 @@ get_if_var() fi _if=$1 - _punct=". - / +" - for _punct_c in $_punct; do - _if=`ltr ${_if} ${_punct_c} '_'` - done + _punct=".-/+" + ltr ${_if} "${_punct}" '_' _if _var=$2 _default=$3 @@ -1076,6 +1074,7 @@ ifalias_af_common_handler() ifalias_af_common() { local _ret _if _af _action alias ifconfig_args _aliasn _c _tmpargs _iaf + local _punct=".-/+" _ret=1 _aliasn= @@ -1083,10 +1082,14 @@ ifalias_af_common() _af=$2 _action=$3 + # Normalize $_if before using it in a pattern to list_vars() + ltr "$_if" "$_punct" "_" _if + # ifconfig_IF_aliasN which starts with $_af - alias=0 - while : ; do - ifconfig_args=`get_if_var $_if ifconfig_IF_alias${alias}` + for alias in `list_vars ifconfig_${_if}_alias[0-9]\* | + sort_lite -nk1.$((9+${#_if}+7))` + do + eval ifconfig_args=\"\$$alias\" _iaf= case $ifconfig_args in inet\ *) _iaf=inet ;; @@ -1107,15 +1110,15 @@ ifalias_af_common() warn "\$ifconfig_${_if}_alias${alias} needs " \ "\"inet\" keyword for an IPv4 address." esac - alias=$(($alias + 1)) done # backward compatibility: ipv6_ifconfig_IF_aliasN. case $_af in inet6) - alias=0 - while : ; do - ifconfig_args=`get_if_var $_if ipv6_ifconfig_IF_alias${alias}` + for alias in `list_vars ipv6_ifconfig_${_if}_alias[0-9]\* | + sort_lite -nk1.$((14+${#_if}+7))` + do + eval ifconfig_args=\"\$$alias\" case ${_action}:"${ifconfig_args}" in *:"") break @@ -1127,7 +1130,6 @@ ifalias_af_common() "instead." ;; esac - alias=$(($alias + 1)) done esac Modified: head/etc/rc.d/mdconfig ============================================================================== --- head/etc/rc.d/mdconfig Mon Apr 7 22:37:13 2014 (r264242) +++ head/etc/rc.d/mdconfig Mon Apr 7 22:40:29 2014 (r264243) @@ -181,17 +181,14 @@ fi load_rc_config $name -_mdconfig_unit=0 if [ -z "${_mdconfig_list}" ]; then - while :; do - eval _mdconfig_config=\$mdconfig_md${_mdconfig_unit} - if [ -z "${_mdconfig_config}" ]; then - break - else - _mdconfig_list="${_mdconfig_list}${_mdconfig_list:+ }md${_mdconfig_unit}" - _mdconfig_unit=$((${_mdconfig_unit} + 1)) - fi + for _mdconfig_config in `list_vars mdconfig_md[0-9]\* | + sort_lite -nk1.12` + do + _mdconfig_unit=${_mdconfig_config#mdconfig_md} + _mdconfig_list="$_mdconfig_list md$_mdconfig_unit" done + _mdconfig_list="${_mdconfig_list# }" fi run_rc_command "${_mdconfig_cmd}" Modified: head/etc/rc.d/mdconfig2 ============================================================================== --- head/etc/rc.d/mdconfig2 Mon Apr 7 22:37:13 2014 (r264242) +++ head/etc/rc.d/mdconfig2 Mon Apr 7 22:40:29 2014 (r264243) @@ -211,17 +211,14 @@ fi load_rc_config $name -_mdconfig2_unit=0 if [ -z "${_mdconfig2_list}" ]; then - while :; do - eval _mdconfig2_config=\$mdconfig_md${_mdconfig2_unit} - if [ -z "${_mdconfig2_config}" ]; then - break - else - _mdconfig2_list="${_mdconfig2_list}${_mdconfig2_list:+ }md${_mdconfig2_unit}" - _mdconfig2_unit=$((${_mdconfig2_unit} + 1)) - fi + for _mdconfig2_config in `list_vars mdconfig_md[0-9]\* | + sort_lite -nk1.12` + do + _mdconfig2_unit=${_mdconfig2_config#mdconfig_md} + _mdconfig2_list="$_mdconfig2_list md$_mdconfig2_unit" done + _mdconfig2_list="${_mdconfig2_list# }" fi run_rc_command "${_mdconfig2_cmd}" Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Mon Apr 7 22:37:13 2014 (r264242) +++ head/etc/rc.subr Mon Apr 7 22:40:29 2014 (r264243) @@ -54,6 +54,20 @@ JID=`$PS -p $$ -o jid=` # functions # --------- +# list_vars pattern +# List vars matching pattern. +# +list_vars() +{ + set | { while read LINE; do + var="${LINE%%=*}" + case "$var" in + "$LINE"|*[!a-zA-Z0-9_]*) continue ;; + $1) echo $var + esac + done; } +} + # set_rcvar_obsolete oldvar [newvar] [msg] # Define obsolete variable. # Global variable $rcvars_obsolete is used. @@ -314,6 +328,246 @@ _find_processes() eval $_proccheck } +# sort_lite [-b] [-n] [-k POS] [-t SEP] +# A lite version of sort(1) (supporting a few options) that can be used +# before the real sort(1) is available (e.g., in scripts that run prior +# to mountcritremote). Requires only shell built-in functionality. +# +sort_lite() +{ + local funcname=sort_lite + local sort_sep="$IFS" sort_ignore_leading_space= + local sort_field=0 sort_strict_fields= sort_numeric= + local nitems=0 skip_leading=0 trim= + + local OPTIND flag + while getopts bnk:t: flag; do + case "$flag" in + b) sort_ignore_leading_space=1 ;; + n) sort_numeric=1 sort_ignore_leading_space=1 ;; + k) sort_field="${OPTARG%%,*}" ;; # only up to first comma + # NB: Unlike sort(1) only one POS allowed + t) sort_sep="$OPTARG" + if [ ${#sort_sep} -gt 1 ]; then + echo "$funcname: multi-character tab \`$sort_sep'" >&2 + return 1 + fi + sort_strict_fields=1 + ;; + \?) return 1 ;; + esac + done + shift $(( $OPTIND - 1 )) + + # Create transformation pattern to trim leading text if desired + case "$sort_field" in + ""|[!0-9]*|*[!0-9.]*) + echo "$funcname: invalid sort field \`$sort_field'" >&2 + return 1 + ;; + *.*) + skip_leading=${sort_field#*.} sort_field=${sort_field%%.*} + while [ ${skip_leading:-0} -gt 1 ] 2> /dev/null; do + trim="$trim?" skip_leading=$(( $skip_leading - 1 )) + done + esac + + # Copy input to series of local numbered variables + # NB: IFS of NULL preserves leading whitespace + local LINE + while IFS= read -r LINE || [ "$LINE" ]; do + nitems=$(( $nitems + 1 )) + local src_$nitems="$LINE" + done + + # + # Sort numbered locals using insertion sort + # + local curitem curitem_orig curitem_mod curitem_haskey + local dest dest_orig dest_mod dest_haskey + local d gt n + local i=1 + while [ $i -le $nitems ]; do + curitem_haskey=1 # Assume sort field (-k POS) exists + eval curitem=\"\$src_$i\" + curitem_mod="$curitem" # for modified comparison + curitem_orig="$curitem" # for original comparison + + # Trim leading whitespace if desired + if [ "$sort_ignore_leading_space" ]; then + while case "$curitem_orig" in + [$IFS]*) : ;; *) false; esac + do + curitem_orig="${curitem_orig#?}" + done + curitem_mod="$curitem_orig" + fi + + # Shift modified comparison value if sort field (-k POS) is > 1 + n=$sort_field + while [ $n -gt 1 ]; do + case "$curitem_mod" in + *[$sort_sep]*) + # Cut text up-to (and incl.) first separator + curitem_mod="${curitem_mod#*[$sort_sep]}" + + # Skip NULLs unless strict field splitting + [ "$sort_strict_fields" ] || + [ "${curitem_mod%%[$sort_sep]*}" ] || + [ $n -eq 2 ] || + continue + ;; + *) + # Asked for a field that doesn't exist + curitem_haskey= break + esac + n=$(( $n - 1 )) + done + + # Trim trailing words if sort field >= 1 + [ $sort_field -ge 1 -a "$sort_numeric" ] && + curitem_mod="${curitem_mod%%[$sort_sep]*}" + + # Apply optional trim (-k POS.TRIM) to cut leading characters + curitem_mod="${curitem_mod#$trim}" + + # Determine the type of modified comparison to use initially + # NB: Prefer numerical if requested but fallback to standard + case "$curitem_mod" in + ""|[!0-9]*) # NULL or begins with non-number + gt=">" + [ "$sort_numeric" ] && curitem_mod=0 + ;; + *) + if [ "$sort_numeric" ]; then + gt="-gt" + curitem_mod="${curitem_mod%%[!0-9]*}" + # NB: trailing non-digits removed + # otherwise numeric comparison fails + else + gt=">" + fi + esac + + # If first time through, short-circuit below position-search + if [ $i -le 1 ]; then + d=0 + else + d=1 + fi + + # + # Find appropriate element position + # + while [ $d -gt 0 ] + do + dest_haskey=$curitem_haskey + eval dest=\"\$dest_$d\" + dest_mod="$dest" # for modified comparison + dest_orig="$dest" # for original comparison + + # Trim leading whitespace if desired + if [ "$sort_ignore_leading_space" ]; then + while case "$dest_orig" in + [$IFS]*) : ;; *) false; esac + do + dest_orig="${dest_orig#?}" + done + dest_mod="$dest_orig" + fi + + # Shift modified value if sort field (-k POS) is > 1 + n=$sort_field + while [ $n -gt 1 ]; do + case "$dest_mod" in + *[$sort_sep]*) + # Cut text up-to (and incl.) 1st sep + dest_mod="${dest_mod#*[$sort_sep]}" + + # Skip NULLs unless strict fields + [ "$sort_strict_fields" ] || + [ "${dest_mod%%[$sort_sep]*}" ] || + [ $n -eq 2 ] || + continue + ;; + *) + # Asked for a field that doesn't exist + dest_haskey= break + esac + n=$(( $n - 1 )) + done + + # Trim trailing words if sort field >= 1 + [ $sort_field -ge 1 -a "$sort_numeric" ] && + dest_mod="${dest_mod%%[$sort_sep]*}" + + # Apply optional trim (-k POS.TRIM), cut leading chars + dest_mod="${dest_mod#$trim}" + + # Determine type of modified comparison to use + # NB: Prefer numerical if requested, fallback to std + case "$dest_mod" in + ""|[!0-9]*) # NULL or begins with non-number + gt=">" + [ "$sort_numeric" ] && dest_mod=0 + ;; + *) + if [ "$sort_numeric" ]; then + gt="-gt" + dest_mod="${dest_mod%%[!0-9]*}" + # NB: kill trailing non-digits + # for numeric comparison safety + else + gt=">" + fi + esac + + # Break if we've found the proper element position + if [ "$curitem_haskey" -a "$dest_haskey" ]; then + if [ "$dest_mod" = "$curitem_mod" ]; then + [ "$dest_orig" ">" "$curitem_orig" ] && + break + elif [ "$dest_mod" $gt "$curitem_mod" ] \ + 2> /dev/null + then + break + fi + else + [ "$dest_orig" ">" "$curitem_orig" ] && break + fi + + # Break if we've hit the end + [ $d -ge $i ] && break + + d=$(( $d + 1 )) + done + + # Shift remaining positions forward, making room for new item + n=$i + while [ $n -ge $d ]; do + # Shift destination item forward one placement + eval dest_$(( $n + 1 ))=\"\$dest_$n\" + n=$(( $n - 1 )) + done + + # Place the element + if [ $i -eq 1 ]; then + local dest_1="$curitem" + else + local dest_$d="$curitem" + fi + + i=$(( $i + 1 )) + done + + # Print sorted results + d=1 + while [ $d -le $nitems ]; do + eval echo \"\$dest_$d\" + d=$(( $d + 1 )) + done +} + # # wait_for_pids pid [pid ...] # spins until none of the pids exist @@ -1524,19 +1778,20 @@ load_kld() return 0 } -# ltr str src dst +# ltr str src dst [var] # Change every $src in $str to $dst. # Useful when /usr is not yet mounted and we cannot use tr(1), sed(1) nor -# awk(1). +# awk(1). If var is non-NULL, set it to the result. ltr() { - local _str _src _dst _out _com - _str=$1 - _src=$2 - _dst=$3 + local _str _src _dst _out _com _var + _str="$1" + _src="$2" + _dst="$3" + _var="$4" _out="" - IFS=${_src} + local IFS="${_src}" for _com in ${_str}; do if [ -z "${_out}" ]; then _out="${_com}" @@ -1544,7 +1799,11 @@ ltr() _out="${_out}${_dst}${_com}" fi done - echo "${_out}" + if [ -n "${_var}" ]; then + setvar "${_var}" "${_out}" + else + echo "${_out}" + fi } # Creates a list of providers for GELI encryption. From owner-svn-src-head@FreeBSD.ORG Mon Apr 7 22:49:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11008FF1; Mon, 7 Apr 2014 22:49:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6044DF5; Mon, 7 Apr 2014 22:49:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s37MnfXQ089027; Mon, 7 Apr 2014 22:49:41 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s37MnflZ089026; Mon, 7 Apr 2014 22:49:41 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201404072249.s37MnflZ089026@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 7 Apr 2014 22:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264244 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2014 22:49:42 -0000 Author: ray Date: Mon Apr 7 22:49:41 2014 New Revision: 264244 URL: http://svnweb.freebsd.org/changeset/base/264244 Log: Fix panic on load new driver while vt(4) is in VGA textmode. o Mute terminal while vt(4) driver change in progress. o Reset VDF_TEXTMODE before init new driver. o Assign default font, if new driver is not in TEXTMODE. o Do not update screen while driver changing. Resolved by: adrian Reported by: tyler MFC after: 7 days Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Mon Apr 7 22:40:29 2014 (r264243) +++ head/sys/dev/vt/vt_core.c Mon Apr 7 22:49:41 2014 (r264244) @@ -705,8 +705,8 @@ vt_bitblt_char(struct vt_device *vd, str static void vt_flush(struct vt_device *vd) { - struct vt_window *vw = vd->vd_curwindow; - struct vt_font *vf = vw->vw_font; + struct vt_window *vw; + struct vt_font *vf; struct vt_bufmask tmask; unsigned int row, col; term_rect_t tarea; @@ -717,6 +717,11 @@ vt_flush(struct vt_device *vd) int bpl, h, w; #endif + vw = vd->vd_curwindow; + if (vw == NULL) return; + vf = vw->vw_font; + if ((vf == NULL) && !(vd->vd_flags & VDF_TEXTMODE)) return; + if (vd->vd_flags & VDF_SPLASH || vw->vw_flags & VWF_BUSY) return; @@ -794,6 +799,7 @@ vt_timer(void *arg) vd = arg; /* Update screen if required. */ vt_flush(vd); + /* Schedule for next update. */ callout_schedule(&vd->vd_timer, hz / VT_TIMERFREQ); } @@ -1882,6 +1888,10 @@ vt_upgrade(struct vt_device *vd) vt_window_switch, vw, SHUTDOWN_PRI_DEFAULT); } terminal_maketty(vw->vw_terminal, "v%r", VT_UNIT(vw)); + + /* Assign default font to window, if not textmode. */ + if (!(vd->vd_flags & VDF_TEXTMODE) && vw->vw_font == NULL) + vw->vw_font = vtfont_ref(&vt_font_default); } if (vd->vd_curwindow == NULL) vd->vd_curwindow = vd->vd_windows[VT_CONSWINDOW]; @@ -1933,9 +1943,21 @@ vt_allocate(struct vt_driver *drv, void if (drv->vd_maskbitbltchr == NULL) drv->vd_maskbitbltchr = drv->vd_bitbltchr; - /* Stop vt_flush periodic task. */ - if (vd->vd_curwindow != NULL) + if (vd->vd_flags & VDF_ASYNC) { + /* Stop vt_flush periodic task. */ callout_drain(&vd->vd_timer); + /* + * Mute current terminal until we done. vt_change_font (called + * from vt_resize) will unmute it. + */ + terminal_mute(vd->vd_curwindow->vw_terminal, 1); + } + + /* + * Reset VDF_TEXTMODE flag, driver who require that flag (vt_vga) will + * set it. + */ + vd->vd_flags &= ~VDF_TEXTMODE; vd->vd_driver = drv; vd->vd_softc = softc; @@ -1951,7 +1973,7 @@ vt_allocate(struct vt_driver *drv, void vtterm_splash(vd); #endif - if (vd->vd_curwindow != NULL) + if (vd->vd_flags & VDF_ASYNC) callout_schedule(&vd->vd_timer, hz / VT_TIMERFREQ); termcn_cnregister(vd->vd_windows[VT_CONSWINDOW]->vw_terminal); From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 01:54:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 781A4907; Tue, 8 Apr 2014 01:54:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A9771129; Tue, 8 Apr 2014 01:54:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s381spJO040533; Tue, 8 Apr 2014 01:54:51 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s381spGW040532; Tue, 8 Apr 2014 01:54:51 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201404080154.s381spGW040532@svn.freebsd.org> From: Kevin Lo Date: Tue, 8 Apr 2014 01:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264248 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 01:54:51 -0000 Author: kevlo Date: Tue Apr 8 01:54:50 2014 New Revision: 264248 URL: http://svnweb.freebsd.org/changeset/base/264248 Log: Remove a bogus re-assignment. Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Tue Apr 8 01:04:23 2014 (r264247) +++ head/sys/netinet/udp_usrreq.c Tue Apr 8 01:54:50 2014 (r264248) @@ -384,7 +384,6 @@ udp_input(struct mbuf *m, int off) int cscov_partial; uint8_t pr; - iphlen = off; ifp = m->m_pkthdr.rcvif; UDPSTAT_INC(udps_ipackets); From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 02:36:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1592986A; Tue, 8 Apr 2014 02:36:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD73E1578; Tue, 8 Apr 2014 02:36:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s382aRHT057352; Tue, 8 Apr 2014 02:36:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s382aR4W057350; Tue, 8 Apr 2014 02:36:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404080236.s382aR4W057350@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Apr 2014 02:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264250 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 02:36:28 -0000 Author: adrian Date: Tue Apr 8 02:36:27 2014 New Revision: 264250 URL: http://svnweb.freebsd.org/changeset/base/264250 Log: Add a basic set of data points which count the number of sleep entries that are being done by the OS. For now this'll match up with the "wakeups"; although I'll dig deeper into this to see if we can determine which sleep state the CPU managed to get into. Most things I've seen these days only expose up to C2 or C3 via ACPI even though the CPU goes all the way down to C6 or C7. Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Tue Apr 8 02:32:39 2014 (r264249) +++ head/sys/dev/acpica/acpi_cpu.c Tue Apr 8 02:36:27 2014 (r264250) @@ -172,6 +172,7 @@ static void acpi_cpu_idle(sbintime_t sbt static void acpi_cpu_notify(ACPI_HANDLE h, UINT32 notify, void *context); static int acpi_cpu_quirks(void); static int acpi_cpu_usage_sysctl(SYSCTL_HANDLER_ARGS); +static int acpi_cpu_usage_counters_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc); static int acpi_cpu_cx_lowest_sysctl(SYSCTL_HANDLER_ARGS); static int acpi_cpu_global_cx_lowest_sysctl(SYSCTL_HANDLER_ARGS); @@ -938,6 +939,11 @@ acpi_cpu_startup_cx(struct acpi_cpu_soft OID_AUTO, "cx_usage", CTLTYPE_STRING | CTLFLAG_RD, (void *)sc, 0, acpi_cpu_usage_sysctl, "A", "percent usage for each Cx state"); + SYSCTL_ADD_PROC(&sc->cpu_sysctl_ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->cpu_dev)), + OID_AUTO, "cx_usage_counters", CTLTYPE_STRING | CTLFLAG_RD, + (void *)sc, 0, acpi_cpu_usage_counters_sysctl, "A", + "Cx sleep state counters"); /* Signal platform that we can handle _CST notification. */ if (!cpu_cx_generic && cpu_cst_cnt != 0) { @@ -1237,6 +1243,35 @@ acpi_cpu_usage_sysctl(SYSCTL_HANDLER_ARG return (0); } +/* + * XXX TODO: actually add support to count each entry/exit + * from the Cx states. + */ +static int +acpi_cpu_usage_counters_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct acpi_cpu_softc *sc; + struct sbuf sb; + char buf[128]; + int i; + + sc = (struct acpi_cpu_softc *) arg1; + + /* Print out the raw counters */ + sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN); + + for (i = 0; i < sc->cpu_cx_count; i++) { + sbuf_printf(&sb, "%u ", sc->cpu_cx_stats[i]); + } + + sbuf_trim(&sb); + sbuf_finish(&sb); + sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req); + sbuf_delete(&sb); + + return (0); +} + static int acpi_cpu_set_cx_lowest(struct acpi_cpu_softc *sc) { From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 04:05:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3E5166E; Tue, 8 Apr 2014 04:05:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD8431CCF; Tue, 8 Apr 2014 04:05:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38456NQ094760; Tue, 8 Apr 2014 04:05:06 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38455dx094750; Tue, 8 Apr 2014 04:05:05 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201404080405.s38455dx094750@svn.freebsd.org> From: Rui Paulo Date: Tue, 8 Apr 2014 04:05:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264251 - in head/sys: arm/conf arm/freescale/imx boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 04:05:06 -0000 Author: rpaulo Date: Tue Apr 8 04:05:04 2014 New Revision: 264251 URL: http://svnweb.freebsd.org/changeset/base/264251 Log: Updates to i.MX53: * Define support for the SDHCI driver, although it doesn't work yet * Fix the memory mappings for IPU [1] Reviewed by: ray [1] Modified: head/sys/arm/conf/DIGI-CCWMX53 head/sys/arm/freescale/imx/files.imx53 head/sys/arm/freescale/imx/imx51_ipuv3.c head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c head/sys/arm/freescale/imx/imx51_ipuv3reg.h head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts head/sys/boot/fdt/dts/arm/imx53-qsb.dts head/sys/boot/fdt/dts/arm/imx53x.dtsi Modified: head/sys/arm/conf/DIGI-CCWMX53 ============================================================================== --- head/sys/arm/conf/DIGI-CCWMX53 Tue Apr 8 02:36:27 2014 (r264250) +++ head/sys/arm/conf/DIGI-CCWMX53 Tue Apr 8 04:05:04 2014 (r264251) @@ -169,6 +169,12 @@ device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm +# MMC +#device sdhci # SD controller +#device mmc # SD/MMC protocol +#device mmcsd # SDCard disk device + + # Flattened Device Tree options FDT options FDT_DTB_STATIC @@ -177,6 +183,7 @@ makeoptions FDT_DTS_FILE=digi-ccwmx5 # NOTE: serial console will be disabled if syscons enabled # Uncomment following lines for framebuffer/syscons support #device sc +#device vt #device kbdmux #options SC_DFLT_FONT # compile font in #makeoptions SC_DFLT_FONT=cp437 Modified: head/sys/arm/freescale/imx/files.imx53 ============================================================================== --- head/sys/arm/freescale/imx/files.imx53 Tue Apr 8 02:36:27 2014 (r264250) +++ head/sys/arm/freescale/imx/files.imx53 Tue Apr 8 04:05:04 2014 (r264251) @@ -36,6 +36,9 @@ arm/freescale/imx/imx51_ccm.c standard # i.MX5xx PATA controller dev/ata/chipsets/ata-fsl.c optional imxata +# SDHCI/MMC +arm/freescale/imx/imx_sdhci.c optional sdhci + # USB OH3 controller (1 OTG, 3 EHCI) arm/freescale/imx/imx_nop_usbphy.c optional ehci dev/usb/controller/ehci_imx.c optional ehci Modified: head/sys/arm/freescale/imx/imx51_ipuv3.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_ipuv3.c Tue Apr 8 02:36:27 2014 (r264250) +++ head/sys/arm/freescale/imx/imx51_ipuv3.c Tue Apr 8 04:05:04 2014 (r264251) @@ -260,7 +260,7 @@ ipu3_fb_probe(device_t dev) if (!ofw_bus_is_compatible(dev, "fsl,ipu3")) return (ENXIO); - device_set_desc(dev, "i.MX515 Image Processing Unit (FB)"); + device_set_desc(dev, "i.MX5x Image Processing Unit v3 (FB)"); error = sc_probe_unit(device_get_unit(dev), device_get_flags(dev) | SC_AUTODETECT_KBD); @@ -277,15 +277,19 @@ ipu3_fb_attach(device_t dev) struct ipu3sc_softc *sc = device_get_softc(dev); bus_space_tag_t iot; bus_space_handle_t ioh; + phandle_t node; + pcell_t reg; int err; + uintptr_t base; if (ipu3sc_softc) return (ENXIO); ipu3sc_softc = sc; - device_printf(dev, "\tclock gate status is %d\n", - imx51_get_clk_gating(IMX51CLK_IPU_HSP_CLK_ROOT)); + if (bootverbose) + device_printf(dev, "clock gate status is %d\n", + imx51_get_clk_gating(IMX51CLK_IPU_HSP_CLK_ROOT)); sc->dev = dev; @@ -300,58 +304,71 @@ ipu3_fb_attach(device_t dev) sc = device_get_softc(dev); sc->iot = iot = fdtbus_bs_tag; - device_printf(sc->dev, ": i.MX51 IPUV3 controller\n"); - + /* + * Retrieve the device address based on the start address in the + * DTS. The DTS for i.MX51 specifies 0x5e000000 as the first register + * address, so we just subtract IPU_CM_BASE to get the offset at which + * the IPU device was memory mapped. + * On i.MX53, the offset is 0. + */ + node = ofw_bus_get_node(dev); + if ((OF_getprop(node, "reg", ®, sizeof(reg))) <= 0) + base = 0; + else + base = fdt32_to_cpu(reg) - IPU_CM_BASE(0); /* map controller registers */ - err = bus_space_map(iot, IPU_CM_BASE, IPU_CM_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_CM_BASE(base), IPU_CM_SIZE, 0, &ioh); if (err) goto fail_retarn_cm; sc->cm_ioh = ioh; /* map Display Multi FIFO Controller registers */ - err = bus_space_map(iot, IPU_DMFC_BASE, IPU_DMFC_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DMFC_BASE(base), IPU_DMFC_SIZE, 0, &ioh); if (err) goto fail_retarn_dmfc; sc->dmfc_ioh = ioh; /* map Display Interface 0 registers */ - err = bus_space_map(iot, IPU_DI0_BASE, IPU_DI0_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DI0_BASE(base), IPU_DI0_SIZE, 0, &ioh); if (err) goto fail_retarn_di0; sc->di0_ioh = ioh; /* map Display Interface 1 registers */ - err = bus_space_map(iot, IPU_DI1_BASE, IPU_DI0_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DI1_BASE(base), IPU_DI0_SIZE, 0, &ioh); if (err) goto fail_retarn_di1; sc->di1_ioh = ioh; /* map Display Processor registers */ - err = bus_space_map(iot, IPU_DP_BASE, IPU_DP_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DP_BASE(base), IPU_DP_SIZE, 0, &ioh); if (err) goto fail_retarn_dp; sc->dp_ioh = ioh; /* map Display Controller registers */ - err = bus_space_map(iot, IPU_DC_BASE, IPU_DC_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DC_BASE(base), IPU_DC_SIZE, 0, &ioh); if (err) goto fail_retarn_dc; sc->dc_ioh = ioh; /* map Image DMA Controller registers */ - err = bus_space_map(iot, IPU_IDMAC_BASE, IPU_IDMAC_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_IDMAC_BASE(base), IPU_IDMAC_SIZE, 0, + &ioh); if (err) goto fail_retarn_idmac; sc->idmac_ioh = ioh; /* map CPMEM registers */ - err = bus_space_map(iot, IPU_CPMEM_BASE, IPU_CPMEM_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_CPMEM_BASE(base), IPU_CPMEM_SIZE, 0, + &ioh); if (err) goto fail_retarn_cpmem; sc->cpmem_ioh = ioh; /* map DCTEMPL registers */ - err = bus_space_map(iot, IPU_DCTMPL_BASE, IPU_DCTMPL_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DCTMPL_BASE(base), IPU_DCTMPL_SIZE, 0, + &ioh); if (err) goto fail_retarn_dctmpl; sc->dctmpl_ioh = ioh; Modified: head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c Tue Apr 8 02:36:27 2014 (r264250) +++ head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c Tue Apr 8 04:05:04 2014 (r264251) @@ -190,7 +190,7 @@ ipu3_fb_probe(device_t dev) if (!ofw_bus_is_compatible(dev, "fsl,ipu3")) return (ENXIO); - device_set_desc(dev, "i.MX515 Image Processing Unit (FB)"); + device_set_desc(dev, "i.MX5x Image Processing Unit v3 (FB)"); return (BUS_PROBE_DEFAULT); } @@ -201,70 +201,87 @@ ipu3_fb_attach(device_t dev) struct ipu3sc_softc *sc = device_get_softc(dev); bus_space_tag_t iot; bus_space_handle_t ioh; - int err; + phandle_t node; + pcell_t reg; + int err; + uintptr_t base; ipu3sc_softc = sc; - device_printf(dev, "\tclock gate status is %d\n", - imx51_get_clk_gating(IMX51CLK_IPU_HSP_CLK_ROOT)); + if (bootverbose) + device_printf(dev, "clock gate status is %d\n", + imx51_get_clk_gating(IMX51CLK_IPU_HSP_CLK_ROOT)); sc->dev = dev; sc = device_get_softc(dev); sc->iot = iot = fdtbus_bs_tag; - device_printf(sc->dev, ": i.MX51 IPUV3 controller\n"); - + /* + * Retrieve the device address based on the start address in the + * DTS. The DTS for i.MX51 specifies 0x5e000000 as the first register + * address, so we just subtract IPU_CM_BASE to get the offset at which + * the IPU device was memory mapped. + * On i.MX53, the offset is 0. + */ + node = ofw_bus_get_node(dev); + if ((OF_getprop(node, "reg", ®, sizeof(reg))) <= 0) + base = 0; + else + base = fdt32_to_cpu(reg) - IPU_CM_BASE(0); /* map controller registers */ - err = bus_space_map(iot, IPU_CM_BASE, IPU_CM_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_CM_BASE(base), IPU_CM_SIZE, 0, &ioh); if (err) goto fail_retarn_cm; sc->cm_ioh = ioh; /* map Display Multi FIFO Controller registers */ - err = bus_space_map(iot, IPU_DMFC_BASE, IPU_DMFC_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DMFC_BASE(base), IPU_DMFC_SIZE, 0, &ioh); if (err) goto fail_retarn_dmfc; sc->dmfc_ioh = ioh; /* map Display Interface 0 registers */ - err = bus_space_map(iot, IPU_DI0_BASE, IPU_DI0_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DI0_BASE(base), IPU_DI0_SIZE, 0, &ioh); if (err) goto fail_retarn_di0; sc->di0_ioh = ioh; /* map Display Interface 1 registers */ - err = bus_space_map(iot, IPU_DI1_BASE, IPU_DI0_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DI1_BASE(base), IPU_DI0_SIZE, 0, &ioh); if (err) goto fail_retarn_di1; sc->di1_ioh = ioh; /* map Display Processor registers */ - err = bus_space_map(iot, IPU_DP_BASE, IPU_DP_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DP_BASE(base), IPU_DP_SIZE, 0, &ioh); if (err) goto fail_retarn_dp; sc->dp_ioh = ioh; /* map Display Controller registers */ - err = bus_space_map(iot, IPU_DC_BASE, IPU_DC_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DC_BASE(base), IPU_DC_SIZE, 0, &ioh); if (err) goto fail_retarn_dc; sc->dc_ioh = ioh; /* map Image DMA Controller registers */ - err = bus_space_map(iot, IPU_IDMAC_BASE, IPU_IDMAC_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_IDMAC_BASE(base), IPU_IDMAC_SIZE, 0, + &ioh); if (err) goto fail_retarn_idmac; sc->idmac_ioh = ioh; /* map CPMEM registers */ - err = bus_space_map(iot, IPU_CPMEM_BASE, IPU_CPMEM_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_CPMEM_BASE(base), IPU_CPMEM_SIZE, 0, + &ioh); if (err) goto fail_retarn_cpmem; sc->cpmem_ioh = ioh; /* map DCTEMPL registers */ - err = bus_space_map(iot, IPU_DCTMPL_BASE, IPU_DCTMPL_SIZE, 0, &ioh); + err = bus_space_map(iot, IPU_DCTMPL_BASE(base), IPU_DCTMPL_SIZE, 0, + &ioh); if (err) goto fail_retarn_dctmpl; sc->dctmpl_ioh = ioh; Modified: head/sys/arm/freescale/imx/imx51_ipuv3reg.h ============================================================================== --- head/sys/arm/freescale/imx/imx51_ipuv3reg.h Tue Apr 8 02:36:27 2014 (r264250) +++ head/sys/arm/freescale/imx/imx51_ipuv3reg.h Tue Apr 8 04:05:04 2014 (r264251) @@ -877,43 +877,46 @@ #define GPU_BASE 0x30000000 #define GPU_SIZE 0x10000000 -/* Image Prossasing Unit */ -#define IPU_BASE 0x40000000 -#define IPU_CM_BASE (IPU_BASE + 0x1e000000) -#define IPU_CM_SIZE 0x8000 -#define IPU_IDMAC_BASE (IPU_BASE + 0x1e008000) -#define IPU_IDMAC_SIZE 0x8000 -#define IPU_DP_BASE (IPU_BASE + 0x1e018000) -#define IPU_DP_SIZE 0x8000 -#define IPU_IC_BASE (IPU_BASE + 0x1e020000) -#define IPU_IC_SIZE 0x8000 -#define IPU_IRT_BASE (IPU_BASE + 0x1e028000) -#define IPU_IRT_SIZE 0x8000 -#define IPU_CSI0_BASE (IPU_BASE + 0x1e030000) -#define IPU_CSI0_SIZE 0x8000 -#define IPU_CSI1_BASE (IPU_BASE + 0x1e038000) -#define IPU_CSI1_SIZE 0x8000 -#define IPU_DI0_BASE (IPU_BASE + 0x1e040000) -#define IPU_DI0_SIZE 0x8000 -#define IPU_DI1_BASE (IPU_BASE + 0x1e048000) -#define IPU_DI1_SIZE 0x8000 -#define IPU_SMFC_BASE (IPU_BASE + 0x1e050000) -#define IPU_SMFC_SIZE 0x8000 -#define IPU_DC_BASE (IPU_BASE + 0x1e058000) -#define IPU_DC_SIZE 0x8000 -#define IPU_DMFC_BASE (IPU_BASE + 0x1e060000) -#define IPU_DMFC_SIZE 0x8000 -#define IPU_VDI_BASE (IPU_BASE + 0x1e068000) -#define IPU_VDI_SIZE 0x8000 -#define IPU_CPMEM_BASE (IPU_BASE + 0x1f000000) -#define IPU_CPMEM_SIZE 0x20000 -#define IPU_LUT_BASE (IPU_BASE + 0x1f020000) -#define IPU_LUT_SIZE 0x20000 -#define IPU_SRM_BASE (IPU_BASE + 0x1f040000) -#define IPU_SRM_SIZE 0x20000 -#define IPU_TPM_BASE (IPU_BASE + 0x1f060000) -#define IPU_TPM_SIZE 0x20000 -#define IPU_DCTMPL_BASE (IPU_BASE + 0x1f080000) -#define IPU_DCTMPL_SIZE 0x20000 +/* + * Image Processing Unit + * + * All addresses are relative to the base SoC address. + */ +#define IPU_CM_BASE(_base) ((_base) + 0x1e000000) +#define IPU_CM_SIZE 0x8000 +#define IPU_IDMAC_BASE(_base) ((_base) + 0x1e008000) +#define IPU_IDMAC_SIZE 0x8000 +#define IPU_DP_BASE(_base) ((_base) + 0x1e018000) +#define IPU_DP_SIZE 0x8000 +#define IPU_IC_BASE(_base) ((_base) + 0x1e020000) +#define IPU_IC_SIZE 0x8000 +#define IPU_IRT_BASE(_base) ((_base) + 0x1e028000) +#define IPU_IRT_SIZE 0x8000 +#define IPU_CSI0_BASE(_base) ((_base) + 0x1e030000) +#define IPU_CSI0_SIZE 0x8000 +#define IPU_CSI1_BASE(_base) ((_base) + 0x1e038000) +#define IPU_CSI1_SIZE 0x8000 +#define IPU_DI0_BASE(_base) ((_base) + 0x1e040000) +#define IPU_DI0_SIZE 0x8000 +#define IPU_DI1_BASE(_base) ((_base) + 0x1e048000) +#define IPU_DI1_SIZE 0x8000 +#define IPU_SMFC_BASE(_base) ((_base) + 0x1e050000) +#define IPU_SMFC_SIZE 0x8000 +#define IPU_DC_BASE(_base) ((_base) + 0x1e058000) +#define IPU_DC_SIZE 0x8000 +#define IPU_DMFC_BASE(_base) ((_base) + 0x1e060000) +#define IPU_DMFC_SIZE 0x8000 +#define IPU_VDI_BASE(_base) ((_base) + 0x1e068000) +#define IPU_VDI_SIZE 0x8000 +#define IPU_CPMEM_BASE(_base) ((_base) + 0x1f000000) +#define IPU_CPMEM_SIZE 0x20000 +#define IPU_LUT_BASE(_base) ((_base) + 0x1f020000) +#define IPU_LUT_SIZE 0x20000 +#define IPU_SRM_BASE(_base) ((_base) + 0x1f040000) +#define IPU_SRM_SIZE 0x20000 +#define IPU_TPM_BASE(_base) ((_base) + 0x1f060000) +#define IPU_TPM_SIZE 0x20000 +#define IPU_DCTMPL_BASE(_base) ((_base) + 0x1f080000) +#define IPU_DCTMPL_SIZE 0x20000 #endif /* _ARM_IMX_IMX51_IPUV3REG_H */ Modified: head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts Tue Apr 8 02:36:27 2014 (r264250) +++ head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts Tue Apr 8 04:05:04 2014 (r264251) @@ -46,7 +46,7 @@ }; localbus@18000000 { - ipu3@18000000 { + ipu3@1E000000 { status = "okay"; }; }; Modified: head/sys/boot/fdt/dts/arm/imx53-qsb.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/imx53-qsb.dts Tue Apr 8 02:36:27 2014 (r264250) +++ head/sys/boot/fdt/dts/arm/imx53-qsb.dts Tue Apr 8 04:05:04 2014 (r264251) @@ -47,7 +47,7 @@ }; localbus@18000000 { - ipu3@18000000 { + ipu3@1E000000 { status = "okay"; }; }; Modified: head/sys/boot/fdt/dts/arm/imx53x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/imx53x.dtsi Tue Apr 8 02:36:27 2014 (r264250) +++ head/sys/boot/fdt/dts/arm/imx53x.dtsi Tue Apr 8 04:05:04 2014 (r264251) @@ -657,27 +657,27 @@ ranges; - vga: ipu3@18000000 { + vga: ipu3@1E000000 { compatible = "fsl,ipu3"; reg = < - 0x18000000 0x08000 /* CM */ - 0x18008000 0x08000 /* IDMAC */ - 0x18018000 0x08000 /* DP */ - 0x18020000 0x08000 /* IC */ - 0x18028000 0x08000 /* IRT */ - 0x18030000 0x08000 /* CSI0 */ - 0x18038000 0x08000 /* CSI1 */ - 0x18040000 0x08000 /* DI0 */ - 0x18048000 0x08000 /* DI1 */ - 0x18050000 0x08000 /* SMFC */ - 0x18058000 0x08000 /* DC */ - 0x18060000 0x08000 /* DMFC */ - 0x18068000 0x08000 /* VDI */ - 0x19000000 0x20000 /* CPMEM */ - 0x19020000 0x20000 /* LUT */ - 0x19040000 0x20000 /* SRM */ - 0x19060000 0x20000 /* TPM */ - 0x19080000 0x20000 /* DCTMPL */ + 0x1E000000 0x08000 /* CM */ + 0x1E008000 0x08000 /* IDMAC */ + 0x1E018000 0x08000 /* DP */ + 0x1E020000 0x08000 /* IC */ + 0x1E028000 0x08000 /* IRT */ + 0x1E030000 0x08000 /* CSI0 */ + 0x1E038000 0x08000 /* CSI1 */ + 0x1E040000 0x08000 /* DI0 */ + 0x1E048000 0x08000 /* DI1 */ + 0x1E050000 0x08000 /* SMFC */ + 0x1E058000 0x08000 /* DC */ + 0x1E060000 0x08000 /* DMFC */ + 0x1E068000 0x08000 /* VDI */ + 0x1F000000 0x20000 /* CPMEM */ + 0x1F020000 0x20000 /* LUT */ + 0x1F040000 0x20000 /* SRM */ + 0x1F060000 0x20000 /* TPM */ + 0x1F080000 0x20000 /* DCTMPL */ >; interrupt-parent = <&tzic>; interrupts = < From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 07:00:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 599F748D; Tue, 8 Apr 2014 07:00:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D2BD1B44; Tue, 8 Apr 2014 07:00:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3870inf066613; Tue, 8 Apr 2014 07:00:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3870iMA066612; Tue, 8 Apr 2014 07:00:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404080700.s3870iMA066612@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Apr 2014 07:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264252 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 07:00:44 -0000 Author: adrian Date: Tue Apr 8 07:00:43 2014 New Revision: 264252 URL: http://svnweb.freebsd.org/changeset/base/264252 Log: Don't resume a TID on each filtered frame completion - only do it if we did suspend it. The whole suspend/resume TID queue thing is supposed to be a matched reference count - a subsystem (eg addba negotiation, BAR transmission, filtered frames, etc) is supposed to call pause() once and then resume() once. ath_tx_tid_filt_comp_complete() is called upon the completion of any filtered frame, regardless of whether the driver had aleady seen a filtered frame and called pause(). So only call resume() if tid->isfiltered = 1, which indicates that we had called pause() once. This fixes a seemingly whacked and different problem - traffic hangs. What was actually going on: * There'd be some marginal link with crappy behaviour, causing filtered frames and BAR TXing to occur; * A BAR TX would occur, setting the new BAW (block-ack window) to seqno n; * .. and pause() would be called, blocking further transmission; * A filtered frame completion would occur from the hardware, but with tid->isfiltered = 0 which indiciates we haven't actually marked the queue yet as filtered; * ath_tx_tid_filt_comp_complete() would call resume(), continuing transmission; * Some frames would be queued to the hardware, since the TID is now no longer paused; * .. and if some make it out and ACked successfully, the new BAW may be seqno n+1 or more; * .. then the BAR TX completes and sets the new seqno back to n. At this point the BAW tracking would be loopy because the BAW start was modified but the BAW ring buffer wasn't updated in lock step. Tested: * Routerstation Pro + AR9220 AP Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Apr 8 04:05:04 2014 (r264251) +++ head/sys/dev/ath/if_ath_tx.c Tue Apr 8 07:00:43 2014 (r264252) @@ -3357,6 +3357,7 @@ static void ath_tx_tid_filt_comp_complete(struct ath_softc *sc, struct ath_tid *tid) { struct ath_buf *bf; + int do_resume = 0; ATH_TX_LOCK_ASSERT(sc); @@ -3365,7 +3366,11 @@ ath_tx_tid_filt_comp_complete(struct ath DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, "%s: hwq=0, transition back\n", __func__); - tid->isfiltered = 0; + if (tid->isfiltered == 1) { + tid->isfiltered = 0; + do_resume = 1; + } + /* XXX ath_tx_tid_resume() also calls ath_tx_set_clrdmask()! */ ath_tx_set_clrdmask(sc, tid->an); @@ -3375,7 +3380,8 @@ ath_tx_tid_filt_comp_complete(struct ath ATH_TID_INSERT_HEAD(tid, bf, bf_list); } - ath_tx_tid_resume(sc, tid); + if (do_resume) + ath_tx_tid_resume(sc, tid); } /* From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 07:01:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7B545D3; Tue, 8 Apr 2014 07:01:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6948E1BD7; Tue, 8 Apr 2014 07:01:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3871Sai067427; Tue, 8 Apr 2014 07:01:28 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3871SxG067426; Tue, 8 Apr 2014 07:01:28 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404080701.s3871SxG067426@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Apr 2014 07:01:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264253 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 07:01:28 -0000 Author: adrian Date: Tue Apr 8 07:01:27 2014 New Revision: 264253 URL: http://svnweb.freebsd.org/changeset/base/264253 Log: Add a comment explaining the obvious. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Apr 8 07:00:43 2014 (r264252) +++ head/sys/dev/ath/if_ath_tx.c Tue Apr 8 07:01:27 2014 (r264253) @@ -3380,6 +3380,7 @@ ath_tx_tid_filt_comp_complete(struct ath ATH_TID_INSERT_HEAD(tid, bf, bf_list); } + /* And only resume if we had paused before */ if (do_resume) ath_tx_tid_resume(sc, tid); } From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 07:09:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3FD6A931; Tue, 8 Apr 2014 07:09:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 130AA1C25; Tue, 8 Apr 2014 07:09:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3878xEI068240; Tue, 8 Apr 2014 07:08:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3878xTb068239; Tue, 8 Apr 2014 07:08:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404080708.s3878xTb068239@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Apr 2014 07:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264254 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 07:09:00 -0000 Author: adrian Date: Tue Apr 8 07:08:59 2014 New Revision: 264254 URL: http://svnweb.freebsd.org/changeset/base/264254 Log: Correct the actual definition of ath_tx_tid_filt_comp_single() to match how it's used. This is another bug that led to aggregate traffic hanging because the BAW tracking stopped being accurate. In this instance, a filtered frame that exceeded retries would return a non-error, which would mean the caller would never remove it from the BAW. But it wouldn't be added to the filtered list, so it would be lost forever. There'd thus be a hole in the BAW that would never get transmitted and this leads to a traffic hang. Tested: * Routerstation Pro, AR9220 AP Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Apr 8 07:01:27 2014 (r264253) +++ head/sys/dev/ath/if_ath_tx.c Tue Apr 8 07:08:59 2014 (r264254) @@ -3388,10 +3388,13 @@ ath_tx_tid_filt_comp_complete(struct ath /* * Called when a single (aggregate or otherwise) frame is completed. * - * Returns 1 if the buffer could be added to the filtered list - * (cloned or otherwise), 0 if the buffer couldn't be added to the + * Returns 0 if the buffer could be added to the filtered list + * (cloned or otherwise), 1 if the buffer couldn't be added to the * filtered list (failed clone; expired retry) and the caller should * free it and handle it like a failure (eg by sending a BAR.) + * + * since the buffer may be cloned, bf must be not touched after this + * if the return value is 0. */ static int ath_tx_tid_filt_comp_single(struct ath_softc *sc, struct ath_tid *tid, @@ -3412,7 +3415,8 @@ ath_tx_tid_filt_comp_single(struct ath_s __func__, bf, bf->bf_state.bfs_seqno); - return (0); + retval = 1; /* error */ + goto finish; } /* @@ -3432,11 +3436,12 @@ ath_tx_tid_filt_comp_single(struct ath_s DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, "%s: busy buffer couldn't be cloned (%p)!\n", __func__, bf); - retval = 1; + retval = 1; /* error */ } else { ath_tx_tid_filt_comp_buf(sc, tid, nbf); - retval = 0; + retval = 0; /* ok */ } +finish: ath_tx_tid_filt_comp_complete(sc, tid); return (retval); From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 07:10:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C9A9A78; Tue, 8 Apr 2014 07:10:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39A991C99; Tue, 8 Apr 2014 07:10:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s387Ar7V068967; Tue, 8 Apr 2014 07:10:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s387ArHo068966; Tue, 8 Apr 2014 07:10:53 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404080710.s387ArHo068966@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Apr 2014 07:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264255 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 07:10:53 -0000 Author: adrian Date: Tue Apr 8 07:10:52 2014 New Revision: 264255 URL: http://svnweb.freebsd.org/changeset/base/264255 Log: Don't do continue inside the scheduler loop; we really need to check if we've hit the end of the list and cycled around to the first node again. Obtained from: DragonflyBSD Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Apr 8 07:08:59 2014 (r264254) +++ head/sys/dev/ath/if_ath_tx.c Tue Apr 8 07:10:52 2014 (r264255) @@ -5509,7 +5509,7 @@ ath_txq_sched(struct ath_softc *sc, stru * a frame; be careful. */ if (! ath_tx_tid_can_tx_or_sched(sc, tid)) { - continue; + goto loop_done; } if (ath_tx_ampdu_running(sc, tid->an, tid->tid)) ath_tx_tid_hw_queue_aggr(sc, tid->an, tid); @@ -5532,7 +5532,7 @@ ath_txq_sched(struct ath_softc *sc, stru if (txq->axq_depth >= sc->sc_hwq_limit_nonaggr) { break; } - +loop_done: /* * If this was the last entry on the original list, stop. * Otherwise nodes that have been rescheduled onto the end From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 07:14:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95C87CD8; Tue, 8 Apr 2014 07:14:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 761491CC3; Tue, 8 Apr 2014 07:14:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s387EFB2071934; Tue, 8 Apr 2014 07:14:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s387EFN2071933; Tue, 8 Apr 2014 07:14:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404080714.s387EFN2071933@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Apr 2014 07:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264256 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 07:14:15 -0000 Author: adrian Date: Tue Apr 8 07:14:14 2014 New Revision: 264256 URL: http://svnweb.freebsd.org/changeset/base/264256 Log: Add some debugging and forcing of the BAW to match what the current tracked BAW actually is. The net80211 code that completes a BAR will set tid->txa_start (the BAW start) to whatever value was called when sending the BAR. Now, in case there's bugs in my driver code that cause the BAW to slip along, we should make sure that the new BAW we start at is actually what we currently have it at, not what we've sent. This totally breaks the specification and so this stays a printf(). If it happens then I need to know and fix it. Whilst here, add some debugging updates: * add TID logging to places where it's useful; * use SEQNO(). Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Apr 8 07:10:52 2014 (r264255) +++ head/sys/dev/ath/if_ath_tx.c Tue Apr 8 07:14:14 2014 (r264256) @@ -2750,8 +2750,8 @@ ath_tx_update_baw(struct ath_softc *sc, INCR(tid->baw_head, ATH_TID_MAX_BUFS); } DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, - "%s: baw is now %d:%d, baw head=%d\n", - __func__, tap->txa_start, tap->txa_wnd, tid->baw_head); + "%s: tid=%d: baw is now %d:%d, baw head=%d\n", + __func__, tid->tid, tap->txa_start, tap->txa_wnd, tid->baw_head); } static void @@ -3336,8 +3336,8 @@ ath_tx_tid_filt_comp_buf(struct ath_soft ATH_TX_LOCK_ASSERT(sc); if (! tid->isfiltered) { - DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, "%s: filter transition\n", - __func__); + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, "%s: tid=%d; filter transition\n", + __func__, tid->tid); tid->isfiltered = 1; ath_tx_tid_pause(sc, tid); } @@ -3364,8 +3364,8 @@ ath_tx_tid_filt_comp_complete(struct ath if (tid->hwq_depth != 0) return; - DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, "%s: hwq=0, transition back\n", - __func__); + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, "%s: tid=%d, hwq=0, transition back\n", + __func__, tid->tid); if (tid->isfiltered == 1) { tid->isfiltered = 0; do_resume = 1; @@ -3414,7 +3414,7 @@ ath_tx_tid_filt_comp_single(struct ath_s "%s: bf=%p, seqno=%d, exceeded retries\n", __func__, bf, - bf->bf_state.bfs_seqno); + SEQNO(bf->bf_state.bfs_seqno)); retval = 1; /* error */ goto finish; } @@ -3466,10 +3466,11 @@ ath_tx_tid_filt_comp_aggr(struct ath_sof if (bf->bf_state.bfs_retries > SWMAX_RETRIES) { sc->sc_stats.ast_tx_swretrymax++; DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, - "%s: bf=%p, seqno=%d, exceeded retries\n", + "%s: tid=%d, bf=%p, seqno=%d, exceeded retries\n", __func__, + tid->tid, bf, - bf->bf_state.bfs_seqno); + SEQNO(bf->bf_state.bfs_seqno)); TAILQ_INSERT_TAIL(bf_q, bf, bf_list); goto next; } @@ -3477,8 +3478,8 @@ ath_tx_tid_filt_comp_aggr(struct ath_sof if (bf->bf_flags & ATH_BUF_BUSY) { nbf = ath_tx_retry_clone(sc, tid->an, tid, bf); DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, - "%s: busy buffer cloned: %p -> %p", - __func__, bf, nbf); + "%s: tid=%d, busy buffer cloned: %p -> %p, seqno=%d\n", + __func__, tid->tid, bf, nbf, SEQNO(bf->bf_state.bfs_seqno)); } else { nbf = bf; } @@ -3489,8 +3490,8 @@ ath_tx_tid_filt_comp_aggr(struct ath_sof */ if (nbf == NULL) { DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, - "%s: buffer couldn't be cloned! (%p)\n", - __func__, bf); + "%s: tid=%d, buffer couldn't be cloned! (%p) seqno=%d\n", + __func__, tid->tid, bf, SEQNO(bf->bf_state.bfs_seqno)); TAILQ_INSERT_TAIL(bf_q, bf, bf_list); } else { ath_tx_tid_filt_comp_buf(sc, tid, nbf); @@ -5044,6 +5045,10 @@ ath_tx_aggr_comp_unaggr(struct ath_softc "%s: isfiltered=1, fail=%d\n", __func__, fail); freeframe = ath_tx_tid_filt_comp_single(sc, atid, bf); + /* + * If freeframe=0 then bf is no longer ours; don't + * touch it. + */ if (freeframe) { /* Remove from BAW */ if (bf->bf_state.bfs_addedbaw) @@ -5079,7 +5084,6 @@ ath_tx_aggr_comp_unaggr(struct ath_softc if (freeframe) ath_tx_default_comp(sc, bf, fail); - return; } /* @@ -5866,19 +5870,43 @@ ath_bar_response(struct ieee80211_node * struct ath_node *an = ATH_NODE(ni); struct ath_tid *atid = &an->an_tid[tid]; int attempts = tap->txa_attempts; + int old_txa_start; DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, - "%s: %6D: called; txa_tid=%d, atid->tid=%d, status=%d, attempts=%d\n", + "%s: %6D: called; txa_tid=%d, atid->tid=%d, status=%d, attempts=%d, txa_start=%d, txa_seqpending=%d\n", __func__, ni->ni_macaddr, ":", tap->txa_tid, atid->tid, status, - attempts); + attempts, + tap->txa_start, + tap->txa_seqpending); /* Note: This may update the BAW details */ + /* + * XXX What if this does slide the BAW along? We need to somehow + * XXX either fix things when it does happen, or prevent the + * XXX seqpending value to be anything other than exactly what + * XXX the hell we want! + * + * XXX So for now, how I do this inside the TX lock for now + * XXX and just correct it afterwards? The below condition should + * XXX never happen and if it does I need to fix all kinds of things. + */ + ATH_TX_LOCK(sc); + old_txa_start = tap->txa_start; sc->sc_bar_response(ni, tap, status); + if (tap->txa_start != old_txa_start) { + device_printf(sc->sc_dev, "%s: tid=%d; txa_start=%d, old=%d, adjusting\n", + __func__, + tid, + tap->txa_start, + old_txa_start); + } + tap->txa_start = old_txa_start; + ATH_TX_UNLOCK(sc); /* Unpause the TID */ /* From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 07:32:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2EF10765; Tue, 8 Apr 2014 07:32:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B5731FC7; Tue, 8 Apr 2014 07:32:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s387WWQc080352; Tue, 8 Apr 2014 07:32:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s387WWDo080350; Tue, 8 Apr 2014 07:32:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404080732.s387WWDo080350@svn.freebsd.org> From: Marius Strobl Date: Tue, 8 Apr 2014 07:32:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264257 - in head/sys/dev: puc uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 07:32:33 -0000 Author: marius Date: Tue Apr 8 07:32:32 2014 New Revision: 264257 URL: http://svnweb.freebsd.org/changeset/base/264257 Log: Distinguish between the different variants and configurations of Sunix {MIO,SER}5xxxx chips instead of treating all of them as PUC_PORT_2S. Among others, this fixes the hang seen when trying to probe the none- existent second UART on an actually 1-port chip. Obtained from: NetBSD (BAR layouts) MFC after: 3 days Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: head/sys/dev/puc/pucdata.c head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Tue Apr 8 07:14:14 2014 (r264256) +++ head/sys/dev/puc/pucdata.c Tue Apr 8 07:32:32 2014 (r264257) @@ -59,6 +59,7 @@ static puc_config_f puc_config_oxford_pc static puc_config_f puc_config_quatech; static puc_config_f puc_config_syba; static puc_config_f puc_config_siig; +static puc_config_f puc_config_sunix; static puc_config_f puc_config_timedia; static puc_config_f puc_config_titan; @@ -987,12 +988,53 @@ const struct puc_cfg puc_pci_devices[] = .config_function = puc_config_syba }, - { 0x1fd4, 0x1999, 0xffff, 0, - "Sunix SER5437A", + /* Prevent puc(4) from attaching, directly use uart(4) instead. */ + { 0x1fd4, 0x1999, 0x1fd4, 0x0001, + "Sunix SER5xxxx 1-port serial", + DEFAULT_RCLK * 8, + PUC_PORT_1S, 0x10, 0, 8, + }, + + { 0x1fd4, 0x1999, 0x1fd4, 0x0002, + "Sunix SER5xxxx 2-port serial", DEFAULT_RCLK * 8, PUC_PORT_2S, 0x10, 0, 8, }, + { 0x1fd4, 0x1999, 0x1fd4, 0x0004, + "Sunix SER5xxxx 4-port serial", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x10, 0, 8, + }, + + { 0x1fd4, 0x1999, 0x1fd4, 0x0008, + "Sunix SER5xxxx 8-port serial", + DEFAULT_RCLK * 8, + PUC_PORT_8S, -1, -1, -1, + .config_function = puc_config_sunix + }, + + { 0x1fd4, 0x1999, 0x1fd4, 0x0101, + "Sunix MIO5xxxx 1-port serial and 1284 Printer port", + DEFAULT_RCLK * 8, + PUC_PORT_1S1P, -1, -1, -1, + .config_function = puc_config_sunix + }, + + { 0x1fd4, 0x1999, 0x1fd4, 0x0102, + "Sunix MIOxxxx 2-port serial and 1284 Printer port", + DEFAULT_RCLK * 8, + PUC_PORT_2S1P, -1, -1, -1, + .config_function = puc_config_sunix + }, + + { 0x1fd4, 0x1999, 0x1fd4, 0x0104, + "Sunix MIO5xxxx 4-port serial and 1284 Printer port", + DEFAULT_RCLK * 8, + PUC_PORT_4S1P, -1, -1, -1, + .config_function = puc_config_sunix + }, + { 0x5372, 0x6873, 0xffff, 0, "Sun 1040 PCI Quad Serial", DEFAULT_RCLK, @@ -1024,8 +1066,8 @@ const struct puc_cfg puc_pci_devices[] = }, /* - * This is more specific than the generic NM9835 entry that follows, and - * is placed here to _prevent_ puc from claiming this single port card. + * This is more specific than the generic NM9835 entry, and is placed + * here to _prevent_ puc(4) from claiming this single port card. * * uart(4) will claim this device. */ @@ -1614,6 +1656,31 @@ puc_config_oxford_pcie(struct puc_softc } static int +puc_config_sunix(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, + intptr_t *res) +{ + int error; + + switch (cmd) { + case PUC_CFG_GET_OFS: + error = puc_config(sc, PUC_CFG_GET_TYPE, port, res); + if (error != 0) + return (error); + *res = (*res == PUC_TYPE_SERIAL) ? (port & 3) * 8 : 0; + return (0); + case PUC_CFG_GET_RID: + error = puc_config(sc, PUC_CFG_GET_TYPE, port, res); + if (error != 0) + return (error); + *res = (*res == PUC_TYPE_SERIAL && port <= 3) ? 0x10 : 0x14; + return (0); + default: + break; + } + return (ENXIO); +} + +static int puc_config_titan(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, intptr_t *res) { Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Tue Apr 8 07:14:14 2014 (r264256) +++ head/sys/dev/uart/uart_bus_pci.c Tue Apr 8 07:32:32 2014 (r264257) @@ -114,6 +114,8 @@ static const struct pci_id pci_ns8250_id 0x10, 16384000 }, { 0x14e4, 0x4344, 0xffff, 0, "Sony Ericsson GC89 PC Card", 0x10}, { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, +{ 0x1fd4, 0x1999, 0x1fd4, 0x0001, "Sunix SER5xxxx Serial Port", 0x10, + 8 * DEFAULT_RCLK }, { 0x8086, 0x1c3d, 0xffff, 0, "Intel AMT - KT Controller", 0x10 }, { 0x8086, 0x1d3d, 0xffff, 0, "Intel C600/X79 Series Chipset KT Controller", 0x10 }, { 0x8086, 0x2e17, 0xffff, 0, "4 Series Chipset Serial KT Controller", 0x10 }, From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 13:37:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F780189; Tue, 8 Apr 2014 13:37:39 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28329123A; Tue, 8 Apr 2014 13:37:39 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 930C4B946; Tue, 8 Apr 2014 09:37:37 -0400 (EDT) From: John Baldwin To: Adrian Chadd Subject: Re: svn commit: r264250 - head/sys/dev/acpica Date: Tue, 8 Apr 2014 09:14:25 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201404080236.s382aR4W057350@svn.freebsd.org> In-Reply-To: <201404080236.s382aR4W057350@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201404080914.25220.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 08 Apr 2014 09:37:37 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 13:37:39 -0000 On Monday, April 07, 2014 10:36:27 pm Adrian Chadd wrote: > Author: adrian > Date: Tue Apr 8 02:36:27 2014 > New Revision: 264250 > URL: http://svnweb.freebsd.org/changeset/base/264250 > > Log: > Add a basic set of data points which count the number of sleep entries > that are being done by the OS. > > For now this'll match up with the "wakeups"; although I'll dig deeper into > this to see if we can determine which sleep state the CPU managed to get > into. Most things I've seen these days only expose up to C2 or C3 via > ACPI even though the CPU goes all the way down to C6 or C7. No, those are actually the same thing. ACPI and Intel both use C-states for the same thing, but the numbers don't line up. That is, Intel's C6/C7 gets exposed to the OS as C2/C3 via ACPI. The 6/7 does matter, (I think) if you are using monitor/mwait as I believe the value you configure for an mwait sleep has to use Intel's number (6/7) whereas the ACPI number (2/3) is assigned by the results of _CST or whichever object it is ACPI queries. All that to say that ACPI is already using Intel's C6/C7 if you have configured your BIOS to expose it. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 13:37:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0839220C; Tue, 8 Apr 2014 13:37:42 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDA05123C; Tue, 8 Apr 2014 13:37:42 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BA6A9B95B; Tue, 8 Apr 2014 09:37:41 -0400 (EDT) From: John Baldwin To: Devin Teske Subject: Re: svn commit: r264243 - in head/etc: . rc.d Date: Tue, 8 Apr 2014 09:17:23 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201404072240.s37MeTqo085123@svn.freebsd.org> In-Reply-To: <201404072240.s37MeTqo085123@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201404080917.23789.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 08 Apr 2014 09:37:41 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 13:37:43 -0000 On Monday, April 07, 2014 6:40:29 pm Devin Teske wrote: > Author: dteske > Date: Mon Apr 7 22:40:29 2014 > New Revision: 264243 > URL: http://svnweb.freebsd.org/changeset/base/264243 > > Log: > Loosen the processing of *_IF_aliasN vars to be less strict. Previously, > the first alias had to be _alias0 and processing stopped at the first non- > defined variable (preventing gaps). Allowing gaps gives the administrator > the ability to group aliases in an adhoc manner and also lifts the > requirement to renumber aliases simply to comment-out an existing one. > Aliases are processed in numerical ascending order. > > Discussed on: -rc > MFC after: 1 week Forgot to mention mdconfig in the log message (or did you mean to commit that separately)? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 14:14:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 493B2551; Tue, 8 Apr 2014 14:14:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35A661648; Tue, 8 Apr 2014 14:14:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38EEQ4e045454; Tue, 8 Apr 2014 14:14:26 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38EEQJC045453; Tue, 8 Apr 2014 14:14:26 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201404081414.s38EEQJC045453@svn.freebsd.org> From: Aleksandr Rybalko Date: Tue, 8 Apr 2014 14:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264258 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 14:14:26 -0000 Author: ray Date: Tue Apr 8 14:14:25 2014 New Revision: 264258 URL: http://svnweb.freebsd.org/changeset/base/264258 Log: Fix cursor color in reverse video mode. PR: kern/188196 Submitted by: Claude Buisson (original version) MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Tue Apr 8 07:32:32 2014 (r264257) +++ head/sys/dev/vt/vt_core.c Tue Apr 8 14:14:25 2014 (r264258) @@ -652,24 +652,26 @@ static inline void vt_determine_colors(term_char_t c, int cursor, term_color_t *fg, term_color_t *bg) { + term_color_t tmp; + int invert; + + invert = 0; *fg = TCHAR_FGCOLOR(c); if (TCHAR_FORMAT(c) & TF_BOLD) *fg = TCOLOR_LIGHT(*fg); *bg = TCHAR_BGCOLOR(c); - if (TCHAR_FORMAT(c) & TF_REVERSE) { - term_color_t tmp; + if (TCHAR_FORMAT(c) & TF_REVERSE) + invert ^= 1; + if (cursor) + invert ^= 1; + if (invert) { tmp = *fg; *fg = *bg; *bg = tmp; } - - if (cursor) { - *fg = *bg; - *bg = TC_WHITE; - } } static void From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 14:18:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 161537D7; Tue, 8 Apr 2014 14:18:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD513168A; Tue, 8 Apr 2014 14:18:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38EIdh6045990; Tue, 8 Apr 2014 14:18:39 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38EIdk4045989; Tue, 8 Apr 2014 14:18:39 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201404081418.s38EIdk4045989@svn.freebsd.org> From: Aleksandr Rybalko Date: Tue, 8 Apr 2014 14:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264259 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 14:18:40 -0000 Author: ray Date: Tue Apr 8 14:18:39 2014 New Revision: 264259 URL: http://svnweb.freebsd.org/changeset/base/264259 Log: Update to fix at r264244. o Unmute terminal when done with driver replacement. o Move init fonts to early point. o Minor cleanup. MFC after: 6 days X-MFC-with: r264244 r264242 Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Tue Apr 8 14:14:25 2014 (r264258) +++ head/sys/dev/vt/vt_core.c Tue Apr 8 14:18:39 2014 (r264259) @@ -720,9 +720,11 @@ vt_flush(struct vt_device *vd) #endif vw = vd->vd_curwindow; - if (vw == NULL) return; + if (vw == NULL) + return; vf = vw->vw_font; - if ((vf == NULL) && !(vd->vd_flags & VDF_TEXTMODE)) return; + if (((vd->vd_flags & VDF_TEXTMODE) == 0) && (vf == NULL)) + return; if (vd->vd_flags & VDF_SPLASH || vw->vw_flags & VWF_BUSY) return; @@ -1891,9 +1893,6 @@ vt_upgrade(struct vt_device *vd) } terminal_maketty(vw->vw_terminal, "v%r", VT_UNIT(vw)); - /* Assign default font to window, if not textmode. */ - if (!(vd->vd_flags & VDF_TEXTMODE) && vw->vw_font == NULL) - vw->vw_font = vtfont_ref(&vt_font_default); } if (vd->vd_curwindow == NULL) vd->vd_curwindow = vd->vd_windows[VT_CONSWINDOW]; @@ -1914,6 +1913,9 @@ vt_resize(struct vt_device *vd) for (i = 0; i < VT_MAXWINDOWS; i++) { vw = vd->vd_windows[i]; + /* Assign default font to window, if not textmode. */ + if (!(vd->vd_flags & VDF_TEXTMODE) && vw->vw_font == NULL) + vw->vw_font = vtfont_ref(&vt_font_default); /* Resize terminal windows */ vt_change_font(vw, vw->vw_font); } @@ -1975,8 +1977,10 @@ vt_allocate(struct vt_driver *drv, void vtterm_splash(vd); #endif - if (vd->vd_flags & VDF_ASYNC) + if (vd->vd_flags & VDF_ASYNC) { + terminal_mute(vd->vd_curwindow->vw_terminal, 0); callout_schedule(&vd->vd_timer, hz / VT_TIMERFREQ); + } termcn_cnregister(vd->vd_windows[VT_CONSWINDOW]->vw_terminal); From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 17:40:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD711D44; Tue, 8 Apr 2014 17:40:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA0951B92; Tue, 8 Apr 2014 17:40:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38He9Tm028787; Tue, 8 Apr 2014 17:40:09 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38He9xr028786; Tue, 8 Apr 2014 17:40:09 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404081740.s38He9xr028786@svn.freebsd.org> From: Ed Maste Date: Tue, 8 Apr 2014 17:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264260 - head/sys/boot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 17:40:09 -0000 Author: emaste Date: Tue Apr 8 17:40:09 2014 New Revision: 264260 URL: http://svnweb.freebsd.org/changeset/base/264260 Log: Revert r264132, disconnecting sys/boot/amd64 for now Some 64-bit Ficl warnings broke tinderbox builds. Modified: head/sys/boot/Makefile Modified: head/sys/boot/Makefile ============================================================================== --- head/sys/boot/Makefile Tue Apr 8 14:18:39 2014 (r264259) +++ head/sys/boot/Makefile Tue Apr 8 17:40:09 2014 (r264260) @@ -9,12 +9,9 @@ SUBDIR+= ficl .endif # Pick the machine-dependent subdir based on the target architecture. -ADIR= ${MACHINE:S/powerpc64/powerpc/} +ADIR= ${MACHINE:S/amd64/i386/:S/powerpc64/powerpc/} .if exists(${.CURDIR}/${ADIR}/.) SUBDIR+= ${ADIR} .endif -.if ${MACHINE} == "amd64" -SUBDIR+= i386 -.endif .include From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 17:50:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 777E432D; Tue, 8 Apr 2014 17:50:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6447D1CA6; Tue, 8 Apr 2014 17:50:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38HoSBI034580; Tue, 8 Apr 2014 17:50:28 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38HoSFs034579; Tue, 8 Apr 2014 17:50:28 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404081750.s38HoSFs034579@svn.freebsd.org> From: Ed Maste Date: Tue, 8 Apr 2014 17:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264261 - head/sys/boot/ficl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 17:50:28 -0000 Author: emaste Date: Tue Apr 8 17:50:27 2014 New Revision: 264261 URL: http://svnweb.freebsd.org/changeset/base/264261 Log: Correct a variable's type for 64-bit Ficl FICL_INT is long. Modified: head/sys/boot/ficl/words.c Modified: head/sys/boot/ficl/words.c ============================================================================== --- head/sys/boot/ficl/words.c Tue Apr 8 17:40:09 2014 (r264260) +++ head/sys/boot/ficl/words.c Tue Apr 8 17:50:27 2014 (r264261) @@ -2567,7 +2567,7 @@ static void setObjectFlag(FICL_VM *pVM) static void isObject(FICL_VM *pVM) { - int flag; + FICL_INT flag; FICL_WORD *pFW = (FICL_WORD *)stackPopPtr(pVM->pStack); flag = ((pFW != NULL) && (pFW->flags & FW_ISOBJECT)) ? FICL_TRUE : FICL_FALSE; From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 17:56:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52F5F5BF; Tue, 8 Apr 2014 17:56:11 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx1.fisglobal.com", Issuer "VeriSign Class 3 Secure Server CA - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B1631D5A; Tue, 8 Apr 2014 17:56:10 +0000 (UTC) Received: from smarthost.fisglobal.com ([10.132.206.193]) by ltcfislmsgpa03.fnfis.com (8.14.5/8.14.5) with ESMTP id s38Hu9Vj025234 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Tue, 8 Apr 2014 12:56:09 -0500 Received: from THEMADHATTER (10.242.181.54) by smarthost.fisglobal.com (10.132.206.193) with Microsoft SMTP Server id 14.3.174.1; Tue, 8 Apr 2014 12:56:07 -0500 From: Sender: Devin Teske To: "'John Baldwin'" , "'Devin Teske'" References: <201404072240.s37MeTqo085123@svn.freebsd.org> <201404080917.23789.jhb@freebsd.org> In-Reply-To: <201404080917.23789.jhb@freebsd.org> Subject: RE: svn commit: r264243 - in head/etc: . rc.d Date: Tue, 8 Apr 2014 10:55:50 -0700 Message-ID: <0ddf01cf5353$c8b46410$5a1d2c30$@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQHtHTJ2bawknJXiink0mx9GxNzXrgIG8iM5mrw1dlA= Content-Language: en-us X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.96, 1.0.14, 0.0.0000 definitions=2014-04-08_04:2014-04-08,2014-04-08,1970-01-01 signatures=0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 17:56:11 -0000 > -----Original Message----- > From: John Baldwin [mailto:jhb@freebsd.org] > Sent: Tuesday, April 8, 2014 6:17 AM > To: Devin Teske > Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src- > head@freebsd.org > Subject: Re: svn commit: r264243 - in head/etc: . rc.d >=20 > On Monday, April 07, 2014 6:40:29 pm Devin Teske wrote: > > Author: dteske > > Date: Mon Apr 7 22:40:29 2014 > > New Revision: 264243 > > URL: > > https://urldefense.proofpoint.com/v1/url?u=3Dhttp://svnweb.freebsd.org/c > > > hangeset/base/264243&k=3D%2FbkpAUdJWZuiTILCq%2FFnQg%3D%3D%0A&r=3D > Mrjs6vR4% > > > 2Faj2Ns9%2FssHJjg%3D%3D%0A&m=3Dx4%2FOSlYxZmvxfxF1vsS2F3iOmYffhRw > 7e5mRGSs > > > LUeM%3D%0A&s=3Df09e9f49a3e96b674c5845e5ca0b0ffe54de091cfb020683aa2 > fc358b > > 8f7182d > > > > Log: > > Loosen the processing of *_IF_aliasN vars to be less strict. Previous= ly, > > the first alias had to be _alias0 and processing stopped at the first= non- > > defined variable (preventing gaps). Allowing gaps gives the administr= ator > > the ability to group aliases in an adhoc manner and also lifts the > > requirement to renumber aliases simply to comment-out an existing one. > > Aliases are processed in numerical ascending order. > > > > Discussed on: -rc > > MFC after: 1 week >=20 > Forgot to mention mdconfig in the log message (or did you mean to commit > that separately)? >=20 Nah, forgot to mention mdconfig in the commit message as you state. --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 18:02:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81055B16; Tue, 8 Apr 2014 18:02:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61D2E1FA2; Tue, 8 Apr 2014 18:02:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38I2X47040255; Tue, 8 Apr 2014 18:02:33 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38I2XMh040254; Tue, 8 Apr 2014 18:02:33 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404081802.s38I2XMh040254@svn.freebsd.org> From: Ed Maste Date: Tue, 8 Apr 2014 18:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264262 - head/sys/boot/ficl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 18:02:33 -0000 Author: emaste Date: Tue Apr 8 18:02:32 2014 New Revision: 264262 URL: http://svnweb.freebsd.org/changeset/base/264262 Log: Fix printf args for 64-bit archs Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/ficl/tools.c Modified: head/sys/boot/ficl/tools.c ============================================================================== --- head/sys/boot/ficl/tools.c Tue Apr 8 17:50:27 2014 (r264261) +++ head/sys/boot/ficl/tools.c Tue Apr 8 18:02:32 2014 (r264262) @@ -201,7 +201,7 @@ static void seeColon(FICL_VM *pVM, CELL *cp++ = '>'; else *cp++ = ' '; - cp += sprintf(cp, "%3d ", pc-param0); + cp += sprintf(cp, "%3d ", (int)(pc-param0)); if (isAFiclWord(pd, pFW)) { @@ -239,40 +239,40 @@ static void seeColon(FICL_VM *pVM, CELL case IF: c = *++pc; if (c.i > 0) - sprintf(cp, "if / while (branch %d)", pc+c.i-param0); + sprintf(cp, "if / while (branch %d)", (int)(pc+c.i-param0)); else - sprintf(cp, "until (branch %d)", pc+c.i-param0); + sprintf(cp, "until (branch %d)", (int)(pc+c.i-param0)); break; case BRANCH: c = *++pc; if (c.i == 0) - sprintf(cp, "repeat (branch %d)", pc+c.i-param0); + sprintf(cp, "repeat (branch %d)", (int)(pc+c.i-param0)); else if (c.i == 1) - sprintf(cp, "else (branch %d)", pc+c.i-param0); + sprintf(cp, "else (branch %d)", (int)(pc+c.i-param0)); else - sprintf(cp, "endof (branch %d)", pc+c.i-param0); + sprintf(cp, "endof (branch %d)", (int)(pc+c.i-param0)); break; case OF: c = *++pc; - sprintf(cp, "of (branch %d)", pc+c.i-param0); + sprintf(cp, "of (branch %d)", (int)(pc+c.i-param0)); break; case QDO: c = *++pc; - sprintf(cp, "?do (leave %d)", (CELL *)c.p-param0); + sprintf(cp, "?do (leave %d)", (int)((CELL *)c.p-param0)); break; case DO: c = *++pc; - sprintf(cp, "do (leave %d)", (CELL *)c.p-param0); + sprintf(cp, "do (leave %d)", (int)((CELL *)c.p-param0)); break; case LOOP: c = *++pc; - sprintf(cp, "loop (branch %d)", pc+c.i-param0); + sprintf(cp, "loop (branch %d)", (int)(pc+c.i-param0)); break; case PLOOP: c = *++pc; - sprintf(cp, "+loop (branch %d)", pc+c.i-param0); + sprintf(cp, "+loop (branch %d)", (int)(pc+c.i-param0)); break; default: sprintf(cp, "%.*s", pFW->nName, pFW->name); From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 18:21:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 714212DD; Tue, 8 Apr 2014 18:21:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DD3E11E7; Tue, 8 Apr 2014 18:21:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38ILdFw047880; Tue, 8 Apr 2014 18:21:39 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38ILd5X047879; Tue, 8 Apr 2014 18:21:39 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404081821.s38ILd5X047879@svn.freebsd.org> From: Ed Maste Date: Tue, 8 Apr 2014 18:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264263 - head/sys/boot/efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 18:21:39 -0000 Author: emaste Date: Tue Apr 8 18:21:38 2014 New Revision: 264263 URL: http://svnweb.freebsd.org/changeset/base/264263 Log: Add explicit casts to quiet warnings in libefi Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/efi/libefi/efipart.c Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Tue Apr 8 18:02:32 2014 (r264262) +++ head/sys/boot/efi/libefi/efipart.c Tue Apr 8 18:21:38 2014 (r264263) @@ -93,14 +93,16 @@ efipart_init(void) bzero(aliases, nin * sizeof(EFI_HANDLE)); for (n = 0; n < nin; n++) { - status = BS->HandleProtocol(hin[n], &devpath_guid, &devpath); + status = BS->HandleProtocol(hin[n], &devpath_guid, + (void **)&devpath); if (EFI_ERROR(status)) { continue; } node = devpath; while (!IsDevicePathEnd(NextDevicePathNode(node))) node = NextDevicePathNode(node); - status = BS->HandleProtocol(hin[n], &blkio_guid, &blkio); + status = BS->HandleProtocol(hin[n], &blkio_guid, + (void**)&blkio); if (EFI_ERROR(status)) continue; if (!blkio->Media->LogicalPartition) @@ -147,7 +149,7 @@ efipart_print(int verbose) sprintf(line, " %s%d:", efipart_dev.dv_name, unit); pager_output(line); - status = BS->HandleProtocol(h, &blkio_guid, &blkio); + status = BS->HandleProtocol(h, &blkio_guid, (void **)&blkio); if (!EFI_ERROR(status)) { sprintf(line, " %llu blocks", (unsigned long long)(blkio->Media->LastBlock + 1)); @@ -176,7 +178,7 @@ efipart_open(struct open_file *f, ...) if (h == NULL) return (EINVAL); - status = BS->HandleProtocol(h, &blkio_guid, &blkio); + status = BS->HandleProtocol(h, &blkio_guid, (void **)&blkio); if (EFI_ERROR(status)) return (efi_status_to_errno(status)); From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 18:22:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B90F845A; Tue, 8 Apr 2014 18:22:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A52D711F5; Tue, 8 Apr 2014 18:22:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38IM3fm048367; Tue, 8 Apr 2014 18:22:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38IM3p2048366; Tue, 8 Apr 2014 18:22:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404081822.s38IM3p2048366@svn.freebsd.org> From: Alexander Motin Date: Tue, 8 Apr 2014 18:22:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264264 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 18:22:03 -0000 Author: mav Date: Tue Apr 8 18:22:03 2014 New Revision: 264264 URL: http://svnweb.freebsd.org/changeset/base/264264 Log: Wakeup only one thread of added in r263978i at a time. This slightly reduces lock congestion between threads. Submitted by: trasz Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Apr 8 18:21:38 2014 (r264263) +++ head/sys/cam/ctl/ctl.c Tue Apr 8 18:22:03 2014 (r264264) @@ -13065,7 +13065,7 @@ ctl_wakeup_thread() softc = control_softc; - wakeup(softc); + wakeup_one(softc); } /* Initialization and failover */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 18:27:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6012B6E6; Tue, 8 Apr 2014 18:27:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F9B61241; Tue, 8 Apr 2014 18:27:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38IRY89048993; Tue, 8 Apr 2014 18:27:34 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38IRXiL048987; Tue, 8 Apr 2014 18:27:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404081827.s38IRXiL048987@svn.freebsd.org> From: Xin LI Date: Tue, 8 Apr 2014 18:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264265 - in head: crypto/openssl/crypto/bn crypto/openssl/crypto/ec crypto/openssl/ssl sys/fs/nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 18:27:34 -0000 Author: delphij Date: Tue Apr 8 18:27:32 2014 New Revision: 264265 URL: http://svnweb.freebsd.org/changeset/base/264265 Log: Fix NFS deadlock vulnerability. [SA-14:05] Fix "Heartbleed" vulnerability and ECDSA Cache Side-channel Attack in OpenSSL. [SA-14:06] Modified: head/crypto/openssl/crypto/bn/bn.h head/crypto/openssl/crypto/bn/bn_lib.c head/crypto/openssl/crypto/ec/ec2_mult.c head/crypto/openssl/ssl/d1_both.c head/crypto/openssl/ssl/t1_lib.c head/sys/fs/nfsserver/nfs_nfsdserv.c Modified: head/crypto/openssl/crypto/bn/bn.h ============================================================================== --- head/crypto/openssl/crypto/bn/bn.h Tue Apr 8 18:22:03 2014 (r264264) +++ head/crypto/openssl/crypto/bn/bn.h Tue Apr 8 18:27:32 2014 (r264265) @@ -538,6 +538,8 @@ BIGNUM *BN_mod_inverse(BIGNUM *ret, BIGNUM *BN_mod_sqrt(BIGNUM *ret, const BIGNUM *a, const BIGNUM *n,BN_CTX *ctx); +void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords); + /* Deprecated versions */ #ifndef OPENSSL_NO_DEPRECATED BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int safe, @@ -774,11 +776,20 @@ int RAND_pseudo_bytes(unsigned char *buf #define bn_fix_top(a) bn_check_top(a) +#define bn_check_size(bn, bits) bn_wcheck_size(bn, ((bits+BN_BITS2-1))/BN_BITS2) +#define bn_wcheck_size(bn, words) \ + do { \ + const BIGNUM *_bnum2 = (bn); \ + assert(words <= (_bnum2)->dmax && words >= (_bnum2)->top); \ + } while(0) + #else /* !BN_DEBUG */ #define bn_pollute(a) #define bn_check_top(a) #define bn_fix_top(a) bn_correct_top(a) +#define bn_check_size(bn, bits) +#define bn_wcheck_size(bn, words) #endif Modified: head/crypto/openssl/crypto/bn/bn_lib.c ============================================================================== --- head/crypto/openssl/crypto/bn/bn_lib.c Tue Apr 8 18:22:03 2014 (r264264) +++ head/crypto/openssl/crypto/bn/bn_lib.c Tue Apr 8 18:27:32 2014 (r264265) @@ -824,3 +824,55 @@ int bn_cmp_part_words(const BN_ULONG *a, } return bn_cmp_words(a,b,cl); } + +/* + * Constant-time conditional swap of a and b. + * a and b are swapped if condition is not 0. The code assumes that at most one bit of condition is set. + * nwords is the number of words to swap. The code assumes that at least nwords are allocated in both a and b, + * and that no more than nwords are used by either a or b. + * a and b cannot be the same number + */ +void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwords) + { + BN_ULONG t; + int i; + + bn_wcheck_size(a, nwords); + bn_wcheck_size(b, nwords); + + assert(a != b); + assert((condition & (condition - 1)) == 0); + assert(sizeof(BN_ULONG) >= sizeof(int)); + + condition = ((condition - 1) >> (BN_BITS2 - 1)) - 1; + + t = (a->top^b->top) & condition; + a->top ^= t; + b->top ^= t; + +#define BN_CONSTTIME_SWAP(ind) \ + do { \ + t = (a->d[ind] ^ b->d[ind]) & condition; \ + a->d[ind] ^= t; \ + b->d[ind] ^= t; \ + } while (0) + + + switch (nwords) { + default: + for (i = 10; i < nwords; i++) + BN_CONSTTIME_SWAP(i); + /* Fallthrough */ + case 10: BN_CONSTTIME_SWAP(9); /* Fallthrough */ + case 9: BN_CONSTTIME_SWAP(8); /* Fallthrough */ + case 8: BN_CONSTTIME_SWAP(7); /* Fallthrough */ + case 7: BN_CONSTTIME_SWAP(6); /* Fallthrough */ + case 6: BN_CONSTTIME_SWAP(5); /* Fallthrough */ + case 5: BN_CONSTTIME_SWAP(4); /* Fallthrough */ + case 4: BN_CONSTTIME_SWAP(3); /* Fallthrough */ + case 3: BN_CONSTTIME_SWAP(2); /* Fallthrough */ + case 2: BN_CONSTTIME_SWAP(1); /* Fallthrough */ + case 1: BN_CONSTTIME_SWAP(0); + } +#undef BN_CONSTTIME_SWAP +} Modified: head/crypto/openssl/crypto/ec/ec2_mult.c ============================================================================== --- head/crypto/openssl/crypto/ec/ec2_mult.c Tue Apr 8 18:22:03 2014 (r264264) +++ head/crypto/openssl/crypto/ec/ec2_mult.c Tue Apr 8 18:27:32 2014 (r264265) @@ -208,11 +208,15 @@ static int gf2m_Mxy(const EC_GROUP *grou return ret; } + /* Computes scalar*point and stores the result in r. * point can not equal r. - * Uses algorithm 2P of + * Uses a modified algorithm 2P of * Lopez, J. and Dahab, R. "Fast multiplication on elliptic curves over * GF(2^m) without precomputation" (CHES '99, LNCS 1717). + * + * To protect against side-channel attack the function uses constant time swap, + * avoiding conditional branches. */ static int ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, const EC_POINT *point, BN_CTX *ctx) @@ -246,6 +250,11 @@ static int ec_GF2m_montgomery_point_mult x2 = &r->X; z2 = &r->Y; + bn_wexpand(x1, group->field.top); + bn_wexpand(z1, group->field.top); + bn_wexpand(x2, group->field.top); + bn_wexpand(z2, group->field.top); + if (!BN_GF2m_mod_arr(x1, &point->X, group->poly)) goto err; /* x1 = x */ if (!BN_one(z1)) goto err; /* z1 = 1 */ if (!group->meth->field_sqr(group, z2, x1, ctx)) goto err; /* z2 = x1^2 = x^2 */ @@ -270,16 +279,12 @@ static int ec_GF2m_montgomery_point_mult word = scalar->d[i]; while (mask) { - if (word & mask) - { - if (!gf2m_Madd(group, &point->X, x1, z1, x2, z2, ctx)) goto err; - if (!gf2m_Mdouble(group, x2, z2, ctx)) goto err; - } - else - { - if (!gf2m_Madd(group, &point->X, x2, z2, x1, z1, ctx)) goto err; - if (!gf2m_Mdouble(group, x1, z1, ctx)) goto err; - } + BN_consttime_swap(word & mask, x1, x2, group->field.top); + BN_consttime_swap(word & mask, z1, z2, group->field.top); + if (!gf2m_Madd(group, &point->X, x2, z2, x1, z1, ctx)) goto err; + if (!gf2m_Mdouble(group, x1, z1, ctx)) goto err; + BN_consttime_swap(word & mask, x1, x2, group->field.top); + BN_consttime_swap(word & mask, z1, z2, group->field.top); mask >>= 1; } mask = BN_TBIT; Modified: head/crypto/openssl/ssl/d1_both.c ============================================================================== --- head/crypto/openssl/ssl/d1_both.c Tue Apr 8 18:22:03 2014 (r264264) +++ head/crypto/openssl/ssl/d1_both.c Tue Apr 8 18:27:32 2014 (r264265) @@ -1459,26 +1459,36 @@ dtls1_process_heartbeat(SSL *s) unsigned int payload; unsigned int padding = 16; /* Use minimum padding */ - /* Read type and payload length first */ - hbtype = *p++; - n2s(p, payload); - pl = p; - if (s->msg_callback) s->msg_callback(0, s->version, TLS1_RT_HEARTBEAT, &s->s3->rrec.data[0], s->s3->rrec.length, s, s->msg_callback_arg); + /* Read type and payload length first */ + if (1 + 2 + 16 > s->s3->rrec.length) + return 0; /* silently discard */ + hbtype = *p++; + n2s(p, payload); + if (1 + 2 + payload + 16 > s->s3->rrec.length) + return 0; /* silently discard per RFC 6520 sec. 4 */ + pl = p; + if (hbtype == TLS1_HB_REQUEST) { unsigned char *buffer, *bp; + unsigned int write_length = 1 /* heartbeat type */ + + 2 /* heartbeat length */ + + payload + padding; int r; + if (write_length > SSL3_RT_MAX_PLAIN_LENGTH) + return 0; + /* Allocate memory for the response, size is 1 byte * message type, plus 2 bytes payload length, plus * payload, plus padding */ - buffer = OPENSSL_malloc(1 + 2 + payload + padding); + buffer = OPENSSL_malloc(write_length); bp = buffer; /* Enter response type, length and copy payload */ @@ -1489,11 +1499,11 @@ dtls1_process_heartbeat(SSL *s) /* Random padding */ RAND_pseudo_bytes(bp, padding); - r = dtls1_write_bytes(s, TLS1_RT_HEARTBEAT, buffer, 3 + payload + padding); + r = dtls1_write_bytes(s, TLS1_RT_HEARTBEAT, buffer, write_length); if (r >= 0 && s->msg_callback) s->msg_callback(1, s->version, TLS1_RT_HEARTBEAT, - buffer, 3 + payload + padding, + buffer, write_length, s, s->msg_callback_arg); OPENSSL_free(buffer); Modified: head/crypto/openssl/ssl/t1_lib.c ============================================================================== --- head/crypto/openssl/ssl/t1_lib.c Tue Apr 8 18:22:03 2014 (r264264) +++ head/crypto/openssl/ssl/t1_lib.c Tue Apr 8 18:27:32 2014 (r264265) @@ -2558,16 +2558,20 @@ tls1_process_heartbeat(SSL *s) unsigned int payload; unsigned int padding = 16; /* Use minimum padding */ - /* Read type and payload length first */ - hbtype = *p++; - n2s(p, payload); - pl = p; - if (s->msg_callback) s->msg_callback(0, s->version, TLS1_RT_HEARTBEAT, &s->s3->rrec.data[0], s->s3->rrec.length, s, s->msg_callback_arg); + /* Read type and payload length first */ + if (1 + 2 + 16 > s->s3->rrec.length) + return 0; /* silently discard */ + hbtype = *p++; + n2s(p, payload); + if (1 + 2 + payload + 16 > s->s3->rrec.length) + return 0; /* silently discard per RFC 6520 sec. 4 */ + pl = p; + if (hbtype == TLS1_HB_REQUEST) { unsigned char *buffer, *bp; Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Tue Apr 8 18:22:03 2014 (r264264) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Tue Apr 8 18:27:32 2014 (r264265) @@ -1457,10 +1457,23 @@ nfsrvd_rename(struct nfsrv_descript *nd, nfsvno_relpathbuf(&fromnd); goto out; } + /* + * Unlock dp in this code section, so it is unlocked before + * tdp gets locked. This avoids a potential LOR if tdp is the + * parent directory of dp. + */ if (nd->nd_flag & ND_NFSV4) { tdp = todp; tnes = *toexp; - tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, p, 0); + if (dp != tdp) { + NFSVOPUNLOCK(dp, 0); + tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, + p, 0); /* Might lock tdp. */ + } else { + tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, + p, 1); + NFSVOPUNLOCK(dp, 0); + } } else { tfh.nfsrvfh_len = 0; error = nfsrv_mtofh(nd, &tfh); @@ -1481,10 +1494,12 @@ nfsrvd_rename(struct nfsrv_descript *nd, tnes = *exp; tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, p, 1); + NFSVOPUNLOCK(dp, 0); } else { + NFSVOPUNLOCK(dp, 0); nd->nd_cred->cr_uid = nd->nd_saveduid; nfsd_fhtovp(nd, &tfh, LK_EXCLUSIVE, &tdp, &tnes, NULL, - 0, p); + 0, p); /* Locks tdp. */ if (tdp) { tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, p, 1); @@ -1499,7 +1514,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, if (error) { if (tdp) vrele(tdp); - vput(dp); + vrele(dp); nfsvno_relpathbuf(&fromnd); nfsvno_relpathbuf(&tond); goto out; @@ -1514,7 +1529,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, } if (tdp) vrele(tdp); - vput(dp); + vrele(dp); nfsvno_relpathbuf(&fromnd); nfsvno_relpathbuf(&tond); goto out; @@ -1523,7 +1538,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, /* * Done parsing, now down to business. */ - nd->nd_repstat = nfsvno_namei(nd, &fromnd, dp, 1, exp, p, &fdirp); + nd->nd_repstat = nfsvno_namei(nd, &fromnd, dp, 0, exp, p, &fdirp); if (nd->nd_repstat) { if (nd->nd_flag & ND_NFSV3) { nfsrv_wcc(nd, fdirfor_ret, &fdirfor, fdiraft_ret, From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 19:19:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2EDC67A1; Tue, 8 Apr 2014 19:19:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C2A6186D; Tue, 8 Apr 2014 19:19:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38JJwsh070470; Tue, 8 Apr 2014 19:19:58 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38JJwm8070469; Tue, 8 Apr 2014 19:19:58 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404081919.s38JJwm8070469@svn.freebsd.org> From: Ed Maste Date: Tue, 8 Apr 2014 19:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264268 - head/sys/boot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 19:19:59 -0000 Author: emaste Date: Tue Apr 8 19:19:58 2014 New Revision: 264268 URL: http://svnweb.freebsd.org/changeset/base/264268 Log: (Re)connect sys/boot/amd64 to the build Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/Makefile Modified: head/sys/boot/Makefile ============================================================================== --- head/sys/boot/Makefile Tue Apr 8 18:27:46 2014 (r264267) +++ head/sys/boot/Makefile Tue Apr 8 19:19:58 2014 (r264268) @@ -9,9 +9,12 @@ SUBDIR+= ficl .endif # Pick the machine-dependent subdir based on the target architecture. -ADIR= ${MACHINE:S/amd64/i386/:S/powerpc64/powerpc/} +ADIR= ${MACHINE:S/powerpc64/powerpc/} .if exists(${.CURDIR}/${ADIR}/.) SUBDIR+= ${ADIR} .endif +.if ${MACHINE} == "amd64" +SUBDIR+= i386 +.endif .include From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 20:10:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81CE3605; Tue, 8 Apr 2014 20:10:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6214B1D2F; Tue, 8 Apr 2014 20:10:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38KAOv3091296; Tue, 8 Apr 2014 20:10:24 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38KAMgg091287; Tue, 8 Apr 2014 20:10:22 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201404082010.s38KAMgg091287@svn.freebsd.org> From: Sean Bruno Date: Tue, 8 Apr 2014 20:10:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264269 - in head: sys/conf sys/kern sys/modules sys/modules/imgact_binmisc sys/sys usr.sbin usr.sbin/binmiscctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 20:10:24 -0000 Author: sbruno Date: Tue Apr 8 20:10:22 2014 New Revision: 264269 URL: http://svnweb.freebsd.org/changeset/base/264269 Log: Add Stacey Son's binary activation patches that allow remapping of execution to a emumation program via parsing of ELF header information. With this kernel module and userland tool, poudriere is able to build ports packages via the QEMU userland tools (or another emulator program) in a different architecture chroot, e.g. TARGET=mips TARGET_ARCH=mips I'm not connecting this to GENERIC for obvious reasons, but this should allow the kernel module to be built by default and enable the building of the userland tool (which automatically loads the kernel module). Submitted by: sson@ Reviewed by: jhb@ Added: head/sys/kern/imgact_binmisc.c (contents, props changed) head/sys/modules/imgact_binmisc/ head/sys/modules/imgact_binmisc/Makefile (contents, props changed) head/sys/sys/imgact_binmisc.h (contents, props changed) head/usr.sbin/binmiscctl/ head/usr.sbin/binmiscctl/Makefile (contents, props changed) head/usr.sbin/binmiscctl/binmiscctl.8 (contents, props changed) head/usr.sbin/binmiscctl/binmiscctl.c (contents, props changed) Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/modules/Makefile head/usr.sbin/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Apr 8 19:19:58 2014 (r264268) +++ head/sys/conf/files.amd64 Tue Apr 8 20:10:22 2014 (r264269) @@ -440,6 +440,7 @@ dev/virtio/scsi/virtio_scsi.c optional dev/virtio/random/virtio_random.c optional virtio_random isa/syscons_isa.c optional sc isa/vga_isa.c optional vga +kern/imgact_binmisc.c optional imagact_binmisc kern/kern_clocksource.c standard kern/link_elf_obj.c standard # Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Apr 8 19:19:58 2014 (r264268) +++ head/sys/conf/files.i386 Tue Apr 8 20:10:22 2014 (r264269) @@ -522,6 +522,7 @@ isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/kern_clocksource.c standard kern/imgact_aout.c optional compat_aout +kern/imgact_binmisc.c optional imagact_binmisc kern/imgact_gzip.c optional gzip libkern/divdi3.c standard libkern/flsll.c standard Added: head/sys/kern/imgact_binmisc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/imgact_binmisc.c Tue Apr 8 20:10:22 2014 (r264269) @@ -0,0 +1,766 @@ +/*- + * Copyright (c) 2013, Stacey D. Son + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + * Miscellaneous binary interpreter image activator. + * + * If the given target executable's header matches 'xbe_magic' field in the + * 'interpreter_list' then it will use the user-level interpreter specified in + * the 'xbe_interpreter' field to execute the binary. The 'xbe_magic' field may + * be adjusted to a given offset using the value in the 'xbe_moffset' field + * and bits of the header may be masked using the 'xbe_mask' field. The + * 'interpreter_list' entries are managed using sysctl(3) as described in the + * file. + */ + +/* + * Node of the interpreter list. + */ +typedef struct imgact_binmisc_entry { + char *ibe_name; + uint8_t *ibe_magic; + uint32_t ibe_moffset; + uint32_t ibe_msize; + uint8_t *ibe_mask; + uint8_t *ibe_interpreter; + uint32_t ibe_interp_argcnt; + uint32_t ibe_interp_length; + uint32_t ibe_flags; + SLIST_ENTRY(imgact_binmisc_entry) link; +} imgact_binmisc_entry_t; + +/* + * sysctl() commands. + */ +#define IBC_ADD 1 /* Add given entry. */ +#define IBC_REMOVE 2 /* Remove entry for a given name. */ +#define IBC_DISABLE 3 /* Disable entry for a given name. */ +#define IBC_ENABLE 4 /* Enable entry for a given name. */ +#define IBC_LOOKUP 5 /* Lookup and return entry for given name. */ +#define IBC_LIST 6 /* Get a snapshot of the interpretor list. */ + +/* + * Interpreter string macros. + * + * They all start with '#' followed by a single letter: + */ +#define ISM_POUND '#' /* "##" is the escape sequence for single #. */ +#define ISM_OLD_ARGV0 'a' /* "#a" is replaced with the old argv0. */ + +MALLOC_DEFINE(M_BINMISC, KMOD_NAME, "misc binary image activator"); + +/* The interpreter list. */ +static SLIST_HEAD(, imgact_binmisc_entry) interpreter_list = + SLIST_HEAD_INITIALIZER(interpreter_list); + +static int interp_list_entry_count = 0; + +static struct mtx interp_list_mtx; + +int imgact_binmisc_exec(struct image_params *imgp); + + +/* + * Populate the entry with the information about the interpreter. + */ +static void +imgact_binmisc_populate_interp(char *str, imgact_binmisc_entry_t *ibe) +{ + uint32_t len = 0, argc = 1; + char t[IBE_INTERP_LEN_MAX]; + char *sp, *tp; + + bzero(t, sizeof(t)); + + /* + * Normalize interpreter string. Replace white space between args with + * single space. + */ + sp = str; tp = t; + while (*sp != '\0') { + if (*sp == ' ' || *sp == '\t') { + if (++len > IBE_INTERP_LEN_MAX) + break; + *tp++ = ' '; + argc++; + while (*sp == ' ' || *sp == '\t') + sp++; + continue; + } else { + *tp++ = *sp++; + len++; + } + } + *tp = '\0'; + len++; + + ibe->ibe_interpreter = malloc(len, M_BINMISC, M_WAITOK|M_ZERO); + + /* Populate all the ibe fields for the interpreter. */ + memcpy(ibe->ibe_interpreter, t, len); + ibe->ibe_interp_argcnt = argc; + ibe->ibe_interp_length = len; +} + +/* + * Allocate memory and populate a new entry for the interpreter table. + */ +static imgact_binmisc_entry_t * +imgact_binmisc_new_entry(ximgact_binmisc_entry_t *xbe) +{ + imgact_binmisc_entry_t *ibe = NULL; + size_t namesz = min(strlen(xbe->xbe_name) + 1, IBE_NAME_MAX); + + mtx_assert(&interp_list_mtx, MA_NOTOWNED); + + ibe = malloc(sizeof(*ibe), M_BINMISC, M_WAITOK|M_ZERO); + + ibe->ibe_name = malloc(namesz, M_BINMISC, M_WAITOK|M_ZERO); + strlcpy(ibe->ibe_name, xbe->xbe_name, namesz); + + imgact_binmisc_populate_interp(xbe->xbe_interpreter, ibe); + + ibe->ibe_magic = malloc(xbe->xbe_msize, M_BINMISC, M_WAITOK|M_ZERO); + memcpy(ibe->ibe_magic, xbe->xbe_magic, xbe->xbe_msize); + + ibe->ibe_mask = malloc(xbe->xbe_msize, M_BINMISC, M_WAITOK|M_ZERO); + memcpy(ibe->ibe_mask, xbe->xbe_mask, xbe->xbe_msize); + + ibe->ibe_moffset = xbe->xbe_moffset; + ibe->ibe_msize = xbe->xbe_msize; + ibe->ibe_flags = xbe->xbe_flags; + + return (ibe); +} + +/* + * Free the allocated memory for a given list item. + */ +static void +imgact_binmisc_destroy_entry(imgact_binmisc_entry_t *ibe) +{ + if (!ibe) + return; + if (ibe->ibe_mask) + free(ibe->ibe_magic, M_BINMISC); + if (ibe->ibe_mask) + free(ibe->ibe_mask, M_BINMISC); + if (ibe->ibe_interpreter) + free(ibe->ibe_interpreter, M_BINMISC); + if (ibe->ibe_name) + free(ibe->ibe_name, M_BINMISC); + if (ibe) + free(ibe, M_BINMISC); +} + +/* + * Find the interpreter in the list by the given name. Return NULL if not + * found. + */ +static imgact_binmisc_entry_t * +imgact_binmisc_find_entry(char *name) +{ + imgact_binmisc_entry_t *ibe; + + mtx_assert(&interp_list_mtx, MA_OWNED); + + SLIST_FOREACH(ibe, &interpreter_list, link) { + if (strncmp(name, ibe->ibe_name, IBE_NAME_MAX) == 0) + return (ibe); + } + + return (NULL); +} + +/* + * Add the given interpreter if it doesn't already exist. Return EEXIST + * if the name already exist in the interpreter list. + */ +static int +imgact_binmisc_add_entry(ximgact_binmisc_entry_t *xbe) +{ + imgact_binmisc_entry_t *ibe; + char *p; + + if (xbe->xbe_msize > IBE_MAGIC_MAX) + return (EINVAL); + + for(p = xbe->xbe_name; *p != 0; p++) + if (!isascii((int)*p)) + return (EINVAL); + + for(p = xbe->xbe_interpreter; *p != 0; p++) + if (!isascii((int)*p)) + return (EINVAL); + + /* Make sure we don't have any invalid #'s. */ + p = xbe->xbe_interpreter; + while (1) { + p = strchr(p, '#'); + if (!p) + break; + + p++; + switch(*p) { + case ISM_POUND: + /* "##" */ + p++; + break; + + case ISM_OLD_ARGV0: + /* "#a" */ + p++; + break; + + case 0: + default: + /* Anything besides the above is invalid. */ + return (EINVAL); + } + } + + mtx_lock(&interp_list_mtx); + if (imgact_binmisc_find_entry(xbe->xbe_name) != NULL) { + mtx_unlock(&interp_list_mtx); + return (EEXIST); + } + mtx_unlock(&interp_list_mtx); + + ibe = imgact_binmisc_new_entry(xbe); + if (!ibe) + return (ENOMEM); + + mtx_lock(&interp_list_mtx); + SLIST_INSERT_HEAD(&interpreter_list, ibe, link); + interp_list_entry_count++; + mtx_unlock(&interp_list_mtx); + + return (0); +} + +/* + * Remove the interpreter in the list with the given name. Return ENOENT + * if not found. + */ +static int +imgact_binmisc_remove_entry(char *name) +{ + imgact_binmisc_entry_t *ibe; + + mtx_lock(&interp_list_mtx); + if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { + mtx_unlock(&interp_list_mtx); + return (ENOENT); + } + SLIST_REMOVE(&interpreter_list, ibe, imgact_binmisc_entry, link); + interp_list_entry_count--; + mtx_unlock(&interp_list_mtx); + + imgact_binmisc_destroy_entry(ibe); + + return (0); +} + +/* + * Disable the interpreter in the list with the given name. Return ENOENT + * if not found. + */ +static int +imgact_binmisc_disable_entry(char *name) +{ + imgact_binmisc_entry_t *ibe; + + mtx_lock(&interp_list_mtx); + if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { + mtx_unlock(&interp_list_mtx); + return (ENOENT); + } + + ibe->ibe_flags &= ~IBF_ENABLED; + mtx_unlock(&interp_list_mtx); + + return (0); +} + +/* + * Enable the interpreter in the list with the given name. Return ENOENT + * if not found. + */ +static int +imgact_binmisc_enable_entry(char *name) +{ + imgact_binmisc_entry_t *ibe; + + mtx_lock(&interp_list_mtx); + if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { + mtx_unlock(&interp_list_mtx); + return (ENOENT); + } + + ibe->ibe_flags |= IBF_ENABLED; + mtx_unlock(&interp_list_mtx); + + return (0); +} + +static int +imgact_binmisc_populate_xbe(ximgact_binmisc_entry_t *xbe, + imgact_binmisc_entry_t *ibe) +{ + uint32_t i; + + mtx_assert(&interp_list_mtx, MA_OWNED); + + bzero(xbe, sizeof(*xbe)); + strlcpy(xbe->xbe_name, ibe->ibe_name, IBE_NAME_MAX); + + /* Copy interpreter string. Replace NULL breaks with space. */ + memcpy(xbe->xbe_interpreter, ibe->ibe_interpreter, + ibe->ibe_interp_length); + for(i = 0; i < (ibe->ibe_interp_length - 1); i++) + if (xbe->xbe_interpreter[i] == '\0') + xbe->xbe_interpreter[i] = ' '; + + memcpy(xbe->xbe_magic, ibe->ibe_magic, ibe->ibe_msize); + memcpy(xbe->xbe_mask, ibe->ibe_mask, ibe->ibe_msize); + xbe->xbe_version = IBE_VERSION; + xbe->xbe_flags = ibe->ibe_flags; + xbe->xbe_moffset = ibe->ibe_moffset; + xbe->xbe_msize = ibe->ibe_msize; + + return (0); +} + +/* + * Retrieve the interpreter with the give name and populate the + * ximgact_binmisc_entry structure. Return ENOENT if not found. + */ +static int +imgact_binmisc_lookup_entry(char *name, ximgact_binmisc_entry_t *xbe) +{ + imgact_binmisc_entry_t *ibe; + int error = 0; + + mtx_lock(&interp_list_mtx); + if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { + mtx_unlock(&interp_list_mtx); + return (ENOENT); + } + + error = imgact_binmisc_populate_xbe(xbe, ibe); + mtx_unlock(&interp_list_mtx); + + return (error); +} + +/* + * Get a snapshot of all the interpreter entries in the list. + */ +static int +imgact_binmisc_get_all_entries(struct sysctl_req *req) +{ + ximgact_binmisc_entry_t *xbe, *xbep; + imgact_binmisc_entry_t *ibe; + int error = 0, count; + + mtx_lock(&interp_list_mtx); + count = interp_list_entry_count; + /* Don't block in malloc() while holding lock. */ + xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_NOWAIT|M_ZERO); + if (!xbe) { + mtx_unlock(&interp_list_mtx); + return (ENOMEM); + } + + xbep = xbe; + SLIST_FOREACH(ibe, &interpreter_list, link) { + error = imgact_binmisc_populate_xbe(xbep++, ibe); + if (error) + break; + } + mtx_unlock(&interp_list_mtx); + + if (!error) + error = SYSCTL_OUT(req, xbe, sizeof(*xbe) * count); + + free(xbe, M_BINMISC); + return (error); +} + +/* + * sysctl() handler for munipulating interpretor table. + * Not MP safe (locked by sysctl). + */ +static int +sysctl_kern_binmisc(SYSCTL_HANDLER_ARGS) +{ + ximgact_binmisc_entry_t xbe; + int error = 0; + + switch(arg2) { + case IBC_ADD: + /* Add an entry. Limited to IBE_MAX_ENTRIES. */ + error = SYSCTL_IN(req, &xbe, sizeof(xbe)); + if (error) + return (error); + if (IBE_VERSION != xbe.xbe_version) + return (EINVAL); + if (interp_list_entry_count == IBE_MAX_ENTRIES) + return (ENOSPC); + error = imgact_binmisc_add_entry(&xbe); + break; + + case IBC_REMOVE: + /* Remove an entry. */ + error = SYSCTL_IN(req, &xbe, sizeof(xbe)); + if (error) + return (error); + if (IBE_VERSION != xbe.xbe_version) + return (EINVAL); + error = imgact_binmisc_remove_entry(xbe.xbe_name); + break; + + case IBC_DISABLE: + /* Disable an entry. */ + error = SYSCTL_IN(req, &xbe, sizeof(xbe)); + if (error) + return (error); + if (IBE_VERSION != xbe.xbe_version) + return (EINVAL); + error = imgact_binmisc_disable_entry(xbe.xbe_name); + break; + + case IBC_ENABLE: + /* Enable an entry. */ + error = SYSCTL_IN(req, &xbe, sizeof(xbe)); + if (error) + return (error); + if (IBE_VERSION != xbe.xbe_version) + return (EINVAL); + error = imgact_binmisc_enable_entry(xbe.xbe_name); + break; + + case IBC_LOOKUP: + /* Lookup an entry. */ + error = SYSCTL_IN(req, &xbe, sizeof(xbe)); + if (error) + return (error); + if (IBE_VERSION != xbe.xbe_version) + return (EINVAL); + error = imgact_binmisc_lookup_entry(xbe.xbe_name, &xbe); + if (!error) + error = SYSCTL_OUT(req, &xbe, sizeof(xbe)); + break; + + case IBC_LIST: + /* Return a snapshot of the interpretor list. */ + + if (!req->oldptr) { + /* No pointer then just return the list size. */ + error = SYSCTL_OUT(req, 0, interp_list_entry_count * + sizeof(ximgact_binmisc_entry_t)); + return (error); + } else + if (!req->oldlen) + return (EINVAL); + + error = imgact_binmisc_get_all_entries(req); + break; + + default: + return (EINVAL); + } + + return (error); +} + +SYSCTL_NODE(_kern, OID_AUTO, binmisc, CTLFLAG_RW, 0, + "Image activator for miscellaneous binaries"); + +SYSCTL_PROC(_kern_binmisc, OID_AUTO, add, + CTLFLAG_MPSAFE|CTLTYPE_STRUCT|CTLFLAG_WR, NULL, IBC_ADD, + sysctl_kern_binmisc, "S,ximgact_binmisc_entry", + "Add an activator entry"); + +SYSCTL_PROC(_kern_binmisc, OID_AUTO, remove, + CTLFLAG_MPSAFE|CTLTYPE_STRUCT|CTLFLAG_WR, NULL, IBC_REMOVE, + sysctl_kern_binmisc, "S,ximgact_binmisc_entry", + "Remove an activator entry"); + +SYSCTL_PROC(_kern_binmisc, OID_AUTO, disable, + CTLFLAG_MPSAFE|CTLTYPE_STRUCT|CTLFLAG_WR, NULL, IBC_DISABLE, + sysctl_kern_binmisc, "S,ximgact_binmisc_entry", + "Disable an activator entry"); + +SYSCTL_PROC(_kern_binmisc, OID_AUTO, enable, + CTLFLAG_MPSAFE|CTLTYPE_STRUCT|CTLFLAG_WR, NULL, IBC_ENABLE, + sysctl_kern_binmisc, "S,ximgact_binmisc_entry", + "Enable an activator entry"); + +SYSCTL_PROC(_kern_binmisc, OID_AUTO, lookup, + CTLFLAG_MPSAFE|CTLTYPE_STRUCT|CTLFLAG_RW|CTLFLAG_ANYBODY, NULL, IBC_LOOKUP, + sysctl_kern_binmisc, "S,ximgact_binmisc_entry", + "Lookup an activator entry"); + +SYSCTL_PROC(_kern_binmisc, OID_AUTO, list, + CTLFLAG_MPSAFE|CTLTYPE_STRUCT|CTLFLAG_RD|CTLFLAG_ANYBODY, NULL, IBC_LIST, + sysctl_kern_binmisc, "S,ximgact_binmisc_entry", + "Get snapshot of all the activator entries"); + +static imgact_binmisc_entry_t * +imgact_binmisc_find_interpreter(const char *image_header) +{ + imgact_binmisc_entry_t *ibe; + const char *p; + int i; + size_t sz; + + mtx_assert(&interp_list_mtx, MA_OWNED); + + SLIST_FOREACH(ibe, &interpreter_list, link) { + if (!(IBF_ENABLED & ibe->ibe_flags)) + continue; + + p = image_header + ibe->ibe_moffset; + sz = ibe->ibe_msize; + if (IBF_USE_MASK & ibe->ibe_flags) { + /* Compare using mask. */ + for (i = 0; i < sz; i++) + if ((*p++ ^ ibe->ibe_magic[i]) & + ibe->ibe_mask[i]) + break; + } else { + for (i = 0; i < sz; i++) + if (*p++ ^ ibe->ibe_magic[i]) + break; + } + if (i == ibe->ibe_msize) + return (ibe); + } + return (NULL); +} + +int +imgact_binmisc_exec(struct image_params *imgp) +{ + const char *image_header = imgp->image_header; + const char *fname = NULL; + int error = 0; + size_t offset, l; + imgact_binmisc_entry_t *ibe; + struct sbuf *sname; + char *s, *d; + + /* Do we have an interpreter for the given image header? */ + mtx_lock(&interp_list_mtx); + if ((ibe = imgact_binmisc_find_interpreter(image_header)) == NULL) { + mtx_unlock(&interp_list_mtx); + return (-1); + } + + /* No interpreter nesting allowed. */ + if (imgp->interpreted) { + mtx_unlock(&interp_list_mtx); + return (ENOEXEC); + } + + imgp->interpreted = 1; + + if (imgp->args->fname != NULL) { + fname = imgp->args->fname; + sname = NULL; + } else { + /* Use the fdescfs(5) path for fexecve(2). */ + sname = sbuf_new_auto(); + sbuf_printf(sname, "/dev/fd/%d", imgp->args->fd); + sbuf_finish(sname); + fname = sbuf_data(sname); + } + + + /* + * We need to "push" the interpreter in the arg[] list. To do this, + * we first shift all the other values in the `begin_argv' area to + * provide the exact amount of room for the values added. Set up + * `offset' as the number of bytes to be added to the `begin_argv' + * area. + */ + offset = ibe->ibe_interp_length; + + /* Adjust the offset for #'s. */ + s = ibe->ibe_interpreter; + while (1) { + s = strchr(s, '#'); + if (!s) + break; + + s++; + switch(*s) { + case ISM_POUND: + /* "##" -> "#": reduce offset by one. */ + offset--; + break; + + case ISM_OLD_ARGV0: + /* "#a" -> (old argv0): increase offset to fit fname */ + offset += strlen(fname) - 2; + break; + + default: + /* Hmm... This shouldn't happen. */ + mtx_unlock(&interp_list_mtx); + printf("%s: Unknown macro #%c sequence in " + "interpreter string\n", KMOD_NAME, *(s + 1)); + error = EINVAL; + goto done; + } + s++; + } + + /* Check to make sure we won't overrun the stringspace. */ + if (offset > imgp->args->stringspace) { + mtx_unlock(&interp_list_mtx); + error = E2BIG; + goto done; + } + + /* Make room for the interpreter */ + bcopy(imgp->args->begin_argv, imgp->args->begin_argv + offset, + imgp->args->endp - imgp->args->begin_argv); + + /* Adjust everything by the offset. */ + imgp->args->begin_envv += offset; + imgp->args->endp += offset; + imgp->args->stringspace -= offset; + + /* Add the new argument(s) in the count. */ + imgp->args->argc += ibe->ibe_interp_argcnt; + + /* + * The original arg[] list has been shifted appropriately. Copy in + * the interpreter path. + */ + s = ibe->ibe_interpreter; + d = imgp->args->begin_argv; + while(*s != '\0') { + switch (*s) { + case '#': + /* Handle "#" in interpreter string. */ + s++; + switch(*s) { + case ISM_POUND: + /* "##": Replace with a single '#' */ + *d++ = '#'; + break; + + case ISM_OLD_ARGV0: + /* "#a": Replace with old arg0 (fname). */ + if ((l = strlen(fname)) != 0) { + memcpy(d, fname, l); + d += l; + } + break; + + default: + /* Shouldn't happen but skip it if it does. */ + break; + } + break; + + case ' ': + /* Replace space with NUL to seperate arguments. */ + *d++ = '\0'; + break; + + default: + *d++ = *s; + break; + } + s++; + } + *d = '\0'; + mtx_unlock(&interp_list_mtx); + + if (!error) + imgp->interpreter_name = imgp->args->begin_argv; + + +done: + if (sname) + sbuf_delete(sname); + return (error); +} + +static void +imgact_binmisc_init(void *arg) +{ + + mtx_init(&interp_list_mtx, KMOD_NAME, NULL, MTX_DEF); +} + +static void +imgact_binmisc_fini(void *arg) +{ + imgact_binmisc_entry_t *ibe, *ibe_tmp; + + /* Free all the interpreters. */ + mtx_lock(&interp_list_mtx); + SLIST_FOREACH_SAFE(ibe, &interpreter_list, link, ibe_tmp) { + SLIST_REMOVE(&interpreter_list, ibe, imgact_binmisc_entry, + link); + imgact_binmisc_destroy_entry(ibe); + } + mtx_unlock(&interp_list_mtx); + + mtx_destroy(&interp_list_mtx); +} + +SYSINIT(imgact_binmisc, SI_SUB_EXEC, SI_ORDER_MIDDLE, imgact_binmisc_init, 0); +SYSUNINIT(imgact_binmisc, SI_SUB_EXEC, SI_ORDER_MIDDLE, imgact_binmisc_fini, 0); + +/* + * Tell kern_execve.c about it, with a little help from the linker. + */ +static struct execsw imgact_binmisc_execsw = { imgact_binmisc_exec, KMOD_NAME }; +EXEC_SET(imgact_binmisc, imgact_binmisc_execsw); Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Apr 8 19:19:58 2014 (r264268) +++ head/sys/modules/Makefile Tue Apr 8 20:10:22 2014 (r264269) @@ -148,6 +148,7 @@ SUBDIR= \ if_vlan \ ${_igb} \ ${_iir} \ + imgact_binmisc \ ${_io} \ ${_ipoib} \ ${_ipdivert} \ Added: head/sys/modules/imgact_binmisc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/imgact_binmisc/Makefile Tue Apr 8 20:10:22 2014 (r264269) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../kern + +KMOD= imgact_binmisc +SRCS= imgact_binmisc.c + +.include Added: head/sys/sys/imgact_binmisc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/imgact_binmisc.h Tue Apr 8 20:10:22 2014 (r264269) @@ -0,0 +1,172 @@ +/*- + * Copyright (c) 2013 Stacey D. Son + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _IMGACT_BINMISC_H_ +#define _IMGACT_BINMISC_H_ + +/** + * Miscellaneous binary interpreter image activator. + */ + +#include /* for MAXPATHLEN */ + +/* + * Imgact bin misc parameters. + */ +#define IBE_VERSION 1 /* struct ximgact_binmisc_entry version. */ +#define IBE_NAME_MAX 32 /* Max size for entry name. */ +#define IBE_MAGIC_MAX 256 /* Max size for header magic and mask. */ +#define IBE_ARG_LEN_MAX 256 /* Max space for optional interpreter command- + line argruments seperated by white space */ +#define IBE_INTERP_LEN_MAX (MAXPATHLEN + IBE_ARG_LEN_MAX) +#define IBE_MAX_ENTRIES 64 /* Max number of interpreter entries. */ + +/* + * Imgact bin misc interpreter entry flags. + */ +#define IBF_ENABLED 0x0001 /* Entry is active. */ +#define IBF_USE_MASK 0x0002 /* Use mask on header magic field. */ + +/* + * Used with sysctlbyname() to pass imgact bin misc entries in and out of the + * kernel. + */ +typedef struct ximgact_binmisc_entry { + uint32_t xbe_version; /* Struct version(IBE_VERSION) */ + uint32_t xbe_flags; /* Entry flags (IBF_*) */ + uint32_t xbe_moffset; /* Magic offset in header */ + uint32_t xbe_msize; /* Magic size */ + uint32_t spare[3]; /* Spare fields for future use */ + char xbe_name[IBE_NAME_MAX]; /* Unique interpreter name */ + char xbe_interpreter[IBE_INTERP_LEN_MAX]; /* Interpreter path + args */ + uint8_t xbe_magic[IBE_MAGIC_MAX]; /* Header Magic */ + uint8_t xbe_mask[IBE_MAGIC_MAX]; /* Magic Mask */ +} ximgact_binmisc_entry_t; + +/* + * sysctl() command names. + */ +#define IBE_SYSCTL_NAME "kern.binmisc" + +#define IBE_SYSCTL_NAME_ADD IBE_SYSCTL_NAME ".add" +#define IBE_SYSCTL_NAME_REMOVE IBE_SYSCTL_NAME ".remove" +#define IBE_SYSCTL_NAME_DISABLE IBE_SYSCTL_NAME ".disable" +#define IBE_SYSCTL_NAME_ENABLE IBE_SYSCTL_NAME ".enable" +#define IBE_SYSCTL_NAME_LOOKUP IBE_SYSCTL_NAME ".lookup" +#define IBE_SYSCTL_NAME_LIST IBE_SYSCTL_NAME ".list" + +#define KMOD_NAME "imgact_binmisc" + +/* + * Examples of manipulating he interpreter table using sysctlbyname(3): + * + * #include + * + * #define LLVM_MAGIC "BC\xc0\xde" + * + * #define MIPS64_ELF_MAGIC "\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00" \ + * "\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08" + * #define MIPS64_ELF_MASK "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff" \ + * "\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff" + * + * ximgact_binmisc_entry_t xbe, *xbep, out_xbe; + * size_t size = 0, osize; + * int error, i; + * + * // Add image activator for LLVM byte code + * bzero(&xbe, sizeof(xbe)); + * xbe.xbe_version = IBE_VERSION; + * xbe.xbe_flags = IBF_ENABLED; + * strlcpy(xbe.xbe_name, "llvm_bc", IBE_NAME_MAX); + * strlcpy(xbe.xbe_interpreter, "/usr/bin/lli --fake-arg0=#a", + * IBE_INTERP_LEN_MAX); + * xbe.xbe_moffset = 0; + * xbe.xbe_msize = 4; + * memcpy(xbe.xbe_magic, LLVM_MAGIC, xbe.xbe_msize); + * error = sysctlbyname(IBE_SYSCTL_NAME_ADD, NULL, NULL, &xbe, sizeof(xbe)); + * + * // Add image activator for mips64 ELF binaries to use qemu user mode + * bzero(&xbe, sizeof(xbe)); + * xbe.xbe_version = IBE_VERSION; + * xbe.xbe_flags = IBF_ENABLED | IBF_USE_MASK; + * strlcpy(xbe.xbe_name, "mips64elf", IBE_NAME_MAX); + * strlcpy(xbe.xbe_interpreter, "/usr/local/bin/qemu-mips64", + * IBE_INTERP_LEN_MAX); + * xbe.xbe_moffset = 0; + * xbe.xbe_msize = 20; + * memcpy(xbe.xbe_magic, MIPS64_ELF_MAGIC, xbe.xbe_msize); + * memcpy(xbe.xbe_mask, MIPS64_ELF_MASK, xbe.xbe_msize); + * sysctlbyname(IBE_SYSCTL_NAME_ADD, NULL, NULL, &xbe, sizeof(xbe)); + * + * // Disable (OR Enable OR Remove) image activator for LLVM byte code + * bzero(&xbe, sizeof(xbe)); + * xbe.xbe_version = IBE_VERSION; + * strlcpy(xbe.xbe_name, "llvm_bc", IBE_NAME_MAX); + * error = sysctlbyname(IBE_SYSCTL_NAME_DISABLE, NULL, NULL, &xbe, sizeof(xbe)); + * // OR sysctlbyname(IBE_SYSCTL_NAME_ENABLE", NULL, NULL, &xbe, sizeof(xbe)); + * // OR sysctlbyname(IBE_SYSCTL_NAME_REMOVE, NULL, NULL, &xbe, sizeof(xbe)); + * + * // Lookup image activator "llvm_bc" + * bzero(&xbe, sizeof(xbe)); + * xbe.xbe_version = IBE_VERSION; + * strlcpy(xbe.xbe_name, "llvm_bc", IBE_NAME_MAX); + * size = sizeof(out_xbe); + * error = sysctlbyname(IBE_SYSCTL_NAME_LOOKUP, &out_xbe, &size, &xbe, + * sizeof(xbe)); + * + * // Get all the currently configured image activators and report + * error = sysctlbyname(IBE_SYSCTL_NAME_LIST, NULL, &size, NULL, 0); + * if (0 == error && size > 0) { + * xbep = malloc(size); + * while(1) { + * osize = size; + * error = sysctlbyname("kern.binmisc.list", xbep, &size, NULL, 0); + * if (-1 == error && ENOMEM == errno && size == osize) { + * // The buffer too small and needs to grow + * size += sizeof(xbe); + * xbep = realloc(xbep, size); + * } else + * break; + * } + * } + * for(i = 0; i < (size / sizeof(xbe)); i++, xbep++) + * printf("name: %s interpreter: %s flags: %s %s\n", xbep->xbe_name, + * xbep->xbe_interpreter, (xbep->xbe_flags & IBF_ENABLED) ? + * "ENABLED" : "", (xbep->xbe_flags & IBF_ENABLED) ? "USE_MASK" : ""); + * + * The sysctlbyname() calls above may return the following errors in addition + * to the standard ones: + * + * [EINVAL] Invalid argument in the input ximgact_binmisc_entry_t structure. + * [EEXIST] Interpreter entry for given name already exist in kernel list. + * [ENOMEM] Allocating memory in the kernel failed or, in the case of + * kern.binmisc.list, the user buffer is too small. + * [ENOENT] Interpreter entry for given name is not found. + * [ENOSPC] Attempted to exceed maximum number of entries (IBE_MAX_ENTRIES). + */ + +#endif /* !_IMGACT_BINMISC_H_ */ Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Tue Apr 8 19:19:58 2014 (r264268) +++ head/usr.sbin/Makefile Tue Apr 8 20:10:22 2014 (r264269) @@ -5,6 +5,7 @@ SUBDIR= adduser \ arp \ + binmiscctl \ bootparamd \ bsdconfig \ bsdinstall \ Added: head/usr.sbin/binmiscctl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/binmiscctl/Makefile Tue Apr 8 20:10:22 2014 (r264269) @@ -0,0 +1,10 @@ +# +# $FreeBSD$ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 20:10:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF218743; Tue, 8 Apr 2014 20:10:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC6911D36; Tue, 8 Apr 2014 20:10:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38KAvhq093425; Tue, 8 Apr 2014 20:10:57 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38KAvj6093424; Tue, 8 Apr 2014 20:10:57 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404082010.s38KAvj6093424@svn.freebsd.org> From: Warner Losh Date: Tue, 8 Apr 2014 20:10:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264270 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 20:10:57 -0000 Author: imp Date: Tue Apr 8 20:10:57 2014 New Revision: 264270 URL: http://svnweb.freebsd.org/changeset/base/264270 Log: Put proper ${} around variable expansion. This fixes the build on 9.2 with fmake (which complained). Not sure why bmake didn't complain though... Modified: head/sys/conf/Makefile.arm Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Tue Apr 8 20:10:22 2014 (r264269) +++ head/sys/conf/Makefile.arm Tue Apr 8 20:10:57 2014 (r264270) @@ -44,10 +44,10 @@ CFLAGS += -mno-thumb-interwork .endif .if empty(DDB_ENABLED) -.if MK_ARM_EABI == "no" && ${COMPILER_TYPE} == "gcc" +.if ${MK_ARM_EABI} == "no" && ${COMPILER_TYPE} == "gcc" CFLAGS += -mno-apcs-frame .endif -.elif MK_ARM_EABI != "no" +.elif ${MK_ARM_EABI} != "no" CFLAGS += -funwind-tables .if ${COMPILER_TYPE} == "clang" # clang requires us to tell it to emit assembly with unwind information From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 20:26:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E34F3E9D; Tue, 8 Apr 2014 20:26:10 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA4AE1032; Tue, 8 Apr 2014 20:26:10 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CC413B917; Tue, 8 Apr 2014 16:26:09 -0400 (EDT) From: John Baldwin To: Sean Bruno Subject: Re: svn commit: r264269 - in head: sys/conf sys/kern sys/modules sys/modules/imgact_binmisc sys/sys usr.sbin usr.sbin/binmiscctl Date: Tue, 8 Apr 2014 16:25:23 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201404082010.s38KAMgg091287@svn.freebsd.org> In-Reply-To: <201404082010.s38KAMgg091287@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201404081625.23418.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 08 Apr 2014 16:26:09 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 20:26:11 -0000 On Tuesday, April 08, 2014 4:10:22 pm Sean Bruno wrote: > Author: sbruno > Date: Tue Apr 8 20:10:22 2014 > New Revision: 264269 > URL: http://svnweb.freebsd.org/changeset/base/264269 > > Log: > Add Stacey Son's binary activation patches that allow remapping of > execution to a emumation program via parsing of ELF header information. > > With this kernel module and userland tool, poudriere is able to build > ports packages via the QEMU userland tools (or another emulator program) > in a different architecture chroot, e.g. TARGET=mips TARGET_ARCH=mips > > I'm not connecting this to GENERIC for obvious reasons, but this should > allow the kernel module to be built by default and enable the building > of the userland tool (which automatically loads the kernel module). > > Submitted by: sson@ > Reviewed by: jhb@ > > Added: > head/sys/kern/imgact_binmisc.c (contents, props changed) > head/sys/modules/imgact_binmisc/ > head/sys/modules/imgact_binmisc/Makefile (contents, props changed) > head/sys/sys/imgact_binmisc.h (contents, props changed) > head/usr.sbin/binmiscctl/ > head/usr.sbin/binmiscctl/Makefile (contents, props changed) > head/usr.sbin/binmiscctl/binmiscctl.8 (contents, props changed) > head/usr.sbin/binmiscctl/binmiscctl.c (contents, props changed) > Modified: > head/sys/conf/files.amd64 > head/sys/conf/files.i386 > head/sys/modules/Makefile > head/usr.sbin/Makefile Maybe put it in sys/conf/files instead of only amd64|i386? You enabled the module build for all architectures. Please also add it to sys/conf/NOTES. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 20:50:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8084958; Tue, 8 Apr 2014 20:50:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B432312FA; Tue, 8 Apr 2014 20:50:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38KooMU007985; Tue, 8 Apr 2014 20:50:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38KoniK007974; Tue, 8 Apr 2014 20:50:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404082050.s38KoniK007974@svn.freebsd.org> From: Alexander Motin Date: Tue, 8 Apr 2014 20:50:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264274 - in head/sys/cam: ctl scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 20:50:50 -0000 Author: mav Date: Tue Apr 8 20:50:48 2014 New Revision: 264274 URL: http://svnweb.freebsd.org/changeset/base/264274 Log: Add support for SCSI UNMAP commands to CTL. This patch adds support for three new SCSI commands: UNMAP, WRITE SAME(10) and WRITE SAME(16). WRITE SAME commands support both normal write mode and UNMAP flag. To properly report UNMAP capabilities this patch also adds support for reporting two new VPD pages: Block limits and Logical Block Provisioning. UNMAP support can be enabled per-LUN by adding "-o unmap=on" to `ctladm create` command line or "option unmap on" to lun sections of /etc/ctl.conf. At this moment UNMAP supported for ramdisks and device-backed block LUNs. It was tested to work great with ZFS ZVOLs. For file-backed LUNs UNMAP support is unfortunately missing due to absence of respective VFS KPI. Reviewed by: ken MFC after: 1 month Sponsored by: iXsystems, Inc Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend.h head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_backend_ramdisk.c head/sys/cam/ctl/ctl_cmd_table.c head/sys/cam/ctl/ctl_io.h head/sys/cam/ctl/ctl_private.h head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Apr 8 20:40:54 2014 (r264273) +++ head/sys/cam/ctl/ctl.c Tue Apr 8 20:50:48 2014 (r264274) @@ -331,9 +331,10 @@ SYSCTL_INT(_kern_cam_ctl, OID_AUTO, verb &verbose, 0, "Show SCSI errors returned to initiator"); /* - * Serial number (0x80), device id (0x83), and supported pages (0x00) + * Serial number (0x80), device id (0x83), supported pages (0x00), + * Block limits (0xB0) and Logical Block Provisioning (0xB2) */ -#define SCSI_EVPD_NUM_SUPPORTED_PAGES 3 +#define SCSI_EVPD_NUM_SUPPORTED_PAGES 5 static void ctl_isc_event_handler(ctl_ha_channel chanel, ctl_ha_event event, int param); @@ -391,6 +392,9 @@ static void ctl_hndl_per_res_out_on_othe static int ctl_inquiry_evpd_supported(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd_serial(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd_devid(struct ctl_scsiio *ctsio, int alloc_len); +static int ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio, + int alloc_len); +static int ctl_inquiry_evpd_lbp(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd(struct ctl_scsiio *ctsio); static int ctl_inquiry_std(struct ctl_scsiio *ctsio); static int ctl_get_lba_len(union ctl_io *io, uint64_t *lba, uint32_t *len); @@ -5787,6 +5791,195 @@ ctl_write_buffer(struct ctl_scsiio *ctsi return (CTL_RETVAL_COMPLETE); } +int +ctl_write_same(struct ctl_scsiio *ctsio) +{ + struct ctl_lun *lun; + struct ctl_lba_len_flags lbalen; + uint64_t lba; + uint32_t num_blocks; + int len, retval; + uint8_t byte2; + + retval = CTL_RETVAL_COMPLETE; + + CTL_DEBUG_PRINT(("ctl_write_same\n")); + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + + switch (ctsio->cdb[0]) { + case WRITE_SAME_10: { + struct scsi_write_same_10 *cdb; + + cdb = (struct scsi_write_same_10 *)ctsio->cdb; + + lba = scsi_4btoul(cdb->addr); + num_blocks = scsi_2btoul(cdb->length); + byte2 = cdb->byte2; + break; + } + case WRITE_SAME_16: { + struct scsi_write_same_16 *cdb; + + cdb = (struct scsi_write_same_16 *)ctsio->cdb; + + lba = scsi_8btou64(cdb->addr); + num_blocks = scsi_4btoul(cdb->length); + byte2 = cdb->byte2; + break; + } + default: + /* + * We got a command we don't support. This shouldn't + * happen, commands should be filtered out above us. + */ + ctl_set_invalid_opcode(ctsio); + ctl_done((union ctl_io *)ctsio); + + return (CTL_RETVAL_COMPLETE); + break; /* NOTREACHED */ + } + + /* + * The first check is to make sure we're in bounds, the second + * check is to catch wrap-around problems. If the lba + num blocks + * is less than the lba, then we've wrapped around and the block + * range is invalid anyway. + */ + if (((lba + num_blocks) > (lun->be_lun->maxlba + 1)) + || ((lba + num_blocks) < lba)) { + ctl_set_lba_out_of_range(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + + /* Zero number of blocks means "to the last logical block" */ + if (num_blocks == 0) { + if ((lun->be_lun->maxlba + 1) - lba > UINT32_MAX) { + ctl_set_invalid_field(ctsio, + /*sks_valid*/ 0, + /*command*/ 1, + /*field*/ 0, + /*bit_valid*/ 0, + /*bit*/ 0); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + num_blocks = (lun->be_lun->maxlba + 1) - lba; + } + + len = lun->be_lun->blocksize; + + /* + * If we've got a kernel request that hasn't been malloced yet, + * malloc it and tell the caller the data buffer is here. + */ + if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { + ctsio->kern_data_ptr = malloc(len, M_CTL, M_WAITOK);; + ctsio->kern_data_len = len; + ctsio->kern_total_len = len; + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + ctl_datamove((union ctl_io *)ctsio); + + return (CTL_RETVAL_COMPLETE); + } + + lbalen.lba = lba; + lbalen.len = num_blocks; + lbalen.flags = byte2; + memcpy(ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, &lbalen, + sizeof(lbalen)); + retval = lun->backend->config_write((union ctl_io *)ctsio); + + return (retval); +} + +int +ctl_unmap(struct ctl_scsiio *ctsio) +{ + struct ctl_lun *lun; + struct scsi_unmap *cdb; + struct ctl_ptr_len_flags ptrlen; + struct scsi_unmap_header *hdr; + struct scsi_unmap_desc *buf, *end; + uint64_t lba; + uint32_t num_blocks; + int len, retval; + uint8_t byte2; + + retval = CTL_RETVAL_COMPLETE; + + CTL_DEBUG_PRINT(("ctl_unmap\n")); + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + cdb = (struct scsi_unmap *)ctsio->cdb; + + len = scsi_2btoul(cdb->length); + byte2 = cdb->byte2; + + /* + * If we've got a kernel request that hasn't been malloced yet, + * malloc it and tell the caller the data buffer is here. + */ + if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { + ctsio->kern_data_ptr = malloc(len, M_CTL, M_WAITOK);; + ctsio->kern_data_len = len; + ctsio->kern_total_len = len; + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + ctl_datamove((union ctl_io *)ctsio); + + return (CTL_RETVAL_COMPLETE); + } + + len = ctsio->kern_total_len - ctsio->kern_data_resid; + hdr = (struct scsi_unmap_header *)ctsio->kern_data_ptr; + if (len < sizeof (*hdr) || + len < (scsi_2btoul(hdr->length) + sizeof(hdr->length)) || + len < (scsi_2btoul(hdr->desc_length) + sizeof (*hdr)) || + scsi_2btoul(hdr->desc_length) % sizeof(*buf) != 0) { + ctl_set_invalid_field(ctsio, + /*sks_valid*/ 0, + /*command*/ 0, + /*field*/ 0, + /*bit_valid*/ 0, + /*bit*/ 0); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + len = scsi_2btoul(hdr->desc_length); + buf = (struct scsi_unmap_desc *)(hdr + 1); + end = buf + len / sizeof(*buf); + + ptrlen.ptr = (void *)buf; + ptrlen.len = len; + ptrlen.flags = byte2; + memcpy(ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, &ptrlen, + sizeof(ptrlen)); + + for (; buf < end; buf++) { + lba = scsi_8btou64(buf->lba); + num_blocks = scsi_4btoul(buf->length); + if (((lba + num_blocks) > (lun->be_lun->maxlba + 1)) + || ((lba + num_blocks) < lba)) { + ctl_set_lba_out_of_range(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + } + + retval = lun->backend->config_write((union ctl_io *)ctsio); + + return (retval); +} + /* * Note that this function currently doesn't actually do anything inside * CTL to enforce things if the DQue bit is turned on. @@ -6909,6 +7102,8 @@ ctl_read_capacity_16(struct ctl_scsiio * scsi_ulto4b(lun->be_lun->blocksize, data->length); data->prot_lbppbe = lun->be_lun->pblockexp & SRC16_LBPPBE; scsi_ulto2b(lun->be_lun->pblockoff & SRC16_LALBA_A, data->lalba_lbp); + if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) + data->lalba_lbp[0] |= SRC16_LBPME; ctsio->scsi_status = SCSI_STATUS_OK; @@ -8995,8 +9190,8 @@ ctl_inquiry_evpd_supported(struct ctl_sc lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - sup_page_size = sizeof(struct scsi_vpd_supported_pages) + - SCSI_EVPD_NUM_SUPPORTED_PAGES; + sup_page_size = sizeof(struct scsi_vpd_supported_pages) * + SCSI_EVPD_NUM_SUPPORTED_PAGES; ctsio->kern_data_ptr = malloc(sup_page_size, M_CTL, M_WAITOK | M_ZERO); pages = (struct scsi_vpd_supported_pages *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; @@ -9032,6 +9227,10 @@ ctl_inquiry_evpd_supported(struct ctl_sc pages->page_list[1] = SVPD_UNIT_SERIAL_NUMBER; /* Device Identification */ pages->page_list[2] = SVPD_DEVICE_ID; + /* Block limits */ + pages->page_list[3] = SVPD_BLOCK_LIMITS; + /* Logical Block Provisioning */ + pages->page_list[4] = SVPD_LBP; ctsio->scsi_status = SCSI_STATUS_OK; @@ -9296,11 +9495,117 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio } static int +ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio, int alloc_len) +{ + struct scsi_vpd_block_limits *bl_ptr; + struct ctl_lun *lun; + int bs; + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + bs = lun->be_lun->blocksize; + + ctsio->kern_data_ptr = malloc(sizeof(*bl_ptr), M_CTL, M_WAITOK | M_ZERO); + bl_ptr = (struct scsi_vpd_block_limits *)ctsio->kern_data_ptr; + ctsio->kern_sg_entries = 0; + + if (sizeof(*bl_ptr) < alloc_len) { + ctsio->residual = alloc_len - sizeof(*bl_ptr); + ctsio->kern_data_len = sizeof(*bl_ptr); + ctsio->kern_total_len = sizeof(*bl_ptr); + } else { + ctsio->residual = 0; + ctsio->kern_data_len = alloc_len; + ctsio->kern_total_len = alloc_len; + } + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + + /* + * The control device is always connected. The disk device, on the + * other hand, may not be online all the time. Need to change this + * to figure out whether the disk device is actually online or not. + */ + if (lun != NULL) + bl_ptr->device = (SID_QUAL_LU_CONNECTED << 5) | + lun->be_lun->lun_type; + else + bl_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; + + bl_ptr->page_code = SVPD_BLOCK_LIMITS; + scsi_ulto2b(sizeof(*bl_ptr), bl_ptr->page_length); + scsi_ulto4b((16 * 1024 * 1024) / bs, bl_ptr->max_txfer_len); + scsi_ulto4b(MAXPHYS / bs, bl_ptr->opt_txfer_len); + if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { + scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_lba_cnt); + scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_blk_cnt); + } + scsi_u64to8b(UINT64_MAX, bl_ptr->max_write_same_length); + + ctsio->scsi_status = SCSI_STATUS_OK; + ctsio->be_move_done = ctl_config_move_done; + ctl_datamove((union ctl_io *)ctsio); + + return (CTL_RETVAL_COMPLETE); +} + +static int +ctl_inquiry_evpd_lbp(struct ctl_scsiio *ctsio, int alloc_len) +{ + struct scsi_vpd_logical_block_prov *lbp_ptr; + struct ctl_lun *lun; + int bs; + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + bs = lun->be_lun->blocksize; + + ctsio->kern_data_ptr = malloc(sizeof(*lbp_ptr), M_CTL, M_WAITOK | M_ZERO); + lbp_ptr = (struct scsi_vpd_logical_block_prov *)ctsio->kern_data_ptr; + ctsio->kern_sg_entries = 0; + + if (sizeof(*lbp_ptr) < alloc_len) { + ctsio->residual = alloc_len - sizeof(*lbp_ptr); + ctsio->kern_data_len = sizeof(*lbp_ptr); + ctsio->kern_total_len = sizeof(*lbp_ptr); + } else { + ctsio->residual = 0; + ctsio->kern_data_len = alloc_len; + ctsio->kern_total_len = alloc_len; + } + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + + /* + * The control device is always connected. The disk device, on the + * other hand, may not be online all the time. Need to change this + * to figure out whether the disk device is actually online or not. + */ + if (lun != NULL) + lbp_ptr->device = (SID_QUAL_LU_CONNECTED << 5) | + lun->be_lun->lun_type; + else + lbp_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; + + lbp_ptr->page_code = SVPD_LBP; + if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) + lbp_ptr->flags = SVPD_LBP_UNMAP | SVPD_LBP_WS16 | SVPD_LBP_WS10; + + ctsio->scsi_status = SCSI_STATUS_OK; + ctsio->be_move_done = ctl_config_move_done; + ctl_datamove((union ctl_io *)ctsio); + + return (CTL_RETVAL_COMPLETE); +} + +static int ctl_inquiry_evpd(struct ctl_scsiio *ctsio) { struct scsi_inquiry *cdb; + struct ctl_lun *lun; int alloc_len, retval; + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; cdb = (struct scsi_inquiry *)ctsio->cdb; retval = CTL_RETVAL_COMPLETE; @@ -9317,6 +9622,12 @@ ctl_inquiry_evpd(struct ctl_scsiio *ctsi case SVPD_DEVICE_ID: retval = ctl_inquiry_evpd_devid(ctsio, alloc_len); break; + case SVPD_BLOCK_LIMITS: + retval = ctl_inquiry_evpd_block_limits(ctsio, alloc_len); + break; + case SVPD_LBP: + retval = ctl_inquiry_evpd_lbp(ctsio, alloc_len); + break; default: ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, @@ -9687,6 +9998,24 @@ ctl_get_lba_len(union ctl_io *io, uint64 *len = scsi_4btoul(cdb->length); break; } + case WRITE_SAME_10: { + struct scsi_write_same_10 *cdb; + + cdb = (struct scsi_write_same_10 *)io->scsiio.cdb; + + *lba = scsi_4btoul(cdb->addr); + *len = scsi_2btoul(cdb->length); + break; + } + case WRITE_SAME_16: { + struct scsi_write_same_16 *cdb; + + cdb = (struct scsi_write_same_16 *)io->scsiio.cdb; + + *lba = scsi_8btou64(cdb->addr); + *len = scsi_4btoul(cdb->length); + break; + } default: return (1); break; /* NOTREACHED */ Modified: head/sys/cam/ctl/ctl_backend.h ============================================================================== --- head/sys/cam/ctl/ctl_backend.h Tue Apr 8 20:40:54 2014 (r264273) +++ head/sys/cam/ctl/ctl_backend.h Tue Apr 8 20:50:48 2014 (r264274) @@ -71,6 +71,8 @@ * valid for use in SCSI INQUIRY VPD page 0x83. * * The DEV_TYPE flag tells us that the device_type field is filled in. + * + * The UNMAP flag tells us that this LUN supports UNMAP. */ typedef enum { CTL_LUN_FLAG_ID_REQ = 0x01, @@ -79,7 +81,8 @@ typedef enum { CTL_LUN_FLAG_PRIMARY = 0x08, CTL_LUN_FLAG_SERIAL_NUM = 0x10, CTL_LUN_FLAG_DEVID = 0x20, - CTL_LUN_FLAG_DEV_TYPE = 0x40 + CTL_LUN_FLAG_DEV_TYPE = 0x40, + CTL_LUN_FLAG_UNMAP = 0x80 } ctl_backend_lun_flags; #ifdef _KERNEL Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Tue Apr 8 20:40:54 2014 (r264273) +++ head/sys/cam/ctl/ctl_backend_block.c Tue Apr 8 20:50:48 2014 (r264274) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -150,6 +151,7 @@ struct ctl_be_block_lun { union ctl_be_block_bedata backend; cbb_dispatch_t dispatch; cbb_dispatch_t lun_flush; + cbb_dispatch_t unmap; struct mtx lock; uma_zone_t lun_zone; uint64_t size_blocks; @@ -205,6 +207,7 @@ struct ctl_be_block_io { uint64_t io_offset; struct ctl_be_block_softc *softc; struct ctl_be_block_lun *lun; + void (*beio_cont)(struct ctl_be_block_io *beio); /* to continue processing */ }; static int cbb_num_threads = 14; @@ -225,6 +228,8 @@ static void ctl_be_block_dispatch_file(s struct ctl_be_block_io *beio); static void ctl_be_block_flush_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); +static void ctl_be_block_unmap_dev(struct ctl_be_block_lun *be_lun, + struct ctl_be_block_io *beio); static void ctl_be_block_dispatch_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); static void ctl_be_block_cw_dispatch(struct ctl_be_block_lun *be_lun, @@ -333,8 +338,12 @@ ctl_complete_beio(struct ctl_be_block_io /*now*/ NULL, /*then*/&beio->ds_t0); - ctl_free_beio(beio); - ctl_done(io); + if (beio->beio_cont != NULL) { + beio->beio_cont(beio); + } else { + ctl_free_beio(beio); + ctl_done(io); + } } static int @@ -480,11 +489,12 @@ ctl_be_block_biodone(struct bio *bio) } /* - * If this is a write or a flush, we're all done. + * If this is a write, a flush or a delete, we're all done. * If this is a read, we can now send the data to the user. */ if ((beio->bio_cmd == BIO_WRITE) - || (beio->bio_cmd == BIO_FLUSH)) { + || (beio->bio_cmd == BIO_FLUSH) + || (beio->bio_cmd == BIO_DELETE)) { ctl_set_success(&io->scsiio); ctl_complete_beio(beio); } else { @@ -750,6 +760,77 @@ ctl_be_block_flush_dev(struct ctl_be_blo } static void +ctl_be_block_unmap_dev_range(struct ctl_be_block_lun *be_lun, + struct ctl_be_block_io *beio, + uint64_t off, uint64_t len, int last) +{ + struct bio *bio; + struct ctl_be_block_devdata *dev_data; + + dev_data = &be_lun->backend.dev; + while (len > 0) { + bio = g_alloc_bio(); + bio->bio_cmd = BIO_DELETE; + bio->bio_flags |= beio->bio_flags; + bio->bio_dev = dev_data->cdev; + bio->bio_offset = off; + bio->bio_length = MIN(len, LONG_MAX); + bio->bio_data = 0; + bio->bio_done = ctl_be_block_biodone; + bio->bio_caller1 = beio; + bio->bio_pblkno = beio->io_offset / be_lun->blocksize; + + off += bio->bio_length; + len -= bio->bio_length; + + mtx_lock(&be_lun->lock); + beio->num_bios_sent++; + if (last && len == 0) + beio->send_complete = 1; + mtx_unlock(&be_lun->lock); + + (*dev_data->csw->d_strategy)(bio); + } +} + +static void +ctl_be_block_unmap_dev(struct ctl_be_block_lun *be_lun, + struct ctl_be_block_io *beio) +{ + union ctl_io *io; + struct ctl_be_block_devdata *dev_data; + struct ctl_ptr_len_flags ptrlen; + struct scsi_unmap_desc *buf, *end; + uint64_t len; + + dev_data = &be_lun->backend.dev; + io = beio->io; + + DPRINTF("entered\n"); + + binuptime(&beio->ds_t0); + devstat_start_transaction(be_lun->disk_stats, &beio->ds_t0); + + if (beio->io_offset == -1) { + beio->io_len = 0; + memcpy(&ptrlen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, + sizeof(ptrlen)); + buf = (struct scsi_unmap_desc *)ptrlen.ptr; + end = buf + ptrlen.len / sizeof(*buf); + for (; buf < end; buf++) { + len = (uint64_t)scsi_4btoul(buf->length) * + be_lun->blocksize; + beio->io_len += len; + ctl_be_block_unmap_dev_range(be_lun, beio, + scsi_8btou64(buf->lba) * be_lun->blocksize, len, + (end - buf < 32) ? TRUE : FALSE); + } + } else + ctl_be_block_unmap_dev_range(be_lun, beio, + beio->io_offset, beio->io_len, TRUE); +} + +static void ctl_be_block_dispatch_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio) { @@ -837,6 +918,208 @@ ctl_be_block_dispatch_dev(struct ctl_be_ } static void +ctl_be_block_cw_done_ws(struct ctl_be_block_io *beio) +{ + union ctl_io *io; + + io = beio->io; + ctl_free_beio(beio); + if (((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE) + && ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)) { + ctl_config_write_done(io); + return; + } + + ctl_be_block_config_write(io); +} + +static void +ctl_be_block_cw_dispatch_ws(struct ctl_be_block_lun *be_lun, + union ctl_io *io) +{ + struct ctl_be_block_io *beio; + struct ctl_be_block_softc *softc; + struct ctl_lba_len_flags lbalen; + uint64_t len_left, lba; + int i, seglen; + uint8_t *buf, *end; + + DPRINTF("entered\n"); + + beio = io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr; + softc = be_lun->softc; + memcpy(&lbalen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, + sizeof(lbalen)); + + if (lbalen.flags & ~(SWS_LBDATA | SWS_UNMAP) || + (lbalen.flags & SWS_UNMAP && be_lun->unmap == NULL)) { + ctl_free_beio(beio); + ctl_set_invalid_field(&io->scsiio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 1, + /*bit_valid*/ 0, + /*bit*/ 0); + ctl_config_write_done(io); + return; + } + + /* + * If the I/O came down with an ordered or head of queue tag, set + * the BIO_ORDERED attribute. For head of queue tags, that's + * pretty much the best we can do. + */ + if ((io->scsiio.tag_type == CTL_TAG_ORDERED) + || (io->scsiio.tag_type == CTL_TAG_HEAD_OF_QUEUE)) + beio->bio_flags = BIO_ORDERED; + + switch (io->scsiio.tag_type) { + case CTL_TAG_ORDERED: + beio->ds_tag_type = DEVSTAT_TAG_ORDERED; + break; + case CTL_TAG_HEAD_OF_QUEUE: + beio->ds_tag_type = DEVSTAT_TAG_HEAD; + break; + case CTL_TAG_UNTAGGED: + case CTL_TAG_SIMPLE: + case CTL_TAG_ACA: + default: + beio->ds_tag_type = DEVSTAT_TAG_SIMPLE; + break; + } + + if (lbalen.flags & SWS_UNMAP) { + beio->io_offset = lbalen.lba * be_lun->blocksize; + beio->io_len = (uint64_t)lbalen.len * be_lun->blocksize; + beio->bio_cmd = BIO_DELETE; + beio->ds_trans_type = DEVSTAT_FREE; + + be_lun->unmap(be_lun, beio); + return; + } + + beio->bio_cmd = BIO_WRITE; + beio->ds_trans_type = DEVSTAT_WRITE; + + DPRINTF("WRITE SAME at LBA %jx len %u\n", + (uintmax_t)lbalen.lba, lbalen.len); + + len_left = (uint64_t)lbalen.len * be_lun->blocksize; + for (i = 0, lba = 0; i < CTLBLK_MAX_SEGS && len_left > 0; i++) { + + /* + * Setup the S/G entry for this chunk. + */ + seglen = MIN(MAXPHYS, len_left); + seglen -= seglen % be_lun->blocksize; + beio->sg_segs[i].len = seglen; + beio->sg_segs[i].addr = uma_zalloc(be_lun->lun_zone, M_WAITOK); + + DPRINTF("segment %d addr %p len %zd\n", i, + beio->sg_segs[i].addr, beio->sg_segs[i].len); + + beio->num_segs++; + len_left -= seglen; + + buf = beio->sg_segs[i].addr; + end = buf + seglen; + for (; buf < end; buf += be_lun->blocksize) { + memcpy(buf, io->scsiio.kern_data_ptr, be_lun->blocksize); + if (lbalen.flags & SWS_LBDATA) + scsi_ulto4b(lbalen.lba + lba, buf); + lba++; + } + } + + beio->io_offset = lbalen.lba * be_lun->blocksize; + beio->io_len = lba * be_lun->blocksize; + + /* We can not do all in one run. Correct and schedule rerun. */ + if (len_left > 0) { + lbalen.lba += lba; + lbalen.len -= lba; + memcpy(io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, &lbalen, + sizeof(lbalen)); + beio->beio_cont = ctl_be_block_cw_done_ws; + } + + be_lun->dispatch(be_lun, beio); +} + +static void +ctl_be_block_cw_dispatch_unmap(struct ctl_be_block_lun *be_lun, + union ctl_io *io) +{ + struct ctl_be_block_io *beio; + struct ctl_be_block_softc *softc; + struct ctl_ptr_len_flags ptrlen; + + DPRINTF("entered\n"); + + beio = io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr; + softc = be_lun->softc; + memcpy(&ptrlen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, + sizeof(ptrlen)); + + if (ptrlen.flags != 0 || be_lun->unmap == NULL) { + ctl_free_beio(beio); + ctl_set_invalid_field(&io->scsiio, + /*sks_valid*/ 0, + /*command*/ 1, + /*field*/ 0, + /*bit_valid*/ 0, + /*bit*/ 0); + ctl_config_write_done(io); + return; + } + + /* + * If the I/O came down with an ordered or head of queue tag, set + * the BIO_ORDERED attribute. For head of queue tags, that's + * pretty much the best we can do. + */ + if ((io->scsiio.tag_type == CTL_TAG_ORDERED) + || (io->scsiio.tag_type == CTL_TAG_HEAD_OF_QUEUE)) + beio->bio_flags = BIO_ORDERED; + + switch (io->scsiio.tag_type) { + case CTL_TAG_ORDERED: + beio->ds_tag_type = DEVSTAT_TAG_ORDERED; + break; + case CTL_TAG_HEAD_OF_QUEUE: + beio->ds_tag_type = DEVSTAT_TAG_HEAD; + break; + case CTL_TAG_UNTAGGED: + case CTL_TAG_SIMPLE: + case CTL_TAG_ACA: + default: + beio->ds_tag_type = DEVSTAT_TAG_SIMPLE; + break; + } + + beio->io_len = 0; + beio->io_offset = -1; + + beio->bio_cmd = BIO_DELETE; + beio->ds_trans_type = DEVSTAT_FREE; + + DPRINTF("WRITE SAME at LBA %jx len %u\n", + (uintmax_t)lbalen.lba, lbalen.len); + + be_lun->unmap(be_lun, beio); +} + +static void +ctl_be_block_cw_done(struct ctl_be_block_io *beio) +{ + union ctl_io *io; + + io = beio->io; + ctl_free_beio(beio); + ctl_config_write_done(io); +} + +static void ctl_be_block_cw_dispatch(struct ctl_be_block_lun *be_lun, union ctl_io *io) { @@ -847,11 +1130,9 @@ ctl_be_block_cw_dispatch(struct ctl_be_b softc = be_lun->softc; beio = ctl_alloc_beio(softc); - KASSERT(beio != NULL, ("ctl_alloc_beio() failed")); - beio->io = io; - beio->softc = softc; beio->lun = be_lun; + beio->beio_cont = ctl_be_block_cw_done; io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr = beio; switch (io->scsiio.cdb[0]) { @@ -863,6 +1144,13 @@ ctl_be_block_cw_dispatch(struct ctl_be_b beio->io_len = 0; be_lun->lun_flush(be_lun, beio); break; + case WRITE_SAME_10: + case WRITE_SAME_16: + ctl_be_block_cw_dispatch_ws(be_lun, io); + break; + case UNMAP: + ctl_be_block_cw_dispatch_unmap(be_lun, io); + break; default: panic("Unhandled CDB type %#x", io->scsiio.cdb[0]); break; @@ -918,10 +1206,7 @@ ctl_be_block_dispatch(struct ctl_be_bloc } beio = ctl_alloc_beio(softc); - KASSERT(beio != NULL, ("ctl_alloc_beio() failed")); - beio->io = io; - beio->softc = softc; beio->lun = be_lun; io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr = beio; @@ -1271,6 +1556,7 @@ ctl_be_block_open_dev(struct ctl_be_bloc be_lun->dev_type = CTL_BE_BLOCK_DEV; be_lun->dispatch = ctl_be_block_dispatch_dev; be_lun->lun_flush = ctl_be_block_flush_dev; + be_lun->unmap = ctl_be_block_unmap_dev; be_lun->backend.dev.cdev = be_lun->vn->v_rdev; be_lun->backend.dev.csw = dev_refthread(be_lun->backend.dev.cdev, &be_lun->backend.dev.dev_ref); @@ -1530,7 +1816,7 @@ ctl_be_block_create(struct ctl_be_block_ struct ctl_lun_create_params *params; struct ctl_be_arg *file_arg; char tmpstr[32]; - int retval, num_threads; + int retval, num_threads, unmap; int i; params = &req->reqdata.create; @@ -1621,6 +1907,7 @@ ctl_be_block_create(struct ctl_be_block_ * XXX This searching loop might be refactored to be combined with * the loop above, */ + unmap = 0; for (i = 0; i < req->num_be_args; i++) { if (strcmp(req->kern_be_args[i].kname, "num_threads") == 0) { struct ctl_be_arg *thread_arg; @@ -1649,6 +1936,9 @@ ctl_be_block_create(struct ctl_be_block_ } num_threads = tmp_num_threads; + } else if (strcmp(req->kern_be_args[i].kname, "unmap") == 0 && + strcmp(req->kern_be_args[i].kvalue, "on") == 0) { + unmap = 1; } else if (strcmp(req->kern_be_args[i].kname, "file") != 0 && strcmp(req->kern_be_args[i].kname, "dev") != 0) { struct ctl_be_lun_option *opt; @@ -1664,6 +1954,8 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->flags = CTL_BE_BLOCK_LUN_UNCONFIGURED; be_lun->ctl_be_lun.flags = CTL_LUN_FLAG_PRIMARY; + if (unmap) + be_lun->ctl_be_lun.flags |= CTL_LUN_FLAG_UNMAP; be_lun->ctl_be_lun.be_lun = be_lun; be_lun->ctl_be_lun.blocksize = be_lun->blocksize; be_lun->ctl_be_lun.pblockexp = be_lun->pblockexp; @@ -2139,6 +2431,9 @@ ctl_be_block_config_write(union ctl_io * switch (io->scsiio.cdb[0]) { case SYNCHRONIZE_CACHE: case SYNCHRONIZE_CACHE_16: + case WRITE_SAME_10: + case WRITE_SAME_16: + case UNMAP: /* * The upper level CTL code will filter out any CDBs with * the immediate bit set and return the proper error. Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_ramdisk.c Tue Apr 8 20:40:54 2014 (r264273) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Tue Apr 8 20:50:48 2014 (r264274) @@ -491,7 +491,7 @@ ctl_backend_ramdisk_create(struct ctl_be struct ctl_lun_create_params *params; uint32_t blocksize; char tmpstr[32]; - int i, retval; + int i, retval, unmap; retval = 0; params = &req->reqdata.create; @@ -547,18 +547,25 @@ ctl_backend_ramdisk_create(struct ctl_be be_lun->softc = softc; for (i = 0; i < req->num_be_args; i++) { - struct ctl_be_lun_option *opt; + if (strcmp(req->kern_be_args[i].kname, "unmap") == 0 && + strcmp(req->kern_be_args[i].kvalue, "on") == 0) { + unmap = 1; + } else { + struct ctl_be_lun_option *opt; - opt = malloc(sizeof(*opt), M_RAMDISK, M_WAITOK); - opt->name = malloc(strlen(req->kern_be_args[i].kname) + 1, M_RAMDISK, M_WAITOK); - strcpy(opt->name, req->kern_be_args[i].kname); - opt->value = malloc(strlen(req->kern_be_args[i].kvalue) + 1, M_RAMDISK, M_WAITOK); - strcpy(opt->value, req->kern_be_args[i].kvalue); - STAILQ_INSERT_TAIL(&be_lun->ctl_be_lun.options, opt, links); + opt = malloc(sizeof(*opt), M_RAMDISK, M_WAITOK); + opt->name = malloc(strlen(req->kern_be_args[i].kname) + 1, M_RAMDISK, M_WAITOK); + strcpy(opt->name, req->kern_be_args[i].kname); + opt->value = malloc(strlen(req->kern_be_args[i].kvalue) + 1, M_RAMDISK, M_WAITOK); + strcpy(opt->value, req->kern_be_args[i].kvalue); + STAILQ_INSERT_TAIL(&be_lun->ctl_be_lun.options, opt, links); + } } be_lun->flags = CTL_BE_RAMDISK_LUN_UNCONFIGURED; be_lun->ctl_be_lun.flags = CTL_LUN_FLAG_PRIMARY; + if (unmap) + be_lun->ctl_be_lun.flags = CTL_LUN_FLAG_UNMAP; be_lun->ctl_be_lun.be_lun = be_lun; if (params->flags & CTL_LUN_FLAG_ID_REQ) { @@ -882,6 +889,12 @@ ctl_backend_ramdisk_config_write(union c ctl_config_write_done(io); break; } + case WRITE_SAME_10: + case WRITE_SAME_16: + case UNMAP: + ctl_set_success(&io->scsiio); + ctl_config_write_done(io); + break; default: ctl_set_invalid_opcode(&io->scsiio); ctl_config_write_done(io); Modified: head/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- head/sys/cam/ctl/ctl_cmd_table.c Tue Apr 8 20:40:54 2014 (r264273) +++ head/sys/cam/ctl/ctl_cmd_table.c Tue Apr 8 20:50:48 2014 (r264274) @@ -331,10 +331,13 @@ struct ctl_cmd_entry ctl_cmd_table[] = {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, /* 41 WRITE SAME(10) */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +{ctl_write_same, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN | + CTL_FLAG_DATA_OUT, + CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE}, -/* 42 READ SUB-CHANNEL */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +/* 42 READ SUB-CHANNEL / UNMAP */ +{ctl_unmap, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_OUT, + CTL_LUN_PAT_WRITE}, /* 43 READ TOC/PMA/ATIP */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, @@ -623,7 +626,9 @@ struct ctl_cmd_entry ctl_cmd_table[] = {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, /* 93 WRITE SAME(16) */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +{ctl_write_same, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN | + CTL_FLAG_DATA_OUT, + CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE}, /* 94 */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, Modified: head/sys/cam/ctl/ctl_io.h ============================================================================== --- head/sys/cam/ctl/ctl_io.h Tue Apr 8 20:40:54 2014 (r264273) +++ head/sys/cam/ctl/ctl_io.h Tue Apr 8 20:50:48 2014 (r264274) @@ -134,6 +134,18 @@ struct ctl_lba_len { uint32_t len; }; +struct ctl_lba_len_flags { + uint64_t lba; + uint32_t len; + uint32_t flags; +}; + +struct ctl_ptr_len_flags { + uint8_t *ptr; + uint32_t len; + uint32_t flags; +}; + union ctl_priv { uint8_t bytes[sizeof(uint64_t) * 2]; uint64_t integer; Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Tue Apr 8 20:40:54 2014 (r264273) +++ head/sys/cam/ctl/ctl_private.h Tue Apr 8 20:50:48 2014 (r264274) @@ -470,6 +470,8 @@ int ctl_start_stop(struct ctl_scsiio *ct int ctl_sync_cache(struct ctl_scsiio *ctsio); int ctl_format(struct ctl_scsiio *ctsio); int ctl_write_buffer(struct ctl_scsiio *ctsio); +int ctl_write_same(struct ctl_scsiio *ctsio); +int ctl_unmap(struct ctl_scsiio *ctsio); int ctl_mode_select(struct ctl_scsiio *ctsio); int ctl_mode_sense(struct ctl_scsiio *ctsio); int ctl_read_capacity(struct ctl_scsiio *ctsio); Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Tue Apr 8 20:40:54 2014 (r264273) +++ head/sys/cam/scsi/scsi_all.h Tue Apr 8 20:50:48 2014 (r264274) @@ -854,6 +854,20 @@ struct scsi_unmap uint8_t control; }; +struct scsi_unmap_header +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 20:54:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E8B0AE4; Tue, 8 Apr 2014 20:54:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B6BA1397; Tue, 8 Apr 2014 20:54:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38KsDfV011242; Tue, 8 Apr 2014 20:54:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38KsD0G011241; Tue, 8 Apr 2014 20:54:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201404082054.s38KsD0G011241@svn.freebsd.org> From: John Baldwin Date: Tue, 8 Apr 2014 20:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264275 - head/usr.sbin/bhyvectl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 20:54:13 -0000 Author: jhb Date: Tue Apr 8 20:54:13 2014 New Revision: 264275 URL: http://svnweb.freebsd.org/changeset/base/264275 Log: Explicitly initialize 'vmname' to NULL. Reviewed by: grehan Modified: head/usr.sbin/bhyvectl/bhyvectl.c Modified: head/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- head/usr.sbin/bhyvectl/bhyvectl.c Tue Apr 8 20:50:48 2014 (r264274) +++ head/usr.sbin/bhyvectl/bhyvectl.c Tue Apr 8 20:54:13 2014 (r264275) @@ -569,6 +569,7 @@ main(int argc, char *argv[]) }; vcpu = 0; + vmname = NULL; assert_lapic_lvt = -1; progname = basename(argv[0]); From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 20:55:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E225BC3C for ; Tue, 8 Apr 2014 20:55:20 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7DED13BC for ; Tue, 8 Apr 2014 20:55:20 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s38KtKad048222 for ; Tue, 8 Apr 2014 20:55:20 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s38KtKm8048216 for svn-src-head@freebsd.org; Tue, 8 Apr 2014 20:55:20 GMT (envelope-from bdrewery) Received: (qmail 2566 invoked from network); 8 Apr 2014 15:55:18 -0500 Received: from unknown (HELO roundcube.xk42.net) (10.10.5.5) by sweb.xzibition.com with SMTP; 8 Apr 2014 15:55:18 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 08 Apr 2014 15:55:18 -0500 From: Bryan Drewery To: Xin LI Subject: Re: svn commit: r264265 - in head: crypto/openssl/crypto/bn crypto/openssl/crypto/ec crypto/openssl/ssl sys/fs/nfsserver Organization: FreeBSD In-Reply-To: <201404081827.s38IRXiL048987@svn.freebsd.org> References: <201404081827.s38IRXiL048987@svn.freebsd.org> Message-ID: X-Sender: bdrewery@FreeBSD.org User-Agent: Roundcube Webmail/0.9.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, secteam@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 20:55:20 -0000 On 2014-04-08 13:27, Xin LI wrote: > Author: delphij > Date: Tue Apr 8 18:27:32 2014 > New Revision: 264265 > URL: http://svnweb.freebsd.org/changeset/base/264265 > > Log: > Fix NFS deadlock vulnerability. [SA-14:05] > > Fix "Heartbleed" vulnerability and ECDSA Cache Side-channel > Attack in OpenSSL. [SA-14:06] > > Modified: > head/crypto/openssl/crypto/bn/bn.h > head/crypto/openssl/crypto/bn/bn_lib.c > head/crypto/openssl/crypto/ec/ec2_mult.c > head/crypto/openssl/ssl/d1_both.c > head/crypto/openssl/ssl/t1_lib.c > head/sys/fs/nfsserver/nfs_nfsdserv.c > __FreeBSD_version is needed too. Also, that this was a partial release of 1.0.1g is confusing a LOT of users. They think they are still vulnerable. They expect to see 1.0.1g in 'openssl version'. We could have our own version string in 'openssl version' to remedy this. -- Regards, Bryan Drewery From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 20:59:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CF2AFBE; Tue, 8 Apr 2014 20:59:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49B82143C; Tue, 8 Apr 2014 20:59:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38Kx34p011911; Tue, 8 Apr 2014 20:59:03 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38Kx38n011910; Tue, 8 Apr 2014 20:59:03 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404082059.s38Kx38n011910@svn.freebsd.org> From: Christian Brueffer Date: Tue, 8 Apr 2014 20:59:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264276 - head/usr.sbin/binmiscctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 20:59:03 -0000 Author: brueffer Date: Tue Apr 8 20:59:02 2014 New Revision: 264276 URL: http://svnweb.freebsd.org/changeset/base/264276 Log: Quick mdoc/whitespace/spelling pass, this needs some more work. Modified: head/usr.sbin/binmiscctl/binmiscctl.8 Modified: head/usr.sbin/binmiscctl/binmiscctl.8 ============================================================================== --- head/usr.sbin/binmiscctl/binmiscctl.8 Tue Apr 8 20:54:13 2014 (r264275) +++ head/usr.sbin/binmiscctl/binmiscctl.8 Tue Apr 8 20:59:02 2014 (r264276) @@ -27,7 +27,7 @@ .\" .\" Support for miscellaneous binary image activators .\" -.Dd May 14, 2013 +.Dd April 8, 2014 .Dt 8 .Os .Sh NAME @@ -37,14 +37,14 @@ .Nm .Cm add .Ar name -.Cm --interpreter +.Cm --interpreter .Ar path -.Cm --magic +.Cm --magic .Ar magic .Cm --size .Ar size -.Op --mask Ar mask -.Op --offset Ar offset +.Op --mask Ar mask +.Op --offset Ar offset .Op --set-enabled .Nm .Cm remove @@ -65,8 +65,10 @@ The .Nm utility is the management utility for configuring miscellaneous binaries image -activators in the kernel. It allows the adding, deleting, disabling, -enabling, and looking up interpreters. Also, all the interpreters can +activators in the kernel. +It allows the adding, deleting, disabling, +enabling, and looking up interpreters. +Also, all the interpreters can be listed as well. .Pp The first argument on the command line indicates the operation to be @@ -76,7 +78,7 @@ Operation must be one of the following: .It Xo .Cm add .Ar name -.Cm --interpreter +.Cm --interpreter .Ar path .Cm --magic .Ar magic @@ -86,10 +88,11 @@ Operation must be one of the following: .Op --offset Ar offset .Op --set-enabled .Xc -Add a new activator entry in the kernel. You must specify an +Add a new activator entry in the kernel. +You must specify an unique .Ar name, -interpreter path and its arguments +interpreter path and its arguments .Ar path, header .Ar magic @@ -103,25 +106,26 @@ in bytes. Optionally you may specify a .Ar mask to do a bitwise AND with the header bytes. - This effectively allows you to ignore fields in the binary header that -do not uniquely indentfy binary file's type. +do not uniquely indentify binary file's type. .Pp An .Ar offset may be specified for the magic bytes using the .Ar --offset -argument. By default the +argument. +By default the .Ar offset is zero. .Pp To set the activator entry enabled the .Ar --set-enabled -option is used. The activator default state is disabled. +option is used. +The activator default state is disabled. .Pp The interpreter .Ar path -may also arguments for the interpreter including +may also arguments for the interpreter including .Ar #a which gets replaced by the old argv0 value in the interpreter string. .It Cm remove Ar name @@ -156,31 +160,31 @@ Set the state of the .Ar llvmbc image activator to disabled. .Pp -.Dl binmiscctl enable llvmbc +.Dl binmiscctl enable llvmbc .Pp Set the state of the .Ar llvmbc image activator to enabled. .Pp -.Dl binmiscctl remove llvmbc +.Dl binmiscctl remove llvmbc .Pp Delete the .Ar llvmbc image activator. .Pp -.Dl binmiscctl lookup llvmbc +.Dl binmiscctl lookup llvmbc .Pp Lookup and list the record for the .Ar llvmbc image activator. .Sh SEE ALSO +.Xr lli 1 , .Xr execve 2 -.Xr lli 1 .Sh HISTORY The .Cm binmiscctl command was added in -.Fx 10.0 . +.Fx 10.1 . It was developed to support the imgact_binmisc kernel module. .Sh AUTHORS Stacey D Son From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 21:02:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4816D23D; Tue, 8 Apr 2014 21:02:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 358D814EE; Tue, 8 Apr 2014 21:02:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38L24FP015340; Tue, 8 Apr 2014 21:02:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38L24Kl015339; Tue, 8 Apr 2014 21:02:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201404082102.s38L24Kl015339@svn.freebsd.org> From: John Baldwin Date: Tue, 8 Apr 2014 21:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264277 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 21:02:04 -0000 Author: jhb Date: Tue Apr 8 21:02:03 2014 New Revision: 264277 URL: http://svnweb.freebsd.org/changeset/base/264277 Log: Handle single-byte reads from the bvmcons port (0x220) by returning 0xff. Some guests may attempt to read from this port to identify psuedo-PNP ISA devices. (The ie(4) driver in FreeBSD/i386 is one example.) Reviewed by: grehan Modified: head/usr.sbin/bhyve/consport.c Modified: head/usr.sbin/bhyve/consport.c ============================================================================== --- head/usr.sbin/bhyve/consport.c Tue Apr 8 20:59:02 2014 (r264276) +++ head/usr.sbin/bhyve/consport.c Tue Apr 8 21:02:03 2014 (r264277) @@ -110,6 +110,15 @@ console_handler(struct vmctx *ctx, int v return (0); } + /* + * Guests might probe this port to look for old ISA devices + * using single-byte reads. Return 0xff for those. + */ + if (bytes == 1 && in) { + *eax = 0xff; + return (0); + } + if (bytes != 4) return (-1); From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 21:07:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0EC56660; Tue, 8 Apr 2014 21:07:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB1701551; Tue, 8 Apr 2014 21:07:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38L78kQ016111; Tue, 8 Apr 2014 21:07:08 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38L6xdd016035; Tue, 8 Apr 2014 21:06:59 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201404082106.s38L6xdd016035@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 8 Apr 2014 21:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264278 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes/asm crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/cms ... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 21:07:09 -0000 Author: jkim Date: Tue Apr 8 21:06:58 2014 New Revision: 264278 URL: http://svnweb.freebsd.org/changeset/base/264278 Log: Merge OpenSSL 1.0.1g. Approved by: benl (maintainer) Modified: head/crypto/openssl/CHANGES head/crypto/openssl/Configure head/crypto/openssl/FAQ head/crypto/openssl/Makefile head/crypto/openssl/Makefile.org head/crypto/openssl/NEWS head/crypto/openssl/README head/crypto/openssl/apps/apps.c head/crypto/openssl/apps/crl.c head/crypto/openssl/apps/dgst.c head/crypto/openssl/apps/ecparam.c head/crypto/openssl/apps/req.c head/crypto/openssl/crypto/aes/asm/vpaes-x86_64.pl head/crypto/openssl/crypto/asn1/asn1_err.c head/crypto/openssl/crypto/bio/bss_log.c head/crypto/openssl/crypto/cms/cms_lib.c head/crypto/openssl/crypto/cryptlib.c head/crypto/openssl/crypto/engine/eng_list.c head/crypto/openssl/crypto/evp/bio_b64.c head/crypto/openssl/crypto/modes/gcm128.c head/crypto/openssl/crypto/opensslv.h head/crypto/openssl/crypto/rand/md_rand.c head/crypto/openssl/crypto/symhacks.h head/crypto/openssl/crypto/x509/by_dir.c head/crypto/openssl/crypto/x509/x509_vfy.c head/crypto/openssl/doc/apps/config.pod head/crypto/openssl/doc/apps/crl.pod head/crypto/openssl/doc/apps/ec.pod head/crypto/openssl/doc/apps/pkcs12.pod head/crypto/openssl/doc/apps/req.pod head/crypto/openssl/doc/apps/s_client.pod head/crypto/openssl/doc/apps/s_server.pod head/crypto/openssl/doc/apps/ts.pod head/crypto/openssl/doc/apps/tsget.pod head/crypto/openssl/doc/crypto/BN_BLINDING_new.pod head/crypto/openssl/doc/crypto/ERR_get_error.pod head/crypto/openssl/doc/crypto/EVP_BytesToKey.pod head/crypto/openssl/doc/crypto/EVP_EncryptInit.pod head/crypto/openssl/doc/crypto/X509_VERIFY_PARAM_set_flags.pod head/crypto/openssl/doc/crypto/pem.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_verify.pod head/crypto/openssl/doc/ssl/SSL_set_shutdown.pod head/crypto/openssl/e_os.h head/crypto/openssl/engines/ccgost/gosthash.c head/crypto/openssl/ssl/kssl.h head/crypto/openssl/ssl/s23_clnt.c head/crypto/openssl/ssl/s3_srvr.c head/crypto/openssl/ssl/ssl.h head/crypto/openssl/ssl/t1_enc.c head/crypto/openssl/ssl/t1_lib.c head/crypto/openssl/ssl/tls1.h head/crypto/openssl/util/libeay.num head/crypto/openssl/util/pl/BC-32.pl head/crypto/openssl/util/pl/VC-32.pl head/secure/lib/libcrypto/Makefile.inc head/secure/lib/libcrypto/amd64/vpaes-x86_64.S head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_length.3 head/secure/lib/libcrypto/man/ASN1_STRING_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 head/secure/lib/libcrypto/man/BIO_ctrl.3 head/secure/lib/libcrypto/man/BIO_f_base64.3 head/secure/lib/libcrypto/man/BIO_f_buffer.3 head/secure/lib/libcrypto/man/BIO_f_cipher.3 head/secure/lib/libcrypto/man/BIO_f_md.3 head/secure/lib/libcrypto/man/BIO_f_null.3 head/secure/lib/libcrypto/man/BIO_f_ssl.3 head/secure/lib/libcrypto/man/BIO_find_type.3 head/secure/lib/libcrypto/man/BIO_new.3 head/secure/lib/libcrypto/man/BIO_new_CMS.3 head/secure/lib/libcrypto/man/BIO_push.3 head/secure/lib/libcrypto/man/BIO_read.3 head/secure/lib/libcrypto/man/BIO_s_accept.3 head/secure/lib/libcrypto/man/BIO_s_bio.3 head/secure/lib/libcrypto/man/BIO_s_connect.3 head/secure/lib/libcrypto/man/BIO_s_fd.3 head/secure/lib/libcrypto/man/BIO_s_file.3 head/secure/lib/libcrypto/man/BIO_s_mem.3 head/secure/lib/libcrypto/man/BIO_s_null.3 head/secure/lib/libcrypto/man/BIO_s_socket.3 head/secure/lib/libcrypto/man/BIO_set_callback.3 head/secure/lib/libcrypto/man/BIO_should_retry.3 head/secure/lib/libcrypto/man/BN_BLINDING_new.3 head/secure/lib/libcrypto/man/BN_CTX_new.3 head/secure/lib/libcrypto/man/BN_CTX_start.3 head/secure/lib/libcrypto/man/BN_add.3 head/secure/lib/libcrypto/man/BN_add_word.3 head/secure/lib/libcrypto/man/BN_bn2bin.3 head/secure/lib/libcrypto/man/BN_cmp.3 head/secure/lib/libcrypto/man/BN_copy.3 head/secure/lib/libcrypto/man/BN_generate_prime.3 head/secure/lib/libcrypto/man/BN_mod_inverse.3 head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 head/secure/lib/libcrypto/man/BN_new.3 head/secure/lib/libcrypto/man/BN_num_bytes.3 head/secure/lib/libcrypto/man/BN_rand.3 head/secure/lib/libcrypto/man/BN_set_bit.3 head/secure/lib/libcrypto/man/BN_swap.3 head/secure/lib/libcrypto/man/BN_zero.3 head/secure/lib/libcrypto/man/CMS_add0_cert.3 head/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 head/secure/lib/libcrypto/man/CMS_compress.3 head/secure/lib/libcrypto/man/CMS_decrypt.3 head/secure/lib/libcrypto/man/CMS_encrypt.3 head/secure/lib/libcrypto/man/CMS_final.3 head/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 head/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 head/secure/lib/libcrypto/man/CMS_get0_type.3 head/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 head/secure/lib/libcrypto/man/CMS_sign.3 head/secure/lib/libcrypto/man/CMS_sign_add1_signer.3 head/secure/lib/libcrypto/man/CMS_sign_receipt.3 head/secure/lib/libcrypto/man/CMS_uncompress.3 head/secure/lib/libcrypto/man/CMS_verify.3 head/secure/lib/libcrypto/man/CMS_verify_receipt.3 head/secure/lib/libcrypto/man/CONF_modules_free.3 head/secure/lib/libcrypto/man/CONF_modules_load_file.3 head/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 head/secure/lib/libcrypto/man/DH_generate_key.3 head/secure/lib/libcrypto/man/DH_generate_parameters.3 head/secure/lib/libcrypto/man/DH_get_ex_new_index.3 head/secure/lib/libcrypto/man/DH_new.3 head/secure/lib/libcrypto/man/DH_set_method.3 head/secure/lib/libcrypto/man/DH_size.3 head/secure/lib/libcrypto/man/DSA_SIG_new.3 head/secure/lib/libcrypto/man/DSA_do_sign.3 head/secure/lib/libcrypto/man/DSA_dup_DH.3 head/secure/lib/libcrypto/man/DSA_generate_key.3 head/secure/lib/libcrypto/man/DSA_generate_parameters.3 head/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/DSA_new.3 head/secure/lib/libcrypto/man/DSA_set_method.3 head/secure/lib/libcrypto/man/DSA_sign.3 head/secure/lib/libcrypto/man/DSA_size.3 head/secure/lib/libcrypto/man/ERR_GET_LIB.3 head/secure/lib/libcrypto/man/ERR_clear_error.3 head/secure/lib/libcrypto/man/ERR_error_string.3 head/secure/lib/libcrypto/man/ERR_get_error.3 head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 head/secure/lib/libcrypto/man/ERR_load_strings.3 head/secure/lib/libcrypto/man/ERR_print_errors.3 head/secure/lib/libcrypto/man/ERR_put_error.3 head/secure/lib/libcrypto/man/ERR_remove_state.3 head/secure/lib/libcrypto/man/ERR_set_mark.3 head/secure/lib/libcrypto/man/EVP_BytesToKey.3 head/secure/lib/libcrypto/man/EVP_DigestInit.3 head/secure/lib/libcrypto/man/EVP_DigestSignInit.3 head/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 head/secure/lib/libcrypto/man/EVP_EncryptInit.3 head/secure/lib/libcrypto/man/EVP_OpenInit.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 head/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_derive.3 head/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 head/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 head/secure/lib/libcrypto/man/EVP_PKEY_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 head/secure/lib/libcrypto/man/EVP_PKEY_sign.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 head/secure/lib/libcrypto/man/EVP_SealInit.3 head/secure/lib/libcrypto/man/EVP_SignInit.3 head/secure/lib/libcrypto/man/EVP_VerifyInit.3 head/secure/lib/libcrypto/man/OBJ_nid2obj.3 head/secure/lib/libcrypto/man/OPENSSL_Applink.3 head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 head/secure/lib/libcrypto/man/OPENSSL_config.3 head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 head/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 head/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 head/secure/lib/libcrypto/man/PKCS12_create.3 head/secure/lib/libcrypto/man/PKCS12_parse.3 head/secure/lib/libcrypto/man/PKCS7_decrypt.3 head/secure/lib/libcrypto/man/PKCS7_encrypt.3 head/secure/lib/libcrypto/man/PKCS7_sign.3 head/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 head/secure/lib/libcrypto/man/PKCS7_verify.3 head/secure/lib/libcrypto/man/RAND_add.3 head/secure/lib/libcrypto/man/RAND_bytes.3 head/secure/lib/libcrypto/man/RAND_cleanup.3 head/secure/lib/libcrypto/man/RAND_egd.3 head/secure/lib/libcrypto/man/RAND_load_file.3 head/secure/lib/libcrypto/man/RAND_set_rand_method.3 head/secure/lib/libcrypto/man/RSA_blinding_on.3 head/secure/lib/libcrypto/man/RSA_check_key.3 head/secure/lib/libcrypto/man/RSA_generate_key.3 head/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/RSA_new.3 head/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 head/secure/lib/libcrypto/man/RSA_print.3 head/secure/lib/libcrypto/man/RSA_private_encrypt.3 head/secure/lib/libcrypto/man/RSA_public_encrypt.3 head/secure/lib/libcrypto/man/RSA_set_method.3 head/secure/lib/libcrypto/man/RSA_sign.3 head/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 head/secure/lib/libcrypto/man/RSA_size.3 head/secure/lib/libcrypto/man/SMIME_read_CMS.3 head/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 head/secure/lib/libcrypto/man/SMIME_write_CMS.3 head/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 head/secure/lib/libcrypto/man/X509_NAME_print_ex.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 head/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 head/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 head/secure/lib/libcrypto/man/X509_new.3 head/secure/lib/libcrypto/man/X509_verify_cert.3 head/secure/lib/libcrypto/man/bio.3 head/secure/lib/libcrypto/man/blowfish.3 head/secure/lib/libcrypto/man/bn.3 head/secure/lib/libcrypto/man/bn_internal.3 head/secure/lib/libcrypto/man/buffer.3 head/secure/lib/libcrypto/man/crypto.3 head/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 head/secure/lib/libcrypto/man/d2i_DHparams.3 head/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 head/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_X509.3 head/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 head/secure/lib/libcrypto/man/d2i_X509_CRL.3 head/secure/lib/libcrypto/man/d2i_X509_NAME.3 head/secure/lib/libcrypto/man/d2i_X509_REQ.3 head/secure/lib/libcrypto/man/d2i_X509_SIG.3 head/secure/lib/libcrypto/man/des.3 head/secure/lib/libcrypto/man/dh.3 head/secure/lib/libcrypto/man/dsa.3 head/secure/lib/libcrypto/man/ecdsa.3 head/secure/lib/libcrypto/man/engine.3 head/secure/lib/libcrypto/man/err.3 head/secure/lib/libcrypto/man/evp.3 head/secure/lib/libcrypto/man/hmac.3 head/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 head/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 head/secure/lib/libcrypto/man/lh_stats.3 head/secure/lib/libcrypto/man/lhash.3 head/secure/lib/libcrypto/man/md5.3 head/secure/lib/libcrypto/man/mdc2.3 head/secure/lib/libcrypto/man/pem.3 head/secure/lib/libcrypto/man/rand.3 head/secure/lib/libcrypto/man/rc4.3 head/secure/lib/libcrypto/man/ripemd.3 head/secure/lib/libcrypto/man/rsa.3 head/secure/lib/libcrypto/man/sha.3 head/secure/lib/libcrypto/man/threads.3 head/secure/lib/libcrypto/man/ui.3 head/secure/lib/libcrypto/man/ui_compat.3 head/secure/lib/libcrypto/man/x509.3 head/secure/lib/libssl/man/SSL_CIPHER_get_name.3 head/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 head/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 head/secure/lib/libssl/man/SSL_CTX_add_session.3 head/secure/lib/libssl/man/SSL_CTX_ctrl.3 head/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 head/secure/lib/libssl/man/SSL_CTX_free.3 head/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 head/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 head/secure/lib/libssl/man/SSL_CTX_new.3 head/secure/lib/libssl/man/SSL_CTX_sess_number.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 head/secure/lib/libssl/man/SSL_CTX_sessions.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 head/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 head/secure/lib/libssl/man/SSL_CTX_set_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_options.3 head/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 head/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 head/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 head/secure/lib/libssl/man/SSL_CTX_set_timeout.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_verify.3 head/secure/lib/libssl/man/SSL_CTX_use_certificate.3 head/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 head/secure/lib/libssl/man/SSL_SESSION_free.3 head/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_SESSION_get_time.3 head/secure/lib/libssl/man/SSL_accept.3 head/secure/lib/libssl/man/SSL_alert_type_string.3 head/secure/lib/libssl/man/SSL_clear.3 head/secure/lib/libssl/man/SSL_connect.3 head/secure/lib/libssl/man/SSL_do_handshake.3 head/secure/lib/libssl/man/SSL_free.3 head/secure/lib/libssl/man/SSL_get_SSL_CTX.3 head/secure/lib/libssl/man/SSL_get_ciphers.3 head/secure/lib/libssl/man/SSL_get_client_CA_list.3 head/secure/lib/libssl/man/SSL_get_current_cipher.3 head/secure/lib/libssl/man/SSL_get_default_timeout.3 head/secure/lib/libssl/man/SSL_get_error.3 head/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 head/secure/lib/libssl/man/SSL_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_get_fd.3 head/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 head/secure/lib/libssl/man/SSL_get_peer_certificate.3 head/secure/lib/libssl/man/SSL_get_psk_identity.3 head/secure/lib/libssl/man/SSL_get_rbio.3 head/secure/lib/libssl/man/SSL_get_session.3 head/secure/lib/libssl/man/SSL_get_verify_result.3 head/secure/lib/libssl/man/SSL_get_version.3 head/secure/lib/libssl/man/SSL_library_init.3 head/secure/lib/libssl/man/SSL_load_client_CA_file.3 head/secure/lib/libssl/man/SSL_new.3 head/secure/lib/libssl/man/SSL_pending.3 head/secure/lib/libssl/man/SSL_read.3 head/secure/lib/libssl/man/SSL_rstate_string.3 head/secure/lib/libssl/man/SSL_session_reused.3 head/secure/lib/libssl/man/SSL_set_bio.3 head/secure/lib/libssl/man/SSL_set_connect_state.3 head/secure/lib/libssl/man/SSL_set_fd.3 head/secure/lib/libssl/man/SSL_set_session.3 head/secure/lib/libssl/man/SSL_set_shutdown.3 head/secure/lib/libssl/man/SSL_set_verify_result.3 head/secure/lib/libssl/man/SSL_shutdown.3 head/secure/lib/libssl/man/SSL_state_string.3 head/secure/lib/libssl/man/SSL_want.3 head/secure/lib/libssl/man/SSL_write.3 head/secure/lib/libssl/man/d2i_SSL_SESSION.3 head/secure/lib/libssl/man/ssl.3 head/secure/usr.bin/openssl/man/CA.pl.1 head/secure/usr.bin/openssl/man/asn1parse.1 head/secure/usr.bin/openssl/man/ca.1 head/secure/usr.bin/openssl/man/ciphers.1 head/secure/usr.bin/openssl/man/cms.1 head/secure/usr.bin/openssl/man/crl.1 head/secure/usr.bin/openssl/man/crl2pkcs7.1 head/secure/usr.bin/openssl/man/dgst.1 head/secure/usr.bin/openssl/man/dhparam.1 head/secure/usr.bin/openssl/man/dsa.1 head/secure/usr.bin/openssl/man/dsaparam.1 head/secure/usr.bin/openssl/man/ec.1 head/secure/usr.bin/openssl/man/ecparam.1 head/secure/usr.bin/openssl/man/enc.1 head/secure/usr.bin/openssl/man/errstr.1 head/secure/usr.bin/openssl/man/gendsa.1 head/secure/usr.bin/openssl/man/genpkey.1 head/secure/usr.bin/openssl/man/genrsa.1 head/secure/usr.bin/openssl/man/nseq.1 head/secure/usr.bin/openssl/man/ocsp.1 head/secure/usr.bin/openssl/man/openssl.1 head/secure/usr.bin/openssl/man/passwd.1 head/secure/usr.bin/openssl/man/pkcs12.1 head/secure/usr.bin/openssl/man/pkcs7.1 head/secure/usr.bin/openssl/man/pkcs8.1 head/secure/usr.bin/openssl/man/pkey.1 head/secure/usr.bin/openssl/man/pkeyparam.1 head/secure/usr.bin/openssl/man/pkeyutl.1 head/secure/usr.bin/openssl/man/rand.1 head/secure/usr.bin/openssl/man/req.1 head/secure/usr.bin/openssl/man/rsa.1 head/secure/usr.bin/openssl/man/rsautl.1 head/secure/usr.bin/openssl/man/s_client.1 head/secure/usr.bin/openssl/man/s_server.1 head/secure/usr.bin/openssl/man/s_time.1 head/secure/usr.bin/openssl/man/sess_id.1 head/secure/usr.bin/openssl/man/smime.1 head/secure/usr.bin/openssl/man/speed.1 head/secure/usr.bin/openssl/man/spkac.1 head/secure/usr.bin/openssl/man/ts.1 head/secure/usr.bin/openssl/man/tsget.1 head/secure/usr.bin/openssl/man/verify.1 head/secure/usr.bin/openssl/man/version.1 head/secure/usr.bin/openssl/man/x509.1 head/secure/usr.bin/openssl/man/x509v3_config.1 Directory Properties: head/crypto/openssl/ (props changed) Modified: head/crypto/openssl/CHANGES ============================================================================== --- head/crypto/openssl/CHANGES Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/CHANGES Tue Apr 8 21:06:58 2014 (r264278) @@ -2,6 +2,35 @@ OpenSSL CHANGES _______________ + Changes between 1.0.1f and 1.0.1g [7 Apr 2014] + + *) A missing bounds check in the handling of the TLS heartbeat extension + can be used to reveal up to 64k of memory to a connected client or + server. + + Thanks for Neel Mehta of Google Security for discovering this bug and to + Adam Langley and Bodo Moeller for + preparing the fix (CVE-2014-0160) + [Adam Langley, Bodo Moeller] + + *) Fix for the attack described in the paper "Recovering OpenSSL + ECDSA Nonces Using the FLUSH+RELOAD Cache Side-channel Attack" + by Yuval Yarom and Naomi Benger. Details can be obtained from: + http://eprint.iacr.org/2014/140 + + Thanks to Yuval Yarom and Naomi Benger for discovering this + flaw and to Yuval Yarom for supplying a fix (CVE-2014-0076) + [Yuval Yarom and Naomi Benger] + + *) TLS pad extension: draft-agl-tls-padding-03 + + Workaround for the "TLS hang bug" (see FAQ and PR#2771): if the + TLS client Hello record length value would otherwise be > 255 and + less that 512 pad with a dummy extension containing zeroes so it + is at least 512 bytes long. + + [Adam Langley, Steve Henson] + Changes between 1.0.1e and 1.0.1f [6 Jan 2014] *) Fix for TLS record tampering bug. A carefully crafted invalid Modified: head/crypto/openssl/Configure ============================================================================== --- head/crypto/openssl/Configure Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/Configure Tue Apr 8 21:06:58 2014 (r264278) @@ -526,7 +526,7 @@ my %table=( # 'perl Configure VC-WIN32' with '-DUNICODE -D_UNICODE' "VC-WIN32","cl:-W3 -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32", # Unified CE target -"debug-VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32", +"debug-VC-WIN32","cl:-W3 -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32", "VC-CE","cl::::WINCE::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32", # Borland C++ 4.5 Modified: head/crypto/openssl/FAQ ============================================================================== --- head/crypto/openssl/FAQ Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/FAQ Tue Apr 8 21:06:58 2014 (r264278) @@ -768,6 +768,9 @@ openssl-security@openssl.org if you don' acknowledging receipt then resend or mail it directly to one of the more active team members (e.g. Steve). +Note that bugs only present in the openssl utility are not in general +considered to be security issues. + [PROG] ======================================================================== * Is OpenSSL thread-safe? Modified: head/crypto/openssl/Makefile ============================================================================== --- head/crypto/openssl/Makefile Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/Makefile Tue Apr 8 21:06:58 2014 (r264278) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.1f +VERSION=1.0.1g MAJOR=1 MINOR=0.1 SHLIB_VERSION_NUMBER=1.0.0 @@ -304,8 +304,8 @@ libcrypto$(SHLIB_EXT): libcrypto.a fips_ FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; \ export CC FIPSLD_CC FIPSLD_LIBCRYPTO; \ fi; \ - $(MAKE) -e SHLIBDIRS=crypto CC=$${CC:-$(CC)} build-shared; \ - touch -c fips_premain_dso$(EXE_EXT); \ + $(MAKE) -e SHLIBDIRS=crypto CC="$${CC:-$(CC)}" build-shared && \ + (touch -c fips_premain_dso$(EXE_EXT) || :); \ else \ echo "There's no support for shared libraries on this platform" >&2; \ exit 1; \ Modified: head/crypto/openssl/Makefile.org ============================================================================== --- head/crypto/openssl/Makefile.org Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/Makefile.org Tue Apr 8 21:06:58 2014 (r264278) @@ -302,8 +302,8 @@ libcrypto$(SHLIB_EXT): libcrypto.a fips_ FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; \ export CC FIPSLD_CC FIPSLD_LIBCRYPTO; \ fi; \ - $(MAKE) -e SHLIBDIRS=crypto CC=$${CC:-$(CC)} build-shared; \ - touch -c fips_premain_dso$(EXE_EXT); \ + $(MAKE) -e SHLIBDIRS=crypto CC="$${CC:-$(CC)}" build-shared && \ + (touch -c fips_premain_dso$(EXE_EXT) || :); \ else \ echo "There's no support for shared libraries on this platform" >&2; \ exit 1; \ Modified: head/crypto/openssl/NEWS ============================================================================== --- head/crypto/openssl/NEWS Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/NEWS Tue Apr 8 21:06:58 2014 (r264278) @@ -5,8 +5,15 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.1f and OpenSSL 1.0.1g [7 Apr 2014] + + o Fix for CVE-2014-0160 + o Add TLS padding extension workaround for broken servers. + o Fix for CVE-2014-0076 + Major changes between OpenSSL 1.0.1e and OpenSSL 1.0.1f [6 Jan 2014] + o Don't include gmt_unix_time in TLS server and client random values o Fix for TLS record tampering bug CVE-2013-4353 o Fix for TLS version checking bug CVE-2013-6449 o Fix for DTLS retransmission bug CVE-2013-6450 Modified: head/crypto/openssl/README ============================================================================== --- head/crypto/openssl/README Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/README Tue Apr 8 21:06:58 2014 (r264278) @@ -1,5 +1,5 @@ - OpenSSL 1.0.1f 6 Jan 2014 + OpenSSL 1.0.1g 7 Apr 2014 Copyright (c) 1998-2011 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: head/crypto/openssl/apps/apps.c ============================================================================== --- head/crypto/openssl/apps/apps.c Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/apps/apps.c Tue Apr 8 21:06:58 2014 (r264278) @@ -586,12 +586,12 @@ int password_callback(char *buf, int buf if (ok >= 0) ok = UI_add_input_string(ui,prompt,ui_flags,buf, - PW_MIN_LENGTH,BUFSIZ-1); + PW_MIN_LENGTH,bufsiz-1); if (ok >= 0 && verify) { buff = (char *)OPENSSL_malloc(bufsiz); ok = UI_add_verify_string(ui,prompt,ui_flags,buff, - PW_MIN_LENGTH,BUFSIZ-1, buf); + PW_MIN_LENGTH,bufsiz-1, buf); } if (ok >= 0) do @@ -2841,7 +2841,7 @@ double app_tminterval(int stop,int usert if (proc==NULL) { - if (GetVersion() < 0x80000000) + if (check_winnt()) proc = OpenProcess(PROCESS_QUERY_INFORMATION,FALSE, GetCurrentProcessId()); if (proc==NULL) proc = (HANDLE)-1; Modified: head/crypto/openssl/apps/crl.c ============================================================================== --- head/crypto/openssl/apps/crl.c Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/apps/crl.c Tue Apr 8 21:06:58 2014 (r264278) @@ -81,6 +81,9 @@ static const char *crl_usage[]={ " -in arg - input file - default stdin\n", " -out arg - output file - default stdout\n", " -hash - print hash value\n", +#ifndef OPENSSL_NO_MD5 +" -hash_old - print old-style (MD5) hash value\n", +#endif " -fingerprint - print the crl fingerprint\n", " -issuer - print issuer DN\n", " -lastupdate - lastUpdate field\n", @@ -108,6 +111,9 @@ int MAIN(int argc, char **argv) int informat,outformat; char *infile=NULL,*outfile=NULL; int hash=0,issuer=0,lastupdate=0,nextupdate=0,noout=0,text=0; +#ifndef OPENSSL_NO_MD5 + int hash_old=0; +#endif int fingerprint = 0, crlnumber = 0; const char **pp; X509_STORE *store = NULL; @@ -192,6 +198,10 @@ int MAIN(int argc, char **argv) text = 1; else if (strcmp(*argv,"-hash") == 0) hash= ++num; +#ifndef OPENSSL_NO_MD5 + else if (strcmp(*argv,"-hash_old") == 0) + hash_old= ++num; +#endif else if (strcmp(*argv,"-nameopt") == 0) { if (--argc < 1) goto bad; @@ -304,6 +314,14 @@ bad: BIO_printf(bio_out,"%08lx\n", X509_NAME_hash(X509_CRL_get_issuer(x))); } +#ifndef OPENSSL_NO_MD5 + if (hash_old == i) + { + BIO_printf(bio_out,"%08lx\n", + X509_NAME_hash_old( + X509_CRL_get_issuer(x))); + } +#endif if (lastupdate == i) { BIO_printf(bio_out,"lastUpdate="); Modified: head/crypto/openssl/apps/dgst.c ============================================================================== --- head/crypto/openssl/apps/dgst.c Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/apps/dgst.c Tue Apr 8 21:06:58 2014 (r264278) @@ -427,9 +427,9 @@ int MAIN(int argc, char **argv) goto end; } if (do_verify) - r = EVP_DigestVerifyInit(mctx, &pctx, md, e, sigkey); + r = EVP_DigestVerifyInit(mctx, &pctx, md, NULL, sigkey); else - r = EVP_DigestSignInit(mctx, &pctx, md, e, sigkey); + r = EVP_DigestSignInit(mctx, &pctx, md, NULL, sigkey); if (!r) { BIO_printf(bio_err, "Error setting context\n"); Modified: head/crypto/openssl/apps/ecparam.c ============================================================================== --- head/crypto/openssl/apps/ecparam.c Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/apps/ecparam.c Tue Apr 8 21:06:58 2014 (r264278) @@ -105,7 +105,7 @@ * in the asn1 der encoding * possible values: named_curve (default) * explicit - * -no_seed - if 'explicit' parameters are choosen do not use the seed + * -no_seed - if 'explicit' parameters are chosen do not use the seed * -genkey - generate ec key * -rand file - files to use for random number input * -engine e - use engine e, possibly a hardware device @@ -286,7 +286,7 @@ bad: BIO_printf(bio_err, " " " explicit\n"); BIO_printf(bio_err, " -no_seed if 'explicit'" - " parameters are choosen do not" + " parameters are chosen do not" " use the seed\n"); BIO_printf(bio_err, " -genkey generate ec" " key\n"); Modified: head/crypto/openssl/apps/req.c ============================================================================== --- head/crypto/openssl/apps/req.c Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/apps/req.c Tue Apr 8 21:06:58 2014 (r264278) @@ -644,6 +644,11 @@ bad: if (inrand) app_RAND_load_files(inrand); + if (!NCONF_get_number(req_conf,SECTION,BITS, &newkey)) + { + newkey=DEFAULT_KEY_LENGTH; + } + if (keyalg) { genctx = set_keygen_ctx(bio_err, keyalg, &pkey_type, &newkey, @@ -652,12 +657,6 @@ bad: goto end; } - if (newkey <= 0) - { - if (!NCONF_get_number(req_conf,SECTION,BITS, &newkey)) - newkey=DEFAULT_KEY_LENGTH; - } - if (newkey < MIN_KEY_LENGTH && (pkey_type == EVP_PKEY_RSA || pkey_type == EVP_PKEY_DSA)) { BIO_printf(bio_err,"private key length is too short,\n"); @@ -1649,6 +1648,8 @@ static EVP_PKEY_CTX *set_keygen_ctx(BIO keylen = atol(p + 1); *pkeylen = keylen; } + else + keylen = *pkeylen; } else if (p) paramfile = p + 1; Modified: head/crypto/openssl/crypto/aes/asm/vpaes-x86_64.pl ============================================================================== --- head/crypto/openssl/crypto/aes/asm/vpaes-x86_64.pl Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/crypto/aes/asm/vpaes-x86_64.pl Tue Apr 8 21:06:58 2014 (r264278) @@ -1060,7 +1060,7 @@ _vpaes_consts: .Lk_dsbo: # decryption sbox final output .quad 0x1387EA537EF94000, 0xC7AA6DB9D4943E2D .quad 0x12D7560F93441D00, 0xCA4B8159D8C58E9C -.asciz "Vector Permutaion AES for x86_64/SSSE3, Mike Hamburg (Stanford University)" +.asciz "Vector Permutation AES for x86_64/SSSE3, Mike Hamburg (Stanford University)" .align 64 .size _vpaes_consts,.-_vpaes_consts ___ Modified: head/crypto/openssl/crypto/asn1/asn1_err.c ============================================================================== --- head/crypto/openssl/crypto/asn1/asn1_err.c Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/crypto/asn1/asn1_err.c Tue Apr 8 21:06:58 2014 (r264278) @@ -305,7 +305,7 @@ static ERR_STRING_DATA ASN1_str_reasons[ {ERR_REASON(ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE),"unknown public key type"}, {ERR_REASON(ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM),"unknown signature algorithm"}, {ERR_REASON(ASN1_R_UNKNOWN_TAG) ,"unknown tag"}, -{ERR_REASON(ASN1_R_UNKOWN_FORMAT) ,"unkown format"}, +{ERR_REASON(ASN1_R_UNKOWN_FORMAT) ,"unknown format"}, {ERR_REASON(ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE),"unsupported any defined by type"}, {ERR_REASON(ASN1_R_UNSUPPORTED_CIPHER) ,"unsupported cipher"}, {ERR_REASON(ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM),"unsupported encryption algorithm"}, Modified: head/crypto/openssl/crypto/bio/bss_log.c ============================================================================== --- head/crypto/openssl/crypto/bio/bss_log.c Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/crypto/bio/bss_log.c Tue Apr 8 21:06:58 2014 (r264278) @@ -245,7 +245,7 @@ static int MS_CALLBACK slg_puts(BIO *bp, static void xopenlog(BIO* bp, char* name, int level) { - if (GetVersion() < 0x80000000) + if (check_winnt()) bp->ptr = RegisterEventSourceA(NULL,name); else bp->ptr = NULL; Modified: head/crypto/openssl/crypto/cms/cms_lib.c ============================================================================== --- head/crypto/openssl/crypto/cms/cms_lib.c Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/crypto/cms/cms_lib.c Tue Apr 8 21:06:58 2014 (r264278) @@ -465,8 +465,6 @@ int CMS_add0_cert(CMS_ContentInfo *cms, pcerts = cms_get0_certificate_choices(cms); if (!pcerts) return 0; - if (!pcerts) - return 0; for (i = 0; i < sk_CMS_CertificateChoices_num(*pcerts); i++) { cch = sk_CMS_CertificateChoices_value(*pcerts, i); Modified: head/crypto/openssl/crypto/cryptlib.c ============================================================================== --- head/crypto/openssl/crypto/cryptlib.c Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/crypto/cryptlib.c Tue Apr 8 21:06:58 2014 (r264278) @@ -889,7 +889,7 @@ void OPENSSL_showfatal (const char *fmta #if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333 /* this -------------v--- guards NT-specific calls */ - if (GetVersion() < 0x80000000 && OPENSSL_isservice() > 0) + if (check_winnt() && OPENSSL_isservice() > 0) { HANDLE h = RegisterEventSource(0,_T("OPENSSL")); const TCHAR *pmsg=buf; ReportEvent(h,EVENTLOG_ERROR_TYPE,0,0,0,1,0,&pmsg,0); Modified: head/crypto/openssl/crypto/engine/eng_list.c ============================================================================== --- head/crypto/openssl/crypto/engine/eng_list.c Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/crypto/engine/eng_list.c Tue Apr 8 21:06:58 2014 (r264278) @@ -408,6 +408,7 @@ ENGINE *ENGINE_by_id(const char *id) !ENGINE_ctrl_cmd_string(iterator, "DIR_LOAD", "2", 0) || !ENGINE_ctrl_cmd_string(iterator, "DIR_ADD", load_dir, 0) || + !ENGINE_ctrl_cmd_string(iterator, "LIST_ADD", "1", 0) || !ENGINE_ctrl_cmd_string(iterator, "LOAD", NULL, 0)) goto notfound; return iterator; Modified: head/crypto/openssl/crypto/evp/bio_b64.c ============================================================================== --- head/crypto/openssl/crypto/evp/bio_b64.c Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/crypto/evp/bio_b64.c Tue Apr 8 21:06:58 2014 (r264278) @@ -264,7 +264,7 @@ static int b64_read(BIO *b, char *out, i } /* we fell off the end without starting */ - if (j == i) + if ((j == i) && (num == 0)) { /* Is this is one long chunk?, if so, keep on * reading until a new line. */ Modified: head/crypto/openssl/crypto/modes/gcm128.c ============================================================================== --- head/crypto/openssl/crypto/modes/gcm128.c Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/crypto/modes/gcm128.c Tue Apr 8 21:06:58 2014 (r264278) @@ -810,7 +810,11 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT GCM_MUL(ctx,Yi); if (is_endian.little) +#ifdef BSWAP4 + ctr = BSWAP4(ctx->Yi.d[3]); +#else ctr = GETU32(ctx->Yi.c+12); +#endif else ctr = ctx->Yi.d[3]; } @@ -818,7 +822,11 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT (*ctx->block)(ctx->Yi.c,ctx->EK0.c,ctx->key); ++ctr; if (is_endian.little) +#ifdef BSWAP4 + ctx->Yi.d[3] = BSWAP4(ctr); +#else PUTU32(ctx->Yi.c+12,ctr); +#endif else ctx->Yi.d[3] = ctr; } @@ -913,7 +921,11 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT } if (is_endian.little) +#ifdef BSWAP4 + ctr = BSWAP4(ctx->Yi.d[3]); +#else ctr = GETU32(ctx->Yi.c+12); +#endif else ctr = ctx->Yi.d[3]; @@ -947,7 +959,11 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; if (is_endian.little) +#ifdef BSWAP4 + ctx->Yi.d[3] = BSWAP4(ctr); +#else PUTU32(ctx->Yi.c+12,ctr); +#endif else ctx->Yi.d[3] = ctr; for (i=0; i<16/sizeof(size_t); ++i) @@ -969,7 +985,11 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; if (is_endian.little) +#ifdef BSWAP4 + ctx->Yi.d[3] = BSWAP4(ctr); +#else PUTU32(ctx->Yi.c+12,ctr); +#endif else ctx->Yi.d[3] = ctr; for (i=0; i<16/sizeof(size_t); ++i) @@ -988,7 +1008,11 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; if (is_endian.little) +#ifdef BSWAP4 + ctx->Yi.d[3] = BSWAP4(ctr); +#else PUTU32(ctx->Yi.c+12,ctr); +#endif else ctx->Yi.d[3] = ctr; for (i=0; i<16/sizeof(size_t); ++i) @@ -1004,7 +1028,11 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; if (is_endian.little) +#ifdef BSWAP4 + ctx->Yi.d[3] = BSWAP4(ctr); +#else PUTU32(ctx->Yi.c+12,ctr); +#endif else ctx->Yi.d[3] = ctr; while (len--) { @@ -1022,7 +1050,11 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; if (is_endian.little) +#ifdef BSWAP4 + ctx->Yi.d[3] = BSWAP4(ctr); +#else PUTU32(ctx->Yi.c+12,ctr); +#endif else ctx->Yi.d[3] = ctr; } @@ -1066,7 +1098,11 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT } if (is_endian.little) +#ifdef BSWAP4 + ctr = BSWAP4(ctx->Yi.d[3]); +#else ctr = GETU32(ctx->Yi.c+12); +#endif else ctr = ctx->Yi.d[3]; @@ -1103,7 +1139,11 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; if (is_endian.little) +#ifdef BSWAP4 + ctx->Yi.d[3] = BSWAP4(ctr); +#else PUTU32(ctx->Yi.c+12,ctr); +#endif else ctx->Yi.d[3] = ctr; for (i=0; i<16/sizeof(size_t); ++i) @@ -1123,7 +1163,11 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; if (is_endian.little) +#ifdef BSWAP4 + ctx->Yi.d[3] = BSWAP4(ctr); +#else PUTU32(ctx->Yi.c+12,ctr); +#endif else ctx->Yi.d[3] = ctr; for (i=0; i<16/sizeof(size_t); ++i) @@ -1141,7 +1185,11 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; if (is_endian.little) +#ifdef BSWAP4 + ctx->Yi.d[3] = BSWAP4(ctr); +#else PUTU32(ctx->Yi.c+12,ctr); +#endif else ctx->Yi.d[3] = ctr; for (i=0; i<16/sizeof(size_t); ++i) { @@ -1159,7 +1207,11 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; if (is_endian.little) +#ifdef BSWAP4 + ctx->Yi.d[3] = BSWAP4(ctr); +#else PUTU32(ctx->Yi.c+12,ctr); +#endif else ctx->Yi.d[3] = ctr; while (len--) { @@ -1180,7 +1232,11 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; if (is_endian.little) +#ifdef BSWAP4 + ctx->Yi.d[3] = BSWAP4(ctr); +#else PUTU32(ctx->Yi.c+12,ctr); +#endif else ctx->Yi.d[3] = ctr; } @@ -1225,7 +1281,11 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_C } if (is_endian.little) +#ifdef BSWAP4 + ctr = BSWAP4(ctx->Yi.d[3]); +#else ctr = GETU32(ctx->Yi.c+12); +#endif else ctr = ctx->Yi.d[3]; @@ -1247,7 +1307,11 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_C (*stream)(in,out,GHASH_CHUNK/16,key,ctx->Yi.c); ctr += GHASH_CHUNK/16; if (is_endian.little) +#ifdef BSWAP4 + ctx->Yi.d[3] = BSWAP4(ctr); +#else PUTU32(ctx->Yi.c+12,ctr); +#endif else ctx->Yi.d[3] = ctr; GHASH(ctx,out,GHASH_CHUNK); @@ -1262,7 +1326,11 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_C (*stream)(in,out,j,key,ctx->Yi.c); ctr += (unsigned int)j; if (is_endian.little) +#ifdef BSWAP4 + ctx->Yi.d[3] = BSWAP4(ctr); +#else PUTU32(ctx->Yi.c+12,ctr); +#endif else ctx->Yi.d[3] = ctr; in += i; @@ -1282,7 +1350,11 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_C (*ctx->block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; if (is_endian.little) +#ifdef BSWAP4 + ctx->Yi.d[3] = BSWAP4(ctr); +#else PUTU32(ctx->Yi.c+12,ctr); +#endif else ctx->Yi.d[3] = ctr; while (len--) { @@ -1324,7 +1396,11 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_C } if (is_endian.little) +#ifdef BSWAP4 + ctr = BSWAP4(ctx->Yi.d[3]); +#else ctr = GETU32(ctx->Yi.c+12); +#endif else ctr = ctx->Yi.d[3]; @@ -1349,7 +1425,11 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_C (*stream)(in,out,GHASH_CHUNK/16,key,ctx->Yi.c); ctr += GHASH_CHUNK/16; if (is_endian.little) +#ifdef BSWAP4 + ctx->Yi.d[3] = BSWAP4(ctr); +#else PUTU32(ctx->Yi.c+12,ctr); +#endif else ctx->Yi.d[3] = ctr; out += GHASH_CHUNK; @@ -1375,7 +1455,11 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_C (*stream)(in,out,j,key,ctx->Yi.c); ctr += (unsigned int)j; if (is_endian.little) +#ifdef BSWAP4 + ctx->Yi.d[3] = BSWAP4(ctr); +#else PUTU32(ctx->Yi.c+12,ctr); +#endif else ctx->Yi.d[3] = ctr; out += i; @@ -1386,7 +1470,11 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_C (*ctx->block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; if (is_endian.little) +#ifdef BSWAP4 + ctx->Yi.d[3] = BSWAP4(ctr); +#else PUTU32(ctx->Yi.c+12,ctr); +#endif else ctx->Yi.d[3] = ctr; while (len--) { Modified: head/crypto/openssl/crypto/opensslv.h ============================================================================== --- head/crypto/openssl/crypto/opensslv.h Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/crypto/opensslv.h Tue Apr 8 21:06:58 2014 (r264278) @@ -25,11 +25,11 @@ * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -#define OPENSSL_VERSION_NUMBER 0x1000106fL +#define OPENSSL_VERSION_NUMBER 0x1000107fL #ifdef OPENSSL_FIPS -#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1f-fips 6 Jan 2014" +#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1g-fips 7 Apr 2014" #else -#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1f-freebsd 6 Jan 2014" +#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1g-freebsd 7 Apr 2014" #endif #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT Modified: head/crypto/openssl/crypto/rand/md_rand.c ============================================================================== --- head/crypto/openssl/crypto/rand/md_rand.c Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/crypto/rand/md_rand.c Tue Apr 8 21:06:58 2014 (r264278) @@ -198,6 +198,9 @@ static void ssleay_rand_add(const void * EVP_MD_CTX m; int do_not_lock; + if (!num) + return; + /* * (Based on the rand(3) manpage) * Modified: head/crypto/openssl/crypto/symhacks.h ============================================================================== --- head/crypto/openssl/crypto/symhacks.h Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/crypto/symhacks.h Tue Apr 8 21:06:58 2014 (r264278) @@ -204,6 +204,12 @@ #define SSL_CTX_set_next_protos_advertised_cb SSL_CTX_set_next_protos_adv_cb #undef SSL_CTX_set_next_proto_select_cb #define SSL_CTX_set_next_proto_select_cb SSL_CTX_set_next_proto_sel_cb +#undef ssl3_cbc_record_digest_supported +#define ssl3_cbc_record_digest_supported ssl3_cbc_record_digest_support +#undef ssl_check_clienthello_tlsext_late +#define ssl_check_clienthello_tlsext_late ssl_check_clihello_tlsext_late +#undef ssl_check_clienthello_tlsext_early +#define ssl_check_clienthello_tlsext_early ssl_check_clihello_tlsext_early /* Hack some long ENGINE names */ #undef ENGINE_get_default_BN_mod_exp_crt Modified: head/crypto/openssl/crypto/x509/by_dir.c ============================================================================== --- head/crypto/openssl/crypto/x509/by_dir.c Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/crypto/x509/by_dir.c Tue Apr 8 21:06:58 2014 (r264278) @@ -218,7 +218,7 @@ static int add_cert_dir(BY_DIR *ctx, con s=dir; p=s; - for (;;p++) + do { if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) { @@ -264,9 +264,7 @@ static int add_cert_dir(BY_DIR *ctx, con return 0; } } - if (*p == '\0') - break; - } + } while (*p++ != '\0'); return 1; } Modified: head/crypto/openssl/crypto/x509/x509_vfy.c ============================================================================== --- head/crypto/openssl/crypto/x509/x509_vfy.c Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/crypto/x509/x509_vfy.c Tue Apr 8 21:06:58 2014 (r264278) @@ -1462,10 +1462,9 @@ static int cert_crl(X509_STORE_CTX *ctx, * a certificate was revoked. This has since been changed since * critical extension can change the meaning of CRL entries. */ - if (crl->flags & EXFLAG_CRITICAL) + if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) + && (crl->flags & EXFLAG_CRITICAL)) { - if (ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) - return 1; ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION; ok = ctx->verify_cb(0, ctx); if(!ok) Modified: head/crypto/openssl/doc/apps/config.pod ============================================================================== --- head/crypto/openssl/doc/apps/config.pod Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/doc/apps/config.pod Tue Apr 8 21:06:58 2014 (r264278) @@ -119,7 +119,7 @@ variable points to a section containing information. The section pointed to by B is a table of engine names (though see -B below) and further sections containing configuration informations +B below) and further sections containing configuration information specific to each ENGINE. Each ENGINE specific section is used to set default algorithms, load Modified: head/crypto/openssl/doc/apps/crl.pod ============================================================================== --- head/crypto/openssl/doc/apps/crl.pod Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/doc/apps/crl.pod Tue Apr 8 21:06:58 2014 (r264278) @@ -62,6 +62,11 @@ don't output the encoded version of the output a hash of the issuer name. This can be use to lookup CRLs in a directory by issuer name. +=item B<-hash_old> + +outputs the "hash" of the CRL issuer name using the older algorithm +as used by OpenSSL versions before 1.0.0. + =item B<-issuer> output the issuer name. Modified: head/crypto/openssl/doc/apps/ec.pod ============================================================================== --- head/crypto/openssl/doc/apps/ec.pod Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/doc/apps/ec.pod Tue Apr 8 21:06:58 2014 (r264278) @@ -41,7 +41,7 @@ PKCS#8 private key format use the B option with a private key uses an ASN.1 DER encoded SEC1 private key. When used with a public key it -uses the SubjectPublicKeyInfo structur as specified in RFC 3280. +uses the SubjectPublicKeyInfo structure as specified in RFC 3280. The B form is the default format: it consists of the B format base64 encoded with additional header and footer lines. In the case of a private key PKCS#8 format is also accepted. Modified: head/crypto/openssl/doc/apps/pkcs12.pod ============================================================================== --- head/crypto/openssl/doc/apps/pkcs12.pod Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/doc/apps/pkcs12.pod Tue Apr 8 21:06:58 2014 (r264278) @@ -67,7 +67,7 @@ by default. The filename to write certificates and private keys to, standard output by default. They are all written in PEM format. -=item B<-pass arg>, B<-passin arg> +=item B<-passin arg> the PKCS#12 file (i.e. input file) password source. For more information about the format of B see the B section in @@ -75,10 +75,15 @@ L. =item B<-passout arg> -pass phrase source to encrypt any outputed private keys with. For more +pass phrase source to encrypt any outputted private keys with. For more information about the format of B see the B section in L. +=item B<-password arg> + +With -export, -password is equivalent to -passout. +Otherwise, -password is equivalent to -passin. + =item B<-noout> this option inhibits output of the keys and certificates to the output file Modified: head/crypto/openssl/doc/apps/req.pod ============================================================================== --- head/crypto/openssl/doc/apps/req.pod Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/doc/apps/req.pod Tue Apr 8 21:06:58 2014 (r264278) @@ -303,7 +303,7 @@ Reverses effect of B<-asn1-kludge> =item B<-newhdr> -Adds the word B to the PEM file header and footer lines on the outputed +Adds the word B to the PEM file header and footer lines on the outputted request. Some software (Netscape certificate server) and some CAs need this. =item B<-batch> Modified: head/crypto/openssl/doc/apps/s_client.pod ============================================================================== --- head/crypto/openssl/doc/apps/s_client.pod Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/doc/apps/s_client.pod Tue Apr 8 21:06:58 2014 (r264278) @@ -10,6 +10,7 @@ s_client - SSL/TLS client program B B [B<-connect host:port>] [B<-verify depth>] +[B<-verify_return_error>] [B<-cert filename>] [B<-certform DER|PEM>] [B<-key filename>] @@ -90,6 +91,11 @@ Currently the verify operation continues with a certificate chain can be seen. As a side effect the connection will never fail due to a server certificate verify failure. +=item B<-verify_return_error> + +Return verification errors instead of continuing. This will typically +abort the handshake with a fatal error. + =item B<-CApath directory> The directory to use for server certificate verification. This directory @@ -286,6 +292,13 @@ Since the SSLv23 client hello cannot inc these will only be supported if its use is disabled, for example by using the B<-no_sslv2> option. +The B utility is a test tool and is designed to continue the +handshake after any certificate verification errors. As a result it will +accept any certificate chain (trusted or not) sent by the peer. None test +applications should B do this as it makes them vulnerable to a MITM +attack. This behaviour can be changed by with the B<-verify_return_error> +option: any verify errors are then returned aborting the handshake. + =head1 BUGS Because this program has a lot of options and also because some of @@ -293,9 +306,6 @@ the techniques used are rather old, the hard to read and not a model of how things should be done. A typical SSL client program would be much simpler. -The B<-verify> option should really exit if the server verification -fails. - The B<-prexit> option is a bit of a hack. We should really report information whenever a session is renegotiated. Modified: head/crypto/openssl/doc/apps/s_server.pod ============================================================================== --- head/crypto/openssl/doc/apps/s_server.pod Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/doc/apps/s_server.pod Tue Apr 8 21:06:58 2014 (r264278) @@ -111,7 +111,7 @@ by using an appropriate certificate. =item B<-dcertform format>, B<-dkeyform format>, B<-dpass arg> -addtional certificate and private key format and passphrase respectively. +additional certificate and private key format and passphrase respectively. =item B<-nocert> Modified: head/crypto/openssl/doc/apps/ts.pod ============================================================================== --- head/crypto/openssl/doc/apps/ts.pod Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/doc/apps/ts.pod Tue Apr 8 21:06:58 2014 (r264278) @@ -352,7 +352,7 @@ switch always overrides the settings in This is the main section and it specifies the name of another section that contains all the options for the B<-reply> command. This default -section can be overriden with the B<-section> command line switch. (Optional) +section can be overridden with the B<-section> command line switch. (Optional) =item B @@ -453,7 +453,7 @@ included. Default is no. (Optional) =head1 ENVIRONMENT VARIABLES B contains the path of the configuration file and can be -overriden by the B<-config> command line option. +overridden by the B<-config> command line option. =head1 EXAMPLES Modified: head/crypto/openssl/doc/apps/tsget.pod ============================================================================== --- head/crypto/openssl/doc/apps/tsget.pod Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/doc/apps/tsget.pod Tue Apr 8 21:06:58 2014 (r264278) @@ -124,7 +124,7 @@ The name of an EGD socket to get random =item [request]... List of files containing B DER-encoded time stamp requests. If no -requests are specifed only one request will be sent to the server and it will be +requests are specified only one request will be sent to the server and it will be read from the standard input. (Optional) =back Modified: head/crypto/openssl/doc/crypto/BN_BLINDING_new.pod ============================================================================== --- head/crypto/openssl/doc/crypto/BN_BLINDING_new.pod Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/doc/crypto/BN_BLINDING_new.pod Tue Apr 8 21:06:58 2014 (r264278) @@ -48,7 +48,7 @@ necessary parameters are set, by re-crea BN_BLINDING_convert_ex() multiplies B with the blinding factor B. If B is not NULL a copy the inverse blinding factor B will be -returned in B (this is useful if a B object is shared amoung +returned in B (this is useful if a B object is shared among several threads). BN_BLINDING_invert_ex() multiplies B with the inverse blinding factor B. If B is not NULL it will be used as the inverse blinding. Modified: head/crypto/openssl/doc/crypto/ERR_get_error.pod ============================================================================== --- head/crypto/openssl/doc/crypto/ERR_get_error.pod Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/doc/crypto/ERR_get_error.pod Tue Apr 8 21:06:58 2014 (r264278) @@ -52,8 +52,11 @@ ERR_get_error_line_data(), ERR_peek_erro ERR_get_last_error_line_data() store additional data and flags associated with the error code in *B and *B, unless these are B. *B contains a string -if *B&B. If it has been allocated by OPENSSL_malloc(), -*B&B is true. +if *B&B is true. + +An application B free the *B pointer (or any other pointers +returned by these functions) with OPENSSL_free() as freeing is handled +automatically by the error library. =head1 RETURN VALUES Modified: head/crypto/openssl/doc/crypto/EVP_BytesToKey.pod ============================================================================== --- head/crypto/openssl/doc/crypto/EVP_BytesToKey.pod Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/doc/crypto/EVP_BytesToKey.pod Tue Apr 8 21:06:58 2014 (r264278) @@ -17,7 +17,7 @@ EVP_BytesToKey - password based encrypti EVP_BytesToKey() derives a key and IV from various parameters. B is the cipher to derive the key and IV for. B is the message digest to use. -The B paramter is used as a salt in the derivation: it should point to +The B parameter is used as a salt in the derivation: it should point to an 8 byte buffer or NULL if no salt is used. B is a buffer containing B bytes which is used to derive the keying data. B is the iteration count to use. The derived key and IV will be written to B Modified: head/crypto/openssl/doc/crypto/EVP_EncryptInit.pod ============================================================================== --- head/crypto/openssl/doc/crypto/EVP_EncryptInit.pod Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/doc/crypto/EVP_EncryptInit.pod Tue Apr 8 21:06:58 2014 (r264278) @@ -152,7 +152,7 @@ does not remain in memory. EVP_EncryptInit(), EVP_DecryptInit() and EVP_CipherInit() behave in a similar way to EVP_EncryptInit_ex(), EVP_DecryptInit_ex and -EVP_CipherInit_ex() except the B paramter does not need to be +EVP_CipherInit_ex() except the B parameter does not need to be initialized and they always use the default cipher implementation. EVP_EncryptFinal(), EVP_DecryptFinal() and EVP_CipherFinal() behave in a Modified: head/crypto/openssl/doc/crypto/X509_VERIFY_PARAM_set_flags.pod ============================================================================== --- head/crypto/openssl/doc/crypto/X509_VERIFY_PARAM_set_flags.pod Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/doc/crypto/X509_VERIFY_PARAM_set_flags.pod Tue Apr 8 21:06:58 2014 (r264278) @@ -113,7 +113,7 @@ a special status code is set to the veri to examine the valid policy tree and perform additional checks or simply log it for debugging purposes. -By default some addtional features such as indirect CRLs and CRLs signed by +By default some additional features such as indirect CRLs and CRLs signed by different keys are disabled. If B is set they are enabled. Modified: head/crypto/openssl/doc/crypto/pem.pod ============================================================================== --- head/crypto/openssl/doc/crypto/pem.pod Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/doc/crypto/pem.pod Tue Apr 8 21:06:58 2014 (r264278) @@ -201,7 +201,7 @@ handle PKCS#8 format encrypted and unenc PEM_write_bio_PKCS8PrivateKey() and PEM_write_PKCS8PrivateKey() write a private key in an EVP_PKEY structure in PKCS#8 EncryptedPrivateKeyInfo format using PKCS#5 v2.0 password based encryption -algorithms. The B argument specifies the encryption algoritm to +algorithms. The B argument specifies the encryption algorithm to use: unlike all other PEM routines the encryption is applied at the PKCS#8 level and not in the PEM headers. If B is NULL then no encryption is used and a PKCS#8 PrivateKeyInfo structure is used instead. Modified: head/crypto/openssl/doc/ssl/SSL_CTX_set_verify.pod ============================================================================== --- head/crypto/openssl/doc/ssl/SSL_CTX_set_verify.pod Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/doc/ssl/SSL_CTX_set_verify.pod Tue Apr 8 21:06:58 2014 (r264278) @@ -169,8 +169,8 @@ that will always continue the TLS/SSL ha failure, if wished. The callback realizes a verification depth limit with more informational output. -All verification errors are printed, informations about the certificate chain -are printed on request. +All verification errors are printed; information about the certificate chain +is printed on request. The example is realized for a server that does allow but not require client certificates. Modified: head/crypto/openssl/doc/ssl/SSL_set_shutdown.pod ============================================================================== --- head/crypto/openssl/doc/ssl/SSL_set_shutdown.pod Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/doc/ssl/SSL_set_shutdown.pod Tue Apr 8 21:06:58 2014 (r264278) @@ -24,7 +24,7 @@ The shutdown state of an ssl connection =over 4 -=item 0 +=item Z<>0 No shutdown setting, yet. Modified: head/crypto/openssl/e_os.h ============================================================================== --- head/crypto/openssl/e_os.h Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/e_os.h Tue Apr 8 21:06:58 2014 (r264278) @@ -368,6 +368,13 @@ static unsigned int _strlen31(const char # define DEFAULT_HOME "C:" # endif +/* Avoid Windows 8 SDK GetVersion deprecated problems */ +#if defined(_MSC_VER) && _MSC_VER>=1800 +# define check_winnt() (1) +#else +# define check_winnt() (GetVersion() < 0x80000000) +#endif + #else /* The non-microsoft world */ # ifdef OPENSSL_SYS_VMS Modified: head/crypto/openssl/engines/ccgost/gosthash.c ============================================================================== --- head/crypto/openssl/engines/ccgost/gosthash.c Tue Apr 8 21:02:03 2014 (r264277) +++ head/crypto/openssl/engines/ccgost/gosthash.c Tue Apr 8 21:06:58 2014 (r264278) @@ -180,8 +180,6 @@ int start_hash(gost_hash_ctx *ctx) */ int hash_block(gost_hash_ctx *ctx,const byte *block, size_t length) { - const byte *curptr=block; - const byte *barrier=block+(length-32);/* Last byte we can safely hash*/ if (ctx->left) { /*There are some bytes from previous step*/ @@ -196,24 +194,25 @@ int hash_block(gost_hash_ctx *ctx,const { return 1; } - curptr=block+add_bytes; + block+=add_bytes; + length-=add_bytes; hash_step(ctx->cipher_ctx,ctx->H,ctx->remainder); add_blocks(32,ctx->S,ctx->remainder); ctx->len+=32; ctx->left=0; } - while (curptr<=barrier) + while (length>=32) { - hash_step(ctx->cipher_ctx,ctx->H,curptr); + hash_step(ctx->cipher_ctx,ctx->H,block); - add_blocks(32,ctx->S,curptr); + add_blocks(32,ctx->S,block); ctx->len+=32; - curptr+=32; + block+=32; + length-=32; } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 21:30:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3543B2D3; Tue, 8 Apr 2014 21:30:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 225641780; Tue, 8 Apr 2014 21:30:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38LUAbY024584; Tue, 8 Apr 2014 21:30:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38LUAHd024582; Tue, 8 Apr 2014 21:30:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404082130.s38LUAHd024582@svn.freebsd.org> From: Alexander Motin Date: Tue, 8 Apr 2014 21:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264279 - in head/sys/cam: ctl scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 21:30:11 -0000 Author: mav Date: Tue Apr 8 21:30:10 2014 New Revision: 264279 URL: http://svnweb.freebsd.org/changeset/base/264279 Log: Oops! Few quick fixes for r264274. Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_ramdisk.c Tue Apr 8 21:06:58 2014 (r264278) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Tue Apr 8 21:30:10 2014 (r264279) @@ -546,6 +546,7 @@ ctl_backend_ramdisk_create(struct ctl_be be_lun->softc = softc; + unmap = 0; for (i = 0; i < req->num_be_args; i++) { if (strcmp(req->kern_be_args[i].kname, "unmap") == 0 && strcmp(req->kern_be_args[i].kvalue, "on") == 0) { @@ -565,7 +566,7 @@ ctl_backend_ramdisk_create(struct ctl_be be_lun->flags = CTL_BE_RAMDISK_LUN_UNCONFIGURED; be_lun->ctl_be_lun.flags = CTL_LUN_FLAG_PRIMARY; if (unmap) - be_lun->ctl_be_lun.flags = CTL_LUN_FLAG_UNMAP; + be_lun->ctl_be_lun.flags |= CTL_LUN_FLAG_UNMAP; be_lun->ctl_be_lun.be_lun = be_lun; if (params->flags & CTL_LUN_FLAG_ID_REQ) { Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Tue Apr 8 21:06:58 2014 (r264278) +++ head/sys/cam/scsi/scsi_all.h Tue Apr 8 21:30:10 2014 (r264279) @@ -858,7 +858,7 @@ struct scsi_unmap_header { uint8_t length[2]; uint8_t desc_length[2]; - uint8_t reserved[8]; + uint8_t reserved[4]; }; struct scsi_unmap_desc From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 21:39:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21F2D4C8; Tue, 8 Apr 2014 21:39:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7BA51861; Tue, 8 Apr 2014 21:39:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38LdqZ8028539; Tue, 8 Apr 2014 21:39:52 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38LdqbY028535; Tue, 8 Apr 2014 21:39:52 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201404082139.s38LdqbY028535@svn.freebsd.org> From: Sean Bruno Date: Tue, 8 Apr 2014 21:39:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264280 - in head/sys: conf modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 21:39:53 -0000 Author: sbruno Date: Tue Apr 8 21:39:51 2014 New Revision: 264280 URL: http://svnweb.freebsd.org/changeset/base/264280 Log: Actually, since this is what I thought I was doing, only allow the binmisc code to be build on amd64/i386 for the kernel. Update NOTES with some indication of what this code is used for. Pointed out by jhb@ ... thanks! Submitted by: jhb@ Modified: head/sys/conf/NOTES head/sys/conf/options.amd64 head/sys/conf/options.i386 head/sys/modules/Makefile Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Apr 8 21:30:10 2014 (r264279) +++ head/sys/conf/NOTES Tue Apr 8 21:39:51 2014 (r264280) @@ -2963,3 +2963,6 @@ options RANDOM_YARROW # Yarrow RNG ##options RANDOM_FORTUNA # Fortuna RNG - not yet implemented options RANDOM_DEBUG # Debugging messages options RANDOM_RWFILE # Read and write entropy cache + +# Module to enable execution of application via emulators like QEMU +options IMAGACT_BINMISC Modified: head/sys/conf/options.amd64 ============================================================================== --- head/sys/conf/options.amd64 Tue Apr 8 21:30:10 2014 (r264279) +++ head/sys/conf/options.amd64 Tue Apr 8 21:39:51 2014 (r264280) @@ -21,6 +21,7 @@ COMPAT_FREEBSD32 opt_compat.h COMPAT_LINUX32 opt_compat.h #COMPAT_SVR4 opt_dontuse.h #DEBUG_SVR4 opt_svr4.h +IMAGACT_BINMISC opt_dontuse.h LINPROCFS opt_dontuse.h LINSYSFS opt_dontuse.h NDISAPI opt_dontuse.h Modified: head/sys/conf/options.i386 ============================================================================== --- head/sys/conf/options.i386 Tue Apr 8 21:30:10 2014 (r264279) +++ head/sys/conf/options.i386 Tue Apr 8 21:39:51 2014 (r264280) @@ -26,6 +26,7 @@ IBCS2 opt_dontuse.h COMPAT_LINUX opt_dontuse.h COMPAT_SVR4 opt_dontuse.h DEBUG_SVR4 opt_svr4.h +IMAGACT_BINMISC opt_binmisc.h LINPROCFS opt_dontuse.h LINSYSFS opt_dontuse.h NDISAPI opt_dontuse.h Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Apr 8 21:30:10 2014 (r264279) +++ head/sys/modules/Makefile Tue Apr 8 21:39:51 2014 (r264280) @@ -148,7 +148,7 @@ SUBDIR= \ if_vlan \ ${_igb} \ ${_iir} \ - imgact_binmisc \ + ${_imgact_binmisc} \ ${_io} \ ${_ipoib} \ ${_ipdivert} \ @@ -372,6 +372,7 @@ SUBDIR= \ .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" _filemon= filemon +_imagact_binmisc= imgact_binmisc _vmware= vmware .endif From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 21:58:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 113FDC60; Tue, 8 Apr 2014 21:58:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F22E71A26; Tue, 8 Apr 2014 21:58:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38Lw4aF036578; Tue, 8 Apr 2014 21:58:04 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38Lw4RR036577; Tue, 8 Apr 2014 21:58:04 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404082158.s38Lw4RR036577@svn.freebsd.org> From: Warner Losh Date: Tue, 8 Apr 2014 21:58:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264281 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 21:58:05 -0000 Author: imp Date: Tue Apr 8 21:58:04 2014 New Revision: 264281 URL: http://svnweb.freebsd.org/changeset/base/264281 Log: Also ignore files from Murcirial (.hg) and git (.git) when copying file trees. Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Tue Apr 8 21:39:51 2014 (r264280) +++ head/tools/tools/nanobsd/nanobsd.sh Tue Apr 8 21:58:04 2014 (r264281) @@ -436,7 +436,7 @@ populate_slice ( ) ( if [ -n "${dir}" -a -d "${dir}" ]; then echo "Populating ${lbl} from ${dir}" cd ${dir} - find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt} + find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -dumpv ${mnt} fi df -i ${mnt} umount ${mnt} @@ -705,7 +705,7 @@ cust_allow_ssh_root () ( cust_install_files () ( cd ${NANO_TOOLS}/Files - find . -print | grep -Ev '/(CVS|\.svn)' | cpio -Ldumpv ${NANO_WORLDDIR} + find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -Ldumpv ${NANO_WORLDDIR} ) ####################################################################### From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 22:01:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B97EDF5; Tue, 8 Apr 2014 22:01:56 +0000 (UTC) Received: from mail.ignoranthack.me (ujvl.x.rootbsd.net [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24E321AB9; Tue, 8 Apr 2014 22:01:55 +0000 (UTC) Received: from [10.73.160.242] (nat-dip7.cfw-a-gci.corp.yahoo.com [209.131.62.116]) (using SSLv3 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 472731929A9; Tue, 8 Apr 2014 22:01:52 +0000 (UTC) Subject: Re: svn commit: r264269 - in head: sys/conf sys/kern sys/modules sys/modules/imgact_binmisc sys/sys usr.sbin usr.sbin/binmiscctl From: Sean Bruno To: John Baldwin In-Reply-To: <201404081625.23418.jhb@freebsd.org> References: <201404082010.s38KAMgg091287@svn.freebsd.org> <201404081625.23418.jhb@freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-S4rBSB27sxTm95yXVTSW" Date: Tue, 08 Apr 2014 15:01:49 -0700 Message-ID: <1396994509.2018.12.camel@powernoodle.corp.yahoo.com> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: sbruno@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 22:01:56 -0000 --=-S4rBSB27sxTm95yXVTSW Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > >=20 > > Added: > > head/sys/kern/imgact_binmisc.c (contents, props changed) > > head/sys/modules/imgact_binmisc/ > > head/sys/modules/imgact_binmisc/Makefile (contents, props changed) > > head/sys/sys/imgact_binmisc.h (contents, props changed) > > head/usr.sbin/binmiscctl/ > > head/usr.sbin/binmiscctl/Makefile (contents, props changed) > > head/usr.sbin/binmiscctl/binmiscctl.8 (contents, props changed) > > head/usr.sbin/binmiscctl/binmiscctl.c (contents, props changed) > > Modified: > > head/sys/conf/files.amd64 > > head/sys/conf/files.i386 > > head/sys/modules/Makefile > > head/usr.sbin/Makefile >=20 > Maybe put it in sys/conf/files instead of only amd64|i386? You enabled > the module build for all architectures. Please also add it to sys/conf/N= OTES. >=20 I've adjusted things to only build on amd64/i386. Thank you for pointing out my misconfiguration. I've updated NOTES as well at svn r264280 to reflext this and updated options for amd64/i386. I haven't tested on non-x86 h/w and have no idea if it works or not. I didn't feel comfortable building this driver in the non-x86 case. If there is a use case/tester for the other arch's, I'll be more than happy to change this. sean --=-S4rBSB27sxTm95yXVTSW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJTRHHNAAoJEBkJRdwI6BaHPHMH/A87M2TzFkfLatKfSyxWjmgY IeeOipjpyPA/3PYPa5wWJRLirVH3jKAlOly11+K+OBYhSmrxJMGfmcSf7TxqLR8G mjqPeycIdlUmJrylhrPKS8e2fmb8B/0nsI2ve3R1mahS5R9en/xkWzMWoO+zkTQq sz8+Qdt2p0Ljb5OESIvTZaD+q/1zKTmYh+vhc6TjG6L+8OyeyvG6a4OwQXUuDsp0 lDWdSc02Au2ICqHriJ/58ZnQukhutIgQ8e8fLfvQVbPEWQtjGOQ0+NiyG9z+ZdPR CbNpeiKKVY5z1h782Nn/825FJVM6jQkFGy9T+2bUnH1//JMTgUZw3gVxZMAxEIw= =XYOR -----END PGP SIGNATURE----- --=-S4rBSB27sxTm95yXVTSW-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 22:12:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB8AC1B7; Tue, 8 Apr 2014 22:12:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEBF71BB5; Tue, 8 Apr 2014 22:12:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38MC2P7044164; Tue, 8 Apr 2014 22:12:02 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38MC21X044162; Tue, 8 Apr 2014 22:12:02 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201404082212.s38MC21X044162@svn.freebsd.org> From: Sean Bruno Date: Tue, 8 Apr 2014 22:12:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264282 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 22:12:02 -0000 Author: sbruno Date: Tue Apr 8 22:12:01 2014 New Revision: 264282 URL: http://svnweb.freebsd.org/changeset/base/264282 Log: sys/kern/imgact_binmisc.c -- free the right pointer mask vs magic sys/sys/imagact_binmisc.h -- cleanup white space tabs vs spaces -- remove stray " in comment Submitted by: jmallett@ Modified: head/sys/kern/imgact_binmisc.c head/sys/sys/imgact_binmisc.h Modified: head/sys/kern/imgact_binmisc.c ============================================================================== --- head/sys/kern/imgact_binmisc.c Tue Apr 8 21:58:04 2014 (r264281) +++ head/sys/kern/imgact_binmisc.c Tue Apr 8 22:12:01 2014 (r264282) @@ -182,7 +182,7 @@ imgact_binmisc_destroy_entry(imgact_binm { if (!ibe) return; - if (ibe->ibe_mask) + if (ibe->ibe_magic) free(ibe->ibe_magic, M_BINMISC); if (ibe->ibe_mask) free(ibe->ibe_mask, M_BINMISC); Modified: head/sys/sys/imgact_binmisc.h ============================================================================== --- head/sys/sys/imgact_binmisc.h Tue Apr 8 21:58:04 2014 (r264281) +++ head/sys/sys/imgact_binmisc.h Tue Apr 8 22:12:01 2014 (r264282) @@ -40,7 +40,7 @@ #define IBE_VERSION 1 /* struct ximgact_binmisc_entry version. */ #define IBE_NAME_MAX 32 /* Max size for entry name. */ #define IBE_MAGIC_MAX 256 /* Max size for header magic and mask. */ -#define IBE_ARG_LEN_MAX 256 /* Max space for optional interpreter command- +#define IBE_ARG_LEN_MAX 256 /* Max space for optional interpreter command- line argruments seperated by white space */ #define IBE_INTERP_LEN_MAX (MAXPATHLEN + IBE_ARG_LEN_MAX) #define IBE_MAX_ENTRIES 64 /* Max number of interpreter entries. */ @@ -70,7 +70,7 @@ typedef struct ximgact_binmisc_entry { /* * sysctl() command names. */ -#define IBE_SYSCTL_NAME "kern.binmisc" +#define IBE_SYSCTL_NAME "kern.binmisc" #define IBE_SYSCTL_NAME_ADD IBE_SYSCTL_NAME ".add" #define IBE_SYSCTL_NAME_REMOVE IBE_SYSCTL_NAME ".remove" @@ -82,7 +82,7 @@ typedef struct ximgact_binmisc_entry { #define KMOD_NAME "imgact_binmisc" /* - * Examples of manipulating he interpreter table using sysctlbyname(3): + * Examples of manipulating the interpreter table using sysctlbyname(3): * * #include * @@ -127,7 +127,7 @@ typedef struct ximgact_binmisc_entry { * xbe.xbe_version = IBE_VERSION; * strlcpy(xbe.xbe_name, "llvm_bc", IBE_NAME_MAX); * error = sysctlbyname(IBE_SYSCTL_NAME_DISABLE, NULL, NULL, &xbe, sizeof(xbe)); - * // OR sysctlbyname(IBE_SYSCTL_NAME_ENABLE", NULL, NULL, &xbe, sizeof(xbe)); + * // OR sysctlbyname(IBE_SYSCTL_NAME_ENABLE, NULL, NULL, &xbe, sizeof(xbe)); * // OR sysctlbyname(IBE_SYSCTL_NAME_REMOVE, NULL, NULL, &xbe, sizeof(xbe)); * * // Lookup image activator "llvm_bc" From owner-svn-src-head@FreeBSD.ORG Tue Apr 8 22:36:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8A0282B; Tue, 8 Apr 2014 22:36:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D68911D98; Tue, 8 Apr 2014 22:36:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38MadjQ052689; Tue, 8 Apr 2014 22:36:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38Madw7052688; Tue, 8 Apr 2014 22:36:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404082236.s38Madw7052688@svn.freebsd.org> From: Alexander Motin Date: Tue, 8 Apr 2014 22:36:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264283 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 22:36:40 -0000 Author: mav Date: Tue Apr 8 22:36:39 2014 New Revision: 264283 URL: http://svnweb.freebsd.org/changeset/base/264283 Log: Another fix for r264274. Last moment cosmetic changes are evil! Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Tue Apr 8 22:12:01 2014 (r264282) +++ head/sys/cam/ctl/ctl_backend_block.c Tue Apr 8 22:36:39 2014 (r264283) @@ -823,7 +823,7 @@ ctl_be_block_unmap_dev(struct ctl_be_blo beio->io_len += len; ctl_be_block_unmap_dev_range(be_lun, beio, scsi_8btou64(buf->lba) * be_lun->blocksize, len, - (end - buf < 32) ? TRUE : FALSE); + (end - buf < 2) ? TRUE : FALSE); } } else ctl_be_block_unmap_dev_range(be_lun, beio, From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 01:26:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14F60DCC; Wed, 9 Apr 2014 01:26:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E328A1431; Wed, 9 Apr 2014 01:26:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s391QwJW045761; Wed, 9 Apr 2014 01:26:58 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s391QwkX045760; Wed, 9 Apr 2014 01:26:58 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201404090126.s391QwkX045760@svn.freebsd.org> From: Peter Wemm Date: Wed, 9 Apr 2014 01:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264289 - head/sys/sys stable/10/sys/sys stable/9/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 01:26:59 -0000 Author: peter Date: Wed Apr 9 01:26:58 2014 New Revision: 264289 URL: http://svnweb.freebsd.org/changeset/base/264289 Log: Bump osreldate for tracking SA-14:06 Modified: head/sys/sys/param.h Changes in other areas also in this revision: Modified: stable/10/sys/sys/param.h stable/9/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Apr 9 00:46:12 2014 (r264288) +++ head/sys/sys/param.h Wed Apr 9 01:26:58 2014 (r264289) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100018 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100019 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 03:46:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E23478F3; Wed, 9 Apr 2014 03:46:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF4D0118E; Wed, 9 Apr 2014 03:46:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s393k4Bs043327; Wed, 9 Apr 2014 03:46:04 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s393k4KV043326; Wed, 9 Apr 2014 03:46:04 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201404090346.s393k4KV043326@svn.freebsd.org> From: Sean Bruno Date: Wed, 9 Apr 2014 03:46:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264291 - head/sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 03:46:05 -0000 Author: sbruno Date: Wed Apr 9 03:46:04 2014 New Revision: 264291 URL: http://svnweb.freebsd.org/changeset/base/264291 Log: Spell imgact_binmisc correctly Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed Apr 9 03:39:57 2014 (r264290) +++ head/sys/modules/Makefile Wed Apr 9 03:46:04 2014 (r264291) @@ -372,7 +372,7 @@ SUBDIR= \ .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" _filemon= filemon -_imagact_binmisc= imgact_binmisc +_imgact_binmisc= imgact_binmisc _vmware= vmware .endif From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 03:51:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38774DBA; Wed, 9 Apr 2014 03:51:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BBF911E1; Wed, 9 Apr 2014 03:51:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s393p5SG044556; Wed, 9 Apr 2014 03:51:05 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s393p5PF044555; Wed, 9 Apr 2014 03:51:05 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404090351.s393p5PF044555@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Apr 2014 03:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264292 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 03:51:06 -0000 Author: adrian Date: Wed Apr 9 03:51:05 2014 New Revision: 264292 URL: http://svnweb.freebsd.org/changeset/base/264292 Log: Add a function to check whether the given register can be accessed whilst the chip is asleep. It's AR5416 and later specific; I'll add a HAL method to generalise it later. Tested: * AR5416, STA mode Modified: head/sys/dev/ath/ah_osdep.c Modified: head/sys/dev/ath/ah_osdep.c ============================================================================== --- head/sys/dev/ath/ah_osdep.c Wed Apr 9 03:46:04 2014 (r264291) +++ head/sys/dev/ath/ah_osdep.c Wed Apr 9 03:51:05 2014 (r264292) @@ -138,6 +138,24 @@ ath_hal_ether_sprintf(const u_int8_t *ma #ifdef AH_DEBUG +/* + * XXX This is highly relevant only for the AR5416 and later + * PCI/PCIe NICs. It'll need adjustment for other hardware + * variations. + */ +static int +ath_hal_reg_whilst_asleep(struct ath_hal *ah, uint32_t reg) +{ + + if (reg >= 0x4000 && reg < 0x5000) + return (1); + if (reg >= 0x6000 && reg < 0x7000) + return (1); + if (reg >= 0x7000 && reg < 0x8000) + return (1); + return (0); +} + void DO_HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...) { @@ -254,7 +272,8 @@ ath_hal_reg_write(struct ath_hal *ah, u_ bus_space_handle_t h = ah->ah_sh; /* Debug - complain if we haven't fully waken things up */ - if (ah->ah_powerMode != HAL_PM_AWAKE) { + if (! ath_hal_reg_whilst_asleep(ah, reg) && + ah->ah_powerMode != HAL_PM_AWAKE) { ath_hal_printf(ah, "%s: reg=0x%08x, val=0x%08x, pm=%d\n", __func__, reg, val, ah->ah_powerMode); } @@ -285,7 +304,8 @@ ath_hal_reg_read(struct ath_hal *ah, u_i u_int32_t val; /* Debug - complain if we haven't fully waken things up */ - if (ah->ah_powerMode != HAL_PM_AWAKE) { + if (! ath_hal_reg_whilst_asleep(ah, reg) && + ah->ah_powerMode != HAL_PM_AWAKE) { ath_hal_printf(ah, "%s: reg=0x%08x, pm=%d\n", __func__, reg, ah->ah_powerMode); } @@ -343,7 +363,8 @@ ath_hal_reg_write(struct ath_hal *ah, u_ bus_space_handle_t h = ah->ah_sh; /* Debug - complain if we haven't fully waken things up */ - if (ah->ah_powerMode != HAL_PM_AWAKE) { + if (! ath_hal_reg_whilst_asleep(ah, reg) && + ah->ah_powerMode != HAL_PM_AWAKE) { ath_hal_printf(ah, "%s: reg=0x%08x, val=0x%08x, pm=%d\n", __func__, reg, val, ah->ah_powerMode); } @@ -363,7 +384,8 @@ ath_hal_reg_read(struct ath_hal *ah, u_i u_int32_t val; /* Debug - complain if we haven't fully waken things up */ - if (ah->ah_powerMode != HAL_PM_AWAKE) { + if (! ath_hal_reg_whilst_asleep(ah, reg) && + ah->ah_powerMode != HAL_PM_AWAKE) { ath_hal_printf(ah, "%s: reg=0x%08x, pm=%d\n", __func__, reg, ah->ah_powerMode); } From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 05:15:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71A4279E; Wed, 9 Apr 2014 05:15:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 451D718C1; Wed, 9 Apr 2014 05:15:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s395FfFT080151; Wed, 9 Apr 2014 05:15:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s395FfaS080150; Wed, 9 Apr 2014 05:15:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201404090515.s395FfaS080150@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 9 Apr 2014 05:15:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264293 - head/sys/dev/nfe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 05:15:41 -0000 Author: yongari Date: Wed Apr 9 05:15:40 2014 New Revision: 264293 URL: http://svnweb.freebsd.org/changeset/base/264293 Log: Add workaround for MCP61 Ethernet controller found on MSI K9 motherboard. PHY hardware used for the controller responded at all possible addresses which in turn resulted in having 32 PHYs for the controller. If driver detects "MSI K9N6PGM2-V2 (MS-7309)" motherboard, tell miibus(4) PHY is located at 0. Tested by: Chris H Modified: head/sys/dev/nfe/if_nfe.c Modified: head/sys/dev/nfe/if_nfe.c ============================================================================== --- head/sys/dev/nfe/if_nfe.c Wed Apr 9 03:51:05 2014 (r264292) +++ head/sys/dev/nfe/if_nfe.c Wed Apr 9 05:15:40 2014 (r264293) @@ -79,6 +79,7 @@ static int nfe_suspend(device_t); static int nfe_resume(device_t); static int nfe_shutdown(device_t); static int nfe_can_use_msix(struct nfe_softc *); +static int nfe_detect_msik9(struct nfe_softc *); static void nfe_power(struct nfe_softc *); static int nfe_miibus_readreg(device_t, int, int); static int nfe_miibus_writereg(device_t, int, int, int); @@ -334,13 +335,38 @@ nfe_alloc_msix(struct nfe_softc *sc, int } } + +static int +nfe_detect_msik9(struct nfe_softc *sc) +{ + static const char *maker = "MSI"; + static const char *product = "K9N6PGM2-V2 (MS-7309)"; + char *m, *p; + int found; + + found = 0; + m = getenv("smbios.planar.maker"); + p = getenv("smbios.planar.product"); + if (m != NULL && p != NULL) { + if (strcmp(m, maker) == 0 && strcmp(p, product) == 0) + found = 1; + } + if (m != NULL) + freeenv(m); + if (p != NULL) + freeenv(p); + + return (found); +} + + static int nfe_attach(device_t dev) { struct nfe_softc *sc; struct ifnet *ifp; bus_addr_t dma_addr_max; - int error = 0, i, msic, reg, rid; + int error = 0, i, msic, phyloc, reg, rid; sc = device_get_softc(dev); sc->nfe_dev = dev; @@ -608,8 +634,16 @@ nfe_attach(device_t dev) #endif /* Do MII setup */ + phyloc = MII_PHY_ANY; + if (sc->nfe_devid == PCI_PRODUCT_NVIDIA_MCP61_LAN1 || + sc->nfe_devid == PCI_PRODUCT_NVIDIA_MCP61_LAN2 || + sc->nfe_devid == PCI_PRODUCT_NVIDIA_MCP61_LAN3 || + sc->nfe_devid == PCI_PRODUCT_NVIDIA_MCP61_LAN4) { + if (nfe_detect_msik9(sc) != 0) + phyloc = 0; + } error = mii_attach(dev, &sc->nfe_miibus, ifp, nfe_ifmedia_upd, - nfe_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, + nfe_ifmedia_sts, BMSR_DEFCAPMASK, phyloc, MII_OFFSET_ANY, MIIF_DOPAUSE); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 06:27:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2ADEB120; Wed, 9 Apr 2014 06:27:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1827C1E70; Wed, 9 Apr 2014 06:27:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s396R4uG008759; Wed, 9 Apr 2014 06:27:04 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s396R4cf008758; Wed, 9 Apr 2014 06:27:04 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201404090627.s396R4cf008758@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 9 Apr 2014 06:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264294 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 06:27:05 -0000 Author: hselasky Date: Wed Apr 9 06:27:04 2014 New Revision: 264294 URL: http://svnweb.freebsd.org/changeset/base/264294 Log: Fix for infinite XHCI reset loops when the set address USB request fails. MFC after: 2 days Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Wed Apr 9 05:15:40 2014 (r264293) +++ head/sys/dev/usb/controller/xhci.c Wed Apr 9 06:27:04 2014 (r264294) @@ -1218,8 +1218,20 @@ retry: */ if (timeout == 0 && xhci_reset_command_queue_locked(sc) == 0) { - timeout = 1; - goto retry; + temp = le32toh(trb->dwTrb3); + + /* + * Avoid infinite XHCI reset loops if the set + * address command fails to respond due to a + * non-enumerating device: + */ + if (XHCI_TRB_3_TYPE_GET(temp) == XHCI_TRB_TYPE_ADDRESS_DEVICE && + (temp & XHCI_TRB_3_BSR_BIT) == 0) { + DPRINTF("Set address timeout\n"); + } else { + timeout = 1; + goto retry; + } } else { DPRINTF("Controller reset!\n"); usb_bus_reset_async_locked(&sc->sc_bus); From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 07:35:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1374CD9A; Wed, 9 Apr 2014 07:35:11 +0000 (UTC) Received: from prod2.absolight.net (mx3.absolight.net [IPv6:2a01:678:2:100::25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "plouf.absolight.net", Issuer "CAcert Class 3 Root" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CB0B510EC; Wed, 9 Apr 2014 07:35:10 +0000 (UTC) Received: from prod2.absolight.net (localhost [127.0.0.1]) by prod2.absolight.net (Postfix) with ESMTP id 1B0B5BDC56; Wed, 9 Apr 2014 09:27:57 +0200 (CEST) Received: from atuin.in.mat.cc (atuin.in.mat.cc [79.143.241.205]) by prod2.absolight.net (Postfix) with ESMTPA id E5662BDC1F; Wed, 9 Apr 2014 09:27:56 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by atuin.in.mat.cc (Postfix) with ESMTP id 49579D35E68C; Wed, 9 Apr 2014 09:27:56 +0200 (CEST) Date: Wed, 09 Apr 2014 09:27:55 +0200 From: Mathieu Arnold To: Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r264269 - in head: sys/conf sys/kern sys/modules sys/modules/imgact_binmisc sys/sys usr.sbin usr.sbin/binmiscctl Message-ID: In-Reply-To: <201404082010.s38KAMgg091287@svn.freebsd.org> References: <201404082010.s38KAMgg091287@svn.freebsd.org> X-Mailer: Mulberry/4.0.8 (Mac OS X) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 07:35:11 -0000 +--On 8 avril 2014 20:10:22 +0000 Sean Bruno wrote: | Log: | Add Stacey Son's binary activation patches that allow remapping of | execution to a emumation program via parsing of ELF header information. Can you MFC that to stable/10 one day ? -- Mathieu Arnold From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 07:44:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 55641124; Wed, 9 Apr 2014 07:44:58 +0000 (UTC) Date: Wed, 9 Apr 2014 07:44:58 +0000 From: Alexey Dokuchaev To: sbruno@freebsd.org Subject: Re: svn commit: r264269 - in head: sys/conf sys/kern sys/modules sys/modules/imgact_binmisc sys/sys usr.sbin usr.sbin/binmiscctl Message-ID: <20140409074458.GB27075@FreeBSD.org> References: <201404082010.s38KAMgg091287@svn.freebsd.org> <201404081625.23418.jhb@freebsd.org> <1396994509.2018.12.camel@powernoodle.corp.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1396994509.2018.12.camel@powernoodle.corp.yahoo.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 07:44:58 -0000 On Tue, Apr 08, 2014 at 03:01:49PM -0700, Sean Bruno wrote: > I haven't tested on non-x86 h/w and have no idea if it works or not. I > didn't feel comfortable building this driver in the non-x86 case. If > there is a use case/tester for the other arch's, I'll be more than happy > to change this. I'd like to test it on PowerPC. Is there quick start guide available with some examples of usage? ./danfe From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 08:57:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50989C21; Wed, 9 Apr 2014 08:57:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C8D41899; Wed, 9 Apr 2014 08:57:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s398vwUk032278; Wed, 9 Apr 2014 08:57:58 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s398vvaW032276; Wed, 9 Apr 2014 08:57:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404090857.s398vvaW032276@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Apr 2014 08:57:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264295 - in head: share/man/man4 sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 08:57:58 -0000 Author: mav Date: Wed Apr 9 08:57:57 2014 New Revision: 264295 URL: http://svnweb.freebsd.org/changeset/base/264295 Log: Remove support of LUN-based CD changers from cd(4) driver. This code was heavily broken few months ago during CAM locking changes. Fixing it would require almost complete rewrite. Since there are no known devices on market using this interface younger then ~15 years, and they are CD, not even DVD, I don't see much reason to rewrite it. This change does not mean those devices won't work. They will just work slower due to inefficient disks load/unload schedule if several LUNs accessed same time. Discussed with: ken@ Silence on: scsi@, hardware@ MFC after: 1 week Modified: head/share/man/man4/cd.4 head/sys/cam/scsi/scsi_cd.c Modified: head/share/man/man4/cd.4 ============================================================================== --- head/share/man/man4/cd.4 Wed Apr 9 06:27:04 2014 (r264294) +++ head/share/man/man4/cd.4 Wed Apr 9 08:57:57 2014 (r264295) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd April 9, 2014 .Dt CD 4 .Os .Sh NAME @@ -33,8 +33,6 @@ .Nd SCSI CD-ROM driver .Sh SYNOPSIS .Cd device cd -.Cd "options ""CHANGER_MIN_BUSY_SECONDS=3""" -.Cd "options ""CHANGER_MAX_BUSY_SECONDS=11""" .Sh DESCRIPTION The .Nm @@ -288,65 +286,6 @@ Some work is planned to support some of the more common `broken' .Tn CD-ROM drives; however, this is not yet under way. -.Sh CHANGER OPERATION -This driver has built-in support for LUN-based CD changers. -A LUN-based CD -changer is a drive that can hold two or more CDs, but only has one CD -player mechanism. -Each CD in the drive shows up as a separate logical unit -on the -.Tn SCSI -bus. -The -.Nm -driver automatically recognizes LUN-based changers, and routes commands for -changers through an internal scheduler. -The scheduler prevents changer -"thrashing", which is caused by sending commands to different LUNs in the -changer at the same time. -.Pp -The scheduler honors minimum and maximum time -quanta that the driver will spend on a particular LUN. -The minimum time -is the guaranteed minimum amount of time that the driver will spend on a -given LUN, even if there is no outstanding I/O for that LUN. -The maximum -time is the maximum amount of time the changer will spend on a LUN if there -is outstanding I/O for another LUN. -If there is no outstanding I/O for -another LUN, the driver will allow indefinite access to a given LUN. -.Pp -The minimum and maximum time quanta are configurable via kernel options and -also via sysctl and kernel tunable variables. -The kernel options are: -.Pp -.Bl -item -compact -.It -.Cd "options ""CHANGER_MIN_BUSY_SECONDS=3""" -.It -.Cd "options ""CHANGER_MAX_BUSY_SECONDS=11""" -.El -.Pp -The sysctl/kernel tunable variables are: -.Pp -.Bl -item -compact -.It -.Va kern.cam.cd.changer.min_busy_seconds -.It -.Va kern.cam.cd.changer.max_busy_seconds -.El -.Pp -It is suggested that the user try experimenting with the minimum and -maximum timeouts via the sysctl variables to arrive at the proper values -for your changer. -Once you have settled on the proper timeouts for your -changer, you can then put them in your kernel config file. -.Pp -If your system does have a LUN-based changer, you may notice that the -probe messages for the various LUNs of the changer will continue to appear -while the boot process is going on. -This is normal, and is caused by the -changer scheduling code. .Sh SYSCTL VARIABLES The following variables are available as both .Xr sysctl 8 @@ -397,12 +336,6 @@ Valid minimum command sizes are 6 and 10. Any value above 6 will be rounded to 10, and any value below 6 will be rounded to 6. -.It kern.cam.cd.changer.min_busy_seconds -.It kern.cam.cd.changer.max_busy_seconds -.Pp -Tune how long individual LUNs are 'locked' for I/O operations to -optimize changer operation. -See CHANGER OPERATION section for information on how to use these items. .El .Sh FILES .Bl -tag -width /dev/cd[0-9][a-h] -compact @@ -437,21 +370,3 @@ were poorly chosen, and a number of spel the names of the .Fn ioctl commands. -.Pp -There is no mechanism currently to set different minimum and maximum -timeouts for different CD changers; the timeout values set by the kernel -options or the sysctl variables apply to all LUN-based CD changers in the -system. -It is possible to implement such support, but the sysctl -implementation at least would be rather inelegant, because of the current -inability of the sysctl code to handle the addition of nodes after compile -time. -Thus, it would take one dynamically sized sysctl variable and a -userland utility to get/set the timeout values. -Implementation of separate -timeouts for different CD devices in the kernel config file would likely -require modification of -.Xr config 8 -to support the two timeouts when hardwiring -.Nm -devices. Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Wed Apr 9 06:27:04 2014 (r264294) +++ head/sys/cam/scsi/scsi_cd.c Wed Apr 9 08:57:57 2014 (r264295) @@ -87,8 +87,6 @@ typedef enum { CD_Q_NONE = 0x00, CD_Q_NO_TOUCH = 0x01, CD_Q_BCD_TRACKS = 0x02, - CD_Q_NO_CHANGER = 0x04, - CD_Q_CHANGER = 0x08, CD_Q_10_BYTE_ONLY = 0x10 } cd_quirks; @@ -96,8 +94,6 @@ typedef enum { "\020" \ "\001NO_TOUCH" \ "\002BCD_TRACKS" \ - "\003NO_CHANGER" \ - "\004CHANGER" \ "\00510_BYTE_ONLY" typedef enum { @@ -106,7 +102,6 @@ typedef enum { CD_FLAG_DISC_LOCKED = 0x0004, CD_FLAG_DISC_REMOVABLE = 0x0008, CD_FLAG_SAW_MEDIA = 0x0010, - CD_FLAG_CHANGER = 0x0040, CD_FLAG_ACTIVE = 0x0080, CD_FLAG_SCHED_ON_COMP = 0x0100, CD_FLAG_RETRY_UA = 0x0200, @@ -123,13 +118,6 @@ typedef enum { CD_CCB_RETRY_UA = 0x10 } cd_ccb_state; -typedef enum { - CHANGER_TIMEOUT_SCHED = 0x01, - CHANGER_SHORT_TMOUT_SCHED = 0x02, - CHANGER_MANUAL_CALL = 0x04, - CHANGER_NEED_TIMEOUT = 0x08 -} cd_changer_flags; - #define ccb_state ppriv_field0 #define ccb_bp ppriv_ptr1 @@ -157,9 +145,6 @@ struct cd_softc { struct cd_params params; union ccb saved_ccb; cd_quirks quirks; - STAILQ_ENTRY(cd_softc) changer_links; - struct cdchanger *changer; - int bufs_left; struct cam_periph *periph; int minimum_command_size; int outstanding_cmds; @@ -189,13 +174,6 @@ struct cd_quirk_entry { }; /* - * The changer quirk entries aren't strictly necessary. Basically, what - * they do is tell cdregister() up front that a device is a changer. - * Otherwise, it will figure that fact out once it sees a LUN on the device - * that is greater than 0. If it is known up front that a device is a changer, - * all I/O to the device will go through the changer scheduling routines, as - * opposed to the "normal" CD code. - * * NOTE ON 10_BYTE_ONLY quirks: Any 10_BYTE_ONLY quirks MUST be because * your device hangs when it gets a 10 byte command. Adding a quirk just * to get rid of the informative diagnostic message is not acceptable. All @@ -209,18 +187,6 @@ struct cd_quirk_entry { static struct cd_quirk_entry cd_quirk_table[] = { { - { T_CDROM, SIP_MEDIA_REMOVABLE, "NRC", "MBR-7", "*"}, - /*quirks*/ CD_Q_CHANGER - }, - { - { T_CDROM, SIP_MEDIA_REMOVABLE, "PIONEER", "CD-ROM DRM*", - "*"}, /* quirks */ CD_Q_CHANGER - }, - { - { T_CDROM, SIP_MEDIA_REMOVABLE, "NAKAMICH", "MJ-*", "*"}, - /* quirks */ CD_Q_CHANGER - }, - { { T_CDROM, SIP_MEDIA_REMOVABLE, "CHINON", "CD-ROM CDS-535","*"}, /* quirks */ CD_Q_BCD_TRACKS } @@ -241,15 +207,11 @@ static void cdasync(void *callback_arg, static int cdcmdsizesysctl(SYSCTL_HANDLER_ARGS); static void cdshorttimeout(void *arg); static void cdschedule(struct cam_periph *periph, int priority); -static void cdrunchangerqueue(void *arg); -static void cdchangerschedule(struct cd_softc *softc); static int cdrunccb(union ccb *ccb, int (*error_routine)(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags), u_int32_t cam_flags, u_int32_t sense_flags); -static union ccb *cdgetccb(struct cam_periph *periph, - u_int32_t priority); static void cddone(struct cam_periph *periph, union ccb *start_ccb); static union cd_pages *cdgetpage(struct cd_mode_params *mode_params); @@ -311,22 +273,12 @@ PERIPHDRIVER_DECLARE(cd, cddriver); #ifndef CD_DEFAULT_TIMEOUT #define CD_DEFAULT_TIMEOUT 30000 #endif -#ifndef CHANGER_MIN_BUSY_SECONDS -#define CHANGER_MIN_BUSY_SECONDS 5 -#endif -#ifndef CHANGER_MAX_BUSY_SECONDS -#define CHANGER_MAX_BUSY_SECONDS 15 -#endif static int cd_poll_period = CD_DEFAULT_POLL_PERIOD; static int cd_retry_count = CD_DEFAULT_RETRY; static int cd_timeout = CD_DEFAULT_TIMEOUT; -static int changer_min_busy_seconds = CHANGER_MIN_BUSY_SECONDS; -static int changer_max_busy_seconds = CHANGER_MAX_BUSY_SECONDS; static SYSCTL_NODE(_kern_cam, OID_AUTO, cd, CTLFLAG_RD, 0, "CAM CDROM driver"); -static SYSCTL_NODE(_kern_cam_cd, OID_AUTO, changer, CTLFLAG_RD, 0, - "CD Changer"); SYSCTL_INT(_kern_cam_cd, OID_AUTO, poll_period, CTLFLAG_RW, &cd_poll_period, 0, "Media polling period in seconds"); TUNABLE_INT("kern.cam.cd.poll_period", &cd_poll_period); @@ -336,30 +288,6 @@ TUNABLE_INT("kern.cam.cd.retry_count", & SYSCTL_INT(_kern_cam_cd, OID_AUTO, timeout, CTLFLAG_RW, &cd_timeout, 0, "Timeout, in us, for read operations"); TUNABLE_INT("kern.cam.cd.timeout", &cd_timeout); -SYSCTL_INT(_kern_cam_cd_changer, OID_AUTO, min_busy_seconds, CTLFLAG_RW, - &changer_min_busy_seconds, 0, "Minimum changer scheduling quantum"); -TUNABLE_INT("kern.cam.cd.changer.min_busy_seconds", &changer_min_busy_seconds); -SYSCTL_INT(_kern_cam_cd_changer, OID_AUTO, max_busy_seconds, CTLFLAG_RW, - &changer_max_busy_seconds, 0, "Maximum changer scheduling quantum"); -TUNABLE_INT("kern.cam.cd.changer.max_busy_seconds", &changer_max_busy_seconds); - -struct cdchanger { - path_id_t path_id; - target_id_t target_id; - int num_devices; - struct camq devq; - struct timeval start_time; - struct cd_softc *cur_device; - struct callout short_handle; - struct callout long_handle; - volatile cd_changer_flags flags; - STAILQ_ENTRY(cdchanger) changer_links; - STAILQ_HEAD(chdevlist, cd_softc) chluns; -}; - -static struct mtx changerq_mtx; -static STAILQ_HEAD(changerlist, cdchanger) changerq; -static int num_changers; static MALLOC_DEFINE(M_SCSICD, "scsi_cd", "scsi_cd buffers"); @@ -368,9 +296,6 @@ cdinit(void) { cam_status status; - mtx_init(&changerq_mtx, "cdchangerq", "SCSI CD Changer List", MTX_DEF); - STAILQ_INIT(&changerq); - /* * Install a global async callback. This callback will * receive async callbacks like "new device found". @@ -417,15 +342,6 @@ cdoninvalidate(struct cam_periph *periph */ bioq_flush(&softc->bio_queue, NULL, ENXIO); - /* - * If this device is part of a changer, and it was scheduled - * to run, remove it from the run queue since we just nuked - * all of its scheduled I/O. - */ - if ((softc->flags & CD_FLAG_CHANGER) - && (softc->pinfo.index != CAM_UNQUEUED_INDEX)) - camq_remove(&softc->changer->devq, softc->pinfo.index); - disk_gone(softc->disk); } @@ -436,73 +352,6 @@ cdcleanup(struct cam_periph *periph) softc = (struct cd_softc *)periph->softc; - /* - * In the queued, non-active case, the device in question - * has already been removed from the changer run queue. Since this - * device is active, we need to de-activate it, and schedule - * another device to run. (if there is another one to run) - */ - if ((softc->flags & CD_FLAG_CHANGER) - && (softc->flags & CD_FLAG_ACTIVE)) { - - /* - * The purpose of the short timeout is soley to determine - * whether the current device has finished or not. Well, - * since we're removing the active device, we know that it - * is finished. So, get rid of the short timeout. - * Otherwise, if we're in the time period before the short - * timeout fires, and there are no other devices in the - * queue to run, there won't be any other device put in the - * active slot. i.e., when we call cdrunchangerqueue() - * below, it won't do anything. Then, when the short - * timeout fires, it'll look at the "current device", which - * we are free below, and possibly panic the kernel on a - * bogus pointer reference. - * - * The long timeout doesn't really matter, since we - * decrement the qfrozen_cnt to indicate that there is - * nothing in the active slot now. Therefore, there won't - * be any bogus pointer references there. - */ - if (softc->changer->flags & CHANGER_SHORT_TMOUT_SCHED) { - callout_stop(&softc->changer->short_handle); - softc->changer->flags &= ~CHANGER_SHORT_TMOUT_SCHED; - } - softc->changer->devq.qfrozen_cnt--; - softc->changer->flags |= CHANGER_MANUAL_CALL; - cdrunchangerqueue(softc->changer); - } - - /* - * If we're removing the last device on the changer, go ahead and - * remove the changer device structure. - */ - if ((softc->flags & CD_FLAG_CHANGER) - && (--softc->changer->num_devices == 0)) { - - /* - * Theoretically, there shouldn't be any timeouts left, but - * I'm not completely sure that that will be the case. So, - * it won't hurt to check and see if there are any left. - */ - if (softc->changer->flags & CHANGER_TIMEOUT_SCHED) { - callout_stop(&softc->changer->long_handle); - softc->changer->flags &= ~CHANGER_TIMEOUT_SCHED; - } - - if (softc->changer->flags & CHANGER_SHORT_TMOUT_SCHED) { - callout_stop(&softc->changer->short_handle); - softc->changer->flags &= ~CHANGER_SHORT_TMOUT_SCHED; - } - - mtx_lock(&changerq_mtx); - STAILQ_REMOVE(&changerq, softc->changer, cdchanger, - changer_links); - num_changers--; - mtx_unlock(&changerq_mtx); - xpt_print(periph->path, "removing changer entry\n"); - free(softc->changer, M_DEVBUF); - } cam_periph_unlock(periph); if ((softc->flags & CD_FLAG_SCTX_INIT) != 0 && sysctl_ctx_free(&softc->sysctl_ctx) != 0) { @@ -834,237 +683,16 @@ cdregister(struct cam_periph *periph, vo AC_SCSI_AEN | AC_UNIT_ATTENTION, cdasync, periph, periph->path); /* - * If the target lun is greater than 0, we most likely have a CD - * changer device. Check the quirk entries as well, though, just - * in case someone has a CD tower with one lun per drive or - * something like that. Also, if we know up front that a - * particular device is a changer, we can mark it as such starting - * with lun 0, instead of lun 1. It shouldn't be necessary to have - * a quirk entry to define something as a changer, however. - */ - if (((cgd->ccb_h.target_lun > 0) - && ((softc->quirks & CD_Q_NO_CHANGER) == 0)) - || ((softc->quirks & CD_Q_CHANGER) != 0)) { - struct cdchanger *nchanger; - struct cam_periph *nperiph; - struct cam_path *path; - cam_status status; - int found; - - /* Set the changer flag in the current device's softc */ - softc->flags |= CD_FLAG_CHANGER; - - /* - * Now, look around for an existing changer device with the - * same path and target ID as the current device. - */ - mtx_lock(&changerq_mtx); - for (found = 0, - nchanger = (struct cdchanger *)STAILQ_FIRST(&changerq); - nchanger != NULL; - nchanger = STAILQ_NEXT(nchanger, changer_links)){ - if ((nchanger->path_id == cgd->ccb_h.path_id) - && (nchanger->target_id == cgd->ccb_h.target_id)) { - found = 1; - break; - } - } - mtx_unlock(&changerq_mtx); - - /* - * If we found a matching entry, just add this device to - * the list of devices on this changer. - */ - if (found == 1) { - struct chdevlist *chlunhead; - - chlunhead = &nchanger->chluns; - - /* - * XXX KDM look at consolidating this code with the - * code below in a separate function. - */ - - /* - * Create a path with lun id 0, and see if we can - * find a matching device - */ - status = xpt_create_path(&path, /*periph*/ periph, - cgd->ccb_h.path_id, - cgd->ccb_h.target_id, 0); - - if ((status == CAM_REQ_CMP) - && ((nperiph = cam_periph_find(path, "cd")) != NULL)){ - struct cd_softc *nsoftc; - - nsoftc = (struct cd_softc *)nperiph->softc; - - if ((nsoftc->flags & CD_FLAG_CHANGER) == 0){ - nsoftc->flags |= CD_FLAG_CHANGER; - nchanger->num_devices++; - if (camq_resize(&nchanger->devq, - nchanger->num_devices)!=CAM_REQ_CMP){ - printf("cdregister: " - "camq_resize " - "failed, changer " - "support may " - "be messed up\n"); - } - nsoftc->changer = nchanger; - nsoftc->pinfo.index =CAM_UNQUEUED_INDEX; - - STAILQ_INSERT_TAIL(&nchanger->chluns, - nsoftc,changer_links); - } - xpt_free_path(path); - } else if (status == CAM_REQ_CMP) - xpt_free_path(path); - else { - printf("cdregister: unable to allocate path\n" - "cdregister: changer support may be " - "broken\n"); - } - - nchanger->num_devices++; - - softc->changer = nchanger; - softc->pinfo.index = CAM_UNQUEUED_INDEX; - - if (camq_resize(&nchanger->devq, - nchanger->num_devices) != CAM_REQ_CMP) { - printf("cdregister: camq_resize " - "failed, changer support may " - "be messed up\n"); - } - - STAILQ_INSERT_TAIL(chlunhead, softc, changer_links); - } - /* - * In this case, we don't already have an entry for this - * particular changer, so we need to create one, add it to - * the queue, and queue this device on the list for this - * changer. Before we queue this device, however, we need - * to search for lun id 0 on this target, and add it to the - * queue first, if it exists. (and if it hasn't already - * been marked as part of the changer.) - */ - else { - nchanger = malloc(sizeof(struct cdchanger), - M_DEVBUF, M_NOWAIT | M_ZERO); - if (nchanger == NULL) { - softc->flags &= ~CD_FLAG_CHANGER; - printf("cdregister: unable to malloc " - "changer structure\ncdregister: " - "changer support disabled\n"); - - /* - * Yes, gotos can be gross but in this case - * I think it's justified.. - */ - goto cdregisterexit; - } - if (camq_init(&nchanger->devq, 1) != 0) { - softc->flags &= ~CD_FLAG_CHANGER; - printf("cdregister: changer support " - "disabled\n"); - goto cdregisterexit; - } - - nchanger->path_id = cgd->ccb_h.path_id; - nchanger->target_id = cgd->ccb_h.target_id; - - /* this is superfluous, but it makes things clearer */ - nchanger->num_devices = 0; - - STAILQ_INIT(&nchanger->chluns); - - callout_init_mtx(&nchanger->long_handle, - cam_periph_mtx(periph), 0); - callout_init_mtx(&nchanger->short_handle, - cam_periph_mtx(periph), 0); - - mtx_lock(&changerq_mtx); - num_changers++; - STAILQ_INSERT_TAIL(&changerq, nchanger, - changer_links); - mtx_unlock(&changerq_mtx); - - /* - * Create a path with lun id 0, and see if we can - * find a matching device - */ - status = xpt_create_path(&path, /*periph*/ periph, - cgd->ccb_h.path_id, - cgd->ccb_h.target_id, 0); - - /* - * If we were able to allocate the path, and if we - * find a matching device and it isn't already - * marked as part of a changer, then we add it to - * the current changer. - */ - if ((status == CAM_REQ_CMP) - && ((nperiph = cam_periph_find(path, "cd")) != NULL) - && ((((struct cd_softc *)periph->softc)->flags & - CD_FLAG_CHANGER) == 0)) { - struct cd_softc *nsoftc; - - nsoftc = (struct cd_softc *)nperiph->softc; - - nsoftc->flags |= CD_FLAG_CHANGER; - nchanger->num_devices++; - if (camq_resize(&nchanger->devq, - nchanger->num_devices) != CAM_REQ_CMP) { - printf("cdregister: camq_resize " - "failed, changer support may " - "be messed up\n"); - } - nsoftc->changer = nchanger; - nsoftc->pinfo.index = CAM_UNQUEUED_INDEX; - - STAILQ_INSERT_TAIL(&nchanger->chluns, - nsoftc, changer_links); - xpt_free_path(path); - } else if (status == CAM_REQ_CMP) - xpt_free_path(path); - else { - printf("cdregister: unable to allocate path\n" - "cdregister: changer support may be " - "broken\n"); - } - - softc->changer = nchanger; - softc->pinfo.index = CAM_UNQUEUED_INDEX; - nchanger->num_devices++; - if (camq_resize(&nchanger->devq, - nchanger->num_devices) != CAM_REQ_CMP) { - printf("cdregister: camq_resize " - "failed, changer support may " - "be messed up\n"); - } - STAILQ_INSERT_TAIL(&nchanger->chluns, softc, - changer_links); - } - } - - /* * Schedule a periodic media polling events. */ callout_init_mtx(&softc->mediapoll_c, cam_periph_mtx(periph), 0); if ((softc->flags & CD_FLAG_DISC_REMOVABLE) && - (softc->flags & CD_FLAG_CHANGER) == 0 && (cgd->inq_flags & SID_AEN) == 0 && cd_poll_period != 0) callout_reset(&softc->mediapoll_c, cd_poll_period * hz, cdmediapoll, periph); -cdregisterexit: - - if ((softc->flags & CD_FLAG_CHANGER) == 0) - xpt_schedule(periph, CAM_PRIORITY_DEV); - else - cdschedule(periph, CAM_PRIORITY_DEV); - + xpt_schedule(periph, CAM_PRIORITY_DEV); return(CAM_REQ_CMP); } @@ -1153,251 +781,6 @@ cdclose(struct disk *dp) return (0); } -static void -cdshorttimeout(void *arg) -{ - struct cdchanger *changer; - - changer = (struct cdchanger *)arg; - - /* Always clear the short timeout flag, since that's what we're in */ - changer->flags &= ~CHANGER_SHORT_TMOUT_SCHED; - - /* - * Check to see if there is any more pending or outstanding I/O for - * this device. If not, move it out of the active slot. - */ - if ((bioq_first(&changer->cur_device->bio_queue) == NULL) - && (changer->cur_device->outstanding_cmds == 0)) { - changer->flags |= CHANGER_MANUAL_CALL; - cdrunchangerqueue(changer); - } -} - -/* - * This is a wrapper for xpt_schedule. It only applies to changers. - */ -static void -cdschedule(struct cam_periph *periph, int priority) -{ - struct cd_softc *softc; - - softc = (struct cd_softc *)periph->softc; - - /* - * If this device isn't currently queued, and if it isn't - * the active device, then we queue this device and run the - * changer queue if there is no timeout scheduled to do it. - * If this device is the active device, just schedule it - * to run again. If this device is queued, there should be - * a timeout in place already that will make sure it runs. - */ - if ((softc->pinfo.index == CAM_UNQUEUED_INDEX) - && ((softc->flags & CD_FLAG_ACTIVE) == 0)) { - /* - * We don't do anything with the priority here. - * This is strictly a fifo queue. - */ - softc->pinfo.priority = CAM_PRIORITY_NORMAL; - softc->pinfo.generation = ++softc->changer->devq.generation; - camq_insert(&softc->changer->devq, (cam_pinfo *)softc); - - /* - * Since we just put a device in the changer queue, - * check and see if there is a timeout scheduled for - * this changer. If so, let the timeout handle - * switching this device into the active slot. If - * not, manually call the timeout routine to - * bootstrap things. - */ - if (((softc->changer->flags & CHANGER_TIMEOUT_SCHED)==0) - && ((softc->changer->flags & CHANGER_NEED_TIMEOUT)==0) - && ((softc->changer->flags & CHANGER_SHORT_TMOUT_SCHED)==0)){ - softc->changer->flags |= CHANGER_MANUAL_CALL; - cdrunchangerqueue(softc->changer); - } - } else if ((softc->flags & CD_FLAG_ACTIVE) - && ((softc->flags & CD_FLAG_SCHED_ON_COMP) == 0)) - xpt_schedule(periph, priority); -} - -static void -cdrunchangerqueue(void *arg) -{ - struct cd_softc *softc; - struct cdchanger *changer; - int called_from_timeout; - - changer = (struct cdchanger *)arg; - - /* - * If we have NOT been called from cdstrategy() or cddone(), and - * instead from a timeout routine, go ahead and clear the - * timeout flag. - */ - if ((changer->flags & CHANGER_MANUAL_CALL) == 0) { - changer->flags &= ~CHANGER_TIMEOUT_SCHED; - called_from_timeout = 1; - } else - called_from_timeout = 0; - - /* Always clear the manual call flag */ - changer->flags &= ~CHANGER_MANUAL_CALL; - - /* nothing to do if the queue is empty */ - if (changer->devq.entries <= 0) { - return; - } - - /* - * If the changer queue is frozen, that means we have an active - * device. - */ - if (changer->devq.qfrozen_cnt > 0) { - - /* - * We always need to reset the frozen count and clear the - * active flag. - */ - changer->devq.qfrozen_cnt--; - changer->cur_device->flags &= ~CD_FLAG_ACTIVE; - changer->cur_device->flags &= ~CD_FLAG_SCHED_ON_COMP; - - if (changer->cur_device->outstanding_cmds > 0) { - changer->cur_device->flags |= CD_FLAG_SCHED_ON_COMP; - changer->cur_device->bufs_left = - changer->cur_device->outstanding_cmds; - if (called_from_timeout) { - callout_reset(&changer->long_handle, - changer_max_busy_seconds * hz, - cdrunchangerqueue, changer); - changer->flags |= CHANGER_TIMEOUT_SCHED; - } - return; - } - - /* - * Check to see whether the current device has any I/O left - * to do. If so, requeue it at the end of the queue. If - * not, there is no need to requeue it. - */ - if (bioq_first(&changer->cur_device->bio_queue) != NULL) { - - changer->cur_device->pinfo.generation = - ++changer->devq.generation; - camq_insert(&changer->devq, - (cam_pinfo *)changer->cur_device); - } - } - - softc = (struct cd_softc *)camq_remove(&changer->devq, CAMQ_HEAD); - - changer->cur_device = softc; - - changer->devq.qfrozen_cnt++; - softc->flags |= CD_FLAG_ACTIVE; - - /* Just in case this device is waiting */ - wakeup(&softc->changer); - xpt_schedule(softc->periph, CAM_PRIORITY_NORMAL); - - /* - * Get rid of any pending timeouts, and set a flag to schedule new - * ones so this device gets its full time quantum. - */ - if (changer->flags & CHANGER_TIMEOUT_SCHED) { - callout_stop(&changer->long_handle); - changer->flags &= ~CHANGER_TIMEOUT_SCHED; - } - - if (changer->flags & CHANGER_SHORT_TMOUT_SCHED) { - callout_stop(&changer->short_handle); - changer->flags &= ~CHANGER_SHORT_TMOUT_SCHED; - } - - /* - * We need to schedule timeouts, but we only do this after the - * first transaction has completed. This eliminates the changer - * switch time. - */ - changer->flags |= CHANGER_NEED_TIMEOUT; -} - -static void -cdchangerschedule(struct cd_softc *softc) -{ - struct cdchanger *changer; - - changer = softc->changer; - - /* - * If this is a changer, and this is the current device, - * and this device has at least the minimum time quantum to - * run, see if we can switch it out. - */ - if ((softc->flags & CD_FLAG_ACTIVE) - && ((changer->flags & CHANGER_SHORT_TMOUT_SCHED) == 0) - && ((changer->flags & CHANGER_NEED_TIMEOUT) == 0)) { - /* - * We try three things here. The first is that we - * check to see whether the schedule on completion - * flag is set. If it is, we decrement the number - * of buffers left, and if it's zero, we reschedule. - * Next, we check to see whether the pending buffer - * queue is empty and whether there are no - * outstanding transactions. If so, we reschedule. - * Next, we see if the pending buffer queue is empty. - * If it is, we set the number of buffers left to - * the current active buffer count and set the - * schedule on complete flag. - */ - if (softc->flags & CD_FLAG_SCHED_ON_COMP) { - if (--softc->bufs_left == 0) { - softc->changer->flags |= - CHANGER_MANUAL_CALL; - softc->flags &= ~CD_FLAG_SCHED_ON_COMP; - cdrunchangerqueue(softc->changer); - } - } else if ((bioq_first(&softc->bio_queue) == NULL) - && (softc->outstanding_cmds == 0)) { - softc->changer->flags |= CHANGER_MANUAL_CALL; - cdrunchangerqueue(softc->changer); - } - } else if ((softc->changer->flags & CHANGER_NEED_TIMEOUT) - && (softc->flags & CD_FLAG_ACTIVE)) { - - /* - * Now that the first transaction to this - * particular device has completed, we can go ahead - * and schedule our timeouts. - */ - if ((changer->flags & CHANGER_TIMEOUT_SCHED) == 0) { - callout_reset(&changer->long_handle, - changer_max_busy_seconds * hz, - cdrunchangerqueue, changer); - changer->flags |= CHANGER_TIMEOUT_SCHED; - } else - printf("cdchangerschedule: already have a long" - " timeout!\n"); - - if ((changer->flags & CHANGER_SHORT_TMOUT_SCHED) == 0) { - callout_reset(&changer->short_handle, - changer_min_busy_seconds * hz, - cdshorttimeout, changer); - changer->flags |= CHANGER_SHORT_TMOUT_SCHED; - } else - printf("cdchangerschedule: already have a short " - "timeout!\n"); - - /* - * We just scheduled timeouts, no need to schedule - * more. - */ - changer->flags &= ~CHANGER_NEED_TIMEOUT; - - } -} - static int cdrunccb(union ccb *ccb, int (*error_routine)(union ccb *ccb, u_int32_t cam_flags, @@ -1414,50 +797,9 @@ cdrunccb(union ccb *ccb, int (*error_rou error = cam_periph_runccb(ccb, error_routine, cam_flags, sense_flags, softc->disk->d_devstat); - if (softc->flags & CD_FLAG_CHANGER) - cdchangerschedule(softc); - return(error); } -static union ccb * -cdgetccb(struct cam_periph *periph, u_int32_t priority) -{ - struct cd_softc *softc; - - softc = (struct cd_softc *)periph->softc; - - if (softc->flags & CD_FLAG_CHANGER) { - /* - * This should work the first time this device is woken up, - * but just in case it doesn't, we use a while loop. - */ - while ((softc->flags & CD_FLAG_ACTIVE) == 0) { - /* - * If this changer isn't already queued, queue it up. - */ - if (softc->pinfo.index == CAM_UNQUEUED_INDEX) { - softc->pinfo.priority = CAM_PRIORITY_NORMAL; - softc->pinfo.generation = - ++softc->changer->devq.generation; - camq_insert(&softc->changer->devq, - (cam_pinfo *)softc); - } - if (((softc->changer->flags & CHANGER_TIMEOUT_SCHED)==0) - && ((softc->changer->flags & CHANGER_NEED_TIMEOUT)==0) - && ((softc->changer->flags - & CHANGER_SHORT_TMOUT_SCHED)==0)) { - softc->changer->flags |= CHANGER_MANUAL_CALL; - cdrunchangerqueue(softc->changer); - } else - cam_periph_sleep(periph, &softc->changer, - PRIBIO, "cgticb", 0); - } - } - return(cam_periph_getccb(periph, priority)); -} - - /* * Actually translate the requested transfer into one the physical driver * can understand. The transfer is described by a buf and will include @@ -1505,14 +847,7 @@ cdstrategy(struct bio *bp) */ bioq_disksort(&softc->bio_queue, bp); - /* - * Schedule ourselves for performing the work. We do things - * differently for changers. - */ - if ((softc->flags & CD_FLAG_CHANGER) == 0) - xpt_schedule(periph, CAM_PRIORITY_NORMAL); - else - cdschedule(periph, CAM_PRIORITY_NORMAL); + xpt_schedule(periph, CAM_PRIORITY_NORMAL); cam_periph_unlock(periph); return; @@ -1699,9 +1034,6 @@ cddone(struct cam_periph *periph, union LIST_REMOVE(&done_ccb->ccb_h, periph_links.le); softc->outstanding_cmds--; - if (softc->flags & CD_FLAG_CHANGER) - cdchangerschedule(softc); - biofinish(bp, NULL, 0); break; } @@ -1864,8 +1196,6 @@ cddone(struct cam_periph *periph, union xpt_announce_periph(periph, announce_buf); xpt_announce_quirks(periph, softc->quirks, CD_Q_BIT_STRING); - if (softc->flags & CD_FLAG_CHANGER) - cdchangerschedule(softc); /* * Create our sysctl variables, now that we know * we have successfully attached. @@ -2841,7 +2171,7 @@ cdprevent(struct cam_periph *periph, int return; } - ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); scsi_prevent(&ccb->csio, /*retries*/ cd_retry_count, @@ -3021,7 +2351,7 @@ cdsize(struct cam_periph *periph, u_int3 softc = (struct cd_softc *)periph->softc; - ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); /* XXX Should be M_WAITOK */ rcap_buf = malloc(sizeof(struct scsi_read_capacity_data), @@ -3266,9 +2596,6 @@ cdmediapoll(void *arg) struct cam_periph *periph = arg; struct cd_softc *softc = periph->softc; - if (softc->flags & CD_FLAG_CHANGER) - return; - if (softc->state == CD_STATE_NORMAL && !softc->tur && softc->outstanding_cmds == 0) { if (cam_periph_acquire(periph) == CAM_REQ_CMP) { @@ -3297,7 +2624,7 @@ cdreadtoc(struct cam_periph *periph, u_i ntoc = len; error = 0; - ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); csio = &ccb->csio; @@ -3344,7 +2671,7 @@ cdreadsubchannel(struct cam_periph *peri error = 0; - ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); csio = &ccb->csio; @@ -3396,7 +2723,7 @@ cdgetmode(struct cam_periph *periph, str *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 10:44:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF442A26; Wed, 9 Apr 2014 10:44:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCABE13E3; Wed, 9 Apr 2014 10:44:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s39Ai922078286; Wed, 9 Apr 2014 10:44:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s39Ai9cY078285; Wed, 9 Apr 2014 10:44:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404091044.s39Ai9cY078285@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Apr 2014 10:44:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264296 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 10:44:09 -0000 Author: mav Date: Wed Apr 9 10:44:09 2014 New Revision: 264296 URL: http://svnweb.freebsd.org/changeset/base/264296 Log: When splitting huge unmap requests, do it on sector boundary. Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Wed Apr 9 08:57:57 2014 (r264295) +++ head/sys/cam/ctl/ctl_backend_block.c Wed Apr 9 10:44:09 2014 (r264296) @@ -766,19 +766,21 @@ ctl_be_block_unmap_dev_range(struct ctl_ { struct bio *bio; struct ctl_be_block_devdata *dev_data; + uint64_t maxlen; dev_data = &be_lun->backend.dev; + maxlen = LONG_MAX - (LONG_MAX % be_lun->blocksize); while (len > 0) { bio = g_alloc_bio(); bio->bio_cmd = BIO_DELETE; bio->bio_flags |= beio->bio_flags; bio->bio_dev = dev_data->cdev; bio->bio_offset = off; - bio->bio_length = MIN(len, LONG_MAX); + bio->bio_length = MIN(len, maxlen); bio->bio_data = 0; bio->bio_done = ctl_be_block_biodone; bio->bio_caller1 = beio; - bio->bio_pblkno = beio->io_offset / be_lun->blocksize; + bio->bio_pblkno = off / be_lun->blocksize; off += bio->bio_length; len -= bio->bio_length; From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 10:58:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36B4BD64; Wed, 9 Apr 2014 10:58:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 170A71586; Wed, 9 Apr 2014 10:58:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s39Awqsw082829; Wed, 9 Apr 2014 10:58:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s39Awquc082826; Wed, 9 Apr 2014 10:58:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404091058.s39Awquc082826@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Apr 2014 10:58:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264297 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 10:58:53 -0000 Author: mav Date: Wed Apr 9 10:58:52 2014 New Revision: 264297 URL: http://svnweb.freebsd.org/changeset/base/264297 Log: Introduce new serialization type CTL_SERIDX_UNMAP. Unfortunately we can't check range collisions for UNMAP commands alike to writes, because they include multiple ranges, which are also passed in data block, not in CDB. As result, UNMAP commands have to be treated as colliding with any other command accessing the media. From the other side all UNMAPs are equal (we don't support ANCHOR flag), so we can execute several UNMAPs same time. Modified: head/sys/cam/ctl/ctl_cmd_table.c head/sys/cam/ctl/ctl_private.h head/sys/cam/ctl/ctl_ser_table.c Modified: head/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- head/sys/cam/ctl/ctl_cmd_table.c Wed Apr 9 10:44:09 2014 (r264296) +++ head/sys/cam/ctl/ctl_cmd_table.c Wed Apr 9 10:58:52 2014 (r264297) @@ -336,7 +336,7 @@ struct ctl_cmd_entry ctl_cmd_table[] = CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE}, /* 42 READ SUB-CHANNEL / UNMAP */ -{ctl_unmap, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_OUT, +{ctl_unmap, CTL_SERIDX_UNMAP, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_OUT, CTL_LUN_PAT_WRITE}, /* 43 READ TOC/PMA/ATIP */ Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Wed Apr 9 10:44:09 2014 (r264296) +++ head/sys/cam/ctl/ctl_private.h Wed Apr 9 10:58:52 2014 (r264297) @@ -156,6 +156,7 @@ typedef enum { CTL_SERIDX_TUR = 0, CTL_SERIDX_READ, CTL_SERIDX_WRITE, + CTL_SERIDX_UNMAP, CTL_SERIDX_MD_SNS, CTL_SERIDX_MD_SEL, CTL_SERIDX_RQ_SNS, Modified: head/sys/cam/ctl/ctl_ser_table.c ============================================================================== --- head/sys/cam/ctl/ctl_ser_table.c Wed Apr 9 10:44:09 2014 (r264296) +++ head/sys/cam/ctl/ctl_ser_table.c Wed Apr 9 10:58:52 2014 (r264297) @@ -60,22 +60,23 @@ static ctl_serialize_action ctl_serialize_table[CTL_SERIDX_COUNT][CTL_SERIDX_COUNT] = { -/**>IDX_ :: 2nd:TUR RD WRT MDSN MDSL RQSN INQ RDCP RES REL LSNS FMT STR PRIN PROT MAININ*/ -/*TUR */{ pS, pS, pS, bK, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, -/*READ */{ pS, pS, xT, bK, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, -/*WRITE */{ pS, xT, xT, bK, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, -/*MD_SNS */{ bK, bK, bK, pS, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, -/*MD_SEL */{ bK, bK, bK, bK, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, -/*RQ_SNS */{ pS, pS, pS, pS, pS, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, -/*INQ */{ pS, pS, pS, pS, pS, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, -/*RD_CAP */{ pS, pS, pS, pS, pS, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, -/*RESV */{ bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK}, -/*REL */{ bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK}, -/*LOG_SNS */{ pS, pS, pS, pS, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, -/*FORMAT */{ pS, bK, bK, bK, bK, pS, pS, bK, bK, bK, bK, bK, bK, bK, bK, bK}, -/*START */{ bK, bK, bK, bK, bK, bK, pS, bK, bK, bK, bK, bK, bK, bK, bK, bK}, -/*PRES_IN */{ bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK}, -/*PRES_OUT*/{ bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK}, -/*MAIN_IN */{ bK, bK, bK, bK, bK, bK, pS, bK, bK, bK, bK, bK, bK, bK, bK, pS} +/**>IDX_ :: 2nd:TUR RD WRT UNM MDSN MDSL RQSN INQ RDCP RES REL LSNS FMT STR PRIN PROT MAININ*/ +/*TUR */{ pS, pS, pS, pS, bK, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, +/*READ */{ pS, pS, xT, bK, bK, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, +/*WRITE */{ pS, xT, xT, bK, bK, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, +/*UNMAP */{ pS, bK, bK, pS, bK, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, +/*MD_SNS */{ bK, bK, bK, bK, pS, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, +/*MD_SEL */{ bK, bK, bK, bK, bK, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, +/*RQ_SNS */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, +/*INQ */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, +/*RD_CAP */{ pS, pS, pS, pS, pS, pS, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, +/*RESV */{ bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK}, +/*REL */{ bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK}, +/*LOG_SNS */{ pS, pS, pS, pS, pS, bK, bK, pS, pS, bK, bK, pS, bK, bK, bK, bK, bK}, +/*FORMAT */{ pS, bK, bK, bK, bK, bK, pS, pS, bK, bK, bK, bK, bK, bK, bK, bK, bK}, +/*START */{ bK, bK, bK, bK, bK, bK, bK, pS, bK, bK, bK, bK, bK, bK, bK, bK, bK}, +/*PRES_IN */{ bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK}, +/*PRES_OUT*/{ bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK, bK}, +/*MAIN_IN */{ bK, bK, bK, bK, bK, bK, bK, pS, bK, bK, bK, bK, bK, bK, bK, bK, pS} }; From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 14:01:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38B619CC; Wed, 9 Apr 2014 14:01:29 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id E9B4F1B4F; Wed, 9 Apr 2014 14:01:28 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 0E2F2630A; Wed, 9 Apr 2014 14:01:28 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 45A00226; Wed, 9 Apr 2014 16:01:28 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Bryan Drewery Subject: Re: svn commit: r264265 - in head: crypto/openssl/crypto/bn crypto/openssl/crypto/ec crypto/openssl/ssl sys/fs/nfsserver References: <201404081827.s38IRXiL048987@svn.freebsd.org> Date: Wed, 09 Apr 2014 16:01:28 +0200 In-Reply-To: (Bryan Drewery's message of "Tue, 08 Apr 2014 15:55:18 -0500") Message-ID: <86bnwa7gav.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI , secteam@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 14:01:29 -0000 Bryan Drewery writes: > Also, that this was a partial release of 1.0.1g is confusing a LOT of > users. They think they are still vulnerable. They expect to see 1.0.1g > in 'openssl version'. We could have our own version string in 'openssl > version' to remedy this. This is no different from what other OSes do, e.g. RHEL6.5: % cat /etc/redhat-release=20 Red Hat Enterprise Linux Workstation release 6.5 (Santiago) % openssl version OpenSSL 1.0.1e-fips 11 Feb 2013 % TZ=3DUTC rpm -qi openssl Name : openssl Relocations: (not relocatable) Version : 1.0.1e Vendor: Red Hat, Inc. Release : 16.el6_5.7 Build Date: Mon 07 Apr 2014 11:= 34:45 AM UTC Install Date: Tue 08 Apr 2014 05:18:52 AM UTC Build Host: x86-027.buil= d.eng.bos.redhat.com [...] which despite the version number and date is *not* vulnerable. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 14:19:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 777C64F1; Wed, 9 Apr 2014 14:19:32 +0000 (UTC) Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [IPv6:2607:f8b0:400e:c03::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B9031CE6; Wed, 9 Apr 2014 14:19:32 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id lf10so2583377pab.13 for ; Wed, 09 Apr 2014 07:19:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=lzOBzydKyGRoF/BSkq2aKztorH+dDgj1awxwEatE3D0=; b=xSHa68G6GeLgcF+ywe3szg7TtBaHBb7LdQ64fOj5Hfo1aP6N9wfsCwTfnW6uK3JhCH vj1IAKOq0qdAq3+RrS8EfQxIl54duNU/HLfFP8edDsMZvMDGHzpc+zc8JrrAT6URMVRK xXyR4CvZ5A5r459H+MGne62e5PFFX4ylCEV5MfEHLwH9TQ0ke0049plAjbHWwJZNo/Pm tJCKi9y43MQleX+r2Tpfm8AGp/dHE71W5K7cqUGRLxX3S+Ws732FMNX0//0DBnCoT3Em 3u05rmmkJT182BybySaGjRLH6GzTT93CZYv0Jg3S7dV6o0AAI7maHvS13KxvGorCqslI Pg/g== X-Received: by 10.69.8.225 with SMTP id dn1mr12534521pbd.46.1397053171774; Wed, 09 Apr 2014 07:19:31 -0700 (PDT) Received: from [192.168.1.7] (ppp59-167-128-11.static.internode.on.net. [59.167.128.11]) by mx.google.com with ESMTPSA id xk3sm2842434pbb.65.2014.04.09.07.19.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Apr 2014 07:19:31 -0700 (PDT) Message-ID: <534556EB.5080700@FreeBSD.org> Date: Thu, 10 Apr 2014 00:19:23 +1000 From: Kubilay Kocak User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Thunderbird/28.0 MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= , Bryan Drewery Subject: Re: svn commit: r264265 - in head: crypto/openssl/crypto/bn crypto/openssl/crypto/ec crypto/openssl/ssl sys/fs/nfsserver References: <201404081827.s38IRXiL048987@svn.freebsd.org> <86bnwa7gav.fsf@nine.des.no> In-Reply-To: <86bnwa7gav.fsf@nine.des.no> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI , secteam@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: koobs@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 14:19:32 -0000 On 10/04/2014 12:01 AM, Dag-Erling Smørgrav wrote: > Bryan Drewery writes: >> Also, that this was a partial release of 1.0.1g is confusing a LOT of >> users. They think they are still vulnerable. They expect to see 1.0.1g >> in 'openssl version'. We could have our own version string in 'openssl >> version' to remedy this. > > This is no different from what other OSes do, e.g. RHEL6.5: > > % cat /etc/redhat-release > Red Hat Enterprise Linux Workstation release 6.5 (Santiago) > % openssl version > OpenSSL 1.0.1e-fips 11 Feb 2013 > % TZ=UTC rpm -qi openssl > Name : openssl Relocations: (not relocatable) > Version : 1.0.1e Vendor: Red Hat, Inc. > Release : 16.el6_5.7 Build Date: Mon 07 Apr 2014 11:34:45 AM UTC > Install Date: Tue 08 Apr 2014 05:18:52 AM UTC Build Host: x86-027.build.eng.bos.redhat.com > [...] > > which despite the version number and date is *not* vulnerable. > > DES > More precisely, users expect *not* to see 1.0.1e That expectation is orthogonal to whether we or other projects do it one way or another. RHEL users may well be as confused as ours (whether of not ours are). It may be relevant as a data point, but not for decision making. Whether its just 1.0.1e, a full 1.0.1g, e+foo, or additional meta obviously matters, but it's not as important as distinguishing 'what we want' with how we're going to do it and why. I'll give it a crack: "Our users can quickly and clearly see and know, on the system, when a vendored library or piece of software in base is patched, or partially updated to account for bugs or security vulnerabilities in a supported version of FreeBSD" ./koobs From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 14:50:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA45771A; Wed, 9 Apr 2014 14:50:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B705911CF; Wed, 9 Apr 2014 14:50:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s39EotSG082385; Wed, 9 Apr 2014 14:50:55 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s39Eot5Q082384; Wed, 9 Apr 2014 14:50:55 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201404091450.s39Eot5Q082384@svn.freebsd.org> From: Tycho Nightingale Date: Wed, 9 Apr 2014 14:50:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264302 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 14:50:55 -0000 Author: tychon Date: Wed Apr 9 14:50:55 2014 New Revision: 264302 URL: http://svnweb.freebsd.org/changeset/base/264302 Log: Constrain the amount of data returned to what is actually available not the size of the buffer. Approved by: grehan (co-mentor) Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Wed Apr 9 13:35:52 2014 (r264301) +++ head/usr.sbin/bhyve/pci_ahci.c Wed Apr 9 14:50:55 2014 (r264302) @@ -543,12 +543,14 @@ write_prdt(struct ahci_port *p, int slot for (i = 0; i < hdr->prdtl && len; i++) { uint8_t *ptr; uint32_t dbcsz; + int sublen; dbcsz = (prdt->dbc & DBCMASK) + 1; ptr = paddr_guest2host(ahci_ctx(p->pr_sc), prdt->dba, dbcsz); - memcpy(ptr, from, dbcsz); - len -= dbcsz; - from += dbcsz; + sublen = len < dbcsz ? len : dbcsz; + memcpy(ptr, from, sublen); + len -= sublen; + from += sublen; prdt++; } hdr->prdbc = size - len; From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 16:08:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 641D0621; Wed, 9 Apr 2014 16:08:13 +0000 (UTC) Received: from ppsw-50.csi.cam.ac.uk (ppsw-50-v6.csi.cam.ac.uk [IPv6:2001:630:212:8::e:f50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BD741BCD; Wed, 9 Apr 2014 16:08:12 +0000 (UTC) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net ([82.26.1.52]:59678 helo=[192.168.0.100]) by ppsw-50.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.158]:25) with esmtpsa (PLAIN:dc552) (TLSv1:AES128-SHA:128) id 1WXv2o-0005ER-rQ (Exim 4.82_3-c0e5623) (return-path ); Wed, 09 Apr 2014 17:08:10 +0100 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264265 - in head: crypto/openssl/crypto/bn crypto/openssl/crypto/ec crypto/openssl/ssl sys/fs/nfsserver From: David Chisnall In-Reply-To: <534556EB.5080700@FreeBSD.org> Date: Wed, 9 Apr 2014 17:08:09 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <323CC215-6DA6-4C8F-A5DA-72C3CB76566A@cl.cam.ac.uk> References: <201404081827.s38IRXiL048987@svn.freebsd.org> <86bnwa7gav.fsf@nine.des.no> <534556EB.5080700@FreeBSD.org> To: koobs@FreeBSD.org, Kubilay Kocak X-Mailer: Apple Mail (2.1874) Sender: "Dr D. Chisnall" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Bryan Drewery , Xin LI , secteam@FreeBSD.org, svn-src-head@freebsd.org, =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 16:08:13 -0000 On 9 Apr 2014, at 15:19, Kubilay Kocak wrote: > That expectation is orthogonal to whether we or other projects do it = one > way or another. RHEL users may well be as confused as ours (whether of > not ours are). It may be relevant as a data point, but not for = decision > making. I can confirm that, as a user (albeit a slightly sleep-deprived one at = the time) I was confused. I believe that I'm now running the correct = version, as my libssl.so has a creation date of yesterday, but I don't = have a good way of verifying it. It would be great for future security advisories to have a 'how to tell = if you're affected' and 'how to tell if you're patched' section. I noticed that freebsd-update told me (after the fetch phase) that I = should rebuild all third-party software. I have been following the = instructions that we give to users and not building most software on = that machine myself. I don't know if there are any packages that = statically link to libssl.a (or even if we have a mechanism for = determining that), but I'd hope that these would get separate VuXML = reports for pkg audit to pick up. =20 David From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 17:21:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 055CF1FB; Wed, 9 Apr 2014 17:21:07 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0CBA1527; Wed, 9 Apr 2014 17:21:06 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C1CC9B924; Wed, 9 Apr 2014 13:21:05 -0400 (EDT) From: John Baldwin To: Sean Bruno Subject: Re: svn commit: r264280 - in head/sys: conf modules Date: Wed, 9 Apr 2014 11:47:08 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201404082139.s38LdqbY028535@svn.freebsd.org> In-Reply-To: <201404082139.s38LdqbY028535@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201404091147.08716.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 09 Apr 2014 13:21:05 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 17:21:07 -0000 On Tuesday, April 08, 2014 5:39:52 pm Sean Bruno wrote: > Author: sbruno > Date: Tue Apr 8 21:39:51 2014 > New Revision: 264280 > URL: http://svnweb.freebsd.org/changeset/base/264280 > > Log: > Actually, since this is what I thought I was doing, only allow the > binmisc code to be build on amd64/i386 for the kernel. > > Update NOTES with some indication of what this code is used for. > > Pointed out by jhb@ ... thanks! > > Submitted by: jhb@ > > Modified: > head/sys/conf/NOTES > head/sys/conf/options.amd64 > head/sys/conf/options.i386 > head/sys/modules/Makefile Why not enable it on all platforms? I don't see anything inherently MD about it. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 17:23:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7ED82665; Wed, 9 Apr 2014 17:23:47 +0000 (UTC) Received: from mail.ignoranthack.me (ujvl.x.rootbsd.net [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5621B1577; Wed, 9 Apr 2014 17:23:46 +0000 (UTC) Received: from [192.168.1.104] (c-24-6-177-88.hsd1.ca.comcast.net [24.6.177.88]) (using SSLv3 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 845391929A9; Wed, 9 Apr 2014 17:23:44 +0000 (UTC) Subject: Re: svn commit: r264269 - in head: sys/conf sys/kern sys/modules sys/modules/imgact_binmisc sys/sys usr.sbin usr.sbin/binmiscctl From: Sean Bruno To: Alexey Dokuchaev In-Reply-To: <20140409074458.GB27075@FreeBSD.org> References: <201404082010.s38KAMgg091287@svn.freebsd.org> <201404081625.23418.jhb@freebsd.org> <1396994509.2018.12.camel@powernoodle.corp.yahoo.com> <20140409074458.GB27075@FreeBSD.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-m8AtzhUARLQPDFKWKXEu" Date: Wed, 09 Apr 2014 10:23:43 -0700 Message-ID: <1397064223.1121.3.camel@powernoodle.corp.yahoo.com> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port X-Mailman-Approved-At: Wed, 09 Apr 2014 17:28:40 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: sbruno@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 17:23:47 -0000 --=-m8AtzhUARLQPDFKWKXEu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2014-04-09 at 07:44 +0000, Alexey Dokuchaev wrote: > On Tue, Apr 08, 2014 at 03:01:49PM -0700, Sean Bruno wrote: > > I haven't tested on non-x86 h/w and have no idea if it works or not. I > > didn't feel comfortable building this driver in the non-x86 case. If > > there is a use case/tester for the other arch's, I'll be more than happ= y > > to change this. >=20 > I'd like to test it on PowerPC. Is there quick start guide available wit= h > some examples of usage? >=20 > ./danfe >=20 Yeah, most of sson's work is documented on the twiki here: https://wiki.freebsd.org/QemuUserModeHowTo At this point, you can use emulators/qemu-devel from ports as it has all the bsd-user land bits in it (thanks to nox). However, each emulated architecture needs someone to spend time on the qemu bits to make it work. For example, the mips32 emulation that has been worked on for since AsiaBSDCon, needed contributions from people(emaste, peter, nox) in the project to get working. sean --=-m8AtzhUARLQPDFKWKXEu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJTRYIPAAoJEBkJRdwI6BaHqdQH/A0E43Z2zLqV3ByEs+0Zpfxk 38dMwbmPoFYNkXjfMDZOfmdzC67Sc1nWXf9l+Q0Oz8iZjzxc/7VJpwH0o3BX3Drh pHMc0f0faQTqpcNGhdd5MmzdQIqE1pktjVNQ5KnhOi75TKusC9ydAmmz5FuEuZwO o1dIluhRRtP30D6x+cb7h1v2FN7ylOBUq9uWFcM1BrM5Rl9y1KsI2l02L5YEDRtQ pg8MARBbFAc6ULm4u+8QP3ceBzG0FshlTPtIBzsXjPdaXfnGzx5CjqDTKu7DThuY Q83MNLuKeFX66neRFqGKIvr15Zv7CNSxGoBhbTi7h8fU1kg+N5SCNspglQlu5fo= =LXJN -----END PGP SIGNATURE----- --=-m8AtzhUARLQPDFKWKXEu-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 17:25:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBF3085F; Wed, 9 Apr 2014 17:25:33 +0000 (UTC) Received: from mail.ignoranthack.me (ujvl.x.rootbsd.net [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B50CA158C; Wed, 9 Apr 2014 17:25:33 +0000 (UTC) Received: from [192.168.1.104] (c-24-6-177-88.hsd1.ca.comcast.net [24.6.177.88]) (using SSLv3 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id CB1811929A9; Wed, 9 Apr 2014 17:25:32 +0000 (UTC) Subject: Re: svn commit: r264269 - in head: sys/conf sys/kern sys/modules sys/modules/imgact_binmisc sys/sys usr.sbin usr.sbin/binmiscctl From: Sean Bruno To: Mathieu Arnold In-Reply-To: References: <201404082010.s38KAMgg091287@svn.freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-4afWSK8k8MXIXHVr+vui" Date: Wed, 09 Apr 2014 10:25:32 -0700 Message-ID: <1397064332.1121.4.camel@powernoodle.corp.yahoo.com> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port X-Mailman-Approved-At: Wed, 09 Apr 2014 17:29:10 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: sbruno@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 17:25:33 -0000 --=-4afWSK8k8MXIXHVr+vui Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2014-04-09 at 09:27 +0200, Mathieu Arnold wrote: > +--On 8 avril 2014 20:10:22 +0000 Sean Bruno wrote: > | Log: > | Add Stacey Son's binary activation patches that allow remapping of > | execution to a emumation program via parsing of ELF header informatio= n. >=20 > Can you MFC that to stable/10 one day ? >=20 We can, yes. I'd like to have a discussion about an MFC first, probably BSDCan, before we do that however. sean --=-4afWSK8k8MXIXHVr+vui Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJTRYKLAAoJEBkJRdwI6BaHFQ4H/3WjZVte8HS59ugzvrXcDKS8 w2rC7kkMPY7H4sCqmh2VakIt/BuwL+1iosTtmJY6aO0DHfQ5kQwEY3NfVfxeGFK8 2MBcgZzZGoX29gRMj4mzTyEme10KGKN6YcbhDTwy49UOJHZyOmh/hkSegiyHZBAL Xe3skBRVIklE/uFDBHR+qpPYOBtRdbPi5+Fw7ceSNpyZPp9koPWYFfs0xawz2gFG gUv3CF5tlW65RXznbcMTC91MGfKwehaETJxx6h6f5IpB2whBhWBBIDyXOBaxpgjT V1J2VJ2LR7/x1c0vtGAqEaiVB7cgbIa4NlJJ6+sIRKf9ill5/BbbJUmq2IFWmME= =Ejs1 -----END PGP SIGNATURE----- --=-4afWSK8k8MXIXHVr+vui-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 17:39:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D06E4FB6; Wed, 9 Apr 2014 17:39:20 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 8845016D4; Wed, 9 Apr 2014 17:39:20 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 8933A6F9D; Wed, 9 Apr 2014 17:39:19 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id CB7373F0; Wed, 9 Apr 2014 19:39:19 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: David Chisnall Subject: Re: svn commit: r264265 - in head: crypto/openssl/crypto/bn crypto/openssl/crypto/ec crypto/openssl/ssl sys/fs/nfsserver References: <201404081827.s38IRXiL048987@svn.freebsd.org> <86bnwa7gav.fsf@nine.des.no> <534556EB.5080700@FreeBSD.org> <323CC215-6DA6-4C8F-A5DA-72C3CB76566A@cl.cam.ac.uk> Date: Wed, 09 Apr 2014 19:39:19 +0200 In-Reply-To: <323CC215-6DA6-4C8F-A5DA-72C3CB76566A@cl.cam.ac.uk> (David Chisnall's message of "Wed, 9 Apr 2014 17:08:09 +0100") Message-ID: <8638hm1jy0.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, koobs@FreeBSD.org, svn-src-all@freebsd.org, Bryan Drewery , Xin LI , secteam@FreeBSD.org, Kubilay Kocak , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 17:39:20 -0000 David Chisnall writes: > I noticed that freebsd-update told me (after the fetch phase) that I > should rebuild all third-party software. This is boilerplate, just like the section in the advisory that tells you to make buildworld && make installworld when in fact all you have to do is make && make install in a single directory (which was not the case here, but was certainly the case for SA-13:14, SA-14:01 and SA-14:02 as well as EN-13:04 and EN-13:05, to pick a few recent examples). > I don't know if there are any packages that statically link to > libssl.a It seems like a fundamentally dumb thing to do, but you never know... > (or even if we have a mechanism for determining that), You can try grepping the binaries. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 17:45:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 853AC2DE; Wed, 9 Apr 2014 17:45:07 +0000 (UTC) Received: from mail.ignoranthack.me (ujvl.x.rootbsd.net [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EE411783; Wed, 9 Apr 2014 17:45:06 +0000 (UTC) Received: from [192.168.1.104] (c-24-6-177-88.hsd1.ca.comcast.net [24.6.177.88]) (using SSLv3 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id C954F1929A9; Wed, 9 Apr 2014 17:45:05 +0000 (UTC) Subject: Re: svn commit: r264280 - in head/sys: conf modules From: Sean Bruno To: John Baldwin In-Reply-To: <201404091147.08716.jhb@freebsd.org> References: <201404082139.s38LdqbY028535@svn.freebsd.org> <201404091147.08716.jhb@freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-DX/uh9McagrwChzuF1r7" Date: Wed, 09 Apr 2014 10:45:04 -0700 Message-ID: <1397065504.1121.6.camel@powernoodle.corp.yahoo.com> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: sbruno@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 17:45:07 -0000 --=-DX/uh9McagrwChzuF1r7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2014-04-09 at 11:47 -0400, John Baldwin wrote: > On Tuesday, April 08, 2014 5:39:52 pm Sean Bruno wrote: > > Author: sbruno > > Date: Tue Apr 8 21:39:51 2014 > > New Revision: 264280 > > URL: http://svnweb.freebsd.org/changeset/base/264280 > >=20 > > Log: > > Actually, since this is what I thought I was doing, only allow the > > binmisc code to be build on amd64/i386 for the kernel. > > =20 > > Update NOTES with some indication of what this code is used for. > > =20 > > Pointed out by jhb@ ... thanks! > > =20 > > Submitted by: jhb@ > >=20 > > Modified: > > head/sys/conf/NOTES > > head/sys/conf/options.amd64 > > head/sys/conf/options.i386 > > head/sys/modules/Makefile >=20 > Why not enable it on all platforms? I don't see anything inherently > MD about it. >=20 This is purely an artifact of my comfort level with the code and the cases that I am using/testing. If someone can verify that it works on other architectures, I'm more than happy to enable on all platforms. sean --=-DX/uh9McagrwChzuF1r7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJTRYcgAAoJEBkJRdwI6BaHT1gH/3LL7R7B5vIZ3QOopsFkuMK5 Zp3lQQQlInPSawCRDIVSWtb27mC2HemmjsVTvGhxYRN9Y4SftgwYIDIqXB3sP9n2 DHb0O2pqSBxEOLV9Rp+/D4qG81S8ZbIovMf6YV1AO6nrgP1O83dr66p663ceLEnK C0vivFw5XZGseJiKqP5PlH1d+3gBn7RUYl9I5s2UqRucFZ856P5Jj3GprCFy+S45 A7fX6B8pESRplDhi1cAZUM+SgZ+e2LrtRemnT6Wz1cuAC83CQoE+aJXC2TqgSnD5 /aeT90NnwYGlRr2J9HGtnJqTYf266yddzHv/rZFtXkpn4Q7BfbP5qs+3msona7E= =iHBp -----END PGP SIGNATURE----- --=-DX/uh9McagrwChzuF1r7-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 18:07:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3025262 for ; Wed, 9 Apr 2014 18:07:35 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD7421A5C for ; Wed, 9 Apr 2014 18:07:35 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s39I7Zh1085150 for ; Wed, 9 Apr 2014 18:07:35 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s39I7ZMT085149 for svn-src-head@freebsd.org; Wed, 9 Apr 2014 18:07:35 GMT (envelope-from bdrewery) Received: (qmail 74556 invoked from network); 9 Apr 2014 13:07:26 -0500 Received: from unknown (HELO roundcube.xk42.net) (10.10.5.5) by sweb.xzibition.com with SMTP; 9 Apr 2014 13:07:26 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Wed, 09 Apr 2014 13:07:26 -0500 From: Bryan Drewery To: =?UTF-8?Q?Dag-Erling_Sm=C3=B8rgrav?= Subject: Re: svn commit: r264265 - in head: crypto/openssl/crypto/bn crypto/openssl/crypto/ec crypto/openssl/ssl sys/fs/nfsserver Organization: FreeBSD In-Reply-To: <86bnwa7gav.fsf@nine.des.no> References: <201404081827.s38IRXiL048987@svn.freebsd.org> <86bnwa7gav.fsf@nine.des.no> Message-ID: <8a794955e9b58cba3f1712f235fdd9e8@shatow.net> X-Sender: bdrewery@FreeBSD.org User-Agent: Roundcube Webmail/0.9.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI , secteam@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 18:07:36 -0000 On 2014-04-09 09:01, Dag-Erling Smørgrav wrote: > Bryan Drewery writes: >> Also, that this was a partial release of 1.0.1g is confusing a LOT of >> users. They think they are still vulnerable. They expect to see 1.0.1g >> in 'openssl version'. We could have our own version string in 'openssl >> version' to remedy this. > > This is no different from what other OSes do, e.g. RHEL6.5: > > % cat /etc/redhat-release > Red Hat Enterprise Linux Workstation release 6.5 (Santiago) > % openssl version > OpenSSL 1.0.1e-fips 11 Feb 2013 > % TZ=UTC rpm -qi openssl > Name : openssl Relocations: (not > relocatable) > Version : 1.0.1e Vendor: Red Hat, Inc. > Release : 16.el6_5.7 Build Date: Mon 07 Apr > 2014 11:34:45 AM UTC > Install Date: Tue 08 Apr 2014 05:18:52 AM UTC Build Host: > x86-027.build.eng.bos.redhat.com > [...] > > which despite the version number and date is *not* vulnerable. > > DES Yes you're right. We're not those projects though. And just because we have "always" done something a certain way does not mean we must forever. We released 2/3 of 1.0.1g to 10, 1/3 of it to previous releases. I do recognize it was not officially 'g'. I am just giving feedback from many confused users. Many of which were just as confused on Debian and CentOS as well. I often think we forget the average user's perspective. -- Regards, Bryan Drewery From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 18:30:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA3CA3B4; Wed, 9 Apr 2014 18:30:52 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1DB81CDF; Wed, 9 Apr 2014 18:30:52 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 961A4B965; Wed, 9 Apr 2014 14:30:51 -0400 (EDT) From: John Baldwin To: sbruno@freebsd.org Subject: Re: svn commit: r264280 - in head/sys: conf modules Date: Wed, 9 Apr 2014 14:30:43 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201404082139.s38LdqbY028535@svn.freebsd.org> <201404091147.08716.jhb@freebsd.org> <1397065504.1121.6.camel@powernoodle.corp.yahoo.com> In-Reply-To: <1397065504.1121.6.camel@powernoodle.corp.yahoo.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201404091430.43469.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 09 Apr 2014 14:30:51 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 18:30:52 -0000 On Wednesday, April 09, 2014 1:45:04 pm Sean Bruno wrote: > On Wed, 2014-04-09 at 11:47 -0400, John Baldwin wrote: > > On Tuesday, April 08, 2014 5:39:52 pm Sean Bruno wrote: > > > Author: sbruno > > > Date: Tue Apr 8 21:39:51 2014 > > > New Revision: 264280 > > > URL: http://svnweb.freebsd.org/changeset/base/264280 > > > > > > Log: > > > Actually, since this is what I thought I was doing, only allow the > > > binmisc code to be build on amd64/i386 for the kernel. > > > > > > Update NOTES with some indication of what this code is used for. > > > > > > Pointed out by jhb@ ... thanks! > > > > > > Submitted by: jhb@ > > > > > > Modified: > > > head/sys/conf/NOTES > > > head/sys/conf/options.amd64 > > > head/sys/conf/options.i386 > > > head/sys/modules/Makefile > > > > Why not enable it on all platforms? I don't see anything inherently > > MD about it. > > > > > This is purely an artifact of my comfort level with the code and the > cases that I am using/testing. > > If someone can verify that it works on other architectures, I'm more > than happy to enable on all platforms. Does it build on other platforms? I think it is better to enable it if it builds to avoid bitrot. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 18:37:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C7438C1; Wed, 9 Apr 2014 18:37:34 +0000 (UTC) Received: from mail.ignoranthack.me (ujvl.x.rootbsd.net [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 244891DB6; Wed, 9 Apr 2014 18:37:33 +0000 (UTC) Received: from [192.168.1.104] (c-24-6-177-88.hsd1.ca.comcast.net [24.6.177.88]) (using SSLv3 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 590271929A9; Wed, 9 Apr 2014 18:37:32 +0000 (UTC) Subject: Re: svn commit: r264280 - in head/sys: conf modules From: Sean Bruno To: John Baldwin In-Reply-To: <201404091430.43469.jhb@freebsd.org> References: <201404082139.s38LdqbY028535@svn.freebsd.org> <201404091147.08716.jhb@freebsd.org> <1397065504.1121.6.camel@powernoodle.corp.yahoo.com> <201404091430.43469.jhb@freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-BouWE21Qm1oMmFFJONMr" Date: Wed, 09 Apr 2014 11:37:31 -0700 Message-ID: <1397068651.1121.8.camel@powernoodle.corp.yahoo.com> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: sbruno@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 18:37:34 -0000 --=-BouWE21Qm1oMmFFJONMr Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2014-04-09 at 14:30 -0400, John Baldwin wrote: > On Wednesday, April 09, 2014 1:45:04 pm Sean Bruno wrote: > > On Wed, 2014-04-09 at 11:47 -0400, John Baldwin wrote: > > > On Tuesday, April 08, 2014 5:39:52 pm Sean Bruno wrote: > > > > Author: sbruno > > > > Date: Tue Apr 8 21:39:51 2014 > > > > New Revision: 264280 > > > > URL: http://svnweb.freebsd.org/changeset/base/264280 > > > >=20 > > > > Log: > > > > Actually, since this is what I thought I was doing, only allow th= e > > > > binmisc code to be build on amd64/i386 for the kernel. > > > > =20 > > > > Update NOTES with some indication of what this code is used for. > > > > =20 > > > > Pointed out by jhb@ ... thanks! > > > > =20 > > > > Submitted by: jhb@ > > > >=20 > > > > Modified: > > > > head/sys/conf/NOTES > > > > head/sys/conf/options.amd64 > > > > head/sys/conf/options.i386 > > > > head/sys/modules/Makefile > > >=20 > > > Why not enable it on all platforms? I don't see anything inherently > > > MD about it. > > >=20 > >=20 > >=20 > > This is purely an artifact of my comfort level with the code and the > > cases that I am using/testing. > >=20 > > If someone can verify that it works on other architectures, I'm more > > than happy to enable on all platforms. >=20 > Does it build on other platforms? I think it is better to enable it if > it builds to avoid bitrot. >=20 Untested. I agree that its better, I just haven't done it. I think this was a protective measure on my part to not inflict more work upon myself as I was already slight agitated at how long it took to get to the point of getting mips32 support implemented via qemu. =20 sean --=-BouWE21Qm1oMmFFJONMr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJTRZNrAAoJEBkJRdwI6BaHAvkH/Ra0u88BVM4NNG9r/90beN+R mjvUZ+Txmi+jqR4j8+EQf7+32JXpoDzpIAjWM4Y3w08KZBg5MjOenl5XJLZAwtZi 65SWXzX/xFVIxiKoXCv5b3gXpIejAypLC6jsK8mKOte3i9mwmQs4Nn6hpyrts7Ju jSYP2jQEHSVe8CXUPktMDP/z9Y5dGMrD8nux8hb9GbRcEqU1aJEaxvdDGflpj5j+ +TfLOzKoDWPCfFYkvNpfRCoyqntj/38S8dFTMifKIoF6DFU9jHzcNXaIimeFUjkj 9U6gx2pMN9ozJKpaYYvRfIqwVPwWHHKNxvRIGR5sxgCuInnRy3Ktpo3jhe9sNnQ= =k5yx -----END PGP SIGNATURE----- --=-BouWE21Qm1oMmFFJONMr-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 18:44:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A28CAD4A; Wed, 9 Apr 2014 18:44:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EC481FF6; Wed, 9 Apr 2014 18:44:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s39Iit1T079863; Wed, 9 Apr 2014 18:44:55 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s39Iit8Y079860; Wed, 9 Apr 2014 18:44:55 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201404091844.s39Iit8Y079860@svn.freebsd.org> From: Sean Bruno Date: Wed, 9 Apr 2014 18:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264304 - in head/sys: amd64/conf conf i386/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 18:44:55 -0000 Author: sbruno Date: Wed Apr 9 18:44:54 2014 New Revision: 264304 URL: http://svnweb.freebsd.org/changeset/base/264304 Log: Really, really, really only allow this option for amd64/i386 builds. Submitted by: imp@ and tinderbox Modified: head/sys/amd64/conf/NOTES head/sys/conf/NOTES head/sys/i386/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Wed Apr 9 18:16:58 2014 (r264303) +++ head/sys/amd64/conf/NOTES Wed Apr 9 18:44:54 2014 (r264304) @@ -649,3 +649,6 @@ device ndis # Linux-specific pseudo devices support device lindev + +# Module to enable execution of application via emulators like QEMU +options IMAGACT_BINMISC Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Apr 9 18:16:58 2014 (r264303) +++ head/sys/conf/NOTES Wed Apr 9 18:44:54 2014 (r264304) @@ -2963,6 +2963,3 @@ options RANDOM_YARROW # Yarrow RNG ##options RANDOM_FORTUNA # Fortuna RNG - not yet implemented options RANDOM_DEBUG # Debugging messages options RANDOM_RWFILE # Read and write entropy cache - -# Module to enable execution of application via emulators like QEMU -options IMAGACT_BINMISC Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Wed Apr 9 18:16:58 2014 (r264303) +++ head/sys/i386/conf/NOTES Wed Apr 9 18:44:54 2014 (r264304) @@ -1059,3 +1059,6 @@ options VM_KMEM_SIZE_SCALE # asr old ioctls support, needed by raidutils options ASR_COMPAT + +# Module to enable execution of application via emulators like QEMU +options IMAGACT_BINMISC From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 19:16:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 357B915C; Wed, 9 Apr 2014 19:16:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22D0A134C; Wed, 9 Apr 2014 19:16:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s39JGf0r092733; Wed, 9 Apr 2014 19:16:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s39JGedV092732; Wed, 9 Apr 2014 19:16:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404091916.s39JGedV092732@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Apr 2014 19:16:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264307 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 19:16:41 -0000 Author: mav Date: Wed Apr 9 19:16:40 2014 New Revision: 264307 URL: http://svnweb.freebsd.org/changeset/base/264307 Log: Fix three refcounter leaks and lock recursion they covered. MFC after: 1 week Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Apr 9 19:01:48 2014 (r264306) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Apr 9 19:16:40 2014 (r264307) @@ -1455,6 +1455,7 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * mtx_unlock(&cfiscsi_softc.lock); snprintf(ci->error_str, sizeof(ci->error_str), "connection not found"); ci->status = CTL_ISCSI_ERROR; + cfiscsi_target_release(ct); return; } mtx_unlock(&cfiscsi_softc.lock); @@ -2093,15 +2094,9 @@ cfiscsi_target_hold(struct cfiscsi_targe static void cfiscsi_target_release(struct cfiscsi_target *ct) { - int old; struct cfiscsi_softc *softc; softc = ct->ct_softc; - - old = ct->ct_refcount; - if (old > 1 && atomic_cmpset_int(&ct->ct_refcount, old, old - 1)) - return; - mtx_lock(&softc->lock); if (refcount_release(&ct->ct_refcount)) { TAILQ_REMOVE(&softc->targets, ct, ct_next); @@ -2278,6 +2273,7 @@ cfiscsi_lun_enable(void *arg, struct ctl tmp = strtoul(lun, NULL, 10); cfiscsi_target_set_lun(ct, tmp, lun_id); + cfiscsi_target_release(ct); return (0); } @@ -2297,8 +2293,9 @@ cfiscsi_lun_disable(void *arg, struct ct continue; if (ct->ct_luns[i] != lun_id) continue; + mtx_unlock(&softc->lock); cfiscsi_target_unset_lun(ct, i); - break; + return (0); } } mtx_unlock(&softc->lock); From owner-svn-src-head@FreeBSD.ORG Wed Apr 9 20:42:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0156632; Wed, 9 Apr 2014 20:42:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDDAB1CC7; Wed, 9 Apr 2014 20:42:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s39Kg0B9029339; Wed, 9 Apr 2014 20:42:00 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s39Kg02q029338; Wed, 9 Apr 2014 20:42:00 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201404092042.s39Kg02q029338@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 9 Apr 2014 20:42:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264308 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2014 20:42:00 -0000 Author: des Date: Wed Apr 9 20:42:00 2014 New Revision: 264308 URL: http://svnweb.freebsd.org/changeset/base/264308 Log: Restore the pX part to the version number printed in debugging mode. Modified: head/crypto/openssh/ssh.c Modified: head/crypto/openssh/ssh.c ============================================================================== --- head/crypto/openssh/ssh.c Wed Apr 9 19:16:40 2014 (r264307) +++ head/crypto/openssh/ssh.c Wed Apr 9 20:42:00 2014 (r264308) @@ -895,7 +895,7 @@ main(int ac, char **av) SYSLOG_FACILITY_USER, !use_syslog); if (debug_flag) - logit("%s, %s", SSH_VERSION, SSLeay_version(SSLEAY_VERSION)); + logit("%s, %s", SSH_RELEASE, SSLeay_version(SSLEAY_VERSION)); /* Parse the configuration files */ process_config_files(pw); From owner-svn-src-head@FreeBSD.ORG Thu Apr 10 02:30:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0235DD0; Thu, 10 Apr 2014 02:30:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1C661210; Thu, 10 Apr 2014 02:30:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3A2UpEU073349; Thu, 10 Apr 2014 02:30:51 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3A2Up7u073320; Thu, 10 Apr 2014 02:30:51 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201404100230.s3A2Up7u073320@svn.freebsd.org> From: David Xu Date: Thu, 10 Apr 2014 02:30:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264310 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 02:30:51 -0000 Author: davidxu Date: Thu Apr 10 02:30:51 2014 New Revision: 264310 URL: http://svnweb.freebsd.org/changeset/base/264310 Log: Add kqueue support for devctl. Reviewed by: kib,mjg Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Wed Apr 9 21:19:46 2014 (r264309) +++ head/sys/kern/subr_bus.c Thu Apr 10 02:30:51 2014 (r264310) @@ -367,6 +367,7 @@ static d_close_t devclose; static d_read_t devread; static d_ioctl_t devioctl; static d_poll_t devpoll; +static d_kqfilter_t devkqfilter; static struct cdevsw dev_cdevsw = { .d_version = D_VERSION, @@ -375,6 +376,7 @@ static struct cdevsw dev_cdevsw = { .d_read = devread, .d_ioctl = devioctl, .d_poll = devpoll, + .d_kqfilter = devkqfilter, .d_name = "devctl", }; @@ -399,6 +401,15 @@ static struct dev_softc struct sigio *sigio; } devsoftc; +static void filt_devctl_detach(struct knote *kn); +static int filt_devctl_read(struct knote *kn, long hint); + +struct filterops devctl_rfiltops = { + .f_isfd = 1, + .f_detach = filt_devctl_detach, + .f_event = filt_devctl_read, +}; + static struct cdev *devctl_dev; static void @@ -409,6 +420,7 @@ devinit(void) mtx_init(&devsoftc.mtx, "dev mtx", "devd", MTX_DEF); cv_init(&devsoftc.cv, "dev cv"); TAILQ_INIT(&devsoftc.devq); + knlist_init_mtx(&devsoftc.sel.si_note, &devsoftc.mtx); } static int @@ -529,6 +541,34 @@ devpoll(struct cdev *dev, int events, st return (revents); } +static int +devkqfilter(struct cdev *dev, struct knote *kn) +{ + int error; + + if (kn->kn_filter == EVFILT_READ) { + kn->kn_fop = &devctl_rfiltops; + knlist_add(&devsoftc.sel.si_note, kn, 0); + error = 0; + } else + error = EINVAL; + return (error); +} + +static void +filt_devctl_detach(struct knote *kn) +{ + + knlist_remove(&devsoftc.sel.si_note, kn, 0); +} + +static int +filt_devctl_read(struct knote *kn, long hint) +{ + kn->kn_data = devsoftc.queued; + return (kn->kn_data != 0); +} + /** * @brief Return whether the userland process is running */ @@ -576,6 +616,7 @@ devctl_queue_data_f(char *data, int flag TAILQ_INSERT_TAIL(&devsoftc.devq, n1, dei_link); devsoftc.queued++; cv_broadcast(&devsoftc.cv); + KNOTE_LOCKED(&devsoftc.sel.si_note, 0); mtx_unlock(&devsoftc.mtx); selwakeup(&devsoftc.sel); if (devsoftc.async && devsoftc.sigio != NULL) From owner-svn-src-head@FreeBSD.ORG Thu Apr 10 05:04:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B06A8E9; Thu, 10 Apr 2014 05:04:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 888CD10ED; Thu, 10 Apr 2014 05:04:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3A54N8B038724; Thu, 10 Apr 2014 05:04:23 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3A54N0d038723; Thu, 10 Apr 2014 05:04:23 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201404100504.s3A54N0d038723@svn.freebsd.org> From: Steven Hartland Date: Thu, 10 Apr 2014 05:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264311 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 05:04:23 -0000 Author: smh Date: Thu Apr 10 05:04:23 2014 New Revision: 264311 URL: http://svnweb.freebsd.org/changeset/base/264311 Log: Fix build breakage caused by r264295 X-MFC-With: r264295 MFC after: 1 week Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Thu Apr 10 02:30:51 2014 (r264310) +++ head/sys/cam/scsi/scsi_cd.c Thu Apr 10 05:04:23 2014 (r264311) @@ -205,8 +205,6 @@ static periph_oninv_t cdoninvalidate; static void cdasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg); static int cdcmdsizesysctl(SYSCTL_HANDLER_ARGS); -static void cdshorttimeout(void *arg); -static void cdschedule(struct cam_periph *periph, int priority); static int cdrunccb(union ccb *ccb, int (*error_routine)(union ccb *ccb, u_int32_t cam_flags, From owner-svn-src-head@FreeBSD.ORG Thu Apr 10 10:12:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6294DDE1; Thu, 10 Apr 2014 10:12:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F8F61DC3; Thu, 10 Apr 2014 10:12:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3AACvHv067243; Thu, 10 Apr 2014 10:12:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3AACvD7067242; Thu, 10 Apr 2014 10:12:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404101012.s3AACvD7067242@svn.freebsd.org> From: Alexander Motin Date: Thu, 10 Apr 2014 10:12:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264313 - head/sys/geom/stripe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 10:12:57 -0000 Author: mav Date: Thu Apr 10 10:12:56 2014 New Revision: 264313 URL: http://svnweb.freebsd.org/changeset/base/264313 Log: Do not increment bio_data in case of BIO_DELETE. This fixes KASSERT() panic in g_io_request(). Modified: head/sys/geom/stripe/g_stripe.c Modified: head/sys/geom/stripe/g_stripe.c ============================================================================== --- head/sys/geom/stripe/g_stripe.c Thu Apr 10 07:00:24 2014 (r264312) +++ head/sys/geom/stripe/g_stripe.c Thu Apr 10 10:12:56 2014 (r264313) @@ -472,9 +472,10 @@ g_stripe_start_economic(struct bio *bp, /* offset -= offset % stripesize; */ offset -= offset & (stripesize - 1); - addr += length; + if (bp->bio_cmd != BIO_DELETE) + addr += length; length = bp->bio_length - length; - for (no++; length > 0; no++, length -= stripesize, addr += stripesize) { + for (no++; length > 0; no++, length -= stripesize) { if (no > sc->sc_ndisks - 1) { no = 0; offset += stripesize; @@ -506,6 +507,9 @@ g_stripe_start_economic(struct bio *bp, cbp->bio_data = addr; cbp->bio_caller2 = sc->sc_disks[no]; + + if (bp->bio_cmd != BIO_DELETE) + addr += stripesize; } /* * Fire off all allocated requests! @@ -632,10 +636,13 @@ g_stripe_start(struct bio *bp) * a provider, so there is nothing to optmize. * and * 4. Request is not unmapped. + * and + * 5. It is not a BIO_DELETE. */ if (g_stripe_fast && bp->bio_length <= MAXPHYS && bp->bio_length >= stripesize * sc->sc_ndisks && - (bp->bio_flags & BIO_UNMAPPED) == 0) { + (bp->bio_flags & BIO_UNMAPPED) == 0 && + bp->bio_cmd != BIO_DELETE) { fast = 1; } error = 0; From owner-svn-src-head@FreeBSD.ORG Thu Apr 10 10:18:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A81F51DF; Thu, 10 Apr 2014 10:18:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93FF91E57; Thu, 10 Apr 2014 10:18:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3AAIU3G067909; Thu, 10 Apr 2014 10:18:30 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3AAIUEX067908; Thu, 10 Apr 2014 10:18:30 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404101018.s3AAIUEX067908@svn.freebsd.org> From: Christian Brueffer Date: Thu, 10 Apr 2014 10:18:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264314 - head/usr.sbin/binmiscctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 10:18:30 -0000 Author: brueffer Date: Thu Apr 10 10:18:30 2014 New Revision: 264314 URL: http://svnweb.freebsd.org/changeset/base/264314 Log: More mdoc/spelling/grammar cleanup. Modified: head/usr.sbin/binmiscctl/binmiscctl.8 Modified: head/usr.sbin/binmiscctl/binmiscctl.8 ============================================================================== --- head/usr.sbin/binmiscctl/binmiscctl.8 Thu Apr 10 10:12:56 2014 (r264313) +++ head/usr.sbin/binmiscctl/binmiscctl.8 Thu Apr 10 10:18:30 2014 (r264314) @@ -27,8 +27,8 @@ .\" .\" Support for miscellaneous binary image activators .\" -.Dd April 8, 2014 -.Dt 8 +.Dd April 10, 2014 +.Dt BINMISCCTL 8 .Os .Sh NAME .Nm binmiscctl @@ -43,9 +43,9 @@ .Ar magic .Cm --size .Ar size -.Op --mask Ar mask -.Op --offset Ar offset -.Op --set-enabled +.Op Cm --mask Ar mask +.Op Cm --offset Ar offset +.Op Cm --set-enabled .Nm .Cm remove .Ar name @@ -66,10 +66,10 @@ The utility is the management utility for configuring miscellaneous binaries image activators in the kernel. -It allows the adding, deleting, disabling, +It allows adding, deleting, disabling, enabling, and looking up interpreters. Also, all the interpreters can -be listed as well. +be listed. .Pp The first argument on the command line indicates the operation to be performed. @@ -84,19 +84,19 @@ Operation must be one of the following: .Ar magic .Cm --size .Ar size -.Op --mask Ar mask -.Op --offset Ar offset -.Op --set-enabled +.Op Cm --mask Ar mask +.Op Cm --offset Ar offset +.Op Cm --set-enabled .Xc Add a new activator entry in the kernel. -You must specify an +You must specify a unique .Ar name, interpreter path and its arguments .Ar path, header .Ar magic -bytes that uniquely identifies a suitable binary for the activator, +bytes that uniquely identify a suitable binary for the activator, and the .Ar size of the @@ -107,27 +107,29 @@ Optionally you may specify a .Ar mask to do a bitwise AND with the header bytes. This effectively allows you to ignore fields in the binary header that -do not uniquely indentify binary file's type. +do not uniquely indentify the binary file's type. .Pp An .Ar offset may be specified for the magic bytes using the -.Ar --offset -argument. +.Cm --offset +option. By default the .Ar offset is zero. .Pp -To set the activator entry enabled the -.Ar --set-enabled +To enable the activator entry the +.Cm --set-enabled option is used. The activator default state is disabled. .Pp The interpreter .Ar path -may also arguments for the interpreter including +may also contain arguments for the interpreter including .Ar #a -which gets replaced by the old argv0 value in the interpreter string. +which gets replaced by the old +.Dv argv0 +value in the interpreter string. .It Cm remove Ar name Remove the activator entry identified with .Ar name . @@ -138,43 +140,47 @@ Disable the activator entry identified w Enable the activator entry identified with .Ar name . .It Cm lookup Ar name -Lookup and print out the activator entry identified with +Look up and print out the activator entry identified with .Ar name . .It Cm list Take a snapshot and print all the activator entries currently configured. .El .Sh EXAMPLES -.Dl binmiscctl add llvmbc --interpreter ''/usr/bin/lli --fake-argv0=#a'' ---magic ''BC\\xc0\\xde'' ---size 4 --set-enabled +.Bl +# binmiscctl add llvmbc --interpreter ''/usr/bin/lli --fake-argv0=#a'' \\ + --magic ''BC\\xc0\\xde'' --size 4 --set-enabled +.El .Pp -Add an image activator to run the the llvm interpreter (lli) on bitcode +Add an image activator to run the LLVM interpreter (lli) on bitcode compiled files. .Ar #a -gets replaced with the old argv0 value so that 'lli' can fake its argv0. +gets replaced with the old +.Dv argv0 +value so that 'lli' can fake its +.Dv argv0 . Set its state to enabled. .Pp -.Dl binmiscctl disable llvmbc +.Dl # binmiscctl disable llvmbc .Pp Set the state of the .Ar llvmbc image activator to disabled. .Pp -.Dl binmiscctl enable llvmbc +.Dl # binmiscctl enable llvmbc .Pp Set the state of the .Ar llvmbc image activator to enabled. .Pp -.Dl binmiscctl remove llvmbc +.Dl # binmiscctl remove llvmbc .Pp Delete the .Ar llvmbc image activator. .Pp -.Dl binmiscctl lookup llvmbc +.Dl # binmiscctl lookup llvmbc .Pp -Lookup and list the record for the +Look up and list the record for the .Ar llvmbc image activator. .Sh SEE ALSO From owner-svn-src-head@FreeBSD.ORG Thu Apr 10 10:54:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F40EF37C; Thu, 10 Apr 2014 10:54:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E077C1337; Thu, 10 Apr 2014 10:54:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3AAs6Xt083622; Thu, 10 Apr 2014 10:54:06 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3AAs6xH083621; Thu, 10 Apr 2014 10:54:06 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404101054.s3AAs6xH083621@svn.freebsd.org> From: Christian Brueffer Date: Thu, 10 Apr 2014 10:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264315 - head/usr.sbin/wlandebug X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 10:54:07 -0000 Author: brueffer Date: Thu Apr 10 10:54:06 2014 New Revision: 264315 URL: http://svnweb.freebsd.org/changeset/base/264315 Log: Fix Xref order in SEE ALSO. MFC after: 1 week Modified: head/usr.sbin/wlandebug/wlandebug.8 Modified: head/usr.sbin/wlandebug/wlandebug.8 ============================================================================== --- head/usr.sbin/wlandebug/wlandebug.8 Thu Apr 10 10:18:30 2014 (r264314) +++ head/usr.sbin/wlandebug/wlandebug.8 Thu Apr 10 10:54:06 2014 (r264315) @@ -153,10 +153,10 @@ The following might be used to debug bas it enables debug messages while scanning, authenticating to an access point, and associating to an access point. .Sh SEE ALSO -.Xr ifconfig 8 , -.Xr wlanstats 8 , .Xr athdebug 8 , .Xr athstats 8 . +.Xr ifconfig 8 , +.Xr wlanstats 8 .Sh NOTES Different wireless drivers support different debugging messages. Drivers such as From owner-svn-src-head@FreeBSD.ORG Thu Apr 10 10:56:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1802A4DA; Thu, 10 Apr 2014 10:56:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 051AF1351; Thu, 10 Apr 2014 10:56:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3AAuBRj083942; Thu, 10 Apr 2014 10:56:11 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3AAuBYY083941; Thu, 10 Apr 2014 10:56:11 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404101056.s3AAuBYY083941@svn.freebsd.org> From: Christian Brueffer Date: Thu, 10 Apr 2014 10:56:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264316 - head/usr.sbin/wlandebug X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 10:56:12 -0000 Author: brueffer Date: Thu Apr 10 10:56:11 2014 New Revision: 264316 URL: http://svnweb.freebsd.org/changeset/base/264316 Log: Fix stray "." left over from previous commit. MFC after: 1 week Modified: head/usr.sbin/wlandebug/wlandebug.8 Modified: head/usr.sbin/wlandebug/wlandebug.8 ============================================================================== --- head/usr.sbin/wlandebug/wlandebug.8 Thu Apr 10 10:54:06 2014 (r264315) +++ head/usr.sbin/wlandebug/wlandebug.8 Thu Apr 10 10:56:11 2014 (r264316) @@ -154,7 +154,7 @@ it enables debug messages while scanning an access point, and associating to an access point. .Sh SEE ALSO .Xr athdebug 8 , -.Xr athstats 8 . +.Xr athstats 8 , .Xr ifconfig 8 , .Xr wlanstats 8 .Sh NOTES From owner-svn-src-head@FreeBSD.ORG Thu Apr 10 14:37:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D05A3D9B; Thu, 10 Apr 2014 14:37:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCFC61960; Thu, 10 Apr 2014 14:37:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3AEbcl6074464; Thu, 10 Apr 2014 14:37:38 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3AEbcj1074461; Thu, 10 Apr 2014 14:37:38 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201404101437.s3AEbcj1074461@svn.freebsd.org> From: Kevin Lo Date: Thu, 10 Apr 2014 14:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264317 - in head: share/man/man4 sys/dev/usb sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 14:37:38 -0000 Author: kevlo Date: Thu Apr 10 14:37:37 2014 New Revision: 264317 URL: http://svnweb.freebsd.org/changeset/base/264317 Log: Add the Asus USB-N10 NANO. Tested by: Kuan-Chung Chiu Modified: head/share/man/man4/urtwn.4 head/sys/dev/usb/usbdevs head/sys/dev/usb/wlan/if_urtwn.c Modified: head/share/man/man4/urtwn.4 ============================================================================== --- head/share/man/man4/urtwn.4 Thu Apr 10 10:56:11 2014 (r264316) +++ head/share/man/man4/urtwn.4 Thu Apr 10 14:37:37 2014 (r264317) @@ -83,6 +83,7 @@ firmware license The following adapters should work: .Pp .Bl -tag -width Ds -offset indent -compact +.It ASUS USB-N10 NANO .It Belkin F7D1102 Surf Wireless Micro .It D-Link DWA-131 .It Edimax EW-7811Un Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Apr 10 10:56:11 2014 (r264316) +++ head/sys/dev/usb/usbdevs Thu Apr 10 14:37:37 2014 (r264317) @@ -1190,6 +1190,7 @@ product ASUS RT3070_1 0x1790 RT3070 product ASUS USBN10 0x1786 USB-N10 product ASUS RTL8192CU 0x17ab RTL8192CU product ASUS USBN66 0x17ad USB-N66 +product ASUS USBN10NANO 0x17ba USB-N10 Nano product ASUS RTL8192SU 0x1791 RTL8192SU product ASUS A730W 0x4202 ASUS MyPal A730W product ASUS P535 0x420f ASUS P535 PDA Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Thu Apr 10 10:56:11 2014 (r264316) +++ head/sys/dev/usb/wlan/if_urtwn.c Thu Apr 10 14:37:37 2014 (r264317) @@ -92,6 +92,7 @@ static const STRUCT_USB_HOST_ID urtwn_de URTWN_DEV(ABOCOM, RTL8188CU_2), URTWN_DEV(ABOCOM, RTL8192CU), URTWN_DEV(ASUS, RTL8192CU), + URTWN_DEV(ASUS, USBN10NANO), URTWN_DEV(AZUREWAVE, RTL8188CE_1), URTWN_DEV(AZUREWAVE, RTL8188CE_2), URTWN_DEV(AZUREWAVE, RTL8188CU), From owner-svn-src-head@FreeBSD.ORG Thu Apr 10 16:00:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D3E9AFD; Thu, 10 Apr 2014 16:00:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D8151357; Thu, 10 Apr 2014 16:00:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3AG0XnR009137; Thu, 10 Apr 2014 16:00:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3AG0X52009136; Thu, 10 Apr 2014 16:00:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404101600.s3AG0X52009136@svn.freebsd.org> From: Alexander Motin Date: Thu, 10 Apr 2014 16:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264318 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 16:00:34 -0000 Author: mav Date: Thu Apr 10 16:00:33 2014 New Revision: 264318 URL: http://svnweb.freebsd.org/changeset/base/264318 Log: Fix wrong sizes used to access PD_Type and PD_State DDF metadata fields. This caused incorrect behavior of arrays with big-endian DDF metadata. Little-endian (like used by Adaptec controllers) should not be harmed. Add workaround should be enough to manage compatibility. MFC after: 2 weeks Modified: head/sys/geom/raid/md_ddf.c Modified: head/sys/geom/raid/md_ddf.c ============================================================================== --- head/sys/geom/raid/md_ddf.c Thu Apr 10 14:37:37 2014 (r264317) +++ head/sys/geom/raid/md_ddf.c Thu Apr 10 16:00:33 2014 (r264318) @@ -1182,6 +1182,28 @@ hdrerror: g_free(buf); if (GET32(meta, pdr->Signature) != DDF_PDR_SIGNATURE) goto hdrerror; + /* + * Workaround for reading metadata corrupted due to graid bug. + * XXX: Remove this before we have disks above 128PB. :) + */ + if (meta->bigendian) { + for (i = 0; i < GET16(meta, pdr->Populated_PDEs); i++) { + if (isff(meta->pdr->entry[i].PD_GUID, 24)) + continue; + if (GET32(meta, pdr->entry[i].PD_Reference) == + 0xffffffff) + continue; + if (GET64(meta, pdr->entry[i].Configured_Size) >= + (1ULL << 48)) { + SET16(meta, pdr->entry[i].PD_State, + GET16(meta, pdr->entry[i].PD_State) & + ~DDF_PDE_FAILED); + SET64(meta, pdr->entry[i].Configured_Size, + GET64(meta, pdr->entry[i].Configured_Size) & + ((1ULL << 48) - 1)); + } + } + } /* Read virtual disk records. */ buf = g_read_data(cp, (lba + GET32(meta, hdr->vdr_section)) * ss, @@ -1711,7 +1733,7 @@ nofit: /* Welcome the new disk. */ if (resurrection) g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); - else if (GET8(gmeta, pdr->entry[md_pde_pos].PD_State) & DDF_PDE_PFA) + else if (GET16(gmeta, pdr->entry[md_pde_pos].PD_State) & DDF_PDE_PFA) g_raid_change_disk_state(disk, G_RAID_DISK_S_FAILED); else g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); @@ -1730,11 +1752,11 @@ nofit: /* Stale disk, almost same as new. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NEW); - } else if (GET8(gmeta, pdr->entry[md_pde_pos].PD_State) & DDF_PDE_PFA) { + } else if (GET16(gmeta, pdr->entry[md_pde_pos].PD_State) & DDF_PDE_PFA) { /* Failed disk. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_FAILED); - } else if ((GET8(gmeta, pdr->entry[md_pde_pos].PD_State) & + } else if ((GET16(gmeta, pdr->entry[md_pde_pos].PD_State) & (DDF_PDE_FAILED | DDF_PDE_REBUILD)) != 0) { /* Rebuilding disk. */ g_raid_change_subdisk_state(sd, @@ -2833,24 +2855,24 @@ g_raid_md_write_ddf(struct g_raid_md_obj GET32(vmeta, bvdc[bvd]->Physical_Disk_Sequence[pos])); if (j < 0) continue; - SET32(gmeta, pdr->entry[j].PD_Type, - GET32(gmeta, pdr->entry[j].PD_Type) | + SET16(gmeta, pdr->entry[j].PD_Type, + GET16(gmeta, pdr->entry[j].PD_Type) | DDF_PDE_PARTICIPATING); if (sd->sd_state == G_RAID_SUBDISK_S_NONE) - SET32(gmeta, pdr->entry[j].PD_State, - GET32(gmeta, pdr->entry[j].PD_State) | + SET16(gmeta, pdr->entry[j].PD_State, + GET16(gmeta, pdr->entry[j].PD_State) | (DDF_PDE_FAILED | DDF_PDE_MISSING)); else if (sd->sd_state == G_RAID_SUBDISK_S_FAILED) - SET32(gmeta, pdr->entry[j].PD_State, - GET32(gmeta, pdr->entry[j].PD_State) | + SET16(gmeta, pdr->entry[j].PD_State, + GET16(gmeta, pdr->entry[j].PD_State) | (DDF_PDE_FAILED | DDF_PDE_PFA)); else if (sd->sd_state <= G_RAID_SUBDISK_S_REBUILD) - SET32(gmeta, pdr->entry[j].PD_State, - GET32(gmeta, pdr->entry[j].PD_State) | + SET16(gmeta, pdr->entry[j].PD_State, + GET16(gmeta, pdr->entry[j].PD_State) | DDF_PDE_REBUILD); else - SET32(gmeta, pdr->entry[j].PD_State, - GET32(gmeta, pdr->entry[j].PD_State) | + SET16(gmeta, pdr->entry[j].PD_State, + GET16(gmeta, pdr->entry[j].PD_State) | DDF_PDE_ONLINE); } } @@ -2863,8 +2885,8 @@ g_raid_md_write_ddf(struct g_raid_md_obj if (i < 0) continue; if (disk->d_state == G_RAID_DISK_S_FAILED) { - SET32(gmeta, pdr->entry[i].PD_State, - GET32(gmeta, pdr->entry[i].PD_State) | + SET16(gmeta, pdr->entry[i].PD_State, + GET16(gmeta, pdr->entry[i].PD_State) | (DDF_PDE_FAILED | DDF_PDE_PFA)); } if (disk->d_state != G_RAID_DISK_S_SPARE) @@ -2881,8 +2903,8 @@ g_raid_md_write_ddf(struct g_raid_md_obj GET16(gmeta, pdr->entry[i].PD_Type) | DDF_PDE_CONFIG_SPARE); } - SET32(gmeta, pdr->entry[i].PD_State, - GET32(gmeta, pdr->entry[i].PD_State) | + SET16(gmeta, pdr->entry[i].PD_State, + GET16(gmeta, pdr->entry[i].PD_State) | DDF_PDE_ONLINE); } From owner-svn-src-head@FreeBSD.ORG Thu Apr 10 16:53:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 841A6AF4; Thu, 10 Apr 2014 16:53:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 705E81949; Thu, 10 Apr 2014 16:53:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3AGrMba032201; Thu, 10 Apr 2014 16:53:22 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3AGrM5K032199; Thu, 10 Apr 2014 16:53:22 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404101653.s3AGrM5K032199@svn.freebsd.org> From: Ed Maste Date: Thu, 10 Apr 2014 16:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264319 - in head/sys/boot/amd64: . efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 16:53:22 -0000 Author: emaste Date: Thu Apr 10 16:53:21 2014 New Revision: 264319 URL: http://svnweb.freebsd.org/changeset/base/264319 Log: Fix EFI loader object tree creation on 9.x build hosts Previously ${COMPILER_TYPE} was checked in sys/boot/amd64, and the efi subdirectory was skipped altogether for gcc (since GCC does not support a required attribute). However, during the early buildworld stages ${COMPILER_TYPE} is the existing system compiler (i.e., gcc on 9.x build hosts), not the compiler that will eventually be used. This caused "make obj" to skip the efi subdirectory. In later build stages ${COMPILER_TYPE} is "clang", and then the efi loader would attempt to build in the source directory. Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/amd64/Makefile head/sys/boot/amd64/efi/Makefile Modified: head/sys/boot/amd64/Makefile ============================================================================== --- head/sys/boot/amd64/Makefile Thu Apr 10 16:00:33 2014 (r264318) +++ head/sys/boot/amd64/Makefile Thu Apr 10 16:53:21 2014 (r264319) @@ -2,10 +2,6 @@ .include -# In-tree GCC does not support __attribute__((ms_abi)), required by the -# UEFI loader. -.if ${COMPILER_TYPE} != "gcc" SUBDIR= efi -.endif .include Modified: head/sys/boot/amd64/efi/Makefile ============================================================================== --- head/sys/boot/amd64/efi/Makefile Thu Apr 10 16:00:33 2014 (r264318) +++ head/sys/boot/amd64/efi/Makefile Thu Apr 10 16:53:21 2014 (r264319) @@ -3,6 +3,10 @@ NO_MAN= .include + +# In-tree GCC does not support __attribute__((ms_abi)). +.if ${COMPILER_TYPE} != "gcc" + MK_SSP= no PROG= loader.sym @@ -85,6 +89,8 @@ CFLAGS+= -I${.CURDIR}/../../common DPADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND} +.endif # ${COMPILER_TYPE} != "gcc" + .include beforedepend ${OBJS}: machine x86 From owner-svn-src-head@FreeBSD.ORG Thu Apr 10 17:00:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C98E6DD4; Thu, 10 Apr 2014 17:00:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B53A81A08; Thu, 10 Apr 2014 17:00:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3AH0iMR033633; Thu, 10 Apr 2014 17:00:44 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3AH0igi033632; Thu, 10 Apr 2014 17:00:44 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201404101700.s3AH0igi033632@svn.freebsd.org> From: Bryan Drewery Date: Thu, 10 Apr 2014 17:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264320 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 17:00:44 -0000 Author: bdrewery Date: Thu Apr 10 17:00:44 2014 New Revision: 264320 URL: http://svnweb.freebsd.org/changeset/base/264320 Log: Fix spelling error in g_trace() call. Sponsored by: EMC / Isilon Storage Division MFC after: 1 week Modified: head/sys/geom/geom_disk.c Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Thu Apr 10 16:53:21 2014 (r264319) +++ head/sys/geom/geom_disk.c Thu Apr 10 17:00:44 2014 (r264320) @@ -164,7 +164,7 @@ g_disk_kerneldump(struct bio *bp, struct gkd = (struct g_kerneldump*)bp->bio_data; gp = bp->bio_to->geom; - g_trace(G_T_TOPOLOGY, "g_disk_kernedump(%s, %jd, %jd)", + g_trace(G_T_TOPOLOGY, "g_disk_kerneldump(%s, %jd, %jd)", gp->name, (intmax_t)gkd->offset, (intmax_t)gkd->length); if (dp->d_dump == NULL) { g_io_deliver(bp, ENODEV); From owner-svn-src-head@FreeBSD.ORG Thu Apr 10 18:15:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 375985F1; Thu, 10 Apr 2014 18:15:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24128125F; Thu, 10 Apr 2014 18:15:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3AIFa48065545; Thu, 10 Apr 2014 18:15:36 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3AIFZx3065541; Thu, 10 Apr 2014 18:15:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201404101815.s3AIFZx3065541@svn.freebsd.org> From: John Baldwin Date: Thu, 10 Apr 2014 18:15:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264321 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 18:15:36 -0000 Author: jhb Date: Thu Apr 10 18:15:35 2014 New Revision: 264321 URL: http://svnweb.freebsd.org/changeset/base/264321 Log: Currently, the TCP slow timer can starve TCP input processing while it walks the list of connections in TIME_WAIT closing expired connections due to contention on the global TCP pcbinfo lock. To remediate, introduce a new global lock to protect the list of connections in TIME_WAIT. Only acquire the TCP pcbinfo lock when closing an expired connection. This limits the window of time when TCP input processing is stopped to the amount of time needed to close a single connection. Submitted by: Julien Charbon Reviewed by: rwatson, rrs, adrian MFC after: 2 months Modified: head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h head/sys/netinet/tcp_timewait.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Thu Apr 10 17:00:44 2014 (r264320) +++ head/sys/netinet/tcp_timer.c Thu Apr 10 18:15:35 2014 (r264321) @@ -144,9 +144,7 @@ tcp_slowtimo(void) VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - INP_INFO_WLOCK(&V_tcbinfo); - (void) tcp_tw_2msl_scan(0); - INP_INFO_WUNLOCK(&V_tcbinfo); + tcp_tw_2msl_scan(); CURVNET_RESTORE(); } VNET_LIST_RUNLOCK_NOSLEEP(); Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Thu Apr 10 17:00:44 2014 (r264320) +++ head/sys/netinet/tcp_timer.h Thu Apr 10 18:15:35 2014 (r264321) @@ -178,7 +178,8 @@ extern int tcp_fast_finwait2_recycle; void tcp_timer_init(void); void tcp_timer_2msl(void *xtp); struct tcptw * - tcp_tw_2msl_scan(int _reuse); /* XXX temporary */ + tcp_tw_2msl_reuse(void); /* XXX temporary? */ +void tcp_tw_2msl_scan(void); void tcp_timer_keep(void *xtp); void tcp_timer_persist(void *xtp); void tcp_timer_rexmt(void *xtp); Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Thu Apr 10 17:00:44 2014 (r264320) +++ head/sys/netinet/tcp_timewait.c Thu Apr 10 18:15:35 2014 (r264321) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -99,13 +100,61 @@ static int maxtcptw; * The timed wait queue contains references to each of the TCP sessions * currently in the TIME_WAIT state. The queue pointers, including the * queue pointers in each tcptw structure, are protected using the global - * tcbinfo lock, which must be held over queue iteration and modification. + * timewait lock, which must be held over queue iteration and modification. */ static VNET_DEFINE(TAILQ_HEAD(, tcptw), twq_2msl); #define V_twq_2msl VNET(twq_2msl) -static void tcp_tw_2msl_reset(struct tcptw *, int); -static void tcp_tw_2msl_stop(struct tcptw *); +/* Global timewait lock */ +static VNET_DEFINE(struct rwlock, tw_lock); +#define V_tw_lock VNET(tw_lock) + +#define TW_LOCK_INIT(tw, d) rw_init_flags(&(tw), (d), 0) +#define TW_LOCK_DESTROY(tw) rw_destroy(&(tw)) +#define TW_RLOCK(tw) rw_rlock(&(tw)) +#define TW_WLOCK(tw) rw_wlock(&(tw)) +#define TW_RUNLOCK(tw) rw_runlock(&(tw)) +#define TW_WUNLOCK(tw) rw_wunlock(&(tw)) +#define TW_LOCK_ASSERT(tw) rw_assert(&(tw), RA_LOCKED) +#define TW_RLOCK_ASSERT(tw) rw_assert(&(tw), RA_RLOCKED) +#define TW_WLOCK_ASSERT(tw) rw_assert(&(tw), RA_WLOCKED) +#define TW_UNLOCK_ASSERT(tw) rw_assert(&(tw), RA_UNLOCKED) + +/* + * tw_pcbref() bumps the reference count on an tw in order to maintain + * stability of an tw pointer despite the tw lock being released. + */ +static void +tw_pcbref(struct tcptw *tw) +{ + + KASSERT(tw->tw_refcount > 0, ("%s: refcount 0", __func__)); + refcount_acquire(&tw->tw_refcount); +} + +/* + * Drop a refcount on an tw elevated using tw_pcbref(). Return + * the tw lock released. + */ +static int +tw_pcbrele(struct tcptw *tw) +{ + + TW_WLOCK_ASSERT(V_tw_lock); + KASSERT(tw->tw_refcount > 0, ("%s: refcount 0", __func__)); + + if (!refcount_release(&tw->tw_refcount)) { + TW_WUNLOCK(V_tw_lock); + return (0); + } + + uma_zfree(V_tcptw_zone, tw); + TW_WUNLOCK(V_tw_lock); + return (1); +} + +static void tcp_tw_2msl_reset(struct tcptw *, int ream); +static void tcp_tw_2msl_stop(struct tcptw *, int reuse); static int tcptw_auto_size(void) @@ -172,6 +221,7 @@ tcp_tw_init(void) else uma_zone_set_max(V_tcptw_zone, maxtcptw); TAILQ_INIT(&V_twq_2msl); + TW_LOCK_INIT(V_tw_lock, "tcptw"); } #ifdef VIMAGE @@ -181,10 +231,11 @@ tcp_tw_destroy(void) struct tcptw *tw; INP_INFO_WLOCK(&V_tcbinfo); - while((tw = TAILQ_FIRST(&V_twq_2msl)) != NULL) + while ((tw = TAILQ_FIRST(&V_twq_2msl)) != NULL) tcp_twclose(tw, 0); INP_INFO_WUNLOCK(&V_tcbinfo); + TW_LOCK_DESTROY(V_tw_lock); uma_zdestroy(V_tcptw_zone); } #endif @@ -205,7 +256,7 @@ tcp_twstart(struct tcpcb *tp) int isipv6 = inp->inp_inc.inc_flags & INC_ISIPV6; #endif - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); /* tcp_tw_2msl_reset(). */ + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); if (V_nolocaltimewait) { @@ -230,7 +281,7 @@ tcp_twstart(struct tcpcb *tp) tw = uma_zalloc(V_tcptw_zone, M_NOWAIT); if (tw == NULL) { - tw = tcp_tw_2msl_scan(1); + tw = tcp_tw_2msl_reuse(); if (tw == NULL) { tp = tcp_close(tp); if (tp != NULL) @@ -239,6 +290,7 @@ tcp_twstart(struct tcpcb *tp) } } tw->tw_inpcb = inp; + refcount_init(&tw->tw_refcount, 1); /* * Recover last window size sent. @@ -357,7 +409,6 @@ tcp_twcheck(struct inpcb *inp, struct tc int thflags; tcp_seq seq; - /* tcbinfo lock required for tcp_twclose(), tcp_tw_2msl_reset(). */ INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); @@ -459,11 +510,11 @@ tcp_twclose(struct tcptw *tw, int reuse) inp = tw->tw_inpcb; KASSERT((inp->inp_flags & INP_TIMEWAIT), ("tcp_twclose: !timewait")); KASSERT(intotw(inp) == tw, ("tcp_twclose: inp_ppcb != tw")); - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); /* tcp_tw_2msl_stop(). */ + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); /* in_pcbfree() */ INP_WLOCK_ASSERT(inp); tw->tw_inpcb = NULL; - tcp_tw_2msl_stop(tw); + tcp_tw_2msl_stop(tw, reuse); inp->inp_ppcb = NULL; in_pcbdrop(inp); @@ -495,11 +546,6 @@ tcp_twclose(struct tcptw *tw, int reuse) } else in_pcbfree(inp); TCPSTAT_INC(tcps_closed); - crfree(tw->tw_cred); - tw->tw_cred = NULL; - if (reuse) - return; - uma_zfree(V_tcptw_zone, tw); } int @@ -617,34 +663,88 @@ tcp_tw_2msl_reset(struct tcptw *tw, int INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(tw->tw_inpcb); + + TW_WLOCK(V_tw_lock); if (rearm) TAILQ_REMOVE(&V_twq_2msl, tw, tw_2msl); tw->tw_time = ticks + 2 * tcp_msl; TAILQ_INSERT_TAIL(&V_twq_2msl, tw, tw_2msl); + TW_WUNLOCK(V_tw_lock); } static void -tcp_tw_2msl_stop(struct tcptw *tw) +tcp_tw_2msl_stop(struct tcptw *tw, int reuse) { INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + + TW_WLOCK(V_tw_lock); TAILQ_REMOVE(&V_twq_2msl, tw, tw_2msl); + crfree(tw->tw_cred); + tw->tw_cred = NULL; + + if (!reuse) { + tw_pcbrele(tw); + return; + } + + TW_WUNLOCK(V_tw_lock); } struct tcptw * -tcp_tw_2msl_scan(int reuse) +tcp_tw_2msl_reuse(void) { - struct tcptw *tw; INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + + struct tcptw *tw; + + TW_WLOCK(V_tw_lock); + tw = TAILQ_FIRST(&V_twq_2msl); + if (tw == NULL) { + TW_WUNLOCK(V_tw_lock); + return NULL; + } + TW_WUNLOCK(V_tw_lock); + + INP_WLOCK(tw->tw_inpcb); + tcp_twclose(tw, 1); + + return (tw); +} + +void +tcp_tw_2msl_scan(void) +{ + + struct tcptw *tw; for (;;) { + TW_RLOCK(V_tw_lock); tw = TAILQ_FIRST(&V_twq_2msl); - if (tw == NULL || (!reuse && (tw->tw_time - ticks) > 0)) + if (tw == NULL || ((tw->tw_time - ticks) > 0)) { + TW_RUNLOCK(V_tw_lock); + break; + } + tw_pcbref(tw); + TW_RUNLOCK(V_tw_lock); + + /* Close timewait state */ + if (INP_INFO_TRY_WLOCK(&V_tcbinfo)) { + TW_WLOCK(V_tw_lock); + if (tw_pcbrele(tw)) + continue; + + KASSERT(tw->tw_inpcb != NULL, + ("%s: tw->tw_inpcb == NULL", __func__)); + + INP_WLOCK(tw->tw_inpcb); + tcp_twclose(tw, 0); + INP_INFO_WUNLOCK(&V_tcbinfo); + } else { + /* INP_INFO lock is busy, continue later */ + TW_WLOCK(V_tw_lock); + tw_pcbrele(tw); break; - INP_WLOCK(tw->tw_inpcb); - tcp_twclose(tw, reuse); - if (reuse) - return (tw); + } } - return (NULL); } Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Thu Apr 10 17:00:44 2014 (r264320) +++ head/sys/netinet/tcp_var.h Thu Apr 10 18:15:35 2014 (r264321) @@ -353,8 +353,7 @@ struct tcptw { u_int t_starttime; int tw_time; TAILQ_ENTRY(tcptw) tw_2msl; - void *tw_pspare; /* TCP_SIGNATURE */ - u_int *tw_spare; /* TCP_SIGNATURE */ + u_int tw_refcount; /* refcount */ }; #define intotcpcb(ip) ((struct tcpcb *)(ip)->inp_ppcb) From owner-svn-src-head@FreeBSD.ORG Thu Apr 10 18:21:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F610903; Thu, 10 Apr 2014 18:21:32 +0000 (UTC) Received: from mail-qa0-x235.google.com (mail-qa0-x235.google.com [IPv6:2607:f8b0:400d:c00::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A26EB131E; Thu, 10 Apr 2014 18:21:31 +0000 (UTC) Received: by mail-qa0-f53.google.com with SMTP id w8so4181238qac.26 for ; Thu, 10 Apr 2014 11:21:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=QwF/DolX0wFXIwS9iaXH33BKT/65/YQYvoExZU2PYV0=; b=Y3600WlLIeNjxsRIblXbxSoPfcIsl1VKFs+l2I9arrgqQ6i2LO9N7T5pTMaPsbD2gZ 1wwEPI23xRiHfqyjkaETui1utNEEvcyOZCRlh04MjV8WkK4E4GIf+17sitHmjrD0HJnn wU1AuduJroyxzef0gdQfQMFTLibIRVIFFZd1pvDi8E3ijDwe5aFumxN9YDf5yjqYVxp2 oaFLYwDFYdukh3WvSP4VI+REcTMDBqSnpfPau0pacaPvstP2mf0jcc5oG2xp3XAEzXDH OjNmWeCB/bXugJ+Evl+Y7lLOmgUVo7/Ys/zHcafVjr09K9ojm+JYARo5jZAabF4njBKC 9dvA== MIME-Version: 1.0 X-Received: by 10.224.13.142 with SMTP id c14mr23145553qaa.76.1397154090809; Thu, 10 Apr 2014 11:21:30 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.50.206 with HTTP; Thu, 10 Apr 2014 11:21:30 -0700 (PDT) In-Reply-To: <201404080914.25220.jhb@freebsd.org> References: <201404080236.s382aR4W057350@svn.freebsd.org> <201404080914.25220.jhb@freebsd.org> Date: Thu, 10 Apr 2014 11:21:30 -0700 X-Google-Sender-Auth: KQ56nGzKMthShZb7vkibXt-n5pg Message-ID: Subject: Re: svn commit: r264250 - head/sys/dev/acpica From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 18:21:32 -0000 On 8 April 2014 06:14, John Baldwin wrote: > On Monday, April 07, 2014 10:36:27 pm Adrian Chadd wrote: >> Author: adrian >> Date: Tue Apr 8 02:36:27 2014 >> New Revision: 264250 >> URL: http://svnweb.freebsd.org/changeset/base/264250 >> >> Log: >> Add a basic set of data points which count the number of sleep entries >> that are being done by the OS. >> >> For now this'll match up with the "wakeups"; although I'll dig deeper into >> this to see if we can determine which sleep state the CPU managed to get >> into. Most things I've seen these days only expose up to C2 or C3 via >> ACPI even though the CPU goes all the way down to C6 or C7. > > No, those are actually the same thing. ACPI and Intel both use C-states for > the same thing, but the numbers don't line up. That is, Intel's C6/C7 gets > exposed to the OS as C2/C3 via ACPI. The 6/7 does matter, (I think) if you > are using monitor/mwait as I believe the value you configure for an mwait > sleep has to use Intel's number (6/7) whereas the ACPI number (2/3) is > assigned by the results of _CST or whichever object it is ACPI queries. > > All that to say that ACPI is already using Intel's C6/C7 if you have > configured your BIOS to expose it. I know that the C2/C3 states are whatever ACPI and the CPU decides to map things to. What I'm curious about is whether we can get some kind of feedback from the CPU when it wakes up about what sleep state it actually made it down to. -a From owner-svn-src-head@FreeBSD.ORG Thu Apr 10 18:34:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25566E33; Thu, 10 Apr 2014 18:34:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC2B01493; Thu, 10 Apr 2014 18:34:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3AIYQgc073562; Thu, 10 Apr 2014 18:34:26 GMT (envelope-from xmj@svn.freebsd.org) Received: (from xmj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3AIYQGJ073560; Thu, 10 Apr 2014 18:34:26 GMT (envelope-from xmj@svn.freebsd.org) Message-Id: <201404101834.s3AIYQGJ073560@svn.freebsd.org> From: Johannes Jost Meixner Date: Thu, 10 Apr 2014 18:34:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264322 - in head: share/misc usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 18:34:27 -0000 Author: xmj (ports committer) Date: Thu Apr 10 18:34:26 2014 New Revision: 264322 URL: http://svnweb.freebsd.org/changeset/base/264322 Log: - Adding myself to the committers-ports.dot - Adding myself to the freebsd calendar Approved by: swills (mentor) Modified: head/share/misc/committers-ports.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Thu Apr 10 18:15:35 2014 (r264321) +++ head/share/misc/committers-ports.dot Thu Apr 10 18:34:26 2014 (r264322) @@ -219,6 +219,7 @@ vg [label="Veniamin Gvozdikov\nvg@FreeBS wen [label="Wen Heping\nwen@FreeBSD.org\n2010/12/13"] wg [label="William Grzybowski\nwg@FreeBSD.org\n2013/04/01"] wxs [label="Wesley Shields\nwxs@FreeBSD.org\n2008/01/03"] +xmj [label="Johannes Jost Meixner\nxmj@FreeBSD.org\n2014/04/07"] xride [label="Soeren Straarup\nxride@FreeBSD.org\n2006/09/27"] yzlin [label="Yi-Jheng Lin\nyzlin@FreeBSD.org\n2009/07/19"] zeising [label="Niclas Zeising\nzeising@FreeBSD.org\n2012/07/03"] @@ -385,6 +386,8 @@ knu -> maho knu -> nobutaka knu -> nork +koobs -> xmj + krion -> brooks krion -> miwi krion -> novel @@ -521,6 +524,7 @@ steve -> netchild swills -> feld swills -> milki swills -> pclin +swills -> xmj tabthorpe -> ashish tabthorpe -> avilla Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Thu Apr 10 18:15:35 2014 (r264321) +++ head/usr.bin/calendar/calendars/calendar.freebsd Thu Apr 10 18:34:26 2014 (r264322) @@ -191,6 +191,7 @@ 06/04 Thomas Moestl born in Braunschweig, Niedersachsen, Germany, 1980 06/04 Devin Teske born in Arcadia, California, United States, 1982 06/04 Zack Kirsch born in Memphis, Tennessee, United States, 1982 +06/04 Johannes Jost Meixner born in Wiesbaden, Germany, 1987 06/06 Sergei Kolobov born in Karpinsk, Russian Federation, 1972 06/06 Alan Eldridge died in Denver, Colorado, 2003 06/07 Jimmy Olgeni born in Milano, Italy, 1976 From owner-svn-src-head@FreeBSD.ORG Thu Apr 10 18:43:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 467233C1; Thu, 10 Apr 2014 18:43:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33B6215C2; Thu, 10 Apr 2014 18:43:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3AIh3Yp077524; Thu, 10 Apr 2014 18:43:03 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3AIh3ZV077523; Thu, 10 Apr 2014 18:43:03 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <201404101843.s3AIh3ZV077523@svn.freebsd.org> From: Bruce M Simpson Date: Thu, 10 Apr 2014 18:43:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264323 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 18:43:03 -0000 Author: bms Date: Thu Apr 10 18:43:02 2014 New Revision: 264323 URL: http://svnweb.freebsd.org/changeset/base/264323 Log: In if_freemulti(), relax the paranoid KASSERT() on ifma->ifma_protospec. This KASSERT() existed as a sanity check that upper layers in the network stack (e.g. inet, inet6) had released their reference to the underlying driver's multicast memberships (ifmultiaddr{}). However it assumes the lifecycle of the driver membership corresponds to the lifecycle of the network layer membership. In the submitter's case, ieee80211_ioctl_updatemulti() attempts to reprogram the (parent, physical) ifnet{} memberships in response to a change in membership on the (child, virtual) VAP ifnet, using a batched update mechanism. These updates happen independently from the network layer, causing a "false negative" assertion failure. There are possibly other use cases where this KASSERT() may be triggered by other networking stack activity (e.g. where a nesting relationship exists between multiple ifnet{} instances). This suggests that further review of FreeBSD's approach to nested ifnet relationships is needed. MFC after: 6 weeks Submitted by: adrian@ Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Apr 10 18:34:26 2014 (r264322) +++ head/sys/net/if.c Thu Apr 10 18:43:02 2014 (r264323) @@ -2937,8 +2937,6 @@ if_freemulti(struct ifmultiaddr *ifma) KASSERT(ifma->ifma_refcount == 0, ("if_freemulti: refcount %d", ifma->ifma_refcount)); - KASSERT(ifma->ifma_protospec == NULL, - ("if_freemulti: protospec not NULL")); if (ifma->ifma_lladdr != NULL) free(ifma->ifma_lladdr, M_IFMADDR); From owner-svn-src-head@FreeBSD.ORG Thu Apr 10 19:15:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 262BC134; Thu, 10 Apr 2014 19:15:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06D8718C2; Thu, 10 Apr 2014 19:15:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3AJFwCD090461; Thu, 10 Apr 2014 19:15:58 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3AJFwOh090458; Thu, 10 Apr 2014 19:15:58 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201404101915.s3AJFwOh090458@svn.freebsd.org> From: Peter Grehan Date: Thu, 10 Apr 2014 19:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264324 - in head/sys/amd64/vmm: . intel io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 19:15:59 -0000 Author: grehan Date: Thu Apr 10 19:15:58 2014 New Revision: 264324 URL: http://svnweb.freebsd.org/changeset/base/264324 Log: Rework r264179. - remove redundant code - remove erroneous setting of the error return in vmmdev_ioctl() - use style(9) initialization - in vmx_inject_pir(), document the race condition that the final conditional statement was detecting, Tested with both gcc and clang builds. Reviewed by: neel Modified: head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/io/vatpic.c head/sys/amd64/vmm/vmm_dev.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Thu Apr 10 18:43:02 2014 (r264323) +++ head/sys/amd64/vmm/intel/vmx.c Thu Apr 10 19:15:58 2014 (r264324) @@ -2755,6 +2755,7 @@ vmx_inject_pir(struct vlapic *vlapic) } pirval = 0; + pirbase = -1; lapic = vlapic->apic_page; val = atomic_readandclear_long(&pir_desc->pir[0]); @@ -2788,16 +2789,29 @@ vmx_inject_pir(struct vlapic *vlapic) pirbase = 192; pirval = val; } - if (pirbase == -1) { - VCPU_CTR0(vlapic->vm, vlapic->vcpuid, "vmx_inject_pir: " - "no posted interrupt found"); - return; - } + VLAPIC_CTR_IRR(vlapic, "vmx_inject_pir"); /* * Update RVI so the processor can evaluate pending virtual * interrupts on VM-entry. + * + * It is possible for pirval to be 0 here, even though the + * pending bit has been set. The scenario is: + * CPU-Y is sending a posted interrupt to CPU-X, which + * is running a guest and processing posted interrupts in h/w. + * CPU-X will eventually exit and the state seen in s/w is + * the pending bit set, but no PIR bits set. + * + * CPU-X CPU-Y + * (vm running) (host running) + * rx posted interrupt + * CLEAR pending bit + * SET PIR bit + * READ/CLEAR PIR bits + * SET pending bit + * (vm exit) + * pending bit set, PIR 0 */ if (pirval != 0) { rvi = pirbase + flsl(pirval) - 1; Modified: head/sys/amd64/vmm/io/vatpic.c ============================================================================== --- head/sys/amd64/vmm/io/vatpic.c Thu Apr 10 18:43:02 2014 (r264323) +++ head/sys/amd64/vmm/io/vatpic.c Thu Apr 10 19:15:58 2014 (r264324) @@ -473,9 +473,10 @@ vatpic_master_handler(void *vm, int vcpu { struct vatpic *vatpic; struct atpic *atpic; - int error = 0;; + int error; uint8_t val; + error = 0; vatpic = vm_atpic(vm); atpic = &vatpic->atpic[0]; Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Thu Apr 10 18:43:02 2014 (r264323) +++ head/sys/amd64/vmm/vmm_dev.c Thu Apr 10 19:15:58 2014 (r264324) @@ -171,6 +171,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c if (sc == NULL) return (ENXIO); + error = 0; vcpu = -1; state_changed = 0; @@ -231,7 +232,6 @@ vmmdev_ioctl(struct cdev *cdev, u_long c break; default: - error = EINVAL; break; } From owner-svn-src-head@FreeBSD.ORG Thu Apr 10 19:30:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 859D7CDD; Thu, 10 Apr 2014 19:30:13 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A42F1A0F; Thu, 10 Apr 2014 19:30:12 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s3AJTb1D089651 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 10 Apr 2014 23:29:37 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s3AJTK2A089650; Thu, 10 Apr 2014 23:29:20 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 10 Apr 2014 23:29:20 +0400 From: Gleb Smirnoff To: John Baldwin , Julien Charbon Subject: Re: svn commit: r264321 - head/sys/netinet Message-ID: <20140410192920.GT44326@FreeBSD.org> References: <201404101815.s3AIFZx3065541@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201404101815.s3AIFZx3065541@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: adrian@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, rrs@FreeBSD.org, rwatson@FreeBSD.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 19:30:13 -0000 Hi, one comment: On Thu, Apr 10, 2014 at 06:15:35PM +0000, John Baldwin wrote: J> +/* J> + * Drop a refcount on an tw elevated using tw_pcbref(). Return J> + * the tw lock released. J> + */ J> +static int J> +tw_pcbrele(struct tcptw *tw) J> +{ J> + J> + TW_WLOCK_ASSERT(V_tw_lock); J> + KASSERT(tw->tw_refcount > 0, ("%s: refcount 0", __func__)); J> + J> + if (!refcount_release(&tw->tw_refcount)) { J> + TW_WUNLOCK(V_tw_lock); J> + return (0); J> + } J> + J> + uma_zfree(V_tcptw_zone, tw); J> + TW_WUNLOCK(V_tw_lock); J> + return (1); J> +} We can unlock before uma_zfree(), that would reduce contention. Why do we need the lock in this function at all? We don't manipulate the TAILQ. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Apr 10 20:06:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E56EAF2D; Thu, 10 Apr 2014 20:06:12 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA4341D92; Thu, 10 Apr 2014 20:06:12 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 72E0DB96E; Thu, 10 Apr 2014 16:06:11 -0400 (EDT) From: John Baldwin To: Gleb Smirnoff Subject: Re: svn commit: r264321 - head/sys/netinet Date: Thu, 10 Apr 2014 16:04:00 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201404101815.s3AIFZx3065541@svn.freebsd.org> <20140410192920.GT44326@FreeBSD.org> In-Reply-To: <20140410192920.GT44326@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201404101604.01178.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 10 Apr 2014 16:06:11 -0400 (EDT) Cc: adrian@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, Julien Charbon , rrs@freebsd.org, rwatson@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 20:06:13 -0000 On Thursday, April 10, 2014 3:29:20 pm Gleb Smirnoff wrote: > Hi, > > one comment: > > On Thu, Apr 10, 2014 at 06:15:35PM +0000, John Baldwin wrote: > J> +/* > J> + * Drop a refcount on an tw elevated using tw_pcbref(). Return > J> + * the tw lock released. > J> + */ > J> +static int > J> +tw_pcbrele(struct tcptw *tw) > J> +{ > J> + > J> + TW_WLOCK_ASSERT(V_tw_lock); > J> + KASSERT(tw->tw_refcount > 0, ("%s: refcount 0", __func__)); > J> + > J> + if (!refcount_release(&tw->tw_refcount)) { > J> + TW_WUNLOCK(V_tw_lock); > J> + return (0); > J> + } > J> + > J> + uma_zfree(V_tcptw_zone, tw); > J> + TW_WUNLOCK(V_tw_lock); > J> + return (1); > J> +} > > We can unlock before uma_zfree(), that would reduce contention. > > Why do we need the lock in this function at all? We don't manipulate > the TAILQ. I believe you are correct, and it would fix one of the locking assymetries I had noted in my review. Humm, and now that I look again, I think I see a lock leak in scan() if you lose the race on freeing the timewait structure: Index: tcp_timewait.c =================================================================== --- tcp_timewait.c (revision 264321) +++ tcp_timewait.c (working copy) @@ -731,8 +731,10 @@ tcp_tw_2msl_scan(void) /* Close timewait state */ if (INP_INFO_TRY_WLOCK(&V_tcbinfo)) { TW_WLOCK(V_tw_lock); - if (tw_pcbrele(tw)) + if (tw_pcbrele(tw)) { + INP_INFO_WUNLOCK(&V_tcbinfo); continue; + } KASSERT(tw->tw_inpcb != NULL, ("%s: tw->tw_inpcb == NULL", __func__)); -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Apr 10 21:03:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2271587; Thu, 10 Apr 2014 21:03:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEF0B14AA; Thu, 10 Apr 2014 21:03:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3AL3kUR037646; Thu, 10 Apr 2014 21:03:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3AL3kae037645; Thu, 10 Apr 2014 21:03:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404102103.s3AL3kae037645@svn.freebsd.org> From: Marius Strobl Date: Thu, 10 Apr 2014 21:03:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264327 - head/sys/dev/puc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 21:03:47 -0000 Author: marius Date: Thu Apr 10 21:03:46 2014 New Revision: 264327 URL: http://svnweb.freebsd.org/changeset/base/264327 Log: Refine r264257; given that I later on decided to nuke the wildcard for the Sunix 0x1999 line of chips there actually is no need to explicitly keep puc(4) from attaching to the single port version anymore. Modified: head/sys/dev/puc/pucdata.c Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Thu Apr 10 19:53:40 2014 (r264326) +++ head/sys/dev/puc/pucdata.c Thu Apr 10 21:03:46 2014 (r264327) @@ -988,13 +988,6 @@ const struct puc_cfg puc_pci_devices[] = .config_function = puc_config_syba }, - /* Prevent puc(4) from attaching, directly use uart(4) instead. */ - { 0x1fd4, 0x1999, 0x1fd4, 0x0001, - "Sunix SER5xxxx 1-port serial", - DEFAULT_RCLK * 8, - PUC_PORT_1S, 0x10, 0, 8, - }, - { 0x1fd4, 0x1999, 0x1fd4, 0x0002, "Sunix SER5xxxx 2-port serial", DEFAULT_RCLK * 8, From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 02:07:51 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4041A9D4; Fri, 11 Apr 2014 02:07:51 +0000 (UTC) Received: from exprod6og126.obsmtp.com (exprod6og126.obsmtp.com [64.18.1.77]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34AF111C9; Fri, 11 Apr 2014 02:07:49 +0000 (UTC) Received: from peregrine.verisign.com ([216.168.239.74]) (using TLSv1) by exprod6ob126.postini.com ([64.18.5.12]) with SMTP ID DSNKU0dOb94idoz8irFJxq3PJknSWsHrtjNy@postini.com; Thu, 10 Apr 2014 19:07:50 PDT Received: from DUL1WNSMTP01.vcorp.ad.vrsn.com (dul1wnexcn03.vcorp.ad.vrsn.com [10.170.12.113]) by peregrine.verisign.com (8.13.6/8.13.4) with ESMTP id s3B27dOv024342; Thu, 10 Apr 2014 22:07:43 -0400 Received: from fri2spoulet-l1.vcorp.ad.vrsn.com ([10.100.64.12]) by DUL1WNSMTP01.vcorp.ad.vrsn.com with Microsoft SMTPSVC(7.5.7601.17514); Thu, 10 Apr 2014 22:07:38 -0400 Message-ID: <53474E52.6080809@verisign.com> Date: Fri, 11 Apr 2014 04:07:14 +0200 From: Julien Charbon User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 Newsgroups: gmane.os.freebsd.current.scm To: Gleb Smirnoff , John Baldwin Subject: Re: svn commit: r264321 - head/sys/netinet References: <201404101815.s3AIFZx3065541@svn.freebsd.org> <20140410192920.GT44326@FreeBSD.org> In-Reply-To: <20140410192920.GT44326@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 11 Apr 2014 02:07:39.0518 (UTC) FILETIME=[D0AF71E0:01CF552A] Cc: adrian@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, rrs@FreeBSD.org, rwatson@FreeBSD.org, svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 02:07:51 -0000 Hi Gleb, On 10/04/14 21:29, Gleb Smirnoff wrote: > one comment: > > On Thu, Apr 10, 2014 at 06:15:35PM +0000, John Baldwin wrote: > J> +/* > J> + * Drop a refcount on an tw elevated using tw_pcbref(). Return > J> + * the tw lock released. > J> + */ > J> +static int > J> +tw_pcbrele(struct tcptw *tw) > J> +{ > J> + > J> + TW_WLOCK_ASSERT(V_tw_lock); > J> + KASSERT(tw->tw_refcount > 0, ("%s: refcount 0", __func__)); > J> + > J> + if (!refcount_release(&tw->tw_refcount)) { > J> + TW_WUNLOCK(V_tw_lock); > J> + return (0); > J> + } > J> + > J> + uma_zfree(V_tcptw_zone, tw); > J> + TW_WUNLOCK(V_tw_lock); > J> + return (1); > J> +} > > We can unlock before uma_zfree(), that would reduce contention. > > Why do we need the lock in this function at all? We don't manipulate > the TAILQ. That's indeed a good point. When I started prototyping this change having TW_WLOCK in tw_pcbrele() made sense but not anymore. Below a patch that removes TW_WLOCK from tw_pcbrele(), I will do another review pass with this change. Thanks. diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index c455be8..1aff6b4 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -131,22 +131,17 @@ tw_pcbref(struct tcptw *tw) } /* - * Drop a refcount on an tw elevated using tw_pcbref(). Return - * the tw lock released. + * Drop a refcount on an tw elevated using tw_pcbref(). */ static int tw_pcbrele(struct tcptw *tw) { - TW_WLOCK_ASSERT(V_tw_lock); KASSERT(tw->tw_refcount > 0, ("%s: refcount 0", __func__)); - if (!refcount_release(&tw->tw_refcount)) { - TW_WUNLOCK(V_tw_lock); + if (!refcount_release(&tw->tw_refcount)) return (0); - } uma_zfree(V_tcptw_zone, tw); - TW_WUNLOCK(V_tw_lock); return (1); } @@ -680,10 +675,8 @@ tcp_tw_2msl_stop(struct tcptw *tw, int reuse) crfree(tw->tw_cred); tw->tw_cred = NULL; - if (!reuse) { + if (!reuse) tw_pcbrele(tw); - return; - } TW_WUNLOCK(V_tw_lock); } @@ -728,7 +721,6 @@ tcp_tw_2msl_scan(void) /* Close timewait state */ if (INP_INFO_TRY_WLOCK(&V_tcbinfo)) { - TW_WLOCK(V_tw_lock); if (tw_pcbrele(tw)) continue; @@ -740,7 +732,6 @@ tcp_tw_2msl_scan(void) INP_INFO_WUNLOCK(&V_tcbinfo); } else { /* INP_INFO lock is busy, continue later */ - TW_WLOCK(V_tw_lock); tw_pcbrele(tw); break; } -- Julien From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 06:17:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E1B468A; Fri, 11 Apr 2014 06:17:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DCD5192A; Fri, 11 Apr 2014 06:17:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3B6Hj3f068959; Fri, 11 Apr 2014 06:17:45 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3B6HiD3068954; Fri, 11 Apr 2014 06:17:44 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201404110617.s3B6HiD3068954@svn.freebsd.org> From: Justin Hibbits Date: Fri, 11 Apr 2014 06:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264338 - in head/sys/powerpc: include powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 06:17:45 -0000 Author: jhibbits Date: Fri Apr 11 06:17:44 2014 New Revision: 264338 URL: http://svnweb.freebsd.org/changeset/base/264338 Log: Small performance optimization. Clobber only cr0, rather than the entire CR. Discussed with: rdivacky,nwhitehorn MFC after: 3 weeks Modified: head/sys/powerpc/include/atomic.h head/sys/powerpc/include/counter.h head/sys/powerpc/powerpc/copyinout.c Modified: head/sys/powerpc/include/atomic.h ============================================================================== --- head/sys/powerpc/include/atomic.h Fri Apr 11 06:15:58 2014 (r264337) +++ head/sys/powerpc/include/atomic.h Fri Apr 11 06:17:44 2014 (r264338) @@ -74,7 +74,7 @@ " bne- 1b\n" \ : "=&r" (t), "=m" (*p) \ : "r" (p), "r" (v), "m" (*p) \ - : "cc", "memory") \ + : "cr0", "memory") \ /* __atomic_add_int */ #ifdef __powerpc64__ @@ -86,7 +86,7 @@ " bne- 1b\n" \ : "=&r" (t), "=m" (*p) \ : "r" (p), "r" (v), "m" (*p) \ - : "cc", "memory") \ + : "cr0", "memory") \ /* __atomic_add_long */ #else #define __atomic_add_long(p, v, t) \ @@ -97,7 +97,7 @@ " bne- 1b\n" \ : "=&r" (t), "=m" (*p) \ : "r" (p), "r" (v), "m" (*p) \ - : "cc", "memory") \ + : "cr0", "memory") \ /* __atomic_add_long */ #endif @@ -160,7 +160,7 @@ _ATOMIC_ADD(long) " bne- 1b\n" \ : "=&r" (t), "=m" (*p) \ : "r" (p), "r" (v), "m" (*p) \ - : "cc", "memory") \ + : "cr0", "memory") \ /* __atomic_clear_int */ #ifdef __powerpc64__ @@ -172,7 +172,7 @@ _ATOMIC_ADD(long) " bne- 1b\n" \ : "=&r" (t), "=m" (*p) \ : "r" (p), "r" (v), "m" (*p) \ - : "cc", "memory") \ + : "cr0", "memory") \ /* __atomic_clear_long */ #else #define __atomic_clear_long(p, v, t) \ @@ -183,7 +183,7 @@ _ATOMIC_ADD(long) " bne- 1b\n" \ : "=&r" (t), "=m" (*p) \ : "r" (p), "r" (v), "m" (*p) \ - : "cc", "memory") \ + : "cr0", "memory") \ /* __atomic_clear_long */ #endif @@ -262,7 +262,7 @@ _ATOMIC_CLEAR(long) " bne- 1b\n" \ : "=&r" (t), "=m" (*p) \ : "r" (p), "r" (v), "m" (*p) \ - : "cc", "memory") \ + : "cr0", "memory") \ /* __atomic_set_int */ #ifdef __powerpc64__ @@ -274,7 +274,7 @@ _ATOMIC_CLEAR(long) " bne- 1b\n" \ : "=&r" (t), "=m" (*p) \ : "r" (p), "r" (v), "m" (*p) \ - : "cc", "memory") \ + : "cr0", "memory") \ /* __atomic_set_long */ #else #define __atomic_set_long(p, v, t) \ @@ -285,7 +285,7 @@ _ATOMIC_CLEAR(long) " bne- 1b\n" \ : "=&r" (t), "=m" (*p) \ : "r" (p), "r" (v), "m" (*p) \ - : "cc", "memory") \ + : "cr0", "memory") \ /* __atomic_set_long */ #endif @@ -348,7 +348,7 @@ _ATOMIC_SET(long) " bne- 1b\n" \ : "=&r" (t), "=m" (*p) \ : "r" (p), "r" (v), "m" (*p) \ - : "cc", "memory") \ + : "cr0", "memory") \ /* __atomic_subtract_int */ #ifdef __powerpc64__ @@ -360,7 +360,7 @@ _ATOMIC_SET(long) " bne- 1b\n" \ : "=&r" (t), "=m" (*p) \ : "r" (p), "r" (v), "m" (*p) \ - : "cc", "memory") \ + : "cr0", "memory") \ /* __atomic_subtract_long */ #else #define __atomic_subtract_long(p, v, t) \ @@ -371,7 +371,7 @@ _ATOMIC_SET(long) " bne- 1b\n" \ : "=&r" (t), "=m" (*p) \ : "r" (p), "r" (v), "m" (*p) \ - : "cc", "memory") \ + : "cr0", "memory") \ /* __atomic_subtract_long */ #endif @@ -444,7 +444,7 @@ atomic_readandclear_int(volatile u_int * "bne- 1b\n\t" /* spin if failed */ : "=&r"(result), "=&r"(temp), "=m" (*addr) : "r" (addr), "m" (*addr) - : "cc", "memory"); + : "cr0", "memory"); #endif return (result); @@ -465,7 +465,7 @@ atomic_readandclear_long(volatile u_long "bne- 1b\n\t" /* spin if failed */ : "=&r"(result), "=&r"(temp), "=m" (*addr) : "r" (addr), "m" (*addr) - : "cc", "memory"); + : "cr0", "memory"); #endif return (result); @@ -568,7 +568,7 @@ atomic_cmpset_int(volatile u_int* p, u_i "3:\n\t" : "=&r" (ret), "=m" (*p) : "r" (p), "r" (cmpval), "r" (newval), "m" (*p) - : "cc", "memory"); + : "cr0", "memory"); #endif return (ret); @@ -604,7 +604,7 @@ atomic_cmpset_long(volatile u_long* p, u "3:\n\t" : "=&r" (ret), "=m" (*p) : "r" (p), "r" (cmpval), "r" (newval), "m" (*p) - : "cc", "memory"); + : "cr0", "memory"); #endif return (ret); @@ -695,7 +695,7 @@ atomic_swap_32(volatile u_int *p, u_int " bne- 1b\n" : "=&r" (prev), "+m" (*(volatile u_int *)p) : "r" (p), "r" (v) - : "cc", "memory"); + : "cr0", "memory"); return (prev); } @@ -712,7 +712,7 @@ atomic_swap_64(volatile u_long *p, u_lon " bne- 1b\n" : "=&r" (prev), "+m" (*(volatile u_long *)p) : "r" (p), "r" (v) - : "cc", "memory"); + : "cr0", "memory"); return (prev); } Modified: head/sys/powerpc/include/counter.h ============================================================================== --- head/sys/powerpc/include/counter.h Fri Apr 11 06:15:58 2014 (r264337) +++ head/sys/powerpc/include/counter.h Fri Apr 11 06:17:44 2014 (r264338) @@ -95,7 +95,7 @@ counter_u64_add(counter_u64_t c, int64_t "bne- 1b" : "=&b" (ccpu), "=&r" (old) : "r" ((char *)c - (char *)&__pcpu[0]), "r" (inc) - : "cc", "memory"); + : "cr0", "memory"); } #else /* !64bit */ Modified: head/sys/powerpc/powerpc/copyinout.c ============================================================================== --- head/sys/powerpc/powerpc/copyinout.c Fri Apr 11 06:15:58 2014 (r264337) +++ head/sys/powerpc/powerpc/copyinout.c Fri Apr 11 06:17:44 2014 (r264338) @@ -503,7 +503,7 @@ casuword32(volatile uint32_t *addr, uint "3:\n\t" : "=&r" (val), "=m" (*p) : "r" (p), "r" (old), "r" (new), "m" (*p) - : "cc", "memory"); + : "cr0", "memory"); td->td_pcb->pcb_onfault = NULL; @@ -551,7 +551,7 @@ casuword(volatile u_long *addr, u_long o "3:\n\t" : "=&r" (val), "=m" (*p) : "r" (p), "r" (old), "r" (new), "m" (*p) - : "cc", "memory"); + : "cr0", "memory"); td->td_pcb->pcb_onfault = NULL; From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 07:15:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1B376A5 for ; Fri, 11 Apr 2014 07:15:08 +0000 (UTC) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A94F1F7F for ; Fri, 11 Apr 2014 07:15:08 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WYVfz-0003vK-Dh for svn-src-head@freebsd.org; Fri, 11 Apr 2014 09:15:03 +0200 Received: from 217.30.88.7 ([217.30.88.7]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 11 Apr 2014 09:15:03 +0200 Received: from jcharbon by 217.30.88.7 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 11 Apr 2014 09:15:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: svn-src-head@freebsd.org From: Julien Charbon Subject: Re: svn commit: r264321 - head/sys/netinet Date: Fri, 11 Apr 2014 04:07:14 +0200 Lines: 101 Message-ID: <53474E52.6080809@verisign.com> References: <201404101815.s3AIFZx3065541@svn.freebsd.org> <20140410192920.GT44326@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 217.30.88.7 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: <20140410192920.GT44326@FreeBSD.org> Cc: adrian@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, rrs@FreeBSD.org, rwatson@FreeBSD.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 07:15:09 -0000 Hi Gleb, On 10/04/14 21:29, Gleb Smirnoff wrote: > one comment: > > On Thu, Apr 10, 2014 at 06:15:35PM +0000, John Baldwin wrote: > J> +/* > J> + * Drop a refcount on an tw elevated using tw_pcbref(). Return > J> + * the tw lock released. > J> + */ > J> +static int > J> +tw_pcbrele(struct tcptw *tw) > J> +{ > J> + > J> + TW_WLOCK_ASSERT(V_tw_lock); > J> + KASSERT(tw->tw_refcount > 0, ("%s: refcount 0", __func__)); > J> + > J> + if (!refcount_release(&tw->tw_refcount)) { > J> + TW_WUNLOCK(V_tw_lock); > J> + return (0); > J> + } > J> + > J> + uma_zfree(V_tcptw_zone, tw); > J> + TW_WUNLOCK(V_tw_lock); > J> + return (1); > J> +} > > We can unlock before uma_zfree(), that would reduce contention. > > Why do we need the lock in this function at all? We don't manipulate > the TAILQ. That's indeed a good point. When I started prototyping this change having TW_WLOCK in tw_pcbrele() made sense but not anymore. Below a patch that removes TW_WLOCK from tw_pcbrele(), I will do another review pass with this change. Thanks. diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index c455be8..1aff6b4 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -131,22 +131,17 @@ tw_pcbref(struct tcptw *tw) } /* - * Drop a refcount on an tw elevated using tw_pcbref(). Return - * the tw lock released. + * Drop a refcount on an tw elevated using tw_pcbref(). */ static int tw_pcbrele(struct tcptw *tw) { - TW_WLOCK_ASSERT(V_tw_lock); KASSERT(tw->tw_refcount > 0, ("%s: refcount 0", __func__)); - if (!refcount_release(&tw->tw_refcount)) { - TW_WUNLOCK(V_tw_lock); + if (!refcount_release(&tw->tw_refcount)) return (0); - } uma_zfree(V_tcptw_zone, tw); - TW_WUNLOCK(V_tw_lock); return (1); } @@ -680,10 +675,8 @@ tcp_tw_2msl_stop(struct tcptw *tw, int reuse) crfree(tw->tw_cred); tw->tw_cred = NULL; - if (!reuse) { + if (!reuse) tw_pcbrele(tw); - return; - } TW_WUNLOCK(V_tw_lock); } @@ -728,7 +721,6 @@ tcp_tw_2msl_scan(void) /* Close timewait state */ if (INP_INFO_TRY_WLOCK(&V_tcbinfo)) { - TW_WLOCK(V_tw_lock); if (tw_pcbrele(tw)) continue; @@ -740,7 +732,6 @@ tcp_tw_2msl_scan(void) INP_INFO_WUNLOCK(&V_tcbinfo); } else { /* INP_INFO lock is busy, continue later */ - TW_WLOCK(V_tw_lock); tw_pcbrele(tw); break; } -- Julien From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 08:25:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9226C476; Fri, 11 Apr 2014 08:25:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FE951754; Fri, 11 Apr 2014 08:25:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3B8PsvH022873; Fri, 11 Apr 2014 08:25:54 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3B8Psh1022872; Fri, 11 Apr 2014 08:25:54 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201404110825.s3B8Psh1022872@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 11 Apr 2014 08:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264340 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 08:25:54 -0000 Author: hselasky Date: Fri Apr 11 08:25:54 2014 New Revision: 264340 URL: http://svnweb.freebsd.org/changeset/base/264340 Log: Correct IMOD default value according to comment. Reported by: Daniel O'Connor MFC after: 1 week Modified: head/sys/dev/usb/controller/xhcireg.h Modified: head/sys/dev/usb/controller/xhcireg.h ============================================================================== --- head/sys/dev/usb/controller/xhcireg.h Fri Apr 11 06:18:24 2014 (r264339) +++ head/sys/dev/usb/controller/xhcireg.h Fri Apr 11 08:25:54 2014 (r264340) @@ -166,7 +166,7 @@ #define XHCI_IMOD_IVAL_SET(x) (((x) & 0xFFFF) << 0) /* 250ns unit */ #define XHCI_IMOD_ICNT_GET(x) (((x) >> 16) & 0xFFFF) /* 250ns unit */ #define XHCI_IMOD_ICNT_SET(x) (((x) & 0xFFFF) << 16) /* 250ns unit */ -#define XHCI_IMOD_DEFAULT 0x000003E8U /* 8000 IRQ/second */ +#define XHCI_IMOD_DEFAULT 0x000001F4U /* 8000 IRQ/second */ #define XHCI_ERSTSZ(n) (0x0028 + (0x20 * (n))) /* XHCI event ring segment table size */ #define XHCI_ERSTS_GET(x) ((x) & 0xFFFF) #define XHCI_ERSTS_SET(x) ((x) & 0xFFFF) From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 10:56:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B502C49; Fri, 11 Apr 2014 10:56:51 +0000 (UTC) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BF6A71774; Fri, 11 Apr 2014 10:56:50 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 5FDBF25D3A82; Fri, 11 Apr 2014 10:56:48 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 8AF61C22C15; Fri, 11 Apr 2014 10:56:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id tlolz7ukG-uv; Fri, 11 Apr 2014 10:56:46 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:2d49:4b0b:d811:7e62] (unknown [IPv6:fde9:577b:c1a9:4410:2d49:4b0b:d811:7e62]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 8D0C3C22C0F; Fri, 11 Apr 2014 10:56:45 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264321 - head/sys/netinet From: "Bjoern A. Zeeb" In-Reply-To: <201404101815.s3AIFZx3065541@svn.freebsd.org> Date: Fri, 11 Apr 2014 10:56:16 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <2775D53A-8728-4E8D-B53D-ADC00649D737@FreeBSD.org> References: <201404101815.s3AIFZx3065541@svn.freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 10:56:51 -0000 On 10 Apr 2014, at 18:15 , John Baldwin wrote: > +/* Global timewait lock */ > +static VNET_DEFINE(struct rwlock, tw_lock); > +#define V_tw_lock VNET(tw_lock) Why do we virtualise individual locks now? Usually we only do for = those embedded into larger virtualised data structures? Does this align = with an independently virtualised data structure (in which case the lock = should be part of that)? /bz =97=20 Bjoern A. Zeeb ????????? ??? ??????? ??????: '??? ??? ???? ?????? ??????? ?? ?? ??????? ??????? ??? ????? ????? ???? ?????? ?? ????? ????', ????????? ?????????, "??? ????? ?? ?????", ?.??? From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 11:56:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 110A517A; Fri, 11 Apr 2014 11:56:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1A4A1D09; Fri, 11 Apr 2014 11:56:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3BBuG0l010744; Fri, 11 Apr 2014 11:56:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3BBuGe6010743; Fri, 11 Apr 2014 11:56:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404111156.s3BBuGe6010743@svn.freebsd.org> From: Alexander Motin Date: Fri, 11 Apr 2014 11:56:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264341 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 11:56:17 -0000 Author: mav Date: Fri Apr 11 11:56:16 2014 New Revision: 264341 URL: http://svnweb.freebsd.org/changeset/base/264341 Log: Create zvol devices on zfs clone. While big and shiny patch is not ready, it is better to have something. PR: kern/178999 MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Apr 11 08:25:54 2014 (r264340) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Apr 11 11:56:16 2014 (r264341) @@ -3352,6 +3352,10 @@ zfs_ioc_clone(const char *fsname, nvlist if (error != 0) (void) dsl_destroy_head(fsname); } +#ifdef __FreeBSD__ + if (error == 0) + zvol_create_minors(fsname); +#endif return (error); } From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 13:11:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD3DC65A; Fri, 11 Apr 2014 13:11:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9D691794; Fri, 11 Apr 2014 13:11:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3BDBhhU044051; Fri, 11 Apr 2014 13:11:43 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3BDBhME044050; Fri, 11 Apr 2014 13:11:43 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201404111311.s3BDBhME044050@svn.freebsd.org> From: John Baldwin Date: Fri, 11 Apr 2014 13:11:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264342 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 13:11:43 -0000 Author: jhb Date: Fri Apr 11 13:11:43 2014 New Revision: 264342 URL: http://svnweb.freebsd.org/changeset/base/264342 Log: Don't leak the TCP pcbinfo lock if a time wait connection is closed in between grabbing a reference on the connection structure and obtaining the pcbinfo lock. Reviewed by: Julien Charbon Modified: head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Fri Apr 11 11:56:16 2014 (r264341) +++ head/sys/netinet/tcp_timewait.c Fri Apr 11 13:11:43 2014 (r264342) @@ -731,8 +731,10 @@ tcp_tw_2msl_scan(void) /* Close timewait state */ if (INP_INFO_TRY_WLOCK(&V_tcbinfo)) { TW_WLOCK(V_tw_lock); - if (tw_pcbrele(tw)) + if (tw_pcbrele(tw)) { + INP_INFO_WUNLOCK(&V_tcbinfo); continue; + } KASSERT(tw->tw_inpcb != NULL, ("%s: tw->tw_inpcb == NULL", __func__)); From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 13:48:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2900F94; Fri, 11 Apr 2014 13:48:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF2EC1BDD; Fri, 11 Apr 2014 13:48:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3BDmkLj059083; Fri, 11 Apr 2014 13:48:46 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3BDmkKb059078; Fri, 11 Apr 2014 13:48:46 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404111348.s3BDmkKb059078@svn.freebsd.org> From: Glen Barber Date: Fri, 11 Apr 2014 13:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264343 - in head: release share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 13:48:47 -0000 Author: gjb Date: Fri Apr 11 13:48:45 2014 New Revision: 264343 URL: http://svnweb.freebsd.org/changeset/base/264343 Log: Add SRC_UPDATE_SKIP, DOC_UPDATE_SKIP, and PORTS_UPDATE_SKIP variables. These are intended to allow bypassing the 'svn co /usr/{src,doc,ports}' step in the chroot when the tree exists from external means. The use case here is that /usr/src, /usr/doc, and /usr/ports in the chroot exist as result of zfs dataset clones, so it is possible (and happens quite often) that the included distributions may not be consistent. (This is not the case for -RELEASE builds, but does happen for snapshot builds.) Tested on: stable/9@r264319 MFC After: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/release.conf.sample head/release/release.sh head/share/man/man7/release.7 Modified: head/release/release.conf.sample ============================================================================== --- head/release/release.conf.sample Fri Apr 11 13:11:43 2014 (r264342) +++ head/release/release.conf.sample Fri Apr 11 13:48:45 2014 (r264343) @@ -56,6 +56,18 @@ PORTBRANCH="ports/head@rHEAD" ## means. #CHROOTBUILD_SKIP= +## Set to a non-empty value skip checkout or update of /usr/src in +## the chroot. This is intended for use when /usr/src already exists. +#SRC_UPDATE_SKIP= + +## Set to a non-empty value skip checkout or update of /usr/doc in +## the chroot. This is intended for use when /usr/doc already exists. +#DOC_UPDATE_SKIP= + +## Set to a non-empty value skip checkout or update of /usr/ports in +## the chroot. This is intended for use when /usr/ports already exists. +#PORTS_UPDATE_SKIP= + ## Set to pass additional flags to make(1) for the build chroot setup, such ## as TARGET/TARGET_ARCH. #CHROOT_MAKEENV= Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Fri Apr 11 13:11:43 2014 (r264342) +++ head/release/release.sh Fri Apr 11 13:48:45 2014 (r264343) @@ -190,11 +190,13 @@ set -e # Everything must succeed mkdir -p ${CHROOTDIR}/usr -${VCSCMD} ${FORCE_SRC_KEY} ${SRCBRANCH} ${CHROOTDIR}/usr/src -if [ -z "${NODOC}" ]; then +if [ -z "${SRC_UPDATE_SKIP}" ]; then + ${VCSCMD} ${FORCE_SRC_KEY} ${SRCBRANCH} ${CHROOTDIR}/usr/src +fi +if [ -z "${NODOC}" ] && [ -z "${DOC_UPDATE_SKIP}" ]; then ${VCSCMD} ${DOCBRANCH} ${CHROOTDIR}/usr/doc fi -if [ -z "${NOPORTS}" ]; then +if [ -z "${NOPORTS}" ] && [ -z "${PORTS_UPDATE_SKIP}" ]; then ${VCSCMD} ${PORTBRANCH} ${CHROOTDIR}/usr/ports fi Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Fri Apr 11 13:11:43 2014 (r264342) +++ head/share/man/man7/release.7 Fri Apr 11 13:48:45 2014 (r264343) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 2, 2014 +.Dd April 11, 2014 .Dt RELEASE 7 .Os .Sh NAME @@ -272,6 +272,30 @@ build environment setup are skipped. This is intended solely for cases where the .Xr chroot 8 userland are provided by alternate means. +.It Va SRC_UPDATE_SKIP +Set to a non-empty value to prevent checkout or update of +.Fa /usr/src +within the +.Xr chroot 8 . +This is intended for use only when +.Fa /usr/src +is expected to exist by alternative means. +.It Va DOC_UPDATE_SKIP +Set to a non-empty value to prevent checkout or update of +.Fa /usr/doc +within the +.Xr chroot 8 . +This is intended for use only when +.Fa /usr/doc +is expected to exist by alternative means. +.It Va PORTS_UPDATE_SKIP +Set to a non-empty value to prevent checkout or update of +.Fa /usr/ports +within the +.Xr chroot 8 . +This is intended for use only when +.Fa /usr/ports +is expected to exist by alternative means. .El .Sh EMBEDDED BUILDS The following From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 14:11:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E027DDB; Fri, 11 Apr 2014 14:11:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AE6B1FDB; Fri, 11 Apr 2014 14:11:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3BEBu20071106; Fri, 11 Apr 2014 14:11:56 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3BEBtFJ071104; Fri, 11 Apr 2014 14:11:55 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201404111411.s3BEBtFJ071104@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 11 Apr 2014 14:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264344 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 14:11:56 -0000 Author: hselasky Date: Fri Apr 11 14:11:55 2014 New Revision: 264344 URL: http://svnweb.freebsd.org/changeset/base/264344 Log: Tune buffer sizes for SuperSpeed USB when using LibUSB v0.1 and v1.0 APIs to increase the maximum bandwidth limit. MFC after: 1 week Modified: head/lib/libusb/libusb01.c head/lib/libusb/libusb10.c Modified: head/lib/libusb/libusb01.c ============================================================================== --- head/lib/libusb/libusb01.c Fri Apr 11 13:48:45 2014 (r264343) +++ head/lib/libusb/libusb01.c Fri Apr 11 14:11:55 2014 (r264344) @@ -127,6 +127,8 @@ usb_get_transfer_by_ep_no(usb_dev_handle bufsize = 256; } else if (speed == LIBUSB20_SPEED_FULL) { bufsize = 4096; + } else if (speed == LIBUSB20_SPEED_SUPER) { + bufsize = 65536; } else { bufsize = 16384; } Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Fri Apr 11 13:48:45 2014 (r264343) +++ head/lib/libusb/libusb10.c Fri Apr 11 14:11:55 2014 (r264344) @@ -935,6 +935,9 @@ libusb10_get_buffsize(struct libusb20_de case LIBUSB20_SPEED_FULL: ret = 4096; break; + case LIBUSB20_SPEED_SUPER: + ret = 65536; + break; default: ret = 16384; break; From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 16:51:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80A3CE97; Fri, 11 Apr 2014 16:51:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62CFF12BE; Fri, 11 Apr 2014 16:51:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3BGpa7j041004; Fri, 11 Apr 2014 16:51:36 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3BGpa0M041002; Fri, 11 Apr 2014 16:51:36 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201404111651.s3BGpa0M041002@svn.freebsd.org> From: Dimitry Andric Date: Fri, 11 Apr 2014 16:51:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264345 - in head: . contrib/llvm/tools/clang/lib/Driver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 16:51:36 -0000 Author: dim Date: Fri Apr 11 16:51:35 2014 New Revision: 264345 URL: http://svnweb.freebsd.org/changeset/base/264345 Log: Amend r263891, by making clang default to DWARF2 debug info format for all FreeBSD versions, not just 10.x and earlier. Apparently too many people seem to have trouble with post-1993 formats. Also remove the related notes about messing with kernel configuration files from UPDATING, which are now superfluous. Requested by: many MFC after: 3 days Modified: head/UPDATING head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Apr 11 14:11:55 2014 (r264344) +++ head/UPDATING Fri Apr 11 16:51:35 2014 (r264345) @@ -45,13 +45,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 preserve the previous behaviour. E.g: ttyu0 "/usr/libexec/getty 3wire" vt100 on secure -20140325: - It is no longer necessary to include the dwarf version in your DEBUG - options in your kernel config file. The bug that required it to be - placed in the config file has bene fixed. DEBUG should now just - contain -g. The build system will automatically update things - to do the right thing. Ignore the entry from 20140216. - 20140306: Support for libwrap (TCP wrappers) in rpcbind was disabled by default to improve performance. To re-enable it, if needed, run rpcbind @@ -67,17 +60,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 20140216: Clang and llvm have been upgraded to 3.4 release. - Please note that clang 3.4 now defaults to DWARF4 debug information - format when you specify -g. Since kgdb(1) only supports DWARF2, you - should update any customized kernel configurations which include debug - information to explicitly use -gdwarf-2, e.g: - - makeoptions DEBUG=-gdwarf-2 - - This has already been applied to the appropriate GENERIC configuration - files, so if you inherit from those, no changes are required. - Please note: this bug has been fixed, please see 20140325. - 20140216: The nve(4) driver has been removed. Please use the nfe(4) driver for NVIDIA nForce MCP Ethernet adapters instead. Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Fri Apr 11 14:11:55 2014 (r264344) +++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Fri Apr 11 16:51:35 2014 (r264345) @@ -2635,10 +2635,9 @@ void Clang::ConstructJob(Compilation &C, CmdArgs.push_back("-gdwarf-4"); else if (!A->getOption().matches(options::OPT_g0) && !A->getOption().matches(options::OPT_ggdb0)) { - // Default is dwarf-2 for darwin and FreeBSD <= 10. + // Default is dwarf-2 for darwin and FreeBSD. const llvm::Triple &Triple = getToolChain().getTriple(); - if (Triple.isOSDarwin() || (Triple.getOS() == llvm::Triple::FreeBSD && - Triple.getOSMajorVersion() <= 10)) + if (Triple.isOSDarwin() || Triple.getOS() == llvm::Triple::FreeBSD) CmdArgs.push_back("-gdwarf-2"); else CmdArgs.push_back("-g"); From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 16:55:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E41571BD; Fri, 11 Apr 2014 16:55:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C545B1366; Fri, 11 Apr 2014 16:55:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3BGtQUv041586; Fri, 11 Apr 2014 16:55:26 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3BGtQjh041582; Fri, 11 Apr 2014 16:55:26 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201404111655.s3BGtQjh041582@svn.freebsd.org> From: Alan Cox Date: Fri, 11 Apr 2014 16:55:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264346 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 16:55:27 -0000 Author: alc Date: Fri Apr 11 16:55:25 2014 New Revision: 264346 URL: http://svnweb.freebsd.org/changeset/base/264346 Log: Before calling mmap() on a shared library's text and data sections, rtld first calls mmap() with the arguments PROT_NONE and MAP_ANON to reserve a single, contiguous range of virtual addresses for the entire shared library. Later, rtld calls mmap() with the the shared library's file descriptor and the argument MAP_FIXED to place the text and data sections within the reserved range. The rationale for mapping shared libraries in this way is explained in the commit message for Revision 190885. However, this approach does have an unintended, negative consequence. Since the first call to mmap() specifies MAP_ANON and not the shared library's file descriptor, the kernel has no idea what alignment the vm object backing the file prefers. As a result, the reserved range's alignment is unlikely to be the same as the vm object's, and so mapping with superpages becomes impossible. To address this problem, this revision adds the argument MAP_ALIGNED_SUPER to the first call to mmap() if the text section is larger than the smallest superpage size. To determine if the text section is larger than the smallest superpage size, rtld must always fetch the page size information. As a result, the private code for fetching the base page size in rtld's builtin malloc is redundant. Eliminate it. Requested by: kib Tested by: zbb (on arm) Reviewed by: kib (an earlier version) Discussed with: jhb Modified: head/libexec/rtld-elf/malloc.c head/libexec/rtld-elf/map_object.c head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h Modified: head/libexec/rtld-elf/malloc.c ============================================================================== --- head/libexec/rtld-elf/malloc.c Fri Apr 11 16:51:35 2014 (r264345) +++ head/libexec/rtld-elf/malloc.c Fri Apr 11 16:55:25 2014 (r264346) @@ -139,25 +139,14 @@ botch(s) /* Debugging stuff */ #define TRACE() rtld_printf("TRACE %s:%d\n", __FILE__, __LINE__) -extern int pagesize; - -static int -rtld_getpagesize(void) -{ - int mib[2]; - size_t size; - - if (pagesize != 0) - return (pagesize); - - mib[0] = CTL_HW; - mib[1] = HW_PAGESIZE; - size = sizeof(pagesize); - if (sysctl(mib, 2, &pagesize, &size, NULL, 0) == -1) - return (-1); - return (pagesize); - -} +/* + * The array of supported page sizes is provided by the user, i.e., the + * program that calls this storage allocator. That program must initialize + * the array before making its first call to allocate storage. The array + * must contain at least one page size. The page sizes must be stored in + * increasing order. + */ +extern size_t *pagesizes; void * malloc(nbytes) @@ -173,7 +162,7 @@ malloc(nbytes) * align break pointer so all data will be page aligned. */ if (pagesz == 0) { - pagesz = n = rtld_getpagesize(); + pagesz = n = pagesizes[0]; if (morepages(NPOOLPAGES) == 0) return NULL; op = (union overhead *)(pagepool_start); Modified: head/libexec/rtld-elf/map_object.c ============================================================================== --- head/libexec/rtld-elf/map_object.c Fri Apr 11 16:51:35 2014 (r264345) +++ head/libexec/rtld-elf/map_object.c Fri Apr 11 16:55:25 2014 (r264346) @@ -68,6 +68,7 @@ map_object(int fd, const char *path, con Elf_Addr base_vaddr; Elf_Addr base_vlimit; caddr_t base_addr; + int base_flags; Elf_Off data_offset; Elf_Addr data_vaddr; Elf_Addr data_vlimit; @@ -176,9 +177,11 @@ map_object(int fd, const char *path, con base_vlimit = round_page(segs[nsegs]->p_vaddr + segs[nsegs]->p_memsz); mapsize = base_vlimit - base_vaddr; base_addr = (caddr_t) base_vaddr; + base_flags = MAP_PRIVATE | MAP_ANON | MAP_NOCORE; + if (npagesizes > 1 && round_page(segs[0]->p_filesz) >= pagesizes[1]) + base_flags |= MAP_ALIGNED_SUPER; - mapbase = mmap(base_addr, mapsize, PROT_NONE, MAP_ANON | MAP_PRIVATE | - MAP_NOCORE, -1, 0); + mapbase = mmap(base_addr, mapsize, PROT_NONE, base_flags, -1, 0); if (mapbase == (caddr_t) -1) { _rtld_error("%s: mmap of entire address space failed: %s", path, rtld_strerror(errno)); Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri Apr 11 16:51:35 2014 (r264345) +++ head/libexec/rtld-elf/rtld.c Fri Apr 11 16:55:25 2014 (r264346) @@ -97,6 +97,7 @@ static void *fill_search_info(const char static char *find_library(const char *, const Obj_Entry *); static const char *gethints(bool); static void init_dag(Obj_Entry *); +static void init_pagesizes(Elf_Auxinfo **aux_info); static void init_rtld(caddr_t, Elf_Auxinfo **); static void initlist_add_neededs(Needed_Entry *, Objlist *); static void initlist_add_objects(Obj_Entry *, Obj_Entry **, Objlist *); @@ -205,7 +206,8 @@ extern Elf_Dyn _DYNAMIC; #define RTLD_IS_DYNAMIC() (&_DYNAMIC != NULL) #endif -int osreldate, pagesize; +int npagesizes, osreldate; +size_t *pagesizes; long __stack_chk_guard[8] = {0, 0, 0, 0, 0, 0, 0, 0}; @@ -1822,8 +1824,9 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * /* Now that non-local variables can be accesses, copy out obj_rtld. */ memcpy(&obj_rtld, &objtmp, sizeof(obj_rtld)); - if (aux_info[AT_PAGESZ] != NULL) - pagesize = aux_info[AT_PAGESZ]->a_un.a_val; + /* The page size is required by the dynamic memory allocator. */ + init_pagesizes(aux_info); + if (aux_info[AT_OSRELDATE] != NULL) osreldate = aux_info[AT_OSRELDATE]->a_un.a_val; @@ -1837,6 +1840,50 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * } /* + * Retrieve the array of supported page sizes. The kernel provides the page + * sizes in increasing order. + */ +static void +init_pagesizes(Elf_Auxinfo **aux_info) +{ + static size_t psa[MAXPAGESIZES]; + int mib[2]; + size_t len, size; + + if (aux_info[AT_PAGESIZES] != NULL && aux_info[AT_PAGESIZESLEN] != + NULL) { + size = aux_info[AT_PAGESIZESLEN]->a_un.a_val; + pagesizes = aux_info[AT_PAGESIZES]->a_un.a_ptr; + } else { + len = 2; + if (sysctlnametomib("hw.pagesizes", mib, &len) == 0) + size = sizeof(psa); + else { + /* As a fallback, retrieve the base page size. */ + size = sizeof(psa[0]); + if (aux_info[AT_PAGESZ] != NULL) { + psa[0] = aux_info[AT_PAGESZ]->a_un.a_val; + goto psa_filled; + } else { + mib[0] = CTL_HW; + mib[1] = HW_PAGESIZE; + len = 2; + } + } + if (sysctl(mib, len, psa, &size, NULL, 0) == -1) { + _rtld_error("sysctl for hw.pagesize(s) failed"); + die(); + } +psa_filled: + pagesizes = psa; + } + npagesizes = size / sizeof(pagesizes[0]); + /* Discard any invalid entries at the end of the array. */ + while (npagesizes > 0 && pagesizes[npagesizes - 1] == 0) + npagesizes--; +} + +/* * Add the init functions from a needed object list (and its recursive * needed objects) to "list". This is not used directly; it is a helper * function for initlist_add_objects(). The write lock must be held Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Fri Apr 11 16:51:35 2014 (r264345) +++ head/libexec/rtld-elf/rtld.h Fri Apr 11 16:55:25 2014 (r264346) @@ -71,6 +71,9 @@ extern size_t tls_static_space; extern int tls_dtv_generation; extern int tls_max_index; +extern int npagesizes; +extern size_t *pagesizes; + extern int main_argc; extern char **main_argv; extern char **environ; From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 17:12:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B659CBC1; Fri, 11 Apr 2014 17:12:24 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask.apl.washington.edu", Issuer "troutmask.apl.washington.edu" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 92BB415BB; Fri, 11 Apr 2014 17:12:24 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.8/8.14.8) with ESMTP id s3BHCHKa042138 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 11 Apr 2014 10:12:17 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.8/8.14.8/Submit) id s3BHCHII042137; Fri, 11 Apr 2014 10:12:17 -0700 (PDT) (envelope-from sgk) Date: Fri, 11 Apr 2014 10:12:17 -0700 From: Steve Kargl To: Dimitry Andric Subject: Re: svn commit: r264345 - in head: . contrib/llvm/tools/clang/lib/Driver Message-ID: <20140411171217.GA42105@troutmask.apl.washington.edu> References: <201404111651.s3BGpa0M041002@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201404111651.s3BGpa0M041002@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 17:12:24 -0000 On Fri, Apr 11, 2014 at 04:51:36PM +0000, Dimitry Andric wrote: > Author: dim > Date: Fri Apr 11 16:51:35 2014 > New Revision: 264345 > URL: http://svnweb.freebsd.org/changeset/base/264345 > > Log: > Amend r263891, by making clang default to DWARF2 debug info format for > all FreeBSD versions, not just 10.x and earlier. Apparently too many > people seem to have trouble with post-1993 formats. > Is the ad-homimem comment really necessary? -- Steve From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 18:19:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00B521EC; Fri, 11 Apr 2014 18:19:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E24E21BAC; Fri, 11 Apr 2014 18:19:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3BIJLmc075895; Fri, 11 Apr 2014 18:19:21 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3BIJLJ2075894; Fri, 11 Apr 2014 18:19:21 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201404111819.s3BIJLJ2075894@svn.freebsd.org> From: Tycho Nightingale Date: Fri, 11 Apr 2014 18:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264347 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 18:19:22 -0000 Author: tychon Date: Fri Apr 11 18:19:21 2014 New Revision: 264347 URL: http://svnweb.freebsd.org/changeset/base/264347 Log: Account for the "plus 1" encoding of the CPUID Function 4 reported core per package and cache sharing values. Approved by: grehan (co-mentor) Modified: head/sys/amd64/vmm/x86.c Modified: head/sys/amd64/vmm/x86.c ============================================================================== --- head/sys/amd64/vmm/x86.c Fri Apr 11 16:55:25 2014 (r264346) +++ head/sys/amd64/vmm/x86.c Fri Apr 11 18:19:21 2014 (r264347) @@ -219,9 +219,18 @@ x86_emulate_cpuid(struct vm *vm, int vcp /* * Do not expose topology. + * + * The maximum number of processor cores in + * this physical processor package and the + * maximum number of threads sharing this + * cache are encoded with "plus 1" encoding. + * Adding one to the value in this register + * field to obtains the actual value. + * + * Therefore 0 for both indicates 1 core per + * package and no cache sharing. */ regs[0] &= 0xffff8000; - regs[0] |= 0x04008000; break; case CPUID_0000_0007: From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 18:23:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1BA6A48C; Fri, 11 Apr 2014 18:23:09 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6CAF1C6C; Fri, 11 Apr 2014 18:23:08 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DF287B939; Fri, 11 Apr 2014 14:23:07 -0400 (EDT) From: John Baldwin To: "Bjoern A. Zeeb" Subject: Re: svn commit: r264321 - head/sys/netinet Date: Fri, 11 Apr 2014 14:17:57 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201404101815.s3AIFZx3065541@svn.freebsd.org> <2775D53A-8728-4E8D-B53D-ADC00649D737@FreeBSD.org> In-Reply-To: <2775D53A-8728-4E8D-B53D-ADC00649D737@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201404111417.57601.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 11 Apr 2014 14:23:08 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 18:23:09 -0000 On Friday, April 11, 2014 6:56:16 am Bjoern A. Zeeb wrote: > On 10 Apr 2014, at 18:15 , John Baldwin wrote: > > > +/* Global timewait lock */ > > +static VNET_DEFINE(struct rwlock, tw_lock); > > +#define V_tw_lock VNET(tw_lock) > > Why do we virtualise individual locks now? Usually we only do for those embedded into larger virtualised data structures? Does this align with an independently virtualised data structure (in which case the lock should be part of that)? The larger structure is currently a single TAILQ: static VNET_DEFINE(TAILQ_HEAD(, tcptw), twq_2msl); #define V_twq_2msl VNET(twq_2msl) Would seem overkill to make a separate struct just for the TAILQ_HEAD and lock? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 18:26:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE7C0630; Fri, 11 Apr 2014 18:26:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF10C1C8E; Fri, 11 Apr 2014 18:26:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3BIQ8f1079643; Fri, 11 Apr 2014 18:26:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3BIQ80F079642; Fri, 11 Apr 2014 18:26:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404111826.s3BIQ80F079642@svn.freebsd.org> From: Alexander Motin Date: Fri, 11 Apr 2014 18:26:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264348 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 18:26:09 -0000 Author: mav Date: Fri Apr 11 18:26:08 2014 New Revision: 264348 URL: http://svnweb.freebsd.org/changeset/base/264348 Log: Improve use of socket buffer upcalls. Use soreadable()/sowriteable() in socket upcalls to avoid extra wakeups until we have enough data to read or space to write. Increase partial receive len from 1K to 128K to not wake up on every received packet. This significantly reduces locks congestion and CPU usage and improves throughput for large I/Os on NICs without TSO and LRO. Reviewed by: trasz Sponsored by: iXsystems, Inc. Modified: head/sys/dev/iscsi/icl.c Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Fri Apr 11 18:19:21 2014 (r264347) +++ head/sys/dev/iscsi/icl.c Fri Apr 11 18:26:08 2014 (r264348) @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -67,7 +68,7 @@ static int coalesce = 1; TUNABLE_INT("kern.icl.coalesce", &coalesce); SYSCTL_INT(_kern_icl, OID_AUTO, coalesce, CTLFLAG_RWTUN, &coalesce, 1, "Try to coalesce PDUs before sending"); -static int partial_receive_len = 1 * 1024; /* XXX: More? */ +static int partial_receive_len = 128 * 1024; TUNABLE_INT("kern.icl.partial_receive_len", &partial_receive_len); SYSCTL_INT(_kern_icl, OID_AUTO, partial_receive_len, CTLFLAG_RWTUN, &partial_receive_len, 1 * 1024, "Minimum read size for partially received " @@ -750,12 +751,19 @@ icl_receive_thread(void *arg) break; } + /* + * Set the low watermark, to be checked by + * soreadable() in icl_soupcall_receive() + * to avoid unneccessary wakeups until there + * is enough data received to read the PDU. + */ SOCKBUF_LOCK(&so->so_rcv); available = so->so_rcv.sb_cc; if (available < ic->ic_receive_len) { so->so_rcv.sb_lowat = ic->ic_receive_len; cv_wait(&ic->ic_receive_cv, &so->so_rcv.sb_mtx); - } + } else + so->so_rcv.sb_lowat = so->so_rcv.sb_hiwat + 1; SOCKBUF_UNLOCK(&so->so_rcv); icl_conn_receive_pdus(ic, available); @@ -772,6 +780,9 @@ icl_soupcall_receive(struct socket *so, { struct icl_conn *ic; + if (!soreadable(so)) + return (SU_OK); + ic = arg; cv_signal(&ic->ic_receive_cv); return (SU_OK); @@ -854,10 +865,10 @@ icl_conn_send_pdus(struct icl_conn *ic, available = sbspace(&so->so_snd); /* - * Notify the socket layer that it doesn't need to call - * send socket upcall for the time being. + * Notify the socket upcall that we don't need wakeups + * for the time being. */ - so->so_snd.sb_lowat = so->so_snd.sb_hiwat; + so->so_snd.sb_lowat = so->so_snd.sb_hiwat + 1; SOCKBUF_UNLOCK(&so->so_snd); while (!STAILQ_EMPTY(queue)) { @@ -873,7 +884,8 @@ icl_conn_send_pdus(struct icl_conn *ic, #endif /* - * Set the low watermark on the socket, + * Set the low watermark, to be checked by + * sowritable() in icl_soupcall_send() * to avoid unneccessary wakeups until there * is enough space for the PDU to fit. */ @@ -1016,6 +1028,9 @@ icl_soupcall_send(struct socket *so, voi { struct icl_conn *ic; + if (!sowriteable(so)) + return (SU_OK); + ic = arg; ICL_CONN_LOCK(ic); From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 18:37:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3713CD01; Fri, 11 Apr 2014 18:37:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 236C01DB5; Fri, 11 Apr 2014 18:37:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3BIbOb1084031; Fri, 11 Apr 2014 18:37:25 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3BIbO3Q084030; Fri, 11 Apr 2014 18:37:24 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404111837.s3BIbO3Q084030@svn.freebsd.org> From: Christian Brueffer Date: Fri, 11 Apr 2014 18:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264349 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 18:37:25 -0000 Author: brueffer Date: Fri Apr 11 18:37:24 2014 New Revision: 264349 URL: http://svnweb.freebsd.org/changeset/base/264349 Log: mdoc and spelling cleanup. MFC after: 3 days Modified: head/share/man/man4/wsp.4 Modified: head/share/man/man4/wsp.4 ============================================================================== --- head/share/man/man4/wsp.4 Fri Apr 11 18:26:08 2014 (r264348) +++ head/share/man/man4/wsp.4 Fri Apr 11 18:37:24 2014 (r264349) @@ -38,7 +38,7 @@ your kernel configuration file: .Cd "device usb" .Ed .Pp -Alternativly, to load the driver as a module at boot time, +Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent @@ -50,31 +50,28 @@ The driver provides support for the Apple Internal Trackpad device found in many Apple laptops. .Pp -The driver simulates a three\-button mouse using multi\-finger tap +The driver simulates a three-button mouse using multi-finger tap detection. -. -A single\-finger press generates a left button click. -A two\-finger tap maps to the right button; whereas a three\-finger tap +A single-finger press generates a left button click. +A two-finger tap maps to the right button; whereas a three-finger tap gets treated as a middle button click. -. .Pp .Nm supports dynamic reconfiguration using -.Xr sysctl 8 ; +.Xr sysctl 8 through nodes under .Nm hw.usb.wsp . Pointer sensitivity can be controlled using the sysctl tunable .Nm hw.usb.wsp.scale_factor . -. .Sh FILES .Nm -creates a blocking pseudo\-device file, +creates a blocking pseudo-device file, .Pa /dev/wsp0 , which presents the mouse as a -.Ar sysmouse +.Em sysmouse or -.Ar mousesystems -type device\-\-see +.Em mousesystems +type device--see .Xr moused 8 for an explanation of these mouse types. From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 18:40:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9345C95; Fri, 11 Apr 2014 18:40:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6762B1DDD; Fri, 11 Apr 2014 18:40:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3BIeUkV084782; Fri, 11 Apr 2014 18:40:30 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3BIeU71084781; Fri, 11 Apr 2014 18:40:30 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201404111840.s3BIeU71084781@svn.freebsd.org> From: Dimitry Andric Date: Fri, 11 Apr 2014 18:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264350 - head/contrib/llvm/patches X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 18:40:30 -0000 Author: dim Date: Fri Apr 11 18:40:29 2014 New Revision: 264350 URL: http://svnweb.freebsd.org/changeset/base/264350 Log: Update the llvm/clang patch for r264345. Added: head/contrib/llvm/patches/patch-r264345-dwarf2-freebsd10.diff - copied, changed from r264345, head/contrib/llvm/patches/patch-r263891-dwarf2-freebsd10.diff Deleted: head/contrib/llvm/patches/patch-r263891-dwarf2-freebsd10.diff Copied and modified: head/contrib/llvm/patches/patch-r264345-dwarf2-freebsd10.diff (from r264345, head/contrib/llvm/patches/patch-r263891-dwarf2-freebsd10.diff) ============================================================================== --- head/contrib/llvm/patches/patch-r263891-dwarf2-freebsd10.diff Fri Apr 11 16:51:35 2014 (r264345, copy source) +++ head/contrib/llvm/patches/patch-r264345-dwarf2-freebsd10.diff Fri Apr 11 18:40:29 2014 (r264350) @@ -1,22 +1,20 @@ -This patch makes clang default to DWARF2 debug info format for FreeBSD -10.x and earlier. +This patch makes clang default to DWARF2 debug info format for FreeBSD. -Introduced here: http://svnweb.freebsd.org/changeset/base/263891 +Introduced here: http://svnweb.freebsd.org/changeset/base/264345 Index: tools/clang/lib/Driver/Tools.cpp =================================================================== --- tools/clang/lib/Driver/Tools.cpp +++ tools/clang/lib/Driver/Tools.cpp -@@ -2628,8 +2628,10 @@ void Clang::ConstructJob(Compilation &C, const Job +@@ -2627,8 +2635,9 @@ void Clang::ConstructJob(Compilation &C, const Job CmdArgs.push_back("-gdwarf-4"); else if (!A->getOption().matches(options::OPT_g0) && !A->getOption().matches(options::OPT_ggdb0)) { - // Default is dwarf-2 for darwin. - if (getToolChain().getTriple().isOSDarwin()) -+ // Default is dwarf-2 for darwin and FreeBSD <= 10. ++ // Default is dwarf-2 for darwin and FreeBSD. + const llvm::Triple &Triple = getToolChain().getTriple(); -+ if (Triple.isOSDarwin() || (Triple.getOS() == llvm::Triple::FreeBSD && -+ Triple.getOSMajorVersion() <= 10)) ++ if (Triple.isOSDarwin() || Triple.getOS() == llvm::Triple::FreeBSD) CmdArgs.push_back("-gdwarf-2"); else CmdArgs.push_back("-g"); From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 19:17:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B1B4DE; Fri, 11 Apr 2014 19:17:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB9B912C7; Fri, 11 Apr 2014 19:17:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3BJHjSL001187; Fri, 11 Apr 2014 19:17:45 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3BJHjMS001186; Fri, 11 Apr 2014 19:17:45 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201404111917.s3BJHjMS001186@svn.freebsd.org> From: John Baldwin Date: Fri, 11 Apr 2014 19:17:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264351 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 19:17:46 -0000 Author: jhb Date: Fri Apr 11 19:17:45 2014 New Revision: 264351 URL: http://svnweb.freebsd.org/changeset/base/264351 Log: The tw_pcbrele() function does not need the global timewait lock. Submitted by: Julien Charbon Suggested by: glebius Modified: head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Fri Apr 11 18:40:29 2014 (r264350) +++ head/sys/netinet/tcp_timewait.c Fri Apr 11 19:17:45 2014 (r264351) @@ -133,23 +133,18 @@ tw_pcbref(struct tcptw *tw) } /* - * Drop a refcount on an tw elevated using tw_pcbref(). Return - * the tw lock released. + * Drop a refcount on an tw elevated using tw_pcbref(). */ static int tw_pcbrele(struct tcptw *tw) { - TW_WLOCK_ASSERT(V_tw_lock); KASSERT(tw->tw_refcount > 0, ("%s: refcount 0", __func__)); - if (!refcount_release(&tw->tw_refcount)) { - TW_WUNLOCK(V_tw_lock); + if (!refcount_release(&tw->tw_refcount)) return (0); - } uma_zfree(V_tcptw_zone, tw); - TW_WUNLOCK(V_tw_lock); return (1); } @@ -682,13 +677,10 @@ tcp_tw_2msl_stop(struct tcptw *tw, int r TAILQ_REMOVE(&V_twq_2msl, tw, tw_2msl); crfree(tw->tw_cred); tw->tw_cred = NULL; + TW_WUNLOCK(V_tw_lock); - if (!reuse) { + if (!reuse) tw_pcbrele(tw); - return; - } - - TW_WUNLOCK(V_tw_lock); } struct tcptw * @@ -730,7 +722,6 @@ tcp_tw_2msl_scan(void) /* Close timewait state */ if (INP_INFO_TRY_WLOCK(&V_tcbinfo)) { - TW_WLOCK(V_tw_lock); if (tw_pcbrele(tw)) { INP_INFO_WUNLOCK(&V_tcbinfo); continue; @@ -744,7 +735,6 @@ tcp_tw_2msl_scan(void) INP_INFO_WUNLOCK(&V_tcbinfo); } else { /* INP_INFO lock is busy, continue later */ - TW_WLOCK(V_tw_lock); tw_pcbrele(tw); break; } From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 20:15:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D589565; Fri, 11 Apr 2014 20:15:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69AA51841; Fri, 11 Apr 2014 20:15:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3BKFsee026235; Fri, 11 Apr 2014 20:15:54 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3BKFrT0026232; Fri, 11 Apr 2014 20:15:53 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201404112015.s3BKFrT0026232@svn.freebsd.org> From: Neel Natu Date: Fri, 11 Apr 2014 20:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264353 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 20:15:54 -0000 Author: neel Date: Fri Apr 11 20:15:53 2014 New Revision: 264353 URL: http://svnweb.freebsd.org/changeset/base/264353 Log: There is no need to save and restore the host's return address in the 'struct vmxctx'. It is preserved on the host stack across a guest entry and exit and just restoring the host's '%rsp' is sufficient. Pointed out by: grehan@ Modified: head/sys/amd64/vmm/intel/vmx.h head/sys/amd64/vmm/intel/vmx_genassym.c head/sys/amd64/vmm/intel/vmx_support.S Modified: head/sys/amd64/vmm/intel/vmx.h ============================================================================== --- head/sys/amd64/vmm/intel/vmx.h Fri Apr 11 19:27:35 2014 (r264352) +++ head/sys/amd64/vmm/intel/vmx.h Fri Apr 11 20:15:53 2014 (r264353) @@ -60,7 +60,6 @@ struct vmxctx { register_t host_rbp; register_t host_rsp; register_t host_rbx; - register_t host_rip; /* * XXX todo debug registers and fpu state */ Modified: head/sys/amd64/vmm/intel/vmx_genassym.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx_genassym.c Fri Apr 11 19:27:35 2014 (r264352) +++ head/sys/amd64/vmm/intel/vmx_genassym.c Fri Apr 11 20:15:53 2014 (r264353) @@ -65,7 +65,6 @@ ASSYM(VMXCTX_HOST_R12, offsetof(struct v ASSYM(VMXCTX_HOST_RBP, offsetof(struct vmxctx, host_rbp)); ASSYM(VMXCTX_HOST_RSP, offsetof(struct vmxctx, host_rsp)); ASSYM(VMXCTX_HOST_RBX, offsetof(struct vmxctx, host_rbx)); -ASSYM(VMXCTX_HOST_RIP, offsetof(struct vmxctx, host_rip)); ASSYM(VMXCTX_INST_FAIL_STATUS, offsetof(struct vmxctx, inst_fail_status)); ASSYM(VMXCTX_PMAP, offsetof(struct vmxctx, pmap)); Modified: head/sys/amd64/vmm/intel/vmx_support.S ============================================================================== --- head/sys/amd64/vmm/intel/vmx_support.S Fri Apr 11 19:27:35 2014 (r264352) +++ head/sys/amd64/vmm/intel/vmx_support.S Fri Apr 11 20:15:53 2014 (r264353) @@ -72,8 +72,7 @@ * * Assumes that %rdi holds a pointer to the 'vmxctx'. */ -#define VMX_HOST_SAVE(tmpreg) \ - movq (%rsp), tmpreg; /* return address */ \ +#define VMX_HOST_SAVE \ movq %r15, VMXCTX_HOST_R15(%rdi); \ movq %r14, VMXCTX_HOST_R14(%rdi); \ movq %r13, VMXCTX_HOST_R13(%rdi); \ @@ -81,9 +80,8 @@ movq %rbp, VMXCTX_HOST_RBP(%rdi); \ movq %rsp, VMXCTX_HOST_RSP(%rdi); \ movq %rbx, VMXCTX_HOST_RBX(%rdi); \ - movq tmpreg, VMXCTX_HOST_RIP(%rdi) -#define VMX_HOST_RESTORE(tmpreg) \ +#define VMX_HOST_RESTORE \ movq VMXCTX_HOST_R15(%rdi), %r15; \ movq VMXCTX_HOST_R14(%rdi), %r14; \ movq VMXCTX_HOST_R13(%rdi), %r13; \ @@ -91,8 +89,6 @@ movq VMXCTX_HOST_RBP(%rdi), %rbp; \ movq VMXCTX_HOST_RSP(%rdi), %rsp; \ movq VMXCTX_HOST_RBX(%rdi), %rbx; \ - movq VMXCTX_HOST_RIP(%rdi), tmpreg; \ - movq tmpreg, (%rsp) /* return address */ /* * vmx_enter_guest(struct vmxctx *vmxctx, int launched) @@ -105,7 +101,7 @@ ENTRY(vmx_enter_guest) /* * Save host state before doing anything else. */ - VMX_HOST_SAVE(%r10) + VMX_HOST_SAVE /* * Activate guest pmap on this cpu. @@ -186,7 +182,7 @@ inst_error: movl PCPU(CPUID), %r10d LK btrl %r10d, PM_ACTIVE(%r11) - VMX_HOST_RESTORE(%r10) + VMX_HOST_RESTORE ret END(vmx_enter_guest) @@ -226,7 +222,7 @@ ENTRY(vmx_exit_guest) movl PCPU(CPUID), %r10d LK btrl %r10d, PM_ACTIVE(%r11) - VMX_HOST_RESTORE(%r10) + VMX_HOST_RESTORE /* * This will return to the caller of 'vmx_enter_guest()' with a return From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 20:18:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AEA27B3 for ; Fri, 11 Apr 2014 20:18:42 +0000 (UTC) Received: from mail-ie0-f169.google.com (mail-ie0-f169.google.com [209.85.223.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 541BE1868 for ; Fri, 11 Apr 2014 20:18:42 +0000 (UTC) Received: by mail-ie0-f169.google.com with SMTP id to1so5949562ieb.14 for ; Fri, 11 Apr 2014 13:18:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=yYD5FUAGJ95TT8/0q8L9hLV55sq8o16XQnvfyqMsnwM=; b=gyzA1OrERw7X6/OtPJiwH/T26Pmbg53oGkaHC01tgkpo/p5wGLLryoA+1N2Mz2ZaAM eq04SbHcJbvjEuVNMvmW0oIs1lYM9R+c7AiE+9qWRSEstT0zEuBU9z/Egb7bolWWW2zw k/2BWnRkjRKH0HVO3K0Ye6J9cdQsENqc27zYMV0rGKZ/pRt5B9eqr8JZWqMABcIPCNP6 oZ1yEokFwc+nE166eekWhvTEBGtCJtxxAf3oiwPy9VSA3q4cwPzWjI+GF4CYowgcM0vs sABcTdDpbaRBjpH5Cm3U/7+dNlifhQHE1jBGsoKtohgOJhQm+HrEdO5QVO+49kbxSoSB dObQ== X-Gm-Message-State: ALoCoQkBHg1p0dLWTeFBd6MCPJ6+ULJS4bkB5iXcVY1giylCbRZBCVDc9eSOEfCUHdM+dsTeKOrD X-Received: by 10.50.136.168 with SMTP id qb8mr6119450igb.13.1397247521297; Fri, 11 Apr 2014 13:18:41 -0700 (PDT) Received: from [192.168.43.111] ([172.56.9.126]) by mx.google.com with ESMTPSA id j9sm8082881igu.10.2014.04.11.13.18.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Apr 2014 13:18:40 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264345 - in head: . contrib/llvm/tools/clang/lib/Driver From: Warner Losh In-Reply-To: <20140411171217.GA42105@troutmask.apl.washington.edu> Date: Fri, 11 Apr 2014 14:18:38 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <6BAAEBB4-46A2-45AE-9A8D-7ECAAAFBD269@bsdimp.com> References: <201404111651.s3BGpa0M041002@svn.freebsd.org> <20140411171217.GA42105@troutmask.apl.washington.edu> To: Steve Kargl X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 20:18:42 -0000 On Apr 11, 2014, at 11:12 AM, Steve Kargl = wrote: > On Fri, Apr 11, 2014 at 04:51:36PM +0000, Dimitry Andric wrote: >> Author: dim >> Date: Fri Apr 11 16:51:35 2014 >> New Revision: 264345 >> URL: http://svnweb.freebsd.org/changeset/base/264345 >>=20 >> Log: >> Amend r263891, by making clang default to DWARF2 debug info format = for >> all FreeBSD versions, not just 10.x and earlier. Apparently too = many >> people seem to have trouble with post-1993 formats. >>=20 >=20 > Is the ad-homimem comment really necessary? Especially since no work was done by the clang folks to bring FreeBSD=92s = system up to date. No work on getting gdb in ports working, no work on = updating crunchgen, no work on forward porting kgdb, not even producing = a roadmap for this or even documenting what work needed to happen. The = switch was just thrown and there was fallout. So attacking that there = was fallout is really out of line. Warner From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 20:19:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA81681F; Fri, 11 Apr 2014 20:19:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DDDB1874; Fri, 11 Apr 2014 20:19:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3BKJ1fg026710; Fri, 11 Apr 2014 20:19:01 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3BKJ1Px026708; Fri, 11 Apr 2014 20:19:01 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201404112019.s3BKJ1Px026708@svn.freebsd.org> From: Sean Bruno Date: Fri, 11 Apr 2014 20:19:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264354 - head/sys/dev/ciss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 20:19:01 -0000 Author: sbruno Date: Fri Apr 11 20:19:01 2014 New Revision: 264354 URL: http://svnweb.freebsd.org/changeset/base/264354 Log: Fix insta-panic on assert of unlocked periph mtx in ciss(4) when logical volume state changes. Currently, I view this as a critical fix for users and will MFC this rapidly as my testing has shown data loss when the disk is failed by removing it when under some amount of write activity and this code panics the box. Reviewed by: mav@ scottl@ MFC after: 3 days Sponsored by: Yahoo! Inc. Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Fri Apr 11 20:15:53 2014 (r264353) +++ head/sys/dev/ciss/ciss.c Fri Apr 11 20:19:01 2014 (r264354) @@ -180,8 +180,6 @@ static int ciss_cam_emulate(struct ciss_ static void ciss_cam_poll(struct cam_sim *sim); static void ciss_cam_complete(struct ciss_request *cr); static void ciss_cam_complete_fixup(struct ciss_softc *sc, struct ccb_scsiio *csio); -static struct cam_periph *ciss_find_periph(struct ciss_softc *sc, - int bus, int target); static int ciss_name_device(struct ciss_softc *sc, int bus, int target); /* periodic status monitoring */ @@ -3413,27 +3411,6 @@ ciss_cam_complete_fixup(struct ciss_soft /******************************************************************************** - * Find a peripheral attached at (target) - */ -static struct cam_periph * -ciss_find_periph(struct ciss_softc *sc, int bus, int target) -{ - struct cam_periph *periph; - struct cam_path *path; - int status; - - status = xpt_create_path(&path, NULL, cam_sim_path(sc->ciss_cam_sim[bus]), - target, 0); - if (status == CAM_REQ_CMP) { - periph = cam_periph_find(path, NULL); - xpt_free_path(path); - } else { - periph = NULL; - } - return(periph); -} - -/******************************************************************************** * Name the device at (target) * * XXX is this strictly correct? @@ -3442,12 +3419,22 @@ static int ciss_name_device(struct ciss_softc *sc, int bus, int target) { struct cam_periph *periph; + struct cam_path *path; + int status; if (CISS_IS_PHYSICAL(bus)) return (0); - if ((periph = ciss_find_periph(sc, bus, target)) != NULL) { + + status = xpt_create_path(&path, NULL, cam_sim_path(sc->ciss_cam_sim[bus]), + target, 0); + + if (status == CAM_REQ_CMP) { + xpt_path_lock(path); + periph = cam_periph_find(path, NULL); sprintf(sc->ciss_logical[bus][target].cl_name, "%s%d", periph->periph_name, periph->unit_number); + xpt_path_unlock(path); + xpt_free_path(path); return(0); } sc->ciss_logical[bus][target].cl_name[0] = 0; From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 20:44:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA5E8350; Fri, 11 Apr 2014 20:44:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B71BA1B01; Fri, 11 Apr 2014 20:44:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3BKi9H8038399; Fri, 11 Apr 2014 20:44:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3BKi9wo038397; Fri, 11 Apr 2014 20:44:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404112044.s3BKi9wo038397@svn.freebsd.org> From: Alexander Motin Date: Fri, 11 Apr 2014 20:44:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264355 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 20:44:10 -0000 Author: mav Date: Fri Apr 11 20:44:09 2014 New Revision: 264355 URL: http://svnweb.freebsd.org/changeset/base/264355 Log: Remove unused val argument value from SYSCTL_INT() calls. Modified: head/sys/dev/iscsi/icl.c head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Fri Apr 11 20:19:01 2014 (r264354) +++ head/sys/dev/iscsi/icl.c Fri Apr 11 20:44:09 2014 (r264355) @@ -63,24 +63,24 @@ SYSCTL_NODE(_kern, OID_AUTO, icl, CTLFLA static int debug = 1; TUNABLE_INT("kern.icl.debug", &debug); SYSCTL_INT(_kern_icl, OID_AUTO, debug, CTLFLAG_RWTUN, - &debug, 1, "Enable debug messages"); + &debug, 0, "Enable debug messages"); static int coalesce = 1; TUNABLE_INT("kern.icl.coalesce", &coalesce); SYSCTL_INT(_kern_icl, OID_AUTO, coalesce, CTLFLAG_RWTUN, - &coalesce, 1, "Try to coalesce PDUs before sending"); + &coalesce, 0, "Try to coalesce PDUs before sending"); static int partial_receive_len = 128 * 1024; TUNABLE_INT("kern.icl.partial_receive_len", &partial_receive_len); SYSCTL_INT(_kern_icl, OID_AUTO, partial_receive_len, CTLFLAG_RWTUN, - &partial_receive_len, 1 * 1024, "Minimum read size for partially received " + &partial_receive_len, 0, "Minimum read size for partially received " "data segment"); static int sendspace = 1048576; TUNABLE_INT("kern.icl.sendspace", &sendspace); SYSCTL_INT(_kern_icl, OID_AUTO, sendspace, CTLFLAG_RWTUN, - &sendspace, 1048576, "Default send socket buffer size"); + &sendspace, 0, "Default send socket buffer size"); static int recvspace = 1048576; TUNABLE_INT("kern.icl.recvspace", &recvspace); SYSCTL_INT(_kern_icl, OID_AUTO, recvspace, CTLFLAG_RWTUN, - &recvspace, 1048576, "Default receive socket buffer size"); + &recvspace, 0, "Default receive socket buffer size"); static uma_zone_t icl_conn_zone; static uma_zone_t icl_pdu_zone; Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Fri Apr 11 20:19:01 2014 (r264354) +++ head/sys/dev/iscsi/iscsi.c Fri Apr 11 20:44:09 2014 (r264355) @@ -76,23 +76,23 @@ SYSCTL_NODE(_kern, OID_AUTO, iscsi, CTLF static int debug = 1; TUNABLE_INT("kern.iscsi.debug", &debug); SYSCTL_INT(_kern_iscsi, OID_AUTO, debug, CTLFLAG_RWTUN, - &debug, 2, "Enable debug messages"); + &debug, 0, "Enable debug messages"); static int ping_timeout = 5; TUNABLE_INT("kern.iscsi.ping_timeout", &ping_timeout); SYSCTL_INT(_kern_iscsi, OID_AUTO, ping_timeout, CTLFLAG_RWTUN, &ping_timeout, - 5, "Timeout for ping (NOP-Out) requests, in seconds"); + 0, "Timeout for ping (NOP-Out) requests, in seconds"); static int iscsid_timeout = 60; TUNABLE_INT("kern.iscsi.iscsid_timeout", &iscsid_timeout); SYSCTL_INT(_kern_iscsi, OID_AUTO, iscsid_timeout, CTLFLAG_RWTUN, &iscsid_timeout, - 60, "Time to wait for iscsid(8) to handle reconnection, in seconds"); + 0, "Time to wait for iscsid(8) to handle reconnection, in seconds"); static int login_timeout = 60; TUNABLE_INT("kern.iscsi.login_timeout", &login_timeout); SYSCTL_INT(_kern_iscsi, OID_AUTO, login_timeout, CTLFLAG_RWTUN, &login_timeout, - 60, "Time to wait for iscsid(8) to finish Login Phase, in seconds"); + 0, "Time to wait for iscsid(8) to finish Login Phase, in seconds"); static int maxtags = 255; TUNABLE_INT("kern.iscsi.maxtags", &maxtags); SYSCTL_INT(_kern_iscsi, OID_AUTO, maxtags, CTLFLAG_RWTUN, &maxtags, - 255, "Max number of IO requests queued"); + 0, "Max number of IO requests queued"); static MALLOC_DEFINE(M_ISCSI, "iSCSI", "iSCSI initiator"); static uma_zone_t iscsi_outstanding_zone; From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 21:01:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 063F1901; Fri, 11 Apr 2014 21:01:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6F0F1C2A; Fri, 11 Apr 2014 21:00:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3BL0xOn044492; Fri, 11 Apr 2014 21:00:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3BL0x79044491; Fri, 11 Apr 2014 21:00:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201404112100.s3BL0x79044491@svn.freebsd.org> From: John Baldwin Date: Fri, 11 Apr 2014 21:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264356 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 21:01:00 -0000 Author: jhb Date: Fri Apr 11 21:00:59 2014 New Revision: 264356 URL: http://svnweb.freebsd.org/changeset/base/264356 Log: Some whitespace and style fixes. Submitted by: bde Modified: head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Fri Apr 11 20:44:09 2014 (r264355) +++ head/sys/netinet/tcp_timewait.c Fri Apr 11 21:00:59 2014 (r264356) @@ -93,7 +93,7 @@ __FBSDID("$FreeBSD$"); #include static VNET_DEFINE(uma_zone_t, tcptw_zone); -#define V_tcptw_zone VNET(tcptw_zone) +#define V_tcptw_zone VNET(tcptw_zone) static int maxtcptw; /* @@ -103,22 +103,25 @@ static int maxtcptw; * timewait lock, which must be held over queue iteration and modification. */ static VNET_DEFINE(TAILQ_HEAD(, tcptw), twq_2msl); -#define V_twq_2msl VNET(twq_2msl) +#define V_twq_2msl VNET(twq_2msl) /* Global timewait lock */ static VNET_DEFINE(struct rwlock, tw_lock); -#define V_tw_lock VNET(tw_lock) +#define V_tw_lock VNET(tw_lock) -#define TW_LOCK_INIT(tw, d) rw_init_flags(&(tw), (d), 0) -#define TW_LOCK_DESTROY(tw) rw_destroy(&(tw)) -#define TW_RLOCK(tw) rw_rlock(&(tw)) -#define TW_WLOCK(tw) rw_wlock(&(tw)) -#define TW_RUNLOCK(tw) rw_runlock(&(tw)) -#define TW_WUNLOCK(tw) rw_wunlock(&(tw)) -#define TW_LOCK_ASSERT(tw) rw_assert(&(tw), RA_LOCKED) -#define TW_RLOCK_ASSERT(tw) rw_assert(&(tw), RA_RLOCKED) -#define TW_WLOCK_ASSERT(tw) rw_assert(&(tw), RA_WLOCKED) -#define TW_UNLOCK_ASSERT(tw) rw_assert(&(tw), RA_UNLOCKED) +#define TW_LOCK_INIT(tw, d) rw_init_flags(&(tw), (d), 0) +#define TW_LOCK_DESTROY(tw) rw_destroy(&(tw)) +#define TW_RLOCK(tw) rw_rlock(&(tw)) +#define TW_WLOCK(tw) rw_wlock(&(tw)) +#define TW_RUNLOCK(tw) rw_runlock(&(tw)) +#define TW_WUNLOCK(tw) rw_wunlock(&(tw)) +#define TW_LOCK_ASSERT(tw) rw_assert(&(tw), RA_LOCKED) +#define TW_RLOCK_ASSERT(tw) rw_assert(&(tw), RA_RLOCKED) +#define TW_WLOCK_ASSERT(tw) rw_assert(&(tw), RA_WLOCKED) +#define TW_UNLOCK_ASSERT(tw) rw_assert(&(tw), RA_UNLOCKED) + +static void tcp_tw_2msl_reset(struct tcptw *, int); +static void tcp_tw_2msl_stop(struct tcptw *, int); /* * tw_pcbref() bumps the reference count on an tw in order to maintain @@ -140,17 +143,12 @@ tw_pcbrele(struct tcptw *tw) { KASSERT(tw->tw_refcount > 0, ("%s: refcount 0", __func__)); - if (!refcount_release(&tw->tw_refcount)) return (0); - uma_zfree(V_tcptw_zone, tw); return (1); } -static void tcp_tw_2msl_reset(struct tcptw *, int ream); -static void tcp_tw_2msl_stop(struct tcptw *, int reuse); - static int tcptw_auto_size(void) { @@ -368,7 +366,7 @@ tcp_twstart(struct tcpcb *tp) * Most other new OSes use semi-randomized ISN values, so we * do not need to worry about them. */ -#define MS_ISN_BYTES_PER_SECOND 250000 +#define MS_ISN_BYTES_PER_SECOND 250000 /* * Determine if the ISN we will generate has advanced beyond the last @@ -686,11 +684,10 @@ tcp_tw_2msl_stop(struct tcptw *tw, int r struct tcptw * tcp_tw_2msl_reuse(void) { + struct tcptw *tw; INP_INFO_WLOCK_ASSERT(&V_tcbinfo); - struct tcptw *tw; - TW_WLOCK(V_tw_lock); tw = TAILQ_FIRST(&V_twq_2msl); if (tw == NULL) { @@ -708,12 +705,12 @@ tcp_tw_2msl_reuse(void) void tcp_tw_2msl_scan(void) { - struct tcptw *tw; + for (;;) { TW_RLOCK(V_tw_lock); tw = TAILQ_FIRST(&V_twq_2msl); - if (tw == NULL || ((tw->tw_time - ticks) > 0)) { + if (tw == NULL || tw->tw_time - ticks > 0) { TW_RUNLOCK(V_tw_lock); break; } @@ -729,12 +726,11 @@ tcp_tw_2msl_scan(void) KASSERT(tw->tw_inpcb != NULL, ("%s: tw->tw_inpcb == NULL", __func__)); - INP_WLOCK(tw->tw_inpcb); tcp_twclose(tw, 0); INP_INFO_WUNLOCK(&V_tcbinfo); } else { - /* INP_INFO lock is busy, continue later */ + /* INP_INFO lock is busy; continue later. */ tw_pcbrele(tw); break; } From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 22:12:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29CDCEED; Fri, 11 Apr 2014 22:12:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A4631526; Fri, 11 Apr 2014 22:12:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3BMCVox075982; Fri, 11 Apr 2014 22:12:31 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3BMCV6q075979; Fri, 11 Apr 2014 22:12:31 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404112212.s3BMCV6q075979@svn.freebsd.org> From: Xin LI Date: Fri, 11 Apr 2014 22:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264361 - head/contrib/netcat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 22:12:32 -0000 Author: delphij Date: Fri Apr 11 22:12:31 2014 New Revision: 264361 URL: http://svnweb.freebsd.org/changeset/base/264361 Log: MFV r258194-264360: nc(1) from OpenBSD 5.5. MFC after: 2 weeks Modified: head/contrib/netcat/nc.1 head/contrib/netcat/netcat.c Directory Properties: head/contrib/netcat/ (props changed) Modified: head/contrib/netcat/nc.1 ============================================================================== --- head/contrib/netcat/nc.1 Fri Apr 11 21:55:30 2014 (r264360) +++ head/contrib/netcat/nc.1 Fri Apr 11 22:12:31 2014 (r264361) @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.63 2013/07/16 00:07:52 schwarze Exp $ +.\" $OpenBSD: nc.1,v 1.67 2014/02/26 20:56:11 claudio Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 20, 2013 +.Dd April 11, 2014 .Dt NC 1 .Os .Sh NAME @@ -36,7 +36,7 @@ .Sh SYNOPSIS .Nm nc .Bk -words -.Op Fl 46DdEhklNnrStUuvz +.Op Fl 46DdEFhklNnrStUuvz .Op Fl e Ar IPsec_policy .Op Fl I Ar length .Op Fl i Ar interval @@ -120,6 +120,21 @@ to be used using the syntax described in .Xr ipsec_set_policy 3 . This flag can be specified up to two times, as typically one policy for each direction is needed. +.It Fl F +Pass the first connected socket using +.Xr sendmsg 2 +to stdout and exit. +This is useful in conjunction with +.Fl X +to have +.Nm +perform connection setup with a proxy but then leave the rest of the +connection to another program (e.g.\& +.Xr ssh 1 +using the +.Xr ssh_config 5 +.Cm ProxyUseFdPass +option). .It Fl h Prints out .Nm @@ -236,7 +251,6 @@ flag is given. Set the routing table .Pq Dq FIB to be used. -The default is 0. .It Fl v Have .Nm @@ -365,7 +379,7 @@ Using a second machine, connect to the l .Nm process, feeding it the file which is to be transferred: .Pp -.Dl $ nc host.example.com 1234 \*(Lt filename.in +.Dl $ nc -N host.example.com 1234 \*(Lt filename.in .Pp After the file has been transferred, the connection will close automatically. .Sh TALKING TO SERVERS Modified: head/contrib/netcat/netcat.c ============================================================================== --- head/contrib/netcat/netcat.c Fri Apr 11 21:55:30 2014 (r264360) +++ head/contrib/netcat/netcat.c Fri Apr 11 22:12:31 2014 (r264361) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.112 2013/04/29 00:28:23 okan Exp $ */ +/* $OpenBSD: netcat.c,v 1.117 2013/10/26 21:33:29 sthen Exp $ */ /* * Copyright (c) 2001 Eric Jackson * @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -74,6 +75,7 @@ /* Command Line Options */ int dflag; /* detached, no stdin */ +int Fflag; /* fdpass sock to stdout */ unsigned int iflag; /* Interval Flag */ int kflag; /* More than one connect */ int lflag; /* Bind to local port */ @@ -94,7 +96,7 @@ int Iflag; /* TCP receive buffer siz int Oflag; /* TCP send buffer size */ int Sflag; /* TCP MD5 signature option */ int Tflag = -1; /* IP Type of Service */ -u_int rtableid; +int rtableid = -1; int timeout = -1; int family = AF_UNSPEC; @@ -106,6 +108,7 @@ void build_ports(char *); void help(void); int local_listen(char *, char *, struct addrinfo); void readwrite(int); +void fdpass(int nfd) __attribute__((noreturn)); int remote_connect(const char *, const char *, struct addrinfo); int timeout_connect(int, const struct sockaddr *, socklen_t); int socks_connect(const char *, const char *, struct addrinfo, @@ -152,9 +155,12 @@ main(int argc, char *argv[]) host = NULL; uport = NULL; sv = NULL; +#if 0 + rtableid = getrtable(); +#endif while ((ch = getopt_long(argc, argv, - "46DdEe:hI:i:klNnoO:P:p:rSs:tT:UuV:vw:X:x:z", + "46DdEe:FhI:i:klNnoO:P:p:rSs:tT:UuV:vw:X:x:z", longopts, NULL)) != -1) { switch (ch) { case '4': @@ -194,6 +200,9 @@ main(int argc, char *argv[]) errx(1, "IPsec support unavailable."); #endif break; + case 'F': + Fflag = 1; + break; case 'h': help(); break; @@ -238,7 +247,7 @@ main(int argc, char *argv[]) case 'V': if (sysctlbyname("net.fibs", &numfibs, &intsize, NULL, 0) == -1) errx(1, "Multiple FIBS not supported"); - rtableid = (unsigned int)strtonum(optarg, 0, + rtableid = (int)strtonum(optarg, 0, numfibs - 1, &errstr); if (errstr) errx(1, "rtable %s: %s", errstr, optarg); @@ -508,7 +517,9 @@ main(int argc, char *argv[]) uflag ? "udp" : "tcp", sv ? sv->s_name : "*"); } - if (!zflag) + if (Fflag) + fdpass(s); + else if (!zflag) readwrite(s); } } @@ -631,12 +642,9 @@ remote_connect(const char *host, const c add_ipsec_policy(s, ipsec_policy[1]); #endif - if (rtableid) { - if (setsockopt(s, SOL_SOCKET, SO_SETFIB, &rtableid, - sizeof(rtableid)) == -1) - err(1, "setsockopt(.., SO_SETFIB, %u, ..)", - rtableid); - } + if (rtableid >= 0 && (setsockopt(s, SOL_SOCKET, SO_SETFIB, + &rtableid, sizeof(rtableid)) == -1)) + err(1, "setsockopt SO_SETFIB"); /* Bind to a local port or source address if specified. */ if (sflag || pflag) { @@ -743,13 +751,9 @@ local_listen(char *host, char *port, str res0->ai_protocol)) < 0) continue; - if (rtableid) { - ret = setsockopt(s, SOL_SOCKET, SO_SETFIB, &rtableid, - sizeof(rtableid)); - if (ret == -1) - err(1, "setsockopt(.., SO_SETFIB, %u, ..)", - rtableid); - } + if (rtableid >= 0 && (setsockopt(s, IPPROTO_IP, SO_SETFIB, + &rtableid, sizeof(rtableid)) == -1)) + err(1, "setsockopt SO_SETFIB"); ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x)); if (ret == -1) @@ -850,6 +854,66 @@ readwrite(int nfd) } } +/* + * fdpass() + * Pass the connected file descriptor to stdout and exit. + */ +void +fdpass(int nfd) +{ + struct msghdr mh; + union { + struct cmsghdr hdr; + char buf[CMSG_SPACE(sizeof(int))]; + } cmsgbuf; + struct cmsghdr *cmsg; + struct iovec iov; + char c = '\0'; + ssize_t r; + struct pollfd pfd; + + /* Avoid obvious stupidity */ + if (isatty(STDOUT_FILENO)) + errx(1, "Cannot pass file descriptor to tty"); + + bzero(&mh, sizeof(mh)); + bzero(&cmsgbuf, sizeof(cmsgbuf)); + bzero(&iov, sizeof(iov)); + bzero(&pfd, sizeof(pfd)); + + mh.msg_control = (caddr_t)&cmsgbuf.buf; + mh.msg_controllen = sizeof(cmsgbuf.buf); + cmsg = CMSG_FIRSTHDR(&mh); + cmsg->cmsg_len = CMSG_LEN(sizeof(int)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + *(int *)CMSG_DATA(cmsg) = nfd; + + iov.iov_base = &c; + iov.iov_len = 1; + mh.msg_iov = &iov; + mh.msg_iovlen = 1; + + bzero(&pfd, sizeof(pfd)); + pfd.fd = STDOUT_FILENO; + for (;;) { + r = sendmsg(STDOUT_FILENO, &mh, 0); + if (r == -1) { + if (errno == EAGAIN || errno == EINTR) { + pfd.events = POLLOUT; + if (poll(&pfd, 1, -1) == -1) + err(1, "poll"); + continue; + } + err(1, "sendmsg"); + } else if (r == -1) + errx(1, "sendmsg: unexpected return value %zd", r); + else + break; + } + exit(0); +} + /* Deal with RFC 854 WILL/WONT DO/DONT negotiation. */ void atelnet(int nfd, unsigned char *buf, unsigned int size) @@ -1088,6 +1152,7 @@ help(void) \t-e policy Use specified IPsec policy\n"); #endif fprintf(stderr, "\ + \t-F Pass socket fd\n\ \t-h This help text\n\ \t-I length TCP receive buffer length\n\ \t-i secs\t Delay interval for lines sent, ports scanned\n\ @@ -1146,9 +1211,9 @@ usage(int ret) { fprintf(stderr, #ifdef IPSEC - "usage: nc [-46DdEhklNnrStUuvz] [-e policy] [-I length] [-i interval] [-O length]\n" + "usage: nc [-46DdEFhklNnrStUuvz] [-e policy] [-I length] [-i interval] [-O length]\n" #else - "usage: nc [-46DdhklNnrStUuvz] [-I length] [-i interval] [-O length]\n" + "usage: nc [-46DdFhklNnrStUuvz] [-I length] [-i interval] [-O length]\n" #endif "\t [-P proxy_username] [-p source_port] [-s source] [-T ToS]\n" "\t [-V rtable] [-w timeout] [-X proxy_protocol]\n" From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 22:34:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3755C768; Fri, 11 Apr 2014 22:34:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2457B16D4; Fri, 11 Apr 2014 22:34:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3BMY1DT084677; Fri, 11 Apr 2014 22:34:01 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3BMY0DI084676; Fri, 11 Apr 2014 22:34:01 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404112234.s3BMY0DI084676@svn.freebsd.org> From: Christian Brueffer Date: Fri, 11 Apr 2014 22:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264362 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 22:34:01 -0000 Author: brueffer Date: Fri Apr 11 22:34:00 2014 New Revision: 264362 URL: http://svnweb.freebsd.org/changeset/base/264362 Log: Remove stray .Nm macro. MFC after: 3 days Modified: head/share/man/man4/terasic_mtl.4 Modified: head/share/man/man4/terasic_mtl.4 ============================================================================== --- head/share/man/man4/terasic_mtl.4 Fri Apr 11 22:12:31 2014 (r264361) +++ head/share/man/man4/terasic_mtl.4 Fri Apr 11 22:34:00 2014 (r264362) @@ -109,7 +109,6 @@ as part of the DARPA CRASH research prog This device driver was written by .An Robert N. M. Watson . .Sh BUGS -.Nm The .Xr syscons 4 attachment does not support the hardware cursor feature. From owner-svn-src-head@FreeBSD.ORG Fri Apr 11 22:45:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1FB797D; Fri, 11 Apr 2014 22:45:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F2A617A0; Fri, 11 Apr 2014 22:45:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3BMjCnT088923; Fri, 11 Apr 2014 22:45:12 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3BMjCgK088922; Fri, 11 Apr 2014 22:45:12 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201404112245.s3BMjCgK088922@svn.freebsd.org> From: Mark Johnston Date: Fri, 11 Apr 2014 22:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264363 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 22:45:12 -0000 Author: markj Date: Fri Apr 11 22:45:12 2014 New Revision: 264363 URL: http://svnweb.freebsd.org/changeset/base/264363 Log: Update the SDT(9) examples to reflect the removal of the sname parameter in r258622. MFC after: 3 days Modified: head/share/man/man9/SDT.9 Modified: head/share/man/man9/SDT.9 ============================================================================== --- head/share/man/man9/SDT.9 Fri Apr 11 22:34:00 2014 (r264362) +++ head/share/man/man9/SDT.9 Fri Apr 11 22:45:12 2014 (r264363) @@ -200,7 +200,7 @@ of type Destination Unreachable: .Bd -literal -offset indent SDT_PROVIDER_DECLARE(icmp); -SDT_PROBE_DEFINE1(icmp, , unreach, pkt_receive, pkt-receive, +SDT_PROBE_DEFINE1(icmp, , unreach, pkt__receive, "struct icmp *"); .Ed @@ -212,7 +212,7 @@ Consider a DTrace probe which fires when packet. Such a probe would be defined by multiple tracepoints: .Bd -literal -offset indent -SDT_PROBE_DEFINE3(ip, , , receive, receive, "struct ifnet *", +SDT_PROBE_DEFINE3(ip, , , receive, "struct ifnet *", "struct ip *", "struct ip6_hdr *"); int @@ -268,7 +268,7 @@ all in the library path. Then the FreeBSD probe above can be defined with: .Bd -literal -offset indent -SDT_PROBE_DEFINE1_XLATE(ip, , , receive, receive, "struct icmp *", +SDT_PROBE_DEFINE1_XLATE(ip, , , receive, "struct icmp *", "struct icmp_hdr_dt *"); .Ed .Sh SEE ALSO From owner-svn-src-head@FreeBSD.ORG Sat Apr 12 00:55:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 323DAE21; Sat, 12 Apr 2014 00:55:02 +0000 (UTC) Received: from mail.soaustin.net (pancho.soaustin.net [76.74.250.40]) by mx1.freebsd.org (Postfix) with ESMTP id 1037112E5; Sat, 12 Apr 2014 00:55:01 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id 4FDB85607F; Fri, 11 Apr 2014 19:55:01 -0500 (CDT) Date: Fri, 11 Apr 2014 19:55:01 -0500 From: Mark Linimon To: Warner Losh Subject: Re: svn commit: r264345 - in head: . contrib/llvm/tools/clang/lib/Driver Message-ID: <20140412005501.GB31966@lonesome.com> References: <201404111651.s3BGpa0M041002@svn.freebsd.org> <20140411171217.GA42105@troutmask.apl.washington.edu> <6BAAEBB4-46A2-45AE-9A8D-7ECAAAFBD269@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6BAAEBB4-46A2-45AE-9A8D-7ECAAAFBD269@bsdimp.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric , Steve Kargl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 00:55:02 -0000 On Fri, Apr 11, 2014 at 02:18:38PM -0600, Warner Losh wrote: > So attacking that there was fallout is really out of line. +1 From owner-svn-src-head@FreeBSD.ORG Sat Apr 12 02:05:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B2A7A57; Sat, 12 Apr 2014 02:05:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4775D187A; Sat, 12 Apr 2014 02:05:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3C25Wmo071063; Sat, 12 Apr 2014 02:05:32 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3C25W49071062; Sat, 12 Apr 2014 02:05:32 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201404120205.s3C25W49071062@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sat, 12 Apr 2014 02:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264364 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 02:05:32 -0000 Author: ae Date: Sat Apr 12 02:05:31 2014 New Revision: 264364 URL: http://svnweb.freebsd.org/changeset/base/264364 Log: Properly release the in6_multi lock. MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netinet6/in6_mcast.c Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Fri Apr 11 22:45:12 2014 (r264363) +++ head/sys/netinet6/in6_mcast.c Sat Apr 12 02:05:31 2014 (r264364) @@ -1450,16 +1450,15 @@ in6p_block_unblock_source(struct inpcb * CTR1(KTR_MLD, "%s: merge inm state", __func__); error = in6m_merge(inm, imf); - if (error) { + if (error) CTR1(KTR_MLD, "%s: failed to merge inm state", __func__); - goto out_im6f_rollback; + else { + CTR1(KTR_MLD, "%s: doing mld downcall", __func__); + error = mld_change_state(inm, 0); + if (error) + CTR1(KTR_MLD, "%s: failed mld downcall", __func__); } - CTR1(KTR_MLD, "%s: doing mld downcall", __func__); - error = mld_change_state(inm, 0); - if (error) - CTR1(KTR_MLD, "%s: failed mld downcall", __func__); - IN6_MULTI_UNLOCK(); out_im6f_rollback: @@ -2044,29 +2043,27 @@ in6p_join_group(struct inpcb *inp, struc if (is_new) { error = in6_mc_join_locked(ifp, &gsa->sin6.sin6_addr, imf, &inm, 0); - if (error) + if (error) { + IN6_MULTI_UNLOCK(); goto out_im6o_free; + } imo->im6o_membership[idx] = inm; } else { CTR1(KTR_MLD, "%s: merge inm state", __func__); error = in6m_merge(inm, imf); - if (error) { + if (error) CTR1(KTR_MLD, "%s: failed to merge inm state", __func__); - goto out_im6f_rollback; - } - CTR1(KTR_MLD, "%s: doing mld downcall", __func__); - error = mld_change_state(inm, 0); - if (error) { - CTR1(KTR_MLD, "%s: failed mld downcall", - __func__); - goto out_im6f_rollback; + else { + CTR1(KTR_MLD, "%s: doing mld downcall", __func__); + error = mld_change_state(inm, 0); + if (error) + CTR1(KTR_MLD, "%s: failed mld downcall", + __func__); } } IN6_MULTI_UNLOCK(); - -out_im6f_rollback: INP_WLOCK_ASSERT(inp); if (error) { im6f_rollback(imf); @@ -2293,23 +2290,20 @@ in6p_leave_group(struct inpcb *inp, stru } else { CTR1(KTR_MLD, "%s: merge inm state", __func__); error = in6m_merge(inm, imf); - if (error) { + if (error) CTR1(KTR_MLD, "%s: failed to merge inm state", __func__); - goto out_im6f_rollback; - } - - CTR1(KTR_MLD, "%s: doing mld downcall", __func__); - error = mld_change_state(inm, 0); - if (error) { - CTR1(KTR_MLD, "%s: failed mld downcall", - __func__); + else { + CTR1(KTR_MLD, "%s: doing mld downcall", __func__); + error = mld_change_state(inm, 0); + if (error) + CTR1(KTR_MLD, "%s: failed mld downcall", + __func__); } } IN6_MULTI_UNLOCK(); -out_im6f_rollback: if (error) im6f_rollback(imf); else @@ -2518,16 +2512,15 @@ in6p_set_source_filters(struct inpcb *in */ CTR1(KTR_MLD, "%s: merge inm state", __func__); error = in6m_merge(inm, imf); - if (error) { + if (error) CTR1(KTR_MLD, "%s: failed to merge inm state", __func__); - goto out_im6f_rollback; + else { + CTR1(KTR_MLD, "%s: doing mld downcall", __func__); + error = mld_change_state(inm, 0); + if (error) + CTR1(KTR_MLD, "%s: failed mld downcall", __func__); } - CTR1(KTR_MLD, "%s: doing mld downcall", __func__); - error = mld_change_state(inm, 0); - if (error) - CTR1(KTR_MLD, "%s: failed mld downcall", __func__); - IN6_MULTI_UNLOCK(); out_im6f_rollback: From owner-svn-src-head@FreeBSD.ORG Sat Apr 12 12:44:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A9D6EDD; Sat, 12 Apr 2014 12:44:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E17471368; Sat, 12 Apr 2014 12:44:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3CCiAfD035092; Sat, 12 Apr 2014 12:44:10 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CCiAS3035089; Sat, 12 Apr 2014 12:44:10 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201404121244.s3CCiAS3035089@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sat, 12 Apr 2014 12:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264367 - in head: gnu/lib/libgcc share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 12:44:11 -0000 Author: des Date: Sat Apr 12 12:44:09 2014 New Revision: 264367 URL: http://svnweb.freebsd.org/changeset/base/264367 Log: Introduce RANLIBFLAGS to mirror ARFLAGS and add -D to both. This sets all timestamps in static libraries to 0 so that consecutive builds from the same source, even on different machines, produce identical libraries. MFC after: 3 weeks Modified: head/gnu/lib/libgcc/Makefile head/share/mk/bsd.lib.mk head/share/mk/sys.mk Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Sat Apr 12 06:50:11 2014 (r264366) +++ head/gnu/lib/libgcc/Makefile Sat Apr 12 12:44:09 2014 (r264367) @@ -352,7 +352,7 @@ libgcc_eh.a: ${EH_OBJS_T} @${ECHO} building static gcc_eh library @rm -f ${.TARGET} @${AR} ${ARFLAGS} ${.TARGET} `lorder ${EH_OBJS_T} | tsort -q` - ${RANLIB} ${.TARGET} + ${RANLIB} ${RANLIBFLAGS} ${.TARGET} all: libgcc_eh.a @@ -361,7 +361,7 @@ libgcc_eh_p.a: ${EH_OBJS_P} @${ECHO} building profiled gcc_eh library @rm -f ${.TARGET} @${AR} ${ARFLAGS} ${.TARGET} `lorder ${EH_OBJS_P} | tsort -q` - ${RANLIB} ${.TARGET} + ${RANLIB} ${RANLIBFLAGS} ${.TARGET} all: libgcc_eh_p.a .endif Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Sat Apr 12 06:50:11 2014 (r264366) +++ head/share/mk/bsd.lib.mk Sat Apr 12 12:44:09 2014 (r264367) @@ -172,7 +172,7 @@ lib${LIB}.a: ${OBJS} ${STATICOBJS} .else @${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${OBJS} ${STATICOBJS} | tsort -q` ${ARADD} .endif - ${RANLIB} ${.TARGET} + ${RANLIB} ${RANLIBFLAGS} ${.TARGET} .endif .if !defined(INTERNALLIB) @@ -189,7 +189,7 @@ lib${LIB}_p.a: ${POBJS} .else @${AR} ${ARFLAGS} ${.TARGET} `NM='${NM}' lorder ${POBJS} | tsort -q` ${ARADD} .endif - ${RANLIB} ${.TARGET} + ${RANLIB} ${RANLIBFLAGS} ${.TARGET} .endif .if defined(SHLIB_NAME) || \ @@ -246,7 +246,7 @@ lib${LIB}_pic.a: ${SOBJS} @${ECHO} building special pic ${LIB} library @rm -f ${.TARGET} @${AR} ${ARFLAGS} ${.TARGET} ${SOBJS} ${ARADD} - ${RANLIB} ${.TARGET} + ${RANLIB} ${RANLIBFLAGS} ${.TARGET} .endif .if defined(WANT_LINT) && !defined(NO_LINT) && defined(LIB) && !empty(LIB) Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Sat Apr 12 06:50:11 2014 (r264366) +++ head/share/mk/sys.mk Sat Apr 12 12:44:09 2014 (r264367) @@ -39,9 +39,12 @@ AR ?= ar .if defined(%POSIX) ARFLAGS ?= -rv .else -ARFLAGS ?= cru +ARFLAGS ?= -crD .endif RANLIB ?= ranlib +.if !defined(%POSIX) +RANLIBFLAGS ?= -D +.endif AS ?= as AFLAGS ?= From owner-svn-src-head@FreeBSD.ORG Sat Apr 12 18:01:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25945FFB; Sat, 12 Apr 2014 18:01:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 121AB1039; Sat, 12 Apr 2014 18:01:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3CI1PvN065813; Sat, 12 Apr 2014 18:01:25 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CI1PX9065556; Sat, 12 Apr 2014 18:01:25 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201404121801.s3CI1PX9065556@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sat, 12 Apr 2014 18:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264374 - in head: contrib/amd/amd usr.sbin/amd/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 18:01:26 -0000 Author: des Date: Sat Apr 12 18:01:25 2014 New Revision: 264374 URL: http://svnweb.freebsd.org/changeset/base/264374 Log: Remove the names of the build host and user and the build date. This still leaves the host OS and version, but these are harder to remove. MFC after: 3 weeks Modified: head/contrib/amd/amd/get_args.c head/usr.sbin/amd/include/newvers.sh Modified: head/contrib/amd/amd/get_args.c ============================================================================== --- head/contrib/amd/amd/get_args.c Sat Apr 12 15:13:43 2014 (r264373) +++ head/contrib/amd/amd/get_args.c Sat Apr 12 18:01:25 2014 (r264374) @@ -93,12 +93,6 @@ get_version_string(void) strlcat(vers, tmpbuf, len); xsnprintf(tmpbuf, sizeof(tmpbuf), "Report bugs to %s.\n", PACKAGE_BUGREPORT); strlcat(vers, tmpbuf, len); - xsnprintf(tmpbuf, sizeof(tmpbuf), "Configured by %s@%s on date %s.\n", - USER_NAME, HOST_NAME, CONFIG_DATE); - strlcat(vers, tmpbuf, len); - xsnprintf(tmpbuf, sizeof(tmpbuf), "Built by %s@%s.\n", - BUILD_USER, BUILD_HOST); - strlcat(vers, tmpbuf, len); xsnprintf(tmpbuf, sizeof(tmpbuf), "cpu=%s (%s-endian), arch=%s, karch=%s.\n", cpu, endian, gopt.arch, gopt.karch); strlcat(vers, tmpbuf, len); Modified: head/usr.sbin/amd/include/newvers.sh ============================================================================== --- head/usr.sbin/amd/include/newvers.sh Sat Apr 12 15:13:43 2014 (r264373) +++ head/usr.sbin/amd/include/newvers.sh Sat Apr 12 18:01:25 2014 (r264374) @@ -31,13 +31,4 @@ fi cat << __EOF -/* Define name of host */ -#define BUILD_HOST "`hostname`" - -/* Define user name */ -#define BUILD_USER "`whoami`" - -/* Define configuration date */ -#define BUILD_DATE "`LC_ALL=C date`" - __EOF From owner-svn-src-head@FreeBSD.ORG Sat Apr 12 20:28:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 237ACB6D; Sat, 12 Apr 2014 20:28:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA74D1B32; Sat, 12 Apr 2014 20:28:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3CKSdbp026395; Sat, 12 Apr 2014 20:28:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CKSdo1026394; Sat, 12 Apr 2014 20:28:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201404122028.s3CKSdo1026394@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 12 Apr 2014 20:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264378 - head/sys/geom/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 20:28:40 -0000 Author: marcel Date: Sat Apr 12 20:28:39 2014 New Revision: 264378 URL: http://svnweb.freebsd.org/changeset/base/264378 Log: Align and round the partitionable disk space to 4K by default. Since this would also apply when recovering, make sure not to align or round when that would have a partition fall outside the partitionable area. Modified: head/sys/geom/part/g_part_gpt.c Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Sat Apr 12 20:22:59 2014 (r264377) +++ head/sys/geom/part/g_part_gpt.c Sat Apr 12 20:28:39 2014 (r264378) @@ -1174,9 +1174,12 @@ g_part_gpt_write(struct g_part_table *ba static void g_gpt_set_defaults(struct g_part_table *basetable, struct g_provider *pp) { + struct g_part_entry *baseentry; + struct g_part_gpt_entry *entry; struct g_part_gpt_table *table; - quad_t last; - size_t tblsz; + quad_t start, end, min, max; + quad_t lba, last; + size_t spb, tblsz; table = (struct g_part_gpt_table *)basetable; last = pp->mediasize / pp->sectorsize - 1; @@ -1192,11 +1195,31 @@ g_gpt_set_defaults(struct g_part_table * table->state[GPT_ELT_SECHDR] = GPT_STATE_OK; table->state[GPT_ELT_SECTBL] = GPT_STATE_OK; - table->hdr->hdr_lba_start = 2 + tblsz; - table->hdr->hdr_lba_end = last - tblsz - 1; + max = start = 2 + tblsz; + min = end = last - tblsz - 1; + LIST_FOREACH(baseentry, &basetable->gpt_entry, gpe_entry) { + if (baseentry->gpe_deleted) + continue; + entry = (struct g_part_gpt_entry *)baseentry; + if (entry->ent.ent_lba_start < min) + min = entry->ent.ent_lba_start; + if (entry->ent.ent_lba_end > max) + max = entry->ent.ent_lba_end; + } + spb = 4096 / pp->sectorsize; + if (spb > 1) { + lba = start + ((start % spb) ? spb - start % spb : 0); + if (lba <= min) + start = lba; + lba = end - (end + 1) % spb; + if (max <= lba) + end = lba; + } + table->hdr->hdr_lba_start = start; + table->hdr->hdr_lba_end = end; - basetable->gpt_first = table->hdr->hdr_lba_start; - basetable->gpt_last = table->hdr->hdr_lba_end; + basetable->gpt_first = start; + basetable->gpt_last = end; } static void From owner-svn-src-head@FreeBSD.ORG Sat Apr 12 21:04:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0511BB85; Sat, 12 Apr 2014 21:04:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E56371FA2; Sat, 12 Apr 2014 21:04:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3CL4rRd042879; Sat, 12 Apr 2014 21:04:53 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CL4rvI042878; Sat, 12 Apr 2014 21:04:53 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404122104.s3CL4rvI042878@svn.freebsd.org> From: Christian Brueffer Date: Sat, 12 Apr 2014 21:04:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264384 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 21:04:54 -0000 Author: brueffer Date: Sat Apr 12 21:04:53 2014 New Revision: 264384 URL: http://svnweb.freebsd.org/changeset/base/264384 Log: mdoc and language improvements. MFC after: 1 week Modified: head/share/man/man4/timecounters.4 Modified: head/share/man/man4/timecounters.4 ============================================================================== --- head/share/man/man4/timecounters.4 Sat Apr 12 20:51:38 2014 (r264383) +++ head/share/man/man4/timecounters.4 Sat Apr 12 21:04:53 2014 (r264384) @@ -31,20 +31,20 @@ .Nm timecounters .Nd kernel time counters subsystem .Sh SYNOPSIS -Kernel uses several types of time-related devices, such as: real time clocks, +The kernel uses several types of time-related devices, such as: real time clocks, time counters and event timers. -Real time clocks responsible for tracking real world time, mostly when system +Real time clocks are responsible for tracking real world time, mostly when the system is down. -Time counters are responsible for tracking purposes, when system is running. -Event timers are responsible for generating interrupts at specified time or +Time counters are responsible for tracking purposes, when the system is running. +Event timers are responsible for generating interrupts at a specified time or periodically, to run different time-based events. This page is about the second. .Sh DESCRIPTION -Time counters are the lowest level of time tracking in kernel. +Time counters are the lowest level of time tracking in the kernel. They provide monotonically increasing timestamps with known width and update frequency. -They can overflow, drift, etc and so in raw form used only in very limited -performance-critical places like process scheduler. +They can overflow, drift, etc and so in raw form can be used only in very limited +performance-critical places like the process scheduler. .Pp More usable time is created by scaling the values read from the selected time counter and combining it with some offset, regularly updated by @@ -54,13 +54,14 @@ on invocation. .Pp Different platforms provide different kinds of timer hardware. -The goal of the time counters subsystem is to provide unified way to access +The goal of the time counters subsystem is to provide a unified way to access that hardware. .Pp -Each driver implementing time counters, registers them at the subsystem. -It is possible to see the list of present time counters, like this, via +Each driver implementing time counters registers them with the subsystem. +It is possible to see the list of present time counters, via the .Va kern.timecounter -sysctl: +.Xr sysctl 8 +variable: .Bd -literal kern.timecounter.choice: TSC-low(-100) HPET(950) i8254(0) ACPI-fast(900) dummy(-1000000) kern.timecounter.tc.ACPI-fast.mask: 16777215 @@ -81,7 +82,7 @@ kern.timecounter.tc.TSC-low.frequency: 1 kern.timecounter.tc.TSC-low.quality: -100 .Ed .Pp -where: +The output nodes are defined as follows: .Bl -inset .It Va kern.timecounter.tc. Ns Ar X Ns Va .mask is a bitmask, defining valid counter bits, @@ -90,13 +91,13 @@ is a present counter value, .It Va kern.timecounter.tc. Ns Ar X Ns Va .frequency is a counter update frequency, .It Va kern.timecounter.tc. Ns Ar X Ns Va .quality -is an integral value, defining how good is this time counter, -comparing to others. -Negative value means that this time counter is broken and should not be used. +is an integral value, defining the quality of this time counter +compared to others. +A negative value means this time counter is broken and should not be used. .El .Pp -Time management code of the kernel chooses one time counter from that list. -Current choice can be read and affected via +The time management code of the kernel chooses one time counter from that list. +The current choice can be read and affected via the .Va kern.timecounter.hardware tunable/sysctl. .Sh SEE ALSO From owner-svn-src-head@FreeBSD.ORG Sat Apr 12 21:39:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C2793A7; Sat, 12 Apr 2014 21:39:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 693FF1211; Sat, 12 Apr 2014 21:39:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3CLdIp0056059; Sat, 12 Apr 2014 21:39:18 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CLdIRh056058; Sat, 12 Apr 2014 21:39:18 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201404122139.s3CLdIRh056058@svn.freebsd.org> From: Bryan Drewery Date: Sat, 12 Apr 2014 21:39:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264385 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 21:39:18 -0000 Author: bdrewery Date: Sat Apr 12 21:39:17 2014 New Revision: 264385 URL: http://svnweb.freebsd.org/changeset/base/264385 Log: Use proper MFSNAMELEN for fs type. MFC after: 2 weeks Reviewed by: rodrigc Also spotted by:ambrisko Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sat Apr 12 21:04:53 2014 (r264384) +++ head/sys/kern/vfs_mount.c Sat Apr 12 21:39:17 2014 (r264385) @@ -748,7 +748,7 @@ sys_mount(td, uap) return (EOPNOTSUPP); } - ma = mount_argsu(ma, "fstype", uap->type, MNAMELEN); + ma = mount_argsu(ma, "fstype", uap->type, MFSNAMELEN); ma = mount_argsu(ma, "fspath", uap->path, MNAMELEN); ma = mount_argb(ma, flags & MNT_RDONLY, "noro"); ma = mount_argb(ma, !(flags & MNT_NOSUID), "nosuid"); From owner-svn-src-head@FreeBSD.ORG Sat Apr 12 22:05:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A18FF4D; Sat, 12 Apr 2014 22:05:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F14B714A5; Sat, 12 Apr 2014 22:05:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3CM53aA068661; Sat, 12 Apr 2014 22:05:03 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CM531U068660; Sat, 12 Apr 2014 22:05:03 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404122205.s3CM531U068660@svn.freebsd.org> From: Christian Brueffer Date: Sat, 12 Apr 2014 22:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264386 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 22:05:04 -0000 Author: brueffer Date: Sat Apr 12 22:05:03 2014 New Revision: 264386 URL: http://svnweb.freebsd.org/changeset/base/264386 Log: Improve markup and remove contractions. MFC after: 1 week Modified: head/share/man/man4/usb_quirk.4 Modified: head/share/man/man4/usb_quirk.4 ============================================================================== --- head/share/man/man4/usb_quirk.4 Sat Apr 12 21:39:17 2014 (r264385) +++ head/share/man/man4/usb_quirk.4 Sat Apr 12 22:05:03 2014 (r264386) @@ -49,13 +49,13 @@ swap left and right channels .It UQ_AU_INP_ASYNC input is async despite claim of adaptive .It UQ_AU_NO_FRAC -don't adjust for fractional samples +do not adjust for fractional samples .It UQ_AU_NO_XU audio device has broken extension unit .It UQ_BAD_ADC bad audio spec version number .It UQ_BAD_AUDIO -device claims audio class, but isn't +device claims audio class, but is not .It UQ_BROKEN_BIDIR printer has broken bidir mode .It UQ_BUS_POWERED @@ -69,7 +69,7 @@ device should set the boot protocol .It UQ_UMS_IGNORE device should be ignored by ums class .It UQ_MS_BAD_CLASS -doesn't identify properly +does not identify properly .It UQ_MS_LEADING_BYTE mouse sends an unknown leading byte .It UQ_MS_REVZ @@ -150,27 +150,28 @@ ejects after Huawei USB command ejects after Sierra USB command .It UQ_MSC_EJECT_SCSIEJECT ejects after SCSI eject command -0x1b0000000200 +.Dv 0x1b0000000200 .It UQ_MSC_EJECT_REZERO ejects after SCSI rezero command -0x010000000000 +.Dv 0x010000000000 .It UQ_MSC_EJECT_ZTESTOR ejects after ZTE SCSI command -0x850101011801010101010000 +.Dv 0x850101011801010101010000 .It UQ_MSC_EJECT_CMOTECH ejects after C-motech SCSI command -0xff52444556434847 +.Dv 0xff52444556434847 .It UQ_MSC_EJECT_WAIT wait for the device to eject .It UQ_MSC_EJECT_SAEL_M460 ejects after Sael USB commands .It UQ_MSC_EJECT_HUAWEISCSI ejects after Huawei SCSI command -0x11060000000000000000000000000000 +.Dv 0x11060000000000000000000000000000 .It UQ_MSC_EJECT_TCT ejects after TCT SCSI command -0x06f504025270 +.Dv 0x06f504025270 .El +.Pp See .Pa /sys/dev/usb/quirk/usb_quirk.h for the complete list of supported quirks. From owner-svn-src-head@FreeBSD.ORG Sat Apr 12 22:36:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7339AABB; Sat, 12 Apr 2014 22:36:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53CB816D9; Sat, 12 Apr 2014 22:36:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3CMaSmh081687; Sat, 12 Apr 2014 22:36:28 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CMaRae081682; Sat, 12 Apr 2014 22:36:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404122236.s3CMaRae081682@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 12 Apr 2014 22:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264387 - head/usr.bin/find X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 22:36:28 -0000 Author: jilles Date: Sat Apr 12 22:36:26 2014 New Revision: 264387 URL: http://svnweb.freebsd.org/changeset/base/264387 Log: find: Correctly propagate -exec/-execdir ... {} + exit status. As per POSIX, the -exec ... {} + primary always returns true, but a non-zero exit status causes find to return a non-zero exit status itself. GNU does the same, and also for -execdir ... {} +. It does not make much sense to return false from the primary only when the child process happens to be run. The behaviour for -exec/-execdir ... ; remains unchanged: the primary returns true or false depending on the exit status, and find's exit status is unaffected. Modified: head/usr.bin/find/extern.h head/usr.bin/find/find.1 head/usr.bin/find/find.c head/usr.bin/find/function.c head/usr.bin/find/main.c Modified: head/usr.bin/find/extern.h ============================================================================== --- head/usr.bin/find/extern.h Sat Apr 12 22:05:03 2014 (r264386) +++ head/usr.bin/find/extern.h Sat Apr 12 22:36:26 2014 (r264387) @@ -118,6 +118,7 @@ extern int ftsoptions, ignore_readdir_ra extern int issort, isxargs; extern int mindepth, maxdepth; extern int regexp_flags; +extern int exitstatus; extern time_t now; extern int dotfd; extern FTS *tree; Modified: head/usr.bin/find/find.1 ============================================================================== --- head/usr.bin/find/find.1 Sat Apr 12 22:05:03 2014 (r264386) +++ head/usr.bin/find/find.1 Sat Apr 12 22:36:26 2014 (r264387) @@ -31,7 +31,7 @@ .\" @(#)find.1 8.7 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd January 5, 2014 +.Dd April 12, 2014 .Dt FIND 1 .Os .Sh NAME @@ -384,6 +384,12 @@ is replaced with as many pathnames as po .Ar utility . This behaviour is similar to that of .Xr xargs 1 . +The primary always returns true; +if at least one invocation of +.Ar utility +returns a non-zero exit status, +.Nm +will return a non-zero exit status. .It Ic -execdir Ar utility Oo Ar argument ... Oc Li \&; The .Ic -execdir @@ -406,6 +412,12 @@ is replaced with as many pathnames as po .Ar utility . This behaviour is similar to that of .Xr xargs 1 . +The primary always returns true; +if at least one invocation of +.Ar utility +returns a non-zero exit status, +.Nm +will return a non-zero exit status. .It Ic -flags Oo Cm - Ns | Ns Cm + Oc Ns Ar flags , Ns Ar notflags The flags are specified using symbolic names (see .Xr chflags 1 ) . Modified: head/usr.bin/find/find.c ============================================================================== --- head/usr.bin/find/find.c Sat Apr 12 22:05:03 2014 (r264386) +++ head/usr.bin/find/find.c Sat Apr 12 22:36:26 2014 (r264387) @@ -175,13 +175,14 @@ find_execute(PLAN *plan, char *paths[]) { FTSENT *entry; PLAN *p; - int e, rval; + int e; tree = fts_open(paths, ftsoptions, (issort ? find_compare : NULL)); if (tree == NULL) err(1, "ftsopen"); - for (rval = 0; errno = 0, (entry = fts_read(tree)) != NULL;) { + exitstatus = 0; + while (errno = 0, (entry = fts_read(tree)) != NULL) { if (maxdepth != -1 && entry->fts_level >= maxdepth) { if (fts_set(tree, entry, FTS_SKIP)) err(1, "%s", entry->fts_path); @@ -206,7 +207,7 @@ find_execute(PLAN *plan, char *paths[]) (void)fflush(stdout); warnx("%s: %s", entry->fts_path, strerror(entry->fts_errno)); - rval = 1; + exitstatus = 1; continue; #ifdef FTS_W case FTS_W: @@ -217,7 +218,7 @@ find_execute(PLAN *plan, char *paths[]) if (isxargs && strpbrk(entry->fts_path, BADCH)) { (void)fflush(stdout); warnx("%s: illegal path", entry->fts_path); - rval = 1; + exitstatus = 1; continue; } @@ -235,5 +236,5 @@ find_execute(PLAN *plan, char *paths[]) finish_execplus(); if (e && (!ignore_readdir_race || e != ENOENT)) errc(1, e, "fts_read"); - return (rval); + return (exitstatus); } Modified: head/usr.bin/find/function.c ============================================================================== --- head/usr.bin/find/function.c Sat Apr 12 22:05:03 2014 (r264386) +++ head/usr.bin/find/function.c Sat Apr 12 22:36:26 2014 (r264387) @@ -671,7 +671,13 @@ doexec: if ((plan->flags & F_NEEDOK) && plan->e_psize = plan->e_pbsize; } pid = waitpid(pid, &status, 0); - return (pid != -1 && WIFEXITED(status) && !WEXITSTATUS(status)); + if (pid != -1 && WIFEXITED(status) && !WEXITSTATUS(status)) + return (1); + if (plan->flags & F_EXECPLUS) { + exitstatus = 1; + return (1); + } + return (0); } /* Modified: head/usr.bin/find/main.c ============================================================================== --- head/usr.bin/find/main.c Sat Apr 12 22:05:03 2014 (r264386) +++ head/usr.bin/find/main.c Sat Apr 12 22:36:26 2014 (r264387) @@ -72,6 +72,7 @@ int issort; /* do hierarchies int isxargs; /* don't permit xargs delimiting chars */ int mindepth = -1, maxdepth = -1; /* minimum and maximum depth */ int regexp_flags = REG_BASIC; /* use the "basic" regexp by default*/ +int exitstatus; static void usage(void); From owner-svn-src-head@FreeBSD.ORG Sat Apr 12 23:29:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B308F0E; Sat, 12 Apr 2014 23:29:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C2481A21; Sat, 12 Apr 2014 23:29:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3CNTUg3002380; Sat, 12 Apr 2014 23:29:30 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CNTTSZ002375; Sat, 12 Apr 2014 23:29:29 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201404122329.s3CNTTSZ002375@svn.freebsd.org> From: Davide Italiano Date: Sat, 12 Apr 2014 23:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264388 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 23:29:30 -0000 Author: davide Date: Sat Apr 12 23:29:29 2014 New Revision: 264388 URL: http://svnweb.freebsd.org/changeset/base/264388 Log: Hide internal details of sbintime_t implementation wrapping INT64_MAX into SBT_MAX, to make it more robust in case internal type representation will change in the future. All the consumers were migrated to SBT_MAX and every new consumer (if any) should from now use this interface. Requested by: bapt, jmg, Ryan Lortie (implictly) Reviewed by: mav, bde Modified: head/sys/kern/kern_clocksource.c head/sys/kern/kern_event.c head/sys/kern/kern_timeout.c head/sys/kern/sys_generic.c head/sys/sys/time.h Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Sat Apr 12 22:36:26 2014 (r264387) +++ head/sys/kern/kern_clocksource.c Sat Apr 12 23:29:29 2014 (r264388) @@ -217,13 +217,13 @@ handleevents(sbintime_t now, int fake) } else state->nextprof = state->nextstat; if (now >= state->nextcallopt) { - state->nextcall = state->nextcallopt = INT64_MAX; + state->nextcall = state->nextcallopt = SBT_MAX; callout_process(now); } #ifdef KDTRACE_HOOKS if (fake == 0 && now >= state->nextcyc && cyclic_clock_func != NULL) { - state->nextcyc = INT64_MAX; + state->nextcyc = SBT_MAX; (*cyclic_clock_func)(frame); } #endif @@ -509,7 +509,7 @@ configtimer(int start) state = DPCPU_ID_PTR(cpu, timerstate); state->now = now; if (!smp_started && cpu != CPU_FIRST()) - state->nextevent = INT64_MAX; + state->nextevent = SBT_MAX; else state->nextevent = next; if (periodic) @@ -598,10 +598,10 @@ cpu_initclocks_bsp(void) state = DPCPU_ID_PTR(cpu, timerstate); mtx_init(&state->et_hw_mtx, "et_hw_mtx", NULL, MTX_SPIN); #ifdef KDTRACE_HOOKS - state->nextcyc = INT64_MAX; + state->nextcyc = SBT_MAX; #endif - state->nextcall = INT64_MAX; - state->nextcallopt = INT64_MAX; + state->nextcall = SBT_MAX; + state->nextcallopt = SBT_MAX; } periodic = want_periodic; /* Grab requested timer or the best of present. */ Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sat Apr 12 22:36:26 2014 (r264387) +++ head/sys/kern/kern_event.c Sat Apr 12 23:29:29 2014 (r264388) @@ -528,8 +528,8 @@ timer2sbintime(intptr_t data) { #ifdef __LP64__ - if (data > INT64_MAX / SBT_1MS) - return INT64_MAX; + if (data > SBT_MAX / SBT_1MS) + return (SBT_MAX); #endif return (SBT_1MS * data); } @@ -1399,7 +1399,7 @@ kqueue_scan(struct kqueue *kq, int maxev rsbt = tstosbt(*tsp); if (TIMESEL(&asbt, rsbt)) asbt += tc_tick_sbt; - if (asbt <= INT64_MAX - rsbt) + if (asbt <= SBT_MAX - rsbt) asbt += rsbt; else asbt = 0; Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Sat Apr 12 22:36:26 2014 (r264387) +++ head/sys/kern/kern_timeout.c Sat Apr 12 23:29:29 2014 (r264388) @@ -302,7 +302,7 @@ callout_cpu_init(struct callout_cpu *cc) for (i = 0; i < callwheelsize; i++) LIST_INIT(&cc->cc_callwheel[i]); TAILQ_INIT(&cc->cc_expireq); - cc->cc_firstevent = INT64_MAX; + cc->cc_firstevent = SBT_MAX; for (i = 0; i < 2; i++) cc_cce_cleanup(cc, i); if (cc->cc_callout == NULL) /* Only cpu0 handles timeout(9) */ @@ -574,8 +574,8 @@ callout_cc_add(struct callout *c, struct * Inform the eventtimers(4) subsystem there's a new callout * that has been inserted, but only if really required. */ - if (INT64_MAX - c->c_time < c->c_precision) - c->c_precision = INT64_MAX - c->c_time; + if (SBT_MAX - c->c_time < c->c_precision) + c->c_precision = SBT_MAX - c->c_time; sbt = c->c_time + c->c_precision; if (sbt < cc->cc_firstevent) { cc->cc_firstevent = sbt; @@ -953,8 +953,8 @@ callout_reset_sbt_on(struct callout *c, to_sbt += tick_sbt; } else to_sbt = sbinuptime(); - if (INT64_MAX - to_sbt < sbt) - to_sbt = INT64_MAX; + if (SBT_MAX - to_sbt < sbt) + to_sbt = SBT_MAX; else to_sbt += sbt; pr = ((C_PRELGET(flags) < 0) ? sbt >> tc_precexp : Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Sat Apr 12 22:36:26 2014 (r264387) +++ head/sys/kern/sys_generic.c Sat Apr 12 23:29:29 2014 (r264388) @@ -1072,7 +1072,7 @@ kern_select(struct thread *td, int nd, f precision >>= tc_precexp; if (TIMESEL(&asbt, rsbt)) asbt += tc_tick_sbt; - if (asbt <= INT64_MAX - rsbt) + if (asbt <= SBT_MAX - rsbt) asbt += rsbt; else asbt = -1; @@ -1547,7 +1547,7 @@ selsocket(struct socket *so, int events, precision >>= tc_precexp; if (TIMESEL(&asbt, rsbt)) asbt += tc_tick_sbt; - if (asbt <= INT64_MAX - rsbt) + if (asbt <= SBT_MAX - rsbt) asbt += rsbt; else asbt = -1; Modified: head/sys/sys/time.h ============================================================================== --- head/sys/sys/time.h Sat Apr 12 22:36:26 2014 (r264387) +++ head/sys/sys/time.h Sat Apr 12 23:29:29 2014 (r264388) @@ -129,6 +129,7 @@ bintime_shift(struct bintime *_bt, int _ #define SBT_1MS (SBT_1S / 1000) #define SBT_1US (SBT_1S / 1000000) #define SBT_1NS (SBT_1S / 1000000000) +#define SBT_MAX INT64_MAX static __inline int sbintime_getsec(sbintime_t _sbt) From owner-svn-src-head@FreeBSD.ORG Sat Apr 12 23:40:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D30A548F; Sat, 12 Apr 2014 23:40:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C00C91AFD; Sat, 12 Apr 2014 23:40:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3CNesvs009723; Sat, 12 Apr 2014 23:40:54 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3CNesfR009722; Sat, 12 Apr 2014 23:40:54 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201404122340.s3CNesfR009722@svn.freebsd.org> From: Rui Paulo Date: Sat, 12 Apr 2014 23:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264389 - head/sys/dev/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Apr 2014 23:40:54 -0000 Author: rpaulo Date: Sat Apr 12 23:40:54 2014 New Revision: 264389 URL: http://svnweb.freebsd.org/changeset/base/264389 Log: Fix the style of ata_interrupt_locked(). Modified: head/sys/dev/ata/ata-all.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Sat Apr 12 23:29:29 2014 (r264388) +++ head/sys/dev/ata/ata-all.c Sat Apr 12 23:40:54 2014 (r264389) @@ -360,24 +360,23 @@ ata_interrupt(void *data) static void ata_interrupt_locked(void *data) { - struct ata_channel *ch = (struct ata_channel *)data; - struct ata_request *request; + struct ata_channel *ch = (struct ata_channel *)data; + struct ata_request *request; - do { /* ignore interrupt if its not for us */ if (ch->hw.status && !ch->hw.status(ch->dev)) - break; + return; /* do we have a running request */ if (!(request = ch->running)) - break; + return; ATA_DEBUG_RQ(request, "interrupt"); /* safetycheck for the right state */ if (ch->state == ATA_IDLE) { - device_printf(request->dev, "interrupt on idle channel ignored\n"); - break; + device_printf(request->dev, "interrupt on idle channel ignored\n"); + return; } /* @@ -385,13 +384,12 @@ ata_interrupt_locked(void *data) * if it finishes immediately otherwise wait for next interrupt */ if (ch->hw.end_transaction(request) == ATA_OP_FINISHED) { - ch->running = NULL; - if (ch->state == ATA_ACTIVE) - ch->state = ATA_IDLE; - ata_cam_end_transaction(ch->dev, request); - return; + ch->running = NULL; + if (ch->state == ATA_ACTIVE) + ch->state = ATA_IDLE; + ata_cam_end_transaction(ch->dev, request); + return; } - } while (0); } static void From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 01:02:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7464A359; Sun, 13 Apr 2014 01:02:34 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D3611246; Sun, 13 Apr 2014 01:02:33 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s3D12QwX012686 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 12 Apr 2014 18:02:27 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s3D12QeL012685; Sat, 12 Apr 2014 18:02:26 -0700 (PDT) (envelope-from jmg) Date: Sat, 12 Apr 2014 18:02:26 -0700 From: John-Mark Gurney To: sbruno@freebsd.org Subject: Re: svn commit: r264269 - in head: sys/conf sys/kern sys/modules sys/modules/imgact_binmisc sys/sys usr.sbin usr.sbin/binmiscctl Message-ID: <20140413010226.GF34745@funkthat.com> References: <201404082010.s38KAMgg091287@svn.freebsd.org> <201404081625.23418.jhb@freebsd.org> <1396994509.2018.12.camel@powernoodle.corp.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1396994509.2018.12.camel@powernoodle.corp.yahoo.com> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Sat, 12 Apr 2014 18:02:27 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 01:02:34 -0000 Sean Bruno wrote this message on Tue, Apr 08, 2014 at 15:01 -0700: > > > Added: > > > head/sys/kern/imgact_binmisc.c (contents, props changed) > > > head/sys/modules/imgact_binmisc/ > > > head/sys/modules/imgact_binmisc/Makefile (contents, props changed) > > > head/sys/sys/imgact_binmisc.h (contents, props changed) > > > head/usr.sbin/binmiscctl/ > > > head/usr.sbin/binmiscctl/Makefile (contents, props changed) > > > head/usr.sbin/binmiscctl/binmiscctl.8 (contents, props changed) > > > head/usr.sbin/binmiscctl/binmiscctl.c (contents, props changed) > > > Modified: > > > head/sys/conf/files.amd64 > > > head/sys/conf/files.i386 > > > head/sys/modules/Makefile > > > head/usr.sbin/Makefile > > > > Maybe put it in sys/conf/files instead of only amd64|i386? You enabled > > the module build for all architectures. Please also add it to sys/conf/NOTES. > > > I've adjusted things to only build on amd64/i386. Thank you for > pointing out my misconfiguration. > > I've updated NOTES as well at svn r264280 to reflext this and updated > options for amd64/i386. > > I haven't tested on non-x86 h/w and have no idea if it works or not. I > didn't feel comfortable building this driver in the non-x86 case. If > there is a use case/tester for the other arch's, I'll be more than happy > to change this. Can we make sure that this choice is well documented? Too often things are marked for a particular arch w/o notice why it is limited, and this just continues to make non-i386/amd64 arches harder to become first class citzens as people will say feature X is broken on arch Y for no good reason... If you believe it should work on all archs, make it available for all and send out a call for testers to the various lists... Thanks. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 01:14:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8D3D512; Sun, 13 Apr 2014 01:14:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8920912F7; Sun, 13 Apr 2014 01:14:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3D1EQxa048134; Sun, 13 Apr 2014 01:14:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3D1EPpt048130; Sun, 13 Apr 2014 01:14:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201404130114.s3D1EPpt048130@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 13 Apr 2014 01:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264391 - in head/sys/boot: amd64 amd64/boot1.efi common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 01:14:26 -0000 Author: nwhitehorn Date: Sun Apr 13 01:14:25 2014 New Revision: 264391 URL: http://svnweb.freebsd.org/changeset/base/264391 Log: Add a simple EFI stub loader. This is a quick and dirty of boot1.chrp from the PowerPC port with all the Open Firmware bits removed and replaced by their EFI counterparts. On the whole, I think I prefer Open Firmware. This code is supposed to be an immutable shim that sits on the EFI system partition, loads /boot/loader.efi from UFS and tells the real loader what disk/partition to look at. It finds the UFS root partition by the somewhat braindead approach of picking the first UFS partition it can find. Better approaches are called for, but this works for now. This shim loader will also be useful for secure boot in the future, which will require some rearchitecture. Added: head/sys/boot/amd64/boot1.efi/ head/sys/boot/amd64/boot1.efi/Makefile (contents, props changed) head/sys/boot/amd64/boot1.efi/boot1.c (contents, props changed) Modified: head/sys/boot/amd64/Makefile head/sys/boot/common/ufsread.c Modified: head/sys/boot/amd64/Makefile ============================================================================== --- head/sys/boot/amd64/Makefile Sat Apr 12 23:48:02 2014 (r264390) +++ head/sys/boot/amd64/Makefile Sun Apr 13 01:14:25 2014 (r264391) @@ -2,6 +2,6 @@ .include -SUBDIR= efi +SUBDIR= efi boot1.efi .include Added: head/sys/boot/amd64/boot1.efi/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/amd64/boot1.efi/Makefile Sun Apr 13 01:14:25 2014 (r264391) @@ -0,0 +1,70 @@ +# $FreeBSD$ + +NO_MAN= + +.include + +# In-tree GCC does not support __attribute__((ms_abi)). +.if ${COMPILER_TYPE} != "gcc" + +MK_SSP= no + +PROG= loader.sym +INTERNALPROG= + +# architecture-specific loader code +SRCS= boot1.c reloc.c start.S + +CFLAGS+= -fPIC +CFLAGS+= -I. +CFLAGS+= -I${.CURDIR}/../../efi/include +CFLAGS+= -I${.CURDIR}/../../efi/include/${MACHINE_CPUARCH} +CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include +CFLAGS+= -I${.CURDIR}/../../.. + +# Always add MI sources +.PATH: ${.CURDIR}/../../common ../efi +CFLAGS+= -I${.CURDIR}/../../common + +FILES= boot1.efi +FILESMODE_boot1.efi= ${BINMODE} + +LDSCRIPT= ${.CURDIR}/../efi/ldscript.${MACHINE_CPUARCH} +LDFLAGS= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared -Wl,-znocombreloc + +${PROG}: ${LDSCRIPT} + +OBJCOPY?= objcopy +OBJDUMP?= objdump + +.if ${MACHINE_CPUARCH} == "amd64" +EFI_TARGET= efi-app-x86_64 +.else +EFI_TARGET= efi-app-ia32 +.endif + +boot1.efi: loader.sym + if [ `${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*' | wc -l` != 0 ]; then \ + ${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*'; \ + exit 1; \ + fi + ${OBJCOPY} -j .text -j .sdata -j .data \ + -j .dynamic -j .dynsym -j .rel.dyn \ + -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \ + --target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} + +CFLAGS+= -I${.CURDIR}/../../common + +.endif # ${COMPILER_TYPE} != "gcc" + +.include + +beforedepend ${OBJS}: machine x86 + +CLEANFILES+= machine x86 + +machine: + ln -sf ${.CURDIR}/../../../amd64/include machine + +x86: + ln -sf ${.CURDIR}/../../../x86/include x86 Added: head/sys/boot/amd64/boot1.efi/boot1.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/amd64/boot1.efi/boot1.c Sun Apr 13 01:14:25 2014 (r264391) @@ -0,0 +1,447 @@ +/*- + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * Copyright (c) 2001 Robert Drehmel + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +#define _PATH_LOADER "/boot/loader.efi" +#define _PATH_KERNEL "/boot/kernel/kernel" + +#define BSIZEMAX 16384 + +typedef int putc_func_t(char c, void *arg); + +struct sp_data { + char *sp_buf; + u_int sp_len; + u_int sp_size; +}; + +static const char digits[] = "0123456789abcdef"; + +static void panic(const char *fmt, ...) __dead2; +static int printf(const char *fmt, ...); +static int putchar(char c, void *arg); +static int vprintf(const char *fmt, va_list ap); +static int vsnprintf(char *str, size_t sz, const char *fmt, va_list ap); + +static int __printf(const char *fmt, putc_func_t *putc, void *arg, va_list ap); +static int __putc(char c, void *arg); +static int __puts(const char *s, putc_func_t *putc, void *arg); +static int __sputc(char c, void *arg); +static char *__uitoa(char *buf, u_int val, int base); +static char *__ultoa(char *buf, u_long val, int base); + +static int domount(EFI_DEVICE_PATH *device, EFI_BLOCK_IO *blkio, int quiet); +static void load(const char *fname); + +EFI_SYSTEM_TABLE *systab; +EFI_HANDLE *image; + +static void +bcopy(const void *src, void *dst, size_t len) +{ + const char *s = src; + char *d = dst; + + while (len-- != 0) + *d++ = *s++; +} + +static void +memcpy(void *dst, const void *src, size_t len) +{ + bcopy(src, dst, len); +} + +static void +bzero(void *b, size_t len) +{ + char *p = b; + + while (len-- != 0) + *p++ = 0; +} + +static int +strcmp(const char *s1, const char *s2) +{ + for (; *s1 == *s2 && *s1; s1++, s2++) + ; + return ((u_char)*s1 - (u_char)*s2); +} + +static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; +static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; +static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL; + +static EFI_BLOCK_IO *bootdev; +static EFI_DEVICE_PATH *bootdevpath; +static EFI_HANDLE *bootdevhandle; + +EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab) +{ + EFI_HANDLE handles[128]; + EFI_BLOCK_IO *blkio; + UINTN i, nparts = sizeof(handles); + EFI_STATUS status; + EFI_DEVICE_PATH *devpath; + char *path = _PATH_LOADER; + + systab = Xsystab; + image = Ximage; + + printf(" \n>> FreeBSD EFI boot block\n"); + printf(" Loader path: %s\n", path); + + status = systab->BootServices->LocateHandle(ByProtocol, + &BlockIoProtocolGUID, NULL, &nparts, handles); + nparts /= sizeof(handles[0]); + + for (i = 0; i < nparts; i++) { + status = systab->BootServices->HandleProtocol(handles[i], + &DevicePathGUID, (void **)&devpath); + if (EFI_ERROR(status)) + continue; + + while (!IsDevicePathEnd(NextDevicePathNode(devpath))) + devpath = NextDevicePathNode(devpath); + + status = systab->BootServices->HandleProtocol(handles[i], + &BlockIoProtocolGUID, (void **)&blkio); + if (EFI_ERROR(status)) + continue; + + if (!blkio->Media->LogicalPartition) + continue; + + if (domount(devpath, blkio, 1) >= 0) + break; + } + + if (i == nparts) + panic("No bootable partition found"); + + bootdevhandle = handles[i]; + load(path); + + panic("Load failed"); + + return EFI_SUCCESS; +} + +static int +dskread(void *buf, u_int64_t lba, int nblk) +{ + EFI_STATUS status; + + status = bootdev->ReadBlocks(bootdev, bootdev->Media->MediaId, lba, + nblk * bootdev->Media->BlockSize, buf); + + if (EFI_ERROR(status)) + return (-1); + + return (0); +} + +#include "ufsread.c" + +static struct dmadat __dmadat; + +static int +domount(EFI_DEVICE_PATH *device, EFI_BLOCK_IO *blkio, int quiet) +{ + + dmadat = &__dmadat; + bootdev = blkio; + bootdevpath = device; + if (fsread(0, NULL, 0)) { + if (!quiet) + printf("domount: can't read superblock\n"); + return (-1); + } + if (!quiet) + printf("Succesfully mounted UFS filesystem\n"); + return (0); +} + +static void +load(const char *fname) +{ + ufs_ino_t ino; + EFI_STATUS status; + EFI_HANDLE loaderhandle; + EFI_LOADED_IMAGE *loaded_image; + void *buffer; + size_t bufsize; + + if ((ino = lookup(fname)) == 0) { + printf("File %s not found\n", fname); + return; + } + + bufsize = fsread(ino, NULL, -1); + status = systab->BootServices->AllocatePool(EfiLoaderData, + bufsize, &buffer); + fsread(ino, buffer, bufsize); + + /* XXX: For secure boot, we need our own loader here */ + status = systab->BootServices->LoadImage(TRUE, image, bootdevpath, + buffer, bufsize, &loaderhandle); + + status = systab->BootServices->HandleProtocol(loaderhandle, + &LoadedImageGUID, (VOID**)&loaded_image); + loaded_image->DeviceHandle = bootdevhandle; + + status = systab->BootServices->StartImage(loaderhandle, NULL, NULL); +} + +static void +panic(const char *fmt, ...) +{ + char buf[128]; + va_list ap; + + va_start(ap, fmt); + vsnprintf(buf, sizeof buf, fmt, ap); + printf("panic: %s\n", buf); + va_end(ap); + + while (1) {} +} + +static int +printf(const char *fmt, ...) +{ + va_list ap; + int ret; + + /* Don't annoy the user as we probe for partitions */ + if (strcmp(fmt,"Not ufs\n") == 0) + return 0; + + va_start(ap, fmt); + ret = vprintf(fmt, ap); + va_end(ap); + return (ret); +} + +static int +putchar(char c, void *arg) +{ + CHAR16 buf[2]; + + if (c == '\n') { + buf[0] = '\r'; + buf[1] = 0; + systab->ConOut->OutputString(systab->ConOut, buf); + } + buf[0] = c; + buf[1] = 0; + systab->ConOut->OutputString(systab->ConOut, buf); + return (1); +} + +static int +vprintf(const char *fmt, va_list ap) +{ + int ret; + + ret = __printf(fmt, putchar, 0, ap); + return (ret); +} + +static int +vsnprintf(char *str, size_t sz, const char *fmt, va_list ap) +{ + struct sp_data sp; + int ret; + + sp.sp_buf = str; + sp.sp_len = 0; + sp.sp_size = sz; + ret = __printf(fmt, __sputc, &sp, ap); + return (ret); +} + +static int +__printf(const char *fmt, putc_func_t *putc, void *arg, va_list ap) +{ + char buf[(sizeof(long) * 8) + 1]; + char *nbuf; + u_long ul; + u_int ui; + int lflag; + int sflag; + char *s; + int pad; + int ret; + int c; + + nbuf = &buf[sizeof buf - 1]; + ret = 0; + while ((c = *fmt++) != 0) { + if (c != '%') { + ret += putc(c, arg); + continue; + } + lflag = 0; + sflag = 0; + pad = 0; +reswitch: c = *fmt++; + switch (c) { + case '#': + sflag = 1; + goto reswitch; + case '%': + ret += putc('%', arg); + break; + case 'c': + c = va_arg(ap, int); + ret += putc(c, arg); + break; + case 'd': + if (lflag == 0) { + ui = (u_int)va_arg(ap, int); + if (ui < (int)ui) { + ui = -ui; + ret += putc('-', arg); + } + s = __uitoa(nbuf, ui, 10); + } else { + ul = (u_long)va_arg(ap, long); + if (ul < (long)ul) { + ul = -ul; + ret += putc('-', arg); + } + s = __ultoa(nbuf, ul, 10); + } + ret += __puts(s, putc, arg); + break; + case 'l': + lflag = 1; + goto reswitch; + case 'o': + if (lflag == 0) { + ui = (u_int)va_arg(ap, u_int); + s = __uitoa(nbuf, ui, 8); + } else { + ul = (u_long)va_arg(ap, u_long); + s = __ultoa(nbuf, ul, 8); + } + ret += __puts(s, putc, arg); + break; + case 'p': + ul = (u_long)va_arg(ap, void *); + s = __ultoa(nbuf, ul, 16); + ret += __puts("0x", putc, arg); + ret += __puts(s, putc, arg); + break; + case 's': + s = va_arg(ap, char *); + ret += __puts(s, putc, arg); + break; + case 'u': + if (lflag == 0) { + ui = va_arg(ap, u_int); + s = __uitoa(nbuf, ui, 10); + } else { + ul = va_arg(ap, u_long); + s = __ultoa(nbuf, ul, 10); + } + ret += __puts(s, putc, arg); + break; + case 'x': + if (lflag == 0) { + ui = va_arg(ap, u_int); + s = __uitoa(nbuf, ui, 16); + } else { + ul = va_arg(ap, u_long); + s = __ultoa(nbuf, ul, 16); + } + if (sflag) + ret += __puts("0x", putc, arg); + ret += __puts(s, putc, arg); + break; + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + pad = pad * 10 + c - '0'; + goto reswitch; + default: + break; + } + } + return (ret); +} + +static int +__sputc(char c, void *arg) +{ + struct sp_data *sp; + + sp = arg; + if (sp->sp_len < sp->sp_size) + sp->sp_buf[sp->sp_len++] = c; + sp->sp_buf[sp->sp_len] = '\0'; + return (1); +} + +static int +__puts(const char *s, putc_func_t *putc, void *arg) +{ + const char *p; + int ret; + + ret = 0; + for (p = s; *p != '\0'; p++) + ret += putc(*p, arg); + return (ret); +} + +static char * +__uitoa(char *buf, u_int ui, int base) +{ + char *p; + + p = buf; + *p = '\0'; + do + *--p = digits[ui % base]; + while ((ui /= base) != 0); + return (p); +} + +static char * +__ultoa(char *buf, u_long ul, int base) +{ + char *p; + + p = buf; + *p = '\0'; + do + *--p = digits[ul % base]; + while ((ul /= base) != 0); + return (p); +} + Modified: head/sys/boot/common/ufsread.c ============================================================================== --- head/sys/boot/common/ufsread.c Sat Apr 12 23:48:02 2014 (r264390) +++ head/sys/boot/common/ufsread.c Sun Apr 13 01:14:25 2014 (r264391) @@ -245,6 +245,8 @@ fsread(ufs_ino_t inode, void *buf, size_ s = buf; size = DIP(di_size); n = size - fs_off; + if (buf == NULL && nbyte == -1) + return n; if (nbyte > n) nbyte = n; nb = nbyte; From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 01:15:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F04C7650; Sun, 13 Apr 2014 01:15:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C28C812FD; Sun, 13 Apr 2014 01:15:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3D1Fbw4048347; Sun, 13 Apr 2014 01:15:37 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3D1FbNX048346; Sun, 13 Apr 2014 01:15:37 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201404130115.s3D1FbNX048346@svn.freebsd.org> From: Davide Italiano Date: Sun, 13 Apr 2014 01:15:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264392 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 01:15:38 -0000 Author: davide Date: Sun Apr 13 01:15:37 2014 New Revision: 264392 URL: http://svnweb.freebsd.org/changeset/base/264392 Log: Fix a panic in zfs_rename(). this is due to a wrong dereference of a vnode when it's not locked and can be (potentially) recycled. 'sdvp' cannot be locked on zfs_rename() entry point because the VFS can't be sure that this scenario is LOR-free (it might violate the parent->child lock acquisition rule). Dereference 'tdvp' instead, which is already locked on entry, and access 'sdvp' fields only when it's safe, i.e. under ZFS_ENTER scope. While at it, remove the usage of VOP_REALVP, as long as this is a NOP on FreeBSD. Discussed with: avg Reviewed by: pjd Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Apr 13 01:14:25 2014 (r264391) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Apr 13 01:15:37 2014 (r264392) @@ -3723,9 +3723,8 @@ static int zfs_rename(vnode_t *sdvp, char *snm, vnode_t *tdvp, char *tnm, cred_t *cr, caller_context_t *ct, int flags) { - znode_t *tdzp, *szp, *tzp; - znode_t *sdzp = VTOZ(sdvp); - zfsvfs_t *zfsvfs = sdzp->z_zfsvfs; + znode_t *tdzp, *sdzp, *szp, *tzp; + zfsvfs_t *zfsvfs; zilog_t *zilog; vnode_t *realvp; zfs_dirlock_t *sdl, *tdl; @@ -3736,24 +3735,27 @@ zfs_rename(vnode_t *sdvp, char *snm, vno int zflg = 0; boolean_t waited = B_FALSE; + tdzp = VTOZ(tdvp); + ZFS_VERIFY_ZP(tdzp); + zfsvfs = tdzp->z_zfsvfs; ZFS_ENTER(zfsvfs); - ZFS_VERIFY_ZP(sdzp); zilog = zfsvfs->z_log; + sdzp = VTOZ(sdvp); /* - * Make sure we have the real vp for the target directory. + * In case sdzp is not valid, let's be sure to exit from the right + * zfsvfs_t. */ - if (VOP_REALVP(tdvp, &realvp, ct) == 0) - tdvp = realvp; - - tdzp = VTOZ(tdvp); - ZFS_VERIFY_ZP(tdzp); + if (sdzp->z_sa_hdl == NULL) { + ZFS_EXIT(zfsvfs); + return (SET_ERROR(EIO)); + } /* * We check z_zfsvfs rather than v_vfsp here, because snapshots and the * ctldir appear to have the same v_vfsp. */ - if (tdzp->z_zfsvfs != zfsvfs || zfsctl_is_node(tdvp)) { + if (sdzp->z_zfsvfs != zfsvfs || zfsctl_is_node(tdvp)) { ZFS_EXIT(zfsvfs); return (SET_ERROR(EXDEV)); } From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 01:43:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12981DA4; Sun, 13 Apr 2014 01:43:57 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id C58781578; Sun, 13 Apr 2014 01:43:56 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id 279F120E7088B; Sun, 13 Apr 2014 01:43:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.3 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,HELO_NO_DOMAIN,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTPS id DA4AE20E70885; Sun, 13 Apr 2014 01:43:43 +0000 (UTC) Message-ID: <009FCFC8A87C4A7CBA3BCEEDDB2FB1DC@multiplay.co.uk> From: "Steven Hartland" To: "Davide Italiano" , , , References: <201404130115.s3D1FbNX048346@svn.freebsd.org> Subject: Re: svn commit: r264392 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Sun, 13 Apr 2014 02:43:42 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 01:43:57 -0000 Interesting, I'd be curious to know what the panic for this looks like? ----- Original Message ----- From: "Davide Italiano" > Author: davide > Date: Sun Apr 13 01:15:37 2014 > New Revision: 264392 > URL: http://svnweb.freebsd.org/changeset/base/264392 > > Log: > Fix a panic in zfs_rename(). > this is due to a wrong dereference of a vnode when it's not locked and > can be (potentially) recycled. 'sdvp' cannot be locked on zfs_rename() > entry point because the VFS can't be sure that this scenario is > LOR-free (it might violate the parent->child lock acquisition rule). > Dereference 'tdvp' instead, which is already locked on entry, and access > 'sdvp' fields only when it's safe, i.e. under ZFS_ENTER scope. > > While at it, remove the usage of VOP_REALVP, as long as this is a NOP > on FreeBSD. From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 01:47:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0CBEBEF8; Sun, 13 Apr 2014 01:47:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D47AC1591; Sun, 13 Apr 2014 01:47:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3D1lFqA061135; Sun, 13 Apr 2014 01:47:15 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3D1lFOX061134; Sun, 13 Apr 2014 01:47:15 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404130147.s3D1lFOX061134@svn.freebsd.org> From: Glen Barber Date: Sun, 13 Apr 2014 01:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264393 - head/bin/ls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 01:47:16 -0000 Author: gjb Date: Sun Apr 13 01:47:15 2014 New Revision: 264393 URL: http://svnweb.freebsd.org/changeset/base/264393 Log: Bump Dd, missed as part of r264098 and related commits. Sponsored by: The FreeBSD Foundation Modified: head/bin/ls/ls.1 Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Sun Apr 13 01:15:37 2014 (r264392) +++ head/bin/ls/ls.1 Sun Apr 13 01:47:15 2014 (r264393) @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd March 15, 2013 +.Dd April 4, 2014 .Dt LS 1 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 01:49:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B45B15B; Sun, 13 Apr 2014 01:49:27 +0000 (UTC) Received: from mail-vc0-x22b.google.com (mail-vc0-x22b.google.com [IPv6:2607:f8b0:400c:c03::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 24FA815A4; Sun, 13 Apr 2014 01:49:27 +0000 (UTC) Received: by mail-vc0-f171.google.com with SMTP id lg15so6147880vcb.16 for ; Sat, 12 Apr 2014 18:49:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=m6G6KwtoR215dpg6bGTVZS7QkEJTuwjkgbZh/PNAa2M=; b=TB5hfR4WAEVmgsXJv/CA0KwWdaXqVdXgYwr5A+EE0VWza5xm+mOVmKpdMO4gOFzDI5 FaCqSaHbZ6eYWXq/NRKSlk7nKY1L4epoYsWSZ81n6W2ENW7Ps7FWLmHV7wgs3hIIVoyl ztcgV2KoRMr4uZoWUaUujKu9Ko+aJRGrZLKXJsVKDmXtELUEXDYj1lPhEY8T3/SztUpf SalRQrYgW/Ng59w/a98I8cMyemhoMPWlEupPh5DcIO9TqdmA4QN27/0WZMPOs45Qlm3g o4RvTOPoUx1OePfzIN7rcXrSDKX2od5DjfUGOGoOAixyyyT5mlnnqKegGeJIuR4UfJX2 kMRg== MIME-Version: 1.0 X-Received: by 10.52.23.97 with SMTP id l1mr23581195vdf.11.1397353766276; Sat, 12 Apr 2014 18:49:26 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.220.5.72 with HTTP; Sat, 12 Apr 2014 18:49:26 -0700 (PDT) In-Reply-To: <009FCFC8A87C4A7CBA3BCEEDDB2FB1DC@multiplay.co.uk> References: <201404130115.s3D1FbNX048346@svn.freebsd.org> <009FCFC8A87C4A7CBA3BCEEDDB2FB1DC@multiplay.co.uk> Date: Sat, 12 Apr 2014 18:49:26 -0700 X-Google-Sender-Auth: Wn9NmNAqhfWcaDZfMTia0ngf3iA Message-ID: Subject: Re: svn commit: r264392 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: Davide Italiano To: Steven Hartland Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 01:49:27 -0000 On Sat, Apr 12, 2014 at 6:43 PM, Steven Hartland wrote: > Interesting, I'd be curious to know what the panic for this looks like? > It's more like a 'trap 12: page fault while in kernel mode'. Post-mortem analysis with kgdb shows the vnode fields filled with garbage (e.g. 0xdeadc0de), if you're lucky and can get a dump. -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 02:03:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9225743E; Sun, 13 Apr 2014 02:03:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EB9316E8; Sun, 13 Apr 2014 02:03:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3D23FW0068899; Sun, 13 Apr 2014 02:03:15 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3D23Fc5068898; Sun, 13 Apr 2014 02:03:15 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404130203.s3D23Fc5068898@svn.freebsd.org> From: Glen Barber Date: Sun, 13 Apr 2014 02:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264394 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 02:03:15 -0000 Author: gjb Date: Sun Apr 13 02:03:14 2014 New Revision: 264394 URL: http://svnweb.freebsd.org/changeset/base/264394 Log: Clean trailing whitespace. Add missing .El to fix formatting. Found with: mandoc(1) Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/uftdi.4 Modified: head/share/man/man4/uftdi.4 ============================================================================== --- head/share/man/man4/uftdi.4 Sun Apr 13 01:47:15 2014 (r264393) +++ head/share/man/man4/uftdi.4 Sun Apr 13 02:03:14 2014 (r264394) @@ -136,7 +136,7 @@ the desired mode, then you .Xr read 2 and .Xr write 2 -data which either reflects pin state or is interpreted +data which either reflects pin state or is interpreted as MPSSE commands and parameters, depending on the mode. .It Dv UFTDIIOC_GET_BITMODE Pq Vt "struct uftdi_bitmode" Return the state of the bitbang pins at the time of the call in the @@ -149,7 +149,7 @@ member is unused. Set the character which is inserted into the buffer to mark the point of an error such as FIFO overflow. .It Dv UFTDIIOC_SET_EVENT_CHAR Pq Vt int -Set the character which causes a partial FIFO full of data +Set the character which causes a partial FIFO full of data to be returned immediately even if the FIFO is not full. .It Dv UFTDIIOC_SET_LATENCY Pq Vt int Set the amount of time to wait for a full FIFO, @@ -164,6 +164,7 @@ This is the .Va bcdDevice value from the .Va usb_device_descriptor . +.El .Sh HARDWARE The .Nm From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 05:21:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41EFC4CA; Sun, 13 Apr 2014 05:21:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 304741792; Sun, 13 Apr 2014 05:21:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3D5LN6J052404; Sun, 13 Apr 2014 05:21:23 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3D5LNCg052403; Sun, 13 Apr 2014 05:21:23 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404130521.s3D5LNCg052403@svn.freebsd.org> From: Warner Losh Date: Sun, 13 Apr 2014 05:21:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264395 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 05:21:23 -0000 Author: imp Date: Sun Apr 13 05:21:22 2014 New Revision: 264395 URL: http://svnweb.freebsd.org/changeset/base/264395 Log: Determine whether to build clang and its bootstrap tools the same way. This allows a clang bootstrap to happen, even when WITHOUT_CLANG is defined. This is a minimal version of a more extensive change which can be MFC'd more easily. However, we have to also test to see if we're building clang as not cc, since the bootstrap for that needs these cross tools and it is easier to build them in just one place. MFC after: 1 week Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Apr 13 02:03:14 2014 (r264394) +++ head/Makefile.inc1 Sun Apr 13 05:21:22 2014 (r264395) @@ -1234,7 +1234,7 @@ _awk= usr.bin/awk _gensnmptree= usr.sbin/bsnmpd/gensnmptree .endif -.if ${MK_CLANG} != "no" +.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang" || ${MK_CLANG} != "no" _clang_tblgen= \ lib/clang/libllvmsupport \ lib/clang/libllvmtablegen \ From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 05:21:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A287D601; Sun, 13 Apr 2014 05:21:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 832F31798; Sun, 13 Apr 2014 05:21:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3D5LVNX052462; Sun, 13 Apr 2014 05:21:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3D5LVPE052460; Sun, 13 Apr 2014 05:21:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404130521.s3D5LVPE052460@svn.freebsd.org> From: Warner Losh Date: Sun, 13 Apr 2014 05:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264396 - in head: . tools/build X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 05:21:31 -0000 Author: imp Date: Sun Apr 13 05:21:30 2014 New Revision: 264396 URL: http://svnweb.freebsd.org/changeset/base/264396 Log: Up the minimum system to build FreeBSD current to 8.0-RELEASE. The issues with vendors that needed 7.x support have been resolved. Many vendors are still using 8.x build platforms, however, so bumping this up to 9.0 will have to wait until that is resolved. Actual support for building from 8.x still relies on those vendors fixing bugs that are present as most developers have moved onto 9.x or newer platforms. Reviewed by: marcel@ Modified: head/Makefile.inc1 head/tools/build/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Apr 13 05:21:22 2014 (r264395) +++ head/Makefile.inc1 Sun Apr 13 05:21:30 2014 (r264396) @@ -1159,8 +1159,8 @@ update: # legacy: Build compatibility shims for the next three targets # legacy: -.if ${BOOTSTRAPPING} < 700055 && ${BOOTSTRAPPING} != 0 - @echo "ERROR: Source upgrades from versions prior to 7.0 not supported."; \ +.if ${BOOTSTRAPPING} < 800107 && ${BOOTSTRAPPING} != 0 + @echo "ERROR: Source upgrades from versions prior to 8.0 not supported."; \ false .endif .for _tool in tools/build @@ -1188,14 +1188,6 @@ _gperf= gnu/usr.bin/gperf _groff= gnu/usr.bin/groff .endif -.if ${BOOTSTRAPPING} < 800022 -_ar= usr.bin/ar -.endif - -.if ${BOOTSTRAPPING} < 800013 -_mklocale= usr.bin/mklocale -.endif - .if ${BOOTSTRAPPING} < 900002 _sed= usr.bin/sed .endif @@ -1279,13 +1271,11 @@ bootstrap-tools: .MAKE ${_strfile} \ ${_gperf} \ ${_groff} \ - ${_ar} \ ${_dtc} \ ${_awk} \ ${_cat} \ usr.bin/lorder \ usr.bin/makewhatis \ - ${_mklocale} \ usr.bin/rpcgen \ ${_sed} \ ${_yacc} \ @@ -1362,7 +1352,7 @@ kernel-tools: .MAKE .if !defined(TARGET_ARCH) && defined(XDEV_ARCH) TARGET_ARCH= ${XDEV_ARCH} .endif -.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 800035 +.if ${TARGET_ARCH} != ${MACHINE_ARCH} .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" _btxld= usr.sbin/btxld .endif Modified: head/tools/build/Makefile ============================================================================== --- head/tools/build/Makefile Sun Apr 13 05:21:22 2014 (r264395) +++ head/tools/build/Makefile Sun Apr 13 05:21:30 2014 (r264396) @@ -9,18 +9,6 @@ INCS= BOOTSTRAPPING?= 0 -_WITH_GETLINE!= grep -c _WITH_GETLINE /usr/include/stdio.h || true -.if ${_WITH_GETLINE} == 0 -.PATH: ${.CURDIR}/../../contrib/file ${.CURDIR}/../../lib/libmagic -SRCS= getline.c config.h -CFLAGS+= -DHAVE_CONFIG_H -I. -CLEANFILES+= config.h - -${SRCS:N*.h:R:S/$/.o/}: config.h -config.h: ${.CURDIR}/../../lib/libmagic/config.h - grep -v HAVE_GETLINE ${.ALLSRC} > ${.TARGET} -.endif - _WITH_PWCACHEDB!= grep -c pwcache_groupdb /usr/include/pwd.h || true .if ${_WITH_PWCACHEDB} == 0 .PATH: ${.CURDIR}/../../contrib/libc-pwcache From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 05:21:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2EBDD7C2; Sun, 13 Apr 2014 05:21:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D941179A; Sun, 13 Apr 2014 05:21:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3D5LZFa052518; Sun, 13 Apr 2014 05:21:35 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3D5LZ8g052517; Sun, 13 Apr 2014 05:21:35 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404130521.s3D5LZ8g052517@svn.freebsd.org> From: Warner Losh Date: Sun, 13 Apr 2014 05:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264397 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 05:21:36 -0000 Author: imp Date: Sun Apr 13 05:21:35 2014 New Revision: 264397 URL: http://svnweb.freebsd.org/changeset/base/264397 Log: We no longer support upgrading from FreeBSD 4, so we don't need the NOMAN and NOSHARED defines here. They have been obsolete for almost a decade anyway. Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sun Apr 13 05:21:30 2014 (r264396) +++ head/Makefile Sun Apr 13 05:21:35 2014 (r264397) @@ -325,8 +325,7 @@ MMAKEENV= MAKEOBJDIRPREFIX=${MYMAKE:H} \ DESTDIR= \ INSTALL="sh ${.CURDIR}/tools/install.sh" MMAKE= ${MMAKEENV} ${MAKE} \ - -D_UPGRADING \ - -DNOMAN -DNO_MAN -DNOSHARED -DNO_SHARED \ + -D_UPGRADING -DNO_MAN -DNO_SHARED \ -DNO_CPU_CFLAGS -DNO_WERROR DESTDIR= PROGNAME=${MYMAKE:T} make bmake: .PHONY From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 05:21:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 739658F8; Sun, 13 Apr 2014 05:21:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 617A2179E; Sun, 13 Apr 2014 05:21:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3D5Liik052580; Sun, 13 Apr 2014 05:21:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3D5LijY052579; Sun, 13 Apr 2014 05:21:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404130521.s3D5LijY052579@svn.freebsd.org> From: Warner Losh Date: Sun, 13 Apr 2014 05:21:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264398 - head/tools/build X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 05:21:44 -0000 Author: imp Date: Sun Apr 13 05:21:43 2014 New Revision: 264398 URL: http://svnweb.freebsd.org/changeset/base/264398 Log: Check the right file for pwcache_groupdb. Modified: head/tools/build/Makefile Modified: head/tools/build/Makefile ============================================================================== --- head/tools/build/Makefile Sun Apr 13 05:21:35 2014 (r264397) +++ head/tools/build/Makefile Sun Apr 13 05:21:43 2014 (r264398) @@ -9,7 +9,7 @@ INCS= BOOTSTRAPPING?= 0 -_WITH_PWCACHEDB!= grep -c pwcache_groupdb /usr/include/pwd.h || true +_WITH_PWCACHEDB!= grep -c pwcache_groupdb /usr/include/grp.h || true .if ${_WITH_PWCACHEDB} == 0 .PATH: ${.CURDIR}/../../contrib/libc-pwcache CFLAGS+= -I${.CURDIR}/../../contrib/libc-pwcache \ From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 05:21:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFF6EA30; Sun, 13 Apr 2014 05:21:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEAEF17A1; Sun, 13 Apr 2014 05:21:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3D5Lmb5052635; Sun, 13 Apr 2014 05:21:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3D5Lmv9052634; Sun, 13 Apr 2014 05:21:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404130521.s3D5Lmv9052634@svn.freebsd.org> From: Warner Losh Date: Sun, 13 Apr 2014 05:21:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264399 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 05:21:49 -0000 Author: imp Date: Sun Apr 13 05:21:48 2014 New Revision: 264399 URL: http://svnweb.freebsd.org/changeset/base/264399 Log: Don't apply ctf conversions in POSIX mode. These can't happen there because they pollute the POSIX environment, which doens't allow for these extentions. ctf conversions are really only relevant when used in coordination with the rest of the bsd*.mk system anyway. Leave them in place for the normal, non-posix enviornment since they are quite useful there. Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Sun Apr 13 05:21:43 2014 (r264398) +++ head/share/mk/sys.mk Sun Apr 13 05:21:48 2014 (r264399) @@ -171,11 +171,9 @@ YFLAGS ?= -d # SINGLE SUFFIX RULES .c: ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC} - ${CTFCONVERT_CMD} .f: ${FC} ${FFLAGS} ${LDFLAGS} -o ${.TARGET} ${.IMPSRC} - ${CTFCONVERT_CMD} .sh: cp -f ${.IMPSRC} ${.TARGET} @@ -185,25 +183,21 @@ YFLAGS ?= -d .c.o: ${CC} ${CFLAGS} -c ${.IMPSRC} - ${CTFCONVERT_CMD} .f.o: ${FC} ${FFLAGS} -c ${.IMPSRC} - ${CTFCONVERT_CMD} .y.o: ${YACC} ${YFLAGS} ${.IMPSRC} ${CC} ${CFLAGS} -c y.tab.c rm -f y.tab.c mv y.tab.o ${.TARGET} - ${CTFCONVERT_CMD} .l.o: ${LEX} ${LFLAGS} ${.IMPSRC} ${CC} ${CFLAGS} -c lex.yy.c rm -f lex.yy.c mv lex.yy.o ${.TARGET} - ${CTFCONVERT_CMD} .y.c: ${YACC} ${YFLAGS} ${.IMPSRC} From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 05:22:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C074B74; Sun, 13 Apr 2014 05:22:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66C0617B3; Sun, 13 Apr 2014 05:22:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3D5MH14052889; Sun, 13 Apr 2014 05:22:17 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3D5LvNo052693; Sun, 13 Apr 2014 05:21:57 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404130521.s3D5LvNo052693@svn.freebsd.org> From: Warner Losh Date: Sun, 13 Apr 2014 05:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264400 - in head: cddl/usr.bin/sgsmsg cddl/usr.bin/zinject cddl/usr.bin/zlook cddl/usr.bin/ztest cddl/usr.sbin/zhack contrib/libucl contrib/libucl/doc contrib/libucl/tests contrib/libu... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 05:22:17 -0000 Author: imp Date: Sun Apr 13 05:21:56 2014 New Revision: 264400 URL: http://svnweb.freebsd.org/changeset/base/264400 Log: NO_MAN= has been deprecated in favor of MAN= for some time, go ahead and finish the job. ncurses is now the only Makefile in the tree that uses it since it wasn't a simple mechanical change, and will be addressed in a future commit. Modified: head/cddl/usr.bin/sgsmsg/Makefile head/cddl/usr.bin/zinject/Makefile head/cddl/usr.bin/zlook/Makefile head/cddl/usr.bin/ztest/Makefile head/cddl/usr.sbin/zhack/Makefile head/contrib/libucl/Makefile.am head/contrib/libucl/doc/Makefile.am head/contrib/libucl/tests/Makefile.am head/contrib/libucl/utils/Makefile.am head/contrib/ofed/usr.bin/ibsendtrap/Makefile head/contrib/ofed/usr.lib/libsdp/Makefile head/crypto/heimdal/appl/Makefile.am head/crypto/heimdal/appl/ftp/Makefile.am head/crypto/heimdal/appl/ftp/common/Makefile.am head/crypto/heimdal/lib/Makefile.am head/crypto/heimdal/lib/ipc/Makefile.am head/games/fortune/unstr/Makefile head/games/ppt/Makefile head/games/primes/Makefile head/gnu/usr.bin/cc/c++/Makefile head/gnu/usr.bin/cc/c++filt/Makefile head/gnu/usr.bin/cc/cc1/Makefile head/gnu/usr.bin/cc/cc1plus/Makefile head/gnu/usr.bin/cc/collect2/Makefile head/gnu/usr.bin/cc/protoize/Makefile head/gnu/usr.bin/gdb/Makefile.inc head/gnu/usr.bin/gdb/gdbtui/Makefile head/gnu/usr.bin/groff/src/devices/grohtml/Makefile head/gnu/usr.bin/groff/src/preproc/html/Makefile head/kerberos5/libexec/digest-service/Makefile head/kerberos5/libexec/ipropd-slave/Makefile head/kerberos5/tools/asn1_compile/Makefile head/kerberos5/tools/make-roken/Makefile head/kerberos5/tools/slc/Makefile head/kerberos5/usr.bin/hxtool/Makefile head/kerberos5/usr.bin/ksu/Makefile head/lib/libarchive/test/Makefile head/lib/libauditd/Makefile head/lib/libproc/Makefile head/lib/libproc/test/t1-bkpt/Makefile head/lib/libproc/test/t2-name2map/Makefile head/lib/libproc/test/t3-name2sym/Makefile head/lib/ncurses/form/Makefile head/lib/ncurses/menu/Makefile head/lib/ncurses/ncurses/Makefile head/lib/ncurses/panel/Makefile head/libexec/bootpd/bootpgw/Makefile head/libexec/casper/dns/Makefile head/libexec/casper/grp/Makefile head/libexec/casper/pwd/Makefile head/libexec/casper/random/Makefile head/libexec/casper/sysctl/Makefile head/libexec/dma-mbox-create/Makefile head/libexec/ulog-helper/Makefile head/release/picobsd/tinyware/aps/Makefile head/release/picobsd/tinyware/help/Makefile head/release/picobsd/tinyware/msg/Makefile head/release/picobsd/tinyware/ns/Makefile head/release/picobsd/tinyware/oinit/Makefile head/release/picobsd/tinyware/simple_httpd/Makefile head/release/picobsd/tinyware/sps/Makefile head/release/picobsd/tinyware/view/Makefile head/release/picobsd/tinyware/vm/Makefile head/rescue/rescue/Makefile head/sbin/geom/Makefile head/sbin/rtsol/Makefile head/secure/lib/libcrypto/engines/lib4758cca/Makefile head/share/examples/FreeBSD_version/Makefile head/share/examples/autofs/driver/Makefile head/share/examples/find_interface/Makefile head/share/examples/kld/cdev/test/Makefile head/share/examples/kld/syscall/test/Makefile head/share/examples/libvgl/Makefile head/share/examples/perfmon/Makefile head/share/examples/ppi/Makefile head/share/mk/bsd.README head/sys/boot/amd64/efi/Makefile head/sys/boot/arm/at91/boot0/Makefile head/sys/boot/arm/at91/boot0iic/Makefile head/sys/boot/arm/at91/boot0spi/Makefile head/sys/boot/arm/at91/boot2/Makefile head/sys/boot/arm/at91/bootiic/Makefile head/sys/boot/arm/at91/bootspi/Makefile head/sys/boot/arm/at91/libat91/Makefile head/sys/boot/arm/ixp425/boot2/Makefile head/sys/boot/i386/boot0/Makefile head/sys/boot/i386/btx/btx/Makefile head/sys/boot/i386/btx/btxldr/Makefile head/sys/boot/i386/btx/lib/Makefile head/sys/boot/i386/cdboot/Makefile head/sys/boot/i386/kgzldr/Makefile head/sys/boot/i386/mbr/Makefile head/sys/boot/i386/pmbr/Makefile head/sys/boot/i386/zfsloader/Makefile head/sys/boot/ia64/efi/Makefile head/sys/boot/ia64/ski/Makefile head/sys/boot/libstand32/Makefile head/sys/boot/mips/beri/boot2/Makefile head/sys/boot/pc98/boot0.5/Makefile head/sys/boot/pc98/boot0/Makefile head/sys/boot/pc98/btx/btx/Makefile head/sys/boot/pc98/btx/btxldr/Makefile head/sys/boot/pc98/btx/lib/Makefile head/sys/boot/pc98/cdboot/Makefile head/sys/boot/pc98/kgzldr/Makefile head/sys/boot/powerpc/boot1.chrp/Makefile head/sys/boot/powerpc/uboot/Makefile head/sys/boot/sparc64/boot1/Makefile head/sys/boot/userboot/libstand/Makefile head/sys/boot/userboot/test/Makefile head/sys/boot/userboot/userboot/Makefile head/sys/crypto/rijndael/Makefile head/sys/dev/aic7xxx/aicasm/Makefile head/sys/dev/patm/genrtab/Makefile head/tools/KSE/ksetest/Makefile head/tools/KSE/rr/Makefile head/tools/bsdbox/Makefile head/tools/diag/dumpvfscache/Makefile head/tools/diag/localeck/Makefile head/tools/regression/acct/Makefile head/tools/regression/aio/aiop/Makefile head/tools/regression/aio/aiotest/Makefile head/tools/regression/aio/kqueue/Makefile head/tools/regression/aio/kqueue/lio/Makefile head/tools/regression/audit/audit_pipe_ioctl/Makefile head/tools/regression/doat/Makefile head/tools/regression/environ/Makefile.envctl head/tools/regression/environ/Makefile.retention head/tools/regression/environ/Makefile.timings head/tools/regression/ethernet/ethermulti/Makefile head/tools/regression/execve/Makefile head/tools/regression/fifo/fifo_create/Makefile head/tools/regression/fifo/fifo_io/Makefile head/tools/regression/fifo/fifo_misc/Makefile head/tools/regression/fifo/fifo_open/Makefile head/tools/regression/file/dup/Makefile head/tools/regression/file/flock/Makefile head/tools/regression/file/ftruncate/Makefile head/tools/regression/file/newfileops_on_fork/Makefile head/tools/regression/filemon/Makefile head/tools/regression/fsx/Makefile head/tools/regression/gaithrstress/Makefile head/tools/regression/geom/ConfCmp/Makefile head/tools/regression/geom/MdLoad/Makefile head/tools/regression/include/stdatomic/Makefile head/tools/regression/include/tgmath/Makefile head/tools/regression/kgssapi/Makefile head/tools/regression/kqueue/Makefile head/tools/regression/kthread/kld/Makefile head/tools/regression/lib/libc/resolv/Makefile head/tools/regression/mac/mac_bsdextended/Makefile head/tools/regression/mlock/Makefile head/tools/regression/mmap/Makefile head/tools/regression/mqueue/mqtest1/Makefile head/tools/regression/mqueue/mqtest2/Makefile head/tools/regression/mqueue/mqtest3/Makefile head/tools/regression/mqueue/mqtest4/Makefile head/tools/regression/mqueue/mqtest5/Makefile head/tools/regression/netinet/arphold/Makefile head/tools/regression/netinet/ipbroadcast/Makefile head/tools/regression/netinet/ipdivert/Makefile head/tools/regression/netinet/ipmulticast/Makefile head/tools/regression/netinet/ipsockopt/Makefile head/tools/regression/netinet/msocket/Makefile head/tools/regression/netinet/msocket_ifnet_remove/Makefile head/tools/regression/netinet/rawconnect/Makefile head/tools/regression/netinet/tcpconnect/Makefile head/tools/regression/netinet/tcpdrop/Makefile head/tools/regression/netinet/tcpfullwindowrst/Makefile head/tools/regression/netinet/tcpsockclosebeforeaccept/Makefile head/tools/regression/netinet/tcpsocktimewait/Makefile head/tools/regression/netinet/tcpstream/Makefile head/tools/regression/netinet/udpconnectjail/Makefile head/tools/regression/netinet/udpzerobyte/Makefile head/tools/regression/netinet6/icmp6_filter/Makefile head/tools/regression/netinet6/inet6_rth/Makefile head/tools/regression/netinet6/ip6_sockets/Makefile head/tools/regression/nfsmmap/test1/Makefile head/tools/regression/nfsmmap/test2/Makefile head/tools/regression/p1003_1b/Makefile head/tools/regression/pipe/Makefile head/tools/regression/posixsem/Makefile head/tools/regression/posixsem2/Makefile head/tools/regression/posixshm/Makefile head/tools/regression/pthread/cv_cancel1/Makefile head/tools/regression/pthread/mutex_isowned_np/Makefile head/tools/regression/rpcsec_gss/Makefile head/tools/regression/security/access/Makefile head/tools/regression/security/cap_test/Makefile head/tools/regression/security/open_to_operation/Makefile head/tools/regression/security/proc_to_proc/Makefile head/tools/regression/sigqueue/sigqtest1/Makefile head/tools/regression/sigqueue/sigqtest2/Makefile head/tools/regression/sockets/accept_fd_leak/Makefile head/tools/regression/sockets/accf_data_attach/Makefile head/tools/regression/sockets/fstat/Makefile head/tools/regression/sockets/kqueue/Makefile head/tools/regression/sockets/listen_backlog/Makefile head/tools/regression/sockets/listenclose/Makefile head/tools/regression/sockets/pr_atomic/Makefile head/tools/regression/sockets/reconnect/Makefile head/tools/regression/sockets/rtsocket/Makefile head/tools/regression/sockets/sblock/Makefile head/tools/regression/sockets/sendfile/Makefile head/tools/regression/sockets/shutdown/Makefile head/tools/regression/sockets/sigpipe/Makefile head/tools/regression/sockets/so_setfib/Makefile head/tools/regression/sockets/socketpair/Makefile head/tools/regression/sockets/unix_bindconnect/Makefile head/tools/regression/sockets/unix_close_race/Makefile head/tools/regression/sockets/unix_cmsg/Makefile head/tools/regression/sockets/unix_gc/Makefile head/tools/regression/sockets/unix_passfd/Makefile head/tools/regression/sockets/unix_sendtorace/Makefile head/tools/regression/sockets/unix_socket/Makefile head/tools/regression/sockets/unix_sorflush/Makefile head/tools/regression/sockets/zerosend/Makefile head/tools/regression/sysvmsg/Makefile head/tools/regression/sysvsem/Makefile head/tools/regression/sysvshm/Makefile head/tools/regression/tls/ttls1/Makefile head/tools/regression/tls/ttls2/Makefile head/tools/regression/tls/ttls4/Makefile head/tools/regression/tmpfs/Makefile head/tools/regression/ufs/uprintf/Makefile head/tools/test/auxinfo/Makefile head/tools/test/iconv/gnu/Makefile head/tools/test/iconv/posix/Makefile head/tools/test/iconv/refgen/Makefile head/tools/test/iconv/tablegen/Makefile head/tools/test/malloc/Makefile head/tools/test/netfibs/Makefile head/tools/test/ppsapi/Makefile head/tools/test/ptrace/Makefile head/tools/test/upsdl/Makefile head/tools/tools/aac/Makefile head/tools/tools/ath/Makefile.inc head/tools/tools/ath/ath_ee_9287_print/Makefile head/tools/tools/ath/ath_ee_9300_print/Makefile head/tools/tools/ath/ath_ee_v14_print/Makefile head/tools/tools/ath/ath_ee_v4k_print/Makefile head/tools/tools/ath/athstats/Makefile head/tools/tools/atsectl/Makefile head/tools/tools/bootparttest/Makefile head/tools/tools/cfi/Makefile head/tools/tools/cxgbetool/Makefile head/tools/tools/cxgbtool/Makefile head/tools/tools/drm/radeon/mkregtable/Makefile head/tools/tools/find-sb/Makefile head/tools/tools/gdb_regofs/Makefile head/tools/tools/ifinfo/Makefile head/tools/tools/ifpifa/Makefile head/tools/tools/ipw/Makefile head/tools/tools/iwi/Makefile head/tools/tools/iwn/iwnstats/Makefile head/tools/tools/mfi/Makefile head/tools/tools/mwl/mwldebug/Makefile head/tools/tools/mwl/mwlstats/Makefile head/tools/tools/ncpus/Makefile head/tools/tools/net80211/stumbler/Makefile head/tools/tools/net80211/w00t/Makefile.inc head/tools/tools/net80211/wesside/dics/Makefile head/tools/tools/net80211/wesside/udps/Makefile head/tools/tools/net80211/wesside/wesside/Makefile head/tools/tools/net80211/wlaninject/Makefile head/tools/tools/net80211/wlanstats/Makefile head/tools/tools/net80211/wlantxtime/Makefile head/tools/tools/net80211/wlanwatch/Makefile head/tools/tools/net80211/wlanwds/Makefile head/tools/tools/netmap/Makefile head/tools/tools/netrate/http/Makefile head/tools/tools/netrate/httpd/Makefile head/tools/tools/netrate/juggle/Makefile head/tools/tools/netrate/netblast/Makefile head/tools/tools/netrate/netreceive/Makefile head/tools/tools/netrate/netsend/Makefile head/tools/tools/netrate/tcpconnect/Makefile head/tools/tools/netrate/tcpp/Makefile head/tools/tools/netrate/tcpreceive/Makefile head/tools/tools/npe/npestats/Makefile head/tools/tools/nxge/Makefile head/tools/tools/pciroms/Makefile head/tools/tools/pirtool/Makefile head/tools/tools/syscall_timing/Makefile head/tools/tools/tionxcl/Makefile head/tools/tools/umastat/Makefile head/tools/tools/vxge/Makefile head/tools/tools/wtap/vis_map/Makefile head/tools/tools/wtap/wtap/Makefile head/tools/tools/zfsboottest/Makefile head/usr.bin/bzip2recover/Makefile head/usr.bin/clang/clang-tblgen/Makefile head/usr.bin/clang/llvm-mc/Makefile head/usr.bin/clang/llvm-objdump/Makefile head/usr.bin/clang/llvm-rtdyld/Makefile head/usr.bin/clang/macho-dump/Makefile head/usr.bin/cpio/test/Makefile head/usr.bin/dirname/Makefile head/usr.bin/locate/bigram/Makefile head/usr.bin/locate/code/Makefile head/usr.bin/mkcsmapper_static/Makefile head/usr.bin/mkesdb_static/Makefile head/usr.bin/svn/svn/Makefile head/usr.bin/svn/svnadmin/Makefile head/usr.bin/svn/svndumpfilter/Makefile head/usr.bin/svn/svnlook/Makefile head/usr.bin/svn/svnmucc/Makefile head/usr.bin/svn/svnrdump/Makefile head/usr.bin/svn/svnserve/Makefile head/usr.bin/svn/svnsync/Makefile head/usr.bin/svn/svnversion/Makefile head/usr.bin/tar/test/Makefile head/usr.bin/unexpand/Makefile head/usr.bin/uudecode/Makefile head/usr.bin/vgrind/RETEST/Makefile head/usr.bin/xlint/lint2/Makefile head/usr.sbin/bhyvectl/Makefile head/usr.sbin/bootparamd/callbootd/Makefile head/usr.sbin/bsdinstall/distextract/Makefile head/usr.sbin/bsdinstall/distfetch/Makefile head/usr.sbin/bsdinstall/scripts/Makefile head/usr.sbin/crunch/examples/Makefile head/usr.sbin/ctm/ctm_dequeue/Makefile head/usr.sbin/ctm/ctm_smail/Makefile head/usr.sbin/ctm/mkCTM/Makefile head/usr.sbin/fifolog/fifolog_reader/Makefile head/usr.sbin/fifolog/fifolog_writer/Makefile head/usr.sbin/lpr/filters.ru/koi2855/Makefile head/usr.sbin/lpr/filters.ru/koi2alt/Makefile head/usr.sbin/lpr/filters/Makefile head/usr.sbin/ntp/ntp-keygen/Makefile head/usr.sbin/ntp/ntpd/Makefile head/usr.sbin/ntp/ntpdate/Makefile head/usr.sbin/ntp/ntpdc/Makefile head/usr.sbin/ntp/ntpq/Makefile head/usr.sbin/ntp/ntptime/Makefile head/usr.sbin/portsnap/make_index/Makefile head/usr.sbin/portsnap/phttpget/Makefile head/usr.sbin/rpc.ypupdated/Makefile Modified: head/cddl/usr.bin/sgsmsg/Makefile ============================================================================== --- head/cddl/usr.bin/sgsmsg/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/cddl/usr.bin/sgsmsg/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -5,7 +5,7 @@ # This program is required as a bootstrap tool for 'make buildworld' PROG= sgsmsg -NO_MAN= +MAN= SRCS= avl.c sgsmsg.c string_table.c findprime.c WARNS?= 0 Modified: head/cddl/usr.bin/zinject/Makefile ============================================================================== --- head/cddl/usr.bin/zinject/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/cddl/usr.bin/zinject/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -4,7 +4,7 @@ PROG= zinject SRCS= zinject.c translate.c -NO_MAN= +MAN= WARNS?= 0 CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris Modified: head/cddl/usr.bin/zlook/Makefile ============================================================================== --- head/cddl/usr.bin/zlook/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/cddl/usr.bin/zlook/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../contrib/opensolaris/cmd/zlook PROG= zlook -NO_MAN= +MAN= WARNS?= 0 CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris Modified: head/cddl/usr.bin/ztest/Makefile ============================================================================== --- head/cddl/usr.bin/ztest/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/cddl/usr.bin/ztest/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../..//contrib/opensolaris/cmd/ztest PROG= ztest -NO_MAN= +MAN= WARNS?= 0 CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris Modified: head/cddl/usr.sbin/zhack/Makefile ============================================================================== --- head/cddl/usr.sbin/zhack/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/cddl/usr.sbin/zhack/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/zhack PROG= zhack -NO_MAN= +MAN= WARNS?= 0 CSTD= c99 Modified: head/contrib/libucl/Makefile.am ============================================================================== --- head/contrib/libucl/Makefile.am Sun Apr 13 05:21:48 2014 (r264399) +++ head/contrib/libucl/Makefile.am Sun Apr 13 05:21:56 2014 (r264400) @@ -4,4 +4,4 @@ EXTRA_DIST = uthash README.md pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libucl.pc -SUBDIRS = src tests utils doc \ No newline at end of file +SUBDIRS = src tests utils doc Modified: head/contrib/libucl/doc/Makefile.am ============================================================================== --- head/contrib/libucl/doc/Makefile.am Sun Apr 13 05:21:48 2014 (r264399) +++ head/contrib/libucl/doc/Makefile.am Sun Apr 13 05:21:56 2014 (r264400) @@ -5,4 +5,4 @@ dist_man_MANS = libucl.3 gen-man: @PANDOC@ tail -n +$$(grep -n '# Synopsis' api.md | cut -d':' -f1) api.md | \ cat pandoc.template - | sed -e 's/^# \(.*\)/# \U\1/' | \ - @PANDOC@ -s -f markdown -t man -o libucl.3 \ No newline at end of file + @PANDOC@ -s -f markdown -t man -o libucl.3 Modified: head/contrib/libucl/tests/Makefile.am ============================================================================== --- head/contrib/libucl/tests/Makefile.am Sun Apr 13 05:21:48 2014 (r264399) +++ head/contrib/libucl/tests/Makefile.am Sun Apr 13 05:21:56 2014 (r264400) @@ -30,4 +30,4 @@ test_schema_SOURCES = test_schema.c test_schema_LDADD = $(common_test_ldadd) test_schema_CFLAGS = $(common_test_cflags) -check_PROGRAMS = test_basic test_speed test_generate test_schema \ No newline at end of file +check_PROGRAMS = test_basic test_speed test_generate test_schema Modified: head/contrib/libucl/utils/Makefile.am ============================================================================== --- head/contrib/libucl/utils/Makefile.am Sun Apr 13 05:21:48 2014 (r264399) +++ head/contrib/libucl/utils/Makefile.am Sun Apr 13 05:21:56 2014 (r264400) @@ -16,4 +16,4 @@ UTL = ucl_chargen ucl_objdump else UTL = endif -bin_PROGRAMS = $(UTL) \ No newline at end of file +bin_PROGRAMS = $(UTL) Modified: head/contrib/ofed/usr.bin/ibsendtrap/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/ibsendtrap/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/contrib/ofed/usr.bin/ibsendtrap/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -7,7 +7,7 @@ PROG= ibsendtrap SRCS= ibsendtrap.c ibdiag_common.c LDADD= -libumad -libcommon -libmad CFLAGS+= -I${DIAGPATH}/include -NO_MAN= true +MAN= WARNS?= 1 Modified: head/contrib/ofed/usr.lib/libsdp/Makefile ============================================================================== --- head/contrib/ofed/usr.lib/libsdp/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/contrib/ofed/usr.lib/libsdp/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -11,7 +11,7 @@ SDPDIR= ${.CURDIR}/../../libsdp/src LIB= ibsdp SHLIB_MAJOR= 1 NO_PROFILE= -NO_MAN= +MAN= SRCS= log.c match.c port.c config_parser.c config_scanner.c Modified: head/crypto/heimdal/appl/Makefile.am ============================================================================== --- head/crypto/heimdal/appl/Makefile.am Sun Apr 13 05:21:48 2014 (r264399) +++ head/crypto/heimdal/appl/Makefile.am Sun Apr 13 05:21:56 2014 (r264400) @@ -26,4 +26,4 @@ SUBDIRS = \ kf \ $(dir_dce) -EXTRA_DIST = NTMakefile \ No newline at end of file +EXTRA_DIST = NTMakefile Modified: head/crypto/heimdal/appl/ftp/Makefile.am ============================================================================== --- head/crypto/heimdal/appl/ftp/Makefile.am Sun Apr 13 05:21:48 2014 (r264399) +++ head/crypto/heimdal/appl/ftp/Makefile.am Sun Apr 13 05:21:56 2014 (r264400) @@ -4,4 +4,4 @@ include $(top_srcdir)/Makefile.am.common SUBDIRS = common ftp ftpd -EXTRA_DIST = NTMakefile \ No newline at end of file +EXTRA_DIST = NTMakefile Modified: head/crypto/heimdal/appl/ftp/common/Makefile.am ============================================================================== --- head/crypto/heimdal/appl/ftp/common/Makefile.am Sun Apr 13 05:21:48 2014 (r264399) +++ head/crypto/heimdal/appl/ftp/common/Makefile.am Sun Apr 13 05:21:56 2014 (r264400) @@ -11,4 +11,4 @@ libcommon_a_SOURCES = \ buffer.c \ common.h -EXTRA_DIST = NTMakefile \ No newline at end of file +EXTRA_DIST = NTMakefile Modified: head/crypto/heimdal/lib/Makefile.am ============================================================================== --- head/crypto/heimdal/lib/Makefile.am Sun Apr 13 05:21:48 2014 (r264399) +++ head/crypto/heimdal/lib/Makefile.am Sun Apr 13 05:21:56 2014 (r264400) @@ -42,4 +42,4 @@ SUBDIRS = \ $(dir_otp) \ $(dir_dce) -EXTRA_DIST = NTMakefile heimdal \ No newline at end of file +EXTRA_DIST = NTMakefile heimdal Modified: head/crypto/heimdal/lib/ipc/Makefile.am ============================================================================== --- head/crypto/heimdal/lib/ipc/Makefile.am Sun Apr 13 05:21:48 2014 (r264399) +++ head/crypto/heimdal/lib/ipc/Makefile.am Sun Apr 13 05:21:56 2014 (r264400) @@ -64,4 +64,4 @@ CLEANFILES = $(built_ipcc) $(built_ipcs) $(srcdir)/client.c: $(built_ipcc) $(srcdir)/server.c: $(built_ipcs) -endif \ No newline at end of file +endif Modified: head/games/fortune/unstr/Makefile ============================================================================== --- head/games/fortune/unstr/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/games/fortune/unstr/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -2,7 +2,7 @@ # $FreeBSD$ PROG= unstr -NO_MAN= +MAN= CFLAGS+= -I${.CURDIR}/../strfile .include Modified: head/games/ppt/Makefile ============================================================================== --- head/games/ppt/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/games/ppt/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -2,7 +2,7 @@ # $FreeBSD$ PROG= ppt -NO_MAN= +MAN= .include Modified: head/games/primes/Makefile ============================================================================== --- head/games/primes/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/games/primes/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -3,7 +3,7 @@ PROG= primes SRCS= pattern.c pr_tbl.c primes.c -NO_MAN= +MAN= DPADD= ${LIBM} LDADD= -lm Modified: head/gnu/usr.bin/cc/c++/Makefile ============================================================================== --- head/gnu/usr.bin/cc/c++/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/gnu/usr.bin/cc/c++/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -1,6 +1,6 @@ # $FreeBSD$ -NO_MAN= +MAN= .include .include "../Makefile.inc" Modified: head/gnu/usr.bin/cc/c++filt/Makefile ============================================================================== --- head/gnu/usr.bin/cc/c++filt/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/gnu/usr.bin/cc/c++filt/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -1,6 +1,6 @@ # $FreeBSD$ -NO_MAN= +MAN= .include .include "../Makefile.inc" Modified: head/gnu/usr.bin/cc/cc1/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc1/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/gnu/usr.bin/cc/cc1/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -1,6 +1,6 @@ # $FreeBSD$ -NO_MAN= +MAN= .include .include "../Makefile.inc" Modified: head/gnu/usr.bin/cc/cc1plus/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc1plus/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/gnu/usr.bin/cc/cc1plus/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -1,6 +1,6 @@ # $FreeBSD$ -NO_MAN= +MAN= .include .include "../Makefile.inc" Modified: head/gnu/usr.bin/cc/collect2/Makefile ============================================================================== --- head/gnu/usr.bin/cc/collect2/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/gnu/usr.bin/cc/collect2/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -6,6 +6,6 @@ PROG= collect2 SRCS= collect2.c tlink.c version.c -NO_MAN= +MAN= .include Modified: head/gnu/usr.bin/cc/protoize/Makefile ============================================================================== --- head/gnu/usr.bin/cc/protoize/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/gnu/usr.bin/cc/protoize/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -5,7 +5,7 @@ .PATH: ${.CURDIR}/../cc_tools ${GCCDIR} PROG= protoize -NO_MAN= +MAN= # things are rather hard-coded, we work around that here CFLAGS+= -DDEFAULT_TARGET_VERSION=\"\" Modified: head/gnu/usr.bin/gdb/Makefile.inc ============================================================================== --- head/gnu/usr.bin/gdb/Makefile.inc Sun Apr 13 05:21:48 2014 (r264399) +++ head/gnu/usr.bin/gdb/Makefile.inc Sun Apr 13 05:21:56 2014 (r264400) @@ -52,7 +52,7 @@ GENSRCS+= nm.h tm.h .if defined(GDB_CROSS_DEBUGGER) CFLAGS+= -DCROSS_DEBUGGER -I${BMAKE_ROOT}/../.. GDB_SUFFIX= -${TARGET_ARCH} -NO_MAN= +MAN= .endif .include "${TARGET_SUBDIR}/Makefile" Modified: head/gnu/usr.bin/gdb/gdbtui/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/gdbtui/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/gnu/usr.bin/gdb/gdbtui/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -2,7 +2,7 @@ PROG= gdbtui${GDB_SUFFIX} SRCS= tui-main.c -NO_MAN= +MAN= BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_BU}/libopcodes/libopcodes.a \ ${OBJ_BU}/libiberty/libiberty.a Modified: head/gnu/usr.bin/groff/src/devices/grohtml/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/devices/grohtml/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/gnu/usr.bin/groff/src/devices/grohtml/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -4,6 +4,6 @@ PROG_CXX= post-grohtml SRCS= post-html.cpp html-table.cpp html-text.cpp output.cpp DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM} LDADD= ${LIBDRIVER} ${LIBGROFF} -lm -NO_MAN= +MAN= .include Modified: head/gnu/usr.bin/groff/src/preproc/html/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/preproc/html/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/gnu/usr.bin/groff/src/preproc/html/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -4,6 +4,6 @@ PROG_CXX= pre-grohtml SRCS= pre-html.cpp pushback.cpp DPADD= ${LIBGROFF} LDADD= ${LIBGROFF} -NO_MAN= +MAN= .include Modified: head/kerberos5/libexec/digest-service/Makefile ============================================================================== --- head/kerberos5/libexec/digest-service/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/kerberos5/libexec/digest-service/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= digest-service -NO_MAN= 1 +MAN= CFLAGS+= -I${KRB5DIR}/kdc \ -I${KRB5DIR}/lib/asn1 \ -I${KRB5DIR}/lib/krb5 \ Modified: head/kerberos5/libexec/ipropd-slave/Makefile ============================================================================== --- head/kerberos5/libexec/ipropd-slave/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/kerberos5/libexec/ipropd-slave/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= ipropd-slave -NO_MAN= +MAN= SRCS= ipropd_common.c ipropd_slave.c kadm5_err.h CFLAGS+=-I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \ -I. ${LDAPCFLAGS} Modified: head/kerberos5/tools/asn1_compile/Makefile ============================================================================== --- head/kerberos5/tools/asn1_compile/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/kerberos5/tools/asn1_compile/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= asn1_compile -NO_MAN= +MAN= LIBROKEN_A= ${.OBJDIR}/../../lib/libroken/libroken.a LDADD= ${LIBROKEN_A} ${LIBVERS} DPADD= ${LIBROKEN_A} ${LIBVERS} Modified: head/kerberos5/tools/make-roken/Makefile ============================================================================== --- head/kerberos5/tools/make-roken/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/kerberos5/tools/make-roken/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= make-roken -NO_MAN= +MAN= CLEANFILES= make-roken.c Modified: head/kerberos5/tools/slc/Makefile ============================================================================== --- head/kerberos5/tools/slc/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/kerberos5/tools/slc/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -4,7 +4,7 @@ PROG= slc LIBROKEN_A= ${.OBJDIR}/../../lib/libroken/libroken.a LDADD= ${LIBROKEN_A} ${LIBVERS} DPADD= ${LIBROKEN_A} ${LIBVERS} -NO_MAN= +MAN= SRCS= roken.h \ slc-gram.y \ Modified: head/kerberos5/usr.bin/hxtool/Makefile ============================================================================== --- head/kerberos5/usr.bin/hxtool/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/kerberos5/usr.bin/hxtool/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= hxtool -NO_MAN= 1 +MAN= CFLAGS+= -I${KRB5DIR}/lib/hx509 \ -I${KRB5DIR}/lib/asn1 \ -I${KRB5DIR}/lib/roken \ Modified: head/kerberos5/usr.bin/ksu/Makefile ============================================================================== --- head/kerberos5/usr.bin/ksu/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/kerberos5/usr.bin/ksu/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -5,7 +5,7 @@ PROG= ksu BINMODE=4555 PRECIOUSPROG= .endif -NO_MAN= +MAN= SRCS= su.c CFLAGS+=-I${KRB5DIR}/lib/roken DPADD= ${LIBKAFS5} ${LIBKRB5} ${LIBHX509} ${LIBROKEN} ${LIBVERS} \ Modified: head/lib/libarchive/test/Makefile ============================================================================== --- head/lib/libarchive/test/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/lib/libarchive/test/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -2,7 +2,7 @@ LIBARCHIVEDIR= ${.CURDIR}/../../../contrib/libarchive -NO_MAN=yes +MAN= PROG=libarchive_test INTERNALPROG=yes # Don't install this; it's just for testing Modified: head/lib/libauditd/Makefile ============================================================================== --- head/lib/libauditd/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/lib/libauditd/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -19,6 +19,6 @@ CFLAGS+= -I${OPENBSMDIR} -I${LIBBSMDIR} WARNS?= 3 -NO_MAN= +MAN= .include Modified: head/lib/libproc/Makefile ============================================================================== --- head/lib/libproc/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/lib/libproc/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -25,6 +25,6 @@ DPADD+= ${LIBSTDCPLUSPLUS} SHLIB_MAJOR= 2 -NO_MAN= +MAN= .include Modified: head/lib/libproc/test/t1-bkpt/Makefile ============================================================================== --- head/lib/libproc/test/t1-bkpt/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/lib/libproc/test/t1-bkpt/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -7,6 +7,6 @@ SRCS= t1-bkpt.c LDADD= -lproc -lelf -lrtld_db -lutil DPADD= ${LIBPROC} ${LIBELF} -NO_MAN= +MAN= .include Modified: head/lib/libproc/test/t2-name2map/Makefile ============================================================================== --- head/lib/libproc/test/t2-name2map/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/lib/libproc/test/t2-name2map/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -7,6 +7,6 @@ SRCS= t2-name2map.c LDADD= -lproc -lelf -lrtld_db -lutil DPADD= ${LIBPROC} ${LIBELF} -NO_MAN= +MAN= .include Modified: head/lib/libproc/test/t3-name2sym/Makefile ============================================================================== --- head/lib/libproc/test/t3-name2sym/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/lib/libproc/test/t3-name2sym/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -7,6 +7,6 @@ SRCS= t3-name2sym.c LDADD= -lproc -lelf -lrtld_db -lutil DPADD= ${LIBPROC} ${LIBELF} -NO_MAN= +MAN= .include Modified: head/lib/ncurses/form/Makefile ============================================================================== --- head/lib/ncurses/form/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/lib/ncurses/form/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -158,7 +158,7 @@ MLINKS= form_cursor.3 pos_form_cursor.3 form_win.3 set_form_sub.3 \ form_win.3 set_form_win.3 .else -NO_MAN= +MAN= .endif .include Modified: head/lib/ncurses/menu/Makefile ============================================================================== --- head/lib/ncurses/menu/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/lib/ncurses/menu/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -130,7 +130,7 @@ MLINKS= menu_attributes.3 menu_back.3 \ mitem_value.3 set_item_value.3 \ mitem_visible.3 item_visible.3 .else -NO_MAN= +MAN= .endif .include Modified: head/lib/ncurses/ncurses/Makefile ============================================================================== --- head/lib/ncurses/ncurses/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/lib/ncurses/ncurses/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -549,12 +549,12 @@ MAN+= \ curs_ins_wstr.3 \ curs_printw.3 \ curs_scanw.3 -.endif - -CLEANFILES+= ${MAN:M*.3} MAN+= term.5 terminfo.5 MAN+= term.7 +.endif + +CLEANFILES+= ${MAN:M*.3} MLINKS= ncurses.3 curses.3 \ curs_addch.3 addch.3 \ Modified: head/lib/ncurses/panel/Makefile ============================================================================== --- head/lib/ncurses/panel/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/lib/ncurses/panel/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -58,7 +58,7 @@ MLINKS= panel.3 bottom_panel.3 \ panel.3 top_panel.3 \ panel.3 update_panels.3 .else -NO_MAN= +MAN= .endif .include Modified: head/libexec/bootpd/bootpgw/Makefile ============================================================================== --- head/libexec/bootpd/bootpgw/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/libexec/bootpd/bootpgw/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -2,7 +2,7 @@ # $FreeBSD$ PROG= bootpgw -NO_MAN= +MAN= SRCS= bootpgw.c getif.c hwaddr.c report.c rtmsg.c SRCDIR= ${.CURDIR}/.. Modified: head/libexec/casper/dns/Makefile ============================================================================== --- head/libexec/casper/dns/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/libexec/casper/dns/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -17,6 +17,6 @@ CFLAGS+=-I${.CURDIR}/../../../lib/libcas CFLAGS+=-I${.CURDIR}/../../../lib/libpjdlog CFLAGS+=-I${.CURDIR}/../../../sbin/casper -NO_MAN= +MAN= .include Modified: head/libexec/casper/grp/Makefile ============================================================================== --- head/libexec/casper/grp/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/libexec/casper/grp/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -17,6 +17,6 @@ CFLAGS+=-I${.CURDIR}/../../../lib/libcas CFLAGS+=-I${.CURDIR}/../../../lib/libpjdlog CFLAGS+=-I${.CURDIR}/../../../sbin/casper -NO_MAN= +MAN= .include Modified: head/libexec/casper/pwd/Makefile ============================================================================== --- head/libexec/casper/pwd/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/libexec/casper/pwd/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -17,6 +17,6 @@ CFLAGS+=-I${.CURDIR}/../../../lib/libcas CFLAGS+=-I${.CURDIR}/../../../lib/libpjdlog CFLAGS+=-I${.CURDIR}/../../../sbin/casper -NO_MAN= +MAN= .include Modified: head/libexec/casper/random/Makefile ============================================================================== --- head/libexec/casper/random/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/libexec/casper/random/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -17,6 +17,6 @@ CFLAGS+=-I${.CURDIR}/../../../lib/libcas CFLAGS+=-I${.CURDIR}/../../../lib/libpjdlog CFLAGS+=-I${.CURDIR}/../../../sbin/casper -NO_MAN= +MAN= .include Modified: head/libexec/casper/sysctl/Makefile ============================================================================== --- head/libexec/casper/sysctl/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/libexec/casper/sysctl/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -17,6 +17,6 @@ CFLAGS+=-I${.CURDIR}/../../../lib/libcas CFLAGS+=-I${.CURDIR}/../../../lib/libpjdlog CFLAGS+=-I${.CURDIR}/../../../sbin/casper -NO_MAN= +MAN= .include Modified: head/libexec/dma-mbox-create/Makefile ============================================================================== --- head/libexec/dma-mbox-create/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/libexec/dma-mbox-create/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -7,7 +7,7 @@ CFLAGS= -I${.CURDIR}/../../contrib/dma \ -DCONF_PATH='"/etc/dma"' \ -DLIBEXEC_PATH='"/usr/libexec"' -DDMA_VERSION='"v0.9+"' -NO_MAN= +MAN= WARNS= 2 Modified: head/libexec/ulog-helper/Makefile ============================================================================== --- head/libexec/ulog-helper/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/libexec/ulog-helper/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -3,7 +3,7 @@ PROG= ulog-helper BINOWN= root BINMODE=4555 -NO_MAN= +MAN= DPADD= ${LIBULOG} LDADD= -lulog Modified: head/release/picobsd/tinyware/aps/Makefile ============================================================================== --- head/release/picobsd/tinyware/aps/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/release/picobsd/tinyware/aps/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -2,7 +2,7 @@ # PROG=ps SRCS+=main.c -NO_MAN= +MAN= .include Modified: head/release/picobsd/tinyware/help/Makefile ============================================================================== --- head/release/picobsd/tinyware/help/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/release/picobsd/tinyware/help/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -2,7 +2,7 @@ # PROG=help SRCS+=help.c -NO_MAN= +MAN= .include Modified: head/release/picobsd/tinyware/msg/Makefile ============================================================================== --- head/release/picobsd/tinyware/msg/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/release/picobsd/tinyware/msg/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -2,7 +2,7 @@ # PROG=msg SRCS= msg.c -NO_MAN= +MAN= .include Modified: head/release/picobsd/tinyware/ns/Makefile ============================================================================== --- head/release/picobsd/tinyware/ns/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/release/picobsd/tinyware/ns/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -4,6 +4,6 @@ PROG= ns SRCS= ns.c CFLAGS+= -DBRIDGING -NO_MAN= +MAN= .include Modified: head/release/picobsd/tinyware/oinit/Makefile ============================================================================== --- head/release/picobsd/tinyware/oinit/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/release/picobsd/tinyware/oinit/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -15,7 +15,7 @@ CFLAGS= -DSH_PATH=\"${SH_PATH}\" -DSH_N #LDADD= -lutil -ledit -ltermcap LDADD=-lutil -NO_MAN= +MAN= .include Modified: head/release/picobsd/tinyware/simple_httpd/Makefile ============================================================================== --- head/release/picobsd/tinyware/simple_httpd/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/release/picobsd/tinyware/simple_httpd/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -2,7 +2,7 @@ # PROG=simple_httpd SRCS= simple_httpd.c -NO_MAN= +MAN= WARNS?=6 .include Modified: head/release/picobsd/tinyware/sps/Makefile ============================================================================== --- head/release/picobsd/tinyware/sps/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/release/picobsd/tinyware/sps/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -2,7 +2,7 @@ # PROG=sps SRCS= sps.c -NO_MAN= +MAN= .include Modified: head/release/picobsd/tinyware/view/Makefile ============================================================================== --- head/release/picobsd/tinyware/view/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/release/picobsd/tinyware/view/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -4,6 +4,6 @@ PROG=view SRCS=view.c CFLAGS+=-I/usr/local/include LDADD+=-L/usr/local/lib -lpng -lvgl -lz -lm -NO_MAN= +MAN= .include Modified: head/release/picobsd/tinyware/vm/Makefile ============================================================================== --- head/release/picobsd/tinyware/vm/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/release/picobsd/tinyware/vm/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -3,7 +3,7 @@ PROG=vm #CFLAGS+= SRCS= vm.c -NO_MAN= +MAN= .include Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/rescue/rescue/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -1,7 +1,7 @@ #$FreeBSD$ # @(#)Makefile 8.1 (Berkeley) 6/2/93 -NO_MAN= +MAN= .include MK_SSP= no Modified: head/sbin/geom/Makefile ============================================================================== --- head/sbin/geom/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sbin/geom/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -9,7 +9,7 @@ PROG= geom SRCS= geom.c geom_label.c geom_part.c subr.c -NO_MAN= +MAN= WARNS?= 2 CFLAGS+=-I${.CURDIR} -I${.CURDIR}/core -DSTATIC_GEOM_CLASSES Modified: head/sbin/rtsol/Makefile ============================================================================== --- head/sbin/rtsol/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sbin/rtsol/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -20,7 +20,7 @@ SRCDIR= ${.CURDIR}/../../usr.sbin/rtsold PROG= rtsol SRCS= rtsold.c rtsol.c if.c probe.c dump.c rtsock.c -NO_MAN= +MAN= WARNS?= 3 CFLAGS+= -DHAVE_ARC4RANDOM -DHAVE_POLL_H -DSMALL Modified: head/secure/lib/libcrypto/engines/lib4758cca/Makefile ============================================================================== --- head/secure/lib/libcrypto/engines/lib4758cca/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/secure/lib/libcrypto/engines/lib4758cca/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -2,6 +2,6 @@ SHLIB_NAME?= lib4758cca.so SRCS= e_4758cca.c -NO_MAN= # For now +MAN= .include Modified: head/share/examples/FreeBSD_version/Makefile ============================================================================== --- head/share/examples/FreeBSD_version/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/share/examples/FreeBSD_version/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= FreeBSD_version -NO_MAN= +MAN= install: Modified: head/share/examples/autofs/driver/Makefile ============================================================================== --- head/share/examples/autofs/driver/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/share/examples/autofs/driver/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -2,7 +2,7 @@ # $FreeBSD$ PROG= autodriver -NO_MAN= +MAN= SRCS= autodriver.c WARNS?= 4 Modified: head/share/examples/find_interface/Makefile ============================================================================== --- head/share/examples/find_interface/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/share/examples/find_interface/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -1,6 +1,6 @@ # $FreeBSD$ PROG= find_interface -NO_MAN= +MAN= .include Modified: head/share/examples/kld/cdev/test/Makefile ============================================================================== --- head/share/examples/kld/cdev/test/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/share/examples/kld/cdev/test/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -67,7 +67,7 @@ # $FreeBSD$ # PROG= testcdev -NO_MAN= +MAN= WARNS?= 5 MODSTAT= /sbin/kldstat Modified: head/share/examples/kld/syscall/test/Makefile ============================================================================== --- head/share/examples/kld/syscall/test/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/share/examples/kld/syscall/test/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -2,7 +2,7 @@ # $FreeBSD$ PROG= call -NO_MAN= +MAN= WARNS?= 5 .include Modified: head/share/examples/libvgl/Makefile ============================================================================== --- head/share/examples/libvgl/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/share/examples/libvgl/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= demo -NO_MAN= +MAN= DPADD= ${LIBVGL} LDADD= -lvgl Modified: head/share/examples/perfmon/Makefile ============================================================================== --- head/share/examples/perfmon/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/share/examples/perfmon/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= perfmon -NO_MAN= +MAN= install: Modified: head/share/examples/ppi/Makefile ============================================================================== --- head/share/examples/ppi/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/share/examples/ppi/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -3,6 +3,6 @@ # $FreeBSD$ PROG= ppilcd -NO_MAN= +MAN= .include Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Sun Apr 13 05:21:48 2014 (r264399) +++ head/share/mk/bsd.README Sun Apr 13 05:21:56 2014 (r264400) @@ -309,7 +309,7 @@ To build foo from foo.c with a manual pa If foo does not have a manual page at all, add the line: - NO_MAN= + MAN= If foo has multiple source files, add the line: Modified: head/sys/boot/amd64/efi/Makefile ============================================================================== --- head/sys/boot/amd64/efi/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sys/boot/amd64/efi/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -1,6 +1,6 @@ # $FreeBSD$ -NO_MAN= +MAN= .include Modified: head/sys/boot/arm/at91/boot0/Makefile ============================================================================== --- head/sys/boot/arm/at91/boot0/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sys/boot/arm/at91/boot0/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -5,7 +5,7 @@ P=boot0 FILES=${P} SRCS=arm_init.S main.c -NO_MAN= +MAN= LDFLAGS=-e 0 -T ${.CURDIR}/linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: head/sys/boot/arm/at91/boot0iic/Makefile ============================================================================== --- head/sys/boot/arm/at91/boot0iic/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sys/boot/arm/at91/boot0iic/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -5,7 +5,7 @@ P=boot0iic FILES=${P} SRCS=arm_init.S main.c -NO_MAN= +MAN= LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: head/sys/boot/arm/at91/boot0spi/Makefile ============================================================================== --- head/sys/boot/arm/at91/boot0spi/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sys/boot/arm/at91/boot0spi/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -5,7 +5,7 @@ P=boot0spi FILES=${P} SRCS=arm_init.S main.c -NO_MAN= +MAN= LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: head/sys/boot/arm/at91/boot2/Makefile ============================================================================== --- head/sys/boot/arm/at91/boot2/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sys/boot/arm/at91/boot2/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -5,7 +5,7 @@ P=boot2 FILES=${P} SRCS=arm_init.S boot2.c ${BOOT_FLAVOR:tl}_board.c -NO_MAN= +MAN= LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: head/sys/boot/arm/at91/bootiic/Makefile ============================================================================== --- head/sys/boot/arm/at91/bootiic/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sys/boot/arm/at91/bootiic/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -5,7 +5,7 @@ P=bootiic FILES=${P} SRCS=arm_init.S main.c loader_prompt.c env_vars.c -NO_MAN= +MAN= LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: head/sys/boot/arm/at91/bootspi/Makefile ============================================================================== --- head/sys/boot/arm/at91/bootspi/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sys/boot/arm/at91/bootspi/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -5,7 +5,7 @@ P=bootspi FILES=${P} SRCS=arm_init.S main.c loader_prompt.c env_vars.c ee.c -NO_MAN= +MAN= LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: head/sys/boot/arm/at91/libat91/Makefile ============================================================================== --- head/sys/boot/arm/at91/libat91/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sys/boot/arm/at91/libat91/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -11,7 +11,7 @@ SRCS=${SOC}_lowlevel.c delay.c eeprom.c sd-card.c strcvt.c strlen.c strcmp.c memcpy.c strcpy.c \ memset.c memcmp.c SRCS+=ashldi3.c divsi3.S -NO_MAN= +MAN= .if ${MK_TAG_LIST} != "no" CFLAGS += -I${.CURDIR}/.. -DSUPPORT_TAG_LIST Modified: head/sys/boot/arm/ixp425/boot2/Makefile ============================================================================== --- head/sys/boot/arm/ixp425/boot2/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sys/boot/arm/ixp425/boot2/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -20,7 +20,7 @@ SRCS+=strlen.c ashldi3.c divsi3.S muldi3 .if ${MK_ARM_EABI} != "no" SRCS+=aeabi_unwind.c .endif -NO_MAN= +MAN= KERNPHYSADDR=0x180000 KERNVIRTADDR=${KERNPHYSADDR} Modified: head/sys/boot/i386/boot0/Makefile ============================================================================== --- head/sys/boot/i386/boot0/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sys/boot/i386/boot0/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -3,7 +3,7 @@ PROG?= boot0 STRIP= BINMODE=${NOBINMODE} -NO_MAN= +MAN= SRCS= ${PROG}.S # Additional options that you can specify with make OPTS="..." Modified: head/sys/boot/i386/btx/btx/Makefile ============================================================================== --- head/sys/boot/i386/btx/btx/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sys/boot/i386/btx/btx/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -2,7 +2,7 @@ PROG= btx INTERNALPROG= -NO_MAN= +MAN= SRCS= btx.S .if defined(BOOT_BTX_NOHANG) Modified: head/sys/boot/i386/btx/btxldr/Makefile ============================================================================== --- head/sys/boot/i386/btx/btxldr/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sys/boot/i386/btx/btxldr/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -2,7 +2,7 @@ PROG= btxldr INTERNALPROG= -NO_MAN= +MAN= SRCS= btxldr.S CFLAGS+=-DLOADER_ADDRESS=${LOADER_ADDRESS} Modified: head/sys/boot/i386/btx/lib/Makefile ============================================================================== --- head/sys/boot/i386/btx/lib/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sys/boot/i386/btx/lib/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -2,7 +2,7 @@ PROG= crt0.o INTERNALPROG= -NO_MAN= +MAN= SRCS= btxcsu.S btxsys.s btxv86.s CFLAGS+=-I${.CURDIR}/../../common LDFLAGS=-Wl,-r Modified: head/sys/boot/i386/cdboot/Makefile ============================================================================== --- head/sys/boot/i386/cdboot/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sys/boot/i386/cdboot/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -3,7 +3,7 @@ PROG= cdboot STRIP= BINMODE=${NOBINMODE} -NO_MAN= +MAN= SRCS= ${PROG}.S CFLAGS+=-I${.CURDIR}/../common Modified: head/sys/boot/i386/kgzldr/Makefile ============================================================================== --- head/sys/boot/i386/kgzldr/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sys/boot/i386/kgzldr/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -4,7 +4,7 @@ PROG= kgzldr.o STRIP= BINMODE=${LIBMODE} BINDIR= ${LIBDIR} -NO_MAN= +MAN= SRCS= start.s boot.c inflate.c lib.c crt.s sio.s CFLAGS= -Os Modified: head/sys/boot/i386/mbr/Makefile ============================================================================== --- head/sys/boot/i386/mbr/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sys/boot/i386/mbr/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -3,7 +3,7 @@ PROG= mbr STRIP= BINMODE=${NOBINMODE} -NO_MAN= +MAN= SRCS= ${PROG}.s # MBR flags: 0x80 -- try packet interface (also known as EDD or LBA) Modified: head/sys/boot/i386/pmbr/Makefile ============================================================================== --- head/sys/boot/i386/pmbr/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sys/boot/i386/pmbr/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -3,7 +3,7 @@ PROG= pmbr STRIP= BINMODE=${NOBINMODE} -NO_MAN= +MAN= SRCS= ${PROG}.s ORG= 0x600 Modified: head/sys/boot/i386/zfsloader/Makefile ============================================================================== --- head/sys/boot/i386/zfsloader/Makefile Sun Apr 13 05:21:48 2014 (r264399) +++ head/sys/boot/i386/zfsloader/Makefile Sun Apr 13 05:21:56 2014 (r264400) @@ -6,7 +6,7 @@ LOADER= zfsloader NEWVERSWHAT= "ZFS enabled bootstrap loader" x86 LOADER_ZFS_SUPPORT=yes LOADER_ONLY= yes -NO_MAN= yes +MAN= .include "${.CURDIR}/../loader/Makefile" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 05:22:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6E0EC4F; Sun, 13 Apr 2014 05:22:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A60F917B9; Sun, 13 Apr 2014 05:22:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3D5MMSg052951; Sun, 13 Apr 2014 05:22:22 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3D5MM6H052950; Sun, 13 Apr 2014 05:22:22 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404130522.s3D5MM6H052950@svn.freebsd.org> From: Warner Losh Date: Sun, 13 Apr 2014 05:22:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264401 - head/sbin/mount_fusefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 05:22:22 -0000 Author: imp Date: Sun Apr 13 05:22:22 2014 New Revision: 264401 URL: http://svnweb.freebsd.org/changeset/base/264401 Log: In tree makefile shouldn't be setting policy piecemeal. Don't set NO_MANCOMPRESS here. Modified: head/sbin/mount_fusefs/Makefile Modified: head/sbin/mount_fusefs/Makefile ============================================================================== --- head/sbin/mount_fusefs/Makefile Sun Apr 13 05:21:56 2014 (r264400) +++ head/sbin/mount_fusefs/Makefile Sun Apr 13 05:22:22 2014 (r264401) @@ -23,7 +23,6 @@ DEBUG_FLAGS+= -DFUSE4BSD_VERSION="\"${F4 PROG= mount_fusefs SRCS= mount_fusefs.c getmntopts.c MAN8= mount_fusefs.8 -NO_MANCOMPRESS?= yes MOUNT= ${.CURDIR}/../mount CFLAGS+= -I${MOUNT} From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 05:22:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04F85DDC; Sun, 13 Apr 2014 05:22:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAB5217BD; Sun, 13 Apr 2014 05:22:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3D5MRUs053015; Sun, 13 Apr 2014 05:22:27 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3D5MRXc053006; Sun, 13 Apr 2014 05:22:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404130522.s3D5MRXc053006@svn.freebsd.org> From: Warner Losh Date: Sun, 13 Apr 2014 05:22:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264402 - in head/share: examples/etc man/man5 mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 05:22:28 -0000 Author: imp Date: Sun Apr 13 05:22:26 2014 New Revision: 264402 URL: http://svnweb.freebsd.org/changeset/base/264402 Log: Convert NO_MANCOMPRESS to normal convention. Modified: head/share/examples/etc/make.conf head/share/man/man5/make.conf.5 head/share/mk/bsd.man.mk head/share/mk/bsd.own.mk Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Sun Apr 13 05:22:22 2014 (r264401) +++ head/share/examples/etc/make.conf Sun Apr 13 05:22:26 2014 (r264402) @@ -138,7 +138,7 @@ # If you do not want unformatted manual pages to be compressed # when they are installed: # -#NO_MANCOMPRESS= +#WITHOUT_MANCOMPRESS=t # # # Default format for system documentation, depends on your printer. Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Sun Apr 13 05:22:22 2014 (r264401) +++ head/share/man/man5/make.conf.5 Sun Apr 13 05:22:26 2014 (r264402) @@ -434,8 +434,11 @@ Set this to run .Dq Li "${MAKE} clean" instead of .Dq Li "${MAKE} cleandir" . -.It Va NO_MANCOMPRESS -.Pq Vt bool +.It Va WITH_MANCOMPRESS +.Pq Vt defined +Set to install manual pages compressed. +.It Va WITHOUT_MANCOMPRESS +.Pq Vt defined Set to install manual pages uncompressed. .It Va NO_SHARE .Pq Vt bool Modified: head/share/mk/bsd.man.mk ============================================================================== --- head/share/mk/bsd.man.mk Sun Apr 13 05:22:22 2014 (r264401) +++ head/share/mk/bsd.man.mk Sun Apr 13 05:22:26 2014 (r264402) @@ -30,9 +30,6 @@ # second, and there may be multiple pairs. The files # are hard-linked. # -# NO_MANCOMPRESS If you do not want unformatted manual pages to be -# compressed when they are installed. [not set] -# # NO_MLINKS If you do not want install manual page links. [not set] # # MANFILTER command to pipe the raw man page through before compressing @@ -77,10 +74,10 @@ MAN+= ${MAN${__sect}} _manpages: all-man: _manpages -.if defined(NO_MANCOMPRESS) +.if ${MK_MANCOMPRESS} != "no" # Make special arrangements to filter to a temporary file at build time -# for NO_MANCOMPRESS. +# for MK_MANCOMPRESS == no. .if defined(MANFILTER) FILTEXTENSION= .filt .else @@ -162,7 +159,7 @@ maninstall: _maninstall _maninstall: .if defined(MAN) && !empty(MAN) _maninstall: ${MAN} -.if defined(NO_MANCOMPRESS) +.if ${MK_MANCOMPRESS} == "no" .if defined(MANFILTER) .for __page in ${MAN} ${MINSTALL} ${__page:T:S/$/${FILTEXTENSION}/g} \ Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sun Apr 13 05:22:22 2014 (r264401) +++ head/share/mk/bsd.own.mk Sun Apr 13 05:22:26 2014 (r264402) @@ -301,6 +301,7 @@ __DEFAULT_YES_OPTIONS = \ MAILWRAPPER \ MAKE \ MAN \ + MANCOMPRESS \ NCURSESW \ NDIS \ NETCAT \ @@ -458,11 +459,14 @@ MK_${var}:= no # Supported NO_* options (if defined, MK_* will be forced to "no", # regardless of user's setting). # +# These are transitional and will disappaer in the fullness of time. +# .for var in \ CTF \ DEBUG_FILES \ INSTALLLIB \ MAN \ + MANCOMPRESS \ PROFILE .if defined(NO_${var}) MK_${var}:=no From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 06:24:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB61435F; Sun, 13 Apr 2014 06:24:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B83EF1BD4; Sun, 13 Apr 2014 06:24:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3D6O1EG077228; Sun, 13 Apr 2014 06:24:01 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3D6O10C077227; Sun, 13 Apr 2014 06:24:01 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201404130624.s3D6O10C077227@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 13 Apr 2014 06:24:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264403 - head/sys/boot/amd64/boot1.efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 06:24:01 -0000 Author: nwhitehorn Date: Sun Apr 13 06:24:01 2014 New Revision: 264403 URL: http://svnweb.freebsd.org/changeset/base/264403 Log: Fix buildworld. I had some local bits in my build tree that caused this to work by accident. Modified: head/sys/boot/amd64/boot1.efi/Makefile Modified: head/sys/boot/amd64/boot1.efi/Makefile ============================================================================== --- head/sys/boot/amd64/boot1.efi/Makefile Sun Apr 13 05:22:26 2014 (r264402) +++ head/sys/boot/amd64/boot1.efi/Makefile Sun Apr 13 06:24:01 2014 (r264403) @@ -22,8 +22,8 @@ CFLAGS+= -I${.CURDIR}/../../efi/include/ CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include CFLAGS+= -I${.CURDIR}/../../.. -# Always add MI sources -.PATH: ${.CURDIR}/../../common ../efi +# Always add MI sources and REGULAR efi loader bits +.PATH: ${.CURDIR}/../efi ${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../common FILES= boot1.efi From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 06:30:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B17304FA; Sun, 13 Apr 2014 06:30:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F3121BFB; Sun, 13 Apr 2014 06:30:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3D6U20V077983; Sun, 13 Apr 2014 06:30:02 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3D6U2fW077981; Sun, 13 Apr 2014 06:30:02 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201404130630.s3D6U2fW077981@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 13 Apr 2014 06:30:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264404 - head/sys/boot/amd64/boot1.efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 06:30:02 -0000 Author: nwhitehorn Date: Sun Apr 13 06:30:02 2014 New Revision: 264404 URL: http://svnweb.freebsd.org/changeset/base/264404 Log: Add my copyright here. Most of this is unmodified from the original sparc64 version, but at least some indication of changes that postdate the actual invention of EFI is probably a good idea. Modified: head/sys/boot/amd64/boot1.efi/boot1.c Modified: head/sys/boot/amd64/boot1.efi/boot1.c ============================================================================== --- head/sys/boot/amd64/boot1.efi/boot1.c Sun Apr 13 06:24:01 2014 (r264403) +++ head/sys/boot/amd64/boot1.efi/boot1.c Sun Apr 13 06:30:02 2014 (r264404) @@ -3,6 +3,8 @@ * All rights reserved. * Copyright (c) 2001 Robert Drehmel * All rights reserved. + * Copyright (c) 2014 Nathan Whitehorn + * All rights reserved. * * Redistribution and use in source and binary forms are freely * permitted provided that the above copyright notice and this From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 09:31:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A009C126; Sun, 13 Apr 2014 09:31:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BA441A5D; Sun, 13 Apr 2014 09:31:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3D9VMjT054825; Sun, 13 Apr 2014 09:31:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3D9VMMr054824; Sun, 13 Apr 2014 09:31:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404130931.s3D9VMMr054824@svn.freebsd.org> From: Alexander Motin Date: Sun, 13 Apr 2014 09:31:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264405 - head/usr.bin/iscsictl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 09:31:22 -0000 Author: mav Date: Sun Apr 13 09:31:22 2014 New Revision: 264405 URL: http://svnweb.freebsd.org/changeset/base/264405 Log: Fix periph listing when IOCTL buffer border hits result for wanted bus. Modified: head/usr.bin/iscsictl/periphs.c Modified: head/usr.bin/iscsictl/periphs.c ============================================================================== --- head/usr.bin/iscsictl/periphs.c Sun Apr 13 06:30:02 2014 (r264404) +++ head/usr.bin/iscsictl/periphs.c Sun Apr 13 09:31:22 2014 (r264405) @@ -102,6 +102,9 @@ print_periphs(int session_id) ccb.cdm.num_patterns = 0; ccb.cdm.pattern_buf_len = 0; + skip_bus = 1; + skip_device = 1; + /* * We do the ioctl multiple times if necessary, in case there are * more than 100 nodes in the EDT. @@ -120,9 +123,6 @@ print_periphs(int session_id) break; } - skip_bus = 1; - skip_device = 1; - for (i = 0; i < ccb.cdm.num_matches; i++) { switch (ccb.cdm.matches[i].type) { case DEV_MATCH_BUS: { From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 11:08:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C7C990C; Sun, 13 Apr 2014 11:08:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6991112B3; Sun, 13 Apr 2014 11:08:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DB8wOm093380; Sun, 13 Apr 2014 11:08:58 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DB8woe093379; Sun, 13 Apr 2014 11:08:58 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404131108.s3DB8woe093379@svn.freebsd.org> From: Alexander Motin Date: Sun, 13 Apr 2014 11:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264406 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 11:08:58 -0000 Author: mav Date: Sun Apr 13 11:08:57 2014 New Revision: 264406 URL: http://svnweb.freebsd.org/changeset/base/264406 Log: Report more readable state "-" for idle CAM scan thread. Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Sun Apr 13 09:31:22 2014 (r264405) +++ head/sys/cam/cam_xpt.c Sun Apr 13 11:08:57 2014 (r264406) @@ -768,7 +768,7 @@ xpt_scanner_thread(void *dummy) for (;;) { if (TAILQ_EMPTY(&xsoftc.ccb_scanq)) msleep(&xsoftc.ccb_scanq, &xsoftc.xpt_topo_lock, PRIBIO, - "ccb_scanq", 0); + "-", 0); if ((ccb = (union ccb *)TAILQ_FIRST(&xsoftc.ccb_scanq)) != NULL) { TAILQ_REMOVE(&xsoftc.ccb_scanq, &ccb->ccb_h, sim_links.tqe); xpt_unlock_buses(); From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 11:10:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 487DCA60; Sun, 13 Apr 2014 11:10:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35B4E12BB; Sun, 13 Apr 2014 11:10:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DBAb6C095372; Sun, 13 Apr 2014 11:10:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DBAbb2095371; Sun, 13 Apr 2014 11:10:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404131110.s3DBAbb2095371@svn.freebsd.org> From: Alexander Motin Date: Sun, 13 Apr 2014 11:10:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264407 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 11:10:37 -0000 Author: mav Date: Sun Apr 13 11:10:36 2014 New Revision: 264407 URL: http://svnweb.freebsd.org/changeset/base/264407 Log: Join CTL worker threads into one process for convenience. Report their idle state as "-". Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sun Apr 13 11:08:57 2014 (r264406) +++ head/sys/cam/ctl/ctl.c Sun Apr 13 11:10:36 2014 (r264407) @@ -1112,8 +1112,8 @@ ctl_init(void) } for (i = 0; i < worker_threads; i++) { - error = kproc_create(ctl_work_thread, softc, &softc->work_thread, 0, 0, - "ctl_thrd%d", i); + error = kproc_kthread_add(ctl_work_thread, softc, + &softc->work_thread, NULL, 0, 0, "ctl", "work%d", i); if (error != 0) { printf("error creating CTL work thread!\n"); mtx_lock(&softc->ctl_lock); @@ -13380,7 +13380,7 @@ ctl_work_thread(void *arg) /* XXX KDM use the PDROP flag?? */ /* Sleep until we have something to do. */ - mtx_sleep(softc, &softc->ctl_lock, PRIBIO, "ctl_work", 0); + mtx_sleep(softc, &softc->ctl_lock, PRIBIO, "-", 0); /* Back to the top of the loop to see what woke us up. */ continue; From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 11:29:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC5FDDC7; Sun, 13 Apr 2014 11:29:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B92EA1449; Sun, 13 Apr 2014 11:29:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DBTqSg001771; Sun, 13 Apr 2014 11:29:52 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DBTqBB001770; Sun, 13 Apr 2014 11:29:52 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201404131129.s3DBTqBB001770@svn.freebsd.org> From: Julio Merino Date: Sun, 13 Apr 2014 11:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264408 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 11:29:52 -0000 Author: jmmv Date: Sun Apr 13 11:29:52 2014 New Revision: 264408 URL: http://svnweb.freebsd.org/changeset/base/264408 Log: Fix test suite name in src.conf(5). There is no such thing as the "Kyua test suite"; it is the "FreeBSD Test Suite". While doing this, point readers to tests(7). Modified: head/tools/build/options/WITH_TESTS Modified: head/tools/build/options/WITH_TESTS ============================================================================== --- head/tools/build/options/WITH_TESTS Sun Apr 13 11:10:36 2014 (r264407) +++ head/tools/build/options/WITH_TESTS Sun Apr 13 11:29:52 2014 (r264408) @@ -1,2 +1,7 @@ .\" $FreeBSD$ -Set to install the Kyua test suite. +Set to install the +.Fx +Test Suite. +See +.Xr tests 7 +for more details. From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 11:31:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26FA1F19; Sun, 13 Apr 2014 11:31:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12B5114E4; Sun, 13 Apr 2014 11:31:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DBVfmL004984; Sun, 13 Apr 2014 11:31:41 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DBVfAU004983; Sun, 13 Apr 2014 11:31:41 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201404131131.s3DBVfAU004983@svn.freebsd.org> From: Julio Merino Date: Sun, 13 Apr 2014 11:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264409 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 11:31:42 -0000 Author: jmmv Date: Sun Apr 13 11:31:41 2014 New Revision: 264409 URL: http://svnweb.freebsd.org/changeset/base/264409 Log: Regen after rewording of WITH_TESTS. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Apr 13 11:29:52 2014 (r264408) +++ head/share/man/man5/src.conf.5 Sun Apr 13 11:31:41 2014 (r264409) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd March 5, 2014 +.Dd April 13, 2014 .Dt SRC.CONF 5 .Os .Sh NAME @@ -136,13 +136,13 @@ toolchain is enabled. .\" from FreeBSD: head/tools/build/options/WITHOUT_BLUETOOTH 156932 2006-03-21 07:50:50Z ru Set to not build Bluetooth related kernel modules, programs and libraries. .It Va WITHOUT_BMAKE -.\" from FreeBSD: head/tools/build/options/WITHOUT_BMAKE 250839 2013-05-21 00:41:49Z delphij +.\" from FreeBSD: head/tools/build/options/WITHOUT_BMAKE 263089 2014-03-12 11:53:35Z jmmv Set to not build and install the portable BSD make (bmake) as .Xr make 1 instead of the traditional FreeBSD make. This build option is temporary. -It allows developers to switch to bmake in order to work out any remaining -kinks or issues. +It allows developers to switch to the traditional FreeBSD make in order to +work out any remaining kinks or issues. This option will be removed in due time. .It Va WITHOUT_BOOT .\" from FreeBSD: head/tools/build/options/WITHOUT_BOOT 156932 2006-03-21 07:50:50Z ru @@ -214,7 +214,7 @@ When set, it also enforces the following Set to build the Clang C/C++ compiler. .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armv6, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. +amd64/amd64, arm/arm, arm/armv6, arm/armv6hf, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. .It Va WITH_CLANG_EXTRAS .\" from FreeBSD: head/tools/build/options/WITH_CLANG_EXTRAS 231057 2012-02-05 23:56:22Z dim Set to build additional clang and llvm tools, such as bugpoint. @@ -224,7 +224,7 @@ Set to avoid building the ARCMigrate, Re the Clang C/C++ compiler. .Pp It is a default setting on -arm/arm, arm/armeb, arm/armv6, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64. +arm/arm, arm/armeb, arm/armv6, arm/armv6hf, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64. .It Va WITH_CLANG_FULL .\" from FreeBSD: head/tools/build/options/WITH_CLANG_FULL 246259 2013-02-02 22:28:29Z dim Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the @@ -251,7 +251,7 @@ and .Pa /usr/bin/cpp . .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armv6, i386/i386 and pc98/i386. +amd64/amd64, arm/arm, arm/armv6, arm/armv6hf, i386/i386 and pc98/i386. .It Va WITHOUT_CPP .\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru Set to not build @@ -349,16 +349,6 @@ Set to avoid installing examples to .\" from FreeBSD: head/tools/build/options/WITHOUT_FDT 221539 2011-05-06 19:10:27Z ru Set to not build Flattened Device Tree support as part of the base system. This includes the device tree compiler (dtc) and libfdt support library. -.Pp -It is a default setting on -amd64/amd64, i386/i386, ia64/ia64, pc98/i386 and sparc64/sparc64. -.It Va WITH_FDT -.\" from FreeBSD: head/tools/build/options/WITH_FDT 221730 2011-05-10 11:14:40Z ru -Set to build Flattened Device Tree support as part of the base system. -This includes the device tree compiler (dtc) and libfdt support library. -.Pp -It is a default setting on -arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_FLOPPY .\" from FreeBSD: head/tools/build/options/WITHOUT_FLOPPY 221540 2011-05-06 19:13:03Z ru Set to not build or install programs @@ -393,7 +383,7 @@ Set to not build games. Set to not build and install gcc and g++. .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armv6 and i386/i386. +amd64/amd64, arm/arm, arm/armv6, arm/armv6hf and i386/i386. .It Va WITH_GCC .\" from FreeBSD: head/tools/build/options/WITH_GCC 255326 2013-09-06 20:49:48Z zeising Set to build and install gcc and g++. @@ -429,7 +419,7 @@ Do not build the GNU C++ stack (g++, lib This is the default on platforms where clang is the system compiler. .Pp It is a default setting on -amd64/amd64, arm/arm, arm/armv6, i386/i386 and pc98/i386. +amd64/amd64, arm/arm, arm/armv6, arm/armv6hf, i386/i386 and pc98/i386. .It Va WITH_GNUCXX .\" from FreeBSD: head/tools/build/options/WITH_GNUCXX 255321 2013-09-06 20:08:03Z theraven Build the GNU C++ stack (g++, libstdc++). @@ -652,6 +642,9 @@ and related programs. Set to build .Xr ls 1 without support for colors to distinguish file types. +.It Va WITHOUT_LZMA_SUPPORT +.\" from FreeBSD: head/tools/build/options/WITHOUT_LZMA_SUPPORT 245171 2013-01-08 18:37:12Z obrien +Set to build some programs without optional lzma compression support. .It Va WITHOUT_MAIL .\" from FreeBSD: head/tools/build/options/WITHOUT_MAIL 183242 2008-09-21 22:02:26Z sam Set to not build any mail support (MUA or MTA). @@ -905,6 +898,10 @@ The set includes .Xr cc 1 , .Xr make 1 and necessary utilities like assembler, linker and library archive manager. +.It Va WITH_SORT_THREADS +.\" from FreeBSD: head/tools/build/options/WITH_SORT_THREADS 264158 2014-04-05 18:00:45Z imp +Set to enable threads in +.Xr sort 1 . .It Va WITHOUT_SOURCELESS .\" from FreeBSD: head/tools/build/options/WITHOUT_SOURCELESS 230972 2012-02-04 00:54:43Z rmh Set to not build kernel modules that include sourceless code (either microcode or native code for host CPU). @@ -961,8 +958,13 @@ Set to not build .Xr telnet 8 and related programs. .It Va WITH_TESTS -.\" from FreeBSD: head/tools/build/options/WITH_TESTS 258014 2013-11-11 21:13:14Z gjb -Set to install the Kyua test suite. +.\" from FreeBSD: head/tools/build/options/WITH_TESTS 264408 2014-04-13 11:29:52Z jmmv +Set to install the +.Fx +Test Suite. +See +.Xr tests 7 +for more details. .It Va WITHOUT_TEXTPROC .\" from FreeBSD: head/tools/build/options/WITHOUT_TEXTPROC 183242 2008-09-21 22:02:26Z sam Set to not build From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 11:35:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09F19110; Sun, 13 Apr 2014 11:35:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF88414FB; Sun, 13 Apr 2014 11:35:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DBZg7e005486; Sun, 13 Apr 2014 11:35:42 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DBZgbn005482; Sun, 13 Apr 2014 11:35:42 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201404131135.s3DBZgbn005482@svn.freebsd.org> From: Julio Merino Date: Sun, 13 Apr 2014 11:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264410 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 11:35:43 -0000 Author: jmmv Date: Sun Apr 13 11:35:42 2014 New Revision: 264410 URL: http://svnweb.freebsd.org/changeset/base/264410 Log: Document how to install the test suite. As part of this, install the tests(7) manual page unconditionally (not only when WITH_TESTS=yes) so that users that have not yet enabled the build of the test suite can read details on how to do so. Modified: head/share/man/man7/Makefile head/share/man/man7/tests.7 Modified: head/share/man/man7/Makefile ============================================================================== --- head/share/man/man7/Makefile Sun Apr 13 11:31:41 2014 (r264409) +++ head/share/man/man7/Makefile Sun Apr 13 11:35:42 2014 (r264410) @@ -27,12 +27,9 @@ MAN= adding_user.7 \ sprog.7 \ stdint.7 \ sticky.7 \ + tests.7 \ tuning.7 -.if ${MK_TESTS} != "no" -MAN+= tests.7 -.endif - MLINKS= intro.7 miscellaneous.7 MLINKS+= security.7 securelevel.7 MLINKS+= c99.7 c.7 Modified: head/share/man/man7/tests.7 ============================================================================== --- head/share/man/man7/tests.7 Sun Apr 13 11:31:41 2014 (r264409) +++ head/share/man/man7/tests.7 Sun Apr 13 11:35:42 2014 (r264410) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd March 20, 2014 +.Dd April 13, 2014 .Dt TESTS 7 .Os .Sh NAME @@ -50,12 +50,31 @@ maintenance. .Pp The .Fx -test suite is installed in the +test suite can be found in the .Pa /usr/tests hierarchy. .Pp This manual page describes how to run the test suite and how to configure some of its optional features. +.Ss Installing the test suite +The test suite is not yet installed by default as part of +.Fx , +but this is bound to change during the development of +.Fx 11.0 . +.Pp +If the +.Pa /usr/tests +directory is missing, then you will have to enable the build of the test +suite, rebuild your system and install the results. +You can do so by setting +.Sq WITH_TESTS=yes +in your +.Pa /etc/src.conf +file (see +.Xr src.conf 5 +for details) +and rebuilding the system as described in +.Xr build 7 . .Ss When to run the tests? Before diving into the details of how to run the test suite, here are some scenarios in which you should run it: @@ -197,7 +216,8 @@ test suite. Top-level test suite definition file. .El .Sh SEE ALSO -.Xr kyua 1 . +.Xr kyua 1 , +.Xr build 7 .Sh HISTORY This test suite first appeared in .Fx 11.0 . From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 11:47:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA21C596; Sun, 13 Apr 2014 11:47:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A738315EF; Sun, 13 Apr 2014 11:47:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DBlI8j009961; Sun, 13 Apr 2014 11:47:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DBlIjw009959; Sun, 13 Apr 2014 11:47:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404131147.s3DBlIjw009959@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 13 Apr 2014 11:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264411 - head/usr.bin/find X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 11:47:18 -0000 Author: jilles Date: Sun Apr 13 11:47:17 2014 New Revision: 264411 URL: http://svnweb.freebsd.org/changeset/base/264411 Log: find: Return normal exit status from -quit. If there was an error, make the exit status reflect this even if -quit caused the exit. Formerly, -quit always caused exit(0). GNU find does the same. Modified: head/usr.bin/find/find.1 head/usr.bin/find/function.c Modified: head/usr.bin/find/find.1 ============================================================================== --- head/usr.bin/find/find.1 Sun Apr 13 11:35:42 2014 (r264410) +++ head/usr.bin/find/find.1 Sun Apr 13 11:47:17 2014 (r264411) @@ -31,7 +31,7 @@ .\" @(#)find.1 8.7 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd April 12, 2014 +.Dd April 13, 2014 .Dt FIND 1 .Os .Sh NAME @@ -778,7 +778,7 @@ option was specified. .It Ic -quit Causes .Nm -to immediately terminate successfully. +to terminate immediately. .It Ic -regex Ar pattern True if the whole path of the file matches .Ar pattern Modified: head/usr.bin/find/function.c ============================================================================== --- head/usr.bin/find/function.c Sun Apr 13 11:35:42 2014 (r264410) +++ head/usr.bin/find/function.c Sun Apr 13 11:47:17 2014 (r264411) @@ -1781,7 +1781,7 @@ int f_quit(PLAN *plan __unused, FTSENT *entry __unused) { finish_execplus(); - exit(0); + exit(exitstatus); } /* c_quit == c_simple */ From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 11:57:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8E8B902; Sun, 13 Apr 2014 11:57:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 959BE16B3; Sun, 13 Apr 2014 11:57:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DBvpuK014116; Sun, 13 Apr 2014 11:57:51 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DBvp6T014115; Sun, 13 Apr 2014 11:57:51 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201404131157.s3DBvp6T014115@svn.freebsd.org> From: Julio Merino Date: Sun, 13 Apr 2014 11:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264412 - head/gnu/usr.bin/groff/tmac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 11:57:51 -0000 Author: jmmv Date: Sun Apr 13 11:57:51 2014 New Revision: 264412 URL: http://svnweb.freebsd.org/changeset/base/264412 Log: Add FreeBSD 10.1 to the list of recognized releases for Fx. This version is already mentioned by 4 manual pages. Modified: head/gnu/usr.bin/groff/tmac/mdoc.local Modified: head/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- head/gnu/usr.bin/groff/tmac/mdoc.local Sun Apr 13 11:47:17 2014 (r264411) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Sun Apr 13 11:57:51 2014 (r264412) @@ -59,6 +59,7 @@ .ds doc-operating-system-FreeBSD-9.1 9.1 .ds doc-operating-system-FreeBSD-9.2 9.2 .ds doc-operating-system-FreeBSD-10.0 10.0 +.ds doc-operating-system-FreeBSD-10.1 10.1 .ds doc-operating-system-FreeBSD-11.0 11.0 .ds doc-operating-system-NetBSD-7.0 7.0 . From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 11:59:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D564FA6C; Sun, 13 Apr 2014 11:59:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8F5B16BF; Sun, 13 Apr 2014 11:59:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DBxg8r014347; Sun, 13 Apr 2014 11:59:42 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DBxgT1014346; Sun, 13 Apr 2014 11:59:42 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201404131159.s3DBxgT1014346@svn.freebsd.org> From: Julio Merino Date: Sun, 13 Apr 2014 11:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264413 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 11:59:42 -0000 Author: jmmv Date: Sun Apr 13 11:59:42 2014 New Revision: 264413 URL: http://svnweb.freebsd.org/changeset/base/264413 Log: Miscellaneous fixes to tests(7). - Properly capitalize "FreeBSD Test Suite". - At this point, the test suite first appeared in 10.1, not in 11.0. - Use my FreeBSD.org address. Modified: head/share/man/man7/tests.7 Modified: head/share/man/man7/tests.7 ============================================================================== --- head/share/man/man7/tests.7 Sun Apr 13 11:57:51 2014 (r264412) +++ head/share/man/man7/tests.7 Sun Apr 13 11:59:42 2014 (r264413) @@ -31,11 +31,11 @@ .Os .Sh NAME .Nm tests -.Nd introduction to the FreeBSD test suite +.Nd introduction to the FreeBSD Test Suite .Sh DESCRIPTION The .Fx -test suite provides a collection of automated tests for two major purposes. +Test Suite provides a collection of automated tests for two major purposes. On one hand, the test suite aids .Em developers to detect bugs and regressions when they modify the source tree. On the other @@ -50,7 +50,7 @@ maintenance. .Pp The .Fx -test suite can be found in the +Test Suite can be found in the .Pa /usr/tests hierarchy. .Pp @@ -148,7 +148,7 @@ to its manual page .Ss Configuring the tests Some test cases in the .Fx -test suite require manual configuration by the administrator before they can be +Test Suite require manual configuration by the administrator before they can be run. Unless certain properties are defined, the tests that require them will be skipped. .Pp @@ -160,7 +160,7 @@ The format of this file is detailed in .Pp The following configuration variables are available in the .Fx -test suite: +Test Suite: .Bl -tag -width "allow_sysctl_side_effects" .It allow_devfs_side_effects If defined, enables tests that may destroy and recreate semipermanent device @@ -211,7 +211,7 @@ Default result database used by Kyua. .It Pa /usr/tests/ Location of the .Fx -test suite. +Test Suite. .It Pa /usr/tests/Kyuafile Top-level test suite definition file. .El @@ -219,14 +219,16 @@ Top-level test suite definition file. .Xr kyua 1 , .Xr build 7 .Sh HISTORY -This test suite first appeared in -.Fx 11.0 . +The +.Fx +Test Suite first appeared in +.Fx 10.1 . .Pp The .Nm manual page first appeared in .Nx 6.0 and was later ported to -.Fx 11.0 . +.Fx 10.1 . .Sh AUTHORS -.An Julio Merino Aq Mt jmmv@google.com +.An Julio Merino Aq Mt jmmv@FreeBSD.org From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 14:50:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27A79EE8; Sun, 13 Apr 2014 14:50:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 134BE15C4; Sun, 13 Apr 2014 14:50:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DEoqW5087504; Sun, 13 Apr 2014 14:50:52 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DEoq5O087499; Sun, 13 Apr 2014 14:50:52 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201404131450.s3DEoq5O087499@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 13 Apr 2014 14:50:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264414 - in head/sys/boot: amd64/boot1.efi common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 14:50:53 -0000 Author: nwhitehorn Date: Sun Apr 13 14:50:52 2014 New Revision: 264414 URL: http://svnweb.freebsd.org/changeset/base/264414 Log: Apparently some of the i386 boot blocks are so close to full that adding single lines to ufsread.c spills them over. Duplicate a whole bunch of code to get file sizes into boot1.efi/boot1.c rather than modifying ufsread.c. Modified: head/sys/boot/amd64/boot1.efi/Makefile head/sys/boot/amd64/boot1.efi/boot1.c head/sys/boot/common/ufsread.c Modified: head/sys/boot/amd64/boot1.efi/Makefile ============================================================================== --- head/sys/boot/amd64/boot1.efi/Makefile Sun Apr 13 11:59:42 2014 (r264413) +++ head/sys/boot/amd64/boot1.efi/Makefile Sun Apr 13 14:50:52 2014 (r264414) @@ -55,6 +55,8 @@ boot1.efi: loader.sym CFLAGS+= -I${.CURDIR}/../../common +boot1.o: ${.CURDIR}/../../common/ufsread.c + .endif # ${COMPILER_TYPE} != "gcc" .include Modified: head/sys/boot/amd64/boot1.efi/boot1.c ============================================================================== --- head/sys/boot/amd64/boot1.efi/boot1.c Sun Apr 13 11:59:42 2014 (r264413) +++ head/sys/boot/amd64/boot1.efi/boot1.c Sun Apr 13 14:50:52 2014 (r264414) @@ -169,6 +169,88 @@ dskread(void *buf, u_int64_t lba, int nb #include "ufsread.c" +static ssize_t +fsstat(ufs_ino_t inode) +{ +#ifndef UFS2_ONLY + static struct ufs1_dinode dp1; + ufs1_daddr_t addr1; +#endif +#ifndef UFS1_ONLY + static struct ufs2_dinode dp2; +#endif + static struct fs fs; + static ufs_ino_t inomap; + char *blkbuf; + void *indbuf; + size_t n, nb, size, off, vboff; + ufs_lbn_t lbn; + ufs2_daddr_t addr2, vbaddr; + static ufs2_daddr_t blkmap, indmap; + u_int u; + + blkbuf = dmadat->blkbuf; + indbuf = dmadat->indbuf; + if (!dsk_meta) { + inomap = 0; + for (n = 0; sblock_try[n] != -1; n++) { + if (dskread(dmadat->sbbuf, sblock_try[n] / DEV_BSIZE, + SBLOCKSIZE / DEV_BSIZE)) + return -1; + memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); + if (( +#if defined(UFS1_ONLY) + fs.fs_magic == FS_UFS1_MAGIC +#elif defined(UFS2_ONLY) + (fs.fs_magic == FS_UFS2_MAGIC && + fs.fs_sblockloc == sblock_try[n]) +#else + fs.fs_magic == FS_UFS1_MAGIC || + (fs.fs_magic == FS_UFS2_MAGIC && + fs.fs_sblockloc == sblock_try[n]) +#endif + ) && + fs.fs_bsize <= MAXBSIZE && + fs.fs_bsize >= sizeof(struct fs)) + break; + } + if (sblock_try[n] == -1) { + printf("Not ufs\n"); + return -1; + } + dsk_meta++; + } else + memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); + if (!inode) + return 0; + if (inomap != inode) { + n = IPERVBLK(&fs); + if (dskread(blkbuf, INO_TO_VBA(&fs, n, inode), DBPERVBLK)) + return -1; + n = INO_TO_VBO(n, inode); +#if defined(UFS1_ONLY) + memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + sizeof(struct ufs1_dinode)); +#elif defined(UFS2_ONLY) + memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + sizeof(struct ufs2_dinode)); +#else + if (fs.fs_magic == FS_UFS1_MAGIC) + memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + sizeof(struct ufs1_dinode)); + else + memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + sizeof(struct ufs2_dinode)); +#endif + inomap = inode; + fs_off = 0; + blkmap = indmap = 0; + } + size = DIP(di_size); + n = size - fs_off; + return (n); +} + static struct dmadat __dmadat; static int @@ -203,7 +285,7 @@ load(const char *fname) return; } - bufsize = fsread(ino, NULL, -1); + bufsize = fsstat(ino); status = systab->BootServices->AllocatePool(EfiLoaderData, bufsize, &buffer); fsread(ino, buffer, bufsize); Modified: head/sys/boot/common/ufsread.c ============================================================================== --- head/sys/boot/common/ufsread.c Sun Apr 13 11:59:42 2014 (r264413) +++ head/sys/boot/common/ufsread.c Sun Apr 13 14:50:52 2014 (r264414) @@ -245,8 +245,6 @@ fsread(ufs_ino_t inode, void *buf, size_ s = buf; size = DIP(di_size); n = size - fs_off; - if (buf == NULL && nbyte == -1) - return n; if (nbyte > n) nbyte = n; nb = nbyte; From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 18:21:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63F183D8; Sun, 13 Apr 2014 18:21:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 512DA17AD; Sun, 13 Apr 2014 18:21:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DILscZ074195; Sun, 13 Apr 2014 18:21:54 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DILsN3074194; Sun, 13 Apr 2014 18:21:54 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404131821.s3DILsN3074194@svn.freebsd.org> From: Christian Brueffer Date: Sun, 13 Apr 2014 18:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264415 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 18:21:54 -0000 Author: brueffer Date: Sun Apr 13 18:21:53 2014 New Revision: 264415 URL: http://svnweb.freebsd.org/changeset/base/264415 Log: Bump Dd for r264384. Requested by: gjb Modified: head/share/man/man4/timecounters.4 Modified: head/share/man/man4/timecounters.4 ============================================================================== --- head/share/man/man4/timecounters.4 Sun Apr 13 14:50:52 2014 (r264414) +++ head/share/man/man4/timecounters.4 Sun Apr 13 18:21:53 2014 (r264415) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 20, 2011 +.Dd April 12, 2014 .Dt TIMECOUNTERS 4 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 18:51:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B9C0C3F; Sun, 13 Apr 2014 18:51:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 589D419AA; Sun, 13 Apr 2014 18:51:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DIpepP084218; Sun, 13 Apr 2014 18:51:40 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DIpeCr084217; Sun, 13 Apr 2014 18:51:40 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404131851.s3DIpeCr084217@svn.freebsd.org> From: Christian Brueffer Date: Sun, 13 Apr 2014 18:51:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264416 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 18:51:40 -0000 Author: brueffer Date: Sun Apr 13 18:51:39 2014 New Revision: 264416 URL: http://svnweb.freebsd.org/changeset/base/264416 Log: Add a missing comma between error message definitions. CID: 1199266 Found with: Coverity Prevent(tm) MFC after: 1 week Modified: head/sys/dev/iwn/if_iwnreg.h Modified: head/sys/dev/iwn/if_iwnreg.h ============================================================================== --- head/sys/dev/iwn/if_iwnreg.h Sun Apr 13 18:21:53 2014 (r264415) +++ head/sys/dev/iwn/if_iwnreg.h Sun Apr 13 18:51:39 2014 (r264416) @@ -2195,7 +2195,7 @@ static const char * const iwn_fw_errmsg[ "NMI_INTERRUPT_DATA_ACTION_PT", "NMI_TRM_HW_ER", "NMI_INTERRUPT_TRM", - "NMI_INTERRUPT_BREAKPOINT" + "NMI_INTERRUPT_BREAKPOINT", "DEBUG_0", "DEBUG_1", "DEBUG_2", From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 19:32:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43EA9468; Sun, 13 Apr 2014 19:32:48 +0000 (UTC) Received: from mail-ve0-x22e.google.com (mail-ve0-x22e.google.com [IPv6:2607:f8b0:400c:c01::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C18EC1D7C; Sun, 13 Apr 2014 19:32:47 +0000 (UTC) Received: by mail-ve0-f174.google.com with SMTP id oz11so6468709veb.19 for ; Sun, 13 Apr 2014 12:32:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=HK6P4jhmgcFOaIHdRO85rpTp4wqlFUBJe286IqhWmAQ=; b=O2sQ8a6O5LFM6IjSaqo+88lOk5yWMyiuduobRU3RkfZlfqaLeEzqneGjwuk4qnyXqv 5iN9Pf8z6Hw9WFgkKHZ1FDX7TscCzqHU1Ai8GsiPMgMT1PmkNVqAPetFqdlZC4EsnGnO QCaLkyU3WKe8OYQzosTi1HaVBfSJs9iiUvXSMtCOANYRnpfdtx4X/vwIcw2Vk6AuSmjn 9mSQvRFHS2GoJIbHWacrAwtORp8D7SZKib3GmlcUMZeCubGD9/n2aYbiXRHsIO0LY1ZT L41CPtbyB9JCWaJCpGRHWbTeN/1e225Oz9lqEtWCqwNFPntuaRZiUKQIvEj1G6xyILSk r3sA== MIME-Version: 1.0 X-Received: by 10.220.170.202 with SMTP id e10mr32412660vcz.20.1397417566845; Sun, 13 Apr 2014 12:32:46 -0700 (PDT) Sender: markjdb@gmail.com Received: by 10.220.162.68 with HTTP; Sun, 13 Apr 2014 12:32:46 -0700 (PDT) In-Reply-To: <201404130522.s3D5MRXc053006@svn.freebsd.org> References: <201404130522.s3D5MRXc053006@svn.freebsd.org> Date: Sun, 13 Apr 2014 15:32:46 -0400 X-Google-Sender-Auth: F4SGPgku0CGGyTEg3u3e_URpwUU Message-ID: Subject: Re: svn commit: r264402 - in head/share: examples/etc man/man5 mk From: Mark Johnston To: Warner Losh Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 19:32:48 -0000 On Sun, Apr 13, 2014 at 1:22 AM, Warner Losh wrote: > Author: imp > Date: Sun Apr 13 05:22:26 2014 > New Revision: 264402 > URL: http://svnweb.freebsd.org/changeset/base/264402 > > Log: > Convert NO_MANCOMPRESS to normal convention. This breaks installworld for me with ... install -o root -g wheel -m 444 zh_CN.GB2312.cat /usr/share/nls/zh_CN.GB2312/libc.cat install -o root -g wheel -m 444 zh_CN.UTF-8.cat /usr/share/nls/zh_CN.UTF-8/libc.cat install -o root -g wheel -m 444 btree.3.gz /usr/share/man/man3 install: btree.3.gz: No such file or directory *** Error code 71 ... > > Modified: > head/share/examples/etc/make.conf > head/share/man/man5/make.conf.5 > head/share/mk/bsd.man.mk > head/share/mk/bsd.own.mk > > [snip] > > Modified: head/share/mk/bsd.man.mk > ============================================================================== > --- head/share/mk/bsd.man.mk Sun Apr 13 05:22:22 2014 (r264401) > +++ head/share/mk/bsd.man.mk Sun Apr 13 05:22:26 2014 (r264402) > @@ -30,9 +30,6 @@ > # second, and there may be multiple pairs. The files > # are hard-linked. > # > -# NO_MANCOMPRESS If you do not want unformatted manual pages to be > -# compressed when they are installed. [not set] > -# > # NO_MLINKS If you do not want install manual page links. [not set] > # > # MANFILTER command to pipe the raw man page through before compressing > @@ -77,10 +74,10 @@ MAN+= ${MAN${__sect}} > _manpages: > all-man: _manpages > > -.if defined(NO_MANCOMPRESS) > +.if ${MK_MANCOMPRESS} != "no" > > # Make special arrangements to filter to a temporary file at build time > -# for NO_MANCOMPRESS. > +# for MK_MANCOMPRESS == no. > .if defined(MANFILTER) > FILTEXTENSION= .filt > .else > @@ -162,7 +159,7 @@ maninstall: _maninstall > _maninstall: > .if defined(MAN) && !empty(MAN) > _maninstall: ${MAN} > -.if defined(NO_MANCOMPRESS) > +.if ${MK_MANCOMPRESS} == "no" Changing this line to ".if ${MK_MANCOMPRESS} != "no" seems to fix the problem. > .if defined(MANFILTER) > [snip] From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 19:48:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 624826DA; Sun, 13 Apr 2014 19:48:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F8531E7A; Sun, 13 Apr 2014 19:48:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DJmT2p007794; Sun, 13 Apr 2014 19:48:29 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DJmTbW007793; Sun, 13 Apr 2014 19:48:29 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404131948.s3DJmTbW007793@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 13 Apr 2014 19:48:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264417 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 19:48:29 -0000 Author: jilles Date: Sun Apr 13 19:48:28 2014 New Revision: 264417 URL: http://svnweb.freebsd.org/changeset/base/264417 Log: realpath(): Properly fail "." or ".." components after non-directories. If realpath() is called on pathnames like "/dev/null/." or "/dev/null/..", it should fail with [ENOTDIR]. Pathnames like "/dev/null/" already failed as they should. Also, put the check for non-directories after lstatting the previous component instead of when the empty component (consecutive or trailing slashes) is detected, saving an lstat() call and some lines of code. PR: kern/82980 MFC after: 2 weeks Modified: head/lib/libc/stdlib/realpath.c Modified: head/lib/libc/stdlib/realpath.c ============================================================================== --- head/lib/libc/stdlib/realpath.c Sun Apr 13 18:51:39 2014 (r264416) +++ head/lib/libc/stdlib/realpath.c Sun Apr 13 19:48:28 2014 (r264417) @@ -132,26 +132,7 @@ realpath(const char * __restrict path, c resolved[resolved_len] = '\0'; } if (next_token[0] == '\0') { - /* - * Handle consequential slashes. The path - * before slash shall point to a directory. - * - * Only the trailing slashes are not covered - * by other checks in the loop, but we verify - * the prefix for any (rare) "//" or "/\0" - * occurrence to not implement lookahead. - */ - if (lstat(resolved, &sb) != 0) { - if (m) - free(resolved); - return (NULL); - } - if (!S_ISDIR(sb.st_mode)) { - if (m) - free(resolved); - errno = ENOTDIR; - return (NULL); - } + /* Handle consequential slashes. */ continue; } else if (strcmp(next_token, ".") == 0) @@ -236,6 +217,11 @@ realpath(const char * __restrict path, c } } left_len = strlcpy(left, symlink, sizeof(left)); + } else if (!S_ISDIR(sb.st_mode) && p != NULL) { + if (m) + free(resolved); + errno = ENOTDIR; + return (NULL); } } From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 19:48:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 936C381C; Sun, 13 Apr 2014 19:48:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8085E1E7C; Sun, 13 Apr 2014 19:48:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DJmpUv007861; Sun, 13 Apr 2014 19:48:51 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DJmpuN007860; Sun, 13 Apr 2014 19:48:51 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404131948.s3DJmpuN007860@svn.freebsd.org> From: Christian Brueffer Date: Sun, 13 Apr 2014 19:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264418 - head/usr.bin/find X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 19:48:51 -0000 Author: brueffer Date: Sun Apr 13 19:48:51 2014 New Revision: 264418 URL: http://svnweb.freebsd.org/changeset/base/264418 Log: Avoid double free in f_acl(). CID: 1018508 Found with: Coverity Prevent(tm) MFC after: 1 week Modified: head/usr.bin/find/function.c Modified: head/usr.bin/find/function.c ============================================================================== --- head/usr.bin/find/function.c Sun Apr 13 19:48:28 2014 (r264417) +++ head/usr.bin/find/function.c Sun Apr 13 19:48:51 2014 (r264418) @@ -404,7 +404,6 @@ f_acl(PLAN *plan __unused, FTSENT *entry acl_free(facl); if (ret) { warn("%s", entry->fts_accpath); - acl_free(facl); return (0); } if (trivial) From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 20:12:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C937FBA8; Sun, 13 Apr 2014 20:12:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5AB711CA; Sun, 13 Apr 2014 20:12:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DKCLTb019510; Sun, 13 Apr 2014 20:12:21 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DKCLmf019509; Sun, 13 Apr 2014 20:12:21 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404132012.s3DKCLmf019509@svn.freebsd.org> From: Christian Brueffer Date: Sun, 13 Apr 2014 20:12:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264419 - head/usr.bin/ldd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 20:12:21 -0000 Author: brueffer Date: Sun Apr 13 20:12:21 2014 New Revision: 264419 URL: http://svnweb.freebsd.org/changeset/base/264419 Log: Avoid double close() of a file descriptor. CID: 1006089 Found with: Coverity Prevent(tm) MFC after: 1 week Modified: head/usr.bin/ldd/sods.c Modified: head/usr.bin/ldd/sods.c ============================================================================== --- head/usr.bin/ldd/sods.c Sun Apr 13 19:48:51 2014 (r264418) +++ head/usr.bin/ldd/sods.c Sun Apr 13 20:12:21 2014 (r264419) @@ -204,7 +204,6 @@ dump_file(const char *fname) warnx("%s: this is an ELF program; use objdump to examine", fname); ++error_count; munmap(objbase, sb.st_size); - close(fd); return; } From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 20:21:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9323E78; Sun, 13 Apr 2014 20:21:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D658B1278; Sun, 13 Apr 2014 20:21:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DKLuMU023132; Sun, 13 Apr 2014 20:21:56 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DKLu5n023131; Sun, 13 Apr 2014 20:21:56 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201404132021.s3DKLu5n023131@svn.freebsd.org> From: Bryan Drewery Date: Sun, 13 Apr 2014 20:21:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264420 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 20:21:57 -0000 Author: bdrewery Date: Sun Apr 13 20:21:56 2014 New Revision: 264420 URL: http://svnweb.freebsd.org/changeset/base/264420 Log: Always install pkg.conf. Don't depend on MK_PKGBOOTSTRAP. This file is used by pkg(8) from ports as well. Someone may choose to not install pkg(7) but still want to consume official packages by building or installing pkg(8) manually. Discussed with: bapt MFC after: 1 day (Working on EN) Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sun Apr 13 20:12:21 2014 (r264419) +++ head/etc/Makefile Sun Apr 13 20:21:56 2014 (r264420) @@ -231,9 +231,7 @@ distribution: .endif ${_+_}cd ${.CURDIR}/gss; ${MAKE} install ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install -.if ${MK_PKGBOOTSTRAP} != "no" ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install -.endif ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install ${_+_}cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 20:57:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EBE535B4 for ; Sun, 13 Apr 2014 20:57:20 +0000 (UTC) Received: from mail-pb0-f49.google.com (mail-pb0-f49.google.com [209.85.160.49]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC83914FC for ; Sun, 13 Apr 2014 20:57:20 +0000 (UTC) Received: by mail-pb0-f49.google.com with SMTP id jt11so7442325pbb.36 for ; Sun, 13 Apr 2014 13:57:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=M0Y0krIPQdUBxHek6pIUMetOA50KPGKS2tPGJjFb97k=; b=VQMEMV13166GOKW2BjuxoAsALkxh4hOCcfgshFfICDHeGbAoiMkojGy9SKANVuwfrp UmgiSUskbbmI3olEL3vnLIheqcYnoOy9G7Z12vkOPZR+a6UUw+PQsxoCzEf7DtftVvFl 4hro2GsJmgugl5mU5hwIC9Z4gca8wsyGpx2VSO3pm4kZIzoZ5wev8y0kyI7Vxu6Lep+k 8TLBIuQIXdfK1s2h8bt9pqwLaDz3pMdUTkYx+6kcKHeaH2xkvUaGRS8mQCh0GMYf6SyT og1cksiNiuPPfgdeukc0KW+7/tUxsKOSRF408HVDDQ+0gcrYbzo0grW9KZakbrbsR7S1 tIFA== X-Gm-Message-State: ALoCoQkenRQ/F1nqAlJXn5nOxBFEUZf9hXQM7GoxL0Xfttuen1bfioZIKjGDdu+ErgFdX4lFeDE/ X-Received: by 10.66.230.193 with SMTP id ta1mr18596489pac.29.1397422634531; Sun, 13 Apr 2014 13:57:14 -0700 (PDT) Received: from macintosh-c42c033c0b73.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id it4sm29488185pbc.39.2014.04.13.13.57.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 13 Apr 2014 13:57:13 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264402 - in head/share: examples/etc man/man5 mk From: Warner Losh In-Reply-To: Date: Sun, 13 Apr 2014 14:57:11 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <9FB7142E-A0A0-41AF-BEFC-9306AE701B3F@bsdimp.com> References: <201404130522.s3D5MRXc053006@svn.freebsd.org> To: Mark Johnston X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 20:57:21 -0000 Are you sure it is this exact commit? Do you have anything in your /etc/make.conf or /etc/src.conf file? Can you send me your full install world output? I=92ll see if I can reproduce it myself. Warner On Apr 13, 2014, at 1:32 PM, Mark Johnston wrote: > On Sun, Apr 13, 2014 at 1:22 AM, Warner Losh wrote: >> Author: imp >> Date: Sun Apr 13 05:22:26 2014 >> New Revision: 264402 >> URL: http://svnweb.freebsd.org/changeset/base/264402 >>=20 >> Log: >> Convert NO_MANCOMPRESS to normal convention. >=20 > This breaks installworld for me with >=20 > ... > install -o root -g wheel -m 444 zh_CN.GB2312.cat > /usr/share/nls/zh_CN.GB2312/libc.cat > install -o root -g wheel -m 444 zh_CN.UTF-8.cat > /usr/share/nls/zh_CN.UTF-8/libc.cat > install -o root -g wheel -m 444 btree.3.gz /usr/share/man/man3 > install: btree.3.gz: No such file or directory > *** Error code 71 > ... >=20 >>=20 >> Modified: >> head/share/examples/etc/make.conf >> head/share/man/man5/make.conf.5 >> head/share/mk/bsd.man.mk >> head/share/mk/bsd.own.mk >>=20 >> [snip] >>=20 >> Modified: head/share/mk/bsd.man.mk >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/share/mk/bsd.man.mk Sun Apr 13 05:22:22 2014 = (r264401) >> +++ head/share/mk/bsd.man.mk Sun Apr 13 05:22:26 2014 = (r264402) >> @@ -30,9 +30,6 @@ >> # second, and there may be multiple pairs. The files >> # are hard-linked. >> # >> -# NO_MANCOMPRESS If you do not want unformatted manual pages = to be >> -# compressed when they are installed. [not set] >> -# >> # NO_MLINKS If you do not want install manual page links. [not = set] >> # >> # MANFILTER command to pipe the raw man page through before = compressing >> @@ -77,10 +74,10 @@ MAN+=3D ${MAN${__sect}} >> _manpages: >> all-man: _manpages >>=20 >> -.if defined(NO_MANCOMPRESS) >> +.if ${MK_MANCOMPRESS} !=3D "no" >>=20 >> # Make special arrangements to filter to a temporary file at build = time >> -# for NO_MANCOMPRESS. >> +# for MK_MANCOMPRESS =3D=3D no. >> .if defined(MANFILTER) >> FILTEXTENSION=3D .filt >> .else >> @@ -162,7 +159,7 @@ maninstall: _maninstall >> _maninstall: >> .if defined(MAN) && !empty(MAN) >> _maninstall: ${MAN} >> -.if defined(NO_MANCOMPRESS) >> +.if ${MK_MANCOMPRESS} =3D=3D "no" >=20 > Changing this line to ".if ${MK_MANCOMPRESS} !=3D "no" seems to fix = the problem. >=20 >> .if defined(MANFILTER) >> [snip] From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 21:13:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A8C28D6; Sun, 13 Apr 2014 21:13:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB107166E; Sun, 13 Apr 2014 21:13:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DLDXj0044237; Sun, 13 Apr 2014 21:13:33 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DLDXRI044236; Sun, 13 Apr 2014 21:13:33 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404132113.s3DLDXRI044236@svn.freebsd.org> From: Christian Brueffer Date: Sun, 13 Apr 2014 21:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264421 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 21:13:34 -0000 Author: brueffer Date: Sun Apr 13 21:13:33 2014 New Revision: 264421 URL: http://svnweb.freebsd.org/changeset/base/264421 Log: Free resources and error cases; re-indent a curly brace while here. CID: 1199366 Found with: Coverity Prevent(tm) MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Sun Apr 13 20:21:56 2014 (r264420) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Sun Apr 13 21:13:33 2014 (r264421) @@ -1039,8 +1039,10 @@ ipfw_ctl(struct sockopt *sopt) if (sopt->sopt_valsize == RULESIZE7(rule)) { is7 = 1; error = convert_rule_to_8(rule); - if (error) + if (error) { + free(rule, M_TEMP); return error; + } if (error == 0) error = check_ipfw_struct(rule, RULESIZE(rule)); } else { @@ -1056,11 +1058,13 @@ ipfw_ctl(struct sockopt *sopt) if (is7) { error = convert_rule_to_7(rule); size = RULESIZE7(rule); - if (error) + if (error) { + free(rule, M_TEMP); return error; + } } error = sooptcopyout(sopt, rule, size); - } + } } free(rule, M_TEMP); break; From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 21:23:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89DA4C7A; Sun, 13 Apr 2014 21:23:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 761821731; Sun, 13 Apr 2014 21:23:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DLNGtL048360; Sun, 13 Apr 2014 21:23:16 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DLNGvJ048359; Sun, 13 Apr 2014 21:23:16 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404132123.s3DLNGvJ048359@svn.freebsd.org> From: Christian Brueffer Date: Sun, 13 Apr 2014 21:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264422 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 21:23:16 -0000 Author: brueffer Date: Sun Apr 13 21:23:15 2014 New Revision: 264422 URL: http://svnweb.freebsd.org/changeset/base/264422 Log: Free buf after usage. CID: 1199377 Found with: Coverity Prevent(tm) MFC after: 1 week Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sun Apr 13 21:13:33 2014 (r264421) +++ head/sys/kern/imgact_elf.c Sun Apr 13 21:23:15 2014 (r264422) @@ -1746,8 +1746,10 @@ __elfN(note_threadmd)(void *arg, struct size = 0; __elfN(dump_thread)(td, buf, &size); KASSERT(*sizep == size, ("invalid size")); - if (size != 0 && sb != NULL) + if (size != 0 && sb != NULL) { sbuf_bcat(sb, buf, size); + free(buf, M_TEMP); + } *sizep = size; } From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 21:46:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9F70B1; Sun, 13 Apr 2014 21:46:39 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31B1618DE; Sun, 13 Apr 2014 21:46:39 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.8/8.14.8) with ESMTP id s3DLkXHJ088063; Mon, 14 Apr 2014 00:46:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s3DLkXHJ088063 Received: (from kostik@localhost) by tom.home (8.14.8/8.14.8/Submit) id s3DLkX4v088062; Mon, 14 Apr 2014 00:46:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 14 Apr 2014 00:46:33 +0300 From: Konstantin Belousov To: Christian Brueffer Subject: Re: svn commit: r264422 - head/sys/kern Message-ID: <20140413214633.GF4016@kib.kiev.ua> References: <201404132123.s3DLNGvJ048359@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0/kgSOzhNoDC5T3a" Content-Disposition: inline In-Reply-To: <201404132123.s3DLNGvJ048359@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 21:46:39 -0000 --0/kgSOzhNoDC5T3a Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 13, 2014 at 09:23:16PM +0000, Christian Brueffer wrote: > Author: brueffer > Date: Sun Apr 13 21:23:15 2014 > New Revision: 264422 > URL: http://svnweb.freebsd.org/changeset/base/264422 >=20 > Log: > Free buf after usage. > =20 > CID: 1199377 > Found with: Coverity Prevent(tm) > MFC after: 1 week >=20 > Modified: > head/sys/kern/imgact_elf.c >=20 > Modified: head/sys/kern/imgact_elf.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/imgact_elf.c Sun Apr 13 21:13:33 2014 (r264421) > +++ head/sys/kern/imgact_elf.c Sun Apr 13 21:23:15 2014 (r264422) > @@ -1746,8 +1746,10 @@ __elfN(note_threadmd)(void *arg, struct=20 > size =3D 0; > __elfN(dump_thread)(td, buf, &size); > KASSERT(*sizep =3D=3D size, ("invalid size")); > - if (size !=3D 0 && sb !=3D NULL) > + if (size !=3D 0 && sb !=3D NULL) { > sbuf_bcat(sb, buf, size); > + free(buf, M_TEMP); > + } > *sizep =3D size; > } > =20 Why conditioning free() on size !=3D 0 ? IMO free(buf) must be done always, since buf is initialized for the case when malloc() is not called. --0/kgSOzhNoDC5T3a Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJTSwW5AAoJEJDCuSvBvK1BNy4P/RAs067+LZWgR0hysHK+PFWd AK8yX48NLHYt9iWbJH5QKVyN68VuFHjy4F+yWa0aiJwHH1mJ3OMjQnJurxsz7t+Z HNjcf5yk1E0+So1WZDOcYfCyIPGSa6Ns/B/YaQolYa53zabWuXvnqmK4iDhJjanV 3O/A7zix1dE3NHdedchN61Hf/ptrzw3wPmYpz9ozHvS+20uQh2SODR8wmKq5Y3iZ NZR/DY08Zc3pGYI3IdKTJaRs9fKGkQi7nUeoIj/g/cdPcblygbqkTauMRYiaxOVY 8dzj8cH3U73TVxcWez0PHW2yTofyiN2diKPuV+rw1JRrSknAdkdCDP9qFrrqm0v9 hK++4+dW5cjVnJRa2ZNig4xT1KKzNP4pN7R3F2tCGpDwqcnPGJizkf1fO5KSrxuw 38AHPgkfQbLpj/HXCCT6HDPfGF4w0z65sL8NliXoFYqzc+4qSgSp2AcDzX/gWuU+ RiKXjw6nji8Eqv3p3ZtM5qPE4i9jr9quz2St6xwmlg6cAsJc+UOerzYSueqSOwli NyxekdnHZz1a9+T2x3FdWFZU0AApVzEeHA+XR5fMt+stt5AnT78moG69hRodj7t1 4iabz/AYsaG2JpUle+M8SYlpgpIK/wKRsc9rNC70jnEwErwOfP9u4HFX/17i0jTs stf5+MaT6IO7F5Us4GJ3 =WbpZ -----END PGP SIGNATURE----- --0/kgSOzhNoDC5T3a-- From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 21:52:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C0BA489; Sun, 13 Apr 2014 21:52:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 168C819A4; Sun, 13 Apr 2014 21:52:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DLqSik060551; Sun, 13 Apr 2014 21:52:28 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DLqS02060544; Sun, 13 Apr 2014 21:52:28 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404132152.s3DLqS02060544@svn.freebsd.org> From: Warner Losh Date: Sun, 13 Apr 2014 21:52:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264424 - in head/share: examples/etc man/man5 mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 21:52:29 -0000 Author: imp Date: Sun Apr 13 21:52:27 2014 New Revision: 264424 URL: http://svnweb.freebsd.org/changeset/base/264424 Log: r264402 builds fine, but turns out there are problems with install. Back it out until they can be tracked down. Modified: head/share/examples/etc/make.conf head/share/man/man5/make.conf.5 head/share/mk/bsd.man.mk head/share/mk/bsd.own.mk Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Sun Apr 13 21:49:44 2014 (r264423) +++ head/share/examples/etc/make.conf Sun Apr 13 21:52:27 2014 (r264424) @@ -138,7 +138,7 @@ # If you do not want unformatted manual pages to be compressed # when they are installed: # -#WITHOUT_MANCOMPRESS=t +#NO_MANCOMPRESS= # # # Default format for system documentation, depends on your printer. Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Sun Apr 13 21:49:44 2014 (r264423) +++ head/share/man/man5/make.conf.5 Sun Apr 13 21:52:27 2014 (r264424) @@ -434,11 +434,8 @@ Set this to run .Dq Li "${MAKE} clean" instead of .Dq Li "${MAKE} cleandir" . -.It Va WITH_MANCOMPRESS -.Pq Vt defined -Set to install manual pages compressed. -.It Va WITHOUT_MANCOMPRESS -.Pq Vt defined +.It Va NO_MANCOMPRESS +.Pq Vt bool Set to install manual pages uncompressed. .It Va NO_SHARE .Pq Vt bool Modified: head/share/mk/bsd.man.mk ============================================================================== --- head/share/mk/bsd.man.mk Sun Apr 13 21:49:44 2014 (r264423) +++ head/share/mk/bsd.man.mk Sun Apr 13 21:52:27 2014 (r264424) @@ -30,6 +30,9 @@ # second, and there may be multiple pairs. The files # are hard-linked. # +# NO_MANCOMPRESS If you do not want unformatted manual pages to be +# compressed when they are installed. [not set] +# # NO_MLINKS If you do not want install manual page links. [not set] # # MANFILTER command to pipe the raw man page through before compressing @@ -74,10 +77,10 @@ MAN+= ${MAN${__sect}} _manpages: all-man: _manpages -.if ${MK_MANCOMPRESS} != "no" +.if defined(NO_MANCOMPRESS) # Make special arrangements to filter to a temporary file at build time -# for MK_MANCOMPRESS == no. +# for NO_MANCOMPRESS. .if defined(MANFILTER) FILTEXTENSION= .filt .else @@ -159,7 +162,7 @@ maninstall: _maninstall _maninstall: .if defined(MAN) && !empty(MAN) _maninstall: ${MAN} -.if ${MK_MANCOMPRESS} == "no" +.if defined(NO_MANCOMPRESS) .if defined(MANFILTER) .for __page in ${MAN} ${MINSTALL} ${__page:T:S/$/${FILTEXTENSION}/g} \ Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sun Apr 13 21:49:44 2014 (r264423) +++ head/share/mk/bsd.own.mk Sun Apr 13 21:52:27 2014 (r264424) @@ -301,7 +301,6 @@ __DEFAULT_YES_OPTIONS = \ MAILWRAPPER \ MAKE \ MAN \ - MANCOMPRESS \ NCURSESW \ NDIS \ NETCAT \ @@ -459,14 +458,11 @@ MK_${var}:= no # Supported NO_* options (if defined, MK_* will be forced to "no", # regardless of user's setting). # -# These are transitional and will disappaer in the fullness of time. -# .for var in \ CTF \ DEBUG_FILES \ INSTALLLIB \ MAN \ - MANCOMPRESS \ PROFILE .if defined(NO_${var}) MK_${var}:=no From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 21:56:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DE0D64F; Sun, 13 Apr 2014 21:56:06 +0000 (UTC) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08A9D19C5; Sun, 13 Apr 2014 21:56:05 +0000 (UTC) Received: from dynamic.1.17.e8edf383af80.685b35818d2c.afb.bredband2.com (dynamic.1.17.e8edf383af80.685b35818d2c.afb.bredband2.com [31.208.77.249]) by mrelayeu.kundenserver.de (node=mreue101) with ESMTP (Nemesis) id 0LaU5X-1XFhXW0bXT-00mN4V; Sun, 13 Apr 2014 23:55:57 +0200 Message-ID: <534B07EA.7080400@FreeBSD.org> Date: Sun, 13 Apr 2014 23:55:54 +0200 From: Christian Brueffer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r264422 - head/sys/kern References: <201404132123.s3DLNGvJ048359@svn.freebsd.org> <20140413214633.GF4016@kib.kiev.ua> In-Reply-To: <20140413214633.GF4016@kib.kiev.ua> X-Enigmail-Version: 1.6 OpenPGP: id=3A67DC36; url=http://people.freebsd.org/~brueffer/brueffer.key.asc Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="1GN7UObGkwVAwht6FBC0rn66egmRIsVe4" X-Provags-ID: V02:K0:uH+XFkF4utCNM5oSFbjLx/ZSyWoUYYOIiJLOx7pRfcm WP8tUOEdRabyUqfnDpINoYojn/7Kf7ucuTEqUB3VWkOtmYViNT tKaXXZLKZhUiIQQGFlyktxy9SGx+SViURSHH5gxzeDrm2Gnk3S BjQ5e5ElFmFUg7Z7MgdYdtTiCyQX4sAyJdnsW2bY3F10D6leUM SOjvOAGe0cvtUNkEmcAeYm2kG0H2dv4t7lTw4Ee+TmB5xL4jh8 uaMcyYaRWNv4Y3CmHyAXs6dyoJfrlz2EtC0uVQQ4jN8DUUATI2 fhV/LEU2WZj9IjQ8e0GYFW5npn1AG6+zZqRxf1oMvpGhzFDpBO dqsmlC4NozukJd4ZuTCnCBiXRH9hJCRR19n7/lWmNOXo8/nNP0 hKZIGXFoykLqvpuQDTS20ZG+5JQvvTBJOuEjDPIHHV5n847BWk 9Hq0l Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 21:56:06 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1GN7UObGkwVAwht6FBC0rn66egmRIsVe4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 4/13/14 11:46 PM, Konstantin Belousov wrote: > On Sun, Apr 13, 2014 at 09:23:16PM +0000, Christian Brueffer wrote: >> Author: brueffer >> Date: Sun Apr 13 21:23:15 2014 >> New Revision: 264422 >> URL: http://svnweb.freebsd.org/changeset/base/264422 >> >> Log: >> Free buf after usage. >> =20 >> CID: 1199377 >> Found with: Coverity Prevent(tm) >> MFC after: 1 week >> >> Modified: >> head/sys/kern/imgact_elf.c >> >> Modified: head/sys/kern/imgact_elf.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/kern/imgact_elf.c Sun Apr 13 21:13:33 2014 (r264421) >> +++ head/sys/kern/imgact_elf.c Sun Apr 13 21:23:15 2014 (r264422) >> @@ -1746,8 +1746,10 @@ __elfN(note_threadmd)(void *arg, struct=20 >> size =3D 0; >> __elfN(dump_thread)(td, buf, &size); >> KASSERT(*sizep =3D=3D size, ("invalid size")); >> - if (size !=3D 0 && sb !=3D NULL) >> + if (size !=3D 0 && sb !=3D NULL) { >> sbuf_bcat(sb, buf, size); >> + free(buf, M_TEMP); >> + } >> *sizep =3D size; >> } >> =20 > Why conditioning free() on size !=3D 0 ? > IMO free(buf) must be done always, since buf is initialized for the cas= e > when malloc() is not called. >=20 The corresponding malloc() call is behind a similar conditional, so it seemed good to be symmetrical here (since buf if NULL otherwise anyway). I can change it to call free() unconditionally if you prefer, I don't mind either way. Chris --1GN7UObGkwVAwht6FBC0rn66egmRIsVe4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQJ8BAEBCgBmBQJTSwfsXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ5QzhCQjQ5MDgzNDUwNjkyOUM5Mjg2NDE3 OEM4MzY5ODQ3RTE2NDg3AAoJEHjINphH4WSHsxUP/1HTSqIZu21b5WUVI6CH1kPG W/xzDJDNXL8Ga9UnUYOFfPEBvU8L9f2FWyJJPuCwieUY4TpWSOeOgtgAFvekfW12 hq740oVExiPEDTE1hknAKF3jtzHxVylORUK1jqTbx/pD5IzXJyaRALEX3unNYqD+ 87IAzpVVoIfRaBFnj8ErGTa9kk8VTUPu+enhjKzXOQMvtNltYXAGAESodXg11K+r Fihz40TQWg+qWGWvVhEmlbw7dFXlqd94C6BxDYAw6Od2BU4mpBf6If55GkV5dN7I UxklWBQ9TGxJs5ObYwaqGN9TntHWXlO6YJJHSTs8unv0JaOikRZvb4uICqHRCgBa mv6m4Q/B34LMoQqbw0dUxRvKdxwTDXMh8/ptNe0scK2IAHfRoX1Gbfr2NmkbTyrk lz472+f8gaQ5Dj6koLUQF/NQ9vvxQk9NACDpWSW9jVJwR2jdKT20RYRVCIWpivcP dTtZAjGU/Udo7zzZ/O8agB5pLL7GKQJqyslXDSJg0Un61Zza7KFyy4I49KDiRJGQ klPIkSb+T43Ign76kXe3izz+ZSUoZrIr0N/dGiUQztLunyR3/aOX0hDNjFdLpN7n gowgyEPSkKB2RILyu9H+P0zCyhwRzjXDffgiNuYHhx87ZBd73r6LkC82iuUwk8Hj 3eepULDuo9N+10IF6+2X =Iwb2 -----END PGP SIGNATURE----- --1GN7UObGkwVAwht6FBC0rn66egmRIsVe4-- From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 22:35:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D028C22D; Sun, 13 Apr 2014 22:35:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC9CD1CC9; Sun, 13 Apr 2014 22:35:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3DMZdFh077940; Sun, 13 Apr 2014 22:35:39 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3DMZdbZ077938; Sun, 13 Apr 2014 22:35:39 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201404132235.s3DMZdbZ077938@svn.freebsd.org> From: Rui Paulo Date: Sun, 13 Apr 2014 22:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264428 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 22:35:40 -0000 Author: rpaulo Date: Sun Apr 13 22:35:39 2014 New Revision: 264428 URL: http://svnweb.freebsd.org/changeset/base/264428 Log: Improve the i.MX53 / Digi DTS: * Fix the IPU address. * Fix the PATA definition. * Add another I2C. * Add more UARTs. * Add SATA. Modified: head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts head/sys/boot/fdt/dts/arm/imx53x.dtsi Modified: head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts Sun Apr 13 22:32:46 2014 (r264427) +++ head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts Sun Apr 13 22:35:39 2014 (r264428) @@ -45,7 +45,10 @@ 0xB0000000 0x10000000>; }; - localbus@18000000 { + localbus@10000000 { + sata@10000000 { + status = "okay"; + }; ipu3@1E000000 { status = "okay"; }; @@ -69,13 +72,19 @@ timer@53fa0000 { status = "okay"; }; - /* UART1, console */ console: serial@53fbc000 { status = "okay"; clock-frequency = <0>; /* won't load w/o this */ }; - + serial@53fc0000 { + status = "okay"; + clock-frequency = <0>; /* won't load w/o this */ + }; + serial@53ff0000 { + status = "okay"; + clock-frequency = <0>; /* won't load w/o this */ + }; clock@53fd4000 { status = "okay"; }; @@ -100,6 +109,14 @@ wdog@53f98000 { status = "okay"; }; + i2c@53fec000 { + status = "okay"; + rtc@68 { + compatible = "dialog,ds9052"; + reg = <0x48>; + interrupts = <0x1 0x1 0 0>; + }; + }; }; aips@60000000 { ethernet@63fec000 { @@ -118,6 +135,9 @@ ide@63fe0000 { status = "okay"; }; + serial@63f90000 { + status = "okay"; + }; }; }; Modified: head/sys/boot/fdt/dts/arm/imx53x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/imx53x.dtsi Sun Apr 13 22:32:46 2014 (r264427) +++ head/sys/boot/fdt/dts/arm/imx53x.dtsi Sun Apr 13 22:35:39 2014 (r264428) @@ -282,7 +282,13 @@ /* 50028000 0x4000 SPDIF */ /* 91 SPDIF */ - /* 50030000 0x4000 PATA (PORT UDMA) irq70 */ + pata@50030000 { + compatible = "fsl,imx53-ata"; + reg = <0x50030000 0x4000>; + interrupt-parent = <&tzic>; + interrupts = <70>; + status = "disabled"; + }; /* 50034000 0x4000 SLM */ /* 50038000 0x4000 HSI2C */ @@ -444,7 +450,7 @@ status = "disabled"; }; - /* 53FC0000 0x4000 UART 4 */ + /* 53FF0000 0x4000 UART 4 */ uart4: serial@53ff0000 { compatible = "fsl,imx53-uart", "fsl,imx-uart"; reg = <0x53ff0000 0x4000>; @@ -469,17 +475,16 @@ interrupts = <73 74>; status = "disabled"; }; - - /* 53FE8000 0x4000 PATA (PORT PIO) */ - /* 70 PATA Parallel ATA host controller interrupt */ - ide@53fe8000 { - compatible = "fsl,imx53-ata"; - reg = <0x83fe0000 0x4000>; + i2c@53fec000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,imx53-i2c", "fsl,imx1-i2c", + "fsl,imx-i2c"; + reg = <0x53fec000 0x4000>; interrupt-parent = <&tzic>; - interrupts = <70>; + interrupts = <64>; status = "disabled"; }; - }; aips@60000000 { /* AIPS2 */ @@ -489,7 +494,7 @@ interrupt-parent = <&tzic>; ranges; - /* 53FC0000 0x4000 UART 5 */ + /* 63F90000 0x4000 UART 5 */ uart5: serial@63f90000 { compatible = "fsl,imx53-uart", "fsl,imx-uart"; reg = <0x63f90000 0x4000>; @@ -650,13 +655,20 @@ }; }; - localbus@18000000 { + localbus@10000000 { compatible = "simple-bus"; #address-cells = <1>; #size-cells = <1>; - ranges; + sata@10000000 { + compatible = "fsl,imx53-ata"; + reg = <0x10000000 0x4000>; + interrupt-parent = <&tzic>; + interrupts = <28>; + status = "disabled"; + }; + vga: ipu3@1E000000 { compatible = "fsl,ipu3"; reg = < From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 23:10:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 220BA277; Sun, 13 Apr 2014 23:10:08 +0000 (UTC) Received: from mail-ve0-x230.google.com (mail-ve0-x230.google.com [IPv6:2607:f8b0:400c:c01::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87A50112B; Sun, 13 Apr 2014 23:10:07 +0000 (UTC) Received: by mail-ve0-f176.google.com with SMTP id db11so6597212veb.21 for ; Sun, 13 Apr 2014 16:10:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=rllERWkUOFb1+NedigMrqc0qfQpTjYwmOgLgAxw+6jM=; b=X5OimzSN6ySU3wAJ2ZtwC62w1w93L/r/HPLhOa8uyF5mNMFMnGATQhRVkJxgXYOX7k dbhELbAQnVh7rKkuOQSEN2k9S66l3kYR5De0xeVejy+9vF+k7Bp2dFQucmD2TJFBVTHq PVFI0emTj9ENvc3SwBI3PAB2iJa4ultxkAsjIIiux1pvGjytOP4DE4gJArH07YICAFyD 66AGs66i9urE6uy+Ujo+3rKEIgGJFhCE9SMe8CJNch8mKUVcLqYKAZZrMsdfVpHh/zAA o9ghWEoaezTbAK0E14jVqHgvUDV9BmhaJerqb9HwTp33Se+SMuuor7E+VgNsCafTAhct snMQ== MIME-Version: 1.0 X-Received: by 10.220.190.197 with SMTP id dj5mr21893426vcb.19.1397430605760; Sun, 13 Apr 2014 16:10:05 -0700 (PDT) Sender: markjdb@gmail.com Received: by 10.220.162.68 with HTTP; Sun, 13 Apr 2014 16:10:05 -0700 (PDT) In-Reply-To: <9FB7142E-A0A0-41AF-BEFC-9306AE701B3F@bsdimp.com> References: <201404130522.s3D5MRXc053006@svn.freebsd.org> <9FB7142E-A0A0-41AF-BEFC-9306AE701B3F@bsdimp.com> Date: Sun, 13 Apr 2014 19:10:05 -0400 X-Google-Sender-Auth: -jex-I1x91VLtlfR_FAjm5B-1pw Message-ID: Subject: Re: svn commit: r264402 - in head/share: examples/etc man/man5 mk From: Mark Johnston To: Warner Losh Content-Type: multipart/mixed; boundary=001a11c1c272e086b704f6f4aa11 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Mark Johnston , Warner Losh , src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 23:10:08 -0000 --001a11c1c272e086b704f6f4aa11 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sun, Apr 13, 2014 at 4:57 PM, Warner Losh wrote: > > Are you sure it is this exact commit? It seems to be. I tried a # make SRCCONF=3D/dev/null MAKECONF=3D/dev/null buildworld installworld with and without this commit reverted, and installworld completed successfully when the change was reverted. > > Do you have anything in your /etc/make.conf or /etc/src.conf file? Yes, but clearing them doesn't fix the problem. > > Can you send me your full install world output? Attached. > > I=E2=80=99ll see if I can reproduce it myself. > > Warner > > On Apr 13, 2014, at 1:32 PM, Mark Johnston wrote: > >> On Sun, Apr 13, 2014 at 1:22 AM, Warner Losh wrote: >>> Author: imp >>> Date: Sun Apr 13 05:22:26 2014 >>> New Revision: 264402 >>> URL: http://svnweb.freebsd.org/changeset/base/264402 >>> >>> Log: >>> Convert NO_MANCOMPRESS to normal convention. >> >> This breaks installworld for me with >> >> ... >> install -o root -g wheel -m 444 zh_CN.GB2312.cat >> /usr/share/nls/zh_CN.GB2312/libc.cat >> install -o root -g wheel -m 444 zh_CN.UTF-8.cat >> /usr/share/nls/zh_CN.UTF-8/libc.cat >> install -o root -g wheel -m 444 btree.3.gz /usr/share/man/man3 >> install: btree.3.gz: No such file or directory >> *** Error code 71 >> ... >> >>> >>> Modified: >>> head/share/examples/etc/make.conf >>> head/share/man/man5/make.conf.5 >>> head/share/mk/bsd.man.mk >>> head/share/mk/bsd.own.mk >>> >>> [snip] >>> >>> Modified: head/share/mk/bsd.man.mk >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/share/mk/bsd.man.mk Sun Apr 13 05:22:22 2014 (r26440= 1) >>> +++ head/share/mk/bsd.man.mk Sun Apr 13 05:22:26 2014 (r26440= 2) >>> @@ -30,9 +30,6 @@ >>> # second, and there may be multiple pairs. The files >>> # are hard-linked. >>> # >>> -# NO_MANCOMPRESS If you do not want unformatted manual pages to = be >>> -# compressed when they are installed. [not set] >>> -# >>> # NO_MLINKS If you do not want install manual page links. [not set] >>> # >>> # MANFILTER command to pipe the raw man page through before compress= ing >>> @@ -77,10 +74,10 @@ MAN+=3D ${MAN${__sect}} >>> _manpages: >>> all-man: _manpages >>> >>> -.if defined(NO_MANCOMPRESS) >>> +.if ${MK_MANCOMPRESS} !=3D "no" >>> >>> # Make special arrangements to filter to a temporary file at build time >>> -# for NO_MANCOMPRESS. >>> +# for MK_MANCOMPRESS =3D=3D no. >>> .if defined(MANFILTER) >>> FILTEXTENSION=3D .filt >>> .else >>> @@ -162,7 +159,7 @@ maninstall: _maninstall >>> _maninstall: >>> .if defined(MAN) && !empty(MAN) >>> _maninstall: ${MAN} >>> -.if defined(NO_MANCOMPRESS) >>> +.if ${MK_MANCOMPRESS} =3D=3D "no" >> >> Changing this line to ".if ${MK_MANCOMPRESS} !=3D "no" seems to fix the = problem. >> >>> .if defined(MANFILTER) >>> [snip] > --001a11c1c272e086b704f6f4aa11 Content-Type: application/octet-stream; name="btree_failure.log" Content-Disposition: attachment; filename="btree_failure.log" Content-Transfer-Encoding: base64 X-Attachment-Id: f_htyy2s8y0 bWtkaXIgLXAgL3RtcC9pbnN0YWxsLlFtTUd5V3lICnByb2dzPSQoZm9yIHByb2cgaW4gWyBhd2sg Y2FwX21rZGIgY2F0IGNoZmxhZ3MgY2htb2QgY2hvd24gIGRhdGUgZWNobyBlZ3JlcCBmaW5kIGdy ZXAgaWQgaW5zdGFsbCBpbnN0YWxsLWluZm8gIGxuIGxvY2tmIG1ha2UgbWtkaXIgbXRyZWUgbXYg cHdkX21rZGIgIHJtIHNlZCBzZXJ2aWNlc19ta2RiIHNoIHN5c2N0bCB0ZXN0IHRydWUgdW5hbWUg d2MgemljIHR6c2V0dXA7IGRvICBpZiBwcm9ncGF0aD1gd2hpY2ggJHByb2dgOyB0aGVuICBlY2hv ICRwcm9ncGF0aDsgIGVsc2UgIGVjaG8gIlJlcXVpcmVkIHRvb2wgJHByb2cgbm90IGZvdW5kIGlu IFBBVEguIiA+JjI7ICBleGl0IDE7ICBmaTsgIGRvbmUpOyAgbGlicz0kKGxkZCAtZiAiJW8gJXBc biIgLWYgIiVvICVwXG4iICRwcm9ncyAyPi9kZXYvbnVsbCB8IHNvcnQgLXUgfCAgd2hpbGUgcmVh ZCBsaW5lOyBkbyAgc2V0IC0tICRsaW5lOyAgaWYgWyAiJDIgJDMiICE9ICJub3QgZm91bmQiIF07 IHRoZW4gIGVjaG8gJDI7ICBlbHNlICBlY2hvICJSZXF1aXJlZCBsaWJyYXJ5ICQxIG5vdCBmb3Vu ZC4iID4mMjsgIGV4aXQgMTsgIGZpOyAgZG9uZSk7ICBjcCAkbGlicyAkcHJvZ3MgL3RtcC9pbnN0 YWxsLlFtTUd5V3lICmNwIC1SICR7UEFUSF9MT0NBTEU6LSIvdXNyL3NoYXJlL2xvY2FsZSJ9IC90 bXAvaW5zdGFsbC5RbU1HeVd5SC9sb2NhbGUKY2QgL2hvbWUvbWFyay9zcmMvZnJlZWJzZDsgTUFL RU9CSkRJUlBSRUZJWD0vdXNyL29iaiBNQUNISU5FX0FSQ0g9YW1kNjQgTUFDSElORT1hbWQ2NCBD UFVUWVBFPSBHUk9GRl9CSU5fUEFUSD0vdXNyL29iai9ob21lL21hcmsvc3JjL2ZyZWVic2QvdG1w L2xlZ2FjeS91c3IvYmluIEdST0ZGX0ZPTlRfUEFUSD0vdXNyL29iai9ob21lL21hcmsvc3JjL2Zy ZWVic2QvdG1wL2xlZ2FjeS91c3Ivc2hhcmUvZ3JvZmZfZm9udCBHUk9GRl9UTUFDX1BBVEg9L3Vz ci9vYmovaG9tZS9tYXJrL3NyYy9mcmVlYnNkL3RtcC9sZWdhY3kvdXNyL3NoYXJlL3RtYWMgUEFU SD0vdXNyL29iai9ob21lL21hcmsvc3JjL2ZyZWVic2QvdG1wL2xlZ2FjeS91c3Ivc2JpbjovdXNy L29iai9ob21lL21hcmsvc3JjL2ZyZWVic2QvdG1wL2xlZ2FjeS91c3IvYmluOi91c3Ivb2JqL2hv bWUvbWFyay9zcmMvZnJlZWJzZC90bXAvbGVnYWN5L3Vzci9nYW1lczovdXNyL29iai9ob21lL21h cmsvc3JjL2ZyZWVic2QvdG1wL2xlZ2FjeS9iaW46L3Vzci9vYmovaG9tZS9tYXJrL3NyYy9mcmVl YnNkL3RtcC91c3Ivc2JpbjovdXNyL29iai9ob21lL21hcmsvc3JjL2ZyZWVic2QvdG1wL3Vzci9i aW46L3Vzci9vYmovaG9tZS9tYXJrL3NyYy9mcmVlYnNkL3RtcC91c3IvZ2FtZXM6L3RtcC9pbnN0 YWxsLlFtTUd5V3lIICBMRF9MSUJSQVJZX1BBVEg9L3RtcC9pbnN0YWxsLlFtTUd5V3lIICBQQVRI X0xPQ0FMRT0vdG1wL2luc3RhbGwuUW1NR3lXeUgvbG9jYWxlIG1ha2UgLWYgTWFrZWZpbGUuaW5j MSAgICBfX01BS0VfU0hFTEw9L3RtcC9pbnN0YWxsLlFtTUd5V3lIL3NoIHJlaW5zdGFsbDsgIE1B S0VPQkpESVJQUkVGSVg9L3Vzci9vYmogTUFDSElORV9BUkNIPWFtZDY0IE1BQ0hJTkU9YW1kNjQg Q1BVVFlQRT0gR1JPRkZfQklOX1BBVEg9L3Vzci9vYmovaG9tZS9tYXJrL3NyYy9mcmVlYnNkL3Rt cC9sZWdhY3kvdXNyL2JpbiBHUk9GRl9GT05UX1BBVEg9L3Vzci9vYmovaG9tZS9tYXJrL3NyYy9m cmVlYnNkL3RtcC9sZWdhY3kvdXNyL3NoYXJlL2dyb2ZmX2ZvbnQgR1JPRkZfVE1BQ19QQVRIPS91 c3Ivb2JqL2hvbWUvbWFyay9zcmMvZnJlZWJzZC90bXAvbGVnYWN5L3Vzci9zaGFyZS90bWFjIFBB VEg9L3Vzci9vYmovaG9tZS9tYXJrL3NyYy9mcmVlYnNkL3RtcC9sZWdhY3kvdXNyL3NiaW46L3Vz ci9vYmovaG9tZS9tYXJrL3NyYy9mcmVlYnNkL3RtcC9sZWdhY3kvdXNyL2JpbjovdXNyL29iai9o b21lL21hcmsvc3JjL2ZyZWVic2QvdG1wL2xlZ2FjeS91c3IvZ2FtZXM6L3Vzci9vYmovaG9tZS9t YXJrL3NyYy9mcmVlYnNkL3RtcC9sZWdhY3kvYmluOi91c3Ivb2JqL2hvbWUvbWFyay9zcmMvZnJl ZWJzZC90bXAvdXNyL3NiaW46L3Vzci9vYmovaG9tZS9tYXJrL3NyYy9mcmVlYnNkL3RtcC91c3Iv YmluOi91c3Ivb2JqL2hvbWUvbWFyay9zcmMvZnJlZWJzZC90bXAvdXNyL2dhbWVzOi90bXAvaW5z dGFsbC5RbU1HeVd5SCAgTERfTElCUkFSWV9QQVRIPS90bXAvaW5zdGFsbC5RbU1HeVd5SCAgUEFU SF9MT0NBTEU9L3RtcC9pbnN0YWxsLlFtTUd5V3lIL2xvY2FsZSBybSAtcmYgL3RtcC9pbnN0YWxs LlFtTUd5V3lICi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tCj4+PiBNYWtpbmcgaGllcmFyY2h5Ci0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCmNkIC9ob21lL21hcmsv c3JjL2ZyZWVic2Q7IG1ha2UgLWYgTWFrZWZpbGUuaW5jMSAgTE9DQUxfTVRSRUU9IGhpZXJhcmNo eQpjZCAvaG9tZS9tYXJrL3NyYy9mcmVlYnNkL2V0YyAmJiBQQVRIPS91c3Ivb2JqL2hvbWUvbWFy ay9zcmMvZnJlZWJzZC90bXAvbGVnYWN5L3Vzci9zYmluOi91c3Ivb2JqL2hvbWUvbWFyay9zcmMv ZnJlZWJzZC90bXAvbGVnYWN5L3Vzci9iaW46L3Vzci9vYmovaG9tZS9tYXJrL3NyYy9mcmVlYnNk L3RtcC9sZWdhY3kvdXNyL2dhbWVzOi91c3Ivb2JqL2hvbWUvbWFyay9zcmMvZnJlZWJzZC90bXAv bGVnYWN5L2JpbjovdXNyL29iai9ob21lL21hcmsvc3JjL2ZyZWVic2QvdG1wL3Vzci9zYmluOi91 c3Ivb2JqL2hvbWUvbWFyay9zcmMvZnJlZWJzZC90bXAvdXNyL2JpbjovdXNyL29iai9ob21lL21h cmsvc3JjL2ZyZWVic2QvdG1wL3Vzci9nYW1lczovdXNyL29iai9ob21lL21hcmsvc3JjL2ZyZWVi c2QvdG1wL2xlZ2FjeS91c3Ivc2JpbjovdXNyL29iai9ob21lL21hcmsvc3JjL2ZyZWVic2QvdG1w L2xlZ2FjeS91c3IvYmluOi91c3Ivb2JqL2hvbWUvbWFyay9zcmMvZnJlZWJzZC90bXAvbGVnYWN5 L3Vzci9nYW1lczovdXNyL29iai9ob21lL21hcmsvc3JjL2ZyZWVic2QvdG1wL2xlZ2FjeS9iaW46 L3Vzci9vYmovaG9tZS9tYXJrL3NyYy9mcmVlYnNkL3RtcC91c3Ivc2JpbjovdXNyL29iai9ob21l L21hcmsvc3JjL2ZyZWVic2QvdG1wL3Vzci9iaW46L3Vzci9vYmovaG9tZS9tYXJrL3NyYy9mcmVl YnNkL3RtcC91c3IvZ2FtZXM6L3RtcC9pbnN0YWxsLlFtTUd5V3lIIG1ha2UgTE9DQUxfTVRSRUU9 IGRpc3RyaWItZGlycwptdHJlZSAtZGVVIC1mIC9ob21lL21hcmsvc3JjL2ZyZWVic2QvZXRjL210 cmVlL0JTRC5yb290LmRpc3QgLXAgLwptdHJlZSAtZGVVIC1mIC9ob21lL21hcmsvc3JjL2ZyZWVi c2QvZXRjL210cmVlL0JTRC52YXIuZGlzdCAtcCAvdmFyCm10cmVlIC1kZVUgLWYgL2hvbWUvbWFy ay9zcmMvZnJlZWJzZC9ldGMvbXRyZWUvQlNELnVzci5kaXN0IC1wIC91c3IKbXRyZWUgLWRlVSAt ZiAvaG9tZS9tYXJrL3NyYy9mcmVlYnNkL2V0Yy9tdHJlZS9CU0QuaW5jbHVkZS5kaXN0IC1wIC91 c3IvaW5jbHVkZQptdHJlZSAtZGVVIC1mIC9ob21lL21hcmsvc3JjL2ZyZWVic2QvZXRjL210cmVl L0JTRC5ncm9mZi5kaXN0IC1wIC91c3IKbXRyZWUgLWRlVSAtZiAvaG9tZS9tYXJrL3NyYy9mcmVl YnNkL2V0Yy9tdHJlZS9CU0Quc2VuZG1haWwuZGlzdCAtcCAvCmluc3RhbGwgLWwgcyB1c3Ivc3Jj L3N5cyAvc3lzCmNkIC91c3Ivc2hhcmUvbWFuOyAgZm9yIG1hbmRpciBpbiBtYW4qOyBkbyAgaW5z dGFsbCAtbCBzIC4uLyRtYW5kaXIgIC91c3Ivc2hhcmUvbWFuL2VuLklTTzg4NTktMS87ICBpbnN0 YWxsIC1sIHMgLi4vJG1hbmRpciAgL3Vzci9zaGFyZS9tYW4vZW4uVVRGLTgvOyAgZG9uZQpjZCAv dXNyL3NoYXJlL29wZW5zc2wvbWFuOyAgZm9yIG1hbmRpciBpbiBtYW4qOyBkbyAgaW5zdGFsbCAt bCBzIC4uLyRtYW5kaXIgIC91c3Ivc2hhcmUvb3BlbnNzbC9tYW4vZW4uSVNPODg1OS0xLzsgIGRv bmUKc2V0IC0gYGdyZXAgIl5bYS16QS1aXSIgL2hvbWUvbWFyay9zcmMvZnJlZWJzZC9ldGMvbWFu LmFsaWFzYDsgIHdoaWxlIFsgJCMgLWd0IDAgXSA7IGRvICBpbnN0YWxsIC1sIHMgIiQyIiAiL3Vz ci9zaGFyZS9tYW4vJDEiOyAgaW5zdGFsbCAtbCBzICIkMiIgICIvdXNyL3NoYXJlL29wZW5zc2wv bWFuLyQxIjsgIHNoaWZ0OyBzaGlmdDsgIGRvbmUKc2V0IC0gYGdyZXAgIl5bYS16QS1aXSIgL2hv bWUvbWFyay9zcmMvZnJlZWJzZC9ldGMvbmxzLmFsaWFzYDsgIHdoaWxlIFsgJCMgLWd0IDAgXSA7 IGRvICBpbnN0YWxsIC1sIHMgIiQyIiAiL3Vzci9zaGFyZS9ubHMvJDEiOyAgc2hpZnQ7IHNoaWZ0 OyAgZG9uZQoKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0KPj4+IEluc3RhbGxpbmcgZXZlcnl0aGluZwotLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQpjZCAvaG9tZS9t YXJrL3NyYy9mcmVlYnNkOyBtYWtlIC1mIE1ha2VmaWxlLmluYzEgaW5zdGFsbAo9PT0+IHNoYXJl L2luZm8gKGluc3RhbGwpCj09PT4gbGliIChpbnN0YWxsKQo9PT0+IGxpYi9jc3UvYW1kNjQgKGlu c3RhbGwpCmluc3RhbGwgLW8gcm9vdCAtZyB3aGVlbCAtbSA0NDQgIGNydDEubyBjcnRpLm8gY3J0 bi5vIFNjcnQxLm8gZ2NydDEubyAvdXNyL2xpYgo9PT0+IGxpYi9saWJjIChpbnN0YWxsKQppbnN0 YWxsIC1DIC1vIHJvb3QgLWcgd2hlZWwgLW0gNDQ0ICAgbGliYy5hIC91c3IvbGliCmluc3RhbGwg LUMgLW8gcm9vdCAtZyB3aGVlbCAtbSA0NDQgICBsaWJjX3AuYSAvdXNyL2xpYgppbnN0YWxsIC1z IC1vIHJvb3QgLWcgd2hlZWwgLW0gNDQ0ICAgLWZzY2hnIC1TICBsaWJjLnNvLjcgL2xpYgpzZWQg LWUgJ3MsQEBTSExJQkBALC9saWIvbGliYy5zby43LGcnICAtZSAncyxAQExJQkRJUkBALC91c3Iv bGliLGcnICAvaG9tZS9tYXJrL3NyYy9mcmVlYnNkL2xpYi9saWJjL2xpYmMubGRzY3JpcHQgPiAv dXNyL2xpYi9saWJjLmxkCmluc3RhbGwgLVMgLUMgLW8gcm9vdCAtZyB3aGVlbCAtbSA0NDQgICAv dXNyL2xpYi9saWJjLmxkICAvdXNyL2xpYi9saWJjLnNvCnJtIC1mIC91c3IvbGliL2xpYmMubGQK aW5zdGFsbCAtbyByb290IC1nIHdoZWVsIC1tIDQ0NCAgIGxpYmNfcGljLmEgL3Vzci9saWIKaW5z dGFsbCAtbyByb290ICAtZyB3aGVlbCAtbSA0NDQgIGJlX0JZLlVURi04LmNhdCAgL3Vzci9zaGFy ZS9ubHMvYmVfQlkuVVRGLTgvbGliYy5jYXQKaW5zdGFsbCAtbyByb290ICAtZyB3aGVlbCAtbSA0 NDQgIGNhX0VTLklTTzg4NTktMS5jYXQgIC91c3Ivc2hhcmUvbmxzL2NhX0VTLklTTzg4NTktMS9s aWJjLmNhdAppbnN0YWxsIC1vIHJvb3QgIC1nIHdoZWVsIC1tIDQ0NCAgZGVfREUuSVNPODg1OS0x LmNhdCAgL3Vzci9zaGFyZS9ubHMvZGVfREUuSVNPODg1OS0xL2xpYmMuY2F0Cmluc3RhbGwgLW8g cm9vdCAgLWcgd2hlZWwgLW0gNDQ0ICBlbF9HUi5JU084ODU5LTcuY2F0ICAvdXNyL3NoYXJlL25s cy9lbF9HUi5JU084ODU5LTcvbGliYy5jYXQKaW5zdGFsbCAtbyByb290ICAtZyB3aGVlbCAtbSA0 NDQgIGVzX0VTLklTTzg4NTktMS5jYXQgIC91c3Ivc2hhcmUvbmxzL2VzX0VTLklTTzg4NTktMS9s aWJjLmNhdAppbnN0YWxsIC1vIHJvb3QgIC1nIHdoZWVsIC1tIDQ0NCAgZmlfRkkuSVNPODg1OS0x LmNhdCAgL3Vzci9zaGFyZS9ubHMvZmlfRkkuSVNPODg1OS0xL2xpYmMuY2F0Cmluc3RhbGwgLW8g cm9vdCAgLWcgd2hlZWwgLW0gNDQ0ICBmcl9GUi5JU084ODU5LTEuY2F0ICAvdXNyL3NoYXJlL25s cy9mcl9GUi5JU084ODU5LTEvbGliYy5jYXQKaW5zdGFsbCAtbyByb290ICAtZyB3aGVlbCAtbSA0 NDQgIGdsX0VTLklTTzg4NTktMS5jYXQgIC91c3Ivc2hhcmUvbmxzL2dsX0VTLklTTzg4NTktMS9s aWJjLmNhdAppbnN0YWxsIC1vIHJvb3QgIC1nIHdoZWVsIC1tIDQ0NCAgaHVfSFUuSVNPODg1OS0y LmNhdCAgL3Vzci9zaGFyZS9ubHMvaHVfSFUuSVNPODg1OS0yL2xpYmMuY2F0Cmluc3RhbGwgLW8g cm9vdCAgLWcgd2hlZWwgLW0gNDQ0ICBpdF9JVC5JU084ODU5LTE1LmNhdCAgL3Vzci9zaGFyZS9u bHMvaXRfSVQuSVNPODg1OS0xNS9saWJjLmNhdAppbnN0YWxsIC1vIHJvb3QgIC1nIHdoZWVsIC1t IDQ0NCAgamFfSlAuVVRGLTguY2F0ICAvdXNyL3NoYXJlL25scy9qYV9KUC5VVEYtOC9saWJjLmNh dAppbnN0YWxsIC1vIHJvb3QgIC1nIHdoZWVsIC1tIDQ0NCAgamFfSlAuZXVjSlAuY2F0ICAvdXNy L3NoYXJlL25scy9qYV9KUC5ldWNKUC9saWJjLmNhdAppbnN0YWxsIC1vIHJvb3QgIC1nIHdoZWVs IC1tIDQ0NCAga29fS1IuVVRGLTguY2F0ICAvdXNyL3NoYXJlL25scy9rb19LUi5VVEYtOC9saWJj LmNhdAppbnN0YWxsIC1vIHJvb3QgIC1nIHdoZWVsIC1tIDQ0NCAga29fS1IuZXVjS1IuY2F0ICAv dXNyL3NoYXJlL25scy9rb19LUi5ldWNLUi9saWJjLmNhdAppbnN0YWxsIC1vIHJvb3QgIC1nIHdo ZWVsIC1tIDQ0NCAgbW5fTU4uVVRGLTguY2F0ICAvdXNyL3NoYXJlL25scy9tbl9NTi5VVEYtOC9s aWJjLmNhdAppbnN0YWxsIC1vIHJvb3QgIC1nIHdoZWVsIC1tIDQ0NCAgbmxfTkwuSVNPODg1OS0x LmNhdCAgL3Vzci9zaGFyZS9ubHMvbmxfTkwuSVNPODg1OS0xL2xpYmMuY2F0Cmluc3RhbGwgLW8g cm9vdCAgLWcgd2hlZWwgLW0gNDQ0ICBub19OTy5JU084ODU5LTEuY2F0ICAvdXNyL3NoYXJlL25s cy9ub19OTy5JU084ODU5LTEvbGliYy5jYXQKaW5zdGFsbCAtbyByb290ICAtZyB3aGVlbCAtbSA0 NDQgIHBsX1BMLklTTzg4NTktMi5jYXQgIC91c3Ivc2hhcmUvbmxzL3BsX1BMLklTTzg4NTktMi9s aWJjLmNhdAppbnN0YWxsIC1vIHJvb3QgIC1nIHdoZWVsIC1tIDQ0NCAgcHRfQlIuSVNPODg1OS0x LmNhdCAgL3Vzci9zaGFyZS9ubHMvcHRfQlIuSVNPODg1OS0xL2xpYmMuY2F0Cmluc3RhbGwgLW8g cm9vdCAgLWcgd2hlZWwgLW0gNDQ0ICBydV9SVS5LT0k4LVIuY2F0ICAvdXNyL3NoYXJlL25scy9y dV9SVS5LT0k4LVIvbGliYy5jYXQKaW5zdGFsbCAtbyByb290ICAtZyB3aGVlbCAtbSA0NDQgIHNr X1NLLklTTzg4NTktMi5jYXQgIC91c3Ivc2hhcmUvbmxzL3NrX1NLLklTTzg4NTktMi9saWJjLmNh dAppbnN0YWxsIC1vIHJvb3QgIC1nIHdoZWVsIC1tIDQ0NCAgc3ZfU0UuSVNPODg1OS0xLmNhdCAg L3Vzci9zaGFyZS9ubHMvc3ZfU0UuSVNPODg1OS0xL2xpYmMuY2F0Cmluc3RhbGwgLW8gcm9vdCAg LWcgd2hlZWwgLW0gNDQ0ICB1a19VQS5VVEYtOC5jYXQgIC91c3Ivc2hhcmUvbmxzL3VrX1VBLlVU Ri04L2xpYmMuY2F0Cmluc3RhbGwgLW8gcm9vdCAgLWcgd2hlZWwgLW0gNDQ0ICB6aF9DTi5HQjE4 MDMwLmNhdCAgL3Vzci9zaGFyZS9ubHMvemhfQ04uR0IxODAzMC9saWJjLmNhdAppbnN0YWxsIC1v IHJvb3QgIC1nIHdoZWVsIC1tIDQ0NCAgemhfQ04uR0IyMzEyLmNhdCAgL3Vzci9zaGFyZS9ubHMv emhfQ04uR0IyMzEyL2xpYmMuY2F0Cmluc3RhbGwgLW8gcm9vdCAgLWcgd2hlZWwgLW0gNDQ0ICB6 aF9DTi5VVEYtOC5jYXQgIC91c3Ivc2hhcmUvbmxzL3poX0NOLlVURi04L2xpYmMuY2F0Cmluc3Rh bGwgLW8gcm9vdCAtZyB3aGVlbCAtbSA0NDQgYnRyZWUuMy5neiAgL3Vzci9zaGFyZS9tYW4vbWFu MwoqKiogRXJyb3IgY29kZSA3MQoKU3RvcC4KbWFrZVs1XTogc3RvcHBlZCBpbiAvaG9tZS9tYXJr L3NyYy9mcmVlYnNkL2xpYi9saWJjCioqKiBFcnJvciBjb2RlIDEKClN0b3AuCm1ha2VbNF06IHN0 b3BwZWQgaW4gL2hvbWUvbWFyay9zcmMvZnJlZWJzZC9saWIKKioqIEVycm9yIGNvZGUgMQoKU3Rv cC4KbWFrZVszXTogc3RvcHBlZCBpbiAvaG9tZS9tYXJrL3NyYy9mcmVlYnNkCioqKiBFcnJvciBj b2RlIDEKClN0b3AuCm1ha2VbMl06IHN0b3BwZWQgaW4gL2hvbWUvbWFyay9zcmMvZnJlZWJzZAoq KiogRXJyb3IgY29kZSAxCgpTdG9wLgptYWtlWzFdOiBzdG9wcGVkIGluIC9ob21lL21hcmsvc3Jj L2ZyZWVic2QKKioqIEVycm9yIGNvZGUgMQoKU3RvcC4KbWFrZTogc3RvcHBlZCBpbiAvaG9tZS9t YXJrL3NyYy9mcmVlYnNkCg== --001a11c1c272e086b704f6f4aa11-- From owner-svn-src-head@FreeBSD.ORG Sun Apr 13 23:23:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A5E848D for ; Sun, 13 Apr 2014 23:23:27 +0000 (UTC) Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26C21125F for ; Sun, 13 Apr 2014 23:23:26 +0000 (UTC) Received: by mail-pd0-f170.google.com with SMTP id v10so7445970pde.1 for ; Sun, 13 Apr 2014 16:23:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=wkPtrMe955AnqW1qOFceyLLskY+dUDATcTJlhmrWhsY=; b=VRDEVJ/aNDGiYfuf+y/YIMp9pZDzJBoU2M0ePsHeJsnse6Cj8b8/Ea4pjleZzKRP9R wM1TSPcqmdg50INmCrw7fkTFaJfuAJJGYP8K4D5sEkotmqObW9GE1eyg+OSeTU4WkGck eByMwSqtdE3WyV8TjEA74M+Ovs7dnZqCWsuB1gXzUipjn1G/mL5PiPSGHNSFLOU//e00 pcW6JRGdWNNXcVVAbfStMQzkbYF7YmtfbFNcvdVmp1+dBmDtnbFX6OczK3uHwlL3E+cI SxBD76TML7iP5b4+KQ3ynfWtnprH0oG3cqJVSWsoeu4oQkcU+9HcZolC/iHDRl1MVW43 bXRw== X-Gm-Message-State: ALoCoQkkWPx1be9EPNvfIY4ZKyHKjAVCbZds86rWx4Fu/MO9xlJ27sj5f3euTH9UHam5I3JO58Zc X-Received: by 10.66.254.234 with SMTP id al10mr51494pad.137.1397431399526; Sun, 13 Apr 2014 16:23:19 -0700 (PDT) Received: from macintosh-c42c033c0b73.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id ja8sm29948212pbd.3.2014.04.13.16.23.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 13 Apr 2014 16:23:18 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264402 - in head/share: examples/etc man/man5 mk From: Warner Losh In-Reply-To: Date: Sun, 13 Apr 2014 17:23:16 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201404130522.s3D5MRXc053006@svn.freebsd.org> <9FB7142E-A0A0-41AF-BEFC-9306AE701B3F@bsdimp.com> To: Mark Johnston X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2014 23:23:27 -0000 Thanks Mark. I=92ve recreated both the problem, and the solution. I=92ve reverted the = offending change until I have time to make sure my fix actually works in = a variety of situations. The tree should be good to go now. Warner On Apr 13, 2014, at 5:10 PM, Mark Johnston wrote: > On Sun, Apr 13, 2014 at 4:57 PM, Warner Losh wrote: >>=20 >> Are you sure it is this exact commit? >=20 > It seems to be. I tried a >=20 > # make SRCCONF=3D/dev/null MAKECONF=3D/dev/null buildworld = installworld >=20 > with and without this commit reverted, and installworld completed > successfully when the change was reverted. >=20 >>=20 >> Do you have anything in your /etc/make.conf or /etc/src.conf file? >=20 > Yes, but clearing them doesn't fix the problem. >=20 >>=20 >> Can you send me your full install world output? >=20 > Attached. >=20 >>=20 >> I=92ll see if I can reproduce it myself. >>=20 >> Warner >>=20 >> On Apr 13, 2014, at 1:32 PM, Mark Johnston wrote: >>=20 >>> On Sun, Apr 13, 2014 at 1:22 AM, Warner Losh = wrote: >>>> Author: imp >>>> Date: Sun Apr 13 05:22:26 2014 >>>> New Revision: 264402 >>>> URL: http://svnweb.freebsd.org/changeset/base/264402 >>>>=20 >>>> Log: >>>> Convert NO_MANCOMPRESS to normal convention. >>>=20 >>> This breaks installworld for me with >>>=20 >>> ... >>> install -o root -g wheel -m 444 zh_CN.GB2312.cat >>> /usr/share/nls/zh_CN.GB2312/libc.cat >>> install -o root -g wheel -m 444 zh_CN.UTF-8.cat >>> /usr/share/nls/zh_CN.UTF-8/libc.cat >>> install -o root -g wheel -m 444 btree.3.gz /usr/share/man/man3 >>> install: btree.3.gz: No such file or directory >>> *** Error code 71 >>> ... >>>=20 >>>>=20 >>>> Modified: >>>> head/share/examples/etc/make.conf >>>> head/share/man/man5/make.conf.5 >>>> head/share/mk/bsd.man.mk >>>> head/share/mk/bsd.own.mk >>>>=20 >>>> [snip] >>>>=20 >>>> Modified: head/share/mk/bsd.man.mk >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/share/mk/bsd.man.mk Sun Apr 13 05:22:22 2014 = (r264401) >>>> +++ head/share/mk/bsd.man.mk Sun Apr 13 05:22:26 2014 = (r264402) >>>> @@ -30,9 +30,6 @@ >>>> # second, and there may be multiple pairs. The files >>>> # are hard-linked. >>>> # >>>> -# NO_MANCOMPRESS If you do not want unformatted manual pages = to be >>>> -# compressed when they are installed. [not set] >>>> -# >>>> # NO_MLINKS If you do not want install manual page links. [not = set] >>>> # >>>> # MANFILTER command to pipe the raw man page through before = compressing >>>> @@ -77,10 +74,10 @@ MAN+=3D ${MAN${__sect}} >>>> _manpages: >>>> all-man: _manpages >>>>=20 >>>> -.if defined(NO_MANCOMPRESS) >>>> +.if ${MK_MANCOMPRESS} !=3D "no" >>>>=20 >>>> # Make special arrangements to filter to a temporary file at build = time >>>> -# for NO_MANCOMPRESS. >>>> +# for MK_MANCOMPRESS =3D=3D no. >>>> .if defined(MANFILTER) >>>> FILTEXTENSION=3D .filt >>>> .else >>>> @@ -162,7 +159,7 @@ maninstall: _maninstall >>>> _maninstall: >>>> .if defined(MAN) && !empty(MAN) >>>> _maninstall: ${MAN} >>>> -.if defined(NO_MANCOMPRESS) >>>> +.if ${MK_MANCOMPRESS} =3D=3D "no" >>>=20 >>> Changing this line to ".if ${MK_MANCOMPRESS} !=3D "no" seems to fix = the problem. >>>=20 >>>> .if defined(MANFILTER) >>>> [snip] >>=20 > From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 00:22:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BFF293F4; Mon, 14 Apr 2014 00:22:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA0381769; Mon, 14 Apr 2014 00:22:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3E0MhS5023932; Mon, 14 Apr 2014 00:22:43 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3E0MhZD023928; Mon, 14 Apr 2014 00:22:43 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201404140022.s3E0MhZD023928@svn.freebsd.org> From: Mark Johnston Date: Mon, 14 Apr 2014 00:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264434 - in head/sys/cddl: contrib/opensolaris/uts/common/dtrace contrib/opensolaris/uts/common/sys contrib/opensolaris/uts/intel/dtrace dev/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 00:22:43 -0000 Author: markj Date: Mon Apr 14 00:22:42 2014 New Revision: 264434 URL: http://svnweb.freebsd.org/changeset/base/264434 Log: DTrace's pid provider works by inserting breakpoint instructions at probe sites and installing a hook at the kernel's trap handler. The fasttrap code will emulate the overwritten instruction in some common cases, but otherwise copies it out into some scratch space in the traced process' address space and ensures that it's executed after returning from the trap. In Solaris and illumos, this (per-thread) scratch space comes from some reserved space in TLS, accessible via the fs segment register. This approach is somewhat unappealing on FreeBSD since it would require some modifications to rtld and jemalloc (for static TLS) to ensure that TLS is executable, and would thus introduce dependencies on their implementation details. I think it would also be impossible to safely trace static binaries compiled without these modifications. This change implements the functionality in a different way, by having fasttrap map pages into the target process' address space on demand. Each page is divided into 64-byte chunks for use by individual threads, and fasttrap's process descriptor struct has been extended to keep track of any scratch space allocated for the corresponding process. With this change it's possible to trace all libc functions in a program, e.g. with pid$target:libc.so.*::entry {@[probefunc] = count();} Previously this would generally cause the victim process to crash, as tracing memcpy on amd64 requires the functionality described above. Tested by: Prashanth Kumar (earlier version) MFC after: 6 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c head/sys/cddl/dev/dtrace/dtrace_cddl.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Sun Apr 13 22:41:30 2014 (r264433) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Apr 14 00:22:42 2014 (r264434) @@ -61,8 +61,13 @@ #include #include #if !defined(sun) -#include #include +#include +#include +#include +#include +#include +#include #include #endif @@ -206,6 +211,10 @@ static void fasttrap_provider_free(fastt static fasttrap_proc_t *fasttrap_proc_lookup(pid_t); static void fasttrap_proc_release(fasttrap_proc_t *); +#if !defined(sun) +static void fasttrap_thread_dtor(void *, struct thread *); +#endif + #define FASTTRAP_PROVS_INDEX(pid, name) \ ((fasttrap_hash_str(name) + (pid)) & fasttrap_provs.fth_mask) @@ -213,6 +222,7 @@ static void fasttrap_proc_release(fasttr #if !defined(sun) static kmutex_t fasttrap_cpuc_pid_lock[MAXCPU]; +static eventhandler_tag fasttrap_thread_dtor_tag; #endif static int @@ -289,6 +299,118 @@ fasttrap_sigtrap(proc_t *p, kthread_t *t #endif } +#if !defined(sun) +/* + * Obtain a chunk of scratch space in the address space of the target process. + */ +fasttrap_scrspace_t * +fasttrap_scraddr(struct thread *td, fasttrap_proc_t *fprc) +{ + fasttrap_scrblock_t *scrblk; + fasttrap_scrspace_t *scrspc; + struct proc *p; + vm_offset_t addr; + int error, i; + + scrspc = NULL; + if (td->t_dtrace_sscr != NULL) { + /* If the thread already has scratch space, we're done. */ + scrspc = (fasttrap_scrspace_t *)td->t_dtrace_sscr; + return (scrspc); + } + + p = td->td_proc; + + mutex_enter(&fprc->ftpc_mtx); + if (LIST_EMPTY(&fprc->ftpc_fscr)) { + /* + * No scratch space is available, so we'll map a new scratch + * space block into the traced process' address space. + */ + addr = 0; + error = vm_map_find(&p->p_vmspace->vm_map, NULL, 0, &addr, + FASTTRAP_SCRBLOCK_SIZE, 0, VMFS_ANY_SPACE, VM_PROT_ALL, + VM_PROT_ALL, 0); + if (error != KERN_SUCCESS) + goto done; + + scrblk = malloc(sizeof(*scrblk), M_SOLARIS, M_WAITOK); + scrblk->ftsb_addr = addr; + LIST_INSERT_HEAD(&fprc->ftpc_scrblks, scrblk, ftsb_next); + + /* + * Carve the block up into chunks and put them on the free list. + */ + for (i = 0; + i < FASTTRAP_SCRBLOCK_SIZE / FASTTRAP_SCRSPACE_SIZE; i++) { + scrspc = malloc(sizeof(*scrspc), M_SOLARIS, M_WAITOK); + scrspc->ftss_addr = addr + + i * FASTTRAP_SCRSPACE_SIZE; + LIST_INSERT_HEAD(&fprc->ftpc_fscr, scrspc, + ftss_next); + } + } + + /* + * Take the first scratch chunk off the free list, put it on the + * allocated list, and return its address. + */ + scrspc = LIST_FIRST(&fprc->ftpc_fscr); + LIST_REMOVE(scrspc, ftss_next); + LIST_INSERT_HEAD(&fprc->ftpc_ascr, scrspc, ftss_next); + + /* + * This scratch space is reserved for use by td until the thread exits. + */ + td->t_dtrace_sscr = scrspc; + +done: + mutex_exit(&fprc->ftpc_mtx); + + return (scrspc); +} + +/* + * Return any allocated per-thread scratch space chunks back to the process' + * free list. + */ +static void +fasttrap_thread_dtor(void *arg __unused, struct thread *td) +{ + fasttrap_bucket_t *bucket; + fasttrap_proc_t *fprc; + fasttrap_scrspace_t *scrspc; + pid_t pid; + + if (td->t_dtrace_sscr == NULL) + return; + + pid = td->td_proc->p_pid; + bucket = &fasttrap_procs.fth_table[FASTTRAP_PROCS_INDEX(pid)]; + fprc = NULL; + + /* Look up the fasttrap process handle for this process. */ + mutex_enter(&bucket->ftb_mtx); + for (fprc = bucket->ftb_data; fprc != NULL; fprc = fprc->ftpc_next) { + if (fprc->ftpc_pid == pid) { + mutex_enter(&fprc->ftpc_mtx); + mutex_exit(&bucket->ftb_mtx); + break; + } + } + if (fprc == NULL) { + mutex_exit(&bucket->ftb_mtx); + return; + } + + scrspc = (fasttrap_scrspace_t *)td->t_dtrace_sscr; + LIST_REMOVE(scrspc, ftss_next); + LIST_INSERT_HEAD(&fprc->ftpc_fscr, scrspc, ftss_next); + + mutex_exit(&fprc->ftpc_mtx); +} +#endif + /* * This function ensures that no threads are actively using the memory * associated with probes that were formerly live. @@ -449,6 +571,10 @@ fasttrap_pid_cleanup(void) static void fasttrap_fork(proc_t *p, proc_t *cp) { +#if !defined(sun) + fasttrap_scrblock_t *scrblk; + fasttrap_proc_t *fprc = NULL; +#endif pid_t ppid = p->p_pid; int i; @@ -534,9 +660,28 @@ fasttrap_fork(proc_t *p, proc_t *cp) * mid-fork. */ ASSERT(tp->ftt_proc->ftpc_acount != 0); +#if !defined(sun) + fprc = tp->ftt_proc; +#endif } } mutex_exit(&bucket->ftb_mtx); + +#if !defined(sun) + /* + * Unmap any scratch space inherited from the parent's address + * space. + */ + if (fprc != NULL) { + mutex_enter(&fprc->ftpc_mtx); + LIST_FOREACH(scrblk, &fprc->ftpc_scrblks, ftsb_next) { + vm_map_remove(&cp->p_vmspace->vm_map, + scrblk->ftsb_addr, + scrblk->ftsb_addr + FASTTRAP_SCRBLOCK_SIZE); + } + mutex_exit(&fprc->ftpc_mtx); + } +#endif } #if defined(sun) @@ -557,12 +702,24 @@ fasttrap_fork(proc_t *p, proc_t *cp) static void fasttrap_exec_exit(proc_t *p) { +#if !defined(sun) + struct thread *td; +#endif + #if defined(sun) ASSERT(p == curproc); -#endif +#else PROC_LOCK_ASSERT(p, MA_OWNED); _PHOLD(p); + /* + * Since struct threads may be recycled, we cannot rely on t_dtrace_sscr + * fields to be zeroed by kdtrace_thread_ctor. Thus we must zero it + * ourselves when a process exits. + */ + FOREACH_THREAD_IN_PROC(p, td) + td->t_dtrace_sscr = NULL; PROC_UNLOCK(p); +#endif /* * We clean up the pid provider for this process here; user-land @@ -572,9 +729,9 @@ fasttrap_exec_exit(proc_t *p) #if !defined(sun) if (p->p_dtrace_helpers) dtrace_helpers_destroy(p); -#endif PROC_LOCK(p); _PRELE(p); +#endif } @@ -1367,6 +1524,12 @@ fasttrap_proc_release(fasttrap_proc_t *p fasttrap_bucket_t *bucket; fasttrap_proc_t *fprc, **fprcp; pid_t pid = proc->ftpc_pid; +#if !defined(sun) + fasttrap_scrblock_t *scrblk, *scrblktmp; + fasttrap_scrspace_t *scrspc, *scrspctmp; + struct proc *p; + struct thread *td; +#endif mutex_enter(&proc->ftpc_mtx); @@ -1378,6 +1541,31 @@ fasttrap_proc_release(fasttrap_proc_t *p return; } +#if !defined(sun) + /* + * Free all structures used to manage per-thread scratch space. + */ + LIST_FOREACH_SAFE(scrblk, &proc->ftpc_scrblks, ftsb_next, + scrblktmp) { + LIST_REMOVE(scrblk, ftsb_next); + free(scrblk, M_SOLARIS); + } + LIST_FOREACH_SAFE(scrspc, &proc->ftpc_fscr, ftss_next, scrspctmp) { + LIST_REMOVE(scrspc, ftss_next); + free(scrspc, M_SOLARIS); + } + LIST_FOREACH_SAFE(scrspc, &proc->ftpc_ascr, ftss_next, scrspctmp) { + LIST_REMOVE(scrspc, ftss_next); + free(scrspc, M_SOLARIS); + } + + if ((p = pfind(pid)) != NULL) { + FOREACH_THREAD_IN_PROC(p, td) + td->t_dtrace_sscr = NULL; + PROC_UNLOCK(p); + } +#endif + mutex_exit(&proc->ftpc_mtx); /* @@ -2363,6 +2551,13 @@ fasttrap_load(void) mutex_init(&fasttrap_cpuc_pid_lock[i], "fasttrap barrier", MUTEX_DEFAULT, NULL); } + + /* + * This event handler must run before kdtrace_thread_dtor() since it + * accesses the thread's struct kdtrace_thread. + */ + fasttrap_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor, + fasttrap_thread_dtor, NULL, EVENTHANDLER_PRI_FIRST); #endif /* @@ -2464,6 +2659,8 @@ fasttrap_unload(void) #endif #if !defined(sun) + EVENTHANDLER_DEREGISTER(thread_dtor, fasttrap_thread_dtor_tag); + for (i = 0; i < fasttrap_tpoints.fth_nent; i++) mutex_destroy(&fasttrap_tpoints.fth_table[i].ftb_mtx); for (i = 0; i < fasttrap_provs.fth_nent; i++) Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Sun Apr 13 22:41:30 2014 (r264433) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Mon Apr 14 00:22:42 2014 (r264434) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -68,14 +69,41 @@ extern "C" { * then disabled, ownership of that tracepoint may be exchanged for an * unused tracepoint belonging to another probe that was attached to the * enabled tracepoint. + * + * On FreeBSD, fasttrap providers also maintain per-thread scratch space for use + * by the ISA-specific fasttrap code. The fasttrap_scrblock_t type stores the + * virtual address of a page-sized memory block that is mapped into a process' + * address space. Each block is carved up into chunks (fasttrap_scrspace_t) for + * use by individual threads, which keep the address of their scratch space + * chunk in their struct kdtrace_thread. A thread's scratch space isn't released + * until it exits. */ +#if !defined(sun) +typedef struct fasttrap_scrblock { + vm_offset_t ftsb_addr; /* address of a scratch block */ + LIST_ENTRY(fasttrap_scrblock) ftsb_next;/* next block in list */ +} fasttrap_scrblock_t; +#define FASTTRAP_SCRBLOCK_SIZE PAGE_SIZE + +typedef struct fasttrap_scrspace { + uintptr_t ftss_addr; /* scratch space address */ + LIST_ENTRY(fasttrap_scrspace) ftss_next;/* next in list */ +} fasttrap_scrspace_t; +#define FASTTRAP_SCRSPACE_SIZE 64 +#endif + typedef struct fasttrap_proc { pid_t ftpc_pid; /* process ID for this proc */ uint64_t ftpc_acount; /* count of active providers */ uint64_t ftpc_rcount; /* count of extant providers */ kmutex_t ftpc_mtx; /* lock on all but acount */ struct fasttrap_proc *ftpc_next; /* next proc in hash chain */ +#if !defined(sun) + LIST_HEAD(, fasttrap_scrblock) ftpc_scrblks; /* mapped scratch blocks */ + LIST_HEAD(, fasttrap_scrspace) ftpc_fscr; /* free scratch space */ + LIST_HEAD(, fasttrap_scrspace) ftpc_ascr; /* used scratch space */ +#endif } fasttrap_proc_t; typedef struct fasttrap_provider { @@ -170,6 +198,10 @@ typedef struct fasttrap_hash { #endif extern void fasttrap_sigtrap(proc_t *, kthread_t *, uintptr_t); +#if !defined(sun) +extern fasttrap_scrspace_t *fasttrap_scraddr(struct thread *, + fasttrap_proc_t *); +#endif extern dtrace_id_t fasttrap_probe_id; extern fasttrap_hash_t fasttrap_tpoints; Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Sun Apr 13 22:41:30 2014 (r264433) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Apr 14 00:22:42 2014 (r264434) @@ -1539,7 +1539,6 @@ fasttrap_pid_probe(struct reg *rp) uint_t i = 0; #if defined(sun) klwp_t *lwp = ttolwp(curthread); -#endif /* * Compute the address of the ulwp_t and step over the @@ -1547,7 +1546,6 @@ fasttrap_pid_probe(struct reg *rp) * thread pointer is very different on 32- and 64-bit * kernels. */ -#if defined(sun) #if defined(__amd64) if (p->p_model == DATAMODEL_LP64) { addr = lwp->lwp_pcb.pcb_fsbase; @@ -1560,13 +1558,23 @@ fasttrap_pid_probe(struct reg *rp) addr = USD_GETBASE(&lwp->lwp_pcb.pcb_gsdesc); addr += sizeof (void *); #endif -#endif /* sun */ -#ifdef __i386__ - addr = USD_GETBASE(&curthread->td_pcb->pcb_gsd); #else - addr = curthread->td_pcb->pcb_gsbase; -#endif - addr += sizeof (void *); + fasttrap_scrspace_t *scrspace; + scrspace = fasttrap_scraddr(curthread, tp->ftt_proc); + if (scrspace == NULL) { + /* + * We failed to allocate scratch space for this thread. + * Try to write the original instruction back out and + * reset the pc. + */ + if (fasttrap_copyout(tp->ftt_instr, (void *)pc, + tp->ftt_size)) + fasttrap_sigtrap(p, curthread, pc); + new_pc = pc; + break; + } + addr = scrspace->ftss_addr; +#endif /* sun */ /* * Generic Instruction Tracing Modified: head/sys/cddl/dev/dtrace/dtrace_cddl.h ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_cddl.h Sun Apr 13 22:41:30 2014 (r264433) +++ head/sys/cddl/dev/dtrace/dtrace_cddl.h Mon Apr 14 00:22:42 2014 (r264434) @@ -84,6 +84,7 @@ typedef struct kdtrace_thread { #endif u_int64_t td_hrtime; /* Last time on cpu. */ int td_errno; /* Syscall return value. */ + void *td_dtrace_sscr; /* Saved scratch space location. */ } kdtrace_thread_t; /* @@ -108,10 +109,12 @@ typedef struct kdtrace_thread { #define t_dtrace_scrpc td_dtrace->td_dtrace_scrpc #define t_dtrace_astpc td_dtrace->td_dtrace_astpc #define t_dtrace_regv td_dtrace->td_dtrace_regv +#define t_dtrace_sscr td_dtrace->td_dtrace_sscr #define p_dtrace_helpers p_dtrace->p_dtrace_helpers #define p_dtrace_count p_dtrace->p_dtrace_count #define p_dtrace_probes p_dtrace->p_dtrace_probes #define p_model p_dtrace->p_dtrace_model + #define DATAMODEL_NATIVE 0 #ifdef __amd64__ #define DATAMODEL_LP64 0 From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 00:23:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF9BE532; Mon, 14 Apr 2014 00:23:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB8FC176F; Mon, 14 Apr 2014 00:23:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3E0NIWZ024047; Mon, 14 Apr 2014 00:23:18 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3E0NIG6024045; Mon, 14 Apr 2014 00:23:18 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201404140023.s3E0NIG6024045@svn.freebsd.org> From: Mark Johnston Date: Mon, 14 Apr 2014 00:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264435 - head/sys/cddl/dev/systrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 00:23:18 -0000 Author: markj Date: Mon Apr 14 00:23:18 2014 New Revision: 264435 URL: http://svnweb.freebsd.org/changeset/base/264435 Log: Ensure that all eight syscall arguments are available to dtrace_probe(), rather than just the first five. This is done by calling dtrace_probe() through a function pointer, as in illumos. MFC after: 3 weeks Modified: head/sys/cddl/dev/systrace/systrace.c Modified: head/sys/cddl/dev/systrace/systrace.c ============================================================================== --- head/sys/cddl/dev/systrace/systrace.c Mon Apr 14 00:22:42 2014 (r264434) +++ head/sys/cddl/dev/systrace/systrace.c Mon Apr 14 00:23:18 2014 (r264435) @@ -168,6 +168,9 @@ static dtrace_pops_t systrace_pops = { static struct cdev *systrace_cdev; static dtrace_provider_id_t systrace_id; +typedef void (*systrace_dtrace_probe_t)(dtrace_id_t, uintptr_t, uintptr_t, + uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); + #if !defined(LINUX_SYSTRACE) /* * Probe callback function. @@ -180,6 +183,7 @@ static void systrace_probe(u_int32_t id, int sysnum, struct sysent *sysent, void *params, int ret) { + systrace_dtrace_probe_t probe; int n_args = 0; u_int64_t uargs[8]; @@ -211,7 +215,9 @@ systrace_probe(u_int32_t id, int sysnum, } /* Process the probe using the converted argments. */ - dtrace_probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4]); + probe = (systrace_dtrace_probe_t)dtrace_probe; + probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4], uargs[5], + uargs[6], uargs[7]); } #endif From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 00:24:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D20E689; Mon, 14 Apr 2014 00:24:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39B97177C; Mon, 14 Apr 2014 00:24:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3E0O5sT024184; Mon, 14 Apr 2014 00:24:05 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3E0O5YW024183; Mon, 14 Apr 2014 00:24:05 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201404140024.s3E0O5YW024183@svn.freebsd.org> From: Mark Johnston Date: Mon, 14 Apr 2014 00:24:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264436 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 00:24:05 -0000 Author: markj Date: Mon Apr 14 00:24:04 2014 New Revision: 264436 URL: http://svnweb.freebsd.org/changeset/base/264436 Log: Fix some off-by-one errors. The kve_end and rdl_eaddr fields contain the first address after the end of the map entry and should therefore be excluded. MFC after: 2 weeks Modified: head/lib/libproc/proc_sym.c Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Mon Apr 14 00:23:18 2014 (r264435) +++ head/lib/libproc/proc_sym.c Mon Apr 14 00:24:04 2014 (r264436) @@ -96,7 +96,7 @@ proc_objname(struct proc_handle *p, uint for (i = 0; i < p->nobjs; i++) { rdl = &p->rdobjs[i]; - if (addr >= rdl->rdl_saddr && addr <= rdl->rdl_eaddr) { + if (addr >= rdl->rdl_saddr && addr < rdl->rdl_eaddr) { strlcpy(objname, rdl->rdl_path, objnamesz); return (objname); } @@ -176,7 +176,7 @@ proc_addr2map(struct proc_handle *p, uin kve = kves + i; if (kve->kve_type == KVME_TYPE_VNODE) lastvn = i; - if (addr >= kve->kve_start && addr <= kve->kve_end) { + if (addr >= kve->kve_start && addr < kve->kve_end) { if ((map = malloc(sizeof(*map))) == NULL) { free(kves); return (NULL); @@ -209,7 +209,7 @@ proc_addr2map(struct proc_handle *p, uin for (i = 0; i < p->nobjs; i++) { rdl = &p->rdobjs[i]; - if (addr >= rdl->rdl_saddr && addr <= rdl->rdl_eaddr) { + if (addr >= rdl->rdl_saddr && addr < rdl->rdl_eaddr) { if ((map = malloc(sizeof(*map))) == NULL) return (NULL); proc_rdl2prmap(rdl, map); From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 05:35:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA74FAFB; Mon, 14 Apr 2014 05:35:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7A2D12C8; Mon, 14 Apr 2014 05:35:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3E5Z1eZ052636; Mon, 14 Apr 2014 05:35:01 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3E5Z150052634; Mon, 14 Apr 2014 05:35:01 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201404140535.s3E5Z150052634@svn.freebsd.org> From: Devin Teske Date: Mon, 14 Apr 2014 05:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264448 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 05:35:01 -0000 Author: dteske Date: Mon Apr 14 05:35:01 2014 New Revision: 264448 URL: http://svnweb.freebsd.org/changeset/base/264448 Log: Fix typo in debug/log statement. Submitted by: Rick Miller Modified: head/usr.sbin/bsdinstall/scripts/script Modified: head/usr.sbin/bsdinstall/scripts/script ============================================================================== --- head/usr.sbin/bsdinstall/scripts/script Mon Apr 14 05:05:07 2014 (r264447) +++ head/usr.sbin/bsdinstall/scripts/script Mon Apr 14 05:35:01 2014 (r264448) @@ -74,7 +74,7 @@ trap error EXIT SCRIPT="$1" shift -f_dprintf "Began Instalation at %s" "$( date )" +f_dprintf "Began Installation at %s" "$( date )" rm -rf $BSDINSTALL_TMPETC mkdir $BSDINSTALL_TMPETC From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 06:34:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39A5091D; Mon, 14 Apr 2014 06:34:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2603D17B4; Mon, 14 Apr 2014 06:34:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3E6Y9UM076972; Mon, 14 Apr 2014 06:34:09 GMT (envelope-from pgj@svn.freebsd.org) Received: (from pgj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3E6Y82b076971; Mon, 14 Apr 2014 06:34:08 GMT (envelope-from pgj@svn.freebsd.org) Message-Id: <201404140634.s3E6Y82b076971@svn.freebsd.org> From: Gabor Pali Date: Mon, 14 Apr 2014 06:34:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264452 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 06:34:09 -0000 Author: pgj (doc,ports committer) Date: Mon Apr 14 06:34:08 2014 New Revision: 264452 URL: http://svnweb.freebsd.org/changeset/base/264452 Log: - Move davidxu to the alumni section Approved by: core (implicit) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Mon Apr 14 06:33:06 2014 (r264451) +++ head/share/misc/committers-src.dot Mon Apr 14 06:34:08 2014 (r264452) @@ -43,6 +43,7 @@ bushman [label="Michael Bushkov\nbushman carl [label="Carl Delsey\ncarl@FreeBSD.org\n2013/01/14\n2014/03/06"] ceri [label="Ceri Davies\nceri@FreeBSD.org\n2006/11/07\n2012/03/07"] cjc [label="Crist J. Clark\ncjc@FreeBSD.org\n2001/06/01\n2006/12/29"] +davidxu [label="David Xu\ndavidxu@FreeBSD.org\n2002/09/02\n2014/04/14"] dds [label="Diomidis Spinellis\ndds@FreeBSD.org\n2003/06/20\n2010/09/22"] dhartmei [label="Daniel Hartmeier\ndhartmei@FreeBSD.org\n2004/04/06\n2008/12/08"] dmlb [label="Duncan Barclay\ndmlb@FreeBSD.org\n2001/12/14\n2008/11/10"] @@ -134,7 +135,6 @@ cperciva [label="Colin Percival\ncperciv csjp [label="Christian S.J. Peron\ncsjp@FreeBSD.org\n2004/05/04"] das [label="David Schultz\ndas@FreeBSD.org\n2003/02/21"] davide [label="Davide Italiano\ndavide@FreeBSD.org\n2012/01/27"] -davidxu [label="David Xu\ndavidxu@FreeBSD.org\n2002/09/02"] dchagin [label="Dmitry Chagin\ndchagin@FreeBSD.org\n2009/02/28"] delphij [label="Xin Li\ndelphij@FreeBSD.org\n2004/09/14"] des [label="Dag-Erling Smorgrav\ndes@FreeBSD.org\n1998/04/03"] From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 06:59:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 810ECE4F; Mon, 14 Apr 2014 06:59:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DD861978; Mon, 14 Apr 2014 06:59:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3E6xoWS085684; Mon, 14 Apr 2014 06:59:50 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3E6xonu085683; Mon, 14 Apr 2014 06:59:50 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404140659.s3E6xonu085683@svn.freebsd.org> From: Christian Brueffer Date: Mon, 14 Apr 2014 06:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264453 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 06:59:50 -0000 Author: brueffer Date: Mon Apr 14 06:59:49 2014 New Revision: 264453 URL: http://svnweb.freebsd.org/changeset/base/264453 Log: Correct geli parameter. PR: 188582 Submitted by: Michael Hall MFC after: 3 days Modified: head/share/man/man5/fstab.5 Modified: head/share/man/man5/fstab.5 ============================================================================== --- head/share/man/man5/fstab.5 Mon Apr 14 06:34:08 2014 (r264452) +++ head/share/man/man5/fstab.5 Mon Apr 14 06:59:49 2014 (r264453) @@ -28,7 +28,7 @@ .\" @(#)fstab.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd September 10, 2013 +.Dd April 14, 2014 .Dt FSTAB 5 .Os .Sh NAME @@ -241,7 +241,7 @@ devices will cause automatic creation of The .Dq ealgo , .Dq aalgo , -.Dq keylength , +.Dq keylen , and .Dq sectorsize options may be passed to control those From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 07:35:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26B015F3; Mon, 14 Apr 2014 07:35:46 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id C56351CD3; Mon, 14 Apr 2014 07:35:45 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id A19861043D6D; Mon, 14 Apr 2014 17:35:35 +1000 (EST) Date: Mon, 14 Apr 2014 17:35:32 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Christian Brueffer Subject: Re: svn commit: r264421 - head/sys/netpfil/ipfw In-Reply-To: <201404132113.s3DLDXRI044236@svn.freebsd.org> Message-ID: <20140414170654.Y5260@besplex.bde.org> References: <201404132113.s3DLDXRI044236@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=U6SrU4bu c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=Fwfa6FMV41EA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=1f4-qKUDpKhKomwRpnoA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 07:35:46 -0000 On Sun, 13 Apr 2014, Christian Brueffer wrote: > Log: > Free resources and error cases; re-indent a curly brace while here. The patch begins with a misindented block in old code. I thought at first the whole file was misindented with 4-column indents and the patch is backwards, as in a recent commit to ata, but here it is mainly the is7 code that is misindented, while in ata the indentation was already mangled throughout the file (ata started in sosNF with 4-column indents and other style bugs, but now has a mangled mess of sosNF and KNF indents and other style bugs). > Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c > ============================================================================== > --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Sun Apr 13 20:21:56 2014 (r264420) > +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Sun Apr 13 21:13:33 2014 (r264421) > @@ -1039,8 +1039,10 @@ ipfw_ctl(struct sockopt *sopt) > if (sopt->sopt_valsize == RULESIZE7(rule)) { > is7 = 1; > error = convert_rule_to_8(rule); > - if (error) > + if (error) { > + free(rule, M_TEMP); > return error; > + } > if (error == 0) > error = check_ipfw_struct(rule, RULESIZE(rule)); > } else { Typical 4-column indents in is7 code. > @@ -1056,11 +1058,13 @@ ipfw_ctl(struct sockopt *sopt) > if (is7) { > error = convert_rule_to_7(rule); > size = RULESIZE7(rule); > - if (error) > + if (error) { > + free(rule, M_TEMP); > return error; > + } Atypical (for is7) normal 8-column indents in is7 code. This is the only is7 block in the file that has normal indents. is7 code in other ipfw files has notmal indents. > } > error = sooptcopyout(sopt, rule, size); > - } > + } > } > free(rule, M_TEMP); > break; ipfw code has mounds of other style bugs, so running it through indent makes too many changes to easily find the mere indentation bugs. According to knfom: %%% 79.069% dn_heap.h 77.876% dn_sched.h 62.386% ip_dn_private.h 69.688% ip_fw_private.h 79.533% dn_heap.c 75.021% dn_sched_fifo.c 81.667% dn_sched_prio.c Error@230: Unbalanced parens Warning@232: Extra ) Error@541: Unbalanced parens Warning@541: Extra ) Error@544: Unbalanced parens Warning@544: Extra ) Error@558: Unbalanced parens Warning@558: Extra ) Error@589: Unbalanced parens Warning@589: Extra ) Error@642: Unbalanced parens Warning@642: Extra ) Error@649: Unbalanced parens Warning@649: Extra ) 80.731% dn_sched_qfq.c 82.742% dn_sched_rr.c 55.642% dn_sched_wf2q.c 71.398% ip_dn_glue.c 84.747% ip_dn_io.c Warning@1283: Extra ) Warning@1286: Extra ) Error@1537: Statement nesting error Error@2307: Stuff missing from end of file 57.207% ip_dummynet.c 67.913% ip_fw2.c Error@621: Unbalanced parens Warning@621: Extra ) Error@658: Unbalanced parens Warning@658: Extra ) Error@679: Unbalanced parens Warning@679: Extra ) Error@689: Unbalanced parens Warning@693: Extra ) Error@722: Unbalanced parens Warning@726: Extra ) Error@1139: Unbalanced parens Warning@1140: Extra ) Error@1147: Unbalanced parens Warning@1148: Extra ) Error@1243: Unbalanced parens Warning@1244: Extra ) 83.301% ip_fw_dynamic.c 84.102% ip_fw_log.c 96.352% ip_fw_nat.c 70.911% ip_fw_pfil.c 84.409% ip_fw_sockopt.c 93.064% ip_fw_table.c %%% 90% would be mediocre (but well above average). 95% would be very good. 90% means that indent with no block comments reformatted and certain other options creates (non-context) diffs of size 10% of the original file. ip_fw_table.c has 764 lines, so 93% for it means about 54 lines of diffs or about 14 lines changed if the changes are scattered. The errors are because ipfw uses many C90 and later constructions that are not understood by indent. It has 58 lines with C++ style comments... It is still closer to KNF than ata, since consistent 4-column indents give a style bug on almost every non-blank line: 66.105% ata-all.h 89.168% ata-pci.h 52.018% ata-all.c 45.705% ata-card.c 37.662% ata-cbus.c 29.365% ata-dma.c 42.298% ata-isa.c 15.969% ata-lowlevel.c 44.266% ata-pci.c 29.038% ata-sata.c ata has only 2 C++ style comments. kern still has none. Complicated declarations are more likely than comments to be the cause of the errors. ipfw has mounds of non-whitespace errors which indent cannot always fix. The most obvious ones in the above are 'return error;' (indent can fix this) and 'if (error)' (indent can't fix this). Bruce From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 07:42:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFB499B2; Mon, 14 Apr 2014 07:42:41 +0000 (UTC) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8148F1D82; Mon, 14 Apr 2014 07:42:41 +0000 (UTC) Received: from dynamic.1.17.e8edf383af80.685b35818d2c.afb.bredband2.com (dynamic.1.17.e8edf383af80.685b35818d2c.afb.bredband2.com [31.208.77.249]) by mrelayeu.kundenserver.de (node=mreue101) with ESMTP (Nemesis) id 0MPXwP-1Wdi8t2mMD-004ldG; Mon, 14 Apr 2014 09:42:38 +0200 Message-ID: <534B916C.6030700@FreeBSD.org> Date: Mon, 14 Apr 2014 09:42:36 +0200 From: Christian Brueffer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r264421 - head/sys/netpfil/ipfw References: <201404132113.s3DLDXRI044236@svn.freebsd.org> <20140414170654.Y5260@besplex.bde.org> In-Reply-To: <20140414170654.Y5260@besplex.bde.org> X-Enigmail-Version: 1.6 OpenPGP: id=3A67DC36; url=http://people.freebsd.org/~brueffer/brueffer.key.asc Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="aHl1lhxjL4GWOG6QGQtu45D3DktSPvu6b" X-Provags-ID: V02:K0:RrXsP7Syi9MBfv7XtR13plAALWQyqBpfpYobR+iJHQL 5mly5PXx+3iZbtte8YYZKheFy0NGBOcOcWSkUe/D5o4KTmPQDe ircQJO26jE5gY4YQL8IT9mwji5fhKMRxalUvuuxg/qekHTbp9+ 4IcaugnIZLTZ2mWYwzG/6iItMpcErXsTB3TvD9Ef8RiBQaKoqO j9TqSivMi6KsWD/vA9oxRtt8IkhAti6dZidAbdO87/UbJszj86 /iK+8z33I4OOGyHuKsvJGKOeoOVeKAvBKZXsTkZfdrcp6xrRKa Fi4HFoz73f3lJ3ClPMItRMEYMvh8S4oR4HetccIEvJnR1ODVxg APYMkm3n568QxgnHHi4Pl45eiPiSWExKRAKwxGUyOoK+tQkPND s9SYWdCne6tVNrcTF1xDg9B+wV0nN+W2amOCDCBKReZv0j6GWn KeAx7 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 07:42:42 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --aHl1lhxjL4GWOG6QGQtu45D3DktSPvu6b Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 4/14/14 9:35 AM, Bruce Evans wrote: > On Sun, 13 Apr 2014, Christian Brueffer wrote: >=20 >> Log: >> Free resources and error cases; re-indent a curly brace while here. >=20 > The patch begins with a misindented block in old code. I thought at > first the whole file was misindented with 4-column indents and the > patch is backwards, as in a recent commit to ata, but here it is mainly= > the is7 code that is misindented, while in ata the indentation was > already mangled throughout the file (ata started in sosNF with 4-column= > indents and other style bugs, but now has a mangled mess of sosNF and > KNF indents and other style bugs). >=20 Yup, the whole file is a mess. I tried to adhere to the local style of the respective code blocks for now. Chris --aHl1lhxjL4GWOG6QGQtu45D3DktSPvu6b Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQJ8BAEBCgBmBQJTS5FtXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ5QzhCQjQ5MDgzNDUwNjkyOUM5Mjg2NDE3 OEM4MzY5ODQ3RTE2NDg3AAoJEHjINphH4WSHCWgP/25J1o9Pnv+/Fr2Va/GD7e9M KDTTao6tm92i1ITuxBUULz9QI33391tR5YqqgOoyZ+QPqWRZze5jhEDbjMiIYLYU 97KBfrS3/iLUnwc4bqu3f8avvoOTXVw8twx0ki0xZpB+EGoV7pHC/mCWGSt3TPMd avUcRQ8+0V6Ik/4tpIKugXN58Mu1trstSxMMJGh5QG/zHNj6S3we/uwYX6xjqW4d TgeT7uYtbmxVxO+I7StiRhY04KM2CZ207vt6UzsBJvYizhfWsDr66P89bNKxNZe4 cr8PnXLleC6AndDhmQ1M6fE5NJfobMy5kEJ9r/Gdg004b88Wlil0nzYf6WcIV0jn leQAjRvlILKXpLAPUkMV7u3FgmWxqHMj3dupVDP19LycL/Kd/Zllkzy4SlfTwH3m SzGgEri85kPq9zdgMJo1lA8BzPaQmcTob0cq3KVxXOvKpI5n0o7C88UToOZc0Hxy GvGGrGwfB3M1gsCFNtxm5BjuPM6Oh6zp9b5ng18UTvLFqaj8wbY/ufuLoBFoCH6f C0Zs0pPB5NAfBMMMbVfN+Ym+HwctcwWqee3ohrT1rbDLhozYiftW1UO0K4DsJTad nyj9kTzP+hg6wbpbBr+ce5aNQy3Xha6NiXYNm0ZO5hr0T3qOjOn1GqrmgWBuvSqw cfSyG2SPZP7wy/e6JiyC =tePr -----END PGP SIGNATURE----- --aHl1lhxjL4GWOG6QGQtu45D3DktSPvu6b-- From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 14:05:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A211FBB1; Mon, 14 Apr 2014 14:05:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E3481B21; Mon, 14 Apr 2014 14:05:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3EE5080063387; Mon, 14 Apr 2014 14:05:00 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EE50U3063384; Mon, 14 Apr 2014 14:05:00 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404141405.s3EE50U3063384@svn.freebsd.org> From: Eitan Adler Date: Mon, 14 Apr 2014 14:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264458 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 14:05:00 -0000 Author: eadler Date: Mon Apr 14 14:04:59 2014 New Revision: 264458 URL: http://svnweb.freebsd.org/changeset/base/264458 Log: units(1): add libedit support Add line editing and history support to units(1) via libedit. Reviewed by: bdrewery Modified: head/usr.bin/units/Makefile head/usr.bin/units/units.c Modified: head/usr.bin/units/Makefile ============================================================================== --- head/usr.bin/units/Makefile Mon Apr 14 13:30:08 2014 (r264457) +++ head/usr.bin/units/Makefile Mon Apr 14 14:04:59 2014 (r264458) @@ -4,4 +4,7 @@ PROG= units FILES= units.lib FILESDIR= ${SHAREDIR}/misc +LDADD+=-ledit -ltermcap +DPADD+=${LIBEDIT} ${LIBTERMCAP} + .include Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Mon Apr 14 13:30:08 2014 (r264457) +++ head/usr.bin/units/units.c Mon Apr 14 14:04:59 2014 (r264458) @@ -23,6 +23,8 @@ static const char rcsid[] = #include #include #include +#include +#include #include #include #include @@ -81,7 +83,7 @@ void initializeunit(struct unittype * t int addsubunit(char *product[], char *toadd); void showunit(struct unittype * theunit); void zeroerror(void); -int addunit(struct unittype *theunit, char *toadd, int flip, int quantity); +int addunit(struct unittype *theunit, const char *toadd, int flip, int quantity); int compare(const void *item1, const void *item2); void sortunit(struct unittype * theunit); void cancelunit(struct unittype * theunit); @@ -94,6 +96,12 @@ int completereduce(struct unittype * un void showanswer(struct unittype * have, struct unittype * want); void usage(void); +static const char* promptstr = ""; + +static const char * prompt(EditLine *e __unused) { + return promptstr; +} + char * dupstr(const char *str) { @@ -304,7 +312,7 @@ zeroerror(void) */ int -addunit(struct unittype * theunit, char *toadd, int flip, int quantity) +addunit(struct unittype * theunit, const char *toadd, int flip, int quantity) { char *scratch, *savescr; char *item; @@ -682,18 +690,25 @@ main(int argc, char **argv) { struct unittype have, want; - char havestr[81], wantstr[81]; + const char * havestr; + const char * wantstr; int optchar; - char *userfile = 0; - int quiet = 0; + char *userfile; + bool quiet; + History *inhistory; + EditLine *el; + HistEvent ev; + int inputsz; + userfile = NULL; + quiet = false; while ((optchar = getopt(argc, argv, "Vqf:")) != -1) { switch (optchar) { case 'f': userfile = optarg; break; case 'q': - quiet = 1; + quiet = true; break; case 'V': fprintf(stderr, "FreeBSD units\n"); @@ -707,11 +722,22 @@ main(int argc, char **argv) if (optind != argc - 2 && optind != argc) usage(); + inhistory = history_init(); + el = el_init(argv[0], stdin, stdout, stderr); + el_source(el, NULL); + el_set(el, EL_PROMPT, &prompt); + el_set(el, EL_EDITOR, "emacs"); + el_set(el, EL_SIGNAL, 1); + el_set(el, EL_HIST, history, inhistory); + history(inhistory, &ev, H_SETSIZE, 800); + if (inhistory == 0) + err(1, "Could not initalize history"); + readunits(userfile); if (optind == argc - 2) { - strlcpy(havestr, argv[optind], sizeof(havestr)); - strlcpy(wantstr, argv[optind + 1], sizeof(wantstr)); + havestr = argv[optind]; + wantstr = argv[optind + 1]; initializeunit(&have); addunit(&have, havestr, 0, 1); completereduce(&have); @@ -728,28 +754,31 @@ main(int argc, char **argv) do { initializeunit(&have); if (!quiet) - printf("You have: "); - if (!fgets(havestr, sizeof(havestr), stdin)) { - if (!quiet) - putchar('\n'); + promptstr = "You have: "; + havestr = el_gets(el, &inputsz); + if (havestr == NULL) exit(0); - } + if (inputsz > 0) + history(inhistory, &ev, H_ENTER, + havestr); } while (addunit(&have, havestr, 0, 1) || completereduce(&have)); do { initializeunit(&want); if (!quiet) - printf("You want: "); - if (!fgets(wantstr, sizeof(wantstr), stdin)) { - if (!quiet) - putchar('\n'); + promptstr = "You want: "; + wantstr = el_gets(el, &inputsz); + if (wantstr == NULL) exit(0); - } + if (inputsz > 0) + history(inhistory, &ev, H_ENTER, + wantstr); } while (addunit(&want, wantstr, 0, 1) || completereduce(&want)); showanswer(&have, &want); } } + history_end(inhistory); return(0); } From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 14:40:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC21A2A7; Mon, 14 Apr 2014 14:40:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B83831E4E; Mon, 14 Apr 2014 14:40:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3EEeCwt076275; Mon, 14 Apr 2014 14:40:12 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EEeCsj076274; Mon, 14 Apr 2014 14:40:12 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404141440.s3EEeCsj076274@svn.freebsd.org> From: Eitan Adler Date: Mon, 14 Apr 2014 14:40:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264459 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 14:40:12 -0000 Author: eadler Date: Mon Apr 14 14:40:12 2014 New Revision: 264459 URL: http://svnweb.freebsd.org/changeset/base/264459 Log: units(1): parse config file after setting defaults Parse the config file after setting the defaults to permit the user to change things (e.g., editing mode) Modified: head/usr.bin/units/units.c Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Mon Apr 14 14:04:59 2014 (r264458) +++ head/usr.bin/units/units.c Mon Apr 14 14:40:12 2014 (r264459) @@ -724,11 +724,11 @@ main(int argc, char **argv) inhistory = history_init(); el = el_init(argv[0], stdin, stdout, stderr); - el_source(el, NULL); el_set(el, EL_PROMPT, &prompt); el_set(el, EL_EDITOR, "emacs"); el_set(el, EL_SIGNAL, 1); el_set(el, EL_HIST, history, inhistory); + el_source(el, NULL); history(inhistory, &ev, H_SETSIZE, 800); if (inhistory == 0) err(1, "Could not initalize history"); From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 16:15:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A88E66A2; Mon, 14 Apr 2014 16:15:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 954991A55; Mon, 14 Apr 2014 16:15:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3EGFBAb016765; Mon, 14 Apr 2014 16:15:11 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EGFBdh016764; Mon, 14 Apr 2014 16:15:11 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404141615.s3EGFBdh016764@svn.freebsd.org> From: Christian Brueffer Date: Mon, 14 Apr 2014 16:15:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264460 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 16:15:11 -0000 Author: brueffer Date: Mon Apr 14 16:15:11 2014 New Revision: 264460 URL: http://svnweb.freebsd.org/changeset/base/264460 Log: Document the xdev* targets. PR: 188519 Submitted by: Idwer Vollering Reviewed by: bapt MFC after: 1 week Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Mon Apr 14 14:40:12 2014 (r264459) +++ head/Makefile Mon Apr 14 16:15:11 2014 (r264460) @@ -32,6 +32,10 @@ # targets - Print a list of supported TARGET/TARGET_ARCH pairs # for world and kernel targets. # toolchains - Build a toolchain for all world and kernel targets. +# xdev - xdev-build + xdev-install for the architecture +# specified with XDEV and XDEV_ARCH. +# xdev-build - Build cross-development tools. +# xdev-install - Install cross-development tools. # # "quick" way to test all kernel builds: # _jflag=`sysctl -n hw.ncpu` From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 16:31:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4200BA78; Mon, 14 Apr 2014 16:31:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DE3A1C45; Mon, 14 Apr 2014 16:31:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3EGVwJF024496; Mon, 14 Apr 2014 16:31:58 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EGVvt4024488; Mon, 14 Apr 2014 16:31:57 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201404141631.s3EGVvt4024488@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 14 Apr 2014 16:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264461 - in head/sys/dev/sfxge: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 16:31:58 -0000 Author: gnn Date: Mon Apr 14 16:31:56 2014 New Revision: 264461 URL: http://svnweb.freebsd.org/changeset/base/264461 Log: Commit various fixes for the SolarFlare drivers, in particular this set of patches fixes support for systems with > 32 cores. Details include sfxge: RXQ index (not label) comes from FW in flush done/failed events Change the second argument name of the efx_rxq_flush_done_ev_t and efx_rxq_flush_failed_ev_t prototypes to highlight that RXQ index (not label) comes from FW in flush done and failed events. sfxge: TXQ index (not label) comes from FW in flush done event Change the second argument name of the efx_txq_flush_done_ev_t prototype to highlight that TXQ index (not label) comes from FW in flush done event. sfxge: use TXQ type as label to support more than 32 TXQs There are 3 TXQs in event queue 0 and 1 TXQ (with TCP/UDP checksum offload) in all other event queues. Submitted by: Andrew Rybchenko Sponsored by: Solarflare Communications, Inc. Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_ev.c head/sys/dev/sfxge/common/efx_tx.c head/sys/dev/sfxge/sfxge_ev.c head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Mon Apr 14 16:15:11 2014 (r264460) +++ head/sys/dev/sfxge/common/efx.h Mon Apr 14 16:31:56 2014 (r264461) @@ -1360,17 +1360,17 @@ typedef __checkReturn boolean_t typedef __checkReturn boolean_t (*efx_rxq_flush_done_ev_t)( __in_opt void *arg, - __in uint32_t label); + __in uint32_t rxq_index); typedef __checkReturn boolean_t (*efx_rxq_flush_failed_ev_t)( __in_opt void *arg, - __in uint32_t label); + __in uint32_t rxq_index); typedef __checkReturn boolean_t (*efx_txq_flush_done_ev_t)( __in_opt void *arg, - __in uint32_t label); + __in uint32_t txq_index); typedef __checkReturn boolean_t (*efx_software_ev_t)( Modified: head/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- head/sys/dev/sfxge/common/efx_ev.c Mon Apr 14 16:15:11 2014 (r264460) +++ head/sys/dev/sfxge/common/efx_ev.c Mon Apr 14 16:31:56 2014 (r264461) @@ -407,24 +407,24 @@ efx_ev_driver( switch (EFX_QWORD_FIELD(*eqp, FSF_AZ_DRIVER_EV_SUBCODE)) { case FSE_AZ_TX_DESCQ_FLS_DONE_EV: { - uint32_t label; + uint32_t txq_index; EFX_EV_QSTAT_INCR(eep, EV_DRIVER_TX_DESCQ_FLS_DONE); - label = EFX_QWORD_FIELD(*eqp, FSF_AZ_DRIVER_EV_SUBDATA); + txq_index = EFX_QWORD_FIELD(*eqp, FSF_AZ_DRIVER_EV_SUBDATA); - EFSYS_PROBE1(tx_descq_fls_done, uint32_t, label); + EFSYS_PROBE1(tx_descq_fls_done, uint32_t, txq_index); EFSYS_ASSERT(eecp->eec_txq_flush_done != NULL); - should_abort = eecp->eec_txq_flush_done(arg, label); + should_abort = eecp->eec_txq_flush_done(arg, txq_index); break; } case FSE_AZ_RX_DESCQ_FLS_DONE_EV: { - uint32_t label; + uint32_t rxq_index; uint32_t failed; - label = EFX_QWORD_FIELD(*eqp, FSF_AZ_DRIVER_EV_RX_DESCQ_ID); + rxq_index = EFX_QWORD_FIELD(*eqp, FSF_AZ_DRIVER_EV_RX_DESCQ_ID); failed = EFX_QWORD_FIELD(*eqp, FSF_AZ_DRIVER_EV_RX_FLUSH_FAIL); EFSYS_ASSERT(eecp->eec_rxq_flush_done != NULL); @@ -433,15 +433,15 @@ efx_ev_driver( if (failed) { EFX_EV_QSTAT_INCR(eep, EV_DRIVER_RX_DESCQ_FLS_FAILED); - EFSYS_PROBE1(rx_descq_fls_failed, uint32_t, label); + EFSYS_PROBE1(rx_descq_fls_failed, uint32_t, rxq_index); - should_abort = eecp->eec_rxq_flush_failed(arg, label); + should_abort = eecp->eec_rxq_flush_failed(arg, rxq_index); } else { EFX_EV_QSTAT_INCR(eep, EV_DRIVER_RX_DESCQ_FLS_DONE); - EFSYS_PROBE1(rx_descq_fls_done, uint32_t, label); + EFSYS_PROBE1(rx_descq_fls_done, uint32_t, rxq_index); - should_abort = eecp->eec_rxq_flush_done(arg, label); + should_abort = eecp->eec_rxq_flush_done(arg, rxq_index); } break; Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Mon Apr 14 16:15:11 2014 (r264460) +++ head/sys/dev/sfxge/common/efx_tx.c Mon Apr 14 16:31:56 2014 (r264461) @@ -290,7 +290,7 @@ efx_tx_qcreate( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX); EFX_STATIC_ASSERT(EFX_EV_TX_NLABELS == (1 << FRF_AZ_TX_DESCQ_LABEL_WIDTH)); - EFSYS_ASSERT3U(label, <, EFX_EV_TX_NLABELS); + /* EFSYS_ASSERT3U(label, <, EFX_EV_TX_NLABELS);*/ EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <, encp->enc_txq_limit); if (!ISP2(n) || !(n & EFX_TXQ_NDESCS_MASK)) { Modified: head/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- head/sys/dev/sfxge/sfxge_ev.c Mon Apr 14 16:15:11 2014 (r264460) +++ head/sys/dev/sfxge/sfxge_ev.c Mon Apr 14 16:31:56 2014 (r264461) @@ -155,17 +155,18 @@ sfxge_ev_exception(void *arg, uint32_t c } static boolean_t -sfxge_ev_rxq_flush_done(void *arg, uint32_t label) +sfxge_ev_rxq_flush_done(void *arg, uint32_t rxq_index) { struct sfxge_evq *evq; struct sfxge_softc *sc; struct sfxge_rxq *rxq; unsigned int index; + unsigned int label; uint16_t magic; evq = (struct sfxge_evq *)arg; sc = evq->sc; - rxq = sc->rxq[label]; + rxq = sc->rxq[rxq_index]; KASSERT(rxq != NULL, ("rxq == NULL")); @@ -173,6 +174,7 @@ sfxge_ev_rxq_flush_done(void *arg, uint3 index = rxq->index; evq = sc->evq[index]; + label = rxq_index; KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != level")); magic = SFXGE_MAGIC_RX_QFLUSH_DONE | label; @@ -185,17 +187,18 @@ sfxge_ev_rxq_flush_done(void *arg, uint3 } static boolean_t -sfxge_ev_rxq_flush_failed(void *arg, uint32_t label) +sfxge_ev_rxq_flush_failed(void *arg, uint32_t rxq_index) { struct sfxge_evq *evq; struct sfxge_softc *sc; struct sfxge_rxq *rxq; unsigned int index; + unsigned int label; uint16_t magic; evq = (struct sfxge_evq *)arg; sc = evq->sc; - rxq = sc->rxq[label]; + rxq = sc->rxq[rxq_index]; KASSERT(rxq != NULL, ("rxq == NULL")); @@ -203,6 +206,7 @@ sfxge_ev_rxq_flush_failed(void *arg, uin index = rxq->index; evq = sc->evq[index]; + label = rxq_index; KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != label")); magic = SFXGE_MAGIC_RX_QFLUSH_FAILED | label; @@ -214,18 +218,27 @@ sfxge_ev_rxq_flush_failed(void *arg, uin return (B_FALSE); } +static struct sfxge_txq * +sfxge_get_txq_by_label(struct sfxge_evq *evq, enum sfxge_txq_type label) +{ + unsigned int index; + + KASSERT((evq->index == 0 && label < SFXGE_TXQ_NTYPES) || + (label == SFXGE_TXQ_IP_TCP_UDP_CKSUM), ("unexpected txq label")); + index = (evq->index == 0) ? label : (evq->index - 1 + SFXGE_TXQ_NTYPES); + return evq->sc->txq[index]; +} + static boolean_t sfxge_ev_tx(void *arg, uint32_t label, uint32_t id) { struct sfxge_evq *evq; - struct sfxge_softc *sc; struct sfxge_txq *txq; unsigned int stop; unsigned int delta; evq = (struct sfxge_evq *)arg; - sc = evq->sc; - txq = sc->txq[label]; + txq = sfxge_get_txq_by_label(evq, label); KASSERT(txq != NULL, ("txq == NULL")); KASSERT(evq->index == txq->evq_index, @@ -256,16 +269,17 @@ done: } static boolean_t -sfxge_ev_txq_flush_done(void *arg, uint32_t label) +sfxge_ev_txq_flush_done(void *arg, uint32_t txq_index) { struct sfxge_evq *evq; struct sfxge_softc *sc; struct sfxge_txq *txq; + unsigned int label; uint16_t magic; evq = (struct sfxge_evq *)arg; sc = evq->sc; - txq = sc->txq[label]; + txq = sc->txq[txq_index]; KASSERT(txq != NULL, ("txq == NULL")); KASSERT(txq->init_state == SFXGE_TXQ_INITIALIZED, @@ -274,6 +288,7 @@ sfxge_ev_txq_flush_done(void *arg, uint3 /* Resend a software event on the correct queue */ evq = sc->evq[txq->evq_index]; + label = txq->type; KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != label")); magic = SFXGE_MAGIC_TX_QFLUSH_DONE | label; @@ -330,7 +345,7 @@ sfxge_ev_software(void *arg, uint16_t ma break; } case SFXGE_MAGIC_TX_QFLUSH_DONE: { - struct sfxge_txq *txq = sc->txq[label]; + struct sfxge_txq *txq = sfxge_get_txq_by_label(evq, label); KASSERT(txq != NULL, ("txq == NULL")); KASSERT(evq->index == txq->evq_index, Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Mon Apr 14 16:15:11 2014 (r264460) +++ head/sys/dev/sfxge/sfxge_tx.c Mon Apr 14 16:31:56 2014 (r264461) @@ -27,6 +27,21 @@ * SUCH DAMAGE. */ +/* Theory of operation: + * + * Tx queues allocation and mapping + * + * One Tx queue with enabled checksum offload is allocated per Rx channel + * (event queue). Also 2 Tx queues (one without checksum offload and one + * with IP checksum offload only) are allocated and bound to event queue 0. + * sfxge_txq_type is used as Tx queue label. + * + * So, event queue plus label mapping to Tx queue index is: + * if event queue index is 0, TxQ-index = TxQ-label * [0..SFXGE_TXQ_NTYPES) + * else TxQ-index = SFXGE_TXQ_NTYPES + EvQ-index - 1 + * See sfxge_get_txq_by_label() sfxge_ev.c + */ + #include __FBSDID("$FreeBSD$"); @@ -1179,7 +1194,7 @@ sfxge_tx_qstart(struct sfxge_softc *sc, } /* Create the common code transmit queue. */ - if ((rc = efx_tx_qcreate(sc->enp, index, index, esmp, + if ((rc = efx_tx_qcreate(sc->enp, index, txq->type, esmp, SFXGE_NDESCS, txq->buf_base_id, flags, evq->common, &txq->common)) != 0) goto fail; From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 16:43:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7AF78E49; Mon, 14 Apr 2014 16:43:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E0721D78; Mon, 14 Apr 2014 16:43:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3EGhbht028744; Mon, 14 Apr 2014 16:43:37 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EGhbMn028743; Mon, 14 Apr 2014 16:43:37 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404141643.s3EGhbMn028743@svn.freebsd.org> From: Eitan Adler Date: Mon, 14 Apr 2014 16:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264462 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 16:43:37 -0000 Author: eadler Date: Mon Apr 14 16:43:36 2014 New Revision: 264462 URL: http://svnweb.freebsd.org/changeset/base/264462 Log: units(1): support reading multiple units files GNU units(1) supports reading up to 25 -f options. We support an arbitrary number. Modified: head/usr.bin/units/units.c Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Mon Apr 14 16:31:56 2014 (r264461) +++ head/usr.bin/units/units.c Mon Apr 14 16:43:36 2014 (r264462) @@ -153,8 +153,6 @@ readunits(const char *userfile) errx(1, "can't find units file '%s'", UNITSFILE); } } - if (cap_enter() < 0 && errno != ENOSYS) - err(1, "unable to enter capability mode"); cap_rights_init(&unitfilerights, CAP_READ, CAP_FSTAT); if (cap_rights_limit(fileno(unitfile), &unitfilerights) < 0 && errno != ENOSYS) @@ -693,19 +691,23 @@ main(int argc, char **argv) const char * havestr; const char * wantstr; int optchar; - char *userfile; bool quiet; + bool readfile; History *inhistory; EditLine *el; HistEvent ev; int inputsz; - userfile = NULL; quiet = false; + readfile = false; while ((optchar = getopt(argc, argv, "Vqf:")) != -1) { switch (optchar) { case 'f': - userfile = optarg; + readfile = true; + if (strlen(optarg) == 0) + readunits(NULL); + else + readunits(optarg); break; case 'q': quiet = true; @@ -719,8 +721,8 @@ main(int argc, char **argv) } } - if (optind != argc - 2 && optind != argc) - usage(); + if (!readfile) + readunits(NULL); inhistory = history_init(); el = el_init(argv[0], stdin, stdout, stderr); @@ -732,8 +734,9 @@ main(int argc, char **argv) history(inhistory, &ev, H_SETSIZE, 800); if (inhistory == 0) err(1, "Could not initalize history"); - - readunits(userfile); + + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "unable to enter capability mode"); if (optind == argc - 2) { havestr = argv[optind]; From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 16:55:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BB89214; Mon, 14 Apr 2014 16:55:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EA5A104A; Mon, 14 Apr 2014 16:55:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3EGtAcK033040; Mon, 14 Apr 2014 16:55:10 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EGtAbM033038; Mon, 14 Apr 2014 16:55:10 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404141655.s3EGtAbM033038@svn.freebsd.org> From: Eitan Adler Date: Mon, 14 Apr 2014 16:55:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264463 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 16:55:10 -0000 Author: eadler Date: Mon Apr 14 16:55:09 2014 New Revision: 264463 URL: http://svnweb.freebsd.org/changeset/base/264463 Log: units(1): Add U option For increased compatibility with GNU units: support a -U option which tests for the existence of the default units file and prints it to the screen. Modified: head/usr.bin/units/units.1 head/usr.bin/units/units.c Modified: head/usr.bin/units/units.1 ============================================================================== --- head/usr.bin/units/units.1 Mon Apr 14 16:43:36 2014 (r264462) +++ head/usr.bin/units/units.1 Mon Apr 14 16:55:09 2014 (r264463) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd July 14, 1993 +.Dd April 14, 2014 .Dt UNITS 1 .Os .Sh NAME @@ -8,7 +8,7 @@ .Sh SYNOPSIS .Nm .Op Fl f Ar filename -.Op Fl qV +.Op Fl qUV .Op Ar from-unit to-unit .Sh OPTIONS The following options are available: @@ -18,6 +18,11 @@ Specify the name of the units data file .It Fl q Suppress prompting of the user for units and the display of statistics about the number of units loaded. +.It Fl U +If the default unit file exists prints its location. If not, print +.Qo +Units data file not found +.Qc .It Fl V Print the version number, usage, and then exit. .It Ar from-unit to-unit Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Mon Apr 14 16:43:36 2014 (r264462) +++ head/usr.bin/units/units.c Mon Apr 14 16:55:09 2014 (r264463) @@ -678,7 +678,7 @@ void usage(void) { fprintf(stderr, - "usage: units [-f unitsfile] [-q] [-v] [from-unit to-unit]\n"); + "usage: units [-f unitsfile] [-UVq] [from-unit to-unit]\n"); exit(3); } @@ -700,7 +700,7 @@ main(int argc, char **argv) quiet = false; readfile = false; - while ((optchar = getopt(argc, argv, "Vqf:")) != -1) { + while ((optchar = getopt(argc, argv, "UVqf:")) != -1) { switch (optchar) { case 'f': readfile = true; @@ -712,6 +712,13 @@ main(int argc, char **argv) case 'q': quiet = true; break; + case 'U': + if (access(UNITSFILE, F_OK) == 0) + printf("%s\n", UNITSFILE); + else + printf("Units data file not found"); + exit(0); + break; case 'V': fprintf(stderr, "FreeBSD units\n"); usage(); From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 18:07:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21BD5A81; Mon, 14 Apr 2014 18:07:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E906417B7; Mon, 14 Apr 2014 18:07:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3EI70sA062829; Mon, 14 Apr 2014 18:07:00 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EI70lg062823; Mon, 14 Apr 2014 18:07:00 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201404141807.s3EI70lg062823@svn.freebsd.org> From: Bryan Drewery Date: Mon, 14 Apr 2014 18:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264465 - head/share/skel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 18:07:01 -0000 Author: bdrewery Date: Mon Apr 14 18:07:00 2014 New Revision: 264465 URL: http://svnweb.freebsd.org/changeset/base/264465 Log: Prefer /etc/login.conf for some of these environment values. PR: conf/186085 Reported by: Glen Neff MFC after: 2 weeks Sponsored by: EMC Modified: head/share/skel/dot.cshrc head/share/skel/dot.profile Modified: head/share/skel/dot.cshrc ============================================================================== --- head/share/skel/dot.cshrc Mon Apr 14 17:54:01 2014 (r264464) +++ head/share/skel/dot.cshrc Mon Apr 14 18:07:00 2014 (r264465) @@ -12,14 +12,15 @@ alias la ls -aF alias lf ls -FA alias ll ls -lAF +# These are normally set through /etc/login.conf. You may override them here +# if wanted. +# set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) +# setenv BLOCKSIZE K # A righteous umask -umask 22 - -set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) +# umask 22 setenv EDITOR vi setenv PAGER more -setenv BLOCKSIZE K if ($?prompt) then # An interactive shell -- set some stuff up Modified: head/share/skel/dot.profile ============================================================================== --- head/share/skel/dot.profile Mon Apr 14 17:54:01 2014 (r264464) +++ head/share/skel/dot.profile Mon Apr 14 18:07:00 2014 (r264465) @@ -5,15 +5,16 @@ # see also sh(1), environ(7). # -# remove /usr/games if you want -PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH +# These are normally set through /etc/login.conf. You may override them here +# if wanted. +# PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH +# BLOCKSIZE=K; export BLOCKSIZE # Setting TERM is normally done through /etc/ttys. Do only override # if you're sure that you'll never log in via telnet or xterm or a # serial line. # TERM=xterm; export TERM -BLOCKSIZE=K; export BLOCKSIZE EDITOR=vi; export EDITOR PAGER=more; export PAGER From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 18:11:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A37DCAA; Mon, 14 Apr 2014 18:11:50 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A316A188E; Mon, 14 Apr 2014 18:11:49 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.8/8.14.8) with ESMTP id s3EIBdtB054950; Mon, 14 Apr 2014 21:11:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s3EIBdtB054950 Received: (from kostik@localhost) by tom.home (8.14.8/8.14.8/Submit) id s3EIBdm1054949; Mon, 14 Apr 2014 21:11:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 14 Apr 2014 21:11:39 +0300 From: Konstantin Belousov To: Christian Brueffer Subject: Re: svn commit: r264422 - head/sys/kern Message-ID: <20140414181139.GL4016@kib.kiev.ua> References: <201404132123.s3DLNGvJ048359@svn.freebsd.org> <20140413214633.GF4016@kib.kiev.ua> <534B07EA.7080400@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="u3bvv0EcKsvvYeex" Content-Disposition: inline In-Reply-To: <534B07EA.7080400@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 18:11:50 -0000 --u3bvv0EcKsvvYeex Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 13, 2014 at 11:55:54PM +0200, Christian Brueffer wrote: > On 4/13/14 11:46 PM, Konstantin Belousov wrote: > > On Sun, Apr 13, 2014 at 09:23:16PM +0000, Christian Brueffer wrote: > >> Author: brueffer > >> Date: Sun Apr 13 21:23:15 2014 > >> New Revision: 264422 > >> URL: http://svnweb.freebsd.org/changeset/base/264422 > >> > >> Log: > >> Free buf after usage. > >> =20 > >> CID: 1199377 > >> Found with: Coverity Prevent(tm) > >> MFC after: 1 week > >> > >> Modified: > >> head/sys/kern/imgact_elf.c > >> > >> Modified: head/sys/kern/imgact_elf.c > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >> --- head/sys/kern/imgact_elf.c Sun Apr 13 21:13:33 2014 (r264421) > >> +++ head/sys/kern/imgact_elf.c Sun Apr 13 21:23:15 2014 (r264422) > >> @@ -1746,8 +1746,10 @@ __elfN(note_threadmd)(void *arg, struct=20 > >> size =3D 0; > >> __elfN(dump_thread)(td, buf, &size); > >> KASSERT(*sizep =3D=3D size, ("invalid size")); > >> - if (size !=3D 0 && sb !=3D NULL) > >> + if (size !=3D 0 && sb !=3D NULL) { > >> sbuf_bcat(sb, buf, size); > >> + free(buf, M_TEMP); > >> + } > >> *sizep =3D size; > >> } > >> =20 > > Why conditioning free() on size !=3D 0 ? > > IMO free(buf) must be done always, since buf is initialized for the case > > when malloc() is not called. > >=20 >=20 > The corresponding malloc() call is behind a similar conditional, so it > seemed good to be symmetrical here (since buf if NULL otherwise anyway). >=20 > I can change it to call free() unconditionally if you prefer, I don't > mind either way. Yes, I think that unconditional call would be better, due to strange interface of dump_thread. It could modify the size, but for now this is effectively disallowed by KASSERT(). Also, while there, I would change the code buf =3D NULL; if (size !=3D 0 && sb !=3D NULL) buf =3D malloc(size, M_TEMP, M_ZERO | M_WAITOK); to avoid useless initialization if buf, like this: if (size !=3D 0 && sb !=3D NULL) buf =3D malloc(size, M_TEMP, M_ZERO | M_WAITOK); else buf =3D NULL; --u3bvv0EcKsvvYeex Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJTTCTbAAoJEJDCuSvBvK1B5bYQAJ/HwLayPx/qmBrKaP2M4+jK W0Ziib27ZWUEgwl+GNXHQN8HtPM6uauHFx9eWh0Ymdajsh+3A/Zue2/vtz6XzUfL HBfyB/WGXjRenR07kC6JkJS9fWJDUjF/N2RcwQxStOS71FIkhZQtCOeGYPp2OHmw NG9e+cl48lwgegJaYCyCesl0nb4fxYRw6hzKTEy8MWzAqKd8BtKJwy71LQLroa3n 9f+EwSM2dL9tnL/WalJkiV5+fOH2hfkSLPx7hpkJakOvIKQ8eoAHnEQZkhmblP52 LzS9p5tF8cxQlcPaSykwQ1f5UF1ZJixkTmE27xdOIpjA0T54Zz+RAtq280DlfZSY RMB4bAIjaPxRQ9St0Iz8cAyRBpvDSsRdNw9tgGe/yupCs65QGoWNEIibskY9tP/G L3JPuv8mZEPkZP0UI6qRD0aGcSu/jm6/LoUlT7+rTIAqXtR3TRlcLNxbdJl9tWh+ Gax5+buW2t98P4ONIxCAITH9aBgR0B2iKKjikg3oZMi2bKyBK12zcEykwb05oSTi kogl6RKtDJ212UzXCXx1kodvbXOOEdUGNB7azoD+tjSXaKsN4/4PC+FfW5EtDcSD VgPvtXunDAxEnzrc7mZ4K9pb2EPHQkhKomSs4k435TOxZ2fi54sjFd4cT+z3SjYJ /bzthR73n14xCysLFPlQ =ft3Y -----END PGP SIGNATURE----- --u3bvv0EcKsvvYeex-- From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 18:14:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A21C5E20; Mon, 14 Apr 2014 18:14:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F26F18B0; Mon, 14 Apr 2014 18:14:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3EIE9hh066622; Mon, 14 Apr 2014 18:14:09 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EIE9Jw066621; Mon, 14 Apr 2014 18:14:09 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404141814.s3EIE9Jw066621@svn.freebsd.org> From: Glen Barber Date: Mon, 14 Apr 2014 18:14:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264466 - head/lib/libcapsicum X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 18:14:09 -0000 Author: gjb Date: Mon Apr 14 18:14:09 2014 New Revision: 264466 URL: http://svnweb.freebsd.org/changeset/base/264466 Log: Fix err() usage in libcapsicum(3) example. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/lib/libcapsicum/libcapsicum.3 Modified: head/lib/libcapsicum/libcapsicum.3 ============================================================================== --- head/lib/libcapsicum/libcapsicum.3 Mon Apr 14 18:07:00 2014 (r264465) +++ head/lib/libcapsicum/libcapsicum.3 Mon Apr 14 18:14:09 2014 (r264466) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 26, 2013 +.Dd April 14, 2014 .Dt LIBCAPSICUM 3 .Os .Sh NAME @@ -253,7 +253,7 @@ limits = nvlist_create(0); nvlist_add_string(limits, "type", "ADDR"); nvlist_add_number(limits, "family", (uint64_t)AF_INET); if (cap_limit_set(capdns, limits) < 0) - err("Unable to limit access to the system.dns service"); + err(1, "Unable to limit access to the system.dns service"); /* Convert IP address in C-string to in_addr. */ if (!inet_aton(ipstr, &ip)) From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 18:38:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B307540; Mon, 14 Apr 2014 18:38:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2757B1A96; Mon, 14 Apr 2014 18:38:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3EIcFaM075611; Mon, 14 Apr 2014 18:38:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EIcEod075609; Mon, 14 Apr 2014 18:38:14 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404141838.s3EIcEod075609@svn.freebsd.org> From: Xin LI Date: Mon, 14 Apr 2014 18:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264467 - in head/cddl/contrib/opensolaris: cmd/zdb lib/libzfs/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 18:38:15 -0000 Author: delphij Date: Mon Apr 14 18:38:14 2014 New Revision: 264467 URL: http://svnweb.freebsd.org/changeset/base/264467 Log: Take into account when zpool history block grows exceeding 128KB in zpool(8) and zdb(8) by growing the buffer on demand with a cap of 1GB (specified in spa_history_create_obj()). PR: bin/186574 Submitted by: Andrew Childs (with changes) MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Apr 14 18:14:09 2014 (r264466) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Apr 14 18:38:14 2014 (r264467) @@ -929,11 +929,16 @@ dump_dtl(vdev_t *vd, int indent) dump_dtl(vd->vdev_child[c], indent + 4); } +/* from spa_history.c: spa_history_create_obj() */ +#define HIS_BUF_LEN_DEF (128 << 10) +#define HIS_BUF_LEN_MAX (1 << 30) + static void dump_history(spa_t *spa) { nvlist_t **events = NULL; - char buf[SPA_MAXBLOCKSIZE]; + char *buf = NULL; + uint64_t bufsize = HIS_BUF_LEN_DEF; uint64_t resid, len, off = 0; uint_t num = 0; int error; @@ -942,8 +947,11 @@ dump_history(spa_t *spa) char tbuf[30]; char internalstr[MAXPATHLEN]; + if ((buf = malloc(bufsize)) == NULL) + (void) fprintf(stderr, "Unable to read history: " + "out of memory\n"); do { - len = sizeof (buf); + len = bufsize; if ((error = spa_history_get(spa, &off, &len, buf)) != 0) { (void) fprintf(stderr, "Unable to read history: " @@ -953,9 +961,26 @@ dump_history(spa_t *spa) if (zpool_history_unpack(buf, len, &resid, &events, &num) != 0) break; - off -= resid; + + /* + * If the history block is too big, double the buffer + * size and try again. + */ + if (resid == len) { + free(buf); + buf = NULL; + + bufsize <<= 1; + if ((bufsize >= HIS_BUF_LEN_MAX) || + ((buf = malloc(bufsize)) == NULL)) { + (void) fprintf(stderr, "Unable to read history: " + "out of memory\n"); + return; + } + } } while (len != 0); + free(buf); (void) printf("\nHistory:\n"); for (int i = 0; i < num; i++) { Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Apr 14 18:14:09 2014 (r264466) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Apr 14 18:38:14 2014 (r264467) @@ -3744,7 +3744,9 @@ zpool_history_unpack(char *buf, uint64_t return (0); } -#define HIS_BUF_LEN (128*1024) +/* from spa_history.c: spa_history_create_obj() */ +#define HIS_BUF_LEN_DEF (128 << 10) +#define HIS_BUF_LEN_MAX (1 << 30) /* * Retrieve the command history of a pool. @@ -3752,21 +3754,24 @@ zpool_history_unpack(char *buf, uint64_t int zpool_get_history(zpool_handle_t *zhp, nvlist_t **nvhisp) { - char buf[HIS_BUF_LEN]; + char *buf = NULL; + uint64_t bufsize = HIS_BUF_LEN_DEF; uint64_t off = 0; nvlist_t **records = NULL; uint_t numrecords = 0; int err, i; + if ((buf = malloc(bufsize)) == NULL) + return (ENOMEM); do { - uint64_t bytes_read = sizeof (buf); + uint64_t bytes_read = bufsize; uint64_t leftover; if ((err = get_history(zhp, buf, &off, &bytes_read)) != 0) break; /* if nothing else was read in, we're at EOF, just return */ - if (!bytes_read) + if (bytes_read == 0) break; if ((err = zpool_history_unpack(buf, bytes_read, @@ -3774,8 +3779,25 @@ zpool_get_history(zpool_handle_t *zhp, n break; off -= leftover; + /* + * If the history block is too big, double the buffer + * size and try again. + */ + if (leftover == bytes_read) { + free(buf); + buf = NULL; + + bufsize <<= 1; + if ((bufsize >= HIS_BUF_LEN_MAX) || + ((buf = malloc(bufsize)) == NULL)) { + err = ENOMEM; + break; + } + } + /* CONSTCOND */ } while (1); + free(buf); if (!err) { verify(nvlist_alloc(nvhisp, NV_UNIQUE_NAME, 0) == 0); From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 19:00:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4C3AC3E; Mon, 14 Apr 2014 19:00:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C58841C9C; Mon, 14 Apr 2014 19:00:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3EJ0L5R084332; Mon, 14 Apr 2014 19:00:21 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EJ0LiR084329; Mon, 14 Apr 2014 19:00:21 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201404141900.s3EJ0LiR084329@svn.freebsd.org> From: Tycho Nightingale Date: Mon, 14 Apr 2014 19:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264468 - in head: lib/libvmmapi sys/amd64/vmm/io usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 19:00:22 -0000 Author: tychon Date: Mon Apr 14 19:00:20 2014 New Revision: 264468 URL: http://svnweb.freebsd.org/changeset/base/264468 Log: Add support for emulating the slave PIC. Reviewed by: grehan, jhb Approved by: grehan (co-mentor) Modified: head/lib/libvmmapi/vmmapi.h head/sys/amd64/vmm/io/vatpic.c head/usr.sbin/bhyve/pm.c Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Mon Apr 14 18:38:14 2014 (r264467) +++ head/lib/libvmmapi/vmmapi.h Mon Apr 14 19:00:20 2014 (r264468) @@ -72,9 +72,9 @@ int vm_ioapic_assert_irq(struct vmctx *c int vm_ioapic_deassert_irq(struct vmctx *ctx, int irq); int vm_ioapic_pulse_irq(struct vmctx *ctx, int irq); int vm_ioapic_pincount(struct vmctx *ctx, int *pincount); +int vm_isa_assert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); int vm_isa_deassert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); int vm_isa_pulse_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); -int vm_isa_pulse_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); int vm_inject_nmi(struct vmctx *ctx, int vcpu); int vm_capability_name2type(const char *capname); const char *vm_capability_type2name(int type); Modified: head/sys/amd64/vmm/io/vatpic.c ============================================================================== --- head/sys/amd64/vmm/io/vatpic.c Mon Apr 14 18:38:14 2014 (r264467) +++ head/sys/amd64/vmm/io/vatpic.c Mon Apr 14 19:00:20 2014 (r264468) @@ -67,6 +67,7 @@ struct atpic { bool aeoi; bool poll; bool rotate; + bool sfn; /* special fully-nested mode */ int irq_base; uint8_t request; /* Interrupt Request Register (IIR) */ @@ -75,6 +76,8 @@ struct atpic { int acnt[8]; /* sum of pin asserts and deasserts */ int priority; /* current pin priority */ + + bool intr_raised; }; struct vatpic { @@ -82,8 +85,6 @@ struct vatpic { struct mtx mtx; struct atpic atpic[2]; uint8_t elc[2]; - - bool intr_raised; }; #define VATPIC_CTR0(vatpic, fmt) \ @@ -101,6 +102,7 @@ struct vatpic { #define VATPIC_CTR4(vatpic, fmt, a1, a2, a3, a4) \ VM_CTR4((vatpic)->vm, fmt, a1, a2, a3, a4) +static void vatpic_set_pinstate(struct vatpic *vatpic, int pin, bool newstate); static __inline int vatpic_get_highest_isrpin(struct atpic *atpic) @@ -122,13 +124,23 @@ vatpic_get_highest_isrpin(struct atpic * static __inline int vatpic_get_highest_irrpin(struct atpic *atpic) { + int serviced; int bit, pin; int i, j; + /* + * In 'Special Fully-Nested Mode' when an interrupt request from + * a slave is in service, the slave is not locked out from the + * master's priority logic. + */ + serviced = atpic->service; + if (atpic->sfn) + serviced &= ~(1 << 2); + for (i = 0; i <= 7; i++) { pin = ((i + 7 - atpic->priority) & 0x7); bit = (1 << pin); - if (atpic->service & bit) + if (serviced & bit) break; } @@ -150,14 +162,35 @@ vatpic_notify_intr(struct vatpic *vatpic KASSERT(VATPIC_LOCKED(vatpic), ("vatpic_notify_intr not locked")); - if (vatpic->intr_raised == true) - return; + /* + * First check the slave. + */ + atpic = &vatpic->atpic[1]; + if (!atpic->intr_raised && + (pin = vatpic_get_highest_irrpin(atpic)) != -1) { + VATPIC_CTR4(vatpic, "atpic slave notify pin = %d " + "(imr 0x%x irr 0x%x isr 0x%x)", pin, + atpic->mask, atpic->request, atpic->service); - /* XXX master only */ - atpic = &vatpic->atpic[0]; + /* + * Cascade the request from the slave to the master. + */ + atpic->intr_raised = true; + vatpic_set_pinstate(vatpic, 2, true); + vatpic_set_pinstate(vatpic, 2, false); + } else { + VATPIC_CTR3(vatpic, "atpic slave no eligible interrupts " + "(imr 0x%x irr 0x%x isr 0x%x)", + atpic->mask, atpic->request, atpic->service); + } - if ((pin = vatpic_get_highest_irrpin(atpic)) != -1) { - VATPIC_CTR4(vatpic, "atpic notify pin = %d " + /* + * Then check the master. + */ + atpic = &vatpic->atpic[0]; + if (!atpic->intr_raised && + (pin = vatpic_get_highest_irrpin(atpic)) != -1) { + VATPIC_CTR4(vatpic, "atpic master notify pin = %d " "(imr 0x%x irr 0x%x isr 0x%x)", pin, atpic->mask, atpic->request, atpic->service); @@ -183,11 +216,11 @@ vatpic_notify_intr(struct vatpic *vatpic * programmed as ExtINT to indicate that the PIC is * the source of the interrupt. */ + atpic->intr_raised = true; lapic_set_local_intr(vatpic->vm, -1, APIC_LVT_LINT0); vioapic_pulse_irq(vatpic->vm, 0); - vatpic->intr_raised = true; } else { - VATPIC_CTR3(vatpic, "atpic no eligible interrupts " + VATPIC_CTR3(vatpic, "atpic master no eligible interrupts " "(imr 0x%x irr 0x%x isr 0x%x)", atpic->mask, atpic->request, atpic->service); } @@ -422,7 +455,6 @@ vatpic_pending_intr(struct vm *vm, int * vatpic = vm_atpic(vm); - /* XXX master only */ atpic = &vatpic->atpic[0]; VATPIC_LOCK(vatpic); @@ -430,37 +462,53 @@ vatpic_pending_intr(struct vm *vm, int * pin = vatpic_get_highest_irrpin(atpic); if (pin == -1) pin = 7; + if (pin == 2) { + atpic = &vatpic->atpic[1]; + pin = vatpic_get_highest_irrpin(atpic); + } *vecptr = atpic->irq_base + pin; VATPIC_UNLOCK(vatpic); } +static void +vatpic_pin_accepted(struct atpic *atpic, int pin) +{ + atpic->intr_raised = false; + + if (atpic->acnt[pin] == 0) + atpic->request &= ~(1 << pin); + + if (atpic->aeoi == true) { + if (atpic->rotate == true) + atpic->priority = pin; + } else { + atpic->service |= (1 << pin); + } +} + void vatpic_intr_accepted(struct vm *vm, int vector) { struct vatpic *vatpic; - struct atpic *atpic; int pin; vatpic = vm_atpic(vm); - /* XXX master only */ - atpic = &vatpic->atpic[0]; - VATPIC_LOCK(vatpic); - vatpic->intr_raised = false; pin = vector & 0x7; - if (atpic->acnt[pin] == 0) - atpic->request &= ~(1 << pin); - - if (atpic->aeoi == true) { - if (atpic->rotate == true) - atpic->priority = pin; + if ((vector & ~0x7) == vatpic->atpic[1].irq_base) { + vatpic_pin_accepted(&vatpic->atpic[1], pin); + /* + * If this vector originated from the slave, + * accept the cascaded interrupt too. + */ + vatpic_pin_accepted(&vatpic->atpic[0], 2); } else { - atpic->service |= (1 << pin); + vatpic_pin_accepted(&vatpic->atpic[0], pin); } vatpic_notify_intr(vatpic); @@ -468,47 +516,43 @@ vatpic_intr_accepted(struct vm *vm, int VATPIC_UNLOCK(vatpic); } -int -vatpic_master_handler(void *vm, int vcpuid, struct vm_exit *vmexit) +static int +vatpic_read(struct vatpic *vatpic, struct atpic *atpic, struct vm_exit *vmexit) { - struct vatpic *vatpic; - struct atpic *atpic; - int error; - uint8_t val; - - error = 0; - vatpic = vm_atpic(vm); - atpic = &vatpic->atpic[0]; + VATPIC_LOCK(vatpic); - if (vmexit->u.inout.bytes != 1) + if (atpic->poll) { + VATPIC_CTR0(vatpic, "vatpic polled mode not supported"); + VATPIC_UNLOCK(vatpic); return (-1); - - if (vmexit->u.inout.in) { - VATPIC_LOCK(vatpic); - if (atpic->poll) { - VATPIC_CTR0(vatpic, "vatpic polled mode not " - "supported"); - VATPIC_UNLOCK(vatpic); - return (-1); + } else { + if (vmexit->u.inout.port & ICU_IMR_OFFSET) { + /* read interrrupt mask register */ + vmexit->u.inout.eax = atpic->mask; } else { - if (vmexit->u.inout.port & ICU_IMR_OFFSET) { - /* read interrrupt mask register */ - vmexit->u.inout.eax = atpic->mask; + if (atpic->rd_cmd_reg == OCW3_RIS) { + /* read interrupt service register */ + vmexit->u.inout.eax = atpic->service; } else { - if (atpic->rd_cmd_reg == OCW3_RIS) { - /* read interrupt service register */ - vmexit->u.inout.eax = atpic->service; - } else { - /* read interrupt request register */ - vmexit->u.inout.eax = atpic->request; - } + /* read interrupt request register */ + vmexit->u.inout.eax = atpic->request; } } - VATPIC_UNLOCK(vatpic); - - return (0); } + VATPIC_UNLOCK(vatpic); + + return (0); + +} + +static int +vatpic_write(struct vatpic *vatpic, struct atpic *atpic, + struct vm_exit *vmexit) +{ + int error; + uint8_t val; + val = vmexit->u.inout.eax; VATPIC_LOCK(vatpic); @@ -550,22 +594,41 @@ vatpic_master_handler(void *vm, int vcpu } int -vatpic_slave_handler(void *vm, int vcpuid, struct vm_exit *vmexit) +vatpic_master_handler(void *vm, int vcpuid, struct vm_exit *vmexit) { + struct vatpic *vatpic; + struct atpic *atpic; + + vatpic = vm_atpic(vm); + atpic = &vatpic->atpic[0]; + if (vmexit->u.inout.bytes != 1) return (-1); if (vmexit->u.inout.in) { - if (vmexit->u.inout.port & ICU_IMR_OFFSET) { - /* all interrupts masked */ - vmexit->u.inout.eax = 0xff; - } else { - vmexit->u.inout.eax = 0x00; - } + return (vatpic_read(vatpic, atpic, vmexit)); } - /* Pretend all accesses to the slave 8259 are alright */ - return (0); + return (vatpic_write(vatpic, atpic, vmexit)); +} + +int +vatpic_slave_handler(void *vm, int vcpuid, struct vm_exit *vmexit) +{ + struct vatpic *vatpic; + struct atpic *atpic; + + vatpic = vm_atpic(vm); + atpic = &vatpic->atpic[1]; + + if (vmexit->u.inout.bytes != 1) + return (-1); + + if (vmexit->u.inout.in) { + return (vatpic_read(vatpic, atpic, vmexit)); + } + + return (vatpic_write(vatpic, atpic, vmexit)); } int @@ -580,6 +643,8 @@ vatpic_elc_handler(void *vm, int vcpuid, if (vmexit->u.inout.bytes != 1) return (-1); + VATPIC_LOCK(vatpic); + if (vmexit->u.inout.in) { if (is_master) vmexit->u.inout.eax = vatpic->elc[0]; @@ -602,6 +667,8 @@ vatpic_elc_handler(void *vm, int vcpuid, vatpic->elc[1] = (vmexit->u.inout.eax & 0xde); } + VATPIC_UNLOCK(vatpic); + return (0); } Modified: head/usr.sbin/bhyve/pm.c ============================================================================== --- head/usr.sbin/bhyve/pm.c Mon Apr 14 18:38:14 2014 (r264467) +++ head/usr.sbin/bhyve/pm.c Mon Apr 14 19:00:20 2014 (r264468) @@ -83,7 +83,7 @@ sci_assert(struct vmctx *ctx) if (sci_active) return; - vm_ioapic_assert_irq(ctx, SCI_INT); + vm_isa_assert_irq(ctx, SCI_INT, SCI_INT); sci_active = 1; } @@ -93,7 +93,7 @@ sci_deassert(struct vmctx *ctx) if (!sci_active) return; - vm_ioapic_deassert_irq(ctx, SCI_INT); + vm_isa_deassert_irq(ctx, SCI_INT, SCI_INT); sci_active = 0; } From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 20:34:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F07E87B6; Mon, 14 Apr 2014 20:34:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC8CE17F7; Mon, 14 Apr 2014 20:34:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3EKYmpH025609; Mon, 14 Apr 2014 20:34:48 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EKYm5H025608; Mon, 14 Apr 2014 20:34:48 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201404142034.s3EKYm5H025608@svn.freebsd.org> From: Rick Macklem Date: Mon, 14 Apr 2014 20:34:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264469 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 20:34:49 -0000 Author: rmacklem Date: Mon Apr 14 20:34:48 2014 New Revision: 264469 URL: http://svnweb.freebsd.org/changeset/base/264469 Log: Lagg did not set the value of if_hw_tsomax, so when lagg was stacked on top of network interfaces that set if_hw_tsomax, tcp_output() would see the default value instead of the value set by the network interface(s). This patch modifies lagg so that it sets if_hw_tsomax to the minimum of the value(s) for the underlying network interfaces. Reviewed by: glebius MFC after: 2 weeks Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Mon Apr 14 19:00:20 2014 (r264468) +++ head/sys/net/if_lagg.c Mon Apr 14 20:34:48 2014 (r264469) @@ -448,6 +448,7 @@ lagg_capabilities(struct lagg_softc *sc) struct lagg_port *lp; int cap = ~0, ena = ~0; u_long hwa = ~0UL; + u_int hw_tsomax = IP_MAXPACKET; /* Initialize to the maximum value. */ LAGG_WLOCK_ASSERT(sc); @@ -456,6 +457,10 @@ lagg_capabilities(struct lagg_softc *sc) cap &= lp->lp_ifp->if_capabilities; ena &= lp->lp_ifp->if_capenable; hwa &= lp->lp_ifp->if_hwassist; + /* Set to the minimum value of the lagg ports. */ + if (lp->lp_ifp->if_hw_tsomax < hw_tsomax && + lp->lp_ifp->if_hw_tsomax > 0) + hw_tsomax = lp->lp_ifp->if_hw_tsomax; } cap = (cap == ~0 ? 0 : cap); ena = (ena == ~0 ? 0 : ena); @@ -463,10 +468,12 @@ lagg_capabilities(struct lagg_softc *sc) if (sc->sc_ifp->if_capabilities != cap || sc->sc_ifp->if_capenable != ena || - sc->sc_ifp->if_hwassist != hwa) { + sc->sc_ifp->if_hwassist != hwa || + sc->sc_ifp->if_hw_tsomax != hw_tsomax) { sc->sc_ifp->if_capabilities = cap; sc->sc_ifp->if_capenable = ena; sc->sc_ifp->if_hwassist = hwa; + sc->sc_ifp->if_hw_tsomax = hw_tsomax; getmicrotime(&sc->sc_ifp->if_lastchange); if (sc->sc_ifflags & IFF_DEBUG) From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 20:51:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CCDDF3D; Mon, 14 Apr 2014 20:51:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5981619E2; Mon, 14 Apr 2014 20:51:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3EKp5Ax031837; Mon, 14 Apr 2014 20:51:05 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EKp581031835; Mon, 14 Apr 2014 20:51:05 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404142051.s3EKp581031835@svn.freebsd.org> From: Eitan Adler Date: Mon, 14 Apr 2014 20:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264470 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 20:51:05 -0000 Author: eadler Date: Mon Apr 14 20:51:04 2014 New Revision: 264470 URL: http://svnweb.freebsd.org/changeset/base/264470 Log: units(1): Add v option: verbose For increased compatibility with GNU units: support a -v option which produces more verbose output when spitting out the answer. GNU -v does additional work in the version, information, and check output which we do not (yet?) replicate. Modified: head/usr.bin/units/units.1 head/usr.bin/units/units.c Modified: head/usr.bin/units/units.1 ============================================================================== --- head/usr.bin/units/units.1 Mon Apr 14 20:34:48 2014 (r264469) +++ head/usr.bin/units/units.1 Mon Apr 14 20:51:04 2014 (r264470) @@ -8,7 +8,7 @@ .Sh SYNOPSIS .Nm .Op Fl f Ar filename -.Op Fl qUV +.Op Fl qvUV .Op Ar from-unit to-unit .Sh OPTIONS The following options are available: @@ -31,6 +31,8 @@ line. The program will not print prompts. It will print out the result of the single specified conversion. +.It Fl v +Print the units in the conversion output. Be more verbose in general. .El .Sh DESCRIPTION The Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Mon Apr 14 20:34:48 2014 (r264469) +++ head/usr.bin/units/units.c Mon Apr 14 20:51:04 2014 (r264470) @@ -76,6 +76,10 @@ static char NULLUNIT[] = ""; static int unitcount; static int prefixcount; +static bool verbose = false; +static const char * havestr; +static const char * wantstr; + char *dupstr(const char *str); void readunits(const char *userfile); @@ -254,7 +258,7 @@ showunit(struct unittype * theunit) int printedslash; int counter = 1; - printf("\t%.8g", theunit->factor); + printf("%.8g", theunit->factor); if (theunit->offset) printf("&%.8g", theunit->offset); for (ptr = theunit->numerator; *ptr; ptr++) { @@ -289,7 +293,7 @@ showunit(struct unittype * theunit) counter = 1; } } - if (counter > 1) + if ( counter > 1) printf("%s%d", powerstring, counter); printf("\n"); } @@ -645,32 +649,50 @@ completereduce(struct unittype * unit) return 0; } - void showanswer(struct unittype * have, struct unittype * want) { + double ans; + if (compareunits(have, want)) { printf("conformability error\n"); + if (verbose) + printf("\t%s = ", havestr); + else + printf("\t"); showunit(have); + if (verbose) + printf("\t%s = ", wantstr); + else + printf("\t"); showunit(want); } else if (have->offset != want->offset) { if (want->quantity) printf("WARNING: conversion of non-proportional quantities.\n"); - printf("\t"); if (have->quantity) - printf("%.8g\n", + printf("\t%.8g\n", (have->factor + have->offset-want->offset)/want->factor); - else - printf(" (-> x*%.8g %+.8g)\n\t (<- y*%.8g %+.8g)\n", + else { + printf("\t (-> x*%.8g %+.8g)\n\t (<- y*%.8g %+.8g)\n", have->factor / want->factor, (have->offset-want->offset)/want->factor, want->factor / have->factor, (want->offset - have->offset)/have->factor); + } + } + else { + ans = have->factor / want->factor; + if (verbose) + printf("\t%s = %.8g * %s\n", havestr, ans, wantstr); + else + printf("\t* %.8g\n", ans); + + if (verbose) + printf("\t%s = (1 / %.8g) * %s\n", havestr, 1/ans, wantstr); + else + printf("\t/ %.8g\n", 1/ans); } - else - printf("\t* %.8g\n\t/ %.8g\n", have->factor / want->factor, - want->factor / have->factor); } @@ -688,8 +710,6 @@ main(int argc, char **argv) { struct unittype have, want; - const char * havestr; - const char * wantstr; int optchar; bool quiet; bool readfile; @@ -700,7 +720,7 @@ main(int argc, char **argv) quiet = false; readfile = false; - while ((optchar = getopt(argc, argv, "UVqf:")) != -1) { + while ((optchar = getopt(argc, argv, "fqvUV:")) != -1) { switch (optchar) { case 'f': readfile = true; @@ -712,6 +732,9 @@ main(int argc, char **argv) case 'q': quiet = true; break; + case 'v': + verbose = true; + break; case 'U': if (access(UNITSFILE, F_OK) == 0) printf("%s\n", UNITSFILE); From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 21:02:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 970123E7; Mon, 14 Apr 2014 21:02:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83EB01B9A; Mon, 14 Apr 2014 21:02:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3EL2KM5037908; Mon, 14 Apr 2014 21:02:20 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EL2KMp037907; Mon, 14 Apr 2014 21:02:20 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404142102.s3EL2KMp037907@svn.freebsd.org> From: Christian Brueffer Date: Mon, 14 Apr 2014 21:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264471 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 21:02:20 -0000 Author: brueffer Date: Mon Apr 14 21:02:20 2014 New Revision: 264471 URL: http://svnweb.freebsd.org/changeset/base/264471 Log: Refine r264422: set buf to NULL only when we don't allocate memory, and free buf unconditionally. Requested by: kib MFC after: 1 week Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Mon Apr 14 20:51:04 2014 (r264470) +++ head/sys/kern/imgact_elf.c Mon Apr 14 21:02:20 2014 (r264471) @@ -1740,16 +1740,16 @@ __elfN(note_threadmd)(void *arg, struct td = (struct thread *)arg; size = *sizep; - buf = NULL; if (size != 0 && sb != NULL) buf = malloc(size, M_TEMP, M_ZERO | M_WAITOK); + else + buf = NULL; size = 0; __elfN(dump_thread)(td, buf, &size); KASSERT(*sizep == size, ("invalid size")); - if (size != 0 && sb != NULL) { + if (size != 0 && sb != NULL) sbuf_bcat(sb, buf, size); - free(buf, M_TEMP); - } + free(buf, M_TEMP); *sizep = size; } From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 21:07:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9C0682E; Mon, 14 Apr 2014 21:07:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD0E41C01; Mon, 14 Apr 2014 21:07:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3EL7soP038638; Mon, 14 Apr 2014 21:07:54 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EL7suh038637; Mon, 14 Apr 2014 21:07:54 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404142107.s3EL7suh038637@svn.freebsd.org> From: Eitan Adler Date: Mon, 14 Apr 2014 21:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264474 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 21:07:54 -0000 Author: eadler Date: Mon Apr 14 21:07:54 2014 New Revision: 264474 URL: http://svnweb.freebsd.org/changeset/base/264474 Log: units(1): Add 'static' and sort list. Inspired by: DragonflyBSD Modified: head/usr.bin/units/units.c Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Mon Apr 14 21:07:36 2014 (r264473) +++ head/usr.bin/units/units.c Mon Apr 14 21:07:54 2014 (r264474) @@ -81,24 +81,24 @@ static const char * havestr; static const char * wantstr; -char *dupstr(const char *str); -void readunits(const char *userfile); -void initializeunit(struct unittype * theunit); -int addsubunit(char *product[], char *toadd); -void showunit(struct unittype * theunit); -void zeroerror(void); -int addunit(struct unittype *theunit, const char *toadd, int flip, int quantity); -int compare(const void *item1, const void *item2); -void sortunit(struct unittype * theunit); -void cancelunit(struct unittype * theunit); -char *lookupunit(const char *unit); -int reduceproduct(struct unittype * theunit, int flip); -int reduceunit(struct unittype * theunit); -int compareproducts(char **one, char **two); -int compareunits(struct unittype * first, struct unittype * second); -int completereduce(struct unittype * unit); -void showanswer(struct unittype * have, struct unittype * want); -void usage(void); +static int addsubunit(char *product[], char *toadd); +static int addunit(struct unittype *theunit, const char *toadd, int flip, int quantity); +static void cancelunit(struct unittype * theunit); +static int compare(const void *item1, const void *item2); +static int compareproducts(char **one, char **two); +static int compareunits(struct unittype * first, struct unittype * second); +static int completereduce(struct unittype * unit); +static char *dupstr(const char *str); +static void initializeunit(struct unittype * theunit); +static char *lookupunit(const char *unit); +static void readunits(const char *userfile); +static int reduceproduct(struct unittype * theunit, int flip); +static int reduceunit(struct unittype * theunit); +static void showanswer(struct unittype * have, struct unittype * want); +static void showunit(struct unittype * theunit); +static void sortunit(struct unittype * theunit); +static void usage(void); +static void zeroerror(void); static const char* promptstr = ""; From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 21:09:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AD669A1; Mon, 14 Apr 2014 21:09:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 077181C1B; Mon, 14 Apr 2014 21:09:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3EL9lvF038893; Mon, 14 Apr 2014 21:09:47 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EL9ljw038892; Mon, 14 Apr 2014 21:09:47 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404142109.s3EL9ljw038892@svn.freebsd.org> From: Eitan Adler Date: Mon, 14 Apr 2014 21:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264475 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 21:09:48 -0000 Author: eadler Date: Mon Apr 14 21:09:47 2014 New Revision: 264475 URL: http://svnweb.freebsd.org/changeset/base/264475 Log: units(1): don't compare pointers with 0 For better readability, don't compare pointers with 0 or assign 0 to them. Use NULL instead. Inspired by: DragonflyBSD Modified: head/usr.bin/units/units.c Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Mon Apr 14 21:07:54 2014 (r264474) +++ head/usr.bin/units/units.c Mon Apr 14 21:09:47 2014 (r264475) @@ -245,7 +245,7 @@ addsubunit(char *product[], char *toadd) return 1; } if (!*ptr) - *(ptr + 1) = 0; + *(ptr + 1) = NULL; *ptr = dupstr(toadd); return 0; } From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 21:44:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD9F9602; Mon, 14 Apr 2014 21:44:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A51E10E1; Mon, 14 Apr 2014 21:44:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3ELiYiR055043; Mon, 14 Apr 2014 21:44:34 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3ELiYH5055042; Mon, 14 Apr 2014 21:44:34 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404142144.s3ELiYH5055042@svn.freebsd.org> From: Christian Brueffer Date: Mon, 14 Apr 2014 21:44:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264479 - head/sbin/savecore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 21:44:34 -0000 Author: brueffer Date: Mon Apr 14 21:44:34 2014 New Revision: 264479 URL: http://svnweb.freebsd.org/changeset/base/264479 Log: Fix double fclose() in an error case. CID: 1006120 Found with: Coverity Prevent(tm) MFC after: 1 week Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Mon Apr 14 21:26:34 2014 (r264478) +++ head/sbin/savecore/savecore.c Mon Apr 14 21:44:34 2014 (r264479) @@ -672,7 +672,7 @@ DoFile(const char *savedir, const char * if (fclose(fp) < 0) { syslog(LOG_ERR, "error on %s: %m", corename); nerr++; - goto closeall; + goto closefd; } symlinks_remove(); From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 22:01:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FF88BB6; Mon, 14 Apr 2014 22:01:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBD812A0; Mon, 14 Apr 2014 22:01:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3EM1oTQ063130; Mon, 14 Apr 2014 22:01:50 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EM1o9x063129; Mon, 14 Apr 2014 22:01:50 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404142201.s3EM1o9x063129@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 14 Apr 2014 22:01:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264480 - head/usr.sbin/mergemaster X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 22:01:50 -0000 Author: jilles Date: Mon Apr 14 22:01:49 2014 New Revision: 264480 URL: http://svnweb.freebsd.org/changeset/base/264480 Log: mergemaster: Avoid "/var/tmp/temproot disappeared" if there is nothing to compare. Because of the change to find in SVN r253886, the entire temproot would be deleted if it became empty, leading to a confusing message "*** FATAL ERROR: The temproot directory ${TEMPROOT} has disappeared!" Note that mergemaster does not do anything useful in this situation anyway (e.g. put IGNORE_FILES="/etc/group /etc/master.passwd" in /etc/mergemaster.rc and run mergemaster -p). As noted in that commit, add -mindepth 1. PR: bin/188485 Submitted by: David Boyd MFC after: 1 week Modified: head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Mon Apr 14 21:44:34 2014 (r264479) +++ head/usr.sbin/mergemaster/mergemaster.sh Mon Apr 14 22:01:49 2014 (r264480) @@ -709,7 +709,7 @@ case "${RERUN}" in # and to make the actual comparison faster. find ${TEMPROOT}/usr -type l -delete 2>/dev/null find ${TEMPROOT} -type f -size 0 -delete 2>/dev/null - find -d ${TEMPROOT} -type d -empty -delete 2>/dev/null + find -d ${TEMPROOT} -type d -empty -mindepth 1 -delete 2>/dev/null # Build the mtree database in a temporary location. case "${PRE_WORLD}" in From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 22:44:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 412305B5; Mon, 14 Apr 2014 22:44:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14C1C16C8; Mon, 14 Apr 2014 22:44:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3EMioBw079789; Mon, 14 Apr 2014 22:44:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EMios9079788; Mon, 14 Apr 2014 22:44:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201404142244.s3EMios9079788@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 14 Apr 2014 22:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264481 - head/libexec/rtld-elf/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 22:44:51 -0000 Author: kib Date: Mon Apr 14 22:44:50 2014 New Revision: 264481 URL: http://svnweb.freebsd.org/changeset/base/264481 Log: Add dwarf annotations to the amd64 _rtld_bind_start to allow debuggers to unwind around the calls from PLT to binder. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/amd64/rtld_start.S Modified: head/libexec/rtld-elf/amd64/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/amd64/rtld_start.S Mon Apr 14 22:01:49 2014 (r264480) +++ head/libexec/rtld-elf/amd64/rtld_start.S Mon Apr 14 22:44:50 2014 (r264481) @@ -79,17 +79,39 @@ .globl _rtld_bind_start .type _rtld_bind_start,@function _rtld_bind_start: + .cfi_startproc + .cfi_adjust_cfa_offset 16 subq $8,%rsp + .cfi_adjust_cfa_offset 8 pushfq # Save rflags + .cfi_adjust_cfa_offset 8 pushq %rax # Save %rax + .cfi_adjust_cfa_offset 8 + .cfi_offset %rax,-32 pushq %rdx # Save %rdx + .cfi_adjust_cfa_offset 8 + .cfi_offset %rdx,-40 pushq %rcx # Save %rcx + .cfi_adjust_cfa_offset 8 + .cfi_offset %rcx,-48 pushq %rsi # Save %rsi + .cfi_adjust_cfa_offset 8 + .cfi_offset %rsi,-56 pushq %rdi # Save %rdi + .cfi_adjust_cfa_offset 8 + .cfi_offset %rdi,-64 pushq %r8 # Save %r8 + .cfi_adjust_cfa_offset 8 + .cfi_offset %r8,-72 pushq %r9 # Save %r9 + .cfi_adjust_cfa_offset 8 + .cfi_offset %r9,-80 pushq %r10 # Save %r10 + .cfi_adjust_cfa_offset 8 + .cfi_offset %r10,-88 pushq %r11 # Save %r11 + .cfi_adjust_cfa_offset 8 + .cfi_offset %r11,-96 movq 0x58(%rsp),%rdi # Fetch obj argument movq 0x60(%rsp),%rsi # Fetch reloff argument @@ -101,16 +123,37 @@ _rtld_bind_start: movq %rax,0x60(%rsp) # Store target over reloff argument popq %r11 # Restore %r11 + .cfi_adjust_cfa_offset -8 + .cfi_restore %r11 popq %r10 # Restore %r10 + .cfi_adjust_cfa_offset -8 + .cfi_restore %r10 popq %r9 # Restore %r9 + .cfi_adjust_cfa_offset -8 + .cfi_restore %r9 popq %r8 # Restore %r8 + .cfi_adjust_cfa_offset -8 + .cfi_restore %r8 popq %rdi # Restore %rdi + .cfi_adjust_cfa_offset -8 + .cfi_restore %rdi popq %rsi # Restore %rsi + .cfi_adjust_cfa_offset -8 + .cfi_restore %rsi popq %rcx # Restore %rcx + .cfi_adjust_cfa_offset -8 + .cfi_restore %rcx popq %rdx # Restore %rdx + .cfi_adjust_cfa_offset -8 + .cfi_restore %rdx popq %rax # Restore %rax + .cfi_adjust_cfa_offset -8 + .cfi_restore %rax popfq # Restore rflags + .cfi_adjust_cfa_offset -8 leaq 16(%rsp),%rsp # Discard spare, obj, do not change rflags ret # "Return" to target address + .cfi_endproc + .size _rtld_bind_start, . - _rtld_bind_start .section .note.GNU-stack,"",%progbits From owner-svn-src-head@FreeBSD.ORG Mon Apr 14 22:49:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DF34716; Mon, 14 Apr 2014 22:49:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2ABDA16E0; Mon, 14 Apr 2014 22:49:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3EMncH4080369; Mon, 14 Apr 2014 22:49:38 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3EMnclL080368; Mon, 14 Apr 2014 22:49:38 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404142249.s3EMnclL080368@svn.freebsd.org> From: Christian Brueffer Date: Mon, 14 Apr 2014 22:49:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264482 - head/sys/boot/i386/libfirewire X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 22:49:38 -0000 Author: brueffer Date: Mon Apr 14 22:49:37 2014 New Revision: 264482 URL: http://svnweb.freebsd.org/changeset/base/264482 Log: Re-indent break statement. MFC after: 1 week Modified: head/sys/boot/i386/libfirewire/firewire.c Modified: head/sys/boot/i386/libfirewire/firewire.c ============================================================================== --- head/sys/boot/i386/libfirewire/firewire.c Mon Apr 14 22:44:50 2014 (r264481) +++ head/sys/boot/i386/libfirewire/firewire.c Mon Apr 14 22:49:37 2014 (r264482) @@ -137,7 +137,7 @@ fw_init(void) if (sc->state == FWOHCI_STATE_DEAD) break; avail ++; - break; + break; } fw_initialized = 1; From owner-svn-src-head@FreeBSD.ORG Tue Apr 15 00:45:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 897084D7; Tue, 15 Apr 2014 00:45:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67BD71162; Tue, 15 Apr 2014 00:45:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3F0jdxa029358; Tue, 15 Apr 2014 00:45:39 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3F0jdAZ029357; Tue, 15 Apr 2014 00:45:39 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404150045.s3F0jdAZ029357@svn.freebsd.org> From: Adrian Chadd Date: Tue, 15 Apr 2014 00:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264484 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 00:45:39 -0000 Author: adrian Date: Tue Apr 15 00:45:38 2014 New Revision: 264484 URL: http://svnweb.freebsd.org/changeset/base/264484 Log: Update the ath(4) manpage with .. well, updated information. MFC after: 3 days Modified: head/share/man/man4/ath.4 Modified: head/share/man/man4/ath.4 ============================================================================== --- head/share/man/man4/ath.4 Mon Apr 14 23:51:57 2014 (r264483) +++ head/share/man/man4/ath.4 Tue Apr 15 00:45:38 2014 (r264484) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd August 28, 2011 +.Dd April 14, 2014 .Dt ATH 4 .Os .Sh NAME @@ -58,7 +58,7 @@ if_ath_pci_load="YES" The .Nm driver provides support for wireless network adapters based on -the Atheros AR5210, AR5211, AR5212, and AR5416 programming APIs. +the Atheros AR5210, AR5211, AR5212, AR5416 and AR9300 programming APIs. These APIs are used by a wide variety of chips; most all chips with a PCI and/or CardBus interface are supported. .Pp @@ -92,20 +92,19 @@ speeds as above for 802.11a operation an 1Mbps, 2Mbps, 5.5 Mbps and 11Mbps for 802.11b operation. AR5212-based devices support 802.11a, 802.11b, and 802.11g operation with transmit speeds appropriate to each. -AR5416-class devices are capable of 802.11n operation -but are supported only in legacy modes (802.11a, 11b, 11g). +AR5416 and later class devices are capable of 802.11n operation. Most chips also support an Atheros Turbo Mode (TM) that operates in the 5GHz frequency range with 2x the transmit speeds. Some chips also support Turbo mode in the 2.4GHz range with 802.11g though this support is not presently available due to regulatory requirements. (Note that Turbo modes are, however, only interoperable with other Atheros-based devices.) -AR5212-based devices also support half- (10MHz) and quarter-width (5MHz) channels. +AR5212-based and AR5416-based devices also support half- (10MHz) and quarter-width (5MHz) channels. The actual transmit speed used is dependent on signal quality and the .Dq "rate control" algorithm employed by the driver. All chips support WEP encryption. -AR5212 and AR5416 parts have hardware support for the +AR5212, AR5416 and later parts have hardware support for the AES-CCM, TKIP, and Michael cryptographic operations required for WPA. To enable encryption, use @@ -125,7 +124,7 @@ mode operation. Multiple .Cm hostap virtual interfaces may be configured for simultaneous -use on cards that use a 5212 part. +use on cards that use a 5212 or later part. When multiple interfaces are configured each may have a separate mac address that is formed by setting the U/L bits in the mac address assigned to the underlying device. @@ -294,9 +293,10 @@ device driver first appeared in Revision A1 of the D-LINK DWL-G520 and DWL-G650 are based on an Intersil PrismGT chip and are not supported by this driver. .Sh BUGS -There is no software retransmit; only hardware retransmit is used. -.Pp The driver does not fully enable power-save operation of the chip in station mode; consequently power use is suboptimal (e.g. on a laptop). .Pp -WPA is not supported for 5210 parts. +The AR5210 can only do WEP in hardware; consequently hardware assisted WEP +is disabled in order to allow software implementations of TKIP and CCMP to +function. +Hardware WEP can be re-enabled by modifying the driver. From owner-svn-src-head@FreeBSD.ORG Tue Apr 15 02:28:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EF65973; Tue, 15 Apr 2014 02:28:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C0961A03; Tue, 15 Apr 2014 02:28:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3F2S9Gb070643; Tue, 15 Apr 2014 02:28:09 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3F2S9kV070642; Tue, 15 Apr 2014 02:28:09 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201404150228.s3F2S9kV070642@svn.freebsd.org> From: Mark Johnston Date: Tue, 15 Apr 2014 02:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264486 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 02:28:09 -0000 Author: markj Date: Tue Apr 15 02:28:08 2014 New Revision: 264486 URL: http://svnweb.freebsd.org/changeset/base/264486 Log: Use the correct format specifiers for wide characters and strings of wide characters. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c Tue Apr 15 02:17:46 2014 (r264485) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c Tue Apr 15 02:28:08 2014 (r264486) @@ -694,8 +694,13 @@ static const dt_pfconv_t _dtrace_convers { "S", "s", pfproto_cstr, pfcheck_str, pfprint_estr }, { "T", "s", "int64_t", pfcheck_time, pfprint_time822 }, { "u", "u", pfproto_xint, pfcheck_xint, pfprint_uint }, +#if defined(sun) { "wc", "wc", "int", pfcheck_type, pfprint_sint }, /* a.k.a. wchar_t */ { "ws", "ws", pfproto_wstr, pfcheck_wstr, pfprint_wstr }, +#else +{ "wc", "lc", "int", pfcheck_type, pfprint_sint }, /* a.k.a. wchar_t */ +{ "ws", "ls", pfproto_wstr, pfcheck_wstr, pfprint_wstr }, +#endif { "x", "x", pfproto_xint, pfcheck_xint, pfprint_uint }, { "X", "X", pfproto_xint, pfcheck_xint, pfprint_uint }, { "Y", "s", "int64_t", pfcheck_time, pfprint_time }, From owner-svn-src-head@FreeBSD.ORG Tue Apr 15 02:32:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C84DEB0E; Tue, 15 Apr 2014 02:32:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4DE51A96; Tue, 15 Apr 2014 02:32:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3F2W1LV074065; Tue, 15 Apr 2014 02:32:01 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3F2W0mP074049; Tue, 15 Apr 2014 02:32:00 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201404150232.s3F2W0mP074049@svn.freebsd.org> From: Mark Johnston Date: Tue, 15 Apr 2014 02:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264487 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 02:32:02 -0000 Author: markj Date: Tue Apr 15 02:32:00 2014 New Revision: 264487 URL: http://svnweb.freebsd.org/changeset/base/264487 Log: Replace a few Solarisisms with their corresponding FreeBSDisms to make a few printf tests pass. Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.basics.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.basics.d.out head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d.out head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d.out Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.basics.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.basics.d Tue Apr 15 02:28:08 2014 (r264486) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.basics.d Tue Apr 15 02:32:00 2014 (r264487) @@ -44,7 +44,7 @@ BEGIN printf("\n"); - printf("%%a = %a\n", &`kmem_alloc); + printf("%%a = %a\n", &`malloc); printf("%%c = %c\n", i); printf("%%d = %d\n", i); printf("%%hd = %hd\n", (short)i); Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.basics.d.out ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.basics.d.out Tue Apr 15 02:28:08 2014 (r264486) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.basics.d.out Tue Apr 15 02:32:00 2014 (r264487) @@ -1,5 +1,5 @@ -%a = genunix`kmem_alloc +%a = kernel`malloc %c = a %d = 97 %hd = 97 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d Tue Apr 15 02:28:08 2014 (r264486) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d Tue Apr 15 02:32:00 2014 (r264487) @@ -36,6 +36,6 @@ BEGIN { - printf("sysname = %s", `utsname.sysname); + printf("sysname = %s", `ostype); exit(0); } Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d.out ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d.out Tue Apr 15 02:28:08 2014 (r264486) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.str.d.out Tue Apr 15 02:32:00 2014 (r264487) @@ -1 +1 @@ -sysname = SunOS +sysname = FreeBSD Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d Tue Apr 15 02:28:08 2014 (r264486) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d Tue Apr 15 02:32:00 2014 (r264487) @@ -38,6 +38,6 @@ BEGIN { - printf("symbol = %a", &`kmem_alloc); + printf("symbol = %a", &`malloc); exit(0); } Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d.out ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d.out Tue Apr 15 02:28:08 2014 (r264486) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d.out Tue Apr 15 02:32:00 2014 (r264487) @@ -1 +1 @@ -symbol = kernel`kmem_alloc +symbol = kernel`malloc From owner-svn-src-head@FreeBSD.ORG Tue Apr 15 06:57:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D082B24; Tue, 15 Apr 2014 06:57:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D35201379; Tue, 15 Apr 2014 06:56:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3F6uxEx081043; Tue, 15 Apr 2014 06:56:59 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3F6uxZ7081041; Tue, 15 Apr 2014 06:56:59 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201404150656.s3F6uxZ7081041@svn.freebsd.org> From: Devin Teske Date: Tue, 15 Apr 2014 06:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264488 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 06:57:00 -0000 Author: dteske Date: Tue Apr 15 06:56:59 2014 New Revision: 264488 URL: http://svnweb.freebsd.org/changeset/base/264488 Log: When merging docsinstall and zfsboot updates to stable/9 it was discovered that the slightly older dialog(1) requires --separate-output when using the --checklist widget to force response to produce unquoted values (whereas in stable/10 --checklist widget without --separate-output will only quote the checklist labels in the response if the label is multi-word (contains any whitespace). Since these enhancements (see revisions 263956 and 264437) were developed originally on 10, the --separate-output option was omitted. When merged to stable/9, we (Allan Jude) and I found during testing that the "always- quoting" of the response was causing things like struct interpolation to fail (`f_struct device_$dev' would produce `f_struct device_\"da0\"' for example -- literal quotes inherited from dialog(1) --checklist response). To see the behavior, execute the following on stable/9 versus stable/10: dialog --checklist disks: 0 0 0 da0 "" off da1 "" off Check both items and hit enter. On stable/10, the response is: da0 da1 On stable/9 the response is: "da0" "da1" If you use the --separate-output option, the response is the same for both: da0 da1 So applying --separate-output on every platform until either one of two things occurs 1) dialog(1,3) gets synchronized between stable/9, higher or 2) we drop support for stable/9. MFC after: 3 days Reviewed by: Allan Jude Modified: head/usr.sbin/bsdinstall/scripts/docsinstall head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/docsinstall ============================================================================== --- head/usr.sbin/bsdinstall/scripts/docsinstall Tue Apr 15 02:32:00 2014 (r264487) +++ head/usr.sbin/bsdinstall/scripts/docsinstall Tue Apr 15 06:56:59 2014 (r264488) @@ -119,6 +119,7 @@ dialog_menu_main() selected=$( eval $DIALOG \ --title \"\$title\" \ --backtitle \"\$btitle\" \ + --separate-output \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Tue Apr 15 02:32:00 2014 (r264487) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Tue Apr 15 06:56:59 2014 (r264488) @@ -581,6 +581,7 @@ dialog_menu_layout() selections=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ + --separate-output \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_back\" \ From owner-svn-src-head@FreeBSD.ORG Tue Apr 15 07:37:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00FD43A3; Tue, 15 Apr 2014 07:37:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E18AD16F5; Tue, 15 Apr 2014 07:37:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3F7buOP098904; Tue, 15 Apr 2014 07:37:56 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3F7buhV098903; Tue, 15 Apr 2014 07:37:56 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404150737.s3F7buhV098903@svn.freebsd.org> From: Christian Brueffer Date: Tue, 15 Apr 2014 07:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264489 - head/sbin/gbde X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 07:37:57 -0000 Author: brueffer Date: Tue Apr 15 07:37:56 2014 New Revision: 264489 URL: http://svnweb.freebsd.org/changeset/base/264489 Log: Add a missing break in option parsing. CID: 1011452 Found with: Coverity Prevent(tm) MFC after: 1 week Modified: head/sbin/gbde/gbde.c Modified: head/sbin/gbde/gbde.c ============================================================================== --- head/sbin/gbde/gbde.c Tue Apr 15 06:56:59 2014 (r264488) +++ head/sbin/gbde/gbde.c Tue Apr 15 07:37:56 2014 (r264489) @@ -805,6 +805,7 @@ main(int argc, char **argv) break; case 'i': i_opt = !i_opt; + break; case 'k': k_opt = optarg; break; From owner-svn-src-head@FreeBSD.ORG Tue Apr 15 09:10:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18375993; Tue, 15 Apr 2014 09:10:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC2261FDE; Tue, 15 Apr 2014 09:10:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3F9A1Ri036760; Tue, 15 Apr 2014 09:10:01 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3F9A1TF036749; Tue, 15 Apr 2014 09:10:01 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201404150910.s3F9A1TF036749@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 15 Apr 2014 09:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264494 - head/sys/fs/smbfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 09:10:02 -0000 Author: ae Date: Tue Apr 15 09:10:01 2014 New Revision: 264494 URL: http://svnweb.freebsd.org/changeset/base/264494 Log: Use SMB_QUERY_FS_SIZE_INFO request to populate statfs structure. When server doesn't support this request, try to use SMB_INFO_ALLOCATION. And use SMB_COM_QUERY_INFORMATION_DISK request as fallback. MFC after: 2 weeks Modified: head/sys/fs/smbfs/smbfs_smb.c head/sys/fs/smbfs/smbfs_subr.h head/sys/fs/smbfs/smbfs_vfsops.c Modified: head/sys/fs/smbfs/smbfs_smb.c ============================================================================== --- head/sys/fs/smbfs/smbfs_smb.c Tue Apr 15 08:08:44 2014 (r264493) +++ head/sys/fs/smbfs/smbfs_smb.c Tue Apr 15 09:10:01 2014 (r264494) @@ -135,8 +135,49 @@ smbfs_smb_lock(struct smbnode *np, int o return smbfs_smb_lockandx(np, op, (uintptr_t)id, start, end, scred); } -int -smbfs_smb_statfs2(struct smb_share *ssp, struct statfs *sbp, +static int +smbfs_query_info_fs(struct smb_share *ssp, struct statfs *sbp, + struct smb_cred *scred) +{ + struct smb_t2rq *t2p; + struct mbchain *mbp; + struct mdchain *mdp; + uint32_t bsize, bpu; + int64_t units, funits; + int error; + + error = smb_t2_alloc(SSTOCP(ssp), SMB_TRANS2_QUERY_FS_INFORMATION, + scred, &t2p); + if (error) + return (error); + mbp = &t2p->t2_tparam; + mb_init(mbp); + mb_put_uint16le(mbp, SMB_QUERY_FS_SIZE_INFO); + t2p->t2_maxpcount = 2; + t2p->t2_maxdcount = sizeof(int64_t) * 2 + sizeof(uint32_t) * 2; + error = smb_t2_request(t2p); + if (error) { + smb_t2_done(t2p); + return (error); + } + mdp = &t2p->t2_rdata; + md_get_int64le(mdp, &units); + md_get_int64le(mdp, &funits); + md_get_uint32le(mdp, &bpu); + md_get_uint32le(mdp, &bsize); + sbp->f_bsize = bpu * bsize; /* fundamental filesystem block size */ + sbp->f_blocks= (uint64_t)units; /* total data blocks in filesystem */ + sbp->f_bfree = (uint64_t)funits;/* free blocks in fs */ + sbp->f_bavail= (uint64_t)funits;/* free blocks avail to non-superuser */ + sbp->f_files = 0xffff; /* total file nodes in filesystem */ + sbp->f_ffree = 0xffff; /* free file nodes in fs */ + smb_t2_done(t2p); + return (0); +} + + +static int +smbfs_query_info_alloc(struct smb_share *ssp, struct statfs *sbp, struct smb_cred *scred) { struct smb_t2rq *t2p; @@ -176,8 +217,8 @@ smbfs_smb_statfs2(struct smb_share *ssp, return 0; } -int -smbfs_smb_statfs(struct smb_share *ssp, struct statfs *sbp, +static int +smbfs_query_info_disk(struct smb_share *ssp, struct statfs *sbp, struct smb_cred *scred) { struct smb_rq *rqp; @@ -213,6 +254,20 @@ smbfs_smb_statfs(struct smb_share *ssp, return 0; } +int +smbfs_smb_statfs(struct smb_share *ssp, struct statfs *sbp, + struct smb_cred *scred) +{ + + if (SMB_DIALECT(SSTOVC(ssp)) >= SMB_DIALECT_LANMAN2_0) { + if (smbfs_query_info_fs(ssp, sbp, scred) == 0) + return (0); + if (smbfs_query_info_alloc(ssp, sbp, scred) == 0) + return (0); + } + return (smbfs_query_info_disk(ssp, sbp, scred)); +} + static int smbfs_smb_seteof(struct smbnode *np, int64_t newsize, struct smb_cred *scred) { Modified: head/sys/fs/smbfs/smbfs_subr.h ============================================================================== --- head/sys/fs/smbfs/smbfs_subr.h Tue Apr 15 08:08:44 2014 (r264493) +++ head/sys/fs/smbfs/smbfs_subr.h Tue Apr 15 09:10:01 2014 (r264494) @@ -126,8 +126,6 @@ struct smbfs_fctx { */ int smbfs_smb_lock(struct smbnode *np, int op, caddr_t id, off_t start, off_t end, struct smb_cred *scred); -int smbfs_smb_statfs2(struct smb_share *ssp, struct statfs *sbp, - struct smb_cred *scred); int smbfs_smb_statfs(struct smb_share *ssp, struct statfs *sbp, struct smb_cred *scred); int smbfs_smb_setfsize(struct smbnode *np, int newsize, struct smb_cred *scred); Modified: head/sys/fs/smbfs/smbfs_vfsops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vfsops.c Tue Apr 15 08:08:44 2014 (r264493) +++ head/sys/fs/smbfs/smbfs_vfsops.c Tue Apr 15 09:10:01 2014 (r264494) @@ -390,7 +390,7 @@ smbfs_statfs(struct mount *mp, struct st struct smbnode *np = smp->sm_root; struct smb_share *ssp = smp->sm_share; struct smb_cred *scred; - int error = 0; + int error; if (np == NULL) { vfs_mount_error(mp, "np == NULL"); @@ -400,16 +400,9 @@ smbfs_statfs(struct mount *mp, struct st sbp->f_iosize = SSTOVC(ssp)->vc_txmax; /* optimal transfer block size */ scred = smbfs_malloc_scred(); smb_makescred(scred, td, td->td_ucred); - - if (SMB_DIALECT(SSTOVC(ssp)) >= SMB_DIALECT_LANMAN2_0) - error = smbfs_smb_statfs2(ssp, sbp, scred); - else - error = smbfs_smb_statfs(ssp, sbp, scred); - if (error) { - smbfs_free_scred(scred); - return error; - } - sbp->f_flags = 0; /* copy of mount exported flags */ + error = smbfs_smb_statfs(ssp, sbp, scred); + if (error == 0) + sbp->f_flags = 0; /* copy of mount exported flags */ smbfs_free_scred(scred); - return 0; + return (error); } From owner-svn-src-head@FreeBSD.ORG Tue Apr 15 13:28:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90903BA7; Tue, 15 Apr 2014 13:28:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CC7C1A2F; Tue, 15 Apr 2014 13:28:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3FDSsjP043488; Tue, 15 Apr 2014 13:28:54 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FDSsME043487; Tue, 15 Apr 2014 13:28:54 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201404151328.s3FDSsME043487@svn.freebsd.org> From: Rick Macklem Date: Tue, 15 Apr 2014 13:28:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264498 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 13:28:54 -0000 Author: rmacklem Date: Tue Apr 15 13:28:54 2014 New Revision: 264498 URL: http://svnweb.freebsd.org/changeset/base/264498 Log: Fix build for non-INET that was broken by r264469. MFC after: 2 weeks Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Tue Apr 15 09:49:44 2014 (r264497) +++ head/sys/net/if_lagg.c Tue Apr 15 13:28:54 2014 (r264498) @@ -54,11 +54,11 @@ __FBSDID("$FreeBSD$"); #if defined(INET) || defined(INET6) #include +#include #endif #ifdef INET #include #include -#include #endif #ifdef INET6 @@ -448,7 +448,11 @@ lagg_capabilities(struct lagg_softc *sc) struct lagg_port *lp; int cap = ~0, ena = ~0; u_long hwa = ~0UL; +#if defined(INET) || defined(INET6) u_int hw_tsomax = IP_MAXPACKET; /* Initialize to the maximum value. */ +#else + u_int hw_tsomax = ~0; /* if_hw_tsomax is only for INET/INET6, but.. */ +#endif LAGG_WLOCK_ASSERT(sc); From owner-svn-src-head@FreeBSD.ORG Tue Apr 15 14:41:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F5C3A6E; Tue, 15 Apr 2014 14:41:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C43713C9; Tue, 15 Apr 2014 14:41:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3FEfgm9075288; Tue, 15 Apr 2014 14:41:42 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FEfgUx075287; Tue, 15 Apr 2014 14:41:42 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201404151441.s3FEfgUx075287@svn.freebsd.org> From: Bryan Drewery Date: Tue, 15 Apr 2014 14:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264499 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 14:41:42 -0000 Author: bdrewery Date: Tue Apr 15 14:41:41 2014 New Revision: 264499 URL: http://svnweb.freebsd.org/changeset/base/264499 Log: Make g_access() KASSERT() more useful. Sponsored by: EMC / Isilon Storage Division Obtained from: Isilon OneFS MFC after: 2 weeks Modified: head/sys/geom/geom_subr.c Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Tue Apr 15 13:28:54 2014 (r264498) +++ head/sys/geom/geom_subr.c Tue Apr 15 14:41:41 2014 (r264499) @@ -912,8 +912,9 @@ g_access(struct g_consumer *cp, int dcr, error = pp->geom->access(pp, dcr, dcw, dce); KASSERT(dcr > 0 || dcw > 0 || dce > 0 || error == 0, - ("Geom provider %s::%s failed closing ->access()", - pp->geom->class->name, pp->name)); + ("Geom provider %s::%s dcr=%d dcw=%d dce=%d error=%d failed " + "closing ->access()", pp->geom->class->name, pp->name, dcr, dcw, + dce, error)); if (!error) { /* * If we open first write, spoil any partner consumers. From owner-svn-src-head@FreeBSD.ORG Tue Apr 15 14:55:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F00FFA5; Tue, 15 Apr 2014 14:55:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CB5D156E; Tue, 15 Apr 2014 14:55:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3FEtuPh080199; Tue, 15 Apr 2014 14:55:56 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FEtulh080198; Tue, 15 Apr 2014 14:55:56 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404151455.s3FEtulh080198@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 15 Apr 2014 14:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264500 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 14:55:57 -0000 Author: trasz Date: Tue Apr 15 14:55:56 2014 New Revision: 264500 URL: http://svnweb.freebsd.org/changeset/base/264500 Log: Stop treating LUN 0 as mandatory. There is no reason to do that. Suggested by: mav@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Tue Apr 15 14:41:41 2014 (r264499) +++ head/usr.sbin/ctld/ctld.c Tue Apr 15 14:55:56 2014 (r264500) @@ -1099,7 +1099,7 @@ conf_verify(struct conf *conf) struct portal_group *pg; struct target *targ; struct lun *lun; - bool found_lun0; + bool found_lun; int error; if (conf->conf_pidfile_path == NULL) @@ -1116,17 +1116,16 @@ conf_verify(struct conf *conf) "default"); assert(targ->t_portal_group != NULL); } - found_lun0 = false; + found_lun = false; TAILQ_FOREACH(lun, &targ->t_luns, l_next) { error = conf_verify_lun(lun); if (error != 0) return (error); - if (lun->l_lun == 0) - found_lun0 = true; + found_lun = true; } - if (!found_lun0) { - log_warnx("mandatory LUN 0 not configured " - "for target \"%s\"", targ->t_name); + if (!found_lun) { + log_warnx("no LUNs defined for target \"%s\"", + targ->t_name); return (1); } } From owner-svn-src-head@FreeBSD.ORG Tue Apr 15 15:11:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A616560A; Tue, 15 Apr 2014 15:11:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7911E16AE; Tue, 15 Apr 2014 15:11:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3FFBB4G087670; Tue, 15 Apr 2014 15:11:11 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FFBBIW087669; Tue, 15 Apr 2014 15:11:11 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201404151511.s3FFBBIW087669@svn.freebsd.org> From: Tycho Nightingale Date: Tue, 15 Apr 2014 15:11:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264501 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 15:11:11 -0000 Author: tychon Date: Tue Apr 15 15:11:10 2014 New Revision: 264501 URL: http://svnweb.freebsd.org/changeset/base/264501 Log: Add support for emulating the byte move and sign extend instructions: "movsx r/m8, r32" and "movsx r/m8, r64". Approved by: grehan (co-mentor) Modified: head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Tue Apr 15 14:55:56 2014 (r264500) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Tue Apr 15 15:11:10 2014 (r264501) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); enum { VIE_OP_TYPE_NONE = 0, VIE_OP_TYPE_MOV, + VIE_OP_TYPE_MOVSX, VIE_OP_TYPE_MOVZX, VIE_OP_TYPE_AND, VIE_OP_TYPE_OR, @@ -69,6 +70,10 @@ static const struct vie_op two_byte_opco .op_byte = 0xB6, .op_type = VIE_OP_TYPE_MOVZX, }, + [0xBE] = { + .op_byte = 0xBE, + .op_type = VIE_OP_TYPE_MOVSX, + }, }; static const struct vie_op one_byte_opcodes[256] = { @@ -333,9 +338,9 @@ emulate_mov(void *vm, int vcpuid, uint64 * - address size override is not supported */ static int -emulate_movzx(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, - mem_region_read_t memread, mem_region_write_t memwrite, - void *arg) +emulate_movx(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, + mem_region_read_t memread, mem_region_write_t memwrite, + void *arg) { int error, size; enum vm_reg_name reg; @@ -368,6 +373,32 @@ emulate_movzx(void *vm, int vcpuid, uint /* write the result */ error = vie_update_register(vm, vcpuid, reg, val, size); break; + case 0xBE: + /* + * MOV and sign extend byte from mem (ModRM:r/m) to + * reg (ModRM:reg). + * + * 0F BE/r movsx r/m8, r32 + * REX.W + 0F BE/r movsx r/m8, r64 + */ + + /* get the first operand */ + error = memread(vm, vcpuid, gpa, &val, 1, arg); + if (error) + break; + + /* get the second operand */ + reg = gpr_map[vie->reg]; + + if (vie->rex_w) + size = 8; + + /* sign extend byte */ + val = (int8_t)val; + + /* write the result */ + error = vie_update_register(vm, vcpuid, reg, val, size); + break; default: break; } @@ -508,9 +539,10 @@ vmm_emulate_instruction(void *vm, int vc error = emulate_mov(vm, vcpuid, gpa, vie, memread, memwrite, memarg); break; + case VIE_OP_TYPE_MOVSX: case VIE_OP_TYPE_MOVZX: - error = emulate_movzx(vm, vcpuid, gpa, vie, - memread, memwrite, memarg); + error = emulate_movx(vm, vcpuid, gpa, vie, + memread, memwrite, memarg); break; case VIE_OP_TYPE_AND: error = emulate_and(vm, vcpuid, gpa, vie, From owner-svn-src-head@FreeBSD.ORG Tue Apr 15 15:41:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B26F3F1; Tue, 15 Apr 2014 15:41:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77C881A10; Tue, 15 Apr 2014 15:41:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3FFfwbx000644; Tue, 15 Apr 2014 15:41:58 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FFfwDA000643; Tue, 15 Apr 2014 15:41:58 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201404151541.s3FFfwDA000643@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 15 Apr 2014 15:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264504 - head/sys/geom/uzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 15:41:58 -0000 Author: marcel Date: Tue Apr 15 15:41:57 2014 New Revision: 264504 URL: http://svnweb.freebsd.org/changeset/base/264504 Log: Make sure not to do I/O for more than MAXPHYS bytes. Doing so can cause problems in our providers, such as a KASSERT in md(4). We can initiate I/O for more than MAXPHYS bytes if we've been given a BIO for MAXPHYS bytes, the blocks from which we're reading couldn't be compressed and we had compression in preceeding blocks resulting in misalignment of the blocks we're trying to read relative to the sector. We're forced to round up the I/O length to make it an multiple of the sector size. When we detect the condition, we'll reduce the block count and perform a "short" read. In g_uzip_done() we need to consider the original I/O length and stop early if we're about to deflate a block that we didn't read. By using bio_completed in the cloned BIO and not bio_length to check for this, we automatically and gracefully handle short reads that our providers may be doing on top of the short reads we may initiate ourselves. Obtained from: Juniper Networks, Inc. Modified: head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Tue Apr 15 15:20:37 2014 (r264503) +++ head/sys/geom/uzip/g_uzip.c Tue Apr 15 15:41:57 2014 (r264504) @@ -125,7 +125,7 @@ g_uzip_done(struct bio *bp) struct g_consumer *cp; struct g_geom *gp; struct g_uzip_softc *sc; - off_t pos, upos; + off_t iolen, pos, upos; uint32_t start_blk, i; size_t bsize; @@ -153,11 +153,13 @@ g_uzip_done(struct bio *bp) } start_blk = bp2->bio_offset / sc->blksz; bsize = pp2->sectorsize; + iolen = bp->bio_completed; pos = sc->offsets[start_blk] % bsize; upos = 0; - DPRINTF(("%s: done: start_blk %d, pos %jd, upos %jd (%jd, %d, %zd)\n", + DPRINTF(("%s: done: start_blk %d, pos %jd, upos %jd, iolen %jd " + "(%jd, %d, %zd)\n", gp->name, start_blk, (intmax_t)pos, (intmax_t)upos, - (intmax_t)bp2->bio_offset, sc->blksz, bsize)); + (intmax_t)iolen, (intmax_t)bp2->bio_offset, sc->blksz, bsize)); for (i = start_blk; upos < bp2->bio_length; i++) { off_t len, ulen, uoff; @@ -172,6 +174,12 @@ g_uzip_done(struct bio *bp) bp2->bio_completed += ulen; continue; } + if (len > iolen) { + DPRINTF(("%s: done: early termination: len (%jd) > " + "iolen (%jd)\n", + gp->name, (intmax_t)len, (intmax_t)iolen)); + break; + } zs.next_in = bp->bio_data + pos; zs.avail_in = len; zs.next_out = sc->last_buf; @@ -196,6 +204,7 @@ g_uzip_done(struct bio *bp) mtx_unlock(&sc->last_mtx); pos += len; + iolen -= len; upos += ulen; bp2->bio_completed += ulen; err = inflateReset(&zs); @@ -290,8 +299,16 @@ g_uzip_start(struct bio *bp) pp2->name, pp2->sectorsize, (intmax_t)pp2->mediasize)); bsize = pp2->sectorsize; bp2->bio_offset = sc->offsets[start_blk] - sc->offsets[start_blk] % bsize; - bp2->bio_length = sc->offsets[end_blk] - bp2->bio_offset; - bp2->bio_length = (bp2->bio_length + bsize - 1) / bsize * bsize; + while (1) { + bp2->bio_length = sc->offsets[end_blk] - bp2->bio_offset; + bp2->bio_length = (bp2->bio_length + bsize - 1) / bsize * bsize; + if (bp2->bio_length < MAXPHYS) + break; + + end_blk--; + DPRINTF(("%s: bio_length (%jd) > MAXPHYS: lowering end_blk " + "to %u\n", gp->name, (intmax_t)bp2->bio_length, end_blk)); + } DPRINTF(("%s: start %jd + %jd -> %ju + %ju -> %jd + %jd\n", gp->name, (intmax_t)bp->bio_offset, (intmax_t)bp->bio_length, From owner-svn-src-head@FreeBSD.ORG Tue Apr 15 16:29:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9CBF533; Tue, 15 Apr 2014 16:29:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B69091FA0; Tue, 15 Apr 2014 16:29:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3FGTLsc018633; Tue, 15 Apr 2014 16:29:21 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FGTL7S018632; Tue, 15 Apr 2014 16:29:21 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404151629.s3FGTL7S018632@svn.freebsd.org> From: Christian Brueffer Date: Tue, 15 Apr 2014 16:29:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264507 - head/lib/libc/posix1e X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 16:29:21 -0000 Author: brueffer Date: Tue Apr 15 16:29:21 2014 New Revision: 264507 URL: http://svnweb.freebsd.org/changeset/base/264507 Log: Mention Capsicum. MFC after: 1 week Modified: head/lib/libc/posix1e/posix1e.3 Modified: head/lib/libc/posix1e/posix1e.3 ============================================================================== --- head/lib/libc/posix1e/posix1e.3 Tue Apr 15 16:10:47 2014 (r264506) +++ head/lib/libc/posix1e/posix1e.3 Tue Apr 15 16:29:21 2014 (r264507) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 7, 2009 +.Dd April 15, 2014 .Dt POSIX1E 3 .Os .Sh NAME @@ -65,6 +65,10 @@ However, does implement the .Xr libbsm audit API. +It also provides +.Xr capsicum 4 , +a lightweight OS capability and sandbox framework implementing a +hybrid capability system model. .Sh ENVIRONMENT POSIX.1e assigns security attributes to all objects, extending the security functionality described in POSIX.1. @@ -89,8 +93,10 @@ for mandatory access control labels. .Xr extattr 2 , .Xr acl 3 , .Xr extattr 3 , +.Xr libcapsicum 3 , .Xr libbsm 3 , .Xr mac 3 , +.Xr capsicum 4 , .Xr ffs 7 , .Xr getfmac 8 , .Xr setfmac 8 , From owner-svn-src-head@FreeBSD.ORG Tue Apr 15 16:31:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20DDC6A4; Tue, 15 Apr 2014 16:31:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E0A01058; Tue, 15 Apr 2014 16:31:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3FGVN5T021033; Tue, 15 Apr 2014 16:31:23 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FGVNWE021032; Tue, 15 Apr 2014 16:31:23 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404151631.s3FGVNWE021032@svn.freebsd.org> From: Christian Brueffer Date: Tue, 15 Apr 2014 16:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264508 - head/lib/libc/posix1e X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 16:31:24 -0000 Author: brueffer Date: Tue Apr 15 16:31:23 2014 New Revision: 264508 URL: http://svnweb.freebsd.org/changeset/base/264508 Log: Correct sorting. Modified: head/lib/libc/posix1e/posix1e.3 Modified: head/lib/libc/posix1e/posix1e.3 ============================================================================== --- head/lib/libc/posix1e/posix1e.3 Tue Apr 15 16:29:21 2014 (r264507) +++ head/lib/libc/posix1e/posix1e.3 Tue Apr 15 16:31:23 2014 (r264508) @@ -93,8 +93,8 @@ for mandatory access control labels. .Xr extattr 2 , .Xr acl 3 , .Xr extattr 3 , -.Xr libcapsicum 3 , .Xr libbsm 3 , +.Xr libcapsicum 3 , .Xr mac 3 , .Xr capsicum 4 , .Xr ffs 7 , From owner-svn-src-head@FreeBSD.ORG Tue Apr 15 17:06:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0ABF7FE7; Tue, 15 Apr 2014 17:06:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBBBF1370; Tue, 15 Apr 2014 17:06:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3FH6Qtk035277; Tue, 15 Apr 2014 17:06:26 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FH6Q5f035276; Tue, 15 Apr 2014 17:06:26 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201404151706.s3FH6Q5f035276@svn.freebsd.org> From: Tycho Nightingale Date: Tue, 15 Apr 2014 17:06:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264509 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 17:06:27 -0000 Author: tychon Date: Tue Apr 15 17:06:26 2014 New Revision: 264509 URL: http://svnweb.freebsd.org/changeset/base/264509 Log: Local APIC access via 32-bit naturally-aligned loads is merely suggested in the SDM. Since some OSes have implemented otherwise don't be too rigorous in enforcing it. Approved by: grehan (co-mentor) Modified: head/sys/amd64/vmm/vmm_lapic.c Modified: head/sys/amd64/vmm/vmm_lapic.c ============================================================================== --- head/sys/amd64/vmm/vmm_lapic.c Tue Apr 15 16:31:23 2014 (r264508) +++ head/sys/amd64/vmm/vmm_lapic.c Tue Apr 15 17:06:26 2014 (r264509) @@ -230,10 +230,12 @@ lapic_mmio_read(void *vm, int cpu, uint6 off = gpa - DEFAULT_APIC_BASE; /* - * Memory mapped local apic accesses must be 4 bytes wide and - * aligned on a 16-byte boundary. + * Memory mapped local apic accesses should be aligned on a + * 16-byte boundary. They are also suggested to be 4 bytes + * wide, alas not all OSes follow suggestions. */ - if (size != 4 || off & 0xf) + off &= ~3; + if (off & 0xf) return (EINVAL); vlapic = vm_lapic(vm, cpu); From owner-svn-src-head@FreeBSD.ORG Tue Apr 15 19:58:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBA6FD05; Tue, 15 Apr 2014 19:58:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B84DA1625; Tue, 15 Apr 2014 19:58:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3FJw5YS005756; Tue, 15 Apr 2014 19:58:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FJw5lI005755; Tue, 15 Apr 2014 19:58:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404151958.s3FJw5lI005755@svn.freebsd.org> From: Marius Strobl Date: Tue, 15 Apr 2014 19:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264514 - head/sys/dev/puc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 19:58:05 -0000 Author: marius Date: Tue Apr 15 19:58:05 2014 New Revision: 264514 URL: http://svnweb.freebsd.org/changeset/base/264514 Log: Correct a typo in a device description added in r264257. Modified: head/sys/dev/puc/pucdata.c Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Tue Apr 15 18:29:05 2014 (r264513) +++ head/sys/dev/puc/pucdata.c Tue Apr 15 19:58:05 2014 (r264514) @@ -1015,7 +1015,7 @@ const struct puc_cfg puc_pci_devices[] = }, { 0x1fd4, 0x1999, 0x1fd4, 0x0102, - "Sunix MIOxxxx 2-port serial and 1284 Printer port", + "Sunix MIO5xxxx 2-port serial and 1284 Printer port", DEFAULT_RCLK * 8, PUC_PORT_2S1P, -1, -1, -1, .config_function = puc_config_sunix From owner-svn-src-head@FreeBSD.ORG Tue Apr 15 20:41:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 107E98FF; Tue, 15 Apr 2014 20:41:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1C8C1A62; Tue, 15 Apr 2014 20:41:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3FKftXt025627; Tue, 15 Apr 2014 20:41:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FKftCR025626; Tue, 15 Apr 2014 20:41:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404152041.s3FKftCR025626@svn.freebsd.org> From: Warner Losh Date: Tue, 15 Apr 2014 20:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264515 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 20:41:56 -0000 Author: imp Date: Tue Apr 15 20:41:55 2014 New Revision: 264515 URL: http://svnweb.freebsd.org/changeset/base/264515 Log: Document WITHOUT_GPL_DTC too. Added: head/tools/build/options/WITHOUT_GPL_DTC - copied, changed from r264466, head/tools/build/options/WITH_GPL_DTC Copied and modified: head/tools/build/options/WITHOUT_GPL_DTC (from r264466, head/tools/build/options/WITH_GPL_DTC) ============================================================================== --- head/tools/build/options/WITH_GPL_DTC Mon Apr 14 18:14:09 2014 (r264466, copy source) +++ head/tools/build/options/WITHOUT_GPL_DTC Tue Apr 15 20:41:55 2014 (r264515) @@ -1,3 +1,3 @@ .\" $FreeBSD$ -Set to build the GPL'd version of the device tree compiler from elinux.org, -instead of the BSD licensed one. +Set to build the BSD licensed version of the device tree compiler, instead of the +GPL'd one from elinux.org. From owner-svn-src-head@FreeBSD.ORG Tue Apr 15 20:53:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82D71E41; Tue, 15 Apr 2014 20:53:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FD481B76; Tue, 15 Apr 2014 20:53:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3FKrsBq030117; Tue, 15 Apr 2014 20:53:54 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FKrsPF030116; Tue, 15 Apr 2014 20:53:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201404152053.s3FKrsPF030116@svn.freebsd.org> From: John Baldwin Date: Tue, 15 Apr 2014 20:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264516 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 20:53:54 -0000 Author: jhb Date: Tue Apr 15 20:53:53 2014 New Revision: 264516 URL: http://svnweb.freebsd.org/changeset/base/264516 Log: Don't spindown the BSP if it executes hlt with the APIC disabled. A guest that doesn't use the APIC at all can trigger this, plus the BSP always needs to execute as it should trigger a reset, etc. Reviewed by: tychon Modified: head/sys/amd64/vmm/vmm.c Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Tue Apr 15 20:41:55 2014 (r264515) +++ head/sys/amd64/vmm/vmm.c Tue Apr 15 20:53:53 2014 (r264516) @@ -1036,10 +1036,12 @@ vm_handle_hlt(struct vm *vm, int vcpuid, msleep_spin(vcpu, &vcpu->mtx, "vmidle", timo); } else { /* - * Spindown the vcpu if the apic is disabled and it - * had entered the halted state. + * Spindown the vcpu if the APIC is disabled and it + * had entered the halted state, but never spin + * down the BSP. */ - spindown = 1; + if (vcpuid != 0) + spindown = 1; } vcpu_require_state_locked(vcpu, VCPU_FROZEN); vmm_stat_incr(vm, vcpuid, VCPU_IDLE_TICKS, ticks - t); From owner-svn-src-head@FreeBSD.ORG Tue Apr 15 21:48:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44276864; Tue, 15 Apr 2014 21:48:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30C0A1192; Tue, 15 Apr 2014 21:48:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3FLma3H050915; Tue, 15 Apr 2014 21:48:36 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FLmacZ050914; Tue, 15 Apr 2014 21:48:36 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201404152148.s3FLmacZ050914@svn.freebsd.org> From: Rick Macklem Date: Tue, 15 Apr 2014 21:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264517 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 21:48:36 -0000 Author: rmacklem Date: Tue Apr 15 21:48:35 2014 New Revision: 264517 URL: http://svnweb.freebsd.org/changeset/base/264517 Log: Vlan did not set the value of if_hw_tsomax, so when vlan was stacked on top of a network interface that set if_hw_tsomax, tcp_output() would see the default value instead of the value set by the network interface. This patch modifies vlan so that it sets if_hw_tsomax to the value of the parent interface. Reviewed by: glebius MFC after: 2 weeks Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Tue Apr 15 20:53:53 2014 (r264516) +++ head/sys/net/if_vlan.c Tue Apr 15 21:48:35 2014 (r264517) @@ -1511,6 +1511,8 @@ vlan_capabilities(struct ifvlan *ifv) * propagate the hardware-assisted flag. TSO on VLANs * does not necessarily require hardware VLAN tagging. */ + if (p->if_hw_tsomax > 0) + ifp->if_hw_tsomax = p->if_hw_tsomax; if (p->if_capabilities & IFCAP_VLAN_HWTSO) ifp->if_capabilities |= p->if_capabilities & IFCAP_TSO; if (p->if_capenable & IFCAP_VLAN_HWTSO) { From owner-svn-src-head@FreeBSD.ORG Tue Apr 15 23:27:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C5D8F28; Tue, 15 Apr 2014 23:27:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 094CA1A32; Tue, 15 Apr 2014 23:27:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3FNREJ3091624; Tue, 15 Apr 2014 23:27:14 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3FNREOp091623; Tue, 15 Apr 2014 23:27:14 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404152327.s3FNREOp091623@svn.freebsd.org> From: Glen Barber Date: Tue, 15 Apr 2014 23:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264518 - head/release/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 23:27:15 -0000 Author: gjb Date: Tue Apr 15 23:27:14 2014 New Revision: 264518 URL: http://svnweb.freebsd.org/changeset/base/264518 Log: Fix armv6 build failure: "armv6-freebsd-gcc: not found" Help from: imp Sponsored by: The FreeBSD Foundation Modified: head/release/arm/release.sh Modified: head/release/arm/release.sh ============================================================================== --- head/release/arm/release.sh Tue Apr 15 21:48:35 2014 (r264517) +++ head/release/arm/release.sh Tue Apr 15 23:27:14 2014 (r264518) @@ -98,7 +98,7 @@ main() { eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/cc \ WITH_GCC=1 ${WORLD_FLAGS} -j1 obj depend all install # Build the 'xdev' target for crochet. - eval chroot ${CHROOTDIR} make -C /usr/src \ + eval chroot ${CHROOTDIR} make -C /usr/src WITHOUT_CLANG_IS_CC=1 \ XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} WITH_GCC=1 \ ${WORLD_FLAGS} xdev From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 05:31:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1FE6AD7; Wed, 16 Apr 2014 05:31:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C49901D77; Wed, 16 Apr 2014 05:31:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3G5VsYZ041852; Wed, 16 Apr 2014 05:31:54 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3G5VsbG041850; Wed, 16 Apr 2014 05:31:54 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201404160531.s3G5VsbG041850@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 16 Apr 2014 05:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264520 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 05:31:55 -0000 Author: ae Date: Wed Apr 16 05:31:54 2014 New Revision: 264520 URL: http://svnweb.freebsd.org/changeset/base/264520 Log: Remove _IP_VHL* macros and related ifdefs. MFC after: 1 week Modified: head/sys/netipsec/ipsec.c head/sys/netipsec/ipsec_output.c Modified: head/sys/netipsec/ipsec.c ============================================================================== --- head/sys/netipsec/ipsec.c Tue Apr 15 23:40:47 2014 (r264519) +++ head/sys/netipsec/ipsec.c Wed Apr 16 05:31:54 2014 (r264520) @@ -560,11 +560,7 @@ ipsec_setspidx(struct mbuf *m, struct se m_copydata(m, 0, sizeof(ipbuf), (caddr_t)&ipbuf); ip = &ipbuf; } -#ifdef _IP_VHL - v = _IP_VHL_V(ip->ip_vhl); -#else v = ip->ip_v; -#endif switch (v) { case 4: error = ipsec4_setspidx_ipaddr(m, spidx); @@ -608,11 +604,7 @@ ipsec4_get_ulp(struct mbuf *m, struct se struct ip *ip = mtod(m, struct ip *); if (ip->ip_off & htons(IP_MF | IP_OFFMASK)) goto done; -#ifdef _IP_VHL - off = _IP_VHL_HL(ip->ip_vhl) << 2; -#else off = ip->ip_hl << 2; -#endif nxt = ip->ip_p; } else { struct ip ih; @@ -620,11 +612,7 @@ ipsec4_get_ulp(struct mbuf *m, struct se m_copydata(m, 0, sizeof (struct ip), (caddr_t) &ih); if (ih.ip_off & htons(IP_MF | IP_OFFMASK)) goto done; -#ifdef _IP_VHL - off = _IP_VHL_HL(ih.ip_vhl) << 2; -#else off = ih.ip_hl << 2; -#endif nxt = ih.ip_p; } Modified: head/sys/netipsec/ipsec_output.c ============================================================================== --- head/sys/netipsec/ipsec_output.c Tue Apr 15 23:40:47 2014 (r264519) +++ head/sys/netipsec/ipsec_output.c Wed Apr 16 05:31:54 2014 (r264520) @@ -206,11 +206,7 @@ ipsec_process_done(struct mbuf *m, struc */ if (sav->natt_type) { struct ip *ip = mtod(m, struct ip *); -#ifdef _IP_VHL - const int hlen = IP_VHL_HL(ip->ip_vhl); -#else const int hlen = (ip->ip_hl << 2); -#endif int size, off; struct mbuf *mi; struct udphdr *udp; @@ -505,15 +501,7 @@ ipsec4_process_packet( ip = mtod(m, struct ip *); ip->ip_len = htons(m->m_pkthdr.len); ip->ip_sum = 0; -#ifdef _IP_VHL - if (ip->ip_vhl == IP_VHL_BORING) - ip->ip_sum = in_cksum_hdr(ip); - else - ip->ip_sum = in_cksum(m, - _IP_VHL_HL(ip->ip_vhl) << 2); -#else ip->ip_sum = in_cksum(m, ip->ip_hl << 2); -#endif /* Encapsulate the packet */ error = ipip_output(m, isr, &mp, 0, 0); From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 09:25:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50D41FCB; Wed, 16 Apr 2014 09:25:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30B651374; Wed, 16 Apr 2014 09:25:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3G9PL6F036451; Wed, 16 Apr 2014 09:25:21 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3G9PKi0036449; Wed, 16 Apr 2014 09:25:20 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201404160925.s3G9PKi0036449@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 16 Apr 2014 09:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264521 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 09:25:21 -0000 Author: glebius Date: Wed Apr 16 09:25:20 2014 New Revision: 264521 URL: http://svnweb.freebsd.org/changeset/base/264521 Log: Backout r257223,r257224,r257225,r257246,r257710. The changes caused some regressions in ICMP handling, and right now me and Baptiste are out of time on analyzing them. PR: 188253 Modified: head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_lb.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Wed Apr 16 05:31:54 2014 (r264520) +++ head/sys/netpfil/pf/pf.c Wed Apr 16 09:25:20 2014 (r264521) @@ -210,8 +210,6 @@ static void pf_change_ap(struct pf_add u_int16_t, u_int8_t, sa_family_t); static int pf_modulate_sack(struct mbuf *, int, struct pf_pdesc *, struct tcphdr *, struct pf_state_peer *); -static int pf_icmp_mapping(struct pf_pdesc *, uint8_t, int *, - int *, uint16_t *, uint16_t *); static void pf_change_icmp(struct pf_addr *, u_int16_t *, struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t *, u_int16_t *, u_int16_t *, @@ -258,10 +256,6 @@ static int pf_test_state_tcp(struct pf static int pf_test_state_udp(struct pf_state **, int, struct pfi_kif *, struct mbuf *, int, void *, struct pf_pdesc *); -static int pf_icmp_state_lookup(struct pf_state_key_cmp *, - struct pf_pdesc *, struct pf_state **, struct mbuf *, - int, struct pfi_kif *, uint16_t, uint16_t, - int, int *, int); static int pf_test_state_icmp(struct pf_state **, int, struct pfi_kif *, struct mbuf *, int, void *, struct pf_pdesc *, u_short *); @@ -310,8 +304,6 @@ VNET_DECLARE(int, pf_end_threads); VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); -enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_SOLICITED, PF_ICMP_MULTI_LINK }; - #define PACKET_LOOPED(pd) ((pd)->pf_mtag && \ (pd)->pf_mtag->flags & PF_PACKET_LOOPED) @@ -2057,155 +2049,6 @@ pf_change_a6(struct pf_addr *a, u_int16_ } #endif /* INET6 */ -static int -pf_icmp_mapping(struct pf_pdesc *pd, uint8_t type, - int *icmp_dir, int *multi, uint16_t *icmpid, uint16_t *icmptype) -{ - /* - * ICMP types marked with PF_OUT are typically responses to - * PF_IN, and will match states in the opposite direction. - * PF_IN ICMP types need to match a state with that type. - */ - *icmp_dir = PF_OUT; - *multi = PF_ICMP_MULTI_LINK; - /* Queries (and responses) */ - switch (type) { - case ICMP_ECHO: - *icmp_dir = PF_IN; - case ICMP_ECHOREPLY: - *icmptype = ICMP_ECHO; - *icmpid = pd->hdr.icmp->icmp_id; - break; - - case ICMP_TSTAMP: - *icmp_dir = PF_IN; - case ICMP_TSTAMPREPLY: - *icmptype = ICMP_TSTAMP; - *icmpid = pd->hdr.icmp->icmp_id; - break; - - case ICMP_IREQ: - *icmp_dir = PF_IN; - case ICMP_IREQREPLY: - *icmptype = ICMP_IREQ; - *icmpid = pd->hdr.icmp->icmp_id; - break; - - case ICMP_MASKREQ: - *icmp_dir = PF_IN; - case ICMP_MASKREPLY: - *icmptype = ICMP_MASKREQ; - *icmpid = pd->hdr.icmp->icmp_id; - break; - - case ICMP_IPV6_WHEREAREYOU: - *icmp_dir = PF_IN; - case ICMP_IPV6_IAMHERE: - *icmptype = ICMP_IPV6_WHEREAREYOU; - *icmpid = 0; /* Nothing sane to match on! */ - break; - - case ICMP_MOBILE_REGREQUEST: - *icmp_dir = PF_IN; - case ICMP_MOBILE_REGREPLY: - *icmptype = ICMP_MOBILE_REGREQUEST; - *icmpid = 0; /* Nothing sane to match on! */ - break; - - case ICMP_ROUTERSOLICIT: - *icmp_dir = PF_IN; - case ICMP_ROUTERADVERT: - *icmptype = ICMP_MOBILE_REGREQUEST; - *icmpid = 0; /* Nothing sane to match on! */ - break; - -#ifdef INET6 - case ICMP6_ECHO_REQUEST: - *icmp_dir = PF_IN; - case ICMP6_ECHO_REPLY: - *icmptype = ICMP6_ECHO_REPLY; - *icmpid = 0; /* Nothing sane to match on! */ - break; - - case MLD_LISTENER_QUERY: - *icmp_dir = PF_IN; - case MLD_LISTENER_REPORT: { - struct mld_hdr *mld = (void *)pd->hdr.icmp6; - - *icmptype = MLD_LISTENER_QUERY; - /* generate fake id for these messages */ - *icmpid = (mld->mld_addr.s6_addr32[0] ^ - mld->mld_addr.s6_addr32[1] ^ - mld->mld_addr.s6_addr32[2] ^ - mld->mld_addr.s6_addr32[3]) & 0xffff; - break; - } - - /* ICMP6_FQDN and ICMP6_NI query/reply are the same type as ICMP6_WRU */ - case ICMP6_WRUREQUEST: - *icmp_dir = PF_IN; - case ICMP6_WRUREPLY: - *icmptype = ICMP6_WRUREQUEST; - *icmpid = 0; /* Nothing sane to match on! */ - break; - - case MLD_MTRACE: - *icmp_dir = PF_IN; - case MLD_MTRACE_RESP: - *icmptype = MLD_MTRACE; - *icmpid = 0; /* Nothing sane to match on! */ - break; - - case ND_NEIGHBOR_SOLICIT: - *icmp_dir = PF_IN; - case ND_NEIGHBOR_ADVERT: { - struct nd_neighbor_solicit *nd = (void *)pd->hdr.icmp6; - - *icmptype = ND_NEIGHBOR_SOLICIT; - *multi = PF_ICMP_MULTI_SOLICITED; - /* generate fake id for these messages */ - *icmpid = (nd->nd_ns_target.s6_addr32[0] ^ - nd->nd_ns_target.s6_addr32[1] ^ - nd->nd_ns_target.s6_addr32[2] ^ - nd->nd_ns_target.s6_addr32[3]) & 0xffff; - break; - } - -#endif /* INET6 */ - /* These ICMP types map to other connections */ - case ICMP_UNREACH: - case ICMP_SOURCEQUENCH: - case ICMP_REDIRECT: - case ICMP_TIMXCEED: - case ICMP_PARAMPROB: -#ifdef INET6 - /* - * ICMP6_TIME_EXCEEDED is the same type as ICMP_UNREACH - * ND_REDIRECT can't be in this list because the triggering packet - * header is optional. - */ - case ICMP6_PACKET_TOO_BIG: -#endif /* INET6 */ - /* These will not be used, but set them anyways */ - *icmp_dir = PF_IN; - *icmptype = htons(type); - *icmpid = 0; - return (1); /* These types are matched to other state */ - /* - * All remaining ICMP types get their own states, - * and will only match in one direction. - */ - default: - *icmp_dir = PF_IN; - *icmptype = type; - *icmpid = 0; - break; - } - *icmptype = htons(*icmptype); - - return (0); -} - static void pf_change_icmp(struct pf_addr *ia, u_int16_t *ip, struct pf_addr *oa, struct pf_addr *na, u_int16_t np, u_int16_t *pc, u_int16_t *h2c, @@ -3180,8 +3023,8 @@ pf_test_rule(struct pf_rule **rm, struct int tag = -1, rtableid = -1; int asd = 0; int match = 0; - int state_icmp = 0, icmp_dir, multi; - uint16_t sport = 0 , dport = 0, virtual_type = 0, virtual_id = 0; + int state_icmp = 0; + u_int16_t sport = 0, dport = 0; u_int16_t bproto_sum = 0, bip_sum = 0; u_int8_t icmptype = 0, icmpcode = 0; struct pf_anchor_stackframe anchor_stack[PF_ANCHOR_STACKSIZE]; @@ -3210,38 +3053,33 @@ pf_test_rule(struct pf_rule **rm, struct case IPPROTO_ICMP: if (pd->af != AF_INET) break; + sport = dport = pd->hdr.icmp->icmp_id; hdrlen = sizeof(*pd->hdr.icmp); icmptype = pd->hdr.icmp->icmp_type; icmpcode = pd->hdr.icmp->icmp_code; - state_icmp = pf_icmp_mapping(pd, icmptype, - &icmp_dir, &multi, &virtual_id, &virtual_type); - if (icmp_dir == PF_IN) { - sport = virtual_id; - dport = virtual_type; - } else { - sport = virtual_type; - dport = virtual_id; - } + if (icmptype == ICMP_UNREACH || + icmptype == ICMP_SOURCEQUENCH || + icmptype == ICMP_REDIRECT || + icmptype == ICMP_TIMXCEED || + icmptype == ICMP_PARAMPROB) + state_icmp++; break; #endif /* INET */ #ifdef INET6 case IPPROTO_ICMPV6: if (af != AF_INET6) break; + sport = dport = pd->hdr.icmp6->icmp6_id; hdrlen = sizeof(*pd->hdr.icmp6); icmptype = pd->hdr.icmp6->icmp6_type; icmpcode = pd->hdr.icmp6->icmp6_code; - state_icmp = pf_icmp_mapping(pd, icmptype, - &icmp_dir, &multi, &virtual_id, &virtual_type); - if (icmp_dir == PF_IN) { - sport = virtual_id; - dport = virtual_type; - } else { - sport = virtual_type; - dport = virtual_id; - } + if (icmptype == ICMP6_DST_UNREACH || + icmptype == ICMP6_PACKET_TOO_BIG || + icmptype == ICMP6_TIME_EXCEEDED || + icmptype == ICMP6_PARAM_PROB) + state_icmp++; break; #endif /* INET6 */ default: @@ -3311,6 +3149,7 @@ pf_test_rule(struct pf_rule **rm, struct break; #ifdef INET case IPPROTO_ICMP: + nk->port[0] = nk->port[1]; if (PF_ANEQ(saddr, &nk->addr[pd->sidx], AF_INET)) pf_change_a(&saddr->v4.s_addr, pd->ip_sum, nk->addr[pd->sidx].v4.s_addr, 0); @@ -3319,12 +3158,11 @@ pf_test_rule(struct pf_rule **rm, struct pf_change_a(&daddr->v4.s_addr, pd->ip_sum, nk->addr[pd->didx].v4.s_addr, 0); - if (virtual_type == ICMP_ECHO && - nk->port[pd->sidx] != pd->hdr.icmp->icmp_id) { + if (nk->port[1] != pd->hdr.icmp->icmp_id) { pd->hdr.icmp->icmp_cksum = pf_cksum_fixup( pd->hdr.icmp->icmp_cksum, sport, - nk->port[pd->sidx], 0); - pd->hdr.icmp->icmp_id = nk->port[pd->sidx]; + nk->port[1], 0); + pd->hdr.icmp->icmp_id = nk->port[1]; pd->sport = &pd->hdr.icmp->icmp_id; } m_copyback(m, off, ICMP_MINLEN, (caddr_t)pd->hdr.icmp); @@ -4546,69 +4384,13 @@ pf_test_state_udp(struct pf_state **stat } static int -pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, - struct pf_state **state, struct mbuf *m, int direction, struct pfi_kif *kif, - uint16_t icmpid, uint16_t type, int icmp_dir, int *iidx, int multi) -{ - - key->af = pd->af; - key->proto = pd->proto; - if (icmp_dir == PF_IN) { - *iidx = pd->sidx; - key->port[pd->sidx] = icmpid; - key->port[pd->didx] = type; - } else { - *iidx = pd->didx; - key->port[pd->sidx] = type; - key->port[pd->didx] = icmpid; - } -#ifdef INET6 - if (pd->af == AF_INET6 && multi != PF_ICMP_MULTI_NONE) { - switch (multi) { - case PF_ICMP_MULTI_SOLICITED: - key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; - key->addr[pd->sidx].addr32[1] = 0; - key->addr[pd->sidx].addr32[2] = IPV6_ADDR_INT32_ONE; - key->addr[pd->sidx].addr32[3] = pd->src->addr32[3]; - key->addr[pd->sidx].addr8[12] = 0xff; - break; - case PF_ICMP_MULTI_LINK: - key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; - key->addr[pd->sidx].addr32[1] = 0; - key->addr[pd->sidx].addr32[2] = 0; - key->addr[pd->sidx].addr32[3] = IPV6_ADDR_INT32_ONE; - break; - } - } else -#endif - PF_ACPY(&key->addr[pd->sidx], pd->src, key->af); - PF_ACPY(&key->addr[pd->didx], pd->dst, key->af); - - STATE_LOOKUP(kif, key, direction, *state, pd); - - /* Is this ICMP message flowing in right direction? */ - if ((*state)->rule.ptr->type && - (((*state)->direction == direction) ? - PF_IN : PF_OUT) != icmp_dir) { - if (V_pf_status.debug >= PF_DEBUG_MISC) { - printf("pf: icmp type %d in wrong direction (%d): ", - icmp_dir, direction); - pf_print_state(*state); - printf("\n"); - } - return (PF_DROP); - } - return (-1); -} - -static int pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kif *kif, struct mbuf *m, int off, void *h, struct pf_pdesc *pd, u_short *reason) { struct pf_addr *saddr = pd->src, *daddr = pd->dst; - u_int16_t icmpid = 0, *icmpsum, virtual_id, virtual_type; + u_int16_t icmpid = 0, *icmpsum; u_int8_t icmptype; - int icmp_dir, iidx, ret, multi; + int state_icmp = 0; struct pf_state_key_cmp key; bzero(&key, sizeof(key)); @@ -4619,6 +4401,12 @@ pf_test_state_icmp(struct pf_state **sta icmpid = pd->hdr.icmp->icmp_id; icmpsum = &pd->hdr.icmp->icmp_cksum; + if (icmptype == ICMP_UNREACH || + icmptype == ICMP_SOURCEQUENCH || + icmptype == ICMP_REDIRECT || + icmptype == ICMP_TIMXCEED || + icmptype == ICMP_PARAMPROB) + state_icmp++; break; #endif /* INET */ #ifdef INET6 @@ -4627,35 +4415,34 @@ pf_test_state_icmp(struct pf_state **sta icmpid = pd->hdr.icmp6->icmp6_id; icmpsum = &pd->hdr.icmp6->icmp6_cksum; + if (icmptype == ICMP6_DST_UNREACH || + icmptype == ICMP6_PACKET_TOO_BIG || + icmptype == ICMP6_TIME_EXCEEDED || + icmptype == ICMP6_PARAM_PROB) + state_icmp++; break; #endif /* INET6 */ - default: - panic("%s: proto %d\n", __func__, pd->proto); } - if (pf_icmp_mapping(pd, icmptype, &icmp_dir, &multi, - &virtual_id, &virtual_type) == 0) { + if (!state_icmp) { + /* * ICMP query/reply message not related to a TCP/UDP packet. * Search for an ICMP state. */ - ret = pf_icmp_state_lookup(&key, pd, state, m, direction, - kif, virtual_id, virtual_type, icmp_dir, &iidx, - PF_ICMP_MULTI_NONE); - if (ret >= 0) { - if (ret == PF_DROP && pd->af == AF_INET6 && - icmp_dir == PF_OUT) { - if (*state) - PF_STATE_UNLOCK(*state); - ret = pf_icmp_state_lookup(&key, pd, state, m, - direction, kif, virtual_id, virtual_type, - icmp_dir, &iidx, multi); - if (ret >= 0) - return (ret); - } else - return (ret); + key.af = pd->af; + key.proto = pd->proto; + key.port[0] = key.port[1] = icmpid; + if (direction == PF_IN) { /* wire side, straight */ + PF_ACPY(&key.addr[0], pd->src, key.af); + PF_ACPY(&key.addr[1], pd->dst, key.af); + } else { /* stack side, reverse */ + PF_ACPY(&key.addr[1], pd->src, key.af); + PF_ACPY(&key.addr[0], pd->dst, key.af); } + STATE_LOOKUP(kif, &key, direction, *state, pd); + (*state)->expire = time_uptime; (*state)->timeout = PFTM_ICMP_ERROR_REPLY; @@ -4678,13 +4465,14 @@ pf_test_state_icmp(struct pf_state **sta pd->ip_sum, nk->addr[pd->didx].v4.s_addr, 0); - if (nk->port[iidx] != + if (nk->port[0] != pd->hdr.icmp->icmp_id) { pd->hdr.icmp->icmp_cksum = pf_cksum_fixup( pd->hdr.icmp->icmp_cksum, icmpid, - nk->port[iidx], 0); - pd->hdr.icmp->icmp_id = nk->port[iidx]; + nk->port[pd->sidx], 0); + pd->hdr.icmp->icmp_id = + nk->port[pd->sidx]; } m_copyback(m, off, ICMP_MINLEN, @@ -5034,15 +4822,13 @@ pf_test_state_icmp(struct pf_state **sta return (PF_DROP); } - pd2.hdr.icmp = &iih; - pf_icmp_mapping(&pd2, iih.icmp_type, - &icmp_dir, &multi, &virtual_id, &virtual_type); - - ret = pf_icmp_state_lookup(&key, &pd2, state, m, - direction, kif, virtual_id, virtual_type, - icmp_dir, &iidx, PF_ICMP_MULTI_NONE); - if (ret >= 0) - return (ret); + key.af = pd2.af; + key.proto = IPPROTO_ICMP; + PF_ACPY(&key.addr[pd2.sidx], pd2.src, key.af); + PF_ACPY(&key.addr[pd2.didx], pd2.dst, key.af); + key.port[0] = key.port[1] = iih.icmp_id; + + STATE_LOOKUP(kif, &key, direction, *state, pd); /* translate source/destination address, if necessary */ if ((*state)->key[PF_SK_WIRE] != @@ -5052,20 +4838,20 @@ pf_test_state_icmp(struct pf_state **sta if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || - (virtual_type == ICMP_ECHO && - nk->port[iidx] != iih.icmp_id)) - pf_change_icmp(pd2.src, - (virtual_type == ICMP_ECHO) ? - &iih.icmp_id : NULL, + nk->port[pd2.sidx] != iih.icmp_id) + pf_change_icmp(pd2.src, &iih.icmp_id, daddr, &nk->addr[pd2.sidx], nk->port[pd2.sidx], NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET); if (PF_ANEQ(pd2.dst, - &nk->addr[pd2.didx], pd2.af)) - pf_change_icmp(pd2.dst, NULL, NULL, - &nk->addr[pd2.didx], 0, NULL, + &nk->addr[pd2.didx], pd2.af) || + nk->port[pd2.didx] != iih.icmp_id) + pf_change_icmp(pd2.dst, &iih.icmp_id, + NULL, /* XXX Inbound NAT? */ + &nk->addr[pd2.didx], + nk->port[pd2.didx], NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET); @@ -5089,26 +4875,13 @@ pf_test_state_icmp(struct pf_state **sta return (PF_DROP); } - pd2.hdr.icmp6 = &iih; - pf_icmp_mapping(&pd2, iih.icmp6_type, - &icmp_dir, &multi, &virtual_id, &virtual_type); - ret = pf_icmp_state_lookup(&key, &pd2, state, m, - direction, kif, virtual_id, virtual_type, - icmp_dir, &iidx, PF_ICMP_MULTI_NONE); - if (ret >= 0) { - if (ret == PF_DROP && pd->af == AF_INET6 && - icmp_dir == PF_OUT) { - if (*state) - PF_STATE_UNLOCK(*state); - ret = pf_icmp_state_lookup(&key, pd, - state, m, direction, kif, - virtual_id, virtual_type, - icmp_dir, &iidx, multi); - if (ret >= 0) - return (ret); - } else - return (ret); - } + key.af = pd2.af; + key.proto = IPPROTO_ICMPV6; + PF_ACPY(&key.addr[pd2.sidx], pd2.src, key.af); + PF_ACPY(&key.addr[pd2.didx], pd2.dst, key.af); + key.port[0] = key.port[1] = iih.icmp6_id; + + STATE_LOOKUP(kif, &key, direction, *state, pd); /* translate source/destination address, if necessary */ if ((*state)->key[PF_SK_WIRE] != @@ -5118,21 +4891,20 @@ pf_test_state_icmp(struct pf_state **sta if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || - ((virtual_type == ICMP6_ECHO_REQUEST) && - nk->port[pd2.sidx] != iih.icmp6_id)) - pf_change_icmp(pd2.src, - (virtual_type == ICMP6_ECHO_REQUEST) - ? &iih.icmp6_id : NULL, + nk->port[pd2.sidx] != iih.icmp6_id) + pf_change_icmp(pd2.src, &iih.icmp6_id, daddr, &nk->addr[pd2.sidx], - (virtual_type == ICMP6_ECHO_REQUEST) - ? nk->port[iidx] : 0, NULL, + nk->port[pd2.sidx], NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET6); if (PF_ANEQ(pd2.dst, - &nk->addr[pd2.didx], pd2.af)) - pf_change_icmp(pd2.dst, NULL, NULL, - &nk->addr[pd2.didx], 0, NULL, + &nk->addr[pd2.didx], pd2.af) || + nk->port[pd2.didx] != iih.icmp6_id) + pf_change_icmp(pd2.dst, &iih.icmp6_id, + NULL, /* XXX Inbound NAT? */ + &nk->addr[pd2.didx], + nk->port[pd2.didx], NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET6); @@ -6455,32 +6227,10 @@ pf_test6(int dir, struct ifnet *ifp, str } case IPPROTO_ICMPV6: { - union { - struct icmp6_hdr icmp6; - struct mld_hdr mld; - struct nd_neighbor_solicit nd; - } ih; - size_t icmp_hlen = sizeof(struct icmp6_hdr); + struct icmp6_hdr ih; - pd.hdr.icmp6 = &ih.icmp6; - if (!pf_pull_hdr(m, off, &ih, icmp_hlen, - &action, &reason, AF_INET6)) { - log = action != PF_PASS; - goto done; - } - /* ICMP headers we look further into to match state */ - switch (ih.icmp6.icmp6_type) { - case MLD_LISTENER_QUERY: - case MLD_LISTENER_REPORT: - icmp_hlen = sizeof(struct mld_hdr); - break; - case ND_NEIGHBOR_SOLICIT: - case ND_NEIGHBOR_ADVERT: - icmp_hlen = sizeof(struct nd_neighbor_solicit); - break; - } - if (icmp_hlen > sizeof(struct icmp6_hdr) && - !pf_pull_hdr(m, off, &ih, icmp_hlen, + pd.hdr.icmp6 = &ih; + if (!pf_pull_hdr(m, off, &ih, sizeof(ih), &action, &reason, AF_INET6)) { log = action != PF_PASS; goto done; Modified: head/sys/netpfil/pf/pf_lb.c ============================================================================== --- head/sys/netpfil/pf/pf_lb.c Wed Apr 16 05:31:54 2014 (r264520) +++ head/sys/netpfil/pf/pf_lb.c Wed Apr 16 09:25:20 2014 (r264521) @@ -53,15 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include - -#ifdef INET6 -#include -#include -#endif - #define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x static void pf_hash(struct pf_addr *, struct pf_addr *, @@ -232,21 +223,9 @@ pf_get_sport(sa_family_t af, u_int8_t pr if (pf_map_addr(af, r, saddr, naddr, &init_addr, sn)) return (1); - switch (proto) { - case IPPROTO_ICMP: - if (dport != htons(ICMP_ECHO)) - return (0); - low = 1; - high = 65535; - break; -#ifdef INET6 - case IPPROTO_ICMPV6: - if (dport != htons(ICMP6_ECHO_REQUEST)) - return (0); + if (proto == IPPROTO_ICMP) { low = 1; high = 65535; - break; -#endif } bzero(&key, sizeof(key)); From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 10:06:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFBDDA0A; Wed, 16 Apr 2014 10:06:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B61B1748; Wed, 16 Apr 2014 10:06:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GA6cQr052919; Wed, 16 Apr 2014 10:06:38 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GA6bEK052912; Wed, 16 Apr 2014 10:06:37 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404161006.s3GA6bEK052912@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 16 Apr 2014 10:06:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264524 - in head: sys/cam/ctl usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 10:06:38 -0000 Author: trasz Date: Wed Apr 16 10:06:37 2014 New Revision: 264524 URL: http://svnweb.freebsd.org/changeset/base/264524 Log: Make it possible for the iSCSI target side to operate in both normal and ICL_KERNEL_PROXY mode, and fix some bit rot so the latter actually works again. Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/cam/ctl/ctl_ioctl.h head/usr.sbin/ctld/ctld.c head/usr.sbin/ctld/kernel.c head/usr.sbin/ctld/pdu.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Apr 16 10:05:35 2014 (r264523) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Apr 16 10:06:37 2014 (r264524) @@ -1419,9 +1419,7 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * struct cfiscsi_session *cs; struct cfiscsi_target *ct; struct ctl_iscsi_handoff_params *cihp; -#ifndef ICL_KERNEL_PROXY int error; -#endif cihp = (struct ctl_iscsi_handoff_params *)&(ci->data); softc = &cfiscsi_softc; @@ -1446,27 +1444,39 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * } #ifdef ICL_KERNEL_PROXY - mtx_lock(&cfiscsi_softc.lock); - TAILQ_FOREACH(cs, &cfiscsi_softc.sessions, cs_next) { - if (cs->cs_id == cihp->socket) - break; - } - if (cs == NULL) { - mtx_unlock(&cfiscsi_softc.lock); - snprintf(ci->error_str, sizeof(ci->error_str), "connection not found"); + if (cihp->socket > 0 && cihp->connection_id > 0) { + snprintf(ci->error_str, sizeof(ci->error_str), + "both socket and connection_id set"); ci->status = CTL_ISCSI_ERROR; cfiscsi_target_release(ct); return; } - mtx_unlock(&cfiscsi_softc.lock); -#else - cs = cfiscsi_session_new(softc); - if (cs == NULL) { - ci->status = CTL_ISCSI_ERROR; - snprintf(ci->error_str, sizeof(ci->error_str), - "%s: cfiscsi_session_new failed", __func__); - cfiscsi_target_release(ct); - return; + if (cihp->socket == 0) { + mtx_lock(&cfiscsi_softc.lock); + TAILQ_FOREACH(cs, &cfiscsi_softc.sessions, cs_next) { + if (cs->cs_id == cihp->socket) + break; + } + if (cs == NULL) { + mtx_unlock(&cfiscsi_softc.lock); + snprintf(ci->error_str, sizeof(ci->error_str), + "connection not found"); + ci->status = CTL_ISCSI_ERROR; + cfiscsi_target_release(ct); + return; + } + mtx_unlock(&cfiscsi_softc.lock); + } else { +#endif + cs = cfiscsi_session_new(softc); + if (cs == NULL) { + ci->status = CTL_ISCSI_ERROR; + snprintf(ci->error_str, sizeof(ci->error_str), + "%s: cfiscsi_session_new failed", __func__); + cfiscsi_target_release(ct); + return; + } +#ifdef ICL_KERNEL_PROXY } #endif cs->cs_target = ct; @@ -1495,16 +1505,18 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * cihp->initiator_alias, sizeof(cs->cs_initiator_alias)); #ifdef ICL_KERNEL_PROXY - cs->cs_login_phase = false; -#else - error = icl_conn_handoff(cs->cs_conn, cihp->socket); - if (error != 0) { - cfiscsi_session_delete(cs); - ci->status = CTL_ISCSI_ERROR; - snprintf(ci->error_str, sizeof(ci->error_str), - "%s: icl_conn_handoff failed with error %d", - __func__, error); - return; + if (cihp->socket > 0) { +#endif + error = icl_conn_handoff(cs->cs_conn, cihp->socket); + if (error != 0) { + cfiscsi_session_delete(cs); + ci->status = CTL_ISCSI_ERROR; + snprintf(ci->error_str, sizeof(ci->error_str), + "%s: icl_conn_handoff failed with error %d", + __func__, error); + return; + } +#ifdef ICL_KERNEL_PROXY } #endif @@ -1514,6 +1526,8 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * cfiscsi_session_register_initiator(cs); #ifdef ICL_KERNEL_PROXY + cs->cs_login_phase = false; + /* * First PDU of the Full Feature phase has likely already arrived. * We have to pick it up and execute properly. @@ -1831,7 +1845,9 @@ cfiscsi_ioctl_send(struct ctl_iscsi *ci) icl_pdu_append_data(ip, data, datalen, M_WAITOK); free(data, M_CFISCSI); } + CFISCSI_SESSION_LOCK(cs); icl_pdu_queue(ip); + CFISCSI_SESSION_UNLOCK(cs); ci->status = CTL_ISCSI_OK; } Modified: head/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- head/sys/cam/ctl/ctl_ioctl.h Wed Apr 16 10:05:35 2014 (r264523) +++ head/sys/cam/ctl/ctl_ioctl.h Wed Apr 16 10:06:37 2014 (r264524) @@ -640,15 +640,7 @@ struct ctl_iscsi_handoff_params { char initiator_addr[CTL_ISCSI_ADDR_LEN]; char initiator_alias[CTL_ISCSI_ALIAS_LEN]; char target_name[CTL_ISCSI_NAME_LEN]; -#ifdef ICL_KERNEL_PROXY - int connection_id; - /* - * XXX - */ int socket; -#else - int socket; -#endif int portal_group_tag; /* @@ -662,7 +654,12 @@ struct ctl_iscsi_handoff_params { uint32_t max_burst_length; uint32_t first_burst_length; uint32_t immediate_data; +#ifdef ICL_KERNEL_PROXY + int connection_id; + int spare[3]; +#else int spare[4]; +#endif }; struct ctl_iscsi_list_params { @@ -715,7 +712,7 @@ struct ctl_iscsi_send_params { void *spare2; size_t data_segment_len; void *data_segment; - int spare[4]; + int spare3[4]; }; struct ctl_iscsi_receive_params { @@ -725,7 +722,7 @@ struct ctl_iscsi_receive_params { void *spare2; size_t data_segment_len; void *data_segment; - int spare[4]; + int spare3[4]; }; struct ctl_iscsi_close_params { Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Wed Apr 16 10:05:35 2014 (r264523) +++ head/usr.sbin/ctld/ctld.c Wed Apr 16 10:06:37 2014 (r264524) @@ -48,6 +48,8 @@ #include "ctld.h" +bool proxy_mode = false; + static volatile bool sighup_received = false; static volatile bool sigterm_received = false; static volatile bool sigalrm_received = false; @@ -553,14 +555,6 @@ portal_group_add_listen(struct portal_gr const char *port; int error, colons = 0; -#ifndef ICL_KERNEL_PROXY - if (iser) { - log_warnx("ctld(8) compiled without ICL_KERNEL_PROXY " - "does not support iSER protocol"); - return (-1); - } -#endif - portal = portal_new(pg); portal->p_listen = checked_strdup(value); portal->p_iser = iser; @@ -1180,9 +1174,7 @@ conf_apply(struct conf *oldconf, struct struct portal *oldp, *newp; pid_t otherpid; int changed, cumulated_error = 0, error; -#ifndef ICL_KERNEL_PROXY int one = 1; -#endif if (oldconf->conf_debug != newconf->conf_debug) { log_debugx("changing debug level to %d", newconf->conf_debug); @@ -1415,10 +1407,14 @@ conf_apply(struct conf *oldconf, struct } #ifdef ICL_KERNEL_PROXY - log_debugx("listening on %s, portal-group \"%s\" using ICL proxy", - newp->p_listen, newpg->pg_name); - kernel_listen(newp->p_ai, newp->p_iser); -#else + if (proxy_mode) { + log_debugx("listening on %s, portal-group \"%s\" using ICL proxy", + newp->p_listen, newpg->pg_name); + kernel_listen(newp->p_ai, newp->p_iser); + continue; + } +#endif + assert(proxy_mode == false); assert(newp->p_iser == false); log_debugx("listening on %s, portal-group \"%s\"", @@ -1461,7 +1457,6 @@ conf_apply(struct conf *oldconf, struct cumulated_error++; continue; } -#endif /* !ICL_KERNEL_PROXY */ } } @@ -1579,11 +1574,9 @@ static void handle_connection(struct portal *portal, int fd, bool dont_fork) { struct connection *conn; -#ifndef ICL_KERNEL_PROXY struct sockaddr_storage ss; socklen_t sslen = sizeof(ss); int error; -#endif pid_t pid; char host[NI_MAXHOST + 1]; struct conf *conf; @@ -1619,20 +1612,25 @@ handle_connection(struct portal *portal, /* * XXX */ - log_set_peer_addr("XXX"); -#else - error = getpeername(fd, (struct sockaddr *)&ss, &sslen); - if (error != 0) - log_err(1, "getpeername"); - error = getnameinfo((struct sockaddr *)&ss, sslen, - host, sizeof(host), NULL, 0, NI_NUMERICHOST); - if (error != 0) - log_errx(1, "getaddrinfo: %s", gai_strerror(error)); - - log_debugx("accepted connection from %s; portal group \"%s\"", - host, portal->p_portal_group->pg_name); - log_set_peer_addr(host); - setproctitle("%s", host); + if (proxy_mode) { + log_set_peer_addr("XXX"); + } else { +#endif + assert(proxy_mode == false); + error = getpeername(fd, (struct sockaddr *)&ss, &sslen); + if (error != 0) + log_err(1, "getpeername"); + error = getnameinfo((struct sockaddr *)&ss, sslen, + host, sizeof(host), NULL, 0, NI_NUMERICHOST); + if (error != 0) + log_errx(1, "getaddrinfo: %s", gai_strerror(error)); + + log_debugx("accepted connection from %s; portal group \"%s\"", + host, portal->p_portal_group->pg_name); + log_set_peer_addr(host); + setproctitle("%s", host); +#ifdef ICL_KERNEL_PROXY + } #endif conn = connection_new(portal, fd, host); @@ -1650,7 +1648,6 @@ handle_connection(struct portal *portal, exit(0); } -#ifndef ICL_KERNEL_PROXY static int fd_add(int fd, fd_set *fdset, int nfds) { @@ -1666,7 +1663,6 @@ fd_add(int fd, fd_set *fdset, int nfds) nfds = fd; return (nfds); } -#endif static void main_loop(struct conf *conf, bool dont_fork) @@ -1675,10 +1671,9 @@ main_loop(struct conf *conf, bool dont_f struct portal *portal; #ifdef ICL_KERNEL_PROXY int connection_id; -#else +#endif fd_set fdset; int error, nfds, client_fd; -#endif pidfile_write(conf->conf_pidfh); @@ -1687,42 +1682,48 @@ main_loop(struct conf *conf, bool dont_f return; #ifdef ICL_KERNEL_PROXY - connection_id = kernel_accept(); - if (connection_id == 0) - continue; + if (proxy_mode) { + connection_id = kernel_accept(); + if (connection_id == 0) + continue; - /* - * XXX: This is obviously temporary. - */ - pg = TAILQ_FIRST(&conf->conf_portal_groups); - portal = TAILQ_FIRST(&pg->pg_portals); + /* + * XXX: This is obviously temporary. + */ + pg = TAILQ_FIRST(&conf->conf_portal_groups); + portal = TAILQ_FIRST(&pg->pg_portals); - handle_connection(portal, connection_id, dont_fork); -#else - FD_ZERO(&fdset); - nfds = 0; - TAILQ_FOREACH(pg, &conf->conf_portal_groups, pg_next) { - TAILQ_FOREACH(portal, &pg->pg_portals, p_next) - nfds = fd_add(portal->p_socket, &fdset, nfds); - } - error = select(nfds + 1, &fdset, NULL, NULL, NULL); - if (error <= 0) { - if (errno == EINTR) - return; - log_err(1, "select"); - } - TAILQ_FOREACH(pg, &conf->conf_portal_groups, pg_next) { - TAILQ_FOREACH(portal, &pg->pg_portals, p_next) { - if (!FD_ISSET(portal->p_socket, &fdset)) - continue; - client_fd = accept(portal->p_socket, NULL, 0); - if (client_fd < 0) - log_err(1, "accept"); - handle_connection(portal, client_fd, dont_fork); - break; + handle_connection(portal, connection_id, dont_fork); + } else { +#endif + assert(proxy_mode == false); + + FD_ZERO(&fdset); + nfds = 0; + TAILQ_FOREACH(pg, &conf->conf_portal_groups, pg_next) { + TAILQ_FOREACH(portal, &pg->pg_portals, p_next) + nfds = fd_add(portal->p_socket, &fdset, nfds); + } + error = select(nfds + 1, &fdset, NULL, NULL, NULL); + if (error <= 0) { + if (errno == EINTR) + return; + log_err(1, "select"); + } + TAILQ_FOREACH(pg, &conf->conf_portal_groups, pg_next) { + TAILQ_FOREACH(portal, &pg->pg_portals, p_next) { + if (!FD_ISSET(portal->p_socket, &fdset)) + continue; + client_fd = accept(portal->p_socket, NULL, 0); + if (client_fd < 0) + log_err(1, "accept"); + handle_connection(portal, client_fd, dont_fork); + break; + } } +#ifdef ICL_KERNEL_PROXY } -#endif /* !ICL_KERNEL_PROXY */ +#endif } } @@ -1788,7 +1789,7 @@ main(int argc, char **argv) int debug = 0, ch, error; bool dont_daemonize = false; - while ((ch = getopt(argc, argv, "df:")) != -1) { + while ((ch = getopt(argc, argv, "df:R")) != -1) { switch (ch) { case 'd': dont_daemonize = true; @@ -1797,6 +1798,13 @@ main(int argc, char **argv) case 'f': config_path = optarg; break; + case 'R': +#ifndef ICL_KERNEL_PROXY + log_errx(1, "ctld(8) compiled without ICL_KERNEL_PROXY " + "does not support iSER protocol"); +#endif + proxy_mode = true; + break; case '?': default: usage(); @@ -1818,12 +1826,10 @@ main(int argc, char **argv) newconf->conf_debug = debug; } -#ifdef ICL_KERNEL_PROXY log_debugx("enabling CTL iSCSI port"); error = kernel_port_on(); if (error != 0) log_errx(1, "failed to enable CTL iSCSI port, exiting"); -#endif error = conf_apply(oldconf, newconf); if (error != 0) @@ -1833,13 +1839,6 @@ main(int argc, char **argv) register_signals(); -#ifndef ICL_KERNEL_PROXY - log_debugx("enabling CTL iSCSI port"); - error = kernel_port_on(); - if (error != 0) - log_errx(1, "failed to enable CTL iSCSI port, exiting"); -#endif - if (dont_daemonize == false) { log_debugx("daemonizing"); if (daemon(0, 0) == -1) { Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Wed Apr 16 10:05:35 2014 (r264523) +++ head/usr.sbin/ctld/kernel.c Wed Apr 16 10:06:37 2014 (r264524) @@ -65,11 +65,13 @@ #include #include +#include "ctld.h" + #ifdef ICL_KERNEL_PROXY #include #endif -#include "ctld.h" +extern bool proxy_mode; static int ctl_fd = 0; @@ -599,7 +601,14 @@ kernel_handoff(struct connection *conn) } strlcpy(req.data.handoff.target_name, conn->conn_target->t_name, sizeof(req.data.handoff.target_name)); +#ifdef ICL_KERNEL_PROXY + if (proxy_mode) + req.data.handoff.connection_id = conn->conn_socket; + else + req.data.handoff.socket = conn->conn_socket; +#else req.data.handoff.socket = conn->conn_socket; +#endif req.data.handoff.portal_group_tag = conn->conn_portal->p_portal_group->pg_tag; if (conn->conn_header_digest == CONN_DIGEST_CRC32C) Modified: head/usr.sbin/ctld/pdu.c ============================================================================== --- head/usr.sbin/ctld/pdu.c Wed Apr 16 10:05:35 2014 (r264523) +++ head/usr.sbin/ctld/pdu.c Wed Apr 16 10:06:37 2014 (r264524) @@ -44,6 +44,8 @@ #include #endif +extern bool proxy_mode; + static int pdu_ahs_length(const struct pdu *pdu) { @@ -101,11 +103,13 @@ pdu_new_response(struct pdu *request) #ifdef ICL_KERNEL_PROXY -void -pdu_receive(struct pdu *pdu) +static void +pdu_receive_proxy(struct pdu *pdu) { size_t len; + assert(proxy_mode); + kernel_receive(pdu); len = pdu_ahs_length(pdu); @@ -117,15 +121,17 @@ pdu_receive(struct pdu *pdu) pdu->pdu_data_len = len; } -void -pdu_send(struct pdu *pdu) +static void +pdu_send_proxy(struct pdu *pdu) { + assert(proxy_mode); + pdu_set_data_segment_length(pdu, pdu->pdu_data_len); kernel_send(pdu); } -#else /* !ICL_KERNEL_PROXY */ +#endif /* ICL_KERNEL_PROXY */ static size_t pdu_padding(const struct pdu *pdu) @@ -161,6 +167,13 @@ pdu_receive(struct pdu *pdu) size_t len, padding; char dummy[4]; +#ifdef ICL_KERNEL_PROXY + if (proxy_mode) + return (pdu_receive_proxy(pdu)); +#endif + + assert(proxy_mode == false); + pdu_read(pdu->pdu_connection->conn_socket, (char *)pdu->pdu_bhs, sizeof(*pdu->pdu_bhs)); @@ -202,6 +215,13 @@ pdu_send(struct pdu *pdu) struct iovec iov[3]; int iovcnt; +#ifdef ICL_KERNEL_PROXY + if (proxy_mode) + return (pdu_send_proxy(pdu)); +#endif + + assert(proxy_mode == false); + pdu_set_data_segment_length(pdu, pdu->pdu_data_len); iov[0].iov_base = pdu->pdu_bhs; iov[0].iov_len = sizeof(*pdu->pdu_bhs); @@ -234,8 +254,6 @@ pdu_send(struct pdu *pdu) log_errx(1, "short write"); } -#endif /* !ICL_KERNEL_PROXY */ - void pdu_delete(struct pdu *pdu) { From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 10:18:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 552EACD8; Wed, 16 Apr 2014 10:18:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 259A41843; Wed, 16 Apr 2014 10:18:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GAIj6s057230; Wed, 16 Apr 2014 10:18:45 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GAIi2l057227; Wed, 16 Apr 2014 10:18:44 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404161018.s3GAIi2l057227@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 16 Apr 2014 10:18:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264525 - in head/sys: cam/ctl dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 10:18:45 -0000 Author: trasz Date: Wed Apr 16 10:18:44 2014 New Revision: 264525 URL: http://svnweb.freebsd.org/changeset/base/264525 Log: Add some stuff to make it easier to figure out for the system administrator whether the ICL_KERNEL_PROXY stuff got compiled in correctly. Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/cam/ctl/ctl_ioctl.h head/sys/dev/iscsi/iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Apr 16 10:06:37 2014 (r264524) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Apr 16 10:18:44 2014 (r264525) @@ -75,6 +75,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef ICL_KERNEL_PROXY +FEATURE(cfiscsi_kernel_proxy, "iSCSI target built with ICL_KERNEL_PROXY"); +#endif + static MALLOC_DEFINE(M_CFISCSI, "cfiscsi", "Memory used for CTL iSCSI frontend"); static uma_zone_t cfiscsi_data_wait_zone; @@ -1960,7 +1964,18 @@ cfiscsi_ioctl(struct cdev *dev, case CTL_ISCSI_CLOSE: cfiscsi_ioctl_close(ci); break; -#endif /* ICL_KERNEL_PROXY */ +#else + case CTL_ISCSI_LISTEN: + case CTL_ISCSI_ACCEPT: + case CTL_ISCSI_SEND: + case CTL_ISCSI_RECEIVE: + case CTL_ISCSI_CLOSE: + ci->status = CTL_ISCSI_ERROR; + snprintf(ci->error_str, sizeof(ci->error_str), + "%s: CTL compiled without ICL_KERNEL_PROXY", + __func__); + break; +#endif /* !ICL_KERNEL_PROXY */ default: ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), Modified: head/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- head/sys/cam/ctl/ctl_ioctl.h Wed Apr 16 10:06:37 2014 (r264524) +++ head/sys/cam/ctl/ctl_ioctl.h Wed Apr 16 10:18:44 2014 (r264525) @@ -617,7 +617,11 @@ typedef enum { CTL_ISCSI_LIST, CTL_ISCSI_LOGOUT, CTL_ISCSI_TERMINATE, -#ifdef ICL_KERNEL_PROXY +#if defined(ICL_KERNEL_PROXY) || 1 + /* + * We actually need those in all cases, but leave the ICL_KERNEL_PROXY, + * to remember to remove them along with rest of proxy code, eventually. + */ CTL_ISCSI_LISTEN, CTL_ISCSI_ACCEPT, CTL_ISCSI_SEND, Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Wed Apr 16 10:06:37 2014 (r264524) +++ head/sys/dev/iscsi/iscsi.c Wed Apr 16 10:18:44 2014 (r264525) @@ -66,6 +66,10 @@ #include #endif +#ifdef ICL_KERNEL_PROXY +FEATURE(iscsi_kernel_proxy, "iSCSI initiator built with ICL_KERNEL_PROXY"); +#endif + /* * XXX: This is global so the iscsi_unload() can access it. * Think about how to do this properly. From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 10:29:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CEE4DDD; Wed, 16 Apr 2014 10:29:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAB5B196A; Wed, 16 Apr 2014 10:29:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GATaVo061485; Wed, 16 Apr 2014 10:29:36 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GATZOR061477; Wed, 16 Apr 2014 10:29:35 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404161029.s3GATZOR061477@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 16 Apr 2014 10:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264526 - in head: sys/cam/ctl sys/dev/iscsi usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 10:29:36 -0000 Author: trasz Date: Wed Apr 16 10:29:34 2014 New Revision: 264526 URL: http://svnweb.freebsd.org/changeset/base/264526 Log: Properly identify target portal when running in proxy mode. While here, remove CTL_ISCSI_CLOSE, it wasn't used or implemented anyway. Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/cam/ctl/ctl_frontend_iscsi.h head/sys/cam/ctl/ctl_ioctl.h head/sys/dev/iscsi/icl.h head/sys/dev/iscsi/icl_proxy.c head/usr.sbin/ctld/ctld.c head/usr.sbin/ctld/ctld.h head/usr.sbin/ctld/kernel.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Apr 16 10:18:44 2014 (r264525) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Apr 16 10:29:34 2014 (r264526) @@ -1350,7 +1350,7 @@ cfiscsi_module_event_handler(module_t mo #ifdef ICL_KERNEL_PROXY static void -cfiscsi_accept(struct socket *so) +cfiscsi_accept(struct socket *so, int portal_id) { struct cfiscsi_session *cs; @@ -1361,6 +1361,7 @@ cfiscsi_accept(struct socket *so) } icl_conn_handoff_sock(cs->cs_conn, so); + cs->cs_portal_id = portal_id; cs->cs_waiting_for_ctld = true; cv_signal(&cfiscsi_softc.accept_cv); } @@ -1739,7 +1740,7 @@ cfiscsi_ioctl_listen(struct ctl_iscsi *c } error = icl_listen_add(cfiscsi_softc.listener, cilp->iser, cilp->domain, - cilp->socktype, cilp->protocol, sa); + cilp->socktype, cilp->protocol, sa, cilp->portal_id); if (error != 0) { free(sa, M_SONAME); CFISCSI_DEBUG("icl_listen_add, error %d", error); @@ -1783,6 +1784,7 @@ cfiscsi_ioctl_accept(struct ctl_iscsi *c cs->cs_login_phase = true; ciap->connection_id = cs->cs_id; + ciap->portal_id = cs->cs_portal_id; ci->status = CTL_ISCSI_OK; } @@ -1916,13 +1918,6 @@ cfiscsi_ioctl_receive(struct ctl_iscsi * ci->status = CTL_ISCSI_OK; } -static void -cfiscsi_ioctl_close(struct ctl_iscsi *ci) -{ - /* - * XXX - */ -} #endif /* !ICL_KERNEL_PROXY */ static int @@ -1961,15 +1956,11 @@ cfiscsi_ioctl(struct cdev *dev, case CTL_ISCSI_RECEIVE: cfiscsi_ioctl_receive(ci); break; - case CTL_ISCSI_CLOSE: - cfiscsi_ioctl_close(ci); - break; #else case CTL_ISCSI_LISTEN: case CTL_ISCSI_ACCEPT: case CTL_ISCSI_SEND: case CTL_ISCSI_RECEIVE: - case CTL_ISCSI_CLOSE: ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), "%s: CTL compiled without ICL_KERNEL_PROXY", Modified: head/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.h Wed Apr 16 10:18:44 2014 (r264525) +++ head/sys/cam/ctl/ctl_frontend_iscsi.h Wed Apr 16 10:29:34 2014 (r264526) @@ -82,6 +82,7 @@ struct cfiscsi_session { unsigned int cs_id; int cs_ctl_initid; #ifdef ICL_KERNEL_PROXY + int cs_portal_id; bool cs_login_phase; bool cs_waiting_for_ctld; struct cv cs_login_cv; Modified: head/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- head/sys/cam/ctl/ctl_ioctl.h Wed Apr 16 10:18:44 2014 (r264525) +++ head/sys/cam/ctl/ctl_ioctl.h Wed Apr 16 10:29:34 2014 (r264526) @@ -626,7 +626,6 @@ typedef enum { CTL_ISCSI_ACCEPT, CTL_ISCSI_SEND, CTL_ISCSI_RECEIVE, - CTL_ISCSI_CLOSE, #endif } ctl_iscsi_type; @@ -701,11 +700,14 @@ struct ctl_iscsi_listen_params { int protocol; struct sockaddr *addr; socklen_t addrlen; + int portal_id; int spare[4]; }; struct ctl_iscsi_accept_params { int connection_id; + struct sockaddr *initiator_addr; + int portal_id; int spare[4]; }; @@ -729,10 +731,6 @@ struct ctl_iscsi_receive_params { int spare3[4]; }; -struct ctl_iscsi_close_params { - int connection_id; - int spare[4]; -}; #endif /* ICL_KERNEL_PROXY */ union ctl_iscsi_data { @@ -745,7 +743,6 @@ union ctl_iscsi_data { struct ctl_iscsi_accept_params accept; struct ctl_iscsi_send_params send; struct ctl_iscsi_receive_params receive; - struct ctl_iscsi_close_params close; #endif }; Modified: head/sys/dev/iscsi/icl.h ============================================================================== --- head/sys/dev/iscsi/icl.h Wed Apr 16 10:18:44 2014 (r264525) +++ head/sys/dev/iscsi/icl.h Wed Apr 16 10:29:34 2014 (r264526) @@ -118,16 +118,17 @@ struct icl_listen; struct icl_listen_sock { TAILQ_ENTRY(icl_listen_sock) ils_next; - struct icl_listen *ils_listen; - struct socket *ils_socket; - bool ils_running; - bool ils_disconnecting; + struct icl_listen *ils_listen; + struct socket *ils_socket; + bool ils_running; + bool ils_disconnecting; + int ils_id; }; struct icl_listen { TAILQ_HEAD(, icl_listen_sock) il_sockets; struct sx il_lock; - void (*il_accept)(struct socket *); + void (*il_accept)(struct socket *, int); }; /* @@ -139,10 +140,11 @@ int icl_conn_connect(struct icl_conn * /* * Target part. */ -struct icl_listen *icl_listen_new(void (*accept_cb)(struct socket *)); +struct icl_listen *icl_listen_new(void (*accept_cb)(struct socket *, int)); void icl_listen_free(struct icl_listen *il); -int icl_listen_add(struct icl_listen *il, bool rdma, int domain, - int socktype, int protocol, struct sockaddr *sa); +int icl_listen_add(struct icl_listen *il, bool rdma, + int domain, int socktype, int protocol, + struct sockaddr *sa, int portal_id); int icl_listen_remove(struct icl_listen *il, struct sockaddr *sa); /* Modified: head/sys/dev/iscsi/icl_proxy.c ============================================================================== --- head/sys/dev/iscsi/icl_proxy.c Wed Apr 16 10:18:44 2014 (r264525) +++ head/sys/dev/iscsi/icl_proxy.c Wed Apr 16 10:29:34 2014 (r264526) @@ -182,7 +182,7 @@ icl_conn_connect(struct icl_conn *ic, bo } struct icl_listen * -icl_listen_new(void (*accept_cb)(struct socket *)) +icl_listen_new(void (*accept_cb)(struct socket *, int)) { struct icl_listen *il; @@ -298,13 +298,13 @@ icl_accept_thread(void *arg) soclose(so); } - (ils->ils_listen->il_accept)(so); + (ils->ils_listen->il_accept)(so, ils->ils_id); } } static int -icl_listen_add_tcp(struct icl_listen *il, int domain, int socktype, int protocol, - struct sockaddr *sa) +icl_listen_add_tcp(struct icl_listen *il, int domain, int socktype, + int protocol, struct sockaddr *sa, int portal_id) { struct icl_listen_sock *ils; struct socket *so; @@ -348,6 +348,7 @@ icl_listen_add_tcp(struct icl_listen *il ils = malloc(sizeof(*ils), M_ICL_PROXY, M_ZERO | M_WAITOK); ils->ils_listen = il; ils->ils_socket = so; + ils->ils_id = portal_id; error = kthread_add(icl_accept_thread, ils, NULL, NULL, 0, 0, "iclacc"); if (error != 0) { @@ -366,8 +367,8 @@ icl_listen_add_tcp(struct icl_listen *il } int -icl_listen_add(struct icl_listen *il, bool rdma, int domain, int socktype, int protocol, - struct sockaddr *sa) +icl_listen_add(struct icl_listen *il, bool rdma, int domain, int socktype, + int protocol, struct sockaddr *sa, int portal_id) { if (rdma) { @@ -375,12 +376,14 @@ icl_listen_add(struct icl_listen *il, bo ICL_DEBUG("RDMA not supported"); return (EOPNOTSUPP); #else - return (icl_listen_add_rdma(il, domain, socktype, protocol, sa)); + return (icl_listen_add_rdma(il, domain, socktype, protocol, + sa, portal_id)); #endif } - return (icl_listen_add_tcp(il, domain, socktype, protocol, sa)); + return (icl_listen_add_tcp(il, domain, socktype, protocol, sa, + portal_id)); } int Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Wed Apr 16 10:18:44 2014 (r264525) +++ head/usr.sbin/ctld/ctld.c Wed Apr 16 10:29:34 2014 (r264526) @@ -1408,9 +1408,13 @@ conf_apply(struct conf *oldconf, struct #ifdef ICL_KERNEL_PROXY if (proxy_mode) { - log_debugx("listening on %s, portal-group \"%s\" using ICL proxy", - newp->p_listen, newpg->pg_name); - kernel_listen(newp->p_ai, newp->p_iser); + newpg->pg_conf->conf_portal_id++; + newp->p_id = newpg->pg_conf->conf_portal_id; + log_debugx("listening on %s, portal-group " + "\"%s\", portal id %d, using ICL proxy", + newp->p_listen, newpg->pg_name, newp->p_id); + kernel_listen(newp->p_ai, newp->p_iser, + newp->p_id); continue; } #endif @@ -1671,6 +1675,7 @@ main_loop(struct conf *conf, bool dont_f struct portal *portal; #ifdef ICL_KERNEL_PROXY int connection_id; + int portal_id; #endif fd_set fdset; int error, nfds, client_fd; @@ -1683,16 +1688,22 @@ main_loop(struct conf *conf, bool dont_f #ifdef ICL_KERNEL_PROXY if (proxy_mode) { - connection_id = kernel_accept(); - if (connection_id == 0) - continue; + kernel_accept(&connection_id, &portal_id); + + log_debugx("incoming connection, id %d, portal id %d", + connection_id, portal_id); + TAILQ_FOREACH(pg, &conf->conf_portal_groups, pg_next) { + TAILQ_FOREACH(portal, &pg->pg_portals, p_next) { + if (portal->p_id == portal_id) { + goto found; + } + } + } - /* - * XXX: This is obviously temporary. - */ - pg = TAILQ_FIRST(&conf->conf_portal_groups); - portal = TAILQ_FIRST(&pg->pg_portals); + log_errx(1, "kernel returned invalid portal_id %d", + portal_id); +found: handle_connection(portal, connection_id, dont_fork); } else { #endif Modified: head/usr.sbin/ctld/ctld.h ============================================================================== --- head/usr.sbin/ctld/ctld.h Wed Apr 16 10:18:44 2014 (r264525) +++ head/usr.sbin/ctld/ctld.h Wed Apr 16 10:29:34 2014 (r264526) @@ -88,6 +88,9 @@ struct portal { bool p_iser; char *p_listen; struct addrinfo *p_ai; +#ifdef ICL_KERNEL_PROXY + int p_id; +#endif TAILQ_HEAD(, target) p_targets; int p_socket; @@ -146,6 +149,9 @@ struct conf { int conf_maxproc; uint16_t conf_last_portal_group_tag; +#ifdef ICL_KERNEL_PROXY + int conf_portal_id; +#endif struct pidfh *conf_pidfh; bool conf_default_pg_defined; @@ -265,8 +271,9 @@ void kernel_capsicate(void); /* * ICL_KERNEL_PROXY */ -void kernel_listen(struct addrinfo *ai, bool iser); -int kernel_accept(void); +void kernel_listen(struct addrinfo *ai, bool iser, + int portal_id); +void kernel_accept(int *connection_id, int *portal_id); void kernel_send(struct pdu *pdu); void kernel_receive(struct pdu *pdu); Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Wed Apr 16 10:18:44 2014 (r264525) +++ head/usr.sbin/ctld/kernel.c Wed Apr 16 10:29:34 2014 (r264526) @@ -622,13 +622,15 @@ kernel_handoff(struct connection *conn) req.data.handoff.max_burst_length = conn->conn_max_burst_length; req.data.handoff.immediate_data = conn->conn_immediate_data; - if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) + if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) { log_err(1, "error issuing CTL_ISCSI ioctl; " "dropping connection"); + } - if (req.status != CTL_ISCSI_OK) + if (req.status != CTL_ISCSI_OK) { log_errx(1, "error returned from CTL iSCSI handoff request: " "%s; dropping connection", req.error_str); + } } int @@ -673,7 +675,7 @@ kernel_port_off(void) #ifdef ICL_KERNEL_PROXY void -kernel_listen(struct addrinfo *ai, bool iser) +kernel_listen(struct addrinfo *ai, bool iser, int portal_id) { struct ctl_iscsi req; @@ -686,11 +688,10 @@ kernel_listen(struct addrinfo *ai, bool req.data.listen.protocol = ai->ai_protocol; req.data.listen.addr = ai->ai_addr; req.data.listen.addrlen = ai->ai_addrlen; + req.data.listen.portal_id = portal_id; - if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) { + if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) log_err(1, "error issuing CTL_ISCSI ioctl"); - return; - } if (req.status != CTL_ISCSI_OK) { log_errx(1, "error returned from CTL iSCSI listen: %s", @@ -698,8 +699,8 @@ kernel_listen(struct addrinfo *ai, bool } } -int -kernel_accept(void) +void +kernel_accept(int *connection_id, int *portal_id) { struct ctl_iscsi req; @@ -707,18 +708,16 @@ kernel_accept(void) req.type = CTL_ISCSI_ACCEPT; - if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) { - log_warn("error issuing CTL_ISCSI ioctl"); - return (0); - } + if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) + log_err(1, "error issuing CTL_ISCSI ioctl"); if (req.status != CTL_ISCSI_OK) { - log_warnx("error returned from CTL iSCSI accept: %s", + log_errx(1, "error returned from CTL iSCSI accept: %s", req.error_str); - return (0); } - return (req.data.accept.connection_id); + *connection_id = req.data.accept.connection_id; + *portal_id = req.data.accept.portal_id; } void From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 10:37:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E5BF4F2; Wed, 16 Apr 2014 10:37:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D57081A7B; Wed, 16 Apr 2014 10:37:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GAbQlO065371; Wed, 16 Apr 2014 10:37:26 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GAbQB4065370; Wed, 16 Apr 2014 10:37:26 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404161037.s3GAbQB4065370@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 16 Apr 2014 10:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264527 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 10:37:27 -0000 Author: trasz Date: Wed Apr 16 10:37:26 2014 New Revision: 264527 URL: http://svnweb.freebsd.org/changeset/base/264527 Log: Make it possible to interrupt login when running in proxy mode. Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Apr 16 10:29:34 2014 (r264526) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Apr 16 10:37:26 2014 (r264527) @@ -1130,6 +1130,9 @@ cfiscsi_session_terminate(struct cfiscsi return; cs->cs_terminating = 1; cv_signal(&cs->cs_maintenance_cv); +#ifdef ICL_KERNEL_PROXY + cv_signal(&cs->cs_login_cv); +#endif } static int @@ -1864,6 +1867,7 @@ cfiscsi_ioctl_receive(struct ctl_iscsi * struct cfiscsi_session *cs; struct icl_pdu *ip; void *data; + int error; cirp = (struct ctl_iscsi_receive_params *)&(ci->data); @@ -1874,7 +1878,8 @@ cfiscsi_ioctl_receive(struct ctl_iscsi * } if (cs == NULL) { mtx_unlock(&cfiscsi_softc.lock); - snprintf(ci->error_str, sizeof(ci->error_str), "connection not found"); + snprintf(ci->error_str, sizeof(ci->error_str), + "connection not found"); ci->status = CTL_ISCSI_ERROR; return; } @@ -1886,12 +1891,21 @@ cfiscsi_ioctl_receive(struct ctl_iscsi * #endif CFISCSI_SESSION_LOCK(cs); - while (cs->cs_login_pdu == NULL && - cs->cs_terminating == false) - cv_wait(&cs->cs_login_cv, &cs->cs_lock); + while (cs->cs_login_pdu == NULL && cs->cs_terminating == false) { + error = cv_wait_sig(&cs->cs_login_cv, &cs->cs_lock); + if (error != 0) { + CFISCSI_SESSION_UNLOCK(cs); + snprintf(ci->error_str, sizeof(ci->error_str), + "interrupted by signal"); + ci->status = CTL_ISCSI_ERROR; + return; + } + } + if (cs->cs_terminating) { CFISCSI_SESSION_UNLOCK(cs); - snprintf(ci->error_str, sizeof(ci->error_str), "connection terminating"); + snprintf(ci->error_str, sizeof(ci->error_str), + "connection terminating"); ci->status = CTL_ISCSI_ERROR; return; } @@ -1901,7 +1915,8 @@ cfiscsi_ioctl_receive(struct ctl_iscsi * if (ip->ip_data_len > cirp->data_segment_len) { icl_pdu_free(ip); - snprintf(ci->error_str, sizeof(ci->error_str), "data segment too big"); + snprintf(ci->error_str, sizeof(ci->error_str), + "data segment too big"); ci->status = CTL_ISCSI_ERROR; return; } From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 10:43:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A69F56ED; Wed, 16 Apr 2014 10:43:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86C5C1B2C; Wed, 16 Apr 2014 10:43:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GAhDen068931; Wed, 16 Apr 2014 10:43:13 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GAhClY068928; Wed, 16 Apr 2014 10:43:12 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404161043.s3GAhClY068928@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 16 Apr 2014 10:43:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264528 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 10:43:13 -0000 Author: trasz Date: Wed Apr 16 10:43:12 2014 New Revision: 264528 URL: http://svnweb.freebsd.org/changeset/base/264528 Log: Rework the way we enable CTL iSCSI port. Previously conf_apply() needed it to be already enabled, because listening in proxy mode requires it; however, it's conf_apply() that opens pidfiles, so it resulted in port being enabled before pidfile was opened. This was not so bad, but it was also disabled when pidfile couldn't be opened due to ctld already running; this means that starting second ctld instance screwed up the first. Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctld.c head/usr.sbin/ctld/ctld.h head/usr.sbin/ctld/parse.y Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Wed Apr 16 10:37:26 2014 (r264527) +++ head/usr.sbin/ctld/ctld.c Wed Apr 16 10:43:12 2014 (r264528) @@ -1209,6 +1209,19 @@ conf_apply(struct conf *oldconf, struct } } + if (oldconf->conf_kernel_port_on != newconf->conf_kernel_port_on) { + if (newconf->conf_kernel_port_on == true) { + log_debugx("enabling CTL iSCSI port"); + error = kernel_port_on(); + if (error != 0) + log_errx(1, "failed to enable CTL iSCSI port, exiting"); + } else { + error = kernel_port_off(); + if (error != 0) + log_warnx("failed to disable CTL iSCSI port"); + } + } + TAILQ_FOREACH_SAFE(oldtarg, &oldconf->conf_targets, t_next, tmptarg) { /* * First, remove any targets present in the old configuration @@ -1837,11 +1850,6 @@ main(int argc, char **argv) newconf->conf_debug = debug; } - log_debugx("enabling CTL iSCSI port"); - error = kernel_port_on(); - if (error != 0) - log_errx(1, "failed to enable CTL iSCSI port, exiting"); - error = conf_apply(oldconf, newconf); if (error != 0) log_errx(1, "failed to apply configuration, exiting"); @@ -1886,9 +1894,6 @@ main(int argc, char **argv) log_debugx("disabling CTL iSCSI port " "and terminating all connections"); - error = kernel_port_off(); - if (error != 0) - log_warnx("failed to disable CTL iSCSI port"); oldconf = newconf; newconf = conf_new(); Modified: head/usr.sbin/ctld/ctld.h ============================================================================== --- head/usr.sbin/ctld/ctld.h Wed Apr 16 10:37:26 2014 (r264527) +++ head/usr.sbin/ctld/ctld.h Wed Apr 16 10:43:12 2014 (r264528) @@ -156,6 +156,7 @@ struct conf { bool conf_default_pg_defined; bool conf_default_ag_defined; + bool conf_kernel_port_on; }; #define CONN_SESSION_TYPE_NONE 0 Modified: head/usr.sbin/ctld/parse.y ============================================================================== --- head/usr.sbin/ctld/parse.y Wed Apr 16 10:37:26 2014 (r264527) +++ head/usr.sbin/ctld/parse.y Wed Apr 16 10:43:12 2014 (r264528) @@ -773,6 +773,8 @@ conf_new_from_file(const char *path) portal_group_add_listen(pg, "[::]:3260", false); } + conf->conf_kernel_port_on = true; + error = conf_verify(conf); if (error != 0) { conf_delete(conf); From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 10:49:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1E08915; Wed, 16 Apr 2014 10:49:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A47F91B84; Wed, 16 Apr 2014 10:49:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GAnmiI069764; Wed, 16 Apr 2014 10:49:48 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GAnmoK069763; Wed, 16 Apr 2014 10:49:48 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404161049.s3GAnmoK069763@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 16 Apr 2014 10:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264529 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 10:49:48 -0000 Author: trasz Date: Wed Apr 16 10:49:48 2014 New Revision: 264529 URL: http://svnweb.freebsd.org/changeset/base/264529 Log: Use socket address from accept(2) instead of retrieving it via getpeername(2). Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Wed Apr 16 10:43:12 2014 (r264528) +++ head/usr.sbin/ctld/ctld.c Wed Apr 16 10:49:48 2014 (r264529) @@ -1588,11 +1588,10 @@ wait_for_children(bool block) } static void -handle_connection(struct portal *portal, int fd, bool dont_fork) +handle_connection(struct portal *portal, int fd, const struct sockaddr_storage *ss, + socklen_t sslen, bool dont_fork) { struct connection *conn; - struct sockaddr_storage ss; - socklen_t sslen = sizeof(ss); int error; pid_t pid; char host[NI_MAXHOST + 1]; @@ -1634,13 +1633,10 @@ handle_connection(struct portal *portal, } else { #endif assert(proxy_mode == false); - error = getpeername(fd, (struct sockaddr *)&ss, &sslen); - if (error != 0) - log_err(1, "getpeername"); - error = getnameinfo((struct sockaddr *)&ss, sslen, + error = getnameinfo((struct sockaddr *)ss, sslen, host, sizeof(host), NULL, 0, NI_NUMERICHOST); if (error != 0) - log_errx(1, "getaddrinfo: %s", gai_strerror(error)); + log_errx(1, "getnameinfo: %s", gai_strerror(error)); log_debugx("accepted connection from %s; portal group \"%s\"", host, portal->p_portal_group->pg_name); @@ -1686,6 +1682,8 @@ main_loop(struct conf *conf, bool dont_f { struct portal_group *pg; struct portal *portal; + struct sockaddr_storage client_sa; + socklen_t client_salen; #ifdef ICL_KERNEL_PROXY int connection_id; int portal_id; @@ -1717,7 +1715,7 @@ main_loop(struct conf *conf, bool dont_f portal_id); found: - handle_connection(portal, connection_id, dont_fork); + handle_connection(portal, connection_id, NULL, 0, dont_fork); } else { #endif assert(proxy_mode == false); @@ -1738,10 +1736,14 @@ found: TAILQ_FOREACH(portal, &pg->pg_portals, p_next) { if (!FD_ISSET(portal->p_socket, &fdset)) continue; - client_fd = accept(portal->p_socket, NULL, 0); + client_salen = sizeof(client_sa); + client_fd = accept(portal->p_socket, + (struct sockaddr *)&client_sa, + &client_salen); if (client_fd < 0) log_err(1, "accept"); - handle_connection(portal, client_fd, dont_fork); + handle_connection(portal, client_fd, + &client_sa, client_salen, dont_fork); break; } } From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 11:00:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 973ECC9F; Wed, 16 Apr 2014 11:00:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 834111D16; Wed, 16 Apr 2014 11:00:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GB0Cj8073995; Wed, 16 Apr 2014 11:00:12 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GB0AHb073985; Wed, 16 Apr 2014 11:00:10 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404161100.s3GB0AHb073985@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 16 Apr 2014 11:00:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264530 - in head: sys/cam/ctl sys/dev/iscsi usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 11:00:12 -0000 Author: trasz Date: Wed Apr 16 11:00:10 2014 New Revision: 264530 URL: http://svnweb.freebsd.org/changeset/base/264530 Log: Properly pass the initiator address when running in proxy mode. Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/cam/ctl/ctl_frontend_iscsi.h head/sys/cam/ctl/ctl_ioctl.h head/sys/dev/iscsi/icl.h head/sys/dev/iscsi/icl_proxy.c head/usr.sbin/ctld/ctld.c head/usr.sbin/ctld/ctld.h head/usr.sbin/ctld/kernel.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Apr 16 10:49:48 2014 (r264529) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Wed Apr 16 11:00:10 2014 (r264530) @@ -1353,7 +1353,7 @@ cfiscsi_module_event_handler(module_t mo #ifdef ICL_KERNEL_PROXY static void -cfiscsi_accept(struct socket *so, int portal_id) +cfiscsi_accept(struct socket *so, struct sockaddr *sa, int portal_id) { struct cfiscsi_session *cs; @@ -1364,6 +1364,7 @@ cfiscsi_accept(struct socket *so, int po } icl_conn_handoff_sock(cs->cs_conn, so); + cs->cs_initiator_sa = sa; cs->cs_portal_id = portal_id; cs->cs_waiting_for_ctld = true; cv_signal(&cfiscsi_softc.accept_cv); @@ -1788,6 +1789,16 @@ cfiscsi_ioctl_accept(struct ctl_iscsi *c ciap->connection_id = cs->cs_id; ciap->portal_id = cs->cs_portal_id; + ciap->initiator_addrlen = cs->cs_initiator_sa->sa_len; + error = copyout(cs->cs_initiator_sa, ciap->initiator_addr, + cs->cs_initiator_sa->sa_len); + if (error != 0) { + snprintf(ci->error_str, sizeof(ci->error_str), + "copyout failed with error %d", error); + ci->status = CTL_ISCSI_ERROR; + return; + } + ci->status = CTL_ISCSI_OK; } Modified: head/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.h Wed Apr 16 10:49:48 2014 (r264529) +++ head/sys/cam/ctl/ctl_frontend_iscsi.h Wed Apr 16 11:00:10 2014 (r264530) @@ -82,6 +82,7 @@ struct cfiscsi_session { unsigned int cs_id; int cs_ctl_initid; #ifdef ICL_KERNEL_PROXY + struct sockaddr *cs_initiator_sa; int cs_portal_id; bool cs_login_phase; bool cs_waiting_for_ctld; Modified: head/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- head/sys/cam/ctl/ctl_ioctl.h Wed Apr 16 10:49:48 2014 (r264529) +++ head/sys/cam/ctl/ctl_ioctl.h Wed Apr 16 11:00:10 2014 (r264530) @@ -706,8 +706,9 @@ struct ctl_iscsi_listen_params { struct ctl_iscsi_accept_params { int connection_id; - struct sockaddr *initiator_addr; int portal_id; + struct sockaddr *initiator_addr; + socklen_t initiator_addrlen; int spare[4]; }; Modified: head/sys/dev/iscsi/icl.h ============================================================================== --- head/sys/dev/iscsi/icl.h Wed Apr 16 10:49:48 2014 (r264529) +++ head/sys/dev/iscsi/icl.h Wed Apr 16 11:00:10 2014 (r264530) @@ -128,7 +128,8 @@ struct icl_listen_sock { struct icl_listen { TAILQ_HEAD(, icl_listen_sock) il_sockets; struct sx il_lock; - void (*il_accept)(struct socket *, int); + void (*il_accept)(struct socket *, + struct sockaddr *, int); }; /* @@ -140,7 +141,8 @@ int icl_conn_connect(struct icl_conn * /* * Target part. */ -struct icl_listen *icl_listen_new(void (*accept_cb)(struct socket *, int)); +struct icl_listen *icl_listen_new(void (*accept_cb)(struct socket *, + struct sockaddr *, int)); void icl_listen_free(struct icl_listen *il); int icl_listen_add(struct icl_listen *il, bool rdma, int domain, int socktype, int protocol, Modified: head/sys/dev/iscsi/icl_proxy.c ============================================================================== --- head/sys/dev/iscsi/icl_proxy.c Wed Apr 16 10:49:48 2014 (r264529) +++ head/sys/dev/iscsi/icl_proxy.c Wed Apr 16 11:00:10 2014 (r264530) @@ -182,7 +182,7 @@ icl_conn_connect(struct icl_conn *ic, bo } struct icl_listen * -icl_listen_new(void (*accept_cb)(struct socket *, int)) +icl_listen_new(void (*accept_cb)(struct socket *, struct sockaddr *, int)) { struct icl_listen *il; @@ -296,9 +296,10 @@ icl_accept_thread(void *arg) if (sa != NULL) free(sa, M_SONAME); soclose(so); + continue; } - (ils->ils_listen->il_accept)(so, ils->ils_id); + (ils->ils_listen->il_accept)(so, sa, ils->ils_id); } } Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Wed Apr 16 10:49:48 2014 (r264529) +++ head/usr.sbin/ctld/ctld.c Wed Apr 16 11:00:10 2014 (r264530) @@ -1588,8 +1588,8 @@ wait_for_children(bool block) } static void -handle_connection(struct portal *portal, int fd, const struct sockaddr_storage *ss, - socklen_t sslen, bool dont_fork) +handle_connection(struct portal *portal, int fd, + const struct sockaddr *client_sa, socklen_t client_salen, bool dont_fork) { struct connection *conn; int error; @@ -1624,27 +1624,15 @@ handle_connection(struct portal *portal, } pidfile_close(conf->conf_pidfh); -#ifdef ICL_KERNEL_PROXY - /* - * XXX - */ - if (proxy_mode) { - log_set_peer_addr("XXX"); - } else { -#endif - assert(proxy_mode == false); - error = getnameinfo((struct sockaddr *)ss, sslen, - host, sizeof(host), NULL, 0, NI_NUMERICHOST); - if (error != 0) - log_errx(1, "getnameinfo: %s", gai_strerror(error)); - - log_debugx("accepted connection from %s; portal group \"%s\"", - host, portal->p_portal_group->pg_name); - log_set_peer_addr(host); - setproctitle("%s", host); -#ifdef ICL_KERNEL_PROXY - } -#endif + error = getnameinfo(client_sa, client_salen, + host, sizeof(host), NULL, 0, NI_NUMERICHOST); + if (error != 0) + log_errx(1, "getnameinfo: %s", gai_strerror(error)); + + log_debugx("accepted connection from %s; portal group \"%s\"", + host, portal->p_portal_group->pg_name); + log_set_peer_addr(host); + setproctitle("%s", host); conn = connection_new(portal, fd, host); set_timeout(conf); @@ -1699,7 +1687,9 @@ main_loop(struct conf *conf, bool dont_f #ifdef ICL_KERNEL_PROXY if (proxy_mode) { - kernel_accept(&connection_id, &portal_id); + client_salen = sizeof(client_sa); + kernel_accept(&connection_id, &portal_id, + (struct sockaddr *)&client_sa, &client_salen); log_debugx("incoming connection, id %d, portal id %d", connection_id, portal_id); @@ -1715,7 +1705,9 @@ main_loop(struct conf *conf, bool dont_f portal_id); found: - handle_connection(portal, connection_id, NULL, 0, dont_fork); + handle_connection(portal, connection_id, + (struct sockaddr *)&client_sa, client_salen, + dont_fork); } else { #endif assert(proxy_mode == false); @@ -1743,7 +1735,8 @@ found: if (client_fd < 0) log_err(1, "accept"); handle_connection(portal, client_fd, - &client_sa, client_salen, dont_fork); + (struct sockaddr *)&client_sa, + client_salen, dont_fork); break; } } Modified: head/usr.sbin/ctld/ctld.h ============================================================================== --- head/usr.sbin/ctld/ctld.h Wed Apr 16 10:49:48 2014 (r264529) +++ head/usr.sbin/ctld/ctld.h Wed Apr 16 11:00:10 2014 (r264530) @@ -33,6 +33,10 @@ #define CTLD_H #include +#ifdef ICL_KERNEL_PROXY +#include +#include +#endif #include #include @@ -269,14 +273,15 @@ int kernel_port_on(void); int kernel_port_off(void); void kernel_capsicate(void); -/* - * ICL_KERNEL_PROXY - */ +#ifdef ICL_KERNEL_PROXY void kernel_listen(struct addrinfo *ai, bool iser, int portal_id); -void kernel_accept(int *connection_id, int *portal_id); +void kernel_accept(int *connection_id, int *portal_id, + struct sockaddr *client_sa, + socklen_t *client_salen); void kernel_send(struct pdu *pdu); void kernel_receive(struct pdu *pdu); +#endif struct keys *keys_new(void); void keys_delete(struct keys *keys); Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Wed Apr 16 10:49:48 2014 (r264529) +++ head/usr.sbin/ctld/kernel.c Wed Apr 16 11:00:10 2014 (r264530) @@ -700,13 +700,16 @@ kernel_listen(struct addrinfo *ai, bool } void -kernel_accept(int *connection_id, int *portal_id) +kernel_accept(int *connection_id, int *portal_id, + struct sockaddr *client_sa, socklen_t *client_salen) { struct ctl_iscsi req; + struct sockaddr_storage ss; bzero(&req, sizeof(req)); req.type = CTL_ISCSI_ACCEPT; + req.data.accept.initiator_addr = (struct sockaddr *)&ss; if (ioctl(ctl_fd, CTL_ISCSI, &req) == -1) log_err(1, "error issuing CTL_ISCSI ioctl"); @@ -718,6 +721,8 @@ kernel_accept(int *connection_id, int *p *connection_id = req.data.accept.connection_id; *portal_id = req.data.accept.portal_id; + *client_salen = req.data.accept.initiator_addrlen; + memcpy(client_sa, &ss, *client_salen); } void From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 11:02:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07784ECF; Wed, 16 Apr 2014 11:02:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E83F31E48; Wed, 16 Apr 2014 11:01:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GB1xCp077086; Wed, 16 Apr 2014 11:01:59 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GB1x19077084; Wed, 16 Apr 2014 11:01:59 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404161101.s3GB1x19077084@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 16 Apr 2014 11:01:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264531 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 11:02:00 -0000 Author: trasz Date: Wed Apr 16 11:01:59 2014 New Revision: 264531 URL: http://svnweb.freebsd.org/changeset/base/264531 Log: Constify. Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctld.c head/usr.sbin/ctld/ctld.h Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Wed Apr 16 11:00:10 2014 (r264530) +++ head/usr.sbin/ctld/ctld.c Wed Apr 16 11:01:59 2014 (r264531) @@ -139,7 +139,7 @@ auth_delete(struct auth *auth) } const struct auth * -auth_find(struct auth_group *ag, const char *user) +auth_find(const struct auth_group *ag, const char *user) { const struct auth *auth; @@ -407,7 +407,7 @@ auth_group_delete(struct auth_group *ag) } struct auth_group * -auth_group_find(struct conf *conf, const char *name) +auth_group_find(const struct conf *conf, const char *name) { struct auth_group *ag; @@ -534,7 +534,7 @@ portal_group_delete(struct portal_group } struct portal_group * -portal_group_find(struct conf *conf, const char *name) +portal_group_find(const struct conf *conf, const char *name) { struct portal_group *pg; @@ -833,7 +833,7 @@ lun_delete(struct lun *lun) } struct lun * -lun_find(struct target *targ, int lun_id) +lun_find(const struct target *targ, int lun_id) { struct lun *lun; @@ -929,7 +929,7 @@ lun_option_delete(struct lun_option *lo) } struct lun_option * -lun_option_find(struct lun *lun, const char *name) +lun_option_find(const struct lun *lun, const char *name) { struct lun_option *lo; Modified: head/usr.sbin/ctld/ctld.h ============================================================================== --- head/usr.sbin/ctld/ctld.h Wed Apr 16 11:00:10 2014 (r264530) +++ head/usr.sbin/ctld/ctld.h Wed Apr 16 11:01:59 2014 (r264531) @@ -211,7 +211,8 @@ int conf_verify(struct conf *conf); struct auth_group *auth_group_new(struct conf *conf, const char *name); void auth_group_delete(struct auth_group *ag); -struct auth_group *auth_group_find(struct conf *conf, const char *name); +struct auth_group *auth_group_find(const struct conf *conf, + const char *name); int auth_group_set_type_str(struct auth_group *ag, const char *type); @@ -220,7 +221,7 @@ const struct auth *auth_new_chap(struct const struct auth *auth_new_chap_mutual(struct auth_group *ag, const char *user, const char *secret, const char *user2, const char *secret2); -const struct auth *auth_find(struct auth_group *ag, +const struct auth *auth_find(const struct auth_group *ag, const char *user); const struct auth_name *auth_name_new(struct auth_group *ag, @@ -237,7 +238,8 @@ const struct auth_portal *auth_portal_fi struct portal_group *portal_group_new(struct conf *conf, const char *name); void portal_group_delete(struct portal_group *pg); -struct portal_group *portal_group_find(struct conf *conf, const char *name); +struct portal_group *portal_group_find(const struct conf *conf, + const char *name); int portal_group_add_listen(struct portal_group *pg, const char *listen, bool iser); @@ -248,7 +250,7 @@ struct target *target_find(struct conf struct lun *lun_new(struct target *target, int lun_id); void lun_delete(struct lun *lun); -struct lun *lun_find(struct target *target, int lun_id); +struct lun *lun_find(const struct target *target, int lun_id); void lun_set_backend(struct lun *lun, const char *value); void lun_set_blocksize(struct lun *lun, size_t value); void lun_set_device_id(struct lun *lun, const char *value); @@ -260,7 +262,8 @@ void lun_set_ctl_lun(struct lun *lun, struct lun_option *lun_option_new(struct lun *lun, const char *name, const char *value); void lun_option_delete(struct lun_option *clo); -struct lun_option *lun_option_find(struct lun *lun, const char *name); +struct lun_option *lun_option_find(const struct lun *lun, + const char *name); void lun_option_set(struct lun_option *clo, const char *value); From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 11:03:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A404511A; Wed, 16 Apr 2014 11:03:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90AE21FA0; Wed, 16 Apr 2014 11:03:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GB3L8Y077276; Wed, 16 Apr 2014 11:03:21 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GB3LM3077275; Wed, 16 Apr 2014 11:03:21 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404161103.s3GB3LM3077275@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 16 Apr 2014 11:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264532 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 11:03:21 -0000 Author: trasz Date: Wed Apr 16 11:03:21 2014 New Revision: 264532 URL: http://svnweb.freebsd.org/changeset/base/264532 Log: Use proper terminology in debug messages. Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/login.c Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Wed Apr 16 11:01:59 2014 (r264531) +++ head/usr.sbin/ctld/login.c Wed Apr 16 11:03:21 2014 (r264532) @@ -787,7 +787,7 @@ login_negotiate(struct connection *conn, bool skipped_security; if (request == NULL) { - log_debugx("beginning parameter negotiation; " + log_debugx("beginning operational parameter negotiation; " "waiting for Login PDU"); request = login_receive(conn, false); skipped_security = false; @@ -813,7 +813,7 @@ login_negotiate(struct connection *conn, response_keys); } - log_debugx("parameter negotiation done; " + log_debugx("operational parameter negotiation done; " "transitioning to Full Feature Phase"); keys_save(response_keys, response); @@ -987,7 +987,7 @@ login(struct connection *conn) * but we don't need it. */ log_debugx("authentication not required; " - "transitioning to parameter negotiation"); + "transitioning to operational parameter negotiation"); if ((bhslr->bhslr_flags & BHSLR_FLAGS_TRANSIT) == 0) log_warnx("initiator did not set the \"T\" flag; " From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 11:05:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D38A92EE; Wed, 16 Apr 2014 11:05:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C04381FED; Wed, 16 Apr 2014 11:05:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GB5vmP077584; Wed, 16 Apr 2014 11:05:57 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GB5vWk077583; Wed, 16 Apr 2014 11:05:57 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404161105.s3GB5vWk077583@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 16 Apr 2014 11:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264533 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 11:05:57 -0000 Author: trasz Date: Wed Apr 16 11:05:57 2014 New Revision: 264533 URL: http://svnweb.freebsd.org/changeset/base/264533 Log: Use consistent punctuation. Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Wed Apr 16 11:03:21 2014 (r264532) +++ head/usr.sbin/ctld/ctld.c Wed Apr 16 11:05:57 2014 (r264533) @@ -1214,7 +1214,7 @@ conf_apply(struct conf *oldconf, struct log_debugx("enabling CTL iSCSI port"); error = kernel_port_on(); if (error != 0) - log_errx(1, "failed to enable CTL iSCSI port, exiting"); + log_errx(1, "failed to enable CTL iSCSI port; exiting"); } else { error = kernel_port_off(); if (error != 0) @@ -1839,7 +1839,7 @@ main(int argc, char **argv) oldconf = conf_new_from_kernel(); newconf = conf_new_from_file(config_path); if (newconf == NULL) - log_errx(1, "configuration error, exiting"); + log_errx(1, "configuration error; exiting"); if (debug > 0) { oldconf->conf_debug = debug; newconf->conf_debug = debug; @@ -1847,7 +1847,8 @@ main(int argc, char **argv) error = conf_apply(oldconf, newconf); if (error != 0) - log_errx(1, "failed to apply configuration, exiting"); + log_errx(1, "failed to apply configuration; exiting"); + conf_delete(oldconf); oldconf = NULL; From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 11:06:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB430466; Wed, 16 Apr 2014 11:06:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C80291041; Wed, 16 Apr 2014 11:06:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GB6j6t077727; Wed, 16 Apr 2014 11:06:45 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GB6jRb077726; Wed, 16 Apr 2014 11:06:45 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404161106.s3GB6jRb077726@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 16 Apr 2014 11:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264534 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 11:06:45 -0000 Author: trasz Date: Wed Apr 16 11:06:45 2014 New Revision: 264534 URL: http://svnweb.freebsd.org/changeset/base/264534 Log: If we fail to create LUN, try again on next configuration reload. Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Wed Apr 16 11:05:57 2014 (r264533) +++ head/usr.sbin/ctld/ctld.c Wed Apr 16 11:06:45 2014 (r264534) @@ -1222,6 +1222,13 @@ conf_apply(struct conf *oldconf, struct } } + /* + * XXX: If target or lun removal fails, we should somehow "move" + * the old lun or target into newconf, so that subsequent + * conf_apply() will try to remove them again. That would + * be somewhat hairy, and lun deletion doesn't really happen, + * so leave it as it is for now. + */ TAILQ_FOREACH_SAFE(oldtarg, &oldconf->conf_targets, t_next, tmptarg) { /* * First, remove any targets present in the old configuration @@ -1344,7 +1351,7 @@ conf_apply(struct conf *oldconf, struct TAILQ_FOREACH(newtarg, &newconf->conf_targets, t_next) { oldtarg = target_find(oldconf, newtarg->t_name); - TAILQ_FOREACH(newlun, &newtarg->t_luns, l_next) { + TAILQ_FOREACH_SAFE(newlun, &newtarg->t_luns, l_next, tmplun) { if (oldtarg != NULL) { oldlun = lun_find(oldtarg, newlun->l_lun); if (oldlun != NULL) { @@ -1376,6 +1383,7 @@ conf_apply(struct conf *oldconf, struct if (error != 0) { log_warnx("failed to add lun %d, target %s", newlun->l_lun, newtarg->t_name); + lun_delete(newlun); cumulated_error++; } } From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 11:07:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CBFC5D3; Wed, 16 Apr 2014 11:07:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 599E31063; Wed, 16 Apr 2014 11:07:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GB7USb077858; Wed, 16 Apr 2014 11:07:30 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GB7Uc2077857; Wed, 16 Apr 2014 11:07:30 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404161107.s3GB7Uc2077857@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 16 Apr 2014 11:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264535 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 11:07:30 -0000 Author: trasz Date: Wed Apr 16 11:07:29 2014 New Revision: 264535 URL: http://svnweb.freebsd.org/changeset/base/264535 Log: English. Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Wed Apr 16 11:06:45 2014 (r264534) +++ head/usr.sbin/ctld/ctld.c Wed Apr 16 11:07:29 2014 (r264535) @@ -1225,9 +1225,9 @@ conf_apply(struct conf *oldconf, struct /* * XXX: If target or lun removal fails, we should somehow "move" * the old lun or target into newconf, so that subsequent - * conf_apply() will try to remove them again. That would - * be somewhat hairy, and lun deletion doesn't really happen, - * so leave it as it is for now. + * conf_apply() would try to remove them again. That would + * be somewhat hairy, though, and lun deletion failures don't + * really happen, so leave it as it is for now. */ TAILQ_FOREACH_SAFE(oldtarg, &oldconf->conf_targets, t_next, tmptarg) { /* From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 11:19:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C09C8A5; Wed, 16 Apr 2014 11:19:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2AC51156; Wed, 16 Apr 2014 11:19:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GBJnsn082134; Wed, 16 Apr 2014 11:19:49 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GBJnbT082132; Wed, 16 Apr 2014 11:19:49 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404161119.s3GBJnbT082132@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 16 Apr 2014 11:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264536 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 11:19:50 -0000 Author: trasz Date: Wed Apr 16 11:19:49 2014 New Revision: 264536 URL: http://svnweb.freebsd.org/changeset/base/264536 Log: Get rid of ISCSIDCLOSE; it wasn't used and is redundant anyway, because of ISCSIDFAIL. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/iscsi.c head/sys/dev/iscsi/iscsi_ioctl.h Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Wed Apr 16 11:07:29 2014 (r264535) +++ head/sys/dev/iscsi/iscsi.c Wed Apr 16 11:19:49 2014 (r264536) @@ -1552,28 +1552,6 @@ iscsi_ioctl_daemon_receive(struct iscsi_ return (0); } - -static int -iscsi_ioctl_daemon_close(struct iscsi_softc *sc, - struct iscsi_daemon_close *idc) -{ - struct iscsi_session *is; - - sx_slock(&sc->sc_lock); - TAILQ_FOREACH(is, &sc->sc_sessions, is_next) { - if (is->is_id == idc->idc_session_id) - break; - } - if (is == NULL) { - sx_sunlock(&sc->sc_lock); - return (ESRCH); - } - sx_sunlock(&sc->sc_lock); - - iscsi_session_reconnect(is); - - return (0); -} #endif /* ICL_KERNEL_PROXY */ static void @@ -1804,9 +1782,6 @@ iscsi_ioctl(struct cdev *dev, u_long cmd case ISCSIDRECEIVE: return (iscsi_ioctl_daemon_receive(sc, (struct iscsi_daemon_receive *)arg)); - case ISCSIDCLOSE: - return (iscsi_ioctl_daemon_close(sc, - (struct iscsi_daemon_close *)arg)); #endif /* ICL_KERNEL_PROXY */ case ISCSISADD: return (iscsi_ioctl_session_add(sc, Modified: head/sys/dev/iscsi/iscsi_ioctl.h ============================================================================== --- head/sys/dev/iscsi/iscsi_ioctl.h Wed Apr 16 11:07:29 2014 (r264535) +++ head/sys/dev/iscsi/iscsi_ioctl.h Wed Apr 16 11:19:49 2014 (r264536) @@ -175,15 +175,9 @@ struct iscsi_daemon_receive { int idr_spare[4]; }; -struct iscsi_daemon_close { - int idc_session_id; - int idc_spare[4]; -}; - #define ISCSIDCONNECT _IOWR('I', 0x04, struct iscsi_daemon_connect) #define ISCSIDSEND _IOWR('I', 0x05, struct iscsi_daemon_send) #define ISCSIDRECEIVE _IOWR('I', 0x06, struct iscsi_daemon_receive) -#define ISCSIDCLOSE _IOWR('I', 0x07, struct iscsi_daemon_close) #endif /* ICL_KERNEL_PROXY */ From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 11:28:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1358DAB1; Wed, 16 Apr 2014 11:28:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F349A1235; Wed, 16 Apr 2014 11:28:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GBS5gt085990; Wed, 16 Apr 2014 11:28:05 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GBS55S085989; Wed, 16 Apr 2014 11:28:05 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404161128.s3GBS55S085989@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 16 Apr 2014 11:28:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264537 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 11:28:06 -0000 Author: trasz Date: Wed Apr 16 11:28:05 2014 New Revision: 264537 URL: http://svnweb.freebsd.org/changeset/base/264537 Log: Be more strict with locking for is_waiting_for_iscsid variable. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Wed Apr 16 11:19:49 2014 (r264536) +++ head/sys/dev/iscsi/iscsi.c Wed Apr 16 11:28:05 2014 (r264537) @@ -1202,8 +1202,10 @@ iscsi_ioctl_daemon_wait(struct iscsi_sof sx_slock(&sc->sc_lock); for (;;) { TAILQ_FOREACH(is, &sc->sc_sessions, is_next) { + ISCSI_SESSION_LOCK(is); if (is->is_waiting_for_iscsid) break; + ISCSI_SESSION_UNLOCK(is); } if (is == NULL) { @@ -1218,7 +1220,6 @@ iscsi_ioctl_daemon_wait(struct iscsi_sof continue; } - ISCSI_SESSION_LOCK(is); is->is_waiting_for_iscsid = false; is->is_login_phase = true; is->is_reason[0] = '\0'; @@ -1651,8 +1652,10 @@ iscsi_ioctl_session_add(struct iscsi_sof /* * Trigger immediate reconnection. */ + ISCSI_SESSION_LOCK(is); is->is_waiting_for_iscsid = true; strlcpy(is->is_reason, "Waiting for iscsid(8)", sizeof(is->is_reason)); + ISCSI_SESSION_UNLOCK(is); cv_signal(&sc->sc_cv); sx_xunlock(&sc->sc_lock); From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 11:28:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6A65C1F; Wed, 16 Apr 2014 11:28:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3D1E123E; Wed, 16 Apr 2014 11:28:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GBScgP086071; Wed, 16 Apr 2014 11:28:38 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GBScKO086070; Wed, 16 Apr 2014 11:28:38 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404161128.s3GBScKO086070@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 16 Apr 2014 11:28:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264538 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 11:28:38 -0000 Author: trasz Date: Wed Apr 16 11:28:38 2014 New Revision: 264538 URL: http://svnweb.freebsd.org/changeset/base/264538 Log: Remove useless debug. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Wed Apr 16 11:28:05 2014 (r264537) +++ head/sys/dev/iscsi/iscsi.c Wed Apr 16 11:28:38 2014 (r264538) @@ -1972,7 +1972,6 @@ iscsi_action(struct cam_sim *sim, union ISCSI_SESSION_LOCK_ASSERT(is); if (is->is_terminating) { - ISCSI_SESSION_DEBUG(is, "called during termination"); ccb->ccb_h.status = CAM_DEV_NOT_THERE; xpt_done(ccb); return; From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 12:29:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9BA3EEA; Wed, 16 Apr 2014 12:29:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A715A18E8; Wed, 16 Apr 2014 12:29:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GCTj1Y010646; Wed, 16 Apr 2014 12:29:45 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GCTjdM010645; Wed, 16 Apr 2014 12:29:45 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201404161229.s3GCTjdM010645@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 16 Apr 2014 12:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264539 - head/sbin/route X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 12:29:45 -0000 Author: bz Date: Wed Apr 16 12:29:45 2014 New Revision: 264539 URL: http://svnweb.freebsd.org/changeset/base/264539 Log: When switching variables to flags in r243185 a few cases were missed. After r263152 this leaves unused variables if route(8) is compiled without INET support. Switch the remaining variable accesses to flags and remove now obsolete variables. Reviewed by: glebius MFC after: 1 week Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Wed Apr 16 11:28:38 2014 (r264538) +++ head/sbin/route/route.c Wed Apr 16 12:29:45 2014 (r264539) @@ -90,7 +90,7 @@ static struct keytab { static struct sockaddr_storage so[RTAX_MAX]; static int pid, rtm_addrs; static int s; -static int forcehost, forcenet, nflag, af, qflag, tflag; +static int nflag, af, qflag, tflag; static int verbose, aflen; static int locking, lockrest, debugonly; static struct rt_metrics rt_metrics; @@ -1245,7 +1245,7 @@ getaddr(int idx, char *str, struct hoste */ switch (idx) { case RTAX_DST: - forcenet++; + nrflags |= F_FORCENET; getaddr(RTAX_NETMASK, str, 0, nrflags); break; } @@ -1308,10 +1308,10 @@ getaddr(int idx, char *str, struct hoste } *q = '/'; } - if ((idx != RTAX_DST || forcenet == 0) && + if ((idx != RTAX_DST || (nrflags & F_FORCENET) == 0) && inet_aton(str, &sin->sin_addr)) { val = sin->sin_addr.s_addr; - if (idx != RTAX_DST || forcehost || + if (idx != RTAX_DST || nrflags & F_FORCEHOST || inet_lnaof(sin->sin_addr) != INADDR_ANY) return (1); else { @@ -1319,7 +1319,7 @@ getaddr(int idx, char *str, struct hoste goto netdone; } } - if (idx == RTAX_DST && forcehost == 0 && + if (idx == RTAX_DST && (nrflags & F_FORCEHOST) == 0 && ((val = inet_network(str)) != INADDR_NONE || ((np = getnetbyname(str)) != NULL && (val = np->n_net) != 0))) { netdone: From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 14:37:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7AF412B7; Wed, 16 Apr 2014 14:37:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67ED6169E; Wed, 16 Apr 2014 14:37:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GEbCRZ063655; Wed, 16 Apr 2014 14:37:12 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GEbC5A063654; Wed, 16 Apr 2014 14:37:12 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201404161437.s3GEbC5A063654@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 16 Apr 2014 14:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264540 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 14:37:12 -0000 Author: ae Date: Wed Apr 16 14:37:11 2014 New Revision: 264540 URL: http://svnweb.freebsd.org/changeset/base/264540 Log: Set oif only for outgoing packets. PR: 188543 MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw_pfil.c Modified: head/sys/netpfil/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_pfil.c Wed Apr 16 12:29:45 2014 (r264539) +++ head/sys/netpfil/ipfw/ip_fw_pfil.c Wed Apr 16 14:37:11 2014 (r264540) @@ -334,7 +334,7 @@ ipfw_check_frame(void *arg, struct mbuf m_adj(m, ETHER_HDR_LEN); /* strip ethernet header */ args.m = m; /* the packet we are looking at */ - args.oif = dst; /* destination, if any */ + args.oif = dir == PFIL_OUT ? dst: NULL; /* destination, if any */ args.next_hop = NULL; /* we do not support forward yet */ args.next_hop6 = NULL; /* we do not support forward yet */ args.eh = &save_eh; /* MAC header for bridged/MAC packets */ From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 15:28:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BAFECA6B; Wed, 16 Apr 2014 15:28:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A79B31B6D; Wed, 16 Apr 2014 15:28:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GFSHf8084954; Wed, 16 Apr 2014 15:28:17 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GFSHnc084953; Wed, 16 Apr 2014 15:28:17 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201404161528.s3GFSHnc084953@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 16 Apr 2014 15:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264542 - head/sys/dev/altera/atse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 15:28:17 -0000 Author: bz Date: Wed Apr 16 15:28:17 2014 New Revision: 264542 URL: http://svnweb.freebsd.org/changeset/base/264542 Log: Use ETHER_ALIGN as argument to m_adj() to offset the beginning of packet rather than the magic number 2. While here fix a typo in a comment. No functional changes. MFC after: 1 week Sponsored by: DARPA/AFRL Modified: head/sys/dev/altera/atse/if_atse.c Modified: head/sys/dev/altera/atse/if_atse.c ============================================================================== --- head/sys/dev/altera/atse/if_atse.c Wed Apr 16 15:27:14 2014 (r264541) +++ head/sys/dev/altera/atse/if_atse.c Wed Apr 16 15:28:17 2014 (r264542) @@ -1179,7 +1179,7 @@ outer: return (rx_npkts); m->m_len = m->m_pkthdr.len = MCLBYTES; /* Make sure upper layers will be aligned. */ - m_adj(m, 2); + m_adj(m, ETHER_ALIGN); sc->atse_rx_m = m; } @@ -1815,7 +1815,7 @@ atse_detach(device_t dev) return (0); } -/* Shared between nexus anf fdt implementation. */ +/* Shared between nexus and fdt implementation. */ void atse_detach_resources(device_t dev) { From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 17:13:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29A10DC; Wed, 16 Apr 2014 17:13:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFF6C183E; Wed, 16 Apr 2014 17:12:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GHCxJv029616; Wed, 16 Apr 2014 17:12:59 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GHCx1h029615; Wed, 16 Apr 2014 17:12:59 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201404161712.s3GHCx1h029615@svn.freebsd.org> From: Brooks Davis Date: Wed, 16 Apr 2014 17:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264543 - head/lib/libkse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 17:13:00 -0000 Author: brooks Date: Wed Apr 16 17:12:59 2014 New Revision: 264543 URL: http://svnweb.freebsd.org/changeset/base/264543 Log: Remove the libkse directory. It was unhooked from the build and kernel support removed in 2008 (prior to 8.0). Approved by: deischen, imp MFC after: 3 days Deleted: head/lib/libkse/ From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 17:39:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFE7DB74; Wed, 16 Apr 2014 17:39:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D08041AC3; Wed, 16 Apr 2014 17:39:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GHdARO038650; Wed, 16 Apr 2014 17:39:10 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GHdA4x038649; Wed, 16 Apr 2014 17:39:10 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404161739.s3GHdA4x038649@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 16 Apr 2014 17:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264544 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 17:39:11 -0000 Author: trasz Date: Wed Apr 16 17:39:10 2014 New Revision: 264544 URL: http://svnweb.freebsd.org/changeset/base/264544 Log: Add kern.iscsi.fail_on_disconnection; this is required for gmultipath to work. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Wed Apr 16 17:12:59 2014 (r264543) +++ head/sys/dev/iscsi/iscsi.c Wed Apr 16 17:39:10 2014 (r264544) @@ -97,6 +97,10 @@ static int maxtags = 255; TUNABLE_INT("kern.iscsi.maxtags", &maxtags); SYSCTL_INT(_kern_iscsi, OID_AUTO, maxtags, CTLFLAG_RWTUN, &maxtags, 0, "Max number of IO requests queued"); +static int fail_on_disconnection = 0; +TUNABLE_INT("kern.iscsi.fail_on_disconnection", &fail_on_disconnection); +SYSCTL_INT(_kern_iscsi, OID_AUTO, fail_on_disconnection, CTLFLAG_RWTUN, + &fail_on_disconnection, 0, "Destroy CAM SIM on connection failure"); static MALLOC_DEFINE(M_ISCSI, "iSCSI", "iSCSI initiator"); static uma_zone_t iscsi_outstanding_zone; @@ -301,22 +305,11 @@ iscsi_session_terminate_tasks(struct isc } static void -iscsi_maintenance_thread_reconnect(struct iscsi_session *is) +iscsi_session_cleanup(struct iscsi_session *is, bool destroy_sim) { struct icl_pdu *pdu; - icl_conn_shutdown(is->is_conn); - icl_conn_close(is->is_conn); - - ISCSI_SESSION_LOCK(is); - -#ifdef ICL_KERNEL_PROXY - if (is->is_login_pdu != NULL) { - icl_pdu_free(is->is_login_pdu); - is->is_login_pdu = NULL; - } - cv_signal(&is->is_login_cv); -#endif + ISCSI_SESSION_LOCK_ASSERT(is); /* * Don't queue any new PDUs. @@ -336,12 +329,63 @@ iscsi_maintenance_thread_reconnect(struc icl_pdu_free(pdu); } - /* - * Terminate SCSI tasks, asking CAM to requeue them. - */ - //ISCSI_SESSION_DEBUG(is, "terminating tasks"); - iscsi_session_terminate_tasks(is, true); + if (destroy_sim == false) { + /* + * Terminate SCSI tasks, asking CAM to requeue them. + */ + iscsi_session_terminate_tasks(is, true); + return; + } + + iscsi_session_terminate_tasks(is, false); + if (is->is_sim == NULL) + return; + + ISCSI_SESSION_DEBUG(is, "deregistering SIM"); + xpt_async(AC_LOST_DEVICE, is->is_path, NULL); + + if (is->is_simq_frozen) { + xpt_release_simq(is->is_sim, 1); + is->is_simq_frozen = false; + } + + xpt_free_path(is->is_path); + is->is_path = NULL; + xpt_bus_deregister(cam_sim_path(is->is_sim)); + cam_sim_free(is->is_sim, TRUE /*free_devq*/); + is->is_sim = NULL; + is->is_devq = NULL; +} + +static void +iscsi_maintenance_thread_reconnect(struct iscsi_session *is) +{ + + icl_conn_shutdown(is->is_conn); + icl_conn_close(is->is_conn); + + ISCSI_SESSION_LOCK(is); + + is->is_connected = false; + is->is_reconnecting = false; + is->is_login_phase = false; + +#ifdef ICL_KERNEL_PROXY + if (is->is_login_pdu != NULL) { + icl_pdu_free(is->is_login_pdu); + is->is_login_pdu = NULL; + } + cv_signal(&is->is_login_cv); +#endif + + if (fail_on_disconnection) { + ISCSI_SESSION_DEBUG(is, "connection failed, destroying devices"); + iscsi_session_cleanup(is, true); + } else { + iscsi_session_cleanup(is, false); + } + KASSERT(TAILQ_EMPTY(&is->is_outstanding), ("destroying session with active tasks")); KASSERT(STAILQ_EMPTY(&is->is_postponed), @@ -351,9 +395,6 @@ iscsi_maintenance_thread_reconnect(struc * Request immediate reconnection from iscsid(8). */ //ISCSI_SESSION_DEBUG(is, "waking up iscsid(8)"); - is->is_connected = false; - is->is_reconnecting = false; - is->is_login_phase = false; is->is_waiting_for_iscsid = true; strlcpy(is->is_reason, "Waiting for iscsid(8)", sizeof(is->is_reason)); is->is_timeout = 0; @@ -365,7 +406,6 @@ static void iscsi_maintenance_thread_terminate(struct iscsi_session *is) { struct iscsi_softc *sc; - struct icl_pdu *pdu; sc = is->is_softc; sx_xlock(&sc->sc_lock); @@ -386,48 +426,9 @@ iscsi_maintenance_thread_terminate(struc cv_signal(&is->is_login_cv); #endif - /* - * Don't queue any new PDUs. - */ callout_drain(&is->is_callout); - if (is->is_sim != NULL && is->is_simq_frozen == false) { - ISCSI_SESSION_DEBUG(is, "freezing"); - xpt_freeze_simq(is->is_sim, 1); - is->is_simq_frozen = true; - } - /* - * Remove postponed PDUs. - */ - while (!STAILQ_EMPTY(&is->is_postponed)) { - pdu = STAILQ_FIRST(&is->is_postponed); - STAILQ_REMOVE_HEAD(&is->is_postponed, ip_next); - icl_pdu_free(pdu); - } - - /* - * Forcibly terminate SCSI tasks. - */ - ISCSI_SESSION_DEBUG(is, "terminating tasks"); - iscsi_session_terminate_tasks(is, false); - - /* - * Deregister CAM. - */ - if (is->is_sim != NULL) { - ISCSI_SESSION_DEBUG(is, "deregistering SIM"); - xpt_async(AC_LOST_DEVICE, is->is_path, NULL); - - if (is->is_simq_frozen) { - xpt_release_simq(is->is_sim, 1); - is->is_simq_frozen = false; - } - - xpt_free_path(is->is_path); - xpt_bus_deregister(cam_sim_path(is->is_sim)); - cam_sim_free(is->is_sim, TRUE /*free_devq*/); - is->is_sim = NULL; - } + iscsi_session_cleanup(is, true); KASSERT(TAILQ_EMPTY(&is->is_outstanding), ("destroying session with active tasks")); @@ -1971,7 +1972,8 @@ iscsi_action(struct cam_sim *sim, union ISCSI_SESSION_LOCK_ASSERT(is); - if (is->is_terminating) { + if (is->is_terminating || + (is->is_connected == false && fail_on_disconnection)) { ccb->ccb_h.status = CAM_DEV_NOT_THERE; xpt_done(ccb); return; From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 17:39:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E5B1CBB; Wed, 16 Apr 2014 17:39:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BAEE1ACE; Wed, 16 Apr 2014 17:39:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GHdxW5038752; Wed, 16 Apr 2014 17:39:59 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GHdxm5038751; Wed, 16 Apr 2014 17:39:59 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404161739.s3GHdxm5038751@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 16 Apr 2014 17:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264545 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 17:39:59 -0000 Author: trasz Date: Wed Apr 16 17:39:59 2014 New Revision: 264545 URL: http://svnweb.freebsd.org/changeset/base/264545 Log: Fix typo. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.c Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Wed Apr 16 17:39:10 2014 (r264544) +++ head/sys/dev/iscsi/icl.c Wed Apr 16 17:39:59 2014 (r264545) @@ -885,7 +885,7 @@ icl_conn_send_pdus(struct icl_conn *ic, /* * Set the low watermark, to be checked by - * sowritable() in icl_soupcall_send() + * sowriteable() in icl_soupcall_send() * to avoid unneccessary wakeups until there * is enough space for the PDU to fit. */ From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 18:23:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF1F6FC0; Wed, 16 Apr 2014 18:23:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFDDB1107; Wed, 16 Apr 2014 18:23:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GINbqZ059273; Wed, 16 Apr 2014 18:23:37 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GINaN2059268; Wed, 16 Apr 2014 18:23:36 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404161823.s3GINaN2059268@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 16 Apr 2014 18:23:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264549 - in head: sys/dev/iscsi usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 18:23:38 -0000 Author: trasz Date: Wed Apr 16 18:23:36 2014 New Revision: 264549 URL: http://svnweb.freebsd.org/changeset/base/264549 Log: Make it possible for the initiator side to operate in both proxy and normal mode; this makes it possible to compile with the former by default, but use it only when neccessary. That's especially important for the userland part. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/iscsi.c head/sys/dev/iscsi/iscsi_ioctl.h head/usr.sbin/iscsid/iscsid.c head/usr.sbin/iscsid/iscsid.h head/usr.sbin/iscsid/pdu.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Wed Apr 16 18:09:39 2014 (r264548) +++ head/sys/dev/iscsi/iscsi.c Wed Apr 16 18:23:36 2014 (r264549) @@ -1304,12 +1304,19 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ ISCSI_SESSION_UNLOCK(is); -#ifndef ICL_KERNEL_PROXY - error = icl_conn_handoff(is->is_conn, handoff->idh_socket); - if (error != 0) { - sx_sunlock(&sc->sc_lock); - iscsi_session_terminate(is); - return (error); +#ifdef ICL_KERNEL_PROXY + if (handoff->idh_socket != 0) { +#endif + /* + * Handoff without using ICL proxy. + */ + error = icl_conn_handoff(is->is_conn, handoff->idh_socket); + if (error != 0) { + sx_sunlock(&sc->sc_lock); + iscsi_session_terminate(is); + return (error); + } +#ifdef ICL_KERNEL_PROXY } #endif @@ -1420,13 +1427,18 @@ iscsi_ioctl_daemon_connect(struct iscsi_ if (idc->idc_from_addrlen > 0) { error = getsockaddr(&from_sa, (void *)idc->idc_from_addr, idc->idc_from_addrlen); - if (error != 0) + if (error != 0) { + ISCSI_SESSION_WARN(is, + "getsockaddr failed with error %d", error); return (error); + } } else { from_sa = NULL; } error = getsockaddr(&to_sa, (void *)idc->idc_to_addr, idc->idc_to_addrlen); if (error != 0) { + ISCSI_SESSION_WARN(is, "getsockaddr failed with error %d", + error); free(from_sa, M_SONAME); return (error); } Modified: head/sys/dev/iscsi/iscsi_ioctl.h ============================================================================== --- head/sys/dev/iscsi/iscsi_ioctl.h Wed Apr 16 18:09:39 2014 (r264548) +++ head/sys/dev/iscsi/iscsi_ioctl.h Wed Apr 16 18:23:36 2014 (r264549) @@ -129,9 +129,9 @@ struct iscsi_daemon_fail { /* * When ICL_KERNEL_PROXY is not defined, the iscsid(8) is responsible - * for creating the socket, connecting, performing Login Phase using - * socked in the usual userspace way, and then passing the socket file - * descriptor to the kernel part using ISCSIDHANDOFF. + * for creating the socket, connecting, and performing Login Phase using + * the socket in the usual userspace way, and then passing the socket + * file descriptor to the kernel part using ISCSIDHANDOFF. * * When ICL_KERNEL_PROXY is defined, the iscsid(8) creates the session * using ISCSICONNECT, performs Login Phase using ISCSISEND/ISCSIRECEIVE @@ -162,7 +162,7 @@ struct iscsi_daemon_send { void *ids_spare2; size_t ids_data_segment_len; void *ids_data_segment; - int ids_spare[4]; + int ids_spare3[4]; }; struct iscsi_daemon_receive { @@ -172,7 +172,7 @@ struct iscsi_daemon_receive { void *idr_spare2; size_t idr_data_segment_len; void *idr_data_segment; - int idr_spare[4]; + int idr_spare3[4]; }; #define ISCSIDCONNECT _IOWR('I', 0x04, struct iscsi_daemon_connect) Modified: head/usr.sbin/iscsid/iscsid.c ============================================================================== --- head/usr.sbin/iscsid/iscsid.c Wed Apr 16 18:09:39 2014 (r264548) +++ head/usr.sbin/iscsid/iscsid.c Wed Apr 16 18:23:36 2014 (r264549) @@ -194,30 +194,32 @@ connection_new(unsigned int session_id, resolve_addr(conn, to_addr, &to_ai, false); #ifdef ICL_KERNEL_PROXY + if (conn->conn_conf.isc_iser) { + memset(&idc, 0, sizeof(idc)); + idc.idc_session_id = conn->conn_session_id; + if (conn->conn_conf.isc_iser) + idc.idc_iser = 1; + idc.idc_domain = to_ai->ai_family; + idc.idc_socktype = to_ai->ai_socktype; + idc.idc_protocol = to_ai->ai_protocol; + if (from_ai != NULL) { + idc.idc_from_addr = from_ai->ai_addr; + idc.idc_from_addrlen = from_ai->ai_addrlen; + } + idc.idc_to_addr = to_ai->ai_addr; + idc.idc_to_addrlen = to_ai->ai_addrlen; - memset(&idc, 0, sizeof(idc)); - idc.idc_session_id = conn->conn_session_id; - if (conn->conn_conf.isc_iser) - idc.idc_iser = 1; - idc.idc_domain = to_ai->ai_family; - idc.idc_socktype = to_ai->ai_socktype; - idc.idc_protocol = to_ai->ai_protocol; - if (from_ai != NULL) { - idc.idc_from_addr = from_ai->ai_addr; - idc.idc_from_addrlen = from_ai->ai_addrlen; - } - idc.idc_to_addr = to_ai->ai_addr; - idc.idc_to_addrlen = to_ai->ai_addrlen; + log_debugx("connecting to %s using ICL kernel proxy", to_addr); + error = ioctl(iscsi_fd, ISCSIDCONNECT, &idc); + if (error != 0) { + fail(conn, strerror(errno)); + log_err(1, "failed to connect to %s " + "using ICL kernel proxy: ISCSIDCONNECT", to_addr); + } - log_debugx("connecting to %s using ICL kernel proxy", to_addr); - error = ioctl(iscsi_fd, ISCSIDCONNECT, &idc); - if (error != 0) { - fail(conn, strerror(errno)); - log_err(1, "failed to connect to %s using ICL kernel proxy", - to_addr); + return (conn); } - -#else /* !ICL_KERNEL_PROXY */ +#endif /* ICL_KERNEL_PROXY */ if (conn->conn_conf.isc_iser) { fail(conn, "iSER not supported"); @@ -246,8 +248,6 @@ connection_new(unsigned int session_id, log_err(1, "failed to connect to %s", to_addr); } -#endif /* !ICL_KERNEL_PROXY */ - return (conn); } @@ -261,9 +261,7 @@ handoff(struct connection *conn) memset(&idh, 0, sizeof(idh)); idh.idh_session_id = conn->conn_session_id; -#ifndef ICL_KERNEL_PROXY idh.idh_socket = conn->conn_socket; -#endif strlcpy(idh.idh_target_alias, conn->conn_target_alias, sizeof(idh.idh_target_alias)); memcpy(idh.idh_isid, conn->conn_isid, sizeof(idh.idh_isid)); Modified: head/usr.sbin/iscsid/iscsid.h ============================================================================== --- head/usr.sbin/iscsid/iscsid.h Wed Apr 16 18:09:39 2014 (r264548) +++ head/usr.sbin/iscsid/iscsid.h Wed Apr 16 18:23:36 2014 (r264549) @@ -46,9 +46,7 @@ struct connection { int conn_iscsi_fd; -#ifndef ICL_KERNEL_PROXY int conn_socket; -#endif unsigned int conn_session_id; struct iscsi_session_conf conn_conf; char conn_target_alias[ISCSI_ADDR_LEN]; Modified: head/usr.sbin/iscsid/pdu.c ============================================================================== --- head/usr.sbin/iscsid/pdu.c Wed Apr 16 18:09:39 2014 (r264548) +++ head/usr.sbin/iscsid/pdu.c Wed Apr 16 18:23:36 2014 (r264549) @@ -101,13 +101,15 @@ pdu_new_response(struct pdu *request) #ifdef ICL_KERNEL_PROXY -void -pdu_receive(struct pdu *pdu) +static void +pdu_receive_proxy(struct pdu *pdu) { struct iscsi_daemon_receive *idr; size_t len; int error; + assert(pdu->pdu_connection->conn_conf.isc_iser != 0); + pdu->pdu_data = malloc(ISCSI_MAX_DATA_SEGMENT_LENGTH); if (pdu->pdu_data == NULL) log_err(1, "malloc"); @@ -136,12 +138,14 @@ pdu_receive(struct pdu *pdu) free(idr); } -void -pdu_send(struct pdu *pdu) +static void +pdu_send_proxy(struct pdu *pdu) { struct iscsi_daemon_send *ids; int error; + assert(pdu->pdu_connection->conn_conf.isc_iser != 0); + pdu_set_data_segment_length(pdu, pdu->pdu_data_len); ids = calloc(1, sizeof(*ids)); @@ -160,7 +164,7 @@ pdu_send(struct pdu *pdu) free(ids); } -#else /* !ICL_KERNEL_PROXY */ +#endif /* ICL_KERNEL_PROXY */ static size_t pdu_padding(const struct pdu *pdu) @@ -196,6 +200,13 @@ pdu_receive(struct pdu *pdu) size_t len, padding; char dummy[4]; +#ifdef ICL_KERNEL_PROXY + if (pdu->pdu_connection->conn_conf.isc_iser != 0) + return (pdu_receive_proxy(pdu)); +#endif + + assert(pdu->pdu_connection->conn_conf.isc_iser == 0); + pdu_read(pdu->pdu_connection->conn_socket, (char *)pdu->pdu_bhs, sizeof(*pdu->pdu_bhs)); @@ -237,6 +248,13 @@ pdu_send(struct pdu *pdu) struct iovec iov[3]; int iovcnt; +#ifdef ICL_KERNEL_PROXY + if (pdu->pdu_connection->conn_conf.isc_iser != 0) + return (pdu_send_proxy(pdu)); +#endif + + assert(pdu->pdu_connection->conn_conf.isc_iser == 0); + pdu_set_data_segment_length(pdu, pdu->pdu_data_len); iov[0].iov_base = pdu->pdu_bhs; iov[0].iov_len = sizeof(*pdu->pdu_bhs); @@ -269,8 +287,6 @@ pdu_send(struct pdu *pdu) log_errx(1, "short write"); } -#endif /* !ICL_KERNEL_PROXY */ - void pdu_delete(struct pdu *pdu) { From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 18:37:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9BFB144D; Wed, 16 Apr 2014 18:37:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 897061219; Wed, 16 Apr 2014 18:37:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GIbkLI075902; Wed, 16 Apr 2014 18:37:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GIbkuS075901; Wed, 16 Apr 2014 18:37:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404161837.s3GIbkuS075901@svn.freebsd.org> From: Alexander Motin Date: Wed, 16 Apr 2014 18:37:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264550 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 18:37:46 -0000 Author: mav Date: Wed Apr 16 18:37:46 2014 New Revision: 264550 URL: http://svnweb.freebsd.org/changeset/base/264550 Log: Fix VIRTUAL and PROF interval timers for short intervals, broken at r247903. Due to the way those timers are implemented, we can't handle very short intervals. In addition to that mentioned patch caused math overflows for short intervals. To avoid that round those intervals to 1 tick. PR: kern/187668 MFC after: 1 week Modified: head/sys/kern/kern_time.c Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Wed Apr 16 18:23:36 2014 (r264549) +++ head/sys/kern/kern_time.c Wed Apr 16 18:37:46 2014 (r264550) @@ -774,6 +774,14 @@ kern_setitimer(struct thread *td, u_int timevalsub(&oitv->it_value, &ctv); } } else { + if (aitv->it_interval.tv_sec == 0 && + aitv->it_interval.tv_usec != 0 && + aitv->it_interval.tv_usec < tick) + aitv->it_interval.tv_usec = tick; + if (aitv->it_value.tv_sec == 0 && + aitv->it_value.tv_usec != 0 && + aitv->it_value.tv_usec < tick) + aitv->it_value.tv_usec = tick; PROC_SLOCK(p); *oitv = p->p_stats->p_timer[which]; p->p_stats->p_timer[which] = *aitv; From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 19:49:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B55BE9B3; Wed, 16 Apr 2014 19:49:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2770191C; Wed, 16 Apr 2014 19:49:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GJniek005433; Wed, 16 Apr 2014 19:49:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GJniP0005432; Wed, 16 Apr 2014 19:49:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404161949.s3GJniP0005432@svn.freebsd.org> From: Warner Losh Date: Wed, 16 Apr 2014 19:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264551 - head/sys/modules/nandfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 19:49:44 -0000 Author: imp Date: Wed Apr 16 19:49:44 2014 New Revision: 264551 URL: http://svnweb.freebsd.org/changeset/base/264551 Log: Include opt_ddb.h in the list of SRCS, since we include it. MFC after: 3d Modified: head/sys/modules/nandfs/Makefile Modified: head/sys/modules/nandfs/Makefile ============================================================================== --- head/sys/modules/nandfs/Makefile Wed Apr 16 18:37:46 2014 (r264550) +++ head/sys/modules/nandfs/Makefile Wed Apr 16 19:49:44 2014 (r264551) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../fs/nandfs KMOD= nandfs -SRCS= vnode_if.h \ +SRCS= vnode_if.h opt_ddb.h \ bmap.c nandfs_bmap.c nandfs_dir.c nandfs_subr.c nandfs_vfsops.c \ nandfs_vnops.c nandfs_alloc.c nandfs_cpfile.c nandfs_dat.c \ nandfs_ifile.c nandfs_segment.c nandfs_sufile.c nandfs_buffer.c \ From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 19:59:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDD21C86; Wed, 16 Apr 2014 19:59:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB27319FA; Wed, 16 Apr 2014 19:59:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GJx6Ff009488; Wed, 16 Apr 2014 19:59:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GJx6A8009487; Wed, 16 Apr 2014 19:59:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404161959.s3GJx6A8009487@svn.freebsd.org> From: Alexander Motin Date: Wed, 16 Apr 2014 19:59:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264552 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 19:59:06 -0000 Author: mav Date: Wed Apr 16 19:59:06 2014 New Revision: 264552 URL: http://svnweb.freebsd.org/changeset/base/264552 Log: Close the race in older code, that caused connection stuck after r264348. Reviewed by: trasz MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/dev/iscsi/icl.c Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Wed Apr 16 19:49:44 2014 (r264551) +++ head/sys/dev/iscsi/icl.c Wed Apr 16 19:59:06 2014 (r264552) @@ -877,11 +877,6 @@ icl_conn_send_pdus(struct icl_conn *ic, request = STAILQ_FIRST(queue); size = icl_pdu_size(request); if (available < size) { -#if 1 - ICL_DEBUG("no space to send; " - "have %zd, need %zd", - available, size); -#endif /* * Set the low watermark, to be checked by @@ -890,9 +885,18 @@ icl_conn_send_pdus(struct icl_conn *ic, * is enough space for the PDU to fit. */ SOCKBUF_LOCK(&so->so_snd); - so->so_snd.sb_lowat = size; + available = sbspace(&so->so_snd); + if (available < size) { +#if 1 + ICL_DEBUG("no space to send; " + "have %zd, need %zd", + available, size); +#endif + so->so_snd.sb_lowat = size; + SOCKBUF_UNLOCK(&so->so_snd); + return; + } SOCKBUF_UNLOCK(&so->so_snd); - return; } STAILQ_REMOVE_HEAD(queue, ip_next); error = icl_pdu_finalize(request); From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 21:39:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C06E4B46; Wed, 16 Apr 2014 21:39:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE022144B; Wed, 16 Apr 2014 21:39:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GLdhgF051397; Wed, 16 Apr 2014 21:39:43 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GLdh5T051396; Wed, 16 Apr 2014 21:39:43 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201404162139.s3GLdh5T051396@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 16 Apr 2014 21:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264565 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 21:39:43 -0000 Author: np Date: Wed Apr 16 21:39:43 2014 New Revision: 264565 URL: http://svnweb.freebsd.org/changeset/base/264565 Log: Do not set M_BESTFIT if a strategy has already been provided. This fixes problems when using M_FIRSTFIT. Reviewed by: jeff@ MFC after: 1 week Modified: head/sys/kern/subr_vmem.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Wed Apr 16 21:30:17 2014 (r264564) +++ head/sys/kern/subr_vmem.c Wed Apr 16 21:39:43 2014 (r264565) @@ -502,7 +502,8 @@ qc_import(void *arg, void **store, int c int i; qc = arg; - flags |= M_BESTFIT; + if ((flags & VMEM_FITMASK) == 0) + flags |= M_BESTFIT; for (i = 0; i < cnt; i++) { if (vmem_xalloc(qc->qc_vmem, qc->qc_size, 0, 0, 0, VMEM_ADDR_MIN, VMEM_ADDR_MAX, flags, &addr) != 0) From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 22:26:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FB51643; Wed, 16 Apr 2014 22:26:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CAB119EB; Wed, 16 Apr 2014 22:26:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GMQg7L071855; Wed, 16 Apr 2014 22:26:42 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GMQgMo071854; Wed, 16 Apr 2014 22:26:42 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201404162226.s3GMQgMo071854@svn.freebsd.org> From: Maksim Yevmenkin Date: Wed, 16 Apr 2014 22:26:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264571 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 22:26:43 -0000 Author: emax Date: Wed Apr 16 22:26:42 2014 New Revision: 264571 URL: http://svnweb.freebsd.org/changeset/base/264571 Log: when watchdogd is asked to exit nicely (via SIGTERM) it will stop timer. since watchdogd rc.d script is marked as 'shutdown' it will exit (on shutdown) and stop timer. if system happens to hung after watchdogd exited, manual reset is required. when one operates in "lights-out" type of environments and without readily available "remote hands" it could create a problem. this provides ability to override "stop signal" for watchdogd. default behavior is preserved, i.e. watchdogd will still be killed via SIGTERM and timer will be stopped. in order to activate new feature, one needs to put watchdogd_sig_stop="KILL" into /etc/rc.conf and also make sure watchdogd timeout is set to long enough value allowing system to come back online before timeout fires. Obtained from: Netflix MFC after: 1 week Modified: head/etc/rc.d/watchdogd Modified: head/etc/rc.d/watchdogd ============================================================================== --- head/etc/rc.d/watchdogd Wed Apr 16 22:18:43 2014 (r264570) +++ head/etc/rc.d/watchdogd Wed Apr 16 22:26:42 2014 (r264571) @@ -39,4 +39,7 @@ command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" load_rc_config $name + +sig_stop="${watchdogd_sig_stop:-TERM}" + run_rc_command "$1" From owner-svn-src-head@FreeBSD.ORG Wed Apr 16 23:14:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E190D71; Wed, 16 Apr 2014 23:14:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19253103C; Wed, 16 Apr 2014 23:14:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GNE8lC092629; Wed, 16 Apr 2014 23:14:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GNE5nN092614; Wed, 16 Apr 2014 23:14:05 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404162314.s3GNE5nN092614@svn.freebsd.org> From: Xin LI Date: Wed, 16 Apr 2014 23:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264573 - in head/usr.bin: bc dc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 23:14:08 -0000 Author: delphij Date: Wed Apr 16 23:14:05 2014 New Revision: 264573 URL: http://svnweb.freebsd.org/changeset/base/264573 Log: Sync with OpenBSD. MFC after: 2 weeks Added: head/usr.bin/bc/tty.c (contents, props changed) Modified: head/usr.bin/bc/Makefile head/usr.bin/bc/bc.1 head/usr.bin/bc/bc.library head/usr.bin/bc/bc.y head/usr.bin/bc/extern.h head/usr.bin/bc/scan.l head/usr.bin/dc/bcode.c head/usr.bin/dc/bcode.h head/usr.bin/dc/dc.1 head/usr.bin/dc/inout.c Modified: head/usr.bin/bc/Makefile ============================================================================== --- head/usr.bin/bc/Makefile Wed Apr 16 23:12:35 2014 (r264572) +++ head/usr.bin/bc/Makefile Wed Apr 16 23:14:05 2014 (r264573) @@ -1,12 +1,12 @@ # $FreeBSD$ -# $OpenBSD: Makefile,v 1.4 2006/06/30 19:02:28 otto Exp $ +# $OpenBSD: Makefile,v 1.7 2013/09/19 16:12:00 otto Exp $ -PROG= bc -SRCS= bc.y scan.l -CFLAGS+= -I. -I${.CURDIR} +PROG= bc +SRCS= bc.y scan.l tty.c +CFLAGS+= -I. -I${.CURDIR} -DPADD= ${LIBEDIT} ${LIBTERMCAP} -LDADD= -ledit -ltermcap +LDADD+= -ledit -lcurses +DPADD+= ${LIBEDIT} ${LIBCURSES} NO_WMISSING_VARIABLE_DECLARATIONS= Modified: head/usr.bin/bc/bc.1 ============================================================================== --- head/usr.bin/bc/bc.1 Wed Apr 16 23:12:35 2014 (r264572) +++ head/usr.bin/bc/bc.1 Wed Apr 16 23:14:05 2014 (r264573) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.\" $OpenBSD: bc.1,v 1.25 2010/01/02 19:48:56 schwarze Exp $ +.\" $OpenBSD: bc.1,v 1.30 2014/01/14 07:42:42 jmc Exp $ .\" .\" Copyright (C) Caldera International Inc. 2001-2002. .\" All rights reserved. @@ -35,7 +35,7 @@ .\" .\" @(#)bc.1 6.8 (Berkeley) 8/8/91 .\" -.Dd December 6, 2013 +.Dd April 16, 2014 .Dt BC 1 .Os .Sh NAME @@ -140,8 +140,7 @@ The following arithmetic and logical ope The semantics of the operators is the same as in the C language. They are listed in order of decreasing precedence. Operators in the same group have the same precedence. -.Bl -column -offset indent "= += \-= *= /= %= ^=" "Associativity" \ -"multiply, divide, modulus" +.Bl -column "= += \-= *= /= %= ^=" "Associativity" "multiply, divide, modulus" -offset indent .It Sy "Operator" Ta Sy "Associativity" Ta Sy "Description" .It "++ \-\-" Ta "none" Ta "increment, decrement" .It "\-" Ta "none" Ta "unary minus" @@ -160,7 +159,7 @@ Note the following: .It The relational operators may appear in any expression. The -.St -p1003.2 +.St -p1003.1-2008 standard only allows them in the conditional expression of an .Sq if , .Sq while @@ -342,6 +341,22 @@ $ bc -l -e 'scale = 500; 2 * a(2^10000)' .Ed .Pp prints an approximation of pi. +.Sh COMMAND LINE EDITING +.Nm +supports interactive command line editing, via the +.Xr editline 3 +library. +It is enabled by default if input is from a tty. +Previous lines can be recalled and edited with the arrow keys, +and other GNU Emacs-style editing keys may be used as well. +.Pp +The +.Xr editline 3 +library is configured with a +.Pa .editrc +file \- refer to +.Xr editrc 5 +for more information. .Sh FILES .Bl -tag -width /usr/share/misc/bc.library -compact .It Pa /usr/share/misc/bc.library @@ -359,9 +374,6 @@ options are no-ops for compatibility wit and their use is discouraged. .Sh SEE ALSO .Xr dc 1 -.Pp -"BC \- An Arbitrary Precision Desk-Calculator Language", -.Pa /usr/share/doc/usd/06.bc/ . .Sh STANDARDS The .Nm @@ -370,7 +382,8 @@ utility is compliant with the specification. .Pp The flags -.Op Fl ce +.Op Fl ce , +as well as the parts noted above, are extensions to that specification. .Sh HISTORY The Modified: head/usr.bin/bc/bc.library ============================================================================== --- head/usr.bin/bc/bc.library Wed Apr 16 23:12:35 2014 (r264572) +++ head/usr.bin/bc/bc.library Wed Apr 16 23:14:05 2014 (r264573) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $OpenBSD: bc.library,v 1.3 2007/02/03 21:15:06 otto Exp $ */ +/* $OpenBSD: bc.library,v 1.4 2012/03/14 07:35:53 otto Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -100,13 +100,13 @@ define l(x) { if (x < 1) { s = scale(x) } else { - s = length(x) - scale(x) + s = length(x)-scale(x) } scale = 0 a = (2.31*s)/1 /* estimated integer part of the answer */ s = t + length(a) + 2 /* estimated length of the answer */ while (x > 2) { - scale=0 + scale = 0 scale = (length(x) + scale(x))/2 + 1 if (scale < s) scale = s x = sqrt(x) Modified: head/usr.bin/bc/bc.y ============================================================================== --- head/usr.bin/bc/bc.y Wed Apr 16 23:12:35 2014 (r264572) +++ head/usr.bin/bc/bc.y Wed Apr 16 23:14:05 2014 (r264573) @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: bc.y,v 1.33 2009/10/27 23:59:36 deraadt Exp $ */ +/* $OpenBSD: bc.y,v 1.44 2013/11/20 21:33:54 deraadt Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -53,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include "extern.h" #include "pathnames.h" -#define BC_VER "1.0-FreeBSD" +#define BC_VER "1.1-FreeBSD" #define END_NODE ((ssize_t) -1) #define CONST_STRING ((ssize_t) -2) #define ALLOC_STRING ((ssize_t) -3) @@ -971,7 +970,12 @@ yyerror(const char *s) if (yyin != NULL && feof(yyin)) n = asprintf(&str, "%s: %s:%d: %s: unexpected EOF", __progname, filename, lineno, s); - else if (isspace(yytext[0]) || !isprint(yytext[0])) + else if (yytext[0] == '\n') + n = asprintf(&str, + "%s: %s:%d: %s: newline unexpected", + __progname, filename, lineno, s); + else if (isspace((unsigned char)yytext[0]) || + !isprint((unsigned char)yytext[0])) n = asprintf(&str, "%s: %s:%d: %s: ascii char 0x%02x unexpected", __progname, filename, lineno, s, yytext[0]); @@ -1085,26 +1089,25 @@ escape(const char *str) /* ARGSUSED */ static void -sigchld(int signo) +sigchld(int signo __unused) { pid_t pid; - int status; + int status, save_errno = errno; - switch (signo) { - default: - for (;;) { - pid = waitpid(dc, &status, WUNTRACED); - if (pid == -1) { - if (errno == EINTR) - continue; - _exit(0); - } - if (WIFEXITED(status) || WIFSIGNALED(status)) - _exit(0); - else - break; - } + for (;;) { + pid = waitpid(dc, &status, WCONTINUED | WNOHANG); + if (pid == -1) { + if (errno == EINTR) + continue; + _exit(0); + } else if (pid == 0) + break; + if (WIFEXITED(status) || WIFSIGNALED(status)) + _exit(0); + else + break; } + errno = save_errno; } static const char * @@ -1191,6 +1194,7 @@ main(int argc, char *argv[]) } } if (interactive) { + gettty(&ttysaved); el = el_init("bc", stdin, stderr, stderr); hist = history_init(); history(hist, &he, H_SETSIZE, 100); @@ -1198,6 +1202,8 @@ main(int argc, char *argv[]) el_set(el, EL_EDITOR, "emacs"); el_set(el, EL_SIGNAL, 1); el_set(el, EL_PROMPT, dummy_prompt); + el_set(el, EL_ADDFN, "bc_eof", "", bc_eof); + el_set(el, EL_BIND, "^D", "bc_eof", NULL); el_source(el, NULL); } yywrap(); Modified: head/usr.bin/bc/extern.h ============================================================================== --- head/usr.bin/bc/extern.h Wed Apr 16 23:12:35 2014 (r264572) +++ head/usr.bin/bc/extern.h Wed Apr 16 23:14:05 2014 (r264573) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $OpenBSD: extern.h,v 1.6 2006/03/18 20:44:43 otto Exp $ */ +/* $OpenBSD: extern.h,v 1.10 2013/09/19 16:12:01 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek @@ -17,26 +17,34 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include #include struct lvalue { - ssize_t load; - ssize_t store; + ssize_t load; + ssize_t store; }; -int yylex(void); -void yyerror(const char *); -void fatal(const char *); -void abort_line(int); - -extern int lineno; -extern int fileindex; -extern int sargc; +int yylex(void); +void yyerror(const char *); +void fatal(const char *); +void abort_line(int); +struct termios; +int gettty(struct termios *); +void tstpcont(int); +unsigned char bc_eof(EditLine *, int); + +extern int lineno; +extern char *yytext; +extern FILE *yyin; +extern int fileindex; +extern int sargc; extern const char **sargv; extern const char *filename; -extern char *cmdexpr; extern bool interactive; extern EditLine *el; extern History *hist; extern HistEvent he; - +extern char *cmdexpr; +extern struct termios ttysaved; +extern bool interactive; Modified: head/usr.bin/bc/scan.l ============================================================================== --- head/usr.bin/bc/scan.l Wed Apr 16 23:12:35 2014 (r264572) +++ head/usr.bin/bc/scan.l Wed Apr 16 23:14:05 2014 (r264573) @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: scan.l,v 1.23 2009/10/27 23:59:36 deraadt Exp $ */ +/* $OpenBSD: scan.l,v 1.28 2013/09/19 16:12:01 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek @@ -24,6 +24,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -31,19 +32,22 @@ __FBSDID("$FreeBSD$"); #include "bc.h" #include "pathnames.h" -int lineno; +int lineno; +bool interactive; -bool interactive; HistEvent he; EditLine *el; History *hist; static char *strbuf = NULL; -static size_t strbuf_sz = 1; -static bool dot_seen; +static size_t strbuf_sz = 1; +static bool dot_seen; +static int use_el; +static volatile sig_atomic_t skipchars; + +static void init_strbuf(void); +static void add_str(const char *); -static void init_strbuf(void); -static void add_str(const char *); static int bc_yyinput(char *, int); #define YY_DECL int yylex(void) @@ -51,6 +55,7 @@ static int bc_yyinput(char *, int); #undef YY_INPUT #define YY_INPUT(buf,retval,max) \ (retval = bc_yyinput(buf, max)) + %} %option always-interactive @@ -102,7 +107,7 @@ ALPHANUM [a-z_0-9] BEGIN(INITIAL); yylval.str = strbuf; unput('.'); - return (NUMBER); + return NUMBER; } else { dot_seen = true; add_str("."); @@ -113,73 +118,73 @@ ALPHANUM [a-z_0-9] BEGIN(INITIAL); unput(yytext[0]); if (strcmp(strbuf, ".") == 0) - return (DOT); + return DOT; else { yylval.str = strbuf; - return (NUMBER); + return NUMBER; } } } -"auto" return (AUTO); -"break" return (BREAK); -"continue" return (CONTINUE); -"define" return (DEFINE); -"else" return (ELSE); -"ibase" return (IBASE); -"if" return (IF); -"last" return (DOT); -"for" return (FOR); -"length" return (LENGTH); -"obase" return (OBASE); -"print" return (PRINT); -"quit" return (QUIT); -"return" return (RETURN); -"scale" return (SCALE); -"sqrt" return (SQRT); -"while" return (WHILE); - -"^" return (EXPONENT); -"*" return (MULTIPLY); -"/" return (DIVIDE); -"%" return (REMAINDER); - -"!" return (BOOL_NOT); -"&&" return (BOOL_AND); -"||" return (BOOL_OR); - -"+" return (PLUS); -"-" return (MINUS); - -"++" return (INCR); -"--" return (DECR); - -"=" yylval.str = ""; return (ASSIGN_OP); -"+=" yylval.str = "+"; return (ASSIGN_OP); -"-=" yylval.str = "-"; return (ASSIGN_OP); -"*=" yylval.str = "*"; return (ASSIGN_OP); -"/=" yylval.str = "/"; return (ASSIGN_OP); -"%=" yylval.str = "%"; return (ASSIGN_OP); -"^=" yylval.str = "^"; return (ASSIGN_OP); - -"==" return (EQUALS); -"<=" return (LESS_EQ); -">=" return (GREATER_EQ); -"!=" return (UNEQUALS); -"<" return (LESS); -">" return (GREATER); - -"," return (COMMA); -";" return (SEMICOLON); +"auto" return AUTO; +"break" return BREAK; +"continue" return CONTINUE; +"define" return DEFINE; +"else" return ELSE; +"ibase" return IBASE; +"if" return IF; +"last" return DOT; +"for" return FOR; +"length" return LENGTH; +"obase" return OBASE; +"print" return PRINT; +"quit" return QUIT; +"return" return RETURN; +"scale" return SCALE; +"sqrt" return SQRT; +"while" return WHILE; + +"^" return EXPONENT; +"*" return MULTIPLY; +"/" return DIVIDE; +"%" return REMAINDER; + +"!" return BOOL_NOT; +"&&" return BOOL_AND; +"||" return BOOL_OR; + +"+" return PLUS; +"-" return MINUS; + +"++" return INCR; +"--" return DECR; + +"=" yylval.str = ""; return ASSIGN_OP; +"+=" yylval.str = "+"; return ASSIGN_OP; +"-=" yylval.str = "-"; return ASSIGN_OP; +"*=" yylval.str = "*"; return ASSIGN_OP; +"/=" yylval.str = "/"; return ASSIGN_OP; +"%=" yylval.str = "%"; return ASSIGN_OP; +"^=" yylval.str = "^"; return ASSIGN_OP; + +"==" return EQUALS; +"<=" return LESS_EQ; +">=" return GREATER_EQ; +"!=" return UNEQUALS; +"<" return LESS; +">" return GREATER; + +"," return COMMA; +";" return SEMICOLON; -"(" return (LPAR); -")" return (RPAR); +"(" return LPAR; +")" return RPAR; -"[" return (LBRACKET); -"]" return (RBRACKET); +"[" return LBRACKET; +"]" return RBRACKET; -"{" return (LBRACE); -"}" return (RBRACE); +"{" return LBRACE; +"}" return RBRACE; {ALPHA}{ALPHANUM}* { /* alloc an extra byte for the type marker */ @@ -188,15 +193,15 @@ ALPHANUM [a-z_0-9] err(1, NULL); strlcpy(p, yytext, yyleng + 1); yylval.astr = p; - return (LETTER); + return LETTER; } \\\n lineno++; -\n lineno++; return (NEWLINE); +\n lineno++; return NEWLINE; #[^\n]* ; [ \t] ; -<> return (QUIT); +<> return QUIT; . yyerror("illegal character"); %% @@ -204,7 +209,6 @@ ALPHANUM [a-z_0-9] static void init_strbuf(void) { - if (strbuf == NULL) { strbuf = malloc(strbuf_sz); if (strbuf == NULL) @@ -221,8 +225,8 @@ add_str(const char *str) arglen = strlen(str); if (strlen(strbuf) + arglen + 1 > strbuf_sz) { - size_t newsize; - char *p; + size_t newsize; + char *p; newsize = strbuf_sz + arglen + 1; p = realloc(strbuf, newsize); @@ -236,11 +240,47 @@ add_str(const char *str) strlcat(strbuf, str, strbuf_sz); } +/* ARGSUSED */ +void +abort_line(int sig __unused) +{ + static const char str1[] = "[\n]P\n"; + static const char str2[] = "[^C\n]P\n"; + int save_errno; + const LineInfo *info; + + save_errno = errno; + if (use_el) { + write(STDOUT_FILENO, str2, sizeof(str2) - 1); + info = el_line(el); + skipchars = info->lastchar - info->buffer; + } else + write(STDOUT_FILENO, str1, sizeof(str1) - 1); + errno = save_errno; +} + +/* + * Avoid the echo of ^D by the default code of editline and take + * into account skipchars to make ^D work when the cursor is at start of + * line after a ^C. + */ +unsigned char +bc_eof(EditLine *e, int ch __unused) +{ + const struct lineinfo *info = el_line(e); + + if (info->buffer + skipchars == info->cursor && + info->cursor == info->lastchar) + return (CC_EOF); + else + return (CC_ERROR); +} + int yywrap(void) { - static YY_BUFFER_STATE buf; static int state; + static YY_BUFFER_STATE buf; if (fileindex == 0 && sargc > 0 && strcmp(sargv[0], _PATH_LIBB) == 0) { filename = sargv[fileindex++]; @@ -273,6 +313,10 @@ yywrap(void) } else if (fileindex == sargc) { fileindex++; yyin = stdin; + if (interactive) { + signal(SIGINT, abort_line); + signal(SIGTSTP, tstpcont); + } lineno = 1; filename = "stdin"; return (0); @@ -284,17 +328,32 @@ static int bc_yyinput(char *buf, int maxlen) { int num; - if (yyin == stdin && interactive) { + + if (el != NULL) + el_get(el, EL_EDITMODE, &use_el); + + if (yyin == stdin && interactive && use_el) { const char *bp; + sigset_t oset, nset; if ((bp = el_gets(el, &num)) == NULL || num == 0) return (0); + sigemptyset(&nset); + sigaddset(&nset, SIGINT); + sigprocmask(SIG_BLOCK, &nset, &oset); + if (skipchars < num) { + bp += skipchars; + num -= skipchars; + } + skipchars = 0; + sigprocmask(SIG_SETMASK, &oset, NULL); if (num > maxlen) { - el_push(el, (char *)(uintptr_t)(bp) + maxlen); + el_push(el, (char *)(void *)bp + maxlen); num = maxlen; } memcpy(buf, bp, num); history(hist, &he, H_ENTER, bp); + el_get(el, EL_EDITMODE, &use_el); } else { int c = '*'; for (num = 0; num < maxlen && @@ -308,3 +367,4 @@ bc_yyinput(char *buf, int maxlen) return (num); } + Added: head/usr.bin/bc/tty.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/bc/tty.c Wed Apr 16 23:14:05 2014 (r264573) @@ -0,0 +1,65 @@ +/* $FreeBSD$ */ +/* $OpenBSD: tty.c,v 1.2 2013/11/12 13:54:51 deraadt Exp $ */ + +/* + * Copyright (c) 2013, Otto Moerbeek + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include +#include +#include "extern.h" + +struct termios ttysaved, ttyedit; + +static int +settty(struct termios *t) +{ + int ret; + + while ((ret = tcsetattr(0, TCSADRAIN, t) == -1) && errno == EINTR) + continue; + return ret; +} + +int +gettty(struct termios *t) +{ + int ret; + + while ((ret = tcgetattr(0, t) == -1) && errno == EINTR) + continue; + return ret; +} + +/* ARGSUSED */ +void +tstpcont(int sig) +{ + int save_errno = errno; + + if (sig == SIGTSTP) { + signal(SIGCONT, tstpcont); + gettty(&ttyedit); + settty(&ttysaved); + } else { + signal(SIGTSTP, tstpcont); + settty(&ttyedit); + } + signal(sig, SIG_DFL); + kill(0, sig); + errno = save_errno; +} Modified: head/usr.bin/dc/bcode.c ============================================================================== --- head/usr.bin/dc/bcode.c Wed Apr 16 23:12:35 2014 (r264572) +++ head/usr.bin/dc/bcode.c Wed Apr 16 23:14:05 2014 (r264573) @@ -1,4 +1,4 @@ -/* $OpenBSD: bcode.c,v 1.40 2009/10/27 23:59:37 deraadt Exp $ */ +/* $OpenBSD: bcode.c,v 1.45 2012/11/07 11:06:14 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD$"); #include "extern.h" -#define __inline +/* #define DEBUGGING */ #define MAX_ARRAY_INDEX 2048 #define READSTACK_SIZE 8 @@ -253,7 +253,7 @@ init_bmachine(bool extended_registers) u_int bmachine_scale(void) { - return (bmachine.scale); + return bmachine.scale; } /* Reset the things needed before processing a (new) file */ @@ -428,7 +428,6 @@ get_ulong(struct number *n) void negate(struct number *n) { - BN_set_negative(n->number, !BN_is_negative(n->number)); } @@ -695,7 +694,7 @@ count_digits(const struct number *n) u_int i; if (BN_is_zero(n->number)) - return (n->scale ? n->scale : 1); + return n->scale ? n->scale : 1; int_part = new_number(); fract_part = new_number(); @@ -1171,9 +1170,10 @@ bdivmod(void) static void bexp(void) { - struct number *a, *p, *r; - u_int rscale; - bool neg; + struct number *a, *p; + struct number *r; + bool neg; + u_int rscale; p = pop_number(); if (p == NULL) { @@ -1193,8 +1193,7 @@ bexp(void) bn_checkp(f); split_number(p, i, f); if (!BN_is_zero(f)) - warnx("Runtime warning: non-zero fractional part " - "in exponent"); + warnx("Runtime warning: non-zero fractional part in exponent"); BN_free(i); BN_free(f); } Modified: head/usr.bin/dc/bcode.h ============================================================================== --- head/usr.bin/dc/bcode.h Wed Apr 16 23:12:35 2014 (r264572) +++ head/usr.bin/dc/bcode.h Wed Apr 16 23:14:05 2014 (r264573) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $OpenBSD: bcode.h,v 1.5 2006/01/16 08:09:25 otto Exp $ */ +/* $OpenBSD: bcode.h,v 1.7 2012/11/07 11:06:14 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek @@ -83,15 +83,15 @@ struct source { int lastchar; }; -void init_bmachine(bool); -void reset_bmachine(struct source *); -u_int bmachine_scale(void); -void scale_number(BIGNUM *, int); -void normalize(struct number *, u_int); -void eval(void); -void pn(const char *, const struct number *); -void pbn(const char *, const BIGNUM *); -void negate(struct number *); -void split_number(const struct number *, BIGNUM *, BIGNUM *); -void bmul_number(struct number *, struct number *, - struct number *, u_int); +void init_bmachine(bool); +void reset_bmachine(struct source *); +u_int bmachine_scale(void); +void scale_number(BIGNUM *, int); +void normalize(struct number *, u_int); +void eval(void); +void pn(const char *, const struct number *); +void pbn(const char *, const BIGNUM *); +void negate(struct number *); +void split_number(const struct number *, BIGNUM *, BIGNUM *); +void bmul_number(struct number *, struct number *, + struct number *, u_int scale); Modified: head/usr.bin/dc/dc.1 ============================================================================== --- head/usr.bin/dc/dc.1 Wed Apr 16 23:12:35 2014 (r264572) +++ head/usr.bin/dc/dc.1 Wed Apr 16 23:14:05 2014 (r264573) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.\" $OpenBSD: dc.1,v 1.24 2010/01/02 19:48:56 schwarze Exp $ +.\" $OpenBSD: dc.1,v 1.27 2012/08/19 12:07:21 jmc Exp $ .\" .\" Copyright (C) Caldera International Inc. 2001-2002. .\" All rights reserved. @@ -35,7 +35,7 @@ .\" .\" @(#)dc.1 8.1 (Berkeley) 6/6/93 .\" -.Dd January 22, 2010 +.Dd April 16, 2014 .Dt DC 1 .Os .Sh NAME @@ -73,12 +73,6 @@ Evaluate If multiple .Fl e options are specified, they will be processed in the order given. -If no -.Ar filename -argument is given, execution will stop after processing the expressions -given on the command line, -otherwise processing will continue with the contents of -.Ar filename . .It Fl f Ar filename , Fl Fl file Ar filename Process the content of the given file before further calculations are done. If multiple @@ -98,14 +92,26 @@ See for a more detailed description. .El .Pp +If neither +.Ar expression +nor +.Ar file +are specified on the command line, +.Nm +reads from the standard input. +Otherwise +.Ar expression +and +.Ar file +are processed and +.Nm +exits. +.Pp Ordinarily, .Nm operates on decimal integers, but one may specify an input base, output base, and a number of fractional digits (scale) to be maintained. -If an argument is given, -input is taken from that file until its end, -then from the standard input. Whitespace is ignored, except where it signals the end of a number, end of a line or when a register name is expected. The following constructions are recognized: Modified: head/usr.bin/dc/inout.c ============================================================================== --- head/usr.bin/dc/inout.c Wed Apr 16 23:12:35 2014 (r264572) +++ head/usr.bin/dc/inout.c Wed Apr 16 23:14:05 2014 (r264573) @@ -1,4 +1,4 @@ -/* $OpenBSD: inout.c,v 1.15 2009/10/27 23:59:37 deraadt Exp $ */ +/* $OpenBSD: inout.c,v 1.17 2012/11/07 11:06:14 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek From owner-svn-src-head@FreeBSD.ORG Thu Apr 17 01:43:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B448E0E; Thu, 17 Apr 2014 01:43:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7854A1171; Thu, 17 Apr 2014 01:43:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3H1hG3G054654; Thu, 17 Apr 2014 01:43:16 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3H1hG0J054653; Thu, 17 Apr 2014 01:43:16 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201404170143.s3H1hG0J054653@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 17 Apr 2014 01:43:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264581 - head/usr.bin/printf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 01:43:16 -0000 Author: pfg Date: Thu Apr 17 01:43:15 2014 New Revision: 264581 URL: http://svnweb.freebsd.org/changeset/base/264581 Log: Minor style(9) cleanups #define should be followed by a tab. MFC after: 3 days Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Thu Apr 17 00:34:51 2014 (r264580) +++ head/usr.bin/printf/printf.c Thu Apr 17 01:43:15 2014 (r264581) @@ -61,13 +61,13 @@ static const char rcsid[] = #include #ifdef SHELL -#define main printfcmd +#define main printfcmd #include "bltin/bltin.h" #include "error.h" #include "options.h" #endif -#define PF(f, func) do { \ +#define PF(f, func) do { \ char *b = NULL; \ if (havewidth) \ if (haveprec) \ From owner-svn-src-head@FreeBSD.ORG Thu Apr 17 06:40:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6DDDDF0; Thu, 17 Apr 2014 06:40:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 945A81C21; Thu, 17 Apr 2014 06:40:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3H6eB50082127; Thu, 17 Apr 2014 06:40:11 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3H6eBXW082126; Thu, 17 Apr 2014 06:40:11 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201404170640.s3H6eBXW082126@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 17 Apr 2014 06:40:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264582 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 06:40:11 -0000 Author: ae Date: Thu Apr 17 06:40:11 2014 New Revision: 264582 URL: http://svnweb.freebsd.org/changeset/base/264582 Log: Remove unused variable. PR: 173521 MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netinet6/ip6_input.c Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Thu Apr 17 01:43:15 2014 (r264581) +++ head/sys/netinet6/ip6_input.c Thu Apr 17 06:40:11 2014 (r264582) @@ -1076,7 +1076,6 @@ ip6_hopopts_input(u_int32_t *plenp, u_in struct mbuf *m = *mp; int off = *offp, hbhlen; struct ip6_hbh *hbh; - u_int8_t *opt; /* validation of the length of the header */ #ifndef PULLDOWN_TEST @@ -1103,8 +1102,6 @@ ip6_hopopts_input(u_int32_t *plenp, u_in #endif off += hbhlen; hbhlen -= sizeof(struct ip6_hbh); - opt = (u_int8_t *)hbh + sizeof(struct ip6_hbh); - if (ip6_process_hopopts(m, (u_int8_t *)hbh + sizeof(struct ip6_hbh), hbhlen, rtalertp, plenp) < 0) return (-1); From owner-svn-src-head@FreeBSD.ORG Thu Apr 17 10:27:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C12AF160; Thu, 17 Apr 2014 10:27:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADC6017E5; Thu, 17 Apr 2014 10:27:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3HARIpD076855; Thu, 17 Apr 2014 10:27:18 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HARIrG076854; Thu, 17 Apr 2014 10:27:18 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404171027.s3HARIrG076854@svn.freebsd.org> From: Christian Brueffer Date: Thu, 17 Apr 2014 10:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264585 - head/lib/libipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 10:27:18 -0000 Author: brueffer Date: Thu Apr 17 10:27:18 2014 New Revision: 264585 URL: http://svnweb.freebsd.org/changeset/base/264585 Log: Add a missing break in the TCP case. Reviewed by: bms MFC after: 1 week Modified: head/lib/libipsec/ipsec_dump_policy.c Modified: head/lib/libipsec/ipsec_dump_policy.c ============================================================================== --- head/lib/libipsec/ipsec_dump_policy.c Thu Apr 17 09:21:58 2014 (r264584) +++ head/lib/libipsec/ipsec_dump_policy.c Thu Apr 17 10:27:18 2014 (r264585) @@ -199,6 +199,7 @@ ipsec_dump_ipsecrequest(buf, len, xisr, break; case IPPROTO_TCP: proto = "tcp"; + break; default: __ipsec_errcode = EIPSEC_INVAL_PROTO; return NULL; From owner-svn-src-head@FreeBSD.ORG Thu Apr 17 12:22:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF569C13; Thu, 17 Apr 2014 12:22:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD7011502; Thu, 17 Apr 2014 12:22:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3HCM8Bn027393; Thu, 17 Apr 2014 12:22:08 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HCM8Cc027392; Thu, 17 Apr 2014 12:22:08 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201404171222.s3HCM8Cc027392@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 17 Apr 2014 12:22:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264600 - head/sys/netsmb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 12:22:08 -0000 Author: ae Date: Thu Apr 17 12:22:08 2014 New Revision: 264600 URL: http://svnweb.freebsd.org/changeset/base/264600 Log: Remove redundant unlock. This code was removed from the opensolaris and darwin's netsmb implementations, in DfBSD it also has been disabled. PR: 36566, 87859, 139407, 161579, 175557, 178412, 186652 MFC after: 2 weeks Sponsored by: Yandex LLC Modified: head/sys/netsmb/smb_iod.c Modified: head/sys/netsmb/smb_iod.c ============================================================================== --- head/sys/netsmb/smb_iod.c Thu Apr 17 12:16:51 2014 (r264599) +++ head/sys/netsmb/smb_iod.c Thu Apr 17 12:22:08 2014 (r264600) @@ -87,8 +87,6 @@ smb_iod_invrq(struct smbiod *iod) */ SMB_IOD_RQLOCK(iod); TAILQ_FOREACH(rqp, &iod->iod_rqlist, sr_link) { - if (rqp->sr_flags & SMBR_INTERNAL) - SMBRQ_SUNLOCK(rqp); rqp->sr_flags |= SMBR_RESTART; smb_iod_rqprocessed(rqp, ENOTCONN); } From owner-svn-src-head@FreeBSD.ORG Thu Apr 17 12:33:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F4832B1; Thu, 17 Apr 2014 12:33:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F526162E; Thu, 17 Apr 2014 12:33:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3HCXSKD031888; Thu, 17 Apr 2014 12:33:28 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HCXREf031882; Thu, 17 Apr 2014 12:33:27 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201404171233.s3HCXREf031882@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 17 Apr 2014 12:33:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264601 - in head: share/man/man4 sys/boot/fdt/dts/mips sys/dev/netfpga10g sys/dev/netfpga10g/nf10bmac sys/mips/beri sys/mips/conf sys/modules sys/modules/netfpga10g sys/modules/netfpga... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 12:33:28 -0000 Author: bz Date: Thu Apr 17 12:33:26 2014 New Revision: 264601 URL: http://svnweb.freebsd.org/changeset/base/264601 Log: Add the initial version of if_nf10bmac(4), a driver to support an NetFPGA-10G Embedded CPU Ethernet Core. The current version operates on a simple PIO based interface connected to a NetFPGA-10G port. To avoid confusion: this driver operates on a CPU running on the FPGA, e.g. BERI/mips, and is not suited for the PCI host interface. MFC after: 1 week Relnotes: yes Sponsored by: DARPA/AFRL Added: head/share/man/man4/netfpga10g_nf10bmac.4 (contents, props changed) head/sys/dev/netfpga10g/ head/sys/dev/netfpga10g/nf10bmac/ head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c (contents, props changed) head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c (contents, props changed) head/sys/dev/netfpga10g/nf10bmac/if_nf10bmacreg.h (contents, props changed) head/sys/modules/netfpga10g/ head/sys/modules/netfpga10g/Makefile (contents, props changed) head/sys/modules/netfpga10g/nf10bmac/ head/sys/modules/netfpga10g/nf10bmac/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/boot/fdt/dts/mips/beri-netfpga.dts head/sys/mips/beri/files.beri head/sys/mips/conf/BERI_NETFPGA_MDROOT head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Apr 17 12:22:08 2014 (r264600) +++ head/share/man/man4/Makefile Thu Apr 17 12:33:26 2014 (r264601) @@ -280,6 +280,7 @@ MAN= aac.4 \ ncv.4 \ ${_ndis.4} \ net80211.4 \ + netfpga10g_nf10bmac.4 \ netgraph.4 \ netintro.4 \ netmap.4 \ @@ -675,6 +676,7 @@ MLINKS+=mwl.4 if_mwl.4 MLINKS+=mxge.4 if_mxge.4 MLINKS+=my.4 if_my.4 MLINKS+=${_ndis.4} ${_if_ndis.4} +MLINKS+=netfpga10g_nf10bmac.4 if_nf10bmac.4 MLINKS+=netintro.4 net.4 \ netintro.4 networking.4 MLINKS+=${_nfe.4} ${_if_nfe.4} Added: head/share/man/man4/netfpga10g_nf10bmac.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/netfpga10g_nf10bmac.4 Thu Apr 17 12:33:26 2014 (r264601) @@ -0,0 +1,70 @@ +.\"- +.\" Copyright (c) 2014 Bjoern A. Zeeb +.\" All rights reserved. +.\" +.\" This software was developed by SRI International and the University of +.\" Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-11-C-0249 +.\" ("MRC2"), as part of the DARPA MRC research programme. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 17, 2014 +.Dt NETFPGA10G_NF10BMAC 4 +.Os +.Sh NAME +.Nm netfpga10g_nf10bmac +.Nd driver for the NetFPGA-10G Embedded CPU Ethernet Core +.Sh SYNOPSIS +.Cd "device netfpga10g_nf10bmac" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the NetFPGA-10G Embedded CPU Ethernet +Core. +.Sh HARDWARE +The current version of the +.Nm +driver works with one PIO mode interface of the +NetFPGA-10G Embedded CPU Ethernet Core version 1.00a. +.Sh SEE ALSO +.Xr netintro 4 , +.Xr ifconfig 8 +.Rs +.%T NetFPGA-10G Wiki +.%U https://github.com/NetFPGA/NetFPGA-public/wiki +.Re +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 11.0 . +.Sh AUTHORS +This software and this manual page were +developed by SRI International and the University of Cambridge Computer +Laboratory under DARPA/AFRL contract +.Pq FA8750-11-C-0249 +.Pq Do MRC2 Dc , +as part of the DARPA MRC research programme. +The device driver was written by +.An Bjoern A. Zeeb . Modified: head/sys/boot/fdt/dts/mips/beri-netfpga.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beri-netfpga.dts Thu Apr 17 12:22:08 2014 (r264600) +++ head/sys/boot/fdt/dts/mips/beri-netfpga.dts Thu Apr 17 12:33:26 2014 (r264601) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2012-2013 Robert N. M. Watson * Copyright (c) 2013 SRI International - * Copyright (c) 2013 Bjoern A. Zeeb + * Copyright (c) 2013-2014 Bjoern A. Zeeb * All rights reserved. * * This software was developed by SRI International and the University of @@ -132,6 +132,17 @@ interrupt-parent = <&beripic>; }; */ + + ethernet@7f005000 { + compatible = "netfpag10g,nf10bmac"; + // TX, RX, LOOP + reg = <0x7f005010 0xc + 0x7f005020 0xc + 0x7f005030 0x4>; + // RX + #interrupts = <1>; + #interrupt-parent = <&beripic>; + }; }; aliases { Added: head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c Thu Apr 17 12:33:26 2014 (r264601) @@ -0,0 +1,816 @@ +/*- + * Copyright (c) 2012-2014 Bjoern A. Zeeb + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-11-C-0249 + * ("MRC2"), as part of the DARPA MRC research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * This driver is modelled after atse(4). We need to seriously reduce the + * per-driver code we have to write^wcopy & paste. + * + * TODO: + * - figure out on the HW side why some data is LE and some is BE. + * - general set of improvements possible (e.g., reduce times of copying, + * do on-the-copy checksum calculations) + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_device_polling.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include "if_nf10bmacreg.h" + +#ifndef NF10BMAC_MAX_PKTS +/* + * We have a 4k buffer in HW, so do not try to send more than 3 packets. + * At the time of writing HW is orders of magnitude faster than we can + * enqueue so it would not matter but need an escape. + */ +#define NF10BMAC_MAX_PKTS 3 +#endif + +#ifndef NF10BMAC_WATCHDOG_TIME +#define NF10BMAC_WATCHDOG_TIME 5 /* seconds */ +#endif + +#ifdef DEVICE_POLLING +static poll_handler_t nf10bmac_poll; +#endif + +#define NF10BMAC_LOCK(_sc) mtx_lock(&(_sc)->nf10bmac_mtx) +#define NF10BMAC_UNLOCK(_sc) mtx_unlock(&(_sc)->nf10bmac_mtx) +#define NF10BMAC_LOCK_ASSERT(_sc) \ + mtx_assert(&(_sc)->nf10bmac_mtx, MA_OWNED) + +#define NF10BMAC_TX_LEN 0x08 +#define NF10BMAC_TX_META 0x04 +#define NF10BMAC_TX_DATA 0x00 +#define NF10BMAC_RX_LEN 0x08 +#define NF10BMAC_RX_META 0x04 +#define NF10BMAC_RX_DATA 0x00 +#define NF10BMAC_CTRL0 0x00 + +#define NF10BMAC_TUSER_MAC0 (1 << 0) +#define NF10BMAC_TUSER_CPU0 (1 << 1) +#define NF10BMAC_TUSER_MAC1 (1 << 2) +#define NF10BMAC_TUSER_CPU1 (1 << 3) +#define NF10BMAC_TUSER_MAC2 (1 << 4) +#define NF10BMAC_TUSER_CPU2 (1 << 5) +#define NF10BMAC_TUSER_MAC3 (1 << 6) +#define NF10BMAC_TUSER_CPU3 (1 << 7) + +#define NF10BMAC_DATA_DPORT_MASK 0xff000000 +#define NF10BMAC_DATA_DPORT_SHIFT 24 +#define NF10BMAC_DATA_SPORT_MASK 0x00ff0000 +#define NF10BMAC_DATA_SPORT_SHIFT 16 +#define NF10BMAC_DATA_LAST 0x00000080 +#define NF10BMAC_DATA_STRB 0x0000000f + + +static inline void +nf10bmac_write_4(struct resource *res, uint32_t reg, uint32_t val4, + const char *f __unused, const int l __unused) +{ + + bus_write_4(res, reg, htole32(val4)); +} + +static inline uint32_t +nf10bmac_read_4(struct resource *res, uint32_t reg, + const char *f __unused, const int l __unused) +{ + + return (le32toh(bus_read_4(res, reg))); +} + +static inline void +nf10bmac_write_4_be(struct resource *res, uint32_t reg, uint32_t val4, + const char *f __unused, const int l __unused) +{ + + bus_write_4(res, reg, htobe32(val4)); +} + + +static inline uint32_t +nf10bmac_read_4_be(struct resource *res, uint32_t reg, + const char *f __unused, const int l __unused) +{ + + return (be32toh(bus_read_4(res, reg))); +} + +#define NF10BMAC_WRITE_CTRL_4(sc, reg, val) \ + nf10bmac_write_4((sc)->nf10bmac_mem_res, (reg), (val), \ + __func__, __LINE__) +#define NF10BMAC_WRITE_4(sc, reg, val) \ + nf10bmac_write_4((sc)->nf10bmac_tx_mem_res, (reg), (val), \ + __func__, __LINE__) +#define NF10BMAC_READ_4(sc, reg) \ + nf10bmac_read_4((sc)->nf10bmac_rx_mem_res, (reg), \ + __func__, __LINE__) +#define NF10BMAC_WRITE_4_BE(sc, reg, val) \ + nf10bmac_write_4_be((sc)->nf10bmac_tx_mem_res, (reg), (val), \ + __func__, __LINE__) +#define NF10BMAC_READ_4_BE(sc, reg) \ + nf10bmac_read_4_be((sc)->nf10bmac_rx_mem_res, (reg), \ + __func__, __LINE__) + +#ifdef ENABLE_WATCHDOG +static void nf10bmac_tick(void *); +#endif +static int nf10bmac_detach(device_t); + +devclass_t nf10bmac_devclass; + + +static int +nf10bmac_tx_locked(struct nf10bmac_softc *sc, struct mbuf *m) +{ + int32_t len, l, ml; + uint32_t m4, val4; + + NF10BMAC_LOCK_ASSERT(sc); + + KASSERT(m != NULL, ("%s: m is null: sc=%p", __func__, sc)); + KASSERT(m->m_flags & M_PKTHDR, ("%s: not a pkthdr: m=%p", __func__, m)); + /* + * Copy to buffer to minimize our pain as we can only store + * double words which, after the first mbuf gets out of alignment + * quite quickly. + */ + m_copydata(m, 0, m->m_pkthdr.len, sc->nf10bmac_tx_buf); + len = m->m_pkthdr.len; + + /* Write the length at start of packet. */ + NF10BMAC_WRITE_4(sc, NF10BMAC_TX_LEN, len); + + /* Write the meta data and data. */ + ml = len / sizeof(val4); + len -= (ml * sizeof(val4)); + for (l = 0; l <= ml; l++) { + int32_t cl; + + cl = sizeof(val4); + m4 = (NF10BMAC_TUSER_CPU0 << NF10BMAC_DATA_SPORT_SHIFT); + if (l == ml || (len == 0 && l == (ml - 1))) { + if (l == ml && len == 0) { + break; + } else { + uint8_t s; + int sl; + + if (l == (ml - 1)) + len = 4; + cl = len; + + for (s = 0, sl = len; sl > 0; sl--) + s |= (1 << (sl - 1)); + m4 |= (s & NF10BMAC_DATA_STRB); + m4 |= NF10BMAC_DATA_LAST; + } + } else { + m4 |= NF10BMAC_DATA_STRB; + } + NF10BMAC_WRITE_4(sc, NF10BMAC_TX_META, m4); + bcopy(&sc->nf10bmac_tx_buf[l*sizeof(val4)], &val4, cl); + NF10BMAC_WRITE_4_BE(sc, NF10BMAC_TX_DATA, val4); + } + + /* If anyone is interested give them a copy. */ + BPF_MTAP(sc->nf10bmac_ifp, m); + + m_freem(m); + + return (0); +} + +static void +nf10bmac_start_locked(struct ifnet *ifp) +{ + struct nf10bmac_softc *sc; + int count, error; + + sc = ifp->if_softc; + NF10BMAC_LOCK_ASSERT(sc); + + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING || (sc->nf10bmac_flags & NF10BMAC_FLAGS_LINK) == 0) + return; + +#ifdef ENABLE_WATCHDOG + /* + * Disable the watchdog while sending, we are batching packets. + * Though we should never reach 5 seconds, and are holding the lock, + * but who knows. + */ + sc->nf10bmac_watchdog_timer = 0; +#endif + + /* Send up to MAX_PKTS_PER_TX_LOOP packets. */ + for (count = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) && + count < NF10BMAC_MAX_PKTS; count++) { + struct mbuf *m; + + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) + break; + error = nf10bmac_tx_locked(sc, m); + if (error != 0) + break; + } + +#ifdef ENABLE_WATCHDOG +done: + /* If the IP core walks into Nekromanteion try to bail out. */ + /* XXX-BZ useless until we have direct FIFO fill status feedback. */ + if (count > 0) + sc->nf10bmac_watchdog_timer = NF10BMAC_WATCHDOG_TIME; +#endif +} + +static void +nf10bmac_start(struct ifnet *ifp) +{ + struct nf10bmac_softc *sc; + + sc = ifp->if_softc; + NF10BMAC_LOCK(sc); + nf10bmac_start_locked(ifp); + NF10BMAC_UNLOCK(sc); +} + +static void +nf10bmac_eat_packet_munch_munch(struct nf10bmac_softc *sc) +{ + uint32_t m4, val4; + + do { + m4 = NF10BMAC_READ_4_BE(sc, NF10BMAC_RX_META); + if ((m4 & NF10BMAC_DATA_STRB) != 0) + val4 = NF10BMAC_READ_4_BE(sc, NF10BMAC_RX_DATA); + } while ((m4 & NF10BMAC_DATA_STRB) != 0 && + (m4 & NF10BMAC_DATA_LAST) == 0); +} + +static int +nf10bmac_rx_locked(struct nf10bmac_softc *sc) +{ + struct ifnet *ifp; + struct mbuf *m; + uint32_t m4, val4; + int32_t len, l; + + /* + * General problem here in case we need to sync ourselves to the + * beginning of a packet. Length will only be set for the first + * read, and together with strb we can detect the begining (or + * skip to tlast). + */ + + len = NF10BMAC_READ_4(sc, NF10BMAC_RX_LEN); + if (len > (MCLBYTES - ETHER_ALIGN)) { + nf10bmac_eat_packet_munch_munch(sc); + return (0); + } + + m4 = NF10BMAC_READ_4(sc, NF10BMAC_RX_META); + if (len == 0 && (m4 & NF10BMAC_DATA_STRB) == 0) { + /* No packet data available. */ + return (0); + } else if (len == 0 && (m4 & NF10BMAC_DATA_STRB) != 0) { + /* We are in the middle of a packet. */ + nf10bmac_eat_packet_munch_munch(sc); + return (0); + } else if ((m4 & NF10BMAC_DATA_STRB) == 0) { + /* Invalid length "hint". */ + device_printf(sc->nf10bmac_dev, + "Unexpected length %d on zero strb\n", len); + return (0); + } + + /* Assume at this point that we have data and a full packet. */ + if ((len + ETHER_ALIGN) >= MINCLSIZE) { + /* Get a cluster. */ + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (0); + m->m_len = m->m_pkthdr.len = MCLBYTES; + } else { + /* Hey this still fits into the mbuf+pkthdr. */ + m = m_gethdr(M_NOWAIT, MT_DATA); + if (m == NULL) + return (0); + m->m_len = m->m_pkthdr.len = MHLEN; + } + /* Make sure upper layers will be aligned. */ + m_adj(m, ETHER_ALIGN); + + ifp = sc->nf10bmac_ifp; + l = 0; +/* + while ((m4 & NF10BMAC_DATA_STRB) != 0 && l < len) { +*/ + while (l < len) { + size_t cl; + + if ((m4 & NF10BMAC_DATA_LAST) == 0 && + (len - l) < sizeof(val4)) { + /* + * Our length and LAST disagree. We have a valid STRB. + * We could continue until we fill the mbuf and just + * log the invlid length "hint". For now drop the + * packet on the floor and count the error. + */ + nf10bmac_eat_packet_munch_munch(sc); + ifp->if_ierrors++; + m_freem(m); + return (0); + } else if ((len - l) <= sizeof(val4)) { + cl = len - l; + } else { + cl = sizeof(val4); + } + + /* Read the first bytes of data as well. */ + val4 = NF10BMAC_READ_4_BE(sc, NF10BMAC_RX_DATA); + bcopy(&val4, (uint8_t *)(m->m_data + l), cl); + l += cl; + + if ((m4 & NF10BMAC_DATA_LAST) != 0 || l >= len) + break; + else { + DELAY(50); + m4 = NF10BMAC_READ_4(sc, NF10BMAC_RX_META); + } + + cl = 10; + while ((m4 & NF10BMAC_DATA_STRB) == 0 && cl-- > 0) { + DELAY(10); + m4 = NF10BMAC_READ_4(sc, NF10BMAC_RX_META); + } + } + /* We should get out of this loop with tlast and tsrb. */ + if ((m4 & NF10BMAC_DATA_LAST) == 0 || (m4 & NF10BMAC_DATA_STRB) == 0) { + device_printf(sc->nf10bmac_dev, "Unexpected rx loop end state: " + "m4=0x%08x len=%d l=%d\n", m4, len, l); + ifp->if_ierrors++; + m_freem(m); + return (0); + } + + m->m_pkthdr.len = m->m_len = len; + m->m_pkthdr.rcvif = ifp; + ifp->if_ipackets++; + + NF10BMAC_UNLOCK(sc); + (*ifp->if_input)(ifp, m); + NF10BMAC_LOCK(sc); + + return (1); +} + + +static int +nf10bmac_stop_locked(struct nf10bmac_softc *sc) +{ + struct ifnet *ifp; + + NF10BMAC_LOCK_ASSERT(sc); + +#ifdef ENABLE_WATCHDOG + sc->nf10bmac_watchdog_timer = 0; + callout_stop(&sc->nf10bmac_tick); +#endif + + ifp = sc->nf10bmac_ifp; + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + + sc->nf10bmac_flags &= ~NF10BMAC_FLAGS_LINK; + if_link_state_change(ifp, LINK_STATE_DOWN); + + return (0); +} + +static int +nf10bmac_reset(struct nf10bmac_softc *sc) +{ + + /* Currently we cannot do anything. */ + return (0); +} + +static void +nf10bmac_init_locked(struct nf10bmac_softc *sc) +{ + struct ifnet *ifp; + uint8_t *eaddr; + + NF10BMAC_LOCK_ASSERT(sc); + ifp = sc->nf10bmac_ifp; + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + + /* + * Must update the ether address if changed. Given we do not handle + * in nf10bmac_ioctl() but it's in the general framework, just always + * do it here before nf10bmac_reset(). + */ + eaddr = IF_LLADDR(sc->nf10bmac_ifp); + bcopy(eaddr, &sc->nf10bmac_eth_addr, ETHER_ADDR_LEN); + /* XXX-BZ we do not have any way to tell the NIC our ether address. */ + + /* Make things frind to halt, cleanup, ... */ + nf10bmac_stop_locked(sc); + /* ... reset, ... */ + nf10bmac_reset(sc); + + /* Memory rings? DMA engine? MC filter? MII? */ + /* Instead drain the FIFO; or at least a possible first packet.. */ + nf10bmac_eat_packet_munch_munch(sc); + + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + + /* We have no underlying media, fake link state. */ + sc->nf10bmac_flags = NF10BMAC_FLAGS_LINK; /* Always up. */ + if_link_state_change(sc->nf10bmac_ifp, LINK_STATE_UP); + +#ifdef ENABLE_WATCHDOG + callout_reset(&sc->nf10bmac_tick, hz, nf10bmac_tick, sc); +#endif +} + +static void +nf10bmac_init(void *xsc) +{ + struct nf10bmac_softc *sc; + + sc = (struct nf10bmac_softc *)xsc; + NF10BMAC_LOCK(sc); + nf10bmac_init_locked(sc); + NF10BMAC_UNLOCK(sc); +} + +#ifdef ENABLE_WATCHDOG +static void +nf10bmac_watchdog(struct nf10bmac_softc *sc) +{ + + NF10BMAC_LOCK_ASSERT(sc); + + if (sc->nf10bmac_watchdog_timer == 0 || --sc->nf10bmac_watchdog_timer > 0) + return; + + device_printf(sc->nf10bmac_dev, "watchdog timeout\n"); + sc->nf10bmac_ifp->if_oerrors++; + + sc->nf10bmac_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + nf10bmac_init_locked(sc); + + if (!IFQ_DRV_IS_EMPTY(&sc->nf10bmac_ifp->if_snd)) + nf10bmac_start_locked(sc->nf10bmac_ifp); +} + +static void +nf10bmac_tick(void *xsc) +{ + struct nf10bmac_softc *sc; + struct ifnet *ifp; + + sc = (struct nf10bmac_softc *)xsc; + NF10BMAC_LOCK_ASSERT(sc); + ifp = sc->nf10bmac_ifp; + + nf10bmac_watchdog(sc); + callout_reset(&sc->nf10bmac_tick, hz, nf10bmac_tick, sc); +} +#endif + +#ifdef DEVICE_POLLING +static int +nf10bmac_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) +{ + struct nf10bmac_softc *sc; + int rx_npkts = 0; + + sc = ifp->if_softc; + NF10BMAC_LOCK(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + NF10BMAC_UNLOCK(sc); + return (rx_npkts); + } + + while (rx_npkts < count) { + int c; + + c = nf10bmac_rx_locked(sc); + rx_npkts += c; + if (c == 0) + break; + } + nf10bmac_start_locked(ifp); + + if (rx_npkts > 0 || cmd == POLL_AND_CHECK_STATUS) { + /* We currently cannot do much. */ + ; + } + + NF10BMAC_UNLOCK(sc); + return (rx_npkts); +} +#else +#error We only support polling mode +#endif /* DEVICE_POLLING */ + +static int +nf10bmac_media_change(struct ifnet *ifp __unused) +{ + + /* Do nothing. */ + return (0); +} + +static void +nf10bmac_media_status(struct ifnet *ifp __unused, struct ifmediareq *imr) +{ + + imr->ifm_status = IFM_AVALID | IFM_ACTIVE; + imr->ifm_active = IFM_ETHER | IFM_10G_T | IFM_FDX; +} + +static int +nf10bmac_ioctl(struct ifnet *ifp, u_long command, caddr_t data) +{ + struct nf10bmac_softc *sc; + struct ifreq *ifr; + int error, mask; + + error = 0; + sc = ifp->if_softc; + ifr = (struct ifreq *)data; + + switch (command) { + case SIOCSIFFLAGS: + NF10BMAC_LOCK(sc); + if (ifp->if_flags & IFF_UP) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + ((ifp->if_flags ^ sc->nf10bmac_if_flags) & + (IFF_PROMISC | IFF_ALLMULTI)) != 0) + /* Nothing we can do. */ ; + else + nf10bmac_init_locked(sc); + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) + nf10bmac_stop_locked(sc); + sc->nf10bmac_if_flags = ifp->if_flags; + NF10BMAC_UNLOCK(sc); + break; + case SIOCSIFCAP: + NF10BMAC_LOCK(sc); + mask = ifr->ifr_reqcap ^ ifp->if_capenable; +#ifdef DEVICE_POLLING + if ((mask & IFCAP_POLLING) != 0 && + (IFCAP_POLLING & ifp->if_capabilities) != 0) { + ifp->if_capenable ^= IFCAP_POLLING; + if ((IFCAP_POLLING & ifp->if_capenable) != 0) { + + error = ether_poll_register(nf10bmac_poll, ifp); + if (error != 0) { + NF10BMAC_UNLOCK(sc); + break; + } + + /* + * Do not allow disabling of polling if we do + * not have interrupts. + */ + } else { + ifp->if_capenable ^= IFCAP_POLLING; + error = EINVAL; + } + } +#endif /* DEVICE_POLLING */ + NF10BMAC_UNLOCK(sc); + break; + case SIOCGIFMEDIA: + case SIOCSIFMEDIA: + error = ifmedia_ioctl(ifp, ifr, &sc->nf10bmac_media, command); + break; + default: + error = ether_ioctl(ifp, command, data); + break; + } + + return (error); +} + + +/* + * Generic device handling routines. + */ +int +nf10bmac_attach(device_t dev) +{ + struct nf10bmac_softc *sc; + struct ifnet *ifp; + int error; + + sc = device_get_softc(dev); + + mtx_init(&sc->nf10bmac_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF); + +#ifdef ENABLE_WATCHDOG + callout_init_mtx(&sc->nf10bmac_tick, &sc->nf10bmac_mtx, 0); +#endif + + sc->nf10bmac_tx_buf = malloc(ETHER_MAX_LEN_JUMBO, M_DEVBUF, M_WAITOK); + + /* Reset the adapter. */ + nf10bmac_reset(sc); + + /* Setup interface. */ + ifp = sc->nf10bmac_ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + device_printf(dev, "if_alloc() failed\n"); + error = ENOSPC; + goto err; + } + ifp->if_softc = sc; + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX; /* | IFF_MULTICAST; */ + ifp->if_ioctl = nf10bmac_ioctl; + ifp->if_start = nf10bmac_start; + ifp->if_init = nf10bmac_init; + IFQ_SET_MAXLEN(&ifp->if_snd, NF10BMAC_MAX_PKTS - 1); + ifp->if_snd.ifq_drv_maxlen = NF10BMAC_MAX_PKTS - 1; + IFQ_SET_READY(&ifp->if_snd); + + /* Call media-indepedent attach routine. */ + ether_ifattach(ifp, sc->nf10bmac_eth_addr); + + /* Tell the upper layer(s) about vlan mtu support. */ + ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); + ifp->if_capabilities |= IFCAP_VLAN_MTU; + ifp->if_capenable = ifp->if_capabilities; +#ifdef DEVICE_POLLING + /* We will enable polling by default if no irqs available. See below. */ + ifp->if_capabilities |= IFCAP_POLLING; +#endif + + /* We need more media attention. Fake it! */ + ifmedia_init(&sc->nf10bmac_media, 0, nf10bmac_media_change, + nf10bmac_media_status); + ifmedia_add(&sc->nf10bmac_media, IFM_ETHER | IFM_10G_T, 0, NULL); + ifmedia_set(&sc->nf10bmac_media, IFM_ETHER | IFM_10G_T); + + /* Interrupts would go here. */ + +#ifdef DEVICE_POLLING + ifp->if_capenable |= IFCAP_POLLING; + device_printf(dev, "forcing to polling due to no interrupts\n"); + error = ether_poll_register(nf10bmac_poll, ifp); + if (error != 0) + goto err; +#else + device_printf(dev, "no DEVICE_POLLING in kernel and no IRQs\n"); + error = ENXIO; +#endif + +err: + if (error != 0) + nf10bmac_detach(dev); + + return (error); +} + +static int +nf10bmac_detach(device_t dev) +{ + struct nf10bmac_softc *sc; + struct ifnet *ifp; + + sc = device_get_softc(dev); + KASSERT(mtx_initialized(&sc->nf10bmac_mtx), + ("%s: mutex not initialized", device_get_nameunit(dev))); + ifp = sc->nf10bmac_ifp; + +#ifdef DEVICE_POLLING + if (ifp->if_capenable & IFCAP_POLLING) + ether_poll_deregister(ifp); +#endif + + /* Only cleanup if attach succeeded. */ + if (device_is_attached(dev)) { + NF10BMAC_LOCK(sc); + nf10bmac_stop_locked(sc); + NF10BMAC_UNLOCK(sc); +#ifdef ENABLE_WATCHDOG + callout_drain(&sc->nf10bmac_tick); +#endif + ether_ifdetach(ifp); + } + + if (ifp != NULL) + if_free(ifp); + ifmedia_removeall(&sc->nf10bmac_media); + + mtx_destroy(&sc->nf10bmac_mtx); + + return (0); +} + +/* Shared with the attachment specific (e.g., fdt) implementation. */ +void +nf10bmac_detach_resources(device_t dev) +{ + struct nf10bmac_softc *sc; + + sc = device_get_softc(dev); + + if (sc->nf10bmac_mem_res != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, + sc->nf10bmac_mem_rid, sc->nf10bmac_mem_res); + sc->nf10bmac_mem_res = NULL; + } + if (sc->nf10bmac_rx_mem_res != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, + sc->nf10bmac_rx_mem_rid, sc->nf10bmac_rx_mem_res); + sc->nf10bmac_rx_mem_res = NULL; + } + if (sc->nf10bmac_tx_mem_res != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, + sc->nf10bmac_tx_mem_rid, sc->nf10bmac_tx_mem_res); + sc->nf10bmac_tx_mem_res = NULL; + } +} + +int +nf10bmac_detach_dev(device_t dev) +{ + int error; + + error = nf10bmac_detach(dev); + if (error) { + /* We are basically in undefined state now. */ + device_printf(dev, "nf10bmac_detach() failed: %d\n", error); + return (error); + } + + nf10bmac_detach_resources(dev); + + return (0); +} + +/* end */ Added: head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c Thu Apr 17 12:33:26 2014 (r264601) @@ -0,0 +1,179 @@ +/*- + * Copyright (c) 2013-2014 Bjoern A. Zeeb + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-11-C-0249 + * ("MRC2"), as part of the DARPA MRC research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * This driver is modelled after atse(4). We need to seriously reduce the + * per-driver code we have to write^wcopy & paste. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "if_nf10bmacreg.h" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Apr 17 12:53:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB8F3D5E; Thu, 17 Apr 2014 12:53:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8609187D; Thu, 17 Apr 2014 12:53:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3HCrusj040496; Thu, 17 Apr 2014 12:53:56 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HCruo3040495; Thu, 17 Apr 2014 12:53:56 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404171253.s3HCruo3040495@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 17 Apr 2014 12:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264604 - head/usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 12:53:56 -0000 Author: trasz Date: Thu Apr 17 12:53:56 2014 New Revision: 264604 URL: http://svnweb.freebsd.org/changeset/base/264604 Log: Remove redundant code. Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/iscsid/login.c Modified: head/usr.sbin/iscsid/login.c ============================================================================== --- head/usr.sbin/iscsid/login.c Thu Apr 17 12:42:41 2014 (r264603) +++ head/usr.sbin/iscsid/login.c Thu Apr 17 12:53:56 2014 (r264604) @@ -783,7 +783,6 @@ login(struct connection *conn) request = login_new_request(conn); bhslr = (struct iscsi_bhs_login_request *)request->pdu_bhs; - bhslr->bhslr_flags |= BHSLR_FLAGS_TRANSIT; request_keys = keys_new(); if (conn->conn_conf.isc_mutual_user[0] != '\0') { From owner-svn-src-head@FreeBSD.ORG Thu Apr 17 13:03:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8663D1B1; Thu, 17 Apr 2014 13:03:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 594B81966; Thu, 17 Apr 2014 13:03:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3HD30Ok044717; Thu, 17 Apr 2014 13:03:00 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HD30Ls044716; Thu, 17 Apr 2014 13:03:00 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201404171303.s3HD30Ls044716@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 17 Apr 2014 13:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264605 - head/sys/mips/beri X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 13:03:00 -0000 Author: bz Date: Thu Apr 17 13:02:59 2014 New Revision: 264605 URL: http://svnweb.freebsd.org/changeset/base/264605 Log: Based on xlp_machdep.c and completed the list of options based on boot/mips/beri/loader/metadata.c allow FDT configuration to set command line options. This leads to an interesting quesiton of future interactions with loader. However for configurations without loader this allows bootverbose or boot single user to be set by compiling a new kernel, which is good enough for testing and debugging. Reviewed by: rwatson MFC after: 1 week Modified: head/sys/mips/beri/beri_machdep.c Modified: head/sys/mips/beri/beri_machdep.c ============================================================================== --- head/sys/mips/beri/beri_machdep.c Thu Apr 17 12:53:56 2014 (r264604) +++ head/sys/mips/beri/beri_machdep.c Thu Apr 17 13:02:59 2014 (r264605) @@ -131,6 +131,46 @@ platform_reset(void) __asm__ __volatile("wait"); } +#ifdef FDT +/* Parse cmd line args as env - copied from xlp_machdep. */ +/* XXX-BZ this should really be centrally provided for all (boot) code. */ +static void +_parse_bootargs(char *cmdline) +{ + char *n, *v; + + while ((v = strsep(&cmdline, " \n")) != NULL) { + if (*v == '\0') + continue; + if (*v == '-') { + while (*v != '\0') { + v++; + switch (*v) { + case 'a': boothowto |= RB_ASKNAME; break; + /* Someone should simulate that ;-) */ + case 'C': boothowto |= RB_CDROM; break; + case 'd': boothowto |= RB_KDB; break; + case 'D': boothowto |= RB_MULTIPLE; break; + case 'm': boothowto |= RB_MUTE; break; + case 'g': boothowto |= RB_GDB; break; + case 'h': boothowto |= RB_SERIAL; break; + case 'p': boothowto |= RB_PAUSE; break; + case 'r': boothowto |= RB_DFLTROOT; break; + case 's': boothowto |= RB_SINGLE; break; + case 'v': boothowto |= RB_VERBOSE; break; + } + } + } else { + n = strsep(&v, "="); + if (v == NULL) + setenv(n, "1"); + else + setenv(n, v); + } + } +} +#endif + void platform_start(__register_t a0, __register_t a1, __register_t a2, __register_t a3) @@ -142,7 +182,9 @@ platform_start(__register_t a0, __regist char **envp = (char **)a2; unsigned int memsize = a3; #ifdef FDT + char buf[2048]; /* early stack supposedly big enough */ vm_offset_t dtbp; + phandle_t chosen; void *kmdp; #endif int i; @@ -180,6 +222,13 @@ platform_start(__register_t a0, __regist while (1); if (OF_init((void *)dtbp) != 0) while (1); + + /* + * Get bootargs from FDT if specified. + */ + chosen = OF_finddevice("/chosen"); + if (OF_getprop(chosen, "bootargs", buf, sizeof(buf)) != -1) + _parse_bootargs(buf); #endif /* From owner-svn-src-head@FreeBSD.ORG Thu Apr 17 13:57:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91E58510; Thu, 17 Apr 2014 13:57:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EE29107D; Thu, 17 Apr 2014 13:57:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3HDvbhS066552; Thu, 17 Apr 2014 13:57:37 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HDvber066551; Thu, 17 Apr 2014 13:57:37 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201404171357.s3HDvber066551@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 17 Apr 2014 13:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264608 - head/usr.bin/bc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 13:57:37 -0000 Author: bz Date: Thu Apr 17 13:57:37 2014 New Revision: 264608 URL: http://svnweb.freebsd.org/changeset/base/264608 Log: Remove duplicate extern declarations after r264573. Makes things compile better. Someone submit to: OpenBSD MFC after: 13 days X-MFC with: r264573 Modified: head/usr.bin/bc/extern.h Modified: head/usr.bin/bc/extern.h ============================================================================== --- head/usr.bin/bc/extern.h Thu Apr 17 13:11:56 2014 (r264607) +++ head/usr.bin/bc/extern.h Thu Apr 17 13:57:37 2014 (r264608) @@ -35,8 +35,6 @@ void tstpcont(int); unsigned char bc_eof(EditLine *, int); extern int lineno; -extern char *yytext; -extern FILE *yyin; extern int fileindex; extern int sargc; extern const char **sargv; @@ -47,4 +45,3 @@ extern History *hist; extern HistEvent he; extern char *cmdexpr; extern struct termios ttysaved; -extern bool interactive; From owner-svn-src-head@FreeBSD.ORG Thu Apr 17 14:15:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 522FEED6; Thu, 17 Apr 2014 14:15:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F1131392; Thu, 17 Apr 2014 14:15:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3HEFsT9074849; Thu, 17 Apr 2014 14:15:54 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HEFs7e074848; Thu, 17 Apr 2014 14:15:54 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201404171415.s3HEFs7e074848@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 17 Apr 2014 14:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264609 - head/usr.bin/bc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 14:15:54 -0000 Author: bz Date: Thu Apr 17 14:15:53 2014 New Revision: 264609 URL: http://svnweb.freebsd.org/changeset/base/264609 Log: Stop casting the const char * to void * to char * to make compile more happy after r264573. Someone submit to: OpenBSD MFC after: 13 days X-MFC with: r264573 Modified: head/usr.bin/bc/scan.l Modified: head/usr.bin/bc/scan.l ============================================================================== --- head/usr.bin/bc/scan.l Thu Apr 17 13:57:37 2014 (r264608) +++ head/usr.bin/bc/scan.l Thu Apr 17 14:15:53 2014 (r264609) @@ -348,7 +348,7 @@ bc_yyinput(char *buf, int maxlen) skipchars = 0; sigprocmask(SIG_SETMASK, &oset, NULL); if (num > maxlen) { - el_push(el, (char *)(void *)bp + maxlen); + el_push(el, bp + maxlen); num = maxlen; } memcpy(buf, bp, num); From owner-svn-src-head@FreeBSD.ORG Thu Apr 17 14:16:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93BDEA5; Thu, 17 Apr 2014 14:16:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80C1D139A; Thu, 17 Apr 2014 14:16:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3HEG2X4074921; Thu, 17 Apr 2014 14:16:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HEG2Tf074919; Thu, 17 Apr 2014 14:16:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404171416.s3HEG2Tf074919@svn.freebsd.org> From: Alexander Motin Date: Thu, 17 Apr 2014 14:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264610 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 14:16:02 -0000 Author: mav Date: Thu Apr 17 14:16:02 2014 New Revision: 264610 URL: http://svnweb.freebsd.org/changeset/base/264610 Log: Correct AMD chipsets identification. Submitted by: Dmitry Luhtionov MFC after: 2 weeks Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Thu Apr 17 14:15:53 2014 (r264609) +++ head/sys/dev/ahci/ahci.c Thu Apr 17 14:16:02 2014 (r264610) @@ -134,13 +134,13 @@ static struct { "\014ALTSIG" \ "\015NOMSI" } ahci_ids[] = { - {0x43801002, 0x00, "ATI IXP600", AHCI_Q_NOMSI}, - {0x43901002, 0x00, "ATI IXP700", 0}, - {0x43911002, 0x00, "ATI IXP700", 0}, - {0x43921002, 0x00, "ATI IXP700", 0}, - {0x43931002, 0x00, "ATI IXP700", 0}, - {0x43941002, 0x00, "ATI IXP800", 0}, - {0x43951002, 0x00, "ATI IXP800", 0}, + {0x43801002, 0x00, "AMD SB600", AHCI_Q_NOMSI}, + {0x43901002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, + {0x43911002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, + {0x43921002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, + {0x43931002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, + {0x43941002, 0x00, "AMD SB7x0/SB8x0/SB9x0", 0}, + {0x43951002, 0x00, "AMD SB8x0/SB9x0", 0}, {0x78001022, 0x00, "AMD Hudson-2", 0}, {0x78011022, 0x00, "AMD Hudson-2", 0}, {0x78021022, 0x00, "AMD Hudson-2", 0}, From owner-svn-src-head@FreeBSD.ORG Thu Apr 17 16:00:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B74D30A; Thu, 17 Apr 2014 16:00:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28DA110E8; Thu, 17 Apr 2014 16:00:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3HG0Ri9019251; Thu, 17 Apr 2014 16:00:27 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HG0Rvf019250; Thu, 17 Apr 2014 16:00:27 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201404171600.s3HG0Rvf019250@svn.freebsd.org> From: Guy Helmer Date: Thu, 17 Apr 2014 16:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264617 - head/libexec/atrun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 16:00:27 -0000 Author: ghelmer Date: Thu Apr 17 16:00:26 2014 New Revision: 264617 URL: http://svnweb.freebsd.org/changeset/base/264617 Log: Fix releasing the lock in the parent atrun process after the queue directory has been processed. Otherwise, a long-running child process caused other atrun invocations to stall unnecessarily. Modified: head/libexec/atrun/atrun.c Modified: head/libexec/atrun/atrun.c ============================================================================== --- head/libexec/atrun/atrun.c Thu Apr 17 15:44:21 2014 (r264616) +++ head/libexec/atrun/atrun.c Thu Apr 17 16:00:26 2014 (r264617) @@ -567,6 +567,12 @@ main(int argc, char *argv[]) if (run_batch && (gloadavg() < load_avg)) run_file(batch_name, batch_uid, batch_gid); + if (flock(dirfd(spool), LOCK_UN) == -1) + perr("cannot unlock %s", ATJOB_DIR); + + if (closedir(spool) == -1) + perr("cannot closedir %s", ATJOB_DIR); + closelog(); exit(EXIT_SUCCESS); } From owner-svn-src-head@FreeBSD.ORG Thu Apr 17 16:54:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C438EE2; Thu, 17 Apr 2014 16:54:50 +0000 (UTC) Received: from mail-oa0-x234.google.com (mail-oa0-x234.google.com [IPv6:2607:f8b0:4003:c02::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 15FE816E0; Thu, 17 Apr 2014 16:54:50 +0000 (UTC) Received: by mail-oa0-f52.google.com with SMTP id l6so718740oag.39 for ; Thu, 17 Apr 2014 09:54:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:message-id:mime-version:subject:date:references :to:in-reply-to; bh=Pot1DA34+bSGphOetaovzY51EYhtmEqB0M7nOu3s/3c=; b=VA6RPItY20af7YRsC+4mcefi/t6ad6WQUaG9REhVmTGq3v2H1SnJTMY9ov5faR+Ysy OK4lkKjMvq456AaEK6ok42Slku0EHoqGloqfD9RW6DSKuE5RIdQQVyMwtVCXBT4P+hB6 TV87yCkVTMkRVJ6uH8A1cFoyLcPhaVUqBpCMfpuE2HBM7/H2suby99/htQaA9z2pJize HlA8fY2ZxGdby4jJlMfLRTuoQCDOkksWSDp4336u8HvVwVrk2/hsFKv0Fq7cUy/UpFN+ n5FFXTjmwzk8Ik8rpJnY5ol3hXcehthspcWzTxVPxT8cklafwo5E5FQCHIJr1Ml7OHDV AQjA== X-Received: by 10.182.24.69 with SMTP id s5mr8236017obf.35.1397753689355; Thu, 17 Apr 2014 09:54:49 -0700 (PDT) Received: from [172.22.132.60] ([192.119.231.58]) by mx.google.com with ESMTPSA id np9sm46656399obc.12.2014.04.17.09.54.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Apr 2014 09:54:48 -0700 (PDT) From: Guy Helmer Content-Type: multipart/signed; boundary="Apple-Mail=_C3830BCC-5507-4B1A-8426-561FC9D0897F"; protocol="application/pgp-signature"; micalg=pgp-sha512 Message-Id: Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264617 - head/libexec/atrun Date: Thu, 17 Apr 2014 11:54:45 -0500 References: <201404171600.s3HG0Rvf019250@svn.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201404171600.s3HG0Rvf019250@svn.freebsd.org> X-Mailer: Apple Mail (2.1874) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 16:54:50 -0000 --Apple-Mail=_C3830BCC-5507-4B1A-8426-561FC9D0897F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Apr 17, 2014, at 11:00 AM, Guy Helmer wrote: > Author: ghelmer > Date: Thu Apr 17 16:00:26 2014 > New Revision: 264617 > URL: http://svnweb.freebsd.org/changeset/base/264617 >=20 > Log: > Fix releasing the lock in the parent atrun process after the queue > directory has been processed. Otherwise, a long-running child process > caused other atrun invocations to stall unnecessarily. >=20 I neglected to note that this was submitted by J.R. Oldroyd jr at = opal.com > Modified: > head/libexec/atrun/atrun.c >=20 > Modified: head/libexec/atrun/atrun.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/libexec/atrun/atrun.c Thu Apr 17 15:44:21 2014 = (r264616) > +++ head/libexec/atrun/atrun.c Thu Apr 17 16:00:26 2014 = (r264617) > @@ -567,6 +567,12 @@ main(int argc, char *argv[]) > if (run_batch && (gloadavg() < load_avg)) > run_file(batch_name, batch_uid, batch_gid); >=20 > + if (flock(dirfd(spool), LOCK_UN) =3D=3D -1) > + perr("cannot unlock %s", ATJOB_DIR); > + > + if (closedir(spool) =3D=3D -1) > + perr("cannot closedir %s", ATJOB_DIR); > + > closelog(); > exit(EXIT_SUCCESS); > } >=20 --Apple-Mail=_C3830BCC-5507-4B1A-8426-561FC9D0897F Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJTUAdVAAoJEJmJzK+PHOvEZVEH/3cVBr03KnwzSOHH3S/5M77R PAlMx2eDxaBJqzcN0cAxrPtOmFnWTIUL3H29sNDCkGSVwM/B0ITrOxQfmxCqCbI7 MuCNIjDz04HnmauBcZierjs/N8KG7pn7x/pjQ0DKFMi6bpvWVY16mE1/ZQqS7SjK 43zxUlZJhG9RCQYZZWBurpgWQgltcMulZBDgH3891tQ7Z2i2hkj5kj/GRDbTdkIw 64YJ1cGl0PKi+rzLiCavzxlG7YWS1EKsECR3yE3AUDmLYMjKzOA3GTva3+McU0R+ JyRIEVegVKwASAdOliq/JjlX3GJV9EJR6aEOvSFtZiQSUCEL+J8K0ExmQGwb2i4= =yQc0 -----END PGP SIGNATURE----- --Apple-Mail=_C3830BCC-5507-4B1A-8426-561FC9D0897F-- From owner-svn-src-head@FreeBSD.ORG Thu Apr 17 18:13:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34E3E7F3; Thu, 17 Apr 2014 18:13:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2266510D9; Thu, 17 Apr 2014 18:13:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3HIDN2X076528; Thu, 17 Apr 2014 18:13:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HIDN4j076527; Thu, 17 Apr 2014 18:13:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201404171813.s3HIDN4j076527@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 17 Apr 2014 18:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264620 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 18:13:24 -0000 Author: kib Date: Thu Apr 17 18:13:23 2014 New Revision: 264620 URL: http://svnweb.freebsd.org/changeset/base/264620 Log: Fix typo. MFC after: 3 days Modified: head/sys/kern/subr_fattime.c Modified: head/sys/kern/subr_fattime.c ============================================================================== --- head/sys/kern/subr_fattime.c Thu Apr 17 18:00:07 2014 (r264619) +++ head/sys/kern/subr_fattime.c Thu Apr 17 18:13:23 2014 (r264620) @@ -49,7 +49,7 @@ * "New Technology". Anyway... * * The 'utc' argument determines if the resulting FATTIME timestamp - * should b on the UTC or local timezone calendar. + * should be on the UTC or local timezone calendar. * * The conversion functions below cut time into four-year leap-second * cycles rather than single years and uses table lookups inside those From owner-svn-src-head@FreeBSD.ORG Thu Apr 17 19:29:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6E794A5; Thu, 17 Apr 2014 19:29:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A37BB18EA; Thu, 17 Apr 2014 19:29:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3HJTFOv006975; Thu, 17 Apr 2014 19:29:15 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HJTFH3006974; Thu, 17 Apr 2014 19:29:15 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201404171929.s3HJTFH3006974@svn.freebsd.org> From: Maksim Yevmenkin Date: Thu, 17 Apr 2014 19:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264621 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 19:29:15 -0000 Author: emax Date: Thu Apr 17 19:29:15 2014 New Revision: 264621 URL: http://svnweb.freebsd.org/changeset/base/264621 Log: use correct (integer) type for the temperature sysctl Reviewed by: np, scottl Obtained from: Netflix MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Apr 17 18:13:23 2014 (r264620) +++ head/sys/dev/cxgbe/t4_main.c Thu Apr 17 19:29:15 2014 (r264621) @@ -4332,7 +4332,7 @@ t4_sysctls(struct adapter *sc) NULL, sc->tids.nftids, "number of filters"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "temperature", CTLTYPE_INT | - CTLFLAG_RD, sc, 0, sysctl_temperature, "A", + CTLFLAG_RD, sc, 0, sysctl_temperature, "I", "chip temperature (in Celsius)"); t4_sge_sysctls(sc, ctx, children); From owner-svn-src-head@FreeBSD.ORG Thu Apr 17 20:42:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00471B5A; Thu, 17 Apr 2014 20:42:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1DB21167; Thu, 17 Apr 2014 20:42:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3HKg3Yn040032; Thu, 17 Apr 2014 20:42:03 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HKg3XC040031; Thu, 17 Apr 2014 20:42:03 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201404172042.s3HKg3XC040031@svn.freebsd.org> From: Robert Watson Date: Thu, 17 Apr 2014 20:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264625 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 20:42:04 -0000 Author: rwatson Date: Thu Apr 17 20:42:03 2014 New Revision: 264625 URL: http://svnweb.freebsd.org/changeset/base/264625 Log: Fix typo and case inconsistency in MIPS CP0 register names. MFC after: 3 days Modified: head/sys/mips/mips/pm_machdep.c Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Thu Apr 17 20:09:41 2014 (r264624) +++ head/sys/mips/mips/pm_machdep.c Thu Apr 17 20:42:03 2014 (r264625) @@ -413,7 +413,7 @@ set_mcontext(struct thread *td, const mc td->td_frame->mullo = mcp->mullo; td->td_frame->mulhi = mcp->mulhi; td->td_md.md_tls = mcp->mc_tls; - /* Dont let user to set any bits in Status and casue registers */ + /* Dont let user to set any bits in status and cause registers. */ return (0); } From owner-svn-src-head@FreeBSD.ORG Thu Apr 17 21:29:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AC4892D; Thu, 17 Apr 2014 21:29:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E78D1575; Thu, 17 Apr 2014 21:29:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3HLTNi3057830; Thu, 17 Apr 2014 21:29:23 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HLTNQY057829; Thu, 17 Apr 2014 21:29:23 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404172129.s3HLTNQY057829@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 17 Apr 2014 21:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264628 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 21:29:23 -0000 Author: jilles Date: Thu Apr 17 21:29:22 2014 New Revision: 264628 URL: http://svnweb.freebsd.org/changeset/base/264628 Log: fcntl.h: Make visible various POSIX.1-2008 features. Also, remove #if __BSD_VISIBLE where it is redundant. When __BSD_VISIBLE is defined to 1, __POSIX_VISIBLE, __XSI_VISIBLE and __ISO_C_VISIBLE are also defined to the newest supported version. PR: 188173 Reviewed by: pluknet Modified: head/sys/sys/fcntl.h Modified: head/sys/sys/fcntl.h ============================================================================== --- head/sys/sys/fcntl.h Thu Apr 17 20:48:32 2014 (r264627) +++ head/sys/sys/fcntl.h Thu Apr 17 21:29:22 2014 (r264628) @@ -96,7 +96,7 @@ typedef __pid_t pid_t; #define O_FSYNC 0x0080 /* synchronous writes */ #endif #define O_SYNC 0x0080 /* POSIX synonym for O_FSYNC */ -#if __BSD_VISIBLE +#if __POSIX_VISIBLE >= 200809 #define O_NOFOLLOW 0x0100 /* don't follow symlinks */ #endif #define O_CREAT 0x0200 /* create if nonexistent */ @@ -114,8 +114,7 @@ typedef __pid_t pid_t; #define O_DIRECT 0x00010000 #endif -/* Defined by POSIX Extended API Set Part 2 */ -#if __BSD_VISIBLE +#if __POSIX_VISIBLE >= 200809 #define O_DIRECTORY 0x00020000 /* Fail if not directory */ #define O_EXEC 0x00040000 /* Open for execute only */ #endif @@ -183,8 +182,7 @@ typedef __pid_t pid_t; #define FRDAHEAD O_CREAT #endif -/* Defined by POSIX Extended API Set Part 2 */ -#if __BSD_VISIBLE +#if __POSIX_VISIBLE >= 200809 /* * Magic value that specify the use of the current working directory * to determine the target of relative file paths in the openat() and @@ -211,7 +209,7 @@ typedef __pid_t pid_t; #define F_SETFD 2 /* set file descriptor flags */ #define F_GETFL 3 /* get file status flags */ #define F_SETFL 4 /* set file status flags */ -#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 +#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 #define F_GETOWN 5 /* get SIGIO/SIGURG proc/pgrp */ #define F_SETOWN 6 /* set SIGIO/SIGURG proc/pgrp */ #endif @@ -229,7 +227,7 @@ typedef __pid_t pid_t; #define F_READAHEAD 15 /* read ahead */ #define F_RDAHEAD 16 /* Darwin compatible read ahead */ #endif -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 +#if __POSIX_VISIBLE >= 200809 #define F_DUPFD_CLOEXEC 17 /* Like F_DUPFD, but FD_CLOEXEC is set */ #endif #if __BSD_VISIBLE @@ -310,10 +308,10 @@ int fcntl(int, int, ...); #if __BSD_VISIBLE int flock(int, int); #endif -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 +#if __POSIX_VISIBLE >= 200809 int openat(int, const char *, int, ...); #endif -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 +#if __POSIX_VISIBLE >= 200112 int posix_fadvise(int, off_t, off_t, int); int posix_fallocate(int, off_t, off_t); #endif From owner-svn-src-head@FreeBSD.ORG Thu Apr 17 23:31:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6E011000; Thu, 17 Apr 2014 23:31:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA0CD1166; Thu, 17 Apr 2014 23:31:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3HNVoU0011598; Thu, 17 Apr 2014 23:31:50 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3HNVovb011597; Thu, 17 Apr 2014 23:31:50 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201404172331.s3HNVovb011597@svn.freebsd.org> From: Rick Macklem Date: Thu, 17 Apr 2014 23:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264630 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 23:31:51 -0000 Author: rmacklem Date: Thu Apr 17 23:31:50 2014 New Revision: 264630 URL: http://svnweb.freebsd.org/changeset/base/264630 Log: For NFS mounts using rsize,wsize=65536 over TSO enabled network interfaces limited to 32 transmit segments, there are two known issues. The more serious one is that for an I/O of slightly less than 64K, the net device driver prepends an ethernet header, resulting in a TSO segment slightly larger than 64K. Since m_defrag() copies this into 33 mbuf clusters, the transmit fails with EFBIG. A tester indicated observing a similar failure using iSCSI. The second less critical problem is that the network device driver must copy the mbuf chain via m_defrag() (m_collapse() is not sufficient), resulting in measurable overhead. This patch reduces the default size of if_hw_tsomax slightly, so that the first issue is avoided. Fixing the second issue will require a way for the network device driver to inform tcp_output() that it is limited to 32 transmit segments. Reported and tested by: csforgeron@gmail.com, markus.gebert@hostpoint.ch MFC after: 2 weeks Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Apr 17 21:43:34 2014 (r264629) +++ head/sys/net/if.c Thu Apr 17 23:31:50 2014 (r264630) @@ -74,6 +74,7 @@ #include #if defined(INET) || defined(INET6) +#include #include #include #include @@ -655,7 +656,8 @@ if_attach_internal(struct ifnet *ifp, in #if defined(INET) || defined(INET6) /* Initialize to max value. */ if (ifp->if_hw_tsomax == 0) - ifp->if_hw_tsomax = IP_MAXPACKET; + ifp->if_hw_tsomax = min(IP_MAXPACKET, 32 * MCLBYTES - + (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN)); KASSERT(ifp->if_hw_tsomax <= IP_MAXPACKET && ifp->if_hw_tsomax >= IP_MAXPACKET / 8, ("%s: tsomax outside of range", __func__)); From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 00:02:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF8E3430; Fri, 18 Apr 2014 00:02:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB9731392; Fri, 18 Apr 2014 00:02:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3I027cc024628; Fri, 18 Apr 2014 00:02:07 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3I027GQ024622; Fri, 18 Apr 2014 00:02:07 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201404180002.s3I027GQ024622@svn.freebsd.org> From: Tycho Nightingale Date: Fri, 18 Apr 2014 00:02:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264631 - in head: sys/amd64/vmm sys/amd64/vmm/io usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 00:02:08 -0000 Author: tychon Date: Fri Apr 18 00:02:06 2014 New Revision: 264631 URL: http://svnweb.freebsd.org/changeset/base/264631 Log: Add support for reading the PIT Counter 2 output signal via the NMI Status and Control register at port 0x61. Be more conservative about "catching up" callouts that were supposed to fire in the past by skipping an interrupt if it was scheduled too far in the past. Restore the PIT ACPI DSDT entries and add an entry for NMISC too. Approved by: neel (co-mentor) Modified: head/sys/amd64/vmm/io/vatpit.c head/sys/amd64/vmm/io/vatpit.h head/sys/amd64/vmm/vmm_ioport.c head/usr.sbin/bhyve/pci_lpc.c Modified: head/sys/amd64/vmm/io/vatpit.c ============================================================================== --- head/sys/amd64/vmm/io/vatpit.c Thu Apr 17 23:31:50 2014 (r264630) +++ head/sys/amd64/vmm/io/vatpit.c Fri Apr 18 00:02:06 2014 (r264631) @@ -56,6 +56,8 @@ static MALLOC_DEFINE(M_VATPIT, "atpit", #define TIMER_MODE_MASK 0x0f #define TIMER_SEL_READBACK 0xc0 +#define TMR2_OUT_STS 0x20 + #define PIT_8254_FREQ 1193182 #define TIMER_DIV(freq, hz) (((freq) + (hz) / 2) / (hz)) @@ -88,22 +90,29 @@ struct vatpit { struct channel channel[3]; }; -#define VATPIT_CTR0(vatpit, fmt) \ - VM_CTR0((vatpit)->vm, fmt) - -#define VATPIT_CTR1(vatpit, fmt, a1) \ - VM_CTR1((vatpit)->vm, fmt, a1) +static void pit_timer_start_cntr0(struct vatpit *vatpit); -#define VATPIT_CTR2(vatpit, fmt, a1, a2) \ - VM_CTR2((vatpit)->vm, fmt, a1, a2) +static int +vatpit_get_out(struct vatpit *vatpit, int channel) +{ + struct channel *c; + sbintime_t delta_ticks; + int out; -#define VATPIT_CTR3(vatpit, fmt, a1, a2, a3) \ - VM_CTR3((vatpit)->vm, fmt, a1, a2, a3) + c = &vatpit->channel[channel]; -#define VATPIT_CTR4(vatpit, fmt, a1, a2, a3, a4) \ - VM_CTR4((vatpit)->vm, fmt, a1, a2, a3, a4) + switch (c->mode) { + case TIMER_INTTC: + delta_ticks = (sbinuptime() - c->now_sbt) / vatpit->freq_sbt; + out = ((c->initial - delta_ticks) <= 0); + break; + default: + out = 0; + break; + } -static void pit_timer_start_cntr0(struct vatpit *vatpit); + return (out); +} static void vatpit_callout_handler(void *a) @@ -117,7 +126,7 @@ vatpit_callout_handler(void *a) c = &vatpit->channel[arg->channel_num]; callout = &c->callout; - VATPIT_CTR1(vatpit, "atpit t%d fired", arg->channel_num); + VM_CTR1(vatpit->vm, "atpit t%d fired", arg->channel_num); VATPIT_LOCK(vatpit); @@ -145,7 +154,7 @@ static void pit_timer_start_cntr0(struct vatpit *vatpit) { struct channel *c; - sbintime_t delta, precision; + sbintime_t now, delta, precision; c = &vatpit->channel[0]; if (c->initial != 0) { @@ -153,6 +162,15 @@ pit_timer_start_cntr0(struct vatpit *vat precision = delta >> tc_precexp; c->callout_sbt = c->callout_sbt + delta; + /* + * Reset 'callout_sbt' if the time that the callout + * was supposed to fire is more than 'c->initial' + * ticks in the past. + */ + now = sbinuptime(); + if (c->callout_sbt < now) + c->callout_sbt = now + delta; + callout_reset_sbt(&c->callout, c->callout_sbt, precision, vatpit_callout_handler, &c->callout_arg, C_ABSOLUTE); @@ -252,8 +270,8 @@ vatpit_handler(void *vm, int vcpuid, str port = vmexit->u.inout.port; if (port == TIMER_MODE) { - if (vmexit->u.inout.in != 0) { - VATPIT_CTR0(vatpit, "vatpit attempt to read mode"); + if (vmexit->u.inout.in) { + VM_CTR0(vatpit->vm, "vatpit attempt to read mode"); return (-1); } @@ -310,6 +328,26 @@ vatpit_handler(void *vm, int vcpuid, str return (0); } +int +vatpit_nmisc_handler(void *vm, int vcpuid, struct vm_exit *vmexit) +{ + struct vatpit *vatpit; + + vatpit = vm_atpit(vm); + + if (vmexit->u.inout.in) { + VATPIT_LOCK(vatpit); + if (vatpit_get_out(vatpit, 2)) + vmexit->u.inout.eax = TMR2_OUT_STS; + else + vmexit->u.inout.eax = 0; + + VATPIT_UNLOCK(vatpit); + } + + return (0); +} + struct vatpit * vatpit_init(struct vm *vm) { Modified: head/sys/amd64/vmm/io/vatpit.h ============================================================================== --- head/sys/amd64/vmm/io/vatpit.h Thu Apr 17 23:31:50 2014 (r264630) +++ head/sys/amd64/vmm/io/vatpit.h Fri Apr 18 00:02:06 2014 (r264631) @@ -32,9 +32,12 @@ #include +#define NMISC_PORT 0x61 + struct vatpit *vatpit_init(struct vm *vm); void vatpit_cleanup(struct vatpit *vatpit); int vatpit_handler(void *vm, int vcpuid, struct vm_exit *vmexit); +int vatpit_nmisc_handler(void *vm, int vcpuid, struct vm_exit *vmexit); #endif /* _VATPIT_H_ */ Modified: head/sys/amd64/vmm/vmm_ioport.c ============================================================================== --- head/sys/amd64/vmm/vmm_ioport.c Thu Apr 17 23:31:50 2014 (r264630) +++ head/sys/amd64/vmm/vmm_ioport.c Fri Apr 18 00:02:06 2014 (r264631) @@ -46,6 +46,7 @@ ioport_handler_func_t ioport_handler[MAX [TIMER_CNTR0] = vatpit_handler, [TIMER_CNTR1] = vatpit_handler, [TIMER_CNTR2] = vatpit_handler, + [NMISC_PORT] = vatpit_nmisc_handler, [IO_ICU1] = vatpic_master_handler, [IO_ICU1 + ICU_IMR_OFFSET] = vatpic_master_handler, [IO_ICU2] = vatpic_slave_handler, Modified: head/usr.sbin/bhyve/pci_lpc.c ============================================================================== --- head/usr.sbin/bhyve/pci_lpc.c Thu Apr 17 23:31:50 2014 (r264630) +++ head/usr.sbin/bhyve/pci_lpc.c Fri Apr 18 00:02:06 2014 (r264631) @@ -55,6 +55,11 @@ SET_DECLARE(lpc_sysres_set, struct lpc_s #define ELCR_PORT 0x4d0 SYSRES_IO(ELCR_PORT, 2); +#define IO_TIMER1_PORT 0x40 + +#define NMISC_PORT 0x61 +SYSRES_IO(NMISC_PORT, 1); + static struct pci_devinst *lpc_bridge; #define LPC_UART_NUM 2 @@ -226,6 +231,19 @@ pci_lpc_write_dsdt(struct pci_devinst *p dsdt_line("}"); dsdt_unindent(1); + dsdt_line(""); + dsdt_line("Device (TIMR)"); + dsdt_line("{"); + dsdt_line(" Name (_HID, EisaId (\"PNP0100\"))"); + dsdt_line(" Name (_CRS, ResourceTemplate ()"); + dsdt_line(" {"); + dsdt_indent(2); + dsdt_fixed_ioport(IO_TIMER1_PORT, 4); + dsdt_fixed_irq(0); + dsdt_unindent(2); + dsdt_line(" })"); + dsdt_line("}"); + dsdt_line("}"); } From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 06:39:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 984C7BFF; Fri, 18 Apr 2014 06:39:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B549186F; Fri, 18 Apr 2014 06:39:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3I6d1CT090308; Fri, 18 Apr 2014 06:39:01 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3I6d1uM090301; Fri, 18 Apr 2014 06:39:01 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201404180639.s3I6d1uM090301@svn.freebsd.org> From: Justin Hibbits Date: Fri, 18 Apr 2014 06:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264635 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 06:39:01 -0000 Author: jhibbits Date: Fri Apr 18 06:39:00 2014 New Revision: 264635 URL: http://svnweb.freebsd.org/changeset/base/264635 Log: Enable and disable the PMC unit at load/unload time, respectively. MFC after: 3 weeks Modified: head/sys/dev/hwpmc/hwpmc_mpc7xxx.c head/sys/dev/hwpmc/hwpmc_ppc970.c Modified: head/sys/dev/hwpmc/hwpmc_mpc7xxx.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mpc7xxx.c Fri Apr 18 01:15:45 2014 (r264634) +++ head/sys/dev/hwpmc/hwpmc_mpc7xxx.c Fri Apr 18 06:39:00 2014 (r264635) @@ -580,6 +580,7 @@ mpc7xxx_pcpu_init(struct pmc_mdep *md, i /* Clear the MMCRs, and set FC, to disable all PMCs. */ mtspr(SPR_MMCR0, SPR_MMCR0_FC | SPR_MMCR0_PMXE | SPR_MMCR0_PMC1CE | SPR_MMCR0_PMCNCE); mtspr(SPR_MMCR1, 0); + mtmsr(mfmsr() | PSL_PMM); return 0; } @@ -589,10 +590,13 @@ mpc7xxx_pcpu_fini(struct pmc_mdep *md, i { uint32_t mmcr0 = mfspr(SPR_MMCR0); + mtmsr(mfmsr() & ~PSL_PMM); mmcr0 |= SPR_MMCR0_FC; mtspr(SPR_MMCR0, mmcr0); + free(powerpc_pcpu[cpu]->pc_ppcpmcs, M_PMC); free(powerpc_pcpu[cpu], M_PMC); + return 0; } Modified: head/sys/dev/hwpmc/hwpmc_ppc970.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_ppc970.c Fri Apr 18 01:15:45 2014 (r264634) +++ head/sys/dev/hwpmc/hwpmc_ppc970.c Fri Apr 18 06:39:00 2014 (r264635) @@ -575,6 +575,7 @@ ppc970_pcpu_init(struct pmc_mdep *md, in mtspr(SPR_970MMCR0, SPR_MMCR0_FC | SPR_MMCR0_PMXE | SPR_MMCR0_PMC1CE | SPR_MMCR0_PMCNCE | SPR_970MMCR0_PMC1SEL(0x8) | SPR_970MMCR0_PMC2SEL(0x8)); mtspr(SPR_970MMCR1, 0x4218420); + mtmsr(mfmsr() | PSL_PMM); return 0; } @@ -584,11 +585,14 @@ ppc970_pcpu_fini(struct pmc_mdep *md, in { register_t mmcr0 = mfspr(SPR_MMCR0); + mtmsr(mfmsr() & ~PSL_PMM); mmcr0 |= SPR_MMCR0_FC; mmcr0 &= ~SPR_MMCR0_PMXE; mtspr(SPR_MMCR0, mmcr0); + free(powerpc_pcpu[cpu]->pc_ppcpmcs, M_PMC); free(powerpc_pcpu[cpu], M_PMC); + return 0; } From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 08:31:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3947A65; Fri, 18 Apr 2014 08:31:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C48C91453; Fri, 18 Apr 2014 08:31:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3I8VumX039167; Fri, 18 Apr 2014 08:31:56 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3I8VurN039161; Fri, 18 Apr 2014 08:31:56 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201404180831.s3I8VurN039161@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 18 Apr 2014 08:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264642 - in head/sys: dev/usb/controller modules/usb/dwc_otg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 08:31:57 -0000 Author: hselasky Date: Fri Apr 18 08:31:55 2014 New Revision: 264642 URL: http://svnweb.freebsd.org/changeset/base/264642 Log: Add support for specifying USB controller mode via FDT. Add FDT support to the DWC OTG kernel module. Submitted by: John Wehle PR: usb/188683 MFC after: 1 week Modified: head/sys/dev/usb/controller/dwc_otg.c head/sys/dev/usb/controller/dwc_otg_fdt.c head/sys/modules/usb/dwc_otg/Makefile Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Fri Apr 18 07:50:25 2014 (r264641) +++ head/sys/dev/usb/controller/dwc_otg.c Fri Apr 18 08:31:55 2014 (r264642) @@ -2149,7 +2149,12 @@ dwc_otg_vbus_interrupt(struct dwc_otg_so { DPRINTFN(5, "vbus = %u\n", is_on); - if (is_on) { + /* + * If the USB host mode is forced, then assume VBUS is always + * present else rely on the input to this function: + */ + if ((is_on != 0) || (sc->sc_mode == DWC_MODE_HOST)) { + if (!sc->sc_flags.status_vbus) { sc->sc_flags.status_vbus = 1; @@ -3182,7 +3187,7 @@ dwc_otg_init(struct dwc_otg_softc *sc) sc->sc_host_ch_max); /* setup FIFO */ - if (dwc_otg_init_fifo(sc, DWC_MODE_OTG)) + if (dwc_otg_init_fifo(sc, sc->sc_mode)) return (EINVAL); /* enable interrupts */ Modified: head/sys/dev/usb/controller/dwc_otg_fdt.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg_fdt.c Fri Apr 18 07:50:25 2014 (r264641) +++ head/sys/dev/usb/controller/dwc_otg_fdt.c Fri Apr 18 08:31:55 2014 (r264642) @@ -91,6 +91,7 @@ static int dwc_otg_attach(device_t dev) { struct dwc_otg_super_softc *sc = device_get_softc(dev); + char usb_mode[24]; int err; int rid; @@ -99,6 +100,23 @@ dwc_otg_attach(device_t dev) sc->sc_otg.sc_bus.devices = sc->sc_otg.sc_devices; sc->sc_otg.sc_bus.devices_max = DWC_OTG_MAX_DEVICES; + /* get USB mode, if any */ + if (OF_getprop(ofw_bus_get_node(dev), "dr_mode", + &usb_mode, sizeof(usb_mode)) > 0) { + + /* ensure proper zero termination */ + usb_mode[sizeof(usb_mode) - 1] = 0; + + if (strcasecmp(usb_mode, "host") == 0) + sc->sc_otg.sc_mode = DWC_MODE_HOST; + else if (strcasecmp(usb_mode, "peripheral") == 0) + sc->sc_otg.sc_mode = DWC_MODE_DEVICE; + else if (strcasecmp(usb_mode, "otg") != 0) { + device_printf(dev, "Invalid FDT dr_mode: %s\n", + usb_mode); + } + } + /* get all DMA memory */ if (usb_bus_mem_alloc_all(&sc->sc_otg.sc_bus, USB_GET_DMA_TAG(dev), NULL)) { Modified: head/sys/modules/usb/dwc_otg/Makefile ============================================================================== --- head/sys/modules/usb/dwc_otg/Makefile Fri Apr 18 07:50:25 2014 (r264641) +++ head/sys/modules/usb/dwc_otg/Makefile Fri Apr 18 08:31:55 2014 (r264642) @@ -31,8 +31,8 @@ S= ${.CURDIR}/../../.. KMOD= dwc_otg SRCS= bus_if.h device_if.h usb_if.h \ - opt_bus.h opt_usb.h \ - dwc_otg.c \ + opt_bus.h opt_usb.h ofw_bus_if.h \ + dwc_otg.c dwc_otg_fdt.c \ pci_if.h .if defined(HAS_ATMELARM) From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 14:21:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D699B406; Fri, 18 Apr 2014 14:21:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C397915BA; Fri, 18 Apr 2014 14:21:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IELA1t082973; Fri, 18 Apr 2014 14:21:10 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IELAH0082972; Fri, 18 Apr 2014 14:21:10 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201404181421.s3IELAH0082972@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 18 Apr 2014 14:21:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264646 - head/sys/dev/netfpga10g/nf10bmac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 14:21:10 -0000 Author: bz Date: Fri Apr 18 14:21:10 2014 New Revision: 264646 URL: http://svnweb.freebsd.org/changeset/base/264646 Log: Now that I figured out where the ethernet addresses come from on NetFPGA-10G, assign one to the interface by default in a very similar way. MFC after: 6 days X-Easter-Egg-Hunt: yes Modified: head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c Modified: head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c ============================================================================== --- head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c Fri Apr 18 12:51:30 2014 (r264645) +++ head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c Fri Apr 18 14:21:10 2014 (r264646) @@ -446,7 +446,25 @@ static int nf10bmac_reset(struct nf10bmac_softc *sc) { - /* Currently we cannot do anything. */ + /* + * If we do not have an ether address set, initialize to the same + * OUI as NetFPGA-10G Linux driver does (which luckily seems + * unallocated). We just change the NIC specific part from + * the slightly long "\0NF10C0" to "\0NFBSD". + * Oh and we keep the way of setting it from a string as they do. + * It's an amazing way to hide it. + * XXX-BZ If NetFPGA gets their own OUI we should fix this. + */ + if (sc->nf10bmac_eth_addr[0] == 0x00 && + sc->nf10bmac_eth_addr[1] == 0x00 && + sc->nf10bmac_eth_addr[2] == 0x00 && + sc->nf10bmac_eth_addr[3] == 0x00 && + sc->nf10bmac_eth_addr[4] == 0x00 && + sc->nf10bmac_eth_addr[5] == 0x00) { + memcpy(&sc->nf10bmac_eth_addr, "\0NFBSD", ETHER_ADDR_LEN); + sc->nf10bmac_eth_addr[5] += sc->nf10bmac_unit; + } + return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 14:28:41 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80092644; Fri, 18 Apr 2014 14:28:41 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51DCC160D; Fri, 18 Apr 2014 14:28:41 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Wb9mS-000I6P-1O; Fri, 18 Apr 2014 14:28:40 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s3IESbrP004499; Fri, 18 Apr 2014 08:28:37 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/CcN9218d+NVjNuSKnMbqT Subject: Re: svn commit: r264646 - head/sys/dev/netfpga10g/nf10bmac From: Ian Lepore To: "Bjoern A. Zeeb" In-Reply-To: <201404181421.s3IELAH0082972@svn.freebsd.org> References: <201404181421.s3IELAH0082972@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Fri, 18 Apr 2014 08:28:37 -0600 Message-ID: <1397831317.1124.301.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 14:28:41 -0000 On Fri, 2014-04-18 at 14:21 +0000, Bjoern A. Zeeb wrote: > Author: bz > Date: Fri Apr 18 14:21:10 2014 > New Revision: 264646 > URL: http://svnweb.freebsd.org/changeset/base/264646 > > Log: > Now that I figured out where the ethernet addresses come from > on NetFPGA-10G, assign one to the interface by default in a very > similar way. > > MFC after: 6 days > X-Easter-Egg-Hunt: yes > > Modified: > head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c > > Modified: head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c > ============================================================================== > --- head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c Fri Apr 18 12:51:30 2014 (r264645) > +++ head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c Fri Apr 18 14:21:10 2014 (r264646) > @@ -446,7 +446,25 @@ static int > nf10bmac_reset(struct nf10bmac_softc *sc) > { > > - /* Currently we cannot do anything. */ > + /* > + * If we do not have an ether address set, initialize to the same > + * OUI as NetFPGA-10G Linux driver does (which luckily seems > + * unallocated). We just change the NIC specific part from > + * the slightly long "\0NF10C0" to "\0NFBSD". > + * Oh and we keep the way of setting it from a string as they do. > + * It's an amazing way to hide it. > + * XXX-BZ If NetFPGA gets their own OUI we should fix this. > + */ > + if (sc->nf10bmac_eth_addr[0] == 0x00 && > + sc->nf10bmac_eth_addr[1] == 0x00 && > + sc->nf10bmac_eth_addr[2] == 0x00 && > + sc->nf10bmac_eth_addr[3] == 0x00 && > + sc->nf10bmac_eth_addr[4] == 0x00 && > + sc->nf10bmac_eth_addr[5] == 0x00) { > + memcpy(&sc->nf10bmac_eth_addr, "\0NFBSD", ETHER_ADDR_LEN); > + sc->nf10bmac_eth_addr[5] += sc->nf10bmac_unit; > + } > + > return (0); > } > > For other drivers/socs where we need to cook up an address on the fly, we've used "bsd" as the OUI and a 24-bit random for the low order. Aside from the nice aesthetic, 'bsd' has the "locally administered" bit set and thus is g'teed to not clash with any globally assigned OUI. -- Ian From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 15:22:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B956322F; Fri, 18 Apr 2014 15:22:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3CA81B99; Fri, 18 Apr 2014 15:22:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IFMwxm009072; Fri, 18 Apr 2014 15:22:58 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IFMvJ7009065; Fri, 18 Apr 2014 15:22:57 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201404181522.s3IFMvJ7009065@svn.freebsd.org> From: Tycho Nightingale Date: Fri, 18 Apr 2014 15:22:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264648 - in head: sys/amd64/vmm sys/amd64/vmm/io usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 15:22:58 -0000 Author: tychon Date: Fri Apr 18 15:22:56 2014 New Revision: 264648 URL: http://svnweb.freebsd.org/changeset/base/264648 Log: Respect the destination operand size of the 'Input from Port' instruction. Approved by: grehan (co-mentor) Modified: head/sys/amd64/vmm/io/vatpic.c head/sys/amd64/vmm/io/vatpic.h head/sys/amd64/vmm/io/vatpit.c head/sys/amd64/vmm/io/vatpit.h head/sys/amd64/vmm/vmm_ioport.c head/sys/amd64/vmm/vmm_ioport.h head/usr.sbin/bhyve/inout.c Modified: head/sys/amd64/vmm/io/vatpic.c ============================================================================== --- head/sys/amd64/vmm/io/vatpic.c Fri Apr 18 14:59:39 2014 (r264647) +++ head/sys/amd64/vmm/io/vatpic.c Fri Apr 18 15:22:56 2014 (r264648) @@ -517,7 +517,8 @@ vatpic_intr_accepted(struct vm *vm, int } static int -vatpic_read(struct vatpic *vatpic, struct atpic *atpic, struct vm_exit *vmexit) +vatpic_read(struct vatpic *vatpic, struct atpic *atpic, bool in, int port, + int bytes, uint32_t *eax) { VATPIC_LOCK(vatpic); @@ -526,16 +527,16 @@ vatpic_read(struct vatpic *vatpic, struc VATPIC_UNLOCK(vatpic); return (-1); } else { - if (vmexit->u.inout.port & ICU_IMR_OFFSET) { + if (port & ICU_IMR_OFFSET) { /* read interrrupt mask register */ - vmexit->u.inout.eax = atpic->mask; + *eax = atpic->mask; } else { if (atpic->rd_cmd_reg == OCW3_RIS) { /* read interrupt service register */ - vmexit->u.inout.eax = atpic->service; + *eax = atpic->service; } else { /* read interrupt request register */ - vmexit->u.inout.eax = atpic->request; + *eax = atpic->request; } } } @@ -547,17 +548,17 @@ vatpic_read(struct vatpic *vatpic, struc } static int -vatpic_write(struct vatpic *vatpic, struct atpic *atpic, - struct vm_exit *vmexit) +vatpic_write(struct vatpic *vatpic, struct atpic *atpic, bool in, int port, + int bytes, uint32_t *eax) { int error; uint8_t val; - val = vmexit->u.inout.eax; + val = *eax; VATPIC_LOCK(vatpic); - if (vmexit->u.inout.port & ICU_IMR_OFFSET) { + if (port & ICU_IMR_OFFSET) { if (atpic->ready) { error = vatpic_ocw1(vatpic, atpic, val); } else { @@ -594,7 +595,8 @@ vatpic_write(struct vatpic *vatpic, stru } int -vatpic_master_handler(void *vm, int vcpuid, struct vm_exit *vmexit) +vatpic_master_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *eax) { struct vatpic *vatpic; struct atpic *atpic; @@ -602,18 +604,19 @@ vatpic_master_handler(void *vm, int vcpu vatpic = vm_atpic(vm); atpic = &vatpic->atpic[0]; - if (vmexit->u.inout.bytes != 1) + if (bytes != 1) return (-1); - if (vmexit->u.inout.in) { - return (vatpic_read(vatpic, atpic, vmexit)); + if (in) { + return (vatpic_read(vatpic, atpic, in, port, bytes, eax)); } - return (vatpic_write(vatpic, atpic, vmexit)); + return (vatpic_write(vatpic, atpic, in, port, bytes, eax)); } int -vatpic_slave_handler(void *vm, int vcpuid, struct vm_exit *vmexit) +vatpic_slave_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *eax) { struct vatpic *vatpic; struct atpic *atpic; @@ -621,35 +624,36 @@ vatpic_slave_handler(void *vm, int vcpui vatpic = vm_atpic(vm); atpic = &vatpic->atpic[1]; - if (vmexit->u.inout.bytes != 1) + if (bytes != 1) return (-1); - if (vmexit->u.inout.in) { - return (vatpic_read(vatpic, atpic, vmexit)); + if (in) { + return (vatpic_read(vatpic, atpic, in, port, bytes, eax)); } - return (vatpic_write(vatpic, atpic, vmexit)); + return (vatpic_write(vatpic, atpic, in, port, bytes, eax)); } int -vatpic_elc_handler(void *vm, int vcpuid, struct vm_exit *vmexit) +vatpic_elc_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *eax) { struct vatpic *vatpic; bool is_master; vatpic = vm_atpic(vm); - is_master = (vmexit->u.inout.port == IO_ELCR1); + is_master = (port == IO_ELCR1); - if (vmexit->u.inout.bytes != 1) + if (bytes != 1) return (-1); VATPIC_LOCK(vatpic); - if (vmexit->u.inout.in) { + if (in) { if (is_master) - vmexit->u.inout.eax = vatpic->elc[0]; + *eax = vatpic->elc[0]; else - vmexit->u.inout.eax = vatpic->elc[1]; + *eax = vatpic->elc[1]; } else { /* * For the master PIC the cascade channel (IRQ2), the @@ -662,9 +666,9 @@ vatpic_elc_handler(void *vm, int vcpuid, * be programmed for level mode. */ if (is_master) - vatpic->elc[0] = (vmexit->u.inout.eax & 0xf8); + vatpic->elc[0] = (*eax & 0xf8); else - vatpic->elc[1] = (vmexit->u.inout.eax & 0xde); + vatpic->elc[1] = (*eax & 0xde); } VATPIC_UNLOCK(vatpic); Modified: head/sys/amd64/vmm/io/vatpic.h ============================================================================== --- head/sys/amd64/vmm/io/vatpic.h Fri Apr 18 14:59:39 2014 (r264647) +++ head/sys/amd64/vmm/io/vatpic.h Fri Apr 18 15:22:56 2014 (r264648) @@ -39,9 +39,12 @@ struct vatpic *vatpic_init(struct vm *vm); void vatpic_cleanup(struct vatpic *vatpic); -int vatpic_master_handler(void *vm, int vcpuid, struct vm_exit *vmexit); -int vatpic_slave_handler(void *vm, int vcpuid, struct vm_exit *vmexit); -int vatpic_elc_handler(void *vm, int vcpuid, struct vm_exit *vmexit); +int vatpic_master_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *eax); +int vatpic_slave_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *eax); +int vatpic_elc_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *eax); int vatpic_assert_irq(struct vm *vm, int irq); int vatpic_deassert_irq(struct vm *vm, int irq); Modified: head/sys/amd64/vmm/io/vatpit.c ============================================================================== --- head/sys/amd64/vmm/io/vatpit.c Fri Apr 18 14:59:39 2014 (r264647) +++ head/sys/amd64/vmm/io/vatpit.c Fri Apr 18 15:22:56 2014 (r264648) @@ -253,24 +253,23 @@ vatpit_update_mode(struct vatpit *vatpit } int -vatpit_handler(void *vm, int vcpuid, struct vm_exit *vmexit) +vatpit_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *eax) { struct vatpit *vatpit; struct channel *c; - int port; uint8_t val; int error; vatpit = vm_atpit(vm); - if (vmexit->u.inout.bytes != 1) + if (bytes != 1) return (-1); - val = vmexit->u.inout.eax; - port = vmexit->u.inout.port; + val = *eax; if (port == TIMER_MODE) { - if (vmexit->u.inout.in) { + if (in) { VM_CTR0(vatpit->vm, "vatpit attempt to read mode"); return (-1); } @@ -283,12 +282,12 @@ vatpit_handler(void *vm, int vcpuid, str } /* counter ports */ - KASSERT(port >= TIMER_CNTR0 && vmexit->u.inout.port <= TIMER_CNTR2, + KASSERT(port >= TIMER_CNTR0 && port <= TIMER_CNTR2, ("invalid port 0x%x", port)); c = &vatpit->channel[port - TIMER_CNTR0]; VATPIT_LOCK(vatpit); - if (vmexit->u.inout.in) { + if (in) { /* * The spec says that once the output latch is completely * read it should revert to "following" the counter. Use @@ -303,12 +302,12 @@ vatpit_handler(void *vm, int vcpuid, str if (c->frbyte) tmp >>= 8; tmp &= 0xff; - vmexit->u.inout.eax = tmp; + *eax = tmp; c->frbyte ^= 1; } else - vmexit->u.inout.eax = c->ol[--c->olbyte]; + *eax = c->ol[--c->olbyte]; } else { - c->cr[c->crbyte++] = vmexit->u.inout.eax; + c->cr[c->crbyte++] = *eax; if (c->crbyte == 2) { c->frbyte = 0; c->crbyte = 0; @@ -329,18 +328,19 @@ vatpit_handler(void *vm, int vcpuid, str } int -vatpit_nmisc_handler(void *vm, int vcpuid, struct vm_exit *vmexit) +vatpit_nmisc_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *eax) { struct vatpit *vatpit; vatpit = vm_atpit(vm); - if (vmexit->u.inout.in) { + if (in) { VATPIT_LOCK(vatpit); if (vatpit_get_out(vatpit, 2)) - vmexit->u.inout.eax = TMR2_OUT_STS; + *eax = TMR2_OUT_STS; else - vmexit->u.inout.eax = 0; + *eax = 0; VATPIT_UNLOCK(vatpit); } Modified: head/sys/amd64/vmm/io/vatpit.h ============================================================================== --- head/sys/amd64/vmm/io/vatpit.h Fri Apr 18 14:59:39 2014 (r264647) +++ head/sys/amd64/vmm/io/vatpit.h Fri Apr 18 15:22:56 2014 (r264648) @@ -37,7 +37,9 @@ struct vatpit *vatpit_init(struct vm *vm); void vatpit_cleanup(struct vatpit *vatpit); -int vatpit_handler(void *vm, int vcpuid, struct vm_exit *vmexit); -int vatpit_nmisc_handler(void *vm, int vcpuid, struct vm_exit *vmexit); +int vatpit_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *eax); +int vatpit_nmisc_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *eax); #endif /* _VATPIT_H_ */ Modified: head/sys/amd64/vmm/vmm_ioport.c ============================================================================== --- head/sys/amd64/vmm/vmm_ioport.c Fri Apr 18 14:59:39 2014 (r264647) +++ head/sys/amd64/vmm/vmm_ioport.c Fri Apr 18 15:22:56 2014 (r264648) @@ -59,6 +59,8 @@ int emulate_ioport(struct vm *vm, int vcpuid, struct vm_exit *vmexit) { ioport_handler_func_t handler; + uint32_t mask, val; + int error; if (vmexit->u.inout.port >= MAX_IOPORTS) return (-1); @@ -67,5 +69,39 @@ emulate_ioport(struct vm *vm, int vcpuid if (handler == NULL) return (-1); - return ((*handler)(vm, vcpuid, vmexit)); + if (!vmexit->u.inout.in) { + switch (vmexit->u.inout.bytes) { + case 1: + mask = 0xff; + break; + case 2: + mask = 0xffff; + break; + default: + mask = 0xffffffff; + break; + } + val = vmexit->u.inout.eax & mask; + } + + error = (*handler)(vm, vcpuid, vmexit->u.inout.in, + vmexit->u.inout.port, vmexit->u.inout.bytes, &val); + + if (!error && vmexit->u.inout.in) { + switch (vmexit->u.inout.bytes) { + case 1: + mask = 0xff; + break; + case 2: + mask = 0xffff; + break; + default: + mask = 0xffffffff; + break; + } + vmexit->u.inout.eax &= ~mask; + vmexit->u.inout.eax |= val & mask; + } + + return (error); } Modified: head/sys/amd64/vmm/vmm_ioport.h ============================================================================== --- head/sys/amd64/vmm/vmm_ioport.h Fri Apr 18 14:59:39 2014 (r264647) +++ head/sys/amd64/vmm/vmm_ioport.h Fri Apr 18 15:22:56 2014 (r264648) @@ -30,7 +30,7 @@ #define _VMM_IOPORT_H_ typedef int (*ioport_handler_func_t)(void *vm, int vcpuid, - struct vm_exit *vmexit); + bool in, int port, int bytes, uint32_t *val); int emulate_ioport(struct vm *vm, int vcpuid, struct vm_exit *vmexit); Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Fri Apr 18 14:59:39 2014 (r264647) +++ head/usr.sbin/bhyve/inout.c Fri Apr 18 15:22:56 2014 (r264648) @@ -95,9 +95,10 @@ emulate_inout(struct vmctx *ctx, int vcp uint32_t *eax, int strict) { int flags; - uint32_t mask; + uint32_t mask, val; inout_func_t handler; void *arg; + int error; assert(port < MAX_IOPORTS); @@ -118,16 +119,34 @@ emulate_inout(struct vmctx *ctx, int vcp mask = 0xffffffff; break; } - *eax = *eax & mask; + val = *eax & mask; } flags = inout_handlers[port].flags; arg = inout_handlers[port].arg; if ((in && (flags & IOPORT_F_IN)) || (!in && (flags & IOPORT_F_OUT))) - return ((*handler)(ctx, vcpu, in, port, bytes, eax, arg)); + error = (*handler)(ctx, vcpu, in, port, bytes, &val, arg); else - return (-1); + error = -1; + + if (!error && in) { + switch (bytes) { + case 1: + mask = 0xff; + break; + case 2: + mask = 0xffff; + break; + default: + mask = 0xffffffff; + break; + } + *eax &= ~mask; + *eax |= val & mask; + } + + return (error); } void From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 16:01:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F68414C; Fri, 18 Apr 2014 16:01:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFFF61067; Fri, 18 Apr 2014 16:01:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IG1JIY025192; Fri, 18 Apr 2014 16:01:19 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IG1JkF025191; Fri, 18 Apr 2014 16:01:19 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201404181601.s3IG1JkF025191@svn.freebsd.org> From: Tycho Nightingale Date: Fri, 18 Apr 2014 16:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264650 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 16:01:20 -0000 Author: tychon Date: Fri Apr 18 16:01:19 2014 New Revision: 264650 URL: http://svnweb.freebsd.org/changeset/base/264650 Log: Fix ACPI DSDT indentation cosmetic breakage introduced in r264631 -- pointed out by jhb@. Approved by: grehan (co-mentor) Modified: head/usr.sbin/bhyve/pci_lpc.c Modified: head/usr.sbin/bhyve/pci_lpc.c ============================================================================== --- head/usr.sbin/bhyve/pci_lpc.c Fri Apr 18 15:46:43 2014 (r264649) +++ head/usr.sbin/bhyve/pci_lpc.c Fri Apr 18 16:01:19 2014 (r264650) @@ -229,7 +229,6 @@ pci_lpc_write_dsdt(struct pci_devinst *p dsdt_unindent(2); dsdt_line(" })"); dsdt_line("}"); - dsdt_unindent(1); dsdt_line(""); dsdt_line("Device (TIMR)"); @@ -243,6 +242,7 @@ pci_lpc_write_dsdt(struct pci_devinst *p dsdt_unindent(2); dsdt_line(" })"); dsdt_line("}"); + dsdt_unindent(1); dsdt_line("}"); } From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 16:05:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DB08361; Fri, 18 Apr 2014 16:05:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A2601106; Fri, 18 Apr 2014 16:05:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IG5CPj025654; Fri, 18 Apr 2014 16:05:12 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IG5CpS025653; Fri, 18 Apr 2014 16:05:12 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201404181605.s3IG5CpS025653@svn.freebsd.org> From: Tycho Nightingale Date: Fri, 18 Apr 2014 16:05:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264651 - head/sys/amd64/vmm/io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 16:05:13 -0000 Author: tychon Date: Fri Apr 18 16:05:12 2014 New Revision: 264651 URL: http://svnweb.freebsd.org/changeset/base/264651 Log: Add support for the PIT 'readback' command -- based on a patch by grehan@. Approved by: grehan (co-mentor) Modified: head/sys/amd64/vmm/io/vatpit.c Modified: head/sys/amd64/vmm/io/vatpit.c ============================================================================== --- head/sys/amd64/vmm/io/vatpit.c Fri Apr 18 16:01:19 2014 (r264650) +++ head/sys/amd64/vmm/io/vatpit.c Fri Apr 18 16:05:12 2014 (r264651) @@ -56,6 +56,15 @@ static MALLOC_DEFINE(M_VATPIT, "atpit", #define TIMER_MODE_MASK 0x0f #define TIMER_SEL_READBACK 0xc0 +#define TIMER_STS_OUT 0x80 +#define TIMER_STS_NULLCNT 0x40 + +#define TIMER_RB_LCTR 0x20 +#define TIMER_RB_LSTATUS 0x10 +#define TIMER_RB_CTR_2 0x08 +#define TIMER_RB_CTR_1 0x04 +#define TIMER_RB_CTR_0 0x02 + #define TMR2_OUT_STS 0x20 #define PIT_8254_FREQ 1193182 @@ -73,6 +82,8 @@ struct channel { sbintime_t now_sbt; /* uptime when counter was loaded */ uint8_t cr[2]; uint8_t ol[2]; + bool slatched; /* status latched */ + uint8_t status; int crbyte; int olbyte; int frbyte; @@ -198,6 +209,7 @@ pit_update_counter(struct vatpit *vatpit */ c->initial = TIMER_DIV(PIT_8254_FREQ, 100); c->now_sbt = sbinuptime(); + c->status &= ~TIMER_STS_NULLCNT; } delta_ticks = (sbinuptime() - c->now_sbt) / vatpit->freq_sbt; @@ -214,6 +226,57 @@ pit_update_counter(struct vatpit *vatpit } static int +pit_readback1(struct vatpit *vatpit, int channel, uint8_t cmd) +{ + struct channel *c; + + c = &vatpit->channel[channel]; + + /* + * Latch the count/status of the timer if not already latched. + * N.B. that the count/status latch-select bits are active-low. + */ + if (!(cmd & TIMER_RB_LCTR) && !c->olbyte) { + (void) pit_update_counter(vatpit, c, true); + } + + if (!(cmd & TIMER_RB_LSTATUS) && !c->slatched) { + c->slatched = true; + /* + * For mode 0, see if the elapsed time is greater + * than the initial value - this results in the + * output pin being set to 1 in the status byte. + */ + if (c->mode == TIMER_INTTC && vatpit_get_out(vatpit, channel)) + c->status |= TIMER_STS_OUT; + else + c->status &= ~TIMER_STS_OUT; + } + + return (0); +} + +static int +pit_readback(struct vatpit *vatpit, uint8_t cmd) +{ + int error; + + /* + * The readback command can apply to all timers. + */ + error = 0; + if (cmd & TIMER_RB_CTR_0) + error = pit_readback1(vatpit, 0, cmd); + if (!error && cmd & TIMER_RB_CTR_1) + error = pit_readback1(vatpit, 1, cmd); + if (!error && cmd & TIMER_RB_CTR_2) + error = pit_readback1(vatpit, 2, cmd); + + return (error); +} + + +static int vatpit_update_mode(struct vatpit *vatpit, uint8_t val) { struct channel *c; @@ -224,7 +287,7 @@ vatpit_update_mode(struct vatpit *vatpit mode = val & TIMER_MODE_MASK; if (sel == TIMER_SEL_READBACK) - return (-1); + return (pit_readback(vatpit, val)); if (rw != TIMER_LATCH && rw != TIMER_16BIT) return (-1); @@ -247,6 +310,7 @@ vatpit_update_mode(struct vatpit *vatpit else { c->mode = mode; c->olbyte = 0; /* reset latch after reprogramming */ + c->status |= TIMER_STS_NULLCNT; } return (0); @@ -287,7 +351,14 @@ vatpit_handler(void *vm, int vcpuid, boo c = &vatpit->channel[port - TIMER_CNTR0]; VATPIT_LOCK(vatpit); - if (in) { + if (in && c->slatched) { + /* + * Return the status byte if latched + */ + *eax = c->status; + c->slatched = false; + c->status = 0; + } else if (in) { /* * The spec says that once the output latch is completely * read it should revert to "following" the counter. Use @@ -309,6 +380,7 @@ vatpit_handler(void *vm, int vcpuid, boo } else { c->cr[c->crbyte++] = *eax; if (c->crbyte == 2) { + c->status &= ~TIMER_STS_NULLCNT; c->frbyte = 0; c->crbyte = 0; c->initial = c->cr[0] | (uint16_t)c->cr[1] << 8; From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 16:19:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFA1B79E; Fri, 18 Apr 2014 16:19:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC7861228; Fri, 18 Apr 2014 16:19:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IGJX4u030249; Fri, 18 Apr 2014 16:19:33 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IGJXGN030246; Fri, 18 Apr 2014 16:19:33 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201404181619.s3IGJXGN030246@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 18 Apr 2014 16:19:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264653 - in head/sys/dev/usb: . quirk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 16:19:34 -0000 Author: hselasky Date: Fri Apr 18 16:19:33 2014 New Revision: 264653 URL: http://svnweb.freebsd.org/changeset/base/264653 Log: Add new USB quirk. Submitted by: kwm @ MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Fri Apr 18 16:14:31 2014 (r264652) +++ head/sys/dev/usb/quirk/usb_quirk.c Fri Apr 18 16:19:33 2014 (r264653) @@ -236,6 +236,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(JMICRON, JM20337, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(KINGSTON, HYPERX3_0, 0x0000, 0xffff, UQ_MSC_NO_INQUIRY), USB_QUIRK(KYOCERA, FINECAM_L3, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), USB_QUIRK(KYOCERA, FINECAM_S3X, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Apr 18 16:14:31 2014 (r264652) +++ head/sys/dev/usb/usbdevs Fri Apr 18 16:19:33 2014 (r264653) @@ -2506,6 +2506,7 @@ product KEYSPAN UIA11 0x0202 UIA-11 rem /* Kingston products */ product KINGSTON XX1 0x0008 Ethernet product KINGSTON KNU101TX 0x000a KNU101TX USB Ethernet +product KINGSTON HYPERX3_0 0x162b DT HyperX 3.0 /* Kawasaki products */ product KLSI DUH3E10BT 0x0008 USB Ethernet From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 16:53:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B211F5; Fri, 18 Apr 2014 16:53:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE8B915C7; Fri, 18 Apr 2014 16:53:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IGr8BQ045877; Fri, 18 Apr 2014 16:53:08 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IGr7Ms045868; Fri, 18 Apr 2014 16:53:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404181653.s3IGr7Ms045868@svn.freebsd.org> From: Warner Losh Date: Fri, 18 Apr 2014 16:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264654 - in head: share/mk sys/i386/conf sys/modules sys/modules/aic7xxx/ahc sys/modules/dpt sys/modules/ep sys/modules/vx tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 16:53:09 -0000 Author: imp Date: Fri Apr 18 16:53:06 2014 New Revision: 264654 URL: http://svnweb.freebsd.org/changeset/base/264654 Log: Don't build EISA by default anymore. Remove from i386 GENERIC and create an option that defaults to "no" on all platforms to not build the EISA bits. Discussed on: arch@ Added: head/tools/build/options/WITH_EISA (contents, props changed) Modified: head/share/mk/bsd.own.mk head/sys/i386/conf/GENERIC head/sys/modules/Makefile head/sys/modules/aic7xxx/ahc/Makefile head/sys/modules/dpt/Makefile head/sys/modules/ep/Makefile head/sys/modules/vx/Makefile Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Fri Apr 18 16:19:33 2014 (r264653) +++ head/share/mk/bsd.own.mk Fri Apr 18 16:53:06 2014 (r264654) @@ -354,6 +354,7 @@ __DEFAULT_NO_OPTIONS = \ CLANG_EXTRAS \ CTF \ DEBUG_FILES \ + EISA \ HESIOD \ INSTALL_AS_USER \ LLDB \ Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri Apr 18 16:19:33 2014 (r264653) +++ head/sys/i386/conf/GENERIC Fri Apr 18 16:53:06 2014 (r264654) @@ -94,7 +94,6 @@ device cpufreq # Bus support. device acpi -device eisa device pci # Floppy drives @@ -108,7 +107,6 @@ device mvs # Marvell 88SX50XX/88SX60X device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # SCSI Controllers -device ahb # EISA AHA1742 family device ahc # AHA2940 and onboard AIC7xxx devices options AHC_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~128k to driver. Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Apr 18 16:19:33 2014 (r264653) +++ head/sys/modules/Makefile Fri Apr 18 16:53:06 2014 (r264654) @@ -561,7 +561,9 @@ _acpi= acpi .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) _aesni= aesni .endif +.if ${MK_EISA} != "no" _ahb= ahb +.endif _amdsbwd= amdsbwd _amdtemp= amdtemp _arcmsr= arcmsr Modified: head/sys/modules/aic7xxx/ahc/Makefile ============================================================================== --- head/sys/modules/aic7xxx/ahc/Makefile Fri Apr 18 16:19:33 2014 (r264653) +++ head/sys/modules/aic7xxx/ahc/Makefile Fri Apr 18 16:53:06 2014 (r264654) @@ -1,9 +1,14 @@ # $FreeBSD$ +.include + .PATH: ${.CURDIR}/../../../dev/aic7xxx KMOD= ahc -SUBDIR= ahc_eisa ahc_isa ahc_pci +.if ${MK_EISA} != "no" +SUBDIR+= ahc_eisa +.endif +SUBDIR+= ahc_isa ahc_pci GENSRCS= aic7xxx_seq.h aic7xxx_reg.h AHC_REG_PRETTY_PRINT=1 Modified: head/sys/modules/dpt/Makefile ============================================================================== --- head/sys/modules/dpt/Makefile Fri Apr 18 16:19:33 2014 (r264653) +++ head/sys/modules/dpt/Makefile Fri Apr 18 16:53:06 2014 (r264654) @@ -1,5 +1,6 @@ # $FreeBSD$ -# + +.include .PATH: ${.CURDIR}/../../dev/dpt KMOD= dpt @@ -9,7 +10,7 @@ SRCS= dpt_scsi.c dpt.h \ opt_cam.h opt_scsi.h \ device_if.h bus_if.h -.if ${MACHINE} != "i386" +.if ${MK_EISA} == "no" # Create an empty opt_eisa.h in order to keep kmod.mk from linking in an # existing one from KERNBUILDDIR which possibly has DEV_EISA defined so # dpt.ko is always built without EISA support. Modified: head/sys/modules/ep/Makefile ============================================================================== --- head/sys/modules/ep/Makefile Fri Apr 18 16:19:33 2014 (r264653) +++ head/sys/modules/ep/Makefile Fri Apr 18 16:53:06 2014 (r264654) @@ -1,12 +1,16 @@ # $FreeBSD$ +.include + .PATH: ${.CURDIR}/../../dev/ep KMOD= if_ep SRCS= if_ep.c SRCS+= if_ep_pccard.c pccarddevs.h card_if.h SRCS+= if_ep_isa.c isa_if.h +.if ${MK_EISA} != "no" SRCS+= if_ep_eisa.c eisa_if.h +.endif #SRCS+= if_ep_mca.c SRCS+= bus_if.h device_if.h Modified: head/sys/modules/vx/Makefile ============================================================================== --- head/sys/modules/vx/Makefile Fri Apr 18 16:19:33 2014 (r264653) +++ head/sys/modules/vx/Makefile Fri Apr 18 16:53:06 2014 (r264654) @@ -1,10 +1,12 @@ # $FreeBSD$ +.include + .PATH: ${.CURDIR}/../../dev/vx KMOD= if_vx SRCS= if_vx.c if_vx_pci.c -.if ${MACHINE_CPUARCH} == "i386" +.if ${MK_EISA} != "no" SRCS+= if_vx_eisa.c .endif SRCS+= device_if.h bus_if.h pci_if.h eisa_if.h Added: head/tools/build/options/WITH_EISA ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_EISA Fri Apr 18 16:53:06 2014 (r264654) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build EISA kernel modules. From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 16:53:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85BAB244; Fri, 18 Apr 2014 16:53:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5914A15D1; Fri, 18 Apr 2014 16:53:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IGrvxi045992; Fri, 18 Apr 2014 16:53:57 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IGrvMc045991; Fri, 18 Apr 2014 16:53:57 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404181653.s3IGrvMc045991@svn.freebsd.org> From: Warner Losh Date: Fri, 18 Apr 2014 16:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264655 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 16:53:57 -0000 Author: imp Date: Fri Apr 18 16:53:56 2014 New Revision: 264655 URL: http://svnweb.freebsd.org/changeset/base/264655 Log: Add -x to the removal of trees to prevent crossing mount points to limit the damage from errored out runs and failure to unmount loopback mounts properly. Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri Apr 18 16:53:06 2014 (r264654) +++ head/tools/tools/nanobsd/nanobsd.sh Fri Apr 18 16:53:56 2014 (r264655) @@ -184,9 +184,9 @@ nano_cleanup ( ) ( clean_build ( ) ( pprint 2 "Clean and create object directory (${MAKEOBJDIRPREFIX})" - if ! rm -rf ${MAKEOBJDIRPREFIX} > /dev/null 2>&1 ; then - chflags -R noschg ${MAKEOBJDIRPREFIX} - rm -r ${MAKEOBJDIRPREFIX} + if ! rm -xrf ${MAKEOBJDIRPREFIX}/ > /dev/null 2>&1 ; then + chflags -R noschg ${MAKEOBJDIRPREFIX}/ + rm -xr ${MAKEOBJDIRPREFIX}/ fi mkdir -p ${MAKEOBJDIRPREFIX} printenv > ${MAKEOBJDIRPREFIX}/_.env @@ -240,17 +240,17 @@ build_kernel ( ) ( clean_world ( ) ( if [ "${NANO_OBJ}" != "${MAKEOBJDIRPREFIX}" ]; then pprint 2 "Clean and create object directory (${NANO_OBJ})" - if ! rm -rf ${NANO_OBJ} > /dev/null 2>&1 ; then + if ! rm -rxf ${NANO_OBJ}/ > /dev/null 2>&1 ; then chflags -R noschg ${NANO_OBJ} - rm -r ${NANO_OBJ} + rm -xr ${NANO_OBJ}/ fi mkdir -p ${NANO_OBJ} ${NANO_WORLDDIR} printenv > ${NANO_OBJ}/_.env else pprint 2 "Clean and create world directory (${NANO_WORLDDIR})" - if ! rm -rf ${NANO_WORLDDIR}/ > /dev/null 2>&1 ; then + if ! rm -rxf ${NANO_WORLDDIR}/ > /dev/null 2>&1 ; then chflags -R noschg ${NANO_WORLDDIR} - rm -rf ${NANO_WORLDDIR} + rm -rxf ${NANO_WORLDDIR}/ fi mkdir -p ${NANO_WORLDDIR} fi @@ -758,7 +758,7 @@ cust_pkg () ( exit 2 fi done - rm -rf ${NANO_WORLDDIR}/Pkg + rm -rxf ${NANO_WORLDDIR}/Pkg ) cust_pkgng () ( @@ -827,7 +827,7 @@ cust_pkgng () ( exit 2 fi done - rm -rf ${NANO_WORLDDIR}/Pkg + rm -rxf ${NANO_WORLDDIR}/Pkg ) ####################################################################### From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 17:03:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97BEE75F; Fri, 18 Apr 2014 17:03:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 721F316A7; Fri, 18 Apr 2014 17:03:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IH3Ade050219; Fri, 18 Apr 2014 17:03:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IH392L050216; Fri, 18 Apr 2014 17:03:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404181703.s3IH392L050216@svn.freebsd.org> From: Warner Losh Date: Fri, 18 Apr 2014 17:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264656 - head/tools/tools/nanobsd/dhcpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 17:03:10 -0000 Author: imp Date: Fri Apr 18 17:03:09 2014 New Revision: 264656 URL: http://svnweb.freebsd.org/changeset/base/264656 Log: An abstracted down version of the NanoBSD config files as used by FreeNAS and the BSDRP folks. Added: head/tools/tools/nanobsd/dhcpd/ head/tools/tools/nanobsd/dhcpd/README (contents, props changed) head/tools/tools/nanobsd/dhcpd/common (contents, props changed) head/tools/tools/nanobsd/dhcpd/os-base (contents, props changed) Added: head/tools/tools/nanobsd/dhcpd/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/nanobsd/dhcpd/README Fri Apr 18 17:03:09 2014 (r264656) @@ -0,0 +1,14 @@ +$FreeBSD$ + +Example for creating many different builds (including different +arch) from a common set of files, as well as building natively +using qemu user space emulation. + +This creates a simple appliance that uses dnsmasq to serve DNS +and DHCPd. + +This is a work in progress. Generally, to build this you should + cd tools/tools/nanobsd/dhcpd + sudo sh ../nandobsd.sh -C os-base +but do be careful if things are interrupted. There may still be +bugs lurking that cause your entire FreeBSD tree to disappear. Added: head/tools/tools/nanobsd/dhcpd/common ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/nanobsd/dhcpd/common Fri Apr 18 17:03:09 2014 (r264656) @@ -0,0 +1,275 @@ +# $FreeBSD$ + +#- +# Copyright (c) 2014 Warner Losh. All Rights Reserved. +# Copyright (c) 2010 iXsystems, Inc., All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL iXsystems, Inc OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# +# This file is heavily derived from both Sam Leffler's Avilia config, +# as well as the BSDRP project's config file. Neither of these have +# an explicit copyright/license statement, but are implicitly BSDL. This +# example has been taken from the FreeNAS project (an early version) and +# simplified to meet the needs of the example. +# + +NANO_PMAKE="make" # NB: disable -j 3 + +NANO_CFG_BASE=$(pwd) +NANO_CFG_BASE=${NANO_CFG_BASE%/dhcpd} +NANO_SRC=$(pwd) +NANO_SRC=${NANO_SRC%/tools/tools/nanobsd/dhcpd} +NANO_OBJ=${NANO_SRC}/../dhcpd/obj +# Where cust_pkg() finds packages to install +#XXX: Is this the right place? +NANO_PORTS=${NANO_SRC}/../ports +NANO_PACKAGE_DIR=${NANO_SRC}/${NANO_TOOLS}/Pkg +NANO_DATADIR=${NANO_OBJ}/_.data +NANO_DATASIZE=40960 +NANO_INIT_IMG2=0 +unset MAKEOBJDIRPREFIX + +# this to go into nanobsd.sh +NANO_PORTS=${NANO_PORTS:-/usr/ports} + +customize_cmd cust_allow_ssh_root + +add_etc_make_conf() +{ + touch ${NANO_WORLDDIR}/etc/make.conf +} +customize_cmd add_etc_make_conf + +clean_usr_local() +{ + LOCAL_DIR=${NANO_WORLDDIR}/usr/local + pprint 2 "Clean and create world directory (${LOCAL_DIR})" + if rm -rf ${LOCAL_DIR}/ > /dev/null 2>&1 ; then + true + else + chflags -R noschg ${LOCAL_DIR}/ + rm -rf ${LOCAL_DIR}/ + fi + for f in bin etc lib libdata libexec sbin share; do + mkdir -p ${LOCAL_DIR}/$f + done +} +customize_cmd clean_usr_local + +cust_install_machine_files() +{ + echo "cd ${NANO_CFG_BASE}/Files" + cd ${NANO_CFG_BASE}/Files + find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${NANO_WORLDDIR} +} +customize_cmd cust_install_files +customize_cmd cust_install_machine_files + +buildenv() +{ + cd ${NANO_SRC} + env __MAKE_CONF=${NANO_MAKE_CONF_BUILD} DESTDIR=${NANO_WORLDDIR} make buildenv +} + +NANO_MAKEFS="makefs -B big \ + -o bsize=4096,fsize=512,density=8192,optimization=space" +export NANO_MAKEFS + +# NB: leave c++ enabled so devd can be built +CONF_BUILD=" +WITHOUT_ACPI=true +WITHOUT_ATM=true +WITHOUT_AUDIT=true +WITHOUT_BIND_DNSSEC=true +WITHOUT_BIND_ETC=true +WITHOUT_BIND_LIBS_LWRES=true +WITHOUT_BLUETOOTH=true +WITHOUT_CALENDAR=true +WITHOUT_CVS=true +WITHOUT_DICT=true +WITHOUT_EXAMPLES=true +WITHOUT_FORTRAN=true +WITHOUT_GAMES=true +WITHOUT_GCOV=true +WITHOUT_GPIB=true +WITHOUT_HTML=true +WITHOUT_I4B=true +WITHOUT_IPFILTER=true +WITHOUT_IPX=true +WITHOUT_LIBKSE=true +WITHOUT_LOCALES=true +WITHOUT_LPR=true +WITHOUT_MAN=true +WITHOUT_NETCAT=true +WITHOUT_NIS=true +WITHOUT_NLS=true +WITHOUT_NS_CACHING=true +WITHOUT_OBJC=true +WITHOUT_PROFILE=true +WITHOUT_RCMDS=true +WITHOUT_SENDMAIL=true +WITHOUT_SHAREDOCS=true +WITHOUT_SYSCONS=true +WITHOUT_LIB32=true +" +CONF_INSTALL="$CONF_BUILD +INSTALL_NODEBUG=t +NOPORTDOCS=t +NO_INSTALL_MANPAGES=t +" +# The following would help... +# WITHOUT_TOOLCHAIN=true can't build ports +# WITHOUT_INSTALLLIB=true libgcc.a +# +# from the build +# WITHOUT_INFO=true makeinfo +# WITHOUT_RCS=true +PKG_ONLY_MAKE_CONF=" +WITHOUT_TOOLCHAIN=true +WITHOUT_INSTALLLIB=true +WITHOUT_INFO=true +WITHOUT_RCS=true +" + +NANO_PACKAGE_ONLY=1 + +CR() +{ + chroot ${NANO_WORLDDIR} /bin/sh -exc "$*" +} + +# install a package from a pre-built binary +do_add_pkg () +{ + # Need to create ${NANO_OBJ}/ports in this add_pkg_${port} function + set -x + mkdir -p ${NANO_OBJ}/ports/distfiles + mkdir -p ${NANO_OBJ}/ports/packages + mkdir -p ${NANO_WORLDDIR}/usr/ports/packages + mkdir -p ${NANO_WORLDDIR}/usr/ports/distfiles + mount -t nullfs -o noatime ${NANO_OBJ}/ports/packages \ + ${NANO_WORLDDIR}/usr/ports/packages + mount -t nullfs -o noatime ${NANO_OBJ}/ports/distfiles \ + ${NANO_WORLDDIR}/usr/ports/distfiles + CR "cd /usr/ports/packages/All;pkg_add -F $1.tbz" + umount ${NANO_WORLDDIR}/usr/ports/distfiles + umount ${NANO_WORLDDIR}/usr/ports/packages + rmdir ${NANO_WORLDDIR}/usr/ports/packages + rmdir ${NANO_WORLDDIR}/usr/ports/distfiles + rmdir ${NANO_WORLDDIR}/usr/ports + set +x +} + +# Build a port (with the side effect of creating a package) +do_add_port () +{ + local port_path + port_path=$1 + shift + set -x + # Need to create ${NANO_OBJ}/ports in this add_port_${port} function + mkdir -p ${NANO_OBJ}/ports/distfiles + mkdir -p ${NANO_OBJ}/ports/packages + mkdir -p ${NANO_PORTS}/packages + mkdir -p ${NANO_PORTS}/distfiles + mkdir -p ${NANO_WORLDDIR}/usr/src + mkdir -p ${NANO_WORLDDIR}/usr/ports + mount -t nullfs -o noatime ${NANO_SRC} ${NANO_WORLDDIR}/usr/src + mount -t nullfs -o noatime ${NANO_PORTS} ${NANO_WORLDDIR}/usr/ports + mount -t nullfs -o noatime ${NANO_OBJ}/ports/packages \ + ${NANO_WORLDDIR}/usr/ports/packages + mount -t nullfs -o noatime ${NANO_OBJ}/ports/distfiles \ + ${NANO_WORLDDIR}/usr/ports/distfiles + mkdir -p ${NANO_WORLDDIR}/dev + mount -t devfs devfs ${NANO_WORLDDIR}/dev + mkdir -p ${NANO_WORLDDIR}/usr/workdir + cp /etc/resolv.conf ${NANO_WORLDDIR}/etc/resolv.conf +# Improvement: Don't know why package-recursive don't works here + CR "env UNAME_p=${NANO_ARCH} TARGET=${NANO_ARCH} \ + TARGET_ARCH=${NANO_ARCH} make \ + __MAKE_CONF=${NANO_MAKE_CONF_BUILD} \ + WRKDIRPREFIX=/usr/workdir -C /usr/ports/$port_path \ + package BATCH=yes $* clean FORCE_PKG_REGISTER=t" + rm ${NANO_WORLDDIR}/etc/resolv.conf + rm -rf ${NANO_WORLDDIR}/usr/obj + rm -rf ${NANO_WORLDDIR}/usr/workdir + umount ${NANO_WORLDDIR}/dev + umount ${NANO_WORLDDIR}/usr/ports/packages + umount ${NANO_WORLDDIR}/usr/ports/distfiles + umount ${NANO_WORLDDIR}/usr/ports + umount ${NANO_WORLDDIR}/usr/src + set +x +} + +# Need to check if this function works with cross-compiling architecture!!!! +# Recursive complex fonction: Generate one function for each ports +add_port () { + local port_path=$1 + local port=`echo $1 | sed -e 's/\//_/'` + export PORTSDIR=${NANO_PORTS} + shift + # Check if package allready exist + # Need to: + # 1. check ARCH of this package! + # 2. Add a trap + cd ${NANO_PORTS}/${port_path} + PKG_NAME=`make ${PKGNAME_HACK} PORTSDIR=${NANO_PORTS} __MAKE_CONF=${NANO_MAKE_CONF_BUILD} package-name` + if [ -f ${NANO_OBJ}/ports/packages/All/${PKG_NAME}.tbz ]; then + # Pkg file found: Generate add_pkg_NAME function + eval " + add_pkg_${port} () { + do_add_pkg ${PKG_NAME} + } + customize_cmd add_pkg_${port} + " + else + # No pkg file: Generate add_port_NAME function + eval " + add_port_${port} () { + do_add_port ${port_path} $* + } + customize_cmd add_port_${port} + " + NANO_PACKAGE_ONLY=0 + fi +} + +die() +{ + echo "$*" + exit 1 +} + +create_amd64_diskimage() +{ + create_i386_diskimage "$*" +} + +rp=$(realpath ${NANO_OBJ}/) +__a=`mount | grep ${rp} | awk '{print length($3), $3;}' | sort -rn | awk '{$1=""; print;}'` +if [ -n "$__a" ]; then + echo "unmounting $__a" + umount $__a +fi + +NANO_BOOTLOADER="boot/boot0" Added: head/tools/tools/nanobsd/dhcpd/os-base ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/nanobsd/dhcpd/os-base Fri Apr 18 17:03:09 2014 (r264656) @@ -0,0 +1,244 @@ +# $FreeBSD$ + +#- +# Copyright (c) 2014 Warner Losh. All Rights Reserved. +# Copyright (c) 2010-2011 iXsystems, Inc., All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL iXsystems, Inc. OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# This file is heavily derived from both Sam Leffler's Avilia config, +# as well as the BSDRP project's config file. Neither of these have +# an explicit copyright/license statement, but are implicitly BSDL. This +# example has been taken from the FreeNAS project and simplified to meet +# the needs of the example. +# + +# Pull in common definitions. +. common + +NANO_BOOT0CFG="-o packet -s 1 -m 3 -t 18" + +# /var -> ~10MB (look through rc.initdiskless for the formula of how this +# number is calculated out). Since we hope to run +NANO_RAM_TMPVARSIZE=10240 + +NANO_IMAGES=2 +FlashDevice generic 2g + +if [ "$DEBUG" = 1 ]; then + DEBUG_BUILD=" +DEBUG_FLAGS= -g +" +else + DEBUG_INSTALL=" +INSTALL_NODEBUG= t +" +fi + +CONF_INSTALL="$CONF_BUILD +${DEBUG_BUILD} +" +CONF_INSTALL="$CONF_INSTALL +${DEBUG_INSTALL} +" + +add_port security/sudo +add_port ftp/curl + +if [ "${NANO_PACKAGE_ONLY}" -eq 1 ]; then + CONF_INSTALL="${CONF_INSTALL} +${PKG_ONLY_MAKE_CONF} +" + echo "Automatically building a thin image with packages" +else + echo "Automatically building a * * F A T * * image so we can build ports" +fi + +VARS="MASTER_SITE_BACKUP MASTER_SITE_OVERRIDE PACKAGEROOT PACKAGESITE" + +for var in $VARS; do + val=$(eval echo "\$$var") + if [ -n "$val" ]; then + CONF_INSTALL="${CONF_INSTALL} +$var=$val" + fi +done + +if [ "$PACKAGE_PREP_BUILD" = 1 ]; then + echo "Skipping post-package customize steps" + do_image=false +else + +hack_nsswitch_conf ( ) +{ + # Remove all references to NIS in the nsswitch.conf file + # Not sure this is still needed, but FreeNAS has it... + sed -i.bak -es/nis/files/g ${NANO_WORLDDIR}/etc/nsswitch.conf + rm -f ${NANO_WORLDDIR}/etc/nsswitch.conf.bak +} +customize_cmd hack_nsswitch_conf + +save_build ( ) +{ + VERSION_FILE=${NANO_WORLDDIR}/etc/version + if [ "${SVNREVISION}" = "${REVISION}" ]; then + echo "${NANO_NAME}" > "${VERSION_FILE}" + else + echo "${NANO_NAME} (${SVNREVISION})" > "${VERSION_FILE}" + fi +} +customize_cmd save_build + +# Move the $world/data to the /data partion +move_data() +{ + db=${NANO_WORLDDIR}/data + rm -rf ${NANO_DATADIR} + mkdir -p ${NANO_DATADIR} + ( cd ${db} ; find . | cpio -R root:wheel -dumpv ${NANO_DATADIR} ) + rm -rf ${db} +} +customize_cmd move_data + +add_data_to_fstab ( ) +{ + ( + cd ${NANO_WORLDDIR} + echo "/dev/${NANO_DRIVE}s4 /data ufs rw,noatime 2 2" >> etc/fstab + mkdir -p data + ) + +} +customize_cmd add_data_to_fstab + +remove_patch_divots ( ) +{ + find ${NANO_WORLDDIR} -name \*.orig -or -name \*.rej -delete +} +customize_cmd remove_patch_divots + +configure_mnt_md ( ) +{ + mkdir -m 755 -p ${NANO_WORLDDIR}/conf/base/mnt + echo 2048 > ${NANO_WORLDDIR}/conf/base/mnt/md_size +} +customize_cmd configure_mnt_md + +shrink_md_fbsize() +{ + # We have a lot of little files on our memory disks. Let's decrease + # the block and frag size to fit more little files on them (this + # halves our space requirement by ~50% on /etc and /var on 8.x -- + # and gives us more back on 9.x as the default block and frag size + # are 4 times larger). + sed -i '' -e 's,-S -i 4096,-S -i 4096 -b 4096 -f 512,' \ + ${NANO_WORLDDIR}/etc/rc.initdiskless +} +customize_cmd shrink_md_fbsize + +if [ "${DEBUG}" = 1 ]; then + +unmute_console_logging() +{ + # /var is small. Don't fill it up with messages from console.log + # because it's a chatty log. + sed -i '' -e 's/#console.info/console.info/' \ + "${NANO_WORLDDIR}/etc/syslog.conf" +} +customize_cmd unmute_console_logging + +fi + +freenas_custom() +{ + gzip -v9 ${NANO_WORLDDIR}/boot/kernel/kernel + + # kill includes (saves 14MB) + find ${NANO_WORLDDIR}/usr/local/include \! -name 'pyconfig.h' -type f | xargs rm -f + + # kill docs (saves 22MB) + rm -rf ${NANO_WORLDDIR}/usr/local/share/doc + rm -rf ${NANO_WORLDDIR}/usr/local/share/gtk-doc + + # and info (2MB) + rm -rf ${NANO_WORLDDIR}/usr/local/info + + # and man pages (4.4MB) + rm -rf ${NANO_WORLDDIR}/usr/local/man + + # and examples (1.7M) + rm -rf ${NANO_WORLDDIR}/usr/local/share/examples + + # and groff_fonts junk (3MB) + rm -rf ${NANO_WORLDDIR}/usr/share/groff_font + rm -rf ${NANO_WORLDDIR}/usr/share/tmac + rm -rf ${NANO_WORLDDIR}/usr/share/me + + # Kill all .a's and .la's that are installed (20MB+) + find ${NANO_WORLDDIR} -name \*.a -or -name \*.la -delete + + # magic.mgc is just a speed optimization. Kill it for 1.7MB + rm -f ${NANO_WORLDDIR}/usr/share/misc/magic.mgc + + # strip binaries (saves spaces on non-debug images). + if [ "${DEBUG}" != 1 ]; then + pprint 4 "Stripping binaries and libraries" + for dir in $(find ${NANO_WORLDDIR}/usr/local -name '*bin' -or -name 'libexec' -maxdepth 3); do + for f in $(find $dir -type f); do + if ! dontstrip "$f" + then + strip 2>/dev/null $f || : + fi + done + done + # .so's are the only thing that need to be stripped. The rest + # should remain untouched. + for f in $(find ${NANO_WORLDDIR}/usr/local/lib -name '*.so' -or -name '*.so.*' -maxdepth 3); do + strip 2>/dev/null $f || : + done + fi + + # Last second tweaks + chown -R root:wheel ${NANO_WORLDDIR}/root + chmod 0755 ${NANO_WORLDDIR}/root/* + chmod 0755 ${NANO_WORLDDIR}/* + chmod 0440 ${NANO_WORLDDIR}/usr/local/etc/sudoers + chown -R root:wheel ${NANO_WORLDDIR}/etc + chown -R root:wheel ${NANO_WORLDDIR}/boot + chown root:wheel ${NANO_WORLDDIR}/ + chown root:wheel ${NANO_WORLDDIR}/usr + find ${NANO_WORLDDIR} -type f -name "*~" -delete + find ${NANO_WORLDDIR}/usr/local -type f -name "*.po" -delete + find ${NANO_WORLDDIR} -type f -name "*.service" -delete + mkdir ${NANO_WORLDDIR}/data/zfs + ln -s -f /usr/local/bin/bash ${NANO_WORLDDIR}/bin/bash + ln -s -f /data/zfs/zpool.cache ${NANO_WORLDDIR}/boot/zfs/zpool.cache + + # This is wrong. Needs a way to tell kernel how to find the mount utility + # instead. + mv ${NANO_WORLDDIR}/sbin/mount_ntfs ${NANO_WORLDDIR}/sbin/mount_ntfs-kern + ln -s -f /usr/local/bin/ntfs-3g ${NANO_WORLDDIR}/sbin/mount_ntfs + +} +late_customize_cmd freenas_custom + +fi # [ $PACKAGE_PREP_BUILD = 1 ] From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 17:03:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3A85896; Fri, 18 Apr 2014 17:03:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B037616AD; Fri, 18 Apr 2014 17:03:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IH3a56050313; Fri, 18 Apr 2014 17:03:36 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IH3Zn4050308; Fri, 18 Apr 2014 17:03:35 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404181703.s3IH3Zn4050308@svn.freebsd.org> From: Warner Losh Date: Fri, 18 Apr 2014 17:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264657 - head/sys/fs/nandfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 17:03:36 -0000 Author: imp Date: Fri Apr 18 17:03:35 2014 New Revision: 264657 URL: http://svnweb.freebsd.org/changeset/base/264657 Log: More properly account for free/reserved segments to avoid deadlock or worse when filling up a device and then trying to erase files to make space. Without enough space, you can't do that. Also, ensure that the metadata writes don't generate ENOSPC. They will be retried later since the buffers are still dirty... Submitted by: mjg@ Modified: head/sys/fs/nandfs/bmap.c head/sys/fs/nandfs/nandfs.h head/sys/fs/nandfs/nandfs_subr.c head/sys/fs/nandfs/nandfs_vfsops.c Modified: head/sys/fs/nandfs/bmap.c ============================================================================== --- head/sys/fs/nandfs/bmap.c Fri Apr 18 17:03:09 2014 (r264656) +++ head/sys/fs/nandfs/bmap.c Fri Apr 18 17:03:35 2014 (r264657) @@ -387,11 +387,10 @@ bmap_truncate_indirect(struct nandfs_nod if (modified) bcopy(copy, bp->b_data, fsdev->nd_blocksize); - error = nandfs_dirty_buf_meta(bp, 0); - if (error) - return (error); + /* Force success even if we can't dirty the buffer metadata when freeing space */ + nandfs_dirty_buf_meta(bp, 1); - return (error); + return (0); } int Modified: head/sys/fs/nandfs/nandfs.h ============================================================================== --- head/sys/fs/nandfs/nandfs.h Fri Apr 18 17:03:09 2014 (r264656) +++ head/sys/fs/nandfs/nandfs.h Fri Apr 18 17:03:35 2014 (r264657) @@ -200,6 +200,8 @@ struct nandfs_device { uint32_t nd_devblocksize; + uint32_t nd_segs_reserved; + /* Segment usage */ uint64_t nd_clean_segs; uint64_t *nd_free_base; Modified: head/sys/fs/nandfs/nandfs_subr.c ============================================================================== --- head/sys/fs/nandfs/nandfs_subr.c Fri Apr 18 17:03:09 2014 (r264656) +++ head/sys/fs/nandfs/nandfs_subr.c Fri Apr 18 17:03:35 2014 (r264657) @@ -910,7 +910,7 @@ nandfs_fs_full(struct nandfs_device *nff DPRINTF(BUF, ("%s: bufs:%jx space:%jx\n", __func__, (uintmax_t)nffsdev->nd_dirty_bufs, (uintmax_t)space)); - if (nffsdev->nd_dirty_bufs + (10 * bps) >= space) + if (nffsdev->nd_dirty_bufs + (nffsdev->nd_segs_reserved * bps) >= space) return (1); return (0); Modified: head/sys/fs/nandfs/nandfs_vfsops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vfsops.c Fri Apr 18 17:03:09 2014 (r264656) +++ head/sys/fs/nandfs/nandfs_vfsops.c Fri Apr 18 17:03:35 2014 (r264657) @@ -718,15 +718,24 @@ nandfs_mount_base(struct nandfs_device * nandfsdev->nd_ts.tv_sec = nandfsdev->nd_last_segsum.ss_create; nandfsdev->nd_last_cno = nandfsdev->nd_super.s_last_cno; nandfsdev->nd_fakevblk = 1; + /* + * FIXME: bogus calculation. Should use actual number of usable segments + * instead of total amount. + */ + nandfsdev->nd_segs_reserved = + nandfsdev->nd_fsdata.f_nsegments * + nandfsdev->nd_fsdata.f_r_segments_percentage / 100; nandfsdev->nd_last_ino = NANDFS_USER_INO; DPRINTF(VOLUMES, ("%s: last_pseg %#jx last_cno %#jx last_seq %#jx\n" - "fsdev: last_seg: seq %#jx num %#jx, next_seg_num %#jx\n", + "fsdev: last_seg: seq %#jx num %#jx, next_seg_num %#jx " + "segs_reserved %#jx\n", __func__, (uintmax_t)nandfsdev->nd_last_pseg, (uintmax_t)nandfsdev->nd_last_cno, (uintmax_t)nandfsdev->nd_seg_sequence, (uintmax_t)nandfsdev->nd_seg_sequence, (uintmax_t)nandfsdev->nd_seg_num, - (uintmax_t)nandfsdev->nd_next_seg_num)); + (uintmax_t)nandfsdev->nd_next_seg_num, + (uintmax_t)nandfsdev->nd_segs_reserved)); DPRINTF(VOLUMES, ("nandfs_mount: accepted super root\n")); From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 17:03:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 181B39F7; Fri, 18 Apr 2014 17:03:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E977E16AF; Fri, 18 Apr 2014 17:03:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IH3iBv050376; Fri, 18 Apr 2014 17:03:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IH3iEO050373; Fri, 18 Apr 2014 17:03:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404181703.s3IH3iEO050373@svn.freebsd.org> From: Warner Losh Date: Fri, 18 Apr 2014 17:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264658 - head/sys/fs/nandfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 17:03:45 -0000 Author: imp Date: Fri Apr 18 17:03:43 2014 New Revision: 264658 URL: http://svnweb.freebsd.org/changeset/base/264658 Log: Take out the hack to write -1's to non-NAND. Always do a BIO_DELETE on the ranges we want to erase. This is nicer to SSDs that want TRIMs anyway. Modified: head/sys/fs/nandfs/nandfs.h head/sys/fs/nandfs/nandfs_subr.c head/sys/fs/nandfs/nandfs_vfsops.c Modified: head/sys/fs/nandfs/nandfs.h ============================================================================== --- head/sys/fs/nandfs/nandfs.h Fri Apr 18 17:03:35 2014 (r264657) +++ head/sys/fs/nandfs/nandfs.h Fri Apr 18 17:03:43 2014 (r264658) @@ -159,8 +159,6 @@ struct nandfs_device { int nd_syncer_exit; int nd_cleaner_exit; - int nd_is_nand; - struct nandfs_fsarea nd_fsarea[NANDFS_NFSAREAS]; int nd_last_fsarea; Modified: head/sys/fs/nandfs/nandfs_subr.c ============================================================================== --- head/sys/fs/nandfs/nandfs_subr.c Fri Apr 18 17:03:35 2014 (r264657) +++ head/sys/fs/nandfs/nandfs_subr.c Fri Apr 18 17:03:43 2014 (r264658) @@ -1065,42 +1065,12 @@ nandfs_buf_check(struct buf *bp, uint32_ int nandfs_erase(struct nandfs_device *fsdev, off_t offset, size_t size) { - struct buf *bp; - int read_size, error, i; - DPRINTF(BLOCK, ("%s: performing erase at offset %jx size %zx\n", __func__, offset, size)); MPASS(size % fsdev->nd_erasesize == 0); - if (fsdev->nd_is_nand) { - error = g_delete_data(fsdev->nd_gconsumer, offset, size); - return (error); - } - - if (size > MAXBSIZE) - read_size = MAXBSIZE; - else - read_size = size; - - error = 0; - for (i = 0; i < size / MAXBSIZE; i++) { - error = bread(fsdev->nd_devvp, btodb(offset + i * read_size), - read_size, NOCRED, &bp); - if (error) { - brelse(bp); - return (error); - } - memset(bp->b_data, 0xff, read_size); - error = bwrite(bp); - if (error) { - nandfs_error("%s: err:%d from bwrite\n", - __func__, error); - return (error); - } - } - - return (error); + return (g_delete_data(fsdev->nd_gconsumer, offset, size)); } int Modified: head/sys/fs/nandfs/nandfs_vfsops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vfsops.c Fri Apr 18 17:03:35 2014 (r264657) +++ head/sys/fs/nandfs/nandfs_vfsops.c Fri Apr 18 17:03:43 2014 (r264658) @@ -913,7 +913,6 @@ nandfs_mount_device(struct vnode *devvp, * We conclude that this is not NAND storage */ nandfsdev->nd_erasesize = NANDFS_DEF_ERASESIZE; - nandfsdev->nd_is_nand = 0; } else { DROP_GIANT(); g_topology_lock(); @@ -924,11 +923,10 @@ nandfs_mount_device(struct vnode *devvp, free(nandfsdev, M_NANDFSMNT); return (error); } - } else { - nandfsdev->nd_erasesize = erasesize; - nandfsdev->nd_is_nand = 1; } + nandfsdev->nd_erasesize = erasesize; + DPRINTF(VOLUMES, ("%s: erasesize %x\n", __func__, nandfsdev->nd_erasesize)); From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 17:03:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF7AEB2D; Fri, 18 Apr 2014 17:03:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91BB716B3; Fri, 18 Apr 2014 17:03:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IH3oZN050435; Fri, 18 Apr 2014 17:03:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IH3njS050431; Fri, 18 Apr 2014 17:03:49 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404181703.s3IH3njS050431@svn.freebsd.org> From: Warner Losh Date: Fri, 18 Apr 2014 17:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264659 - in head/share: examples/etc man/man5 mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 17:03:50 -0000 Author: imp Date: Fri Apr 18 17:03:49 2014 New Revision: 264659 URL: http://svnweb.freebsd.org/changeset/base/264659 Log: Convert NO_MANCOMPRESSED to MK_MANCOMPRESSED. Modified: head/share/examples/etc/make.conf head/share/man/man5/make.conf.5 head/share/mk/bsd.man.mk head/share/mk/bsd.own.mk Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Fri Apr 18 17:03:43 2014 (r264658) +++ head/share/examples/etc/make.conf Fri Apr 18 17:03:49 2014 (r264659) @@ -138,7 +138,7 @@ # If you do not want unformatted manual pages to be compressed # when they are installed: # -#NO_MANCOMPRESS= +#WITHOUT_MANCOMPRESS=t # # # Default format for system documentation, depends on your printer. Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Fri Apr 18 17:03:43 2014 (r264658) +++ head/share/man/man5/make.conf.5 Fri Apr 18 17:03:49 2014 (r264659) @@ -434,8 +434,11 @@ Set this to run .Dq Li "${MAKE} clean" instead of .Dq Li "${MAKE} cleandir" . -.It Va NO_MANCOMPRESS -.Pq Vt bool +.It Va WITH_MANCOMPRESS +.Pq Vt defined +Set to install manual pages compressed. +.It Va WITHOUT_MANCOMPRESS +.Pq Vt defined Set to install manual pages uncompressed. .It Va NO_SHARE .Pq Vt bool Modified: head/share/mk/bsd.man.mk ============================================================================== --- head/share/mk/bsd.man.mk Fri Apr 18 17:03:43 2014 (r264658) +++ head/share/mk/bsd.man.mk Fri Apr 18 17:03:49 2014 (r264659) @@ -30,9 +30,6 @@ # second, and there may be multiple pairs. The files # are hard-linked. # -# NO_MANCOMPRESS If you do not want unformatted manual pages to be -# compressed when they are installed. [not set] -# # NO_MLINKS If you do not want install manual page links. [not set] # # MANFILTER command to pipe the raw man page through before compressing @@ -77,10 +74,10 @@ MAN+= ${MAN${__sect}} _manpages: all-man: _manpages -.if defined(NO_MANCOMPRESS) +.if ${MK_MANCOMPRESS} == "no" # Make special arrangements to filter to a temporary file at build time -# for NO_MANCOMPRESS. +# for MK_MANCOMPRESS == no. .if defined(MANFILTER) FILTEXTENSION= .filt .else @@ -162,7 +159,7 @@ maninstall: _maninstall _maninstall: .if defined(MAN) && !empty(MAN) _maninstall: ${MAN} -.if defined(NO_MANCOMPRESS) +.if ${MK_MANCOMPRESS} == "no" .if defined(MANFILTER) .for __page in ${MAN} ${MINSTALL} ${__page:T:S/$/${FILTEXTENSION}/g} \ Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Fri Apr 18 17:03:43 2014 (r264658) +++ head/share/mk/bsd.own.mk Fri Apr 18 17:03:49 2014 (r264659) @@ -301,6 +301,7 @@ __DEFAULT_YES_OPTIONS = \ MAILWRAPPER \ MAKE \ MAN \ + MANCOMPRESS \ NCURSESW \ NDIS \ NETCAT \ @@ -459,6 +460,8 @@ MK_${var}:= no # Supported NO_* options (if defined, MK_* will be forced to "no", # regardless of user's setting). # +# These are transitional and will disappaer in the fullness of time. +# .for var in \ CTF \ DEBUG_FILES \ From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 17:04:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2023C91; Fri, 18 Apr 2014 17:04:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE05416BB; Fri, 18 Apr 2014 17:04:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IH41qr050523; Fri, 18 Apr 2014 17:04:01 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IH3xlg050491; Fri, 18 Apr 2014 17:03:59 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404181703.s3IH3xlg050491@svn.freebsd.org> From: Warner Losh Date: Fri, 18 Apr 2014 17:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264660 - in head: . share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 17:04:01 -0000 Author: imp Date: Fri Apr 18 17:03:58 2014 New Revision: 264660 URL: http://svnweb.freebsd.org/changeset/base/264660 Log: Separate out enabling building clang and/or gcc for the system and building clang and/or gcc as the bootstrap compiler. Normally, the default compiler is used. WITH_CLANG_BOOTSTRAP and/or WITH_GCC_BOOTSTRAP will enable building these compilers as part bootstrap phase. WITH/WITHOUT_CLANG_IS_CC controls which compiler is used by default for the bootstrap phase, as well as which compiler is installed as cc. buildworld now successfully completes building the cross compiler with WITHOUT_CLANG=t and WITHOUT_GCC=t and produces a built system with neither of these included. Similarlly, MK_BINUTILS_BOOTSTRAP controls whether binutils is built during this phase. WITHOUT_CROSS_COMPILER will now force MK_BINUTILS_BOOTSTRAP=no, MK_CLANG_BOOTSTRAP=no and MK_GCC_BOOTSTRAP=no. BOOTSTRAP_COMPILER was considered, but rejected, since pc98 needs both clang and gcc to bootstrap still. It should be revisisted in the future if this requirement goes away. Values should be gcc, clang or none. It could also be a list. The odd interaction with Xfoo cross/external tools needs work, but is beyond the scope of this change as well. Added: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP - copied, changed from r264659, head/tools/build/options/WITHOUT_BINUTILS head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP - copied, changed from r264659, head/tools/build/options/WITHOUT_CLANG head/tools/build/options/WITHOUT_GCC_BOOTSTRAP - copied, changed from r264659, head/tools/build/options/WITHOUT_GCC head/tools/build/options/WITH_CLANG_BOOTSTRAP - copied, changed from r264659, head/tools/build/options/WITHOUT_CLANG head/tools/build/options/WITH_GCC_BOOTSTRAP - copied, changed from r264659, head/tools/build/options/WITHOUT_GCC Modified: head/Makefile.inc1 head/share/mk/bsd.own.mk head/tools/build/options/WITHOUT_BINUTILS head/tools/build/options/WITHOUT_CLANG head/tools/build/options/WITHOUT_CROSS_COMPILER head/tools/build/options/WITHOUT_GCC head/tools/build/options/WITH_CLANG Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Apr 18 17:03:49 2014 (r264659) +++ head/Makefile.inc1 Fri Apr 18 17:03:58 2014 (r264660) @@ -1226,7 +1226,9 @@ _awk= usr.bin/awk _gensnmptree= usr.sbin/bsnmpd/gensnmptree .endif -.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang" || ${MK_CLANG} != "no" +# We need to build tlbgen when we're building clang either as +# the bootstrap compiler, or as the part of the normal build. +.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" _clang_tblgen= \ lib/clang/libllvmsupport \ lib/clang/libllvmtablegen \ @@ -1366,22 +1368,19 @@ _kgzip= usr.sbin/kgzip .endif .endif -.if ${XAS:M/*} == "" && ${MK_BINUTILS} != "no" +# If we're given an XAS, don't build binutils. +.if ${XAS:M/*} == "" && ${MK_BINUTILS_BOOTSTRAP} != "no" _binutils= gnu/usr.bin/binutils .endif # If an full path to an external cross compiler is given, don't build # a cross compiler. .if ${XCC:M/*} == "" && ${MK_CROSS_COMPILER} != "no" -.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang" +.if ${MK_CLANG_BOOTSTRAP} != "no" _clang= usr.bin/clang _clang_libs= lib/clang -.else -_cc= gnu/usr.bin/cc .endif - -# The boot2 for pc98 requires gcc. -.if ${TARGET} == "pc98" +.if ${MK_GCC_BOOTSTRAP} != "no" _cc= gnu/usr.bin/cc .endif .endif Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Fri Apr 18 17:03:49 2014 (r264659) +++ head/share/mk/bsd.own.mk Fri Apr 18 17:03:58 2014 (r264660) @@ -237,6 +237,7 @@ __DEFAULT_YES_OPTIONS = \ AUDIT \ AUTHPF \ BINUTILS \ + BINUTILS_BOOTSTRAP \ BLUETOOTH \ BMAKE \ BOOT \ @@ -387,13 +388,13 @@ __TT=${MACHINE} .endif # Clang is only for x86, powerpc and little-endian arm right now, by default. .if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*} -__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL +__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP .elif ${__T} == "arm" || ${__T} == "armv6" || ${__T} == "armv6hf" -__DEFAULT_YES_OPTIONS+=CLANG +__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP # GCC is unable to build the full clang on arm, disable it by default. __DEFAULT_NO_OPTIONS+=CLANG_FULL .else -__DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL +__DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP .endif # Clang the default system compiler only on little-endian arm and x86. .if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \ @@ -403,14 +404,14 @@ __DEFAULT_NO_OPTIONS+=GNUCXX # The pc98 bootloader requires gcc to build and so we must leave gcc enabled # for pc98 for now. .if ${__TT} == "pc98" -__DEFAULT_YES_OPTIONS+=GCC +__DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP .else -__DEFAULT_NO_OPTIONS+=GCC +__DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP .endif .else # If clang is not cc, then build gcc by default -__DEFAULT_NO_OPTIONS+=CLANG_IS_CC -__DEFAULT_YES_OPTIONS+=GCC GNUCXX +__DEFAULT_NO_OPTIONS+=CLANG_IS_CC CLANG CLANG_BOOTSTRAP +__DEFAULT_YES_OPTIONS+=GCC GNUCXX GCC_BOOTSTRAP .endif # @@ -531,6 +532,12 @@ MK_AUTHPF:= no MK_GROFF:= no .endif +.if ${MK_CROSS_COMPILER} == "no" +MK_BINUTILS_BOOTSTRAP:= no +MK_CLANG_BOOTSTRAP:= no +MK_GCC_BOOTSTRAP:= no +.endif + .if ${MK_TOOLCHAIN} == "no" MK_BINUTILS:= no MK_CLANG:= no Modified: head/tools/build/options/WITHOUT_BINUTILS ============================================================================== --- head/tools/build/options/WITHOUT_BINUTILS Fri Apr 18 17:03:49 2014 (r264659) +++ head/tools/build/options/WITHOUT_BINUTILS Fri Apr 18 17:03:58 2014 (r264660) @@ -1,7 +1,7 @@ .\" $FreeBSD$ -Set to not install binutils (as, c++-filt, gconv, -ld, nm, objcopy, objdump, readelf, size and strip). -.Bf -symbolic -The option does not generally work for build targets, unless some alternative -toolchain is enabled. -.Ef +Set to not build or install binutils (as, c++-filt, gconv, +ld, nm, objcopy, objdump, readelf, size and strip) as part +of the normal system build. +The resulting system cannot build programs from source. + + Copied and modified: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP (from r264659, head/tools/build/options/WITHOUT_BINUTILS) ============================================================================== --- head/tools/build/options/WITHOUT_BINUTILS Fri Apr 18 17:03:49 2014 (r264659, copy source) +++ head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP Fri Apr 18 17:03:58 2014 (r264660) @@ -1,7 +1,8 @@ .\" $FreeBSD$ -Set to not install binutils (as, c++-filt, gconv, -ld, nm, objcopy, objdump, readelf, size and strip). +Set to not build binutils (as, c++-filt, gconv, +ld, nm, objcopy, objdump, readelf, size and strip) +as part of the bootstrap process. .Bf -symbolic -The option does not generally work for build targets, unless some alternative -toolchain is enabled. +The option does not work for build targets unless some alternative +toolchain is provided. .Ef Modified: head/tools/build/options/WITHOUT_CLANG ============================================================================== --- head/tools/build/options/WITHOUT_CLANG Fri Apr 18 17:03:49 2014 (r264659) +++ head/tools/build/options/WITHOUT_CLANG Fri Apr 18 17:03:58 2014 (r264660) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Set to not build the Clang C/C++ compiler. +Set to not build the Clang C/C++ compiler during the regular phase of the build. Copied and modified: head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP (from r264659, head/tools/build/options/WITHOUT_CLANG) ============================================================================== --- head/tools/build/options/WITHOUT_CLANG Fri Apr 18 17:03:49 2014 (r264659, copy source) +++ head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP Fri Apr 18 17:03:58 2014 (r264660) @@ -1,2 +1,5 @@ .\" $FreeBSD$ -Set to not build the Clang C/C++ compiler. +Set to not build the Clang C/C++ compiler during the bootstrap phase of the build. +You must enable wither gcc or clang bootstrap to be able to build the system, +unless an alternative compiiler is provided via +XCC. Modified: head/tools/build/options/WITHOUT_CROSS_COMPILER ============================================================================== --- head/tools/build/options/WITHOUT_CROSS_COMPILER Fri Apr 18 17:03:49 2014 (r264659) +++ head/tools/build/options/WITHOUT_CROSS_COMPILER Fri Apr 18 17:03:58 2014 (r264660) @@ -1,3 +1,13 @@ .\" $FreeBSD$ -Set to not build a cross compiler in the cross-tools stage of -buildworld, buildkernel, etc. +Set to not build any cross compiler in the cross-tools stage of buildworld. +If you are compiling a different version of +.Fx +than what is installed on the system, you will need to provide an alternate +compiler with XCC to ensure success. +If you are compiling with an identical version of +.Fx +to the host, this option may be safely used. +This option may also be safe when the host version of +.Fx +is close to the sources being built, but all bets are off if there have +been any changes to the toolchain between the versions. Modified: head/tools/build/options/WITHOUT_GCC ============================================================================== --- head/tools/build/options/WITHOUT_GCC Fri Apr 18 17:03:49 2014 (r264659) +++ head/tools/build/options/WITHOUT_GCC Fri Apr 18 17:03:58 2014 (r264660) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Set to not build and install gcc and g++. +Set to not build and install gcc and g++ as part of the normal build process. Copied and modified: head/tools/build/options/WITHOUT_GCC_BOOTSTRAP (from r264659, head/tools/build/options/WITHOUT_GCC) ============================================================================== --- head/tools/build/options/WITHOUT_GCC Fri Apr 18 17:03:49 2014 (r264659, copy source) +++ head/tools/build/options/WITHOUT_GCC_BOOTSTRAP Fri Apr 18 17:03:58 2014 (r264660) @@ -1,2 +1,5 @@ .\" $FreeBSD$ -Set to not build and install gcc and g++. +Set to not build gcc and g++ as part of the bootstrap process. +You must enable wither gcc or clang bootstrap to be able to build the system, +unless an alternative compiiler is provided via +XCC. Modified: head/tools/build/options/WITH_CLANG ============================================================================== --- head/tools/build/options/WITH_CLANG Fri Apr 18 17:03:49 2014 (r264659) +++ head/tools/build/options/WITH_CLANG Fri Apr 18 17:03:58 2014 (r264660) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Set to build the Clang C/C++ compiler. +Set to build the Clang C/C++ compiler during the normal phase of the build. Copied and modified: head/tools/build/options/WITH_CLANG_BOOTSTRAP (from r264659, head/tools/build/options/WITHOUT_CLANG) ============================================================================== --- head/tools/build/options/WITHOUT_CLANG Fri Apr 18 17:03:49 2014 (r264659, copy source) +++ head/tools/build/options/WITH_CLANG_BOOTSTRAP Fri Apr 18 17:03:58 2014 (r264660) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Set to not build the Clang C/C++ compiler. +Set to build the Clang C/C++ compiler during the bootstrap phase of the build. Copied and modified: head/tools/build/options/WITH_GCC_BOOTSTRAP (from r264659, head/tools/build/options/WITHOUT_GCC) ============================================================================== --- head/tools/build/options/WITHOUT_GCC Fri Apr 18 17:03:49 2014 (r264659, copy source) +++ head/tools/build/options/WITH_GCC_BOOTSTRAP Fri Apr 18 17:03:58 2014 (r264660) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Set to not build and install gcc and g++. +Set to build gcc and g++ as part of the bootstrap process. From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 17:04:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C285FDD1; Fri, 18 Apr 2014 17:04:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A424916C1; Fri, 18 Apr 2014 17:04:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IH4AAh050592; Fri, 18 Apr 2014 17:04:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IH4AJA050586; Fri, 18 Apr 2014 17:04:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404181704.s3IH4AJA050586@svn.freebsd.org> From: Warner Losh Date: Fri, 18 Apr 2014 17:04:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264661 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 17:04:10 -0000 Author: imp Date: Fri Apr 18 17:04:09 2014 New Revision: 264661 URL: http://svnweb.freebsd.org/changeset/base/264661 Log: Copy bsd.own.mk to bsd.opts.mk and separate out the option setting code from the rest. Include bsd.opts.mk in bsd.own.mk to preserve current behavior. Future revisions will replace the inclusion of bsd.own.mk elsewhere with bsd.opts.mk or a more appropriate new file that's still being finalized. Added: head/share/mk/bsd.opts.mk - copied, changed from r264660, head/share/mk/bsd.own.mk Modified: head/share/mk/Makefile head/share/mk/bsd.own.mk Modified: head/share/mk/Makefile ============================================================================== --- head/share/mk/Makefile Fri Apr 18 17:03:58 2014 (r264660) +++ head/share/mk/Makefile Fri Apr 18 17:04:09 2014 (r264661) @@ -24,6 +24,7 @@ FILES= \ bsd.man.mk \ bsd.nls.mk \ bsd.obj.mk \ + bsd.opts.mk \ bsd.own.mk \ bsd.port.mk \ bsd.port.options.mk \ Copied and modified: head/share/mk/bsd.opts.mk (from r264660, head/share/mk/bsd.own.mk) ============================================================================== --- head/share/mk/bsd.own.mk Fri Apr 18 17:03:58 2014 (r264660, copy source) +++ head/share/mk/bsd.opts.mk Fri Apr 18 17:04:09 2014 (r264661) @@ -1,221 +1,48 @@ # $FreeBSD$ # -# The include file set common variables for owner, -# group, mode, and directories. Defaults are in brackets. +# Option file for src builds. # +# Users define WITH_FOO and WITHOUT_FOO on the command line or in /etc/src.conf +# and /etc/make.conf files. These translate in the build system to MK_FOO={yes,no} +# with sensible (usually) defaults. # -# +++ variables +++ +# Makefiles must include bsd.opts.mk after defining specific MK_FOO options that +# are applicable for that Makefile (typically there are none, but sometimes there +# are exceptions). Recursive makes usually add MK_FOO=no for options that they wish +# to omit from that make. # -# DESTDIR Change the tree where the file gets installed. [not set] +# Makefiles must include bsd.srcpot.mk before they test the value of any MK_FOO +# variable. # -# DISTDIR Change the tree where the file for a distribution -# gets installed (see /usr/src/release/Makefile). [not set] +# Makefiles may also assume that this file is included by bsd.own.mk should it +# need variables defined there prior to the end of the Makefile where +# bsd.{subdir,lib.bin}.mk is traditionally included. # -# COMPRESS_CMD Program to compress documents. -# Output is to stdout. [gzip -cn] +# The old-style YES_FOO and NO_FOO are being phased out. No new instances of them +# should be added. Old instances should be removed since they were just to +# bridge the gap between FreeBSD 4 and FreeBSD 5. # -# COMPRESS_EXT File name extension of ${COMPRESS_CMD} command. [.gz] +# Makefiles should never test WITH_FOO or WITHOUT_FOO directly (although an +# exception is made for _WITHOUT_SRCONF which turns off this mechanism +# completely). # -# BINOWN Binary owner. [root] -# -# BINGRP Binary group. [wheel] -# -# BINMODE Binary mode. [555] -# -# NOBINMODE Mode for non-executable files. [444] -# -# LIBDIR Base path for libraries. [/usr/lib] -# -# LIBCOMPATDIR Base path for compat libraries. [/usr/lib/compat] -# -# LIBPRIVATEDIR Base path for private libraries. [/usr/lib/private] -# -# LIBDATADIR Base path for misc. utility data files. [/usr/libdata] -# -# LIBEXECDIR Base path for system daemons and utilities. [/usr/libexec] -# -# LINTLIBDIR Base path for lint libraries. [/usr/libdata/lint] -# -# SHLIBDIR Base path for shared libraries. [${LIBDIR}] -# -# LIBOWN Library owner. [${BINOWN}] -# -# LIBGRP Library group. [${BINGRP}] -# -# LIBMODE Library mode. [${NOBINMODE}] -# -# -# DEBUGDIR Base path for standalone debug files. [/usr/lib/debug] -# -# DEBUGMODE Mode for debug files. [${NOBINMODE}] -# -# -# KMODDIR Base path for loadable kernel modules -# (see kld(4)). [/boot/kernel] -# -# KMODOWN Kernel and KLD owner. [${BINOWN}] -# -# KMODGRP Kernel and KLD group. [${BINGRP}] -# -# KMODMODE KLD mode. [${BINMODE}] -# -# -# SHAREDIR Base path for architecture-independent ascii -# text files. [/usr/share] -# -# SHAREOWN ASCII text file owner. [root] -# -# SHAREGRP ASCII text file group. [wheel] -# -# SHAREMODE ASCII text file mode. [${NOBINMODE}] -# -# -# CONFDIR Base path for configuration files. [/etc] -# -# CONFOWN Configuration file owner. [root] -# -# CONFGRP Configuration file group. [wheel] -# -# CONFMODE Configuration file mode. [644] -# -# -# DOCDIR Base path for system documentation (e.g. PSD, USD, -# handbook, FAQ etc.). [${SHAREDIR}/doc] -# -# DOCOWN Documentation owner. [${SHAREOWN}] -# -# DOCGRP Documentation group. [${SHAREGRP}] -# -# DOCMODE Documentation mode. [${NOBINMODE}] -# -# -# INFODIR Base path for GNU's hypertext system -# called Info (see info(1)). [${SHAREDIR}/info] -# -# INFOOWN Info owner. [${SHAREOWN}] -# -# INFOGRP Info group. [${SHAREGRP}] -# -# INFOMODE Info mode. [${NOBINMODE}] -# -# -# MANDIR Base path for manual installation. [${SHAREDIR}/man/man] -# -# MANOWN Manual owner. [${SHAREOWN}] -# -# MANGRP Manual group. [${SHAREGRP}] -# -# MANMODE Manual mode. [${NOBINMODE}] -# -# -# NLSDIR Base path for National Language Support files -# installation. [${SHAREDIR}/nls] -# -# NLSOWN National Language Support files owner. [${SHAREOWN}] -# -# NLSGRP National Language Support files group. [${SHAREGRP}] -# -# NLSMODE National Language Support files mode. [${NOBINMODE}] -# -# INCLUDEDIR Base path for standard C include files [/usr/include] -.if !target(____) -____: +.if !target(____) +____: .if !defined(_WITHOUT_SRCCONF) SRCCONF?= /etc/src.conf .if exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf" .include "${SRCCONF}" .endif -.endif - -# Binaries -BINOWN?= root -BINGRP?= wheel -BINMODE?= 555 -NOBINMODE?= 444 - -.if defined(MODULES_WITH_WORLD) -KMODDIR?= /boot/modules -.else -KMODDIR?= /boot/kernel -.endif -KMODOWN?= ${BINOWN} -KMODGRP?= ${BINGRP} -KMODMODE?= ${BINMODE} - -LIBDIR?= /usr/lib -LIBCOMPATDIR?= /usr/lib/compat -LIBPRIVATEDIR?= /usr/lib/private -LIBDATADIR?= /usr/libdata -LIBEXECDIR?= /usr/libexec -LINTLIBDIR?= /usr/libdata/lint -SHLIBDIR?= ${LIBDIR} -LIBOWN?= ${BINOWN} -LIBGRP?= ${BINGRP} -LIBMODE?= ${NOBINMODE} - -DEBUGDIR?= /usr/lib/debug -DEBUGMODE?= ${NOBINMODE} - - -# Share files -SHAREDIR?= /usr/share -SHAREOWN?= root -SHAREGRP?= wheel -SHAREMODE?= ${NOBINMODE} - -CONFDIR?= /etc -CONFOWN?= root -CONFGRP?= wheel -CONFMODE?= 644 - -MANDIR?= ${SHAREDIR}/man/man -MANOWN?= ${SHAREOWN} -MANGRP?= ${SHAREGRP} -MANMODE?= ${NOBINMODE} - -DOCDIR?= ${SHAREDIR}/doc -DOCOWN?= ${SHAREOWN} -DOCGRP?= ${SHAREGRP} -DOCMODE?= ${NOBINMODE} - -INFODIR?= ${SHAREDIR}/info -INFOOWN?= ${SHAREOWN} -INFOGRP?= ${SHAREGRP} -INFOMODE?= ${NOBINMODE} - -NLSDIR?= ${SHAREDIR}/nls -NLSOWN?= ${SHAREOWN} -NLSGRP?= ${SHAREGRP} -NLSMODE?= ${NOBINMODE} - -INCLUDEDIR?= /usr/include - -# -# install(1) parameters. -# -HRDLINK?= -l h -SYMLINK?= -l s - -INSTALL_LINK?= ${INSTALL} ${HRDLINK} -INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK} - -# Common variables -.if !defined(DEBUG_FLAGS) -STRIP?= -s -.endif - -COMPRESS_CMD?= gzip -cn -COMPRESS_EXT?= .gz -.if !defined(_WITHOUT_SRCCONF) # # Define MK_* variables (which are either "yes" or "no") for users # to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the # make(1) environment. # These should be tested with `== "no"' or `!= "no"' in makefiles. -# The NO_* variables should only be set by makefiles. +# The NO_* variables should only be set by makefiles for variables +# that haven't been converted over. # # @@ -375,6 +202,8 @@ __DEFAULT_NO_OPTIONS = \ # as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not # used at all in bsd.*.mk, but we have to make an exception here if we want # to allow defaults for some things like clang to vary by target architecture. +# Additional, per-target behavior should be rarely added only after much +# gnashing of teeth and grinding of gears. # .if defined(TARGET_ARCH) __T=${TARGET_ARCH} @@ -636,32 +465,6 @@ MK_${var}:= no MK_LLDB:= no .endif -.if ${MK_CTF} != "no" -CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300) -CTFCONVERT_CMD= -.else -CTFCONVERT_CMD= @: -.endif - -.if ${MK_INSTALL_AS_USER} != "no" -_uid!= id -u -.if ${_uid} != 0 -.if !defined(USER) -USER!= id -un -.endif -_gid!= id -gn -.for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE -$xOWN= ${USER} -$xGRP= ${_gid} -.endfor -.endif -.endif - .endif # !_WITHOUT_SRCCONF -# Pointer to the top directory into which tests are installed. Should not be -# overriden by Makefiles, but the user may choose to set this in src.conf(5). -TESTSBASE?= /usr/tests - -.endif # !target(____) +.endif Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Fri Apr 18 17:03:58 2014 (r264660) +++ head/share/mk/bsd.own.mk Fri Apr 18 17:04:09 2014 (r264661) @@ -122,13 +122,34 @@ .if !target(____) ____: +.include + .if !defined(_WITHOUT_SRCCONF) -SRCCONF?= /etc/src.conf -.if exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf" -.include "${SRCCONF}" + +.if ${MK_CTF} != "no" +CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300) +CTFCONVERT_CMD= +.else +CTFCONVERT_CMD= @: +.endif + +.if ${MK_INSTALL_AS_USER} != "no" +_uid!= id -u +.if ${_uid} != 0 +.if !defined(USER) +USER!= id -un +.endif +_gid!= id -gn +.for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE +$xOWN= ${USER} +$xGRP= ${_gid} +.endfor .endif .endif +.endif # !_WITHOUT_SRCCONF + # Binaries BINOWN?= root BINGRP?= wheel @@ -209,457 +230,6 @@ STRIP?= -s COMPRESS_CMD?= gzip -cn COMPRESS_EXT?= .gz -.if !defined(_WITHOUT_SRCCONF) -# -# Define MK_* variables (which are either "yes" or "no") for users -# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the -# make(1) environment. -# These should be tested with `== "no"' or `!= "no"' in makefiles. -# The NO_* variables should only be set by makefiles. -# - -# -# Older-style variables that enabled behaviour when set. -# -.if defined(YES_HESIOD) -WITH_HESIOD= -.endif - -__DEFAULT_YES_OPTIONS = \ - ACCT \ - ACPI \ - AMD \ - APM \ - ARM_EABI \ - ASSERT_DEBUG \ - AT \ - ATM \ - AUDIT \ - AUTHPF \ - BINUTILS \ - BINUTILS_BOOTSTRAP \ - BLUETOOTH \ - BMAKE \ - BOOT \ - BSD_CPIO \ - BSNMP \ - BZIP2 \ - CALENDAR \ - CAPSICUM \ - CASPER \ - CDDL \ - CPP \ - CROSS_COMPILER \ - CRYPT \ - CTM \ - CXX \ - DICT \ - DMAGENT \ - DYNAMICROOT \ - ED_CRYPTO \ - EXAMPLES \ - FDT \ - FLOPPY \ - FMTREE \ - FORMAT_EXTENSIONS \ - FORTH \ - FP_LIBC \ - FREEBSD_UPDATE \ - GAMES \ - GCOV \ - GDB \ - GNU \ - GNU_GREP_COMPAT \ - GPIB \ - GPIO \ - GPL_DTC \ - GROFF \ - HTML \ - ICONV \ - INET \ - INET6 \ - INFO \ - INSTALLLIB \ - IPFILTER \ - IPFW \ - JAIL \ - KDUMP \ - KERBEROS \ - KERNEL_SYMBOLS \ - KVM \ - LDNS \ - LDNS_UTILS \ - LEGACY_CONSOLE \ - LIB32 \ - LIBPTHREAD \ - LIBTHR \ - LOCALES \ - LOCATE \ - LPR \ - LS_COLORS \ - LZMA_SUPPORT \ - MAIL \ - MAILWRAPPER \ - MAKE \ - MAN \ - MANCOMPRESS \ - NCURSESW \ - NDIS \ - NETCAT \ - NETGRAPH \ - NIS \ - NLS \ - NLS_CATALOGS \ - NS_CACHING \ - NTP \ - OPENSSH \ - OPENSSL \ - PAM \ - PC_SYSINSTALL \ - PF \ - PKGBOOTSTRAP \ - PMC \ - PORTSNAP \ - PPP \ - PROFILE \ - QUOTAS \ - RCMDS \ - RCS \ - RESCUE \ - ROUTED \ - SENDMAIL \ - SETUID_LOGIN \ - SHAREDOCS \ - SOURCELESS \ - SOURCELESS_HOST \ - SOURCELESS_UCODE \ - SSP \ - SVNLITE \ - SYMVER \ - SYSCALL_COMPAT \ - SYSCONS \ - SYSINSTALL \ - TCSH \ - TELNET \ - TEXTPROC \ - TOOLCHAIN \ - UNBOUND \ - USB \ - UTMPX \ - WIRELESS \ - WPA_SUPPLICANT_EAPOL \ - ZFS \ - ZONEINFO - -__DEFAULT_NO_OPTIONS = \ - BSD_GREP \ - CLANG_EXTRAS \ - CTF \ - DEBUG_FILES \ - EISA \ - HESIOD \ - INSTALL_AS_USER \ - LLDB \ - NAND \ - OFED \ - OPENSSH_NONE_CIPHER \ - SHARED_TOOLCHAIN \ - SORT_THREADS \ - SVN \ - TESTS \ - USB_GADGET_EXAMPLES - -# -# Default behaviour of some options depends on the architecture. Unfortunately -# this means that we have to test TARGET_ARCH (the buildworld case) as well -# as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not -# used at all in bsd.*.mk, but we have to make an exception here if we want -# to allow defaults for some things like clang to vary by target architecture. -# -.if defined(TARGET_ARCH) -__T=${TARGET_ARCH} -.else -__T=${MACHINE_ARCH} -.endif -.if defined(TARGET) -__TT=${TARGET} -.else -__TT=${MACHINE} -.endif -# Clang is only for x86, powerpc and little-endian arm right now, by default. -.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*} -__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP -.elif ${__T} == "arm" || ${__T} == "armv6" || ${__T} == "armv6hf" -__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP -# GCC is unable to build the full clang on arm, disable it by default. -__DEFAULT_NO_OPTIONS+=CLANG_FULL -.else -__DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP -.endif -# Clang the default system compiler only on little-endian arm and x86. -.if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \ - ${__T} == "armv6hf" || ${__T} == "i386" -__DEFAULT_YES_OPTIONS+=CLANG_IS_CC -__DEFAULT_NO_OPTIONS+=GNUCXX -# The pc98 bootloader requires gcc to build and so we must leave gcc enabled -# for pc98 for now. -.if ${__TT} == "pc98" -__DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP -.else -__DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP -.endif -.else -# If clang is not cc, then build gcc by default -__DEFAULT_NO_OPTIONS+=CLANG_IS_CC CLANG CLANG_BOOTSTRAP -__DEFAULT_YES_OPTIONS+=GCC GNUCXX GCC_BOOTSTRAP -.endif - -# -# MK_* options which default to "yes". -# -.for var in ${__DEFAULT_YES_OPTIONS} -.if defined(WITH_${var}) && defined(WITHOUT_${var}) -.error WITH_${var} and WITHOUT_${var} can't both be set. -.endif -.if defined(MK_${var}) -.if defined(.MAKE.LEVEL) && ${.MAKE.LEVEL} == 0 -.error MK_${var} can't be set by a user. -.endif -.else -.if defined(WITHOUT_${var}) -MK_${var}:= no -.else -MK_${var}:= yes -.endif -.endif -.endfor -.undef __DEFAULT_YES_OPTIONS - -# -# MK_* options which default to "no". -# -.for var in ${__DEFAULT_NO_OPTIONS} -.if defined(WITH_${var}) && defined(WITHOUT_${var}) -.error WITH_${var} and WITHOUT_${var} can't both be set. -.endif -.if defined(MK_${var}) -.if defined(.MAKE.LEVEL) && ${.MAKE.LEVEL} == 0 -.error MK_${var} can't be set by a user. -.endif -.else -.if defined(WITH_${var}) -MK_${var}:= yes -.else -MK_${var}:= no -.endif -.endif -.endfor -.undef __DEFAULT_NO_OPTIONS - - -# -# Supported NO_* options (if defined, MK_* will be forced to "no", -# regardless of user's setting). -# -# These are transitional and will disappaer in the fullness of time. -# -.for var in \ - CTF \ - DEBUG_FILES \ - INSTALLLIB \ - MAN \ - PROFILE -.if defined(NO_${var}) -MK_${var}:=no -.endif -.endfor - -# -# Force some options off if their dependencies are off. -# Order is somewhat important. -# -.if ${MK_LIBPTHREAD} == "no" -MK_LIBTHR:= no -.endif - -.if ${MK_LDNS} == "no" -MK_LDNS_UTILS:= no -MK_UNBOUND:= no -.endif - -.if ${MK_SOURCELESS} == "no" -MK_SOURCELESS_HOST:= no -MK_SOURCELESS_UCODE:= no -.endif - -.if ${MK_CDDL} == "no" -MK_ZFS:= no -MK_CTF:= no -.endif - -.if ${MK_CRYPT} == "no" -MK_OPENSSL:= no -MK_OPENSSH:= no -MK_KERBEROS:= no -.endif - -.if ${MK_CXX} == "no" -MK_CLANG:= no -MK_GROFF:= no -.endif - -.if ${MK_MAIL} == "no" -MK_MAILWRAPPER:= no -MK_SENDMAIL:= no -MK_DMAGENT:= no -.endif - -.if ${MK_NETGRAPH} == "no" -MK_ATM:= no -MK_BLUETOOTH:= no -.endif - -.if ${MK_OPENSSL} == "no" -MK_OPENSSH:= no -MK_KERBEROS:= no -.endif - -.if ${MK_PF} == "no" -MK_AUTHPF:= no -.endif - -.if ${MK_TEXTPROC} == "no" -MK_GROFF:= no -.endif - -.if ${MK_CROSS_COMPILER} == "no" -MK_BINUTILS_BOOTSTRAP:= no -MK_CLANG_BOOTSTRAP:= no -MK_GCC_BOOTSTRAP:= no -.endif - -.if ${MK_TOOLCHAIN} == "no" -MK_BINUTILS:= no -MK_CLANG:= no -MK_GCC:= no -MK_GDB:= no -.endif - -.if ${MK_CLANG} == "no" -MK_CLANG_EXTRAS:= no -MK_CLANG_FULL:= no -.endif - -# -# Set defaults for the MK_*_SUPPORT variables. -# - -# -# MK_*_SUPPORT options which default to "yes" unless their corresponding -# MK_* variable is set to "no". -# -.for var in \ - BZIP2 \ - GNU \ - INET \ - INET6 \ - KERBEROS \ - KVM \ - NETGRAPH \ - PAM \ - WIRELESS -.if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT) -.error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set. -.endif -.if defined(MK_${var}_SUPPORT) -.error MK_${var}_SUPPORT can't be set by a user. -.endif -.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no" -MK_${var}_SUPPORT:= no -.else -MK_${var}_SUPPORT:= yes -.endif -.endfor - -# -# MK_* options whose default value depends on another option. -# -.for vv in \ - GSSAPI/KERBEROS \ - MAN_UTILS/MAN -.if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H}) -.error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set. -.endif -.if defined(MK_${vv:H}) -.error MK_${vv:H} can't be set by a user. -.endif -.if defined(WITH_${vv:H}) -MK_${vv:H}:= yes -.elif defined(WITHOUT_${vv:H}) -MK_${vv:H}:= no -.else -MK_${vv:H}:= ${MK_${vv:T}} -.endif -.endfor - -# -# MK_* options that default to "yes" if the compiler is a C++11 compiler. -# -.include -.for var in \ - LIBCPLUSPLUS -.if defined(WITH_${var}) && defined(WITHOUT_${var}) -.error WITH_${var} and WITHOUT_${var} can't both be set. -.endif -.if defined(MK_${var}) -.if defined(.MAKE.LEVEL) && ${.MAKE.LEVEL} == 0 -.error MK_${var} can't be set by a user. -.endif -.else -.if ${COMPILER_FEATURES:Mc++11} -.if defined(WITHOUT_${var}) -MK_${var}:= no -.else -MK_${var}:= yes -.endif -.else -.if defined(WITH_${var}) -MK_${var}:= yes -.else -MK_${var}:= no -.endif -.endif -.endif -.endfor - -.if !${COMPILER_FEATURES:Mc++11} -MK_LLDB:= no -.endif - -.if ${MK_CTF} != "no" -CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300) -CTFCONVERT_CMD= -.else -CTFCONVERT_CMD= @: -.endif - -.if ${MK_INSTALL_AS_USER} != "no" -_uid!= id -u -.if ${_uid} != 0 -.if !defined(USER) -USER!= id -un -.endif -_gid!= id -gn -.for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE -$xOWN= ${USER} -$xGRP= ${_gid} -.endfor -.endif -.endif - -.endif # !_WITHOUT_SRCCONF - # Pointer to the top directory into which tests are installed. Should not be # overriden by Makefiles, but the user may choose to set this in src.conf(5). TESTSBASE?= /usr/tests From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 17:04:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5D4CF12; Fri, 18 Apr 2014 17:04:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89AA016C5; Fri, 18 Apr 2014 17:04:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IH4IM6050659; Fri, 18 Apr 2014 17:04:18 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IH4ITf050658; Fri, 18 Apr 2014 17:04:18 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404181704.s3IH4ITf050658@svn.freebsd.org> From: Warner Losh Date: Fri, 18 Apr 2014 17:04:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264662 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 17:04:18 -0000 Author: imp Date: Fri Apr 18 17:04:18 2014 New Revision: 264662 URL: http://svnweb.freebsd.org/changeset/base/264662 Log: Allow setting of MK_FOO by anybody. There are too many edge cases that we're preventing now with this policy. However, these edge cases should be rare and all that set MK_FOO directly. WITH_FOO and WITHOUT_FOO both being defined now result in the non-default behavior happening silently. Users needing determinism here fall into the edge case exception for MK_FOO setting. Modified: head/share/mk/bsd.opts.mk Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Fri Apr 18 17:04:09 2014 (r264661) +++ head/share/mk/bsd.opts.mk Fri Apr 18 17:04:18 2014 (r264662) @@ -247,14 +247,7 @@ __DEFAULT_YES_OPTIONS+=GCC GNUCXX GCC_BO # MK_* options which default to "yes". # .for var in ${__DEFAULT_YES_OPTIONS} -.if defined(WITH_${var}) && defined(WITHOUT_${var}) -.error WITH_${var} and WITHOUT_${var} can't both be set. -.endif -.if defined(MK_${var}) -.if defined(.MAKE.LEVEL) && ${.MAKE.LEVEL} == 0 -.error MK_${var} can't be set by a user. -.endif -.else +.if !defined(MK_${var}) .if defined(WITHOUT_${var}) MK_${var}:= no .else @@ -268,14 +261,7 @@ MK_${var}:= yes # MK_* options which default to "no". # .for var in ${__DEFAULT_NO_OPTIONS} -.if defined(WITH_${var}) && defined(WITHOUT_${var}) -.error WITH_${var} and WITHOUT_${var} can't both be set. -.endif -.if defined(MK_${var}) -.if defined(.MAKE.LEVEL) && ${.MAKE.LEVEL} == 0 -.error MK_${var} can't be set by a user. -.endif -.else +.if !defined(MK_${var}) .if defined(WITH_${var}) MK_${var}:= yes .else @@ -397,12 +383,6 @@ MK_CLANG_FULL:= no NETGRAPH \ PAM \ WIRELESS -.if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT) -.error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set. -.endif -.if defined(MK_${var}_SUPPORT) -.error MK_${var}_SUPPORT can't be set by a user. -.endif .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no" MK_${var}_SUPPORT:= no .else @@ -416,12 +396,6 @@ MK_${var}_SUPPORT:= yes .for vv in \ GSSAPI/KERBEROS \ MAN_UTILS/MAN -.if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H}) -.error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set. -.endif -.if defined(MK_${vv:H}) -.error MK_${vv:H} can't be set by a user. -.endif .if defined(WITH_${vv:H}) MK_${vv:H}:= yes .elif defined(WITHOUT_${vv:H}) @@ -437,14 +411,7 @@ MK_${vv:H}:= ${MK_${vv:T}} .include .for var in \ LIBCPLUSPLUS -.if defined(WITH_${var}) && defined(WITHOUT_${var}) -.error WITH_${var} and WITHOUT_${var} can't both be set. -.endif -.if defined(MK_${var}) -.if defined(.MAKE.LEVEL) && ${.MAKE.LEVEL} == 0 -.error MK_${var} can't be set by a user. -.endif -.else +.if !defined(MK_${var}) .if ${COMPILER_FEATURES:Mc++11} .if defined(WITHOUT_${var}) MK_${var}:= no From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 17:04:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8091DD5; Fri, 18 Apr 2014 17:04:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53BB216CB; Fri, 18 Apr 2014 17:04:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IH4RA9050724; Fri, 18 Apr 2014 17:04:27 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IH4QaR050720; Fri, 18 Apr 2014 17:04:26 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404181704.s3IH4QaR050720@svn.freebsd.org> From: Warner Losh Date: Fri, 18 Apr 2014 17:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264663 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 17:04:27 -0000 Author: imp Date: Fri Apr 18 17:04:26 2014 New Revision: 264663 URL: http://svnweb.freebsd.org/changeset/base/264663 Log: Move the generic part of bsd.opts.mk into bsd.mkopts.mk to allow for the WITH/WITHOUT_FOO -> MK_FOO={yes,no} stuff to be used elsewhere. Added: head/share/mk/bsd.mkopt.mk (contents, props changed) Modified: head/share/mk/bsd.opts.mk Added: head/share/mk/bsd.mkopt.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/mk/bsd.mkopt.mk Fri Apr 18 17:04:26 2014 (r264663) @@ -0,0 +1,40 @@ +# +# $FreeBSD$ +# +# Generic mechanism to deal with WITH and WITHOUT options and turn them into MK_ options. +# +# +# For each option FOO that defaults to YES, MK_FOO is set to yes, unless WITHOUT_FOO +# is defined, in which case it is set to no. If both WITH_FOO and WITHOUT_FOO are +# defined, WITHOUT_FOO wins. The list of default yes options is contained in the +# __DEFAULT_YES_OPTIONS variable, which is undefined after expansion. +# +# For each option FOO that defaults to NO, MK_FOO is set to no, unless WITH_FOO +# is defined, in which case it is set to yes. If both WITH_FOO and WITHOUT_FOO are +# defined, WITH_FOO wins. The list of default no options is contained in the +# __DEFAULT_NO_OPTIONS variable, which is undefined after expansion. +# +.for var in ${__DEFAULT_YES_OPTIONS} +.if !defined(MK_${var}) +.if defined(WITHOUT_${var}) # IF both WITH and WITHOUT defined, WITHOUT wins. +MK_${var}:= no +.else +MK_${var}:= yes +.endif +.endif +.endfor +.undef __DEFAULT_YES_OPTIONS + +# +# MK_* options which default to "no". +# +.for var in ${__DEFAULT_NO_OPTIONS} +.if !defined(MK_${var}) +.if defined(WITH_${var}) # If both WITH and WITHOUT defined, WITH wins +MK_${var}:= yes +.else +MK_${var}:= no +.endif +.endif +.endfor +.undef __DEFAULT_NO_OPTIONS Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Fri Apr 18 17:04:18 2014 (r264662) +++ head/share/mk/bsd.opts.mk Fri Apr 18 17:04:26 2014 (r264663) @@ -243,34 +243,7 @@ __DEFAULT_NO_OPTIONS+=CLANG_IS_CC CLANG __DEFAULT_YES_OPTIONS+=GCC GNUCXX GCC_BOOTSTRAP .endif -# -# MK_* options which default to "yes". -# -.for var in ${__DEFAULT_YES_OPTIONS} -.if !defined(MK_${var}) -.if defined(WITHOUT_${var}) -MK_${var}:= no -.else -MK_${var}:= yes -.endif -.endif -.endfor -.undef __DEFAULT_YES_OPTIONS - -# -# MK_* options which default to "no". -# -.for var in ${__DEFAULT_NO_OPTIONS} -.if !defined(MK_${var}) -.if defined(WITH_${var}) -MK_${var}:= yes -.else -MK_${var}:= no -.endif -.endif -.endfor -.undef __DEFAULT_NO_OPTIONS - +.include # # Supported NO_* options (if defined, MK_* will be forced to "no", From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 17:04:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A3B4F211; Fri, 18 Apr 2014 17:04:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B66516CD; Fri, 18 Apr 2014 17:04:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IH4Yfj050788; Fri, 18 Apr 2014 17:04:34 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IH4YgR050787; Fri, 18 Apr 2014 17:04:34 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404181704.s3IH4YgR050787@svn.freebsd.org> From: Warner Losh Date: Fri, 18 Apr 2014 17:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264664 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 17:04:34 -0000 Author: imp Date: Fri Apr 18 17:04:34 2014 New Revision: 264664 URL: http://svnweb.freebsd.org/changeset/base/264664 Log: Retire compatibility YES_HESIOD. If you haven't upgraded in the last decade to WITH_HESIOD, your are in for a rude surprise... Modified: head/share/mk/bsd.opts.mk Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Fri Apr 18 17:04:26 2014 (r264663) +++ head/share/mk/bsd.opts.mk Fri Apr 18 17:04:34 2014 (r264664) @@ -45,13 +45,6 @@ SRCCONF?= /etc/src.conf # that haven't been converted over. # -# -# Older-style variables that enabled behaviour when set. -# -.if defined(YES_HESIOD) -WITH_HESIOD= -.endif - __DEFAULT_YES_OPTIONS = \ ACCT \ ACPI \ From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 17:06:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 190543C1; Fri, 18 Apr 2014 17:06:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05EBD16E7; Fri, 18 Apr 2014 17:06:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IH6IIL051063; Fri, 18 Apr 2014 17:06:18 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IH6IFB051062; Fri, 18 Apr 2014 17:06:18 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404181706.s3IH6IFB051062@svn.freebsd.org> From: Warner Losh Date: Fri, 18 Apr 2014 17:06:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264665 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 17:06:19 -0000 Author: imp Date: Fri Apr 18 17:06:18 2014 New Revision: 264665 URL: http://svnweb.freebsd.org/changeset/base/264665 Log: Document YES_HESIOD disappearing. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Apr 18 17:04:34 2014 (r264664) +++ head/UPDATING Fri Apr 18 17:06:18 2014 (r264665) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20140418: + The YES_HESIOD knob has been removed. It has been obsolete for + a decade. Please move to using WITH_HESIOD instead or your builds + will silently lack HESIOD. + 20140405: The uart(4) driver has been changed with respect to its handling of the low-level console. Previously the uart(4) driver prevented From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 17:24:35 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E91FA17; Fri, 18 Apr 2014 17:24:35 +0000 (UTC) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C7FA418BF; Fri, 18 Apr 2014 17:24:34 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id A368625D3A85; Fri, 18 Apr 2014 17:24:24 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id C07ACC22BD1; Fri, 18 Apr 2014 17:24:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id djvaDQTa-NlO; Fri, 18 Apr 2014 17:24:21 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:5cde:fbc0:bb16:9af4] (unknown [IPv6:fde9:577b:c1a9:4410:5cde:fbc0:bb16:9af4]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 020E7C22BFB; Fri, 18 Apr 2014 17:23:57 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264646 - head/sys/dev/netfpga10g/nf10bmac From: "Bjoern A. Zeeb" In-Reply-To: <1397831317.1124.301.camel@revolution.hippie.lan> Date: Fri, 18 Apr 2014 17:23:47 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201404181421.s3IELAH0082972@svn.freebsd.org> <1397831317.1124.301.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 17:24:35 -0000 On 18 Apr 2014, at 14:28 , Ian Lepore wrote: > On Fri, 2014-04-18 at 14:21 +0000, Bjoern A. Zeeb wrote: >> Author: bz >> Date: Fri Apr 18 14:21:10 2014 >> New Revision: 264646 >> URL: http://svnweb.freebsd.org/changeset/base/264646 >>=20 >> Log: >> Now that I figured out where the ethernet addresses come from >> on NetFPGA-10G, assign one to the interface by default in a very >> similar way. >>=20 >> MFC after: 6 days >> X-Easter-Egg-Hunt: yes >>=20 >> Modified: >> head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c >>=20 >> Modified: head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c Fri Apr 18 = 12:51:30 2014 (r264645) >> +++ head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c Fri Apr 18 = 14:21:10 2014 (r264646) >> @@ -446,7 +446,25 @@ static int >> nf10bmac_reset(struct nf10bmac_softc *sc) >> { >>=20 >> - /* Currently we cannot do anything. */ >> + /* >> + * If we do not have an ether address set, initialize to the = same >> + * OUI as NetFPGA-10G Linux driver does (which luckily seems >> + * unallocated). We just change the NIC specific part from >> + * the slightly long "\0NF10C0" to "\0NFBSD". >> + * Oh and we keep the way of setting it from a string as they = do. >> + * It's an amazing way to hide it. >> + * XXX-BZ If NetFPGA gets their own OUI we should fix this. >> + */ >> + if (sc->nf10bmac_eth_addr[0] =3D=3D 0x00 && >> + sc->nf10bmac_eth_addr[1] =3D=3D 0x00 && >> + sc->nf10bmac_eth_addr[2] =3D=3D 0x00 && >> + sc->nf10bmac_eth_addr[3] =3D=3D 0x00 && >> + sc->nf10bmac_eth_addr[4] =3D=3D 0x00 && >> + sc->nf10bmac_eth_addr[5] =3D=3D 0x00) { >> + memcpy(&sc->nf10bmac_eth_addr, "\0NFBSD", = ETHER_ADDR_LEN); >> + sc->nf10bmac_eth_addr[5] +=3D sc->nf10bmac_unit; >> + } >> + >> return (0); >> } >>=20 >>=20 >=20 > For other drivers/socs where we need to cook up an address on the fly, > we've used "bsd" as the OUI and a 24-bit random for the low order. > Aside from the nice aesthetic, 'bsd' has the "locally administered" = bit > set and thus is g'teed to not clash with any globally assigned OUI. This is, as the comment, the commit message, and the XXX-BZ indicates, = to be consistent with that platform. The change is only to not conflict = with the host driver to avoid duplicate ethernet addresses when host = PCI/DMA interfaces, and the =93inside=94 PIO interfaces all talk to each = other. If I=92d do this another way, I=92d (a) get a tiny slice from the = official FreeBSD OUI and (b) put some random bits on the NIC part + the = unit number. And, as we have learnt elsewhere, sys/net-admins are not always happy if = you set the locally administered bit by default, as it=92s them to = assign the addresses and not the user. It=92s a game you cannot = globally win. This is about providing a =93matching=94 default for the = environment, and that=92s why it sticks with what the platform is doing = for now. /bz =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 21:15:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83BF4BFE; Fri, 18 Apr 2014 21:15:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C6CA10DC; Fri, 18 Apr 2014 21:15:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3ILFHNq054478; Fri, 18 Apr 2014 21:15:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3ILFDkQ054448; Fri, 18 Apr 2014 21:15:13 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404182115.s3ILFDkQ054448@svn.freebsd.org> From: Xin LI Date: Fri, 18 Apr 2014 21:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264669 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/lib/libzpool/common cddl/contrib/opensolaris/lib/libzpool/common/sys sys/cddl/contrib/opensolaris/uts/common... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 21:15:17 -0000 Author: delphij Date: Fri Apr 18 21:15:12 2014 New Revision: 264669 URL: http://svnweb.freebsd.org/changeset/base/264669 Log: MFV r264666: 4374 dn_free_ranges should use range_tree_t illumos/illumos-gate@bf16b11e8deb633dd6c4296d46e92399d1582df4 MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c head/sys/cddl/contrib/opensolaris/uts/common/sys/bitmap.h head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Apr 18 19:43:02 2014 (r264668) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Apr 18 21:15:12 2014 (r264669) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -2741,7 +2741,8 @@ dump_simulated_ddt(spa_t *spa) dds.dds_ref_psize = zdde->zdde_ref_psize; dds.dds_ref_dsize = zdde->zdde_ref_dsize; - ddt_stat_add(&ddh_total.ddh_stat[highbit(refcnt) - 1], &dds, 0); + ddt_stat_add(&ddh_total.ddh_stat[highbit64(refcnt) - 1], + &dds, 0); umem_free(zdde, sizeof (*zdde)); } Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Fri Apr 18 19:43:02 2014 (r264668) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Fri Apr 18 21:15:12 2014 (r264669) @@ -20,6 +20,8 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include @@ -800,20 +802,17 @@ delay(clock_t ticks) /* * Find highest one bit set. * Returns bit number + 1 of highest bit that is set, otherwise returns 0. - * High order bit is 31 (or 63 in _LP64 kernel). */ int -highbit(ulong_t i) +highbit64(uint64_t i) { - register int h = 1; + int h = 1; if (i == 0) return (0); -#ifdef _LP64 - if (i & 0xffffffff00000000ul) { + if (i & 0xffffffff00000000ULL) { h += 32; i >>= 32; } -#endif if (i & 0xffff0000) { h += 16; i >>= 16; } Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri Apr 18 19:43:02 2014 (r264668) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri Apr 18 21:15:12 2014 (r264669) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ /* @@ -558,7 +558,7 @@ extern void delay(clock_t ticks); extern uint64_t physmem; -extern int highbit(ulong_t i); +extern int highbit64(uint64_t i); extern int random_get_bytes(uint8_t *ptr, size_t len); extern int random_get_pseudo_bytes(uint8_t *ptr, size_t len); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Apr 18 19:43:02 2014 (r264668) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Apr 18 21:15:12 2014 (r264669) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -40,6 +40,7 @@ #include #include #include +#include /* * Number of times that zfs_free_range() took the slow path while doing @@ -1177,7 +1178,10 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t if (db->db_level == 0 && db->db_blkid != DMU_BONUS_BLKID && db->db_blkid != DMU_SPILL_BLKID) { mutex_enter(&dn->dn_mtx); - dnode_clear_range(dn, db->db_blkid, 1, tx); + if (dn->dn_free_ranges[txgoff] != NULL) { + range_tree_clear(dn->dn_free_ranges[txgoff], + db->db_blkid, 1); + } mutex_exit(&dn->dn_mtx); db->db_freed_in_flight = FALSE; } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Fri Apr 18 19:43:02 2014 (r264668) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Fri Apr 18 21:15:12 2014 (r264669) @@ -21,7 +21,7 @@ /* * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -416,7 +416,7 @@ ddt_stat_update(ddt_t *ddt, ddt_entry_t ddt_stat_generate(ddt, dde, &dds); - bucket = highbit(dds.dds_ref_blocks) - 1; + bucket = highbit64(dds.dds_ref_blocks) - 1; ASSERT(bucket >= 0); ddh = &ddt->ddt_histogram[dde->dde_type][dde->dde_class]; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Apr 18 19:43:02 2014 (r264668) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Apr 18 21:15:12 2014 (r264669) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -35,8 +35,7 @@ #include #include #include - -static int free_range_compar(const void *node1, const void *node2); +#include static kmem_cache_t *dnode_cache; /* @@ -92,9 +91,7 @@ dnode_cons(void *arg, void *unused, int for (i = 0; i < TXG_SIZE; i++) { list_link_init(&dn->dn_dirty_link[i]); - avl_create(&dn->dn_ranges[i], free_range_compar, - sizeof (free_range_t), - offsetof(struct free_range, fr_node)); + dn->dn_free_ranges[i] = NULL; list_create(&dn->dn_dirty_records[i], sizeof (dbuf_dirty_record_t), offsetof(dbuf_dirty_record_t, dr_dirty_node)); @@ -143,7 +140,7 @@ dnode_dest(void *arg, void *unused) for (i = 0; i < TXG_SIZE; i++) { ASSERT(!list_link_active(&dn->dn_dirty_link[i])); - avl_destroy(&dn->dn_ranges[i]); + ASSERT3P(dn->dn_free_ranges[i], ==, NULL); list_destroy(&dn->dn_dirty_records[i]); ASSERT0(dn->dn_next_nblkptr[i]); ASSERT0(dn->dn_next_nlevels[i]); @@ -316,19 +313,6 @@ dnode_buf_byteswap(void *vbuf, size_t si } } -static int -free_range_compar(const void *node1, const void *node2) -{ - const free_range_t *rp1 = node1; - const free_range_t *rp2 = node2; - - if (rp1->fr_blkid < rp2->fr_blkid) - return (-1); - else if (rp1->fr_blkid > rp2->fr_blkid) - return (1); - else return (0); -} - void dnode_setbonuslen(dnode_t *dn, int newsize, dmu_tx_t *tx) { @@ -377,7 +361,7 @@ dnode_setdblksz(dnode_t *dn, int size) 1<<(sizeof (dn->dn_phys->dn_datablkszsec) * 8)); dn->dn_datablksz = size; dn->dn_datablkszsec = size >> SPA_MINBLOCKSHIFT; - dn->dn_datablkshift = ISP2(size) ? highbit(size - 1) : 0; + dn->dn_datablkshift = ISP2(size) ? highbit64(size - 1) : 0; } static dnode_t * @@ -533,7 +517,7 @@ dnode_allocate(dnode_t *dn, dmu_object_t ASSERT0(dn->dn_next_blksz[i]); ASSERT(!list_link_active(&dn->dn_dirty_link[i])); ASSERT3P(list_head(&dn->dn_dirty_records[i]), ==, NULL); - ASSERT0(avl_numnodes(&dn->dn_ranges[i])); + ASSERT3P(dn->dn_free_ranges[i], ==, NULL); } dn->dn_type = ot; @@ -697,7 +681,8 @@ dnode_move_impl(dnode_t *odn, dnode_t *n list_move_tail(&ndn->dn_dirty_records[i], &odn->dn_dirty_records[i]); } - bcopy(&odn->dn_ranges[0], &ndn->dn_ranges[0], sizeof (odn->dn_ranges)); + bcopy(&odn->dn_free_ranges[0], &ndn->dn_free_ranges[0], + sizeof (odn->dn_free_ranges)); ndn->dn_allocated_txg = odn->dn_allocated_txg; ndn->dn_free_txg = odn->dn_free_txg; ndn->dn_assigned_txg = odn->dn_assigned_txg; @@ -760,8 +745,7 @@ dnode_move_impl(dnode_t *odn, dnode_t *n list_create(&odn->dn_dirty_records[i], sizeof (dbuf_dirty_record_t), offsetof(dbuf_dirty_record_t, dr_dirty_node)); - odn->dn_ranges[i].avl_root = NULL; - odn->dn_ranges[i].avl_numnodes = 0; + odn->dn_free_ranges[i] = NULL; odn->dn_next_nlevels[i] = 0; odn->dn_next_indblkshift[i] = 0; odn->dn_next_bonustype[i] = 0; @@ -1467,59 +1451,6 @@ out: } void -dnode_clear_range(dnode_t *dn, uint64_t blkid, uint64_t nblks, dmu_tx_t *tx) -{ - avl_tree_t *tree = &dn->dn_ranges[tx->tx_txg&TXG_MASK]; - avl_index_t where; - free_range_t *rp; - free_range_t rp_tofind; - uint64_t endblk = blkid + nblks; - - ASSERT(MUTEX_HELD(&dn->dn_mtx)); - ASSERT(nblks <= UINT64_MAX - blkid); /* no overflow */ - - dprintf_dnode(dn, "blkid=%llu nblks=%llu txg=%llu\n", - blkid, nblks, tx->tx_txg); - rp_tofind.fr_blkid = blkid; - rp = avl_find(tree, &rp_tofind, &where); - if (rp == NULL) - rp = avl_nearest(tree, where, AVL_BEFORE); - if (rp == NULL) - rp = avl_nearest(tree, where, AVL_AFTER); - - while (rp && (rp->fr_blkid <= blkid + nblks)) { - uint64_t fr_endblk = rp->fr_blkid + rp->fr_nblks; - free_range_t *nrp = AVL_NEXT(tree, rp); - - if (blkid <= rp->fr_blkid && endblk >= fr_endblk) { - /* clear this entire range */ - avl_remove(tree, rp); - kmem_free(rp, sizeof (free_range_t)); - } else if (blkid <= rp->fr_blkid && - endblk > rp->fr_blkid && endblk < fr_endblk) { - /* clear the beginning of this range */ - rp->fr_blkid = endblk; - rp->fr_nblks = fr_endblk - endblk; - } else if (blkid > rp->fr_blkid && blkid < fr_endblk && - endblk >= fr_endblk) { - /* clear the end of this range */ - rp->fr_nblks = blkid - rp->fr_blkid; - } else if (blkid > rp->fr_blkid && endblk < fr_endblk) { - /* clear a chunk out of this range */ - free_range_t *new_rp = - kmem_alloc(sizeof (free_range_t), KM_SLEEP); - - new_rp->fr_blkid = endblk; - new_rp->fr_nblks = fr_endblk - endblk; - avl_insert_here(tree, new_rp, rp, AVL_AFTER); - rp->fr_nblks = blkid - rp->fr_blkid; - } - /* there may be no overlap */ - rp = nrp; - } -} - -void dnode_free_range(dnode_t *dn, uint64_t off, uint64_t len, dmu_tx_t *tx) { dmu_buf_impl_t *db; @@ -1669,22 +1600,15 @@ done: * We will finish up this free operation in the syncing phase. */ mutex_enter(&dn->dn_mtx); - dnode_clear_range(dn, blkid, nblks, tx); - { - free_range_t *rp, *found; - avl_index_t where; - avl_tree_t *tree = &dn->dn_ranges[tx->tx_txg&TXG_MASK]; - - /* Add new range to dn_ranges */ - rp = kmem_alloc(sizeof (free_range_t), KM_SLEEP); - rp->fr_blkid = blkid; - rp->fr_nblks = nblks; - found = avl_find(tree, rp, &where); - ASSERT(found == NULL); - avl_insert(tree, rp, where); - dprintf_dnode(dn, "blkid=%llu nblks=%llu txg=%llu\n", - blkid, nblks, tx->tx_txg); + int txgoff = tx->tx_txg & TXG_MASK; + if (dn->dn_free_ranges[txgoff] == NULL) { + dn->dn_free_ranges[txgoff] = + range_tree_create(NULL, NULL, &dn->dn_mtx); } + range_tree_clear(dn->dn_free_ranges[txgoff], blkid, nblks); + range_tree_add(dn->dn_free_ranges[txgoff], blkid, nblks); + dprintf_dnode(dn, "blkid=%llu nblks=%llu txg=%llu\n", + blkid, nblks, tx->tx_txg); mutex_exit(&dn->dn_mtx); dbuf_free_range(dn, blkid, blkid + nblks - 1, tx); @@ -1712,7 +1636,6 @@ dnode_spill_freed(dnode_t *dn) uint64_t dnode_block_freed(dnode_t *dn, uint64_t blkid) { - free_range_t range_tofind; void *dp = spa_get_dsl(dn->dn_objset->os_spa); int i; @@ -1732,20 +1655,10 @@ dnode_block_freed(dnode_t *dn, uint64_t if (blkid == DMU_SPILL_BLKID) return (dnode_spill_freed(dn)); - range_tofind.fr_blkid = blkid; mutex_enter(&dn->dn_mtx); for (i = 0; i < TXG_SIZE; i++) { - free_range_t *range_found; - avl_index_t idx; - - range_found = avl_find(&dn->dn_ranges[i], &range_tofind, &idx); - if (range_found) { - ASSERT(range_found->fr_nblks > 0); - break; - } - range_found = avl_nearest(&dn->dn_ranges[i], idx, AVL_BEFORE); - if (range_found && - range_found->fr_blkid + range_found->fr_nblks > blkid) + if (dn->dn_free_ranges[i] != NULL && + range_tree_contains(dn->dn_free_ranges[i], blkid, 1)) break; } mutex_exit(&dn->dn_mtx); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Fri Apr 18 19:43:02 2014 (r264668) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Fri Apr 18 21:15:12 2014 (r264669) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -32,6 +32,7 @@ #include #include #include +#include #include static void @@ -318,7 +319,7 @@ free_children(dmu_buf_impl_t *db, uint64 * and "free" all the blocks contained there. */ static void -dnode_sync_free_range(dnode_t *dn, uint64_t blkid, uint64_t nblks, +dnode_sync_free_range_impl(dnode_t *dn, uint64_t blkid, uint64_t nblks, dmu_tx_t *tx) { blkptr_t *bp = dn->dn_phys->dn_blkptr; @@ -376,6 +377,22 @@ dnode_sync_free_range(dnode_t *dn, uint6 } } +typedef struct dnode_sync_free_range_arg { + dnode_t *dsfra_dnode; + dmu_tx_t *dsfra_tx; +} dnode_sync_free_range_arg_t; + +static void +dnode_sync_free_range(void *arg, uint64_t blkid, uint64_t nblks) +{ + dnode_sync_free_range_arg_t *dsfra = arg; + dnode_t *dn = dsfra->dsfra_dnode; + + mutex_exit(&dn->dn_mtx); + dnode_sync_free_range_impl(dn, blkid, nblks, dsfra->dsfra_tx); + mutex_enter(&dn->dn_mtx); +} + /* * Try to kick all the dnode's dbufs out of the cache... */ @@ -536,7 +553,6 @@ dnode_sync_free(dnode_t *dn, dmu_tx_t *t void dnode_sync(dnode_t *dn, dmu_tx_t *tx) { - free_range_t *rp; dnode_phys_t *dnp = dn->dn_phys; int txgoff = tx->tx_txg & TXG_MASK; list_t *list = &dn->dn_dirty_records[txgoff]; @@ -594,9 +610,9 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) SPA_MINBLOCKSIZE) == 0); ASSERT(BP_IS_HOLE(&dnp->dn_blkptr[0]) || dn->dn_maxblkid == 0 || list_head(list) != NULL || - avl_last(&dn->dn_ranges[txgoff]) || dn->dn_next_blksz[txgoff] >> SPA_MINBLOCKSHIFT == - dnp->dn_datablkszsec); + dnp->dn_datablkszsec || + range_tree_space(dn->dn_free_ranges[txgoff]) != 0); dnp->dn_datablkszsec = dn->dn_next_blksz[txgoff] >> SPA_MINBLOCKSHIFT; dn->dn_next_blksz[txgoff] = 0; @@ -655,13 +671,16 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) } /* process all the "freed" ranges in the file */ - while (rp = avl_last(&dn->dn_ranges[txgoff])) { - dnode_sync_free_range(dn, rp->fr_blkid, rp->fr_nblks, tx); - /* grab the mutex so we don't race with dnode_block_freed() */ + if (dn->dn_free_ranges[txgoff] != NULL) { + dnode_sync_free_range_arg_t dsfra; + dsfra.dsfra_dnode = dn; + dsfra.dsfra_tx = tx; mutex_enter(&dn->dn_mtx); - avl_remove(&dn->dn_ranges[txgoff], rp); + range_tree_vacate(dn->dn_free_ranges[txgoff], + dnode_sync_free_range, &dsfra); + range_tree_destroy(dn->dn_free_ranges[txgoff]); + dn->dn_free_ranges[txgoff] = NULL; mutex_exit(&dn->dn_mtx); - kmem_free(rp, sizeof (free_range_t)); } if (freeing_dnode) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Apr 18 19:43:02 2014 (r264668) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Apr 18 21:15:12 2014 (r264669) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ @@ -789,7 +789,7 @@ metaslab_ff_alloc(metaslab_t *msp, uint6 * may exist in the same region. */ uint64_t align = size & -size; - uint64_t *cursor = &msp->ms_lbas[highbit(align) - 1]; + uint64_t *cursor = &msp->ms_lbas[highbit64(align) - 1]; avl_tree_t *t = &msp->ms_tree->rt_root; return (metaslab_block_picker(t, cursor, size, align)); @@ -826,7 +826,7 @@ metaslab_df_alloc(metaslab_t *msp, uint6 * may exist in the same region. */ uint64_t align = size & -size; - uint64_t *cursor = &msp->ms_lbas[highbit(align) - 1]; + uint64_t *cursor = &msp->ms_lbas[highbit64(align) - 1]; range_tree_t *rt = msp->ms_tree; avl_tree_t *t = &rt->rt_root; uint64_t max_size = metaslab_block_maxsize(msp); @@ -942,7 +942,7 @@ metaslab_ndf_alloc(metaslab_t *msp, uint avl_tree_t *t = &msp->ms_tree->rt_root; avl_index_t where; range_seg_t *rs, rsearch; - uint64_t hbit = highbit(size); + uint64_t hbit = highbit64(size); uint64_t *cursor = &msp->ms_lbas[hbit - 1]; uint64_t max_size = metaslab_block_maxsize(msp); @@ -1185,7 +1185,7 @@ metaslab_weight_factor(metaslab_t *msp) if (msp->ms_sm == NULL) { vdev_t *vd = msp->ms_group->mg_vd; - i = highbit(msp->ms_size) - 1; + i = highbit64(msp->ms_size) - 1; sectors = msp->ms_size >> vd->vdev_ashift; return (sectors * i * vd->vdev_ashift); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c Fri Apr 18 19:43:02 2014 (r264668) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c Fri Apr 18 21:15:12 2014 (r264669) @@ -23,7 +23,7 @@ * Use is subject to license terms. */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. */ #include @@ -60,7 +60,7 @@ range_tree_stat_verify(range_tree_t *rt) for (rs = avl_first(&rt->rt_root); rs != NULL; rs = AVL_NEXT(&rt->rt_root, rs)) { uint64_t size = rs->rs_end - rs->rs_start; - int idx = highbit(size) - 1; + int idx = highbit64(size) - 1; hist[idx]++; ASSERT3U(hist[idx], !=, 0); @@ -79,7 +79,7 @@ static void range_tree_stat_incr(range_tree_t *rt, range_seg_t *rs) { uint64_t size = rs->rs_end - rs->rs_start; - int idx = highbit(size) - 1; + int idx = highbit64(size) - 1; ASSERT3U(idx, <, sizeof (rt->rt_histogram) / sizeof (*rt->rt_histogram)); @@ -93,7 +93,7 @@ static void range_tree_stat_decr(range_tree_t *rt, range_seg_t *rs) { uint64_t size = rs->rs_end - rs->rs_start; - int idx = highbit(size) - 1; + int idx = highbit64(size) - 1; ASSERT3U(idx, <, sizeof (rt->rt_histogram) / sizeof (*rt->rt_histogram)); @@ -299,10 +299,10 @@ range_tree_remove(void *arg, uint64_t st } static range_seg_t * -range_tree_find(range_tree_t *rt, uint64_t start, uint64_t size, - avl_index_t *wherep) +range_tree_find_impl(range_tree_t *rt, uint64_t start, uint64_t size) { - range_seg_t rsearch, *rs; + avl_index_t where; + range_seg_t rsearch; uint64_t end = start + size; ASSERT(MUTEX_HELD(rt->rt_lock)); @@ -310,9 +310,14 @@ range_tree_find(range_tree_t *rt, uint64 rsearch.rs_start = start; rsearch.rs_end = end; - rs = avl_find(&rt->rt_root, &rsearch, wherep); + return (avl_find(&rt->rt_root, &rsearch, &where)); +} - if (rs != NULL && rs->rs_start <= start && rs->rs_end >= end) +static range_seg_t * +range_tree_find(range_tree_t *rt, uint64_t start, uint64_t size) +{ + range_seg_t *rs = range_tree_find_impl(rt, start, size); + if (rs != NULL && rs->rs_start <= start && rs->rs_end >= start + size) return (rs); return (NULL); } @@ -321,10 +326,9 @@ void range_tree_verify(range_tree_t *rt, uint64_t off, uint64_t size) { range_seg_t *rs; - avl_index_t where; mutex_enter(rt->rt_lock); - rs = range_tree_find(rt, off, size, &where); + rs = range_tree_find(rt, off, size); if (rs != NULL) panic("freeing free block; rs=%p", (void *)rs); mutex_exit(rt->rt_lock); @@ -333,9 +337,23 @@ range_tree_verify(range_tree_t *rt, uint boolean_t range_tree_contains(range_tree_t *rt, uint64_t start, uint64_t size) { - avl_index_t where; + return (range_tree_find(rt, start, size) != NULL); +} - return (range_tree_find(rt, start, size, &where) != NULL); +/* + * Ensure that this range is not in the tree, regardless of whether + * it is currently in the tree. + */ +void +range_tree_clear(range_tree_t *rt, uint64_t start, uint64_t size) +{ + range_seg_t *rs; + + while ((rs = range_tree_find_impl(rt, start, size)) != NULL) { + uint64_t free_start = MAX(rs->rs_start, start); + uint64_t free_end = MIN(rs->rs_end, start + size); + range_tree_remove(rt, free_start, free_end - free_start); + } } void Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Fri Apr 18 19:43:02 2014 (r264668) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Fri Apr 18 21:15:12 2014 (r264669) @@ -23,7 +23,7 @@ * Use is subject to license terms. */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -267,7 +267,7 @@ space_map_set_blocksize(space_map_t *sm, * adding more blocks. The block size can grow until it * reaches space_map_max_blksz. */ - newsz = ISP2(size) ? size : 1ULL << highbit(size); + newsz = ISP2(size) ? size : 1ULL << highbit64(size); if (newsz > space_map_max_blksz) newsz = space_map_max_blksz; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Fri Apr 18 19:43:02 2014 (r264668) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Fri Apr 18 21:15:12 2014 (r264669) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #ifndef _SYS_DNODE_H @@ -198,7 +198,7 @@ typedef struct dnode { /* protected by dn_mtx: */ kmutex_t dn_mtx; list_t dn_dirty_records[TXG_SIZE]; - avl_tree_t dn_ranges[TXG_SIZE]; + struct range_tree *dn_free_ranges[TXG_SIZE]; uint64_t dn_allocated_txg; uint64_t dn_free_txg; uint64_t dn_assigned_txg; @@ -280,8 +280,6 @@ void dnode_buf_byteswap(void *buf, size_ void dnode_verify(dnode_t *dn); int dnode_set_blksz(dnode_t *dn, uint64_t size, int ibs, dmu_tx_t *tx); void dnode_free_range(dnode_t *dn, uint64_t off, uint64_t len, dmu_tx_t *tx); -void dnode_clear_range(dnode_t *dn, uint64_t blkid, - uint64_t nblks, dmu_tx_t *tx); void dnode_diduse_space(dnode_t *dn, int64_t space); void dnode_willuse_space(dnode_t *dn, int64_t space, dmu_tx_t *tx); void dnode_new_blkid(dnode_t *dn, uint64_t blkid, dmu_tx_t *tx, boolean_t); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h Fri Apr 18 19:43:02 2014 (r264668) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h Fri Apr 18 21:15:12 2014 (r264669) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. */ #ifndef _SYS_RANGE_TREE_H @@ -85,6 +85,7 @@ void range_tree_stat_verify(range_tree_t void range_tree_add(void *arg, uint64_t start, uint64_t size); void range_tree_remove(void *arg, uint64_t start, uint64_t size); +void range_tree_clear(range_tree_t *rt, uint64_t start, uint64_t size); void range_tree_vacate(range_tree_t *rt, range_tree_func_t *func, void *arg); void range_tree_walk(range_tree_t *rt, range_tree_func_t *func, void *arg); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Apr 18 19:43:02 2014 (r264668) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Apr 18 21:15:12 2014 (r264669) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright 2013 Martin Matuska . All rights reserved. */ @@ -1626,7 +1626,7 @@ vdev_metaslab_set_size(vdev_t *vd) /* * Aim for roughly 200 metaslabs per vdev. */ - vd->vdev_ms_shift = highbit(vd->vdev_asize / 200); + vd->vdev_ms_shift = highbit64(vd->vdev_asize / 200); vd->vdev_ms_shift = MAX(vd->vdev_ms_shift, SPA_MAXBLOCKSHIFT); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Fri Apr 18 19:43:02 2014 (r264668) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Fri Apr 18 21:15:12 2014 (r264669) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 Joyent, Inc. All rights reserved. */ @@ -547,7 +547,7 @@ skip_open: pbsize = DEV_BSIZE; } - *ashift = highbit(MAX(pbsize, SPA_MINBLOCKSIZE)) - 1; + *ashift = highbit64(MAX(pbsize, SPA_MINBLOCKSIZE)) - 1; if (vd->vdev_wholedisk == 1) { int wce = 1; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Fri Apr 18 19:43:02 2014 (r264668) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Fri Apr 18 21:15:12 2014 (r264669) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ /* @@ -84,7 +84,7 @@ fzap_upgrade(zap_t *zap, dmu_tx_t *tx, z &zap->zap_f.zap_phys, zap_evict); mutex_init(&zap->zap_f.zap_num_entries_mtx, 0, 0, 0); - zap->zap_f.zap_block_shift = highbit(zap->zap_dbuf->db_size) - 1; + zap->zap_f.zap_block_shift = highbit64(zap->zap_dbuf->db_size) - 1; zp = zap->zap_f.zap_phys; /* @@ -458,7 +458,7 @@ zap_open_leaf(uint64_t blkid, dmu_buf_t rw_init(&l->l_rwlock, 0, 0, 0); rw_enter(&l->l_rwlock, RW_WRITER); l->l_blkid = blkid; - l->l_bs = highbit(db->db_size)-1; + l->l_bs = highbit64(db->db_size) - 1; l->l_dbuf = db; l->l_phys = NULL; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c Fri Apr 18 19:43:02 2014 (r264668) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c Fri Apr 18 21:15:12 2014 (r264669) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. */ /* @@ -105,16 +105,16 @@ zap_leaf_byteswap(zap_leaf_phys_t *buf, { int i; zap_leaf_t l; - l.l_bs = highbit(size)-1; + l.l_bs = highbit64(size) - 1; l.l_phys = buf; - buf->l_hdr.lh_block_type = BSWAP_64(buf->l_hdr.lh_block_type); - buf->l_hdr.lh_prefix = BSWAP_64(buf->l_hdr.lh_prefix); - buf->l_hdr.lh_magic = BSWAP_32(buf->l_hdr.lh_magic); - buf->l_hdr.lh_nfree = BSWAP_16(buf->l_hdr.lh_nfree); - buf->l_hdr.lh_nentries = BSWAP_16(buf->l_hdr.lh_nentries); - buf->l_hdr.lh_prefix_len = BSWAP_16(buf->l_hdr.lh_prefix_len); - buf->l_hdr.lh_freelist = BSWAP_16(buf->l_hdr.lh_freelist); + buf->l_hdr.lh_block_type = BSWAP_64(buf->l_hdr.lh_block_type); + buf->l_hdr.lh_prefix = BSWAP_64(buf->l_hdr.lh_prefix); + buf->l_hdr.lh_magic = BSWAP_32(buf->l_hdr.lh_magic); + buf->l_hdr.lh_nfree = BSWAP_16(buf->l_hdr.lh_nfree); + buf->l_hdr.lh_nentries = BSWAP_16(buf->l_hdr.lh_nentries); + buf->l_hdr.lh_prefix_len = BSWAP_16(buf->l_hdr.lh_prefix_len); + buf->l_hdr.lh_freelist = BSWAP_16(buf->l_hdr.lh_freelist); for (i = 0; i < ZAP_LEAF_HASH_NUMENTRIES(&l); i++) buf->l_hash[i] = BSWAP_16(buf->l_hash[i]); @@ -157,7 +157,7 @@ zap_leaf_init(zap_leaf_t *l, boolean_t s { int i; - l->l_bs = highbit(l->l_dbuf->db_size)-1; + l->l_bs = highbit64(l->l_dbuf->db_size) - 1; zap_memset(&l->l_phys->l_hdr, 0, sizeof (struct zap_leaf_header)); zap_memset(l->l_phys->l_hash, CHAIN_END, 2*ZAP_LEAF_HASH_NUMENTRIES(l)); for (i = 0; i < ZAP_LEAF_NUMCHUNKS(l); i++) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Fri Apr 18 19:43:02 2014 (r264668) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Fri Apr 18 21:15:12 2014 (r264669) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. */ #include @@ -380,7 +380,7 @@ mzap_open(objset_t *os, uint64_t obj, dm if (*(uint64_t *)db->db_data != ZBT_MICRO) { mutex_init(&zap->zap_f.zap_num_entries_mtx, 0, 0, 0); - zap->zap_f.zap_block_shift = highbit(db->db_size) - 1; + zap->zap_f.zap_block_shift = highbit64(db->db_size) - 1; } else { zap->zap_ismicro = TRUE; } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Apr 18 19:43:02 2014 (r264668) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Apr 18 21:15:12 2014 (r264669) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved. */ @@ -1352,7 +1352,7 @@ zio_execute(zio_t *zio) } zio->io_stage = stage; - rv = zio_pipeline[highbit(stage) - 1](zio); + rv = zio_pipeline[highbit64(stage) - 1](zio); if (rv == ZIO_PIPELINE_STOP) return; Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/bitmap.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/bitmap.h Fri Apr 18 19:43:02 2014 (r264668) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/bitmap.h Fri Apr 18 21:15:12 2014 (r264669) @@ -24,6 +24,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2014 by Delphix. All rights reserved. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ @@ -31,8 +35,6 @@ #ifndef _SYS_BITMAP_H #define _SYS_BITMAP_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -152,6 +154,7 @@ extern int bt_range(ulong_t *bitmap, siz * Low order bit is 0, high order bit is 31. */ extern int highbit(ulong_t); +extern int highbit64(uint64_t); extern int lowbit(ulong_t); extern int bt_getlowbit(ulong_t *bitmap, size_t start, size_t stop); extern void bt_copy(ulong_t *, ulong_t *, ulong_t); Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h Fri Apr 18 19:43:02 2014 (r264668) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h Fri Apr 18 21:15:12 2014 (r264669) @@ -409,6 +409,38 @@ highbit(ulong_t i) return (h); } +/* + * Find highest one bit set. + * Returns bit number + 1 of highest bit that is set, otherwise returns 0. + */ +static __inline int +highbit64(uint64_t i) +{ + int h = 1; + + if (i == 0) + return (0); + if (i & 0xffffffff00000000ULL) { + h += 32; i >>= 32; + } + if (i & 0xffff0000) { + h += 16; i >>= 16; + } + if (i & 0xff00) { + h += 8; i >>= 8; + } + if (i & 0xf0) { + h += 4; i >>= 4; + } + if (i & 0xc) { + h += 2; i >>= 2; + } + if (i & 0x2) { + h += 1; + } + return (h); +} + #ifdef __cplusplus } #endif From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 21:35:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7607D108; Fri, 18 Apr 2014 21:35:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 632BC128B; Fri, 18 Apr 2014 21:35:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3ILZOB2063804; Fri, 18 Apr 2014 21:35:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3ILZOaZ063803; Fri, 18 Apr 2014 21:35:24 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404182135.s3ILZOaZ063803@svn.freebsd.org> From: Xin LI Date: Fri, 18 Apr 2014 21:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264670 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 21:35:24 -0000 Author: delphij Date: Fri Apr 18 21:35:23 2014 New Revision: 264670 URL: http://svnweb.freebsd.org/changeset/base/264670 Log: MFV r264667: 4752 fan out read zio taskqs illumos/illumos-gate@1b497ab83e8f1c58bba5da59c649207a442a4720 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Apr 18 21:15:12 2014 (r264669) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Apr 18 21:35:23 2014 (r264670) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 Martin Matuska . All rights reserved. */ @@ -138,7 +138,7 @@ static const char *const zio_taskq_types const zio_taskq_info_t zio_taskqs[ZIO_TYPES][ZIO_TASKQ_TYPES] = { /* ISSUE ISSUE_HIGH INTR INTR_HIGH */ { ZTI_ONE, ZTI_NULL, ZTI_ONE, ZTI_NULL }, /* NULL */ - { ZTI_N(8), ZTI_NULL, ZTI_BATCH, ZTI_NULL }, /* READ */ + { ZTI_N(8), ZTI_NULL, ZTI_P(12, 8), ZTI_NULL }, /* READ */ { ZTI_BATCH, ZTI_N(5), ZTI_N(8), ZTI_N(5) }, /* WRITE */ { ZTI_P(12, 8), ZTI_NULL, ZTI_ONE, ZTI_NULL }, /* FREE */ { ZTI_ONE, ZTI_NULL, ZTI_ONE, ZTI_NULL }, /* CLAIM */ From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 22:04:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF340854; Fri, 18 Apr 2014 22:04:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAEDE157C; Fri, 18 Apr 2014 22:04:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IM4xCN080122; Fri, 18 Apr 2014 22:04:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IM4x13080118; Fri, 18 Apr 2014 22:04:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404182204.s3IM4x13080118@svn.freebsd.org> From: Xin LI Date: Fri, 18 Apr 2014 22:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264671 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 22:05:00 -0000 Author: delphij Date: Fri Apr 18 22:04:58 2014 New Revision: 264671 URL: http://svnweb.freebsd.org/changeset/base/264671 Log: MFV r264668: 4754 io issued to near-full luns even after setting noalloc threshold 4755 mg_alloc_failures is no longer needed illumos/illumos@b6240e830b871f59c22a3918aebb3b36c872edba MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Apr 18 21:35:23 2014 (r264670) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Apr 18 22:04:58 2014 (r264671) @@ -41,7 +41,7 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab * avoid having to load lots of space_maps in a given txg. There are, * however, some cases where we want to avoid "fast" ganging and instead * we want to do an exhaustive search of all metaslabs on this device. - * Currently we don't allow any gang, zil, or dump device related allocations + * Currently we don't allow any gang, slog, or dump device related allocations * to "fast" gang. */ #define CAN_FASTGANG(flags) \ @@ -74,18 +74,6 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, condense_ " of in-memory counterpart"); /* - * This value defines the number of allowed allocation failures per vdev. - * If a device reaches this threshold in a given txg then we consider skipping - * allocations on that device. The value of zfs_mg_alloc_failures is computed - * in zio_init() unless it has been overridden in /etc/system. - */ -int zfs_mg_alloc_failures = 0; -TUNABLE_INT("vfs.zfs.mg_alloc_failures", &zfs_mg_alloc_failures); -SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_alloc_failures, CTLFLAG_RWTUN, - &zfs_mg_alloc_failures, 0, - "Number of allowed allocation failures per vdev"); - -/* * The zfs_mg_noalloc_threshold defines which metaslab groups should * be eligible for allocation. The value is defined as a percentage of * a free space. Metaslab groups that have more free space than @@ -1707,10 +1695,7 @@ metaslab_sync_done(metaslab_t *msp, uint void metaslab_sync_reassess(metaslab_group_t *mg) { - int64_t failures = mg->mg_alloc_failures; - metaslab_group_alloc_update(mg); - atomic_add_64(&mg->mg_alloc_failures, -failures); /* * Preload the next potential metaslabs @@ -1737,7 +1722,7 @@ metaslab_distance(metaslab_t *msp, dva_t static uint64_t metaslab_group_alloc(metaslab_group_t *mg, uint64_t psize, uint64_t asize, - uint64_t txg, uint64_t min_distance, dva_t *dva, int d, int flags) + uint64_t txg, uint64_t min_distance, dva_t *dva, int d) { spa_t *spa = mg->mg_vd->vdev_spa; metaslab_t *msp = NULL; @@ -1764,10 +1749,9 @@ metaslab_group_alloc(metaslab_group_t *m spa_dbgmsg(spa, "%s: failed to meet weight " "requirement: vdev %llu, txg %llu, mg %p, " "msp %p, psize %llu, asize %llu, " - "failures %llu, weight %llu", - spa_name(spa), mg->mg_vd->vdev_id, txg, - mg, msp, psize, asize, - mg->mg_alloc_failures, msp->ms_weight); + "weight %llu", spa_name(spa), + mg->mg_vd->vdev_id, txg, + mg, msp, psize, asize, msp->ms_weight); mutex_exit(&mg->mg_lock); return (-1ULL); } @@ -1800,27 +1784,6 @@ metaslab_group_alloc(metaslab_group_t *m mutex_enter(&msp->ms_lock); /* - * If we've already reached the allowable number of failed - * allocation attempts on this metaslab group then we - * consider skipping it. We skip it only if we're allowed - * to "fast" gang, the physical size is larger than - * a gang block, and we're attempting to allocate from - * the primary metaslab. - */ - if (mg->mg_alloc_failures > zfs_mg_alloc_failures && - CAN_FASTGANG(flags) && psize > SPA_GANGBLOCKSIZE && - activation_weight == METASLAB_WEIGHT_PRIMARY) { - spa_dbgmsg(spa, "%s: skipping metaslab group: " - "vdev %llu, txg %llu, mg %p, msp[%llu] %p, " - "psize %llu, asize %llu, failures %llu", - spa_name(spa), mg->mg_vd->vdev_id, txg, mg, - msp->ms_id, msp, psize, asize, - mg->mg_alloc_failures); - mutex_exit(&msp->ms_lock); - return (-1ULL); - } - - /* * Ensure that the metaslab we have selected is still * capable of handling our request. It's possible that * another thread may have changed the weight while we @@ -1859,8 +1822,6 @@ metaslab_group_alloc(metaslab_group_t *m if ((offset = metaslab_block_alloc(msp, asize)) != -1ULL) break; - atomic_inc_64(&mg->mg_alloc_failures); - metaslab_passivate(msp, metaslab_block_maxsize(msp)); mutex_exit(&msp->ms_lock); } @@ -2015,7 +1976,7 @@ top: ASSERT(P2PHASE(asize, 1ULL << vd->vdev_ashift) == 0); offset = metaslab_group_alloc(mg, psize, asize, txg, distance, - dva, d, flags); + dva, d); if (offset != -1ULL) { /* * If we've just selected this metaslab group, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Fri Apr 18 21:35:23 2014 (r264670) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Fri Apr 18 22:04:58 2014 (r264671) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. */ #ifndef _SYS_METASLAB_IMPL_H @@ -58,7 +58,6 @@ struct metaslab_group { kmutex_t mg_lock; avl_tree_t mg_metaslab_tree; uint64_t mg_aliquot; - uint64_t mg_alloc_failures; boolean_t mg_allocatable; /* can we allocate? */ uint64_t mg_free_capacity; /* percentage free */ int64_t mg_bias; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Apr 18 21:35:23 2014 (r264670) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Apr 18 22:04:58 2014 (r264671) @@ -90,7 +90,6 @@ kmem_cache_t *zio_data_buf_cache[SPA_MAX #ifdef _KERNEL extern vmem_t *zio_alloc_arena; #endif -extern int zfs_mg_alloc_failures; /* * The following actions directly effect the spa's sync-to-convergence logic. @@ -206,15 +205,6 @@ zio_init(void) } out: - /* - * The zio write taskqs have 1 thread per cpu, allow 1/2 of the taskqs - * to fail 3 times per txg or 8 failures, whichever is greater. - */ - if (zfs_mg_alloc_failures == 0) - zfs_mg_alloc_failures = MAX((3 * max_ncpus / 2), 8); - else if (zfs_mg_alloc_failures < 8) - zfs_mg_alloc_failures = 8; - zio_inject_init(); zio_trim_ksp = kstat_create("zfs", 0, "zio_trim", "misc", From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 22:05:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC5429AD; Fri, 18 Apr 2014 22:05:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C871158D; Fri, 18 Apr 2014 22:05:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IM5ZNn080351; Fri, 18 Apr 2014 22:05:35 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IM5ZtM080348; Fri, 18 Apr 2014 22:05:35 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201404182205.s3IM5ZtM080348@svn.freebsd.org> From: Rick Macklem Date: Fri, 18 Apr 2014 22:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264672 - in head/sys/fs: nfs nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 22:05:35 -0000 Author: rmacklem Date: Fri Apr 18 22:05:34 2014 New Revision: 264672 URL: http://svnweb.freebsd.org/changeset/base/264672 Log: Modify the Lookup RPC for NFSv4 so that it acquires directory attributes. This allows the client to cache directory names when they are looked up, reducing the Lookup RPC count by about 40% for software builds. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfsclient/nfs_clcomsubs.c head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Fri Apr 18 22:04:58 2014 (r264671) +++ head/sys/fs/nfs/nfs_commonsubs.c Fri Apr 18 22:05:34 2014 (r264672) @@ -101,8 +101,8 @@ struct nfsv4_opflag nfsv4_opflag[NFSV41_ { 0, 1, 0, 0, LK_EXCLUSIVE, 1 }, /* Lock */ { 0, 1, 0, 0, LK_EXCLUSIVE, 1 }, /* LockT */ { 0, 1, 0, 0, LK_EXCLUSIVE, 1 }, /* LockU */ - { 1, 1, 0, 0, LK_EXCLUSIVE, 1 }, /* Lookup */ - { 1, 1, 0, 0, LK_EXCLUSIVE, 1 }, /* Lookupp */ + { 1, 2, 0, 0, LK_EXCLUSIVE, 1 }, /* Lookup */ + { 1, 2, 0, 0, LK_EXCLUSIVE, 1 }, /* Lookupp */ { 0, 1, 0, 0, LK_EXCLUSIVE, 1 }, /* NVerify */ { 1, 1, 0, 1, LK_EXCLUSIVE, 1 }, /* Open */ { 1, 1, 0, 0, LK_EXCLUSIVE, 1 }, /* OpenAttr */ Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clcomsubs.c Fri Apr 18 22:04:58 2014 (r264671) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Fri Apr 18 22:05:34 2014 (r264672) @@ -219,9 +219,18 @@ nfscl_reqstart(struct nfsrv_descript *nd procnum != NFSPROC_COMMITDS) { NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_GETATTR); - NFSWCCATTR_ATTRBIT(&attrbits); + /* + * For Lookup Ops, we want all the directory + * attributes, so we can load the name cache. + */ + if (procnum == NFSPROC_LOOKUP || + procnum == NFSPROC_LOOKUPP) + NFSGETATTR_ATTRBIT(&attrbits); + else { + NFSWCCATTR_ATTRBIT(&attrbits); + nd->nd_flag |= ND_V4WCCATTR; + } (void) nfsrv_putattrbit(nd, &attrbits); - nd->nd_flag |= ND_V4WCCATTR; } } if (procnum != NFSPROC_RENEW || Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Fri Apr 18 22:04:58 2014 (r264671) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Fri Apr 18 22:05:34 2014 (r264672) @@ -1238,14 +1238,23 @@ nfsrpc_lookup(vnode_t dvp, char *name, i } if (nd->nd_flag & ND_NFSV3) error = nfscl_postop_attr(nd, dnap, dattrflagp, stuff); + else if ((nd->nd_flag & (ND_NFSV4 | ND_NOMOREDATA)) == + ND_NFSV4) { + /* Load the directory attributes. */ + error = nfsm_loadattr(nd, dnap); + if (error == 0) + *dattrflagp = 1; + } goto nfsmout; } if ((nd->nd_flag & (ND_NFSV4 | ND_NOMOREDATA)) == ND_NFSV4) { - NFSM_DISSECT(tl, u_int32_t *, 2 * NFSX_UNSIGNED); - if (*(tl + 1)) { - nd->nd_flag |= ND_NOMOREDATA; + /* Load the directory attributes. */ + error = nfsm_loadattr(nd, dnap); + if (error != 0) goto nfsmout; - } + *dattrflagp = 1; + /* Skip over the Lookup and GetFH operation status values. */ + NFSM_DISSECT(tl, u_int32_t *, 4 * NFSX_UNSIGNED); } error = nfsm_getfh(nd, nfhpp); if (error) @@ -2702,14 +2711,6 @@ nfsrpc_readdir(vnode_t vp, struct uio *u * Joy, oh joy. For V4 we get to hand craft '.' and '..'. */ if (uiop->uio_offset == 0) { -#if defined(__FreeBSD_version) && __FreeBSD_version >= 800000 - error = VOP_GETATTR(vp, &nfsva.na_vattr, cred); -#else - error = VOP_GETATTR(vp, &nfsva.na_vattr, cred, p); -#endif - if (error) - return (error); - dotfileid = nfsva.na_fileid; NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp); NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(NFSV4OP_GETFH); @@ -2718,9 +2719,16 @@ nfsrpc_readdir(vnode_t vp, struct uio *u error = nfscl_request(nd, vp, p, cred, stuff); if (error) return (error); + dotfileid = 0; /* Fake out the compiler. */ + if ((nd->nd_flag & ND_NOMOREDATA) == 0) { + error = nfsm_loadattr(nd, &nfsva); + if (error != 0) + goto nfsmout; + dotfileid = nfsva.na_fileid; + } if (nd->nd_repstat == 0) { - NFSM_DISSECT(tl, u_int32_t *, 3*NFSX_UNSIGNED); - len = fxdr_unsigned(int, *(tl + 2)); + NFSM_DISSECT(tl, u_int32_t *, 5 * NFSX_UNSIGNED); + len = fxdr_unsigned(int, *(tl + 4)); if (len > 0 && len <= NFSX_V4FHMAX) error = nfsm_advance(nd, NFSM_RNDUP(len), -1); else @@ -3129,15 +3137,6 @@ nfsrpc_readdirplus(vnode_t vp, struct ui * Joy, oh joy. For V4 we get to hand craft '.' and '..'. */ if (uiop->uio_offset == 0) { -#if defined(__FreeBSD_version) && __FreeBSD_version >= 800000 - error = VOP_GETATTR(vp, &nfsva.na_vattr, cred); -#else - error = VOP_GETATTR(vp, &nfsva.na_vattr, cred, p); -#endif - if (error) - return (error); - dctime = nfsva.na_ctime; - dotfileid = nfsva.na_fileid; NFSCL_REQSTART(nd, NFSPROC_LOOKUPP, vp); NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(NFSV4OP_GETFH); @@ -3146,9 +3145,17 @@ nfsrpc_readdirplus(vnode_t vp, struct ui error = nfscl_request(nd, vp, p, cred, stuff); if (error) return (error); + dotfileid = 0; /* Fake out the compiler. */ + if ((nd->nd_flag & ND_NOMOREDATA) == 0) { + error = nfsm_loadattr(nd, &nfsva); + if (error != 0) + goto nfsmout; + dctime = nfsva.na_ctime; + dotfileid = nfsva.na_fileid; + } if (nd->nd_repstat == 0) { - NFSM_DISSECT(tl, u_int32_t *, 3*NFSX_UNSIGNED); - len = fxdr_unsigned(int, *(tl + 2)); + NFSM_DISSECT(tl, u_int32_t *, 5 * NFSX_UNSIGNED); + len = fxdr_unsigned(int, *(tl + 4)); if (len > 0 && len <= NFSX_V4FHMAX) error = nfsm_advance(nd, NFSM_RNDUP(len), -1); else From owner-svn-src-head@FreeBSD.ORG Sat Apr 19 01:52:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6BCDF2F7; Sat, 19 Apr 2014 01:52:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5820118DA; Sat, 19 Apr 2014 01:52:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3J1q4GZ077678; Sat, 19 Apr 2014 01:52:04 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3J1q4n9077677; Sat, 19 Apr 2014 01:52:04 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201404190152.s3J1q4n9077677@svn.freebsd.org> From: John-Mark Gurney Date: Sat, 19 Apr 2014 01:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264673 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Apr 2014 01:52:04 -0000 Author: jmg Date: Sat Apr 19 01:52:03 2014 New Revision: 264673 URL: http://svnweb.freebsd.org/changeset/base/264673 Log: add link to crypto(4)... MFC after: 1 week Modified: head/share/man/man9/crypto.9 Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Fri Apr 18 22:05:34 2014 (r264672) +++ head/share/man/man9/crypto.9 Sat Apr 19 01:52:03 2014 (r264673) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 19, 2007 +.Dd April 18, 2014 .Dt CRYPTO 9 .Os .Sh NAME @@ -640,6 +640,7 @@ field. most of the framework code .El .Sh SEE ALSO +.Xr crypto 4 , .Xr ipsec 4 , .Xr malloc 9 , .Xr sleep 9 From owner-svn-src-head@FreeBSD.ORG Sat Apr 19 04:59:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D945A51B; Sat, 19 Apr 2014 04:59:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC4031A4E; Sat, 19 Apr 2014 04:59:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3J4xuRv053065; Sat, 19 Apr 2014 04:59:56 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3J4xumn053064; Sat, 19 Apr 2014 04:59:56 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201404190459.s3J4xumn053064@svn.freebsd.org> From: Jung-uk Kim Date: Sat, 19 Apr 2014 04:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264674 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Apr 2014 04:59:56 -0000 Author: jkim Date: Sat Apr 19 04:59:56 2014 New Revision: 264674 URL: http://svnweb.freebsd.org/changeset/base/264674 Log: Install newly added bsd.mkopt.mk. Modified: head/share/mk/Makefile Modified: head/share/mk/Makefile ============================================================================== --- head/share/mk/Makefile Sat Apr 19 01:52:03 2014 (r264673) +++ head/share/mk/Makefile Sat Apr 19 04:59:56 2014 (r264674) @@ -22,6 +22,7 @@ FILES= \ bsd.libnames.mk \ bsd.links.mk \ bsd.man.mk \ + bsd.mkopt.mk \ bsd.nls.mk \ bsd.obj.mk \ bsd.opts.mk \ From owner-svn-src-head@FreeBSD.ORG Sat Apr 19 06:32:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9AFA6F7; Sat, 19 Apr 2014 06:32:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A611012B0; Sat, 19 Apr 2014 06:32:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3J6Wpj9093007; Sat, 19 Apr 2014 06:32:51 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3J6Wp45093006; Sat, 19 Apr 2014 06:32:51 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201404190632.s3J6Wp45093006@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 19 Apr 2014 06:32:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264675 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Apr 2014 06:32:51 -0000 Author: hselasky Date: Sat Apr 19 06:32:51 2014 New Revision: 264675 URL: http://svnweb.freebsd.org/changeset/base/264675 Log: Update UMASS manual page to mention newer host controller drivers. Submitted by: Aseem Jolly Modified: head/share/man/man4/umass.4 Modified: head/share/man/man4/umass.4 ============================================================================== --- head/share/man/man4/umass.4 Sat Apr 19 04:59:56 2014 (r264674) +++ head/share/man/man4/umass.4 Sat Apr 19 06:32:51 2014 (r264675) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 22, 2009 +.Dd April 19, 2014 .Dt UMASS 4 .Os .Sh NAME @@ -60,6 +60,10 @@ and one of .Xr uhci 4 or .Xr ohci 4 +or +.Xr ehci 4 +or +.Xr xhci 4 must be configured in the kernel. Additionally, since .Nm @@ -236,6 +240,7 @@ when using .Xr mount 8 . .Sh SEE ALSO .Xr ehci 4 , +.Xr xhci 4 , .Xr ohci 4 , .Xr uhci 4 , .Xr usb 4 , From owner-svn-src-head@FreeBSD.ORG Sat Apr 19 12:38:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A5D187B; Sat, 19 Apr 2014 12:38:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 475721E80; Sat, 19 Apr 2014 12:38:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3JCc2Dl039156; Sat, 19 Apr 2014 12:38:02 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3JCc2Kr039155; Sat, 19 Apr 2014 12:38:02 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404191238.s3JCc2Kr039155@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 19 Apr 2014 12:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264676 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Apr 2014 12:38:02 -0000 Author: jilles Date: Sat Apr 19 12:38:01 2014 New Revision: 264676 URL: http://svnweb.freebsd.org/changeset/base/264676 Log: langinfo.h: Hide YESSTR and NOSTR in strict POSIX mode. YESSTR and NOSTR are obsolete and are only in old SUS. Modified: head/include/langinfo.h Modified: head/include/langinfo.h ============================================================================== --- head/include/langinfo.h Sat Apr 19 06:32:51 2014 (r264675) +++ head/include/langinfo.h Sat Apr 19 12:38:01 2014 (r264676) @@ -103,7 +103,7 @@ typedef __nl_item nl_item; #define YESEXPR 52 /* affirmative response expression */ #define NOEXPR 53 /* negative response expression */ -#if __BSD_VISIBLE || __XSI_VISIBLE <= 500 +#if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE <= 500) #define YESSTR 54 /* affirmative response for yes/no queries */ #define NOSTR 55 /* negative response for yes/no queries */ #endif From owner-svn-src-head@FreeBSD.ORG Sat Apr 19 13:47:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A6FCDC6; Sat, 19 Apr 2014 13:47:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1747A147E; Sat, 19 Apr 2014 13:47:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3JDlWd7067222; Sat, 19 Apr 2014 13:47:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3JDlWQM067221; Sat, 19 Apr 2014 13:47:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404191347.s3JDlWQM067221@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 19 Apr 2014 13:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264677 - head/usr.bin/login X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Apr 2014 13:47:33 -0000 Author: jilles Date: Sat Apr 19 13:47:32 2014 New Revision: 264677 URL: http://svnweb.freebsd.org/changeset/base/264677 Log: login: Remove broken dialup log message. For 10 years, the "DIALUP , " message has required having a hostname (-h) instead of not having a hostname; therefore, it is never logged. Given that dialup is obsolete and this has not been fixed, remove the log message. Note that LOGALL, which is defined by default, logs a message for all logins, including dialup logins. Modified: head/usr.bin/login/login.c Modified: head/usr.bin/login/login.c ============================================================================== --- head/usr.bin/login/login.c Sat Apr 19 12:38:01 2014 (r264676) +++ head/usr.bin/login/login.c Sat Apr 19 13:47:32 2014 (r264677) @@ -489,14 +489,6 @@ main(int argc, char *argv[]) if (errno != EROFS) syslog(LOG_ERR, "chown(%s): %m", ttyn); - /* - * Exclude cons/vt/ptys only, assume dialup otherwise - * TODO: Make dialup tty determination a library call - * for consistency (finger etc.) - */ - if (hflag && isdialuptty(tty)) - syslog(LOG_INFO, "DIALUP %s, %s", tty, pwd->pw_name); - #ifdef LOGALL /* * Syslog each successful login, so we don't have to watch From owner-svn-src-head@FreeBSD.ORG Sat Apr 19 17:48:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B42BC2F1; Sat, 19 Apr 2014 17:48:11 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D96D1B0A; Sat, 19 Apr 2014 17:48:10 +0000 (UTC) Received: from Julian-MBP3.local (ppp121-45-232-70.lns20.per1.internode.on.net [121.45.232.70]) (authenticated bits=0) by vps1.elischer.org (8.14.8/8.14.8) with ESMTP id s3JHm74h032215 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 19 Apr 2014 10:48:09 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <5352B6D0.6060503@freebsd.org> Date: Sun, 20 Apr 2014 01:48:00 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Brooks Davis , svn-src-head@freebsd.org Subject: Re: svn commit: r264543 - head/lib/libkse References: <201404161712.s3GHCx1h029615@svn.freebsd.org> In-Reply-To: <201404161712.s3GHCx1h029615@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Apr 2014 17:48:11 -0000 On 4/17/14, 1:12 AM, Brooks Davis wrote: > Author: brooks > Date: Wed Apr 16 17:12:59 2014 > New Revision: 264543 > URL: http://svnweb.freebsd.org/changeset/base/264543 > > Log: > Remove the libkse directory. It was unhooked from the build and kernel > support removed in 2008 (prior to 8.0). > > Approved by: deischen, imp > MFC after: 3 days > > Deleted: > head/lib/libkse/ > > take out the unit test too in tools (somewhere) From owner-svn-src-head@FreeBSD.ORG Sat Apr 19 19:08:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70638462; Sat, 19 Apr 2014 19:08:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D4FC14D1; Sat, 19 Apr 2014 19:08:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3JJ891r096833; Sat, 19 Apr 2014 19:08:09 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3JJ898u096832; Sat, 19 Apr 2014 19:08:09 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201404191908.s3JJ898u096832@svn.freebsd.org> From: John-Mark Gurney Date: Sat, 19 Apr 2014 19:08:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264678 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Apr 2014 19:08:09 -0000 Author: jmg Date: Sat Apr 19 19:08:08 2014 New Revision: 264678 URL: http://svnweb.freebsd.org/changeset/base/264678 Log: garbage collect something that hasn't been triggered in almost 5 years... the last consumer was removed a couple years ago... Modified: head/sys/net/route.h Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sat Apr 19 13:47:32 2014 (r264677) +++ head/sys/net/route.h Sat Apr 19 19:08:08 2014 (r264678) @@ -398,10 +398,7 @@ int rtrequest_fib(int, struct sockaddr int rtrequest1_fib(int, struct rt_addrinfo *, struct rtentry **, u_int); #include -typedef void (*rtevent_arp_update_fn)(void *, struct rtentry *, uint8_t *, struct sockaddr *); typedef void (*rtevent_redirect_fn)(void *, struct rtentry *, struct rtentry *, struct sockaddr *); -/* route_arp_update_event is no longer generated; see arp_update_event */ -EVENTHANDLER_DECLARE(route_arp_update_event, rtevent_arp_update_fn); EVENTHANDLER_DECLARE(route_redirect_event, rtevent_redirect_fn); #endif From owner-svn-src-head@FreeBSD.ORG Sat Apr 19 19:21:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A420B56; Sat, 19 Apr 2014 19:21:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46F60169F; Sat, 19 Apr 2014 19:21:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3JJL7AC003516; Sat, 19 Apr 2014 19:21:07 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3JJL6L2003512; Sat, 19 Apr 2014 19:21:06 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201404191921.s3JJL6L2003512@svn.freebsd.org> From: Michael Tuexen Date: Sat, 19 Apr 2014 19:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264679 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Apr 2014 19:21:07 -0000 Author: tuexen Date: Sat Apr 19 19:21:06 2014 New Revision: 264679 URL: http://svnweb.freebsd.org/changeset/base/264679 Log: Send the correct error cause, when a DATA chunk with no user data is received. This bug was reported by Irene Ruengeler. MFC after: 3 days Modified: head/sys/netinet/sctp.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Sat Apr 19 19:08:08 2014 (r264678) +++ head/sys/netinet/sctp.h Sat Apr 19 19:21:06 2014 (r264679) @@ -408,6 +408,11 @@ struct sctp_error_unrecognized_chunk { struct sctp_chunkhdr ch;/* header from chunk in error */ } SCTP_PACKED; +struct sctp_error_no_user_data { + struct sctp_error_cause cause; /* code=SCTP_CAUSE_NO_USER_DATA */ + uint32_t tsn; /* TSN of the empty data chunk */ +} SCTP_PACKED; + /* * Main SCTP chunk types we place these here so natd and f/w's in user land * can find them. Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sat Apr 19 19:08:08 2014 (r264678) +++ head/sys/netinet/sctp_indata.c Sat Apr 19 19:21:06 2014 (r264679) @@ -2323,7 +2323,7 @@ sctp_process_data(struct mbuf **mm, int continue; } if (ch->ch.chunk_type == SCTP_DATA) { - if ((size_t)chk_length < sizeof(struct sctp_data_chunk) + 1) { + if ((size_t)chk_length < sizeof(struct sctp_data_chunk)) { /* * Need to send an abort since we had a * invalid data chunk. @@ -2341,6 +2341,21 @@ sctp_process_data(struct mbuf **mm, int vrf_id, port); return (2); } + if ((size_t)chk_length == sizeof(struct sctp_data_chunk)) { + /* + * Need to send an abort since we had an + * empty data chunk. + */ + struct mbuf *op_err; + + op_err = sctp_generate_no_user_data_cause(ch->dp.tsn); + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19; + sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, op_err, + use_mflowid, mflowid, + vrf_id, port); + return (2); + } #ifdef SCTP_AUDITING_ENABLED sctp_audit_log(0xB1, 0); #endif Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat Apr 19 19:08:08 2014 (r264678) +++ head/sys/netinet/sctputil.c Sat Apr 19 19:21:06 2014 (r264679) @@ -4654,6 +4654,25 @@ sctp_generate_cause(uint16_t code, char return (m); } +struct mbuf * +sctp_generate_no_user_data_cause(uint32_t tsn) +{ + struct mbuf *m; + struct sctp_error_no_user_data *no_user_data_cause; + size_t len; + + len = sizeof(struct sctp_error_no_user_data); + m = sctp_get_mbuf_for_msg(len, 0, M_NOWAIT, 1, MT_DATA); + if (m != NULL) { + SCTP_BUF_LEN(m) = len; + no_user_data_cause = mtod(m, struct sctp_error_no_user_data *); + no_user_data_cause->cause.code = htons(SCTP_CAUSE_NO_USER_DATA); + no_user_data_cause->cause.length = htons((uint16_t) len); + no_user_data_cause->tsn = tsn; /* tsn is passed in as NBO */ + } + return (m); +} + #ifdef SCTP_MBCNT_LOGGING void sctp_free_bufspace(struct sctp_tcb *stcb, struct sctp_association *asoc, Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Sat Apr 19 19:08:08 2014 (r264678) +++ head/sys/netinet/sctputil.h Sat Apr 19 19:21:06 2014 (r264679) @@ -254,6 +254,7 @@ sctp_release_pr_sctp_chunk(struct sctp_t ); struct mbuf *sctp_generate_cause(uint16_t, char *); +struct mbuf *sctp_generate_no_user_data_cause(uint32_t); void sctp_bindx_add_address(struct socket *so, struct sctp_inpcb *inp, From owner-svn-src-head@FreeBSD.ORG Sat Apr 19 19:32:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4003D5C; Sat, 19 Apr 2014 19:32:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C44861808; Sat, 19 Apr 2014 19:32:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3JJWs92008547; Sat, 19 Apr 2014 19:32:54 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3JJWsGR008546; Sat, 19 Apr 2014 19:32:54 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201404191932.s3JJWsGR008546@svn.freebsd.org> From: John-Mark Gurney Date: Sat, 19 Apr 2014 19:32:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264680 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Apr 2014 19:32:55 -0000 Author: jmg Date: Sat Apr 19 19:32:54 2014 New Revision: 264680 URL: http://svnweb.freebsd.org/changeset/base/264680 Log: add a TON of missing event handlers with quite possibly bogus descrptions... If you're one of the many people who forgot to document their work and don't like my description, well, do your job and update it... Modified: head/share/man/man9/EVENTHANDLER.9 Modified: head/share/man/man9/EVENTHANDLER.9 ============================================================================== --- head/share/man/man9/EVENTHANDLER.9 Sat Apr 19 19:21:06 2014 (r264679) +++ head/share/man/man9/EVENTHANDLER.9 Sat Apr 19 19:32:54 2014 (r264680) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" $FreeBSD$ .\" -.Dd August 1, 2013 +.Dd April 19, 2014 .Dt EVENTHANDLER 9 .Os .Sh NAME @@ -186,19 +186,45 @@ The following event handlers are present Callbacks invoked when the system is being sent to sleep. .It Vt acpi_wakeup_event Callbacks invoked when the system is being woken up. +.It Vt app_coredump_start +Callbacks invoked at start of application core dump. +.It Vt app_coredump_progress +Callbacks invoked during progress of application core dump. +.It Vt app_coredump_finish +Callbacks invoked at finish of application core dump. +.It Vt app_coredump_error +Callbacks invoked on error of application core dump. +.It Vt bpf_track +Callbacks invoked when a BPF listener attaches to/detaches from network interface. +.It Vt cpufreq_levels_changed +Callback invoked when cpu frequence levels have changed. +.It Vt cpufreq_post_change +Callback invoked after cpu frequence has changed. +.It Vt cpufreq_pre_change +Callback invoked before cpu frequence has changed +.It Vt dcons_poll +Callback invoked to poll for dcons changes. .It Vt dev_clone Callbacks invoked when a new entry is created under .Pa /dev . +.It Vt group_attach_event +Callback invoked when an interfance has been added to an interface group. +.It Vt group_change_event +Callback invoked when an change has been made to an interface group. +.It Vt group_detach_event +Callback invoked when an interfance has been removed from an interface group. .It Vt ifaddr_event Callbacks invoked when an address is set up on a network interface. .It Vt if_clone_event Callbacks invoked when an interface is cloned. +.It Vt iflladdr_event +Callback invoked when an if link layer address event has happened. .It Vt ifnet_arrival_event Callbacks invoked when a new network interface appears. .It Vt ifnet_departure_event Callbacks invoked when a network interface is taken down. -.It Vt bpf_track -Callbacks invoked when a BPF listener attaches to/detaches from network interface. +.It Vt ifnet_link_event +Callback invoked when an interfance link event has happened. .It Vt kld_load Callbacks invoked after a linker file has been loaded. .It Vt kld_unload @@ -207,22 +233,75 @@ Callbacks invoked after a linker file ha Callbacks invoked before a linker file is about to be unloaded. These callbacks may be used to return an error and prevent the unload from proceeding. +.It Vt lle_event +Callback invoked when an link layer event has happened. +.It Vt nmbclusters_change +Callback invoked when the number of mbuf clusters has changed. +.It Vt nmbufs_change +Callback invoked when the number of mbufs has changed. +.It Vt maxsockets_change +Callback invoked when the maximum number of sockets has changed. +.It Vt mountroot +Callback invoked when root has been mounted. .It Vt power_profile_change Callbacks invoked when the power profile of the system changes. +.It Vt power_resume +Callback invoked when the system has resumed. +.It Vt power_suspend +Callback invoked just before the system is suspended. +.It Vt process_ctor +Callback invoked when a process is created. +.It Vt process_dtor +Callback invoked when a process is destroyed. .It Vt process_exec Callbacks invoked when a process performs an .Fn exec operation. .It Vt process_exit Callbacks invoked when a process exits. +.It Vt process_fini +Callback invoked when a process memory is destroyed. +This is never called. .It Vt process_fork Callbacks invoked when a process forks a child. +.It Vt process_init +Callback invoked when a process is initalized. +.It Vt random_adaptor_attach +Callback invoked when a new random module has been loaded. +.It Vt register_framebuffer +Callback invoked when a new frame buffer is registered. +.It Vt route_redirect_event +Callback invoked when a route gets redirected to a new location. .It Vt shutdown_pre_sync Callbacks invoked at shutdown time, before file systems are synchronized. .It Vt shutdown_post_sync Callbacks invoked at shutdown time, after all file systems are synchronized. .It Vt shutdown_final Callbacks invoked just before halting the system. +.It Vt tcp_offload_listen_start +Callback invoked for TCP Offload to start listening for new connections. +.It Vt tcp_offload_listen_stop +Callback invoked ror TCP Offload to stop listening for new connections. +.It Vt thread_ctor +Callback invoked when a thread object is created. +.It Vt thread_dtor +Callback invoked when a thread object is destroyed. +.It Vt thread_init +Callback invoked when a thread object is initalized. +.It Vt thread_fini +Callback invoked when a thread object is deinitalized. +.It Vt usb_dev_configured +Callback invoked when a USB device is configured +.It Vt unregister_framebuffer +Callback invoked when a frame buffer is deregistered. +.It Vt vfs_mounted +Callback invoked when a file system is mounted. +.It Vt vfs_unmounted +Callback invoked when a file system is unmounted. +.It Vt vlan_config +Callback invoked when the vlan configuration has changed. +.It Vt vlan_unconfig +Callback invoked when a vlan is destroyed. .It Vt vm_lowmem Callbacks invoked when virtual memory is low. .It Vt watchdog_list From owner-svn-src-head@FreeBSD.ORG Sat Apr 19 19:40:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4923BFA6; Sat, 19 Apr 2014 19:40:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34EDC1875; Sat, 19 Apr 2014 19:40:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3JJeL5A009445; Sat, 19 Apr 2014 19:40:21 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3JJeK59009443; Sat, 19 Apr 2014 19:40:20 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201404191940.s3JJeK59009443@svn.freebsd.org> From: Rick Macklem Date: Sat, 19 Apr 2014 19:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264681 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Apr 2014 19:40:21 -0000 Author: rmacklem Date: Sat Apr 19 19:40:20 2014 New Revision: 264681 URL: http://svnweb.freebsd.org/changeset/base/264681 Log: Modify the NFSv4 client open/create RPC so that it acquires post-open/create directory attributes. This allows the RPC to name cache the newly created file and reduces the lookup RPC count by about 10% for software builds. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clcomsubs.c Sat Apr 19 19:32:54 2014 (r264680) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Sat Apr 19 19:40:20 2014 (r264681) @@ -66,7 +66,7 @@ static struct { { NFSV4OP_READLINK, 2, "Readlink", 8, }, { NFSV4OP_READ, 1, "Read", 4, }, { NFSV4OP_WRITE, 2, "Write", 5, }, - { NFSV4OP_OPEN, 3, "Open", 4, }, + { NFSV4OP_OPEN, 5, "Open", 4, }, { NFSV4OP_CREATE, 3, "Create", 6, }, { NFSV4OP_CREATE, 1, "Create", 6, }, { NFSV4OP_CREATE, 3, "Create", 6, }, Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Sat Apr 19 19:32:54 2014 (r264680) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Sat Apr 19 19:40:20 2014 (r264681) @@ -1956,6 +1956,7 @@ nfsrpc_createv4(vnode_t dvp, char *name, struct nfsmount *nmp; nmp = VFSTONFS(dvp->v_mount); + np = VTONFS(dvp); *unlockedp = 0; *nfhpp = NULL; *dpp = NULL; @@ -2005,17 +2006,22 @@ nfsrpc_createv4(vnode_t dvp, char *name, NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OPEN_CLAIMNULL); (void) nfsm_strtom(nd, name, namelen); + /* Get the new file's handle and attributes. */ NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(NFSV4OP_GETFH); *tl = txdr_unsigned(NFSV4OP_GETATTR); NFSGETATTR_ATTRBIT(&attrbits); (void) nfsrv_putattrbit(nd, &attrbits); + /* Get the directory's post-op attributes. */ + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OP_PUTFH); + (void) nfsm_fhtom(nd, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, 0); + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OP_GETATTR); + (void) nfsrv_putattrbit(nd, &attrbits); error = nfscl_request(nd, dvp, p, cred, dstuff); if (error) return (error); - error = nfscl_wcc_data(nd, dvp, dnap, dattrflagp, NULL, dstuff); - if (error) - goto nfsmout; NFSCL_INCRSEQID(owp->nfsow_seqid, nd); if (nd->nd_repstat == 0) { NFSM_DISSECT(tl, u_int32_t *, NFSX_STATEID + @@ -2087,6 +2093,13 @@ nfsrpc_createv4(vnode_t dvp, char *name, error = nfscl_mtofh(nd, nfhpp, nnap, attrflagp); if (error) goto nfsmout; + /* Get rid of the PutFH and Getattr status values. */ + NFSM_DISSECT(tl, u_int32_t *, 4 * NFSX_UNSIGNED); + /* Load the directory attributes. */ + error = nfsm_loadattr(nd, dnap); + if (error) + goto nfsmout; + *dattrflagp = 1; if (dp != NULL && *attrflagp) { dp->nfsdl_change = nnap->na_filerev; dp->nfsdl_modtime = nnap->na_mtime; @@ -2130,7 +2143,6 @@ nfsrpc_createv4(vnode_t dvp, char *name, if ((rflags & NFSV4OPEN_RESULTCONFIRM) && (owp->nfsow_clp->nfsc_flags & NFSCLFLAGS_GOTDELEG) && !error && dp == NULL) { - np = VTONFS(dvp); do { ret = nfsrpc_openrpc(VFSTONFS(vnode_mount(dvp)), dvp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, From owner-svn-src-head@FreeBSD.ORG Sat Apr 19 20:55:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89E2D632; Sat, 19 Apr 2014 20:55:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 764751DB1; Sat, 19 Apr 2014 20:55:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3JKtqb1041193; Sat, 19 Apr 2014 20:55:52 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3JKtqkg041192; Sat, 19 Apr 2014 20:55:52 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201404192055.s3JKtqkg041192@svn.freebsd.org> From: Michael Tuexen Date: Sat, 19 Apr 2014 20:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264682 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Apr 2014 20:55:52 -0000 Author: tuexen Date: Sat Apr 19 20:55:51 2014 New Revision: 264682 URL: http://svnweb.freebsd.org/changeset/base/264682 Log: Use consistently debug output instead of an unconditional printf. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sat Apr 19 19:40:20 2014 (r264681) +++ head/sys/netinet/sctp_indata.c Sat Apr 19 20:55:51 2014 (r264682) @@ -1002,7 +1002,7 @@ sctp_queue_data_for_reasm(struct sctp_tc * Huh, need the correct STR here, * they must be the same. */ - SCTP_PRINTF("Prev check - Gak, Evil plot, sid:%d not the same as at:%d\n", + SCTPDBG(SCTP_DEBUG_INDATA1, "Prev check - Gak, Evil plot, sid:%d not the same as at:%d\n", chk->rec.data.stream_number, prev->rec.data.stream_number); snprintf(msg, sizeof(msg), From owner-svn-src-head@FreeBSD.ORG Sat Apr 19 22:18:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B690E323; Sat, 19 Apr 2014 22:18:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A310217E3; Sat, 19 Apr 2014 22:18:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3JMIvoJ073683; Sat, 19 Apr 2014 22:18:57 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3JMIvWn073682; Sat, 19 Apr 2014 22:18:57 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404192218.s3JMIvWn073682@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 19 Apr 2014 22:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264683 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Apr 2014 22:18:57 -0000 Author: jilles Date: Sat Apr 19 22:18:57 2014 New Revision: 264683 URL: http://svnweb.freebsd.org/changeset/base/264683 Log: sys/capsicum.h: Remove not very useful visibility guards. Since does not comply to any standards, standards-compliant applications do not include it and it is not useful to restrict what is exposed depending on the requested standard. In addition, the use of types like u_int makes the header fail in strict standards compliance modes anyway. Modified: head/sys/sys/capsicum.h Modified: head/sys/sys/capsicum.h ============================================================================== --- head/sys/sys/capsicum.h Sat Apr 19 20:55:51 2014 (r264682) +++ head/sys/sys/capsicum.h Sat Apr 19 22:18:57 2014 (r264683) @@ -302,16 +302,10 @@ */ #define CAP_FCNTL_GETFL (1 << F_GETFL) #define CAP_FCNTL_SETFL (1 << F_SETFL) -#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 #define CAP_FCNTL_GETOWN (1 << F_GETOWN) #define CAP_FCNTL_SETOWN (1 << F_SETOWN) -#endif -#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 #define CAP_FCNTL_ALL (CAP_FCNTL_GETFL | CAP_FCNTL_SETFL | \ CAP_FCNTL_GETOWN | CAP_FCNTL_SETOWN) -#else -#define CAP_FCNTL_ALL (CAP_FCNTL_GETFL | CAP_FCNTL_SETFL) -#endif #define CAP_IOCTLS_ALL SSIZE_MAX From owner-svn-src-head@FreeBSD.ORG Sun Apr 20 03:27:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41C92991; Sun, 20 Apr 2014 03:27:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EEDD1198; Sun, 20 Apr 2014 03:27:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3K3RdG7099976; Sun, 20 Apr 2014 03:27:39 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3K3Rd3m099975; Sun, 20 Apr 2014 03:27:39 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404200327.s3K3Rd3m099975@svn.freebsd.org> From: Eitan Adler Date: Sun, 20 Apr 2014 03:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264686 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 03:27:39 -0000 Author: eadler Date: Sun Apr 20 03:27:38 2014 New Revision: 264686 URL: http://svnweb.freebsd.org/changeset/base/264686 Log: bsd-family-tree: Add NetBSD 6.1.4, 6.0.5 Part of 6.0.4 is still missing: this really needs to be automated Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Sun Apr 20 01:45:23 2014 (r264685) +++ head/share/misc/bsd-family-tree Sun Apr 20 03:27:38 2014 (r264686) @@ -278,6 +278,12 @@ FreeBSD 5.2 | | | | | | | | | OpenBSD 5.3 DragonFly 3.4.1 | | | | | | NetBSD | | | | | | | | 6.0.3 | | + | | | | | | | | | + | | | | | | NetBSD | | + | | | | | | 6.0.4 | | + | | | | | | | | | + | | | | | | NetBSD | | + | | | | | | 6.0.5 | | | | | | | | | | | | | | | |`-NetBSD 6.1 | | | | FreeBSD | | | | | @@ -289,8 +295,23 @@ FreeBSD 5.2 | | | | | | | DragonFly 3.6.0 | | | | | | *--FreeBSD | | NetBSD 6.1.3 | | - | 10.0 | | | | - | | | | DragonFly 3.6.1 + | 10.0 | | | | | + | | | NetBSD 6.1.4 | DragonFly 3.6.1 + | | | | | + | | | | | + | | | | | + | | | | | + | | | | | + | | | | | + | | | | | + | | | | | + | | | | | + | | | | | + | | | | | + | | | | | + | | | | | + | | | | | + | | | | | | | | | | FreeBSD 11 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -612,6 +633,8 @@ DragonFly 3.6.0 2013-11-25 [DFB] FreeBSD 10.0 2014-01-20 [FBD] NetBSD 6.1.3 2014-01-27 [NBD] DragonFly 3.6.1 2014-02-22 [DFB] +NetBSD 6.0.5 2014-04-19 [NDB] +NetBSD 6.1.4 2014-04-19 [NDB] Bibliography ------------------------ From owner-svn-src-head@FreeBSD.ORG Sun Apr 20 03:29:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3F6BAD4 for ; Sun, 20 Apr 2014 03:29:15 +0000 (UTC) Received: from mail-qg0-x232.google.com (mail-qg0-x232.google.com [IPv6:2607:f8b0:400d:c04::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D71511A2 for ; Sun, 20 Apr 2014 03:29:15 +0000 (UTC) Received: by mail-qg0-f50.google.com with SMTP id j107so926985qga.37 for ; Sat, 19 Apr 2014 20:29:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=6MKmlZJgcRNePXfshuv8kvJ6y4/3+2Hyu2HmQ+/XAbc=; b=Ke/9aXSRCM2kWwEz/xA13LPS3twXEjxkJOllnys+hiFR1i4S27g73kkj9+tIXyvqxW +yWF3yDymTrfcwKjGZkF17w0lD1OKhFBLM0r5WzsdqftvkjXf2mkdrIvxbtASecoM7az 8SJROND4dEqTsqD2vHMev9DR/iGZQxqAYn8Ig= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:content-type; bh=6MKmlZJgcRNePXfshuv8kvJ6y4/3+2Hyu2HmQ+/XAbc=; b=ad6siQBz5kuAwvtM9Axe1aHpZFaf0Zq8NK0TZXqYPBjhk2zBaD8/CnUmM2AnoUqpFy wCwxezYBdCjBqfzl+Ej7QZ01fDouNGcpA4sJFf27s8KK50Qj7YTK+hbMpHPNkSZLmpNy W8Bf8UyGu9GfFqecIFnNDJKwvmKBSpeASNgUejSys3PUDmSK6O2BRKauGnRMMkbwL5dJ 0QIX2hHYKuBLRS36rqb2bGHcUDiTlndekxnAnKEA6YJPylGh+luZiqSI4+FHt8eN0JCb xl2M1meyTy98/uL/R+aXUevXatwAA4xPD77mAYdbO7pBEKRu4ViTxCp3cILm8tJmf8nX TUnA== X-Gm-Message-State: ALoCoQnYtEaqaYtQ7A/MmyZ4kxgJsW7Pll4CsiL9nxi2ky6cEYXZt8DHWny8iPVdNGu52VdS2gVb X-Received: by 10.224.29.206 with SMTP id r14mr101856qac.91.1397964554765; Sat, 19 Apr 2014 20:29:14 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.54.102 with HTTP; Sat, 19 Apr 2014 20:28:44 -0700 (PDT) In-Reply-To: <201404200327.s3K3Rd3m099975@svn.freebsd.org> References: <201404200327.s3K3Rd3m099975@svn.freebsd.org> From: Eitan Adler Date: Sat, 19 Apr 2014 20:28:44 -0700 X-Google-Sender-Auth: PUSq0NppU50LthpIvoYZpZfFwt8 Message-ID: Subject: Re: svn commit: r264686 - head/share/misc To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 03:29:16 -0000 On 19 April 2014 20:27, Eitan Adler wrote: > Author: eadler > Date: Sun Apr 20 03:27:38 2014 > New Revision: 264686 > URL: http://svnweb.freebsd.org/changeset/base/264686 > > Log: > bsd-family-tree: Add NetBSD 6.1.4, 6.0.5 > > Part of 6.0.4 is still missing: this really needs to be automated this file really ought to be a .dot file :-\ -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Sun Apr 20 05:40:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78AC72FD; Sun, 20 Apr 2014 05:40:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62EF61A49; Sun, 20 Apr 2014 05:40:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3K5eE8J053418; Sun, 20 Apr 2014 05:40:14 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3K5eEoG053417; Sun, 20 Apr 2014 05:40:14 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201404200540.s3K5eEoG053417@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sun, 20 Apr 2014 05:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264687 - head/sys/pc98/pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 05:40:14 -0000 Author: nyan Date: Sun Apr 20 05:40:13 2014 New Revision: 264687 URL: http://svnweb.freebsd.org/changeset/base/264687 Log: MFi386: r257858 (by kib) Fix signal delivery for the iBCS2 binaries. Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Sun Apr 20 03:27:38 2014 (r264686) +++ head/sys/pc98/pc98/machdep.c Sun Apr 20 05:40:13 2014 (r264687) @@ -694,6 +694,8 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, regs->tf_esp = (int)sfp; regs->tf_eip = p->p_sysent->sv_sigcode_base; + if (regs->tf_eip == 0) + regs->tf_eip = p->p_sysent->sv_psstrings - szsigcode; regs->tf_eflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; From owner-svn-src-head@FreeBSD.ORG Sun Apr 20 09:17:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 341339E0; Sun, 20 Apr 2014 09:17:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 202761ACD; Sun, 20 Apr 2014 09:17:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3K9Hmin042542; Sun, 20 Apr 2014 09:17:48 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3K9HmwJ042538; Sun, 20 Apr 2014 09:17:48 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201404200917.s3K9HmwJ042538@svn.freebsd.org> From: Martin Matuska Date: Sun, 20 Apr 2014 09:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264689 - in head/sys: net netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 09:17:49 -0000 Author: mm Date: Sun Apr 20 09:17:48 2014 New Revision: 264689 URL: http://svnweb.freebsd.org/changeset/base/264689 Log: Backport from projects/pf r263908: De-virtualize UMA zone pf_mtag_z and move to global initialization part. The m_tag struct does not know about vnet context and the pf_mtag_free() callback is called unaware of current vnet. This causes a panic. MFC after: 1 week Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_ioctl.c Directory Properties: head/ (props changed) head/sys/ (props changed) Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Sun Apr 20 06:46:04 2014 (r264688) +++ head/sys/net/pfvar.h Sun Apr 20 09:17:48 2014 (r264689) @@ -1529,6 +1529,8 @@ VNET_DECLARE(struct pf_rulequeue, pf_unl #define V_pf_unlinked_rules VNET(pf_unlinked_rules) void pf_initialize(void); +void pf_mtag_initialize(void); +void pf_mtag_cleanup(void); void pf_cleanup(void); struct pf_mtag *pf_get_mtag(struct mbuf *); Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sun Apr 20 06:46:04 2014 (r264688) +++ head/sys/netpfil/pf/pf.c Sun Apr 20 09:17:48 2014 (r264689) @@ -187,8 +187,7 @@ struct mtx pf_unlnkdrules_mtx; static VNET_DEFINE(uma_zone_t, pf_sources_z); #define V_pf_sources_z VNET(pf_sources_z) -static VNET_DEFINE(uma_zone_t, pf_mtag_z); -#define V_pf_mtag_z VNET(pf_mtag_z) +uma_zone_t pf_mtag_z; VNET_DEFINE(uma_zone_t, pf_state_z); VNET_DEFINE(uma_zone_t, pf_state_key_z); @@ -283,7 +282,7 @@ static int pf_insert_src_node(struct p struct pf_rule *, struct pf_addr *, sa_family_t); static u_int pf_purge_expired_states(u_int, int); static void pf_purge_unlinked_rules(void); -static int pf_mtag_init(void *, int, int); +static int pf_mtag_uminit(void *, int, int); static void pf_mtag_free(struct m_tag *); #ifdef INET static void pf_route(struct mbuf **, struct pf_rule *, int, @@ -726,7 +725,16 @@ pf_free_src_nodes(struct pf_src_node_lis return (count); } -/* Data storage structures initialization. */ +void +pf_mtag_initialize() +{ + + pf_mtag_z = uma_zcreate("pf mtags", sizeof(struct m_tag) + + sizeof(struct pf_mtag), NULL, NULL, pf_mtag_uminit, NULL, + UMA_ALIGN_PTR, 0); +} + +/* Per-vnet data storage structures initialization. */ void pf_initialize() { @@ -785,10 +793,6 @@ pf_initialize() V_pf_altqs_active = &V_pf_altqs[0]; V_pf_altqs_inactive = &V_pf_altqs[1]; - /* Mbuf tags */ - V_pf_mtag_z = uma_zcreate("pf mtags", sizeof(struct m_tag) + - sizeof(struct pf_mtag), NULL, NULL, pf_mtag_init, NULL, - UMA_ALIGN_PTR, 0); /* Send & overload+flush queues. */ STAILQ_INIT(&V_pf_sendqueue); @@ -804,6 +808,13 @@ pf_initialize() } void +pf_mtag_cleanup() +{ + + uma_zdestroy(pf_mtag_z); +} + +void pf_cleanup() { struct pf_keyhash *kh; @@ -840,14 +851,13 @@ pf_cleanup() mtx_destroy(&pf_overloadqueue_mtx); mtx_destroy(&pf_unlnkdrules_mtx); - uma_zdestroy(V_pf_mtag_z); uma_zdestroy(V_pf_sources_z); uma_zdestroy(V_pf_state_z); uma_zdestroy(V_pf_state_key_z); } static int -pf_mtag_init(void *mem, int size, int how) +pf_mtag_uminit(void *mem, int size, int how) { struct m_tag *t; @@ -864,7 +874,7 @@ static void pf_mtag_free(struct m_tag *t) { - uma_zfree(V_pf_mtag_z, t); + uma_zfree(pf_mtag_z, t); } struct pf_mtag * @@ -875,7 +885,7 @@ pf_get_mtag(struct mbuf *m) if ((mtag = m_tag_find(m, PACKET_TAG_PF, NULL)) != NULL) return ((struct pf_mtag *)(mtag + 1)); - mtag = uma_zalloc(V_pf_mtag_z, M_NOWAIT); + mtag = uma_zalloc(pf_mtag_z, M_NOWAIT); if (mtag == NULL) return (NULL); bzero(mtag + 1, sizeof(struct pf_mtag)); Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Sun Apr 20 06:46:04 2014 (r264688) +++ head/sys/netpfil/pf/pf_ioctl.c Sun Apr 20 09:17:48 2014 (r264689) @@ -208,6 +208,8 @@ pfattach(void) u_int32_t *my_timeout = V_pf_default_rule.timeout; int error; + if (IS_DEFAULT_VNET(curvnet)) + pf_mtag_initialize(); pf_initialize(); pfr_initialize(); pfi_initialize(); @@ -3725,6 +3727,8 @@ pf_unload(void) pfr_cleanup(); pf_osfp_flush(); pf_cleanup(); + if (IS_DEFAULT_VNET(curvnet)) + pf_mtag_cleanup(); PF_RULES_WUNLOCK(); destroy_dev(pf_dev); rw_destroy(&pf_rules_lock); From owner-svn-src-head@FreeBSD.ORG Sun Apr 20 11:34:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BE266CA; Sun, 20 Apr 2014 11:34:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 282F01639; Sun, 20 Apr 2014 11:34:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3KBYa65098780; Sun, 20 Apr 2014 11:34:36 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3KBYYZn098766; Sun, 20 Apr 2014 11:34:34 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201404201134.s3KBYYZn098766@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 20 Apr 2014 11:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264691 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 11:34:36 -0000 Author: des Date: Sun Apr 20 11:34:33 2014 New Revision: 264691 URL: http://svnweb.freebsd.org/changeset/base/264691 Log: Apply upstream patch for EC calculation bug and bump version addendum. Modified: head/crypto/openssh/bufaux.c head/crypto/openssh/compat.c head/crypto/openssh/compat.h head/crypto/openssh/ssh_config head/crypto/openssh/ssh_config.5 head/crypto/openssh/sshconnect2.c head/crypto/openssh/sshd.c head/crypto/openssh/sshd_config head/crypto/openssh/sshd_config.5 head/crypto/openssh/version.h Modified: head/crypto/openssh/bufaux.c ============================================================================== --- head/crypto/openssh/bufaux.c Sun Apr 20 11:17:44 2014 (r264690) +++ head/crypto/openssh/bufaux.c Sun Apr 20 11:34:33 2014 (r264691) @@ -1,4 +1,4 @@ -/* $OpenBSD: bufaux.c,v 1.56 2014/02/02 03:44:31 djm Exp $ */ +/* $OpenBSD: bufaux.c,v 1.57 2014/04/16 23:22:45 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -372,6 +372,9 @@ buffer_put_bignum2_from_string(Buffer *b if (l > 8 * 1024) fatal("%s: length %u too long", __func__, l); + /* Skip leading zero bytes */ + for (; l > 0 && *s == 0; l--, s++) + ; p = buf = xmalloc(l + 1); /* * If most significant bit is set then prepend a zero byte to Modified: head/crypto/openssh/compat.c ============================================================================== --- head/crypto/openssh/compat.c Sun Apr 20 11:17:44 2014 (r264690) +++ head/crypto/openssh/compat.c Sun Apr 20 11:34:33 2014 (r264691) @@ -97,6 +97,9 @@ compat_datafellows(const char *version) { "Sun_SSH_1.0*", SSH_BUG_NOREKEY|SSH_BUG_EXTEOF}, { "OpenSSH_4*", 0 }, { "OpenSSH_5*", SSH_NEW_OPENSSH|SSH_BUG_DYNAMIC_RPORT}, + { "OpenSSH_6.6.1*", SSH_NEW_OPENSSH}, + { "OpenSSH_6.5*," + "OpenSSH_6.6*", SSH_NEW_OPENSSH|SSH_BUG_CURVE25519PAD}, { "OpenSSH*", SSH_NEW_OPENSSH }, { "*MindTerm*", 0 }, { "2.1.0*", SSH_BUG_SIGBLOB|SSH_BUG_HMAC| @@ -263,7 +266,6 @@ compat_cipher_proposal(char *cipher_prop return cipher_prop; } - char * compat_pkalg_proposal(char *pkalg_prop) { @@ -277,3 +279,16 @@ compat_pkalg_proposal(char *pkalg_prop) return pkalg_prop; } +char * +compat_kex_proposal(char *kex_prop) +{ + if (!(datafellows & SSH_BUG_CURVE25519PAD)) + return kex_prop; + debug2("%s: original KEX proposal: %s", __func__, kex_prop); + kex_prop = filter_proposal(kex_prop, "curve25519-sha256@libssh.org"); + debug2("%s: compat KEX proposal: %s", __func__, kex_prop); + if (*kex_prop == '\0') + fatal("No supported key exchange algorithms found"); + return kex_prop; +} + Modified: head/crypto/openssh/compat.h ============================================================================== --- head/crypto/openssh/compat.h Sun Apr 20 11:17:44 2014 (r264690) +++ head/crypto/openssh/compat.h Sun Apr 20 11:34:33 2014 (r264691) @@ -60,7 +60,9 @@ #define SSH_BUG_RFWD_ADDR 0x02000000 #define SSH_NEW_OPENSSH 0x04000000 #define SSH_BUG_DYNAMIC_RPORT 0x08000000 -#define SSH_BUG_LARGEWINDOW 0x10000000 +#define SSH_BUG_CURVE25519PAD 0x10000000 + +#define SSH_BUG_LARGEWINDOW 0x80000000 void enable_compat13(void); void enable_compat20(void); @@ -68,6 +70,7 @@ void compat_datafellows(const char * int proto_spec(const char *); char *compat_cipher_proposal(char *); char *compat_pkalg_proposal(char *); +char *compat_kex_proposal(char *); extern int compat13; extern int compat20; Modified: head/crypto/openssh/ssh_config ============================================================================== --- head/crypto/openssh/ssh_config Sun Apr 20 11:17:44 2014 (r264690) +++ head/crypto/openssh/ssh_config Sun Apr 20 11:34:33 2014 (r264691) @@ -48,4 +48,4 @@ # ProxyCommand ssh -q -W %h:%p gateway.example.com # RekeyLimit 1G 1h # VerifyHostKeyDNS yes -# VersionAddendum FreeBSD-20140324 +# VersionAddendum FreeBSD-20140420 Modified: head/crypto/openssh/ssh_config.5 ============================================================================== --- head/crypto/openssh/ssh_config.5 Sun Apr 20 11:17:44 2014 (r264690) +++ head/crypto/openssh/ssh_config.5 Sun Apr 20 11:34:33 2014 (r264691) @@ -1423,7 +1423,7 @@ See also VERIFYING HOST KEYS in Specifies a string to append to the regular version string to identify OS- or site-specific modifications. The default is -.Dq FreeBSD-20140324 . +.Dq FreeBSD-20140420 . .It Cm VisualHostKey If this flag is set to .Dq yes , Modified: head/crypto/openssh/sshconnect2.c ============================================================================== --- head/crypto/openssh/sshconnect2.c Sun Apr 20 11:17:44 2014 (r264690) +++ head/crypto/openssh/sshconnect2.c Sun Apr 20 11:34:33 2014 (r264691) @@ -207,6 +207,8 @@ ssh_kex2(char *host, struct sockaddr *ho } if (options.kex_algorithms != NULL) myproposal[PROPOSAL_KEX_ALGS] = options.kex_algorithms; + myproposal[PROPOSAL_KEX_ALGS] = compat_kex_proposal( + myproposal[PROPOSAL_KEX_ALGS]); if (options.rekey_limit || options.rekey_interval) packet_set_rekey_limits((u_int32_t)options.rekey_limit, Modified: head/crypto/openssh/sshd.c ============================================================================== --- head/crypto/openssh/sshd.c Sun Apr 20 11:17:44 2014 (r264690) +++ head/crypto/openssh/sshd.c Sun Apr 20 11:34:33 2014 (r264691) @@ -2528,6 +2528,9 @@ do_ssh2_kex(void) if (options.kex_algorithms != NULL) myproposal[PROPOSAL_KEX_ALGS] = options.kex_algorithms; + myproposal[PROPOSAL_KEX_ALGS] = compat_kex_proposal( + myproposal[PROPOSAL_KEX_ALGS]); + if (options.rekey_limit || options.rekey_interval) packet_set_rekey_limits((u_int32_t)options.rekey_limit, (time_t)options.rekey_interval); Modified: head/crypto/openssh/sshd_config ============================================================================== --- head/crypto/openssh/sshd_config Sun Apr 20 11:17:44 2014 (r264690) +++ head/crypto/openssh/sshd_config Sun Apr 20 11:34:33 2014 (r264691) @@ -120,7 +120,7 @@ #MaxStartups 10:30:100 #PermitTunnel no #ChrootDirectory none -#VersionAddendum FreeBSD-20140324 +#VersionAddendum FreeBSD-20140420 # no default banner path #Banner none Modified: head/crypto/openssh/sshd_config.5 ============================================================================== --- head/crypto/openssh/sshd_config.5 Sun Apr 20 11:17:44 2014 (r264690) +++ head/crypto/openssh/sshd_config.5 Sun Apr 20 11:34:33 2014 (r264691) @@ -1253,7 +1253,7 @@ restrictions. Optionally specifies additional text to append to the SSH protocol banner sent by the server upon connection. The default is -.Dq FreeBSD-20140324 . +.Dq FreeBSD-20140420 . .It Cm X11DisplayOffset Specifies the first display number available for .Xr sshd 8 Ns 's Modified: head/crypto/openssh/version.h ============================================================================== --- head/crypto/openssh/version.h Sun Apr 20 11:17:44 2014 (r264690) +++ head/crypto/openssh/version.h Sun Apr 20 11:34:33 2014 (r264691) @@ -1,10 +1,10 @@ /* $OpenBSD: version.h,v 1.70 2014/02/27 22:57:40 djm Exp $ */ /* $FreeBSD$ */ -#define SSH_VERSION "OpenSSH_6.6" +#define SSH_VERSION "OpenSSH_6.6.1" #define SSH_PORTABLE "p1" #define SSH_RELEASE SSH_VERSION SSH_PORTABLE -#define SSH_VERSION_FREEBSD "FreeBSD-20140324" +#define SSH_VERSION_FREEBSD "FreeBSD-20140420" #define SSH_VERSION_HPN "_hpn13v11" From owner-svn-src-head@FreeBSD.ORG Sun Apr 20 13:37:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9016380D; Sun, 20 Apr 2014 13:37:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D494107C; Sun, 20 Apr 2014 13:37:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3KDbMgx047582; Sun, 20 Apr 2014 13:37:22 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3KDbMl9047581; Sun, 20 Apr 2014 13:37:22 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404201337.s3KDbMl9047581@svn.freebsd.org> From: Ian Lepore Date: Sun, 20 Apr 2014 13:37:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264694 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 13:37:22 -0000 Author: ian Date: Sun Apr 20 13:37:22 2014 New Revision: 264694 URL: http://svnweb.freebsd.org/changeset/base/264694 Log: Fix a comment typo; conversion tables are for leap years, not leap seconds. Modified: head/sys/kern/subr_fattime.c Modified: head/sys/kern/subr_fattime.c ============================================================================== --- head/sys/kern/subr_fattime.c Sun Apr 20 13:12:32 2014 (r264693) +++ head/sys/kern/subr_fattime.c Sun Apr 20 13:37:22 2014 (r264694) @@ -51,7 +51,7 @@ * The 'utc' argument determines if the resulting FATTIME timestamp * should be on the UTC or local timezone calendar. * - * The conversion functions below cut time into four-year leap-second + * The conversion functions below cut time into four-year leap-year * cycles rather than single years and uses table lookups inside those * cycles to get the months and years sorted out. * From owner-svn-src-head@FreeBSD.ORG Sun Apr 20 14:58:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1240248; Sun, 20 Apr 2014 14:58:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80DDD1633; Sun, 20 Apr 2014 14:58:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3KEwGYC079821; Sun, 20 Apr 2014 14:58:16 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3KEwFQx079814; Sun, 20 Apr 2014 14:58:15 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201404201458.s3KEwFQx079814@svn.freebsd.org> From: Andrew Turner Date: Sun, 20 Apr 2014 14:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264696 - head/lib/libc/arm/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 14:58:16 -0000 Author: andrew Date: Sun Apr 20 14:58:14 2014 New Revision: 264696 URL: http://svnweb.freebsd.org/changeset/base/264696 Log: Add the deprecated fp{get,set}* functions, a few ports use them. Added: head/lib/libc/arm/gen/fpgetmask.c (contents, props changed) head/lib/libc/arm/gen/fpgetround.c (contents, props changed) head/lib/libc/arm/gen/fpgetsticky.c (contents, props changed) head/lib/libc/arm/gen/fpsetmask.c (contents, props changed) head/lib/libc/arm/gen/fpsetround.c (contents, props changed) head/lib/libc/arm/gen/fpsetsticky.c (contents, props changed) Modified: head/lib/libc/arm/gen/Makefile.inc Modified: head/lib/libc/arm/gen/Makefile.inc ============================================================================== --- head/lib/libc/arm/gen/Makefile.inc Sun Apr 20 14:45:17 2014 (r264695) +++ head/lib/libc/arm/gen/Makefile.inc Sun Apr 20 14:58:14 2014 (r264696) @@ -9,3 +9,8 @@ SRCS+= _ctx_start.S _setjmp.S _set_tp.c .if ${MK_ARM_EABI} == "no" SRCS+= divsi3.S .endif + +.if ${MACHINE_ARCH} == "armv6hf" +SRCS+= fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c fpsetround.c \ + fpsetsticky.c +.endif Added: head/lib/libc/arm/gen/fpgetmask.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/gen/fpgetmask.c Sun Apr 20 14:58:14 2014 (r264696) @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef __weak_alias +__weak_alias(fpgetmask,_fpgetmask) +#endif + +#define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP) + +fp_except_t +fpgetmask(void) +{ + fp_except mask; + + __asm __volatile("vmrs %0, fpscr" : "=&r"(mask)); + + return ((mask >> 8) & FP_X_MASK); +} + Added: head/lib/libc/arm/gen/fpgetround.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/gen/fpgetround.c Sun Apr 20 14:58:14 2014 (r264696) @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef __weak_alias +__weak_alias(fpgetround,_fpgetround) +#endif + +fp_rnd_t +fpgetround(void) +{ + uint32_t fpscr; + + __asm __volatile("vmrs %0, fpscr" : "=&r"(fpscr)); + + return ((fpscr >> 22) & 3); +} + Added: head/lib/libc/arm/gen/fpgetsticky.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/gen/fpgetsticky.c Sun Apr 20 14:58:14 2014 (r264696) @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef __weak_alias +__weak_alias(fpgetsticky,_fpgetsticky) +#endif + +#define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP) + +fp_except +fpgetsticky(void) +{ + fp_except old; + + __asm __volatile("vmrs %0, fpscr" : "=&r"(old)); + + return (old & FP_X_MASK); +} + Added: head/lib/libc/arm/gen/fpsetmask.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/gen/fpsetmask.c Sun Apr 20 14:58:14 2014 (r264696) @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef __weak_alias +__weak_alias(fpsetmask,_fpsetmask) +#endif + +#define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP) + +fp_except_t +fpsetmask(fp_except_t mask) +{ + fp_except old, new; + + __asm __volatile("vmrs %0, fpscr" : "=&r"(old)); + mask = (mask & FP_X_MASK) << 8; + new = (old & ~(FP_X_MASK << 8)) | mask; + __asm __volatile("vmsr fpscr, %0" : : "r"(old)); + + return ((old >> 8) & FP_X_MASK); +} + Added: head/lib/libc/arm/gen/fpsetround.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/gen/fpsetround.c Sun Apr 20 14:58:14 2014 (r264696) @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef __weak_alias +__weak_alias(fpsetround,_fpsetround) +#endif + +fp_rnd_t +fpsetround(fp_rnd_t rnd_dir) +{ + uint32_t old, new; + + __asm __volatile("vmrs %0, fpscr" : "=&r"(old)); + new = old & ~(3 << 22); + new |= rnd_dir << 22; + __asm __volatile("vmsr fpscr, %0" : : "r"(new)); + + return ((old >> 22) & 3); +} + Added: head/lib/libc/arm/gen/fpsetsticky.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/gen/fpsetsticky.c Sun Apr 20 14:58:14 2014 (r264696) @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef __weak_alias +__weak_alias(fpsetsticky,_fpsetsticky) +#endif + +#define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP) + +fp_except +fpsetsticky(fp_except except) +{ + fp_except old, new; + + __asm __volatile("vmrs %0, fpscr" : "=&r"(old)); + new = old & ~(FP_X_MASK); + new &= ~except; + __asm __volatile("vmsr fpscr, %0" : : "r"(new)); + + return (old & except); +} + From owner-svn-src-head@FreeBSD.ORG Sun Apr 20 16:33:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 326815FD; Sun, 20 Apr 2014 16:33:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EBCE1D49; Sun, 20 Apr 2014 16:33:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3KGXSGd028866; Sun, 20 Apr 2014 16:33:28 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3KGXSD2028865; Sun, 20 Apr 2014 16:33:28 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404201633.s3KGXSD2028865@svn.freebsd.org> From: Glen Barber Date: Sun, 20 Apr 2014 16:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264697 - head/release/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 16:33:29 -0000 Author: gjb Date: Sun Apr 20 16:33:28 2014 New Revision: 264697 URL: http://svnweb.freebsd.org/changeset/base/264697 Log: When building the 'xdev' target when WITH_GCC=1 and WITHOUT_CLANG_IS_CC=1, it appears WITHOUT_CLANG=1 must also be set. While here, reorder the lines to put the WITH_* and WITHOUT_* entries on the same line. MFC After: 3 days X-MFC-With: r264518 Tested on: stable/10@r264677 Sponsored by: The FreeBSD Foundation Modified: head/release/arm/release.sh Modified: head/release/arm/release.sh ============================================================================== --- head/release/arm/release.sh Sun Apr 20 14:58:14 2014 (r264696) +++ head/release/arm/release.sh Sun Apr 20 16:33:28 2014 (r264697) @@ -98,8 +98,9 @@ main() { eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/cc \ WITH_GCC=1 ${WORLD_FLAGS} -j1 obj depend all install # Build the 'xdev' target for crochet. - eval chroot ${CHROOTDIR} make -C /usr/src WITHOUT_CLANG_IS_CC=1 \ - XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} WITH_GCC=1 \ + eval chroot ${CHROOTDIR} make -C /usr/src \ + WITHOUT_CLANG_IS_CC=1 WITHOUT_CLANG=1 WITH_GCC=1 \ + XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} ${WORLD_FLAGS} xdev # Run the ldconfig(8) startup script so /var/run/ld-elf*.so.hints From owner-svn-src-head@FreeBSD.ORG Sun Apr 20 16:34:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F13A73C; Sun, 20 Apr 2014 16:34:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BD211D53; Sun, 20 Apr 2014 16:34:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3KGYAhx028985; Sun, 20 Apr 2014 16:34:10 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3KGYAco028984; Sun, 20 Apr 2014 16:34:10 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404201634.s3KGYAco028984@svn.freebsd.org> From: Glen Barber Date: Sun, 20 Apr 2014 16:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264698 - head/release/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 16:34:11 -0000 Author: gjb Date: Sun Apr 20 16:34:10 2014 New Revision: 264698 URL: http://svnweb.freebsd.org/changeset/base/264698 Log: Fix EOL escape. MFC after: 3 days X-MFC-With: r264697 Sponsored by: The FreeBSD Foundation Modified: head/release/arm/release.sh Modified: head/release/arm/release.sh ============================================================================== --- head/release/arm/release.sh Sun Apr 20 16:33:28 2014 (r264697) +++ head/release/arm/release.sh Sun Apr 20 16:34:10 2014 (r264698) @@ -100,7 +100,7 @@ main() { # Build the 'xdev' target for crochet. eval chroot ${CHROOTDIR} make -C /usr/src \ WITHOUT_CLANG_IS_CC=1 WITHOUT_CLANG=1 WITH_GCC=1 \ - XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} + XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} \ ${WORLD_FLAGS} xdev # Run the ldconfig(8) startup script so /var/run/ld-elf*.so.hints From owner-svn-src-head@FreeBSD.ORG Sun Apr 20 18:15:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E12CA58; Sun, 20 Apr 2014 18:15:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7ABD61684; Sun, 20 Apr 2014 18:15:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3KIFOeY069322; Sun, 20 Apr 2014 18:15:24 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3KIFO5c069321; Sun, 20 Apr 2014 18:15:24 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201404201815.s3KIFO5c069321@svn.freebsd.org> From: Michael Tuexen Date: Sun, 20 Apr 2014 18:15:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264701 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 18:15:24 -0000 Author: tuexen Date: Sun Apr 20 18:15:23 2014 New Revision: 264701 URL: http://svnweb.freebsd.org/changeset/base/264701 Log: Send also a packet containing an ABORT chunk in response to an OOTB packet containing a COOKIE-ECHO chunk. MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Apr 20 17:24:27 2014 (r264700) +++ head/sys/netinet/sctputil.c Sun Apr 20 18:15:23 2014 (r264701) @@ -4047,9 +4047,6 @@ sctp_handle_ootb(struct mbuf *m, int iph case SCTP_INIT: contains_init_chunk = 1; break; - case SCTP_COOKIE_ECHO: - /* We hit here only if the assoc is being freed */ - return; case SCTP_PACKET_DROPPED: /* we don't respond to pkt-dropped */ return; From owner-svn-src-head@FreeBSD.ORG Sun Apr 20 18:21:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68F9BC40; Sun, 20 Apr 2014 18:21:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5613816A6; Sun, 20 Apr 2014 18:21:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3KIL6OS072037; Sun, 20 Apr 2014 18:21:06 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3KIL6UW072036; Sun, 20 Apr 2014 18:21:06 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404201821.s3KIL6UW072036@svn.freebsd.org> From: Ian Lepore Date: Sun, 20 Apr 2014 18:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264702 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 18:21:06 -0000 Author: ian Date: Sun Apr 20 18:21:05 2014 New Revision: 264702 URL: http://svnweb.freebsd.org/changeset/base/264702 Log: Remove uncessary cache and TLB maintenance ops. - These were needed on armv4/5 (VIVT cache), not needed on armv6. - The wbinv_all call can't be used on SMP systems; cache operations by set/way are not broadcast to other cores. - The TLB maintenance operations needed for pmap_growkernel() happen in pmap_grow_l2_bucket(), so there's no need to flush all TLB entries at the end. - There may not be any need for the TLB flush at the beginning of pmap_release(), but it's left in for now pending more investigation. Pointed out by: Svatopluk Kraus Discussed with: cognet@ Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sun Apr 20 18:15:23 2014 (r264701) +++ head/sys/arm/arm/pmap-v6.c Sun Apr 20 18:21:05 2014 (r264702) @@ -1988,8 +1988,6 @@ pmap_release(pmap_t pmap) { struct pcb *pcb; - cpu_idcache_wbinv_all(); - cpu_l2cache_wbinv_all(); cpu_tlb_flushID(); cpu_cpwait(); if (vector_page < KERNBASE) { @@ -2175,14 +2173,6 @@ pmap_growkernel(vm_offset_t addr) for (; pmap_curmaxkvaddr < addr; pmap_curmaxkvaddr += L1_S_SIZE) pmap_grow_l2_bucket(kpmap, pmap_curmaxkvaddr); - /* - * flush out the cache, expensive but growkernel will happen so - * rarely - */ - cpu_dcache_wbinv_all(); - cpu_l2cache_wbinv_all(); - cpu_tlb_flushD(); - cpu_cpwait(); kernel_vm_end = pmap_curmaxkvaddr; } From owner-svn-src-head@FreeBSD.ORG Sun Apr 20 18:25:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0349ADB2; Sun, 20 Apr 2014 18:25:50 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id A19B2173B; Sun, 20 Apr 2014 18:25:49 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 879AA782094; Mon, 21 Apr 2014 04:02:36 +1000 (EST) Date: Mon, 21 Apr 2014 04:02:35 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrew Turner Subject: Re: svn commit: r264696 - head/lib/libc/arm/gen In-Reply-To: <201404201458.s3KEwFQx079814@svn.freebsd.org> Message-ID: <20140421011410.E8569@besplex.bde.org> References: <201404201458.s3KEwFQx079814@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=QIpRGG7L c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=_0BtgO3-ezQA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=FYdb16HlwN49KzZiXeYA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 18:25:50 -0000 On Sun, 20 Apr 2014, Andrew Turner wrote: > Log: > Add the deprecated fp{get,set}* functions, a few ports use them. > > Added: > head/lib/libc/arm/gen/fpgetmask.c (contents, props changed) > head/lib/libc/arm/gen/fpgetround.c (contents, props changed) > head/lib/libc/arm/gen/fpgetsticky.c (contents, props changed) > head/lib/libc/arm/gen/fpsetmask.c (contents, props changed) > head/lib/libc/arm/gen/fpsetround.c (contents, props changed) > head/lib/libc/arm/gen/fpsetsticky.c (contents, props changed) These obsolete i386 APIs are hard to kill. They keep coming back for new arches. I don't see how most of them can even be used on those of the new arches including arm where they are not declared in any header. They used to be declared in an opt-out way in , but preparation for killing them in ~2008 removed the declarations there. The declarations are now opt-in in . Many arches are now broken by having a different set of declarations than what they implement. Perhaps it is not broken to have no declarations, but this is unclear, and in amd64 there is a declaration for an unimplemented function. These functions in libc but not declared in any header are supposed to be for binary compatibility only. Soft-float already has these mistakes, but binary compatibility of hard-float with mistakes in soft-float shouldn't be needed. > Added: head/lib/libc/arm/gen/fpsetsticky.c > +#ifdef __weak_alias > +__weak_alias(fpsetsticky,_fpsetsticky) This seems to be backwards. It aliases the non-polluting name to the polluting name. There is no need for a non-polluting name if the polluting one is unavoidable. All libc code for fp* aliases has the same bug (mips/hardfloat, softfloat). The pollution is smaller for some private (sic) public symbols in shared libraries, but this public symbol is exported. Even private public symbols need underscores for the static case. > +#endif > + > +#define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP) Style bug (space insted of tab). > ... > +fp_except > +fpsetsticky(fp_except except) > +{ > + fp_except old, new; > + > + __asm __volatile("vmrs %0, fpscr" : "=&r"(old)); > + new = old & ~(FP_X_MASK); Style bug (bogus parentheses). > + new &= ~except; > + __asm __volatile("vmsr fpscr, %0" : : "r"(new)); > + Style bug (extra blank line). > + return (old & except); > +} fpsetsticky() and fpresetsticky() are especially bogus and not needed for new arches. There is considerable confusion about their name, and some old arches have either never had them or have removed 1 or both of them, even in object files. fpresetsticky() seems to be the correct name, and fpsetsticky() just a FreeBSD mistake. fpsetsticky() was never documented in FreeBSD's man page for such things (fpgetround.3), but I think it was the most popular spelling. It was removed for i386 in 2008. Googling it then and now shows almost no hits for it outside of FreeBSD, and mostly old hits for FreeBSD. fpresetsticky() was once fairly standard (see google). It was obsoleted by femumble() in C99. i386 still has fpresetsticky() for API compatibility. On i386, the fp* functions were always static inlines. This keeps them out of libraries, so they don't have any ABI to be compatible with. But on many new arches, they get into libc for compatibility and then cause even more ABI compatibility problems than they avoided. fpresetsticky() is still the only one documented. It is documented for all arches, only old arches should have it. This is not even wrong for new arches. New arches tend to have the the never-documented fpsetsticky() instead :-(. Arch-dependent ifdefs would be needed to select the wrong function. On i386, the situation is as described above (inline functions with only fpsetsticky() removed and fpresetsticky() fully available as an inline function but not as an extern function). On amd64: from amd64/include/ieeefp.h: % #if !defined(__IEEEFP_NOINLINES__) && defined(__GNUCLIKE_ASM) % % #define fpgetmask() __fpgetmask() % #define fpgetprec() __fpgetprec() % #define fpgetround() __fpgetround() % #define fpgetsticky() __fpgetsticky() % #define fpsetmask(m) __fpsetmask(m) % #define fpsetprec(m) __fpsetprec(m) % #define fpsetround(m) __fpsetround(m) These are the internal declarations (in terms of inline functions), with no style bugs and both setsticky functions intentionally left out. One reason that they were left out is that the confusion between their names makes it unclude whether they set or clear bits (there was a PR or 2 about this). Another is just to see what breaks when they are killed. Apparently nothing. % % #else /* !(!__IEEEFP_NOINLINES__ && __GNUCLIKE_ASM) */ % % /* Augment the userland declarations. */ % __BEGIN_DECLS % extern fp_rnd_t fpgetround(void); % extern fp_rnd_t fpsetround(fp_rnd_t); % extern fp_except_t fpgetmask(void); % extern fp_except_t fpsetmask(fp_except_t); % extern fp_except_t fpgetsticky(void); % extern fp_except_t fpsetsticky(fp_except_t); The above mound of style bugs (with unsorting, redundant externs and corrupt tabs) was copied here and perhaps to some other MD ieeefp.h's from the MI ieeefp.h. Similarly for some other arches. % fp_prec_t fpgetprec(void); % fp_prec_t fpsetprec(fp_prec_t); These prototypes are here because these were the only APIs that were not declared in the MI ieeefp.h. They have no style bugs since the file was originally more carefully written. Note that all of these prototypes are very rarely used. I think their only practical use is to quieten -Wmumble when this file is used to implement the public functions in libc. I don't know why amd64 has regressed relative to i386 by making this obsolete API more available (i386 only has it as inlines via macros). Other arches only ever had the public functions, so they always had a binary compatibility problem if anyone actually used these functions. % __END_DECLS % % #endif /* !__IEEEFP_NOINLINES__ && __GNUCLIKE_ASM */ arm ieeefp.h doesn't declare any of the functions (unless you changed it recently). arm libc now implements 6 (?) of the functions. arm ieeefp.h is completely unusable in applications even for testing the exception flags, since it doesn't declare the standard type fp_except_t, but only fp_except. fp_except_t is documented as being #define'd as int. This is broken on all arches except amd64 and i386 -- it is a typedef on the others, except on arm where it doesn't exist. Many other style bugs (mostly formatting and punctuation) can be fixed by copying from i386. ia64 ieeefp.h declares the 4 functions that libc implements. It has fewer style bugs than arm ieeefp.h, but it has gross namespace pollution (nested include of ). ia64 doesn't declare or implement either get or set of sticky. mips ieeefp.h doesn't declare any of the functions, but mips libc implements 6 in hardfloat and softfloat, including both get and set of sticky (hopefully set sticky is actually reset sticky = clear). I think softfloat applies to arm too. A different naming scheme (with a hardfloat subdir) is used for mips hardfloat. mips ieeefp.h also has fp_except but is not missing fp_except_t. It also has fp_rnd alongside fp_rnd_t. Perhaps the _t suffixes were another old i386 mistake. powerpc ieeefp.h declares 5 functions. powerpc libc implements all 5 (not et of sticky). spardc64 is like powerpc. The following arches have a public fpsetsticky: mips/hardfloat, softfloat, and now arm(hardfloat?). 8 functions are documented, but most arches don't have runtime-modifiable precision, so there are normally 6 functions. Omitting reset of sticky gives 5, and omitting get of sticky gives 4. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Apr 20 20:46:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53559AA0; Sun, 20 Apr 2014 20:46:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40BEC133A; Sun, 20 Apr 2014 20:46:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3KKk78o033198; Sun, 20 Apr 2014 20:46:07 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3KKk7Vp033197; Sun, 20 Apr 2014 20:46:07 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404202046.s3KKk7Vp033197@svn.freebsd.org> From: Glen Barber Date: Sun, 20 Apr 2014 20:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264703 - head/release/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 20:46:07 -0000 Author: gjb Date: Sun Apr 20 20:46:06 2014 New Revision: 264703 URL: http://svnweb.freebsd.org/changeset/base/264703 Log: Apply a slightly different color hammer to arm/release.sh: - gcc(1) fails to build usr.bin/dtc - lack of WITH_GNUCXX=1 causes cc1plus(1) calls to fail - u-boot fails to build with clang (hard-coded gcc(1) calls) Implement the proper incantation of WITH_/WITHOUT_ knobs to get arm snapshot builds working again. Since the cc(1) binary is no longer expected to be clang(1), remove the chroot(8) post-install cc(1) overwrite. MFC After: 3 days X-MFC-With: r264518,r264697,r264698 Tested on: stable/10@r264677 RPI-B Sponsored by: The FreeBSD Foundation Modified: head/release/arm/release.sh Modified: head/release/arm/release.sh ============================================================================== --- head/release/arm/release.sh Sun Apr 20 18:21:05 2014 (r264702) +++ head/release/arm/release.sh Sun Apr 20 20:46:06 2014 (r264703) @@ -92,14 +92,9 @@ install_uboot() { } main() { - # Build gcc for use in the chroot for arm builds. - # This is not '-j'-safe, so force '-j1' to allow using - # additional, non-'-j' options specified in WORLD_FLAGS. - eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/cc \ - WITH_GCC=1 ${WORLD_FLAGS} -j1 obj depend all install # Build the 'xdev' target for crochet. eval chroot ${CHROOTDIR} make -C /usr/src \ - WITHOUT_CLANG_IS_CC=1 WITHOUT_CLANG=1 WITH_GCC=1 \ + WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1 \ XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} \ ${WORLD_FLAGS} xdev From owner-svn-src-head@FreeBSD.ORG Sun Apr 20 20:49:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 425ACC1A; Sun, 20 Apr 2014 20:49:34 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail0.glenbarber.us", Issuer "Gandi Standard SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 140ED134F; Sun, 20 Apr 2014 20:49:33 +0000 (UTC) Received: from glenbarber.us (c-71-224-221-174.hsd1.nj.comcast.net [71.224.221.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id A599613E07; Sun, 20 Apr 2014 20:49:32 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us A599613E07 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Sun, 20 Apr 2014 16:49:31 -0400 From: Glen Barber To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r264703 - head/release/arm Message-ID: <20140420204931.GV49791@glenbarber.us> References: <201404202046.s3KKk7Vp033197@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1AtvaQRkIQxkm1Oe" Content-Disposition: inline In-Reply-To: <201404202046.s3KKk7Vp033197@svn.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 20:49:34 -0000 --1AtvaQRkIQxkm1Oe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 20, 2014 at 08:46:07PM +0000, Glen Barber wrote: > Author: gjb > Date: Sun Apr 20 20:46:06 2014 > New Revision: 264703 > URL: http://svnweb.freebsd.org/changeset/base/264703 >=20 > Log: > Apply a slightly different color hammer to arm/release.sh: > =20 > - gcc(1) fails to build usr.bin/dtc > - lack of WITH_GNUCXX=3D1 causes cc1plus(1) calls to fail > - u-boot fails to build with clang (hard-coded gcc(1) calls) > =20 > Implement the proper incantation of WITH_/WITHOUT_ knobs > to get arm snapshot builds working again. > =20 > Since the cc(1) binary is no longer expected to be clang(1), > remove the chroot(8) post-install cc(1) overwrite. > =20 The wording here is backwards post-edit. It should have stated "because we no longer need to overwrite cc(1) with clang(1),...". Glen --1AtvaQRkIQxkm1Oe Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTVDLbAAoJELls3eqvi17Qm/4P/3ElkHnRlVVY2Sj7fklpSGCY W1g4PrYIs0ONZBQdvFKSzBsAs8N74bGoCTcOxe33bMSg+lo2YsqhNgiTBUvucD96 EJVdTrFqz/fTQAvWxotYLfHxcQFrb0mdQpDSi9/A7YcY5b4LZjkwMR1A1avCkvpD PDX845YynniIN3JyXqDaV0yN5GHgsYtembcKV6Mie5jjRWPQLsUTMc5mmyVw2iQy 7fiJRQoShRkrutXwrqESaIvMCq0nfOutwoYJUc4ZzUcd4TfWNC0TniP4V1KcXItc QkgPPz/o2DpqJmtiPGSv5An+Uajr7MG7+MFpl4WWBTkiGF7BLOcWaQLSra0UMq02 4q9/89pkkllgro6E+CaqubOuLaqvZufnqhFDEs7+O9+4lwuG1JU/FA0hr/s1bi30 4WOBQH7o7KF5hoT/Tbf/ebfOXUihHyXpf7oSWJBqWQd2MXwrmprNHtx1NmATaPH3 YNuJxWOJvhOb5lq93GyGVKLmNX55Hwhcq6yVhb0iM3l6MJ2H7O04UYgYbEldme/L ZzBt7331e5QIQ37fS2o0Q9H+UKj/nEIYqToCaWNS7QZ8B6NEFUUXymcmDFq9FLq7 RORUkcjAcbgtmxZtDDfCH2uXVNaoxIXIm9B0tQOxEmODWGak+IwYAd6C9o+b1TfA r3irBtGrm7aTRL7JA8qI =3OVQ -----END PGP SIGNATURE----- --1AtvaQRkIQxkm1Oe-- From owner-svn-src-head@FreeBSD.ORG Sun Apr 20 21:11:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D504117F; Sun, 20 Apr 2014 21:11:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7B0315B9; Sun, 20 Apr 2014 21:11:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3KLBdPT044980; Sun, 20 Apr 2014 21:11:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3KLBdLP044978; Sun, 20 Apr 2014 21:11:39 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201404202111.s3KLBdLP044978@svn.freebsd.org> From: Michael Tuexen Date: Sun, 20 Apr 2014 21:11:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264704 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 21:11:39 -0000 Author: tuexen Date: Sun Apr 20 21:11:39 2014 New Revision: 264704 URL: http://svnweb.freebsd.org/changeset/base/264704 Log: Add consistency checks to ensure that fragments of a user message have the same U-bit. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun Apr 20 20:46:06 2014 (r264703) +++ head/sys/netinet/sctp_indata.c Sun Apr 20 21:11:39 2014 (r264704) @@ -828,7 +828,6 @@ sctp_queue_data_for_reasm(struct sctp_tc { struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - uint32_t cum_ackp1, prev_tsn, post_tsn; struct sctp_tmit_chunk *at, *prev, *next; @@ -1017,6 +1016,24 @@ sctp_queue_data_for_reasm(struct sctp_tc *abort_flag = 1; return; } + if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != + (prev->rec.data.rcv_flags & SCTP_DATA_UNORDERED)) { + /* + * Huh, need the same ordering here, + * they must be the same. + */ + SCTPDBG(SCTP_DEBUG_INDATA1, "Prev check - Gak, Evil plot, U-bit not constant\n"); + snprintf(msg, sizeof(msg), + "Expect U-bit=%d for TSN=%8.8x, got U-bit=%d", + (prev->rec.data.rcv_flags & SCTP_DATA_UNORDERED) ? 1 : 0, + chk->rec.data.TSN_seq, + (chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) ? 1 : 0); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_7; + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); + *abort_flag = 1; + return; + } if ((prev->rec.data.rcv_flags & SCTP_DATA_UNORDERED) == 0 && chk->rec.data.stream_seq != prev->rec.data.stream_seq) { @@ -1127,6 +1144,24 @@ sctp_queue_data_for_reasm(struct sctp_tc *abort_flag = 1; return; } + if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != + (next->rec.data.rcv_flags & SCTP_DATA_UNORDERED)) { + /* + * Huh, need the same ordering here, + * they must be the same. + */ + SCTPDBG(SCTP_DEBUG_INDATA1, "Next check - Gak, Evil plot, U-bit not constant\n"); + snprintf(msg, sizeof(msg), + "Expect U-bit=%d for TSN=%8.8x, got U-bit=%d", + (next->rec.data.rcv_flags & SCTP_DATA_UNORDERED) ? 1 : 0, + chk->rec.data.TSN_seq, + (chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) ? 1 : 0); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_12; + sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); + *abort_flag = 1; + return; + } if ((next->rec.data.rcv_flags & SCTP_DATA_UNORDERED) == 0 && chk->rec.data.stream_seq != next->rec.data.stream_seq) { From owner-svn-src-head@FreeBSD.ORG Sun Apr 20 22:19:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FB29B73; Sun, 20 Apr 2014 22:19:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E72A219E6; Sun, 20 Apr 2014 22:19:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3KMJ0lC070083; Sun, 20 Apr 2014 22:19:00 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3KMJ0iR070081; Sun, 20 Apr 2014 22:19:00 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201404202219.s3KMJ0iR070081@svn.freebsd.org> From: Rick Macklem Date: Sun, 20 Apr 2014 22:19:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264705 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2014 22:19:01 -0000 Author: rmacklem Date: Sun Apr 20 22:19:00 2014 New Revision: 264705 URL: http://svnweb.freebsd.org/changeset/base/264705 Log: Modify the NFSv4 client create/mkdir RPC so that it acquires post-create/mkdir directory attributes. This allows the RPC to name cache the newly created directory and reduces the lookup RPC count for applications creating a lot of directories. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clcomsubs.c Sun Apr 20 21:11:39 2014 (r264704) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Sun Apr 20 22:19:00 2014 (r264705) @@ -67,7 +67,7 @@ static struct { { NFSV4OP_READ, 1, "Read", 4, }, { NFSV4OP_WRITE, 2, "Write", 5, }, { NFSV4OP_OPEN, 5, "Open", 4, }, - { NFSV4OP_CREATE, 3, "Create", 6, }, + { NFSV4OP_CREATE, 5, "Create", 6, }, { NFSV4OP_CREATE, 1, "Create", 6, }, { NFSV4OP_CREATE, 3, "Create", 6, }, { NFSV4OP_REMOVE, 1, "Remove", 6, }, Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Sun Apr 20 21:11:39 2014 (r264704) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Sun Apr 20 22:19:00 2014 (r264705) @@ -2545,10 +2545,12 @@ nfsrpc_mkdir(vnode_t dvp, char *name, in struct nfsrv_descript nfsd, *nd = &nfsd; nfsattrbit_t attrbits; int error = 0; + struct nfsfh *fhp; *nfhpp = NULL; *attrflagp = 0; *dattrflagp = 0; + fhp = VTONFS(dvp)->n_fhp; if (namelen > NFS_MAXNAMLEN) return (ENAMETOOLONG); NFSCL_REQSTART(nd, NFSPROC_MKDIR, dvp); @@ -2564,6 +2566,12 @@ nfsrpc_mkdir(vnode_t dvp, char *name, in *tl++ = txdr_unsigned(NFSV4OP_GETFH); *tl = txdr_unsigned(NFSV4OP_GETATTR); (void) nfsrv_putattrbit(nd, &attrbits); + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OP_PUTFH); + (void) nfsm_fhtom(nd, fhp->nfh_fh, fhp->nfh_len, 0); + NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); + *tl = txdr_unsigned(NFSV4OP_GETATTR); + (void) nfsrv_putattrbit(nd, &attrbits); } error = nfscl_request(nd, dvp, p, cred, dstuff); if (error) @@ -2577,6 +2585,14 @@ nfsrpc_mkdir(vnode_t dvp, char *name, in } if (!error) error = nfscl_mtofh(nd, nfhpp, nnap, attrflagp); + if (!error) { + /* Get rid of the PutFH and Getattr status values. */ + NFSM_DISSECT(tl, u_int32_t *, 4 * NFSX_UNSIGNED); + /* Load the directory attributes. */ + error = nfsm_loadattr(nd, dnap); + if (error == 0) + *dattrflagp = 1; + } } if ((nd->nd_flag & ND_NFSV3) && !error) error = nfscl_wcc_data(nd, dvp, dnap, dattrflagp, NULL, dstuff); From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 01:02:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33A3A821; Mon, 21 Apr 2014 01:02:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F9C21785; Mon, 21 Apr 2014 01:02:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3L12n3h039425; Mon, 21 Apr 2014 01:02:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3L12nWm039424; Mon, 21 Apr 2014 01:02:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404210102.s3L12nWm039424@svn.freebsd.org> From: Adrian Chadd Date: Mon, 21 Apr 2014 01:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264708 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 01:02:50 -0000 Author: adrian Date: Mon Apr 21 01:02:49 2014 New Revision: 264708 URL: http://svnweb.freebsd.org/changeset/base/264708 Log: Fix a cleanup hang if cleanup gets called _during_ an active cleanup. During power save testing I noticed that the cleanup code is being called during a RUN->RUN state transition. It's because the net80211 stack is treating that (for reasons I don't quitey know yet) as a reassociation and this calls the node cleanup code. The reason it's seeing a RUN->RUN transition is because during active power save stuff it's possible that the RUN->SLEEP and SLEEP->RUN transitions happen so quickly that the deferred net80211 vap state code "loses" a transition, namely the intermediary SLEEP transition. So, this was causing the node reassociation code to sometimes be called twice in quick succession and this would result in ath_tx_tid_cleanup() to be called again. The code calling it would always call pause, and then only call resume if the TID didn't have "cleanup_inprogress" set. Unfortunately it didn't check if it was already set on entry, so it would pause but not call resume. Thus, paused would be called more than once (once before each entry into ath-tx_tid_cleanup()) but resume would only be called once when the cleanup state was finished. This doesn't entirely fix all of the issues seen in the cleanup path but it's a necessary first step. Since this is a stability fix, it should be merged to stable/10 at some point. Tested: * AR5416, STA mode MFC after: 7 days Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sun Apr 20 23:01:56 2014 (r264707) +++ head/sys/dev/ath/if_ath_tx.c Mon Apr 21 01:02:49 2014 (r264708) @@ -5789,12 +5789,26 @@ ath_addba_stop(struct ieee80211_node *ni */ TAILQ_INIT(&bf_cq); ATH_TX_LOCK(sc); - ath_tx_tid_cleanup(sc, an, tid, &bf_cq); + /* - * Unpause the TID if no cleanup is required. + * In case there's a followup call to this, only call it + * if we don't have a cleanup in progress. + * + * Since we've paused the queue above, we need to make + * sure we unpause if there's already a cleanup in + * progress - it means something else is also doing + * this stuff, so we don't need to also keep it paused. */ - if (! atid->cleanup_inprogress) + if (atid->cleanup_inprogress) { ath_tx_tid_resume(sc, atid); + } else { + ath_tx_tid_cleanup(sc, an, tid, &bf_cq); + /* + * Unpause the TID if no cleanup is required. + */ + if (! atid->cleanup_inprogress) + ath_tx_tid_resume(sc, atid); + } ATH_TX_UNLOCK(sc); /* Handle completing frames and fail them */ @@ -5828,19 +5842,25 @@ ath_tx_node_reassoc(struct ath_softc *sc tid = &an->an_tid[i]; if (tid->hwq_depth == 0) continue; - ath_tx_tid_pause(sc, tid); DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: TID %d: cleaning up TID\n", __func__, an->an_node.ni_macaddr, ":", i); - ath_tx_tid_cleanup(sc, an, i, &bf_cq); /* - * Unpause the TID if no cleanup is required. + * In case there's a followup call to this, only call it + * if we don't have a cleanup in progress. */ - if (! tid->cleanup_inprogress) - ath_tx_tid_resume(sc, tid); + if (! tid->cleanup_inprogress) { + ath_tx_tid_pause(sc, tid); + ath_tx_tid_cleanup(sc, an, i, &bf_cq); + /* + * Unpause the TID if no cleanup is required. + */ + if (! tid->cleanup_inprogress) + ath_tx_tid_resume(sc, tid); + } } ATH_TX_UNLOCK(sc); From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 02:04:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4F74EAC; Mon, 21 Apr 2014 02:04:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C135A1C05; Mon, 21 Apr 2014 02:04:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3L24b2h064067; Mon, 21 Apr 2014 02:04:37 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3L24bVh064066; Mon, 21 Apr 2014 02:04:37 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404210204.s3L24bVh064066@svn.freebsd.org> From: Eitan Adler Date: Mon, 21 Apr 2014 02:04:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264709 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 02:04:37 -0000 Author: eadler Date: Mon Apr 21 02:04:37 2014 New Revision: 264709 URL: http://svnweb.freebsd.org/changeset/base/264709 Log: bsd-family-tree: Add missing releases - NetBSD 6.0.4 - DragonFly 3.6.2 Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Mon Apr 21 01:02:49 2014 (r264708) +++ head/share/misc/bsd-family-tree Mon Apr 21 02:04:37 2014 (r264709) @@ -299,6 +299,7 @@ FreeBSD 5.2 | | | | | NetBSD 6.1.4 | DragonFly 3.6.1 | | | | | | | | | | + | | | | DragonFly 3.6.2 | | | | | | | | | | | | | | | @@ -631,8 +632,10 @@ Mac OS X 10.9 2013-10-22 [APL] OpenBSD 5.4 2013-11-01 [OBD] DragonFly 3.6.0 2013-11-25 [DFB] FreeBSD 10.0 2014-01-20 [FBD] +NetBSD 6.0.4 2014-01-27 [NBD] NetBSD 6.1.3 2014-01-27 [NBD] DragonFly 3.6.1 2014-02-22 [DFB] +DragonFly 3.6.2 2014-03-27 [DFB] NetBSD 6.0.5 2014-04-19 [NDB] NetBSD 6.1.4 2014-04-19 [NDB] From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 02:05:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE62FFE6; Mon, 21 Apr 2014 02:05:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA43F1C0A; Mon, 21 Apr 2014 02:05:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3L25p1E064241; Mon, 21 Apr 2014 02:05:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3L25p9U064240; Mon, 21 Apr 2014 02:05:51 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404210205.s3L25p9U064240@svn.freebsd.org> From: Adrian Chadd Date: Mon, 21 Apr 2014 02:05:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264710 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 02:05:51 -0000 Author: adrian Date: Mon Apr 21 02:05:51 2014 New Revision: 264710 URL: http://svnweb.freebsd.org/changeset/base/264710 Log: Make sure bf_next is NULL'ed out when we're completing up an aggregate frame through the cleanup path. Whilst here, fix the indenting for something I messed up. Tested: * AR5416, STA mode Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon Apr 21 02:04:37 2014 (r264709) +++ head/sys/dev/ath/if_ath_tx.c Mon Apr 21 02:05:51 2014 (r264710) @@ -4600,10 +4600,11 @@ ath_tx_comp_cleanup_aggr(struct ath_soft ATH_TX_UNLOCK(sc); - /* Handle frame completion */ + /* Handle frame completion as individual frames */ bf = bf_first; while (bf) { bf_next = bf->bf_next; + bf->bf_next = NULL; ath_tx_default_comp(sc, bf, 1); bf = bf_next; } @@ -5849,7 +5850,7 @@ ath_tx_node_reassoc(struct ath_softc *sc ":", i); /* - * In case there's a followup call to this, only call it + * In case there's a followup call to this, only call it * if we don't have a cleanup in progress. */ if (! tid->cleanup_inprogress) { From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 02:09:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A996F271; Mon, 21 Apr 2014 02:09:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9641B1C43; Mon, 21 Apr 2014 02:09:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3L29Eux064608; Mon, 21 Apr 2014 02:09:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3L29EG8064607; Mon, 21 Apr 2014 02:09:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404210209.s3L29EG8064607@svn.freebsd.org> From: Adrian Chadd Date: Mon, 21 Apr 2014 02:09:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264711 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 02:09:14 -0000 Author: adrian Date: Mon Apr 21 02:09:14 2014 New Revision: 264711 URL: http://svnweb.freebsd.org/changeset/base/264711 Log: * Modify the debugging output from pause/resume to note the TID and STA MAC * Now that the paused < 0 bugs have been identified, make the DPRINTF() a device_printf() again. Anything else that shows up here needs to be fixed immediately. Tested: * AR5416, STA mode MFC after: 7 days Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon Apr 21 02:05:51 2014 (r264710) +++ head/sys/dev/ath/if_ath_tx.c Mon Apr 21 02:09:14 2014 (r264711) @@ -3244,8 +3244,11 @@ ath_tx_tid_pause(struct ath_softc *sc, s ATH_TX_LOCK_ASSERT(sc); tid->paused++; - DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: paused = %d\n", - __func__, tid->paused); + DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: [%6D]: tid=%d, paused = %d\n", + __func__, + tid->an->an_node.ni_macaddr, ":", + tid->tid, + tid->paused); } /* @@ -3262,15 +3265,21 @@ ath_tx_tid_resume(struct ath_softc *sc, * until it's actually resolved. */ if (tid->paused == 0) { - DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, - "%s: %6D: paused=0?\n", __func__, - tid->an->an_node.ni_macaddr, ":"); + device_printf(sc->sc_dev, + "%s: [%6D]: tid=%d, paused=0?\n", + __func__, + tid->an->an_node.ni_macaddr, ":", + tid->tid); } else { tid->paused--; } - DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: unpaused = %d\n", - __func__, tid->paused); + DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, + "%s: [%6D]: tid=%d, unpaused = %d\n", + __func__, + tid->an->an_node.ni_macaddr, ":", + tid->tid, + tid->paused); if (tid->paused) return; From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 02:09:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9F073A5; Mon, 21 Apr 2014 02:09:34 +0000 (UTC) Received: from mail-qa0-x230.google.com (mail-qa0-x230.google.com [IPv6:2607:f8b0:400d:c00::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89A1D1C45; Mon, 21 Apr 2014 02:09:34 +0000 (UTC) Received: by mail-qa0-f48.google.com with SMTP id s7so3306582qap.7 for ; Sun, 20 Apr 2014 19:09:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=97QBpPdGY9f08yQd0Ia5i9NwKDEH80d+KxWbj0NnrrU=; b=AtjD2lIdYVUNazCbsXz2Tppok0qofwJ2gyMdN6pcTVAhEIZ1pCHu/dFH4VLCJUNOZr +iJU0Rpzh4l1zSmAfGcrGfV7eEvPXZKcegzYNtXUVmgavLYsuR7tOHBUFWvDYBi7HxhT XePaRHg3bFADFpDdivtGOwJjcA9gbVjmflK9DDAvXILx47GvtRH360Bj0/m02Tlmiqze Ntpe0MaxS6hJu2/NuYHoZaCZyPjsrArPAhySZAuqMxgWSVn/326PRsphM0HuwauPUJOq GZdCUMdux89EbBxCbTg9NgnxCVjaA2phShN+FrKRgXiWcj8ESdlOvZDN6XyCbKis7oeh DGUw== MIME-Version: 1.0 X-Received: by 10.140.51.74 with SMTP id t68mr16726006qga.50.1398046173682; Sun, 20 Apr 2014 19:09:33 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.191.201 with HTTP; Sun, 20 Apr 2014 19:09:33 -0700 (PDT) In-Reply-To: <201404210205.s3L25p9U064240@svn.freebsd.org> References: <201404210205.s3L25p9U064240@svn.freebsd.org> Date: Sun, 20 Apr 2014 19:09:33 -0700 X-Google-Sender-Auth: 5s6UC9TSbDobfDs9Ngj8IVGEb3g Message-ID: Subject: Re: svn commit: r264710 - head/sys/dev/ath From: Adrian Chadd To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 02:09:35 -0000 I didn't say it in the commit message, but this should be MFCed to stable/10 . -a On 20 April 2014 19:05, Adrian Chadd wrote: > Author: adrian > Date: Mon Apr 21 02:05:51 2014 > New Revision: 264710 > URL: http://svnweb.freebsd.org/changeset/base/264710 > > Log: > Make sure bf_next is NULL'ed out when we're completing up an aggregate > frame through the cleanup path. > > Whilst here, fix the indenting for something I messed up. > > Tested: > > * AR5416, STA mode > > Modified: > head/sys/dev/ath/if_ath_tx.c > > Modified: head/sys/dev/ath/if_ath_tx.c > ============================================================================== > --- head/sys/dev/ath/if_ath_tx.c Mon Apr 21 02:04:37 2014 (r264709) > +++ head/sys/dev/ath/if_ath_tx.c Mon Apr 21 02:05:51 2014 (r264710) > @@ -4600,10 +4600,11 @@ ath_tx_comp_cleanup_aggr(struct ath_soft > > ATH_TX_UNLOCK(sc); > > - /* Handle frame completion */ > + /* Handle frame completion as individual frames */ > bf = bf_first; > while (bf) { > bf_next = bf->bf_next; > + bf->bf_next = NULL; > ath_tx_default_comp(sc, bf, 1); > bf = bf_next; > } > @@ -5849,7 +5850,7 @@ ath_tx_node_reassoc(struct ath_softc *sc > ":", > i); > /* > - * In case there's a followup call to this, only call it > + * In case there's a followup call to this, only call it > * if we don't have a cleanup in progress. > */ > if (! tid->cleanup_inprogress) { > From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 04:29:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A063827C for ; Mon, 21 Apr 2014 04:29:09 +0000 (UTC) Received: from mail-ig0-f176.google.com (mail-ig0-f176.google.com [209.85.213.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66A6818B4 for ; Mon, 21 Apr 2014 04:29:09 +0000 (UTC) Received: by mail-ig0-f176.google.com with SMTP id uy17so1413880igb.15 for ; Sun, 20 Apr 2014 21:29:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=TEY2hXWYyy78VmrAkUdmFmIPf0sIWZOLbABf/6uCtPM=; b=CwKUQXAjLIuEQVNQ1E60rBJWxhwHCti+ME2yZeHkgY6dEHZZP0+HSAz+ncgi8VuPda km3QazYv8OuzsTY/w1U479/5LaZjHb6LkA1xJO5FxJh9MZr6AjcfLEJmydS61F7FHpDY li5pzG0slPk/DIr7cJAlqfRaH6eJy1IhNrgcPn1PSUx07LpVjMW4MAop0G+PBFJsrSUz OplGmAgF3S81HLrwN2bm5q4YWuwoKYpdiCtD4VSbk4ueh1H45aIAyjI34PY7YR+cEQGD qgc8wc3+3u02RCX9WRWldlmvgK/w7mMCvjytii33aGUXzSGd0uTMekolsNXtd26bm+Ba 6Sng== X-Gm-Message-State: ALoCoQk/KJA2oig7fRXvu/Ttl/VHEcCezs2+Es2zB28RVxofHN2C7TnaPaATf2GVHN1Iqr0MwWTe X-Received: by 10.50.66.3 with SMTP id b3mr19989567igt.22.1398054548376; Sun, 20 Apr 2014 21:29:08 -0700 (PDT) Received: from netflix-mac.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id vk7sm5524057igb.1.2014.04.20.21.29.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 20 Apr 2014 21:29:07 -0700 (PDT) Sender: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264703 - head/release/arm From: Warner Losh In-Reply-To: <20140420204931.GV49791@glenbarber.us> Date: Sun, 20 Apr 2014 22:29:16 -0600 Content-Transfer-Encoding: 7bit Message-Id: References: <201404202046.s3KKk7Vp033197@svn.freebsd.org> <20140420204931.GV49791@glenbarber.us> To: Glen Barber X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 04:29:09 -0000 On Apr 20, 2014, at 2:49 PM, Glen Barber wrote: > On Sun, Apr 20, 2014 at 08:46:07PM +0000, Glen Barber wrote: >> Author: gjb >> Date: Sun Apr 20 20:46:06 2014 >> New Revision: 264703 >> URL: http://svnweb.freebsd.org/changeset/base/264703 >> >> Log: >> Apply a slightly different color hammer to arm/release.sh: >> >> - gcc(1) fails to build usr.bin/dtc >> - lack of WITH_GNUCXX=1 causes cc1plus(1) calls to fail >> - u-boot fails to build with clang (hard-coded gcc(1) calls) >> >> Implement the proper incantation of WITH_/WITHOUT_ knobs >> to get arm snapshot builds working again. >> >> Since the cc(1) binary is no longer expected to be clang(1), >> remove the chroot(8) post-install cc(1) overwrite. >> > > The wording here is backwards post-edit. It should have stated "because > we no longer need to overwrite cc(1) with clang(1),...". Yea, WITH/WITHOUT_CLANG_IS_CC must die. Warner From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 06:07:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 546BDA25; Mon, 21 Apr 2014 06:07:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32A9B10CF; Mon, 21 Apr 2014 06:07:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3L678lB062986; Mon, 21 Apr 2014 06:07:08 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3L678KU062985; Mon, 21 Apr 2014 06:07:08 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404210607.s3L678KU062985@svn.freebsd.org> From: Adrian Chadd Date: Mon, 21 Apr 2014 06:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264720 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 06:07:09 -0000 Author: adrian Date: Mon Apr 21 06:07:08 2014 New Revision: 264720 URL: http://svnweb.freebsd.org/changeset/base/264720 Log: Rewrite the cleanup code to, well, actually work right. The existing cleanup code was based on the Atheros reference driver from way back and stuff that was in Linux ath9k. It turned out to be .. rather silly. Specifically: * The whole method of determining whether there's hardware-queued frames was fragile and the BAW would never quite work right afterwards. * The cleanup path wouldn't correctly pull apart aggregate frames in the queue, so frames would not be freed and the BAW wouldn't be correctly updated. So to implement this: * Pull the aggregate frames apart correctly and handle each separately; * Make the atid->incomp counter just track the number of hardware queued frames rather than try to figure it out from the BAW; * Modify the aggregate completion path to handle it as a single frame (atid->incomp tracks the one frame now, not the subframes) and remove the frames from the BAW before completing them as normal frames; * Make sure bf->bf_next is NULled out correctly; * Make both aggregate session and non-aggregate path frames now be handled via the incompletion path. TODO: * kill atid->incomp; the driver tracks the hardware queued frames for each TID and so we can just use that. This is a stability fix that should be merged back to stable/10. Tested: * AR5416, STA MFC after: 7 days Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon Apr 21 02:55:46 2014 (r264719) +++ head/sys/dev/ath/if_ath_tx.c Mon Apr 21 06:07:08 2014 (r264720) @@ -4108,6 +4108,19 @@ ath_tx_normal_comp(struct ath_softc *sc, DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: hwq_depth < 0: %d\n", __func__, atid->hwq_depth); + /* If the TID is being cleaned up, track things */ + /* XXX refactor! */ + if (atid->cleanup_inprogress) { + atid->incomp--; + if (atid->incomp == 0) { + DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, + "%s: TID %d: cleaned up! resume!\n", + __func__, tid); + atid->cleanup_inprogress = 0; + ath_tx_tid_resume(sc, atid); + } + } + /* * If the queue is filtered, potentially mark it as complete * and reschedule it as needed. @@ -4155,6 +4168,16 @@ ath_tx_comp_cleanup_unaggr(struct ath_so ATH_TX_LOCK(sc); atid->incomp--; + + /* XXX refactor! */ + if (bf->bf_state.bfs_dobaw) { + ath_tx_update_baw(sc, an, atid, bf); + if (!bf->bf_state.bfs_addedbaw) + DPRINTF(sc, ATH_DEBUG_SW_TX, + "%s: wasn't added: seqno %d\n", + __func__, SEQNO(bf->bf_state.bfs_seqno)); + } + if (atid->incomp == 0) { DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: TID %d: cleaned up! resume!\n", @@ -4167,14 +4190,72 @@ ath_tx_comp_cleanup_unaggr(struct ath_so ath_tx_default_comp(sc, bf, 0); } + +/* + * This as it currently stands is a bit dumb. Ideally we'd just + * fail the frame the normal way and have it permanently fail + * via the normal aggregate completion path. + */ +static void +ath_tx_tid_cleanup_frame(struct ath_softc *sc, struct ath_node *an, + int tid, struct ath_buf *bf_head, ath_bufhead *bf_cq) +{ + struct ath_tid *atid = &an->an_tid[tid]; + struct ath_buf *bf, *bf_next; + + ATH_TX_LOCK_ASSERT(sc); + + /* + * Remove this frame from the queue. + */ + ATH_TID_REMOVE(atid, bf_head, bf_list); + + /* + * Loop over all the frames in the aggregate. + */ + bf = bf_head; + while (bf != NULL) { + bf_next = bf->bf_next; /* next aggregate frame, or NULL */ + + /* + * If it's been added to the BAW we need to kick + * it out of the BAW before we continue. + * + * XXX if it's an aggregate, assert that it's in the + * BAW - we shouldn't have it be in an aggregate + * otherwise! + */ + if (bf->bf_state.bfs_addedbaw) { + ath_tx_update_baw(sc, an, atid, bf); + bf->bf_state.bfs_dobaw = 0; + } + + /* + * Give it the default completion handler. + */ + bf->bf_comp = ath_tx_normal_comp; + bf->bf_next = NULL; + + /* + * Add it to the list to free. + */ + TAILQ_INSERT_TAIL(bf_cq, bf, bf_list); + + /* + * Now advance to the next frame in the aggregate. + */ + bf = bf_next; + } +} + /* * Performs transmit side cleanup when TID changes from aggregated to - * unaggregated. + * unaggregated and during reassociation. * - * - Discard all retry frames from the s/w queue. - * - Fix the tx completion function for all buffers in s/w queue. - * - Count the number of unacked frames, and let transmit completion - * handle it later. + * For now, this just tosses everything from the TID software queue + * whether or not it has been retried and marks the TID as + * pending completion if there's anything for this TID queued to + * the hardware. * * The caller is responsible for pausing the TID and unpausing the * TID if no cleanup was required. Otherwise the cleanup path will @@ -4185,18 +4266,19 @@ ath_tx_tid_cleanup(struct ath_softc *sc, ath_bufhead *bf_cq) { struct ath_tid *atid = &an->an_tid[tid]; - struct ieee80211_tx_ampdu *tap; struct ath_buf *bf, *bf_next; ATH_TX_LOCK_ASSERT(sc); DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, - "%s: TID %d: called\n", __func__, tid); + "%s: TID %d: called; inprogress=%d\n", __func__, tid, + atid->cleanup_inprogress); /* * Move the filtered frames to the TX queue, before * we run off and discard/process things. */ + /* XXX this is really quite inefficient */ while ((bf = ATH_TID_FILT_LAST(atid, ath_bufhead_s)) != NULL) { ATH_TID_FILT_REMOVE(atid, bf, bf_list); @@ -4211,47 +4293,35 @@ ath_tx_tid_cleanup(struct ath_softc *sc, */ bf = ATH_TID_FIRST(atid); while (bf) { - if (bf->bf_state.bfs_isretried) { - bf_next = TAILQ_NEXT(bf, bf_list); - ATH_TID_REMOVE(atid, bf, bf_list); - if (bf->bf_state.bfs_dobaw) { - ath_tx_update_baw(sc, an, atid, bf); - if (!bf->bf_state.bfs_addedbaw) - DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, - "%s: wasn't added: seqno %d\n", - __func__, - SEQNO(bf->bf_state.bfs_seqno)); - } - bf->bf_state.bfs_dobaw = 0; - /* - * Call the default completion handler with "fail" just - * so upper levels are suitably notified about this. - */ - TAILQ_INSERT_TAIL(bf_cq, bf, bf_list); - bf = bf_next; - continue; - } - /* Give these the default completion handler */ - bf->bf_comp = ath_tx_normal_comp; - bf = TAILQ_NEXT(bf, bf_list); + /* + * Grab the next frame in the list, we may + * be fiddling with the list. + */ + bf_next = TAILQ_NEXT(bf, bf_list); + + /* + * Free the frame and all subframes. + */ + ath_tx_tid_cleanup_frame(sc, an, tid, bf, bf_cq); + + /* + * Next frame! + */ + bf = bf_next; } /* - * Calculate what hardware-queued frames exist based - * on the current BAW size. Ie, what frames have been - * added to the TX hardware queue for this TID but - * not yet ACKed. + * If there's anything in the hardware queue we wait + * for the TID HWQ to empty. */ - tap = ath_tx_get_tx_tid(an, tid); - /* Need the lock - fiddling with BAW */ - while (atid->baw_head != atid->baw_tail) { - if (atid->tx_buf[atid->baw_head]) { - atid->incomp++; - atid->cleanup_inprogress = 1; - atid->tx_buf[atid->baw_head] = NULL; - } - INCR(atid->baw_head, ATH_TID_MAX_BUFS); - INCR(tap->txa_start, IEEE80211_SEQ_RANGE); + if (atid->hwq_depth > 0) { + /* + * XXX how about we kill atid->incomp, and instead + * replace it with a macro that checks that atid->hwq_depth + * is 0? + */ + atid->incomp = atid->hwq_depth; + atid->cleanup_inprogress = 1; } if (atid->cleanup_inprogress) @@ -4584,9 +4654,19 @@ ath_tx_comp_cleanup_aggr(struct ath_soft ATH_TX_LOCK(sc); /* update incomp */ + atid->incomp--; + + /* Update the BAW */ bf = bf_first; while (bf) { - atid->incomp--; + /* XXX refactor! */ + if (bf->bf_state.bfs_dobaw) { + ath_tx_update_baw(sc, an, atid, bf); + if (!bf->bf_state.bfs_addedbaw) + DPRINTF(sc, ATH_DEBUG_SW_TX, + "%s: wasn't added: seqno %d\n", + __func__, SEQNO(bf->bf_state.bfs_seqno)); + } bf = bf->bf_next; } From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 09:43:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9236EF1; Mon, 21 Apr 2014 09:43:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8755A12C9; Mon, 21 Apr 2014 09:43:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3L9hORr051429; Mon, 21 Apr 2014 09:43:24 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3L9hNUp051421; Mon, 21 Apr 2014 09:43:23 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201404210943.s3L9hNUp051421@svn.freebsd.org> From: Andrew Turner Date: Mon, 21 Apr 2014 09:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264721 - head/lib/libc/arm/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 09:43:24 -0000 Author: andrew Date: Mon Apr 21 09:43:22 2014 New Revision: 264721 URL: http://svnweb.freebsd.org/changeset/base/264721 Log: Rename the fp{get,set}* files so they no longer conflict with the softfloat version of these files. Keep them within this directory so they can be used to implement the armv6 version of these functions. Added: head/lib/libc/arm/gen/fpgetmask_vfp.c - copied unchanged from r264696, head/lib/libc/arm/gen/fpgetmask.c head/lib/libc/arm/gen/fpgetround_vfp.c - copied unchanged from r264696, head/lib/libc/arm/gen/fpgetround.c head/lib/libc/arm/gen/fpgetsticky_vfp.c - copied unchanged from r264696, head/lib/libc/arm/gen/fpgetsticky.c head/lib/libc/arm/gen/fpsetmask_vfp.c - copied unchanged from r264696, head/lib/libc/arm/gen/fpsetmask.c head/lib/libc/arm/gen/fpsetround_vfp.c - copied unchanged from r264696, head/lib/libc/arm/gen/fpsetround.c head/lib/libc/arm/gen/fpsetsticky_vfp.c - copied unchanged from r264696, head/lib/libc/arm/gen/fpsetsticky.c Deleted: head/lib/libc/arm/gen/fpgetmask.c head/lib/libc/arm/gen/fpgetround.c head/lib/libc/arm/gen/fpgetsticky.c head/lib/libc/arm/gen/fpsetmask.c head/lib/libc/arm/gen/fpsetround.c head/lib/libc/arm/gen/fpsetsticky.c Modified: head/lib/libc/arm/gen/Makefile.inc Modified: head/lib/libc/arm/gen/Makefile.inc ============================================================================== --- head/lib/libc/arm/gen/Makefile.inc Mon Apr 21 06:07:08 2014 (r264720) +++ head/lib/libc/arm/gen/Makefile.inc Mon Apr 21 09:43:22 2014 (r264721) @@ -11,6 +11,6 @@ SRCS+= divsi3.S .endif .if ${MACHINE_ARCH} == "armv6hf" -SRCS+= fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c fpsetround.c \ - fpsetsticky.c +SRCS+= fpgetmask_vfp.c fpgetround_vfp.c fpgetsticky_vfp.c fpsetmask_vfp.c \ + fpsetround_vfp.c fpsetsticky_vfp.c .endif Copied: head/lib/libc/arm/gen/fpgetmask_vfp.c (from r264696, head/lib/libc/arm/gen/fpgetmask.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/gen/fpgetmask_vfp.c Mon Apr 21 09:43:22 2014 (r264721, copy of r264696, head/lib/libc/arm/gen/fpgetmask.c) @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef __weak_alias +__weak_alias(fpgetmask,_fpgetmask) +#endif + +#define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP) + +fp_except_t +fpgetmask(void) +{ + fp_except mask; + + __asm __volatile("vmrs %0, fpscr" : "=&r"(mask)); + + return ((mask >> 8) & FP_X_MASK); +} + Copied: head/lib/libc/arm/gen/fpgetround_vfp.c (from r264696, head/lib/libc/arm/gen/fpgetround.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/gen/fpgetround_vfp.c Mon Apr 21 09:43:22 2014 (r264721, copy of r264696, head/lib/libc/arm/gen/fpgetround.c) @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef __weak_alias +__weak_alias(fpgetround,_fpgetround) +#endif + +fp_rnd_t +fpgetround(void) +{ + uint32_t fpscr; + + __asm __volatile("vmrs %0, fpscr" : "=&r"(fpscr)); + + return ((fpscr >> 22) & 3); +} + Copied: head/lib/libc/arm/gen/fpgetsticky_vfp.c (from r264696, head/lib/libc/arm/gen/fpgetsticky.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/gen/fpgetsticky_vfp.c Mon Apr 21 09:43:22 2014 (r264721, copy of r264696, head/lib/libc/arm/gen/fpgetsticky.c) @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef __weak_alias +__weak_alias(fpgetsticky,_fpgetsticky) +#endif + +#define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP) + +fp_except +fpgetsticky(void) +{ + fp_except old; + + __asm __volatile("vmrs %0, fpscr" : "=&r"(old)); + + return (old & FP_X_MASK); +} + Copied: head/lib/libc/arm/gen/fpsetmask_vfp.c (from r264696, head/lib/libc/arm/gen/fpsetmask.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/gen/fpsetmask_vfp.c Mon Apr 21 09:43:22 2014 (r264721, copy of r264696, head/lib/libc/arm/gen/fpsetmask.c) @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef __weak_alias +__weak_alias(fpsetmask,_fpsetmask) +#endif + +#define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP) + +fp_except_t +fpsetmask(fp_except_t mask) +{ + fp_except old, new; + + __asm __volatile("vmrs %0, fpscr" : "=&r"(old)); + mask = (mask & FP_X_MASK) << 8; + new = (old & ~(FP_X_MASK << 8)) | mask; + __asm __volatile("vmsr fpscr, %0" : : "r"(old)); + + return ((old >> 8) & FP_X_MASK); +} + Copied: head/lib/libc/arm/gen/fpsetround_vfp.c (from r264696, head/lib/libc/arm/gen/fpsetround.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/gen/fpsetround_vfp.c Mon Apr 21 09:43:22 2014 (r264721, copy of r264696, head/lib/libc/arm/gen/fpsetround.c) @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef __weak_alias +__weak_alias(fpsetround,_fpsetround) +#endif + +fp_rnd_t +fpsetround(fp_rnd_t rnd_dir) +{ + uint32_t old, new; + + __asm __volatile("vmrs %0, fpscr" : "=&r"(old)); + new = old & ~(3 << 22); + new |= rnd_dir << 22; + __asm __volatile("vmsr fpscr, %0" : : "r"(new)); + + return ((old >> 22) & 3); +} + Copied: head/lib/libc/arm/gen/fpsetsticky_vfp.c (from r264696, head/lib/libc/arm/gen/fpsetsticky.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/gen/fpsetsticky_vfp.c Mon Apr 21 09:43:22 2014 (r264721, copy of r264696, head/lib/libc/arm/gen/fpsetsticky.c) @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifdef __weak_alias +__weak_alias(fpsetsticky,_fpsetsticky) +#endif + +#define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP) + +fp_except +fpsetsticky(fp_except except) +{ + fp_except old, new; + + __asm __volatile("vmrs %0, fpscr" : "=&r"(old)); + new = old & ~(FP_X_MASK); + new &= ~except; + __asm __volatile("vmsr fpscr, %0" : : "r"(new)); + + return (old & except); +} + From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 12:39:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F0A1E62; Mon, 21 Apr 2014 12:39:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BE161354; Mon, 21 Apr 2014 12:39:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3LCdaYE021518; Mon, 21 Apr 2014 12:39:36 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3LCdagG021517; Mon, 21 Apr 2014 12:39:36 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404211239.s3LCdagG021517@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 21 Apr 2014 12:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264725 - head/tools/regression/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 12:39:36 -0000 Author: jilles Date: Mon Apr 21 12:39:35 2014 New Revision: 264725 URL: http://svnweb.freebsd.org/changeset/base/264725 Log: libc: Add fopen() test to regression Makefile. Modified: head/tools/regression/lib/libc/stdio/Makefile Modified: head/tools/regression/lib/libc/stdio/Makefile ============================================================================== --- head/tools/regression/lib/libc/stdio/Makefile Mon Apr 21 11:26:46 2014 (r264724) +++ head/tools/regression/lib/libc/stdio/Makefile Mon Apr 21 12:39:35 2014 (r264725) @@ -1,8 +1,16 @@ # $FreeBSD$ -TESTS= test-fmemopen test-getdelim test-mkostemp test-open_memstream \ - test-open_wmemstream test-perror test-print-positional test-printbasic \ - test-printfloat test-scanfloat +TESTS= test-fmemopen \ + test-fopen \ + test-getdelim \ + test-mkostemp \ + test-open_memstream \ + test-open_wmemstream \ + test-perror \ + test-print-positional \ + test-printbasic \ + test-printfloat \ + test-scanfloat CFLAGS+= -lm .PHONY: tests From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 13:15:44 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26321490; Mon, 21 Apr 2014 13:15:44 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D262F167E; Mon, 21 Apr 2014 13:15:43 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WcE4N-0007Kp-Ji; Mon, 21 Apr 2014 13:15:35 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s3LDFV2O007367; Mon, 21 Apr 2014 07:15:31 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/gZ4yqjHMLFlxGBGR1fAN2 Subject: Re: svn commit: r263778 - in head: bin lib lib/clang sbin share/mk usr.bin usr.sbin From: Ian Lepore To: Dimitry Andric In-Reply-To: <7A86F5E9-DBE9-4D3F-B166-C02F8386B722@FreeBSD.org> References: <201403262230.s2QMUdH6021943@svn.freebsd.org> <20140327181245.GA69977@stack.nl> <7A86F5E9-DBE9-4D3F-B166-C02F8386B722@FreeBSD.org> Content-Type: multipart/mixed; boundary="=-5mNCT3uufMi0VnEJyCeB" Date: Mon, 21 Apr 2014 07:15:31 -0600 Message-ID: <1398086131.1124.371.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Warner Losh , Jilles Tjoelker X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 13:15:44 -0000 --=-5mNCT3uufMi0VnEJyCeB Content-Type: text/plain; charset="iso-8859-7" Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by damnhippie.dyndns.org id s3LDFV2O007367 On Thu, 2014-03-27 at 20:44 +0100, Dimitry Andric wrote: > On 27 Mar 2014, at 19:12, Jilles Tjoelker wrote: > > On Thu, Mar 27, 2014 at 11:05:00AM -0600, Warner Losh wrote: > >> On Mar 26, 2014, at 4:30 PM, Dimitry Andric wrote: > >>> Author: dim > >>> Date: Wed Mar 26 22:30:38 2014 > >>> New Revision: 263778 > >>> URL: http://svnweb.freebsd.org/changeset/base/263778 > >=20 > >>> Log: > >>> Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to pro= cess > >>> all the SUBDIR entries in parallel, instead of serially. Apply thi= s > >>> option to a selected number of Makefiles, which can greatly speed u= p the > >>> build on multi-core machines, when using make -j. > >=20 > >>> This can be extended to more Makefiles later on, whenever they are > >>> verified to work correctly with parallel building. > >=20 > >> Why not have this =A1opt out=A2 rather than =A1opt in=A2 like it is = now? Are > >> there any known bad dependencies this introduces? > >=20 > > I'm paranoid about build systems ;) It is easy to add dependencies > > across directories and as long as directories are built in sequence, > > nothing goes wrong. > >=20 > > In fact, I had enabled SUBDIR_PARALLEL in sys/modules/Makefile as wel= l, > > but this caused mysterious failures with some kernels such as mips > > ADM5120. >=20 > There are a bunch of other parts that don't really like parallel builds > at the moment. For example, gnu/usr.bin/binutils needs its libraries > (libbfd.a, etc) built first, before it can link the programs. Similar > for gnu/usr.bin/cc, which needs libiberty, libcpp, etc before being abl= e > to build the rest of gcc. >=20 > Most of these cases can hopefully be solved by adding .WAIT targets at > strategic points in the SUBDIR lists, but this also needs a bit of extr= a > logic in bsd.subdir.mk. >=20 > -Dimitry > =20 It turns out I needed the .WAIT functionality to use SUBDIR_PARALLEL for $work, so I came up with the attached, does this look okay to commit? -- Ian --=-5mNCT3uufMi0VnEJyCeB Content-Disposition: inline; filename="parallel_make_wait.diff" Content-Type: text/x-patch; name="parallel_make_wait.diff"; charset="us-ascii" Content-Transfer-Encoding: 7bit diff -r 67802e319fc6 share/mk/bsd.subdir.mk --- a/share/mk/bsd.subdir.mk Sun Apr 20 21:01:07 2014 -0600 +++ b/share/mk/bsd.subdir.mk Mon Apr 21 06:59:37 2014 -0600 @@ -4,10 +4,10 @@ # The include file contains the default targets # for building subdirectories. # -# For all of the directories listed in the variable SUBDIRS, the +# For all of the directories listed in the variable SUBDIR, the # specified directory will be visited and the target made. There is # also a default target which allows the command "make subdir" where -# subdir is any directory listed in the variable SUBDIRS. +# subdir is any directory listed in the variable SUBDIR. # # # +++ variables +++ @@ -42,7 +42,7 @@ distribute: _SUBDIR: .USE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) - @${_+_}for entry in ${SUBDIR}; do \ + @${_+_}for entry in ${SUBDIR:N.WAIT}; do \ if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \ ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE_ARCH} (${.TARGET:realinstall=install})"; \ edir=$${entry}.${MACHINE_ARCH}; \ @@ -57,7 +57,7 @@ distribute: done .endif -${SUBDIR}: .PHONY +${SUBDIR:N.WAIT}: .PHONY ${_+_}@if test -d ${.TARGET}.${MACHINE_ARCH}; then \ cd ${.CURDIR}/${.TARGET}.${MACHINE_ARCH}; \ else \ @@ -65,13 +65,18 @@ distribute: fi; \ ${MAKE} all +__wait=.WAIT .for __target in all all-man checkdpadd clean cleandepend cleandir \ depend distribute lint maninstall manlint \ obj objlink realinstall regress tags \ ${SUBDIR_TARGETS} .ifdef SUBDIR_PARALLEL +__subdir_targets= .for __dir in ${SUBDIR} -${__target}: ${__target}_subdir_${__dir} +.if ${__wait} == ${__dir} +__subdir_targets+= .WAIT +.else +__subdir_targets+= ${__target}_subdir_${__dir} ${__target}_subdir_${__dir}: .MAKE @${_+_}set -e; \ if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ @@ -85,7 +90,9 @@ distribute: fi; \ ${MAKE} ${__target:realinstall=install} \ DIRPRFX=${DIRPRFX}$$edir/ +.endif .endfor +${__target}: ${__subdir_targets} .else ${__target}: _SUBDIR .endif --=-5mNCT3uufMi0VnEJyCeB-- From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 13:35:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3A84973 for ; Mon, 21 Apr 2014 13:35:00 +0000 (UTC) Received: from mail-ig0-f175.google.com (mail-ig0-f175.google.com [209.85.213.175]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AA48180B for ; Mon, 21 Apr 2014 13:35:00 +0000 (UTC) Received: by mail-ig0-f175.google.com with SMTP id h3so1760357igd.2 for ; Mon, 21 Apr 2014 06:34:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=EiGU/f9tBn0MHvIjKitXjs5bn7hZsUkHbbJafZsOfTg=; b=IRHSmd90Gi7B2lCzAktCSij0ff2R/3xmuiqia+pESn39NqZ0v4SCAxaR+EBsfjUPyo s3YjmicBFeyfNeoP25QwisC1B8UaGc1vEjsS5nQph33Oc5h4535kD2Z+OjGTKrRCwNsK SD+z3kcrlDBmPLHwBREhELgVW4ifV6YVs3pHRDqLp2GmWeR8asJv6d+5/NnvKelCCEkE immlEMg0SB3sEmZoXBJYpY/pCwa71aYuTrx2ZD3qqBL5wyqBX37H+msDQ/ogWDavJhJw JxZhzjJSdqX8VtLY1yzEFu6pwRmwuTZkpTZRDekeg/6mYlrGoIGIJlS4Pus0z9CWqg0e 4j+A== X-Gm-Message-State: ALoCoQniAtnMp2OZdwrkhn/E+TflUFGN/E9NTO7NvXMfdogCgC9MEWwv5hERu16V+EQZwXK8SF7w X-Received: by 10.42.176.131 with SMTP id be3mr30503577icb.2.1398087299350; Mon, 21 Apr 2014 06:34:59 -0700 (PDT) Received: from [192.168.43.111] ([172.56.8.60]) by mx.google.com with ESMTPSA id m8sm21135701igx.9.2014.04.21.06.34.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Apr 2014 06:34:58 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=iso-8859-7 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263778 - in head: bin lib lib/clang sbin share/mk usr.bin usr.sbin From: Warner Losh In-Reply-To: <1398086131.1124.371.camel@revolution.hippie.lan> Date: Mon, 21 Apr 2014 07:35:03 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201403262230.s2QMUdH6021943@svn.freebsd.org> <20140327181245.GA69977@stack.nl> <7A86F5E9-DBE9-4D3F-B166-C02F8386B722@FreeBSD.org> <1398086131.1124.371.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Dimitry Andric , Jilles Tjoelker X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 13:35:00 -0000 (sorry for the top post) This looks good to my eye. I=A2d be tempted to toss in a comment about = the __wait=3D.WAIT construct is due to the primitive nature of bmake=A2s = parser so it runs afoul of the .for/.if construction rules and this is needed = to expand the for variable. It tripped me up when I looked at it, until I recalled = a comment from similar code in NetBSD. Warner On Apr 21, 2014, at 7:15 AM, Ian Lepore wrote: > On Thu, 2014-03-27 at 20:44 +0100, Dimitry Andric wrote: >> On 27 Mar 2014, at 19:12, Jilles Tjoelker wrote: >>> On Thu, Mar 27, 2014 at 11:05:00AM -0600, Warner Losh wrote: >>>> On Mar 26, 2014, at 4:30 PM, Dimitry Andric = wrote: >>>>> Author: dim >>>>> Date: Wed Mar 26 22:30:38 2014 >>>>> New Revision: 263778 >>>>> URL: http://svnweb.freebsd.org/changeset/base/263778 >>>=20 >>>>> Log: >>>>> Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to = process >>>>> all the SUBDIR entries in parallel, instead of serially. Apply = this >>>>> option to a selected number of Makefiles, which can greatly speed = up the >>>>> build on multi-core machines, when using make -j. >>>=20 >>>>> This can be extended to more Makefiles later on, whenever they are >>>>> verified to work correctly with parallel building. >>>=20 >>>> Why not have this =A1opt out=A2 rather than =A1opt in=A2 like it is = now? Are >>>> there any known bad dependencies this introduces? >>>=20 >>> I'm paranoid about build systems ;) It is easy to add dependencies >>> across directories and as long as directories are built in sequence, >>> nothing goes wrong. >>>=20 >>> In fact, I had enabled SUBDIR_PARALLEL in sys/modules/Makefile as = well, >>> but this caused mysterious failures with some kernels such as mips >>> ADM5120. >>=20 >> There are a bunch of other parts that don't really like parallel = builds >> at the moment. For example, gnu/usr.bin/binutils needs its libraries >> (libbfd.a, etc) built first, before it can link the programs. = Similar >> for gnu/usr.bin/cc, which needs libiberty, libcpp, etc before being = able >> to build the rest of gcc. >>=20 >> Most of these cases can hopefully be solved by adding .WAIT targets = at >> strategic points in the SUBDIR lists, but this also needs a bit of = extra >> logic in bsd.subdir.mk. >>=20 >> -Dimitry >>=20 >=20 > It turns out I needed the .WAIT functionality to use SUBDIR_PARALLEL = for > $work, so I came up with the attached, does this look okay to commit? >=20 > -- Ian >=20 > diff -r 67802e319fc6 share/mk/bsd.subdir.mk > --- a/share/mk/bsd.subdir.mk Sun Apr 20 21:01:07 2014 -0600 > +++ b/share/mk/bsd.subdir.mk Mon Apr 21 06:59:37 2014 -0600 > @@ -4,10 +4,10 @@ > # The include file contains the default targets > # for building subdirectories. > # > -# For all of the directories listed in the variable SUBDIRS, the > +# For all of the directories listed in the variable SUBDIR, the > # specified directory will be visited and the target made. There is > # also a default target which allows the command "make subdir" where > -# subdir is any directory listed in the variable SUBDIRS. > +# subdir is any directory listed in the variable SUBDIR. > # > # > # +++ variables +++ > @@ -42,7 +42,7 @@ distribute: >=20 > _SUBDIR: .USE > .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) > - @${_+_}for entry in ${SUBDIR}; do \ > + @${_+_}for entry in ${SUBDIR:N.WAIT}; do \ > if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \ > ${ECHODIR} "=3D=3D=3D> = ${DIRPRFX}$${entry}.${MACHINE_ARCH} (${.TARGET:realinstall=3Dinstall})"; = \ > edir=3D$${entry}.${MACHINE_ARCH}; \ > @@ -57,7 +57,7 @@ distribute: > done > .endif >=20 > -${SUBDIR}: .PHONY > +${SUBDIR:N.WAIT}: .PHONY > ${_+_}@if test -d ${.TARGET}.${MACHINE_ARCH}; then \ > cd ${.CURDIR}/${.TARGET}.${MACHINE_ARCH}; \ > else \ > @@ -65,13 +65,18 @@ distribute: > fi; \ > ${MAKE} all >=20 > +__wait=3D.WAIT > .for __target in all all-man checkdpadd clean cleandepend cleandir \ > depend distribute lint maninstall manlint \ > obj objlink realinstall regress tags \ > ${SUBDIR_TARGETS} > .ifdef SUBDIR_PARALLEL > +__subdir_targets=3D > .for __dir in ${SUBDIR} > -${__target}: ${__target}_subdir_${__dir} > +.if ${__wait} =3D=3D ${__dir} > +__subdir_targets+=3D .WAIT > +.else > +__subdir_targets+=3D ${__target}_subdir_${__dir} > ${__target}_subdir_${__dir}: .MAKE > @${_+_}set -e; \ > if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ > @@ -85,7 +90,9 @@ distribute: > fi; \ > ${MAKE} ${__target:realinstall=3Dinstall} \ > DIRPRFX=3D${DIRPRFX}$$edir/ > +.endif > .endfor > +${__target}: ${__subdir_targets} > .else > ${__target}: _SUBDIR > .endif From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 16:35:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32F78B26; Mon, 21 Apr 2014 16:35:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2071E1A05; Mon, 21 Apr 2014 16:35:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3LGZJwC019463; Mon, 21 Apr 2014 16:35:19 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3LGZJdS019462; Mon, 21 Apr 2014 16:35:19 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404211635.s3LGZJdS019462@svn.freebsd.org> From: Glen Barber Date: Mon, 21 Apr 2014 16:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264731 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 16:35:20 -0000 Author: gjb Date: Mon Apr 21 16:35:19 2014 New Revision: 264731 URL: http://svnweb.freebsd.org/changeset/base/264731 Log: urndis(4) will first appear in 9.3-RELEASE. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/urndis.4 Modified: head/share/man/man4/urndis.4 ============================================================================== --- head/share/man/man4/urndis.4 Mon Apr 21 16:35:14 2014 (r264730) +++ head/share/man/man4/urndis.4 Mon Apr 21 16:35:19 2014 (r264731) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 6, 2014 +.Dd April 21, 2014 .Dt URNDIS 4 .Os .Sh NAME @@ -81,7 +81,7 @@ device driver first appeared in The first .Fx release to include it was -.Fx 10.1 . +.Fx 9.3 . .Sh AUTHORS .An -nosplit The From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 17:40:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20A60C30; Mon, 21 Apr 2014 17:40:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00D5D1168; Mon, 21 Apr 2014 17:40:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3LHeOKl044990; Mon, 21 Apr 2014 17:40:24 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3LHeNv3044981; Mon, 21 Apr 2014 17:40:23 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201404211740.s3LHeNv3044981@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 21 Apr 2014 17:40:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264737 - in head: lib/libc/stdio tools/regression/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 17:40:25 -0000 Author: jilles Date: Mon Apr 21 17:40:23 2014 New Revision: 264737 URL: http://svnweb.freebsd.org/changeset/base/264737 Log: libc/stdio: Fail fdopen() on an execute-only fd. An execute-only fd (opened with O_EXEC) allows neither read() nor write() and is therefore incompatible with all stdio modes. Therefore, the [EINVAL] error applies. Also adjust the similar check in freopen() with a NULL path, even though this checks an fd which is already from a FILE. Added: head/tools/regression/lib/libc/stdio/test-fdopen.c (contents, props changed) head/tools/regression/lib/libc/stdio/test-fdopen.t (contents, props changed) head/tools/regression/lib/libc/stdio/test-freopen.c (contents, props changed) head/tools/regression/lib/libc/stdio/test-freopen.t (contents, props changed) Modified: head/lib/libc/stdio/fdopen.c head/lib/libc/stdio/freopen.c head/tools/regression/lib/libc/stdio/Makefile Modified: head/lib/libc/stdio/fdopen.c ============================================================================== --- head/lib/libc/stdio/fdopen.c Mon Apr 21 17:17:23 2014 (r264736) +++ head/lib/libc/stdio/fdopen.c Mon Apr 21 17:40:23 2014 (r264737) @@ -70,7 +70,8 @@ fdopen(int fd, const char *mode) /* Make sure the mode the user wants is a subset of the actual mode. */ if ((fdflags = _fcntl(fd, F_GETFL, 0)) < 0) return (NULL); - tmp = fdflags & O_ACCMODE; + /* Work around incorrect O_ACCMODE. */ + tmp = fdflags & (O_ACCMODE | O_EXEC); if (tmp != O_RDWR && (tmp != (oflags & O_ACCMODE))) { errno = EINVAL; return (NULL); Modified: head/lib/libc/stdio/freopen.c ============================================================================== --- head/lib/libc/stdio/freopen.c Mon Apr 21 17:17:23 2014 (r264736) +++ head/lib/libc/stdio/freopen.c Mon Apr 21 17:40:23 2014 (r264737) @@ -92,8 +92,9 @@ freopen(const char * __restrict file, co errno = sverrno; return (NULL); } - if ((dflags & O_ACCMODE) != O_RDWR && (dflags & O_ACCMODE) != - (oflags & O_ACCMODE)) { + /* Work around incorrect O_ACCMODE. */ + if ((dflags & O_ACCMODE) != O_RDWR && + (dflags & (O_ACCMODE | O_EXEC)) != (oflags & O_ACCMODE)) { fclose(fp); FUNLOCKFILE(fp); errno = EINVAL; Modified: head/tools/regression/lib/libc/stdio/Makefile ============================================================================== --- head/tools/regression/lib/libc/stdio/Makefile Mon Apr 21 17:17:23 2014 (r264736) +++ head/tools/regression/lib/libc/stdio/Makefile Mon Apr 21 17:40:23 2014 (r264737) @@ -1,7 +1,9 @@ # $FreeBSD$ -TESTS= test-fmemopen \ +TESTS= test-fdopen \ + test-fmemopen \ test-fopen \ + test-freopen \ test-getdelim \ test-mkostemp \ test-open_memstream \ Added: head/tools/regression/lib/libc/stdio/test-fdopen.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/libc/stdio/test-fdopen.c Mon Apr 21 17:40:23 2014 (r264737) @@ -0,0 +1,105 @@ +/*- + * Copyright (c) 2014 Jilles Tjoelker + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +static int testnum = 1; + +static void +runtest(const char *fname, int intmode, const char *strmode, bool success) +{ + FILE *fp; + int fd; + + fd = open(fname, intmode); + if (fd == -1) { + printf("not ok %d - open(\"%s\", %#x) failed\n", + testnum++, fname, intmode); + return; + } + fp = fdopen(fd, strmode); + if (fp == NULL) { + close(fd); + if (success) + printf("not ok %d - " + "fdopen(open(\"%s\", %#x), \"%s\") failed\n", + testnum++, fname, intmode, strmode); + else + printf("ok %d - " + "fdopen(open(\"%s\", %#x), \"%s\") failed\n", + testnum++, fname, intmode, strmode); + return; + } + if (success) + printf("ok %d - " + "fdopen(open(\"%s\", %#x), \"%s\") succeeded\n", + testnum++, fname, intmode, strmode); + else + printf("not ok %d - " + "fdopen(open(\"%s\", %#x), \"%s\") succeeded\n", + testnum++, fname, intmode, strmode); + fclose(fp); +} + +/* + * Test program for fdopen(). + */ +int +main(int argc, char *argv[]) +{ + printf("1..19\n"); + runtest("/dev/null", O_RDONLY, "r", true); + runtest("/dev/null", O_WRONLY, "r", false); + runtest("/dev/null", O_RDWR, "r", true); + runtest("/dev/null", O_RDONLY, "w", false); + runtest("/dev/null", O_WRONLY, "w", true); + runtest("/dev/null", O_RDWR, "w", true); + runtest("/dev/null", O_RDONLY, "a", false); + runtest("/dev/null", O_WRONLY, "a", true); + runtest("/dev/null", O_RDWR, "a", true); + runtest("/dev/null", O_RDONLY, "r+", false); + runtest("/dev/null", O_WRONLY, "r+", false); + runtest("/dev/null", O_RDWR, "r+", true); + runtest("/dev/null", O_RDONLY, "w+", false); + runtest("/dev/null", O_WRONLY, "w+", false); + runtest("/dev/null", O_RDWR, "w+", true); + runtest("/bin/sh", O_EXEC, "r", false); + runtest("/bin/sh", O_EXEC, "w", false); + runtest("/bin/sh", O_EXEC, "r+", false); + runtest("/bin/sh", O_EXEC, "w+", false); + + return 0; +} + +/* vim:ts=8:cin:sw=8 + * */ Added: head/tools/regression/lib/libc/stdio/test-fdopen.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/libc/stdio/test-fdopen.t Mon Apr 21 17:40:23 2014 (r264737) @@ -0,0 +1,10 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +executable=`basename $0 .t` + +make $executable 2>&1 > /dev/null + +exec ./$executable Added: head/tools/regression/lib/libc/stdio/test-freopen.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/libc/stdio/test-freopen.c Mon Apr 21 17:40:23 2014 (r264737) @@ -0,0 +1,109 @@ +/*- + * Copyright (c) 2014 Jilles Tjoelker + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +static int testnum = 1; + +static void +runtest(const char *fname1, const char *mode1, const char *fname2, + const char *mode2, bool success) +{ + FILE *fp1, *fp2; + const char *fname2_print; + + fname2_print = fname2 != NULL ? fname2 : ""; + fp1 = fopen(fname1, mode1); + if (fp1 == NULL) { + printf("not ok %d - fopen(\"%s\", \"%s\") failed\n", + testnum++, fname1, mode1); + return; + } + fp2 = freopen(fname2, mode2, fp1); + if (fp2 == NULL) { + fclose(fp1); + if (success) + printf("not ok %d - " + "freopen(\"%s\", \"%s\", fopen(\"%s\", \"%s\")) " + "failed\n", + testnum++, fname2_print, mode2, fname1, mode1); + else + printf("ok %d - " + "freopen(\"%s\", \"%s\", fopen(\"%s\", \"%s\")) " + "failed\n", + testnum++, fname2_print, mode2, fname1, mode1); + return; + } + if (success) + printf("ok %d - " + "freopen(\"%s\", \"%s\", fopen(\"%s\", \"%s\")) " + "succeeded\n", + testnum++, fname2_print, mode2, fname1, mode1); + else + printf("not ok %d - " + "freopen(\"%s\", \"%s\", fopen(\"%s\", \"%s\")) " + "succeeded\n", + testnum++, fname2_print, mode2, fname1, mode1); + fclose(fp2); +} + +/* + * Test program for freopen(). + */ +int +main(int argc, char *argv[]) +{ + printf("1..19\n"); + runtest("/dev/null", "r", NULL, "r", true); + runtest("/dev/null", "w", NULL, "r", false); + runtest("/dev/null", "r+", NULL, "r", true); + runtest("/dev/null", "r", NULL, "w", false); + runtest("/dev/null", "w", NULL, "w", true); + runtest("/dev/null", "r+", NULL, "w", true); + runtest("/dev/null", "r", NULL, "a", false); + runtest("/dev/null", "w", NULL, "a", true); + runtest("/dev/null", "r+", NULL, "a", true); + runtest("/dev/null", "r", NULL, "r+", false); + runtest("/dev/null", "w", NULL, "r+", false); + runtest("/dev/null", "r+", NULL, "r+", true); + runtest("/dev/null", "r", NULL, "w+", false); + runtest("/dev/null", "w", NULL, "w+", false); + runtest("/dev/null", "r+", NULL, "w+", true); + runtest("/bin/sh", "r", NULL, "r", true); + runtest("/bin/sh", "r", "/bin/sh", "r", true); + runtest("/bin/sh", "r", "/dev/null", "r", true); + runtest("/bin/sh", "r", "/dev/null", "w", true); + + return 0; +} + +/* vim:ts=8:cin:sw=8 + * */ Added: head/tools/regression/lib/libc/stdio/test-freopen.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/libc/stdio/test-freopen.t Mon Apr 21 17:40:23 2014 (r264737) @@ -0,0 +1,10 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +executable=`basename $0 .t` + +make $executable 2>&1 > /dev/null + +exec ./$executable From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 19:10:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A562C832; Mon, 21 Apr 2014 19:10:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 927B01AA8; Mon, 21 Apr 2014 19:10:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3LJANrq082585; Mon, 21 Apr 2014 19:10:23 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3LJANkb082584; Mon, 21 Apr 2014 19:10:23 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201404211910.s3LJANkb082584@svn.freebsd.org> From: Rick Macklem Date: Mon, 21 Apr 2014 19:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264738 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 19:10:23 -0000 Author: rmacklem Date: Mon Apr 21 19:10:23 2014 New Revision: 264738 URL: http://svnweb.freebsd.org/changeset/base/264738 Log: For an NFSv4 mount with the "nocto" option, don't get the up to date file attributes upon close. This reduces the Getattr RPC count by about 65% for software builds. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Mon Apr 21 17:40:23 2014 (r264737) +++ head/sys/fs/nfsclient/nfs_clvnops.c Mon Apr 21 19:10:23 2014 (r264738) @@ -767,7 +767,9 @@ nfs_close(struct vop_close_args *ap) /* * Get attributes so "change" is up to date. */ - if (error == 0 && nfscl_mustflush(vp) != 0) { + if (error == 0 && nfscl_mustflush(vp) != 0 && + vp->v_type == VREG && + (VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOCTO) == 0) { ret = nfsrpc_getattr(vp, cred, ap->a_td, &nfsva, NULL); if (!ret) { From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 19:17:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 602B9AE9; Mon, 21 Apr 2014 19:17:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3281B7A; Mon, 21 Apr 2014 19:17:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3LJHKjf085938; Mon, 21 Apr 2014 19:17:20 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3LJHKem085937; Mon, 21 Apr 2014 19:17:20 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201404211917.s3LJHKem085937@svn.freebsd.org> From: Rick Macklem Date: Mon, 21 Apr 2014 19:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264739 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 19:17:20 -0000 Author: rmacklem Date: Mon Apr 21 19:17:19 2014 New Revision: 264739 URL: http://svnweb.freebsd.org/changeset/base/264739 Log: Add {} braces so that the code conforms to the indentation. Fortunately, I don't think doing the assignment of cap->tsomax unconditionally causes any problem. Reviewed by: glebius MFC after: 2 weeks Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Mon Apr 21 19:10:23 2014 (r264738) +++ head/sys/netinet/tcp_subr.c Mon Apr 21 19:17:19 2014 (r264739) @@ -1819,9 +1819,10 @@ tcp_maxmtu(struct in_conninfo *inc, stru /* Report additional interface capabilities. */ if (cap != NULL) { if (ifp->if_capenable & IFCAP_TSO4 && - ifp->if_hwassist & CSUM_TSO) + ifp->if_hwassist & CSUM_TSO) { cap->ifcap |= CSUM_TSO; cap->tsomax = ifp->if_hw_tsomax; + } } RTFREE(sro.ro_rt); } @@ -1857,9 +1858,10 @@ tcp_maxmtu6(struct in_conninfo *inc, str /* Report additional interface capabilities. */ if (cap != NULL) { if (ifp->if_capenable & IFCAP_TSO6 && - ifp->if_hwassist & CSUM_TSO) + ifp->if_hwassist & CSUM_TSO) { cap->ifcap |= CSUM_TSO; cap->tsomax = ifp->if_hw_tsomax; + } } RTFREE(sro6.ro_rt); } From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 19:33:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9082129; Mon, 21 Apr 2014 19:33:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B58971D4F; Mon, 21 Apr 2014 19:33:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3LJXRcb093562; Mon, 21 Apr 2014 19:33:27 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3LJXRtR093561; Mon, 21 Apr 2014 19:33:27 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404211933.s3LJXRtR093561@svn.freebsd.org> From: Xin LI Date: Mon, 21 Apr 2014 19:33:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264740 - head/usr.sbin/portsnap/portsnap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 19:33:27 -0000 Author: delphij Date: Mon Apr 21 19:33:27 2014 New Revision: 264740 URL: http://svnweb.freebsd.org/changeset/base/264740 Log: Use case insensitive match in portsnap. PR: bin/186510 Submitted by: olli MFC after: 2 weeks Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh ============================================================================== --- head/usr.sbin/portsnap/portsnap/portsnap.sh Mon Apr 21 19:17:19 2014 (r264739) +++ head/usr.sbin/portsnap/portsnap/portsnap.sh Mon Apr 21 19:33:27 2014 (r264740) @@ -367,7 +367,7 @@ fetch_pick_server_init() { # "$name server selection ..."; we allow either format. MLIST="_http._tcp.${SERVERNAME}" host -t srv "${MLIST}" | - sed -nE "s/${MLIST} (has SRV record|server selection) //p" | + sed -nE "s/${MLIST} (has SRV record|server selection) //Ip" | cut -f 1,2,4 -d ' ' | sed -e 's/\.$//' | sort > serverlist_full From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 21:39:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34E22CB6; Mon, 21 Apr 2014 21:39:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EDBB1A0C; Mon, 21 Apr 2014 21:39:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3LLdWDR045084; Mon, 21 Apr 2014 21:39:32 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3LLdPgw045046; Mon, 21 Apr 2014 21:39:25 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201404212139.s3LLdPgw045046@svn.freebsd.org> From: Julio Merino Date: Mon, 21 Apr 2014 21:39:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264741 - in head: cddl cddl/lib cddl/lib/tests cddl/sbin cddl/sbin/tests cddl/tests cddl/usr.bin cddl/usr.bin/tests cddl/usr.sbin cddl/usr.sbin/tests etc etc/mtree etc/tests games game... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 21:39:32 -0000 Author: jmmv Date: Mon Apr 21 21:39:25 2014 New Revision: 264741 URL: http://svnweb.freebsd.org/changeset/base/264741 Log: Add placeholder Kyuafiles for various top-level hierarchies. This change adds tests/ directories in the source tree to create various subdirectories in /usr/tests/ and to install placeholder Kyuafiles for them. the relevant hierarchies are: cddl, etc, games, gnu and secure. The reason for this is to simplify the addition of new test programs for utilities or libraries under any of these directories. Doing so on a case by case basis is unnecessary and is quite an obscure process. Added: head/cddl/lib/tests/ head/cddl/lib/tests/Makefile (contents, props changed) head/cddl/sbin/tests/ head/cddl/sbin/tests/Makefile (contents, props changed) head/cddl/tests/ head/cddl/tests/Makefile (contents, props changed) head/cddl/usr.bin/tests/ head/cddl/usr.bin/tests/Makefile (contents, props changed) head/cddl/usr.sbin/tests/ head/cddl/usr.sbin/tests/Makefile (contents, props changed) head/etc/tests/ head/etc/tests/Makefile (contents, props changed) head/games/tests/ head/games/tests/Makefile (contents, props changed) head/gnu/lib/tests/ head/gnu/lib/tests/Makefile (contents, props changed) head/gnu/tests/ head/gnu/tests/Makefile (contents, props changed) head/gnu/usr.bin/tests/ head/gnu/usr.bin/tests/Makefile (contents, props changed) head/secure/lib/tests/ head/secure/lib/tests/Makefile (contents, props changed) head/secure/libexec/tests/ head/secure/libexec/tests/Makefile (contents, props changed) head/secure/tests/ head/secure/tests/Makefile (contents, props changed) head/secure/usr.bin/tests/ head/secure/usr.bin/tests/Makefile (contents, props changed) head/secure/usr.sbin/tests/ head/secure/usr.sbin/tests/Makefile (contents, props changed) Modified: head/cddl/Makefile head/cddl/lib/Makefile head/cddl/sbin/Makefile head/cddl/usr.bin/Makefile head/cddl/usr.sbin/Makefile head/etc/Makefile head/etc/mtree/BSD.tests.dist head/games/Makefile head/gnu/Makefile head/gnu/lib/Makefile head/gnu/usr.bin/Makefile head/secure/Makefile head/secure/lib/Makefile head/secure/libexec/Makefile head/secure/usr.bin/Makefile head/secure/usr.sbin/Makefile Modified: head/cddl/Makefile ============================================================================== --- head/cddl/Makefile Mon Apr 21 19:33:27 2014 (r264740) +++ head/cddl/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -1,5 +1,11 @@ # $FreeBSD$ +.include + SUBDIR= lib sbin usr.bin usr.sbin +.if ${MK_TESTS} != "no" +SUBDIR+=tests +.endif + .include Modified: head/cddl/lib/Makefile ============================================================================== --- head/cddl/lib/Makefile Mon Apr 21 19:33:27 2014 (r264740) +++ head/cddl/lib/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -11,7 +11,12 @@ SUBDIR= ${_drti} \ libuutil \ ${_libzfs_core} \ ${_libzfs} \ - ${_libzpool} + ${_libzpool} \ + ${_tests} + +.if ${MK_TESTS} != "no" +_tests= tests +.endif .if ${MK_ZFS} != "no" _libzfs_core= libzfs_core Added: head/cddl/lib/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/lib/tests/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/cddl/lib + +.PATH: ${.CURDIR:H:H:H}/tests +KYUAFILE= yes + +.include Modified: head/cddl/sbin/Makefile ============================================================================== --- head/cddl/sbin/Makefile Mon Apr 21 19:33:27 2014 (r264740) +++ head/cddl/sbin/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -2,7 +2,11 @@ .include -SUBDIR= ${_zfs} ${_zpool} +SUBDIR= ${_tests} ${_zfs} ${_zpool} + +.if ${MK_TESTS} != "no" +_tests= tests +.endif .if ${MK_ZFS} != "no" _zfs= zfs Added: head/cddl/sbin/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/sbin/tests/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/cddl/sbin + +.PATH: ${.CURDIR:H:H:H}/tests +KYUAFILE= yes + +.include Added: head/cddl/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/tests/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/cddl + +.PATH: ${.CURDIR:H:H}/tests +KYUAFILE= yes + +.include Modified: head/cddl/usr.bin/Makefile ============================================================================== --- head/cddl/usr.bin/Makefile Mon Apr 21 19:33:27 2014 (r264740) +++ head/cddl/usr.bin/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -7,11 +7,16 @@ SUBDIR= \ ctfdump \ ctfmerge \ sgsmsg \ + ${_tests} \ ${_zinject} \ ${_zlook} \ ${_zstreamdump} \ ${_ztest} +.if ${MK_TESTS} != "no" +_tests= tests +.endif + .if ${MK_ZFS} != "no" _zinject= zinject #_zlook= zlook Added: head/cddl/usr.bin/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.bin/tests/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/cddl/usr.bin + +.PATH: ${.CURDIR:H:H:H}/tests +KYUAFILE= yes + +.include Modified: head/cddl/usr.sbin/Makefile ============================================================================== --- head/cddl/usr.sbin/Makefile Mon Apr 21 19:33:27 2014 (r264740) +++ head/cddl/usr.sbin/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -5,9 +5,14 @@ SUBDIR= ${_dtrace} \ ${_dtruss} \ ${_lockstat} \ + ${_tests} \ ${_zdb} \ ${_zhack} +.if ${MK_TESTS} != "no" +_tests= tests +.endif + .if ${MK_ZFS} != "no" .if ${MK_LIBTHR} != "no" _zdb= zdb Added: head/cddl/usr.sbin/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/tests/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/cddl/usr.sbin + +.PATH: ${.CURDIR:H:H:H}/tests +KYUAFILE= yes + +.include Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Mon Apr 21 19:33:27 2014 (r264740) +++ head/etc/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -7,6 +7,10 @@ SUBDIR= sendmail .endif +.if ${MK_TESTS} != "no" +SUBDIR+=tests +.endif + BIN1= crontab \ devd.conf \ devfs.conf \ Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Apr 21 19:33:27 2014 (r264740) +++ head/etc/mtree/BSD.tests.dist Mon Apr 21 21:39:25 2014 (r264741) @@ -50,6 +50,26 @@ test .. .. + cddl + lib + .. + sbin + .. + usr.bin + .. + usr.sbin + .. + .. + etc + .. + games + .. + gnu + lib + .. + usr.bin + .. + .. lib atf libatf-c @@ -82,6 +102,16 @@ mdconfig .. .. + secure + lib + .. + libexec + .. + usr.bin + .. + usr.sbin + .. + .. share examples tests Added: head/etc/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/tests/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/etc + +.PATH: ${.CURDIR:H:H}/tests +KYUAFILE= yes + +.include Modified: head/games/Makefile ============================================================================== --- head/games/Makefile Mon Apr 21 19:33:27 2014 (r264740) +++ head/games/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -1,6 +1,7 @@ -# @(#)Makefile 8.2 (Berkeley) 3/31/94 # $FreeBSD$ +.include + SUBDIR= \ bcd \ caesar \ @@ -12,6 +13,11 @@ SUBDIR= \ pom \ ppt \ primes \ - random + random \ + ${_tests} + +.if ${MK_TESTS} != "no" +_tests= tests +.endif .include Added: head/games/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/games/tests/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/games + +.PATH: ${.CURDIR:H:H}/tests +KYUAFILE= yes + +.include Modified: head/gnu/Makefile ============================================================================== --- head/gnu/Makefile Mon Apr 21 19:33:27 2014 (r264740) +++ head/gnu/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -1,6 +1,12 @@ # @(#)Makefile 5.33.1.1 (Berkeley) 5/6/91 # $FreeBSD$ -SUBDIR= lib usr.bin +.include + +SUBDIR= lib ${_tests} usr.bin + +.if ${MK_TESTS} != "no" +_tests= tests +.endif .include Modified: head/gnu/lib/Makefile ============================================================================== --- head/gnu/lib/Makefile Mon Apr 21 19:33:27 2014 (r264740) +++ head/gnu/lib/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -8,6 +8,10 @@ SUBDIR= csu libgcc libgcov libdialog lib SUBDIR+= libssp .endif +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + # libsupc++ uses libstdc++ headers, although 'make includes' should # have taken care of that already. .if ${MK_GNUCXX} != "no" && ${MK_CXX} != "no" Added: head/gnu/lib/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/lib/tests/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/gnu/lib + +.PATH: ${.CURDIR:H:H:H}/tests +KYUAFILE= yes + +.include Added: head/gnu/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/tests/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/gnu + +.PATH: ${.CURDIR:H:H}/tests +KYUAFILE= yes + +.include Modified: head/gnu/usr.bin/Makefile ============================================================================== --- head/gnu/usr.bin/Makefile Mon Apr 21 19:33:27 2014 (r264740) +++ head/gnu/usr.bin/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -15,6 +15,7 @@ SUBDIR= ${_binutils} \ ${_rcs} \ sdiff \ send-pr \ + ${_tests} \ ${_texinfo} .if ${MK_CXX} != "no" @@ -36,6 +37,10 @@ _texinfo= texinfo _rcs= rcs .endif +.if ${MK_TESTS} != "no" +_tests= tests +.endif + .if ${MK_BINUTILS} != "no" _binutils= binutils .endif Added: head/gnu/usr.bin/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/tests/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/gnu/usr.bin + +.PATH: ${.CURDIR:H:H:H}/tests +KYUAFILE= yes + +.include Modified: head/secure/Makefile ============================================================================== --- head/secure/Makefile Mon Apr 21 19:33:27 2014 (r264740) +++ head/secure/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -2,7 +2,11 @@ .include -SUBDIR= lib libexec usr.bin usr.sbin +SUBDIR= lib libexec ${_tests} usr.bin usr.sbin + +.if ${MK_TESTS} != "no" +_tests= tests +.endif # These are the programs which depend on crypto, but not Kerberos. SPROGS= lib/libfetch lib/libpam lib/libradius lib/libtelnet \ Modified: head/secure/lib/Makefile ============================================================================== --- head/secure/lib/Makefile Mon Apr 21 19:33:27 2014 (r264740) +++ head/secure/lib/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -10,4 +10,8 @@ SUBDIR+=libssh .endif .endif +.if ${MK_TESTS} != "no" +SUBDIR+=tests +.endif + .include Added: head/secure/lib/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/lib/tests/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/secure/lib + +.PATH: ${.CURDIR:H:H:H}/tests +KYUAFILE= yes + +.include Modified: head/secure/libexec/Makefile ============================================================================== --- head/secure/libexec/Makefile Mon Apr 21 19:33:27 2014 (r264740) +++ head/secure/libexec/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -7,4 +7,8 @@ SUBDIR= SUBDIR+=sftp-server ssh-keysign ssh-pkcs11-helper .endif +.if ${MK_TESTS} != "no" +SUBDIR+=tests +.endif + .include Added: head/secure/libexec/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/libexec/tests/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/secure/libexec + +.PATH: ${.CURDIR:H:H:H}/tests +KYUAFILE= yes + +.include Added: head/secure/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/tests/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/secure + +.PATH: ${.CURDIR:H:H}/tests +KYUAFILE= yes + +.include Modified: head/secure/usr.bin/Makefile ============================================================================== --- head/secure/usr.bin/Makefile Mon Apr 21 19:33:27 2014 (r264740) +++ head/secure/usr.bin/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -10,4 +10,8 @@ SUBDIR+=scp sftp ssh ssh-add ssh-agent s .endif .endif +.if ${MK_TESTS} != "no" +SUBDIR+=tests +.endif + .include Added: head/secure/usr.bin/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/usr.bin/tests/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/secure/usr.bin + +.PATH: ${.CURDIR:H:H:H}/tests +KYUAFILE= yes + +.include Modified: head/secure/usr.sbin/Makefile ============================================================================== --- head/secure/usr.sbin/Makefile Mon Apr 21 19:33:27 2014 (r264740) +++ head/secure/usr.sbin/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -7,4 +7,8 @@ SUBDIR= SUBDIR+=sshd .endif +.if ${MK_TESTS} != "no" +SUBDIR+=tests +.endif + .include Added: head/secure/usr.sbin/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/usr.sbin/tests/Makefile Mon Apr 21 21:39:25 2014 (r264741) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/secure/usr.sbin + +.PATH: ${.CURDIR:H:H:H}/tests +KYUAFILE= yes + +.include From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 22:36:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E0057255; Mon, 21 Apr 2014 22:36:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCFBB1142; Mon, 21 Apr 2014 22:36:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3LMaVFT069671; Mon, 21 Apr 2014 22:36:31 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3LMaVBq069670; Mon, 21 Apr 2014 22:36:31 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201404212236.s3LMaVBq069670@svn.freebsd.org> From: Julio Merino Date: Mon, 21 Apr 2014 22:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264742 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 22:36:32 -0000 Author: jmmv Date: Mon Apr 21 22:36:31 2014 New Revision: 264742 URL: http://svnweb.freebsd.org/changeset/base/264742 Log: Prevent building tests when bootstrapping make. Should fix the breakage reported by tinderbox when WITHOUT_BMAKE is set, which was probably introduced in r263346.. Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Mon Apr 21 21:39:25 2014 (r264741) +++ head/Makefile Mon Apr 21 22:36:31 2014 (r264742) @@ -330,7 +330,8 @@ MMAKEENV= MAKEOBJDIRPREFIX=${MYMAKE:H} \ INSTALL="sh ${.CURDIR}/tools/install.sh" MMAKE= ${MMAKEENV} ${MAKE} \ -D_UPGRADING -DNO_MAN -DNO_SHARED \ - -DNO_CPU_CFLAGS -DNO_WERROR DESTDIR= PROGNAME=${MYMAKE:T} + -DNO_CPU_CFLAGS -DNO_WERROR \ + DESTDIR= MK_TESTS=no PROGNAME=${MYMAKE:T} make bmake: .PHONY @echo From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 22:47:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD53F536; Mon, 21 Apr 2014 22:47:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA65C1225; Mon, 21 Apr 2014 22:47:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3LMlIj2073857; Mon, 21 Apr 2014 22:47:18 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3LMlIuk073855; Mon, 21 Apr 2014 22:47:18 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201404212247.s3LMlIuk073855@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 21 Apr 2014 22:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264743 - head/usr.bin/printf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 22:47:19 -0000 Author: pfg Date: Mon Apr 21 22:47:18 2014 New Revision: 264743 URL: http://svnweb.freebsd.org/changeset/base/264743 Log: Add parameterized position handling to printf(1). Add a new %n$ option to change the order of the parameters as done in the ksh93 builtin printf (among others). For example: %printf '%2$1d %1$s\n' one 2 three 4 2 one 4 three The feature was written by Garret D'Amore under a BSD license for Nexenta/illumos. Reference: http://garrett.damore.org/2010/10/new-implementation-of-printf.html PR: bin/152934 Obtained from: Illumos MFC after: 2 weeks Modified: head/usr.bin/printf/printf.1 head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.1 ============================================================================== --- head/usr.bin/printf/printf.1 Mon Apr 21 22:36:31 2014 (r264742) +++ head/usr.bin/printf/printf.1 Mon Apr 21 22:47:18 2014 (r264743) @@ -31,7 +31,7 @@ .\" @(#)printf.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd May 28, 2011 +.Dd April 21, 2014 .Dt PRINTF 1 .Os .Sh NAME @@ -290,6 +290,9 @@ octal escapes are .Cm \e0 Ns Ar num instead of .Cm \e Ns Ar num . +.It Cm n$ +Allows reordering of the output according to +.Ar argument . .It Cm \&% Print a `%'; no argument is used. .El Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Mon Apr 21 22:36:31 2014 (r264742) +++ head/usr.bin/printf/printf.c Mon Apr 21 22:47:18 2014 (r264743) @@ -1,4 +1,5 @@ /*- + * Copyright 2010 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * @@ -69,6 +70,11 @@ static const char rcsid[] = #define PF(f, func) do { \ char *b = NULL; \ + int dollar = 0; \ + if (*f == '$') { \ + dollar++; \ + *f = '%'; \ + } \ if (havewidth) \ if (haveprec) \ (void)asprintf(&b, f, fieldwidth, precision, func); \ @@ -82,6 +88,8 @@ static const char rcsid[] = (void)fputs(b, stdout); \ free(b); \ } \ + if (dollar) \ + *f = '$'; \ } while (0) static int asciicode(void); @@ -96,6 +104,8 @@ static const char static char *mknum(char *, char); static void usage(void); +static int myargc; +static char **myargv; static char **gargv; int @@ -146,7 +156,13 @@ main(int argc, char *argv[]) chopped = escape(fmt, 1, &len); /* backslash interpretation */ rval = end = 0; gargv = ++argv; + for (;;) { + char **maxargv = gargv; + + myargv = gargv; + for (myargc = 0; gargv[myargc]; myargc++) + /* nop */; start = fmt; while (fmt < format + len) { if (fmt[0] == '%') { @@ -168,7 +184,10 @@ main(int argc, char *argv[]) start = fmt; } else fmt++; + if (gargv > maxargv) + maxargv = gargv; } + gargv = maxargv; if (end == 1) { warnx("missing format character"); @@ -202,6 +221,22 @@ printf_doformat(char *start, int *rval) char convch, nextch; fmt = start + 1; + + /* look for "n$" field index specifier */ + fmt += strspn(fmt, skip2); + if ((*fmt == '$') && (fmt != (start + 1))) { + int idx = atoi(start + 1); + if (idx <= myargc) { + gargv = &myargv[idx - 1]; + } else { + gargv = &myargv[myargc]; + } + start = fmt; + fmt++; + } else { + fmt = start + 1; + } + /* skip to field width */ fmt += strspn(fmt, skip1); if (*fmt == '*') { From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 22:51:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58E1D712 for ; Mon, 21 Apr 2014 22:51:23 +0000 (UTC) Received: from mail-qc0-f179.google.com (mail-qc0-f179.google.com [209.85.216.179]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 145091241 for ; Mon, 21 Apr 2014 22:51:22 +0000 (UTC) Received: by mail-qc0-f179.google.com with SMTP id m20so4619199qcx.38 for ; Mon, 21 Apr 2014 15:51:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=XetANcOOCq4av1MfAhPSde8hKMtgGiOeClMNt3d21aM=; b=mZ1ru7a5j44WwlZDjX+qf7/BEKRxMud4OsysCgOwcQpXpp7YxLqaQYm1lVg8DYzGpk fkEE3QkYEK1MTWiUIf2n1ihvLE/Wxmchef2LWPl46n1O6iN+azprVSXfoUE/AqM8QUKd J0t96ZGOryrk9/g5qtO+EUVRKo7FeYpPMbGcsAf/BVLWozvF1lzOcio/aTRm27qKs6Ub sEtmWidZudK5SrEZ4RakRmNoA6u5aOMPvO16sSsaNAd8Tp8GRAzjm2j5B1ySMC3BnJWw DGa1Qv1P6JVdAYrfoOWCURDYBkdjfGz/z7Y7ezQ4UDxhKjVR4Idopbd3tPj0Cc/Egejd 0bOw== X-Gm-Message-State: ALoCoQlqDdBP/r9wh1vxA5QYfvkq1yMDzbSoxOikFhKbduGE4yFfSyDrp9gVFqigS/CBvmLpGvo4 X-Received: by 10.140.29.226 with SMTP id b89mr31326625qgb.48.1398120676681; Mon, 21 Apr 2014 15:51:16 -0700 (PDT) MIME-Version: 1.0 Sender: jmmv@meroh.net Received: by 10.96.83.99 with HTTP; Mon, 21 Apr 2014 15:50:55 -0700 (PDT) X-Originating-IP: [2620:0:1008:100a:3c8f:4973:f7d2:3bdb] In-Reply-To: References: <201403191229.s2JCTLDp024608@svn.freebsd.org> <864n2mxpun.fsf@nine.des.no> From: Julio Merino Date: Mon, 21 Apr 2014 15:50:55 -0700 X-Google-Sender-Auth: ugFAtc6zriljVPw1tuPsN25lAN0 Message-ID: Subject: Re: svn commit: r263346 - in head: etc/mtree tools/build/mk tools/regression/usr.bin/make usr.bin/make usr.bin/make/tests usr.bin/make/tests/archives/fmt_44bsd usr.bin/make/tests/archives/fmt_44bsd_mod... To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 22:51:23 -0000 On Fri, Mar 28, 2014 at 1:32 AM, Julio Merino wrote: > On Wed, Mar 26, 2014 at 12:25 AM, Dag-Erling Sm=C3=B8rgrav w= rote: >> Julio Merino writes: >>> Log: >>> Migrate tools/regression/usr.bin/make/ to the new tests layout. >>> >>> Note that these tests are for fmake, not bmake, and thus they are not >>> installed nor run when bmake is selected (the default). Yes, I have >>> wasted a *ton* of time on moving tests for no real reason other than >>> ensuring they are not left behind. >>> >>> But maybe, just maybe, it was not work in vain: the majority of these >>> tests also work with bmake and the few that don't may point at broken >>> stuff. For example, the tests for the "archive" feature do not work >>> with bmake, but bmake's manpage and source tree seem to imply that th= ey >>> should. So... to be investigated later; need to poke sjg@. >> >> This, or a subsequent but related commit, broke the WITHOUT_BMAKE build: > > Apologies for not having gotten to this yet. Will try to deal with it > during the weekend or next week when I'm back home. (Still traveling > after AsiaBSDCon and been focusing on fixing some other issues in the > testing cluster.) Finally got to this. Just committed r264742 which will hopefully fix it. > In the meantime: could someone enlighten me as to why !bmake is still sup= ported? Question still stands. From owner-svn-src-head@FreeBSD.ORG Mon Apr 21 22:52:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD0DF86F; Mon, 21 Apr 2014 22:52:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD8B012CF; Mon, 21 Apr 2014 22:52:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3LMqLE5077381; Mon, 21 Apr 2014 22:52:21 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3LMqJNp077360; Mon, 21 Apr 2014 22:52:19 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201404212252.s3LMqJNp077360@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 21 Apr 2014 22:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264744 - in head/usr.bin: grep grep/regex patch sort X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 22:52:22 -0000 Author: pfg Date: Mon Apr 21 22:52:18 2014 New Revision: 264744 URL: http://svnweb.freebsd.org/changeset/base/264744 Log: Various style(9) fixes and typos in grep, sort and patch. MFC after: 3 days Modified: head/usr.bin/grep/grep.c head/usr.bin/grep/grep.h head/usr.bin/grep/regex/tre-fastmatch.c head/usr.bin/patch/common.h head/usr.bin/patch/pch.h head/usr.bin/sort/bwstring.h head/usr.bin/sort/coll.h head/usr.bin/sort/file.h head/usr.bin/sort/mem.h head/usr.bin/sort/radixsort.h head/usr.bin/sort/sort.1.in head/usr.bin/sort/sort.h head/usr.bin/sort/vsort.h Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Mon Apr 21 22:47:18 2014 (r264743) +++ head/usr.bin/grep/grep.c Mon Apr 21 22:52:18 2014 (r264744) @@ -311,7 +311,7 @@ read_patterns(const char *fn) fclose(f); return; } - while ((line = fgetln(f, &len)) != NULL) + while ((line = fgetln(f, &len)) != NULL) add_pattern(line, line[0] == '\n' ? 0 : len); if (ferror(f)) err(2, "%s", fn); Modified: head/usr.bin/grep/grep.h ============================================================================== --- head/usr.bin/grep/grep.h Mon Apr 21 22:47:18 2014 (r264743) +++ head/usr.bin/grep/grep.h Mon Apr 21 22:52:18 2014 (r264744) @@ -39,48 +39,48 @@ #include "fastmatch.h" #ifdef WITHOUT_NLS -#define getstr(n) errstr[n] +#define getstr(n) errstr[n] #else #include extern nl_catd catalog; -#define getstr(n) catgets(catalog, 1, n, errstr[n]) +#define getstr(n) catgets(catalog, 1, n, errstr[n]) #endif extern const char *errstr[]; -#define VERSION "2.5.1-FreeBSD" +#define VERSION "2.5.1-FreeBSD" -#define GREP_FIXED 0 -#define GREP_BASIC 1 -#define GREP_EXTENDED 2 - -#define BINFILE_BIN 0 -#define BINFILE_SKIP 1 -#define BINFILE_TEXT 2 - -#define FILE_STDIO 0 -#define FILE_MMAP 1 -#define FILE_GZIP 2 -#define FILE_BZIP 3 -#define FILE_XZ 4 -#define FILE_LZMA 5 - -#define DIR_READ 0 -#define DIR_SKIP 1 -#define DIR_RECURSE 2 - -#define DEV_READ 0 -#define DEV_SKIP 1 - -#define LINK_READ 0 -#define LINK_EXPLICIT 1 -#define LINK_SKIP 2 +#define GREP_FIXED 0 +#define GREP_BASIC 1 +#define GREP_EXTENDED 2 + +#define BINFILE_BIN 0 +#define BINFILE_SKIP 1 +#define BINFILE_TEXT 2 + +#define FILE_STDIO 0 +#define FILE_MMAP 1 +#define FILE_GZIP 2 +#define FILE_BZIP 3 +#define FILE_XZ 4 +#define FILE_LZMA 5 + +#define DIR_READ 0 +#define DIR_SKIP 1 +#define DIR_RECURSE 2 + +#define DEV_READ 0 +#define DEV_SKIP 1 + +#define LINK_READ 0 +#define LINK_EXPLICIT 1 +#define LINK_SKIP 2 -#define EXCL_PAT 0 -#define INCL_PAT 1 +#define EXCL_PAT 0 +#define INCL_PAT 1 -#define MAX_LINE_MATCHES 32 +#define MAX_LINE_MATCHES 32 struct file { int fd; @@ -129,7 +129,7 @@ extern regex_t *er_pattern, *r_pattern; extern fastmatch_t *fg_pattern; /* For regex errors */ -#define RE_ERROR_BUF 512 +#define RE_ERROR_BUF 512 extern char re_error[RE_ERROR_BUF + 1]; /* Seems big enough */ /* util.c */ Modified: head/usr.bin/grep/regex/tre-fastmatch.c ============================================================================== --- head/usr.bin/grep/regex/tre-fastmatch.c Mon Apr 21 22:47:18 2014 (r264743) +++ head/usr.bin/grep/regex/tre-fastmatch.c Mon Apr 21 22:52:18 2014 (r264744) @@ -444,7 +444,7 @@ static int fastcmp(const fastmatch_t *fg } /* - * Copies the pattern pat having lenght n to p and stores + * Copies the pattern pat having length n to p and stores * the size in l. */ #define SAVE_PATTERN(src, srclen, dst, dstlen) \ Modified: head/usr.bin/patch/common.h ============================================================================== --- head/usr.bin/patch/common.h Mon Apr 21 22:47:18 2014 (r264743) +++ head/usr.bin/patch/common.h Mon Apr 21 22:52:18 2014 (r264744) @@ -32,32 +32,32 @@ #include #include -#define DEBUGGING +#define DEBUGGING /* constants */ -#define MAXHUNKSIZE 200000 /* is this enough lines? */ -#define INITHUNKMAX 125 /* initial dynamic allocation size */ -#define INITLINELEN 4096 -#define BUFFERSIZE 4096 - -#define SCCSPREFIX "s." -#define GET "get -e %s" -#define SCCSDIFF "get -p %s | diff - %s >/dev/null" - -#define RCSSUFFIX ",v" -#define CHECKOUT "co -l %s" -#define RCSDIFF "rcsdiff %s > /dev/null" +#define MAXHUNKSIZE 200000 /* is this enough lines? */ +#define INITHUNKMAX 125 /* initial dynamic allocation size */ +#define INITLINELEN 4096 +#define BUFFERSIZE 4096 + +#define SCCSPREFIX "s." +#define GET "get -e %s" +#define SCCSDIFF "get -p %s | diff - %s >/dev/null" + +#define RCSSUFFIX ",v" +#define CHECKOUT "co -l %s" +#define RCSDIFF "rcsdiff %s > /dev/null" -#define ORIGEXT ".orig" -#define REJEXT ".rej" +#define ORIGEXT ".orig" +#define REJEXT ".rej" /* handy definitions */ -#define strNE(s1,s2) (strcmp(s1, s2)) -#define strEQ(s1,s2) (!strcmp(s1, s2)) -#define strnNE(s1,s2,l) (strncmp(s1, s2, l)) -#define strnEQ(s1,s2,l) (!strncmp(s1, s2, l)) +#define strNE(s1,s2) (strcmp(s1, s2)) +#define strEQ(s1,s2) (!strcmp(s1, s2)) +#define strnNE(s1,s2,l) (strncmp(s1, s2, l)) +#define strnEQ(s1,s2,l) (!strncmp(s1, s2, l)) /* typedefs */ @@ -73,7 +73,7 @@ extern size_t buf_size; /* size of gener extern bool using_plan_a; /* try to keep everything in memory */ extern bool out_of_mem; /* ran out of memory in plan a */ -#define MAXFILEC 2 +#define MAXFILEC 2 extern char *filearg[MAXFILEC]; extern bool ok_to_create_file; @@ -105,11 +105,11 @@ extern bool warn_on_invalid_line; extern bool last_line_missing_eol; -#define CONTEXT_DIFF 1 -#define NORMAL_DIFF 2 -#define ED_DIFF 3 -#define NEW_CONTEXT_DIFF 4 -#define UNI_DIFF 5 +#define CONTEXT_DIFF 1 +#define NORMAL_DIFF 2 +#define ED_DIFF 3 +#define NEW_CONTEXT_DIFF 4 +#define UNI_DIFF 5 extern int diff_type; extern char *revision; /* prerequisite revision, if any */ Modified: head/usr.bin/patch/pch.h ============================================================================== --- head/usr.bin/patch/pch.h Mon Apr 21 22:47:18 2014 (r264743) +++ head/usr.bin/patch/pch.h Mon Apr 21 22:52:18 2014 (r264744) @@ -27,10 +27,10 @@ * $FreeBSD$ */ -#define OLD_FILE 0 -#define NEW_FILE 1 -#define INDEX_FILE 2 -#define MAX_FILE 3 +#define OLD_FILE 0 +#define NEW_FILE 1 +#define INDEX_FILE 2 +#define MAX_FILE 3 struct file_name { char *path; Modified: head/usr.bin/sort/bwstring.h ============================================================================== --- head/usr.bin/sort/bwstring.h Mon Apr 21 22:47:18 2014 (r264743) +++ head/usr.bin/sort/bwstring.h Mon Apr 21 22:52:18 2014 (r264744) @@ -28,7 +28,7 @@ */ #if !defined(__BWSTRING_H__) -#define __BWSTRING_H__ +#define __BWSTRING_H__ #include #include @@ -41,7 +41,7 @@ extern bool byte_sort; /* wchar_t is of 4 bytes: */ -#define SIZEOF_WCHAR_STRING(LEN) ((LEN)*sizeof(wchar_t)) +#define SIZEOF_WCHAR_STRING(LEN) ((LEN)*sizeof(wchar_t)) /* * Binary "wide" string @@ -64,7 +64,7 @@ struct reader_buffer typedef void *bwstring_iterator; -#define BWSLEN(s) ((s)->len) +#define BWSLEN(s) ((s)->len) struct bwstring *bwsalloc(size_t sz); @@ -135,7 +135,7 @@ bws_get_iter_value(bwstring_iterator ite int bws_iterator_cmp(bwstring_iterator iter1, bwstring_iterator iter2, size_t len); -#define BWS_GET(bws, pos) ((MB_CUR_MAX == 1) ? ((bws)->data.cstr[(pos)]) : (bws)->data.wstr[(pos)]) +#define BWS_GET(bws, pos) ((MB_CUR_MAX == 1) ? ((bws)->data.cstr[(pos)]) : (bws)->data.wstr[(pos)]) void initialise_months(void); Modified: head/usr.bin/sort/coll.h ============================================================================== --- head/usr.bin/sort/coll.h Mon Apr 21 22:47:18 2014 (r264743) +++ head/usr.bin/sort/coll.h Mon Apr 21 22:52:18 2014 (r264744) @@ -28,7 +28,7 @@ */ #if !defined(__COLL_H__) -#define __COLL_H__ +#define __COLL_H__ #include "bwstring.h" #include "sort.h" Modified: head/usr.bin/sort/file.h ============================================================================== --- head/usr.bin/sort/file.h Mon Apr 21 22:47:18 2014 (r264743) +++ head/usr.bin/sort/file.h Mon Apr 21 22:52:18 2014 (r264744) @@ -28,7 +28,7 @@ */ #if !defined(__SORT_FILE_H__) -#define __SORT_FILE_H__ +#define __SORT_FILE_H__ #include "coll.h" #include "sort.h" @@ -39,8 +39,8 @@ #define SORT_HEAPSORT 3 #define SORT_RADIXSORT 4 -#define DEFAULT_SORT_ALGORITHM SORT_HEAPSORT -#define DEFAULT_SORT_FUNC heapsort +#define DEFAULT_SORT_ALGORITHM SORT_HEAPSORT +#define DEFAULT_SORT_FUNC heapsort /* * List of data to be sorted. Modified: head/usr.bin/sort/mem.h ============================================================================== --- head/usr.bin/sort/mem.h Mon Apr 21 22:47:18 2014 (r264743) +++ head/usr.bin/sort/mem.h Mon Apr 21 22:52:18 2014 (r264744) @@ -28,7 +28,7 @@ */ #if !defined(__SORT_MEM_H__) -#define __SORT_MEM_H__ +#define __SORT_MEM_H__ #include #include Modified: head/usr.bin/sort/radixsort.h ============================================================================== --- head/usr.bin/sort/radixsort.h Mon Apr 21 22:47:18 2014 (r264743) +++ head/usr.bin/sort/radixsort.h Mon Apr 21 22:52:18 2014 (r264744) @@ -28,7 +28,7 @@ */ #if !defined(__SORT_RADIX_H__) -#define __SORT_RADIX_H__ +#define __SORT_RADIX_H__ #include "coll.h" #include "sort.h" Modified: head/usr.bin/sort/sort.1.in ============================================================================== --- head/usr.bin/sort/sort.1.in Mon Apr 21 22:47:18 2014 (r264743) +++ head/usr.bin/sort/sort.1.in Mon Apr 21 22:52:18 2014 (r264744) @@ -194,7 +194,7 @@ This is a random permutation of the inpu the equal keys sort together. It is implemented by hashing the input keys and sorting the hash values. -The hash function is choosen randomly. +The hash function is chosen randomly. The hash function is randomized by .Cm /dev/random content, or by file content if it is specified by @@ -212,7 +212,7 @@ The files are compared by their prefixes zeros are ignored in version numbers, see example below). If an input string does not match the pattern, then it is compared using the byte compare function. -All string comparisions are performed in C locale, the locale +All string comparisons are performed in C locale, the locale environment setting is ignored. .Bl -tag -width indent .It Example: Modified: head/usr.bin/sort/sort.h ============================================================================== --- head/usr.bin/sort/sort.h Mon Apr 21 22:47:18 2014 (r264743) +++ head/usr.bin/sort/sort.h Mon Apr 21 22:52:18 2014 (r264744) @@ -28,7 +28,7 @@ */ #if !defined(__BSD_SORT_H__) -#define __BSD_SORT_H__ +#define __BSD_SORT_H__ #include #include @@ -53,7 +53,7 @@ extern nl_catd catalog; extern const char *nlsstr[]; #if defined(SORT_THREADS) -#define MT_SORT_THRESHOLD (10000) +#define MT_SORT_THRESHOLD (10000) extern unsigned int ncpu; extern size_t nthreads; #endif Modified: head/usr.bin/sort/vsort.h ============================================================================== --- head/usr.bin/sort/vsort.h Mon Apr 21 22:47:18 2014 (r264743) +++ head/usr.bin/sort/vsort.h Mon Apr 21 22:52:18 2014 (r264744) @@ -28,7 +28,7 @@ */ #ifndef _VSORT_H_ -#define _VSORT_H_ +#define _VSORT_H_ #include "bwstring.h" From owner-svn-src-head@FreeBSD.ORG Tue Apr 22 04:42:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD926A59; Tue, 22 Apr 2014 04:42:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9AA6117E; Tue, 22 Apr 2014 04:42:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3M4gkgD022245; Tue, 22 Apr 2014 04:42:46 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3M4gkEe022244; Tue, 22 Apr 2014 04:42:46 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201404220442.s3M4gkEe022244@svn.freebsd.org> From: Rick Macklem Date: Tue, 22 Apr 2014 04:42:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264749 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2014 04:42:46 -0000 Author: rmacklem Date: Tue Apr 22 04:42:46 2014 New Revision: 264749 URL: http://svnweb.freebsd.org/changeset/base/264749 Log: Fixes mkdir for the NFSv2 client that was broken by r264705. Reported by: bdrewery MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Tue Apr 22 04:36:53 2014 (r264748) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Tue Apr 22 04:42:46 2014 (r264749) @@ -2585,7 +2585,7 @@ nfsrpc_mkdir(vnode_t dvp, char *name, in } if (!error) error = nfscl_mtofh(nd, nfhpp, nnap, attrflagp); - if (!error) { + if (error == 0 && (nd->nd_flag & ND_NFSV4) != 0) { /* Get rid of the PutFH and Getattr status values. */ NFSM_DISSECT(tl, u_int32_t *, 4 * NFSX_UNSIGNED); /* Load the directory attributes. */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 22 15:15:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25AD348E; Tue, 22 Apr 2014 15:15:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12B8B1339; Tue, 22 Apr 2014 15:15:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3MFFsGI086170; Tue, 22 Apr 2014 15:15:54 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3MFFsUG086169; Tue, 22 Apr 2014 15:15:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201404221515.s3MFFsUG086169@svn.freebsd.org> From: John Baldwin Date: Tue, 22 Apr 2014 15:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264765 - head/usr.sbin/mfiutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2014 15:15:55 -0000 Author: jhb Date: Tue Apr 22 15:15:54 2014 New Revision: 264765 URL: http://svnweb.freebsd.org/changeset/base/264765 Log: Don't claim the adapter is idle if it is clearing a drive. MFC after: 1 week Modified: head/usr.sbin/mfiutil/mfi_show.c Modified: head/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_show.c Tue Apr 22 13:58:39 2014 (r264764) +++ head/usr.sbin/mfiutil/mfi_show.c Tue Apr 22 15:15:54 2014 (r264765) @@ -766,7 +766,7 @@ show_progress(int ac, char **av __unused printf("drive %s ", mfi_drive_name(NULL, device_id, MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS)); mfi_display_progress("Clear", &pinfo.prog_info.clear); - + busy = 1; } } From owner-svn-src-head@FreeBSD.ORG Tue Apr 22 15:17:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 113815EF; Tue, 22 Apr 2014 15:17:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D80291358; Tue, 22 Apr 2014 15:17:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3MFHWSi086428; Tue, 22 Apr 2014 15:17:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3MFHW7G086427; Tue, 22 Apr 2014 15:17:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201404221517.s3MFHW7G086427@svn.freebsd.org> From: John Baldwin Date: Tue, 22 Apr 2014 15:17:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264766 - head/usr.sbin/mfiutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2014 15:17:33 -0000 Author: jhb Date: Tue Apr 22 15:17:32 2014 New Revision: 264766 URL: http://svnweb.freebsd.org/changeset/base/264766 Log: - Fix an off by one error when checking for the stop event. This resulted in not showing the most recent event by default. - When the stop even is hit, break out of the outer loop to stop fetching more events. MFC after: 1 week Modified: head/usr.sbin/mfiutil/mfi_evt.c Modified: head/usr.sbin/mfiutil/mfi_evt.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_evt.c Tue Apr 22 15:15:54 2014 (r264765) +++ head/usr.sbin/mfiutil/mfi_evt.c Tue Apr 22 15:17:32 2014 (r264766) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -534,6 +535,7 @@ show_events(int ac, char **av) struct mfi_evt_log_state info; struct mfi_evt_list *list; union mfi_evt filter; + bool first; long val; char *cp; ssize_t size; @@ -640,7 +642,9 @@ show_events(int ac, char **av) close(fd); return (ENOMEM); } - for (seq = start;;) { + first = true; + seq = start; + for (;;) { if (mfi_get_events(fd, list, num_events, filter, seq, &status) < 0) { error = errno; @@ -650,8 +654,6 @@ show_events(int ac, char **av) return (error); } if (status == MFI_STAT_NOT_FOUND) { - if (seq == start) - warnx("No matching events found"); break; } if (status != MFI_STAT_OK) { @@ -669,13 +671,14 @@ show_events(int ac, char **av) * the case that our stop point is earlier in * the buffer than our start point. */ - if (list->event[i].seq >= stop) { + if (list->event[i].seq > stop) { if (start <= stop) - break; + goto finish; else if (list->event[i].seq < start) - break; + goto finish; } mfi_decode_evt(fd, &list->event[i], verbose); + first = false; } /* @@ -686,6 +689,9 @@ show_events(int ac, char **av) seq = list->event[list->count - 1].seq + 1; } +finish: + if (first) + warnx("No matching events found"); free(list); close(fd); From owner-svn-src-head@FreeBSD.ORG Tue Apr 22 16:13:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C53A012C; Tue, 22 Apr 2014 16:13:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 989C219DC; Tue, 22 Apr 2014 16:13:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3MGDvwm011723; Tue, 22 Apr 2014 16:13:57 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3MGDvbJ011721; Tue, 22 Apr 2014 16:13:57 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201404221613.s3MGDvbJ011721@svn.freebsd.org> From: Tycho Nightingale Date: Tue, 22 Apr 2014 16:13:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264768 - in head: sys/amd64/vmm usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2014 16:13:57 -0000 Author: tychon Date: Tue Apr 22 16:13:56 2014 New Revision: 264768 URL: http://svnweb.freebsd.org/changeset/base/264768 Log: Factor out common ioport handler code for better hygiene -- pointed out by neel@. Approved by: neel (co-mentor) Modified: head/sys/amd64/vmm/vmm_ioport.c head/usr.sbin/bhyve/inout.c Modified: head/sys/amd64/vmm/vmm_ioport.c ============================================================================== --- head/sys/amd64/vmm/vmm_ioport.c Tue Apr 22 16:04:31 2014 (r264767) +++ head/sys/amd64/vmm/vmm_ioport.c Tue Apr 22 16:13:56 2014 (r264768) @@ -69,18 +69,19 @@ emulate_ioport(struct vm *vm, int vcpuid if (handler == NULL) return (-1); + switch (vmexit->u.inout.bytes) { + case 1: + mask = 0xff; + break; + case 2: + mask = 0xffff; + break; + default: + mask = 0xffffffff; + break; + } + if (!vmexit->u.inout.in) { - switch (vmexit->u.inout.bytes) { - case 1: - mask = 0xff; - break; - case 2: - mask = 0xffff; - break; - default: - mask = 0xffffffff; - break; - } val = vmexit->u.inout.eax & mask; } @@ -88,17 +89,6 @@ emulate_ioport(struct vm *vm, int vcpuid vmexit->u.inout.port, vmexit->u.inout.bytes, &val); if (!error && vmexit->u.inout.in) { - switch (vmexit->u.inout.bytes) { - case 1: - mask = 0xff; - break; - case 2: - mask = 0xffff; - break; - default: - mask = 0xffffffff; - break; - } vmexit->u.inout.eax &= ~mask; vmexit->u.inout.eax |= val & mask; } Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Tue Apr 22 16:04:31 2014 (r264767) +++ head/usr.sbin/bhyve/inout.c Tue Apr 22 16:13:56 2014 (r264768) @@ -107,18 +107,19 @@ emulate_inout(struct vmctx *ctx, int vcp if (strict && handler == default_inout) return (-1); + switch (bytes) { + case 1: + mask = 0xff; + break; + case 2: + mask = 0xffff; + break; + default: + mask = 0xffffffff; + break; + } + if (!in) { - switch (bytes) { - case 1: - mask = 0xff; - break; - case 2: - mask = 0xffff; - break; - default: - mask = 0xffffffff; - break; - } val = *eax & mask; } @@ -131,17 +132,6 @@ emulate_inout(struct vmctx *ctx, int vcp error = -1; if (!error && in) { - switch (bytes) { - case 1: - mask = 0xff; - break; - case 2: - mask = 0xffff; - break; - default: - mask = 0xffffffff; - break; - } *eax &= ~mask; *eax |= val & mask; } From owner-svn-src-head@FreeBSD.ORG Tue Apr 22 18:08:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FBDE3C7; Tue, 22 Apr 2014 18:08:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E43EC17B3; Tue, 22 Apr 2014 18:08:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3MI8YKI057527; Tue, 22 Apr 2014 18:08:34 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3MI8Y8G057526; Tue, 22 Apr 2014 18:08:34 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201404221808.s3MI8Y8G057526@svn.freebsd.org> From: Luiz Otavio O Souza Date: Tue, 22 Apr 2014 18:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264769 - head/sys/geom/uncompress X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2014 18:08:35 -0000 Author: loos Date: Tue Apr 22 18:08:34 2014 New Revision: 264769 URL: http://svnweb.freebsd.org/changeset/base/264769 Log: Keep geom_uncompress(4) in line with geom_uzip(4), bring in the r264504 fix. Make sure not to start I/O bigger than MAXPHYS bytes. Quoting r264504: When we detect the condition, we'll reduce the block count and perform a "short" read. In g_uncompress_done() we need to consider the original I/O length and stop early if we're about to deflate a block that we didn't read. By using bio_completed in the cloned BIO and not bio_length to check for this, we automatically and gracefully handle short reads that our providers may be doing on top of the short reads we may initiate ourselves. Reviewed by: marcel Modified: head/sys/geom/uncompress/g_uncompress.c Modified: head/sys/geom/uncompress/g_uncompress.c ============================================================================== --- head/sys/geom/uncompress/g_uncompress.c Tue Apr 22 16:13:56 2014 (r264768) +++ head/sys/geom/uncompress/g_uncompress.c Tue Apr 22 18:08:34 2014 (r264769) @@ -169,7 +169,7 @@ g_uncompress_done(struct bio *bp) struct g_geom *gp; struct bio *bp2; uint32_t start_blk, i; - off_t pos, upos; + off_t iolen, pos, upos; size_t bsize; int err; @@ -210,6 +210,7 @@ g_uncompress_done(struct bio *bp) */ start_blk = bp2->bio_offset / sc->blksz; bsize = pp2->sectorsize; + iolen = bp->bio_completed; pos = sc->offsets[start_blk] % bsize; upos = 0; @@ -239,6 +240,13 @@ g_uncompress_done(struct bio *bp) continue; } + if (len > iolen) { + DPRINTF(("%s: done: early termination: len (%jd) > " + "iolen (%jd)\n", + gp->name, (intmax_t)len, (intmax_t)iolen)); + break; + } + mtx_lock(&sc->last_mtx); #ifdef GEOM_UNCOMPRESS_DEBUG @@ -292,6 +300,7 @@ g_uncompress_done(struct bio *bp) mtx_unlock(&sc->last_mtx); pos += len; + iolen -= len; upos += ulen; bp2->bio_completed += ulen; } @@ -380,10 +389,18 @@ g_uncompress_start(struct bio *bp) bsize = pp2->sectorsize; bp2->bio_done = g_uncompress_done; - bp2->bio_offset = rounddown(sc->offsets[start_blk],bsize); - bp2->bio_length = roundup(sc->offsets[end_blk],bsize) - - bp2->bio_offset; - bp2->bio_data = malloc(bp2->bio_length, M_GEOM_UNCOMPRESS, M_NOWAIT); + bp2->bio_offset = rounddown(sc->offsets[start_blk], bsize); + while (1) { + bp2->bio_length = roundup(sc->offsets[end_blk], bsize) - + bp2->bio_offset; + if (bp2->bio_length < MAXPHYS) + break; + + end_blk--; + DPRINTF(( + "%s: bio_length (%jd) > MAXPHYS: lowering end_blk to %u\n", + gp->name, (intmax_t)bp2->bio_length, end_blk)); + } DPRINTF(("%s: start %jd + %jd -> %ju + %ju -> %jd + %jd\n", gp->name, @@ -392,6 +409,7 @@ g_uncompress_start(struct bio *bp) (uintmax_t)sc->offsets[end_blk] - sc->offsets[start_blk], (intmax_t)bp2->bio_offset, (intmax_t)bp2->bio_length)); + bp2->bio_data = malloc(bp2->bio_length, M_GEOM_UNCOMPRESS, M_NOWAIT); if (bp2->bio_data == NULL) { g_destroy_bio(bp2); g_io_deliver(bp, ENOMEM); From owner-svn-src-head@FreeBSD.ORG Tue Apr 22 18:55:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A61D4CBD; Tue, 22 Apr 2014 18:55:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 903841CB3; Tue, 22 Apr 2014 18:55:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3MItNsj078627; Tue, 22 Apr 2014 18:55:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3MItLuP078617; Tue, 22 Apr 2014 18:55:21 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404221855.s3MItLuP078617@svn.freebsd.org> From: Xin LI Date: Tue, 22 Apr 2014 18:55:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264770 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2014 18:55:23 -0000 Author: delphij Date: Tue Apr 22 18:55:21 2014 New Revision: 264770 URL: http://svnweb.freebsd.org/changeset/base/264770 Log: Use calloc() in favor of malloc + memset. Reviewed by: neel Modified: head/usr.sbin/bhyve/block_if.c head/usr.sbin/bhyve/mevent.c head/usr.sbin/bhyve/pci_ahci.c head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_passthru.c head/usr.sbin/bhyve/pci_virtio_block.c head/usr.sbin/bhyve/pci_virtio_net.c head/usr.sbin/bhyve/pci_virtio_rnd.c head/usr.sbin/bhyve/uart_emul.c Modified: head/usr.sbin/bhyve/block_if.c ============================================================================== --- head/usr.sbin/bhyve/block_if.c Tue Apr 22 18:08:34 2014 (r264769) +++ head/usr.sbin/bhyve/block_if.c Tue Apr 22 18:55:21 2014 (r264770) @@ -270,13 +270,12 @@ blockif_open(const char *optstr, const c assert(sectsz != 0); } - bc = malloc(sizeof(struct blockif_ctxt)); + bc = calloc(1, sizeof(struct blockif_ctxt)); if (bc == NULL) { close(fd); return (NULL); } - memset(bc, 0, sizeof(*bc)); bc->bc_magic = BLOCKIF_SIG; bc->bc_fd = fd; bc->bc_size = size; Modified: head/usr.sbin/bhyve/mevent.c ============================================================================== --- head/usr.sbin/bhyve/mevent.c Tue Apr 22 18:08:34 2014 (r264769) +++ head/usr.sbin/bhyve/mevent.c Tue Apr 22 18:55:21 2014 (r264770) @@ -268,12 +268,11 @@ mevent_add(int tfd, enum ev_type type, /* * Allocate an entry, populate it, and add it to the change list. */ - mevp = malloc(sizeof(struct mevent)); + mevp = calloc(1, sizeof(struct mevent)); if (mevp == NULL) { goto exit; } - memset(mevp, 0, sizeof(struct mevent)); if (type == EVF_TIMER) { mevp->me_msecs = tfd; mevp->me_timid = mevent_timid++; Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Tue Apr 22 18:08:34 2014 (r264769) +++ head/usr.sbin/bhyve/pci_ahci.c Tue Apr 22 18:55:21 2014 (r264770) @@ -1756,8 +1756,7 @@ pci_ahci_init(struct vmctx *ctx, struct dbg = fopen("/tmp/log", "w+"); #endif - sc = malloc(sizeof(struct pci_ahci_softc)); - memset(sc, 0, sizeof(struct pci_ahci_softc)); + sc = calloc(1, sizeof(struct pci_ahci_softc)); pi->pi_arg = sc; sc->asc_pi = pi; sc->ports = MAX_PORTS; Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Tue Apr 22 18:08:34 2014 (r264769) +++ head/usr.sbin/bhyve/pci_emul.c Tue Apr 22 18:55:21 2014 (r264770) @@ -688,8 +688,7 @@ pci_emul_init(struct vmctx *ctx, struct struct pci_devinst *pdi; int err; - pdi = malloc(sizeof(struct pci_devinst)); - bzero(pdi, sizeof(*pdi)); + pdi = calloc(1, sizeof(struct pci_devinst)); pdi->pi_vmctx = ctx; pdi->pi_bus = bus; @@ -781,8 +780,7 @@ pci_msix_table_init(struct pci_devinst * assert(table_entries <= MAX_MSIX_TABLE_ENTRIES); table_size = table_entries * MSIX_TABLE_ENTRY_SIZE; - pi->pi_msix.table = malloc(table_size); - bzero(pi->pi_msix.table, table_size); + pi->pi_msix.table = calloc(1, table_size); /* set mask bit of vector control register */ for (i = 0; i < table_entries; i++) @@ -1781,8 +1779,7 @@ pci_emul_dinit(struct vmctx *ctx, struct int error; struct pci_emul_dsoftc *sc; - sc = malloc(sizeof(struct pci_emul_dsoftc)); - memset(sc, 0, sizeof(struct pci_emul_dsoftc)); + sc = calloc(1, sizeof(struct pci_emul_dsoftc)); pi->pi_arg = sc; Modified: head/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- head/usr.sbin/bhyve/pci_passthru.c Tue Apr 22 18:08:34 2014 (r264769) +++ head/usr.sbin/bhyve/pci_passthru.c Tue Apr 22 18:55:21 2014 (r264770) @@ -232,8 +232,7 @@ cfginitmsi(struct passthru_softc *sc) /* Allocate the emulated MSI-X table array */ table_size = pi->pi_msix.table_count * MSIX_TABLE_ENTRY_SIZE; - pi->pi_msix.table = malloc(table_size); - bzero(pi->pi_msix.table, table_size); + pi->pi_msix.table = calloc(1, table_size); /* Mask all table entries */ for (i = 0; i < pi->pi_msix.table_count; i++) { @@ -574,8 +573,7 @@ passthru_init(struct vmctx *ctx, struct if (vm_assign_pptdev(ctx, bus, slot, func) != 0) goto done; - sc = malloc(sizeof(struct passthru_softc)); - memset(sc, 0, sizeof(struct passthru_softc)); + sc = calloc(1, sizeof(struct passthru_softc)); pi->pi_arg = sc; sc->psc_pi = pi; Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Tue Apr 22 18:08:34 2014 (r264769) +++ head/usr.sbin/bhyve/pci_virtio_block.c Tue Apr 22 18:55:21 2014 (r264770) @@ -299,8 +299,7 @@ pci_vtblk_init(struct vmctx *ctx, struct assert(sectsz != 0); } - sc = malloc(sizeof(struct pci_vtblk_softc)); - memset(sc, 0, sizeof(struct pci_vtblk_softc)); + sc = calloc(1, sizeof(struct pci_vtblk_softc)); /* record fd of storage device/file */ sc->vbsc_fd = fd; Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Tue Apr 22 18:08:34 2014 (r264769) +++ head/usr.sbin/bhyve/pci_virtio_net.c Tue Apr 22 18:55:21 2014 (r264770) @@ -513,8 +513,7 @@ pci_vtnet_init(struct vmctx *ctx, struct char *vtopts; int mac_provided; - sc = malloc(sizeof(struct pci_vtnet_softc)); - memset(sc, 0, sizeof(struct pci_vtnet_softc)); + sc = calloc(1, sizeof(struct pci_vtnet_softc)); pthread_mutex_init(&sc->vsc_mtx, NULL); Modified: head/usr.sbin/bhyve/pci_virtio_rnd.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_rnd.c Tue Apr 22 18:08:34 2014 (r264769) +++ head/usr.sbin/bhyve/pci_virtio_rnd.c Tue Apr 22 18:55:21 2014 (r264770) @@ -155,8 +155,7 @@ pci_vtrnd_init(struct vmctx *ctx, struct return (1); } - sc = malloc(sizeof(struct pci_vtrnd_softc)); - memset(sc, 0, sizeof(struct pci_vtrnd_softc)); + sc = calloc(1, sizeof(struct pci_vtrnd_softc)); vi_softc_linkup(&sc->vrsc_vs, &vtrnd_vi_consts, sc, pi, &sc->vrsc_vq); sc->vrsc_vs.vs_mtx = &sc->vrsc_mtx; Modified: head/usr.sbin/bhyve/uart_emul.c ============================================================================== --- head/usr.sbin/bhyve/uart_emul.c Tue Apr 22 18:08:34 2014 (r264769) +++ head/usr.sbin/bhyve/uart_emul.c Tue Apr 22 18:55:21 2014 (r264770) @@ -563,8 +563,7 @@ uart_init(uart_intr_func_t intr_assert, { struct uart_softc *sc; - sc = malloc(sizeof(struct uart_softc)); - bzero(sc, sizeof(struct uart_softc)); + sc = calloc(1, sizeof(struct uart_softc)); sc->arg = arg; sc->intr_assert = intr_assert; From owner-svn-src-head@FreeBSD.ORG Tue Apr 22 20:19:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 692E9FCD; Tue, 22 Apr 2014 20:19:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C13C171F; Tue, 22 Apr 2014 20:19:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3MKJAhD012225; Tue, 22 Apr 2014 20:19:10 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3MKJA4l012224; Tue, 22 Apr 2014 20:19:10 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201404222019.s3MKJA4l012224@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 22 Apr 2014 20:19:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264772 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2014 20:19:10 -0000 Author: gnn Date: Tue Apr 22 20:19:09 2014 New Revision: 264772 URL: http://svnweb.freebsd.org/changeset/base/264772 Log: Check that port is started when MAC filter is set The MAC filter set may be called without softc_lock held in the case of SIOCADDMULTI and SIOCDELMULTI ioctls. The ioctl handler checks IFF_DRV_RUNNING flag which implies port started, but it is not guaranteed to remain. softc_lock shared lock can't be held in the case of these ioctls processing, since it results in failure where kernel complains that non-sleepable lock is held in sleeping thread. Both problems are repeatable on LAG with LACP proto bring up. Submitted by: Andrew Rybchenko Sponsored by: Solarflare Communications, Inc. MFC after: 2 weeks Modified: head/sys/dev/sfxge/sfxge_port.c Modified: head/sys/dev/sfxge/sfxge_port.c ============================================================================== --- head/sys/dev/sfxge/sfxge_port.c Tue Apr 22 20:17:05 2014 (r264771) +++ head/sys/dev/sfxge/sfxge_port.c Tue Apr 22 20:19:09 2014 (r264772) @@ -320,10 +320,21 @@ sfxge_mac_filter_set(struct sfxge_softc struct sfxge_port *port = &sc->port; int rc; - KASSERT(port->init_state == SFXGE_PORT_STARTED, ("port not started")); - mtx_lock(&port->lock); - rc = sfxge_mac_filter_set_locked(sc); + /* + * The function may be called without softc_lock held in the + * case of SIOCADDMULTI and SIOCDELMULTI ioctls. ioctl handler + * checks IFF_DRV_RUNNING flag which implies port started, but + * it is not guaranteed to remain. softc_lock shared lock can't + * be held in the case of these ioctls processing, since it + * results in failure where kernel complains that non-sleepable + * lock is held in sleeping thread. Both problems are repeatable + * on LAG with LACP proto bring up. + */ + if (port->init_state == SFXGE_PORT_STARTED) + rc = sfxge_mac_filter_set_locked(sc); + else + rc = 0; mtx_unlock(&port->lock); return rc; } From owner-svn-src-head@FreeBSD.ORG Tue Apr 22 20:37:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5218F8C0; Tue, 22 Apr 2014 20:37:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 326B91922; Tue, 22 Apr 2014 20:37:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3MKb8O4020346; Tue, 22 Apr 2014 20:37:08 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3MKb7NL020341; Tue, 22 Apr 2014 20:37:07 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404222037.s3MKb7NL020341@svn.freebsd.org> From: Ed Maste Date: Tue, 22 Apr 2014 20:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264774 - in head/kerberos5/lib: libasn1 libgssapi_spnego libhdb libhx509 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2014 20:37:08 -0000 Author: emaste Date: Tue Apr 22 20:37:07 2014 New Revision: 264774 URL: http://svnweb.freebsd.org/changeset/base/264774 Log: Fix installworld failure when kerberos source files have new timestamps If a kerberos .hx source file is newer than the .h copy, but the content is the same, then during buildworld the "cmp -s || cp" command in the .hx.h rule would do nothing, leaving the .h copy with the older timestamp. During installworld the rule would again be invoked, causing a failure as neither cmp or cp would exist in the temporary path. As the underlying issue should be resolved by r262209, unconditionally copy the file. No objection: peter@ Tested by: gjb@ Sponsored by: The FreeBSD Foundation Modified: head/kerberos5/lib/libasn1/Makefile head/kerberos5/lib/libgssapi_spnego/Makefile head/kerberos5/lib/libhdb/Makefile head/kerberos5/lib/libhx509/Makefile Modified: head/kerberos5/lib/libasn1/Makefile ============================================================================== --- head/kerberos5/lib/libasn1/Makefile Tue Apr 22 20:21:40 2014 (r264773) +++ head/kerberos5/lib/libasn1/Makefile Tue Apr 22 20:37:07 2014 (r264774) @@ -112,10 +112,10 @@ ${GEN_KX509}: kx509.asn1 .SUFFIXES: .h .c .x .hx .x.c: - cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cp ${.IMPSRC} ${.TARGET} + cp ${.IMPSRC} ${.TARGET} .hx.h: - cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cp ${.IMPSRC} ${.TARGET} + cp ${.IMPSRC} ${.TARGET} .include Modified: head/kerberos5/lib/libgssapi_spnego/Makefile ============================================================================== --- head/kerberos5/lib/libgssapi_spnego/Makefile Tue Apr 22 20:21:40 2014 (r264773) +++ head/kerberos5/lib/libgssapi_spnego/Makefile Tue Apr 22 20:37:07 2014 (r264774) @@ -46,10 +46,10 @@ ${GEN}: spnego.asn1 spnego.opt .SUFFIXES: .h .c .x .hx .x.c: - cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cp ${.IMPSRC} ${.TARGET} + cp ${.IMPSRC} ${.TARGET} .hx.h: - cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cp ${.IMPSRC} ${.TARGET} + cp ${.IMPSRC} ${.TARGET} .include Modified: head/kerberos5/lib/libhdb/Makefile ============================================================================== --- head/kerberos5/lib/libhdb/Makefile Tue Apr 22 20:21:40 2014 (r264773) +++ head/kerberos5/lib/libhdb/Makefile Tue Apr 22 20:37:07 2014 (r264774) @@ -91,10 +91,10 @@ ${GEN}: hdb.asn1 .SUFFIXES: .h .c .x .hx .x.c: - cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cp ${.IMPSRC} ${.TARGET} + cp ${.IMPSRC} ${.TARGET} .hx.h: - cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cp ${.IMPSRC} ${.TARGET} + cp ${.IMPSRC} ${.TARGET} .include Modified: head/kerberos5/lib/libhx509/Makefile ============================================================================== --- head/kerberos5/lib/libhx509/Makefile Tue Apr 22 20:21:40 2014 (r264773) +++ head/kerberos5/lib/libhx509/Makefile Tue Apr 22 20:37:07 2014 (r264774) @@ -286,10 +286,10 @@ ${GEN_CRMF}: crmf.asn1 .SUFFIXES: .h .c .x .hx .x.c: - cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cp ${.IMPSRC} ${.TARGET} + cp ${.IMPSRC} ${.TARGET} .hx.h: - cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cp ${.IMPSRC} ${.TARGET} + cp ${.IMPSRC} ${.TARGET} .include From owner-svn-src-head@FreeBSD.ORG Tue Apr 22 21:07:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B82E96E; Tue, 22 Apr 2014 21:07:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F268E1C40; Tue, 22 Apr 2014 21:07:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3ML7uYb033195; Tue, 22 Apr 2014 21:07:56 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3ML7ujp033193; Tue, 22 Apr 2014 21:07:56 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201404222107.s3ML7ujp033193@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 22 Apr 2014 21:07:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264781 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2014 21:07:57 -0000 Author: bapt Date: Tue Apr 22 21:07:56 2014 New Revision: 264781 URL: http://svnweb.freebsd.org/changeset/base/264781 Log: Simplify reading pw.conf(5) by using getline(3) Modified: head/usr.sbin/pw/pw.h head/usr.sbin/pw/pw_conf.c Modified: head/usr.sbin/pw/pw.h ============================================================================== --- head/usr.sbin/pw/pw.h Tue Apr 22 21:05:11 2014 (r264780) +++ head/usr.sbin/pw/pw.h Tue Apr 22 21:07:56 2014 (r264781) @@ -26,6 +26,7 @@ * $FreeBSD$ */ +#define _WITH_GETLINE #include #include #include Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Tue Apr 22 21:05:11 2014 (r264780) +++ head/usr.sbin/pw/pw_conf.c Tue Apr 22 21:07:56 2014 (r264781) @@ -226,35 +226,21 @@ newstr(char const * p) struct userconf * read_userconfig(char const * file) { - FILE *fp; + FILE *fp; + char *buf, *p; + size_t linecap; + ssize_t linelen; + + buf = NULL; + linecap = 0; extendarray(&config.groups, &config.numgroups, 200); memset(config.groups, 0, config.numgroups * sizeof(char *)); if (file == NULL) file = _PATH_PW_CONF; - if ((fp = fopen(file, "r")) != NULL) { - int buflen = LNBUFSZ; - char *buf = malloc(buflen); - - nextline: - while (fgets(buf, buflen, fp) != NULL) { - char *p; - - while ((p = strchr(buf, '\n')) == NULL) { - int l; - if (extendline(&buf, &buflen, buflen + LNBUFSZ) == -1) { - int ch; - while ((ch = fgetc(fp)) != '\n' && ch != EOF); - goto nextline; /* Ignore it */ - } - l = strlen(buf); - if (fgets(buf + l, buflen - l, fp) == NULL) - break; /* Unterminated last line */ - } - - if (p != NULL) - *p = '\0'; + if ((fp = fopen(file, "r")) != NULL) { + while ((linelen = getline(&buf, &linecap, fp)) > 0) { if (*buf && (p = strtok(buf, " \t\r\n=")) != NULL && *p != '#') { static char const toks[] = " \t\r\n,="; char *q = strtok(NULL, toks); @@ -368,7 +354,8 @@ read_userconfig(char const * file) } } } - free(buf); + if (linecap > 0) + free(buf); fclose(fp); } return &config; From owner-svn-src-head@FreeBSD.ORG Tue Apr 22 22:02:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A62DEF0A; Tue, 22 Apr 2014 22:02:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F0561331; Tue, 22 Apr 2014 22:02:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3MM28nC057413; Tue, 22 Apr 2014 22:02:08 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3MM27X4057404; Tue, 22 Apr 2014 22:02:07 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201404222202.s3MM27X4057404@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 22 Apr 2014 22:02:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264789 - in head: contrib/libucl contrib/libucl/doc contrib/libucl/include contrib/libucl/src contrib/libucl/tests contrib/libucl/utils usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2014 22:02:08 -0000 Author: bapt Date: Tue Apr 22 22:02:06 2014 New Revision: 264789 URL: http://svnweb.freebsd.org/changeset/base/264789 Log: Import libucl 0.4.0 Adapt pkg(7) to the new libucl API Modified: head/contrib/libucl/README.md head/contrib/libucl/configure.ac head/contrib/libucl/doc/api.md head/contrib/libucl/doc/libucl.3 head/contrib/libucl/include/ucl.h head/contrib/libucl/src/Makefile.am head/contrib/libucl/src/ucl_emitter.c head/contrib/libucl/src/ucl_hash.c head/contrib/libucl/src/ucl_hash.h head/contrib/libucl/src/ucl_internal.h head/contrib/libucl/src/ucl_parser.c head/contrib/libucl/src/ucl_schema.c head/contrib/libucl/src/ucl_util.c head/contrib/libucl/tests/test_basic.c head/contrib/libucl/tests/test_generate.c head/contrib/libucl/tests/test_schema.c head/contrib/libucl/utils/objdump.c head/usr.sbin/pkg/config.c head/usr.sbin/pkg/pkg.c Directory Properties: head/contrib/libucl/ (props changed) Modified: head/contrib/libucl/README.md ============================================================================== --- head/contrib/libucl/README.md Tue Apr 22 21:57:13 2014 (r264788) +++ head/contrib/libucl/README.md Tue Apr 22 22:02:06 2014 (r264789) @@ -287,7 +287,7 @@ Each UCL object can be serialized to one ## Validation -UCL allows validation of objects. It uses the same schema that is used for json: [json schema v4](http://json-schema.org). UCL supports the full set of json schema with the exception of remote references. This feature is unlikely useful for configuration objects. Of course, schema definition can be in UCL format instead of JSON that sinplifies schemas writing. Moreover, since UCL supports multiple values for keys in an object it is possible to specify generic integer constraints `maxValues` and `minValues` to define the limits of values in a single key. UCL currently is not absolutely strict about validation schemas themselves, therefore UCL users should supply valid schemas (as it is defined in json-schema draft v4) to ensure that input is validated properly. +UCL allows validation of objects. It uses the same schema that is used for json: [json schema v4](http://json-schema.org). UCL supports the full set of json schema with the exception of remote references. This feature is unlikely useful for configuration objects. Of course, a schema definition can be in UCL format instead of JSON that simplifies schemas writing. Moreover, since UCL supports multiple values for keys in an object it is possible to specify generic integer constraints `maxValues` and `minValues` to define the limits of values count in a single key. UCL currently is not absolutely strict about validation schemas themselves, therefore UCL users should supply valid schemas (as it is defined in json-schema draft v4) to ensure that the input objects are validated properly. ## Performance Modified: head/contrib/libucl/configure.ac ============================================================================== --- head/contrib/libucl/configure.ac Tue Apr 22 21:57:13 2014 (r264788) +++ head/contrib/libucl/configure.ac Tue Apr 22 22:02:06 2014 (r264789) @@ -1,5 +1,5 @@ m4_define([maj_ver], [0]) -m4_define([med_ver], [3]) +m4_define([med_ver], [4]) m4_define([min_ver], [0]) m4_define([so_version], [maj_ver:med_ver]) m4_define([ucl_version], [maj_ver.med_ver.min_ver]) @@ -48,11 +48,17 @@ AC_CHECK_HEADERS_ONCE([float.h]) AC_CHECK_HEADERS_ONCE([math.h]) dnl Example of default-disabled feature -AC_ARG_ENABLE([urls], AS_HELP_STRING([--enable-urls], [Enable URLs fetch (requires libfetch or libcurl)])) +AC_ARG_ENABLE([urls], AS_HELP_STRING([--enable-urls], + [Enable URLs fetch (requires libfetch or libcurl) @<:@default=no@:>@]), [], + [enable_urls=no]) +AC_ARG_ENABLE([regex], AS_HELP_STRING([--enable-regex], + [Enable regex checking for schema @<:@default=yes@:>@]), [], + [enable_regex=yes]) AC_ARG_ENABLE([signatures], AS_HELP_STRING([--enable-signatures], - [Enable signatures check (requires openssl)])) + [Enable signatures check (requires openssl) @<:@default=no@:>@]), [], + [enable_signatures=no]) AC_ARG_ENABLE([utils], - [--enable-utils Build and install utils], + AS_HELP_STRING([--enable-utils], [Build and install utils @<:@default=no@:>@]), [case "${enableval}" in yes) utils=true ;; no) utils=false ;; @@ -63,11 +69,11 @@ AM_CONDITIONAL([UTILS], [test x$utils = AS_IF([test "x$enable_signatures" = "xyes"], [ AC_SEARCH_LIBS([EVP_MD_CTX_create], [crypto], [ AC_DEFINE(HAVE_OPENSSL, 1, [Define to 1 if you have the 'crypto' library (-lcrypto).]) - LIBSSL_LIB="-lcrypto" + LIBCRYPTO_LIB="-lcrypto" LIBS_EXTRA="${LIBS_EXTRA} -lcrypto" ], [AC_MSG_ERROR([unable to find the EVP_MD_CTX_create() function])]) ]) - +AC_SUBST(LIBCRYPTO_LIB) AC_PATH_PROG(PANDOC, pandoc, [/non/existent]) AC_SEARCH_LIBS([clock_gettime], [rt], [], [ @@ -77,11 +83,21 @@ AC_SEARCH_LIBS([clock_gettime], [rt], [] ]) AC_SEARCH_LIBS([remainder], [m], [], [AC_MSG_ERROR([unable to find remainder() function])]) -AC_CHECK_HEADER([regex.h], [ - AC_DEFINE(HAVE_REGEX_H, 1, [Define to 1 if you have the header file.]) - ], - [AC_MSG_ERROR([unable to find the regex.h header])], - [#include ]) +AS_IF([test "x$enable_regex" = "xyes"], [ + AC_CHECK_HEADER([regex.h], [ + AC_DEFINE(HAVE_REGEX_H, 1, [Define to 1 if you have the header file.]) + AC_SEARCH_LIBS([regexec], [regex], [ + AS_IF([test "x$ac_cv_search_regexec" = "x-lregex"], [ + LIBREGEX_LIB="-lregex" + LIBS_EXTRA="${LIBS_EXTRA} -lregex" + ] + )], + [AC_MSG_ERROR([unable to find the regexec() function])])], + [AC_MSG_ERROR([unable to find the regex.h header]) + ], + [#include ]) +]) +AC_SUBST(LIBREGEX_LIB) AS_IF([test "x$enable_urls" = "xyes"], [ AC_CHECK_HEADER([fetch.h], [ @@ -114,6 +130,29 @@ AS_IF([test "x$enable_urls" = "xyes"], [ AC_SUBST(LIBS_EXTRA) +AC_MSG_CHECKING(for GCC atomic builtins) +AC_LINK_IFELSE([ + AC_LANG_SOURCE([[ + int main() { + volatile unsigned long val = 1; + __sync_synchronize(); + __sync_val_compare_and_swap(&val, 1, 0); + __sync_add_and_fetch(&val, 1); + __sync_sub_and_fetch(&val, 1); + return 0; + } + ]]) +], +[ + AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_ATOMIC_BUILTINS], [1], [Has gcc/MSVC atomic intrinsics]) +], +[ + AC_MSG_RESULT([no]) + AC_DEFINE([HAVE_ATOMIC_BUILTINS], [0], [Has gcc/MSVC atomic intrinsics]) + AC_MSG_WARN([Libucl references could be thread-unsafe because atomic builtins are missing]) +]) + AC_CONFIG_FILES(Makefile \ src/Makefile \ tests/Makefile \ Modified: head/contrib/libucl/doc/api.md ============================================================================== --- head/contrib/libucl/doc/api.md Tue Apr 22 21:57:13 2014 (r264788) +++ head/contrib/libucl/doc/api.md Tue Apr 22 22:02:06 2014 (r264789) @@ -282,7 +282,7 @@ Libucl provides the following functions ### ucl_object_emit ~~~C -unsigned char *ucl_object_emit (ucl_object_t *obj, enum ucl_emitter emit_type); +unsigned char *ucl_object_emit (const ucl_object_t *obj, enum ucl_emitter emit_type); ~~~ Allocate a string that is suitable to fit the underlying UCL object `obj` and fill it with the textual representation of the object `obj` according to style `emit_type`. The caller should free the returned string after using. @@ -290,7 +290,7 @@ Allocate a string that is suitable to fi ### ucl_object_emit_full ~~~C -bool ucl_object_emit_full (ucl_object_t *obj, enum ucl_emitter emit_type, +bool ucl_object_emit_full (const ucl_object_t *obj, enum ucl_emitter emit_type, struct ucl_emitter_functions *emitter); ~~~ @@ -381,7 +381,7 @@ Iteration are used to iterate over UCL c ## ucl_iterate_object ~~~C -ucl_object_t* ucl_iterate_object (ucl_object_t *obj, +const ucl_object_t* ucl_iterate_object (const ucl_object_t *obj, ucl_object_iter_t *iter, bool expand_values); ~~~ @@ -389,7 +389,7 @@ This function accept opaque iterator poi ~~~C ucl_object_iter_t it = NULL, it_obj = NULL; -ucl_object_t *cur, *tmp; +const ucl_object_t *cur, *tmp; /* Iterate over the object */ while ((obj = ucl_iterate_object (top, &it, true))) { @@ -408,8 +408,8 @@ Currently, there is only one validation ## ucl_object_validate ~~~C -bool ucl_object_validate (ucl_object_t *schema, - ucl_object_t *obj, struct ucl_schema_error *err); +bool ucl_object_validate (const ucl_object_t *schema, + const ucl_object_t *obj, struct ucl_schema_error *err); ~~~ This function uses ucl object `schema`, that must be valid in terms of `json-schema` draft v4, to validate input object `obj`. If this function returns `true` then validation procedure has been succeed. Otherwise, `false` is returned and `err` is set to a specific value. If caller set `err` to NULL then this function does not set any error just returning `false`. Error is the structure defined as following: Modified: head/contrib/libucl/doc/libucl.3 ============================================================================== --- head/contrib/libucl/doc/libucl.3 Tue Apr 22 21:57:13 2014 (r264788) +++ head/contrib/libucl/doc/libucl.3 Tue Apr 22 22:02:06 2014 (r264789) @@ -6,11 +6,11 @@ \f[B]ucl_parser_add_string\f[], \f[B]ucl_parser_add_file\f[], \f[B]ucl_parser_get_object\f[], \f[B]ucl_parser_get_error\f[], \f[B]ucl_parser_free\f[], \f[B]ucl_pubkey_add\f[], -\f[B]ucl_parser_set_filevars\f[] - universal configuration library +\f[B]ucl_parser_set_filevars\f[] \- universal configuration library parser and utility functions .SH LIBRARY .PP -UCL library (libucl, -lucl) +UCL library (libucl, \-lucl) .SH SYNOPSIS .PP \f[C]#include\ \f[] @@ -32,12 +32,12 @@ In future, this limitation can be remove Convert \f[C]ucl\f[] objects to some textual or binary representation. Currently, libucl supports the following exports: .IP \[bu] 2 -\f[C]JSON\f[] - valid json format (can possibly loose some original +\f[C]JSON\f[] \- valid json format (can possibly loose some original data, such as implicit arrays) .IP \[bu] 2 -\f[C]Config\f[] - human-readable configuration format (losseless) +\f[C]Config\f[] \- human\-readable configuration format (losseless) .IP \[bu] 2 -\f[C]YAML\f[] - embedded yaml format (has the same limitations as +\f[C]YAML\f[] \- embedded yaml format (has the same limitations as \f[C]json\f[] output) .SS Conversion functions .PP @@ -57,7 +57,7 @@ as implicit array or implicit consolidat .SS Validation functions .PP Validation functions are used to validate some object \f[C]obj\f[] using -json-schema compatible object \f[C]schema\f[]. +json\-schema compatible object \f[C]schema\f[]. Both input and schema must be UCL objects to perform validation. .SS Utility functions .PP @@ -76,13 +76,13 @@ struct\ ucl_parser*\ ucl_parser_new\ (in .PP Creates new parser with the specified flags: .IP \[bu] 2 -\f[C]UCL_PARSER_KEY_LOWERCASE\f[] - lowercase keys parsed +\f[C]UCL_PARSER_KEY_LOWERCASE\f[] \- lowercase keys parsed .IP \[bu] 2 -\f[C]UCL_PARSER_ZEROCOPY\f[] - try to use zero-copy mode when reading -files (in zero-copy mode text chunk being parsed without copying strings -so it should exist till any object parsed is used) +\f[C]UCL_PARSER_ZEROCOPY\f[] \- try to use zero\-copy mode when reading +files (in zero\-copy mode text chunk being parsed without copying +strings so it should exist till any object parsed is used) .IP \[bu] 2 -\f[C]UCL_PARSER_NO_TIME\f[] - treat time values as strings without +\f[C]UCL_PARSER_NO_TIME\f[] \- treat time values as strings without parsing them as floats .SS ucl_parser_register_macro .IP @@ -161,7 +161,7 @@ bool\ ucl_parser_add_string\ (struct\ uc .PP This function acts exactly like \f[C]ucl_parser_add_chunk\f[] does but if \f[C]len\f[] argument is zero, then the string \f[C]data\f[] must be -zero-terminated and the actual length is calculated up to \f[C]\\0\f[] +zero\-terminated and the actual length is calculated up to \f[C]\\0\f[] character. .SS ucl_parser_add_file .IP @@ -229,7 +229,7 @@ bool\ ucl_pubkey_add\ (struct\ ucl_parse This function adds a public key from text blob \f[C]key\f[] of length \f[C]len\f[] to the \f[C]parser\f[] object. This public key should be in the \f[C]PEM\f[] format and can be used by -\f[C].includes\f[] macro for checking signatures of files included. +\f[C]\&.includes\f[] macro for checking signatures of files included. \f[C]Openssl\f[] support should be enabled to make this function working. If a key cannot be added (e.g. @@ -247,25 +247,26 @@ bool\ ucl_parser_set_filevars\ (struct\ Add the standard file variables to the \f[C]parser\f[] based on the \f[C]filename\f[] specified: .IP \[bu] 2 -\f[C]$FILENAME\f[] - a filename of \f[C]ucl\f[] input +\f[C]$FILENAME\f[] \- a filename of \f[C]ucl\f[] input .IP \[bu] 2 -\f[C]$CURDIR\f[] - a current directory of the input +\f[C]$CURDIR\f[] \- a current directory of the input .PP -For example, if a \f[C]filename\f[] param is \f[C]../something.conf\f[] -then the variables will have the following values: +For example, if a \f[C]filename\f[] param is +\f[C]\&../something.conf\f[] then the variables will have the following +values: .IP \[bu] 2 -\f[C]$FILENAME\f[] - "../something.conf" +\f[C]$FILENAME\f[] \- "../something.conf" .IP \[bu] 2 -\f[C]$CURDIR\f[] - ".." +\f[C]$CURDIR\f[] \- ".." .PP if \f[C]need_expand\f[] parameter is \f[C]true\f[] then all relative paths are expanded using \f[C]realpath\f[] call. -In this example if \f[C]..\f[] is \f[C]/etc/dir\f[] then variables will -have these values: +In this example if \f[C]\&..\f[] is \f[C]/etc/dir\f[] then variables +will have these values: .IP \[bu] 2 -\f[C]$FILENAME\f[] - "/etc/something.conf" +\f[C]$FILENAME\f[] \- "/etc/something.conf" .IP \[bu] 2 -\f[C]$CURDIR\f[] - "/etc" +\f[C]$CURDIR\f[] \- "/etc" .SS Parser usage example .PP The following example loads, parses and extracts \f[C]ucl\f[] object @@ -283,7 +284,7 @@ FILE\ *in; in\ =\ stdin; parser\ =\ ucl_parser_new\ (0); while\ (!feof\ (in)\ &&\ r\ <\ (int)sizeof\ (inbuf))\ { -\ \ \ \ r\ +=\ fread\ (inbuf\ +\ r,\ 1,\ sizeof\ (inbuf)\ -\ r,\ in); +\ \ \ \ r\ +=\ fread\ (inbuf\ +\ r,\ 1,\ sizeof\ (inbuf)\ \-\ r,\ in); } ucl_parser_add_chunk\ (parser,\ inbuf,\ r); fclose\ (in); @@ -309,20 +310,20 @@ return\ ret; .PP Libucl can transform UCL objects to a number of tectual formats: .IP \[bu] 2 -configuration (\f[C]UCL_EMIT_CONFIG\f[]) - nginx like human readable +configuration (\f[C]UCL_EMIT_CONFIG\f[]) \- nginx like human readable configuration file where implicit arrays are transformed to the duplicate keys .IP \[bu] 2 -compact json: \f[C]UCL_EMIT_JSON_COMPACT\f[] - single line valid json +compact json: \f[C]UCL_EMIT_JSON_COMPACT\f[] \- single line valid json without spaces .IP \[bu] 2 -formatted json: \f[C]UCL_EMIT_JSON\f[] - pretty formatted JSON with +formatted json: \f[C]UCL_EMIT_JSON\f[] \- pretty formatted JSON with newlines and spaces .IP \[bu] 2 -compact yaml: \f[C]UCL_EMIT_YAML\f[] - compact YAML output +compact yaml: \f[C]UCL_EMIT_YAML\f[] \- compact YAML output .PP Moreover, libucl API allows to select a custom set of emitting functions -allowing efficent and zero-copy output of libucl objects. +allowing efficent and zero\-copy output of libucl objects. Libucl uses the following structure to support this feature: .IP .nf @@ -344,17 +345,17 @@ struct\ ucl_emitter_functions\ { .PP This structure defines the following callbacks: .IP \[bu] 2 -\f[C]ucl_emitter_append_character\f[] - a function that is called to +\f[C]ucl_emitter_append_character\f[] \- a function that is called to append \f[C]nchars\f[] characters equal to \f[C]c\f[] .IP \[bu] 2 -\f[C]ucl_emitter_append_len\f[] - used to append a string of length +\f[C]ucl_emitter_append_len\f[] \- used to append a string of length \f[C]len\f[] starting from pointer \f[C]str\f[] .IP \[bu] 2 -\f[C]ucl_emitter_append_int\f[] - this function applies to integer +\f[C]ucl_emitter_append_int\f[] \- this function applies to integer numbers .IP \[bu] 2 -\f[C]ucl_emitter_append_double\f[] - this function is intended to output -floating point variable +\f[C]ucl_emitter_append_double\f[] \- this function is intended to +output floating point variable .PP The set of these functions could be used to output text formats of \f[C]UCL\f[] objects to different structures or streams. @@ -364,7 +365,7 @@ Libucl provides the following functions .IP .nf \f[C] -unsigned\ char\ *ucl_object_emit\ (ucl_object_t\ *obj,\ enum\ ucl_emitter\ emit_type); +unsigned\ char\ *ucl_object_emit\ (const\ ucl_object_t\ *obj,\ enum\ ucl_emitter\ emit_type); \f[] .fi .PP @@ -376,7 +377,7 @@ The caller should free the returned stri .IP .nf \f[C] -bool\ ucl_object_emit_full\ (ucl_object_t\ *obj,\ enum\ ucl_emitter\ emit_type, +bool\ ucl_object_emit_full\ (const\ ucl_object_t\ *obj,\ enum\ ucl_emitter\ emit_type, \ \ \ \ \ \ \ \ struct\ ucl_emitter_functions\ *emitter); \f[] .fi @@ -400,26 +401,26 @@ cannot be converted then some reasonable strings and 0 for numbers) .PP Also there is a single \f[C]ucl_object_tostring_forced\f[] function that -converts any UCL object (including compound types - arrays and objects) +converts any UCL object (including compound types \- arrays and objects) to a string representation. For compound and numeric types this function performs emitting to a compact json format actually. .PP Here is a list of all conversion functions: .IP \[bu] 2 -\f[C]ucl_object_toint\f[] - returns \f[C]int64_t\f[] of UCL object +\f[C]ucl_object_toint\f[] \- returns \f[C]int64_t\f[] of UCL object .IP \[bu] 2 -\f[C]ucl_object_todouble\f[] - returns \f[C]double\f[] of UCL object +\f[C]ucl_object_todouble\f[] \- returns \f[C]double\f[] of UCL object .IP \[bu] 2 -\f[C]ucl_object_toboolean\f[] - returns \f[C]bool\f[] of UCL object +\f[C]ucl_object_toboolean\f[] \- returns \f[C]bool\f[] of UCL object .IP \[bu] 2 -\f[C]ucl_object_tostring\f[] - returns \f[C]const\ char\ *\f[] of UCL +\f[C]ucl_object_tostring\f[] \- returns \f[C]const\ char\ *\f[] of UCL object (this string is NULL terminated) .IP \[bu] 2 -\f[C]ucl_object_tolstring\f[] - returns \f[C]const\ char\ *\f[] and +\f[C]ucl_object_tolstring\f[] \- returns \f[C]const\ char\ *\f[] and \f[C]size_t\f[] len of UCL object (string can be not NULL terminated) .IP \[bu] 2 -\f[C]ucl_object_tostring_forced\f[] - returns string representation of +\f[C]ucl_object_tostring_forced\f[] \- returns string representation of any UCL object .PP Strings returned by these pointers are associated with the UCL object @@ -448,26 +449,28 @@ ucl_object_t\ *\ ucl_object_typed_new\ ( \f[] .fi .PP -Create an object of a specified type: - \f[C]UCL_OBJECT\f[] - UCL object -- key/value pairs - \f[C]UCL_ARRAY\f[] - UCL array - \f[C]UCL_INT\f[] - -integer number - \f[C]UCL_FLOAT\f[] - floating point number - -\f[C]UCL_STRING\f[] - NULL terminated string - \f[C]UCL_BOOLEAN\f[] - -boolean value - \f[C]UCL_TIME\f[] - time value (floating point number of -seconds) - \f[C]UCL_USERDATA\f[] - opaque userdata pointer (may be used -in macros) - \f[C]UCL_NULL\f[] - null value +Create an object of a specified type: \- \f[C]UCL_OBJECT\f[] \- UCL +object \- key/value pairs \- \f[C]UCL_ARRAY\f[] \- UCL array \- +\f[C]UCL_INT\f[] \- integer number \- \f[C]UCL_FLOAT\f[] \- floating +point number \- \f[C]UCL_STRING\f[] \- NULL terminated string \- +\f[C]UCL_BOOLEAN\f[] \- boolean value \- \f[C]UCL_TIME\f[] \- time value +(floating point number of seconds) \- \f[C]UCL_USERDATA\f[] \- opaque +userdata pointer (may be used in macros) \- \f[C]UCL_NULL\f[] \- null +value .PP This object should be released by caller. .SS Primitive objects generation .PP Libucl provides the functions similar to inverse conversion functions -called with the specific C type: - \f[C]ucl_object_fromint\f[] - -converts \f[C]int64_t\f[] to UCL object - \f[C]ucl_object_fromdouble\f[] -- converts \f[C]double\f[] to UCL object - -\f[C]ucl_object_fromboolean\f[] - converts \f[C]bool\f[] to UCL object - -\f[C]ucl_object_fromstring\f[] - converts \f[C]const\ char\ *\f[] to UCL -object (this string is NULL terminated) - -\f[C]ucl_object_fromlstring\f[] - converts \f[C]const\ char\ *\f[] and -\f[C]size_t\f[] len to UCL object (string can be not NULL terminated) +called with the specific C type: \- \f[C]ucl_object_fromint\f[] \- +converts \f[C]int64_t\f[] to UCL object \- +\f[C]ucl_object_fromdouble\f[] \- converts \f[C]double\f[] to UCL object +\- \f[C]ucl_object_fromboolean\f[] \- converts \f[C]bool\f[] to UCL +object \- \f[C]ucl_object_fromstring\f[] \- converts +\f[C]const\ char\ *\f[] to UCL object (this string is NULL terminated) +\- \f[C]ucl_object_fromlstring\f[] \- converts \f[C]const\ char\ *\f[] +and \f[C]size_t\f[] len to UCL object (string can be not NULL +terminated) .PP Also there is a function to generate UCL object from a string performing various parsing or conversion operations called @@ -484,35 +487,35 @@ ucl_object_t\ *\ ucl_object_fromstring_c This function is used to convert a string \f[C]str\f[] of size \f[C]len\f[] to an UCL objects applying \f[C]flags\f[] conversions. If \f[C]len\f[] is equal to zero then a \f[C]str\f[] is assumed as -NULL-terminated. +NULL\-terminated. This function supports the following flags (a set of flags can be specified using logical \f[C]OR\f[] operation): .IP \[bu] 2 -\f[C]UCL_STRING_ESCAPE\f[] - perform JSON escape +\f[C]UCL_STRING_ESCAPE\f[] \- perform JSON escape .IP \[bu] 2 -\f[C]UCL_STRING_TRIM\f[] - trim leading and trailing whitespaces +\f[C]UCL_STRING_TRIM\f[] \- trim leading and trailing whitespaces .IP \[bu] 2 -\f[C]UCL_STRING_PARSE_BOOLEAN\f[] - parse passed string and detect +\f[C]UCL_STRING_PARSE_BOOLEAN\f[] \- parse passed string and detect boolean .IP \[bu] 2 -\f[C]UCL_STRING_PARSE_INT\f[] - parse passed string and detect integer +\f[C]UCL_STRING_PARSE_INT\f[] \- parse passed string and detect integer number .IP \[bu] 2 -\f[C]UCL_STRING_PARSE_DOUBLE\f[] - parse passed string and detect +\f[C]UCL_STRING_PARSE_DOUBLE\f[] \- parse passed string and detect integer or float number .IP \[bu] 2 -\f[C]UCL_STRING_PARSE_TIME\f[] - parse time values as floating point +\f[C]UCL_STRING_PARSE_TIME\f[] \- parse time values as floating point numbers .IP \[bu] 2 -\f[C]UCL_STRING_PARSE_NUMBER\f[] - parse passed string and detect number -(both float, integer and time types) +\f[C]UCL_STRING_PARSE_NUMBER\f[] \- parse passed string and detect +number (both float, integer and time types) .IP \[bu] 2 -\f[C]UCL_STRING_PARSE\f[] - parse passed string (and detect booleans, +\f[C]UCL_STRING_PARSE\f[] \- parse passed string (and detect booleans, numbers and time values) .IP \[bu] 2 -\f[C]UCL_STRING_PARSE_BYTES\f[] - assume that numeric multipliers are in -bytes notation, for example \f[C]10k\f[] means \f[C]10*1024\f[] and not -\f[C]10*1000\f[] as assumed without this flag +\f[C]UCL_STRING_PARSE_BYTES\f[] \- assume that numeric multipliers are +in bytes notation, for example \f[C]10k\f[] means \f[C]10*1024\f[] and +not \f[C]10*1000\f[] as assumed without this flag .PP If parsing operations fail then the resulting UCL object will be a \f[C]UCL_STRING\f[]. @@ -530,7 +533,7 @@ is a function \f[C]ucl_iterate_object\f[ .IP .nf \f[C] -ucl_object_t*\ ucl_iterate_object\ (ucl_object_t\ *obj,\ +const\ ucl_object_t*\ ucl_iterate_object\ (const\ ucl_object_t\ *obj,\ \ \ \ \ ucl_object_iter_t\ *iter,\ bool\ expand_values); \f[] .fi @@ -561,7 +564,7 @@ Here is an example of iteration over the .nf \f[C] ucl_object_iter_t\ it\ =\ NULL,\ it_obj\ =\ NULL; -ucl_object_t\ *cur,\ *tmp; +const\ ucl_object_t\ *cur,\ *tmp; /*\ Iterate\ over\ the\ object\ */ while\ ((obj\ =\ ucl_iterate_object\ (top,\ &it,\ true)))\ { @@ -584,13 +587,13 @@ This function is defined as following: .IP .nf \f[C] -bool\ ucl_object_validate\ (ucl_object_t\ *schema, -\ \ \ \ ucl_object_t\ *obj,\ struct\ ucl_schema_error\ *err); +bool\ ucl_object_validate\ (const\ ucl_object_t\ *schema, +\ \ \ \ const\ ucl_object_t\ *obj,\ struct\ ucl_schema_error\ *err); \f[] .fi .PP This function uses ucl object \f[C]schema\f[], that must be valid in -terms of \f[C]json-schema\f[] draft v4, to validate input object +terms of \f[C]json\-schema\f[] draft v4, to validate input object \f[C]obj\f[]. If this function returns \f[C]true\f[] then validation procedure has been succeed. Modified: head/contrib/libucl/include/ucl.h ============================================================================== --- head/contrib/libucl/include/ucl.h Tue Apr 22 21:57:13 2014 (r264788) +++ head/contrib/libucl/include/ucl.h Tue Apr 22 22:02:06 2014 (r264789) @@ -81,6 +81,14 @@ extern "C" { #define UCL_WARN_UNUSED_RESULT #endif +#ifdef __GNUC__ +#define UCL_DEPRECATED(func) func __attribute__ ((deprecated)) +#elif defined(_MSC_VER) +#define UCL_DEPRECATED(func) __declspec(deprecated) func +#else +#define UCL_DEPRECATED(func) func +#endif + /** * @defgroup structures Structures and types * UCL defines several enumeration types used for error reporting or specifying flags and attributes. @@ -208,14 +216,14 @@ typedef struct ucl_object_s { * @param obj CL object * @return zero terminated key */ -UCL_EXTERN char* ucl_copy_key_trash (ucl_object_t *obj); +UCL_EXTERN char* ucl_copy_key_trash (const ucl_object_t *obj); /** * Copy and return a string value of an object, returned key is zero-terminated * @param obj CL object * @return zero terminated string representation of object value */ -UCL_EXTERN char* ucl_copy_value_trash (ucl_object_t *obj); +UCL_EXTERN char* ucl_copy_value_trash (const ucl_object_t *obj); /** * Creates a new object @@ -245,7 +253,7 @@ UCL_EXTERN ucl_object_t * ucl_object_fro * @param str NULL terminated string, will be json escaped * @return new object */ -UCL_EXTERN ucl_object_t *ucl_object_fromstring (const char *str); +UCL_EXTERN ucl_object_t *ucl_object_fromstring (const char *str) UCL_WARN_UNUSED_RESULT; /** * Create a UCL object from the specified string @@ -253,28 +261,29 @@ UCL_EXTERN ucl_object_t *ucl_object_from * @param len length of a string * @return new object */ -UCL_EXTERN ucl_object_t *ucl_object_fromlstring (const char *str, size_t len); +UCL_EXTERN ucl_object_t *ucl_object_fromlstring (const char *str, + size_t len) UCL_WARN_UNUSED_RESULT; /** * Create an object from an integer number * @param iv number * @return new object */ -UCL_EXTERN ucl_object_t* ucl_object_fromint (int64_t iv); +UCL_EXTERN ucl_object_t* ucl_object_fromint (int64_t iv) UCL_WARN_UNUSED_RESULT; /** * Create an object from a float number * @param dv number * @return new object */ -UCL_EXTERN ucl_object_t* ucl_object_fromdouble (double dv); +UCL_EXTERN ucl_object_t* ucl_object_fromdouble (double dv) UCL_WARN_UNUSED_RESULT; /** * Create an object from a boolean * @param bv bool value * @return new object */ -UCL_EXTERN ucl_object_t* ucl_object_frombool (bool bv); +UCL_EXTERN ucl_object_t* ucl_object_frombool (bool bv) UCL_WARN_UNUSED_RESULT; /** * Insert a object 'elt' to the hash 'top' and associate it with key 'key' @@ -283,10 +292,10 @@ UCL_EXTERN ucl_object_t* ucl_object_from * @param key key to associate with this object (either const or preallocated) * @param keylen length of the key (or 0 for NULL terminated keys) * @param copy_key make an internal copy of key - * @return new value of top object + * @return true if key has been inserted */ -UCL_EXTERN ucl_object_t* ucl_object_insert_key (ucl_object_t *top, ucl_object_t *elt, - const char *key, size_t keylen, bool copy_key) UCL_WARN_UNUSED_RESULT; +UCL_EXTERN bool ucl_object_insert_key (ucl_object_t *top, ucl_object_t *elt, + const char *key, size_t keylen, bool copy_key); /** * Replace a object 'elt' to the hash 'top' and associate it with key 'key', old object will be unrefed, @@ -296,10 +305,10 @@ UCL_EXTERN ucl_object_t* ucl_object_inse * @param key key to associate with this object (either const or preallocated) * @param keylen length of the key (or 0 for NULL terminated keys) * @param copy_key make an internal copy of key - * @return new value of top object + * @return true if key has been inserted */ -UCL_EXTERN ucl_object_t* ucl_object_replace_key (ucl_object_t *top, ucl_object_t *elt, - const char *key, size_t keylen, bool copy_key) UCL_WARN_UNUSED_RESULT; +UCL_EXTERN bool ucl_object_replace_key (ucl_object_t *top, ucl_object_t *elt, + const char *key, size_t keylen, bool copy_key); /** * Delete a object associated with key 'key', old object will be unrefered, @@ -307,14 +316,16 @@ UCL_EXTERN ucl_object_t* ucl_object_repl * @param key key associated to the object to remove * @param keylen length of the key (or 0 for NULL terminated keys) */ -UCL_EXTERN bool ucl_object_delete_keyl (ucl_object_t *top, const char *key, size_t keylen); +UCL_EXTERN bool ucl_object_delete_keyl (ucl_object_t *top, + const char *key, size_t keylen); /** * Delete a object associated with key 'key', old object will be unrefered, * @param top object * @param key key associated to the object to remove */ -UCL_EXTERN bool ucl_object_delete_key (ucl_object_t *top, const char *key); +UCL_EXTERN bool ucl_object_delete_key (ucl_object_t *top, + const char *key); /** @@ -346,28 +357,28 @@ UCL_EXTERN ucl_object_t* ucl_object_pop_ * @param key key to associate with this object (either const or preallocated) * @param keylen length of the key (or 0 for NULL terminated keys) * @param copy_key make an internal copy of key - * @return new value of top object + * @return true if key has been inserted */ -UCL_EXTERN ucl_object_t* ucl_object_insert_key_merged (ucl_object_t *top, ucl_object_t *elt, - const char *key, size_t keylen, bool copy_key) UCL_WARN_UNUSED_RESULT; +UCL_EXTERN bool ucl_object_insert_key_merged (ucl_object_t *top, ucl_object_t *elt, + const char *key, size_t keylen, bool copy_key); /** * Append an element to the front of array object * @param top destination object (will be created automatically if top is NULL) * @param elt element to append (must NOT be NULL) - * @return new value of top object + * @return true if value has been inserted */ -UCL_EXTERN ucl_object_t* ucl_array_append (ucl_object_t *top, - ucl_object_t *elt) UCL_WARN_UNUSED_RESULT; +UCL_EXTERN bool ucl_array_append (ucl_object_t *top, + ucl_object_t *elt); /** * Append an element to the start of array object * @param top destination object (will be created automatically if top is NULL) * @param elt element to append (must NOT be NULL) - * @return new value of top object + * @return true if value has been inserted */ -UCL_EXTERN ucl_object_t* ucl_array_prepend (ucl_object_t *top, - ucl_object_t *elt) UCL_WARN_UNUSED_RESULT; +UCL_EXTERN bool ucl_array_prepend (ucl_object_t *top, + ucl_object_t *elt); /** * Removes an element `elt` from the array `top`. Caller must unref the returned object when it is not @@ -376,21 +387,22 @@ UCL_EXTERN ucl_object_t* ucl_array_prepe * @param elt element to remove * @return removed element or NULL if `top` is NULL or not an array */ -UCL_EXTERN ucl_object_t* ucl_array_delete (ucl_object_t *top, ucl_object_t *elt); +UCL_EXTERN ucl_object_t* ucl_array_delete (ucl_object_t *top, + ucl_object_t *elt); /** * Returns the first element of the array `top` * @param top array ucl object * @return element or NULL if `top` is NULL or not an array */ -UCL_EXTERN ucl_object_t* ucl_array_head (ucl_object_t *top); +UCL_EXTERN const ucl_object_t* ucl_array_head (const ucl_object_t *top); /** * Returns the last element of the array `top` * @param top array ucl object * @return element or NULL if `top` is NULL or not an array */ -UCL_EXTERN ucl_object_t* ucl_array_tail (ucl_object_t *top); +UCL_EXTERN const ucl_object_t* ucl_array_tail (const ucl_object_t *top); /** * Removes the last element from the array `top`. Caller must unref the returned object when it is not @@ -412,10 +424,10 @@ UCL_EXTERN ucl_object_t* ucl_array_pop_f * Append a element to another element forming an implicit array * @param head head to append (may be NULL) * @param elt new element - * @return new head if applicable + * @return true if element has been inserted */ -UCL_EXTERN ucl_object_t* ucl_elt_append (ucl_object_t *head, - ucl_object_t *elt) UCL_WARN_UNUSED_RESULT; +UCL_EXTERN ucl_object_t * ucl_elt_append (ucl_object_t *head, + ucl_object_t *elt); /** * Converts an object to double value @@ -423,14 +435,14 @@ UCL_EXTERN ucl_object_t* ucl_elt_append * @param target target double variable * @return true if conversion was successful */ -UCL_EXTERN bool ucl_object_todouble_safe (ucl_object_t *obj, double *target); +UCL_EXTERN bool ucl_object_todouble_safe (const ucl_object_t *obj, double *target); /** * Unsafe version of \ref ucl_obj_todouble_safe * @param obj CL object * @return double value */ -UCL_EXTERN double ucl_object_todouble (ucl_object_t *obj); +UCL_EXTERN double ucl_object_todouble (const ucl_object_t *obj); /** * Converts an object to integer value @@ -438,14 +450,14 @@ UCL_EXTERN double ucl_object_todouble (u * @param target target integer variable * @return true if conversion was successful */ -UCL_EXTERN bool ucl_object_toint_safe (ucl_object_t *obj, int64_t *target); +UCL_EXTERN bool ucl_object_toint_safe (const ucl_object_t *obj, int64_t *target); /** * Unsafe version of \ref ucl_obj_toint_safe * @param obj CL object * @return int value */ -UCL_EXTERN int64_t ucl_object_toint (ucl_object_t *obj); +UCL_EXTERN int64_t ucl_object_toint (const ucl_object_t *obj); /** * Converts an object to boolean value @@ -453,14 +465,14 @@ UCL_EXTERN int64_t ucl_object_toint (ucl * @param target target boolean variable * @return true if conversion was successful */ -UCL_EXTERN bool ucl_object_toboolean_safe (ucl_object_t *obj, bool *target); +UCL_EXTERN bool ucl_object_toboolean_safe (const ucl_object_t *obj, bool *target); /** * Unsafe version of \ref ucl_obj_toboolean_safe * @param obj CL object * @return boolean value */ -UCL_EXTERN bool ucl_object_toboolean (ucl_object_t *obj); +UCL_EXTERN bool ucl_object_toboolean (const ucl_object_t *obj); /** * Converts an object to string value @@ -468,21 +480,21 @@ UCL_EXTERN bool ucl_object_toboolean (uc * @param target target string variable, no need to free value * @return true if conversion was successful */ -UCL_EXTERN bool ucl_object_tostring_safe (ucl_object_t *obj, const char **target); +UCL_EXTERN bool ucl_object_tostring_safe (const ucl_object_t *obj, const char **target); /** * Unsafe version of \ref ucl_obj_tostring_safe * @param obj CL object * @return string value */ -UCL_EXTERN const char* ucl_object_tostring (ucl_object_t *obj); +UCL_EXTERN const char* ucl_object_tostring (const ucl_object_t *obj); /** * Convert any object to a string in JSON notation if needed * @param obj CL object * @return string value */ -UCL_EXTERN const char* ucl_object_tostring_forced (ucl_object_t *obj); +UCL_EXTERN const char* ucl_object_tostring_forced (const ucl_object_t *obj); /** * Return string as char * and len, string may be not zero terminated, more efficient that \ref ucl_obj_tostring as it @@ -492,7 +504,7 @@ UCL_EXTERN const char* ucl_object_tostri * @param tlen target length * @return true if conversion was successful */ -UCL_EXTERN bool ucl_object_tolstring_safe (ucl_object_t *obj, +UCL_EXTERN bool ucl_object_tolstring_safe (const ucl_object_t *obj, const char **target, size_t *tlen); /** @@ -500,7 +512,7 @@ UCL_EXTERN bool ucl_object_tolstring_saf * @param obj CL object * @return string value */ -UCL_EXTERN const char* ucl_object_tolstring (ucl_object_t *obj, size_t *tlen); +UCL_EXTERN const char* ucl_object_tolstring (const ucl_object_t *obj, size_t *tlen); /** * Return object identified by a key in the specified object @@ -508,7 +520,8 @@ UCL_EXTERN const char* ucl_object_tolstr * @param key key to search * @return object matched the specified key or NULL if key is not found */ -UCL_EXTERN ucl_object_t* ucl_object_find_key (ucl_object_t *obj, const char *key); +UCL_EXTERN const ucl_object_t* ucl_object_find_key (const ucl_object_t *obj, + const char *key); /** * Return object identified by a fixed size key in the specified object @@ -517,14 +530,15 @@ UCL_EXTERN ucl_object_t* ucl_object_find * @param klen length of a key * @return object matched the specified key or NULL if key is not found */ -UCL_EXTERN ucl_object_t* ucl_object_find_keyl (ucl_object_t *obj, const char *key, size_t klen); +UCL_EXTERN const ucl_object_t* ucl_object_find_keyl (const ucl_object_t *obj, + const char *key, size_t klen); /** * Returns a key of an object as a NULL terminated string * @param obj CL object * @return key or NULL if there is no key */ -UCL_EXTERN const char* ucl_object_key (ucl_object_t *obj); +UCL_EXTERN const char* ucl_object_key (const ucl_object_t *obj); /** * Returns a key of an object as a fixed size string (may be more efficient) @@ -532,19 +546,19 @@ UCL_EXTERN const char* ucl_object_key (u * @param len target key length * @return key pointer */ -UCL_EXTERN const char* ucl_object_keyl (ucl_object_t *obj, size_t *len); +UCL_EXTERN const char* ucl_object_keyl (const ucl_object_t *obj, size_t *len); /** - * Free ucl object - * @param obj ucl object to free + * Increase reference count for an object + * @param obj object to ref */ -UCL_EXTERN void ucl_object_free (ucl_object_t *obj); +UCL_EXTERN ucl_object_t* ucl_object_ref (const ucl_object_t *obj); /** - * Increase reference count for an object - * @param obj object to ref + * Free ucl object + * @param obj ucl object to free */ -UCL_EXTERN ucl_object_t* ucl_object_ref (ucl_object_t *obj); +UCL_DEPRECATED(UCL_EXTERN void ucl_object_free (ucl_object_t *obj)); /** * Decrease reference count for an object @@ -562,7 +576,8 @@ UCL_EXTERN void ucl_object_unref (ucl_ob * 2) Size of objects * 3) Content of objects */ -UCL_EXTERN int ucl_object_compare (ucl_object_t *o1, ucl_object_t *o2); +UCL_EXTERN int ucl_object_compare (const ucl_object_t *o1, + const ucl_object_t *o2); /** * Sort UCL array using `cmp` compare function @@ -570,7 +585,7 @@ UCL_EXTERN int ucl_object_compare (ucl_o * @param cmp */ UCL_EXTERN void ucl_object_array_sort (ucl_object_t *ar, - int (*cmp)(ucl_object_t *o1, ucl_object_t *o2)); + int (*cmp)(const ucl_object_t *o1, const ucl_object_t *o2)); /** * Opaque iterator object @@ -585,7 +600,8 @@ typedef void* ucl_object_iter_t; * while ((cur = ucl_iterate_object (obj, &it)) != NULL) ... * @return the next object or NULL */ -UCL_EXTERN ucl_object_t* ucl_iterate_object (ucl_object_t *obj, ucl_object_iter_t *iter, bool expand_values); +UCL_EXTERN const ucl_object_t* ucl_iterate_object (const ucl_object_t *obj, + ucl_object_iter_t *iter, bool expand_values); /** @} */ @@ -663,10 +679,21 @@ UCL_EXTERN bool ucl_parser_add_string (s * @param err if *err is NULL it is set to parser error * @return true if chunk has been added and false in case of error */ -UCL_EXTERN bool ucl_parser_add_file (struct ucl_parser *parser, const char *filename); +UCL_EXTERN bool ucl_parser_add_file (struct ucl_parser *parser, + const char *filename); + +/** + * Load and add data from a file descriptor + * @param parser parser structure + * @param filename the name of file + * @param err if *err is NULL it is set to parser error + * @return true if chunk has been added and false in case of error + */ +UCL_EXTERN bool ucl_parser_add_fd (struct ucl_parser *parser, + int fd); /** - * Get a top object for a parser + * Get a top object for a parser (refcount is increased) * @param parser parser structure * @param err if *err is NULL it is set to parser error * @return top parser object or NULL @@ -736,7 +763,8 @@ struct ucl_emitter_functions { * #UCL_EMIT_CONFIG then emit config like object * @return dump of an object (must be freed after using) or NULL in case of error */ -UCL_EXTERN unsigned char *ucl_object_emit (ucl_object_t *obj, enum ucl_emitter emit_type); +UCL_EXTERN unsigned char *ucl_object_emit (const ucl_object_t *obj, + enum ucl_emitter emit_type); /** * Emit object to a string @@ -745,7 +773,8 @@ UCL_EXTERN unsigned char *ucl_object_emi * #UCL_EMIT_CONFIG then emit config like object * @return dump of an object (must be freed after using) or NULL in case of error */ -UCL_EXTERN bool ucl_object_emit_full (ucl_object_t *obj, enum ucl_emitter emit_type, +UCL_EXTERN bool ucl_object_emit_full (const ucl_object_t *obj, + enum ucl_emitter emit_type, struct ucl_emitter_functions *emitter); /** @} */ @@ -775,7 +804,7 @@ enum ucl_schema_error_code { struct ucl_schema_error { enum ucl_schema_error_code code; /**< error code */ char msg[128]; /**< error message */ - ucl_object_t *obj; /**< object where error occured */ + const ucl_object_t *obj; /**< object where error occured */ }; /** @@ -786,8 +815,8 @@ struct ucl_schema_error { * occured, then `err` is filled with the exact error definition. * @return true if `obj` is valid using `schema` */ -UCL_EXTERN bool ucl_object_validate (ucl_object_t *schema, - ucl_object_t *obj, struct ucl_schema_error *err); +UCL_EXTERN bool ucl_object_validate (const ucl_object_t *schema, + const ucl_object_t *obj, struct ucl_schema_error *err); /** @} */ Modified: head/contrib/libucl/src/Makefile.am ============================================================================== --- head/contrib/libucl/src/Makefile.am Tue Apr 22 21:57:13 2014 (r264788) +++ head/contrib/libucl/src/Makefile.am Tue Apr 22 22:02:06 2014 (r264789) @@ -13,6 +13,8 @@ libucl_la_CFLAGS= $(libucl_common_cflags @CURL_CFLAGS@ libucl_la_LDFLAGS = -version-info @SO_VERSION@ libucl_la_LIBADD= @LIBFETCH_LIBS@ \ + @LIBCRYPTO_LIB@ \ + @LIBREGEX_LIB@ \ @CURL_LIBS@ include_HEADERS= $(top_srcdir)/include/ucl.h Modified: head/contrib/libucl/src/ucl_emitter.c ============================================================================== --- head/contrib/libucl/src/ucl_emitter.c Tue Apr 22 21:57:13 2014 (r264788) +++ head/contrib/libucl/src/ucl_emitter.c Tue Apr 22 22:02:06 2014 (r264789) @@ -41,29 +41,29 @@ */ -static void ucl_obj_write_json (ucl_object_t *obj, +static void ucl_obj_write_json (const ucl_object_t *obj, struct ucl_emitter_functions *func, unsigned int tabs, bool start_tabs, bool compact); -static void ucl_elt_write_json (ucl_object_t *obj, +static void ucl_elt_write_json (const ucl_object_t *obj, struct ucl_emitter_functions *func, unsigned int tabs, bool start_tabs, bool compact); -static void ucl_elt_write_config (ucl_object_t *obj, +static void ucl_elt_write_config (const ucl_object_t *obj, struct ucl_emitter_functions *func, unsigned int tabs, bool start_tabs, bool is_top, bool expand_array); -static void ucl_elt_write_yaml (ucl_object_t *obj, +static void ucl_elt_write_yaml (const ucl_object_t *obj, struct ucl_emitter_functions *func, unsigned int tabs, bool start_tabs, bool compact, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 01:47:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DDCC945; Wed, 23 Apr 2014 01:47:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEFFD178F; Wed, 23 Apr 2014 01:47:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3N1l7aT049426; Wed, 23 Apr 2014 01:47:07 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3N1l7RI049425; Wed, 23 Apr 2014 01:47:07 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404230147.s3N1l7RI049425@svn.freebsd.org> From: Glen Barber Date: Wed, 23 Apr 2014 01:47:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264793 - head/release/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 01:47:08 -0000 Author: gjb Date: Wed Apr 23 01:47:07 2014 New Revision: 264793 URL: http://svnweb.freebsd.org/changeset/base/264793 Log: Play musical-KNOBS a bit more with release/arm/release.sh. For stable/10, r264703 sets the correct WITH/WITHOUT knobs to get xdev built with the arm-freebsd-gcc binary installed. Unfortunately, the same fix does not work on head/. Also, quite to my amazement, WITH_GCC=1 and WITH_GNUCXX=1 causes xdev to fail spectactularly at least on r264791. The situation as it stands is: - gcc(1) is needed for the u-boot build. - cc(1) *cannot* be clang(1) To shoe-horn the toolchain to make 'xdev' give what is needed, remove WITH_GNUCXX=1 and add WITH_GCC_BOOTSTRAP=1. MFC After: 1 week X-MFC-To: stable/10 only X-MFC-Note: after stable/10 is broken in this way... Sponsored by: The FreeBSD Foundation Modified: head/release/arm/release.sh Modified: head/release/arm/release.sh ============================================================================== --- head/release/arm/release.sh Wed Apr 23 01:27:53 2014 (r264792) +++ head/release/arm/release.sh Wed Apr 23 01:47:07 2014 (r264793) @@ -94,7 +94,7 @@ install_uboot() { main() { # Build the 'xdev' target for crochet. eval chroot ${CHROOTDIR} make -C /usr/src \ - WITH_GCC=1 WITH_GNUCXX=1 WITHOUT_CLANG_IS_CC=1 \ + WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1 \ XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} \ ${WORLD_FLAGS} xdev From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 02:01:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 872EDD8F; Wed, 23 Apr 2014 02:01:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 745B21927; Wed, 23 Apr 2014 02:01:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3N21O28054892; Wed, 23 Apr 2014 02:01:24 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3N21NiE054881; Wed, 23 Apr 2014 02:01:23 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404230201.s3N21NiE054881@svn.freebsd.org> From: Glen Barber Date: Wed, 23 Apr 2014 02:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264794 - head/release/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 02:01:24 -0000 Author: gjb Date: Wed Apr 23 02:01:22 2014 New Revision: 264794 URL: http://svnweb.freebsd.org/changeset/base/264794 Log: Move xdev knobs from release/arm/release.sh and into an XDEV_FLAGS variable in ${KERNCONF}.conf file. MFC after: 3 days X-MFC-Note: fix stable/10 XDEV_FLAGS local for branch Sponsored by: The FreeBSD Foundation Modified: head/release/arm/BEAGLEBONE.conf head/release/arm/PANDABOARD.conf head/release/arm/RPI-B.conf head/release/arm/WANDBOARD-QUAD.conf head/release/arm/ZEDBOARD.conf head/release/arm/release.sh Modified: head/release/arm/BEAGLEBONE.conf ============================================================================== --- head/release/arm/BEAGLEBONE.conf Wed Apr 23 01:47:07 2014 (r264793) +++ head/release/arm/BEAGLEBONE.conf Wed Apr 23 02:01:22 2014 (r264794) @@ -22,6 +22,7 @@ EMBEDDEDBUILD=1 EMBEDDEDPORTS="lang/python textproc/gsed" XDEV="arm" XDEV_ARCH="armv6" +XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" KERNEL="BEAGLEBONE" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" CROCHETBRANCH="trunk" Modified: head/release/arm/PANDABOARD.conf ============================================================================== --- head/release/arm/PANDABOARD.conf Wed Apr 23 01:47:07 2014 (r264793) +++ head/release/arm/PANDABOARD.conf Wed Apr 23 02:01:22 2014 (r264794) @@ -22,6 +22,7 @@ EMBEDDEDBUILD=1 EMBEDDEDPORTS="lang/python textproc/gsed" XDEV="arm" XDEV_ARCH="armv6" +XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" KERNEL="PANDABOARD" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" CROCHETBRANCH="trunk" Modified: head/release/arm/RPI-B.conf ============================================================================== --- head/release/arm/RPI-B.conf Wed Apr 23 01:47:07 2014 (r264793) +++ head/release/arm/RPI-B.conf Wed Apr 23 02:01:22 2014 (r264794) @@ -22,6 +22,7 @@ EMBEDDEDBUILD=1 EMBEDDEDPORTS="lang/python textproc/gsed" XDEV="arm" XDEV_ARCH="armv6" +XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" KERNEL="RPI-B" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" CROCHETBRANCH="trunk" Modified: head/release/arm/WANDBOARD-QUAD.conf ============================================================================== --- head/release/arm/WANDBOARD-QUAD.conf Wed Apr 23 01:47:07 2014 (r264793) +++ head/release/arm/WANDBOARD-QUAD.conf Wed Apr 23 02:01:22 2014 (r264794) @@ -22,6 +22,7 @@ EMBEDDEDBUILD=1 EMBEDDEDPORTS="lang/python textproc/gsed" XDEV="arm" XDEV_ARCH="armv6" +XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" KERNEL="WANDBOARD-QUAD" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" CROCHETBRANCH="trunk" Modified: head/release/arm/ZEDBOARD.conf ============================================================================== --- head/release/arm/ZEDBOARD.conf Wed Apr 23 01:47:07 2014 (r264793) +++ head/release/arm/ZEDBOARD.conf Wed Apr 23 02:01:22 2014 (r264794) @@ -21,6 +21,7 @@ CHROOTDIR="/scratch" EMBEDDEDBUILD=1 XDEV="arm" XDEV_ARCH="armv6" +XDEV_FLAGS="WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1" KERNEL="ZEDBOARD" CROCHETSRC="https://github.com/kientzle/crochet-freebsd" CROCHETBRANCH="trunk" Modified: head/release/arm/release.sh ============================================================================== --- head/release/arm/release.sh Wed Apr 23 01:47:07 2014 (r264793) +++ head/release/arm/release.sh Wed Apr 23 02:01:22 2014 (r264794) @@ -94,8 +94,7 @@ install_uboot() { main() { # Build the 'xdev' target for crochet. eval chroot ${CHROOTDIR} make -C /usr/src \ - WITH_GCC=1 WITH_GCC_BOOTSTRAP=1 WITHOUT_CLANG_IS_CC=1 \ - XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} \ + ${XDEV_FLAGS} XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} \ ${WORLD_FLAGS} xdev # Run the ldconfig(8) startup script so /var/run/ld-elf*.so.hints From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 02:21:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E960E517; Wed, 23 Apr 2014 02:21:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6FA01A60; Wed, 23 Apr 2014 02:21:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3N2LHPC065221; Wed, 23 Apr 2014 02:21:17 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3N2LHj4065220; Wed, 23 Apr 2014 02:21:17 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201404230221.s3N2LHj4065220@svn.freebsd.org> From: Bryan Drewery Date: Wed, 23 Apr 2014 02:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264795 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 02:21:18 -0000 Author: bdrewery Date: Wed Apr 23 02:21:17 2014 New Revision: 264795 URL: http://svnweb.freebsd.org/changeset/base/264795 Log: Fix grammar error and trailing newline. Submitted by: danfe MFC after: 3 days Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Wed Apr 23 02:01:22 2014 (r264794) +++ head/sys/kern/subr_prf.c Wed Apr 23 02:21:17 2014 (r264795) @@ -914,7 +914,7 @@ number: while (percent < fmt) PCHAR(*percent++); /* - * Since we ignore an formatting argument it is no + * Since we ignore a formatting argument it is no * longer safe to obey the remaining formatting * arguments as the arguments will no longer match * the format specs. @@ -1122,4 +1122,3 @@ hexdump(const void *ptr, int length, con printf("\n"); } } - From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 05:02:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A92C5F0 for ; Wed, 23 Apr 2014 05:02:05 +0000 (UTC) Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com [209.85.192.179]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1A051D46 for ; Wed, 23 Apr 2014 05:02:04 +0000 (UTC) Received: by mail-pd0-f179.google.com with SMTP id g10so376227pdj.38 for ; Tue, 22 Apr 2014 22:02:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=X8joVAamCuVjAV2oB/hXdVNnfSztWADFbxp2VDqdm2A=; b=OJm0iKOJA+UeOqyVVg5ojRWE70ezbZa8MKLhlFEfwkifj269r6DYSkgJf+SCSRjG+F ULQbL7jnBkNM65BXvvlx7kbpK6dN/eNBcVEr8Iy183BuyEZEgzUmPZ4LfHW3NZ/RLwaW oUAX11qj5f/7X2lwW0dLiNNkvOXlCY8tQiP8BRV3jn6DYXh/bOEuZDof9ZwdmQei+ZRh HVobjcef+W/QhonE4PiqUh3E41t96wazjfRJhlVtasV3ZcnQ3waPpqNzFsz5hTeLfnPu vY+0eYwmozK6g5cfm2DBTSpQC5q0iDbrdV45rrznPOjDiJmEMDgZut3FlL83r4AsGEX6 QuAQ== X-Gm-Message-State: ALoCoQn8EEcrlFmFQZxRjE2+N6Wq2SEn1xYs3uoI1SH3Obk+eL1IlxukADbWKaGP1PponOq3fN/8 X-Received: by 10.68.201.97 with SMTP id jz1mr50568219pbc.26.1398229324671; Tue, 22 Apr 2014 22:02:04 -0700 (PDT) Received: from [10.0.103.142] ([50.242.69.61]) by mx.google.com with ESMTPSA id nx12sm211649941pab.6.2014.04.22.22.02.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Apr 2014 22:02:04 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264794 - head/release/arm From: Warner Losh In-Reply-To: <201404230201.s3N21NiE054881@svn.freebsd.org> Date: Tue, 22 Apr 2014 22:02:03 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <11A48119-4502-4EE6-A4AF-E726578380DF@gmail.com> References: <201404230201.s3N21NiE054881@svn.freebsd.org> To: Glen Barber X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 05:02:05 -0000 Ditto. This should be backed out and you should make whoever broke this = fix it in head. Warner On Apr 22, 2014, at 7:01 PM, Glen Barber wrote: > Author: gjb > Date: Wed Apr 23 02:01:22 2014 > New Revision: 264794 > URL: http://svnweb.freebsd.org/changeset/base/264794 >=20 > Log: > Move xdev knobs from release/arm/release.sh and into an > XDEV_FLAGS variable in ${KERNCONF}.conf file. >=20 > MFC after: 3 days > X-MFC-Note: fix stable/10 XDEV_FLAGS local for branch > Sponsored by: The FreeBSD Foundation >=20 > Modified: > head/release/arm/BEAGLEBONE.conf > head/release/arm/PANDABOARD.conf > head/release/arm/RPI-B.conf > head/release/arm/WANDBOARD-QUAD.conf > head/release/arm/ZEDBOARD.conf > head/release/arm/release.sh >=20 > Modified: head/release/arm/BEAGLEBONE.conf > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/release/arm/BEAGLEBONE.conf Wed Apr 23 01:47:07 2014 = (r264793) > +++ head/release/arm/BEAGLEBONE.conf Wed Apr 23 02:01:22 2014 = (r264794) > @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 > EMBEDDEDPORTS=3D"lang/python textproc/gsed" > XDEV=3D"arm" > XDEV_ARCH=3D"armv6" > +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 = WITHOUT_CLANG_IS_CC=3D1" > KERNEL=3D"BEAGLEBONE" > CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" > CROCHETBRANCH=3D"trunk" >=20 > Modified: head/release/arm/PANDABOARD.conf > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/release/arm/PANDABOARD.conf Wed Apr 23 01:47:07 2014 = (r264793) > +++ head/release/arm/PANDABOARD.conf Wed Apr 23 02:01:22 2014 = (r264794) > @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 > EMBEDDEDPORTS=3D"lang/python textproc/gsed" > XDEV=3D"arm" > XDEV_ARCH=3D"armv6" > +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 = WITHOUT_CLANG_IS_CC=3D1" > KERNEL=3D"PANDABOARD" > CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" > CROCHETBRANCH=3D"trunk" >=20 > Modified: head/release/arm/RPI-B.conf > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/release/arm/RPI-B.conf Wed Apr 23 01:47:07 2014 = (r264793) > +++ head/release/arm/RPI-B.conf Wed Apr 23 02:01:22 2014 = (r264794) > @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 > EMBEDDEDPORTS=3D"lang/python textproc/gsed" > XDEV=3D"arm" > XDEV_ARCH=3D"armv6" > +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 = WITHOUT_CLANG_IS_CC=3D1" > KERNEL=3D"RPI-B" > CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" > CROCHETBRANCH=3D"trunk" >=20 > Modified: head/release/arm/WANDBOARD-QUAD.conf > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/release/arm/WANDBOARD-QUAD.conf Wed Apr 23 01:47:07 2014 = (r264793) > +++ head/release/arm/WANDBOARD-QUAD.conf Wed Apr 23 02:01:22 2014 = (r264794) > @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 > EMBEDDEDPORTS=3D"lang/python textproc/gsed" > XDEV=3D"arm" > XDEV_ARCH=3D"armv6" > +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 = WITHOUT_CLANG_IS_CC=3D1" > KERNEL=3D"WANDBOARD-QUAD" > CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" > CROCHETBRANCH=3D"trunk" >=20 > Modified: head/release/arm/ZEDBOARD.conf > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/release/arm/ZEDBOARD.conf Wed Apr 23 01:47:07 2014 = (r264793) > +++ head/release/arm/ZEDBOARD.conf Wed Apr 23 02:01:22 2014 = (r264794) > @@ -21,6 +21,7 @@ CHROOTDIR=3D"/scratch" > EMBEDDEDBUILD=3D1 > XDEV=3D"arm" > XDEV_ARCH=3D"armv6" > +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 = WITHOUT_CLANG_IS_CC=3D1" > KERNEL=3D"ZEDBOARD" > CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" > CROCHETBRANCH=3D"trunk" >=20 > Modified: head/release/arm/release.sh > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/release/arm/release.sh Wed Apr 23 01:47:07 2014 = (r264793) > +++ head/release/arm/release.sh Wed Apr 23 02:01:22 2014 = (r264794) > @@ -94,8 +94,7 @@ install_uboot() { > main() { > # Build the 'xdev' target for crochet. > eval chroot ${CHROOTDIR} make -C /usr/src \ > - WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 = WITHOUT_CLANG_IS_CC=3D1 \ > - XDEV=3D${XDEV} XDEV_ARCH=3D${XDEV_ARCH} \ > + ${XDEV_FLAGS} XDEV=3D${XDEV} XDEV_ARCH=3D${XDEV_ARCH} \ > ${WORLD_FLAGS} xdev >=20 > # Run the ldconfig(8) startup script so = /var/run/ld-elf*.so.hints >=20 From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 05:06:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0A26730 for ; Wed, 23 Apr 2014 05:06:36 +0000 (UTC) Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73DEC1D7B for ; Wed, 23 Apr 2014 05:06:36 +0000 (UTC) Received: by mail-pa0-f48.google.com with SMTP id hz1so379512pad.7 for ; Tue, 22 Apr 2014 22:06:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=EkDB9PKk8bg6ubQwK3+KZCom69NsxXLAhuVAd3SrSRs=; b=TpBzs4y+nlAfsUBpop+lBRo8n/mwVmvmJAdG9voxhHif6vyvK9Dv6aiUxqAso0wVlL Kz3KPFDshBv2DC1VFbEcYurZkhr0hJNaTY/dDP/eJ5M69L6EPZ1sqBKesFphNR6CfyIS GhaAzztbh6oF0L2PlC/MHBuEksYuFDX3dGtrKNyjtfsHkuH0AFSaXCZaA1FyY0YS1uvl C4cOFBvAMqr+uamcS/h5fkRygK2929ffts/BcM7jc9AtX0BlUD1hN1d8GOEY3yU98myE ibe3T5rohqXW9D7rlNbs+lW2rKJB4d8GPWUNjX1oUela3dEi+I3plLBMfdgSCxSG+/Lt esRQ== X-Gm-Message-State: ALoCoQmDIBxR3V1le0orGhvVBTaVAdgZBWBJVffTFgdF9VBT1/qkN1wOt4QecV/8zinLGdSVdnDC X-Received: by 10.68.130.137 with SMTP id oe9mr50032515pbb.21.1398229290548; Tue, 22 Apr 2014 22:01:30 -0700 (PDT) Received: from [10.0.103.142] ([50.242.69.61]) by mx.google.com with ESMTPSA id nx12sm211649941pab.6.2014.04.22.22.01.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Apr 2014 22:01:29 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264793 - head/release/arm From: Warner Losh In-Reply-To: <201404230147.s3N1l7RI049425@svn.freebsd.org> Date: Tue, 22 Apr 2014 22:01:27 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <501CF539-F6EC-489F-B114-390A45FDEF64@gmail.com> References: <201404230147.s3N1l7RI049425@svn.freebsd.org> To: Glen Barber X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 05:06:36 -0000 On Apr 22, 2014, at 6:47 PM, Glen Barber wrote: > Author: gjb > Date: Wed Apr 23 01:47:07 2014 > New Revision: 264793 > URL: http://svnweb.freebsd.org/changeset/base/264793 >=20 > Log: > Play musical-KNOBS a bit more with release/arm/release.sh. >=20 > For stable/10, r264703 sets the correct WITH/WITHOUT > knobs to get xdev built with the arm-freebsd-gcc binary > installed. Unfortunately, the same fix does not work on > head/. >=20 > Also, quite to my amazement, WITH_GCC=3D1 and WITH_GNUCXX=3D1 > causes xdev to fail spectactularly at least on r264791. >=20 > The situation as it stands is: >=20 > - gcc(1) is needed for the u-boot build. > - cc(1) *cannot* be clang(1) >=20 > To shoe-horn the toolchain to make 'xdev' give what is > needed, remove WITH_GNUCXX=3D1 and add WITH_GCC_BOOTSTRAP=3D1. You shouldn=92t need this, since that should be the default with = WITHOUT_CLANG_IS_CC=85 You fixed the wrong bug :) Warner > MFC After: 1 week > X-MFC-To: stable/10 only > X-MFC-Note: after stable/10 is broken in this way... > Sponsored by: The FreeBSD Foundation >=20 > Modified: > head/release/arm/release.sh >=20 > Modified: head/release/arm/release.sh > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/release/arm/release.sh Wed Apr 23 01:27:53 2014 = (r264792) > +++ head/release/arm/release.sh Wed Apr 23 01:47:07 2014 = (r264793) > @@ -94,7 +94,7 @@ install_uboot() { > main() { > # Build the 'xdev' target for crochet. > eval chroot ${CHROOTDIR} make -C /usr/src \ > - WITH_GCC=3D1 WITH_GNUCXX=3D1 WITHOUT_CLANG_IS_CC=3D1 \ > + WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 = WITHOUT_CLANG_IS_CC=3D1 \ > XDEV=3D${XDEV} XDEV_ARCH=3D${XDEV_ARCH} \ > ${WORLD_FLAGS} xdev >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 05:09:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF6567BE; Wed, 23 Apr 2014 05:09:27 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail0.glenbarber.us", Issuer "Gandi Standard SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D1BE1D92; Wed, 23 Apr 2014 05:09:27 +0000 (UTC) Received: from glenbarber.us (c-71-224-221-174.hsd1.nj.comcast.net [71.224.221.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id E14A314E00; Wed, 23 Apr 2014 05:09:24 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us E14A314E00 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Wed, 23 Apr 2014 01:09:23 -0400 From: Glen Barber To: Warner Losh Subject: Re: svn commit: r264794 - head/release/arm Message-ID: <20140423050923.GW49791@glenbarber.us> References: <201404230201.s3N21NiE054881@svn.freebsd.org> <11A48119-4502-4EE6-A4AF-E726578380DF@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Io5+l5/qWLIGd1Gn" Content-Disposition: inline In-Reply-To: <11A48119-4502-4EE6-A4AF-E726578380DF@gmail.com> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 05:09:27 -0000 --Io5+l5/qWLIGd1Gn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 22, 2014 at 10:02:03PM -0700, Warner Losh wrote: > Ditto. This should be backed out and you should make whoever broke this f= ix it in head. >=20 Well, this commit only moves where the definition is, from the script itself to the configuration file. But, to be fair, I think you broke it in r264660. Glen > Warner >=20 > On Apr 22, 2014, at 7:01 PM, Glen Barber wrote: >=20 > > Author: gjb > > Date: Wed Apr 23 02:01:22 2014 > > New Revision: 264794 > > URL: http://svnweb.freebsd.org/changeset/base/264794 > >=20 > > Log: > > Move xdev knobs from release/arm/release.sh and into an > > XDEV_FLAGS variable in ${KERNCONF}.conf file. > >=20 > > MFC after: 3 days > > X-MFC-Note: fix stable/10 XDEV_FLAGS local for branch > > Sponsored by: The FreeBSD Foundation > >=20 > > Modified: > > head/release/arm/BEAGLEBONE.conf > > head/release/arm/PANDABOARD.conf > > head/release/arm/RPI-B.conf > > head/release/arm/WANDBOARD-QUAD.conf > > head/release/arm/ZEDBOARD.conf > > head/release/arm/release.sh > >=20 > > Modified: head/release/arm/BEAGLEBONE.conf > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/release/arm/BEAGLEBONE.conf Wed Apr 23 01:47:07 2014 (r264793) > > +++ head/release/arm/BEAGLEBONE.conf Wed Apr 23 02:01:22 2014 (r264794) > > @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 > > EMBEDDEDPORTS=3D"lang/python textproc/gsed" > > XDEV=3D"arm" > > XDEV_ARCH=3D"armv6" > > +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 WITHOUT_CLANG_IS_CC= =3D1" > > KERNEL=3D"BEAGLEBONE" > > CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" > > CROCHETBRANCH=3D"trunk" > >=20 > > Modified: head/release/arm/PANDABOARD.conf > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/release/arm/PANDABOARD.conf Wed Apr 23 01:47:07 2014 (r264793) > > +++ head/release/arm/PANDABOARD.conf Wed Apr 23 02:01:22 2014 (r264794) > > @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 > > EMBEDDEDPORTS=3D"lang/python textproc/gsed" > > XDEV=3D"arm" > > XDEV_ARCH=3D"armv6" > > +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 WITHOUT_CLANG_IS_CC= =3D1" > > KERNEL=3D"PANDABOARD" > > CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" > > CROCHETBRANCH=3D"trunk" > >=20 > > Modified: head/release/arm/RPI-B.conf > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/release/arm/RPI-B.conf Wed Apr 23 01:47:07 2014 (r264793) > > +++ head/release/arm/RPI-B.conf Wed Apr 23 02:01:22 2014 (r264794) > > @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 > > EMBEDDEDPORTS=3D"lang/python textproc/gsed" > > XDEV=3D"arm" > > XDEV_ARCH=3D"armv6" > > +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 WITHOUT_CLANG_IS_CC= =3D1" > > KERNEL=3D"RPI-B" > > CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" > > CROCHETBRANCH=3D"trunk" > >=20 > > Modified: head/release/arm/WANDBOARD-QUAD.conf > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/release/arm/WANDBOARD-QUAD.conf Wed Apr 23 01:47:07 2014 (r264= 793) > > +++ head/release/arm/WANDBOARD-QUAD.conf Wed Apr 23 02:01:22 2014 (r264= 794) > > @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 > > EMBEDDEDPORTS=3D"lang/python textproc/gsed" > > XDEV=3D"arm" > > XDEV_ARCH=3D"armv6" > > +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 WITHOUT_CLANG_IS_CC= =3D1" > > KERNEL=3D"WANDBOARD-QUAD" > > CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" > > CROCHETBRANCH=3D"trunk" > >=20 > > Modified: head/release/arm/ZEDBOARD.conf > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/release/arm/ZEDBOARD.conf Wed Apr 23 01:47:07 2014 (r264793) > > +++ head/release/arm/ZEDBOARD.conf Wed Apr 23 02:01:22 2014 (r264794) > > @@ -21,6 +21,7 @@ CHROOTDIR=3D"/scratch" > > EMBEDDEDBUILD=3D1 > > XDEV=3D"arm" > > XDEV_ARCH=3D"armv6" > > +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 WITHOUT_CLANG_IS_CC= =3D1" > > KERNEL=3D"ZEDBOARD" > > CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" > > CROCHETBRANCH=3D"trunk" > >=20 > > Modified: head/release/arm/release.sh > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/release/arm/release.sh Wed Apr 23 01:47:07 2014 (r264793) > > +++ head/release/arm/release.sh Wed Apr 23 02:01:22 2014 (r264794) > > @@ -94,8 +94,7 @@ install_uboot() { > > main() { > > # Build the 'xdev' target for crochet. > > eval chroot ${CHROOTDIR} make -C /usr/src \ > > - WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 WITHOUT_CLANG_IS_CC=3D1 \ > > - XDEV=3D${XDEV} XDEV_ARCH=3D${XDEV_ARCH} \ > > + ${XDEV_FLAGS} XDEV=3D${XDEV} XDEV_ARCH=3D${XDEV_ARCH} \ > > ${WORLD_FLAGS} xdev > >=20 > > # Run the ldconfig(8) startup script so /var/run/ld-elf*.so.hints > >=20 >=20 --Io5+l5/qWLIGd1Gn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTV0sDAAoJELls3eqvi17QO94QAI+u8Ht2oxIOlVqR5dZwhbTR /6dJrj37tDU6nhVOlHQrM6DBr+Q7VgohWbcEggSCT2MhoiafkYTCfoM+tbEZHn2p pX+0wazYDx0rpioC2O80gBwVF4euTQXUosSw2GfenZ7heQPn7xQWE/s0myC9FBnG h6YqI++uyyCZhw53uhQApElBIhXCGe72NuzSisKr+AqfGy6b4jzVetL+lql9mYB0 rioK4tdDzAHUGxWFQA0VlQ+xvg8YgOmXQ8JehMS/ZI2yV8+ngFZpl3IrH0rIPRop HYfvUw4lF+PIBgeOEkEjFPqcxT4+1aMpVTivXZMfRqhro6r148SlW0gPZ80AFKdy +2xVGcISsN1SklSTio4DRRxIa++ginbgK/Nqw9XlnaOc7WvqMwsSWJ/YqLMbylM/ n2cxWkftHisP15NccBEt+scTnvUokjnbiZIoT/984aIMd1YIqaEyefRiDEYv9xhN X9QQH/mMRmmZ5RII9a/6hStDGy35g3QfJD6Ll7Ze887dL6gaUsPnsMZI8TtnoMZ6 hIOLED2ey6LNnHnJ9BPqiiJv4gPrw5wVmHVrSUaO1ka56nFk537Rs97ZuOFGMpG/ oCSVWU1Q2+Z9KISIZczpGmd+UDu9OjsnAY87SB86sz7hpZI5tWdXv7nxImQqP0jD kZEew3fx516gb2fcwHMO =qFJg -----END PGP SIGNATURE----- --Io5+l5/qWLIGd1Gn-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 05:12:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D945290E; Wed, 23 Apr 2014 05:12:38 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail0.glenbarber.us", Issuer "Gandi Standard SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7A731E4D; Wed, 23 Apr 2014 05:12:38 +0000 (UTC) Received: from glenbarber.us (c-71-224-221-174.hsd1.nj.comcast.net [71.224.221.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 73DC014E51; Wed, 23 Apr 2014 05:12:37 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 73DC014E51 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Wed, 23 Apr 2014 01:12:35 -0400 From: Glen Barber To: Warner Losh Subject: Re: svn commit: r264794 - head/release/arm Message-ID: <20140423051235.GX49791@glenbarber.us> References: <201404230201.s3N21NiE054881@svn.freebsd.org> <11A48119-4502-4EE6-A4AF-E726578380DF@gmail.com> <20140423050923.GW49791@glenbarber.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="yfuuGBTZ0Eg3HEy0" Content-Disposition: inline In-Reply-To: <20140423050923.GW49791@glenbarber.us> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 05:12:38 -0000 --yfuuGBTZ0Eg3HEy0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 23, 2014 at 01:09:23AM -0400, Glen Barber wrote: > On Tue, Apr 22, 2014 at 10:02:03PM -0700, Warner Losh wrote: > > Ditto. This should be backed out and you should make whoever broke this= fix it in head. > >=20 >=20 > Well, this commit only moves where the definition is, from the script > itself to the configuration file. >=20 > But, to be fair, I think you broke it in r264660. >=20 To clarify further, if it was you that did break it in head/, I am not complaining about it - I fixed the use case I need. What I *want* to happen is for the WITH_CLANG_IS_CC and WITHOUT_CLANG_IS_CC to stop conflicting with WITH_GCC, and additional convoluted and unnecessary knobs to go away. But you already know that. :) Glen > Glen >=20 > > Warner > >=20 > > On Apr 22, 2014, at 7:01 PM, Glen Barber wrote: > >=20 > > > Author: gjb > > > Date: Wed Apr 23 02:01:22 2014 > > > New Revision: 264794 > > > URL: http://svnweb.freebsd.org/changeset/base/264794 > > >=20 > > > Log: > > > Move xdev knobs from release/arm/release.sh and into an > > > XDEV_FLAGS variable in ${KERNCONF}.conf file. > > >=20 > > > MFC after: 3 days > > > X-MFC-Note: fix stable/10 XDEV_FLAGS local for branch > > > Sponsored by: The FreeBSD Foundation > > >=20 > > > Modified: > > > head/release/arm/BEAGLEBONE.conf > > > head/release/arm/PANDABOARD.conf > > > head/release/arm/RPI-B.conf > > > head/release/arm/WANDBOARD-QUAD.conf > > > head/release/arm/ZEDBOARD.conf > > > head/release/arm/release.sh > > >=20 > > > Modified: head/release/arm/BEAGLEBONE.conf > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/release/arm/BEAGLEBONE.conf Wed Apr 23 01:47:07 2014 (r26479= 3) > > > +++ head/release/arm/BEAGLEBONE.conf Wed Apr 23 02:01:22 2014 (r26479= 4) > > > @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 > > > EMBEDDEDPORTS=3D"lang/python textproc/gsed" > > > XDEV=3D"arm" > > > XDEV_ARCH=3D"armv6" > > > +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 WITHOUT_CLANG_IS_C= C=3D1" > > > KERNEL=3D"BEAGLEBONE" > > > CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" > > > CROCHETBRANCH=3D"trunk" > > >=20 > > > Modified: head/release/arm/PANDABOARD.conf > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/release/arm/PANDABOARD.conf Wed Apr 23 01:47:07 2014 (r26479= 3) > > > +++ head/release/arm/PANDABOARD.conf Wed Apr 23 02:01:22 2014 (r26479= 4) > > > @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 > > > EMBEDDEDPORTS=3D"lang/python textproc/gsed" > > > XDEV=3D"arm" > > > XDEV_ARCH=3D"armv6" > > > +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 WITHOUT_CLANG_IS_C= C=3D1" > > > KERNEL=3D"PANDABOARD" > > > CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" > > > CROCHETBRANCH=3D"trunk" > > >=20 > > > Modified: head/release/arm/RPI-B.conf > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/release/arm/RPI-B.conf Wed Apr 23 01:47:07 2014 (r264793) > > > +++ head/release/arm/RPI-B.conf Wed Apr 23 02:01:22 2014 (r264794) > > > @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 > > > EMBEDDEDPORTS=3D"lang/python textproc/gsed" > > > XDEV=3D"arm" > > > XDEV_ARCH=3D"armv6" > > > +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 WITHOUT_CLANG_IS_C= C=3D1" > > > KERNEL=3D"RPI-B" > > > CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" > > > CROCHETBRANCH=3D"trunk" > > >=20 > > > Modified: head/release/arm/WANDBOARD-QUAD.conf > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/release/arm/WANDBOARD-QUAD.conf Wed Apr 23 01:47:07 2014 (r2= 64793) > > > +++ head/release/arm/WANDBOARD-QUAD.conf Wed Apr 23 02:01:22 2014 (r2= 64794) > > > @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 > > > EMBEDDEDPORTS=3D"lang/python textproc/gsed" > > > XDEV=3D"arm" > > > XDEV_ARCH=3D"armv6" > > > +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 WITHOUT_CLANG_IS_C= C=3D1" > > > KERNEL=3D"WANDBOARD-QUAD" > > > CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" > > > CROCHETBRANCH=3D"trunk" > > >=20 > > > Modified: head/release/arm/ZEDBOARD.conf > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/release/arm/ZEDBOARD.conf Wed Apr 23 01:47:07 2014 (r264793) > > > +++ head/release/arm/ZEDBOARD.conf Wed Apr 23 02:01:22 2014 (r264794) > > > @@ -21,6 +21,7 @@ CHROOTDIR=3D"/scratch" > > > EMBEDDEDBUILD=3D1 > > > XDEV=3D"arm" > > > XDEV_ARCH=3D"armv6" > > > +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 WITHOUT_CLANG_IS_C= C=3D1" > > > KERNEL=3D"ZEDBOARD" > > > CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" > > > CROCHETBRANCH=3D"trunk" > > >=20 > > > Modified: head/release/arm/release.sh > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/release/arm/release.sh Wed Apr 23 01:47:07 2014 (r264793) > > > +++ head/release/arm/release.sh Wed Apr 23 02:01:22 2014 (r264794) > > > @@ -94,8 +94,7 @@ install_uboot() { > > > main() { > > > # Build the 'xdev' target for crochet. > > > eval chroot ${CHROOTDIR} make -C /usr/src \ > > > - WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 WITHOUT_CLANG_IS_CC=3D1 \ > > > - XDEV=3D${XDEV} XDEV_ARCH=3D${XDEV_ARCH} \ > > > + ${XDEV_FLAGS} XDEV=3D${XDEV} XDEV_ARCH=3D${XDEV_ARCH} \ > > > ${WORLD_FLAGS} xdev > > >=20 > > > # Run the ldconfig(8) startup script so /var/run/ld-elf*.so.hints > > >=20 > >=20 --yfuuGBTZ0Eg3HEy0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTV0vDAAoJELls3eqvi17Qgz0QAMVjIO59riFT/CZ8Hi6HNkmw SZWwqX4cmNp7NjjQEP78G3RaJ6BH8x0ZgmgNuMyRcFRZv6krlDLd61FvLy9kKDU7 3J/9iATJBl2BM6YFDi7nnUZXX6aeDvL1pzE9iErLJaCCCYLYkaNdesxz1wvdmP9e j5ERiLEQxKaa9BjXnFUTQqrnuc7hnBlhKlfyNgMC0Q3r3dPA+0Nj4RNaodRZUzJT ZjTW/BqjdcIu7PT+E32YNJh5Cbn9aCHw7xjlGdZ5nzEplDHxmUjq1YSgTylijUxq 9tHKDxGD9xae505oRIaYs4B6EXzUMFVdFTuvBV3q3wv9hgnc0x9AUeT/YwJRTEKJ nnusRAbKElKJTRVq7ftCrckv37qSJNQR7fbUF9rpStJ2waD6v2dB5P/T8L9Trz+E xYycObFpRiM4A33KCeBWBryife+DjvtDKb9mam+wE+kTYlQ8TBECOlSizNuHJr/F YS3aJeDl/6lth4xM/9UoOvSqXeLzpceWxg/uxNz0l7CCc05Z9qr/JGjgVK4DqWCp Se04k8ouqxNesl8AlnxBpkcEvWdrauzEfeoEqXZlZDkLp4XKCBTcqzsmtXeQhw2s K73+ioFlk4kTI8dMus4yo0ULKbG/lLAtu5OHyH7xT1Vg7bDsgL9eJqtbjOfm4EAj udsmwW69vIrgmXNfIAj4 =Nd2a -----END PGP SIGNATURE----- --yfuuGBTZ0Eg3HEy0-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 05:13:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 467C6A5A for ; Wed, 23 Apr 2014 05:13:45 +0000 (UTC) Received: from mail-pb0-f46.google.com (mail-pb0-f46.google.com [209.85.160.46]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 189161E56 for ; Wed, 23 Apr 2014 05:13:44 +0000 (UTC) Received: by mail-pb0-f46.google.com with SMTP id rq2so393197pbb.5 for ; Tue, 22 Apr 2014 22:13:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=0hMsPAP3u842vUl4ICsLgN2cJBtDljkqD2+EvKi3HSU=; b=nE+EmwLALHBM+2wXKlmJy/m4jKz9hR57YdKuuesAVYoG4ZygUuclu7PdM/M3rN0YQu pT3YVPsjLcMjSOfzsk3D8y05JG2FOo+jzO4tD7Bt5BxV2RT5kkGc8m/EhfmTStrOvzCv JN4jyKUIYtE0xGbNOC6HMzW8ROb0dfx1ILIUWiTcaB+q3axQh/6oohjtQKTt0ikjIVwt HT/hVWYw41fAySRXVcX1Gb0iH1KQc5bLSfwHvu4DubV/+tiPqmtt+GIGZw5RIiGsZ8OF F5ess3svpvCQCgcNOlZZX8W0MTiMtVlnHueHDXECxMLuGUj5l3ynxxb4x98PrD9ySr5u 5RlA== X-Gm-Message-State: ALoCoQko60v5o5zz+qDSxE68BQvwCG47Ei7LGnDEvUCBaVb/9GLIkoK26dDRHvgJoxMvv3jKTCOl X-Received: by 10.68.220.137 with SMTP id pw9mr50582966pbc.24.1398230024268; Tue, 22 Apr 2014 22:13:44 -0700 (PDT) Received: from [10.0.103.142] ([50.242.69.61]) by mx.google.com with ESMTPSA id pv4sm88716829pbb.55.2014.04.22.22.13.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Apr 2014 22:13:43 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264794 - head/release/arm From: Warner Losh In-Reply-To: <20140423050923.GW49791@glenbarber.us> Date: Tue, 22 Apr 2014 22:13:42 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <561CD4F3-6F88-4897-8B49-DF001C76053B@bsdimp.com> References: <201404230201.s3N21NiE054881@svn.freebsd.org> <11A48119-4502-4EE6-A4AF-E726578380DF@gmail.com> <20140423050923.GW49791@glenbarber.us> To: Glen Barber X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 05:13:45 -0000 On Apr 22, 2014, at 10:09 PM, Glen Barber wrote: > On Tue, Apr 22, 2014 at 10:02:03PM -0700, Warner Losh wrote: >> Ditto. This should be backed out and you should make whoever broke = this fix it in head. >>=20 >=20 > Well, this commit only moves where the definition is, from the script > itself to the configuration file. >=20 > But, to be fair, I think you broke it in r264660. i=92m pretty sure I broke it and was poking fun at myself until I can = get it fixed :) Warner > Glen >=20 >> Warner >>=20 >> On Apr 22, 2014, at 7:01 PM, Glen Barber wrote: >>=20 >>> Author: gjb >>> Date: Wed Apr 23 02:01:22 2014 >>> New Revision: 264794 >>> URL: http://svnweb.freebsd.org/changeset/base/264794 >>>=20 >>> Log: >>> Move xdev knobs from release/arm/release.sh and into an >>> XDEV_FLAGS variable in ${KERNCONF}.conf file. >>>=20 >>> MFC after: 3 days >>> X-MFC-Note: fix stable/10 XDEV_FLAGS local for branch >>> Sponsored by: The FreeBSD Foundation >>>=20 >>> Modified: >>> head/release/arm/BEAGLEBONE.conf >>> head/release/arm/PANDABOARD.conf >>> head/release/arm/RPI-B.conf >>> head/release/arm/WANDBOARD-QUAD.conf >>> head/release/arm/ZEDBOARD.conf >>> head/release/arm/release.sh >>>=20 >>> Modified: head/release/arm/BEAGLEBONE.conf >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/release/arm/BEAGLEBONE.conf Wed Apr 23 01:47:07 2014 = (r264793) >>> +++ head/release/arm/BEAGLEBONE.conf Wed Apr 23 02:01:22 2014 = (r264794) >>> @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 >>> EMBEDDEDPORTS=3D"lang/python textproc/gsed" >>> XDEV=3D"arm" >>> XDEV_ARCH=3D"armv6" >>> +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 = WITHOUT_CLANG_IS_CC=3D1" >>> KERNEL=3D"BEAGLEBONE" >>> CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" >>> CROCHETBRANCH=3D"trunk" >>>=20 >>> Modified: head/release/arm/PANDABOARD.conf >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/release/arm/PANDABOARD.conf Wed Apr 23 01:47:07 2014 = (r264793) >>> +++ head/release/arm/PANDABOARD.conf Wed Apr 23 02:01:22 2014 = (r264794) >>> @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 >>> EMBEDDEDPORTS=3D"lang/python textproc/gsed" >>> XDEV=3D"arm" >>> XDEV_ARCH=3D"armv6" >>> +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 = WITHOUT_CLANG_IS_CC=3D1" >>> KERNEL=3D"PANDABOARD" >>> CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" >>> CROCHETBRANCH=3D"trunk" >>>=20 >>> Modified: head/release/arm/RPI-B.conf >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/release/arm/RPI-B.conf Wed Apr 23 01:47:07 2014 = (r264793) >>> +++ head/release/arm/RPI-B.conf Wed Apr 23 02:01:22 2014 = (r264794) >>> @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 >>> EMBEDDEDPORTS=3D"lang/python textproc/gsed" >>> XDEV=3D"arm" >>> XDEV_ARCH=3D"armv6" >>> +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 = WITHOUT_CLANG_IS_CC=3D1" >>> KERNEL=3D"RPI-B" >>> CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" >>> CROCHETBRANCH=3D"trunk" >>>=20 >>> Modified: head/release/arm/WANDBOARD-QUAD.conf >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/release/arm/WANDBOARD-QUAD.conf Wed Apr 23 01:47:07 2014 = (r264793) >>> +++ head/release/arm/WANDBOARD-QUAD.conf Wed Apr 23 02:01:22 2014 = (r264794) >>> @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 >>> EMBEDDEDPORTS=3D"lang/python textproc/gsed" >>> XDEV=3D"arm" >>> XDEV_ARCH=3D"armv6" >>> +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 = WITHOUT_CLANG_IS_CC=3D1" >>> KERNEL=3D"WANDBOARD-QUAD" >>> CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" >>> CROCHETBRANCH=3D"trunk" >>>=20 >>> Modified: head/release/arm/ZEDBOARD.conf >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/release/arm/ZEDBOARD.conf Wed Apr 23 01:47:07 2014 = (r264793) >>> +++ head/release/arm/ZEDBOARD.conf Wed Apr 23 02:01:22 2014 = (r264794) >>> @@ -21,6 +21,7 @@ CHROOTDIR=3D"/scratch" >>> EMBEDDEDBUILD=3D1 >>> XDEV=3D"arm" >>> XDEV_ARCH=3D"armv6" >>> +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 = WITHOUT_CLANG_IS_CC=3D1" >>> KERNEL=3D"ZEDBOARD" >>> CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" >>> CROCHETBRANCH=3D"trunk" >>>=20 >>> Modified: head/release/arm/release.sh >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/release/arm/release.sh Wed Apr 23 01:47:07 2014 = (r264793) >>> +++ head/release/arm/release.sh Wed Apr 23 02:01:22 2014 = (r264794) >>> @@ -94,8 +94,7 @@ install_uboot() { >>> main() { >>> # Build the 'xdev' target for crochet. >>> eval chroot ${CHROOTDIR} make -C /usr/src \ >>> - WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 = WITHOUT_CLANG_IS_CC=3D1 \ >>> - XDEV=3D${XDEV} XDEV_ARCH=3D${XDEV_ARCH} \ >>> + ${XDEV_FLAGS} XDEV=3D${XDEV} XDEV_ARCH=3D${XDEV_ARCH} \ >>> ${WORLD_FLAGS} xdev >>>=20 >>> # Run the ldconfig(8) startup script so = /var/run/ld-elf*.so.hints >>>=20 >>=20 From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 05:15:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46586BA1 for ; Wed, 23 Apr 2014 05:15:18 +0000 (UTC) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 171501E62 for ; Wed, 23 Apr 2014 05:15:17 +0000 (UTC) Received: by mail-pd0-f174.google.com with SMTP id y13so387465pdi.33 for ; Tue, 22 Apr 2014 22:15:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=1hOwQzJiZDU2nzMU3Myau11qboE6uKyR6FYza32gqMI=; b=AwbXybxtW2qqr9Bx06QqCtK8DNVDyfqMHsNe9S9+rBmgql73ZDoHFg8biIwgnG/BlA I1ItOJkDpWfdsufOnuxvVKOcXjQSUiY7aZx6gLtp+xulMnyOULQ7yc5HoajB2p4Dd8BV /xeO5rh+O25C4T/EbZJ7JC8bOMCLN9Z1c9hEpxuoIoNqBjFwYXjDdSt3wF1ajMKo1p22 hDz/I5eFz2jD3c3DIUAX+nOEuTSEv4HpJ4j2L47/BhjPvqYe6aQb3SMLV9UNr9pbXBH+ 4f8ZxJY0dh63SYHtUs0IXWeKp05UGec0ssOTPQ3NgwefsZLUC4mPVhK2o7VE19dwNowa kdgw== X-Gm-Message-State: ALoCoQmQUxkUOZYK20j6vNGI5xVnB7LT9fm2L+YykAvxB6sBIv+InDsTdO1VH5xsTk5O/cmHmuxs X-Received: by 10.68.190.163 with SMTP id gr3mr50413326pbc.103.1398230117319; Tue, 22 Apr 2014 22:15:17 -0700 (PDT) Received: from [10.0.103.142] ([50.242.69.61]) by mx.google.com with ESMTPSA id au16sm211703088pac.27.2014.04.22.22.15.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Apr 2014 22:15:16 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264794 - head/release/arm From: Warner Losh In-Reply-To: <20140423051235.GX49791@glenbarber.us> Date: Tue, 22 Apr 2014 22:15:14 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <71240AD4-7635-4694-950D-CDD99960A013@bsdimp.com> References: <201404230201.s3N21NiE054881@svn.freebsd.org> <11A48119-4502-4EE6-A4AF-E726578380DF@gmail.com> <20140423050923.GW49791@glenbarber.us> <20140423051235.GX49791@glenbarber.us> To: Glen Barber X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 05:15:18 -0000 On Apr 22, 2014, at 10:12 PM, Glen Barber wrote: > On Wed, Apr 23, 2014 at 01:09:23AM -0400, Glen Barber wrote: >> On Tue, Apr 22, 2014 at 10:02:03PM -0700, Warner Losh wrote: >>> Ditto. This should be backed out and you should make whoever broke = this fix it in head. >>>=20 >>=20 >> Well, this commit only moves where the definition is, from the script >> itself to the configuration file. >>=20 >> But, to be fair, I think you broke it in r264660. >>=20 >=20 > To clarify further, if it was you that did break it in head/, I am not > complaining about it - I fixed the use case I need. >=20 > What I *want* to happen is for the WITH_CLANG_IS_CC and > WITHOUT_CLANG_IS_CC to stop conflicting with WITH_GCC, and additional > convoluted and unnecessary knobs to go away. >=20 > But you already know that. :) Yea, see my recent posts to arm@ on that very topic. CLANG_IS_CC is evil = and must die. There=92s too many stupid special cases for clang in the = build system, and it is really horking me off=85 But there will be fewer = in about a week or so when I push my next round of fixes in... Warner > Glen >=20 >> Glen >>=20 >>> Warner >>>=20 >>> On Apr 22, 2014, at 7:01 PM, Glen Barber wrote: >>>=20 >>>> Author: gjb >>>> Date: Wed Apr 23 02:01:22 2014 >>>> New Revision: 264794 >>>> URL: http://svnweb.freebsd.org/changeset/base/264794 >>>>=20 >>>> Log: >>>> Move xdev knobs from release/arm/release.sh and into an >>>> XDEV_FLAGS variable in ${KERNCONF}.conf file. >>>>=20 >>>> MFC after: 3 days >>>> X-MFC-Note: fix stable/10 XDEV_FLAGS local for branch >>>> Sponsored by: The FreeBSD Foundation >>>>=20 >>>> Modified: >>>> head/release/arm/BEAGLEBONE.conf >>>> head/release/arm/PANDABOARD.conf >>>> head/release/arm/RPI-B.conf >>>> head/release/arm/WANDBOARD-QUAD.conf >>>> head/release/arm/ZEDBOARD.conf >>>> head/release/arm/release.sh >>>>=20 >>>> Modified: head/release/arm/BEAGLEBONE.conf >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/release/arm/BEAGLEBONE.conf Wed Apr 23 01:47:07 2014 = (r264793) >>>> +++ head/release/arm/BEAGLEBONE.conf Wed Apr 23 02:01:22 2014 = (r264794) >>>> @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 >>>> EMBEDDEDPORTS=3D"lang/python textproc/gsed" >>>> XDEV=3D"arm" >>>> XDEV_ARCH=3D"armv6" >>>> +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 = WITHOUT_CLANG_IS_CC=3D1" >>>> KERNEL=3D"BEAGLEBONE" >>>> CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" >>>> CROCHETBRANCH=3D"trunk" >>>>=20 >>>> Modified: head/release/arm/PANDABOARD.conf >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/release/arm/PANDABOARD.conf Wed Apr 23 01:47:07 2014 = (r264793) >>>> +++ head/release/arm/PANDABOARD.conf Wed Apr 23 02:01:22 2014 = (r264794) >>>> @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 >>>> EMBEDDEDPORTS=3D"lang/python textproc/gsed" >>>> XDEV=3D"arm" >>>> XDEV_ARCH=3D"armv6" >>>> +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 = WITHOUT_CLANG_IS_CC=3D1" >>>> KERNEL=3D"PANDABOARD" >>>> CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" >>>> CROCHETBRANCH=3D"trunk" >>>>=20 >>>> Modified: head/release/arm/RPI-B.conf >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/release/arm/RPI-B.conf Wed Apr 23 01:47:07 2014 = (r264793) >>>> +++ head/release/arm/RPI-B.conf Wed Apr 23 02:01:22 2014 = (r264794) >>>> @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 >>>> EMBEDDEDPORTS=3D"lang/python textproc/gsed" >>>> XDEV=3D"arm" >>>> XDEV_ARCH=3D"armv6" >>>> +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 = WITHOUT_CLANG_IS_CC=3D1" >>>> KERNEL=3D"RPI-B" >>>> CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" >>>> CROCHETBRANCH=3D"trunk" >>>>=20 >>>> Modified: head/release/arm/WANDBOARD-QUAD.conf >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/release/arm/WANDBOARD-QUAD.conf Wed Apr 23 01:47:07 2014 = (r264793) >>>> +++ head/release/arm/WANDBOARD-QUAD.conf Wed Apr 23 02:01:22 2014 = (r264794) >>>> @@ -22,6 +22,7 @@ EMBEDDEDBUILD=3D1 >>>> EMBEDDEDPORTS=3D"lang/python textproc/gsed" >>>> XDEV=3D"arm" >>>> XDEV_ARCH=3D"armv6" >>>> +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 = WITHOUT_CLANG_IS_CC=3D1" >>>> KERNEL=3D"WANDBOARD-QUAD" >>>> CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" >>>> CROCHETBRANCH=3D"trunk" >>>>=20 >>>> Modified: head/release/arm/ZEDBOARD.conf >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/release/arm/ZEDBOARD.conf Wed Apr 23 01:47:07 2014 = (r264793) >>>> +++ head/release/arm/ZEDBOARD.conf Wed Apr 23 02:01:22 2014 = (r264794) >>>> @@ -21,6 +21,7 @@ CHROOTDIR=3D"/scratch" >>>> EMBEDDEDBUILD=3D1 >>>> XDEV=3D"arm" >>>> XDEV_ARCH=3D"armv6" >>>> +XDEV_FLAGS=3D"WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 = WITHOUT_CLANG_IS_CC=3D1" >>>> KERNEL=3D"ZEDBOARD" >>>> CROCHETSRC=3D"https://github.com/kientzle/crochet-freebsd" >>>> CROCHETBRANCH=3D"trunk" >>>>=20 >>>> Modified: head/release/arm/release.sh >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/release/arm/release.sh Wed Apr 23 01:47:07 2014 = (r264793) >>>> +++ head/release/arm/release.sh Wed Apr 23 02:01:22 2014 = (r264794) >>>> @@ -94,8 +94,7 @@ install_uboot() { >>>> main() { >>>> # Build the 'xdev' target for crochet. >>>> eval chroot ${CHROOTDIR} make -C /usr/src \ >>>> - WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 = WITHOUT_CLANG_IS_CC=3D1 \ >>>> - XDEV=3D${XDEV} XDEV_ARCH=3D${XDEV_ARCH} \ >>>> + ${XDEV_FLAGS} XDEV=3D${XDEV} XDEV_ARCH=3D${XDEV_ARCH} \ >>>> ${WORLD_FLAGS} xdev >>>>=20 >>>> # Run the ldconfig(8) startup script so = /var/run/ld-elf*.so.hints >>>>=20 >>>=20 >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 05:17:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4947DCE7; Wed, 23 Apr 2014 05:17:13 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail0.glenbarber.us", Issuer "Gandi Standard SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17AF61E71; Wed, 23 Apr 2014 05:17:12 +0000 (UTC) Received: from glenbarber.us (c-71-224-221-174.hsd1.nj.comcast.net [71.224.221.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id EE9AA14EFB; Wed, 23 Apr 2014 05:17:10 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us EE9AA14EFB Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Wed, 23 Apr 2014 01:17:09 -0400 From: Glen Barber To: Warner Losh Subject: Re: svn commit: r264794 - head/release/arm Message-ID: <20140423051709.GY49791@glenbarber.us> References: <201404230201.s3N21NiE054881@svn.freebsd.org> <11A48119-4502-4EE6-A4AF-E726578380DF@gmail.com> <20140423050923.GW49791@glenbarber.us> <20140423051235.GX49791@glenbarber.us> <71240AD4-7635-4694-950D-CDD99960A013@bsdimp.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="i3QSQnH4pbmkdUT9" Content-Disposition: inline In-Reply-To: <71240AD4-7635-4694-950D-CDD99960A013@bsdimp.com> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 05:17:13 -0000 --i3QSQnH4pbmkdUT9 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 22, 2014 at 10:15:14PM -0700, Warner Losh wrote: >=20 > On Apr 22, 2014, at 10:12 PM, Glen Barber wrote: >=20 > > On Wed, Apr 23, 2014 at 01:09:23AM -0400, Glen Barber wrote: > >> On Tue, Apr 22, 2014 at 10:02:03PM -0700, Warner Losh wrote: > >>> Ditto. This should be backed out and you should make whoever broke th= is fix it in head. > >>>=20 > >>=20 > >> Well, this commit only moves where the definition is, from the script > >> itself to the configuration file. > >>=20 > >> But, to be fair, I think you broke it in r264660. > >>=20 > >=20 > > To clarify further, if it was you that did break it in head/, I am not > > complaining about it - I fixed the use case I need. > >=20 > > What I *want* to happen is for the WITH_CLANG_IS_CC and > > WITHOUT_CLANG_IS_CC to stop conflicting with WITH_GCC, and additional > > convoluted and unnecessary knobs to go away. > >=20 > > But you already know that. :) >=20 > Yea, see my recent posts to arm@ on that very topic. CLANG_IS_CC > is evil and must die. There=E2=80=99s too many stupid special cases for > clang in the build system, and it is really horking me off=E2=80=A6 But > there will be fewer in about a week or so when I push my next round > of fixes in... >=20 Feel free to run your changes by me for testing. I'm happy to complain^W test. :) Glen --i3QSQnH4pbmkdUT9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTV0zVAAoJELls3eqvi17Q9NoP+wWjOXBySLRCk/I6KbTpkycs nEbf0peLvRZKfw2GXApyz55oVCR9vdUBEUzbcN0b1SQBGv3IW2w53Eqeer4MuiuN 6baSweLBPUUoLWkUcyr/7cdD8Go9j+iQ9j2MeSKafgYfpgnMGxSJRR6nwu243a51 tgr81K9NdR1loWhH/y+S2KSW97RiatECc6T/QtFN8Srr+u4nmLtaE/4RqDNwEyDR 7dzwEWyr7bRnD0NKCTuQqbAMdXbwB3Phq+s9ZdfMqepvtbKVFArXUuI1hXBCHsFo yBIr1KDPoSnQOOzn6gdby9yEcLLSXrYqTp+cdTuoeZxrVVbe90hKs1veFMwbgBr0 ugMtF9tdDFPRf/HNBJ1thtbJs2rtZukrW5op2R+isGIUzbpnpG3M48Fp5KgY7X8e I0YbuySZAA6l9XTMzftdqFGC5WSgNih1EXmyiRN5M45Be5O4Ue25DW/PXMEIrFaV NBhE5Z9pXaNhDLbhUcnD/ftNlvsQgxIyseTlkA/TIs2QxbwVjRj0y34PT80rjKSy 2MSjeGH5JYrwSuFCwMSZF1Fqnv+k8g7fgldo19CRJBlgqlF/8wD8b7I6fQhM2l0s XkNygMcE3QZ7tsMJwShfFEJM/sLv6RZ2arBQL52shKJEy0bpOZUTOyLoqhIgRg5R WQTkw4LTc2X7dBWV8nbb =hym1 -----END PGP SIGNATURE----- --i3QSQnH4pbmkdUT9-- From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 05:19:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8585E2B; Wed, 23 Apr 2014 05:19:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 954BF1E7A; Wed, 23 Apr 2014 05:19:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3N5JjOx036504; Wed, 23 Apr 2014 05:19:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3N5Jj5E036503; Wed, 23 Apr 2014 05:19:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404230519.s3N5Jj5E036503@svn.freebsd.org> From: Adrian Chadd Date: Wed, 23 Apr 2014 05:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264798 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 05:19:45 -0000 Author: adrian Date: Wed Apr 23 05:19:45 2014 New Revision: 264798 URL: http://svnweb.freebsd.org/changeset/base/264798 Log: Wrap the rate control re-init code in a lock, to serialise it with concurrent updates from any completing transmits in other threads. This was exposed when doing power save work - net80211 is constantly doing reassociations and it's causing the rate control state to get blanked out. This could cause the rate control code to assert. This should be MFCed to stable/10 as it's a stability fix. Tested: * AR5416, STA MFC after: 7 days Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Apr 23 03:30:00 2014 (r264797) +++ head/sys/dev/ath/if_ath.c Wed Apr 23 05:19:45 2014 (r264798) @@ -5567,7 +5567,9 @@ ath_newassoc(struct ieee80211_node *ni, an->an_mcastrix = ath_tx_findrix(sc, tp->mcastrate); an->an_mgmtrix = ath_tx_findrix(sc, tp->mgmtrate); + ATH_NODE_LOCK(an); ath_rate_newassoc(sc, an, isnew); + ATH_NODE_UNLOCK(an); if (isnew && (vap->iv_flags & IEEE80211_F_PRIVACY) == 0 && sc->sc_hasclrkey && From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 05:20:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CEEE4113 for ; Wed, 23 Apr 2014 05:20:00 +0000 (UTC) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F9C61E81 for ; Wed, 23 Apr 2014 05:20:00 +0000 (UTC) Received: by mail-pb0-f50.google.com with SMTP id md12so397015pbc.37 for ; Tue, 22 Apr 2014 22:19:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=4RsPbmFfEkmPBqdxqC5gpIFVNc5y+CRJAa41TLXYMq8=; b=J15V9HCElJPy1SPqVKoocxr2CAeKO4ZYTjAHtn2kniHYX2aLq/eXX6UAU7amjirXrg gAsr6NJD7/uduhndBWaJx/8xV2DglgbTIk9zd/6oIGCoOSZc3TPktztyhDztalgXl4U3 RmXY1iXk2Pq8nJJaD/1ZDyreraqOPyDQFYi0etKrKfI5JCviGVtTXD08WnrVcyzLuWTf pqYnaMlPmDgd22WKyW2cG96Wy46/QHis7uixxKgxLOs4CccVRyWwKmH2VBljHFm4I7rn oylP4B6/8ztUotpGb6In01mBN9WJNb0QBQihJfvFAd3Q8icUHEdjaBfQ5qFlHXU8SUZs b53A== X-Gm-Message-State: ALoCoQlNOORlkVicwZPodRJ4LyHu9q9JbupU69zpREscL/yDlX++aJWlji7MlAg4mRSt7L8UXeb1 X-Received: by 10.68.104.225 with SMTP id gh1mr5493730pbb.87.1398230393939; Tue, 22 Apr 2014 22:19:53 -0700 (PDT) Received: from [10.0.103.142] ([50.242.69.61]) by mx.google.com with ESMTPSA id yo9sm211832674pab.16.2014.04.22.22.19.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Apr 2014 22:19:52 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264794 - head/release/arm From: Warner Losh In-Reply-To: <20140423051709.GY49791@glenbarber.us> Date: Tue, 22 Apr 2014 22:19:50 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <19D9CEFF-ED49-4310-991A-59D35EF8A242@bsdimp.com> References: <201404230201.s3N21NiE054881@svn.freebsd.org> <11A48119-4502-4EE6-A4AF-E726578380DF@gmail.com> <20140423050923.GW49791@glenbarber.us> <20140423051235.GX49791@glenbarber.us> <71240AD4-7635-4694-950D-CDD99960A013@bsdimp.com> <20140423051709.GY49791@glenbarber.us> To: Glen Barber X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 05:20:01 -0000 On Apr 22, 2014, at 10:17 PM, Glen Barber wrote: > On Tue, Apr 22, 2014 at 10:15:14PM -0700, Warner Losh wrote: >>=20 >> On Apr 22, 2014, at 10:12 PM, Glen Barber wrote: >>=20 >>> On Wed, Apr 23, 2014 at 01:09:23AM -0400, Glen Barber wrote: >>>> On Tue, Apr 22, 2014 at 10:02:03PM -0700, Warner Losh wrote: >>>>> Ditto. This should be backed out and you should make whoever broke = this fix it in head. >>>>>=20 >>>>=20 >>>> Well, this commit only moves where the definition is, from the = script >>>> itself to the configuration file. >>>>=20 >>>> But, to be fair, I think you broke it in r264660. >>>>=20 >>>=20 >>> To clarify further, if it was you that did break it in head/, I am = not >>> complaining about it - I fixed the use case I need. >>>=20 >>> What I *want* to happen is for the WITH_CLANG_IS_CC and >>> WITHOUT_CLANG_IS_CC to stop conflicting with WITH_GCC, and = additional >>> convoluted and unnecessary knobs to go away. >>>=20 >>> But you already know that. :) >>=20 >> Yea, see my recent posts to arm@ on that very topic. CLANG_IS_CC >> is evil and must die. There=92s too many stupid special cases for >> clang in the build system, and it is really horking me off=85 But >> there will be fewer in about a week or so when I push my next round >> of fixes in... >>=20 >=20 > Feel free to run your changes by me for testing. I'm happy to > complain^W test. :) Will do=85 My work in progress mercurial patch queue is updating every = day or three at http://people.freebsd.org/~imp/patch-queue if you wanted a sneak peak = and had a mercurial setup already=85 But there=92s also some crazy stuff in = that=85 When I have a patch set I=92m ready to dump into make universe, I=92ll give you a = heads up. And sorry for breaking it in the first place... Warner= From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 05:50:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97B9B593; Wed, 23 Apr 2014 05:50:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A010129F; Wed, 23 Apr 2014 05:50:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3N5ouQb050470; Wed, 23 Apr 2014 05:50:56 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3N5oue8050469; Wed, 23 Apr 2014 05:50:56 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201404230550.s3N5oue8050469@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 23 Apr 2014 05:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264800 - head/sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 05:50:56 -0000 Author: hselasky Date: Wed Apr 23 05:50:55 2014 New Revision: 264800 URL: http://svnweb.freebsd.org/changeset/base/264800 Log: - Get transmit loop more in line with the other serial drivers. - Add a comment about FTDI and ZLPs. - Correctly check odditiy of baud rate divisor. - Correct IOCTL handling for "error" and "event" char. MFC after: 1 weeks Modified: head/sys/dev/usb/serial/uftdi.c Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Wed Apr 23 05:29:50 2014 (r264799) +++ head/sys/dev/usb/serial/uftdi.c Wed Apr 23 05:50:55 2014 (r264800) @@ -1155,11 +1155,17 @@ uftdi_write_callback(struct usb_xfer *xf * Otherwise, loop to format packets into the buffer while there * is data available, and room for a packet header and at least * one byte of payload. + * + * NOTE: The FTDI chip doesn't accept zero length + * packets. This cannot happen because the "pktlen" + * will always be non-zero when "ucom_get_data()" + * returns non-zero which we check below. */ pc = usbd_xfer_get_frame(xfer, 0); if (sc->sc_hdrlen == 0) { - ucom_get_data(&sc->sc_ucom, pc, 0, UFTDI_OBUFSIZE, - &buflen); + if (ucom_get_data(&sc->sc_ucom, pc, 0, UFTDI_OBUFSIZE, + &buflen) == 0) + break; } else { buflen = 0; while (buflen < UFTDI_OBUFSIZE - sc->sc_hdrlen - 1 && @@ -1417,7 +1423,7 @@ uftdi_encode_baudrate(struct uftdi_softc * 8ths by adding 1 and dividing by 2. */ divisor = (clk << 4) / speed; - if ((divisor & 0xfffffff0) == 1) + if ((divisor & 0xf) == 1) divisor &= 0xfffffff8; else if (sc->sc_devtype == DEVT_232A) divisor += roundoff_232a[divisor & 0x0f]; @@ -1759,10 +1765,11 @@ uftdi_ioctl(struct ucom_softc *ucom, uin err = uftdi_get_latency(ucom, (int *)data); break; case UFTDIIOC_SET_ERROR_CHAR: - err = uftdi_set_event_char(ucom, *(int *)data); + err = uftdi_set_error_char(ucom, *(int *)data); break; case UFTDIIOC_SET_EVENT_CHAR: - err = uftdi_set_error_char(ucom, *(int *)data); + err = uftdi_set_event_char(ucom, *(int *)data); + break; case UFTDIIOC_GET_HWREV: *(int *)data = sc->sc_bcdDevice; err = 0; From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 05:53:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DA9E70E; Wed, 23 Apr 2014 05:53:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7ADF212CC; Wed, 23 Apr 2014 05:53:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3N5r3GA051911; Wed, 23 Apr 2014 05:53:03 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3N5r3iY051910; Wed, 23 Apr 2014 05:53:03 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201404230553.s3N5r3iY051910@svn.freebsd.org> From: Kevin Lo Date: Wed, 23 Apr 2014 05:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264801 - head/sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 05:53:03 -0000 Author: kevlo Date: Wed Apr 23 05:53:03 2014 New Revision: 264801 URL: http://svnweb.freebsd.org/changeset/base/264801 Log: Add a missing break. Modified: head/sys/dev/usb/serial/uftdi.c Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Wed Apr 23 05:50:55 2014 (r264800) +++ head/sys/dev/usb/serial/uftdi.c Wed Apr 23 05:53:03 2014 (r264801) @@ -1770,6 +1770,7 @@ uftdi_ioctl(struct ucom_softc *ucom, uin case UFTDIIOC_SET_EVENT_CHAR: err = uftdi_set_event_char(ucom, *(int *)data); break; + break; case UFTDIIOC_GET_HWREV: *(int *)data = sc->sc_bcdDevice; err = 0; From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 05:54:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CDD8873; Wed, 23 Apr 2014 05:54:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2961112E1; Wed, 23 Apr 2014 05:54:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3N5suKV052129; Wed, 23 Apr 2014 05:54:56 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3N5sulJ052128; Wed, 23 Apr 2014 05:54:56 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201404230554.s3N5sulJ052128@svn.freebsd.org> From: Kevin Lo Date: Wed, 23 Apr 2014 05:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264802 - head/sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 05:54:56 -0000 Author: kevlo Date: Wed Apr 23 05:54:55 2014 New Revision: 264802 URL: http://svnweb.freebsd.org/changeset/base/264802 Log: Oops, revert r264801. Modified: head/sys/dev/usb/serial/uftdi.c Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Wed Apr 23 05:53:03 2014 (r264801) +++ head/sys/dev/usb/serial/uftdi.c Wed Apr 23 05:54:55 2014 (r264802) @@ -1770,7 +1770,6 @@ uftdi_ioctl(struct ucom_softc *ucom, uin case UFTDIIOC_SET_EVENT_CHAR: err = uftdi_set_event_char(ucom, *(int *)data); break; - break; case UFTDIIOC_GET_HWREV: *(int *)data = sc->sc_bcdDevice; err = 0; From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 05:57:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54D799CD; Wed, 23 Apr 2014 05:57:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C68112F7; Wed, 23 Apr 2014 05:57:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3N5vkrn052522; Wed, 23 Apr 2014 05:57:46 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3N5vjhA052519; Wed, 23 Apr 2014 05:57:45 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201404230557.s3N5vjhA052519@svn.freebsd.org> From: Baptiste Daroussin Date: Wed, 23 Apr 2014 05:57:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264803 - in head: contrib/byacc contrib/byacc/package contrib/byacc/package/debian contrib/byacc/package/pkgsrc contrib/byacc/test contrib/byacc/test/btyacc contrib/byacc/test/yacc usr... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 05:57:46 -0000 Author: bapt Date: Wed Apr 23 05:57:45 2014 New Revision: 264803 URL: http://svnweb.freebsd.org/changeset/base/264803 Log: Update to byacc 20140409 Among all the modifications, this new byacc also solves a 14 year old bug [1] PR: bin/23254 [1] Submitted by: marka@nominum.com [1] MFC after: 3 weeks Added: head/contrib/byacc/MANIFEST - copied unchanged from r264791, vendor/byacc/dist/MANIFEST head/contrib/byacc/NOTES-btyacc-Changes - copied unchanged from r264791, vendor/byacc/dist/NOTES-btyacc-Changes head/contrib/byacc/NOTES-btyacc-Disposition - copied unchanged from r264791, vendor/byacc/dist/NOTES-btyacc-Disposition head/contrib/byacc/README.BTYACC - copied unchanged from r264791, vendor/byacc/dist/README.BTYACC head/contrib/byacc/btyaccpar.c - copied unchanged from r264791, vendor/byacc/dist/btyaccpar.c head/contrib/byacc/btyaccpar.skel - copied unchanged from r264791, vendor/byacc/dist/btyaccpar.skel head/contrib/byacc/mstring.c - copied unchanged from r264791, vendor/byacc/dist/mstring.c head/contrib/byacc/skel2c - copied unchanged from r264791, vendor/byacc/dist/skel2c head/contrib/byacc/test/btyacc/ - copied from r264791, vendor/byacc/dist/test/btyacc/ head/contrib/byacc/test/btyacc_calc1.y - copied unchanged from r264791, vendor/byacc/dist/test/btyacc_calc1.y head/contrib/byacc/test/btyacc_demo.y - copied unchanged from r264791, vendor/byacc/dist/test/btyacc_demo.y head/contrib/byacc/test/code_debug.y - copied unchanged from r264791, vendor/byacc/dist/test/code_debug.y head/contrib/byacc/test/empty.y - copied unchanged from r264791, vendor/byacc/dist/test/empty.y head/contrib/byacc/test/err_inherit1.y - copied unchanged from r264791, vendor/byacc/dist/test/err_inherit1.y head/contrib/byacc/test/err_inherit2.y - copied unchanged from r264791, vendor/byacc/dist/test/err_inherit2.y head/contrib/byacc/test/err_inherit3.y - copied unchanged from r264791, vendor/byacc/dist/test/err_inherit3.y head/contrib/byacc/test/err_inherit4.y - copied unchanged from r264791, vendor/byacc/dist/test/err_inherit4.y head/contrib/byacc/test/err_inherit5.y - copied unchanged from r264791, vendor/byacc/dist/test/err_inherit5.y head/contrib/byacc/test/err_syntax1.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax1.y head/contrib/byacc/test/err_syntax10.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax10.y head/contrib/byacc/test/err_syntax11.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax11.y head/contrib/byacc/test/err_syntax12.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax12.y head/contrib/byacc/test/err_syntax13.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax13.y head/contrib/byacc/test/err_syntax14.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax14.y head/contrib/byacc/test/err_syntax15.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax15.y head/contrib/byacc/test/err_syntax16.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax16.y head/contrib/byacc/test/err_syntax17.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax17.y head/contrib/byacc/test/err_syntax18.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax18.y head/contrib/byacc/test/err_syntax19.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax19.y head/contrib/byacc/test/err_syntax2.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax2.y head/contrib/byacc/test/err_syntax20.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax20.y head/contrib/byacc/test/err_syntax21.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax21.y head/contrib/byacc/test/err_syntax22.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax22.y head/contrib/byacc/test/err_syntax23.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax23.y head/contrib/byacc/test/err_syntax24.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax24.y head/contrib/byacc/test/err_syntax25.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax25.y head/contrib/byacc/test/err_syntax26.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax26.y head/contrib/byacc/test/err_syntax27.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax27.y head/contrib/byacc/test/err_syntax3.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax3.y head/contrib/byacc/test/err_syntax4.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax4.y head/contrib/byacc/test/err_syntax5.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax5.y head/contrib/byacc/test/err_syntax6.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax6.y head/contrib/byacc/test/err_syntax7.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax7.y head/contrib/byacc/test/err_syntax7a.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax7a.y head/contrib/byacc/test/err_syntax7b.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax7b.y head/contrib/byacc/test/err_syntax8.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax8.y head/contrib/byacc/test/err_syntax8a.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax8a.y head/contrib/byacc/test/err_syntax9.y - copied unchanged from r264791, vendor/byacc/dist/test/err_syntax9.y head/contrib/byacc/test/inherit0.y - copied unchanged from r264791, vendor/byacc/dist/test/inherit0.y head/contrib/byacc/test/inherit1.y - copied unchanged from r264791, vendor/byacc/dist/test/inherit1.y head/contrib/byacc/test/inherit2.y - copied unchanged from r264791, vendor/byacc/dist/test/inherit2.y head/contrib/byacc/test/ok_syntax1.y - copied unchanged from r264791, vendor/byacc/dist/test/ok_syntax1.y head/contrib/byacc/test/varsyntax_calc1.y - copied unchanged from r264791, vendor/byacc/dist/test/varsyntax_calc1.y head/contrib/byacc/test/yacc/ - copied from r264791, vendor/byacc/dist/test/yacc/ head/contrib/byacc/yaccpar.c - copied unchanged from r264791, vendor/byacc/dist/yaccpar.c head/contrib/byacc/yaccpar.skel - copied unchanged from r264791, vendor/byacc/dist/yaccpar.skel Deleted: head/contrib/byacc/skeleton.c head/contrib/byacc/test/calc.output head/contrib/byacc/test/calc.tab.c head/contrib/byacc/test/calc.tab.h head/contrib/byacc/test/calc1.output head/contrib/byacc/test/calc1.tab.c head/contrib/byacc/test/calc1.tab.h head/contrib/byacc/test/calc2.output head/contrib/byacc/test/calc2.tab.c head/contrib/byacc/test/calc2.tab.h head/contrib/byacc/test/calc3.output head/contrib/byacc/test/calc3.tab.c head/contrib/byacc/test/calc3.tab.h head/contrib/byacc/test/code_calc.code.c head/contrib/byacc/test/code_calc.output head/contrib/byacc/test/code_calc.tab.c head/contrib/byacc/test/code_calc.tab.h head/contrib/byacc/test/code_error.code.c head/contrib/byacc/test/code_error.output head/contrib/byacc/test/code_error.tab.c head/contrib/byacc/test/code_error.tab.h head/contrib/byacc/test/error.output head/contrib/byacc/test/error.tab.c head/contrib/byacc/test/error.tab.h head/contrib/byacc/test/ftp.output head/contrib/byacc/test/ftp.tab.c head/contrib/byacc/test/ftp.tab.h head/contrib/byacc/test/ftp.y head/contrib/byacc/test/grammar.output head/contrib/byacc/test/grammar.tab.c head/contrib/byacc/test/grammar.tab.h head/contrib/byacc/test/pure_calc.output head/contrib/byacc/test/pure_calc.tab.c head/contrib/byacc/test/pure_calc.tab.h head/contrib/byacc/test/pure_error.output head/contrib/byacc/test/pure_error.tab.c head/contrib/byacc/test/pure_error.tab.h head/contrib/byacc/test/quote_calc-s.output head/contrib/byacc/test/quote_calc-s.tab.c head/contrib/byacc/test/quote_calc-s.tab.h head/contrib/byacc/test/quote_calc.output head/contrib/byacc/test/quote_calc.tab.c head/contrib/byacc/test/quote_calc.tab.h head/contrib/byacc/test/quote_calc2-s.output head/contrib/byacc/test/quote_calc2-s.tab.c head/contrib/byacc/test/quote_calc2-s.tab.h head/contrib/byacc/test/quote_calc2.output head/contrib/byacc/test/quote_calc2.tab.c head/contrib/byacc/test/quote_calc2.tab.h head/contrib/byacc/test/quote_calc3-s.output head/contrib/byacc/test/quote_calc3-s.tab.c head/contrib/byacc/test/quote_calc3-s.tab.h head/contrib/byacc/test/quote_calc3.output head/contrib/byacc/test/quote_calc3.tab.c head/contrib/byacc/test/quote_calc3.tab.h head/contrib/byacc/test/quote_calc4-s.output head/contrib/byacc/test/quote_calc4-s.tab.c head/contrib/byacc/test/quote_calc4-s.tab.h head/contrib/byacc/test/quote_calc4.output head/contrib/byacc/test/quote_calc4.tab.c head/contrib/byacc/test/quote_calc4.tab.h Modified: head/contrib/byacc/CHANGES head/contrib/byacc/VERSION head/contrib/byacc/aclocal.m4 head/contrib/byacc/closure.c head/contrib/byacc/config_h.in head/contrib/byacc/configure head/contrib/byacc/configure.in head/contrib/byacc/defs.h head/contrib/byacc/descrip.mms head/contrib/byacc/error.c head/contrib/byacc/graph.c head/contrib/byacc/lalr.c head/contrib/byacc/lr0.c head/contrib/byacc/main.c head/contrib/byacc/makefile.in head/contrib/byacc/mkpar.c head/contrib/byacc/output.c head/contrib/byacc/package/byacc.spec head/contrib/byacc/package/debian/changelog head/contrib/byacc/package/mingw-byacc.spec head/contrib/byacc/package/pkgsrc/Makefile head/contrib/byacc/reader.c head/contrib/byacc/symtab.c head/contrib/byacc/test/calc2.y head/contrib/byacc/test/calc3.y head/contrib/byacc/test/run_lint.sh head/contrib/byacc/test/run_make.sh head/contrib/byacc/test/run_test.sh head/contrib/byacc/verbose.c head/contrib/byacc/vmsbuild.com head/contrib/byacc/yacc.1 head/usr.bin/yacc/Makefile Directory Properties: head/contrib/byacc/ (props changed) Modified: head/contrib/byacc/CHANGES ============================================================================== --- head/contrib/byacc/CHANGES Wed Apr 23 05:54:55 2014 (r264802) +++ head/contrib/byacc/CHANGES Wed Apr 23 05:57:45 2014 (r264803) @@ -1,9 +1,648 @@ +2014-04-09 Rick.Spates + + * main.c, defs.h: patch to allow DEBUG build with WIN32 system + +2014-04-09 Thomas E. Dickey + + * output.c, reader.c: gcc warnings + + * reader.c: fix const-cast warnings + + * test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/code_error.tab.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/error.tab.c, test/btyacc/rename_debug.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.tab.c, output.c: + fix a few clang --analyze warnings; one was a case where output_ctable emitted + an empty table (which should be an error). + + * reader.c: appease clang --analyze + + * defs.h: mark two functions as no-return. + + * package/debian/changelog: reason for release + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + + * makefile.in: use $LINT_OPTS from environment via configure script + + * test/btyacc/ok_syntax1.output, test/btyacc/ok_syntax1.tab.c, test/yacc/ok_syntax1.tab.c, test/ok_syntax1.y, test/yacc/ok_syntax1.output: + tweaks to make generated files from ok_syntax1.y compile with check_make rule + + * test/btyacc/rename_debug.c, test/btyacc/rename_debug.error, test/btyacc/rename_debug.h, test/btyacc/rename_debug.i, test/btyacc/rename_debug.output, test/yacc/rename_debug.c: + reference output for testing + + * test/run_test.sh: + retain the renaming done for code_debug.y so that check_make will work. + + * test/yacc/rename_debug.error, test/yacc/rename_debug.h, test/yacc/rename_debug.i, test/yacc/rename_debug.output: + reference output for testing + + * test/btyacc/ok_syntax1.error: RCS_BASE + + * test/yacc/quote_calc4-s.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/ok_syntax1.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, yaccpar.c: + regen + + * yacc.1: + clarify relationship of btyacc features to default configuration. + +2014-04-08 Thomas E. Dickey + + * test/yacc/ok_syntax1.output, test/yacc/ok_syntax1.tab.c, test/yacc/ok_syntax1.tab.h, test/btyacc/ok_syntax1.output, test/btyacc/ok_syntax1.tab.c, test/btyacc/ok_syntax1.tab.h: + reference output for testing + + * test/ok_syntax1.y: RCS_BASE + + * test/yacc/ok_syntax1.error: reference output for testing + + * test/yacc/big_b.error, test/yacc/big_b.output, test/yacc/big_l.error, test/yacc/big_l.output, test/btyacc/big_b.error, test/btyacc/big_b.output, test/btyacc/big_l.error, test/btyacc/big_l.output, test/run_test.sh: + exercise -L/-B options + + * test/yacc/code_debug.c, test/btyacc/code_debug.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax27.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/q uote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.tab.c, test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax26.tab.c, test/btyacc/err_syntax27.t ab.c, test/btyacc/err_syntax3.tab.c, test/bt! yacc/err_syntax4.tab.c, test/btyacc/err_syntax5.tab.c, test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax7.tab.c, test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7b.tab.c, test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8a.tab.c, test/btyacc/err_syntax9.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.t ab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/run_test.sh, test/yacc/no_b_opt1.output: + use a better renaming of the YYPATCH definition (none of the test-cases rely + upon it, but redefinition in the "make check_make" rule is a problem). + + * test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax26.tab.c, test/btyacc/err_syntax27.tab.c, test/btyacc/err_syntax3.tab.c, test/btyacc/err_syntax4.tab.c, test/btyacc/err_syntax5.tab.c, test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax7.tab.c, test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7b.tab.c, test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8a.tab.c, test/btyacc/err_syntax9.tab.c, test/btyacc/varsyntax_calc1.tab.c: + undid temporary reordering in reader() by Tom Shields to align with byacc outputs + + * test/run_test.sh: remove a repeated test-case + + * mstring.c: minor reformatting to make coverage analysis simpler + +2014-04-07 Thomas E. Dickey + + * test/run_test.sh: tidy + + * test/yacc/help.error, test/yacc/help.output, test/yacc/no_b_opt.error, test/yacc/no_b_opt.output, test/yacc/no_b_opt1.error, test/yacc/no_b_opt1.output, test/yacc/no_code_c.error, test/yacc/no_code_c.output, test/yacc/no_defines.error, test/yacc/no_defines.output, test/yacc/no_graph.error, test/yacc/no_graph.output, test/yacc/no_include.error, test/yacc/no_include.output, test/yacc/no_opts.error, test/yacc/no_opts.output, test/yacc/no_output.error, test/yacc/no_output.output, test/yacc/no_output1.error, test/yacc/no_output1.output, test/yacc/no_output2.error, test/yacc/no_output2.output, test/yacc/no_p_opt.error, test/yacc/no_p_opt.output, test/yacc/no_p_opt1.error, test/yacc/no_p_opt1.output, test/yacc/no_verbose.error, test/yacc/no_verbose.output, test/yacc/nostdin.error, test/yacc/nostdin.output, test/yacc/test-no_b_opt1.output: + reference output for testing + + * test/run_test.sh: + add special checks for flags which depend on writable/existing files + + * test/btyacc/no_b_opt1.output, test/btyacc/no_p_opt1.output, test/btyacc/no_b_opt.error, test/btyacc/no_b_opt.output, test/btyacc/no_b_opt1.error, test/btyacc/no_code_c.output, test/btyacc/no_p_opt.error, test/btyacc/no_p_opt.output, test/btyacc/no_p_opt1.error, test/btyacc/no_output2.output, test/btyacc/no_code_c.error, test/btyacc/no_output2.error, test/btyacc/no_include.error, test/btyacc/no_include.output, test/btyacc/no_defines.output, test/btyacc/no_defines.error, test/btyacc/no_verbose.output, test/btyacc/no_graph.output, test/btyacc/no_graph.error, test/btyacc/no_opts.error, test/btyacc/no_opts.output, test/btyacc/no_verbose.error, test/btyacc/nostdin.error, test/btyacc/nostdin.output, test/btyacc/no_output.error, test/btyacc/no_output.output, test/btyacc/no_output1.error, test/btyacc/no_output1.output: + reference output for testing + + * main.c: + change CREATE_FILE_NAMES() to use local function rather than inline code, + to simplify coverage analysis. + + * test/btyacc/err_syntax27.error, test/btyacc/err_syntax27.output, test/btyacc/err_syntax27.tab.c, test/btyacc/err_syntax27.tab.h, test/btyacc/help.error, test/btyacc/help.output, test/yacc/err_syntax27.error, test/yacc/err_syntax27.output, test/yacc/err_syntax27.tab.c, test/yacc/err_syntax27.tab.h: + reference output for testing + + * test/err_syntax27.y: testcase for missing_brace() + + * error.c: ifdef'd non-btyacc function + + * lr0.c: ifdef'd debug-code + + * yaccpar.skel: use YYINT's to replace short's as in btyaccpar.skel + + * test/btyacc/code_debug.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/c alc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/co de_debug.c, test/yacc/code_error.code.c, tes! t/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, output.c, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/run_test.sh: + 2010/11/26 simplification of output.c using putc_code() and putl_code() + omitted an adjustment of the #line value used for code-file. Fix that. + Also, amend 2005/05/04 change to run_test.sh to retain a dummy line for + YYPATCH #define's to make test-outputs easier to compare #line's (report + by Tom Shields) + +2014-04-06 Thomas E. Dickey + + * reader.c: fix for valgrind + (the calloc's are intentional - valgrind reported use of uninitialized memory) + + * lr0.c, output.c: fix for valgrind + + * test/btyacc/code_debug.c, test/btyacc/code_debug.error, test/btyacc/code_debug.h, test/btyacc/code_debug.i, test/btyacc/code_debug.output: + RCS_BASE + + * test/yacc/code_debug.c, test/yacc/code_debug.h: + exercise the -i option + + * test/yacc/code_debug.i: reference output for testing + + * test/run_test.sh: exercise the -i option + + * test/yacc/code_debug.c: reference output for testing + + * test/run_test.sh: exercise the "-o" option + + * test/yacc/code_debug.error, test/yacc/code_debug.h, test/yacc/code_debug.output: + reference output for testing + + * output.c: don't call exit() without giving a chance to cleanup. + + * mstring.c: ifdef'd functions not used in byacc + + * btyaccpar.c: generated from btyaccpar.skel + + * yaccpar.c: generated from yaccpar.skel + + * skel2c: + change the generated-by comment to show which version of this script (and + which version of the given skeleton file) were used to produce the C-file. + + * configure: regen + + * makefile.in: + add rules to generate byacc and btyacc parser skeleton files independently + + * aclocal.m4: CF_PROG_AWK - add to byacc's configure script + CF_INTEL_COMPILER + cleanup the -no-gcc option which was leftover from testing - prcs does + not build with this option. + CF_MAKE_DOCS + protect $2 from substitution, for luit's "$(manext)" + CF_XOPEN_SOURCE + for Solaris (tested with gcc/g++ 3.4.3 on Solaris 10 and gcc/g++ 4.5.2 + on Solaris 11), suppress the followup check for defining _XOPEN_SOURCE + because it is not needed, as well as because g++ 4.7.3 (no package, + used in Sage for Solaris 10) has some unspecified header breakage which + is triggered by the duplicate definition. + + * configure.in: + modify so skeleton-source is determined by configure options rather than by + having developer rename yaccpar.skel.old to yaccpar.skel + + * descrip.mms: rename skeleton + + * vmsbuild.com: + fwiw, renamed the skeleton for consistency with makefile + + * skel2c, skeleton.c: resync skeleton and its generating files + + * yaccpar.skel: + renamed yaccpar.skel.old to yaccpar.skel, to allow using makefile suffix rules + + * yaccpar.skel.old: resync skeleton and its generating files + + * test/run_make.sh: improve cleanup after error recovery + + * test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, output.c, skeleton.c, defs.h: + use improvement from Tom Shield's btyacc changes, getting rid of special cases for generating two yyerror calls in skeleton + + * output.c: simplify output_yyerror_decl() + + * test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.tab.c, test/yacc/code_error.tab.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, output.c: + add second "const" to string-table declarations, from Tom Shield's btyacc changes + + * test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c: + discard unnecessary call on write_code_lineno() from Tom Shield's changes + + * test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_calc.tab.c, test/yacc/code_error.code.c, test/yacc/code_error.tab.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, output.c: + use YYINT typedef from Tom Shield's btyacc changes to replace explicit "short" + + * test/yacc/code_calc.code.c, test/yacc/code_error.code.c, output.c: + use fix from Tom Shield's btyacc changes: remove redundant extern-declaration for YYPARSE_DECL() + + * test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c: + discard unnecessary call on write_code_lineno() from Tom Shield's changes + + * output.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/code_calc.tab.c, test/yacc/code_error.tab.c: + use fix from Tom Shield's btyacc changes: prefix-definitions went to the + output (.tab.c) file in a case where they should have gone to the code + (.code.c) file. Remove now-redundant call to output_prefix(). + + * main.c: do the same for help-message + + * main.c: use OUTPUT_SUFFIX symbol in an overlooked case + + * test/run_make.sh: + modify to avoid use of VPATH, which has no standard implementation + +2014-04-05 Thomas E. Dickey + + * test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c: + discard a change which merged CountLines() with explicit comparisons against + code_file because that adds extra to the #line values + + * test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/calc.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/error.tab.c, output.c: + add Tom Shield's change to allow definition of YYSTYPE_IS_DECLARED symbol to + override fallback typedef for YYSTYPE when that symbol is undefined + + * test/btyacc/error.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c: + minor tweak to coding style - use parenthesis for "defined" operator's parameter + + * test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c: + regen to make YYMAXTOKEN and YYUNDFTOKEN adjacent + + * test/yacc/err_syntax20.tab.c, test/yacc/grammar.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_calc.tab.c, test/yacc/code_error.code.c, test/yacc/code_error.tab.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c: + regen after adding the YYUNDFTOKEN symbol + + * output.c: + integrate Tom Shield's btyacc changes which introduce the YYUNDFTOKEN symbol + (I changed order of output to keep this adjacent to YYMAXTOKEN) + + * reader.c: + merge all but one small change from Tom Shield's btyacc changes - that + changes the order of code-file in the tests. + + * test/btyacc/btyacc_demo.tab.c: regen + + * test/btyacc_demo.y: fix prototypes + +2014-04-04 Thomas E. Dickey + + * reader.c, defs.h, main.c: + more merging of Tom Shield's btyacc changes. In the merge, I moved the + symbol_pval inside the btyacc ifdef's and added some more btyacc ifdefs + +2014-04-03 Thomas E. Dickey + + * reader.c: + merge-in 3/4 of btyacc's changes, deferring those which change test-outputs. + Tom Shield's changes split-out copy_string() and copy_comment() functions + to simplify some logic, as well as adding btyacc-only chunks + + * makefile.in: build mstring.o, needed for changes in reader.c + + * output.c: + merge-in all of btyacc's changes which do not change byacc's test-output. + Some of the merge uses ifdef-changes which I applied to ongoing resync, + e.g., the introduction of PER_STATE. + +2014-04-02 Thomas E. Dickey + + * test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c: regen + + * output.c: fix typo + + * output.c, reader.c: + merge in some chunks of reader and output files which do not affect byacc tests + + * test/yacc/calc2.tab.c, test/yacc/calc3.tab.c: regen + + * test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test /yacc/err_syntax17.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, skeleton.c: + incorporate YYENOMEM and YYEOF symbols from btyacc + + * output.c: merge chunk from btyacc changes for header-guards + + * btyaccpar.skel: RCS_BASE + + * yaccpar.skel: comment-out yysccsid[], for FreeBSD build-issues + remove GCC_UNUSED to reduce name-pollution as well as being simpler + + * main.c: + move a btyacc symbol outside ifdef to work around current state of merge + + * defs.h: + add USE_HEADER_GUARDS to defer whether to modify byacc's header-output + + * test/run_make.sh: + do not try to compile files used for testing syntax-errors, since they are + likely to be incomplete + +2014-04-02 Tom.Shields + + * main.c: changes for btyacc + +2014-04-01 Thomas E. Dickey + + * reader.c: + integrate change by Tom Shields to use bsearch rather than successive + calls to matchec() + + * defs.h: typedef __compar_fn_t is unnecessary + + * test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c: + omit the GCC_UNUSED, as noted by Tom Shields not really essential + +2014-04-01 Tom.Shields + + * verbose.c: changes for btyacc, ifdef'd + +2014-04-01 Thomas E. Dickey + + * mkpar.c: eliminate most of the ifdef's using macros + +2014-04-01 Tom.Shields + + * mkpar.c: merge btyacc changes (ifdef'd - no change to byacc) + + * error.c: + new functions used for reporting errors from the btyacc configuration + (I reordered some, and ifdef'd the new ones -TD) + +2014-03-31 Thomas E. Dickey + + * test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c: + omit the GCC_UNUSED, as noted by Tom Shields not really essential + + * test/btyacc/empty.tab.c, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.tab.c: + regen + +2014-03-29 Thomas E. Dickey + + * test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/y acc/err_syntax1.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax21.tab.c, skeleton.c: + comment-out yysccsid in the banner because it produces unnecessary compiler + warnings. The suggested alternative (using #pragma ident) in the preceding + comment is also obsolete; remove that comment (request by Gleb Smirnoff). + + * test/run_test.sh: + for yacc, ignore the inherit testcases, since they are btyacc-specific + +2014-03-28 Thomas E. Dickey + + * test/yacc/varsyntax_calc1.error, test/yacc/varsyntax_calc1.output, test/yacc/varsyntax_calc1.tab.c, test/yacc/varsyntax_calc1.tab.h, test/yacc/err_inherit3.error, test/yacc/err_inherit3.output, test/yacc/err_inherit3.tab.c, test/yacc/err_inherit3.tab.h, test/yacc/err_inherit4.error, test/yacc/err_inherit4.output, test/yacc/err_inherit4.tab.c, test/yacc/err_inherit4.tab.h, test/yacc/err_inherit5.error, test/yacc/err_inherit5.output, test/yacc/err_inherit5.tab.c, test/yacc/err_inherit5.tab.h, test/yacc/inherit0.error, test/yacc/inherit0.output, test/yacc/inherit0.tab.c, test/yacc/inherit0.tab.h, test/yacc/inherit1.error, test/yacc/inherit1.output, test/yacc/inherit1.tab.c, test/yacc/inherit1.tab.h, test/yacc/inherit2.error, test/yacc/inherit2.output, test/yacc/inherit2.tab.c, test/yacc/inherit2.tab.h, test/yacc/empty.error, test/yacc/empty.output, test/yacc/empty.tab.c, test/yacc/empty.tab.h, test/yacc/err_inherit1.error, test/yacc/err_inherit1.output, test/yacc/err_inherit1.tab.c, test/yacc/err_inherit1.tab.h, test/yacc/err_inherit2.error, test/yacc/err_inherit2.output, test/yacc/err_inherit2.tab.c, test/yacc/err_inherit2.tab.h: + reference output for testing + + * test/run_lint.sh, test/run_make.sh, test/run_test.sh: + moving #define's out of makefile broke check for yacc vs btyacc (fix) + +2014-03-28 Tom.Shields + + * test/btyacc/btyacc_demo.tab.c, test/btyacc/err_inherit3.error, test/btyacc/err_inherit3.output, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit3.tab.h, test/btyacc/err_inherit2.error, test/btyacc/err_inherit2.output, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit2.tab.h, test/btyacc/err_inherit4.error, test/btyacc/err_inherit4.output, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit4.tab.h, test/btyacc/err_inherit5.error, test/btyacc/err_inherit5.output, test/btyacc/err_inherit5.tab.c, test/btyacc/err_inherit5.tab.h, test/btyacc/inherit0.error, test/btyacc/inherit0.output, test/btyacc/inherit0.tab.c, test/btyacc/inherit0.tab.h, test/btyacc/inherit1.error, test/btyacc/inherit1.output, test/btyacc/inherit1.tab.c, test/btyacc/inherit1.tab.h, test/btyacc/inherit2.error, test/btyacc/inherit2.output, test/btyacc/inherit2.tab.c, test/btyacc/inherit2.tab.h, test/btyacc/calc.error, test/btyacc/err_inherit1.error, test/btyacc/err_inherit1.output, test/btyacc/err_inh erit1.tab.c, test/btyacc/err_inherit1.tab.h: + reference output for testing + + * defs.h: new functions/variables for btyacc + (I reordered and ifdef'd -TD) + + * test/inherit0.y, test/inherit1.y: testcase for btyacc + +2014-03-27 Tom.Shields + + * test/err_inherit5.y, test/err_inherit4.y, test/err_inherit3.y, test/err_inherit2.y, test/err_inherit1.y, test/inherit2.y: + testcase for btyacc + +2014-03-25 Tom.Shields + + * symtab.c: extra initialization needed for btyacc + (I ifdef'd -TD) + + * yacc.1: document -L/-B features from btyacc + +2014-03-25 Thomas E. Dickey + + * yacc.1: typo + + * configure: regen + + * configure.in: + modified new options to act like those in my other configure-scripts, e.g., + showing what option is being tested, and the resulting value. Put the + definitions in config.h rather than in the makefile. + +2014-03-25 Tom.Shields + + * makefile.in: add/use LINTFLAGS variable + make all of the objects (not just skeleton) rebuild if makefile changes + modify check-rule to reflect updates to run_test.sh vs subdirectory + + * mstring.c: byacc-btyacc-20140323 + +2014-03-25 Thomas E. Dickey + + * test/btyacc/RCS, test/yacc/RCS: PERMIT FILE + + * config_h.in: updated with autoheader-252 + +2014-03-25 Tom.Shields + + * README.BTYACC: byacc-btyacc-20140323 + +2014-03-24 Tom.Shields + + * test/btyacc/err_syntax1.output, test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax1.tab.h, test/btyacc/err_syntax10.error, test/btyacc/err_syntax10.output, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax10.tab.h, test/btyacc/err_syntax11.error, test/btyacc/err_syntax11.output, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax11.tab.h, test/btyacc/err_syntax12.error, test/btyacc/err_syntax12.output, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax12.tab.h, test/btyacc/err_syntax13.error, test/btyacc/err_syntax13.output, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax13.tab.h, test/btyacc/err_syntax14.error, test/btyacc/err_syntax14.output, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax14.tab.h, test/btyacc/err_syntax15.error, test/btyacc/err_syntax15.output, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax15.tab.h, test/btyacc/err_syntax16.error, test/btyacc/err_syntax16.output, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax16.tab. h, test/btyacc/err_syntax17.error, test/btyacc/err_syntax17.output, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax17.tab.h, test/btyacc/err_syntax18.error, test/btyacc/err_syntax18.output, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax18.tab.h, test/btyacc/err_syntax19.error, test/btyacc/err_syntax19.output, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax19.tab.h, test/btyacc/err_syntax2.output, test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax2.tab.h, test/btyacc/err_syntax20.error, test/btyacc/err_syntax20.output, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax20.tab.h, test/btyacc/err_syntax21.error, test/btyacc/err_syntax21.output, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax21.tab.h, test/btyacc/err_syntax22.error, test/btyacc/err_syntax22.output, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax22.tab.h, test/btyacc/err_syntax23.error, test/btyacc/err_syntax23.output, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax23.tab. h, test/btyacc/err_syntax24.error, test/btya! cc/err_syntax24.output, test/btyacc/err_syntax24.tab.c, test/btyacc/err_syntax24.tab.h, test/btyacc/err_syntax25.error, test/btyacc/err_syntax25.output, test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax25.tab.h, test/btyacc/err_syntax26.error, test/btyacc/err_syntax26.output, test/btyacc/err_syntax26.tab.c, test/btyacc/err_syntax26.tab.h, test/btyacc/err_syntax3.output, test/btyacc/err_syntax3.tab.c, test/btyacc/err_syntax3.tab.h, test/btyacc/err_syntax4.output, test/btyacc/err_syntax4.tab.c, test/btyacc/err_syntax4.tab.h, test/btyacc/err_syntax5.output, test/btyacc/err_syntax5.tab.c, test/btyacc/err_syntax5.tab.h, test/btyacc/err_syntax6.output, test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax6.tab.h, test/btyacc/err_syntax7.output, test/btyacc/err_syntax7.tab.c, test/btyacc/err_syntax7.tab.h, test/btyacc/err_syntax7a.output, test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7a.tab.h, test/btyacc/err_syntax7b.output, test/btyacc/err_syntax7b.tab.c, test/btyacc/err_syn tax7b.tab.h, test/btyacc/err_syntax8.output, test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8.tab.h, test/btyacc/err_syntax8a.output, test/btyacc/err_syntax8a.tab.c, test/btyacc/err_syntax8a.tab.h, test/btyacc/err_syntax9.output, test/btyacc/err_syntax9.tab.c, test/btyacc/err_syntax9.tab.h: + reference output for testing + +2014-03-24 Thomas E. Dickey + + * defs.h: fix compiler warnings due to mputc() + +2014-03-23 Tom.Shields + + * test/btyacc_demo.y: testcase for btyacc + + * test/btyacc/varsyntax_calc1.error, test/btyacc/varsyntax_calc1.output, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/varsyntax_calc1.tab.h: + reference output for testing + + * test/varsyntax_calc1.y, test/btyacc_calc1.y: testcase for btyacc + +2014-03-23 Thomas E. Dickey + + * test/err_syntax26.error, test/err_syntax26.output, test/err_syntax26.tab.c, test/err_syntax26.tab.h, test/yacc/err_syntax26.error, test/yacc/err_syntax26.output, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax26.tab.h: + reference output for testing + + * test/err_syntax26.y: testcase for missing_brace() + + * test/err_syntax25.error, test/err_syntax25.output, test/err_syntax25.tab.c, test/err_syntax25.tab.h, test/yacc/err_syntax25.error, test/yacc/err_syntax25.output, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax25.tab.h: + reference output for testing + + * test/err_syntax25.y: testcase for over_unionized() + + * test/err_syntax24.error, test/err_syntax24.output, test/err_syntax24.tab.c, test/err_syntax24.tab.h, test/yacc/err_syntax24.error, test/yacc/err_syntax24.output, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax24.tab.h: + reference output for testing + + * test/err_syntax24.y: testcase for default_action_warning() + +2014-03-23 Tom.Shields + + * test/btyacc/quote_calc3-s.error, test/btyacc/quote_calc4-s.error, test/btyacc/quote_calc4.error, test/btyacc/grammar.dot, test/btyacc/grammar.error, test/btyacc/pure_calc.error, test/btyacc/pure_error.error, test/btyacc/quote_calc-s.error, test/btyacc/quote_calc.error, test/btyacc/quote_calc2-s.error, test/btyacc/quote_calc2.error, test/btyacc/quote_calc3.error, test/btyacc/err_syntax2.error, test/btyacc/err_syntax3.error, test/btyacc/err_syntax4.error, test/btyacc/err_syntax5.error, test/btyacc/err_syntax6.error, test/btyacc/err_syntax7.error, test/btyacc/err_syntax7a.error, test/btyacc/err_syntax7b.error, test/btyacc/err_syntax8.error, test/btyacc/err_syntax8a.error, test/btyacc/err_syntax9.error, test/btyacc/error.error, test/btyacc/calc1.error, test/btyacc/calc2.error, test/btyacc/calc3.error, test/btyacc/code_calc.error, test/btyacc/code_error.error, test/btyacc/empty.error, test/btyacc/err_syntax1.error, test/btyacc/btyacc_calc1.error, test/btyacc/btyacc_demo.error: + reference output for testing + +2014-03-23 Thomas E. Dickey + + * test/err_syntax23.error, test/err_syntax23.output, test/err_syntax23.tab.c, test/err_syntax23.tab.h, test/yacc/err_syntax23.error, test/yacc/err_syntax23.output, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax23.tab.h: + reference output for testing + + * test/err_syntax23.y: testcase for untyped_lhs() + +2014-03-23 Tom.Shields + + * test/run_test.sh: + move test-outputs into subdirectories to keep btyacc/yacc results separate + +2014-03-23 Thomas E. Dickey + + * test/err_syntax22.error, test/err_syntax22.output, test/err_syntax22.tab.c, test/err_syntax22.tab.h, test/yacc/err_syntax22.error, test/yacc/err_syntax22.output, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax22.tab.h: + reference output for testing + + * test/err_syntax22.y: testcase for untyped_rhs() + + * test/err_syntax21.error, test/err_syntax21.output, test/err_syntax21.tab.c, test/err_syntax21.tab.h, test/yacc/err_syntax21.error, test/yacc/err_syntax21.output, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax21.tab.h, test/err_syntax20.error, test/err_syntax20.output, test/err_syntax20.tab.c, test/err_syntax20.tab.h, test/yacc/err_syntax20.error, test/yacc/err_syntax20.output, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax20.tab.h: + reference output for testing + + * test/err_syntax20.y: testcase for undefined_symbol_warning() + + * test/err_syntax21.y: testcase for unknown_rhs() + + * test/err_syntax19.error, test/err_syntax19.output, test/err_syntax19.tab.c, test/err_syntax19.tab.h, test/yacc/err_syntax19.error, test/yacc/err_syntax19.output, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax19.tab.h: + reference output for testing + + * test/err_syntax19.y: testcase for dollar_error() + + * test/err_syntax18.error, test/err_syntax18.output, test/err_syntax18.tab.c, test/err_syntax18.tab.h, test/yacc/err_syntax18.error, test/yacc/err_syntax18.output, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax18.tab.h: + reference output for testing + + * test/err_syntax18.y: testcase for dollar_warning() + + * test/err_syntax17.error, test/err_syntax17.output, test/err_syntax17.tab.c, test/err_syntax17.tab.h, test/yacc/err_syntax17.error, test/yacc/err_syntax17.output, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax17.tab.h: + reference output for testing + + * test/err_syntax17.y: testcase for unterminated_action() + +2014-03-22 Thomas E. Dickey + + * test/err_syntax16.error, test/err_syntax16.output, test/err_syntax16.tab.c, test/err_syntax16.tab.h, test/yacc/err_syntax16.error, test/yacc/err_syntax16.output, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax16.tab.h: + reference output for testing + + * test/err_syntax16.y: testcase for terminal_lhs() + + * test/err_syntax15.error, test/err_syntax15.output, test/err_syntax15.tab.c, test/err_syntax15.tab.h, test/yacc/err_syntax15.error, test/yacc/err_syntax15.output, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax15.tab.h: + reference output for testing + + * test/err_syntax15.y: testcase for no_grammar() + + * test/err_syntax14.error, test/err_syntax14.output, test/err_syntax14.tab.c, test/err_syntax14.tab.h, test/yacc/err_syntax14.error, test/yacc/err_syntax14.output, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax14.tab.h: + reference output for testing + + * test/err_syntax14.y: + testcase for restarted_warning() and undefined_goal() + + * test/err_syntax13.error, test/err_syntax13.output, test/err_syntax13.tab.c, test/err_syntax13.tab.h, test/yacc/err_syntax13.error, test/yacc/err_syntax13.output, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax13.tab.h: + reference output for testing + + * test/err_syntax13.y: testcase for terminal_start() + + * test/err_syntax12.error, test/err_syntax12.output, test/err_syntax12.tab.c, test/err_syntax12.tab.h, test/yacc/err_syntax12.error, test/yacc/err_syntax12.output, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax12.tab.h: + reference output for testing + + * test/err_syntax12.y: testcase for revalued_warning() + + * test/err_syntax11.error, test/err_syntax11.output, test/err_syntax11.tab.c, test/err_syntax11.tab.h, test/yacc/err_syntax11.error, test/yacc/err_syntax11.output, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax11.tab.h: + reference output for testing + + * test/err_syntax11.y: testcase for reprec_warning() + + * test/err_syntax10.error, test/err_syntax10.output, test/err_syntax10.tab.c, test/err_syntax10.tab.h, test/yacc/err_syntax10.error, test/yacc/err_syntax10.output, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax10.tab.h: + reference output for testing + + * test/err_syntax10.y: testcase for retyped_warning() + +2014-03-21 Thomas E. Dickey + + * test/err_syntax9.error, test/err_syntax9.output, test/err_syntax9.tab.c, test/err_syntax9.tab.h, test/yacc/err_syntax9.error, test/yacc/err_syntax9.output, test/yacc/err_syntax9.tab.c, test/yacc/err_syntax9.tab.h: + reference output for testing + + * test/err_syntax9.y: testcase for tokenized_start() + + * test/err_syntax8.error, test/err_syntax8.output, test/err_syntax8.tab.c, test/err_syntax8.tab.h, test/err_syntax8a.error, test/err_syntax8a.output, test/err_syntax8a.tab.c, test/err_syntax8a.tab.h, test/yacc/err_syntax8.error, test/yacc/err_syntax8.output, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8.tab.h, test/yacc/err_syntax8a.error, test/yacc/err_syntax8a.output, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax8a.tab.h: + reference output for testing + + * test/err_syntax8a.y, test/err_syntax8.y: testcase for used_reserved() + + * test/err_syntax7.error, test/err_syntax7.output, test/err_syntax7.tab.c, test/err_syntax7.tab.h, test/err_syntax7a.error, test/err_syntax7a.output, test/err_syntax7a.tab.c, test/err_syntax7a.tab.h, test/err_syntax7b.error, test/err_syntax7b.output, test/err_syntax7b.tab.c, test/err_syntax7b.tab.h, test/yacc/err_syntax7.error, test/yacc/err_syntax7.output, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7.tab.h, test/yacc/err_syntax7a.error, test/yacc/err_syntax7a.output, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7a.tab.h, test/yacc/err_syntax7b.error, test/yacc/err_syntax7b.output, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax7b.tab.h: + reference output for testing + + * test/err_syntax7b.y, test/err_syntax7a.y, test/err_syntax7.y: + testcase for illegal_character() + + * test/err_syntax6.error, test/err_syntax6.output, test/err_syntax6.tab.c, test/err_syntax6.tab.h, test/yacc/err_syntax6.error, test/yacc/err_syntax6.output, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax6.tab.h: + reference output for testing + + * test/err_syntax6.y: testcase for illegal_tag() + + * test/err_syntax5.error, test/err_syntax5.output, test/err_syntax5.tab.c, test/err_syntax5.tab.h, test/yacc/err_syntax5.error, test/yacc/err_syntax5.output, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax5.tab.h: + reference output for testing + + * test/err_syntax5.y: testcase for unterminated_union() + + * test/err_syntax4.error, test/err_syntax4.output, test/err_syntax4.tab.c, test/err_syntax4.tab.h, test/yacc/err_syntax4.error, test/yacc/err_syntax4.output, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax4.tab.h: + reference output for testing + + * test/err_syntax4.y: testcase for unterminated_text() + + * test/err_syntax3.error, test/err_syntax3.output, test/err_syntax3.tab.c, test/err_syntax3.tab.h, test/yacc/err_syntax3.error, test/yacc/err_syntax3.output, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax3.tab.h: + reference output for testing + + * test/err_syntax3.y: testcase for unterminated_string() + + * test/err_syntax2.error, test/err_syntax2.output, test/err_syntax2.tab.c, test/err_syntax2.tab.h, test/yacc/err_syntax2.error, test/yacc/err_syntax2.output, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax2.tab.h: + reference output for testing + + * test/err_syntax2.y: testcase for unterminated_comment() + + * test/err_syntax1.error, test/yacc/err_syntax1.error: + reference output for testing + + * test/err_syntax1.y: + test-case with syntax error (and nonprinting character) + + * test/calc.error, test/calc1.error, test/calc2.error, test/calc3.error, test/code_calc.error, test/code_error.error, test/err_syntax1.error, test/error.error, test/grammar.error, test/pure_calc.error, test/pure_error.error, test/quote_calc-s.error, test/quote_calc.error, test/quote_calc2-s.error, test/quote_calc2.error, test/quote_calc3-s.error, test/quote_calc3.error, test/quote_calc4-s.error, test/quote_calc4.error, test/yacc/calc.error, test/yacc/calc1.error, test/yacc/calc2.error, test/yacc/calc3.error, test/yacc/code_calc.error, test/yacc/code_error.error, test/yacc/error.error, test/yacc/grammar.error, test/yacc/pure_calc.error, test/yacc/pure_error.error, test/yacc/quote_calc-s.error, test/yacc/quote_calc.error, test/yacc/quote_calc2-s.error, test/yacc/quote_calc2.error, test/yacc/quote_calc3-s.error, test/yacc/quote_calc3.error, test/yacc/quote_calc4-s.error, test/yacc/quote_calc4.error: + reference output for testing + + * test/run_test.sh: + save stderr to reference files, to capture shift/reduce messages as well + as syntax-error messages + + * test/err_syntax1.output, test/err_syntax1.tab.c, test/err_syntax1.tab.h, test/yacc/err_syntax1.output, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax1.tab.h: + reference output for testing + + * test/run_test.sh: generate a ".dot" file for the grammar file + + * test/grammar.dot: RCS_BASE + + * test/yacc/grammar.dot: reference output for testing + +2014-03-19 Tom.Shields + + * output.c: rename MAXSHORT to MAXYYINT + +2014-03-18 Tom.Shields + + * yaccpar.skel: skeleton with btyacc additions + + * NOTES-btyacc-Changes: byacc-btyacc-20140323 + + * test/btyacc/btyacc_calc1.output, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_calc1.tab.h: + reference output for testing + + * test/run_make.sh: + move test-outputs into subdirectories to keep btyacc/yacc results separate + + * test/btyacc/pure_calc.tab.c, test/btyacc/pure_calc.tab.h, test/btyacc/pure_error.output, test/btyacc/pure_error.tab.c, test/btyacc/pure_error.tab.h, test/btyacc/quote_calc-s.output, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc-s.tab.h, test/btyacc/quote_calc.output, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc.tab.h, test/btyacc/quote_calc2-s.output, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2-s.tab.h, test/btyacc/quote_calc2.output, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc2.tab.h, test/btyacc/quote_calc3-s.output, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3-s.tab.h, test/btyacc/quote_calc3.output, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc3.tab.h, test/btyacc/quote_calc4-s.output, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4-s.tab.h, test/btyacc/quote_calc4.output, test/btyacc/quote_calc4.tab.c, test/btyacc/quote_calc4.tab.h, test/btyacc/calc1.output, test/btyacc/calc1.tab.c, test/btyacc/calc1.tab.h, test/btyacc/calc2.output, test/btyacc/calc2.tab.c, test/btyacc/calc2.tab.h, test/btyacc/calc3.output, test/btyacc/calc3.tab.c, test/btyacc/calc3.tab.h, test/btyacc/code_calc.code.c, test/btyacc/code_calc.output, test/btyacc/code_calc.tab.c, test/btyacc/code_calc.tab.h, test/btyacc/code_error.code.c, test/btyacc/code_error.output, test/btyacc/code_error.tab.c, test/btyacc/code_error.tab.h, test/btyacc/empty.output, test/btyacc/empty.tab.c, test/btyacc/empty.tab.h, test/btyacc/error.output, test/btyacc/error.tab.c, test/btyacc/error.tab.h, test/btyacc/grammar.output, test/btyacc/grammar.tab.c, test/btyacc/grammar.tab.h, test/btyacc/pure_calc.output, test/btyacc/btyacc_demo.output, test/btyacc/btyacc_demo.tab.h, test/btyacc/calc.output, test/btyacc/calc.tab.c, test/btyacc/calc.tab.h: + reference output for testing + + * defs.h: + several changes to help decouple the use of 'short' as the type of value + used in yacc parsers. + + * NOTES-btyacc-Disposition: byacc-btyacc-20140323 + +2014-03-17 Tom.Shields + + * skel2c, yaccpar.skel, yaccpar.skel.old: RCS_BASE + + * test/run_lint.sh: + move test-outputs into subdirectories to keep btyacc/yacc results separate + + * configure.in: add --with-max-table-size and --enable-btyacc options + +2014-03-16 Tom.Shields + + * main.c: use Value_t rather than short + +2014-03-11 Tom.Shields + + * test/empty.y: testcase for btyacc + +2014-03-10 Tom.Shields + + * test/calc3.y, test/calc2.y: fix unused-variable warning + +2014-02-18 Tom.Shields + + * lr0.c, graph.c: use Value_t rather than short + + * closure.c: use Value_t rather than short + ifdef'd forward-reference prototypes to match ifdef'ing of the actual functions + + * lalr.c: rename MAXSHORT to MAXYYINT + 2014-01-01 Thomas E. Dickey * yacc.1: document %token-table, improve presentation of double-quotes * VERSION, package/byacc.spec, package/debian/changelog: bump + * test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_calc.tab.c, test/yacc/code_error.code.c, test/yacc/code_error.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c: + reference output for testing + * test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_calc.tab.c, test/code_error.code.c, test/code_error.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2-s.tab.c, test/quote_calc2.tab.c, test/quote_calc3-s.tab.c, test/quote_calc3.tab.c, test/quote_calc4-s.tab.c, test/quote_calc4.tab.c: regen @@ -248,6 +887,8 @@ * VERSION, package/debian/changelog, package/byacc.spec: bump + * test/yacc/calc1.output: reference output for testing + * test/calc1.output, test/calc1.tab.c: regen * test/calc1.y: @@ -267,6 +908,8 @@ * test/calc2.tab.c, test/calc3.tab.c, test/code_error.code.c, test/ftp.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c: regen + * test/code_debug.y: RCS_BASE + * test/calc2.y, test/calc3.y, test/code_error.y, test/ftp.y: byacc already declares yyerror @@ -359,6 +1002,9 @@ * test/quote_calc-s.output, test/quote_calc-s.tab.c, test/quote_calc-s.tab.h, test/quote_calc2-s.output, test/quote_calc2-s.tab.c, test/quote_calc2-s.tab.h, test/quote_calc3-s.output, test/quote_calc3-s.tab.c, test/quote_calc3-s.tab.h, test/quote_calc4-s.output, test/quote_calc4-s.tab.c, test/quote_calc4-s.tab.h: RCS_BASE + * test/yacc/quote_calc-s.output, test/yacc/quote_calc-s.tab.h, test/yacc/quote_calc2-s.output, test/yacc/quote_calc2-s.tab.h, test/yacc/quote_calc3-s.output, test/yacc/quote_calc3-s.tab.h, test/yacc/quote_calc4-s.output, test/yacc/quote_calc4-s.tab.h: + reference output for testing + * test/run_test.sh: generate/test with "-s" option applied. 2012-01-13 Thomas E. Dickey @@ -371,9 +1017,24 @@ * main.c: add -s option to usage message. - * test/quote_calc3.output, test/quote_calc3.tab.c, test/quote_calc4.output, test/quote_calc4.tab.c, test/quote_calc4.tab.h, test/quote_calc3.y, test/quote_calc.tab.h, test/quote_calc.output, test/quote_calc.tab.c, test/quote_calc2.output, test/quote_calc2.tab.c, test/quote_calc2.tab.h, test/quote_calc3.tab.h, test/quote_calc4.y, test/quote_calc.y, test/quote_calc2.y: + * test/quote_calc3.output, test/quote_calc3.tab.c, test/quote_calc4.output, test/quote_calc4.tab.c, test/quote_calc4.tab.h: RCS_BASE + * test/yacc/quote_calc3.output, test/yacc/quote_calc4.output, test/yacc/quote_calc4.tab.h: + reference output for testing + + * test/quote_calc3.y, test/quote_calc.tab.h: RCS_BASE + + * test/yacc/quote_calc.tab.h: reference output for testing + + * test/quote_calc.output, test/quote_calc.tab.c, test/quote_calc2.output, test/quote_calc2.tab.c, test/quote_calc2.tab.h, test/quote_calc3.tab.h: + RCS_BASE + + * test/yacc/quote_calc.output, test/yacc/quote_calc2.output, test/yacc/quote_calc2.tab.h, test/yacc/quote_calc3.tab.h: + reference output for testing + + * test/quote_calc4.y, test/quote_calc.y, test/quote_calc2.y: RCS_BASE + * configure: regen * aclocal.m4: resync with my-autoconf, i.e., fixes for CF_XOPEN_SOURCE @@ -556,6 +1217,8 @@ * output.c: simplified a little, using putc_code() and putl_code() + * test/yacc/calc1.tab.h: reference output for testing + * test/calc1.tab.h: regen * reader.c: @@ -637,9 +1300,20 @@ improve %lex-param / %parse-param implementation by allowing for arrays to be passed as parameters, e.g., "int regs[26]". - * test/calc3.tab.c, test/calc3.y, test/calc3.output, test/calc3.tab.h, test/calc2.tab.c, test/calc2.y, test/calc2.tab.h, test/calc2.output: + * test/calc3.tab.c, test/calc3.y, test/calc3.output, test/calc3.tab.h: RCS_BASE + * test/yacc/calc3.output, test/yacc/calc3.tab.h: + reference output for testing + + * test/calc2.tab.c, test/calc2.y, test/calc2.tab.h: RCS_BASE + + * test/yacc/calc2.tab.h: reference output for testing + + * test/calc2.output: RCS_BASE + + * test/yacc/calc2.output: reference output for testing + * output.c: improve %lex-param / %parse-param implementation by allowing for arrays to be passed as parameters, e.g., "int regs[26]". @@ -699,9 +1373,27 @@ provide for testing -r and -P options by checking if the ".y" filename begins with "code_" or "pure_", respectively. - * test/code_error.code.c, test/code_error.tab.c, test/code_error.tab.h, test/code_calc.code.c, test/code_calc.tab.c, test/code_calc.tab.h, test/pure_calc.output, test/pure_calc.tab.h, test/pure_error.output, test/pure_error.tab.h, test/code_calc.output, test/code_error.output: + * test/code_error.code.c, test/code_error.tab.c, test/code_error.tab.h: RCS_BASE + * test/yacc/code_error.tab.h: reference output for testing + + * test/code_calc.code.c, test/code_calc.tab.c, test/code_calc.tab.h: + RCS_BASE + + * test/yacc/code_calc.tab.h: reference output for testing + + * test/pure_calc.output, test/pure_calc.tab.h, test/pure_error.output, test/pure_error.tab.h: + RCS_BASE + + * test/yacc/pure_calc.output, test/yacc/pure_calc.tab.h, test/yacc/pure_error.output, test/yacc/pure_error.tab.h: + reference output for testing + + * test/code_calc.output, test/code_error.output: RCS_BASE + + * test/yacc/code_calc.output, test/yacc/code_error.output: + reference output for testing + * test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: regen * test/run_test.sh: @@ -1250,9 +1942,18 @@ * test/grammar.output, test/grammar.tab.c, test/grammar.tab.h: RCS_BASE + * test/yacc/grammar.output, test/yacc/grammar.tab.h: + reference output for testing + * makefile.in: turn on "make check" rule - * test/calc.output, test/run_test.sh, test/calc.tab.h: RCS_BASE + * test/calc.output: RCS_BASE + + * test/yacc/calc.output: reference output for testing + + * test/run_test.sh, test/calc.tab.h: RCS_BASE + + * test/yacc/calc.tab.h: reference output for testing * test/ftp.tab.c: yyparse() is now yyparse(void) @@ -1338,8 +2039,16 @@ 1993-02-22 unknown - * test/ftp.output, test/ftp.tab.c, test/ftp.tab.h, test/error.output, test/error.tab.c, test/error.tab.h: - RCS_BASE + * test/ftp.output, test/ftp.tab.c, test/ftp.tab.h: RCS_BASE + +1993-02-22 Thomas E. Dickey + + * test/yacc/error.output, test/yacc/error.tab.h: + reference output for testing + +1993-02-22 unknown + + * test/error.output, test/error.tab.c, test/error.tab.h: RCS_BASE * skeleton.c, warshall.c, main.c, output.c, reader.c, closure.c, NOTES: original version Copied: head/contrib/byacc/MANIFEST (from r264791, vendor/byacc/dist/MANIFEST) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/byacc/MANIFEST Wed Apr 23 05:57:45 2014 (r264803, copy of r264791, vendor/byacc/dist/MANIFEST) @@ -0,0 +1,669 @@ +MANIFEST for byacc-20140409, version t20140409 +-------------------------------------------------------------------------------- +MANIFEST this file +ACKNOWLEDGEMENTS original version of byacc - 1993 +AUTHORS nicknames for some contributors (see CHANGES for details) +Makefile.old renamed from Makefile +NEW_FEATURES original version of byacc - 1993 +NOTES original version of byacc - 1993 +NOTES-btyacc-Changes byacc-btyacc-20140323 +NOTES-btyacc-Disposition byacc-btyacc-20140323 +NO_WARRANTY original version of byacc - 1993 +README original version of byacc - 1993 +README.BTYACC byacc-btyacc-20140323 +VERSION patch-level +aclocal.m4 macros for configure-script +btyaccpar.c generated from btyaccpar.skel +btyaccpar.skel bytacc's parser skeleton (renamed from yaccpar.skel) +closure.c original version of byacc - 1993 +config.guess configure-script utility +config.sub configure-script utility +config_h.in template for config.h +configure snapshot 2004/3/28 +configure.in template for configure-script +defs.h original version of byacc - 1993 +descrip.mms build-script for VMS +error.c original version of byacc - 1993 +graph.c write the file y.dot in graphviz format +install-sh install-script +lalr.c original version of byacc - 1993 +lr0.c original version of byacc - 1993 +main.c original version of byacc - 1993 +makefile.in template for makefile +mkpar.c original version of byacc - 1993 +mstring.c string-utilities +output.c original version of byacc - 1993 +reader.c original version of byacc - 1993 +skel2c awk script to transform yaccpar.skel into skeleton.c +symtab.c original version of byacc - 1993 +verbose.c original version of byacc - 1993 +vmsbuild.com build-script for VMS +warshall.c original version of byacc - 1993 +yacc.1 original version of byacc - 1993 +yaccpar.c generated from yaccpar.skel +yaccpar.skel data which can be transformed into skeleton.c +package subdirectory +package/byacc.spec RPM file for byacc +package/debian subdirectory +package/debian/changelog scripts from Debian package +package/debian/compat scripts from Debian package +package/debian/control scripts from Debian package +package/debian/copyright scripts from Debian package +package/debian/docs scripts from Debian package +package/debian/postinst scripts from Debian package +package/debian/prerm scripts from Debian package +package/debian/rules scripts from Debian package +package/debian/source subdirectory +package/debian/source/format scripts from Debian package +package/debian subdirectory +package/debian/watch scripts from Debian package +package subdirectory +package/mingw-byacc.spec mingw spec-file, for cross-compiles +package/pkgsrc subdirectory +package/pkgsrc/DESCR scripts from NetBSD pkgsrc, for test-builds +package/pkgsrc/Makefile scripts from NetBSD pkgsrc, for test-builds +package/pkgsrc/PLIST scripts from NetBSD pkgsrc, for test-builds +package/pkgsrc/distinfo scripts from NetBSD pkgsrc, for test-builds +test subdirectory +test/README describe contents of "test" subdirectory +test/btyacc subdirectory +test/btyacc/big_b.error exercise -L/-B options +test/btyacc/big_b.output exercise -L/-B options +test/btyacc/big_l.error exercise -L/-B options +test/btyacc/big_l.output exercise -L/-B options +test/btyacc/btyacc_calc1.error reference output for testing +test/btyacc/btyacc_calc1.output reference output for testing +test/btyacc/btyacc_calc1.tab.c reference output for testing +test/btyacc/btyacc_calc1.tab.h reference output for testing +test/btyacc/btyacc_demo.error reference output for testing +test/btyacc/btyacc_demo.output reference output for testing +test/btyacc/btyacc_demo.tab.c reference output for testing +test/btyacc/btyacc_demo.tab.h reference output for testing +test/btyacc/calc.error reference output for testing +test/btyacc/calc.output reference output for testing +test/btyacc/calc.tab.c reference output for testing +test/btyacc/calc.tab.h reference output for testing +test/btyacc/calc1.error reference output for testing +test/btyacc/calc1.output reference output for testing +test/btyacc/calc1.tab.c reference output for testing +test/btyacc/calc1.tab.h reference output for testing +test/btyacc/calc2.error reference output for testing +test/btyacc/calc2.output reference output for testing +test/btyacc/calc2.tab.c reference output for testing +test/btyacc/calc2.tab.h reference output for testing +test/btyacc/calc3.error reference output for testing +test/btyacc/calc3.output reference output for testing +test/btyacc/calc3.tab.c reference output for testing +test/btyacc/calc3.tab.h reference output for testing +test/btyacc/code_calc.code.c reference output for testing +test/btyacc/code_calc.error reference output for testing +test/btyacc/code_calc.output reference output for testing +test/btyacc/code_calc.tab.c reference output for testing +test/btyacc/code_calc.tab.h reference output for testing +test/btyacc/code_debug.c reference for test-output +test/btyacc/code_debug.error reference for test-output +test/btyacc/code_debug.h reference for test-output +test/btyacc/code_debug.i reference for test-output +test/btyacc/code_debug.output reference for test-output +test/btyacc/code_error.code.c reference output for testing +test/btyacc/code_error.error reference output for testing +test/btyacc/code_error.output reference output for testing +test/btyacc/code_error.tab.c reference output for testing +test/btyacc/code_error.tab.h reference output for testing +test/btyacc/empty.error reference output for testing +test/btyacc/empty.output reference output for testing +test/btyacc/empty.tab.c reference output for testing +test/btyacc/empty.tab.h reference output for testing +test/btyacc/err_inherit1.error reference output for testing +test/btyacc/err_inherit1.output reference output for testing +test/btyacc/err_inherit1.tab.c reference output for testing +test/btyacc/err_inherit1.tab.h reference output for testing +test/btyacc/err_inherit2.error reference output for testing +test/btyacc/err_inherit2.output reference output for testing +test/btyacc/err_inherit2.tab.c reference output for testing +test/btyacc/err_inherit2.tab.h reference output for testing +test/btyacc/err_inherit3.error reference output for testing +test/btyacc/err_inherit3.output reference output for testing +test/btyacc/err_inherit3.tab.c reference output for testing +test/btyacc/err_inherit3.tab.h reference output for testing +test/btyacc/err_inherit4.error reference output for testing +test/btyacc/err_inherit4.output reference output for testing +test/btyacc/err_inherit4.tab.c reference output for testing +test/btyacc/err_inherit4.tab.h reference output for testing +test/btyacc/err_inherit5.error reference output for testing +test/btyacc/err_inherit5.output reference output for testing +test/btyacc/err_inherit5.tab.c reference output for testing +test/btyacc/err_inherit5.tab.h reference output for testing +test/btyacc/err_syntax1.error reference output for testing +test/btyacc/err_syntax1.output reference output for testing +test/btyacc/err_syntax1.tab.c reference output for testing +test/btyacc/err_syntax1.tab.h reference output for testing +test/btyacc/err_syntax10.error reference output for testing +test/btyacc/err_syntax10.output reference output for testing +test/btyacc/err_syntax10.tab.c reference output for testing +test/btyacc/err_syntax10.tab.h reference output for testing +test/btyacc/err_syntax11.error reference output for testing +test/btyacc/err_syntax11.output reference output for testing +test/btyacc/err_syntax11.tab.c reference output for testing +test/btyacc/err_syntax11.tab.h reference output for testing +test/btyacc/err_syntax12.error reference output for testing +test/btyacc/err_syntax12.output reference output for testing +test/btyacc/err_syntax12.tab.c reference output for testing +test/btyacc/err_syntax12.tab.h reference output for testing +test/btyacc/err_syntax13.error reference output for testing +test/btyacc/err_syntax13.output reference output for testing +test/btyacc/err_syntax13.tab.c reference output for testing +test/btyacc/err_syntax13.tab.h reference output for testing +test/btyacc/err_syntax14.error reference output for testing +test/btyacc/err_syntax14.output reference output for testing +test/btyacc/err_syntax14.tab.c reference output for testing +test/btyacc/err_syntax14.tab.h reference output for testing +test/btyacc/err_syntax15.error reference output for testing +test/btyacc/err_syntax15.output reference output for testing +test/btyacc/err_syntax15.tab.c reference output for testing +test/btyacc/err_syntax15.tab.h reference output for testing +test/btyacc/err_syntax16.error reference output for testing +test/btyacc/err_syntax16.output reference output for testing +test/btyacc/err_syntax16.tab.c reference output for testing +test/btyacc/err_syntax16.tab.h reference output for testing +test/btyacc/err_syntax17.error reference output for testing +test/btyacc/err_syntax17.output reference output for testing +test/btyacc/err_syntax17.tab.c reference output for testing +test/btyacc/err_syntax17.tab.h reference output for testing +test/btyacc/err_syntax18.error reference output for testing +test/btyacc/err_syntax18.output reference output for testing +test/btyacc/err_syntax18.tab.c reference output for testing +test/btyacc/err_syntax18.tab.h reference output for testing +test/btyacc/err_syntax19.error reference output for testing +test/btyacc/err_syntax19.output reference output for testing +test/btyacc/err_syntax19.tab.c reference output for testing +test/btyacc/err_syntax19.tab.h reference output for testing +test/btyacc/err_syntax2.error reference output for testing +test/btyacc/err_syntax2.output reference output for testing +test/btyacc/err_syntax2.tab.c reference output for testing +test/btyacc/err_syntax2.tab.h reference output for testing +test/btyacc/err_syntax20.error reference output for testing +test/btyacc/err_syntax20.output reference output for testing +test/btyacc/err_syntax20.tab.c reference output for testing +test/btyacc/err_syntax20.tab.h reference output for testing +test/btyacc/err_syntax21.error reference output for testing +test/btyacc/err_syntax21.output reference output for testing +test/btyacc/err_syntax21.tab.c reference output for testing +test/btyacc/err_syntax21.tab.h reference output for testing +test/btyacc/err_syntax22.error reference output for testing *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 12:52:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D10A367; Wed, 23 Apr 2014 12:52:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70D4D12BD; Wed, 23 Apr 2014 12:52:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NCqC3W026934; Wed, 23 Apr 2014 12:52:12 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NCqCWV026933; Wed, 23 Apr 2014 12:52:12 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404231252.s3NCqCWV026933@svn.freebsd.org> From: Ian Lepore Date: Wed, 23 Apr 2014 12:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264822 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 12:52:12 -0000 Author: ian Date: Wed Apr 23 12:52:11 2014 New Revision: 264822 URL: http://svnweb.freebsd.org/changeset/base/264822 Log: Allow .WAIT to appear in SUBDIR= lists, to provide some control over parallel build order. All subdirs before a .WAIT will be built before any subdirs after it. Reviewed by: imp@ Modified: head/share/mk/bsd.subdir.mk Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Wed Apr 23 12:46:27 2014 (r264821) +++ head/share/mk/bsd.subdir.mk Wed Apr 23 12:52:11 2014 (r264822) @@ -45,7 +45,7 @@ distribute: .MAKE _SUBDIR: .USE .MAKE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) - @${_+_}set -e; for entry in ${SUBDIR}; do \ + @${_+_}set -e; for entry in ${SUBDIR:N.WAIT}; do \ if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \ ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE_ARCH} (${.TARGET:realinstall=install})"; \ edir=$${entry}.${MACHINE_ARCH}; \ @@ -60,7 +60,7 @@ _SUBDIR: .USE .MAKE done .endif -${SUBDIR}: .PHONY .MAKE +${SUBDIR:N.WAIT}: .PHONY .MAKE ${_+_}@if test -d ${.TARGET}.${MACHINE_ARCH}; then \ cd ${.CURDIR}/${.TARGET}.${MACHINE_ARCH}; \ else \ @@ -68,12 +68,18 @@ ${SUBDIR}: .PHONY .MAKE fi; \ ${MAKE} all +# Work around parsing of .if nested in .for by putting .WAIT string into a var. +__wait= .WAIT .for __target in all all-man checkdpadd clean cleandepend cleandir \ cleanilinks depend distribute lint maninstall manlint obj objlink \ realinstall regress tags ${SUBDIR_TARGETS} .ifdef SUBDIR_PARALLEL +__subdir_targets= .for __dir in ${SUBDIR} -${__target}: ${__target}_subdir_${__dir} +.if ${__wait} == ${__dir} +__subdir_targets+= .WAIT +.else +__subdir_targets+= ${__target}_subdir_${__dir} ${__target}_subdir_${__dir}: .MAKE @${_+_}set -e; \ if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ @@ -87,7 +93,9 @@ ${__target}_subdir_${__dir}: .MAKE fi; \ ${MAKE} ${__target:realinstall=install} \ DIRPRFX=${DIRPRFX}$$edir/ +.endif .endfor +${__target}: ${__subdir_targets} .else ${__target}: _SUBDIR .endif From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 14:05:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F6FA3AF; Wed, 23 Apr 2014 14:05:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 528011A46; Wed, 23 Apr 2014 14:05:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NE5TTZ064347; Wed, 23 Apr 2014 14:05:29 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NE5SUL064345; Wed, 23 Apr 2014 14:05:28 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201404231405.s3NE5SUL064345@svn.freebsd.org> From: Ed Schouten Date: Wed, 23 Apr 2014 14:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264823 - in head/usr.bin/bsdiff: bsdiff bspatch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 14:05:29 -0000 Author: ed Date: Wed Apr 23 14:05:28 2014 New Revision: 264823 URL: http://svnweb.freebsd.org/changeset/base/264823 Log: Make usage printing more consistent with other tools. - Introduce a separate usage() function. - Don't use argv[0]. Directly name the application, as we do elsewhere. - Don't prepend the application name. - Don't print two newlines. Modified: head/usr.bin/bsdiff/bsdiff/bsdiff.c head/usr.bin/bsdiff/bspatch/bspatch.c Modified: head/usr.bin/bsdiff/bsdiff/bsdiff.c ============================================================================== --- head/usr.bin/bsdiff/bsdiff/bsdiff.c Wed Apr 23 12:52:11 2014 (r264822) +++ head/usr.bin/bsdiff/bsdiff/bsdiff.c Wed Apr 23 14:05:28 2014 (r264823) @@ -196,6 +196,14 @@ static void offtout(off_t x,u_char *buf) if(x<0) buf[7]|=0x80; } +static void +usage(void) +{ + + fprintf(stderr, "usage: bsdiff oldfile newfile patchfile\n"); + exit(1); +} + int main(int argc,char *argv[]) { int fd; @@ -216,7 +224,8 @@ int main(int argc,char *argv[]) BZFILE * pfbz2; int bz2err; - if(argc!=4) errx(1,"usage: %s oldfile newfile patchfile\n",argv[0]); + if (argc != 4) + usage(); /* Allocate oldsize+1 bytes instead of oldsize bytes to ensure that we never try to malloc(0) and get a NULL pointer */ Modified: head/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- head/usr.bin/bsdiff/bspatch/bspatch.c Wed Apr 23 12:52:11 2014 (r264822) +++ head/usr.bin/bsdiff/bspatch/bspatch.c Wed Apr 23 14:05:28 2014 (r264823) @@ -57,6 +57,14 @@ static off_t offtin(u_char *buf) return y; } +static void +usage(void) +{ + + fprintf(stderr, "usage: bspatch oldfile newfile patchfile\n"); + exit(1); +} + int main(int argc,char * argv[]) { FILE * f, * cpf, * dpf, * epf; @@ -72,7 +80,8 @@ int main(int argc,char * argv[]) off_t lenread; off_t i; - if(argc!=4) errx(1,"usage: %s oldfile newfile patchfile\n",argv[0]); + if (argc != 4) + usage(); /* Open patch file */ if ((f = fopen(argv[3], "rb")) == NULL) From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 16:01:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 876033F4; Wed, 23 Apr 2014 16:01:19 +0000 (UTC) Received: from mail-ve0-x230.google.com (mail-ve0-x230.google.com [IPv6:2607:f8b0:400c:c01::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F12C916CB; Wed, 23 Apr 2014 16:01:18 +0000 (UTC) Received: by mail-ve0-f176.google.com with SMTP id db11so1384846veb.35 for ; Wed, 23 Apr 2014 09:01:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=t969laKQIeOlhBXmFkkVMc24GuETuC9uA8b4IIIXfsE=; b=LhSIO5fDzWzLw7VaiLt8jVvTJcyh+5WF5ydnLXQG8FTL3rl92oSoszEHUN527hPwtv kb9/wPYTzozh12WSRbCy0hHW+3z3a3w2qDNyFJdMTLGP6FOg1JMCGCwtzOH7znOMFTXS hKfgqVOuLUSxHIgiKqF2NuokfmeTzC3ss/5ipfhq/NKm/Yen5R5xlJysGugaDCok6u6+ uegHLlJZB0DxusYv5cxXOt906IY74lH0NHClnIxN7WJraroT50wT8XLlehgjzGHEc1hX ohpjTlkwLgk0XFVPdbsfTGYsTygw9VID1MUfJGGLirazoDpfEa7MaKQRF8PGwpz1HJc5 JHjw== X-Received: by 10.220.250.203 with SMTP id mp11mr42669550vcb.2.1398268878125; Wed, 23 Apr 2014 09:01:18 -0700 (PDT) MIME-Version: 1.0 Sender: cochard@gmail.com Received: by 10.58.2.225 with HTTP; Wed, 23 Apr 2014 09:00:57 -0700 (PDT) In-Reply-To: <201404171233.s3HCXREf031882@svn.freebsd.org> References: <201404171233.s3HCXREf031882@svn.freebsd.org> From: =?ISO-8859-1?Q?Olivier_Cochard=2DLabb=E9?= Date: Wed, 23 Apr 2014 18:00:57 +0200 X-Google-Sender-Auth: 3uojCvt9PNMMENOtU8fkb151OWo Message-ID: Subject: Re: svn commit: r264601 - in head: share/man/man4 sys/boot/fdt/dts/mips sys/dev/netfpga10g sys/dev/netfpga10g/nf10bmac sys/mips/beri sys/mips/conf sys/modules sys/modules/netfpga10g sys/modules/netfpga... To: "Bjoern A. Zeeb" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head , svn-src-all , src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 16:01:19 -0000 On Thu, Apr 17, 2014 at 2:33 PM, Bjoern A. Zeeb wrote: > Author: bz > Date: Thu Apr 17 12:33:26 2014 > New Revision: 264601 > URL: http://svnweb.freebsd.org/changeset/base/264601 > > Log: > Add the initial version of if_nf10bmac(4), a driver to support an > NetFPGA-10G Embedded CPU Ethernet Core. > > > Hi Bjoern, I meet this problem during installworld since this commit: install -o root -g wheel -m 444 netfpga10g_nf10bmac.4.gz /usr/obj/nanobsd.amd64/_.w/usr/share/man/man4 install: netfpga10g_nf10bmac.4.gz: No such file or directory *** [_maninstall] Error code 71 Regards, Olivier From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 16:50:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4863A34C; Wed, 23 Apr 2014 16:50:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 354F81C6E; Wed, 23 Apr 2014 16:50:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NGofje033257; Wed, 23 Apr 2014 16:50:41 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NGofmA033256; Wed, 23 Apr 2014 16:50:41 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201404231650.s3NGofmA033256@svn.freebsd.org> From: Neel Natu Date: Wed, 23 Apr 2014 16:50:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264825 - head/sys/amd64/vmm/io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 16:50:41 -0000 Author: neel Date: Wed Apr 23 16:50:40 2014 New Revision: 264825 URL: http://svnweb.freebsd.org/changeset/base/264825 Log: Change the vlapic timer frequency to be in the ballpark of contemporary hardware. This also decouples the vlapic emulation from the host's TSC frequency. Requested by: grehan@ Modified: head/sys/amd64/vmm/io/vlapic.c Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Wed Apr 23 15:18:40 2014 (r264824) +++ head/sys/amd64/vmm/io/vlapic.c Wed Apr 23 16:50:40 2014 (r264825) @@ -70,7 +70,12 @@ __FBSDID("$FreeBSD$"); #define VLAPIC_TIMER_UNLOCK(vlapic) mtx_unlock_spin(&((vlapic)->timer_mtx)) #define VLAPIC_TIMER_LOCKED(vlapic) mtx_owned(&((vlapic)->timer_mtx)) -#define VLAPIC_BUS_FREQ tsc_freq +/* + * APIC timer frequency: + * - arbitrary but chosen to be in the ballpark of contemporary hardware. + * - power-of-two to avoid loss of precision when converted to a bintime. + */ +#define VLAPIC_BUS_FREQ (128 * 1024 * 1024) static __inline uint32_t vlapic_get_id(struct vlapic *vlapic) From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 18:25:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC4F4A72; Wed, 23 Apr 2014 18:25:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD8501716; Wed, 23 Apr 2014 18:25:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NIPCD6074256; Wed, 23 Apr 2014 18:25:12 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NIPCWY074250; Wed, 23 Apr 2014 18:25:12 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404231825.s3NIPCWY074250@svn.freebsd.org> From: Ed Maste Date: Wed, 23 Apr 2014 18:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264826 - in head/contrib/llvm: include/llvm lib/CodeGen/AsmPrinter X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 18:25:13 -0000 Author: emaste Date: Wed Apr 23 18:25:11 2014 New Revision: 264826 URL: http://svnweb.freebsd.org/changeset/base/264826 Log: Merge LLVM r202188: Debug info: Support variadic functions. Variadic functions have an unspecified parameter tag after the last argument. In IR this is represented as an unspecified parameter in the subroutine type. Paired commit with CFE r202185. rdar://problem/13690847 This re-applies r202184 + a bugfix in DwarfDebug's argument handling. This merge includes a change to use the LLVM 3.4 API in lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp: DwarfUnit -> CompileUnit Sponsored by: DARPA, AFRL Modified: head/contrib/llvm/include/llvm/DIBuilder.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Modified: head/contrib/llvm/include/llvm/DIBuilder.h ============================================================================== --- head/contrib/llvm/include/llvm/DIBuilder.h Wed Apr 23 16:50:40 2014 (r264825) +++ head/contrib/llvm/include/llvm/DIBuilder.h Wed Apr 23 18:25:11 2014 (r264826) @@ -439,7 +439,7 @@ namespace llvm { /// through debug info anchors. void retainType(DIType T); - /// createUnspecifiedParameter - Create unspeicified type descriptor + /// createUnspecifiedParameter - Create unspecified type descriptor /// for a subroutine type. DIDescriptor createUnspecifiedParameter(); Modified: head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Wed Apr 23 16:50:40 2014 (r264825) +++ head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Wed Apr 23 18:25:11 2014 (r264826) @@ -1116,6 +1116,22 @@ void CompileUnit::constructTypeDIE(DIE & addSourceLine(&Buffer, DTy); } +/// constructSubprogramArguments - Construct function argument DIEs. +void CompileUnit::constructSubprogramArguments(DIE &Buffer, DIArray Args) { + for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) { + DIDescriptor Ty = Args.getElement(i); + if (Ty.isUnspecifiedParameter()) { + assert(i == N-1 && "ellipsis must be the last argument"); + createAndAddDIE(dwarf::DW_TAG_unspecified_parameters, Buffer); + } else { + DIE *Arg = createAndAddDIE(dwarf::DW_TAG_formal_parameter, Buffer); + addType(Arg, DIType(Ty)); + if (DIType(Ty).isArtificial()) + addFlag(Arg, dwarf::DW_AT_artificial); + } + } +} + /// Return true if the type is appropriately scoped to be contained inside /// its own type unit. static bool isTypeUnitScoped(DIType Ty, const DwarfDebug *DD) { @@ -1170,19 +1186,12 @@ void CompileUnit::constructTypeDIE(DIE & addType(&Buffer, RTy); bool isPrototyped = true; - // Add arguments. - for (unsigned i = 1, N = Elements.getNumElements(); i < N; ++i) { - DIDescriptor Ty = Elements.getElement(i); - if (Ty.isUnspecifiedParameter()) { - createAndAddDIE(dwarf::DW_TAG_unspecified_parameters, Buffer); - isPrototyped = false; - } else { - DIE *Arg = createAndAddDIE(dwarf::DW_TAG_formal_parameter, Buffer); - addType(Arg, DIType(Ty)); - if (DIType(Ty).isArtificial()) - addFlag(Arg, dwarf::DW_AT_artificial); - } - } + if (Elements.getNumElements() == 2 && + Elements.getElement(1).isUnspecifiedParameter()) + isPrototyped = false; + + constructSubprogramArguments(Buffer, Elements); + // Add prototype flag if we're dealing with a C language and the // function has been prototyped. uint16_t Language = getLanguage(); @@ -1475,13 +1484,7 @@ DIE *CompileUnit::getOrCreateSubprogramD // Add arguments. Do not add arguments for subprogram definition. They will // be handled while processing variables. - for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) { - DIE *Arg = createAndAddDIE(dwarf::DW_TAG_formal_parameter, *SPDie); - DIType ATy(Args.getElement(i)); - addType(Arg, ATy); - if (ATy.isArtificial()) - addFlag(Arg, dwarf::DW_AT_artificial); - } + constructSubprogramArguments(*SPDie, Args); } if (SP.isArtificial()) Modified: head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h ============================================================================== --- head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h Wed Apr 23 16:50:40 2014 (r264825) +++ head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h Wed Apr 23 18:25:11 2014 (r264826) @@ -342,6 +342,9 @@ public: void emitHeader(const MCSection *ASection, const MCSymbol *ASectionSym); private: + /// constructSubprogramArguments - Construct function argument DIEs. + void constructSubprogramArguments(DIE &Buffer, DIArray Args); + /// constructTypeDIE - Construct basic type die from DIBasicType. void constructTypeDIE(DIE &Buffer, DIBasicType BTy); Modified: head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Apr 23 16:50:40 2014 (r264825) +++ head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Apr 23 18:25:11 2014 (r264826) @@ -404,15 +404,21 @@ DIE *DwarfDebug::updateSubprogramScopeDI DIArray Args = SPTy.getTypeArray(); uint16_t SPTag = SPTy.getTag(); if (SPTag == dwarf::DW_TAG_subroutine_type) + // FIXME: Use DwarfUnit::constructSubprogramArguments() here. for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) { - DIE *Arg = - SPCU->createAndAddDIE(dwarf::DW_TAG_formal_parameter, *SPDie); DIType ATy(Args.getElement(i)); - SPCU->addType(Arg, ATy); - if (ATy.isArtificial()) - SPCU->addFlag(Arg, dwarf::DW_AT_artificial); - if (ATy.isObjectPointer()) - SPCU->addDIEEntry(SPDie, dwarf::DW_AT_object_pointer, Arg); + if (ATy.isUnspecifiedParameter()) { + assert(i == N-1 && "ellipsis must be the last argument"); + SPCU->createAndAddDIE(dwarf::DW_TAG_unspecified_parameters, *SPDie); + } else { + DIE *Arg = + SPCU->createAndAddDIE(dwarf::DW_TAG_formal_parameter, *SPDie); + SPCU->addType(Arg, ATy); + if (ATy.isArtificial()) + SPCU->addFlag(Arg, dwarf::DW_AT_artificial); + if (ATy.isObjectPointer()) + SPCU->addDIEEntry(SPDie, dwarf::DW_AT_object_pointer, Arg); + } } DIE *SPDeclDie = SPDie; SPDie = @@ -579,7 +585,7 @@ DIE *DwarfDebug::createScopeChildrenDIE( DIE *ObjectPointer = NULL; // Collect arguments for current function. - if (LScopes.isCurrentFunctionScope(Scope)) + if (LScopes.isCurrentFunctionScope(Scope)) { for (unsigned i = 0, N = CurrentFnArguments.size(); i < N; ++i) if (DbgVariable *ArgDV = CurrentFnArguments[i]) if (DIE *Arg = @@ -588,6 +594,16 @@ DIE *DwarfDebug::createScopeChildrenDIE( if (ArgDV->isObjectPointer()) ObjectPointer = Arg; } + // Create the unspecified parameter that marks a function as variadic. + DISubprogram SP(Scope->getScopeNode()); + assert(SP.Verify()); + DIArray FnArgs = SP.getType().getTypeArray(); + if (FnArgs.getElement(FnArgs.getNumElements()-1).isUnspecifiedParameter()) { + DIE *Ellipsis = new DIE(dwarf::DW_TAG_unspecified_parameters); + Children.push_back(Ellipsis); + } + } + // Collect lexical scope children first. const SmallVectorImpl &Variables =ScopeVariables.lookup(Scope); for (unsigned i = 0, N = Variables.size(); i < N; ++i) From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 18:26:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C105ABC0; Wed, 23 Apr 2014 18:26:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A19B51726; Wed, 23 Apr 2014 18:26:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NIQCCH074396; Wed, 23 Apr 2014 18:26:12 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NIQCA9074395; Wed, 23 Apr 2014 18:26:12 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404231826.s3NIQCA9074395@svn.freebsd.org> From: Ed Maste Date: Wed, 23 Apr 2014 18:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264827 - head/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 18:26:12 -0000 Author: emaste Date: Wed Apr 23 18:26:12 2014 New Revision: 264827 URL: http://svnweb.freebsd.org/changeset/base/264827 Log: Merge Clang r202185: Debug info: Generate debug info for variadic functions. Paired commit with LLVM. rdar://problem/13690847 This merege includes changes to use the Clang 3.4 API (revisions 199686 and 200082) in lib/CodeGen/CGDebugInfo.cpp: getParamType -> getArgType getNumParams -> getNumArgs getReturnType -> getResultType Sponsored by: DARPA, AFRL Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Wed Apr 23 18:25:11 2014 (r264826) +++ head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Wed Apr 23 18:26:12 2014 (r264827) @@ -37,7 +37,7 @@ #include "llvm/IR/Module.h" #include "llvm/Support/Dwarf.h" #include "llvm/Support/FileSystem.h" -#include "llvm/Support/Path.h" +#include "llvm/Support/Path.h" using namespace clang; using namespace clang::CodeGen; @@ -342,9 +342,9 @@ void CGDebugInfo::CreateCompileUnit() { if (const FileEntry *MainFile = SM.getFileEntryForID(SM.getMainFileID())) { MainFileDir = MainFile->getDir()->getName(); if (MainFileDir != ".") { - llvm::SmallString<1024> MainFileDirSS(MainFileDir); - llvm::sys::path::append(MainFileDirSS, MainFileName); - MainFileName = MainFileDirSS.str(); + llvm::SmallString<1024> MainFileDirSS(MainFileDir); + llvm::sys::path::append(MainFileDirSS, MainFileName); + MainFileName = MainFileDirSS.str(); } } @@ -760,6 +760,8 @@ llvm::DIType CGDebugInfo::CreateType(con else if (const FunctionProtoType *FPT = dyn_cast(Ty)) { for (unsigned i = 0, e = FPT->getNumArgs(); i != e; ++i) EltTys.push_back(getOrCreateType(FPT->getArgType(i), Unit)); + if (FPT->isVariadic()) + EltTys.push_back(DBuilder.createUnspecifiedParameter()); } llvm::DIArray EltTypeArray = DBuilder.getOrCreateArray(EltTys); @@ -2420,6 +2422,20 @@ llvm::DICompositeType CGDebugInfo::getOr llvm::DIArray EltTypeArray = DBuilder.getOrCreateArray(Elts); return DBuilder.createSubroutineType(F, EltTypeArray); } + + // Variadic function. + if (const FunctionDecl *FD = dyn_cast(D)) + if (FD->isVariadic()) { + SmallVector EltTys; + EltTys.push_back(getOrCreateType(FD->getResultType(), F)); + if (const FunctionProtoType *FPT = dyn_cast(FnType)) + for (unsigned i = 0, e = FPT->getNumArgs(); i != e; ++i) + EltTys.push_back(getOrCreateType(FPT->getArgType(i), F)); + EltTys.push_back(DBuilder.createUnspecifiedParameter()); + llvm::DIArray EltTypeArray = DBuilder.getOrCreateArray(EltTys); + return DBuilder.createSubroutineType(F, EltTypeArray); + } + return llvm::DICompositeType(getOrCreateType(FnType, F)); } From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 18:36:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB5CFEBE; Wed, 23 Apr 2014 18:36:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAC091813; Wed, 23 Apr 2014 18:36:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NIaXvh078547; Wed, 23 Apr 2014 18:36:33 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NIaXAf078544; Wed, 23 Apr 2014 18:36:33 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404231836.s3NIaXAf078544@svn.freebsd.org> From: Ed Maste Date: Wed, 23 Apr 2014 18:36:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264828 - head/contrib/llvm/patches X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 18:36:34 -0000 Author: emaste Date: Wed Apr 23 18:36:32 2014 New Revision: 264828 URL: http://svnweb.freebsd.org/changeset/base/264828 Log: Add patches corresponding to r264826 and r264827 Added: head/contrib/llvm/patches/patch-r264826-llvm-r202188-variadic-fn-debug-info.diff head/contrib/llvm/patches/patch-r264827-clang-r202185-variadic-fn-debug-info.diff Added: head/contrib/llvm/patches/patch-r264826-llvm-r202188-variadic-fn-debug-info.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r264826-llvm-r202188-variadic-fn-debug-info.diff Wed Apr 23 18:36:32 2014 (r264828) @@ -0,0 +1,176 @@ +Merge LLVM r202188: + + Debug info: Support variadic functions. + Variadic functions have an unspecified parameter tag after the last + argument. In IR this is represented as an unspecified parameter in the + subroutine type. + + Paired commit with CFE r202185. + + rdar://problem/13690847 + + This re-applies r202184 + a bugfix in DwarfDebug's argument handling. + +This merge includes a change to use the LLVM 3.4 API in +lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp: + +DwarfUnit -> CompileUnit + +Sponsored by: DARPA, AFRL + +http://svnweb.freebsd.org/changeset/base/264826 + +Index: include/llvm/DIBuilder.h +=================================================================== +--- include/llvm/DIBuilder.h (revision 264825) ++++ include/llvm/DIBuilder.h (revision 264826) +@@ -439,7 +439,7 @@ + /// through debug info anchors. + void retainType(DIType T); + +- /// createUnspecifiedParameter - Create unspeicified type descriptor ++ /// createUnspecifiedParameter - Create unspecified type descriptor + /// for a subroutine type. + DIDescriptor createUnspecifiedParameter(); + +Index: lib/CodeGen/AsmPrinter/DwarfDebug.cpp +=================================================================== +--- lib/CodeGen/AsmPrinter/DwarfDebug.cpp (revision 264825) ++++ lib/CodeGen/AsmPrinter/DwarfDebug.cpp (revision 264826) +@@ -404,15 +404,21 @@ + DIArray Args = SPTy.getTypeArray(); + uint16_t SPTag = SPTy.getTag(); + if (SPTag == dwarf::DW_TAG_subroutine_type) ++ // FIXME: Use DwarfUnit::constructSubprogramArguments() here. + for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) { +- DIE *Arg = ++ DIType ATy(Args.getElement(i)); ++ if (ATy.isUnspecifiedParameter()) { ++ assert(i == N-1 && "ellipsis must be the last argument"); ++ SPCU->createAndAddDIE(dwarf::DW_TAG_unspecified_parameters, *SPDie); ++ } else { ++ DIE *Arg = + SPCU->createAndAddDIE(dwarf::DW_TAG_formal_parameter, *SPDie); +- DIType ATy(Args.getElement(i)); +- SPCU->addType(Arg, ATy); +- if (ATy.isArtificial()) +- SPCU->addFlag(Arg, dwarf::DW_AT_artificial); +- if (ATy.isObjectPointer()) +- SPCU->addDIEEntry(SPDie, dwarf::DW_AT_object_pointer, Arg); ++ SPCU->addType(Arg, ATy); ++ if (ATy.isArtificial()) ++ SPCU->addFlag(Arg, dwarf::DW_AT_artificial); ++ if (ATy.isObjectPointer()) ++ SPCU->addDIEEntry(SPDie, dwarf::DW_AT_object_pointer, Arg); ++ } + } + DIE *SPDeclDie = SPDie; + SPDie = +@@ -579,7 +585,7 @@ + DIE *ObjectPointer = NULL; + + // Collect arguments for current function. +- if (LScopes.isCurrentFunctionScope(Scope)) ++ if (LScopes.isCurrentFunctionScope(Scope)) { + for (unsigned i = 0, N = CurrentFnArguments.size(); i < N; ++i) + if (DbgVariable *ArgDV = CurrentFnArguments[i]) + if (DIE *Arg = +@@ -588,6 +594,16 @@ + if (ArgDV->isObjectPointer()) ObjectPointer = Arg; + } + ++ // Create the unspecified parameter that marks a function as variadic. ++ DISubprogram SP(Scope->getScopeNode()); ++ assert(SP.Verify()); ++ DIArray FnArgs = SP.getType().getTypeArray(); ++ if (FnArgs.getElement(FnArgs.getNumElements()-1).isUnspecifiedParameter()) { ++ DIE *Ellipsis = new DIE(dwarf::DW_TAG_unspecified_parameters); ++ Children.push_back(Ellipsis); ++ } ++ } ++ + // Collect lexical scope children first. + const SmallVectorImpl &Variables =ScopeVariables.lookup(Scope); + for (unsigned i = 0, N = Variables.size(); i < N; ++i) +Index: lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +=================================================================== +--- lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (revision 264825) ++++ lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (revision 264826) +@@ -1116,6 +1116,22 @@ + addSourceLine(&Buffer, DTy); + } + ++/// constructSubprogramArguments - Construct function argument DIEs. ++void CompileUnit::constructSubprogramArguments(DIE &Buffer, DIArray Args) { ++ for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) { ++ DIDescriptor Ty = Args.getElement(i); ++ if (Ty.isUnspecifiedParameter()) { ++ assert(i == N-1 && "ellipsis must be the last argument"); ++ createAndAddDIE(dwarf::DW_TAG_unspecified_parameters, Buffer); ++ } else { ++ DIE *Arg = createAndAddDIE(dwarf::DW_TAG_formal_parameter, Buffer); ++ addType(Arg, DIType(Ty)); ++ if (DIType(Ty).isArtificial()) ++ addFlag(Arg, dwarf::DW_AT_artificial); ++ } ++ } ++} ++ + /// Return true if the type is appropriately scoped to be contained inside + /// its own type unit. + static bool isTypeUnitScoped(DIType Ty, const DwarfDebug *DD) { +@@ -1170,19 +1186,12 @@ + addType(&Buffer, RTy); + + bool isPrototyped = true; +- // Add arguments. +- for (unsigned i = 1, N = Elements.getNumElements(); i < N; ++i) { +- DIDescriptor Ty = Elements.getElement(i); +- if (Ty.isUnspecifiedParameter()) { +- createAndAddDIE(dwarf::DW_TAG_unspecified_parameters, Buffer); +- isPrototyped = false; +- } else { +- DIE *Arg = createAndAddDIE(dwarf::DW_TAG_formal_parameter, Buffer); +- addType(Arg, DIType(Ty)); +- if (DIType(Ty).isArtificial()) +- addFlag(Arg, dwarf::DW_AT_artificial); +- } +- } ++ if (Elements.getNumElements() == 2 && ++ Elements.getElement(1).isUnspecifiedParameter()) ++ isPrototyped = false; ++ ++ constructSubprogramArguments(Buffer, Elements); ++ + // Add prototype flag if we're dealing with a C language and the + // function has been prototyped. + uint16_t Language = getLanguage(); +@@ -1475,13 +1484,7 @@ + + // Add arguments. Do not add arguments for subprogram definition. They will + // be handled while processing variables. +- for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) { +- DIE *Arg = createAndAddDIE(dwarf::DW_TAG_formal_parameter, *SPDie); +- DIType ATy(Args.getElement(i)); +- addType(Arg, ATy); +- if (ATy.isArtificial()) +- addFlag(Arg, dwarf::DW_AT_artificial); +- } ++ constructSubprogramArguments(*SPDie, Args); + } + + if (SP.isArtificial()) +Index: lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +=================================================================== +--- lib/CodeGen/AsmPrinter/DwarfCompileUnit.h (revision 264825) ++++ lib/CodeGen/AsmPrinter/DwarfCompileUnit.h (revision 264826) +@@ -342,6 +342,9 @@ + void emitHeader(const MCSection *ASection, const MCSymbol *ASectionSym); + + private: ++ /// constructSubprogramArguments - Construct function argument DIEs. ++ void constructSubprogramArguments(DIE &Buffer, DIArray Args); ++ + /// constructTypeDIE - Construct basic type die from DIBasicType. + void constructTypeDIE(DIE &Buffer, DIBasicType BTy); + Added: head/contrib/llvm/patches/patch-r264827-clang-r202185-variadic-fn-debug-info.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r264827-clang-r202185-variadic-fn-debug-info.diff Wed Apr 23 18:36:32 2014 (r264828) @@ -0,0 +1,74 @@ +Merge Clang r202185: + + Debug info: Generate debug info for variadic functions. + Paired commit with LLVM. + + rdar://problem/13690847 + +This merege includes changes to use the Clang 3.4 API (revisions +199686 and 200082) in lib/CodeGen/CGDebugInfo.cpp: + +getParamType -> getArgType +getNumParams -> getNumArgs +getReturnType -> getResultType + +Sponsored by: DARPA, AFRL + +http://svnweb.freebsd.org/changeset/base/264827 + +Index: tools/clang/lib/CodeGen/CGDebugInfo.cpp +=================================================================== +--- tools/clang/lib/CodeGen/CGDebugInfo.cpp (revision 264826) ++++ tools/clang/lib/CodeGen/CGDebugInfo.cpp (revision 264827) +@@ -37,7 +37,7 @@ + #include "llvm/IR/Module.h" + #include "llvm/Support/Dwarf.h" + #include "llvm/Support/FileSystem.h" +-#include "llvm/Support/Path.h" ++#include "llvm/Support/Path.h" + using namespace clang; + using namespace clang::CodeGen; + +@@ -342,9 +342,9 @@ + if (const FileEntry *MainFile = SM.getFileEntryForID(SM.getMainFileID())) { + MainFileDir = MainFile->getDir()->getName(); + if (MainFileDir != ".") { +- llvm::SmallString<1024> MainFileDirSS(MainFileDir); +- llvm::sys::path::append(MainFileDirSS, MainFileName); +- MainFileName = MainFileDirSS.str(); ++ llvm::SmallString<1024> MainFileDirSS(MainFileDir); ++ llvm::sys::path::append(MainFileDirSS, MainFileName); ++ MainFileName = MainFileDirSS.str(); + } + } + +@@ -760,6 +760,8 @@ + else if (const FunctionProtoType *FPT = dyn_cast(Ty)) { + for (unsigned i = 0, e = FPT->getNumArgs(); i != e; ++i) + EltTys.push_back(getOrCreateType(FPT->getArgType(i), Unit)); ++ if (FPT->isVariadic()) ++ EltTys.push_back(DBuilder.createUnspecifiedParameter()); + } + + llvm::DIArray EltTypeArray = DBuilder.getOrCreateArray(EltTys); +@@ -2420,6 +2422,20 @@ + llvm::DIArray EltTypeArray = DBuilder.getOrCreateArray(Elts); + return DBuilder.createSubroutineType(F, EltTypeArray); + } ++ ++ // Variadic function. ++ if (const FunctionDecl *FD = dyn_cast(D)) ++ if (FD->isVariadic()) { ++ SmallVector EltTys; ++ EltTys.push_back(getOrCreateType(FD->getResultType(), F)); ++ if (const FunctionProtoType *FPT = dyn_cast(FnType)) ++ for (unsigned i = 0, e = FPT->getNumArgs(); i != e; ++i) ++ EltTys.push_back(getOrCreateType(FPT->getArgType(i), F)); ++ EltTys.push_back(DBuilder.createUnspecifiedParameter()); ++ llvm::DIArray EltTypeArray = DBuilder.getOrCreateArray(EltTys); ++ return DBuilder.createSubroutineType(F, EltTypeArray); ++ } ++ + return llvm::DICompositeType(getOrCreateType(FnType, F)); + } + From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 19:26:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C0FDB38; Wed, 23 Apr 2014 19:26:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5899D1CB7; Wed, 23 Apr 2014 19:26:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NJQ0EG098806; Wed, 23 Apr 2014 19:26:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NJQ0j3098798; Wed, 23 Apr 2014 19:26:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404231926.s3NJQ0j3098798@svn.freebsd.org> From: Marius Strobl Date: Wed, 23 Apr 2014 19:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264831 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 19:26:00 -0000 Author: marius Date: Wed Apr 23 19:25:59 2014 New Revision: 264831 URL: http://svnweb.freebsd.org/changeset/base/264831 Log: Add quirk to configure headphones redirection on Intel DH87RL boards. MFC after: 3 days Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa_patches.c Wed Apr 23 19:12:26 2014 (r264830) +++ head/sys/dev/sound/pci/hda/hdaa_patches.c Wed Apr 23 19:25:59 2014 (r264831) @@ -355,7 +355,7 @@ hdac_pin_patch(struct hdaa_widget *w) case 25: patch = "as=1 seq=15"; break; - /* + /* * Group onboard mic and headphone mic * together. Fixes onboard mic. */ @@ -383,6 +383,13 @@ hdac_pin_patch(struct hdaa_widget *w) patch = "as=1 seq=15"; break; } + } else if (id == HDA_CODEC_ALC892 && + subid == INTEL_DH87RL_SUBVENDOR) { + switch (nid) { + case 27: + patch = "as=1 seq=15"; + break; + } } if (patch != NULL) Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Wed Apr 23 19:12:26 2014 (r264830) +++ head/sys/dev/sound/pci/hda/hdac.h Wed Apr 23 19:25:59 2014 (r264831) @@ -155,6 +155,7 @@ /* OEM/subvendors */ /* Intel */ +#define INTEL_DH87RL_SUBVENDOR HDA_MODEL_CONSTRUCT(INTEL, 0x204a) #define INTEL_D101GGC_SUBVENDOR HDA_MODEL_CONSTRUCT(INTEL, 0xd600) /* HP/Compaq */ From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 19:32:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D83A0EB6; Wed, 23 Apr 2014 19:32:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B956B1D68; Wed, 23 Apr 2014 19:32:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NJWp8v002733; Wed, 23 Apr 2014 19:32:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NJWpNF002730; Wed, 23 Apr 2014 19:32:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404231932.s3NJWpNF002730@svn.freebsd.org> From: Marius Strobl Date: Wed, 23 Apr 2014 19:32:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264832 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 19:32:52 -0000 Author: marius Date: Wed Apr 23 19:32:50 2014 New Revision: 264832 URL: http://svnweb.freebsd.org/changeset/base/264832 Log: - Sprinkle const and static as appropriate. - Convert the remainder of snd_hda(4) to take advantage of nitems(). - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. MFC after: 3 days Modified: head/sys/dev/sound/pci/hda/hdaa.c head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdacc.c Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Wed Apr 23 19:25:59 2014 (r264831) +++ head/sys/dev/sound/pci/hda/hdaa.c Wed Apr 23 19:32:50 2014 (r264832) @@ -53,7 +53,7 @@ SND_DECLARE_FILE("$FreeBSD$"); #define hdaa_lockowned(devinfo) mtx_owned((devinfo)->lock) static const struct { - char *key; + const char *key; uint32_t value; } hdaa_quirks_tab[] = { { "softpcmvol", HDAA_QUIRK_SOFTPCMVOL }, @@ -71,28 +71,26 @@ static const struct { { "ovref", HDAA_QUIRK_OVREF }, { "vref", HDAA_QUIRK_VREF }, }; -#define HDAA_QUIRKS_TAB_LEN \ - (sizeof(hdaa_quirks_tab) / sizeof(hdaa_quirks_tab[0])) #define HDA_PARSE_MAXDEPTH 10 MALLOC_DEFINE(M_HDAA, "hdaa", "HDA Audio"); -const char *HDA_COLORS[16] = {"Unknown", "Black", "Grey", "Blue", "Green", "Red", - "Orange", "Yellow", "Purple", "Pink", "Res.A", "Res.B", "Res.C", "Res.D", - "White", "Other"}; +static const char *HDA_COLORS[16] = {"Unknown", "Black", "Grey", "Blue", + "Green", "Red", "Orange", "Yellow", "Purple", "Pink", "Res.A", "Res.B", + "Res.C", "Res.D", "White", "Other"}; -const char *HDA_DEVS[16] = {"Line-out", "Speaker", "Headphones", "CD", +static const char *HDA_DEVS[16] = {"Line-out", "Speaker", "Headphones", "CD", "SPDIF-out", "Digital-out", "Modem-line", "Modem-handset", "Line-in", "AUX", "Mic", "Telephony", "SPDIF-in", "Digital-in", "Res.E", "Other"}; -const char *HDA_CONNS[4] = {"Jack", "None", "Fixed", "Both"}; +static const char *HDA_CONNS[4] = {"Jack", "None", "Fixed", "Both"}; -const char *HDA_CONNECTORS[16] = { +static const char *HDA_CONNECTORS[16] = { "Unknown", "1/8", "1/4", "ATAPI", "RCA", "Optical", "Digital", "Analog", "DIN", "XLR", "RJ-11", "Combo", "0xc", "0xd", "0xe", "Other" }; -const char *HDA_LOCS[64] = { +static const char *HDA_LOCS[64] = { "0x00", "Rear", "Front", "Left", "Right", "Top", "Bottom", "Rear-panel", "Drive-bay", "0x09", "0x0a", "0x0b", "0x0c", "0x0d", "0x0e", "0x0f", "Internal", "0x11", "0x12", "0x13", "0x14", "0x15", "0x16", "Riser", @@ -102,10 +100,10 @@ const char *HDA_LOCS[64] = { "Other", "0x31", "0x32", "0x33", "0x34", "0x35", "Other-Bott", "Lid-In", "Lid-Out", "0x39", "0x3a", "0x3b", "0x3c", "0x3d", "0x3e", "0x3f" }; -const char *HDA_GPIO_ACTIONS[8] = { +static const char *HDA_GPIO_ACTIONS[8] = { "keep", "set", "clear", "disable", "input", "0x05", "0x06", "0x07"}; -const char *HDA_HDMI_CODING_TYPES[18] = { +static const char *HDA_HDMI_CODING_TYPES[18] = { "undefined", "LPCM", "AC-3", "MPEG1", "MP3", "MPEG2", "AAC-LC", "DTS", "ATRAC", "DSD", "E-AC-3", "DTS-HD", "MLP", "DST", "WMAPro", "HE-AAC", "HE-AACv2", "MPEG-Surround" @@ -1113,7 +1111,7 @@ hdaa_dump_pin_sb(struct sbuf *sb, struct } static void -hdaa_dump_amp_sb(struct sbuf *sb, uint32_t cap, char *banner) +hdaa_dump_amp_sb(struct sbuf *sb, uint32_t cap, const char *banner) { int offset, size, step; @@ -1274,7 +1272,7 @@ hdaa_config_fetch(const char *str, uint3 inv = 2; else inv = 0; - for (k = 0; len > inv && k < HDAA_QUIRKS_TAB_LEN; k++) { + for (k = 0; len > inv && k < nitems(hdaa_quirks_tab); k++) { if (strncmp(str + i + inv, hdaa_quirks_tab[k].key, len - inv) != 0) continue; @@ -1302,7 +1300,7 @@ hdaa_sysctl_quirks(SYSCTL_HANDLER_ARGS) quirks = *(uint32_t *)oidp->oid_arg1; buf[0] = 0; - for (i = 0; i < HDAA_QUIRKS_TAB_LEN; i++) { + for (i = 0; i < nitems(hdaa_quirks_tab); i++) { if ((quirks & hdaa_quirks_tab[i].value) != 0) n += snprintf(buf + n, sizeof(buf) - n, "%s%s", n != 0 ? "," : "", hdaa_quirks_tab[i].key); @@ -1576,7 +1574,7 @@ hdaa_widget_parse(struct hdaa_widget *w) static void hdaa_widget_postprocess(struct hdaa_widget *w) { - char *typestr; + const char *typestr; w->type = HDA_PARAM_AUDIO_WIDGET_CAP_TYPE(w->param.widget_cap); switch (w->type) { @@ -5778,7 +5776,7 @@ hdaa_dump_pin_configs(struct hdaa_devinf } static void -hdaa_dump_amp(device_t dev, uint32_t cap, char *banner) +hdaa_dump_amp(device_t dev, uint32_t cap, const char *banner) { int offset, size, step; @@ -6209,7 +6207,7 @@ hdaa_configure(device_t dev) HDA_BOOTVERBOSE( if (devinfo->quirks != 0) { device_printf(dev, "FG config/quirks:"); - for (i = 0; i < HDAA_QUIRKS_TAB_LEN; i++) { + for (i = 0; i < nitems(hdaa_quirks_tab); i++) { if ((devinfo->quirks & hdaa_quirks_tab[i].value) == hdaa_quirks_tab[i].value) @@ -6834,7 +6832,7 @@ static device_method_t hdaa_methods[] = DEVMETHOD(hdac_stream_intr, hdaa_stream_intr), DEVMETHOD(hdac_unsol_intr, hdaa_unsol_intr), DEVMETHOD(hdac_pindump, hdaa_pindump), - { 0, 0 } + DEVMETHOD_END }; static driver_t hdaa_driver = { @@ -6845,7 +6843,7 @@ static driver_t hdaa_driver = { static devclass_t hdaa_devclass; -DRIVER_MODULE(snd_hda, hdacc, hdaa_driver, hdaa_devclass, 0, 0); +DRIVER_MODULE(snd_hda, hdacc, hdaa_driver, hdaa_devclass, NULL, NULL); static void hdaa_chan_formula(struct hdaa_devinfo *devinfo, int asid, @@ -7143,7 +7141,7 @@ static device_method_t hdaa_pcm_methods[ DEVMETHOD(device_probe, hdaa_pcm_probe), DEVMETHOD(device_attach, hdaa_pcm_attach), DEVMETHOD(device_detach, hdaa_pcm_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t hdaa_pcm_driver = { @@ -7152,6 +7150,6 @@ static driver_t hdaa_pcm_driver = { PCM_SOFTC_SIZE, }; -DRIVER_MODULE(snd_hda_pcm, hdaa, hdaa_pcm_driver, pcm_devclass, 0, 0); +DRIVER_MODULE(snd_hda_pcm, hdaa, hdaa_pcm_driver, pcm_devclass, NULL, NULL); MODULE_DEPEND(snd_hda, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); MODULE_VERSION(snd_hda, 1); Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Wed Apr 23 19:25:59 2014 (r264831) +++ head/sys/dev/sound/pci/hda/hdac.c Wed Apr 23 19:32:50 2014 (r264832) @@ -60,21 +60,19 @@ SND_DECLARE_FILE("$FreeBSD$"); #define HDAC_QUIRK_MSI (1 << 2) static const struct { - char *key; + const char *key; uint32_t value; } hdac_quirks_tab[] = { { "64bit", HDAC_QUIRK_DMAPOS }, { "dmapos", HDAC_QUIRK_DMAPOS }, { "msi", HDAC_QUIRK_MSI }, }; -#define HDAC_QUIRKS_TAB_LEN \ - (sizeof(hdac_quirks_tab) / sizeof(hdac_quirks_tab[0])) MALLOC_DEFINE(M_HDAC, "hdac", "HDA Controller"); static const struct { uint32_t model; - char *desc; + const char *desc; char quirks_on; char quirks_off; } hdac_devices[] = { @@ -170,7 +168,6 @@ static const struct { { HDA_SIS_ALL, "SiS", 0, 0 }, { HDA_ULI_ALL, "ULI", 0, 0 }, }; -#define HDAC_DEVICES_LEN (sizeof(hdac_devices) / sizeof(hdac_devices[0])) static const struct { uint16_t vendor; @@ -182,8 +179,6 @@ static const struct { { ATI_VENDORID, 0x42, 0xf8, 0x02 }, { NVIDIA_VENDORID, 0x4e, 0xf0, 0x0f }, }; -#define HDAC_PCIESNOOP_LEN \ - (sizeof(hdac_pcie_snoop) / sizeof(hdac_pcie_snoop[0])) /**************************************************************************** * Function prototypes @@ -254,7 +249,7 @@ hdac_config_fetch(struct hdac_softc *sc, inv = 2; else inv = 0; - for (k = 0; len > inv && k < HDAC_QUIRKS_TAB_LEN; k++) { + for (k = 0; len > inv && k < nitems(hdac_quirks_tab); k++) { if (strncmp(res + i + inv, hdac_quirks_tab[k].key, len - inv) != 0) continue; @@ -1024,7 +1019,7 @@ hdac_probe(device_t dev) bzero(desc, sizeof(desc)); result = ENXIO; - for (i = 0; i < HDAC_DEVICES_LEN; i++) { + for (i = 0; i < nitems(hdac_devices); i++) { if (hdac_devices[i].model == model) { strlcpy(desc, hdac_devices[i].desc, sizeof(desc)); result = BUS_PROBE_DEFAULT; @@ -1096,7 +1091,7 @@ hdac_attach(device_t dev) class = pci_get_class(dev); subclass = pci_get_subclass(dev); - for (i = 0; i < HDAC_DEVICES_LEN; i++) { + for (i = 0; i < nitems(hdac_devices); i++) { if (hdac_devices[i].model == model) { devid = i; break; @@ -1175,7 +1170,7 @@ hdac_attach(device_t dev) * * http://msdn2.microsoft.com/en-us/library/ms790324.aspx */ - for (i = 0; i < HDAC_PCIESNOOP_LEN; i++) { + for (i = 0; i < nitems(hdac_pcie_snoop); i++) { if (hdac_pcie_snoop[i].vendor != vendor) continue; sc->flags &= ~HDAC_F_DMA_NOCACHE; @@ -2078,7 +2073,7 @@ static device_method_t hdac_methods[] = DEVMETHOD(hdac_stream_getptr, hdac_stream_getptr), DEVMETHOD(hdac_unsol_alloc, hdac_unsol_alloc), DEVMETHOD(hdac_unsol_free, hdac_unsol_free), - { 0, 0 } + DEVMETHOD_END }; static driver_t hdac_driver = { @@ -2089,4 +2084,4 @@ static driver_t hdac_driver = { static devclass_t hdac_devclass; -DRIVER_MODULE(snd_hda, pci, hdac_driver, hdac_devclass, 0, 0); +DRIVER_MODULE(snd_hda, pci, hdac_driver, hdac_devclass, NULL, NULL); Modified: head/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdacc.c Wed Apr 23 19:25:59 2014 (r264831) +++ head/sys/dev/sound/pci/hda/hdacc.c Wed Apr 23 19:32:50 2014 (r264832) @@ -71,7 +71,7 @@ MALLOC_DEFINE(M_HDACC, "hdacc", "HDA COD static const struct { uint32_t id; uint16_t revid; - char *name; + const char *name; } hdacc_codecs[] = { { HDA_CODEC_CS4206, 0, "Cirrus Logic CS4206" }, { HDA_CODEC_CS4207, 0, "Cirrus Logic CS4207" }, @@ -341,7 +341,6 @@ static const struct { { HDA_CODEC_STACXXXX, 0, "Sigmatel" }, { HDA_CODEC_VTXXXX, 0, "VIA" }, }; -#define HDACC_CODECS_LEN (sizeof(hdacc_codecs) / sizeof(hdacc_codecs[0])) static int hdacc_suspend(device_t dev) @@ -381,7 +380,7 @@ hdacc_probe(device_t dev) id = ((uint32_t)hda_get_vendor_id(dev) << 16) + hda_get_device_id(dev); revid = ((uint32_t)hda_get_revision_id(dev) << 8) + hda_get_stepping_id(dev); - for (i = 0; i < HDACC_CODECS_LEN; i++) { + for (i = 0; i < nitems(hdacc_codecs); i++) { if (!HDA_DEV_MATCH(hdacc_codecs[i].id, id)) continue; if (hdacc_codecs[i].revid != 0 && @@ -389,7 +388,7 @@ hdacc_probe(device_t dev) continue; break; } - if (i < HDACC_CODECS_LEN) { + if (i < nitems(hdacc_codecs)) { if ((hdacc_codecs[i].id & 0xffff) != 0xffff) strlcpy(buf, hdacc_codecs[i].name, sizeof(buf)); else @@ -713,7 +712,7 @@ static device_method_t hdacc_methods[] = DEVMETHOD(hdac_unsol_free, hdacc_unsol_free), DEVMETHOD(hdac_unsol_intr, hdacc_unsol_intr), DEVMETHOD(hdac_pindump, hdacc_pindump), - { 0, 0 } + DEVMETHOD_END }; static driver_t hdacc_driver = { @@ -724,4 +723,4 @@ static driver_t hdacc_driver = { static devclass_t hdacc_devclass; -DRIVER_MODULE(snd_hda, hdac, hdacc_driver, hdacc_devclass, 0, 0); +DRIVER_MODULE(snd_hda, hdac, hdacc_driver, hdacc_devclass, NULL, NULL); From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 19:50:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D2114D5; Wed, 23 Apr 2014 19:50:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A6E710C2; Wed, 23 Apr 2014 19:50:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NJoaHj008461; Wed, 23 Apr 2014 19:50:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NJoaxw008460; Wed, 23 Apr 2014 19:50:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404231950.s3NJoaxw008460@svn.freebsd.org> From: Alexander Motin Date: Wed, 23 Apr 2014 19:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264834 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 19:50:36 -0000 Author: mav Date: Wed Apr 23 19:50:35 2014 New Revision: 264834 URL: http://svnweb.freebsd.org/changeset/base/264834 Log: Disable UNMAP support for STEC 842 SSDs. In some unknown cases UNMAP commands make device firmware stuck. MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Wed Apr 23 19:35:55 2014 (r264833) +++ head/sys/cam/scsi/scsi_da.c Wed Apr 23 19:50:35 2014 (r264834) @@ -99,7 +99,8 @@ typedef enum { DA_Q_NO_6_BYTE = 0x02, DA_Q_NO_PREVENT = 0x04, DA_Q_4K = 0x08, - DA_Q_NO_RC16 = 0x10 + DA_Q_NO_RC16 = 0x10, + DA_Q_NO_UNMAP = 0x20 } da_quirks; #define DA_Q_BIT_STRING \ @@ -349,6 +350,13 @@ static struct da_quirk_entry da_quirk_ta {T_DIRECT, SIP_MEDIA_FIXED, "COMPAQ", "RAID*", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE }, + { + /* + * The STEC 842 sometimes hang on UNMAP. + */ + {T_DIRECT, SIP_MEDIA_FIXED, "STEC", "S842E800M2", "*"}, + /*quirks*/ DA_Q_NO_UNMAP + }, /* USB mass storage devices supported by umass(4) */ { /* @@ -3202,7 +3210,7 @@ dadone(struct cam_periph *periph, union /* Ensure re-probe doesn't see old delete. */ softc->delete_available = 0; - if (lbp) { + if (lbp && (softc->quirks & DA_Q_NO_UNMAP) == 0) { /* * Based on older SBC-3 spec revisions * any of the UNMAP methods "may" be @@ -3412,7 +3420,8 @@ dadone(struct cam_periph *periph, union for (i = 0; i < sizeof(*ata_params) / 2; i++) ptr[i] = le16toh(ptr[i]); - if (ata_params->support_dsm & ATA_SUPPORT_DSM_TRIM) { + if (ata_params->support_dsm & ATA_SUPPORT_DSM_TRIM && + (softc->quirks & DA_Q_NO_UNMAP) == 0) { dadeleteflag(softc, DA_DELETE_ATA_TRIM, 1); if (ata_params->max_dsm_blocks != 0) softc->trim_max_ranges = min( From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 20:29:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0182E398; Wed, 23 Apr 2014 20:29:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC21213CE; Wed, 23 Apr 2014 20:29:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NKTm6P024631; Wed, 23 Apr 2014 20:29:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NKTkIn024612; Wed, 23 Apr 2014 20:29:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404232029.s3NKTkIn024612@svn.freebsd.org> From: Xin LI Date: Wed, 23 Apr 2014 20:29:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264835 - in head: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contri... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 20:29:49 -0000 Author: delphij Date: Wed Apr 23 20:29:46 2014 New Revision: 264835 URL: http://svnweb.freebsd.org/changeset/base/264835 Log: MFV r264829: 3897 zfs filesystem and snapshot limits MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Apr 23 19:50:35 2014 (r264834) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Apr 23 20:29:46 2014 (r264835) @@ -24,13 +24,13 @@ .\" Copyright (c) 2012, Bryan Drewery .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. .\" Copyright (c) 2013 Nexenta Systems, Inc. All Rights Reserved. -.\" Copyright (c) 2013, Joyent, Inc. All rights reserved. +.\" Copyright (c) 2014, Joyent, Inc. All rights reserved. .\" Copyright (c) 2013, Steven Hartland .\" Copyright (c) 2014, Xin LI .\" .\" $FreeBSD$ .\" -.Dd April 5, 2014 +.Dd April 23, 2014 .Dt ZFS 8 .Os .Sh NAME @@ -542,6 +542,13 @@ if the snapshot has been marked for defe .Qq Nm Cm destroy -d command. Otherwise, the property is .Cm off . +.It Sy filesystem_count +The total number of filesystems and volumes that exist under this location in the +dataset tree. +This value is only available when a +.Sy filesystem_limit +has +been set somewhere in the tree under which the dataset resides. .It Sy logicalreferenced The amount of space that is .Qq logically @@ -600,6 +607,12 @@ The compression ratio achieved for the space of this dataset, expressed as a multiplier. See also the .Sy compressratio property. +.It Sy snapshot_count +The total number of snapshots that exist under this location in the dataset tree. +This value is only available when a +.Sy snapshot_limit +has been set somewhere +in the tree under which the dataset resides. .It Sy type The type of dataset: .Sy filesystem , volume , No or Sy snapshot . @@ -1020,6 +1033,23 @@ The .Sy mlslabel property is currently not supported on .Fx . +.It Sy filesystem_limit Ns = Ns Ar count | Cm none +Limits the number of filesystems and volumes that can exist under this point in +the dataset tree. +The limit is not enforced if the user is allowed to change +the limit. +Setting a +.Sy filesystem_limit +on a descendent of a filesystem that +already has a +.Sy filesystem_limit +does not override the ancestor's +.Sy filesystem_limit , +but rather imposes an additional limit. +This feature must be enabled to be used +.Po see +.Xr zpool-features 7 +.Pc . .It Sy mountpoint Ns = Ns Ar path | Cm none | legacy Controls the mount point used for this file system. See the .Qq Sx Mount Points @@ -1061,6 +1091,27 @@ the ancestor's quota, but rather imposes Quotas cannot be set on volumes, as the .Sy volsize property acts as an implicit quota. +.It Sy snapshot_limit Ns = Ns Ar count | Cm none +Limits the number of snapshots that can be created on a dataset and its +descendents. +Setting a +.Sy snapshot_limit +on a descendent of a dataset that already +has a +.Sy snapshot_limit +does not override the ancestor's +.Sy snapshot_limit , +but +rather imposes an additional limit. +The limit is not enforced if the user is +allowed to change the limit. +For example, this means that recursive snapshots +taken from the global zone are counted against each delegated dataset within +a jail. +This feature must be enabled to be used +.Po see +.Xr zpool-features 7 +.Pc . .It Sy userquota@ Ns Ar user Ns = Ns Ar size | Cm none Limits the amount of space consumed by the specified user. Similar to the @@ -2738,6 +2789,7 @@ protocol .It dedup Ta property .It devices Ta property .It exec Ta property +.It filesystem_limit Ta property .It logbias Ta property .It jailed Ta property .It mlslabel Ta property @@ -2756,6 +2808,7 @@ protocol .It sharenfs Ta property .It sharesmb Ta property .It snapdir Ta property +.It snapshot_limit Ta property .It sync Ta property .It utf8only Ta property .It version Ta property @@ -3102,10 +3155,12 @@ pool/home/bob compression on pool/home/bob atime on default pool/home/bob devices on default pool/home/bob exec on default +pool/home/bob filesystem_limit none default pool/home/bob setuid on default pool/home/bob readonly off default pool/home/bob jailed off default pool/home/bob snapdir hidden default +pool/home/bob snapshot_limit none default pool/home/bob aclmode discard default pool/home/bob aclinherit restricted default pool/home/bob canmount on default Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Wed Apr 23 19:50:35 2014 (r264834) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Wed Apr 23 20:29:46 2014 (r264835) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 2, 2014 +.Dd April 23, 2014 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -187,6 +187,23 @@ This feature is .Sy active while there are any filesystems, volumes, or snapshots which were created after enabling this feature. +.It Sy filesystem_limits +.Bl -column "READ\-ONLY COMPATIBLE" "com.joyent:filesystem_limits" +.It GUID Ta com.joyent:filesystem_limits +.It READ\-ONLY COMPATIBLE Ta yes +.It DEPENDENCIES Ta extensible_dataset +.El +.Pp +This feature enables filesystem and snapshot limits. +These limits can be used +to control how many filesystems and/or snapshots can be created at the point in +the tree on which the limits are set. +.Pp +This feature is +.Sy active +once either of the limit properties has been +set on a dataset. +Once activated the feature is never deactivated. .It Sy lz4_compress .Bl -column "READ\-ONLY COMPATIBLE" "org.illumos:lz4_compress" .It GUID Ta org.illumos:lz4_compress Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Wed Apr 23 19:50:35 2014 (r264834) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Wed Apr 23 20:29:46 2014 (r264835) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . @@ -1910,6 +1911,10 @@ get_numeric_property(zfs_handle_t *zhp, case ZFS_PROP_REFQUOTA: case ZFS_PROP_RESERVATION: case ZFS_PROP_REFRESERVATION: + case ZFS_PROP_FILESYSTEM_LIMIT: + case ZFS_PROP_SNAPSHOT_LIMIT: + case ZFS_PROP_FILESYSTEM_COUNT: + case ZFS_PROP_SNAPSHOT_COUNT: *val = getprop_uint64(zhp, prop, source); if (*source == NULL) { @@ -2315,6 +2320,30 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop } break; + case ZFS_PROP_FILESYSTEM_LIMIT: + case ZFS_PROP_SNAPSHOT_LIMIT: + case ZFS_PROP_FILESYSTEM_COUNT: + case ZFS_PROP_SNAPSHOT_COUNT: + + if (get_numeric_property(zhp, prop, src, &source, &val) != 0) + return (-1); + + /* + * If limit is UINT64_MAX, we translate this into 'none' (unless + * literal is set), and indicate that it's the default value. + * Otherwise, we print the number nicely and indicate that it's + * set locally. + */ + if (literal) { + (void) snprintf(propbuf, proplen, "%llu", + (u_longlong_t)val); + } else if (val == UINT64_MAX) { + (void) strlcpy(propbuf, "none", proplen); + } else { + zfs_nicenum(val, propbuf, proplen); + } + break; + case ZFS_PROP_REFRATIO: case ZFS_PROP_COMPRESSRATIO: if (get_numeric_property(zhp, prop, src, &source, &val) != 0) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Wed Apr 23 19:50:35 2014 (r264834) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Wed Apr 23 20:29:46 2014 (r264835) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -1268,6 +1269,16 @@ zprop_parse_value(libzfs_handle_t *hdl, "use 'none' to disable quota/refquota")); goto error; } + + /* + * Special handling for "*_limit=none". In this case it's not + * 0 but UINT64_MAX. + */ + if ((type & ZFS_TYPE_DATASET) && isnone && + (prop == ZFS_PROP_FILESYSTEM_LIMIT || + prop == ZFS_PROP_SNAPSHOT_LIMIT)) { + *ivalp = UINT64_MAX; + } break; case PROP_TYPE_INDEX: Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Wed Apr 23 19:50:35 2014 (r264834) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Wed Apr 23 20:29:46 2014 (r264835) @@ -205,4 +205,13 @@ zpool_feature_init(void) "com.delphix:bookmarks", "bookmarks", "\"zfs bookmark\" command", B_TRUE, B_FALSE, B_FALSE, bookmarks_deps); + + static const spa_feature_t filesystem_limits_deps[] = { + SPA_FEATURE_EXTENSIBLE_DATASET, + SPA_FEATURE_NONE + }; + zfeature_register(SPA_FEATURE_FS_SS_LIMIT, + "com.joyent:filesystem_limits", "filesystem_limits", + "Filesystem and snapshot limits.", B_TRUE, B_FALSE, B_FALSE, + filesystem_limits_deps); } Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Wed Apr 23 19:50:35 2014 (r264834) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Wed Apr 23 20:29:46 2014 (r264835) @@ -48,6 +48,7 @@ typedef enum spa_feature { SPA_FEATURE_HOLE_BIRTH, SPA_FEATURE_EXTENSIBLE_DATASET, SPA_FEATURE_BOOKMARKS, + SPA_FEATURE_FS_SS_LIMIT, SPA_FEATURES } spa_feature_t; Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Wed Apr 23 19:50:35 2014 (r264834) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Wed Apr 23 20:29:46 2014 (r264835) @@ -383,6 +383,18 @@ zfs_prop_init(void) zprop_register_number(ZFS_PROP_REFRESERVATION, "refreservation", 0, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, " | none", "REFRESERV"); + zprop_register_number(ZFS_PROP_FILESYSTEM_LIMIT, "filesystem_limit", + UINT64_MAX, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM, + " | none", "FSLIMIT"); + zprop_register_number(ZFS_PROP_SNAPSHOT_LIMIT, "snapshot_limit", + UINT64_MAX, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, + " | none", "SSLIMIT"); + zprop_register_number(ZFS_PROP_FILESYSTEM_COUNT, "filesystem_count", + UINT64_MAX, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM, + "", "FSCOUNT"); + zprop_register_number(ZFS_PROP_SNAPSHOT_COUNT, "snapshot_count", + UINT64_MAX, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, + "", "SSCOUNT"); /* inherit number properties */ zprop_register_number(ZFS_PROP_RECORDSIZE, "recordsize", Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Wed Apr 23 19:50:35 2014 (r264834) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Wed Apr 23 20:29:46 2014 (r264835) @@ -22,6 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -758,9 +759,11 @@ dmu_objset_create_check(void *arg, dmu_t dsl_dir_rele(pdd, FTAG); return (SET_ERROR(EEXIST)); } + error = dsl_fs_ss_limit_check(pdd, 1, ZFS_PROP_FILESYSTEM_LIMIT, NULL, + doca->doca_cred); dsl_dir_rele(pdd, FTAG); - return (0); + return (error); } static void @@ -844,6 +847,12 @@ dmu_objset_clone_check(void *arg, dmu_tx dsl_dir_rele(pdd, FTAG); return (SET_ERROR(EXDEV)); } + error = dsl_fs_ss_limit_check(pdd, 1, ZFS_PROP_FILESYSTEM_LIMIT, NULL, + doca->doca_cred); + if (error != 0) { + dsl_dir_rele(pdd, FTAG); + return (SET_ERROR(EDQUOT)); + } dsl_dir_rele(pdd, FTAG); error = dsl_dataset_hold(dp, doca->doca_origin, FTAG, &origin); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed Apr 23 19:50:35 2014 (r264834) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed Apr 23 20:29:46 2014 (r264835) @@ -22,7 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. - * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright (c) 2014, Joyent, Inc. All rights reserved. * Copyright (c) 2012, Martin Matuska . All rights reserved. */ @@ -806,6 +806,20 @@ recv_begin_check_existing_impl(dmu_recv_ if (error != ENOENT) return (error == 0 ? EEXIST : error); + /* + * Check snapshot limit before receiving. We'll recheck again at the + * end, but might as well abort before receiving if we're already over + * the limit. + * + * Note that we do not check the file system limit with + * dsl_dir_fscount_check because the temporary %clones don't count + * against that limit. + */ + error = dsl_fs_ss_limit_check(ds->ds_dir, 1, ZFS_PROP_SNAPSHOT_LIMIT, + NULL, drba->drba_cred); + if (error != 0) + return (error); + if (fromguid != 0) { dsl_dataset_t *snap; uint64_t obj = ds->ds_phys->ds_prev_snap_obj; @@ -912,6 +926,25 @@ dmu_recv_begin_check(void *arg, dmu_tx_t if (error != 0) return (error); + /* + * Check filesystem and snapshot limits before receiving. We'll + * recheck snapshot limits again at the end (we create the + * filesystems and increment those counts during begin_sync). + */ + error = dsl_fs_ss_limit_check(ds->ds_dir, 1, + ZFS_PROP_FILESYSTEM_LIMIT, NULL, drba->drba_cred); + if (error != 0) { + dsl_dataset_rele(ds, FTAG); + return (error); + } + + error = dsl_fs_ss_limit_check(ds->ds_dir, 1, + ZFS_PROP_SNAPSHOT_LIMIT, NULL, drba->drba_cred); + if (error != 0) { + dsl_dataset_rele(ds, FTAG); + return (error); + } + if (drba->drba_origin != NULL) { dsl_dataset_t *origin; error = dsl_dataset_hold(dp, drba->drba_origin, @@ -1021,6 +1054,7 @@ dmu_recv_begin(char *tofs, char *tosnap, drc->drc_tosnap = tosnap; drc->drc_tofs = tofs; drc->drc_force = force; + drc->drc_cred = CRED(); if (drrb->drr_magic == BSWAP_64(DMU_BACKUP_MAGIC)) drc->drc_byteswap = B_TRUE; @@ -1740,7 +1774,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * return (error); } error = dsl_dataset_snapshot_check_impl(origin_head, - drc->drc_tosnap, tx, B_TRUE); + drc->drc_tosnap, tx, B_TRUE, 1, drc->drc_cred); dsl_dataset_rele(origin_head, FTAG); if (error != 0) return (error); @@ -1748,7 +1782,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * error = dsl_destroy_head_check_impl(drc->drc_ds, 1); } else { error = dsl_dataset_snapshot_check_impl(drc->drc_ds, - drc->drc_tosnap, tx, B_TRUE); + drc->drc_tosnap, tx, B_TRUE, 1, drc->drc_cred); } return (error); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Apr 23 19:50:35 2014 (r264834) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Apr 23 20:29:46 2014 (r264835) @@ -22,7 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Portions Copyright (c) 2011 Martin Matuska * Copyright (c) 2013 by Delphix. All rights reserved. - * Copyright (c) 2012, Joyent, Inc. All rights reserved. + * Copyright (c) 2014, Joyent, Inc. All rights reserved. * Copyright (c) 2014 RackTop Systems. */ @@ -321,7 +321,8 @@ dsl_dataset_snap_lookup(dsl_dataset_t *d } int -dsl_dataset_snap_remove(dsl_dataset_t *ds, const char *name, dmu_tx_t *tx) +dsl_dataset_snap_remove(dsl_dataset_t *ds, const char *name, dmu_tx_t *tx, + boolean_t adj_cnt) { objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset; uint64_t snapobj = ds->ds_phys->ds_snapnames_zapobj; @@ -338,6 +339,11 @@ dsl_dataset_snap_remove(dsl_dataset_t *d err = zap_remove_norm(mos, snapobj, name, mt, tx); if (err == ENOTSUP && mt == MT_FIRST) err = zap_remove(mos, snapobj, name, tx); + + if (err == 0 && adj_cnt) + dsl_fs_ss_count_adjust(ds->ds_dir, -1, + DD_FIELD_SNAPSHOT_COUNT, tx); + return (err); } @@ -765,6 +771,21 @@ dsl_dataset_create_sync(dsl_dir_t *pdd, dsl_deleg_set_create_perms(dd, tx, cr); + /* + * Since we're creating a new node we know it's a leaf, so we can + * initialize the counts if the limit feature is active. + */ + if (spa_feature_is_active(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT)) { + uint64_t cnt = 0; + objset_t *os = dd->dd_pool->dp_meta_objset; + + dsl_dir_zapify(dd, tx); + VERIFY0(zap_add(os, dd->dd_object, DD_FIELD_FILESYSTEM_COUNT, + sizeof (cnt), 1, &cnt, tx)); + VERIFY0(zap_add(os, dd->dd_object, DD_FIELD_SNAPSHOT_COUNT, + sizeof (cnt), 1, &cnt, tx)); + } + dsl_dir_rele(dd, FTAG); /* @@ -971,11 +992,12 @@ typedef struct dsl_dataset_snapshot_arg nvlist_t *ddsa_snaps; nvlist_t *ddsa_props; nvlist_t *ddsa_errors; + cred_t *ddsa_cr; } dsl_dataset_snapshot_arg_t; int dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, const char *snapname, - dmu_tx_t *tx, boolean_t recv) + dmu_tx_t *tx, boolean_t recv, uint64_t cnt, cred_t *cr) { int error; uint64_t value; @@ -1013,6 +1035,18 @@ dsl_dataset_snapshot_check_impl(dsl_data if (!recv && DS_IS_INCONSISTENT(ds)) return (SET_ERROR(EBUSY)); + /* + * Skip the check for temporary snapshots or if we have already checked + * the counts in dsl_dataset_snapshot_check. This means we really only + * check the count here when we're receiving a stream. + */ + if (cnt != 0 && cr != NULL) { + error = dsl_fs_ss_limit_check(ds->ds_dir, cnt, + ZFS_PROP_SNAPSHOT_LIMIT, NULL, cr); + if (error != 0) + return (error); + } + error = dsl_dataset_snapshot_reserve_space(ds, tx); if (error != 0) return (error); @@ -1028,6 +1062,99 @@ dsl_dataset_snapshot_check(void *arg, dm nvpair_t *pair; int rv = 0; + /* + * Pre-compute how many total new snapshots will be created for each + * level in the tree and below. This is needed for validating the + * snapshot limit when either taking a recursive snapshot or when + * taking multiple snapshots. + * + * The problem is that the counts are not actually adjusted when + * we are checking, only when we finally sync. For a single snapshot, + * this is easy, the count will increase by 1 at each node up the tree, + * but its more complicated for the recursive/multiple snapshot case. + * + * The dsl_fs_ss_limit_check function does recursively check the count + * at each level up the tree but since it is validating each snapshot + * independently we need to be sure that we are validating the complete + * count for the entire set of snapshots. We do this by rolling up the + * counts for each component of the name into an nvlist and then + * checking each of those cases with the aggregated count. + * + * This approach properly handles not only the recursive snapshot + * case (where we get all of those on the ddsa_snaps list) but also + * the sibling case (e.g. snapshot a/b and a/c so that we will also + * validate the limit on 'a' using a count of 2). + * + * We validate the snapshot names in the third loop and only report + * name errors once. + */ + if (dmu_tx_is_syncing(tx)) { + nvlist_t *cnt_track = NULL; + cnt_track = fnvlist_alloc(); + + /* Rollup aggregated counts into the cnt_track list */ + for (pair = nvlist_next_nvpair(ddsa->ddsa_snaps, NULL); + pair != NULL; + pair = nvlist_next_nvpair(ddsa->ddsa_snaps, pair)) { + char *pdelim; + uint64_t val; + char nm[MAXPATHLEN]; + + (void) strlcpy(nm, nvpair_name(pair), sizeof (nm)); + pdelim = strchr(nm, '@'); + if (pdelim == NULL) + continue; + *pdelim = '\0'; + + do { + if (nvlist_lookup_uint64(cnt_track, nm, + &val) == 0) { + /* update existing entry */ + fnvlist_add_uint64(cnt_track, nm, + val + 1); + } else { + /* add to list */ + fnvlist_add_uint64(cnt_track, nm, 1); + } + + pdelim = strrchr(nm, '/'); + if (pdelim != NULL) + *pdelim = '\0'; + } while (pdelim != NULL); + } + + /* Check aggregated counts at each level */ + for (pair = nvlist_next_nvpair(cnt_track, NULL); + pair != NULL; pair = nvlist_next_nvpair(cnt_track, pair)) { + int error = 0; + char *name; + uint64_t cnt = 0; + dsl_dataset_t *ds; + + name = nvpair_name(pair); + cnt = fnvpair_value_uint64(pair); + ASSERT(cnt > 0); + + error = dsl_dataset_hold(dp, name, FTAG, &ds); + if (error == 0) { + error = dsl_fs_ss_limit_check(ds->ds_dir, cnt, + ZFS_PROP_SNAPSHOT_LIMIT, NULL, + ddsa->ddsa_cr); + dsl_dataset_rele(ds, FTAG); + } + + if (error != 0) { + if (ddsa->ddsa_errors != NULL) + fnvlist_add_int32(ddsa->ddsa_errors, + name, error); + rv = error; + /* only report one error for this check */ + break; + } + } + nvlist_free(cnt_track); + } + for (pair = nvlist_next_nvpair(ddsa->ddsa_snaps, NULL); pair != NULL; pair = nvlist_next_nvpair(ddsa->ddsa_snaps, pair)) { int error = 0; @@ -1048,8 +1175,9 @@ dsl_dataset_snapshot_check(void *arg, dm if (error == 0) error = dsl_dataset_hold(dp, dsname, FTAG, &ds); if (error == 0) { + /* passing 0/NULL skips dsl_fs_ss_limit_check */ error = dsl_dataset_snapshot_check_impl(ds, - atp + 1, tx, B_FALSE); + atp + 1, tx, B_FALSE, 0, NULL); dsl_dataset_rele(ds, FTAG); } @@ -1061,6 +1189,7 @@ dsl_dataset_snapshot_check(void *arg, dm rv = error; } } + return (rv); } @@ -1088,6 +1217,7 @@ dsl_dataset_snapshot_sync_impl(dsl_datas bcmp(&os->os_phys->os_zil_header, &zero_zil, sizeof (zero_zil)) == 0); + dsl_fs_ss_count_adjust(ds->ds_dir, 1, DD_FIELD_SNAPSHOT_COUNT, tx); /* * The origin's ds_creation_txg has to be < TXG_INITIAL @@ -1266,6 +1396,7 @@ dsl_dataset_snapshot(nvlist_t *snaps, nv ddsa.ddsa_snaps = snaps; ddsa.ddsa_props = props; ddsa.ddsa_errors = errors; + ddsa.ddsa_cr = CRED(); if (error == 0) { error = dsl_sync_task(firstname, dsl_dataset_snapshot_check, @@ -1315,8 +1446,9 @@ dsl_dataset_snapshot_tmp_check(void *arg if (error != 0) return (error); + /* NULL cred means no limit check for tmp snapshot */ error = dsl_dataset_snapshot_check_impl(ds, ddsta->ddsta_snapname, - tx, B_FALSE); + tx, B_FALSE, 0, NULL); if (error != 0) { dsl_dataset_rele(ds, FTAG); return (error); @@ -1689,7 +1821,8 @@ dsl_dataset_rename_snapshot_sync_impl(ds spa_history_log_internal_ds(ds, "rename", tx, "-> @%s", ddrsa->ddrsa_newsnapname); - VERIFY0(dsl_dataset_snap_remove(hds, ddrsa->ddrsa_oldsnapname, tx)); + VERIFY0(dsl_dataset_snap_remove(hds, ddrsa->ddrsa_oldsnapname, tx, + B_FALSE)); mutex_enter(&ds->ds_lock); (void) strcpy(ds->ds_snapname, ddrsa->ddrsa_newsnapname); mutex_exit(&ds->ds_lock); @@ -1936,6 +2069,7 @@ typedef struct dsl_dataset_promote_arg { dsl_dataset_t *origin_origin; /* origin of the origin */ uint64_t used, comp, uncomp, unique, cloneusedsnap, originusedsnap; char *err_ds; + cred_t *cr; } dsl_dataset_promote_arg_t; static int snaplist_space(list_t *l, uint64_t mintxg, uint64_t *spacep); @@ -1953,6 +2087,7 @@ dsl_dataset_promote_check(void *arg, dmu dsl_dataset_t *origin_ds; int err; uint64_t unused; + uint64_t ss_mv_cnt; err = promote_hold(ddpa, dp, FTAG); if (err != 0) @@ -1999,6 +2134,7 @@ dsl_dataset_promote_check(void *arg, dmu * Note however, if we stop before we reach the ORIGIN we get: * uN + kN + kN-1 + ... + kM - uM-1 */ + ss_mv_cnt = 0; ddpa->used = origin_ds->ds_phys->ds_referenced_bytes; ddpa->comp = origin_ds->ds_phys->ds_compressed_bytes; ddpa->uncomp = origin_ds->ds_phys->ds_uncompressed_bytes; @@ -2007,6 +2143,8 @@ dsl_dataset_promote_check(void *arg, dmu uint64_t val, dlused, dlcomp, dluncomp; dsl_dataset_t *ds = snap->ds; + ss_mv_cnt++; + /* * If there are long holds, we won't be able to evict * the objset. @@ -2049,9 +2187,9 @@ dsl_dataset_promote_check(void *arg, dmu ddpa->origin_origin->ds_phys->ds_uncompressed_bytes; } - /* Check that there is enough space here */ + /* Check that there is enough space and limit headroom here */ err = dsl_dir_transfer_possible(origin_ds->ds_dir, hds->ds_dir, - ddpa->used); + 0, ss_mv_cnt, ddpa->used, ddpa->cr); if (err != 0) goto out; @@ -2191,10 +2329,12 @@ dsl_dataset_promote_sync(void *arg, dmu_ /* move snap name entry */ VERIFY0(dsl_dataset_get_snapname(ds)); VERIFY0(dsl_dataset_snap_remove(origin_head, - ds->ds_snapname, tx)); + ds->ds_snapname, tx, B_TRUE)); VERIFY0(zap_add(dp->dp_meta_objset, hds->ds_phys->ds_snapnames_zapobj, ds->ds_snapname, 8, 1, &ds->ds_object, tx)); + dsl_fs_ss_count_adjust(hds->ds_dir, 1, + DD_FIELD_SNAPSHOT_COUNT, tx); /* change containing dsl_dir */ dmu_buf_will_dirty(ds->ds_dbuf, tx); @@ -2432,6 +2572,7 @@ dsl_dataset_promote(const char *name, ch ddpa.ddpa_clonename = name; ddpa.err_ds = conflsnap; + ddpa.cr = CRED(); return (dsl_sync_task(name, dsl_dataset_promote_check, dsl_dataset_promote_sync, &ddpa, 2 + numsnaps)); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Wed Apr 23 19:50:35 2014 (r264834) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Wed Apr 23 20:29:46 2014 (r264835) @@ -22,6 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. + * Copyright (c) 2013 by Joyent, Inc. All rights reserved. */ #include @@ -430,7 +431,7 @@ dsl_destroy_snapshot_sync_impl(dsl_datas ASSERT3U(val, ==, obj); } #endif - VERIFY0(dsl_dataset_snap_remove(ds_head, ds->ds_snapname, tx)); + VERIFY0(dsl_dataset_snap_remove(ds_head, ds->ds_snapname, tx, B_TRUE)); dsl_dataset_rele(ds_head, FTAG); if (ds_prev != NULL) @@ -657,6 +658,17 @@ dsl_dir_destroy_sync(uint64_t ddobj, dmu ASSERT0(dd->dd_phys->dd_head_dataset_obj); /* + * Decrement the filesystem count for all parent filesystems. + * + * When we receive an incremental stream into a filesystem that already + * exists, a temporary clone is created. We never count this temporary + * clone, whose name begins with a '%'. + */ + if (dd->dd_myname[0] != '%' && dd->dd_parent != NULL) + dsl_fs_ss_count_adjust(dd->dd_parent, -1, + DD_FIELD_FILESYSTEM_COUNT, tx); + + /* * Remove our reservation. The impl() routine avoids setting the * actual property, which would require the (already destroyed) ds. */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Wed Apr 23 19:50:35 2014 (r264834) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Wed Apr 23 20:29:46 2014 (r264835) @@ -23,6 +23,7 @@ * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2014 Joyent, Inc. All rights reserved. */ #include @@ -44,7 +45,86 @@ #ifdef _KERNEL #include #endif +#include +#include +#include #include "zfs_namecheck.h" +#include "zfs_prop.h" + +/* + * Filesystem and Snapshot Limits + * ------------------------------ + * + * These limits are used to restrict the number of filesystems and/or snapshots + * that can be created at a given level in the tree or below. A typical + * use-case is with a delegated dataset where the administrator wants to ensure + * that a user within the zone is not creating too many additional filesystems + * or snapshots, even though they're not exceeding their space quota. + * + * The filesystem and snapshot counts are stored as extensible properties. This + * capability is controlled by a feature flag and must be enabled to be used. + * Once enabled, the feature is not active until the first limit is set. At + * that point, future operations to create/destroy filesystems or snapshots + * will validate and update the counts. + * + * Because the count properties will not exist before the feature is active, + * the counts are updated when a limit is first set on an uninitialized + * dsl_dir node in the tree (The filesystem/snapshot count on a node includes + * all of the nested filesystems/snapshots. Thus, a new leaf node has a + * filesystem count of 0 and a snapshot count of 0. Non-existent filesystem and + * snapshot count properties on a node indicate uninitialized counts on that + * node.) When first setting a limit on an uninitialized node, the code starts + * at the filesystem with the new limit and descends into all sub-filesystems + * to add the count properties. + * + * In practice this is lightweight since a limit is typically set when the + * filesystem is created and thus has no children. Once valid, changing the + * limit value won't require a re-traversal since the counts are already valid. + * When recursively fixing the counts, if a node with a limit is encountered + * during the descent, the counts are known to be valid and there is no need to + * descend into that filesystem's children. The counts on filesystems above the + * one with the new limit will still be uninitialized, unless a limit is + * eventually set on one of those filesystems. The counts are always recursively + * updated when a limit is set on a dataset, unless there is already a limit. + * When a new limit value is set on a filesystem with an existing limit, it is + * possible for the new limit to be less than the current count at that level + * since a user who can change the limit is also allowed to exceed the limit. + * + * Once the feature is active, then whenever a filesystem or snapshot is + * created, the code recurses up the tree, validating the new count against the + * limit at each initialized level. In practice, most levels will not have a + * limit set. If there is a limit at any initialized level up the tree, the + * check must pass or the creation will fail. Likewise, when a filesystem or + * snapshot is destroyed, the counts are recursively adjusted all the way up + * the initizized nodes in the tree. Renaming a filesystem into different point + * in the tree will first validate, then update the counts on each branch up to + * the common ancestor. A receive will also validate the counts and then update + * them. + * + * An exception to the above behavior is that the limit is not enforced if the + * user has permission to modify the limit. This is primarily so that + * recursive snapshots in the global zone always work. We want to prevent a + * denial-of-service in which a lower level delegated dataset could max out its + * limit and thus block recursive snapshots from being taken in the global zone. + * Because of this, it is possible for the snapshot count to be over the limit + * and snapshots taken in the global zone could cause a lower level dataset to + * hit or exceed its limit. The administrator taking the global zone recursive + * snapshot should be aware of this side-effect and behave accordingly. + * For consistency, the filesystem limit is also not enforced if the user can + * modify the limit. + * + * The filesystem and snapshot limits are validated by dsl_fs_ss_limit_check() + * and updated by dsl_fs_ss_count_adjust(). A new limit value is setup in + * dsl_dir_activate_fs_ss_limit() and the counts are adjusted, if necessary, by + * dsl_dir_init_fs_ss_count(). + * + * There is a special case when we receive a filesystem that already exists. In + * this case a temporary clone name of %X is created (see dmu_recv_begin). We + * never update the filesystem counts for temporary clones. + * + * Likewise, we do not update the snapshot counts for temporary snapshots, + * such as those created by zfs diff. + */ static uint64_t dsl_dir_space_towrite(dsl_dir_t *dd); @@ -383,6 +463,402 @@ dsl_dir_hold(dsl_pool_t *dp, const char return (err); } +/* + * If the counts are already initialized for this filesystem and its + * descendants then do nothing, otherwise initialize the counts. + * + * The counts on this filesystem, and those below, may be uninitialized due to + * either the use of a pre-existing pool which did not support the + * filesystem/snapshot limit feature, or one in which the feature had not yet + * been enabled. + * + * Recursively descend the filesystem tree and update the filesystem/snapshot + * counts on each filesystem below, then update the cumulative count on the + * current filesystem. If the filesystem already has a count set on it, + * then we know that its counts, and the counts on the filesystems below it, + * are already correct, so we don't have to update this filesystem. + */ +static void +dsl_dir_init_fs_ss_count(dsl_dir_t *dd, dmu_tx_t *tx) +{ + uint64_t my_fs_cnt = 0; + uint64_t my_ss_cnt = 0; + dsl_pool_t *dp = dd->dd_pool; + objset_t *os = dp->dp_meta_objset; + zap_cursor_t *zc; + zap_attribute_t *za; + dsl_dataset_t *ds; + + ASSERT(spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT)); + ASSERT(dsl_pool_config_held(dp)); + ASSERT(dmu_tx_is_syncing(tx)); + + dsl_dir_zapify(dd, tx); + + /* + * If the filesystem count has already been initialized then we + * don't need to recurse down any further. + */ + if (zap_contains(os, dd->dd_object, DD_FIELD_FILESYSTEM_COUNT) == 0) + return; + + zc = kmem_alloc(sizeof (zap_cursor_t), KM_SLEEP); + za = kmem_alloc(sizeof (zap_attribute_t), KM_SLEEP); + + /* Iterate my child dirs */ + for (zap_cursor_init(zc, os, dd->dd_phys->dd_child_dir_zapobj); + zap_cursor_retrieve(zc, za) == 0; zap_cursor_advance(zc)) { + dsl_dir_t *chld_dd; + uint64_t count; + + VERIFY0(dsl_dir_hold_obj(dp, za->za_first_integer, NULL, FTAG, + &chld_dd)); + + /* + * Ignore hidden ($FREE, $MOS & $ORIGIN) objsets and + * temporary datasets. + */ + if (chld_dd->dd_myname[0] == '$' || + chld_dd->dd_myname[0] == '%') { + dsl_dir_rele(chld_dd, FTAG); + continue; + } + + my_fs_cnt++; /* count this child */ + + dsl_dir_init_fs_ss_count(chld_dd, tx); + + VERIFY0(zap_lookup(os, chld_dd->dd_object, + DD_FIELD_FILESYSTEM_COUNT, sizeof (count), 1, &count)); + my_fs_cnt += count; + VERIFY0(zap_lookup(os, chld_dd->dd_object, + DD_FIELD_SNAPSHOT_COUNT, sizeof (count), 1, &count)); + my_ss_cnt += count; + + dsl_dir_rele(chld_dd, FTAG); + } + zap_cursor_fini(zc); + /* Count my snapshots (we counted children's snapshots above) */ + VERIFY0(dsl_dataset_hold_obj(dd->dd_pool, + dd->dd_phys->dd_head_dataset_obj, FTAG, &ds)); + + for (zap_cursor_init(zc, os, ds->ds_phys->ds_snapnames_zapobj); + zap_cursor_retrieve(zc, za) == 0; + zap_cursor_advance(zc)) { + /* Don't count temporary snapshots */ + if (za->za_name[0] != '%') + my_ss_cnt++; + } + + dsl_dataset_rele(ds, FTAG); + + kmem_free(zc, sizeof (zap_cursor_t)); + kmem_free(za, sizeof (zap_attribute_t)); + + /* we're in a sync task, update counts */ + dmu_buf_will_dirty(dd->dd_dbuf, tx); + VERIFY0(zap_add(os, dd->dd_object, DD_FIELD_FILESYSTEM_COUNT, + sizeof (my_fs_cnt), 1, &my_fs_cnt, tx)); + VERIFY0(zap_add(os, dd->dd_object, DD_FIELD_SNAPSHOT_COUNT, + sizeof (my_ss_cnt), 1, &my_ss_cnt, tx)); +} + +static int +dsl_dir_actv_fs_ss_limit_check(void *arg, dmu_tx_t *tx) +{ + char *ddname = (char *)arg; + dsl_pool_t *dp = dmu_tx_pool(tx); + dsl_dataset_t *ds; + dsl_dir_t *dd; + int error; + + error = dsl_dataset_hold(dp, ddname, FTAG, &ds); + if (error != 0) + return (error); + + if (!spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT)) { + dsl_dataset_rele(ds, FTAG); + return (SET_ERROR(ENOTSUP)); + } + + dd = ds->ds_dir; + if (spa_feature_is_active(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT) && + dsl_dir_is_zapified(dd) && + zap_contains(dp->dp_meta_objset, dd->dd_object, + DD_FIELD_FILESYSTEM_COUNT) == 0) { + dsl_dataset_rele(ds, FTAG); + return (SET_ERROR(EALREADY)); + } + + dsl_dataset_rele(ds, FTAG); + return (0); +} + +static void +dsl_dir_actv_fs_ss_limit_sync(void *arg, dmu_tx_t *tx) +{ + char *ddname = (char *)arg; + dsl_pool_t *dp = dmu_tx_pool(tx); + dsl_dataset_t *ds; + spa_t *spa; + + VERIFY0(dsl_dataset_hold(dp, ddname, FTAG, &ds)); + + spa = dsl_dataset_get_spa(ds); + + if (!spa_feature_is_active(spa, SPA_FEATURE_FS_SS_LIMIT)) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 20:32:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09B3A5DD; Wed, 23 Apr 2014 20:32:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9C9C14B3; Wed, 23 Apr 2014 20:32:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NKWdRK028069; Wed, 23 Apr 2014 20:32:39 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NKWdx8028067; Wed, 23 Apr 2014 20:32:39 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404232032.s3NKWdx8028067@svn.freebsd.org> From: Xin LI Date: Wed, 23 Apr 2014 20:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264836 - in head/sys/cddl/contrib/opensolaris: common/avl uts/common/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 20:32:40 -0000 Author: delphij Date: Wed Apr 23 20:32:39 2014 New Revision: 264836 URL: http://svnweb.freebsd.org/changeset/base/264836 Log: MFV r264830: 4745 fix AVL code misspellings MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/common/avl/avl.c head/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/common/avl/avl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/avl/avl.c Wed Apr 23 20:29:46 2014 (r264835) +++ head/sys/cddl/contrib/opensolaris/common/avl/avl.c Wed Apr 23 20:32:39 2014 (r264836) @@ -37,7 +37,7 @@ * insertion and deletion relatively efficiently. Searching the tree is * still a fast operation, roughly O(log(N)). * - * The key to insertion and deletion is a set of tree maniuplations called + * The key to insertion and deletion is a set of tree manipulations called * rotations, which bring unbalanced subtrees back into the semi-balanced state. * * This implementation of AVL trees has the following peculiarities: @@ -45,7 +45,7 @@ * - The AVL specific data structures are physically embedded as fields * in the "using" data structures. To maintain generality the code * must constantly translate between "avl_node_t *" and containing - * data structure "void *"s by adding/subracting the avl_offset. + * data structure "void *"s by adding/subtracting the avl_offset. * * - Since the AVL data is always embedded in other structures, there is * no locking or memory allocation in the AVL routines. This must be @@ -94,7 +94,7 @@ #include /* - * Small arrays to translate between balance (or diff) values and child indeces. + * Small arrays to translate between balance (or diff) values and child indices. * * Code that deals with binary tree data structures will randomly use * left and right children when examining a tree. C "if()" statements @@ -114,7 +114,8 @@ static const int avl_balance2child[] = * * - If there is a left child, go to it, then to it's rightmost descendant. * - * - otherwise we return thru parent nodes until we've come from a right child. + * - otherwise we return through parent nodes until we've come from a right + * child. * * Return Value: * NULL - if at the end of the nodes @@ -919,7 +920,7 @@ avl_is_empty(avl_tree_t *tree) /* * Post-order tree walk used to visit all tree nodes and destroy the tree - * in post order. This is used for destroying a tree w/o paying any cost + * in post order. This is used for destroying a tree without paying any cost * for rebalancing it. * * example: Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h Wed Apr 23 20:29:46 2014 (r264835) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h Wed Apr 23 20:32:39 2014 (r264836) @@ -39,7 +39,7 @@ extern "C" { #include /* - * This is a generic implemenatation of AVL trees for use in the Solaris kernel. + * This is a generic implementation of AVL trees for use in the Solaris kernel. * The interfaces provide an efficient way of implementing an ordered set of * data structures. * @@ -175,7 +175,7 @@ extern void avl_insert(avl_tree_t *tree, * Insert "new_data" in "tree" in the given "direction" either after * or before the data "here". * - * This might be usefull for avl clients caching recently accessed + * This might be useful for avl clients caching recently accessed * data to avoid doing avl_find() again for insertion. * * new_data - new data to insert From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 20:55:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81599EA6; Wed, 23 Apr 2014 20:55:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E1311718; Wed, 23 Apr 2014 20:55:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NKt8Tp036691; Wed, 23 Apr 2014 20:55:08 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NKt8Of036690; Wed, 23 Apr 2014 20:55:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201404232055.s3NKt8Of036690@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Apr 2014 20:55:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264837 - head/share/examples/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 20:55:08 -0000 Author: jhb Date: Wed Apr 23 20:55:07 2014 New Revision: 264837 URL: http://svnweb.freebsd.org/changeset/base/264837 Log: - Format the usage so that it fits in 80 cols and follows the standard convention for long usage lines in manpages. - Sort the option string passed to getopts and the case statements for the option returned by getopts. - Add a -C option to specify the device to be used for the console (defaults to 'stdio') (This could be let vmrun be run in the background by using /dev/nmdm0B or the like) - Add a -H option to specify a host path to pass to bhyveload(8) via -h to back the host0: filesystem in bhyveload(8) (useful for loading kernels from the host into the guest without having to copy them into the guest's disk image first) Reviewed by: neel MFC after: 2 weeks Modified: head/share/examples/bhyve/vmrun.sh Modified: head/share/examples/bhyve/vmrun.sh ============================================================================== --- head/share/examples/bhyve/vmrun.sh Wed Apr 23 20:32:39 2014 (r264836) +++ head/share/examples/bhyve/vmrun.sh Wed Apr 23 20:55:07 2014 (r264837) @@ -34,18 +34,25 @@ FBSDRUN=/usr/sbin/bhyve DEFAULT_MEMSIZE=512M DEFAULT_CPUS=2 DEFAULT_TAPDEV=tap0 +DEFAULT_CONSOLE=stdio DEFAULT_VIRTIO_DISK="./diskdev" DEFAULT_ISOFILE="./release.iso" usage() { - echo "Usage: vmrun.sh [-hai][-g ][-m ][-d ][-e ][-I ][-t ] " + echo "Usage: vmrun.sh [-ahi] [-c ] [-C ] [-d ]" + echo " [-e ] [-g ] [-H ]" + echo " [-I ] [-m ]" + echo " [-t ] " + echo "" echo " -h: display this help message" - echo " -a: force memory mapped local apic access" + echo " -a: force memory mapped local APIC access" echo " -c: number of virtual cpus (default is ${DEFAULT_CPUS})" + echo " -C: console device (default is ${DEFAULT_CONSOLE})" echo " -d: virtio diskdev file (default is ${DEFAULT_VIRTIO_DISK})" echo " -e: set FreeBSD loader environment variable" echo " -g: listen for connection from kgdb at " + echo " -H: host filesystem to export to the loader" echo " -i: force boot of the Installation CDROM image" echo " -I: Installation CDROM image location (default is ${DEFAULT_ISOFILE})" echo " -m: memory size (default is ${DEFAULT_MEMSIZE})" @@ -69,28 +76,36 @@ fi force_install=0 isofile=${DEFAULT_ISOFILE} memsize=${DEFAULT_MEMSIZE} +console=${DEFAULT_CONSOLE} cpus=${DEFAULT_CPUS} virtio_diskdev=${DEFAULT_VIRTIO_DISK} tapdev=${DEFAULT_TAPDEV} apic_opt="" gdbport=0 -env_opt="" +loader_opt="" -while getopts haic:e:g:I:m:d:t: c ; do +while getopts ac:C:d:e:g:hH:iI:m:t: c ; do case $c in - h) - usage - ;; a) apic_opt="-a" ;; + c) + cpus=${OPTARG} + ;; + C) + console=${OPTARG} + ;; d) virtio_diskdev=${OPTARG} ;; e) - env_opt="${env_opt} -e ${OPTARG}" + loader_opt="${loader_opt} -e ${OPTARG}" ;; - g) gdbport=${OPTARG} + g) + gdbport=${OPTARG} + ;; + H) + host_base=`realpath ${OPTARG}` ;; i) force_install=1 @@ -98,16 +113,13 @@ while getopts haic:e:g:I:m:d:t: c ; do I) isofile=${OPTARG} ;; - c) - cpus=${OPTARG} - ;; m) memsize=${OPTARG} ;; t) tapdev=${OPTARG} ;; - \?) + *) usage ;; esac @@ -120,6 +132,9 @@ if [ $# -ne 1 ]; then fi vmname="$1" +if [ -n "${host_base}" ]; then + loader_opt="${loader_opt} -h ${host_base}" +fi # Create the virtio diskdev file if needed if [ ! -f ${virtio_diskdev} ]; then @@ -168,7 +183,8 @@ while [ 1 ]; do installer_opt="" fi - ${LOADER} -m ${memsize} -d ${BOOTDISK} ${env_opt} ${vmname} + ${LOADER} -c ${console} -m ${memsize} -d ${BOOTDISK} ${loader_opt} \ + ${vmname} if [ $? -ne 0 ]; then break fi @@ -179,7 +195,7 @@ while [ 1 ]; do -s 1:0,lpc \ -s 2:0,virtio-net,${tapdev} \ -s 3:0,virtio-blk,${virtio_diskdev} \ - -l com1,stdio \ + -l com1,${console} \ ${installer_opt} \ ${vmname} if [ $? -ne 0 ]; then From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 21:20:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9495632; Wed, 23 Apr 2014 21:20:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C93919B4; Wed, 23 Apr 2014 21:20:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NLKtTm045944; Wed, 23 Apr 2014 21:20:55 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NLKtnh045943; Wed, 23 Apr 2014 21:20:55 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201404232120.s3NLKtnh045943@svn.freebsd.org> From: Michael Tuexen Date: Wed, 23 Apr 2014 21:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264838 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 21:20:55 -0000 Author: tuexen Date: Wed Apr 23 21:20:55 2014 New Revision: 264838 URL: http://svnweb.freebsd.org/changeset/base/264838 Log: Don't free an mbuf twice. This only happens in very rare error cases where the peer sends illegal sequencing information in DATA chunks for an existing association. MFC after: 3 days. Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Apr 23 20:55:07 2014 (r264837) +++ head/sys/netinet/sctp_indata.c Wed Apr 23 21:20:55 2014 (r264838) @@ -1717,6 +1717,9 @@ failed_pdapi_express_del: stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_15; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; + if (last_chunk) { + *m = NULL; + } return (0); } else { if (sctp_does_tsn_belong_to_reasm(asoc, control->sinfo_tsn)) { @@ -1733,6 +1736,9 @@ failed_pdapi_express_del: stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; + if (last_chunk) { + *m = NULL; + } return (0); } } @@ -1759,6 +1765,9 @@ failed_pdapi_express_del: stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_17; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); *abort_flag = 1; + if (last_chunk) { + *m = NULL; + } return (0); } } @@ -1822,6 +1831,9 @@ failed_pdapi_express_del: } else { sctp_queue_data_to_stream(stcb, asoc, control, abort_flag); if (*abort_flag) { + if (last_chunk) { + *m = NULL; + } return (0); } } @@ -1834,7 +1846,9 @@ failed_pdapi_express_del: * the assoc is now gone and chk was put onto the * reasm queue, which has all been freed. */ - *m = NULL; + if (last_chunk) { + *m = NULL; + } return (0); } } From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 22:04:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CD26CEF; Wed, 23 Apr 2014 22:04:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77EDC1D2C; Wed, 23 Apr 2014 22:04:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NM46g5064972; Wed, 23 Apr 2014 22:04:06 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NM45NQ064960; Wed, 23 Apr 2014 22:04:05 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201404232204.s3NM45NQ064960@svn.freebsd.org> From: Devin Teske Date: Wed, 23 Apr 2014 22:04:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264840 - in head/usr.sbin/bsdconfig: dot examples networking/share share share/media share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 22:04:06 -0000 Author: dteske Date: Wed Apr 23 22:04:04 2014 New Revision: 264840 URL: http://svnweb.freebsd.org/changeset/base/264840 Log: Implement GEOM based media device classification. You'll notice a few different things from this commit: + More devices. Devices that were previously ignored are now present. + Faster device scanning. "There is no try, only Do" -- f_device_try() is no longer the basis of device scanning as GEOM provides [nearly] all devices (doesn't provide network devices). + More information available as non-root. Usually you have to be root to do things like taste filesystems, and that limits the amount of information available to non-root users; with GEOM, we see all even running unprivileged as the brunt of information (except for so- called ``dangerously dedicated'' file systems) is represented by the `kern.geom.confxml' sysctl(8) MIB. NB: Only really useful for external scripts that use the API and run as non-root; where this code is used in bsdconfig(8) and bsdinstall(8) you are running as root so can detect even ``dangerously dedicated'' file systems that are not present in GEOM; e.g., no PART class for a DOS filesystem written directly to disk without partition table). + No more use of legacy tools such as diskinfo(8) to get disk capacity or fdisk(8) to see partitions. MFC after: 1 week Added: head/usr.sbin/bsdconfig/share/geom.subr (contents, props changed) Modified: head/usr.sbin/bsdconfig/dot/dot head/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh head/usr.sbin/bsdconfig/examples/browse_packages_http.sh head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/share/Makefile head/usr.sbin/bsdconfig/share/common.subr head/usr.sbin/bsdconfig/share/device.subr head/usr.sbin/bsdconfig/share/media/cdrom.subr head/usr.sbin/bsdconfig/share/media/common.subr head/usr.sbin/bsdconfig/share/media/directory.subr head/usr.sbin/bsdconfig/share/media/dos.subr head/usr.sbin/bsdconfig/share/media/floppy.subr head/usr.sbin/bsdconfig/share/media/ftp.subr head/usr.sbin/bsdconfig/share/media/http.subr head/usr.sbin/bsdconfig/share/media/nfs.subr head/usr.sbin/bsdconfig/share/media/tcpip.subr head/usr.sbin/bsdconfig/share/media/ufs.subr head/usr.sbin/bsdconfig/share/media/usb.subr head/usr.sbin/bsdconfig/share/packages/index.subr head/usr.sbin/bsdconfig/share/packages/packages.subr head/usr.sbin/bsdconfig/share/struct.subr Modified: head/usr.sbin/bsdconfig/dot/dot ============================================================================== --- head/usr.sbin/bsdconfig/dot/dot Wed Apr 23 21:52:43 2014 (r264839) +++ head/usr.sbin/bsdconfig/dot/dot Wed Apr 23 22:04:04 2014 (r264840) @@ -29,7 +29,7 @@ ############################################################ INCLUDES # Prevent common.subr from auto initializing debugging (this is not an inter- -# active utility that requires debugging; also `-d' has been repurposed). +# active utility so does not require debugging; also `-d' has been repurposed). # DEBUG_SELF_INITIALIZE=NO Modified: head/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh ============================================================================== --- head/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh Wed Apr 23 21:52:43 2014 (r264839) +++ head/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh Wed Apr 23 22:04:04 2014 (r264840) @@ -18,7 +18,7 @@ if [ ! -e "$TMPDIR/packages/INDEX" ]; th mediaSetFTP mediaOpen f_show_info "Downloading packages/INDEX from\n %s" "$_ftpPath" - f_device_get media packages/INDEX > $TMPDIR/packages/INDEX + f_device_get device_media packages/INDEX > $TMPDIR/packages/INDEX fi _directoryPath=$TMPDIR mediaSetDirectory Modified: head/usr.sbin/bsdconfig/examples/browse_packages_http.sh ============================================================================== --- head/usr.sbin/bsdconfig/examples/browse_packages_http.sh Wed Apr 23 21:52:43 2014 (r264839) +++ head/usr.sbin/bsdconfig/examples/browse_packages_http.sh Wed Apr 23 22:04:04 2014 (r264840) @@ -18,7 +18,7 @@ if [ ! -e "$TMPDIR/packages/INDEX" ]; th mediaSetHTTP mediaOpen f_show_info "Downloading packages/INDEX from\n %s" "$_httpPath" - f_device_get media packages/INDEX > $TMPDIR/packages/INDEX + f_device_get device_media packages/INDEX > $TMPDIR/packages/INDEX fi _directoryPath=$TMPDIR mediaSetDirectory Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Wed Apr 23 21:52:43 2014 (r264839) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Wed Apr 23 22:04:04 2014 (r264840) @@ -75,10 +75,11 @@ f_dialog_menu_netdev() # # Get list of usable network interfaces # - local devs if iflist= # Calculated below + local dev devs if iflist= # Calculated below f_device_rescan_network f_device_find "" $DEVICE_TYPE_NETWORK devs - for if in $devs; do + for dev in $devs; do + f_struct "$dev" get name if || continue # Skip unsavory interfaces case "$if" in lo[0-9]*|ppp[0-9]*|sl[0-9]*|faith[0-9]*) continue ;; Modified: head/usr.sbin/bsdconfig/share/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/share/Makefile Wed Apr 23 21:52:43 2014 (r264839) +++ head/usr.sbin/bsdconfig/share/Makefile Wed Apr 23 22:04:04 2014 (r264840) @@ -5,7 +5,7 @@ NO_OBJ= SUBDIR= media packages FILESDIR= ${SHAREDIR}/bsdconfig -FILES= common.subr device.subr dialog.subr keymap.subr \ +FILES= common.subr device.subr dialog.subr geom.subr keymap.subr \ mustberoot.subr script.subr strings.subr struct.subr \ sysrc.subr variable.subr Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Wed Apr 23 21:52:43 2014 (r264839) +++ head/usr.sbin/bsdconfig/share/common.subr Wed Apr 23 22:04:04 2014 (r264840) @@ -153,7 +153,7 @@ f_debug_init() # Process stored command-line arguments # set -- $ARGV - local OPTIND flag + local OPTIND OPTARG flag f_dprintf "f_debug_init: ARGV=[%s] GETOPTS_STDARGS=[%s]" \ "$ARGV" "$GETOPTS_STDARGS" while getopts "$GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS" flag \ @@ -798,14 +798,30 @@ f_running_as_init() } # f_mounted $local_directory +# f_mounted -b $device # -# Return success if a filesystem is mounted on a particular directory. +# Return success if a filesystem is mounted on a particular directory. If `-b' +# is present, instead check that the block device (or a partition thereof) is +# mounted. # f_mounted() { - local dir="$1" - [ -d "$dir" ] || return $FAILURE - mount | grep -Eq " on $dir \([^)]+\)$" + local OPTIND OPTARG flag use_device= + while getopts b flag; do + case "$flag" in + b) use_device=1 ;; + esac + done + shift $(( $OPTIND - 1 )) + if [ "$use_device" ]; then + local device="$1" + mount | grep -Eq \ + "^$device([[:space:]]|p[0-9]|s[0-9]|\.nop|\.eli)" + else + [ -d "$dir" ] || return $FAILURE + mount | grep -Eq " on $dir \([^)]+\)$" + fi + # Return status is that of last grep(1) } # f_eval_catch [-de] [-k $var_to_set] $funcname $utility \ @@ -890,7 +906,7 @@ f_eval_catch() # # Process local function arguments # - local OPTIND __flag + local OPTIND OPTARG __flag while getopts "dek:" __flag > /dev/null; do case "$__flag" in d) __no_dialog=1 ;; Modified: head/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/device.subr Wed Apr 23 21:52:43 2014 (r264839) +++ head/usr.sbin/bsdconfig/share/device.subr Wed Apr 23 22:04:04 2014 (r264840) @@ -32,6 +32,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." device.subr f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/geom.subr f_include $BSDCFG_SHARE/strings.subr f_include $BSDCFG_SHARE/struct.subr @@ -40,42 +41,53 @@ f_include_lang $BSDCFG_LIBE/include/mess ############################################################ GLOBALS -DEVICES= -DEVICE_NAMES= -NDEVICES=0 +NDEVICES=0 # Set by f_device_register(), used by f_device_*() -# A "device" from sysinstall's point of view +# +# A "device" from legacy sysinstall's point of view (mostly) +# +# NB: Disk devices have their `private' property set to GEOM ident +# NB: USB devices have their `private' property set to USB disk device name +# f_struct_define DEVICE \ - name \ + capacity \ desc \ devname \ - type \ - capacity \ enabled \ - init \ - get \ - shutdown \ flags \ + get \ + init \ + name \ private \ + shutdown \ + type \ volume # Network devices have their `private' property set to this f_struct_define DEVICE_INFO \ - use_rtsol use_dhcp ipaddr ipv6addr netmask extras - -setvar DEVICE_TYPE_NONE 1 -setvar DEVICE_TYPE_DISK 2 -setvar DEVICE_TYPE_FLOPPY 3 -setvar DEVICE_TYPE_FTP 4 -setvar DEVICE_TYPE_NETWORK 5 -setvar DEVICE_TYPE_CDROM 6 -setvar DEVICE_TYPE_USB 7 -setvar DEVICE_TYPE_DOS 8 -setvar DEVICE_TYPE_UFS 9 -setvar DEVICE_TYPE_NFS 10 -setvar DEVICE_TYPE_ANY 11 -setvar DEVICE_TYPE_HTTP_PROXY 12 -setvar DEVICE_TYPE_HTTP 13 + extras \ + ipaddr \ + ipv6addr \ + netmask \ + use_dhcp \ + use_rtsol + +# +# Device types for f_device_register(), f_device_find(), et al. +# +setvar DEVICE_TYPE_ANY "any" # Any +setvar DEVICE_TYPE_NONE "NONE" # Unknown +setvar DEVICE_TYPE_DISK "DISK" # GEOM `DISK' +setvar DEVICE_TYPE_FLOPPY "FD" # GEOM `FD' +setvar DEVICE_TYPE_FTP "FTP" # Dynamic network device +setvar DEVICE_TYPE_NETWORK "NETWORK" # See f_device_get_all_network +setvar DEVICE_TYPE_CDROM "CDROM" # GEOM `DISK' +setvar DEVICE_TYPE_USB "USB" # GEOM `PART' +setvar DEVICE_TYPE_DOS "DOS" # GEOM `DISK' `PART' or `LABEL' +setvar DEVICE_TYPE_UFS "UFS" # GEOM `DISK' `PART' or `LABEL' +setvar DEVICE_TYPE_NFS "NFS" # Dynamic network device +setvar DEVICE_TYPE_HTTP_PROXY "HTTP_PROXY" # Dynamic network device +setvar DEVICE_TYPE_HTTP "HTTP" # Dynamic network device # Network devices have the following flags available setvar IF_ETHERNET 1 @@ -87,76 +99,70 @@ setvar IF_ACTIVE 4 # : ${DEVICE_SELF_SCAN_ALL=1} -############################################################ FUNCTIONS - -# f_device_try $name [$i [$var_path]] -# -# Test a particular device. If $i is given, then $name is expected to contain a -# single "%d" where $i will be inserted using printf. If $var_path is given, -# it is used as a variable name to provide the caller the device pathname. # -# Returns success if the device path exists and is a cdev. +# Device Catalog variables # -f_device_try() -{ - local name="$1" i="$2" var_path="$3" unit - if [ "$i" ]; then - f_sprintf unit "$name" "$i" - else - unit="$name" - fi - case "$unit" in - /dev/*) : good ;; # already qualified - *) unit="/dev/$unit" ;; - esac - [ "$var_path" ] && setvar "$var_path" "$unit" - f_dprintf "f_device_try: making sure %s is a device node" "$unit" - if [ -c "$unit" ]; then - f_dprintf "f_device_try: %s is a cdev [good]" "$unit" - return $SUCCESS - else - f_dprintf "f_device_try: %s is not a cdev [skip]" "$unit" - return $FAILURE - fi -} +DEVICE_CATALOG_APPEND_ONLY= # Used by f_device_catalog_set() +NCATALOG_DEVICES=0 # Used by f_device_catalog_*() and MAIN -# f_device_register $name $desc $devname $type $enabled $init_function \ -# $get_function $shutdown_function $private $capacity # -# Register a device. A `structure' (see struct.subr) is created with the name -# device_$name (so make sure $name contains only alpha-numeric characters or -# the underscore, `_'). The remaining arguments after $name correspond to the -# properties of the `DEVICE' structure-type (defined above). +# A ``catalog'' device is for mapping GEOM devices to media devices (for +# example, determining if a $GEOM_CLASS_DISK geom is $DEVICE_TYPE_CDROM or +# $DEVICE_TYPE_DISK) and also getting default descriptions for devices that +# either lack a GEOM provided description or lack a presence in GEOM) # -# If not already registered, the device is then appended to the DEVICES -# environment variable, a space-separated list of all registered devices. +f_struct_define CATALOG_DEVICE \ + desc \ + name \ + type + +############################################################ FUNCTIONS + +# f_device_register $var_to_set $name $desc $devname $type $enabled +# $init_function $get_function $shutdown_function +# $private $capacity +# +# Register a device. A `structure' (see struct.subr) is created and if +# $var_to_set is non-NULL, upon success holds the name of the struct created. +# The remaining positional arguments correspond to the properties of the +# `DEVICE' structure-type to be assigned (defined above). +# +# If not already registered (based on $name and $type), a new device is created +# and $NDEVICES is incremented. # f_device_register() { - local name="$1" desc="$2" devname="$3" type="$4" enabled="$5" - local init_func="$6" get_func="$7" shutdown_func="$8" private="$9" - local capacity="${10}" - - f_struct_new DEVICE "device_$name" || return $FAILURE - device_$name set name "$name" - device_$name set desc "$desc" - device_$name set devname "$devname" - device_$name set type "$type" - device_$name set enabled "$enabled" - device_$name set init "$init_func" - device_$name set get "$get_func" - device_$name set shutdown "$shutdown_func" - device_$name set private "$private" - device_$name set capacity "$capacity" - - # Scan our global register to see if it needs ammending - local dev found= - for dev in $DEVICES; do - [ "$dev" = "$name" ] || continue - found=1 && break - done - [ "$found" ] || DEVICES="$DEVICES $name" + local __var_to_set="$1" __name="$2" __desc="$3" __devname="$4" + local __type="$5" __enabled="$6" __init_func="$7" __get_func="$8" + local __shutdown_func="$9" __private="${10}" __capacity="${11}" + # Required parameter(s) + [ "$__name" ] || return $FAILURE + if [ "$__var_to_set" ]; then + setvar "$__var_to_set" "" || return $FAILURE + fi + + local __device + if f_device_find -1 "$__name" "$__type" __device; then + f_struct_free "$__device" + f_struct_new DEVICE "$__device" || return $FAILURE + else + __device=device_$(( NDEVICES + 1 )) + f_struct_new DEVICE "$__device" || return $FAILURE + NDEVICES=$(( $NDEVICES + 1 )) + fi + $__device set name "$__name" + $__device set desc "$__desc" + $__device set devname "$__devname" + $__device set type "$__type" + $__device set enabled "$__enabled" + $__device set init "$__init_func" + $__device set get "$__get_func" + $__device set shutdown "$__shutdown_func" + $__device set private "$__private" + $__device set capacity "$__capacity" + + [ "$__var_to_set" ] && setvar "$__var_to_set" "$__device" return $SUCCESS } @@ -166,18 +172,21 @@ f_device_register() # f_device_reset() { - local dev - for dev in $DEVICES; do - f_device_shutdown $dev + local n=1 + while [ $n -le $NDEVICES ]; do + f_device_shutdown device_$n + # # XXX This potentially leaks $dev->private if it's being # used to point to something dynamic, but you're not supposed # to call this routine at such times that some open instance # has its private member pointing somewhere anyway. # - f_struct_free device_$dev + f_struct_free device_$n + + n=$(( $n + 1 )) done - DEVICES= + NDEVICES=0 } # f_device_reset_network @@ -186,34 +195,45 @@ f_device_reset() # f_device_reset_network() { - local dev type private pruned_list= - for dev in $DEVICES; do - device_$dev get type type - if [ "$type" != "$DEVICE_TYPE_NETWORK" ]; then - pruned_list="$pruned_list $dev" - continue - fi + local n=1 device type private i + while [ $n -le $NDEVICES ]; do + device=device_$n + f_struct $device || continue + $device get type type + [ "$type" = "$DEVICE_TYPE_NETWORK" ] || continue # # Leave the device up (don't call shutdown routine) # # Network devices may have DEVICE_INFO private member - device_$dev get private private + $device get private private [ "$private" ] && f_struct_free "$private" - f_struct_free device_$dev + # Free the network device + f_struct_free $device + + # Fill the gap we just created + i=$n + while [ $i -lt $NDEVICES ]; do + f_struct_copy device_$(( $i + 1 )) device_$i + done + f_struct_free device_$NDEVICES + + # Finally decrement the number of devices + NDEVICES=$(( $NDEVICES - 1 )) + + n=$(( $n + 1 )) done - DEVICES="${pruned_list# }" } # f_device_get_all # -# Get all device information for devices we have attached. +# Get all device information for all devices. # f_device_get_all() { - local devname desc capacity + local devname type desc capacity f_dprintf "f_device_get_all: Probing devices..." f_dialog_info "$msg_probing_devices_please_wait_this_can_take_a_while" @@ -221,180 +241,16 @@ f_device_get_all() # First go for the network interfaces f_device_get_all_network - # Next, try to find all the types of devices one might use - # as a media source for content - # - - local dev type max n=0 - for dev in $DEVICE_NAMES; do - n=$(( $n + 1 )) - # Get the desc, type, and max (with debugging disabled) - # NOTE: Bypassing f_device_name_get() for efficiency - # ASIDE: This would be equivalent to the following: - # debug= f_device_name_get $dev desc - # debug= f_device_name_get $dev type - # debug= f_device_name_get $dev max - debug= f_getvar _device_desc$n desc - debug= f_getvar _device_type$n type - debug= f_getvar _device_max$n max - - local k=0 - while [ $k -lt ${max:-0} ]; do - i=$k k=$(( $k + 1 )) - devname="" - case "$type" in - $DEVICE_TYPE_CDROM) - f_device_try "$dev" "$i" devname || continue - f_device_capacity "$devname" capacity - f_device_register "${devname##*/}" "$desc" \ - "$devname" $DEVICE_TYPE_CDROM 1 \ - f_media_init_cdrom f_media_get_cdrom \ - f_media_shutdown_cdrom "" "$capacity" - f_dprintf "Found a CDROM device for %s" \ - "$devname" - ;; - $DEVICE_TYPE_FLOPPY) - f_device_try "$dev" "$i" devname || continue - f_device_capacity "$devname" capacity - f_device_register "${devname##*/}" "$desc" \ - "$devname" $DEVICE_TYPE_FLOPPY 1 \ - f_media_init_floppy \ - f_media_get_floppy \ - f_media_shutdown_floppy "" "$capacity" - f_dprintf "Found a floppy device for %s" \ - "$devname" - ;; - $DEVICE_TYPE_USB) - f_device_try "$dev" "$i" devname || continue - f_device_capacity "$devname" capacity - f_device_register "${devname##*/}" "$desc" \ - "$devname" $DEVICE_TYPE_USB 1 \ - f_media_init_usb f_media_get_usb \ - f_media_shutdown_usb "" "$capacity" - f_dprintf "Found a USB disk for %s" "$devname" - ;; - esac - done - done - - # Register ISO9660 providers as CDROM devices - for devname in /dev/iso9660/*; do - f_device_try "$devname" || continue - f_device_capacity "$devname" capacity - f_device_register "${devname##*/}" "ISO9660 file system" \ - "$devname" $DEVICE_TYPE_CDROM 1 \ - f_media_init_cdrom f_media_get_cdrom \ - f_media_shutdown_cdrom "" "$capacity" - f_dprintf "Found a CDROM device for %s" "$devname" - done - - # Scan for mdconfig(8)-created md(4) devices - local filename - for devname in /dev/md[0-9] /dev/md[0-9][0-9]; do - f_device_try "$devname" || continue - - # See if the md(4) device is a vnode type backed by a file - filename=$( sysctl kern.geom.conftxt | - awk -v devname="${devname##*/}" \ - ' - ( $2 == "MD" ) && \ - ( $3 == devname ) && \ - ( $(NF-2) == "vnode" ) && \ - ( $(NF-1) == "file" ) \ - { - print $NF - } - ' ) - case "$filename" in - *.iso) # Register the device as an ISO9660 provider - f_device_capacity "$devname" capacity - f_device_register "${devname##*/}" \ - "md(4) vnode file system" \ - "$devname" $DEVICE_TYPE_CDROM 1 \ - f_media_init_cdrom f_media_get_cdrom \ - f_media_shutdown_cdrom "" "$capacity" - f_dprintf "Found a CDROM device for %s" "$devname" - ;; - esac - done - - # Finally go get the disks and look for partitions to register - local diskname slices index type rest slice part - for diskname in $( sysctl -n kern.disks ); do - - case "$diskname" in - cd*) - # XXX Due to unknown reasons, kern.disks returns SCSI - # CDROM as a valid disk. This will prevent bsdconfig - # from presenting SCSI CDROMs as available disks in - # various menus. Why GEOM treats SCSI CDROM as a disk - # is beyond me and that should be investigated. - # For temporary workaround, ignore SCSI CDROM device. - # - continue ;; - esac - - # Try to create a list of partitions and their types, - # consisting of "N,typeN ..." (e.g., "1,0xa5 2,0x06"). - if ! slices=$( fdisk -p "$diskname" 2> /dev/null | - awk '( $1 == "p" ) { print $2","$3 }' ) - then - f_dprintf "Unable to open disk %s" "$diskname" - continue + # Next, go for the GEOM devices we might want to use as media + local geom geoms geom_name + debug= f_geom_find "" $GEOM_CLASS_DEV geoms + for geom in $geoms; do + if ! f_device_probe_geom $geom; then + debug= $geom get name geom_name + f_dprintf "WARNING! Unable to classify %s as %s" \ + "GEOM device $geom_name" "media source" fi - - # Try and find its description - f_device_desc "$diskname" $DEVICE_TYPE_DISK desc - - f_device_capacity "$diskname" capacity - f_device_register "$diskname" "$desc" \ - "/dev/$diskname" $DEVICE_TYPE_DISK 0 \ - "" "" "" "" "$capacity" - f_dprintf "Found a disk device named %s" "$diskname" - - # Look for existing partitions to register - for slice in $slices; do - index="${slice%%,*}" type="${slice#*,}" - slice=${diskname}s$index - case "$type" in - 0x01|0x04|0x06|0x0b|0x0c|0x0e|0xef) - # DOS partitions to add as "DOS media devices" - f_device_capacity "/dev/$slice" capacity - f_device_register "$slice" "" \ - "/dev/$slice" $DEVICE_TYPE_DOS 1 \ - f_media_init_dos f_media_get_dos \ - f_media_shutdown_dos "" "$capacity" - f_dprintf "Found a DOS partition %s" "$slice" - ;; - 0xa5) # FreeBSD partition - for part in $( - bsdlabel -r $slice 2> /dev/null | - awk -v slice="$slice" ' - ( $1 ~ /[abdefgh]:/ ) { - printf "%s%s\n", - slice, - substr($1,1,1) - }' - ); do - f_quietly dumpfs -m /dev/$part || - continue - f_device_capacity \ - "$/dev/$part" capacity - f_device_register \ - "$part" "" "/dev/$part" \ - $DEVICE_TYPE_UFS 1 \ - f_media_init_ufs \ - f_media_get_ufs \ - f_media_shutdown_ufs "" \ - "$capacity" - f_dprintf "Found a UFS partition %s" \ - "$part" - done # parts - ;; - esac - done # slices - - done # disks + done } # f_device_get_all_network @@ -403,7 +259,7 @@ f_device_get_all() # f_device_get_all_network() { - local devname desc flags + local devname desc device flags for devname in $( ifconfig -l ); do # Eliminate network devices that don't make sense case "$devname" in @@ -413,9 +269,9 @@ f_device_get_all_network() # Try and find its description f_device_desc "$devname" $DEVICE_TYPE_NETWORK desc - f_dprintf "Found a network device named %s" "$devname" - f_device_register $devname \ - "$desc" "$devname" $DEVICE_TYPE_NETWORK 1 \ + f_dprintf "Found network device named %s" "$devname" + debug= f_device_register device $devname "$desc" \ + "$devname" $DEVICE_TYPE_NETWORK 1 \ f_media_init_network "" f_media_shutdown_network "" -1 # Set flags based on media and status @@ -435,37 +291,532 @@ f_device_get_all_network() if (value ~ /^active/) _or(var, "IF_ACTIVE") } }' )" - device_$devname set flags $flags + $device set flags $flags done } -# f_device_name_get $type $name type|desc|max [$var_to_set] +# f_device_rescan +# +# Rescan all devices, after closing previous set - convenience function. # -# Fetch the device type (type), description (desc), or maximum number of -# devices to scan for (max) associated with device $name and $type. If $type is -# either NULL, missing, or set to $DEVICE_TYPE_ANY then only $name is used. +f_device_rescan() +{ + f_device_reset + f_geom_rescan + f_device_get_all +} + +# f_device_rescan_network +# +# Rescan all network devices, after closing previous set - for convenience. +# +f_device_rescan_network() +{ + f_device_reset_network + f_device_get_all_network +} + +# f_device_probe_geom $geom +# +# Probe a single GEOM device and if it can be classified as a media source, +# register it using f_device_register() with known type-specific arguments. +# +f_device_probe_geom() +{ + local geom="$1" + + f_struct "$geom" || return $FAILURE + + # geom associated variables + local geom_name geom_consumer provider_ref geom_provider= + local provider_geom provider_config provider_class= + local provider_config_type catalog_struct catalog_type + local disk_ident + + # gnop(8)/geli(8) associated variables (p for `parent device') + local p_devname p_geom p_consumer p_provider_ref p_provider + local p_provider_config p_provider_geom p_provider_class + + # md(4) associated variables + local config config_type config_file magic= + + # Temporarily disable debugging to keep debug output light + local old_debug="$debug" debug= + + # + # Get the GEOM name (for use below in device registration) + # + $geom get name devname || continue + + # + # Attempt to get the consumer, provider, provider config, and + # provider class for this geom (errors ignored). + # + # NB: Each GEOM in the `DEV' class should have one consumer. + # That consumer should have a reference to its provider. + # + $geom get consumer1 geom_consumer + f_struct "$geom_consumer" get provider_ref provider_ref && + f_geom_find_by id "$provider_ref" provider geom_provider + if f_struct "$geom_provider"; then + $geom_provider get config provider_config + f_geom_parent $geom_provider provider_geom && + f_geom_parent $provider_geom provider_class + fi + + # + # Get values for device registration (errors ignored) + # + f_struct "$provider_class" get name type + f_struct "$geom_provider" get mediasize capacity + f_struct "$provider_config" get descr desc + + # + # For gnop(8), geli(8), or combination thereof, change device type to + # that of the consumer + # + p_devname= p_geom= p_provider= p_provider_config= + case "$devname" in + *.nop.eli) p_devname="${devname%.nop.eli}" ;; + *.eli.nop) p_devname="${devname%.eli.nop}" ;; + *.eli) p_devname="${devname%.eli}" ;; + *.nop) p_devname="${devname%.nop}" ;; + esac + [ "$p_devname" ] && f_geom_find "$p_devname" $GEOM_CLASS_DEV p_geom + if [ "${p_geom:-$geom}" != "$geom" ]; then + f_struct "$p_geom" get consumer1 p_consumer + f_struct "$p_consumer" get provider_ref p_provider_ref && + f_geom_find_by id "$p_provider_ref" provider p_provider + if f_struct "$p_provider"; then + $p_provider get config p_provider_config + f_geom_parent $p_provider p_provider_geom && + f_geom_parent $p_provider_geom p_provider_class + fi + f_struct "$p_provider_class" get name type + fi + + # Look up geom device in device catalog for default description + f_device_catalog_get \ + $DEVICE_TYPE_ANY "${p_devname:-$devname}" catalog_struct + [ "$desc" ] || f_struct "catalog_device_$catalog_struct" get desc desc + + # Use device catalog entry for potential re-classification(s) + f_struct "catalog_device_$catalog_struct" get type catalog_type + + # Restore debugging for this next part (device registration) + debug="$old_debug" + + # + # Register the device + # + local retval device + case "$type" in + $GEOM_CLASS_DISK) + # First attempt to classify by device catalog (see MAIN) + case "$catalog_type" in + $DEVICE_TYPE_CDROM) + f_dprintf "Found CDROM device for disk %s" "$devname" + debug= f_device_register device "$devname" "$desc" \ + "/dev/$devname" $DEVICE_TYPE_CDROM 1 \ + f_media_init_cdrom f_media_get_cdrom \ + f_media_shutdown_cdrom "" "$capacity" && + return $SUCCESS + ;; + esac + + # Fall back to register label device as a disk and taste it + f_dprintf "Found disk device named %s" "$devname" + debug= f_struct "$p_provider_config" get \ + ident disk_ident || + debug= f_struct "$provider_config" get \ + ident disk_ident + debug= f_device_register device "$devname" "$desc" \ + "/dev/$devname" $DEVICE_TYPE_DISK 1 \ + "" "" "" "$disk_ident" "$capacity" + retval=$? + + # Detect ``dangerously dedicated'' filesystems (errors ignored) + f_device_probe_disk_fs device "$devname" "$capacity" && + retval=$SUCCESS + + return $retval + ;; + $GEOM_CLASS_FD) + f_dprintf "Found floppy device named %s" "$devname" + debug= f_device_register device "$devname" "$desc" \ + "/dev/$devname" $DEVICE_TYPE_FLOPPY 1 \ + f_media_init_floppy f_media_get_floppy \ + f_media_shutdown_floppy "" "$capacity" + return $? + ;; + $GEOM_CLASS_LABEL) + : fall through to below section # reduces indentation level + ;; + $GEOM_CLASS_MD) + f_dprintf "Found disk device named %s" "$devname" + debug= f_device_register device "$devname" "$desc" \ + "/dev/$devname" $DEVICE_TYPE_DISK 1 \ + "" "" "" "" "$capacity" + retval=$? + + # + # Attempt to get file(1) magic to potentially classify as + # alternate media type. If unable to get magic, fall back to + # md(4) characteristics (such as vnode filename). + # + [ -r "/dev/$devname" ] && + magic=$( file -bs "/dev/$devname" 2> /dev/null ) + if [ ! "$magic" ]; then + # Fall back to md(4) characteristics + if f_struct "$p_provider_config"; then + config="$p_provider_config" + else + config="$provider_config" + fi + debug= f_struct "$config" get type config_type + debug= f_struct "$config" get file config_file + + # Substitute magic for below based on type and file + case "$config_type=$config_file" in + vnode=*.iso) magic="ISO 9660" ;; + esac + fi + f_device_probe_disk_fs device \ + "$devname" "$capacity" "$magic" && + retval=$SUCCESS # Errors ignored + + return $retval + ;; + $GEOM_CLASS_PART) + if f_struct "$p_provider_config"; then + config="$p_provider_config" + else + config="$provider_config" + fi + debug= f_struct "$config" get type provider_config_type + f_device_probe_geom_part device \ + "$provider_config_type" "$devname" "$capacity" + retval=$? + device_type=$DEVICE_TYPE_NONE + [ $retval -eq $SUCCESS ] && + debug= f_struct "$device" get type device_type + + # Potentially re-classify as USB device + if [ "$device_type" = "$DEVICE_TYPE_UFS" -a \ + "$catalog_type" = "$DEVICE_TYPE_USB" ] + then + f_dprintf "Found USB device for partition %s" \ + "$devname" + debug= f_struct "$p_provider_geom" get \ + name disk_name || + debug= f_struct "$provider_geom" get \ + name disk_name + debug= f_device_register device "$devname" "$desc" \ + "/dev/$devname" $DEVICE_TYPE_USB 1 \ + f_media_init_usb f_media_get_usb \ + f_media_shutdown_usb "$disk_name" "$capacity" + retval=$? + fi + + return $retval + ;; + $GEOM_CLASS_RAID) + # Use the provider geom name as the description + if [ ! "$desc" ]; then + f_struct "$p_provider_geom" get name desc || + f_struct "$provider_geom" get name desc + fi + + f_dprintf "Found disk device named %s" "$devname" + debug= f_device_register device \ + "$devname" "${desc:-GEOM RAID device}" \ + "/dev/$devname" $DEVICE_TYPE_DISK 1 \ + "" "" "" "" "$capacity" + retval=$? + + # Detect ``dangerously dedicated'' filesystems + f_device_probe_disk_fs device "$devname" "$capacity" && + retval=$SUCCESS # Errors ignored + + return $retval + ;; + $GEOM_CLASS_ZFS_ZVOL) + f_dprintf "Found disk device named %s" "$devname" + debug= f_device_register device \ + "$devname" "${desc:-GEOM ZFS::ZVOL device}" \ + "/dev/$devname" $DEVICE_TYPE_DISK 1 \ + "" "" "" "" "$capacity" + retval=$? + + # Detect ``dangerously dedicated'' filesystems + f_device_probe_disk_fs device "$devname" "$capacity" && + retval=$SUCCESS # Errors ignored + + return $retval + ;; + *) + return $FAILURE # Unknown GEOM class + esac + + # + # Still here? Must be $GEOM_CLASS_LABEL + # + + local label_geom label_devname label_devgeom= label_devconsumer + local label_devprovider= label_devprovider_ref label_devprovider_config + local label_gpart_type + + if f_struct "$p_provider"; then + label_geom="$p_provider_geom" + else + label_geom="$provider_geom" + fi + + case "$devname" in + gpt/*|gptid/*) + # + # Attempt to get the partition type by getting the `config' + # member of the provider for our device (which is named in the + # parent geom of our current provider). + # + debug= f_struct "$label_geom" get name label_devname && + debug= f_geom_find "$label_devname" $GEOM_CLASS_DEV \ + label_devgeom + debug= f_struct "$label_devgeom" get \ + consumer1 label_devconsumer + debug= f_struct "$label_devconsumer" get \ + provider_ref label_devprovider_ref && + debug= f_geom_find_by id "$label_devprovider_ref" \ + provider label_devprovider + debug= f_struct "$label_devprovider" get \ + config label_devprovider_config + debug= f_struct "$label_devprovider_config" get \ + type label_gpart_type + + # + # Register device label based on partition type + # + f_device_probe_geom_part device \ + "$label_gpart_type" "$devname" "$capacity" + return $? + ;; + iso9660/*) + f_dprintf "Found CDROM device labeled %s" "$devname" + debug= f_device_register device \ + "$devname" "ISO9660 file system" \ + "/dev/$devname" $DEVICE_TYPE_CDROM 1 \ + f_media_init_cdrom f_media_get_cdrom \ + f_media_shutdown_cdrom "" "$capacity" + return $? + ;; + label/*) + # For generic labels, use provider geom name as real device + debug= f_struct "$label_geom" get name label_devname + + # Look up label geom device in device catalog for default desc + debug= f_device_catalog_get \ + $DEVICE_TYPE_ANY "$label_devname" catalog_struct + [ "$desc" ] || debug= f_struct \ + "catalog_device_$catalog_struct" get desc desc + + # Use device catalog entry for potential re-classification(s) + debug= f_struct "catalog_device_$catalog_struct" get \ + type catalog_type + + # First attempt to classify by device catalog (see MAIN) + case "$catalog_type" in + $DEVICE_TYPE_CDROM) + f_dprintf "Found CDROM device for disk %s" "$devname" + debug= f_device_register device "$devname" "$desc" \ + "/dev/$devname" $DEVICE_TYPE_CDROM 1 \ + f_media_init_cdrom f_media_get_cdrom \ + f_media_shutdown_cdrom "" "$capacity" && + return $SUCCESS + ;; + esac + + # Fall back to register label device as a disk and taste it + f_dprintf "Found disk device labeled %s" "$devname" + debug= f_device_register device \ + "$devname" "GEOM LABEL device" \ + "/dev/$devname" $DEVICE_TYPE_DISK 1 \ + "" "" "" "" "$capacity" + retval=$? + + # Detect ``dangerously dedicated'' filesystems (errors ignored) + f_device_probe_disk_fs device "$devname" "$capacity" && + retval=$SUCCESS + + return $retval + ;; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 22:06:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75EA3E6B; Wed, 23 Apr 2014 22:06:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 560AA1D44; Wed, 23 Apr 2014 22:06:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NM6iUN065276; Wed, 23 Apr 2014 22:06:44 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NM6iRg065275; Wed, 23 Apr 2014 22:06:44 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201404232206.s3NM6iRg065275@svn.freebsd.org> From: Devin Teske Date: Wed, 23 Apr 2014 22:06:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264841 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 22:06:44 -0000 Author: dteske Date: Wed Apr 23 22:06:43 2014 New Revision: 264841 URL: http://svnweb.freebsd.org/changeset/base/264841 Log: Update zfsboot to coincide with r264840 to bsdconfig(8) adding GEOM support (thereby adding GEOM support to the disk selection menu of bsdinstall(8)'s `zfsboot' module updated herein). MFC after: 1 week X-MFC-with: 264840 Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Wed Apr 23 22:04:04 2014 (r264840) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Wed Apr 23 22:06:43 2014 (r264841) @@ -189,6 +189,7 @@ ZFS_CREATE_WITH_OPTIONS='zfs create %s " ZFS_SET='zfs set "%s" "%s"' ZFS_UNMOUNT='zfs unmount "%s"' ZPOOL_CREATE_WITH_OPTIONS='zpool create %s "%s" %s %s' +ZPOOL_DESTROY='zpool destroy "%s"' ZPOOL_EXPORT='zpool export "%s"' ZPOOL_IMPORT_WITH_OPTIONS='zpool import %s "%s"' ZPOOL_LABELCLEAR_F='zpool labelclear -f "%s"' @@ -286,7 +287,8 @@ dialog_menu_main() local usegeli="$msg_no" [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ] && force4k="$msg_yes" [ "$ZFSBOOT_GELI_ENCRYPTION" ] && usegeli="$msg_yes" - local disks n=$( set -- $ZFSBOOT_DISKS; echo $# ) + local disks n + f_count n $ZFSBOOT_DISKS { [ $n -eq 1 ] && disks=disk; } || disks=disks # grammar local menu_list=" '>>> $msg_install' '$msg_install_desc' @@ -451,8 +453,29 @@ dialog_menu_layout() # Get a list of probed disk devices local disks= - f_device_find "" $DEVICE_TYPE_DISK disks - f_dprintf "$funcname: disks=[%s]" "$disks" + debug= f_device_find "" $DEVICE_TYPE_DISK disks + + # Prune out mounted md(4) devices that may be part of the boot process + local disk name new_list= + for disk in $disks; do + debug= $disk get name name + case "$name" in + md[0-9]*) f_mounted -b "/dev/$name" && continue ;; + esac + new_list="$new_list $disk" + done + disks="${new_list# }" + + # Debugging + if [ "$debug" ]; then + local disk_names= + for disk in $disks; do + debug= $disk get name name + disk_names="$disk_names $name" + done + f_dprintf "$funcname: disks=[%s]" "${disk_names# }" + fi + if [ ! "$disks" ]; then f_dprintf "No disk(s) present to configure" f_show_err "$msg_no_disks_present_to_configure" @@ -460,14 +483,15 @@ dialog_menu_layout() fi # Lets sort the disks array to be more user friendly - disks=$( echo "$disks" | tr ' ' '\n' | sort | tr '\n' ' ' ) + f_device_sort_by name disks disks # # Operate in a loop so we can (if interactive) repeat if not enough # disks are selected to satisfy the chosen vdev type or user wants to # back-up to the previous menu. # - local vardisk ndisks onoff selections vdev_choice + local vardisk ndisks onoff selections vdev_choice breakout device + local valid_disks all_valid want_disks desc height width rows while :; do # # Confirm the vdev type that was selected @@ -495,7 +519,7 @@ dialog_menu_layout() fi # Determine the number of disks needed for this vdev type - local want_disks=0 + want_disks=0 case "$ZFSBOOT_VDEV_TYPE" in stripe) want_disks=1 ;; mirror) want_disks=2 ;; @@ -504,11 +528,14 @@ dialog_menu_layout() raidz3) want_disks=5 ;; esac + # # Warn the user if any scripted disks are invalid - local disk valid_disks= - local all_valid=${ZFSBOOT_DISKS:+1} # optimism + # + valid_disks= all_valid=${ZFSBOOT_DISKS:+1} # optimism for disk in $ZFSBOOT_DISKS; do - if f_struct device_$disk; then + if debug= f_device_find -1 \ + $disk $DEVICE_TYPE_DISK device + then valid_disks="$valid_disks $disk" continue fi @@ -532,7 +559,7 @@ dialog_menu_layout() # Short-circuit if we're running non-interactively # if ! f_interactive || [ ! "$ZFSBOOT_CONFIRM_LAYOUT" ]; then - ndisks=$( set -- $ZFSBOOT_DISKS; echo $# ) + f_count ndisks $ZFSBOOT_DISKS [ $ndisks -ge $want_disks ] && break # to success # Not enough disks selected @@ -551,29 +578,35 @@ dialog_menu_layout() # Confirm the disks that were selected # Loop until the user cancels or selects enough disks # - local breakout= + breakout= while :; do # Loop over list of available disks, resetting state - for disk in $disks; do unset _${disk}_status; done + for disk in $disks; do + f_isset _${disk}_status && _${disk}_status= + done # Loop over list of selected disks and create temporary # locals to map statuses onto up-to-date list of disks for disk in $ZFSBOOT_DISKS; do - local _${disk}_status=on + debug= f_device_find -1 \ + $disk $DEVICE_TYPE_DISK disk + f_isset _${disk}_status || + local _${disk}_status + _${disk}_status=on done # Create the checklist menu of discovered disk devices disk_check_list= for disk in $disks; do - local desc= - device_$disk get desc desc + desc= + $disk get name name + $disk get desc desc f_shell_escape "$desc" desc f_getvar _${disk}_status:-off onoff disk_check_list="$disk_check_list - $disk '$desc' $onoff" + $name '$desc' $onoff" done - local height width rows eval f_dialog_checklist_size height width rows \ \"\$title\" \"\$btitle\" \"\$prompt\" \ \"\$hline\" $disk_check_list @@ -597,7 +630,7 @@ dialog_menu_layout() f_dprintf "$funcname: ZFSBOOT_DISKS=[%s]" \ "$ZFSBOOT_DISKS" - ndisks=$( set -- $ZFSBOOT_DISKS; echo $# ) + f_count ndisks $ZFSBOOT_DISKS [ $ndisks -ge $want_disks ] && breakout=break && break @@ -917,6 +950,16 @@ zfs_create_boot() "$ZFSBOOT_BOOT_POOL_SIZE" "$bootsize" # + # Destroy the pool in-case this is our second time 'round (case of + # failure and installer presented ``Retry'' option to come back). + # + # NB: If we don't destroy the pool, later gpart(8) destroy commands + # that try to clear existing partitions (see zfs_create_diskpart()) + # will fail with a `Device Busy' error, leading to `GEOM exists'. + # + f_eval_catch -d $funcname zpool "$ZPOOL_DESTROY" "$zroot_name" + + # # Prepare the disks and build pool device list(s) # f_dprintf "$funcname: Preparing disk partitions for ZFS pool..." @@ -973,8 +1016,9 @@ zfs_create_boot() $BSDINSTALL_CHROOT || return $FAILURE # Create mirror across the boot partition on all disks - [ $( set -- $boot_vdevs; echo $# ) -gt 1 ] && - bootpool_vdevtype=mirror + local nvdevs + f_count nvdevs $boot_vdevs + [ $nvdevs -gt 1 ] && bootpool_vdevtype=mirror bootpool_options="-o altroot=$BSDINSTALL_CHROOT" bootpool_options="$bootpool_options -m \"/$bootpool_name\" -f" @@ -1232,15 +1276,16 @@ zfs_create_boot() # dialog_menu_diskinfo() { - local disk + local device disk # # Break from loop when user cancels disk selection # while :; do - disk=$( msg_cancel="$msg_back" f_device_menu \ + device=$( msg_cancel="$msg_back" f_device_menu \ "$DIALOG_TITLE" "$msg_select_a_disk_device" "" \ $DEVICE_TYPE_DISK 2>&1 ) || break + $device get name disk # Show gpart(8) `show' and camcontrol(8) `inquiry' data f_show_msg "$msg_detailed_disk_info" \ @@ -1312,7 +1357,10 @@ while :; do [ "$ZFSBOOT_BOOT_POOL" ] && minsize=$(( $minsize + $bootsize )) for disk in $ZFSBOOT_DISKS; do - device_$disk get capacity disksize || continue + debug= f_device_find -1 \ + $disk $DEVICE_TYPE_DISK device + $device get capacity disksize || continue + [ ${disksize:-0} -ge 0 ] || disksize=0 disksize=$(( $disksize - $minsize )) [ $disksize -lt $minsize ] && teeny_disks="$teeny_disks $disk" From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 22:13:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34D36F1; Wed, 23 Apr 2014 22:13:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21C2A1E42; Wed, 23 Apr 2014 22:13:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NMDAvp068978; Wed, 23 Apr 2014 22:13:11 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NMDAtD068977; Wed, 23 Apr 2014 22:13:10 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201404232213.s3NMDAtD068977@svn.freebsd.org> From: Rick Macklem Date: Wed, 23 Apr 2014 22:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264842 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 22:13:11 -0000 Author: rmacklem Date: Wed Apr 23 22:13:10 2014 New Revision: 264842 URL: http://svnweb.freebsd.org/changeset/base/264842 Log: Modify the NFSv4 client's Pathconf RPC (actually a Getattr Op.) so that it only does the RPC for names that are answered by the RPC. Doing the RPC for other names is harmless, but unnecessary. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Wed Apr 23 22:06:43 2014 (r264841) +++ head/sys/fs/nfsclient/nfs_clvnops.c Wed Apr 23 22:13:10 2014 (r264842) @@ -3429,12 +3429,15 @@ nfs_pathconf(struct vop_pathconf_args *a struct thread *td = curthread; int attrflag, error; - if (NFS_ISV4(vp) || (NFS_ISV3(vp) && (ap->a_name == _PC_LINK_MAX || + if ((NFS_ISV34(vp) && (ap->a_name == _PC_LINK_MAX || ap->a_name == _PC_NAME_MAX || ap->a_name == _PC_CHOWN_RESTRICTED || - ap->a_name == _PC_NO_TRUNC))) { + ap->a_name == _PC_NO_TRUNC)) || + (NFS_ISV4(vp) && ap->a_name == _PC_ACL_NFS4)) { /* * Since only the above 4 a_names are returned by the NFSv3 * Pathconf RPC, there is no point in doing it for others. + * For NFSv4, the Pathconf RPC (actually a Getattr Op.) can + * be used for _PC_NFS4_ACL as well. */ error = nfsrpc_pathconf(vp, &pc, td->td_ucred, td, &nfsva, &attrflag, NULL); From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 22:43:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD7AB6B9; Wed, 23 Apr 2014 22:43:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA5DA11DB; Wed, 23 Apr 2014 22:43:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NMhdpq081237; Wed, 23 Apr 2014 22:43:39 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NMhddw081236; Wed, 23 Apr 2014 22:43:39 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404232243.s3NMhddw081236@svn.freebsd.org> From: Adrian Chadd Date: Wed, 23 Apr 2014 22:43:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264843 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 22:43:39 -0000 Author: adrian Date: Wed Apr 23 22:43:39 2014 New Revision: 264843 URL: http://svnweb.freebsd.org/changeset/base/264843 Log: Allow the state of the interface to be "up" if the VAP is in SLEEP state. Without this, the carrier will drop when the NIC transitions to SLEEP and nothing will ever transmit. Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Wed Apr 23 22:13:10 2014 (r264842) +++ head/sys/net80211/ieee80211.c Wed Apr 23 22:43:39 2014 (r264843) @@ -1408,7 +1408,8 @@ ieee80211_media_status(struct ifnet *ifp * rate only when running; otherwise we may have a mismatch * in which case the rate will not be convertible. */ - if (vap->iv_state == IEEE80211_S_RUN) { + if (vap->iv_state == IEEE80211_S_RUN || + vap->iv_state == IEEE80211_S_SLEEP) { imr->ifm_status |= IFM_ACTIVE; mode = ieee80211_chan2mode(ic->ic_curchan); } else From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 22:44:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B266804; Wed, 23 Apr 2014 22:44:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E26AA11E9; Wed, 23 Apr 2014 22:44:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NMin9Z081450; Wed, 23 Apr 2014 22:44:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NMinZU081449; Wed, 23 Apr 2014 22:44:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404232244.s3NMinZU081449@svn.freebsd.org> From: Adrian Chadd Date: Wed, 23 Apr 2014 22:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264844 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 22:44:50 -0000 Author: adrian Date: Wed Apr 23 22:44:49 2014 New Revision: 264844 URL: http://svnweb.freebsd.org/changeset/base/264844 Log: Allow frames to be transmitted in either RUN or SLEEP state Frames transmitted during SLEEP state should be queued in the power save queue before waking the unit up. Otherwise DHCP requests and such will be dropped if the NIC is asleep - the NIC will wake up but not transmit the frame. Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Wed Apr 23 22:43:39 2014 (r264843) +++ head/sys/net80211/ieee80211_output.c Wed Apr 23 22:44:49 2014 (r264844) @@ -390,6 +390,19 @@ ieee80211_start_pkt(struct ieee80211vap /* * We've resolved the sender, so attempt to transmit it. */ + + if (vap->iv_state == IEEE80211_S_SLEEP) { + /* + * In power save; queue frame and then wakeup device + * for transmit. + */ + ic->ic_lastdata = ticks; + (void) ieee80211_pwrsave(ni, m); + ieee80211_free_node(ni); + ieee80211_new_state(vap, IEEE80211_S_RUN, 0); + return (0); + } + if (ieee80211_vap_pkt_send_dest(vap, m, ni) != 0) return (ENOBUFS); return (0); @@ -420,24 +433,19 @@ ieee80211_vap_transmit(struct ifnet *ifp m_freem(m); return (EINVAL); } - if (vap->iv_state == IEEE80211_S_SLEEP) { - /* - * In power save, wakeup device for transmit. - */ - ieee80211_new_state(vap, IEEE80211_S_RUN, 0); - m_freem(m); - return (0); - } + /* * No data frames go out unless we're running. * Note in particular this covers CAC and CSA * states (though maybe we should check muting * for CSA). */ - if (vap->iv_state != IEEE80211_S_RUN) { + if (vap->iv_state != IEEE80211_S_RUN && + vap->iv_state != IEEE80211_S_SLEEP) { IEEE80211_LOCK(ic); /* re-check under the com lock to avoid races */ - if (vap->iv_state != IEEE80211_S_RUN) { + if (vap->iv_state != IEEE80211_S_RUN && + vap->iv_state != IEEE80211_S_SLEEP) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, "%s: ignore queue, in %s state\n", __func__, ieee80211_state_name[vap->iv_state]); @@ -477,6 +485,13 @@ ieee80211_vap_qflush(struct ifnet *ifp) /* * 802.11 raw output routine. + * + * XXX TODO: this (and other send routines) should correctly + * XXX keep the pwr mgmt bit set if it decides to call into the + * XXX driver to send a frame whilst the state is SLEEP. + * + * Otherwise the peer may decide that we're awake and flood us + * with traffic we are still too asleep to receive! */ int ieee80211_raw_output(struct ieee80211vap *vap, struct ieee80211_node *ni, From owner-svn-src-head@FreeBSD.ORG Wed Apr 23 23:13:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26E98D3C; Wed, 23 Apr 2014 23:13:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE62514F7; Wed, 23 Apr 2014 23:13:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3NNDkvJ093460; Wed, 23 Apr 2014 23:13:46 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3NNDk2N093459; Wed, 23 Apr 2014 23:13:46 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201404232313.s3NNDk2N093459@svn.freebsd.org> From: Rick Macklem Date: Wed, 23 Apr 2014 23:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264845 - head/sys/fs/nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2014 23:13:47 -0000 Author: rmacklem Date: Wed Apr 23 23:13:46 2014 New Revision: 264845 URL: http://svnweb.freebsd.org/changeset/base/264845 Log: Remove an unnecessary level of indirection for an argument. This simplifies the code and should avoid the clang sparc port from generating an abort() call. Requested by: rdivacky Submitted by: jhb MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Wed Apr 23 22:44:49 2014 (r264844) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Wed Apr 23 23:13:46 2014 (r264845) @@ -79,7 +79,7 @@ static int nfsrv_getstate(struct nfsclie static void nfsrv_getowner(struct nfsstatehead *hp, struct nfsstate *new_stp, struct nfsstate **stpp); static int nfsrv_getlockfh(vnode_t vp, u_short flags, - struct nfslockfile **new_lfpp, fhandle_t *nfhp, NFSPROC_T *p); + struct nfslockfile *new_lfp, fhandle_t *nfhp, NFSPROC_T *p); static int nfsrv_getlockfile(u_short flags, struct nfslockfile **new_lfpp, struct nfslockfile **lfpp, fhandle_t *nfhp, int lockit); static void nfsrv_insertlock(struct nfslock *new_lop, @@ -1985,7 +1985,7 @@ tryagain: MALLOC(new_lfp, struct nfslockfile *, sizeof (struct nfslockfile), M_NFSDLOCKFILE, M_WAITOK); if (vp) - getfhret = nfsrv_getlockfh(vp, new_stp->ls_flags, &new_lfp, + getfhret = nfsrv_getlockfh(vp, new_stp->ls_flags, new_lfp, NULL, p); NFSLOCKSTATE(); /* @@ -2235,7 +2235,7 @@ tryagain: M_NFSDSTATE, M_WAITOK); MALLOC(new_deleg, struct nfsstate *, sizeof (struct nfsstate), M_NFSDSTATE, M_WAITOK); - getfhret = nfsrv_getlockfh(vp, new_stp->ls_flags, &new_lfp, + getfhret = nfsrv_getlockfh(vp, new_stp->ls_flags, new_lfp, NULL, p); NFSLOCKSTATE(); /* @@ -3142,11 +3142,10 @@ out: * Get the file handle for a lock structure. */ static int -nfsrv_getlockfh(vnode_t vp, u_short flags, - struct nfslockfile **new_lfpp, fhandle_t *nfhp, NFSPROC_T *p) +nfsrv_getlockfh(vnode_t vp, u_short flags, struct nfslockfile *new_lfp, + fhandle_t *nfhp, NFSPROC_T *p) { fhandle_t *fhp = NULL; - struct nfslockfile *new_lfp; int error; /* @@ -3154,7 +3153,7 @@ nfsrv_getlockfh(vnode_t vp, u_short flag * a fhandle_t on the stack. */ if (flags & NFSLCK_OPEN) { - new_lfp = *new_lfpp; + KASSERT(new_lfp != NULL, ("nfsrv_getlockfh: new_lfp NULL")); fhp = &new_lfp->lf_fh; } else if (nfhp) { fhp = nfhp; From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 00:27:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FB6886D; Thu, 24 Apr 2014 00:27:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F04201AB5; Thu, 24 Apr 2014 00:27:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O0RY4O023033; Thu, 24 Apr 2014 00:27:34 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O0RY0x023032; Thu, 24 Apr 2014 00:27:34 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201404240027.s3O0RY0x023032@svn.freebsd.org> From: Peter Grehan Date: Thu, 24 Apr 2014 00:27:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264846 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 00:27:35 -0000 Author: grehan Date: Thu Apr 24 00:27:34 2014 New Revision: 264846 URL: http://svnweb.freebsd.org/changeset/base/264846 Log: Allow the guest to read the TSC via MSR 0x10. NetBSD/amd64 does this, as does Linux on AMD CPUs. Reviewed by: neel MFC after: 3 weeks Modified: head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Wed Apr 23 23:13:46 2014 (r264845) +++ head/sys/amd64/vmm/intel/vmx.c Thu Apr 24 00:27:34 2014 (r264846) @@ -863,6 +863,11 @@ vmx_vminit(struct vm *vm, pmap_t pmap) * MSR_EFER is saved and restored in the guest VMCS area on a * VM exit and entry respectively. It is also restored from the * host VMCS area on a VM exit. + * + * The TSC MSR is exposed read-only. Writes are disallowed as that + * will impact the host TSC. + * XXX Writes would be implemented with a wrmsr trap, and + * then modifying the TSC offset in the VMCS. */ if (guest_msr_rw(vmx, MSR_GSBASE) || guest_msr_rw(vmx, MSR_FSBASE) || @@ -870,7 +875,8 @@ vmx_vminit(struct vm *vm, pmap_t pmap) guest_msr_rw(vmx, MSR_SYSENTER_ESP_MSR) || guest_msr_rw(vmx, MSR_SYSENTER_EIP_MSR) || guest_msr_rw(vmx, MSR_KGSBASE) || - guest_msr_rw(vmx, MSR_EFER)) + guest_msr_rw(vmx, MSR_EFER) || + guest_msr_ro(vmx, MSR_TSC)) panic("vmx_vminit: error setting guest msr access"); /* From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 00:41:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65C5ED0D; Thu, 24 Apr 2014 00:41:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 526E11C23; Thu, 24 Apr 2014 00:41:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O0f3Ul029070; Thu, 24 Apr 2014 00:41:03 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O0f3Hv029034; Thu, 24 Apr 2014 00:41:03 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201404240041.s3O0f3Hv029034@svn.freebsd.org> From: Steven Hartland Date: Thu, 24 Apr 2014 00:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264849 - head/sys/dev/acpica/Osd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 00:41:03 -0000 Author: smh Date: Thu Apr 24 00:41:02 2014 New Revision: 264849 URL: http://svnweb.freebsd.org/changeset/base/264849 Log: Exposed debug.acpi.max_tasks and debug.acpi.max_threads via sysctls so their values can be viewed. Modified: head/sys/dev/acpica/Osd/OsdSchedule.c Modified: head/sys/dev/acpica/Osd/OsdSchedule.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSchedule.c Thu Apr 24 00:29:18 2014 (r264848) +++ head/sys/dev/acpica/Osd/OsdSchedule.c Thu Apr 24 00:41:02 2014 (r264849) @@ -52,11 +52,15 @@ __FBSDID("$FreeBSD$"); #define _COMPONENT ACPI_OS_SERVICES ACPI_MODULE_NAME("SCHEDULE") +SYSCTL_DECL(_debug_acpi); + /* * Allow the user to tune the maximum number of tasks we may enqueue. */ static int acpi_max_tasks = ACPI_MAX_TASKS; TUNABLE_INT("debug.acpi.max_tasks", &acpi_max_tasks); +SYSCTL_INT(_debug_acpi, OID_AUTO, max_tasks, CTLFLAG_RDTUN, &acpi_max_tasks, + 0, "Maximum acpi tasks"); /* * Allow the user to tune the number of task threads we start. It seems @@ -64,6 +68,8 @@ TUNABLE_INT("debug.acpi.max_tasks", &acp */ static int acpi_max_threads = ACPI_MAX_THREADS; TUNABLE_INT("debug.acpi.max_threads", &acpi_max_threads); +SYSCTL_INT(_debug_acpi, OID_AUTO, max_threads, CTLFLAG_RDTUN, &acpi_max_threads, + 0, "Maximum acpi threads"); static MALLOC_DEFINE(M_ACPITASK, "acpitask", "ACPI deferred task"); From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 01:06:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9CD56402; Thu, 24 Apr 2014 01:06:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 890831DE8; Thu, 24 Apr 2014 01:06:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O164jg039717; Thu, 24 Apr 2014 01:06:04 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O164wo039714; Thu, 24 Apr 2014 01:06:04 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201404240106.s3O164wo039714@svn.freebsd.org> From: Steven Hartland Date: Thu, 24 Apr 2014 01:06:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264850 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 01:06:04 -0000 Author: smh Date: Thu Apr 24 01:06:03 2014 New Revision: 264850 URL: http://svnweb.freebsd.org/changeset/base/264850 Log: Add the ability to set a minimum ashift size for ZFS pool creation or root level vdev addition. Change max_auto_ashift sysctl to error when an invalid value is requested instead of silently limiting it. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Thu Apr 24 00:41:02 2014 (r264849) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Thu Apr 24 01:06:03 2014 (r264850) @@ -106,7 +106,7 @@ _NOTE(CONSTCOND) } while (0) #define SPA_BLOCKSIZES (SPA_MAXBLOCKSHIFT - SPA_MINBLOCKSHIFT + 1) /* - * Maximum supported logical ashift. + * Default maximum supported logical ashift. * * The current 8k allocation block size limit is due to the 8k * aligned/sized operations performed by vdev_probe() on @@ -117,6 +117,11 @@ _NOTE(CONSTCOND) } while (0) #define SPA_MAXASHIFT 13 /* + * Default minimum supported logical ashift. + */ +#define SPA_MINASHIFT SPA_MINBLOCKSHIFT + +/* * Size of block to hold the configuration data (a packed nvlist) */ #define SPA_CONFIG_BLOCKSIZE (1ULL << 14) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Thu Apr 24 00:41:02 2014 (r264849) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Thu Apr 24 01:06:03 2014 (r264850) @@ -53,7 +53,7 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, vdev, CT * Virtual device management. */ -/** +/* * The limit for ZFS to automatically increase a top-level vdev's ashift * from logical ashift to physical ashift. * @@ -61,19 +61,34 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, vdev, CT * child->vdev_ashift = 9 (512 bytes) * child->vdev_physical_ashift = 12 (4096 bytes) * zfs_max_auto_ashift = 11 (2048 bytes) + * zfs_min_auto_ashift = 9 (512 bytes) * - * On pool creation or the addition of a new top-leve vdev, ZFS will - * bump the ashift of the top-level vdev to 2048. + * On pool creation or the addition of a new top-level vdev, ZFS will + * increase the ashift of the top-level vdev to 2048 as limited by + * zfs_max_auto_ashift. * * Example: one or more 512B emulation child vdevs * child->vdev_ashift = 9 (512 bytes) * child->vdev_physical_ashift = 12 (4096 bytes) * zfs_max_auto_ashift = 13 (8192 bytes) + * zfs_min_auto_ashift = 9 (512 bytes) + * + * On pool creation or the addition of a new top-level vdev, ZFS will + * increase the ashift of the top-level vdev to 4096 to match the + * max vdev_physical_ashift. * - * On pool creation or the addition of a new top-leve vdev, ZFS will - * bump the ashift of the top-level vdev to 4096. + * Example: one or more 512B emulation child vdevs + * child->vdev_ashift = 9 (512 bytes) + * child->vdev_physical_ashift = 9 (512 bytes) + * zfs_max_auto_ashift = 13 (8192 bytes) + * zfs_min_auto_ashift = 12 (4096 bytes) + * + * On pool creation or the addition of a new top-level vdev, ZFS will + * increase the ashift of the top-level vdev to 4096 to match the + * zfs_min_auto_ashift. */ static uint64_t zfs_max_auto_ashift = SPA_MAXASHIFT; +static uint64_t zfs_min_auto_ashift = SPA_MINASHIFT; static int sysctl_vfs_zfs_max_auto_ashift(SYSCTL_HANDLER_ARGS) @@ -86,8 +101,8 @@ sysctl_vfs_zfs_max_auto_ashift(SYSCTL_HA if (err != 0 || req->newptr == NULL) return (err); - if (val > SPA_MAXASHIFT) - val = SPA_MAXASHIFT; + if (val > SPA_MAXASHIFT || val < zfs_min_auto_ashift) + return (EINVAL); zfs_max_auto_ashift = val; @@ -96,7 +111,31 @@ sysctl_vfs_zfs_max_auto_ashift(SYSCTL_HA SYSCTL_PROC(_vfs_zfs, OID_AUTO, max_auto_ashift, CTLTYPE_U64 | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(uint64_t), sysctl_vfs_zfs_max_auto_ashift, "QU", - "Cap on logical -> physical ashift adjustment on new top-level vdevs."); + "Max ashift used when optimising for logical -> physical sectors size on " + "new top-level vdevs."); + +static int +sysctl_vfs_zfs_min_auto_ashift(SYSCTL_HANDLER_ARGS) +{ + uint64_t val; + int err; + + val = zfs_min_auto_ashift; + err = sysctl_handle_64(oidp, &val, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + if (val < SPA_MINASHIFT || val > zfs_max_auto_ashift) + return (EINVAL); + + zfs_min_auto_ashift = val; + + return (0); +} +SYSCTL_PROC(_vfs_zfs, OID_AUTO, min_auto_ashift, + CTLTYPE_U64 | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(uint64_t), + sysctl_vfs_zfs_min_auto_ashift, "QU", + "Min ashift used when creating new top-level vdevs."); static vdev_ops_t *vdev_ops_table[] = { &vdev_root_ops, @@ -1631,19 +1670,30 @@ vdev_metaslab_set_size(vdev_t *vd) } /* - * Maximize performance by inflating the configured ashift for - * top level vdevs to be as close to the physical ashift as - * possible without exceeding the administrator specified - * limit. + * Maximize performance by inflating the configured ashift for top level + * vdevs to be as close to the physical ashift as possible while maintaining + * administrator defined limits and ensuring it doesn't go below the + * logical ashift. */ void vdev_ashift_optimize(vdev_t *vd) { - if (vd == vd->vdev_top && - (vd->vdev_ashift < vd->vdev_physical_ashift) && - (vd->vdev_ashift < zfs_max_auto_ashift)) { - vd->vdev_ashift = MIN(zfs_max_auto_ashift, - vd->vdev_physical_ashift); + if (vd == vd->vdev_top) { + if (vd->vdev_ashift < vd->vdev_physical_ashift) { + vd->vdev_ashift = MIN( + MAX(zfs_max_auto_ashift, vd->vdev_ashift), + MAX(zfs_min_auto_ashift, vd->vdev_physical_ashift)); + } else { + /* + * Unusual case where logical ashift > physical ashift + * so we can't cap the calculated ashift based on max + * ashift as that would cause failures. + * We still check if we need to increase it to match + * the min ashift. + */ + vd->vdev_ashift = MAX(zfs_min_auto_ashift, + vd->vdev_ashift); + } } } From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 01:12:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7165F5B3; Thu, 24 Apr 2014 01:12:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E0A91FEF; Thu, 24 Apr 2014 01:12:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O1CrQ3043424; Thu, 24 Apr 2014 01:12:53 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O1CrSl043423; Thu, 24 Apr 2014 01:12:53 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201404240112.s3O1CrSl043423@svn.freebsd.org> From: Steven Hartland Date: Thu, 24 Apr 2014 01:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264851 - head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 01:12:53 -0000 Author: smh Date: Thu Apr 24 01:12:52 2014 New Revision: 264851 URL: http://svnweb.freebsd.org/changeset/base/264851 Log: Eliminated optarg global being used outside of the function which called getopt MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Apr 24 01:06:03 2014 (r264850) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Apr 24 01:12:52 2014 (r264851) @@ -495,9 +495,8 @@ usage(boolean_t requested) } static int -parseprop(nvlist_t *props) +parseprop(nvlist_t *props, char *propname) { - char *propname = optarg; char *propval, *strval; if ((propval = strchr(propname, '=')) == NULL) { @@ -526,7 +525,7 @@ parse_depth(char *opt, int *flags) depth = (int)strtol(opt, &tmp, 0); if (*tmp) { (void) fprintf(stderr, - gettext("%s is not an integer\n"), optarg); + gettext("%s is not an integer\n"), opt); usage(B_FALSE); } if (depth < 0) { @@ -617,7 +616,7 @@ zfs_do_clone(int argc, char **argv) while ((c = getopt(argc, argv, "o:p")) != -1) { switch (c) { case 'o': - if (parseprop(props)) + if (parseprop(props, optarg)) return (1); break; case 'p': @@ -767,7 +766,7 @@ zfs_do_create(int argc, char **argv) nomem(); break; case 'o': - if (parseprop(props)) + if (parseprop(props, optarg)) goto error; break; case 's': @@ -3636,7 +3635,7 @@ zfs_do_snapshot(int argc, char **argv) while ((c = getopt(argc, argv, "ro:")) != -1) { switch (c) { case 'o': - if (parseprop(props)) + if (parseprop(props, optarg)) return (1); break; case 'r': From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 01:20:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3ED02752; Thu, 24 Apr 2014 01:20:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B74D10CE; Thu, 24 Apr 2014 01:20:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O1Ki2F044837; Thu, 24 Apr 2014 01:20:44 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O1Kijl044836; Thu, 24 Apr 2014 01:20:44 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201404240120.s3O1Kijl044836@svn.freebsd.org> From: Steven Hartland Date: Thu, 24 Apr 2014 01:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264852 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 01:20:44 -0000 Author: smh Date: Thu Apr 24 01:20:43 2014 New Revision: 264852 URL: http://svnweb.freebsd.org/changeset/base/264852 Log: Silence compiler warning due to missing return in idmap_id_to_numeric_domain_rid Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Apr 24 01:12:52 2014 (r264851) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Apr 24 01:20:43 2014 (r264852) @@ -2573,6 +2573,7 @@ out: return (err); #else /* !sun */ assert(!"invalid code path"); + return (EINVAL); // silence compiler warning #endif /* !sun */ } From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 01:28:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D24888F5; Thu, 24 Apr 2014 01:28:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4B831116; Thu, 24 Apr 2014 01:28:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O1SE9o048089; Thu, 24 Apr 2014 01:28:14 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O1SEDn048088; Thu, 24 Apr 2014 01:28:14 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201404240128.s3O1SEDn048088@svn.freebsd.org> From: Steven Hartland Date: Thu, 24 Apr 2014 01:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264853 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 01:28:14 -0000 Author: smh Date: Thu Apr 24 01:28:14 2014 New Revision: 264853 URL: http://svnweb.freebsd.org/changeset/base/264853 Log: Add some new ATA defines for SATA 3.1 spec Modified: head/sys/sys/ata.h Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Thu Apr 24 01:20:43 2014 (r264852) +++ head/sys/sys/ata.h Thu Apr 24 01:28:14 2014 (r264853) @@ -130,6 +130,7 @@ struct ata_params { #define ATA_SATA_CURR_GEN_MASK 0x0006 #define ATA_SUPPORT_NCQ_STREAM 0x0010 #define ATA_SUPPORT_NCQ_QMANAGEMENT 0x0020 +#define ATA_SUPPORT_RCVSND_FPDMA_QUEUED 0x0040 /*78*/ u_int16_t satasupport; #define ATA_SUPPORT_NONZERO 0x0002 #define ATA_SUPPORT_AUTOACTIVATE 0x0004 @@ -351,6 +352,7 @@ struct ata_params { #define ATA_READ_NATIVE_MAX_ADDRESS48 0x27 /* read native max addr 48bit */ #define ATA_READ_MUL48 0x29 /* read multi 48bit LBA */ #define ATA_READ_STREAM_DMA48 0x2a /* read DMA stream 48bit LBA */ +#define ATA_READ_LOG_EXT 0x2f /* read log ext - PIO Data-In */ #define ATA_READ_STREAM48 0x2b /* read stream 48bit LBA */ #define ATA_WRITE 0x30 /* write */ #define ATA_WRITE48 0x34 /* write 48bit LBA */ @@ -365,8 +367,11 @@ struct ata_params { #define ATA_WRITE_LOG_EXT 0x3f #define ATA_READ_VERIFY 0x40 #define ATA_READ_VERIFY48 0x42 +#define ATA_READ_LOG_DMA_EXT 0x47 /* read log DMA ext - PIO Data-In */ #define ATA_READ_FPDMA_QUEUED 0x60 /* read DMA NCQ */ #define ATA_WRITE_FPDMA_QUEUED 0x61 /* write DMA NCQ */ +#define ATA_SEND_FPDMA_QUEUED 0x64 /* send DMA NCQ */ +#define ATA_RECV_FPDMA_QUEUED 0x65 /* recieve DMA NCQ */ #define ATA_SEP_ATTN 0x67 /* SEP request */ #define ATA_SEEK 0x70 /* seek */ #define ATA_PACKET_CMD 0xa0 /* packet command */ From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 01:28:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72059A2C; Thu, 24 Apr 2014 01:28:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F4491119; Thu, 24 Apr 2014 01:28:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O1Se7h048163; Thu, 24 Apr 2014 01:28:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O1Seo1048162; Thu, 24 Apr 2014 01:28:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404240128.s3O1Seo1048162@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Apr 2014 01:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264854 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 01:28:40 -0000 Author: adrian Date: Thu Apr 24 01:28:39 2014 New Revision: 264854 URL: http://svnweb.freebsd.org/changeset/base/264854 Log: Add a capability to indicate that the net80211 stack should be doing RUN->SLEEP->RUN transitions for station mode sleep management. Modified: head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Thu Apr 24 01:28:14 2014 (r264853) +++ head/sys/net80211/ieee80211_var.h Thu Apr 24 01:28:39 2014 (r264854) @@ -629,6 +629,7 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_C_MONITOR 0x00010000 /* CAPABILITY: monitor mode */ #define IEEE80211_C_DFS 0x00020000 /* CAPABILITY: DFS/radar avail*/ #define IEEE80211_C_MBSS 0x00040000 /* CAPABILITY: MBSS available */ +#define IEEE80211_C_SWSLEEP 0x00080000 /* CAPABILITY: do sleep here */ /* 0x7c0000 available */ #define IEEE80211_C_WPA1 0x00800000 /* CAPABILITY: WPA1 avail */ #define IEEE80211_C_WPA2 0x01000000 /* CAPABILITY: WPA2 avail */ From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 01:39:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 679A3CA4; Thu, 24 Apr 2014 01:39:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47B2011F9; Thu, 24 Apr 2014 01:39:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O1dssW052384; Thu, 24 Apr 2014 01:39:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O1drcg052381; Thu, 24 Apr 2014 01:39:53 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404240139.s3O1drcg052381@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Apr 2014 01:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264855 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 01:39:54 -0000 Author: adrian Date: Thu Apr 24 01:39:53 2014 New Revision: 264855 URL: http://svnweb.freebsd.org/changeset/base/264855 Log: Begin fleshing out support for net80211 provided (legacy) sleep management. This transitions the VAP in and out of SLEEP state based on: * whether there's been an active transmission in the last (hardcoded) 500ms; * whether the TIM from the AP indicates there is data available. It uses the beacon reception to trigger the active traffic check. This way there's no further timer running to wake up the CPU from its own sleep states. Right now the VAP isn't woken up for multicast traffic - mostly because the only NIC I plan on doing this for right will auto wakeup and stay awake for multicast traffic indicated in the TIM. So I don't have to manually keep the hardware awake. This doesn't do anything if the NIC doesn't advertise it implements the new SWSLEEP capability AND if the VAP doesn't have powersave enabled. It also doesn't do much with ath(4) as it doesn't currently implement the SLEEP state. Tested: * AR5416, STA mode (with local ath(4) changes) Modified: head/sys/net80211/ieee80211_power.c head/sys/net80211/ieee80211_power.h head/sys/net80211/ieee80211_sta.c Modified: head/sys/net80211/ieee80211_power.c ============================================================================== --- head/sys/net80211/ieee80211_power.c Thu Apr 24 01:28:39 2014 (r264854) +++ head/sys/net80211/ieee80211_power.c Thu Apr 24 01:39:53 2014 (r264855) @@ -555,3 +555,89 @@ ieee80211_sta_pwrsave(struct ieee80211va ieee80211_send_nulldata(ieee80211_ref_node(ni)); } } + +/* + * Handle being notified that we have data available for us in a TIM/ATIM. + * + * This may schedule a transition from _SLEEP -> _RUN if it's appropriate. + */ +void +ieee80211_sta_tim_notify(struct ieee80211vap *vap, int set) +{ + /* + * Schedule the driver state change. It'll happen at some point soon. + * Since the hardware shouldn't know that we're running just yet + * (and thus tell the peer that we're awake before we actually wake + * up said hardware), we leave the actual node state transition + * up to the transition to RUN. + * + * XXX TODO: verify that the transition to RUN will wake up the + * BSS node! + */ + IEEE80211_DPRINTF(vap, IEEE80211_MSG_POWER, "%s: TIM=%d\n", __func__, set); + IEEE80211_LOCK(vap->iv_ic); + if (set == 1 && vap->iv_state == IEEE80211_S_SLEEP) { + ieee80211_new_state_locked(vap, IEEE80211_S_RUN, 0); + } + IEEE80211_UNLOCK(vap->iv_ic); +} + +/* + * Timer check on whether the VAP has had any transmit activity. + * + * This may schedule a transition from _RUN -> _SLEEP if it's appropriate. + */ +void +ieee80211_sta_ps_timer_check(struct ieee80211vap *vap) +{ + struct ieee80211com *ic = vap->iv_ic; + + /* XXX lock assert */ + + /* For no, only do this in STA mode */ + if (! (vap->iv_caps & IEEE80211_C_SWSLEEP)) + goto out; + + if (vap->iv_opmode != IEEE80211_M_STA) + goto out; + + /* If we're not at run state, bail */ + if (vap->iv_state != IEEE80211_S_RUN) + goto out; + + IEEE80211_DPRINTF(vap, IEEE80211_MSG_POWER, + "%s: lastdata=%llu, ticks=%llu\n", + __func__, (unsigned long long) ic->ic_lastdata, + (unsigned long long) ticks); + + /* If powersave is disabled on the VAP, don't bother */ + if (! (vap->iv_flags & IEEE80211_F_PMGTON)) + goto out; + + /* If we've done any data within our idle interval, bail */ + /* XXX hard-coded to one second for now, ew! */ + if (time_after(ic->ic_lastdata + 500, ticks)) + goto out; + + /* + * Signify we're going into power save and transition the + * node to powersave. + */ + if ((vap->iv_bss->ni_flags & IEEE80211_NODE_PWR_MGT) == 0) + vap->iv_sta_ps(vap, 1); + + /* + * XXX The driver has to handle the fact that we're going + * to sleep but frames may still be transmitted; + * hopefully it and/or us will do the right thing and mark any + * transmitted frames with PWRMGT set to 1. + */ + ieee80211_new_state_locked(vap, IEEE80211_S_SLEEP, 0); + + IEEE80211_DPRINTF(vap, IEEE80211_MSG_POWER, + "%s: time delta=%d msec\n", __func__, + (int) ticks_to_msecs(ticks - ic->ic_lastdata)); + +out: + return; +} Modified: head/sys/net80211/ieee80211_power.h ============================================================================== --- head/sys/net80211/ieee80211_power.h Thu Apr 24 01:28:39 2014 (r264854) +++ head/sys/net80211/ieee80211_power.h Thu Apr 24 01:39:53 2014 (r264855) @@ -79,6 +79,9 @@ int ieee80211_node_psq_age(struct ieee80 int ieee80211_pwrsave(struct ieee80211_node *, struct mbuf *); void ieee80211_node_pwrsave(struct ieee80211_node *, int enable); void ieee80211_sta_pwrsave(struct ieee80211vap *, int enable); +void ieee80211_sta_tim_notify(struct ieee80211vap *vap, int set); +void ieee80211_sta_ps_timer_check(struct ieee80211vap *vap); +/* XXX what's this? */ void ieee80211_power_poll(struct ieee80211com *); #endif /* _NET80211_IEEE80211_POWER_H_ */ Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Thu Apr 24 01:28:39 2014 (r264854) +++ head/sys/net80211/ieee80211_sta.c Thu Apr 24 01:39:53 2014 (r264855) @@ -234,6 +234,7 @@ sta_newstate(struct ieee80211vap *vap, e switch (ostate) { case IEEE80211_S_SLEEP: /* XXX wakeup */ + /* XXX driver hook to wakeup the hardware? */ case IEEE80211_S_RUN: IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_DISASSOC, @@ -403,6 +404,7 @@ sta_newstate(struct ieee80211vap *vap, e arg == IEEE80211_FC0_SUBTYPE_ASSOC_RESP); break; case IEEE80211_S_SLEEP: + /* Wake up from sleep */ vap->iv_sta_ps(vap, 0); break; default: @@ -430,9 +432,11 @@ sta_newstate(struct ieee80211vap *vap, e ieee80211_node_authorize(ni); /* * Fake association when joining an existing bss. + * + * Don't do this if we're doing SLEEP->RUN. */ - if (ic->ic_newassoc != NULL) - ic->ic_newassoc(vap->iv_bss, ostate != IEEE80211_S_RUN); + if (ic->ic_newassoc != NULL && ostate != IEEE80211_S_SLEEP) + ic->ic_newassoc(vap->iv_bss, (ostate != IEEE80211_S_RUN)); break; case IEEE80211_S_CSA: if (ostate != IEEE80211_S_RUN) @@ -1312,6 +1316,7 @@ sta_recv_mgmt(struct ieee80211_node *ni, vap->iv_stats.is_beacon_bad++; return; } + /* * Count frame now that we know it's to be processed. */ @@ -1381,23 +1386,48 @@ sta_recv_mgmt(struct ieee80211_node *ni, } if (scan.quiet) ic->ic_set_quiet(ni, scan.quiet); + if (scan.tim != NULL) { struct ieee80211_tim_ie *tim = (struct ieee80211_tim_ie *) scan.tim; -#if 0 + /* + * XXX Check/debug this code; see if it's about + * the right time to force the VAP awake if we + * receive a frame destined for us? + */ int aid = IEEE80211_AID(ni->ni_associd); int ix = aid / NBBY; int min = tim->tim_bitctl &~ 1; int max = tim->tim_len + min - 4; - if ((tim->tim_bitctl&1) || + + /* + * Only do this for unicast traffic in the TIM + * The multicast traffic notification for + * the scan notification stuff should occur + * differently. + */ + if (min <= ix && ix <= max && + isset(tim->tim_bitmap - min, aid)) { + ieee80211_sta_tim_notify(vap, 1); + ic->ic_lastdata = ticks; + } + + /* + * XXX TODO: do a separate notification + * for the multicast bit being set. + */ +#if 0 + if ((tim->tim_bitctl & 1) || (min <= ix && ix <= max && isset(tim->tim_bitmap - min, aid))) { /* * XXX Do not let bg scan kick off * we are expecting data. */ + ieee80211_sta_tim_notify(vap, 1); ic->ic_lastdata = ticks; - vap->iv_sta_ps(vap, 0); + // XXX not yet? +// vap->iv_sta_ps(vap, 0); } #endif ni->ni_dtim_count = tim->tim_count; @@ -1446,6 +1476,14 @@ sta_recv_mgmt(struct ieee80211_node *ni, } /* + * Put the station to sleep if we haven't seen + * traffic in a while. + */ + IEEE80211_LOCK(ic); + ieee80211_sta_ps_timer_check(vap); + IEEE80211_UNLOCK(ic); + + /* * If we've had a channel width change (eg HT20<->HT40) * then schedule a delayed driver notification. */ From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 02:02:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 121B31B3; Thu, 24 Apr 2014 02:02:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F35F1149B; Thu, 24 Apr 2014 02:02:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O226Z3063939; Thu, 24 Apr 2014 02:02:06 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O226U5063938; Thu, 24 Apr 2014 02:02:06 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404240202.s3O226U5063938@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Apr 2014 02:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264856 - head/tools/tools/nanobsd/dhcpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 02:02:07 -0000 Author: imp Date: Thu Apr 24 02:02:06 2014 New Revision: 264856 URL: http://svnweb.freebsd.org/changeset/base/264856 Log: Override the parallel make target to use all CPUs. Modified: head/tools/tools/nanobsd/dhcpd/common Modified: head/tools/tools/nanobsd/dhcpd/common ============================================================================== --- head/tools/tools/nanobsd/dhcpd/common Thu Apr 24 01:39:53 2014 (r264855) +++ head/tools/tools/nanobsd/dhcpd/common Thu Apr 24 02:02:06 2014 (r264856) @@ -33,7 +33,9 @@ # simplified to meet the needs of the example. # -NANO_PMAKE="make" # NB: disable -j 3 +# NB: You want the other file + +NANO_PMAKE="make -j $(sysctl -n hw.ncpu)" NANO_CFG_BASE=$(pwd) NANO_CFG_BASE=${NANO_CFG_BASE%/dhcpd} From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 02:02:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2720E2E9; Thu, 24 Apr 2014 02:02:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14D52149C; Thu, 24 Apr 2014 02:02:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O22Bww063997; Thu, 24 Apr 2014 02:02:11 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O22BeM063995; Thu, 24 Apr 2014 02:02:11 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404240202.s3O22BeM063995@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Apr 2014 02:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264857 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 02:02:12 -0000 Author: imp Date: Thu Apr 24 02:02:11 2014 New Revision: 264857 URL: http://svnweb.freebsd.org/changeset/base/264857 Log: No need for true here, remove it. Sponsored by: Netflix Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Thu Apr 24 02:02:06 2014 (r264856) +++ head/tools/tools/nanobsd/nanobsd.sh Thu Apr 24 02:02:11 2014 (r264857) @@ -616,7 +616,6 @@ last_orders () ( # after the build completed, for instance to copy the finished # image to a more convenient place: # cp ${NANO_DISKIMGDIR}/_.disk.image /home/ftp/pub/nanobsd.disk - true ) ####################################################################### From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 02:02:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B17CB420; Thu, 24 Apr 2014 02:02:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EC08149F; Thu, 24 Apr 2014 02:02:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O22Kp5064061; Thu, 24 Apr 2014 02:02:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O22KNH064060; Thu, 24 Apr 2014 02:02:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404240202.s3O22KNH064060@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Apr 2014 02:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264858 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 02:02:20 -0000 Author: imp Date: Thu Apr 24 02:02:20 2014 New Revision: 264858 URL: http://svnweb.freebsd.org/changeset/base/264858 Log: Introduce NANO_PKG_META_BASE to allow moving where metadata for packages is stored. Sponsored by: Netflix Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Thu Apr 24 02:02:11 2014 (r264857) +++ head/tools/tools/nanobsd/nanobsd.sh Thu Apr 24 02:02:20 2014 (r264858) @@ -49,6 +49,9 @@ NANO_TOOLS=tools/tools/nanobsd NANO_PACKAGE_DIR=${NANO_SRC}/${NANO_TOOLS}/Pkg NANO_PACKAGE_LIST="*" +# where package metadata gets placed +NANO_PKG_META_BASE=/var/db + # Object tree directory # default is subdir of /usr/obj #NANO_OBJ="" @@ -719,7 +722,7 @@ cust_pkg () ( fi # Copy packages into chroot - mkdir -p ${NANO_WORLDDIR}/Pkg + mkdir -p ${NANO_WORLDDIR}/Pkg ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg ( cd ${NANO_PACKAGE_DIR} find ${NANO_PACKAGE_LIST} -print | @@ -734,18 +737,18 @@ cust_pkg () ( while true do # Record how many we have now - have=`ls ${NANO_WORLDDIR}/var/db/pkg | wc -l` + have=`ls ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg | wc -l` # Attempt to install more packages # ...but no more than 200 at a time due to pkg_add's internal # limitations. chroot ${NANO_WORLDDIR} sh -c \ - 'ls Pkg/*tbz | xargs -n 200 pkg_add -F' || true + 'ls Pkg/*tbz | xargs -n 200 env PKG_DBDIR='${NANO_PKG_META_BASE}'/pkg pkg_add -v -F' || true # See what that got us - now=`ls ${NANO_WORLDDIR}/var/db/pkg | wc -l` + now=`ls ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg | wc -l` echo "=== NOW $now" - ls ${NANO_WORLDDIR}/var/db/pkg + ls ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg echo "===" From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 02:02:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4572D557; Thu, 24 Apr 2014 02:02:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2084514A3; Thu, 24 Apr 2014 02:02:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O22Suk064118; Thu, 24 Apr 2014 02:02:28 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O22SGM064117; Thu, 24 Apr 2014 02:02:28 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404240202.s3O22SGM064117@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Apr 2014 02:02:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264859 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 02:02:29 -0000 Author: imp Date: Thu Apr 24 02:02:28 2014 New Revision: 264859 URL: http://svnweb.freebsd.org/changeset/base/264859 Log: Add a routine for easy workaround any umount issues w/o hacking nanobsd.sh. Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Thu Apr 24 02:02:20 2014 (r264858) +++ head/tools/tools/nanobsd/nanobsd.sh Thu Apr 24 02:02:28 2014 (r264859) @@ -428,6 +428,12 @@ newfs_part ( ) ( mount -o async ${dev} ${mnt} ) +# Convenient spot to work around any umount issues that your build environment +# hits by overriding this method. +nano_umount () { + umount ${1} +} + populate_slice ( ) ( local dev dir mnt lbl dev=$1 @@ -442,7 +448,7 @@ populate_slice ( ) ( find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -dumpv ${mnt} fi df -i ${mnt} - umount ${mnt} + nano_umount ${mnt} ) populate_cfg_slice ( ) ( @@ -541,7 +547,7 @@ create_i386_diskimage ( ) ( -y ${NANO_HEADS}` fi - trap "echo 'Running exit trap code' ; df -i ${MNT} ; umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT + trap "echo 'Running exit trap code' ; df -i ${MNT} ; nano_umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT fdisk -i -f ${NANO_OBJ}/_.fdisk ${MD} fdisk ${MD} @@ -557,7 +563,7 @@ create_i386_diskimage ( ) ( echo "Generating mtree..." ( cd ${MNT} && mtree -c ) > ${NANO_OBJ}/_.mtree ( cd ${MNT} && du -k ) > ${NANO_OBJ}/_.du - umount ${MNT} + nano_umount ${MNT} if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then # Duplicate to second image (if present) @@ -568,7 +574,7 @@ create_i386_diskimage ( ) ( do sed -i "" "s=${NANO_DRIVE}s1=${NANO_DRIVE}s2=g" $f done - umount ${MNT} + nano_umount ${MNT} # Override the label from the first partition so we # don't confuse glabel with duplicates. if [ ! -z ${NANO_LABEL} ]; then From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 02:02:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C722C69A; Thu, 24 Apr 2014 02:02:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B41EF14A7; Thu, 24 Apr 2014 02:02:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O22bSo064181; Thu, 24 Apr 2014 02:02:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O22bBA064179; Thu, 24 Apr 2014 02:02:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404240202.s3O22bBA064179@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Apr 2014 02:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264860 - head/tools/tools/nanobsd/dhcpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 02:02:37 -0000 Author: imp Date: Thu Apr 24 02:02:37 2014 New Revision: 264860 URL: http://svnweb.freebsd.org/changeset/base/264860 Log: Switch to using pkgng for all package management. Add necessary bootstrap step for pkg. Fix a bunch of annoying little nits. We can now build fat or thin images successfully for the dhcpd config. Modified: head/tools/tools/nanobsd/dhcpd/common head/tools/tools/nanobsd/dhcpd/os-base Modified: head/tools/tools/nanobsd/dhcpd/common ============================================================================== --- head/tools/tools/nanobsd/dhcpd/common Thu Apr 24 02:02:28 2014 (r264859) +++ head/tools/tools/nanobsd/dhcpd/common Thu Apr 24 02:02:37 2014 (r264860) @@ -44,7 +44,8 @@ NANO_SRC=${NANO_SRC%/tools/tools/nanobsd NANO_OBJ=${NANO_SRC}/../dhcpd/obj # Where cust_pkg() finds packages to install #XXX: Is this the right place? -NANO_PORTS=${NANO_SRC}/../ports +#NANO_PORTS=$(realpath ${NANO_SRC}/../ports) +NANO_PORTS=/usr/ports NANO_PACKAGE_DIR=${NANO_SRC}/${NANO_TOOLS}/Pkg NANO_DATADIR=${NANO_OBJ}/_.data NANO_DATASIZE=40960 @@ -173,7 +174,7 @@ do_add_pkg () ${NANO_WORLDDIR}/usr/ports/packages mount -t nullfs -o noatime ${NANO_OBJ}/ports/distfiles \ ${NANO_WORLDDIR}/usr/ports/distfiles - CR "cd /usr/ports/packages/All;pkg_add -F $1.tbz" + CR env ASSUME_ALWAYS_YES=YES SIGNATURE_TYPE=none /usr/sbin/pkg add /usr/ports/packages/All/$1.txz umount ${NANO_WORLDDIR}/usr/ports/distfiles umount ${NANO_WORLDDIR}/usr/ports/packages rmdir ${NANO_WORLDDIR}/usr/ports/packages @@ -206,12 +207,16 @@ do_add_port () mount -t devfs devfs ${NANO_WORLDDIR}/dev mkdir -p ${NANO_WORLDDIR}/usr/workdir cp /etc/resolv.conf ${NANO_WORLDDIR}/etc/resolv.conf + # OK, a little inefficient, but likely not enough to worry about. + CR ldconfig /lib /usr/lib /usr/local/lib + CR ldconfig -R + CR ldconfig -r # Improvement: Don't know why package-recursive don't works here CR "env UNAME_p=${NANO_ARCH} TARGET=${NANO_ARCH} \ - TARGET_ARCH=${NANO_ARCH} make \ + TARGET_ARCH=${NANO_ARCH} PORTSDIR=${NANO_PORTS} make \ __MAKE_CONF=${NANO_MAKE_CONF_BUILD} \ WRKDIRPREFIX=/usr/workdir -C /usr/ports/$port_path \ - package BATCH=yes $* clean FORCE_PKG_REGISTER=t" + package-recursive BATCH=yes $* clean FORCE_PKG_REGISTER=t" rm ${NANO_WORLDDIR}/etc/resolv.conf rm -rf ${NANO_WORLDDIR}/usr/obj rm -rf ${NANO_WORLDDIR}/usr/workdir @@ -228,15 +233,14 @@ do_add_port () add_port () { local port_path=$1 local port=`echo $1 | sed -e 's/\//_/'` - export PORTSDIR=${NANO_PORTS} shift # Check if package allready exist # Need to: # 1. check ARCH of this package! # 2. Add a trap cd ${NANO_PORTS}/${port_path} - PKG_NAME=`make ${PKGNAME_HACK} PORTSDIR=${NANO_PORTS} __MAKE_CONF=${NANO_MAKE_CONF_BUILD} package-name` - if [ -f ${NANO_OBJ}/ports/packages/All/${PKG_NAME}.tbz ]; then + PKG_NAME=`env PORTSDIR=${NANO_PORTS} make __MAKE_CONF=${NANO_MAKE_CONF_BUILD} package-name` + if [ -f ${NANO_OBJ}/ports/packages/All/${PKG_NAME}.txz ]; then # Pkg file found: Generate add_pkg_NAME function eval " add_pkg_${port} () { @@ -267,6 +271,10 @@ create_amd64_diskimage() create_i386_diskimage "$*" } +# Automatically include the packaging port here so it is always first so it +# builds the port and adds the package so we can add other packages. +add_port ports-mgmt/pkg + rp=$(realpath ${NANO_OBJ}/) __a=`mount | grep ${rp} | awk '{print length($3), $3;}' | sort -rn | awk '{$1=""; print;}'` if [ -n "$__a" ]; then Modified: head/tools/tools/nanobsd/dhcpd/os-base ============================================================================== --- head/tools/tools/nanobsd/dhcpd/os-base Thu Apr 24 02:02:28 2014 (r264859) +++ head/tools/tools/nanobsd/dhcpd/os-base Thu Apr 24 02:02:37 2014 (r264860) @@ -108,28 +108,6 @@ save_build ( ) } customize_cmd save_build -# Move the $world/data to the /data partion -move_data() -{ - db=${NANO_WORLDDIR}/data - rm -rf ${NANO_DATADIR} - mkdir -p ${NANO_DATADIR} - ( cd ${db} ; find . | cpio -R root:wheel -dumpv ${NANO_DATADIR} ) - rm -rf ${db} -} -customize_cmd move_data - -add_data_to_fstab ( ) -{ - ( - cd ${NANO_WORLDDIR} - echo "/dev/${NANO_DRIVE}s4 /data ufs rw,noatime 2 2" >> etc/fstab - mkdir -p data - ) - -} -customize_cmd add_data_to_fstab - remove_patch_divots ( ) { find ${NANO_WORLDDIR} -name \*.orig -or -name \*.rej -delete @@ -168,7 +146,7 @@ customize_cmd unmute_console_logging fi -freenas_custom() +product_custom() { gzip -v9 ${NANO_WORLDDIR}/boot/kernel/kernel @@ -199,29 +177,10 @@ freenas_custom() # magic.mgc is just a speed optimization. Kill it for 1.7MB rm -f ${NANO_WORLDDIR}/usr/share/misc/magic.mgc - # strip binaries (saves spaces on non-debug images). - if [ "${DEBUG}" != 1 ]; then - pprint 4 "Stripping binaries and libraries" - for dir in $(find ${NANO_WORLDDIR}/usr/local -name '*bin' -or -name 'libexec' -maxdepth 3); do - for f in $(find $dir -type f); do - if ! dontstrip "$f" - then - strip 2>/dev/null $f || : - fi - done - done - # .so's are the only thing that need to be stripped. The rest - # should remain untouched. - for f in $(find ${NANO_WORLDDIR}/usr/local/lib -name '*.so' -or -name '*.so.*' -maxdepth 3); do - strip 2>/dev/null $f || : - done - fi - # Last second tweaks chown -R root:wheel ${NANO_WORLDDIR}/root chmod 0755 ${NANO_WORLDDIR}/root/* chmod 0755 ${NANO_WORLDDIR}/* - chmod 0440 ${NANO_WORLDDIR}/usr/local/etc/sudoers chown -R root:wheel ${NANO_WORLDDIR}/etc chown -R root:wheel ${NANO_WORLDDIR}/boot chown root:wheel ${NANO_WORLDDIR}/ @@ -229,16 +188,7 @@ freenas_custom() find ${NANO_WORLDDIR} -type f -name "*~" -delete find ${NANO_WORLDDIR}/usr/local -type f -name "*.po" -delete find ${NANO_WORLDDIR} -type f -name "*.service" -delete - mkdir ${NANO_WORLDDIR}/data/zfs - ln -s -f /usr/local/bin/bash ${NANO_WORLDDIR}/bin/bash - ln -s -f /data/zfs/zpool.cache ${NANO_WORLDDIR}/boot/zfs/zpool.cache - - # This is wrong. Needs a way to tell kernel how to find the mount utility - # instead. - mv ${NANO_WORLDDIR}/sbin/mount_ntfs ${NANO_WORLDDIR}/sbin/mount_ntfs-kern - ln -s -f /usr/local/bin/ntfs-3g ${NANO_WORLDDIR}/sbin/mount_ntfs - } -late_customize_cmd freenas_custom +late_customize_cmd product_custom fi # [ $PACKAGE_PREP_BUILD = 1 ] From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 02:02:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DCFA77D0; Thu, 24 Apr 2014 02:02:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA3A114AA; Thu, 24 Apr 2014 02:02:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O22k7G064244; Thu, 24 Apr 2014 02:02:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O22knb064242; Thu, 24 Apr 2014 02:02:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404240202.s3O22knb064242@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Apr 2014 02:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264861 - in head/tools/tools/nanobsd: . dhcpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 02:02:47 -0000 Author: imp Date: Thu Apr 24 02:02:46 2014 New Revision: 264861 URL: http://svnweb.freebsd.org/changeset/base/264861 Log: Hoist CR convenience function up from dhcpd config and use appropriately in nanobsd.sh. Also create CR0 for a errors allowed version. Modified: head/tools/tools/nanobsd/dhcpd/common head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/dhcpd/common ============================================================================== --- head/tools/tools/nanobsd/dhcpd/common Thu Apr 24 02:02:37 2014 (r264860) +++ head/tools/tools/nanobsd/dhcpd/common Thu Apr 24 02:02:46 2014 (r264861) @@ -156,11 +156,6 @@ WITHOUT_RCS=true NANO_PACKAGE_ONLY=1 -CR() -{ - chroot ${NANO_WORLDDIR} /bin/sh -exc "$*" -} - # install a package from a pre-built binary do_add_pkg () { Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Thu Apr 24 02:02:37 2014 (r264860) +++ head/tools/tools/nanobsd/nanobsd.sh Thu Apr 24 02:02:46 2014 (r264861) @@ -177,6 +177,18 @@ SRCCONF=${SRCCONF:=/dev/null} # ####################################################################### +# run in the world chroot, errors fatal +CR() +{ + chroot ${NANO_WORLDDIR} /bin/sh -exc "$*" +} + +# run in the world chroot, errors not fatal +CR0() +{ + chroot ${NANO_WORLDDIR} /bin/sh -c "$*" || true +} + nano_cleanup ( ) ( if [ $? -ne 0 ]; then echo "Error encountered. Check for errors in last log file." 1>&2 @@ -748,8 +760,7 @@ cust_pkg () ( # Attempt to install more packages # ...but no more than 200 at a time due to pkg_add's internal # limitations. - chroot ${NANO_WORLDDIR} sh -c \ - 'ls Pkg/*tbz | xargs -n 200 env PKG_DBDIR='${NANO_PKG_META_BASE}'/pkg pkg_add -v -F' || true + CR0 'ls Pkg/*tbz | xargs -n 200 env PKG_DBDIR='${NANO_PKG_META_BASE}'/pkg pkg_add -v -F' # See what that got us now=`ls ${NANO_WORLDDIR}/${NANO_PKG_META_BASE}/pkg | wc -l` @@ -795,9 +806,8 @@ cust_pkgng () ( ) #Bootstrap pkg - chroot ${NANO_WORLDDIR} sh -c \ - "env ASSUME_ALWAYS_YES=YES SIGNATURE_TYPE=none /usr/sbin/pkg add /Pkg/${_NANO_PKG_PACKAGE}" - chroot ${NANO_WORLDDIR} sh -c "pkg -N >/dev/null 2>&1;" + CR env ASSUME_ALWAYS_YES=YES SIGNATURE_TYPE=none /usr/sbin/pkg add /Pkg/${_NANO_PKG_PACKAGE} + CR pkg -N >/dev/null 2>&1 if [ "$?" -ne "0" ]; then echo "FAILED: pkg bootstrapping faied" exit 2 @@ -813,19 +823,15 @@ cust_pkgng () ( while true do # Record how many we have now - have=`chroot ${NANO_WORLDDIR} sh -c \ - 'env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg info | /usr/bin/wc -l'` + have=$(CR env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg info | /usr/bin/wc -l) # Attempt to install more packages - chroot ${NANO_WORLDDIR} sh -c \ - 'ls Pkg/*txz | xargs env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg add ' || true + CR0 'ls 'Pkg/*txz' | xargs env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg add' # See what that got us - now=`chroot ${NANO_WORLDDIR} sh -c \ - 'env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg info | /usr/bin/wc -l'` + now=$(CR env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg info | /usr/bin/wc -l) echo "=== NOW $now" - chroot ${NANO_WORLDDIR} sh -c \ - 'env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg info' + CR env ASSUME_ALWAYS_YES=YES /usr/sbin/pkg info echo "===" if [ $now -eq $todo ] ; then echo "DONE $now packages" From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 02:02:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FD8F901; Thu, 24 Apr 2014 02:02:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB4E314AC; Thu, 24 Apr 2014 02:02:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O22pQZ064299; Thu, 24 Apr 2014 02:02:51 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O22pkw064298; Thu, 24 Apr 2014 02:02:51 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404240202.s3O22pkw064298@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Apr 2014 02:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264862 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 02:02:52 -0000 Author: imp Date: Thu Apr 24 02:02:51 2014 New Revision: 264862 URL: http://svnweb.freebsd.org/changeset/base/264862 Log: Include bsd.opts.mk before Makefile.inc so Makefile.inc can do things based on MK_xxx symbols. Continue to include bsd.own.mk after Makefile.inc to preserve current behavior. Modified: head/share/mk/bsd.init.mk Modified: head/share/mk/bsd.init.mk ============================================================================== --- head/share/mk/bsd.init.mk Thu Apr 24 02:02:46 2014 (r264861) +++ head/share/mk/bsd.init.mk Thu Apr 24 02:02:51 2014 (r264862) @@ -1,11 +1,14 @@ # $FreeBSD$ -# The include file includes ../Makefile.inc and -# ; this is used at the top of all files -# that actually "build something". +# The include file includes , +# ../Makefile.inc and ; this is used at the +# top of all files that actually "build something". +# bsd.opts.mk is included early so Makefile.inc can use the +# MK_FOO variables. .if !target(____) ____: +.include .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" .endif From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 02:16:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50210C54; Thu, 24 Apr 2014 02:16:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2326B15C3; Thu, 24 Apr 2014 02:16:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O2GNlM068789; Thu, 24 Apr 2014 02:16:23 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O2GNec068788; Thu, 24 Apr 2014 02:16:23 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201404240216.s3O2GNec068788@svn.freebsd.org> From: Steven Hartland Date: Thu, 24 Apr 2014 02:16:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264863 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 02:16:24 -0000 Author: smh Date: Thu Apr 24 02:16:23 2014 New Revision: 264863 URL: http://svnweb.freebsd.org/changeset/base/264863 Log: Add information about supported NCQ functionality to camcontrol identify. MFC after: 2 weeks Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu Apr 24 02:02:51 2014 (r264862) +++ head/sbin/camcontrol/camcontrol.c Thu Apr 24 02:16:23 2014 (r264863) @@ -1214,6 +1214,18 @@ atahpa_print(struct ata_params *parm, u_ } } +static int +atasata(struct ata_params *parm) +{ + + + if (parm->satacapabilities != 0xffff && + parm->satacapabilities != 0x0000) + return 1; + + return 0; +} + static void atacapprint(struct ata_params *parm) { @@ -1370,6 +1382,17 @@ atacapprint(struct ata_params *parm) ATA_QUEUE_LEN(parm->queue) + 1); } else printf("no\n"); + + printf("NCQ Queue Management %s\n", atasata(parm) && + parm->satacapabilities2 & ATA_SUPPORT_NCQ_QMANAGEMENT ? + "yes" : "no"); + printf("NCQ Streaming %s\n", atasata(parm) && + parm->satacapabilities2 & ATA_SUPPORT_NCQ_STREAM ? + "yes" : "no"); + printf("Receive & Send FPDMA Queued %s\n", atasata(parm) && + parm->satacapabilities2 & ATA_SUPPORT_RCVSND_FPDMA_QUEUED ? + "yes" : "no"); + printf("SMART %s %s\n", parm->support.command1 & ATA_SUPPORT_SMART ? "yes" : "no", parm->enabled.command1 & ATA_SUPPORT_SMART ? "yes" : "no"); @@ -1418,6 +1441,9 @@ atacapprint(struct ata_params *parm) printf("unload %s %s\n", parm->support.extension & ATA_SUPPORT_UNLOAD ? "yes" : "no", parm->enabled.extension & ATA_SUPPORT_UNLOAD ? "yes" : "no"); + printf("general purpose logging %s %s\n", + parm->support.extension & ATA_SUPPORT_GENLOG ? "yes" : "no", + parm->enabled.extension & ATA_SUPPORT_GENLOG ? "yes" : "no"); printf("free-fall %s %s\n", parm->support2 & ATA_SUPPORT_FREEFALL ? "yes" : "no", parm->enabled2 & ATA_SUPPORT_FREEFALL ? "yes" : "no"); From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 03:16:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 021C73A2; Thu, 24 Apr 2014 03:16:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2BDD1AF9; Thu, 24 Apr 2014 03:16:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O3Gl8e093951; Thu, 24 Apr 2014 03:16:47 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O3GlUl093950; Thu, 24 Apr 2014 03:16:47 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201404240316.s3O3GlUl093950@svn.freebsd.org> From: Kevin Lo Date: Thu, 24 Apr 2014 03:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264864 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 03:16:48 -0000 Author: kevlo Date: Thu Apr 24 03:16:47 2014 New Revision: 264864 URL: http://svnweb.freebsd.org/changeset/base/264864 Log: Fix panic by adding mtx_assert() to urtwn_init_locked() and urtwn_stop_locked(). Tested by: Anthony Jenkins Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Thu Apr 24 02:16:23 2014 (r264863) +++ head/sys/dev/usb/wlan/if_urtwn.c Thu Apr 24 03:16:47 2014 (r264864) @@ -2054,6 +2054,7 @@ urtwn_load_firmware(struct urtwn_softc * uint32_t reg; int mlen, ntries, page, error; + URTWN_UNLOCK(sc); /* Read firmware image from the filesystem. */ if ((sc->chip & (URTWN_CHIP_UMC_A_CUT | URTWN_CHIP_92C)) == URTWN_CHIP_UMC_A_CUT) @@ -2062,6 +2063,7 @@ urtwn_load_firmware(struct urtwn_softc * imagename = "urtwn-rtl8192cfwT"; fw = firmware_get(imagename); + URTWN_LOCK(sc); if (fw == NULL) { device_printf(sc->sc_dev, "failed loadfirmware of file %s\n", imagename); @@ -2816,6 +2818,8 @@ urtwn_init_locked(void *arg) uint32_t reg; int error; + URTWN_ASSERT_LOCKED(sc); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) urtwn_stop_locked(ifp); @@ -2979,6 +2983,8 @@ urtwn_stop_locked(struct ifnet *ifp) { struct urtwn_softc *sc = ifp->if_softc; + URTWN_ASSERT_LOCKED(sc); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); callout_stop(&sc->sc_watchdog_ch); From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 03:31:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45952761; Thu, 24 Apr 2014 03:31:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18CE11CCA; Thu, 24 Apr 2014 03:31:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O3V73c001327; Thu, 24 Apr 2014 03:31:07 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O3V7IY001326; Thu, 24 Apr 2014 03:31:07 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201404240331.s3O3V7IY001326@svn.freebsd.org> From: Bryan Venteicher Date: Thu, 24 Apr 2014 03:31:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264865 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 03:31:08 -0000 Author: bryanv Date: Thu Apr 24 03:31:07 2014 New Revision: 264865 URL: http://svnweb.freebsd.org/changeset/base/264865 Log: Update the date that was missed in r263259 Modified: head/share/man/man4/vmx.4 Modified: head/share/man/man4/vmx.4 ============================================================================== --- head/share/man/man4/vmx.4 Thu Apr 24 03:16:47 2014 (r264864) +++ head/share/man/man4/vmx.4 Thu Apr 24 03:31:07 2014 (r264865) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 4, 2013 +.Dd March 17, 2014 .Dt VMX 4 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 05:04:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DA0A706; Thu, 24 Apr 2014 05:04:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AB4B159C; Thu, 24 Apr 2014 05:04:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O54tC8039094; Thu, 24 Apr 2014 05:04:55 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O54tPT039093; Thu, 24 Apr 2014 05:04:55 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201404240504.s3O54tPT039093@svn.freebsd.org> From: Bryan Venteicher Date: Thu, 24 Apr 2014 05:04:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264867 - head/sys/dev/virtio/random X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 05:04:55 -0000 Author: bryanv Date: Thu Apr 24 05:04:54 2014 New Revision: 264867 URL: http://svnweb.freebsd.org/changeset/base/264867 Log: Wait for the callout to finish before unloading the module MFC after: 3 days Modified: head/sys/dev/virtio/random/virtio_random.c Modified: head/sys/dev/virtio/random/virtio_random.c ============================================================================== --- head/sys/dev/virtio/random/virtio_random.c Thu Apr 24 04:43:50 2014 (r264866) +++ head/sys/dev/virtio/random/virtio_random.c Thu Apr 24 05:04:54 2014 (r264867) @@ -156,7 +156,7 @@ vtrnd_detach(device_t dev) sc = device_get_softc(dev); - callout_stop(&sc->vtrnd_callout); + callout_drain(&sc->vtrnd_callout); return (0); } From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 11:27:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9AFBAC7F; Thu, 24 Apr 2014 11:27:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87D751B7B; Thu, 24 Apr 2014 11:27:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OBR3Qg094178; Thu, 24 Apr 2014 11:27:03 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OBR3A5094177; Thu, 24 Apr 2014 11:27:03 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404241127.s3OBR3A5094177@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 24 Apr 2014 11:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264876 - head/usr.bin/iscsictl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 11:27:03 -0000 Author: trasz Date: Thu Apr 24 11:27:03 2014 New Revision: 264876 URL: http://svnweb.freebsd.org/changeset/base/264876 Log: Grammar fix. Modified: head/usr.bin/iscsictl/iscsictl.8 Modified: head/usr.bin/iscsictl/iscsictl.8 ============================================================================== --- head/usr.bin/iscsictl/iscsictl.8 Thu Apr 24 11:14:17 2014 (r264875) +++ head/usr.bin/iscsictl/iscsictl.8 Thu Apr 24 11:27:03 2014 (r264876) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 20, 2014 +.Dd April 24, 2014 .Dt ISCSICTL 8 .Os .Sh NAME @@ -119,7 +119,7 @@ Use .Nm Fl L to check the connection status. .Pp -Note that in order to the iSCSI initiator to be able to connect to a target, +Note that in order for the iSCSI initiator to be able to connect to a target, the .Xr iscsid 8 daemon must be running. From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 11:28:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38D71EB2; Thu, 24 Apr 2014 11:28:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AE341B93; Thu, 24 Apr 2014 11:28:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OBSN1c094445; Thu, 24 Apr 2014 11:28:23 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OBSNpH094444; Thu, 24 Apr 2014 11:28:23 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404241128.s3OBSNpH094444@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 24 Apr 2014 11:28:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264877 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 11:28:24 -0000 Author: trasz Date: Thu Apr 24 11:28:23 2014 New Revision: 264877 URL: http://svnweb.freebsd.org/changeset/base/264877 Log: Style fixes. Modified: head/usr.sbin/ctld/ctl.conf.5 Modified: head/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- head/usr.sbin/ctld/ctl.conf.5 Thu Apr 24 11:27:03 2014 (r264876) +++ head/usr.sbin/ctld/ctl.conf.5 Thu Apr 24 11:28:23 2014 (r264877) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 11, 2014 +.Dd April 24, 2014 .Dt CTL.CONF 5 .Os .Sh NAME @@ -41,7 +41,7 @@ configuration file is used by the daemon. Lines starting with .Ql # -and empty lines are interpreted as comments. +are interpreted as comments. The general syntax of the .Nm file is: @@ -129,7 +129,7 @@ ones will be allowed to connect. The following statements are available at the portal-group level: .Bl -tag -width indent .It Ic discovery-auth-group Aq Ar name -Assigns previously defined authentication group to that portal group, +Assigns previously defined authentication group to the portal group, to be used for target discovery. By default, portal groups that do not specify their own auth settings, using clauses such as "chap" or "initiator-name", are assigned @@ -146,10 +146,10 @@ using iSER (iSCSI over RDMA) protocol. The following statements are available at the target level: .Bl -tag -width indent .It Ic alias Aq Ar text -Assigns human-readable description to that target. +Assigns human-readable description to the target. There is no default. .It Ic auth-group Aq Ar name -Assigns previously defined authentication group to that target. +Assigns previously defined authentication group to the target. By default, targets that do not specify their own auth settings, using clauses such as "chap" or "initiator-name", are assigned predefined auth-group "default", which denies all access. @@ -187,7 +187,7 @@ ones will be allowed to connect. This clause is mutually exclusive with auth-group; one cannot use both in a single target. .It Ic portal-group Aq Ar name -Assigns previously defined portal group to that target. +Assigns previously defined portal group to the target. Default portal group is "default", which makes the target available on TCP port 3260 on all configured IPv4 and IPv6 addresses. .It Ic lun Aq Ar number @@ -203,7 +203,7 @@ Valid choices are and .Dq ramdisk ; block is used for LUNs backed -by files in the filesystem; ramdisk is a bitsink device, used mostly for +by files or disk device nodes; ramdisk is a bitsink device, used mostly for testing. The default backend is block. .It Ic blocksize Aq Ar size @@ -214,7 +214,7 @@ Specifies SCSI Device Identification str .It Ic option Ao Ar name Ac Aq Ar value Specifies CTL-specific options passed to the kernel. .It Ic path Aq Ar path -Specifies path to file used to back the LUN. +Specifies path to file or device node used to back the LUN. .It Ic serial Aq Ar string Specifies SCSI serial number presented to the initiator. .It Ic size Aq Ar size @@ -245,7 +245,7 @@ portal-group example2 { } target iqn.2012-06.com.example:target0 { - alias "Testing target" + alias "Example target" auth-group no-authentication lun 0 { path /dev/zvol/example_0 From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 12:38:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E10B1C9; Thu, 24 Apr 2014 12:38:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AB5A1356; Thu, 24 Apr 2014 12:38:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OCc8WP023436; Thu, 24 Apr 2014 12:38:08 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OCc81u023435; Thu, 24 Apr 2014 12:38:08 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201404241238.s3OCc81u023435@svn.freebsd.org> From: Steven Hartland Date: Thu, 24 Apr 2014 12:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264878 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 12:38:08 -0000 Author: smh Date: Thu Apr 24 12:38:07 2014 New Revision: 264878 URL: http://svnweb.freebsd.org/changeset/base/264878 Log: Increase ACPI_MAX_TASKS to be 4 x the number of CPU's as 2 x was still insufficient on some machines MFC after: 2 weeks Modified: head/sys/dev/acpica/acpivar.h Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Thu Apr 24 11:28:23 2014 (r264877) +++ head/sys/dev/acpica/acpivar.h Thu Apr 24 12:38:07 2014 (r264878) @@ -476,7 +476,7 @@ ACPI_HANDLE acpi_GetReference(ACPI_HANDL /* Default maximum number of tasks to enqueue. */ #ifndef ACPI_MAX_TASKS -#define ACPI_MAX_TASKS MAX(32, MAXCPU * 2) +#define ACPI_MAX_TASKS MAX(32, MAXCPU * 4) #endif /* Default number of task queue threads to start. */ From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 12:52:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98428756; Thu, 24 Apr 2014 12:52:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B1A4155F; Thu, 24 Apr 2014 12:52:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OCqW4w031331; Thu, 24 Apr 2014 12:52:32 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OCqVjj031328; Thu, 24 Apr 2014 12:52:31 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201404241252.s3OCqVjj031328@svn.freebsd.org> From: Steven Hartland Date: Thu, 24 Apr 2014 12:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264879 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 12:52:32 -0000 Author: smh Date: Thu Apr 24 12:52:31 2014 New Revision: 264879 URL: http://svnweb.freebsd.org/changeset/base/264879 Log: Fix jailed raw sockets not setting the correct source address by calling in_pcbladdr instead of prison_get_ip4 MFC after: 1 month Modified: head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/raw_ip.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu Apr 24 12:38:07 2014 (r264878) +++ head/sys/netinet/in_pcb.c Thu Apr 24 12:52:31 2014 (r264879) @@ -697,7 +697,7 @@ in_pcbconnect(struct inpcb *inp, struct * Do proper source address selection on an unbound socket in case * of connect. Take jails into account as well. */ -static int +int in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, struct in_addr *laddr, struct ucred *cred) { Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Thu Apr 24 12:38:07 2014 (r264878) +++ head/sys/netinet/in_pcb.h Thu Apr 24 12:52:31 2014 (r264879) @@ -636,6 +636,8 @@ void in_pcbdrop(struct inpcb *); void in_pcbfree(struct inpcb *); int in_pcbinshash(struct inpcb *); int in_pcbinshash_nopcbgroup(struct inpcb *); +int in_pcbladdr(struct inpcb *, struct in_addr *, struct in_addr *, + struct ucred *); struct inpcb * in_pcblookup_local(struct inpcbinfo *, struct in_addr, u_short, int, struct ucred *); Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Thu Apr 24 12:38:07 2014 (r264878) +++ head/sys/netinet/raw_ip.c Thu Apr 24 12:52:31 2014 (r264879) @@ -454,26 +454,26 @@ rip_output(struct mbuf *m, struct socket ip->ip_p = inp->inp_ip_p; ip->ip_len = htons(m->m_pkthdr.len); ip->ip_src = inp->inp_laddr; + ip->ip_dst.s_addr = dst; if (jailed(inp->inp_cred)) { /* * prison_local_ip4() would be good enough but would * let a source of INADDR_ANY pass, which we do not - * want to see from jails. We do not go through the - * pain of in_pcbladdr() for raw sockets. + * want to see from jails. */ - if (ip->ip_src.s_addr == INADDR_ANY) - error = prison_get_ip4(inp->inp_cred, - &ip->ip_src); - else + if (ip->ip_src.s_addr == INADDR_ANY) { + error = in_pcbladdr(inp, &ip->ip_dst, &ip->ip_src, + inp->inp_cred); + } else { error = prison_local_ip4(inp->inp_cred, &ip->ip_src); + } if (error != 0) { INP_RUNLOCK(inp); m_freem(m); return (error); } } - ip->ip_dst.s_addr = dst; ip->ip_ttl = inp->inp_ip_ttl; } else { if (m->m_pkthdr.len > IP_MAXPACKET) { From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 12:54:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E35418AE; Thu, 24 Apr 2014 12:54:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE8D81574; Thu, 24 Apr 2014 12:54:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OCsZU4031622; Thu, 24 Apr 2014 12:54:35 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OCsZAn031621; Thu, 24 Apr 2014 12:54:35 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201404241254.s3OCsZAn031621@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 24 Apr 2014 12:54:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264880 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 12:54:36 -0000 Author: trasz Date: Thu Apr 24 12:54:35 2014 New Revision: 264880 URL: http://svnweb.freebsd.org/changeset/base/264880 Log: Modify CTL iSCSI frontend to properly handle situations where datamove routine is called multiple times per SCSI task. Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Thu Apr 24 12:52:31 2014 (r264879) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Thu Apr 24 12:54:35 2014 (r264880) @@ -709,7 +709,7 @@ cfiscsi_handle_data_segment(struct icl_p ("bad opcode 0x%x", request->ip_bhs->bhs_opcode)); /* - * We're only using fields common for Data Out and SCSI Command PDUs. + * We're only using fields common for Data-Out and SCSI Command PDUs. */ bhsdo = (struct iscsi_bhs_data_out *)request->ip_bhs; @@ -742,10 +742,13 @@ cfiscsi_handle_data_segment(struct icl_p * Make sure the offset, as sent by the initiator, matches the offset * we're supposed to be at in the scatter-gather list. */ - if (buffer_offset != io->scsiio.ext_data_filled) { + if (buffer_offset != + io->scsiio.kern_rel_offset + io->scsiio.ext_data_filled) { CFISCSI_SESSION_WARN(cs, "received bad buffer offset %zd, " - "expected %zd", buffer_offset, + "expected %zd; dropping connection", buffer_offset, + (size_t)io->scsiio.kern_rel_offset + (size_t)io->scsiio.ext_data_filled); + ctl_set_data_phase_error(&io->scsiio); cfiscsi_session_terminate(cs); return (true); } @@ -804,40 +807,62 @@ cfiscsi_handle_data_segment(struct icl_p } if (len > off) { + /* + * In case of unsolicited data, it's possible that the buffer + * provided by CTL is smaller than negotiated FirstBurstLength. + * Just ignore the superfluous data; will ask for them with R2T + * on next call to cfiscsi_datamove(). + * + * This obviously can only happen with SCSI Command PDU. + */ + if ((request->ip_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) == + ISCSI_BHS_OPCODE_SCSI_COMMAND) { + CFISCSI_SESSION_DEBUG(cs, "received too much immediate " + "data: got %zd bytes, expected %zd", + icl_pdu_data_segment_length(request), off); + return (true); + } + CFISCSI_SESSION_WARN(cs, "received too much data: got %zd bytes, " - "expected %zd", icl_pdu_data_segment_length(request), off); + "expected %zd; dropping connection", + icl_pdu_data_segment_length(request), off); + ctl_set_data_phase_error(&io->scsiio); cfiscsi_session_terminate(cs); return (true); } - if (bhsdo->bhsdo_flags & BHSDO_FLAGS_F || - io->scsiio.ext_data_filled == io->scsiio.kern_total_len) { - if ((bhsdo->bhsdo_flags & BHSDO_FLAGS_F) == 0) { - CFISCSI_SESSION_WARN(cs, "got the final packet without " - "the F flag; flags = 0x%x; dropping connection", - bhsdo->bhsdo_flags); + if (io->scsiio.ext_data_filled == io->scsiio.kern_data_len && + (bhsdo->bhsdo_flags & BHSDO_FLAGS_F) == 0) { + CFISCSI_SESSION_WARN(cs, "got the final packet without " + "the F flag; flags = 0x%x; dropping connection", + bhsdo->bhsdo_flags); + ctl_set_data_phase_error(&io->scsiio); + cfiscsi_session_terminate(cs); + return (true); + } + + if (io->scsiio.ext_data_filled != io->scsiio.kern_data_len && + (bhsdo->bhsdo_flags & BHSDO_FLAGS_F) != 0) { + if ((request->ip_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) == + ISCSI_BHS_OPCODE_SCSI_DATA_OUT) { + CFISCSI_SESSION_WARN(cs, "got the final packet, but the " + "transmitted size was %zd bytes instead of %d; " + "dropping connection", + (size_t)io->scsiio.ext_data_filled, + io->scsiio.kern_data_len); + ctl_set_data_phase_error(&io->scsiio); cfiscsi_session_terminate(cs); return (true); + } else { + /* + * For SCSI Command PDU, this just means we need to + * solicit more data by sending R2T. + */ + return (false); } + } - if (io->scsiio.ext_data_filled != io->scsiio.kern_total_len) { - if ((request->ip_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) == - ISCSI_BHS_OPCODE_SCSI_DATA_OUT) { - CFISCSI_SESSION_WARN(cs, "got the final packet, but the " - "transmitted size was %zd bytes instead of %d; " - "dropping connection", - (size_t)io->scsiio.ext_data_filled, - io->scsiio.kern_total_len); - cfiscsi_session_terminate(cs); - return (true); - } else { - /* - * For SCSI Command PDU, this just means we need to - * solicit more data by sending R2T. - */ - return (false); - } - } + if (io->scsiio.ext_data_filled == io->scsiio.kern_data_len) { #if 0 CFISCSI_SESSION_DEBUG(cs, "no longer expecting Data-Out with target " "transfer tag 0x%x", cdw->cdw_target_transfer_tag); @@ -2390,8 +2415,7 @@ cfiscsi_datamove_in(union ctl_io *io) /* * This is the offset within the current SCSI command; for the first * call to cfiscsi_datamove() it will be 0, and for subsequent ones - * it will be the sum of lengths of previous ones. It's being - * incremented as we append data to the data segment. + * it will be the sum of lengths of previous ones. */ buffer_offset = io->scsiio.kern_rel_offset; @@ -2402,10 +2426,11 @@ cfiscsi_datamove_in(union ctl_io *io) */ expected_len = ntohl(bhssc->bhssc_expected_data_transfer_length); #if 0 - if (expected_len != io->scsiio.kern_total_len) - CFISCSI_SESSION_DEBUG(cs, "expected transfer length = %zd, " - "actual length = %zd", expected_len, - io->scsiio.kern_total_len); + if (expected_len != io->scsiio.kern_total_len) { + CFISCSI_SESSION_DEBUG(cs, "expected transfer length %zd, " + "actual length %zd", expected_len, + (size_t)io->scsiio.kern_total_len); + } #endif if (buffer_offset >= expected_len) { @@ -2413,7 +2438,6 @@ cfiscsi_datamove_in(union ctl_io *io) CFISCSI_SESSION_DEBUG(cs, "buffer_offset = %zd, " "already sent the expected len", buffer_offset); #endif - io->scsiio.ext_data_filled = io->scsiio.kern_total_len; io->scsiio.be_move_done(io); return; } @@ -2456,26 +2480,31 @@ cfiscsi_datamove_in(union ctl_io *io) * Truncate to maximum data segment length. */ KASSERT(response->ip_data_len < cs->cs_max_data_segment_length, - ("max_data_segment_length %zd >= ip_data_len %zd", + ("ip_data_len %zd >= max_data_segment_length %zd", response->ip_data_len, cs->cs_max_data_segment_length)); if (response->ip_data_len + len > - cs->cs_max_data_segment_length) + cs->cs_max_data_segment_length) { len = cs->cs_max_data_segment_length - response->ip_data_len; + KASSERT(len <= sg_len, ("len %zd > sg_len %zd", + len, sg_len)); + } /* * Truncate to expected data transfer length. */ KASSERT(buffer_offset + response->ip_data_len < expected_len, - ("%zd >= %zd", buffer_offset + response->ip_data_len, expected_len)); + ("buffer_offset %zd + ip_data_len %zd >= expected_len %zd", + buffer_offset, response->ip_data_len, expected_len)); if (buffer_offset + response->ip_data_len + len > expected_len) { CFISCSI_SESSION_DEBUG(cs, "truncating from %zd " "to expected data transfer length %zd", buffer_offset + response->ip_data_len + len, expected_len); len = expected_len - (buffer_offset + response->ip_data_len); + KASSERT(len <= sg_len, ("len %zd > sg_len %zd", + len, sg_len)); } - KASSERT(len <= sg_len, ("len > sg_len")); error = icl_pdu_append_data(response, sg_addr, len, M_NOWAIT); if (error != 0) { CFISCSI_SESSION_WARN(cs, "failed to " @@ -2488,10 +2517,11 @@ cfiscsi_datamove_in(union ctl_io *io) } sg_addr += len; sg_len -= len; - buffer_offset += len; - io->scsiio.ext_data_filled += len; - if (buffer_offset == expected_len) { + KASSERT(buffer_offset + request->ip_data_len <= expected_len, + ("buffer_offset %zd + ip_data_len %zd > expected_len %zd", + buffer_offset, request->ip_data_len, expected_len)); + if (buffer_offset + request->ip_data_len == expected_len) { /* * Already have the amount of data the initiator wanted. */ @@ -2521,6 +2551,7 @@ cfiscsi_datamove_in(union ctl_io *io) * call to cfiscsi_datamove(), and we want * to set the F flag only on the last of them. */ + buffer_offset += response->ip_data_len; if (buffer_offset == io->scsiio.kern_total_len || buffer_offset == expected_len) bhsdi->bhsdi_flags |= BHSDI_FLAGS_F; @@ -2530,6 +2561,7 @@ cfiscsi_datamove_in(union ctl_io *io) } } if (response != NULL) { + buffer_offset += response->ip_data_len; if (buffer_offset == io->scsiio.kern_total_len || buffer_offset == expected_len) bhsdi->bhsdi_flags |= BHSDI_FLAGS_F; @@ -2565,6 +2597,11 @@ cfiscsi_datamove_out(union ctl_io *io) */ PDU_TOTAL_TRANSFER_LEN(request) = io->scsiio.kern_total_len; + /* + * We hadn't received anything during this datamove yet. + */ + io->scsiio.ext_data_filled = 0; + target_transfer_tag = atomic_fetchadd_32(&cs->cs_target_transfer_tag, 1); @@ -2586,19 +2623,14 @@ cfiscsi_datamove_out(union ctl_io *io) cdw->cdw_target_transfer_tag = target_transfer_tag; cdw->cdw_initiator_task_tag = bhssc->bhssc_initiator_task_tag; - if (cs->cs_immediate_data && icl_pdu_data_segment_length(request) > 0) { + if (cs->cs_immediate_data && io->scsiio.kern_rel_offset == 0 && + icl_pdu_data_segment_length(request) > 0) { done = cfiscsi_handle_data_segment(request, cdw); if (done) { uma_zfree(cfiscsi_data_wait_zone, cdw); io->scsiio.be_move_done(io); return; } - -#if 0 - if (io->scsiio.ext_data_filled != 0) - CFISCSI_SESSION_DEBUG(cs, "got %zd bytes of immediate data, need %zd", - io->scsiio.ext_data_filled, io->scsiio.kern_data_len); -#endif } CFISCSI_SESSION_LOCK(cs); From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 14:12:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA4068C7; Thu, 24 Apr 2014 14:12:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B626C1D2B; Thu, 24 Apr 2014 14:12:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OECZ7H064851; Thu, 24 Apr 2014 14:12:35 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OECZSX064849; Thu, 24 Apr 2014 14:12:35 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201404241412.s3OECZSX064849@svn.freebsd.org> From: Steven Hartland Date: Thu, 24 Apr 2014 14:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264881 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 14:12:36 -0000 Author: smh Date: Thu Apr 24 14:12:35 2014 New Revision: 264881 URL: http://svnweb.freebsd.org/changeset/base/264881 Log: Add Linux socket call decoding to truss MFC after: 1 month Modified: head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c Modified: head/usr.bin/truss/syscall.h ============================================================================== --- head/usr.bin/truss/syscall.h Thu Apr 24 12:54:35 2014 (r264880) +++ head/usr.bin/truss/syscall.h Thu Apr 24 14:12:35 2014 (r264881) @@ -39,7 +39,8 @@ enum Argtype { None = 1, Hex, Octal, Int Fd_set, Sigaction, Fcntl, Mprot, Mmapflags, Whence, Readlinkres, Sigset, Sigprocmask, Kevent, Sockdomain, Socktype, Open, Fcntlflag, Rusage, BinString, Shutdown, Resource, Rlimit, Timeval2, - Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl }; + Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl, + LinuxSockArgs }; #define ARG_MASK 0xff #define OUT 0x100 @@ -63,6 +64,47 @@ struct syscall { struct syscall *get_syscall(const char*); char *print_arg(struct syscall_args *, unsigned long*, long, struct trussinfo *); + +/* + * Linux Socket defines + */ +#define LINUX_SOCKET 1 +#define LINUX_BIND 2 +#define LINUX_CONNECT 3 +#define LINUX_LISTEN 4 +#define LINUX_ACCEPT 5 +#define LINUX_GETSOCKNAME 6 +#define LINUX_GETPEERNAME 7 +#define LINUX_SOCKETPAIR 8 +#define LINUX_SEND 9 +#define LINUX_RECV 10 +#define LINUX_SENDTO 11 +#define LINUX_RECVFROM 12 +#define LINUX_SHUTDOWN 13 +#define LINUX_SETSOCKOPT 14 +#define LINUX_GETSOCKOPT 15 +#define LINUX_SENDMSG 16 +#define LINUX_RECVMSG 17 + +#define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \ + 0 : sizeof(register_t) - sizeof(t)) + +#if BYTE_ORDER == LITTLE_ENDIAN +#define PADL_(t) 0 +#define PADR_(t) PAD_(t) +#else +#define PADL_(t) PAD_(t) +#define PADR_(t) 0 +#endif + +typedef int l_int; +typedef uint32_t l_ulong; + +struct linux_socketcall_args { + char what_l_[PADL_(l_int)]; l_int what; char what_r_[PADR_(l_int)]; + char args_l_[PADL_(l_ulong)]; l_ulong args; char args_r_[PADR_(l_ulong)]; +}; + void print_syscall(struct trussinfo *, const char *, int, char **); void print_syscall_ret(struct trussinfo *, const char *, int, char **, int, long, struct syscall *); Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Thu Apr 24 12:54:35 2014 (r264880) +++ head/usr.bin/truss/syscalls.c Thu Apr 24 14:12:35 2014 (r264881) @@ -100,6 +100,10 @@ static struct syscall syscalls[] = { .args = { { Rforkflags, 0 } } }, { .name = "getegid", .ret_type = 1, .nargs = 0 }, { .name = "geteuid", .ret_type = 1, .nargs = 0 }, + { .name = "linux_readlink", .ret_type = 1, .nargs = 3, + .args = { { Name, 0 } , { Name | OUT, 1 }, { Int, 2 }}}, + { .name = "linux_socketcall", .ret_type = 1, .nargs = 2, + .args = { { Int, 0 } , { LinuxSockArgs, 1 }}}, { .name = "getgid", .ret_type = 1, .nargs = 0 }, { .name = "getpid", .ret_type = 1, .nargs = 0 }, { .name = "getpgid", .ret_type = 1, .nargs = 1, @@ -117,6 +121,8 @@ static struct syscall syscalls[] = { .args = { { Int, 0 }, { Int, 1 }, { Whence, 2 } } }, { .name = "mmap", .ret_type = 2, .nargs = 6, .args = { { Ptr, 0 }, { Int, 1 }, { Mprot, 2 }, { Mmapflags, 3 }, { Int, 4 }, { Quad, 5 + QUAD_ALIGN } } }, + { .name = "linux_mkdir", .ret_type = 1, .nargs = 2, + .args = { { Name | IN, 0} , {Int, 1}}}, { .name = "mprotect", .ret_type = 1, .nargs = 3, .args = { { Ptr, 0 }, { Int, 1 }, { Mprot, 2 } } }, { .name = "open", .ret_type = 1, .nargs = 3, @@ -141,6 +147,8 @@ static struct syscall syscalls[] = { .args = { { Name, 0 }, { Octal, 1 } } }, { .name = "chown", .ret_type = 0, .nargs = 3, .args = { { Name, 0 }, { Int, 1 }, { Int, 2 } } }, + { .name = "linux_stat64", .ret_type = 1, .nargs = 3, + .args = { { Name | IN, 0 }, { Ptr | OUT, 1 }, { Ptr | IN, 1 }}}, { .name = "mount", .ret_type = 0, .nargs = 4, .args = { { Name, 0 }, { Name, 1 }, { Int, 2 }, { Ptr, 3 } } }, { .name = "umount", .ret_type = 0, .nargs = 2, @@ -153,6 +161,8 @@ static struct syscall syscalls[] = { .args = { { Name | IN, 0 }, { Stat | OUT, 1 } } }, { .name = "linux_newstat", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Ptr | OUT, 1 } } }, + { .name = "linux_access", .ret_type = 1, .nargs = 2, + .args = { { Name, 0 }, { Int, 1 }}}, { .name = "linux_newfstat", .ret_type = 1, .nargs = 2, .args = { { Int, 0 }, { Ptr | OUT, 1 } } }, { .name = "write", .ret_type = 1, .nargs = 3, @@ -763,6 +773,76 @@ print_arg(struct syscall_args *sc, unsig asprintf(&tmp, "0x%lx", args[sc->offset]); break; } + case LinuxSockArgs: + { + struct linux_socketcall_args largs; + if (get_struct(pid, (void *)args[sc->offset], (void *)&largs, + sizeof(largs)) == -1) { + err(1, "get_struct %p", (void *)args[sc->offset]); + } + const char *what; + char buf[30]; + + switch (largs.what) { + case LINUX_SOCKET: + what = "LINUX_SOCKET"; + break; + case LINUX_BIND: + what = "LINUX_BIND"; + break; + case LINUX_CONNECT: + what = "LINUX_CONNECT"; + break; + case LINUX_LISTEN: + what = "LINUX_LISTEN"; + break; + case LINUX_ACCEPT: + what = "LINUX_ACCEPT"; + break; + case LINUX_GETSOCKNAME: + what = "LINUX_GETSOCKNAME"; + break; + case LINUX_GETPEERNAME: + what = "LINUX_GETPEERNAME"; + break; + case LINUX_SOCKETPAIR: + what = "LINUX_SOCKETPAIR"; + break; + case LINUX_SEND: + what = "LINUX_SEND"; + break; + case LINUX_RECV: + what = "LINUX_RECV"; + break; + case LINUX_SENDTO: + what = "LINUX_SENDTO"; + break; + case LINUX_RECVFROM: + what = "LINUX_RECVFROM"; + break; + case LINUX_SHUTDOWN: + what = "LINUX_SHUTDOWN"; + break; + case LINUX_SETSOCKOPT: + what = "LINUX_SETSOCKOPT"; + break; + case LINUX_GETSOCKOPT: + what = "LINUX_GETSOCKOPT"; + break; + case LINUX_SENDMSG: + what = "LINUX_SENDMSG"; + break; + case LINUX_RECVMSG: + what = "LINUX_RECVMSG"; + break; + default: + sprintf(buf, "%d", largs.what); + what = buf; + break; + } + asprintf(&tmp, "(0x%lx)%s, 0x%lx", args[sc->offset], what, (long unsigned int)largs.args); + break; + } case Pollfd: { /* * XXX: A Pollfd argument expects the /next/ syscall argument From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 14:44:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A840641; Thu, 24 Apr 2014 14:44:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 877141263; Thu, 24 Apr 2014 14:44:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OEighY077613; Thu, 24 Apr 2014 14:44:42 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OEigni077612; Thu, 24 Apr 2014 14:44:42 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201404241444.s3OEigni077612@svn.freebsd.org> From: Roger Pau Monné Date: Thu, 24 Apr 2014 14:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264882 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 14:44:42 -0000 Author: royger Date: Thu Apr 24 14:44:42 2014 New Revision: 264882 URL: http://svnweb.freebsd.org/changeset/base/264882 Log: xen: fix copyright header Some of the code in xen-locore.S was picked from Cherry G. Mathew amd64 Xen PV branch, but I've failed to set the proper copyright, so do it now. Approved by: gibbs Modified: head/sys/amd64/amd64/xen-locore.S Modified: head/sys/amd64/amd64/xen-locore.S ============================================================================== --- head/sys/amd64/amd64/xen-locore.S Thu Apr 24 14:12:35 2014 (r264881) +++ head/sys/amd64/amd64/xen-locore.S Thu Apr 24 14:44:42 2014 (r264882) @@ -1,8 +1,12 @@ /*- * Copyright (c) 2003 Peter Wemm + * Copyright (c) 2011-2012 Spectra Logic Corporation * Copyright (c) 2013 Roger Pau Monne * All rights reserved. * + * This software was developed by Cherry G. Mathew + * under sponsorship from Spectra Logic Corporation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 14:58:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B256C53; Thu, 24 Apr 2014 14:58:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27451149F; Thu, 24 Apr 2014 14:58:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OEwCkh082058; Thu, 24 Apr 2014 14:58:13 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OEwCal082057; Thu, 24 Apr 2014 14:58:12 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201404241458.s3OEwCal082057@svn.freebsd.org> From: Steven Hartland Date: Thu, 24 Apr 2014 14:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264883 - head/sys/dev/acpica/Osd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 14:58:13 -0000 Author: smh Date: Thu Apr 24 14:58:12 2014 New Revision: 264883 URL: http://svnweb.freebsd.org/changeset/base/264883 Log: Remove duplicate SYSCTL_DECL(_debug_acpi) which was breaking tinderbox MFC after: 2 weeks X-MFC-With: r264849 Modified: head/sys/dev/acpica/Osd/OsdSchedule.c Modified: head/sys/dev/acpica/Osd/OsdSchedule.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSchedule.c Thu Apr 24 14:44:42 2014 (r264882) +++ head/sys/dev/acpica/Osd/OsdSchedule.c Thu Apr 24 14:58:12 2014 (r264883) @@ -52,8 +52,6 @@ __FBSDID("$FreeBSD$"); #define _COMPONENT ACPI_OS_SERVICES ACPI_MODULE_NAME("SCHEDULE") -SYSCTL_DECL(_debug_acpi); - /* * Allow the user to tune the maximum number of tasks we may enqueue. */ From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 15:16:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B5364AB; Thu, 24 Apr 2014 15:16:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B761170D; Thu, 24 Apr 2014 15:16:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OFGRbi090170; Thu, 24 Apr 2014 15:16:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OFGR0o090169; Thu, 24 Apr 2014 15:16:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404241516.s3OFGR0o090169@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 Apr 2014 15:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264884 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 15:16:27 -0000 Author: mav Date: Thu Apr 24 15:16:26 2014 New Revision: 264884 URL: http://svnweb.freebsd.org/changeset/base/264884 Log: Make CAM target CTL frontend respect SIM I/O size limitations. If datamove size is bigger then SIM can handle, or it has more segments then this code can handle -- split it into several CTIO requests. Modified: head/sys/cam/ctl/scsi_ctl.c Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Thu Apr 24 14:58:12 2014 (r264883) +++ head/sys/cam/ctl/scsi_ctl.c Thu Apr 24 15:16:26 2014 (r264884) @@ -79,6 +79,7 @@ typedef enum { struct ctlfe_softc { struct ctl_frontend fe; path_id_t path_id; + u_int maxio; struct cam_sim *sim; char port_name[DEV_IDLEN]; struct mtx lun_softc_mtx; @@ -129,13 +130,15 @@ typedef enum { */ struct ctlfe_lun_cmd_info { int cur_transfer_index; + size_t cur_transfer_off; ctlfe_cmd_flags flags; /* * XXX KDM struct bus_dma_segment is 8 bytes on i386, and 16 * bytes on amd64. So with 32 elements, this is 256 bytes on * i386 and 512 bytes on amd64. */ - bus_dma_segment_t cam_sglist[32]; +#define CTLFE_MAX_SEGS 32 + bus_dma_segment_t cam_sglist[CTLFE_MAX_SEGS]; }; /* @@ -375,6 +378,10 @@ ctlfeasync(void *callback_arg, uint32_t bus_softc->path_id = cpi->ccb_h.path_id; bus_softc->sim = xpt_path_sim(path); + if (cpi->maxio != 0) + bus_softc->maxio = cpi->maxio; + else + bus_softc->maxio = DFLTPHYS; mtx_init(&bus_softc->lun_softc_mtx, "LUN softc mtx", NULL, MTX_DEF); STAILQ_INIT(&bus_softc->lun_softc_list); @@ -693,6 +700,90 @@ ctlfecleanup(struct cam_periph *periph) } static void +ctlfedata(struct ctlfe_lun_softc *softc, union ctl_io *io, + ccb_flags *flags, uint8_t **data_ptr, uint32_t *dxfer_len, + u_int16_t *sglist_cnt) +{ + struct ctlfe_softc *bus_softc; + struct ctlfe_lun_cmd_info *cmd_info; + struct ctl_sg_entry *ctl_sglist; + bus_dma_segment_t *cam_sglist; + size_t off; + int i, idx; + + cmd_info = (struct ctlfe_lun_cmd_info *)io->io_hdr.port_priv; + bus_softc = softc->parent_softc; + + /* + * Set the direction, relative to the initiator. + */ + *flags &= ~CAM_DIR_MASK; + if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN) + *flags |= CAM_DIR_IN; + else + *flags |= CAM_DIR_OUT; + + *flags &= ~CAM_DATA_MASK; + idx = cmd_info->cur_transfer_index; + off = cmd_info->cur_transfer_off; + cmd_info->flags &= ~CTLFE_CMD_PIECEWISE; + if (io->scsiio.kern_sg_entries == 0) { + /* No S/G list. */ + *data_ptr = io->scsiio.kern_data_ptr + off; + if (io->scsiio.kern_data_len - off <= bus_softc->maxio) { + *dxfer_len = io->scsiio.kern_data_len - off; + } else { + *dxfer_len = bus_softc->maxio; + cmd_info->cur_transfer_index = -1; + cmd_info->cur_transfer_off = bus_softc->maxio; + cmd_info->flags |= CTLFE_CMD_PIECEWISE; + } + *sglist_cnt = 0; + + if (io->io_hdr.flags & CTL_FLAG_BUS_ADDR) + *flags |= CAM_DATA_PADDR; + else + *flags |= CAM_DATA_VADDR; + } else { + /* S/G list with physical or virtual pointers. */ + ctl_sglist = (struct ctl_sg_entry *)io->scsiio.kern_data_ptr; + cam_sglist = cmd_info->cam_sglist; + *dxfer_len = 0; + for (i = 0; i < io->scsiio.kern_sg_entries - idx; i++) { + cam_sglist[i].ds_addr = (bus_addr_t)ctl_sglist[i + idx].addr + off; + if (ctl_sglist[i + idx].len - off <= bus_softc->maxio - *dxfer_len) { + cam_sglist[i].ds_len = ctl_sglist[idx + i].len - off; + *dxfer_len += cam_sglist[i].ds_len; + } else { + cam_sglist[i].ds_len = bus_softc->maxio - *dxfer_len; + cmd_info->cur_transfer_index = idx + i; + cmd_info->cur_transfer_off = cam_sglist[i].ds_len + off; + cmd_info->flags |= CTLFE_CMD_PIECEWISE; + *dxfer_len += cam_sglist[i].ds_len; + if (ctl_sglist[i].len != 0) + i++; + break; + } + if (i == (CTLFE_MAX_SEGS - 1) && + idx + i < (io->scsiio.kern_sg_entries - 1)) { + cmd_info->cur_transfer_index = idx + i + 1; + cmd_info->cur_transfer_off = 0; + cmd_info->flags |= CTLFE_CMD_PIECEWISE; + i++; + break; + } + off = 0; + } + *sglist_cnt = i; + if (io->io_hdr.flags & CTL_FLAG_BUS_ADDR) + *flags |= CAM_DATA_SG_PADDR; + else + *flags |= CAM_DATA_SG; + *data_ptr = (uint8_t *)cam_sglist; + } +} + +static void ctlfestart(struct cam_periph *periph, union ccb *start_ccb) { struct ctlfe_lun_softc *softc; @@ -854,84 +945,10 @@ ctlfestart(struct cam_periph *periph, un bzero(cmd_info, sizeof(*cmd_info)); scsi_status = 0; - /* - * Set the direction, relative to the initiator. - */ - flags &= ~CAM_DIR_MASK; - if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == - CTL_FLAG_DATA_IN) - flags |= CAM_DIR_IN; - else - flags |= CAM_DIR_OUT; - csio->cdb_len = atio->cdb_len; - flags &= ~CAM_DATA_MASK; - if (io->scsiio.kern_sg_entries == 0) { - /* No S/G list */ - data_ptr = io->scsiio.kern_data_ptr; - dxfer_len = io->scsiio.kern_data_len; - csio->sglist_cnt = 0; - - if (io->io_hdr.flags & CTL_FLAG_BUS_ADDR) - flags |= CAM_DATA_PADDR; - else - flags |= CAM_DATA_VADDR; - } else if (io->scsiio.kern_sg_entries <= - (sizeof(cmd_info->cam_sglist)/ - sizeof(cmd_info->cam_sglist[0]))) { - /* - * S/G list with physical or virtual pointers. - * Just populate the CAM S/G list with the - * pointers. - */ - int i; - struct ctl_sg_entry *ctl_sglist; - bus_dma_segment_t *cam_sglist; - - ctl_sglist = (struct ctl_sg_entry *) - io->scsiio.kern_data_ptr; - cam_sglist = cmd_info->cam_sglist; - - for (i = 0; i < io->scsiio.kern_sg_entries;i++){ - cam_sglist[i].ds_addr = - (bus_addr_t)ctl_sglist[i].addr; - cam_sglist[i].ds_len = - ctl_sglist[i].len; - } - csio->sglist_cnt = io->scsiio.kern_sg_entries; - if (io->io_hdr.flags & CTL_FLAG_BUS_ADDR) - flags |= CAM_DATA_SG_PADDR; - else - flags |= CAM_DATA_SG; - data_ptr = (uint8_t *)cam_sglist; - dxfer_len = io->scsiio.kern_data_len; - } else { - /* S/G list with virtual pointers */ - struct ctl_sg_entry *sglist; - int *ti; - - /* - * If we have more S/G list pointers than - * will fit in the available storage in the - * cmd_info structure inside the ctl_io header, - * then we need to send down the pointers - * one element at a time. - */ - - sglist = (struct ctl_sg_entry *) - io->scsiio.kern_data_ptr; - ti = &cmd_info->cur_transfer_index; - data_ptr = sglist[*ti].addr; - dxfer_len = sglist[*ti].len; - csio->sglist_cnt = 0; - if (io->io_hdr.flags & CTL_FLAG_BUS_ADDR) - flags |= CAM_DATA_PADDR; - else - flags |= CAM_DATA_VADDR; - cmd_info->flags |= CTLFE_CMD_PIECEWISE; - (*ti)++; - } + ctlfedata(softc, io, &flags, &data_ptr, &dxfer_len, + &csio->sglist_cnt); io->scsiio.ext_data_filled += dxfer_len; @@ -1416,37 +1433,18 @@ ctlfedone(struct cam_periph *periph, uni * continue sending pieces if necessary. */ if ((cmd_info->flags & CTLFE_CMD_PIECEWISE) - && (io->io_hdr.port_status == 0) - && (cmd_info->cur_transfer_index < - io->scsiio.kern_sg_entries)) { - struct ctl_sg_entry *sglist; + && (io->io_hdr.port_status == 0)) { ccb_flags flags; uint8_t scsi_status; uint8_t *data_ptr; uint32_t dxfer_len; - int *ti; - sglist = (struct ctl_sg_entry *) - io->scsiio.kern_data_ptr; - ti = &cmd_info->cur_transfer_index; flags = atio->ccb_h.flags & (CAM_DIS_DISCONNECT| - CAM_TAG_ACTION_VALID| - CAM_DIR_MASK); - - /* - * Set the direction, relative to the initiator. - */ - flags &= ~CAM_DIR_MASK; - if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == - CTL_FLAG_DATA_IN) - flags |= CAM_DIR_IN; - else - flags |= CAM_DIR_OUT; + CAM_TAG_ACTION_VALID); - data_ptr = sglist[*ti].addr; - dxfer_len = sglist[*ti].len; - (*ti)++; + ctlfedata(softc, io, &flags, &data_ptr, + &dxfer_len, &csio->sglist_cnt); scsi_status = 0; From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 15:36:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30979EF4; Thu, 24 Apr 2014 15:36:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 031AE1999; Thu, 24 Apr 2014 15:36:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OFa0ce098362; Thu, 24 Apr 2014 15:36:00 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OFa03u098361; Thu, 24 Apr 2014 15:36:00 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201404241536.s3OFa03u098361@svn.freebsd.org> From: Steven Hartland Date: Thu, 24 Apr 2014 15:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264885 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 15:36:01 -0000 Author: smh Date: Thu Apr 24 15:36:00 2014 New Revision: 264885 URL: http://svnweb.freebsd.org/changeset/base/264885 Log: Eliminate duplicate checks in vdev_geom_io_intr error handling MFC after: 1 month Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Apr 24 15:16:26 2014 (r264884) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Apr 24 15:36:00 2014 (r264885) @@ -752,35 +752,39 @@ vdev_geom_io_intr(struct bio *bp) zio->io_error = bp->bio_error; if (zio->io_error == 0 && bp->bio_resid != 0) zio->io_error = EIO; - if (bp->bio_cmd == BIO_FLUSH && bp->bio_error == ENOTSUP) { - /* - * If we get ENOTSUP, we know that no future - * attempts will ever succeed. In this case we - * set a persistent bit so that we don't bother - * with the ioctl in the future. - */ - vd->vdev_nowritecache = B_TRUE; - } - if (bp->bio_cmd == BIO_DELETE && bp->bio_error == ENOTSUP) { - /* - * If we get ENOTSUP, we know that no future - * attempts will ever succeed. In this case we - * set a persistent bit so that we don't bother - * with the ioctl in the future. - */ - vd->vdev_notrim = B_TRUE; - } - if (zio->io_error == ENXIO && !vd->vdev_remove_wanted) { + + switch(zio->io_error) { + case ENOTSUP: /* - * If provider's error is set we assume it is being - * removed. + * If we get ENOTSUP for BIO_FLUSH or BIO_DELETE we know + * that future attempts will never succeed. In this case + * we set a persistent flag so that we don't bother with + * requests in the future. */ - if (bp->bio_to->error != 0) { - vd->vdev_remove_wanted = B_TRUE; - spa_async_request(zio->io_spa, SPA_ASYNC_REMOVE); - } else if (!vd->vdev_delayed_close) { - vd->vdev_delayed_close = B_TRUE; + switch(bp->bio_cmd) { + case BIO_FLUSH: + vd->vdev_nowritecache = B_TRUE; + break; + case BIO_DELETE: + vd->vdev_notrim = B_TRUE; + break; + } + break; + case ENXIO: + if (!vd->vdev_remove_wanted) { + /* + * If provider's error is set we assume it is being + * removed. + */ + if (bp->bio_to->error != 0) { + vd->vdev_remove_wanted = B_TRUE; + spa_async_request(zio->io_spa, + SPA_ASYNC_REMOVE); + } else if (!vd->vdev_delayed_close) { + vd->vdev_delayed_close = B_TRUE; + } } + break; } g_destroy_bio(bp); zio_interrupt(zio); From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 16:19:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1746949; Thu, 24 Apr 2014 16:19:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 915BD1E46; Thu, 24 Apr 2014 16:19:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OGJoeu015275; Thu, 24 Apr 2014 16:19:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OGJo0s015272; Thu, 24 Apr 2014 16:19:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404241619.s3OGJo0s015272@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 Apr 2014 16:19:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264886 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 16:19:50 -0000 Author: mav Date: Thu Apr 24 16:19:49 2014 New Revision: 264886 URL: http://svnweb.freebsd.org/changeset/base/264886 Log: Remove limits on size of READ/WRITE operations. Instead of allocating up to 16MB or RAM at once to handle whole I/O, allocate up to 1MB at a time, but do multiple ctl_datamove() and storage I/Os if needed. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_backend_ramdisk.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Thu Apr 24 15:36:00 2014 (r264885) +++ head/sys/cam/ctl/ctl.c Thu Apr 24 16:19:49 2014 (r264886) @@ -9534,7 +9534,7 @@ ctl_inquiry_evpd_block_limits(struct ctl bl_ptr->page_code = SVPD_BLOCK_LIMITS; scsi_ulto2b(sizeof(*bl_ptr), bl_ptr->page_length); - scsi_ulto4b((16 * 1024 * 1024) / bs, bl_ptr->max_txfer_len); + scsi_ulto4b(0xffffffff, bl_ptr->max_txfer_len); scsi_ulto4b(MAXPHYS / bs, bl_ptr->opt_txfer_len); if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_lba_cnt); Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Thu Apr 24 15:36:00 2014 (r264885) +++ head/sys/cam/ctl/ctl_backend_block.c Thu Apr 24 16:19:49 2014 (r264886) @@ -89,11 +89,12 @@ __FBSDID("$FreeBSD$"); #include /* - * The idea here is that we'll allocate enough S/G space to hold a 16MB - * I/O. If we get an I/O larger than that, we'll reject it. + * The idea here is that we'll allocate enough S/G space to hold a 1MB + * I/O. If we get an I/O larger than that, we'll split it. */ -#define CTLBLK_MAX_IO_SIZE (16 * 1024 * 1024) -#define CTLBLK_MAX_SEGS (CTLBLK_MAX_IO_SIZE / MAXPHYS) + 1 +#define CTLBLK_MAX_IO_SIZE (1024 * 1024) +#define CTLBLK_MAX_SEG MAXPHYS +#define CTLBLK_MAX_SEGS MAX(CTLBLK_MAX_IO_SIZE / CTLBLK_MAX_SEG, 1) #ifdef CTLBLK_DEBUG #define DPRINTF(fmt, args...) \ @@ -498,14 +499,6 @@ ctl_be_block_biodone(struct bio *bio) ctl_set_success(&io->scsiio); ctl_complete_beio(beio); } else { - io->scsiio.be_move_done = ctl_be_block_move_done; - io->scsiio.kern_data_ptr = (uint8_t *)beio->sg_segs; - io->scsiio.kern_data_len = beio->io_len; - io->scsiio.kern_total_len = beio->io_len; - io->scsiio.kern_rel_offset = 0; - io->scsiio.kern_data_resid = 0; - io->scsiio.kern_sg_entries = beio->num_segs; - io->io_hdr.flags |= CTL_FLAG_ALLOCATED | CTL_FLAG_KDPTR_SGLIST; #ifdef CTL_TIME_IO getbintime(&io->io_hdr.dma_start_bt); #endif @@ -705,14 +698,6 @@ ctl_be_block_dispatch_file(struct ctl_be ctl_complete_beio(beio); } else { SDT_PROBE(cbb, kernel, read, file_done, 0, 0, 0, 0, 0); - io->scsiio.be_move_done = ctl_be_block_move_done; - io->scsiio.kern_data_ptr = (uint8_t *)beio->sg_segs; - io->scsiio.kern_data_len = beio->io_len; - io->scsiio.kern_total_len = beio->io_len; - io->scsiio.kern_rel_offset = 0; - io->scsiio.kern_data_resid = 0; - io->scsiio.kern_sg_entries = beio->num_segs; - io->io_hdr.flags |= CTL_FLAG_ALLOCATED | CTL_FLAG_KDPTR_SGLIST; #ifdef CTL_TIME_IO getbintime(&io->io_hdr.dma_start_bt); #endif @@ -1012,7 +997,7 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b /* * Setup the S/G entry for this chunk. */ - seglen = MIN(MAXPHYS, len_left); + seglen = MIN(CTLBLK_MAX_SEG, len_left); seglen -= seglen % be_lun->blocksize; beio->sg_segs[i].len = seglen; beio->sg_segs[i].addr = uma_zalloc(be_lun->lun_zone, M_WAITOK); @@ -1165,13 +1150,44 @@ SDT_PROBE_DEFINE1(cbb, kernel, read, all SDT_PROBE_DEFINE1(cbb, kernel, write, alloc_done, "uint64_t"); static void +ctl_be_block_next(struct ctl_be_block_io *beio) +{ + struct ctl_be_block_lun *be_lun; + union ctl_io *io; + + io = beio->io; + be_lun = beio->lun; + ctl_free_beio(beio); + if (((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE) + && ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)) { + ctl_done(io); + return; + } + + io->scsiio.kern_rel_offset += io->scsiio.kern_data_len; + io->io_hdr.status &= ~CTL_STATUS_MASK; + io->io_hdr.status |= CTL_STATUS_NONE; + + mtx_lock(&be_lun->lock); + /* + * XXX KDM make sure that links is okay to use at this point. + * Otherwise, we either need to add another field to ctl_io_hdr, + * or deal with resource allocation here. + */ + STAILQ_INSERT_TAIL(&be_lun->input_queue, &io->io_hdr, links); + mtx_unlock(&be_lun->lock); + + taskqueue_enqueue(be_lun->io_taskqueue, &be_lun->io_task); +} + +static void ctl_be_block_dispatch(struct ctl_be_block_lun *be_lun, union ctl_io *io) { struct ctl_be_block_io *beio; struct ctl_be_block_softc *softc; struct ctl_lba_len lbalen; - uint64_t len_left, io_size_bytes; + uint64_t len_left, lbaoff; int i; softc = be_lun->softc; @@ -1184,29 +1200,6 @@ ctl_be_block_dispatch(struct ctl_be_bloc SDT_PROBE(cbb, kernel, write, start, 0, 0, 0, 0, 0); } - memcpy(&lbalen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, - sizeof(lbalen)); - - io_size_bytes = lbalen.len * be_lun->blocksize; - - /* - * XXX KDM this is temporary, until we implement chaining of beio - * structures and multiple datamove calls to move all the data in - * or out. - */ - if (io_size_bytes > CTLBLK_MAX_IO_SIZE) { - printf("%s: IO length %ju > max io size %u\n", __func__, - io_size_bytes, CTLBLK_MAX_IO_SIZE); - ctl_set_invalid_field(&io->scsiio, - /*sks_valid*/ 0, - /*command*/ 1, - /*field*/ 0, - /*bit_valid*/ 0, - /*bit*/ 0); - ctl_done(io); - return; - } - beio = ctl_alloc_beio(softc); beio->io = io; beio->lun = be_lun; @@ -1253,20 +1246,25 @@ ctl_be_block_dispatch(struct ctl_be_bloc beio->ds_trans_type = DEVSTAT_WRITE; } - beio->io_len = lbalen.len * be_lun->blocksize; - beio->io_offset = lbalen.lba * be_lun->blocksize; - - DPRINTF("%s at LBA %jx len %u\n", + memcpy(&lbalen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, + sizeof(lbalen)); + DPRINTF("%s at LBA %jx len %u @%ju\n", (beio->bio_cmd == BIO_READ) ? "READ" : "WRITE", - (uintmax_t)lbalen.lba, lbalen.len); - - for (i = 0, len_left = io_size_bytes; i < CTLBLK_MAX_SEGS && - len_left > 0; i++) { + (uintmax_t)lbalen.lba, lbalen.len, lbaoff); + lbaoff = io->scsiio.kern_rel_offset / be_lun->blocksize; + beio->io_offset = (lbalen.lba + lbaoff) * be_lun->blocksize; + beio->io_len = MIN((lbalen.len - lbaoff) * be_lun->blocksize, + CTLBLK_MAX_IO_SIZE); + beio->io_len -= beio->io_len % be_lun->blocksize; + + for (i = 0, len_left = beio->io_len; len_left > 0; i++) { + KASSERT(i < CTLBLK_MAX_SEGS, ("Too many segs (%d >= %d)", + i, CTLBLK_MAX_SEGS)); /* * Setup the S/G entry for this chunk. */ - beio->sg_segs[i].len = min(MAXPHYS, len_left); + beio->sg_segs[i].len = min(CTLBLK_MAX_SEG, len_left); beio->sg_segs[i].addr = uma_zalloc(be_lun->lun_zone, M_WAITOK); DPRINTF("segment %d addr %p len %zd\n", i, @@ -1275,6 +1273,15 @@ ctl_be_block_dispatch(struct ctl_be_bloc beio->num_segs++; len_left -= beio->sg_segs[i].len; } + if (io->scsiio.kern_rel_offset + beio->io_len < + io->scsiio.kern_total_len) + beio->beio_cont = ctl_be_block_next; + io->scsiio.be_move_done = ctl_be_block_move_done; + io->scsiio.kern_data_ptr = (uint8_t *)beio->sg_segs; + io->scsiio.kern_data_len = beio->io_len; + io->scsiio.kern_data_resid = 0; + io->scsiio.kern_sg_entries = beio->num_segs; + io->io_hdr.flags |= CTL_FLAG_ALLOCATED | CTL_FLAG_KDPTR_SGLIST; /* * For the read case, we need to read the data into our buffers and @@ -1286,14 +1293,6 @@ ctl_be_block_dispatch(struct ctl_be_bloc be_lun->dispatch(be_lun, beio); } else { SDT_PROBE(cbb, kernel, write, alloc_done, 0, 0, 0, 0, 0); - io->scsiio.be_move_done = ctl_be_block_move_done; - io->scsiio.kern_data_ptr = (uint8_t *)beio->sg_segs; - io->scsiio.kern_data_len = beio->io_len; - io->scsiio.kern_total_len = beio->io_len; - io->scsiio.kern_rel_offset = 0; - io->scsiio.kern_data_resid = 0; - io->scsiio.kern_sg_entries = beio->num_segs; - io->io_hdr.flags |= CTL_FLAG_ALLOCATED | CTL_FLAG_KDPTR_SGLIST; #ifdef CTL_TIME_IO getbintime(&io->io_hdr.dma_start_bt); #endif @@ -1384,6 +1383,7 @@ ctl_be_block_worker(void *context, int p static int ctl_be_block_submit(union ctl_io *io) { + struct ctl_lba_len lbalen; struct ctl_be_block_lun *be_lun; struct ctl_be_lun *ctl_be_lun; int retval; @@ -1402,6 +1402,11 @@ ctl_be_block_submit(union ctl_io *io) KASSERT(io->io_hdr.io_type == CTL_IO_SCSI, ("Non-SCSI I/O (type " "%#x) encountered", io->io_hdr.io_type)); + memcpy(&lbalen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, + sizeof(lbalen)); + io->scsiio.kern_total_len = lbalen.len * be_lun->blocksize; + io->scsiio.kern_rel_offset = 0; + mtx_lock(&be_lun->lock); /* * XXX KDM make sure that links is okay to use at this point. @@ -1838,7 +1843,7 @@ ctl_be_block_create(struct ctl_be_block_ sprintf(be_lun->lunname, "cblk%d", softc->num_luns); mtx_init(&be_lun->lock, be_lun->lunname, NULL, MTX_DEF); - be_lun->lun_zone = uma_zcreate(be_lun->lunname, MAXPHYS, + be_lun->lun_zone = uma_zcreate(be_lun->lunname, CTLBLK_MAX_SEG, NULL, NULL, NULL, NULL, /*align*/ 0, /*flags*/0); if (be_lun->lun_zone == NULL) { Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_ramdisk.c Thu Apr 24 15:36:00 2014 (r264885) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Thu Apr 24 16:19:49 2014 (r264886) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -73,12 +74,17 @@ typedef enum { } ctl_be_ramdisk_lun_flags; struct ctl_be_ramdisk_lun { + char lunname[32]; uint64_t size_bytes; uint64_t size_blocks; struct ctl_be_ramdisk_softc *softc; ctl_be_ramdisk_lun_flags flags; STAILQ_ENTRY(ctl_be_ramdisk_lun) links; struct ctl_be_lun ctl_be_lun; + struct taskqueue *io_taskqueue; + struct task io_task; + STAILQ_HEAD(, ctl_io_hdr) cont_queue; + struct mtx lock; }; struct ctl_be_ramdisk_softc { @@ -100,6 +106,7 @@ int ctl_backend_ramdisk_init(void); void ctl_backend_ramdisk_shutdown(void); static int ctl_backend_ramdisk_move_done(union ctl_io *io); static int ctl_backend_ramdisk_submit(union ctl_io *io); +static void ctl_backend_ramdisk_continue(union ctl_io *io); static int ctl_backend_ramdisk_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td); static int ctl_backend_ramdisk_rm(struct ctl_be_ramdisk_softc *softc, @@ -108,6 +115,7 @@ static int ctl_backend_ramdisk_create(st struct ctl_lun_req *req, int do_wait); static int ctl_backend_ramdisk_modify(struct ctl_be_ramdisk_softc *softc, struct ctl_lun_req *req); +static void ctl_backend_ramdisk_worker(void *context, int pending); static void ctl_backend_ramdisk_lun_shutdown(void *be_lun); static void ctl_backend_ramdisk_lun_config_status(void *be_lun, ctl_lun_config_status status); @@ -145,7 +153,7 @@ ctl_backend_ramdisk_init(void) mtx_init(&softc->lock, "ramdisk", NULL, MTX_DEF); STAILQ_INIT(&softc->lun_list); - softc->rd_size = 4 * 1024 * 1024; + softc->rd_size = 1024 * 1024; #ifdef CTL_RAMDISK_PAGES softc->num_pages = softc->rd_size / PAGE_SIZE; softc->ramdisk_pages = (uint8_t **)malloc(sizeof(uint8_t *) * @@ -211,16 +219,39 @@ ctl_backend_ramdisk_shutdown(void) static int ctl_backend_ramdisk_move_done(union ctl_io *io) { + struct ctl_be_lun *ctl_be_lun; + struct ctl_be_ramdisk_lun *be_lun; #ifdef CTL_TIME_IO struct bintime cur_bt; #endif CTL_DEBUG_PRINT(("ctl_backend_ramdisk_move_done\n")); + ctl_be_lun = (struct ctl_be_lun *)io->io_hdr.ctl_private[ + CTL_PRIV_BACKEND_LUN].ptr; + be_lun = (struct ctl_be_ramdisk_lun *)ctl_be_lun->be_lun; +#ifdef CTL_TIME_IO + getbintime(&cur_bt); + bintime_sub(&cur_bt, &io->io_hdr.dma_start_bt); + bintime_add(&io->io_hdr.dma_bt, &cur_bt); + io->io_hdr.num_dmas++; +#endif + if (io->scsiio.kern_sg_entries > 0) + free(io->scsiio.kern_data_ptr, M_RAMDISK); + io->scsiio.kern_rel_offset += io->scsiio.kern_data_len; if ((io->io_hdr.port_status == 0) && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) - && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) + && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) { + if (io->scsiio.kern_rel_offset < io->scsiio.kern_total_len) { + mtx_lock(&be_lun->lock); + STAILQ_INSERT_TAIL(&be_lun->cont_queue, + &io->io_hdr, links); + mtx_unlock(&be_lun->lock); + taskqueue_enqueue(be_lun->io_taskqueue, + &be_lun->io_task); + return (0); + } io->io_hdr.status = CTL_SUCCESS; - else if ((io->io_hdr.port_status != 0) + } else if ((io->io_hdr.port_status != 0) && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)){ /* @@ -236,15 +267,6 @@ ctl_backend_ramdisk_move_done(union ctl_ /*retry_count*/ io->io_hdr.port_status); } -#ifdef CTL_TIME_IO - getbintime(&cur_bt); - bintime_sub(&cur_bt, &io->io_hdr.dma_start_bt); - bintime_add(&io->io_hdr.dma_bt, &cur_bt); - io->io_hdr.num_dmas++; -#endif - - if (io->scsiio.kern_sg_entries > 0) - free(io->scsiio.kern_data_ptr, M_RAMDISK); ctl_done(io); return(0); } @@ -253,93 +275,100 @@ static int ctl_backend_ramdisk_submit(union ctl_io *io) { struct ctl_lba_len lbalen; -#ifdef CTL_RAMDISK_PAGES - struct ctl_sg_entry *sg_entries; - int len_filled; - int i; -#endif - int num_sg_entries, len; - struct ctl_be_ramdisk_softc *softc; struct ctl_be_lun *ctl_be_lun; - struct ctl_be_ramdisk_lun *be_lun; - softc = &rd_softc; - ctl_be_lun = (struct ctl_be_lun *)io->io_hdr.ctl_private[ CTL_PRIV_BACKEND_LUN].ptr; - be_lun = (struct ctl_be_ramdisk_lun *)ctl_be_lun->be_lun; memcpy(&lbalen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, sizeof(lbalen)); + io->scsiio.be_move_done = ctl_backend_ramdisk_move_done; + io->scsiio.kern_total_len = lbalen.len * ctl_be_lun->blocksize; + io->scsiio.kern_rel_offset = 0; + io->scsiio.kern_data_resid = 0; + ctl_backend_ramdisk_continue(io); - len = lbalen.len * ctl_be_lun->blocksize; - - /* - * Kick out the request if it's bigger than we can handle. - */ - if (len > softc->rd_size) { - ctl_set_internal_failure(&io->scsiio, - /*sks_valid*/ 0, - /*retry_count*/ 0); - ctl_done(io); - return (CTL_RETVAL_COMPLETE); - } - - /* - * Kick out the request if it's larger than the device size that - * the user requested. - */ - if (((lbalen.lba * ctl_be_lun->blocksize) + len) > be_lun->size_bytes) { - ctl_set_lba_out_of_range(&io->scsiio); - ctl_done(io); - return (CTL_RETVAL_COMPLETE); - } + return (CTL_RETVAL_COMPLETE); +} +static void +ctl_backend_ramdisk_continue(union ctl_io *io) +{ + struct ctl_be_ramdisk_softc *softc; + int len, len_filled, sg_filled; #ifdef CTL_RAMDISK_PAGES - num_sg_entries = len >> PAGE_SHIFT; - if ((len & (PAGE_SIZE - 1)) != 0) - num_sg_entries++; + struct ctl_sg_entry *sg_entries; + int i; +#endif - if (num_sg_entries > 1) { + softc = &rd_softc; + len = io->scsiio.kern_total_len - io->scsiio.kern_rel_offset; +#ifdef CTL_RAMDISK_PAGES + sg_filled = min(btoc(len), softc->num_pages); + if (sg_filled > 1) { io->scsiio.kern_data_ptr = malloc(sizeof(struct ctl_sg_entry) * - num_sg_entries, M_RAMDISK, + sg_filled, M_RAMDISK, M_WAITOK); sg_entries = (struct ctl_sg_entry *)io->scsiio.kern_data_ptr; - for (i = 0, len_filled = 0; i < num_sg_entries; - i++, len_filled += PAGE_SIZE) { + for (i = 0, len_filled = 0; i < sg_filled; i++) { sg_entries[i].addr = softc->ramdisk_pages[i]; sg_entries[i].len = ctl_min(PAGE_SIZE, len - len_filled); + len_filled += sg_entries[i].len; } + io->io_hdr.flags |= CTL_FLAG_KDPTR_SGLIST; } else { -#endif /* CTL_RAMDISK_PAGES */ - /* - * If this is less than 1 page, don't bother allocating a - * scatter/gather list for it. This saves time/overhead. - */ - num_sg_entries = 0; -#ifdef CTL_RAMDISK_PAGES + sg_filled = 0; + len_filled = len; io->scsiio.kern_data_ptr = softc->ramdisk_pages[0]; -#else - io->scsiio.kern_data_ptr = softc->ramdisk_buffer; -#endif -#ifdef CTL_RAMDISK_PAGES } -#endif +#else + sg_filled = 0; + len_filled = min(len, softc->rd_size); + io->scsiio.kern_data_ptr = softc->ramdisk_buffer; +#endif /* CTL_RAMDISK_PAGES */ - io->scsiio.be_move_done = ctl_backend_ramdisk_move_done; - io->scsiio.kern_data_len = len; - io->scsiio.kern_total_len = len; - io->scsiio.kern_rel_offset = 0; - io->scsiio.kern_data_resid = 0; - io->scsiio.kern_sg_entries = num_sg_entries; - io->io_hdr.flags |= CTL_FLAG_ALLOCATED | CTL_FLAG_KDPTR_SGLIST; + io->scsiio.kern_data_len = len_filled; + io->scsiio.kern_sg_entries = sg_filled; + io->io_hdr.flags |= CTL_FLAG_ALLOCATED; #ifdef CTL_TIME_IO getbintime(&io->io_hdr.dma_start_bt); #endif ctl_datamove(io); +} - return (CTL_RETVAL_COMPLETE); +static void +ctl_backend_ramdisk_worker(void *context, int pending) +{ + struct ctl_be_ramdisk_softc *softc; + struct ctl_be_ramdisk_lun *be_lun; + union ctl_io *io; + + be_lun = (struct ctl_be_ramdisk_lun *)context; + softc = be_lun->softc; + + mtx_lock(&be_lun->lock); + for (;;) { + io = (union ctl_io *)STAILQ_FIRST(&be_lun->cont_queue); + if (io != NULL) { + STAILQ_REMOVE(&be_lun->cont_queue, &io->io_hdr, + ctl_io_hdr, links); + + mtx_unlock(&be_lun->lock); + + ctl_backend_ramdisk_continue(io); + + mtx_lock(&be_lun->lock); + continue; + } + + /* + * If we get here, there is no work left in the queues, so + * just break out and let the task queue go to sleep. + */ + break; + } + mtx_unlock(&be_lun->lock); } static int @@ -470,8 +499,12 @@ ctl_backend_ramdisk_rm(struct ctl_be_ram mtx_unlock(&softc->lock); - if (retval == 0) + if (retval == 0) { + taskqueue_drain(be_lun->io_taskqueue, &be_lun->io_task); + taskqueue_free(be_lun->io_taskqueue); + mtx_destroy(&be_lun->lock); free(be_lun, M_RAMDISK); + } req->status = CTL_LUN_OK; @@ -509,6 +542,7 @@ ctl_backend_ramdisk_create(struct ctl_be sizeof(*be_lun)); goto bailout_error; } + sprintf(be_lun->lunname, "cram%d", softc->num_luns); STAILQ_INIT(&be_lun->ctl_be_lun.options); if (params->flags & CTL_LUN_FLAG_DEV_TYPE) @@ -611,6 +645,27 @@ ctl_backend_ramdisk_create(struct ctl_be sizeof(params->device_id))); } + STAILQ_INIT(&be_lun->cont_queue); + mtx_init(&be_lun->lock, "CTL ramdisk", NULL, MTX_DEF); + TASK_INIT(&be_lun->io_task, /*priority*/0, ctl_backend_ramdisk_worker, + be_lun); + + be_lun->io_taskqueue = taskqueue_create(be_lun->lunname, M_WAITOK, + taskqueue_thread_enqueue, /*context*/&be_lun->io_taskqueue); + if (be_lun->io_taskqueue == NULL) { + snprintf(req->error_str, sizeof(req->error_str), + "%s: Unable to create taskqueue", __func__); + goto bailout_error; + } + + retval = taskqueue_start_threads(&be_lun->io_taskqueue, + /*num threads*/1, + /*priority*/PWAIT, + /*thread name*/ + "%s taskq", be_lun->lunname); + if (retval != 0) + goto bailout_error; + mtx_lock(&softc->lock); softc->num_luns++; STAILQ_INSERT_TAIL(&softc->lun_list, be_lun, links); @@ -669,7 +724,13 @@ ctl_backend_ramdisk_create(struct ctl_be bailout_error: req->status = CTL_LUN_ERROR; - free(be_lun, M_RAMDISK); + if (be_lun != NULL) { + if (be_lun->io_taskqueue != NULL) { + taskqueue_free(be_lun->io_taskqueue); + } + mtx_destroy(&be_lun->lock); + free(be_lun, M_RAMDISK); + } return (retval); } From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 17:17:40 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52B85C17; Thu, 24 Apr 2014 17:17:39 +0000 (UTC) Received: from aslan.scsiguy.com (aslan.scsiguy.com [70.89.174.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D21AE15CA; Thu, 24 Apr 2014 17:17:38 +0000 (UTC) Received: from benscottlt.sldomain.com (207-225-98-3.dia.static.qwest.net [207.225.98.3]) (authenticated bits=0) by aslan.scsiguy.com (8.14.8/8.14.8) with ESMTP id s3OHHRBf024552 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 24 Apr 2014 11:17:29 -0600 (MDT) (envelope-from gibbs@scsiguy.com) Content-Type: text/plain; charset=windows-1253 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263778 - in head: bin lib lib/clang sbin share/mk usr.bin usr.sbin From: "Justin T. Gibbs" In-Reply-To: Date: Thu, 24 Apr 2014 11:17:22 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201403262230.s2QMUdH6021943@svn.freebsd.org> <20140327181245.GA69977@stack.nl> <7A86F5E9-DBE9-4D3F-B166-C02F8386B722@FreeBSD.org> <1398086131.1124.371.camel@revolution.hippie.lan> To: Warner Losh X-Mailer: Apple Mail (2.1874) Cc: src-committers@FreeBSD.org, Ian Lepore , Jilles Tjoelker , svn-src-all@FreeBSD.org, Dimitry Andric , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 17:17:40 -0000 Why wouldn=92t we fix these with explicit subdir dependencies (e.g: = subdira: subdirb)? I=92m pretty sure I had this working with a hacked = up bsd.subdir.mk at a previous job, but my memory is hazy. =97 Justin =20 On Apr 21, 2014, at 7:35 AM, Warner Losh wrote: > (sorry for the top post) >=20 > This looks good to my eye. I=92d be tempted to toss in a comment about = the > __wait=3D.WAIT construct is due to the primitive nature of bmake=92s = parser > so it runs afoul of the .for/.if construction rules and this is needed = to expand > the for variable. It tripped me up when I looked at it, until I = recalled a comment > from similar code in NetBSD. >=20 > Warner >=20 > On Apr 21, 2014, at 7:15 AM, Ian Lepore wrote: >=20 >> On Thu, 2014-03-27 at 20:44 +0100, Dimitry Andric wrote: >>> On 27 Mar 2014, at 19:12, Jilles Tjoelker wrote: >>>> On Thu, Mar 27, 2014 at 11:05:00AM -0600, Warner Losh wrote: >>>>> On Mar 26, 2014, at 4:30 PM, Dimitry Andric = wrote: >>>>>> Author: dim >>>>>> Date: Wed Mar 26 22:30:38 2014 >>>>>> New Revision: 263778 >>>>>> URL: http://svnweb.freebsd.org/changeset/base/263778 >>>>=20 >>>>>> Log: >>>>>> Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to = process >>>>>> all the SUBDIR entries in parallel, instead of serially. Apply = this >>>>>> option to a selected number of Makefiles, which can greatly speed = up the >>>>>> build on multi-core machines, when using make -j. >>>>=20 >>>>>> This can be extended to more Makefiles later on, whenever they = are >>>>>> verified to work correctly with parallel building. >>>>=20 >>>>> Why not have this =91opt out=92 rather than =91opt in=92 like it = is now? Are >>>>> there any known bad dependencies this introduces? >>>>=20 >>>> I'm paranoid about build systems ;) It is easy to add dependencies >>>> across directories and as long as directories are built in = sequence, >>>> nothing goes wrong. >>>>=20 >>>> In fact, I had enabled SUBDIR_PARALLEL in sys/modules/Makefile as = well, >>>> but this caused mysterious failures with some kernels such as mips >>>> ADM5120. >>>=20 >>> There are a bunch of other parts that don't really like parallel = builds >>> at the moment. For example, gnu/usr.bin/binutils needs its = libraries >>> (libbfd.a, etc) built first, before it can link the programs. = Similar >>> for gnu/usr.bin/cc, which needs libiberty, libcpp, etc before being = able >>> to build the rest of gcc. >>>=20 >>> Most of these cases can hopefully be solved by adding .WAIT targets = at >>> strategic points in the SUBDIR lists, but this also needs a bit of = extra >>> logic in bsd.subdir.mk. >>>=20 >>> -Dimitry >>>=20 >>=20 >> It turns out I needed the .WAIT functionality to use SUBDIR_PARALLEL = for >> $work, so I came up with the attached, does this look okay to commit? >>=20 >> -- Ian >>=20 >> diff -r 67802e319fc6 share/mk/bsd.subdir.mk >> --- a/share/mk/bsd.subdir.mk Sun Apr 20 21:01:07 2014 -0600 >> +++ b/share/mk/bsd.subdir.mk Mon Apr 21 06:59:37 2014 -0600 >> @@ -4,10 +4,10 @@ >> # The include file contains the default targets >> # for building subdirectories. >> # >> -# For all of the directories listed in the variable SUBDIRS, the >> +# For all of the directories listed in the variable SUBDIR, the >> # specified directory will be visited and the target made. There is >> # also a default target which allows the command "make subdir" where >> -# subdir is any directory listed in the variable SUBDIRS. >> +# subdir is any directory listed in the variable SUBDIR. >> # >> # >> # +++ variables +++ >> @@ -42,7 +42,7 @@ distribute: >>=20 >> _SUBDIR: .USE >> .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) >> - @${_+_}for entry in ${SUBDIR}; do \ >> + @${_+_}for entry in ${SUBDIR:N.WAIT}; do \ >> if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \ >> ${ECHODIR} "=3D=3D=3D> = ${DIRPRFX}$${entry}.${MACHINE_ARCH} (${.TARGET:realinstall=3Dinstall})"; = \ >> edir=3D$${entry}.${MACHINE_ARCH}; \ >> @@ -57,7 +57,7 @@ distribute: >> done >> .endif >>=20 >> -${SUBDIR}: .PHONY >> +${SUBDIR:N.WAIT}: .PHONY >> ${_+_}@if test -d ${.TARGET}.${MACHINE_ARCH}; then \ >> cd ${.CURDIR}/${.TARGET}.${MACHINE_ARCH}; \ >> else \ >> @@ -65,13 +65,18 @@ distribute: >> fi; \ >> ${MAKE} all >>=20 >> +__wait=3D.WAIT >> .for __target in all all-man checkdpadd clean cleandepend cleandir \ >> depend distribute lint maninstall manlint \ >> obj objlink realinstall regress tags \ >> ${SUBDIR_TARGETS} >> .ifdef SUBDIR_PARALLEL >> +__subdir_targets=3D >> .for __dir in ${SUBDIR} >> -${__target}: ${__target}_subdir_${__dir} >> +.if ${__wait} =3D=3D ${__dir} >> +__subdir_targets+=3D .WAIT >> +.else >> +__subdir_targets+=3D ${__target}_subdir_${__dir} >> ${__target}_subdir_${__dir}: .MAKE >> @${_+_}set -e; \ >> if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ >> @@ -85,7 +90,9 @@ distribute: >> fi; \ >> ${MAKE} ${__target:realinstall=3Dinstall} \ >> DIRPRFX=3D${DIRPRFX}$$edir/ >> +.endif >> .endfor >> +${__target}: ${__subdir_targets} >> .else >> ${__target}: _SUBDIR >> .endif >=20 >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 17:23:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99809AC; Thu, 24 Apr 2014 17:23:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7948E1680; Thu, 24 Apr 2014 17:23:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OHNH3r044289; Thu, 24 Apr 2014 17:23:17 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OHNGFQ044284; Thu, 24 Apr 2014 17:23:16 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201404241723.s3OHNGFQ044284@svn.freebsd.org> From: Alan Somers Date: Thu, 24 Apr 2014 17:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264887 - in head: sys/net sys/netinet tests/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 17:23:17 -0000 Author: asomers Date: Thu Apr 24 17:23:16 2014 New Revision: 264887 URL: http://svnweb.freebsd.org/changeset/base/264887 Log: Fix host and network routes for new interfaces when net.add_addr_allfibs=0 sys/net/route.c In rtinit1, use the interface fib instead of the process fib. The latter wasn't very useful because ifconfig(8) is usually invoked with the default process fib. Changing ifconfig(8) to use setfib(2) would be redundant, because it already sets the interface fib. tests/sys/netinet/fibs_test.sh Clear the expected ATF failure sys/net/if.c Pass the interface fib in calls to rtrequest1_fib and rtalloc1_fib sys/netinet/in.c sys/net/if_var.h Add a fibnum argument to ifa_switch_loopback_route, a subroutine of in_scrubprefix. Pass it the interface fib. PR: kern/187549 Reviewed by: melifaro MFC after: 3 weeks Sponsored by: Spectra Logic Corporation Modified: head/sys/net/if.c head/sys/net/if_var.h head/sys/net/route.c head/sys/netinet/in.c head/tests/sys/netinet/fibs_test.sh Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Apr 24 16:19:49 2014 (r264886) +++ head/sys/net/if.c Thu Apr 24 17:23:16 2014 (r264887) @@ -1485,7 +1485,7 @@ ifa_add_loopback_route(struct ifaddr *if info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC; info.rti_info[RTAX_DST] = ia; info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; - error = rtrequest1_fib(RTM_ADD, &info, &rt, 0); + error = rtrequest1_fib(RTM_ADD, &info, &rt, ifa->ifa_ifp->if_fib); if (error == 0 && rt != NULL) { RT_LOCK(rt); @@ -1517,7 +1517,7 @@ ifa_del_loopback_route(struct ifaddr *if info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC; info.rti_info[RTAX_DST] = ia; info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; - error = rtrequest1_fib(RTM_DELETE, &info, NULL, 0); + error = rtrequest1_fib(RTM_DELETE, &info, NULL, ifa->ifa_ifp->if_fib); if (error != 0) log(LOG_DEBUG, "%s: deletion failed: %u\n", __func__, error); @@ -1526,11 +1526,11 @@ ifa_del_loopback_route(struct ifaddr *if } int -ifa_switch_loopback_route(struct ifaddr *ifa, struct sockaddr *sa) +ifa_switch_loopback_route(struct ifaddr *ifa, struct sockaddr *sa, int fib) { struct rtentry *rt; - rt = rtalloc1_fib(sa, 0, 0, 0); + rt = rtalloc1_fib(sa, 0, 0, fib); if (rt == NULL) { log(LOG_DEBUG, "%s: fail", __func__); return (EHOSTUNREACH); Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Apr 24 16:19:49 2014 (r264886) +++ head/sys/net/if_var.h Thu Apr 24 17:23:16 2014 (r264887) @@ -490,7 +490,7 @@ struct ifnet *ifunit_ref(const char *); int ifa_add_loopback_route(struct ifaddr *, struct sockaddr *); int ifa_del_loopback_route(struct ifaddr *, struct sockaddr *); -int ifa_switch_loopback_route(struct ifaddr *, struct sockaddr *); +int ifa_switch_loopback_route(struct ifaddr *, struct sockaddr *, int fib); struct ifaddr *ifa_ifwithaddr(struct sockaddr *); int ifa_ifwithaddr_check(struct sockaddr *); Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Apr 24 16:19:49 2014 (r264886) +++ head/sys/net/route.c Thu Apr 24 17:23:16 2014 (r264887) @@ -1536,7 +1536,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int } if (fibnum == RT_ALL_FIBS) { if (rt_add_addr_allfibs == 0 && cmd == (int)RTM_ADD) { - startfib = endfib = curthread->td_proc->p_fibnum; + startfib = endfib = ifa->ifa_ifp->if_fib; } else { startfib = 0; endfib = rt_numfibs - 1; Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Thu Apr 24 16:19:49 2014 (r264886) +++ head/sys/netinet/in.c Thu Apr 24 17:23:16 2014 (r264887) @@ -708,7 +708,7 @@ in_scrubprefix(struct in_ifaddr *target, if (eia != NULL) { error = ifa_switch_loopback_route((struct ifaddr *)eia, - (struct sockaddr *)&target->ia_addr); + (struct sockaddr *)&target->ia_addr, fibnum); ifa_free(&eia->ia_ifa); } else { error = ifa_del_loopback_route((struct ifaddr *)target, Modified: head/tests/sys/netinet/fibs_test.sh ============================================================================== --- head/tests/sys/netinet/fibs_test.sh Thu Apr 24 16:19:49 2014 (r264886) +++ head/tests/sys/netinet/fibs_test.sh Thu Apr 24 17:23:16 2014 (r264887) @@ -116,7 +116,6 @@ loopback_and_network_routes_on_nondefaul loopback_and_network_routes_on_nondefault_fib_body() { - atf_expect_fail "kern/187549 Host and network routes for a new interface appear in the wrong FIB" # Configure the TAP interface to use an RFC5737 nonrouteable address # and a non-default fib ADDR="192.0.2.2" From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 18:14:16 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 637E9ABC; Thu, 24 Apr 2014 18:14:16 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C6321BD8; Thu, 24 Apr 2014 18:14:15 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WdO9x-0001lB-0c; Thu, 24 Apr 2014 18:14:09 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s3OIE6J1010838; Thu, 24 Apr 2014 12:14:06 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19rhB2pAZ3NuhtJy9ilOvlF Subject: Re: svn commit: r263778 - in head: bin lib lib/clang sbin share/mk usr.bin usr.sbin From: Ian Lepore To: "Justin T. Gibbs" In-Reply-To: References: <201403262230.s2QMUdH6021943@svn.freebsd.org> <20140327181245.GA69977@stack.nl> <7A86F5E9-DBE9-4D3F-B166-C02F8386B722@FreeBSD.org> <1398086131.1124.371.camel@revolution.hippie.lan> Content-Type: text/plain; charset="windows-1251" Date: Thu, 24 Apr 2014 12:14:06 -0600 Message-ID: <1398363246.61646.73.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by damnhippie.dyndns.org id s3OIE6J1010838 Cc: src-committers@FreeBSD.org, Jilles Tjoelker , svn-src-all@FreeBSD.org, Dimitry Andric , svn-src-head@FreeBSD.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 18:14:16 -0000 I couldn't think of a way to do that, because the directory itself isn't the dependency. That is, whether one directory has a newer/older timestamp than the other isn't a function of the build process. The fact that someone else mentioned inserting .WAIT into the list is something I took as a confirmation that the regular dependency mechanism wouldn't work (so maybe I didn't think about it hard enough). -- Ian On Thu, 2014-04-24 at 11:17 -0600, Justin T. Gibbs wrote: > Why wouldn=92t we fix these with explicit subdir dependencies (e.g: sub= dira: subdirb)? I=92m pretty sure I had this working with a hacked up bs= d.subdir.mk at a previous job, but my memory is hazy. >=20 > =97 > Justin > =20 > On Apr 21, 2014, at 7:35 AM, Warner Losh wrote: >=20 > > (sorry for the top post) > >=20 > > This looks good to my eye. I=92d be tempted to toss in a comment abou= t the > > __wait=3D.WAIT construct is due to the primitive nature of bmake=92s = parser > > so it runs afoul of the .for/.if construction rules and this is neede= d to expand > > the for variable. It tripped me up when I looked at it, until I recal= led a comment > > from similar code in NetBSD. > >=20 > > Warner > >=20 > > On Apr 21, 2014, at 7:15 AM, Ian Lepore wrote: > >=20 > >> On Thu, 2014-03-27 at 20:44 +0100, Dimitry Andric wrote: > >>> On 27 Mar 2014, at 19:12, Jilles Tjoelker wrote: > >>>> On Thu, Mar 27, 2014 at 11:05:00AM -0600, Warner Losh wrote: > >>>>> On Mar 26, 2014, at 4:30 PM, Dimitry Andric wro= te: > >>>>>> Author: dim > >>>>>> Date: Wed Mar 26 22:30:38 2014 > >>>>>> New Revision: 263778 > >>>>>> URL: http://svnweb.freebsd.org/changeset/base/263778 > >>>>=20 > >>>>>> Log: > >>>>>> Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to = process > >>>>>> all the SUBDIR entries in parallel, instead of serially. Apply = this > >>>>>> option to a selected number of Makefiles, which can greatly spee= d up the > >>>>>> build on multi-core machines, when using make -j. > >>>>=20 > >>>>>> This can be extended to more Makefiles later on, whenever they a= re > >>>>>> verified to work correctly with parallel building. > >>>>=20 > >>>>> Why not have this =91opt out=92 rather than =91opt in=92 like it = is now? Are > >>>>> there any known bad dependencies this introduces? > >>>>=20 > >>>> I'm paranoid about build systems ;) It is easy to add dependencies > >>>> across directories and as long as directories are built in sequenc= e, > >>>> nothing goes wrong. > >>>>=20 > >>>> In fact, I had enabled SUBDIR_PARALLEL in sys/modules/Makefile as = well, > >>>> but this caused mysterious failures with some kernels such as mips > >>>> ADM5120. > >>>=20 > >>> There are a bunch of other parts that don't really like parallel bu= ilds > >>> at the moment. For example, gnu/usr.bin/binutils needs its librari= es > >>> (libbfd.a, etc) built first, before it can link the programs. Simi= lar > >>> for gnu/usr.bin/cc, which needs libiberty, libcpp, etc before being= able > >>> to build the rest of gcc. > >>>=20 > >>> Most of these cases can hopefully be solved by adding .WAIT targets= at > >>> strategic points in the SUBDIR lists, but this also needs a bit of = extra > >>> logic in bsd.subdir.mk. > >>>=20 > >>> -Dimitry > >>>=20 > >>=20 > >> It turns out I needed the .WAIT functionality to use SUBDIR_PARALLEL= for > >> $work, so I came up with the attached, does this look okay to commit= ? > >>=20 > >> -- Ian > >>=20 > >> diff -r 67802e319fc6 share/mk/bsd.subdir.mk > >> --- a/share/mk/bsd.subdir.mk Sun Apr 20 21:01:07 2014 -0600 > >> +++ b/share/mk/bsd.subdir.mk Mon Apr 21 06:59:37 2014 -0600 > >> @@ -4,10 +4,10 @@ > >> # The include file contains the default targets > >> # for building subdirectories. > >> # > >> -# For all of the directories listed in the variable SUBDIRS, the > >> +# For all of the directories listed in the variable SUBDIR, the > >> # specified directory will be visited and the target made. There is > >> # also a default target which allows the command "make subdir" where > >> -# subdir is any directory listed in the variable SUBDIRS. > >> +# subdir is any directory listed in the variable SUBDIR. > >> # > >> # > >> # +++ variables +++ > >> @@ -42,7 +42,7 @@ distribute: > >>=20 > >> _SUBDIR: .USE > >> .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) > >> - @${_+_}for entry in ${SUBDIR}; do \ > >> + @${_+_}for entry in ${SUBDIR:N.WAIT}; do \ > >> if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \ > >> ${ECHODIR} "=3D=3D=3D> ${DIRPRFX}$${entry}.${MACHINE_ARCH} (${.TA= RGET:realinstall=3Dinstall})"; \ > >> edir=3D$${entry}.${MACHINE_ARCH}; \ > >> @@ -57,7 +57,7 @@ distribute: > >> done > >> .endif > >>=20 > >> -${SUBDIR}: .PHONY > >> +${SUBDIR:N.WAIT}: .PHONY > >> ${_+_}@if test -d ${.TARGET}.${MACHINE_ARCH}; then \ > >> cd ${.CURDIR}/${.TARGET}.${MACHINE_ARCH}; \ > >> else \ > >> @@ -65,13 +65,18 @@ distribute: > >> fi; \ > >> ${MAKE} all > >>=20 > >> +__wait=3D.WAIT > >> .for __target in all all-man checkdpadd clean cleandepend cleandir \ > >> depend distribute lint maninstall manlint \ > >> obj objlink realinstall regress tags \ > >> ${SUBDIR_TARGETS} > >> .ifdef SUBDIR_PARALLEL > >> +__subdir_targets=3D > >> .for __dir in ${SUBDIR} > >> -${__target}: ${__target}_subdir_${__dir} > >> +.if ${__wait} =3D=3D ${__dir} > >> +__subdir_targets+=3D .WAIT > >> +.else > >> +__subdir_targets+=3D ${__target}_subdir_${__dir} > >> ${__target}_subdir_${__dir}: .MAKE > >> @${_+_}set -e; \ > >> if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ > >> @@ -85,7 +90,9 @@ distribute: > >> fi; \ > >> ${MAKE} ${__target:realinstall=3Dinstall} \ > >> DIRPRFX=3D${DIRPRFX}$$edir/ > >> +.endif > >> .endfor > >> +${__target}: ${__subdir_targets} > >> .else > >> ${__target}: _SUBDIR > >> .endif > >=20 > >=20 > >=20 >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 18:19:14 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94958DE6; Thu, 24 Apr 2014 18:19:14 +0000 (UTC) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 515E31C25; Thu, 24 Apr 2014 18:19:14 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 8D1F6358C63; Thu, 24 Apr 2014 20:19:11 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 7AA1D28497; Thu, 24 Apr 2014 20:19:11 +0200 (CEST) Date: Thu, 24 Apr 2014 20:19:11 +0200 From: Jilles Tjoelker To: Ian Lepore Subject: Re: svn commit: r263778 - in head: bin lib lib/clang sbin share/mk usr.bin usr.sbin Message-ID: <20140424181911.GA43270@stack.nl> References: <201403262230.s2QMUdH6021943@svn.freebsd.org> <20140327181245.GA69977@stack.nl> <7A86F5E9-DBE9-4D3F-B166-C02F8386B722@FreeBSD.org> <1398086131.1124.371.camel@revolution.hippie.lan> <1398363246.61646.73.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1398363246.61646.73.camel@revolution.hippie.lan> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Dimitry Andric , svn-src-head@FreeBSD.org, "Justin T. Gibbs" , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 18:19:14 -0000 On Thu, Apr 24, 2014 at 12:14:06PM -0600, Ian Lepore wrote: > On Thu, 2014-04-24 at 11:17 -0600, Justin T. Gibbs wrote: > > Why wouldn’t we fix these with explicit subdir dependencies (e.g: > > subdira: subdirb)? I’m pretty sure I had this working with a hacked > > up bsd.subdir.mk at a previous job, but my memory is hazy. > I couldn't think of a way to do that, because the directory itself isn't > the dependency. That is, whether one directory has a newer/older > timestamp than the other isn't a function of the build process. The > fact that someone else mentioned inserting .WAIT into the list is > something I took as a confirmation that the regular dependency mechanism > wouldn't work (so maybe I didn't think about it hard enough). You can add dependencies between the targets generated by bsd.subdir.mk: ${target}_subdir_${subdir}. This will probably be more verbose in the individual Makefiles than .WAIT, though. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 18:20:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EDED5F3B for ; Thu, 24 Apr 2014 18:20:05 +0000 (UTC) Received: from mail-ie0-f171.google.com (mail-ie0-f171.google.com [209.85.223.171]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B11B61C38 for ; Thu, 24 Apr 2014 18:20:05 +0000 (UTC) Received: by mail-ie0-f171.google.com with SMTP id ar20so2788698iec.2 for ; Thu, 24 Apr 2014 11:19:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=akdzDwaxau/4KOVEMlt2SQ3z3rK+EkmISy8+TCxNwIw=; b=bpJad5r6I7eBIwJ1Xlc4G6lNAk7o3YRBRJBPitfc/Y6G5UKNzYTMq86iUUShnYYFFw m0baGZ1OPhWdgLqroRSwBF0b+y8dNCgP6Q0ZKLPgdhQ/NzSciu0kEiS4QtDAFkDiVtJa XnANzN2d28g28zhzflzaRRoV5BNBhvyMtf4LMKkaAPm5EkFGp4FtxWA7tHXJQPQenybl 9+dCeK3/l0CEUbRWGpQhzxmc/Dvo++lPM5r4sq/PjJOXKUHXy5ly+FudnIpmpo83EXO/ MY67WUcCL2E23YM2jaERzkOo6DHq+t2NJi3BDILgaHHmh7HRkFSYs8uC3zAzMzWDQBvZ gw3w== X-Gm-Message-State: ALoCoQmlSMvJHQ3og6cRiciZ3i2XH0BOKTQpQjtHBufNqDEFg1fMeSWAf78M4zminki/pwc4G0dJ X-Received: by 10.42.86.196 with SMTP id v4mr3215705icl.62.1398363599669; Thu, 24 Apr 2014 11:19:59 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id fx1sm877818igd.1.2014.04.24.11.19.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Apr 2014 11:19:59 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1251 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r263778 - in head: bin lib lib/clang sbin share/mk usr.bin usr.sbin From: Warner Losh In-Reply-To: <1398363246.61646.73.camel@revolution.hippie.lan> Date: Thu, 24 Apr 2014 12:19:57 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201403262230.s2QMUdH6021943@svn.freebsd.org> <20140327181245.GA69977@stack.nl> <7A86F5E9-DBE9-4D3F-B166-C02F8386B722@FreeBSD.org> <1398086131.1124.371.camel@revolution.hippie.lan> <1398363246.61646.73.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1874) Cc: src-committers@FreeBSD.org, Jilles Tjoelker , svn-src-all@FreeBSD.org, Dimitry Andric , svn-src-head@FreeBSD.org, "Justin T. Gibbs" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 18:20:06 -0000 The dependency would have to be on the artificial targets that are created, and could easily be done. .WAIT is good for things like libc where everything is dependent on it, but poor for other dependencies which would be expressed as individual dependencies. Warner On Apr 24, 2014, at 12:14 PM, Ian Lepore wrote: > I couldn't think of a way to do that, because the directory itself = isn't > the dependency. That is, whether one directory has a newer/older > timestamp than the other isn't a function of the build process. The > fact that someone else mentioned inserting .WAIT into the list is > something I took as a confirmation that the regular dependency = mechanism > wouldn't work (so maybe I didn't think about it hard enough). >=20 > -- Ian >=20 > On Thu, 2014-04-24 at 11:17 -0600, Justin T. Gibbs wrote: >> Why wouldn=92t we fix these with explicit subdir dependencies (e.g: = subdira: subdirb)? I=92m pretty sure I had this working with a hacked = up bsd.subdir.mk at a previous job, but my memory is hazy. >>=20 >> =97 >> Justin >>=20 >> On Apr 21, 2014, at 7:35 AM, Warner Losh wrote: >>=20 >>> (sorry for the top post) >>>=20 >>> This looks good to my eye. I=92d be tempted to toss in a comment = about the >>> __wait=3D.WAIT construct is due to the primitive nature of bmake=92s = parser >>> so it runs afoul of the .for/.if construction rules and this is = needed to expand >>> the for variable. It tripped me up when I looked at it, until I = recalled a comment >>> from similar code in NetBSD. >>>=20 >>> Warner >>>=20 >>> On Apr 21, 2014, at 7:15 AM, Ian Lepore wrote: >>>=20 >>>> On Thu, 2014-03-27 at 20:44 +0100, Dimitry Andric wrote: >>>>> On 27 Mar 2014, at 19:12, Jilles Tjoelker wrote: >>>>>> On Thu, Mar 27, 2014 at 11:05:00AM -0600, Warner Losh wrote: >>>>>>> On Mar 26, 2014, at 4:30 PM, Dimitry Andric = wrote: >>>>>>>> Author: dim >>>>>>>> Date: Wed Mar 26 22:30:38 2014 >>>>>>>> New Revision: 263778 >>>>>>>> URL: http://svnweb.freebsd.org/changeset/base/263778 >>>>>>=20 >>>>>>>> Log: >>>>>>>> Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to = process >>>>>>>> all the SUBDIR entries in parallel, instead of serially. Apply = this >>>>>>>> option to a selected number of Makefiles, which can greatly = speed up the >>>>>>>> build on multi-core machines, when using make -j. >>>>>>=20 >>>>>>>> This can be extended to more Makefiles later on, whenever they = are >>>>>>>> verified to work correctly with parallel building. >>>>>>=20 >>>>>>> Why not have this =91opt out=92 rather than =91opt in=92 like it = is now? Are >>>>>>> there any known bad dependencies this introduces? >>>>>>=20 >>>>>> I'm paranoid about build systems ;) It is easy to add = dependencies >>>>>> across directories and as long as directories are built in = sequence, >>>>>> nothing goes wrong. >>>>>>=20 >>>>>> In fact, I had enabled SUBDIR_PARALLEL in sys/modules/Makefile as = well, >>>>>> but this caused mysterious failures with some kernels such as = mips >>>>>> ADM5120. >>>>>=20 >>>>> There are a bunch of other parts that don't really like parallel = builds >>>>> at the moment. For example, gnu/usr.bin/binutils needs its = libraries >>>>> (libbfd.a, etc) built first, before it can link the programs. = Similar >>>>> for gnu/usr.bin/cc, which needs libiberty, libcpp, etc before = being able >>>>> to build the rest of gcc. >>>>>=20 >>>>> Most of these cases can hopefully be solved by adding .WAIT = targets at >>>>> strategic points in the SUBDIR lists, but this also needs a bit of = extra >>>>> logic in bsd.subdir.mk. >>>>>=20 >>>>> -Dimitry >>>>>=20 >>>>=20 >>>> It turns out I needed the .WAIT functionality to use = SUBDIR_PARALLEL for >>>> $work, so I came up with the attached, does this look okay to = commit? >>>>=20 >>>> -- Ian >>>>=20 >>>> diff -r 67802e319fc6 share/mk/bsd.subdir.mk >>>> --- a/share/mk/bsd.subdir.mk Sun Apr 20 21:01:07 2014 -0600 >>>> +++ b/share/mk/bsd.subdir.mk Mon Apr 21 06:59:37 2014 -0600 >>>> @@ -4,10 +4,10 @@ >>>> # The include file contains the default targets >>>> # for building subdirectories. >>>> # >>>> -# For all of the directories listed in the variable SUBDIRS, the >>>> +# For all of the directories listed in the variable SUBDIR, the >>>> # specified directory will be visited and the target made. There is >>>> # also a default target which allows the command "make subdir" = where >>>> -# subdir is any directory listed in the variable SUBDIRS. >>>> +# subdir is any directory listed in the variable SUBDIR. >>>> # >>>> # >>>> # +++ variables +++ >>>> @@ -42,7 +42,7 @@ distribute: >>>>=20 >>>> _SUBDIR: .USE >>>> .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) >>>> - @${_+_}for entry in ${SUBDIR}; do \ >>>> + @${_+_}for entry in ${SUBDIR:N.WAIT}; do \ >>>> if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \ >>>> ${ECHODIR} "=3D=3D=3D> = ${DIRPRFX}$${entry}.${MACHINE_ARCH} (${.TARGET:realinstall=3Dinstall})"; = \ >>>> edir=3D$${entry}.${MACHINE_ARCH}; \ >>>> @@ -57,7 +57,7 @@ distribute: >>>> done >>>> .endif >>>>=20 >>>> -${SUBDIR}: .PHONY >>>> +${SUBDIR:N.WAIT}: .PHONY >>>> ${_+_}@if test -d ${.TARGET}.${MACHINE_ARCH}; then \ >>>> cd ${.CURDIR}/${.TARGET}.${MACHINE_ARCH}; \ >>>> else \ >>>> @@ -65,13 +65,18 @@ distribute: >>>> fi; \ >>>> ${MAKE} all >>>>=20 >>>> +__wait=3D.WAIT >>>> .for __target in all all-man checkdpadd clean cleandepend cleandir = \ >>>> depend distribute lint maninstall manlint \ >>>> obj objlink realinstall regress tags \ >>>> ${SUBDIR_TARGETS} >>>> .ifdef SUBDIR_PARALLEL >>>> +__subdir_targets=3D >>>> .for __dir in ${SUBDIR} >>>> -${__target}: ${__target}_subdir_${__dir} >>>> +.if ${__wait} =3D=3D ${__dir} >>>> +__subdir_targets+=3D .WAIT >>>> +.else >>>> +__subdir_targets+=3D ${__target}_subdir_${__dir} >>>> ${__target}_subdir_${__dir}: .MAKE >>>> @${_+_}set -e; \ >>>> if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ >>>> @@ -85,7 +90,9 @@ distribute: >>>> fi; \ >>>> ${MAKE} ${__target:realinstall=3Dinstall} \ >>>> DIRPRFX=3D${DIRPRFX}$$edir/ >>>> +.endif >>>> .endfor >>>> +${__target}: ${__subdir_targets} >>>> .else >>>> ${__target}: _SUBDIR >>>> .endif >>>=20 >>>=20 >>>=20 >>=20 >>=20 >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 18:24:50 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55EBF3AB; Thu, 24 Apr 2014 18:24:50 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FC411CDE; Thu, 24 Apr 2014 18:24:49 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WdOKH-0008xb-3Y; Thu, 24 Apr 2014 18:24:49 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s3OIOkS5010859; Thu, 24 Apr 2014 12:24:46 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/TSqvxFBBWTM/o0y8lUfvG Subject: Re: svn commit: r263778 - in head: bin lib lib/clang sbin share/mk usr.bin usr.sbin From: Ian Lepore To: Jilles Tjoelker In-Reply-To: <20140424181911.GA43270@stack.nl> References: <201403262230.s2QMUdH6021943@svn.freebsd.org> <20140327181245.GA69977@stack.nl> <7A86F5E9-DBE9-4D3F-B166-C02F8386B722@FreeBSD.org> <1398086131.1124.371.camel@revolution.hippie.lan> <1398363246.61646.73.camel@revolution.hippie.lan> <20140424181911.GA43270@stack.nl> Content-Type: text/plain; charset="iso-8859-13" Date: Thu, 24 Apr 2014 12:24:46 -0600 Message-ID: <1398363886.61646.76.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by damnhippie.dyndns.org id s3OIOkS5010859 Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Dimitry Andric , svn-src-head@FreeBSD.org, "Justin T. Gibbs" , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 18:24:50 -0000 On Thu, 2014-04-24 at 20:19 +0200, Jilles Tjoelker wrote: > On Thu, Apr 24, 2014 at 12:14:06PM -0600, Ian Lepore wrote: > > On Thu, 2014-04-24 at 11:17 -0600, Justin T. Gibbs wrote: > > > Why wouldn=FFt we fix these with explicit subdir dependencies (e.g: > > > subdira: subdirb)? I=FFm pretty sure I had this working with a hac= ked > > > up bsd.subdir.mk at a previous job, but my memory is hazy. >=20 > > I couldn't think of a way to do that, because the directory itself is= n't > > the dependency. That is, whether one directory has a newer/older > > timestamp than the other isn't a function of the build process. The > > fact that someone else mentioned inserting .WAIT into the list is > > something I took as a confirmation that the regular dependency mechan= ism > > wouldn't work (so maybe I didn't think about it hard enough). >=20 > You can add dependencies between the targets generated by bsd.subdir.mk= : > ${target}_subdir_${subdir}. This will probably be more verbose in the > individual Makefiles than .WAIT, though. >=20 What I was hoping is that we would eventually sprinkle 3 or 4 or 5 strategic .WAITs throughout the source tree and it would all be good. Maybe that's too optimistic. -- Ian From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 20:47:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81D0B9F0; Thu, 24 Apr 2014 20:47:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EBA81C2B; Thu, 24 Apr 2014 20:47:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OKlx1q030020; Thu, 24 Apr 2014 20:47:59 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OKlx8O030018; Thu, 24 Apr 2014 20:47:59 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201404242047.s3OKlx8O030018@svn.freebsd.org> From: Rick Macklem Date: Thu, 24 Apr 2014 20:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264888 - in head/sys: fs/nfsserver nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 20:47:59 -0000 Author: rmacklem Date: Thu Apr 24 20:47:58 2014 New Revision: 264888 URL: http://svnweb.freebsd.org/changeset/base/264888 Log: The PR reported that the old NFS server did not set uio_td == NULL for the VOP_READ() call. This patch fixes both the old and new server for this case. PR: 185232 Submitted by: PR had patch for old server Reviewed by: kib MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/nfsserver/nfs_serv.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Thu Apr 24 17:23:16 2014 (r264887) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Thu Apr 24 20:47:58 2014 (r264888) @@ -673,6 +673,7 @@ nfsvno_read(struct vnode *vp, off_t off, uiop->uio_resid = len; uiop->uio_rw = UIO_READ; uiop->uio_segflg = UIO_SYSSPACE; + uiop->uio_td = NULL; nh = nfsrv_sequential_heuristic(uiop, vp); ioflag |= nh->nh_seqcount << IO_SEQSHIFT; error = VOP_READ(vp, uiop, IO_NODELOCKED | ioflag, cred); Modified: head/sys/nfsserver/nfs_serv.c ============================================================================== --- head/sys/nfsserver/nfs_serv.c Thu Apr 24 17:23:16 2014 (r264887) +++ head/sys/nfsserver/nfs_serv.c Thu Apr 24 20:47:58 2014 (r264888) @@ -911,6 +911,7 @@ nfsrv_read(struct nfsrv_descript *nfsd, uiop->uio_resid = len; uiop->uio_rw = UIO_READ; uiop->uio_segflg = UIO_SYSSPACE; + uiop->uio_td = NULL; nh = nfsrv_sequential_heuristic(uiop, vp); ioflag |= nh->nh_seqcount << IO_SEQSHIFT; error = VOP_READ(vp, uiop, IO_NODELOCKED | ioflag, cred); From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 20:53:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4919F00; Thu, 24 Apr 2014 20:53:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD3AA1D2F; Thu, 24 Apr 2014 20:53:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OKr9RI033677; Thu, 24 Apr 2014 20:53:09 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OKr9Z4033676; Thu, 24 Apr 2014 20:53:09 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404242053.s3OKr9Z4033676@svn.freebsd.org> From: Ed Maste Date: Thu, 24 Apr 2014 20:53:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264889 - head/sbin/newfs_msdos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 20:53:09 -0000 Author: emaste Date: Thu Apr 24 20:53:09 2014 New Revision: 264889 URL: http://svnweb.freebsd.org/changeset/base/264889 Log: Correct min/max cluster counts for FAT12/16/32 FAT12 1..4084 FAT16 4085..65524 FAT32 65525.. This is required for interoperability with other FAT implementations, and in particular UEFI. Obtained from: NetBSD Sponsored by: The FreeBSD Foundation Modified: head/sbin/newfs_msdos/newfs_msdos.c Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Thu Apr 24 20:47:58 2014 (r264888) +++ head/sbin/newfs_msdos/newfs_msdos.c Thu Apr 24 20:53:09 2014 (r264889) @@ -64,11 +64,11 @@ static const char rcsid[] = #define DEFRDE 512 /* default root directory entries */ #define RESFTE 2 /* reserved FAT entries */ #define MINCLS12 1U /* minimum FAT12 clusters */ -#define MINCLS16 0x1000U /* minimum FAT16 clusters */ -#define MINCLS32 2U /* minimum FAT32 clusters */ -#define MAXCLS12 0xfedU /* maximum FAT12 clusters */ -#define MAXCLS16 0xfff5U /* maximum FAT16 clusters */ -#define MAXCLS32 0xffffff5U /* maximum FAT32 clusters */ +#define MINCLS16 0xff5U /* minimum FAT16 clusters */ +#define MINCLS32 0xfff5U /* minimum FAT32 clusters */ +#define MAXCLS12 0xff4U /* maximum FAT12 clusters */ +#define MAXCLS16 0xfff4U /* maximum FAT16 clusters */ +#define MAXCLS32 0xffffff4U /* maximum FAT32 clusters */ #define mincls(fat) ((fat) == 12 ? MINCLS12 : \ (fat) == 16 ? MINCLS16 : \ From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 21:17:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F35A6FF; Thu, 24 Apr 2014 21:17:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F008D10ED; Thu, 24 Apr 2014 21:17:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OLHmLh042662; Thu, 24 Apr 2014 21:17:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OLHmiR042661; Thu, 24 Apr 2014 21:17:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404242117.s3OLHmiR042661@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Apr 2014 21:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264890 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 21:17:49 -0000 Author: imp Date: Thu Apr 24 21:17:48 2014 New Revision: 264890 URL: http://svnweb.freebsd.org/changeset/base/264890 Log: More like gone in 11... Modified: head/sys/mips/mips/pm_machdep.c Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Thu Apr 24 20:53:09 2014 (r264889) +++ head/sys/mips/mips/pm_machdep.c Thu Apr 24 21:17:48 2014 (r264890) @@ -184,27 +184,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, mtx_lock(&psp->ps_mtx); } -#ifdef GONE_IN_7 -/* - * Build siginfo_t for SA thread - */ -void -cpu_thread_siginfo(int sig, u_long code, siginfo_t *si) -{ - struct proc *p; - struct thread *td; - - td = curthread; - p = td->td_proc; - PROC_LOCK_ASSERT(p, MA_OWNED); - - bzero(si, sizeof(*si)); - si->si_signo = sig; - si->si_code = code; - /* XXXKSE fill other fields */ -} -#endif - /* * System call to cleanup state after a signal * has been taken. Reset signal mask and From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 21:17:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CBBE8CA; Thu, 24 Apr 2014 21:17:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0220B10EE; Thu, 24 Apr 2014 21:17:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OLHrOR042718; Thu, 24 Apr 2014 21:17:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OLHrQw042717; Thu, 24 Apr 2014 21:17:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404242117.s3OLHrQw042717@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Apr 2014 21:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264891 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 21:17:54 -0000 Author: imp Date: Thu Apr 24 21:17:53 2014 New Revision: 264891 URL: http://svnweb.freebsd.org/changeset/base/264891 Log: Channel my inner hobgoblin and make all functions enclosed in () instead of some in () and some in {} Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Thu Apr 24 21:17:48 2014 (r264890) +++ head/tools/tools/nanobsd/nanobsd.sh Thu Apr 24 21:17:53 2014 (r264891) @@ -442,9 +442,9 @@ newfs_part ( ) ( # Convenient spot to work around any umount issues that your build environment # hits by overriding this method. -nano_umount () { +nano_umount () ( umount ${1} -} +) populate_slice ( ) ( local dev dir mnt lbl @@ -649,14 +649,14 @@ last_orders () ( # Common Flash device geometries # -FlashDevice () { +FlashDevice () ( if [ -d ${NANO_TOOLS} ] ; then . ${NANO_TOOLS}/FlashDevice.sub else . ${NANO_SRC}/${NANO_TOOLS}/FlashDevice.sub fi sub_FlashDevice $1 $2 -} +) ####################################################################### # USB device geometries @@ -678,7 +678,7 @@ FlashDevice () { # The generic-hdd device is preferred for flash devices larger than 1GB. # -UsbDevice () { +UsbDevice () ( a1=`echo $1 | tr '[:upper:]' '[:lower:]'` case $a1 in generic-fdd) @@ -696,7 +696,7 @@ UsbDevice () { exit 2 ;; esac -} +) ####################################################################### # Setup serial console @@ -848,18 +848,18 @@ cust_pkgng () ( # Convenience function: # Register all args as customize function. -customize_cmd () { +customize_cmd () ( NANO_CUSTOMIZE="$NANO_CUSTOMIZE $*" -} +) ####################################################################### # Convenience function: # Register all args as late customize function to run just before # image creation. -late_customize_cmd () { +late_customize_cmd () ( NANO_LATE_CUSTOMIZE="$NANO_LATE_CUSTOMIZE $*" -} +) ####################################################################### # @@ -869,14 +869,14 @@ late_customize_cmd () { # Progress Print # Print $2 at level $1. -pprint() { +pprint() ( if [ "$1" -le $PPLEVEL ]; then runtime=$(( `date +%s` - $NANO_STARTTIME )) printf "%s %.${1}s %s\n" "`date -u -r $runtime +%H:%M:%S`" "#####" "$2" 1>&3 fi -} +) -usage () { +usage () ( ( echo "Usage: $0 [-bfiknqvw] [-c config_file]" echo " -b suppress builds (both kernel and world)" @@ -890,7 +890,7 @@ usage () { echo " -c specify config file" ) 1>&2 exit 2 -} +) ####################################################################### # Parse arguments From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 21:18:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAB72A08; Thu, 24 Apr 2014 21:18:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D897C10F3; Thu, 24 Apr 2014 21:18:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OLI1XJ042794; Thu, 24 Apr 2014 21:18:01 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OLI11d042793; Thu, 24 Apr 2014 21:18:01 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404242118.s3OLI11d042793@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Apr 2014 21:18:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264892 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 21:18:02 -0000 Author: imp Date: Thu Apr 24 21:18:01 2014 New Revision: 264892 URL: http://svnweb.freebsd.org/changeset/base/264892 Log: Turns out that bash whines line a spoiled three year old when it encounters empty function. Put the 'true' passifier back. This effectively backs out r264857. Submitted by: Garrett Cooper Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Thu Apr 24 21:17:53 2014 (r264891) +++ head/tools/tools/nanobsd/nanobsd.sh Thu Apr 24 21:18:01 2014 (r264892) @@ -637,6 +637,7 @@ last_orders () ( # after the build completed, for instance to copy the finished # image to a more convenient place: # cp ${NANO_DISKIMGDIR}/_.disk.image /home/ftp/pub/nanobsd.disk + true ) ####################################################################### From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 21:18:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5986B3F; Thu, 24 Apr 2014 21:18:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3ABD10F7; Thu, 24 Apr 2014 21:18:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OLI6ES042859; Thu, 24 Apr 2014 21:18:06 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OLI6Qt042858; Thu, 24 Apr 2014 21:18:06 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404242118.s3OLI6Qt042858@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Apr 2014 21:18:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264893 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 21:18:06 -0000 Author: imp Date: Thu Apr 24 21:18:06 2014 New Revision: 264893 URL: http://svnweb.freebsd.org/changeset/base/264893 Log: Always define LIBLDNS. We don't need to only define it when it is enabled. Modified: head/share/mk/bsd.libnames.mk Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Thu Apr 24 21:18:01 2014 (r264892) +++ head/share/mk/bsd.libnames.mk Thu Apr 24 21:18:06 2014 (r264893) @@ -77,9 +77,7 @@ LIBKICONV?= ${DESTDIR}${LIBDIR}/libkicon LIBKRB5?= ${DESTDIR}${LIBDIR}/libkrb5.a LIBKVM?= ${DESTDIR}${LIBDIR}/libkvm.a LIBL?= ${DESTDIR}${LIBDIR}/libl.a -.if ${MK_LDNS} != "no" LIBLDNS?= ${DESTDIR}${LIBPRIVATEDIR}/libldns.a -.endif LIBLN?= "don't use LIBLN, use LIBL" LIBLZMA?= ${DESTDIR}${LIBDIR}/liblzma.a LIBM?= ${DESTDIR}${LIBDIR}/libm.a From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 21:18:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC765C7A; Thu, 24 Apr 2014 21:18:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A1841102; Thu, 24 Apr 2014 21:18:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OLIEmC042920; Thu, 24 Apr 2014 21:18:14 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OLIEa6042919; Thu, 24 Apr 2014 21:18:14 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404242118.s3OLIEa6042919@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Apr 2014 21:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264894 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 21:18:14 -0000 Author: imp Date: Thu Apr 24 21:18:14 2014 New Revision: 264894 URL: http://svnweb.freebsd.org/changeset/base/264894 Log: LIBMILTER can be defined always. No need to restrict to only when we're building sendmail. Modified: head/share/mk/bsd.libnames.mk Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Thu Apr 24 21:18:06 2014 (r264893) +++ head/share/mk/bsd.libnames.mk Thu Apr 24 21:18:14 2014 (r264894) @@ -85,9 +85,7 @@ LIBMAGIC?= ${DESTDIR}${LIBDIR}/libmagic. LIBMD?= ${DESTDIR}${LIBDIR}/libmd.a LIBMEMSTAT?= ${DESTDIR}${LIBDIR}/libmemstat.a LIBMENU?= ${DESTDIR}${LIBDIR}/libmenu.a -.if ${MK_SENDMAIL} != "no" LIBMILTER?= ${DESTDIR}${LIBDIR}/libmilter.a -.endif LIBMP?= ${DESTDIR}${LIBDIR}/libmp.a LIBNCURSES?= ${DESTDIR}${LIBDIR}/libncurses.a LIBNCURSESW?= ${DESTDIR}${LIBDIR}/libncursesw.a From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 21:18:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91BCADB4; Thu, 24 Apr 2014 21:18:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D9831106; Thu, 24 Apr 2014 21:18:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OLIMPe042988; Thu, 24 Apr 2014 21:18:22 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OLIM8w042987; Thu, 24 Apr 2014 21:18:22 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404242118.s3OLIM8w042987@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Apr 2014 21:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264895 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 21:18:22 -0000 Author: imp Date: Thu Apr 24 21:18:22 2014 New Revision: 264895 URL: http://svnweb.freebsd.org/changeset/base/264895 Log: Don't need to make these conditional on MK_LIBCPLUSPLUS. They can be defined all the time without ill effect. Modified: head/share/mk/bsd.libnames.mk Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Thu Apr 24 21:18:14 2014 (r264894) +++ head/share/mk/bsd.libnames.mk Thu Apr 24 21:18:22 2014 (r264895) @@ -24,10 +24,8 @@ LIBBSDXML?= ${DESTDIR}${LIBDIR}/libbsdxm LIBBSM?= ${DESTDIR}${LIBDIR}/libbsm.a LIBBSNMP?= ${DESTDIR}${LIBDIR}/libbsnmp.a LIBBZ2?= ${DESTDIR}${LIBDIR}/libbz2.a -.if ${MK_LIBCPLUSPLUS} != "no" LIBCXXRT?= ${DESTDIR}${LIBDIR}/libcxxrt.a LIBCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libc++.a -.endif LIBC?= ${DESTDIR}${LIBDIR}/libc.a LIBC_PIC?= ${DESTDIR}${LIBDIR}/libc_pic.a LIBCALENDAR?= ${DESTDIR}${LIBDIR}/libcalendar.a @@ -96,7 +94,9 @@ LIBNVPAIR?= ${DESTDIR}${LIBDIR}/libnvpai LIBOPIE?= ${DESTDIR}${LIBDIR}/libopie.a # The static PAM library doesn't know its secondary dependencies, -# so we have to specify them explicitly. +# so we have to specify them explicitly. Ths is an unfortunate, +# but necessary departure from testing MK_ flags to define +# values here. LIBPAM?= ${DESTDIR}${LIBDIR}/libpam.a MINUSLPAM= -lpam .if defined(LDFLAGS) && !empty(LDFLAGS:M-static) From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 21:18:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA0E0EE9; Thu, 24 Apr 2014 21:18:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D55251108; Thu, 24 Apr 2014 21:18:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OLITBB043045; Thu, 24 Apr 2014 21:18:29 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OLITtn043044; Thu, 24 Apr 2014 21:18:29 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404242118.s3OLITtn043044@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Apr 2014 21:18:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264896 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 21:18:30 -0000 Author: imp Date: Thu Apr 24 21:18:29 2014 New Revision: 264896 URL: http://svnweb.freebsd.org/changeset/base/264896 Log: LIBUNBOUND can be unconditionally set. Modified: head/share/mk/bsd.libnames.mk Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Thu Apr 24 21:18:22 2014 (r264895) +++ head/share/mk/bsd.libnames.mk Thu Apr 24 21:18:29 2014 (r264896) @@ -148,9 +148,7 @@ LIBUCL?= ${DESTDIR}${LIBPRIVATEDIR}/libu LIBUFS?= ${DESTDIR}${LIBDIR}/libufs.a LIBUGIDFW?= ${DESTDIR}${LIBDIR}/libugidfw.a LIBUMEM?= ${DESTDIR}${LIBDIR}/libumem.a -.if ${MK_UNBOUND} != "no" LIBUNBOUND?= ${DESTDIR}${LIBPRIVATEDIR}/libunbound.a -.endif LIBUSBHID?= ${DESTDIR}${LIBDIR}/libusbhid.a LIBUSB?= ${DESTDIR}${LIBDIR}/libusb.a LIBULOG?= ${DESTDIR}${LIBDIR}/libulog.a From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 22:28:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8DFD840; Thu, 24 Apr 2014 22:28:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98C6A17E7; Thu, 24 Apr 2014 22:28:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3OMSrlC071903; Thu, 24 Apr 2014 22:28:53 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3OMSrPl071902; Thu, 24 Apr 2014 22:28:53 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201404242228.s3OMSrPl071902@svn.freebsd.org> From: Brooks Davis Date: Thu, 24 Apr 2014 22:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264897 - head/sys/mips/beri X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 22:28:53 -0000 Author: brooks Date: Thu Apr 24 22:28:53 2014 New Revision: 264897 URL: http://svnweb.freebsd.org/changeset/base/264897 Log: Merge from CheriBSD: commit 003649d9622ce252a2794ae5891ee7e7c209caca Author: Robert N. M. Watson Date: Wed Feb 5 18:32:09 2014 +0000 Teach the FreeBSD/beri boot to "auto-detect" whether argument 4 (a3) is a memory size of pointer to a struct bootinfo * by looking at its value and seeing whether it is pointer-like. If a pointer, assume it's a bootinfo and extract memsize from it instead; otherwise, use it as memsize directly. This allows kernels to support bootinfo being passed by loader (and boot2) while still supporting older Miniboot setups. commit f7045af9a1e92b6bd92541fe5d25abf66d824e8f Author: Robert N. M. Watson Date: Thu Feb 6 13:45:34 2014 +0000 When the module metadata pointer is available from loader, use it in the kernel. commit 52e0e1ff2cba9dfcfab9e1d0a31fb7fdf7317450 Author: Robert N. M. Watson Date: Thu Feb 6 19:57:48 2014 +0000 In the BERI kernel boot code, extract 'boothowto' (which includes boot flags such as '-s') and 'envp' from passed module data. Booting to single-user mode using boot flags now works. Sponsored by: DARPA, AFRL Modified: head/sys/mips/beri/beri_machdep.c Modified: head/sys/mips/beri/beri_machdep.c ============================================================================== --- head/sys/mips/beri/beri_machdep.c Thu Apr 24 21:18:29 2014 (r264896) +++ head/sys/mips/beri/beri_machdep.c Thu Apr 24 22:28:53 2014 (r264897) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Wojciech A. Koszek - * Copyright (c) 2012 Robert N. M. Watson + * Copyright (c) 2012-2014 Robert N. M. Watson * All rights reserved. * * This software was developed by SRI International and the University of @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -131,60 +132,19 @@ platform_reset(void) __asm__ __volatile("wait"); } -#ifdef FDT -/* Parse cmd line args as env - copied from xlp_machdep. */ -/* XXX-BZ this should really be centrally provided for all (boot) code. */ -static void -_parse_bootargs(char *cmdline) -{ - char *n, *v; - - while ((v = strsep(&cmdline, " \n")) != NULL) { - if (*v == '\0') - continue; - if (*v == '-') { - while (*v != '\0') { - v++; - switch (*v) { - case 'a': boothowto |= RB_ASKNAME; break; - /* Someone should simulate that ;-) */ - case 'C': boothowto |= RB_CDROM; break; - case 'd': boothowto |= RB_KDB; break; - case 'D': boothowto |= RB_MULTIPLE; break; - case 'm': boothowto |= RB_MUTE; break; - case 'g': boothowto |= RB_GDB; break; - case 'h': boothowto |= RB_SERIAL; break; - case 'p': boothowto |= RB_PAUSE; break; - case 'r': boothowto |= RB_DFLTROOT; break; - case 's': boothowto |= RB_SINGLE; break; - case 'v': boothowto |= RB_VERBOSE; break; - } - } - } else { - n = strsep(&v, "="); - if (v == NULL) - setenv(n, "1"); - else - setenv(n, v); - } - } -} -#endif - void platform_start(__register_t a0, __register_t a1, __register_t a2, __register_t a3) { + struct bootinfo *bootinfop; vm_offset_t kernend; uint64_t platform_counter_freq; int argc = a0; char **argv = (char **)a1; char **envp = (char **)a2; - unsigned int memsize = a3; + long memsize; #ifdef FDT - char buf[2048]; /* early stack supposedly big enough */ vm_offset_t dtbp; - phandle_t chosen; void *kmdp; #endif int i; @@ -197,6 +157,25 @@ platform_start(__register_t a0, __regist mips_pcpu0_init(); + /* + * Over time, we've changed out boot-time binary interface for the + * kernel. Miniboot simply provides a 'memsize' in a3, whereas the + * FreeBSD boot loader provides a 'bootinfo *' in a3. While slightly + * grody, we support both here by detecting 'pointer-like' values in + * a3 and assuming physical memory can never be that back. + * + * XXXRW: Pull more values than memsize out of bootinfop -- e.g., + * module information. + */ + if (a3 >= 0x9800000000000000ULL) { + bootinfop = (void *)a3; + memsize = bootinfop->bi_memsize; + preload_metadata = (caddr_t)bootinfop->bi_modulep; + } else { + bootinfop = NULL; + memsize = a3; + } + #ifdef FDT /* * Find the dtb passed in by the boot loader (currently fictional). @@ -222,14 +201,13 @@ platform_start(__register_t a0, __regist while (1); if (OF_init((void *)dtbp) != 0) while (1); +#endif /* - * Get bootargs from FDT if specified. + * Configure more boot-time parameters passed in by loader. */ - chosen = OF_finddevice("/chosen"); - if (OF_getprop(chosen, "bootargs", buf, sizeof(buf)) != -1) - _parse_bootargs(buf); -#endif + boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); + kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); /* * XXXRW: We have no way to compare wallclock time to cycle rate on @@ -252,7 +230,10 @@ platform_start(__register_t a0, __regist for (i = 0; envp[i]; i += 2) printf("\t%s = %s\n", envp[i], envp[i+1]); - printf("memsize = %08x\n", memsize); + if (bootinfop != NULL) + printf("bootinfo found at %p\n", bootinfop); + + printf("memsize = %p\n", (void *)memsize); } realmem = btoc(memsize); From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 23:10:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C53AE33C; Thu, 24 Apr 2014 23:10:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B29351B9D; Thu, 24 Apr 2014 23:10:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3ONAObG088936; Thu, 24 Apr 2014 23:10:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3ONAO5o088935; Thu, 24 Apr 2014 23:10:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404242310.s3ONAO5o088935@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Apr 2014 23:10:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264898 - head/sys/dev/ath/ath_hal/ar5210 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 23:10:24 -0000 Author: adrian Date: Thu Apr 24 23:10:24 2014 New Revision: 264898 URL: http://svnweb.freebsd.org/changeset/base/264898 Log: Fix ah_powerMode to be set at the correct place for the AR5210. Tested: * AR5210, STA mode Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_power.c Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_power.c Thu Apr 24 22:28:53 2014 (r264897) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_power.c Thu Apr 24 23:10:24 2014 (r264898) @@ -108,21 +108,23 @@ ar5210SetPowerMode(struct ath_hal *ah, H setChip ? "set chip " : ""); switch (mode) { case HAL_PM_AWAKE: + ah->ah_powerMode = mode; status = ar5210SetPowerModeAwake(ah, setChip); break; case HAL_PM_FULL_SLEEP: ar5210SetPowerModeSleep(ah, setChip); + ah->ah_powerMode = mode; break; case HAL_PM_NETWORK_SLEEP: ar5210SetPowerModeAuto(ah, setChip); + ah->ah_powerMode = mode; break; default: HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unknown power mode %u\n", __func__, mode); return AH_FALSE; } - ah->ah_powerMode = mode; - return status; + return status; } HAL_POWER_MODE From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 23:11:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E843749F; Thu, 24 Apr 2014 23:11:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB8641C19; Thu, 24 Apr 2014 23:11:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3ONBJGR089130; Thu, 24 Apr 2014 23:11:19 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3ONBJhg089127; Thu, 24 Apr 2014 23:11:19 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404242311.s3ONBJhg089127@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Apr 2014 23:11:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264899 - head/sys/dev/ath/ath_hal/ar5210 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 23:11:20 -0000 Author: adrian Date: Thu Apr 24 23:11:18 2014 New Revision: 264899 URL: http://svnweb.freebsd.org/changeset/base/264899 Log: Fix the AR5210 HAL code to store the association ID and restore it upon reset. Tested: * AR5210, STA mode Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210.h head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210.h Thu Apr 24 23:10:24 2014 (r264898) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210.h Thu Apr 24 23:11:18 2014 (r264899) @@ -120,6 +120,8 @@ struct ath_hal_5210 { u_int ah_slottime; /* user-specified slot time */ u_int ah_acktimeout; /* user-specified ack timeout */ u_int ah_ctstimeout; /* user-specified cts timeout */ + + uint16_t ah_associd; /* association id */ }; #define AH5210(ah) ((struct ath_hal_5210 *)(ah)) Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c Thu Apr 24 23:10:24 2014 (r264898) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_misc.c Thu Apr 24 23:11:18 2014 (r264899) @@ -315,6 +315,7 @@ ar5210WriteAssocid(struct ath_hal *ah, c /* XXX save bssid for possible re-use on reset */ OS_MEMCPY(ahp->ah_bssid, bssid, IEEE80211_ADDR_LEN); + ahp->ah_associd = assocId; OS_REG_WRITE(ah, AR_BSS_ID0, LE_READ_4(ahp->ah_bssid)); OS_REG_WRITE(ah, AR_BSS_ID1, LE_READ_2(ahp->ah_bssid+4) | ((assocId & 0x3fff)<ah_bssid)); OS_REG_WRITE(ah, AR_BSS_ID1, LE_READ_2(ahp->ah_bssid + 4)); +#endif + /* BSSID, association id, ps-poll */ + ar5210WriteAssocid(ah, ahp->ah_bssid, ahp->ah_associd); OS_REG_WRITE(ah, AR_TXDP0, 0); OS_REG_WRITE(ah, AR_TXDP1, 0); From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 23:11:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09D985E2; Thu, 24 Apr 2014 23:11:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB1281C1E; Thu, 24 Apr 2014 23:11:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3ONBaj3090913; Thu, 24 Apr 2014 23:11:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3ONBaDk090912; Thu, 24 Apr 2014 23:11:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404242311.s3ONBaDk090912@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Apr 2014 23:11:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264900 - head/sys/dev/ath/ath_hal/ar5211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 23:11:37 -0000 Author: adrian Date: Thu Apr 24 23:11:36 2014 New Revision: 264900 URL: http://svnweb.freebsd.org/changeset/base/264900 Log: Fix the AR5211 power mode tracking stuff. Tested: * AR5211, STA mode Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_power.c Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_power.c Thu Apr 24 23:11:18 2014 (r264899) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_power.c Thu Apr 24 23:11:36 2014 (r264900) @@ -110,21 +110,23 @@ ar5211SetPowerMode(struct ath_hal *ah, H setChip ? "set chip " : ""); switch (mode) { case HAL_PM_AWAKE: + ah->ah_powerMode = mode; status = ar5211SetPowerModeAwake(ah, setChip); break; case HAL_PM_FULL_SLEEP: ar5211SetPowerModeSleep(ah, setChip); + ah->ah_powerMode = mode; break; case HAL_PM_NETWORK_SLEEP: ar5211SetPowerModeNetworkSleep(ah, setChip); + ah->ah_powerMode = mode; break; default: HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unknown power mode %u\n", __func__, mode); return AH_FALSE; } - ah->ah_powerMode = mode; - return status; + return status; } HAL_POWER_MODE From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 23:12:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69A4C749; Thu, 24 Apr 2014 23:12:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A7EB1C2A; Thu, 24 Apr 2014 23:12:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3ONCf50091770; Thu, 24 Apr 2014 23:12:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3ONCf44091769; Thu, 24 Apr 2014 23:12:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404242312.s3ONCf44091769@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Apr 2014 23:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264901 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 23:12:41 -0000 Author: adrian Date: Thu Apr 24 23:12:40 2014 New Revision: 264901 URL: http://svnweb.freebsd.org/changeset/base/264901 Log: Modify the ioctl path to support querying things if the vap state is SLEEP rather than RUN. Without this things like 'ifconfig wlan0 list sta' don't work when the NIC is power save. Tested: * AR5212, STA mode (with powersave) * AR5416, STA mode (with powersave) Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Thu Apr 24 23:11:36 2014 (r264900) +++ head/sys/net80211/ieee80211_ioctl.c Thu Apr 24 23:12:40 2014 (r264901) @@ -602,7 +602,7 @@ ieee80211_ioctl_getcurchan(struct ieee80 * in use. When in RUN state report the vap-specific channel. * Otherwise return curchan. */ - if (vap->iv_state == IEEE80211_S_RUN) + if (vap->iv_state == IEEE80211_S_RUN | vap->iv_state == IEEE80211_S_SLEEP) c = vap->iv_bss->ni_chan; else c = ic->ic_curchan; @@ -920,7 +920,7 @@ ieee80211_ioctl_get80211(struct ieee8021 case IEEE80211_IOC_BSSID: if (ireq->i_len != IEEE80211_ADDR_LEN) return EINVAL; - if (vap->iv_state == IEEE80211_S_RUN) { + if (vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP) { error = copyout(vap->iv_opmode == IEEE80211_M_WDS ? vap->iv_bss->ni_macaddr : vap->iv_bss->ni_bssid, ireq->i_data, ireq->i_len); @@ -1026,7 +1026,7 @@ ieee80211_ioctl_get80211(struct ieee8021 case IEEE80211_IOC_AMPDU_LIMIT: if (vap->iv_opmode == IEEE80211_M_HOSTAP) ireq->i_val = vap->iv_ampdu_rxmax; - else if (vap->iv_state == IEEE80211_S_RUN) + else if (vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP) ireq->i_val = MS(vap->iv_bss->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU); else @@ -1034,7 +1034,7 @@ ieee80211_ioctl_get80211(struct ieee8021 break; case IEEE80211_IOC_AMPDU_DENSITY: if (vap->iv_opmode == IEEE80211_M_STA && - vap->iv_state == IEEE80211_S_RUN) + (vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP)) ireq->i_val = MS(vap->iv_bss->ni_htparam, IEEE80211_HTCAP_MPDUDENSITY); else @@ -1108,7 +1108,7 @@ ieee80211_ioctl_get80211(struct ieee8021 break; case IEEE80211_IOC_SMPS: if (vap->iv_opmode == IEEE80211_M_STA && - vap->iv_state == IEEE80211_S_RUN) { + (vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP)) { if (vap->iv_bss->ni_flags & IEEE80211_NODE_MIMO_RTS) ireq->i_val = IEEE80211_HTCAP_SMPS_DYNAMIC; else if (vap->iv_bss->ni_flags & IEEE80211_NODE_MIMO_PS) @@ -1120,7 +1120,7 @@ ieee80211_ioctl_get80211(struct ieee8021 break; case IEEE80211_IOC_RIFS: if (vap->iv_opmode == IEEE80211_M_STA && - vap->iv_state == IEEE80211_S_RUN) + (vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP)) ireq->i_val = (vap->iv_bss->ni_flags & IEEE80211_NODE_RIFS) != 0; else @@ -1949,7 +1949,7 @@ setcurchan(struct ieee80211vap *vap, str if (IEEE80211_IS_CHAN_NOADHOC(c)) return EINVAL; } - if (vap->iv_state == IEEE80211_S_RUN && + if ((vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP) && vap->iv_bss->ni_chan == c) return 0; /* NB: nothing to do */ } From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 23:17:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4843AE0; Thu, 24 Apr 2014 23:17:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 910101C66; Thu, 24 Apr 2014 23:17:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3ONHW69092579; Thu, 24 Apr 2014 23:17:32 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3ONHW1o092576; Thu, 24 Apr 2014 23:17:32 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404242317.s3ONHW1o092576@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Apr 2014 23:17:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264902 - in head: kerberos5 share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 23:17:32 -0000 Author: imp Date: Thu Apr 24 23:17:31 2014 New Revision: 264902 URL: http://svnweb.freebsd.org/changeset/base/264902 Log: Use MK_OPENLDAP in preference to WITH_OPENLDAP and make it a default NO option to match the opt-in nature of the historical nature of this option. Added: head/tools/build/options/WITH_OPENLDAP (contents, props changed) Modified: head/kerberos5/Makefile.inc head/share/mk/bsd.opts.mk Modified: head/kerberos5/Makefile.inc ============================================================================== --- head/kerberos5/Makefile.inc Thu Apr 24 23:12:40 2014 (r264901) +++ head/kerberos5/Makefile.inc Thu Apr 24 23:17:31 2014 (r264902) @@ -1,12 +1,14 @@ # $FreeBSD$ +.include + NO_LINT= KRB5DIR= ${.CURDIR}/../../../crypto/heimdal CFLAGS+= -DHAVE_CONFIG_H -I${.CURDIR}/../../include -.if defined(WITH_OPENLDAP) && !defined(COMPAT_32BIT) +.if ${MK_OPENLDAP} != "no" && !defined(COMPAT_32BIT) OPENLDAPBASE?= /usr/local LDAPLDADD= -lldap -llber LDAPDPADD= ${LDAPLDADD:C;^-l(.*)$;${OPENLDAPBASE}/lib/lib\1.a;} Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Thu Apr 24 23:12:40 2014 (r264901) +++ head/share/mk/bsd.opts.mk Thu Apr 24 23:17:31 2014 (r264902) @@ -182,6 +182,7 @@ __DEFAULT_NO_OPTIONS = \ LLDB \ NAND \ OFED \ + OPENLDAP \ OPENSSH_NONE_CIPHER \ SHARED_TOOLCHAIN \ SORT_THREADS \ Added: head/tools/build/options/WITH_OPENLDAP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_OPENLDAP Thu Apr 24 23:17:31 2014 (r264902) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Enable building openldap support for kerberos. From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 23:17:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66822CF1; Thu, 24 Apr 2014 23:17:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53B531C69; Thu, 24 Apr 2014 23:17:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3ONHf3a092644; Thu, 24 Apr 2014 23:17:41 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3ONHeDI092641; Thu, 24 Apr 2014 23:17:40 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404242317.s3ONHeDI092641@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Apr 2014 23:17:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264903 - in head: share/mk tools/build/options usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 23:17:41 -0000 Author: imp Date: Thu Apr 24 23:17:40 2014 New Revision: 264903 URL: http://svnweb.freebsd.org/changeset/base/264903 Log: Add option WITHOUT_VI to not build/install vi. vi was the largest binary without a knob to turn it off. Added: head/tools/build/options/WITHOUT_VI (contents, props changed) Modified: head/share/mk/bsd.opts.mk head/usr.bin/Makefile Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Thu Apr 24 23:17:31 2014 (r264902) +++ head/share/mk/bsd.opts.mk Thu Apr 24 23:17:40 2014 (r264903) @@ -166,6 +166,7 @@ __DEFAULT_YES_OPTIONS = \ UNBOUND \ USB \ UTMPX \ + VI \ WIRELESS \ WPA_SUPPLICANT_EAPOL \ ZFS \ Added: head/tools/build/options/WITHOUT_VI ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_VI Thu Apr 24 23:17:40 2014 (r264903) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build and install vi, view, ex and related programs. Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Thu Apr 24 23:17:31 2014 (r264902) +++ head/usr.bin/Makefile Thu Apr 24 23:17:40 2014 (r264903) @@ -182,7 +182,6 @@ SUBDIR= alias \ unvis \ uudecode \ uuencode \ - vi \ vis \ vmstat \ w \ @@ -361,6 +360,10 @@ SUBDIR+= xstr SUBDIR+= yacc .endif +.if ${MK_VI} != "no" +SUBDIR+= vi +.endif + .if ${MK_USB} != "no" SUBDIR+= usbhidaction SUBDIR+= usbhidctl From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 23:28:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0CEC516F; Thu, 24 Apr 2014 23:28:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE0CF1D37; Thu, 24 Apr 2014 23:28:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3ONS9XR096856; Thu, 24 Apr 2014 23:28:09 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3ONS9ii096855; Thu, 24 Apr 2014 23:28:09 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201404242328.s3ONS9ii096855@svn.freebsd.org> From: Brooks Davis Date: Thu, 24 Apr 2014 23:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264904 - head/sys/mips/beri X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 23:28:10 -0000 Author: brooks Date: Thu Apr 24 23:28:09 2014 New Revision: 264904 URL: http://svnweb.freebsd.org/changeset/base/264904 Log: Fix beri_simplebus probing. It's not allowed to have two modules on the same bus with the same name. Tweak the description so it's clear the BERI version attached. Sponsored by: DARPA, AFRL Modified: head/sys/mips/beri/beri_simplebus.c Modified: head/sys/mips/beri/beri_simplebus.c ============================================================================== --- head/sys/mips/beri/beri_simplebus.c Thu Apr 24 23:17:40 2014 (r264903) +++ head/sys/mips/beri/beri_simplebus.c Thu Apr 24 23:28:09 2014 (r264904) @@ -136,9 +136,10 @@ static driver_t simplebus_driver = { devclass_t simplebus_devclass; -DRIVER_MODULE(simplebus, ofwbus, simplebus_driver, simplebus_devclass, 0, 0); -DRIVER_MODULE(simplebus, simplebus, simplebus_driver, simplebus_devclass, 0, +DRIVER_MODULE(beri_simplebus, ofwbus, simplebus_driver, simplebus_devclass, 0, 0); +DRIVER_MODULE(beri_simplebus, simplebus, simplebus_driver, simplebus_devclass, + 0, 0); static int simplebus_probe(device_t dev) @@ -150,7 +151,7 @@ simplebus_probe(device_t dev) if (!ofw_bus_is_compatible(dev, "simple-bus")) return (ENXIO); - device_set_desc(dev, "Flattened device tree simple bus"); + device_set_desc(dev, "Flattened device tree simple bus (BERI version)"); return (BUS_PROBE_SPECIFIC); } From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 23:56:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9B727AE; Thu, 24 Apr 2014 23:56:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94CAA10E4; Thu, 24 Apr 2014 23:56:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3ONuxtA009073; Thu, 24 Apr 2014 23:56:59 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3ONuvej009057; Thu, 24 Apr 2014 23:56:57 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201404242356.s3ONuvej009057@svn.freebsd.org> From: Alan Somers Date: Thu, 24 Apr 2014 23:56:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264905 - in head: sys/net sys/netinet sys/netinet6 tests/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 23:56:59 -0000 Author: asomers Date: Thu Apr 24 23:56:56 2014 New Revision: 264905 URL: http://svnweb.freebsd.org/changeset/base/264905 Log: Fix subnet and default routes on different FIBs on the same subnet. These two bugs are closely related. The root cause is that ifa_ifwithnet does not consider FIBs when searching for an interface address. sys/net/if_var.h sys/net/if.c Add a fib argument to ifa_ifwithnet and ifa_ifwithdstadddr. Those functions will only return an address whose interface fib equals the argument. sys/net/route.c Update calls to ifa_ifwithnet and ifa_ifwithdstaddr with fib arguments. sys/netinet/in.c Update in_addprefix to consider the interface fib when adding prefixes. This will prevent it from not adding a subnet route when one already exists on a different fib. sys/net/rtsock.c sys/netinet/in_pcb.c sys/netinet/ip_output.c sys/netinet/ip_options.c sys/netinet6/nd6.c Add RT_DEFAULT_FIB arguments to ifa_ifwithdstaddr and ifa_ifwithnet. In some cases it there wasn't a clear specific fib number to use. In others, I was unable to test those functions so I chose RT_DEFAULT_FIB to minimize divergence from current behavior. I will fix some of the latter changes along with PR kern/187553. tests/sys/netinet/fibs_test.sh tests/sys/netinet/udp_dontroute.c tests/sys/netinet/Makefile Revert r263738. The udp_dontroute test was right all along. However, bugs kern/187550 and kern/187553 cancelled each other out when it came to this test. Because of kern/187553, ifa_ifwithnet searched the default fib instead of the requested one, but because of kern/187550, there was an applicable subnet route on the default fib. The new test added in r263738 doesn't work right, however. I can verify with dtrace that ifa_ifwithnet returned the wrong address before I applied this commit, but route(8) miraculously found the correct interface to use anyway. I don't know how. Clear expected failure messages for kern/187550 and kern/187552. PR: kern/187550 PR: kern/187552 Reviewed by: melifaro MFC after: 3 weeks Sponsored by: Spectra Logic Added: head/tests/sys/netinet/udp_dontroute.c - copied unchanged from r263737, head/tests/sys/netinet/udp_dontroute.c Modified: head/sys/net/if.c head/sys/net/if_var.h head/sys/net/route.c head/sys/net/rtsock.c head/sys/netinet/in.c head/sys/netinet/in_pcb.c head/sys/netinet/ip_options.c head/sys/netinet/ip_output.c head/sys/netinet6/nd6.c head/tests/sys/netinet/Makefile head/tests/sys/netinet/fibs_test.sh Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Apr 24 23:28:09 2014 (r264904) +++ head/sys/net/if.c Thu Apr 24 23:56:56 2014 (r264905) @@ -1653,7 +1653,7 @@ done: */ /*ARGSUSED*/ struct ifaddr * -ifa_ifwithdstaddr(struct sockaddr *addr) +ifa_ifwithdstaddr(struct sockaddr *addr, int fibnum) { struct ifnet *ifp; struct ifaddr *ifa; @@ -1662,6 +1662,8 @@ ifa_ifwithdstaddr(struct sockaddr *addr) TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if ((ifp->if_flags & IFF_POINTOPOINT) == 0) continue; + if ((ifp->if_fib != fibnum)) + continue; IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != addr->sa_family) @@ -1686,7 +1688,7 @@ done: * is most specific found. */ struct ifaddr * -ifa_ifwithnet(struct sockaddr *addr, int ignore_ptp) +ifa_ifwithnet(struct sockaddr *addr, int ignore_ptp, int fibnum) { struct ifnet *ifp; struct ifaddr *ifa; @@ -1706,12 +1708,14 @@ ifa_ifwithnet(struct sockaddr *addr, int /* * Scan though each interface, looking for ones that have addresses - * in this address family. Maintain a reference on ifa_maybe once - * we find one, as we release the IF_ADDR_RLOCK() that kept it stable - * when we move onto the next interface. + * in this address family and the requested fib. Maintain a reference + * on ifa_maybe once we find one, as we release the IF_ADDR_RLOCK() that + * kept it stable when we move onto the next interface. */ IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { + if (ifp->if_fib != fibnum) + continue; IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { char *cp, *cp2, *cp3; Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Apr 24 23:28:09 2014 (r264904) +++ head/sys/net/if_var.h Thu Apr 24 23:56:56 2014 (r264905) @@ -495,8 +495,8 @@ int ifa_switch_loopback_route(struct ifa struct ifaddr *ifa_ifwithaddr(struct sockaddr *); int ifa_ifwithaddr_check(struct sockaddr *); struct ifaddr *ifa_ifwithbroadaddr(struct sockaddr *); -struct ifaddr *ifa_ifwithdstaddr(struct sockaddr *); -struct ifaddr *ifa_ifwithnet(struct sockaddr *, int); +struct ifaddr *ifa_ifwithdstaddr(struct sockaddr *, int); +struct ifaddr *ifa_ifwithnet(struct sockaddr *, int, int); struct ifaddr *ifa_ifwithroute(int, struct sockaddr *, struct sockaddr *); struct ifaddr *ifa_ifwithroute_fib(int, struct sockaddr *, struct sockaddr *, u_int); struct ifaddr *ifaof_ifpforaddr(struct sockaddr *, struct ifnet *); Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Apr 24 23:28:09 2014 (r264904) +++ head/sys/net/route.c Thu Apr 24 23:56:56 2014 (r264905) @@ -582,7 +582,7 @@ rtredirect_fib(struct sockaddr *dst, } /* verify the gateway is directly reachable */ - if ((ifa = ifa_ifwithnet(gateway, 0)) == NULL) { + if ((ifa = ifa_ifwithnet(gateway, 0, fibnum)) == NULL) { error = ENETUNREACH; goto out; } @@ -739,7 +739,7 @@ ifa_ifwithroute_fib(int flags, struct so */ ifa = NULL; if (flags & RTF_HOST) - ifa = ifa_ifwithdstaddr(dst); + ifa = ifa_ifwithdstaddr(dst, fibnum); if (ifa == NULL) ifa = ifa_ifwithaddr(gateway); } else { @@ -748,10 +748,10 @@ ifa_ifwithroute_fib(int flags, struct so * or host, the gateway may still be on the * other end of a pt to pt link. */ - ifa = ifa_ifwithdstaddr(gateway); + ifa = ifa_ifwithdstaddr(gateway, fibnum); } if (ifa == NULL) - ifa = ifa_ifwithnet(gateway, 0); + ifa = ifa_ifwithnet(gateway, 0, fibnum); if (ifa == NULL) { struct rtentry *rt = rtalloc1_fib(gateway, 0, RTF_RNH_LOCKED, fibnum); if (rt == NULL) @@ -865,7 +865,7 @@ rt_getifa_fib(struct rt_addrinfo *info, */ if (info->rti_ifp == NULL && ifpaddr != NULL && ifpaddr->sa_family == AF_LINK && - (ifa = ifa_ifwithnet(ifpaddr, 0)) != NULL) { + (ifa = ifa_ifwithnet(ifpaddr, 0, fibnum)) != NULL) { info->rti_ifp = ifa->ifa_ifp; ifa_free(ifa); } Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Thu Apr 24 23:28:09 2014 (r264904) +++ head/sys/net/rtsock.c Thu Apr 24 23:56:56 2014 (r264905) @@ -735,7 +735,8 @@ route_output(struct mbuf *m, struct sock rt->rt_ifp->if_type == IFT_PROPVIRTUAL) { struct ifaddr *ifa; - ifa = ifa_ifwithnet(info.rti_info[RTAX_DST], 1); + ifa = ifa_ifwithnet(info.rti_info[RTAX_DST], 1, + RT_DEFAULT_FIB); if (ifa != NULL) rt_maskedcopy(ifa->ifa_addr, &laddr, Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Thu Apr 24 23:28:09 2014 (r264904) +++ head/sys/netinet/in.c Thu Apr 24 23:56:56 2014 (r264905) @@ -617,7 +617,7 @@ in_addprefix(struct in_ifaddr *target, i { struct in_ifaddr *ia; struct in_addr prefix, mask, p, m; - int error, fibnum; + int error; if ((flags & RTF_HOST) != 0) { prefix = target->ia_dstaddr.sin_addr; @@ -628,9 +628,8 @@ in_addprefix(struct in_ifaddr *target, i prefix.s_addr &= mask.s_addr; } - fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : target->ia_ifp->if_fib; - IN_IFADDR_RLOCK(); + /* Look for an existing address with the same prefix, mask, and fib */ TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { if (rtinitflags(ia)) { p = ia->ia_dstaddr.sin_addr; @@ -646,6 +645,8 @@ in_addprefix(struct in_ifaddr *target, i mask.s_addr != m.s_addr) continue; } + if (target->ia_ifp->if_fib != ia->ia_ifp->if_fib) + continue; /* * If we got a matching prefix route inserted by other @@ -664,6 +665,10 @@ in_addprefix(struct in_ifaddr *target, i IN_IFADDR_RUNLOCK(); return (EEXIST); } else { + int fibnum; + + fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : + target->ia_ifp->if_fib; rt_addrmsg(RTM_ADD, &target->ia_ifa, fibnum); IN_IFADDR_RUNLOCK(); return (0); Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu Apr 24 23:28:09 2014 (r264904) +++ head/sys/netinet/in_pcb.c Thu Apr 24 23:56:56 2014 (r264905) @@ -745,9 +745,11 @@ in_pcbladdr(struct inpcb *inp, struct in struct in_ifaddr *ia; struct ifnet *ifp; - ia = ifatoia(ifa_ifwithdstaddr((struct sockaddr *)sin)); + ia = ifatoia(ifa_ifwithdstaddr((struct sockaddr *)sin, + RT_DEFAULT_FIB)); if (ia == NULL) - ia = ifatoia(ifa_ifwithnet((struct sockaddr *)sin, 0)); + ia = ifatoia(ifa_ifwithnet((struct sockaddr *)sin, 0, + RT_DEFAULT_FIB)); if (ia == NULL) { error = ENETUNREACH; goto done; @@ -862,9 +864,10 @@ in_pcbladdr(struct inpcb *inp, struct in sain.sin_len = sizeof(struct sockaddr_in); sain.sin_addr.s_addr = faddr->s_addr; - ia = ifatoia(ifa_ifwithdstaddr(sintosa(&sain))); + ia = ifatoia(ifa_ifwithdstaddr(sintosa(&sain), RT_DEFAULT_FIB)); if (ia == NULL) - ia = ifatoia(ifa_ifwithnet(sintosa(&sain), 0)); + ia = ifatoia(ifa_ifwithnet(sintosa(&sain), 0, + RT_DEFAULT_FIB)); if (ia == NULL) ia = ifatoia(ifa_ifwithaddr(sintosa(&sain))); Modified: head/sys/netinet/ip_options.c ============================================================================== --- head/sys/netinet/ip_options.c Thu Apr 24 23:28:09 2014 (r264904) +++ head/sys/netinet/ip_options.c Thu Apr 24 23:56:56 2014 (r264905) @@ -227,8 +227,11 @@ dropit: if (opt == IPOPT_SSRR) { #define INA struct in_ifaddr * #define SA struct sockaddr * - if ((ia = (INA)ifa_ifwithdstaddr((SA)&ipaddr)) == NULL) - ia = (INA)ifa_ifwithnet((SA)&ipaddr, 0); + if ((ia = (INA)ifa_ifwithdstaddr((SA)&ipaddr, + RT_DEFAULT_FIB)) == NULL) { + ia = (INA)ifa_ifwithnet((SA)&ipaddr, 0, + RT_DEFAULT_FIB); + } } else /* XXX MRT 0 for routing */ ia = ip_rtaddr(ipaddr.sin_addr, M_GETFIB(m)); Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Thu Apr 24 23:28:09 2014 (r264904) +++ head/sys/netinet/ip_output.c Thu Apr 24 23:56:56 2014 (r264905) @@ -230,7 +230,8 @@ again: */ if (flags & IP_SENDONES) { if ((ia = ifatoia(ifa_ifwithbroadaddr(sintosa(dst)))) == NULL && - (ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst)))) == NULL) { + (ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst), + RT_DEFAULT_FIB))) == NULL) { IPSTAT_INC(ips_noroute); error = ENETUNREACH; goto bad; @@ -241,8 +242,10 @@ again: ip->ip_ttl = 1; isbroadcast = 1; } else if (flags & IP_ROUTETOIF) { - if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst)))) == NULL && - (ia = ifatoia(ifa_ifwithnet(sintosa(dst), 0))) == NULL) { + if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst), + RT_DEFAULT_FIB))) == NULL && + (ia = ifatoia(ifa_ifwithnet(sintosa(dst), 0, + RT_DEFAULT_FIB))) == NULL) { IPSTAT_INC(ips_noroute); error = ENETUNREACH; goto bad; Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Thu Apr 24 23:28:09 2014 (r264904) +++ head/sys/netinet6/nd6.c Thu Apr 24 23:56:56 2014 (r264905) @@ -945,7 +945,7 @@ nd6_is_new_addr_neighbor(struct sockaddr * If the address is assigned on the node of the other side of * a p2p interface, the address should be a neighbor. */ - dstaddr = ifa_ifwithdstaddr((struct sockaddr *)addr); + dstaddr = ifa_ifwithdstaddr((struct sockaddr *)addr, RT_DEFAULT_FIB); if (dstaddr != NULL) { if (dstaddr->ifa_ifp == ifp) { ifa_free(dstaddr); Modified: head/tests/sys/netinet/Makefile ============================================================================== --- head/tests/sys/netinet/Makefile Thu Apr 24 23:28:09 2014 (r264904) +++ head/tests/sys/netinet/Makefile Thu Apr 24 23:56:56 2014 (r264905) @@ -1,7 +1,12 @@ # $FreeBSD$ TESTSDIR= ${TESTSBASE}/sys/netinet +BINDIR= ${TESTSDIR} ATF_TESTS_SH+= fibs_test +PROG= udp_dontroute +SRCS= udp_dontroute.c +NO_MAN= +WARNS?= 6 .include Modified: head/tests/sys/netinet/fibs_test.sh ============================================================================== --- head/tests/sys/netinet/fibs_test.sh Thu Apr 24 23:28:09 2014 (r264904) +++ head/tests/sys/netinet/fibs_test.sh Thu Apr 24 23:56:56 2014 (r264905) @@ -175,7 +175,6 @@ default_route_with_multiple_fibs_on_same default_route_with_multiple_fibs_on_same_subnet_body() { - atf_expect_fail "kern/187552 default route uses the wrong interface when multiple interfaces have the same subnet but different fibs" # Configure the TAP interfaces to use a RFC5737 nonrouteable addresses # and a non-default fib ADDR0="192.0.2.2" @@ -225,7 +224,6 @@ subnet_route_with_multiple_fibs_on_same_ subnet_route_with_multiple_fibs_on_same_subnet_body() { - atf_expect_fail "kern/187550 Multiple interfaces on different FIBs but the same subnet don't all have a subnet route" # Configure the TAP interfaces to use a RFC5737 nonrouteable addresses # and a non-default fib ADDR0="192.0.2.2" @@ -253,66 +251,54 @@ subnet_route_with_multiple_fibs_on_same_ cleanup_tap } -# Regression test for kern/187553 "Source address selection for UDP packets -# with SO_DONTROUTE uses the default FIB". The original complaint was that a -# UDP packet with SO_DONTROUTE set would select a source address from an -# interface on the default FIB instead of the process FIB. +# Test that source address selection works correctly for UDP packets with +# SO_DONTROUTE set that are sent on non-default FIBs. # This bug was discovered with "setfib 1 netperf -t UDP_STREAM -H some_host" # Regression test for kern/187553 - +# # The root cause was that ifa_ifwithnet() did not have a fib argument. It # would return an address from an interface on any FIB that had a subnet route # for the destination. If more than one were available, it would choose the -# most specific. The root cause is most easily tested by creating two -# interfaces with overlapping subnet routes, adding a default route to the -# interface with the less specific subnet route, and looking up a host that -# requires the default route using the FIB of the interface with the less -# specific subnet route. "route get" should provide a route that uses the -# interface on the chosen FIB. However, absent the patch for this bug it will -# instead use the other interface. -atf_test_case src_addr_selection_by_subnet cleanup -src_addr_selection_by_subnet_head() +# most specific. This is most easily tested by creating a FIB without a +# default route, then trying to send a UDP packet with SO_DONTROUTE set to an +# address which is not routable on that FIB. Absent the fix for this bug, +# in_pcbladdr would choose an interface on any FIB with a default route. With +# the fix, you will get EUNREACH or ENETUNREACH. +atf_test_case udp_dontroute cleanup +udp_dontroute_head() { atf_set "descr" "Source address selection for UDP packets with SO_DONTROUTE on non-default FIBs works" atf_set "require.user" "root" atf_set "require.config" "fibs" } -src_addr_selection_by_subnet_body() +udp_dontroute_body() { atf_expect_fail "kern/187553 Source address selection for UDP packets with SO_DONTROUTE uses the default FIB" # Configure the TAP interface to use an RFC5737 nonrouteable address # and a non-default fib - ADDR0="192.0.2.2" - ADDR1="192.0.2.3" - GATEWAY0="192.0.2.1" - TARGET="192.0.2.128" + ADDR="192.0.2.2" SUBNET="192.0.2.0" - MASK0="25" - MASK1="26" + MASK="24" + # Use a different IP on the same subnet as the target + TARGET="192.0.2.100" # Check system configuration if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then atf_skip "This test requires net.add_addr_allfibs=0" fi - get_fibs 2 + get_fibs 1 # Configure a TAP interface - setup_tap ${FIB0} ${ADDR0} ${MASK0} - TAP0=${TAP} - setup_tap ${FIB1} ${ADDR1} ${MASK1} - TAP1=${TAP} - - # Add a gateway to the interface with the less specific subnet route - setfib ${FIB0} route add default ${GATEWAY0} + setup_tap ${FIB0} ${ADDR} ${MASK} - # Lookup a route - echo "Looking up route to ${TARGET} with fib ${FIB0}" - echo "Expected behavior is to use interface ${TAP0}" - atf_check -o match:"interface:.${TAP0}" setfib ${FIB0} route -n get ${TARGET} + # Send a UDP packet with SO_DONTROUTE. In the failure case, it will + # return ENETUNREACH + SRCDIR=`atf_get_srcdir` + atf_check -o ignore setfib ${FIB0} ${SRCDIR}/udp_dontroute ${TARGET} } -src_addr_selection_by_subnet_cleanup() +udp_dontroute_cleanup() { cleanup_tap } @@ -324,7 +310,7 @@ atf_init_test_cases() atf_add_test_case loopback_and_network_routes_on_nondefault_fib atf_add_test_case default_route_with_multiple_fibs_on_same_subnet atf_add_test_case subnet_route_with_multiple_fibs_on_same_subnet - atf_add_test_case src_addr_selection_by_subnet + atf_add_test_case udp_dontroute } # Looks up one or more fibs from the configuration data and validates them. Copied: head/tests/sys/netinet/udp_dontroute.c (from r263737, head/tests/sys/netinet/udp_dontroute.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netinet/udp_dontroute.c Thu Apr 24 23:56:56 2014 (r264905, copy of r263737, head/tests/sys/netinet/udp_dontroute.c) @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2014 Spectra Logic Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * Authors: Alan Somers (Spectra Logic Corporation) + * + * $FreeBSD$ + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +/* + * Sends a single UDP packet to the provided address, with SO_DONTROUTE set + * I couldn't find a way to do this with builtin utilities like nc(1) + */ +int main(int argc, char **argv) +{ + struct sockaddr_in dst; + int s; + int opt; + int ret; + const char* buf = "Hello, World!"; + + if (argc != 2) { + fprintf(stderr, "Usage: %s ip_address\n", argv[0]); + exit(2); + } + s = socket(PF_INET, SOCK_DGRAM, 0); + if (s < 0) + err(errno, "socket"); + opt = 1; + + ret = setsockopt(s, SOL_SOCKET, SO_DONTROUTE, &opt, sizeof(opt)); + if (ret == -1) + err(errno, "setsockopt(SO_DONTROUTE)"); + + dst.sin_len = sizeof(dst); + dst.sin_family = AF_INET; + dst.sin_port = htons(46120); + dst.sin_addr.s_addr = inet_addr(argv[1]); + if (dst.sin_addr.s_addr == htonl(INADDR_NONE)) { + fprintf(stderr, "Invalid address: %s\n", argv[1]); + exit(2); + } + ret = sendto(s, buf, strlen(buf), 0, (struct sockaddr*)&dst, + dst.sin_len); + if (ret == -1) + err(errno, "sendto"); + + return (0); +} From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 01:20:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70CD15F7; Fri, 25 Apr 2014 01:20:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43DC317A6; Fri, 25 Apr 2014 01:20:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3P1KBtV043436; Fri, 25 Apr 2014 01:20:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3P1KBAt043435; Fri, 25 Apr 2014 01:20:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404250120.s3P1KBAt043435@svn.freebsd.org> From: Adrian Chadd Date: Fri, 25 Apr 2014 01:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264906 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 01:20:11 -0000 Author: adrian Date: Fri Apr 25 01:20:10 2014 New Revision: 264906 URL: http://svnweb.freebsd.org/changeset/base/264906 Log: Add a SLEEP->SCAN transition. Without this a disassociate or scan request during SLEEP results in a hang. Whilst I'm here, add in some disabled code that will transition to RUN if there's multicast traffic. It's not needed for Atheros hardware but it may be for other hardware. Tested: * AR5416, STA mode (powersave) * AR5212, STA mode (powersave) Modified: head/sys/net80211/ieee80211_sta.c Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Thu Apr 24 23:56:56 2014 (r264905) +++ head/sys/net80211/ieee80211_sta.c Fri Apr 25 01:20:10 2014 (r264906) @@ -300,12 +300,18 @@ sta_newstate(struct ieee80211vap *vap, e if (vap->iv_roaming == IEEE80211_ROAMING_AUTO) ieee80211_check_scan_current(vap); break; + case IEEE80211_S_SLEEP: /* beacon miss */ + /* + * XXX if in sleep we need to wakeup the hardware. + */ + /* FALLTHROUGH */ case IEEE80211_S_RUN: /* beacon miss */ /* * Beacon miss. Notify user space and if not * under control of a user application (roaming * manual) kick off a scan to re-connect. */ + ieee80211_sta_leave(ni); if (vap->iv_roaming == IEEE80211_ROAMING_AUTO) ieee80211_check_scan_current(vap); @@ -1417,19 +1423,12 @@ sta_recv_mgmt(struct ieee80211_node *ni, * for the multicast bit being set. */ #if 0 - if ((tim->tim_bitctl & 1) || - (min <= ix && ix <= max && - isset(tim->tim_bitmap - min, aid))) { - /* - * XXX Do not let bg scan kick off - * we are expecting data. - */ + if (tim->tim_bitctl & 1) { ieee80211_sta_tim_notify(vap, 1); ic->ic_lastdata = ticks; - // XXX not yet? -// vap->iv_sta_ps(vap, 0); } #endif + ni->ni_dtim_count = tim->tim_count; ni->ni_dtim_period = tim->tim_period; } From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 01:38:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD790A02; Fri, 25 Apr 2014 01:38:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9C5F1951; Fri, 25 Apr 2014 01:38:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3P1cvSF050582; Fri, 25 Apr 2014 01:38:57 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3P1cvHn050580; Fri, 25 Apr 2014 01:38:57 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404250138.s3P1cvHn050580@svn.freebsd.org> From: Glen Barber Date: Fri, 25 Apr 2014 01:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264907 - in head/release: amd64 i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 01:38:57 -0000 Author: gjb Date: Fri Apr 25 01:38:57 2014 New Revision: 264907 URL: http://svnweb.freebsd.org/changeset/base/264907 Log: Refactor make-memstick.sh to avoid creating the 'dangerously dedicated' partition scheme, reported to cause the memstick.img to fail to boot. Similar to how make-memstick.sh worked on stable/8, use makefs(8) to create the actual filesystem. Then calculate the size of the resulting image file, create the GPT partition scheme, then dd(1) the filesystem created with makefs(8) to the freebsd-ufs GPT partition. This was tested on a known-working machine[1] for regression, and a known-not-working machine[2] to ensure the boot issue has been resolved. Testers: myself [1], db [2] MFC After: 1 week Sponsored by: The FreeBSD Foundation Modified: head/release/amd64/make-memstick.sh head/release/i386/make-memstick.sh Modified: head/release/amd64/make-memstick.sh ============================================================================== --- head/release/amd64/make-memstick.sh Fri Apr 25 01:20:10 2014 (r264906) +++ head/release/amd64/make-memstick.sh Fri Apr 25 01:38:57 2014 (r264907) @@ -3,7 +3,7 @@ # This script generates a "memstick image" (image that can be copied to a # USB memory stick) from a directory tree. Note that the script does not # clean up after itself very well for error conditions on purpose so the -# problem can be diagnosed (full filesystem most likely but ...). +# problem can be diagnosed. # # Usage: make-memstick.sh # @@ -13,11 +13,15 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH +BLOCKSIZE=10240 + if [ $# -ne 2 ]; then echo "make-memstick.sh /path/to/directory /path/to/image/file" exit 1 fi +tempfile="${2}.$$" + if [ ! -d ${1} ]; then echo "${1} must be a directory" exit 1 @@ -28,21 +32,62 @@ if [ -e ${2} ]; then exit 1 fi -echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab -makefs -B little -o label=FreeBSD_Install ${2} ${1} +rm -f ${tempfile} +echo "/dev/gpt/rootfs / ufs ro,noatime 1 1" > ${1}/etc/fstab +makefs ${tempfile} ${1} if [ $? -ne 0 ]; then echo "makefs failed" exit 1 fi rm ${1}/etc/fstab +# +# Use $BLOCKSIZE for transfers to improve efficiency. When calculating +# how many blocks to transfer "+ 520" is to account for truncation in the +# division and to provide ample padding. +# + +filesize=`stat -f "%z" ${tempfile}` +blocks=$(($filesize / ${BLOCKSIZE} + 520 )) +dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks} +if [ $? -ne 0 ]; then + echo "creation of image file failed" + exit 1 +fi + unit=`mdconfig -a -t vnode -f ${2}` if [ $? -ne 0 ]; then echo "mdconfig failed" exit 1 fi -gpart create -s BSD ${unit} -gpart bootcode -b ${1}/boot/boot ${unit} -gpart add -t freebsd-ufs ${unit} + +gpart create -s gpt /dev/${unit} +if [ $? -ne 0 ]; then + echo "GPT creation failed" + exit 1 +fi +gpart add -t freebsd-boot -s 512k /dev/${unit} +if [ $? -ne 0 ]; then + echo "Creating boot partition failed" + exit 1 +fi +gpart bootcode -b ${1}/boot/pmbr -p ${1}/boot/gptboot -i 1 /dev/${unit} +if [ $? -ne 0 ]; then + echo "Writing bootcode failed" + exit 1 +fi +gpart add -t freebsd-ufs -l rootfs /dev/${unit} +if [ $? -ne 0 ]; then + echo "Creating UFS partition failed" + exit 1 +fi + +dd if=${tempfile} of=/dev/${unit}p2 bs=$BLOCKSIZE conv=sync +if [ $? -ne 0 ]; then + echo "copying filesystem into image file failed" + exit 1 +fi + mdconfig -d -u ${unit} +rm -f ${tempfile} Modified: head/release/i386/make-memstick.sh ============================================================================== --- head/release/i386/make-memstick.sh Fri Apr 25 01:20:10 2014 (r264906) +++ head/release/i386/make-memstick.sh Fri Apr 25 01:38:57 2014 (r264907) @@ -3,7 +3,7 @@ # This script generates a "memstick image" (image that can be copied to a # USB memory stick) from a directory tree. Note that the script does not # clean up after itself very well for error conditions on purpose so the -# problem can be diagnosed (full filesystem most likely but ...). +# problem can be diagnosed. # # Usage: make-memstick.sh # @@ -13,11 +13,15 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH +BLOCKSIZE=10240 + if [ $# -ne 2 ]; then echo "make-memstick.sh /path/to/directory /path/to/image/file" exit 1 fi +tempfile="${2}.$$" + if [ ! -d ${1} ]; then echo "${1} must be a directory" exit 1 @@ -28,21 +32,62 @@ if [ -e ${2} ]; then exit 1 fi -echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab -makefs -B little -o label=FreeBSD_Install ${2} ${1} +rm -f ${tempfile} +echo "/dev/gpt/rootfs / ufs ro,noatime 1 1" > ${1}/etc/fstab +makefs ${tempfile} ${1} if [ $? -ne 0 ]; then echo "makefs failed" exit 1 fi rm ${1}/etc/fstab +# +# Use $BLOCKSIZE for transfers to improve efficiency. When calculating +# how many blocks to transfer "+ 520" is to account for truncation in the +# division and to provide ample padding. +# + +filesize=`stat -f "%z" ${tempfile}` +blocks=$(($filesize / ${BLOCKSIZE} + 520 )) +dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks} +if [ $? -ne 0 ]; then + echo "creation of image file failed" + exit 1 +fi + unit=`mdconfig -a -t vnode -f ${2}` if [ $? -ne 0 ]; then echo "mdconfig failed" exit 1 fi -gpart create -s BSD ${unit} -gpart bootcode -b ${1}/boot/boot ${unit} -gpart add -t freebsd-ufs ${unit} + +gpart create -s gpt /dev/${unit} +if [ $? -ne 0 ]; then + echo "GPT creation failed" + exit 1 +fi +gpart add -t freebsd-boot -s 512k /dev/${unit} +if [ $? -ne 0 ]; then + echo "Creating boot partition failed" + exit 1 +fi +gpart bootcode -b ${1}/boot/pmbr -p ${1}/boot/gptboot -i 1 /dev/${unit} +if [ $? -ne 0 ]; then + echo "Writing bootcode failed" + exit 1 +fi +gpart add -t freebsd-ufs -l rootfs /dev/${unit} +if [ $? -ne 0 ]; then + echo "Creating UFS partition failed" + exit 1 +fi + +dd if=${tempfile} of=/dev/${unit}p2 bs=$BLOCKSIZE conv=sync +if [ $? -ne 0 ]; then + echo "copying filesystem into image file failed" + exit 1 +fi + mdconfig -d -u ${unit} +rm -f ${tempfile} From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 01:55:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2B34D00; Fri, 25 Apr 2014 01:55:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A35701AE5; Fri, 25 Apr 2014 01:55:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3P1tFjY058248; Fri, 25 Apr 2014 01:55:15 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3P1tFQL058246; Fri, 25 Apr 2014 01:55:15 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404250155.s3P1tFQL058246@svn.freebsd.org> From: Glen Barber Date: Fri, 25 Apr 2014 01:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264908 - in head/release: amd64 i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 01:55:15 -0000 Author: gjb Date: Fri Apr 25 01:55:14 2014 New Revision: 264908 URL: http://svnweb.freebsd.org/changeset/base/264908 Log: Style cleanup - Indent 1 full tab where needed - Use $() for shell exec - Insert a space between '$(( ))' parens MFC After: 1 week X-MFC-With: r264907 Sponsored by: The FreeBSD Foundation Modified: head/release/amd64/make-memstick.sh head/release/i386/make-memstick.sh Modified: head/release/amd64/make-memstick.sh ============================================================================== --- head/release/amd64/make-memstick.sh Fri Apr 25 01:38:57 2014 (r264907) +++ head/release/amd64/make-memstick.sh Fri Apr 25 01:55:14 2014 (r264908) @@ -16,28 +16,28 @@ export PATH BLOCKSIZE=10240 if [ $# -ne 2 ]; then - echo "make-memstick.sh /path/to/directory /path/to/image/file" - exit 1 + echo "make-memstick.sh /path/to/directory /path/to/image/file" + exit 1 fi tempfile="${2}.$$" if [ ! -d ${1} ]; then - echo "${1} must be a directory" - exit 1 + echo "${1} must be a directory" + exit 1 fi if [ -e ${2} ]; then - echo "won't overwrite ${2}" - exit 1 + echo "won't overwrite ${2}" + exit 1 fi rm -f ${tempfile} echo "/dev/gpt/rootfs / ufs ro,noatime 1 1" > ${1}/etc/fstab makefs ${tempfile} ${1} if [ $? -ne 0 ]; then - echo "makefs failed" - exit 1 + echo "makefs failed" + exit 1 fi rm ${1}/etc/fstab @@ -47,45 +47,45 @@ rm ${1}/etc/fstab # division and to provide ample padding. # -filesize=`stat -f "%z" ${tempfile}` -blocks=$(($filesize / ${BLOCKSIZE} + 520 )) +filesize=$(stat -f "%z" ${tempfile}) +blocks=$(( ${filesize} / ${BLOCKSIZE} + 520 )) dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks} if [ $? -ne 0 ]; then - echo "creation of image file failed" - exit 1 + echo "creation of image file failed" + exit 1 fi unit=`mdconfig -a -t vnode -f ${2}` if [ $? -ne 0 ]; then - echo "mdconfig failed" - exit 1 + echo "mdconfig failed" + exit 1 fi gpart create -s gpt /dev/${unit} if [ $? -ne 0 ]; then - echo "GPT creation failed" - exit 1 + echo "GPT creation failed" + exit 1 fi gpart add -t freebsd-boot -s 512k /dev/${unit} if [ $? -ne 0 ]; then - echo "Creating boot partition failed" - exit 1 + echo "Creating boot partition failed" + exit 1 fi gpart bootcode -b ${1}/boot/pmbr -p ${1}/boot/gptboot -i 1 /dev/${unit} if [ $? -ne 0 ]; then - echo "Writing bootcode failed" - exit 1 + echo "Writing bootcode failed" + exit 1 fi gpart add -t freebsd-ufs -l rootfs /dev/${unit} if [ $? -ne 0 ]; then - echo "Creating UFS partition failed" - exit 1 + echo "Creating UFS partition failed" + exit 1 fi dd if=${tempfile} of=/dev/${unit}p2 bs=$BLOCKSIZE conv=sync if [ $? -ne 0 ]; then - echo "copying filesystem into image file failed" - exit 1 + echo "copying filesystem into image file failed" + exit 1 fi mdconfig -d -u ${unit} Modified: head/release/i386/make-memstick.sh ============================================================================== --- head/release/i386/make-memstick.sh Fri Apr 25 01:38:57 2014 (r264907) +++ head/release/i386/make-memstick.sh Fri Apr 25 01:55:14 2014 (r264908) @@ -16,28 +16,28 @@ export PATH BLOCKSIZE=10240 if [ $# -ne 2 ]; then - echo "make-memstick.sh /path/to/directory /path/to/image/file" - exit 1 + echo "make-memstick.sh /path/to/directory /path/to/image/file" + exit 1 fi tempfile="${2}.$$" if [ ! -d ${1} ]; then - echo "${1} must be a directory" - exit 1 + echo "${1} must be a directory" + exit 1 fi if [ -e ${2} ]; then - echo "won't overwrite ${2}" - exit 1 + echo "won't overwrite ${2}" + exit 1 fi rm -f ${tempfile} echo "/dev/gpt/rootfs / ufs ro,noatime 1 1" > ${1}/etc/fstab makefs ${tempfile} ${1} if [ $? -ne 0 ]; then - echo "makefs failed" - exit 1 + echo "makefs failed" + exit 1 fi rm ${1}/etc/fstab @@ -47,45 +47,45 @@ rm ${1}/etc/fstab # division and to provide ample padding. # -filesize=`stat -f "%z" ${tempfile}` -blocks=$(($filesize / ${BLOCKSIZE} + 520 )) +filesize=$(stat -f "%z" ${tempfile}) +blocks=$(( ${filesize} / ${BLOCKSIZE} + 520 )) dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks} if [ $? -ne 0 ]; then - echo "creation of image file failed" - exit 1 + echo "creation of image file failed" + exit 1 fi unit=`mdconfig -a -t vnode -f ${2}` if [ $? -ne 0 ]; then - echo "mdconfig failed" - exit 1 + echo "mdconfig failed" + exit 1 fi gpart create -s gpt /dev/${unit} if [ $? -ne 0 ]; then - echo "GPT creation failed" - exit 1 + echo "GPT creation failed" + exit 1 fi gpart add -t freebsd-boot -s 512k /dev/${unit} if [ $? -ne 0 ]; then - echo "Creating boot partition failed" - exit 1 + echo "Creating boot partition failed" + exit 1 fi gpart bootcode -b ${1}/boot/pmbr -p ${1}/boot/gptboot -i 1 /dev/${unit} if [ $? -ne 0 ]; then - echo "Writing bootcode failed" - exit 1 + echo "Writing bootcode failed" + exit 1 fi gpart add -t freebsd-ufs -l rootfs /dev/${unit} if [ $? -ne 0 ]; then - echo "Creating UFS partition failed" - exit 1 + echo "Creating UFS partition failed" + exit 1 fi dd if=${tempfile} of=/dev/${unit}p2 bs=$BLOCKSIZE conv=sync if [ $? -ne 0 ]; then - echo "copying filesystem into image file failed" - exit 1 + echo "copying filesystem into image file failed" + exit 1 fi mdconfig -d -u ${unit} From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 02:20:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A51F1AA; Fri, 25 Apr 2014 02:20:03 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 69CCE1CF1; Fri, 25 Apr 2014 02:20:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 1CC8638056; Thu, 24 Apr 2014 21:12:12 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id R6NwPOP8Ztp5; Thu, 24 Apr 2014 21:12:12 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 8205B38054; Thu, 24 Apr 2014 21:12:11 -0500 (CDT) Message-ID: <5359C47A.4060609@freebsd.org> Date: Thu, 24 Apr 2014 19:12:10 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Glen Barber , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r264907 - in head/release: amd64 i386 References: <201404250138.s3P1cvHn050580@svn.freebsd.org> In-Reply-To: <201404250138.s3P1cvHn050580@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 02:20:03 -0000 On 04/24/14 18:38, Glen Barber wrote: > Author: gjb > Date: Fri Apr 25 01:38:57 2014 > New Revision: 264907 > URL: http://svnweb.freebsd.org/changeset/base/264907 > > Log: > Refactor make-memstick.sh to avoid creating the 'dangerously > dedicated' partition scheme, reported to cause the memstick.img > to fail to boot. > > Similar to how make-memstick.sh worked on stable/8, use makefs(8) > to create the actual filesystem. Then calculate the size of the > resulting image file, create the GPT partition scheme, then dd(1) > the filesystem created with makefs(8) to the freebsd-ufs GPT > partition. > > This was tested on a known-working machine[1] for regression, and > a known-not-working machine[2] to ensure the boot issue has been > resolved. > > GPT may not be the best choice here. On a number of, in particular, Lenovo hardware, the BIOS will unconditionally boot with EFI from GPT media. I'm not sure we want to just swap the set of machines on which this will not boot. It probably needs to be nested MBR (or straight MBR -- I forget if that works) until the boot media work with EFI (which should be soon on -CURRENT). -Nathan From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 02:26:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97D93384; Fri, 25 Apr 2014 02:26:32 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail0.glenbarber.us", Issuer "Gandi Standard SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64A041D99; Fri, 25 Apr 2014 02:26:32 +0000 (UTC) Received: from glenbarber.us (c-71-224-221-174.hsd1.nj.comcast.net [71.224.221.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 973DB5454; Fri, 25 Apr 2014 02:26:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 973DB5454 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Thu, 24 Apr 2014 22:26:29 -0400 From: Glen Barber To: Nathan Whitehorn Subject: Re: svn commit: r264907 - in head/release: amd64 i386 Message-ID: <20140425022629.GL49791@glenbarber.us> References: <201404250138.s3P1cvHn050580@svn.freebsd.org> <5359C47A.4060609@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="YXgUkCSfyvNdAU1Z" Content-Disposition: inline In-Reply-To: <5359C47A.4060609@freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 02:26:32 -0000 --YXgUkCSfyvNdAU1Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 24, 2014 at 07:12:10PM -0700, Nathan Whitehorn wrote: > On 04/24/14 18:38, Glen Barber wrote: > >Author: gjb > >Date: Fri Apr 25 01:38:57 2014 > >New Revision: 264907 > >URL: http://svnweb.freebsd.org/changeset/base/264907 > > > >Log: > > Refactor make-memstick.sh to avoid creating the 'dangerously > > dedicated' partition scheme, reported to cause the memstick.img > > to fail to boot. > > Similar to how make-memstick.sh worked on stable/8, use makefs(8) > > to create the actual filesystem. Then calculate the size of the > > resulting image file, create the GPT partition scheme, then dd(1) > > the filesystem created with makefs(8) to the freebsd-ufs GPT > > partition. > > This was tested on a known-working machine[1] for regression, and > > a known-not-working machine[2] to ensure the boot issue has been > > resolved. > > >=20 > GPT may not be the best choice here. On a number of, in particular, Lenovo > hardware, the BIOS will unconditionally boot with EFI from GPT media. I'm > not sure we want to just swap the set of machines on which this will not > boot. It probably needs to be nested MBR (or straight MBR -- I forget if > that works) until the boot media work with EFI (which should be soon on > -CURRENT). Noted. The thing here is that I want to get an EFI GPT partition on the image eventually, which unless I'm missing something obvious, we cannot mix GPT and MBR. I don't particularly like swapping which machines boot with this hack. Maybe it's time to do a MBR stick for "legacy" boot, and the GPT stick for UEFI and/or "fails-to-boot-DD" case? Glen --YXgUkCSfyvNdAU1Z Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTWcfVAAoJELls3eqvi17QLHoQAIr+U/o2qP7lrcPP9Q4EJpN2 necYGL+jwA3/0VBwGZNVFVIAWMHsP+TqofBO89GNwMVMyLMvr/Ay7s+HRbBJoWSD Cg8QSU//iE2YeVBdOo2ERJ44vZgPyZLr0kOCvIsls6iUiK9fJ497lM1dYFhl1Mpb 5GWando77FsQrw3MDVoaVtG5p02dAqYI6XCT3BEWORYQhoPeVeb0+oXu9uaDaeYp YxhT/MD5BfipQNfEoJK00KDaAWTlETuaOuhiS7dPA5/WjZB/yiIyUdK1U0xC/PFX Y7HZF7iF6fPPJIR7UG0cd4hCSD9ykAreom7IRfY/K9d6ho0TcqfO10QwE3lCjQR0 VC5I6FRh6AywvMvCKKndBRx0brgnZ4jUNuekhHLs5owbK2RttSPd2ZpGPNgVvFuB rT3p8b7Aceaqi5nNckO/Y/L4USZKxmVNBcGFadPQByztE6SzePJXPqDWmQDgeIIs mhVizT6ChCAbaSvWk6swfzEMgAlN6GL2lcRKb7BuALUHCapPM38YdfrH0idslns4 WrFMMBSK15VmZX5f0p6QSTbG8Rr1SSkiCbOMMG2ElI+q+ZbI2lL1KqLhfiOixQup dYWmAqMHcFENeFR6rNz3T4TjYneOTZefs1Mfhbt6v6N9LscKCA/Ls71VIjnWp3PY roRqSfaC/SMAGoqr/1gC =9aOS -----END PGP SIGNATURE----- --YXgUkCSfyvNdAU1Z-- From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 02:29:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B70F545; Fri, 25 Apr 2014 02:29:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E4721DBE; Fri, 25 Apr 2014 02:29:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3P2TU6g070801; Fri, 25 Apr 2014 02:29:30 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3P2TURC070800; Fri, 25 Apr 2014 02:29:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404250229.s3P2TURC070800@svn.freebsd.org> From: Warner Losh Date: Fri, 25 Apr 2014 02:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264909 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 02:29:30 -0000 Author: imp Date: Fri Apr 25 02:29:29 2014 New Revision: 264909 URL: http://svnweb.freebsd.org/changeset/base/264909 Log: Put my inner hobgoblin on a leash: These routines, at least, needed to be {} so they don't run in a subshell. Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri Apr 25 01:55:14 2014 (r264908) +++ head/tools/tools/nanobsd/nanobsd.sh Fri Apr 25 02:29:29 2014 (r264909) @@ -650,14 +650,14 @@ last_orders () ( # Common Flash device geometries # -FlashDevice () ( +FlashDevice () { if [ -d ${NANO_TOOLS} ] ; then . ${NANO_TOOLS}/FlashDevice.sub else . ${NANO_SRC}/${NANO_TOOLS}/FlashDevice.sub fi sub_FlashDevice $1 $2 -) +} ####################################################################### # USB device geometries @@ -679,7 +679,7 @@ FlashDevice () ( # The generic-hdd device is preferred for flash devices larger than 1GB. # -UsbDevice () ( +UsbDevice () { a1=`echo $1 | tr '[:upper:]' '[:lower:]'` case $a1 in generic-fdd) @@ -697,7 +697,7 @@ UsbDevice () ( exit 2 ;; esac -) +} ####################################################################### # Setup serial console @@ -849,18 +849,18 @@ cust_pkgng () ( # Convenience function: # Register all args as customize function. -customize_cmd () ( +customize_cmd () { NANO_CUSTOMIZE="$NANO_CUSTOMIZE $*" -) +} ####################################################################### # Convenience function: # Register all args as late customize function to run just before # image creation. -late_customize_cmd () ( +late_customize_cmd () { NANO_LATE_CUSTOMIZE="$NANO_LATE_CUSTOMIZE $*" -) +} ####################################################################### # @@ -877,7 +877,7 @@ pprint() ( fi ) -usage () ( +usage () { ( echo "Usage: $0 [-bfiknqvw] [-c config_file]" echo " -b suppress builds (both kernel and world)" @@ -891,7 +891,7 @@ usage () ( echo " -c specify config file" ) 1>&2 exit 2 -) +} ####################################################################### # Parse arguments From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 04:01:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34E6762B; Fri, 25 Apr 2014 04:01:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 228BE1771; Fri, 25 Apr 2014 04:01:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3P41Pvx009611; Fri, 25 Apr 2014 04:01:25 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3P41Pw7009609; Fri, 25 Apr 2014 04:01:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404250401.s3P41Pw7009609@svn.freebsd.org> From: Xin LI Date: Fri, 25 Apr 2014 04:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264910 - head/usr.bin/hexdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 04:01:26 -0000 Author: delphij Date: Fri Apr 25 04:01:25 2014 New Revision: 264910 URL: http://svnweb.freebsd.org/changeset/base/264910 Log: Constify. Modified: head/usr.bin/hexdump/hexdump.h head/usr.bin/hexdump/parse.c Modified: head/usr.bin/hexdump/hexdump.h ============================================================================== --- head/usr.bin/hexdump/hexdump.h Fri Apr 25 02:29:29 2014 (r264909) +++ head/usr.bin/hexdump/hexdump.h Fri Apr 25 04:01:25 2014 (r264910) @@ -82,9 +82,9 @@ enum _vflag { ALL, DUP, FIRST, WAIT }; / extern enum _vflag vflag; void add(const char *); -void addfile(char *); -void badcnt(char *); -void badconv(char *); +void addfile(const char *); +void badcnt(const char *); +void badconv(const char *); void badfmt(const char *); void badsfmt(void); void bpad(PR *); Modified: head/usr.bin/hexdump/parse.c ============================================================================== --- head/usr.bin/hexdump/parse.c Fri Apr 25 02:29:29 2014 (r264909) +++ head/usr.bin/hexdump/parse.c Fri Apr 25 04:01:25 2014 (r264910) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); FU *endfu; /* format at end-of-data */ void -addfile(char *name) +addfile(const char *name) { unsigned char *p; FILE *fp; @@ -491,7 +491,7 @@ escape(char *p1) } void -badcnt(char *s) +badcnt(const char *s) { errx(1, "%s: bad byte count", s); } @@ -509,7 +509,7 @@ badfmt(const char *fmt) } void -badconv(char *ch) +badconv(const char *ch) { errx(1, "%%%s: bad conversion character", ch); } From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 05:26:20 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70C42276; Fri, 25 Apr 2014 05:26:20 +0000 (UTC) Received: from gw.catspoiler.org (gw.catspoiler.org [75.1.14.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CFB61E59; Fri, 25 Apr 2014 05:26:19 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s3P5Q3hS010626; Thu, 24 Apr 2014 22:26:07 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201404250526.s3P5Q3hS010626@gw.catspoiler.org> Date: Thu, 24 Apr 2014 22:26:03 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r264907 - in head/release: amd64 i386 To: gjb@FreeBSD.org In-Reply-To: <20140425022629.GL49791@glenbarber.us> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, nwhitehorn@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 05:26:20 -0000 On 24 Apr, Glen Barber wrote: > On Thu, Apr 24, 2014 at 07:12:10PM -0700, Nathan Whitehorn wrote: >> On 04/24/14 18:38, Glen Barber wrote: >> >Author: gjb >> >Date: Fri Apr 25 01:38:57 2014 >> >New Revision: 264907 >> >URL: http://svnweb.freebsd.org/changeset/base/264907 >> > >> >Log: >> > Refactor make-memstick.sh to avoid creating the 'dangerously >> > dedicated' partition scheme, reported to cause the memstick.img >> > to fail to boot. >> > Similar to how make-memstick.sh worked on stable/8, use makefs(8) >> > to create the actual filesystem. Then calculate the size of the >> > resulting image file, create the GPT partition scheme, then dd(1) >> > the filesystem created with makefs(8) to the freebsd-ufs GPT >> > partition. >> > This was tested on a known-working machine[1] for regression, and >> > a known-not-working machine[2] to ensure the boot issue has been >> > resolved. >> > >> >> GPT may not be the best choice here. On a number of, in particular, Lenovo >> hardware, the BIOS will unconditionally boot with EFI from GPT media. I'm >> not sure we want to just swap the set of machines on which this will not >> boot. It probably needs to be nested MBR (or straight MBR -- I forget if >> that works) until the boot media work with EFI (which should be soon on >> -CURRENT). > > Noted. The thing here is that I want to get an EFI GPT partition on the > image eventually, which unless I'm missing something obvious, we cannot > mix GPT and MBR. > > I don't particularly like swapping which machines boot with this hack. > Maybe it's time to do a MBR stick for "legacy" boot, and the GPT stick > for UEFI and/or "fails-to-boot-DD" case? I've got a fairly recent Gigabyte motherboard that refused to boot an Ultimate Boot CD memstick which uses MBR. I found out that I was was able to boot and install from a 'dangerously dedicated' FreeBSD 9.x memstick. Given that clue, I built a 'dangerously dedicated' Ultimate Boot CD memstick, which worked just fine. From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 08:01:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9BB1CC2F; Fri, 25 Apr 2014 08:01:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84FE71CFA; Fri, 25 Apr 2014 08:01:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3P81NMk008714; Fri, 25 Apr 2014 08:01:23 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3P81ME1008705; Fri, 25 Apr 2014 08:01:22 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201404250801.s3P81ME1008705@svn.freebsd.org> From: Kevin Lo Date: Fri, 25 Apr 2014 08:01:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264912 - in head: share/man/man4 sys/conf sys/contrib/dev/urtwn sys/dev/usb sys/dev/usb/wlan sys/modules/usb/urtwnfw sys/modules/usb/urtwnfw/urtwnrtl8188eu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 08:01:23 -0000 Author: kevlo Date: Fri Apr 25 08:01:22 2014 New Revision: 264912 URL: http://svnweb.freebsd.org/changeset/base/264912 Log: Add preliminary support for the Realtek RTL8188EUS and RTL8188ETV chipsets. Committed over the TP-LINK TL-WN725N v2 (RTL8188EUS) on amd64 with WPA. Added: head/sys/contrib/dev/urtwn/urtwn-rtl8188eufw.fw.uu head/sys/modules/usb/urtwnfw/urtwnrtl8188eu/ head/sys/modules/usb/urtwnfw/urtwnrtl8188eu/Makefile (contents, props changed) Modified: head/share/man/man4/urtwn.4 head/share/man/man4/urtwnfw.4 head/sys/conf/files head/sys/dev/usb/usbdevs head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnreg.h head/sys/modules/usb/urtwnfw/Makefile Modified: head/share/man/man4/urtwn.4 ============================================================================== --- head/share/man/man4/urtwn.4 Fri Apr 25 04:49:27 2014 (r264911) +++ head/share/man/man4/urtwn.4 Fri Apr 25 08:01:22 2014 (r264912) @@ -14,12 +14,12 @@ .\" .\" $FreeBSD$ .\" -.Dd October 31, 2013 +.Dd April 25, 2014 .Dt URTWN 4 .Os .Sh NAME .Nm urtwn -.Nd Realtek RTL8188CU/RTL8192CU USB IEEE 802.11b/g/n wireless network device +.Nd Realtek RTL8188CU/RTL8188EU/RTL8192CU USB IEEE 802.11b/g/n wireless network device .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -50,11 +50,11 @@ legal.realtek.license_ack=1 The .Nm driver supports USB 2.0 wireless network devices based on Realtek -RTL8188CUS, RTL8188CE-VAU, RTL8188RU and RTL8192CU chipsets. +RTL8188CUS, RTL8188CE-VAU, RTL8188EUS, RTL8188RU and RTL8192CU chipsets. .Pp -The RTL8188CUS is a highly integrated 802.11n adapter that combines -a MAC, a 1T1R capable baseband and an RF in a single chip. -It operates in the 2GHz spectrum only. +The RTL8188CUS and RTL8188EUS are highly integrated 802.11n adapter that +combine a MAC, a 1T1R capable baseband and an RF in a single chip. +They operate in the 2GHz spectrum only. The RTL8188RU is a high-power variant of the RTL8188CUS. The RTL8188CE-VAU is a PCI Express Mini Card adapter that attaches to the USB interface. @@ -90,6 +90,8 @@ The following adapters should work: .It Netgear WNA1000M .It Realtek RTL8192CU .It Realtek RTL8188CUS +.It TP-LINK TL-WN723N v3 +.It TP-LINK TL-WN725N v2 .El .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): Modified: head/share/man/man4/urtwnfw.4 ============================================================================== --- head/share/man/man4/urtwnfw.4 Fri Apr 25 04:49:27 2014 (r264911) +++ head/share/man/man4/urtwnfw.4 Fri Apr 25 08:01:22 2014 (r264912) @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 31, 2013 +.Dd April 25, 2014 .Dt URTWNFW 4 .Os .Sh NAME @@ -42,6 +42,7 @@ of the following: .Bd -ragged -offset indent .Cd "device urtwn-rtl8192cfwT" .Cd "device urtwn-rtl8192cfwU" +.Cd "device urtwn-rtl8188eufw" .Ed .Pp Alternatively, to load the driver as a @@ -50,10 +51,11 @@ module at boot time, place the following .Bd -literal -offset indent urtwn-rtl8192cfwT_load="YES" urtwn-rtl8192cfwU_load="YES" +urtwn-rtl8188eufw_load="YES" .Ed .Sh DESCRIPTION This module provides access to firmware sets for the -Realtek RTL8188CUS, RTL8188CE-VAU, RTL8188RU and RTL8192CU +Realtek RTL8188CUS, RTL8188CE-VAU, RTL8188EUS, RTL8188RU and RTL8192CU chip based USB WiFi adapters. It may be statically linked into the kernel, or loaded as a module. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Apr 25 04:49:27 2014 (r264911) +++ head/sys/conf/files Fri Apr 25 08:01:22 2014 (r264912) @@ -2373,6 +2373,20 @@ dev/usb/wlan/if_upgt.c optional upgt dev/usb/wlan/if_ural.c optional ural dev/usb/wlan/if_urtw.c optional urtw dev/usb/wlan/if_urtwn.c optional urtwn +urtwn-rtl8188eufw.c optional urtwn-rtl8188eufw | urtwnfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk urtwn-rtl8188eufw.fw:urtwn-rtl8188eufw:111 -murtwn-rtl8188eufw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "urtwn-rtl8188eufw.c" +urtwn-rtl8188eufw.fwo optional urtwn-rtl8188eufw | urtwnfw \ + dependency "urtwn-rtl8188eufw.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "urtwn-rtl8188eufw.fwo" +urtwn-rtl8188eufw.fw optional urtwn-rtl8188eufw | urtwnfw \ + dependency "$S/contrib/dev/urtwn/urtwn-rtl8188eufw.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "urtwn-rtl8188eufw.fw" urtwn-rtl8192cfwT.c optional urtwn-rtl8192cfwT | urtwnfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk urtwn-rtl8192cfwT.fw:urtwn-rtl8192cfwT:111 -murtwn-rtl8192cfwT -c${.TARGET}" \ no-implicit-rule before-depend local \ Added: head/sys/contrib/dev/urtwn/urtwn-rtl8188eufw.fw.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/urtwn/urtwn-rtl8188eufw.fw.uu Fri Apr 25 08:01:22 2014 (r264912) @@ -0,0 +1,312 @@ +begin 644 urtwn-rtl8188eufw.fw.uu +MX8@0``L``0`!(1$G,#8``"T'```````````````````"14X````````````` +M````````P6\````````````````````````````````````````````````` +M````````````H>8````````"5O<````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````,*O@/XR$D($A=`+==`(JN#"C.6*)&?UBN6,-'GUC-*,["2)^.:\`P)T +M_\.5@;1``$#.>01X@!;F"'`+PJ_F,.$#1!CVTJ\(V>WJB]`BY0S_(R2!^`\( +M"+\$!'\`>('F,.3R`.4,PY]0(`4,=(@E#/CF_::!".:N#+X#`G3_S?CH;6#@ +M".;`X(#VY0S3GT`GY0PDB?CFK@R^`P)T__T8YLWXY8%M8`;0X/88@/7E#"2( +MR/85#(#3Y0PC)('X?P3"K^8PX`,0X@Q_`##A!S#C!'\(5/14?,;2KU2`0@(BF@70#8`;_"';_W_M_!.1X@/8(]@C?^GB!=C"01=YT`9/`X.23P.!#B0%U +MBF!UC'G2C-*O(@/OTY0#0`-__R)T@2\O^.8@Y?3"K^9$,/;2KZX,[L.?4"$. +M=(@N^.;Y".88O@,"=/_][6E@"0GG&1GW"0F`\Q86@-KNTY]`!`6!!8'NTY]` +M(G2(+O@(YOGNM0P"J8$8!@;F_>UI8`D9&><)"?<9@/,>@-GO)(CXY@3X[R\$ +MD$7>D_8([R^3]G\`(N_3E`-``W__(N\C)('XYC#E],*OYE2,]M*OY0RU!PIT +MB"_XYO6!`D)-4"YTB2_XYK\#`G3__1CF^72(+_C[YOSI;&`(J`7G]AT9@/2H +M`Z8%'^4,M0?C?P`B=(DO^.;]&(8!#W2(+_BF`0B&!.4,M0<"K('M;&`(#0FH +M!>;W@/3E#+4'WHF!?P`B[].4`T`#?_\B[R,D@?C"K^8PY04PX`+2Y-+BQM*O +M?P`PX@$/`D),C_#D__[E#",D@/C"J3#W#7\(YF`++?9@,%`N@`23H_CDDZ-``_:``?((W_2`*>23H_A4!R0,R,,SQ%0/1"#(@T`$]%:``4;V +MW^2`"P$"!`@0($"`D$71Y'X!DV"\H_]4/S#E"50?_N23HV`!#L]4P"7@8*A` +MN.23H_KDDZ/XY).CR,6"R,K%@\KPH\C%@LC*Q8/*W^G>YX"^`$&""0!!@@H` +M08(7`%GB7"1>75^AP.#`\,"#P(+`T'70`,``P`'``L`#P`3`!<`&P`>0`<1T +MYO!T1:/PT35TY@20`<3P=$6C\-`'T`;0!=`$T`/0`M`!T`#0T-""T(/0\-#@ +M,I``5.!5-?4YH^!5-O4ZH^!5-_4[H^!5./4\K3E_5!(R'JTZ?U42,AZM.W]6 +M$C(>K3Q_5Q(R'E.1[R+`X,#PP(/`@L#0==``P`#``<`"P`/`!,`%P`;`!Y`! +MQ'1O\'1&H_`2;'CE03#D!'\"D2?E03#F`Q)LU>5#,.`#$E'"Y4,PX0,230SE +M0S#B`Q),P>5#,.,#$FSBY4,PY`,2;03E0S#E`Q)M,^5#,.8"\0_E1##A`Q)1 +M?W1O!)`!Q/!T1J/PT`?0!M`%T`30`]`"T`'0`-#0T(+0@]#PT.`RD(#>X+0! +M$Y"!)^!@#9"!*^!4_O!4!W`"\2HBD($?X)"!*3#@!>#_`G2/X/]]`=,0KP'# +MP-"0@A/M\)"!*N"0@A3PD($DX/[$$Q-4`S#@`P)(H.[$$Q,35`$PX`,"2*"0 +M@A3@_F]P`P)(H.]P`P)(%R3^<`,"2%`D_F!1)/QP`P)(BR3\8`,"2*#NM`X# +M$DE>D((4X'`%?P$229.0@A3@M`8#$DDTD((4X+0$#Y""$^#_8`42]D`6`"`:`1^@&@D((4X+0.!Q&EOP$" +M,5Z0@A3@M`8",320@A3@M`P'$:6_`0(1^I""%.!D!'!<$G+U[V0!<%0QOH!0 +MD((4X+0.!Q&EOP$",5Z0@A3@M`8",320@A3@M`P'$:6_`0(1^I""%.!P!'\! +M,9.0@A3@M`0:$G.[@!60@A3@M`P.D($EX/\3$U0_,.`",;'0T)*O(M&K[V0! +M8`B0`;AT`?"`/9"!).#_$Q,35!\PX`B0`;AT`O"`*._$5`\PX`B0`;AT!/"` +M&9"!*>#3E`1`")`!N'0(\(`(D`&XY/!_`2*0`;ET`O!_`"*0@-[@9`%P,9"! +M)>!4_?"0!2)T;_!_`?$-OP$2D($DX$2`\)"!*G0.\)"!(_`BD`&Y=`'PD`&X +M!/`BD($EX)`&!"#@#.!$0/"0@2IT!/"`#N!4?_"0@2IT#/"0@2/PD`4BY/`B +MD($EX,,3(.`(D($J=`SP@!Z0!@3@1$#PX$2`\)"!*G0$\)`%)^!$@/"0@2-T +M!/"0!2+D\"*0@A7O\!)499""%>!@!9`%(N3PD($J=`3PD($C\"(QXY"!*G0( +M\)"!(_`BD`4B=/_P\3J0`3=T`O#]?P-15S'CY)"!*O"0@2/P(I`%(G3_\/$Z +MD(6[$B#:S/``P'^,?@@2+J*0A;L2(-H````4?W!^#A(NHI"!^1(@V@````#D +M_?\251Q_?'X($BU<[$2`_)""!1(@SI""!1)$V9"%NQ(@SG]\?@@2+J*0`0!T +M/_"CX%3]\)`%4^!$(/`BD`$T=$#P_>3_=#TO^.9-_O9T,"_U@N0T`?6#[O`B +MTQ"O`D($?X/\PX&V0@0@1_@_R#@`F'GD('+=#'P[Q,35#\PX`M13I"! +MR^!$"/"`!GU`Y/^1)I"!'^#]$Q,35!\PX`>0@/"C=`+P?7C_45=] +M`G\#45>0!@K@1`?PD($RH^"0!5CPD(#>X+0!%9"!)>!4^_"0@2K@(.(.?0%_ +M!`)'/9"!)>!$!/`BD($?X/\PX`B0@2/@9`)@.I"!)^!P!.\PX`J0@2K@9`)@ +M*+&#D($EX!,3$U0?,.`4D($MX/^CX&]P"O'-D1R0@2[@%/"0`>;@!/`BD($? +MX##@!I"!(70!\)"!)^!@19"!)>#_$Q,35!\PX!*0`3O@,.0+D1R0@2W@%)`% +M<_"0@@OD=?`!$D2IPY""#."4@)"""^!D@)2`0`N0`9C@5/[PX$0!\!)U^-'6 +MD($_X##@#.3U':/Q^Y`!5W0%\)`!ON`$\"*0@-[@9`%@`L$CD($GX'`"P2.0 +M@2;@Q%0/9`%P(I`&J^"0@2[PD`:JX)"!+?"CX/]P")"!+>#^_X``D($N[_"0 +M@27@1`3PY)"!,/"0@3*CX)`%6/"0`5?D\)`!/'0"\)"!*^!4_?!4[_"0@2;@ +M_\14#R3]4`*`#Y"!'^`PX`42;?*``Q)NR9"!)>`3$Q-4'S#@#I"!+>#_H^"U +M!P3QS9$BD($?X,,3(.`'D($EX$0$\"+1J^]P`M$\(I"!)^!D`7!FD($FX%0/ +M8%&0@2K@<`/_,9.0@2K@9`Q@`Q)F)I`!6^3PD`$\=`3PT:OO9`%@..3U'9"! +M.N##$U1_]1[D^_U_6'X!$E`%D`%;=`7PD`:2=`'PD($DX$0(\"*0@2K@<`=] +M`7\$$D<](I`$&N#T8`-_`"*0!!O@5`=D!W\!8`)_`"(24&"0@2W@%)`%<_!] +M`G\"45>0@4+@,.`MD(#>X+0!)I""%^`$\."T"@N0@43@!/#DD((7\)"!1.#_ +MD(%#X+4'!>2C\/$+(N3_CU.0!!W@8!F0!2+@]59T__#Q.K\!`Q)T^Y`%(N56 +M\(`#$G3[D`0?="#P?P$BY)""#_"C\)`%^.!P#Z/@<`NCX'`'H^!P`W\!(M.0 +M@A#@E.B0@@_@E`-`"I`!P.!$(/!_`")_,GX`$C*JD((/Y'7P`1)$J8"_=!\M +M]8+D-/SU@^!4/_#O8!UT(2WU@N0T_/6#X$00\'0?+?6"Y#3\]8/@1(#P(G0A +M+?6"Y#3\]8/@5._P=!\M]8+D-/SU@^!$0/`B[Q20!7/PD`$_=!#P_7\#=$4O +M^.9-_O9T."_U@N0T`?6#[O`BX$0"\.3U'9"!.>#U'N3[_7]4?@&.&8\:Y1Y4 +M!\0S5."%&8.%&H+PY1U4!\0S5.#_Y1X3$Q-4'T^C\.M4!\0S5.#_Y1T3$Q-4 +M'T^%&H*%&8.CH_"]`0R%&H*.@Z.CHW0#\"*%&H*%&8.CHZ-T`?`BY)"!3?"0 +M@2?@8%B0@-[@9`%P4)"!303PY)"!+O"0@1_@,.`5D($CX+0"!>20@4WP,7/O +M<`20@4WPD(%-X&`DD($KX$00\.3U'9"!+Q)/^Y`!5W0%\)"!*N`@X@=]`7\$ +M$D<](N20@4SPD($GX'`"(7*0@-[@9`%@`B%RD($FX/_$5`]@(B3^8`,$<"&0 +M@2[@%/#@_V`&D($PX&`1[W`(D($MX*/P@`"0@4QT`?"0@1_@,.`5D($CX+0" +M!>20@4SP,7/O<`20@4SPD(%,X&!#D($KX$00\)"!,.!@`[0!">3U'9"!,."` +M#>3U'9"!,.!U\`.D)/[_D($OX"\23_R0`5=T!?"0@2K@(.('?0%_!!)'/2*0 +M!4/@?P`PYP)_`2*0@2?@<`>0@1_@,.`1D($?X##@!S%SOP$%05L23CPBTQ"O +M`199`% +M(N3P(I"!'^#_,.`]D($CX'X`M`("?@&0@2+@?0"T!`)]`>U.<"/OPQ,PX`(A +MGE%%D($CX+0(!N3]?PR`"9"!(^!P!OU_!!)'/2*0@1[@M`$/D($CX&0"8`=] +M`7\"$D<]D($GX&0"8!20@2;@5`]@#!).J^]P!OU_#!)'/2*0@1_@_S#@/Y"! +M(^!^`+0"`GX!D($BX'T`M`0"?0'M3G`E[\,3,.`"(9X2=*R0@2/@M`P&Y/U_ +M"(`*D($CX+0$!N3]_Q)'/2+3$*\!P\#0D('+$D4?$A^D_Y"!'O"_`1*0@ +MT-"2KR+3$*\!P\#0D($BX)""%O!O<`*!!.\48#X48&(4<`)AN!1P`F'?)`1@ +M`H$$D((6X/^T!`2108$$[[0"!)%0@020@A;@_[0#!)%4@03O9`%@`H$$D4.! +M!)""%N#_M`0$D?.!!.^T`@216($$D((6X/^T`P21Z($$[W!]D2N`>9""%N"T +M!`42=&"`;9""%N"T`021(8!BD((6X+0#!1)T<8!6D((6X'!0D1^`3)""%N#_ +MM`0%$G1,@#_OM`$$D32`-^^T`@21WX`OD((6X'`ID3*`)9""%N#_M`,%$G1[ +M@!COM`$$D0N`$.^T`@2Q!H`(D((6X'`"D0G0T)*O(I$KD`4B=&_PD`4GX%2_ +M\)"!(G0$\"*1*Q))W9"!(G0"\"*0@2)T`?`BD2N0!2)T__"0@2)T`_`BD?.0 +M!2?@5+_PY)"!(O`BD5B`[Y'H@.N199`%(N3PD($B!/`BTQ"O`!$ +M`O"0`0!T__"0!K=T"?"0!K1TAO!_?'X($BU<[%1__)""`1(@SI""`1)$V9"% +MNQ(@SG]\?@@2+J*0A;L2(-K,P`#`?XQ^"!(NHI"%NQ(@V@#``!1_<'X.$BZB +MD('Y$B#:``,^8.3]_[$42(,[0!=`'$F#UT-"2KR*0@<@211_O$D4H57$`57H!58," +M58L#590$59P@5:0A5:TC5;4D5;XE5<#^D($DX%3]3O#O5`_$5/#_ +MD($FX%0/3_"0``02'[V0@2GPT<:0`;ET`?"0`;CPD($GX)`!NO"0@2G@D`&[ +M\)"!)N!4#Y`!OO`BD('+$D4?$G*SD($GX/\23#Z0@2?@8!F0@5),.$#$F]YY4DPX@+QI>5),.,#$F^-Y4HPX`,2;\GE +M2C#D`Q)P(N5+,.$"47CE2S#@`C'_Y4LPXP+QX.5,,.$%?P,21"?E3##D`Q). +MQ.5,,.4#$G`XY4PPY@,2<,YT]P20`<3P=%:C\-`'T`;0!=`$T`/0`M`!T`#0 +MT-""T(/0\-#@,I"!)^!@-)`&DN`PX"/D]1V0@3K@PQ-4?_4>Y/O]?UA^`1$% +MD`%;=`7PD`:2=`'P(I"!).!4]_`21RHB(A(?I)"!,?`BD`'(Y/"C\*/P>P%Z +M@7E1?__^$BLGOP$)D(%1X&0#8`,B`:ODD(%6\)"!5N#_PY0"0`(!YL-T_I__ +MY)0`_GL!>H%Y4A(K)^]D`7!WD(%2X/]4P/Y@!>]4#'`6D(%2X/]4,&!G[U0# +M8&*0@5-T`?"`!>20@5/PD(%3X)"!4G`6X/_N$Q-4/Y"!5/#O5`P3$U0_H_"` +M#>#^5#"0@53P[E0#H_"0@53@9#!P5*/@9`)P3I``]>!40)"!5_#@<$&C=`+P +M@!"0@5AT`?"`")"!5N`$\`$1D`'$=.GP=%>C\)"!6."0`K3A_4P(R'G4]$.3U/G4_!W5``I`!,.4]\*/E/O"CY3_PH^5` +M\")U10YU1@%#1A!U1P-U2&*0`3CE1?"CY4;PH^5'\*/E2/`BD`$PY/"C\*/P +MH_"0`3CPH_"C\*/P_7]0$C(>Y/U_41(R'N3]?U(2,A[D_7]3`C(>D`$T=/_P +MH_"C\*/PD`$\\*/PH_"C\/U_5!(R'GW_?U42,AY]_W]6$C(>??]_5P(R'I`` +M@.!$@/U_@!(R'I#]`.!4O_`25^E1=Q(R=U')45Y_`1)#%9"!070"\/\20Q60 +M@4'@!/!_`Q)#%9"!0>`$\#$!43^0`(#@1$#]?X`2,AYU(/]1:%'Y47_D_P)# +MGE%B46]1IW%/48I1E9"!1>!4_O"C=`/PH_#DH_"C\"+D]4TBY)"`WO`B=>@# +M=:B$(N20@-CPH_`BD`&4X$0!\"*0`>1T"_"C=`'P(I"!/^!4_O#DH_`BD(%" +MX%3^\%1_\*-T"O#DH_`BD($?X%3^\%3]\%3[\%3W\%3O\%3?\.2C\*/PH_"C +M=`SP(I`!`>!$!/"0`9QT?O"C=)+PHW2@\*-T)/"0`9MT2?"0`9ITX/"0`9GD +M\)`!F`3P(N20@5'PH_"0`9C@?P`PY`)_`>]D`6`^PY"!4N"4B)"!4>"4$T`( +MD`'!X$00\"*0@5'D=?`!$D2I?Q1^`!(RJM.0@5+@E#*0@5'@E`!`N9`!QN`P +MX[(BY)"!)_"C\)"!)N!4#_!4\/"0@23@5/WP5/?P5._PD($M=`'PH_"0@23@ +M5/OPH^!4^_#DD($P\)"!+W0'\)"!,N3PHW0"\.20@2OPD($DX%3^\)"!*70, +M\)"!).!4W_"0@2IT#/"0@23@5+_P5'_PH^!4_O!4_?!4]_"0@302(-H````` +MD(`\X+0!")"!,729\(`2D(`\X)"!,;0#!720\(`#=$#PD($X=`'PHW0%\*/@ +M5`%$*/"C=`7PY*/PH^!4_?!4^_!4]_!4[_!4W_!4O_#DH_`BY)"!6?"0@5G@ +M9`'P)"20`<3P=%RC\)"!*N#_D($IX&]@`Q)'*M$(OP$"D5^Q\A(RGK\!`K%G +M$D)-@,K3$*\!P\#0D($DX##@))"!'^#_,.`:PQ,PX`>Q^[\!$H`*D($CX/]@ +M`[0(!I&6@`*1IM#0DJ\BTQ"O`7@!/`BL?.0``C@5._]?P@2,A[D_X]0Y)"!6O"C\)`!">!_`##G`G\![V50 +M8#[#D(%;X)2(D(%:X)030`B0`<#@1!#P(I"!6N1U\`$21*E_%'X`$C*JTY"! +M6^"4,I"!6N"4`$"YD`'&X##@LB*0@3'@_7^3$C(>D($HX&`2D`$OX##G!700 +M\(`&D`$O=)#PD``(X$00_7\($C(>?P&1RI``D.!$`?U_D!(R'G\4?@`",JK3 +M$*\!P\#0$BVGY/52$C*>[V!S8U(!Y5(D9Y`!Q/!T7:/PD`"(X/50]5%4#V#? +MY5`PX`L@Y`,2*<534>Z`/^50,.$6(.4.$A&][W`#0U$@D`$&Y/!34?V`).50 +M,.(+(.8#$F<&4U'[@!3E4##C#R#G"1)A;N]P`T-1@%-1]ZU1?X@2,AZ`A]#0 +MDJ\B(I``D.`@X/DBD($BX&0"?P%@`G\`(G\"D(%!X/[OPYY0&.\EX"2!^.8P +MY`N0`;AT"/"C\'\`(@^`WG\!(I`"A^!@")`!N'0!\(`7D`*&X"#A")`!N'0$ +M\(`(D`&XY/!_`2*0`;ET"/!_`"+D^_K]?P$21$Z0@;WO\&#PT7&`[-,0KP'# +MP-"0`!U\`20`=`210K@D(&_\'43`744@745OW46`7L!>H%YP!(K[9"" +M">!U\`20`=$210K@D('!\)""">!U\`20`=(210K@D('"\)""">!U\`20`=,2 +M10K@D('#\)""">!U\`20`?`210K@D('$\)""">!U\`20`?$210K@D('%\)"" +M">!U\`20`?(210K@D('&\)""">!U\`20`?,210K@D(''\)"!ON#_D(()X/YT +M`:@&"(`"PS/8_/1?D(&^\)""">#_=`&H!PB``L,SV/R0`<$253^0@@G@!/#@5`/PP8*0`<#@1`+PT-"2KR+D^_K]?P$21$Z0@=#O\&#P +M$FP9@.N0@=3O\*/M\*,2(-H`````Y)"!XO!_)'X($BU#_Y/S] +M_G@7$B"[J`2I!:H&JP>0@=X21-GM5'_][%2`_!)$S.Q$@/R0@=X2(,Z0@=H2 +M1-GL5'_\D(6[$B#.?R1^"!(NHI"!U.!U\`BD)&+U@N0TA_6#X/ZCX/_`!L`' +MD('>$D39D(6[$B#.T`?0!A(NHI"!VA)$V>Q$@/R0A;L2(,Y_)'X($BZBD('4 +MX'`$?R"`"9"!U."T`19_*'X($BU<>`@2(*CO5`'_Y)"!XN_PD('BX)"!U&`. +MX'7P"*0D9O6"Y#2'@`S@=?`(I"1D]8+D-(?U@^#^H^#_$BU<[50/_>3\D('6 +M$B#.D('6`D39D('C[_"K!9"!Z1(@V@````"O`^3\_?YX%!(@NZ@$J06J!JL' +MD('E$D39[50/_>3\$D3,[%0/_)"!Z1(@SI"!X^!U\`BD)&#U@N0TA_6#X/ZC +MX/_`!L`'D('I$D39D(6[$B#.T`?0!@(NHM,0KP'#P-`27[;0T)*O(G@0=`'R +MD`()X'@`\@AT(/(8XO\PX`4(XB2`\N_#$Y#]$/!X`>(D`/6"Y#3\]8/@>`/R +M9`1@#>+_9`A@!^]D#&`"8=[D>`+R>`/B_QCBPY]0+>+]&.(MD(%:\.#_)`#U +M@N0T_/6#X/YT!"WX[O+OM/\&D/T0X`3P>`+B!/*`R7@$XG@2\O]X!>)X$?)X +M!N)X$_)X!^)X%/)X".)X,_)X">)X-/)X"N)X-?)X"^)X-O)X#.)X-_)X#>)X +M./)X#N)X.?)X#^)X.O+D>!7R[R3X8'4D_&!L)`A@`F'`>!'BM`$%$BG%8<5X +M$>*T`@42$;UAQ7@1XK0#!/$&8<5X$>*T$!=X%.+^&.+][?]X%N[R_@CO\O\2 +M,JIAQ7@1XK01%W@4XOX8XOWM_W@6[O+^"._R_Q(R!F'%>!'B]&`"8<48\F'% +M>!5T`?)X$>)D!V`"8:IX-.+_Y/S]_G@($B"[P`2I!:H&JP=X,^+_Y/S]_M`` +M$D3,P`3`!<`&P`=X->+_Y/S]_G@0$B"[T`/0`M`!T``21,QX&!)$_G@5XG`" +M89,8XO\8XOTQ7W@<$D3^>#CB_^3\_?YX"!(@N\`$J06J!JL'>#?B_^3\_?[0 +M`!)$S,`$P`7`!L`'>#GB_^3\_?YX$!(@N]`#T`+0`=``$D3,>"`21/YX(!)$ +MY1(@FW@<$D3Q$D2_P`3`!<`&P`=X&!)$Y7@@$D3Q$D2_T`/0`M`!T``21,QX +M&!)$_G@8$D3ED('Y$B#.>!/B_0CB_Q)5'(`;>!/B_PCB_7@1XOMX%>*0@;SP +M<>&`!7@0=`+R>!#B_\.4`E`0[V`*>`+B_QCB+_(AD'\!(G\`(JP'[:T$>"3R +M[0CRZ[0$!W@G=`'R@`[K>">T!05T`O*``W0$\M-X)>*4_QCBE`!08^1X)O)X +M)^+_&.+^PY]``J%_=#,N^.)X*/*0@;S@8"UT-R[XXG@R\N[_>"7B+_\8XC0` +MCX+U@^!X*?)X,N+_]/YX*>)>_ACB_>]=3O)X)`CB_PCB+_]X*.+]$C(>>";B +M!/*`H=-X)>*4_QCBE`=0:>1X)O)X)^+_&.+^PY]``J%_=#,N^.)X*/*0@;S@ +M8"UX)N+__1CB+?T8XC0`C8+U@^!X*?)T-R_XXG@R\N+_]/YX*>)>_ACB_>]= +M3O)X*.+_>";B_1CB+?T8XC0`C8+U@^_P>";B!/*`FY"!O.!@#W@DXOX(XO\2 +M+5QX+A)$_N1X)O)X)^+_&.+^PY]0770S+OCB>"CRD(&\X&`K>"X21.5X)N+[ +M=?`(I/GX$B"H>"GO\G0W*_CB>#+RXO[T7_]X*.+][EU/\G@HXO]X)N+]PW0# +MG?WDE`#\>_YT*BWY=(`\^N\2'^KB!/*`F'@J$D3ED(6[$B#.>"3B_@CB_Q(N +MHB(BD('+$D4?D``!$A^]__X2'Z3]PQ,PX!*0@4#B0@_PH^WPK0.L`N20@?7PH_"0`<1T.?!T9J/P[%0__)`!0.WP +MK@3NH_"0@>W@)(%@-"3:8!PD/'!!D('NX,0S,S-4@)"!\O"C=&GPHW2`\(`L +MD('NX%0!D('R\*-TI?"C=`'P@!B0@>[@Q%00D('R\*-T?_"C=!#P@`-_`"*0 +M@?/@D`$&\)"!\N!@#I`!0O"0@?'@D`%#\(`-D`%#Y/"0@?+@D`%"\)"!].#_ +MD`%"X%__D('RX&]@[G0Y!)`!Q/!T9J/PD`%#Y/!_`2+DD(%J\)"'7^"0@6GP +MY)"!=O"0@6;PD(%FX/_#E$!0%71Y+_6"Y#2!]8-T__"0@6;@!/"`X>20@6;P +MD(%IX/^0@6;@_L.?0`,":!)TWR[YY#2&=1,!]12)%746"GL!>H%Y6Q(K[9"! +M7.#_$B\G[P20@7;PD(%;X/^CX/T2,>KO),B0@7CP=?`(I/"0@5S@5`^0@7?P +MY)"!9?"0@6?PD(%GX/_#E`105Y"!=^#^J`<(@`+#$]C\(.`^D(%GX"7@_Y"! +M>.`O)'GYY#2!^GL!P`/``9"!9>!U\`*D)%WY=($U\(L3]12)%746`M`!T`,2 +M*^V0@67@!/"0@6?@!/"`GY"!=N#_D(%FX"_P`F=`Y)"!:O"0@6K@PY1`0`)! +MK^#_)'GU@N0T@?6#X)"!;/#@_E3PQ%0/_9"!:_#N5`_^H_!T>B_U@N0T@?6# +MX)"!;?#\[O[L^^O_D(%R[O"C[_#M$D4H:(L`:,(!:7,":J`#:8X$::\%::\& +M::\'::\(:C,):FD*``!JKY"!:N#])'SU@N0T@?6#X/YT>RWU@N0T@?6#X/WM +M_Y"!=.[P_*/O\)"!;>#_$B^6D(%H=`+P0:"0@6K@)'SU@N0T@?6#X/_D_/W^ +M>`@2(+NH!*D%J@:K!Y"!:N`D>_6"Y#2!]8/@_^3\_?X21,S`!,`%P`;`!Y"! +M:N`D??6"Y#2!]8/@_^3\_?YX$!(@N]`#T`+0`=``$D3,P`3`!<`&P`>0@6K@ +M)'[U@N0T@?6#X/_D_/W^>!@2(+O0`]`"T`'0`!)$S)"!;A(@SI"!;A)$V9"% +MEA(@SI"!_6"Y#2!]8/@^^3_ +M$C#'@!F0@6W@_9"!:N`D>_6"Y#2!]8/@^^3_$C!JD(%H=`'P0:"0@6AT`O"0 +M@6K@)'SU@N0T@?6#X/_D_/W^>`@2(+NH!*D%J@:K!Y"!:N`D>_6"Y#2!]8/@ +M_^3\_?X21,S`!,`%P`;`!Y"!;.#_Y/S]_G@0$B"[T`/0`M`!T``21,R0@6X2 +M(,Z0@6O@)/O_P`>0@6X21-F0@?D2(,Z0@6W@_=`'$E4<@&V0@6AT`?"0@6K@ +M)'OYY#2!=1,!]12)%746`7O^>H!Y,Q(K[9"!;>#_D(%LX/WDD(&\\'L$@#20 +M@6AT!/"0@6K@)'OYY#2!=1,!]12)%746!'O^>H!Y,Q(K[9"!;>#_D(%LX/WD +MD(&\\'L&$F/AD(%HX"0"_Y"!:N`O\`$7(I`"">#]$A^D_J\%[2Z0@#WPD``! +M$A^]_^TOD(`^\)```A(?O?_M+Y"`/_"0``,2'[W_[2^0@$#PD``$$A^]_ZX% +M[2^0@$'P(I```A(?O?\PX"82'Z20@3CPD``!$A^]D($Y\.]4_O^CX%0!3_"0 +M``,2'[V0@3OP(I"!.'0!\*-T!?"CX%0!1"CPHW0%\"(2'Z20@3[PD($^X)`! +MY_`B$A^DD(%*\)```1(?O9"!2_`BTQ"O`[PH^_PY*/PH_"0@?W@ +M_J/@]8*.@^!@+<.0@@#@E.B0@?_@E`-`"Y`!P.!$@/!_`(`5D('_Y'7P`1)$ +MJ7\*?@`2,JJ`Q7\!T-"2KR+3$*\!P\#0D('1$D4?D((*X/\$\)```>\2'_Q_ +MKWX!<6#O8#J0@=$211:+$XH4B160``X2'[TD`O46>P%Z`7F@$BOMD('1$D46 +MD``.$A^]D`&N\*-T__"0`P%QMG\![V`6D(#8 +MX`3PX'\`M`H"?P'O8`7DD(#8\-#0DJ\BCPTBCPXB(I`!-.!5/?5!H^!5/O5" +MH^!5/_5#H^!50/5$D`$TY4'PH^5"\*/E0_"CY43P(I`!/.!51?5)H^!51O5* +MH^!51_5+H^!52/5,D`$\Y4GPH^5*\*/E2_"CY4SP4Y'?(I"!'^`PX`7DH_"C +M\"*0@-[@9`%P&9"!)^!@$Y`!5^3PD`$\=`(23_20`5=T!?`BD(#>X&0!<":0 +M@2?@8""0`5?D\)`!/'0"\)"!).!4^_"0@2O@5/WP5`=P`Q)'*B*0@-[@M`$4 +MD($GX&`.D($FX%0/9`)@`H`#T7\BD`0=X'`3D(`^X/_D_;%ICDZ/3Y`$'W0@ +M\"+3$*\!P\#0D((.[?"0@@WO\.3]_/$W?`"M!Y""#>"0!"7PD((.X&`.=`\O +M]8+D-/SU@^!$@/"O!70(+_6"Y#3\]8/D\'0)+_6"Y#3\]8/@5/#P="$M]8+D +M-/SU@^!4]_"N!*\%T-"2KR*/3O%+OP$8D(!`X/]]`;%IK0>L!J].$D^"D`0? +M="#P(I`&J>"0@4SPX/U4P'`)D($KX%3^\(!R[3#F2Y"!)^!D`G`JD($DX/_# +M$R#@"9"!*^!$`?"`*)"!)N!4#V0!<"V0@2O@1`3P?P&QTH`@D($KX$0!\)"! +M)N!4#V0"8`2Q3X`+T7^`!Y"!*^!4_O"0@4S@D($K,.<1$D_QD`%7=`7PD($D +MX$0$\"+@5/WP(I`!7^3PD`$\=`CPY/4=D($ZX,,35'_U'N3[_7]0@2O@5/[PD(%,X)"!*S#G$1)/\9`!5W0% +M\)"!).!$!/`BX%3]\"+D_N_#$_WO,.`"?H"0_1#M\*\&(M,0KP'#P-"0!!W@ +M8!J0!2+@5)!@!Y`!P.!$"/"0`<;@,.'D?P"``G\!T-"2KR*0@2?@8`,2<^&0 +M@3_@,.`#$DG=(I"!)^!@-9`&DN`PX23D]1V0@3K@PQ-4?_4>Y/O]?UQ^`1)0 +M!9`!7W0%\)`&DG0"\"*0@23@5._P$D_PD($D,.`&X$0!\(`$ +MX%3^\)"!3>`PYA&0`2_@,.<$Y/"`!I`!+W2`\)"!).`PX!J0@3+D\*-T!_"0 +M@3*CX)`%6/"0!.S@5-WP(I`$[.!$(O`BD(%*X&`/Y/"0!5/@1`'PD`7]X`3P +M(I"!).#_Q!,35`,PX"?O5+_PD`3@X)"!)3#@!N!$`?"`$.!4_O"0`;ET`?"0 +M`;AT!/`21RKD_Y"!1>`PX$B0@4G@_6!!=`%^`*@'"(`%PS/.,\[8^?^0!.#@ +M^^];8`;DD(%)\"*0@4?@TYU0$)`!QW00\!&^D(%%X%3^\"(23PN0@4G@!/`B +MD(`\X&0"8`>0!I#@1`'P(I"!).#_Q!,3$U0!,.`L[U1_\)`$X."0@24PX0;@ +M1`+P@`_@5/WPD`&Y=`'PD`&X!/"0@2?@8`,21RI_`0%NP^Z4`4`*#>T3D/T0 +M\.0O_R+#[I0!0"20_1'@;7`:D`$7X+4%#9`!Y'1W\)#]$>3P@`;M!)#]$?#D +M+_\BY)"!3O"C\*/PD`"#X)"!3O"0`(/@_I"!3N#_M08!(L.0@5#@E&20@4_@ +ME`!`#9`!P.!$0/"0@4[@_R*0@4_D=?`!$D2I@,)T12_XYO[M]%[^]G0X+_6" +MY#0!]8/N\"+3$*\!P\#0D((2[?"0@A'O\-.4!U!PX/]T`:@'"(`"PS/8_/3_ +MD`!'X%_]?T<2,AZ0@A'@_W0!J`<(@`+#,]C\_Y``1N!/_7]&$C(>D((2X&`8 +MD((1X/]T`:@'"(`"PS/8_/^0`$7@3X`7D((1X/]T`:@'"(`"PS/8_/3_D`!% +MX%_]?T6`?I""$>`D^/#@)`3_=`&H!PB``L,SV/ST_Y``0^!?_7]#$C(>D((1 +MX/]T`:@'"(`"PS/8_/^0`$/@3_U_0Q(R'I""$N!@'9""$>`D!/]T`:@'"(`" +MPS/8_/^0`$+@3_U_0H`"C\)"!)>!$"/`B$DZK[V0!8`B0`;AT`?"`9Y"! +M*^#_5`-@")`!N'0"\(!6D($IX/[DPYY0")`!N'0$\(!$[S#B")`!N'0(\(`X +MD($KX##D")`!N'00\(`ID($EX!,35#\@X`B0`;AT(/"`%I"!/N!@")`!N'2` +M\(`(D`&XY/!_`2*0`;ET!/!_`"+O8$*0@-[@9`%P.I"!)>!4_O"0!2)T#_"0 +M!@3@5+_PY/\23PV_`1*0@23@1$#PD($J=`;PD($C\"*0`;ET`?"0`;AT"/`B +MD`4B=&_PD`4GX%2_\)"!*G0"\)"!(_`B$E1ED($J=`SPD($C\"*0@23@_Q,3 +M5#\PX!'O5/OPD($KX%3]\%0'<$*`/9"!,.`$\)"!*^!4[_"0@3#@_[0!`H`$ +M[[0"!I`%6.`$\)"!..#_D($PX-.?0`^0@-[@M`$+D($EX%3[\"(21RHB(I`% +M*^!_`##G`G\!(I`%(G3_\)`%)^!$0/"0@2)T`_`BD`4GX$1`\!))W9"!(G0" +M\"(22>.0@2)T`O`BD`4B=&_PD`4GX%2_\)"!(G0$\"*N!Q)1<[\!$I"!(^!D +M`F`*KP9]`1)'/7\!(G\`(I`!5^!@2.3PD`$\=`+PD($DX/\3$U0_,.`,[U3[ +M\)"!*^!4_?`BD($PX`3PD($KX%3O\)"!..#_D($PX-.?0`Z0@-[@M`$'D($E +MX%3[\"*0@#_@_WT!$FUICE2/5:U5K%2O4Q)/@J]5KE20!(#@5`_]K`=T$2SU +M@N0T_/6#X$0!\'01+/6"Y#3\]8/@5/OPK`=T%BSU@N0T_/6#X$3Z\'05+/6" +MY#3\]8/@1!_PK`=T!BSU@N0T_/6#X$0/\)`$4^3PD`12\)`$473_\)`$4'3] +M\'04+/6"Y#3\]8/@5,!-_704+_6"Y#3\]8/M\"*K!ZH&[2O[Y#KZPY"`V^"; +MD(#:X)I0$Z/@)`'_D(#:X#0`_L/KG_OJGOKJD/T1\*\#=``O]8+D-/OU@^#_ +M(A(?I/]4`?Z0@4+@5/Y.\._#$S#@"I```1(?O9"!0_`BD(%%X##@+9"!2.`$ +L\.#_D(%&X+4''I`&DN!4''`+$D\+D(%)X`3P@`:0!I)T'/#DD(%(\"(`NXX` +` +end Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Apr 25 04:49:27 2014 (r264911) +++ head/sys/dev/usb/usbdevs Fri Apr 25 08:01:22 2014 (r264912) @@ -3677,6 +3677,7 @@ product RATOC REXUSB60F 0xb020 USB seri /* Green House and CompUSA OEM this part */ product REALTEK DUMMY 0x0000 Dummy product product REALTEK USB20CRW 0x0158 USB20CRW Card Reader +product REALTEK RTL8188ETV 0x0179 RTL8188ETV product REALTEK RTL8188CTV 0x018a RTL8188CTV product REALTEK USBKR100 0x8150 USBKR100 USB Ethernet product REALTEK RTL8188CE_0 0x8170 RTL8188CE Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Fri Apr 25 04:49:27 2014 (r264911) +++ head/sys/dev/usb/wlan/if_urtwn.c Fri Apr 25 08:01:22 2014 (r264912) @@ -2,6 +2,7 @@ /*- * Copyright (c) 2010 Damien Bergamini + * Copyright (c) 2014 Kevin Lo * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -20,7 +21,7 @@ __FBSDID("$FreeBSD$"); /* - * Driver for Realtek RTL8188CE-VAU/RTL8188CUS/RTL8188RU/RTL8192CU. + * Driver for Realtek RTL8188CE-VAU/RTL8188CUS/RTL8188EU/RTL8188RU/RTL8192CU. */ #include @@ -88,11 +89,13 @@ SYSCTL_INT(_hw_usb_urtwn, OID_AUTO, debu /* various supported device vendors/products */ static const STRUCT_USB_HOST_ID urtwn_devs[] = { #define URTWN_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } +#define URTWN_RTL8188E_DEV(v,p) \ + { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, URTWN_RTL8188E) } +#define URTWN_RTL8188E 1 URTWN_DEV(ABOCOM, RTL8188CU_1), URTWN_DEV(ABOCOM, RTL8188CU_2), URTWN_DEV(ABOCOM, RTL8192CU), URTWN_DEV(ASUS, RTL8192CU), - URTWN_DEV(ASUS, USBN10NANO), URTWN_DEV(AZUREWAVE, RTL8188CE_1), URTWN_DEV(AZUREWAVE, RTL8188CE_2), URTWN_DEV(AZUREWAVE, RTL8188CU), @@ -147,6 +150,10 @@ static const STRUCT_USB_HOST_ID urtwn_de URTWN_DEV(TRENDNET, RTL8188CU), URTWN_DEV(TRENDNET, RTL8192CU), URTWN_DEV(ZYXEL, RTL8192CU), + /* URTWN_RTL8188E */ + URTWN_RTL8188E_DEV(REALTEK, RTL8188ETV), + URTWN_RTL8188E_DEV(REALTEK, RTL8188EU), +#undef URTWN_RTL8188E_DEV #undef URTWN_DEV }; @@ -191,15 +198,19 @@ static uint16_t urtwn_read_2(struct urt static uint32_t urtwn_read_4(struct urtwn_softc *, uint16_t); static int urtwn_fw_cmd(struct urtwn_softc *, uint8_t, const void *, int); -static void urtwn_rf_write(struct urtwn_softc *, int, uint8_t, - uint32_t); +static void urtwn_r92c_rf_write(struct urtwn_softc *, int, + uint8_t, uint32_t); +static void urtwn_r88e_rf_write(struct urtwn_softc *, int, + uint8_t, uint32_t); static uint32_t urtwn_rf_read(struct urtwn_softc *, int, uint8_t); static int urtwn_llt_write(struct urtwn_softc *, uint32_t, uint32_t); static uint8_t urtwn_efuse_read_1(struct urtwn_softc *, uint16_t); static void urtwn_efuse_read(struct urtwn_softc *); +static void urtwn_efuse_switch_power(struct urtwn_softc *); static int urtwn_read_chipid(struct urtwn_softc *); static void urtwn_read_rom(struct urtwn_softc *); +static void urtwn_r88e_read_rom(struct urtwn_softc *); static int urtwn_ra_init(struct urtwn_softc *); static void urtwn_tsf_sync_enable(struct urtwn_softc *); static void urtwn_set_led(struct urtwn_softc *, int, int); @@ -208,6 +219,7 @@ static int urtwn_newstate(struct ieee80 static void urtwn_watchdog(void *); static void urtwn_update_avgrssi(struct urtwn_softc *, int, int8_t); static int8_t urtwn_get_rssi(struct urtwn_softc *, int, void *); +static int8_t urtwn_r88e_get_rssi(struct urtwn_softc *, int, void *); static int urtwn_tx_start(struct urtwn_softc *, struct ieee80211_node *, struct mbuf *, struct urtwn_data *); @@ -215,13 +227,16 @@ static void urtwn_start(struct ifnet *) static void urtwn_start_locked(struct ifnet *, struct urtwn_softc *); static int urtwn_ioctl(struct ifnet *, u_long, caddr_t); -static int urtwn_power_on(struct urtwn_softc *); +static int urtwn_r92c_power_on(struct urtwn_softc *); +static int urtwn_r88e_power_on(struct urtwn_softc *); static int urtwn_llt_init(struct urtwn_softc *); static void urtwn_fw_reset(struct urtwn_softc *); +static void urtwn_r88e_fw_reset(struct urtwn_softc *); static int urtwn_fw_loadpage(struct urtwn_softc *, int, const uint8_t *, int); static int urtwn_load_firmware(struct urtwn_softc *); -static int urtwn_dma_init(struct urtwn_softc *); +static int urtwn_r92c_dma_init(struct urtwn_softc *); +static int urtwn_r88e_dma_init(struct urtwn_softc *); static void urtwn_mac_init(struct urtwn_softc *); static void urtwn_bb_init(struct urtwn_softc *); static void urtwn_rf_init(struct urtwn_softc *); @@ -234,6 +249,9 @@ static void urtwn_write_txpower(struct static void urtwn_get_txpower(struct urtwn_softc *, int, struct ieee80211_channel *, struct ieee80211_channel *, uint16_t[]); +static void urtwn_r88e_get_txpower(struct urtwn_softc *, int, + struct ieee80211_channel *, + struct ieee80211_channel *, uint16_t[]); static void urtwn_set_txpower(struct urtwn_softc *, struct ieee80211_channel *, struct ieee80211_channel *); @@ -352,6 +370,8 @@ urtwn_attach(device_t self) device_set_usb_desc(self); sc->sc_udev = uaa->device; sc->sc_dev = self; + if (USB_GET_DRIVER_INFO(uaa) == URTWN_RTL8188E) + sc->chip |= URTWN_CHIP_88E; mtx_init(&sc->sc_mtx, device_get_nameunit(self), MTX_NETWORK_LOCK, MTX_DEF); @@ -383,10 +403,15 @@ urtwn_attach(device_t self) sc->ntxchains = 1; sc->nrxchains = 1; } - urtwn_read_rom(sc); + + if (sc->chip & URTWN_CHIP_88E) + urtwn_r88e_read_rom(sc); + else + urtwn_read_rom(sc); device_printf(sc->sc_dev, "MAC/BB RTL%s, RF 6052 %dT%dR\n", (sc->chip & URTWN_CHIP_92C) ? "8192CU" : + (sc->chip & URTWN_CHIP_88E) ? "8188EU" : (sc->board_type == R92C_BOARD_TYPE_HIGHPA) ? "8188RU" : (sc->board_type == R92C_BOARD_TYPE_MINICARD) ? "8188CE-VAU" : "8188CUS", sc->ntxchains, sc->nrxchains); @@ -638,7 +663,10 @@ urtwn_rx_frame(struct urtwn_softc *sc, u /* Get RSSI from PHY status descriptor if present. */ if (infosz != 0 && (rxdw0 & R92C_RXDW0_PHYST)) { - rssi = urtwn_get_rssi(sc, rate, &stat[1]); + if (sc->chip & URTWN_CHIP_88E) + rssi = urtwn_r88e_get_rssi(sc, rate, &stat[1]); + else + rssi = urtwn_get_rssi(sc, rate, &stat[1]); /* Update our average RSSI. */ urtwn_update_avgrssi(sc, rate, rssi); /* @@ -1056,14 +1084,31 @@ urtwn_fw_cmd(struct urtwn_softc *sc, uin return (0); } -static void +static __inline void urtwn_rf_write(struct urtwn_softc *sc, int chain, uint8_t addr, uint32_t val) { + + sc->sc_rf_write(sc, chain, addr, val); +} + +static void +urtwn_r92c_rf_write(struct urtwn_softc *sc, int chain, uint8_t addr, + uint32_t val) +{ urtwn_bb_write(sc, R92C_LSSI_PARAM(chain), SM(R92C_LSSI_PARAM_ADDR, addr) | SM(R92C_LSSI_PARAM_DATA, val)); } +static void +urtwn_r88e_rf_write(struct urtwn_softc *sc, int chain, uint8_t addr, +uint32_t val) +{ + urtwn_bb_write(sc, R92C_LSSI_PARAM(chain), + SM(R88E_LSSI_PARAM_ADDR, addr) | + SM(R92C_LSSI_PARAM_DATA, val)); +} + static uint32_t urtwn_rf_read(struct urtwn_softc *sc, int chain, uint8_t addr) { @@ -1143,22 +1188,8 @@ urtwn_efuse_read(struct urtwn_softc *sc) uint8_t off, msk; int i; - reg = urtwn_read_2(sc, R92C_SYS_ISO_CTRL); - if (!(reg & R92C_SYS_ISO_CTRL_PWC_EV12V)) { - urtwn_write_2(sc, R92C_SYS_ISO_CTRL, - reg | R92C_SYS_ISO_CTRL_PWC_EV12V); - } - reg = urtwn_read_2(sc, R92C_SYS_FUNC_EN); - if (!(reg & R92C_SYS_FUNC_EN_ELDR)) { - urtwn_write_2(sc, R92C_SYS_FUNC_EN, - reg | R92C_SYS_FUNC_EN_ELDR); - } - reg = urtwn_read_2(sc, R92C_SYS_CLKR); - if ((reg & (R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M)) != - (R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M)) { - urtwn_write_2(sc, R92C_SYS_CLKR, - reg | R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M); - } + urtwn_efuse_switch_power(sc); + memset(&sc->rom, 0xff, sizeof(sc->rom)); while (addr < 512) { reg = urtwn_efuse_read_1(sc, addr); @@ -1188,12 +1219,37 @@ urtwn_efuse_read(struct urtwn_softc *sc) } #endif } +static void +urtwn_efuse_switch_power(struct urtwn_softc *sc) +{ + uint32_t reg; + + reg = urtwn_read_2(sc, R92C_SYS_ISO_CTRL); + if (!(reg & R92C_SYS_ISO_CTRL_PWC_EV12V)) { + urtwn_write_2(sc, R92C_SYS_ISO_CTRL, + reg | R92C_SYS_ISO_CTRL_PWC_EV12V); + } + reg = urtwn_read_2(sc, R92C_SYS_FUNC_EN); + if (!(reg & R92C_SYS_FUNC_EN_ELDR)) { + urtwn_write_2(sc, R92C_SYS_FUNC_EN, + reg | R92C_SYS_FUNC_EN_ELDR); + } + reg = urtwn_read_2(sc, R92C_SYS_CLKR); + if ((reg & (R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M)) != + (R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M)) { + urtwn_write_2(sc, R92C_SYS_CLKR, + reg | R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M); + } +} static int urtwn_read_chipid(struct urtwn_softc *sc) { uint32_t reg; + if (sc->chip & URTWN_CHIP_88E) + return (0); + reg = urtwn_read_4(sc, R92C_SYS_CFG); if (reg & R92C_SYS_CFG_TRP_VAUX_EN) return (EIO); @@ -1230,8 +1286,69 @@ urtwn_read_rom(struct urtwn_softc *sc) sc->regulatory = MS(rom->rf_opt1, R92C_ROM_RF1_REGULATORY); DPRINTF("regulatory type=%d\n", sc->regulatory); - IEEE80211_ADDR_COPY(sc->sc_bssid, rom->macaddr); + + sc->sc_rf_write = urtwn_r92c_rf_write; + sc->sc_power_on = urtwn_r92c_power_on; + sc->sc_dma_init = urtwn_r92c_dma_init; +} + +static void +urtwn_r88e_read_rom(struct urtwn_softc *sc) +{ + uint8_t *rom = sc->r88e_rom; + uint16_t addr = 0; + uint32_t reg; + uint8_t off, msk, tmp; + int i; + + urtwn_efuse_switch_power(sc); + + /* Read full ROM image. */ + memset(&sc->r88e_rom, 0xff, sizeof(sc->r88e_rom)); + while (addr < 1024) { + reg = urtwn_efuse_read_1(sc, addr); + if (reg == 0xff) + break; + addr++; + if ((reg & 0x1f) == 0x0f) { + tmp = (reg & 0xe0) >> 5; + reg = urtwn_efuse_read_1(sc, addr); + if ((reg & 0x0f) != 0x0f) + off = ((reg & 0xf0) >> 1) | tmp; + addr++; + } else + off = reg >> 4; + msk = reg & 0xf; + for (i = 0; i < 4; i++) { + if (msk & (1 << i)) + continue; + rom[off * 8 + i * 2 + 0] = + urtwn_efuse_read_1(sc, addr); + addr++; + rom[off * 8 + i * 2 + 1] = + urtwn_efuse_read_1(sc, addr); + addr++; + } + } + + addr = 0x10; + for (i = 0; i < 6; i++) + sc->cck_tx_pwr[i] = sc->r88e_rom[addr++]; + for (i = 0; i < 5; i++) + sc->ht40_tx_pwr[i] = sc->r88e_rom[addr++]; + sc->bw20_tx_pwr_diff = (sc->r88e_rom[addr] & 0xf0) >> 4; + if (sc->bw20_tx_pwr_diff & 0x08) + sc->bw20_tx_pwr_diff |= 0xf0; + sc->ofdm_tx_pwr_diff = (sc->r88e_rom[addr] & 0xf); + if (sc->ofdm_tx_pwr_diff & 0x08) + sc->ofdm_tx_pwr_diff |= 0xf0; + sc->regulatory = MS(sc->r88e_rom[0xc1], R92C_ROM_RF1_REGULATORY); + IEEE80211_ADDR_COPY(sc->sc_bssid, &sc->r88e_rom[0xd7]); + + sc->sc_rf_write = urtwn_r88e_rf_write; + sc->sc_power_on = urtwn_r88e_power_on; + sc->sc_dma_init = urtwn_r88e_dma_init; } /* @@ -1349,13 +1466,26 @@ static void urtwn_set_led(struct urtwn_softc *sc, int led, int on) { uint8_t reg; - + if (led == URTWN_LED_LINK) { - reg = urtwn_read_1(sc, R92C_LEDCFG0) & 0x70; - if (!on) - reg |= R92C_LEDCFG0_DIS; - urtwn_write_1(sc, R92C_LEDCFG0, reg); - sc->ledlink = on; /* Save LED state. */ + if (sc->chip & URTWN_CHIP_88E) { + reg = urtwn_read_1(sc, R92C_LEDCFG2) & 0xf0; + urtwn_write_1(sc, R92C_LEDCFG2, reg | 0x60); + if (!on) { + reg = urtwn_read_1(sc, R92C_LEDCFG2) & 0x90; + urtwn_write_1(sc, R92C_LEDCFG2, + reg | R92C_LEDCFG0_DIS); + urtwn_write_1(sc, R92C_MAC_PINMUX_CFG, + urtwn_read_1(sc, R92C_MAC_PINMUX_CFG) & + 0xfe); + } + } else { + reg = urtwn_read_1(sc, R92C_LEDCFG0) & 0x70; + if (!on) + reg |= R92C_LEDCFG0_DIS; + urtwn_write_1(sc, R92C_LEDCFG0, reg); + } + sc->ledlink = on; /* Save LED state. */ } } @@ -1421,11 +1551,12 @@ urtwn_newstate(struct ieee80211vap *vap, reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x20); urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), reg); - reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1)); - reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x20); - urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); + if (!(sc->chip & URTWN_CHIP_88E)) { + reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1)); + reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x20); + urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); + } } - /* Make link LED blink during scan. */ urtwn_set_led(sc, URTWN_LED_LINK, !sc->ledlink); @@ -1441,10 +1572,11 @@ urtwn_newstate(struct ieee80211vap *vap, reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x32); urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), reg); - reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1)); - reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x32); - urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); - + if (!(sc->chip & URTWN_CHIP_88E)) { + reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1)); + reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x32); + urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); + } urtwn_set_chan(sc, ic->ic_curchan, NULL); break; case IEEE80211_S_RUN: @@ -1497,7 +1629,11 @@ urtwn_newstate(struct ieee80211vap *vap, urtwn_write_1(sc, R92C_T2T_SIFS + 1, 10); /* Intialize rate adaptation. */ - urtwn_ra_init(sc); + if (sc->chip & URTWN_CHIP_88E) + ni->ni_txrate = + ni->ni_rates.rs_rates[ni->ni_rates.rs_nrates-1]; + else + urtwn_ra_init(sc); /* Turn link LED on. */ urtwn_set_led(sc, URTWN_LED_LINK, 1); @@ -1543,19 +1679,21 @@ urtwn_update_avgrssi(struct urtwn_softc pwdb = 100; else pwdb = 100 + rssi; - if (rate <= 3) { - /* CCK gain is smaller than OFDM/MCS gain. */ - pwdb += 6; - if (pwdb > 100) - pwdb = 100; - if (pwdb <= 14) - pwdb -= 4; - else if (pwdb <= 26) - pwdb -= 8; - else if (pwdb <= 34) - pwdb -= 6; - else if (pwdb <= 42) - pwdb -= 2; + if (!(sc->chip & URTWN_CHIP_88E)) { + if (rate <= 3) { + /* CCK gain is smaller than OFDM/MCS gain. */ + pwdb += 6; + if (pwdb > 100) + pwdb = 100; + if (pwdb <= 14) + pwdb -= 4; + else if (pwdb <= 26) + pwdb -= 8; + else if (pwdb <= 34) + pwdb -= 6; + else if (pwdb <= 42) + pwdb -= 2; + } } if (sc->avg_pwdb == -1) /* Init. */ sc->avg_pwdb = pwdb; @@ -1592,6 +1730,57 @@ urtwn_get_rssi(struct urtwn_softc *sc, i return (rssi); } +static int8_t +urtwn_r88e_get_rssi(struct urtwn_softc *sc, int rate, void *physt) +{ + struct r92c_rx_phystat *phy; + struct r88e_rx_cck *cck; + uint8_t cck_agc_rpt, lna_idx, vga_idx; + int8_t rssi; + + if (rate <= 3) { + cck = (struct r88e_rx_cck *)physt; + cck_agc_rpt = cck->agc_rpt; + lna_idx = (cck_agc_rpt & 0xe0) >> 5; + vga_idx = cck_agc_rpt & 0x1f; + switch (lna_idx) { + case 7: + if (vga_idx <= 27) + rssi = -100 + 2* (27 - vga_idx); + else + rssi = -100; + break; + case 6: + rssi = -48 + 2 * (2 - vga_idx); + break; + case 5: + rssi = -42 + 2 * (7 - vga_idx); + break; + case 4: + rssi = -36 + 2 * (7 - vga_idx); + break; + case 3: + rssi = -24 + 2 * (7 - vga_idx); + break; + case 2: + rssi = -12 + 2 * (5 - vga_idx); + break; + case 1: + rssi = 8 - (2 * vga_idx); + break; + case 0: + rssi = 14 - (2 * vga_idx); + break; + } + rssi += 6; + } else { /* OFDM/HT. */ + phy = (struct r92c_rx_phystat *)physt; + rssi = ((le32toh(phy->phydw1) >> 1) & 0x7f) - 110; + } + return (rssi); +} + + static int urtwn_tx_start(struct urtwn_softc *sc, struct ieee80211_node *ni, struct mbuf *m0, struct urtwn_data *data) @@ -1619,6 +1808,8 @@ urtwn_tx_start(struct urtwn_softc *sc, s * Software crypto. */ wh = mtod(m0, struct ieee80211_frame *); + type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { @@ -1633,7 +1824,7 @@ urtwn_tx_start(struct urtwn_softc *sc, s wh = mtod(m0, struct ieee80211_frame *); } - switch (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) { + switch (type) { case IEEE80211_FC0_TYPE_CTL: case IEEE80211_FC0_TYPE_MGT: xfer = sc->sc_xfer[URTWN_BULK_TX_VO]; @@ -1657,20 +1848,24 @@ urtwn_tx_start(struct urtwn_softc *sc, s R92C_TXDW0_OWN | R92C_TXDW0_FSG | R92C_TXDW0_LSG); if (IEEE80211_IS_MULTICAST(wh->i_addr1)) txd->txdw0 |= htole32(R92C_TXDW0_BMCAST); - - type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; if (!IEEE80211_IS_MULTICAST(wh->i_addr1) && type == IEEE80211_FC0_TYPE_DATA) { if (ic->ic_curmode == IEEE80211_MODE_11B) raid = R92C_RAID_11B; else raid = R92C_RAID_11BG; - txd->txdw1 |= htole32( - SM(R92C_TXDW1_MACID, URTWN_MACID_BSS) | - SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_BE) | - SM(R92C_TXDW1_RAID, raid) | - R92C_TXDW1_AGGBK); - + if (sc->chip & URTWN_CHIP_88E) { + txd->txdw1 |= htole32( + SM(R88E_TXDW1_MACID, URTWN_MACID_BSS) | + SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_BE) | + SM(R92C_TXDW1_RAID, raid)); + txd->txdw2 |= htole32(R88E_TXDW2_AGGBK); + } else { + txd->txdw1 |= htole32( + SM(R92C_TXDW1_MACID, URTWN_MACID_BSS) | + SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_BE) | + SM(R92C_TXDW1_RAID, raid) | R92C_TXDW1_AGGBK); + } if (ic->ic_flags & IEEE80211_F_USEPROT) { if (ic->ic_protmode == IEEE80211_PROT_CTSONLY) { txd->txdw4 |= htole32(R92C_TXDW4_CTS2SELF | @@ -1684,7 +1879,10 @@ urtwn_tx_start(struct urtwn_softc *sc, s txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE, 8)); txd->txdw5 |= htole32(0x0001ff00); /* Send data at OFDM54. */ - txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, 11)); + if (sc->chip & URTWN_CHIP_88E) + txd->txdw5 |= htole32(0x13 & 0x3f); + else + txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, 11)); } else { txd->txdw1 |= htole32( SM(R92C_TXDW1_MACID, 0) | @@ -1882,9 +2080,16 @@ urtwn_alloc_tx_list(struct urtwn_softc * return (0); } -static int +static __inline int urtwn_power_on(struct urtwn_softc *sc) { + + return sc->sc_power_on(sc); +} + +static int +urtwn_r92c_power_on(struct urtwn_softc *sc) +{ uint32_t reg; int ntries; @@ -1968,12 +2173,73 @@ urtwn_power_on(struct urtwn_softc *sc) } static int +urtwn_r88e_power_on(struct urtwn_softc *sc) +{ + uint8_t val; + uint32_t reg; + int ntries; + + /* Wait for power ready bit. */ + for (ntries = 0; ntries < 5000; ntries++) { + val = urtwn_read_1(sc, 0x6) & 0x2; + if (val == 0x2) + break; + DELAY(10); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 10:00:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2170CC82; Fri, 25 Apr 2014 10:00:44 +0000 (UTC) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 928D71BB6; Fri, 25 Apr 2014 10:00:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id s3PA0DRg048121; Fri, 25 Apr 2014 14:00:13 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Fri, 25 Apr 2014 14:00:13 +0400 (MSK) From: Dmitry Morozovsky To: Don Lewis Subject: Re: svn commit: r264907 - in head/release: amd64 i386 In-Reply-To: <201404250526.s3P5Q3hS010626@gw.catspoiler.org> Message-ID: References: <201404250526.s3P5Q3hS010626@gw.catspoiler.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Fri, 25 Apr 2014 14:00:13 +0400 (MSK) Cc: svn-src-head@freebsd.org, gjb@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, nwhitehorn@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 10:00:44 -0000 On Thu, 24 Apr 2014, Don Lewis wrote: [snip] > >> GPT may not be the best choice here. On a number of, in particular, Lenovo > >> hardware, the BIOS will unconditionally boot with EFI from GPT media. I'm > >> not sure we want to just swap the set of machines on which this will not > >> boot. It probably needs to be nested MBR (or straight MBR -- I forget if > >> that works) until the boot media work with EFI (which should be soon on > >> -CURRENT). > > > > Noted. The thing here is that I want to get an EFI GPT partition on the > > image eventually, which unless I'm missing something obvious, we cannot > > mix GPT and MBR. > > > > I don't particularly like swapping which machines boot with this hack. > > Maybe it's time to do a MBR stick for "legacy" boot, and the GPT stick > > for UEFI and/or "fails-to-boot-DD" case? > > I've got a fairly recent Gigabyte motherboard that refused to boot an > Ultimate Boot CD memstick which uses MBR. I found out that I was was > able to boot and install from a 'dangerously dedicated' FreeBSD 9.x > memstick. Given that clue, I built a 'dangerously dedicated' Ultimate > Boot CD memstick, which worked just fine. seconded, till now the most bootable case for machines under my hands were happy with no-partition at all (fake MBR with 50k@s4, dd from UFS) this situation could drift in the near future though... -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 11:36:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EEF08A09; Fri, 25 Apr 2014 11:36:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBC1C1675; Fri, 25 Apr 2014 11:36:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PBaBne097855; Fri, 25 Apr 2014 11:36:11 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PBaBKK097854; Fri, 25 Apr 2014 11:36:11 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201404251136.s3PBaBKK097854@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 25 Apr 2014 11:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264915 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 11:36:12 -0000 Author: glebius Date: Fri Apr 25 11:36:11 2014 New Revision: 264915 URL: http://svnweb.freebsd.org/changeset/base/264915 Log: The current API for adding rules with pool addresses is the following: - DIOCADDADDR adds addresses and puts them into V_pf_pabuf - DIOCADDRULE takes all addresses from V_pf_pabuf and links them into rule. The ugly part is that if address is a table, then it is initialized in DIOCADDRULE, because we need ruleset, and DIOCADDADDR doesn't supply ruleset. But if address is a dynaddr, we need address family, and address family could be different for different addresses in one rule, so dynaddr is initialized in DIOCADDADDR. This leads to the entangled state of addresses on V_pf_pabuf. Some are initialized, and some not. That's why running pf_empty_pool(&V_pf_pabuf) can lead to a panic on a NULL table address. Since proper fix requires API/ABI change, for now simply plug the panic in pf_empty_pool(). Reported by: danger Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Fri Apr 25 09:54:42 2014 (r264914) +++ head/sys/netpfil/pf/pf_ioctl.c Fri Apr 25 11:36:11 2014 (r264915) @@ -343,7 +343,9 @@ pf_empty_pool(struct pf_palist *poola) pfi_dynaddr_remove(pa->addr.p.dyn); break; case PF_ADDR_TABLE: - pfr_detach_table(pa->addr.p.tbl); + /* XXX: this could be unfinished pooladdr on pabuf */ + if (pa->addr.p.tbl != NULL) + pfr_detach_table(pa->addr.p.tbl); break; } if (pa->kif) From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 13:07:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CBAA902; Fri, 25 Apr 2014 13:07:20 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail0.glenbarber.us", Issuer "Gandi Standard SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 235DA119B; Fri, 25 Apr 2014 13:07:20 +0000 (UTC) Received: from glenbarber.us (c-71-224-221-174.hsd1.nj.comcast.net [71.224.221.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 613FB5D9F; Fri, 25 Apr 2014 13:07:16 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 613FB5D9F Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Fri, 25 Apr 2014 09:07:14 -0400 From: Glen Barber To: Dmitry Morozovsky Subject: Re: svn commit: r264907 - in head/release: amd64 i386 Message-ID: <20140425130714.GN49791@glenbarber.us> References: <201404250526.s3P5Q3hS010626@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="K4JQQuyuIggLcvtH" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, Don Lewis , src-committers@freebsd.org, svn-src-all@freebsd.org, nwhitehorn@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 13:07:20 -0000 --K4JQQuyuIggLcvtH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 25, 2014 at 02:00:13PM +0400, Dmitry Morozovsky wrote: > seconded, till now the most bootable case for machines under my hands wer= e=20 > happy with no-partition at all (fake MBR with 50k@s4, dd from UFS) >=20 I'm working on restoring the MBR, but need some time to test. If I can't get a working memstick image with the addition of an EFI partition for the UEFI boot loader in a few hours, I'll revert this commit. Glen --K4JQQuyuIggLcvtH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTWl4CAAoJELls3eqvi17QnewQALg/dYB1qBoDGyfM043L031I qVLvNQ2HWh+xl2p1wMA5ReyySF3mwvuigwbkxMzPsTFND1NSVKHXIP8ycaYtljwr YLjBe8FvJVWeYY0sJuQYVv0TTTRqyAiUFACVIXF7/7QYgAj0P0Ce0aPwmQ4O4IlT ZPIBp+I+H/l8/RW3Msh/H5gNDtdzF+emT00j9GCSzn6WHMnsPfFbRmJLMfzaniNg XICXU04qUSBbtaEeZj/DB5L9IT2hJgLvjWx5oCxsH3EXkPuGnGbaInXWxZVWklsx ub1C9XK7OcQ9hQLZvWK0P6h3SMM5eVFcNXQ31DOzC44Trm0lBUQFAFElavxfzIXn mqzpxR3LjkEhoJbzYt3aHat5vZ0xca1UQdhium0YCp8z2d3IrfiTjODVHtEHXu2C jrVLdVzSA7+FDKJ4CzVmi/KHXsNbmyBVx6DuVmLyuomP2F+LVoeXr3L7K4Cwfm7M R2kFPDtd5EtxGeRZpeZ6zTuc5+bu+JWiyXAxXEWgrcxoPRMxV5ePAtQpq6A9b3iL MGW+8Lyb45hR0puprZcVqOcg0Hi3WeHvguLuVx/zqJVsSm6LceCnbmmyr861p9Dv OxHqbuYtRvpwgfLeXxlr+hXc8yyP+Si/Gz6rOxb9jeTVsBgkT9v25mK5MdKRJWbG EhHRBTpDm4K3l3QWCkXp =rQvY -----END PGP SIGNATURE----- --K4JQQuyuIggLcvtH-- From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 13:38:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70E7567C; Fri, 25 Apr 2014 13:38:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C6ED14DF; Fri, 25 Apr 2014 13:38:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PDcJdR049598; Fri, 25 Apr 2014 13:38:19 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PDcIuZ049595; Fri, 25 Apr 2014 13:38:18 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201404251338.s3PDcIuZ049595@svn.freebsd.org> From: Tycho Nightingale Date: Fri, 25 Apr 2014 13:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264916 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 13:38:19 -0000 Author: tychon Date: Fri Apr 25 13:38:18 2014 New Revision: 264916 URL: http://svnweb.freebsd.org/changeset/base/264916 Log: Provide a very basic stub for the 8042 PS/2 keyboard controller. Reviewed by: jhb Approved by: neel (co-mentor) Added: head/usr.sbin/bhyve/atkbdc.c (contents, props changed) Modified: head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/bhyverun.c Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Fri Apr 25 11:36:11 2014 (r264915) +++ head/usr.sbin/bhyve/Makefile Fri Apr 25 13:38:18 2014 (r264916) @@ -9,6 +9,7 @@ DEBUG_FLAGS= -g -O0 MAN= bhyve.8 SRCS= \ + atkbdc.c \ acpi.c \ bhyverun.c \ block_if.c \ Added: head/usr.sbin/bhyve/atkbdc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/atkbdc.c Fri Apr 25 13:38:18 2014 (r264916) @@ -0,0 +1,85 @@ +/*- + * Copyright (c) 2014 Tycho Nightingale + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +#include + +#include "inout.h" +#include "pci_lpc.h" + +#define KBD_DATA_PORT 0x60 + +#define KBD_STS_CTL_PORT 0x64 +#define KDB_SYS_FLAG 0x4 + +#define KBDC_RESET 0xfe + +static int +atkbdc_data_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, + uint32_t *eax, void *arg) +{ + if (bytes != 1) + return (INOUT_ERROR); + + *eax = 0; + + return (INOUT_OK); +} + +static int +atkbdc_sts_ctl_handler(struct vmctx *ctx, int vcpu, int in, int port, + int bytes, uint32_t *eax, void *arg) +{ + int retval; + + if (bytes != 1) + return (INOUT_ERROR); + + retval = INOUT_OK; + if (in) { + *eax = KDB_SYS_FLAG; /* system passed POST */ + } else { + switch (*eax) { + case KBDC_RESET: /* Pulse "reset" line. */ + retval = INOUT_RESET; + break; + } + } + + return (retval); +} + +INOUT_PORT(atkdbc, KBD_DATA_PORT, IOPORT_F_INOUT, atkbdc_data_handler); +SYSRES_IO(KBD_DATA_PORT, 1); +INOUT_PORT(atkbdc, KBD_STS_CTL_PORT, IOPORT_F_INOUT, + atkbdc_sts_ctl_handler); +SYSRES_IO(KBD_STS_CTL_PORT, 1); Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Fri Apr 25 11:36:11 2014 (r264915) +++ head/usr.sbin/bhyve/bhyverun.c Fri Apr 25 13:38:18 2014 (r264916) @@ -281,10 +281,6 @@ vmexit_inout(struct vmctx *ctx, struct v if (vme->u.inout.string || vme->u.inout.rep) return (VMEXIT_ABORT); - /* Special case of guest reset */ - if (out && port == 0x64 && (uint8_t)eax == 0xFE) - return (vmexit_catch_reset()); - /* Extra-special case of host notifications */ if (out && port == GUEST_NIO_PORT) return (vmexit_handle_notify(ctx, vme, pvcpu, eax)); From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 14:35:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CDE1CAD; Fri, 25 Apr 2014 14:35:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78AB91B6A; Fri, 25 Apr 2014 14:35:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PEZVAV074193; Fri, 25 Apr 2014 14:35:31 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PEZVTJ074191; Fri, 25 Apr 2014 14:35:31 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201404251435.s3PEZVTJ074191@svn.freebsd.org> From: Alan Somers Date: Fri, 25 Apr 2014 14:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264917 - head/tests/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 14:35:31 -0000 Author: asomers Date: Fri Apr 25 14:35:30 2014 New Revision: 264917 URL: http://svnweb.freebsd.org/changeset/base/264917 Log: Style fixes, mostly trailing whitespace elimination. No functional change. Reported by: pho MFC after: 3 weeks Modified: head/tests/sys/netinet/fibs_test.sh head/tests/sys/netinet/udp_dontroute.c Modified: head/tests/sys/netinet/fibs_test.sh ============================================================================== --- head/tests/sys/netinet/fibs_test.sh Fri Apr 25 13:38:18 2014 (r264916) +++ head/tests/sys/netinet/fibs_test.sh Fri Apr 25 14:35:30 2014 (r264917) @@ -1,7 +1,7 @@ # # Copyright (c) 2014 Spectra Logic Corporation # All rights reserved. -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: @@ -13,7 +13,7 @@ # ("Disclaimer") and any redistribution must be conditioned upon # including a substantially similar Disclaimer requirement for further # binary redistribution. -# +# # NO WARRANTY # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -26,7 +26,7 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGES. -# +# # Authors: Alan Somers (Spectra Logic Corporation) # # $FreeBSD$ @@ -43,7 +43,7 @@ # Simulate a crossover cable between them by using net/socat # Use nping (from security/nmap) to send an ICMP echo request from one # interface to the other, spoofing the source IP. The source IP must be -# spoofed, or else it will already have an entry in the arp table. +# spoofed, or else it will already have an entry in the arp table. # Check whether an arp entry exists for the spoofed IP atf_test_case arpresolve_checks_interface_fib cleanup arpresolve_checks_interface_fib_head() @@ -84,7 +84,7 @@ arpresolve_checks_interface_fib_body() socat /dev/${TAP0} /dev/${TAP1} & SOCAT_PID=$! echo ${SOCAT_PID} >> "processes_to_kill" - + # Send an ICMP echo request with a spoofed source IP setfib 2 nping -c 1 -e ${TAP0} -S ${SPOOF_ADDR} \ --source-mac ${SPOOF_MAC} --icmp --icmp-type "echo-request" \ @@ -307,9 +307,9 @@ udp_dontroute_cleanup() atf_init_test_cases() { atf_add_test_case arpresolve_checks_interface_fib - atf_add_test_case loopback_and_network_routes_on_nondefault_fib - atf_add_test_case default_route_with_multiple_fibs_on_same_subnet - atf_add_test_case subnet_route_with_multiple_fibs_on_same_subnet + atf_add_test_case loopback_and_network_routes_on_nondefault_fib + atf_add_test_case default_route_with_multiple_fibs_on_same_subnet + atf_add_test_case subnet_route_with_multiple_fibs_on_same_subnet atf_add_test_case udp_dontroute } Modified: head/tests/sys/netinet/udp_dontroute.c ============================================================================== --- head/tests/sys/netinet/udp_dontroute.c Fri Apr 25 13:38:18 2014 (r264916) +++ head/tests/sys/netinet/udp_dontroute.c Fri Apr 25 14:35:30 2014 (r264917) @@ -1,7 +1,7 @@ /* * Copyright (c) 2014 Spectra Logic Corporation * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. - * + * * NO WARRANTY * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -26,7 +26,7 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. - * + * * Authors: Alan Somers (Spectra Logic Corporation) * * $FreeBSD$ @@ -43,11 +43,12 @@ #include #include -/* +/* * Sends a single UDP packet to the provided address, with SO_DONTROUTE set * I couldn't find a way to do this with builtin utilities like nc(1) */ -int main(int argc, char **argv) +int +main(int argc, char **argv) { struct sockaddr_in dst; int s; @@ -80,6 +81,6 @@ int main(int argc, char **argv) dst.sin_len); if (ret == -1) err(errno, "sendto"); - + return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 15:27:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C7E8D14; Fri, 25 Apr 2014 15:27:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68FDC118D; Fri, 25 Apr 2014 15:27:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PFRKfo095017; Fri, 25 Apr 2014 15:27:20 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PFRKCj095016; Fri, 25 Apr 2014 15:27:20 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201404251527.s3PFRKCj095016@svn.freebsd.org> From: Bryan Drewery Date: Fri, 25 Apr 2014 15:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264918 - head/usr.bin/sort X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 15:27:20 -0000 Author: bdrewery Date: Fri Apr 25 15:27:19 2014 New Revision: 264918 URL: http://svnweb.freebsd.org/changeset/base/264918 Log: Fix spelling error. MFC after: 3 days Modified: head/usr.bin/sort/sort.1.in Modified: head/usr.bin/sort/sort.1.in ============================================================================== --- head/usr.bin/sort/sort.1.in Fri Apr 25 14:35:30 2014 (r264917) +++ head/usr.bin/sort/sort.1.in Fri Apr 25 15:27:19 2014 (r264918) @@ -147,7 +147,7 @@ specifications, they apply globally to a When attached to a specific key (see .Fl k ) , the ordering options override all global ordering options for -the key they are attahced to. +the key they are attached to. .Bl -tag -width indent .It Fl b, Fl Fl ignore-leading-blanks Ignore leading blank characters when comparing lines. From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 15:58:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53989C9B; Fri, 25 Apr 2014 15:58:34 +0000 (UTC) Received: from mail-wg0-x233.google.com (mail-wg0-x233.google.com [IPv6:2a00:1450:400c:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6617F151F; Fri, 25 Apr 2014 15:58:33 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id z12so2632373wgg.22 for ; Fri, 25 Apr 2014 08:58:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=HahrS+m+xF42H9r+SOF7WpC0GNjmuFGcdZnn2o4+avY=; b=b/Yn7cNvlPIZ8T/hvcSV0T8/lCky73m9AIKIJEvL4V5INXZLKhFR2v5Ca00YY9EFWX oFmDrXTw8Pi23q/G70gR7zq+afdBbchk3fZ3iN84JcI9dBrbTibEGgFzUV08r4gD5pAE Co04crqT1+xKRrsyvqJq4FpjhCkk1bALedlpp3apWs1dgBFeHXC+nUBDwR0MOwAkv965 HwJi7U4Ga8mBhc0DtMQrb7FoZ9s1T0KQvRiIwbecx8bGcGQyGryGzbUtoDxFn8Lnig5C DZgSBNS3msskHIzjfQlPVivIUg0r3xrJQJNGDcq08diFZtKJkvVHB0/gVGo9usjFF/LM GHVA== MIME-Version: 1.0 X-Received: by 10.194.175.70 with SMTP id by6mr7367209wjc.3.1398441511690; Fri, 25 Apr 2014 08:58:31 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.194.168.130 with HTTP; Fri, 25 Apr 2014 08:58:31 -0700 (PDT) In-Reply-To: <201307261941.r6QJfEMO087844@svn.freebsd.org> References: <201307261941.r6QJfEMO087844@svn.freebsd.org> Date: Fri, 25 Apr 2014 09:58:31 -0600 X-Google-Sender-Auth: wXNuYYlT2mUA5JXzQajO4UP2rL0 Message-ID: Subject: Re: svn commit: r253687 - head/sys/net From: Alan Somers To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 15:58:34 -0000 On Fri, Jul 26, 2013 at 1:41 PM, Adrian Chadd wrote: > Author: adrian > Date: Fri Jul 26 19:41:13 2013 > New Revision: 253687 > URL: http://svnweb.freebsd.org/changeset/base/253687 > > Log: > Break out the static, global LACP debug options into a per-lagg unit > sysctl tree. > > * Create a net.link.lagg.X.lacp node I think this introduced a lock order reversal. > * Add a debug node under that for tx_test and rx_test > * Add lacp_strict_mode, defaulting to 1 > > tx_test and rx_test are still a bitmap of unit numbers for now. > At some point it would be nice to create child nodes of the lagg bundle > for each sub-interface, and then populate those with various knobs > and statistics. > > Sponsored by: Netflix > > Modified: > head/sys/net/ieee8023ad_lacp.c > head/sys/net/ieee8023ad_lacp.h > head/sys/net/if_lagg.c > head/sys/net/if_lagg.h > > Modified: head/sys/net/ieee8023ad_lacp.c > ============================================================================== > --- head/sys/net/ieee8023ad_lacp.c Fri Jul 26 19:11:08 2013 (r253686) > +++ head/sys/net/ieee8023ad_lacp.c Fri Jul 26 19:41:13 2013 (r253687) ; > @@ -765,10 +791,19 @@ lacp_attach(struct lagg_softc *sc) > > lsc->lsc_hashkey = arc4random(); > lsc->lsc_active_aggregator = NULL; > + lsc->lsc_strict_mode = 1; > LACP_LOCK_INIT(lsc); > TAILQ_INIT(&lsc->lsc_aggregators); > LIST_INIT(&lsc->lsc_ports); > > + /* Create a child of the parent lagg interface */ > + oid = SYSCTL_ADD_NODE(&sc->ctx, SYSCTL_CHILDREN(sc->sc_oid), > + OID_AUTO, "lacp", CTLFLAG_RD, NULL, "LACP"); This line grabs a sleepable lock, but we already had a nonsleepable lock further up the stack, acquired in lagg_ioctl(). > + > + /* Attach sysctl nodes */ > + lacp_attach_sysctl(lsc, oid); > + lacp_attach_sysctl_debug(lsc, oid); > + > callout_init_mtx(&lsc->lsc_transit_callout, &lsc->lsc_mtx, 0); > callout_init_mtx(&lsc->lsc_callout, &lsc->lsc_mtx, 0); > Here's the warning from Witness.as well as a warning from UMA. Many more UMA warnings followed. lock order reversal: (sleepable after non-sleepable) 1st 0xfffff8000252ca08 if_lagg rmlock (if_lagg rmlock) @ /usr/home/alans/freebsd/head/sys/modules/if_lagg/../../net/if_lagg.c:1040 2nd 0xffffffff814ef4e0 sysctl lock (sysctl lock) @ /usr/home/alans/freebsd/head/sys/kern/kern_sysctl.c:474 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00977485b0 kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe0097748660 witness_checkorder() at witness_checkorder+0xdc2/frame 0xfffffe00977486f0 _sx_xlock() at _sx_xlock+0x75/frame 0xfffffe0097748730 sysctl_add_oid() at sysctl_add_oid+0x4a/frame 0xfffffe0097748780 lacp_attach() at lacp_attach+0xf7/frame 0xfffffe00977487f0 lagg_lacp_attach() at lagg_lacp_attach+0x88/frame 0xfffffe0097748810 lagg_ioctl() at lagg_ioctl+0x98a/frame 0xfffffe00977488f0 in_control() at in_control+0x38e/frame 0xfffffe0097748970 ifioctl() at ifioctl+0xba2/frame 0xfffffe0097748a30 kern_ioctl() at kern_ioctl+0x22b/frame 0xfffffe0097748a90 sys_ioctl() at sys_ioctl+0x13c/frame 0xfffffe0097748ae0 amd64_syscall() at amd64_syscall+0x25a/frame 0xfffffe0097748bf0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe0097748bf0 --- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x800fa045a, rsp = 0x7fffffffe118, rbp = 0x7fffffffe1a0 --- uma_zalloc_arg: zone "128" with the following non-sleepable locks held: exclusive rm if_lagg rmlock (if_lagg rmlock) r = 0 (0xfffff8000252ca08) locked @ /usr/home/alans/freebsd/head/sys/modules/if_lagg/../../net/if_lagg.c:1040 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0097748500 kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe00977485b0 witness_warn() at witness_warn+0x4b5/frame 0xfffffe0097748670 uma_zalloc_arg() at uma_zalloc_arg+0x3b/frame 0xfffffe00977486e0 malloc() at malloc+0x194/frame 0xfffffe0097748730 sysctl_add_oid() at sysctl_add_oid+0x11f/frame 0xfffffe0097748780 lacp_attach() at lacp_attach+0xf7/frame 0xfffffe00977487f0 lagg_lacp_attach() at lagg_lacp_attach+0x88/frame 0xfffffe0097748810 lagg_ioctl() at lagg_ioctl+0x98a/frame 0xfffffe00977488f0 in_control() at in_control+0x38e/frame 0xfffffe0097748970 ifioctl() at ifioctl+0xba2/frame 0xfffffe0097748a30 kern_ioctl() at kern_ioctl+0x22b/frame 0xfffffe0097748a90 sys_ioctl() at sys_ioctl+0x13c/frame 0xfffffe0097748ae0 amd64_syscall() at amd64_syscall+0x25a/frame 0xfffffe0097748bf0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe0097748bf0 --- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x800fa045a, rsp = 0x7fffffffe118, rbp = 0x7fffffffe1a0 --- # uname -a FreeBSD alans-fbsd-head 11.0-CURRENT FreeBSD 11.0-CURRENT #49 r264887M: Thu Apr 24 17:21:48 MDT 2014 alans@ns1.eng.sldomain.com:/vmpool/obj/usr/home/alans/freebsd/head/sys/GENERIC amd64 To reproduce: ifconfig tap0 create ifconfig tap1 create ifconfig tap2 create ifconfig lagg0 create ifconfig lagg0 up laggproto lacp laggport tap0 laggport tap1 laggport tap2 192.0.0.2/24 If I create and destroy the lagg in a tight loop, while running "ifconfig -am" in a tight loop in another terminal, I eventually hit a general protection fault in __mtx_lock_sleep. I think it might be related. Can you reproduce this? Do you have any good ideas for a solution? -Alan From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 16:44:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25598CAF; Fri, 25 Apr 2014 16:44:28 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 7BD8E2F4; Fri, 25 Apr 2014 16:44:26 +0000 (UTC) Message-ID: <535A9093.6010201@FreeBSD.org> Date: Fri, 25 Apr 2014 20:42:59 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Alan Somers , Adrian Chadd Subject: Re: svn commit: r253687 - head/sys/net References: <201307261941.r6QJfEMO087844@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 16:44:28 -0000 On 25.04.2014 19:58, Alan Somers wrote: > On Fri, Jul 26, 2013 at 1:41 PM, Adrian Chadd wrote: >> Author: adrian >> Date: Fri Jul 26 19:41:13 2013 >> New Revision: 253687 >> URL: http://svnweb.freebsd.org/changeset/base/253687 >> >> Log: >> Break out the static, global LACP debug options into a per-lagg unit >> sysctl tree. >> >> * Create a net.link.lagg.X.lacp node > > I think this introduced a lock order reversal. > >> * Add a debug node under that for tx_test and rx_test >> * Add lacp_strict_mode, defaulting to 1 >> >> tx_test and rx_test are still a bitmap of unit numbers for now. >> At some point it would be nice to create child nodes of the lagg bundle >> for each sub-interface, and then populate those with various knobs >> and statistics. >> >> Sponsored by: Netflix >> >> Modified: >> head/sys/net/ieee8023ad_lacp.c >> head/sys/net/ieee8023ad_lacp.h >> head/sys/net/if_lagg.c >> head/sys/net/if_lagg.h >> >> Modified: head/sys/net/ieee8023ad_lacp.c >> ============================================================================== >> --- head/sys/net/ieee8023ad_lacp.c Fri Jul 26 19:11:08 2013 (r253686) >> +++ head/sys/net/ieee8023ad_lacp.c Fri Jul 26 19:41:13 2013 (r253687) > > > ; >> @@ -765,10 +791,19 @@ lacp_attach(struct lagg_softc *sc) >> >> lsc->lsc_hashkey = arc4random(); >> lsc->lsc_active_aggregator = NULL; >> + lsc->lsc_strict_mode = 1; >> LACP_LOCK_INIT(lsc); >> TAILQ_INIT(&lsc->lsc_aggregators); >> LIST_INIT(&lsc->lsc_ports); >> >> + /* Create a child of the parent lagg interface */ >> + oid = SYSCTL_ADD_NODE(&sc->ctx, SYSCTL_CHILDREN(sc->sc_oid), >> + OID_AUTO, "lacp", CTLFLAG_RD, NULL, "LACP"); > > This line grabs a sleepable lock, but we already had a nonsleepable > lock further up the stack, acquired in lagg_ioctl(). > >> + >> + /* Attach sysctl nodes */ >> + lacp_attach_sysctl(lsc, oid); >> + lacp_attach_sysctl_debug(lsc, oid); >> + >> callout_init_mtx(&lsc->lsc_transit_callout, &lsc->lsc_mtx, 0); >> callout_init_mtx(&lsc->lsc_callout, &lsc->lsc_mtx, 0); >> > > Here's the warning from Witness.as well as a warning from UMA. Many > more UMA warnings followed. > > lock order reversal: (sleepable after non-sleepable) > 1st 0xfffff8000252ca08 if_lagg rmlock (if_lagg rmlock) @ > /usr/home/alans/freebsd/head/sys/modules/if_lagg/../../net/if_lagg.c:1040 > 2nd 0xffffffff814ef4e0 sysctl lock (sysctl lock) @ > /usr/home/alans/freebsd/head/sys/kern/kern_sysctl.c:474 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00977485b0 > kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe0097748660 > witness_checkorder() at witness_checkorder+0xdc2/frame 0xfffffe00977486f0 > _sx_xlock() at _sx_xlock+0x75/frame 0xfffffe0097748730 > sysctl_add_oid() at sysctl_add_oid+0x4a/frame 0xfffffe0097748780 > lacp_attach() at lacp_attach+0xf7/frame 0xfffffe00977487f0 > lagg_lacp_attach() at lagg_lacp_attach+0x88/frame 0xfffffe0097748810 > lagg_ioctl() at lagg_ioctl+0x98a/frame 0xfffffe00977488f0 > in_control() at in_control+0x38e/frame 0xfffffe0097748970 > ifioctl() at ifioctl+0xba2/frame 0xfffffe0097748a30 > kern_ioctl() at kern_ioctl+0x22b/frame 0xfffffe0097748a90 > sys_ioctl() at sys_ioctl+0x13c/frame 0xfffffe0097748ae0 > amd64_syscall() at amd64_syscall+0x25a/frame 0xfffffe0097748bf0 > Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe0097748bf0 > --- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x800fa045a, rsp = > 0x7fffffffe118, rbp = 0x7fffffffe1a0 --- > uma_zalloc_arg: zone "128" with the following non-sleepable locks held: > exclusive rm if_lagg rmlock (if_lagg rmlock) r = 0 > (0xfffff8000252ca08) locked @ > /usr/home/alans/freebsd/head/sys/modules/if_lagg/../../net/if_lagg.c:1040 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0097748500 > kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe00977485b0 > witness_warn() at witness_warn+0x4b5/frame 0xfffffe0097748670 > uma_zalloc_arg() at uma_zalloc_arg+0x3b/frame 0xfffffe00977486e0 > malloc() at malloc+0x194/frame 0xfffffe0097748730 > sysctl_add_oid() at sysctl_add_oid+0x11f/frame 0xfffffe0097748780 > lacp_attach() at lacp_attach+0xf7/frame 0xfffffe00977487f0 > lagg_lacp_attach() at lagg_lacp_attach+0x88/frame 0xfffffe0097748810 > lagg_ioctl() at lagg_ioctl+0x98a/frame 0xfffffe00977488f0 > in_control() at in_control+0x38e/frame 0xfffffe0097748970 > ifioctl() at ifioctl+0xba2/frame 0xfffffe0097748a30 > kern_ioctl() at kern_ioctl+0x22b/frame 0xfffffe0097748a90 > sys_ioctl() at sys_ioctl+0x13c/frame 0xfffffe0097748ae0 > amd64_syscall() at amd64_syscall+0x25a/frame 0xfffffe0097748bf0 > Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe0097748bf0 > --- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x800fa045a, rsp = > 0x7fffffffe118, rbp = 0x7fffffffe1a0 --- > > > # uname -a > FreeBSD alans-fbsd-head 11.0-CURRENT FreeBSD 11.0-CURRENT #49 > r264887M: Thu Apr 24 17:21:48 MDT 2014 > alans@ns1.eng.sldomain.com:/vmpool/obj/usr/home/alans/freebsd/head/sys/GENERIC > amd64 > > To reproduce: > ifconfig tap0 create > ifconfig tap1 create > ifconfig tap2 create > ifconfig lagg0 create > ifconfig lagg0 up laggproto lacp laggport tap0 laggport tap1 laggport > tap2 192.0.0.2/24 > > If I create and destroy the lagg in a tight loop, while running > "ifconfig -am" in a tight loop in another terminal, I eventually hit a > general protection fault in __mtx_lock_sleep. I think it might be > related. Do you have a backtrace from this panic? > Can you reproduce this? Do you have any good ideas for a solution? I can reproduce a lot of LOR messages, but no panic. -- WBR, Andrey V. Elsukov From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 16:58:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10D07456; Fri, 25 Apr 2014 16:58:37 +0000 (UTC) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1E211B65; Fri, 25 Apr 2014 16:58:35 +0000 (UTC) Received: by mail-wi0-f169.google.com with SMTP id hm4so2938218wib.0 for ; Fri, 25 Apr 2014 09:58:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Lj3nMWHr6FY8DKpkWOZ02k712zs82nUvhJ+Tt0CWnYE=; b=zFLIbceBe6W9aIvum0kYruq76zUcROBd2txH/+eJ+2ow6RRVWIlW9vNewifZB8BzHm zzt1LzBn6G76ti7abzZuY0YliYBdhOzA1RkglVWVdBLeBjw6+F5rbl8j3kYXElBRx9Xz XO7jYlmOrYfzczA7pK66TsoyEtv0tyPjHkNPIFik/ENLSXImXQ+4f7bLE12kkqxCTZyf SOVOJBXtr6h8iBp7B9iTPImLVgbuN8eUOdrWVDsLq3eoU6pb9Hhz0Edf+9us7ugNOuq6 SswKp38Pi3ywl6t+m2K1JaGzQro13VkRtp1lAni8bMVcwwSjufcLmWa2BXC33V5a4qei rW6w== MIME-Version: 1.0 X-Received: by 10.180.92.131 with SMTP id cm3mr4641669wib.40.1398445113974; Fri, 25 Apr 2014 09:58:33 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.194.168.130 with HTTP; Fri, 25 Apr 2014 09:58:33 -0700 (PDT) In-Reply-To: <535A9093.6010201@FreeBSD.org> References: <201307261941.r6QJfEMO087844@svn.freebsd.org> <535A9093.6010201@FreeBSD.org> Date: Fri, 25 Apr 2014 10:58:33 -0600 X-Google-Sender-Auth: NfAcuk3cDRx3XSWnvSU2_AEafBQ Message-ID: Subject: Re: svn commit: r253687 - head/sys/net From: Alan Somers To: "Andrey V. Elsukov" Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, Alan Somers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 16:58:37 -0000 On Fri, Apr 25, 2014 at 10:42 AM, Andrey V. Elsukov wrote: > On 25.04.2014 19:58, Alan Somers wrote: >> On Fri, Jul 26, 2013 at 1:41 PM, Adrian Chadd wrote: >>> Author: adrian >>> Date: Fri Jul 26 19:41:13 2013 >>> New Revision: 253687 >>> URL: http://svnweb.freebsd.org/changeset/base/253687 >>> >>> Log: >>> Break out the static, global LACP debug options into a per-lagg unit >>> sysctl tree. >>> >>> * Create a net.link.lagg.X.lacp node >> >> I think this introduced a lock order reversal. >> >>> * Add a debug node under that for tx_test and rx_test >>> * Add lacp_strict_mode, defaulting to 1 >>> >>> tx_test and rx_test are still a bitmap of unit numbers for now. >>> At some point it would be nice to create child nodes of the lagg bundle >>> for each sub-interface, and then populate those with various knobs >>> and statistics. >>> >>> Sponsored by: Netflix >>> >>> Modified: >>> head/sys/net/ieee8023ad_lacp.c >>> head/sys/net/ieee8023ad_lacp.h >>> head/sys/net/if_lagg.c >>> head/sys/net/if_lagg.h >>> >>> Modified: head/sys/net/ieee8023ad_lacp.c >>> ============================================================================== >>> --- head/sys/net/ieee8023ad_lacp.c Fri Jul 26 19:11:08 2013 (r253686) >>> +++ head/sys/net/ieee8023ad_lacp.c Fri Jul 26 19:41:13 2013 (r253687) >> >> >> ; >>> @@ -765,10 +791,19 @@ lacp_attach(struct lagg_softc *sc) >>> >>> lsc->lsc_hashkey = arc4random(); >>> lsc->lsc_active_aggregator = NULL; >>> + lsc->lsc_strict_mode = 1; >>> LACP_LOCK_INIT(lsc); >>> TAILQ_INIT(&lsc->lsc_aggregators); >>> LIST_INIT(&lsc->lsc_ports); >>> >>> + /* Create a child of the parent lagg interface */ >>> + oid = SYSCTL_ADD_NODE(&sc->ctx, SYSCTL_CHILDREN(sc->sc_oid), >>> + OID_AUTO, "lacp", CTLFLAG_RD, NULL, "LACP"); >> >> This line grabs a sleepable lock, but we already had a nonsleepable >> lock further up the stack, acquired in lagg_ioctl(). >> >>> + >>> + /* Attach sysctl nodes */ >>> + lacp_attach_sysctl(lsc, oid); >>> + lacp_attach_sysctl_debug(lsc, oid); >>> + >>> callout_init_mtx(&lsc->lsc_transit_callout, &lsc->lsc_mtx, 0); >>> callout_init_mtx(&lsc->lsc_callout, &lsc->lsc_mtx, 0); >>> >> >> Here's the warning from Witness.as well as a warning from UMA. Many >> more UMA warnings followed. >> >> lock order reversal: (sleepable after non-sleepable) >> 1st 0xfffff8000252ca08 if_lagg rmlock (if_lagg rmlock) @ >> /usr/home/alans/freebsd/head/sys/modules/if_lagg/../../net/if_lagg.c:1040 >> 2nd 0xffffffff814ef4e0 sysctl lock (sysctl lock) @ >> /usr/home/alans/freebsd/head/sys/kern/kern_sysctl.c:474 >> KDB: stack backtrace: >> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00977485b0 >> kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe0097748660 >> witness_checkorder() at witness_checkorder+0xdc2/frame 0xfffffe00977486f0 >> _sx_xlock() at _sx_xlock+0x75/frame 0xfffffe0097748730 >> sysctl_add_oid() at sysctl_add_oid+0x4a/frame 0xfffffe0097748780 >> lacp_attach() at lacp_attach+0xf7/frame 0xfffffe00977487f0 >> lagg_lacp_attach() at lagg_lacp_attach+0x88/frame 0xfffffe0097748810 >> lagg_ioctl() at lagg_ioctl+0x98a/frame 0xfffffe00977488f0 >> in_control() at in_control+0x38e/frame 0xfffffe0097748970 >> ifioctl() at ifioctl+0xba2/frame 0xfffffe0097748a30 >> kern_ioctl() at kern_ioctl+0x22b/frame 0xfffffe0097748a90 >> sys_ioctl() at sys_ioctl+0x13c/frame 0xfffffe0097748ae0 >> amd64_syscall() at amd64_syscall+0x25a/frame 0xfffffe0097748bf0 >> Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe0097748bf0 >> --- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x800fa045a, rsp = >> 0x7fffffffe118, rbp = 0x7fffffffe1a0 --- >> uma_zalloc_arg: zone "128" with the following non-sleepable locks held: >> exclusive rm if_lagg rmlock (if_lagg rmlock) r = 0 >> (0xfffff8000252ca08) locked @ >> /usr/home/alans/freebsd/head/sys/modules/if_lagg/../../net/if_lagg.c:1040 >> KDB: stack backtrace: >> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0097748500 >> kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe00977485b0 >> witness_warn() at witness_warn+0x4b5/frame 0xfffffe0097748670 >> uma_zalloc_arg() at uma_zalloc_arg+0x3b/frame 0xfffffe00977486e0 >> malloc() at malloc+0x194/frame 0xfffffe0097748730 >> sysctl_add_oid() at sysctl_add_oid+0x11f/frame 0xfffffe0097748780 >> lacp_attach() at lacp_attach+0xf7/frame 0xfffffe00977487f0 >> lagg_lacp_attach() at lagg_lacp_attach+0x88/frame 0xfffffe0097748810 >> lagg_ioctl() at lagg_ioctl+0x98a/frame 0xfffffe00977488f0 >> in_control() at in_control+0x38e/frame 0xfffffe0097748970 >> ifioctl() at ifioctl+0xba2/frame 0xfffffe0097748a30 >> kern_ioctl() at kern_ioctl+0x22b/frame 0xfffffe0097748a90 >> sys_ioctl() at sys_ioctl+0x13c/frame 0xfffffe0097748ae0 >> amd64_syscall() at amd64_syscall+0x25a/frame 0xfffffe0097748bf0 >> Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe0097748bf0 >> --- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x800fa045a, rsp = >> 0x7fffffffe118, rbp = 0x7fffffffe1a0 --- >> >> >> # uname -a >> FreeBSD alans-fbsd-head 11.0-CURRENT FreeBSD 11.0-CURRENT #49 >> r264887M: Thu Apr 24 17:21:48 MDT 2014 >> alans@ns1.eng.sldomain.com:/vmpool/obj/usr/home/alans/freebsd/head/sys/GENERIC >> amd64 >> >> To reproduce: >> ifconfig tap0 create >> ifconfig tap1 create >> ifconfig tap2 create >> ifconfig lagg0 create >> ifconfig lagg0 up laggproto lacp laggport tap0 laggport tap1 laggport >> tap2 192.0.0.2/24 >> >> If I create and destroy the lagg in a tight loop, while running >> "ifconfig -am" in a tight loop in another terminal, I eventually hit a >> general protection fault in __mtx_lock_sleep. I think it might be >> related. > > Do you have a backtrace from this panic? I can't get a backtrace because every time I panic, my terminal gets screwed up and unresponsive. And I have neither serial port nor firewire setup on this machine. I'll see if I can get automatic core dumps to work. > >> Can you reproduce this? Do you have any good ideas for a solution? > > I can reproduce a lot of LOR messages, but no panic. When I commented out the sysctl statements in lacp_attach, the LOR messages went away. So did the GPF, but instead I got a page fault. It seems that there are many bugs in the lagg creation/destruction code. I shall continue to investigate... > > -- > WBR, Andrey V. Elsukov From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 17:35:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB6EDEED; Fri, 25 Apr 2014 17:35:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9830F10B2; Fri, 25 Apr 2014 17:35:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PHZYC5048298; Fri, 25 Apr 2014 17:35:34 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PHZYSd048297; Fri, 25 Apr 2014 17:35:34 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201404251735.s3PHZYSd048297@svn.freebsd.org> From: Peter Grehan Date: Fri, 25 Apr 2014 17:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264921 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 17:35:34 -0000 Author: grehan Date: Fri Apr 25 17:35:34 2014 New Revision: 264921 URL: http://svnweb.freebsd.org/changeset/base/264921 Log: Respect and track the enable bit in the PCI configuration address word. Ignore writes, and return 0xff's, on config accesses when not set. Behaviour now matches that seen on h/w. Found with a NetBSD/amd64 guest. Reviewed by: tychon MFC after: 3 weeks Modified: head/usr.sbin/bhyve/pci_emul.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Fri Apr 25 16:54:28 2014 (r264920) +++ head/usr.sbin/bhyve/pci_emul.c Fri Apr 25 17:35:34 2014 (r264921) @@ -1508,7 +1508,7 @@ pci_emul_hdrtype_fixup(int bus, int slot } } -static int cfgbus, cfgslot, cfgfunc, cfgoff; +static int cfgenable, cfgbus, cfgslot, cfgfunc, cfgoff; static int pci_emul_cfgaddr(struct vmctx *ctx, int vcpu, int in, int port, int bytes, @@ -1527,9 +1527,12 @@ pci_emul_cfgaddr(struct vmctx *ctx, int (cfgslot << 11) | (cfgfunc << 8) | cfgoff; - *eax = x | CONF1_ENABLE; + if (cfgenable) + x |= CONF1_ENABLE; + *eax = x; } else { x = *eax; + cfgenable = (x & CONF1_ENABLE) == CONF1_ENABLE; cfgoff = x & PCI_REGMAX; cfgfunc = (x >> 8) & PCI_FUNCMAX; cfgslot = (x >> 11) & PCI_SLOTMAX; @@ -1629,10 +1632,11 @@ pci_emul_cfgdata(struct vmctx *ctx, int #endif /* - * Just return if there is no device at this cfgslot:cfgfunc or - * if the guest is doing an un-aligned access + * Just return if there is no device at this cfgslot:cfgfunc, + * if the guest is doing an un-aligned access, or if the config + * address word isn't enabled. */ - if (pi == NULL || (coff & (bytes - 1)) != 0) { + if (!cfgenable || pi == NULL || (coff & (bytes - 1)) != 0) { if (in) *eax = 0xffffffff; return (0); From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 18:09:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 187989D6; Fri, 25 Apr 2014 18:09:11 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F9F6144B; Fri, 25 Apr 2014 18:09:09 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s3PI90it094325 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 25 Apr 2014 22:09:00 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s3PI90u7094324; Fri, 25 Apr 2014 22:09:00 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 25 Apr 2014 22:09:00 +0400 From: Gleb Smirnoff To: Alan Somers Subject: Re: svn commit: r253687 - head/sys/net Message-ID: <20140425180900.GP85571@FreeBSD.org> References: <201307261941.r6QJfEMO087844@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 18:09:11 -0000 On Fri, Apr 25, 2014 at 09:58:31AM -0600, Alan Somers wrote: A> On Fri, Jul 26, 2013 at 1:41 PM, Adrian Chadd wrote: A> > Author: adrian A> > Date: Fri Jul 26 19:41:13 2013 A> > New Revision: 253687 A> > URL: http://svnweb.freebsd.org/changeset/base/253687 A> > A> > Log: A> > Break out the static, global LACP debug options into a per-lagg unit A> > sysctl tree. A> > A> > * Create a net.link.lagg.X.lacp node A> A> I think this introduced a lock order reversal. A> A> > * Add a debug node under that for tx_test and rx_test A> > * Add lacp_strict_mode, defaulting to 1 A> > A> > tx_test and rx_test are still a bitmap of unit numbers for now. A> > At some point it would be nice to create child nodes of the lagg bundle A> > for each sub-interface, and then populate those with various knobs A> > and statistics. A> > A> > Sponsored by: Netflix Also, these sysctl nodes were promised to be removed soon: http://lists.freebsd.org/pipermail/svn-src-head/2013-July/049602.html -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 18:46:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A65A37C; Fri, 25 Apr 2014 18:46:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E952A189D; Fri, 25 Apr 2014 18:46:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PIksBs082183; Fri, 25 Apr 2014 18:46:54 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PIksf0082181; Fri, 25 Apr 2014 18:46:54 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404251846.s3PIksf0082181@svn.freebsd.org> From: Glen Barber Date: Fri, 25 Apr 2014 18:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264922 - in head/release: amd64 i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 18:46:55 -0000 Author: gjb Date: Fri Apr 25 18:46:54 2014 New Revision: 264922 URL: http://svnweb.freebsd.org/changeset/base/264922 Log: Revert r264907 and r264908: Restore make-memstick.sh back to its original state to unbreak booting for machines that do not support GPT. I have in-progress work to keep the MBR layout and add the EFI partition, but it is not yet ready, and does need at least one full release build to be certain it does not break. Sponsored by: The FreeBSD Foundation Modified: head/release/amd64/make-memstick.sh head/release/i386/make-memstick.sh Modified: head/release/amd64/make-memstick.sh ============================================================================== --- head/release/amd64/make-memstick.sh Fri Apr 25 17:35:34 2014 (r264921) +++ head/release/amd64/make-memstick.sh Fri Apr 25 18:46:54 2014 (r264922) @@ -3,7 +3,7 @@ # This script generates a "memstick image" (image that can be copied to a # USB memory stick) from a directory tree. Note that the script does not # clean up after itself very well for error conditions on purpose so the -# problem can be diagnosed. +# problem can be diagnosed (full filesystem most likely but ...). # # Usage: make-memstick.sh # @@ -13,81 +13,36 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH -BLOCKSIZE=10240 - if [ $# -ne 2 ]; then - echo "make-memstick.sh /path/to/directory /path/to/image/file" - exit 1 + echo "make-memstick.sh /path/to/directory /path/to/image/file" + exit 1 fi -tempfile="${2}.$$" - if [ ! -d ${1} ]; then - echo "${1} must be a directory" - exit 1 + echo "${1} must be a directory" + exit 1 fi if [ -e ${2} ]; then - echo "won't overwrite ${2}" - exit 1 + echo "won't overwrite ${2}" + exit 1 fi -rm -f ${tempfile} -echo "/dev/gpt/rootfs / ufs ro,noatime 1 1" > ${1}/etc/fstab -makefs ${tempfile} ${1} +echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab +makefs -B little -o label=FreeBSD_Install ${2} ${1} if [ $? -ne 0 ]; then - echo "makefs failed" - exit 1 + echo "makefs failed" + exit 1 fi rm ${1}/etc/fstab -# -# Use $BLOCKSIZE for transfers to improve efficiency. When calculating -# how many blocks to transfer "+ 520" is to account for truncation in the -# division and to provide ample padding. -# - -filesize=$(stat -f "%z" ${tempfile}) -blocks=$(( ${filesize} / ${BLOCKSIZE} + 520 )) -dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks} -if [ $? -ne 0 ]; then - echo "creation of image file failed" - exit 1 -fi - unit=`mdconfig -a -t vnode -f ${2}` if [ $? -ne 0 ]; then - echo "mdconfig failed" - exit 1 -fi - -gpart create -s gpt /dev/${unit} -if [ $? -ne 0 ]; then - echo "GPT creation failed" - exit 1 + echo "mdconfig failed" + exit 1 fi -gpart add -t freebsd-boot -s 512k /dev/${unit} -if [ $? -ne 0 ]; then - echo "Creating boot partition failed" - exit 1 -fi -gpart bootcode -b ${1}/boot/pmbr -p ${1}/boot/gptboot -i 1 /dev/${unit} -if [ $? -ne 0 ]; then - echo "Writing bootcode failed" - exit 1 -fi -gpart add -t freebsd-ufs -l rootfs /dev/${unit} -if [ $? -ne 0 ]; then - echo "Creating UFS partition failed" - exit 1 -fi - -dd if=${tempfile} of=/dev/${unit}p2 bs=$BLOCKSIZE conv=sync -if [ $? -ne 0 ]; then - echo "copying filesystem into image file failed" - exit 1 -fi - +gpart create -s BSD ${unit} +gpart bootcode -b ${1}/boot/boot ${unit} +gpart add -t freebsd-ufs ${unit} mdconfig -d -u ${unit} -rm -f ${tempfile} Modified: head/release/i386/make-memstick.sh ============================================================================== --- head/release/i386/make-memstick.sh Fri Apr 25 17:35:34 2014 (r264921) +++ head/release/i386/make-memstick.sh Fri Apr 25 18:46:54 2014 (r264922) @@ -3,7 +3,7 @@ # This script generates a "memstick image" (image that can be copied to a # USB memory stick) from a directory tree. Note that the script does not # clean up after itself very well for error conditions on purpose so the -# problem can be diagnosed. +# problem can be diagnosed (full filesystem most likely but ...). # # Usage: make-memstick.sh # @@ -13,81 +13,36 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH -BLOCKSIZE=10240 - if [ $# -ne 2 ]; then - echo "make-memstick.sh /path/to/directory /path/to/image/file" - exit 1 + echo "make-memstick.sh /path/to/directory /path/to/image/file" + exit 1 fi -tempfile="${2}.$$" - if [ ! -d ${1} ]; then - echo "${1} must be a directory" - exit 1 + echo "${1} must be a directory" + exit 1 fi if [ -e ${2} ]; then - echo "won't overwrite ${2}" - exit 1 + echo "won't overwrite ${2}" + exit 1 fi -rm -f ${tempfile} -echo "/dev/gpt/rootfs / ufs ro,noatime 1 1" > ${1}/etc/fstab -makefs ${tempfile} ${1} +echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab +makefs -B little -o label=FreeBSD_Install ${2} ${1} if [ $? -ne 0 ]; then - echo "makefs failed" - exit 1 + echo "makefs failed" + exit 1 fi rm ${1}/etc/fstab -# -# Use $BLOCKSIZE for transfers to improve efficiency. When calculating -# how many blocks to transfer "+ 520" is to account for truncation in the -# division and to provide ample padding. -# - -filesize=$(stat -f "%z" ${tempfile}) -blocks=$(( ${filesize} / ${BLOCKSIZE} + 520 )) -dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks} -if [ $? -ne 0 ]; then - echo "creation of image file failed" - exit 1 -fi - unit=`mdconfig -a -t vnode -f ${2}` if [ $? -ne 0 ]; then - echo "mdconfig failed" - exit 1 -fi - -gpart create -s gpt /dev/${unit} -if [ $? -ne 0 ]; then - echo "GPT creation failed" - exit 1 + echo "mdconfig failed" + exit 1 fi -gpart add -t freebsd-boot -s 512k /dev/${unit} -if [ $? -ne 0 ]; then - echo "Creating boot partition failed" - exit 1 -fi -gpart bootcode -b ${1}/boot/pmbr -p ${1}/boot/gptboot -i 1 /dev/${unit} -if [ $? -ne 0 ]; then - echo "Writing bootcode failed" - exit 1 -fi -gpart add -t freebsd-ufs -l rootfs /dev/${unit} -if [ $? -ne 0 ]; then - echo "Creating UFS partition failed" - exit 1 -fi - -dd if=${tempfile} of=/dev/${unit}p2 bs=$BLOCKSIZE conv=sync -if [ $? -ne 0 ]; then - echo "copying filesystem into image file failed" - exit 1 -fi - +gpart create -s BSD ${unit} +gpart bootcode -b ${1}/boot/boot ${unit} +gpart add -t freebsd-ufs ${unit} mdconfig -d -u ${unit} -rm -f ${tempfile} From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 19:13:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 158239A7; Fri, 25 Apr 2014 19:13:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3D7F1B3D; Fri, 25 Apr 2014 19:13:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PJDvqQ094032; Fri, 25 Apr 2014 19:13:57 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PJDvdo094030; Fri, 25 Apr 2014 19:13:57 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404251913.s3PJDvdo094030@svn.freebsd.org> From: Ian Lepore Date: Fri, 25 Apr 2014 19:13:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264923 - head/sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 19:13:58 -0000 Author: ian Date: Fri Apr 25 19:13:57 2014 New Revision: 264923 URL: http://svnweb.freebsd.org/changeset/base/264923 Log: Remove device type from the uftdi_devs table, enhance the jtag-skip feature. Device type and revision is now determined from the bcdDevice field and doesn't need to be in the table at all. The feature that skips creation of /dev/ttyU* entries for jtag and gpio interfaces is enhanced: - The feature is now optional, but enabled by default. A tunable and sysctl are available to control it: hw.usb.uftdi.skip_jtag_interfaces. - We no longer assume interface #0 is the only jtag interface. Up to eight interfaces per chip can be flagged as jtag. (Current ftdi chips support a max of 4 interfaces; this leaves room for growth.) - Some manufacturers don't change the product ID or use the same ID for different devices intended for both serial-comms and jtag/gpio use. Often while the product ID is the same, the product name string is different, so it's now possible to search for the product name in a table of strings and get the set of non-tty interfaces from that table. Modified: head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/serial/uftdi_reg.h Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Fri Apr 25 18:46:54 2014 (r264922) +++ head/sys/dev/usb/serial/uftdi.c Fri Apr 25 19:13:57 2014 (r264923) @@ -82,16 +82,15 @@ __FBSDID("$FreeBSD$"); #include #include +static SYSCTL_NODE(_hw_usb, OID_AUTO, uftdi, CTLFLAG_RW, 0, "USB uftdi"); + #ifdef USB_DEBUG static int uftdi_debug = 0; - -static SYSCTL_NODE(_hw_usb, OID_AUTO, uftdi, CTLFLAG_RW, 0, "USB uftdi"); SYSCTL_INT(_hw_usb_uftdi, OID_AUTO, debug, CTLFLAG_RW, &uftdi_debug, 0, "Debug level"); #endif #define UFTDI_CONFIG_INDEX 0 -#define UFTDI_IFACE_INDEX_JTAG 0 /* * IO buffer sizes and FTDI device procotol sizes. @@ -273,645 +272,701 @@ MODULE_VERSION(uftdi, 1); static const STRUCT_USB_HOST_ID uftdi_devs[] = { #define UFTDI_DEV(v, p, i) \ { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } - UFTDI_DEV(ACTON, SPECTRAPRO, UFTDI_TYPE_AUTO), - UFTDI_DEV(ALTI2, N3, UFTDI_TYPE_AUTO), - UFTDI_DEV(ANALOGDEVICES, GNICE, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(ANALOGDEVICES, GNICEPLUS, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(ATMEL, STK541, UFTDI_TYPE_8U232AM), - UFTDI_DEV(BAYER, CONTOUR_CABLE, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, 232USB9M, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, 485USB9F_2W, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, 485USB9F_4W, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, 485USBTB_2W, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, 485USBTB_4W, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, TTL3USB9M, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, TTL5USB9M, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USO9ML2, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USO9ML2DR, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USO9ML2DR_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USOPTL4, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USOPTL4DR, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USOPTL4DR2, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USOTL4, UFTDI_TYPE_8U232AM), - UFTDI_DEV(BBELECTRONICS, USPTL4, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, USTL4, UFTDI_TYPE_AUTO), - UFTDI_DEV(BBELECTRONICS, ZZ_PROG1_USB, UFTDI_TYPE_AUTO), - UFTDI_DEV(CONTEC, COM1USBH, UFTDI_TYPE_AUTO), - UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, UFTDI_TYPE_8U232AM), - UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, UFTDI_TYPE_8U232AM), - UFTDI_DEV(DRESDENELEKTRONIK, LEVELSHIFTERSTICKLOWCOST, UFTDI_TYPE_8U232AM), - UFTDI_DEV(ELEKTOR, FT323R, UFTDI_TYPE_AUTO), - UFTDI_DEV(EVOLUTION, ER1, UFTDI_TYPE_AUTO), - UFTDI_DEV(EVOLUTION, HYBRID, UFTDI_TYPE_AUTO), - UFTDI_DEV(EVOLUTION, RCM4, UFTDI_TYPE_AUTO), - UFTDI_DEV(FALCOM, SAMBA, UFTDI_TYPE_AUTO), - UFTDI_DEV(FALCOM, TWIST, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FIC, NEO1973_DEBUG, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FIC, NEO1973_DEBUG, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, 232EX, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, 232H, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, 232RL, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, 4N_GALAXY_DE_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, 4N_GALAXY_DE_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, 4N_GALAXY_DE_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, 8U232AM_ALT, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ACCESSO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ACG_HFDUAL, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ACTIVE_ROBOTS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ACTZWAVE, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, AMC232, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ARTEMIS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ASK_RDR400, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ATIK_ATK16, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ATIK_ATK16C, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ATIK_ATK16HR, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ATIK_ATK16HRC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ATIK_ATK16IC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, BCS_SE923, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, BEAGLEBONE, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CANDAPTER, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CANUSB, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CCSICDU20_0, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CCSICDU40_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CCSICDU64_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CCSLOAD_N_GO_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CCSMACHX_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CCSPRIME8_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CFA_631, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CFA_632, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CFA_633, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CFA_634, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CFA_635, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CHAMSYS_24_MASTER_WING, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_MAXI_WING, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_MEDIA_WING, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_MIDI_TIMECODE, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_MINI_WING, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_PC_WING, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_USB_DMX, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CHAMSYS_WING, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, COM4SM, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_0, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_6, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CONVERTER_7, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, CTI_USB_MINI_485, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, CTI_USB_NANO_485, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, DMX4ALL, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, DOMINTELL_DGQG, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, DOMINTELL_DUSB, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, DOTEC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ECLO_COM_1WIRE, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ECO_PRO_CDS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, EISCOU, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, ELSTER_UNICOM, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_ALC8500, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_CLI7000, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_CSI8, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_EC3000, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_EM1000DL, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_EM1010PC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_FEM, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_FHZ1000PC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_FHZ1300PC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_FM3RX, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_FS20SIG, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_HS485, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_KL100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_MSM1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_PCD200, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_PCK100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_PPS7330, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_RFP500, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_T1100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_TFD128, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_TFM100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_TWS550, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UAD8, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UDA7, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UDF77, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UIO88, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_ULA200, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UM100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UMS100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UO100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UR100, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_USI2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_USR, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_UTP8, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_WS300PC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_WS444PC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_WS500, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_WS550, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_WS777, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, ELV_WS888, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, EMCU2D, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, EMCU2H, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, FUTURE_0, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, FUTURE_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, FUTURE_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GAMMASCOUT, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, GENERIC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E808, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E809, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E80A, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E80B, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E80C, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E80D, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E80E, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E80F, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E88D, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E88E, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, GUDEADS_E88F, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, HD_RADIO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, HO720, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, HO730, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, HO820, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, HO870, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_APP70, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_PCMCIA, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_PEDO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_PICPRO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_PK1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_PROD, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_RS232MON, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IBS_US485, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IPLUS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IPLUS2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, IRTRANS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, KBS, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, KTLINK, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, LENZ_LIUSB, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, LK202, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, LK204, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, LM3S_DEVEL_BOARD, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, LM3S_EVAL_BOARD, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, LM3S_ICDI_B_BOARD, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, MASTERDEVEL2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MAXSTREAM, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, MHAM_DB9, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_IC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_KW, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_RS232, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_Y6, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_Y8, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_Y9, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MHAM_YS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MICRO_CHAMELEON, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MTXORB_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MTXORB_6, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, MX2_3, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, MX4_5, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, NXTCAM, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, OCEANIC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, OOCDLINK, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, OPENDCC, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, OPENDCC_GATEWAY, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, OPENDCC_GBM, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, OPENDCC_SNIFFER, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, OPENDCC_THROTTLE, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, PCDJ_DAC2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, PCMSFU, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, PERLE_ULTRAPORT, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, PHI_FISCO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, PIEGROUP, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, PROPOX_JTAGCABLEII, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, R2000KU_TRUE_RNG, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, R2X0, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, RELAIS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, REU_TINY, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, RMP200, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, RM_CANVIEW, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, RRCIRKITS_LOCOBUFFER, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCIENCESCOPE_HS_LOGBOOK, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCIENCESCOPE_LOGBOOKML, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCIENCESCOPE_LS_LOGBOOK, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_0, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_6, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SCS_DEVICE_7, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SDMUSBQSS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SEMC_DSS20, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, SERIAL_2232C, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, SERIAL_2232D, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, SERIAL_232RL, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SERIAL_4232H, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, SERIAL_8U100AX, UFTDI_TYPE_SIO), - UFTDI_DEV(FTDI, SERIAL_8U232AM, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, SERIAL_8U232AM4, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, SIGNALYZER_SH2, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, SIGNALYZER_SH4, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, SIGNALYZER_SLITE, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, SIGNALYZER_ST, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, SPECIAL_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SPECIAL_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SPECIAL_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SPROG_II, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SR_RADIO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, SUUNTO_SPORTS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13M, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13S, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13U, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, TAVIR_STK500, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, TERATRONIK_D2XX, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, TERATRONIK_VCP, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, THORLABS, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, TNC_X, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, TTUSB, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, TURTELIZER2, UFTDI_TYPE_8U232AM | UFTDI_FLAG_JTAG), - UFTDI_DEV(FTDI, UOPTBR, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, USBSERIAL, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, USBX_707, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, USB_UIRT, UFTDI_TYPE_8U232AM), - UFTDI_DEV(FTDI, USINT_CAT, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, USINT_RS232, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, USINT_WKEY, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, VARDAAN, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, VNHCPCUSB_D, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, WESTREX_MODEL_777, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, WESTREX_MODEL_8900F, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, XF_547, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, XF_640, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, XF_642, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, XM_RADIO, UFTDI_TYPE_AUTO), - UFTDI_DEV(FTDI, YEI_SERVOCENTER31, UFTDI_TYPE_AUTO), - UFTDI_DEV(GNOTOMETRICS, USB, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, SP1, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, OPC_U_UC, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2C1, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2C2, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2D, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2KVR, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2KVT, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2VR, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP2VT, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP4KVR, UFTDI_TYPE_AUTO), - UFTDI_DEV(ICOM, RP4KVT, UFTDI_TYPE_AUTO), - UFTDI_DEV(IDTECH, IDT1221U, UFTDI_TYPE_AUTO), - UFTDI_DEV(INTERBIOMETRICS, IOBOARD, UFTDI_TYPE_AUTO), - UFTDI_DEV(INTERBIOMETRICS, MINI_IOBOARD, UFTDI_TYPE_AUTO), - UFTDI_DEV(INTREPIDCS, NEOVI, UFTDI_TYPE_8U232AM), - UFTDI_DEV(INTREPIDCS, VALUECAN, UFTDI_TYPE_8U232AM), - UFTDI_DEV(IONICS, PLUGCOMPUTER, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(JETI, SPC1201, UFTDI_TYPE_AUTO), - UFTDI_DEV(KOBIL, CONV_B1, UFTDI_TYPE_AUTO), - UFTDI_DEV(KOBIL, CONV_KAAN, UFTDI_TYPE_AUTO), - UFTDI_DEV(LARSENBRUSGAARD, ALTITRACK, UFTDI_TYPE_AUTO), - UFTDI_DEV(MARVELL, SHEEVAPLUG, UFTDI_TYPE_8U232AM), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0100, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0101, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0102, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0103, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0104, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0105, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0106, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0107, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0108, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0109, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0110, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0111, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0112, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0113, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0114, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0115, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0116, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0117, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0118, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0119, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0120, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0121, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0122, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0123, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0124, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0125, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0126, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0128, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0129, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0130, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0131, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0132, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0133, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0134, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0135, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0136, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0137, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0138, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0139, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_013F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0140, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0141, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0142, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0143, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0144, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0145, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0146, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0147, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0148, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0149, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_014F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0150, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0151, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0152, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0159, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_015F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0160, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0161, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0162, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0163, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0164, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0165, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0166, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0167, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0168, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0169, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_016F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0170, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0171, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0172, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0173, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0174, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0175, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0176, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0177, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0178, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0179, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_017F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0180, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0181, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0182, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0183, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0184, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0185, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0186, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0187, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0188, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0189, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_018F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0190, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0191, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0192, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0193, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0194, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0195, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0196, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0197, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0198, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0199, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019A, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019B, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019C, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019D, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019E, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_019F, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A0, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A1, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A2, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A3, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A4, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A5, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A6, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A7, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A8, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01A9, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AA, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AB, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AC, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AD, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AE, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01AF, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B0, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B1, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B2, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B3, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B4, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B5, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B6, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B7, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B8, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01B9, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BA, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BB, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BC, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BD, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BE, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01BF, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C0, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C1, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C2, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C3, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C4, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C5, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C6, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C7, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C8, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01C9, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CA, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CB, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CC, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CD, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CE, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01CF, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D0, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D1, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D2, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D3, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D4, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D5, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D6, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D7, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D8, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01D9, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DA, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DB, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DC, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DD, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DE, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01DF, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E0, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E1, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E2, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E3, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E4, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E5, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E6, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E7, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E8, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01E9, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EA, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EB, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EC, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01ED, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EE, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01EF, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F0, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F1, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F2, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F3, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F4, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F5, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F6, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F7, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F8, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01F9, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FA, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FB, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FC, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FD, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FE, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_01FF, UFTDI_TYPE_AUTO), - UFTDI_DEV(MATRIXORBITAL, MOUA, UFTDI_TYPE_8U232AM), - UFTDI_DEV(MELCO, PCOPRS1, UFTDI_TYPE_8U232AM), - UFTDI_DEV(METAGEEK, TELLSTICK, UFTDI_TYPE_AUTO), - UFTDI_DEV(MOBILITY, USB_SERIAL, UFTDI_TYPE_AUTO), - UFTDI_DEV(OLIMEX, ARM_USB_OCD, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(OLIMEX, ARM_USB_OCD_H, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(OPTO, CRD7734, UFTDI_TYPE_AUTO), - UFTDI_DEV(OPTO, CRD7734_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, AD4USB, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, AP485, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, AP485_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, DRAK5, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, DRAK6, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, GMSR, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, GMUX, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, IRAMP, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, LEC, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, MU, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO10X1, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO2X16, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO2X2, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO30X3, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO3X32, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO4X4, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO60X3, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, QUIDO8X8, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB232, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB422, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB422_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB485, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB485C, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB485S, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SB485_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, SIMUKEY, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, TMU, UFTDI_TYPE_AUTO), - UFTDI_DEV(PAPOUCH, UPSUSB, UFTDI_TYPE_AUTO), - UFTDI_DEV(POSIFLEX, PP7000, UFTDI_TYPE_AUTO), - UFTDI_DEV(QIHARDWARE, JTAGSERIAL, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), - UFTDI_DEV(RATOC, REXUSB60F, UFTDI_TYPE_8U232AM), - UFTDI_DEV(RTSYSTEMS, CT29B, UFTDI_TYPE_AUTO), - UFTDI_DEV(RTSYSTEMS, SERIAL_VX7, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2101, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2102, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2103, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2104, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2106, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2201_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2201_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2202_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2202_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2203_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2203_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2401_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2401_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2401_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2401_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2402_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2402_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2402_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2402_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2403_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2403_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2403_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2403_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_6, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_7, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2801_8, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_6, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_7, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2802_8, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_1, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_2, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_3, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_4, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_5, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_6, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_7, UFTDI_TYPE_AUTO), - UFTDI_DEV(SEALEVEL, 2803_8, UFTDI_TYPE_AUTO), - UFTDI_DEV(SIIG2, DK201, UFTDI_TYPE_AUTO), - UFTDI_DEV(SIIG2, US2308, UFTDI_TYPE_8U232AM), - UFTDI_DEV(TESTO, USB_INTERFACE, UFTDI_TYPE_AUTO), - UFTDI_DEV(TML, USB_SERIAL, UFTDI_TYPE_AUTO), - UFTDI_DEV(TTI, QL355P, UFTDI_TYPE_AUTO), - UFTDI_DEV(UNKNOWN4, NF_RIC, UFTDI_TYPE_AUTO), + UFTDI_DEV(ACTON, SPECTRAPRO, 0), + UFTDI_DEV(ALTI2, N3, 0), + UFTDI_DEV(ANALOGDEVICES, GNICE, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(ANALOGDEVICES, GNICEPLUS, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(ATMEL, STK541, 0), + UFTDI_DEV(BAYER, CONTOUR_CABLE, 0), + UFTDI_DEV(BBELECTRONICS, 232USB9M, 0), + UFTDI_DEV(BBELECTRONICS, 485USB9F_2W, 0), + UFTDI_DEV(BBELECTRONICS, 485USB9F_4W, 0), + UFTDI_DEV(BBELECTRONICS, 485USBTB_2W, 0), + UFTDI_DEV(BBELECTRONICS, 485USBTB_4W, 0), + UFTDI_DEV(BBELECTRONICS, TTL3USB9M, 0), + UFTDI_DEV(BBELECTRONICS, TTL5USB9M, 0), + UFTDI_DEV(BBELECTRONICS, USO9ML2, 0), + UFTDI_DEV(BBELECTRONICS, USO9ML2DR, 0), + UFTDI_DEV(BBELECTRONICS, USO9ML2DR_2, 0), + UFTDI_DEV(BBELECTRONICS, USOPTL4, 0), + UFTDI_DEV(BBELECTRONICS, USOPTL4DR, 0), + UFTDI_DEV(BBELECTRONICS, USOPTL4DR2, 0), + UFTDI_DEV(BBELECTRONICS, USOTL4, 0), + UFTDI_DEV(BBELECTRONICS, USPTL4, 0), + UFTDI_DEV(BBELECTRONICS, USTL4, 0), + UFTDI_DEV(BBELECTRONICS, ZZ_PROG1_USB, 0), + UFTDI_DEV(CONTEC, COM1USBH, 0), + UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, 0), + UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, 0), + UFTDI_DEV(DRESDENELEKTRONIK, LEVELSHIFTERSTICKLOWCOST, 0), + UFTDI_DEV(ELEKTOR, FT323R, 0), + UFTDI_DEV(EVOLUTION, ER1, 0), + UFTDI_DEV(EVOLUTION, HYBRID, 0), + UFTDI_DEV(EVOLUTION, RCM4, 0), + UFTDI_DEV(FALCOM, SAMBA, 0), + UFTDI_DEV(FALCOM, TWIST, 0), + UFTDI_DEV(FIC, NEO1973_DEBUG, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FIC, NEO1973_DEBUG, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, 232EX, 0), + UFTDI_DEV(FTDI, 232H, 0), + UFTDI_DEV(FTDI, 232RL, 0), + UFTDI_DEV(FTDI, 4N_GALAXY_DE_1, 0), + UFTDI_DEV(FTDI, 4N_GALAXY_DE_2, 0), + UFTDI_DEV(FTDI, 4N_GALAXY_DE_3, 0), + UFTDI_DEV(FTDI, 8U232AM_ALT, 0), + UFTDI_DEV(FTDI, ACCESSO, 0), + UFTDI_DEV(FTDI, ACG_HFDUAL, 0), + UFTDI_DEV(FTDI, ACTIVE_ROBOTS, 0), + UFTDI_DEV(FTDI, ACTZWAVE, 0), + UFTDI_DEV(FTDI, AMC232, 0), + UFTDI_DEV(FTDI, ARTEMIS, 0), + UFTDI_DEV(FTDI, ASK_RDR400, 0), + UFTDI_DEV(FTDI, ATIK_ATK16, 0), + UFTDI_DEV(FTDI, ATIK_ATK16C, 0), + UFTDI_DEV(FTDI, ATIK_ATK16HR, 0), + UFTDI_DEV(FTDI, ATIK_ATK16HRC, 0), + UFTDI_DEV(FTDI, ATIK_ATK16IC, 0), + UFTDI_DEV(FTDI, BCS_SE923, 0), + UFTDI_DEV(FTDI, BEAGLEBONE, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, CANDAPTER, 0), + UFTDI_DEV(FTDI, CANUSB, 0), + UFTDI_DEV(FTDI, CCSICDU20_0, 0), + UFTDI_DEV(FTDI, CCSICDU40_1, 0), + UFTDI_DEV(FTDI, CCSICDU64_4, 0), + UFTDI_DEV(FTDI, CCSLOAD_N_GO_3, 0), + UFTDI_DEV(FTDI, CCSMACHX_2, 0), + UFTDI_DEV(FTDI, CCSPRIME8_5, 0), + UFTDI_DEV(FTDI, CFA_631, 0), + UFTDI_DEV(FTDI, CFA_632, 0), + UFTDI_DEV(FTDI, CFA_633, 0), + UFTDI_DEV(FTDI, CFA_634, 0), + UFTDI_DEV(FTDI, CFA_635, 0), + UFTDI_DEV(FTDI, CHAMSYS_24_MASTER_WING, 0), + UFTDI_DEV(FTDI, CHAMSYS_MAXI_WING, 0), + UFTDI_DEV(FTDI, CHAMSYS_MEDIA_WING, 0), + UFTDI_DEV(FTDI, CHAMSYS_MIDI_TIMECODE, 0), + UFTDI_DEV(FTDI, CHAMSYS_MINI_WING, 0), + UFTDI_DEV(FTDI, CHAMSYS_PC_WING, 0), + UFTDI_DEV(FTDI, CHAMSYS_USB_DMX, 0), + UFTDI_DEV(FTDI, CHAMSYS_WING, 0), + UFTDI_DEV(FTDI, COM4SM, 0), + UFTDI_DEV(FTDI, CONVERTER_0, 0), + UFTDI_DEV(FTDI, CONVERTER_1, 0), + UFTDI_DEV(FTDI, CONVERTER_2, 0), + UFTDI_DEV(FTDI, CONVERTER_3, 0), + UFTDI_DEV(FTDI, CONVERTER_4, 0), + UFTDI_DEV(FTDI, CONVERTER_5, 0), + UFTDI_DEV(FTDI, CONVERTER_6, 0), + UFTDI_DEV(FTDI, CONVERTER_7, 0), + UFTDI_DEV(FTDI, CTI_USB_MINI_485, 0), + UFTDI_DEV(FTDI, CTI_USB_NANO_485, 0), + UFTDI_DEV(FTDI, DMX4ALL, 0), + UFTDI_DEV(FTDI, DOMINTELL_DGQG, 0), + UFTDI_DEV(FTDI, DOMINTELL_DUSB, 0), + UFTDI_DEV(FTDI, DOTEC, 0), + UFTDI_DEV(FTDI, ECLO_COM_1WIRE, 0), + UFTDI_DEV(FTDI, ECO_PRO_CDS, 0), + UFTDI_DEV(FTDI, EISCOU, 0), + UFTDI_DEV(FTDI, ELSTER_UNICOM, 0), + UFTDI_DEV(FTDI, ELV_ALC8500, 0), + UFTDI_DEV(FTDI, ELV_CLI7000, 0), + UFTDI_DEV(FTDI, ELV_CSI8, 0), + UFTDI_DEV(FTDI, ELV_EC3000, 0), + UFTDI_DEV(FTDI, ELV_EM1000DL, 0), + UFTDI_DEV(FTDI, ELV_EM1010PC, 0), + UFTDI_DEV(FTDI, ELV_FEM, 0), + UFTDI_DEV(FTDI, ELV_FHZ1000PC, 0), + UFTDI_DEV(FTDI, ELV_FHZ1300PC, 0), + UFTDI_DEV(FTDI, ELV_FM3RX, 0), + UFTDI_DEV(FTDI, ELV_FS20SIG, 0), + UFTDI_DEV(FTDI, ELV_HS485, 0), + UFTDI_DEV(FTDI, ELV_KL100, 0), + UFTDI_DEV(FTDI, ELV_MSM1, 0), + UFTDI_DEV(FTDI, ELV_PCD200, 0), + UFTDI_DEV(FTDI, ELV_PCK100, 0), + UFTDI_DEV(FTDI, ELV_PPS7330, 0), + UFTDI_DEV(FTDI, ELV_RFP500, 0), + UFTDI_DEV(FTDI, ELV_T1100, 0), + UFTDI_DEV(FTDI, ELV_TFD128, 0), + UFTDI_DEV(FTDI, ELV_TFM100, 0), + UFTDI_DEV(FTDI, ELV_TWS550, 0), + UFTDI_DEV(FTDI, ELV_UAD8, 0), + UFTDI_DEV(FTDI, ELV_UDA7, 0), + UFTDI_DEV(FTDI, ELV_UDF77, 0), + UFTDI_DEV(FTDI, ELV_UIO88, 0), + UFTDI_DEV(FTDI, ELV_ULA200, 0), + UFTDI_DEV(FTDI, ELV_UM100, 0), + UFTDI_DEV(FTDI, ELV_UMS100, 0), + UFTDI_DEV(FTDI, ELV_UO100, 0), + UFTDI_DEV(FTDI, ELV_UR100, 0), + UFTDI_DEV(FTDI, ELV_USI2, 0), + UFTDI_DEV(FTDI, ELV_USR, 0), + UFTDI_DEV(FTDI, ELV_UTP8, 0), + UFTDI_DEV(FTDI, ELV_WS300PC, 0), + UFTDI_DEV(FTDI, ELV_WS444PC, 0), + UFTDI_DEV(FTDI, ELV_WS500, 0), + UFTDI_DEV(FTDI, ELV_WS550, 0), + UFTDI_DEV(FTDI, ELV_WS777, 0), + UFTDI_DEV(FTDI, ELV_WS888, 0), + UFTDI_DEV(FTDI, EMCU2D, 0), + UFTDI_DEV(FTDI, EMCU2H, 0), + UFTDI_DEV(FTDI, FUTURE_0, 0), + UFTDI_DEV(FTDI, FUTURE_1, 0), + UFTDI_DEV(FTDI, FUTURE_2, 0), + UFTDI_DEV(FTDI, GAMMASCOUT, 0), + UFTDI_DEV(FTDI, GENERIC, 0), + UFTDI_DEV(FTDI, GUDEADS_E808, 0), + UFTDI_DEV(FTDI, GUDEADS_E809, 0), + UFTDI_DEV(FTDI, GUDEADS_E80A, 0), + UFTDI_DEV(FTDI, GUDEADS_E80B, 0), + UFTDI_DEV(FTDI, GUDEADS_E80C, 0), + UFTDI_DEV(FTDI, GUDEADS_E80D, 0), + UFTDI_DEV(FTDI, GUDEADS_E80E, 0), + UFTDI_DEV(FTDI, GUDEADS_E80F, 0), + UFTDI_DEV(FTDI, GUDEADS_E88D, 0), + UFTDI_DEV(FTDI, GUDEADS_E88E, 0), + UFTDI_DEV(FTDI, GUDEADS_E88F, 0), + UFTDI_DEV(FTDI, HD_RADIO, 0), + UFTDI_DEV(FTDI, HO720, 0), + UFTDI_DEV(FTDI, HO730, 0), + UFTDI_DEV(FTDI, HO820, 0), + UFTDI_DEV(FTDI, HO870, 0), + UFTDI_DEV(FTDI, IBS_APP70, 0), + UFTDI_DEV(FTDI, IBS_PCMCIA, 0), + UFTDI_DEV(FTDI, IBS_PEDO, 0), + UFTDI_DEV(FTDI, IBS_PICPRO, 0), + UFTDI_DEV(FTDI, IBS_PK1, 0), + UFTDI_DEV(FTDI, IBS_PROD, 0), + UFTDI_DEV(FTDI, IBS_RS232MON, 0), + UFTDI_DEV(FTDI, IBS_US485, 0), + UFTDI_DEV(FTDI, IPLUS, 0), + UFTDI_DEV(FTDI, IPLUS2, 0), + UFTDI_DEV(FTDI, IRTRANS, 0), + UFTDI_DEV(FTDI, KBS, 0), + UFTDI_DEV(FTDI, KTLINK, 0), + UFTDI_DEV(FTDI, LENZ_LIUSB, 0), + UFTDI_DEV(FTDI, LK202, 0), + UFTDI_DEV(FTDI, LK204, 0), + UFTDI_DEV(FTDI, LM3S_DEVEL_BOARD, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, LM3S_EVAL_BOARD, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, LM3S_ICDI_B_BOARD, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, MASTERDEVEL2, 0), + UFTDI_DEV(FTDI, MAXSTREAM, 0), + UFTDI_DEV(FTDI, MHAM_DB9, 0), + UFTDI_DEV(FTDI, MHAM_IC, 0), + UFTDI_DEV(FTDI, MHAM_KW, 0), + UFTDI_DEV(FTDI, MHAM_RS232, 0), + UFTDI_DEV(FTDI, MHAM_Y6, 0), + UFTDI_DEV(FTDI, MHAM_Y8, 0), + UFTDI_DEV(FTDI, MHAM_Y9, 0), + UFTDI_DEV(FTDI, MHAM_YS, 0), + UFTDI_DEV(FTDI, MICRO_CHAMELEON, 0), + UFTDI_DEV(FTDI, MTXORB_5, 0), + UFTDI_DEV(FTDI, MTXORB_6, 0), + UFTDI_DEV(FTDI, MX2_3, 0), + UFTDI_DEV(FTDI, MX4_5, 0), + UFTDI_DEV(FTDI, NXTCAM, 0), + UFTDI_DEV(FTDI, OCEANIC, 0), + UFTDI_DEV(FTDI, OOCDLINK, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, OPENDCC, 0), + UFTDI_DEV(FTDI, OPENDCC_GATEWAY, 0), + UFTDI_DEV(FTDI, OPENDCC_GBM, 0), + UFTDI_DEV(FTDI, OPENDCC_SNIFFER, 0), + UFTDI_DEV(FTDI, OPENDCC_THROTTLE, 0), + UFTDI_DEV(FTDI, PCDJ_DAC2, 0), + UFTDI_DEV(FTDI, PCMSFU, 0), + UFTDI_DEV(FTDI, PERLE_ULTRAPORT, 0), + UFTDI_DEV(FTDI, PHI_FISCO, 0), + UFTDI_DEV(FTDI, PIEGROUP, 0), + UFTDI_DEV(FTDI, PROPOX_JTAGCABLEII, 0), + UFTDI_DEV(FTDI, R2000KU_TRUE_RNG, 0), + UFTDI_DEV(FTDI, R2X0, 0), + UFTDI_DEV(FTDI, RELAIS, 0), + UFTDI_DEV(FTDI, REU_TINY, 0), + UFTDI_DEV(FTDI, RMP200, 0), + UFTDI_DEV(FTDI, RM_CANVIEW, 0), + UFTDI_DEV(FTDI, RRCIRKITS_LOCOBUFFER, 0), + UFTDI_DEV(FTDI, SCIENCESCOPE_HS_LOGBOOK, 0), + UFTDI_DEV(FTDI, SCIENCESCOPE_LOGBOOKML, 0), + UFTDI_DEV(FTDI, SCIENCESCOPE_LS_LOGBOOK, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_0, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_1, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_2, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_3, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_4, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_5, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_6, 0), + UFTDI_DEV(FTDI, SCS_DEVICE_7, 0), + UFTDI_DEV(FTDI, SDMUSBQSS, 0), + UFTDI_DEV(FTDI, SEMC_DSS20, 0), + UFTDI_DEV(FTDI, SERIAL_2232C, UFTDI_JTAG_CHECK_STRING), + UFTDI_DEV(FTDI, SERIAL_2232D, 0), + UFTDI_DEV(FTDI, SERIAL_232RL, 0), + UFTDI_DEV(FTDI, SERIAL_4232H, 0), + UFTDI_DEV(FTDI, SERIAL_8U100AX, 0), + UFTDI_DEV(FTDI, SERIAL_8U232AM, 0), + UFTDI_DEV(FTDI, SERIAL_8U232AM4, 0), + UFTDI_DEV(FTDI, SIGNALYZER_SH2, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, SIGNALYZER_SH4, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, SIGNALYZER_SLITE, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, SIGNALYZER_ST, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, SPECIAL_1, 0), + UFTDI_DEV(FTDI, SPECIAL_3, 0), + UFTDI_DEV(FTDI, SPECIAL_4, 0), + UFTDI_DEV(FTDI, SPROG_II, 0), + UFTDI_DEV(FTDI, SR_RADIO, 0), + UFTDI_DEV(FTDI, SUUNTO_SPORTS, 0), + UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13M, 0), + UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13S, 0), + UFTDI_DEV(FTDI, TACTRIX_OPENPORT_13U, 0), + UFTDI_DEV(FTDI, TAVIR_STK500, 0), + UFTDI_DEV(FTDI, TERATRONIK_D2XX, 0), + UFTDI_DEV(FTDI, TERATRONIK_VCP, 0), + UFTDI_DEV(FTDI, THORLABS, 0), + UFTDI_DEV(FTDI, TNC_X, 0), + UFTDI_DEV(FTDI, TTUSB, 0), + UFTDI_DEV(FTDI, TURTELIZER2, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, UOPTBR, 0), + UFTDI_DEV(FTDI, USBSERIAL, 0), + UFTDI_DEV(FTDI, USBX_707, 0), + UFTDI_DEV(FTDI, USB_UIRT, 0), + UFTDI_DEV(FTDI, USINT_CAT, 0), + UFTDI_DEV(FTDI, USINT_RS232, 0), + UFTDI_DEV(FTDI, USINT_WKEY, 0), + UFTDI_DEV(FTDI, VARDAAN, 0), + UFTDI_DEV(FTDI, VNHCPCUSB_D, 0), + UFTDI_DEV(FTDI, WESTREX_MODEL_777, 0), + UFTDI_DEV(FTDI, WESTREX_MODEL_8900F, 0), + UFTDI_DEV(FTDI, XF_547, 0), + UFTDI_DEV(FTDI, XF_640, 0), + UFTDI_DEV(FTDI, XF_642, 0), + UFTDI_DEV(FTDI, XM_RADIO, 0), + UFTDI_DEV(FTDI, YEI_SERVOCENTER31, 0), + UFTDI_DEV(GNOTOMETRICS, USB, 0), + UFTDI_DEV(ICOM, SP1, 0), + UFTDI_DEV(ICOM, OPC_U_UC, 0), + UFTDI_DEV(ICOM, RP2C1, 0), + UFTDI_DEV(ICOM, RP2C2, 0), + UFTDI_DEV(ICOM, RP2D, 0), + UFTDI_DEV(ICOM, RP2KVR, 0), + UFTDI_DEV(ICOM, RP2KVT, 0), + UFTDI_DEV(ICOM, RP2VR, 0), + UFTDI_DEV(ICOM, RP2VT, 0), + UFTDI_DEV(ICOM, RP4KVR, 0), + UFTDI_DEV(ICOM, RP4KVT, 0), + UFTDI_DEV(IDTECH, IDT1221U, 0), + UFTDI_DEV(INTERBIOMETRICS, IOBOARD, 0), + UFTDI_DEV(INTERBIOMETRICS, MINI_IOBOARD, 0), + UFTDI_DEV(INTREPIDCS, NEOVI, 0), + UFTDI_DEV(INTREPIDCS, VALUECAN, 0), + UFTDI_DEV(IONICS, PLUGCOMPUTER, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(JETI, SPC1201, 0), + UFTDI_DEV(KOBIL, CONV_B1, 0), + UFTDI_DEV(KOBIL, CONV_KAAN, 0), + UFTDI_DEV(LARSENBRUSGAARD, ALTITRACK, 0), + UFTDI_DEV(MARVELL, SHEEVAPLUG, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0100, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0101, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0102, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0103, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0104, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0105, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0106, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0107, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0108, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0109, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010A, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010B, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010C, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010D, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010E, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_010F, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0110, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0111, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0112, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0113, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0114, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0115, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0116, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0117, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0118, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0119, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011A, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011B, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011C, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011D, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011E, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_011F, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0120, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0121, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0122, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0123, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0124, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0125, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0126, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0128, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0129, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012A, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012B, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012D, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012E, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_012F, 0), + UFTDI_DEV(MATRIXORBITAL, FTDI_RANGE_0130, 0), *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 19:25:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A9B8C32; Fri, 25 Apr 2014 19:25:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 476B11C4E; Fri, 25 Apr 2014 19:25:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PJP1XU098230; Fri, 25 Apr 2014 19:25:01 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PJP0Vh098223; Fri, 25 Apr 2014 19:25:00 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404251925.s3PJP0Vh098223@svn.freebsd.org> From: Warner Losh Date: Fri, 25 Apr 2014 19:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264924 - in head: . tools/regression/filemon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 19:25:01 -0000 Author: imp Date: Fri Apr 25 19:25:00 2014 New Revision: 264924 URL: http://svnweb.freebsd.org/changeset/base/264924 Log: Remove NO_CTF, exccept as an undocumented compatibility option. Convert all other uses to MK_CTF=no. Set MK_CTF=no rather than the indirect WITHOUT_CDDL in filemon regression. It is expected that NO_CTF will be removed in FreeBSD 12 entirely. Modified: head/Makefile.inc1 head/tools/regression/filemon/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Apr 25 19:13:57 2014 (r264923) +++ head/Makefile.inc1 Fri Apr 25 19:25:00 2014 (r264924) @@ -15,7 +15,7 @@ # -DNO_PORTSUPDATE do not update ports in ${MAKE} update # -DNO_ROOT install without using root privilege # -DNO_DOCUPDATE do not update doc in ${MAKE} update -# -DNO_CTF do not run the DTrace CTF conversion tools on built objects +# -DWITHOUT_CTF do not run the DTrace CTF conversion tools on built objects # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list # LOCAL_LIB_DIRS="list of dirs" to add additional dirs to libraries target # LOCAL_MTREE="list of mtree files" to process to allow local directories @@ -248,7 +248,7 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ SSP_CFLAGS= \ MK_HTML=no MK_INFO=no NO_LINT=yes MK_MAN=no \ -DNO_PIC -DNO_PROFILE -DNO_SHARED \ - -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD MK_TESTS=no + -DNO_CPU_CFLAGS -DNO_WARNS MK_CTF=no -DEARLY_BUILD MK_TESTS=no # build-tools stage TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ @@ -258,7 +258,7 @@ TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ BOOTSTRAPPING=${OSRELDATE} \ SSP_CFLAGS= \ -DNO_LINT \ - -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD MK_TESTS=no + -DNO_CPU_CFLAGS -DNO_WARNS MK_CTF=no -DEARLY_BUILD MK_TESTS=no # cross-tools stage XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ @@ -277,7 +277,7 @@ KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOB SSP_CFLAGS= \ MK_HTML=no MK_INFO=no -DNO_LINT MK_MAN=no \ -DNO_PIC -DNO_PROFILE -DNO_SHARED \ - -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD + -DNO_CPU_CFLAGS -DNO_WARNS MK_CTF=no -DEARLY_BUILD # world stage WMAKEENV= ${CROSSENV} \ @@ -294,7 +294,7 @@ HMAKE+= PATH=${TMPPATH} METALOG=${METAL .endif .if ${MK_CDDL} == "no" -WMAKEENV+= NO_CTF=1 +WMAKEENV+= MK_CTF=no .endif .if defined(CROSS_TOOLCHAIN_PREFIX) @@ -400,7 +400,7 @@ LIB32WMAKEFLAGS+= CC="${XCC} ${LIB32FLAG -DCOMPAT_32BIT \ -DLIBRARIES_ONLY \ -DNO_CPU_CFLAGS \ - -DNO_CTF \ + MK_CTF=no \ -DNO_LINT \ MK_TESTS=no @@ -609,7 +609,7 @@ build32: WORLDTMP=${WORLDTMP} \ MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \ - DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF \ + DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS MK_CTF=no \ -DEARLY_BUILD build-tools .endfor cd ${.CURDIR}; \ Modified: head/tools/regression/filemon/Makefile ============================================================================== --- head/tools/regression/filemon/Makefile Fri Apr 25 19:13:57 2014 (r264923) +++ head/tools/regression/filemon/Makefile Fri Apr 25 19:25:00 2014 (r264924) @@ -22,9 +22,8 @@ MAN= WARNS?= 6 CFLAGS+= -I${.CURDIR}/../../../sys -# Should be "WITHOUT_CTF=" below, but stupid infastrurture fails: -# "/usr/share/mk/bsd.own.mk", line 489: WITH_CTF and WITHOUT_CTF can't both be set. -WITHOUT_CDDL= +# We don't want to genreate CTF files. Force that here. +MK_CTF=no CLEANFILES+= ${BINS} @@ -59,7 +58,7 @@ test01: ${BINS:Mfilemontest*} ${BINS:Msi grep -q -v '\.[0-9][0-9][0-9][0-9][0-9][0-9]$$' || printf "Time stamp format OK\n\n" .endfor @cd ${.CURDIR} ; set +e ; for F in filemon_log.* ; do \ - tail -1 $$F | grep -q '# Bye bye' || echo "$$F missing filemon bye-bye" ; \ + tail -1 $$F | grep -q '# Bye bye' || echo "$$F missing filemon bye-bye" ; \ NL=`wc -l $$F | awk '{print $$1}'` ; \ if [ "$${NL}" != 97 ]; then echo "$$F BAD, contains $${NL} lines" ; exit 1 ; fi ; done From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 19:25:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 599B9D69; Fri, 25 Apr 2014 19:25:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A1A51C50; Fri, 25 Apr 2014 19:25:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PJP8p4098314; Fri, 25 Apr 2014 19:25:08 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PJP5RB098297; Fri, 25 Apr 2014 19:25:05 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404251925.s3PJP5RB098297@svn.freebsd.org> From: Warner Losh Date: Fri, 25 Apr 2014 19:25:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264925 - in head: lib/ncurses/ncurses sys/boot/amd64/boot1.efi tools/tools/ath/arcode tools/tools/ath/ath_ee_9287_print tools/tools/ath/ath_ee_9300_print tools/tools/ath/ath_ee_v14_pri... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 19:25:08 -0000 Author: imp Date: Fri Apr 25 19:25:05 2014 New Revision: 264925 URL: http://svnweb.freebsd.org/changeset/base/264925 Log: Eliminate last vestigies of NO_MAN= in the tree. Also, remove ineffectual NOMAN= lines. These don't change the build at all. Modified: head/lib/ncurses/ncurses/Makefile head/sys/boot/amd64/boot1.efi/Makefile head/tools/tools/ath/arcode/Makefile head/tools/tools/ath/ath_ee_9287_print/Makefile head/tools/tools/ath/ath_ee_9300_print/Makefile head/tools/tools/ath/ath_ee_v14_print/Makefile head/tools/tools/ath/ath_ee_v4k_print/Makefile head/tools/tools/ath/athalq/Makefile head/usr.bin/svn/lib/libapr/Makefile head/usr.bin/svn/lib/libserf/Makefile head/usr.bin/svn/lib/libsqlite3/Makefile Modified: head/lib/ncurses/ncurses/Makefile ============================================================================== --- head/lib/ncurses/ncurses/Makefile Fri Apr 25 19:25:00 2014 (r264924) +++ head/lib/ncurses/ncurses/Makefile Fri Apr 25 19:25:05 2014 (r264925) @@ -3,7 +3,8 @@ SHLIBDIR?= /lib .if !defined(ENABLE_WIDEC) -NO_MAN= +# Override any MAN= setting below.. +MK_MAN=no .endif .include Modified: head/sys/boot/amd64/boot1.efi/Makefile ============================================================================== --- head/sys/boot/amd64/boot1.efi/Makefile Fri Apr 25 19:25:00 2014 (r264924) +++ head/sys/boot/amd64/boot1.efi/Makefile Fri Apr 25 19:25:05 2014 (r264925) @@ -1,6 +1,6 @@ # $FreeBSD$ -NO_MAN= +MAN= .include Modified: head/tools/tools/ath/arcode/Makefile ============================================================================== --- head/tools/tools/ath/arcode/Makefile Fri Apr 25 19:25:00 2014 (r264924) +++ head/tools/tools/ath/arcode/Makefile Fri Apr 25 19:25:05 2014 (r264925) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= arcode -NOMAN= yes +MAN= .include <../Makefile.inc> Modified: head/tools/tools/ath/ath_ee_9287_print/Makefile ============================================================================== --- head/tools/tools/ath/ath_ee_9287_print/Makefile Fri Apr 25 19:25:00 2014 (r264924) +++ head/tools/tools/ath/ath_ee_9287_print/Makefile Fri Apr 25 19:25:05 2014 (r264925) @@ -4,7 +4,6 @@ PROG= ath_ee_9287_print SRCS= main.c eeprom.c 9287.c -NOMAN= yes MAN= .include <../Makefile.inc> Modified: head/tools/tools/ath/ath_ee_9300_print/Makefile ============================================================================== --- head/tools/tools/ath/ath_ee_9300_print/Makefile Fri Apr 25 19:25:00 2014 (r264924) +++ head/tools/tools/ath/ath_ee_9300_print/Makefile Fri Apr 25 19:25:05 2014 (r264925) @@ -3,7 +3,6 @@ .PATH: ${.CURDIR}/../../../../sys/dev/ath/ath_hal PROG= ath_ee_9300_print -NOMAN= yes MAN= SRCS= main.c SRCS+= opt_ah.h Modified: head/tools/tools/ath/ath_ee_v14_print/Makefile ============================================================================== --- head/tools/tools/ath/ath_ee_v14_print/Makefile Fri Apr 25 19:25:00 2014 (r264924) +++ head/tools/tools/ath/ath_ee_v14_print/Makefile Fri Apr 25 19:25:05 2014 (r264925) @@ -3,7 +3,6 @@ .PATH: ${.CURDIR}/../../../../sys/dev/ath/ath_hal PROG= ath_ee_v14_print -NOMAN= yes MAN= .include <../Makefile.inc> Modified: head/tools/tools/ath/ath_ee_v4k_print/Makefile ============================================================================== --- head/tools/tools/ath/ath_ee_v4k_print/Makefile Fri Apr 25 19:25:00 2014 (r264924) +++ head/tools/tools/ath/ath_ee_v4k_print/Makefile Fri Apr 25 19:25:05 2014 (r264925) @@ -4,7 +4,6 @@ PROG= ath_ee_v4k_print SRCS= main.c eeprom.c v4k.c -NOMAN= yes MAN= .include <../Makefile.inc> Modified: head/tools/tools/ath/athalq/Makefile ============================================================================== --- head/tools/tools/ath/athalq/Makefile Fri Apr 25 19:25:00 2014 (r264924) +++ head/tools/tools/ath/athalq/Makefile Fri Apr 25 19:25:05 2014 (r264925) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= athalq -NOMAN= yes +MAN= CFLAGS+= -I../../../../sys/contrib Modified: head/usr.bin/svn/lib/libapr/Makefile ============================================================================== --- head/usr.bin/svn/lib/libapr/Makefile Fri Apr 25 19:25:00 2014 (r264924) +++ head/usr.bin/svn/lib/libapr/Makefile Fri Apr 25 19:25:05 2014 (r264925) @@ -20,8 +20,6 @@ SRCS= apr_cpystrn.c apr_fnmatch.c apr_g thread_mutex.c thread_rwlock.c threadpriv.c time.c \ timestr.c userinfo.c version.c waitio.c -NOMAN= internalonly - .PATH: ${APR}/atomic/unix ${APR}/dso/unix ${APR}/file_io/unix \ ${APR}/locks/unix ${APR}/memory/unix ${APR}/misc/unix \ ${APR}/mmap/unix ${APR}/network_io/unix ${APR}/passwd \ Modified: head/usr.bin/svn/lib/libserf/Makefile ============================================================================== --- head/usr.bin/svn/lib/libserf/Makefile Fri Apr 25 19:25:00 2014 (r264924) +++ head/usr.bin/svn/lib/libserf/Makefile Fri Apr 25 19:25:05 2014 (r264925) @@ -14,8 +14,6 @@ SRCS= aggregate_buckets.c allocator.c a response_body_buckets.c response_buckets.c simple_buckets.c \ socket_buckets.c ssl_buckets.c ssltunnel.c -NOMAN= internalonly - .PATH: ${SERF}/buckets ${SERF}/auth ${SERF} CFLAGS+= -I${.CURDIR} -I${SERF} \ Modified: head/usr.bin/svn/lib/libsqlite3/Makefile ============================================================================== --- head/usr.bin/svn/lib/libsqlite3/Makefile Fri Apr 25 19:25:00 2014 (r264924) +++ head/usr.bin/svn/lib/libsqlite3/Makefile Fri Apr 25 19:25:05 2014 (r264925) @@ -7,8 +7,6 @@ LIB= sqlite3 SRCS= sqlite3.c -NOMAN= internalonly - .PATH: ${SQLITE} CFLAGS+= -DHAVE_CONFIG_H -I${.CURDIR} \ From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 19:25:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7387EA0; Fri, 25 Apr 2014 19:25:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4DAE1C53; Fri, 25 Apr 2014 19:25:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PJPDbq098373; Fri, 25 Apr 2014 19:25:13 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PJPDsX098372; Fri, 25 Apr 2014 19:25:13 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404251925.s3PJPDsX098372@svn.freebsd.org> From: Warner Losh Date: Fri, 25 Apr 2014 19:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264926 - head/lib/libpam/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 19:25:13 -0000 Author: imp Date: Fri Apr 25 19:25:13 2014 New Revision: 264926 URL: http://svnweb.freebsd.org/changeset/base/264926 Log: Kill last remaining NO_INSTALLLIB in tree by converting it over to MK_INSTALLIB=no. Modified: head/lib/libpam/modules/Makefile.inc Modified: head/lib/libpam/modules/Makefile.inc ============================================================================== --- head/lib/libpam/modules/Makefile.inc Fri Apr 25 19:25:05 2014 (r264925) +++ head/lib/libpam/modules/Makefile.inc Fri Apr 25 19:25:13 2014 (r264926) @@ -2,7 +2,7 @@ PAMDIR= ${.CURDIR}/../../../../contrib/openpam -NO_INSTALLLIB= +MK_INSTALLLIB= no NO_PROFILE= CFLAGS+= -I${PAMDIR}/include -I${.CURDIR}/../../libpam From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 19:25:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D8BAFDD; Fri, 25 Apr 2014 19:25:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A7F41C55; Fri, 25 Apr 2014 19:25:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PJPIfQ098429; Fri, 25 Apr 2014 19:25:18 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PJPIc2098428; Fri, 25 Apr 2014 19:25:18 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404251925.s3PJPIc2098428@svn.freebsd.org> From: Warner Losh Date: Fri, 25 Apr 2014 19:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264927 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 19:25:18 -0000 Author: imp Date: Fri Apr 25 19:25:18 2014 New Revision: 264927 URL: http://svnweb.freebsd.org/changeset/base/264927 Log: NO_DEBUG_FILES -> MK_DEBUG_FILES=no in last remaining place. Modified: head/share/mk/bsd.crunchgen.mk Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Fri Apr 25 19:25:13 2014 (r264926) +++ head/share/mk/bsd.crunchgen.mk Fri Apr 25 19:25:18 2014 (r264927) @@ -48,7 +48,7 @@ CRUNCH_GENERATE_LINKS?= yes CLEANFILES+= $(CONF) *.o *.lo *.c *.mk *.cache *.a *.h # Don't try to extract debug info from ${PROG}. -NO_DEBUG_FILES= +MK_DEBUG_FILES=no # Program names and their aliases contribute hardlinks to 'rescue' executable, # except for those that get suppressed. From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 19:25:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2AAA11A2; Fri, 25 Apr 2014 19:25:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF28A1C59; Fri, 25 Apr 2014 19:25:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PJPVNc098522; Fri, 25 Apr 2014 19:25:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PJPQbt098490; Fri, 25 Apr 2014 19:25:26 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404251925.s3PJPQbt098490@svn.freebsd.org> From: Warner Losh Date: Fri, 25 Apr 2014 19:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264928 - in head: . cddl/lib/libzpool contrib/ofed/usr.lib/libibcm contrib/ofed/usr.lib/libibcommon contrib/ofed/usr.lib/libibmad contrib/ofed/usr.lib/libibumad contrib/ofed/usr.lib/li... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 19:25:32 -0000 Author: imp Date: Fri Apr 25 19:25:26 2014 New Revision: 264928 URL: http://svnweb.freebsd.org/changeset/base/264928 Log: Spell NO_PROFILE= as MK_PROFILE=no. Modified: head/Makefile.inc1 head/cddl/lib/libzpool/Makefile head/contrib/ofed/usr.lib/libibcm/Makefile head/contrib/ofed/usr.lib/libibcommon/Makefile head/contrib/ofed/usr.lib/libibmad/Makefile head/contrib/ofed/usr.lib/libibumad/Makefile head/contrib/ofed/usr.lib/libibverbs/Makefile head/contrib/ofed/usr.lib/libmlx4/Makefile head/contrib/ofed/usr.lib/libmthca/Makefile head/contrib/ofed/usr.lib/libopensm/Makefile head/contrib/ofed/usr.lib/libosmcomp/Makefile head/contrib/ofed/usr.lib/libosmvendor/Makefile head/contrib/ofed/usr.lib/librdmacm/Makefile head/contrib/ofed/usr.lib/libsdp/Makefile head/gnu/lib/libgcov/Makefile head/gnu/lib/libssp/Makefile head/gnu/lib/libssp/libssp_nonshared/Makefile head/lib/libc_nonshared/Makefile head/lib/libiconv_modules/Makefile.inc head/lib/libpam/libpam/Makefile head/lib/libpam/modules/Makefile.inc head/lib/librpcsec_gss/Makefile head/lib/libstand/Makefile head/sys/boot/libstand32/Makefile head/sys/boot/userboot/libstand/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Apr 25 19:25:18 2014 (r264927) +++ head/Makefile.inc1 Fri Apr 25 19:25:26 2014 (r264928) @@ -247,7 +247,7 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ BOOTSTRAPPING=${OSRELDATE} \ SSP_CFLAGS= \ MK_HTML=no MK_INFO=no NO_LINT=yes MK_MAN=no \ - -DNO_PIC -DNO_PROFILE -DNO_SHARED \ + -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS -DNO_WARNS MK_CTF=no -DEARLY_BUILD MK_TESTS=no # build-tools stage @@ -276,7 +276,7 @@ KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOB BOOTSTRAPPING=${OSRELDATE} \ SSP_CFLAGS= \ MK_HTML=no MK_INFO=no -DNO_LINT MK_MAN=no \ - -DNO_PIC -DNO_PROFILE -DNO_SHARED \ + -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS -DNO_WARNS MK_CTF=no -DEARLY_BUILD # world stage @@ -557,7 +557,7 @@ _libraries: @echo "--------------------------------------------------------------" ${_+_}cd ${.CURDIR}; \ ${WMAKE} -DNO_FSCHG MK_HTML=no MK_INFO=no -DNO_LINT MK_MAN=no \ - -DNO_PROFILE MK_TESTS=no libraries + MK_PROFILE=no MK_TESTS=no libraries _depend: @echo @echo "--------------------------------------------------------------" @@ -1602,9 +1602,9 @@ ${_lib}__PL: .PHONY .MAKE cd ${.CURDIR}/${_lib} && \ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj && \ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend && \ - ${MAKE} MK_TESTS=no -DNO_PROFILE -DNO_PIC \ + ${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \ DIRPRFX=${_lib}/ all && \ - ${MAKE} MK_TESTS=no -DNO_PROFILE -DNO_PIC \ + ${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \ DIRPRFX=${_lib}/ install .endif .endfor @@ -1858,7 +1858,7 @@ XDEV_CPUTYPE?=${TARGET_CPUTYPE} .endif NOFUN=-DNO_FSCHG MK_HTML=no MK_INFO=no -DNO_LINT \ - MK_MAN=no MK_NLS=no -DNO_PROFILE \ + MK_MAN=no MK_NLS=no MK_PROFILE=no \ MK_KERBEROS=no MK_RESCUE=no MK_TESTS=no -DNO_WARNS \ TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \ CPUTYPE=${XDEV_CPUTYPE} Modified: head/cddl/lib/libzpool/Makefile ============================================================================== --- head/cddl/lib/libzpool/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/cddl/lib/libzpool/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -60,7 +60,7 @@ DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBZ} LDADD= -lmd -lpthread -lz # atomic.S doesn't like profiling. -NO_PROFILE= +MK_PROFILE= no CSTD= c99 Modified: head/contrib/ofed/usr.lib/libibcm/Makefile ============================================================================== --- head/contrib/ofed/usr.lib/libibcm/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/contrib/ofed/usr.lib/libibcm/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -12,7 +12,7 @@ IBSRCDIR= ${IBCMDIR}/src LIB= ibcm SHLIB_MAJOR= 1 -NO_PROFILE= +MK_PROFILE= no SRCS= cm.c CFLAGS+= -I ${IBCMDIR}/include Modified: head/contrib/ofed/usr.lib/libibcommon/Makefile ============================================================================== --- head/contrib/ofed/usr.lib/libibcommon/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/contrib/ofed/usr.lib/libibcommon/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -11,7 +11,7 @@ IBSRCDIR= ${IBCOMMONDIR}/src LIB= ibcommon SHLIB_MAJOR= 1 -NO_PROFILE= +MK_PROFILE= no SRCS= sysfs.c util.c hash.c stack.c time.c Modified: head/contrib/ofed/usr.lib/libibmad/Makefile ============================================================================== --- head/contrib/ofed/usr.lib/libibmad/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/contrib/ofed/usr.lib/libibmad/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -11,7 +11,7 @@ IBSRCDIR= ${IBMADDIR}/src LIB= ibmad SHLIB_MAJOR= 1 -NO_PROFILE= +MK_PROFILE= no SRCS= dump.c fields.c gs.c mad.c portid.c register.c resolve.c rpc.c sa.c \ serv.c smp.c vendor.c Modified: head/contrib/ofed/usr.lib/libibumad/Makefile ============================================================================== --- head/contrib/ofed/usr.lib/libibumad/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/contrib/ofed/usr.lib/libibumad/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -11,7 +11,7 @@ IBSRCDIR= ${UMADDIR}/src LIB= ibumad SHLIB_MAJOR= 1 -NO_PROFILE= +MK_PROFILE= no SRCS= umad.c Modified: head/contrib/ofed/usr.lib/libibverbs/Makefile ============================================================================== --- head/contrib/ofed/usr.lib/libibverbs/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/contrib/ofed/usr.lib/libibverbs/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -12,7 +12,7 @@ IBMANDIR= ${IBVERBSDIR}/man LIB= ibverbs SHLIB_MAJOR= 1 -NO_PROFILE= +MK_PROFILE= no SRCS= device.c init.c marshall.c verbs.c cmd.c enum_strs.c kern_abi.h \ memory.c compat-1_0.c sysfs.c Modified: head/contrib/ofed/usr.lib/libmlx4/Makefile ============================================================================== --- head/contrib/ofed/usr.lib/libmlx4/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/contrib/ofed/usr.lib/libmlx4/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -12,7 +12,7 @@ MLXSRCDIR= ${MLX4DIR}/src LIB= mlx4 SHLIB_MAJOR= 1 -NO_PROFILE= +MK_PROFILE= no SRCS= buf.c cq.c dbrec.c mlx4.c qp.c srq.c verbs.c Modified: head/contrib/ofed/usr.lib/libmthca/Makefile ============================================================================== --- head/contrib/ofed/usr.lib/libmthca/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/contrib/ofed/usr.lib/libmthca/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -12,7 +12,7 @@ MTHCASRCDIR= ${MTHCADIR}/src LIB= mthca SHLIB_MAJOR= 1 -NO_PROFILE= +MK_PROFILE= no SRCS= ah.c buf.c cq.c memfree.c mthca.c qp.c srq.c verbs.c Modified: head/contrib/ofed/usr.lib/libopensm/Makefile ============================================================================== --- head/contrib/ofed/usr.lib/libopensm/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/contrib/ofed/usr.lib/libopensm/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -9,7 +9,7 @@ SHLIBDIR?= /usr/lib LIB= opensm SHLIB_MAJOR= 1 -NO_PROFILE= +MK_PROFILE= no SRCS= osm_log.c osm_mad_pool.c osm_helper.c Modified: head/contrib/ofed/usr.lib/libosmcomp/Makefile ============================================================================== --- head/contrib/ofed/usr.lib/libosmcomp/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/contrib/ofed/usr.lib/libosmcomp/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -9,7 +9,7 @@ SHLIBDIR?= /usr/lib LIB= osmcomp SHLIB_MAJOR= 1 -NO_PROFILE= +MK_PROFILE= no SRCS= cl_complib.c cl_dispatcher.c cl_event.c cl_event_wheel.c cl_list.c SRCS+= cl_log.c cl_map.c cl_pool.c cl_ptr_vector.c cl_spinlock.c Modified: head/contrib/ofed/usr.lib/libosmvendor/Makefile ============================================================================== --- head/contrib/ofed/usr.lib/libosmvendor/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/contrib/ofed/usr.lib/libosmvendor/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -9,7 +9,7 @@ SHLIBDIR?= /usr/lib LIB= osmvendor SHLIB_MAJOR= 1 -NO_PROFILE= +MK_PROFILE= no SRCS= osm_vendor_ibumad.c osm_vendor_ibumad_sa.c Modified: head/contrib/ofed/usr.lib/librdmacm/Makefile ============================================================================== --- head/contrib/ofed/usr.lib/librdmacm/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/contrib/ofed/usr.lib/librdmacm/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -12,7 +12,7 @@ RDMAMANDIR= ${RDMACMDIR}/man LIB= rdmacm SHLIB_MAJOR= 1 -NO_PROFILE= +MK_PROFILE= no SRCS= cma.c Modified: head/contrib/ofed/usr.lib/libsdp/Makefile ============================================================================== --- head/contrib/ofed/usr.lib/libsdp/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/contrib/ofed/usr.lib/libsdp/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -10,7 +10,7 @@ SDPDIR= ${.CURDIR}/../../libsdp/src LIB= ibsdp SHLIB_MAJOR= 1 -NO_PROFILE= +MK_PROFILE= no MAN= SRCS= log.c match.c port.c config_parser.c config_scanner.c Modified: head/gnu/lib/libgcov/Makefile ============================================================================== --- head/gnu/lib/libgcov/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/gnu/lib/libgcov/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -1,8 +1,9 @@ # $FreeBSD$ -NO_PROFILE= -.include +MK_PROFILE= no MK_SSP= no + +.include .include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt" GCCDIR= ${.CURDIR}/../../../contrib/gcc Modified: head/gnu/lib/libssp/Makefile ============================================================================== --- head/gnu/lib/libssp/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/gnu/lib/libssp/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -2,9 +2,11 @@ SHLIBDIR?= /lib -.include +MK_PROFILE= no MK_SSP= no +.include + GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCLIB= ${.CURDIR}/../../../contrib/gcclibs SRCDIR= ${GCCLIB}/libssp @@ -13,7 +15,6 @@ SRCDIR= ${GCCLIB}/libssp LIB= ssp SHLIB_MAJOR= 0 -NO_PROFILE= SRCS= ssp.c gets-chk.c memcpy-chk.c memmove-chk.c mempcpy-chk.c \ memset-chk.c snprintf-chk.c sprintf-chk.c stpcpy-chk.c \ Modified: head/gnu/lib/libssp/libssp_nonshared/Makefile ============================================================================== --- head/gnu/lib/libssp/libssp_nonshared/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/gnu/lib/libssp/libssp_nonshared/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -7,7 +7,7 @@ GCCLIB= ${.CURDIR}/../../../../contrib/g LIB= ssp_nonshared NO_PIC= -NO_PROFILE= +MK_PROFILE=no SRCS= ssp-local.c Modified: head/lib/libc_nonshared/Makefile ============================================================================== --- head/lib/libc_nonshared/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/lib/libc_nonshared/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -4,7 +4,7 @@ # It is used exclusively with libc.so.* - there is no need for any other # compile modes. # bsd.lib.mk doesn't have an easy way to express that. -NO_PROFILE?= +MK_PROFILE?=no .include NO_PIC= # -fpic on some platforms, -fPIC on others. Modified: head/lib/libiconv_modules/Makefile.inc ============================================================================== --- head/lib/libiconv_modules/Makefile.inc Fri Apr 25 19:25:18 2014 (r264927) +++ head/lib/libiconv_modules/Makefile.inc Fri Apr 25 19:25:26 2014 (r264928) @@ -14,4 +14,4 @@ SHLIBDIR= /usr/lib/i18n SHLIBDIR= /usr/lib32/i18n .endif LIBDIR= ${SHLIBDIR} -NO_PROFILE= +MK_PROFILE= no Modified: head/lib/libpam/libpam/Makefile ============================================================================== --- head/lib/libpam/libpam/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/lib/libpam/libpam/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -39,7 +39,7 @@ OPENPAM= ${.CURDIR}/../../../contrib/ope .PATH: ${OPENPAM}/include ${OPENPAM}/lib/libpam ${OPENPAM}/doc/man LIB= pam -NO_PROFILE= +MK_PROFILE=no SRCS= openpam_asprintf.c \ openpam_borrow_cred.c \ Modified: head/lib/libpam/modules/Makefile.inc ============================================================================== --- head/lib/libpam/modules/Makefile.inc Fri Apr 25 19:25:18 2014 (r264927) +++ head/lib/libpam/modules/Makefile.inc Fri Apr 25 19:25:26 2014 (r264928) @@ -3,7 +3,7 @@ PAMDIR= ${.CURDIR}/../../../../contrib/openpam MK_INSTALLLIB= no -NO_PROFILE= +MK_PROFILE= no CFLAGS+= -I${PAMDIR}/include -I${.CURDIR}/../../libpam Modified: head/lib/librpcsec_gss/Makefile ============================================================================== --- head/lib/librpcsec_gss/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/lib/librpcsec_gss/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -13,7 +13,7 @@ SYMBOL_MAPS= ${.CURDIR}/Symbol.map CFLAGS+= -I${.CURDIR}/../../include CFLAGS+= -I${.CURDIR}/../../libc_rpc -NO_PROFILE= +MK_PROFILE= no MAN= rpcsec_gss.3 MAN+= rpc_gss_seccreate.3 Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/lib/libstand/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -6,11 +6,12 @@ # quite large. # -.include +MK_PROFILE= no MK_SSP= no +.include + LIB= stand -NO_PROFILE= NO_PIC= INCS= stand.h MAN= libstand.3 Modified: head/sys/boot/libstand32/Makefile ============================================================================== --- head/sys/boot/libstand32/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/sys/boot/libstand32/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -16,7 +16,7 @@ S= ${.CURDIR}/../../../lib/libstand .PATH: ${S} LIB= stand INTERNALLIB= -NO_PROFILE= +MK_PROFILE= no NO_PIC= WARNS?= 0 Modified: head/sys/boot/userboot/libstand/Makefile ============================================================================== --- head/sys/boot/userboot/libstand/Makefile Fri Apr 25 19:25:18 2014 (r264927) +++ head/sys/boot/userboot/libstand/Makefile Fri Apr 25 19:25:26 2014 (r264928) @@ -16,7 +16,7 @@ S= ${.CURDIR}/../../../../lib/libstand .PATH: ${S} LIB= stand INTERNALLIB= -NO_PROFILE= +MK_PROFILE= no NO_PIC= WARNS?= 0 From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 19:25:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F0072DA; Fri, 25 Apr 2014 19:25:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CD6E1C5C; Fri, 25 Apr 2014 19:25:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PJPb8u098578; Fri, 25 Apr 2014 19:25:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PJPbbG098577; Fri, 25 Apr 2014 19:25:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404251925.s3PJPbbG098577@svn.freebsd.org> From: Warner Losh Date: Fri, 25 Apr 2014 19:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264929 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 19:25:37 -0000 Author: imp Date: Fri Apr 25 19:25:37 2014 New Revision: 264929 URL: http://svnweb.freebsd.org/changeset/base/264929 Log: Now that all the NO_foo expressed in this loop have been removed from the tree, start warning that NO_foo is deprecated. It was supposed to be gone from the tree as a user-setting a long time ago... Modified: head/share/mk/bsd.opts.mk Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Fri Apr 25 19:25:26 2014 (r264928) +++ head/share/mk/bsd.opts.mk Fri Apr 25 19:25:37 2014 (r264929) @@ -244,7 +244,7 @@ __DEFAULT_YES_OPTIONS+=GCC GNUCXX GCC_BO # Supported NO_* options (if defined, MK_* will be forced to "no", # regardless of user's setting). # -# These are transitional and will disappaer in the fullness of time. +# These are transitional and will disappaer in the FreeBSD 12. # .for var in \ CTF \ @@ -253,6 +253,7 @@ __DEFAULT_YES_OPTIONS+=GCC GNUCXX GCC_BO MAN \ PROFILE .if defined(NO_${var}) +.warning "NO_${var} is defined, but deprecated. Please use MK_${var}=no instead." MK_${var}:=no .endif .endfor From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 19:25:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E91BF414; Fri, 25 Apr 2014 19:25:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC8B11C5F; Fri, 25 Apr 2014 19:25:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PJPjpw098642; Fri, 25 Apr 2014 19:25:45 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PJPjGc098640; Fri, 25 Apr 2014 19:25:45 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404251925.s3PJPjGc098640@svn.freebsd.org> From: Warner Losh Date: Fri, 25 Apr 2014 19:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264930 - in head: . share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 19:25:46 -0000 Author: imp Date: Fri Apr 25 19:25:45 2014 New Revision: 264930 URL: http://svnweb.freebsd.org/changeset/base/264930 Log: Eliminate NO_INCS. It is used one place, and MK_TOOLCHAIN=no will handle the job just as well. Opt for simplicity rather than one more option. Modified: head/Makefile.inc1 head/share/mk/bsd.incs.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Apr 25 19:25:37 2014 (r264929) +++ head/Makefile.inc1 Fri Apr 25 19:25:45 2014 (r264930) @@ -406,8 +406,8 @@ LIB32WMAKEFLAGS+= CC="${XCC} ${LIB32FLAG LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} ${LIB32WMAKEFLAGS} \ MK_MAN=no MK_INFO=no MK_HTML=no -LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS \ - ${IMAKE_INSTALL} +LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} \ + MK_TOOLCHAIN=no ${IMAKE_INSTALL} .endif IMAKEENV= ${CROSSENV:N_LDSCRIPTROOT=*} Modified: head/share/mk/bsd.incs.mk ============================================================================== --- head/share/mk/bsd.incs.mk Fri Apr 25 19:25:37 2014 (r264929) +++ head/share/mk/bsd.incs.mk Fri Apr 25 19:25:45 2014 (r264930) @@ -4,7 +4,7 @@ .error bsd.incs.mk cannot be included directly. .endif -.if !defined(NO_INCS) && ${MK_TOOLCHAIN} != "no" +.if ${MK_TOOLCHAIN} != "no" INCSGROUPS?= INCS @@ -81,4 +81,4 @@ installincludes: realinstall: installincludes .ORDER: beforeinstall installincludes -.endif # !defined(NO_INCS) && ${MK_TOOLCHAIN} != "no" +.endif # ${MK_TOOLCHAIN} != "no" From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 19:25:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7C7D54E; Fri, 25 Apr 2014 19:25:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5A901C63; Fri, 25 Apr 2014 19:25:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PJPrO3098702; Fri, 25 Apr 2014 19:25:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PJPrjg098701; Fri, 25 Apr 2014 19:25:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404251925.s3PJPrjg098701@svn.freebsd.org> From: Warner Losh Date: Fri, 25 Apr 2014 19:25:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264931 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 19:25:54 -0000 Author: imp Date: Fri Apr 25 19:25:53 2014 New Revision: 264931 URL: http://svnweb.freebsd.org/changeset/base/264931 Log: Split up the options into those used only by bsd.mk.* or sys.mk and the rest. Add note of caution for the surprises that popped up. MK_SSP is the only one used by sys.mk, and it likely needs even extra attention. Modified: head/share/mk/bsd.opts.mk Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Fri Apr 25 19:25:45 2014 (r264930) +++ head/share/mk/bsd.opts.mk Fri Apr 25 19:25:53 2014 (r264931) @@ -45,13 +45,40 @@ SRCCONF?= /etc/src.conf # that haven't been converted over. # +# Only these options are used by bsd.*.mk. Most seem legit, except maybe +# OPENSSH. + +__DEFAULT_YES_OPTIONS = \ + ASSERT_DEBUG \ + INFO \ + INSTALLLIB \ + KERBEROS \ + MAN \ + MANCOMPRESS \ + NIS \ + OPENSSH \ + PROFILE \ + SSP \ + SYMVER \ + TOOLCHAIN + +__DEFAULT_NO_OPTIONS = \ + CTF \ + DEBUG_FILES \ + INSTALL_AS_USER \ + +.include + +# Note: __DEFAULT_{YES,NO}_OPTIONS unset by bsd.mkopt.mk + +# These options are used by src the builds + __DEFAULT_YES_OPTIONS = \ ACCT \ ACPI \ AMD \ APM \ ARM_EABI \ - ASSERT_DEBUG \ AT \ ATM \ AUDIT \ @@ -98,13 +125,10 @@ __DEFAULT_YES_OPTIONS = \ ICONV \ INET \ INET6 \ - INFO \ - INSTALLLIB \ IPFILTER \ IPFW \ JAIL \ KDUMP \ - KERBEROS \ KERNEL_SYMBOLS \ KVM \ LDNS \ @@ -121,18 +145,14 @@ __DEFAULT_YES_OPTIONS = \ MAIL \ MAILWRAPPER \ MAKE \ - MAN \ - MANCOMPRESS \ NCURSESW \ NDIS \ NETCAT \ NETGRAPH \ - NIS \ NLS \ NLS_CATALOGS \ NS_CACHING \ NTP \ - OPENSSH \ OPENSSL \ PAM \ PC_SYSINSTALL \ @@ -141,7 +161,6 @@ __DEFAULT_YES_OPTIONS = \ PMC \ PORTSNAP \ PPP \ - PROFILE \ QUOTAS \ RCMDS \ RCS \ @@ -153,16 +172,13 @@ __DEFAULT_YES_OPTIONS = \ SOURCELESS \ SOURCELESS_HOST \ SOURCELESS_UCODE \ - SSP \ SVNLITE \ - SYMVER \ SYSCALL_COMPAT \ SYSCONS \ SYSINSTALL \ TCSH \ TELNET \ TEXTPROC \ - TOOLCHAIN \ UNBOUND \ USB \ UTMPX \ @@ -175,11 +191,8 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ BSD_GREP \ CLANG_EXTRAS \ - CTF \ - DEBUG_FILES \ EISA \ HESIOD \ - INSTALL_AS_USER \ LLDB \ NAND \ OFED \ @@ -259,6 +272,29 @@ MK_${var}:=no .endfor # +# MK_* options that default to "yes" if the compiler is a C++11 compiler. +# +.include +.for var in \ + LIBCPLUSPLUS +.if !defined(MK_${var}) +.if ${COMPILER_FEATURES:Mc++11} +.if defined(WITHOUT_${var}) +MK_${var}:= no +.else +MK_${var}:= yes +.endif +.else +.if defined(WITH_${var}) +MK_${var}:= yes +.else +MK_${var}:= no +.endif +.endif +.endif +.endfor + +# # Force some options off if their dependencies are off. # Order is somewhat important. # @@ -374,29 +410,6 @@ MK_${vv:H}:= ${MK_${vv:T}} .endif .endfor -# -# MK_* options that default to "yes" if the compiler is a C++11 compiler. -# -.include -.for var in \ - LIBCPLUSPLUS -.if !defined(MK_${var}) -.if ${COMPILER_FEATURES:Mc++11} -.if defined(WITHOUT_${var}) -MK_${var}:= no -.else -MK_${var}:= yes -.endif -.else -.if defined(WITH_${var}) -MK_${var}:= yes -.else -MK_${var}:= no -.endif -.endif -.endif -.endfor - .if !${COMPILER_FEATURES:Mc++11} MK_LLDB:= no .endif From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 19:25:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CE1067F; Fri, 25 Apr 2014 19:25:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5242D1C65; Fri, 25 Apr 2014 19:25:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PJPwH0098758; Fri, 25 Apr 2014 19:25:58 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PJPwM3098757; Fri, 25 Apr 2014 19:25:58 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404251925.s3PJPwM3098757@svn.freebsd.org> From: Warner Losh Date: Fri, 25 Apr 2014 19:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264932 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 19:25:58 -0000 Author: imp Date: Fri Apr 25 19:25:57 2014 New Revision: 264932 URL: http://svnweb.freebsd.org/changeset/base/264932 Log: Generalize FOO.clang to FOO.${COMPILER_TYPE}. There's no reason these need to be clang specific. Also generalize things a bit. Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Fri Apr 25 19:25:53 2014 (r264931) +++ head/share/mk/bsd.sys.mk Fri Apr 25 19:25:57 2014 (r264932) @@ -30,10 +30,9 @@ CFLAGS+= -std=${CSTD} .if defined(WARNS) .if ${WARNS} >= 1 CWARNFLAGS+= -Wsystem-headers -.if !defined(NO_WERROR) && (${COMPILER_TYPE} != "clang" \ - || !defined(NO_WERROR.clang)) +.if !defined(NO_WERROR) && !defined(NO_WERROR.${COMPILER_TYPE}) CWARNFLAGS+= -Werror -.endif # !NO_WERROR && (!CLANG || !NO_WERROR.clang) +.endif # !NO_WERROR && !NO_WERROR.${COMPILER_TYPE} .endif # WARNS >= 1 .if ${WARNS} >= 2 CWARNFLAGS+= -Wall -Wno-format-y2k @@ -45,10 +44,9 @@ CWARNFLAGS+= -W -Wno-unused-parameter -W .if ${WARNS} >= 4 CWARNFLAGS+= -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow\ -Wunused-parameter -.if !defined(NO_WCAST_ALIGN) && (${COMPILER_TYPE} != "clang" \ - || !defined(NO_WCAST_ALIGN.clang)) +.if !defined(NO_WCAST_ALIGN) && !defined(NO_WCAST_ALIGN.${COMPILER_TYPE}) CWARNFLAGS+= -Wcast-align -.endif # !NO_WCAST_ALIGN && (!CLANG || !NO_WCAST_ALIGN.clang) +.endif # !NO_WCAST_ALIGN !NO_WCAST_ALIGN.${COMPILER_TYPE} .endif # WARNS >= 4 # BDECFLAGS .if ${WARNS} >= 6 @@ -99,15 +97,14 @@ CWARNFLAGS+= -Wformat=2 -Wno-format-extr CWARNFLAGS+= -Wno-format-nonliteral .endif # WARNS <= 3 .endif # CLANG -.if !defined(NO_WERROR) && (${COMPILER_TYPE} != "clang" \ - || !defined(NO_WERROR.clang)) +.if !defined(NO_WERROR) && !defined(NO_WERROR.${COMPILER_TYPE}) CWARNFLAGS+= -Werror -.endif # !NO_WERROR && (!CLANG || !NO_WERROR.clang) +.endif # !NO_WERROR && !NO_WERROR.${COMPILER_TYPE} .endif # WFORMAT > 0 .endif # WFORMAT -.if defined(NO_WFORMAT) || (${COMPILER_TYPE} == "clang" && defined(NO_WFORMAT.clang)) +.if defined(NO_WFORMAT) || defined(NO_WFORMAT.${COMPILER_TYPE}) CWARNFLAGS+= -Wno-format -.endif # NO_WFORMAT || (CLANG && NO_WFORMAT.clang) +.endif # NO_WFORMAT || NO_WFORMAT.${COMPILER_TYPE} .endif # !NO_WARNS .if defined(IGNORE_PRAGMA) @@ -130,13 +127,9 @@ CFLAGS+= -fno-dwarf2-cfi-asm # Eventually we'll want to start building the base system C++ code as C++11, # but not yet. CXXFLAGS+= -Wno-c++11-extensions -CFLAGS+= ${CFLAGS.clang} -CXXFLAGS+= ${CXXFLAGS.clang} -.else # !CLANG -GCC_MS_EXTENSIONS= -fms-extensions -CFLAGS+= ${CFLAGS.gcc} -CXXFLAGS+= ${CXXFLAGS.gcc} .endif # CLANG +CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} +CXXFLAGS+= ${CXXFLAGS.${COMPILER_TYPE}} .endif # !EARLY_BUILD .if ${MK_SSP} != "no" && ${MACHINE_CPUARCH} != "ia64" && \ From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 19:43:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69910B90; Fri, 25 Apr 2014 19:43:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CF6E1DF6; Fri, 25 Apr 2014 19:43:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PJhJVo006755; Fri, 25 Apr 2014 19:43:19 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PJhI79006753; Fri, 25 Apr 2014 19:43:18 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404251943.s3PJhI79006753@svn.freebsd.org> From: Glen Barber Date: Fri, 25 Apr 2014 19:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264933 - in head/release: amd64 i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 19:43:19 -0000 Author: gjb Date: Fri Apr 25 19:43:18 2014 New Revision: 264933 URL: http://svnweb.freebsd.org/changeset/base/264933 Log: Fix indentation for diff reduction with commits to follow. Sponsored by: The FreeBSD Foundation Modified: head/release/amd64/make-memstick.sh head/release/i386/make-memstick.sh Modified: head/release/amd64/make-memstick.sh ============================================================================== --- head/release/amd64/make-memstick.sh Fri Apr 25 19:25:57 2014 (r264932) +++ head/release/amd64/make-memstick.sh Fri Apr 25 19:43:18 2014 (r264933) @@ -14,32 +14,32 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH if [ $# -ne 2 ]; then - echo "make-memstick.sh /path/to/directory /path/to/image/file" - exit 1 + echo "make-memstick.sh /path/to/directory /path/to/image/file" + exit 1 fi if [ ! -d ${1} ]; then - echo "${1} must be a directory" - exit 1 + echo "${1} must be a directory" + exit 1 fi if [ -e ${2} ]; then - echo "won't overwrite ${2}" - exit 1 + echo "won't overwrite ${2}" + exit 1 fi echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab makefs -B little -o label=FreeBSD_Install ${2} ${1} if [ $? -ne 0 ]; then - echo "makefs failed" - exit 1 + echo "makefs failed" + exit 1 fi rm ${1}/etc/fstab -unit=`mdconfig -a -t vnode -f ${2}` +unit=$(mdconfig -a -t vnode -f ${2}) if [ $? -ne 0 ]; then - echo "mdconfig failed" - exit 1 + echo "mdconfig failed" + exit 1 fi gpart create -s BSD ${unit} gpart bootcode -b ${1}/boot/boot ${unit} Modified: head/release/i386/make-memstick.sh ============================================================================== --- head/release/i386/make-memstick.sh Fri Apr 25 19:25:57 2014 (r264932) +++ head/release/i386/make-memstick.sh Fri Apr 25 19:43:18 2014 (r264933) @@ -14,32 +14,32 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH if [ $# -ne 2 ]; then - echo "make-memstick.sh /path/to/directory /path/to/image/file" - exit 1 + echo "make-memstick.sh /path/to/directory /path/to/image/file" + exit 1 fi if [ ! -d ${1} ]; then - echo "${1} must be a directory" - exit 1 + echo "${1} must be a directory" + exit 1 fi if [ -e ${2} ]; then - echo "won't overwrite ${2}" - exit 1 + echo "won't overwrite ${2}" + exit 1 fi echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab makefs -B little -o label=FreeBSD_Install ${2} ${1} if [ $? -ne 0 ]; then - echo "makefs failed" - exit 1 + echo "makefs failed" + exit 1 fi rm ${1}/etc/fstab -unit=`mdconfig -a -t vnode -f ${2}` +unit=$(mdconfig -a -t vnode -f ${2}) if [ $? -ne 0 ]; then - echo "mdconfig failed" - exit 1 + echo "mdconfig failed" + exit 1 fi gpart create -s BSD ${unit} gpart bootcode -b ${1}/boot/boot ${unit} From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 19:47:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43A3AD07; Fri, 25 Apr 2014 19:47:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1729C1E4F; Fri, 25 Apr 2014 19:47:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PJlRw7007295; Fri, 25 Apr 2014 19:47:27 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PJlRqx007293; Fri, 25 Apr 2014 19:47:27 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404251947.s3PJlRqx007293@svn.freebsd.org> From: Ian Lepore Date: Fri, 25 Apr 2014 19:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264934 - in head/sys/dev/usb: . serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 19:47:28 -0000 Author: ian Date: Fri Apr 25 19:47:27 2014 New Revision: 264934 URL: http://svnweb.freebsd.org/changeset/base/264934 Log: The FTDI product ID we've been calling BEAGLEBONE is actually TI XDS100V2, a jtag debugging product, which was used on early Beaglebone boards (later boards used a standard FTDI 2232C product ID). Change the name accordingly, and also add an entry for XDS100V3, the latest version of that product which has its own new product ID number. Modified: head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Fri Apr 25 19:43:18 2014 (r264933) +++ head/sys/dev/usb/serial/uftdi.c Fri Apr 25 19:47:27 2014 (r264934) @@ -327,7 +327,6 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(FTDI, ATIK_ATK16HRC, 0), UFTDI_DEV(FTDI, ATIK_ATK16IC, 0), UFTDI_DEV(FTDI, BCS_SE923, 0), - UFTDI_DEV(FTDI, BEAGLEBONE, UFTDI_JTAG_IFACE(0)), UFTDI_DEV(FTDI, CANDAPTER, 0), UFTDI_DEV(FTDI, CANUSB, 0), UFTDI_DEV(FTDI, CCSICDU20_0, 0), @@ -537,6 +536,8 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(FTDI, VNHCPCUSB_D, 0), UFTDI_DEV(FTDI, WESTREX_MODEL_777, 0), UFTDI_DEV(FTDI, WESTREX_MODEL_8900F, 0), + UFTDI_DEV(FTDI, XDS100V2, UFTDI_JTAG_IFACE(0)), + UFTDI_DEV(FTDI, XDS100V3, UFTDI_JTAG_IFACE(0)), UFTDI_DEV(FTDI, XF_547, 0), UFTDI_DEV(FTDI, XF_640, 0), UFTDI_DEV(FTDI, XF_642, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Apr 25 19:43:18 2014 (r264933) +++ head/sys/dev/usb/usbdevs Fri Apr 25 19:47:27 2014 (r264934) @@ -1843,7 +1843,8 @@ product FTDI 232H 0x6014 FTDI compatibl product FTDI 232EX 0x6015 FTDI compatible adapter product FTDI SERIAL_2232D 0x9e90 FT2232D Dual port Serial product FTDI SERIAL_4232H 0x6011 FT4232H Quad port Serial -product FTDI BEAGLEBONE 0xa6d0 BeagleBone +product FTDI XDS100V2 0xa6d0 TI XDS100V1/V2 and early Beaglebones +product FTDI XDS100V3 0xa6d1 TI XDS100V3 product FTDI KTLINK 0xbbe2 KT-LINK Embedded Hackers Multitool product FTDI TURTELIZER2 0xbdc8 egnite Turtelizer 2 JTAG/RS232 Adapter /* Gude Analog- und Digitalsysteme products also uses FTDI's id: */ From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 21:09:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36C7D490; Fri, 25 Apr 2014 21:09:23 +0000 (UTC) Received: from mail-qg0-x234.google.com (mail-qg0-x234.google.com [IPv6:2607:f8b0:400d:c04::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6EA81767; Fri, 25 Apr 2014 21:09:22 +0000 (UTC) Received: by mail-qg0-f52.google.com with SMTP id j5so4607788qga.39 for ; Fri, 25 Apr 2014 14:09:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=KJo1zV4Ib5V+JAhdrtFufUW+/V8D9X16NWbBcLQc/iE=; b=hiGKSqDNFWnSce7O1w3xlb/dfD18FeMckrF6v8Jc6aj643QBDREKHljwOaIC0VDtxS ouLNi+nUzOaoscJBEKvZGIh7/EzEqlzAbd8QqMLoq5uVRi8kFbsikx3uWVKOBX5YROpV INfTUBgN1fzf34k423RicFzoWo/eFy/6GL8N6Q5EPj9US+zqAxbrtS2WTPxf7ADNx6Ek Lyy9w9gdYplFmCfPNUf6msqkHqDpo2Z4EzdqaYOFS1H2tsvuRMpO8xluZr68wFlT1t/y CdVeQpesqmpNJ3ZofX+Dgc9Y7Uoy1TPDab+dgYmctCZXRiPIeNeKcB8ptAwz0Y1zdvcI djag== MIME-Version: 1.0 X-Received: by 10.140.92.230 with SMTP id b93mr6682799qge.12.1398460161516; Fri, 25 Apr 2014 14:09:21 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.191.201 with HTTP; Fri, 25 Apr 2014 14:09:21 -0700 (PDT) In-Reply-To: <20140425180900.GP85571@FreeBSD.org> References: <201307261941.r6QJfEMO087844@svn.freebsd.org> <20140425180900.GP85571@FreeBSD.org> Date: Fri, 25 Apr 2014 14:09:21 -0700 X-Google-Sender-Auth: gK5ey9ywygHY0PprhI0AlkTZojo Message-ID: Subject: Re: svn commit: r253687 - head/sys/net From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Alan Somers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 21:09:23 -0000 Someone else should do it. -a On 25 April 2014 11:09, Gleb Smirnoff wrote: > On Fri, Apr 25, 2014 at 09:58:31AM -0600, Alan Somers wrote: > A> On Fri, Jul 26, 2013 at 1:41 PM, Adrian Chadd wrote: > A> > Author: adrian > A> > Date: Fri Jul 26 19:41:13 2013 > A> > New Revision: 253687 > A> > URL: http://svnweb.freebsd.org/changeset/base/253687 > A> > > A> > Log: > A> > Break out the static, global LACP debug options into a per-lagg unit > A> > sysctl tree. > A> > > A> > * Create a net.link.lagg.X.lacp node > A> > A> I think this introduced a lock order reversal. > A> > A> > * Add a debug node under that for tx_test and rx_test > A> > * Add lacp_strict_mode, defaulting to 1 > A> > > A> > tx_test and rx_test are still a bitmap of unit numbers for now. > A> > At some point it would be nice to create child nodes of the lagg bundle > A> > for each sub-interface, and then populate those with various knobs > A> > and statistics. > A> > > A> > Sponsored by: Netflix > > Also, these sysctl nodes were promised to be removed soon: > > http://lists.freebsd.org/pipermail/svn-src-head/2013-July/049602.html > > -- > Totus tuus, Glebius. > From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 21:11:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C07105DE; Fri, 25 Apr 2014 21:11:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9464417E8; Fri, 25 Apr 2014 21:11:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PLB0c5043707; Fri, 25 Apr 2014 21:11:00 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PLB00Q043705; Fri, 25 Apr 2014 21:11:00 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404252111.s3PLB00Q043705@svn.freebsd.org> From: Glen Barber Date: Fri, 25 Apr 2014 21:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264935 - head/release/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 21:11:00 -0000 Author: gjb Date: Fri Apr 25 21:11:00 2014 New Revision: 264935 URL: http://svnweb.freebsd.org/changeset/base/264935 Log: Add a separate script to build the memstick.img and the mini-memstick.img with UEFI support. As the comments in the file suggest, 1) there must be existing ${.OBJDIR}/usr/src/release/{release,bootonly}; 2) TARGET/TARGET_ARCH must be amd64; and 3) it must be a vt(4)-enabled kernel with vt_efifb (*not* vt_vga). This script is not hooked into release/Makefile in any way until further testing is complete. Sponsored by: The FreeBSD Foundation Added: head/release/amd64/make-uefi-memstick.sh (contents, props changed) Added: head/release/amd64/make-uefi-memstick.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/amd64/make-uefi-memstick.sh Fri Apr 25 21:11:00 2014 (r264935) @@ -0,0 +1,73 @@ +#!/bin/sh +# +# This script generates a "memstick image" for UEFI-capable systems. +# +# Prerequisites: +# - 'make release' +# - KERNCONF *must* be VT (or vt_efifb(4) compiled into the kernel) +# +# Note: This only works for amd64, because i386 lacks the EFI boot bits. +# +# Usage: make-memstick.sh +# +# $FreeBSD$ +# + +PATH=/bin:/usr/bin:/sbin:/usr/sbin +export PATH + +if [ $# -ne 2 ]; then + echo "make-memstick.sh /path/to/directory /path/to/image/file" + exit 1 +fi + +if [ ! -d ${1} ]; then + echo "${1} must be a directory" + exit 1 +fi + +if [ -e ${2} ]; then + echo "won't overwrite ${2}" + exit 1 +fi + +dirsize=$(du -shLm ${1} | awk '{print $1}') +dirsize=$(( $(( $(( ${dirsize} + 256 )) * 1024 * 1024 )) )) +truncate -s ${dirsize} ${2} + +unit=$(mdconfig -a -t vnode -f ${2}) +gpart create -s mbr /dev/${unit} +gpart add -t '!0xEF' -s 32M /dev/${unit} +gpart add -t freebsd /dev/${unit} +gpart set -a active -i 2 /dev/${unit} +gpart bootcode -b ${1}/boot/boot0 /dev/${unit} +gpart create -s bsd -n 20 /dev/${unit}s2 +gpart add -t freebsd-ufs /dev/${unit}s2 +gpart bootcode -b ${1}/boot/boot /dev/${unit}s2 +newfs_msdos /dev/${unit}s1 +newfs -L rootfs /dev/${unit}s2a +mkdir -p ${1}/mnt +mount -t msdosfs /dev/${unit}s1 ${1}/mnt +mkdir -p ${1}/mnt/efi/boot +cp -p ${1}/boot/boot1.efi ${1}/mnt/efi/boot/BOOTx64.efi + +while ! umount ${1}/mnt; do + sleep 1 +done + +mkdir -p mnt +mount /dev/${unit}s2a mnt +tar -cf - -C ${1} . | tar -xf - -C mnt +echo "/dev/ufs/rootfs / ufs ro,noatime 1 1" > mnt/etc/fstab + +while ! umount mnt; do + sleep 1 +done + +# Default boot selection to MBR so systems that do not support UEFI +# do not fail to boot without human interaction. +boot0cfg -s 2 /dev/${unit} + +mdconfig -d -u ${unit} +rmdir mnt + From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 21:41:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99A25797; Fri, 25 Apr 2014 21:41:28 +0000 (UTC) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81B231ADF; Fri, 25 Apr 2014 21:41:28 +0000 (UTC) Received: from zeppelin.tachypleus.net (airbears2-136-152-142-25.AirBears2.Berkeley.EDU [136.152.142.25]) (authenticated bits=0) by c.mail.sonic.net (8.14.4/8.14.4) with ESMTP id s3PLfPLT019252 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 25 Apr 2014 14:41:26 -0700 Message-ID: <535AD685.90606@freebsd.org> Date: Fri, 25 Apr 2014 14:41:25 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Glen Barber , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r264935 - head/release/amd64 References: <201404252111.s3PLB00Q043705@svn.freebsd.org> In-Reply-To: <201404252111.s3PLB00Q043705@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-ID: C;xCQRWsLM4xGm2bilf7iULg== M;EMc2WsLM4xGm2bilf7iULg== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 21:41:28 -0000 On 04/25/14 14:11, Glen Barber wrote: > Author: gjb > Date: Fri Apr 25 21:11:00 2014 > New Revision: 264935 > URL: http://svnweb.freebsd.org/changeset/base/264935 > > Log: > Add a separate script to build the memstick.img and the > mini-memstick.img with UEFI support. > > As the comments in the file suggest, 1) there must > be existing ${.OBJDIR}/usr/src/release/{release,bootonly}; > 2) TARGET/TARGET_ARCH must be amd64; and 3) it must be > a vt(4)-enabled kernel with vt_efifb (*not* vt_vga). > > This script is not hooked into release/Makefile in any way > until further testing is complete. > > Sponsored by: The FreeBSD Foundation > > Added: > head/release/amd64/make-uefi-memstick.sh (contents, props changed) > > I understand this is for testing, but is there any reason we can't just have one GPT memstick that boots both BIOS and EFI eventually? Or is that the plan already? -Nathan From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 21:44:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E57FDB5D; Fri, 25 Apr 2014 21:44:57 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [IPv6:2607:fc50:1:2300:1001:1001:1001:face]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail0.glenbarber.us", Issuer "Gandi Standard SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B463F1B00; Fri, 25 Apr 2014 21:44:57 +0000 (UTC) Received: from glenbarber.us (c-71-224-221-174.hsd1.nj.comcast.net [71.224.221.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 4C67B5C81; Fri, 25 Apr 2014 21:44:56 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 4C67B5C81 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Fri, 25 Apr 2014 17:44:54 -0400 From: Glen Barber To: Nathan Whitehorn Subject: Re: svn commit: r264935 - head/release/amd64 Message-ID: <20140425214454.GA1231@glenbarber.us> References: <201404252111.s3PLB00Q043705@svn.freebsd.org> <535AD685.90606@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="OXfL5xGRrasGEqWY" Content-Disposition: inline In-Reply-To: <535AD685.90606@freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 21:44:58 -0000 --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 25, 2014 at 02:41:25PM -0700, Nathan Whitehorn wrote: >=20 > On 04/25/14 14:11, Glen Barber wrote: > >Author: gjb > >Date: Fri Apr 25 21:11:00 2014 > >New Revision: 264935 > >URL: http://svnweb.freebsd.org/changeset/base/264935 > > > >Log: > > Add a separate script to build the memstick.img and the > > mini-memstick.img with UEFI support. > > As the comments in the file suggest, 1) there must > > be existing ${.OBJDIR}/usr/src/release/{release,bootonly}; > > 2) TARGET/TARGET_ARCH must be amd64; and 3) it must be > > a vt(4)-enabled kernel with vt_efifb (*not* vt_vga). > > This script is not hooked into release/Makefile in any way > > until further testing is complete. > > Sponsored by: The FreeBSD Foundation > > > >Added: > > head/release/amd64/make-uefi-memstick.sh (contents, props changed) > > > > >=20 > I understand this is for testing, but is there any reason we can't just h= ave > one GPT memstick that boots both BIOS and EFI eventually? Or is that the > plan already? That is the end goal, and this script does produce both. I just don't entirely trust this script yet. Glen --OXfL5xGRrasGEqWY Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTWtdWAAoJELls3eqvi17Q0PAP/0FroNcIvwa8NnQEQTO2FIut piOPWwEu1nZKyB5IRGDz2DdGU2XCQQAL4nrlNiFXef6yxT4NxNmY89WpJsOTUWdi dGRwqGxsKTWOzYVhGQXsutD86PoRlPcx8ho1aiVvv+J9qS/qJz5apizW3c1Hwip5 JZ4r9f84MkFhs2d3/rke6LEkfdkryjcLVGDv4LFvVcoZ6YS/4kF5aMOwRUmMgqYB Asoo80eRmTbeEYXUzLd2JjCLwuDCbJ7zpzp2oOHpefbzylezuppf1BfjcMHKsFeA Y0JQVuzeKP/WnSTJudX5n9r2vjDS5NWyGSAwkWQPnTTvFCfXP63AJl8x6Qq7PzVS 1K9GPyc2yvISFkJh0tlJkO0/96E+tDJ5MaIXcncDXYg18YtlgKKv6+1J6faXgFVT a0qKj8NX20VUw4cuhtH7SbdWGWD+Nk43dnsjMLwzfgKzbitF78CBytEDvVPeEMmZ X8DIw/JdzfP26scpBW+yetyZ1INj+laPCwgwiNC5tHTFylcUfh/PGbNxY7PD75vq btCMu67SC/aFkRujnQtTKknaCR7kr/oq158W/chCV8v6Sc/cTJBTFXtSxm2gI9Xp sdj6nfQ8HClgi03bCV2o4mjuFdywgT2a5+k58mjTn+4kH58RkIFxE2k3JyqhTAHy 3KtRVVxIHLELCsXU1owT =PwkT -----END PGP SIGNATURE----- --OXfL5xGRrasGEqWY-- From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 21:46:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E24DDDC9; Fri, 25 Apr 2014 21:46:48 +0000 (UTC) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C72371B16; Fri, 25 Apr 2014 21:46:48 +0000 (UTC) Received: from zeppelin.tachypleus.net (airbears2-136-152-142-25.AirBears2.Berkeley.EDU [136.152.142.25]) (authenticated bits=0) by c.mail.sonic.net (8.14.4/8.14.4) with ESMTP id s3PLkkI4024246 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 25 Apr 2014 14:46:47 -0700 Message-ID: <535AD7C6.9030802@freebsd.org> Date: Fri, 25 Apr 2014 14:46:46 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Glen Barber Subject: Re: svn commit: r264935 - head/release/amd64 References: <201404252111.s3PLB00Q043705@svn.freebsd.org> <535AD685.90606@freebsd.org> <20140425214454.GA1231@glenbarber.us> In-Reply-To: <20140425214454.GA1231@glenbarber.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-ID: C;LhZpGcPM4xGBqbilf7iULg== M;LNWSGcPM4xGBqbilf7iULg== Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 21:46:49 -0000 On 04/25/14 14:44, Glen Barber wrote: > On Fri, Apr 25, 2014 at 02:41:25PM -0700, Nathan Whitehorn wrote: >> On 04/25/14 14:11, Glen Barber wrote: >>> Author: gjb >>> Date: Fri Apr 25 21:11:00 2014 >>> New Revision: 264935 >>> URL: http://svnweb.freebsd.org/changeset/base/264935 >>> >>> Log: >>> Add a separate script to build the memstick.img and the >>> mini-memstick.img with UEFI support. >>> As the comments in the file suggest, 1) there must >>> be existing ${.OBJDIR}/usr/src/release/{release,bootonly}; >>> 2) TARGET/TARGET_ARCH must be amd64; and 3) it must be >>> a vt(4)-enabled kernel with vt_efifb (*not* vt_vga). >>> This script is not hooked into release/Makefile in any way >>> until further testing is complete. >>> Sponsored by: The FreeBSD Foundation >>> >>> Added: >>> head/release/amd64/make-uefi-memstick.sh (contents, props changed) >>> >>> >> I understand this is for testing, but is there any reason we can't just have >> one GPT memstick that boots both BIOS and EFI eventually? Or is that the >> plan already? > That is the end goal, and this script does produce both. I just don't > entirely trust this script yet. > > Glen > I appreciate the caution. Thanks for the clarification! I'm planning to get EFI support into the installer this weekend. -Nathan From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 21:47:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70A87F16; Fri, 25 Apr 2014 21:47:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E2971B1D; Fri, 25 Apr 2014 21:47:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PLlPRT057812; Fri, 25 Apr 2014 21:47:25 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3PLlPt1057811; Fri, 25 Apr 2014 21:47:25 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404252147.s3PLlPt1057811@svn.freebsd.org> From: Glen Barber Date: Fri, 25 Apr 2014 21:47:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264946 - head/sys/amd64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 21:47:25 -0000 Author: gjb Date: Fri Apr 25 21:47:24 2014 New Revision: 264946 URL: http://svnweb.freebsd.org/changeset/base/264946 Log: Add a UEFI kernel configuration to include the VT kernel, and replace the vt_vga driver with vt_efifb. This is intended to help with snapshot builds only. There is no intention to MFC this commit. Sponsored by: The FreeBSD Foundation Added: head/sys/amd64/conf/UEFI - copied, changed from r264896, head/sys/amd64/conf/VT Copied and modified: head/sys/amd64/conf/UEFI (from r264896, head/sys/amd64/conf/VT) ============================================================================== --- head/sys/amd64/conf/VT Thu Apr 24 21:18:29 2014 (r264896, copy source) +++ head/sys/amd64/conf/UEFI Fri Apr 25 21:47:24 2014 (r264946) @@ -4,11 +4,8 @@ # # $FreeBSD$ -include GENERIC -ident VT +include VT +ident UEFI -nodevice sc -nodevice vga - -device vt -device vt_vga +nodevice vt_vga +device vt_efifb From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 21:53:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 578651DD; Fri, 25 Apr 2014 21:53:28 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail0.glenbarber.us", Issuer "Gandi Standard SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 274901BFC; Fri, 25 Apr 2014 21:53:28 +0000 (UTC) Received: from glenbarber.us (c-71-224-221-174.hsd1.nj.comcast.net [71.224.221.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id BAA7C5D52; Fri, 25 Apr 2014 21:53:20 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us BAA7C5D52 Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Fri, 25 Apr 2014 17:52:48 -0400 From: Glen Barber To: Nathan Whitehorn Subject: Re: svn commit: r264935 - head/release/amd64 Message-ID: <20140425215248.GB1231@glenbarber.us> References: <201404252111.s3PLB00Q043705@svn.freebsd.org> <535AD685.90606@freebsd.org> <20140425214454.GA1231@glenbarber.us> <535AD7C6.9030802@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="E39vaYmALEf/7YXx" Content-Disposition: inline In-Reply-To: <535AD7C6.9030802@freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 21:53:28 -0000 --E39vaYmALEf/7YXx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Apr 25, 2014 at 02:46:46PM -0700, Nathan Whitehorn wrote: > I appreciate the caution. Thanks for the clarification! I'm planning to get > EFI support into the installer this weekend. Speaking of the installer... How difficult would it be to be able to select a kernel for installation if more than one kernel.${foo}.txz is provided on the install medium? The use case I have in mind is where kernel.VT.txz is extracted to /boot/kernel.VT (which I believe the loader menu already supports multi-kernel), an alternate kernel can be chosen for booting and then can subsequently be chosen as the installed kernel during the extract phase. This would actually cut down quite a bit on snapshot build times, since right now I have to do a separate build for each kernel. Thoughts? Glen --E39vaYmALEf/7YXx Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTWtkwAAoJELls3eqvi17QgBIP/0HWw3In6b96xpv6H6OEie4/ 0BKgd5VhMipaHJlp97t0TFjisAsuMTdytxFJcjJqaWaVdXezYO+B8ac28xnw3wqG WQPuqL0o1X8i49JD+3DHhGQnuGjRkvbsIvXU6bl/6ZuGmQabwCh6hzfpS+pz0vz0 38pR5Ob9BzDWm3qluErZN3g9en8CZq37kitwU5jQmr4X7X1mpKbpD1PjYEsoJFBh HzOw2fVUjrfle9NtXcQd+w9K/UPxybr2w/cvE1mZK9uBkrJgu8fAtnE4zdqI5iyN yEFJ+J9VkOxuVKCubajpQocStRwN8UCO+6UxyQgCQFnSMWFvS3t4wCKCtXLr6ZB/ TftKJRTd0dKI3igRLeGOTTGSNY1wXGpsrZK1Y6ZofPdD5Pwf4fjV+T+Cj10YbXLJ 7UElzSEukNU1q4NvXafCrFzNrvMYdWNZQ2kUTOtr5CiZ13j8ebCqm8LEiktMFSan b9XyThxoMm4Brl47CzIa2ztLPMUE1p0HP1q7suRqnZlb8u1AFvhUfp3VgxhDBvDC YexJQ1pWYYlbwQjXV6uruDCp9pYhCrma2hYISwqSNqYkRBYoyREpmBvNTscaFmOI /6vXIFyiOdclzPdhB3ZXB8zzAXVWcc0E5HoJesiG96UVwWb0H9nzYW/N5eSzyD5c b8NCCXeDSkingaTWSxcr =ZRe5 -----END PGP SIGNATURE----- --E39vaYmALEf/7YXx-- From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 21:58:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30D576B4; Fri, 25 Apr 2014 21:58:37 +0000 (UTC) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16DE81C3C; Fri, 25 Apr 2014 21:58:36 +0000 (UTC) Received: from zeppelin.tachypleus.net (airbears2-136-152-142-25.AirBears2.Berkeley.EDU [136.152.142.25]) (authenticated bits=0) by c.mail.sonic.net (8.14.4/8.14.4) with ESMTP id s3PLwYns002635 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 25 Apr 2014 14:58:35 -0700 Message-ID: <535ADA8A.4030408@freebsd.org> Date: Fri, 25 Apr 2014 14:58:34 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Glen Barber Subject: Re: svn commit: r264935 - head/release/amd64 References: <201404252111.s3PLB00Q043705@svn.freebsd.org> <535AD685.90606@freebsd.org> <20140425214454.GA1231@glenbarber.us> <535AD7C6.9030802@freebsd.org> <20140425215248.GB1231@glenbarber.us> In-Reply-To: <20140425215248.GB1231@glenbarber.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-ID: C;vnt2v8TM4xGCMLilf7iULg== M;Psebv8TM4xGCMLilf7iULg== Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 21:58:37 -0000 On 04/25/14 14:52, Glen Barber wrote: > On Fri, Apr 25, 2014 at 02:46:46PM -0700, Nathan Whitehorn wrote: >> I appreciate the caution. Thanks for the clarification! I'm planning to get >> EFI support into the installer this weekend. > Speaking of the installer... > > How difficult would it be to be able to select a kernel for installation > if more than one kernel.${foo}.txz is provided on the install medium? > > The use case I have in mind is where kernel.VT.txz is extracted to > /boot/kernel.VT (which I believe the loader menu already supports > multi-kernel), an alternate kernel can be chosen for booting and then > can subsequently be chosen as the installed kernel during the extract > phase. > > This would actually cut down quite a bit on snapshot build times, since > right now I have to do a separate build for each kernel. > > Thoughts? > > Glen > Not that hard. If you want to just add extra optional kernels, the installer doesn't even need any patches -- you just have to add it to the make release logic (and MANIFEST) as an extra tarball. Installing it to /boot/kernel would require removing the logic in bsdinstall/scripts/auto that removes "kernel" from the menu as a nonoptional package. -Nathan From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 22:00:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CED9080B; Fri, 25 Apr 2014 22:00:46 +0000 (UTC) Received: from mail-qc0-x233.google.com (mail-qc0-x233.google.com [IPv6:2607:f8b0:400d:c01::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB1F1CB9; Fri, 25 Apr 2014 22:00:46 +0000 (UTC) Received: by mail-qc0-f179.google.com with SMTP id l6so3797783qcy.38 for ; Fri, 25 Apr 2014 15:00:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=tW66s3gC7HUgEnYTs9zqNM6iOMdQ30YFd2brp8f8kEQ=; b=ZyklYs5MpNAY0YT0YMbyEVhEKoMfQoRv9Shw1lP70fDoW9XapzddSXtP7XkI2OZ4b6 U9a7B9B8SsnieJDnd/zOWpRGKPO3bLkU6Gk1+TXtlBVKqFUmXAl9UgvScEKC3JJQgDix 74huEyr0rb27HLP/3ye0oSyKHM/6Ck1v3YOfF+91gVSmwNNtUSG4ulLQk87gC0X7OfNE /duNheAr/SgE/3qKNl2nGYQW0de/RSKJt11s6tJsxmcexvJ4HMbz0ofvROhVrpgHOIdv ObxJMznsTkrhbL6jKYiz5sZx2T+lBHbDjq72YFWwEbix4J4yMAP9FVt8iA5q8vOTN0rM syHQ== MIME-Version: 1.0 X-Received: by 10.140.42.38 with SMTP id b35mr14329607qga.87.1398463245109; Fri, 25 Apr 2014 15:00:45 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.191.201 with HTTP; Fri, 25 Apr 2014 15:00:45 -0700 (PDT) In-Reply-To: <535AD685.90606@freebsd.org> References: <201404252111.s3PLB00Q043705@svn.freebsd.org> <535AD685.90606@freebsd.org> Date: Fri, 25 Apr 2014 15:00:45 -0700 X-Google-Sender-Auth: AlKon-TCVEF555fGcCv3jCxP3xs Message-ID: Subject: Re: svn commit: r264935 - head/release/amd64 From: Adrian Chadd To: Nathan Whitehorn Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , Glen Barber , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 22:00:46 -0000 On 25 April 2014 14:41, Nathan Whitehorn wrote: > > On 04/25/14 14:11, Glen Barber wrote: >> >> Author: gjb >> Date: Fri Apr 25 21:11:00 2014 >> New Revision: 264935 >> URL: http://svnweb.freebsd.org/changeset/base/264935 >> >> Log: >> Add a separate script to build the memstick.img and the >> mini-memstick.img with UEFI support. >> As the comments in the file suggest, 1) there must >> be existing ${.OBJDIR}/usr/src/release/{release,bootonly}; >> 2) TARGET/TARGET_ARCH must be amd64; and 3) it must be >> a vt(4)-enabled kernel with vt_efifb (*not* vt_vga). >> This script is not hooked into release/Makefile in any way >> until further testing is complete. >> Sponsored by: The FreeBSD Foundation >> >> Added: >> head/release/amd64/make-uefi-memstick.sh (contents, props changed) >> >> > > I understand this is for testing, but is there any reason we can't just have > one GPT memstick that boots both BIOS and EFI eventually? Or is that the > plan already? Because BIOSes don't get enough testing. It's the same reason why I'm highly tempted to figure out how to teach the installer to do MBR installs out of the box as well as GPT installs out of the box, because I've found a bunch of BIOSes on recent hardware that seems to assume GPTs == EFI booting, and just plain don't boot your system. (And yes, it'd be nice to have EFI work there, but there's still no i386 EFI support.) -a From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 22:05:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF31DE8F; Fri, 25 Apr 2014 22:05:34 +0000 (UTC) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D279B1D00; Fri, 25 Apr 2014 22:05:34 +0000 (UTC) Received: from zeppelin.tachypleus.net (airbears2-136-152-142-25.AirBears2.Berkeley.EDU [136.152.142.25]) (authenticated bits=0) by d.mail.sonic.net (8.14.4/8.14.4) with ESMTP id s3PM5WKv011232 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 25 Apr 2014 15:05:32 -0700 Message-ID: <535ADC2C.50303@freebsd.org> Date: Fri, 25 Apr 2014 15:05:32 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r264935 - head/release/amd64 References: <201404252111.s3PLB00Q043705@svn.freebsd.org> <535AD685.90606@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-ID: C;LsxSuMXM4xGH2ZxB+Bh/TQ== M;hnd3uMXM4xGH2ZxB+Bh/TQ== Cc: "svn-src-head@freebsd.org" , Glen Barber , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 22:05:35 -0000 On 04/25/14 15:00, Adrian Chadd wrote: > On 25 April 2014 14:41, Nathan Whitehorn wrote: >> On 04/25/14 14:11, Glen Barber wrote: >>> Author: gjb >>> Date: Fri Apr 25 21:11:00 2014 >>> New Revision: 264935 >>> URL: http://svnweb.freebsd.org/changeset/base/264935 >>> >>> Log: >>> Add a separate script to build the memstick.img and the >>> mini-memstick.img with UEFI support. >>> As the comments in the file suggest, 1) there must >>> be existing ${.OBJDIR}/usr/src/release/{release,bootonly}; >>> 2) TARGET/TARGET_ARCH must be amd64; and 3) it must be >>> a vt(4)-enabled kernel with vt_efifb (*not* vt_vga). >>> This script is not hooked into release/Makefile in any way >>> until further testing is complete. >>> Sponsored by: The FreeBSD Foundation >>> >>> Added: >>> head/release/amd64/make-uefi-memstick.sh (contents, props changed) >>> >>> >> I understand this is for testing, but is there any reason we can't just have >> one GPT memstick that boots both BIOS and EFI eventually? Or is that the >> plan already? > Because BIOSes don't get enough testing. > > It's the same reason why I'm highly tempted to figure out how to teach > the installer to do MBR installs out of the box as well as GPT > installs out of the box, because I've found a bunch of BIOSes on > recent hardware that seems to assume GPTs == EFI booting, and just > plain don't boot your system. (And yes, it'd be nice to have EFI work > there, but there's still no i386 EFI support.) > The installer *does* do MBR out of the box. Just format the disk with MBR and press "Auto". It also does straight bsd labels in the same way. -Nathan From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 22:06:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58E13148; Fri, 25 Apr 2014 22:06:28 +0000 (UTC) Received: from mail0.glenbarber.us (mail0.glenbarber.us [208.86.227.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail0.glenbarber.us", Issuer "Gandi Standard SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 140061D11; Fri, 25 Apr 2014 22:06:27 +0000 (UTC) Received: from glenbarber.us (c-71-224-221-174.hsd1.nj.comcast.net [71.224.221.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by mail0.glenbarber.us (Postfix) with ESMTPSA id 638215F0A; Fri, 25 Apr 2014 22:06:26 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 mail0.glenbarber.us 638215F0A Authentication-Results: mail0.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Fri, 25 Apr 2014 18:06:24 -0400 From: Glen Barber To: Nathan Whitehorn Subject: Re: svn commit: r264935 - head/release/amd64 Message-ID: <20140425220624.GC1231@glenbarber.us> References: <201404252111.s3PLB00Q043705@svn.freebsd.org> <535AD685.90606@freebsd.org> <20140425214454.GA1231@glenbarber.us> <535AD7C6.9030802@freebsd.org> <20140425215248.GB1231@glenbarber.us> <535ADA8A.4030408@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="c3bfwLpm8qysLVxt" Content-Disposition: inline In-Reply-To: <535ADA8A.4030408@freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 22:06:28 -0000 --c3bfwLpm8qysLVxt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 25, 2014 at 02:58:34PM -0700, Nathan Whitehorn wrote: >=20 > On 04/25/14 14:52, Glen Barber wrote: > >On Fri, Apr 25, 2014 at 02:46:46PM -0700, Nathan Whitehorn wrote: > >>I appreciate the caution. Thanks for the clarification! I'm planning to= get > >>EFI support into the installer this weekend. > >Speaking of the installer... > > > >How difficult would it be to be able to select a kernel for installation > >if more than one kernel.${foo}.txz is provided on the install medium? > > > >The use case I have in mind is where kernel.VT.txz is extracted to > >/boot/kernel.VT (which I believe the loader menu already supports > >multi-kernel), an alternate kernel can be chosen for booting and then > >can subsequently be chosen as the installed kernel during the extract > >phase. > > > >This would actually cut down quite a bit on snapshot build times, since > >right now I have to do a separate build for each kernel. > > > >Thoughts? > > > >Glen > > >=20 > Not that hard. If you want to just add extra optional kernels, the instal= ler > doesn't even need any patches -- you just have to add it to the make rele= ase > logic (and MANIFEST) as an extra tarball. Installing it to /boot/kernel > would require removing the logic in bsdinstall/scripts/auto that removes > "kernel" from the menu as a nonoptional package. Hmm, if I remember correctly, last time I booted an installer with multiple kernels, there were no options for the kernel in the distribution menu. Or do you mean that if it were marked as optional, they would appear? Anyway, the release logic already supports 'KERNCONF=3D"GENERIC VT"' listing of multiple kernels, so that is not an issue. Thanks! Glen --c3bfwLpm8qysLVxt Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTWtxgAAoJELls3eqvi17QbX4P/2CxIs3PvwcEPQMUODTxoQRb E81sScVleSy1kT6qv5IGJDD6PKCRTn8pYGddZ/bSTzoOy2XVDqsMdhRnZ50ZZBk7 UPBzI8u/sW9xOSXOBa4zY+twaiIi1eRwlzo8emgLU7YufuR0JGZQxBpOCiZBlEDO AGnDg9HOH957HjVxOm5vhQF6MAX4ZGtSUha3nfNhlnAmFyvoX+JPQbT6jaL++NQg bisP5A/dx5qNubRkFMM1j05hrGJOpUO5iQkQfwer+SXkewETi8LPCMQABAWPvtCE r4gv63VPbQ7n9N+dFsojCMkDs2Q+7EFInmtSO1tCOpvgKdz2x2gHfdg8asRFb0tf TGpajLDZzXHI110GF3x2L3TFSUbJTP/qvDqaDi9fRDrD4+FK19qO8ljtKIDU4f0G woc2AkAmczDlSeWmL2U6nLigtUO3eWT/PA8dDgaCZb3MC5MUd3HNSqG6MI6gjOWe /c60EVhcmrXw9CT8gTddiWojooSD8fztr+Rju6jngUIpguyQKNU/iHZzceVjfz+x zMWk+alIBe4PgFcby4VkDzvyyJ1AaENdlEblFDX0lGI19vE7CmFSVkicoh7wsiY7 iwVmXa44JOpRoIyJrZfgYe1JaN+Smg+vRfbzYBDRKF4rfoA4ozm/O9z0jMRTz1yq 3lNbQMEhkJH+7xrv5VPh =zuKB -----END PGP SIGNATURE----- --c3bfwLpm8qysLVxt-- From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 22:09:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23EDD2D8; Fri, 25 Apr 2014 22:09:10 +0000 (UTC) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 083BA1D3D; Fri, 25 Apr 2014 22:09:09 +0000 (UTC) Received: from zeppelin.tachypleus.net (airbears2-136-152-142-25.AirBears2.Berkeley.EDU [136.152.142.25]) (authenticated bits=0) by d.mail.sonic.net (8.14.4/8.14.4) with ESMTP id s3PM97Ik014885 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 25 Apr 2014 15:09:07 -0700 Message-ID: <535ADD03.9000601@freebsd.org> Date: Fri, 25 Apr 2014 15:09:07 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Glen Barber Subject: Re: svn commit: r264935 - head/release/amd64 References: <201404252111.s3PLB00Q043705@svn.freebsd.org> <535AD685.90606@freebsd.org> <20140425214454.GA1231@glenbarber.us> <535AD7C6.9030802@freebsd.org> <20140425215248.GB1231@glenbarber.us> <535ADA8A.4030408@freebsd.org> <20140425220624.GC1231@glenbarber.us> In-Reply-To: <20140425220624.GC1231@glenbarber.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-ID: C;6OGEOMbM4xG2YZxB+Bh/TQ== M;FEWqOMbM4xG2YZxB+Bh/TQ== Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 22:09:10 -0000 On 04/25/14 15:06, Glen Barber wrote: > On Fri, Apr 25, 2014 at 02:58:34PM -0700, Nathan Whitehorn wrote: >> On 04/25/14 14:52, Glen Barber wrote: >>> On Fri, Apr 25, 2014 at 02:46:46PM -0700, Nathan Whitehorn wrote: >>>> I appreciate the caution. Thanks for the clarification! I'm planning to get >>>> EFI support into the installer this weekend. >>> Speaking of the installer... >>> >>> How difficult would it be to be able to select a kernel for installation >>> if more than one kernel.${foo}.txz is provided on the install medium? >>> >>> The use case I have in mind is where kernel.VT.txz is extracted to >>> /boot/kernel.VT (which I believe the loader menu already supports >>> multi-kernel), an alternate kernel can be chosen for booting and then >>> can subsequently be chosen as the installed kernel during the extract >>> phase. >>> >>> This would actually cut down quite a bit on snapshot build times, since >>> right now I have to do a separate build for each kernel. >>> >>> Thoughts? >>> >>> Glen >>> >> Not that hard. If you want to just add extra optional kernels, the installer >> doesn't even need any patches -- you just have to add it to the make release >> logic (and MANIFEST) as an extra tarball. Installing it to /boot/kernel >> would require removing the logic in bsdinstall/scripts/auto that removes >> "kernel" from the menu as a nonoptional package. > Hmm, if I remember correctly, last time I booted an installer with > multiple kernels, there were no options for the kernel in the > distribution menu. Or do you mean that if it were marked as optional, > they would appear? > > Anyway, the release logic already supports 'KERNCONF="GENERIC VT"' > listing of multiple kernels, so that is not an issue. > > Thanks! > > Glen > They just need to be in the MANIFEST file somehow. I guess they aren't being added by release(7)? All the installer does is list that file -- and remove kernel.txz and base.txz by hand. -Nathan From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 22:13:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 662E14FC; Fri, 25 Apr 2014 22:13:42 +0000 (UTC) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx1.fisglobal.com", Issuer "VeriSign Class 3 Secure Server CA - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 283E31DEB; Fri, 25 Apr 2014 22:13:41 +0000 (UTC) Received: from smarthost.fisglobal.com ([10.132.206.191]) by ltcfislmsgpa07.fnfis.com (8.14.5/8.14.5) with ESMTP id s3PMDeI2005249 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Fri, 25 Apr 2014 17:13:40 -0500 Received: from THEMADHATTER (10.242.181.54) by smarthost.fisglobal.com (10.132.206.191) with Microsoft SMTP Server id 14.3.174.1; Fri, 25 Apr 2014 17:13:38 -0500 From: Sender: Devin Teske To: "'Nathan Whitehorn'" , "'Glen Barber'" References: <201404252111.s3PLB00Q043705@svn.freebsd.org> <535AD685.90606@freebsd.org> <20140425214454.GA1231@glenbarber.us> <535AD7C6.9030802@freebsd.org> <20140425215248.GB1231@glenbarber.us> <535ADA8A.4030408@freebsd.org> <20140425220624.GC1231@glenbarber.us> <535ADD03.9000601@freebsd.org> In-Reply-To: <535ADD03.9000601@freebsd.org> Subject: RE: svn commit: r264935 - head/release/amd64 Date: Fri, 25 Apr 2014 15:13:32 -0700 Message-ID: <03e701cf60d3$99547a10$cbfd6e30$@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQHoMQgDLB9RDLdWdAUeXbZQg6JV9wFQ2Si1AUB3rAwBPjMc7AJd2GKAAiZEN8YBttvx0AIEtiCfmpDLTIA= Content-Language: en-us X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.11.96, 1.0.14, 0.0.0000 definitions=2014-04-25_05:2014-04-25,2014-04-25,1970-01-01 signatures=0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 22:13:42 -0000 > -----Original Message----- > From: Nathan Whitehorn [mailto:nwhitehorn@freebsd.org] > Sent: Friday, April 25, 2014 3:09 PM > To: Glen Barber > Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src- > head@freebsd.org > Subject: Re: svn commit: r264935 - head/release/amd64 > > > On 04/25/14 15:06, Glen Barber wrote: > > On Fri, Apr 25, 2014 at 02:58:34PM -0700, Nathan Whitehorn wrote: > >> On 04/25/14 14:52, Glen Barber wrote: > >>> On Fri, Apr 25, 2014 at 02:46:46PM -0700, Nathan Whitehorn wrote: > >>>> I appreciate the caution. Thanks for the clarification! I'm > >>>> planning to get EFI support into the installer this weekend. > >>> Speaking of the installer... > >>> > >>> How difficult would it be to be able to select a kernel for > >>> installation if more than one kernel.${foo}.txz is provided on the install > medium? > >>> > >>> The use case I have in mind is where kernel.VT.txz is extracted to > >>> /boot/kernel.VT (which I believe the loader menu already supports > >>> multi-kernel), an alternate kernel can be chosen for booting and > >>> then can subsequently be chosen as the installed kernel during the > >>> extract phase. > >>> > >>> This would actually cut down quite a bit on snapshot build times, > >>> since right now I have to do a separate build for each kernel. > >>> > >>> Thoughts? > >>> > >>> Glen > >>> > >> Not that hard. If you want to just add extra optional kernels, the > >> installer doesn't even need any patches -- you just have to add it to > >> the make release logic (and MANIFEST) as an extra tarball. Installing > >> it to /boot/kernel would require removing the logic in > >> bsdinstall/scripts/auto that removes "kernel" from the menu as a > nonoptional package. > > Hmm, if I remember correctly, last time I booted an installer with > > multiple kernels, there were no options for the kernel in the > > distribution menu. Or do you mean that if it were marked as optional, > > they would appear? > > > > Anyway, the release logic already supports 'KERNCONF="GENERIC VT"' > > listing of multiple kernels, so that is not an issue. > > > > Thanks! > > > > Glen > > > > They just need to be in the MANIFEST file somehow. I guess they aren't > being added by release(7)? All the installer does is list that file -- and remove > kernel.txz and base.txz by hand. So where sysinstall last we left it supported only two optional distributions, the kernel-debug distribution and "local" distribution, bsdinstall supports as many as you stuff into the manifest. -- Devin _____________ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you. From owner-svn-src-head@FreeBSD.ORG Fri Apr 25 23:26:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABD93430; Fri, 25 Apr 2014 23:26:26 +0000 (UTC) Received: from mail.soaustin.net (pancho.soaustin.net [76.74.250.40]) by mx1.freebsd.org (Postfix) with ESMTP id 87E01161D; Fri, 25 Apr 2014 23:26:26 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id 96A075607F; Fri, 25 Apr 2014 18:26:25 -0500 (CDT) Date: Fri, 25 Apr 2014 18:26:25 -0500 From: Mark Linimon To: Adrian Chadd Subject: Re: svn commit: r264935 - head/release/amd64 Message-ID: <20140425232625.GA14017@lonesome.com> References: <201404252111.s3PLB00Q043705@svn.freebsd.org> <535AD685.90606@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "svn-src-head@freebsd.org" , Glen Barber , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Nathan Whitehorn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 23:26:26 -0000 On Fri, Apr 25, 2014 at 03:00:45PM -0700, Adrian Chadd wrote: > I've found a bunch of BIOSes on recent hardware that seems to assume > GPTs == EFI booting, and just plain don't boot your system. Suggestion? Put a list of these on the wiki so that other people know not to get burned, too. mcl From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 08:05:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A49337F; Sat, 26 Apr 2014 08:05:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56E691114; Sat, 26 Apr 2014 08:05:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3Q85Hj9018905; Sat, 26 Apr 2014 08:05:17 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3Q85HFe018904; Sat, 26 Apr 2014 08:05:17 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201404260805.s3Q85HFe018904@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 26 Apr 2014 08:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264963 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 08:05:17 -0000 Author: trociny Date: Sat Apr 26 08:05:16 2014 New Revision: 264963 URL: http://svnweb.freebsd.org/changeset/base/264963 Log: Define startup order the same way as it is in dummynet. Modified: head/sys/netpfil/ipfw/ip_fw_nat.c Modified: head/sys/netpfil/ipfw/ip_fw_nat.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_nat.c Sat Apr 26 01:00:37 2014 (r264962) +++ head/sys/netpfil/ipfw/ip_fw_nat.c Sat Apr 26 08:05:16 2014 (r264963) @@ -676,8 +676,8 @@ static moduledata_t ipfw_nat_mod = { }; /* Define startup order. */ -#define IPFW_NAT_SI_SUB_FIREWALL (SI_SUB_PROTO_IFATTACHDOMAIN + 1) -#define IPFW_NAT_MODEVENT_ORDER (SI_ORDER_ANY - 255) +#define IPFW_NAT_SI_SUB_FIREWALL SI_SUB_PROTO_IFATTACHDOMAIN +#define IPFW_NAT_MODEVENT_ORDER (SI_ORDER_ANY - 128) /* after ipfw */ #define IPFW_NAT_MODULE_ORDER (IPFW_NAT_MODEVENT_ORDER + 1) #define IPFW_NAT_VNET_ORDER (IPFW_NAT_MODEVENT_ORDER + 2) From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 11:50:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECB5CE07; Sat, 26 Apr 2014 11:50:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCE25134B; Sat, 26 Apr 2014 11:50:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QBoPqt011761; Sat, 26 Apr 2014 11:50:25 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QBoP2v011760; Sat, 26 Apr 2014 11:50:25 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201404261150.s3QBoP2v011760@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sat, 26 Apr 2014 11:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264964 - head/lib/libcrypt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 11:50:26 -0000 Author: des Date: Sat Apr 26 11:50:25 2014 New Revision: 264964 URL: http://svnweb.freebsd.org/changeset/base/264964 Log: r261913 broke DES passwords, because the only way they could work, since they don't have an easily recognizable signature, was if they were the default. This commit rewrites crypt_set_format(3) etc to address this: - Use a pointer instead of an index to identify the default format. This pointer is initialized at compile time to point to the first first element in the list of supported formats, eliminating the need for crypt_setdefault(). Using a pointer also simplifies iterating through the list. - Associate DES with the magic string "_", which takes care of the Extended DES format. - Finally, as a special case, if the salt does not match any known magic string but matches ^[./0-9A-Za-z]{13}$, it is assumed to be a DES password and is passed on to crypt_des(). MFC after: 1 week Modified: head/lib/libcrypt/crypt.c Modified: head/lib/libcrypt/crypt.c ============================================================================== --- head/lib/libcrypt/crypt.c Sat Apr 26 08:05:16 2014 (r264963) +++ head/lib/libcrypt/crypt.c Sat Apr 26 11:50:25 2014 (r264964) @@ -1,6 +1,7 @@ -/* - * Copyright (c) 1999 - * Mark Murray. All rights reserved. +/*- + * Copyright (c) 1999 Mark Murray + * Copyright (c) 2014 Dag-Erling Smørgrav + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,110 +29,88 @@ __FBSDID("$FreeBSD$"); #include -#include + #include +#include #include + #include "crypt.h" -static const struct { +/* + * List of supported crypt(3) formats. The first element in the list will + * be the default. + */ +static const struct crypt_format { const char *const name; char *(*const func)(const char *, const char *); const char *const magic; -} crypt_types[] = { -#ifdef HAS_DES - { - "des", - crypt_des, - NULL - }, -#endif - { - "md5", - crypt_md5, - "$1$" - }, +} crypt_formats[] = { + /* default format */ + { "sha512", crypt_sha512, "$6$" }, + + /* other supported formats */ + { "md5", crypt_md5, "$1$" }, #ifdef HAS_BLOWFISH - { - "blf", - crypt_blowfish, - "$2" - }, + { "blf", crypt_blowfish, "$2" }, +#endif + { "nth", crypt_nthash, "$3$" }, + { "sha256", crypt_sha256, "$5$" }, +#ifdef HAS_DES + { "des", crypt_des, "_" }, #endif - { - "nth", - crypt_nthash, - "$3$" - }, - { - "sha256", - crypt_sha256, - "$5$" - }, - { - "sha512", - crypt_sha512, - "$6$" - }, - { - NULL, - NULL, - NULL - } -}; - -#define CRYPT_DEFAULT "sha512" -static int crypt_type = -1; + /* sentinel */ + { NULL, NULL, NULL } +}; -static void -crypt_setdefault(void) -{ - size_t i; +static const struct crypt_format *crypt_format = &crypt_formats[0]; - if (crypt_type != -1) - return; - for (i = 0; i < sizeof(crypt_types) / sizeof(crypt_types[0]) - 1; i++) { - if (strcmp(CRYPT_DEFAULT, crypt_types[i].name) == 0) { - crypt_type = (int)i; - return; - } - } - crypt_type = 0; -} +#define DES_SALT_ALPHABET \ + "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" +/* + * Returns the name of the currently selected format. + */ const char * crypt_get_format(void) { - crypt_setdefault(); - return (crypt_types[crypt_type].name); + return (crypt_format->name); } +/* + * Selects the format to use for subsequent crypt(3) invocations. + */ int -crypt_set_format(const char *type) +crypt_set_format(const char *format) { - size_t i; + const struct crypt_format *cf; - crypt_setdefault(); - for (i = 0; i < sizeof(crypt_types) / sizeof(crypt_types[0]) - 1; i++) { - if (strcmp(type, crypt_types[i].name) == 0) { - crypt_type = (int)i; + for (cf = crypt_formats; cf->name != NULL; ++cf) { + if (strcasecmp(cf->name, format) == 0) { + crypt_format = cf; return (1); } } return (0); } +/* + * Hash the given password with the given salt. If the salt begins with a + * magic string (e.g. "$6$" for sha512), the corresponding format is used; + * otherwise, the currently selected format is used. + */ char * crypt(const char *passwd, const char *salt) { - size_t i; + const struct crypt_format *cf; - crypt_setdefault(); - for (i = 0; i < sizeof(crypt_types) / sizeof(crypt_types[0]) - 1; i++) { - if (crypt_types[i].magic != NULL && strncmp(salt, - crypt_types[i].magic, strlen(crypt_types[i].magic)) == 0) - return (crypt_types[i].func(passwd, salt)); - } - return (crypt_types[crypt_type].func(passwd, salt)); + for (cf = crypt_formats; cf->name != NULL; ++cf) + if (cf->magic != NULL && strstr(salt, cf->magic) == salt) + return (cf->func(passwd, salt)); +#ifdef HAS_DES + if (strlen(salt) == 13 && strspn(salt, DES_SALT_ALPHABET) == 13) + return (crypt_des(passwd, salt)); +#endif + return (crypt_format->func(passwd, salt)); } From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 12:16:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1316438; Sat, 26 Apr 2014 12:16:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D3A015AA; Sat, 26 Apr 2014 12:16:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QCGegx021409; Sat, 26 Apr 2014 12:16:40 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QCGe4t021408; Sat, 26 Apr 2014 12:16:40 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201404261216.s3QCGe4t021408@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sat, 26 Apr 2014 12:16:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264965 - head/tools/regression/vfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 12:16:40 -0000 Author: des Date: Sat Apr 26 12:16:40 2014 New Revision: 264965 URL: http://svnweb.freebsd.org/changeset/base/264965 Log: Note that the bug was fixed, and when. Modified: head/tools/regression/vfs/trailing_slash.t Modified: head/tools/regression/vfs/trailing_slash.t ============================================================================== --- head/tools/regression/vfs/trailing_slash.t Sat Apr 26 11:50:25 2014 (r264964) +++ head/tools/regression/vfs/trailing_slash.t Sat Apr 26 12:16:40 2014 (r264965) @@ -3,7 +3,7 @@ # $FreeBSD$ # # Tests vfs_lookup()'s handling of trailing slashes for symlinks that -# point to files. See kern/21768 +# point to files. See kern/21768 for details. Fixed in r193028. # testfile="/tmp/testfile-$$" From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 12:18:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2EC0A6A4; Sat, 26 Apr 2014 12:18:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19EAA15BC; Sat, 26 Apr 2014 12:18:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QCIH7s021627; Sat, 26 Apr 2014 12:18:17 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QCIHaX021626; Sat, 26 Apr 2014 12:18:17 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201404261218.s3QCIHaX021626@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sat, 26 Apr 2014 12:18:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264966 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 12:18:18 -0000 Author: des Date: Sat Apr 26 12:18:17 2014 New Revision: 264966 URL: http://svnweb.freebsd.org/changeset/base/264966 Log: Add sysctl OIDs showing the actual size and capacity of the swap zone. MFC after: 1 week Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sat Apr 26 12:16:40 2014 (r264965) +++ head/sys/vm/swap_pager.c Sat Apr 26 12:18:17 2014 (r264966) @@ -164,6 +164,12 @@ static int overcommit = 0; SYSCTL_INT(_vm, OID_AUTO, overcommit, CTLFLAG_RW, &overcommit, 0, "Configure virtual memory overcommit behavior. See tuning(7) " "for details."); +static unsigned long swzone; +SYSCTL_ULONG(_vm, OID_AUTO, swzone, CTLFLAG_RD, &swzone, 0, + "Actual size of swap metadata zone"); +static unsigned long swap_maxpages; +SYSCTL_ULONG(_vm, OID_AUTO, swap_maxpages, CTLFLAG_RD, &swap_maxpages, 0, + "Maximum amount of swap supported"); /* bits from overcommit */ #define SWAP_RESERVE_FORCE_ON (1 << 0) @@ -506,7 +512,7 @@ swap_pager_init(void) void swap_pager_swap_init(void) { - int n, n2; + unsigned long n, n2; /* * Number of in-transit swap bp operations. Don't @@ -542,7 +548,7 @@ swap_pager_swap_init(void) /* * Initialize our zone. Right now I'm just guessing on the number * we need based on the number of pages in the system. Each swblock - * can hold 16 pages, so this is probably overkill. This reservation + * can hold 32 pages, so this is probably overkill. This reservation * is typically limited to around 32MB by default. */ n = vm_cnt.v_page_count / 2; @@ -563,7 +569,9 @@ swap_pager_swap_init(void) n -= ((n + 2) / 3); } while (n > 0); if (n2 != n) - printf("Swap zone entries reduced from %d to %d.\n", n2, n); + printf("Swap zone entries reduced from %lu to %lu.\n", n2, n); + swap_maxpages = n * SWAP_META_PAGES; + swzone = n * sizeof(struct swblock); n2 = n; /* From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 13:05:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51DA5763; Sat, 26 Apr 2014 13:05:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DFCD19E7; Sat, 26 Apr 2014 13:05:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QD5vbE042423; Sat, 26 Apr 2014 13:05:57 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QD5uRW042421; Sat, 26 Apr 2014 13:05:56 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201404261305.s3QD5uRW042421@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 26 Apr 2014 13:05:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264968 - head/bin/date X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 13:05:57 -0000 Author: dumbbell Date: Sat Apr 26 13:05:56 2014 New Revision: 264968 URL: http://svnweb.freebsd.org/changeset/base/264968 Log: date(1): Add "-R" flag to use RFC 2822 date and time output format As stated in the man page, this is equivalent to use "%a, %d %b %Y %T %z" as the output format while LC_TIME is set to the "C" locale. This is compatible with date(1) from the GNU core utilities. Modified: head/bin/date/date.1 head/bin/date/date.c Modified: head/bin/date/date.1 ============================================================================== --- head/bin/date/date.1 Sat Apr 26 12:19:40 2014 (r264967) +++ head/bin/date/date.1 Sat Apr 26 13:05:56 2014 (r264968) @@ -40,7 +40,7 @@ .Nd display or set date and time .Sh SYNOPSIS .Nm -.Op Fl ju +.Op Fl jRu .Op Fl r Ar seconds .Oo .Fl v @@ -58,7 +58,7 @@ .Ar MM Op Ar .ss .Sm on .Nm -.Op Fl jnu +.Op Fl jnRu .Fl f Ar input_fmt new_date .Op Cm + Ns Ar output_fmt .Nm @@ -130,6 +130,16 @@ The .Fl n option suppresses this behavior and causes the time to be set only on the current machine. +.It Fl R +Use RFC 2822 date and time output format. This is equivalent to use +.Dq Li %a, %d %b %Y \&%T %z +as +.Ar output_fmt +while +.Ev LC_TIME +is set to the +.Dq C +locale . .It Fl r Ar seconds Print the date and time represented by .Ar seconds , Modified: head/bin/date/date.c ============================================================================== --- head/bin/date/date.c Sat Apr 26 12:19:40 2014 (r264967) +++ head/bin/date/date.c Sat Apr 26 13:05:56 2014 (r264968) @@ -69,12 +69,14 @@ static void setthetime(const char *, con static void badformat(void); static void usage(void); +static const char *rfc2822_format = "%a, %d %b %Y %T %z"; + int main(int argc, char *argv[]) { struct timezone tz; int ch, rflag; - int jflag, nflag; + int jflag, nflag, Rflag; const char *format; char buf[1024]; char *endptr, *fmt; @@ -89,9 +91,9 @@ main(int argc, char *argv[]) (void) setlocale(LC_TIME, ""); tz.tz_dsttime = tz.tz_minuteswest = 0; rflag = 0; - jflag = nflag = 0; + jflag = nflag = Rflag = 0; set_timezone = 0; - while ((ch = getopt(argc, argv, "d:f:jnr:t:uv:")) != -1) + while ((ch = getopt(argc, argv, "d:f:jnRr:t:uv:")) != -1) switch((char)ch) { case 'd': /* daylight savings time */ tz.tz_dsttime = strtol(optarg, &endptr, 10) ? 1 : 0; @@ -108,6 +110,9 @@ main(int argc, char *argv[]) case 'n': /* don't set network */ nflag = 1; break; + case 'R': /* RFC 2822 datetime format */ + Rflag = 1; + break; case 'r': /* user specified seconds */ rflag = 1; tval = strtoq(optarg, &tmp, 0); @@ -145,6 +150,9 @@ main(int argc, char *argv[]) format = "%+"; + if (Rflag) + format = rfc2822_format; + /* allow the operands in any order */ if (*argv && **argv == '+') { format = *argv + 1; @@ -169,6 +177,14 @@ main(int argc, char *argv[]) usage(); } vary_destroy(v); + + if (format == rfc2822_format) + /* + * When using RFC 2822 datetime format, don't honor the + * locale. + */ + setlocale(LC_TIME, "C"); + (void)strftime(buf, sizeof(buf), format, <); (void)printf("%s\n", buf); if (fflush(stdout)) @@ -301,7 +317,7 @@ static void usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: date [-jnu] [-d dst] [-r seconds] [-t west] " + "usage: date [-jnRu] [-d dst] [-r seconds] [-t west] " "[-v[+|-]val[ymwdHMS]] ... ", " " "[-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format]"); From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 13:21:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71158E79; Sat, 26 Apr 2014 13:21:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E5101BA0; Sat, 26 Apr 2014 13:21:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QDLTSf050318; Sat, 26 Apr 2014 13:21:29 GMT (envelope-from markm@svn.freebsd.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QDLT1C050317; Sat, 26 Apr 2014 13:21:29 GMT (envelope-from markm@svn.freebsd.org) Message-Id: <201404261321.s3QDLT1C050317@svn.freebsd.org> From: Mark Murray Date: Sat, 26 Apr 2014 13:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264969 - head/sys/dev/random X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 13:21:29 -0000 Author: markm Date: Sat Apr 26 13:21:28 2014 New Revision: 264969 URL: http://svnweb.freebsd.org/changeset/base/264969 Log: Correctly set the sysctl format to Alphanumeric, rather than letting it default. Approved by: security-officer(des) Modified: head/sys/dev/random/random_adaptors.c Modified: head/sys/dev/random/random_adaptors.c ============================================================================== --- head/sys/dev/random/random_adaptors.c Sat Apr 26 13:05:56 2014 (r264968) +++ head/sys/dev/random/random_adaptors.c Sat Apr 26 13:21:28 2014 (r264969) @@ -220,12 +220,12 @@ random_adaptors_init(void *unused) SYSCTL_PROC(_kern_random, OID_AUTO, adaptors, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - NULL, 0, random_sysctl_adaptors_handler, "", + NULL, 0, random_sysctl_adaptors_handler, "A", "Random Number Generator adaptors"); SYSCTL_PROC(_kern_random, OID_AUTO, active_adaptor, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, - NULL, 0, random_sysctl_active_adaptor_handler, "", + NULL, 0, random_sysctl_active_adaptor_handler, "A", "Active Random Number Generator Adaptor"); sx_init(&adaptors_lock, "random_adaptors"); From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 13:53:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7346F23B; Sat, 26 Apr 2014 13:53:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F9321DAA; Sat, 26 Apr 2014 13:53:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QDr5nF062462; Sat, 26 Apr 2014 13:53:05 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QDr5cj062461; Sat, 26 Apr 2014 13:53:05 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201404261353.s3QDr5cj062461@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 26 Apr 2014 13:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264970 - head/bin/date X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 13:53:05 -0000 Author: dumbbell Date: Sat Apr 26 13:53:04 2014 New Revision: 264970 URL: http://svnweb.freebsd.org/changeset/base/264970 Log: date(1): Forgot to update manpage date in r264968 MFC after: 1 week MFC with: 264968 Modified: head/bin/date/date.1 Modified: head/bin/date/date.1 ============================================================================== --- head/bin/date/date.1 Sat Apr 26 13:21:28 2014 (r264969) +++ head/bin/date/date.1 Sat Apr 26 13:53:04 2014 (r264970) @@ -32,7 +32,7 @@ .\" @(#)date.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd June 3, 2010 +.Dd April 26, 2014 .Dt DATE 1 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 14:39:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F026A3F; Sat, 26 Apr 2014 14:39:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B825125D; Sat, 26 Apr 2014 14:39:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QEdxJh079468; Sat, 26 Apr 2014 14:39:59 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QEdxgY079467; Sat, 26 Apr 2014 14:39:59 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201404261439.s3QEdxgY079467@svn.freebsd.org> From: Kevin Lo Date: Sat, 26 Apr 2014 14:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264972 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 14:39:59 -0000 Author: kevlo Date: Sat Apr 26 14:39:58 2014 New Revision: 264972 URL: http://svnweb.freebsd.org/changeset/base/264972 Log: Initialize rssi variable. Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sat Apr 26 13:55:03 2014 (r264971) +++ head/sys/dev/usb/wlan/if_urtwn.c Sat Apr 26 14:39:58 2014 (r264972) @@ -1738,6 +1738,7 @@ urtwn_r88e_get_rssi(struct urtwn_softc * uint8_t cck_agc_rpt, lna_idx, vga_idx; int8_t rssi; + rssi = 0; if (rate <= 3) { cck = (struct r88e_rx_cck *)physt; cck_agc_rpt = cck->agc_rpt; From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 14:52:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26471F12; Sat, 26 Apr 2014 14:52:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 125231396; Sat, 26 Apr 2014 14:52:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QEq4Ne086952; Sat, 26 Apr 2014 14:52:04 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QEq48b086947; Sat, 26 Apr 2014 14:52:04 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201404261452.s3QEq48b086947@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 26 Apr 2014 14:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264973 - in head/sys: net netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 14:52:05 -0000 Author: melifaro Date: Sat Apr 26 14:52:03 2014 New Revision: 264973 URL: http://svnweb.freebsd.org/changeset/base/264973 Log: Unify sa_equal() macro usage. MFC after: 2 weeks Modified: head/sys/net/if.c head/sys/net/route.c head/sys/net/route.h head/sys/net/rtsock.c head/sys/netinet6/ip6_input.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sat Apr 26 14:39:58 2014 (r264972) +++ head/sys/net/if.c Sat Apr 26 14:52:03 2014 (r264973) @@ -1550,9 +1550,6 @@ ifa_switch_loopback_route(struct ifaddr * to perform a different comparison. */ -#define sa_equal(a1, a2) \ - (bcmp((a1), (a2), ((a1))->sa_len) == 0) - #define sa_dl_equal(a1, a2) \ ((((struct sockaddr_dl *)(a1))->sdl_len == \ ((struct sockaddr_dl *)(a2))->sdl_len) && \ Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat Apr 26 14:39:58 2014 (r264972) +++ head/sys/net/route.c Sat Apr 26 14:52:03 2014 (r264973) @@ -125,10 +125,6 @@ VNET_DEFINE(int, rttrash); /* routes no #define V_rttrash VNET(rttrash) -/* compare two sockaddr structures */ -#define sa_equal(a1, a2) (((a1)->sa_len == (a2)->sa_len) && \ - (bcmp((a1), (a2), (a1)->sa_len) == 0)) - /* * Convert a 'struct radix_node *' to a 'struct rtentry *'. * The operation can be done safely (in this code) because a Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sat Apr 26 14:39:58 2014 (r264972) +++ head/sys/net/route.h Sat Apr 26 14:52:03 2014 (r264973) @@ -275,6 +275,10 @@ struct rt_addrinfo { sizeof(long) : \ 1 + ( (((struct sockaddr *)(sa))->sa_len - 1) | (sizeof(long) - 1) ) ) +#define sa_equal(a, b) ( \ + (((struct sockaddr *)(a))->sa_len == ((struct sockaddr *)(b))->sa_len) && \ + (bcmp((a), (b), ((struct sockaddr *)(b))->sa_len) == 0)) + #ifdef _KERNEL #define RT_LINK_IS_UP(ifp) (!((ifp)->if_capabilities & IFCAP_LINKSTATE) \ Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sat Apr 26 14:39:58 2014 (r264972) +++ head/sys/net/rtsock.c Sat Apr 26 14:52:03 2014 (r264973) @@ -517,7 +517,6 @@ rtm_get_jailed(struct rt_addrinfo *info, static int route_output(struct mbuf *m, struct socket *so) { -#define sa_equal(a1, a2) (bcmp((a1), (a2), (a1)->sa_len) == 0) struct rt_msghdr *rtm = NULL; struct rtentry *rt = NULL; struct radix_node_head *rnh; @@ -960,7 +959,6 @@ flush: Free(rtm); } return (error); -#undef sa_equal } static void Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Sat Apr 26 14:39:58 2014 (r264972) +++ head/sys/netinet6/ip6_input.c Sat Apr 26 14:52:03 2014 (r264973) @@ -695,8 +695,6 @@ passin: int bad; bad = 1; -#define sa_equal(a1, a2) \ - (bcmp((a1), (a2), ((a1))->sin6_len) == 0) IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != dst6.sin6_family) @@ -706,7 +704,6 @@ passin: } KASSERT(ifa != NULL, ("%s: ifa not found for lle %p", __func__, lle)); -#undef sa_equal ia6 = (struct in6_ifaddr *)ifa; if (!(ia6->ia6_flags & IN6_IFF_NOTREADY)) { From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 16:06:22 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7D35F4A; Sat, 26 Apr 2014 16:06:22 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24CA21933; Sat, 26 Apr 2014 16:06:21 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1We57G-000Eux-CY; Sat, 26 Apr 2014 16:06:14 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s3QG6Be5012878; Sat, 26 Apr 2014 10:06:12 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/8gQ2RWzw81pnr+ldfga0h Subject: Re: svn commit: r264973 - in head/sys: net netinet6 From: Ian Lepore To: "Alexander V. Chernikov" In-Reply-To: <201404261452.s3QEq48b086947@svn.freebsd.org> References: <201404261452.s3QEq48b086947@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Sat, 26 Apr 2014 10:06:11 -0600 Message-ID: <1398528371.61646.147.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 16:06:22 -0000 On Sat, 2014-04-26 at 14:52 +0000, Alexander V. Chernikov wrote: > Author: melifaro > Date: Sat Apr 26 14:52:03 2014 > New Revision: 264973 > URL: http://svnweb.freebsd.org/changeset/base/264973 > > Log: > Unify sa_equal() macro usage. > > MFC after: 2 weeks > > Modified: > head/sys/net/if.c > head/sys/net/route.c > head/sys/net/route.h > head/sys/net/rtsock.c > head/sys/netinet6/ip6_input.c > FYI, there's another #define sa_equal (and sa_dl_equal) in usr.sbin/ifmcstat/ifmcstat.c, which is now getting a redefined error. -- Ian > Modified: head/sys/net/if.c > ============================================================================== > --- head/sys/net/if.c Sat Apr 26 14:39:58 2014 (r264972) > +++ head/sys/net/if.c Sat Apr 26 14:52:03 2014 (r264973) > @@ -1550,9 +1550,6 @@ ifa_switch_loopback_route(struct ifaddr > * to perform a different comparison. > */ > > -#define sa_equal(a1, a2) \ > - (bcmp((a1), (a2), ((a1))->sa_len) == 0) > - > #define sa_dl_equal(a1, a2) \ > ((((struct sockaddr_dl *)(a1))->sdl_len == \ > ((struct sockaddr_dl *)(a2))->sdl_len) && \ > > Modified: head/sys/net/route.c > ============================================================================== > --- head/sys/net/route.c Sat Apr 26 14:39:58 2014 (r264972) > +++ head/sys/net/route.c Sat Apr 26 14:52:03 2014 (r264973) > @@ -125,10 +125,6 @@ VNET_DEFINE(int, rttrash); /* routes no > #define V_rttrash VNET(rttrash) > > > -/* compare two sockaddr structures */ > -#define sa_equal(a1, a2) (((a1)->sa_len == (a2)->sa_len) && \ > - (bcmp((a1), (a2), (a1)->sa_len) == 0)) > - > /* > * Convert a 'struct radix_node *' to a 'struct rtentry *'. > * The operation can be done safely (in this code) because a > > Modified: head/sys/net/route.h > ============================================================================== > --- head/sys/net/route.h Sat Apr 26 14:39:58 2014 (r264972) > +++ head/sys/net/route.h Sat Apr 26 14:52:03 2014 (r264973) > @@ -275,6 +275,10 @@ struct rt_addrinfo { > sizeof(long) : \ > 1 + ( (((struct sockaddr *)(sa))->sa_len - 1) | (sizeof(long) - 1) ) ) > > +#define sa_equal(a, b) ( \ > + (((struct sockaddr *)(a))->sa_len == ((struct sockaddr *)(b))->sa_len) && \ > + (bcmp((a), (b), ((struct sockaddr *)(b))->sa_len) == 0)) > + > #ifdef _KERNEL > > #define RT_LINK_IS_UP(ifp) (!((ifp)->if_capabilities & IFCAP_LINKSTATE) \ > > Modified: head/sys/net/rtsock.c > ============================================================================== > --- head/sys/net/rtsock.c Sat Apr 26 14:39:58 2014 (r264972) > +++ head/sys/net/rtsock.c Sat Apr 26 14:52:03 2014 (r264973) > @@ -517,7 +517,6 @@ rtm_get_jailed(struct rt_addrinfo *info, > static int > route_output(struct mbuf *m, struct socket *so) > { > -#define sa_equal(a1, a2) (bcmp((a1), (a2), (a1)->sa_len) == 0) > struct rt_msghdr *rtm = NULL; > struct rtentry *rt = NULL; > struct radix_node_head *rnh; > @@ -960,7 +959,6 @@ flush: > Free(rtm); > } > return (error); > -#undef sa_equal > } > > static void > > Modified: head/sys/netinet6/ip6_input.c > ============================================================================== > --- head/sys/netinet6/ip6_input.c Sat Apr 26 14:39:58 2014 (r264972) > +++ head/sys/netinet6/ip6_input.c Sat Apr 26 14:52:03 2014 (r264973) > @@ -695,8 +695,6 @@ passin: > int bad; > > bad = 1; > -#define sa_equal(a1, a2) \ > - (bcmp((a1), (a2), ((a1))->sin6_len) == 0) > IF_ADDR_RLOCK(ifp); > TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { > if (ifa->ifa_addr->sa_family != dst6.sin6_family) > @@ -706,7 +704,6 @@ passin: > } > KASSERT(ifa != NULL, ("%s: ifa not found for lle %p", > __func__, lle)); > -#undef sa_equal > > ia6 = (struct in6_ifaddr *)ifa; > if (!(ia6->ia6_flags & IN6_IFF_NOTREADY)) { > From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 16:12:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3203E282; Sat, 26 Apr 2014 16:12:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E7CE19D4; Sat, 26 Apr 2014 16:12:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QGCdRW019893; Sat, 26 Apr 2014 16:12:39 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QGCd5K019892; Sat, 26 Apr 2014 16:12:39 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201404261612.s3QGCd5K019892@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 26 Apr 2014 16:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264974 - head/usr.sbin/ifmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 16:12:40 -0000 Author: melifaro Date: Sat Apr 26 16:12:39 2014 New Revision: 264974 URL: http://svnweb.freebsd.org/changeset/base/264974 Log: Remove sa_equal() definition since it is already defined in net/route.h. Noted by: ian MFC after: 2 weeks Modified: head/usr.sbin/ifmcstat/ifmcstat.c Modified: head/usr.sbin/ifmcstat/ifmcstat.c ============================================================================== --- head/usr.sbin/ifmcstat/ifmcstat.c Sat Apr 26 14:52:03 2014 (r264973) +++ head/usr.sbin/ifmcstat/ifmcstat.c Sat Apr 26 16:12:39 2014 (r264974) @@ -116,9 +116,6 @@ int Kflag = 0; #endif int vflag = 0; -#define sa_equal(a1, a2) \ - (bcmp((a1), (a2), ((a1))->sa_len) == 0) - #define sa_dl_equal(a1, a2) \ ((((struct sockaddr_dl *)(a1))->sdl_len == \ ((struct sockaddr_dl *)(a2))->sdl_len) && \ From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 16:13:12 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 610A43B9; Sat, 26 Apr 2014 16:13:12 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF19419D7; Sat, 26 Apr 2014 16:13:11 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=ptichko.yndx.net) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1We1KX-000PTq-3w; Sat, 26 Apr 2014 16:03:41 +0400 Message-ID: <535BDAFF.2020909@FreeBSD.org> Date: Sat, 26 Apr 2014 20:12:47 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r264973 - in head/sys: net netinet6 References: <201404261452.s3QEq48b086947@svn.freebsd.org> <1398528371.61646.147.camel@revolution.hippie.lan> In-Reply-To: <1398528371.61646.147.camel@revolution.hippie.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 16:13:12 -0000 On 26.04.2014 20:06, Ian Lepore wrote: > On Sat, 2014-04-26 at 14:52 +0000, Alexander V. Chernikov wrote: >> Author: melifaro >> Date: Sat Apr 26 14:52:03 2014 >> New Revision: 264973 >> URL: http://svnweb.freebsd.org/changeset/base/264973 >> >> Log: >> Unify sa_equal() macro usage. >> >> MFC after: 2 weeks >> >> Modified: >> head/sys/net/if.c >> head/sys/net/route.c >> head/sys/net/route.h >> head/sys/net/rtsock.c >> head/sys/netinet6/ip6_input.c >> > FYI, there's another #define sa_equal (and sa_dl_equal) in > usr.sbin/ifmcstat/ifmcstat.c, which is now getting a redefined error. Thanks, removed in r264974. > > -- Ian > >> Modified: head/sys/net/if.c >> ============================================================================== >> --- head/sys/net/if.c Sat Apr 26 14:39:58 2014 (r264972) >> +++ head/sys/net/if.c Sat Apr 26 14:52:03 2014 (r264973) >> @@ -1550,9 +1550,6 @@ ifa_switch_loopback_route(struct ifaddr >> * to perform a different comparison. >> */ >> >> -#define sa_equal(a1, a2) \ >> - (bcmp((a1), (a2), ((a1))->sa_len) == 0) >> - >> #define sa_dl_equal(a1, a2) \ >> ((((struct sockaddr_dl *)(a1))->sdl_len == \ >> ((struct sockaddr_dl *)(a2))->sdl_len) && \ >> >> Modified: head/sys/net/route.c >> ============================================================================== >> --- head/sys/net/route.c Sat Apr 26 14:39:58 2014 (r264972) >> +++ head/sys/net/route.c Sat Apr 26 14:52:03 2014 (r264973) >> @@ -125,10 +125,6 @@ VNET_DEFINE(int, rttrash); /* routes no >> #define V_rttrash VNET(rttrash) >> >> >> -/* compare two sockaddr structures */ >> -#define sa_equal(a1, a2) (((a1)->sa_len == (a2)->sa_len) && \ >> - (bcmp((a1), (a2), (a1)->sa_len) == 0)) >> - >> /* >> * Convert a 'struct radix_node *' to a 'struct rtentry *'. >> * The operation can be done safely (in this code) because a >> >> Modified: head/sys/net/route.h >> ============================================================================== >> --- head/sys/net/route.h Sat Apr 26 14:39:58 2014 (r264972) >> +++ head/sys/net/route.h Sat Apr 26 14:52:03 2014 (r264973) >> @@ -275,6 +275,10 @@ struct rt_addrinfo { >> sizeof(long) : \ >> 1 + ( (((struct sockaddr *)(sa))->sa_len - 1) | (sizeof(long) - 1) ) ) >> >> +#define sa_equal(a, b) ( \ >> + (((struct sockaddr *)(a))->sa_len == ((struct sockaddr *)(b))->sa_len) && \ >> + (bcmp((a), (b), ((struct sockaddr *)(b))->sa_len) == 0)) >> + >> #ifdef _KERNEL >> >> #define RT_LINK_IS_UP(ifp) (!((ifp)->if_capabilities & IFCAP_LINKSTATE) \ >> >> Modified: head/sys/net/rtsock.c >> ============================================================================== >> --- head/sys/net/rtsock.c Sat Apr 26 14:39:58 2014 (r264972) >> +++ head/sys/net/rtsock.c Sat Apr 26 14:52:03 2014 (r264973) >> @@ -517,7 +517,6 @@ rtm_get_jailed(struct rt_addrinfo *info, >> static int >> route_output(struct mbuf *m, struct socket *so) >> { >> -#define sa_equal(a1, a2) (bcmp((a1), (a2), (a1)->sa_len) == 0) >> struct rt_msghdr *rtm = NULL; >> struct rtentry *rt = NULL; >> struct radix_node_head *rnh; >> @@ -960,7 +959,6 @@ flush: >> Free(rtm); >> } >> return (error); >> -#undef sa_equal >> } >> >> static void >> >> Modified: head/sys/netinet6/ip6_input.c >> ============================================================================== >> --- head/sys/netinet6/ip6_input.c Sat Apr 26 14:39:58 2014 (r264972) >> +++ head/sys/netinet6/ip6_input.c Sat Apr 26 14:52:03 2014 (r264973) >> @@ -695,8 +695,6 @@ passin: >> int bad; >> >> bad = 1; >> -#define sa_equal(a1, a2) \ >> - (bcmp((a1), (a2), ((a1))->sin6_len) == 0) >> IF_ADDR_RLOCK(ifp); >> TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { >> if (ifa->ifa_addr->sa_family != dst6.sin6_family) >> @@ -706,7 +704,6 @@ passin: >> } >> KASSERT(ifa != NULL, ("%s: ifa not found for lle %p", >> __func__, lle)); >> -#undef sa_equal >> >> ia6 = (struct in6_ifaddr *)ifa; >> if (!(ia6->ia6_flags & IN6_IFF_NOTREADY)) { >> > > From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 16:34:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2D757BF; Sat, 26 Apr 2014 16:34:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C275B1B92; Sat, 26 Apr 2014 16:34:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QGYNAS028170; Sat, 26 Apr 2014 16:34:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QGYNv4028165; Sat, 26 Apr 2014 16:34:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201404261634.s3QGYNv4028165@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 26 Apr 2014 16:34:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264975 - head/sys/boot/amd64/boot1.efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 16:34:24 -0000 Author: nwhitehorn Date: Sat Apr 26 16:34:22 2014 New Revision: 264975 URL: http://svnweb.freebsd.org/changeset/base/264975 Log: Add generation of an EFI filesystem to hold boot1.efi. This is a near-exact copy of the code from boot1.chrp again. The resulting image is installed to /boot/boot1.efifat. If dd'ed to an 800K "efi" partition, it should result in a bootable system. Added: head/sys/boot/amd64/boot1.efi/Makefile.fat (contents, props changed) head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu (contents, props changed) head/sys/boot/amd64/boot1.efi/generate-fat.sh (contents, props changed) Modified: head/sys/boot/amd64/boot1.efi/Makefile Modified: head/sys/boot/amd64/boot1.efi/Makefile ============================================================================== --- head/sys/boot/amd64/boot1.efi/Makefile Sat Apr 26 16:12:39 2014 (r264974) +++ head/sys/boot/amd64/boot1.efi/Makefile Sat Apr 26 16:34:22 2014 (r264975) @@ -26,7 +26,7 @@ CFLAGS+= -I${.CURDIR}/../../.. .PATH: ${.CURDIR}/../efi ${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../common -FILES= boot1.efi +FILES= boot1.efi boot1.efifat FILESMODE_boot1.efi= ${BINMODE} LDSCRIPT= ${.CURDIR}/../efi/ldscript.${MACHINE_CPUARCH} @@ -57,6 +57,20 @@ CFLAGS+= -I${.CURDIR}/../../common boot1.o: ${.CURDIR}/../../common/ufsread.c +# The following inserts out objects into a template FAT file system +# created by generate-fat.sh + +.include "${.CURDIR}/Makefile.fat" + +boot1.efifat: boot1.efi + echo ${.OBJDIR} + uudecode ${.CURDIR}/fat.tmpl.bz2.uu + mv fat.tmpl.bz2 ${.TARGET}.bz2 + bzip2 -f -d ${.TARGET}.bz2 + dd if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc + +CLEANFILES= boot1.efifat + .endif # ${COMPILER_TYPE} != "gcc" .include Added: head/sys/boot/amd64/boot1.efi/Makefile.fat ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/amd64/boot1.efi/Makefile.fat Sat Apr 26 16:34:22 2014 (r264975) @@ -0,0 +1,3 @@ +# This file autogenerated by generate-fat.sh - DO NOT EDIT +# $FreeBSD$ +BOOT1_OFFSET=0x2d Added: head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu Sat Apr 26 16:34:22 2014 (r264975) @@ -0,0 +1,22 @@ +FAT template boot filesystem created by generate-fat.sh +DO NOT EDIT +$FreeBSD$ +begin 644 fat.tmpl.bz2 +M0EIH.3%!62936?1V`!$`&J7____[ZZKJJ_^N_ZO^Z_^[ON_\`4`00!0$#$$" +M0D)$6&(IZC3RGZH\B&$,U&AH#)B:,$8TAF@@]0T>IZF&A +M&GZID,1IZFAMO%FPGL0"(QIZV"3_!`$@N(@`DD$?C&$["`)`!)$6@#\HOB42 +M0`"2(X0FGX1#L"`'7E,'#-'HM!'QUD0\R,?9U,6ZE8F,Y6*L<9S<6PH)"%_" +MX'_PL4A),QB"(`B(=14*-"8,(QCG.(2$A(1J'010CB&R$(0B00FPP(0A"$)E +M#`A"$(1]LB&!"$(0B4&1#`A"$(14W<9J.:&A@8&!@8'`Z$(D(02@^L=UL>:+ +MBG:Q5+4&'[/P4@D2?M<,E!0&YBF8+],4^%$`4*%$N9MF:Z29-_VG2G7<$LJ-44RST& +MB53YE@H%(G5G$.FU;=L[DQVA]"(V4B1+%BP%.A<-10-%#R#NKR='@\'#"_'U +M'I36ZT:8QIN*3E$:HZIZRJ?$Y1L&<1'C)G(=8,E.L(KU<9X=%/NX.6\=@^IW +M\-PC$B&I"T\!(VI3"K!X:\%.01Y#X/83[SH.J*H5BH:ILFV1'X/D/V1$W6'\ +MFY>YE:*(I!.X@'D>H_(PY'(W1+B;:,Y?H8Y%(Q')!>DDE;\J1-DRXJJ/O(1@ +M'X/24=!+/V8S1)B(R:UE"0&&1:PUS(1`!$04``++GZ/8(CE5P1P8?^7QB[DB +(G"A(>CL`"(`` +` +end Added: head/sys/boot/amd64/boot1.efi/generate-fat.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/amd64/boot1.efi/generate-fat.sh Sat Apr 26 16:34:22 2014 (r264975) @@ -0,0 +1,54 @@ +#!/bin/sh + +# This script generates the dummy FAT filesystem used for the EFI boot +# blocks. It uses newfs_msdos to generate a template filesystem with the +# relevant interesting files. These are then found by grep, and the offsets +# written to a Makefile snippet. +# +# Because it requires root, and because it is overkill, we do not +# do this as part of the normal build. If makefs(8) grows workable FAT +# support, this should be revisited. + +# $FreeBSD$ + +FAT_SIZE=1600 #Size in 512-byte blocks of the produced image + +BOOT1_SIZE=64k + +# Generate 800K FAT image +OUTPUT_FILE=fat.tmpl + +dd if=/dev/zero of=$OUTPUT_FILE bs=512 count=$FAT_SIZE +DEVICE=`mdconfig -a -f $OUTPUT_FILE` +newfs_msdos -F 12 $DEVICE +mkdir stub +mount -t msdosfs /dev/$DEVICE stub + +# Create and bless a directory for the boot loader +mkdir -p stub/efi/boot + +# Make a dummy file for boot1 +echo 'Boot1 START' | dd of=stub/efi/boot/BOOTx64.efi cbs=$BOOT1_SIZE count=1 conv=block + +umount stub +mdconfig -d -u $DEVICE +rmdir stub + +# Locate the offsets of the two fake files +BOOT1_OFFSET=$(hd $OUTPUT_FILE | grep 'Boot1 START' | cut -f 1 -d ' ') + +# Convert to numbers of blocks +BOOT1_OFFSET=$(echo 0x$BOOT1_OFFSET | awk '{printf("%x\n",$1/512);}') + +echo '# This file autogenerated by generate-fat.sh - DO NOT EDIT' > Makefile.fat +echo '# $FreeBSD$' >> Makefile.fat +echo "BOOT1_OFFSET=0x$BOOT1_OFFSET" >> Makefile.fat + +bzip2 $OUTPUT_FILE +echo 'FAT template boot filesystem created by generate-fat.sh' > $OUTPUT_FILE.bz2.uu +echo 'DO NOT EDIT' >> $OUTPUT_FILE.bz2.uu +echo '$FreeBSD$' >> $OUTPUT_FILE.bz2.uu + +uuencode $OUTPUT_FILE.bz2 $OUTPUT_FILE.bz2 >> $OUTPUT_FILE.bz2.uu +rm $OUTPUT_FILE.bz2 + From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 16:46:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2753CB42; Sat, 26 Apr 2014 16:46:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 139771C6A; Sat, 26 Apr 2014 16:46:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QGkXow032480; Sat, 26 Apr 2014 16:46:33 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QGkXlG032479; Sat, 26 Apr 2014 16:46:33 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201404261646.s3QGkXlG032479@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 26 Apr 2014 16:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264976 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 16:46:34 -0000 Author: melifaro Date: Sat Apr 26 16:46:33 2014 New Revision: 264976 URL: http://svnweb.freebsd.org/changeset/base/264976 Log: Use "hash" value in rtalloc_mpath_fib() instead of RTF_ANNOUNCE flag. Hashing method is the same as in in6_src.c. (Probably we need better one). MFC after: 2 weeks Modified: head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Sat Apr 26 16:34:22 2014 (r264975) +++ head/sys/netinet6/nd6_nbr.c Sat Apr 26 16:46:33 2014 (r264976) @@ -242,7 +242,7 @@ nd6_ns_input(struct mbuf *m, int off, in /* Always use the default FIB. */ #ifdef RADIX_MPATH - rtalloc_mpath_fib((struct route *)&ro, RTF_ANNOUNCE, + rtalloc_mpath_fib((struct route *)&ro, ntohl(taddr6.s6_addr32[3]), RT_DEFAULT_FIB); #else in6_rtalloc(&ro, RT_DEFAULT_FIB); From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 16:48:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DBF3C84; Sat, 26 Apr 2014 16:48:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E20A1C71; Sat, 26 Apr 2014 16:48:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QGmBh4032782; Sat, 26 Apr 2014 16:48:11 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QGm9Vs032772; Sat, 26 Apr 2014 16:48:09 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404261648.s3QGm9Vs032772@svn.freebsd.org> From: Ian Lepore Date: Sat, 26 Apr 2014 16:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264977 - in head/sys: arm/freescale/imx dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 16:48:11 -0000 Author: ian Date: Sat Apr 26 16:48:09 2014 New Revision: 264977 URL: http://svnweb.freebsd.org/changeset/base/264977 Log: Stop calling imx51_ccm_foo() clock functions from imx6 code. Instead define a few imx_ccm_foo() functions that are implemented by the imx51 or imx6 ccm code. Of course, the imx6 ccm code is still more a wish than reality, so for now its implementations just return hard-coded numbers. Added: head/sys/arm/freescale/imx/imx_ccmvar.h (contents, props changed) Modified: head/sys/arm/freescale/imx/imx51_ccm.c head/sys/arm/freescale/imx/imx6_ccm.c head/sys/arm/freescale/imx/imx6_usbphy.c head/sys/arm/freescale/imx/imx_gpt.c head/sys/arm/freescale/imx/imx_machdep.h head/sys/arm/freescale/imx/imx_nop_usbphy.c head/sys/arm/freescale/imx/imx_sdhci.c head/sys/dev/usb/controller/ehci_imx.c Modified: head/sys/arm/freescale/imx/imx51_ccm.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_ccm.c Sat Apr 26 16:46:33 2014 (r264976) +++ head/sys/arm/freescale/imx/imx51_ccm.c Sat Apr 26 16:48:09 2014 (r264977) @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #define IMXCCMDEBUG @@ -552,3 +553,30 @@ imx_ccm_usbphy_enable(device_t dev) } } +uint32_t +imx_ccm_ipg_hz(void) +{ + + return (imx51_get_clock(IMX51CLK_IPG_CLK_ROOT)); +} + +uint32_t +imx_ccm_sdhci_hz(void) +{ + + return (imx51_get_clock(IMX51CLK_ESDHC1_CLK_ROOT)); +} + +uint32_t +imx_ccm_perclk_hz(void) +{ + + return (imx51_get_clock(IMX51CLK_PERCLK_ROOT)); +} + +uint32_t +imx_ccm_uart_hz(void) +{ + + return (imx51_get_clock(IMX51CLK_UART_CLK_ROOT)); +} Modified: head/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccm.c Sat Apr 26 16:46:33 2014 (r264976) +++ head/sys/arm/freescale/imx/imx6_ccm.c Sat Apr 26 16:48:09 2014 (r264977) @@ -45,13 +45,15 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include +#include +#include - -/* XXX temp kludge for imx51_get_clock. */ -#include -#include +#ifndef CCGR_CLK_MODE_ALWAYS +#define CCGR_CLK_MODE_OFF 0 +#define CCGR_CLK_MODE_RUNMODE 1 +#define CCGR_CLK_MODE_ALWAYS 3 +#endif struct ccm_softc { device_t dev; @@ -208,24 +210,32 @@ imx_ccm_usbphy_enable(device_t _phydev) #endif } +uint32_t +imx_ccm_ipg_hz(void) +{ + return (66000000); +} +uint32_t +imx_ccm_perclk_hz(void) +{ + return (66000000); +} -// XXX Fix this. This has to be here for other code to link, -// but it doesn't have to return anything useful for imx6 right now. -u_int -imx51_get_clock(enum imx51_clock clk) -{ - switch (clk) - { - case IMX51CLK_IPG_CLK_ROOT: - return 66000000; - default: - printf("imx51_get_clock() on imx6 doesn't know about clock %d\n", clk); - break; - } - return 0; +uint32_t +imx_ccm_sdhci_hz(void) +{ + + return (200000000); +} + +uint32_t +imx_ccm_uart_hz(void) +{ + + return (80000000); } static device_method_t ccm_methods[] = { Modified: head/sys/arm/freescale/imx/imx6_usbphy.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_usbphy.c Sat Apr 26 16:46:33 2014 (r264976) +++ head/sys/arm/freescale/imx/imx6_usbphy.c Sat Apr 26 16:48:09 2014 (r264977) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include Added: head/sys/arm/freescale/imx/imx_ccmvar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx_ccmvar.h Sat Apr 26 16:48:09 2014 (r264977) @@ -0,0 +1,54 @@ +/*- + * Copyright (c) 2014 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef IMX_CCMVAR_H +#define IMX_CCMVAR_H + +/* + * We need a clock management system that works across unrelated SoCs and + * devices. For now, to keep imx development moving, define some barebones + * functionality that can be shared within the imx family by having each SoC + * implement functions with a common name. + * + * The usb enable functions are best-effort. They turn on the usb otg, host, + * and phy clocks in a SoC-specific manner, but it may take a lot more than that + * to make usb work on a given board. In particular, it can require specific + * pinmux setup of gpio pins connected to external phy parts, voltage regulators + * and overcurrent detectors, and so on. On such boards, u-boot or other early + * board setup code has to handle those things. + */ + +uint32_t imx_ccm_ipg_hz(void); +uint32_t imx_ccm_perclk_hz(void); +uint32_t imx_ccm_sdhci_hz(void); +uint32_t imx_ccm_uart_hz(void); + +void imx_ccm_usb_enable(device_t _usbdev); +void imx_ccm_usbphy_enable(device_t _phydev); + +#endif Modified: head/sys/arm/freescale/imx/imx_gpt.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpt.c Sat Apr 26 16:46:33 2014 (r264976) +++ head/sys/arm/freescale/imx/imx_gpt.c Sat Apr 26 16:48:09 2014 (r264977) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #define WRITE4(_sc, _r, _v) \ bus_space_write_4((_sc)->sc_iot, (_sc)->sc_ioh, (_r), (_v)) @@ -164,10 +164,10 @@ imx_gpt_attach(device_t dev) basefreq = 32768; break; case GPT_CR_CLKSRC_IPG: - basefreq = imx51_get_clock(IMX51CLK_IPG_CLK_ROOT); + basefreq = imx_ccm_ipg_hz(); break; case GPT_CR_CLKSRC_IPG_HIGH: - basefreq = imx51_get_clock(IMX51CLK_IPG_CLK_ROOT) * 2; + basefreq = imx_ccm_ipg_hz() * 2; break; case GPT_CR_CLKSRC_24M: ctlreg |= GPT_CR_24MEN; Modified: head/sys/arm/freescale/imx/imx_machdep.h ============================================================================== --- head/sys/arm/freescale/imx/imx_machdep.h Sat Apr 26 16:46:33 2014 (r264976) +++ head/sys/arm/freescale/imx/imx_machdep.h Sat Apr 26 16:48:09 2014 (r264977) @@ -56,21 +56,5 @@ void imx_wdog_cpu_reset(vm_offset_t _wdc u_int imx_soc_type(void); u_int imx_soc_family(void); -/* - * We need a clock management system that works across unrelated SoCs and - * devices. For now, to keep imx development moving, define some barebones - * functionality that can be shared within the imx family by having each SoC - * implement functions with a common name. - * - * The usb enable functions are best-effort. They turn on the usb otg, host, - * and phy clocks in a SoC-specific manner, but it may take a lot more than that - * to make usb work on a given board. In particular, it can require specific - * pinmux setup of gpio pins connected to external phy parts, voltage regulators - * and overcurrent detectors, and so on. On such boards, u-boot or other early - * board setup code has to handle those things. - */ -void imx_ccm_usb_enable(device_t _usbdev); -void imx_ccm_usbphy_enable(device_t _phydev); - #endif Modified: head/sys/arm/freescale/imx/imx_nop_usbphy.c ============================================================================== --- head/sys/arm/freescale/imx/imx_nop_usbphy.c Sat Apr 26 16:46:33 2014 (r264976) +++ head/sys/arm/freescale/imx/imx_nop_usbphy.c Sat Apr 26 16:48:09 2014 (r264977) @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include /* * Table of supported FDT compat strings. Modified: head/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- head/sys/arm/freescale/imx/imx_sdhci.c Sat Apr 26 16:46:33 2014 (r264976) +++ head/sys/arm/freescale/imx/imx_sdhci.c Sat Apr 26 16:48:09 2014 (r264977) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include @@ -723,12 +723,7 @@ imx_sdhci_attach(device_t dev) */ WR4(sc, SDHC_WTMK_LVL, 0x08800880); - /* XXX get imx6 clock frequency from CCM */ - if (sc->hwtype == HWTYPE_USDHC) { - sc->baseclk_hz = 200000000; - } else if (sc->hwtype == HWTYPE_ESDHC) { - sc->baseclk_hz = imx51_get_clock(IMX51CLK_PERCLK_ROOT); - } + sc->baseclk_hz = imx_ccm_sdhci_hz(); /* * If the slot is flagged with the non-removable property, set our flag Modified: head/sys/dev/usb/controller/ehci_imx.c ============================================================================== --- head/sys/dev/usb/controller/ehci_imx.c Sat Apr 26 16:46:33 2014 (r264976) +++ head/sys/dev/usb/controller/ehci_imx.c Sat Apr 26 16:48:09 2014 (r264977) @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "opt_platform.h" From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 16:55:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8ED4FFE1; Sat, 26 Apr 2014 16:55:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F5931D16; Sat, 26 Apr 2014 16:55:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QGtexp036818; Sat, 26 Apr 2014 16:55:40 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QGtdMO036810; Sat, 26 Apr 2014 16:55:39 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201404261655.s3QGtdMO036810@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 26 Apr 2014 16:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264978 - head/usr.sbin/bsdinstall/partedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 16:55:40 -0000 Author: nwhitehorn Date: Sat Apr 26 16:55:38 2014 New Revision: 264978 URL: http://svnweb.freebsd.org/changeset/base/264978 Log: Add EFI support to the installer. This requires that the kernel provide a sysctl to determine what firmware is in use. This sysctl does not exist yet, so the following blocks are in front of the wheels: - I've provisionally called this "hw.platform" after the equivalent thing on PPC - The logic to check the sysctl is short-circuited to always choose BIOS. There's a comment in the top of the file about how to turn this off. If IA64 acquired a boot1.efifat-like thing (probably with very few modifications), the same code could be adapted there. Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c head/usr.sbin/bsdinstall/partedit/partedit.h head/usr.sbin/bsdinstall/partedit/partedit_generic.c head/usr.sbin/bsdinstall/partedit/partedit_pc98.c head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c head/usr.sbin/bsdinstall/partedit/partedit_sparc64.c head/usr.sbin/bsdinstall/partedit/partedit_x86.c Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/gpart_ops.c Sat Apr 26 16:48:09 2014 (r264977) +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c Sat Apr 26 16:55:38 2014 (r264978) @@ -584,7 +584,7 @@ set_default_part_metadata(const char *na if (strcmp(type, "freebsd-swap") == 0) mountpoint = "none"; - if (strcmp(type, "freebsd-boot") == 0) + if (strcmp(type, bootpart_type(scheme)) == 0) md->bootcode = 1; /* VTOC8 needs partcode in UFS partitions */ @@ -949,7 +949,8 @@ addpartform: LIST_FOREACH(gc, &pp->lg_config, lg_config) if (strcmp(gc->lg_name, "type") == 0) break; - if (gc != NULL && strcmp(gc->lg_val, "freebsd-boot") == 0) + if (gc != NULL && strcmp(gc->lg_val, + bootpart_type(scheme)) == 0) break; } @@ -971,7 +972,7 @@ addpartform: gctl_ro_param(r, "arg0", -1, geom->lg_name); gctl_ro_param(r, "flags", -1, GPART_FLAGS); gctl_ro_param(r, "verb", -1, "add"); - gctl_ro_param(r, "type", -1, "freebsd-boot"); + gctl_ro_param(r, "type", -1, bootpart_type(scheme)); snprintf(sizestr, sizeof(sizestr), "%jd", bootpart_size(scheme) / sector); gctl_ro_param(r, "size", -1, sizestr); @@ -1031,7 +1032,7 @@ addpartform: gctl_issue(r); /* Error usually expected and non-fatal */ gctl_free(r); - if (strcmp(items[0].text, "freebsd-boot") == 0) + if (strcmp(items[0].text, bootpart_type(scheme)) == 0) get_part_metadata(newpartname, 1)->bootcode = 1; else if (strcmp(items[0].text, "freebsd") == 0) gpart_partition(newpartname, "BSD"); Modified: head/usr.sbin/bsdinstall/partedit/partedit.h ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit.h Sat Apr 26 16:48:09 2014 (r264977) +++ head/usr.sbin/bsdinstall/partedit/partedit.h Sat Apr 26 16:55:38 2014 (r264978) @@ -74,9 +74,10 @@ void set_default_part_metadata(const cha /* machine-dependent bootability checks */ const char *default_scheme(void); -int is_scheme_bootable(const char *part_type); -size_t bootpart_size(const char *part_type); -const char *bootcode_path(const char *part_type); -const char *partcode_path(const char *part_type); +int is_scheme_bootable(const char *scheme); +size_t bootpart_size(const char *scheme); +const char *bootpart_type(const char *scheme); +const char *bootcode_path(const char *scheme); +const char *partcode_path(const char *scheme); #endif Modified: head/usr.sbin/bsdinstall/partedit/partedit_generic.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit_generic.c Sat Apr 26 16:48:09 2014 (r264977) +++ head/usr.sbin/bsdinstall/partedit/partedit_generic.c Sat Apr 26 16:55:38 2014 (r264978) @@ -58,6 +58,11 @@ bootpart_size(const char *part_type) { } const char * +bootpart_type(const char *scheme) { + return ("freebsd-boot"); +} + +const char * bootcode_path(const char *part_type) { return (NULL); } Modified: head/usr.sbin/bsdinstall/partedit/partedit_pc98.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit_pc98.c Sat Apr 26 16:48:09 2014 (r264977) +++ head/usr.sbin/bsdinstall/partedit/partedit_pc98.c Sat Apr 26 16:55:38 2014 (r264978) @@ -52,6 +52,11 @@ bootpart_size(const char *part_type) { } const char * +bootpart_type(const char *scheme) { + return ("freebsd-boot"); +} + +const char * bootcode_path(const char *part_type) { if (strcmp(part_type, "PC98") == 0) return ("/boot/pc98boot"); Modified: head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Sat Apr 26 16:48:09 2014 (r264977) +++ head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Sat Apr 26 16:55:38 2014 (r264978) @@ -74,6 +74,11 @@ bootpart_size(const char *part_type) { } const char * +bootpart_type(const char *scheme) { + return ("freebsd-boot"); +} + +const char * bootcode_path(const char *part_type) { return (NULL); } Modified: head/usr.sbin/bsdinstall/partedit/partedit_sparc64.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit_sparc64.c Sat Apr 26 16:48:09 2014 (r264977) +++ head/usr.sbin/bsdinstall/partedit/partedit_sparc64.c Sat Apr 26 16:55:38 2014 (r264978) @@ -50,6 +50,11 @@ bootpart_size(const char *part_type) { } const char * +bootpart_type(const char *scheme) { + return ("freebsd-boot"); +} + +const char * bootcode_path(const char *part_type) { return (NULL); } Modified: head/usr.sbin/bsdinstall/partedit/partedit_x86.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit_x86.c Sat Apr 26 16:48:09 2014 (r264977) +++ head/usr.sbin/bsdinstall/partedit/partedit_x86.c Sat Apr 26 16:55:38 2014 (r264978) @@ -26,10 +26,15 @@ * $FreeBSD$ */ +#include +#include #include #include "partedit.h" +static char platform[255] = "BIOS"; /* XXX once sysctl exists, make this an empty string */ +static const char *platform_sysctl = "hw.platform"; + const char * default_scheme(void) { return ("GPT"); @@ -37,27 +42,60 @@ default_scheme(void) { int is_scheme_bootable(const char *part_type) { - if (strcmp(part_type, "BSD") == 0) - return (1); + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); + if (strcmp(part_type, "GPT") == 0) return (1); - if (strcmp(part_type, "MBR") == 0) - return (1); + if (strcmp(platform, "BIOS") == 0) { + if (strcmp(part_type, "BSD") == 0) + return (1); + if (strcmp(part_type, "MBR") == 0) + return (1); + } return (0); } size_t -bootpart_size(const char *part_type) { - if (strcmp(part_type, "GPT") == 0) - return (64*1024); +bootpart_size(const char *scheme) { + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); /* No partcode except for GPT */ + if (strcmp(scheme, "GPT") != 0) + return (0); + + if (strcmp(platform, "BIOS") == 0) + return (64*1024); + else + return (800*1024); + return (0); } const char * +bootpart_type(const char *scheme) { + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); + + if (strcmp(platform, "EFI") == 0) + return ("efi"); + + return ("freebsd-boot"); +} + +const char * bootcode_path(const char *part_type) { + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); + if (strcmp(platform, "EFI") == 0) + return (NULL); + if (strcmp(part_type, "GPT") == 0) return ("/boot/pmbr"); if (strcmp(part_type, "MBR") == 0) @@ -70,8 +108,16 @@ bootcode_path(const char *part_type) { const char * partcode_path(const char *part_type) { - if (strcmp(part_type, "GPT") == 0) - return ("/boot/gptboot"); + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); + + if (strcmp(part_type, "GPT") == 0) { + if (strcmp(platform, "EFI") == 0) + return ("/boot/boot1.efifat"); + else + return ("/boot/gptboot"); + } /* No partcode except for GPT */ return (NULL); From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 16:58:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C31D1C2; Sat, 26 Apr 2014 16:58:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18B4A1D2A; Sat, 26 Apr 2014 16:58:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QGwZac037132; Sat, 26 Apr 2014 16:58:35 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QGwZc4037131; Sat, 26 Apr 2014 16:58:35 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404261658.s3QGwZc4037131@svn.freebsd.org> From: Warner Losh Date: Sat, 26 Apr 2014 16:58:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264979 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 16:58:36 -0000 Author: imp Date: Sat Apr 26 16:58:35 2014 New Revision: 264979 URL: http://svnweb.freebsd.org/changeset/base/264979 Log: make_dtb.sh is designed to be used in a kernel build environment where MACHINE is defined to the target's value, not the host's value. However, in Makefile.inc1, it is still defined to be the host's value. Make the makedtb target work by expanding TARGET in the existance test, and passing MACHINE=$TARGET in the call to make_dtb.sh Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Apr 26 16:55:38 2014 (r264978) +++ head/Makefile.inc1 Sat Apr 26 16:58:35 2014 (r264979) @@ -1833,7 +1833,7 @@ builddtb: echo "ERROR: FDT_DTS_FILE must be specified!"; \ exit 1; \ fi; \ - if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${MACHINE}/${FDT_DTS_FILE} ]; then \ + if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${TARGET}/${FDT_DTS_FILE} ]; then \ echo "ERROR: Specified DTS file (${FDT_DTS_FILE}) does not \ exist!"; \ exit 1; \ @@ -1843,6 +1843,7 @@ builddtb: directory"; \ fi @PATH=${TMPPATH} \ + MACHINE=${TARGET} \ ${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \ ${FDT_DTS_FILE} \ ${DTBOUTPUTPATH}/`basename ${FDT_DTS_FILE} .dts` From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 17:51:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B51BBB8; Sat, 26 Apr 2014 17:51:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBA1512EB; Sat, 26 Apr 2014 17:51:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QHpfjR059246; Sat, 26 Apr 2014 17:51:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QHpfXF059049; Sat, 26 Apr 2014 17:51:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201404261751.s3QHpfXF059049@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 26 Apr 2014 17:51:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264980 - head/sys/boot/amd64/boot1.efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 17:51:42 -0000 Author: nwhitehorn Date: Sat Apr 26 17:51:41 2014 New Revision: 264980 URL: http://svnweb.freebsd.org/changeset/base/264980 Log: Apparently this is supposed to be FAT32, not FAT12. Modified: head/sys/boot/amd64/boot1.efi/Makefile.fat head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu head/sys/boot/amd64/boot1.efi/generate-fat.sh Modified: head/sys/boot/amd64/boot1.efi/Makefile.fat ============================================================================== --- head/sys/boot/amd64/boot1.efi/Makefile.fat Sat Apr 26 16:58:35 2014 (r264979) +++ head/sys/boot/amd64/boot1.efi/Makefile.fat Sat Apr 26 17:51:41 2014 (r264980) @@ -1,3 +1,3 @@ # This file autogenerated by generate-fat.sh - DO NOT EDIT # $FreeBSD$ -BOOT1_OFFSET=0x2d +BOOT1_OFFSET=0x3b Modified: head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu ============================================================================== --- head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu Sat Apr 26 16:58:35 2014 (r264979) +++ head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu Sat Apr 26 17:51:41 2014 (r264980) @@ -2,21 +2,24 @@ FAT template boot filesystem created by DO NOT EDIT $FreeBSD$ begin 644 fat.tmpl.bz2 -M0EIH.3%!62936?1V`!$`&J7____[ZZKJJ_^N_ZO^Z_^[ON_\`4`00!0$#$$" -M0D)$6&(IZC3RGZH\B&$,U&AH#)B:,$8TAF@@]0T>IZF&A -M&GZID,1IZFAMO%FPGL0"(QIZV"3_!`$@N(@`DD$?C&$["`)`!)$6@#\HOB42 -M0`"2(X0FGX1#L"`'7E,'#-'HM!'QUD0\R,?9U,6ZE8F,Y6*L<9S<6PH)"%_" -MX'_PL4A),QB"(`B(=14*-"8,(QCG.(2$A(1J'010CB&R$(0B00FPP(0A"$)E -M#`A"$(1]LB&!"$(0B4&1#`A"$(14W<9J.:&A@8&!@8'`Z$(D(02@^L=UL>:+ -MBG:Q5+4&'[/P4@D2?M<,E!0&YBF8+],4^%$`4*%$N9MF:Z29-_VG2G7<$LJ-44RST& -MB53YE@H%(G5G$.FU;=L[DQVA]"(V4B1+%BP%.A<-10-%#R#NKR='@\'#"_'U -M'I36ZT:8QIN*3E$:HZIZRJ?$Y1L&<1'C)G(=8,E.L(KU<9X=%/NX.6\=@^IW -M\-PC$B&I"T\!(VI3"K!X:\%.01Y#X/83[SH.J*H5BH:ILFV1'X/D/V1$W6'\ -MFY>YE:*(I!.X@'D>H_(PY'(W1+B;:,Y?H8Y%(Q')!>DDE;\J1-DRXJJ/O(1@ -M'X/24=!+/V8S1)B(R:UE"0&&1:PUS(1`!$04``++GZ/8(CE5P1P8?^7QB[DB -(G"A(>CL`"(`` +M0EIH.3%!6293620F1 +MIH#31H--/48U#0--&":#0`80&@TT,@`-&FF"&F@'J::&U/34NO5O]KH&,P3D +M9TC0KV+%M5^)$Y=$D2(S=*LB`@R"#`))MDFE$%&-NDVQ;AN6'M4LC-TEV[;Q +MO4PF6^32;0F_3B==]9YV`]#!83TL-$>IZWL>U[G#?8XC[6LXKC..Y"]R7 +MW+2`DCI_O6(CB*@F:HXU$D_U22''VTEI>J0$D<5XJTGX,_@%TB=+22<.G#2] +M8%U/0HF\H&"DJE]1'D[:R*HAO::Y1KJ51.W[.PJD;.AF*B305`)(Y*D=,J3E +M*C32FALJLNYU!J@"Z_P%2`,'![YLW>M2IC2`:`CEJ&T49+FZ_ +M1LE?,Y33\]9\*FD5,=K=4NCB[FR1Y"F3ZC%OGB-9C3?UV/,;:Y_5*B>JJ2SV +M'4VCKU)D*&.INFX6:M1L6Q:1HC>J9JLU)CN\93G:R2HF-)RY."9[:-NSFY;)AW3_&>YC +MGE^RL\!$JAO6TM%S=C+LRM7_XNY(IPH2!. Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0CBBD1F; Sat, 26 Apr 2014 17:56:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BBE9130F; Sat, 26 Apr 2014 17:56:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QHueJt061794; Sat, 26 Apr 2014 17:56:40 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QHueMW061792; Sat, 26 Apr 2014 17:56:40 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404261756.s3QHueMW061792@svn.freebsd.org> From: Ian Lepore Date: Sat, 26 Apr 2014 17:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264981 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 17:56:40 -0000 Author: ian Date: Sat Apr 26 17:56:39 2014 New Revision: 264981 URL: http://svnweb.freebsd.org/changeset/base/264981 Log: The freescale imx uart driver works for the whole i.MX family, so rename the header file to not have "5xx" in the name. Added: head/sys/dev/uart/uart_dev_imx.h - copied unchanged from r264979, head/sys/dev/uart/uart_dev_imx5xx.h Deleted: head/sys/dev/uart/uart_dev_imx5xx.h Modified: head/sys/dev/uart/uart_dev_imx.c Modified: head/sys/dev/uart/uart_dev_imx.c ============================================================================== --- head/sys/dev/uart/uart_dev_imx.c Sat Apr 26 17:51:41 2014 (r264980) +++ head/sys/dev/uart/uart_dev_imx.c Sat Apr 26 17:56:39 2014 (r264981) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "uart_if.h" /* Copied: head/sys/dev/uart/uart_dev_imx.h (from r264979, head/sys/dev/uart/uart_dev_imx5xx.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/uart/uart_dev_imx.h Sat Apr 26 17:56:39 2014 (r264981, copy of r264979, head/sys/dev/uart/uart_dev_imx5xx.h) @@ -0,0 +1,222 @@ +/*- + * Copyright (c) 2012 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Oleksandr Rybalko under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _UART_DEV_IMX5XX_H +#define _UART_DEV_IMX5XX_H + +#define IMXUART_URXD_REG 0x0000 /* UART Receiver Register */ +#define IMXUART_URXD_CHARRDY (1 << 15) +#define IMXUART_URXD_ERR (1 << 14) +#define IMXUART_URXD_OVRRUN (1 << 13) +#define IMXUART_URXD_FRMERR (1 << 12) +#define IMXUART_URXD_BRK (1 << 11) +#define IMXUART_URXD_PRERR (1 << 10) +#define IMXUART_URXD_RX_DATA_MASK 0xff + +#define IMXUART_UTXD_REG 0x0040 /* UART Transmitter Register */ +#define IMXUART_UTXD_TX_DATA_MASK 0xff + +#define IMXUART_UCR1_REG 0x0080 /* UART Control Register 1 */ +#define IMXUART_UCR1_ADEN (1 << 15) +#define IMXUART_UCR1_ADBR (1 << 14) +#define IMXUART_UCR1_TRDYEN (1 << 13) +#define IMXUART_UCR1_IDEN (1 << 12) +#define IMXUART_UCR1_ICD_MASK (3 << 10) +#define IMXUART_UCR1_ICD_IDLE4 (0 << 10) +#define IMXUART_UCR1_ICD_IDLE8 (1 << 10) +#define IMXUART_UCR1_ICD_IDLE16 (2 << 10) +#define IMXUART_UCR1_ICD_IDLE32 (3 << 10) +#define IMXUART_UCR1_RRDYEN (1 << 9) +#define IMXUART_UCR1_RXDMAEN (1 << 8) +#define IMXUART_UCR1_IREN (1 << 7) +#define IMXUART_UCR1_TXMPTYEN (1 << 6) +#define IMXUART_UCR1_RTSDEN (1 << 5) +#define IMXUART_UCR1_SNDBRK (1 << 4) +#define IMXUART_UCR1_TXDMAEN (1 << 3) +#define IMXUART_UCR1_ATDMAEN (1 << 2) +#define IMXUART_UCR1_DOZE (1 << 1) +#define IMXUART_UCR1_UARTEN (1 << 0) + +#define IMXUART_UCR2_REG 0x0084 /* UART Control Register 2 */ +#define IMXUART_UCR2_ESCI (1 << 15) +#define IMXUART_UCR2_IRTS (1 << 14) +#define IMXUART_UCR2_CTSC (1 << 13) +#define IMXUART_UCR2_CTS (1 << 12) +#define IMXUART_UCR2_ESCEN (1 << 11) +#define IMXUART_UCR2_RTEC_MASK (3 << 9) +#define IMXUART_UCR2_RTEC_REDGE (0 << 9) +#define IMXUART_UCR2_RTEC_FEDGE (1 << 9) +#define IMXUART_UCR2_RTEC_EDGE (2 << 9) +#define IMXUART_UCR2_PREN (1 << 8) +#define IMXUART_UCR2_PROE (1 << 7) +#define IMXUART_UCR2_STPB (1 << 6) +#define IMXUART_UCR2_WS (1 << 5) +#define IMXUART_UCR2_RTSEN (1 << 4) +#define IMXUART_UCR2_ATEN (1 << 3) +#define IMXUART_UCR2_TXEN (1 << 2) +#define IMXUART_UCR2_RXEN (1 << 1) +#define IMXUART_UCR2_N_SRST (1 << 0) + +#define IMXUART_UCR3_REG 0x0088 /* UART Control Register 3 */ +#define IMXUART_UCR3_DPEC_MASK (3 << 14) +#define IMXUART_UCR3_DPEC_REDGE (0 << 14) +#define IMXUART_UCR3_DPEC_FEDGE (1 << 14) +#define IMXUART_UCR3_DPEC_EDGE (2 << 14) +#define IMXUART_UCR3_DTREN (1 << 13) +#define IMXUART_UCR3_PARERREN (1 << 12) +#define IMXUART_UCR3_FRAERREN (1 << 11) +#define IMXUART_UCR3_DSR (1 << 10) +#define IMXUART_UCR3_DCD (1 << 9) +#define IMXUART_UCR3_RI (1 << 8) +#define IMXUART_UCR3_ADNIMP (1 << 7) +#define IMXUART_UCR3_RXDSEN (1 << 6) +#define IMXUART_UCR3_AIRINTEN (1 << 5) +#define IMXUART_UCR3_AWAKEN (1 << 4) +#define IMXUART_UCR3_DTRDEN (1 << 3) +#define IMXUART_UCR3_RXDMUXSEL (1 << 2) +#define IMXUART_UCR3_INVT (1 << 1) +#define IMXUART_UCR3_ACIEN (1 << 0) + +#define IMXUART_UCR4_REG 0x008c /* UART Control Register 4 */ +#define IMXUART_UCR4_CTSTL_MASK (0x3f << 10) +#define IMXUART_UCR4_CTSTL_SHIFT 10 +#define IMXUART_UCR4_INVR (1 << 9) +#define IMXUART_UCR4_ENIRI (1 << 8) +#define IMXUART_UCR4_WKEN (1 << 7) +#define IMXUART_UCR4_IDDMAEN (1 << 6) +#define IMXUART_UCR4_IRSC (1 << 5) +#define IMXUART_UCR4_LPBYP (1 << 4) +#define IMXUART_UCR4_TCEN (1 << 3) +#define IMXUART_UCR4_BKEN (1 << 2) +#define IMXUART_UCR4_OREN (1 << 1) +#define IMXUART_UCR4_DREN (1 << 0) + +#define IMXUART_UFCR_REG 0x0090 /* UART FIFO Control Register */ +#define IMXUART_UFCR_TXTL_MASK (0x3f << 10) +#define IMXUART_UFCR_TXTL_SHIFT 10 +#define IMXUART_UFCR_RFDIV_MASK (0x07 << 7) +#define IMXUART_UFCR_RFDIV_SHIFT 7 +#define IMXUART_UFCR_RFDIV_SHIFT 7 +#define IMXUART_UFCR_RFDIV_DIV6 (0 << 7) +#define IMXUART_UFCR_RFDIV_DIV5 (1 << 7) +#define IMXUART_UFCR_RFDIV_DIV4 (2 << 7) +#define IMXUART_UFCR_RFDIV_DIV3 (3 << 7) +#define IMXUART_UFCR_RFDIV_DIV2 (4 << 7) +#define IMXUART_UFCR_RFDIV_DIV1 (5 << 7) +#define IMXUART_UFCR_RFDIV_DIV7 (6 << 7) +#define IMXUART_UFCR_DCEDTE (1 << 6) +#define IMXUART_UFCR_RXTL_MASK 0x0000003f +#define IMXUART_UFCR_RXTL_SHIFT 0 + +#define IMXUART_USR1_REG 0x0094 /* UART Status Register 1 */ +#define IMXUART_USR1_PARITYERR (1 << 15) +#define IMXUART_USR1_RTSS (1 << 14) +#define IMXUART_USR1_TRDY (1 << 13) +#define IMXUART_USR1_RTSD (1 << 12) +#define IMXUART_USR1_ESCF (1 << 11) +#define IMXUART_USR1_FRAMERR (1 << 10) +#define IMXUART_USR1_RRDY (1 << 9) +#define IMXUART_USR1_AGTIM (1 << 8) +#define IMXUART_USR1_DTRD (1 << 7) +#define IMXUART_USR1_RXDS (1 << 6) +#define IMXUART_USR1_AIRINT (1 << 5) +#define IMXUART_USR1_AWAKE (1 << 4) +/* 6040 5008 XXX */ + +#define IMXUART_USR2_REG 0x0098 /* UART Status Register 2 */ +#define IMXUART_USR2_ADET (1 << 15) +#define IMXUART_USR2_TXFE (1 << 14) +#define IMXUART_USR2_DTRF (1 << 13) +#define IMXUART_USR2_IDLE (1 << 12) +#define IMXUART_USR2_ACST (1 << 11) +#define IMXUART_USR2_RIDELT (1 << 10) +#define IMXUART_USR2_RIIN (1 << 9) +#define IMXUART_USR2_IRINT (1 << 8) +#define IMXUART_USR2_WAKE (1 << 7) +#define IMXUART_USR2_DCDDELT (1 << 6) +#define IMXUART_USR2_DCDIN (1 << 5) +#define IMXUART_USR2_RTSF (1 << 4) +#define IMXUART_USR2_TXDC (1 << 3) +#define IMXUART_USR2_BRCD (1 << 2) +#define IMXUART_USR2_ORE (1 << 1) +#define IMXUART_USR2_RDR (1 << 0) + +#define IMXUART_UESC_REG 0x009c /* UART Escape Character Register */ +#define IMXUART_UESC_ESC_CHAR_MASK 0x000000ff + +#define IMXUART_UTIM_REG 0x00a0 /* UART Escape Timer Register */ +#define IMXUART_UTIM_TIM_MASK 0x00000fff + +#define IMXUART_UBIR_REG 0x00a4 /* UART BRM Incremental Register */ +#define IMXUART_UBIR_INC_MASK 0x0000ffff + +#define IMXUART_UBMR_REG 0x00a8 /* UART BRM Modulator Register */ +#define IMXUART_UBMR_MOD_MASK 0x0000ffff + +#define IMXUART_UBRC_REG 0x00ac /* UART Baud Rate Count Register */ +#define IMXUART_UBRC_BCNT_MASK 0x0000ffff + +#define IMXUART_ONEMS_REG 0x00b0 /* UART One Millisecond Register */ +#define IMXUART_ONEMS_ONEMS_MASK 0x00ffffff + +#define IMXUART_UTS_REG 0x00b4 /* UART Test Register */ +#define IMXUART_UTS_FRCPERR (1 << 13) +#define IMXUART_UTS_LOOP (1 << 12) +#define IMXUART_UTS_DBGEN (1 << 11) +#define IMXUART_UTS_LOOPIR (1 << 10) +#define IMXUART_UTS_RXDBG (1 << 9) +#define IMXUART_UTS_TXEMPTY (1 << 6) +#define IMXUART_UTS_RXEMPTY (1 << 5) +#define IMXUART_UTS_TXFULL (1 << 4) +#define IMXUART_UTS_RXFULL (1 << 3) +#define IMXUART_UTS_SOFTRST (1 << 0) + +#define REG(_r) IMXUART_ ## _r ## _REG +#define FLD(_r, _v) IMXUART_ ## _r ## _ ## _v + +#define GETREG(bas, reg) \ + bus_space_read_4((bas)->bst, (bas)->bsh, (reg)) +#define SETREG(bas, reg, value) \ + bus_space_write_4((bas)->bst, (bas)->bsh, (reg), (value)) + +#define CLR(_bas, _r, _b) \ + SETREG((_bas), (_r), GETREG((_bas), (_r)) & ~(_b)) +#define SET(_bas, _r, _b) \ + SETREG((_bas), (_r), GETREG((_bas), (_r)) | (_b)) +#define IS_SET(_bas, _r, _b) \ + ((GETREG((_bas), (_r)) & (_b)) ? 1 : 0) + +#define ENA(_bas, _r, _b) SET((_bas), REG(_r), FLD(_r, _b)) +#define DIS(_bas, _r, _b) CLR((_bas), REG(_r), FLD(_r, _b)) +#define IS(_bas, _r, _b) IS_SET((_bas), REG(_r), FLD(_r, _b)) + + +#endif /* _UART_DEV_IMX5XX_H */ From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 19:30:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B625D2C4; Sat, 26 Apr 2014 19:30:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A35C01C04; Sat, 26 Apr 2014 19:30:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QJU4CP007813; Sat, 26 Apr 2014 19:30:04 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QJU4PW007812; Sat, 26 Apr 2014 19:30:04 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201404261930.s3QJU4PW007812@svn.freebsd.org> From: Andreas Tobler Date: Sat, 26 Apr 2014 19:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264982 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 19:30:04 -0000 Author: andreast Date: Sat Apr 26 19:30:04 2014 New Revision: 264982 URL: http://svnweb.freebsd.org/changeset/base/264982 Log: Fix gcc build, initialize off variable. Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sat Apr 26 17:56:39 2014 (r264981) +++ head/sys/dev/usb/wlan/if_urtwn.c Sat Apr 26 19:30:04 2014 (r264982) @@ -1302,6 +1302,7 @@ urtwn_r88e_read_rom(struct urtwn_softc * uint8_t off, msk, tmp; int i; + off = 0; urtwn_efuse_switch_power(sc); /* Read full ROM image. */ From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 20:03:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E909FC8D; Sat, 26 Apr 2014 20:03:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D580C1081; Sat, 26 Apr 2014 20:03:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QK34cG023301; Sat, 26 Apr 2014 20:03:04 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QK34gj023300; Sat, 26 Apr 2014 20:03:04 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404262003.s3QK34gj023300@svn.freebsd.org> From: Ian Lepore Date: Sat, 26 Apr 2014 20:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264983 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 20:03:05 -0000 Author: ian Date: Sat Apr 26 20:03:04 2014 New Revision: 264983 URL: http://svnweb.freebsd.org/changeset/base/264983 Log: Flesh out imx_uart_init() so that we're not relying on u-boot to init the hardware (meaning uarts other than the console will work). Modified: head/sys/dev/uart/uart_dev_imx.c Modified: head/sys/dev/uart/uart_dev_imx.c ============================================================================== --- head/sys/dev/uart/uart_dev_imx.c Sat Apr 26 19:30:04 2014 (r264982) +++ head/sys/dev/uart/uart_dev_imx.c Sat Apr 26 20:03:04 2014 (r264983) @@ -43,10 +43,11 @@ __FBSDID("$FreeBSD$"); #include #include #include - #include - #include "uart_if.h" + +#include + /* * Low-level UART interface. */ @@ -66,6 +67,22 @@ static struct uart_ops uart_imx_uart_ops .getc = imx_uart_getc, }; +#if 0 /* Handy when debugging. */ +static void +dumpregs(struct uart_bas *bas, const char * msg) +{ + + if (!bootverbose) + return; + printf("%s bsh 0x%08lx UCR1 0x%08x UCR2 0x%08x " + "UCR3 0x%08x UCR4 0x%08x USR1 0x%08x USR2 0x%08x\n", + msg, bas->bsh, + GETREG(bas, REG(UCR1)), GETREG(bas, REG(UCR2)), + GETREG(bas, REG(UCR3)), GETREG(bas, REG(UCR4)), + GETREG(bas, REG(USR1)), GETREG(bas, REG(USR2))); +} +#endif + static int imx_uart_probe(struct uart_bas *bas) { @@ -77,7 +94,59 @@ static void imx_uart_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, int parity) { + uint32_t baseclk, reg; + + /* Enable the device and the RX/TX channels. */ + SET(bas, REG(UCR1), FLD(UCR1, UARTEN)); + SET(bas, REG(UCR2), FLD(UCR2, RXEN) | FLD(UCR2, TXEN)); + + if (databits == 7) + DIS(bas, UCR2, WS); + else + ENA(bas, UCR2, WS); + + if (stopbits == 2) + ENA(bas, UCR2, STPB); + else + DIS(bas, UCR2, STPB); + + switch (parity) { + case UART_PARITY_ODD: + DIS(bas, UCR2, PROE); + ENA(bas, UCR2, PREN); + break; + case UART_PARITY_EVEN: + ENA(bas, UCR2, PROE); + ENA(bas, UCR2, PREN); + break; + case UART_PARITY_MARK: + case UART_PARITY_SPACE: + /* FALLTHROUGH: Hardware doesn't support mark/space. */ + case UART_PARITY_NONE: + default: + DIS(bas, UCR2, PREN); + break; + } + /* + * The hardware has an extremely flexible baud clock: it allows setting + * both the numerator and denominator of the divider, as well as a + * separate pre-divider. We simplify that problem by assuming a + * pre-divider and numerator of one because our base clock is so fast we + * can reach virtually any reasonable speed with a simple divisor. The + * numerator value actually includes the 16x over-sampling; the register + * value is the numerator-1, so we have a hard-coded 15. Note that a + * quirk of the hardware requires that both UBIR and UBMR be set back to + * back in order for the change to take effect. + */ + if (baudrate > 0) { + baseclk = imx_ccm_uart_hz(); + reg = GETREG(bas, REG(UFCR)); + reg = (reg & ~IMXUART_UFCR_RFDIV_MASK) | IMXUART_UFCR_RFDIV_DIV1; + SETREG(bas, REG(UFCR), reg); + SETREG(bas, REG(UBIR), 15); + SETREG(bas, REG(UBMR), (baseclk / baudrate) - 1); + } } static void @@ -218,6 +287,8 @@ imx_uart_bus_attach(struct uart_softc *s DIS(bas, UCR3, RI); DIS(bas, UCR3, DCD); DIS(bas, UCR3, DTRDEN); + ENA(bas, UCR2, IRTS); + ENA(bas, UCR3, RXDMUXSEL); /* ACK all interrupts */ SETREG(bas, REG(USR1), 0xffff); From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 20:27:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79BE4129; Sat, 26 Apr 2014 20:27:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6653B1215; Sat, 26 Apr 2014 20:27:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QKRxHG031867; Sat, 26 Apr 2014 20:27:59 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QKRx8w031866; Sat, 26 Apr 2014 20:27:59 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404262027.s3QKRx8w031866@svn.freebsd.org> From: Ian Lepore Date: Sat, 26 Apr 2014 20:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264985 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 20:27:59 -0000 Author: ian Date: Sat Apr 26 20:27:58 2014 New Revision: 264985 URL: http://svnweb.freebsd.org/changeset/base/264985 Log: Reword a comment block a bit; no functional changes. Modified: head/sys/dev/uart/uart_dev_imx.c Modified: head/sys/dev/uart/uart_dev_imx.c ============================================================================== --- head/sys/dev/uart/uart_dev_imx.c Sat Apr 26 20:27:54 2014 (r264984) +++ head/sys/dev/uart/uart_dev_imx.c Sat Apr 26 20:27:58 2014 (r264985) @@ -131,13 +131,14 @@ imx_uart_init(struct uart_bas *bas, int /* * The hardware has an extremely flexible baud clock: it allows setting * both the numerator and denominator of the divider, as well as a - * separate pre-divider. We simplify that problem by assuming a - * pre-divider and numerator of one because our base clock is so fast we - * can reach virtually any reasonable speed with a simple divisor. The - * numerator value actually includes the 16x over-sampling; the register - * value is the numerator-1, so we have a hard-coded 15. Note that a - * quirk of the hardware requires that both UBIR and UBMR be set back to - * back in order for the change to take effect. + * separate pre-divider. We simplify the problem of coming up with a + * workable pair of numbers by assuming a pre-divider and numerator of + * one because our base clock is so fast we can reach virtually any + * reasonable speed with a simple divisor. The numerator value actually + * includes the 16x over-sampling (so a value of 16 means divide by 1); + * the register value is the numerator-1, so we have a hard-coded 15. + * Note that a quirk of the hardware requires that both UBIR and UBMR be + * set back to back in order for the change to take effect. */ if (baudrate > 0) { baseclk = imx_ccm_uart_hz(); From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 20:27:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7BFFF118; Sat, 26 Apr 2014 20:27:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6650C1212; Sat, 26 Apr 2014 20:27:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QKRvBg031827; Sat, 26 Apr 2014 20:27:57 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QKRsTu031813; Sat, 26 Apr 2014 20:27:54 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201404262027.s3QKRsTu031813@svn.freebsd.org> From: Scott Long Date: Sat, 26 Apr 2014 20:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264984 - in head/sys: amd64/amd64 arm/arm i386/i386 i386/xen ia64/ia64 kern mips/mips powerpc/powerpc sparc64/sparc64 sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 20:27:57 -0000 Author: scottl Date: Sat Apr 26 20:27:54 2014 New Revision: 264984 URL: http://svnweb.freebsd.org/changeset/base/264984 Log: Retire smp_active. It was racey and caused demonstrated problems with the cpufreq code. Replace its use with smp_started. There's at least one userland tool that still looks at the kern.smp.active sysctl, so preserve it but point it to smp_started as well. Discussed with: peter, jhb MFC after: 3 days Obtained from: Netflix Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/vm_machdep.c head/sys/arm/arm/mp_machdep.c head/sys/i386/i386/mp_machdep.c head/sys/i386/i386/vm_machdep.c head/sys/i386/xen/mp_machdep.c head/sys/ia64/ia64/mp_machdep.c head/sys/kern/kern_cpu.c head/sys/kern/subr_smp.c head/sys/mips/mips/mp_machdep.c head/sys/powerpc/powerpc/mp_machdep.c head/sys/sparc64/sparc64/mp_machdep.c head/sys/sys/smp.h Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Sat Apr 26 20:03:04 2014 (r264983) +++ head/sys/amd64/amd64/mp_machdep.c Sat Apr 26 20:27:54 2014 (r264984) @@ -771,7 +771,6 @@ init_secondary(void) if (smp_cpus == mp_ncpus) { /* enable IPI's, tlb shootdown, freezes etc */ atomic_store_rel_int(&smp_started, 1); - smp_active = 1; /* historic */ } /* Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Sat Apr 26 20:03:04 2014 (r264983) +++ head/sys/amd64/amd64/vm_machdep.c Sat Apr 26 20:27:54 2014 (r264984) @@ -597,7 +597,7 @@ cpu_reset() cpuset_t map; u_int cnt; - if (smp_active) { + if (smp_started) { map = all_cpus; CPU_CLR(PCPU_GET(cpuid), &map); CPU_NAND(&map, &stopped_cpus); Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Sat Apr 26 20:03:04 2014 (r264983) +++ head/sys/arm/arm/mp_machdep.c Sat Apr 26 20:27:54 2014 (r264984) @@ -219,7 +219,6 @@ init_secondary(int cpu) if (smp_cpus == mp_ncpus) { /* enable IPI's, tlb shootdown, freezes etc */ atomic_store_rel_int(&smp_started, 1); - smp_active = 1; } mtx_unlock_spin(&ap_boot_mtx); Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Sat Apr 26 20:03:04 2014 (r264983) +++ head/sys/i386/i386/mp_machdep.c Sat Apr 26 20:27:54 2014 (r264984) @@ -805,7 +805,6 @@ init_secondary(void) if (smp_cpus == mp_ncpus) { /* enable IPI's, tlb shootdown, freezes etc */ atomic_store_rel_int(&smp_started, 1); - smp_active = 1; /* historic */ } mtx_unlock_spin(&ap_boot_mtx); Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Sat Apr 26 20:03:04 2014 (r264983) +++ head/sys/i386/i386/vm_machdep.c Sat Apr 26 20:27:54 2014 (r264984) @@ -619,7 +619,7 @@ cpu_reset() cpuset_t map; u_int cnt; - if (smp_active) { + if (smp_started) { map = all_cpus; CPU_CLR(PCPU_GET(cpuid), &map); CPU_NAND(&map, &stopped_cpus); Modified: head/sys/i386/xen/mp_machdep.c ============================================================================== --- head/sys/i386/xen/mp_machdep.c Sat Apr 26 20:03:04 2014 (r264983) +++ head/sys/i386/xen/mp_machdep.c Sat Apr 26 20:27:54 2014 (r264984) @@ -655,7 +655,6 @@ init_secondary(void) if (smp_cpus == mp_ncpus) { /* enable IPI's, tlb shootdown, freezes etc */ atomic_store_rel_int(&smp_started, 1); - smp_active = 1; /* historic */ } mtx_unlock_spin(&ap_boot_mtx); Modified: head/sys/ia64/ia64/mp_machdep.c ============================================================================== --- head/sys/ia64/ia64/mp_machdep.c Sat Apr 26 20:03:04 2014 (r264983) +++ head/sys/ia64/ia64/mp_machdep.c Sat Apr 26 20:27:54 2014 (r264984) @@ -475,7 +475,7 @@ cpu_mp_unleash(void *dummy) mp_ncpus, cpus, smp_cpus); } - smp_active = 1; + /* XXX Atomic set operation? */ smp_started = 1; /* Modified: head/sys/kern/kern_cpu.c ============================================================================== --- head/sys/kern/kern_cpu.c Sat Apr 26 20:03:04 2014 (r264983) +++ head/sys/kern/kern_cpu.c Sat Apr 26 20:27:54 2014 (r264984) @@ -268,7 +268,7 @@ cf_set_method(device_t dev, const struct * switching the main CPU. XXXTODO: Need to think more about how to * handle having different CPUs at different frequencies. */ - if (mp_ncpus > 1 && !smp_active) { + if (mp_ncpus > 1 && !smp_started) { device_printf(dev, "rejecting change, SMP not started yet\n"); error = ENXIO; goto out; Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Sat Apr 26 20:03:04 2014 (r264983) +++ head/sys/kern/subr_smp.c Sat Apr 26 20:27:54 2014 (r264984) @@ -59,6 +59,9 @@ cpuset_t logical_cpus_mask; void (*cpustop_restartfunc)(void); #endif + +static int sysctl_kern_smp_active(SYSCTL_HANDLER_ARGS); + /* This is used in modules that need to work in both SMP and UP. */ cpuset_t all_cpus; @@ -78,9 +81,8 @@ SYSCTL_INT(_kern_smp, OID_AUTO, maxid, C SYSCTL_INT(_kern_smp, OID_AUTO, maxcpus, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_maxcpus, 0, "Max number of CPUs that the system was compiled for."); -int smp_active = 0; /* are the APs allowed to run? */ -SYSCTL_INT(_kern_smp, OID_AUTO, active, CTLFLAG_RW, &smp_active, 0, - "Number of Auxillary Processors (APs) that were successfully started"); +SYSCTL_PROC(_kern_smp, OID_AUTO, active, CTLFLAG_RD | CTLTYPE_INT, NULL, 0, + sysctl_kern_smp_active, "I", "Indicates system is running in SMP mode"); int smp_disabled = 0; /* has smp been disabled? */ SYSCTL_INT(_kern_smp, OID_AUTO, disabled, CTLFLAG_RDTUN|CTLFLAG_CAPRD, @@ -831,3 +833,15 @@ quiesce_all_cpus(const char *wmesg, int return quiesce_cpus(all_cpus, wmesg, prio); } + +/* Extra care is taken with this sysctl because the data type is volatile */ +static int +sysctl_kern_smp_active(SYSCTL_HANDLER_ARGS) +{ + int error, active; + + active = smp_started; + error = SYSCTL_OUT(req, &active, sizeof(active)); + return (error); +} + Modified: head/sys/mips/mips/mp_machdep.c ============================================================================== --- head/sys/mips/mips/mp_machdep.c Sat Apr 26 20:03:04 2014 (r264983) +++ head/sys/mips/mips/mp_machdep.c Sat Apr 26 20:27:54 2014 (r264984) @@ -317,7 +317,6 @@ smp_init_secondary(u_int32_t cpuid) if (smp_cpus == mp_ncpus) { atomic_store_rel_int(&smp_started, 1); - smp_active = 1; } mtx_unlock_spin(&ap_boot_mtx); Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Sat Apr 26 20:03:04 2014 (r264983) +++ head/sys/powerpc/powerpc/mp_machdep.c Sat Apr 26 20:27:54 2014 (r264984) @@ -267,7 +267,7 @@ cpu_mp_unleash(void *dummy) /* Let the APs get into the scheduler */ DELAY(10000); - smp_active = 1; + /* XXX Atomic set operation? */ smp_started = 1; } Modified: head/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/mp_machdep.c Sat Apr 26 20:03:04 2014 (r264983) +++ head/sys/sparc64/sparc64/mp_machdep.c Sat Apr 26 20:27:54 2014 (r264984) @@ -291,7 +291,6 @@ cpu_mp_start(void) KASSERT(!isjbus || mp_ncpus <= IDR_JALAPENO_MAX_BN_PAIRS, ("%s: can only IPI a maximum of %d JBus-CPUs", __func__, IDR_JALAPENO_MAX_BN_PAIRS)); - smp_active = 1; } static void Modified: head/sys/sys/smp.h ============================================================================== --- head/sys/sys/smp.h Sat Apr 26 20:03:04 2014 (r264983) +++ head/sys/sys/smp.h Sat Apr 26 20:27:54 2014 (r264984) @@ -71,7 +71,6 @@ struct cpu_group *smp_topo_2level(int l2 struct cpu_group *smp_topo_find(struct cpu_group *top, int cpu); extern void (*cpustop_restartfunc)(void); -extern int smp_active; extern int smp_cpus; extern volatile cpuset_t started_cpus; extern volatile cpuset_t stopped_cpus; @@ -141,7 +140,7 @@ cpu_next(int i) * cpu_mp_start() will be called so that MP can be enabled. This function * should do things such as startup secondary processors. It should also * setup mp_ncpus, all_cpus, and smp_cpus. It should also ensure that - * smp_active and smp_started are initialized at the appropriate time. + * smp_started is initialized at the appropriate time. * Once cpu_mp_start() returns, machine independent MP startup code will be * executed and a simple message will be output to the console. Finally, * cpu_mp_announce() will be called so that machine dependent messages about From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 21:03:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C357C6F; Sat, 26 Apr 2014 21:03:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B3C51554; Sat, 26 Apr 2014 21:03:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QL3g31048247; Sat, 26 Apr 2014 21:03:42 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QL3fAX048245; Sat, 26 Apr 2014 21:03:41 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201404262103.s3QL3fAX048245@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 26 Apr 2014 21:03:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264986 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 21:03:42 -0000 Author: melifaro Date: Sat Apr 26 21:03:41 2014 New Revision: 264986 URL: http://svnweb.freebsd.org/changeset/base/264986 Log: Decouple RTM_CHANGE from RTM_GET handling in rtsock.c:route_output(). RTM_CHANGE is now handled inside route.c:rtrequest1_fib() as it should be. Note change change handler is a separate function rtrequest1_fib_change(). MFC after: 1 month Modified: head/sys/net/route.c head/sys/net/rtsock.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat Apr 26 20:27:58 2014 (r264985) +++ head/sys/net/route.c Sat Apr 26 21:03:41 2014 (r264986) @@ -140,6 +140,9 @@ VNET_DEFINE(int, rttrash); /* routes no static VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */ #define V_rtzone VNET(rtzone) +static int rtrequest1_fib_change(struct radix_node_head *, struct rt_addrinfo *, + struct rtentry **, u_int); + /* * handler for net.my_fibnum */ @@ -1408,6 +1411,9 @@ rtrequest1_fib(int req, struct rt_addrin } RT_UNLOCK(rt); break; + case RTM_CHANGE: + error = rtrequest1_fib_change(rnh, info, ret_nrt, fibnum); + break; default: error = EOPNOTSUPP; } @@ -1425,6 +1431,95 @@ bad: #undef ifpaddr #undef flags +#define senderr(e) { error = e; goto bad; } +static int +rtrequest1_fib_change(struct radix_node_head *rnh, struct rt_addrinfo *info, + struct rtentry **ret_nrt, u_int fibnum) +{ + struct rtentry *rt = NULL; + int error = 0; + int free_ifa = 0; + + rt = (struct rtentry *)rnh->rnh_lookup(info->rti_info[RTAX_DST], + info->rti_info[RTAX_NETMASK], rnh); + + if (rt == NULL) + return (ESRCH); + +#ifdef RADIX_MPATH + /* + * If we got multipath routes, + * we require users to specify a matching RTAX_GATEWAY. + */ + if (rn_mpath_capable(rnh)) { + rt = rt_mpath_matchgate(rt, info->rti_info[RTAX_GATEWAY]); + if (rt == NULL) + return (ESRCH); + } +#endif + + RT_LOCK(rt); + + /* + * New gateway could require new ifaddr, ifp; + * flags may also be different; ifp may be specified + * by ll sockaddr when protocol address is ambiguous + */ + if (((rt->rt_flags & RTF_GATEWAY) && + info->rti_info[RTAX_GATEWAY] != NULL) || + info->rti_info[RTAX_IFP] != NULL || + (info->rti_info[RTAX_IFA] != NULL && + !sa_equal(info->rti_info[RTAX_IFA], rt->rt_ifa->ifa_addr))) { + + error = rt_getifa_fib(info, fibnum); + if (info->rti_ifa != NULL) + free_ifa = 1; + + if (error != 0) + senderr(error); + } + + /* Check if outgoing interface has changed */ + if (info->rti_ifa != NULL && info->rti_ifa != rt->rt_ifa && + rt->rt_ifa != NULL && rt->rt_ifa->ifa_rtrequest != NULL) { + rt->rt_ifa->ifa_rtrequest(RTM_DELETE, rt, info); + ifa_free(rt->rt_ifa); + } + /* Update gateway address */ + if (info->rti_info[RTAX_GATEWAY] != NULL) { + error = rt_setgate(rt, rt_key(rt), info->rti_info[RTAX_GATEWAY]); + if (error != 0) + senderr(error); + + rt->rt_flags &= ~RTF_GATEWAY; + rt->rt_flags |= (RTF_GATEWAY & info->rti_flags); + } + + if (info->rti_ifa != NULL && info->rti_ifa != rt->rt_ifa) { + ifa_ref(info->rti_ifa); + rt->rt_ifa = info->rti_ifa; + rt->rt_ifp = info->rti_ifp; + } + /* Allow some flags to be toggled on change. */ + rt->rt_flags &= ~RTF_FMASK; + rt->rt_flags |= info->rti_flags & RTF_FMASK; + + if (rt->rt_ifa && rt->rt_ifa->ifa_rtrequest != NULL) + rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, info); + + if (ret_nrt) { + *ret_nrt = rt; + RT_ADDREF(rt); + } +bad: + RT_UNLOCK(rt); + if (free_ifa != 0) + ifa_free(info->rti_ifa); + return (error); +} +#undef senderr + + int rt_setgate(struct rtentry *rt, struct sockaddr *dst, struct sockaddr *gate) { Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sat Apr 26 20:27:58 2014 (r264985) +++ head/sys/net/rtsock.c Sat Apr 26 21:03:41 2014 (r264986) @@ -621,6 +621,7 @@ route_output(struct mbuf *m, struct sock struct rtentry *saved_nrt; case RTM_ADD: + case RTM_CHANGE: if (info.rti_info[RTAX_GATEWAY] == NULL) senderr(EINVAL); saved_nrt = NULL; @@ -635,9 +636,9 @@ route_output(struct mbuf *m, struct sock #endif break; } - error = rtrequest1_fib(RTM_ADD, &info, &saved_nrt, + error = rtrequest1_fib(rtm->rtm_type, &info, &saved_nrt, so->so_fibnum); - if (error == 0 && saved_nrt) { + if (error == 0 && saved_nrt != NULL) { #ifdef INET6 rti_need_deembed = (V_deembed_scopeid) ? 1 : 0; #endif @@ -676,8 +677,6 @@ route_output(struct mbuf *m, struct sock break; case RTM_GET: - case RTM_CHANGE: - case RTM_LOCK: rnh = rt_tables_get_rnh(so->so_fibnum, info.rti_info[RTAX_DST]->sa_family); if (rnh == NULL) @@ -757,133 +756,61 @@ route_output(struct mbuf *m, struct sock RT_ADDREF(rt); RADIX_NODE_HEAD_RUNLOCK(rnh); - switch(rtm->rtm_type) { - - case RTM_GET: - report: - RT_LOCK_ASSERT(rt); - if ((rt->rt_flags & RTF_HOST) == 0 - ? jailed_without_vnet(curthread->td_ucred) - : prison_if(curthread->td_ucred, - rt_key(rt)) != 0) { - RT_UNLOCK(rt); - senderr(ESRCH); - } - info.rti_info[RTAX_DST] = rt_key(rt); - info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; - info.rti_info[RTAX_NETMASK] = rt_mask(rt); - info.rti_info[RTAX_GENMASK] = 0; - if (rtm->rtm_addrs & (RTA_IFP | RTA_IFA)) { - ifp = rt->rt_ifp; - if (ifp) { - info.rti_info[RTAX_IFP] = - ifp->if_addr->ifa_addr; - error = rtm_get_jailed(&info, ifp, rt, - &saun, curthread->td_ucred); - if (error != 0) { - RT_UNLOCK(rt); - senderr(error); - } - if (ifp->if_flags & IFF_POINTOPOINT) - info.rti_info[RTAX_BRD] = - rt->rt_ifa->ifa_dstaddr; - rtm->rtm_index = ifp->if_index; - } else { - info.rti_info[RTAX_IFP] = NULL; - info.rti_info[RTAX_IFA] = NULL; - } - } else if ((ifp = rt->rt_ifp) != NULL) { - rtm->rtm_index = ifp->if_index; - } - len = rt_msg2(rtm->rtm_type, &info, NULL, NULL); - if (len > rtm->rtm_msglen) { - struct rt_msghdr *new_rtm; - R_Malloc(new_rtm, struct rt_msghdr *, len); - if (new_rtm == NULL) { - RT_UNLOCK(rt); - senderr(ENOBUFS); - } - bcopy(rtm, new_rtm, rtm->rtm_msglen); - Free(rtm); rtm = new_rtm; - } - (void)rt_msg2(rtm->rtm_type, &info, (caddr_t)rtm, NULL); - if (rt->rt_flags & RTF_GWFLAG_COMPAT) - rtm->rtm_flags = RTF_GATEWAY | - (rt->rt_flags & ~RTF_GWFLAG_COMPAT); - else - rtm->rtm_flags = rt->rt_flags; - rt_getmetrics(rt, &rtm->rtm_rmx); - rtm->rtm_addrs = info.rti_addrs; - break; - - case RTM_CHANGE: - /* - * New gateway could require new ifaddr, ifp; - * flags may also be different; ifp may be specified - * by ll sockaddr when protocol address is ambiguous - */ - if (((rt->rt_flags & RTF_GATEWAY) && - info.rti_info[RTAX_GATEWAY] != NULL) || - info.rti_info[RTAX_IFP] != NULL || - (info.rti_info[RTAX_IFA] != NULL && - !sa_equal(info.rti_info[RTAX_IFA], - rt->rt_ifa->ifa_addr))) { - RT_UNLOCK(rt); - RADIX_NODE_HEAD_LOCK(rnh); - error = rt_getifa_fib(&info, rt->rt_fibnum); - /* - * XXXRW: Really we should release this - * reference later, but this maintains - * historical behavior. - */ - if (info.rti_ifa != NULL) - ifa_free(info.rti_ifa); - RADIX_NODE_HEAD_UNLOCK(rnh); - if (error != 0) - senderr(error); - RT_LOCK(rt); - } - if (info.rti_ifa != NULL && - info.rti_ifa != rt->rt_ifa && - rt->rt_ifa != NULL && - rt->rt_ifa->ifa_rtrequest != NULL) { - rt->rt_ifa->ifa_rtrequest(RTM_DELETE, rt, - &info); - ifa_free(rt->rt_ifa); - } - if (info.rti_info[RTAX_GATEWAY] != NULL) { - RT_UNLOCK(rt); - RADIX_NODE_HEAD_LOCK(rnh); - RT_LOCK(rt); - - error = rt_setgate(rt, rt_key(rt), - info.rti_info[RTAX_GATEWAY]); - RADIX_NODE_HEAD_UNLOCK(rnh); +report: + RT_LOCK_ASSERT(rt); + if ((rt->rt_flags & RTF_HOST) == 0 + ? jailed_without_vnet(curthread->td_ucred) + : prison_if(curthread->td_ucred, + rt_key(rt)) != 0) { + RT_UNLOCK(rt); + senderr(ESRCH); + } + info.rti_info[RTAX_DST] = rt_key(rt); + info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; + info.rti_info[RTAX_NETMASK] = rt_mask(rt); + info.rti_info[RTAX_GENMASK] = 0; + if (rtm->rtm_addrs & (RTA_IFP | RTA_IFA)) { + ifp = rt->rt_ifp; + if (ifp) { + info.rti_info[RTAX_IFP] = + ifp->if_addr->ifa_addr; + error = rtm_get_jailed(&info, ifp, rt, + &saun, curthread->td_ucred); if (error != 0) { RT_UNLOCK(rt); senderr(error); } - rt->rt_flags &= ~RTF_GATEWAY; - rt->rt_flags |= (RTF_GATEWAY & info.rti_flags); + if (ifp->if_flags & IFF_POINTOPOINT) + info.rti_info[RTAX_BRD] = + rt->rt_ifa->ifa_dstaddr; + rtm->rtm_index = ifp->if_index; + } else { + info.rti_info[RTAX_IFP] = NULL; + info.rti_info[RTAX_IFA] = NULL; } - if (info.rti_ifa != NULL && - info.rti_ifa != rt->rt_ifa) { - ifa_ref(info.rti_ifa); - rt->rt_ifa = info.rti_ifa; - rt->rt_ifp = info.rti_ifp; + } else if ((ifp = rt->rt_ifp) != NULL) { + rtm->rtm_index = ifp->if_index; + } + len = rt_msg2(rtm->rtm_type, &info, NULL, NULL); + if (len > rtm->rtm_msglen) { + struct rt_msghdr *new_rtm; + R_Malloc(new_rtm, struct rt_msghdr *, len); + if (new_rtm == NULL) { + RT_UNLOCK(rt); + senderr(ENOBUFS); } - /* Allow some flags to be toggled on change. */ - rt->rt_flags = (rt->rt_flags & ~RTF_FMASK) | - (rtm->rtm_flags & RTF_FMASK); - rt_setmetrics(rtm, rt); - rtm->rtm_index = rt->rt_ifp->if_index; - if (rt->rt_ifa && rt->rt_ifa->ifa_rtrequest) - rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, &info); - /* FALLTHROUGH */ - case RTM_LOCK: - /* We don't support locks anymore */ - break; + bcopy(rtm, new_rtm, rtm->rtm_msglen); + Free(rtm); rtm = new_rtm; } + (void)rt_msg2(rtm->rtm_type, &info, (caddr_t)rtm, NULL); + if (rt->rt_flags & RTF_GWFLAG_COMPAT) + rtm->rtm_flags = RTF_GATEWAY | + (rt->rt_flags & ~RTF_GWFLAG_COMPAT); + else + rtm->rtm_flags = rt->rt_flags; + rt_getmetrics(rt, &rtm->rtm_rmx); + rtm->rtm_addrs = info.rti_addrs; + RT_UNLOCK(rt); break; From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 22:32:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF510EB; Sat, 26 Apr 2014 22:32:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9197B1C22; Sat, 26 Apr 2014 22:32:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QMW4su085572; Sat, 26 Apr 2014 22:32:04 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QMW4pe085571; Sat, 26 Apr 2014 22:32:04 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201404262232.s3QMW4pe085571@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 26 Apr 2014 22:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264987 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 22:32:04 -0000 Author: melifaro Date: Sat Apr 26 22:32:04 2014 New Revision: 264987 URL: http://svnweb.freebsd.org/changeset/base/264987 Log: Determine fibnum once in the beginning of route_output(). MFC after: 1 month Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sat Apr 26 21:03:41 2014 (r264986) +++ head/sys/net/rtsock.c Sat Apr 26 22:32:04 2014 (r264987) @@ -526,7 +526,7 @@ route_output(struct mbuf *m, struct sock struct sockaddr_in6 *sin6; int i, rti_need_deembed = 0; #endif - int len, error = 0; + int len, error = 0, fibnum; struct ifnet *ifp = NULL; union sockaddr_union saun; sa_family_t saf = AF_UNSPEC; @@ -582,6 +582,8 @@ route_output(struct mbuf *m, struct sock senderr(error); } + fibnum = so->so_fibnum; + /* * The given gateway address may be an interface address. * For example, issuing a "route change" command on a route @@ -596,7 +598,7 @@ route_output(struct mbuf *m, struct sock bzero(&gw_ro, sizeof(gw_ro)); gw_ro.ro_dst = *info.rti_info[RTAX_GATEWAY]; - rtalloc_ign_fib(&gw_ro, 0, so->so_fibnum); + rtalloc_ign_fib(&gw_ro, 0, fibnum); /* * A host route through the loopback interface is * installed for each interface adddress. In pre 8.0 @@ -637,7 +639,7 @@ route_output(struct mbuf *m, struct sock break; } error = rtrequest1_fib(rtm->rtm_type, &info, &saved_nrt, - so->so_fibnum); + fibnum); if (error == 0 && saved_nrt != NULL) { #ifdef INET6 rti_need_deembed = (V_deembed_scopeid) ? 1 : 0; @@ -663,8 +665,7 @@ route_output(struct mbuf *m, struct sock #endif break; } - error = rtrequest1_fib(RTM_DELETE, &info, &saved_nrt, - so->so_fibnum); + error = rtrequest1_fib(RTM_DELETE, &info, &saved_nrt, fibnum); if (error == 0) { RT_LOCK(saved_nrt); rt = saved_nrt; @@ -677,8 +678,7 @@ route_output(struct mbuf *m, struct sock break; case RTM_GET: - rnh = rt_tables_get_rnh(so->so_fibnum, - info.rti_info[RTAX_DST]->sa_family); + rnh = rt_tables_get_rnh(fibnum, saf); if (rnh == NULL) senderr(EAFNOSUPPORT); @@ -867,7 +867,7 @@ flush: m_adj(m, rtm->rtm_msglen - m->m_pkthdr.len); } if (m) { - M_SETFIB(m, so->so_fibnum); + M_SETFIB(m, fibnum); m->m_flags |= RTS_FILTER_FIB; if (rp) { /* From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 22:37:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59BA0296; Sat, 26 Apr 2014 22:37:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 466F51C49; Sat, 26 Apr 2014 22:37:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QMbvtu086234; Sat, 26 Apr 2014 22:37:57 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QMbvup086233; Sat, 26 Apr 2014 22:37:57 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201404262237.s3QMbvup086233@svn.freebsd.org> From: Neel Natu Date: Sat, 26 Apr 2014 22:37:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264988 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 22:37:57 -0000 Author: neel Date: Sat Apr 26 22:37:56 2014 New Revision: 264988 URL: http://svnweb.freebsd.org/changeset/base/264988 Log: A VMCS is always inactive when it exits the vmx_run() loop. Remove redundant code and the misleading comment that suggest otherwise. Reviewed by: grehan@ Modified: head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sat Apr 26 22:32:04 2014 (r264987) +++ head/sys/amd64/vmm/intel/vmx.c Sat Apr 26 22:37:56 2014 (r264988) @@ -2234,7 +2234,7 @@ vmx_run(void *arg, int vcpu, register_t static void vmx_vmcleanup(void *arg) { - int i, error; + int i; struct vmx *vmx = arg; if (apic_access_virtualization(vmx, 0)) @@ -2243,13 +2243,6 @@ vmx_vmcleanup(void *arg) for (i = 0; i < VM_MAXCPU; i++) vpid_free(vmx->state[i].vpid); - /* - * XXXSMP we also need to clear the VMCS active on the other vcpus. - */ - error = vmclear(&vmx->vmcs[0]); - if (error != 0) - panic("vmx_vmcleanup: vmclear error %d on vcpu 0", error); - free(vmx, M_VMX); return; From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 22:42:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75D373EF; Sat, 26 Apr 2014 22:42:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 628031CCE; Sat, 26 Apr 2014 22:42:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QMgMnS089675; Sat, 26 Apr 2014 22:42:22 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QMgMts089674; Sat, 26 Apr 2014 22:42:22 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201404262242.s3QMgMts089674@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 26 Apr 2014 22:42:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264989 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 22:42:22 -0000 Author: melifaro Date: Sat Apr 26 22:42:21 2014 New Revision: 264989 URL: http://svnweb.freebsd.org/changeset/base/264989 Log: Remove useless `register' declarations. MFC after: 1 month Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat Apr 26 22:37:56 2014 (r264988) +++ head/sys/net/route.c Sat Apr 26 22:42:21 2014 (r264989) @@ -725,7 +725,7 @@ struct ifaddr * ifa_ifwithroute_fib(int flags, struct sockaddr *dst, struct sockaddr *gateway, u_int fibnum) { - register struct ifaddr *ifa; + struct ifaddr *ifa; int not_found = 0; if ((flags & RTF_GATEWAY) == 0) { @@ -1041,7 +1041,7 @@ rn_mpath_update(int req, struct rt_addri * a matching RTAX_GATEWAY. */ struct rtentry *rt, *rto = NULL; - register struct radix_node *rn; + struct radix_node *rn; int error = 0; rn = rnh->rnh_lookup(dst, netmask, rnh); @@ -1143,12 +1143,12 @@ rtrequest1_fib(int req, struct rt_addrin u_int fibnum) { int error = 0, needlock = 0; - register struct rtentry *rt; + struct rtentry *rt; #ifdef FLOWTABLE - register struct rtentry *rt0; + struct rtentry *rt0; #endif - register struct radix_node *rn; - register struct radix_node_head *rnh; + struct radix_node *rn; + struct radix_node_head *rnh; struct ifaddr *ifa; struct sockaddr *ndst; struct sockaddr_storage mdst; @@ -1571,9 +1571,9 @@ rt_setgate(struct rtentry *rt, struct so void rt_maskedcopy(struct sockaddr *src, struct sockaddr *dst, struct sockaddr *netmask) { - register u_char *cp1 = (u_char *)src; - register u_char *cp2 = (u_char *)dst; - register u_char *cp3 = (u_char *)netmask; + u_char *cp1 = (u_char *)src; + u_char *cp2 = (u_char *)dst; + u_char *cp3 = (u_char *)netmask; u_char *cplim = cp2 + *cp3; u_char *cplim2 = cp2 + *cp1; From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 23:09:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36633719; Sat, 26 Apr 2014 23:09:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 226AA1FA2; Sat, 26 Apr 2014 23:09:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QN917i098529; Sat, 26 Apr 2014 23:09:01 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QN91w8098528; Sat, 26 Apr 2014 23:09:01 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404262309.s3QN91w8098528@svn.freebsd.org> From: Ian Lepore Date: Sat, 26 Apr 2014 23:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264990 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 23:09:02 -0000 Author: ian Date: Sat Apr 26 23:09:01 2014 New Revision: 264990 URL: http://svnweb.freebsd.org/changeset/base/264990 Log: Call cpu_icache_sync_range() rather than sync_all since we know the range and flushing the entire icache is needlessly expensive. Modified: head/sys/arm/include/kdb.h Modified: head/sys/arm/include/kdb.h ============================================================================== --- head/sys/arm/include/kdb.h Sat Apr 26 22:42:21 2014 (r264989) +++ head/sys/arm/include/kdb.h Sat Apr 26 23:09:01 2014 (r264990) @@ -49,7 +49,7 @@ static __inline void kdb_cpu_sync_icache(unsigned char *addr, size_t size) { - cpu_icache_sync_all(); + cpu_icache_sync_range((vm_offset_t)addr, size); } static __inline void From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 23:16:23 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43C528E2; Sat, 26 Apr 2014 23:16:23 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 135E9106B; Sat, 26 Apr 2014 23:16:22 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WeBpV-000Kod-C6; Sat, 26 Apr 2014 23:16:21 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s3QNGJSl013156; Sat, 26 Apr 2014 17:16:19 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19AbvFZyHNJHPi03mL2Vls4 Subject: Re: svn commit: r264987 - head/sys/net From: Ian Lepore To: "Alexander V. Chernikov" In-Reply-To: <201404262232.s3QMW4pe085571@svn.freebsd.org> References: <201404262232.s3QMW4pe085571@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Sat, 26 Apr 2014 17:16:18 -0600 Message-ID: <1398554178.61646.149.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 23:16:23 -0000 On Sat, 2014-04-26 at 22:32 +0000, Alexander V. Chernikov wrote: > Author: melifaro > Date: Sat Apr 26 22:32:04 2014 > New Revision: 264987 > URL: http://svnweb.freebsd.org/changeset/base/264987 > > Log: > Determine fibnum once in the beginning of route_output(). > > MFC after: 1 month > > Modified: > head/sys/net/rtsock.c > Modified: head/sys/net/rtsock.c > ============================================================================== > --- head/sys/net/rtsock.c Sat Apr 26 21:03:41 2014 (r264986) > +++ head/sys/net/rtsock.c Sat Apr 26 22:32:04 2014 (r264987) > @@ -526,7 +526,7 @@ route_output(struct mbuf *m, struct sock > struct sockaddr_in6 *sin6; > int i, rti_need_deembed = 0; > #endif > - int len, error = 0; > + int len, error = 0, fibnum; > struct ifnet *ifp = NULL; > union sockaddr_union saun; > sa_family_t saf = AF_UNSPEC; > @@ -582,6 +582,8 @@ route_output(struct mbuf *m, struct sock > senderr(error); > } > > + fibnum = so->so_fibnum; > + > /* > * The given gateway address may be an interface address. > * For example, issuing a "route change" command on a route > @@ -596,7 +598,7 @@ route_output(struct mbuf *m, struct sock > > bzero(&gw_ro, sizeof(gw_ro)); > gw_ro.ro_dst = *info.rti_info[RTAX_GATEWAY]; > - rtalloc_ign_fib(&gw_ro, 0, so->so_fibnum); > + rtalloc_ign_fib(&gw_ro, 0, fibnum); > /* > * A host route through the loopback interface is > * installed for each interface adddress. In pre 8.0 > @@ -637,7 +639,7 @@ route_output(struct mbuf *m, struct sock > break; > } > error = rtrequest1_fib(rtm->rtm_type, &info, &saved_nrt, > - so->so_fibnum); > + fibnum); > if (error == 0 && saved_nrt != NULL) { > #ifdef INET6 > rti_need_deembed = (V_deembed_scopeid) ? 1 : 0; > @@ -663,8 +665,7 @@ route_output(struct mbuf *m, struct sock > #endif > break; > } > - error = rtrequest1_fib(RTM_DELETE, &info, &saved_nrt, > - so->so_fibnum); > + error = rtrequest1_fib(RTM_DELETE, &info, &saved_nrt, fibnum); > if (error == 0) { > RT_LOCK(saved_nrt); > rt = saved_nrt; > @@ -677,8 +678,7 @@ route_output(struct mbuf *m, struct sock > break; > > case RTM_GET: > - rnh = rt_tables_get_rnh(so->so_fibnum, > - info.rti_info[RTAX_DST]->sa_family); > + rnh = rt_tables_get_rnh(fibnum, saf); > if (rnh == NULL) > senderr(EAFNOSUPPORT); > > @@ -867,7 +867,7 @@ flush: > m_adj(m, rtm->rtm_msglen - m->m_pkthdr.len); > } > if (m) { > - M_SETFIB(m, so->so_fibnum); > + M_SETFIB(m, fibnum); > m->m_flags |= RTS_FILTER_FIB; > if (rp) { > /* > I've got build breakage that I think may be from this change... /local/build/staging/freebsd/head/src/sys/net/rtsock.c: In function 'route_output': /local/build/staging/freebsd/head/src/sys/net/rtsock.c:529: warning: 'fibnum' may be used uninitialized in this function -- Ian From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 23:22:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58236A61; Sat, 26 Apr 2014 23:22:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44A6A1113; Sat, 26 Apr 2014 23:22:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QNMoIP006088; Sat, 26 Apr 2014 23:22:50 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3QNMo6x006087; Sat, 26 Apr 2014 23:22:50 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404262322.s3QNMo6x006087@svn.freebsd.org> From: Ian Lepore Date: Sat, 26 Apr 2014 23:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264991 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 23:22:50 -0000 Author: ian Date: Sat Apr 26 23:22:49 2014 New Revision: 264991 URL: http://svnweb.freebsd.org/changeset/base/264991 Log: Use logical rather than bitwise OR in if() expression. Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Sat Apr 26 23:09:01 2014 (r264990) +++ head/sys/net80211/ieee80211_ioctl.c Sat Apr 26 23:22:49 2014 (r264991) @@ -602,7 +602,7 @@ ieee80211_ioctl_getcurchan(struct ieee80 * in use. When in RUN state report the vap-specific channel. * Otherwise return curchan. */ - if (vap->iv_state == IEEE80211_S_RUN | vap->iv_state == IEEE80211_S_SLEEP) + if (vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP) c = vap->iv_bss->ni_chan; else c = ic->ic_curchan; From owner-svn-src-head@FreeBSD.ORG Sat Apr 26 23:39:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4DCEE187; Sat, 26 Apr 2014 23:39:43 +0000 (UTC) Received: from mail-qc0-x22c.google.com (mail-qc0-x22c.google.com [IPv6:2607:f8b0:400d:c01::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF394120C; Sat, 26 Apr 2014 23:39:42 +0000 (UTC) Received: by mail-qc0-f172.google.com with SMTP id i8so5583108qcq.31 for ; Sat, 26 Apr 2014 16:39:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=OMPszRFLS+8OepZQl42bxBzjtp1QuVtJvD8tUMi3eyI=; b=ZIGevl0LY29TONTg5qgfBxj2TQNjyVkSKBACWhkibLoUvWj6d2HAylOx6YKS3f0HMB lscjBxllaSU/dKxxpZ8hDxRIvsuWyFGPaEck6fD7+dFGkP8BMX8m3BNG2ehno0bPkm+W 3GgW+4f+gB787lZEY58XZCnYwo8xA0cVD7mYeii7ZVmkgs6aO6VhzBn3uFnE+aC/ELrH 4eB2tbUWYJX0yymkaRjr0xqW5JSpDJJt9iSU70Gxjwt/3n4RlfQR3F/EzSrf0TMUunXL jDOMuM7VZ/vYTeM7irmSHaht4MmGzzdY31v93XsBVHEz9LVLsLol5GhZ0sjfWDDk8dxc DgAg== MIME-Version: 1.0 X-Received: by 10.224.88.201 with SMTP id b9mr138952qam.95.1398555582007; Sat, 26 Apr 2014 16:39:42 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.191.201 with HTTP; Sat, 26 Apr 2014 16:39:41 -0700 (PDT) In-Reply-To: <201404262322.s3QNMo6x006087@svn.freebsd.org> References: <201404262322.s3QNMo6x006087@svn.freebsd.org> Date: Sat, 26 Apr 2014 16:39:41 -0700 X-Google-Sender-Auth: RfWSPwoF6p_ISAFyDpYH6ViEVGs Message-ID: Subject: Re: svn commit: r264991 - head/sys/net80211 From: Adrian Chadd To: Ian Lepore Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 23:39:43 -0000 oops! -a On 26 April 2014 16:22, Ian Lepore wrote: > Author: ian > Date: Sat Apr 26 23:22:49 2014 > New Revision: 264991 > URL: http://svnweb.freebsd.org/changeset/base/264991 > > Log: > Use logical rather than bitwise OR in if() expression. > > Modified: > head/sys/net80211/ieee80211_ioctl.c > > Modified: head/sys/net80211/ieee80211_ioctl.c > ============================================================================== > --- head/sys/net80211/ieee80211_ioctl.c Sat Apr 26 23:09:01 2014 (r264990) > +++ head/sys/net80211/ieee80211_ioctl.c Sat Apr 26 23:22:49 2014 (r264991) > @@ -602,7 +602,7 @@ ieee80211_ioctl_getcurchan(struct ieee80 > * in use. When in RUN state report the vap-specific channel. > * Otherwise return curchan. > */ > - if (vap->iv_state == IEEE80211_S_RUN | vap->iv_state == IEEE80211_S_SLEEP) > + if (vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP) > c = vap->iv_bss->ni_chan; > else > c = ic->ic_curchan; > From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 00:40:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD5C16FF; Sun, 27 Apr 2014 00:40:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B04D0164E; Sun, 27 Apr 2014 00:40:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3R0eINI036177; Sun, 27 Apr 2014 00:40:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3R0eIrV036176; Sun, 27 Apr 2014 00:40:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201404270040.s3R0eIrV036176@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 27 Apr 2014 00:40:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264992 - head/release/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 00:40:18 -0000 Author: nwhitehorn Date: Sun Apr 27 00:40:18 2014 New Revision: 264992 URL: http://svnweb.freebsd.org/changeset/base/264992 Log: Make a dual-boot BIOS/UEFI memstick image. Testing required before this gets renamed make-memstick.sh. Modified: head/release/amd64/make-uefi-memstick.sh Modified: head/release/amd64/make-uefi-memstick.sh ============================================================================== --- head/release/amd64/make-uefi-memstick.sh Sat Apr 26 23:22:49 2014 (r264991) +++ head/release/amd64/make-uefi-memstick.sh Sun Apr 27 00:40:18 2014 (r264992) @@ -1,12 +1,9 @@ #!/bin/sh # -# This script generates a "memstick image" for UEFI-capable systems. -# -# Prerequisites: -# - 'make release' -# - KERNCONF *must* be VT (or vt_efifb(4) compiled into the kernel) -# -# Note: This only works for amd64, because i386 lacks the EFI boot bits. +# This script generates a "memstick image" (image that can be copied to a +# USB memory stick) from a directory tree. Note that the script does not +# clean up after itself very well for error conditions on purpose so the +# problem can be diagnosed (full filesystem most likely but ...). # # Usage: make-memstick.sh # @@ -31,43 +28,14 @@ if [ -e ${2} ]; then exit 1 fi -dirsize=$(du -shLm ${1} | awk '{print $1}') -dirsize=$(( $(( $(( ${dirsize} + 256 )) * 1024 * 1024 )) )) -truncate -s ${dirsize} ${2} - -unit=$(mdconfig -a -t vnode -f ${2}) -gpart create -s mbr /dev/${unit} -gpart add -t '!0xEF' -s 32M /dev/${unit} -gpart add -t freebsd /dev/${unit} -gpart set -a active -i 2 /dev/${unit} -gpart bootcode -b ${1}/boot/boot0 /dev/${unit} -gpart create -s bsd -n 20 /dev/${unit}s2 -gpart add -t freebsd-ufs /dev/${unit}s2 -gpart bootcode -b ${1}/boot/boot /dev/${unit}s2 -newfs_msdos /dev/${unit}s1 -newfs -L rootfs /dev/${unit}s2a -mkdir -p ${1}/mnt -mount -t msdosfs /dev/${unit}s1 ${1}/mnt -mkdir -p ${1}/mnt/efi/boot -cp -p ${1}/boot/boot1.efi ${1}/mnt/efi/boot/BOOTx64.efi - -while ! umount ${1}/mnt; do - sleep 1 -done - -mkdir -p mnt -mount /dev/${unit}s2a mnt -tar -cf - -C ${1} . | tar -xf - -C mnt -echo "/dev/ufs/rootfs / ufs ro,noatime 1 1" > mnt/etc/fstab - -while ! umount mnt; do - sleep 1 -done - -# Default boot selection to MBR so systems that do not support UEFI -# do not fail to boot without human interaction. -boot0cfg -s 2 /dev/${unit} +echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab +makefs -B little -o label=FreeBSD_Install ${2}.part ${1} +if [ $? -ne 0 ]; then + echo "makefs failed" + exit 1 +fi +rm ${1}/etc/fstab -mdconfig -d -u ${unit} -rmdir mnt +mkimg -s gpt -b ${1}/boot/pmbr -p freebsd-boot:=${1}/boot/gptboot -p efi:=${1}/boot/boot1.efifat -p freebsd-ufs:=${2}.part -o ${2} +rm ${2}.part From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 00:45:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FCF993E; Sun, 27 Apr 2014 00:45:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C19016DA; Sun, 27 Apr 2014 00:45:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3R0j8FT039648; Sun, 27 Apr 2014 00:45:08 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3R0j8f3039645; Sun, 27 Apr 2014 00:45:08 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201404270045.s3R0j8f3039645@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 27 Apr 2014 00:45:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264993 - head/sys/boot/amd64/boot1.efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 00:45:09 -0000 Author: nwhitehorn Date: Sun Apr 27 00:45:08 2014 New Revision: 264993 URL: http://svnweb.freebsd.org/changeset/base/264993 Log: Revert to FAT12. This file system is apparently too small for FAT32, even if the old (pre r264889) newfs_msdos allowed it. And FAT12 seems to work perfectly well. Modified: head/sys/boot/amd64/boot1.efi/Makefile.fat head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu head/sys/boot/amd64/boot1.efi/generate-fat.sh Modified: head/sys/boot/amd64/boot1.efi/Makefile.fat ============================================================================== --- head/sys/boot/amd64/boot1.efi/Makefile.fat Sun Apr 27 00:40:18 2014 (r264992) +++ head/sys/boot/amd64/boot1.efi/Makefile.fat Sun Apr 27 00:45:08 2014 (r264993) @@ -1,3 +1,3 @@ # This file autogenerated by generate-fat.sh - DO NOT EDIT # $FreeBSD$ -BOOT1_OFFSET=0x3b +BOOT1_OFFSET=0x2d Modified: head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu ============================================================================== --- head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu Sun Apr 27 00:40:18 2014 (r264992) +++ head/sys/boot/amd64/boot1.efi/fat.tmpl.bz2.uu Sun Apr 27 00:45:08 2014 (r264993) @@ -2,24 +2,20 @@ FAT template boot filesystem created by DO NOT EDIT $FreeBSD$ begin 644 fat.tmpl.bz2 -M0EIH.3%!6293620F1 -MIH#31H--/48U#0--&":#0`80&@TT,@`-&FF"&F@'J::&U/34NO5O]KH&,P3D -M9TC0KV+%M5^)$Y=$D2(S=*LB`@R"#`))MDFE$%&-NDVQ;AN6'M4LC-TEV[;Q -MO4PF6^32;0F_3B==]9YV`]#!83TL-$>IZWL>U[G#?8XC[6LXKC..Y"]R7 -MW+2`DCI_O6(CB*@F:HXU$D_U22''VTEI>J0$D<5XJTGX,_@%TB=+22<.G#2] -M8%U/0HF\H&"DJE]1'D[:R*HAO::Y1KJ51.W[.PJD;.AF*B305`)(Y*D=,J3E -M*C32FALJLNYU!J@"Z_P%2`,'![YLW>M2IC2`:`CEJ&T49+FZ_ -M1LE?,Y33\]9\*FD5,=K=4NCB[FR1Y"F3ZC%OGB-9C3?UV/,;:Y_5*B>JJ2SV -M'4VCKU)D*&.INFX6:M1L6Q:1HC>J9JLU)CN\93G:R2HF-)RY."9[:-NSFY;)AW3_&>YC -MGE^RL\!$JAO6TM%S=C+LRM7_XNY(IPH2!.H:`81HT#)D!H-#U`T#31IH-&(``R8$9_I)6[MY/, +M(H=/()+4&!(3V0"20C3J5$L5@2`219,"T6JI,@0"2*2\=LAD6=>N6(8QSW'U+N42P^'5X@7X``23=EA``#Z,O)^-VTX@ +M`+E!=,&6PV11C:*D8K#^<%FTG-%!@PR72@\ZU0BF1Y] +MF-FPGL2L>4QCU&O/>89^#H$6^<;&WKC9W52KUX."CM6+GD;(=1!MUD,,?Y[] +MTLAG0];,:B^]M%BH0J1":_C-*2I9R3AS#,&0>$RCY'T/R?HR!?'5$MILQ:!" +M+;10A*!&^<(_/8>D8 Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1D68A78; Sun, 27 Apr 2014 00:46:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EDCF16DE; Sun, 27 Apr 2014 00:46:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3R0k2Kq039754; Sun, 27 Apr 2014 00:46:02 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3R0k1w0039748; Sun, 27 Apr 2014 00:46:01 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404270046.s3R0k1w0039748@svn.freebsd.org> From: Ian Lepore Date: Sun, 27 Apr 2014 00:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264994 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 00:46:02 -0000 Author: ian Date: Sun Apr 27 00:46:01 2014 New Revision: 264994 URL: http://svnweb.freebsd.org/changeset/base/264994 Log: Provide a proper armv7 implementation of icache_sync_all rather than using armv7_idcache_wbinv_all, because wbinv_all doesn't broadcast the operation to other cores. In elf_cpu_load_file() use icache_sync_all() and explain why it's needed (and why other sync operations aren't). As part of doing this, all callers of cpu_icache_sync_all() were inspected to ensure they weren't relying on the old side effect of doing a wbinv_all along with the icache work. Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/arm/cpufunc_asm_armv7.S head/sys/arm/arm/elf_machdep.c head/sys/arm/include/cpufunc.h Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Sun Apr 27 00:45:08 2014 (r264993) +++ head/sys/arm/arm/cpufunc.c Sun Apr 27 00:46:01 2014 (r264994) @@ -769,7 +769,7 @@ struct cpu_functions cortexa_cpufuncs = /* Cache operations */ - armv7_idcache_wbinv_all, /* icache_sync_all */ + armv7_icache_sync_all, /* icache_sync_all */ armv7_icache_sync_range, /* icache_sync_range */ armv7_dcache_wbinv_all, /* dcache_wbinv_all */ Modified: head/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_armv7.S Sun Apr 27 00:45:08 2014 (r264993) +++ head/sys/arm/arm/cpufunc_asm_armv7.S Sun Apr 27 00:46:01 2014 (r264994) @@ -250,6 +250,13 @@ ENTRY(armv7_idcache_wbinv_range) RET END(armv7_idcache_wbinv_range) +ENTRY_NP(armv7_icache_sync_all) + mcr p15, 0, r0, c7, c1, 0 /* Invalidate all I cache to PoU Inner Shareable */ + isb /* instruction synchronization barrier */ + dsb /* data synchronization barrier */ + RET +END(armv7_icache_sync_all) + ENTRY_NP(armv7_icache_sync_range) ldr ip, .Larmv7_line_size .Larmv7_sync_next: Modified: head/sys/arm/arm/elf_machdep.c ============================================================================== --- head/sys/arm/arm/elf_machdep.c Sun Apr 27 00:45:08 2014 (r264993) +++ head/sys/arm/arm/elf_machdep.c Sun Apr 27 00:46:01 2014 (r264994) @@ -220,9 +220,19 @@ int elf_cpu_load_file(linker_file_t lf __unused) { - cpu_idcache_wbinv_all(); - cpu_l2cache_wbinv_all(); - cpu_tlb_flushID(); + /* + * The pmap code does not do an icache sync upon establishing executable + * mappings in the kernel pmap. It's an optimization based on the fact + * that kernel memory allocations always have EXECUTABLE protection even + * when the memory isn't going to hold executable code. The only time + * kernel memory holding instructions does need a sync is after loading + * a kernel module, and that's when this function gets called. Normal + * data cache maintenance has already been done by the IO code, and TLB + * maintenance has been done by the pmap code, so all we have to do here + * is invalidate the instruction cache (which also invalidates the + * branch predictor cache on platforms that have one). + */ + cpu_icache_sync_all(); return (0); } Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Sun Apr 27 00:45:08 2014 (r264993) +++ head/sys/arm/include/cpufunc.h Sun Apr 27 00:46:01 2014 (r264994) @@ -411,6 +411,7 @@ void armv6_idcache_wbinv_range (vm_offse void armv7_setttb (u_int); void armv7_tlb_flushID (void); void armv7_tlb_flushID_SE (u_int); +void armv7_icache_sync_all (); void armv7_icache_sync_range (vm_offset_t, vm_size_t); void armv7_idcache_wbinv_range (vm_offset_t, vm_size_t); void armv7_idcache_inv_all (void); From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 01:06:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53701C30; Sun, 27 Apr 2014 01:06:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25FE41834; Sun, 27 Apr 2014 01:06:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3R163UQ047660; Sun, 27 Apr 2014 01:06:03 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3R162Ws047659; Sun, 27 Apr 2014 01:06:02 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201404270106.s3R162Ws047659@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 27 Apr 2014 01:06:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264995 - head/release/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 01:06:03 -0000 Author: nwhitehorn Date: Sun Apr 27 01:06:02 2014 New Revision: 264995 URL: http://svnweb.freebsd.org/changeset/base/264995 Log: Add script to setup bootable CD ISOs for both BIOS and EFI systems. Tested and working on QEMU. Actually using this script as the regular image generator, like with the memstick one, will require that the kernel support EFI too. In particular, the following two things are required: 1. vt(9) be the default console driver 2. vt_efifb and vt_vga be able to coexist usefully in the same kernel One other note here is that this requires newfs_msdos and mdconfig, which is really ugly. NetBSD's makefs at least seems to support FAT now. If that actually works, it should be imported and we can get rid of the mdconfig mess. Added: head/release/amd64/mkisoimages-uefi.sh - copied, changed from r264979, head/release/amd64/mkisoimages.sh Copied and modified: head/release/amd64/mkisoimages-uefi.sh (from r264979, head/release/amd64/mkisoimages.sh) ============================================================================== --- head/release/amd64/mkisoimages.sh Sat Apr 26 16:58:35 2014 (r264979, copy source) +++ head/release/amd64/mkisoimages-uefi.sh Sun Apr 27 01:06:02 2014 (r264995) @@ -26,6 +26,20 @@ if [ "x$1" = "x-b" ]; then # This is highly x86-centric and will be used directly below. bootable="-o bootimage=i386;$4/boot/cdboot -o no-emul-boot" + + # Make EFI system partition (should be done with makefs in the future) + dd if=/dev/zero of=efiboot.img bs=4k count=100 + device=`mdconfig -a -t vnode -f efiboot.img` + newfs_msdos -F 12 -m 0xf8 /dev/$device + mkdir efi + mount -t msdosfs /dev/$device efi + mkdir -p efi/efi/boot + cp ${4}/boot/loader.efi efi/efi/boot/bootx64.efi + umount efi + rmdir efi + mdconfig -d -u $device + bootable="-o bootimage=i386;efiboot.img -o no-emul-boot $bootable" + shift else bootable="" @@ -43,3 +57,4 @@ publisher="The FreeBSD Project. http:// echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab makefs -t cd9660 $bootable -o rockridge -o label=$LABEL -o publisher="$publisher" $NAME $* rm $1/etc/fstab +rm -f efiboot.img From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 02:19:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF263618; Sun, 27 Apr 2014 02:19:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BA9C1CEA; Sun, 27 Apr 2014 02:19:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3R2Jr95076570; Sun, 27 Apr 2014 02:19:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3R2Jr60076569; Sun, 27 Apr 2014 02:19:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201404270219.s3R2Jr60076569@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 27 Apr 2014 02:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264997 - head/sys/dev/vt/hw/vga X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 02:19:53 -0000 Author: nwhitehorn Date: Sun Apr 27 02:19:53 2014 New Revision: 264997 URL: http://svnweb.freebsd.org/changeset/base/264997 Log: Disable vga if EFI framebuffer present. vt(9) should handle this internally based on efifb's higher priority, but it doesn't, and this at least lets us build a kernel that boots on both BIOS and EFI systems for now. Modified: head/sys/dev/vt/hw/vga/vga.c Modified: head/sys/dev/vt/hw/vga/vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vga.c Sun Apr 27 01:15:10 2014 (r264996) +++ head/sys/dev/vt/hw/vga/vga.c Sun Apr 27 02:19:53 2014 (r264997) @@ -45,8 +45,10 @@ __FBSDID("$FreeBSD$"); #if defined(__amd64__) || defined(__i386__) #include #include +#include #include #include +#include #endif /* __amd64__ || __i386__ */ struct vga_softc { @@ -637,6 +639,19 @@ vga_init(struct vt_device *vd) int textmode = 0; #if defined(__amd64__) || defined(__i386__) + /* Disable if EFI framebuffer present. Should be handled by priority + * logic in vt(9), but this will do for now. XXX */ + + caddr_t kmdp, efifb; + kmdp = preload_search_by_type("elf kernel"); + if (kmdp == NULL) + kmdp = preload_search_by_type("elf64 kernel"); + efifb = preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_EFI_FB); + if (efifb != NULL) + return (CN_DEAD); +#endif + +#if defined(__amd64__) || defined(__i386__) sc->vga_fb_tag = X86_BUS_SPACE_MEM; sc->vga_fb_handle = KERNBASE + VGA_MEM_BASE; sc->vga_reg_tag = X86_BUS_SPACE_IO; From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 02:20:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECA2274F; Sun, 27 Apr 2014 02:20:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9B6A1CED; Sun, 27 Apr 2014 02:20:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3R2K9Vo077078; Sun, 27 Apr 2014 02:20:09 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3R2K9xP077077; Sun, 27 Apr 2014 02:20:09 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201404270220.s3R2K9xP077077@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sun, 27 Apr 2014 02:20:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264998 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 02:20:10 -0000 Author: melifaro Date: Sun Apr 27 02:20:09 2014 New Revision: 264998 URL: http://svnweb.freebsd.org/changeset/base/264998 Log: Move up fibnum to ensure it is always defined. Found by: ian MFC with: r264987 Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sun Apr 27 02:19:53 2014 (r264997) +++ head/sys/net/rtsock.c Sun Apr 27 02:20:09 2014 (r264998) @@ -531,6 +531,8 @@ route_output(struct mbuf *m, struct sock union sockaddr_union saun; sa_family_t saf = AF_UNSPEC; + fibnum = so->so_fibnum; + #define senderr(e) { error = e; goto flush;} if (m == NULL || ((m->m_len < sizeof(long)) && (m = m_pullup(m, sizeof(long))) == NULL)) @@ -582,8 +584,6 @@ route_output(struct mbuf *m, struct sock senderr(error); } - fibnum = so->so_fibnum; - /* * The given gateway address may be an interface address. * For example, issuing a "route change" command on a route From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 02:20:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 118D7889; Sun, 27 Apr 2014 02:20:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2A261CF4; Sun, 27 Apr 2014 02:20:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3R2KpUC079364; Sun, 27 Apr 2014 02:20:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3R2KpNF079363; Sun, 27 Apr 2014 02:20:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201404270220.s3R2KpNF079363@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 27 Apr 2014 02:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264999 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 02:20:52 -0000 Author: nwhitehorn Date: Sun Apr 27 02:20:51 2014 New Revision: 264999 URL: http://svnweb.freebsd.org/changeset/base/264999 Log: Increase the maximum framebuffer size to more reasonable values reflecting the high-resolution boot consoles present on Open Firmware and EFI systems. Modified: head/sys/dev/vt/vt.h Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Sun Apr 27 02:20:09 2014 (r264998) +++ head/sys/dev/vt/vt.h Sun Apr 27 02:20:51 2014 (r264999) @@ -337,10 +337,10 @@ void vt_upgrade(struct vt_device *vd); #define PIXEL_HEIGHT(h) ((h) / 16) #ifndef VT_FB_DEFAULT_WIDTH -#define VT_FB_DEFAULT_WIDTH 640 +#define VT_FB_DEFAULT_WIDTH 2048 #endif #ifndef VT_FB_DEFAULT_HEIGHT -#define VT_FB_DEFAULT_HEIGHT 480 +#define VT_FB_DEFAULT_HEIGHT 1200 #endif #define VT_CONSDEV_DECLARE(driver, width, height, softc) \ From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 02:22:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13D3C9D7; Sun, 27 Apr 2014 02:22:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00A1E1D6C; Sun, 27 Apr 2014 02:22:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3R2MLDx079961; Sun, 27 Apr 2014 02:22:21 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3R2MLTc079960; Sun, 27 Apr 2014 02:22:21 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201404270222.s3R2MLTc079960@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 27 Apr 2014 02:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265000 - head/sys/amd64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 02:22:22 -0000 Author: nwhitehorn Date: Sun Apr 27 02:22:21 2014 New Revision: 265000 URL: http://svnweb.freebsd.org/changeset/base/265000 Log: Add vt_efifb to VT kernel configuration now that that actually works. This kernel will now boot on both BIOS and EFI systems without modification. Equivalent functionality in GENERIC requires making vt(9) the default console driver, which is probably appropriate at this point. Modified: head/sys/amd64/conf/VT Modified: head/sys/amd64/conf/VT ============================================================================== --- head/sys/amd64/conf/VT Sun Apr 27 02:20:51 2014 (r264999) +++ head/sys/amd64/conf/VT Sun Apr 27 02:22:21 2014 (r265000) @@ -12,3 +12,4 @@ nodevice vga device vt device vt_vga +device vt_efifb From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 02:24:33 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90DDFB31; Sun, 27 Apr 2014 02:24:33 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52CE11D85; Sun, 27 Apr 2014 02:24:33 +0000 (UTC) Received: from secured.by.ipfw.ru ([95.143.220.47] helo=ws.su29.net) by mail.ipfw.ru with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1WeAs9-00036F-Kc; Sun, 27 Apr 2014 02:15:01 +0400 Message-ID: <535C6A3A.7030203@FreeBSD.org> Date: Sun, 27 Apr 2014 06:23:54 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r264987 - head/sys/net References: <201404262232.s3QMW4pe085571@svn.freebsd.org> <1398554178.61646.149.camel@revolution.hippie.lan> In-Reply-To: <1398554178.61646.149.camel@revolution.hippie.lan> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 02:24:33 -0000 On 27.04.2014 03:16, Ian Lepore wrote: > On Sat, 2014-04-26 at 22:32 +0000, Alexander V. Chernikov wrote: >> Author: melifaro >> Date: Sat Apr 26 22:32:04 2014 >> New Revision: 264987 >> URL: http://svnweb.freebsd.org/changeset/base/264987 >> >> Log: >> Determine fibnum once in the beginning of route_output(). >> >> MFC after: 1 month >> >> Modified: >> head/sys/net/rtsock.c > >> Modified: head/sys/net/rtsock.c >> ============================================================================== >> --- head/sys/net/rtsock.c Sat Apr 26 21:03:41 2014 (r264986) >> +++ head/sys/net/rtsock.c Sat Apr 26 22:32:04 2014 (r264987) >> @@ -526,7 +526,7 @@ route_output(struct mbuf *m, struct sock >> struct sockaddr_in6 *sin6; >> int i, rti_need_deembed = 0; >> #endif >> - int len, error = 0; >> + int len, error = 0, fibnum; >> struct ifnet *ifp = NULL; >> union sockaddr_union saun; >> sa_family_t saf = AF_UNSPEC; >> @@ -582,6 +582,8 @@ route_output(struct mbuf *m, struct sock >> senderr(error); >> } >> >> + fibnum = so->so_fibnum; >> + >> /* >> * The given gateway address may be an interface address. >> * For example, issuing a "route change" command on a route >> @@ -596,7 +598,7 @@ route_output(struct mbuf *m, struct sock >> >> bzero(&gw_ro, sizeof(gw_ro)); >> gw_ro.ro_dst = *info.rti_info[RTAX_GATEWAY]; >> - rtalloc_ign_fib(&gw_ro, 0, so->so_fibnum); >> + rtalloc_ign_fib(&gw_ro, 0, fibnum); >> /* >> * A host route through the loopback interface is >> * installed for each interface adddress. In pre 8.0 >> @@ -637,7 +639,7 @@ route_output(struct mbuf *m, struct sock >> break; >> } >> error = rtrequest1_fib(rtm->rtm_type, &info, &saved_nrt, >> - so->so_fibnum); >> + fibnum); >> if (error == 0 && saved_nrt != NULL) { >> #ifdef INET6 >> rti_need_deembed = (V_deembed_scopeid) ? 1 : 0; >> @@ -663,8 +665,7 @@ route_output(struct mbuf *m, struct sock >> #endif >> break; >> } >> - error = rtrequest1_fib(RTM_DELETE, &info, &saved_nrt, >> - so->so_fibnum); >> + error = rtrequest1_fib(RTM_DELETE, &info, &saved_nrt, fibnum); >> if (error == 0) { >> RT_LOCK(saved_nrt); >> rt = saved_nrt; >> @@ -677,8 +678,7 @@ route_output(struct mbuf *m, struct sock >> break; >> >> case RTM_GET: >> - rnh = rt_tables_get_rnh(so->so_fibnum, >> - info.rti_info[RTAX_DST]->sa_family); >> + rnh = rt_tables_get_rnh(fibnum, saf); >> if (rnh == NULL) >> senderr(EAFNOSUPPORT); >> >> @@ -867,7 +867,7 @@ flush: >> m_adj(m, rtm->rtm_msglen - m->m_pkthdr.len); >> } >> if (m) { >> - M_SETFIB(m, so->so_fibnum); >> + M_SETFIB(m, fibnum); >> m->m_flags |= RTS_FILTER_FIB; >> if (rp) { >> /* >> > > I've got build breakage that I think may be from this change... > > /local/build/staging/freebsd/head/src/sys/net/rtsock.c: In function 'route_output': > /local/build/staging/freebsd/head/src/sys/net/rtsock.c:529: warning: 'fibnum' may be used uninitialized in this function Fixed in r264998, thank you! Twice per night is a kind of record for me :( I'm wondering why clang hasn't seen any issue here.. > > -- Ian > > > > From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 02:28:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7824D1B; Sun, 27 Apr 2014 02:28:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A8C01DAA; Sun, 27 Apr 2014 02:28:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3R2SWp5080601; Sun, 27 Apr 2014 02:28:32 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3R2SWrP080600; Sun, 27 Apr 2014 02:28:32 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201404270228.s3R2SWrP080600@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 27 Apr 2014 02:28:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265001 - head/sys/amd64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 02:28:32 -0000 Author: nwhitehorn Date: Sun Apr 27 02:28:32 2014 New Revision: 265001 URL: http://svnweb.freebsd.org/changeset/base/265001 Log: Don't need this now. VT does the same thing, but better. Submitted by: gjb Deleted: head/sys/amd64/conf/UEFI From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 02:38:48 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 942F8FAD; Sun, 27 Apr 2014 02:38:48 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E7F31FAB; Sun, 27 Apr 2014 02:38:47 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WeEzO-000IU0-7w; Sun, 27 Apr 2014 02:38:46 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s3R2chQ2013310; Sat, 26 Apr 2014 20:38:44 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+Bk4iuL6ZeZJ/e7JkseWAz Subject: Re: svn commit: r264987 - head/sys/net From: Ian Lepore To: "Alexander V. Chernikov" In-Reply-To: <535C6A3A.7030203@FreeBSD.org> References: <201404262232.s3QMW4pe085571@svn.freebsd.org> <1398554178.61646.149.camel@revolution.hippie.lan> <535C6A3A.7030203@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" Date: Sat, 26 Apr 2014 20:38:43 -0600 Message-ID: <1398566323.61646.151.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 02:38:48 -0000 On Sun, 2014-04-27 at 06:23 +0400, Alexander V. Chernikov wrote: > On 27.04.2014 03:16, Ian Lepore wrote: > > On Sat, 2014-04-26 at 22:32 +0000, Alexander V. Chernikov wrote: > >> Author: melifaro > >> Date: Sat Apr 26 22:32:04 2014 > >> New Revision: 264987 > >> URL: http://svnweb.freebsd.org/changeset/base/264987 > >> > >> Log: > >> Determine fibnum once in the beginning of route_output(). > >> > >> MFC after: 1 month > >> > >> Modified: > >> head/sys/net/rtsock.c > > > >> Modified: head/sys/net/rtsock.c > >> ============================================================================== > >> --- head/sys/net/rtsock.c Sat Apr 26 21:03:41 2014 (r264986) > >> +++ head/sys/net/rtsock.c Sat Apr 26 22:32:04 2014 (r264987) > >> @@ -526,7 +526,7 @@ route_output(struct mbuf *m, struct sock > >> struct sockaddr_in6 *sin6; > >> int i, rti_need_deembed = 0; > >> #endif > >> - int len, error = 0; > >> + int len, error = 0, fibnum; > >> struct ifnet *ifp = NULL; > >> union sockaddr_union saun; > >> sa_family_t saf = AF_UNSPEC; > >> @@ -582,6 +582,8 @@ route_output(struct mbuf *m, struct sock > >> senderr(error); > >> } > >> > >> + fibnum = so->so_fibnum; > >> + > >> /* > >> * The given gateway address may be an interface address. > >> * For example, issuing a "route change" command on a route > >> @@ -596,7 +598,7 @@ route_output(struct mbuf *m, struct sock > >> > >> bzero(&gw_ro, sizeof(gw_ro)); > >> gw_ro.ro_dst = *info.rti_info[RTAX_GATEWAY]; > >> - rtalloc_ign_fib(&gw_ro, 0, so->so_fibnum); > >> + rtalloc_ign_fib(&gw_ro, 0, fibnum); > >> /* > >> * A host route through the loopback interface is > >> * installed for each interface adddress. In pre 8.0 > >> @@ -637,7 +639,7 @@ route_output(struct mbuf *m, struct sock > >> break; > >> } > >> error = rtrequest1_fib(rtm->rtm_type, &info, &saved_nrt, > >> - so->so_fibnum); > >> + fibnum); > >> if (error == 0 && saved_nrt != NULL) { > >> #ifdef INET6 > >> rti_need_deembed = (V_deembed_scopeid) ? 1 : 0; > >> @@ -663,8 +665,7 @@ route_output(struct mbuf *m, struct sock > >> #endif > >> break; > >> } > >> - error = rtrequest1_fib(RTM_DELETE, &info, &saved_nrt, > >> - so->so_fibnum); > >> + error = rtrequest1_fib(RTM_DELETE, &info, &saved_nrt, fibnum); > >> if (error == 0) { > >> RT_LOCK(saved_nrt); > >> rt = saved_nrt; > >> @@ -677,8 +678,7 @@ route_output(struct mbuf *m, struct sock > >> break; > >> > >> case RTM_GET: > >> - rnh = rt_tables_get_rnh(so->so_fibnum, > >> - info.rti_info[RTAX_DST]->sa_family); > >> + rnh = rt_tables_get_rnh(fibnum, saf); > >> if (rnh == NULL) > >> senderr(EAFNOSUPPORT); > >> > >> @@ -867,7 +867,7 @@ flush: > >> m_adj(m, rtm->rtm_msglen - m->m_pkthdr.len); > >> } > >> if (m) { > >> - M_SETFIB(m, so->so_fibnum); > >> + M_SETFIB(m, fibnum); > >> m->m_flags |= RTS_FILTER_FIB; > >> if (rp) { > >> /* > >> > > > > I've got build breakage that I think may be from this change... > > > > /local/build/staging/freebsd/head/src/sys/net/rtsock.c: In function 'route_output': > > /local/build/staging/freebsd/head/src/sys/net/rtsock.c:529: warning: 'fibnum' may be used uninitialized in this function > Fixed in r264998, thank you! > Twice per night is a kind of record for me :( > I'm wondering why clang hasn't seen any issue here.. > I've been doing a bunch of arm universe kernel builds that bring both clang and gcc into play; they do sometimes whine about different things. -- Ian From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 05:19:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96C63770; Sun, 27 Apr 2014 05:19:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 705CCC9F; Sun, 27 Apr 2014 05:19:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3R5J23G050442; Sun, 27 Apr 2014 05:19:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3R5J2nV050441; Sun, 27 Apr 2014 05:19:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201404270519.s3R5J2nV050441@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 27 Apr 2014 05:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265002 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 05:19:02 -0000 Author: kib Date: Sun Apr 27 05:19:01 2014 New Revision: 265002 URL: http://svnweb.freebsd.org/changeset/base/265002 Log: When vm_fault_copy_entry() is called from vm_map_protect() for a wired entry and performs the upgrade of the entry permissions from read-only to read-write, we must allow to search for the source pages in the backing object, like we do in the case of forking the read-only wired entry. For the fork case, the behaviour is allowed by src_readonly boolean, which in fact is only used to assert that read-write case provides all source pages in the top-level object. Eliminate the src_readonly variable. Allow for the copy loop to look into the backing objects, add explicit asserts to ensure that only read-only and upgrade case actually does. Expand comments. Change the panic call into assert. Reported by: markj Tested by: markj, pho (previous version) Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Apr 27 02:28:32 2014 (r265001) +++ head/sys/vm/vm_fault.c Sun Apr 27 05:19:01 2014 (r265002) @@ -1240,7 +1240,7 @@ vm_fault_copy_entry(vm_map_t dst_map, vm vm_offset_t vaddr; vm_page_t dst_m; vm_page_t src_m; - boolean_t src_readonly, upgrade; + boolean_t upgrade; #ifdef lint src_map++; @@ -1250,7 +1250,6 @@ vm_fault_copy_entry(vm_map_t dst_map, vm src_object = src_entry->object.vm_object; src_pindex = OFF_TO_IDX(src_entry->offset); - src_readonly = (src_entry->protection & VM_PROT_WRITE) == 0; /* * Create the top-level object for the destination entry. (Doesn't @@ -1321,25 +1320,33 @@ vm_fault_copy_entry(vm_map_t dst_map, vm /* * Find the page in the source object, and copy it in. - * (Because the source is wired down, the page will be in - * memory.) + * Because the source is wired down, the page will be + * in memory. */ VM_OBJECT_RLOCK(src_object); object = src_object; pindex = src_pindex + dst_pindex; while ((src_m = vm_page_lookup(object, pindex)) == NULL && - src_readonly && (backing_object = object->backing_object) != NULL) { /* - * Allow fallback to backing objects if we are reading. + * Unless the source mapping is read-only or + * it is presently being upgraded from + * read-only, the first object in the shadow + * chain should provide all of the pages. In + * other words, this loop body should never be + * executed when the source mapping is already + * read/write. */ + KASSERT((src_entry->protection & VM_PROT_WRITE) == 0 || + upgrade, + ("vm_fault_copy_entry: main object missing page")); + VM_OBJECT_RLOCK(backing_object); pindex += OFF_TO_IDX(object->backing_object_offset); VM_OBJECT_RUNLOCK(object); object = backing_object; } - if (src_m == NULL) - panic("vm_fault_copy_wired: page missing"); + KASSERT(src_m != NULL, ("vm_fault_copy_entry: page missing")); pmap_copy_page(src_m, dst_m); VM_OBJECT_RUNLOCK(object); dst_m->valid = VM_PAGE_BITS_ALL; From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 05:28:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CADEB8EA; Sun, 27 Apr 2014 05:28:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7B78D4C; Sun, 27 Apr 2014 05:28:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3R5SEn5054378; Sun, 27 Apr 2014 05:28:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3R5SEIm054377; Sun, 27 Apr 2014 05:28:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201404270528.s3R5SEIm054377@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 27 Apr 2014 05:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265003 - head/secure/usr.sbin/sshd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 05:28:14 -0000 Author: kib Date: Sun Apr 27 05:28:14 2014 New Revision: 265003 URL: http://svnweb.freebsd.org/changeset/base/265003 Log: Fix order of libthr and libc in the global dso list for sshd, by explicitely linking main binary with -lpthread. Before, libthr appeared in the list due to dependency of one of the kerberos libs. Due to the change in ld(1) behaviour of not copying NEEDED entries from direct dependencies into the link results, the order becomes reversed. The libthr must appear before libc to properly interpose libc symbols and provide working rtld locks implementation. The symptom was sshd hanging on rtld bind lock during nested symbol binding from a signal handler. Approved by: des (openssh maintainer) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/secure/usr.sbin/sshd/Makefile Modified: head/secure/usr.sbin/sshd/Makefile ============================================================================== --- head/secure/usr.sbin/sshd/Makefile Sun Apr 27 05:19:01 2014 (r265002) +++ head/secure/usr.sbin/sshd/Makefile Sun Apr 27 05:28:14 2014 (r265003) @@ -57,6 +57,16 @@ CFLAGS+= -DNONE_CIPHER_ENABLED DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ} LDADD+= -lcrypt -lcrypto -lz +# Fix the order of NEEDED entries for libthr and libc. The libthr +# needs to interpose libc symbols, leaving the libthr loading as +# dependency of krb causes reversed order and broken interposing. Put +# the threading library last on the linker command line, just before +# the -lc added by a compiler driver. +.if ${MK_KERBEROS_SUPPORT} != "no" +DPADD+= ${LIBPTHREAD} +LDADD+= -lpthread +.endif + .if defined(LOCALBASE) CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\" .endif From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 05:37:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86E52A4F; Sun, 27 Apr 2014 05:37:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 732D0DDA; Sun, 27 Apr 2014 05:37:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3R5b2jJ058320; Sun, 27 Apr 2014 05:37:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3R5b2TB058319; Sun, 27 Apr 2014 05:37:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201404270537.s3R5b2TB058319@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 27 Apr 2014 05:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265004 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 05:37:02 -0000 Author: kib Date: Sun Apr 27 05:37:01 2014 New Revision: 265004 URL: http://svnweb.freebsd.org/changeset/base/265004 Log: Same as it was done in r263878 for invlrng_handler(), fix order of checks for special pcid values in invlpg_pcid_handler(). Forst check for special values, and only then do PCID-specific page invalidation. Minor fix to the style compliance, declare local variable at the function start. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Sun Apr 27 05:28:14 2014 (r265003) +++ head/sys/amd64/amd64/mp_machdep.c Sun Apr 27 05:37:01 2014 (r265004) @@ -1566,6 +1566,7 @@ invlpg_handler(void) void invlpg_pcid_handler(void) { + uint64_t cr3; #ifdef COUNT_XINVLTLB_HITS xhits_pg[PCPU_GET(cpuid)]++; #endif /* COUNT_XINVLTLB_HITS */ @@ -1573,15 +1574,13 @@ invlpg_pcid_handler(void) (*ipi_invlpg_counts[PCPU_GET(cpuid)])++; #endif /* COUNT_IPIS */ - if (invpcid_works) { - invpcid(&smp_tlb_invpcid, INVPCID_ADDR); + if (smp_tlb_invpcid.pcid == (uint64_t)-1) { + invltlb_globpcid(); } else if (smp_tlb_invpcid.pcid == 0) { invlpg(smp_tlb_invpcid.addr); - } else if (smp_tlb_invpcid.pcid == (uint64_t)-1) { - invltlb_globpcid(); + } else if (invpcid_works) { + invpcid(&smp_tlb_invpcid, INVPCID_ADDR); } else { - uint64_t cr3; - /* * PCID supported, but INVPCID is not. * Temporarily switch to the target address From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 05:38:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59A8DB97; Sun, 27 Apr 2014 05:38:40 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask.apl.washington.edu", Issuer "troutmask.apl.washington.edu" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D087DEC; Sun, 27 Apr 2014 05:38:40 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.8/8.14.8) with ESMTP id s3R5axE8080180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 26 Apr 2014 22:36:59 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.8/8.14.8/Submit) id s3R5ax63080179; Sat, 26 Apr 2014 22:36:59 -0700 (PDT) (envelope-from sgk) Date: Sat, 26 Apr 2014 22:36:59 -0700 From: Steve Kargl To: Nathan Whitehorn Subject: Re: svn commit: r265000 - head/sys/amd64/conf Message-ID: <20140427053659.GA80168@troutmask.apl.washington.edu> References: <201404270222.s3R2MLTc079960@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201404270222.s3R2MLTc079960@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 05:38:40 -0000 > Equivalent functionality in GENERIC requires making vt(9) > the default console driver, which is probably appropriate > at this point. No. It is not appropriate! Please stop referring to nonexistent man pages in your commit mesasges. There is NO vt(9) manpage. -- Steve From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 09:16:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 007E695B; Sun, 27 Apr 2014 09:16:47 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id AE58F1DDD; Sun, 27 Apr 2014 09:16:47 +0000 (UTC) Received: from rnote.ddteam.net (10-89-133-95.pool.ukrtel.net [95.133.89.10]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPSA id 7047DC4927; Sun, 27 Apr 2014 12:16:39 +0300 (EEST) Date: Sun, 27 Apr 2014 12:16:36 +0300 From: Aleksandr Rybalko To: Nathan Whitehorn Subject: Re: svn commit: r264997 - head/sys/dev/vt/hw/vga Message-Id: <20140427121636.b93682e4.ray@freebsd.org> In-Reply-To: <201404270219.s3R2Jr60076569@svn.freebsd.org> References: <201404270219.s3R2Jr60076569@svn.freebsd.org> Organization: FreeBSD.ORG X-Mailer: Sylpheed 3.1.2 (GTK+ 2.24.5; amd64-portbld-freebsd9.0) X-Operating-System: FreeBSD Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 09:16:48 -0000 On Sun, 27 Apr 2014 02:19:53 +0000 (UTC) Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sun Apr 27 02:19:53 2014 > New Revision: 264997 > URL: http://svnweb.freebsd.org/changeset/base/264997 > > Log: > Disable vga if EFI framebuffer present. vt(9) should handle this > internally based on efifb's higher priority, but it doesn't, and this > at least lets us build a kernel that boots on both BIOS and EFI > systems for now. > > Modified: > head/sys/dev/vt/hw/vga/vga.c > > Modified: head/sys/dev/vt/hw/vga/vga.c > ============================================================================== > --- head/sys/dev/vt/hw/vga/vga.c Sun Apr 27 01:15:10 > 2014 (r264996) +++ head/sys/dev/vt/hw/vga/vga.c Sun Apr > 27 02:19:53 2014 (r264997) @@ -45,8 +45,10 @@ __FBSDID > ("$FreeBSD$"); > #if defined(__amd64__) || defined(__i386__) > #include > #include > +#include > #include > #include > +#include > #endif /* __amd64__ || __i386__ */ > > struct vga_softc { > @@ -637,6 +639,19 @@ vga_init(struct vt_device *vd) > int textmode = 0; > > #if defined(__amd64__) || defined(__i386__) > + /* Disable if EFI framebuffer present. Should be handled by > priority > + * logic in vt(9), but this will do for now. XXX */ > + > + caddr_t kmdp, efifb; > + kmdp = preload_search_by_type("elf kernel"); > + if (kmdp == NULL) > + kmdp = preload_search_by_type("elf64 kernel"); > + efifb = preload_search_info(kmdp, MODINFO_METADATA | > MODINFOMD_EFI_FB); > + if (efifb != NULL) > + return (CN_DEAD); > +#endif > + > +#if defined(__amd64__) || defined(__i386__) > sc->vga_fb_tag = X86_BUS_SPACE_MEM; > sc->vga_fb_handle = KERNBASE + VGA_MEM_BASE; > sc->vga_reg_tag = X86_BUS_SPACE_IO; > I have patch for that, but it require testing: http://people.freebsd.org/~ray/newcons/vt_early_select.patch WBW -- Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 09:49:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94348E56; Sun, 27 Apr 2014 09:49:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80AC618A; Sun, 27 Apr 2014 09:49:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3R9nZpA060535; Sun, 27 Apr 2014 09:49:35 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3R9nZZi060534; Sun, 27 Apr 2014 09:49:35 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201404270949.s3R9nZZi060534@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sun, 27 Apr 2014 09:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265009 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 09:49:35 -0000 Author: melifaro Date: Sun Apr 27 09:49:35 2014 New Revision: 265009 URL: http://svnweb.freebsd.org/changeset/base/265009 Log: Do not delay freeing rtm. Bandaid added in r227061 is not needed since r227061, MFC after: 1 month Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sun Apr 27 09:05:34 2014 (r265008) +++ head/sys/net/rtsock.c Sun Apr 27 09:49:35 2014 (r265009) @@ -842,7 +842,7 @@ flush: /* There is another listener, so construct message */ rp = sotorawcb(so); } - if (rtm) { + if (rtm != NULL) { #ifdef INET6 if (rti_need_deembed) { /* sin6_scope_id is recovered before sending rtm. */ @@ -865,6 +865,7 @@ flush: m = NULL; } else if (m->m_pkthdr.len > rtm->rtm_msglen) m_adj(m, rtm->rtm_msglen - m->m_pkthdr.len); + Free(rtm); } if (m) { M_SETFIB(m, fibnum); @@ -881,9 +882,6 @@ flush: } else rt_dispatch(m, saf); } - /* info.rti_info[RTAX_DST] (used above) can point inside of rtm */ - if (rtm) - Free(rtm); } return (error); } From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 10:20:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B42B445; Sun, 27 Apr 2014 10:20:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 762DD38A; Sun, 27 Apr 2014 10:20:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RAKckk073168; Sun, 27 Apr 2014 10:20:38 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RAKc9R073142; Sun, 27 Apr 2014 10:20:38 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201404271020.s3RAKc9R073142@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sun, 27 Apr 2014 10:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265010 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 10:20:38 -0000 Author: melifaro Date: Sun Apr 27 10:20:37 2014 New Revision: 265010 URL: http://svnweb.freebsd.org/changeset/base/265010 Log: Cleanup route_output() a bit. MFC after: 1 month Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sun Apr 27 09:49:35 2014 (r265009) +++ head/sys/net/rtsock.c Sun Apr 27 10:20:37 2014 (r265010) @@ -530,6 +530,7 @@ route_output(struct mbuf *m, struct sock struct ifnet *ifp = NULL; union sockaddr_union saun; sa_family_t saf = AF_UNSPEC; + struct rawcb *rp = NULL; fibnum = so->so_fibnum; @@ -819,22 +820,14 @@ report: } flush: - if (rtm) { - if (error) - rtm->rtm_errno = error; - else - rtm->rtm_flags |= RTF_DONE; - } - if (rt) /* XXX can this be true? */ + if (rt != NULL) RTFREE(rt); - { - struct rawcb *rp = NULL; /* * Check to see if we don't want our own messages. */ if ((so->so_options & SO_USELOOPBACK) == 0) { if (V_route_cb.any_count <= 1) { - if (rtm) + if (rtm != NULL) Free(rtm); m_freem(m); return (error); @@ -842,6 +835,7 @@ flush: /* There is another listener, so construct message */ rp = sotorawcb(so); } + if (rtm != NULL) { #ifdef INET6 if (rti_need_deembed) { @@ -859,6 +853,11 @@ flush: } } #endif + if (error != 0) + rtm->rtm_errno = error; + else + rtm->rtm_flags |= RTF_DONE; + m_copyback(m, 0, rtm->rtm_msglen, (caddr_t)rtm); if (m->m_pkthdr.len < rtm->rtm_msglen) { m_freem(m); @@ -867,7 +866,7 @@ flush: m_adj(m, rtm->rtm_msglen - m->m_pkthdr.len); Free(rtm); } - if (m) { + if (m != NULL) { M_SETFIB(m, fibnum); m->m_flags |= RTS_FILTER_FIB; if (rp) { @@ -882,7 +881,7 @@ flush: } else rt_dispatch(m, saf); } - } + return (error); } From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 10:43:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B811F6A8; Sun, 27 Apr 2014 10:43:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A40E37BE; Sun, 27 Apr 2014 10:43:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RAhm7E084756; Sun, 27 Apr 2014 10:43:48 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RAhm31084755; Sun, 27 Apr 2014 10:43:48 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201404271043.s3RAhm31084755@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sun, 27 Apr 2014 10:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265011 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 10:43:48 -0000 Author: melifaro Date: Sun Apr 27 10:43:48 2014 New Revision: 265011 URL: http://svnweb.freebsd.org/changeset/base/265011 Log: Remove useless zeroing of RTAX_DST on error. Cleanup a bit. MFC after: 1 month Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sun Apr 27 10:20:37 2014 (r265010) +++ head/sys/net/rtsock.c Sun Apr 27 10:43:48 2014 (r265011) @@ -542,32 +542,38 @@ route_output(struct mbuf *m, struct sock panic("route_output"); len = m->m_pkthdr.len; if (len < sizeof(*rtm) || - len != mtod(m, struct rt_msghdr *)->rtm_msglen) { - info.rti_info[RTAX_DST] = NULL; + len != mtod(m, struct rt_msghdr *)->rtm_msglen) senderr(EINVAL); - } + R_Malloc(rtm, struct rt_msghdr *, len); - if (rtm == NULL) { - info.rti_info[RTAX_DST] = NULL; + if (rtm == NULL) senderr(ENOBUFS); - } m_copydata(m, 0, len, (caddr_t)rtm); + bzero(&info, sizeof(info)); + if (rtm->rtm_version != RTM_VERSION) { - info.rti_info[RTAX_DST] = NULL; + /* Do not touch message since format is unknown */ + Free(rtm); + rtm = NULL; senderr(EPROTONOSUPPORT); } + + /* + * Starting from here, it is possible + * to alter original message and insert + * caller PID and error value. + */ + rtm->rtm_pid = curproc->p_pid; - bzero(&info, sizeof(info)); info.rti_addrs = rtm->rtm_addrs; /* * rt_xaddrs() performs s6_addr[2] := sin6_scope_id for AF_INET6 * link-local address because rtrequest requires addresses with * embedded scope id. */ - if (rt_xaddrs((caddr_t)(rtm + 1), len + (caddr_t)rtm, &info)) { - info.rti_info[RTAX_DST] = NULL; + if (rt_xaddrs((caddr_t)(rtm + 1), len + (caddr_t)rtm, &info)) senderr(EINVAL); - } + info.rti_flags = rtm->rtm_flags; if (info.rti_info[RTAX_DST] == NULL || info.rti_info[RTAX_DST]->sa_family >= AF_MAX || From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 12:11:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12CEB2AF; Sun, 27 Apr 2014 12:11:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3026DCE; Sun, 27 Apr 2014 12:11:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RCB1Sg018797; Sun, 27 Apr 2014 12:11:01 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RCB1wI018791; Sun, 27 Apr 2014 12:11:01 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201404271211.s3RCB1wI018791@svn.freebsd.org> From: Luiz Otavio O Souza Date: Sun, 27 Apr 2014 12:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265012 - in head/sys/dev: gpio ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 12:11:02 -0000 Author: loos Date: Sun Apr 27 12:11:00 2014 New Revision: 265012 URL: http://svnweb.freebsd.org/changeset/base/265012 Log: Fix the gpio-specifier decoding by respecting the GPIO controller's #gpio-cells property. Add a new ofw_bus method (OFW_BUS_MAP_GPIOS()) that allows the GPIO controller to implement its own mapping to deal with gpio-specifiers, allowing the decoding of gpio-specifiers to be controller specific. The default ofw_bus_map_gpios() decodes the linux standard (#gpio-cells = <2>) and the FreeBSD standard (#gpio-cells = <3>). It pass the gpio-specifier flag field to the children as an ivar variable so they can act upon. Modified: head/sys/dev/gpio/gpiobusvar.h head/sys/dev/gpio/ofw_gpiobus.c head/sys/dev/ofw/ofw_bus.h head/sys/dev/ofw/ofw_bus_if.m Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Sun Apr 27 10:43:48 2014 (r265011) +++ head/sys/dev/gpio/gpiobusvar.h Sun Apr 27 12:11:00 2014 (r265012) @@ -60,17 +60,22 @@ struct gpiobus_softc int *sc_pins_mapped; /* mark mapped pins */ }; - struct gpiobus_ivar { uint32_t npins; /* pins total */ + uint32_t *flags; /* pins flags */ uint32_t *pins; /* pins map */ }; -void gpiobus_print_pins(struct gpiobus_ivar *); #ifdef FDT +struct ofw_gpiobus_devinfo { + struct gpiobus_ivar opd_dinfo; + struct ofw_bus_devinfo opd_obdinfo; +}; + device_t ofw_gpiobus_add_fdt_child(device_t, phandle_t); #endif +void gpiobus_print_pins(struct gpiobus_ivar *); extern driver_t gpiobus_driver; Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Sun Apr 27 10:43:48 2014 (r265011) +++ head/sys/dev/gpio/ofw_gpiobus.c Sun Apr 27 12:11:00 2014 (r265012) @@ -47,11 +47,6 @@ __FBSDID("$FreeBSD$"); #include "gpio_if.h" #include "gpiobus_if.h" -struct ofw_gpiobus_devinfo { - struct gpiobus_ivar opd_dinfo; - struct ofw_bus_devinfo opd_obdinfo; -}; - static int ofw_gpiobus_parse_gpios(struct gpiobus_softc *, struct gpiobus_ivar *, phandle_t); static struct ofw_gpiobus_devinfo *ofw_gpiobus_setup_devinfo(device_t, @@ -83,10 +78,37 @@ ofw_gpiobus_add_fdt_child(device_t bus, } static int +ofw_gpiobus_alloc_ivars(struct gpiobus_ivar *dinfo) +{ + + /* Allocate pins and flags memory. */ + dinfo->pins = malloc(sizeof(uint32_t) * dinfo->npins, M_DEVBUF, + M_NOWAIT | M_ZERO); + if (dinfo->pins == NULL) + return (ENOMEM); + dinfo->flags = malloc(sizeof(uint32_t) * dinfo->npins, M_DEVBUF, + M_NOWAIT | M_ZERO); + if (dinfo->flags == NULL) { + free(dinfo->pins, M_DEVBUF); + return (ENOMEM); + } + + return (0); +} + +static void +ofw_gpiobus_free_ivars(struct gpiobus_ivar *dinfo) +{ + + free(dinfo->flags, M_DEVBUF); + free(dinfo->pins, M_DEVBUF); +} + +static int ofw_gpiobus_parse_gpios(struct gpiobus_softc *sc, struct gpiobus_ivar *dinfo, phandle_t child) { - int i, len; + int cells, i, j, len; pcell_t *gpios; phandle_t gpio; @@ -102,44 +124,81 @@ ofw_gpiobus_parse_gpios(struct gpiobus_s } /* - * Each 'gpios' entry must contain 4 pcells. - * The first one is the GPIO controller phandler. - * Then the last three are the GPIO pin, the GPIO pin direction and - * the GPIO pin flags. + * The gpio-specifier is controller independent, but the first pcell + * has the reference to the GPIO controller phandler. + * One the first pass we count the number of encoded gpio-specifiers. */ - if ((len / sizeof(pcell_t)) % 4) { + i = 0; + len /= sizeof(pcell_t); + while (i < len) { + /* Allow NULL specifiers. */ + if (gpios[i] == 0) { + dinfo->npins++; + i++; + continue; + } + gpio = OF_xref_phandle(gpios[i]); + /* Verify if we're attaching to the correct GPIO controller. */ + if (!OF_hasprop(gpio, "gpio-controller") || + gpio != ofw_bus_get_node(sc->sc_dev)) { + free(gpios, M_DEVBUF); + return (EINVAL); + } + /* Read gpio-cells property for this GPIO controller. */ + if (OF_getencprop(gpio, "#gpio-cells", &cells, + sizeof(cells)) < 0) { + free(gpios, M_DEVBUF); + return (EINVAL); + } + dinfo->npins++; + i += cells + 1; + } + + if (dinfo->npins == 0) { free(gpios, M_DEVBUF); return (EINVAL); } - dinfo->npins = len / (sizeof(pcell_t) * 4); - dinfo->pins = malloc(sizeof(uint32_t) * dinfo->npins, M_DEVBUF, - M_NOWAIT | M_ZERO); - if (dinfo->pins == NULL) { + + /* Allocate the child resources. */ + if (ofw_gpiobus_alloc_ivars(dinfo) != 0) { free(gpios, M_DEVBUF); return (ENOMEM); } - for (i = 0; i < dinfo->npins; i++) { + /* Decode the gpio specifier on the second pass. */ + i = 0; + j = 0; + while (i < len) { + /* Allow NULL specifiers. */ + if (gpios[i] == 0) { + i++; + j++; + continue; + } - /* Verify if we're attaching to the correct gpio controller. */ - gpio = OF_xref_phandle(gpios[i * 4 + 0]); - if (!OF_hasprop(gpio, "gpio-controller") || - gpio != ofw_bus_get_node(sc->sc_dev)) { - free(dinfo->pins, M_DEVBUF); + gpio = OF_xref_phandle(gpios[i]); + /* Read gpio-cells property for this GPIO controller. */ + if (OF_getencprop(gpio, "#gpio-cells", &cells, + sizeof(cells)) < 0) { + ofw_gpiobus_free_ivars(dinfo); free(gpios, M_DEVBUF); return (EINVAL); } - /* Get the GPIO pin number. */ - dinfo->pins[i] = gpios[i * 4 + 1]; - /* gpios[i * 4 + 2] - GPIO pin direction */ - /* gpios[i * 4 + 3] - GPIO pin flags */ + /* Get the GPIO pin number and flags. */ + if (ofw_bus_map_gpios(sc->sc_dev, child, gpio, cells, + &gpios[i + 1], &dinfo->pins[j], &dinfo->flags[j]) != 0) { + ofw_gpiobus_free_ivars(dinfo); + free(gpios, M_DEVBUF); + return (EINVAL); + } - if (dinfo->pins[i] > sc->sc_npins) { + /* Consistency check. */ + if (dinfo->pins[j] > sc->sc_npins) { device_printf(sc->sc_busdev, "invalid pin %d, max: %d\n", - dinfo->pins[i], sc->sc_npins - 1); - free(dinfo->pins, M_DEVBUF); + dinfo->pins[j], sc->sc_npins - 1); + ofw_gpiobus_free_ivars(dinfo); free(gpios, M_DEVBUF); return (EINVAL); } @@ -147,15 +206,18 @@ ofw_gpiobus_parse_gpios(struct gpiobus_s /* * Mark pin as mapped and give warning if it's already mapped. */ - if (sc->sc_pins_mapped[dinfo->pins[i]]) { + if (sc->sc_pins_mapped[dinfo->pins[j]]) { device_printf(sc->sc_busdev, "warning: pin %d is already mapped\n", - dinfo->pins[i]); - free(dinfo->pins, M_DEVBUF); + dinfo->pins[j]); + ofw_gpiobus_free_ivars(dinfo); free(gpios, M_DEVBUF); return (EINVAL); } - sc->sc_pins_mapped[dinfo->pins[i]] = 1; + sc->sc_pins_mapped[dinfo->pins[j]] = 1; + + i += cells + 1; + j++; } free(gpios, M_DEVBUF); Modified: head/sys/dev/ofw/ofw_bus.h ============================================================================== --- head/sys/dev/ofw/ofw_bus.h Sun Apr 27 10:43:48 2014 (r265011) +++ head/sys/dev/ofw/ofw_bus.h Sun Apr 27 12:11:00 2014 (r265012) @@ -76,4 +76,12 @@ ofw_bus_map_intr(device_t dev, phandle_t return (OFW_BUS_MAP_INTR(dev, dev, iparent, icells, intr)); } +static __inline int +ofw_bus_map_gpios(device_t bus, phandle_t dev, phandle_t gparent, int gcells, + pcell_t *gpios, uint32_t *pin, uint32_t *flags) +{ + return (OFW_BUS_MAP_GPIOS(bus, dev, gparent, gcells, gpios, pin, + flags)); +} + #endif /* !_DEV_OFW_OFW_BUS_H_ */ Modified: head/sys/dev/ofw/ofw_bus_if.m ============================================================================== --- head/sys/dev/ofw/ofw_bus_if.m Sun Apr 27 10:43:48 2014 (r265011) +++ head/sys/dev/ofw/ofw_bus_if.m Sun Apr 27 12:11:00 2014 (r265012) @@ -58,6 +58,7 @@ CODE { static ofw_bus_get_node_t ofw_bus_default_get_node; static ofw_bus_get_type_t ofw_bus_default_get_type; static ofw_bus_map_intr_t ofw_bus_default_map_intr; + static ofw_bus_map_gpios_t ofw_bus_default_map_gpios; static const struct ofw_bus_devinfo * ofw_bus_default_get_devinfo(device_t bus, device_t dev) @@ -113,6 +114,24 @@ CODE { /* If that fails, then assume a one-domain system */ return (interrupt[0]); } + + int + ofw_bus_default_map_gpios(device_t bus, phandle_t dev, + phandle_t gparent, int gcells, pcell_t *gpios, uint32_t *pin, + uint32_t *flags) + { + /* Propagate up the bus hierarchy until someone handles it. */ + if (device_get_parent(bus) != NULL) + return OFW_BUS_MAP_GPIOS(device_get_parent(bus), dev, + gparent, gcells, gpios, pin, flags); + + /* If that fails, then assume the FreeBSD defaults. */ + *pin = gpios[0]; + if (gcells == 2 || gcells == 3) + *flags = gpios[gcells - 1]; + + return (0); + } }; # Get the ofw_bus_devinfo struct for the device dev on the bus. Used for bus @@ -170,4 +189,13 @@ METHOD int map_intr { pcell_t *interrupt; } DEFAULT ofw_bus_default_map_intr; - +# Map the GPIO controller specific gpio-specifier to GPIO pin and flags. +METHOD int map_gpios { + device_t bus; + phandle_t dev; + phandle_t gparent; + int gcells; + pcell_t *gpios; + uint32_t *pin; + uint32_t *flags; +} DEFAULT ofw_bus_default_map_gpios; From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 13:10:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D9A8C62; Sun, 27 Apr 2014 13:10:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49E2E1292; Sun, 27 Apr 2014 13:10:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RDAqYt045536; Sun, 27 Apr 2014 13:10:52 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RDAqhE045535; Sun, 27 Apr 2014 13:10:52 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201404271310.s3RDAqhE045535@svn.freebsd.org> From: Luiz Otavio O Souza Date: Sun, 27 Apr 2014 13:10:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265013 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 13:10:52 -0000 Author: loos Date: Sun Apr 27 13:10:51 2014 New Revision: 265013 URL: http://svnweb.freebsd.org/changeset/base/265013 Log: Revert r258678. Make the led gpio-specifier match again the #gpio-cells settings from the GPIO controller, which i had broken in r258678. Restore the active-low flag. Modified: head/sys/boot/fdt/dts/arm/rpi.dts Modified: head/sys/boot/fdt/dts/arm/rpi.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/rpi.dts Sun Apr 27 12:11:00 2014 (r265012) +++ head/sys/boot/fdt/dts/arm/rpi.dts Sun Apr 27 13:10:51 2014 (r265013) @@ -316,7 +316,7 @@ ok { label = "ok"; - gpios = <&gpio 16 2 0>; + gpios = <&gpio 16 1>; /* Don't change this - it configures * how the led driver determines if From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 15:13:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12FA5868; Sun, 27 Apr 2014 15:13:14 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id D988D1D55; Sun, 27 Apr 2014 15:13:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 7BAF738064; Sun, 27 Apr 2014 10:13:11 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id 2E19WdagWsrz; Sun, 27 Apr 2014 10:13:11 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id E45C33804C; Sun, 27 Apr 2014 10:13:10 -0500 (CDT) Message-ID: <535D1E85.8020502@freebsd.org> Date: Sun, 27 Apr 2014 08:13:09 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Luiz Otavio O Souza , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r265012 - in head/sys/dev: gpio ofw References: <201404271211.s3RCB1wI018791@svn.freebsd.org> In-Reply-To: <201404271211.s3RCB1wI018791@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 15:13:14 -0000 On 04/27/14 05:11, Luiz Otavio O Souza wrote: > Author: loos > Date: Sun Apr 27 12:11:00 2014 > New Revision: 265012 > URL: http://svnweb.freebsd.org/changeset/base/265012 > > Log: > Fix the gpio-specifier decoding by respecting the GPIO controller's > #gpio-cells property. > > Add a new ofw_bus method (OFW_BUS_MAP_GPIOS()) that allows the GPIO > controller to implement its own mapping to deal with gpio-specifiers, > allowing the decoding of gpio-specifiers to be controller specific. > > The default ofw_bus_map_gpios() decodes the linux standard (#gpio-cells = > <2>) and the FreeBSD standard (#gpio-cells = <3>). > > It pass the gpio-specifier flag field to the children as an ivar variable so > they can act upon. > > Modified: > head/sys/dev/gpio/gpiobusvar.h > head/sys/dev/gpio/ofw_gpiobus.c > head/sys/dev/ofw/ofw_bus.h > head/sys/dev/ofw/ofw_bus_if.m Would it be possible to put the routines from ofw_bus* into dev/gpio instead? I'd like to avoid polluting dev/ofw with bus-specific parts as much as possible. -Nathan From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 15:15:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 632969AF; Sun, 27 Apr 2014 15:15:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 503701D60; Sun, 27 Apr 2014 15:15:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RFF02g097200; Sun, 27 Apr 2014 15:15:00 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RFF0OJ097198; Sun, 27 Apr 2014 15:15:00 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404271515.s3RFF0OJ097198@svn.freebsd.org> From: Ed Maste Date: Sun, 27 Apr 2014 15:15:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265014 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 15:15:00 -0000 Author: emaste Date: Sun Apr 27 15:14:59 2014 New Revision: 265014 URL: http://svnweb.freebsd.org/changeset/base/265014 Log: Report boot method (BIOS/UEFI) via sysctl machdep.bootmethod Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sun Apr 27 13:10:51 2014 (r265013) +++ head/sys/amd64/amd64/machdep.c Sun Apr 27 15:14:59 2014 (r265014) @@ -1526,6 +1526,10 @@ add_efi_map_entries(struct efi_map_heade } } +static char bootmethod[16] = ""; +SYSCTL_STRING(_machdep, OID_AUTO, bootmethod, CTLFLAG_RD, bootmethod, 0, + "System firmware boot method"); + static void native_parse_memmap(caddr_t kmdp, vm_paddr_t *physmap, int *physmap_idx) { @@ -1550,9 +1554,11 @@ native_parse_memmap(caddr_t kmdp, vm_pad if (efihdr != NULL) { add_efi_map_entries(efihdr, physmap, physmap_idx); + strlcpy(bootmethod, "UEFI", sizeof(bootmethod)); } else { size = *((u_int32_t *)smap - 1); bios_add_smap_entries(smap, size, physmap, physmap_idx); + strlcpy(bootmethod, "BIOS", sizeof(bootmethod)); } } From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 15:22:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91696BF8; Sun, 27 Apr 2014 15:22:49 +0000 (UTC) Received: from mail-qg0-x22b.google.com (mail-qg0-x22b.google.com [IPv6:2607:f8b0:400d:c04::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FAE11F80; Sun, 27 Apr 2014 15:22:49 +0000 (UTC) Received: by mail-qg0-f43.google.com with SMTP id a108so5924947qge.16 for ; Sun, 27 Apr 2014 08:22:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=qUS6h5fgxPtP8KKevBE6XWecgL3LE3Cr0S7D+D8zcB8=; b=AB7kRyJ4uriyoOQ7qx8WYqeq0PIVNAOHHkPc+TNMOi6Oo74oGp0NLTJHGw9jXKEf/Q /QnQq1Z291UsHX1jn9BLKBdWdE8az2N9ueFLB2e87wd9wFwegxM2cfPa2gPr8Cf9WZry av3QD97V0L4z1LIWJLSSi1mgEwJBjfrVM8bSSD5Owl7m8JC+ktHg4ZgYNA62ugr7Dmks 7i3B3lWvNmoIGLqD3cTumKJrTe/R9oemz2f7bfZc0cF5nl8UsFYOTEezJPPEUPYw5LYQ H4+cx9oOWrLDjITtmiLZIb5JTyPMo5a075jrj79QeO4cXlBwL1D36eCzmIhYmDZsybD9 DuNA== MIME-Version: 1.0 X-Received: by 10.140.108.166 with SMTP id j35mr25309770qgf.76.1398612168246; Sun, 27 Apr 2014 08:22:48 -0700 (PDT) Sender: carpeddiem@gmail.com Received: by 10.140.49.239 with HTTP; Sun, 27 Apr 2014 08:22:48 -0700 (PDT) In-Reply-To: <201404270106.s3R162Ws047659@svn.freebsd.org> References: <201404270106.s3R162Ws047659@svn.freebsd.org> Date: Sun, 27 Apr 2014 11:22:48 -0400 X-Google-Sender-Auth: 7JLEEL7w0I6CW6yWczarHasbiIU Message-ID: Subject: Re: svn commit: r264995 - head/release/amd64 From: Ed Maste To: Nathan Whitehorn Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 15:22:49 -0000 On 26 April 2014 21:06, Nathan Whitehorn wrote: > > One other note here is that this requires newfs_msdos and mdconfig, which is > really ugly. NetBSD's makefs at least seems to support FAT now. If that > actually works, it should be imported and we can get rid of the mdconfig mess. NetBSD's makefs does support FAT, but relies on a refactored newfs_msdos that splits out the basic functionality for reuse. I started looking into that (and discovered the wrong min/max cluster counts -- r264889), and plan to make that change and then bring over the makefs changes. From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 15:41:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9AED743F; Sun, 27 Apr 2014 15:41:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B0691AB; Sun, 27 Apr 2014 15:41:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RFfjWp009483; Sun, 27 Apr 2014 15:41:45 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RFfika009477; Sun, 27 Apr 2014 15:41:44 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201404271541.s3RFfika009477@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 27 Apr 2014 15:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265015 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 15:41:45 -0000 Author: hselasky Date: Sun Apr 27 15:41:44 2014 New Revision: 265015 URL: http://svnweb.freebsd.org/changeset/base/265015 Log: Setting the IMOD value below 0x3F8 can cause IRQ lockups in the Intel LynxPoint USB 3.0 controllers found in MacBookPro 2013's. MFC after: 2 days Tested by: Huang Wen Hui Modified: head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/controller/xhci.h head/sys/dev/usb/controller/xhci_pci.c head/sys/dev/usb/controller/xhcireg.h Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Sun Apr 27 15:14:59 2014 (r265014) +++ head/sys/dev/usb/controller/xhci.c Sun Apr 27 15:41:44 2014 (r265015) @@ -495,8 +495,12 @@ xhci_start_controller(struct xhci_softc XWRITE4(sc, runt, XHCI_ERSTSZ(0), XHCI_ERSTS_SET(temp)); + /* Check if we should use the default IMOD value */ + if (sc->sc_imod_default == 0) + sc->sc_imod_default = XHCI_IMOD_DEFAULT; + /* Setup interrupt rate */ - XWRITE4(sc, runt, XHCI_IMOD(0), XHCI_IMOD_DEFAULT); + XWRITE4(sc, runt, XHCI_IMOD(0), sc->sc_imod_default); usbd_get_page(&sc->sc_hw.root_pc, 0, &buf_res); Modified: head/sys/dev/usb/controller/xhci.h ============================================================================== --- head/sys/dev/usb/controller/xhci.h Sun Apr 27 15:14:59 2014 (r265014) +++ head/sys/dev/usb/controller/xhci.h Sun Apr 27 15:41:44 2014 (r265015) @@ -481,6 +481,7 @@ struct xhci_softc { uint16_t sc_erst_max; uint16_t sc_event_idx; uint16_t sc_command_idx; + uint16_t sc_imod_default; uint8_t sc_event_ccs; uint8_t sc_command_ccs; Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Sun Apr 27 15:14:59 2014 (r265014) +++ head/sys/dev/usb/controller/xhci_pci.c Sun Apr 27 15:41:44 2014 (r265015) @@ -242,6 +242,7 @@ xhci_pci_attach(device_t self) case 0x1e318086: /* Panther Point */ case 0x8c318086: /* Lynx Point */ sc->sc_port_route = &xhci_pci_port_route; + sc->sc_imod_default = XHCI_IMOD_DEFAULT_LP; break; default: break; Modified: head/sys/dev/usb/controller/xhcireg.h ============================================================================== --- head/sys/dev/usb/controller/xhcireg.h Sun Apr 27 15:14:59 2014 (r265014) +++ head/sys/dev/usb/controller/xhcireg.h Sun Apr 27 15:41:44 2014 (r265015) @@ -166,7 +166,8 @@ #define XHCI_IMOD_IVAL_SET(x) (((x) & 0xFFFF) << 0) /* 250ns unit */ #define XHCI_IMOD_ICNT_GET(x) (((x) >> 16) & 0xFFFF) /* 250ns unit */ #define XHCI_IMOD_ICNT_SET(x) (((x) & 0xFFFF) << 16) /* 250ns unit */ -#define XHCI_IMOD_DEFAULT 0x000001F4U /* 8000 IRQ/second */ +#define XHCI_IMOD_DEFAULT 0x000001F4U /* 8000 IRQs/second */ +#define XHCI_IMOD_DEFAULT_LP 0x000003F8U /* 4000 IRQs/second - LynxPoint */ #define XHCI_ERSTSZ(n) (0x0028 + (0x20 * (n))) /* XHCI event ring segment table size */ #define XHCI_ERSTS_GET(x) ((x) & 0xFFFF) #define XHCI_ERSTS_SET(x) ((x) & 0xFFFF) From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 15:58:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2524915; Sun, 27 Apr 2014 15:58:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF1472E5; Sun, 27 Apr 2014 15:58:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RFw7Lq014246; Sun, 27 Apr 2014 15:58:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RFw71q014245; Sun, 27 Apr 2014 15:58:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201404271558.s3RFw71q014245@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 27 Apr 2014 15:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265016 - head/usr.sbin/bsdinstall/partedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 15:58:07 -0000 Author: nwhitehorn Date: Sun Apr 27 15:58:07 2014 New Revision: 265016 URL: http://svnweb.freebsd.org/changeset/base/265016 Log: Finish connecting up installer UEFI support. If the kernel was booted using EFI, set up the disks for an EFI system. If booted from BIOS/CSM, set up for BIOS. Modified: head/usr.sbin/bsdinstall/partedit/partedit_x86.c Modified: head/usr.sbin/bsdinstall/partedit/partedit_x86.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit_x86.c Sun Apr 27 15:41:44 2014 (r265015) +++ head/usr.sbin/bsdinstall/partedit/partedit_x86.c Sun Apr 27 15:58:07 2014 (r265016) @@ -32,8 +32,8 @@ #include "partedit.h" -static char platform[255] = "BIOS"; /* XXX once sysctl exists, make this an empty string */ -static const char *platform_sysctl = "hw.platform"; +static char platform[255] = ""; +static const char *platform_sysctl = "machdep.bootmethod"; const char * default_scheme(void) { @@ -82,7 +82,7 @@ bootpart_type(const char *scheme) { if (strlen(platform) == 0) sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); - if (strcmp(platform, "EFI") == 0) + if (strcmp(platform, "UEFI") == 0) return ("efi"); return ("freebsd-boot"); @@ -93,7 +93,7 @@ bootcode_path(const char *part_type) { size_t platlen = sizeof(platform); if (strlen(platform) == 0) sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); - if (strcmp(platform, "EFI") == 0) + if (strcmp(platform, "UEFI") == 0) return (NULL); if (strcmp(part_type, "GPT") == 0) @@ -113,7 +113,7 @@ partcode_path(const char *part_type) { sysctlbyname(platform_sysctl, platform, &platlen, NULL, -1); if (strcmp(part_type, "GPT") == 0) { - if (strcmp(platform, "EFI") == 0) + if (strcmp(platform, "UEFI") == 0) return ("/boot/boot1.efifat"); else return ("/boot/gptboot"); From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 16:35:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13F70162; Sun, 27 Apr 2014 16:35:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0079D896; Sun, 27 Apr 2014 16:35:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RGYxBS030289; Sun, 27 Apr 2014 16:34:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RGYx2W030288; Sun, 27 Apr 2014 16:34:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201404271634.s3RGYx2W030288@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 27 Apr 2014 16:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265017 - head/release/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 16:35:00 -0000 Author: nwhitehorn Date: Sun Apr 27 16:34:59 2014 New Revision: 265017 URL: http://svnweb.freebsd.org/changeset/base/265017 Log: loader's GPT support on BIOS does not seem to like the root filesystem being the last filesystem on the disk for some reason when made by this script. Add a vestigial swap partition to allow this to boot with QEMU BIOS. Modified: head/release/amd64/make-uefi-memstick.sh Modified: head/release/amd64/make-uefi-memstick.sh ============================================================================== --- head/release/amd64/make-uefi-memstick.sh Sun Apr 27 15:58:07 2014 (r265016) +++ head/release/amd64/make-uefi-memstick.sh Sun Apr 27 16:34:59 2014 (r265017) @@ -36,6 +36,6 @@ if [ $? -ne 0 ]; then fi rm ${1}/etc/fstab -mkimg -s gpt -b ${1}/boot/pmbr -p freebsd-boot:=${1}/boot/gptboot -p efi:=${1}/boot/boot1.efifat -p freebsd-ufs:=${2}.part -o ${2} +mkimg -s gpt -b ${1}/boot/pmbr -p efi:=${1}/boot/boot1.efifat -p freebsd-boot:=${1}/boot/gptboot -p freebsd-ufs:=${2}.part -p freebsd-swap::1M -o ${2} rm ${2}.part From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 16:40:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD4E942D; Sun, 27 Apr 2014 16:40:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A4B5905; Sun, 27 Apr 2014 16:40:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RGee5F031047; Sun, 27 Apr 2014 16:40:40 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RGeeab031046; Sun, 27 Apr 2014 16:40:40 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404271640.s3RGeeab031046@svn.freebsd.org> From: Glen Barber Date: Sun, 27 Apr 2014 16:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265018 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 16:40:40 -0000 Author: gjb Date: Sun Apr 27 16:40:40 2014 New Revision: 265018 URL: http://svnweb.freebsd.org/changeset/base/265018 Log: Turn off the full witness trace on console output. On head/, or more specifically, when WITNESS is in the kernel config, the console is spammed excessively with lock order reversal between isofs and devfs. Set debug.witness.trace=0 in the installer sysctl.conf to avoid printing the full KDB stack backtrace. This does not prevent printing the lock order reversal has happened, only lessens the console spam. Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Sun Apr 27 16:34:59 2014 (r265017) +++ head/release/Makefile Sun Apr 27 16:40:40 2014 (r265018) @@ -164,6 +164,7 @@ system: packagesystem ln -fs /tmp/bsdinstall_etc/resolv.conf release/etc/resolv.conf echo sendmail_enable=\"NONE\" > release/etc/rc.conf echo hostid_enable=\"NO\" >> release/etc/rc.conf + echo debug.witness.trace=0 >> release/etc/sysctl.conf cp ${.CURDIR}/rc.local release/etc touch ${.TARGET} @@ -188,6 +189,7 @@ bootonly: packagesystem ln -fs /tmp/bsdinstall_etc/resolv.conf bootonly/etc/resolv.conf echo sendmail_enable=\"NONE\" > bootonly/etc/rc.conf echo hostid_enable=\"NO\" >> bootonly/etc/rc.conf + echo debug.witness.trace=0 >> bootonly/etc/sysctl.conf cp ${.CURDIR}/rc.local bootonly/etc dvd: @@ -206,6 +208,7 @@ dvd: ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf + echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf cp ${.CURDIR}/rc.local ${.TARGET}/etc touch ${.TARGET} From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 17:41:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6002164; Sun, 27 Apr 2014 17:41:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1CACF73; Sun, 27 Apr 2014 17:41:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RHfIi3058371; Sun, 27 Apr 2014 17:41:18 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RHfIYF058370; Sun, 27 Apr 2014 17:41:18 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201404271741.s3RHfIYF058370@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sun, 27 Apr 2014 17:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265019 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 17:41:18 -0000 Author: melifaro Date: Sun Apr 27 17:41:18 2014 New Revision: 265019 URL: http://svnweb.freebsd.org/changeset/base/265019 Log: Improve memory allocation model for rt_msg2() rtsock messages: * memory is now allocated as early as possible, without holding locks. * sysctl users are now guaranteed to get a response (M_WAITOK buffer prealloc). * socket users are more likely to use on-stack buffer for replies. * standard kernel malloc/free functions are now used instead of radix wrappers. rt_msg2() has been renamed to rtsock_msg_buffer(). MFC after: 1 month Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sun Apr 27 16:40:40 2014 (r265018) +++ head/sys/net/rtsock.c Sun Apr 27 17:41:18 2014 (r265019) @@ -152,8 +152,8 @@ struct walkarg { static void rts_input(struct mbuf *m); static struct mbuf *rt_msg1(int type, struct rt_addrinfo *rtinfo); -static int rt_msg2(int type, struct rt_addrinfo *rtinfo, - caddr_t cp, struct walkarg *w); +static int rtsock_msg_buffer(int type, struct rt_addrinfo *rtinfo, + struct walkarg *w, int *plen); static int rt_xaddrs(caddr_t cp, caddr_t cplim, struct rt_addrinfo *rtinfo); static int sysctl_dumpentry(struct radix_node *rn, void *vw); @@ -526,11 +526,13 @@ route_output(struct mbuf *m, struct sock struct sockaddr_in6 *sin6; int i, rti_need_deembed = 0; #endif - int len, error = 0, fibnum; + int alloc_len = 0, len, error = 0, fibnum; struct ifnet *ifp = NULL; union sockaddr_union saun; sa_family_t saf = AF_UNSPEC; struct rawcb *rp = NULL; + struct walkarg w; + char msgbuf[512]; fibnum = so->so_fibnum; @@ -545,15 +547,31 @@ route_output(struct mbuf *m, struct sock len != mtod(m, struct rt_msghdr *)->rtm_msglen) senderr(EINVAL); - R_Malloc(rtm, struct rt_msghdr *, len); - if (rtm == NULL) - senderr(ENOBUFS); + /* + * Most of current messages are in range 200-240 bytes, + * minimize possible failures by using on-stack buffer + * which should fit for most messages. + * However, use stable memory if we need to handle + * something large. + */ + if (len < sizeof(msgbuf)) { + alloc_len = sizeof(msgbuf); + rtm = (struct rt_msghdr *)msgbuf; + } else { + alloc_len = roundup2(len, 1024); + rtm = malloc(alloc_len, M_TEMP, M_NOWAIT); + if (rtm == NULL) + senderr(ENOBUFS); + } + m_copydata(m, 0, len, (caddr_t)rtm); bzero(&info, sizeof(info)); + bzero(&w, sizeof(w)); if (rtm->rtm_version != RTM_VERSION) { /* Do not touch message since format is unknown */ - Free(rtm); + if ((char *)rtm != msgbuf) + free(rtm, M_TEMP); rtm = NULL; senderr(EPROTONOSUPPORT); } @@ -798,18 +816,26 @@ report: } else if ((ifp = rt->rt_ifp) != NULL) { rtm->rtm_index = ifp->if_index; } - len = rt_msg2(rtm->rtm_type, &info, NULL, NULL); - if (len > rtm->rtm_msglen) { + + /* Check if we need to realloc storage */ + rtsock_msg_buffer(rtm->rtm_type, &info, NULL, &len); + if (len > alloc_len) { struct rt_msghdr *new_rtm; - R_Malloc(new_rtm, struct rt_msghdr *, len); + new_rtm = malloc(len, M_TEMP, M_NOWAIT); if (new_rtm == NULL) { RT_UNLOCK(rt); senderr(ENOBUFS); } bcopy(rtm, new_rtm, rtm->rtm_msglen); - Free(rtm); rtm = new_rtm; + free(rtm, M_TEMP); + rtm = new_rtm; + alloc_len = len; } - (void)rt_msg2(rtm->rtm_type, &info, (caddr_t)rtm, NULL); + + w.w_tmem = (caddr_t)rtm; + w.w_tmemsize = alloc_len; + rtsock_msg_buffer(rtm->rtm_type, &info, &w, &len); + if (rt->rt_flags & RTF_GWFLAG_COMPAT) rtm->rtm_flags = RTF_GATEWAY | (rt->rt_flags & ~RTF_GWFLAG_COMPAT); @@ -833,8 +859,8 @@ flush: */ if ((so->so_options & SO_USELOOPBACK) == 0) { if (V_route_cb.any_count <= 1) { - if (rtm != NULL) - Free(rtm); + if (rtm != NULL && (char *)rtm != msgbuf) + free(rtm, M_TEMP); m_freem(m); return (error); } @@ -870,7 +896,9 @@ flush: m = NULL; } else if (m->m_pkthdr.len > rtm->rtm_msglen) m_adj(m, rtm->rtm_msglen - m->m_pkthdr.len); - Free(rtm); + + if ((char *)rtm != msgbuf) + free(rtm, M_TEMP); } if (m != NULL) { M_SETFIB(m, fibnum); @@ -1041,21 +1069,26 @@ rt_msg1(int type, struct rt_addrinfo *rt } /* - * Used by the sysctl code and routing socket. + * Writes information related to @rtinfo object to preallocated buffer. + * Stores needed size in @plen. If @w is NULL, calculates size without + * writing. + * Used for sysctl dumps and rtsock answers (RTM_DEL/RTM_GET) generation. + * + * Returns 0 on success. + * */ static int -rt_msg2(int type, struct rt_addrinfo *rtinfo, caddr_t cp, struct walkarg *w) +rtsock_msg_buffer(int type, struct rt_addrinfo *rtinfo, struct walkarg *w, int *plen) { int i; - int len, dlen, second_time = 0; - caddr_t cp0; + int len, buflen = 0, dlen; + caddr_t cp; + struct rt_msghdr *rtm = NULL; #ifdef INET6 struct sockaddr_storage ss; struct sockaddr_in6 *sin6; #endif - rtinfo->rti_addrs = 0; -again: switch (type) { case RTM_DELADDR: @@ -1094,9 +1127,14 @@ again: default: len = sizeof(struct rt_msghdr); } - cp0 = cp; - if (cp0) - cp += len; + + if (w != NULL) { + rtm = (struct rt_msghdr *)w->w_tmem; + buflen = w->w_tmemsize - len; + cp = (caddr_t)w->w_tmem + len; + } + + rtinfo->rti_addrs = 0; for (i = 0; i < RTAX_MAX; i++) { struct sockaddr *sa; @@ -1104,7 +1142,7 @@ again: continue; rtinfo->rti_addrs |= (1 << i); dlen = SA_SIZE(sa); - if (cp) { + if (cp != NULL && buflen >= dlen) { #ifdef INET6 if (V_deembed_scopeid && sa->sa_family == AF_INET6) { sin6 = (struct sockaddr_in6 *)&ss; @@ -1115,37 +1153,40 @@ again: #endif bcopy((caddr_t)sa, cp, (unsigned)dlen); cp += dlen; + buflen -= dlen; + } else if (cp != NULL) { + /* + * Buffer too small. Count needed size + * and return with error. + */ + cp = NULL; } + len += dlen; } - len = ALIGN(len); - if (cp == NULL && w != NULL && !second_time) { - struct walkarg *rw = w; - if (rw->w_req) { - if (rw->w_tmemsize < len) { - if (rw->w_tmem) - free(rw->w_tmem, M_RTABLE); - rw->w_tmem = (caddr_t) - malloc(len, M_RTABLE, M_NOWAIT); - if (rw->w_tmem) - rw->w_tmemsize = len; - } - if (rw->w_tmem) { - cp = rw->w_tmem; - second_time = 1; - goto again; - } - } + if (cp != NULL) { + dlen = ALIGN(len) - len; + if (buflen < dlen) + cp = NULL; + else + buflen -= dlen; } - if (cp) { - struct rt_msghdr *rtm = (struct rt_msghdr *)cp0; + len = ALIGN(len); + if (cp != NULL) { + /* fill header iff buffer is large enough */ rtm->rtm_version = RTM_VERSION; rtm->rtm_type = type; rtm->rtm_msglen = len; } - return (len); + + *plen = len; + + if (w != NULL && cp == NULL) + return (ENOBUFS); + + return (0); } /* @@ -1473,7 +1514,8 @@ sysctl_dumpentry(struct radix_node *rn, if (rt->rt_ifp->if_flags & IFF_POINTOPOINT) info.rti_info[RTAX_BRD] = rt->rt_ifa->ifa_dstaddr; } - size = rt_msg2(RTM_GET, &info, NULL, w); + if ((error = rtsock_msg_buffer(RTM_GET, &info, w, &size)) != 0) + return (error); if (w->w_req && w->w_tmem) { struct rt_msghdr *rtm = (struct rt_msghdr *)w->w_tmem; @@ -1649,7 +1691,9 @@ sysctl_iflist(int af, struct walkarg *w) IF_ADDR_RLOCK(ifp); ifa = ifp->if_addr; info.rti_info[RTAX_IFP] = ifa->ifa_addr; - len = rt_msg2(RTM_IFINFO, &info, NULL, w); + error = rtsock_msg_buffer(RTM_IFINFO, &info, w, &len); + if (error != 0) + goto done; info.rti_info[RTAX_IFP] = NULL; if (w->w_req && w->w_tmem) { if (w->w_op == NET_RT_IFLISTL) @@ -1668,7 +1712,9 @@ sysctl_iflist(int af, struct walkarg *w) info.rti_info[RTAX_IFA] = ifa->ifa_addr; info.rti_info[RTAX_NETMASK] = ifa->ifa_netmask; info.rti_info[RTAX_BRD] = ifa->ifa_dstaddr; - len = rt_msg2(RTM_NEWADDR, &info, NULL, w); + error = rtsock_msg_buffer(RTM_NEWADDR, &info, w, &len); + if (error != 0) + goto done; if (w->w_req && w->w_tmem) { if (w->w_op == NET_RT_IFLISTL) error = sysctl_iflist_ifaml(ifa, &info, @@ -1718,7 +1764,9 @@ sysctl_ifmalist(int af, struct walkarg * info.rti_info[RTAX_GATEWAY] = (ifma->ifma_addr->sa_family != AF_LINK) ? ifma->ifma_lladdr : NULL; - len = rt_msg2(RTM_NEWMADDR, &info, NULL, w); + error = rtsock_msg_buffer(RTM_NEWADDR, &info, w, &len); + if (error != 0) + goto done; if (w->w_req && w->w_tmem) { struct ifma_msghdr *ifmam; @@ -1778,6 +1826,14 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS) error = sysctl_wire_old_buffer(req, 0); if (error) return (error); + + /* + * Allocate reply buffer in advance. + * All rtsock messages has maximum length of u_short. + */ + w.w_tmemsize = 65536; + w.w_tmem = malloc(w.w_tmemsize, M_TEMP, M_WAITOK); + switch (w.w_op) { case NET_RT_DUMP: @@ -1824,8 +1880,8 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS) error = sysctl_ifmalist(af, &w); break; } - if (w.w_tmem) - free(w.w_tmem, M_RTABLE); + + free(w.w_tmem, M_TEMP); return (error); } From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 18:12:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D5E176A; Sun, 27 Apr 2014 18:12:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A3851209; Sun, 27 Apr 2014 18:12:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RICuoY071516; Sun, 27 Apr 2014 18:12:56 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RICunl071515; Sun, 27 Apr 2014 18:12:56 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404271812.s3RICunl071515@svn.freebsd.org> From: Ian Lepore Date: Sun, 27 Apr 2014 18:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265020 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 18:12:56 -0000 Author: ian Date: Sun Apr 27 18:12:55 2014 New Revision: 265020 URL: http://svnweb.freebsd.org/changeset/base/265020 Log: Remove cpu_idcache_wbinv_all() from kdb_cpu_trap(), it's no longer needed. This was added ca. 2004 for the purpose of ensuring the caches were in the right state after the debugger set a breakpoint. kdb_cpu_sync_icache() was added in 2007 to handle that situation, and now the wbinv_all is actually harmful because the operation isn't broadcast to other cores. Modified: head/sys/arm/include/kdb.h Modified: head/sys/arm/include/kdb.h ============================================================================== --- head/sys/arm/include/kdb.h Sun Apr 27 17:41:18 2014 (r265019) +++ head/sys/arm/include/kdb.h Sun Apr 27 18:12:55 2014 (r265020) @@ -55,8 +55,6 @@ kdb_cpu_sync_icache(unsigned char *addr, static __inline void kdb_cpu_trap(int type, int code) { - - cpu_idcache_wbinv_all(); } #endif /* _MACHINE_KDB_H_ */ From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 20:02:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 283A9F43; Sun, 27 Apr 2014 20:02:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13D3A1A4B; Sun, 27 Apr 2014 20:02:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RK1x06019017; Sun, 27 Apr 2014 20:01:59 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RK1xtk019014; Sun, 27 Apr 2014 20:01:59 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404272001.s3RK1xtk019014@svn.freebsd.org> From: Ian Lepore Date: Sun, 27 Apr 2014 20:01:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265023 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 20:02:00 -0000 Author: ian Date: Sun Apr 27 20:01:59 2014 New Revision: 265023 URL: http://svnweb.freebsd.org/changeset/base/265023 Log: There is no difference between IPI_STOP and IPI_STOP_HARD on ARM, so map them both to the same interrupt number like other arches do. Modified: head/sys/arm/arm/mp_machdep.c head/sys/arm/include/smp.h Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Sun Apr 27 19:00:14 2014 (r265022) +++ head/sys/arm/arm/mp_machdep.c Sun Apr 27 20:01:59 2014 (r265023) @@ -278,7 +278,6 @@ ipi_handler(void *arg) break; case IPI_STOP: - case IPI_STOP_HARD: /* * IPI_STOP_HARD is mapped to IPI_STOP so it is not * necessary to add it in the switch. Modified: head/sys/arm/include/smp.h ============================================================================== --- head/sys/arm/include/smp.h Sun Apr 27 19:00:14 2014 (r265022) +++ head/sys/arm/include/smp.h Sun Apr 27 20:01:59 2014 (r265023) @@ -10,7 +10,7 @@ #define IPI_PREEMPT 2 #define IPI_RENDEZVOUS 3 #define IPI_STOP 4 -#define IPI_STOP_HARD 5 +#define IPI_STOP_HARD 4 #define IPI_HARDCLOCK 6 #define IPI_TLB 7 From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 20:16:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BC751A2; Sun, 27 Apr 2014 20:16:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EA291B18; Sun, 27 Apr 2014 20:16:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RKGprt023606; Sun, 27 Apr 2014 20:16:51 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RKGpMi023604; Sun, 27 Apr 2014 20:16:51 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404272016.s3RKGpMi023604@svn.freebsd.org> From: Ian Lepore Date: Sun, 27 Apr 2014 20:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265024 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 20:16:52 -0000 Author: ian Date: Sun Apr 27 20:16:51 2014 New Revision: 265024 URL: http://svnweb.freebsd.org/changeset/base/265024 Log: Flush and invalidate caches on each CPU as part of handling IPI_STOP. Flushing the caches is required before doing a panic dump, but ARM doesn't provide a flavor of flush that gets broadcast to other cores. However, all cores except one are stopped before doing a dump, so this works around the lack of a global flush/invalidate by doing it locally on each CPU as part of stopping. Discussed with: cognet@ Modified: head/sys/arm/arm/minidump_machdep.c head/sys/arm/arm/mp_machdep.c Modified: head/sys/arm/arm/minidump_machdep.c ============================================================================== --- head/sys/arm/arm/minidump_machdep.c Sun Apr 27 20:01:59 2014 (r265023) +++ head/sys/arm/arm/minidump_machdep.c Sun Apr 27 20:16:51 2014 (r265024) @@ -210,7 +210,15 @@ minidumpsys(struct dumperinfo *di) int i, k, bit, error; char *addr; - /* Flush cache */ + /* + * Flush caches. Note that in the SMP case this operates only on the + * current CPU's L1 cache. Before we reach this point, code in either + * the system shutdown or kernel debugger has called stop_cpus() to stop + * all cores other than this one. Part of the ARM handling of + * stop_cpus() is to call wbinv_all() on that core's local L1 cache. So + * by time we get to here, all that remains is to flush the L1 for the + * current CPU, then the L2. + */ cpu_idcache_wbinv_all(); cpu_l2cache_wbinv_all(); Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Sun Apr 27 20:01:59 2014 (r265023) +++ head/sys/arm/arm/mp_machdep.c Sun Apr 27 20:16:51 2014 (r265024) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -286,6 +287,19 @@ ipi_handler(void *arg) savectx(&stoppcbs[cpu]); + /* + * CPUs are stopped when entering the debugger and at + * system shutdown, both events which can precede a + * panic dump. For the dump to be correct, all caches + * must be flushed and invalidated, but on ARM there's + * no way to broadcast a wbinv_all to other cores. + * Instead, we have each core do the local wbinv_all as + * part of stopping the core. The core requesting the + * stop will do the l2 cache flush after all other cores + * have done their l1 flushes and stopped. + */ + cpu_idcache_wbinv_all(); + /* Indicate we are stopped */ CPU_SET_ATOMIC(cpu, &stopped_cpus); From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 20:26:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D12F4F2; Sun, 27 Apr 2014 20:26:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09C421BEF; Sun, 27 Apr 2014 20:26:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RKQFfK027779; Sun, 27 Apr 2014 20:26:15 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RKQFjx027778; Sun, 27 Apr 2014 20:26:15 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404272026.s3RKQFjx027778@svn.freebsd.org> From: Ian Lepore Date: Sun, 27 Apr 2014 20:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265025 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 20:26:16 -0000 Author: ian Date: Sun Apr 27 20:26:15 2014 New Revision: 265025 URL: http://svnweb.freebsd.org/changeset/base/265025 Log: Explain why wbinv_all is SMP-safe in this case, and add a missing l2 cache flush. (Either it was missing here, or it isn't needed in the minidump case. Adding it here seems like the safer path to consistancy.) Modified: head/sys/arm/arm/dump_machdep.c Modified: head/sys/arm/arm/dump_machdep.c ============================================================================== --- head/sys/arm/arm/dump_machdep.c Sun Apr 27 20:16:51 2014 (r265024) +++ head/sys/arm/arm/dump_machdep.c Sun Apr 27 20:26:15 2014 (r265025) @@ -174,8 +174,14 @@ cb_dumpdata(struct md_pa *mdp, int seqnr printf(" chunk %d: %dMB (%d pages)", seqnr, pgs * PAGE_SIZE / ( 1024*1024), pgs); - /* Make sure we write coherent datas. */ + /* + * Make sure we write coherent data. Note that in the SMP case this + * only operates on the L1 cache of the current CPU, but all other CPUs + * have already been stopped, and their flush/invalidate was done as + * part of stopping. + */ cpu_idcache_wbinv_all(); + cpu_l2cache_wbinv_all(); #ifdef __XSCALE__ xscale_cache_clean_minidata(); #endif From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 20:36:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DC6096E; Sun, 27 Apr 2014 20:36:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A0091CA3; Sun, 27 Apr 2014 20:36:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RKaKkZ032078; Sun, 27 Apr 2014 20:36:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RKaKTY032077; Sun, 27 Apr 2014 20:36:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201404272036.s3RKaKTY032077@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 27 Apr 2014 20:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265026 - head/sys/dev/vt/hw/vga X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 20:36:20 -0000 Author: nwhitehorn Date: Sun Apr 27 20:36:19 2014 New Revision: 265026 URL: http://svnweb.freebsd.org/changeset/base/265026 Log: No EFI on i386. This unbreaks the i386 VT kernel build. Modified: head/sys/dev/vt/hw/vga/vga.c Modified: head/sys/dev/vt/hw/vga/vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vga.c Sun Apr 27 20:26:15 2014 (r265025) +++ head/sys/dev/vt/hw/vga/vga.c Sun Apr 27 20:36:19 2014 (r265026) @@ -638,7 +638,7 @@ vga_init(struct vt_device *vd) struct vga_softc *sc = vd->vd_softc; int textmode = 0; -#if defined(__amd64__) || defined(__i386__) +#if defined(__amd64__) /* Disable if EFI framebuffer present. Should be handled by priority * logic in vt(9), but this will do for now. XXX */ From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 21:00:56 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A14E4CEB; Sun, 27 Apr 2014 21:00:56 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 743791E57; Sun, 27 Apr 2014 21:00:56 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WeWBz-00068O-5G; Sun, 27 Apr 2014 21:00:55 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s3RL0rTA014200; Sun, 27 Apr 2014 15:00:53 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19uV2COArGqmQA/FKUAsGGR Subject: Re: svn commit: r265019 - head/sys/net From: Ian Lepore To: "Alexander V. Chernikov" In-Reply-To: <201404271741.s3RHfIYF058370@svn.freebsd.org> References: <201404271741.s3RHfIYF058370@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Sun, 27 Apr 2014 15:00:53 -0600 Message-ID: <1398632453.61646.182.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 21:00:56 -0000 On Sun, 2014-04-27 at 17:41 +0000, Alexander V. Chernikov wrote: > Author: melifaro > Date: Sun Apr 27 17:41:18 2014 > New Revision: 265019 > URL: http://svnweb.freebsd.org/changeset/base/265019 > > Log: > Improve memory allocation model for rt_msg2() rtsock messages: > * memory is now allocated as early as possible, without holding locks. > * sysctl users are now guaranteed to get a response (M_WAITOK buffer prealloc). > * socket users are more likely to use on-stack buffer for replies. > * standard kernel malloc/free functions are now used instead of radix wrappers. > rt_msg2() has been renamed to rtsock_msg_buffer(). > > MFC after: 1 month > > Modified: > head/sys/net/rtsock.c > > Modified: head/sys/net/rtsock.c > [...] You're on a roll this weekend. :) I got another uninit-var warning today -- I worked around it with this, but I'm not sure it's the right way to fix it: revolution > sd sys/net/rtsock.c Index: sys/net/rtsock.c =================================================================== --- sys/net/rtsock.c (revision 265026) +++ sys/net/rtsock.c (working copy) @@ -1132,7 +1132,8 @@ rtsock_msg_buffer(int type, struct rt_addrinfo *rt rtm = (struct rt_msghdr *)w->w_tmem; buflen = w->w_tmemsize - len; cp = (caddr_t)w->w_tmem + len; - } + } else + cp = NULL; rtinfo->rti_addrs = 0; for (i = 0; i < RTAX_MAX; i++) { -- Ian From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 21:17:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E0C6105; Sun, 27 Apr 2014 21:17:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE95B104; Sun, 27 Apr 2014 21:17:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RLHsvV048716; Sun, 27 Apr 2014 21:17:54 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RLHsAc048715; Sun, 27 Apr 2014 21:17:54 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201404272117.s3RLHsAc048715@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sun, 27 Apr 2014 21:17:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265027 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 21:17:55 -0000 Author: melifaro Date: Sun Apr 27 21:17:54 2014 New Revision: 265027 URL: http://svnweb.freebsd.org/changeset/base/265027 Log: Fix build Found by: ian Pointyhat to: me Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sun Apr 27 20:36:19 2014 (r265026) +++ head/sys/net/rtsock.c Sun Apr 27 21:17:54 2014 (r265027) @@ -1082,7 +1082,7 @@ rtsock_msg_buffer(int type, struct rt_ad { int i; int len, buflen = 0, dlen; - caddr_t cp; + caddr_t cp = NULL; struct rt_msghdr *rtm = NULL; #ifdef INET6 struct sockaddr_storage ss; From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 21:22:49 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD75B283; Sun, 27 Apr 2014 21:22:49 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F48319D; Sun, 27 Apr 2014 21:22:49 +0000 (UTC) Received: from secured.by.ipfw.ru ([95.143.220.47] helo=ws.su29.net) by mail.ipfw.ru with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1WeSdg-000AB9-R6; Sun, 27 Apr 2014 21:13:16 +0400 Message-ID: <535D7500.9020808@FreeBSD.org> Date: Mon, 28 Apr 2014 01:22:08 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r265019 - head/sys/net References: <201404271741.s3RHfIYF058370@svn.freebsd.org> <1398632453.61646.182.camel@revolution.hippie.lan> In-Reply-To: <1398632453.61646.182.camel@revolution.hippie.lan> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 21:22:49 -0000 On 28.04.2014 01:00, Ian Lepore wrote: > On Sun, 2014-04-27 at 17:41 +0000, Alexander V. Chernikov wrote: >> Author: melifaro >> Date: Sun Apr 27 17:41:18 2014 >> New Revision: 265019 >> URL: http://svnweb.freebsd.org/changeset/base/265019 >> >> Log: >> Improve memory allocation model for rt_msg2() rtsock messages: >> * memory is now allocated as early as possible, without holding locks. >> * sysctl users are now guaranteed to get a response (M_WAITOK buffer prealloc). >> * socket users are more likely to use on-stack buffer for replies. >> * standard kernel malloc/free functions are now used instead of radix wrappers. >> rt_msg2() has been renamed to rtsock_msg_buffer(). >> >> MFC after: 1 month >> >> Modified: >> head/sys/net/rtsock.c >> >> Modified: head/sys/net/rtsock.c >> [...] > > You're on a roll this weekend. :) I got another uninit-var warning > today -- I worked around it with this, but I'm not sure it's the right > way to fix it: Fixed. Thanks again. It looks like something wrong has happened to my clang setup.. > > revolution > sd sys/net/rtsock.c > Index: sys/net/rtsock.c > =================================================================== > --- sys/net/rtsock.c (revision 265026) > +++ sys/net/rtsock.c (working copy) > @@ -1132,7 +1132,8 @@ rtsock_msg_buffer(int type, struct rt_addrinfo *rt > rtm = (struct rt_msghdr *)w->w_tmem; > buflen = w->w_tmemsize - len; > cp = (caddr_t)w->w_tmem + len; > - } > + } else > + cp = NULL; > > rtinfo->rti_addrs = 0; > for (i = 0; i < RTAX_MAX; i++) { > > > -- Ian > > > From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 22:18:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74E3CABB; Sun, 27 Apr 2014 22:18:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 475967B6; Sun, 27 Apr 2014 22:18:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RMIY10073055; Sun, 27 Apr 2014 22:18:34 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RMIXj9073052; Sun, 27 Apr 2014 22:18:33 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201404272218.s3RMIXj9073052@svn.freebsd.org> From: Devin Teske Date: Sun, 27 Apr 2014 22:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265028 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 22:18:34 -0000 Author: dteske Date: Sun Apr 27 22:18:33 2014 New Revision: 265028 URL: http://svnweb.freebsd.org/changeset/base/265028 Log: Disable the beastie menu for EFI console which doesn't support ANSI codes (so things like `at-xy', `clear', and other commands don't work making it impossible to generate a living menu). Reviewed by: nwhitehorn, emaste Modified: head/sys/boot/forth/beastie.4th head/sys/boot/forth/beastie.4th.8 head/sys/boot/forth/loader.conf.5 Modified: head/sys/boot/forth/beastie.4th ============================================================================== --- head/sys/boot/forth/beastie.4th Sun Apr 27 21:17:54 2014 (r265027) +++ head/sys/boot/forth/beastie.4th Sun Apr 27 22:18:33 2014 (r265028) @@ -242,6 +242,11 @@ variable logoY ; : beastie-start ( -- ) \ starts the menu + s" console" getenv dup -1 <> if + s" efi" 2swap contains? if + s" set beastie_disable=YES" evaluate + then + else drop then s" beastie_disable" getenv dup -1 <> if s" YES" compare-insensitive 0= if Modified: head/sys/boot/forth/beastie.4th.8 ============================================================================== --- head/sys/boot/forth/beastie.4th.8 Sun Apr 27 21:17:54 2014 (r265027) +++ head/sys/boot/forth/beastie.4th.8 Sun Apr 27 22:18:33 2014 (r265028) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2011 +.Dd April 27, 2014 .Dt BEASTIE.4TH 8 .Os .Sh NAME @@ -119,6 +119,8 @@ Sets the desired row position of the log If set to .Dq YES , the beastie boot menu will be skipped. +The beastie boot menu is always skipped if booting UEFI or running non-x86 +hardware. .It Va loader_delay If set to a number higher than zero, introduces a delay before starting the beastie boot menu. During the delay the user can press either Ctrl-C to skip Modified: head/sys/boot/forth/loader.conf.5 ============================================================================== --- head/sys/boot/forth/loader.conf.5 Sun Apr 27 21:17:54 2014 (r265027) +++ head/sys/boot/forth/loader.conf.5 Sun Apr 27 22:18:33 2014 (r265028) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd October 18, 2013 +.Dd April 27, 2014 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -236,6 +236,8 @@ be displayed. If set to .Dq YES , the beastie boot menu will be skipped. +The beastie boot menu is always skipped if booting UEFI or running non-x86 +hardware. .It Va loader_logo Pq Dq Li orbbw Selects a desired logo in the beastie boot menu. Possible values are: From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 23:31:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D71A27D; Sun, 27 Apr 2014 23:31:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AB09CFE; Sun, 27 Apr 2014 23:31:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RNVhhf004537; Sun, 27 Apr 2014 23:31:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RNVhp4004535; Sun, 27 Apr 2014 23:31:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404272331.s3RNVhp4004535@svn.freebsd.org> From: Adrian Chadd Date: Sun, 27 Apr 2014 23:31:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265029 - head/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 23:31:43 -0000 Author: adrian Date: Sun Apr 27 23:31:42 2014 New Revision: 265029 URL: http://svnweb.freebsd.org/changeset/base/265029 Log: Do a read-after-write to ensure the interrupt register update is flushed to the hardware. The QCA HAL has a comment noting that if this isn't done, modifications to AR_IMR_S2 before AR_IMR is flushed may produce spurious interrupts. Obtained from: QCA Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Sun Apr 27 22:18:33 2014 (r265028) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Sun Apr 27 23:31:42 2014 (r265029) @@ -337,6 +337,9 @@ ar5416SetInterrupts(struct ath_hal *ah, /* Write the new IMR and store off our SW copy. */ HALDEBUG(ah, HAL_DEBUG_INTERRUPT, "%s: new IMR 0x%x\n", __func__, mask); OS_REG_WRITE(ah, AR_IMR, mask); + /* Flush write */ + (void) OS_REG_READ(ah, AR_IMR); + mask = OS_REG_READ(ah, AR_IMR_S2) & ~(AR_IMR_S2_TIM | AR_IMR_S2_DTIM | AR_IMR_S2_DTIMSYNC | From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 23:33:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F28193CE; Sun, 27 Apr 2014 23:33:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF860D0B; Sun, 27 Apr 2014 23:33:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RNXbMj004830; Sun, 27 Apr 2014 23:33:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RNXbYR004829; Sun, 27 Apr 2014 23:33:37 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404272333.s3RNXbYR004829@svn.freebsd.org> From: Adrian Chadd Date: Sun, 27 Apr 2014 23:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265030 - head/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 23:33:38 -0000 Author: adrian Date: Sun Apr 27 23:33:37 2014 New Revision: 265030 URL: http://svnweb.freebsd.org/changeset/base/265030 Log: Fix the AR_SLEEP1 and AR_SLEEP2 definitions. Oops! Tested: * AR9285, STA * AR5416, STA Obtained from: QCA, Linux ath9k Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Sun Apr 27 23:31:42 2014 (r265029) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Sun Apr 27 23:33:37 2014 (r265030) @@ -476,10 +476,10 @@ /* Sleep control */ #define AR5416_SLEEP1_ASSUME_DTIM 0x00080000 #define AR5416_SLEEP1_CAB_TIMEOUT 0xFFE00000 /* Cab timeout (TU) */ -#define AR5416_SLEEP1_CAB_TIMEOUT_S 22 +#define AR5416_SLEEP1_CAB_TIMEOUT_S 21 #define AR5416_SLEEP2_BEACON_TIMEOUT 0xFFE00000 /* Beacon timeout (TU)*/ -#define AR5416_SLEEP2_BEACON_TIMEOUT_S 22 +#define AR5416_SLEEP2_BEACON_TIMEOUT_S 21 /* Sleep Registers */ #define AR_SLP32_HALFCLK_LATENCY 0x000FFFFF /* rising <-> falling edge */ From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 23:35:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6A60511; Sun, 27 Apr 2014 23:35:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A7CED12; Sun, 27 Apr 2014 23:35:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RNZ5Kp005054; Sun, 27 Apr 2014 23:35:05 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RNZ5hu005053; Sun, 27 Apr 2014 23:35:05 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404272335.s3RNZ5hu005053@svn.freebsd.org> From: Adrian Chadd Date: Sun, 27 Apr 2014 23:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265031 - head/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 23:35:05 -0000 Author: adrian Date: Sun Apr 27 23:35:05 2014 New Revision: 265031 URL: http://svnweb.freebsd.org/changeset/base/265031 Log: Program the AR_TSFOOR_THRESHOLD register with a default lifted from the QCA HAL. This fires off an interrupt if the TSF from the AP / IBSS peer is wildly out of range. I'll add some code to the ath(4) driver soon which makes use of this. TODO: * verify this didn't break TDMA! Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Sun Apr 27 23:33:37 2014 (r265030) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Sun Apr 27 23:35:05 2014 (r265031) @@ -197,6 +197,25 @@ ar5416SetStaBeaconTimers(struct ath_hal * beacon jitter; cab timeout is max time to wait for cab * after seeing the last DTIM or MORE CAB bit */ + +/* + * I've bumped these to 30TU for now. + * + * Some APs (AR933x/AR934x?) in 2GHz especially seem to not always + * transmit beacon frames at exactly the right times and with it set + * to 10TU, the NIC starts not waking up at the right times to hear + * these slightly-larger-jitering beacons. It also never recovers + * from that (it doesn't resync? I'm not sure.) + * + * So for now bump this to 30TU. Ideally we'd cap this based on + * the beacon interval so the sum of CAB+BEACON timeouts never + * exceeded the beacon interval. + * + * Now, since we're doing all the math in the ath(4) driver in TU + * rather than TSF, we may be seeing the result of dumb rounding + * errors causing the jitter to actually be a much bigger problem. + * I'll have to investigate that with a fine tooth comb. + */ #define CAB_TIMEOUT_VAL 10 /* in TU */ #define BEACON_TIMEOUT_VAL 10 /* in TU */ #define SLEEP_SLOP 3 /* in TU */ @@ -248,6 +267,13 @@ ar5416SetStaBeaconTimers(struct ath_hal OS_REG_SET_BIT(ah, AR_TIMER_MODE, AR_TIMER_MODE_TBTT | AR_TIMER_MODE_TIM | AR_TIMER_MODE_DTIM); + +#define HAL_TSFOOR_THRESHOLD 0x00004240 /* TSF OOR threshold (16k us) */ + + /* TSF out of range threshold */ +// OS_REG_WRITE(ah, AR_TSFOOR_THRESHOLD, bs->bs_tsfoor_threshold); + OS_REG_WRITE(ah, AR_TSFOOR_THRESHOLD, HAL_TSFOOR_THRESHOLD); + HALDEBUG(ah, HAL_DEBUG_BEACON, "%s: next DTIM %d\n", __func__, bs->bs_nextdtim); HALDEBUG(ah, HAL_DEBUG_BEACON, "%s: next beacon %d\n", From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 23:36:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2CA864E; Sun, 27 Apr 2014 23:36:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 929C6D21; Sun, 27 Apr 2014 23:36:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RNajDR005258; Sun, 27 Apr 2014 23:36:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RNajkC005254; Sun, 27 Apr 2014 23:36:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404272336.s3RNajkC005254@svn.freebsd.org> From: Adrian Chadd Date: Sun, 27 Apr 2014 23:36:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265032 - head/sys/dev/ath/ath_hal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 23:36:45 -0000 Author: adrian Date: Sun Apr 27 23:36:44 2014 New Revision: 265032 URL: http://svnweb.freebsd.org/changeset/base/265032 Log: * Add a new capability which returns whether the hardware supports the MYBEACON RX filter (only receive beacons which match the BSSID) or all beacons on the current channel. * Add the relevant RX filter entry for MYBEACON. Tested: * AR5416, STA * AR9285, STA TODO: * once the code is in -HEAD, just make sure that the code which uses it correctly sets BEACON for pre-AR5416 chips. Obtained from: QCA, Linux ath9k Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Sun Apr 27 23:35:05 2014 (r265031) +++ head/sys/dev/ath/ath_hal/ah.c Sun Apr 27 23:36:44 2014 (r265032) @@ -786,6 +786,8 @@ ath_hal_getcapability(struct ath_hal *ah return HAL_OK; case HAL_CAP_RX_LNA_MIXING: /* Hardware uses an RX LNA mixer to map 2 antennas to a 1 stream receiver */ return pCap->halRxUsingLnaMixing ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_DO_MYBEACON: /* Hardware supports filtering my-beacons */ + return pCap->halRxDoMyBeacon ? HAL_OK : HAL_ENOTSUPP; default: return HAL_EINVAL; } Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Sun Apr 27 23:35:05 2014 (r265031) +++ head/sys/dev/ath/ath_hal/ah.h Sun Apr 27 23:36:44 2014 (r265032) @@ -199,6 +199,7 @@ typedef enum { HAL_CAP_SERIALISE_WAR = 245, /* serialise register access on PCI */ HAL_CAP_ENFORCE_TXOP = 246, /* Enforce TXOP if supported */ HAL_CAP_RX_LNA_MIXING = 247, /* RX hardware uses LNA mixing */ + HAL_CAP_DO_MYBEACON = 248, /* Supports HAL_RX_FILTER_MYBEACON */ } HAL_CAPABILITY_TYPE; /* @@ -404,6 +405,7 @@ typedef enum { HAL_RX_FILTER_PROM = 0x00000020, /* Promiscuous mode */ HAL_RX_FILTER_PROBEREQ = 0x00000080, /* Allow probe request frames */ HAL_RX_FILTER_PHYERR = 0x00000100, /* Allow phy errors */ + HAL_RX_FILTER_MYBEACON = 0x00000200, /* Filter beacons other than mine */ HAL_RX_FILTER_COMPBAR = 0x00000400, /* Allow compressed BAR */ HAL_RX_FILTER_COMP_BA = 0x00000800, /* Allow compressed blockack */ HAL_RX_FILTER_PHYRADAR = 0x00002000, /* Allow phy radar errors */ Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Sun Apr 27 23:35:05 2014 (r265031) +++ head/sys/dev/ath/ath_hal/ah_internal.h Sun Apr 27 23:36:44 2014 (r265032) @@ -280,7 +280,8 @@ typedef struct { halAntDivCombSupportOrg : 1, halRadioRetentionSupport : 1, halSpectralScanSupport : 1, - halRxUsingLnaMixing : 1; + halRxUsingLnaMixing : 1, + halRxDoMyBeacon : 1; uint32_t halWirelessModes; uint16_t halTotalQueues; From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 23:37:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA33C78D; Sun, 27 Apr 2014 23:37:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96C56D2B; Sun, 27 Apr 2014 23:37:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RNb34W005335; Sun, 27 Apr 2014 23:37:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RNb3w9005334; Sun, 27 Apr 2014 23:37:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404272337.s3RNb3w9005334@svn.freebsd.org> From: Adrian Chadd Date: Sun, 27 Apr 2014 23:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265033 - head/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 23:37:03 -0000 Author: adrian Date: Sun Apr 27 23:37:03 2014 New Revision: 265033 URL: http://svnweb.freebsd.org/changeset/base/265033 Log: Note that the AR5416 and later hardware supports the MYBEACON RX filter. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sun Apr 27 23:36:44 2014 (r265032) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sun Apr 27 23:37:03 2014 (r265033) @@ -1059,6 +1059,11 @@ ar5416FillCapabilityInfo(struct ath_hal if (! AH_PRIVATE(ah)->ah_ispcie) pCap->halSerialiseRegWar = 1; + /* + * AR5416 and later NICs support MYBEACON filtering. + */ + pCap->halRxDoMyBeacon = AH_TRUE; + return AH_TRUE; } From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 23:37:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D1C68DD; Sun, 27 Apr 2014 23:37:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A1C7D3C; Sun, 27 Apr 2014 23:37:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RNbeYr005440; Sun, 27 Apr 2014 23:37:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RNbe1K005439; Sun, 27 Apr 2014 23:37:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404272337.s3RNbe1K005439@svn.freebsd.org> From: Adrian Chadd Date: Sun, 27 Apr 2014 23:37:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265034 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 23:37:40 -0000 Author: adrian Date: Sun Apr 27 23:37:39 2014 New Revision: 265034 URL: http://svnweb.freebsd.org/changeset/base/265034 Log: Note that the AR9380 and later hardware supports MYBEACON. (Yes, I said AR5416 in the committed code. It's still strictly true.) Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Sun Apr 27 23:37:03 2014 (r265033) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Sun Apr 27 23:37:39 2014 (r265034) @@ -2934,6 +2934,10 @@ ar9300_fill_capability_info(struct ath_h p_cap->halRxUsingLnaMixing = AH_TRUE; } + /* + * AR5416 and later NICs support MYBEACON filtering. + */ + p_cap->halRxDoMyBeacon = AH_TRUE; #if ATH_WOW_OFFLOAD if (AR_SREV_JUPITER_20_OR_LATER(ah) || AR_SREV_APHRODITE(ah)) { From owner-svn-src-head@FreeBSD.ORG Sun Apr 27 23:47:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF21FAAB; Sun, 27 Apr 2014 23:47:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF6D2DE3; Sun, 27 Apr 2014 23:47:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3RNldds009482; Sun, 27 Apr 2014 23:47:39 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3RNldg0009477; Sun, 27 Apr 2014 23:47:39 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404272347.s3RNldg0009477@svn.freebsd.org> From: Ian Lepore Date: Sun, 27 Apr 2014 23:47:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265035 - in head/sys/arm: arm freescale/imx include ti/omap4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2014 23:47:40 -0000 Author: ian Date: Sun Apr 27 23:47:38 2014 New Revision: 265035 URL: http://svnweb.freebsd.org/changeset/base/265035 Log: Move duplicated code to print l2 cache config into the common code. Modified: head/sys/arm/arm/pl310.c head/sys/arm/freescale/imx/imx6_pl310.c head/sys/arm/include/pl310.h head/sys/arm/ti/omap4/omap4_l2cache.c Modified: head/sys/arm/arm/pl310.c ============================================================================== --- head/sys/arm/arm/pl310.c Sun Apr 27 23:37:39 2014 (r265034) +++ head/sys/arm/arm/pl310.c Sun Apr 27 23:47:38 2014 (r265035) @@ -84,6 +84,47 @@ static uint32_t g_ways_assoc; static struct pl310_softc *pl310_softc; +void +pl310_print_config(struct pl310_softc *sc) +{ + uint32_t aux, prefetch; + const char *dis = "disabled"; + const char *ena = "enabled"; + + aux = pl310_read4(sc, PL310_AUX_CTRL); + prefetch = pl310_read4(sc, PL310_PREFETCH_CTRL); + + device_printf(sc->sc_dev, "Early BRESP response: %s\n", + (aux & AUX_CTRL_EARLY_BRESP) ? ena : dis); + device_printf(sc->sc_dev, "Instruction prefetch: %s\n", + (aux & AUX_CTRL_INSTR_PREFETCH) ? ena : dis); + device_printf(sc->sc_dev, "Data prefetch: %s\n", + (aux & AUX_CTRL_DATA_PREFETCH) ? ena : dis); + device_printf(sc->sc_dev, "Non-secure interrupt control: %s\n", + (aux & AUX_CTRL_NS_INT_CTRL) ? ena : dis); + device_printf(sc->sc_dev, "Non-secure lockdown: %s\n", + (aux & AUX_CTRL_NS_LOCKDOWN) ? ena : dis); + device_printf(sc->sc_dev, "Share override: %s\n", + (aux & AUX_CTRL_SHARE_OVERRIDE) ? ena : dis); + + device_printf(sc->sc_dev, "Double linefill: %s\n", + (prefetch & PREFETCH_CTRL_DL) ? ena : dis); + device_printf(sc->sc_dev, "Instruction prefetch: %s\n", + (prefetch & PREFETCH_CTRL_INSTR_PREFETCH) ? ena : dis); + device_printf(sc->sc_dev, "Data prefetch: %s\n", + (prefetch & PREFETCH_CTRL_DATA_PREFETCH) ? ena : dis); + device_printf(sc->sc_dev, "Double linefill on WRAP request: %s\n", + (prefetch & PREFETCH_CTRL_DL_ON_WRAP) ? ena : dis); + device_printf(sc->sc_dev, "Prefetch drop: %s\n", + (prefetch & PREFETCH_CTRL_PREFETCH_DROP) ? ena : dis); + device_printf(sc->sc_dev, "Incr double Linefill: %s\n", + (prefetch & PREFETCH_CTRL_INCR_DL) ? ena : dis); + device_printf(sc->sc_dev, "Not same ID on exclusive sequence: %s\n", + (prefetch & PREFETCH_CTRL_NOTSAMEID) ? ena : dis); + device_printf(sc->sc_dev, "Prefetch offset: %d\n", + (prefetch & PREFETCH_CTRL_OFFSET_MASK)); +} + static int pl310_filter(void *arg) { @@ -351,6 +392,8 @@ pl310_attach(device_t dev) /* Enable the L2 cache if disabled */ platform_pl310_write_ctrl(sc, CTRL_ENABLED); device_printf(dev, "L2 Cache enabled\n"); + if (bootverbose) + pl310_print_config(sc); } if (!sc->sc_enabled && (ctrl_value & CTRL_ENABLED)) { Modified: head/sys/arm/freescale/imx/imx6_pl310.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_pl310.c Sun Apr 27 23:37:39 2014 (r265034) +++ head/sys/arm/freescale/imx/imx6_pl310.c Sun Apr 27 23:47:38 2014 (r265035) @@ -44,42 +44,6 @@ __FBSDID("$FreeBSD$"); void platform_pl310_init(struct pl310_softc *sc) { - uint32_t aux, prefetch; - - aux = pl310_read4(sc, PL310_AUX_CTRL); - prefetch = pl310_read4(sc, PL310_PREFETCH_CTRL); - - if (bootverbose) { - device_printf(sc->sc_dev, "Early BRESP response: %s\n", - (aux & AUX_CTRL_EARLY_BRESP) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Instruction prefetch: %s\n", - (aux & AUX_CTRL_INSTR_PREFETCH) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Data prefetch: %s\n", - (aux & AUX_CTRL_DATA_PREFETCH) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Non-secure interrupt control: %s\n", - (aux & AUX_CTRL_NS_INT_CTRL) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Non-secure lockdown: %s\n", - (aux & AUX_CTRL_NS_LOCKDOWN) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Share override: %s\n", - (aux & AUX_CTRL_SHARE_OVERRIDE) ? "enabled" : "disabled"); - - device_printf(sc->sc_dev, "Double linefil: %s\n", - (prefetch & PREFETCH_CTRL_DL) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Instruction prefetch: %s\n", - (prefetch & PREFETCH_CTRL_INSTR_PREFETCH) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Data prefetch: %s\n", - (prefetch & PREFETCH_CTRL_DATA_PREFETCH) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Double linefill on WRAP request: %s\n", - (prefetch & PREFETCH_CTRL_DL_ON_WRAP) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Prefetch drop: %s\n", - (prefetch & PREFETCH_CTRL_PREFETCH_DROP) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Incr double Linefill: %s\n", - (prefetch & PREFETCH_CTRL_INCR_DL) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Not same ID on exclusive sequence: %s\n", - (prefetch & PREFETCH_CTRL_NOTSAMEID) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Prefetch offset: %d\n", - (prefetch & PREFETCH_CTRL_OFFSET_MASK)); - } } void Modified: head/sys/arm/include/pl310.h ============================================================================== --- head/sys/arm/include/pl310.h Sun Apr 27 23:37:39 2014 (r265034) +++ head/sys/arm/include/pl310.h Sun Apr 27 23:47:38 2014 (r265035) @@ -161,6 +161,8 @@ pl310_write4(struct pl310_softc *sc, bus bus_write_4(sc->sc_mem_res, off, val); } +void pl310_print_config(struct pl310_softc *sc); + void platform_pl310_init(struct pl310_softc *); void platform_pl310_write_ctrl(struct pl310_softc *, uint32_t); void platform_pl310_write_debug(struct pl310_softc *, uint32_t); Modified: head/sys/arm/ti/omap4/omap4_l2cache.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_l2cache.c Sun Apr 27 23:37:39 2014 (r265034) +++ head/sys/arm/ti/omap4/omap4_l2cache.c Sun Apr 27 23:47:38 2014 (r265035) @@ -45,38 +45,6 @@ platform_pl310_init(struct pl310_softc * aux = pl310_read4(sc, PL310_AUX_CTRL); prefetch = pl310_read4(sc, PL310_PREFETCH_CTRL); - if (bootverbose) { - device_printf(sc->sc_dev, "Early BRESP response: %s\n", - (aux & AUX_CTRL_EARLY_BRESP) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Instruction prefetch: %s\n", - (aux & AUX_CTRL_INSTR_PREFETCH) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Data prefetch: %s\n", - (aux & AUX_CTRL_DATA_PREFETCH) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Non-secure interrupt control: %s\n", - (aux & AUX_CTRL_NS_INT_CTRL) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Non-secure lockdown: %s\n", - (aux & AUX_CTRL_NS_LOCKDOWN) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Share override: %s\n", - (aux & AUX_CTRL_SHARE_OVERRIDE) ? "enabled" : "disabled"); - - device_printf(sc->sc_dev, "Double linefil: %s\n", - (prefetch & PREFETCH_CTRL_DL) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Instruction prefetch: %s\n", - (prefetch & PREFETCH_CTRL_INSTR_PREFETCH) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Data prefetch: %s\n", - (prefetch & PREFETCH_CTRL_DATA_PREFETCH) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Double linefill on WRAP request: %s\n", - (prefetch & PREFETCH_CTRL_DL_ON_WRAP) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Prefetch drop: %s\n", - (prefetch & PREFETCH_CTRL_PREFETCH_DROP) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Incr double Linefill: %s\n", - (prefetch & PREFETCH_CTRL_INCR_DL) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Not same ID on exclusive sequence: %s\n", - (prefetch & PREFETCH_CTRL_NOTSAMEID) ? "enabled" : "disabled"); - device_printf(sc->sc_dev, "Prefetch offset: %d\n", - (prefetch & PREFETCH_CTRL_OFFSET_MASK)); - } - /* * Disable instruction prefetch */ From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 02:35:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56C35CD9; Mon, 28 Apr 2014 02:35:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4461A1B73; Mon, 28 Apr 2014 02:35:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3S2ZT6o079206; Mon, 28 Apr 2014 02:35:29 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3S2ZTGN079205; Mon, 28 Apr 2014 02:35:29 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404280235.s3S2ZTGN079205@svn.freebsd.org> From: Ian Lepore Date: Mon, 28 Apr 2014 02:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265036 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 02:35:29 -0000 Author: ian Date: Mon Apr 28 02:35:28 2014 New Revision: 265036 URL: http://svnweb.freebsd.org/changeset/base/265036 Log: Don't use multiprocessing-extensions instruction on processors that don't support SMP. Submitted by: loos@ Pointy hat to: me Modified: head/sys/arm/arm/cpufunc_asm_armv7.S Modified: head/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_armv7.S Sun Apr 27 23:47:38 2014 (r265035) +++ head/sys/arm/arm/cpufunc_asm_armv7.S Mon Apr 28 02:35:28 2014 (r265036) @@ -251,7 +251,11 @@ ENTRY(armv7_idcache_wbinv_range) END(armv7_idcache_wbinv_range) ENTRY_NP(armv7_icache_sync_all) +#ifdef SMP mcr p15, 0, r0, c7, c1, 0 /* Invalidate all I cache to PoU Inner Shareable */ +#else + mcr p15, 0, r0, c7, c5, 0 /* Invalidate all I cache to PoU (ICIALLU) */ +#endif isb /* instruction synchronization barrier */ dsb /* data synchronization barrier */ RET From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 05:39:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F4A9ED5; Mon, 28 Apr 2014 05:39:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 317901AC9; Mon, 28 Apr 2014 05:39:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3S5dLFt054489; Mon, 28 Apr 2014 05:39:21 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3S5dLBO054483; Mon, 28 Apr 2014 05:39:21 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201404280539.s3S5dLBO054483@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Mon, 28 Apr 2014 05:39:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265038 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 05:39:22 -0000 Author: ganbold Date: Mon Apr 28 05:39:20 2014 New Revision: 265038 URL: http://svnweb.freebsd.org/changeset/base/265038 Log: Move common device tree informations to separate dtsi files for A10 and A20 SoC. Change cubieboard1 and cubieboard2 dts files accordingly. Approved by: stas (mentor) Added: head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi (contents, props changed) head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi (contents, props changed) Modified: head/sys/boot/fdt/dts/arm/cubieboard.dts head/sys/boot/fdt/dts/arm/cubieboard2.dts Modified: head/sys/boot/fdt/dts/arm/cubieboard.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/cubieboard.dts Mon Apr 28 04:20:14 2014 (r265037) +++ head/sys/boot/fdt/dts/arm/cubieboard.dts Mon Apr 28 05:39:20 2014 (r265038) @@ -28,13 +28,10 @@ /dts-v1/; +/include/ "sun4i-a10.dtsi" + / { model = "Cubietech Cubieboard"; - compatible = "cubietech,a10-cubieboard", "allwinner,sun4i-a10"; - #address-cells = <1>; - #size-cells = <1>; - - interrupt-parent = <&AINTC>; memory { device_type = "memory"; @@ -47,96 +44,21 @@ }; SOC: a10 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges; - bus-frequency = <0>; - - AINTC: interrupt-controller@01c20400 { - compatible = "allwinner,sun4i-ic"; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = < 0x01c20400 0x400 >; - }; - - sramc@01c00000 { - compatible = "allwinner,sun4i-sramc"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x01c00000 0x1000 >; - }; - - ccm@01c20000 { - compatible = "allwinner,sun4i-ccm"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x01c20000 0x400 >; - }; - - timer@01c20c00 { - compatible = "allwinner,sun4i-timer"; - reg = <0x01c20c00 0x90>; - interrupts = < 22 >; - interrupt-parent = <&AINTC>; - clock-frequency = < 24000000 >; - }; - - watchdog@01c20c90 { - compatible = "allwinner,sun4i-wdt"; - reg = <0x01c20c90 0x08>; - }; - - - GPIO: gpio@01c20800 { - #gpio-cells = <3>; - compatible = "allwinner,sun4i-gpio"; - gpio-controller; - reg =< 0x01c20800 0x400 >; - interrupts = < 28 >; - interrupt-parent = <&AINTC>; - }; usb1: usb@01c14000 { - compatible = "allwinner,usb-ehci", "usb-ehci"; - reg = <0x01c14000 0x1000>; - interrupts = < 39 >; - interrupt-parent = <&AINTC>; + status = "okay"; }; usb2: usb@01c1c000 { - compatible = "allwinner,usb-ehci", "usb-ehci"; - reg = <0x01c1c000 0x1000>; - interrupts = < 40 >; - interrupt-parent = <&AINTC>; - }; - - sata@01c18000 { - compatible = "allwinner,ahci"; - reg = <0x01c18000 0x1000>; - interrupts = <56>; - interrupt-parent = <&AINTC>; + status = "okay"; }; UART0: serial@01c28000 { status = "okay"; - compatible = "ns16550"; - reg = <0x01c28000 0x400>; - reg-shift = <2>; - interrupts = <1>; - interrupt-parent = <&AINTC>; - current-speed = <115200>; - clock-frequency = < 24000000 >; - busy-detect = <1>; - broken-txfifo = <1>; }; emac@01c0b000 { - compatible = "allwinner,sun4i-emac"; - reg = <0x01c0b000 0x1000>; - interrupts = <55>; - interrupt-parent = <&AINTC>; + status = "okay"; }; }; Modified: head/sys/boot/fdt/dts/arm/cubieboard2.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/cubieboard2.dts Mon Apr 28 04:20:14 2014 (r265037) +++ head/sys/boot/fdt/dts/arm/cubieboard2.dts Mon Apr 28 05:39:20 2014 (r265038) @@ -28,13 +28,10 @@ /dts-v1/; +/include/ "sun7i-a20.dtsi" + / { model = "Cubietech Cubieboard2"; - compatible = "cubietech,a20-cubieboard", "allwinner,sun7i-a20"; - #address-cells = <1>; - #size-cells = <1>; - - interrupt-parent = <&GIC>; memory { device_type = "memory"; @@ -47,102 +44,21 @@ }; SOC: a20 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges; - bus-frequency = <0>; - - GIC: interrupt-controller@01c81000 { - compatible = "arm,gic"; - reg = <0x01c81000 0x1000>, /* Distributor Registers */ - <0x01c82000 0x0100>; /* CPU Interface Registers */ - interrupt-controller; - #interrupt-cells = <1>; - }; - - sramc@01c00000 { - compatible = "allwinner,sun4i-sramc"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x01c00000 0x1000 >; - }; - - cpu-cfg@01c25c00 { - compatible = "allwinner,sun7i-cpu-cfg"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x01c25c00 0x400 >; - }; - - ccm@01c20000 { - compatible = "allwinner,sun4i-ccm"; - #address-cells = <1>; - #size-cells = <1>; - reg = < 0x01c20000 0x400 >; - }; - - timer@01c20c00 { - compatible = "allwinner,sun7i-timer"; - reg = <0x01c20c00 0x90>; - interrupts = < 22 >; - interrupt-parent = <&GIC>; - clock-frequency = < 24000000 >; - }; - - watchdog@01c20c90 { - compatible = "allwinner,sun4i-wdt"; - reg = <0x01c20c90 0x10>; - }; - - GPIO: gpio@01c20800 { - #gpio-cells = <3>; - compatible = "allwinner,sun4i-gpio"; - gpio-controller; - reg =< 0x01c20800 0x400 >; - interrupts = < 28 >; - interrupt-parent = <&GIC>; - }; usb1: usb@01c14000 { - compatible = "allwinner,usb-ehci", "usb-ehci"; - reg = <0x01c14000 0x1000>; - interrupts = < 39 >; - interrupt-parent = <&GIC>; + status = "okay"; }; usb2: usb@01c1c000 { - compatible = "allwinner,usb-ehci", "usb-ehci"; - reg = <0x01c1c000 0x1000>; - interrupts = < 40 >; - interrupt-parent = <&GIC>; - }; - - sata@01c18000 { - compatible = "allwinner,ahci"; - reg = <0x01c18000 0x1000>; - interrupts = <56>; - interrupt-parent = <&GIC>; + status = "okay"; }; UART0: serial@01c28000 { status = "okay"; - compatible = "ns16550"; - reg = <0x01c28000 0x400>; - reg-shift = <2>; - interrupts = <1>; - interrupt-parent = <&GIC>; - current-speed = <115200>; - clock-frequency = < 24000000 >; - busy-detect = <1>; - broken-txfifo = <1>; }; emac@01c0b000 { - compatible = "allwinner,sun4i-emac"; - reg = <0x01c0b000 0x1000>; - interrupts = <55>; - interrupt-parent = <&GIC>; + status = "okay"; }; }; Added: head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi Mon Apr 28 05:39:20 2014 (r265038) @@ -0,0 +1,133 @@ +/*- + * Copyright (c) 2014 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/ { + compatible = "allwinner,sun4i-a10"; + #address-cells = <1>; + #size-cells = <1>; + + interrupt-parent = <&AINTC>; + + aliases { + soc = &SOC; + }; + + SOC: a10 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges; + bus-frequency = <0>; + + AINTC: interrupt-controller@01c20400 { + compatible = "allwinner,sun4i-ic"; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = < 0x01c20400 0x400 >; + }; + + sramc@01c00000 { + compatible = "allwinner,sun4i-sramc"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x01c00000 0x1000 >; + }; + + ccm@01c20000 { + compatible = "allwinner,sun4i-ccm"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x01c20000 0x400 >; + }; + + timer@01c20c00 { + compatible = "allwinner,sun4i-timer"; + reg = <0x01c20c00 0x90>; + interrupts = < 22 >; + interrupt-parent = <&AINTC>; + clock-frequency = < 24000000 >; + }; + + watchdog@01c20c90 { + compatible = "allwinner,sun4i-wdt"; + reg = <0x01c20c90 0x08>; + }; + + + GPIO: gpio@01c20800 { + #gpio-cells = <3>; + compatible = "allwinner,sun4i-gpio"; + gpio-controller; + reg =< 0x01c20800 0x400 >; + interrupts = < 28 >; + interrupt-parent = <&AINTC>; + }; + + usb1: usb@01c14000 { + compatible = "allwinner,usb-ehci", "usb-ehci"; + reg = <0x01c14000 0x1000>; + interrupts = < 39 >; + interrupt-parent = <&AINTC>; + }; + + usb2: usb@01c1c000 { + compatible = "allwinner,usb-ehci", "usb-ehci"; + reg = <0x01c1c000 0x1000>; + interrupts = < 40 >; + interrupt-parent = <&AINTC>; + }; + + sata@01c18000 { + compatible = "allwinner,ahci"; + reg = <0x01c18000 0x1000>; + interrupts = <56>; + interrupt-parent = <&AINTC>; + }; + + UART0: serial@01c28000 { + compatible = "ns16550"; + reg = <0x01c28000 0x400>; + reg-shift = <2>; + interrupts = <1>; + interrupt-parent = <&AINTC>; + current-speed = <115200>; + clock-frequency = < 24000000 >; + busy-detect = <1>; + broken-txfifo = <1>; + }; + + emac@01c0b000 { + compatible = "allwinner,sun4i-emac"; + reg = <0x01c0b000 0x1000>; + interrupts = <55>; + interrupt-parent = <&AINTC>; + }; + }; +}; + Added: head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi Mon Apr 28 05:39:20 2014 (r265038) @@ -0,0 +1,139 @@ +/*- + * Copyright (c) 2014 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/ { + compatible = "allwinner,sun7i-a20"; + #address-cells = <1>; + #size-cells = <1>; + + interrupt-parent = <&GIC>; + + aliases { + soc = &SOC; + }; + + SOC: a20 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges; + bus-frequency = <0>; + + GIC: interrupt-controller@01c81000 { + compatible = "arm,gic"; + reg = <0x01c81000 0x1000>, /* Distributor Registers */ + <0x01c82000 0x0100>; /* CPU Interface Registers */ + interrupt-controller; + #interrupt-cells = <1>; + }; + + sramc@01c00000 { + compatible = "allwinner,sun4i-sramc"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x01c00000 0x1000 >; + }; + + cpu-cfg@01c25c00 { + compatible = "allwinner,sun7i-cpu-cfg"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x01c25c00 0x400 >; + }; + + ccm@01c20000 { + compatible = "allwinner,sun4i-ccm"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x01c20000 0x400 >; + }; + + timer@01c20c00 { + compatible = "allwinner,sun7i-timer"; + reg = <0x01c20c00 0x90>; + interrupts = < 22 >; + interrupt-parent = <&GIC>; + clock-frequency = < 24000000 >; + }; + + watchdog@01c20c90 { + compatible = "allwinner,sun4i-wdt"; + reg = <0x01c20c90 0x10>; + }; + + GPIO: gpio@01c20800 { + #gpio-cells = <3>; + compatible = "allwinner,sun4i-gpio"; + gpio-controller; + reg =< 0x01c20800 0x400 >; + interrupts = < 28 >; + interrupt-parent = <&GIC>; + }; + + usb1: usb@01c14000 { + compatible = "allwinner,usb-ehci", "usb-ehci"; + reg = <0x01c14000 0x1000>; + interrupts = < 39 >; + interrupt-parent = <&GIC>; + }; + + usb2: usb@01c1c000 { + compatible = "allwinner,usb-ehci", "usb-ehci"; + reg = <0x01c1c000 0x1000>; + interrupts = < 40 >; + interrupt-parent = <&GIC>; + }; + + sata@01c18000 { + compatible = "allwinner,ahci"; + reg = <0x01c18000 0x1000>; + interrupts = <56>; + interrupt-parent = <&GIC>; + }; + + UART0: serial@01c28000 { + compatible = "ns16550"; + reg = <0x01c28000 0x400>; + reg-shift = <2>; + interrupts = <1>; + interrupt-parent = <&GIC>; + current-speed = <115200>; + clock-frequency = < 24000000 >; + busy-detect = <1>; + broken-txfifo = <1>; + }; + + emac@01c0b000 { + compatible = "allwinner,sun4i-emac"; + reg = <0x01c0b000 0x1000>; + interrupts = <55>; + interrupt-parent = <&GIC>; + }; + }; +}; + From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 06:24:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18019A0A; Mon, 28 Apr 2014 06:24:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04E8D1FEE; Mon, 28 Apr 2014 06:24:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3S6ObRX074747; Mon, 28 Apr 2014 06:24:37 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3S6ObDr074746; Mon, 28 Apr 2014 06:24:37 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404280624.s3S6ObDr074746@svn.freebsd.org> From: Eitan Adler Date: Mon, 28 Apr 2014 06:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265042 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 06:24:38 -0000 Author: eadler Date: Mon Apr 28 06:24:37 2014 New Revision: 265042 URL: http://svnweb.freebsd.org/changeset/base/265042 Log: bsd-family-tree: Fix date Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Mon Apr 28 06:12:15 2014 (r265041) +++ head/share/misc/bsd-family-tree Mon Apr 28 06:24:37 2014 (r265042) @@ -635,7 +635,7 @@ FreeBSD 10.0 2014-01-20 [FBD] NetBSD 6.0.4 2014-01-27 [NBD] NetBSD 6.1.3 2014-01-27 [NBD] DragonFly 3.6.1 2014-02-22 [DFB] -DragonFly 3.6.2 2014-03-27 [DFB] +DragonFly 3.6.2 2014-04-10 [DFB] NetBSD 6.0.5 2014-04-19 [NDB] NetBSD 6.1.4 2014-04-19 [NDB] From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 08:53:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF38A21E; Mon, 28 Apr 2014 08:53:44 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D3471CCE; Mon, 28 Apr 2014 08:53:43 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s3S8rYxV008582 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 28 Apr 2014 12:53:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s3S8rYUV008581; Mon, 28 Apr 2014 12:53:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 28 Apr 2014 12:53:34 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r253687 - head/sys/net Message-ID: <20140428085334.GV85571@FreeBSD.org> References: <201307261941.r6QJfEMO087844@svn.freebsd.org> <20140425180900.GP85571@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Alan Somers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 08:53:44 -0000 On Fri, Apr 25, 2014 at 02:09:21PM -0700, Adrian Chadd wrote: A> Someone else should do it. Someone else can simply revert a commit that introduces a LOR and adds nonstandard undocumented configuration knobs. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 08:59:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F97466B; Mon, 28 Apr 2014 08:59:44 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A46721D0E; Mon, 28 Apr 2014 08:59:42 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s3S8xfZM008642 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 28 Apr 2014 12:59:41 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s3S8xfn4008641; Mon, 28 Apr 2014 12:59:41 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 28 Apr 2014 12:59:41 +0400 From: Gleb Smirnoff To: "Alexander V. Chernikov" Subject: Re: svn commit: r264986 - head/sys/net Message-ID: <20140428085941.GW85571@FreeBSD.org> References: <201404262103.s3QL3fAX048245@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201404262103.s3QL3fAX048245@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 08:59:44 -0000 On Sat, Apr 26, 2014 at 09:03:41PM +0000, Alexander V. Chernikov wrote: A> @@ -1425,6 +1431,95 @@ bad: A> #undef ifpaddr A> #undef flags A> A> +#define senderr(e) { error = e; goto bad; } ... A> + if (error != 0) A> + senderr(error); This resolves to "error = error". Surprised that compiler is silent. Can this line and others like it be replaced with? if (error) goto bad; -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 09:00:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B04E57AA; Mon, 28 Apr 2014 09:00:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91F861D17; Mon, 28 Apr 2014 09:00:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3S9019b036827; Mon, 28 Apr 2014 09:00:01 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3S901UT036817; Mon, 28 Apr 2014 09:00:01 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201404280900.s3S901UT036817@svn.freebsd.org> From: Steven Hartland Date: Mon, 28 Apr 2014 09:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265046 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 09:00:01 -0000 Author: smh Date: Mon Apr 28 09:00:00 2014 New Revision: 265046 URL: http://svnweb.freebsd.org/changeset/base/265046 Log: Fix ZIO reordering done by vdev_queue_io causing panics when zio_vdev_io_start returns ZIO_PIPELINE_CONTINUE from vdev_op_io_start to zio_execute resulting in the wrong ZIO continuing its pipeline. This is a serious issue which could cause data loss / corruption but appears to be limited to error handling such as when vdev_readable(vd) returns false. MFC after: 2 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Apr 28 07:51:07 2014 (r265045) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Apr 28 09:00:00 2014 (r265046) @@ -349,7 +349,7 @@ typedef struct zio_transform { struct zio_transform *zt_next; } zio_transform_t; -typedef int zio_pipe_stage_t(zio_t *zio); +typedef int zio_pipe_stage_t(zio_t **ziop); /* * The io_reexecute flags are distinct from io_flags because the child must Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Apr 28 07:51:07 2014 (r265045) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Apr 28 09:00:00 2014 (r265046) @@ -1012,8 +1012,9 @@ zio_shrink(zio_t *zio, uint64_t size) */ static int -zio_read_bp_init(zio_t *zio) +zio_read_bp_init(zio_t **ziop) { + zio_t *zio = *ziop; blkptr_t *bp = zio->io_bp; if (BP_GET_COMPRESS(bp) != ZIO_COMPRESS_OFF && @@ -1038,8 +1039,9 @@ zio_read_bp_init(zio_t *zio) } static int -zio_write_bp_init(zio_t *zio) +zio_write_bp_init(zio_t **ziop) { + zio_t *zio = *ziop; spa_t *spa = zio->io_spa; zio_prop_t *zp = &zio->io_prop; enum zio_compress compress = zp->zp_compress; @@ -1189,8 +1191,9 @@ zio_write_bp_init(zio_t *zio) } static int -zio_free_bp_init(zio_t *zio) +zio_free_bp_init(zio_t **ziop) { + zio_t *zio = *ziop; blkptr_t *bp = zio->io_bp; if (zio->io_child_type == ZIO_CHILD_LOGICAL) { @@ -1273,8 +1276,10 @@ zio_taskq_member(zio_t *zio, zio_taskq_t } static int -zio_issue_async(zio_t *zio) +zio_issue_async(zio_t **ziop) { + zio_t *zio = *ziop; + zio_taskq_dispatch(zio, ZIO_TASKQ_ISSUE, B_FALSE); return (ZIO_PIPELINE_STOP); @@ -1342,7 +1347,7 @@ zio_execute(zio_t *zio) } zio->io_stage = stage; - rv = zio_pipeline[highbit64(stage) - 1](zio); + rv = zio_pipeline[highbit64(stage) - 1](&zio); if (rv == ZIO_PIPELINE_STOP) return; @@ -1776,8 +1781,9 @@ zio_gang_tree_issue(zio_t *pio, zio_gang } static int -zio_gang_assemble(zio_t *zio) +zio_gang_assemble(zio_t **ziop) { + zio_t *zio = *ziop; blkptr_t *bp = zio->io_bp; ASSERT(BP_IS_GANG(bp) && zio->io_gang_leader == NULL); @@ -1791,8 +1797,9 @@ zio_gang_assemble(zio_t *zio) } static int -zio_gang_issue(zio_t *zio) +zio_gang_issue(zio_t **ziop) { + zio_t *zio = *ziop; blkptr_t *bp = zio->io_bp; if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_DONE)) @@ -1926,8 +1933,9 @@ zio_write_gang_block(zio_t *pio) * writes) and as a result is mutually exclusive with dedup. */ static int -zio_nop_write(zio_t *zio) +zio_nop_write(zio_t **ziop) { + zio_t *zio = *ziop; blkptr_t *bp = zio->io_bp; blkptr_t *bp_orig = &zio->io_bp_orig; zio_prop_t *zp = &zio->io_prop; @@ -1998,8 +2006,9 @@ zio_ddt_child_read_done(zio_t *zio) } static int -zio_ddt_read_start(zio_t *zio) +zio_ddt_read_start(zio_t **ziop) { + zio_t *zio = *ziop; blkptr_t *bp = zio->io_bp; ASSERT(BP_GET_DEDUP(bp)); @@ -2041,8 +2050,9 @@ zio_ddt_read_start(zio_t *zio) } static int -zio_ddt_read_done(zio_t *zio) +zio_ddt_read_done(zio_t **ziop) { + zio_t *zio = *ziop; blkptr_t *bp = zio->io_bp; if (zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_DONE)) @@ -2210,8 +2220,9 @@ zio_ddt_ditto_write_done(zio_t *zio) } static int -zio_ddt_write(zio_t *zio) +zio_ddt_write(zio_t **ziop) { + zio_t *zio = *ziop; spa_t *spa = zio->io_spa; blkptr_t *bp = zio->io_bp; uint64_t txg = zio->io_txg; @@ -2322,8 +2333,9 @@ zio_ddt_write(zio_t *zio) ddt_entry_t *freedde; /* for debugging */ static int -zio_ddt_free(zio_t *zio) +zio_ddt_free(zio_t **ziop) { + zio_t *zio = *ziop; spa_t *spa = zio->io_spa; blkptr_t *bp = zio->io_bp; ddt_t *ddt = ddt_select(spa, bp); @@ -2348,8 +2360,9 @@ zio_ddt_free(zio_t *zio) * ========================================================================== */ static int -zio_dva_allocate(zio_t *zio) +zio_dva_allocate(zio_t **ziop) { + zio_t *zio = *ziop; spa_t *spa = zio->io_spa; metaslab_class_t *mc = spa_normal_class(spa); blkptr_t *bp = zio->io_bp; @@ -2391,16 +2404,19 @@ zio_dva_allocate(zio_t *zio) } static int -zio_dva_free(zio_t *zio) +zio_dva_free(zio_t **ziop) { + zio_t *zio = *ziop; + metaslab_free(zio->io_spa, zio->io_bp, zio->io_txg, B_FALSE); return (ZIO_PIPELINE_CONTINUE); } static int -zio_dva_claim(zio_t *zio) +zio_dva_claim(zio_t **ziop) { + zio_t *zio = *ziop; int error; error = metaslab_claim(zio->io_spa, zio->io_bp, zio->io_txg); @@ -2494,8 +2510,9 @@ zio_free_zil(spa_t *spa, uint64_t txg, b * ========================================================================== */ static int -zio_vdev_io_start(zio_t *zio) +zio_vdev_io_start(zio_t **ziop) { + zio_t *zio = *ziop; vdev_t *vd = zio->io_vd; uint64_t align; spa_t *spa = zio->io_spa; @@ -2589,6 +2606,7 @@ zio_vdev_io_start(zio_t *zio) if ((zio = vdev_queue_io(zio)) == NULL) return (ZIO_PIPELINE_STOP); + *ziop = zio; if (!vdev_accessible(vd, zio)) { zio->io_error = SET_ERROR(ENXIO); @@ -2612,8 +2630,9 @@ zio_vdev_io_start(zio_t *zio) } static int -zio_vdev_io_done(zio_t *zio) +zio_vdev_io_done(zio_t **ziop) { + zio_t *zio = *ziop; vdev_t *vd = zio->io_vd; vdev_ops_t *ops = vd ? vd->vdev_ops : &vdev_mirror_ops; boolean_t unexpected_error = B_FALSE; @@ -2687,8 +2706,9 @@ zio_vsd_default_cksum_report(zio_t *zio, } static int -zio_vdev_io_assess(zio_t *zio) +zio_vdev_io_assess(zio_t **ziop) { + zio_t *zio = *ziop; vdev_t *vd = zio->io_vd; if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE)) @@ -2801,8 +2821,9 @@ zio_vdev_io_bypass(zio_t *zio) * ========================================================================== */ static int -zio_checksum_generate(zio_t *zio) +zio_checksum_generate(zio_t **ziop) { + zio_t *zio = *ziop; blkptr_t *bp = zio->io_bp; enum zio_checksum checksum; @@ -2832,8 +2853,9 @@ zio_checksum_generate(zio_t *zio) } static int -zio_checksum_verify(zio_t *zio) +zio_checksum_verify(zio_t **ziop) { + zio_t *zio = *ziop; zio_bad_cksum_t info; blkptr_t *bp = zio->io_bp; int error; @@ -2904,8 +2926,9 @@ zio_worst_error(int e1, int e2) * ========================================================================== */ static int -zio_ready(zio_t *zio) +zio_ready(zio_t **ziop) { + zio_t *zio = *ziop; blkptr_t *bp = zio->io_bp; zio_t *pio, *pio_next; @@ -2962,8 +2985,9 @@ zio_ready(zio_t *zio) } static int -zio_done(zio_t *zio) +zio_done(zio_t **ziop) { + zio_t *zio = *ziop; spa_t *spa = zio->io_spa; zio_t *lio = zio->io_logical; blkptr_t *bp = zio->io_bp; From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 12:33:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 660676BB; Mon, 28 Apr 2014 12:33:20 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20461169E; Mon, 28 Apr 2014 12:33:19 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.82 (FreeBSD)) (envelope-from ) id 1WekkH-000ALy-N0; Mon, 28 Apr 2014 16:33:17 +0400 Date: Mon, 28 Apr 2014 16:33:17 +0400 From: Slawa Olhovchenkov To: Konstantin Belousov Subject: Re: svn commit: r265003 - head/secure/usr.sbin/sshd Message-ID: <20140428123317.GA38996@zxy.spb.ru> References: <201404270528.s3R5SEIm054377@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201404270528.s3R5SEIm054377@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 12:33:20 -0000 On Sun, Apr 27, 2014 at 05:28:14AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Sun Apr 27 05:28:14 2014 > New Revision: 265003 > URL: http://svnweb.freebsd.org/changeset/base/265003 > > Log: > Fix order of libthr and libc in the global dso list for sshd, by > explicitely linking main binary with -lpthread. Before, libthr > appeared in the list due to dependency of one of the kerberos libs. > Due to the change in ld(1) behaviour of not copying NEEDED entries > from direct dependencies into the link results, the order becomes > reversed. > > The libthr must appear before libc to properly interpose libc symbols > and provide working rtld locks implementation. The symptom was sshd > hanging on rtld bind lock during nested symbol binding from a signal > handler. What about define CFLAGS += -DUNSUPPORTED_POSIX_THREADS_HACK for realy working kerberos SSO? > Approved by: des (openssh maintainer) > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > > Modified: > head/secure/usr.sbin/sshd/Makefile > > Modified: head/secure/usr.sbin/sshd/Makefile > ============================================================================== > --- head/secure/usr.sbin/sshd/Makefile Sun Apr 27 05:19:01 2014 (r265002) > +++ head/secure/usr.sbin/sshd/Makefile Sun Apr 27 05:28:14 2014 (r265003) > @@ -57,6 +57,16 @@ CFLAGS+= -DNONE_CIPHER_ENABLED > DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ} > LDADD+= -lcrypt -lcrypto -lz > > +# Fix the order of NEEDED entries for libthr and libc. The libthr > +# needs to interpose libc symbols, leaving the libthr loading as > +# dependency of krb causes reversed order and broken interposing. Put > +# the threading library last on the linker command line, just before > +# the -lc added by a compiler driver. > +.if ${MK_KERBEROS_SUPPORT} != "no" > +DPADD+= ${LIBPTHREAD} > +LDADD+= -lpthread > +.endif > + > .if defined(LOCALBASE) > CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\" > .endif > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 13:42:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E6DA166; Mon, 28 Apr 2014 13:42:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B9B41DDA; Mon, 28 Apr 2014 13:42:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3SDgfnZ055825; Mon, 28 Apr 2014 13:42:41 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3SDgfIO055824; Mon, 28 Apr 2014 13:42:41 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404281342.s3SDgfIO055824@svn.freebsd.org> From: Ed Maste Date: Mon, 28 Apr 2014 13:42:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265051 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 13:42:41 -0000 Author: emaste Date: Mon Apr 28 13:42:41 2014 New Revision: 265051 URL: http://svnweb.freebsd.org/changeset/base/265051 Log: Drop explicit unsigned from FD_SETSIZE constant FD_SETSIZE is often used as an argument to select or compared with an integer file descriptor. Rather than force 3rd party software to add explicit casts, just make it a plain (int) constant as on other operating systems. Previous discussion: http://lists.freebsd.org/pipermail/freebsd-standards/2012-July/002410.html Modified: head/sys/sys/select.h Modified: head/sys/sys/select.h ============================================================================== --- head/sys/sys/select.h Mon Apr 28 13:28:10 2014 (r265050) +++ head/sys/sys/select.h Mon Apr 28 13:42:41 2014 (r265051) @@ -56,7 +56,7 @@ typedef __sigset_t sigset_t; * be enough for most uses. */ #ifndef FD_SETSIZE -#define FD_SETSIZE 1024U +#define FD_SETSIZE 1024 #endif #define _NFDBITS (sizeof(__fd_mask) * 8) /* bits per mask */ From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 15:03:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 055EF53A; Mon, 28 Apr 2014 15:03:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D985E1921; Mon, 28 Apr 2014 15:03:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3SF3rRD089420; Mon, 28 Apr 2014 15:03:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3SF3q6f089411; Mon, 28 Apr 2014 15:03:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404281503.s3SF3q6f089411@svn.freebsd.org> From: Alexander Motin Date: Mon, 28 Apr 2014 15:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265054 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 15:03:54 -0000 Author: mav Date: Mon Apr 28 15:03:52 2014 New Revision: 265054 URL: http://svnweb.freebsd.org/changeset/base/265054 Log: Reduce number of opens by REOM RAID during provider taste. Instead opening/closing provider by each of metadata classes, do it only once in core code. Since for SCSI disks open/close means sending some SCSI commands to the device, this change reduces taste time. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/geom/raid/g_raid.c head/sys/geom/raid/md_ddf.c head/sys/geom/raid/md_intel.c head/sys/geom/raid/md_jmicron.c head/sys/geom/raid/md_nvidia.c head/sys/geom/raid/md_promise.c head/sys/geom/raid/md_sii.c Modified: head/sys/geom/raid/g_raid.c ============================================================================== --- head/sys/geom/raid/g_raid.c Mon Apr 28 14:44:08 2014 (r265053) +++ head/sys/geom/raid/g_raid.c Mon Apr 28 15:03:52 2014 (r265054) @@ -2251,6 +2251,8 @@ g_raid_taste(struct g_class *mp, struct return (NULL); G_RAID_DEBUG(2, "Tasting provider %s.", pp->name); + geom = NULL; + status = G_RAID_MD_TASTE_FAIL; gp = g_new_geomf(mp, "raid:taste"); /* * This orphan function should be never called. @@ -2259,8 +2261,9 @@ g_raid_taste(struct g_class *mp, struct cp = g_new_consumer(gp); cp->flags |= G_CF_DIRECT_RECEIVE; g_attach(cp, pp); + if (g_access(cp, 1, 0, 0) != 0) + goto ofail; - geom = NULL; LIST_FOREACH(class, &g_raid_md_classes, mdc_list) { if (!class->mdc_enable) continue; @@ -2276,6 +2279,9 @@ g_raid_taste(struct g_class *mp, struct break; } + if (status == G_RAID_MD_TASTE_FAIL) + (void)g_access(cp, -1, 0, 0); +ofail: g_detach(cp); g_destroy_consumer(cp); g_destroy_geom(gp); Modified: head/sys/geom/raid/md_ddf.c ============================================================================== --- head/sys/geom/raid/md_ddf.c Mon Apr 28 14:44:08 2014 (r265053) +++ head/sys/geom/raid/md_ddf.c Mon Apr 28 15:03:52 2014 (r265054) @@ -2120,13 +2120,10 @@ g_raid_md_taste_ddf(struct g_raid_md_obj pp = cp->provider; /* Read metadata from device. */ - if (g_access(cp, 1, 0, 0) != 0) - return (G_RAID_MD_TASTE_FAIL); g_topology_unlock(); bzero(&meta, sizeof(meta)); error = ddf_meta_read(cp, &meta); g_topology_lock(); - g_access(cp, -1, 0, 0); if (error != 0) return (G_RAID_MD_TASTE_FAIL); be = meta.bigendian; @@ -2164,6 +2161,9 @@ g_raid_md_taste_ddf(struct g_raid_md_obj geom = sc->sc_geom; } + /* There is no return after this point, so we close passed consumer. */ + g_access(cp, -1, 0, 0); + rcp = g_new_consumer(geom); rcp->flags |= G_CF_DIRECT_RECEIVE; g_attach(rcp, pp); Modified: head/sys/geom/raid/md_intel.c ============================================================================== --- head/sys/geom/raid/md_intel.c Mon Apr 28 14:44:08 2014 (r265053) +++ head/sys/geom/raid/md_intel.c Mon Apr 28 15:03:52 2014 (r265054) @@ -1382,8 +1382,6 @@ g_raid_md_taste_intel(struct g_raid_md_o meta = NULL; vendor = 0xffff; disk_pos = 0; - if (g_access(cp, 1, 0, 0) != 0) - return (G_RAID_MD_TASTE_FAIL); g_topology_unlock(); error = g_raid_md_get_label(cp, serial, sizeof(serial)); if (error != 0) { @@ -1396,7 +1394,6 @@ g_raid_md_taste_intel(struct g_raid_md_o g_io_getattr("GEOM::hba_vendor", cp, &len, &vendor); meta = intel_meta_read(cp); g_topology_lock(); - g_access(cp, -1, 0, 0); if (meta == NULL) { if (g_raid_aggressive_spare) { if (vendor != 0x8086) { @@ -1476,6 +1473,9 @@ search: G_RAID_DEBUG1(1, sc, "root_mount_hold %p", mdi->mdio_rootmount); } + /* There is no return after this point, so we close passed consumer. */ + g_access(cp, -1, 0, 0); + rcp = g_new_consumer(geom); rcp->flags |= G_CF_DIRECT_RECEIVE; g_attach(rcp, pp); @@ -1512,7 +1512,6 @@ search: return (result); fail2: g_topology_lock(); - g_access(cp, -1, 0, 0); fail1: free(meta, M_MD_INTEL); return (G_RAID_MD_TASTE_FAIL); Modified: head/sys/geom/raid/md_jmicron.c ============================================================================== --- head/sys/geom/raid/md_jmicron.c Mon Apr 28 14:44:08 2014 (r265053) +++ head/sys/geom/raid/md_jmicron.c Mon Apr 28 15:03:52 2014 (r265054) @@ -837,15 +837,12 @@ g_raid_md_taste_jmicron(struct g_raid_md /* Read metadata from device. */ meta = NULL; vendor = 0xffff; - if (g_access(cp, 1, 0, 0) != 0) - return (G_RAID_MD_TASTE_FAIL); g_topology_unlock(); len = 2; if (pp->geom->rank == 1) g_io_getattr("GEOM::hba_vendor", cp, &len, &vendor); meta = jmicron_meta_read(cp); g_topology_lock(); - g_access(cp, -1, 0, 0); if (meta == NULL) { if (g_raid_aggressive_spare) { if (vendor == 0x197b) { @@ -922,6 +919,9 @@ search: G_RAID_DEBUG1(1, sc, "root_mount_hold %p", mdi->mdio_rootmount); } + /* There is no return after this point, so we close passed consumer. */ + g_access(cp, -1, 0, 0); + rcp = g_new_consumer(geom); rcp->flags |= G_CF_DIRECT_RECEIVE; g_attach(rcp, pp); Modified: head/sys/geom/raid/md_nvidia.c ============================================================================== --- head/sys/geom/raid/md_nvidia.c Mon Apr 28 14:44:08 2014 (r265053) +++ head/sys/geom/raid/md_nvidia.c Mon Apr 28 15:03:52 2014 (r265054) @@ -841,15 +841,12 @@ g_raid_md_taste_nvidia(struct g_raid_md_ /* Read metadata from device. */ meta = NULL; vendor = 0xffff; - if (g_access(cp, 1, 0, 0) != 0) - return (G_RAID_MD_TASTE_FAIL); g_topology_unlock(); len = 2; if (pp->geom->rank == 1) g_io_getattr("GEOM::hba_vendor", cp, &len, &vendor); meta = nvidia_meta_read(cp); g_topology_lock(); - g_access(cp, -1, 0, 0); if (meta == NULL) { if (g_raid_aggressive_spare) { if (vendor == 0x10de) { @@ -918,6 +915,9 @@ search: G_RAID_DEBUG1(1, sc, "root_mount_hold %p", mdi->mdio_rootmount); } + /* There is no return after this point, so we close passed consumer. */ + g_access(cp, -1, 0, 0); + rcp = g_new_consumer(geom); rcp->flags |= G_CF_DIRECT_RECEIVE; g_attach(rcp, pp); Modified: head/sys/geom/raid/md_promise.c ============================================================================== --- head/sys/geom/raid/md_promise.c Mon Apr 28 14:44:08 2014 (r265053) +++ head/sys/geom/raid/md_promise.c Mon Apr 28 15:03:52 2014 (r265054) @@ -1106,15 +1106,12 @@ g_raid_md_taste_promise(struct g_raid_md /* Read metadata from device. */ meta = NULL; vendor = 0xffff; - if (g_access(cp, 1, 0, 0) != 0) - return (G_RAID_MD_TASTE_FAIL); g_topology_unlock(); len = 2; if (pp->geom->rank == 1) g_io_getattr("GEOM::hba_vendor", cp, &len, &vendor); subdisks = promise_meta_read(cp, metaarr); g_topology_lock(); - g_access(cp, -1, 0, 0); if (subdisks == 0) { if (g_raid_aggressive_spare) { if (vendor == 0x105a || vendor == 0x1002) { @@ -1175,6 +1172,9 @@ search: geom = sc->sc_geom; } + /* There is no return after this point, so we close passed consumer. */ + g_access(cp, -1, 0, 0); + rcp = g_new_consumer(geom); rcp->flags |= G_CF_DIRECT_RECEIVE; g_attach(rcp, pp); Modified: head/sys/geom/raid/md_sii.c ============================================================================== --- head/sys/geom/raid/md_sii.c Mon Apr 28 14:44:08 2014 (r265053) +++ head/sys/geom/raid/md_sii.c Mon Apr 28 15:03:52 2014 (r265054) @@ -923,15 +923,12 @@ g_raid_md_taste_sii(struct g_raid_md_obj /* Read metadata from device. */ meta = NULL; vendor = 0xffff; - if (g_access(cp, 1, 0, 0) != 0) - return (G_RAID_MD_TASTE_FAIL); g_topology_unlock(); len = 2; if (pp->geom->rank == 1) g_io_getattr("GEOM::hba_vendor", cp, &len, &vendor); meta = sii_meta_read(cp); g_topology_lock(); - g_access(cp, -1, 0, 0); if (meta == NULL) { if (g_raid_aggressive_spare) { if (vendor == 0x1095) { @@ -1011,6 +1008,9 @@ search: G_RAID_DEBUG1(1, sc, "root_mount_hold %p", mdi->mdio_rootmount); } + /* There is no return after this point, so we close passed consumer. */ + g_access(cp, -1, 0, 0); + rcp = g_new_consumer(geom); rcp->flags |= G_CF_DIRECT_RECEIVE; g_attach(rcp, pp); From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 17:55:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8EA2704; Mon, 28 Apr 2014 17:55:17 +0000 (UTC) Received: from mail-qc0-x22e.google.com (mail-qc0-x22e.google.com [IPv6:2607:f8b0:400d:c01::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 247A31B93; Mon, 28 Apr 2014 17:55:17 +0000 (UTC) Received: by mail-qc0-f174.google.com with SMTP id c9so7117543qcz.5 for ; Mon, 28 Apr 2014 10:55:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=LgGiokwaDwGUGZCmX4D0AnXViy7R8XYP/SlnAbG96U8=; b=OeVJWMq6R7G2s2pZl3UqSYCFy713cgqRA7VPAd2EpKapSK7NZRsp4+ZfYq4c1EXORi Ly3WUJPhfyKPHh6dRq+2GFkvT7Y/sMT/xgO2fExsC0mhkQ7ppNoRKX5M4eNpbdQw7GZv OB6h3HuSOjluJKI4ryNUA2UxWBJkwqL8TMacDzKch2REiE3YY5rvEQVRR46UUm+LkUL1 N1a9htk6yFGMTElh6e9Z5Co8mFbTTNLJ3eXli7q26HQB1691U3wXM2eE0ddsbV4doyTt WiW1mq4mivZLuQMwsHhhQXRtfXmKAkdl1nPQMI22qlry4yMxLCQWZG/VBJ8GfOonnh4T e6aA== MIME-Version: 1.0 X-Received: by 10.140.92.230 with SMTP id b93mr25944003qge.12.1398707716118; Mon, 28 Apr 2014 10:55:16 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.191.201 with HTTP; Mon, 28 Apr 2014 10:55:15 -0700 (PDT) In-Reply-To: <20140428085334.GV85571@FreeBSD.org> References: <201307261941.r6QJfEMO087844@svn.freebsd.org> <20140425180900.GP85571@FreeBSD.org> <20140428085334.GV85571@FreeBSD.org> Date: Mon, 28 Apr 2014 10:55:15 -0700 X-Google-Sender-Auth: 3roiz0h3V7nmNA3VkcBPSXMMn98 Message-ID: Subject: Re: svn commit: r253687 - head/sys/net From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Alan Somers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 17:55:17 -0000 On 28 April 2014 01:53, Gleb Smirnoff wrote: > On Fri, Apr 25, 2014 at 02:09:21PM -0700, Adrian Chadd wrote: > A> Someone else should do it. > > Someone else can simply revert a commit that introduces a LOR and > adds nonstandard undocumented configuration knobs. Please do. I'm no longer doing anything with the link aggregation stuff here and I just don't have the time. -a From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 17:58:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 735209AF; Mon, 28 Apr 2014 17:58:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C2801BD2; Mon, 28 Apr 2014 17:58:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3SHwgBA061897; Mon, 28 Apr 2014 17:58:42 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3SHwehW061889; Mon, 28 Apr 2014 17:58:40 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201404281758.s3SHwehW061889@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 28 Apr 2014 17:58:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265055 - in head: share/man/man4 sys/dev/proto sys/modules sys/modules/proto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 17:58:42 -0000 Author: marcel Date: Mon Apr 28 17:58:40 2014 New Revision: 265055 URL: http://svnweb.freebsd.org/changeset/base/265055 Log: Add proto(4): A driver for prototyping and diagnostics. It exposes I/O resources to user space, so that programs can peek and poke at the hardware. It does not itself have knowledge about the hardware device it attaches to. Sponsored by: Juniper Networks, Inc. Added: head/share/man/man4/proto.4 (contents, props changed) head/sys/dev/proto/ head/sys/dev/proto/proto.h (contents, props changed) head/sys/dev/proto/proto_bus_pci.c (contents, props changed) head/sys/dev/proto/proto_core.c (contents, props changed) head/sys/dev/proto/proto_dev.h (contents, props changed) head/sys/modules/proto/ head/sys/modules/proto/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Apr 28 15:03:52 2014 (r265054) +++ head/share/man/man4/Makefile Mon Apr 28 17:58:40 2014 (r265055) @@ -378,6 +378,7 @@ MAN= aac.4 \ ppc.4 \ ppi.4 \ procdesc.4 \ + proto.4 \ psm.4 \ pst.4 \ pt.4 \ Added: head/share/man/man4/proto.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/proto.4 Mon Apr 28 17:58:40 2014 (r265055) @@ -0,0 +1,121 @@ +.\" +.\" Copyright (c) 2014 Marcel Moolenaar +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 21, 2014 +.Dt PROTO 4 +.Os +.\" +.Sh NAME +.Nm proto +.Nd Driver for prototyping and H/W diagnostics +.\" +.Sh SYNOPSIS +.Cd "device proto" +.\" +.Sh DESCRIPTION +The +.Nm +device driver attaches to PCI devices when no other device drivers are +present and creates device special files for all resources associated +with the device. +The driver itself has no knowledge of the device it attaches to. +Programs can open these device special files and peform register-level +reads and writes. +As such, the +.Nm +device driver is nothing but a conduit or gateway between user space +programs and the hardware device. +.Pp +Examples for why this is useful include hardware diagnostics and prototyping. +In both these use cases, it's far more convenient to develop and run the +logic in user space. +Especially hardware diagnostics requires a somewhat user-friendly interface +and adequate reporting. +Neither is done easily as kernel code. +.\" +.Sh FILES +All device special files corresponding to a PCI device are located under +.Pa /dev/proto/pci::: +with +.Pa pci::: +representing the location of the PCI device in the PCI hierarchy. +A location includes: +.Bl -tag -width XXXXXX -compact +.It +The PCI domain number +.It +The PCI bus number +.It +The PCI slot or device number +.It +The PCI function number +.El +.Pp +Every PCI device has a device special file called +.Pa pcicfg . +This device special file gives access to the PCI configuration space. +For each valid base address register (BAR), a device special file is created +that contains the BAR offset and the resource type. +A resource type can be either +.Pa io +or +.Pa mem +representing I/O port or memory mapped I/O space (resp.) +.\" +.Sh EXAMPLES +A single function PCI device in domain 0, on bus 1, in slot 2 and having a +single memory mapped I/O region will have the following device special files: +.Bl -tag -compact +.It Pa /dev/proto/pci0:1:2:0/10.mem +.It Pa /dev/proto/pci0:1:2:0/pcicfg +.El +.\" +.Sh SECURITY CONSIDERATIONS +Because programs have direct access to the hardware, the +.Nm +driver is inherently insecure. +It is not advisable to use this driver on a production machine. +.\" +.Sh MISSING FUNCTIONALITY +The +.Nm +driver does not yet support interrupts. +Since interrupts cannot be handled by the driver itself, they must be converted +into signals and delivered to the program that has registered for interrupts. +.Pp +In order to test the transmission or reception of data, some means of doing +direct memory access (DMA) by the device must be possible. This too much be +under the control of the program. The details of how a program can setup and +initiate DMA still need to be fleshed out. +.Pp +Support for non-PCI devices has not been implemented yet. +.\" +.Sh AUTHORS +The +.Nm +device driver and this manual page were written by +.An Marcel Moolenaar Aq marcel@xcllnt.net . Added: head/sys/dev/proto/proto.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/proto/proto.h Mon Apr 28 17:58:40 2014 (r265055) @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2014 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_PROTO_H_ +#define _DEV_PROTO_H_ + +#define PROTO_RES_MAX 16 + +#define PROTO_RES_UNUSED 0 +#define PROTO_RES_PCICFG 10 + +struct proto_res { + int r_type; + int r_rid; + struct resource *r_res; + u_long r_size; + union { + void *cookie; + struct cdev *cdev; + } r_u; + uintptr_t r_opened; +}; + +struct proto_softc { + device_t sc_dev; + struct proto_res sc_res[PROTO_RES_MAX]; + int sc_rescnt; +}; + +extern devclass_t proto_devclass; +extern char proto_driver_name[]; + +int proto_add_resource(struct proto_softc *, int, int, struct resource *); + +int proto_attach(device_t dev); +int proto_detach(device_t dev); + +#endif /* _DEV_PROTO_H_ */ Added: head/sys/dev/proto/proto_bus_pci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/proto/proto_bus_pci.c Mon Apr 28 17:58:40 2014 (r265055) @@ -0,0 +1,112 @@ +/*- + * Copyright (c) 2014 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +static int proto_pci_probe(device_t dev); +static int proto_pci_attach(device_t dev); + +static device_method_t proto_pci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, proto_pci_probe), + DEVMETHOD(device_attach, proto_pci_attach), + DEVMETHOD(device_detach, proto_detach), + DEVMETHOD_END +}; + +static driver_t proto_pci_driver = { + proto_driver_name, + proto_pci_methods, + sizeof(struct proto_softc), +}; + +static int +proto_pci_probe(device_t dev) +{ + struct sbuf *sb; + + /* For now we only attach to function 0 devices. */ + if (pci_get_function(dev) != 0) + return (ENXIO); + + sb = sbuf_new_auto(); + sbuf_printf(sb, "pci%d:%d:%d:%d", pci_get_domain(dev), + pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev)); + sbuf_finish(sb); + device_set_desc_copy(dev, sbuf_data(sb)); + sbuf_delete(sb); + return (BUS_PROBE_HOOVER); +} + +static int +proto_pci_attach(device_t dev) +{ + struct proto_softc *sc; + struct resource *res; + int bar, rid, type; + + sc = device_get_softc(dev); + + proto_add_resource(sc, PROTO_RES_PCICFG, 0, NULL); + + for (bar = 0; bar < PCIR_MAX_BAR_0; bar++) { + rid = PCIR_BAR(bar); + type = SYS_RES_MEMORY; + res = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE); + if (res == NULL) { + type = SYS_RES_IOPORT; + res = bus_alloc_resource_any(dev, type, &rid, + RF_ACTIVE); + } + if (res != NULL) + proto_add_resource(sc, type, rid, res); + } + + rid = 0; + type = SYS_RES_IRQ; + res = bus_alloc_resource_any(dev, type, &rid, RF_ACTIVE | RF_SHAREABLE); + if (res != NULL) + proto_add_resource(sc, type, rid, res); + return (proto_attach(dev)); +} + +DRIVER_MODULE(proto, pci, proto_pci_driver, proto_devclass, NULL, NULL); Added: head/sys/dev/proto/proto_core.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/proto/proto_core.c Mon Apr 28 17:58:40 2014 (r265055) @@ -0,0 +1,384 @@ +/*- + * Copyright (c) 2014 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +CTASSERT(SYS_RES_IRQ != PROTO_RES_UNUSED && + SYS_RES_MEMORY != PROTO_RES_UNUSED && + SYS_RES_IOPORT != PROTO_RES_UNUSED); +CTASSERT(SYS_RES_IRQ != PROTO_RES_PCICFG && + SYS_RES_MEMORY != PROTO_RES_PCICFG && + SYS_RES_IOPORT != PROTO_RES_PCICFG); + +devclass_t proto_devclass; +char proto_driver_name[] = "proto"; + +static d_open_t proto_open; +static d_close_t proto_close; +static d_read_t proto_read; +static d_write_t proto_write; +static d_ioctl_t proto_ioctl; +static d_mmap_t proto_mmap; + +struct cdevsw proto_devsw = { + .d_version = D_VERSION, + .d_flags = 0, + .d_name = proto_driver_name, + .d_open = proto_open, + .d_close = proto_close, + .d_read = proto_read, + .d_write = proto_write, + .d_ioctl = proto_ioctl, + .d_mmap = proto_mmap, +}; + +static MALLOC_DEFINE(M_PROTO, "PROTO", "PROTO driver"); + +int +proto_add_resource(struct proto_softc *sc, int type, int rid, + struct resource *res) +{ + struct proto_res *r; + + if (type == PROTO_RES_UNUSED) + return (EINVAL); + if (sc->sc_rescnt == PROTO_RES_MAX) + return (ENOSPC); + + r = sc->sc_res + sc->sc_rescnt++; + r->r_type = type; + r->r_rid = rid; + r->r_res = res; + return (0); +} + +#ifdef notyet +static int +proto_intr(void *arg) +{ + struct proto_softc *sc = arg; + + /* XXX TODO */ + return (FILTER_HANDLED); +} +#endif + +int +proto_attach(device_t dev) +{ + struct proto_softc *sc; + struct proto_res *r; + u_int res; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + for (res = 0; res < sc->sc_rescnt; res++) { + r = sc->sc_res + res; + switch (r->r_type) { + case SYS_RES_IRQ: + /* XXX TODO */ + break; + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + r->r_size = rman_get_size(r->r_res); + r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666, + "proto/%s/%02x.%s", device_get_desc(dev), r->r_rid, + (r->r_type == SYS_RES_IOPORT) ? "io" : "mem"); + r->r_u.cdev->si_drv1 = sc; + r->r_u.cdev->si_drv2 = r; + break; + case PROTO_RES_PCICFG: + r->r_size = 4096; + r->r_u.cdev = make_dev(&proto_devsw, res, 0, 0, 0666, + "proto/%s/pcicfg", device_get_desc(dev)); + r->r_u.cdev->si_drv1 = sc; + r->r_u.cdev->si_drv2 = r; + break; + } + } + return (0); +} + +int +proto_detach(device_t dev) +{ + struct proto_softc *sc; + struct proto_res *r; + u_int res; + + sc = device_get_softc(dev); + + /* Don't detach if we have open device filess. */ + for (res = 0; res < sc->sc_rescnt; res++) { + r = sc->sc_res + res; + if (r->r_opened) + return (EBUSY); + } + + for (res = 0; res < sc->sc_rescnt; res++) { + r = sc->sc_res + res; + switch (r->r_type) { + case SYS_RES_IRQ: + /* XXX TODO */ + break; + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + case PROTO_RES_PCICFG: + destroy_dev(r->r_u.cdev); + break; + } + if (r->r_res != NULL) { + bus_release_resource(dev, r->r_type, r->r_rid, + r->r_res); + r->r_res = NULL; + } + r->r_type = PROTO_RES_UNUSED; + } + sc->sc_rescnt = 0; + return (0); +} + +/* + * Device functions + */ + +static int +proto_open(struct cdev *cdev, int oflags, int devtype, struct thread *td) +{ + struct proto_res *r; + + r = cdev->si_drv2; + if (!atomic_cmpset_acq_ptr(&r->r_opened, 0UL, (uintptr_t)td->td_proc)) + return (EBUSY); + return (0); +} + +static int +proto_close(struct cdev *cdev, int fflag, int devtype, struct thread *td) +{ + struct proto_res *r; + + r = cdev->si_drv2; + if (!atomic_cmpset_acq_ptr(&r->r_opened, (uintptr_t)td->td_proc, 0UL)) + return (ENXIO); + return (0); +} + +static int +proto_read(struct cdev *cdev, struct uio *uio, int ioflag) +{ + union { + uint8_t x1[8]; + uint16_t x2[4]; + uint32_t x4[2]; + uint64_t x8[1]; + } buf; + struct proto_softc *sc; + struct proto_res *r; + device_t dev; + off_t ofs; + u_long width; + int error; + + sc = cdev->si_drv1; + dev = sc->sc_dev; + r = cdev->si_drv2; + + width = uio->uio_resid; + if (width < 1 || width > 8 || bitcount16(width) > 1) + return (EIO); + ofs = uio->uio_offset; + if (ofs + width > r->r_size) + return (EIO); + + switch (width) { + case 1: + buf.x1[0] = (r->r_type == PROTO_RES_PCICFG) ? + pci_read_config(dev, ofs, 1) : bus_read_1(r->r_res, ofs); + break; + case 2: + buf.x2[0] = (r->r_type == PROTO_RES_PCICFG) ? + pci_read_config(dev, ofs, 2) : bus_read_2(r->r_res, ofs); + break; + case 4: + buf.x4[0] = (r->r_type == PROTO_RES_PCICFG) ? + pci_read_config(dev, ofs, 4) : bus_read_4(r->r_res, ofs); + break; +#ifndef __i386__ + case 8: + if (r->r_type == PROTO_RES_PCICFG) + return (EINVAL); + buf.x8[0] = bus_read_8(r->r_res, ofs); + break; +#endif + default: + return (EIO); + } + + error = uiomove(&buf, width, uio); + return (error); +} + +static int +proto_write(struct cdev *cdev, struct uio *uio, int ioflag) +{ + union { + uint8_t x1[8]; + uint16_t x2[4]; + uint32_t x4[2]; + uint64_t x8[1]; + } buf; + struct proto_softc *sc; + struct proto_res *r; + device_t dev; + off_t ofs; + u_long width; + int error; + + sc = cdev->si_drv1; + dev = sc->sc_dev; + r = cdev->si_drv2; + + width = uio->uio_resid; + if (width < 1 || width > 8 || bitcount16(width) > 1) + return (EIO); + ofs = uio->uio_offset; + if (ofs + width > r->r_size) + return (EIO); + + error = uiomove(&buf, width, uio); + if (error) + return (error); + + switch (width) { + case 1: + if (r->r_type == PROTO_RES_PCICFG) + pci_write_config(dev, ofs, buf.x1[0], 1); + else + bus_write_1(r->r_res, ofs, buf.x1[0]); + break; + case 2: + if (r->r_type == PROTO_RES_PCICFG) + pci_write_config(dev, ofs, buf.x2[0], 2); + else + bus_write_2(r->r_res, ofs, buf.x2[0]); + break; + case 4: + if (r->r_type == PROTO_RES_PCICFG) + pci_write_config(dev, ofs, buf.x4[0], 4); + else + bus_write_4(r->r_res, ofs, buf.x4[0]); + break; +#ifndef __i386__ + case 8: + if (r->r_type == PROTO_RES_PCICFG) + return (EINVAL); + bus_write_8(r->r_res, ofs, buf.x8[0]); + break; +#endif + default: + return (EIO); + } + + return (0); +} + +static int +proto_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, + struct thread *td) +{ + struct proto_ioc_region *region; + struct proto_res *r; + int error; + + r = cdev->si_drv2; + + error = 0; + switch (cmd) { + case PROTO_IOC_REGION: + region = (struct proto_ioc_region *)data; + region->size = r->r_size; + if (r->r_type == PROTO_RES_PCICFG) + region->address = 0; + else + region->address = rman_get_start(r->r_res); + break; + default: + error = ENOIOCTL; + break; + } + return (error); +} + +static int +proto_mmap(struct cdev *cdev, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) +{ + struct proto_res *r; + + r = cdev->si_drv2; + + if (r->r_type != SYS_RES_MEMORY) + return (ENXIO); + if (offset & PAGE_MASK) + return (EINVAL); + if (prot & PROT_EXEC) + return (EACCES); + if (offset >= r->r_size) + return (EINVAL); + *paddr = rman_get_start(r->r_res) + offset; +#ifndef __sparc64__ + *memattr = VM_MEMATTR_UNCACHEABLE; +#endif + return (0); +} Added: head/sys/dev/proto/proto_dev.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/proto/proto_dev.h Mon Apr 28 17:58:40 2014 (r265055) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2014 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_PROTO_DEV_H_ +#define _DEV_PROTO_DEV_H_ + +#include + +#define PROTO_IOC_CLASS 'h' + +struct proto_ioc_region { + unsigned long address; + unsigned long size; +}; + +#define PROTO_IOC_REGION _IOWR(PROTO_IOC_CLASS, 1, struct proto_ioc_region) + +#endif /* _DEV_PROTO_H_ */ Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Apr 28 15:03:52 2014 (r265054) +++ head/sys/modules/Makefile Mon Apr 28 17:58:40 2014 (r265055) @@ -272,6 +272,7 @@ SUBDIR= \ ppi \ pps \ procfs \ + proto \ pseudofs \ ${_pst} \ pty \ Added: head/sys/modules/proto/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/proto/Makefile Mon Apr 28 17:58:40 2014 (r265055) @@ -0,0 +1,20 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/proto + +KMOD= proto +SRCS= \ + proto_bus_pci.c \ + proto_core.c + +SRCS+= \ + bus_if.h \ + device_if.h \ + pci_if.h \ + +MFILES= \ + dev/pci/pci_if.m \ + kern/bus_if.m \ + kern/device_if.m + +.include From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 18:06:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A6AFC2D; Mon, 28 Apr 2014 18:06:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 656D41CDC; Mon, 28 Apr 2014 18:06:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3SI6DDo065868; Mon, 28 Apr 2014 18:06:13 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3SI6BkI065857; Mon, 28 Apr 2014 18:06:11 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201404281806.s3SI6BkI065857@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 28 Apr 2014 18:06:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265056 - in head/tools/bus_space: . C Python X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 18:06:13 -0000 Author: marcel Date: Mon Apr 28 18:06:11 2014 New Revision: 265056 URL: http://svnweb.freebsd.org/changeset/base/265056 Log: Add a C libary and a Python module that implements an API similar to bus_space(9) and that uses the proto(4) driver for talking to hardware. If the I/O resource is a memory mapped I/O resource, then mmap(2) will be attempted to avoid read(2)/write(2) overhead. Sponsored by: Juniper Networks, Inc. Added: head/tools/bus_space/ head/tools/bus_space/C/ head/tools/bus_space/C/Makefile (contents, props changed) head/tools/bus_space/C/lang.c (contents, props changed) head/tools/bus_space/C/libbus_space.h (contents, props changed) head/tools/bus_space/Makefile (contents, props changed) head/tools/bus_space/Makefile.inc (contents, props changed) head/tools/bus_space/Python/ head/tools/bus_space/Python/Makefile (contents, props changed) head/tools/bus_space/Python/lang.c (contents, props changed) head/tools/bus_space/bus_space.c (contents, props changed) head/tools/bus_space/bus_space.h (contents, props changed) Added: head/tools/bus_space/C/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bus_space/C/Makefile Mon Apr 28 18:06:11 2014 (r265056) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +LIB= bus_space +SHLIB_MAJOR= 0 +SRCS= lang.c + +CFLAGS+= -I${.CURDIR}/.. + +.include Added: head/tools/bus_space/C/lang.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bus_space/C/lang.c Mon Apr 28 18:06:11 2014 (r265056) @@ -0,0 +1,100 @@ +/*- + * Copyright (c) 2014 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include "bus_space.h" +#include "libbus_space.h" + +int +bus_space_read_1(int rid, long ofs) +{ + uint8_t val; + + return ((!bs_read(rid, ofs, &val, sizeof(val))) ? -1 : (int)val); +} + +int +bus_space_read_2(int rid, long ofs) +{ + uint16_t val; + + return ((!bs_read(rid, ofs, &val, sizeof(val))) ? -1 : (int)val); +} + +int64_t +bus_space_read_4(int rid, long ofs) +{ + uint32_t val; + + return ((!bs_read(rid, ofs, &val, sizeof(val))) ? -1 : (int64_t)val); +} + +int +bus_space_write_1(int rid, long ofs, uint8_t val) +{ + + return ((!bs_write(rid, ofs, &val, sizeof(val))) ? errno : 0); +} + +int +bus_space_write_2(int rid, long ofs, uint16_t val) +{ + + return ((!bs_write(rid, ofs, &val, sizeof(val))) ? errno : 0); +} + +int +bus_space_write_4(int rid, long ofs, uint32_t val) +{ + + return ((!bs_write(rid, ofs, &val, sizeof(val))) ? errno : 0); +} + +int +bus_space_map(const char *dev) +{ + + return (bs_map(dev)); +} + +int +bus_space_unmap(int rid) +{ + + return ((!bs_unmap(rid)) ? errno : 0); +} + +int +bus_space_subregion(int rid, long ofs, long sz) +{ + + return (bs_subregion(rid, ofs, sz)); +} Added: head/tools/bus_space/C/libbus_space.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bus_space/C/libbus_space.h Mon Apr 28 18:06:11 2014 (r265056) @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2014 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LIBBUS_SPACE_H_ +#define _LIBBUS_SPACE_H_ + +int bus_space_map(const char *dev); +int bus_space_read_1(int rid, long ofs); +int bus_space_read_2(int rid, long ofs); +int64_t bus_space_read_4(int rid, long ofs); +int bus_space_subregion(int rid, long ofs, long sz); +int bus_space_unmap(int rid); +int bus_space_write_1(int rid, long ofs, uint8_t val); +int bus_space_write_2(int rid, long ofs, uint16_t val); +int bus_space_write_4(int rid, long ofs, uint32_t val); + +#endif /* _LIBBUS_SPACE_H_ */ Added: head/tools/bus_space/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bus_space/Makefile Mon Apr 28 18:06:11 2014 (r265056) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +SUBDIR= \ + C \ + Python + +.include Added: head/tools/bus_space/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bus_space/Makefile.inc Mon Apr 28 18:06:11 2014 (r265056) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/.. +SRCS+= bus_space.c Added: head/tools/bus_space/Python/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bus_space/Python/Makefile Mon Apr 28 18:06:11 2014 (r265056) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +SHLIB_NAME= bus_space.so +SRCS= lang.c + +CFLAGS+= -I${.CURDIR}/.. -I/usr/local/include/python2.7 +LDFLAGS+= -L/usr/local/lib -lpython2.7 + +.include Added: head/tools/bus_space/Python/lang.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bus_space/Python/lang.c Mon Apr 28 18:06:11 2014 (r265056) @@ -0,0 +1,200 @@ +/*- + * Copyright (c) 2014 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include "bus_space.h" + +static PyObject * +bus_read_1(PyObject *self, PyObject *args) +{ + long ofs; + int rid; + uint8_t val; + + if (!PyArg_ParseTuple(args, "il", &rid, &ofs)) + return (NULL); + if (!bs_read(rid, ofs, &val, sizeof(val))) { + PyErr_SetString(PyExc_IOError, strerror(errno)); + return (NULL); + } + return (Py_BuildValue("B", val)); +} + +static PyObject * +bus_read_2(PyObject *self, PyObject *args) +{ + long ofs; + int rid; + uint16_t val; + + if (!PyArg_ParseTuple(args, "il", &rid, &ofs)) + return (NULL); + if (!bs_read(rid, ofs, &val, sizeof(val))) { + PyErr_SetString(PyExc_IOError, strerror(errno)); + return (NULL); + } + return (Py_BuildValue("H", val)); +} + +static PyObject * +bus_read_4(PyObject *self, PyObject *args) +{ + long ofs; + int rid; + uint32_t val; + + if (!PyArg_ParseTuple(args, "il", &rid, &ofs)) + return (NULL); + if (!bs_read(rid, ofs, &val, sizeof(val))) { + PyErr_SetString(PyExc_IOError, strerror(errno)); + return (NULL); + } + return (Py_BuildValue("I", val)); +} + +static PyObject * +bus_write_1(PyObject *self, PyObject *args) +{ + long ofs; + int rid; + uint8_t val; + + if (!PyArg_ParseTuple(args, "ilB", &rid, &ofs, &val)) + return (NULL); + if (!bs_write(rid, ofs, &val, sizeof(val))) { + PyErr_SetString(PyExc_IOError, strerror(errno)); + return (NULL); + } + Py_RETURN_NONE; +} + +static PyObject * +bus_write_2(PyObject *self, PyObject *args) +{ + long ofs; + int rid; + uint16_t val; + + if (!PyArg_ParseTuple(args, "ilH", &rid, &ofs, &val)) + return (NULL); + if (!bs_write(rid, ofs, &val, sizeof(val))) { + PyErr_SetString(PyExc_IOError, strerror(errno)); + return (NULL); + } + Py_RETURN_NONE; +} + +static PyObject * +bus_write_4(PyObject *self, PyObject *args) +{ + long ofs; + int rid; + uint32_t val; + + if (!PyArg_ParseTuple(args, "ilI", &rid, &ofs, &val)) + return (NULL); + if (!bs_write(rid, ofs, &val, sizeof(val))) { + PyErr_SetString(PyExc_IOError, strerror(errno)); + return (NULL); + } + Py_RETURN_NONE; +} + +static PyObject * +bus_map(PyObject *self, PyObject *args) +{ + char *dev; + int rid; + + if (!PyArg_ParseTuple(args, "s", &dev)) + return (NULL); + rid = bs_map(dev); + if (rid == -1) { + PyErr_SetString(PyExc_IOError, strerror(errno)); + return (NULL); + } + return (Py_BuildValue("i", rid)); +} + +static PyObject * +bus_unmap(PyObject *self, PyObject *args) +{ + int rid; + + if (!PyArg_ParseTuple(args, "i", &rid)) + return (NULL); + if (!bs_unmap(rid)) { + PyErr_SetString(PyExc_IOError, strerror(errno)); + return (NULL); + } + Py_RETURN_NONE; +} + +static PyObject * +bus_subregion(PyObject *self, PyObject *args) +{ + long ofs, sz; + int rid0, rid; + + if (!PyArg_ParseTuple(args, "ill", &rid0, &ofs, &sz)) + return (NULL); + rid = bs_subregion(rid0, ofs, sz); + if (rid == -1) { + PyErr_SetString(PyExc_IOError, strerror(errno)); + return (NULL); + } + return (Py_BuildValue("i", rid)); +} + +static PyMethodDef bus_space_methods[] = { + { "read_1", bus_read_1, METH_VARARGS, "Read a 1-byte data item." }, + { "read_2", bus_read_2, METH_VARARGS, "Read a 2-byte data item." }, + { "read_4", bus_read_4, METH_VARARGS, "Read a 4-byte data item." }, + + { "write_1", bus_write_1, METH_VARARGS, "Write a 1-byte data item." }, + { "write_2", bus_write_2, METH_VARARGS, "Write a 2-byte data item." }, + { "write_4", bus_write_4, METH_VARARGS, "Write a 4-byte data item." }, + + { "map", bus_map, METH_VARARGS, + "Return a resource ID for a device file created by proto(4)" }, + { "unmap", bus_unmap, METH_VARARGS, + "Free a resource ID" }, + { "subregion", bus_subregion, METH_VARARGS, + "Return a resource ID for a subregion of another resource ID" }, + + { NULL, NULL, 0, NULL } +}; + +PyMODINIT_FUNC +initbus_space(void) +{ + + Py_InitModule("bus_space", bus_space_methods); +} Added: head/tools/bus_space/bus_space.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bus_space/bus_space.c Mon Apr 28 18:06:11 2014 (r265056) @@ -0,0 +1,263 @@ +/*- + * Copyright (c) 2014 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include "bus_space.h" + +#include "../../sys/dev/proto/proto_dev.h" + +struct resource { + int rid; + int fd; + long addr; + long size; + off_t ofs; + caddr_t ptr; +}; + +static struct resource *ridtbl = NULL; +static int nrids = 0; + +static int +rid_alloc(void) +{ + void *newtbl; + int rid; + + for (rid = 0; rid < nrids; rid++) { + if (ridtbl[rid].fd == -1) + break; + } + if (rid == nrids) { + nrids++; + newtbl = realloc(ridtbl, sizeof(struct resource) * nrids); + if (newtbl == NULL) { + nrids--; + return (-1); + } else + ridtbl = newtbl; + } + ridtbl[rid].fd = INT_MAX; + return (rid); +} + +static struct resource * +rid_lookup(int rid) +{ + struct resource *r; + + if (rid < 0 || rid >= nrids) { + errno = EINVAL; + return (NULL); + } + r = ridtbl + rid; + if (r->fd == -1) { + errno = ENXIO; + return (NULL); + } + return (r); +} + +int +bs_map(const char *dev) +{ + struct proto_ioc_region region; + struct resource *r; + int rid; + + rid = rid_alloc(); + if (rid == -1) + return (-1); + r = rid_lookup(rid); + if (r == NULL) + return (-1); + r->fd = open(dev, O_RDWR); + if (r->fd == -1) + return (-1); + r->rid = -1; + if (ioctl(r->fd, PROTO_IOC_REGION, ®ion) == -1) { + close(r->fd); + r->fd = -1; + return (-1); + } + r->addr = region.address; + r->size = region.size; + r->ofs = 0; + r->ptr = mmap(NULL, r->size, PROT_READ | PROT_WRITE, + MAP_NOCORE | MAP_SHARED, r->fd, r->ofs); + return (rid); +} + +int +bs_read(int rid, off_t ofs, void *buf, ssize_t bufsz) +{ + struct resource *r; + volatile void *ptr; + off_t o; + ssize_t s; + + r = rid_lookup(rid); + if (r == NULL) + return (0); + if (ofs < 0 || ofs > r->size - bufsz) { + errno = ESPIPE; + return (0); + } + ofs += r->ofs; + if (r->ptr != MAP_FAILED) { + ptr = r->ptr + ofs; + switch (bufsz) { + case 1: + *((uint8_t *)buf) = *((volatile uint8_t *)ptr); + break; + case 2: + *((uint16_t *)buf) = *((volatile uint16_t *)ptr); + break; + case 4: + *((uint32_t *)buf) = *((volatile uint32_t *)ptr); + break; + default: + errno = EIO; + return (0); + } + } else { + o = lseek(r->fd, ofs, SEEK_SET); + if (o != ofs) + return (0); + s = read(r->fd, buf, bufsz); + if (s != bufsz) + return (0); + } + return (1); +} + +int +bs_subregion(int rid0, long ofs, long sz) +{ + struct resource *r; + void *ptr0; + long addr0, ofs0; + int fd0, rid; + + r = rid_lookup(rid0); + if (r == NULL) + return (-1); + if (ofs < 0 || sz < 1) { + errno = EINVAL; + return (-1); + } + if (ofs + sz > r->size) { + errno = ENOSPC; + return (-1); + } + fd0 = r->fd; + addr0 = r->addr; + ofs0 = r->ofs; + ptr0 = r->ptr; + rid = rid_alloc(); + if (rid == -1) + return (-1); + r = rid_lookup(rid); + if (r == NULL) + return (-1); + r->rid = rid0; + r->fd = fd0; + r->addr = addr0 + ofs; + r->size = sz; + r->ofs = ofs0 + ofs; + r->ptr = ptr0; + return (rid); +} + +int +bs_unmap(int rid) +{ + struct resource *r; + + r = rid_lookup(rid); + if (r == NULL) + return (0); + if (r->rid == -1) { + if (r->ptr != MAP_FAILED) + munmap(r->ptr, r->size); + close(r->fd); + } + r->fd = -1; + return (1); +} + +int +bs_write(int rid, off_t ofs, void *buf, ssize_t bufsz) +{ + struct resource *r; + volatile void *ptr; + off_t o; + ssize_t s; + + r = rid_lookup(rid); + if (r == NULL) + return (0); + if (ofs < 0 || ofs > r->size - bufsz) { + errno = ESPIPE; + return (0); + } + ofs += r->ofs; + if (r->ptr != MAP_FAILED) { + ptr = r->ptr + ofs; + switch (bufsz) { + case 1: + *((volatile uint8_t *)ptr) = *((uint8_t *)buf); + break; + case 2: + *((volatile uint16_t *)ptr) = *((uint16_t *)buf); + break; + case 4: + *((volatile uint32_t *)ptr) = *((uint32_t *)buf); + break; + default: + errno = EIO; + return (0); + } + } else { + o = lseek(r->fd, ofs, SEEK_SET); + if (o != ofs) + return (0); + s = write(r->fd, buf, bufsz); + if (s != bufsz) + return (0); + } + return (1); +} Added: head/tools/bus_space/bus_space.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/bus_space/bus_space.h Mon Apr 28 18:06:11 2014 (r265056) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2014 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _TOOLS_BUS_SPACE_H_ +#define _TOOLS_BUS_SPACE_H_ + +int bs_map(const char *dev); +int bs_read(int rid, off_t ofs, void *buf, ssize_t bufsz); +int bs_subregion(int rid0, long ofs, long sz); +int bs_unmap(int rid); +int bs_write(int rid, off_t ofs, void *buf, ssize_t bufsz); + +#endif /* _TOOLS_BUS_SPACE_H_ */ From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 18:25:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 132B7537; Mon, 28 Apr 2014 18:25:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3686106D; Mon, 28 Apr 2014 18:25:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3SIPLec074358; Mon, 28 Apr 2014 18:25:21 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3SIPLlv074357; Mon, 28 Apr 2014 18:25:21 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201404281825.s3SIPLlv074357@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 28 Apr 2014 18:25:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265057 - head/sys/boot/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 18:25:22 -0000 Author: nwhitehorn Date: Mon Apr 28 18:25:21 2014 New Revision: 265057 URL: http://svnweb.freebsd.org/changeset/base/265057 Log: Turn off various fancy instruction sets, as well as deduplicate some options. This makes the EFI loader build work with CPUTYPE=native in make.conf on my Core i5. Modified: head/sys/boot/amd64/Makefile.inc Modified: head/sys/boot/amd64/Makefile.inc ============================================================================== --- head/sys/boot/amd64/Makefile.inc Mon Apr 28 18:06:11 2014 (r265056) +++ head/sys/boot/amd64/Makefile.inc Mon Apr 28 18:25:21 2014 (r265057) @@ -4,8 +4,9 @@ BINDIR?= /boot +# See conf/kern.mk for the correct set of these CFLAGS+= -ffreestanding -CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float +CFLAGS+= -mno-mmx -mno-sse -mno-aes -mno-avx -msoft-float LDFLAGS+= -nostdlib .include "../Makefile.inc" From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 18:41:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B82D98A; Mon, 28 Apr 2014 18:41:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E9D911C5; Mon, 28 Apr 2014 18:41:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3SIfQZR080290; Mon, 28 Apr 2014 18:41:26 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3SIfQ4F080289; Mon, 28 Apr 2014 18:41:26 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201404281841.s3SIfQ4F080289@svn.freebsd.org> From: Peter Grehan Date: Mon, 28 Apr 2014 18:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265058 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 18:41:26 -0000 Author: grehan Date: Mon Apr 28 18:41:25 2014 New Revision: 265058 URL: http://svnweb.freebsd.org/changeset/base/265058 Log: Implement legacy interrupts for the AHCI device emulation according to the method outlined in the AHCI spec. Tested with FreeBSD 9/10/11 with MSI disabled, and also NetBSD/amd64 (lightly). Reviewed by: neel, tychon MFC after: 3 weeks Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Mon Apr 28 18:25:21 2014 (r265057) +++ head/usr.sbin/bhyve/pci_ahci.c Mon Apr 28 18:41:25 2014 (r265058) @@ -192,6 +192,7 @@ struct pci_ahci_softc { uint32_t em_ctl; uint32_t cap2; uint32_t bohc; + uint32_t lintr; struct ahci_port port[MAX_PORTS]; }; #define ahci_ctx(sc) ((sc)->asc_pi->pi_vmctx) @@ -211,8 +212,11 @@ static inline void lba_to_msf(uint8_t *b static void ahci_generate_intr(struct pci_ahci_softc *sc) { + struct pci_devinst *pi; int i; + pi = sc->asc_pi; + for (i = 0; i < sc->ports; i++) { struct ahci_port *pr; pr = &sc->port[i]; @@ -222,8 +226,28 @@ ahci_generate_intr(struct pci_ahci_softc DPRINTF("%s %x\n", __func__, sc->is); - if (sc->is && (sc->ghc & AHCI_GHC_IE)) - pci_generate_msi(sc->asc_pi, 0); + if (sc->is && (sc->ghc & AHCI_GHC_IE)) { + if (pci_msi_enabled(pi)) { + /* + * Generate an MSI interrupt on every edge + */ + pci_generate_msi(pi, 0); + } else if (!sc->lintr) { + /* + * Only generate a pin-based interrupt if one wasn't + * in progress + */ + sc->lintr = 1; + pci_lintr_assert(pi); + } + } else if (sc->lintr) { + /* + * No interrupts: deassert pin-based signal if it had + * been asserted + */ + pci_lintr_deassert(pi); + sc->lintr = 0; + } } static void @@ -367,6 +391,12 @@ ahci_reset(struct pci_ahci_softc *sc) sc->ghc = AHCI_GHC_AE; sc->is = 0; + + if (sc->lintr) { + pci_lintr_deassert(sc->asc_pi); + sc->lintr = 0; + } + for (i = 0; i < sc->ports; i++) { sc->port[i].ie = 0; sc->port[i].is = 0; @@ -1814,6 +1844,8 @@ pci_ahci_init(struct vmctx *ctx, struct pci_emul_alloc_bar(pi, 5, PCIBAR_MEM32, AHCI_OFFSET + sc->ports * AHCI_STEP); + pci_lintr_request(pi); + open_fail: if (ret) { blockif_close(sc->port[0].bctx); From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 18:54:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA2EBD0A; Mon, 28 Apr 2014 18:54:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A677D132F; Mon, 28 Apr 2014 18:54:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3SIsCkQ086418; Mon, 28 Apr 2014 18:54:12 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3SIsCYY086417; Mon, 28 Apr 2014 18:54:12 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201404281854.s3SIsCYY086417@svn.freebsd.org> From: Andrew Turner Date: Mon, 28 Apr 2014 18:54:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265059 - head/lib/libc/arm/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 18:54:12 -0000 Author: andrew Date: Mon Apr 28 18:54:12 2014 New Revision: 265059 URL: http://svnweb.freebsd.org/changeset/base/265059 Log: Set the new floating point exception mask correctly Submitted by: Keith White Modified: head/lib/libc/arm/gen/fpsetmask_vfp.c Modified: head/lib/libc/arm/gen/fpsetmask_vfp.c ============================================================================== --- head/lib/libc/arm/gen/fpsetmask_vfp.c Mon Apr 28 18:41:25 2014 (r265058) +++ head/lib/libc/arm/gen/fpsetmask_vfp.c Mon Apr 28 18:54:12 2014 (r265059) @@ -45,7 +45,7 @@ fpsetmask(fp_except_t mask) __asm __volatile("vmrs %0, fpscr" : "=&r"(old)); mask = (mask & FP_X_MASK) << 8; new = (old & ~(FP_X_MASK << 8)) | mask; - __asm __volatile("vmsr fpscr, %0" : : "r"(old)); + __asm __volatile("vmsr fpscr, %0" : : "r"(new)); return ((old >> 8) & FP_X_MASK); } From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 18:54:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE09BE44; Mon, 28 Apr 2014 18:54:56 +0000 (UTC) Received: from mail-wg0-x22b.google.com (mail-wg0-x22b.google.com [IPv6:2a00:1450:400c:c00::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 723E61335; Mon, 28 Apr 2014 18:54:55 +0000 (UTC) Received: by mail-wg0-f43.google.com with SMTP id x12so2294854wgg.2 for ; Mon, 28 Apr 2014 11:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=kXfcZEXtwdDdUD+pYi7vmkYrljvwnO3UgFbdlygBm9w=; b=BmQLEany2DJ7U3SMSLcBIeFScrORONNwL8vtDfeeXoShfsVnfpY51IlROOHcU3wqIM 2KRydfZtaOoNKiKnyH6B79Fd8j1EZm1ZKzbekH30R8K4R+CNAMtZx5t8h8F+DZ++4fSF Q3PSxhhNqHrsNdCju6fZBFnEV9jEwZqWt+Vno7SlGGmXGPz2Wb4KqOvMpPPheRBikyvY x78jEMldR0/oNLvViddtYpqVUhkHQf+D9f3/kc8dyWLh3mxxi1ETtpGMPVogXO5qh4I8 QjW2XBzRK7ZAN5DuqzP/adp+lUdsEOLmKb9qo0ATrN88Af7UnxxUvOLmzIdmo8y6KT4Q wT7w== MIME-Version: 1.0 X-Received: by 10.194.92.81 with SMTP id ck17mr20747286wjb.14.1398711293733; Mon, 28 Apr 2014 11:54:53 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.194.168.130 with HTTP; Mon, 28 Apr 2014 11:54:53 -0700 (PDT) In-Reply-To: References: <201307261941.r6QJfEMO087844@svn.freebsd.org> <20140425180900.GP85571@FreeBSD.org> <20140428085334.GV85571@FreeBSD.org> Date: Mon, 28 Apr 2014 12:54:53 -0600 X-Google-Sender-Auth: 9yAUOsxZ2w-jxs-rXsYrEMDlpgk Message-ID: Subject: Re: svn commit: r253687 - head/sys/net From: Alan Somers To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: "src-committers@freebsd.org" , Alan Somers , "svn-src-all@freebsd.org" , scottl@freebsd.org, Gleb Smirnoff , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 18:54:56 -0000 On Mon, Apr 28, 2014 at 11:55 AM, Adrian Chadd wrote: > On 28 April 2014 01:53, Gleb Smirnoff wrote: >> On Fri, Apr 25, 2014 at 02:09:21PM -0700, Adrian Chadd wrote: >> A> Someone else should do it. >> >> Someone else can simply revert a commit that introduces a LOR and >> adds nonstandard undocumented configuration knobs. > > Please do. I'm no longer doing anything with the link aggregation > stuff here and I just don't have the time. > > > -a Scott Long has volunteered to fix it. And please move future discussion to GNATS at http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/188997 . From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 20:38:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DEAC1F95; Mon, 28 Apr 2014 20:38:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEB771E82; Mon, 28 Apr 2014 20:38:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3SKc8Lv029141; Mon, 28 Apr 2014 20:38:08 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3SKc8Ug029140; Mon, 28 Apr 2014 20:38:08 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201404282038.s3SKc8Ug029140@svn.freebsd.org> From: Brooks Davis Date: Mon, 28 Apr 2014 20:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265060 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 20:38:09 -0000 Author: brooks Date: Mon Apr 28 20:38:08 2014 New Revision: 265060 URL: http://svnweb.freebsd.org/changeset/base/265060 Log: Revert r263754, re-adding support for hw.bus.devctl_disable. Breaking old devd's and thus hosts that get IP addresses from DHCP was too much of a POLA violation. The sysctl may be removed again after r263758 has been merged to at least stable/9 and stable/10, and releases have been cut from those branches. Discussed with: mjg Reported by: theraven, rwatson Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Apr 28 18:54:12 2014 (r265059) +++ head/sys/kern/subr_bus.c Mon Apr 28 20:38:08 2014 (r265060) @@ -355,6 +355,13 @@ device_sysctl_fini(device_t dev) * tested since 3.4 or 2.2.8! */ +/* Deprecated way to adjust queue length */ +static int sysctl_devctl_disable(SYSCTL_HANDLER_ARGS); +/* XXX Need to support old-style tunable hw.bus.devctl_disable" */ +SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW | + CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_disable, "I", + "devctl disable -- deprecated"); + #define DEVCTL_DEFAULT_QUEUE_LEN 1000 static int sysctl_devctl_queue(SYSCTL_HANDLER_ARGS); static int devctl_queue_length = DEVCTL_DEFAULT_QUEUE_LEN; @@ -685,9 +692,9 @@ devctl_notify(const char *system, const * Common routine that tries to make sending messages as easy as possible. * We allocate memory for the data, copy strings into that, but do not * free it unless there's an error. The dequeue part of the driver should - * free the data. We don't send data when queue length is 0. We do send - * data, even when we have no listeners, because we wish to avoid races - * relating to startup and restart of listening applications. + * free the data. We don't send data when the device is disabled. We do + * send data, even when we have no listeners, because we wish to avoid + * races relating to startup and restart of listening applications. * * devaddq is designed to string together the type of event, with the * object of that event, plus the plug and play info and location info @@ -779,6 +786,33 @@ devnomatch(device_t dev) } static int +sysctl_devctl_disable(SYSCTL_HANDLER_ARGS) +{ + struct dev_event_info *n1; + int dis, error; + + dis = devctl_queue_length == 0; + error = sysctl_handle_int(oidp, &dis, 0, req); + if (error || !req->newptr) + return (error); + mtx_lock(&devsoftc.mtx); + if (dis) { + while (!TAILQ_EMPTY(&devsoftc.devq)) { + n1 = TAILQ_FIRST(&devsoftc.devq); + TAILQ_REMOVE(&devsoftc.devq, n1, dei_link); + free(n1->dei_data, M_BUS); + free(n1, M_BUS); + } + devsoftc.queued = 0; + devctl_queue_length = 0; + } else { + devctl_queue_length = DEVCTL_DEFAULT_QUEUE_LEN; + } + mtx_unlock(&devsoftc.mtx); + return (0); +} + +static int sysctl_devctl_queue(SYSCTL_HANDLER_ARGS) { struct dev_event_info *n1; From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 20:40:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A05DB25B; Mon, 28 Apr 2014 20:40:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D8B81FAE; Mon, 28 Apr 2014 20:40:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3SKeaRB029918; Mon, 28 Apr 2014 20:40:36 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3SKea1e029917; Mon, 28 Apr 2014 20:40:36 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201404282040.s3SKea1e029917@svn.freebsd.org> From: Glen Barber Date: Mon, 28 Apr 2014 20:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265061 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 20:40:36 -0000 Author: gjb Date: Mon Apr 28 20:40:36 2014 New Revision: 265061 URL: http://svnweb.freebsd.org/changeset/base/265061 Log: Remove note about hw.bus.devctl_disable removal, restored in r265060. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Apr 28 20:38:08 2014 (r265060) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Apr 28 20:40:36 2014 (r265061) @@ -104,10 +104,6 @@ Kernel Changes - The &man.sysctl.8; - hw.bus.devctl_disable has been - removed. - Support for GPS ports has been added to &man.uhso.4;. From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 22:06:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 587B74CB; Mon, 28 Apr 2014 22:06:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 390A61789; Mon, 28 Apr 2014 22:06:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3SM6g48066826; Mon, 28 Apr 2014 22:06:42 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3SM6e6W066814; Mon, 28 Apr 2014 22:06:40 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201404282206.s3SM6e6W066814@svn.freebsd.org> From: Neel Natu Date: Mon, 28 Apr 2014 22:06:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265062 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 22:06:42 -0000 Author: neel Date: Mon Apr 28 22:06:40 2014 New Revision: 265062 URL: http://svnweb.freebsd.org/changeset/base/265062 Log: Allow a virtual machine to be forcibly reset or powered off. This is done by adding an argument to the VM_SUSPEND ioctl that specifies how the virtual machine should be suspended, viz. VM_SUSPEND_RESET or VM_SUSPEND_POWEROFF. The disposition of VM_SUSPEND is also made available to the exit handler via the 'u.suspended' member of 'struct vm_exit'. This capability is exposed via the '--force-reset' and '--force-poweroff' arguments to /usr/sbin/bhyvectl. Discussed with: grehan@ Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_dev.c head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyvectl/bhyvectl.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Mon Apr 28 20:40:36 2014 (r265061) +++ head/lib/libvmmapi/vmmapi.c Mon Apr 28 22:06:40 2014 (r265062) @@ -343,10 +343,13 @@ vm_run(struct vmctx *ctx, int vcpu, uint } int -vm_suspend(struct vmctx *ctx) +vm_suspend(struct vmctx *ctx, enum vm_suspend_how how) { + struct vm_suspend vmsuspend; - return (ioctl(ctx->fd, VM_SUSPEND, 0)); + bzero(&vmsuspend, sizeof(vmsuspend)); + vmsuspend.how = how; + return (ioctl(ctx->fd, VM_SUSPEND, &vmsuspend)); } static int Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Mon Apr 28 20:40:36 2014 (r265061) +++ head/lib/libvmmapi/vmmapi.h Mon Apr 28 22:06:40 2014 (r265062) @@ -61,7 +61,7 @@ int vm_set_register(struct vmctx *ctx, i int vm_get_register(struct vmctx *ctx, int vcpu, int reg, uint64_t *retval); int vm_run(struct vmctx *ctx, int vcpu, uint64_t rip, struct vm_exit *ret_vmexit); -int vm_suspend(struct vmctx *ctx); +int vm_suspend(struct vmctx *ctx, enum vm_suspend_how how); int vm_apicid2vcpu(struct vmctx *ctx, int apicid); int vm_inject_exception(struct vmctx *ctx, int vcpu, int vec); int vm_inject_exception2(struct vmctx *ctx, int vcpu, int vec, int errcode); Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Mon Apr 28 20:40:36 2014 (r265061) +++ head/sys/amd64/include/vmm.h Mon Apr 28 22:06:40 2014 (r265062) @@ -29,6 +29,13 @@ #ifndef _VMM_H_ #define _VMM_H_ +enum vm_suspend_how { + VM_SUSPEND_NONE, + VM_SUSPEND_RESET, + VM_SUSPEND_POWEROFF, + VM_SUSPEND_LAST +}; + #ifdef _KERNEL #define VM_MAX_NAMELEN 32 @@ -115,7 +122,7 @@ int vm_get_seg_desc(struct vm *vm, int v int vm_set_seg_desc(struct vm *vm, int vcpu, int reg, struct seg_desc *desc); int vm_run(struct vm *vm, struct vm_run *vmrun); -int vm_suspend(struct vm *vm); +int vm_suspend(struct vm *vm, enum vm_suspend_how how); int vm_inject_nmi(struct vm *vm, int vcpu); int vm_nmi_pending(struct vm *vm, int vcpuid); void vm_nmi_clear(struct vm *vm, int vcpuid); @@ -134,6 +141,7 @@ int vm_apicid2vcpuid(struct vm *vm, int void vm_activate_cpu(struct vm *vm, int vcpu); cpuset_t vm_active_cpus(struct vm *vm); struct vm_exit *vm_exitinfo(struct vm *vm, int vcpuid); +void vm_exit_suspended(struct vm *vm, int vcpuid, uint64_t rip); /* * Rendezvous all vcpus specified in 'dest' and execute 'func(arg)'. @@ -382,6 +390,9 @@ struct vm_exit { struct { int vector; } ioapic_eoi; + struct { + enum vm_suspend_how how; + } suspended; } u; }; Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Mon Apr 28 20:40:36 2014 (r265061) +++ head/sys/amd64/include/vmm_dev.h Mon Apr 28 22:06:40 2014 (r265062) @@ -159,6 +159,10 @@ struct vm_hpet_cap { uint32_t capabilities; /* lower 32 bits of HPET capabilities */ }; +struct vm_suspend { + enum vm_suspend_how how; +}; + enum { /* general routines */ IOCNUM_ABIVERS = 0, @@ -214,7 +218,7 @@ enum { #define VM_RUN \ _IOWR('v', IOCNUM_RUN, struct vm_run) #define VM_SUSPEND \ - _IO('v', IOCNUM_SUSPEND) + _IOW('v', IOCNUM_SUSPEND, struct vm_suspend) #define VM_MAP_MEMORY \ _IOWR('v', IOCNUM_MAP_MEMORY, struct vm_memory_segment) #define VM_GET_MEMORY_SEG \ Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Mon Apr 28 20:40:36 2014 (r265061) +++ head/sys/amd64/vmm/intel/vmx.c Mon Apr 28 22:06:40 2014 (r265062) @@ -2045,16 +2045,6 @@ vmx_exit_rendezvous(struct vmx *vmx, int } static __inline int -vmx_exit_suspended(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) -{ - - vmexit->rip = vmcs_guest_rip(); - vmexit->inst_length = 0; - vmexit->exitcode = VM_EXITCODE_SUSPENDED; - return (UNHANDLED); -} - -static __inline int vmx_exit_inst_error(struct vmxctx *vmxctx, int rc, struct vm_exit *vmexit) { @@ -2173,7 +2163,8 @@ vmx_run(void *arg, int vcpu, register_t disable_intr(); if (vcpu_suspended(suspend_cookie)) { enable_intr(); - handled = vmx_exit_suspended(vmx, vcpu, vmexit); + vm_exit_suspended(vmx->vm, vcpu, vmcs_guest_rip()); + handled = UNHANDLED; break; } Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Mon Apr 28 20:40:36 2014 (r265061) +++ head/sys/amd64/vmm/vmm.c Mon Apr 28 22:06:40 2014 (r265062) @@ -1211,16 +1211,45 @@ vm_handle_suspend(struct vm *vm, int vcp } int -vm_suspend(struct vm *vm) +vm_suspend(struct vm *vm, enum vm_suspend_how how) { + int i; - if (atomic_cmpset_int(&vm->suspend, 0, 1)) { - VM_CTR0(vm, "virtual machine suspended"); - return (0); - } else { - VM_CTR0(vm, "virtual machine already suspended"); + if (how <= VM_SUSPEND_NONE || how >= VM_SUSPEND_LAST) + return (EINVAL); + + if (atomic_cmpset_int(&vm->suspend, 0, how) == 0) { + VM_CTR2(vm, "virtual machine already suspended %d/%d", + vm->suspend, how); return (EALREADY); } + + VM_CTR1(vm, "virtual machine successfully suspended %d", how); + + /* + * Notify all active vcpus that they are now suspended. + */ + for (i = 0; i < VM_MAXCPU; i++) { + if (CPU_ISSET(i, &vm->active_cpus)) + vcpu_notify_event(vm, i, false); + } + + return (0); +} + +void +vm_exit_suspended(struct vm *vm, int vcpuid, uint64_t rip) +{ + struct vm_exit *vmexit; + + KASSERT(vm->suspend > VM_SUSPEND_NONE && vm->suspend < VM_SUSPEND_LAST, + ("vm_exit_suspended: invalid suspend type %d", vm->suspend)); + + vmexit = vm_exitinfo(vm, vcpuid); + vmexit->rip = rip; + vmexit->inst_length = 0; + vmexit->exitcode = VM_EXITCODE_SUSPENDED; + vmexit->u.suspended.how = vm->suspend; } int Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Mon Apr 28 20:40:36 2014 (r265061) +++ head/sys/amd64/vmm/vmm_dev.c Mon Apr 28 22:06:40 2014 (r265062) @@ -166,6 +166,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c struct vm_stat_desc *statdesc; struct vm_x2apic *x2apic; struct vm_gpa_pte *gpapte; + struct vm_suspend *vmsuspend; sc = vmmdev_lookup2(cdev); if (sc == NULL) @@ -241,7 +242,8 @@ vmmdev_ioctl(struct cdev *cdev, u_long c error = vm_run(sc->vm, vmrun); break; case VM_SUSPEND: - error = vm_suspend(sc->vm); + vmsuspend = (struct vm_suspend *)data; + error = vm_suspend(sc->vm, vmsuspend->how); break; case VM_STAT_DESC: { statdesc = (struct vm_stat_desc *)data; Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Mon Apr 28 20:40:36 2014 (r265061) +++ head/usr.sbin/bhyve/bhyverun.c Mon Apr 28 22:06:40 2014 (r265062) @@ -461,17 +461,18 @@ vmexit_inst_emul(struct vmctx *ctx, stru static pthread_mutex_t resetcpu_mtx = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t resetcpu_cond = PTHREAD_COND_INITIALIZER; -static int resetcpu = -1; static int vmexit_suspend(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) { - - assert(resetcpu != -1); + enum vm_suspend_how how; + + how = vmexit->u.suspended.how; + assert(how == VM_SUSPEND_RESET || how == VM_SUSPEND_POWEROFF); fbsdrun_deletecpu(ctx, *pvcpu); - if (*pvcpu != resetcpu) { + if (*pvcpu != BSP) { pthread_mutex_lock(&resetcpu_mtx); pthread_cond_signal(&resetcpu_cond); pthread_mutex_unlock(&resetcpu_mtx); @@ -483,7 +484,12 @@ vmexit_suspend(struct vmctx *ctx, struct pthread_cond_wait(&resetcpu_cond, &resetcpu_mtx); } pthread_mutex_unlock(&resetcpu_mtx); - exit(0); + + if (how == VM_SUSPEND_RESET) + exit(0); + if (how == VM_SUSPEND_POWEROFF) + exit(1); + return (0); /* NOTREACHED */ } static vmexit_handler_t handler[VM_EXITCODE_MAX] = { @@ -505,6 +511,7 @@ vm_loop(struct vmctx *ctx, int vcpu, uin cpuset_t mask; int error, rc, prevcpu; enum vm_exitcode exitcode; + enum vm_suspend_how how; if (pincpu >= 0) { CPU_ZERO(&mask); @@ -538,10 +545,13 @@ vm_loop(struct vmctx *ctx, int vcpu, uin rip = vmexit[vcpu].rip; break; case VMEXIT_RESET: - if (vm_suspend(ctx) == 0) { - assert(resetcpu == -1); - resetcpu = vcpu; - } + case VMEXIT_POWEROFF: + if (rc == VMEXIT_RESET) + how = VM_SUSPEND_RESET; + else + how = VM_SUSPEND_POWEROFF; + error = vm_suspend(ctx, how); + assert(error == 0 || errno == EALREADY); rip = vmexit[vcpu].rip + vmexit[vcpu].inst_length; break; default: Modified: head/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- head/usr.sbin/bhyvectl/bhyvectl.c Mon Apr 28 20:40:36 2014 (r265061) +++ head/usr.sbin/bhyvectl/bhyvectl.c Mon Apr 28 22:06:40 2014 (r265062) @@ -191,13 +191,16 @@ usage(void) " [--get-highmem]\n" " [--get-gpa-pmap]\n" " [--assert-lapic-lvt=]\n" - " [--inject-nmi]\n", + " [--inject-nmi]\n" + " [--force-reset]\n" + " [--force-poweroff]\n", progname); exit(1); } static int get_stats, getcap, setcap, capval, get_gpa_pmap; static int inject_nmi, assert_lapic_lvt; +static int force_reset, force_poweroff; static const char *capname; static int create, destroy, get_lowmem, get_highmem; static uint64_t memsize; @@ -565,6 +568,8 @@ main(int argc, char *argv[]) { "create", NO_ARG, &create, 1 }, { "destroy", NO_ARG, &destroy, 1 }, { "inject-nmi", NO_ARG, &inject_nmi, 1 }, + { "force-reset", NO_ARG, &force_reset, 1 }, + { "force-poweroff", NO_ARG, &force_poweroff, 1 }, { NULL, 0, NULL, 0 } }; @@ -1535,6 +1540,12 @@ main(int argc, char *argv[]) printf("vm_run error %d\n", error); } + if (!error && force_reset) + error = vm_suspend(ctx, VM_SUSPEND_RESET); + + if (!error && force_poweroff) + error = vm_suspend(ctx, VM_SUSPEND_POWEROFF); + if (error) printf("errno = %d\n", errno); From owner-svn-src-head@FreeBSD.ORG Mon Apr 28 23:16:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 932A1E52; Mon, 28 Apr 2014 23:16:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FC531D71; Mon, 28 Apr 2014 23:16:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3SNGlcW095316; Mon, 28 Apr 2014 23:16:47 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3SNGlY8095315; Mon, 28 Apr 2014 23:16:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404282316.s3SNGlY8095315@svn.freebsd.org> From: Warner Losh Date: Mon, 28 Apr 2014 23:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265063 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Apr 2014 23:16:47 -0000 Author: imp Date: Mon Apr 28 23:16:46 2014 New Revision: 265063 URL: http://svnweb.freebsd.org/changeset/base/265063 Log: Add dependency for libm to libstdc++. This fixes high -j value builds when not building with clang. Submitted by: ian@ Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Apr 28 22:06:40 2014 (r265062) +++ head/Makefile.inc1 Mon Apr 28 23:16:46 2014 (r265063) @@ -1480,6 +1480,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_secure_lib_libssh} ${_secure_lib_libssl} .if ${MK_GNUCXX} != "no" && ${MK_CXX} != "no" _prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++ +gnu/lib/libstdc++__L: lib/msun__L .endif .if defined(WITH_ATF) || ${MK_TESTS} != "no" From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 00:02:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C537A766; Tue, 29 Apr 2014 00:02:52 +0000 (UTC) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 86F8612D9; Tue, 29 Apr 2014 00:02:52 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 00F89424EBF; Tue, 29 Apr 2014 09:43:19 +1000 (EST) Date: Tue, 29 Apr 2014 09:43:19 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Maste Subject: Re: svn commit: r265051 - head/sys/sys In-Reply-To: <201404281342.s3SDgfIO055824@svn.freebsd.org> Message-ID: <20140429080705.T1041@besplex.bde.org> References: <201404281342.s3SDgfIO055824@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=QIpRGG7L c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=9hPZJVi7WwkA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=nkv3H-rXro4_lS4O7XIA:9 a=CjuIK1q_8ugA:10 a=EMdYaVHK1hYA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 00:02:52 -0000 On Mon, 28 Apr 2014, Ed Maste wrote: > Log: > Drop explicit unsigned from FD_SETSIZE constant > > FD_SETSIZE is often used as an argument to select or compared with an > integer file descriptor. Rather than force 3rd party software to add > explicit casts, just make it a plain (int) constant as on other > operating systems. > > Previous discussion: > http://lists.freebsd.org/pipermail/freebsd-standards/2012-July/002410.html Thanks. The above discussion refers to my mail in 2002 about related things. I just debugged why this is (now) a non-problem for poll(). It is because the design error of using an unsigned type for a count is standard for poll(), so the unwanted promotions to unsigned should already be expected and handled for poll(). They mainly give confusing differences from select(). % #ifndef _SYS_SYSPROTO_H_ % struct poll_args { % struct pollfd *fds; % u_int nfds; % int timeout; % }; % #endif nfds actually has type nfds_t, but nfds_t is just u_int. POSIX specificies that nfsd_t is an unsigned integer type. % int % sys_poll(td, uap) % struct thread *td; % struct poll_args *uap; % { % struct pollfd *bits; % struct pollfd smallbits[32]; % sbintime_t asbt, precision, rsbt; % u_int nfds; As mentioned in old mail: The nfsds arg has always had type u_int in FreeBSD. The bounds checking of the nfds arg worked between 1997 and 2001 since it was done directly on the arg. However, it was broken for 3 weeks in Feb 2001, by introducing this local variable nfds and giving it a wrong type (int). This gave overflow for negative nfds. Other BSDs apparently had this bug in poll() and/or select() for longer. % int error; % size_t ni; % % nfds = uap->nfds; % if (nfds > maxfilesperproc && nfds > FD_SETSIZE) % return (EINVAL); The "fix" in Feb 2001 was to bogusly cast "int nfds" back to the correct type u_int. The behaviour on overflow was stll undefined, but was benign. Then in Feb 2002, breaking the type of FD_SETSIZE to u_int would have given the same bogus conversion. Then in Jun 2002, the type of the local variable was fixed (modulo the assumption than nfds_t == u_int). So except in the 3 week broken period, we just exploit the arg type being bogusly unsigned. Promotions still occur, but are harmless. (maxfilesperproc has the correct type (int), so it gets promoted to the type of nfds (u_int) in the first comparison. Promotion preserves its value, except possibly on weird arches where maxfilesperproc is weirdly large. So the comparison works. Now, a similar promotion occurs for FD_SETSIZE, and any weirdness in the first comparison would be compensated for by the second comparison, provided FD_SETSIZE is not also weirdly large.) Bruce From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 01:17:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA7F0250; Tue, 29 Apr 2014 01:17:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6A881A12; Tue, 29 Apr 2014 01:17:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3T1HhlQ045381; Tue, 29 Apr 2014 01:17:43 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3T1HhXn045380; Tue, 29 Apr 2014 01:17:43 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201404290117.s3T1HhXn045380@svn.freebsd.org> From: Bryan Drewery Date: Tue, 29 Apr 2014 01:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265072 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 01:17:43 -0000 Author: bdrewery Date: Tue Apr 29 01:17:43 2014 New Revision: 265072 URL: http://svnweb.freebsd.org/changeset/base/265072 Log: Remove redundant include MFC after: 3 days Modified: head/sys/geom/geom_disk.c Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Tue Apr 29 00:45:42 2014 (r265071) +++ head/sys/geom/geom_disk.c Tue Apr 29 01:17:43 2014 (r265072) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 07:17:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67DEBACA; Tue, 29 Apr 2014 07:17:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54B231B76; Tue, 29 Apr 2014 07:17:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3T7HYAi094268; Tue, 29 Apr 2014 07:17:34 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3T7HYJv094267; Tue, 29 Apr 2014 07:17:34 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201404290717.s3T7HYJv094267@svn.freebsd.org> From: Scott Long Date: Tue, 29 Apr 2014 07:17:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265085 - head/usr.sbin/pmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 07:17:34 -0000 Author: scottl Date: Tue Apr 29 07:17:33 2014 New Revision: 265085 URL: http://svnweb.freebsd.org/changeset/base/265085 Log: Document the -a option that was added in r262424. Obtained from: Netflix, Inc. MFC after: 3 days Modified: head/usr.sbin/pmcstat/pmcstat.8 Modified: head/usr.sbin/pmcstat/pmcstat.8 ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.8 Tue Apr 29 06:18:06 2014 (r265084) +++ head/usr.sbin/pmcstat/pmcstat.8 Tue Apr 29 07:17:33 2014 (r265085) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 19, 2008 +.Dd April 29, 2014 .Dt PMCSTAT 8 .Os .Sh NAME @@ -46,6 +46,7 @@ .Op Fl S Ar event-spec .Op Fl T .Op Fl W +.Op Fl a Ar pathname .Op Fl c Ar cpu-spec .Op Fl d .Op Fl f Ar pluginopt @@ -221,6 +222,21 @@ This is an experimental feature intended dynamic behaviour of processes in the system. It may incur substantial overhead if enabled. The default is for this feature to be disabled. +.It Fl a Ar pathname +Perform a symbol and file:line lookup for each address in each +callgraph and save the output to +.Ar pathname . +Unlike +.Fl m +that only resolves the first symbol in the graph, this resolves +every node in the callgraph, or prints out addresses if no +lookup information is available. +This option requires the +.Fl R +option to read in samples that were previously collected and +saved with the +.Fl o +option. .It Fl c Ar cpu-spec Set the cpus for subsequent system mode PMCs specified on the command line to From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 07:19:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDF24C16; Tue, 29 Apr 2014 07:19:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB2A91B82; Tue, 29 Apr 2014 07:19:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3T7JMtt094519; Tue, 29 Apr 2014 07:19:22 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3T7JMvA094518; Tue, 29 Apr 2014 07:19:22 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201404290719.s3T7JMvA094518@svn.freebsd.org> From: Scott Long Date: Tue, 29 Apr 2014 07:19:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265086 - head/usr.sbin/pmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 07:19:22 -0000 Author: scottl Date: Tue Apr 29 07:19:22 2014 New Revision: 265086 URL: http://svnweb.freebsd.org/changeset/base/265086 Log: Fix formatting of the -a option in usage() to be consistent. Obtained from: Netflix, Inc. MFC after: 3 days Modified: head/usr.sbin/pmcstat/pmcstat.c Modified: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Tue Apr 29 07:17:33 2014 (r265085) +++ head/usr.sbin/pmcstat/pmcstat.c Tue Apr 29 07:19:22 2014 (r265086) @@ -503,7 +503,7 @@ pmcstat_show_usage(void) "\t -S spec\t allocate a system-wide sampling PMC\n" "\t -T\t\t start in top mode\n" "\t -W\t\t (toggle) show counts per context switch\n" - "\t -a \t print sampled PCs and callgraph to \"file\"\n" + "\t -a file\t print sampled PCs and callgraph to \"file\"\n" "\t -c cpu-list\t set cpus for subsequent system-wide PMCs\n" "\t -d\t\t (toggle) track descendants\n" "\t -f spec\t pass \"spec\" to as plugin option\n" From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 07:45:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D89145E; Tue, 29 Apr 2014 07:45:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 700141DC2; Tue, 29 Apr 2014 07:45:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3T7jM1D007129; Tue, 29 Apr 2014 07:45:22 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3T7jMNG007128; Tue, 29 Apr 2014 07:45:22 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201404290745.s3T7jMNG007128@svn.freebsd.org> From: Christian Brueffer Date: Tue, 29 Apr 2014 07:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265088 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 07:45:22 -0000 Author: brueffer Date: Tue Apr 29 07:45:21 2014 New Revision: 265088 URL: http://svnweb.freebsd.org/changeset/base/265088 Log: Add standard SYNOPSIS wording, fix typos, contractions and new sentence -> new line. Modified: head/share/man/man4/proto.4 Modified: head/share/man/man4/proto.4 ============================================================================== --- head/share/man/man4/proto.4 Tue Apr 29 07:29:13 2014 (r265087) +++ head/share/man/man4/proto.4 Tue Apr 29 07:45:21 2014 (r265088) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 21, 2014 +.Dd April 29, 2014 .Dt PROTO 4 .Os .\" @@ -34,7 +34,19 @@ .Nd Driver for prototyping and H/W diagnostics .\" .Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent .Cd "device proto" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +proto_load="YES" +.Ed .\" .Sh DESCRIPTION The @@ -43,7 +55,7 @@ device driver attaches to PCI devices wh present and creates device special files for all resources associated with the device. The driver itself has no knowledge of the device it attaches to. -Programs can open these device special files and peform register-level +Programs can open these device special files and perform register-level reads and writes. As such, the .Nm @@ -51,7 +63,7 @@ device driver is nothing but a conduit o programs and the hardware device. .Pp Examples for why this is useful include hardware diagnostics and prototyping. -In both these use cases, it's far more convenient to develop and run the +In both these use cases, it is far more convenient to develop and run the logic in user space. Especially hardware diagnostics requires a somewhat user-friendly interface and adequate reporting. @@ -108,8 +120,9 @@ Since interrupts cannot be handled by th into signals and delivered to the program that has registered for interrupts. .Pp In order to test the transmission or reception of data, some means of doing -direct memory access (DMA) by the device must be possible. This too much be -under the control of the program. The details of how a program can setup and +direct memory access (DMA) by the device must be possible. +This too must be under the control of the program. +The details of how a program can set up and initiate DMA still need to be fleshed out. .Pp Support for non-PCI devices has not been implemented yet. From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 07:48:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF7A55C4; Tue, 29 Apr 2014 07:48:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C27D11DDB; Tue, 29 Apr 2014 07:48:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3T7m72h007464; Tue, 29 Apr 2014 07:48:07 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3T7m7i6007463; Tue, 29 Apr 2014 07:48:07 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201404290748.s3T7m7i6007463@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 29 Apr 2014 07:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265089 - head/sys/mips/beri X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 07:48:08 -0000 Author: bz Date: Tue Apr 29 07:48:07 2014 New Revision: 265089 URL: http://svnweb.freebsd.org/changeset/base/265089 Log: After r264897 restore the ability to add bootoptions from FDT for platforms which do not use loaders or kernels that want to hardcode options or for FDT passed in by loader. Also fix a build issue by putting the kmdp variable accessed back under the #ifdef FDT; we may wish to revisit decision in which case more code needs changing. Submitted by: brooks Modified: head/sys/mips/beri/beri_machdep.c Modified: head/sys/mips/beri/beri_machdep.c ============================================================================== --- head/sys/mips/beri/beri_machdep.c Tue Apr 29 07:45:21 2014 (r265088) +++ head/sys/mips/beri/beri_machdep.c Tue Apr 29 07:48:07 2014 (r265089) @@ -132,6 +132,46 @@ platform_reset(void) __asm__ __volatile("wait"); } +#ifdef FDT +/* Parse cmd line args as env - copied from xlp_machdep. */ +/* XXX-BZ this should really be centrally provided for all (boot) code. */ +static void +_parse_bootargs(char *cmdline) +{ + char *n, *v; + + while ((v = strsep(&cmdline, " \n")) != NULL) { + if (*v == '\0') + continue; + if (*v == '-') { + while (*v != '\0') { + v++; + switch (*v) { + case 'a': boothowto |= RB_ASKNAME; break; + /* Someone should simulate that ;-) */ + case 'C': boothowto |= RB_CDROM; break; + case 'd': boothowto |= RB_KDB; break; + case 'D': boothowto |= RB_MULTIPLE; break; + case 'm': boothowto |= RB_MUTE; break; + case 'g': boothowto |= RB_GDB; break; + case 'h': boothowto |= RB_SERIAL; break; + case 'p': boothowto |= RB_PAUSE; break; + case 'r': boothowto |= RB_DFLTROOT; break; + case 's': boothowto |= RB_SINGLE; break; + case 'v': boothowto |= RB_VERBOSE; break; + } + } + } else { + n = strsep(&v, "="); + if (v == NULL) + setenv(n, "1"); + else + setenv(n, v); + } + } +} +#endif + void platform_start(__register_t a0, __register_t a1, __register_t a2, __register_t a3) @@ -144,7 +184,9 @@ platform_start(__register_t a0, __regist char **envp = (char **)a2; long memsize; #ifdef FDT + char buf[2048]; /* early stack supposedly big enough */ vm_offset_t dtbp; + phandle_t chosen; void *kmdp; #endif int i; @@ -201,7 +243,6 @@ platform_start(__register_t a0, __regist while (1); if (OF_init((void *)dtbp) != 0) while (1); -#endif /* * Configure more boot-time parameters passed in by loader. @@ -210,6 +251,14 @@ platform_start(__register_t a0, __regist kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); /* + * Get bootargs from FDT if specified. + */ + chosen = OF_finddevice("/chosen"); + if (OF_getprop(chosen, "bootargs", buf, sizeof(buf)) != -1) + _parse_bootargs(buf); +#endif + + /* * XXXRW: We have no way to compare wallclock time to cycle rate on * BERI, so for now assume we run at the MALTA default (100MHz). */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 08:35:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34C15EEE; Tue, 29 Apr 2014 08:35:43 +0000 (UTC) Received: from mail-vc0-x235.google.com (mail-vc0-x235.google.com [IPv6:2607:f8b0:400c:c03::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE72436E; Tue, 29 Apr 2014 08:35:42 +0000 (UTC) Received: by mail-vc0-f181.google.com with SMTP id hy4so3535255vcb.40 for ; Tue, 29 Apr 2014 01:35:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=5TjoNJ68nv96uPWLmPXrq2bN/F27CU+N2EcgXZ5K3oo=; b=P8PeGe7kkdDxiZSrIpBmaO5afpu754l0xWrni/kClOzS2Bwltt0n/33DgFl83rpk6r Jpt6fnXD05kW0uZ44fWw0vK8FiMWNRnDaDzHcq4YfTIn+cNpcp/PRMBrbjpGOTpMvCt2 2NJF6hbz6RLWR61LYY5ES5RotJM8bdjtZKfMKwbuWcSpzXkeXojr1W0a/19ZMwMv/BvV XAZp33ZIvfUj7ORvzb9o/A0IRrGgHU6a++hTgTzGbnMxh1CXeNqASABRO4vSV5e0aUbQ 1QktraCm+XF9zsTcTWyHKBIeCsZV7qeam+eONxlSfrsnct8y21KHDPLFxCVA4oDibxyX 5uPw== X-Received: by 10.52.12.36 with SMTP id v4mr24884303vdb.20.1398760541426; Tue, 29 Apr 2014 01:35:41 -0700 (PDT) MIME-Version: 1.0 Sender: cochard@gmail.com Received: by 10.58.2.225 with HTTP; Tue, 29 Apr 2014 01:35:21 -0700 (PDT) In-Reply-To: <201312200017.rBK0HR3T077621@svn.freebsd.org> References: <201312200017.rBK0HR3T077621@svn.freebsd.org> From: =?ISO-8859-1?Q?Olivier_Cochard=2DLabb=E9?= Date: Tue, 29 Apr 2014 10:35:21 +0200 X-Google-Sender-Auth: nJl9kHMS9kPXxnJ_O1ndnnhYN-Y Message-ID: Subject: Re: svn commit: r259638 - head/usr.bin/netstat To: "Alexander V. Chernikov" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head , svn-src-all , src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 08:35:43 -0000 On Fri, Dec 20, 2013 at 1:17 AM, Alexander V. Chernikov < melifaro@freebsd.org> wrote: > Author: melifaro > Date: Fri Dec 20 00:17:26 2013 > New Revision: 259638 > URL: http://svnweb.freebsd.org/changeset/base/259638 > > Log: > Use more fine-grained kvm(3) symbol lookup: routing code retrieves only > necessary symbols needed per subsystem. Main kvm(3) init is now delayed > as much as possbile. This finally fixes performance issues reported in > kern/167204. > Some non-working code (ng_socket.ko symbol addresses calculation) > removed. > Some global variables eliminated. > > PR: kern/167204 > MFC after: 4 weeks > > Hi Alexander, "netstat -gW" no more correctly detect inet4 MROUTING after this commit (that was MFC to stable). Behavior of my MROUTING enabled system before your commit: ----- [root@router]~# uname -a FreeBSD router.bsdrp.net 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r259635: Tue Apr 29 09:08:10 CEST 2014 root@orange.bsdrp.net:/usr/obj/TESTING.amd64/usr/local/BSDRP/TESTING/FreeBSD/src/sys/amd64 amd64 [root@router]~# sysctl kern.conftxt | grep MROUTING options MROUTING [root@router]~# netstat -gW IPv4 Virtual Interface Table is empty IPv4 Multicast Forwarding Table is empty IPv6 Multicast Interface Table is empty IPv6 Multicast Forwarding Table is empty ----- And the new behavior after your commit: ----- [root@router]~# uname -a FreeBSD router.bsdrp.net 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r259638: Mon Apr 28 20:58:06 CEST 2014 root@orange.bsdrp.net:/usr/obj/TESTING.amd64/usr/local/BSDRP/TESTING/FreeBSD/src/sys/amd64 amd64 [root@router]~# sysctl kern.conftxt | grep MROUTING options MROUTING [root@router]~# netstat -gW No IPv4 MROUTING kernel support. IPv6 Multicast Interface Table is empty IPv6 Multicast Forwarding Table is empty ----- Regards, Olivier From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 11:31:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4744D2E0; Tue, 29 Apr 2014 11:31:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33F221747; Tue, 29 Apr 2014 11:31:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3TBVNrG000481; Tue, 29 Apr 2014 11:31:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3TBVNm1000480; Tue, 29 Apr 2014 11:31:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404291131.s3TBVNm1000480@svn.freebsd.org> From: Marius Strobl Date: Tue, 29 Apr 2014 11:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265090 - head/contrib/libstdc++/include/bits X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 11:31:23 -0000 Author: marius Date: Tue Apr 29 11:31:22 2014 New Revision: 265090 URL: http://svnweb.freebsd.org/changeset/base/265090 Log: Merge r133175 from upstream: 2008-03-13 Dennis Czeremin PR libstdc++/35566 * include/bits/stl_multimap.h (multimap<>::multimap(_InputIterator, _InputIterator)): Forward to _M_insert_equal, not _M_insert_unique. This patch was GPL2 at the time and fixes a regression introduced with the merge of GCC r129013 in FreeBSD r236829. MFC after: 3 days Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: head/contrib/libstdc++/include/bits/stl_multimap.h Modified: head/contrib/libstdc++/include/bits/stl_multimap.h ============================================================================== --- head/contrib/libstdc++/include/bits/stl_multimap.h Tue Apr 29 07:48:07 2014 (r265089) +++ head/contrib/libstdc++/include/bits/stl_multimap.h Tue Apr 29 11:31:22 2014 (r265090) @@ -185,7 +185,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GL template multimap(_InputIterator __first, _InputIterator __last) : _M_t() - { _M_t._M_insert_unique(__first, __last); } + { _M_t._M_insert_equal(__first, __last); } /** * @brief Builds a %multimap from a range. From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 12:52:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3927951C; Tue, 29 Apr 2014 12:52:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 265271FCF; Tue, 29 Apr 2014 12:52:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3TCqbf1033376; Tue, 29 Apr 2014 12:52:37 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3TCqb8O033375; Tue, 29 Apr 2014 12:52:37 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201404291252.s3TCqb8O033375@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Tue, 29 Apr 2014 12:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265091 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 12:52:37 -0000 Author: melifaro Date: Tue Apr 29 12:52:36 2014 New Revision: 265091 URL: http://svnweb.freebsd.org/changeset/base/265091 Log: Do not use senderr() in rtrequest1_fib_change(). Suggested by: glebius MFC after: 4 weeks Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Tue Apr 29 11:31:22 2014 (r265090) +++ head/sys/net/route.c Tue Apr 29 12:52:36 2014 (r265091) @@ -1431,7 +1431,6 @@ bad: #undef ifpaddr #undef flags -#define senderr(e) { error = e; goto bad; } static int rtrequest1_fib_change(struct radix_node_head *rnh, struct rt_addrinfo *info, struct rtentry **ret_nrt, u_int fibnum) @@ -1476,7 +1475,7 @@ rtrequest1_fib_change(struct radix_node_ free_ifa = 1; if (error != 0) - senderr(error); + goto bad; } /* Check if outgoing interface has changed */ @@ -1489,7 +1488,7 @@ rtrequest1_fib_change(struct radix_node_ if (info->rti_info[RTAX_GATEWAY] != NULL) { error = rt_setgate(rt, rt_key(rt), info->rti_info[RTAX_GATEWAY]); if (error != 0) - senderr(error); + goto bad; rt->rt_flags &= ~RTF_GATEWAY; rt->rt_flags |= (RTF_GATEWAY & info->rti_flags); @@ -1517,8 +1516,6 @@ bad: ifa_free(info->rti_ifa); return (error); } -#undef senderr - int rt_setgate(struct rtentry *rt, struct sockaddr *dst, struct sockaddr *gate) From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 12:54:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EB85673; Tue, 29 Apr 2014 12:54:02 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 103551FE5; Tue, 29 Apr 2014 12:54:02 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=ptichko.yndx.net) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1Wf3eL-000POU-Kz; Tue, 29 Apr 2014 12:44:25 +0400 Message-ID: <535FA0C9.3060308@FreeBSD.org> Date: Tue, 29 Apr 2014 16:53:29 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r264986 - head/sys/net References: <201404262103.s3QL3fAX048245@svn.freebsd.org> <20140428085941.GW85571@FreeBSD.org> In-Reply-To: <20140428085941.GW85571@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 12:54:02 -0000 On 28.04.2014 12:59, Gleb Smirnoff wrote: > On Sat, Apr 26, 2014 at 09:03:41PM +0000, Alexander V. Chernikov wrote: > A> @@ -1425,6 +1431,95 @@ bad: > A> #undef ifpaddr > A> #undef flags > A> > A> +#define senderr(e) { error = e; goto bad; } > > ... > > A> + if (error != 0) > A> + senderr(error); > > This resolves to "error = error". Surprised that compiler is silent. > > Can this line and others like it be replaced with? Yup. done in r265091. > if (error) > goto bad; > From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 14:46:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16D9D846; Tue, 29 Apr 2014 14:46:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01444D75; Tue, 29 Apr 2014 14:46:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3TEkjKO081095; Tue, 29 Apr 2014 14:46:45 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3TEkjjo081091; Tue, 29 Apr 2014 14:46:45 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201404291446.s3TEkjjo081091@svn.freebsd.org> From: Alan Somers Date: Tue, 29 Apr 2014 14:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265092 - in head: sys/netinet tests/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 14:46:46 -0000 Author: asomers Date: Tue Apr 29 14:46:45 2014 New Revision: 265092 URL: http://svnweb.freebsd.org/changeset/base/265092 Log: Fix a panic when removing an IP address from an interface, if the same address exists on another interface. The panic was introduced by change 264887, which changed the fibnum parameter in the call to rtalloc1_fib() in ifa_switch_loopback_route() from RT_DEFAULT_FIB to RT_ALL_FIBS. The solution is to use the interface fib in that call. For the majority of users, that will be equivalent to the legacy behavior. PR: kern/189089 Reported by: neel Reviewed by: neel MFC after: 3 weeks X-MFC with: 264887 Sponsored by: Spectra Logic Modified: head/sys/netinet/in.c head/tests/sys/netinet/fibs_test.sh Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Tue Apr 29 12:52:36 2014 (r265091) +++ head/sys/netinet/in.c Tue Apr 29 14:46:45 2014 (r265092) @@ -696,11 +696,9 @@ in_scrubprefix(struct in_ifaddr *target, { struct in_ifaddr *ia; struct in_addr prefix, mask, p, m; - int error = 0, fibnum; + int error = 0; struct sockaddr_in prefix0, mask0; - fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : target->ia_ifp->if_fib; - /* * Remove the loopback route to the interface address. */ @@ -712,6 +710,8 @@ in_scrubprefix(struct in_ifaddr *target, eia = in_localip_more(target); if (eia != NULL) { + int fibnum = target->ia_ifp->if_fib; + error = ifa_switch_loopback_route((struct ifaddr *)eia, (struct sockaddr *)&target->ia_addr, fibnum); ifa_free(&eia->ia_ifa); @@ -736,6 +736,10 @@ in_scrubprefix(struct in_ifaddr *target, } if ((target->ia_flags & IFA_ROUTE) == 0) { + int fibnum; + + fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : + target->ia_ifp->if_fib; rt_addrmsg(RTM_DELETE, &target->ia_ifa, fibnum); return (0); } Modified: head/tests/sys/netinet/fibs_test.sh ============================================================================== --- head/tests/sys/netinet/fibs_test.sh Tue Apr 29 12:52:36 2014 (r265091) +++ head/tests/sys/netinet/fibs_test.sh Tue Apr 29 14:46:45 2014 (r265092) @@ -213,6 +213,45 @@ default_route_with_multiple_fibs_on_same } +# Regression test for PR kern/189089 +# Create two tap interfaces and assign them both the same IP address but with +# different netmasks, and both on the default FIB. Then remove one's IP +# address. Hopefully the machine won't panic. +atf_test_case same_ip_multiple_ifaces_fib0 cleanup +same_ip_multiple_ifaces_fib0_head() +{ + atf_set "descr" "Can remove an IP alias from an interface when the same IP is also assigned to another interface." + atf_set "require.user" "root" + atf_set "require.config" "fibs" +} +same_ip_multiple_ifaces_fib0_body() +{ + ADDR="192.0.2.2" + MASK0="24" + MASK1="32" + + # Unlike most of the tests in this file, this is applicable regardless + # of net.add_addr_allfibs + + # Setup the interfaces, then remove one alias. It should not panic. + setup_tap 0 ${ADDR} ${MASK0} + TAP0=${TAP} + setup_tap 0 ${ADDR} ${MASK1} + TAP1=${TAP} + ifconfig ${TAP1} -alias ${ADDR} + + # Do it again, in the opposite order. It should not panic. + setup_tap 0 ${ADDR} ${MASK0} + TAP0=${TAP} + setup_tap 0 ${ADDR} ${MASK1} + TAP1=${TAP} + ifconfig ${TAP0} -alias ${ADDR} +} +same_ip_multiple_ifaces_fib0_cleanup() +{ + cleanup_tap +} + # Regression test for kern/187550 atf_test_case subnet_route_with_multiple_fibs_on_same_subnet cleanup subnet_route_with_multiple_fibs_on_same_subnet_head() @@ -309,6 +348,7 @@ atf_init_test_cases() atf_add_test_case arpresolve_checks_interface_fib atf_add_test_case loopback_and_network_routes_on_nondefault_fib atf_add_test_case default_route_with_multiple_fibs_on_same_subnet + atf_add_test_case same_ip_multiple_ifaces_fib0 atf_add_test_case subnet_route_with_multiple_fibs_on_same_subnet atf_add_test_case udp_dontroute } From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 14:52:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 222FEBD3; Tue, 29 Apr 2014 14:52:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FA3FE3F; Tue, 29 Apr 2014 14:52:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3TEqdGW084652; Tue, 29 Apr 2014 14:52:39 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3TEqdcn084651; Tue, 29 Apr 2014 14:52:39 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404291452.s3TEqdcn084651@svn.freebsd.org> From: Warner Losh Date: Tue, 29 Apr 2014 14:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265093 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 14:52:40 -0000 Author: imp Date: Tue Apr 29 14:52:39 2014 New Revision: 265093 URL: http://svnweb.freebsd.org/changeset/base/265093 Log: NLS is used by the build system. Modified: head/share/mk/bsd.opts.mk Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Tue Apr 29 14:46:45 2014 (r265092) +++ head/share/mk/bsd.opts.mk Tue Apr 29 14:52:39 2014 (r265093) @@ -56,6 +56,7 @@ __DEFAULT_YES_OPTIONS = \ MAN \ MANCOMPRESS \ NIS \ + NLS \ OPENSSH \ PROFILE \ SSP \ @@ -149,7 +150,6 @@ __DEFAULT_YES_OPTIONS = \ NDIS \ NETCAT \ NETGRAPH \ - NLS \ NLS_CATALOGS \ NS_CACHING \ NTP \ From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 15:12:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2BB2F426; Tue, 29 Apr 2014 15:12:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C39211C2; Tue, 29 Apr 2014 15:12:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3TFCNrx093162; Tue, 29 Apr 2014 15:12:23 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3TFCNVS093161; Tue, 29 Apr 2014 15:12:23 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201404291512.s3TFCNVS093161@svn.freebsd.org> From: Alan Somers Date: Tue, 29 Apr 2014 15:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265094 - head/tests/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 15:12:24 -0000 Author: asomers Date: Tue Apr 29 15:12:23 2014 New Revision: 265094 URL: http://svnweb.freebsd.org/changeset/base/265094 Log: Add regression test for PR kern/189088. PR: kern/189088 MFC after: 3 weeks Sponsored by: Spectra Logic Modified: head/tests/sys/netinet/fibs_test.sh Modified: head/tests/sys/netinet/fibs_test.sh ============================================================================== --- head/tests/sys/netinet/fibs_test.sh Tue Apr 29 14:52:39 2014 (r265093) +++ head/tests/sys/netinet/fibs_test.sh Tue Apr 29 15:12:23 2014 (r265094) @@ -252,6 +252,59 @@ same_ip_multiple_ifaces_fib0_cleanup() cleanup_tap } +# Regression test for PR kern/189088 +# Test that removing an IP address works even if the same IP is assigned to a +# different interface, on a different FIB. Tests the same code that whose +# panic was regressed by same_ip_multiple_ifaces_fib0. +# Create two tap interfaces and assign them both the same IP address but with +# different netmasks, and on different FIBs. Then remove one's IP +# address. Hopefully the machine won't panic. Also, the IP's hostroute should +# dissappear from the correct fib. +atf_test_case same_ip_multiple_ifaces cleanup +same_ip_multiple_ifaces_head() +{ + atf_set "descr" "Can remove an IP alias from an interface when the same IP is also assigned to another interface, on non-default FIBs." + atf_set "require.user" "root" + atf_set "require.config" "fibs" +} +same_ip_multiple_ifaces_body() +{ + atf_expect_fail "kern/189088 Assigning the same IP to multiple interfaces in different FIBs creates a host route for only one" + ADDR="192.0.2.2" + MASK0="24" + MASK1="32" + + # Unlike most of the tests in this file, this is applicable regardless + # of net.add_addr_allfibs + get_fibs 2 + + # Setup the interfaces, then remove one alias. It should not panic. + setup_tap ${FIB0} ${ADDR} ${MASK0} + TAP0=${TAP} + setup_tap ${FIB1} ${ADDR} ${MASK1} + TAP1=${TAP} + ifconfig ${TAP1} -alias ${ADDR} + atf_check -o not-match:"^${ADDR}[[:space:]]" \ + setfib ${FIB1} netstat -rn -f inet + + # Do it again, in the opposite order. It should not panic. + setup_tap ${FIB0} ${ADDR} ${MASK0} + TAP0=${TAP} + setup_tap ${FIB1} ${ADDR} ${MASK1} + TAP1=${TAP} + ifconfig ${TAP0} -alias ${ADDR} + atf_check -o not-match:"^${ADDR}[[:space:]]" \ + setfib ${FIB0} netstat -rn -f inet +} +same_ip_multiple_ifaces_cleanup() +{ + # Due to PR kern/189088, we must destroy the interfaces in LIFO order + # in order for the routes to be correctly cleaned up. + for TAPD in `tail -r "tap_devices_to_cleanup"`; do + ifconfig ${TAPD} destroy + done +} + # Regression test for kern/187550 atf_test_case subnet_route_with_multiple_fibs_on_same_subnet cleanup subnet_route_with_multiple_fibs_on_same_subnet_head() @@ -349,6 +402,7 @@ atf_init_test_cases() atf_add_test_case loopback_and_network_routes_on_nondefault_fib atf_add_test_case default_route_with_multiple_fibs_on_same_subnet atf_add_test_case same_ip_multiple_ifaces_fib0 + atf_add_test_case same_ip_multiple_ifaces atf_add_test_case subnet_route_with_multiple_fibs_on_same_subnet atf_add_test_case udp_dontroute } From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 15:25:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F24368E3; Tue, 29 Apr 2014 15:25:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEE601342; Tue, 29 Apr 2014 15:25:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3TFPvS0097590; Tue, 29 Apr 2014 15:25:57 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3TFPvmt097589; Tue, 29 Apr 2014 15:25:57 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201404291525.s3TFPvmt097589@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 29 Apr 2014 15:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265095 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 15:25:58 -0000 Author: pfg Date: Tue Apr 29 15:25:57 2014 New Revision: 265095 URL: http://svnweb.freebsd.org/changeset/base/265095 Log: citrus: Avoid invalid code points. From the OpenBSD log: The UTF-8 decoder should not accept byte sequences which decode to unicode code positions U+D800 to U+DFFF (UTF-16 surrogates), U+FFFE, and U+FFFF. http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 http://unicode.org/faq/utf_bom.html#utf8-4 Reported by: Stefan Sperling Obtained from: OpenBSD MFC after: 5 days Modified: head/lib/libc/locale/utf8.c Modified: head/lib/libc/locale/utf8.c ============================================================================== --- head/lib/libc/locale/utf8.c Tue Apr 29 15:12:23 2014 (r265094) +++ head/lib/libc/locale/utf8.c Tue Apr 29 15:25:57 2014 (r265095) @@ -203,6 +203,14 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, errno = EILSEQ; return ((size_t)-1); } + if ((wch >= 0xd800 && wch <= 0xdfff) || + wch == 0xfffe || wch == 0xffff) { + /* + * Malformed input; invalid code points. + */ + errno = EILSEQ; + return ((size_t)-1); + } if (pwc != NULL) *pwc = wch; us->want = 0; From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 16:51:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F121FCA7; Tue, 29 Apr 2014 16:51:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3E851C33; Tue, 29 Apr 2014 16:51:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3TGpSmm031548; Tue, 29 Apr 2014 16:51:28 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3TGpSou031547; Tue, 29 Apr 2014 16:51:28 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201404291651.s3TGpSou031547@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Tue, 29 Apr 2014 16:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265096 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 16:51:29 -0000 Author: melifaro Date: Tue Apr 29 16:51:28 2014 New Revision: 265096 URL: http://svnweb.freebsd.org/changeset/base/265096 Log: Fix "netstat -gW" behavior broken in r259638. netstat has two options for printing multicast tables: sysctl (the default one for live systems) and kvm-based one (for cores). It looks like kvm-based one hasn't been working since it's been introduced in r190012 due to absence of mfctablesize kernel symbol. Check for all ipv4-multicast symbols being correctly resolved was introduced in r259638 regardless of 'live' value leading to "No IPv4 MROUTING" error message. Reported by: Olivier Cochard-Labbé MFC after: 1 week Modified: head/usr.bin/netstat/mroute.c Modified: head/usr.bin/netstat/mroute.c ============================================================================== --- head/usr.bin/netstat/mroute.c Tue Apr 29 15:25:57 2014 (r265095) +++ head/usr.bin/netstat/mroute.c Tue Apr 29 16:51:28 2014 (r265096) @@ -236,16 +236,7 @@ mroutepr() * functionality was deprecated, as PIM does not use it. */ maxvif = 0; - - kresolve_list(mrl); - pmfchashtbl = mrl[N_MFCHASHTBL].n_value; - pmfctablesize = mrl[N_MFCTABLESIZE].n_value; - pviftbl = mrl[N_VIFTABLE].n_value; - - if (pmfchashtbl == 0 || pmfctablesize == 0 || pviftbl == 0) { - fprintf(stderr, "No IPv4 MROUTING kernel support.\n"); - return; - } + pmfchashtbl = pmfctablesize = pviftbl = 0; len = sizeof(viftable); if (live) { @@ -254,8 +245,19 @@ mroutepr() warn("sysctl: net.inet.ip.viftable"); return; } - } else + } else { + kresolve_list(mrl); + pmfchashtbl = mrl[N_MFCHASHTBL].n_value; + pmfctablesize = mrl[N_MFCTABLESIZE].n_value; + pviftbl = mrl[N_VIFTABLE].n_value; + + if (pmfchashtbl == 0 || pmfctablesize == 0 || pviftbl == 0) { + fprintf(stderr, "No IPv4 MROUTING kernel support.\n"); + return; + } + kread(pviftbl, (char *)viftable, sizeof(viftable)); + } banner_printed = 0; for (vifi = 0, v = viftable; vifi < MAXVIFS; ++vifi, ++v) { From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 16:52:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC383E0C; Tue, 29 Apr 2014 16:52:29 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FCF31CBC; Tue, 29 Apr 2014 16:52:29 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=ptichko.yndx.net) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1Wf7N6-0000pM-Ep; Tue, 29 Apr 2014 16:42:52 +0400 Message-ID: <535FD8AC.5020606@FreeBSD.org> Date: Tue, 29 Apr 2014 20:51:56 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: =?UTF-8?B?T2xpdmllciBDb2NoYXJkLUxhYmLDqQ==?= Subject: Re: svn commit: r259638 - head/usr.bin/netstat References: <201312200017.rBK0HR3T077621@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head , svn-src-all , src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 16:52:30 -0000 On 29.04.2014 12:35, Olivier Cochard-Labbé wrote: > On Fri, Dec 20, 2013 at 1:17 AM, Alexander V. Chernikov > > wrote: > > Author: melifaro > Date: Fri Dec 20 00:17:26 2013 > New Revision: 259638 > URL: http://svnweb.freebsd.org/changeset/base/259638 > > Log: > Use more fine-grained kvm(3) symbol lookup: routing code > retrieves only > necessary symbols needed per subsystem. Main kvm(3) init is now > delayed > as much as possbile. This finally fixes performance issues > reported in > kern/167204. > Some non-working code (ng_socket.ko symbol addresses > calculation) removed. > Some global variables eliminated. > > PR: kern/167204 > MFC after: 4 weeks > > > Hi Alexander, > > "netstat -gW" no more correctly detect inet4 MROUTING after this > commit (that was MFC to stable). > > Behavior of my MROUTING enabled system before your commit: Whoops. Fixed in r265096, thank you! > > ----- > [root@router]~# uname -a > FreeBSD router.bsdrp.net 11.0-CURRENT > FreeBSD 11.0-CURRENT #0 r259635: Tue Apr 29 09:08:10 CEST 2014 > root@orange.bsdrp.net:/usr/obj/TESTING.amd64/usr/local/BSDRP/TESTING/FreeBSD/src/sys/amd64 > amd64 > [root@router]~# sysctl kern.conftxt | grep MROUTING > options MROUTING > [root@router]~# netstat -gW > > IPv4 Virtual Interface Table is empty > > IPv4 Multicast Forwarding Table is empty > > > IPv6 Multicast Interface Table is empty > > IPv6 Multicast Forwarding Table is empty > ----- > > And the new behavior after your commit: > > ----- > [root@router]~# uname -a > FreeBSD router.bsdrp.net 11.0-CURRENT > FreeBSD 11.0-CURRENT #0 r259638: Mon Apr 28 20:58:06 CEST 2014 > root@orange.bsdrp.net:/usr/obj/TESTING.amd64/usr/local/BSDRP/TESTING/FreeBSD/src/sys/amd64 > amd64 > [root@router]~# sysctl kern.conftxt | grep MROUTING > options MROUTING > [root@router]~# netstat -gW > No IPv4 MROUTING kernel support. > > IPv6 Multicast Interface Table is empty > > IPv6 Multicast Forwarding Table is empty > ----- > > Regards, > > Olivier > From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 16:57:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E0195240; Tue, 29 Apr 2014 16:57:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD7191D04; Tue, 29 Apr 2014 16:57:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3TGvP9t034647; Tue, 29 Apr 2014 16:57:25 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3TGvPcf034646; Tue, 29 Apr 2014 16:57:25 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201404291657.s3TGvPcf034646@svn.freebsd.org> From: Brooks Davis Date: Tue, 29 Apr 2014 16:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265097 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 16:57:25 -0000 Author: brooks Date: Tue Apr 29 16:57:25 2014 New Revision: 265097 URL: http://svnweb.freebsd.org/changeset/base/265097 Log: Merge from CheriBSD: commit 1d1b908107255ffdff4d17f015d8f057d73cc6cb Author: Brooks Davis Date: Fri Mar 28 16:24:45 2014 +0000 Add a long needed seatbelt. Exit with an error when make is called without a target at the top level rather than poluting the source tree and causing use confusion in future builds. commit a9d9aa341b2f4308a227ab460ba85f1f287ad028 Author: Brooks Davis Date: Tue Apr 29 16:06:12 2014 +0000 Simplify seatbelt added in 1d1b908 based in feedback. Discussed with: imp@FreeBSD.org Reviewed by: imp Sponsored by: DARPA, AFRL Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Tue Apr 29 16:51:28 2014 (r265096) +++ head/Makefile Tue Apr 29 16:57:25 2014 (r265097) @@ -238,8 +238,17 @@ tinderbox toolchains kernel-toolchains: ${TGTS}: ${_+_}@cd ${.CURDIR}; ${_MAKE} ${.TARGET} -# Set a reasonable default -.MAIN: all +# The historic default "all" target creates files which may cause stale +# or (in the cross build case) unlinkable results. Fail with an error +# when no target is given. The users can explicitly specify "all" +# if they want the historic behavior. +.MAIN: _guard + +_guard: + @echo + @echo "Explicit target required (use \"all\" for historic behavior)" + @echo + @false STARTTIME!= LC_ALL=C date CHECK_TIME!= find ${.CURDIR}/sys/sys/param.h -mtime -0s ; echo From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 17:22:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63559BC4; Tue, 29 Apr 2014 17:22:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50369134; Tue, 29 Apr 2014 17:22:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3THMU5o046787; Tue, 29 Apr 2014 17:22:30 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3THMUBN046786; Tue, 29 Apr 2014 17:22:30 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201404291722.s3THMUBN046786@svn.freebsd.org> From: Peter Grehan Date: Tue, 29 Apr 2014 17:22:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265098 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 17:22:30 -0000 Author: grehan Date: Tue Apr 29 17:22:29 2014 New Revision: 265098 URL: http://svnweb.freebsd.org/changeset/base/265098 Log: Bump WITNESS_PENDLIST by MAXCPU to account for the pmap pvlist locks which are scaled by MAXCPU. This allows an amd64 system to boot with MAXCPU set to 256, which is currently FreeBSD's hard limit without x2apic support. Compile-tested for other arch's. PR: 185831 Discussed with: jhb MFC after: 3 weeks Modified: head/sys/kern/subr_witness.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Tue Apr 29 16:57:25 2014 (r265097) +++ head/sys/kern/subr_witness.c Tue Apr 29 17:22:29 2014 (r265098) @@ -135,7 +135,7 @@ __FBSDID("$FreeBSD$"); #define WITNESS_COUNT 1536 #define WITNESS_CHILDCOUNT (WITNESS_COUNT * 4) #define WITNESS_HASH_SIZE 251 /* Prime, gives load factor < 2 */ -#define WITNESS_PENDLIST 1024 +#define WITNESS_PENDLIST (1024 + MAXCPU) /* Allocate 256 KB of stack data space */ #define WITNESS_LO_DATA_COUNT 2048 From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 17:48:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4599D2C2; Tue, 29 Apr 2014 17:48:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 252EC348; Tue, 29 Apr 2014 17:48:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3THmweN055666; Tue, 29 Apr 2014 17:48:58 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3THmvKg055662; Tue, 29 Apr 2014 17:48:57 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404291748.s3THmvKg055662@svn.freebsd.org> From: Ian Lepore Date: Tue, 29 Apr 2014 17:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265099 - in head/sys/arm: conf xilinx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 17:48:58 -0000 Author: ian Date: Tue Apr 29 17:48:57 2014 New Revision: 265099 URL: http://svnweb.freebsd.org/changeset/base/265099 Log: Add SMP support for Zedboard. Submitted by: Thomas Skibo Added: head/sys/arm/xilinx/zy7_mp.c (contents, props changed) Modified: head/sys/arm/conf/ZEDBOARD head/sys/arm/xilinx/files.zynq7 head/sys/arm/xilinx/std.zynq7 Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Tue Apr 29 17:22:29 2014 (r265098) +++ head/sys/arm/conf/ZEDBOARD Tue Apr 29 17:48:57 2014 (r265099) @@ -56,6 +56,7 @@ options SYSVSEM # SYSV-style semaphor options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions options FREEBSD_BOOT_LOADER options VFP # vfp/neon +options SMP # Symmetric MultiProcessor Kernel # Debugging makeoptions DEBUG=-g Modified: head/sys/arm/xilinx/files.zynq7 ============================================================================== --- head/sys/arm/xilinx/files.zynq7 Tue Apr 29 17:22:29 2014 (r265098) +++ head/sys/arm/xilinx/files.zynq7 Tue Apr 29 17:48:57 2014 (r265099) @@ -21,6 +21,7 @@ arm/xilinx/zy7_l2cache.c standard arm/xilinx/zy7_bus_space.c standard arm/xilinx/zy7_slcr.c standard arm/xilinx/zy7_devcfg.c standard +arm/xilinx/zy7_mp.c optional smp dev/cadence/if_cgem.c optional if_cgem dev/sdhci/sdhci_fdt.c optional sdhci Modified: head/sys/arm/xilinx/std.zynq7 ============================================================================== --- head/sys/arm/xilinx/std.zynq7 Tue Apr 29 17:22:29 2014 (r265098) +++ head/sys/arm/xilinx/std.zynq7 Tue Apr 29 17:48:57 2014 (r265099) @@ -20,3 +20,5 @@ makeoptions KERNVIRTADDR=0xc0100000 options ARM_L2_PIPT +options IPI_IRQ_START=0 +options IPI_IRQ_END=15 Added: head/sys/arm/xilinx/zy7_mp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/xilinx/zy7_mp.c Tue Apr 29 17:48:57 2014 (r265099) @@ -0,0 +1,99 @@ +/*- + * Copyright (c) 2013 Thomas Skibo. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#define ZYNQ7_CPU1_ENTRY 0xfffffff0 + +void +platform_mp_init_secondary(void) +{ + + gic_init_secondary(); +} + +void +platform_mp_setmaxid(void) +{ + + mp_maxid = 1; +} + +int +platform_mp_probe(void) +{ + + mp_ncpus = 2; + return (1); +} + +void +platform_mp_start_ap(void) +{ + bus_space_handle_t ocm_handle; + + /* Map in magic location to give entry address to CPU1. */ + if (bus_space_map(fdtbus_bs_tag, ZYNQ7_CPU1_ENTRY, 4, + 0, &ocm_handle) != 0) + panic("platform_mp_start_ap: Couldn't map OCM\n"); + + /* Write start address for CPU1. */ + bus_space_write_4(fdtbus_bs_tag, ocm_handle, 0, + pmap_kextract((vm_offset_t)mpentry)); + + /* + * The SCU is enabled by the BOOTROM but I think the second CPU doesn't + * turn on filtering until after the wake-up below. I think that's why + * things don't work if I don't put these cache ops here. Also, the + * magic location, 0xfffffff0, isn't in the SCU's filtering range so it + * needs a write-back too. + */ + cpu_idcache_wbinv_all(); + cpu_l2cache_wbinv_all(); + + /* Wake up CPU1. */ + armv7_sev(); + + bus_space_unmap(fdtbus_bs_tag, ocm_handle, 4); +} + +void +platform_ipi_send(cpuset_t cpus, u_int ipi) +{ + + pic_ipi_send(cpus, ipi); +} From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 18:42:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 013513AF; Tue, 29 Apr 2014 18:42:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E24D7BDC; Tue, 29 Apr 2014 18:42:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3TIgbke079229; Tue, 29 Apr 2014 18:42:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3TIgbSF079228; Tue, 29 Apr 2014 18:42:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201404291842.s3TIgbSF079228@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 29 Apr 2014 18:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265100 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 18:42:38 -0000 Author: kib Date: Tue Apr 29 18:42:37 2014 New Revision: 265100 URL: http://svnweb.freebsd.org/changeset/base/265100 Log: For the VM_PHYSSEG_DENSE case, checking the requested range to fall into the area backed by vm_page_array wrongly compared end with vm_page_array_size. It should be adjusted by first_page index to be correct. Also, the corner and incorrect case of the requested range extending after the end of the vm_page_array was incorrectly handled by allocating the segment. Fix the comparision for the end of range and return EINVAL if the end extends beyond vm_page_array. Discussed with: royger Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_phys.c Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Tue Apr 29 17:48:57 2014 (r265099) +++ head/sys/vm/vm_phys.c Tue Apr 29 18:42:37 2014 (r265100) @@ -551,7 +551,9 @@ vm_phys_fictitious_reg_range(vm_paddr_t #ifdef VM_PHYSSEG_DENSE pi = atop(start); - if (pi >= first_page && atop(end) < vm_page_array_size) { + if (pi >= first_page && pi < vm_page_array_size + first_page) { + if (atop(end) >= vm_page_array_size + first_page) + return (EINVAL); fp = &vm_page_array[pi - first_page]; malloced = FALSE; } else From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 18:42:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DCD44E5; Tue, 29 Apr 2014 18:42:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A5A3BDF; Tue, 29 Apr 2014 18:42:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3TIgvjr079296; Tue, 29 Apr 2014 18:42:57 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3TIguTx079293; Tue, 29 Apr 2014 18:42:56 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201404291842.s3TIguTx079293@svn.freebsd.org> From: Neel Natu Date: Tue, 29 Apr 2014 18:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265101 - in head: sys/amd64/include sys/amd64/vmm usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 18:42:57 -0000 Author: neel Date: Tue Apr 29 18:42:56 2014 New Revision: 265101 URL: http://svnweb.freebsd.org/changeset/base/265101 Log: Some Linux guests will implement a 'halt' by disabling the APIC and executing the 'HLT' instruction. This condition was detected by 'vm_handle_hlt()' and converted into the SPINDOWN_CPU exitcode . The bhyve(8) process would exit the vcpu thread in response to a SPINDOWN_CPU and when the last vcpu was spun down it would reset the virtual machine via vm_suspend(VM_SUSPEND_RESET). This functionality was broken in r263780 in a way that made it impossible to kill the bhyve(8) process because it would loop forever in vm_handle_suspend(). Unbreak this by removing the code to spindown vcpus. Thus a 'halt' from a Linux guest will appear to be hung but this is consistent with the behavior on bare metal. The guest can be rebooted by using the bhyvectl options '--force-reset' or '--force-poweroff'. Reviewed by: grehan@ Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/vmm.c head/usr.sbin/bhyve/bhyverun.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Tue Apr 29 18:42:37 2014 (r265100) +++ head/sys/amd64/include/vmm.h Tue Apr 29 18:42:56 2014 (r265101) @@ -325,7 +325,7 @@ enum vm_exitcode { VM_EXITCODE_PAGING, VM_EXITCODE_INST_EMUL, VM_EXITCODE_SPINUP_AP, - VM_EXITCODE_SPINDOWN_CPU, + VM_EXITCODE_DEPRECATED1, /* used to be SPINDOWN_CPU */ VM_EXITCODE_RENDEZVOUS, VM_EXITCODE_IOAPIC_EOI, VM_EXITCODE_SUSPENDED, Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Tue Apr 29 18:42:37 2014 (r265100) +++ head/sys/amd64/vmm/vmm.c Tue Apr 29 18:42:56 2014 (r265101) @@ -191,8 +191,6 @@ static int vmm_ipinum; SYSCTL_INT(_hw_vmm, OID_AUTO, ipinum, CTLFLAG_RD, &vmm_ipinum, 0, "IPI vector used for vcpu notifications"); -static void vm_deactivate_cpu(struct vm *vm, int vcpuid); - static void vcpu_cleanup(struct vm *vm, int i) { @@ -1006,60 +1004,47 @@ vm_handle_rendezvous(struct vm *vm, int static int vm_handle_hlt(struct vm *vm, int vcpuid, bool intr_disabled, bool *retu) { - struct vm_exit *vmexit; struct vcpu *vcpu; - int t, timo, spindown; + const char *wmesg; + int t; vcpu = &vm->vcpu[vcpuid]; - spindown = 0; vcpu_lock(vcpu); + while (1) { + /* + * Do a final check for pending NMI or interrupts before + * really putting this thread to sleep. Also check for + * software events that would cause this vcpu to wakeup. + * + * These interrupts/events could have happened after the + * vcpu returned from VMRUN() and before it acquired the + * vcpu lock above. + */ + if (vm->rendezvous_func != NULL || vm->suspend) + break; + if (vm_nmi_pending(vm, vcpuid)) + break; + if (!intr_disabled) { + if (vm_extint_pending(vm, vcpuid) || + vlapic_pending_intr(vcpu->vlapic, NULL)) { + break; + } + } + + if (vlapic_enabled(vcpu->vlapic)) + wmesg = "vmidle"; + else + wmesg = "vmhalt"; - /* - * Do a final check for pending NMI or interrupts before - * really putting this thread to sleep. - * - * These interrupts could have happened any time after we - * returned from VMRUN() and before we grabbed the vcpu lock. - */ - if (vm->rendezvous_func == NULL && - !vm_nmi_pending(vm, vcpuid) && - (intr_disabled || !vlapic_pending_intr(vcpu->vlapic, NULL))) { t = ticks; vcpu_require_state_locked(vcpu, VCPU_SLEEPING); - if (vlapic_enabled(vcpu->vlapic)) { - /* - * XXX msleep_spin() is not interruptible so use the - * 'timo' to put an upper bound on the sleep time. - */ - timo = hz; - msleep_spin(vcpu, &vcpu->mtx, "vmidle", timo); - } else { - /* - * Spindown the vcpu if the APIC is disabled and it - * had entered the halted state, but never spin - * down the BSP. - */ - if (vcpuid != 0) - spindown = 1; - } + msleep_spin(vcpu, &vcpu->mtx, wmesg, 0); vcpu_require_state_locked(vcpu, VCPU_FROZEN); vmm_stat_incr(vm, vcpuid, VCPU_IDLE_TICKS, ticks - t); } vcpu_unlock(vcpu); - /* - * Since 'vm_deactivate_cpu()' grabs a sleep mutex we must call it - * outside the confines of the vcpu spinlock. - */ - if (spindown) { - *retu = true; - vmexit = vm_exitinfo(vm, vcpuid); - vmexit->exitcode = VM_EXITCODE_SPINDOWN_CPU; - vm_deactivate_cpu(vm, vcpuid); - VCPU_CTR0(vm, vcpuid, "spinning down cpu"); - } - return (0); } @@ -1673,30 +1658,6 @@ vm_activate_cpu(struct vm *vm, int vcpui CPU_SET_ATOMIC(vcpuid, &vm->active_cpus); } -static void -vm_deactivate_cpu(struct vm *vm, int vcpuid) -{ - - KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, - ("vm_deactivate_cpu: invalid vcpuid %d", vcpuid)); - KASSERT(CPU_ISSET(vcpuid, &vm->active_cpus), - ("vm_deactivate_cpu: vcpuid %d is not active", vcpuid)); - - VCPU_CTR0(vm, vcpuid, "deactivated"); - CPU_CLR_ATOMIC(vcpuid, &vm->active_cpus); - - /* - * If a vcpu rendezvous is in progress then it could be blocked - * on 'vcpuid' - unblock it before disappearing forever. - */ - mtx_lock(&vm->rendezvous_mtx); - if (vm->rendezvous_func != NULL) { - VCPU_CTR0(vm, vcpuid, "unblock rendezvous after deactivation"); - wakeup(&vm->rendezvous_func); - } - mtx_unlock(&vm->rendezvous_mtx); -} - cpuset_t vm_active_cpus(struct vm *vm) { Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Tue Apr 29 18:42:37 2014 (r265100) +++ head/usr.sbin/bhyve/bhyverun.c Tue Apr 29 18:42:56 2014 (r265101) @@ -114,6 +114,7 @@ struct bhyvestats { uint64_t cpu_switch_rotate; uint64_t cpu_switch_direct; int io_reset; + int io_poweroff; } stats; struct mt_vmm_info { @@ -237,13 +238,6 @@ fbsdrun_deletecpu(struct vmctx *ctx, int } static int -vmexit_catch_reset(void) -{ - stats.io_reset++; - return (VMEXIT_RESET); -} - -static int vmexit_catch_inout(void) { return (VMEXIT_ABORT); @@ -293,8 +287,10 @@ vmexit_inout(struct vmctx *ctx, struct v case INOUT_OK: return (VMEXIT_CONTINUE); case INOUT_RESET: + stats.io_reset++; return (VMEXIT_RESET); case INOUT_POWEROFF: + stats.io_poweroff++; return (VMEXIT_POWEROFF); default: fprintf(stderr, "Unhandled %s%c 0x%04x\n", @@ -365,17 +361,6 @@ vmexit_spinup_ap(struct vmctx *ctx, stru } static int -vmexit_spindown_cpu(struct vmctx *ctx, struct vm_exit *vme, int *pvcpu) -{ - int lastcpu; - - lastcpu = fbsdrun_deletecpu(ctx, *pvcpu); - if (!lastcpu) - pthread_exit(NULL); - return (vmexit_catch_reset()); -} - -static int vmexit_vmx(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) { @@ -501,7 +486,6 @@ static vmexit_handler_t handler[VM_EXITC [VM_EXITCODE_MTRAP] = vmexit_mtrap, [VM_EXITCODE_INST_EMUL] = vmexit_inst_emul, [VM_EXITCODE_SPINUP_AP] = vmexit_spinup_ap, - [VM_EXITCODE_SPINDOWN_CPU] = vmexit_spindown_cpu, [VM_EXITCODE_SUSPENDED] = vmexit_suspend }; From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 19:02:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D155AA1; Tue, 29 Apr 2014 19:02:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A14CDAE; Tue, 29 Apr 2014 19:02:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3TJ2YEQ087572; Tue, 29 Apr 2014 19:02:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3TJ2YDe087571; Tue, 29 Apr 2014 19:02:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201404291902.s3TJ2YDe087571@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 29 Apr 2014 19:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265102 - head/sys/dev/drm2/i915 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 19:02:34 -0000 Author: kib Date: Tue Apr 29 19:02:34 2014 New Revision: 265102 URL: http://svnweb.freebsd.org/changeset/base/265102 Log: Fix two cases of recursive acquisitions of the vm object lock, only possible in rare failure situations. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/drm2/i915/i915_gem.c Modified: head/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem.c Tue Apr 29 18:42:56 2014 (r265101) +++ head/sys/dev/drm2/i915/i915_gem.c Tue Apr 29 19:02:34 2014 (r265102) @@ -1431,6 +1431,7 @@ retry: m = vm_phys_fictitious_to_vm_page(dev->agp->base + obj->gtt_offset + offset); if (m == NULL) { + VM_OBJECT_WUNLOCK(vm_obj); cause = 60; ret = -EFAULT; goto unlock; @@ -1450,7 +1451,6 @@ retry: DRM_UNLOCK(dev); VM_OBJECT_WUNLOCK(vm_obj); VM_WAIT; - VM_OBJECT_WLOCK(vm_obj); goto retry; } m->valid = VM_PAGE_BITS_ALL; From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 19:14:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD21BDB2; Tue, 29 Apr 2014 19:14:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9E8AF97; Tue, 29 Apr 2014 19:14:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3TJEhUn091837; Tue, 29 Apr 2014 19:14:43 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3TJEh38091834; Tue, 29 Apr 2014 19:14:43 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201404291914.s3TJEh38091834@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Tue, 29 Apr 2014 19:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265103 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 19:14:43 -0000 Author: melifaro Date: Tue Apr 29 19:14:42 2014 New Revision: 265103 URL: http://svnweb.freebsd.org/changeset/base/265103 Log: Move rt_setmetrics() from rtsock.c to route.c. All rtsock-initiated rte creation/modification are now performed in route.c holding radix tree write lock. This reduces the need for per-rte mutex. Sponsored by: Yandex LLC MFC after: 1 month Modified: head/sys/net/route.c head/sys/net/route.h head/sys/net/rtsock.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Tue Apr 29 19:02:34 2014 (r265102) +++ head/sys/net/route.c Tue Apr 29 19:14:42 2014 (r265103) @@ -142,6 +142,7 @@ static VNET_DEFINE(uma_zone_t, rtzone); static int rtrequest1_fib_change(struct radix_node_head *, struct rt_addrinfo *, struct rtentry **, u_int); +static void rt_setmetrics(const struct rt_addrinfo *, struct rtentry *); /* * handler for net.my_fibnum @@ -1401,6 +1402,8 @@ rtrequest1_fib(int req, struct rt_addrin if (ifa->ifa_rtrequest) ifa->ifa_rtrequest(req, rt, info); + rt_setmetrics(info, rt); + /* * actually return a resultant rtentry and * give the caller a single reference. @@ -1506,6 +1509,8 @@ rtrequest1_fib_change(struct radix_node_ if (rt->rt_ifa && rt->rt_ifa->ifa_rtrequest != NULL) rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, info); + rt_setmetrics(info, rt); + if (ret_nrt) { *ret_nrt = rt; RT_ADDREF(rt); @@ -1517,6 +1522,20 @@ bad: return (error); } +static void +rt_setmetrics(const struct rt_addrinfo *info, struct rtentry *rt) +{ + + if (info->rti_mflags & RTV_MTU) + rt->rt_mtu = info->rti_rmx->rmx_mtu; + if (info->rti_mflags & RTV_WEIGHT) + rt->rt_weight = info->rti_rmx->rmx_weight; + /* Kernel -> userland timebase conversion. */ + if (info->rti_mflags & RTV_EXPIRE) + rt->rt_expire = info->rti_rmx->rmx_expire ? + info->rti_rmx->rmx_expire - time_second + time_uptime : 0; +} + int rt_setgate(struct rtentry *rt, struct sockaddr *dst, struct sockaddr *gate) { Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Tue Apr 29 19:02:34 2014 (r265102) +++ head/sys/net/route.h Tue Apr 29 19:14:42 2014 (r265103) @@ -261,6 +261,8 @@ struct rt_addrinfo { int rti_flags; struct ifaddr *rti_ifa; struct ifnet *rti_ifp; + u_long rti_mflags; + struct rt_metrics *rti_rmx; }; /* Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Tue Apr 29 19:02:34 2014 (r265102) +++ head/sys/net/rtsock.c Tue Apr 29 19:14:42 2014 (r265103) @@ -160,7 +160,6 @@ static int sysctl_dumpentry(struct radix static int sysctl_iflist(int af, struct walkarg *w); static int sysctl_ifmalist(int af, struct walkarg *w); static int route_output(struct mbuf *m, struct socket *so); -static void rt_setmetrics(const struct rt_msghdr *rtm, struct rtentry *rt); static void rt_getmetrics(const struct rtentry *rt, struct rt_metrics *out); static void rt_dispatch(struct mbuf *, sa_family_t); @@ -584,6 +583,10 @@ route_output(struct mbuf *m, struct sock rtm->rtm_pid = curproc->p_pid; info.rti_addrs = rtm->rtm_addrs; + + info.rti_mflags = rtm->rtm_inits; + info.rti_rmx = &rtm->rtm_rmx; + /* * rt_xaddrs() performs s6_addr[2] := sin6_scope_id for AF_INET6 * link-local address because rtrequest requires addresses with @@ -670,7 +673,6 @@ route_output(struct mbuf *m, struct sock rti_need_deembed = (V_deembed_scopeid) ? 1 : 0; #endif RT_LOCK(saved_nrt); - rt_setmetrics(rtm, saved_nrt); rtm->rtm_index = saved_nrt->rt_ifp->if_index; RT_REMREF(saved_nrt); RT_UNLOCK(saved_nrt); @@ -920,20 +922,6 @@ flush: } static void -rt_setmetrics(const struct rt_msghdr *rtm, struct rtentry *rt) -{ - - if (rtm->rtm_inits & RTV_MTU) - rt->rt_mtu = rtm->rtm_rmx.rmx_mtu; - if (rtm->rtm_inits & RTV_WEIGHT) - rt->rt_weight = rtm->rtm_rmx.rmx_weight; - /* Kernel -> userland timebase conversion. */ - if (rtm->rtm_inits & RTV_EXPIRE) - rt->rt_expire = rtm->rtm_rmx.rmx_expire ? - rtm->rtm_rmx.rmx_expire - time_second + time_uptime : 0; -} - -static void rt_getmetrics(const struct rtentry *rt, struct rt_metrics *out) { From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 19:48:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B145352; Tue, 29 Apr 2014 19:48:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F21D61266; Tue, 29 Apr 2014 19:48:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3TJmBKg005372; Tue, 29 Apr 2014 19:48:11 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3TJmBcw005371; Tue, 29 Apr 2014 19:48:11 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201404291948.s3TJmBcw005371@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Tue, 29 Apr 2014 19:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265104 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 19:48:12 -0000 Author: melifaro Date: Tue Apr 29 19:48:11 2014 New Revision: 265104 URL: http://svnweb.freebsd.org/changeset/base/265104 Log: Partially revert r265019 - allocating 512 bytes on stack can be too much for architectures like ARM. Always use rounded malloc instead. Discussed with: jmallett MFC after: 4 weeks Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Tue Apr 29 19:14:42 2014 (r265103) +++ head/sys/net/rtsock.c Tue Apr 29 19:48:11 2014 (r265104) @@ -531,7 +531,6 @@ route_output(struct mbuf *m, struct sock sa_family_t saf = AF_UNSPEC; struct rawcb *rp = NULL; struct walkarg w; - char msgbuf[512]; fibnum = so->so_fibnum; @@ -548,20 +547,12 @@ route_output(struct mbuf *m, struct sock /* * Most of current messages are in range 200-240 bytes, - * minimize possible failures by using on-stack buffer - * which should fit for most messages. - * However, use stable memory if we need to handle - * something large. + * minimize possible re-allocation on reply using larger size + * buffer aligned on 1k boundaty. */ - if (len < sizeof(msgbuf)) { - alloc_len = sizeof(msgbuf); - rtm = (struct rt_msghdr *)msgbuf; - } else { - alloc_len = roundup2(len, 1024); - rtm = malloc(alloc_len, M_TEMP, M_NOWAIT); - if (rtm == NULL) - senderr(ENOBUFS); - } + alloc_len = roundup2(len, 1024); + if ((rtm = malloc(alloc_len, M_TEMP, M_NOWAIT)) == NULL) + senderr(ENOBUFS); m_copydata(m, 0, len, (caddr_t)rtm); bzero(&info, sizeof(info)); @@ -569,8 +560,7 @@ route_output(struct mbuf *m, struct sock if (rtm->rtm_version != RTM_VERSION) { /* Do not touch message since format is unknown */ - if ((char *)rtm != msgbuf) - free(rtm, M_TEMP); + free(rtm, M_TEMP); rtm = NULL; senderr(EPROTONOSUPPORT); } @@ -861,7 +851,7 @@ flush: */ if ((so->so_options & SO_USELOOPBACK) == 0) { if (V_route_cb.any_count <= 1) { - if (rtm != NULL && (char *)rtm != msgbuf) + if (rtm != NULL) free(rtm, M_TEMP); m_freem(m); return (error); @@ -899,8 +889,7 @@ flush: } else if (m->m_pkthdr.len > rtm->rtm_msglen) m_adj(m, rtm->rtm_msglen - m->m_pkthdr.len); - if ((char *)rtm != msgbuf) - free(rtm, M_TEMP); + free(rtm, M_TEMP); } if (m != NULL) { M_SETFIB(m, fibnum); From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 20:49:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0AA8E1CA; Tue, 29 Apr 2014 20:49:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC06A17CF; Tue, 29 Apr 2014 20:49:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3TKnldk031242; Tue, 29 Apr 2014 20:49:47 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3TKnlls031240; Tue, 29 Apr 2014 20:49:47 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201404292049.s3TKnlls031240@svn.freebsd.org> From: Ryan Stone Date: Tue, 29 Apr 2014 20:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265107 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 20:49:48 -0000 Author: rstone Date: Tue Apr 29 20:49:47 2014 New Revision: 265107 URL: http://svnweb.freebsd.org/changeset/base/265107 Log: Be consistent with the whitespace in the rest of these files. X-MFC-With: r264007 Modified: head/sys/dev/pci/pci_if.m head/sys/dev/pci/pcib_if.m Modified: head/sys/dev/pci/pci_if.m ============================================================================== --- head/sys/dev/pci/pci_if.m Tue Apr 29 20:48:15 2014 (r265106) +++ head/sys/dev/pci/pci_if.m Tue Apr 29 20:49:47 2014 (r265107) @@ -161,7 +161,7 @@ METHOD int msix_count { } DEFAULT null_msi_count; METHOD uint16_t get_rid { - device_t dev; - device_t child; + device_t dev; + device_t child; }; Modified: head/sys/dev/pci/pcib_if.m ============================================================================== --- head/sys/dev/pci/pcib_if.m Tue Apr 29 20:48:15 2014 (r265106) +++ head/sys/dev/pci/pcib_if.m Tue Apr 29 20:49:47 2014 (r265107) @@ -169,8 +169,8 @@ METHOD int power_for_sleep { # Return the PCI Routing Identifier (RID) for the device. # METHOD uint16_t get_rid { - device_t pcib; - device_t dev; + device_t pcib; + device_t dev; } DEFAULT pcib_get_rid; # From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 20:51:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA69F31F; Tue, 29 Apr 2014 20:51:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C78E71866; Tue, 29 Apr 2014 20:51:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3TKpv1R032747; Tue, 29 Apr 2014 20:51:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3TKpvNi032746; Tue, 29 Apr 2014 20:51:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404292051.s3TKpvNi032746@svn.freebsd.org> From: Marius Strobl Date: Tue, 29 Apr 2014 20:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265108 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 20:51:57 -0000 Author: marius Date: Tue Apr 29 20:51:57 2014 New Revision: 265108 URL: http://svnweb.freebsd.org/changeset/base/265108 Log: Given that as of r258002 the last external user is gone, make sched_lock static. Modified: head/sys/kern/sched_4bsd.c Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Tue Apr 29 20:49:47 2014 (r265107) +++ head/sys/kern/sched_4bsd.c Tue Apr 29 20:51:57 2014 (r265108) @@ -116,7 +116,7 @@ struct td_sched { CPU_ISSET((cpu), &(td)->td_cpuset->cs_mask) static struct td_sched td_sched0; -struct mtx sched_lock; +static struct mtx sched_lock; static int realstathz = 127; /* stathz is sometimes 0 and run off of hz. */ static int sched_tdcnt; /* Total runnable threads in the system. */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 20:57:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AAA5078E; Tue, 29 Apr 2014 20:57:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97A4018BF; Tue, 29 Apr 2014 20:57:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3TKvPe8035305; Tue, 29 Apr 2014 20:57:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3TKvPnL035304; Tue, 29 Apr 2014 20:57:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201404292057.s3TKvPnL035304@svn.freebsd.org> From: Marius Strobl Date: Tue, 29 Apr 2014 20:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265110 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 20:57:25 -0000 Author: marius Date: Tue Apr 29 20:57:25 2014 New Revision: 265110 URL: http://svnweb.freebsd.org/changeset/base/265110 Log: Update comment. Modified: head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Tue Apr 29 20:52:39 2014 (r265109) +++ head/sys/mips/mips/vm_machdep.c Tue Apr 29 20:57:25 2014 (r265110) @@ -438,7 +438,7 @@ cpu_set_upcall(struct thread *td, struct * that are needed. */ - /* SMP Setup to release sched_lock in fork_exit(). */ + /* Setup to release spin count in in fork_exit(). */ td->td_md.md_spinlock_count = 1; td->td_md.md_saved_intr = MIPS_SR_INT_IE; #if 0 From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 21:07:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F1CEC70; Tue, 29 Apr 2014 21:07:25 +0000 (UTC) Received: from felyko.com (felyko.com [174.136.100.2]) by mx1.freebsd.org (Postfix) with ESMTP id 12872199F; Tue, 29 Apr 2014 21:07:24 +0000 (UTC) Received: from [10.0.1.3] (c-24-6-115-18.hsd1.ca.comcast.net [24.6.115.18]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id BD7033985F; Tue, 29 Apr 2014 14:07:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1398805644; bh=bDoB2Aj+vy2jQMn1UuCpeOQHNfVHQvoP16huskwlxY4=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=G3dlsSggiHm46rvpMG2AXSVYlc4zDESLeNm481bQyvp+JXwArCt80KsgXQAhOnR9F CTYRsLtzEXKLbE7PUnlugIn5Vj6R0wZKTHCkvyyw/ARG1pihL7VbRyhtliFLjVKzbr enFSQOZUL8VPBMG8eZaaH9uREvqS1EcsBEEMVEaw= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r264864 - head/sys/dev/usb/wlan From: Rui Paulo In-Reply-To: <201404240316.s3O3GlUl093950@svn.freebsd.org> Date: Tue, 29 Apr 2014 14:07:21 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <1D92F901-019B-436A-9926-7D7AB4F4C858@felyko.com> References: <201404240316.s3O3GlUl093950@svn.freebsd.org> To: Kevin Lo X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 21:07:25 -0000 On Apr 23, 2014, at 20:16, Kevin Lo wrote: > Author: kevlo > Date: Thu Apr 24 03:16:47 2014 > New Revision: 264864 > URL: http://svnweb.freebsd.org/changeset/base/264864 >=20 > Log: > Fix panic by adding mtx_assert() to urtwn_init_locked() and > urtwn_stop_locked(). This was not a panic, but a LOR. > Modified: > head/sys/dev/usb/wlan/if_urtwn.c >=20 > Modified: head/sys/dev/usb/wlan/if_urtwn.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/usb/wlan/if_urtwn.c Thu Apr 24 02:16:23 2014 = (r264863) > +++ head/sys/dev/usb/wlan/if_urtwn.c Thu Apr 24 03:16:47 2014 = (r264864) > @@ -2054,6 +2054,7 @@ urtwn_load_firmware(struct urtwn_softc * > uint32_t reg; > int mlen, ntries, page, error; >=20 > + URTWN_UNLOCK(sc); You didn't need to unlock this early. The problem was in = firmware_get(). > /* Read firmware image from the filesystem. */ > if ((sc->chip & (URTWN_CHIP_UMC_A_CUT | URTWN_CHIP_92C)) =3D=3D > URTWN_CHIP_UMC_A_CUT) > @@ -2062,6 +2063,7 @@ urtwn_load_firmware(struct urtwn_softc * > imagename =3D "urtwn-rtl8192cfwT"; >=20 > fw =3D firmware_get(imagename); > + URTWN_LOCK(sc); > if (fw =3D=3D NULL) { > device_printf(sc->sc_dev, > "failed loadfirmware of file %s\n", imagename); > @@ -2816,6 +2818,8 @@ urtwn_init_locked(void *arg) > uint32_t reg; > int error; >=20 > + URTWN_ASSERT_LOCKED(sc); > + > if (ifp->if_drv_flags & IFF_DRV_RUNNING) > urtwn_stop_locked(ifp); >=20 > @@ -2979,6 +2983,8 @@ urtwn_stop_locked(struct ifnet *ifp) > { > struct urtwn_softc *sc =3D ifp->if_softc; >=20 > + URTWN_ASSERT_LOCKED(sc); > + > ifp->if_drv_flags &=3D ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); >=20 > callout_stop(&sc->sc_watchdog_ch); This is fine, but I wonder if the firmware API should be changed. The = problem with this approach, and all USB WiFi drivers, is that by = unlocking the mutex, the mutual exclusion protection is lost...=20 -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Tue Apr 29 23:29:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1144517A; Tue, 29 Apr 2014 23:29:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2DD38C5; Tue, 29 Apr 2014 23:29:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3TNTSqQ098310; Tue, 29 Apr 2014 23:29:28 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3TNTSYq098309; Tue, 29 Apr 2014 23:29:28 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404292329.s3TNTSYq098309@svn.freebsd.org> From: Ian Lepore Date: Tue, 29 Apr 2014 23:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265111 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 23:29:29 -0000 Author: ian Date: Tue Apr 29 23:29:28 2014 New Revision: 265111 URL: http://svnweb.freebsd.org/changeset/base/265111 Log: Make this declaration into a proper function prototype. Modified: head/sys/arm/include/cpufunc.h Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Tue Apr 29 20:57:25 2014 (r265110) +++ head/sys/arm/include/cpufunc.h Tue Apr 29 23:29:28 2014 (r265111) @@ -411,7 +411,7 @@ void armv6_idcache_wbinv_range (vm_offse void armv7_setttb (u_int); void armv7_tlb_flushID (void); void armv7_tlb_flushID_SE (u_int); -void armv7_icache_sync_all (); +void armv7_icache_sync_all (void); void armv7_icache_sync_range (vm_offset_t, vm_size_t); void armv7_idcache_wbinv_range (vm_offset_t, vm_size_t); void armv7_idcache_inv_all (void); From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 02:03:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93AEC9D8; Wed, 30 Apr 2014 02:03:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7415015A8; Wed, 30 Apr 2014 02:03:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3U23ERs063554; Wed, 30 Apr 2014 02:03:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U23DNk063550; Wed, 30 Apr 2014 02:03:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404300203.s3U23DNk063550@svn.freebsd.org> From: Adrian Chadd Date: Wed, 30 Apr 2014 02:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265112 - in head/sys/dev/ath/ath_hal: ar5210 ar5211 ar5212 ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 02:03:14 -0000 Author: adrian Date: Wed Apr 30 02:03:13 2014 New Revision: 265112 URL: http://svnweb.freebsd.org/changeset/base/265112 Log: * Only update ah_powerMode if we're setting the chip sleep state. Some code will appear soon that is actually setting the chip powerstate separate from the self-generated frames power state. * Allow the AR5416 family chips to actually have the power state changed from the self generated state change. Tested (STA mode): * AR5210 * AR5211 * AR5412 * AR5413 * AR5416 * AR9285 Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_power.c head/sys/dev/ath/ath_hal/ar5211/ar5211_power.c head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_power.c Tue Apr 29 23:29:28 2014 (r265111) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_power.c Wed Apr 30 02:03:13 2014 (r265112) @@ -108,16 +108,19 @@ ar5210SetPowerMode(struct ath_hal *ah, H setChip ? "set chip " : ""); switch (mode) { case HAL_PM_AWAKE: - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; status = ar5210SetPowerModeAwake(ah, setChip); break; case HAL_PM_FULL_SLEEP: ar5210SetPowerModeSleep(ah, setChip); - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; break; case HAL_PM_NETWORK_SLEEP: ar5210SetPowerModeAuto(ah, setChip); - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; break; default: HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unknown power mode %u\n", Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_power.c Tue Apr 29 23:29:28 2014 (r265111) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_power.c Wed Apr 30 02:03:13 2014 (r265112) @@ -110,16 +110,19 @@ ar5211SetPowerMode(struct ath_hal *ah, H setChip ? "set chip " : ""); switch (mode) { case HAL_PM_AWAKE: - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; status = ar5211SetPowerModeAwake(ah, setChip); break; case HAL_PM_FULL_SLEEP: ar5211SetPowerModeSleep(ah, setChip); - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; break; case HAL_PM_NETWORK_SLEEP: ar5211SetPowerModeNetworkSleep(ah, setChip); - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; break; default: HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unknown power mode %u\n", Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c Tue Apr 29 23:29:28 2014 (r265111) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_power.c Wed Apr 30 02:03:13 2014 (r265112) @@ -134,16 +134,19 @@ ar5212SetPowerMode(struct ath_hal *ah, H setChip ? "set chip " : ""); switch (mode) { case HAL_PM_AWAKE: - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; status = ar5212SetPowerModeAwake(ah, setChip); break; case HAL_PM_FULL_SLEEP: ar5212SetPowerModeSleep(ah, setChip); - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; break; case HAL_PM_NETWORK_SLEEP: ar5212SetPowerModeNetworkSleep(ah, setChip); - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; break; default: HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unknown power mode %u\n", Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c Tue Apr 29 23:29:28 2014 (r265111) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c Wed Apr 30 02:03:13 2014 (r265112) @@ -133,23 +133,29 @@ ar5416SetPowerMode(struct ath_hal *ah, H }; #endif int status = AH_TRUE; + +#if 0 if (!setChip) return AH_TRUE; +#endif HALDEBUG(ah, HAL_DEBUG_POWER, "%s: %s -> %s (%s)\n", __func__, modes[ah->ah_powerMode], modes[mode], setChip ? "set chip " : ""); switch (mode) { case HAL_PM_AWAKE: - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; status = ar5416SetPowerModeAwake(ah, setChip); break; case HAL_PM_FULL_SLEEP: ar5416SetPowerModeSleep(ah, setChip); - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; break; case HAL_PM_NETWORK_SLEEP: ar5416SetPowerModeNetworkSleep(ah, setChip); - ah->ah_powerMode = mode; + if (setChip) + ah->ah_powerMode = mode; break; default: HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unknown power mode 0x%x\n", From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 02:03:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACE03B10; Wed, 30 Apr 2014 02:03:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 996F715AC; Wed, 30 Apr 2014 02:03:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3U23li5063637; Wed, 30 Apr 2014 02:03:47 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U23liL063635; Wed, 30 Apr 2014 02:03:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404300203.s3U23liL063635@svn.freebsd.org> From: Adrian Chadd Date: Wed, 30 Apr 2014 02:03:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265113 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 02:03:47 -0000 Author: adrian Date: Wed Apr 30 02:03:47 2014 New Revision: 265113 URL: http://svnweb.freebsd.org/changeset/base/265113 Log: Only track the power state variable if the power state is changed, not if the self-generated frame state is changed. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c Wed Apr 30 02:03:13 2014 (r265112) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c Wed Apr 30 02:03:47 2014 (r265113) @@ -669,7 +669,8 @@ ar9300_set_power_mode(struct ath_hal *ah switch (mode) { case HAL_PM_AWAKE: - ah->ah_powerMode = mode; + if (set_chip) + ah->ah_powerMode = mode; status = ar9300_set_power_mode_awake(ah, set_chip); #if ATH_SUPPORT_MCI if (AH_PRIVATE(ah)->ah_caps.halMciSupport) { @@ -699,8 +700,10 @@ ar9300_set_power_mode(struct ath_hal *ah } #endif ar9300_set_power_mode_sleep(ah, set_chip); - ahp->ah_chip_full_sleep = AH_TRUE; - ah->ah_powerMode = mode; + if (set_chip) { + ahp->ah_chip_full_sleep = AH_TRUE; + ah->ah_powerMode = mode; + } break; case HAL_PM_NETWORK_SLEEP: #if ATH_SUPPORT_MCI @@ -709,7 +712,9 @@ ar9300_set_power_mode(struct ath_hal *ah } #endif ar9300_set_power_mode_network_sleep(ah, set_chip); - ah->ah_powerMode = mode; + if (set_chip) { + ah->ah_powerMode = mode; + } break; default: HALDEBUG(ah, HAL_DEBUG_POWER_MGMT, From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 02:08:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46B7CDE2; Wed, 30 Apr 2014 02:08:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 338D01611; Wed, 30 Apr 2014 02:08:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3U28SjR064163; Wed, 30 Apr 2014 02:08:28 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U28RRd064160; Wed, 30 Apr 2014 02:08:27 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201404300208.s3U28RRd064160@svn.freebsd.org> From: Neel Natu Date: Wed, 30 Apr 2014 02:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265114 - in head: sys/amd64/vmm/intel usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 02:08:28 -0000 Author: neel Date: Wed Apr 30 02:08:27 2014 New Revision: 265114 URL: http://svnweb.freebsd.org/changeset/base/265114 Log: Ignore writes to microcode update MSR. This MSR is accessed by RHEL7 guest. Add KTR tracepoints to annotate wrmsr and rdmsr VM exits. Modified: head/sys/amd64/vmm/intel/vmx.c head/usr.sbin/bhyve/xmsr.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Wed Apr 30 02:03:47 2014 (r265113) +++ head/sys/amd64/vmm/intel/vmx.c Wed Apr 30 02:08:27 2014 (r265114) @@ -1797,6 +1797,7 @@ vmx_exit_process(struct vmx *vmx, int vc vmm_stat_incr(vmx->vm, vcpu, VMEXIT_RDMSR, 1); retu = false; ecx = vmxctx->guest_rcx; + VCPU_CTR1(vmx->vm, vcpu, "rdmsr 0x%08x", ecx); error = emulate_rdmsr(vmx->vm, vcpu, ecx, &retu); if (error) { vmexit->exitcode = VM_EXITCODE_RDMSR; @@ -1815,6 +1816,8 @@ vmx_exit_process(struct vmx *vmx, int vc eax = vmxctx->guest_rax; ecx = vmxctx->guest_rcx; edx = vmxctx->guest_rdx; + VCPU_CTR2(vmx->vm, vcpu, "wrmsr 0x%08x value 0x%016lx", + ecx, (uint64_t)edx << 32 | eax); error = emulate_wrmsr(vmx->vm, vcpu, ecx, (uint64_t)edx << 32 | eax, &retu); if (error) { Modified: head/usr.sbin/bhyve/xmsr.c ============================================================================== --- head/usr.sbin/bhyve/xmsr.c Wed Apr 30 02:03:47 2014 (r265113) +++ head/usr.sbin/bhyve/xmsr.c Wed Apr 30 02:08:27 2014 (r265114) @@ -47,6 +47,8 @@ emulate_wrmsr(struct vmctx *ctx, int vcp case 0xd04: /* Sandy Bridge uncore PMC MSRs */ case 0xc24: return (0); + case 0x79: + return (0); /* IA32_BIOS_UPDT_TRIG MSR */ default: break; } From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 02:19:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 823B51C1; Wed, 30 Apr 2014 02:19:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E50216CA; Wed, 30 Apr 2014 02:19:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3U2Jg25068452; Wed, 30 Apr 2014 02:19:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U2JgWn068449; Wed, 30 Apr 2014 02:19:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404300219.s3U2JgWn068449@svn.freebsd.org> From: Adrian Chadd Date: Wed, 30 Apr 2014 02:19:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265115 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 02:19:42 -0000 Author: adrian Date: Wed Apr 30 02:19:41 2014 New Revision: 265115 URL: http://svnweb.freebsd.org/changeset/base/265115 Log: Bring over some initial power save management support, reset path fixes and beacon programming / debugging into the ath(4) driver. The basic power save tracking: * Add some new code to track the current desired powersave state; and * Add some reference count tracking so we know when the NIC is awake; then * Add code in all the points where we're about to touch the hardware and push it to force-wake. Then, how things are moved into power save: * Only move into network-sleep during a RUN->SLEEP transition; * Force wake the hardware up everywhere that we're about to touch the hardware. The net80211 stack takes care of doing RUN<->SLEEP<->(other) state transitions so we don't have to do it in the driver. Next, when to wake things up: * In short - everywhere we touch the hardware. * The hardware will take care of staying awake if things are queued in the transmit queue(s); it'll then transit down to sleep if there's nothing left. This way we don't have to track the software / hardware transmit queue(s) and keep the hardware awake for those. Then, some transmit path fixes that aren't related but useful: * Force EAPOL frames to go out at the lowest rate. This improves reliability during the encryption handshake after 802.11 negotiation. Next, some reset path fixes! * Fix the overlap between reset and transmit pause so we don't transmit frames during a reset. * Some noisy environments will end up taking a lot longer to reset than normal, so extend the reset period and drop the raise the reset interval to be more realistic and give the hardware some time to finish calibration. * Skip calibration during the reset path. Tsk! Then, beacon fixes in station mode! * Add a _lot_ more debugging in the station beacon reset path. This is all quite fluid right now. * Modify the STA beacon programming code to try and take the TU gap between desired TSF and the target TU into account. (Lifted from QCA.) Tested: * AR5210 * AR5211 * AR5212 * AR5413 * AR5416 * AR9280 * AR9285 TODO: * More AP, IBSS, mesh, TDMA testing * Thorough AR9380 and later testing! * AR9160 and AR9287 testing Obtained from: QCA Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_beacon.c head/sys/dev/ath/if_ath_beacon.h head/sys/dev/ath/if_ath_debug.h head/sys/dev/ath/if_ath_keycache.c head/sys/dev/ath/if_ath_led.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_ath_rx_edma.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Apr 30 02:08:27 2014 (r265114) +++ head/sys/dev/ath/if_ath.c Wed Apr 30 02:19:41 2014 (r265115) @@ -279,6 +279,95 @@ ath_legacy_attach_comp_func(struct ath_s } } +/* + * Set the target power mode. + * + * If this is called during a point in time where + * the hardware is being programmed elsewhere, it will + * simply store it away and update it when all current + * uses of the hardware are completed. + */ +void +_ath_power_setpower(struct ath_softc *sc, int power_state, const char *file, int line) +{ + ATH_LOCK_ASSERT(sc); + + sc->sc_target_powerstate = power_state; + + DPRINTF(sc, ATH_DEBUG_PWRSAVE, "%s: (%s:%d) state=%d, refcnt=%d\n", + __func__, + file, + line, + power_state, + sc->sc_powersave_refcnt); + + if (sc->sc_powersave_refcnt == 0 && + power_state != sc->sc_cur_powerstate) { + sc->sc_cur_powerstate = power_state; + ath_hal_setpower(sc->sc_ah, power_state); + } +} + +/* + * Set the hardware power mode and take a reference. + * + * This doesn't update the target power mode in the driver; + * it just updates the hardware power state. + * + * XXX it should only ever force the hardware awake; it should + * never be called to set it asleep. + */ +void +_ath_power_set_power_state(struct ath_softc *sc, int power_state, const char *file, int line) +{ + ATH_LOCK_ASSERT(sc); + + DPRINTF(sc, ATH_DEBUG_PWRSAVE, "%s: (%s:%d) state=%d, refcnt=%d\n", + __func__, + file, + line, + power_state, + sc->sc_powersave_refcnt); + + sc->sc_powersave_refcnt++; + + if (power_state != sc->sc_cur_powerstate) { + ath_hal_setpower(sc->sc_ah, power_state); + sc->sc_cur_powerstate = power_state; + } +} + +/* + * Restore the power save mode to what it once was. + * + * This will decrement the reference counter and once it hits + * zero, it'll restore the powersave state. + */ +void +_ath_power_restore_power_state(struct ath_softc *sc, const char *file, int line) +{ + + ATH_LOCK_ASSERT(sc); + + DPRINTF(sc, ATH_DEBUG_PWRSAVE, "%s: (%s:%d) refcnt=%d, target state=%d\n", + __func__, + file, + line, + sc->sc_powersave_refcnt, + sc->sc_target_powerstate); + + if (sc->sc_powersave_refcnt == 0) + device_printf(sc->sc_dev, "%s: refcnt=0?\n", __func__); + else + sc->sc_powersave_refcnt--; + + if (sc->sc_powersave_refcnt == 0 && + sc->sc_target_powerstate != sc->sc_cur_powerstate) { + sc->sc_cur_powerstate = sc->sc_target_powerstate; + ath_hal_setpower(sc->sc_ah, sc->sc_target_powerstate); + } +} + #define HAL_MODE_HT20 (HAL_MODE_11NG_HT20 | HAL_MODE_11NA_HT20) #define HAL_MODE_HT40 \ (HAL_MODE_11NG_HT40PLUS | HAL_MODE_11NG_HT40MINUS | \ @@ -341,6 +430,10 @@ ath_attach(u_int16_t devid, struct ath_s ath_xmit_setup_legacy(sc); } + if (ath_hal_hasmybeacon(sc->sc_ah)) { + sc->sc_do_mybeacon = 1; + } + /* * Check if the MAC has multi-rate retry support. * We do this by trying to setup a fake extended @@ -605,6 +698,8 @@ ath_attach(u_int16_t devid, struct ath_s #ifdef ATH_ENABLE_DFS | IEEE80211_C_DFS /* Enable radar detection */ #endif + | IEEE80211_C_PMGT /* Station side power mgmt */ + | IEEE80211_C_SWSLEEP ; /* * Query the hal to figure out h/w crypto support. @@ -994,6 +1089,14 @@ ath_attach(u_int16_t devid, struct ath_s if (bootverbose) ieee80211_announce(ic); ath_announce(sc); + + /* + * Put it to sleep for now. + */ + ATH_LOCK(sc); + ath_power_setpower(sc, HAL_PM_FULL_SLEEP); + ATH_UNLOCK(sc); + return 0; bad2: ath_tx_cleanup(sc); @@ -1039,7 +1142,22 @@ ath_detach(struct ath_softc *sc) * it last * Other than that, it's straightforward... */ + + /* + * XXX Wake the hardware up first. ath_stop() will still + * wake it up first, but I'd rather do it here just to + * ensure it's awake. + */ + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ath_power_setpower(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + + /* + * Stop things cleanly. + */ ath_stop(ifp); + ieee80211_ifdetach(ifp->if_l2com); taskqueue_free(sc->sc_tq); #ifdef ATH_TX99_DIAG @@ -1402,6 +1520,10 @@ ath_vap_delete(struct ieee80211vap *vap) struct ath_hal *ah = sc->sc_ah; struct ath_vap *avp = ATH_VAP(vap); + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + DPRINTF(sc, ATH_DEBUG_RESET, "%s: called\n", __func__); if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* @@ -1415,6 +1537,8 @@ ath_vap_delete(struct ieee80211vap *vap) ath_stoprecv(sc, 1); /* stop recv side */ } + /* .. leave the hardware awake for now. */ + ieee80211_vap_detach(vap); /* @@ -1502,6 +1626,9 @@ ath_vap_delete(struct ieee80211vap *vap) } ath_hal_intrset(ah, sc->sc_imask); } + + /* Ok, let the hardware asleep. */ + ath_power_restore_power_state(sc); ATH_UNLOCK(sc); } @@ -1547,8 +1674,12 @@ ath_reset_keycache(struct ath_softc *sc) struct ath_hal *ah = sc->sc_ah; int i; + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); for (i = 0; i < sc->sc_keymax; i++) ath_hal_keyreset(ah, i); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); ieee80211_crypto_reload_keys(ic); } @@ -1600,6 +1731,13 @@ ath_resume(struct ath_softc *sc) sc->sc_curchan != NULL ? sc->sc_curchan : ic->ic_curchan); ath_hal_setchainmasks(sc->sc_ah, sc->sc_cur_txchainmask, sc->sc_cur_rxchainmask); + + /* Ensure we set the current power state to on */ + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ath_power_setpower(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + ath_hal_reset(ah, sc->sc_opmode, sc->sc_curchan != NULL ? sc->sc_curchan : ic->ic_curchan, AH_FALSE, &status); @@ -1632,6 +1770,10 @@ ath_resume(struct ath_softc *sc) if (sc->sc_resume_up) ieee80211_resume_all(ic); + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + /* XXX beacons ? */ } @@ -1689,6 +1831,10 @@ ath_intr(void *arg) return; } + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0 || (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { HAL_INT status; @@ -1698,6 +1844,10 @@ ath_intr(void *arg) ath_hal_getisr(ah, &status); /* clear ISR */ ath_hal_intrset(ah, 0); /* disable further intr's */ ATH_PCU_UNLOCK(sc); + + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); return; } @@ -1737,6 +1887,11 @@ ath_intr(void *arg) /* Short-circuit un-handled interrupts */ if (status == 0x0) { ATH_PCU_UNLOCK(sc); + + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + return; } @@ -1903,10 +2058,18 @@ ath_intr(void *arg) ATH_KTR(sc, ATH_KTR_ERROR, 0, "ath_intr: RXORN"); sc->sc_stats.ast_rxorn++; } + if (status & HAL_INT_TSFOOR) { + device_printf(sc->sc_dev, "%s: TSFOOR\n", __func__); + sc->sc_syncbeacon = 1; + } } ATH_PCU_LOCK(sc); sc->sc_intr_cnt--; ATH_PCU_UNLOCK(sc); + + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); } static void @@ -1937,6 +2100,8 @@ ath_fatal_proc(void *arg, int pending) static void ath_bmiss_vap(struct ieee80211vap *vap) { + struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; + /* * Workaround phantom bmiss interrupts by sanity-checking * the time of our last rx'd frame. If it is within the @@ -1945,6 +2110,16 @@ ath_bmiss_vap(struct ieee80211vap *vap) * be dispatched up for processing. Note this applies only * for h/w beacon miss events. */ + + /* + * XXX TODO: Just read the TSF during the interrupt path; + * that way we don't have to wake up again just to read it + * again. + */ + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + if ((vap->iv_flags_ext & IEEE80211_FEXT_SWBMISS) == 0) { struct ifnet *ifp = vap->iv_ic->ic_ifp; struct ath_softc *sc = ifp->if_softc; @@ -1962,12 +2137,32 @@ ath_bmiss_vap(struct ieee80211vap *vap) if (tsf - lastrx <= bmisstimeout) { sc->sc_stats.ast_bmiss_phantom++; + + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + return; } } + + /* + * There's no need to keep the hardware awake during the call + * to av_bmiss(). + */ + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + + /* + * Attempt to force a beacon resync. + */ + sc->sc_syncbeacon = 1; + ATH_VAP(vap)->av_bmiss(vap); } +/* XXX this needs a force wakeup! */ int ath_hal_gethangstate(struct ath_hal *ah, uint32_t mask, uint32_t *hangs) { @@ -1990,6 +2185,12 @@ ath_bmiss_proc(void *arg, int pending) DPRINTF(sc, ATH_DEBUG_ANY, "%s: pending %u\n", __func__, pending); + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + + ath_beacon_miss(sc); + /* * Do a reset upon any becaon miss event. * @@ -2003,6 +2204,13 @@ ath_bmiss_proc(void *arg, int pending) ath_reset(ifp, ATH_RESET_NOLOSS); ieee80211_beacon_miss(ifp->if_l2com); } + + /* Force a beacon resync, in case they've drifted */ + sc->sc_syncbeacon = 1; + + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); } /* @@ -2042,6 +2250,12 @@ ath_init(void *arg) ATH_LOCK(sc); /* + * Force the sleep state awake. + */ + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ath_power_setpower(sc, HAL_PM_AWAKE); + + /* * Stop anything previously setup. This is safe * whether this is the first time through or not. */ @@ -2058,6 +2272,7 @@ ath_init(void *arg) ath_update_chainmasks(sc, ic->ic_curchan); ath_hal_setchainmasks(sc->sc_ah, sc->sc_cur_txchainmask, sc->sc_cur_rxchainmask); + if (!ath_hal_reset(ah, sc->sc_opmode, ic->ic_curchan, AH_FALSE, &status)) { if_printf(ifp, "unable to reset hardware; hal status %u\n", status); @@ -2113,6 +2328,7 @@ ath_init(void *arg) */ if (ath_startrecv(sc) != 0) { if_printf(ifp, "unable to start recv logic\n"); + ath_power_restore_power_state(sc); ATH_UNLOCK(sc); return; } @@ -2139,6 +2355,15 @@ ath_init(void *arg) if (sc->sc_needmib && ic->ic_opmode == IEEE80211_M_STA) sc->sc_imask |= HAL_INT_MIB; + /* + * XXX add capability for this. + * + * If we're in STA mode (and maybe IBSS?) then register for + * TSFOOR interrupts. + */ + if (ic->ic_opmode == IEEE80211_M_STA) + sc->sc_imask |= HAL_INT_TSFOOR; + /* Enable global TX timeout and carrier sense timeout if available */ if (ath_hal_gtxto_supported(ah)) sc->sc_imask |= HAL_INT_GTT; @@ -2150,6 +2375,7 @@ ath_init(void *arg) callout_reset(&sc->sc_wd_ch, hz, ath_watchdog, sc); ath_hal_intrset(ah, sc->sc_imask); + ath_power_restore_power_state(sc); ATH_UNLOCK(sc); #ifdef ATH_TX99_DIAG @@ -2170,6 +2396,12 @@ ath_stop_locked(struct ifnet *ifp) __func__, sc->sc_invalid, ifp->if_flags); ATH_LOCK_ASSERT(sc); + + /* + * Wake the hardware up before fiddling with it. + */ + ath_power_set_power_state(sc, HAL_PM_AWAKE); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* * Shutdown the hardware and driver: @@ -2210,9 +2442,20 @@ ath_stop_locked(struct ifnet *ifp) sc->sc_rxlink = NULL; ath_beacon_free(sc); /* XXX not needed */ } + + /* And now, restore the current power state */ + ath_power_restore_power_state(sc); } -#define MAX_TXRX_ITERATIONS 1000 +/* + * Wait until all pending TX/RX has completed. + * + * This waits until all existing transmit, receive and interrupts + * have completed. It's assumed that the caller has first + * grabbed the reset lock so it doesn't try to do overlapping + * chip resets. + */ +#define MAX_TXRX_ITERATIONS 100 static void ath_txrx_stop_locked(struct ath_softc *sc) { @@ -2231,7 +2474,8 @@ ath_txrx_stop_locked(struct ath_softc *s sc->sc_txstart_cnt || sc->sc_intr_cnt) { if (i <= 0) break; - msleep(sc, &sc->sc_pcu_mtx, 0, "ath_txrx_stop", 1); + msleep(sc, &sc->sc_pcu_mtx, 0, "ath_txrx_stop", + msecs_to_ticks(10)); i--; } @@ -2278,7 +2522,7 @@ ath_txrx_start(struct ath_softc *sc) * Another, cleaner way should be found to serialise all of * these operations. */ -#define MAX_RESET_ITERATIONS 10 +#define MAX_RESET_ITERATIONS 25 static int ath_reset_grablock(struct ath_softc *sc, int dowait) { @@ -2296,7 +2540,11 @@ ath_reset_grablock(struct ath_softc *sc, break; } ATH_PCU_UNLOCK(sc); - pause("ath_reset_grablock", 1); + /* + * 1 tick is likely not enough time for long calibrations + * to complete. So we should wait quite a while. + */ + pause("ath_reset_grablock", msecs_to_ticks(100)); i--; ATH_PCU_LOCK(sc); } while (i > 0); @@ -2361,6 +2609,13 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T /* Try to (stop any further TX/RX from occuring */ taskqueue_block(sc->sc_tq); + /* + * Wake the hardware up. + */ + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + ATH_PCU_LOCK(sc); /* @@ -2455,9 +2710,13 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T * reset counter - this way ath_intr() doesn't end up * disabling interrupts without a corresponding enable * in the rest or channel change path. + * + * Grab the TX reference in case we need to transmit. + * That way a parallel transmit doesn't. */ ATH_PCU_LOCK(sc); sc->sc_inreset_cnt--; + sc->sc_txstart_cnt++; /* XXX only do this if sc_inreset_cnt == 0? */ ath_hal_intrset(ah, sc->sc_imask); ATH_PCU_UNLOCK(sc); @@ -2474,6 +2733,8 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T /* Restart TX/RX as needed */ ath_txrx_start(sc); + /* XXX TODO: we need to hold the tx refcount here! */ + /* Restart TX completion and pending TX */ if (reset_type == ATH_RESET_NOLOSS) { for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { @@ -2498,6 +2759,14 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; IF_UNLOCK(&ifp->if_snd); + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + + ATH_PCU_LOCK(sc); + sc->sc_txstart_cnt--; + ATH_PCU_UNLOCK(sc); + /* Handle any frames in the TX queue */ /* * XXX should this be done by the caller, rather than @@ -2638,6 +2907,7 @@ ath_buf_clone(struct ath_softc *sc, stru tbf->bf_status = bf->bf_status; tbf->bf_m = bf->bf_m; tbf->bf_node = bf->bf_node; + KASSERT((bf->bf_node != NULL), ("%s: bf_node=NULL!", __func__)); /* will be setup by the chain/setup function */ tbf->bf_lastds = NULL; /* for now, last == self */ @@ -2739,6 +3009,11 @@ ath_transmit(struct ifnet *ifp, struct m sc->sc_txstart_cnt++; ATH_PCU_UNLOCK(sc); + /* Wake the hardware up already */ + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + ATH_KTR(sc, ATH_KTR_TX, 0, "ath_transmit: start"); /* * Grab the TX lock - it's ok to do this here; we haven't @@ -2972,6 +3247,11 @@ finish: sc->sc_txstart_cnt--; ATH_PCU_UNLOCK(sc); + /* Sleep the hardware if required */ + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + ATH_KTR(sc, ATH_KTR_TX, 0, "ath_transmit: finished"); return (retval); @@ -2999,7 +3279,6 @@ ath_key_update_begin(struct ieee80211vap DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s:\n", __func__); taskqueue_block(sc->sc_tq); - IF_LOCK(&ifp->if_snd); /* NB: doesn't block mgmt frames */ } static void @@ -3009,7 +3288,6 @@ ath_key_update_end(struct ieee80211vap * struct ath_softc *sc = ifp->if_softc; DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s:\n", __func__); - IF_UNLOCK(&ifp->if_snd); taskqueue_unblock(sc->sc_tq); } @@ -3020,8 +3298,12 @@ ath_update_promisc(struct ifnet *ifp) u_int32_t rfilt; /* configure rx filter */ + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); rfilt = ath_calcrxfilter(sc); ath_hal_setrxfilter(sc->sc_ah, rfilt); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); DPRINTF(sc, ATH_DEBUG_MODE, "%s: RX filter 0x%x\n", __func__, rfilt); } @@ -3057,7 +3339,11 @@ ath_update_mcast(struct ifnet *ifp) if_maddr_runlock(ifp); } else mfilt[0] = mfilt[1] = ~0; + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); ath_hal_setmcastfilter(sc->sc_ah, mfilt[0], mfilt[1]); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); DPRINTF(sc, ATH_DEBUG_MODE, "%s: MC filter %08x:%08x\n", __func__, mfilt[0], mfilt[1]); } @@ -3119,8 +3405,13 @@ ath_setslottime(struct ath_softc *sc) __func__, ic->ic_curchan->ic_freq, ic->ic_curchan->ic_flags, ic->ic_flags & IEEE80211_F_SHSLOT ? "short" : "long", usec); + /* Wake up the hardware first before updating the slot time */ + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); ath_hal_setslottime(ah, usec); + ath_power_restore_power_state(sc); sc->sc_updateslot = OK; + ATH_UNLOCK(sc); } /* @@ -3137,6 +3428,8 @@ ath_updateslot(struct ifnet *ifp) * When not coordinating the BSS, change the hardware * immediately. For other operation we defer the change * until beacon updates have propagated to the stations. + * + * XXX sc_updateslot isn't changed behind a lock? */ if (ic->ic_opmode == IEEE80211_M_HOSTAP || ic->ic_opmode == IEEE80211_M_MBSS) @@ -4258,6 +4551,10 @@ ath_tx_proc_q0(void *arg, int npending) sc->sc_txq_active &= ~txqs; ATH_PCU_UNLOCK(sc); + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + ATH_KTR(sc, ATH_KTR_TXCOMP, 1, "ath_tx_proc_q0: txqs=0x%08x", txqs); @@ -4278,6 +4575,10 @@ ath_tx_proc_q0(void *arg, int npending) sc->sc_txproc_cnt--; ATH_PCU_UNLOCK(sc); + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + ath_tx_kick(sc); } @@ -4299,6 +4600,10 @@ ath_tx_proc_q0123(void *arg, int npendin sc->sc_txq_active &= ~txqs; ATH_PCU_UNLOCK(sc); + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + ATH_KTR(sc, ATH_KTR_TXCOMP, 1, "ath_tx_proc_q0123: txqs=0x%08x", txqs); @@ -4331,6 +4636,10 @@ ath_tx_proc_q0123(void *arg, int npendin sc->sc_txproc_cnt--; ATH_PCU_UNLOCK(sc); + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + ath_tx_kick(sc); } @@ -4351,6 +4660,10 @@ ath_tx_proc(void *arg, int npending) sc->sc_txq_active &= ~txqs; ATH_PCU_UNLOCK(sc); + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + ATH_KTR(sc, ATH_KTR_TXCOMP, 1, "ath_tx_proc: txqs=0x%08x", txqs); /* @@ -4376,6 +4689,10 @@ ath_tx_proc(void *arg, int npending) sc->sc_txproc_cnt--; ATH_PCU_UNLOCK(sc); + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + ath_tx_kick(sc); } #undef TXQACTIVE @@ -4402,6 +4719,10 @@ ath_txq_sched_tasklet(void *arg, int npe sc->sc_txproc_cnt++; ATH_PCU_UNLOCK(sc); + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + ATH_TX_LOCK(sc); for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { if (ATH_TXQ_SETUP(sc, i)) { @@ -4410,6 +4731,10 @@ ath_txq_sched_tasklet(void *arg, int npe } ATH_TX_UNLOCK(sc); + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + ATH_PCU_LOCK(sc); sc->sc_txproc_cnt--; ATH_PCU_UNLOCK(sc); @@ -5057,6 +5382,15 @@ ath_calibrate(void *arg) HAL_BOOL aniCal, shortCal = AH_FALSE; int nextcal; + /* + * Force the hardware awake for ANI work. + */ + ath_power_set_power_state(sc, HAL_PM_AWAKE); + + /* Skip trying to do this if we're in reset */ + if (sc->sc_inreset_cnt) + goto restart; + if (ic->ic_flags & IEEE80211_F_SCAN) /* defer, off channel */ goto restart; longCal = (ticks - sc->sc_lastlongcal >= ath_longcalinterval*hz); @@ -5086,6 +5420,7 @@ ath_calibrate(void *arg) sc->sc_doresetcal = AH_TRUE; taskqueue_enqueue(sc->sc_tq, &sc->sc_resettask); callout_reset(&sc->sc_cal_ch, 1, ath_calibrate, sc); + ath_power_restore_power_state(sc); return; } /* @@ -5157,6 +5492,10 @@ restart: __func__); /* NB: don't rearm timer */ } + /* + * Restore power state now that we're done. + */ + ath_power_restore_power_state(sc); } static void @@ -5242,6 +5581,10 @@ ath_set_channel(struct ieee80211com *ic) struct ifnet *ifp = ic->ic_ifp; struct ath_softc *sc = ifp->if_softc; + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + (void) ath_chan_set(sc, ic->ic_curchan); /* * If we are returning to our bss channel then mark state @@ -5252,6 +5595,7 @@ ath_set_channel(struct ieee80211com *ic) ATH_LOCK(sc); if (!sc->sc_scanning && ic->ic_curchan == ic->ic_bsschan) sc->sc_syncbeacon = 1; + ath_power_restore_power_state(sc); ATH_UNLOCK(sc); } @@ -5284,6 +5628,7 @@ ath_newstate(struct ieee80211vap *vap, e int i, error, stamode; u_int32_t rfilt; int csa_run_transition = 0; + enum ieee80211_state ostate = vap->iv_state; static const HAL_LED_STATE leds[] = { HAL_LED_INIT, /* IEEE80211_S_INIT */ @@ -5297,7 +5642,7 @@ ath_newstate(struct ieee80211vap *vap, e }; DPRINTF(sc, ATH_DEBUG_STATE, "%s: %s -> %s\n", __func__, - ieee80211_state_name[vap->iv_state], + ieee80211_state_name[ostate], ieee80211_state_name[nstate]); /* @@ -5309,7 +5654,12 @@ ath_newstate(struct ieee80211vap *vap, e */ IEEE80211_LOCK_ASSERT(ic); - if (vap->iv_state == IEEE80211_S_CSA && nstate == IEEE80211_S_RUN) + /* Before we touch the hardware - wake it up */ + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + + if (ostate == IEEE80211_S_CSA && nstate == IEEE80211_S_RUN) csa_run_transition = 1; callout_drain(&sc->sc_cal_ch); @@ -5322,6 +5672,12 @@ ath_newstate(struct ieee80211vap *vap, e * [re]setup beacons. Unblock the task q thread so * deferred interrupt processing is done. */ + + /* Ensure we stay awake during scan */ + ATH_LOCK(sc); + ath_power_setpower(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + ath_hal_intrset(ah, sc->sc_imask &~ (HAL_INT_SWBA | HAL_INT_BMISS)); sc->sc_imask &= ~(HAL_INT_SWBA | HAL_INT_BMISS); @@ -5334,6 +5690,11 @@ ath_newstate(struct ieee80211vap *vap, e stamode = (vap->iv_opmode == IEEE80211_M_STA || vap->iv_opmode == IEEE80211_M_AHDEMO || vap->iv_opmode == IEEE80211_M_IBSS); + + /* + * XXX Dont need to do this (and others) if we've transitioned + * from SLEEP->RUN. + */ if (stamode && nstate == IEEE80211_S_RUN) { sc->sc_curaid = ni->ni_associd; IEEE80211_ADDR_COPY(sc->sc_curbssid, ni->ni_bssid); @@ -5436,11 +5797,14 @@ ath_newstate(struct ieee80211vap *vap, e * beacon to update the beacon timer and thus we * won't get notified of the missing beacons. */ - sc->sc_syncbeacon = 1; -#if 0 - if (csa_run_transition) -#endif - ath_beacon_config(sc, vap); + if (ostate != IEEE80211_S_RUN && + ostate != IEEE80211_S_SLEEP) { + DPRINTF(sc, ATH_DEBUG_BEACON, + "%s: STA; syncbeacon=1\n", __func__); + sc->sc_syncbeacon = 1; + + if (csa_run_transition) + ath_beacon_config(sc, vap); /* * PR: kern/175227 @@ -5454,7 +5818,8 @@ ath_newstate(struct ieee80211vap *vap, e * timer fires (too often), leading to a STA * disassociation. */ - sc->sc_beacons = 1; + sc->sc_beacons = 1; + } break; case IEEE80211_M_MONITOR: /* @@ -5480,6 +5845,14 @@ ath_newstate(struct ieee80211vap *vap, e sc->sc_halstats.ns_avgbrssi = ATH_RSSI_DUMMY_MARKER; sc->sc_halstats.ns_avgrssi = ATH_RSSI_DUMMY_MARKER; sc->sc_halstats.ns_avgtxrssi = ATH_RSSI_DUMMY_MARKER; + + /* + * Force awake for RUN mode. + */ + ATH_LOCK(sc); + ath_power_setpower(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + /* * Finally, start any timers and the task q thread * (in case we didn't go through SCAN state). @@ -5491,6 +5864,7 @@ ath_newstate(struct ieee80211vap *vap, e DPRINTF(sc, ATH_DEBUG_CALIBRATE, "%s: calibration disabled\n", __func__); } + taskqueue_unblock(sc->sc_tq); } else if (nstate == IEEE80211_S_INIT) { /* @@ -5510,9 +5884,40 @@ ath_newstate(struct ieee80211vap *vap, e #ifdef IEEE80211_SUPPORT_TDMA ath_hal_setcca(ah, AH_TRUE); #endif + } else if (nstate == IEEE80211_S_SLEEP) { + /* We're going to sleep, so transition appropriately */ + /* For now, only do this if we're a single STA vap */ + if (sc->sc_nvaps == 1 && + vap->iv_opmode == IEEE80211_M_STA) { + DPRINTF(sc, ATH_DEBUG_BEACON, "%s: syncbeacon=%d\n", __func__, sc->sc_syncbeacon); + ATH_LOCK(sc); + if (sc->sc_syncbeacon == 0) { + ath_power_setpower(sc, HAL_PM_NETWORK_SLEEP); + } + /* + * Always at least set the self-generated + * power bits appropriately. + * + * XXX TODO: this should be an ath_power_*() call + * which also tracks whether we're doing self-gen + * frames or not, and allows the hardware to be + * awake _but_ self-gen frames to have PWRMGT=1. + */ + ath_hal_setselfgenpower(sc->sc_ah, + HAL_PM_NETWORK_SLEEP); + ATH_UNLOCK(sc); + } } bad: ieee80211_free_node(ni); + + /* + * Restore the power state - either to what it was, or + * to network_sleep if it's alright. + */ + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); return error; } @@ -5567,6 +5972,13 @@ ath_newassoc(struct ieee80211_node *ni, an->an_mcastrix = ath_tx_findrix(sc, tp->mcastrate); an->an_mgmtrix = ath_tx_findrix(sc, tp->mgmtrate); + DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: reassoc; isnew=%d, is_powersave=%d\n", + __func__, + ni->ni_macaddr, + ":", + isnew, + an->an_is_powersave); + ATH_NODE_LOCK(an); ath_rate_newassoc(sc, an, isnew); ATH_NODE_UNLOCK(an); @@ -5813,6 +6225,10 @@ ath_watchdog(void *arg) struct ifnet *ifp = sc->sc_ifp; uint32_t hangs; + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + if (ath_hal_gethangstate(sc->sc_ah, 0xffff, &hangs) && hangs != 0) { if_printf(ifp, "%s hang detected (0x%x)\n", @@ -5822,6 +6238,10 @@ ath_watchdog(void *arg) do_reset = 1; ifp->if_oerrors++; sc->sc_stats.ast_watchdog++; + + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); } /* @@ -5919,6 +6339,13 @@ ath_ioctl_diag(struct ath_softc *sc, str goto bad; } } + + + ATH_LOCK(sc); + if (id != HAL_DIAG_REGS) + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + if (ath_hal_getdiagstate(ah, id, indata, insize, &outdata, &outsize)) { if (outsize < ad->ad_out_size) ad->ad_out_size = outsize; @@ -5928,6 +6355,12 @@ ath_ioctl_diag(struct ath_softc *sc, str } else { error = EINVAL; } + + ATH_LOCK(sc); + if (id != HAL_DIAG_REGS) + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + bad: if ((ad->ad_id & ATH_DIAG_IN) && indata != NULL) free(indata, M_TEMP); @@ -5974,11 +6407,8 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, } else { ATH_LOCK(sc); ath_stop_locked(ifp); -#ifdef notyet - /* XXX must wakeup in places like ath_vap_delete */ if (!sc->sc_invalid) - ath_hal_setpower(sc->sc_ah, HAL_PM_FULL_SLEEP); -#endif + ath_power_setpower(sc, HAL_PM_FULL_SLEEP); ATH_UNLOCK(sc); } break; Modified: head/sys/dev/ath/if_ath_beacon.c ============================================================================== --- head/sys/dev/ath/if_ath_beacon.c Wed Apr 30 02:08:27 2014 (r265114) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 02:29:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EBE143C; Wed, 30 Apr 2014 02:29:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A16F1792; Wed, 30 Apr 2014 02:29:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3U2TWlD072443; Wed, 30 Apr 2014 02:29:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U2TWiQ072442; Wed, 30 Apr 2014 02:29:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404300229.s3U2TWiQ072442@svn.freebsd.org> From: Adrian Chadd Date: Wed, 30 Apr 2014 02:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265116 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 02:29:32 -0000 Author: adrian Date: Wed Apr 30 02:29:31 2014 New Revision: 265116 URL: http://svnweb.freebsd.org/changeset/base/265116 Log: Add ar9300_get_next_tbtt(). Tested: * AR9380, STA mode Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Wed Apr 30 02:19:41 2014 (r265115) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Wed Apr 30 02:29:31 2014 (r265116) @@ -60,6 +60,11 @@ ar9300_freebsd_set_tx_power_limit(struct return (ar9300_set_tx_power_limit(ah, limit, 0, 0)); } +static uint64_t +ar9300_get_next_tbtt(struct ath_hal *ah) +{ + return (OS_REG_READ(ah, AR_NEXT_TBTT_TIMER)); +} void ar9300_attach_freebsd_ops(struct ath_hal *ah) @@ -195,6 +200,7 @@ ar9300_attach_freebsd_ops(struct ath_hal ah->ah_setStationBeaconTimers = ar9300_set_sta_beacon_timers; /* ah_resetStationBeaconTimers */ /* ah_getNextTBTT */ + ah->ah_getNextTBTT = ar9300_get_next_tbtt; /* Interrupt functions */ ah->ah_isInterruptPending = ar9300_is_interrupt_pending; From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 02:44:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD51B8E5; Wed, 30 Apr 2014 02:44:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE6BF190B; Wed, 30 Apr 2014 02:44:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3U2i7gF079997; Wed, 30 Apr 2014 02:44:07 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U2i7pQ079996; Wed, 30 Apr 2014 02:44:07 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201404300244.s3U2i7pQ079996@svn.freebsd.org> From: Adrian Chadd Date: Wed, 30 Apr 2014 02:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265117 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 02:44:08 -0000 Author: adrian Date: Wed Apr 30 02:44:07 2014 New Revision: 265117 URL: http://svnweb.freebsd.org/changeset/base/265117 Log: * Modify the beacon interval in debugging to be ni_intval, not 102400 * Be paranoid about avoiding divide-by-zero. Tested: * AR9380, STA mode Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Wed Apr 30 02:29:31 2014 (r265116) +++ head/sys/dev/ath/if_ath_rx.c Wed Apr 30 02:44:07 2014 (r265117) @@ -335,10 +335,18 @@ ath_recv_mgmt(struct ieee80211_node *ni, int32_t tsf_delta_bmiss; int32_t tsf_remainder; uint64_t tsf_beacon_target; + int tsf_intval; tsf_beacon_old = ((uint64_t) LE_READ_4(ni->ni_tstamp.data + 4)) << 32; tsf_beacon_old |= LE_READ_4(ni->ni_tstamp.data); +#define TU_TO_TSF(_tu) (((u_int64_t)(_tu)) << 10) + tsf_intval = 1; + if (ni != NULL && ni->ni_intval > 0) { + tsf_intval = TU_TO_TSF(ni->ni_intval); + } +#undef TU_TO_TSF + /* * Call up first so subsequent work can use information * potentially stored in the node (e.g. for ibss merge). @@ -362,12 +370,7 @@ ath_recv_mgmt(struct ieee80211_node *ni, */ tsf_delta = (long long) tsf_beacon - (long long) tsf_beacon_old; - /* - * For now let's just assume the intval is 100TU, which is - * 102400uS. So, we can just calculate the remainder from - * that. - */ - tsf_delta_bmiss = tsf_delta / 102400; + tsf_delta_bmiss = tsf_delta / tsf_intval; /* * If our delta is greater than half the beacon interval, @@ -375,25 +378,26 @@ ath_recv_mgmt(struct ieee80211_node *ni, * interval. Ie, we're running really, really early * on the next beacon. */ - if (tsf_delta % 102400 > 51200) + if (tsf_delta % tsf_intval > (tsf_intval / 2)) tsf_delta_bmiss ++; tsf_beacon_target = tsf_beacon_old + - (((unsigned long long) tsf_delta_bmiss) * 102400ULL); + (((unsigned long long) tsf_delta_bmiss) * (long long) tsf_intval); /* - * The remainder using '%' is between 0 .. 102400-1. + * The remainder using '%' is between 0 .. intval-1. * If we're actually running too fast, then the remainder - * will be some large number just under 102400-1. + * will be some large number just under intval-1. * So we need to look at whether we're running * before or after the target beacon interval * and if we are, modify how we do the remainder * calculation. */ if (tsf_beacon < tsf_beacon_target) { - tsf_remainder = -(102400 - ((tsf_beacon - tsf_beacon_old) % 102400)); + tsf_remainder = + -(tsf_intval - ((tsf_beacon - tsf_beacon_old) % tsf_intval)); } else { - tsf_remainder = (tsf_beacon - tsf_beacon_old) % 102400; + tsf_remainder = (tsf_beacon - tsf_beacon_old) % tsf_intval; } DPRINTF(sc, ATH_DEBUG_BEACON, "%s: old_tsf=%llu, new_tsf=%llu, target_tsf=%llu, delta=%lld, bmiss=%d, remainder=%d\n", @@ -409,7 +413,7 @@ ath_recv_mgmt(struct ieee80211_node *ni, __func__, (unsigned long long) tsf_beacon, (unsigned long long) nexttbtt, - (int32_t) tsf_beacon - (int32_t) nexttbtt + 102400); + (int32_t) tsf_beacon - (int32_t) nexttbtt + tsf_intval); if (sc->sc_syncbeacon && ni == vap->iv_bss && From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 04:02:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A040D6E7; Wed, 30 Apr 2014 04:02:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D7391199; Wed, 30 Apr 2014 04:02:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3U42W60013799; Wed, 30 Apr 2014 04:02:32 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U42WHs013798; Wed, 30 Apr 2014 04:02:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404300402.s3U42WHs013798@svn.freebsd.org> From: Xin LI Date: Wed, 30 Apr 2014 04:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265119 - head/etc/defaults X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 04:02:32 -0000 Author: delphij Date: Wed Apr 30 04:02:32 2014 New Revision: 265119 URL: http://svnweb.freebsd.org/changeset/base/265119 Log: Fix devfs rules not applied by default for jails. Security: FreeBSD-SA-14:07.devfs Security: CVE-2014-3001 Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Wed Apr 30 03:49:21 2014 (r265118) +++ head/etc/defaults/rc.conf Wed Apr 30 04:02:32 2014 (r265119) @@ -641,7 +641,7 @@ devfs_rulesets="/etc/defaults/devfs.rule devfs_system_ruleset="" # The name (NOT number) of a ruleset to apply to /dev devfs_set_rulesets="" # A list of /mount/dev=ruleset_name settings to # apply (must be mounted already, i.e. fstab(5)) -devfs_load_rulesets="NO" # Enable to always load the default rulesets +devfs_load_rulesets="YES" # Enable to always load the default rulesets performance_cx_lowest="HIGH" # Online CPU idle state performance_cpu_freq="NONE" # Online CPU frequency economy_cx_lowest="HIGH" # Offline CPU idle state From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 04:02:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29A4281C; Wed, 30 Apr 2014 04:02:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 156CA119A; Wed, 30 Apr 2014 04:02:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3U42awG013847; Wed, 30 Apr 2014 04:02:36 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U42amK013846; Wed, 30 Apr 2014 04:02:36 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404300402.s3U42amK013846@svn.freebsd.org> From: Xin LI Date: Wed, 30 Apr 2014 04:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265120 - head/crypto/openssl/ssl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 04:02:37 -0000 Author: delphij Date: Wed Apr 30 04:02:36 2014 New Revision: 265120 URL: http://svnweb.freebsd.org/changeset/base/265120 Log: Fix OpenSSL use-after-free vulnerability. Obtained from: OpenBSD Security: FreeBSD-SA-14:09.openssl Security: CVE-2010-5298 Modified: head/crypto/openssl/ssl/s3_pkt.c Modified: head/crypto/openssl/ssl/s3_pkt.c ============================================================================== --- head/crypto/openssl/ssl/s3_pkt.c Wed Apr 30 04:02:32 2014 (r265119) +++ head/crypto/openssl/ssl/s3_pkt.c Wed Apr 30 04:02:36 2014 (r265120) @@ -1055,7 +1055,7 @@ start: { s->rstate=SSL_ST_READ_HEADER; rr->off=0; - if (s->mode & SSL_MODE_RELEASE_BUFFERS) + if (s->mode & SSL_MODE_RELEASE_BUFFERS && s->s3->rbuf.left == 0) ssl3_release_read_buffer(s); } } From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 04:02:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B91E3954; Wed, 30 Apr 2014 04:02:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6707119E; Wed, 30 Apr 2014 04:02:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3U42vtl013922; Wed, 30 Apr 2014 04:02:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U42vR3013921; Wed, 30 Apr 2014 04:02:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201404300402.s3U42vR3013921@svn.freebsd.org> From: Xin LI Date: Wed, 30 Apr 2014 04:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265121 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 04:02:57 -0000 Author: delphij Date: Wed Apr 30 04:02:57 2014 New Revision: 265121 URL: http://svnweb.freebsd.org/changeset/base/265121 Log: Fix TCP reassembly vulnerability. Patch done by: glebius Security: FreeBSD-SA-14:08.tcp Security: CVE-2014-3000 Modified: head/sys/netinet/tcp_reass.c Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Wed Apr 30 04:02:36 2014 (r265120) +++ head/sys/netinet/tcp_reass.c Wed Apr 30 04:02:57 2014 (r265121) @@ -194,7 +194,7 @@ tcp_reass(struct tcpcb *tp, struct tcphd * Investigate why and re-evaluate the below limit after the behaviour * is understood. */ - if (th->th_seq != tp->rcv_nxt && + if ((th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) && tp->t_segqlen >= (so->so_rcv.sb_hiwat / tp->t_maxseg) + 1) { V_tcp_reass_overflows++; TCPSTAT_INC(tcps_rcvmemdrop); @@ -217,7 +217,7 @@ tcp_reass(struct tcpcb *tp, struct tcphd */ te = uma_zalloc(V_tcp_reass_zone, M_NOWAIT); if (te == NULL) { - if (th->th_seq != tp->rcv_nxt) { + if (th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) { TCPSTAT_INC(tcps_rcvmemdrop); m_freem(m); *tlenp = 0; @@ -265,7 +265,8 @@ tcp_reass(struct tcpcb *tp, struct tcphd TCPSTAT_INC(tcps_rcvduppack); TCPSTAT_ADD(tcps_rcvdupbyte, *tlenp); m_freem(m); - uma_zfree(V_tcp_reass_zone, te); + if (te != &tqs) + uma_zfree(V_tcp_reass_zone, te); tp->t_segqlen--; /* * Try to present any queued data From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 05:41:54 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8078DA8; Wed, 30 Apr 2014 05:41:54 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id B80CA1075; Wed, 30 Apr 2014 05:41:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id CA2A83806E; Wed, 30 Apr 2014 00:41:46 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id 0Ee3WRjr1oZe; Wed, 30 Apr 2014 00:41:46 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 113CF3806C; Wed, 30 Apr 2014 00:41:45 -0500 (CDT) Message-ID: <53608D19.7060309@freebsd.org> Date: Tue, 29 Apr 2014 22:41:45 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Glen Barber , Dmitry Morozovsky Subject: Re: svn commit: r264907 - in head/release: amd64 i386 References: <201404250526.s3P5Q3hS010626@gw.catspoiler.org> <20140425130714.GN49791@glenbarber.us> In-Reply-To: <20140425130714.GN49791@glenbarber.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, Don Lewis , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 05:41:55 -0000 On 04/25/14 06:07, Glen Barber wrote: > On Fri, Apr 25, 2014 at 02:00:13PM +0400, Dmitry Morozovsky wrote: >> seconded, till now the most bootable case for machines under my hands were >> happy with no-partition at all (fake MBR with 50k@s4, dd from UFS) >> > I'm working on restoring the MBR, but need some time to test. If > I can't get a working memstick image with the addition of an EFI > partition for the UEFI boot loader in a few hours, I'll revert this > commit. > > Glen > The amd64 release scripts now include variants that build EFI/BIOS dual mode images. These should be bootable everywhere: stupid BIOSes that see GPT and try to boot with EFI will succeed since there actually is EFI. If you try to boot with BIOS, it will also boot that way. (Thanks to Marcel for mkimg, by the way, which have made the scripts much cleaner) These cannot, however, become the defaults for the time being because GENERIC uses syscons and syscons does not support EFI. Adding EFI loaders to the image means there is an increased likelihood they will be used and failing to give a console afterward is not friendly behavior. The VT kernel configuration works with both. So, to make universally bootable install media, we have to switch the default console driver to newcons. This means we need to finish polishing newcons and need to think about what, exactly, the missing pieces are to enable it as the default. -Nathan From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 05:44:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87F73EFC; Wed, 30 Apr 2014 05:44:17 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 598AE107F; Wed, 30 Apr 2014 05:44:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id B9F6038070; Wed, 30 Apr 2014 00:44:16 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id FsrpI0qkIccd; Wed, 30 Apr 2014 00:44:16 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 347A33806F; Wed, 30 Apr 2014 00:44:16 -0500 (CDT) Message-ID: <53608DAF.7070606@freebsd.org> Date: Tue, 29 Apr 2014 22:44:15 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Marcel Moolenaar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r262957 - in head/etc: etc.arm etc.ia64 etc.mips etc.powerpc etc.sparc64 References: <201403092106.s29L6M3D056313@svn.freebsd.org> In-Reply-To: <201403092106.s29L6M3D056313@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 05:44:17 -0000 On 03/09/14 14:06, Marcel Moolenaar wrote: > Author: marcel > Date: Sun Mar 9 21:06:22 2014 > New Revision: 262957 > URL: http://svnweb.freebsd.org/changeset/base/262957 > > Log: > Change the terminal type/class for enabled serial lines to 3wire. This > allows us to change the uart(4) driver to not hardcode specific line > settings for the serial console. > > A terminal type of 3wire makes sure the console still works when no DCD > signal is present, which preserves behviour. When it is known that the > terminal server (or DCE in general) provides DCD, a terminal type/class > of std can be used. This has the effect of being logged out when one > disconnects from the console -- improving security overall. > > Likewise, when uart(4) does not fixate the baudrate, one can change > the terminal type/class to set a specific baudrate. An operator can use > this to change the console speed mid-flight, without needing a reboot. > Of course it helps in this respect if and when the firmware can be > configured from the OS. > > The above mentioned capabilities depend on uart(4) being changed, which > is to happen next. > Should we set onifconsole for x86 UARTs as well? That enables them if they are the kernel console and is probably a user friendliness improvement. -Nathan From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 06:20:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE1B5BD5; Wed, 30 Apr 2014 06:20:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E8AF1395; Wed, 30 Apr 2014 06:20:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3U6Knst074498; Wed, 30 Apr 2014 06:20:49 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U6Kmn6074492; Wed, 30 Apr 2014 06:20:48 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404300620.s3U6Kmn6074492@svn.freebsd.org> From: Eitan Adler Date: Wed, 30 Apr 2014 06:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265132 - in head: share/man/man4 sys/dev/null X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 06:20:49 -0000 Author: eadler Date: Wed Apr 30 06:20:48 2014 New Revision: 265132 URL: http://svnweb.freebsd.org/changeset/base/265132 Log: Add a /dev/full device. /dev/full is similar to /dev/zero except it always returns ENOSPC when you attempt to write to it. Reviewed by: jhibbits Discussed with: rpaulo Added: head/share/man/man4/full.4 (contents, props changed) Modified: head/share/man/man4/null.4 head/share/man/man4/zero.4 head/sys/dev/null/null.c Added: head/share/man/man4/full.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/full.4 Wed Apr 30 06:20:48 2014 (r265132) @@ -0,0 +1,47 @@ +.\" Copyright (c) 2014 +.\" Eitan Adler . All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 29, 2014 +.Dt FULL 4 +.Os +.Sh NAME +.Nm full +.Nd the full device +.Sh DESCRIPTION +The +.Nm +device supplies an endless stream of zeros when read. +However, it will always be full when writing to it. +.Sh FILES +.Bl -tag -width /dev/full +.It Pa /dev/full +.El +.Sh SEE ALSO +.Xr null 4 +.Xr zero 4 +.Sh Author +This device and man page was written by +.An Eitan Adler Aq eadler@FreeBSD.org . Modified: head/share/man/man4/null.4 ============================================================================== --- head/share/man/man4/null.4 Wed Apr 30 06:03:01 2014 (r265131) +++ head/share/man/man4/null.4 Wed Apr 30 06:20:48 2014 (r265132) @@ -48,6 +48,7 @@ device is always zero. .It Pa /dev/null .El .Sh SEE ALSO +.Xr full 4 .Xr zero 4 .Sh HISTORY A Modified: head/share/man/man4/zero.4 ============================================================================== --- head/share/man/man4/zero.4 Wed Apr 30 06:03:01 2014 (r265131) +++ head/share/man/man4/zero.4 Wed Apr 30 06:20:48 2014 (r265132) @@ -49,6 +49,7 @@ supply of null bytes when read. .It Pa /dev/zero .El .Sh SEE ALSO +.Xr full 4 .Xr null 4 .Sh HISTORY A Modified: head/sys/dev/null/null.c ============================================================================== --- head/sys/dev/null/null.c Wed Apr 30 06:03:01 2014 (r265131) +++ head/sys/dev/null/null.c Wed Apr 30 06:20:48 2014 (r265132) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2000 Mark R. V. Murray & Jeroen C. van Gelderen * Copyright (c) 2001-2004 Mark R. V. Murray + * Copyright (c) 2014 Eitan Adler * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -47,7 +48,9 @@ __FBSDID("$FreeBSD$"); /* For use with destroy_dev(9). */ static struct cdev *null_dev; static struct cdev *zero_dev; +static struct cdev *full_dev; +static d_write_t full_write; static d_write_t null_write; static d_ioctl_t null_ioctl; static d_ioctl_t zero_ioctl; @@ -70,6 +73,23 @@ static struct cdevsw zero_cdevsw = { .d_flags = D_MMAP_ANON, }; +static struct cdevsw full_cdevsw = { + .d_version = D_VERSION, + .d_read = zero_read, + .d_write = full_write, + .d_ioctl = zero_ioctl, + .d_name = "full", +}; + + +/* ARGSUSED */ +static int +full_write(struct cdev *dev __unused, struct uio *uio, int flags __unused) +{ + + return (ENOSPC); +} + /* ARGSUSED */ static int null_write(struct cdev *dev __unused, struct uio *uio, int flags __unused) @@ -155,7 +175,9 @@ null_modevent(module_t mod __unused, int switch(type) { case MOD_LOAD: if (bootverbose) - printf("null: \n"); + printf("null: \n"); + full_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &full_cdevsw, 0, + NULL, UID_ROOT, GID_WHEEL, 0666, "full"); null_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &null_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0666, "null"); zero_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &zero_cdevsw, 0, @@ -163,6 +185,7 @@ null_modevent(module_t mod __unused, int break; case MOD_UNLOAD: + destroy_dev(full_dev); destroy_dev(null_dev); destroy_dev(zero_dev); break; From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 06:30:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE7ADF2E; Wed, 30 Apr 2014 06:30:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B7A714E2; Wed, 30 Apr 2014 06:30:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3U6UbQ2078259; Wed, 30 Apr 2014 06:30:37 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U6UbTB078258; Wed, 30 Apr 2014 06:30:37 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404300630.s3U6UbTB078258@svn.freebsd.org> From: Eitan Adler Date: Wed, 30 Apr 2014 06:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265134 - head/sys/dev/null X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 06:30:37 -0000 Author: eadler Date: Wed Apr 30 06:30:37 2014 New Revision: 265134 URL: http://svnweb.freebsd.org/changeset/base/265134 Log: null.c: fix ordering Use a consistent ordering of full -> null -> zero (alphabetical) in null.c Reported by: mjg Modified: head/sys/dev/null/null.c Modified: head/sys/dev/null/null.c ============================================================================== --- head/sys/dev/null/null.c Wed Apr 30 06:27:23 2014 (r265133) +++ head/sys/dev/null/null.c Wed Apr 30 06:30:37 2014 (r265134) @@ -46,9 +46,9 @@ __FBSDID("$FreeBSD$"); #include /* For use with destroy_dev(9). */ +static struct cdev *full_dev; static struct cdev *null_dev; static struct cdev *zero_dev; -static struct cdev *full_dev; static d_write_t full_write; static d_write_t null_write; @@ -56,6 +56,14 @@ static d_ioctl_t null_ioctl; static d_ioctl_t zero_ioctl; static d_read_t zero_read; +static struct cdevsw full_cdevsw = { + .d_version = D_VERSION, + .d_read = zero_read, + .d_write = full_write, + .d_ioctl = zero_ioctl, + .d_name = "full", +}; + static struct cdevsw null_cdevsw = { .d_version = D_VERSION, .d_read = (d_read_t *)nullop, @@ -73,13 +81,6 @@ static struct cdevsw zero_cdevsw = { .d_flags = D_MMAP_ANON, }; -static struct cdevsw full_cdevsw = { - .d_version = D_VERSION, - .d_read = zero_read, - .d_write = full_write, - .d_ioctl = zero_ioctl, - .d_name = "full", -}; /* ARGSUSED */ From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 06:34:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B713153; Wed, 30 Apr 2014 06:34:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0860A1507; Wed, 30 Apr 2014 06:34:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3U6Yrd0080266; Wed, 30 Apr 2014 06:34:53 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U6Yr8J080264; Wed, 30 Apr 2014 06:34:53 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404300634.s3U6Yr8J080264@svn.freebsd.org> From: Eitan Adler Date: Wed, 30 Apr 2014 06:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265135 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 06:34:54 -0000 Author: eadler Date: Wed Apr 30 06:34:53 2014 New Revision: 265135 URL: http://svnweb.freebsd.org/changeset/base/265135 Log: man pages: add missing comma Reported by: brueffer Modified: head/share/man/man4/null.4 head/share/man/man4/zero.4 Modified: head/share/man/man4/null.4 ============================================================================== --- head/share/man/man4/null.4 Wed Apr 30 06:30:37 2014 (r265134) +++ head/share/man/man4/null.4 Wed Apr 30 06:34:53 2014 (r265135) @@ -48,7 +48,7 @@ device is always zero. .It Pa /dev/null .El .Sh SEE ALSO -.Xr full 4 +.Xr full 4 , .Xr zero 4 .Sh HISTORY A Modified: head/share/man/man4/zero.4 ============================================================================== --- head/share/man/man4/zero.4 Wed Apr 30 06:30:37 2014 (r265134) +++ head/share/man/man4/zero.4 Wed Apr 30 06:34:53 2014 (r265135) @@ -49,7 +49,7 @@ supply of null bytes when read. .It Pa /dev/zero .El .Sh SEE ALSO -.Xr full 4 +.Xr full 4 , .Xr null 4 .Sh HISTORY A From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 06:40:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 107B035D; Wed, 30 Apr 2014 06:40:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F19AD1586; Wed, 30 Apr 2014 06:40:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3U6eUnL082535; Wed, 30 Apr 2014 06:40:30 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U6eUE6082501; Wed, 30 Apr 2014 06:40:30 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404300640.s3U6eUE6082501@svn.freebsd.org> From: Eitan Adler Date: Wed, 30 Apr 2014 06:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265136 - head/sys/dev/null X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 06:40:31 -0000 Author: eadler Date: Wed Apr 30 06:40:30 2014 New Revision: 265136 URL: http://svnweb.freebsd.org/changeset/base/265136 Log: null.c: uio is unused Mark another parameter as unused Reported by: rpaulo Modified: head/sys/dev/null/null.c Modified: head/sys/dev/null/null.c ============================================================================== --- head/sys/dev/null/null.c Wed Apr 30 06:34:53 2014 (r265135) +++ head/sys/dev/null/null.c Wed Apr 30 06:40:30 2014 (r265136) @@ -85,7 +85,7 @@ static struct cdevsw zero_cdevsw = { /* ARGSUSED */ static int -full_write(struct cdev *dev __unused, struct uio *uio, int flags __unused) +full_write(struct cdev *dev __unused, struct uio *uio __unused, int flags __unused) { return (ENOSPC); From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 06:54:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C05574B; Wed, 30 Apr 2014 06:54:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 586FE16EE; Wed, 30 Apr 2014 06:54:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3U6saQv088330; Wed, 30 Apr 2014 06:54:36 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U6sa0s088329; Wed, 30 Apr 2014 06:54:36 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201404300654.s3U6sa0s088329@svn.freebsd.org> From: Eitan Adler Date: Wed, 30 Apr 2014 06:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265137 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 06:54:36 -0000 Author: eadler Date: Wed Apr 30 06:54:35 2014 New Revision: 265137 URL: http://svnweb.freebsd.org/changeset/base/265137 Log: Add missing comma Relnotes: yes (/dev/full) Modified: head/share/man/man4/full.4 Modified: head/share/man/man4/full.4 ============================================================================== --- head/share/man/man4/full.4 Wed Apr 30 06:40:30 2014 (r265136) +++ head/share/man/man4/full.4 Wed Apr 30 06:54:35 2014 (r265137) @@ -40,7 +40,7 @@ However, it will always be full when wri .It Pa /dev/full .El .Sh SEE ALSO -.Xr null 4 +.Xr null 4 , .Xr zero 4 .Sh Author This device and man page was written by From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 07:17:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2755C62; Wed, 30 Apr 2014 07:17:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F2C918D6; Wed, 30 Apr 2014 07:17:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3U7HpCv096942; Wed, 30 Apr 2014 07:17:51 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U7HpOk096941; Wed, 30 Apr 2014 07:17:51 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201404300717.s3U7HpOk096941@svn.freebsd.org> From: Kevin Lo Date: Wed, 30 Apr 2014 07:17:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265139 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 07:17:51 -0000 Author: kevlo Date: Wed Apr 30 07:17:51 2014 New Revision: 265139 URL: http://svnweb.freebsd.org/changeset/base/265139 Log: Change type from int to short to match function prototypes. Reviewed by: glebius Modified: head/share/man/man9/mbuf.9 Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Wed Apr 30 07:09:16 2014 (r265138) +++ head/share/man/man9/mbuf.9 Wed Apr 30 07:17:51 2014 (r265139) @@ -64,23 +64,23 @@ .Fn M_TRAILINGSPACE "struct mbuf *mbuf" .Fn M_MOVE_PKTHDR "struct mbuf *to" "struct mbuf *from" .Fn M_PREPEND "struct mbuf *mbuf" "int len" "int how" -.Fn MCHTYPE "struct mbuf *mbuf" "u_int type" +.Fn MCHTYPE "struct mbuf *mbuf" "short type" .Ft int .Fn M_WRITABLE "struct mbuf *mbuf" .\" .Ss Mbuf allocation functions .Ft struct mbuf * -.Fn m_get "int how" "int type" +.Fn m_get "int how" "short type" .Ft struct mbuf * -.Fn m_getm "struct mbuf *orig" "int len" "int how" "int type" +.Fn m_getm "struct mbuf *orig" "int len" "int how" "short type" .Ft struct mbuf * .Fn m_getjcl "int how" "short type" "int flags" "int size" .Ft struct mbuf * .Fn m_getcl "int how" "short type" "int flags" .Ft struct mbuf * -.Fn m_getclr "int how" "int type" +.Fn m_getclr "int how" "short type" .Ft struct mbuf * -.Fn m_gethdr "int how" "int type" +.Fn m_gethdr "int how" "short type" .Ft struct mbuf * .Fn m_free "struct mbuf *mbuf" .Ft void From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 08:51:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 192FCE00; Wed, 30 Apr 2014 08:51:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06863138B; Wed, 30 Apr 2014 08:51:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3U8pUIv035012; Wed, 30 Apr 2014 08:51:30 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U8pU9M035010; Wed, 30 Apr 2014 08:51:30 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201404300851.s3U8pU9M035010@svn.freebsd.org> From: Kevin Lo Date: Wed, 30 Apr 2014 08:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265140 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 08:51:31 -0000 Author: kevlo Date: Wed Apr 30 08:51:30 2014 New Revision: 265140 URL: http://svnweb.freebsd.org/changeset/base/265140 Log: Document m_get2(). Reviewed by: glebius Modified: head/share/man/man9/Makefile head/share/man/man9/mbuf.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Wed Apr 30 07:17:51 2014 (r265139) +++ head/share/man/man9/Makefile Wed Apr 30 08:51:30 2014 (r265140) @@ -902,6 +902,7 @@ MLINKS+=\ mbuf.9 m_freem.9 \ mbuf.9 MGET.9 \ mbuf.9 m_get.9 \ + mbuf.9 m_get2.9 \ mbuf.9 m_getjcl.9 \ mbuf.9 m_getcl.9 \ mbuf.9 m_getclr.9 \ Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Wed Apr 30 07:17:51 2014 (r265139) +++ head/share/man/man9/mbuf.9 Wed Apr 30 08:51:30 2014 (r265140) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2014 +.Dd April 30, 2014 .Dt MBUF 9 .Os .\" @@ -72,6 +72,8 @@ .Ft struct mbuf * .Fn m_get "int how" "short type" .Ft struct mbuf * +.Fn m_get2 "int size" "int how" "short type" "int flags" +.Ft struct mbuf * .Fn m_getm "struct mbuf *orig" "int len" "int how" "short type" .Ft struct mbuf * .Fn m_getjcl "int how" "short type" "int flags" "int size" @@ -528,6 +530,10 @@ The functions are: A function version of .Fn MGET for non-critical paths. +.It Fn m_get2 size how type flags +Allocate an +.Vt mbuf +with enough space to hold specified amount of data. .It Fn m_getm orig len how type Allocate .Fa len From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 09:58:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BB13343; Wed, 30 Apr 2014 09:58:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 789C919DA; Wed, 30 Apr 2014 09:58:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3U9wTu3062779; Wed, 30 Apr 2014 09:58:29 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3U9wTkB062778; Wed, 30 Apr 2014 09:58:29 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201404300958.s3U9wTkB062778@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 30 Apr 2014 09:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265145 - head/lib/libcapsicum X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 09:58:29 -0000 Author: pjd Date: Wed Apr 30 09:58:28 2014 New Revision: 265145 URL: http://svnweb.freebsd.org/changeset/base/265145 Log: Don't forget to remember previous element at the end of the loop. Reported by: brueffer Found with: Coverity Prevent(tm) CID: 1135301 Modified: head/lib/libcapsicum/libcapsicum_dns.c Modified: head/lib/libcapsicum/libcapsicum_dns.c ============================================================================== --- head/lib/libcapsicum/libcapsicum_dns.c Wed Apr 30 09:57:38 2014 (r265144) +++ head/lib/libcapsicum/libcapsicum_dns.c Wed Apr 30 09:58:28 2014 (r265145) @@ -247,6 +247,7 @@ cap_getaddrinfo(cap_channel_t *chan, con prevai->ai_next = curai; else if (firstai == NULL) firstai = curai; + prevai = curai; } nvlist_destroy(nvl); if (curai == NULL && nvlai != NULL) { From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 13:36:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A025374; Wed, 30 Apr 2014 13:36:06 +0000 (UTC) Received: from mail-qa0-x22c.google.com (mail-qa0-x22c.google.com [IPv6:2607:f8b0:400d:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7956412C2; Wed, 30 Apr 2014 13:36:05 +0000 (UTC) Received: by mail-qa0-f44.google.com with SMTP id k15so1666920qaq.31 for ; Wed, 30 Apr 2014 06:36:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=DVVBd11xch9YgfyZaOa03wXvEzSKa6UD1mQ7eY1644I=; b=ZK3KjoryFeyLIWb1SfFbj+qXxJWpP5xjtZMoQbbfLvYrzpyHE0zVnbhNbnZrFpUhnH mSL+5jJLZRf4czIKVn33X2Yzusf0grl0Vr0AZIg1A0pMOlPs5Tcb/0d/iCu5obIxIeeL kFu7W+4TpJBh+xF/wjMrmBnzDvM3bdnyE+dl07l2KF4ALufl8Vb4Bzlqd46390poLZGX CCPcOW/L7CSrjsvclQ+zewdk69yn6mcAMqbW3bMGHhZPcWKYkAKYwTgbxfu8aF9c8Nb4 M1hzYfB28+HCnBP0EznQZHDpFnrqfHt4yEnTMAp3TuH0ULvbVt7ZyFHB9VkiZQZsFxQK +3WA== MIME-Version: 1.0 X-Received: by 10.140.101.201 with SMTP id u67mr4779931qge.107.1398864964457; Wed, 30 Apr 2014 06:36:04 -0700 (PDT) Sender: carpeddiem@gmail.com Received: by 10.140.49.239 with HTTP; Wed, 30 Apr 2014 06:36:04 -0700 (PDT) In-Reply-To: <53608D19.7060309@freebsd.org> References: <201404250526.s3P5Q3hS010626@gw.catspoiler.org> <20140425130714.GN49791@glenbarber.us> <53608D19.7060309@freebsd.org> Date: Wed, 30 Apr 2014 09:36:04 -0400 X-Google-Sender-Auth: TxRsFeLSc_QwdNeV1uSaNfa_FFM Message-ID: Subject: Re: svn commit: r264907 - in head/release: amd64 i386 From: Ed Maste To: Nathan Whitehorn Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Aleksandr Rybalko X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 13:36:06 -0000 On 30 April 2014 01:41, Nathan Whitehorn wrote: > > So, to make universally bootable install media, we have to switch the > default console driver to newcons. This means we need to finish polishing > newcons and need to think about what, exactly, the missing pieces are to > enable it as the default. There's a Newcons wiki page at https://wiki.freebsd.org/Newcons with some details, but I believe the main points are: 1. Documentation. We currently have no vt(4) man page so one needs to be written, and other pages likely need to be updated. Other documentation (like the handbook) need to be investigated. 2. Control tools (e.g. kbdmap(1), vidcontrol(1), vidfont(1)) need to be updated. Alexandr posted a patch for vidcontrol with the subject "RFT vidcontrol for vt(4)" 3. Provide console fonts for vt, equivalent to /usr/share/syscons/fonts. 4. Address some performance issues, especially on certain non-x86 and low-end hardware, and in virtual machines. 5. Address boot console priority. From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 14:38:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1EFD886E; Wed, 30 Apr 2014 14:38:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F37481968; Wed, 30 Apr 2014 14:38:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3UEcDIF076884; Wed, 30 Apr 2014 14:38:13 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3UEcDgP076881; Wed, 30 Apr 2014 14:38:13 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201404301438.s3UEcDgP076881@svn.freebsd.org> From: Ian Lepore Date: Wed, 30 Apr 2014 14:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265148 - head/sys/arm/xilinx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 14:38:14 -0000 Author: ian Date: Wed Apr 30 14:38:13 2014 New Revision: 265148 URL: http://svnweb.freebsd.org/changeset/base/265148 Log: Convert the Zynq SoC support to the new routines for static device mapping. Modified: head/sys/arm/xilinx/zy7_machdep.c head/sys/arm/xilinx/zy7_reg.h Modified: head/sys/arm/xilinx/zy7_machdep.c ============================================================================== --- head/sys/arm/xilinx/zy7_machdep.c Wed Apr 30 14:09:26 2014 (r265147) +++ head/sys/arm/xilinx/zy7_machdep.c Wed Apr 30 14:38:13 2014 (r265148) @@ -60,7 +60,7 @@ vm_offset_t initarm_lastaddr(void) { - return (ZYNQ7_PSIO_VBASE); + return (arm_devmap_lastaddr()); } void @@ -79,39 +79,18 @@ initarm_late_init(void) { } -#define FDT_DEVMAP_SIZE 3 -static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_SIZE]; - /* - * Construct pmap_devmap[] with DT-derived config data. + * Set up static device mappings. Not strictly necessary -- simplebus will + * dynamically establish mappings as needed -- but doing it this way gets us + * nice efficient 1MB section mappings. */ int initarm_devmap_init(void) { - int i = 0; - fdt_devmap[i].pd_va = ZYNQ7_PSIO_VBASE; - fdt_devmap[i].pd_pa = ZYNQ7_PSIO_HWBASE; - fdt_devmap[i].pd_size = ZYNQ7_PSIO_SIZE; - fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[i].pd_cache = PTE_DEVICE; - i++; - - fdt_devmap[i].pd_va = ZYNQ7_PSCTL_VBASE; - fdt_devmap[i].pd_pa = ZYNQ7_PSCTL_HWBASE; - fdt_devmap[i].pd_size = ZYNQ7_PSCTL_SIZE; - fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[i].pd_cache = PTE_DEVICE; - i++; - - /* end of table */ - fdt_devmap[i].pd_va = 0; - fdt_devmap[i].pd_pa = 0; - fdt_devmap[i].pd_size = 0; - fdt_devmap[i].pd_prot = 0; - fdt_devmap[i].pd_cache = 0; + arm_devmap_add_entry(ZYNQ7_PSIO_HWBASE, ZYNQ7_PSIO_SIZE); + arm_devmap_add_entry(ZYNQ7_PSCTL_HWBASE, ZYNQ7_PSCTL_SIZE); - arm_devmap_register_table(&fdt_devmap[0]); return (0); } Modified: head/sys/arm/xilinx/zy7_reg.h ============================================================================== --- head/sys/arm/xilinx/zy7_reg.h Wed Apr 30 14:09:26 2014 (r265147) +++ head/sys/arm/xilinx/zy7_reg.h Wed Apr 30 14:38:13 2014 (r265148) @@ -44,16 +44,13 @@ #define ZYNQ7_PLGP1_SIZE 0x40000000 /* I/O Peripheral registers. */ -#define ZYNQ7_PSIO_VBASE 0xE0000000 #define ZYNQ7_PSIO_HWBASE 0xE0000000 #define ZYNQ7_PSIO_SIZE 0x00300000 /* UART0 and UART1 */ -#define ZYNQ7_UART0_VBASE (ZYNQ7_PSIO_VBASE) #define ZYNQ7_UART0_HWBASE (ZYNQ7_PSIO_HWBASE) #define ZYNQ7_UART0_SIZE 0x1000 -#define ZYNQ7_UART1_VBASE (ZYNQ7_PSIO_VBASE+0x1000) #define ZYNQ7_UART1_HWBASE (ZYNQ7_PSIO_HWBASE+0x1000) #define ZYNQ7_UART1_SIZE 0x1000 @@ -63,15 +60,12 @@ #define ZYNQ7_SMC_SIZE 0x05000000 /* SLCR, PS system, and CPU private registers combined in this region. */ -#define ZYNQ7_PSCTL_VBASE 0xF8000000 #define ZYNQ7_PSCTL_HWBASE 0xF8000000 #define ZYNQ7_PSCTL_SIZE 0x01000000 -#define ZYNQ7_SLCR_VBASE (ZYNQ7_PSCTL_VBASE) #define ZYNQ7_SLCR_HWBASE (ZYNQ7_PSCTL_HWBASE) #define ZYNQ7_SLCR_SIZE 0x1000 -#define ZYNQ7_DEVCFG_VBASE (ZYNQ7_PSCTL_VBASE+0x7000) #define ZYNQ7_DEVCFG_HWBASE (ZYNQ7_PSCTL_HWBASE+0x7000) #define ZYNQ7_DEVCFG_SIZE 0x1000 From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 14:48:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66DB0BB4; Wed, 30 Apr 2014 14:48:30 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 331671A5E; Wed, 30 Apr 2014 14:48:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 0829738060; Wed, 30 Apr 2014 09:48:29 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id RV1i79viQRgP; Wed, 30 Apr 2014 09:48:28 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 57FF83805B; Wed, 30 Apr 2014 09:48:28 -0500 (CDT) Message-ID: <53610D3B.40401@freebsd.org> Date: Wed, 30 Apr 2014 07:48:27 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Ed Maste Subject: Re: svn commit: r264907 - in head/release: amd64 i386 References: <201404250526.s3P5Q3hS010626@gw.catspoiler.org> <20140425130714.GN49791@glenbarber.us> <53608D19.7060309@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Aleksandr Rybalko X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 14:48:30 -0000 On 04/30/14 06:36, Ed Maste wrote: > On 30 April 2014 01:41, Nathan Whitehorn wrote: >> So, to make universally bootable install media, we have to switch the >> default console driver to newcons. This means we need to finish polishing >> newcons and need to think about what, exactly, the missing pieces are to >> enable it as the default. > There's a Newcons wiki page at https://wiki.freebsd.org/Newcons with > some details, but I believe the main points are: > > 1. Documentation. We currently have no vt(4) man page so one needs to > be written, and other pages likely need to be updated. Other > documentation (like the handbook) need to be investigated. > 2. Control tools (e.g. kbdmap(1), vidcontrol(1), vidfont(1)) need to > be updated. Alexandr posted a patch for vidcontrol with the subject > "RFT vidcontrol for vt(4)" > 3. Provide console fonts for vt, equivalent to /usr/share/syscons/fonts. > 4. Address some performance issues, especially on certain non-x86 and > low-end hardware, and in virtual machines. > 5. Address boot console priority. > Which of these are blockers before turning it on in GENERIC for wider testing? Point #1 is a must, I think. #2 seems potentially destructive: do we want to have to make them work with both syscons and vt? #5 we've worked around for the time being. #4 would be nice, but maybe wider testing helps with it. It's painfully slow on regular x86 hardware as well -- my brand-new Lenovo laptop for instance. But I think we could switch GENERIC on -CURRENT over only after writing some documentation. -Nathan From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 14:48:43 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 426C0CEB; Wed, 30 Apr 2014 14:48:43 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14B721A5F; Wed, 30 Apr 2014 14:48:42 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WfVoP-0005Vx-Va; Wed, 30 Apr 2014 14:48:42 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s3UEmd72017676; Wed, 30 Apr 2014 08:48:39 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18Wb39Dyk5RKfpiPAwJIRO8 Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null From: Ian Lepore To: Eitan Adler In-Reply-To: <201404300620.s3U6Kmn6074492@svn.freebsd.org> References: <201404300620.s3U6Kmn6074492@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Wed, 30 Apr 2014 08:48:39 -0600 Message-ID: <1398869319.22079.54.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 14:48:43 -0000 On Wed, 2014-04-30 at 06:20 +0000, Eitan Adler wrote: > Author: eadler > Date: Wed Apr 30 06:20:48 2014 > New Revision: 265132 > URL: http://svnweb.freebsd.org/changeset/base/265132 > > Log: > Add a /dev/full device. > > /dev/full is similar to /dev/zero except it always returns > ENOSPC when you attempt to write to it. > For some reason this reminded me of something I've been wanting for a while but never get around to writing... /dev/ones, it's just like /dev/zero except it returns 0xff bytes. Useful for dd'ing to wipe out flash-based media. -- Ian From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 16:02:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B15E4C4C; Wed, 30 Apr 2014 16:02:23 +0000 (UTC) Received: from mail-qc0-x22d.google.com (mail-qc0-x22d.google.com [IPv6:2607:f8b0:400d:c01::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D321133A; Wed, 30 Apr 2014 16:02:23 +0000 (UTC) Received: by mail-qc0-f173.google.com with SMTP id r5so2081778qcx.18 for ; Wed, 30 Apr 2014 09:02:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ks4kkc5WprQaZ5yxgZxvhTaI99aL/obGH3GeK7KbT2U=; b=RAQ1jdsy/q7/Gwv7McmoJEltLaQHd3J62JGU4Pb8stAIZ+/rcyoFwwjG/G1YCqMayn wX04YNEw86ZM6fk+kirGbFOESw32FFitRDuV3pk3wo1+F1DbUmAf3Bbtx9TdoU0awKOp xaehL0TnFAEAALRhq0vsatwDZPj6FIuFWNLTxIwWhMt/S8WJccEweoLQm867qIJllUeb zGqejJtZ7kGunIPQDeDx0jU1IWDBA4Mgnh3FfxOGJNrGnRD8AQamEViP02dnGDz0xspf dCGL3mMH8ms+c4JurI7apbmG0CwnKrMCdiqQyk8C2cBBD2VCfNGee3KXhC12duXpcFxI /rFQ== MIME-Version: 1.0 X-Received: by 10.229.136.135 with SMTP id r7mr6563291qct.17.1398873742328; Wed, 30 Apr 2014 09:02:22 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.229.170.195 with HTTP; Wed, 30 Apr 2014 09:02:22 -0700 (PDT) In-Reply-To: <1398869319.22079.54.camel@revolution.hippie.lan> References: <201404300620.s3U6Kmn6074492@svn.freebsd.org> <1398869319.22079.54.camel@revolution.hippie.lan> Date: Wed, 30 Apr 2014 09:02:22 -0700 X-Google-Sender-Auth: I4F_bSavI19fiox7Dkp6pWnxsYg Message-ID: Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null From: Matthew Fleming To: Ian Lepore Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Eitan Adler X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 16:02:23 -0000 On Wed, Apr 30, 2014 at 7:48 AM, Ian Lepore wrote: > On Wed, 2014-04-30 at 06:20 +0000, Eitan Adler wrote: >> Author: eadler >> Date: Wed Apr 30 06:20:48 2014 >> New Revision: 265132 >> URL: http://svnweb.freebsd.org/changeset/base/265132 >> >> Log: >> Add a /dev/full device. >> >> /dev/full is similar to /dev/zero except it always returns >> ENOSPC when you attempt to write to it. >> > > For some reason this reminded me of something I've been wanting for a > while but never get around to writing... /dev/ones, it's just > like /dev/zero except it returns 0xff bytes. Useful for dd'ing to wipe > out flash-based media. dd if=/dev/zero | tr "\000" "\377" | dd of= But it's not quite the same. Cheers, matthew From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 16:23:06 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 532D3372; Wed, 30 Apr 2014 16:23:06 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id E8B3E157C; Wed, 30 Apr 2014 16:23:05 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id 5291420E7088B; Wed, 30 Apr 2014 16:23:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,HELO_NO_DOMAIN,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTPS id D86DB20E70885; Wed, 30 Apr 2014 16:22:58 +0000 (UTC) Message-ID: From: "Steven Hartland" To: "Ian Lepore" , "Eitan Adler" References: <201404300620.s3U6Kmn6074492@svn.freebsd.org> <1398869319.22079.54.camel@revolution.hippie.lan> Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null Date: Wed, 30 Apr 2014 17:22:59 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 16:23:06 -0000 ----- Original Message ----- From: "Ian Lepore" To: "Eitan Adler" Cc: ; ; Sent: Wednesday, April 30, 2014 3:48 PM Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null > On Wed, 2014-04-30 at 06:20 +0000, Eitan Adler wrote: >> Author: eadler >> Date: Wed Apr 30 06:20:48 2014 >> New Revision: 265132 >> URL: http://svnweb.freebsd.org/changeset/base/265132 >> >> Log: >> Add a /dev/full device. >> >> /dev/full is similar to /dev/zero except it always returns >> ENOSPC when you attempt to write to it. >> > > For some reason this reminded me of something I've been wanting for a > while but never get around to writing... /dev/ones, it's just > like /dev/zero except it returns 0xff bytes. Useful for dd'ing to wipe > out flash-based media. Surely for that you want camcontrol security ...? Regards Steve From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 16:25:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10483504; Wed, 30 Apr 2014 16:25:39 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D49F515AD; Wed, 30 Apr 2014 16:25:38 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7F140B939; Wed, 30 Apr 2014 12:25:36 -0400 (EDT) From: John Baldwin To: Nathan Whitehorn Subject: Re: svn commit: r264907 - in head/release: amd64 i386 Date: Wed, 30 Apr 2014 11:20:25 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201404250526.s3P5Q3hS010626@gw.catspoiler.org> <53610D3B.40401@freebsd.org> In-Reply-To: <53610D3B.40401@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201404301120.25568.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 30 Apr 2014 12:25:36 -0400 (EDT) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ed Maste , Aleksandr Rybalko X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 16:25:39 -0000 On Wednesday, April 30, 2014 10:48:27 am Nathan Whitehorn wrote: > On 04/30/14 06:36, Ed Maste wrote: > > On 30 April 2014 01:41, Nathan Whitehorn wrote: > >> So, to make universally bootable install media, we have to switch the > >> default console driver to newcons. This means we need to finish polishing > >> newcons and need to think about what, exactly, the missing pieces are to > >> enable it as the default. > > There's a Newcons wiki page at https://wiki.freebsd.org/Newcons with > > some details, but I believe the main points are: > > > > 1. Documentation. We currently have no vt(4) man page so one needs to > > be written, and other pages likely need to be updated. Other > > documentation (like the handbook) need to be investigated. > > 2. Control tools (e.g. kbdmap(1), vidcontrol(1), vidfont(1)) need to > > be updated. Alexandr posted a patch for vidcontrol with the subject > > "RFT vidcontrol for vt(4)" > > 3. Provide console fonts for vt, equivalent to /usr/share/syscons/fonts. > > 4. Address some performance issues, especially on certain non-x86 and > > low-end hardware, and in virtual machines. > > 5. Address boot console priority. > > > > Which of these are blockers before turning it on in GENERIC for wider > testing? Point #1 is a must, I think. #2 seems potentially destructive: > do we want to have to make them work with both syscons and vt? #5 we've > worked around for the time being. #4 would be nice, but maybe wider > testing helps with it. It's painfully slow on regular x86 hardware as > well -- my brand-new Lenovo laptop for instance. But I think we could > switch GENERIC on -CURRENT over only after writing some documentation. > -Nathan I would prefer having a boot time knob to switch between vt or sc and being able to include both in the kernel. The boot time knob could default to vt when booting from EFI. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 16:42:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DEF5902; Wed, 30 Apr 2014 16:42:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E32C175B; Wed, 30 Apr 2014 16:42:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3UGgDwx030005; Wed, 30 Apr 2014 16:42:13 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3UGgD9I030004; Wed, 30 Apr 2014 16:42:13 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201404301642.s3UGgD9I030004@svn.freebsd.org> From: Steven Hartland Date: Wed, 30 Apr 2014 16:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265149 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 16:42:13 -0000 Author: smh Date: Wed Apr 30 16:42:12 2014 New Revision: 265149 URL: http://svnweb.freebsd.org/changeset/base/265149 Log: Make uninteresting PCI devices with no attached drivers only print out on a verbose boot MFC after: 2 weeks Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Apr 30 14:38:13 2014 (r265148) +++ head/sys/dev/pci/pci.c Wed Apr 30 16:42:12 2014 (r265149) @@ -3968,105 +3968,107 @@ static const struct { int class; int subclass; + int report; /* 0 = bootverbose, 1 = always */ const char *desc; } pci_nomatch_tab[] = { - {PCIC_OLD, -1, "old"}, - {PCIC_OLD, PCIS_OLD_NONVGA, "non-VGA display device"}, - {PCIC_OLD, PCIS_OLD_VGA, "VGA-compatible display device"}, - {PCIC_STORAGE, -1, "mass storage"}, - {PCIC_STORAGE, PCIS_STORAGE_SCSI, "SCSI"}, - {PCIC_STORAGE, PCIS_STORAGE_IDE, "ATA"}, - {PCIC_STORAGE, PCIS_STORAGE_FLOPPY, "floppy disk"}, - {PCIC_STORAGE, PCIS_STORAGE_IPI, "IPI"}, - {PCIC_STORAGE, PCIS_STORAGE_RAID, "RAID"}, - {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, "ATA (ADMA)"}, - {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"}, - {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"}, - {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM"}, - {PCIC_NETWORK, -1, "network"}, - {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"}, - {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"}, - {PCIC_NETWORK, PCIS_NETWORK_FDDI, "fddi"}, - {PCIC_NETWORK, PCIS_NETWORK_ATM, "ATM"}, - {PCIC_NETWORK, PCIS_NETWORK_ISDN, "ISDN"}, - {PCIC_DISPLAY, -1, "display"}, - {PCIC_DISPLAY, PCIS_DISPLAY_VGA, "VGA"}, - {PCIC_DISPLAY, PCIS_DISPLAY_XGA, "XGA"}, - {PCIC_DISPLAY, PCIS_DISPLAY_3D, "3D"}, - {PCIC_MULTIMEDIA, -1, "multimedia"}, - {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_VIDEO, "video"}, - {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_AUDIO, "audio"}, - {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_TELE, "telephony"}, - {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_HDA, "HDA"}, - {PCIC_MEMORY, -1, "memory"}, - {PCIC_MEMORY, PCIS_MEMORY_RAM, "RAM"}, - {PCIC_MEMORY, PCIS_MEMORY_FLASH, "flash"}, - {PCIC_BRIDGE, -1, "bridge"}, - {PCIC_BRIDGE, PCIS_BRIDGE_HOST, "HOST-PCI"}, - {PCIC_BRIDGE, PCIS_BRIDGE_ISA, "PCI-ISA"}, - {PCIC_BRIDGE, PCIS_BRIDGE_EISA, "PCI-EISA"}, - {PCIC_BRIDGE, PCIS_BRIDGE_MCA, "PCI-MCA"}, - {PCIC_BRIDGE, PCIS_BRIDGE_PCI, "PCI-PCI"}, - {PCIC_BRIDGE, PCIS_BRIDGE_PCMCIA, "PCI-PCMCIA"}, - {PCIC_BRIDGE, PCIS_BRIDGE_NUBUS, "PCI-NuBus"}, - {PCIC_BRIDGE, PCIS_BRIDGE_CARDBUS, "PCI-CardBus"}, - {PCIC_BRIDGE, PCIS_BRIDGE_RACEWAY, "PCI-RACEway"}, - {PCIC_SIMPLECOMM, -1, "simple comms"}, - {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_UART, "UART"}, /* could detect 16550 */ - {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_PAR, "parallel port"}, - {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_MULSER, "multiport serial"}, - {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_MODEM, "generic modem"}, - {PCIC_BASEPERIPH, -1, "base peripheral"}, - {PCIC_BASEPERIPH, PCIS_BASEPERIPH_PIC, "interrupt controller"}, - {PCIC_BASEPERIPH, PCIS_BASEPERIPH_DMA, "DMA controller"}, - {PCIC_BASEPERIPH, PCIS_BASEPERIPH_TIMER, "timer"}, - {PCIC_BASEPERIPH, PCIS_BASEPERIPH_RTC, "realtime clock"}, - {PCIC_BASEPERIPH, PCIS_BASEPERIPH_PCIHOT, "PCI hot-plug controller"}, - {PCIC_BASEPERIPH, PCIS_BASEPERIPH_SDHC, "SD host controller"}, - {PCIC_INPUTDEV, -1, "input device"}, - {PCIC_INPUTDEV, PCIS_INPUTDEV_KEYBOARD, "keyboard"}, - {PCIC_INPUTDEV, PCIS_INPUTDEV_DIGITIZER,"digitizer"}, - {PCIC_INPUTDEV, PCIS_INPUTDEV_MOUSE, "mouse"}, - {PCIC_INPUTDEV, PCIS_INPUTDEV_SCANNER, "scanner"}, - {PCIC_INPUTDEV, PCIS_INPUTDEV_GAMEPORT, "gameport"}, - {PCIC_DOCKING, -1, "docking station"}, - {PCIC_PROCESSOR, -1, "processor"}, - {PCIC_SERIALBUS, -1, "serial bus"}, - {PCIC_SERIALBUS, PCIS_SERIALBUS_FW, "FireWire"}, - {PCIC_SERIALBUS, PCIS_SERIALBUS_ACCESS, "AccessBus"}, - {PCIC_SERIALBUS, PCIS_SERIALBUS_SSA, "SSA"}, - {PCIC_SERIALBUS, PCIS_SERIALBUS_USB, "USB"}, - {PCIC_SERIALBUS, PCIS_SERIALBUS_FC, "Fibre Channel"}, - {PCIC_SERIALBUS, PCIS_SERIALBUS_SMBUS, "SMBus"}, - {PCIC_WIRELESS, -1, "wireless controller"}, - {PCIC_WIRELESS, PCIS_WIRELESS_IRDA, "iRDA"}, - {PCIC_WIRELESS, PCIS_WIRELESS_IR, "IR"}, - {PCIC_WIRELESS, PCIS_WIRELESS_RF, "RF"}, - {PCIC_INTELLIIO, -1, "intelligent I/O controller"}, - {PCIC_INTELLIIO, PCIS_INTELLIIO_I2O, "I2O"}, - {PCIC_SATCOM, -1, "satellite communication"}, - {PCIC_SATCOM, PCIS_SATCOM_TV, "sat TV"}, - {PCIC_SATCOM, PCIS_SATCOM_AUDIO, "sat audio"}, - {PCIC_SATCOM, PCIS_SATCOM_VOICE, "sat voice"}, - {PCIC_SATCOM, PCIS_SATCOM_DATA, "sat data"}, - {PCIC_CRYPTO, -1, "encrypt/decrypt"}, - {PCIC_CRYPTO, PCIS_CRYPTO_NETCOMP, "network/computer crypto"}, - {PCIC_CRYPTO, PCIS_CRYPTO_ENTERTAIN, "entertainment crypto"}, - {PCIC_DASP, -1, "dasp"}, - {PCIC_DASP, PCIS_DASP_DPIO, "DPIO module"}, - {0, 0, NULL} + {PCIC_OLD, -1, 1, "old"}, + {PCIC_OLD, PCIS_OLD_NONVGA, 1, "non-VGA display device"}, + {PCIC_OLD, PCIS_OLD_VGA, 1, "VGA-compatible display device"}, + {PCIC_STORAGE, -1, 1, "mass storage"}, + {PCIC_STORAGE, PCIS_STORAGE_SCSI, 1, "SCSI"}, + {PCIC_STORAGE, PCIS_STORAGE_IDE, 1, "ATA"}, + {PCIC_STORAGE, PCIS_STORAGE_FLOPPY, 1, "floppy disk"}, + {PCIC_STORAGE, PCIS_STORAGE_IPI, 1, "IPI"}, + {PCIC_STORAGE, PCIS_STORAGE_RAID, 1, "RAID"}, + {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, 1, "ATA (ADMA)"}, + {PCIC_STORAGE, PCIS_STORAGE_SATA, 1, "SATA"}, + {PCIC_STORAGE, PCIS_STORAGE_SAS, 1, "SAS"}, + {PCIC_STORAGE, PCIS_STORAGE_NVM, 1, "NVM"}, + {PCIC_NETWORK, -1, 1, "network"}, + {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, 1, "ethernet"}, + {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, 1, "token ring"}, + {PCIC_NETWORK, PCIS_NETWORK_FDDI, 1, "fddi"}, + {PCIC_NETWORK, PCIS_NETWORK_ATM, 1, "ATM"}, + {PCIC_NETWORK, PCIS_NETWORK_ISDN, 1, "ISDN"}, + {PCIC_DISPLAY, -1, 1, "display"}, + {PCIC_DISPLAY, PCIS_DISPLAY_VGA, 1, "VGA"}, + {PCIC_DISPLAY, PCIS_DISPLAY_XGA, 1, "XGA"}, + {PCIC_DISPLAY, PCIS_DISPLAY_3D, 1, "3D"}, + {PCIC_MULTIMEDIA, -1, 1, "multimedia"}, + {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_VIDEO, 1, "video"}, + {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_AUDIO, 1, "audio"}, + {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_TELE, 1, "telephony"}, + {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_HDA, 1, "HDA"}, + {PCIC_MEMORY, -1, 1, "memory"}, + {PCIC_MEMORY, PCIS_MEMORY_RAM, 1, "RAM"}, + {PCIC_MEMORY, PCIS_MEMORY_FLASH, 1, "flash"}, + {PCIC_BRIDGE, -1, 1, "bridge"}, + {PCIC_BRIDGE, PCIS_BRIDGE_HOST, 1, "HOST-PCI"}, + {PCIC_BRIDGE, PCIS_BRIDGE_ISA, 1, "PCI-ISA"}, + {PCIC_BRIDGE, PCIS_BRIDGE_EISA, 1, "PCI-EISA"}, + {PCIC_BRIDGE, PCIS_BRIDGE_MCA, 1, "PCI-MCA"}, + {PCIC_BRIDGE, PCIS_BRIDGE_PCI, 1, "PCI-PCI"}, + {PCIC_BRIDGE, PCIS_BRIDGE_PCMCIA, 1, "PCI-PCMCIA"}, + {PCIC_BRIDGE, PCIS_BRIDGE_NUBUS, 1, "PCI-NuBus"}, + {PCIC_BRIDGE, PCIS_BRIDGE_CARDBUS, 1, "PCI-CardBus"}, + {PCIC_BRIDGE, PCIS_BRIDGE_RACEWAY, 1, "PCI-RACEway"}, + {PCIC_SIMPLECOMM, -1, 1, "simple comms"}, + {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_UART, 1, "UART"}, /* could detect 16550 */ + {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_PAR, 1, "parallel port"}, + {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_MULSER, 1, "multiport serial"}, + {PCIC_SIMPLECOMM, PCIS_SIMPLECOMM_MODEM, 1, "generic modem"}, + {PCIC_BASEPERIPH, -1, 0, "base peripheral"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_PIC, 1, "interrupt controller"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_DMA, 1, "DMA controller"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_TIMER, 1, "timer"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_RTC, 1, "realtime clock"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_PCIHOT, 1, "PCI hot-plug controller"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_SDHC, 1, "SD host controller"}, + {PCIC_INPUTDEV, -1, 1, "input device"}, + {PCIC_INPUTDEV, PCIS_INPUTDEV_KEYBOARD, 1, "keyboard"}, + {PCIC_INPUTDEV, PCIS_INPUTDEV_DIGITIZER,1, "digitizer"}, + {PCIC_INPUTDEV, PCIS_INPUTDEV_MOUSE, 1, "mouse"}, + {PCIC_INPUTDEV, PCIS_INPUTDEV_SCANNER, 1, "scanner"}, + {PCIC_INPUTDEV, PCIS_INPUTDEV_GAMEPORT, 1, "gameport"}, + {PCIC_DOCKING, -1, 1, "docking station"}, + {PCIC_PROCESSOR, -1, 1, "processor"}, + {PCIC_SERIALBUS, -1, 1, "serial bus"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_FW, 1, "FireWire"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_ACCESS, 1, "AccessBus"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_SSA, 1, "SSA"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_USB, 1, "USB"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_FC, 1, "Fibre Channel"}, + {PCIC_SERIALBUS, PCIS_SERIALBUS_SMBUS, 0, "SMBus"}, + {PCIC_WIRELESS, -1, 1, "wireless controller"}, + {PCIC_WIRELESS, PCIS_WIRELESS_IRDA, 1, "iRDA"}, + {PCIC_WIRELESS, PCIS_WIRELESS_IR, 1, "IR"}, + {PCIC_WIRELESS, PCIS_WIRELESS_RF, 1, "RF"}, + {PCIC_INTELLIIO, -1, 1, "intelligent I/O controller"}, + {PCIC_INTELLIIO, PCIS_INTELLIIO_I2O, 1, "I2O"}, + {PCIC_SATCOM, -1, 1, "satellite communication"}, + {PCIC_SATCOM, PCIS_SATCOM_TV, 1, "sat TV"}, + {PCIC_SATCOM, PCIS_SATCOM_AUDIO, 1, "sat audio"}, + {PCIC_SATCOM, PCIS_SATCOM_VOICE, 1, "sat voice"}, + {PCIC_SATCOM, PCIS_SATCOM_DATA, 1, "sat data"}, + {PCIC_CRYPTO, -1, 1, "encrypt/decrypt"}, + {PCIC_CRYPTO, PCIS_CRYPTO_NETCOMP, 1, "network/computer crypto"}, + {PCIC_CRYPTO, PCIS_CRYPTO_ENTERTAIN, 1, "entertainment crypto"}, + {PCIC_DASP, -1, 0, "dasp"}, + {PCIC_DASP, PCIS_DASP_DPIO, 1, "DPIO module"}, + {0, 0, 0, NULL} }; void pci_probe_nomatch(device_t dev, device_t child) { - int i; + int i, report; const char *cp, *scp; char *device; /* * Look for a listing for this device in a loaded device database. */ + report = 1; if ((device = pci_describe_device(child)) != NULL) { device_printf(dev, "<%s>", device); free(device, M_DEVBUF); @@ -4081,19 +4083,25 @@ pci_probe_nomatch(device_t dev, device_t if (pci_nomatch_tab[i].class == pci_get_class(child)) { if (pci_nomatch_tab[i].subclass == -1) { cp = pci_nomatch_tab[i].desc; + report = pci_nomatch_tab[i].report; } else if (pci_nomatch_tab[i].subclass == pci_get_subclass(child)) { scp = pci_nomatch_tab[i].desc; + report = pci_nomatch_tab[i].report; } } } - device_printf(dev, "<%s%s%s>", - cp ? cp : "", - ((cp != NULL) && (scp != NULL)) ? ", " : "", - scp ? scp : ""); + if (report || bootverbose) { + device_printf(dev, "<%s%s%s>", + cp ? cp : "", + ((cp != NULL) && (scp != NULL)) ? ", " : "", + scp ? scp : ""); + } + } + if (report || bootverbose) { + printf(" at device %d.%d (no driver attached)\n", + pci_get_slot(child), pci_get_function(child)); } - printf(" at device %d.%d (no driver attached)\n", - pci_get_slot(child), pci_get_function(child)); pci_cfg_save(child, device_get_ivars(child), 1); } From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 17:13:33 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 159B12E5; Wed, 30 Apr 2014 17:13:33 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DABB01ACE; Wed, 30 Apr 2014 17:13:32 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WfY4Z-000Jie-IW; Wed, 30 Apr 2014 17:13:31 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s3UHDSmm017778; Wed, 30 Apr 2014 11:13:29 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18krBQahqcnTbQb5Ie7r+U5 Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null From: Ian Lepore To: Steven Hartland In-Reply-To: References: <201404300620.s3U6Kmn6074492@svn.freebsd.org> <1398869319.22079.54.camel@revolution.hippie.lan> Content-Type: text/plain; charset="us-ascii" Date: Wed, 30 Apr 2014 11:13:28 -0600 Message-ID: <1398878008.22079.67.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 17:13:33 -0000 On Wed, 2014-04-30 at 17:22 +0100, Steven Hartland wrote: > ----- Original Message ----- > From: "Ian Lepore" > To: "Eitan Adler" > Cc: ; ; > Sent: Wednesday, April 30, 2014 3:48 PM > Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null > > > > On Wed, 2014-04-30 at 06:20 +0000, Eitan Adler wrote: > >> Author: eadler > >> Date: Wed Apr 30 06:20:48 2014 > >> New Revision: 265132 > >> URL: http://svnweb.freebsd.org/changeset/base/265132 > >> > >> Log: > >> Add a /dev/full device. > >> > >> /dev/full is similar to /dev/zero except it always returns > >> ENOSPC when you attempt to write to it. > >> > > > > For some reason this reminded me of something I've been wanting for a > > while but never get around to writing... /dev/ones, it's just > > like /dev/zero except it returns 0xff bytes. Useful for dd'ing to wipe > > out flash-based media. > > Surely for that you want camcontrol security ...? > > Regards > Steve I have no idea what that is, but given that it has "security" in the name, it's almost certainly NOT what I want in any way shape or form. Shocking as it may be, some people are just not obsessed with security, for good reason. It just isn't a consideration in any way in my day to day activities. When I want to make an sdcard, or some portion thereof, look empty/virgin/new-from-factory for testing on an embedded system, that has nothing to do with security, and everything to do with just exactly what I asked for: something that writes all-ones-bits. Besides, cam and sdcards don't play in the same sandboxes. -- Ian From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 17:34:29 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87CD1A4C; Wed, 30 Apr 2014 17:34:29 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id 9C0EE1D5E; Wed, 30 Apr 2014 17:34:28 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id 14C9520E7088D; Wed, 30 Apr 2014 17:34:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,HELO_NO_DOMAIN,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTPS id 73F5D20E7088A; Wed, 30 Apr 2014 17:34:21 +0000 (UTC) Message-ID: <906E4322F37E42CABB19AE687605243C@multiplay.co.uk> From: "Steven Hartland" To: "Ian Lepore" References: <201404300620.s3U6Kmn6074492@svn.freebsd.org> <1398869319.22079.54.camel@revolution.hippie.lan> <1398878008.22079.67.camel@revolution.hippie.lan> Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null Date: Wed, 30 Apr 2014 18:34:22 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 17:34:29 -0000 ----- Original Message ----- From: "Ian Lepore" To: "Steven Hartland" Cc: "Eitan Adler" ; ; ; Sent: Wednesday, April 30, 2014 6:13 PM Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null > On Wed, 2014-04-30 at 17:22 +0100, Steven Hartland wrote: >> ----- Original Message ----- >> From: "Ian Lepore" >> To: "Eitan Adler" >> Cc: ; ; >> Sent: Wednesday, April 30, 2014 3:48 PM >> Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null >> >> >> > On Wed, 2014-04-30 at 06:20 +0000, Eitan Adler wrote: >> >> Author: eadler >> >> Date: Wed Apr 30 06:20:48 2014 >> >> New Revision: 265132 >> >> URL: http://svnweb.freebsd.org/changeset/base/265132 >> >> >> >> Log: >> >> Add a /dev/full device. >> >> >> >> /dev/full is similar to /dev/zero except it always returns >> >> ENOSPC when you attempt to write to it. >> >> >> > >> > For some reason this reminded me of something I've been wanting for a >> > while but never get around to writing... /dev/ones, it's just >> > like /dev/zero except it returns 0xff bytes. Useful for dd'ing to wipe >> > out flash-based media. >> >> Surely for that you want camcontrol security ...? >> >> Regards >> Steve > > I have no idea what that is, but given that it has "security" in the > name, it's almost certainly NOT what I want in any way shape or form. > Shocking as it may be, some people are just not obsessed with security, > for good reason. It just isn't a consideration in any way in my day to > day activities. Its a standard option which allows you to erase the contents of a device its named security as thats the class of the ATA commands which provides this functionality. > When I want to make an sdcard, or some portion thereof, look > empty/virgin/new-from-factory for testing on an embedded system, that > has nothing to do with security, and everything to do with just exactly > what I asked for: something that writes all-ones-bits. That does kind of describe the functionality thats provided by camcontrol security appart from it explicity asks for the cells to be erased, so results in the device being as close to from factory as possible but, not set to a specific value. Maybe thats the difference between ATA based flash media e.g. SSD and sdcard's? Regards Steve From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 17:38:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F61DC07; Wed, 30 Apr 2014 17:38:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CAC11D96; Wed, 30 Apr 2014 17:38:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3UHcRoX051345; Wed, 30 Apr 2014 17:38:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3UHcRU4051344; Wed, 30 Apr 2014 17:38:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404301738.s3UHcRU4051344@svn.freebsd.org> From: Alexander Motin Date: Wed, 30 Apr 2014 17:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265150 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 17:38:27 -0000 Author: mav Date: Wed Apr 30 17:38:26 2014 New Revision: 265150 URL: http://svnweb.freebsd.org/changeset/base/265150 Log: Do not reread SCSI disk VPD pages on every device open. Instead of rereading VPD pages on every device open, do it only on initial device probe, and in cases when device reported via UNIT ATTENTIONs that something has changed. Capacity is still rereaded on every open because it is more critical for operation and more probable to change in run time. On my tests with Intel 530 SSDs on mps(4) HBA this change reduces time GEOM needs to retaste the device (that includes few open/close cycles) from ~150ms to ~30ms. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Wed Apr 30 16:42:12 2014 (r265149) +++ head/sys/cam/scsi/scsi_da.c Wed Apr 30 17:38:26 2014 (r265150) @@ -90,7 +90,8 @@ typedef enum { DA_FLAG_SCTX_INIT = 0x200, DA_FLAG_CAN_RC16 = 0x400, DA_FLAG_PROBED = 0x800, - DA_FLAG_DIRTY = 0x1000 + DA_FLAG_DIRTY = 0x1000, + DA_FLAG_ANNOUNCED = 0x2000 } da_flags; typedef enum { @@ -1658,10 +1659,18 @@ daasync(void *callback_arg, u_int32_t co &error_code, &sense_key, &asc, &ascq)) { if (asc == 0x2A && ascq == 0x09) { xpt_print(ccb->ccb_h.path, - "capacity data has changed\n"); + "Capacity data has changed\n"); + softc->flags &= ~DA_FLAG_PROBED; dareprobe(periph); - } else if (asc == 0x28 && ascq == 0x00) + } else if (asc == 0x28 && ascq == 0x00) { + softc->flags &= ~DA_FLAG_PROBED; disk_media_changed(softc->disk, M_NOWAIT); + } else if (asc == 0x3F && ascq == 0x03) { + xpt_print(ccb->ccb_h.path, + "INQUIRY data has changed\n"); + softc->flags &= ~DA_FLAG_PROBED; + dareprobe(periph); + } } cam_periph_async(periph, code, path, arg); break; @@ -1891,7 +1900,7 @@ daprobedone(struct cam_periph *periph, u dadeletemethodchoose(softc, DA_DELETE_NONE); - if (bootverbose && (softc->flags & DA_FLAG_PROBED) == 0) { + if (bootverbose && (softc->flags & DA_FLAG_ANNOUNCED) == 0) { char buf[80]; int i, sep; @@ -1932,10 +1941,11 @@ daprobedone(struct cam_periph *periph, u */ xpt_release_ccb(ccb); softc->state = DA_STATE_NORMAL; + softc->flags |= DA_FLAG_PROBED; daschedule(periph); wakeup(&softc->disk->d_mediasize); - if ((softc->flags & DA_FLAG_PROBED) == 0) { - softc->flags |= DA_FLAG_PROBED; + if ((softc->flags & DA_FLAG_ANNOUNCED) == 0) { + softc->flags |= DA_FLAG_ANNOUNCED; cam_periph_unhold(periph); } else cam_periph_release_locked(periph); @@ -3190,7 +3200,8 @@ dadone(struct cam_periph *periph, union } } free(csio->data_ptr, M_SCSIDA); - if (announce_buf[0] != '\0' && ((softc->flags & DA_FLAG_PROBED) == 0)) { + if (announce_buf[0] != '\0' && + ((softc->flags & DA_FLAG_ANNOUNCED) == 0)) { /* * Create our sysctl variables, now that we know * we have successfully attached. @@ -3208,6 +3219,12 @@ dadone(struct cam_periph *periph, union } } + /* We already probed the device. */ + if (softc->flags & DA_FLAG_PROBED) { + daprobedone(periph, done_ccb); + return; + } + /* Ensure re-probe doesn't see old delete. */ softc->delete_available = 0; if (lbp && (softc->quirks & DA_Q_NO_UNMAP) == 0) { @@ -3546,13 +3563,21 @@ daerror(union ccb *ccb, u_int32_t cam_fl */ else if (sense_key == SSD_KEY_UNIT_ATTENTION && asc == 0x2A && ascq == 0x09) { - xpt_print(periph->path, "capacity data has changed\n"); + xpt_print(periph->path, "Capacity data has changed\n"); + softc->flags &= ~DA_FLAG_PROBED; dareprobe(periph); sense_flags |= SF_NO_PRINT; } else if (sense_key == SSD_KEY_UNIT_ATTENTION && - asc == 0x28 && ascq == 0x00) + asc == 0x28 && ascq == 0x00) { + softc->flags &= ~DA_FLAG_PROBED; disk_media_changed(softc->disk, M_NOWAIT); - else if (sense_key == SSD_KEY_NOT_READY && + } else if (sense_key == SSD_KEY_UNIT_ATTENTION && + asc == 0x3F && ascq == 0x03) { + xpt_print(periph->path, "INQUIRY data has changed\n"); + softc->flags &= ~DA_FLAG_PROBED; + dareprobe(periph); + sense_flags |= SF_NO_PRINT; + } else if (sense_key == SSD_KEY_NOT_READY && asc == 0x3a && (softc->flags & DA_FLAG_PACK_INVALID) == 0) { softc->flags |= DA_FLAG_PACK_INVALID; disk_media_gone(softc->disk, M_NOWAIT); From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 17:43:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E54BD8E; Wed, 30 Apr 2014 17:43:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AA211E63; Wed, 30 Apr 2014 17:43:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3UHho3l054904; Wed, 30 Apr 2014 17:43:50 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3UHhoch054900; Wed, 30 Apr 2014 17:43:50 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201404301743.s3UHhoch054900@svn.freebsd.org> From: Peter Wemm Date: Wed, 30 Apr 2014 17:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265151 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 17:43:50 -0000 Author: peter Date: Wed Apr 30 17:43:49 2014 New Revision: 265151 URL: http://svnweb.freebsd.org/changeset/base/265151 Log: Nuke svn:ignore on the conf directory - This makes sense for the compile directory, but not so much for here as it's including ignores for things like GENERIC etc. Submitted by: markm Modified: Directory Properties: head/sys/amd64/conf/ (props changed) head/sys/arm/conf/ (props changed) head/sys/i386/conf/ (props changed) head/sys/ia64/conf/ (props changed) head/sys/mips/conf/ (props changed) head/sys/pc98/conf/ (props changed) head/sys/powerpc/conf/ (props changed) head/sys/sparc64/conf/ (props changed) From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 17:46:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39917FD1; Wed, 30 Apr 2014 17:46:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 245781F3C; Wed, 30 Apr 2014 17:46:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3UHkVHG055374; Wed, 30 Apr 2014 17:46:31 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3UHkTqs055362; Wed, 30 Apr 2014 17:46:29 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201404301746.s3UHkTqs055362@svn.freebsd.org> From: Steven Hartland Date: Wed, 30 Apr 2014 17:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265152 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 17:46:31 -0000 Author: smh Date: Wed Apr 30 17:46:29 2014 New Revision: 265152 URL: http://svnweb.freebsd.org/changeset/base/265152 Log: Reintroduce priority for the TRIM ZIOs instead of using the "NOW" priority The changes how TRIM requests are generated to use ZIO_TYPE_FREE + a priority instead of ZIO_TYPE_IOCTL, until processed by vdev_geom; only then is it translated the required geom values. This reduces the amount of changes required for FREE requests to be supported by the new IO scheduler. This also eliminates the need for a specific DKIOCTRIM. Also fixed FREE vdev child IO's from running ZIO_STAGE_VDEV_IO_DONE as part of their schedule. As the new IO scheduler can result in a request to execute one type of IO to actually run a different type of IO it requires that zio_trim requests are processed without holding the trim map lock (tm->tm_lock), as the free request execute call may result in write request running hence triggering a trim_map_write_start call, which takes the trim map lock and hence would result in recused on no-recursive sx lock. This is based off avg's original work, so credit to him. MFC after: 1 month Modified: head/sys/cddl/compat/opensolaris/sys/dkio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/compat/opensolaris/sys/dkio.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/dkio.h Wed Apr 30 17:43:49 2014 (r265151) +++ head/sys/cddl/compat/opensolaris/sys/dkio.h Wed Apr 30 17:46:29 2014 (r265152) @@ -75,8 +75,6 @@ extern "C" { */ #define DKIOCFLUSHWRITECACHE (DKIOC|34) /* flush cache to phys medium */ -#define DKIOCTRIM (DKIOC|35) /* TRIM a block */ - struct dk_callback { void (*dkc_callback)(void *dkc_cookie, int error); void *dkc_cookie; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Wed Apr 30 17:43:49 2014 (r265151) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Wed Apr 30 17:46:29 2014 (r265152) @@ -135,9 +135,10 @@ typedef enum zio_priority { ZIO_PRIORITY_ASYNC_READ, /* prefetch */ ZIO_PRIORITY_ASYNC_WRITE, /* spa_sync() */ ZIO_PRIORITY_SCRUB, /* asynchronous scrub/resilver reads */ + ZIO_PRIORITY_TRIM, /* free requests used for TRIM */ ZIO_PRIORITY_NUM_QUEUEABLE, - ZIO_PRIORITY_NOW /* non-queued i/os (e.g. free) */ + ZIO_PRIORITY_NOW /* non-queued I/Os (e.g. ioctl) */ } zio_priority_t; #define ZIO_PIPELINE_CONTINUE 0x100 @@ -508,7 +509,7 @@ extern zio_t *zio_claim(zio_t *pio, spa_ extern zio_t *zio_ioctl(zio_t *pio, spa_t *spa, vdev_t *vd, int cmd, uint64_t offset, uint64_t size, zio_done_func_t *done, void *priv, - enum zio_flag flags); + zio_priority_t priority, enum zio_flag flags); extern zio_t *zio_read_phys(zio_t *pio, vdev_t *vd, uint64_t offset, uint64_t size, void *data, int checksum, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Wed Apr 30 17:43:49 2014 (r265151) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Wed Apr 30 17:46:29 2014 (r265152) @@ -215,6 +215,10 @@ enum zio_stage { ZIO_STAGE_FREE_BP_INIT | \ ZIO_STAGE_DVA_FREE) +#define ZIO_FREE_PHYS_PIPELINE \ + (ZIO_INTERLOCK_STAGES | \ + ZIO_VDEV_IO_STAGES) + #define ZIO_DDT_FREE_PIPELINE \ (ZIO_INTERLOCK_STAGES | \ ZIO_STAGE_FREE_BP_INIT | \ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Wed Apr 30 17:43:49 2014 (r265151) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Wed Apr 30 17:46:29 2014 (r265152) @@ -449,7 +449,7 @@ trim_map_vdev_commit(spa_t *spa, zio_t * { trim_map_t *tm = vd->vdev_trimmap; trim_seg_t *ts; - uint64_t size, txgtarget, txgsafe; + uint64_t size, offset, txgtarget, txgsafe; hrtime_t timelimit; ASSERT(vd->vdev_ops->vdev_op_leaf); @@ -477,9 +477,20 @@ trim_map_vdev_commit(spa_t *spa, zio_t * avl_remove(&tm->tm_queued_frees, ts); avl_add(&tm->tm_inflight_frees, ts); size = ts->ts_end - ts->ts_start; - zio_nowait(zio_trim(zio, spa, vd, ts->ts_start, size)); + offset = ts->ts_start; TRIM_MAP_SDEC(tm, size); TRIM_MAP_QDEC(tm); + /* + * We drop the lock while we call zio_nowait as the IO + * scheduler can result in a different IO being run e.g. + * a write which would result in a recursive lock. + */ + mutex_exit(&tm->tm_lock); + + zio_nowait(zio_trim(zio, spa, vd, offset, size)); + + mutex_enter(&tm->tm_lock); + ts = trim_map_first(tm, txgtarget, txgsafe, timelimit); } mutex_exit(&tm->tm_lock); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Wed Apr 30 17:43:49 2014 (r265151) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Wed Apr 30 17:46:29 2014 (r265152) @@ -800,10 +800,11 @@ vdev_geom_io_start(zio_t *zio) vd = zio->io_vd; - if (zio->io_type == ZIO_TYPE_IOCTL) { + switch (zio->io_type) { + case ZIO_TYPE_IOCTL: /* XXPOLICY */ if (!vdev_readable(vd)) { - zio->io_error = ENXIO; + zio->io_error = SET_ERROR(ENXIO); return (ZIO_PIPELINE_CONTINUE); } @@ -812,28 +813,28 @@ vdev_geom_io_start(zio_t *zio) if (zfs_nocacheflush || vdev_geom_bio_flush_disable) break; if (vd->vdev_nowritecache) { - zio->io_error = ENOTSUP; - break; - } - goto sendreq; - case DKIOCTRIM: - if (vdev_geom_bio_delete_disable) - break; - if (vd->vdev_notrim) { - zio->io_error = ENOTSUP; + zio->io_error = SET_ERROR(ENOTSUP); break; } goto sendreq; default: - zio->io_error = ENOTSUP; + zio->io_error = SET_ERROR(ENOTSUP); } return (ZIO_PIPELINE_CONTINUE); + case ZIO_TYPE_FREE: + if (vdev_geom_bio_delete_disable) + return (ZIO_PIPELINE_CONTINUE); + + if (vd->vdev_notrim) { + zio->io_error = SET_ERROR(ENOTSUP); + return (ZIO_PIPELINE_CONTINUE); + } } sendreq: cp = vd->vdev_tsd; if (cp == NULL) { - zio->io_error = ENXIO; + zio->io_error = SET_ERROR(ENXIO); return (ZIO_PIPELINE_CONTINUE); } bp = g_alloc_bio(); @@ -846,21 +847,20 @@ sendreq: bp->bio_offset = zio->io_offset; bp->bio_length = zio->io_size; break; + case ZIO_TYPE_FREE: + bp->bio_cmd = BIO_DELETE; + bp->bio_data = NULL; + bp->bio_offset = zio->io_offset; + bp->bio_length = zio->io_size; + break; case ZIO_TYPE_IOCTL: - switch (zio->io_cmd) { - case DKIOCFLUSHWRITECACHE: + if (zio->io_cmd == DKIOCFLUSHWRITECACHE) { bp->bio_cmd = BIO_FLUSH; bp->bio_flags |= BIO_ORDERED; bp->bio_data = NULL; bp->bio_offset = cp->provider->mediasize; bp->bio_length = 0; break; - case DKIOCTRIM: - bp->bio_cmd = BIO_DELETE; - bp->bio_data = NULL; - bp->bio_offset = zio->io_offset; - bp->bio_length = zio->io_size; - break; } break; } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Wed Apr 30 17:43:49 2014 (r265151) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Wed Apr 30 17:46:29 2014 (r265152) @@ -40,9 +40,9 @@ * * ZFS issues I/O operations to leaf vdevs to satisfy and complete zios. The * I/O scheduler determines when and in what order those operations are - * issued. The I/O scheduler divides operations into five I/O classes + * issued. The I/O scheduler divides operations into six I/O classes * prioritized in the following order: sync read, sync write, async read, - * async write, and scrub/resilver. Each queue defines the minimum and + * async write, scrub/resilver and trim. Each queue defines the minimum and * maximum number of concurrent operations that may be issued to the device. * In addition, the device has an aggregate maximum. Note that the sum of the * per-queue minimums must not exceed the aggregate maximum, and if the @@ -61,7 +61,7 @@ * done in the order specified above. No further operations are issued if the * aggregate maximum number of concurrent operations has been hit or if there * are no operations queued for an I/O class that has not hit its maximum. - * Every time an i/o is queued or an operation completes, the I/O scheduler + * Every time an I/O is queued or an operation completes, the I/O scheduler * looks for new operations to issue. * * All I/O classes have a fixed maximum number of outstanding operations @@ -70,7 +70,7 @@ * transaction groups (see txg.c). Transaction groups enter the syncing state * periodically so the number of queued async writes will quickly burst up and * then bleed down to zero. Rather than servicing them as quickly as possible, - * the I/O scheduler changes the maximum number of active async write i/os + * the I/O scheduler changes the maximum number of active async write I/Os * according to the amount of dirty data in the pool (see dsl_pool.c). Since * both throughput and latency typically increase with the number of * concurrent operations issued to physical devices, reducing the burstiness @@ -113,14 +113,14 @@ */ /* - * The maximum number of i/os active to each device. Ideally, this will be >= + * The maximum number of I/Os active to each device. Ideally, this will be >= * the sum of each queue's max_active. It must be at least the sum of each * queue's min_active. */ uint32_t zfs_vdev_max_active = 1000; /* - * Per-queue limits on the number of i/os active to each device. If the + * Per-queue limits on the number of I/Os active to each device. If the * sum of the queue's max_active is < zfs_vdev_max_active, then the * min_active comes into play. We will send min_active from each queue, * and then select from queues in the order defined by zio_priority_t. @@ -145,6 +145,14 @@ uint32_t zfs_vdev_async_write_min_active uint32_t zfs_vdev_async_write_max_active = 10; uint32_t zfs_vdev_scrub_min_active = 1; uint32_t zfs_vdev_scrub_max_active = 2; +uint32_t zfs_vdev_trim_min_active = 1; +/* + * TRIM max active is large in comparison to the other values due to the fact + * that TRIM IOs are coalesced at the device layer. This value is set such + * that a typical SSD can process the queued IOs in a single request. + */ +uint32_t zfs_vdev_trim_max_active = 64; + /* * When the pool has less than zfs_vdev_async_write_active_min_dirty_percent @@ -171,7 +179,7 @@ SYSCTL_DECL(_vfs_zfs_vdev); TUNABLE_INT("vfs.zfs.vdev.max_active", &zfs_vdev_max_active); SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, max_active, CTLFLAG_RW, &zfs_vdev_max_active, 0, - "The maximum number of i/os of all types active for each device."); + "The maximum number of I/Os of all types active for each device."); #define ZFS_VDEV_QUEUE_KNOB_MIN(name) \ TUNABLE_INT("vfs.zfs.vdev." #name "_min_active", \ @@ -199,6 +207,8 @@ ZFS_VDEV_QUEUE_KNOB_MIN(async_write); ZFS_VDEV_QUEUE_KNOB_MAX(async_write); ZFS_VDEV_QUEUE_KNOB_MIN(scrub); ZFS_VDEV_QUEUE_KNOB_MAX(scrub); +ZFS_VDEV_QUEUE_KNOB_MIN(trim); +ZFS_VDEV_QUEUE_KNOB_MAX(trim); #undef ZFS_VDEV_QUEUE_KNOB @@ -299,6 +309,7 @@ static void vdev_queue_io_add(vdev_queue_t *vq, zio_t *zio) { spa_t *spa = zio->io_spa; + ASSERT(MUTEX_HELD(&vq->vq_lock)); ASSERT3U(zio->io_priority, <, ZIO_PRIORITY_NUM_QUEUEABLE); avl_add(&vq->vq_class[zio->io_priority].vqc_queued_tree, zio); @@ -315,6 +326,7 @@ static void vdev_queue_io_remove(vdev_queue_t *vq, zio_t *zio) { spa_t *spa = zio->io_spa; + ASSERT(MUTEX_HELD(&vq->vq_lock)); ASSERT3U(zio->io_priority, <, ZIO_PRIORITY_NUM_QUEUEABLE); avl_remove(&vq->vq_class[zio->io_priority].vqc_queued_tree, zio); @@ -403,6 +415,8 @@ vdev_queue_class_min_active(zio_priority return (zfs_vdev_async_write_min_active); case ZIO_PRIORITY_SCRUB: return (zfs_vdev_scrub_min_active); + case ZIO_PRIORITY_TRIM: + return (zfs_vdev_trim_min_active); default: panic("invalid priority %u", p); return (0); @@ -454,6 +468,8 @@ vdev_queue_class_max_active(spa_t *spa, spa->spa_dsl_pool->dp_dirty_total)); case ZIO_PRIORITY_SCRUB: return (zfs_vdev_scrub_max_active); + case ZIO_PRIORITY_TRIM: + return (zfs_vdev_trim_max_active); default: panic("invalid priority %u", p); return (0); @@ -470,6 +486,8 @@ vdev_queue_class_to_issue(vdev_queue_t * spa_t *spa = vq->vq_vdev->vdev_spa; zio_priority_t p; + ASSERT(MUTEX_HELD(&vq->vq_lock)); + if (avl_numnodes(&vq->vq_active_tree) >= zfs_vdev_max_active) return (ZIO_PRIORITY_NUM_QUEUEABLE); @@ -511,10 +529,11 @@ vdev_queue_aggregate(vdev_queue_t *vq, z zio_t *first, *last, *aio, *dio, *mandatory, *nio; uint64_t maxgap = 0; uint64_t size; - boolean_t stretch = B_FALSE; - vdev_queue_class_t *vqc = &vq->vq_class[zio->io_priority]; - avl_tree_t *t = &vqc->vqc_queued_tree; - enum zio_flag flags = zio->io_flags & ZIO_FLAG_AGG_INHERIT; + boolean_t stretch; + avl_tree_t *t; + enum zio_flag flags; + + ASSERT(MUTEX_HELD(&vq->vq_lock)); if (zio->io_flags & ZIO_FLAG_DONT_AGGREGATE) return (NULL); @@ -552,6 +571,8 @@ vdev_queue_aggregate(vdev_queue_t *vq, z * Walk backwards through sufficiently contiguous I/Os * recording the last non-option I/O. */ + flags = zio->io_flags & ZIO_FLAG_AGG_INHERIT; + t = &vq->vq_class[zio->io_priority].vqc_queued_tree; while ((dio = AVL_PREV(t, first)) != NULL && (dio->io_flags & ZIO_FLAG_AGG_INHERIT) == flags && IO_SPAN(dio, last) <= zfs_vdev_aggregation_limit && @@ -591,6 +612,7 @@ vdev_queue_aggregate(vdev_queue_t *vq, z * non-optional I/O is close enough to make aggregation * worthwhile. */ + stretch = B_FALSE; if (zio->io_type == ZIO_TYPE_WRITE && mandatory != NULL) { zio_t *nio = last; while ((dio = AVL_NEXT(t, nio)) != NULL && @@ -731,11 +753,13 @@ vdev_queue_io(zio_t *zio) zio->io_priority != ZIO_PRIORITY_ASYNC_READ && zio->io_priority != ZIO_PRIORITY_SCRUB) zio->io_priority = ZIO_PRIORITY_ASYNC_READ; - } else { - ASSERT(zio->io_type == ZIO_TYPE_WRITE); + } else if (zio->io_type == ZIO_TYPE_WRITE) { if (zio->io_priority != ZIO_PRIORITY_SYNC_WRITE && zio->io_priority != ZIO_PRIORITY_ASYNC_WRITE) zio->io_priority = ZIO_PRIORITY_ASYNC_WRITE; + } else { + ASSERT(zio->io_type == ZIO_TYPE_FREE); + zio->io_priority = ZIO_PRIORITY_TRIM; } zio->io_flags |= ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_QUEUE; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed Apr 30 17:43:49 2014 (r265151) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed Apr 30 17:46:29 2014 (r265152) @@ -788,6 +788,8 @@ zio_free_sync(zio_t *pio, spa_t *spa, ui else if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp)) stage |= ZIO_STAGE_ISSUE_ASYNC; + flags |= ZIO_FLAG_DONT_QUEUE; + zio = zio_create(pio, spa, txg, bp, NULL, size, NULL, NULL, ZIO_TYPE_FREE, ZIO_PRIORITY_NOW, flags, NULL, 0, NULL, ZIO_STAGE_OPEN, stage); @@ -827,14 +829,14 @@ zio_claim(zio_t *pio, spa_t *spa, uint64 zio_t * zio_ioctl(zio_t *pio, spa_t *spa, vdev_t *vd, int cmd, uint64_t offset, uint64_t size, zio_done_func_t *done, void *private, - enum zio_flag flags) + zio_priority_t priority, enum zio_flag flags) { zio_t *zio; int c; if (vd->vdev_children == 0) { zio = zio_create(pio, spa, 0, NULL, NULL, size, done, private, - ZIO_TYPE_IOCTL, ZIO_PRIORITY_NOW, flags, vd, offset, NULL, + ZIO_TYPE_IOCTL, priority, flags, vd, offset, NULL, ZIO_STAGE_OPEN, ZIO_IOCTL_PIPELINE); zio->io_cmd = cmd; @@ -843,7 +845,7 @@ zio_ioctl(zio_t *pio, spa_t *spa, vdev_t for (c = 0; c < vd->vdev_children; c++) zio_nowait(zio_ioctl(zio, spa, vd->vdev_child[c], cmd, - offset, size, done, private, flags)); + offset, size, done, private, priority, flags)); } return (zio); @@ -928,6 +930,10 @@ zio_vdev_child_io(zio_t *pio, blkptr_t * pio->io_pipeline &= ~ZIO_STAGE_CHECKSUM_VERIFY; } + /* Not all IO types require vdev io done stage e.g. free */ + if (!(pio->io_pipeline & ZIO_STAGE_VDEV_IO_DONE)) + pipeline &= ~ZIO_STAGE_VDEV_IO_DONE; + if (vd->vdev_children == 0) offset += VDEV_LABEL_START_SIZE; @@ -973,7 +979,7 @@ void zio_flush(zio_t *zio, vdev_t *vd) { zio_nowait(zio_ioctl(zio, zio->io_spa, vd, DKIOCFLUSHWRITECACHE, 0, 0, - NULL, NULL, + NULL, NULL, ZIO_PRIORITY_NOW, ZIO_FLAG_CANFAIL | ZIO_FLAG_DONT_PROPAGATE | ZIO_FLAG_DONT_RETRY)); } @@ -983,9 +989,10 @@ zio_trim(zio_t *zio, spa_t *spa, vdev_t ASSERT(vd->vdev_ops->vdev_op_leaf); - return zio_ioctl(zio, spa, vd, DKIOCTRIM, offset, size, - NULL, NULL, - ZIO_FLAG_CANFAIL | ZIO_FLAG_DONT_PROPAGATE | ZIO_FLAG_DONT_RETRY); + return (zio_create(zio, spa, 0, NULL, NULL, size, NULL, NULL, + ZIO_TYPE_FREE, ZIO_PRIORITY_TRIM, ZIO_FLAG_DONT_AGGREGATE | + ZIO_FLAG_CANFAIL | ZIO_FLAG_DONT_PROPAGATE | ZIO_FLAG_DONT_RETRY, + vd, offset, NULL, ZIO_STAGE_OPEN, ZIO_FREE_PHYS_PIPELINE)); } void @@ -2530,7 +2537,8 @@ zio_vdev_io_start(zio_t **ziop) return (vdev_mirror_ops.vdev_op_io_start(zio)); } - if (vd->vdev_ops->vdev_op_leaf && zio->io_type == ZIO_TYPE_FREE) { + if (vd->vdev_ops->vdev_op_leaf && zio->io_type == ZIO_TYPE_FREE && + zio->io_priority == ZIO_PRIORITY_NOW) { trim_map_free(vd, zio->io_offset, zio->io_size, zio->io_txg); return (ZIO_PIPELINE_CONTINUE); } @@ -2598,31 +2606,33 @@ zio_vdev_io_start(zio_t **ziop) return (ZIO_PIPELINE_CONTINUE); } - if (vd->vdev_ops->vdev_op_leaf && - (zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_WRITE)) { + if (vd->vdev_ops->vdev_op_leaf) { + switch (zio->io_type) { + case ZIO_TYPE_READ: + if (vdev_cache_read(zio)) + return (ZIO_PIPELINE_CONTINUE); + /* FALLTHROUGH */ + case ZIO_TYPE_WRITE: + case ZIO_TYPE_FREE: + if ((zio = vdev_queue_io(zio)) == NULL) + return (ZIO_PIPELINE_STOP); + *ziop = zio; - if (zio->io_type == ZIO_TYPE_READ && vdev_cache_read(zio)) - return (ZIO_PIPELINE_CONTINUE); - - if ((zio = vdev_queue_io(zio)) == NULL) - return (ZIO_PIPELINE_STOP); - *ziop = zio; - - if (!vdev_accessible(vd, zio)) { - zio->io_error = SET_ERROR(ENXIO); - zio_interrupt(zio); - return (ZIO_PIPELINE_STOP); + if (!vdev_accessible(vd, zio)) { + zio->io_error = SET_ERROR(ENXIO); + zio_interrupt(zio); + return (ZIO_PIPELINE_STOP); + } + break; } - } - - /* - * Note that we ignore repair writes for TRIM because they can conflict - * with normal writes. This isn't an issue because, by definition, we - * only repair blocks that aren't freed. - */ - if (vd->vdev_ops->vdev_op_leaf && zio->io_type == ZIO_TYPE_WRITE && - !(zio->io_flags & ZIO_FLAG_IO_REPAIR)) { - if (!trim_map_write_start(zio)) + /* + * Note that we ignore repair writes for TRIM because they can + * conflict with normal writes. This isn't an issue because, by + * definition, we only repair blocks that aren't freed. + */ + if (zio->io_type == ZIO_TYPE_WRITE && + !(zio->io_flags & ZIO_FLAG_IO_REPAIR) && + !trim_map_write_start(zio)) return (ZIO_PIPELINE_STOP); } @@ -2644,7 +2654,8 @@ zio_vdev_io_done(zio_t **ziop) zio->io_type == ZIO_TYPE_WRITE || zio->io_type == ZIO_TYPE_FREE); if (vd != NULL && vd->vdev_ops->vdev_op_leaf && - (zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_WRITE)) { + (zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_WRITE || + zio->io_type == ZIO_TYPE_FREE)) { if (zio->io_type == ZIO_TYPE_WRITE && !(zio->io_flags & ZIO_FLAG_IO_REPAIR)) @@ -2725,7 +2736,8 @@ zio_vdev_io_assess(zio_t **ziop) if (zio_injection_enabled && zio->io_error == 0) zio->io_error = zio_handle_fault_injection(zio, EIO); - if (zio->io_type == ZIO_TYPE_IOCTL && zio->io_cmd == DKIOCTRIM) + if (zio->io_type == ZIO_TYPE_FREE && + zio->io_priority != ZIO_PRIORITY_NOW) { switch (zio->io_error) { case 0: ZIO_TRIM_STAT_INCR(bytes, zio->io_size); @@ -2738,6 +2750,7 @@ zio_vdev_io_assess(zio_t **ziop) ZIO_TRIM_STAT_BUMP(failed); break; } + } /* * If the I/O failed, determine whether we should attempt to retry it. From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 18:02:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6438E693; Wed, 30 Apr 2014 18:02:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4541A119A; Wed, 30 Apr 2014 18:02:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3UI25bO063370; Wed, 30 Apr 2014 18:02:05 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3UI24eV063366; Wed, 30 Apr 2014 18:02:04 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404301802.s3UI24eV063366@svn.freebsd.org> From: Warner Losh Date: Wed, 30 Apr 2014 18:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265154 - in head: . sys/conf sys/tools/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 18:02:05 -0000 Author: imp Date: Wed Apr 30 18:02:04 2014 New Revision: 265154 URL: http://svnweb.freebsd.org/changeset/base/265154 Log: Allow FDT_DTS_FILE to be a list, either in the makedtb target, or in a kernel config file. If you also want to have a static DTB compiled into your kernel, however, it cannot be a list. We have no mechanism in the kernel for picking one, so that doesn't make sense and will result in a compile-time error. Modified: head/Makefile.inc1 head/sys/conf/files head/sys/tools/fdt/make_dtb.sh (contents, props changed) Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Apr 30 17:56:05 2014 (r265153) +++ head/Makefile.inc1 Wed Apr 30 18:02:04 2014 (r265154) @@ -1830,24 +1830,12 @@ DTBOUTPUTPATH= ${.CURDIR} # Build 'standalone' Device Tree Blob # builddtb: - @if [ "${FDT_DTS_FILE}" = "" ]; then \ - echo "ERROR: FDT_DTS_FILE must be specified!"; \ - exit 1; \ - fi; \ - if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${TARGET}/${FDT_DTS_FILE} ]; then \ - echo "ERROR: Specified DTS file (${FDT_DTS_FILE}) does not \ - exist!"; \ - exit 1; \ - fi; \ - if [ "${DTBOUTPUTPATH}" = "${.CURDIR}" ]; then \ - echo "WARNING: DTB will be placed in the current working \ - directory"; \ - fi - @PATH=${TMPPATH} \ - MACHINE=${TARGET} \ +.if !defined(FDT_DTS_FILE) +.error "FDT_DTS_FILE must be specified!" +.endif + @PATH=${TMPPATH} MACHINE=${TARGET} \ ${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \ - ${FDT_DTS_FILE} \ - ${DTBOUTPUTPATH}/`basename ${FDT_DTS_FILE} .dts` + "${FDT_DTS_FILE}" ${DTBOUTPUTPATH} ############### Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Apr 30 17:56:05 2014 (r265153) +++ head/sys/conf/files Wed Apr 30 18:02:04 2014 (r265154) @@ -14,7 +14,7 @@ acpi_quirks.h optional acpi \ # from the specified source (DTS) file: .dts -> .dtb # fdt_dtb_file optional fdt fdt_dtb_static \ - compile-with "sh $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} ${.CURDIR}/${FDT_DTS_FILE:R}.dtb" \ + compile-with "sh $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} ${.CURDIR}" \ no-obj no-implicit-rule before-depend \ clean "${FDT_DTS_FILE:R}.dtb" fdt_static_dtb.h optional fdt fdt_dtb_static \ Modified: head/sys/tools/fdt/make_dtb.sh ============================================================================== --- head/sys/tools/fdt/make_dtb.sh Wed Apr 30 17:56:05 2014 (r265153) +++ head/sys/tools/fdt/make_dtb.sh Wed Apr 30 18:02:04 2014 (r265154) @@ -4,8 +4,12 @@ # Script generates dtb file ($3) from dts source ($2) in build tree S ($1) S=$1 -dts=$2 -dtb=$3 +dts="$2" +dtb_path=$3 -cpp -x assembler-with-cpp -I $S/gnu/dts/include -I $S/boot/fdt/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $dts /dev/null | +for d in ${dts}; do + dtb=${dtb_path}/`basename $d .dts`.dtb + echo "converting $d -> $dtb" + cpp -x assembler-with-cpp -I $S/gnu/dts/include -I $S/boot/fdt/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $d /dev/null | dtc -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts/${MACHINE} -i $S/gnu/dts/${MACHINE} +done From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 18:02:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3F787DA; Wed, 30 Apr 2014 18:02:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1A4B119E; Wed, 30 Apr 2014 18:02:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3UI2Eem063455; Wed, 30 Apr 2014 18:02:14 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3UI2AKL063426; Wed, 30 Apr 2014 18:02:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404301802.s3UI2AKL063426@svn.freebsd.org> From: Warner Losh Date: Wed, 30 Apr 2014 18:02:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265155 - in head: . sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 18:02:14 -0000 Author: imp Date: Wed Apr 30 18:02:10 2014 New Revision: 265155 URL: http://svnweb.freebsd.org/changeset/base/265155 Log: Omit from the universe build all config files tagged with #NO_UNIVERSE. Many of these config files are important examples, but add little to no regresive value to the intended purpose of UNIVERSE. We now build over 120 kernels during universe. There's really little to no value to this over building say 60 or even 30 of them (either is still a way too big number). This is especially true for kernels that are nothing more than including a common base and adding a static DTB file. Start by pruning 1/3 of the arm kernels that add little regresion value. Added: head/sys/arm/conf/VYBRID - copied, changed from r265154, head/sys/arm/conf/VYBRID.common Deleted: head/sys/arm/conf/VYBRID.common Modified: head/Makefile head/sys/arm/conf/ARNDALE head/sys/arm/conf/BWCT head/sys/arm/conf/COLIBRI-VF50 head/sys/arm/conf/COSMIC head/sys/arm/conf/EB9200 head/sys/arm/conf/ETHERNUT5 head/sys/arm/conf/HL200 head/sys/arm/conf/HL201 head/sys/arm/conf/KB920X head/sys/arm/conf/NSLU head/sys/arm/conf/QILA9G20 head/sys/arm/conf/QUARTZ head/sys/arm/conf/SAM9260EK head/sys/arm/conf/SAM9X25EK head/sys/arm/conf/SN9G45 head/sys/arm/conf/WANDBOARD-DUAL head/sys/arm/conf/WANDBOARD-QUAD head/sys/arm/conf/WANDBOARD-SOLO Modified: head/Makefile ============================================================================== --- head/Makefile Wed Apr 30 18:02:04 2014 (r265154) +++ head/Makefile Wed Apr 30 18:02:10 2014 (r265155) @@ -458,9 +458,15 @@ universe_kernels: universe_kernconfs .if !defined(TARGET) TARGET!= uname -m .endif +.if defined(MAKE_ALL_KERNELS) +_THINNER=cat +.else +_THINNER=xargs grep -L "^.NO_UNIVERSE" +.endif KERNCONFS!= cd ${KERNSRCDIR}/${TARGET}/conf && \ find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ - ! -name DEFAULTS ! -name NOTES + ! -name DEFAULTS ! -name NOTES | \ + ${_THINNER} universe_kernconfs: .for kernel in ${KERNCONFS} TARGET_ARCH_${kernel}!= cd ${KERNSRCDIR}/${TARGET}/conf && \ Modified: head/sys/arm/conf/ARNDALE ============================================================================== --- head/sys/arm/conf/ARNDALE Wed Apr 30 18:02:04 2014 (r265154) +++ head/sys/arm/conf/ARNDALE Wed Apr 30 18:02:10 2014 (r265155) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + include "EXYNOS5250.common" ident ARNDALE Modified: head/sys/arm/conf/BWCT ============================================================================== --- head/sys/arm/conf/BWCT Wed Apr 30 18:02:04 2014 (r265154) +++ head/sys/arm/conf/BWCT Wed Apr 30 18:02:10 2014 (r265155) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident BWCT options VERBOSE_INIT_ARM Modified: head/sys/arm/conf/COLIBRI-VF50 ============================================================================== --- head/sys/arm/conf/COLIBRI-VF50 Wed Apr 30 18:02:04 2014 (r265154) +++ head/sys/arm/conf/COLIBRI-VF50 Wed Apr 30 18:02:10 2014 (r265155) @@ -17,7 +17,9 @@ # # $FreeBSD$ -include "VYBRID.common" +#NO_UNIVERSE + +include "VYBRID" ident COLIBRI-VF50 #FDT Modified: head/sys/arm/conf/COSMIC ============================================================================== --- head/sys/arm/conf/COSMIC Wed Apr 30 18:02:04 2014 (r265154) +++ head/sys/arm/conf/COSMIC Wed Apr 30 18:02:10 2014 (r265155) @@ -17,7 +17,9 @@ # # $FreeBSD$ -include "VYBRID.common" +#NO_UNIVERSE + +include "VYBRID" ident COSMIC #FDT Modified: head/sys/arm/conf/EB9200 ============================================================================== --- head/sys/arm/conf/EB9200 Wed Apr 30 18:02:04 2014 (r265154) +++ head/sys/arm/conf/EB9200 Wed Apr 30 18:02:10 2014 (r265155) @@ -12,6 +12,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident EB9200 include "../at91/std.eb9200" Modified: head/sys/arm/conf/ETHERNUT5 ============================================================================== --- head/sys/arm/conf/ETHERNUT5 Wed Apr 30 18:02:04 2014 (r265154) +++ head/sys/arm/conf/ETHERNUT5 Wed Apr 30 18:02:10 2014 (r265155) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident ETHERNUT5 include "../at91/std.ethernut5" Modified: head/sys/arm/conf/HL200 ============================================================================== --- head/sys/arm/conf/HL200 Wed Apr 30 18:02:04 2014 (r265154) +++ head/sys/arm/conf/HL200 Wed Apr 30 18:02:10 2014 (r265155) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident HL200 include "../at91/std.hl200" Modified: head/sys/arm/conf/HL201 ============================================================================== --- head/sys/arm/conf/HL201 Wed Apr 30 18:02:04 2014 (r265154) +++ head/sys/arm/conf/HL201 Wed Apr 30 18:02:10 2014 (r265155) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident HL201 include "../at91/std.hl201" Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Wed Apr 30 18:02:04 2014 (r265154) +++ head/sys/arm/conf/KB920X Wed Apr 30 18:02:10 2014 (r265155) @@ -18,6 +18,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident KB920X include "../at91/std.kb920x" Modified: head/sys/arm/conf/NSLU ============================================================================== --- head/sys/arm/conf/NSLU Wed Apr 30 18:02:04 2014 (r265154) +++ head/sys/arm/conf/NSLU Wed Apr 30 18:02:10 2014 (r265155) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident NSLU # XXX What is defined in std.avila does not exactly match the following: Modified: head/sys/arm/conf/QILA9G20 ============================================================================== --- head/sys/arm/conf/QILA9G20 Wed Apr 30 18:02:04 2014 (r265154) +++ head/sys/arm/conf/QILA9G20 Wed Apr 30 18:02:10 2014 (r265155) @@ -18,6 +18,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident QILA9G20 include "../at91/std.qila9g20" Modified: head/sys/arm/conf/QUARTZ ============================================================================== --- head/sys/arm/conf/QUARTZ Wed Apr 30 18:02:04 2014 (r265154) +++ head/sys/arm/conf/QUARTZ Wed Apr 30 18:02:10 2014 (r265155) @@ -17,7 +17,9 @@ # # $FreeBSD$ -include "VYBRID.common" +#NO_UNIVERSE + +include "VYBRID" ident QUARTZ #FDT Modified: head/sys/arm/conf/SAM9260EK ============================================================================== --- head/sys/arm/conf/SAM9260EK Wed Apr 30 18:02:04 2014 (r265154) +++ head/sys/arm/conf/SAM9260EK Wed Apr 30 18:02:10 2014 (r265155) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident SAM9260EK include "../at91/std.sam9260ek" Modified: head/sys/arm/conf/SAM9X25EK ============================================================================== --- head/sys/arm/conf/SAM9X25EK Wed Apr 30 18:02:04 2014 (r265154) +++ head/sys/arm/conf/SAM9X25EK Wed Apr 30 18:02:10 2014 (r265155) @@ -17,7 +17,8 @@ # # $FreeBSD$ -# NOUNIVERSE: disable building in make universe +#NO_UNIVERSE + ident SAM9X25EK include "../at91/std.sam9x25ek" Modified: head/sys/arm/conf/SN9G45 ============================================================================== --- head/sys/arm/conf/SN9G45 Wed Apr 30 18:02:04 2014 (r265154) +++ head/sys/arm/conf/SN9G45 Wed Apr 30 18:02:10 2014 (r265155) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + ident SN9G45 include "../at91/std.sn9g45" Copied and modified: head/sys/arm/conf/VYBRID (from r265154, head/sys/arm/conf/VYBRID.common) ============================================================================== --- head/sys/arm/conf/VYBRID.common Wed Apr 30 18:02:04 2014 (r265154, copy source) +++ head/sys/arm/conf/VYBRID Wed Apr 30 18:02:10 2014 (r265155) @@ -17,6 +17,7 @@ # # $FreeBSD$ +ident VYBRID include "../freescale/vybrid/std.vybrid" makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/conf/WANDBOARD-DUAL ============================================================================== --- head/sys/arm/conf/WANDBOARD-DUAL Wed Apr 30 18:02:04 2014 (r265154) +++ head/sys/arm/conf/WANDBOARD-DUAL Wed Apr 30 18:02:10 2014 (r265155) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + include "IMX6" ident WANDBOARD-DUAL Modified: head/sys/arm/conf/WANDBOARD-QUAD ============================================================================== --- head/sys/arm/conf/WANDBOARD-QUAD Wed Apr 30 18:02:04 2014 (r265154) +++ head/sys/arm/conf/WANDBOARD-QUAD Wed Apr 30 18:02:10 2014 (r265155) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + include "IMX6" ident WANDBOARD-QUAD Modified: head/sys/arm/conf/WANDBOARD-SOLO ============================================================================== --- head/sys/arm/conf/WANDBOARD-SOLO Wed Apr 30 18:02:04 2014 (r265154) +++ head/sys/arm/conf/WANDBOARD-SOLO Wed Apr 30 18:02:10 2014 (r265155) @@ -17,6 +17,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + include "IMX6" ident WANDBOARD-SOLO From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 18:02:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04C9990F; Wed, 30 Apr 2014 18:02:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE75711A0; Wed, 30 Apr 2014 18:02:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3UI2Jfc063513; Wed, 30 Apr 2014 18:02:19 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3UI2JJl063512; Wed, 30 Apr 2014 18:02:19 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404301802.s3UI2JJl063512@svn.freebsd.org> From: Warner Losh Date: Wed, 30 Apr 2014 18:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265156 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 18:02:20 -0000 Author: imp Date: Wed Apr 30 18:02:19 2014 New Revision: 265156 URL: http://svnweb.freebsd.org/changeset/base/265156 Log: This was copied to IMX6, which has since evolved further. Remove this as it is no longer needed. Deleted: head/sys/arm/conf/WANDBOARD.common From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 18:11:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C97A3C49; Wed, 30 Apr 2014 18:11:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D4B812C4; Wed, 30 Apr 2014 18:11:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3UIBrja067622; Wed, 30 Apr 2014 18:11:53 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3UIBrdU067621; Wed, 30 Apr 2014 18:11:53 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201404301811.s3UIBrdU067621@svn.freebsd.org> From: Ed Maste Date: Wed, 30 Apr 2014 18:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265157 - head/usr.sbin/kldxref X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 18:11:53 -0000 Author: emaste Date: Wed Apr 30 18:11:53 2014 New Revision: 265157 URL: http://svnweb.freebsd.org/changeset/base/265157 Log: kldxref: Clean up error reporting Omit "too many sections" warnings if the ELF file is not dynamically linked (and is therefore skipped anyway), and otherwise output it only once. An errant core file would previously cause kldxref to output a number of warnings. Also introduce a MAXSEGS #define and replace literal 2 with it, to make comparisons clear. Reviewed by: kib Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/kldxref/ef.c Modified: head/usr.sbin/kldxref/ef.c ============================================================================== --- head/usr.sbin/kldxref/ef.c Wed Apr 30 18:02:19 2014 (r265156) +++ head/usr.sbin/kldxref/ef.c Wed Apr 30 18:11:53 2014 (r265157) @@ -47,6 +47,7 @@ #include "ef.h" +#define MAXSEGS 2 struct ef_file { char* ef_name; struct elf_file *ef_efile; @@ -68,7 +69,7 @@ struct ef_file { Elf_Off ef_symoff; Elf_Sym* ef_symtab; int ef_nsegs; - Elf_Phdr * ef_segs[2]; + Elf_Phdr * ef_segs[MAXSEGS]; int ef_verbose; Elf_Rel * ef_rel; /* relocation table */ int ef_relsz; /* number of entries */ @@ -580,12 +581,9 @@ ef_open(const char *filename, struct elf ef_print_phdr(phdr); switch (phdr->p_type) { case PT_LOAD: - if (nsegs == 2) { - warnx("%s: too many sections", - filename); - break; - } - ef->ef_segs[nsegs++] = phdr; + if (nsegs < MAXSEGS) + ef->ef_segs[nsegs] = phdr; + nsegs++; break; case PT_PHDR: break; @@ -597,12 +595,15 @@ ef_open(const char *filename, struct elf } if (verbose > 1) printf("\n"); - ef->ef_nsegs = nsegs; if (phdyn == NULL) { warnx("Skipping %s: not dynamically-linked", filename); break; + } else if (nsegs > MAXSEGS) { + warnx("%s: too many sections", filename); + break; } + ef->ef_nsegs = nsegs; if (ef_read_entry(ef, phdyn->p_offset, phdyn->p_filesz, (void**)&ef->ef_dyn) != 0) { printf("ef_read_entry failed\n"); From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 18:25:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75BBECA; Wed, 30 Apr 2014 18:25:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48BFA13B4; Wed, 30 Apr 2014 18:25:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3UIPFcg072207; Wed, 30 Apr 2014 18:25:15 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3UIPFba072205; Wed, 30 Apr 2014 18:25:15 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201404301825.s3UIPFba072205@svn.freebsd.org> From: Peter Wemm Date: Wed, 30 Apr 2014 18:25:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265158 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 18:25:15 -0000 Author: peter Date: Wed Apr 30 18:25:14 2014 New Revision: 265158 URL: http://svnweb.freebsd.org/changeset/base/265158 Log: List LINT* instead of completely removing svn:ignore. Modified: Directory Properties: head/sys/amd64/conf/ (props changed) head/sys/arm/conf/ (props changed) head/sys/i386/conf/ (props changed) head/sys/ia64/conf/ (props changed) head/sys/mips/conf/ (props changed) head/sys/pc98/conf/ (props changed) head/sys/powerpc/conf/ (props changed) head/sys/sparc64/conf/ (props changed) From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 19:38:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by hub.freebsd.org (Postfix) with ESMTP id A8022B66; Wed, 30 Apr 2014 19:38:19 +0000 (UTC) Message-ID: <5361512A.7070205@FreeBSD.org> Date: Wed, 30 Apr 2014 15:38:18 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null References: <201404300620.s3U6Kmn6074492@svn.freebsd.org> In-Reply-To: <201404300620.s3U6Kmn6074492@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 19:38:25 -0000 On 2014-04-30 02:20:48 -0400, ?? wrote: > Author: eadler > Date: Wed Apr 30 06:20:48 2014 > New Revision: 265132 > URL: http://svnweb.freebsd.org/changeset/base/265132 > > Log: > Add a /dev/full device. > > /dev/full is similar to /dev/zero except it always returns > ENOSPC when you attempt to write to it. > > Reviewed by: jhibbits > Discussed with: rpaulo ... Please see lindev(4). Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 19:44:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7765D9C; Wed, 30 Apr 2014 19:44:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B87C71D8D; Wed, 30 Apr 2014 19:44:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3UJiVxC011262; Wed, 30 Apr 2014 19:44:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3UJiVl0011261; Wed, 30 Apr 2014 19:44:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201404301944.s3UJiVl0011261@svn.freebsd.org> From: Alexander Motin Date: Wed, 30 Apr 2014 19:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265159 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 19:44:32 -0000 Author: mav Date: Wed Apr 30 19:44:31 2014 New Revision: 265159 URL: http://svnweb.freebsd.org/changeset/base/265159 Log: Respect MAXIMUM TRANSFER LENGTH field of Block Limits VPD page. Nobody yet reported disk supporting I/Os less then our MAXPHYS value, but since we any way have code to read Block Limits VPD page, that is easy. MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Wed Apr 30 18:25:14 2014 (r265158) +++ head/sys/cam/scsi/scsi_da.c Wed Apr 30 19:44:31 2014 (r265159) @@ -212,6 +212,7 @@ struct da_softc { int trim_max_ranges; int delete_running; int delete_available; /* Delete methods possibly available */ + u_int maxio; uint32_t unmap_max_ranges; uint32_t unmap_max_lba; /* Max LBAs in UNMAP req */ uint64_t ws_max_blks; @@ -2135,11 +2136,12 @@ daregister(struct cam_periph *periph, vo softc->disk->d_name = "da"; softc->disk->d_drv1 = periph; if (cpi.maxio == 0) - softc->disk->d_maxsize = DFLTPHYS; /* traditional default */ + softc->maxio = DFLTPHYS; /* traditional default */ else if (cpi.maxio > MAXPHYS) - softc->disk->d_maxsize = MAXPHYS; /* for safety */ + softc->maxio = MAXPHYS; /* for safety */ else - softc->disk->d_maxsize = cpi.maxio; + softc->maxio = cpi.maxio; + softc->disk->d_maxsize = softc->maxio; softc->disk->d_unit = periph->unit_number; softc->disk->d_flags = DISKFLAG_DIRECT_COMPLETION; if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) @@ -3276,14 +3278,6 @@ dadone(struct cam_periph *periph, union (lbp->flags & SVPD_LBP_WS10)); dadeleteflag(softc, DA_DELETE_UNMAP, (lbp->flags & SVPD_LBP_UNMAP)); - - if (lbp->flags & SVPD_LBP_UNMAP) { - free(lbp, M_SCSIDA); - xpt_release_ccb(done_ccb); - softc->state = DA_STATE_PROBE_BLK_LIMITS; - xpt_schedule(periph, priority); - return; - } } else { int error; error = daerror(done_ccb, CAM_RETRY_SELTO, @@ -3309,7 +3303,7 @@ dadone(struct cam_periph *periph, union free(lbp, M_SCSIDA); xpt_release_ccb(done_ccb); - softc->state = DA_STATE_PROBE_BDC; + softc->state = DA_STATE_PROBE_BLK_LIMITS; xpt_schedule(periph, priority); return; } @@ -3320,12 +3314,20 @@ dadone(struct cam_periph *periph, union block_limits = (struct scsi_vpd_block_limits *)csio->data_ptr; if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { + uint32_t max_txfer_len = scsi_4btoul( + block_limits->max_txfer_len); uint32_t max_unmap_lba_cnt = scsi_4btoul( block_limits->max_unmap_lba_cnt); uint32_t max_unmap_blk_cnt = scsi_4btoul( block_limits->max_unmap_blk_cnt); uint64_t ws_max_blks = scsi_8btou64( block_limits->max_write_same_length); + + if (max_txfer_len != 0) { + softc->disk->d_maxsize = MIN(softc->maxio, + (off_t)max_txfer_len * softc->params.secsize); + } + /* * We should already support UNMAP but we check lba * and block count to be sure From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 19:54:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5A8D568 for ; Wed, 30 Apr 2014 19:54:18 +0000 (UTC) Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com [209.85.192.179]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A54171035 for ; Wed, 30 Apr 2014 19:54:18 +0000 (UTC) Received: by mail-pd0-f179.google.com with SMTP id y10so2203674pdj.38 for ; Wed, 30 Apr 2014 12:54:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=PkHydebOy368LXR8T8eaKGQ7ODEqFwSnqRbWViNvJJ4=; b=BHB6FbtapO1ZOqqMJnAP3u7g1c2/ysVuTZOg01LYVgT3HQuByF0jLrrUqP09Z2vmXC S4rj1lJw0/SdYBhXNDK7Q2HCciBuFKbMqC/M7+nabsElnl/p575JOi/Z8RItDtAMt8Rs v/H8W2ecLOSC/OtaMiL1q958DfMTNeb8wfzPeHga8gagYk98FE8ac8mYJGz54AFnea79 5+WOVASoD1c8SF4A/yHytCQ8DdLsgo3mTqXwKOjKPs3DziAwg2AWSzYnfPWY8MMoEkmc mTQHCqokrJgY3oPNj8v1miJy24SLuse9TX5354Uojtc22frzktJLzdT1tVjGKbBjmOVM gLyw== X-Gm-Message-State: ALoCoQmCkcUb041LBu5xPnjb1GgtHowxJSUA4zIxabwHMkLl5lHoU4SaMTQLc2pOZMOFGXuhhV2E X-Received: by 10.66.177.168 with SMTP id cr8mr12209540pac.128.1398887651956; Wed, 30 Apr 2014 12:54:11 -0700 (PDT) Received: from macintosh-3c0754232d17.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id xr9sm141853978pab.5.2014.04.30.12.54.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Apr 2014 12:54:11 -0700 (PDT) Sender: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null From: Warner Losh In-Reply-To: <1398878008.22079.67.camel@revolution.hippie.lan> Date: Wed, 30 Apr 2014 13:54:09 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201404300620.s3U6Kmn6074492@svn.freebsd.org> <1398869319.22079.54.camel@revolution.hippie.lan> <1398878008.22079.67.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@FreeBSD.org, Eitan Adler , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Steven Hartland X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 19:54:19 -0000 On Apr 30, 2014, at 11:13 AM, Ian Lepore wrote: > On Wed, 2014-04-30 at 17:22 +0100, Steven Hartland wrote: >> ----- Original Message -----=20 >> From: "Ian Lepore" >> To: "Eitan Adler" >> Cc: ; ; = >> Sent: Wednesday, April 30, 2014 3:48 PM >> Subject: Re: svn commit: r265132 - in head: share/man/man4 = sys/dev/null >>=20 >>=20 >>> On Wed, 2014-04-30 at 06:20 +0000, Eitan Adler wrote: >>>> Author: eadler >>>> Date: Wed Apr 30 06:20:48 2014 >>>> New Revision: 265132 >>>> URL: http://svnweb.freebsd.org/changeset/base/265132 >>>>=20 >>>> Log: >>>> Add a /dev/full device. >>>>=20 >>>> /dev/full is similar to /dev/zero except it always returns >>>> ENOSPC when you attempt to write to it. >>>>=20 >>>=20 >>> For some reason this reminded me of something I've been wanting for = a >>> while but never get around to writing... /dev/ones, it's just >>> like /dev/zero except it returns 0xff bytes. Useful for dd'ing to = wipe >>> out flash-based media. >>=20 >> Surely for that you want camcontrol security ...? >>=20 >> Regards >> Steve >=20 > I have no idea what that is, but given that it has "security" in the > name, it's almost certainly NOT what I want in any way shape or form. > Shocking as it may be, some people are just not obsessed with = security, > for good reason. It just isn't a consideration in any way in my day = to > day activities. =20 >=20 > When I want to make an sdcard, or some portion thereof, look > empty/virgin/new-from-factory for testing on an embedded system, that > has nothing to do with security, and everything to do with just = exactly > what I asked for: something that writes all-ones-bits. >=20 > Besides, cam and sdcards don't play in the same sandboxes. You likely want some variation of the SATA secure erase command, which = despite having the name =91secure=92 in it really is a =91erase all = contents of this drive and reinitialize to factory defaults=92. Warner= From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 20:47:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14FBD3B2; Wed, 30 Apr 2014 20:47:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 030B91526; Wed, 30 Apr 2014 20:47:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3UKleRS043474; Wed, 30 Apr 2014 20:47:40 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3UKlevx043472; Wed, 30 Apr 2014 20:47:40 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404302047.s3UKlevx043472@svn.freebsd.org> From: Warner Losh Date: Wed, 30 Apr 2014 20:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265162 - in head: . sys/tools/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 20:47:41 -0000 Author: imp Date: Wed Apr 30 20:47:40 2014 New Revision: 265162 URL: http://svnweb.freebsd.org/changeset/base/265162 Log: Turns out this .if evaluated not in the context of the makedtb target sometimes due to Makefile expansion rules. Make the test for things being NULL elsewhere... Modified: head/Makefile.inc1 head/sys/tools/fdt/make_dtb.sh (contents, props changed) Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Apr 30 20:46:52 2014 (r265161) +++ head/Makefile.inc1 Wed Apr 30 20:47:40 2014 (r265162) @@ -1830,9 +1830,6 @@ DTBOUTPUTPATH= ${.CURDIR} # Build 'standalone' Device Tree Blob # builddtb: -.if !defined(FDT_DTS_FILE) -.error "FDT_DTS_FILE must be specified!" -.endif @PATH=${TMPPATH} MACHINE=${TARGET} \ ${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \ "${FDT_DTS_FILE}" ${DTBOUTPUTPATH} Modified: head/sys/tools/fdt/make_dtb.sh ============================================================================== --- head/sys/tools/fdt/make_dtb.sh Wed Apr 30 20:46:52 2014 (r265161) +++ head/sys/tools/fdt/make_dtb.sh Wed Apr 30 20:47:40 2014 (r265162) @@ -7,6 +7,11 @@ S=$1 dts="$2" dtb_path=$3 +if [ -n "$dts" ]; then + echo "No DTS specified" + exit 1 +fi + for d in ${dts}; do dtb=${dtb_path}/`basename $d .dts`.dtb echo "converting $d -> $dtb" From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 20:52:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D584959C; Wed, 30 Apr 2014 20:52:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C35BD15D8; Wed, 30 Apr 2014 20:52:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3UKqcxi047040; Wed, 30 Apr 2014 20:52:38 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3UKqcY0047039; Wed, 30 Apr 2014 20:52:38 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404302052.s3UKqcY0047039@svn.freebsd.org> From: Warner Losh Date: Wed, 30 Apr 2014 20:52:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265163 - head/sys/tools/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 20:52:38 -0000 Author: imp Date: Wed Apr 30 20:52:38 2014 New Revision: 265163 URL: http://svnweb.freebsd.org/changeset/base/265163 Log: Fix logic error. Submitted by: ian@ Modified: head/sys/tools/fdt/make_dtb.sh (contents, props changed) Modified: head/sys/tools/fdt/make_dtb.sh ============================================================================== --- head/sys/tools/fdt/make_dtb.sh Wed Apr 30 20:47:40 2014 (r265162) +++ head/sys/tools/fdt/make_dtb.sh Wed Apr 30 20:52:38 2014 (r265163) @@ -7,7 +7,7 @@ S=$1 dts="$2" dtb_path=$3 -if [ -n "$dts" ]; then +if [ -z "$dts" ]; then echo "No DTS specified" exit 1 fi From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 21:10:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5843BC55; Wed, 30 Apr 2014 21:10:32 +0000 (UTC) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E88716EE; Wed, 30 Apr 2014 21:10:32 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id DD864B805F; Wed, 30 Apr 2014 23:10:28 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id CBEAD28497; Wed, 30 Apr 2014 23:10:28 +0200 (CEST) Date: Wed, 30 Apr 2014 23:10:28 +0200 From: Jilles Tjoelker To: "Pedro F. Giffuni" Subject: Re: svn commit: r265095 - head/lib/libc/locale Message-ID: <20140430211028.GA61757@stack.nl> References: <201404291525.s3TFPvmt097589@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201404291525.s3TFPvmt097589@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 21:10:32 -0000 On Tue, Apr 29, 2014 at 03:25:57PM +0000, Pedro F. Giffuni wrote: > Author: pfg > Date: Tue Apr 29 15:25:57 2014 > New Revision: 265095 > URL: http://svnweb.freebsd.org/changeset/base/265095 > Log: > citrus: Avoid invalid code points. > > From the OpenBSD log: > The UTF-8 decoder should not accept byte sequences which decode to unicode > code positions U+D800 to U+DFFF (UTF-16 surrogates), U+FFFE, and U+FFFF. > http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 > http://unicode.org/faq/utf_bom.html#utf8-4 > Reported by: Stefan Sperling > Obtained from: OpenBSD > MFC after: 5 days > Modified: > head/lib/libc/locale/utf8.c > Modified: head/lib/libc/locale/utf8.c > ============================================================================== > --- head/lib/libc/locale/utf8.c Tue Apr 29 15:12:23 2014 (r265094) > +++ head/lib/libc/locale/utf8.c Tue Apr 29 15:25:57 2014 (r265095) > @@ -203,6 +203,14 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, > errno = EILSEQ; > return ((size_t)-1); > } > + if ((wch >= 0xd800 && wch <= 0xdfff) || > + wch == 0xfffe || wch == 0xffff) { > + /* > + * Malformed input; invalid code points. > + */ > + errno = EILSEQ; > + return ((size_t)-1); > + } > if (pwc != NULL) > *pwc = wch; > us->want = 0; Hmm, I think U+FFFE and U+FFFF should be passed through normally. According to http://www.unicode.org/faq/private_use.html they are "noncharacters" (basically a more private variant of private-use characters) and must be mapped through UTFs. The part that rejects U+D800 to U+DFFF is definitely correct, though. http://unicode.org/faq/utf_bom.html#utf8-4 tells to do only that. The part about U+FFFE and U+FFFF in http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 seems out of date. Note the last modified date of that page: 2009-05-11. On another note, everything above U+0010FFFF should perhaps be rejected since those codes, which cannot be encoded in UTF-16, were excluded from Unicode and ISO 10646. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 21:19:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A95B9D8; Wed, 30 Apr 2014 21:19:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A56C17D3; Wed, 30 Apr 2014 21:19:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3ULJkOG056842; Wed, 30 Apr 2014 21:19:46 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3ULJkRI056841; Wed, 30 Apr 2014 21:19:46 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201404302119.s3ULJkRI056841@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 30 Apr 2014 21:19:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265164 - head/sbin/newfs_msdos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 21:19:46 -0000 Author: pfg Date: Wed Apr 30 21:19:46 2014 New Revision: 265164 URL: http://svnweb.freebsd.org/changeset/base/265164 Log: Small cleanup: mostly whitespace vs. tabs. Modified: head/sbin/newfs_msdos/newfs_msdos.c Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Wed Apr 30 20:52:38 2014 (r265163) +++ head/sbin/newfs_msdos/newfs_msdos.c Wed Apr 30 21:19:46 2014 (r265164) @@ -51,50 +51,50 @@ static const char rcsid[] = #include #include -#define MAXU16 0xffff /* maximum unsigned 16-bit quantity */ -#define BPN 4 /* bits per nibble */ -#define NPB 2 /* nibbles per byte */ - -#define DOSMAGIC 0xaa55 /* DOS magic number */ -#define MINBPS 512 /* minimum bytes per sector */ -#define MAXSPC 128 /* maximum sectors per cluster */ -#define MAXNFT 16 /* maximum number of FATs */ -#define DEFBLK 4096 /* default block size */ -#define DEFBLK16 2048 /* default block size FAT16 */ -#define DEFRDE 512 /* default root directory entries */ -#define RESFTE 2 /* reserved FAT entries */ -#define MINCLS12 1U /* minimum FAT12 clusters */ -#define MINCLS16 0xff5U /* minimum FAT16 clusters */ -#define MINCLS32 0xfff5U /* minimum FAT32 clusters */ -#define MAXCLS12 0xff4U /* maximum FAT12 clusters */ -#define MAXCLS16 0xfff4U /* maximum FAT16 clusters */ -#define MAXCLS32 0xffffff4U /* maximum FAT32 clusters */ +#define MAXU16 0xffff /* maximum unsigned 16-bit quantity */ +#define BPN 4 /* bits per nibble */ +#define NPB 2 /* nibbles per byte */ + +#define DOSMAGIC 0xaa55 /* DOS magic number */ +#define MINBPS 512 /* minimum bytes per sector */ +#define MAXSPC 128 /* maximum sectors per cluster */ +#define MAXNFT 16 /* maximum number of FATs */ +#define DEFBLK 4096 /* default block size */ +#define DEFBLK16 2048 /* default block size FAT16 */ +#define DEFRDE 512 /* default root directory entries */ +#define RESFTE 2 /* reserved FAT entries */ +#define MINCLS12 1U /* minimum FAT12 clusters */ +#define MINCLS16 0xff5U /* minimum FAT16 clusters */ +#define MINCLS32 0xfff5U /* minimum FAT32 clusters */ +#define MAXCLS12 0xff4U /* maximum FAT12 clusters */ +#define MAXCLS16 0xfff4U /* maximum FAT16 clusters */ +#define MAXCLS32 0xffffff4U /* maximum FAT32 clusters */ -#define mincls(fat) ((fat) == 12 ? MINCLS12 : \ +#define mincls(fat) ((fat) == 12 ? MINCLS12 : \ (fat) == 16 ? MINCLS16 : \ MINCLS32) -#define maxcls(fat) ((fat) == 12 ? MAXCLS12 : \ +#define maxcls(fat) ((fat) == 12 ? MAXCLS12 : \ (fat) == 16 ? MAXCLS16 : \ MAXCLS32) -#define mk1(p, x) \ +#define mk1(p, x) \ (p) = (u_int8_t)(x) -#define mk2(p, x) \ +#define mk2(p, x) \ (p)[0] = (u_int8_t)(x), \ (p)[1] = (u_int8_t)((x) >> 010) -#define mk4(p, x) \ +#define mk4(p, x) \ (p)[0] = (u_int8_t)(x), \ (p)[1] = (u_int8_t)((x) >> 010), \ (p)[2] = (u_int8_t)((x) >> 020), \ (p)[3] = (u_int8_t)((x) >> 030) -#define argto1(arg, lo, msg) argtou(arg, lo, 0xff, msg) -#define argto2(arg, lo, msg) argtou(arg, lo, 0xffff, msg) -#define argto4(arg, lo, msg) argtou(arg, lo, 0xffffffff, msg) -#define argtox(arg, lo, msg) argtou(arg, lo, UINT_MAX, msg) +#define argto1(arg, lo, msg) argtou(arg, lo, 0xff, msg) +#define argto2(arg, lo, msg) argtou(arg, lo, 0xffff, msg) +#define argto4(arg, lo, msg) argtou(arg, lo, 0xffffffff, msg) +#define argtox(arg, lo, msg) argtou(arg, lo, UINT_MAX, msg) struct bs { u_int8_t bsJump[3]; /* bootstrap entry point */ @@ -131,7 +131,7 @@ struct bsx { u_int8_t exReserved1; /* reserved */ u_int8_t exBootSignature; /* extended boot signature */ u_int8_t exVolumeID[4]; /* volume ID number */ - u_int8_t exVolumeLabel[11]; /* volume label */ + u_int8_t exVolumeLabel[11]; /* volume label */ u_int8_t exFileSysType[8]; /* file system type */ } __packed; @@ -164,7 +164,7 @@ struct bpb { u_int bpbBackup; /* backup boot sector */ }; -#define BPBGAP 0, 0, 0, 0, 0, 0 +#define BPBGAP 0, 0, 0, 0, 0, 0 static struct { const char *name; @@ -174,10 +174,10 @@ static struct { {"180", {512, 1, 1, 2, 64, 360, 0xfc, 2, 9, 1, BPBGAP}}, {"320", {512, 2, 1, 2, 112, 640, 0xff, 1, 8, 2, BPBGAP}}, {"360", {512, 2, 1, 2, 112, 720, 0xfd, 2, 9, 2, BPBGAP}}, - {"640", {512, 2, 1, 2, 112, 1280, 0xfb, 2, 8, 2, BPBGAP}}, + {"640", {512, 2, 1, 2, 112, 1280, 0xfb, 2, 8, 2, BPBGAP}}, {"720", {512, 2, 1, 2, 112, 1440, 0xf9, 3, 9, 2, BPBGAP}}, {"1200", {512, 1, 1, 2, 224, 2400, 0xf9, 7, 15, 2, BPBGAP}}, - {"1232", {1024,1, 1, 2, 192, 1232, 0xfe, 2, 8, 2, BPBGAP}}, + {"1232", {1024,1, 1, 2, 192, 1232, 0xfe, 2, 8, 2, BPBGAP}}, {"1440", {512, 1, 1, 2, 224, 2880, 0xf0, 9, 18, 2, BPBGAP}}, {"2880", {512, 2, 1, 2, 240, 5760, 0xf0, 9, 36, 2, BPBGAP}} }; @@ -1029,7 +1029,7 @@ usage(void) fprintf(stderr, "usage: newfs_msdos [ -options ] special [disktype]\n" "where the options are:\n" - "\t-@ create file system at specified offset\n" + "\t-@ create file system at specified offset\n" "\t-B get bootstrap from file\n" "\t-C create image file with specified size\n" "\t-F FAT type (12, 16, or 32)\n" From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 21:43:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2717DC60 for ; Wed, 30 Apr 2014 21:43:27 +0000 (UTC) Received: from nm29-vm1.bullet.mail.bf1.yahoo.com (nm29-vm1.bullet.mail.bf1.yahoo.com [98.139.213.144]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA0381A76 for ; Wed, 30 Apr 2014 21:43:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1398894197; bh=pJ9bKVekZcMTun7ugqyw1RDm0XfoAoDDJ6amByqGxtg=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=gkEqBK2F0DC/r+uGAHZbZDzJY4tU2vtvgkc78fFRKt6+VKsNlUyd8wMxQaur5yH0OoZr4OO3nwt138JVIRtebJbo7A9Do3x825dw416l/tIHXUUMFD5yhTXquhSO8d1dDpygcfSgXIGR5Mf8Lwpd//Ekcgif38knctYTv5kXKD559jIK3Yn6qKSKcXHaUrsC9/q0gY6y58k/9rmy3BqUHozyvUZptjnL2x8E6urw1GtibFlwAXd4BhLA/O/zEjI18ZpKdQiKYpd2NqdoqhN4MpWgDq4VAyAo4rBB3HUu+/8r2df3cYPYKtRQPIxiMbNzFVWDre4YU3O5vsSiRPGgQA== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=fgrrmMgiuUTEkyQGzBjAxRrBwozFBYCIBEwTCu2M9zm/44KVzQsx8FKWKj+4dBIjQpunPArasGe0YHntYHTmN21jjvWq1Z9sAdHcHTQVdxsR/WiKxB02vwf0yVTzOEzmn3TCRYA1JeDoUbLzqIUqlSeHNEJHkCVknY27G+Z7uSO2RDj54MGunalxhgYL5BHD2g4Ll9m8VQVkv+P9htv7wg4FnedH2x+bjhmgIYbYoqYtbYii+b3AJKZDGP9pQcjGLM0Ldz6eSFJf/ralRZH2WtqCaEUU6FECKHYQuFbxjf24vyjVedZynfmIMsYsiTfdS984d2/ZHjWFBrruS3jlWg==; Received: from [66.196.81.171] by nm29.bullet.mail.bf1.yahoo.com with NNFMP; 30 Apr 2014 21:43:17 -0000 Received: from [98.139.213.10] by tm17.bullet.mail.bf1.yahoo.com with NNFMP; 30 Apr 2014 21:43:17 -0000 Received: from [127.0.0.1] by smtp110.mail.bf1.yahoo.com with NNFMP; 30 Apr 2014 21:43:17 -0000 X-Yahoo-Newman-Id: 885846.190.bm@smtp110.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: w.qUspoVM1kPmjjJ5BGQv1l1yYXtUYgXt0muA4yQY.XZJdD 1u8gnpNeyagxHaeDGEQGDMBSg1IxhQb7E8RXpoH5WdAx1szzXKZcyEyfb21T Fsfk_WuTzBLU.3PEAls1mEKK_I2LTCrYneSC82dCZUCisf1RRbjtpxDY8Wpt hTxa6aBAaAyHrMLbVZJu8_iT2vTdrldhrA9CpGzXfzd_n3RcBHGbJ.JRgn2M ZKmNiMsd1pBuii_GxJ6m2TF2W0POcXB3Gnm8v5r91y4vyH_M0vFlkbV7StqX 0bHupEjMeU19brRcdTUXOSUQ_xQVNpfqLhDc9WEHqYbU8gqwPPXxpwiiIfDv _KXXaMcFAtUh2tLxC.8eb64wuntdWzjOP48s3EWc3Npn.4cbP9pO1Qgvk__j 0SAgfOmXEuTr6rwzDKDDx4bg4H7vUi.JEI.mMRq.lPdwK80zIzSu0IoPncW7 11yMia945zpcW5lQLnhSTJeYQfn.4fVmjVyZ4iER7TK_8Ql8Yf1MXxM1aecT BrScchiZ0uQ8xWCosdF0L7q8fXmd6VokUHUIvGjnlTjZ6dsnLeAyYWgPmxdh 04RIAennG5hPO85osrVzp8TCNN1nzJN6BXlXsv_Q2QdWHcTks1m88udpF250 Cu.46DkklX73d4DNfNyu0YaA2e.jTVAY0ShMhZnksMp2luz3.ZCT6t4Js2ma sLpP9L7mAKqILTvus5svy9wKOdTl_BcktgWRRtkzS_oyTWYKmfNtvJAFB3IK CEigTenT0JMKx3g-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain [63.250.193.228]) by smtp110.mail.bf1.yahoo.com with SMTP; 30 Apr 2014 14:43:17 -0700 PDT Message-ID: <53616E78.3010301@freebsd.org> Date: Wed, 30 Apr 2014 16:43:20 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Jilles Tjoelker Subject: Re: svn commit: r265095 - head/lib/libc/locale References: <201404291525.s3TFPvmt097589@svn.freebsd.org> <20140430211028.GA61757@stack.nl> In-Reply-To: <20140430211028.GA61757@stack.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 21:43:27 -0000 On 04/30/14 16:10, Jilles Tjoelker wrote: > On Tue, Apr 29, 2014 at 03:25:57PM +0000, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Tue Apr 29 15:25:57 2014 >> New Revision: 265095 >> URL: http://svnweb.freebsd.org/changeset/base/265095 >> Log: >> citrus: Avoid invalid code points. >> >> From the OpenBSD log: >> The UTF-8 decoder should not accept byte sequences which decode to unicode >> code positions U+D800 to U+DFFF (UTF-16 surrogates), U+FFFE, and U+FFFF. >> http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 >> http://unicode.org/faq/utf_bom.html#utf8-4 >> Reported by: Stefan Sperling >> Obtained from: OpenBSD >> MFC after: 5 days >> Modified: >> head/lib/libc/locale/utf8.c >> Modified: head/lib/libc/locale/utf8.c >> ============================================================================== >> --- head/lib/libc/locale/utf8.c Tue Apr 29 15:12:23 2014 (r265094) >> +++ head/lib/libc/locale/utf8.c Tue Apr 29 15:25:57 2014 (r265095) >> @@ -203,6 +203,14 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, >> errno = EILSEQ; >> return ((size_t)-1); >> } >> + if ((wch >= 0xd800 && wch <= 0xdfff) || >> + wch == 0xfffe || wch == 0xffff) { >> + /* >> + * Malformed input; invalid code points. >> + */ >> + errno = EILSEQ; >> + return ((size_t)-1); >> + } >> if (pwc != NULL) >> *pwc = wch; >> us->want = 0; > Hmm, I think U+FFFE and U+FFFF should be passed through normally. > According to http://www.unicode.org/faq/private_use.html they are > "noncharacters" (basically a more private variant of private-use > characters) and must be mapped through UTFs. > > The part that rejects U+D800 to U+DFFF is definitely correct, though. > http://unicode.org/faq/utf_bom.html#utf8-4 tells to do only that. > > The part about U+FFFE and U+FFFF in > http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 seems out of date. > Note the last modified date of that page: 2009-05-11. > > On another note, everything above U+0010FFFF should perhaps be rejected > since those codes, which cannot be encoded in UTF-16, were excluded from > Unicode and ISO 10646. > Thank you! I will fix soon the UTF-8 part. Pedro. From owner-svn-src-head@FreeBSD.ORG Wed Apr 30 23:56:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95CBB78E; Wed, 30 Apr 2014 23:56:26 +0000 (UTC) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1827F16FC; Wed, 30 Apr 2014 23:56:25 +0000 (UTC) Received: from ur.dons.net.au (ppp121-45-78-209.lns20.adl6.internode.on.net [121.45.78.209]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id s3UNu7Lq021956 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 1 May 2014 09:26:14 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Content-Type: multipart/signed; boundary="Apple-Mail=_3B7802D0-AFEB-4D51-B32A-A00ED205CD95"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null From: "Daniel O'Connor" In-Reply-To: <1398869319.22079.54.camel@revolution.hippie.lan> Date: Thu, 1 May 2014 09:26:05 +0930 Message-Id: <68DC39CD-BB33-46CA-A7CF-51B7D568009E@gsoft.com.au> References: <201404300620.s3U6Kmn6074492@svn.freebsd.org> <1398869319.22079.54.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1874) X-Spam-Score: 0.163 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2014 23:56:26 -0000 --Apple-Mail=_3B7802D0-AFEB-4D51-B32A-A00ED205CD95 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 1 May 2014, at 0:18, Ian Lepore wrote: >> /dev/full is similar to /dev/zero except it always returns >> ENOSPC when you attempt to write to it. >> > > For some reason this reminded me of something I've been wanting for a > while but never get around to writing... /dev/ones, it's just > like /dev/zero except it returns 0xff bytes. Useful for dd'ing to wipe > out flash-based media. http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/79421 :) -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C --Apple-Mail=_3B7802D0-AFEB-4D51-B32A-A00ED205CD95 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iD8DBQFTYY2V5ZPcIHs/zowRAqjQAJ45pd5FXaieFtpZK8TJCmnR2g/YKACdGLOP NcJAxtDbBWEQdZd4uULAA9k= =5HSn -----END PGP SIGNATURE----- --Apple-Mail=_3B7802D0-AFEB-4D51-B32A-A00ED205CD95-- From owner-svn-src-head@FreeBSD.ORG Thu May 1 00:12:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 881659F0; Thu, 1 May 2014 00:12:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B2BB1865; Thu, 1 May 2014 00:12:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s410CPPh031010; Thu, 1 May 2014 00:12:25 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s410CPpX031008; Thu, 1 May 2014 00:12:25 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201405010012.s410CPpX031008@svn.freebsd.org> From: Peter Grehan Date: Thu, 1 May 2014 00:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265165 - head/sys/boot/userboot/userboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 00:12:25 -0000 Author: grehan Date: Thu May 1 00:12:24 2014 New Revision: 265165 URL: http://svnweb.freebsd.org/changeset/base/265165 Log: Provide an alias for the userboot console and name it 'comconsole'. This allows existing loader.conf files that set "console=comconsole" to work without failing. No functional difference otherwise. Reported by: Michael Dexter, pfSense install. Reviewed by: neel MFC after: 3 weeks Modified: head/sys/boot/userboot/userboot/conf.c head/sys/boot/userboot/userboot/userboot_cons.c Modified: head/sys/boot/userboot/userboot/conf.c ============================================================================== --- head/sys/boot/userboot/userboot/conf.c Wed Apr 30 21:19:46 2014 (r265164) +++ head/sys/boot/userboot/userboot/conf.c Thu May 1 00:12:24 2014 (r265165) @@ -97,8 +97,10 @@ struct file_format *file_formats[] = { * data structures from bootstrap.h as well. */ extern struct console userboot_console; +extern struct console userboot_comconsole; struct console *consoles[] = { &userboot_console, + &userboot_comconsole, NULL }; Modified: head/sys/boot/userboot/userboot/userboot_cons.c ============================================================================== --- head/sys/boot/userboot/userboot/userboot_cons.c Wed Apr 30 21:19:46 2014 (r265164) +++ head/sys/boot/userboot/userboot/userboot_cons.c Thu May 1 00:12:24 2014 (r265165) @@ -33,8 +33,12 @@ __FBSDID("$FreeBSD$"); int console; +static struct console *userboot_comconsp; + static void userboot_cons_probe(struct console *cp); static int userboot_cons_init(int); +static void userboot_comcons_probe(struct console *cp); +static int userboot_comcons_init(int); static void userboot_cons_putchar(int); static int userboot_cons_getchar(void); static int userboot_cons_poll(void); @@ -50,6 +54,21 @@ struct console userboot_console = { userboot_cons_poll, }; +/* + * Provide a simple alias to allow loader scripts to set the + * console to comconsole without resulting in an error + */ +struct console userboot_comconsole = { + "comconsole", + "comconsole", + 0, + userboot_comcons_probe, + userboot_comcons_init, + userboot_cons_putchar, + userboot_cons_getchar, + userboot_cons_poll, +}; + static void userboot_cons_probe(struct console *cp) { @@ -65,6 +84,31 @@ userboot_cons_init(int arg) } static void +userboot_comcons_probe(struct console *cp) +{ + + /* + * Save the console pointer so the comcons_init routine + * can set the C_PRESENT* flags. They are not set + * here to allow the existing userboot console to + * be elected the default. + */ + userboot_comconsp = cp; +} + +static int +userboot_comcons_init(int arg) +{ + + /* + * Set the C_PRESENT* flags to allow the comconsole + * to be selected as the active console + */ + userboot_comconsp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); + return (0); +} + +static void userboot_cons_putchar(int c) { From owner-svn-src-head@FreeBSD.ORG Thu May 1 01:42:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11EB2B56; Thu, 1 May 2014 01:42:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0003010A1; Thu, 1 May 2014 01:42:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s411gmQ3068252; Thu, 1 May 2014 01:42:48 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s411gm8F068251; Thu, 1 May 2014 01:42:48 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405010142.s411gm8F068251@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 1 May 2014 01:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265167 - head/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 01:42:49 -0000 Author: pfg Date: Thu May 1 01:42:48 2014 New Revision: 265167 URL: http://svnweb.freebsd.org/changeset/base/265167 Log: citrus: Avoid invalid code points. From the OpenBSD log: The UTF-8 decoder should not accept byte sequences which decode to unicode code positions U+D800 to U+DFFF (UTF-16 surrogates), U+FFFE, and U+FFFF. http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 http://unicode.org/faq/utf_bom.html#utf8-4 Reported by: Stefan Sperling Obtained from: OpenBSD MFC after: 5 days Modified: head/lib/libc/locale/utf8.c Modified: head/lib/libc/locale/utf8.c ============================================================================== --- head/lib/libc/locale/utf8.c Thu May 1 00:31:19 2014 (r265166) +++ head/lib/libc/locale/utf8.c Thu May 1 01:42:48 2014 (r265167) @@ -203,8 +203,7 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, errno = EILSEQ; return ((size_t)-1); } - if ((wch >= 0xd800 && wch <= 0xdfff) || - wch == 0xfffe || wch == 0xffff) { + if (wch >= 0xd800 && wch <= 0xdfff) { /* * Malformed input; invalid code points. */ From owner-svn-src-head@FreeBSD.ORG Thu May 1 02:00:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 050DDF52; Thu, 1 May 2014 02:00:09 +0000 (UTC) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id B235B1191; Thu, 1 May 2014 02:00:07 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id EE598422D3B; Thu, 1 May 2014 11:59:59 +1000 (EST) Date: Thu, 1 May 2014 11:59:56 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Matthew Fleming Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null In-Reply-To: Message-ID: <20140501094737.J1261@besplex.bde.org> References: <201404300620.s3U6Kmn6074492@svn.freebsd.org> <1398869319.22079.54.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eojmkOZX c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=BuGJK2ebvAQA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=nHynIu3us5LNPkm6OCcA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Eitan Adler , Ian Lepore X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 02:00:09 -0000 On Wed, 30 Apr 2014, Matthew Fleming wrote: > On Wed, Apr 30, 2014 at 7:48 AM, Ian Lepore wrote: >> For some reason this reminded me of something I've been wanting for a >> while but never get around to writing... /dev/ones, it's just >> like /dev/zero except it returns 0xff bytes. Useful for dd'ing to wipe >> out flash-based media. > > dd if=/dev/zero | tr "\000" "\377" | dd of= Why all these processes and i/o's? tr But it's not quite the same. It is better, since it is not limited to 0xff bytes :-). Oops, perhaps not. tr not only uses stdio to pessimize the i/o; it uses wide characters 1 at a time. It used to use only characters 1 at a time. yes(1) is limited to newline bytes, or newlines mixed with strings. It also uses stdio to pessimize the i/o, but not wide characters yet. stdio's pessimizations begin with naively believing that st_blksize gives a good i/o size. For most non-regular files, including all (?) devices and all (?) pipes, st_blksize is PAGE_SIZE. For disks, this has been broken signficantly since FreeBSD-4 where it was the disk's si_bsize_best (usually 64K). For pipes, this has been broken significantly since FreeBSD-4 where it was pipe_buffer.size (either PIPE_SIZE = 16K or BIG_PIPE_SIZE = 64K). So standard utilities tend to be too slow to use on disks. You have to use dd and relatively complicated pipelines to get adequate block sizes. Sometimes dd or a special utility is needed to get adequate control and error handling. I have such a special utility for copying disks with bad sectors, but prefer to use just cp fpr copying disks. cp doesn't use stdio, and doesn't use mmap() above certain small size; it uses read/write() with a fixed block size of 64K or maybe larger in -current, so it works OK for copying disks. The most broken utilities that I use often for disk devices are: - md5. This (really libmd/mdXhl.c) has been broken on all devices (really on all non-regular files) since ~2001. It is broken by misusing st_size instead of by trusting st_blksize. st_size is only valid for regular files, but is used on other file types to break them. For example: pts/21:bde@freefall:~> md5 /dev/null MD5 (/dev/null) = d41d8cd98f00b204e9800998ecf8427e pts/21:bde@freefall:~> md5 /dev/zero MD5 (/dev/zero) = d41d8cd98f00b204e9800998ecf8427e Similarly for disk devices. All devices are seen as empty by md5. The workaround is to use a pipeline, or just stdin. "cat /dev/zero | md5" and even "md5 , but don't seem to use stdio except for bugs like this. The result is that the i/o is especially pessimized for the usual regular file case. Buffering in the kernel limits this pessimization. ) The device file case for cmp just uses getc()/putc(). This first gets the st_blksize pessimization. Then it gets the slow per-char i/o fro using getc()/putc(). For disks, the first pessimizations tends to dominate but the second one is noticeable. For fast input devices it is very noticeable. On freefall now: "dd if=/dev/zero bs=1m count=4k of=/dev/null": speed is 21GB/sec; "dd if=/dev/zero bs=1m count=4k | cmp - /dev/zero": speed is 187MB/sec. The overhead is a factor of 110. With iron disks, the overhead would be a factor of about 1/2. The loop in cmp for regular files is slow too, but only in comparison with the memcpy() that is (essentially) used for reading /dev/zero and with the memcmp() that should be used by cmp. It just compares bytewise and has mounds of bookkeeping to count characters and lines for the rare cases that fail. The usual case should just use mmap() of the whole file (if not read()) and memcmp() on that. I recently noticed a very bad case for cmp on regular files too. I was comparing large files on an cd9600 file system on a DVD, under an old version of FreeBSD. cmp mmap()s the whole file. The i/o for this is done by vm, and vm generated only minimal i/o's with the cd9660 block size of 2K. read() would have done clustering to a block size of 64K. Perhaps vm is better now, but it is hard to see how it could do as well as read() without doing the same clustering as read(). One workaround for this is to prefetch files into the buffer (vmio) cache using read(). It is hard to avoid thrashing of the cache with this, so I used workarounds like diff'ing the files instead of cmp'ing them. diff is much heavier weight, but it runs faster since it doesn't use mmap() (gnu diff seems to use fread() and suffers from stdio using st_blksize). Bruce From owner-svn-src-head@FreeBSD.ORG Thu May 1 02:38:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E3F8925 for ; Thu, 1 May 2014 02:38:55 +0000 (UTC) Received: from nm48-vm4.bullet.mail.bf1.yahoo.com (nm48-vm4.bullet.mail.bf1.yahoo.com [216.109.115.159]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 252B814F4 for ; Thu, 1 May 2014 02:38:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1398911597; bh=cxup5NhuXXpItLs3jdtSMWgh2smEM0/MzzbPvrTOQeQ=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=LYIfXyiYfHvBH58ZFJaq3q+4XD3agQskORXRNNQRMN2uyrkhCigoiuTtDl9Ql7AEbu/q2rPQ3JaV04tl9b/YIGESO3AVueqGczTCPbth+ot6nEcp3bNfjWDY1Fx6tGjgy38FfTjzFg4luKu0Bb80hM5Cmmjn6tVMUB5yNyW/Uf9sRoB7ZuoG4x6VsG3Wxs73s50cSIiiiGDbaphLJOa5brAIxLei/pe0M//rQapVW7w4nJGx04byeWw3vnUuQV5cjX3CGqZxm+67tXTFPBXcBqvAfVD4vduJ+53qh1B7vYxXVb36Av0Kuw8i6I+QOQzQR0kTkNVxiDVJ+ZQ5iF4YYg== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=XIABrPsBd7L2iPEzK8zRvzjbilBFJR65QKAPVibJyvTQL7fmTSYo8JbPiOY28BsMbJRa1qLXDh7v2lDwfrmtz9zRveZxI7NUgTZ7MDUiBlcyCILgHSo32cpQO6O3ov8fx7mT28mNTI6JeNzP6mFIbeCMfcgrSqC30ty6yiSiLqruQ48q4ILMlsHKNRqOenVWNVZlyeRH9LKgeFI3akWu8kjayNvod75DL/CxLhTzvyOBayXzD3ykO7rz9VUrSftmIvJgAxeMaf2uPkk0YcwRzwGWDntPyMf3t/n/72BJCQq0mrtYTlEVg+BuV4RiId/7ORfre3hlTBaLUsljErQ3Sg==; Received: from [66.196.81.173] by nm48.bullet.mail.bf1.yahoo.com with NNFMP; 01 May 2014 02:33:17 -0000 Received: from [98.139.211.160] by tm19.bullet.mail.bf1.yahoo.com with NNFMP; 01 May 2014 02:33:17 -0000 Received: from [127.0.0.1] by smtp217.mail.bf1.yahoo.com with NNFMP; 01 May 2014 02:33:17 -0000 X-Yahoo-Newman-Id: 841877.63910.bm@smtp217.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: GdZAKPgVM1nABkro4LxzJJlE6CSuPnL4395OrfsiWJb1NwV 6sTM5Y4VHSqBHV8tneMMs_6qtfKgJv2vhQl3Km4bJSikYkcqMLoC1tvoh83V 1qe8Lubsy1ielkOL5jX3y9GWY28H4ZeZO4CQJNEFLQ653H.vIgY46td6vTxS UgYWytq6qzOY4QFPD8KKnubfaGRBx9eWFHT1J9WGnRlHlNCyY6qC5uq0RLrH 2YY8pdbBAjmmJAK08vMWB5sDevFMLWcutytJqaGqXfWPXdk3bsmPk5xMYe4A IZoilzoEHzYFD4Jne8sOY3.sPOtLO61RU2qV2a7SUCiyQJzv5OZpRIDzsf7u 3UdOIo9VR6J1xN5_mc4IlO0Miblp7OXz7NEQerW_I8i.JqKqJkXyZ9RJm.Tr OPpRD8E9OSX.F1Sm8JlLadd4j4qjVbulq0amHKLMijPBPnTaRczI4x_Qh7Tv NJM3zxuyR2agTrR7RM2yhBf95kcfzTVZAita4Fz80fXeB1TMCnf6FvcvVWka TB1ynjL91im9VG1W.xn9ogzNCowF7p52elV9O0VpnKNAfYAgEbTbRkq6AR_x mFOfN_yr5DUtGOzu2NqKKwCrefiqPHbzGBskv9HKSua86crE1eHt41vEEvI0 wVwabASUM9gaumzW7dIjoQpx4iLZdKrUT44YIQqLLhFHmWayLq7GWBqwxmwQ 2Hl2w65VpXW.jJMf5a2rgTZ5SUmx0M39xEgddDtv7AywEigUnxJ8rPmAuA_Y IScYcMld_cnDIN6LIgQ-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain [63.250.193.228]) by smtp217.mail.bf1.yahoo.com with SMTP; 30 Apr 2014 19:33:17 -0700 PDT Message-ID: <5361B270.7020609@freebsd.org> Date: Wed, 30 Apr 2014 21:33:20 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, jilles@freebsd.org Subject: Re: svn commit: r265167 - head/lib/libc/locale References: <201405010142.s411gm8F068251@svn.freebsd.org> In-Reply-To: <201405010142.s411gm8F068251@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 02:38:55 -0000 Oops.. wrong log!! Should've been this: _____________ citrus: pass U+FFFE and U+FFFF normally. r265095, based on an OpenBSD change was rejecting U+FFFE and U+FFFF in accordance with outdated documentation. Both values are valid "non-characters" [1] and must be mapped through UTFs. Reference: http://www.unicode.org/faq/private_use.html [1] Reported by: jilles MFC after: 4 days _____________ I will fix it for the MFC. Pedro. On 04/30/14 20:42, Pedro F. Giffuni wrote: > Author: pfg > Date: Thu May 1 01:42:48 2014 > New Revision: 265167 > URL: http://svnweb.freebsd.org/changeset/base/265167 > > Log: > citrus: Avoid invalid code points. > > From the OpenBSD log: > The UTF-8 decoder should not accept byte sequences which decode to unicode > code positions U+D800 to U+DFFF (UTF-16 surrogates), U+FFFE, and U+FFFF. > > http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 > http://unicode.org/faq/utf_bom.html#utf8-4 > > Reported by: Stefan Sperling > Obtained from: OpenBSD > MFC after: 5 days > > Modified: > head/lib/libc/locale/utf8.c > > Modified: head/lib/libc/locale/utf8.c > ============================================================================== > --- head/lib/libc/locale/utf8.c Thu May 1 00:31:19 2014 (r265166) > +++ head/lib/libc/locale/utf8.c Thu May 1 01:42:48 2014 (r265167) > @@ -203,8 +203,7 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, > errno = EILSEQ; > return ((size_t)-1); > } > - if ((wch >= 0xd800 && wch <= 0xdfff) || > - wch == 0xfffe || wch == 0xffff) { > + if (wch >= 0xd800 && wch <= 0xdfff) { > /* > * Malformed input; invalid code points. > */ > From owner-svn-src-head@FreeBSD.ORG Thu May 1 03:24:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D46A63B; Thu, 1 May 2014 03:24:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B19D196F; Thu, 1 May 2014 03:24:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s413OKvG010891; Thu, 1 May 2014 03:24:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s413OKDO010890; Thu, 1 May 2014 03:24:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201405010324.s413OKDO010890@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 1 May 2014 03:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265170 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 03:24:21 -0000 Author: nwhitehorn Date: Thu May 1 03:24:20 2014 New Revision: 265170 URL: http://svnweb.freebsd.org/changeset/base/265170 Log: Add freebsd-boot to recognized partition types. Modified: head/usr.bin/mkimg/apm.c Modified: head/usr.bin/mkimg/apm.c ============================================================================== --- head/usr.bin/mkimg/apm.c Thu May 1 03:18:11 2014 (r265169) +++ head/usr.bin/mkimg/apm.c Thu May 1 03:24:20 2014 (r265170) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); static struct mkimg_alias apm_aliases[] = { { ALIAS_FREEBSD, ALIAS_PTR2TYPE(APM_ENT_TYPE_FREEBSD) }, + { ALIAS_FREEBSD_BOOT, ALIAS_PTR2TYPE(APM_ENT_TYPE_APPLE_BOOT) }, { ALIAS_FREEBSD_NANDFS, ALIAS_PTR2TYPE(APM_ENT_TYPE_FREEBSD_NANDFS) }, { ALIAS_FREEBSD_SWAP, ALIAS_PTR2TYPE(APM_ENT_TYPE_FREEBSD_SWAP) }, { ALIAS_FREEBSD_UFS, ALIAS_PTR2TYPE(APM_ENT_TYPE_FREEBSD_UFS) }, From owner-svn-src-head@FreeBSD.ORG Thu May 1 03:24:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 988D9775; Thu, 1 May 2014 03:24:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 862D81973; Thu, 1 May 2014 03:24:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s413OfF5010959; Thu, 1 May 2014 03:24:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s413OfU4010958; Thu, 1 May 2014 03:24:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201405010324.s413OfU4010958@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 1 May 2014 03:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265171 - head/release/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 03:24:41 -0000 Author: nwhitehorn Date: Thu May 1 03:24:41 2014 New Revision: 265171 URL: http://svnweb.freebsd.org/changeset/base/265171 Log: Use mkimg instead of md(4) and gpart. Modified: head/release/powerpc/make-memstick.sh Modified: head/release/powerpc/make-memstick.sh ============================================================================== --- head/release/powerpc/make-memstick.sh Thu May 1 03:24:20 2014 (r265170) +++ head/release/powerpc/make-memstick.sh Thu May 1 03:24:41 2014 (r265171) @@ -41,38 +41,7 @@ if [ $? -ne 0 ]; then fi rm ${1}/etc/fstab -# -# Use $BLOCKSIZE for transfers to improve efficiency. When calculating -# how many blocks to transfer "+ 2" is to account for truncation in the -# division and to provide space for the label. -# - -filesize=`stat -f "%z" ${tempfile}` -blocks=$(($filesize / ${BLOCKSIZE} + 1728)) -dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks} -if [ $? -ne 0 ]; then - echo "creation of image file failed" - exit 1 -fi - -unit=`mdconfig -a -t vnode -f ${2}` -if [ $? -ne 0 ]; then - echo "mdconfig failed" - exit 1 -fi - -gpart create -s APM ${unit} -gpart add -t freebsd-boot -s 800K ${unit} -gpart bootcode -p ${1}/boot/boot1.hfs -i 1 ${unit} -gpart add -t freebsd-ufs -l FreeBSD_Install ${unit} - -dd if=${tempfile} of=/dev/${unit}s3 bs=$BLOCKSIZE conv=sync -if [ $? -ne 0 ]; then - echo "copying filesystem into image file failed" - exit 1 -fi - -mdconfig -d -u ${unit} +mkimg -s apm -p freebsd-boot:=${1}/boot/boot1.hfs -p freebsd-ufs/FreeBSD_Install:=${tempfile} -o ${2} rm -f ${tempfile} From owner-svn-src-head@FreeBSD.ORG Thu May 1 03:26:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9160D8EE; Thu, 1 May 2014 03:26:41 +0000 (UTC) Received: from mail-yh0-x22f.google.com (mail-yh0-x22f.google.com [IPv6:2607:f8b0:4002:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 275F9198A; Thu, 1 May 2014 03:26:41 +0000 (UTC) Received: by mail-yh0-f47.google.com with SMTP id a41so172389yho.6 for ; Wed, 30 Apr 2014 20:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references; bh=lzRn0y4DqcQguFP6cNga4KB4yx571vYDLhN9dGPfzWw=; b=cFnT4NPN6M/77SQ/Oyke84Z+fIvH1ef5UeZetDQg2/0a2ELZRbpnHusuk1fmeA/2gQ rh1u+0hedJEzKR020+uN6bghvDDtwqQaZSUl0uUTcHc73v77tfkZEziLOh8EeJqPDRd5 OaSQCJsLJSZFQqpuOZB9xzV5OwLZgZaZG7Q7tWR08qlUOfsba7pb7MigcnLasu+5Bk2w e9x58qN9hs335gRnddx7+ML6nx1YorWR1SPyNC3uqGiL4K8Kax7vm5i2tzv55GUzzVG1 d9O4/r/IlI9TyUm2Xf3CJ9yUTCKL07uREm4OXtvp4ULajIbnyoJ2zLQfX5HHfrjQEFnG UM/g== X-Received: by 10.236.134.140 with SMTP id s12mr11344856yhi.138.1398914800365; Wed, 30 Apr 2014 20:26:40 -0700 (PDT) Received: from blackstar.att.net ([2602:306:bdeb:a030:214:51ff:fe7c:7a2f]) by mx.google.com with ESMTPSA id o62sm46579314yha.27.2014.04.30.20.26.39 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 30 Apr 2014 20:26:40 -0700 (PDT) Message-Id: From: Justin Hibbits To: Nathan Whitehorn In-Reply-To: <201405010324.s413OfU4010958@svn.freebsd.org> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: svn commit: r265171 - head/release/powerpc Date: Wed, 30 Apr 2014 20:26:38 -0700 References: <201405010324.s413OfU4010958@svn.freebsd.org> X-Mailer: Apple Mail (2.936) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 03:26:41 -0000 On Apr 30, 2014, at 8:24 PM, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Thu May 1 03:24:41 2014 > New Revision: 265171 > URL: http://svnweb.freebsd.org/changeset/base/265171 > > Log: > Use mkimg instead of md(4) and gpart. > > Modified: > head/release/powerpc/make-memstick.sh > > Modified: head/release/powerpc/make-memstick.sh Does this mean we can 'make release' without root now? Cool! - Justin From owner-svn-src-head@FreeBSD.ORG Thu May 1 04:01:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99B0DE3; Thu, 1 May 2014 04:01:42 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 6DD491CBA; Thu, 1 May 2014 04:01:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 108D13805C; Wed, 30 Apr 2014 23:01:42 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id u4QWuXI0rCYf; Wed, 30 Apr 2014 23:01:42 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 012823805B; Wed, 30 Apr 2014 23:01:40 -0500 (CDT) Message-ID: <5361C723.8060504@freebsd.org> Date: Wed, 30 Apr 2014 21:01:39 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Justin Hibbits Subject: Re: svn commit: r265171 - head/release/powerpc References: <201405010324.s413OfU4010958@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 04:01:42 -0000 On 04/30/14 20:26, Justin Hibbits wrote: > On Apr 30, 2014, at 8:24 PM, Nathan Whitehorn wrote: > >> Author: nwhitehorn >> Date: Thu May 1 03:24:41 2014 >> New Revision: 265171 >> URL: http://svnweb.freebsd.org/changeset/base/265171 >> >> Log: >> Use mkimg instead of md(4) and gpart. >> >> Modified: >> head/release/powerpc/make-memstick.sh >> >> Modified: head/release/powerpc/make-memstick.sh > > Does this mean we can 'make release' without root now? Cool! > > - Justin > Probably? I haven't actually tried. What it certainly means is that you can cross-build all PowerPC install media without kldload'ing geom_part_apm. -Nathan From owner-svn-src-head@FreeBSD.ORG Thu May 1 14:09:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97493AB9; Thu, 1 May 2014 14:09:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 843411029; Thu, 1 May 2014 14:09:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s41E9mWH075018; Thu, 1 May 2014 14:09:48 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s41E9mun075016; Thu, 1 May 2014 14:09:48 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405011409.s41E9mun075016@svn.freebsd.org> From: Luiz Otavio O Souza Date: Thu, 1 May 2014 14:09:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265191 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 14:09:48 -0000 Author: loos Date: Thu May 1 14:09:47 2014 New Revision: 265191 URL: http://svnweb.freebsd.org/changeset/base/265191 Log: Remove unnecessary headers. Sort out the headers. Add a missing header on ofw_gpiobus.c (it was working because of sys/libkern.h). Modified: head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Thu May 1 14:08:19 2014 (r265190) +++ head/sys/dev/gpio/gpiobus.c Thu May 1 14:09:47 2014 (r265191) @@ -28,21 +28,16 @@ __FBSDID("$FreeBSD$"); #include -#include +#include +#include +#include #include #include -#include -#include -#include +#include #include -#include -#include -#include -#include - -#include #include + #include "gpio_if.h" #include "gpiobus_if.h" Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Thu May 1 14:08:19 2014 (r265190) +++ head/sys/dev/gpio/ofw_gpiobus.c Thu May 1 14:09:47 2014 (r265191) @@ -33,17 +33,13 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include -#include +#include #include #include #include -#include - #include "gpio_if.h" #include "gpiobus_if.h" From owner-svn-src-head@FreeBSD.ORG Thu May 1 14:47:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1280BAE0; Thu, 1 May 2014 14:47:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2C78137C; Thu, 1 May 2014 14:47:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s41ElRPa091793; Thu, 1 May 2014 14:47:27 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s41ElRna091791; Thu, 1 May 2014 14:47:27 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405011447.s41ElRna091791@svn.freebsd.org> From: Luiz Otavio O Souza Date: Thu, 1 May 2014 14:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265193 - in head/sys/geom: uncompress uzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 14:47:28 -0000 Author: loos Date: Thu May 1 14:47:27 2014 New Revision: 265193 URL: http://svnweb.freebsd.org/changeset/base/265193 Log: Some style and whitespace fixes. Reduce the difference between geom_uzip(4) and geom_uncompress(4). Now, they produce an almost clean diff(1) output. Remove a duplicated variable from g_uncompress.c and an unnecessary header from g_uzip.c. No functional changes. Modified: head/sys/geom/uncompress/g_uncompress.c head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/uncompress/g_uncompress.c ============================================================================== --- head/sys/geom/uncompress/g_uncompress.c Thu May 1 14:19:14 2014 (r265192) +++ head/sys/geom/uncompress/g_uncompress.c Thu May 1 14:47:27 2014 (r265193) @@ -116,7 +116,7 @@ g_uncompress_softc_free(struct g_uncompr } if (sc->offsets != NULL) { free(sc->offsets, M_GEOM_UNCOMPRESS); - sc->offsets = 0; + sc->offsets = NULL; } switch (sc->type) { @@ -150,6 +150,7 @@ z_alloc(void *nil, u_int type, u_int siz void *ptr; ptr = malloc(type * size, M_GEOM_UNCOMPRESS, M_NOWAIT); + return (ptr); } @@ -221,11 +222,11 @@ g_uncompress_done(struct bio *bp) (intmax_t)bp2->bio_offset, sc->blksz, bsize)); for (i = start_blk; upos < bp2->bio_length; i++) { - off_t len, dlen, ulen, uoff; + off_t len, ulen, uoff; uoff = i == start_blk ? bp2->bio_offset % sc->blksz : 0; ulen = MIN(sc->blksz - uoff, bp2->bio_length - upos); - dlen = len = sc->offsets[i + 1] - sc->offsets[i]; + len = sc->offsets[i + 1] - sc->offsets[i]; DPRINTF(( "%s: done: inflate block %d, start %ju, end %ju len %jd\n", @@ -239,19 +240,17 @@ g_uncompress_done(struct bio *bp) bp2->bio_completed += ulen; continue; } - if (len > iolen) { DPRINTF(("%s: done: early termination: len (%jd) > " "iolen (%jd)\n", gp->name, (intmax_t)len, (intmax_t)iolen)); break; } - mtx_lock(&sc->last_mtx); #ifdef GEOM_UNCOMPRESS_DEBUG if (g_debugflags & 32) - hexdump(bp->bio_data + pos, dlen, 0, 0); + hexdump(bp->bio_data + pos, len, 0, 0); #endif switch (sc->type) { @@ -259,7 +258,7 @@ g_uncompress_done(struct bio *bp) sc->b->in = bp->bio_data + pos; sc->b->out = sc->last_buf; sc->b->in_pos = sc->b->out_pos = 0; - sc->b->in_size = dlen; + sc->b->in_size = len; sc->b->out_size = (size_t)-1; err = (xz_dec_run(sc->s, sc->b) != XZ_STREAM_END) ? @@ -268,7 +267,7 @@ g_uncompress_done(struct bio *bp) break; case GEOM_UZIP: sc->zs->next_in = bp->bio_data + pos; - sc->zs->avail_in = dlen; + sc->zs->avail_in = len; sc->zs->next_out = sc->last_buf; sc->zs->avail_out = sc->blksz; @@ -328,7 +327,6 @@ g_uncompress_start(struct bio *bp) uint32_t start_blk, end_blk; size_t bsize; - pp = bp->bio_to; gp = pp->geom; DPRINTF(("%s: start (%d:%s) to %s off=%jd len=%jd\n", @@ -347,10 +345,8 @@ g_uncompress_start(struct bio *bp) start_blk = bp->bio_offset / sc->blksz; end_blk = howmany(bp->bio_offset + bp->bio_length, sc->blksz); - KASSERT(start_blk < sc->nblocks, - ("start_blk out of range")); - KASSERT(end_blk <= sc->nblocks, - ("end_blk out of range")); + KASSERT(start_blk < sc->nblocks, ("start_blk out of range")); + KASSERT(end_blk <= sc->nblocks, ("end_blk out of range")); sc->req_total++; if (start_blk + 1 == end_blk) { @@ -385,9 +381,7 @@ g_uncompress_start(struct bio *bp) gp->name, start_blk, end_blk, pp->name, pp->sectorsize, (intmax_t)pp->mediasize, pp2->name, pp2->sectorsize, (intmax_t)pp2->mediasize)); - bsize = pp2->sectorsize; - bp2->bio_done = g_uncompress_done; bp2->bio_offset = rounddown(sc->offsets[start_blk], bsize); while (1) { @@ -401,14 +395,12 @@ g_uncompress_start(struct bio *bp) "%s: bio_length (%jd) > MAXPHYS: lowering end_blk to %u\n", gp->name, (intmax_t)bp2->bio_length, end_blk)); } - DPRINTF(("%s: start %jd + %jd -> %ju + %ju -> %jd + %jd\n", gp->name, (intmax_t)bp->bio_offset, (intmax_t)bp->bio_length, (uintmax_t)sc->offsets[start_blk], (uintmax_t)sc->offsets[end_blk] - sc->offsets[start_blk], (intmax_t)bp2->bio_offset, (intmax_t)bp2->bio_length)); - bp2->bio_data = malloc(bp2->bio_length, M_GEOM_UNCOMPRESS, M_NOWAIT); if (bp2->bio_data == NULL) { g_destroy_bio(bp2); @@ -425,8 +417,7 @@ g_uncompress_orphan(struct g_consumer *c { struct g_geom *gp; - g_trace(G_T_TOPOLOGY, "%s(%p/%s)", __func__, cp, - cp->provider->name); + g_trace(G_T_TOPOLOGY, "%s(%p/%s)", __func__, cp, cp->provider->name); g_topology_assert(); gp = cp->geom; @@ -508,15 +499,13 @@ g_uncompress_taste(struct g_class *mp, s */ DPRINTF(("%s: media sectorsize %u, mediasize %jd\n", gp->name, pp->sectorsize, (intmax_t)pp->mediasize)); - i = roundup(sizeof(struct cloop_header), pp->sectorsize); buf = g_read_data(cp, 0, i, NULL); if (buf == NULL) goto err; - header = (struct cloop_header *) buf; if (strncmp(header->magic, CLOOP_MAGIC_START, - sizeof(CLOOP_MAGIC_START) - 1) != 0) { + sizeof(CLOOP_MAGIC_START) - 1) != 0) { DPRINTF(("%s: no CLOOP magic\n", gp->name)); goto err; } @@ -571,7 +560,7 @@ g_uncompress_taste(struct g_class *mp, s free(buf, M_GEOM); i = roundup((sizeof(struct cloop_header) + - total_offsets * sizeof(uint64_t)),pp->sectorsize); + total_offsets * sizeof(uint64_t)), pp->sectorsize); buf = g_read_data(cp, 0, i, NULL); if (buf == NULL) goto err; @@ -581,6 +570,7 @@ g_uncompress_taste(struct g_class *mp, s sc->offsets[i] = be64toh(((uint64_t *) (buf+sizeof(struct cloop_header)))[i]); } + free(buf, M_GEOM); DPRINTF(("%s: done reading offsets\n", gp->name)); mtx_init(&sc->last_mtx, "geom_uncompress cache", NULL, MTX_DEF); sc->last_blk = -1; @@ -615,15 +605,13 @@ g_uncompress_taste(struct g_class *mp, s pp2->stripeoffset = pp->stripeoffset; } g_error_provider(pp2, 0); - free(buf, M_GEOM); g_access(cp, -1, 0, 0); DPRINTF(("%s: taste ok (%d, %jd), (%d, %d), %x\n", gp->name, pp2->sectorsize, (intmax_t)pp2->mediasize, pp2->stripeoffset, pp2->stripesize, pp2->flags)); - printf("%s: %u x %u blocks\n", - gp->name, sc->nblocks, sc->blksz); + printf("%s: %u x %u blocks\n", gp->name, sc->nblocks, sc->blksz); return (gp); err: @@ -638,6 +626,7 @@ err: g_detach(cp); g_destroy_consumer(cp); g_destroy_geom(gp); + return (NULL); } @@ -664,6 +653,7 @@ g_uncompress_destroy_geom(struct gctl_re g_uncompress_softc_free(gp->softc, gp); gp->softc = NULL; g_wither_geom(gp, ENXIO); + return (0); } Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Thu May 1 14:19:14 2014 (r265192) +++ head/sys/geom/uzip/g_uzip.c Thu May 1 14:47:27 2014 (r265193) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -45,19 +44,19 @@ FEATURE(geom_uzip, "GEOM uzip read-only #undef GEOM_UZIP_DEBUG #ifdef GEOM_UZIP_DEBUG -#define DPRINTF(a) printf a +#define DPRINTF(a) printf a #else -#define DPRINTF(a) +#define DPRINTF(a) #endif static MALLOC_DEFINE(M_GEOM_UZIP, "geom_uzip", "GEOM UZIP data structures"); -#define UZIP_CLASS_NAME "UZIP" +#define UZIP_CLASS_NAME "UZIP" /* * Maximum allowed valid block size (to prevent foot-shooting) */ -#define MAX_BLKSZ (MAXPHYS - MAXPHYS / 1000 - 12) +#define MAX_BLKSZ (MAXPHYS - MAXPHYS / 1000 - 12) /* * Integer values (block size, number of blocks, offsets) @@ -65,7 +64,7 @@ static MALLOC_DEFINE(M_GEOM_UZIP, "geom_ * and in native order in struct g_uzip_softc */ -#define CLOOP_MAGIC_LEN 128 +#define CLOOP_MAGIC_LEN 128 static char CLOOP_MAGIC_START[] = "#!/bin/sh\n"; struct cloop_header { @@ -89,12 +88,15 @@ struct g_uzip_softc { static void g_uzip_softc_free(struct g_uzip_softc *sc, struct g_geom *gp) { + if (gp != NULL) { printf("%s: %d requests, %d cached\n", gp->name, sc->req_total, sc->req_cached); } - if (sc->offsets != NULL) + if (sc->offsets != NULL) { free(sc->offsets, M_GEOM_UZIP); + sc->offsets = NULL; + } mtx_destroy(&sc->last_mtx); free(sc->last_buf, M_GEOM_UZIP); free(sc, M_GEOM_UZIP); @@ -106,12 +108,14 @@ z_alloc(void *nil, u_int type, u_int siz void *ptr; ptr = malloc(type * size, M_GEOM_UZIP, M_NOWAIT); - return ptr; + + return (ptr); } static void z_free(void *nil, void *ptr) { + free(ptr, M_GEOM_UZIP); } @@ -258,10 +262,8 @@ g_uzip_start(struct bio *bp) start_blk = bp->bio_offset / sc->blksz; end_blk = (bp->bio_offset + bp->bio_length + sc->blksz - 1) / sc->blksz; - KASSERT(start_blk < sc->nblocks, - ("start_blk out of range")); - KASSERT(end_blk <= sc->nblocks, - ("end_blk out of range")); + KASSERT(start_blk < sc->nblocks, ("start_blk out of range")); + KASSERT(end_blk <= sc->nblocks, ("end_blk out of range")); sc->req_total++; if (start_blk + 1 == end_blk) { @@ -331,7 +333,7 @@ g_uzip_orphan(struct g_consumer *cp) { struct g_geom *gp; - g_trace(G_T_TOPOLOGY, "g_uzip_orphan(%p/%s)", cp, cp->provider->name); + g_trace(G_T_TOPOLOGY, "%s(%p/%s)", __func__, cp, cp->provider->name); g_topology_assert(); gp = cp->geom; @@ -351,7 +353,7 @@ g_uzip_access(struct g_provider *pp, int KASSERT (cp != NULL, ("g_uzip_access but no consumer")); if (cp->acw + dw > 0) - return EROFS; + return (EROFS); return (g_access(cp, dr, dw, de)); } @@ -362,7 +364,7 @@ g_uzip_spoiled(struct g_consumer *cp) struct g_geom *gp; gp = cp->geom; - g_trace(G_T_TOPOLOGY, "g_uzip_spoiled(%p/%s)", cp, gp->name); + g_trace(G_T_TOPOLOGY, "%s(%p/%s)", __func__, cp, gp->name); g_topology_assert(); g_uzip_softc_free(gp->softc, gp); @@ -382,7 +384,7 @@ g_uzip_taste(struct g_class *mp, struct struct g_provider *pp2; struct g_uzip_softc *sc; - g_trace(G_T_TOPOLOGY, "g_uzip_taste(%s,%s)", mp->name, pp->name); + g_trace(G_T_TOPOLOGY, "%s(%s,%s)", __func__, mp->name, pp->name); g_topology_assert(); /* Skip providers that are already open for writing. */ @@ -418,7 +420,7 @@ g_uzip_taste(struct g_class *mp, struct goto err; header = (struct cloop_header *) buf; if (strncmp(header->magic, CLOOP_MAGIC_START, - sizeof(CLOOP_MAGIC_START) - 1) != 0) { + sizeof(CLOOP_MAGIC_START) - 1) != 0) { DPRINTF(("%s: no CLOOP magic\n", gp->name)); goto err; } @@ -447,7 +449,7 @@ g_uzip_taste(struct g_class *mp, struct if (sizeof(struct cloop_header) + total_offsets * sizeof(uint64_t) > pp->mediasize) { printf("%s: media too small for %u blocks\n", - gp->name, sc->nblocks); + gp->name, sc->nblocks); goto err; } sc->offsets = malloc( @@ -487,8 +489,8 @@ g_uzip_taste(struct g_class *mp, struct pp2 = g_new_providerf(gp, "%s", gp->name); pp2->sectorsize = 512; pp2->mediasize = (off_t)sc->nblocks * sc->blksz; - pp2->stripesize = pp->stripesize; - pp2->stripeoffset = pp->stripeoffset; + pp2->stripesize = pp->stripesize; + pp2->stripeoffset = pp->stripeoffset; g_error_provider(pp2, 0); g_access(cp, -1, 0, 0); @@ -496,8 +498,7 @@ g_uzip_taste(struct g_class *mp, struct gp->name, pp2->sectorsize, (intmax_t)pp2->mediasize, pp2->stripeoffset, pp2->stripesize, pp2->flags)); - printf("%s: %u x %u blocks\n", - gp->name, sc->nblocks, sc->blksz); + printf("%s: %u x %u blocks\n", gp->name, sc->nblocks, sc->blksz); return (gp); err: @@ -512,6 +513,7 @@ err: g_detach(cp); g_destroy_consumer(cp); g_destroy_geom(gp); + return (NULL); } @@ -520,7 +522,7 @@ g_uzip_destroy_geom(struct gctl_req *req { struct g_provider *pp; - g_trace(G_T_TOPOLOGY, "g_uzip_destroy_geom(%s, %s)", mp->name, gp->name); + g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, gp->name); g_topology_assert(); if (gp->softc == NULL) { @@ -537,6 +539,7 @@ g_uzip_destroy_geom(struct gctl_req *req g_uzip_softc_free(gp->softc, gp); gp->softc = NULL; g_wither_geom(gp, ENXIO); + return (0); } From owner-svn-src-head@FreeBSD.ORG Thu May 1 14:59:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 967B5E74; Thu, 1 May 2014 14:59:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83C8914CB; Thu, 1 May 2014 14:59:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s41Ex4DZ095974; Thu, 1 May 2014 14:59:04 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s41Ex4cQ095973; Thu, 1 May 2014 14:59:04 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405011459.s41Ex4cQ095973@svn.freebsd.org> From: Luiz Otavio O Souza Date: Thu, 1 May 2014 14:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265194 - head/sys/geom/uzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 14:59:04 -0000 Author: loos Date: Thu May 1 14:59:04 2014 New Revision: 265194 URL: http://svnweb.freebsd.org/changeset/base/265194 Log: Actually the FEATURE() macro is defined on sys/sysctl.h. Pointyhat to: loos Modified: head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Thu May 1 14:47:27 2014 (r265193) +++ head/sys/geom/uzip/g_uzip.c Thu May 1 14:59:04 2014 (r265194) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Thu May 1 15:04:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 598AB3EC; Thu, 1 May 2014 15:04:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46E4E15AD; Thu, 1 May 2014 15:04:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s41F4XQv099721; Thu, 1 May 2014 15:04:33 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s41F4X0J099720; Thu, 1 May 2014 15:04:33 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201405011504.s41F4X0J099720@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Thu, 1 May 2014 15:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265196 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 15:04:33 -0000 Author: melifaro Date: Thu May 1 15:04:32 2014 New Revision: 265196 URL: http://svnweb.freebsd.org/changeset/base/265196 Log: Fix rnh_walktree_from() function (patch from kern/174959). Require valid netmask to be passed since host route is always a leaf. PR: kern/174959 Submitted by: Keith Sklower MFC after: 2 weeks Modified: head/sys/net/radix.c Modified: head/sys/net/radix.c ============================================================================== --- head/sys/net/radix.c Thu May 1 15:03:26 2014 (r265195) +++ head/sys/net/radix.c Thu May 1 15:04:32 2014 (r265196) @@ -971,6 +971,8 @@ rn_walktree_from(struct radix_node_head int stopping = 0; int lastb; + KASSERT(m != NULL, ("%s: mask needs to be specified", __func__)); + /* * rn_search_m is sort-of-open-coded here. We cannot use the * function because we need to keep track of the last node seen. @@ -994,11 +996,11 @@ rn_walktree_from(struct radix_node_head /* * Two cases: either we stepped off the end of our mask, * in which case last == rn, or we reached a leaf, in which - * case we want to start from the last node we looked at. - * Either way, last is the node we want to start from. + * case we want to start from the leaf. */ - rn = last; - lastb = rn->rn_bit; + if (rn->rn_bit >= 0) + rn = last; + lastb = last->rn_bit; /* printf("rn %p, lastb %d\n", rn, lastb);*/ From owner-svn-src-head@FreeBSD.ORG Thu May 1 15:23:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5B98F07; Thu, 1 May 2014 15:23:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92F84179E; Thu, 1 May 2014 15:23:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s41FNK0m008083; Thu, 1 May 2014 15:23:20 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s41FNKh1008082; Thu, 1 May 2014 15:23:20 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405011523.s41FNKh1008082@svn.freebsd.org> From: Luiz Otavio O Souza Date: Thu, 1 May 2014 15:23:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265197 - head/sys/geom/uzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 15:23:20 -0000 Author: loos Date: Thu May 1 15:23:20 2014 New Revision: 265197 URL: http://svnweb.freebsd.org/changeset/base/265197 Log: Fix a leak in g_uzip_taste(). After retrieve all the block offsets from the uzip image, free the last data read. Modified: head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Thu May 1 15:04:32 2014 (r265196) +++ head/sys/geom/uzip/g_uzip.c Thu May 1 15:23:20 2014 (r265197) @@ -479,6 +479,7 @@ g_uzip_taste(struct g_class *mp, struct } offsets_read += nread; } + free(buf, M_GEOM); DPRINTF(("%s: done reading offsets\n", gp->name)); mtx_init(&sc->last_mtx, "geom_uzip cache", NULL, MTX_DEF); sc->last_blk = -1; From owner-svn-src-head@FreeBSD.ORG Thu May 1 16:59:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by hub.freebsd.org (Postfix) with ESMTP id 4AF3C61B; Thu, 1 May 2014 16:59:57 +0000 (UTC) Message-ID: <53627D8C.3030404@FreeBSD.org> Date: Thu, 01 May 2014 12:59:56 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null References: <201404300620.s3U6Kmn6074492@svn.freebsd.org> <5361512A.7070205@FreeBSD.org> In-Reply-To: <5361512A.7070205@FreeBSD.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 16:59:57 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2014-04-30 15:38:18 -0400, ?? wrote: > On 2014-04-30 02:20:48 -0400, ?? wrote: >> Author: eadler Date: Wed Apr 30 06:20:48 2014 New Revision: >> 265132 URL: http://svnweb.freebsd.org/changeset/base/265132 >> >> Log: Add a /dev/full device. >> >> /dev/full is similar to /dev/zero except it always returns ENOSPC >> when you attempt to write to it. >> >> Reviewed by: jhibbits Discussed with: rpaulo > ... Please see lindev(4). I guess I wasn't loud enough. We already had the exact same feature via lindev(4). In fact, now it panics if we load both, i.e., "make_dev_credv: bad si_name (error=17, si_name=full)". Please see sys/dev/lindev/full.c. Also, the manual page is still symlinked from lindev.4. % grep -n 'full\.4' share/man/man4/Makefile 822:MLINKS+=lindev.4 full.4 If we're really making it a standard feature, then lindev must be removed (or at least disconnected from build), __FreeBSD_version must be bumped, and a new UPDATING entry for the change is required. Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQEcBAEBAgAGBQJTYn2MAAoJEHyflib82/FGDW0H+wUW91tsvm3jwzn736MmM3R/ jyBKP6HBiUYfpF9tIQQMcnoGq1+xsWBJfRzn1sK3IdFUaP9R0HFwAz2IEpGQ4Lsy SeincVpI+T5FkSiZhnWYke4W3XsCg2JAeUKVbSg6u9SgxE3RTGdYBmHwSfHOEGYn Q3kqSAjq44F7jJRl2DNyo1AT8/IYfws2IrEM5vakfry/iRrMKEMt7ICCKK3v1TA8 dJoTxoM3aW9NQFvk1vPe6s4TVQEpnuWhoadRCuUQtZQ7skoONpmXNObWwCyoWbq5 zUjtEea60bXXMEo84ruVN/3hCHZqRAXiWhYMTf3cg1QirV9upshP0IOSaGo/Q4o= =drUB -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Thu May 1 22:28:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D636C4D; Thu, 1 May 2014 22:28:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6ACC114B4; Thu, 1 May 2014 22:28:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s41MSFBd082093; Thu, 1 May 2014 22:28:15 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s41MSF7T082092; Thu, 1 May 2014 22:28:15 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201405012228.s41MSF7T082092@svn.freebsd.org> From: Brooks Davis Date: Thu, 1 May 2014 22:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265201 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 22:28:15 -0000 Author: brooks Date: Thu May 1 22:28:14 2014 New Revision: 265201 URL: http://svnweb.freebsd.org/changeset/base/265201 Log: Fix a 2038 bug. If time_t is 64-bit (i.e. isn't 32-bit) allow any value of year, not just years less than 2038. Don't bother fixing the underflow in the case of years before 1903. MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/kern/subr_clock.c Modified: head/sys/kern/subr_clock.c ============================================================================== --- head/sys/kern/subr_clock.c Thu May 1 21:34:55 2014 (r265200) +++ head/sys/kern/subr_clock.c Thu May 1 22:28:14 2014 (r265201) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -147,7 +148,7 @@ clock_ct_to_ts(struct clocktime *ct, str if (ct->mon < 1 || ct->mon > 12 || ct->day < 1 || ct->day > days_in_month(year, ct->mon) || ct->hour > 23 || ct->min > 59 || ct->sec > 59 || - ct->year > 2037) { /* time_t overflow */ + (sizeof(time_t) == 4 && year > 2037)) { /* time_t overflow */ if (ct_debug) printf(" = EINVAL\n"); return (EINVAL); From owner-svn-src-head@FreeBSD.ORG Thu May 1 23:34:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CC877F1; Thu, 1 May 2014 23:34:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30CAE1A3B; Thu, 1 May 2014 23:34:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s41NYEvu010237; Thu, 1 May 2014 23:34:14 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s41NYENs010235; Thu, 1 May 2014 23:34:14 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405012334.s41NYENs010235@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 1 May 2014 23:34:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265202 - head/lib/libc/regex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 23:34:15 -0000 Author: pfg Date: Thu May 1 23:34:14 2014 New Revision: 265202 URL: http://svnweb.freebsd.org/changeset/base/265202 Log: regex: Remove some unreachable breaks. This is based on a much bigger cleanup done in Illumos. Reference: https://www.illumos.org/issues/2077 MFC after: 1 week Modified: head/lib/libc/regex/engine.c head/lib/libc/regex/regcomp.c Modified: head/lib/libc/regex/engine.c ============================================================================== --- head/lib/libc/regex/engine.c Thu May 1 22:28:14 2014 (r265201) +++ head/lib/libc/regex/engine.c Thu May 1 23:34:14 2014 (r265202) @@ -686,19 +686,16 @@ backref(struct match *m, while (m->g->strip[ss] != SOP(O_BACK, i)) ss++; return(backref(m, sp+len, stop, ss+1, stopst, lev, rec)); - break; case OQUEST_: /* to null or not */ dp = backref(m, sp, stop, ss+1, stopst, lev, rec); if (dp != NULL) return(dp); /* not */ return(backref(m, sp, stop, ss+OPND(s)+1, stopst, lev, rec)); - break; case OPLUS_: assert(m->lastpos != NULL); assert(lev+1 <= m->g->nplus); m->lastpos[lev+1] = sp; return(backref(m, sp, stop, ss+1, stopst, lev+1, rec)); - break; case O_PLUS: if (sp == m->lastpos[lev]) /* last pass matched null */ return(backref(m, sp, stop, ss+1, stopst, lev-1, rec)); @@ -709,7 +706,6 @@ backref(struct match *m, return(backref(m, sp, stop, ss+1, stopst, lev-1, rec)); else return(dp); - break; case OCH_: /* find the right one, if any */ ssub = ss + 1; esub = ss + OPND(s) - 1; @@ -730,6 +726,7 @@ backref(struct match *m, else assert(OP(m->g->strip[esub]) == O_CH); } + /* NOTREACHED */ break; case OLPAREN: /* must undo assignment if rest fails */ i = OPND(s); @@ -741,7 +738,6 @@ backref(struct match *m, return(dp); m->pmatch[i].rm_so = offsave; return(NULL); - break; case ORPAREN: /* must undo assignment if rest fails */ i = OPND(s); assert(0 < i && i <= m->g->nsub); @@ -752,7 +748,6 @@ backref(struct match *m, return(dp); m->pmatch[i].rm_eo = offsave; return(NULL); - break; default: /* uh oh */ assert(nope); break; Modified: head/lib/libc/regex/regcomp.c ============================================================================== --- head/lib/libc/regex/regcomp.c Thu May 1 22:28:14 2014 (r265201) +++ head/lib/libc/regex/regcomp.c Thu May 1 23:34:14 2014 (r265202) @@ -746,7 +746,6 @@ p_b_term(struct parse *p, cset *cs) case '-': SETERROR(REG_ERANGE); return; /* NOTE RETURN */ - break; default: c = '\0'; break; From owner-svn-src-head@FreeBSD.ORG Fri May 2 00:46:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45B17176; Fri, 2 May 2014 00:46:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 322A4110D; Fri, 2 May 2014 00:46:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s420XuxS035661; Fri, 2 May 2014 00:33:56 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s420Xu91035658; Fri, 2 May 2014 00:33:56 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405020033.s420Xu91035658@svn.freebsd.org> From: Neel Natu Date: Fri, 2 May 2014 00:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265203 - in head: sys/amd64/include sys/amd64/vmm usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 00:46:48 -0000 Author: neel Date: Fri May 2 00:33:56 2014 New Revision: 265203 URL: http://svnweb.freebsd.org/changeset/base/265203 Log: Add logic in the HLT exit handler to detect if the guest has put all vcpus to sleep permanently by executing a HLT with interrupts disabled. When this condition is detected the guest with be suspended with a reason of VM_SUSPEND_HALT and the bhyve(8) process will exit. Tested by executing "halt" inside a RHEL7-beta guest. Discussed with: grehan@ Reviewed by: jhb@, tychon@ Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/vmm.c head/usr.sbin/bhyve/bhyverun.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Thu May 1 23:34:14 2014 (r265202) +++ head/sys/amd64/include/vmm.h Fri May 2 00:33:56 2014 (r265203) @@ -33,6 +33,7 @@ enum vm_suspend_how { VM_SUSPEND_NONE, VM_SUSPEND_RESET, VM_SUSPEND_POWEROFF, + VM_SUSPEND_HALT, VM_SUSPEND_LAST }; Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Thu May 1 23:34:14 2014 (r265202) +++ head/sys/amd64/vmm/vmm.c Fri May 2 00:33:56 2014 (r265203) @@ -142,6 +142,8 @@ struct vm { int suspend; volatile cpuset_t suspended_cpus; + + volatile cpuset_t halted_cpus; }; static int vmm_initialized; @@ -1006,9 +1008,13 @@ vm_handle_hlt(struct vm *vm, int vcpuid, { struct vcpu *vcpu; const char *wmesg; - int t; + int t, vcpu_halted, vm_halted; + + KASSERT(!CPU_ISSET(vcpuid, &vm->halted_cpus), ("vcpu already halted")); vcpu = &vm->vcpu[vcpuid]; + vcpu_halted = 0; + vm_halted = 0; vcpu_lock(vcpu); while (1) { @@ -1032,10 +1038,26 @@ vm_handle_hlt(struct vm *vm, int vcpuid, } } - if (vlapic_enabled(vcpu->vlapic)) - wmesg = "vmidle"; - else + /* + * Some Linux guests implement "halt" by having all vcpus + * execute HLT with interrupts disabled. 'halted_cpus' keeps + * track of the vcpus that have entered this state. When all + * vcpus enter the halted state the virtual machine is halted. + */ + if (intr_disabled) { wmesg = "vmhalt"; + VCPU_CTR0(vm, vcpuid, "Halted"); + if (!vcpu_halted) { + vcpu_halted = 1; + CPU_SET_ATOMIC(vcpuid, &vm->halted_cpus); + } + if (CPU_CMP(&vm->halted_cpus, &vm->active_cpus) == 0) { + vm_halted = 1; + break; + } + } else { + wmesg = "vmidle"; + } t = ticks; vcpu_require_state_locked(vcpu, VCPU_SLEEPING); @@ -1043,8 +1065,15 @@ vm_handle_hlt(struct vm *vm, int vcpuid, vcpu_require_state_locked(vcpu, VCPU_FROZEN); vmm_stat_incr(vm, vcpuid, VCPU_IDLE_TICKS, ticks - t); } + + if (vcpu_halted) + CPU_CLR_ATOMIC(vcpuid, &vm->halted_cpus); + vcpu_unlock(vcpu); + if (vm_halted) + vm_suspend(vm, VM_SUSPEND_HALT); + return (0); } Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Thu May 1 23:34:14 2014 (r265202) +++ head/usr.sbin/bhyve/bhyverun.c Fri May 2 00:33:56 2014 (r265203) @@ -453,7 +453,6 @@ vmexit_suspend(struct vmctx *ctx, struct enum vm_suspend_how how; how = vmexit->u.suspended.how; - assert(how == VM_SUSPEND_RESET || how == VM_SUSPEND_POWEROFF); fbsdrun_deletecpu(ctx, *pvcpu); @@ -470,10 +469,17 @@ vmexit_suspend(struct vmctx *ctx, struct } pthread_mutex_unlock(&resetcpu_mtx); - if (how == VM_SUSPEND_RESET) + switch (how) { + case VM_SUSPEND_RESET: exit(0); - if (how == VM_SUSPEND_POWEROFF) + case VM_SUSPEND_POWEROFF: exit(1); + case VM_SUSPEND_HALT: + exit(2); + default: + fprintf(stderr, "vmexit_suspend: invalid reason %d\n", how); + exit(100); + } return (0); /* NOTREACHED */ } From owner-svn-src-head@FreeBSD.ORG Fri May 2 00:48:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D76492E0; Fri, 2 May 2014 00:48:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B94EE1122; Fri, 2 May 2014 00:48:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s420mA9m040260; Fri, 2 May 2014 00:48:10 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s420mA1S040257; Fri, 2 May 2014 00:48:10 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405020048.s420mA1S040257@svn.freebsd.org> From: Adrian Chadd Date: Fri, 2 May 2014 00:48:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265205 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 00:48:10 -0000 Author: adrian Date: Fri May 2 00:48:09 2014 New Revision: 265205 URL: http://svnweb.freebsd.org/changeset/base/265205 Log: Add tracking for self-generated frames when the VAP is in sleep state. The hardware can generate its own frames (eg RTS/CTS exchanges, other kinds of 802.11 management stuff, especially when it comes to 802.11n) and these also have PWRMGT flags. So if the VAP is asleep but the NIC is in force-awake for some reason, ensure that the self-generated frames have PWRMGT set to 1. Now, this (like basically everything to do with powersave) is still racy - the only way to guarantee that it's all actually consistent is to pause transmit and let it finish before transitioning the VAP to sleep, but this at least gets the basic method of tracking and updating the state debugged. Tested: * AR5416, STA mode * AR9380, STA mode Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri May 2 00:45:30 2014 (r265204) +++ head/sys/dev/ath/if_ath.c Fri May 2 00:48:09 2014 (r265205) @@ -305,6 +305,55 @@ _ath_power_setpower(struct ath_softc *sc power_state != sc->sc_cur_powerstate) { sc->sc_cur_powerstate = power_state; ath_hal_setpower(sc->sc_ah, power_state); + + /* + * If the NIC is force-awake, then set the + * self-gen frame state appropriately. + * + * If the nic is in network sleep or full-sleep, + * we let the above call leave the self-gen + * state as "sleep". + */ + if (sc->sc_cur_powerstate == HAL_PM_AWAKE && + sc->sc_target_selfgen_state != HAL_PM_AWAKE) { + ath_hal_setselfgenpower(sc->sc_ah, + sc->sc_target_selfgen_state); + } + } +} + +/* + * Set the current self-generated frames state. + * + * This is separate from the target power mode. The chip may be + * awake but the desired state is "sleep", so frames sent to the + * destination has PWRMGT=1 in the 802.11 header. The NIC also + * needs to know to set PWRMGT=1 in self-generated frames. + */ +void +_ath_power_set_selfgen(struct ath_softc *sc, int power_state, const char *file, int line) +{ + + ATH_LOCK_ASSERT(sc); + + DPRINTF(sc, ATH_DEBUG_PWRSAVE, "%s: (%s:%d) state=%d, refcnt=%d\n", + __func__, + file, + line, + power_state, + sc->sc_target_selfgen_state); + + sc->sc_target_selfgen_state = power_state; + + /* + * If the NIC is force-awake, then set the power state. + * Network-state and full-sleep will already transition it to + * mark self-gen frames as sleeping - and we can't + * guarantee the NIC is awake to program the self-gen frame + * setting anyway. + */ + if (sc->sc_cur_powerstate == HAL_PM_AWAKE) { + ath_hal_setselfgenpower(sc->sc_ah, power_state); } } @@ -334,6 +383,16 @@ _ath_power_set_power_state(struct ath_so if (power_state != sc->sc_cur_powerstate) { ath_hal_setpower(sc->sc_ah, power_state); sc->sc_cur_powerstate = power_state; + + /* + * Adjust the self-gen powerstate if appropriate. + */ + if (sc->sc_cur_powerstate == HAL_PM_AWAKE && + sc->sc_target_selfgen_state != HAL_PM_AWAKE) { + ath_hal_setselfgenpower(sc->sc_ah, + sc->sc_target_selfgen_state); + } + } } @@ -366,6 +425,16 @@ _ath_power_restore_power_state(struct at sc->sc_cur_powerstate = sc->sc_target_powerstate; ath_hal_setpower(sc->sc_ah, sc->sc_target_powerstate); } + + /* + * Adjust the self-gen powerstate if appropriate. + */ + if (sc->sc_cur_powerstate == HAL_PM_AWAKE && + sc->sc_target_selfgen_state != HAL_PM_AWAKE) { + ath_hal_setselfgenpower(sc->sc_ah, + sc->sc_target_selfgen_state); + } + } #define HAL_MODE_HT20 (HAL_MODE_11NG_HT20 | HAL_MODE_11NA_HT20) @@ -1734,6 +1803,7 @@ ath_resume(struct ath_softc *sc) /* Ensure we set the current power state to on */ ATH_LOCK(sc); + ath_power_setselfgen(sc, HAL_PM_AWAKE); ath_power_set_power_state(sc, HAL_PM_AWAKE); ath_power_setpower(sc, HAL_PM_AWAKE); ATH_UNLOCK(sc); @@ -2252,6 +2322,7 @@ ath_init(void *arg) /* * Force the sleep state awake. */ + ath_power_setselfgen(sc, HAL_PM_AWAKE); ath_power_set_power_state(sc, HAL_PM_AWAKE); ath_power_setpower(sc, HAL_PM_AWAKE); @@ -5656,6 +5727,20 @@ ath_newstate(struct ieee80211vap *vap, e /* Before we touch the hardware - wake it up */ ATH_LOCK(sc); + /* + * If the NIC is in anything other than SLEEP state, + * we need to ensure that self-generated frames are + * set for PWRMGT=0. Otherwise we may end up with + * strange situations. + * + * XXX TODO: is this actually the case? :-) + */ + if (nstate != IEEE80211_S_SLEEP) + ath_power_setselfgen(sc, HAL_PM_AWAKE); + + /* + * Now, wake the thing up. + */ ath_power_set_power_state(sc, HAL_PM_AWAKE); ATH_UNLOCK(sc); @@ -5675,6 +5760,7 @@ ath_newstate(struct ieee80211vap *vap, e /* Ensure we stay awake during scan */ ATH_LOCK(sc); + ath_power_setselfgen(sc, HAL_PM_AWAKE); ath_power_setpower(sc, HAL_PM_AWAKE); ATH_UNLOCK(sc); @@ -5850,6 +5936,7 @@ ath_newstate(struct ieee80211vap *vap, e * Force awake for RUN mode. */ ATH_LOCK(sc); + ath_power_setselfgen(sc, HAL_PM_AWAKE); ath_power_setpower(sc, HAL_PM_AWAKE); ATH_UNLOCK(sc); @@ -5891,20 +5978,23 @@ ath_newstate(struct ieee80211vap *vap, e vap->iv_opmode == IEEE80211_M_STA) { DPRINTF(sc, ATH_DEBUG_BEACON, "%s: syncbeacon=%d\n", __func__, sc->sc_syncbeacon); ATH_LOCK(sc); - if (sc->sc_syncbeacon == 0) { - ath_power_setpower(sc, HAL_PM_NETWORK_SLEEP); - } /* * Always at least set the self-generated - * power bits appropriately. + * frame config to set PWRMGT=1. + */ + ath_power_setselfgen(sc, HAL_PM_NETWORK_SLEEP); + + /* + * If we're not syncing beacons, transition + * to NETWORK_SLEEP. * - * XXX TODO: this should be an ath_power_*() call - * which also tracks whether we're doing self-gen - * frames or not, and allows the hardware to be - * awake _but_ self-gen frames to have PWRMGT=1. + * We stay awake if syncbeacon > 0 in case + * we need to listen for some beacons otherwise + * our beacon timer config may be wrong. */ - ath_hal_setselfgenpower(sc->sc_ah, - HAL_PM_NETWORK_SLEEP); + if (sc->sc_syncbeacon == 0) { + ath_power_setpower(sc, HAL_PM_NETWORK_SLEEP); + } ATH_UNLOCK(sc); } } Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Fri May 2 00:45:30 2014 (r265204) +++ head/sys/dev/ath/if_ath_misc.h Fri May 2 00:48:09 2014 (r265205) @@ -131,10 +131,12 @@ extern void ath_tx_dump(struct ath_softc * Power state tracking. */ extern void _ath_power_setpower(struct ath_softc *sc, int power_state, const char *file, int line); +extern void _ath_power_set_selfgen(struct ath_softc *sc, int power_state, const char *file, int line); extern void _ath_power_set_power_state(struct ath_softc *sc, int power_state, const char *file, int line); extern void _ath_power_restore_power_state(struct ath_softc *sc, const char *file, int line); #define ath_power_setpower(sc, ps) _ath_power_setpower(sc, ps, __FILE__, __LINE__) +#define ath_power_setselfgen(sc, ps) _ath_power_set_selfgen(sc, ps, __FILE__, __LINE__) #define ath_power_set_power_state(sc, ps) _ath_power_set_power_state(sc, ps, __FILE__, __LINE__) #define ath_power_restore_power_state(sc) _ath_power_restore_power_state(sc, __FILE__, __LINE__) Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Fri May 2 00:45:30 2014 (r265204) +++ head/sys/dev/ath/if_athvar.h Fri May 2 00:48:09 2014 (r265205) @@ -867,10 +867,19 @@ struct ath_softc { int status); /* - * powersave state tracking. + * Powersave state tracking. + * + * target/cur powerstate is the chip power state. + * target selfgen state is the self-generated frames + * state. The chip can be awake but transmitted frames + * can have the PWRMGT bit set to 1 so the destination + * thinks the node is asleep. */ HAL_POWER_MODE sc_target_powerstate; + HAL_POWER_MODE sc_target_selfgen_state; + HAL_POWER_MODE sc_cur_powerstate; + int sc_powersave_refcnt; }; From owner-svn-src-head@FreeBSD.ORG Fri May 2 00:52:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C8186C3; Fri, 2 May 2014 00:52:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0E0511F9; Fri, 2 May 2014 00:52:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s420qEej043729; Fri, 2 May 2014 00:52:14 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s420qEo0043726; Fri, 2 May 2014 00:52:14 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201405020052.s420qEo0043726@svn.freebsd.org> From: Mateusz Guzik Date: Fri, 2 May 2014 00:52:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265206 - in head/sys: fs/fifofs kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 00:52:15 -0000 Author: mjg Date: Fri May 2 00:52:13 2014 New Revision: 265206 URL: http://svnweb.freebsd.org/changeset/base/265206 Log: Ignore the error from pipespace_new when creating a pipe. It can fail if pipe map is exhausted (as a result of too many pipes created), but it is not fatal and could be provoked by unprivileged users. The only consequence is worse performance with given pipe. Reported by: ivoras Suggested by: kib MFC after: 1 week Modified: head/sys/fs/fifofs/fifo_vnops.c head/sys/kern/sys_pipe.c head/sys/sys/pipe.h Modified: head/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- head/sys/fs/fifofs/fifo_vnops.c Fri May 2 00:48:09 2014 (r265205) +++ head/sys/fs/fifofs/fifo_vnops.c Fri May 2 00:52:13 2014 (r265206) @@ -146,9 +146,7 @@ fifo_open(ap) if (fp == NULL || (ap->a_mode & FEXEC) != 0) return (EINVAL); if ((fip = vp->v_fifoinfo) == NULL) { - error = pipe_named_ctor(&fpipe, td); - if (error != 0) - return (error); + pipe_named_ctor(&fpipe, td); fip = malloc(sizeof(*fip), M_VNODE, M_WAITOK); fip->fi_pipe = fpipe; fpipe->pipe_wgen = fip->fi_readers = fip->fi_writers = 0; Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Fri May 2 00:48:09 2014 (r265205) +++ head/sys/kern/sys_pipe.c Fri May 2 00:52:13 2014 (r265206) @@ -221,8 +221,8 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, piperesi static void pipeinit(void *dummy __unused); static void pipeclose(struct pipe *cpipe); static void pipe_free_kmem(struct pipe *cpipe); -static int pipe_create(struct pipe *pipe, int backing); -static int pipe_paircreate(struct thread *td, struct pipepair **p_pp); +static void pipe_create(struct pipe *pipe, int backing); +static void pipe_paircreate(struct thread *td, struct pipepair **p_pp); static __inline int pipelock(struct pipe *cpipe, int catch); static __inline void pipeunlock(struct pipe *cpipe); #ifndef PIPE_NODIRECT @@ -331,12 +331,11 @@ pipe_zone_fini(void *mem, int size) mtx_destroy(&pp->pp_mtx); } -static int +static void pipe_paircreate(struct thread *td, struct pipepair **p_pp) { struct pipepair *pp; struct pipe *rpipe, *wpipe; - int error; *p_pp = pp = uma_zalloc(pipe_zone, M_WAITOK); #ifdef MAC @@ -355,30 +354,21 @@ pipe_paircreate(struct thread *td, struc knlist_init_mtx(&wpipe->pipe_sel.si_note, PIPE_MTX(wpipe)); /* Only the forward direction pipe is backed by default */ - if ((error = pipe_create(rpipe, 1)) != 0 || - (error = pipe_create(wpipe, 0)) != 0) { - pipeclose(rpipe); - pipeclose(wpipe); - return (error); - } + pipe_create(rpipe, 1); + pipe_create(wpipe, 0); rpipe->pipe_state |= PIPE_DIRECTOK; wpipe->pipe_state |= PIPE_DIRECTOK; - return (0); } -int +void pipe_named_ctor(struct pipe **ppipe, struct thread *td) { struct pipepair *pp; - int error; - error = pipe_paircreate(td, &pp); - if (error != 0) - return (error); + pipe_paircreate(td, &pp); pp->pp_rpipe.pipe_state |= PIPE_NAMED; *ppipe = &pp->pp_rpipe; - return (0); } void @@ -419,9 +409,7 @@ kern_pipe2(struct thread *td, int fildes int fd, fflags, error; fdp = td->td_proc->p_fd; - error = pipe_paircreate(td, &pp); - if (error != 0) - return (error); + pipe_paircreate(td, &pp); rpipe = &pp->pp_rpipe; wpipe = &pp->pp_wpipe; error = falloc(td, &rf, &fd, flags); @@ -642,24 +630,27 @@ pipeselwakeup(cpipe) * Initialize and allocate VM and memory for pipe. The structure * will start out zero'd from the ctor, so we just manage the kmem. */ -static int +static void pipe_create(pipe, backing) struct pipe *pipe; int backing; { - int error; if (backing) { + /* + * Note that these functions can fail if pipe map is exhausted + * (as a result of too many pipes created), but we ignore the + * error as it is not fatal and could be provoked by + * unprivileged users. The only consequence is worse performance + * with given pipe. + */ if (amountpipekva > maxpipekva / 2) - error = pipespace_new(pipe, SMALL_PIPE_SIZE); + (void)pipespace_new(pipe, SMALL_PIPE_SIZE); else - error = pipespace_new(pipe, PIPE_SIZE); - } else { - /* If we're not backing this pipe, no need to do anything. */ - error = 0; + (void)pipespace_new(pipe, PIPE_SIZE); } + pipe->pipe_ino = -1; - return (error); } /* ARGSUSED */ Modified: head/sys/sys/pipe.h ============================================================================== --- head/sys/sys/pipe.h Fri May 2 00:48:09 2014 (r265205) +++ head/sys/sys/pipe.h Fri May 2 00:52:13 2014 (r265206) @@ -142,6 +142,6 @@ struct pipepair { #define PIPE_LOCK_ASSERT(pipe, type) mtx_assert(PIPE_MTX(pipe), (type)) void pipe_dtor(struct pipe *dpipe); -int pipe_named_ctor(struct pipe **ppipe, struct thread *td); +void pipe_named_ctor(struct pipe **ppipe, struct thread *td); void pipeselwakeup(struct pipe *cpipe); #endif /* !_SYS_PIPE_H_ */ From owner-svn-src-head@FreeBSD.ORG Fri May 2 01:20:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2334CE4F; Fri, 2 May 2014 01:20:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 105F014C0; Fri, 2 May 2014 01:20:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s421KDAa052864; Fri, 2 May 2014 01:20:13 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s421KDhD052863; Fri, 2 May 2014 01:20:13 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201405020120.s421KDhD052863@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Fri, 2 May 2014 01:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265207 - head/sys/arm/rockchip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 01:20:14 -0000 Author: ganbold Date: Fri May 2 01:20:13 2014 New Revision: 265207 URL: http://svnweb.freebsd.org/changeset/base/265207 Log: Switch to use arm_devmap_add_entry() to setup static device mapping. Approved by: stas (mentor) Modified: head/sys/arm/rockchip/rk30xx_machdep.c Modified: head/sys/arm/rockchip/rk30xx_machdep.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_machdep.c Fri May 2 00:52:13 2014 (r265206) +++ head/sys/arm/rockchip/rk30xx_machdep.c Fri May 2 01:20:13 2014 (r265207) @@ -51,14 +51,11 @@ __FBSDID("$FreeBSD$"); #include -/* Start of address space used for bootstrap map */ -#define DEVMAP_BOOTSTRAP_MAP_START 0xF0000000 - vm_offset_t initarm_lastaddr(void) { - return (DEVMAP_BOOTSTRAP_MAP_START); + return (arm_devmap_lastaddr()); } void @@ -81,27 +78,14 @@ initarm_late_init(void) CPU_CONTROL_DC_ENABLE|CPU_CONTROL_IC_ENABLE); } -#define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) -static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { - { 0, 0, 0, 0, 0, } -}; - /* - * Construct pmap_devmap[] with DT-derived config data. + * Set up static device mappings. */ int initarm_devmap_init(void) { - int i = 0; - - fdt_devmap[i].pd_va = 0xF0000000; - fdt_devmap[i].pd_pa = 0x20000000; - fdt_devmap[i].pd_size = 0x100000; - fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[i].pd_cache = PTE_DEVICE; - i++; - arm_devmap_register_table(&fdt_devmap[0]); + arm_devmap_add_entry(0x20000000, 0x00100000); return (0); } From owner-svn-src-head@FreeBSD.ORG Fri May 2 01:28:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84EC210D; Fri, 2 May 2014 01:28:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7195815C2; Fri, 2 May 2014 01:28:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s421SKnu056632; Fri, 2 May 2014 01:28:20 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s421SJeR056626; Fri, 2 May 2014 01:28:19 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405020128.s421SJeR056626@svn.freebsd.org> From: Ian Lepore Date: Fri, 2 May 2014 01:28:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265208 - in head/sys: boot/fdt/dts/arm dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 01:28:20 -0000 Author: ian Date: Fri May 2 01:28:19 2014 New Revision: 265208 URL: http://svnweb.freebsd.org/changeset/base/265208 Log: Honor the max-frequency property if it appears in the fdt data. Adjust the exynos and zedboard dts files to use max-frequency (the documented standard property) instead of clock-frequency. Submitted by: Thomas Skibo Modified: head/sys/boot/fdt/dts/arm/exynos5250.dtsi head/sys/boot/fdt/dts/arm/zedboard.dts head/sys/dev/sdhci/sdhci_fdt.c Modified: head/sys/boot/fdt/dts/arm/exynos5250.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/exynos5250.dtsi Fri May 2 01:20:13 2014 (r265207) +++ head/sys/boot/fdt/dts/arm/exynos5250.dtsi Fri May 2 01:28:19 2014 (r265208) @@ -126,7 +126,7 @@ reg = <0x12200000 0x1000>; interrupts = <107>; interrupt-parent = <&GIC>; - clock-frequency = <24000000>; /* TODO: verify freq */ + max-frequency = <24000000>; /* TODO: verify freq */ }; sdhci@12210000 { @@ -134,7 +134,7 @@ reg = <0x12210000 0x1000>; interrupts = <108>; interrupt-parent = <&GIC>; - clock-frequency = <24000000>; + max-frequency = <24000000>; }; sdhci@12220000 { @@ -142,7 +142,7 @@ reg = <0x12220000 0x1000>; interrupts = <109>; interrupt-parent = <&GIC>; - clock-frequency = <24000000>; + max-frequency = <24000000>; }; sdhci@12230000 { @@ -150,7 +150,7 @@ reg = <0x12230000 0x1000>; interrupts = <110>; interrupt-parent = <&GIC>; - clock-frequency = <24000000>; + max-frequency = <24000000>; }; serial0: serial@12C00000 { Modified: head/sys/boot/fdt/dts/arm/zedboard.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/zedboard.dts Fri May 2 01:20:13 2014 (r265207) +++ head/sys/boot/fdt/dts/arm/zedboard.dts Fri May 2 01:28:19 2014 (r265208) @@ -183,7 +183,7 @@ reg = <0x100000 0x1000>; interrupts = <56>; interrupt-parent = <&GIC>; - clock-frequency = <50000000>; + max-frequency = <50000000>; }; // QSPI Modified: head/sys/dev/sdhci/sdhci_fdt.c ============================================================================== --- head/sys/dev/sdhci/sdhci_fdt.c Fri May 2 01:20:13 2014 (r265207) +++ head/sys/dev/sdhci/sdhci_fdt.c Fri May 2 01:28:19 2014 (r265208) @@ -66,6 +66,7 @@ struct sdhci_fdt_softc { device_t dev; /* Controller device */ u_int quirks; /* Chip specific quirks */ u_int caps; /* If we override SDHCI_CAPABILITIES */ + uint32_t max_clk; /* Max possible freq */ struct resource *irq_res; /* IRQ resource */ void *intrhand; /* Interrupt handle */ @@ -156,6 +157,7 @@ sdhci_fdt_probe(device_t dev) sc->quirks = 0; sc->num_slots = 1; + sc->max_clk = 0; if (!ofw_bus_status_okay(dev)) return (ENXIO); @@ -170,11 +172,14 @@ sdhci_fdt_probe(device_t dev) node = ofw_bus_get_node(dev); - /* Allow dts to patch quirks and slots. */ - if ((OF_getprop(node, "quirks", &cid, sizeof(cid))) > 0) - sc->quirks = fdt32_to_cpu(cid); - if ((OF_getprop(node, "num-slots", &cid, sizeof(cid))) > 0) - sc->num_slots = fdt32_to_cpu(cid); + /* Allow dts to patch quirks, slots, and max-frequency. */ + if ((OF_getencprop(node, "quirks", &cid, sizeof(cid))) > 0) + sc->quirks = cid; + if ((OF_getencprop(node, "num-slots", &cid, sizeof(cid))) > 0) + sc->num_slots = cid; + if ((OF_getencprop(node, "max-frequency", &cid, sizeof(cid))) > 0) + sc->max_clk = cid; + return (0); } @@ -214,6 +219,7 @@ sdhci_fdt_attach(device_t dev) slot->quirks = sc->quirks; slot->caps = sc->caps; + slot->max_clk = sc->max_clk; if (sdhci_init_slot(dev, slot, i) != 0) continue; From owner-svn-src-head@FreeBSD.ORG Fri May 2 04:51:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C99D464; Fri, 2 May 2014 04:51:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E15F21791; Fri, 2 May 2014 04:51:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s424pWri039560; Fri, 2 May 2014 04:51:32 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s424pVWD039555; Fri, 2 May 2014 04:51:31 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405020451.s424pVWD039555@svn.freebsd.org> From: Neel Natu Date: Fri, 2 May 2014 04:51:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265211 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 04:51:33 -0000 Author: neel Date: Fri May 2 04:51:31 2014 New Revision: 265211 URL: http://svnweb.freebsd.org/changeset/base/265211 Log: Don't allow MPtable generation if there are multiple PCI hierarchies. This is because there isn't a standard way to relay this information to the guest OS. Add a command line option "-Y" to bhyve(8) to inhibit MPtable generation. If the virtual machine is using PCI devices on buses other than 0 then it can still use ACPI tables to convey this information to the guest. Discussed with: grehan@ Modified: head/usr.sbin/bhyve/bhyve.8 head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/mptbl.c head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_emul.h Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Fri May 2 01:39:44 2014 (r265210) +++ head/usr.sbin/bhyve/bhyve.8 Fri May 2 04:51:31 2014 (r265211) @@ -236,6 +236,8 @@ This is intended for debug purposes. Ignore accesses to unimplemented Model Specific Registers (MSRs). This is intended for debug purposes. .It Fl x The guest's local APIC is configured in x2APIC mode. +.It Fl Y +Disable MPtable generation. .It Fl h Print help message and exit. .It Ar vmname Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Fri May 2 01:39:44 2014 (r265210) +++ head/usr.sbin/bhyve/bhyverun.c Fri May 2 04:51:31 2014 (r265211) @@ -145,6 +145,7 @@ usage(int code) " -m: memory size in MB\n" " -w: ignore unimplemented MSRs\n" " -x: local apic is in x2APIC mode\n" + " -Y: disable MPtable generation\n" " -U: uuid\n", progname, (int)strlen(progname), ""); @@ -616,7 +617,7 @@ int main(int argc, char *argv[]) { int c, error, gdb_port, err, bvmcons; - int max_vcpus; + int max_vcpus, mptgen; struct vmctx *ctx; uint64_t rip; size_t memsize; @@ -626,8 +627,9 @@ main(int argc, char *argv[]) gdb_port = 0; guest_ncpus = 1; memsize = 256 * MB; + mptgen = 1; - while ((c = getopt(argc, argv, "abehwxAHIPWp:g:c:s:m:l:U:")) != -1) { + while ((c = getopt(argc, argv, "abehwxAHIPWYp:g:c:s:m:l:U:")) != -1) { switch (c) { case 'a': x2apic_mode = 0; @@ -693,6 +695,9 @@ main(int argc, char *argv[]) case 'x': x2apic_mode = 1; break; + case 'Y': + mptgen = 0; + break; case 'h': usage(0); default: @@ -752,7 +757,11 @@ main(int argc, char *argv[]) /* * build the guest tables, MP etc. */ - mptable_build(ctx, guest_ncpus); + if (mptgen) { + error = mptable_build(ctx, guest_ncpus); + if (error) + exit(1); + } error = smbios_build(ctx); assert(error == 0); Modified: head/usr.sbin/bhyve/mptbl.c ============================================================================== --- head/usr.sbin/bhyve/mptbl.c Fri May 2 01:39:44 2014 (r265210) +++ head/usr.sbin/bhyve/mptbl.c Fri May 2 04:51:31 2014 (r265211) @@ -303,16 +303,31 @@ mptable_build(struct vmctx *ctx, int ncp proc_entry_ptr mpep; mpfps_t mpfp; int_entry_ptr mpie; - int ioints; + int ioints, bus; char *curraddr; char *startaddr; startaddr = paddr_guest2host(ctx, MPTABLE_BASE, MPTABLE_MAX_LENGTH); if (startaddr == NULL) { - printf("mptable requires mapped mem\n"); + fprintf(stderr, "mptable requires mapped mem\n"); return (ENOMEM); } + /* + * There is no way to advertise multiple PCI hierarchies via MPtable + * so require that there is no PCI hierarchy with a non-zero bus + * number. + */ + for (bus = 1; bus <= PCI_BUSMAX; bus++) { + if (pci_bus_configured(bus)) { + fprintf(stderr, "MPtable is incompatible with " + "multiple PCI hierarchies.\r\n"); + fprintf(stderr, "MPtable generation can be disabled " + "by passing the -Y option to bhyve(8).\r\n"); + return (EINVAL); + } + } + curraddr = startaddr; mpfp = (mpfps_t)curraddr; mpt_build_mpfp(mpfp, MPTABLE_BASE); Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Fri May 2 01:39:44 2014 (r265210) +++ head/usr.sbin/bhyve/pci_emul.c Fri May 2 04:51:31 2014 (r265211) @@ -1261,6 +1261,13 @@ pci_write_dsdt(void) } int +pci_bus_configured(int bus) +{ + assert(bus >= 0 && bus < MAXBUSES); + return (pci_businfo[bus] != NULL); +} + +int pci_msi_enabled(struct pci_devinst *pi) { return (pi->pi_msi.enabled); Modified: head/usr.sbin/bhyve/pci_emul.h ============================================================================== --- head/usr.sbin/bhyve/pci_emul.h Fri May 2 01:39:44 2014 (r265210) +++ head/usr.sbin/bhyve/pci_emul.h Fri May 2 04:51:31 2014 (r265211) @@ -233,6 +233,7 @@ uint64_t pci_emul_msix_tread(struct pci_ int pci_count_lintr(int bus); void pci_walk_lintr(int bus, pci_lintr_cb cb, void *arg); void pci_write_dsdt(void); +int pci_bus_configured(int bus); static __inline void pci_set_cfgdata8(struct pci_devinst *pi, int offset, uint8_t val) From owner-svn-src-head@FreeBSD.ORG Fri May 2 05:30:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 627378D2; Fri, 2 May 2014 05:30:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3661219E1; Fri, 2 May 2014 05:30:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s425Uo9d055324; Fri, 2 May 2014 05:30:50 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s425UnvI055322; Fri, 2 May 2014 05:30:49 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201405020530.s425UnvI055322@svn.freebsd.org> From: Eitan Adler Date: Fri, 2 May 2014 05:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265212 - in head: . share/man/man4 sys/dev/lindev X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 05:30:50 -0000 Author: eadler Date: Fri May 2 05:30:49 2014 New Revision: 265212 URL: http://svnweb.freebsd.org/changeset/base/265212 Log: lindev(4): remove the device lindev(4) was only used to provide /dev/full which is now a standard feature of FreeBSD. /dev/full was never linux-specific and provides a generally useful feature. Document this in UPDATING and bump __FreeBSD_version. This will be documented in the PH shortly. Reported by: jkim Deleted: head/share/man/man4/lindev.4 head/sys/dev/lindev/ Modified: head/UPDATING head/share/man/man4/Makefile Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri May 2 04:51:31 2014 (r265211) +++ head/UPDATING Fri May 2 05:30:49 2014 (r265212) @@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20140430: + The lindev device has been removed since /dev/full has been made a + standard device. __FreeBSD_version has been bumped. + 20140418: The YES_HESIOD knob has been removed. It has been obsolete for a decade. Please move to using WITH_HESIOD instead or your builds Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri May 2 04:51:31 2014 (r265211) +++ head/share/man/man4/Makefile Fri May 2 05:30:49 2014 (r265212) @@ -142,6 +142,7 @@ MAN= aac.4 \ filemon.4 \ firewire.4 \ fpa.4 \ + full.4 \ fwe.4 \ fwip.4 \ fwohci.4 \ @@ -226,7 +227,6 @@ MAN= aac.4 \ le.4 \ led.4 \ lge.4 \ - ${_lindev.4} \ ${_linux.4} \ lmc.4 \ lo.4 \ @@ -790,7 +790,6 @@ _if_vxge.4= if_vxge.4 _if_wpi.4= if_wpi.4 _ipmi.4= ipmi.4 _io.4= io.4 -_lindev.4= lindev.4 _linux.4= linux.4 _ndis.4= ndis.4 _nfe.4= nfe.4 @@ -819,7 +818,6 @@ _wpi.4= wpi.4 _xen.4= xen.4 _xnb.4= xnb.4 -MLINKS+=lindev.4 full.4 .endif .if ${MACHINE_CPUARCH} == "amd64" From owner-svn-src-head@FreeBSD.ORG Fri May 2 05:33:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 310EFA3A for ; Fri, 2 May 2014 05:33:53 +0000 (UTC) Received: from mail-qa0-x22e.google.com (mail-qa0-x22e.google.com [IPv6:2607:f8b0:400d:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDE781A6B for ; Fri, 2 May 2014 05:33:52 +0000 (UTC) Received: by mail-qa0-f46.google.com with SMTP id w8so3807814qac.5 for ; Thu, 01 May 2014 22:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=GMOVyI2gxhuGkemHzxnzH1XaEcW1J614WAcFfx4n7nI=; b=YouiDF4wwbOld2+AeUbuHQLkSKza4qVNnus7cHNC0rBHkubK3f8+Yz5/C+zi/VBfYF rmiOCeSyPs/RXcbmymgBAJkwCCa3xbdhi1rEjDNzNJgjTvu463qZcVp6TeyuGrayVSje jBOYw63+zZS7rsG7Sr8wcmQ7N8qvujxkUqbMw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=GMOVyI2gxhuGkemHzxnzH1XaEcW1J614WAcFfx4n7nI=; b=ZOYCaaKzILxESiFp6r12ncslmoPXM0u4Sb2ATKIhgwZFIf6hDHrUbb8zAMZuwMbeqa V1+3z03kyDnec1TBdszw+a58vd78uzUvQnw089h/vTBkkHRoQQ7MHblYf0QPUcVEP+A1 IFMwB0xvgwoGyVfJ7UC//Dn3s4FAaDbrncJtyiz1eO0ccpXFOlFOKzSdly6R1NdoFi99 jm3evMHHCQXYqggnHaUTxqn98VJKLIS3+Sl+NQRGnhIRcucFUEQyDs55pw0Tp2N4ojIv hbAOVtogYL/pFwcXVc7U+YVagSlPT15rEgFxmQysbU9K1zlE+203yI8hmw7hD1w6ljR0 yUSg== X-Gm-Message-State: ALoCoQlgm4PWUCmuX9u8AaIGnMJajheFj7mAjBfI55qpnpijnFmMuiGIKOT7J3dLsu2dNStmQMBB X-Received: by 10.140.104.78 with SMTP id z72mr18595895qge.60.1399008831908; Thu, 01 May 2014 22:33:51 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.54.102 with HTTP; Thu, 1 May 2014 22:33:21 -0700 (PDT) In-Reply-To: <53627D8C.3030404@FreeBSD.org> References: <201404300620.s3U6Kmn6074492@svn.freebsd.org> <5361512A.7070205@FreeBSD.org> <53627D8C.3030404@FreeBSD.org> From: Eitan Adler Date: Thu, 1 May 2014 22:33:21 -0700 X-Google-Sender-Auth: ShaXxV0V8gV1BORDuVtGxaJQuX4 Message-ID: Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null To: Jung-uk Kim Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 05:33:53 -0000 On 1 May 2014 09:59, Jung-uk Kim wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 2014-04-30 15:38:18 -0400, ?? wrote: >> On 2014-04-30 02:20:48 -0400, ?? wrote: >>> Author: eadler Date: Wed Apr 30 06:20:48 2014 New Revision: >>> 265132 URL: http://svnweb.freebsd.org/changeset/base/265132 >>> >>> Log: Add a /dev/full device. >>> >>> /dev/full is similar to /dev/zero except it always returns ENOSPC >>> when you attempt to write to it. >>> >>> Reviewed by: jhibbits Discussed with: rpaulo >> ... Please see lindev(4). > > I guess I wasn't loud enough. We already had the exact same feature > via lindev(4). In fact, now it panics if we load both, i.e., > "make_dev_credv: bad si_name (error=17, si_name=full)". Please see > sys/dev/lindev/full.c. Also, the manual page is still symlinked from > lindev.4. Thanks for letting me know about lindev(4). I've brought up /dev/full to a few people and no one else mentioned it. Since /dev/full is not linux specific and code/binary size addition is minor I've opted to just remove lindev and leave my implementation. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Fri May 2 07:04:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB8A5CC7; Fri, 2 May 2014 07:04:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EC92128E; Fri, 2 May 2014 07:04:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4274Z3F094986; Fri, 2 May 2014 07:04:35 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4274Zki094985; Fri, 2 May 2014 07:04:35 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201405020704.s4274Zki094985@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 2 May 2014 07:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265214 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 07:04:35 -0000 Author: des Date: Fri May 2 07:04:35 2014 New Revision: 265214 URL: http://svnweb.freebsd.org/changeset/base/265214 Log: The mergeinfo was somehow left out of previous commit. Modified: Directory Properties: head/crypto/openssh/ (props changed) From owner-svn-src-head@FreeBSD.ORG Fri May 2 07:14:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2863020E; Fri, 2 May 2014 07:14:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 154AA136F; Fri, 2 May 2014 07:14:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s427ENp0099200; Fri, 2 May 2014 07:14:23 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s427EMew099192; Fri, 2 May 2014 07:14:22 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201405020714.s427EMew099192@svn.freebsd.org> From: Eitan Adler Date: Fri, 2 May 2014 07:14:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265215 - in head/sys: amd64/conf boot/forth conf i386/conf pc98/conf sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 07:14:24 -0000 Author: eadler Date: Fri May 2 07:14:22 2014 New Revision: 265215 URL: http://svnweb.freebsd.org/changeset/base/265215 Log: lindev(4): finish the partial commit in r265212 lindev(4) was only used to provide /dev/full which is now a standard feature of FreeBSD. /dev/full was never linux-specific and provides a generally useful feature. Document this in UPDATING and bump __FreeBSD_version. This will be documented in the PH shortly. Reported by: jkim Modified: head/sys/amd64/conf/NOTES head/sys/boot/forth/loader.conf head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/i386/conf/NOTES head/sys/pc98/conf/NOTES head/sys/sys/param.h Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Fri May 2 07:04:35 2014 (r265214) +++ head/sys/amd64/conf/NOTES Fri May 2 07:14:22 2014 (r265215) @@ -647,8 +647,5 @@ options VM_KMEM_SIZE_SCALE options NDISAPI device ndis -# Linux-specific pseudo devices support -device lindev - # Module to enable execution of application via emulators like QEMU options IMAGACT_BINMISC Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Fri May 2 07:04:35 2014 (r265214) +++ head/sys/boot/forth/loader.conf Fri May 2 07:14:22 2014 (r265215) @@ -241,7 +241,6 @@ screensave_name="green_saver" # Set to t ibcs2_load="NO" # IBCS2 (SCO) emulation ibcs2_coff_load="NO" linux_load="NO" # Linux emulation -lindev_load="NO" # Linux-specific pseudo devices (see lindev(4)) svr4_load="NO" # SystemV R4 emulation streams_load="NO" # System V streams module Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Fri May 2 07:04:35 2014 (r265214) +++ head/sys/conf/files.amd64 Fri May 2 07:14:22 2014 (r265215) @@ -232,8 +232,6 @@ dev/hyperv/vmbus/hv_hv.c optional hyp dev/hyperv/vmbus/hv_ring_buffer.c optional hyperv dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c optional hyperv dev/kbd/kbd.c optional atkbd | sc | ukbd | vt -dev/lindev/full.c optional lindev -dev/lindev/lindev.c optional lindev dev/nfe/if_nfe.c optional nfe pci dev/ntb/if_ntb/if_ntb.c optional if_ntb dev/ntb/ntb_hw/ntb_hw.c optional if_ntb ntb_hw Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Fri May 2 07:04:35 2014 (r265214) +++ head/sys/conf/files.i386 Fri May 2 07:14:22 2014 (r265215) @@ -240,8 +240,6 @@ dev/ipmi/ipmi_pci.c optional ipmi pci dev/ipmi/ipmi_linux.c optional ipmi compat_linux dev/kbd/kbd.c optional atkbd | sc | ukbd | vt dev/le/if_le_isa.c optional le isa -dev/lindev/full.c optional lindev -dev/lindev/lindev.c optional lindev dev/mse/mse.c optional mse dev/mse/mse_isa.c optional mse isa dev/nfe/if_nfe.c optional nfe pci Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Fri May 2 07:04:35 2014 (r265214) +++ head/sys/i386/conf/NOTES Fri May 2 07:14:22 2014 (r265215) @@ -1002,9 +1002,6 @@ device streams # STREAMS network drive options NDISAPI device ndis -# Linux-specific pseudo devices support -device lindev - ##################################################################### # VM OPTIONS Modified: head/sys/pc98/conf/NOTES ============================================================================== --- head/sys/pc98/conf/NOTES Fri May 2 07:04:35 2014 (r265214) +++ head/sys/pc98/conf/NOTES Fri May 2 07:14:22 2014 (r265215) @@ -545,9 +545,6 @@ options COMPAT_SVR4 # build emulator st options DEBUG_SVR4 # enable verbose debugging device streams # STREAMS network driver (required for svr4). -# Linux-specific pseudo devices support -device lindev - ##################################################################### # VM OPTIONS Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri May 2 07:04:35 2014 (r265214) +++ head/sys/sys/param.h Fri May 2 07:14:22 2014 (r265215) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100019 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100020 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Fri May 2 07:57:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10BCA84F; Fri, 2 May 2014 07:57:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F14DD16CC; Fri, 2 May 2014 07:57:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s427veIG015752; Fri, 2 May 2014 07:57:40 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s427veV4015749; Fri, 2 May 2014 07:57:40 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201405020757.s427veV4015749@svn.freebsd.org> From: Robert Watson Date: Fri, 2 May 2014 07:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265216 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 07:57:41 -0000 Author: rwatson Date: Fri May 2 07:57:40 2014 New Revision: 265216 URL: http://svnweb.freebsd.org/changeset/base/265216 Log: Garbage collect mtxpool_lockbuilder, the mutex pool historically used for lockmgr and sx interlocks, but unused since optimised versions of those sleep locks were introduced. This will save a (quite) small amount of memory in all kernel configurations. The sleep mutex pool is retained as it is used for 'struct bio' and several other consumers. Discussed with: jhb MFC after: 3 days Modified: head/sys/kern/kern_mtxpool.c head/sys/sys/kernel.h head/sys/sys/mutex.h Modified: head/sys/kern/kern_mtxpool.c ============================================================================== --- head/sys/kern/kern_mtxpool.c Fri May 2 07:14:22 2014 (r265215) +++ head/sys/kern/kern_mtxpool.c Fri May 2 07:57:40 2014 (r265216) @@ -59,9 +59,6 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_MTXPOOL, "mtx_pool", "mutex pool"); /* Pool sizes must be a power of two */ -#ifndef MTX_POOL_LOCKBUILDER_SIZE -#define MTX_POOL_LOCKBUILDER_SIZE 128 -#endif #ifndef MTX_POOL_SLEEP_SIZE #define MTX_POOL_SLEEP_SIZE 128 #endif @@ -78,18 +75,12 @@ struct mtx_pool { struct mtx mtx_pool_ary[1]; }; -static struct mtx_pool_lockbuilder { - struct mtxpool_header mtx_pool_header; - struct mtx mtx_pool_ary[MTX_POOL_LOCKBUILDER_SIZE]; -} lockbuilder_pool; - #define mtx_pool_size mtx_pool_header.mtxpool_size #define mtx_pool_mask mtx_pool_header.mtxpool_mask #define mtx_pool_shift mtx_pool_header.mtxpool_shift #define mtx_pool_next mtx_pool_header.mtxpool_next struct mtx_pool *mtxpool_sleep; -struct mtx_pool *mtxpool_lockbuilder; #if UINTPTR_MAX == UINT64_MAX /* 64 bits */ # define POINTER_BITS 64 @@ -166,15 +157,6 @@ mtx_pool_destroy(struct mtx_pool **poolp } static void -mtx_pool_setup_static(void *dummy __unused) -{ - mtx_pool_initialize((struct mtx_pool *)&lockbuilder_pool, - "lockbuilder mtxpool", MTX_POOL_LOCKBUILDER_SIZE, - MTX_DEF | MTX_NOWITNESS | MTX_QUIET); - mtxpool_lockbuilder = (struct mtx_pool *)&lockbuilder_pool; -} - -static void mtx_pool_setup_dynamic(void *dummy __unused) { mtxpool_sleep = mtx_pool_create("sleep mtxpool", @@ -202,17 +184,5 @@ mtx_pool_alloc(struct mtx_pool *pool) return (&pool->mtx_pool_ary[i]); } -/* - * The lockbuilder pool must be initialized early because the lockmgr - * and sx locks depend on it. The sx locks are used in the kernel - * memory allocator. The lockmgr subsystem is initialized by - * SYSINIT(..., SI_SUB_LOCKMGR, ...). - * - * We can't call malloc() to dynamically allocate the sleep pool - * until after kmeminit() has been called, which is done by - * SYSINIT(..., SI_SUB_KMEM, ...). - */ -SYSINIT(mtxpooli1, SI_SUB_MTX_POOL_STATIC, SI_ORDER_FIRST, - mtx_pool_setup_static, NULL); SYSINIT(mtxpooli2, SI_SUB_MTX_POOL_DYNAMIC, SI_ORDER_FIRST, mtx_pool_setup_dynamic, NULL); Modified: head/sys/sys/kernel.h ============================================================================== --- head/sys/sys/kernel.h Fri May 2 07:14:22 2014 (r265215) +++ head/sys/sys/kernel.h Fri May 2 07:57:40 2014 (r265216) @@ -92,7 +92,6 @@ enum sysinit_sub_id { SI_SUB_COPYRIGHT = 0x0800001, /* first use of console*/ SI_SUB_SETTINGS = 0x0880000, /* check and recheck settings */ SI_SUB_MTX_POOL_STATIC = 0x0900000, /* static mutex pool */ - SI_SUB_LOCKMGR = 0x0980000, /* lockmgr locks */ SI_SUB_VM = 0x1000000, /* virtual memory system init*/ SI_SUB_KMEM = 0x1800000, /* kernel memory*/ SI_SUB_KVM_RSRC = 0x1A00000, /* kvm operational limits*/ Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Fri May 2 07:14:22 2014 (r265215) +++ head/sys/sys/mutex.h Fri May 2 07:57:40 2014 (r265216) @@ -323,12 +323,8 @@ struct mtx *mtx_pool_alloc(struct mtx_po mtx_unlock_spin(mtx_pool_find((pool), (ptr))) /* - * mtxpool_lockbuilder is a pool of sleep locks that is not witness - * checked and should only be used for building higher level locks. - * * mtxpool_sleep is a general purpose pool of sleep mutexes. */ -extern struct mtx_pool *mtxpool_lockbuilder; extern struct mtx_pool *mtxpool_sleep; #ifndef LOCK_DEBUG From owner-svn-src-head@FreeBSD.ORG Fri May 2 08:26:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B78C5D84; Fri, 2 May 2014 08:26:46 +0000 (UTC) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7861A1932; Fri, 2 May 2014 08:26:45 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 0241C3C12F9; Fri, 2 May 2014 17:57:20 +1000 (EST) Date: Fri, 2 May 2014 17:57:02 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler Subject: Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null In-Reply-To: Message-ID: <20140502165438.D1112@besplex.bde.org> References: <201404300620.s3U6Kmn6074492@svn.freebsd.org> <5361512A.7070205@FreeBSD.org> <53627D8C.3030404@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=QIpRGG7L c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=BuGJK2ebvAQA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=lpW0VMHjAf6UbcIGi6sA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jung-uk Kim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 08:26:46 -0000 On Thu, 1 May 2014, Eitan Adler wrote: > On 1 May 2014 09:59, Jung-uk Kim wrote: >> On 2014-04-30 15:38:18 -0400, ?? wrote: >>> On 2014-04-30 02:20:48 -0400, ?? wrote: Mail clients keep getting worse. Fitst the apostrophes were corrupted, now the names... >>>> Author: eadler Date: Wed Apr 30 06:20:48 2014 New Revision: >>>> 265132 URL: http://svnweb.freebsd.org/changeset/base/265132 >>>> >>>> Log: Add a /dev/full device. >>>> >>>> /dev/full is similar to /dev/zero except it always returns ENOSPC >>>> when you attempt to write to it. >>>> >>>> Reviewed by: jhibbits Discussed with: rpaulo >>> ... Please see lindev(4). >> >> I guess I wasn't loud enough. We already had the exact same feature >> via lindev(4). In fact, now it panics if we load both, i.e., >> "make_dev_credv: bad si_name (error=17, si_name=full)". Please see >> sys/dev/lindev/full.c. Also, the manual page is still symlinked from >> lindev.4. > > Thanks for letting me know about lindev(4). I've brought up /dev/full > to a few people and no one else mentioned it. Since /dev/full is not > linux specific and code/binary size addition is minor I've opted to > just remove lindev and leave my implementation. It seems reasonable to have it unconditional, since it is so small when it is not a separate module. Please merge any better style from lindev to null.c. I only noticed a couple of remaining style bugs in the new code in null.c. There are a few more in old code in null.c. lindev has about the same density of style bugs: full.c: % /* ARGSUSED */ The __unused annotations are ugly enough. lint has been unusable for a long time. % static int % full_read(struct cdev *dev __unused, struct uio *uio, int flags __unused) % { % int error = 0; Initialization in declaration. % % while (uio->uio_resid > 0 && error == 0) % error = uiomove(zbuf, MIN(uio->uio_resid, PAGE_SIZE), uio); Use of the MIN() macro. MIN() was removed from the kernel in 4.4BSD, but was restored in FreeBSD to allow broken code that uses it to work. The min() family of inline functions is supposed to be used in 4.4BSD and later. It is still used a lot. However, it is broken as designed since it is type-specific and thus is especially hard to use with typedefed types like typeof(uio->uio_resid). MIN() has smaller design errors. The correct API is a type-generic version of min(). Unfortunately, the good name min() is already used (it means take the minimum of u_int values). % Extra blank line. % return (error); % } % % /* ARGSUSED */ As above. % static int % full_write(struct cdev *dev __unused, struct uio *uio __unused, % int flags __unused) % { % This blank line is not extra, but is perfectly ugly to style(9) spec. % return (ENOSPC); % } % % /* ARGSUSED */ % int % lindev_modevent_full(module_t mod __unused, int type, void *data __unused) % { % % switch(type) { % case MOD_LOAD: % zbuf = (void *)malloc(PAGE_SIZE, M_TEMP, M_WAITOK | M_ZERO); Bogus cast. Has no effect. This is not C++. % full_dev = make_dev(&full_cdevsw, 0, UID_ROOT, GID_WHEEL, % 0666, "full"); % if (bootverbose) % printf("full: \n"); I don't like hiding this under bootverbose. 1 line per device is not much spam. % break; % I don't like the style of an extra blank line for each case in a switch. This style is normal in the kernel, but is not permitted by style(9) (because the example in style(9) doesn't use it). Fully ugly versions of this style put the extra blank line before each case statement. This switch statement is missing the extra blank line before the first case statement. null.c does this inconsistently. It uses the extra blank line for the switch statement in null_modevent(), but not for any other switch statement in the file. indent(1) has no chance of preserving such differences. % case MOD_UNLOAD: % destroy_dev(full_dev); % free(zbuf, M_TEMP); % break; % % case MOD_SHUTDOWN: % break; % % default: % return (EOPNOTSUPP); % } % Extra blank line. % return (0); % } lindev.c: % ... % /* % * "lindev" is supposed to be a collection of linux-specific devices % * that we also support, just not by default. % * While currently there is only "/dev/full", we are planning to see % * more in the future. % * This file is only the container to load/unload all supported devices; % * the implementation of each should go into its own file. % */ There is only dev/full in lindev now. I don't like having lots of little files supporting 1 feature each or 1 feature across 3 files. After removing lindev/full.c but not all of lindev, the 2 remaining files support 0 features. Removing all of lindev would break adding more features, if any. % /* ARGSUSED */ % static int % lindev_modevent(module_t mod, int type, void *data) Here there is useless lint markup, but no useful compiler markup (__unused). Since this apparently compilers without the markup, why use it at all? lindev.h: % ... % #ifndef _DEV_LINDEV_LINDEV_H Tab instead of space after #ifndef Nonstandard idempotency macro name. Standard ones have a trailing underscore. % #define _DEV_LINDEV_LINDEV_H % % int lindev_modevent_full(module_t, int, void *); Non-fancy formatting (no indentation of the function name). % % #endif /* _DEV_LINDEV_LINDEV_H */ Backwards comment on endif. null.c (before your changes): % #include % #include % #include % #include % #include % #include % #include % #include % #include % #include % #include Totally disorded includes. % /* For use with destroy_dev(9). */ % static struct cdev *null_dev; % static struct cdev *zero_dev; Unnecessary comment. The code is very simple, and commenting just this 1 part of it is not useful. % % static d_write_t null_write; % static d_ioctl_t null_ioctl; % static d_ioctl_t zero_ioctl; % static d_read_t zero_read; Unsorted declarations. They are in the same "logical" order as the cdevsw struct members. I don't like using the typedefs to hide the prototypes. % % static struct cdevsw null_cdevsw = { % .d_version = D_VERSION, % .d_read = (d_read_t *)nullop, % .d_write = null_write, % .d_ioctl = null_ioctl, % .d_name = "null", % }; % % static struct cdevsw zero_cdevsw = { % .d_version = D_VERSION, % .d_read = zero_read, % .d_write = null_write, % .d_ioctl = zero_ioctl, % .d_name = "zero", % .d_flags = D_MMAP_ANON, % }; Before C99, the cdevsw initializers had to be in struct member order. This order is still mostly used. % % /* ARGSUSED */ % static int % null_write(struct cdev *dev __unused, struct uio *uio, int flags __unused) % { Missing blank line after declarations. % uio->uio_resid = 0; % Extra blank line. % return (0); % } % % /* ARGSUSED */ % static int % null_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t data __unused, % int flags __unused, struct thread *td) % { % int error; Missing blank line after declarations. % error = 0; % Extra blank line. % switch (cmd) { % case DIOCSKERNELDUMP: % error = priv_check(td, PRIV_SETDUMPER); % if (error == 0) % error = set_dumper(NULL, NULL); % break; % case FIONBIO: % break; % case FIOASYNC: % if (*(int *)data != 0) % error = EINVAL; % break; % default: % error = ENOIOCTL; % } % return (error); % } % % /* ARGSUSED */ % static int % zero_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t data __unused, % int flags __unused, struct thread *td) Gnu-style continuation indentation (indent -lp). KNF indentation (indent -ci4) is used for zero_ioctl(). % { % int error; % error = 0; % Blank lines in all the wrong places, as above. % switch (cmd) { % case FIONBIO: % break; % case FIOASYNC: % if (*(int *)data != 0) % error = EINVAL; % break; % default: % error = ENOIOCTL; % } % return (error); % } % % % /* ARGSUSED */ % static int % zero_read(struct cdev *dev __unused, struct uio *uio, int flags __unused) % { % void *zbuf; % ssize_t len; % int error = 0; % Blank lines in all the wrong places, as above. % KASSERT(uio->uio_rw == UIO_READ, % ("Can't be in %s for write", __func__)); Obfuscation of the function name using __func__. The messages is rather cryptic, and not in a standard format like ": ". Why assert this at all. zero_read() is only attached to d_read, so this assertion is about as useful as a parity check on entry to zero_read() but not for functions that are actually important. % zbuf = __DECONST(void *, zero_region); Use of the __DECONST() to hide type errors. I don't see how to avoid the type errors. The problem is that uiomove() can go in both directions, and in one direction the pointer needs to be to-non-const, so pointers that start as to-const for the other direction need to be corrupted. Here we start with a const zero_region and have to corrupt the pointer. This is safe since the uiomove() is only from zero_region. struct uiovec has similar design errors (there is a void * pointer in it that has to be used for both directions). Old versions of /dev/zero avoided this problem by malloc()ing a zero region just for /dev/zero and not declaring the pointer to it as volatile. % while (uio->uio_resid > 0 && error == 0) { % len = uio->uio_resid; % if (len > ZERO_REGION_SIZE) % len = ZERO_REGION_SIZE; % error = uiomove(zbuf, len, uio); % } % Extra blank line. % return (error); % } % ... Bruce From owner-svn-src-head@FreeBSD.ORG Fri May 2 08:34:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE618F36; Fri, 2 May 2014 08:34:54 +0000 (UTC) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 401FD19D5; Fri, 2 May 2014 08:34:54 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 309461A4D6B; Fri, 2 May 2014 18:34:47 +1000 (EST) Date: Fri, 2 May 2014 18:34:40 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Luiz Otavio O Souza Subject: Re: svn commit: r265191 - head/sys/dev/gpio In-Reply-To: <201405011409.s41E9mun075016@svn.freebsd.org> Message-ID: <20140502180115.I1337@besplex.bde.org> References: <201405011409.s41E9mun075016@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=U6SrU4bu c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=WU5SAaDETzEA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=YRN3L0-C4pmnSk9kEeAA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 08:34:54 -0000 On Thu, 1 May 2014, Luiz Otavio O Souza wrote: > Log: > Remove unnecessary headers. Sort out the headers. Add a missing header on > ofw_gpiobus.c (it was working because of sys/libkern.h). Do you use /usr/src/tools/tools/kerninclude/kerninclude.sh to find the unused includes? There are many false positives and negatives which are hard to find without a lot of testing. kerninclude.sh automates some of the testing. I think it is rarely used and has rotted. A full universe build is probably required, but kerninclude.sh is i386-centric and only tests LINT, GENERIC and GENERIC98 (GENERIC98 last existed in the source tree in FreeBSD-3, but the script creates it by copying GENERIC and building with pc98 options). I prefer my unusedinc script. It is easier to run 1 on file at a time, but does less hacking to reduce the false positives and negatives. > Modified: head/sys/dev/gpio/gpiobus.c > ============================================================================== > --- head/sys/dev/gpio/gpiobus.c Thu May 1 14:08:19 2014 (r265190) > +++ head/sys/dev/gpio/gpiobus.c Thu May 1 14:09:47 2014 (r265191) > @@ -28,21 +28,16 @@ > __FBSDID("$FreeBSD$"); > > #include > -#include This unsorts the includes. must be included after , and should be always included, since other headers may depend on it (for things like KASSERT() in inline functions). Some broken headers include it nested. This makes it difficult to tell whether it is used. Some other headers that don't do this may compile accidentally because they are included after the polluted ones. > +#include > +#include > +#include > #include > #include > -#include > -#include is probably used. It is included nested in many headers, and this is not considered pollution, unlike for , but it makes it very hard to determine if is included as needed in other headers and .c files. kerninclude.sh attempts to determine if headers like are needed by doing things like replacing it by an empty header in some contexts. I suspect this doesn't handle the full complications. Ideally, the include of in a .c file should be explicit iff the .c files uses any queue macro. > -#include > +#include > #include is certainly not needed. It is standard pollution in , and it is a style bug to not depend on that. It is also usually a style bug (in kernel code) to include and not include . Many things depend on the standard pollution, or might be changed to depend on it. > Modified: head/sys/dev/gpio/ofw_gpiobus.c > ============================================================================== > --- head/sys/dev/gpio/ofw_gpiobus.c Thu May 1 14:08:19 2014 (r265190) > +++ head/sys/dev/gpio/ofw_gpiobus.c Thu May 1 14:09:47 2014 (r265191) > @@ -33,17 +33,13 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include Correct. is standard pollution in , and it is a style bug to include it directly. > -#include > #include > -#include > +#include Not using mutexes may indicate missing locking. I think this works because almost everything in new-bus is Giant-locked and Giant locking hides its own details very well. Elsewhere, there are lots of polluting nested includes of and (not even of and which make it very unclear whether explicit includes of these are needed. The worst cases are in , , , , and . Only some of these are relatively easy to fix by including in the headers. Bruce From owner-svn-src-head@FreeBSD.ORG Fri May 2 09:24:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BC08967; Fri, 2 May 2014 09:24:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78A741DCC; Fri, 2 May 2014 09:24:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s429O7vM051743; Fri, 2 May 2014 09:24:07 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s429O7sW051742; Fri, 2 May 2014 09:24:07 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405020924.s429O7sW051742@svn.freebsd.org> From: Christian Brueffer Date: Fri, 2 May 2014 09:24:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265217 - in head/sys/modules: . lindev X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 09:24:07 -0000 Author: brueffer Date: Fri May 2 09:24:06 2014 New Revision: 265217 URL: http://svnweb.freebsd.org/changeset/base/265217 Log: libdev(4) has been removed, get rid of the module as well to fix the build. Submitted by: Sainath Varanasi Deleted: head/sys/modules/lindev/ Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 2 07:57:40 2014 (r265216) +++ head/sys/modules/Makefile Fri May 2 09:24:06 2014 (r265217) @@ -186,7 +186,6 @@ SUBDIR= \ libiconv \ libmbpool \ libmchain \ - ${_lindev} \ ${_linprocfs} \ ${_linsysfs} \ ${_linux} \ @@ -514,7 +513,6 @@ _io= io .if ${MK_OFED} != "no" || defined(ALL_MODULES) _ipoib= ipoib .endif -_lindev= lindev _linprocfs= linprocfs _linsysfs= linsysfs _linux= linux @@ -716,7 +714,6 @@ _iwnfw= iwnfw .endif _ixgb= ixgb _ixgbe= ixgbe -_lindev= lindev _linprocfs= linprocfs _linsysfs= linsysfs _linux= linux From owner-svn-src-head@FreeBSD.ORG Fri May 2 09:31:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87532D74; Fri, 2 May 2014 09:31:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 746CF1FF8; Fri, 2 May 2014 09:31:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s429VMGk055499; Fri, 2 May 2014 09:31:22 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s429VMS6055498; Fri, 2 May 2014 09:31:22 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201405020931.s429VMS6055498@svn.freebsd.org> From: Steven Hartland Date: Fri, 2 May 2014 09:31:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265218 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 09:31:22 -0000 Author: smh Date: Fri May 2 09:31:21 2014 New Revision: 265218 URL: http://svnweb.freebsd.org/changeset/base/265218 Log: Removed pointless / duplicated call to trim_map_first. MFC after: 1 month X-MFC-With: r265152 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Fri May 2 09:24:06 2014 (r265217) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Fri May 2 09:31:21 2014 (r265218) @@ -490,7 +490,6 @@ trim_map_vdev_commit(spa_t *spa, zio_t * zio_nowait(zio_trim(zio, spa, vd, offset, size)); mutex_enter(&tm->tm_lock); - ts = trim_map_first(tm, txgtarget, txgsafe, timelimit); } mutex_exit(&tm->tm_lock); } From owner-svn-src-head@FreeBSD.ORG Fri May 2 11:09:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D86A1EA8; Fri, 2 May 2014 11:09:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C589119B3; Fri, 2 May 2014 11:09:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s42B9119098815; Fri, 2 May 2014 11:09:01 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42B91GC098814; Fri, 2 May 2014 11:09:01 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405021109.s42B91GC098814@svn.freebsd.org> From: Christian Brueffer Date: Fri, 2 May 2014 11:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265225 - in head: sys/conf tools/kerneldoc/subsys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 11:09:01 -0000 Author: brueffer Date: Fri May 2 11:09:01 2014 New Revision: 265225 URL: http://svnweb.freebsd.org/changeset/base/265225 Log: Clean up more lindev(4) vestiges. Deleted: head/tools/kerneldoc/subsys/Doxyfile-dev_lindev Modified: head/sys/conf/files.pc98 Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Fri May 2 10:48:26 2014 (r265224) +++ head/sys/conf/files.pc98 Fri May 2 11:09:01 2014 (r265225) @@ -110,8 +110,6 @@ dev/hwpmc/hwpmc_x86.c optional hwpmc dev/io/iodev.c optional io dev/kbd/kbd.c optional pckbd | sc | ukbd dev/le/if_le_cbus.c optional le isa -dev/lindev/full.c optional lindev -dev/lindev/lindev.c optional lindev dev/mse/mse.c optional mse dev/mse/mse_cbus.c optional mse isa dev/sbni/if_sbni.c optional sbni From owner-svn-src-head@FreeBSD.ORG Fri May 2 13:54:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9C17C67 for ; Fri, 2 May 2014 13:54:46 +0000 (UTC) Received: from mail-pa0-x242.google.com (mail-pa0-x242.google.com [IPv6:2607:f8b0:400e:c03::242]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 958EC19CE for ; Fri, 2 May 2014 13:54:46 +0000 (UTC) Received: by mail-pa0-f66.google.com with SMTP id hz1so3206364pad.1 for ; Fri, 02 May 2014 06:54:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type :thread-index:content-language; bh=wAN6jzrVZ9OhYzyDl1S1JUg02x6IW7pi/g+oo93axi8=; b=o/ah+jqBtbaO3JxVA2OfVblxMmcW0q470YoACnu1hPom5sKW7Imrka7pcjcjPjBlZx k3eZNz9dmjfg+ZbrSb8zBp3KnzM5B+O5cazSIgKmSMtNDv9ulfM29BPsjWlg/rrQDnHo XYFT1L5FaFXxbgC1a4pdCmOziEs36RtfUenz1vyXK1w8KQYYz6avkzB8j9dqBYUI00wP 1Qu3drkb0/tIlgZJGR6cjieTyyphwVsBHZL5L8miY202I07l8jsFhjaQ2+ACcLmKOyK/ ReKI1mo1oxNwxjGDAhZKE4oazF1px7QKQPgWs58xDP7fARguC4NxrWyx2zNhk6NqdU/2 VaOw== X-Received: by 10.66.231.105 with SMTP id tf9mr35584338pac.84.1399038885567; Fri, 02 May 2014 06:54:45 -0700 (PDT) Received: from adminSPC ([122.177.235.166]) by mx.google.com with ESMTPSA id sy1sm183873741pab.30.2014.05.02.06.54.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 02 May 2014 06:54:45 -0700 (PDT) X-Google-Original-Message-ID: <146e01cf660e$0f32b370$2d981a50$@info@gmail.com> From: "Lakshmi Kumar" To: Subject: Web Designing & Development Services !! Date: Fri, 2 May 2014 19:24:23 +0530 Message-ID: <5363a3a5.0192420a.10bd.10b6@mx.google.com> MIME-Version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac9mDY4HZI89j0rJRCymDV/CBHE1Ig== Content-Language: en-us x-cr-hashedpuzzle: ANVy BT2c CD83 CldG DLeE DakW DcUg Dtqd Dys/ HDdf HPuS HcNm HnqY HtCi IR0K LN+f; 1; cwB2AG4ALQBzAHIAYwAtAGgAZQBhAGQAQABmAHIAZQBlAGIAcwBkAC4AbwByAGcA; Sosha1_v1; 7; {39C39C5F-DF49-41BE-BDA9-94BC9337E444}; cwBhAGwAZQBzAGYAcgBlAGUAcwBlAG8AcwBlAHIAdgBpAGMAZQAuAGkAbgBmAG8AQABnAG0AYQBpAGwALgBjAG8AbQA=; Fri, 02 May 2014 13:51:13 GMT; VwBlAGIAIABEAGUAcwBpAGcAbgBpAG4AZwAgACYAIABEAGUAdgBlAGwAbwBwAG0AZQBuAHQAIABTAGUAcgB2AGkAYwBlAHMAIAAhACEA x-cr-puzzleid: {39C39C5F-DF49-41BE-BDA9-94BC9337E444} X-Antivirus: avast! (VPS 140502-0, 05/02/2014), Outbound message X-Antivirus-Status: Clean Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.17 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 13:54:46 -0000 Hi, I found your web contact email svn-src-head@freebsd.org. I would like to discuss a business opportunity with you. My name is Lakshmi Kumar, Online Marketing Consultant. We are in Web Design and Development firm based in India, with over 6 years of experience. With Web Designing & Development, Flash Design, Graphic Design, PHP Development, CMS and E-commerce Solution. We offer following Services with affordable cost than what it might be in house: - PHP Website Development Mobile Application Development Joomla Website Development iPhone Apps Development Word press Website Development Andriod Apps Development Magento Website Development iPad Apps Development Shopify Website Development Android Tablet Apps Drupal Development Windows Applications Development Face book Aps & Social Media Mobile Website Development eCommerce Solutions iOS Apps Development Payment Gateway Integration Design I will highly appreciate if you have any requirement for the same or any other requirement on the above mentioned services provided by us. Looking forward to hearing from you. Kinds Regards, Lakshmi Kumar, Online Marketing Consultant Disclaimer: The CAN-SPAM Act of 2003 (Controlling the Assault of Non-Solicited Pornography and Marketing Act) establishes requirements for those who send commercial email, spells out penalties for spammers and companies whose products are advertised in spam if they violate the law, and gives consumers the right to ask mailers to stop spamming them. The above mail is in accordance to the Can Spam act of 2003: There are no deceptive subject lines and is a manual process through our efforts on World Wide Web. --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com From owner-svn-src-head@FreeBSD.ORG Fri May 2 15:05:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 878078F6; Fri, 2 May 2014 15:05:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 684291243; Fri, 2 May 2014 15:05:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s42F5moE099449; Fri, 2 May 2014 15:05:48 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42F5lQO099446; Fri, 2 May 2014 15:05:47 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201405021505.s42F5lQO099446@svn.freebsd.org> From: Bryan Drewery Date: Fri, 2 May 2014 15:05:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265229 - head/bin/ps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 15:05:48 -0000 Author: bdrewery Date: Fri May 2 15:05:47 2014 New Revision: 265229 URL: http://svnweb.freebsd.org/changeset/base/265229 Log: Add -J to filter by matching jail IDs and names. -J 0 can be used to show only host processes. Patch partially based on work by bz@ PR: bin/78763 MFC after: 2 weeks Relnotes: yes Modified: head/bin/ps/Makefile head/bin/ps/ps.1 head/bin/ps/ps.c Modified: head/bin/ps/Makefile ============================================================================== --- head/bin/ps/Makefile Fri May 2 14:47:53 2014 (r265228) +++ head/bin/ps/Makefile Fri May 2 15:05:47 2014 (r265229) @@ -11,7 +11,7 @@ SRCS= fmt.c keyword.c nlist.c print.c ps # on large systems. # CFLAGS+=-DLAZY_PS -DPADD= ${LIBM} ${LIBKVM} -LDADD= -lm -lkvm +DPADD= ${LIBM} ${LIBKVM} ${LIBJAIL} +LDADD= -lm -lkvm -ljail .include Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Fri May 2 14:47:53 2014 (r265228) +++ head/bin/ps/ps.1 Fri May 2 15:05:47 2014 (r265229) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd December 27, 2013 +.Dd May 2, 2014 .Dt PS 1 .Os .Sh NAME @@ -40,6 +40,7 @@ .Op Fl aCcdefHhjlmrSTuvwXxZ .Op Fl O Ar fmt | Fl o Ar fmt .Op Fl G Ar gid Ns Op , Ns Ar gid Ns Ar ... +.Op Fl J Ar jid Ns Op , Ns Ar jid Ns Ar ... .Op Fl M Ar core .Op Fl N Ar system .Op Fl p Ar pid Ns Op , Ns Ar pid Ns Ar ... @@ -62,7 +63,7 @@ will also display processes that do not .Pp A different set of processes can be selected for display by using any combination of the -.Fl a , G , p , T , t , +.Fl a , G , J , p , T , t , and .Fl U options. @@ -152,6 +153,20 @@ Print information associated with the fo .Cm user , pid , ppid , pgid , sid , jobc , state , tt , time , and .Cm command . +.It Fl J +Display information about processes which match the specified jail IDs. +This may be either the +.Cm jid +or +.Cm name +of the jail. +Use +.Fl J +.Sy 0 +to display only host processes. +This flag implies +.Fl x +by default. .It Fl L List the set of keywords available for the .Fl O Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Fri May 2 14:47:53 2014 (r265228) +++ head/bin/ps/ps.c Fri May 2 15:05:47 2014 (r265229) @@ -50,6 +50,7 @@ static char sccsid[] = "@(#)ps.c 8.4 (Be __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -62,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -124,6 +126,7 @@ struct listinfo { const char *lname; union { gid_t *gids; + int *jids; pid_t *pids; dev_t *ttys; uid_t *uids; @@ -132,6 +135,7 @@ struct listinfo { }; static int addelem_gid(struct listinfo *, const char *); +static int addelem_jid(struct listinfo *, const char *); static int addelem_pid(struct listinfo *, const char *); static int addelem_tty(struct listinfo *, const char *); static int addelem_uid(struct listinfo *, const char *); @@ -163,12 +167,12 @@ static char vfmt[] = "pid,state,time,sl, "%cpu,%mem,command"; static char Zfmt[] = "label"; -#define PS_ARGS "AaCcde" OPT_LAZY_f "G:gHhjLlM:mN:O:o:p:rSTt:U:uvwXxZ" +#define PS_ARGS "AaCcde" OPT_LAZY_f "G:gHhjJ:LlM:mN:O:o:p:rSTt:U:uvwXxZ" int main(int argc, char *argv[]) { - struct listinfo gidlist, pgrplist, pidlist; + struct listinfo gidlist, jidlist, pgrplist, pidlist; struct listinfo ruidlist, sesslist, ttylist, uidlist; struct kinfo_proc *kp; KINFO *kinfo = NULL, *next_KINFO; @@ -208,6 +212,7 @@ main(int argc, char *argv[]) prtheader = showthreads = wflag = xkeep_implied = 0; xkeep = -1; /* Neither -x nor -X. */ init_list(&gidlist, addelem_gid, sizeof(gid_t), "group"); + init_list(&jidlist, addelem_jid, sizeof(int), "jail id"); init_list(&pgrplist, addelem_pid, sizeof(pid_t), "process group"); init_list(&pidlist, addelem_pid, sizeof(pid_t), "process id"); init_list(&ruidlist, addelem_uid, sizeof(uid_t), "ruser"); @@ -275,6 +280,11 @@ main(int argc, char *argv[]) case 'h': prtheader = ws.ws_row > 5 ? ws.ws_row : 22; break; + case 'J': + add_list(&jidlist, optarg); + xkeep_implied = 1; + nselectors++; + break; case 'j': parsefmt(jfmt, 0); _fmt = 1; @@ -538,6 +548,11 @@ main(int argc, char *argv[]) if (kp->ki_rgid == gidlist.l.gids[elem]) goto keepit; } + if (jidlist.count > 0) { + for (elem = 0; elem < jidlist.count; elem++) + if (kp->ki_jid == jidlist.l.jids[elem]) + goto keepit; + } if (pgrplist.count > 0) { for (elem = 0; elem < pgrplist.count; elem++) if (kp->ki_pgid == @@ -666,6 +681,7 @@ main(int argc, char *argv[]) } } free_list(&gidlist); + free_list(&jidlist); free_list(&pidlist); free_list(&pgrplist); free_list(&ruidlist); @@ -727,6 +743,30 @@ addelem_gid(struct listinfo *inf, const } static int +addelem_jid(struct listinfo *inf, const char *elem) +{ + int tempid; + + if (*elem == '\0') { + warnx("Invalid (zero-length) jail id"); + optfatal = 1; + return (0); /* Do not add this value. */ + } + + tempid = jail_getid(elem); + if (tempid < 0) { + warnx("Invalid %s: %s", inf->lname, elem); + optfatal = 1; + return (0); + } + + if (inf->count >= inf->maxcount) + expand_list(inf); + inf->l.jids[(inf->count)++] = tempid; + return (1); +} + +static int addelem_pid(struct listinfo *inf, const char *elem) { char *endp; @@ -1373,7 +1413,7 @@ usage(void) (void)fprintf(stderr, "%s\n%s\n%s\n%s\n", "usage: ps " SINGLE_OPTS " [-O fmt | -o fmt] [-G gid[,gid...]]", - " [-M core] [-N system]", + " [-J jid[,jid...]] [-M core] [-N system]", " [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]", " ps [-L]"); exit(1); From owner-svn-src-head@FreeBSD.ORG Fri May 2 15:52:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1472DA7; Fri, 2 May 2014 15:52:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9ED2C17A9; Fri, 2 May 2014 15:52:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s42FqovS021167; Fri, 2 May 2014 15:52:50 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42FqoAJ021166; Fri, 2 May 2014 15:52:50 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405021552.s42FqoAJ021166@svn.freebsd.org> From: Glen Barber Date: Fri, 2 May 2014 15:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265230 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 15:52:50 -0000 Author: gjb Date: Fri May 2 15:52:50 2014 New Revision: 265230 URL: http://svnweb.freebsd.org/changeset/base/265230 Log: Clarify that MAKEOBJDIRPREFIX and MAKEOBJDIR are not honored as make(1) arguments. Requested by: smh MFC After: 3 days Sponsored by: The FreeBSD Foundation Modified: head/share/man/man5/make.conf.5 Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Fri May 2 15:05:47 2014 (r265229) +++ head/share/man/man5/make.conf.5 Fri May 2 15:52:50 2014 (r265230) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 28, 2013 +.Dd May 2, 2014 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -692,6 +692,8 @@ and .Ev MAKEOBJDIR are environment variables and should not be set in .Nm +or as command line arguments to +.Xr make 1 , but in make's environment. .Sh BUGS This manual page may occasionally be out of date with respect to From owner-svn-src-head@FreeBSD.ORG Fri May 2 16:15:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACEC9FFF; Fri, 2 May 2014 16:15:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99D901D11; Fri, 2 May 2014 16:15:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s42GFYj5030997; Fri, 2 May 2014 16:15:34 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42GFYH2030996; Fri, 2 May 2014 16:15:34 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405021615.s42GFYH2030996@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 2 May 2014 16:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265231 - head/contrib/gcc/config/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 16:15:34 -0000 Author: pfg Date: Fri May 2 16:15:34 2014 New Revision: 265231 URL: http://svnweb.freebsd.org/changeset/base/265231 Log: gcc: fix strict alignment. From the OpenBSD log: x86-64 ABI requires arrays greater than 16 bytes to be aligned to 16byte boundary. However, GCC 16-byte aligns arrays of >=16 BITS, not BYTES. This diff improves bug detectability for code which has local arrays of [16 .. 127] bits: in those cases SSP will now detect even 1-byte overflows. Obtained from: OpenBSD (CVS rev 1.4) MFC after: 1 week Modified: head/contrib/gcc/config/i386/i386.c Modified: head/contrib/gcc/config/i386/i386.c ============================================================================== --- head/contrib/gcc/config/i386/i386.c Fri May 2 15:52:50 2014 (r265230) +++ head/contrib/gcc/config/i386/i386.c Fri May 2 16:15:34 2014 (r265231) @@ -14408,7 +14408,7 @@ ix86_local_alignment (tree type, int ali if (AGGREGATE_TYPE_P (type) && TYPE_SIZE (type) && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST - && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 16 + && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 128 || TREE_INT_CST_HIGH (TYPE_SIZE (type))) && align < 128) return 128; } From owner-svn-src-head@FreeBSD.ORG Fri May 2 16:24:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE5005F0; Fri, 2 May 2014 16:24:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBB001E42; Fri, 2 May 2014 16:24:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s42GO9nO034948; Fri, 2 May 2014 16:24:09 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42GO9Hi034947; Fri, 2 May 2014 16:24:09 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201405021624.s42GO9Hi034947@svn.freebsd.org> From: Alan Somers Date: Fri, 2 May 2014 16:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265232 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 16:24:09 -0000 Author: asomers Date: Fri May 2 16:24:09 2014 New Revision: 265232 URL: http://svnweb.freebsd.org/changeset/base/265232 Log: Fix a panic caused by doing "ifconfig -am" while a lagg is being destroyed. The thread that is destroying the lagg has already set sc->sc_psc=NULL when the "ifconfig -am" thread gets to lacp_req(). It tries to dereference sc->sc_psc and panics. The solution is for lacp_req() to check the value of sc->sc_psc. If NULL, harmlessly return an lacp_opreq structure full of zeros. Full details in GNATS. PR: kern/189003 Reviewed by: timeout on freebsd-net@ MFC after: 3 weeks Sponsored by: Spectra Logic Corporation Modified: head/sys/net/ieee8023ad_lacp.c Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Fri May 2 16:15:34 2014 (r265231) +++ head/sys/net/ieee8023ad_lacp.c Fri May 2 16:24:09 2014 (r265232) @@ -590,10 +590,20 @@ lacp_req(struct lagg_softc *sc, caddr_t { struct lacp_opreq *req = (struct lacp_opreq *)data; struct lacp_softc *lsc = LACP_SOFTC(sc); - struct lacp_aggregator *la = lsc->lsc_active_aggregator; + struct lacp_aggregator *la; - LACP_LOCK(lsc); bzero(req, sizeof(struct lacp_opreq)); + + /* + * If the LACP softc is NULL, return with the opreq structure full of + * zeros. It is normal for the softc to be NULL while the lagg is + * being destroyed. + */ + if (NULL == lsc) + return; + + la = lsc->lsc_active_aggregator; + LACP_LOCK(lsc); if (la != NULL) { req->actor_prio = ntohs(la->la_actor.lip_systemid.lsi_prio); memcpy(&req->actor_mac, &la->la_actor.lip_systemid.lsi_mac, From owner-svn-src-head@FreeBSD.ORG Fri May 2 16:27:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4742797A for ; Fri, 2 May 2014 16:27:34 +0000 (UTC) Received: from nm12-vm0.bullet.mail.bf1.yahoo.com (nm12-vm0.bullet.mail.bf1.yahoo.com [98.139.213.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1EE91E7E for ; Fri, 2 May 2014 16:27:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1399047672; bh=XkYQo96ntgS0KiDAhTsZoPmiJP1AjhXbnGIZKhProfA=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=XxA9z9Y62P1RK29lQJHwe0ik/0puWryPKjHFn9/gvO6kELPixiKzsC9pkBuRAPYzIQiXHyNsdxih+IiSRjlsDW/MbRJgo3dXiUxemFKe/tfSfWr6054v3qhEGUCQ5XaibOL3adiylhHHeyIFFUqAl4wjoVOImbMi634mztob/WCiP9O9DWA45uMqbBwBcLyd9dwSM79P8blr+zlUqx8FiKJRZYfrHCEsfihJs1uZM0U8q+tWDRwYl1BAQ+0JWszmb5x3Z68HrY81b8FpOIvctdijFU69jgQrTWTOdOxig//f+3Q1DaL8y2vl86J94ABHKjC5O5T7qQOr986PNTfHJg== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=HjUn7WI5RzKcoDiAbxamHKIHEu5XNObFQlNj9gcjxCSjGM6E/UvzwUx+zQl7DJPQQ+JZb68j5ZCkcGxhm7RuqWJKYxwetoigLnNZHt5xnvJ0FMWM4IV4pHshyBsy6bD85VXNsbtX6/s7rnCgR9CADVv5Me1haG1VID4iX7h+7WyBWj+V5anYtqVKFD8jj4S9Y9DaaACJU3ehB0TjAyygF9Er7OyJmmX231YkP6LDrNxoldUlBrf2Vx1ABxtXQL3IL50EXDEj1g792bU4i5OaAFtBck4UNJrEw6tfRQPNVTu24s5Now0wScNbxrGyZ1YOZqy7haL63ibL4g3rnqTOdQ==; Received: from [98.139.212.149] by nm12.bullet.mail.bf1.yahoo.com with NNFMP; 02 May 2014 16:21:12 -0000 Received: from [68.142.230.70] by tm6.bullet.mail.bf1.yahoo.com with NNFMP; 02 May 2014 16:21:12 -0000 Received: from [127.0.0.1] by smtp227.mail.bf1.yahoo.com with NNFMP; 02 May 2014 16:21:12 -0000 X-Yahoo-Newman-Id: 434026.64065.bm@smtp227.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: SozIFLgVM1ncTcxXz0lzLrudLhtCdkECLsJhKz8IjDqCy7o mSBoPc7iP5G6oYm_BlhXEEzzQP57ZLWUB96VhkDbri6Q8zRClhoaq69VOBXV u3m9CEGS2zxBhJ.MPukt.93p_ftHI.eHFQJBTfJ1Vb2QZ_nAQ8kjaeK7bPD7 ilValmTTTo82kBB3dWp.70rVLGhKJOF7K5XYRg7mOqgMDNa199IlZIs4z7hs A4OHHuETX.7yvMpbnBVM0nT9A82Z0uoF52VOs2Xp4QRFL.WKcnHo9X8knJWQ sUBFd5rTCLgKNF2HI8BiVoLrWUNtbPRc2BUq2isvAcUJniWN1ARStMpZZTSr 5Rr43GWZhRPU_GJ2d7DYLPTU5f0_mXBE8SkWoB696VV6iFFcKuFOMUbSziZH IgDwH1afxIZxCCGPNdq3OYzyv__oVeHnEhztIEc4gjY570TTST8h94rR5peA t9xzc4p2kbOP7ZzN9xhaBU8flaZ8k6rfScFKeQxMli74iQYqNoIa9f_DHvbH HM7OV7EOE4GbHmCwY4gviL3i_1wamRkshmQwy3qKgNGNI_XGO7u4SG0LeVy2 k9VCIETqfB.tkhjTAz9yFmaVA.gVGB7UezStJ1PAp3GvWMsF8.sK7Hst9Yba wmznF X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain [63.250.193.228]) by smtp227.mail.bf1.yahoo.com with SMTP; 02 May 2014 16:21:12 +0000 UTC Message-ID: <5363C5FF.7050602@freebsd.org> Date: Fri, 02 May 2014 11:21:19 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r265231 - head/contrib/gcc/config/i386 References: <201405021615.s42GFYH2030996@svn.freebsd.org> In-Reply-To: <201405021615.s42GFYH2030996@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 16:27:34 -0000 On 05/02/14 11:15, Pedro F. Giffuni wrote: > Author: pfg > Date: Fri May 2 16:15:34 2014 > New Revision: 265231 > URL: http://svnweb.freebsd.org/changeset/base/265231 > > Log: > gcc: fix strict alignment. > > From the OpenBSD log: > > x86-64 ABI requires arrays greater than 16 bytes to be aligned to > 16byte boundary. However, GCC 16-byte aligns arrays of >=16 BITS, > not BYTES. > > This diff improves bug detectability for code which has local arrays > of [16 .. 127] bits: in those cases SSP will now detect even 1-byte > overflows. > > Obtained from: OpenBSD (CVS rev 1.4) > MFC after: 1 week I only plan to merge this to 10/stable since I am not really using 9/stable and I don't like running "risks" before a release. The fix looks interesting though so feel free to try to convince me if you have tested it :). Pedro. > Modified: > head/contrib/gcc/config/i386/i386.c > > Modified: head/contrib/gcc/config/i386/i386.c > ============================================================================== > --- head/contrib/gcc/config/i386/i386.c Fri May 2 15:52:50 2014 (r265230) > +++ head/contrib/gcc/config/i386/i386.c Fri May 2 16:15:34 2014 (r265231) > @@ -14408,7 +14408,7 @@ ix86_local_alignment (tree type, int ali > if (AGGREGATE_TYPE_P (type) > && TYPE_SIZE (type) > && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST > - && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 16 > + && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 128 > || TREE_INT_CST_HIGH (TYPE_SIZE (type))) && align < 128) > return 128; > } > From owner-svn-src-head@FreeBSD.ORG Fri May 2 17:02:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F3E9974; Fri, 2 May 2014 17:02:16 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 001821351; Fri, 2 May 2014 17:02:15 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=ptichko.yndx.net) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1WgCx4-0003Ae-Vk; Fri, 02 May 2014 16:52:31 +0400 Message-ID: <5363CF6C.2000305@FreeBSD.org> Date: Fri, 02 May 2014 21:01:32 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Alan Somers , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r265232 - head/sys/net References: <201405021624.s42GO9Hi034947@svn.freebsd.org> In-Reply-To: <201405021624.s42GO9Hi034947@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 17:02:16 -0000 On 02.05.2014 20:24, Alan Somers wrote: > Author: asomers > Date: Fri May 2 16:24:09 2014 > New Revision: 265232 > URL: http://svnweb.freebsd.org/changeset/base/265232 > > Log: > Fix a panic caused by doing "ifconfig -am" while a lagg is being destroyed. > The thread that is destroying the lagg has already set sc->sc_psc=NULL when > the "ifconfig -am" thread gets to lacp_req(). It tries to dereference > sc->sc_psc and panics. The solution is for lacp_req() to check the value of > sc->sc_psc. If NULL, harmlessly return an lacp_opreq structure full of > zeros. Full details in GNATS. Sorry, it looks like I've missed -net@ discussion. While this patch minimizes panics, they still can occur. If one thread performs lagg_clone_destroy() -> lagg_lacp_detach() (1) -> lacp_detach(), executing struct lacp_softc *lsc = LACP_SOFTC(sc); (e.g. one line before sc_psc = NULL assignment) At the same moment, another thread (initiated by ifconfig) executes struct lacp_softc *lsc = LACP_SOFTC(sc); Then, thread #1 goes further to LACP_LOCK_DESTROY(lsc); free(lsc, M_DEVBUF); After that, thread #2 performs bzero(req, sizeof(struct lacp_opreq)); passes lsc check for NULL and crashes on destroyed mutex. Briefly looking, we can remove WUNLOCK() before lacp_detach() in lagg_lacp_detach() (I'm unsure about the reasons why do we need unlock here). lacp_req() is already protected by at least LAGG_RLOCK() so we should get consistent view of sc->sc_psc. > > PR: kern/189003 > Reviewed by: timeout on freebsd-net@ > MFC after: 3 weeks > Sponsored by: Spectra Logic Corporation > > Modified: > head/sys/net/ieee8023ad_lacp.c > > Modified: head/sys/net/ieee8023ad_lacp.c > ============================================================================== > --- head/sys/net/ieee8023ad_lacp.c Fri May 2 16:15:34 2014 (r265231) > +++ head/sys/net/ieee8023ad_lacp.c Fri May 2 16:24:09 2014 (r265232) > @@ -590,10 +590,20 @@ lacp_req(struct lagg_softc *sc, caddr_t > { > struct lacp_opreq *req = (struct lacp_opreq *)data; > struct lacp_softc *lsc = LACP_SOFTC(sc); > - struct lacp_aggregator *la = lsc->lsc_active_aggregator; > + struct lacp_aggregator *la; > > - LACP_LOCK(lsc); > bzero(req, sizeof(struct lacp_opreq)); > + > + /* > + * If the LACP softc is NULL, return with the opreq structure full of > + * zeros. It is normal for the softc to be NULL while the lagg is > + * being destroyed. > + */ > + if (NULL == lsc) > + return; > + > + la = lsc->lsc_active_aggregator; > + LACP_LOCK(lsc); > if (la != NULL) { > req->actor_prio = ntohs(la->la_actor.lip_systemid.lsi_prio); > memcpy(&req->actor_mac, &la->la_actor.lip_systemid.lsi_mac, > > From owner-svn-src-head@FreeBSD.ORG Fri May 2 18:37:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55BBBB15; Fri, 2 May 2014 18:37:13 +0000 (UTC) Received: from mail-lb0-x231.google.com (mail-lb0-x231.google.com [IPv6:2a00:1450:4010:c04::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AFC71BDA; Fri, 2 May 2014 18:37:12 +0000 (UTC) Received: by mail-lb0-f177.google.com with SMTP id z11so3431595lbi.22 for ; Fri, 02 May 2014 11:37:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=DeObnN1NZmM/VojyG+tGKCfJL9kX1PrC61dkKUMV1xA=; b=VGxJ3hN7XrOV/4wOS/sWvmfv9bUHiJ4Y3pfpYG/1Kthx0lRflqNb+T1eXkeMlSli3/ TGKVEB/RxBUaPd9on33y1DFNflhO4kaXYIghNJuM8wXAXqZS8qsZ1OEJpWtSl4xjQzAx 0u7t3lGU63rPMLLKtdF2JXrcI0YzIf5BFW9ioLnPgfBOZ77RnMO7xBYtoXfwiONk/ZDH DwzEcR+mw+YKYT/c645rEy8Vea2Xiwm+MA35RnH0UNHkMuk1hJ1Y+4uBgJpxNX1m1f2W zGMX+0jmHBYjnkddctY/PrHS9qpv0auepxd1achZ4zojWDLwLRur+QUTK6hhawewk2EK t/ig== X-Received: by 10.112.135.198 with SMTP id pu6mr1190571lbb.58.1399055829791; Fri, 02 May 2014 11:37:09 -0700 (PDT) Received: from dchagin.static.corbina.net (dchagin.static.corbina.ru. [78.107.232.239]) by mx.google.com with ESMTPSA id rd5sm34555506lbb.0.2014.05.02.11.37.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 May 2014 11:37:07 -0700 (PDT) Sender: Dmitry Chagin Received: from dchagin.static.corbina.net (localhost [127.0.0.1]) by dchagin.static.corbina.net (8.14.8/8.14.8) with ESMTP id s42Ib6JG010318; Fri, 2 May 2014 22:37:06 +0400 (MSK) (envelope-from dchagin@dchagin.static.corbina.net) Received: (from dchagin@localhost) by dchagin.static.corbina.net (8.14.8/8.14.8/Submit) id s42Ib5jQ010317; Fri, 2 May 2014 22:37:05 +0400 (MSK) (envelope-from dchagin) Date: Fri, 2 May 2014 22:37:05 +0400 From: Chagin Dmitry To: Mateusz Guzik Subject: Re: svn commit: r255672 - in head/sys: amd64/linux32 compat/linux conf i386/linux kern modules/linux sys Message-ID: <20140502183705.GA10245@dchagin.static.corbina.net> References: <201309181756.r8IHu4qV052882@svn.freebsd.org> <20130918184648.GA31748@dft-labs.eu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="X1bOJ3K7DJ5YkBrT" Content-Disposition: inline In-Reply-To: <20130918184648.GA31748@dft-labs.eu> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, yuri@rawbw.com, Roman Divacky , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 18:37:13 -0000 --X1bOJ3K7DJ5YkBrT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 18, 2013 at 08:46:48PM +0200, Mateusz Guzik wrote: > On Wed, Sep 18, 2013 at 05:56:04PM +0000, Roman Divacky wrote: > > Author: rdivacky > > Date: Wed Sep 18 17:56:04 2013 > > New Revision: 255672 > > URL: http://svnweb.freebsd.org/changeset/base/255672 > >=20 > > Log: > > Implement epoll support in Linuxulator. This is a tiny wrapper around= kqueue > > to implement epoll subset of functionality. The kqueue user data are = 32bit > > on i386 which is not enough for epoll user data so this patch overrid= es > > kqueue fileops to maintain enough space in struct file. > > =20 > > Initial patch developed by me in 2007 and then extended and finished > > by Yuri Victorovich. > > =20 >=20 I'm strongly dislike a hacking kqueue file ops. I would prefer more generic mechanism. Maybe we need a emulator file ops in struct file, or a per proc list of such files. Any ideas? > First of all thank you both for doing this work. >=20 > I have some important though (I didn't spend too much on this, so maybe > I missed some stuff or what I write here is incorrect). >=20 > In general some lines are longer than 80 characters and simple stile > violations are present ("if (!error)"). >=20 > > +/* Create a new epoll file descriptor. */ > > + > > +static int > > +linux_epoll_create_common(struct thread *td) > > +{ > > + struct file *fp; > > + int error; > > + > > + error =3D kern_kqueue_locked(td, &fp); > > +#if EPOLL_WIDE_USER_DATA > > + if (error =3D=3D 0) { > > + epoll_init_user_data(td, fp); > > + fdrop(fp, td); > > + } > > +#endif > > + return (error); > > +} >=20 > This leaks fd reference if EPOLL_WIDE_USER_DATA is not defined. >=20 > > +int > > +linux_epoll_create1(struct thread *td, struct linux_epoll_create1_args= *args) > > +{ > > + int error; > > + > > + error =3D linux_epoll_create_common(td); > > + > > + if (!error) { > > + if (args->flags & LINUX_EPOLL_CLOEXEC) > > + td->td_proc->p_fd->fd_ofiles[td->td_retval[0]].fde_flags |=3D UF_EX= CLOSE; >=20 > This is very racy for no good reason. This should be passed down to > kqueue and be set on fd creation. >=20 > > + if (args->flags & LINUX_EPOLL_NONBLOCK) > > + linux_msg(td, "epoll_create1 doesn't yet support EPOLL_NONBLOCK fla= g\n"); > > + } > > + > > + return (error); > > +} > > + > > + > > +static void > > +epoll_init_user_data(struct thread *td, struct file *epfp) > > +{ > > + struct epoll_user_data *udv; > > + > > + /* override file ops to have our close operation */ > > + atomic_store_rel_ptr((volatile uintptr_t *)&epfp->f_ops, (uintptr_t)&= epollops); > > + > > + /* allocate epoll_user_data initially for up to 16 file descriptor va= lues */ > > + udv =3D malloc(EPOLL_USER_DATA_SIZE(EPOLL_USER_DATA_MARGIN), M_LINUX_= EPOLL, M_WAITOK); > > + udv->sz =3D EPOLL_USER_DATA_MARGIN; > > + EPOLL_USER_DATA_SET(epfp, udv); > > +} >=20 > Is not this racy? There is a window when fd is installed with epoll ops, > yet no userdata is allocated. >=20 > > +/*ARGSUSED*/ > > +static int > > +epoll_close(struct file *epfp, struct thread *td) > > +{ > > + /* free user data vector */ > > + free(EPOLL_USER_DATA_GET(epfp), M_LINUX_EPOLL); > > + /* over to kqueue parent */ > > + return (kqueue_close(epfp, td)); > > +} > > +#endif >=20 > Unnecessary comments. >=20 > > + > > +static struct file* > > +epoll_fget(struct thread *td, int epfd) > > +{ > > + struct file *fp; > > + cap_rights_t rights; > > + > > + if (fget(td, epfd, cap_rights_init(&rights, CAP_POLL_EVENT), &fp) != =3D 0) > > + panic("epoll: no file object found for kqueue descriptor"); > > + > > + return (fp); > > +} > > + >=20 > Callers pass arbitrary fd here (provided by the user), yet this panics > if fd is bad. >=20 > > int > > +kern_kqueue(struct thread *td) > > +{ > > + struct file *fp; > > + int error; > > + > > + error =3D kern_kqueue_locked(td, &fp); > > + >=20 > Why is this _locked? Typically such naming is used when some locks are > held around the call. >=20 > > + fdrop(fp, td); >=20 > If there was an error, fdrop is called even though there is nothing to > fdrop. >=20 > > + return (error); > > +} >=20 >=20 > --=20 > Mateusz Guzik --=20 Have fun! chd --X1bOJ3K7DJ5YkBrT Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlNj5dEACgkQ0t2Tb3OO/O3BggCeLOaWC/Sahncjp9L2+Vls9oPS F8oAoM6ssx7iJhs8gFX+14v2yM0HJA2P =igRs -----END PGP SIGNATURE----- --X1bOJ3K7DJ5YkBrT-- From owner-svn-src-head@FreeBSD.ORG Fri May 2 18:49:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BEF320D; Fri, 2 May 2014 18:49:31 +0000 (UTC) Received: from mail-qa0-x22b.google.com (mail-qa0-x22b.google.com [IPv6:2607:f8b0:400d:c00::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B35751CCC; Fri, 2 May 2014 18:49:30 +0000 (UTC) Received: by mail-qa0-f43.google.com with SMTP id m5so1311732qaj.2 for ; Fri, 02 May 2014 11:49:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=+rg9CmDLDlx6wBb4PEoWPTc6icdcOR0kwuKdnRn+jYo=; b=QuhI1PjhgHR8Uo9bCM90rwWjyk/RxglY7C7i70u/Z95PqPuuchaEmxqmcohHOZNiN3 SY5UPKZLF4qKO+Gpr3051tX4bchjQjdvGCm97Gcue0xVp7V4VqT6s5e2thtlzHeJQ716 mFUBfiDRWjWt4n2qKzcWqmWw/cCLys1Nn1Hts4xxgb8thXJSIQePJ2vKyo5NAxempYeJ l22Jr4AeR+7Y+buV05cqk56No9KHdr35MyB16aXaGb9tFsBGhHH5ShD+WfoG0GNFzxxg BqcDnrH84BOStcoLNhDD6XsLJD3fsnZaEmaPErV4W/GkFXDn3zimhXzx9xAP3dM4AyGR af5A== MIME-Version: 1.0 X-Received: by 10.224.13.142 with SMTP id c14mr25259823qaa.76.1399056569320; Fri, 02 May 2014 11:49:29 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.191.201 with HTTP; Fri, 2 May 2014 11:49:29 -0700 (PDT) In-Reply-To: <201309181756.r8IHu4qV052882@svn.freebsd.org> References: <201309181756.r8IHu4qV052882@svn.freebsd.org> Date: Fri, 2 May 2014 11:49:29 -0700 X-Google-Sender-Auth: RsEYDQKH_t8IeSPqCGhciZXSlO0 Message-ID: Subject: Re: svn commit: r255672 - in head/sys: amd64/linux32 compat/linux conf i386/linux kern modules/linux sys From: Adrian Chadd To: Roman Divacky Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 18:49:31 -0000 Hi, why not just extend the kqueue data fields to 64 bits and leave the freebsd API only copy 32 bits in? -a On 18 September 2013 10:56, Roman Divacky wrote: > Author: rdivacky > Date: Wed Sep 18 17:56:04 2013 > New Revision: 255672 > URL: http://svnweb.freebsd.org/changeset/base/255672 > > Log: > Implement epoll support in Linuxulator. This is a tiny wrapper around kqueue > to implement epoll subset of functionality. The kqueue user data are 32bit > on i386 which is not enough for epoll user data so this patch overrides > kqueue fileops to maintain enough space in struct file. > > Initial patch developed by me in 2007 and then extended and finished > by Yuri Victorovich. > > Approved by: re (delphij) > Sponsored by: Google Summer of Code > Submitted by: Yuri Victorovich > Tested by: Yuri Victorovich > > Added: > head/sys/compat/linux/linux_epoll.c (contents, props changed) > head/sys/compat/linux/linux_epoll.h (contents, props changed) > Modified: > head/sys/amd64/linux32/linux32_dummy.c > head/sys/amd64/linux32/syscalls.master > head/sys/conf/files.amd64 > head/sys/conf/files.i386 > head/sys/conf/files.pc98 > head/sys/i386/linux/linux_dummy.c > head/sys/i386/linux/syscalls.master > head/sys/kern/kern_event.c > head/sys/modules/linux/Makefile > head/sys/sys/event.h > head/sys/sys/file.h > head/sys/sys/syscallsubr.h > > Modified: head/sys/amd64/linux32/linux32_dummy.c > ============================================================================== > --- head/sys/amd64/linux32/linux32_dummy.c Wed Sep 18 17:28:19 2013 (r255671) > +++ head/sys/amd64/linux32/linux32_dummy.c Wed Sep 18 17:56:04 2013 (r255672) > @@ -70,9 +70,6 @@ DUMMY(pivot_root); > DUMMY(mincore); > DUMMY(ptrace); > DUMMY(lookup_dcookie); > -DUMMY(epoll_create); > -DUMMY(epoll_ctl); > -DUMMY(epoll_wait); > DUMMY(remap_file_pages); > DUMMY(timer_create); > DUMMY(timer_settime); > @@ -129,7 +126,6 @@ DUMMY(timerfd_gettime); > /* linux 2.6.27: */ > DUMMY(signalfd4); > DUMMY(eventfd2); > -DUMMY(epoll_create1); > DUMMY(dup3); > DUMMY(inotify_init1); > /* linux 2.6.30: */ > > Modified: head/sys/amd64/linux32/syscalls.master > ============================================================================== > --- head/sys/amd64/linux32/syscalls.master Wed Sep 18 17:28:19 2013 (r255671) > +++ head/sys/amd64/linux32/syscalls.master Wed Sep 18 17:56:04 2013 (r255672) > @@ -430,9 +430,11 @@ > 251 AUE_NULL UNIMPL > 252 AUE_EXIT STD { int linux_exit_group(int error_code); } > 253 AUE_NULL STD { int linux_lookup_dcookie(void); } > -254 AUE_NULL STD { int linux_epoll_create(void); } > -255 AUE_NULL STD { int linux_epoll_ctl(void); } > -256 AUE_NULL STD { int linux_epoll_wait(void); } > +254 AUE_NULL STD { int linux_epoll_create(l_int size); } > +255 AUE_NULL STD { int linux_epoll_ctl(l_int epfd, l_int op, l_int fd, \ > + struct linux_epoll_event *event); } > +256 AUE_NULL STD { int linux_epoll_wait(l_int epfd, struct linux_epoll_event *events, \ > + l_int maxevents, l_int timeout); } > 257 AUE_NULL STD { int linux_remap_file_pages(void); } > 258 AUE_NULL STD { int linux_set_tid_address(int *tidptr); } > 259 AUE_NULL STD { int linux_timer_create(void); } > @@ -534,7 +536,7 @@ > ; linux 2.6.27: > 327 AUE_NULL STD { int linux_signalfd4(void); } > 328 AUE_NULL STD { int linux_eventfd2(void); } > -329 AUE_NULL STD { int linux_epoll_create1(void); } > +329 AUE_NULL STD { int linux_epoll_create1(l_int flags); } > 330 AUE_NULL STD { int linux_dup3(void); } > 331 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); } > 332 AUE_NULL STD { int linux_inotify_init1(void); } > > Added: head/sys/compat/linux/linux_epoll.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/compat/linux/linux_epoll.c Wed Sep 18 17:56:04 2013 (r255672) > @@ -0,0 +1,554 @@ > +/*- > + * Copyright (c) 2007 Roman Divacky > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include "opt_compat.h" > +#include "opt_ktrace.h" > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#ifdef KTRACE > +#include > +#endif > + > +#ifdef COMPAT_LINUX32 > +#include > +#include > +#else > +#include > +#include > +#endif > + > +#define ktrepoll_events(evt, count) \ > + ktrstruct("linux_epoll_event", (evt), count * sizeof(*evt)) > + > +/* > + * epoll defines 'struct epoll_event' with the field 'data' as 64 bits > + * on all architectures. But on 32 bit architectures BSD 'struct kevent' only > + * has 32 bit opaque pointer as 'udata' field. So we can't pass epoll supplied > + * data verbatuim. Therefore on 32 bit architectures we allocate 64-bit memory > + * block to pass user supplied data for every file descriptor. > + */ > +typedef uint64_t epoll_udata_t; > +#if defined(__i386__) > +#define EPOLL_WIDE_USER_DATA 1 > +#else > +#define EPOLL_WIDE_USER_DATA 0 > +#endif > + > +#if EPOLL_WIDE_USER_DATA > + > +/* > + * Approach similar to epoll_user_data could also be used to > + * keep track of event bits per file descriptor for all architectures. > + * However, it isn't obvious that such tracking would be beneficial > + * in practice. > + */ > + > +struct epoll_user_data { > + unsigned sz; > + epoll_udata_t data[1]; > +}; > +static MALLOC_DEFINE(M_LINUX_EPOLL, "epoll", "memory for epoll system"); > +#define EPOLL_USER_DATA_SIZE(ndata) \ > + (sizeof(struct epoll_user_data)+((ndata)-1)*sizeof(epoll_udata_t)) > +#define EPOLL_USER_DATA_MARGIN 16 > + > +static void epoll_init_user_data(struct thread *td, struct file *epfp); > +static void epoll_set_user_data(struct thread *td, struct file *epfp, int fd, epoll_udata_t user_data); > +static epoll_udata_t epoll_get_user_data(struct thread *td, struct file *epfp, int fd); > +static fo_close_t epoll_close; > + > +/* overload kqueue fileops */ > +static struct fileops epollops = { > + .fo_read = kqueue_read, > + .fo_write = kqueue_write, > + .fo_truncate = kqueue_truncate, > + .fo_ioctl = kqueue_ioctl, > + .fo_poll = kqueue_poll, > + .fo_kqfilter = kqueue_kqfilter, > + .fo_stat = kqueue_stat, > + .fo_close = epoll_close, > + .fo_chmod = invfo_chmod, > + .fo_chown = invfo_chown, > + .fo_sendfile = invfo_sendfile, > +}; > +#endif > + > +static struct file* epoll_fget(struct thread *td, int epfd); > + > +struct epoll_copyin_args { > + struct kevent *changelist; > +}; > + > +struct epoll_copyout_args { > + struct linux_epoll_event *leventlist; > + int count; > + int error; > +#if KTRACE || EPOLL_WIDE_USER_DATA > + struct thread *td; > +#endif > +#if EPOLL_WIDE_USER_DATA > + struct file *epfp; > +#endif > +}; > + > + > +/* Create a new epoll file descriptor. */ > + > +static int > +linux_epoll_create_common(struct thread *td) > +{ > + struct file *fp; > + int error; > + > + error = kern_kqueue_locked(td, &fp); > +#if EPOLL_WIDE_USER_DATA > + if (error == 0) { > + epoll_init_user_data(td, fp); > + fdrop(fp, td); > + } > +#endif > + return (error); > +} > + > +int > +linux_epoll_create(struct thread *td, struct linux_epoll_create_args *args) > +{ > + if (args->size <= 0) > + return (EINVAL); > + /* args->size is unused. Linux just tests it > + * and then forgets it as well. */ > + > + return (linux_epoll_create_common(td)); > +} > + > +int > +linux_epoll_create1(struct thread *td, struct linux_epoll_create1_args *args) > +{ > + int error; > + > + error = linux_epoll_create_common(td); > + > + if (!error) { > + if (args->flags & LINUX_EPOLL_CLOEXEC) > + td->td_proc->p_fd->fd_ofiles[td->td_retval[0]].fde_flags |= UF_EXCLOSE; > + if (args->flags & LINUX_EPOLL_NONBLOCK) > + linux_msg(td, "epoll_create1 doesn't yet support EPOLL_NONBLOCK flag\n"); > + } > + > + return (error); > +} > + > +/* Structure converting function from epoll to kevent. */ > +static int > +linux_epoll_to_kevent(struct thread *td, > +#if EPOLL_WIDE_USER_DATA > + struct file *epfp, > +#endif > + int fd, struct linux_epoll_event *l_event, int kev_flags, struct kevent *kevent, int *nkevents) > +{ > + /* flags related to how event is registered */ > + if (l_event->events & LINUX_EPOLLONESHOT) > + kev_flags |= EV_ONESHOT; > + if (l_event->events & LINUX_EPOLLET) { > + kev_flags |= EV_CLEAR; > + } > + > + /* flags related to what event is registered */ > + if (l_event->events & LINUX_EPOLLIN || > + l_event->events & LINUX_EPOLLRDNORM || > + l_event->events & LINUX_EPOLLPRI || > + l_event->events & LINUX_EPOLLRDHUP) { > + EV_SET(kevent++, fd, EVFILT_READ, kev_flags, 0, 0, > + (void*)(EPOLL_WIDE_USER_DATA ? 0 : l_event->data)); > + ++*nkevents; > + } > + if (l_event->events & LINUX_EPOLLOUT || > + l_event->events & LINUX_EPOLLWRNORM) { > + EV_SET(kevent++, fd, EVFILT_WRITE, kev_flags, 0, 0, > + (void*)(EPOLL_WIDE_USER_DATA ? 0 : l_event->data)); > + ++*nkevents; > + } > + if (l_event->events & LINUX_EPOLLRDBAND || > + l_event->events & LINUX_EPOLLWRBAND || > + l_event->events & LINUX_EPOLLHUP || > + l_event->events & LINUX_EPOLLMSG || > + l_event->events & LINUX_EPOLLWAKEUP || > + l_event->events & LINUX_EPOLLERR) { > + linux_msg(td, "epoll_ctl doesn't yet support some event flags supplied: 0x%x\n", > + l_event->events); > + return (EINVAL); > + } > + > +#if EPOLL_WIDE_USER_DATA > + epoll_set_user_data(td, epfp, fd, l_event->data); > +#endif > + return (0); > +} > + > +/* > + * Structure converting function from kevent to epoll. In a case > + * this is called on error in registration we store the error in > + * event->data and pick it up later in linux_epoll_ctl(). > + */ > +static void > +linux_kevent_to_epoll( > +#if EPOLL_WIDE_USER_DATA > + struct thread *td, struct file *epfp, > +#endif > + struct kevent *kevent, struct linux_epoll_event *l_event) > +{ > + if ((kevent->flags & EV_ERROR) == 0) > + switch (kevent->filter) { > + case EVFILT_READ: > + l_event->events = LINUX_EPOLLIN|LINUX_EPOLLRDNORM|LINUX_EPOLLPRI; > + break; > + case EVFILT_WRITE: > + l_event->events = LINUX_EPOLLOUT|LINUX_EPOLLWRNORM; > + break; > + } > +#if EPOLL_WIDE_USER_DATA > + l_event->data = epoll_get_user_data(td, epfp, kevent->ident); > +#else > + l_event->data = (epoll_udata_t)kevent->udata; > +#endif > +} > + > +/* > + * Copyout callback used by kevent. This converts kevent > + * events to epoll events and copies them back to the > + * userspace. This is also called on error on registering > + * of the filter. > + */ > +static int > +epoll_kev_copyout(void *arg, struct kevent *kevp, int count) > +{ > + struct epoll_copyout_args *args; > + struct linux_epoll_event *eep; > + int error, i; > + > + args = (struct epoll_copyout_args*) arg; > + eep = malloc(sizeof(*eep) * count, M_TEMP, M_WAITOK | M_ZERO); > + > + for (i = 0; i < count; i++) > + linux_kevent_to_epoll( > +#if EPOLL_WIDE_USER_DATA > + args->td, args->epfp, > +#endif > + &kevp[i], &eep[i]); > + > + error = copyout(eep, args->leventlist, count * sizeof(*eep)); > + if (!error) { > + args->leventlist += count; > + args->count += count; > + } else if (!args->error) > + args->error = error; > + > +#ifdef KTRACE > + if (KTRPOINT(args->td, KTR_STRUCT)) > + ktrepoll_events(eep, count); > +#endif > + > + free(eep, M_TEMP); > + return (error); > +} > + > +/* > + * Copyin callback used by kevent. This copies already > + * converted filters from kernel memory to the kevent > + * internal kernel memory. Hence the memcpy instead of > + * copyin. > + */ > +static int > +epoll_kev_copyin(void *arg, struct kevent *kevp, int count) > +{ > + struct epoll_copyin_args *args; > + > + args = (struct epoll_copyin_args*) arg; > + > + memcpy(kevp, args->changelist, count * sizeof(*kevp)); > + args->changelist += count; > + > + return (0); > +} > + > +static int > +ignore_enoent(int error) { > + if (error == ENOENT) > + error = 0; > + return (error); > +} > + > +static int > +delete_event(struct thread *td, struct file *epfp, int fd, int filter) > +{ > + struct epoll_copyin_args ciargs; > + struct kevent kev; > + struct kevent_copyops k_ops = { &ciargs, > + NULL, > + epoll_kev_copyin}; > + ciargs.changelist = &kev; > + > + EV_SET(&kev, fd, filter, EV_DELETE | EV_DISABLE, 0, 0, 0); > + return (kern_kevent_locked(td, epfp, 1, 0, &k_ops, NULL)); > +} > + > +static int > +delete_all_events(struct thread *td, struct file *epfp, int fd) > +{ > + /* here we ignore ENONT, because we don't keep track of events here */ > + int error1, error2; > + > + error1 = ignore_enoent(delete_event(td, epfp, fd, EVFILT_READ)); > + error2 = ignore_enoent(delete_event(td, epfp, fd, EVFILT_WRITE)); > + > + /* report any errors we got */ > + if (error1) > + return (error1); > + if (error2) > + return (error2); > + return (0); > +} > + > +/* > + * Load epoll filter, convert it to kevent filter > + * and load it into kevent subsystem. > + */ > +int > +linux_epoll_ctl(struct thread *td, struct linux_epoll_ctl_args *args) > +{ > + struct file *epfp; > + struct epoll_copyin_args ciargs; > + struct kevent kev[2]; > + struct kevent_copyops k_ops = { &ciargs, > + NULL, > + epoll_kev_copyin}; > + struct linux_epoll_event le; > + int kev_flags; > + int nchanges = 0; > + int error; > + > + if (args->epfd == args->fd) > + return (EINVAL); > + > + if (args->op != LINUX_EPOLL_CTL_DEL) { > + error = copyin(args->event, &le, sizeof(le)); > + if (error) > + return (error); > + } > +#ifdef DEBUG > + if (ldebug(epoll_ctl)) > + printf(ARGS(epoll_ctl,"%i, %i, %i, %u"), args->epfd, args->op, > + args->fd, le.events); > +#endif > +#ifdef KTRACE > + if (KTRPOINT(td, KTR_STRUCT) && args->op != LINUX_EPOLL_CTL_DEL) > + ktrepoll_events(&le, 1); > +#endif > + epfp = epoll_fget(td, args->epfd); > + > + ciargs.changelist = kev; > + > + switch (args->op) { > + case LINUX_EPOLL_CTL_MOD: > + /* we don't memorize which events were set for this FD > + on this level, so just delete all we could have set: > + EVFILT_READ and EVFILT_WRITE, ignoring any errors > + */ > + error = delete_all_events(td, epfp, args->fd); > + if (error) > + goto leave; > + /* FALLTHROUGH */ > + case LINUX_EPOLL_CTL_ADD: > + kev_flags = EV_ADD | EV_ENABLE; > + break; > + case LINUX_EPOLL_CTL_DEL: > + /* CTL_DEL means unregister this fd with this epoll */ > + error = delete_all_events(td, epfp, args->fd); > + goto leave; > + default: > + error = EINVAL; > + goto leave; > + } > + > + error = linux_epoll_to_kevent(td, > +#if EPOLL_WIDE_USER_DATA > + epfp, > +#endif > + args->fd, &le, kev_flags, kev, &nchanges); > + if (error) > + goto leave; > + > + error = kern_kevent_locked(td, epfp, nchanges, 0, &k_ops, NULL); > +leave: > + fdrop(epfp, td); > + return (error); > +} > + > +/* > + * Wait for a filter to be triggered on the epoll file descriptor. */ > +int > +linux_epoll_wait(struct thread *td, struct linux_epoll_wait_args *args) > +{ > + struct file *epfp; > + struct timespec ts, *tsp; > + struct epoll_copyout_args coargs; > + struct kevent_copyops k_ops = { &coargs, > + epoll_kev_copyout, > + NULL}; > + int error; > + > + if (args->maxevents <= 0 || args->maxevents > LINUX_MAX_EVENTS) > + return (EINVAL); > + > + epfp = epoll_fget(td, args->epfd); > + > + coargs.leventlist = args->events; > + coargs.count = 0; > + coargs.error = 0; > +#if defined(KTRACE) || EPOLL_WIDE_USER_DATA > + coargs.td = td; > +#endif > +#if EPOLL_WIDE_USER_DATA > + coargs.epfp = epfp; > +#endif > + > + if (args->timeout != -1) { > + if (args->timeout < 0) { > + error = EINVAL; > + goto leave; > + } > + /* Convert from milliseconds to timespec. */ > + ts.tv_sec = args->timeout / 1000; > + ts.tv_nsec = (args->timeout % 1000) * 1000000; > + tsp = &ts; > + } else { > + tsp = NULL; > + } > + > + error = kern_kevent_locked(td, epfp, 0, args->maxevents, &k_ops, tsp); > + if (!error && coargs.error) > + error = coargs.error; > + > + /* > + * kern_keven might return ENOMEM which is not expected from epoll_wait. > + * Maybe we should translate that but I don't think it matters at all. > + */ > + > + if (!error) > + td->td_retval[0] = coargs.count; > +leave: > + fdrop(epfp, td); > + return (error); > +} > + > +#if EPOLL_WIDE_USER_DATA > +/* > + * we store user_data vector in an unused for kqueue descriptor > + * field fvn_epollpriv in struct file. > + */ > +#define EPOLL_USER_DATA_GET(epfp) \ > + ((struct epoll_user_data*)(epfp)->f_vnun.fvn_epollpriv) > +#define EPOLL_USER_DATA_SET(epfp, udv) \ > + (epfp)->f_vnun.fvn_epollpriv = (udv) > + > +static void > +epoll_init_user_data(struct thread *td, struct file *epfp) > +{ > + struct epoll_user_data *udv; > + > + /* override file ops to have our close operation */ > + atomic_store_rel_ptr((volatile uintptr_t *)&epfp->f_ops, (uintptr_t)&epollops); > + > + /* allocate epoll_user_data initially for up to 16 file descriptor values */ > + udv = malloc(EPOLL_USER_DATA_SIZE(EPOLL_USER_DATA_MARGIN), M_LINUX_EPOLL, M_WAITOK); > + udv->sz = EPOLL_USER_DATA_MARGIN; > + EPOLL_USER_DATA_SET(epfp, udv); > +} > + > +static void > +epoll_set_user_data(struct thread *td, struct file *epfp, int fd, epoll_udata_t user_data) > +{ > + struct epoll_user_data *udv = EPOLL_USER_DATA_GET(epfp); > + > + if (fd >= udv->sz) { > + udv = realloc(udv, EPOLL_USER_DATA_SIZE(fd + EPOLL_USER_DATA_MARGIN), M_LINUX_EPOLL, M_WAITOK); > + udv->sz = fd + EPOLL_USER_DATA_MARGIN; > + EPOLL_USER_DATA_SET(epfp, udv); > + } > + udv->data[fd] = user_data; > +} > + > +static epoll_udata_t > +epoll_get_user_data(struct thread *td, struct file *epfp, int fd) > +{ > + struct epoll_user_data *udv = EPOLL_USER_DATA_GET(epfp); > + if (fd >= udv->sz) > + panic("epoll: user data vector is too small"); > + > + return (udv->data[fd]); > +} > + > +/*ARGSUSED*/ > +static int > +epoll_close(struct file *epfp, struct thread *td) > +{ > + /* free user data vector */ > + free(EPOLL_USER_DATA_GET(epfp), M_LINUX_EPOLL); > + /* over to kqueue parent */ > + return (kqueue_close(epfp, td)); > +} > +#endif > + > +static struct file* > +epoll_fget(struct thread *td, int epfd) > +{ > + struct file *fp; > + cap_rights_t rights; > + > + if (fget(td, epfd, cap_rights_init(&rights, CAP_POLL_EVENT), &fp) != 0) > + panic("epoll: no file object found for kqueue descriptor"); > + > + return (fp); > +} > + > > Added: head/sys/compat/linux/linux_epoll.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/compat/linux/linux_epoll.h Wed Sep 18 17:56:04 2013 (r255672) > @@ -0,0 +1,68 @@ > +/*- > + * Copyright (c) 2007 Roman Divacky > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > + > +#ifndef _LINUX_EPOLL_H_ > +#define _LINUX_EPOLL_H_ > + > +#ifdef __amd64__ > +#define EPOLL_PACKED __packed > +#else > +#define EPOLL_PACKED > +#endif > + > +struct linux_epoll_event { > + uint32_t events; > + uint64_t data; > +} EPOLL_PACKED; > + > +#define LINUX_EPOLLIN 0x001 > +#define LINUX_EPOLLPRI 0x002 > +#define LINUX_EPOLLOUT 0x004 > +#define LINUX_EPOLLRDNORM 0x040 > +#define LINUX_EPOLLRDBAND 0x080 > +#define LINUX_EPOLLWRNORM 0x100 > +#define LINUX_EPOLLWRBAND 0x200 > +#define LINUX_EPOLLMSG 0x400 > +#define LINUX_EPOLLERR 0x008 > +#define LINUX_EPOLLHUP 0x010 > +#define LINUX_EPOLLRDHUP 0x2000 > +#define LINUX_EPOLLWAKEUP 1u<<29 > +#define LINUX_EPOLLONESHOT 1u<<30 > +#define LINUX_EPOLLET 1u<<31 > + > +#define LINUX_EPOLL_CTL_ADD 1 > +#define LINUX_EPOLL_CTL_DEL 2 > +#define LINUX_EPOLL_CTL_MOD 3 > + > +#define LINUX_EPOLL_CLOEXEC 02000000 > +#define LINUX_EPOLL_NONBLOCK 00004000 > + > +#define LINUX_MAX_EVENTS (INT_MAX / sizeof(struct linux_epoll_event)) > + > +#endif /* !_LINUX_EPOLL_H_ */ > + > > Modified: head/sys/conf/files.amd64 > ============================================================================== > --- head/sys/conf/files.amd64 Wed Sep 18 17:28:19 2013 (r255671) > +++ head/sys/conf/files.amd64 Wed Sep 18 17:56:04 2013 (r255672) > @@ -467,6 +467,7 @@ amd64/linux32/linux32_support.s optional > dependency "linux32_assym.h" > amd64/linux32/linux32_sysent.c optional compat_linux32 > amd64/linux32/linux32_sysvec.c optional compat_linux32 > +compat/linux/linux_epoll.c optional compat_linux32 > compat/linux/linux_emul.c optional compat_linux32 > compat/linux/linux_file.c optional compat_linux32 > compat/linux/linux_fork.c optional compat_linux32 > > Modified: head/sys/conf/files.i386 > ============================================================================== > --- head/sys/conf/files.i386 Wed Sep 18 17:28:19 2013 (r255671) > +++ head/sys/conf/files.i386 Wed Sep 18 17:56:04 2013 (r255672) > @@ -80,6 +80,7 @@ hptrr_lib.o optional hptrr \ > cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S optional zfs compile-with "${ZFS_S}" > compat/linprocfs/linprocfs.c optional linprocfs > compat/linsysfs/linsysfs.c optional linsysfs > +compat/linux/linux_epoll.c optional compat_linux > compat/linux/linux_emul.c optional compat_linux > compat/linux/linux_file.c optional compat_linux > compat/linux/linux_fork.c optional compat_linux > > Modified: head/sys/conf/files.pc98 > ============================================================================== > --- head/sys/conf/files.pc98 Wed Sep 18 17:28:19 2013 (r255671) > +++ head/sys/conf/files.pc98 Wed Sep 18 17:56:04 2013 (r255672) > @@ -41,6 +41,7 @@ ukbdmap.h optional ukbd_dflt_keymap \ > cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S optional zfs compile-with "${ZFS_S}" > compat/linprocfs/linprocfs.c optional linprocfs > compat/linsysfs/linsysfs.c optional linsysfs > +compat/linux/linux_epoll.c optional compat_linux > compat/linux/linux_emul.c optional compat_linux > compat/linux/linux_file.c optional compat_linux > compat/linux/linux_fork.c optional compat_linux > > Modified: head/sys/i386/linux/linux_dummy.c > ============================================================================== > --- head/sys/i386/linux/linux_dummy.c Wed Sep 18 17:28:19 2013 (r255671) > +++ head/sys/i386/linux/linux_dummy.c Wed Sep 18 17:56:04 2013 (r255672) > @@ -72,9 +72,6 @@ DUMMY(setfsgid); > DUMMY(pivot_root); > DUMMY(mincore); > DUMMY(lookup_dcookie); > -DUMMY(epoll_create); > -DUMMY(epoll_ctl); > -DUMMY(epoll_wait); > DUMMY(remap_file_pages); > DUMMY(fstatfs64); > DUMMY(mbind); > @@ -120,7 +117,6 @@ DUMMY(timerfd_gettime); > /* linux 2.6.27: */ > DUMMY(signalfd4); > DUMMY(eventfd2); > -DUMMY(epoll_create1); > DUMMY(dup3); > DUMMY(inotify_init1); > /* linux 2.6.30: */ > > Modified: head/sys/i386/linux/syscalls.master > ============================================================================== > --- head/sys/i386/linux/syscalls.master Wed Sep 18 17:28:19 2013 (r255671) > +++ head/sys/i386/linux/syscalls.master Wed Sep 18 17:56:04 2013 (r255672) > @@ -432,9 +432,11 @@ > 251 AUE_NULL UNIMPL > 252 AUE_EXIT STD { int linux_exit_group(int error_code); } > 253 AUE_NULL STD { int linux_lookup_dcookie(void); } > -254 AUE_NULL STD { int linux_epoll_create(void); } > -255 AUE_NULL STD { int linux_epoll_ctl(void); } > -256 AUE_NULL STD { int linux_epoll_wait(void); } > +254 AUE_NULL STD { int linux_epoll_create(l_int size); } > +255 AUE_NULL STD { int linux_epoll_ctl(l_int epfd, l_int op, l_int fd, \ > + struct linux_epoll_event *event); } > +256 AUE_NULL STD { int linux_epoll_wait(l_int epfd, struct linux_epoll_event *events, \ > + l_int maxevents, l_int timeout); } > 257 AUE_NULL STD { int linux_remap_file_pages(void); } > 258 AUE_NULL STD { int linux_set_tid_address(int *tidptr); } > 259 AUE_NULL STD { int linux_timer_create(clockid_t clock_id, \ > @@ -544,7 +546,7 @@ > ; linux 2.6.27: > 327 AUE_NULL STD { int linux_signalfd4(void); } > 328 AUE_NULL STD { int linux_eventfd2(void); } > -329 AUE_NULL STD { int linux_epoll_create1(void); } > +329 AUE_NULL STD { int linux_epoll_create1(l_int flags); } > 330 AUE_NULL STD { int linux_dup3(void); } > 331 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); } > 332 AUE_NULL STD { int linux_inotify_init1(void); } > > Modified: head/sys/kern/kern_event.c > ============================================================================== > --- head/sys/kern/kern_event.c Wed Sep 18 17:28:19 2013 (r255671) > +++ head/sys/kern/kern_event.c Wed Sep 18 17:56:04 2013 (r255672) > @@ -107,16 +107,7 @@ static void kqueue_wakeup(struct kqueue > static struct filterops *kqueue_fo_find(int filt); > static void kqueue_fo_release(int filt); > > -static fo_rdwr_t kqueue_read; > -static fo_rdwr_t kqueue_write; > -static fo_truncate_t kqueue_truncate; > -static fo_ioctl_t kqueue_ioctl; > -static fo_poll_t kqueue_poll; > -static fo_kqfilter_t kqueue_kqfilter; > -static fo_stat_t kqueue_stat; > -static fo_close_t kqueue_close; > - > -static struct fileops kqueueops = { > +struct fileops kqueueops = { > .fo_read = kqueue_read, > .fo_write = kqueue_write, > .fo_truncate = kqueue_truncate, > @@ -303,7 +294,7 @@ filt_fileattach(struct knote *kn) > } > > /*ARGSUSED*/ > -static int > +int > kqueue_kqfilter(struct file *fp, struct knote *kn) > { > struct kqueue *kq = kn->kn_fp->f_data; > @@ -688,34 +679,7 @@ filt_usertouch(struct knote *kn, struct > int > sys_kqueue(struct thread *td, struct kqueue_args *uap) > { > - struct filedesc *fdp; > - struct kqueue *kq; > - struct file *fp; > - int fd, error; > - > - fdp = td->td_proc->p_fd; > - error = falloc(td, &fp, &fd, 0); > - if (error) > - goto done2; > - > - /* An extra reference on `fp' has been held for us by falloc(). */ > - kq = malloc(sizeof *kq, M_KQUEUE, M_WAITOK | M_ZERO); > - mtx_init(&kq->kq_lock, "kqueue", NULL, MTX_DEF|MTX_DUPOK); > - TAILQ_INIT(&kq->kq_head); > - kq->kq_fdp = fdp; > - knlist_init_mtx(&kq->kq_sel.si_note, &kq->kq_lock); > - TASK_INIT(&kq->kq_task, 0, kqueue_task, kq); > - > - FILEDESC_XLOCK(fdp); > - TAILQ_INSERT_HEAD(&fdp->fd_kqlist, kq, kq_list); > - FILEDESC_XUNLOCK(fdp); > - > - finit(fp, FREAD | FWRITE, DTYPE_KQUEUE, kq, &kqueueops); > - fdrop(fp, td); > - > - td->td_retval[0] = fd; > -done2: > - return (error); > + return (kern_kqueue(td)); > } > > #ifndef _SYS_SYSPROTO_H_ > @@ -817,19 +781,75 @@ kevent_copyin(void *arg, struct kevent * > } > > int > +kern_kqueue(struct thread *td) > +{ > + struct file *fp; > + int error; > + > + error = kern_kqueue_locked(td, &fp); > + > + fdrop(fp, td); > + return (error); > +} > + > +int > +kern_kqueue_locked(struct thread *td, struct file **fpp) > +{ > + struct filedesc *fdp; > + struct kqueue *kq; > + struct file *fp; > + int fd, error; > + > + fdp = td->td_proc->p_fd; > + error = falloc(td, &fp, &fd, 0); > + if (error) > + return (error); > + > + /* An extra reference on `fp' has been held for us by falloc(). */ > + kq = malloc(sizeof *kq, M_KQUEUE, M_WAITOK | M_ZERO); > + mtx_init(&kq->kq_lock, "kqueue", NULL, MTX_DEF|MTX_DUPOK); > + TAILQ_INIT(&kq->kq_head); > + kq->kq_fdp = fdp; > + knlist_init_mtx(&kq->kq_sel.si_note, &kq->kq_lock); > + TASK_INIT(&kq->kq_task, 0, kqueue_task, kq); > + > + FILEDESC_XLOCK(fdp); > + TAILQ_INSERT_HEAD(&fdp->fd_kqlist, kq, kq_list); > + FILEDESC_XUNLOCK(fdp); > + > + finit(fp, FREAD | FWRITE, DTYPE_KQUEUE, kq, &kqueueops); > + > + td->td_retval[0] = fd; > + *fpp = fp; > + return (0); > +} > + > +int > kern_kevent(struct thread *td, int fd, int nchanges, int nevents, > struct kevent_copyops *k_ops, const struct timespec *timeout) > { > + struct file *fp; > + cap_rights_t rights; > + int error; > + > + if ((error = fget(td, fd, cap_rights_init(&rights, CAP_POST_EVENT), &fp)) != 0) > + return (error); > + > + error = kern_kevent_locked(td, fp, nchanges, nevents, k_ops, timeout); > + > + fdrop(fp, td); > + return (error); > +} > + > +int > +kern_kevent_locked(struct thread *td, struct file *fp, int nchanges, int nevents, > + struct kevent_copyops *k_ops, const struct timespec *timeout) > +{ > struct kevent keva[KQ_NEVENTS]; > struct kevent *kevp, *changes; > struct kqueue *kq; > - struct file *fp; > - cap_rights_t rights; > int i, n, nerrors, error; > > - error = fget(td, fd, cap_rights_init(&rights, CAP_POST_EVENT), &fp); > - if (error != 0) > - return (error); > if ((error = kqueue_acquire(fp, &kq)) != 0) > goto done_norel; > > @@ -872,7 +892,6 @@ kern_kevent(struct thread *td, int fd, i > done: > kqueue_release(kq, 0); > done_norel: > - fdrop(fp, td); > return (error); > } > > @@ -1526,7 +1545,7 @@ done_nl: > * This could be expanded to call kqueue_scan, if desired. > */ > /*ARGSUSED*/ > -static int > +int > kqueue_read(struct file *fp, struct uio *uio, struct ucred *active_cred, > int flags, struct thread *td) > { > @@ -1534,7 +1553,7 @@ kqueue_read(struct file *fp, struct uio > } > > /*ARGSUSED*/ > -static int > +int > kqueue_write(struct file *fp, struct uio *uio, struct ucred *active_cred, > int flags, struct thread *td) > { > @@ -1542,7 +1561,7 @@ kqueue_write(struct file *fp, struct uio > } > > /*ARGSUSED*/ > -static int > +int > kqueue_truncate(struct file *fp, off_t length, struct ucred *active_cred, > struct thread *td) > { > @@ -1551,7 +1570,7 @@ kqueue_truncate(struct file *fp, off_t l > } > > /*ARGSUSED*/ > -static int > +int > kqueue_ioctl(struct file *fp, u_long cmd, void *data, > struct ucred *active_cred, struct thread *td) > { > @@ -1599,7 +1618,7 @@ kqueue_ioctl(struct file *fp, u_long cmd > } > > /*ARGSUSED*/ > -static int > +int > kqueue_poll(struct file *fp, int events, struct ucred *active_cred, > struct thread *td) > { > @@ -1626,7 +1645,7 @@ kqueue_poll(struct file *fp, int events, > } > > /*ARGSUSED*/ > -static int > +int > kqueue_stat(struct file *fp, struct stat *st, struct ucred *active_cred, > struct thread *td) > { > @@ -1644,7 +1663,7 @@ kqueue_stat(struct file *fp, struct stat > } > > /*ARGSUSED*/ > -static int > +int > kqueue_close(struct file *fp, struct thread *td) > { > struct kqueue *kq = fp->f_data; > > Modified: head/sys/modules/linux/Makefile > ============================================================================== > --- head/sys/modules/linux/Makefile Wed Sep 18 17:28:19 2013 (r255671) > +++ head/sys/modules/linux/Makefile Wed Sep 18 17:56:04 2013 (r255672) > @@ -9,7 +9,7 @@ CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINU > > KMOD= linux > SRCS= linux_fork.c linux${SFX}_dummy.c linux_emul.c linux_file.c \ > - linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \ > + linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c linux_epoll.c \ > linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \ > linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \ > linux${SFX}_sysvec.c linux_uid16.c linux_util.c linux_time.c \ > > Modified: head/sys/sys/event.h > ============================================================================== > --- head/sys/sys/event.h Wed Sep 18 17:28:19 2013 (r255671) > +++ head/sys/sys/event.h Wed Sep 18 17:56:04 2013 (r255672) > @@ -236,6 +236,9 @@ struct proc; > struct knlist; > struct mtx; > struct rwlock; > +struct uio; > +struct stat; > +struct ucred; > > extern void knote(struct knlist *list, long hint, int lockflags); > extern void knote_fork(struct knlist *list, int pid); > @@ -261,6 +264,21 @@ extern int kqfd_register(int fd, struct > extern int kqueue_add_filteropts(int filt, struct filterops *filtops); > extern int kqueue_del_filteropts(int filt); > > +int kqueue_read(struct file *fp, struct uio *uio, struct ucred *active_cred, > + int flags, struct thread *td); > +int kqueue_write(struct file *fp, struct uio *uio, struct ucred *active_cred, > + int flags, struct thread *td); > +int kqueue_truncate(struct file *fp, off_t length, struct ucred *active_cred, > + struct thread *td); > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri May 2 18:56:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70A1558C; Fri, 2 May 2014 18:56:59 +0000 (UTC) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67B7B1D96; Fri, 2 May 2014 18:56:58 +0000 (UTC) Received: by mail-wi0-f172.google.com with SMTP id hi5so1895197wib.5 for ; Fri, 02 May 2014 11:56:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=UZXZzWj7GAtBo1XfX76GRXpi61DxmlEHB9r3cUbx6j4=; b=vVSTmTPUE+U3uVVO8eK1bPWtN88ASzZN3L2/wKtWZH52Yd/2pGQyAKk1WPFq0Jtwlw +ZQregX693VMq6X9hA0LN51+OHJw5dgjxDfH9uxL0ZljNaFViYN0XmA3RPN7wozE0wVN uQ+NSFCsY3xQ+4K7+fjerlHZSlgQEY+TMa2MP8TTPxaR7wbM02AVYhS55cHHuUkexmj+ FNqbXFy7T6L6IF1OUK0ywUZLArBTLlXYg2WopLudj3n99C/zn+/4Fs6sW23fdpKyN+ZU VofZXoUaSGXIaJJ/bDHPYfRWhoiEaTMKs4q6gaNSfDp+VY6C/97Zx6x1Ij9Om9tVdW7L O3TA== X-Received: by 10.180.94.37 with SMTP id cz5mr4251286wib.19.1399057016435; Fri, 02 May 2014 11:56:56 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id q2sm6551055wix.5.2014.05.02.11.56.54 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 02 May 2014 11:56:55 -0700 (PDT) Date: Fri, 2 May 2014 20:56:52 +0200 From: Mateusz Guzik To: Chagin Dmitry Subject: Re: svn commit: r255672 - in head/sys: amd64/linux32 compat/linux conf i386/linux kern modules/linux sys Message-ID: <20140502185652.GA28158@dft-labs.eu> References: <201309181756.r8IHu4qV052882@svn.freebsd.org> <20130918184648.GA31748@dft-labs.eu> <20140502183705.GA10245@dchagin.static.corbina.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20140502183705.GA10245@dchagin.static.corbina.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, yuri@rawbw.com, Roman Divacky , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 18:56:59 -0000 On Fri, May 02, 2014 at 10:37:05PM +0400, Chagin Dmitry wrote: > On Wed, Sep 18, 2013 at 08:46:48PM +0200, Mateusz Guzik wrote: > > On Wed, Sep 18, 2013 at 05:56:04PM +0000, Roman Divacky wrote: > > > Author: rdivacky > > > Date: Wed Sep 18 17:56:04 2013 > > > New Revision: 255672 > > > URL: http://svnweb.freebsd.org/changeset/base/255672 > > > > > > Log: > > > Implement epoll support in Linuxulator. This is a tiny wrapper around kqueue > > > to implement epoll subset of functionality. The kqueue user data are 32bit > > > on i386 which is not enough for epoll user data so this patch overrides > > > kqueue fileops to maintain enough space in struct file. > > > > > > Initial patch developed by me in 2007 and then extended and finished > > > by Yuri Victorovich. > > > > > > > > I'm strongly dislike a hacking kqueue file ops. I would prefer more > generic mechanism. > > Maybe we need a emulator file ops in struct file, or a per proc list of > such files. Any ideas? > Not sure what you mean. I don't see any acceptable way around modifying kqueue. kqueue syscall will install fd with kqops in your table, but you don't want that. You want fd with epoll op. What's more, with epoll_create1 you want to be able to set O_CLOEXEC atomically. Thus, you need to either duplicate kqueue initialization code (but why?) or modify it so that it supports both interfaces, which to some extent was done in this patch. -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Fri May 2 19:02:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44D18969; Fri, 2 May 2014 19:02:37 +0000 (UTC) Received: from mail-lb0-x233.google.com (mail-lb0-x233.google.com [IPv6:2a00:1450:4010:c04::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00C3E1EC8; Fri, 2 May 2014 19:02:35 +0000 (UTC) Received: by mail-lb0-f179.google.com with SMTP id c11so1500364lbj.24 for ; Fri, 02 May 2014 12:02:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=c9fkLOAUPwt4ct6KIa9O7tZUJH/uYKhtPmxJio37h00=; b=NKDCYpQDsUG6jawVE/HLBlDtQg3E+Q5o3BrJPat2EDmy9lGg/eLYjD04cTine3riN0 HS/hFifEYSNdE1scIakOo54N1eAVHoTtkK+7f208YgKwp5sRVayMtyxDQD/Zr7ouU08X N9wGaqnK8PPu41XNyJe6pufhdoEjiPzZJEdghmObQBu+ynfiysOR0ejpNdp+2jDc+QYn FcGuH5Ksl3term0kN8+g/4bJUqQ5a+QmtBMiXhayH3HsmwCTM7wFg6XkZLOPNTvEg85P OFzLW/qlT3fOozyE5ITErvd3N1q/GGmWA+sfLynsRI8lV94kayWepkxSvsnQPkcHPnA6 OxiQ== X-Received: by 10.112.12.103 with SMTP id x7mr3330736lbb.36.1399057353603; Fri, 02 May 2014 12:02:33 -0700 (PDT) Received: from dchagin.static.corbina.net (dchagin.static.corbina.ru. [78.107.232.239]) by mx.google.com with ESMTPSA id jh4sm34632181lbb.26.2014.05.02.12.02.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 May 2014 12:02:32 -0700 (PDT) Sender: Dmitry Chagin Received: from dchagin.static.corbina.net (localhost [127.0.0.1]) by dchagin.static.corbina.net (8.14.8/8.14.8) with ESMTP id s42J2UYA010471; Fri, 2 May 2014 23:02:30 +0400 (MSK) (envelope-from dchagin@dchagin.static.corbina.net) Received: (from dchagin@localhost) by dchagin.static.corbina.net (8.14.8/8.14.8/Submit) id s42J2U7V010470; Fri, 2 May 2014 23:02:30 +0400 (MSK) (envelope-from dchagin) Date: Fri, 2 May 2014 23:02:30 +0400 From: Chagin Dmitry To: Adrian Chadd Subject: Re: svn commit: r255672 - in head/sys: amd64/linux32 compat/linux conf i386/linux kern modules/linux sys Message-ID: <20140502190230.GA10412@dchagin.static.corbina.net> References: <201309181756.r8IHu4qV052882@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gKMricLos+KVdGMg" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , Roman Divacky , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 19:02:37 -0000 --gKMricLos+KVdGMg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 02, 2014 at 11:49:29AM -0700, Adrian Chadd wrote: > Hi, >=20 > why not just extend the kqueue data fields to 64 bits and leave the > freebsd API only copy 32 bits in? >=20 >=20 >=20 well, this is the first that comes to mind.=20 --=20 Have fun! chd --gKMricLos+KVdGMg Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlNj68YACgkQ0t2Tb3OO/O2lfQCeNUgoi3ap0RhrHOYF8wrieEVT Vm4AoJ5YJ9IMMyhyC55mffjzZybob+Ki =skCJ -----END PGP SIGNATURE----- --gKMricLos+KVdGMg-- From owner-svn-src-head@FreeBSD.ORG Fri May 2 19:45:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A39A75BC for ; Fri, 2 May 2014 19:45:20 +0000 (UTC) Received: from mail-qc0-x22a.google.com (mail-qc0-x22a.google.com [IPv6:2607:f8b0:400d:c01::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5742413B6 for ; Fri, 2 May 2014 19:45:20 +0000 (UTC) Received: by mail-qc0-f170.google.com with SMTP id x13so5384683qcv.29 for ; Fri, 02 May 2014 12:45:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=XDJQ83qxZ5etx6cgjkU7CvO75kSEsWCJAQIaCkVNEqg=; b=g8p8zhkSlSDL8ok9uHtI0xk3tklEnsPUhRQGhGjd1+nEAi1AaaDEW0LhpW4MTrmywE /y2+6PzzGKxR888w8TYtaIprD8YGRwEQgOKpoSxTwiihVuVCFD/WgHbxRTHJv/dkrqfY k1/b4QNUcWZcQOnK8PMAN3Yzbpk/z3OkcstxE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=XDJQ83qxZ5etx6cgjkU7CvO75kSEsWCJAQIaCkVNEqg=; b=hoo1+Gvno0t1+WBom/5iMHr5DuNMgzGUpWTfxQezOr+p7Wdx+vcLp638c9z78qBqxL jjyp3KQtQrU7kEwT0VM3a1F316/Vzs6q2B3/K6ca/eQh3FJ2DNTm6FoYaOf8kEG9RS/w XryJyrMJkfZqdNwfYhjkN+azf0ik3D1f1QFljtnFGriw3WT5SGCtgkR8bkp5yhNFg3Zm pvof06xZn90CWP7zlSPCnI+nyuv44AUGGPLAzILeVKWXyvyfurwbS4hDkH5FbaxDxEw2 arn0tLYQnfh1MILazkVmZOO66sxEH3PaWrz14CY8M0wAdsQZa3Ra7IavzBK0Cxh1KnGR 4IXA== X-Gm-Message-State: ALoCoQm3ZTEcWfJGGZ6va++G/NzP2r+w+hID5lkfDtW+8ZGX29mFrIKc2sw36k4ktQLxPAI2lpxc X-Received: by 10.140.31.10 with SMTP id e10mr23376904qge.101.1399059919330; Fri, 02 May 2014 12:45:19 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.54.102 with HTTP; Fri, 2 May 2014 12:44:49 -0700 (PDT) In-Reply-To: <201405020924.s429O7sW051742@svn.freebsd.org> References: <201405020924.s429O7sW051742@svn.freebsd.org> From: Eitan Adler Date: Fri, 2 May 2014 12:44:49 -0700 X-Google-Sender-Auth: WE9Jz7RJ2cAZJNs0gkdYJJT7Taw Message-ID: Subject: Re: svn commit: r265217 - in head/sys/modules: . lindev To: Christian Brueffer Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 19:45:20 -0000 On 2 May 2014 02:24, Christian Brueffer wrote: > Author: brueffer > Date: Fri May 2 09:24:06 2014 > New Revision: 265217 > URL: http://svnweb.freebsd.org/changeset/base/265217 > > Log: > libdev(4) has been removed, get rid of the module as well to fix the build. Thanks. My cleanup of lindev(4) was much too incomplete. :( -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Fri May 2 20:19:16 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27E65283; Fri, 2 May 2014 20:19:15 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DE0016CB; Fri, 2 May 2014 20:19:14 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WgJvN-0006Mt-2q; Fri, 02 May 2014 20:19:13 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s42KJArW020619; Fri, 2 May 2014 14:19:10 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/cMhyH2CgoxFDJ/cZWzvPj Subject: Re: svn commit: r265229 - head/bin/ps From: Ian Lepore To: Bryan Drewery In-Reply-To: <201405021505.s42F5lQO099446@svn.freebsd.org> References: <201405021505.s42F5lQO099446@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Fri, 02 May 2014 14:19:10 -0600 Message-ID: <1399061950.22079.195.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 20:19:16 -0000 On Fri, 2014-05-02 at 15:05 +0000, Bryan Drewery wrote: > Author: bdrewery > Date: Fri May 2 15:05:47 2014 > New Revision: 265229 > URL: http://svnweb.freebsd.org/changeset/base/265229 > > Log: > Add -J to filter by matching jail IDs and names. > > -J 0 can be used to show only host processes. > > Patch partially based on work by bz@ > > PR: bin/78763 > MFC after: 2 weeks > Relnotes: yes > > Modified: > head/bin/ps/Makefile > head/bin/ps/ps.1 > head/bin/ps/ps.c > > Modified: head/bin/ps/Makefile > ============================================================================== > --- head/bin/ps/Makefile Fri May 2 14:47:53 2014 (r265228) > +++ head/bin/ps/Makefile Fri May 2 15:05:47 2014 (r265229) > @@ -11,7 +11,7 @@ SRCS= fmt.c keyword.c nlist.c print.c ps > # on large systems. > # > CFLAGS+=-DLAZY_PS > -DPADD= ${LIBM} ${LIBKVM} > -LDADD= -lm -lkvm > +DPADD= ${LIBM} ${LIBKVM} ${LIBJAIL} > +LDADD= -lm -lkvm -ljail > > .include > > Modified: head/bin/ps/ps.1 > ============================================================================== > --- head/bin/ps/ps.1 Fri May 2 14:47:53 2014 (r265228) > +++ head/bin/ps/ps.1 Fri May 2 15:05:47 2014 (r265229) > @@ -29,7 +29,7 @@ > .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 > .\" $FreeBSD$ > .\" > -.Dd December 27, 2013 > +.Dd May 2, 2014 > .Dt PS 1 > .Os > .Sh NAME > @@ -40,6 +40,7 @@ > .Op Fl aCcdefHhjlmrSTuvwXxZ > .Op Fl O Ar fmt | Fl o Ar fmt > .Op Fl G Ar gid Ns Op , Ns Ar gid Ns Ar ... > +.Op Fl J Ar jid Ns Op , Ns Ar jid Ns Ar ... > .Op Fl M Ar core > .Op Fl N Ar system > .Op Fl p Ar pid Ns Op , Ns Ar pid Ns Ar ... > @@ -62,7 +63,7 @@ will also display processes that do not > .Pp > A different set of processes can be selected for display by using any > combination of the > -.Fl a , G , p , T , t , > +.Fl a , G , J , p , T , t , > and > .Fl U > options. > @@ -152,6 +153,20 @@ Print information associated with the fo > .Cm user , pid , ppid , pgid , sid , jobc , state , tt , time , > and > .Cm command . > +.It Fl J > +Display information about processes which match the specified jail IDs. > +This may be either the > +.Cm jid > +or > +.Cm name > +of the jail. > +Use > +.Fl J > +.Sy 0 > +to display only host processes. > +This flag implies > +.Fl x > +by default. > .It Fl L > List the set of keywords available for the > .Fl O > > Modified: head/bin/ps/ps.c > ============================================================================== > --- head/bin/ps/ps.c Fri May 2 14:47:53 2014 (r265228) > +++ head/bin/ps/ps.c Fri May 2 15:05:47 2014 (r265229) > @@ -50,6 +50,7 @@ static char sccsid[] = "@(#)ps.c 8.4 (Be > __FBSDID("$FreeBSD$"); > > #include > +#include > #include > #include > #include > @@ -62,6 +63,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -124,6 +126,7 @@ struct listinfo { > const char *lname; > union { > gid_t *gids; > + int *jids; > pid_t *pids; > dev_t *ttys; > uid_t *uids; > @@ -132,6 +135,7 @@ struct listinfo { > }; > > static int addelem_gid(struct listinfo *, const char *); > +static int addelem_jid(struct listinfo *, const char *); > static int addelem_pid(struct listinfo *, const char *); > static int addelem_tty(struct listinfo *, const char *); > static int addelem_uid(struct listinfo *, const char *); > @@ -163,12 +167,12 @@ static char vfmt[] = "pid,state,time,sl, > "%cpu,%mem,command"; > static char Zfmt[] = "label"; > > -#define PS_ARGS "AaCcde" OPT_LAZY_f "G:gHhjLlM:mN:O:o:p:rSTt:U:uvwXxZ" > +#define PS_ARGS "AaCcde" OPT_LAZY_f "G:gHhjJ:LlM:mN:O:o:p:rSTt:U:uvwXxZ" > > int > main(int argc, char *argv[]) > { > - struct listinfo gidlist, pgrplist, pidlist; > + struct listinfo gidlist, jidlist, pgrplist, pidlist; > struct listinfo ruidlist, sesslist, ttylist, uidlist; > struct kinfo_proc *kp; > KINFO *kinfo = NULL, *next_KINFO; > @@ -208,6 +212,7 @@ main(int argc, char *argv[]) > prtheader = showthreads = wflag = xkeep_implied = 0; > xkeep = -1; /* Neither -x nor -X. */ > init_list(&gidlist, addelem_gid, sizeof(gid_t), "group"); > + init_list(&jidlist, addelem_jid, sizeof(int), "jail id"); > init_list(&pgrplist, addelem_pid, sizeof(pid_t), "process group"); > init_list(&pidlist, addelem_pid, sizeof(pid_t), "process id"); > init_list(&ruidlist, addelem_uid, sizeof(uid_t), "ruser"); > @@ -275,6 +280,11 @@ main(int argc, char *argv[]) > case 'h': > prtheader = ws.ws_row > 5 ? ws.ws_row : 22; > break; > + case 'J': > + add_list(&jidlist, optarg); > + xkeep_implied = 1; > + nselectors++; > + break; > case 'j': > parsefmt(jfmt, 0); > _fmt = 1; > @@ -538,6 +548,11 @@ main(int argc, char *argv[]) > if (kp->ki_rgid == gidlist.l.gids[elem]) > goto keepit; > } > + if (jidlist.count > 0) { > + for (elem = 0; elem < jidlist.count; elem++) > + if (kp->ki_jid == jidlist.l.jids[elem]) > + goto keepit; > + } > if (pgrplist.count > 0) { > for (elem = 0; elem < pgrplist.count; elem++) > if (kp->ki_pgid == > @@ -666,6 +681,7 @@ main(int argc, char *argv[]) > } > } > free_list(&gidlist); > + free_list(&jidlist); > free_list(&pidlist); > free_list(&pgrplist); > free_list(&ruidlist); > @@ -727,6 +743,30 @@ addelem_gid(struct listinfo *inf, const > } > > static int > +addelem_jid(struct listinfo *inf, const char *elem) > +{ > + int tempid; > + > + if (*elem == '\0') { > + warnx("Invalid (zero-length) jail id"); > + optfatal = 1; > + return (0); /* Do not add this value. */ > + } > + > + tempid = jail_getid(elem); > + if (tempid < 0) { > + warnx("Invalid %s: %s", inf->lname, elem); > + optfatal = 1; > + return (0); > + } > + > + if (inf->count >= inf->maxcount) > + expand_list(inf); > + inf->l.jids[(inf->count)++] = tempid; > + return (1); > +} > + > +static int > addelem_pid(struct listinfo *inf, const char *elem) > { > char *endp; > @@ -1373,7 +1413,7 @@ usage(void) > > (void)fprintf(stderr, "%s\n%s\n%s\n%s\n", > "usage: ps " SINGLE_OPTS " [-O fmt | -o fmt] [-G gid[,gid...]]", > - " [-M core] [-N system]", > + " [-J jid[,jid...]] [-M core] [-N system]", > " [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]", > " ps [-L]"); > exit(1); > I'm getting an error building rescue after this change: --- rescue.all__D --- ps.lo: In function `_$$hide$$ ps.lo $a': _$$hide$$ ps.lo ps.c:(.text+0x26ec): undefined reference to `jail_getid' *** [rescue] Error code 1 bmake[4]: stopped in /local/build/staging/freebsd/wand/obj/arm.armv6/local/build/staging/freebsd/wand/src/rescue/rescue 1 error This is on arm, building with gcc, but I'm not sure whether that's germane or not. -- Ian From owner-svn-src-head@FreeBSD.ORG Fri May 2 20:21:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE5C8542 for ; Fri, 2 May 2014 20:21:56 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4EE21766 for ; Fri, 2 May 2014 20:21:56 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s42KLuvI048447 for ; Fri, 2 May 2014 20:21:56 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s42KLuY4048440 for svn-src-head@freebsd.org; Fri, 2 May 2014 20:21:56 GMT (envelope-from bdrewery) Received: (qmail 59599 invoked from network); 2 May 2014 15:21:53 -0500 Received: from unknown (HELO roundcube.xk42.net) (10.10.5.5) by sweb.xzibition.com with SMTP; 2 May 2014 15:21:53 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 02 May 2014 15:21:53 -0500 From: Bryan Drewery To: Ian Lepore Subject: Re: svn commit: r265229 - head/bin/ps Organization: FreeBSD In-Reply-To: <1399061950.22079.195.camel@revolution.hippie.lan> References: <201405021505.s42F5lQO099446@svn.freebsd.org> <1399061950.22079.195.camel@revolution.hippie.lan> Message-ID: <362bf9e7ee603012af0c79ecbb56a582@shatow.net> X-Sender: bdrewery@FreeBSD.org User-Agent: Roundcube Webmail/0.9.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 20:21:56 -0000 On 2014-05-02 15:19, Ian Lepore wrote: > On Fri, 2014-05-02 at 15:05 +0000, Bryan Drewery wrote: >> Author: bdrewery >> Date: Fri May 2 15:05:47 2014 >> New Revision: 265229 >> URL: http://svnweb.freebsd.org/changeset/base/265229 >> >> Log: >> Add -J to filter by matching jail IDs and names. >> >> -J 0 can be used to show only host processes. >> >> Patch partially based on work by bz@ [...] > I'm getting an error building rescue after this change: > > --- rescue.all__D --- > ps.lo: In function `_$$hide$$ ps.lo $a': > _$$hide$$ ps.lo ps.c:(.text+0x26ec): undefined reference to > `jail_getid' > *** [rescue] Error code 1 > > bmake[4]: stopped > in > /local/build/staging/freebsd/wand/obj/arm.armv6/local/build/staging/freebsd/wand/src/rescue/rescue > 1 error > > This is on arm, building with gcc, but I'm not sure whether that's > germane or not. > > -- Ian Yes, sorry about that. Testing a fix. I had made a bad assumption about rescue. I see now it doesn't work at all like I thought. That's what I get for not doing a full build. I did test on GCC though. -- Regards, Bryan Drewery From owner-svn-src-head@FreeBSD.ORG Fri May 2 20:22:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1B216D2; Fri, 2 May 2014 20:22:54 +0000 (UTC) Received: from mail-we0-x230.google.com (mail-we0-x230.google.com [IPv6:2a00:1450:400c:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DC991780; Fri, 2 May 2014 20:22:53 +0000 (UTC) Received: by mail-we0-f176.google.com with SMTP id q59so2694883wes.35 for ; Fri, 02 May 2014 13:22:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=b70a6RsWtxT2SgJpEBEBTdiHZkUJ82Dn+jj3aFXxvR4=; b=HOR7pkIN+aG7pcrcWOQF6HaJ89euN7s4eeuoS3AlqHboF9h5hOCOqp6w0c7coFWBwa MyQT8Gkhy/eL4KrmDLspHMPWKSFbdyBhyNAOluuL5mqp5Q8C6hiKZvwPTH9jJsU4OA1x eCpkZlVLSRPAr1eHyxCtgUaPfs76NiC6YifGWdVjuju2NJ9a+2zbFxiQbONB7v/bws0n rdRHrJIr/ajKYhDnIW3vATPzSjjtf7CE17GccMQ2l5LISIkhshOssuWPwJKAIgUh/8T8 /qiMzPecUvGB9IybntmkgheTfHJcBv7HylWOdNrXJ7PbTkXTMCtZoNDde8upUrokAXDQ RPDg== MIME-Version: 1.0 X-Received: by 10.180.14.233 with SMTP id s9mr4512490wic.53.1399062171995; Fri, 02 May 2014 13:22:51 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.194.168.130 with HTTP; Fri, 2 May 2014 13:22:51 -0700 (PDT) In-Reply-To: <5363CF6C.2000305@FreeBSD.org> References: <201405021624.s42GO9Hi034947@svn.freebsd.org> <5363CF6C.2000305@FreeBSD.org> Date: Fri, 2 May 2014 14:22:51 -0600 X-Google-Sender-Auth: gvFKR9vRupdGFDauOY2tzYy4Z4U Message-ID: Subject: Re: svn commit: r265232 - head/sys/net From: Alan Somers To: "Alexander V. Chernikov" Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Alan Somers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 20:22:54 -0000 On Fri, May 2, 2014 at 11:01 AM, Alexander V. Chernikov wrote: > On 02.05.2014 20:24, Alan Somers wrote: >> >> Author: asomers >> Date: Fri May 2 16:24:09 2014 >> New Revision: 265232 >> URL: http://svnweb.freebsd.org/changeset/base/265232 >> >> Log: >> Fix a panic caused by doing "ifconfig -am" while a lagg is being >> destroyed. >> The thread that is destroying the lagg has already set sc->sc_psc=NULL >> when >> the "ifconfig -am" thread gets to lacp_req(). It tries to dereference >> sc->sc_psc and panics. The solution is for lacp_req() to check the >> value of >> sc->sc_psc. If NULL, harmlessly return an lacp_opreq structure full of >> zeros. Full details in GNATS. > > Sorry, it looks like I've missed -net@ discussion. Thanks for the retroactive review; it's good too. > > While this patch minimizes panics, they still can occur. > If one thread performs lagg_clone_destroy() -> lagg_lacp_detach() (1) -> > lacp_detach(), executing > > struct lacp_softc *lsc = LACP_SOFTC(sc); (e.g. one line before sc_psc = NULL > assignment) > > At the same moment, another thread (initiated by ifconfig) executes > > > struct lacp_softc *lsc = LACP_SOFTC(sc); > > Then, thread #1 goes further to > > LACP_LOCK_DESTROY(lsc); > free(lsc, M_DEVBUF); > > After that, thread #2 performs > > bzero(req, sizeof(struct lacp_opreq)); > > passes lsc check for NULL and crashes on destroyed mutex. > > > Briefly looking, we can remove WUNLOCK() before lacp_detach() in > lagg_lacp_detach() (I'm unsure about the reasons why do we need unlock > here). > lacp_req() is already protected by at least LAGG_RLOCK() so we should get > consistent view of sc->sc_psc. The WUNLOCK was added in r168561 without comment. Removing it seems like it would work. It doesn't cause any new LORs or WITNESS warnings. And I can no longer reproduce the panic in lacp_req. However, it doesn't fix another panic in lagg_port_ioctl line 825 (my patch didn't either). Do you have any good ideas what to do about that? #9 0xffffffff808cee81 in __mtx_lock_sleep (c=0xfffff800052bb648, tid=18446735277704396800, opts=, file=, line=) at /usr/home/alans/freebsd/head/sys/kern/kern_mutex.c:430 #10 0xffffffff808ced02 in __mtx_lock_flags (c=, opts=0, file=0xffffffff80f6dd8c "/usr/home/alans/freebsd/head/sys/kern/kern_rmlock.c", line=407) at /usr/home/alans/freebsd/head/sys/kern/kern_mutex.c:223 #11 0xffffffff808e0032 in _rm_rlock (rm=0xfffff800052bb608, tracker=0xfffffe0097751918, trylock=) at /usr/home/alans/freebsd/head/sys/kern/kern_rmlock.c:407 #12 0xffffffff808e0812 in _rm_rlock_debug (rm=0xfffff800052bb608, tracker=0xfffffe0097751918, trylock=0, file=0xffffffff81c1dd13 "/usr/home/alans/freebsd/head/sys/modules/if_lagg/../../net/if_lagg.c", line=825) at /usr/home/alans/freebsd/head/sys/kern/kern_rmlock.c:659 #13 0xffffffff81c19f62 in lagg_port_ioctl (ifp=0xfffff8000590d800, cmd=, data=0xfffff80005582c00 "tap0") at /usr/home/alans/freebsd/head/sys/modules/if_lagg/../../net/if_lagg.c:825 #14 0xffffffff809ae407 in ifioctl (so=, cmd=3225971084, data=0xfffff80005582c00 "tap0", td=) at /usr/home/alans/freebsd/head/sys/net/if.c:2643 #15 0xffffffff8093b9fb in kern_ioctl (td=, fd=, com=) at file.h:323 #16 0xffffffff8093b77c in sys_ioctl (td=0xfffff800053cc000, uap=0xfffffe0097751b80) at /usr/home/alans/freebsd/head/sys/kern/sys_generic.c:702 From owner-svn-src-head@FreeBSD.ORG Fri May 2 20:25:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A83EC83A; Fri, 2 May 2014 20:25:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 913A7179C; Fri, 2 May 2014 20:25:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s42KPAgE037588; Fri, 2 May 2014 20:25:10 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42KP90n037583; Fri, 2 May 2014 20:25:09 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201405022025.s42KP90n037583@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 2 May 2014 20:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265236 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/mpr sys/dev/mpr/mpi sys/i386/conf sys/ia64/conf sys/mips/conf sys/modules sys/modules/mpr sys/sparc64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 20:25:10 -0000 Author: ken Date: Fri May 2 20:25:09 2014 New Revision: 265236 URL: http://svnweb.freebsd.org/changeset/base/265236 Log: Bring in the mpr(4) driver for LSI's MPT3 12Gb SAS controllers. This is derived from the mps(4) driver, but it supports only the 12Gb IT and IR hardware including the SAS 3004, SAS 3008 and SAS 3108. Some notes about this driver: o The 12Gb hardware can do "FastPath" I/O, and that capability is included in this driver. o WarpDrive functionality has been removed, since it isn't supported in the 12Gb driver interface. o The Scatter/Gather list handling code is significantly different between the 6Gb and 12Gb hardware. The 12Gb boards support IEEE Scatter/Gather lists. Thanks to LSI for developing and testing this driver for FreeBSD. share/man/man4/mpr.4: mpr(4) man page. sys/dev/mpr/*: mpr(4) driver files. sys/modules/Makefile, sys/modules/mpr/Makefile: Add a module Makefile for the mpr(4) driver. sys/conf/files: Add the mpr(4) driver. sys/amd64/conf/GENERIC, sys/i386/conf/GENERIC, sys/mips/conf/OCTEON1, sys/sparc64/conf/GENERIC: Add the mpr(4) driver to all config files that currently have the mps(4) driver. sys/ia64/conf/GENERIC: Add the mps(4) and mpr(4) drivers to the ia64 GENERIC config file. sys/i386/conf/XEN: Exclude the mpr module from building here. Submitted by: Steve McConnell MFC after: 3 days Tested by: Chris Reeves Sponsored by: LSI, Spectra Logic Relnotes: LSI 12Gb SAS driver mpr(4) added Added: head/share/man/man4/mpr.4 (contents, props changed) head/sys/dev/mpr/ head/sys/dev/mpr/mpi/ head/sys/dev/mpr/mpi/mpi2.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_cnfg.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_hbd.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_history.txt (contents, props changed) head/sys/dev/mpr/mpi/mpi2_init.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_ioc.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_ra.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_raid.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_sas.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_targ.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_tool.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_type.h (contents, props changed) head/sys/dev/mpr/mpr.c (contents, props changed) head/sys/dev/mpr/mpr_config.c (contents, props changed) head/sys/dev/mpr/mpr_ioctl.h (contents, props changed) head/sys/dev/mpr/mpr_mapping.c (contents, props changed) head/sys/dev/mpr/mpr_mapping.h (contents, props changed) head/sys/dev/mpr/mpr_pci.c (contents, props changed) head/sys/dev/mpr/mpr_sas.c (contents, props changed) head/sys/dev/mpr/mpr_sas.h (contents, props changed) head/sys/dev/mpr/mpr_sas_lsi.c (contents, props changed) head/sys/dev/mpr/mpr_table.c (contents, props changed) head/sys/dev/mpr/mpr_table.h (contents, props changed) head/sys/dev/mpr/mpr_user.c (contents, props changed) head/sys/dev/mpr/mprvar.h (contents, props changed) head/sys/modules/mpr/ head/sys/modules/mpr/Makefile (contents, props changed) Modified: head/sys/amd64/conf/GENERIC head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/i386/conf/XEN head/sys/ia64/conf/GENERIC head/sys/mips/conf/OCTEON1 head/sys/modules/Makefile head/sys/sparc64/conf/GENERIC Added: head/share/man/man4/mpr.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/mpr.4 Fri May 2 20:25:09 2014 (r265236) @@ -0,0 +1,226 @@ +.\" +.\" Copyright (c) 2010 Spectra Logic Corporation +.\" Copyright (c) 2014 LSI Corp +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions, and the following disclaimer, +.\" without modification. +.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer +.\" substantially similar to the "NO WARRANTY" disclaimer below +.\" ("Disclaimer") and any redistribution must be conditioned upon +.\" including a substantially similar Disclaimer requirement for further +.\" binary redistribution. +.\" +.\" NO WARRANTY +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR +.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGES. +.\" +.\" mpr driver man page. +.\" +.\" Author: Ken Merry +.\" Author: Stephen McConnell +.\" +.\" $Id$ +.\" $FreeBSD$ +.\" +.Dd Apr 28, 2014 +.Dt MPR 4 +.Os +.Sh NAME +.Nm mpr +.Nd "LSI Fusion-MPT 3 IT/IR 12Gb/s Serial Attached SCSI/SATA driver" +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device pci" +.Cd "device scbus" +.Cd "device mpr" +.Ed +.Pp +Or, to load the driver as a module at boot, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +mpr_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for LSI Fusion-MPT 3 IT/IR +.Tn SAS +controllers. +.Sh HARDWARE +The following controllers are supported by the +.Nm +driver +.Pp +.Bl -bullet -compact +.It +LSI SAS 3004 (4 Port SAS) +.It +LSI SAS 3008 (8 Port SAS) +.It +LSI SAS 3108 (8 Port SAS) +.El +.Sh CONFIGURATION +To disable MSI interrupts for all +.Nm +driver instances, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hw.mpr.disable_msi=1 +.Ed +.Pp +To disable MSI interrupts for a specific +.Nm +driver instance, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mpr.X.disable_msi=1 +.Ed +.Pp +where X is the adapter number. +.Pp +To disable MSI-X interrupts for all +.Nm +driver instances, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hw.mpr.disable_msix=1 +.Ed +.Pp +To disable MSI-X interrupts for a specific +.Nm +driver instance, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mpr.X.disable_msix=1 +.Ed +.Pp +To set the maximum number of DMA chains allocated for all adapters, set +the following variable in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hw.mpr.max_chains=NNNN +.Ed +.Pp +To set the maximum number of DMA chains allocated for a specific adapter, +set the following variable in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mpr.X.max_chains=NNNN +.Ed +.Pp +This variable may also be viewed via +.Xr sysctl 8 +to see the maximum set for a given adapter. +.Pp +The current number of free chain frames may be seen via the +dev.mpr.X.chain_free +.Xr sysctl 8 +variable. +.Pp +The lowest number of free chain frames may be seen via the +dev.mpr.X.chain_free_lowwater +.Xr sysctl 8 +variable. +.Pp +The current number of active I/O commands is shown in the +dev.mpr.X.io_cmds_active +.Xr sysctl 8 +variable. +.Pp +The maximum number of active I/O commands seen since boot is shown in the +dev.mpr.X.io_cmds_highwater +.Xr sysctl 8 +variable. +.Pp +Devices can be excluded from +.Nm +control for all adapters by setting the following variable in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hw.mpr.exclude_ids=Y +.Ed +.Pp +where Y is the target ID of the device. If more than one device is to be +excluded, target ID's are separated by commas. +.Pp +Devices can be excluded from +.Nm +control for a specific adapter by setting the following variable in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mpr.X.exclude_ids=Y +.Ed +.Pp +where X is the adapter number and Y is the target ID of the device. If more +than one device is to be excluded, target ID's are separated by commas. +.Sh DEBUGGING +To enable debugging prints from the +.Nm +driver, set the +.Bd -literal -offset indent +hw.mpr.X.debug_level +.Ed +.Pp +variable, where X is the adapter number, either in +.Xr loader.conf 5 +or via +.Xr sysctl 8 . +The following bits have the described effects: +.Bd -literal -offset indent +0x0001 Enable informational prints. +0x0002 Enable prints for driver faults. +0x0004 Enable prints for controller events. +0x0008 Enable prints for controller logging. +0x0010 Enable prints for tracing recovery operations. +0x0020 Enable prints for parameter errors and programming bugs. +0x0040 Enable prints for system initialization operations. +0x0080 Enable prints for more detailed information. +0x0100 Enable prints for user-generated commands. +0x0200 Enable prints for device mapping. +0x0400 Enable prints for tracing through driver functions. +.Ed +.Sh SEE ALSO +.Xr cam 4 , +.Xr cd 4 , +.Xr ch 4 , +.Xr da 4 , +.Xr mpt 4 , +.Xr mps 4 , +.Xr pci 4 , +.Xr sa 4 , +.Xr scsi 4 , +.Xr targ 4 , +.Xr loader.conf 5 , +.Xr sysctl 8 +.Sh HISTORY +The +.Nm +driver first appeared in FreeBSD 9.3. +.Sh AUTHORS +The +.Nm +driver was originally written by +.An -nosplit +.An Scott Long Aq scottl@FreeBSD.org . +It has been improved and tested by LSI Corporation. +.Pp +This man page was written by +.An Ken Merry Aq ken@FreeBSD.org +with additional input from +.An Stephen McConnell Aq stephen.mcconnell@lsi.com . Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri May 2 20:13:52 2014 (r265235) +++ head/sys/amd64/conf/GENERIC Fri May 2 20:25:09 2014 (r265236) @@ -119,6 +119,7 @@ device isp # Qlogic family #device ispfw # Firmware for QLogic HBAs- normally a module device mpt # LSI-Logic MPT-Fusion device mps # LSI-Logic MPT-Fusion 2 +device mpr # LSI-Logic MPT-Fusion 3 #device ncr # NCR/Symbios Logic device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') device trm # Tekram DC395U/UW/F DC315U adapters Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 2 20:13:52 2014 (r265235) +++ head/sys/conf/files Fri May 2 20:25:09 2014 (r265236) @@ -1804,6 +1804,17 @@ dev/mmc/mmcbr_if.m standard dev/mmc/mmcbus_if.m standard dev/mmc/mmcsd.c optional mmcsd dev/mn/if_mn.c optional mn pci +dev/mpr/mpr.c optional mpr +dev/mpr/mpr_config.c optional mpr +# XXX Work around clang warning, until maintainer approves fix. +dev/mpr/mpr_mapping.c optional mpr \ + compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" +dev/mpr/mpr_pci.c optional mpr pci +dev/mpr/mpr_sas.c optional mpr \ + compile-with "${NORMAL_C} ${NO_WUNNEEDED_INTERNAL_DECL}" +dev/mpr/mpr_sas_lsi.c optional mpr +dev/mpr/mpr_table.c optional mpr +dev/mpr/mpr_user.c optional mpr dev/mps/mps.c optional mps dev/mps/mps_config.c optional mps # XXX Work around clang warning, until maintainer approves fix. Added: head/sys/dev/mpr/mpi/mpi2.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mpr/mpi/mpi2.h Fri May 2 20:25:09 2014 (r265236) @@ -0,0 +1,1257 @@ +/*- + * Copyright (c) 2013 LSI Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * LSI MPT-Fusion Host Adapter FreeBSD + * + * $FreeBSD$ + */ + +/* + * Copyright (c) 2000-2013 LSI Corporation. + * + * + * Name: mpi2.h + * Title: MPI Message independent structures and definitions + * including System Interface Register Set and + * scatter/gather formats. + * Creation Date: June 21, 2006 + * + * mpi2.h Version: 02.00.33 + * + * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 + * prefix are for use only on MPI v2.5 products, and must not be used + * with MPI v2.0 products. Unless otherwise noted, names beginning with + * MPI2 or Mpi2 are for use with both MPI v2.0 and MPI v2.5 products. + * + * Version History + * --------------- + * + * Date Version Description + * -------- -------- ------------------------------------------------------ + * 04-30-07 02.00.00 Corresponds to Fusion-MPT MPI Specification Rev A. + * 06-04-07 02.00.01 Bumped MPI2_HEADER_VERSION_UNIT. + * 06-26-07 02.00.02 Bumped MPI2_HEADER_VERSION_UNIT. + * 08-31-07 02.00.03 Bumped MPI2_HEADER_VERSION_UNIT. + * Moved ReplyPostHostIndex register to offset 0x6C of the + * MPI2_SYSTEM_INTERFACE_REGS and modified the define for + * MPI2_REPLY_POST_HOST_INDEX_OFFSET. + * Added union of request descriptors. + * Added union of reply descriptors. + * 10-31-07 02.00.04 Bumped MPI2_HEADER_VERSION_UNIT. + * Added define for MPI2_VERSION_02_00. + * Fixed the size of the FunctionDependent5 field in the + * MPI2_DEFAULT_REPLY structure. + * 12-18-07 02.00.05 Bumped MPI2_HEADER_VERSION_UNIT. + * Removed the MPI-defined Fault Codes and extended the + * product specific codes up to 0xEFFF. + * Added a sixth key value for the WriteSequence register + * and changed the flush value to 0x0. + * Added message function codes for Diagnostic Buffer Post + * and Diagnsotic Release. + * New IOCStatus define: MPI2_IOCSTATUS_DIAGNOSTIC_RELEASED + * Moved MPI2_VERSION_UNION from mpi2_ioc.h. + * 02-29-08 02.00.06 Bumped MPI2_HEADER_VERSION_UNIT. + * 03-03-08 02.00.07 Bumped MPI2_HEADER_VERSION_UNIT. + * 05-21-08 02.00.08 Bumped MPI2_HEADER_VERSION_UNIT. + * Added #defines for marking a reply descriptor as unused. + * 06-27-08 02.00.09 Bumped MPI2_HEADER_VERSION_UNIT. + * 10-02-08 02.00.10 Bumped MPI2_HEADER_VERSION_UNIT. + * Moved LUN field defines from mpi2_init.h. + * 01-19-09 02.00.11 Bumped MPI2_HEADER_VERSION_UNIT. + * 05-06-09 02.00.12 Bumped MPI2_HEADER_VERSION_UNIT. + * In all request and reply descriptors, replaced VF_ID + * field with MSIxIndex field. + * Removed DevHandle field from + * MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR and made those + * bytes reserved. + * Added RAID Accelerator functionality. + * 07-30-09 02.00.13 Bumped MPI2_HEADER_VERSION_UNIT. + * 10-28-09 02.00.14 Bumped MPI2_HEADER_VERSION_UNIT. + * Added MSI-x index mask and shift for Reply Post Host + * Index register. + * Added function code for Host Based Discovery Action. + * 02-10-10 02.00.15 Bumped MPI2_HEADER_VERSION_UNIT. + * Added define for MPI2_FUNCTION_PWR_MGMT_CONTROL. + * Added defines for product-specific range of message + * function codes, 0xF0 to 0xFF. + * 05-12-10 02.00.16 Bumped MPI2_HEADER_VERSION_UNIT. + * Added alternative defines for the SGE Direction bit. + * 08-11-10 02.00.17 Bumped MPI2_HEADER_VERSION_UNIT. + * 11-10-10 02.00.18 Bumped MPI2_HEADER_VERSION_UNIT. + * Added MPI2_IEEE_SGE_FLAGS_SYSTEMPLBCPI_ADDR define. + * 02-23-11 02.00.19 Bumped MPI2_HEADER_VERSION_UNIT. + * Added MPI2_FUNCTION_SEND_HOST_MESSAGE. + * 03-09-11 02.00.20 Bumped MPI2_HEADER_VERSION_UNIT. + * 05-25-11 02.00.21 Bumped MPI2_HEADER_VERSION_UNIT. + * 08-24-11 02.00.22 Bumped MPI2_HEADER_VERSION_UNIT. + * 11-18-11 02.00.23 Bumped MPI2_HEADER_VERSION_UNIT. + * Incorporating additions for MPI v2.5. + * 02-06-12 02.00.24 Bumped MPI2_HEADER_VERSION_UNIT. + * 03-29-12 02.00.25 Bumped MPI2_HEADER_VERSION_UNIT. + * Added Hard Reset delay timings. + * 07-10-12 02.00.26 Bumped MPI2_HEADER_VERSION_UNIT. + * 07-26-12 02.00.27 Bumped MPI2_HEADER_VERSION_UNIT. + * 11-27-12 02.00.28 Bumped MPI2_HEADER_VERSION_UNIT. + * 12-20-12 02.00.29 Bumped MPI2_HEADER_VERSION_UNIT. + * Added MPI25_SUP_REPLY_POST_HOST_INDEX_OFFSET. + * 04-09-13 02.00.30 Bumped MPI2_HEADER_VERSION_UNIT. + * 04-17-13 02.00.31 Bumped MPI2_HEADER_VERSION_UNIT. + * 08-19-13 02.00.32 Bumped MPI2_HEADER_VERSION_UNIT. + * 12-05-13 02.00.33 Bumped MPI2_HEADER_VERSION_UNIT. + * -------------------------------------------------------------------------- + */ + +#ifndef MPI2_H +#define MPI2_H + + +/***************************************************************************** +* +* MPI Version Definitions +* +*****************************************************************************/ + +#define MPI2_VERSION_MAJOR_MASK (0xFF00) +#define MPI2_VERSION_MAJOR_SHIFT (8) +#define MPI2_VERSION_MINOR_MASK (0x00FF) +#define MPI2_VERSION_MINOR_SHIFT (0) + +/* major version for all MPI v2.x */ +#define MPI2_VERSION_MAJOR (0x02) + +/* minor version for MPI v2.0 compatible products */ +#define MPI2_VERSION_MINOR (0x00) +#define MPI2_VERSION ((MPI2_VERSION_MAJOR << MPI2_VERSION_MAJOR_SHIFT) | \ + MPI2_VERSION_MINOR) +#define MPI2_VERSION_02_00 (0x0200) + + +/* minor version for MPI v2.5 compatible products */ +#define MPI25_VERSION_MINOR (0x05) +#define MPI25_VERSION ((MPI2_VERSION_MAJOR << MPI2_VERSION_MAJOR_SHIFT) | \ + MPI25_VERSION_MINOR) +#define MPI2_VERSION_02_05 (0x0205) + + +/* Unit and Dev versioning for this MPI header set */ +#define MPI2_HEADER_VERSION_UNIT (0x21) +#define MPI2_HEADER_VERSION_DEV (0x00) +#define MPI2_HEADER_VERSION_UNIT_MASK (0xFF00) +#define MPI2_HEADER_VERSION_UNIT_SHIFT (8) +#define MPI2_HEADER_VERSION_DEV_MASK (0x00FF) +#define MPI2_HEADER_VERSION_DEV_SHIFT (0) +#define MPI2_HEADER_VERSION ((MPI2_HEADER_VERSION_UNIT << 8) | MPI2_HEADER_VERSION_DEV) + + +/***************************************************************************** +* +* IOC State Definitions +* +*****************************************************************************/ + +#define MPI2_IOC_STATE_RESET (0x00000000) +#define MPI2_IOC_STATE_READY (0x10000000) +#define MPI2_IOC_STATE_OPERATIONAL (0x20000000) +#define MPI2_IOC_STATE_FAULT (0x40000000) + +#define MPI2_IOC_STATE_MASK (0xF0000000) +#define MPI2_IOC_STATE_SHIFT (28) + +/* Fault state range for prodcut specific codes */ +#define MPI2_FAULT_PRODUCT_SPECIFIC_MIN (0x0000) +#define MPI2_FAULT_PRODUCT_SPECIFIC_MAX (0xEFFF) + + +/***************************************************************************** +* +* System Interface Register Definitions +* +*****************************************************************************/ + +typedef volatile struct _MPI2_SYSTEM_INTERFACE_REGS +{ + U32 Doorbell; /* 0x00 */ + U32 WriteSequence; /* 0x04 */ + U32 HostDiagnostic; /* 0x08 */ + U32 Reserved1; /* 0x0C */ + U32 DiagRWData; /* 0x10 */ + U32 DiagRWAddressLow; /* 0x14 */ + U32 DiagRWAddressHigh; /* 0x18 */ + U32 Reserved2[5]; /* 0x1C */ + U32 HostInterruptStatus; /* 0x30 */ + U32 HostInterruptMask; /* 0x34 */ + U32 DCRData; /* 0x38 */ + U32 DCRAddress; /* 0x3C */ + U32 Reserved3[2]; /* 0x40 */ + U32 ReplyFreeHostIndex; /* 0x48 */ + U32 Reserved4[8]; /* 0x4C */ + U32 ReplyPostHostIndex; /* 0x6C */ + U32 Reserved5; /* 0x70 */ + U32 HCBSize; /* 0x74 */ + U32 HCBAddressLow; /* 0x78 */ + U32 HCBAddressHigh; /* 0x7C */ + U32 Reserved6[16]; /* 0x80 */ + U32 RequestDescriptorPostLow; /* 0xC0 */ + U32 RequestDescriptorPostHigh; /* 0xC4 */ + U32 Reserved7[14]; /* 0xC8 */ +} MPI2_SYSTEM_INTERFACE_REGS, MPI2_POINTER PTR_MPI2_SYSTEM_INTERFACE_REGS, + Mpi2SystemInterfaceRegs_t, MPI2_POINTER pMpi2SystemInterfaceRegs_t; + +/* + * Defines for working with the Doorbell register. + */ +#define MPI2_DOORBELL_OFFSET (0x00000000) + +/* IOC --> System values */ +#define MPI2_DOORBELL_USED (0x08000000) +#define MPI2_DOORBELL_WHO_INIT_MASK (0x07000000) +#define MPI2_DOORBELL_WHO_INIT_SHIFT (24) +#define MPI2_DOORBELL_FAULT_CODE_MASK (0x0000FFFF) +#define MPI2_DOORBELL_DATA_MASK (0x0000FFFF) + +/* System --> IOC values */ +#define MPI2_DOORBELL_FUNCTION_MASK (0xFF000000) +#define MPI2_DOORBELL_FUNCTION_SHIFT (24) +#define MPI2_DOORBELL_ADD_DWORDS_MASK (0x00FF0000) +#define MPI2_DOORBELL_ADD_DWORDS_SHIFT (16) + + +/* + * Defines for the WriteSequence register + */ +#define MPI2_WRITE_SEQUENCE_OFFSET (0x00000004) +#define MPI2_WRSEQ_KEY_VALUE_MASK (0x0000000F) +#define MPI2_WRSEQ_FLUSH_KEY_VALUE (0x0) +#define MPI2_WRSEQ_1ST_KEY_VALUE (0xF) +#define MPI2_WRSEQ_2ND_KEY_VALUE (0x4) +#define MPI2_WRSEQ_3RD_KEY_VALUE (0xB) +#define MPI2_WRSEQ_4TH_KEY_VALUE (0x2) +#define MPI2_WRSEQ_5TH_KEY_VALUE (0x7) +#define MPI2_WRSEQ_6TH_KEY_VALUE (0xD) + +/* + * Defines for the HostDiagnostic register + */ +#define MPI2_HOST_DIAGNOSTIC_OFFSET (0x00000008) + +#define MPI2_DIAG_BOOT_DEVICE_SELECT_MASK (0x00001800) +#define MPI2_DIAG_BOOT_DEVICE_SELECT_DEFAULT (0x00000000) +#define MPI2_DIAG_BOOT_DEVICE_SELECT_HCDW (0x00000800) + +#define MPI2_DIAG_CLEAR_FLASH_BAD_SIG (0x00000400) +#define MPI2_DIAG_FORCE_HCB_ON_RESET (0x00000200) +#define MPI2_DIAG_HCB_MODE (0x00000100) +#define MPI2_DIAG_DIAG_WRITE_ENABLE (0x00000080) +#define MPI2_DIAG_FLASH_BAD_SIG (0x00000040) +#define MPI2_DIAG_RESET_HISTORY (0x00000020) +#define MPI2_DIAG_DIAG_RW_ENABLE (0x00000010) +#define MPI2_DIAG_RESET_ADAPTER (0x00000004) +#define MPI2_DIAG_HOLD_IOC_RESET (0x00000002) + +/* + * Offsets for DiagRWData and address + */ +#define MPI2_DIAG_RW_DATA_OFFSET (0x00000010) +#define MPI2_DIAG_RW_ADDRESS_LOW_OFFSET (0x00000014) +#define MPI2_DIAG_RW_ADDRESS_HIGH_OFFSET (0x00000018) + +/* + * Defines for the HostInterruptStatus register + */ +#define MPI2_HOST_INTERRUPT_STATUS_OFFSET (0x00000030) +#define MPI2_HIS_SYS2IOC_DB_STATUS (0x80000000) +#define MPI2_HIS_IOP_DOORBELL_STATUS MPI2_HIS_SYS2IOC_DB_STATUS +#define MPI2_HIS_RESET_IRQ_STATUS (0x40000000) +#define MPI2_HIS_REPLY_DESCRIPTOR_INTERRUPT (0x00000008) +#define MPI2_HIS_IOC2SYS_DB_STATUS (0x00000001) +#define MPI2_HIS_DOORBELL_INTERRUPT MPI2_HIS_IOC2SYS_DB_STATUS + +/* + * Defines for the HostInterruptMask register + */ +#define MPI2_HOST_INTERRUPT_MASK_OFFSET (0x00000034) +#define MPI2_HIM_RESET_IRQ_MASK (0x40000000) +#define MPI2_HIM_REPLY_INT_MASK (0x00000008) +#define MPI2_HIM_RIM MPI2_HIM_REPLY_INT_MASK +#define MPI2_HIM_IOC2SYS_DB_MASK (0x00000001) +#define MPI2_HIM_DIM MPI2_HIM_IOC2SYS_DB_MASK + +/* + * Offsets for DCRData and address + */ +#define MPI2_DCR_DATA_OFFSET (0x00000038) +#define MPI2_DCR_ADDRESS_OFFSET (0x0000003C) + +/* + * Offset for the Reply Free Queue + */ +#define MPI2_REPLY_FREE_HOST_INDEX_OFFSET (0x00000048) + +/* + * Defines for the Reply Descriptor Post Queue + */ +#define MPI2_REPLY_POST_HOST_INDEX_OFFSET (0x0000006C) +#define MPI2_REPLY_POST_HOST_INDEX_MASK (0x00FFFFFF) +#define MPI2_RPHI_MSIX_INDEX_MASK (0xFF000000) +#define MPI2_RPHI_MSIX_INDEX_SHIFT (24) +#define MPI25_SUP_REPLY_POST_HOST_INDEX_OFFSET (0x0000030C) /* MPI v2.5 only */ + + +/* + * Defines for the HCBSize and address + */ +#define MPI2_HCB_SIZE_OFFSET (0x00000074) +#define MPI2_HCB_SIZE_SIZE_MASK (0xFFFFF000) +#define MPI2_HCB_SIZE_HCB_ENABLE (0x00000001) + +#define MPI2_HCB_ADDRESS_LOW_OFFSET (0x00000078) +#define MPI2_HCB_ADDRESS_HIGH_OFFSET (0x0000007C) + +/* + * Offsets for the Request Queue + */ +#define MPI2_REQUEST_DESCRIPTOR_POST_LOW_OFFSET (0x000000C0) +#define MPI2_REQUEST_DESCRIPTOR_POST_HIGH_OFFSET (0x000000C4) + + +/* Hard Reset delay timings */ +#define MPI2_HARD_RESET_PCIE_FIRST_READ_DELAY_MICRO_SEC (50000) +#define MPI2_HARD_RESET_PCIE_RESET_READ_WINDOW_MICRO_SEC (255000) +#define MPI2_HARD_RESET_PCIE_SECOND_READ_DELAY_MICRO_SEC (256000) + +/***************************************************************************** +* +* Message Descriptors +* +*****************************************************************************/ + +/* Request Descriptors */ + +/* Default Request Descriptor */ +typedef struct _MPI2_DEFAULT_REQUEST_DESCRIPTOR +{ + U8 RequestFlags; /* 0x00 */ + U8 MSIxIndex; /* 0x01 */ + U16 SMID; /* 0x02 */ + U16 LMID; /* 0x04 */ + U16 DescriptorTypeDependent; /* 0x06 */ +} MPI2_DEFAULT_REQUEST_DESCRIPTOR, + MPI2_POINTER PTR_MPI2_DEFAULT_REQUEST_DESCRIPTOR, + Mpi2DefaultRequestDescriptor_t, MPI2_POINTER pMpi2DefaultRequestDescriptor_t; + +/* defines for the RequestFlags field */ +#define MPI2_REQ_DESCRIPT_FLAGS_TYPE_MASK (0x0E) +#define MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO (0x00) +#define MPI2_REQ_DESCRIPT_FLAGS_SCSI_TARGET (0x02) +#define MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY (0x06) +#define MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE (0x08) +#define MPI2_REQ_DESCRIPT_FLAGS_RAID_ACCELERATOR (0x0A) +#define MPI25_REQ_DESCRIPT_FLAGS_FAST_PATH_SCSI_IO (0x0C) + +#define MPI2_REQ_DESCRIPT_FLAGS_IOC_FIFO_MARKER (0x01) + + +/* High Priority Request Descriptor */ +typedef struct _MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR +{ + U8 RequestFlags; /* 0x00 */ + U8 MSIxIndex; /* 0x01 */ + U16 SMID; /* 0x02 */ + U16 LMID; /* 0x04 */ + U16 Reserved1; /* 0x06 */ +} MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR, + MPI2_POINTER PTR_MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR, + Mpi2HighPriorityRequestDescriptor_t, + MPI2_POINTER pMpi2HighPriorityRequestDescriptor_t; + + +/* SCSI IO Request Descriptor */ +typedef struct _MPI2_SCSI_IO_REQUEST_DESCRIPTOR +{ + U8 RequestFlags; /* 0x00 */ + U8 MSIxIndex; /* 0x01 */ + U16 SMID; /* 0x02 */ + U16 LMID; /* 0x04 */ + U16 DevHandle; /* 0x06 */ +} MPI2_SCSI_IO_REQUEST_DESCRIPTOR, + MPI2_POINTER PTR_MPI2_SCSI_IO_REQUEST_DESCRIPTOR, + Mpi2SCSIIORequestDescriptor_t, MPI2_POINTER pMpi2SCSIIORequestDescriptor_t; + + +/* SCSI Target Request Descriptor */ +typedef struct _MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR +{ + U8 RequestFlags; /* 0x00 */ + U8 MSIxIndex; /* 0x01 */ + U16 SMID; /* 0x02 */ + U16 LMID; /* 0x04 */ + U16 IoIndex; /* 0x06 */ +} MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR, + MPI2_POINTER PTR_MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR, + Mpi2SCSITargetRequestDescriptor_t, + MPI2_POINTER pMpi2SCSITargetRequestDescriptor_t; + + +/* RAID Accelerator Request Descriptor */ +typedef struct _MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR +{ + U8 RequestFlags; /* 0x00 */ + U8 MSIxIndex; /* 0x01 */ + U16 SMID; /* 0x02 */ + U16 LMID; /* 0x04 */ + U16 Reserved; /* 0x06 */ +} MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR, + MPI2_POINTER PTR_MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR, + Mpi2RAIDAcceleratorRequestDescriptor_t, + MPI2_POINTER pMpi2RAIDAcceleratorRequestDescriptor_t; + + +/* Fast Path SCSI IO Request Descriptor */ +typedef MPI2_SCSI_IO_REQUEST_DESCRIPTOR + MPI25_FP_SCSI_IO_REQUEST_DESCRIPTOR, + MPI2_POINTER PTR_MPI25_FP_SCSI_IO_REQUEST_DESCRIPTOR, + Mpi25FastPathSCSIIORequestDescriptor_t, + MPI2_POINTER pMpi25FastPathSCSIIORequestDescriptor_t; + + +/* union of Request Descriptors */ +typedef union _MPI2_REQUEST_DESCRIPTOR_UNION +{ + MPI2_DEFAULT_REQUEST_DESCRIPTOR Default; + MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR HighPriority; + MPI2_SCSI_IO_REQUEST_DESCRIPTOR SCSIIO; + MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR SCSITarget; + MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR RAIDAccelerator; + MPI25_FP_SCSI_IO_REQUEST_DESCRIPTOR FastPathSCSIIO; + U64 Words; +} MPI2_REQUEST_DESCRIPTOR_UNION, MPI2_POINTER PTR_MPI2_REQUEST_DESCRIPTOR_UNION, + Mpi2RequestDescriptorUnion_t, MPI2_POINTER pMpi2RequestDescriptorUnion_t; + + +/* Reply Descriptors */ + +/* Default Reply Descriptor */ +typedef struct _MPI2_DEFAULT_REPLY_DESCRIPTOR +{ + U8 ReplyFlags; /* 0x00 */ + U8 MSIxIndex; /* 0x01 */ + U16 DescriptorTypeDependent1; /* 0x02 */ + U32 DescriptorTypeDependent2; /* 0x04 */ +} MPI2_DEFAULT_REPLY_DESCRIPTOR, MPI2_POINTER PTR_MPI2_DEFAULT_REPLY_DESCRIPTOR, + Mpi2DefaultReplyDescriptor_t, MPI2_POINTER pMpi2DefaultReplyDescriptor_t; + +/* defines for the ReplyFlags field */ +#define MPI2_RPY_DESCRIPT_FLAGS_TYPE_MASK (0x0F) +#define MPI2_RPY_DESCRIPT_FLAGS_SCSI_IO_SUCCESS (0x00) +#define MPI2_RPY_DESCRIPT_FLAGS_ADDRESS_REPLY (0x01) +#define MPI2_RPY_DESCRIPT_FLAGS_TARGETASSIST_SUCCESS (0x02) +#define MPI2_RPY_DESCRIPT_FLAGS_TARGET_COMMAND_BUFFER (0x03) +#define MPI2_RPY_DESCRIPT_FLAGS_RAID_ACCELERATOR_SUCCESS (0x05) +#define MPI25_RPY_DESCRIPT_FLAGS_FAST_PATH_SCSI_IO_SUCCESS (0x06) +#define MPI2_RPY_DESCRIPT_FLAGS_UNUSED (0x0F) + +/* values for marking a reply descriptor as unused */ +#define MPI2_RPY_DESCRIPT_UNUSED_WORD0_MARK (0xFFFFFFFF) +#define MPI2_RPY_DESCRIPT_UNUSED_WORD1_MARK (0xFFFFFFFF) + +/* Address Reply Descriptor */ +typedef struct _MPI2_ADDRESS_REPLY_DESCRIPTOR +{ + U8 ReplyFlags; /* 0x00 */ + U8 MSIxIndex; /* 0x01 */ + U16 SMID; /* 0x02 */ + U32 ReplyFrameAddress; /* 0x04 */ +} MPI2_ADDRESS_REPLY_DESCRIPTOR, MPI2_POINTER PTR_MPI2_ADDRESS_REPLY_DESCRIPTOR, + Mpi2AddressReplyDescriptor_t, MPI2_POINTER pMpi2AddressReplyDescriptor_t; + +#define MPI2_ADDRESS_REPLY_SMID_INVALID (0x00) + + +/* SCSI IO Success Reply Descriptor */ +typedef struct _MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR +{ + U8 ReplyFlags; /* 0x00 */ + U8 MSIxIndex; /* 0x01 */ + U16 SMID; /* 0x02 */ + U16 TaskTag; /* 0x04 */ + U16 Reserved1; /* 0x06 */ +} MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR, + MPI2_POINTER PTR_MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR, + Mpi2SCSIIOSuccessReplyDescriptor_t, + MPI2_POINTER pMpi2SCSIIOSuccessReplyDescriptor_t; + + +/* TargetAssist Success Reply Descriptor */ +typedef struct _MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR +{ + U8 ReplyFlags; /* 0x00 */ + U8 MSIxIndex; /* 0x01 */ + U16 SMID; /* 0x02 */ + U8 SequenceNumber; /* 0x04 */ + U8 Reserved1; /* 0x05 */ + U16 IoIndex; /* 0x06 */ +} MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR, + MPI2_POINTER PTR_MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR, + Mpi2TargetAssistSuccessReplyDescriptor_t, + MPI2_POINTER pMpi2TargetAssistSuccessReplyDescriptor_t; + + +/* Target Command Buffer Reply Descriptor */ +typedef struct _MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR +{ + U8 ReplyFlags; /* 0x00 */ + U8 MSIxIndex; /* 0x01 */ + U8 VP_ID; /* 0x02 */ + U8 Flags; /* 0x03 */ + U16 InitiatorDevHandle; /* 0x04 */ + U16 IoIndex; /* 0x06 */ +} MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR, + MPI2_POINTER PTR_MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR, + Mpi2TargetCommandBufferReplyDescriptor_t, + MPI2_POINTER pMpi2TargetCommandBufferReplyDescriptor_t; + +/* defines for Flags field */ +#define MPI2_RPY_DESCRIPT_TCB_FLAGS_PHYNUM_MASK (0x3F) + + +/* RAID Accelerator Success Reply Descriptor */ +typedef struct _MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR +{ + U8 ReplyFlags; /* 0x00 */ + U8 MSIxIndex; /* 0x01 */ + U16 SMID; /* 0x02 */ + U32 Reserved; /* 0x04 */ +} MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR, + MPI2_POINTER PTR_MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR, + Mpi2RAIDAcceleratorSuccessReplyDescriptor_t, + MPI2_POINTER pMpi2RAIDAcceleratorSuccessReplyDescriptor_t; + + +/* Fast Path SCSI IO Success Reply Descriptor */ +typedef MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR + MPI25_FP_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR, + MPI2_POINTER PTR_MPI25_FP_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR, + Mpi25FastPathSCSIIOSuccessReplyDescriptor_t, + MPI2_POINTER pMpi25FastPathSCSIIOSuccessReplyDescriptor_t; + + +/* union of Reply Descriptors */ +typedef union _MPI2_REPLY_DESCRIPTORS_UNION +{ + MPI2_DEFAULT_REPLY_DESCRIPTOR Default; + MPI2_ADDRESS_REPLY_DESCRIPTOR AddressReply; + MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR SCSIIOSuccess; + MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR TargetAssistSuccess; + MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR TargetCommandBuffer; + MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR RAIDAcceleratorSuccess; + MPI25_FP_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR FastPathSCSIIOSuccess; + U64 Words; +} MPI2_REPLY_DESCRIPTORS_UNION, MPI2_POINTER PTR_MPI2_REPLY_DESCRIPTORS_UNION, + Mpi2ReplyDescriptorsUnion_t, MPI2_POINTER pMpi2ReplyDescriptorsUnion_t; + + + +/***************************************************************************** +* +* Message Functions +* +*****************************************************************************/ + +#define MPI2_FUNCTION_SCSI_IO_REQUEST (0x00) /* SCSI IO */ +#define MPI2_FUNCTION_SCSI_TASK_MGMT (0x01) /* SCSI Task Management */ +#define MPI2_FUNCTION_IOC_INIT (0x02) /* IOC Init */ +#define MPI2_FUNCTION_IOC_FACTS (0x03) /* IOC Facts */ +#define MPI2_FUNCTION_CONFIG (0x04) /* Configuration */ +#define MPI2_FUNCTION_PORT_FACTS (0x05) /* Port Facts */ +#define MPI2_FUNCTION_PORT_ENABLE (0x06) /* Port Enable */ +#define MPI2_FUNCTION_EVENT_NOTIFICATION (0x07) /* Event Notification */ +#define MPI2_FUNCTION_EVENT_ACK (0x08) /* Event Acknowledge */ +#define MPI2_FUNCTION_FW_DOWNLOAD (0x09) /* FW Download */ +#define MPI2_FUNCTION_TARGET_ASSIST (0x0B) /* Target Assist */ +#define MPI2_FUNCTION_TARGET_STATUS_SEND (0x0C) /* Target Status Send */ +#define MPI2_FUNCTION_TARGET_MODE_ABORT (0x0D) /* Target Mode Abort */ +#define MPI2_FUNCTION_FW_UPLOAD (0x12) /* FW Upload */ +#define MPI2_FUNCTION_RAID_ACTION (0x15) /* RAID Action */ +#define MPI2_FUNCTION_RAID_SCSI_IO_PASSTHROUGH (0x16) /* SCSI IO RAID Passthrough */ +#define MPI2_FUNCTION_TOOLBOX (0x17) /* Toolbox */ +#define MPI2_FUNCTION_SCSI_ENCLOSURE_PROCESSOR (0x18) /* SCSI Enclosure Processor */ +#define MPI2_FUNCTION_SMP_PASSTHROUGH (0x1A) /* SMP Passthrough */ +#define MPI2_FUNCTION_SAS_IO_UNIT_CONTROL (0x1B) /* SAS IO Unit Control */ +#define MPI2_FUNCTION_SATA_PASSTHROUGH (0x1C) /* SATA Passthrough */ +#define MPI2_FUNCTION_DIAG_BUFFER_POST (0x1D) /* Diagnostic Buffer Post */ +#define MPI2_FUNCTION_DIAG_RELEASE (0x1E) /* Diagnostic Release */ +#define MPI2_FUNCTION_TARGET_CMD_BUF_BASE_POST (0x24) /* Target Command Buffer Post Base */ +#define MPI2_FUNCTION_TARGET_CMD_BUF_LIST_POST (0x25) /* Target Command Buffer Post List */ +#define MPI2_FUNCTION_RAID_ACCELERATOR (0x2C) /* RAID Accelerator */ +#define MPI2_FUNCTION_HOST_BASED_DISCOVERY_ACTION (0x2F) /* Host Based Discovery Action */ +#define MPI2_FUNCTION_PWR_MGMT_CONTROL (0x30) /* Power Management Control */ +#define MPI2_FUNCTION_SEND_HOST_MESSAGE (0x31) /* Send Host Message */ +#define MPI2_FUNCTION_MIN_PRODUCT_SPECIFIC (0xF0) /* beginning of product-specific range */ +#define MPI2_FUNCTION_MAX_PRODUCT_SPECIFIC (0xFF) /* end of product-specific range */ + + + +/* Doorbell functions */ +#define MPI2_FUNCTION_IOC_MESSAGE_UNIT_RESET (0x40) +#define MPI2_FUNCTION_HANDSHAKE (0x42) + + +/***************************************************************************** +* +* IOC Status Values +* +*****************************************************************************/ + +/* mask for IOCStatus status value */ +#define MPI2_IOCSTATUS_MASK (0x7FFF) + +/**************************************************************************** +* Common IOCStatus values for all replies +****************************************************************************/ + +#define MPI2_IOCSTATUS_SUCCESS (0x0000) +#define MPI2_IOCSTATUS_INVALID_FUNCTION (0x0001) +#define MPI2_IOCSTATUS_BUSY (0x0002) +#define MPI2_IOCSTATUS_INVALID_SGL (0x0003) +#define MPI2_IOCSTATUS_INTERNAL_ERROR (0x0004) +#define MPI2_IOCSTATUS_INVALID_VPID (0x0005) +#define MPI2_IOCSTATUS_INSUFFICIENT_RESOURCES (0x0006) +#define MPI2_IOCSTATUS_INVALID_FIELD (0x0007) +#define MPI2_IOCSTATUS_INVALID_STATE (0x0008) +#define MPI2_IOCSTATUS_OP_STATE_NOT_SUPPORTED (0x0009) + +/**************************************************************************** +* Config IOCStatus values +****************************************************************************/ + +#define MPI2_IOCSTATUS_CONFIG_INVALID_ACTION (0x0020) +#define MPI2_IOCSTATUS_CONFIG_INVALID_TYPE (0x0021) +#define MPI2_IOCSTATUS_CONFIG_INVALID_PAGE (0x0022) +#define MPI2_IOCSTATUS_CONFIG_INVALID_DATA (0x0023) +#define MPI2_IOCSTATUS_CONFIG_NO_DEFAULTS (0x0024) +#define MPI2_IOCSTATUS_CONFIG_CANT_COMMIT (0x0025) + +/**************************************************************************** +* SCSI IO Reply +****************************************************************************/ + +#define MPI2_IOCSTATUS_SCSI_RECOVERED_ERROR (0x0040) +#define MPI2_IOCSTATUS_SCSI_INVALID_DEVHANDLE (0x0042) +#define MPI2_IOCSTATUS_SCSI_DEVICE_NOT_THERE (0x0043) +#define MPI2_IOCSTATUS_SCSI_DATA_OVERRUN (0x0044) +#define MPI2_IOCSTATUS_SCSI_DATA_UNDERRUN (0x0045) +#define MPI2_IOCSTATUS_SCSI_IO_DATA_ERROR (0x0046) +#define MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR (0x0047) +#define MPI2_IOCSTATUS_SCSI_TASK_TERMINATED (0x0048) +#define MPI2_IOCSTATUS_SCSI_RESIDUAL_MISMATCH (0x0049) +#define MPI2_IOCSTATUS_SCSI_TASK_MGMT_FAILED (0x004A) +#define MPI2_IOCSTATUS_SCSI_IOC_TERMINATED (0x004B) +#define MPI2_IOCSTATUS_SCSI_EXT_TERMINATED (0x004C) + +/**************************************************************************** +* For use by SCSI Initiator and SCSI Target end-to-end data protection +****************************************************************************/ + +#define MPI2_IOCSTATUS_EEDP_GUARD_ERROR (0x004D) +#define MPI2_IOCSTATUS_EEDP_REF_TAG_ERROR (0x004E) +#define MPI2_IOCSTATUS_EEDP_APP_TAG_ERROR (0x004F) + +/**************************************************************************** +* SCSI Target values +****************************************************************************/ + +#define MPI2_IOCSTATUS_TARGET_INVALID_IO_INDEX (0x0062) +#define MPI2_IOCSTATUS_TARGET_ABORTED (0x0063) +#define MPI2_IOCSTATUS_TARGET_NO_CONN_RETRYABLE (0x0064) +#define MPI2_IOCSTATUS_TARGET_NO_CONNECTION (0x0065) +#define MPI2_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH (0x006A) +#define MPI2_IOCSTATUS_TARGET_DATA_OFFSET_ERROR (0x006D) +#define MPI2_IOCSTATUS_TARGET_TOO_MUCH_WRITE_DATA (0x006E) +#define MPI2_IOCSTATUS_TARGET_IU_TOO_SHORT (0x006F) +#define MPI2_IOCSTATUS_TARGET_ACK_NAK_TIMEOUT (0x0070) +#define MPI2_IOCSTATUS_TARGET_NAK_RECEIVED (0x0071) + +/**************************************************************************** +* Serial Attached SCSI values +****************************************************************************/ + +#define MPI2_IOCSTATUS_SAS_SMP_REQUEST_FAILED (0x0090) +#define MPI2_IOCSTATUS_SAS_SMP_DATA_OVERRUN (0x0091) + +/**************************************************************************** +* Diagnostic Buffer Post / Diagnostic Release values +****************************************************************************/ + +#define MPI2_IOCSTATUS_DIAGNOSTIC_RELEASED (0x00A0) + +/**************************************************************************** +* RAID Accelerator values +****************************************************************************/ + +#define MPI2_IOCSTATUS_RAID_ACCEL_ERROR (0x00B0) + +/**************************************************************************** +* IOCStatus flag to indicate that log info is available +****************************************************************************/ + +#define MPI2_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE (0x8000) + +/**************************************************************************** +* IOCLogInfo Types +****************************************************************************/ + +#define MPI2_IOCLOGINFO_TYPE_MASK (0xF0000000) +#define MPI2_IOCLOGINFO_TYPE_SHIFT (28) +#define MPI2_IOCLOGINFO_TYPE_NONE (0x0) +#define MPI2_IOCLOGINFO_TYPE_SCSI (0x1) +#define MPI2_IOCLOGINFO_TYPE_FC (0x2) +#define MPI2_IOCLOGINFO_TYPE_SAS (0x3) +#define MPI2_IOCLOGINFO_TYPE_ISCSI (0x4) +#define MPI2_IOCLOGINFO_LOG_DATA_MASK (0x0FFFFFFF) + + +/***************************************************************************** *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri May 2 20:36:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 030D7A7A; Fri, 2 May 2014 20:36:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E47CF187A; Fri, 2 May 2014 20:36:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s42KaKUU041838; Fri, 2 May 2014 20:36:20 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42KaKNw041837; Fri, 2 May 2014 20:36:20 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201405022036.s42KaKNw041837@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 2 May 2014 20:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265237 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 20:36:21 -0000 Author: ken Date: Fri May 2 20:36:20 2014 New Revision: 265237 URL: http://svnweb.freebsd.org/changeset/base/265237 Log: Add the mpr(4) man page to the man4 Makefile. This should have been included in r265236. Submitted by: Steve McConnell MFC after: 3 days Sponsored by: LSI, Spectra Logic Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri May 2 20:25:09 2014 (r265236) +++ head/share/man/man4/Makefile Fri May 2 20:36:20 2014 (r265237) @@ -262,6 +262,7 @@ MAN= aac.4 \ mod_cc.4 \ mos.4 \ mouse.4 \ + mpr.4 \ mps.4 \ mpt.4 \ msk.4 \ From owner-svn-src-head@FreeBSD.ORG Fri May 2 20:41:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9182D8C; Fri, 2 May 2014 20:41:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A648F1913; Fri, 2 May 2014 20:41:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s42Kf90D043112; Fri, 2 May 2014 20:41:09 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42Kf93I043111; Fri, 2 May 2014 20:41:09 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405022041.s42Kf93I043111@svn.freebsd.org> From: Christian Brueffer Date: Fri, 2 May 2014 20:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265238 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 20:41:09 -0000 Author: brueffer Date: Fri May 2 20:41:09 2014 New Revision: 265238 URL: http://svnweb.freebsd.org/changeset/base/265238 Log: Properly free resources in case of error. CID: 1007032 Found with: Coverity Prevent(tm) MFC after: 2 weeks Modified: head/lib/libc/rpc/clnt_vc.c Modified: head/lib/libc/rpc/clnt_vc.c ============================================================================== --- head/lib/libc/rpc/clnt_vc.c Fri May 2 20:36:20 2014 (r265237) +++ head/lib/libc/rpc/clnt_vc.c Fri May 2 20:41:09 2014 (r265238) @@ -301,15 +301,13 @@ clnt_vc_create(fd, raddr, prog, vers, se return (cl); err: - if (cl) { - if (ct) { - if (ct->ct_addr.len) - mem_free(ct->ct_addr.buf, ct->ct_addr.len); - mem_free(ct, sizeof (struct ct_data)); - } - if (cl) - mem_free(cl, sizeof (CLIENT)); + if (ct) { + if (ct->ct_addr.len) + mem_free(ct->ct_addr.buf, ct->ct_addr.len); + mem_free(ct, sizeof (struct ct_data)); } + if (cl) + mem_free(cl, sizeof (CLIENT)); return ((CLIENT *)NULL); } From owner-svn-src-head@FreeBSD.ORG Fri May 2 20:45:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B5C3FA9; Fri, 2 May 2014 20:45:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 267971945; Fri, 2 May 2014 20:45:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s42KjZbo045838; Fri, 2 May 2014 20:45:35 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42KjZ1E045837; Fri, 2 May 2014 20:45:35 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201405022045.s42KjZ1E045837@svn.freebsd.org> From: Bryan Drewery Date: Fri, 2 May 2014 20:45:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265239 - head/rescue/rescue X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 20:45:35 -0000 Author: bdrewery Date: Fri May 2 20:45:34 2014 New Revision: 265239 URL: http://svnweb.freebsd.org/changeset/base/265239 Log: - Fix build WITHOUT_ZFS/WITHOUT_CDDL after r265229, bin/ps needs libjail. MFC after: 2 weeks X-MFC-with: r265229 Modified: head/rescue/rescue/Makefile Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Fri May 2 20:41:09 2014 (r265238) +++ head/rescue/rescue/Makefile Fri May 2 20:45:34 2014 (r265239) @@ -52,7 +52,7 @@ CRUNCH_SRCDIRS+= bin CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo \ ed expr getfacl hostname kenv kill ln ls mkdir mv \ pkill ps pwd realpath rm rmdir setfacl sh stty sync test -CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -ltermcap -lutil +CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -ll -ltermcap -lutil CRUNCH_BUILDTOOLS+= bin/sh # Additional options for specific programs @@ -120,7 +120,7 @@ CRUNCH_PROGS_sbin+= zpool CRUNCH_LIBS+= -lalias -lcam -lcurses -ldevstat -lipsec .if ${MK_ZFS} != "no" -CRUNCH_LIBS+= -lavl -ljail -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem +CRUNCH_LIBS+= -lavl -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem .endif CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lmd -lsbuf -lufs -lz From owner-svn-src-head@FreeBSD.ORG Fri May 2 20:45:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB45116C; Fri, 2 May 2014 20:45:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98A661947; Fri, 2 May 2014 20:45:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s42KjtMH045902; Fri, 2 May 2014 20:45:55 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42Kjt9e045901; Fri, 2 May 2014 20:45:55 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405022045.s42Kjt9e045901@svn.freebsd.org> From: Christian Brueffer Date: Fri, 2 May 2014 20:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265240 - head/sys/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 20:45:55 -0000 Author: brueffer Date: Fri May 2 20:45:55 2014 New Revision: 265240 URL: http://svnweb.freebsd.org/changeset/base/265240 Log: Properly free resources in case of error. CID: 1007032 Found with: Coverity Prevent(tm) MFC after: 2 weeks Modified: head/sys/rpc/clnt_vc.c Modified: head/sys/rpc/clnt_vc.c ============================================================================== --- head/sys/rpc/clnt_vc.c Fri May 2 20:45:34 2014 (r265239) +++ head/sys/rpc/clnt_vc.c Fri May 2 20:45:55 2014 (r265240) @@ -270,14 +270,12 @@ clnt_vc_create( return (cl); err: - if (cl) { - if (ct) { - mtx_destroy(&ct->ct_lock); - mem_free(ct, sizeof (struct ct_data)); - } - if (cl) - mem_free(cl, sizeof (CLIENT)); + if (ct) { + mtx_destroy(&ct->ct_lock); + mem_free(ct, sizeof (struct ct_data)); } + if (cl) + mem_free(cl, sizeof (CLIENT)); return ((CLIENT *)NULL); } From owner-svn-src-head@FreeBSD.ORG Fri May 2 20:46:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2833A2E4 for ; Fri, 2 May 2014 20:46:26 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C5821952 for ; Fri, 2 May 2014 20:46:26 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s42KkPXm055970 for ; Fri, 2 May 2014 20:46:25 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s42KkPxH055964 for svn-src-head@freebsd.org; Fri, 2 May 2014 20:46:25 GMT (envelope-from bdrewery) Received: (qmail 8464 invoked from network); 2 May 2014 15:46:24 -0500 Received: from unknown (HELO roundcube.xk42.net) (10.10.5.5) by sweb.xzibition.com with SMTP; 2 May 2014 15:46:24 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 02 May 2014 15:46:24 -0500 From: Bryan Drewery To: Ian Lepore Subject: Re: svn commit: r265229 - head/bin/ps Organization: FreeBSD In-Reply-To: <1399061950.22079.195.camel@revolution.hippie.lan> References: <201405021505.s42F5lQO099446@svn.freebsd.org> <1399061950.22079.195.camel@revolution.hippie.lan> Message-ID: <52ce1e98815f7a8bc97c4a03a3461d08@shatow.net> X-Sender: bdrewery@FreeBSD.org User-Agent: Roundcube Webmail/0.9.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 20:46:26 -0000 On 2014-05-02 15:19, Ian Lepore wrote: > On Fri, 2014-05-02 at 15:05 +0000, Bryan Drewery wrote: >> Author: bdrewery >> Date: Fri May 2 15:05:47 2014 >> New Revision: 265229 >> URL: http://svnweb.freebsd.org/changeset/base/265229 >> >> Log: >> Add -J to filter by matching jail IDs and names. >> [...] > I'm getting an error building rescue after this change: > > --- rescue.all__D --- > ps.lo: In function `_$$hide$$ ps.lo $a': > _$$hide$$ ps.lo ps.c:(.text+0x26ec): undefined reference to > `jail_getid' > *** [rescue] Error code 1 > > bmake[4]: stopped > in > /local/build/staging/freebsd/wand/obj/arm.armv6/local/build/staging/freebsd/wand/src/rescue/rescue > 1 error > > This is on arm, building with gcc, but I'm not sure whether that's > germane or not. > > -- Ian Fixed in r265239. Was only if not building ZFS. -- Regards, Bryan Drewery From owner-svn-src-head@FreeBSD.ORG Fri May 2 20:58:16 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6FE2650; Fri, 2 May 2014 20:58:16 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A1B41A2E; Fri, 2 May 2014 20:58:16 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WgKX9-0001mU-9p; Fri, 02 May 2014 20:58:15 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s42KwD0D020663; Fri, 2 May 2014 14:58:13 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/RqMKRNGMeL+dyY54gVOGk Subject: Re: svn commit: r265229 - head/bin/ps From: Ian Lepore To: Bryan Drewery In-Reply-To: <52ce1e98815f7a8bc97c4a03a3461d08@shatow.net> References: <201405021505.s42F5lQO099446@svn.freebsd.org> <1399061950.22079.195.camel@revolution.hippie.lan> <52ce1e98815f7a8bc97c4a03a3461d08@shatow.net> Content-Type: text/plain; charset="us-ascii" Date: Fri, 02 May 2014 14:58:13 -0600 Message-ID: <1399064293.22079.196.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 20:58:16 -0000 On Fri, 2014-05-02 at 15:46 -0500, Bryan Drewery wrote: > On 2014-05-02 15:19, Ian Lepore wrote: > > On Fri, 2014-05-02 at 15:05 +0000, Bryan Drewery wrote: > >> Author: bdrewery > >> Date: Fri May 2 15:05:47 2014 > >> New Revision: 265229 > >> URL: http://svnweb.freebsd.org/changeset/base/265229 > >> > >> Log: > >> Add -J to filter by matching jail IDs and names. > >> > [...] > > I'm getting an error building rescue after this change: > > > > --- rescue.all__D --- > > ps.lo: In function `_$$hide$$ ps.lo $a': > > _$$hide$$ ps.lo ps.c:(.text+0x26ec): undefined reference to > > `jail_getid' > > *** [rescue] Error code 1 > > > > bmake[4]: stopped > > in > > /local/build/staging/freebsd/wand/obj/arm.armv6/local/build/staging/freebsd/wand/src/rescue/rescue > > 1 error > > > > This is on arm, building with gcc, but I'm not sure whether that's > > germane or not. > > > > -- Ian > > Fixed in r265239. > > Was only if not building ZFS. > Oh. No wonder I was the first one to run into it, I'm building WITHOUT_CDDL (just to save time, because I never need that stuff). Thanks. -- Ian From owner-svn-src-head@FreeBSD.ORG Fri May 2 21:09:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B8B7A7F; Fri, 2 May 2014 21:09:08 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 231991B00; Fri, 2 May 2014 21:09:08 +0000 (UTC) Received: from secured.by.ipfw.ru ([95.143.220.47] helo=ws.su29.net) by mail.ipfw.ru with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1WgGnz-000592-49; Fri, 02 May 2014 20:59:23 +0400 Message-ID: <5364093A.7040607@FreeBSD.org> Date: Sat, 03 May 2014 01:08:10 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Alan Somers Subject: Re: svn commit: r265232 - head/sys/net References: <201405021624.s42GO9Hi034947@svn.freebsd.org> <5363CF6C.2000305@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 21:09:08 -0000 On 03.05.2014 00:22, Alan Somers wrote: > On Fri, May 2, 2014 at 11:01 AM, Alexander V. Chernikov > wrote: >> On 02.05.2014 20:24, Alan Somers wrote: >>> >>> Author: asomers >>> Date: Fri May 2 16:24:09 2014 >>> New Revision: 265232 >>> URL: http://svnweb.freebsd.org/changeset/base/265232 >>> >>> Log: >>> Fix a panic caused by doing "ifconfig -am" while a lagg is being >>> destroyed. >>> The thread that is destroying the lagg has already set sc->sc_psc=NULL >>> when >>> the "ifconfig -am" thread gets to lacp_req(). It tries to dereference >>> sc->sc_psc and panics. The solution is for lacp_req() to check the >>> value of >>> sc->sc_psc. If NULL, harmlessly return an lacp_opreq structure full of >>> zeros. Full details in GNATS. >> >> Sorry, it looks like I've missed -net@ discussion. > > Thanks for the retroactive review; it's good too. > >> >> While this patch minimizes panics, they still can occur. >> If one thread performs lagg_clone_destroy() -> lagg_lacp_detach() (1) -> >> lacp_detach(), executing >> >> struct lacp_softc *lsc = LACP_SOFTC(sc); (e.g. one line before sc_psc = NULL >> assignment) >> >> At the same moment, another thread (initiated by ifconfig) executes >> >> >> struct lacp_softc *lsc = LACP_SOFTC(sc); >> >> Then, thread #1 goes further to >> >> LACP_LOCK_DESTROY(lsc); >> free(lsc, M_DEVBUF); >> >> After that, thread #2 performs >> >> bzero(req, sizeof(struct lacp_opreq)); >> >> passes lsc check for NULL and crashes on destroyed mutex. >> >> >> Briefly looking, we can remove WUNLOCK() before lacp_detach() in >> lagg_lacp_detach() (I'm unsure about the reasons why do we need unlock >> here). >> lacp_req() is already protected by at least LAGG_RLOCK() so we should get >> consistent view of sc->sc_psc. > > The WUNLOCK was added in r168561 without comment. Removing it seems > like it would work. It doesn't cause any new LORs or WITNESS > warnings. And I can no longer reproduce the panic in lacp_req. > However, it doesn't fix another panic in lagg_port_ioctl line 825 (my > patch didn't either). Do you have any good ideas what to do about > that? Interesting. Line numbers look a bit shifted. Is line 825 'LAGG_RUNLOCK(sc, &tracker)' ? Are the steps to reproduce it the same as in kern/189003? > > #9 0xffffffff808cee81 in __mtx_lock_sleep (c=0xfffff800052bb648, > tid=18446735277704396800, opts=, > file=, line=) > at /usr/home/alans/freebsd/head/sys/kern/kern_mutex.c:430 > #10 0xffffffff808ced02 in __mtx_lock_flags (c=, opts=0, > file=0xffffffff80f6dd8c > "/usr/home/alans/freebsd/head/sys/kern/kern_rmlock.c", line=407) at > /usr/home/alans/freebsd/head/sys/kern/kern_mutex.c:223 > #11 0xffffffff808e0032 in _rm_rlock (rm=0xfffff800052bb608, > tracker=0xfffffe0097751918, trylock=) > at /usr/home/alans/freebsd/head/sys/kern/kern_rmlock.c:407 > #12 0xffffffff808e0812 in _rm_rlock_debug (rm=0xfffff800052bb608, > tracker=0xfffffe0097751918, trylock=0, > file=0xffffffff81c1dd13 > "/usr/home/alans/freebsd/head/sys/modules/if_lagg/../../net/if_lagg.c", > line=825) > at /usr/home/alans/freebsd/head/sys/kern/kern_rmlock.c:659 > #13 0xffffffff81c19f62 in lagg_port_ioctl (ifp=0xfffff8000590d800, > cmd=, data=0xfffff80005582c00 "tap0") > at /usr/home/alans/freebsd/head/sys/modules/if_lagg/../../net/if_lagg.c:825 > #14 0xffffffff809ae407 in ifioctl (so=, cmd=3225971084, > data=0xfffff80005582c00 "tap0", td=) > at /usr/home/alans/freebsd/head/sys/net/if.c:2643 > #15 0xffffffff8093b9fb in kern_ioctl (td=, > fd=, com=) at file.h:323 > #16 0xffffffff8093b77c in sys_ioctl (td=0xfffff800053cc000, > uap=0xfffffe0097751b80) > at /usr/home/alans/freebsd/head/sys/kern/sys_generic.c:702 > From owner-svn-src-head@FreeBSD.ORG Fri May 2 21:14:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76530BFB; Fri, 2 May 2014 21:14:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6325F1BAD; Fri, 2 May 2014 21:14:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s42LETfT058531; Fri, 2 May 2014 21:14:29 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42LETO7058530; Fri, 2 May 2014 21:14:29 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405022114.s42LETO7058530@svn.freebsd.org> From: Christian Brueffer Date: Fri, 2 May 2014 21:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265241 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 21:14:29 -0000 Author: brueffer Date: Fri May 2 21:14:28 2014 New Revision: 265241 URL: http://svnweb.freebsd.org/changeset/base/265241 Log: Use our standard SYNOPSIS wording; perform some cleanup while here. Modified: head/share/man/man4/mpr.4 Modified: head/share/man/man4/mpr.4 ============================================================================== --- head/share/man/man4/mpr.4 Fri May 2 20:45:55 2014 (r265240) +++ head/share/man/man4/mpr.4 Fri May 2 21:14:28 2014 (r265241) @@ -36,7 +36,7 @@ .\" $Id$ .\" $FreeBSD$ .\" -.Dd Apr 28, 2014 +.Dd May 2, 2014 .Dt MPR 4 .Os .Sh NAME @@ -51,7 +51,8 @@ kernel configuration file: .Cd "device mpr" .Ed .Pp -Or, to load the driver as a module at boot, place the following line in +Alternatively, to load the driver as a +module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent mpr_load="YES" @@ -156,7 +157,8 @@ control for all adapters by setting the hw.mpr.exclude_ids=Y .Ed .Pp -where Y is the target ID of the device. If more than one device is to be +where Y is the target ID of the device. +If more than one device is to be excluded, target ID's are separated by commas. .Pp Devices can be excluded from @@ -167,7 +169,8 @@ control for a specific adapter by settin dev.mpr.X.exclude_ids=Y .Ed .Pp -where X is the adapter number and Y is the target ID of the device. If more +where X is the adapter number and Y is the target ID of the device. +If more than one device is to be excluded, target ID's are separated by commas. .Sh DEBUGGING To enable debugging prints from the @@ -200,8 +203,8 @@ The following bits have the described ef .Xr cd 4 , .Xr ch 4 , .Xr da 4 , -.Xr mpt 4 , .Xr mps 4 , +.Xr mpt 4 , .Xr pci 4 , .Xr sa 4 , .Xr scsi 4 , From owner-svn-src-head@FreeBSD.ORG Fri May 2 21:19:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85686E66; Fri, 2 May 2014 21:19:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72A3F1BE3; Fri, 2 May 2014 21:19:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s42LJEqJ059147; Fri, 2 May 2014 21:19:14 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42LJEiM059146; Fri, 2 May 2014 21:19:14 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405022119.s42LJEiM059146@svn.freebsd.org> From: Christian Brueffer Date: Fri, 2 May 2014 21:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265242 - head/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 21:19:14 -0000 Author: brueffer Date: Fri May 2 21:19:13 2014 New Revision: 265242 URL: http://svnweb.freebsd.org/changeset/base/265242 Log: Generate hardware notes for mpr(4) and bump copyright for 2014. Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri May 2 21:14:28 2014 (r265241) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri May 2 21:19:13 2014 (r265242) @@ -29,6 +29,7 @@ 2011 2012 2013 + 2014 The &os; Documentation Project @@ -732,6 +733,8 @@ &hwlist.mly; + &hwlist.mpr; + &hwlist.mps; &hwlist.mpt; From owner-svn-src-head@FreeBSD.ORG Fri May 2 21:23:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A9FA252; Fri, 2 May 2014 21:23:30 +0000 (UTC) Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com [IPv6:2a00:1450:400c:c05::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 741501CA2; Fri, 2 May 2014 21:23:29 +0000 (UTC) Received: by mail-wi0-f177.google.com with SMTP id cc10so2998286wib.4 for ; Fri, 02 May 2014 14:23:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=vZaMe0ZOIJLVjHtkxsEBhsPX89+zX+qRpCBEVHpdi1U=; b=ipuSGBdgWscd29FDJxsLG35q9kpu4gsCU7lq67mrFZ3y92cXj1RnYusqxKoNpmvcD2 +80cREKvADx+yxAJ2/ujrgFXhNBDInO4E6SARZGUslO/E6DuM+/PE+FUqO5kYZAzblZr QHqwhDLuvm8fHKprHZvIygvEb2teVmN8bwX1GVRcirqcqTkM1JWhJJgvmOEN3He1UovJ Pimxw7N5SHdO39s3PEGlhHYAwkay4pKZhrSFJtVOurXgzyKU1ypLcDy4PyHsqNxBXQlH D0Cl7MLfyWOGiMibZVpQVq5tFkcPinw5gccsIaVW28r19Ok+E8R1IPLAltmSIOynu4+U bJHg== MIME-Version: 1.0 X-Received: by 10.180.14.72 with SMTP id n8mr4691659wic.53.1399065807693; Fri, 02 May 2014 14:23:27 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.194.168.130 with HTTP; Fri, 2 May 2014 14:23:27 -0700 (PDT) In-Reply-To: <5364093A.7040607@FreeBSD.org> References: <201405021624.s42GO9Hi034947@svn.freebsd.org> <5363CF6C.2000305@FreeBSD.org> <5364093A.7040607@FreeBSD.org> Date: Fri, 2 May 2014 15:23:27 -0600 X-Google-Sender-Auth: EdPcD0Nkg7tJO4tNusq2HXdiCYw Message-ID: Subject: Re: svn commit: r265232 - head/sys/net From: Alan Somers To: "Alexander V. Chernikov" Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Alan Somers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 21:23:30 -0000 On Fri, May 2, 2014 at 3:08 PM, Alexander V. Chernikov wrote: > On 03.05.2014 00:22, Alan Somers wrote: >> On Fri, May 2, 2014 at 11:01 AM, Alexander V. Chernikov >> wrote: >>> On 02.05.2014 20:24, Alan Somers wrote: >>>> >>>> Author: asomers >>>> Date: Fri May 2 16:24:09 2014 >>>> New Revision: 265232 >>>> URL: http://svnweb.freebsd.org/changeset/base/265232 >>>> >>>> Log: >>>> Fix a panic caused by doing "ifconfig -am" while a lagg is being >>>> destroyed. >>>> The thread that is destroying the lagg has already set sc->sc_psc=NULL >>>> when >>>> the "ifconfig -am" thread gets to lacp_req(). It tries to dereference >>>> sc->sc_psc and panics. The solution is for lacp_req() to check the >>>> value of >>>> sc->sc_psc. If NULL, harmlessly return an lacp_opreq structure full of >>>> zeros. Full details in GNATS. >>> >>> Sorry, it looks like I've missed -net@ discussion. >> >> Thanks for the retroactive review; it's good too. >> >>> >>> While this patch minimizes panics, they still can occur. >>> If one thread performs lagg_clone_destroy() -> lagg_lacp_detach() (1) -> >>> lacp_detach(), executing >>> >>> struct lacp_softc *lsc = LACP_SOFTC(sc); (e.g. one line before sc_psc = NULL >>> assignment) >>> >>> At the same moment, another thread (initiated by ifconfig) executes >>> >>> >>> struct lacp_softc *lsc = LACP_SOFTC(sc); >>> >>> Then, thread #1 goes further to >>> >>> LACP_LOCK_DESTROY(lsc); >>> free(lsc, M_DEVBUF); >>> >>> After that, thread #2 performs >>> >>> bzero(req, sizeof(struct lacp_opreq)); >>> >>> passes lsc check for NULL and crashes on destroyed mutex. >>> >>> >>> Briefly looking, we can remove WUNLOCK() before lacp_detach() in >>> lagg_lacp_detach() (I'm unsure about the reasons why do we need unlock >>> here). >>> lacp_req() is already protected by at least LAGG_RLOCK() so we should get >>> consistent view of sc->sc_psc. >> >> The WUNLOCK was added in r168561 without comment. Removing it seems >> like it would work. It doesn't cause any new LORs or WITNESS >> warnings. And I can no longer reproduce the panic in lacp_req. >> However, it doesn't fix another panic in lagg_port_ioctl line 825 (my >> patch didn't either). Do you have any good ideas what to do about >> that? > Interesting. > Line numbers look a bit shifted. Is line 825 'LAGG_RUNLOCK(sc, &tracker)' ? Yes. > > Are the steps to reproduce it the same as in kern/189003? Yes. BTW, In kern/189003, I suggested reverting 253687. In reality, I didn't revert it; I commented out the sysctl lines it added in lacp_attach(). > >> >> #9 0xffffffff808cee81 in __mtx_lock_sleep (c=0xfffff800052bb648, >> tid=18446735277704396800, opts=, >> file=, line=) >> at /usr/home/alans/freebsd/head/sys/kern/kern_mutex.c:430 >> #10 0xffffffff808ced02 in __mtx_lock_flags (c=, opts=0, >> file=0xffffffff80f6dd8c >> "/usr/home/alans/freebsd/head/sys/kern/kern_rmlock.c", line=407) at >> /usr/home/alans/freebsd/head/sys/kern/kern_mutex.c:223 >> #11 0xffffffff808e0032 in _rm_rlock (rm=0xfffff800052bb608, >> tracker=0xfffffe0097751918, trylock=) >> at /usr/home/alans/freebsd/head/sys/kern/kern_rmlock.c:407 >> #12 0xffffffff808e0812 in _rm_rlock_debug (rm=0xfffff800052bb608, >> tracker=0xfffffe0097751918, trylock=0, >> file=0xffffffff81c1dd13 >> "/usr/home/alans/freebsd/head/sys/modules/if_lagg/../../net/if_lagg.c", >> line=825) >> at /usr/home/alans/freebsd/head/sys/kern/kern_rmlock.c:659 >> #13 0xffffffff81c19f62 in lagg_port_ioctl (ifp=0xfffff8000590d800, >> cmd=, data=0xfffff80005582c00 "tap0") >> at /usr/home/alans/freebsd/head/sys/modules/if_lagg/../../net/if_lagg.c:825 >> #14 0xffffffff809ae407 in ifioctl (so=, cmd=3225971084, >> data=0xfffff80005582c00 "tap0", td=) >> at /usr/home/alans/freebsd/head/sys/net/if.c:2643 >> #15 0xffffffff8093b9fb in kern_ioctl (td=, >> fd=, com=) at file.h:323 >> #16 0xffffffff8093b77c in sys_ioctl (td=0xfffff800053cc000, >> uap=0xfffffe0097751b80) >> at /usr/home/alans/freebsd/head/sys/kern/sys_generic.c:702 >> > From owner-svn-src-head@FreeBSD.ORG Fri May 2 21:34:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C794B80F; Fri, 2 May 2014 21:34:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B53331D8C; Fri, 2 May 2014 21:34:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s42LYHU7066854; Fri, 2 May 2014 21:34:17 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42LYHxV066853; Fri, 2 May 2014 21:34:17 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405022134.s42LYHxV066853@svn.freebsd.org> From: Christian Brueffer Date: Fri, 2 May 2014 21:34:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265244 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 21:34:17 -0000 Author: brueffer Date: Fri May 2 21:34:17 2014 New Revision: 265244 URL: http://svnweb.freebsd.org/changeset/base/265244 Log: Free resources in an error case. CID: 1018947 Found with: Coverity Prevent(tm) MFC after: 1 week Modified: head/sys/kern/kern_cpu.c Modified: head/sys/kern/kern_cpu.c ============================================================================== --- head/sys/kern/kern_cpu.c Fri May 2 21:30:59 2014 (r265243) +++ head/sys/kern/kern_cpu.c Fri May 2 21:34:17 2014 (r265244) @@ -1037,6 +1037,7 @@ cpufreq_unregister(device_t dev) if (cf_dev == NULL) { device_printf(dev, "warning: cpufreq_unregister called with no cpufreq device active\n"); + free(devs, M_TEMP); return (0); } cfcount = 0; From owner-svn-src-head@FreeBSD.ORG Fri May 2 21:41:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E86CFBA4; Fri, 2 May 2014 21:41:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D67181E79; Fri, 2 May 2014 21:41:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s42LfZVd070716; Fri, 2 May 2014 21:41:35 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42LfZqI070715; Fri, 2 May 2014 21:41:35 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201405022141.s42LfZqI070715@svn.freebsd.org> From: Mateusz Guzik Date: Fri, 2 May 2014 21:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265245 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 21:41:36 -0000 Author: mjg Date: Fri May 2 21:41:35 2014 New Revision: 265245 URL: http://svnweb.freebsd.org/changeset/base/265245 Log: Fix typo in KF_FD_TYPE_TRACE comment: ptrace -> ktrace Modified: head/sys/sys/user.h Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Fri May 2 21:34:17 2014 (r265244) +++ head/sys/sys/user.h Fri May 2 21:41:35 2014 (r265245) @@ -271,7 +271,7 @@ struct user { #define KF_FD_TYPE_CWD -1 /* Current working directory */ #define KF_FD_TYPE_ROOT -2 /* Root directory */ #define KF_FD_TYPE_JAIL -3 /* Jail directory */ -#define KF_FD_TYPE_TRACE -4 /* ptrace vnode */ +#define KF_FD_TYPE_TRACE -4 /* Ktrace vnode */ #define KF_FD_TYPE_TEXT -5 /* Text vnode */ #define KF_FD_TYPE_CTTY -6 /* Controlling terminal */ From owner-svn-src-head@FreeBSD.ORG Fri May 2 21:46:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B04BF70; Fri, 2 May 2014 21:46:05 +0000 (UTC) Received: from mail-qa0-x22c.google.com (mail-qa0-x22c.google.com [IPv6:2607:f8b0:400d:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79D011FC3; Fri, 2 May 2014 21:46:04 +0000 (UTC) Received: by mail-qa0-f44.google.com with SMTP id k15so4932011qaq.3 for ; Fri, 02 May 2014 14:46:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=DQVkfPfAH8DnrVHEki+UTPcJr5bF/RCpncAA7Xo+nJU=; b=Vjnf1Mcnc9z7iQNLn7+z4j4fExTEXa1f4GvJLEaTMpnuCyNW8673CfRxO8b9v4BlQv xjEQtcXy6y3bq2y3oMoFHbz69VINilG1WCwt+9re3OTsbQXPh1ttOUIBD3M2S5rS9qwl mvAcbq93wUPeqNgOW1Lw2F0PWQwUtxQ9e3Gu4u5SUCUaXkVjxQuJFRFTLGhqei7reT0E 6PXsCcGzxTIfu86qB9cwlQN5NzLepcAZEbX7/vYTGFv/06NAL4F6N1nf+pu1Mfu1HX50 C4DJztnoXEeqtjwY9SI7anPVMexL5aQSkzJXSRDEvT3+qJQarwEd54e2dmwXcPKIYfBW 24dA== MIME-Version: 1.0 X-Received: by 10.224.38.138 with SMTP id b10mr26042231qae.98.1399067163699; Fri, 02 May 2014 14:46:03 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.191.201 with HTTP; Fri, 2 May 2014 14:46:03 -0700 (PDT) In-Reply-To: <20140502190230.GA10412@dchagin.static.corbina.net> References: <201309181756.r8IHu4qV052882@svn.freebsd.org> <20140502190230.GA10412@dchagin.static.corbina.net> Date: Fri, 2 May 2014 14:46:03 -0700 X-Google-Sender-Auth: t0ImW0cReqfvdsVrdT6Q3d54JKI Message-ID: Subject: Re: svn commit: r255672 - in head/sys: amd64/linux32 compat/linux conf i386/linux kern modules/linux sys From: Adrian Chadd To: Chagin Dmitry , John-Mark Gurney Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , Roman Divacky , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 21:46:05 -0000 Well, have a chat with jmg and see if it can just be extended this way. Allocating another 8 bytes each time is a waste of memory bandwidth and allocator CPU cycles. :-) (Great work though! I'm glad this finally got shepharded into the tree!) -a On 2 May 2014 12:02, Chagin Dmitry wrote: > On Fri, May 02, 2014 at 11:49:29AM -0700, Adrian Chadd wrote: >> Hi, >> >> why not just extend the kqueue data fields to 64 bits and leave the >> freebsd API only copy 32 bits in? >> >> >> > > well, this is the first that comes to mind. > > > -- > Have fun! > chd From owner-svn-src-head@FreeBSD.ORG Fri May 2 21:55:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 449014F4; Fri, 2 May 2014 21:55:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3279410CA; Fri, 2 May 2014 21:55:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s42LtAac075261; Fri, 2 May 2014 21:55:10 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42LtAnC075260; Fri, 2 May 2014 21:55:10 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201405022155.s42LtAnC075260@svn.freebsd.org> From: Mateusz Guzik Date: Fri, 2 May 2014 21:55:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265247 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 21:55:10 -0000 Author: mjg Date: Fri May 2 21:55:09 2014 New Revision: 265247 URL: http://svnweb.freebsd.org/changeset/base/265247 Log: Request a non-exiting process in sysctl_kern_proc_{o,}filedesc This fixes a race with exit1 freeing p_textvp. Suggested by: kib MFC after: 1 week Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri May 2 21:54:36 2014 (r265246) +++ head/sys/kern/kern_descrip.c Fri May 2 21:55:09 2014 (r265247) @@ -3010,7 +3010,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE struct tty *tp; name = (int *)arg1; - error = pget((pid_t)name[0], PGET_CANDEBUG, &p); + error = pget((pid_t)name[0], PGET_CANDEBUG | PGET_NOTWEXIT, &p); if (error != 0) return (error); fdp = fdhold(p); @@ -3503,7 +3503,7 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER name = (int *)arg1; sbuf_new_for_sysctl(&sb, NULL, FILEDESC_SBUF_SIZE, req); - error = pget((pid_t)name[0], PGET_CANDEBUG, &p); + error = pget((pid_t)name[0], PGET_CANDEBUG | PGET_NOTWEXIT, &p); if (error != 0) { sbuf_delete(&sb); return (error); From owner-svn-src-head@FreeBSD.ORG Fri May 2 23:23:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89967822; Fri, 2 May 2014 23:23:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A37D179F; Fri, 2 May 2014 23:23:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s42NNJKh012691; Fri, 2 May 2014 23:23:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42NNIpT012682; Fri, 2 May 2014 23:23:18 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201405022323.s42NNIpT012682@svn.freebsd.org> From: Marius Strobl Date: Fri, 2 May 2014 23:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265248 - in head: sbin/gvinum sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 23:23:19 -0000 Author: marius Date: Fri May 2 23:23:18 2014 New Revision: 265248 URL: http://svnweb.freebsd.org/changeset/base/265248 Log: Allow GEOM_VINUM to be statically compiled into the kernel. Submitted by: gleb MFC after: 3 days Modified: head/sbin/gvinum/gvinum.c head/sbin/gvinum/gvinum.h head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options Modified: head/sbin/gvinum/gvinum.c ============================================================================== --- head/sbin/gvinum/gvinum.c Fri May 2 21:55:09 2014 (r265247) +++ head/sbin/gvinum/gvinum.c Fri May 2 23:23:18 2014 (r265248) @@ -95,8 +95,10 @@ main(int argc, char **argv) char buffer[BUFSIZ], *inputline, *token[GV_MAXARGS]; /* Load the module if necessary. */ - if (kldfind(GVINUMMOD) < 0 && kldload(GVINUMMOD) < 0) - err(1, GVINUMMOD ": Kernel module not available"); + if (modfind(GVINUMMOD) < 0) { + if (kldload(GVINUMKLD) < 0 && modfind(GVINUMMOD) < 0) + err(1, GVINUMKLD ": Kernel module not available"); + } /* Arguments given on the command line. */ if (argc > 1) { @@ -1207,9 +1209,10 @@ gvinum_stop(int argc, char **argv) { int err, fileid; - fileid = kldfind(GVINUMMOD); + fileid = kldfind(GVINUMKLD); if (fileid == -1) { - warn("cannot find " GVINUMMOD); + if (modfind(GVINUMMOD) < 0) + warn("cannot find " GVINUMKLD); return; } @@ -1219,7 +1222,7 @@ gvinum_stop(int argc, char **argv) * event thread will be free for the g_wither_geom() call from * gv_unload(). It's silly, but it works. */ - printf("unloading " GVINUMMOD " kernel module... "); + printf("unloading " GVINUMKLD " kernel module... "); fflush(stdout); if ((err = kldunload(fileid)) != 0 && (errno == EAGAIN)) { sleep(1); @@ -1227,7 +1230,7 @@ gvinum_stop(int argc, char **argv) } if (err != 0) { printf(" failed!\n"); - warn("cannot unload " GVINUMMOD); + warn("cannot unload " GVINUMKLD); return; } Modified: head/sbin/gvinum/gvinum.h ============================================================================== --- head/sbin/gvinum/gvinum.h Fri May 2 21:55:09 2014 (r265247) +++ head/sbin/gvinum/gvinum.h Fri May 2 23:23:18 2014 (r265248) @@ -36,4 +36,5 @@ /* $FreeBSD$ */ -#define GVINUMMOD "geom_vinum" +#define GVINUMMOD "g_vinum" +#define GVINUMKLD "geom_vinum" Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri May 2 21:55:09 2014 (r265247) +++ head/sys/conf/NOTES Fri May 2 23:23:18 2014 (r265248) @@ -176,6 +176,7 @@ options GEOM_SHSEC # Shared secret. options GEOM_STRIPE # Disk striping. options GEOM_SUNLABEL # Sun/Solaris partitioning options GEOM_UZIP # Read-only compressed disks +options GEOM_VINUM # Vinum logical volume manager options GEOM_VIRSTOR # Virtual storage. options GEOM_VOL # Volume names from UFS superblock options GEOM_ZERO # Performance testing helper. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 2 21:55:09 2014 (r265247) +++ head/sys/conf/files Fri May 2 23:23:18 2014 (r265248) @@ -2770,6 +2770,21 @@ contrib/xz-embedded/linux/lib/xz/xz_dec_ optional xz_embedded | geom_uncompress \ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" geom/uzip/g_uzip.c optional geom_uzip +geom/vinum/geom_vinum.c optional geom_vinum +geom/vinum/geom_vinum_create.c optional geom_vinum +geom/vinum/geom_vinum_drive.c optional geom_vinum +geom/vinum/geom_vinum_plex.c optional geom_vinum +geom/vinum/geom_vinum_volume.c optional geom_vinum +geom/vinum/geom_vinum_subr.c optional geom_vinum +geom/vinum/geom_vinum_raid5.c optional geom_vinum +geom/vinum/geom_vinum_share.c optional geom_vinum +geom/vinum/geom_vinum_list.c optional geom_vinum +geom/vinum/geom_vinum_rm.c optional geom_vinum +geom/vinum/geom_vinum_init.c optional geom_vinum +geom/vinum/geom_vinum_state.c optional geom_vinum +geom/vinum/geom_vinum_rename.c optional geom_vinum +geom/vinum/geom_vinum_move.c optional geom_vinum +geom/vinum/geom_vinum_events.c optional geom_vinum geom/virstor/binstream.c optional geom_virstor geom/virstor/g_virstor.c optional geom_virstor geom/virstor/g_virstor_md.c optional geom_virstor Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri May 2 21:55:09 2014 (r265247) +++ head/sys/conf/options Fri May 2 23:23:18 2014 (r265248) @@ -125,6 +125,7 @@ GEOM_STRIPE opt_geom.h GEOM_SUNLABEL opt_geom.h GEOM_UNCOMPRESS opt_geom.h GEOM_UZIP opt_geom.h +GEOM_VINUM opt_geom.h GEOM_VIRSTOR opt_geom.h GEOM_VOL opt_geom.h GEOM_ZERO opt_geom.h From owner-svn-src-head@FreeBSD.ORG Fri May 2 23:30:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD6BC9FD; Fri, 2 May 2014 23:30:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A4901852; Fri, 2 May 2014 23:30:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s42NUeql013898; Fri, 2 May 2014 23:30:40 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42NUdCQ013893; Fri, 2 May 2014 23:30:39 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201405022330.s42NUdCQ013893@svn.freebsd.org> From: Bryan Drewery Date: Fri, 2 May 2014 23:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265249 - in head: contrib/top usr.bin/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 23:30:40 -0000 Author: bdrewery Date: Fri May 2 23:30:39 2014 New Revision: 265249 URL: http://svnweb.freebsd.org/changeset/base/265249 Log: Add -J command/flag to filter by jail name/jid. This will automatically display the JID as well (the -j command/flag). 0 displays host. + displays all. MFC after: 2 weeks Relnotes: yes Modified: head/contrib/top/machine.h head/contrib/top/top.X head/contrib/top/top.c head/usr.bin/top/Makefile head/usr.bin/top/machine.c Modified: head/contrib/top/machine.h ============================================================================== --- head/contrib/top/machine.h Fri May 2 23:23:18 2014 (r265248) +++ head/contrib/top/machine.h Fri May 2 23:30:39 2014 (r265249) @@ -66,6 +66,7 @@ struct process_select int thread; /* show threads */ int uid; /* only this uid (unless uid == -1) */ int wcpu; /* show weighted cpu */ + int jid; /* only this jid (unless jid == -1) */ int jail; /* show jail ID */ int kidle; /* show per-CPU idle threads */ char *command; /* only this command (unless == NULL) */ Modified: head/contrib/top/top.X ============================================================================== --- head/contrib/top/top.X Fri May 2 23:23:18 2014 (r265248) +++ head/contrib/top/top.X Fri May 2 23:30:39 2014 (r265249) @@ -20,6 +20,8 @@ top \- display and update information ab ] [ .BI \-s time ] [ +.BI \-J jail +] [ .BI \-U username ] [ .I number @@ -171,6 +173,21 @@ values are \*(lqcpu\*(rq, \*(lqsize\*(rq but may vary on different operating systems. Note that not all operating systems support this option. .TP +.BI \-J jail +Show only those processes owned by +.IR jail . +This may be either the +.B jid +or +.B name +of the jail. +Use +.B 0 +to limit to host processes. +Using this option implies the +.B \-j +flag. +.PP .BI \-U username Show only those processes owned by .IR username . @@ -315,6 +332,12 @@ Toggle the display of .IR jail (8) ID. .TP +.B J +Display only processes owned by a specific jail (prompt for jail). +If the jail specified is simply \*(lq+\*(rq, then processes belonging +to all jails and the host will be displayed. +This will also enable the display of JID. +.TP .B P Toggle the display of per-CPU statistics. .TP Modified: head/contrib/top/top.c ============================================================================== --- head/contrib/top/top.c Fri May 2 23:23:18 2014 (r265248) +++ head/contrib/top/top.c Fri May 2 23:30:39 2014 (r265249) @@ -38,7 +38,9 @@ char *copyright = #include #include #include +#include #include +#include /* includes specific to top */ #include "display.h" /* interface to display package */ @@ -198,9 +200,9 @@ char *argv[]; fd_set readfds; #ifdef ORDER - static char command_chars[] = "\f qh?en#sdkriIutHmSCajzPo"; + static char command_chars[] = "\f qh?en#sdkriIutHmSCajzPJo"; #else - static char command_chars[] = "\f qh?en#sdkriIutHmSCajzP"; + static char command_chars[] = "\f qh?en#sdkriIutHmSCajzPJ"; #endif /* these defines enumerate the "strchr"s of the commands in command_chars */ #define CMD_redraw 0 @@ -228,8 +230,9 @@ char *argv[]; #define CMD_jidtog 21 #define CMD_kidletog 22 #define CMD_pcputog 23 +#define CMD_jail 24 #ifdef ORDER -#define CMD_order 24 +#define CMD_order 25 #endif /* set the buffer for stdout */ @@ -261,6 +264,7 @@ char *argv[]; ps.uid = -1; ps.thread = No; ps.wcpu = 1; + ps.jid = -1; ps.jail = No; ps.kidle = Yes; ps.command = NULL; @@ -288,7 +292,7 @@ char *argv[]; optind = 1; } - while ((i = getopt(ac, av, "CSIHPabijnquvzs:d:U:m:o:t")) != EOF) + while ((i = getopt(ac, av, "CSIHPabijJ:nquvzs:d:U:m:o:t")) != EOF) { switch(i) { @@ -413,6 +417,15 @@ char *argv[]; ps.jail = !ps.jail; break; + case 'J': /* display only jail's processes */ + if ((ps.jid = jail_getid(optarg)) == -1) + { + fprintf(stderr, "%s: unknown jail\n", optarg); + exit(1); + } + ps.jail = 1; + break; + case 'P': pcpu_stats = !pcpu_stats; break; @@ -425,7 +438,7 @@ char *argv[]; fprintf(stderr, "Top version %s\n" "Usage: %s [-abCHIijnPqStuvz] [-d count] [-m io | cpu] [-o field] [-s time]\n" -" [-U username] [number]\n", +" [-J jail] [-U username] [number]\n", version_string(), myname); exit(1); } @@ -1085,6 +1098,44 @@ restart: reset_display(); putchar('\r'); break; + + case CMD_jail: + new_message(MT_standout, + "Jail to show: "); + if (readline(tempbuf2, sizeof(tempbuf2), No) > 0) + { + if (tempbuf2[0] == '+' && + tempbuf2[1] == '\0') + { + ps.jid = -1; + } + else if ((i = jail_getid(tempbuf2)) == -1) + { + new_message(MT_standout, + " %s: unknown jail", tempbuf2); + no_command = Yes; + } + else + { + ps.jid = i; + } + if (ps.jail == 0) { + ps.jail = 1; + new_message(MT_standout | + MT_delayed, " Displaying jail " + "ID."); + header_text = + format_header(uname_field); + reset_display(); + } + putchar('\r'); + } + else + { + clear_message(); + } + break; + case CMD_kidletog: ps.kidle = !ps.kidle; new_message(MT_standout | MT_delayed, Modified: head/usr.bin/top/Makefile ============================================================================== --- head/usr.bin/top/Makefile Fri May 2 23:23:18 2014 (r265248) +++ head/usr.bin/top/Makefile Fri May 2 23:30:39 2014 (r265249) @@ -21,8 +21,8 @@ WARNS?= 0 CFLAGS+= -D"Table_size=${TOP_TABLE_SIZE}" .endif -DPADD= ${LIBTERMCAP} ${LIBM} ${LIBKVM} -LDADD= -ltermcap -lm -lkvm +DPADD= ${LIBTERMCAP} ${LIBM} ${LIBKVM} ${LIBJAIL} +LDADD= -ltermcap -lm -lkvm -ljail CLEANFILES= sigdesc.h SIGCONV_AWK= ${.CURDIR}/../../contrib/top/sigconv.awk Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Fri May 2 23:23:18 2014 (r265248) +++ head/usr.bin/top/machine.c Fri May 2 23:30:39 2014 (r265249) @@ -668,6 +668,7 @@ get_process_info(struct system_info *si, /* these are copied out of sel for speed */ int show_idle; + int show_jid; int show_self; int show_system; int show_uid; @@ -710,6 +711,7 @@ get_process_info(struct system_info *si, /* set up flags which define what we are going to select */ show_idle = sel->idle; + show_jid = sel->jid != -1; show_self = sel->self == -1; show_system = sel->system; show_uid = sel->uid != -1; @@ -764,6 +766,10 @@ get_process_info(struct system_info *si, /* skip processes that aren't doing I/O */ continue; + if (show_jid && pp->ki_jid != sel->jid) + /* skip proc. that don't belong to the selected JID */ + continue; + if (show_uid && pp->ki_ruid != (uid_t)sel->uid) /* skip proc. that don't belong to the selected UID */ continue; From owner-svn-src-head@FreeBSD.ORG Fri May 2 23:32:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A28AB53; Fri, 2 May 2014 23:32:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47CD61868; Fri, 2 May 2014 23:32:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s42NWjsI016670; Fri, 2 May 2014 23:32:45 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42NWjUs016669; Fri, 2 May 2014 23:32:45 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201405022332.s42NWjUs016669@svn.freebsd.org> From: Bryan Drewery Date: Fri, 2 May 2014 23:32:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265250 - head/contrib/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 23:32:45 -0000 Author: bdrewery Date: Fri May 2 23:32:44 2014 New Revision: 265250 URL: http://svnweb.freebsd.org/changeset/base/265250 Log: - Add a hint for 'u' and 'J' command that '+' displays all. MFC after: 2 weeks Modified: head/contrib/top/top.c Modified: head/contrib/top/top.c ============================================================================== --- head/contrib/top/top.c Fri May 2 23:30:39 2014 (r265249) +++ head/contrib/top/top.c Fri May 2 23:32:44 2014 (r265250) @@ -1007,7 +1007,7 @@ restart: case CMD_user: new_message(MT_standout, - "Username to show: "); + "Username to show (+ for all): "); if (readline(tempbuf2, sizeof(tempbuf2), No) > 0) { if (tempbuf2[0] == '+' && @@ -1101,7 +1101,7 @@ restart: case CMD_jail: new_message(MT_standout, - "Jail to show: "); + "Jail to show (+ for all): "); if (readline(tempbuf2, sizeof(tempbuf2), No) > 0) { if (tempbuf2[0] == '+' && From owner-svn-src-head@FreeBSD.ORG Fri May 2 23:39:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DAC9AD64; Fri, 2 May 2014 23:39:22 +0000 (UTC) Received: from mail-qa0-x229.google.com (mail-qa0-x229.google.com [IPv6:2607:f8b0:400d:c00::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68974189A; Fri, 2 May 2014 23:39:22 +0000 (UTC) Received: by mail-qa0-f41.google.com with SMTP id dc16so3236345qab.28 for ; Fri, 02 May 2014 16:39:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=YZSKU+trSWmBHFHWV9BWqiQ0rHSGdOhJ+c8EnTDi6DQ=; b=qyAqpurQEfX8M2UqmkYIRuz6ZRrGsyV0S48BEhN3UIr8pmJ3qCvYXYVG4+vf63DOWf aDpnTRpHKcqxmGUE8NrtYy2kW10MQutTVBRUV5Mn9OyOP/unlB22GKVjE+9CgtO9AOfQ w37MBY13VzeuGJRImgJ7zIzrkAX8I53oADZWhbEaL/Qsx5UEhvTKIuz0wN4Lsj2VQgSP g18IqbYHD23ImF63fjJySP0tqOJxN5ujUJpPwTjoNcs/+CclprHBhdeYFmY059+5X4xV X7aY5yPXFo8pE0x5G7ynGF19HnMWD1HWRZPrV5dxzUZOlfLXwPUO6zHsRSVh1zN/9mM2 pD3g== MIME-Version: 1.0 X-Received: by 10.140.95.80 with SMTP id h74mr24958193qge.2.1399073961004; Fri, 02 May 2014 16:39:21 -0700 (PDT) Sender: chmeeedalf@gmail.com Received: by 10.140.19.107 with HTTP; Fri, 2 May 2014 16:39:20 -0700 (PDT) In-Reply-To: <201405022332.s42NWjUs016669@svn.freebsd.org> References: <201405022332.s42NWjUs016669@svn.freebsd.org> Date: Fri, 2 May 2014 16:39:20 -0700 X-Google-Sender-Auth: MAgr6TzbUKPQMKTWb0Y1CfxrUBs Message-ID: Subject: Re: svn commit: r265250 - head/contrib/top From: Justin Hibbits To: Bryan Drewery Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 23:39:22 -0000 On Fri, May 2, 2014 at 4:32 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Fri May 2 23:32:44 2014 > New Revision: 265250 > URL: http://svnweb.freebsd.org/changeset/base/265250 > > Log: > - Add a hint for 'u' and 'J' command that '+' displays all. > Thanks! I keep forgetting about '+'. - Justin From owner-svn-src-head@FreeBSD.ORG Fri May 2 23:40:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C329BED1 for ; Fri, 2 May 2014 23:40:21 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A8D618A4 for ; Fri, 2 May 2014 23:40:21 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s42NeLLq019816 for ; Fri, 2 May 2014 23:40:21 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s42NeLls019811 for svn-src-head@freebsd.org; Fri, 2 May 2014 23:40:21 GMT (envelope-from bdrewery) Received: (qmail 84152 invoked from network); 2 May 2014 18:40:18 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 2 May 2014 18:40:18 -0500 Message-ID: <53642CB4.3010502@FreeBSD.org> Date: Fri, 02 May 2014 18:39:32 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Justin Hibbits Subject: Re: svn commit: r265250 - head/contrib/top References: <201405022332.s42NWjUs016669@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.6 OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="P4j3huP9JjRw7siQjEBCBxHmFInnNk6oM" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 23:40:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --P4j3huP9JjRw7siQjEBCBxHmFInnNk6oM Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 5/2/2014 6:39 PM, Justin Hibbits wrote: > On Fri, May 2, 2014 at 4:32 PM, Bryan Drewery wr= ote: >> Author: bdrewery >> Date: Fri May 2 23:32:44 2014 >> New Revision: 265250 >> URL: http://svnweb.freebsd.org/changeset/base/265250 >> >> Log: >> - Add a hint for 'u' and 'J' command that '+' displays all. >> >=20 > Thanks! I keep forgetting about '+'. >=20 > - Justin >=20 I had no idea about it! --=20 Regards, Bryan Drewery --P4j3huP9JjRw7siQjEBCBxHmFInnNk6oM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJTZCy4AAoJEDXXcbtuRpfPxXUH+wXXU9Rw8TjROW7X5FPqZXKk h1d3z/97Fsl7Mx6c0WSxER40IMoLQJO3Q7uLsvoo9spFiRw1nDPlwQCmA2C9/PZ0 SY5ZApHdO0uVUId5oapo20ZFd6GN/HbjPBGJodT7yVpvV5HFJhH8sZ8t9NeSq4Fz wKTony1sREb7OrQmEcsa5sPTo3IbhABSG0bpaS0lqjC/9jsBxsx66N8hXnmGuwJr +8TPWUm1Nw58Qk6ig5S9jRSkjeAakK9dXTj4AOPII7hl70ZT+77ssyMIbiUBY63o yj3GmroX2Y+i/nujJ48/UpAUwVArp2frv0u94wcySTW8RblNLHRMOySrsfkWvek= =dmKT -----END PGP SIGNATURE----- --P4j3huP9JjRw7siQjEBCBxHmFInnNk6oM-- From owner-svn-src-head@FreeBSD.ORG Fri May 2 23:47:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 483C21C6; Fri, 2 May 2014 23:47:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35A9A1949; Fri, 2 May 2014 23:47:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s42NlFmi021355; Fri, 2 May 2014 23:47:15 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s42NlFte021354; Fri, 2 May 2014 23:47:15 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201405022347.s42NlFte021354@svn.freebsd.org> From: Bryan Drewery Date: Fri, 2 May 2014 23:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265251 - head/contrib/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 23:47:15 -0000 Author: bdrewery Date: Fri May 2 23:47:14 2014 New Revision: 265251 URL: http://svnweb.freebsd.org/changeset/base/265251 Log: - Add J command to help. MFC after: 2 weeks X-MFC-with: r265249 Modified: head/contrib/top/commands.c Modified: head/contrib/top/commands.c ============================================================================== --- head/contrib/top/commands.c Fri May 2 23:32:44 2014 (r265250) +++ head/contrib/top/commands.c Fri May 2 23:47:14 2014 (r265251) @@ -74,6 +74,7 @@ e - list errors generated by last H - toggle the displaying of threads\n\ i or I - toggle the displaying of idle processes\n\ j - toggle the displaying of jail ID\n\ +J - display processes for only one jail (+ selects all jails)\n\ k - kill processes; send a signal to a list of processes\n\ m - toggle the display between 'cpu' and 'io' modes\n\ n or # - change number of processes to display\n", stdout); From owner-svn-src-head@FreeBSD.ORG Sat May 3 00:13:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E9CF4D5; Sat, 3 May 2014 00:13:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BC2C1B40; Sat, 3 May 2014 00:13:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s430DjeW034426; Sat, 3 May 2014 00:13:45 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s430DjDp034424; Sat, 3 May 2014 00:13:45 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201405030013.s430DjDp034424@svn.freebsd.org> From: Rick Macklem Date: Sat, 3 May 2014 00:13:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265252 - in head/sys/fs: nfs nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 00:13:46 -0000 Author: rmacklem Date: Sat May 3 00:13:45 2014 New Revision: 265252 URL: http://svnweb.freebsd.org/changeset/base/265252 Log: The new draft specification for NFSv4.0 specifies that a server should either accept owner and owner_group strings that are just the digits of the uid/gid or return NFS4ERR_BADOWNER. This patch adds a sysctl vfs.nfsd.enable_stringtouid, which can be set to enable the server w.r.t. accepting numeric string. It also ensures that NFS4ERR_BADOWNER is returned if numeric uid/gid strings are not enabled. This fixes the server for recent Linux nfs4 clients that use numeric uid/gid strings by default. Reported and tested by: craigyk@gmail.com MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Fri May 2 23:47:14 2014 (r265251) +++ head/sys/fs/nfs/nfs_commonsubs.c Sat May 3 00:13:45 2014 (r265252) @@ -65,6 +65,7 @@ uid_t nfsrv_defaultuid; gid_t nfsrv_defaultgid; int nfsrv_lease = NFSRV_LEASE; int ncl_mbuf_mlen = MLEN; +int nfsd_enable_stringtouid = 0; NFSNAMEIDMUTEX; NFSSOCKMUTEX; @@ -2640,9 +2641,14 @@ nfsv4_strtouid(struct nfsrv_descript *nd /* If a string of digits and an AUTH_SYS mount, just convert it. */ str0 = str; tuid = (uid_t)strtoul(str0, &endstr, 10); - if ((endstr - str0) == len && - (nd->nd_flag & (ND_KERBV | ND_NFSCL)) == ND_NFSCL) { - *uidp = tuid; + if ((endstr - str0) == len) { + /* A numeric string. */ + if ((nd->nd_flag & ND_KERBV) == 0 && + ((nd->nd_flag & ND_NFSCL) != 0 || + nfsd_enable_stringtouid != 0)) + *uidp = tuid; + else + error = NFSERR_BADOWNER; goto out; } /* @@ -2845,9 +2851,14 @@ nfsv4_strtogid(struct nfsrv_descript *nd /* If a string of digits and an AUTH_SYS mount, just convert it. */ str0 = str; tgid = (gid_t)strtoul(str0, &endstr, 10); - if ((endstr - str0) == len && - (nd->nd_flag & (ND_KERBV | ND_NFSCL)) == ND_NFSCL) { - *gidp = tgid; + if ((endstr - str0) == len) { + /* A numeric string. */ + if ((nd->nd_flag & ND_KERBV) == 0 && + ((nd->nd_flag & ND_NFSCL) != 0 || + nfsd_enable_stringtouid != 0)) + *gidp = tgid; + else + error = NFSERR_BADOWNER; goto out; } /* Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Fri May 2 23:47:14 2014 (r265251) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Sat May 3 00:13:45 2014 (r265252) @@ -80,6 +80,7 @@ static int nfs_commit_blks; static int nfs_commit_miss; extern int nfsrv_issuedelegs; extern int nfsrv_dolocallocks; +extern int nfsd_enable_stringtouid; SYSCTL_NODE(_vfs, OID_AUTO, nfsd, CTLFLAG_RW, 0, "New NFS server"); SYSCTL_INT(_vfs_nfsd, OID_AUTO, mirrormnt, CTLFLAG_RW, @@ -92,6 +93,8 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, issue_de &nfsrv_issuedelegs, 0, "Enable nfsd to issue delegations"); SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_locallocks, CTLFLAG_RW, &nfsrv_dolocallocks, 0, "Enable nfsd to acquire local locks on files"); +SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_stringtouid, CTLFLAG_RW, + &nfsd_enable_stringtouid, 0, "Enable nfsd to accept numeric owner_names"); #define MAX_REORDERED_RPC 16 #define NUM_HEURISTIC 1031 From owner-svn-src-head@FreeBSD.ORG Sat May 3 00:19:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0CC6E720; Sat, 3 May 2014 00:19:10 +0000 (UTC) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id 8FEAB1B78; Sat, 3 May 2014 00:19:09 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmUGADcSY1ODaFve/2dsb2JhbABag1VMC4JnwXOBKXSCJQEBBAEjBFIFFg4GBAICDRkCIzYGE4gtAwkIDaYGnSkNhkUXgSqLEYFjATMHgm+BSgSXPYMui1iFW4NPIYFu X-IronPort-AV: E=Sophos;i="4.97,975,1389762000"; d="scan'208";a="120090152" Received: from muskoka.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.222]) by esa-jnhn.mail.uoguelph.ca with ESMTP; 02 May 2014 20:19:08 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id D748FB4032; Fri, 2 May 2014 20:19:07 -0400 (EDT) Date: Fri, 2 May 2014 20:19:07 -0400 (EDT) From: Rick Macklem To: Rick Macklem Message-ID: <1749211976.1376200.1399076347872.JavaMail.root@uoguelph.ca> In-Reply-To: <201405030013.s430DjDp034424@svn.freebsd.org> Subject: Re: svn commit: r265252 - in head/sys/fs: nfs nfsserver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.203] X-Mailer: Zimbra 7.2.1_GA_2790 (ZimbraWebClient - FF3.0 (Win)/7.2.1_GA_2790) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 00:19:10 -0000 I wrote: > Author: rmacklem > Date: Sat May 3 00:13:45 2014 > New Revision: 265252 > URL: http://svnweb.freebsd.org/changeset/base/265252 > > Log: > The new draft specification for NFSv4.0 specifies that a server > should either accept owner and owner_group strings that are just > the digits of the uid/gid or return NFS4ERR_BADOWNER. > This patch adds a sysctl vfs.nfsd.enable_stringtouid, which can > be set to enable the server w.r.t. accepting numeric string. It > also ensures that NFS4ERR_BADOWNER is returned if numeric uid/gid > strings are not enabled. This fixes the server for recent Linux > nfs4 clients that use numeric uid/gid strings by default. > > Reported and tested by: craigyk@gmail.com > MFC after: 2 weeks > Oops, I meant to MFC in 1 week, since I'd like to get this in 9.3. rick > Modified: > head/sys/fs/nfs/nfs_commonsubs.c > head/sys/fs/nfsserver/nfs_nfsdport.c > > Modified: head/sys/fs/nfs/nfs_commonsubs.c > ============================================================================== > --- head/sys/fs/nfs/nfs_commonsubs.c Fri May 2 23:47:14 2014 > (r265251) > +++ head/sys/fs/nfs/nfs_commonsubs.c Sat May 3 00:13:45 2014 > (r265252) > @@ -65,6 +65,7 @@ uid_t nfsrv_defaultuid; > gid_t nfsrv_defaultgid; > int nfsrv_lease = NFSRV_LEASE; > int ncl_mbuf_mlen = MLEN; > +int nfsd_enable_stringtouid = 0; > NFSNAMEIDMUTEX; > NFSSOCKMUTEX; > > @@ -2640,9 +2641,14 @@ nfsv4_strtouid(struct nfsrv_descript *nd > /* If a string of digits and an AUTH_SYS mount, just convert it. */ > str0 = str; > tuid = (uid_t)strtoul(str0, &endstr, 10); > - if ((endstr - str0) == len && > - (nd->nd_flag & (ND_KERBV | ND_NFSCL)) == ND_NFSCL) { > - *uidp = tuid; > + if ((endstr - str0) == len) { > + /* A numeric string. */ > + if ((nd->nd_flag & ND_KERBV) == 0 && > + ((nd->nd_flag & ND_NFSCL) != 0 || > + nfsd_enable_stringtouid != 0)) > + *uidp = tuid; > + else > + error = NFSERR_BADOWNER; > goto out; > } > /* > @@ -2845,9 +2851,14 @@ nfsv4_strtogid(struct nfsrv_descript *nd > /* If a string of digits and an AUTH_SYS mount, just convert it. */ > str0 = str; > tgid = (gid_t)strtoul(str0, &endstr, 10); > - if ((endstr - str0) == len && > - (nd->nd_flag & (ND_KERBV | ND_NFSCL)) == ND_NFSCL) { > - *gidp = tgid; > + if ((endstr - str0) == len) { > + /* A numeric string. */ > + if ((nd->nd_flag & ND_KERBV) == 0 && > + ((nd->nd_flag & ND_NFSCL) != 0 || > + nfsd_enable_stringtouid != 0)) > + *gidp = tgid; > + else > + error = NFSERR_BADOWNER; > goto out; > } > /* > > Modified: head/sys/fs/nfsserver/nfs_nfsdport.c > ============================================================================== > --- head/sys/fs/nfsserver/nfs_nfsdport.c Fri May 2 23:47:14 2014 > (r265251) > +++ head/sys/fs/nfsserver/nfs_nfsdport.c Sat May 3 00:13:45 2014 > (r265252) > @@ -80,6 +80,7 @@ static int nfs_commit_blks; > static int nfs_commit_miss; > extern int nfsrv_issuedelegs; > extern int nfsrv_dolocallocks; > +extern int nfsd_enable_stringtouid; > > SYSCTL_NODE(_vfs, OID_AUTO, nfsd, CTLFLAG_RW, 0, "New NFS server"); > SYSCTL_INT(_vfs_nfsd, OID_AUTO, mirrormnt, CTLFLAG_RW, > @@ -92,6 +93,8 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, issue_de > &nfsrv_issuedelegs, 0, "Enable nfsd to issue delegations"); > SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_locallocks, CTLFLAG_RW, > &nfsrv_dolocallocks, 0, "Enable nfsd to acquire local locks on > files"); > +SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_stringtouid, CTLFLAG_RW, > + &nfsd_enable_stringtouid, 0, "Enable nfsd to accept numeric > owner_names"); > > #define MAX_REORDERED_RPC 16 > #define NUM_HEURISTIC 1031 > > From owner-svn-src-head@FreeBSD.ORG Sat May 3 02:30:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67B31569; Sat, 3 May 2014 02:30:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54AE01538; Sat, 3 May 2014 02:30:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s432U2Xu088852; Sat, 3 May 2014 02:30:02 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s432U2dl088851; Sat, 3 May 2014 02:30:02 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201405030230.s432U2dl088851@svn.freebsd.org> From: Steven Hartland Date: Sat, 3 May 2014 02:30:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265253 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 02:30:02 -0000 Author: smh Date: Sat May 3 02:30:01 2014 New Revision: 265253 URL: http://svnweb.freebsd.org/changeset/base/265253 Log: Don't treat TRIM requests returning ENOTSUP as an unexpected error. MFC after: 1 month X-MFC-With: r265152 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sat May 3 00:13:45 2014 (r265252) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sat May 3 02:30:01 2014 (r265253) @@ -2674,7 +2674,10 @@ zio_vdev_io_done(zio_t **ziop) zio->io_error = zio_handle_label_injection(zio, EIO); if (zio->io_error) { - if (!vdev_accessible(vd, zio)) { + if (zio->io_error == ENOTSUP && + zio->io_type == ZIO_TYPE_FREE) { + /* Not all devices support TRIM. */ + } else if (!vdev_accessible(vd, zio)) { zio->io_error = SET_ERROR(ENXIO); } else { unexpected_error = B_TRUE; From owner-svn-src-head@FreeBSD.ORG Sat May 3 03:40:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AB787C9; Sat, 3 May 2014 03:40:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37D3A1B27; Sat, 3 May 2014 03:40:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s433ebIX020056; Sat, 3 May 2014 03:40:37 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s433ebDL020055; Sat, 3 May 2014 03:40:37 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405030340.s433ebDL020055@svn.freebsd.org> From: Luiz Otavio O Souza Date: Sat, 3 May 2014 03:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265254 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 03:40:37 -0000 Author: loos Date: Sat May 3 03:40:36 2014 New Revision: 265254 URL: http://svnweb.freebsd.org/changeset/base/265254 Log: Fix the tinderbox armv6/arm build failure. VYBRID code depends on FDT. Modified: head/sys/arm/conf/VYBRID Modified: head/sys/arm/conf/VYBRID ============================================================================== --- head/sys/arm/conf/VYBRID Sat May 3 02:30:01 2014 (r265253) +++ head/sys/arm/conf/VYBRID Sat May 3 03:40:36 2014 (r265254) @@ -147,3 +147,5 @@ device kbdmux options SC_DFLT_FONT # compile font in makeoptions SC_DFLT_FONT=cp437 device ukbd + +options FDT From owner-svn-src-head@FreeBSD.ORG Sat May 3 04:44:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3945D46F; Sat, 3 May 2014 04:44:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A8C31279; Sat, 3 May 2014 04:44:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s434i49e048929; Sat, 3 May 2014 04:44:04 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s434i4YV048925; Sat, 3 May 2014 04:44:04 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405030444.s434i4YV048925@svn.freebsd.org> From: Mark Johnston Date: Sat, 3 May 2014 04:44:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265255 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 04:44:05 -0000 Author: markj Date: Sat May 3 04:44:03 2014 New Revision: 265255 URL: http://svnweb.freebsd.org/changeset/base/265255 Log: Allow "a.out" as an alias for the executable if no other matching entries are found. This improves compatibility with Solaris' libproc and fixes a number of failing DTrace tests that rely on this feature. MFC after: 3 weeks Modified: head/lib/libproc/_libproc.h head/lib/libproc/proc_create.c head/lib/libproc/proc_rtld.c head/lib/libproc/proc_sym.c Modified: head/lib/libproc/_libproc.h ============================================================================== --- head/lib/libproc/_libproc.h Sat May 3 03:40:36 2014 (r265254) +++ head/lib/libproc/_libproc.h Sat May 3 04:44:03 2014 (r265255) @@ -46,6 +46,8 @@ struct proc_handle { size_t rdobjsz; size_t nobjs; struct lwpstatus lwps; + rd_loadobj_t *rdexec; /* rdobj index of program executable. */ + char execname[MAXPATHLEN]; /* Path to program executable. */ }; #ifdef DEBUG Modified: head/lib/libproc/proc_create.c ============================================================================== --- head/lib/libproc/proc_create.c Sat May 3 03:40:36 2014 (r265254) +++ head/lib/libproc/proc_create.c Sat May 3 04:44:03 2014 (r265255) @@ -26,8 +26,10 @@ * $FreeBSD$ */ -#include "_libproc.h" -#include +#include +#include +#include + #include #include #include @@ -35,7 +37,37 @@ #include #include #include -#include + +#include "_libproc.h" + +static int proc_init(pid_t, int, int, struct proc_handle *); + +static int +proc_init(pid_t pid, int flags, int status, struct proc_handle *phdl) +{ + int mib[4], error; + size_t len; + + memset(phdl, 0, sizeof(*phdl)); + phdl->pid = pid; + phdl->flags = flags; + phdl->status = status; + + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_PATHNAME; + mib[3] = pid; + len = sizeof(phdl->execname); + if (sysctl(mib, 4, phdl->execname, &len, NULL, 0) != 0) { + error = errno; + DPRINTF("ERROR: cannot get pathname for child process %d", pid); + return (error); + } + if (len == 0) + phdl->execname[0] = '\0'; + + return (0); +} int proc_attach(pid_t pid, int flags, struct proc_handle **pphdl) @@ -54,12 +86,12 @@ proc_attach(pid_t pid, int flags, struct if ((phdl = malloc(sizeof(struct proc_handle))) == NULL) return (ENOMEM); - memset(phdl, 0, sizeof(struct proc_handle)); - phdl->pid = pid; - phdl->flags = flags; - phdl->status = PS_RUN; elf_version(EV_CURRENT); + error = proc_init(pid, flags, PS_RUN, phdl); + if (error != 0) + goto out; + if (ptrace(PT_ATTACH, phdl->pid, 0, 0) != 0) { error = errno; DPRINTF("ERROR: cannot ptrace child process %d", pid); @@ -123,9 +155,9 @@ proc_create(const char *file, char * con _exit(2); } else { /* The parent owns the process handle. */ - memset(phdl, 0, sizeof(struct proc_handle)); - phdl->pid = pid; - phdl->status = PS_IDLE; + error = proc_init(pid, 0, PS_IDLE, phdl); + if (error != 0) + goto bad; /* Wait for the child process to stop. */ if (waitpid(pid, &status, WUNTRACED) == -1) { Modified: head/lib/libproc/proc_rtld.c ============================================================================== --- head/lib/libproc/proc_rtld.c Sat May 3 03:40:36 2014 (r265254) +++ head/lib/libproc/proc_rtld.c Sat May 3 04:44:03 2014 (r265255) @@ -49,6 +49,9 @@ map_iter(const rd_loadobj_t *lop, void * if (phdl->rdobjs == NULL) return (-1); } + if (strcmp(lop->rdl_path, phdl->execname) == 0 && + (lop->rdl_prot & RD_RDL_X) != 0) + phdl->rdexec = &phdl->rdobjs[phdl->nobjs]; memcpy(&phdl->rdobjs[phdl->nobjs++], lop, sizeof(*lop)); return (0); Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Sat May 3 03:40:36 2014 (r265254) +++ head/lib/libproc/proc_sym.c Sat May 3 04:44:03 2014 (r265255) @@ -112,17 +112,23 @@ proc_obj2map(struct proc_handle *p, cons rd_loadobj_t *rdl; char path[MAXPATHLEN]; + rdl = NULL; for (i = 0; i < p->nobjs; i++) { - rdl = &p->rdobjs[i]; - basename_r(rdl->rdl_path, path); + basename_r(p->rdobjs[i].rdl_path, path); if (strcmp(path, objname) == 0) { - if ((map = malloc(sizeof(*map))) == NULL) - return (NULL); - proc_rdl2prmap(rdl, map); - return (map); + rdl = &p->rdobjs[i]; + break; } } - return (NULL); + if (rdl == NULL && strcmp(objname, "a.out") == 0 && p->rdexec != NULL) + rdl = p->rdexec; + else + return (NULL); + + if ((map = malloc(sizeof(*map))) == NULL) + return (NULL); + proc_rdl2prmap(rdl, map); + return (map); } int @@ -386,8 +392,9 @@ proc_name2map(struct proc_handle *p, con free(kves); return (NULL); } - if (name == NULL || strcmp(name, "a.out") == 0) { - map = proc_addr2map(p, p->rdobjs[0].rdl_saddr); + if ((name == NULL || strcmp(name, "a.out") == 0) && + p->rdexec != NULL) { + map = proc_addr2map(p, p->rdexec->rdl_saddr); return (map); } for (i = 0; i < p->nobjs; i++) { From owner-svn-src-head@FreeBSD.ORG Sat May 3 08:52:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7CFDC2F; Sat, 3 May 2014 08:52:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D55C2161C; Sat, 3 May 2014 08:52:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s438qqnN053579; Sat, 3 May 2014 08:52:52 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s438qqCh053578; Sat, 3 May 2014 08:52:52 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201405030852.s438qqCh053578@svn.freebsd.org> From: Eitan Adler Date: Sat, 3 May 2014 08:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265256 - head/usr.bin/ssh-copy-id X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 08:52:53 -0000 Author: eadler Date: Sat May 3 08:52:52 2014 New Revision: 265256 URL: http://svnweb.freebsd.org/changeset/base/265256 Log: Fix syntax error with modern shells Submitted by: multiple Modified: head/usr.bin/ssh-copy-id/ssh-copy-id.sh Modified: head/usr.bin/ssh-copy-id/ssh-copy-id.sh ============================================================================== --- head/usr.bin/ssh-copy-id/ssh-copy-id.sh Sat May 3 04:44:03 2014 (r265255) +++ head/usr.bin/ssh-copy-id/ssh-copy-id.sh Sat May 3 08:52:52 2014 (r265256) @@ -45,7 +45,7 @@ sendkey() { if ! grep -sqwF "$key" "$keyfile"; then \ printf "$alg $key $comment\n" >> "$keyfile" ; \ fi ; \ - done \ + done ; \ if [ -x /sbin/restorecon ]; then \ /sbin/restorecon -F "$HOME/.ssh/" "$keyfile" >/dev/null 2>&1 || true ; \ fi From owner-svn-src-head@FreeBSD.ORG Sat May 3 09:06:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0482F0B; Sat, 3 May 2014 09:06:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E08A16D6; Sat, 3 May 2014 09:06:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4396Bqh058354; Sat, 3 May 2014 09:06:11 GMT (envelope-from thomas@svn.freebsd.org) Received: (from thomas@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4396BwN058353; Sat, 3 May 2014 09:06:11 GMT (envelope-from thomas@svn.freebsd.org) Message-Id: <201405030906.s4396BwN058353@svn.freebsd.org> From: Thomas Quinot Date: Sat, 3 May 2014 09:06:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265257 - head/bin/dd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 09:06:11 -0000 Author: thomas Date: Sat May 3 09:06:11 2014 New Revision: 265257 URL: http://svnweb.freebsd.org/changeset/base/265257 Log: Minor comment fix. Modified: head/bin/dd/conv.c Modified: head/bin/dd/conv.c ============================================================================== --- head/bin/dd/conv.c Sat May 3 08:52:52 2014 (r265256) +++ head/bin/dd/conv.c Sat May 3 09:06:11 2014 (r265257) @@ -74,7 +74,7 @@ def(void) dd_out(0); /* - * Ddout copies the leftover output to the beginning of + * dd_out copies the leftover output to the beginning of * the buffer and resets the output buffer. Reset the * input buffer to match it. */ From owner-svn-src-head@FreeBSD.ORG Sat May 3 09:07:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF408DE; Sat, 3 May 2014 09:07:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD43316ED; Sat, 3 May 2014 09:07:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s43972fh058520; Sat, 3 May 2014 09:07:02 GMT (envelope-from thomas@svn.freebsd.org) Received: (from thomas@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43972cL058519; Sat, 3 May 2014 09:07:02 GMT (envelope-from thomas@svn.freebsd.org) Message-Id: <201405030907.s43972cL058519@svn.freebsd.org> From: Thomas Quinot Date: Sat, 3 May 2014 09:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265258 - head/bin/dd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 09:07:02 -0000 Author: thomas Date: Sat May 3 09:07:02 2014 New Revision: 265258 URL: http://svnweb.freebsd.org/changeset/base/265258 Log: Minor comment fix: dbsz is the block size as set by bs/ibs/obs, not the size of the buffer. Modified: head/bin/dd/dd.h Modified: head/bin/dd/dd.h ============================================================================== --- head/bin/dd/dd.h Sat May 3 09:06:11 2014 (r265257) +++ head/bin/dd/dd.h Sat May 3 09:07:02 2014 (r265258) @@ -41,7 +41,7 @@ typedef struct { /* XXX ssize_t? */ size_t dbcnt; /* current buffer byte count */ size_t dbrcnt; /* last read byte count */ - size_t dbsz; /* buffer size */ + size_t dbsz; /* block size */ #define ISCHR 0x01 /* character device (warn on short) */ #define ISPIPE 0x02 /* pipe-like (see position.c) */ From owner-svn-src-head@FreeBSD.ORG Sat May 3 09:24:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2804B61B; Sat, 3 May 2014 09:24:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 084A7188C; Sat, 3 May 2014 09:24:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s439OK07066703; Sat, 3 May 2014 09:24:20 GMT (envelope-from thomas@svn.freebsd.org) Received: (from thomas@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s439OKid066701; Sat, 3 May 2014 09:24:20 GMT (envelope-from thomas@svn.freebsd.org) Message-Id: <201405030924.s439OKid066701@svn.freebsd.org> From: Thomas Quinot Date: Sat, 3 May 2014 09:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265260 - in head: . tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 09:24:21 -0000 Author: thomas Date: Sat May 3 09:24:20 2014 New Revision: 265260 URL: http://svnweb.freebsd.org/changeset/base/265260 Log: Add appropriate quoting to allow building with a KERNCONFDIR containing spaces. PR: kern/162736 MFC after: 1 week Modified: head/Makefile.inc1 head/tools/tools/nanobsd/nanobsd.sh Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat May 3 09:18:59 2014 (r265259) +++ head/Makefile.inc1 Sat May 3 09:24:20 2014 (r265260) @@ -1001,7 +1001,7 @@ buildkernel: cd ${KRNLCONFDIR}; \ PATH=${TMPPATH} \ config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \ - -I ${KERNCONFDIR} ${KERNCONFDIR}/${_kernel} + -I '${KERNCONFDIR}' '${KERNCONFDIR}/${_kernel}' .endif .if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN) @echo @@ -1816,7 +1816,7 @@ DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF} .if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE) .if exists(${KERNCONFDIR}/${KERNCONF}) FDT_DTS_FILE!= awk 'BEGIN {FS="="} /^makeoptions[[:space:]]+FDT_DTS_FILE/ {print $$2}' \ - ${KERNCONFDIR}/${KERNCONF} ; echo + '${KERNCONFDIR}/${KERNCONF}' ; echo .endif .endif Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Sat May 3 09:18:59 2014 (r265259) +++ head/tools/tools/nanobsd/nanobsd.sh Sat May 3 09:24:20 2014 (r265260) @@ -233,7 +233,7 @@ build_kernel ( ) ( ( if [ -f ${NANO_KERNEL} ] ; then - extra="KERNCONFDIR=$(realpath $(dirname ${NANO_KERNEL}))" + kernconfdir_arg="KERNCONFDIR='$(realpath $(dirname ${NANO_KERNEL}))'" kernconf=$(basename ${NANO_KERNEL}) else kernconf=${NANO_KERNEL} @@ -245,10 +245,10 @@ build_kernel ( ) ( unset TARGET_CPUTYPE # Note: We intentionally build all modules, not only the ones in # NANO_MODULES so the built world can be reused by multiple images. - env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \ - SRCCONF=${SRCCONF} \ - ${extra} __MAKE_CONF=${NANO_MAKE_CONF_BUILD} \ - KERNCONF=${kernconf} + eval "TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \ + SRCCONF='${SRCCONF}' \ + __MAKE_CONF='${NANO_MAKE_CONF_BUILD}' \ + ${kernconfdir_arg} KERNCONF=${kernconf}" ) > ${MAKEOBJDIRPREFIX}/_.bk 2>&1 ) @@ -315,19 +315,19 @@ install_kernel ( ) ( ( if [ -f ${NANO_KERNEL} ] ; then - extra="KERNCONFDIR=$(realpath $(dirname ${NANO_KERNEL}))" + kernconfdir_arg="KERNCONFDIR='$(realpath $(dirname ${NANO_KERNEL}))'" kernconf=$(basename ${NANO_KERNEL}) else kernconf=${NANO_KERNEL} fi cd ${NANO_SRC} - env TARGET_ARCH=${NANO_ARCH} ${NANO_MAKE} installkernel \ - DESTDIR=${NANO_WORLDDIR} \ - SRCCONF=${SRCCONF} \ - ${extra} __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} \ - KERNCONF=${kernconf} \ - MODULES_OVERRIDE="${NANO_MODULES}" + eval "TARGET_ARCH=${NANO_ARCH} ${NANO_MAKE} installkernel \ + DESTDIR='${NANO_WORLDDIR}' \ + SRCCONF='${SRCCONF}' \ + __MAKE_CONF='${NANO_MAKE_CONF_INSTALL}' \ + ${kernconfdir_arg} KERNCONF=${kernconf} \ + MODULES_OVERRIDE='${NANO_MODULES}'" ) > ${NANO_OBJ}/_.ik 2>&1 ) From owner-svn-src-head@FreeBSD.ORG Sat May 3 11:15:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA1E4E91; Sat, 3 May 2014 11:15:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B7C411EA; Sat, 3 May 2014 11:15:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s43BFSlH014562; Sat, 3 May 2014 11:15:28 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43BFSis014561; Sat, 3 May 2014 11:15:28 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405031115.s43BFSis014561@svn.freebsd.org> From: Christian Brueffer Date: Sat, 3 May 2014 11:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265261 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 11:15:28 -0000 Author: brueffer Date: Sat May 3 11:15:28 2014 New Revision: 265261 URL: http://svnweb.freebsd.org/changeset/base/265261 Log: Add a missing colon. Modified: head/share/man/man4/mpr.4 Modified: head/share/man/man4/mpr.4 ============================================================================== --- head/share/man/man4/mpr.4 Sat May 3 09:24:20 2014 (r265260) +++ head/share/man/man4/mpr.4 Sat May 3 11:15:28 2014 (r265261) @@ -66,7 +66,7 @@ controllers. .Sh HARDWARE The following controllers are supported by the .Nm -driver +driver: .Pp .Bl -bullet -compact .It From owner-svn-src-head@FreeBSD.ORG Sat May 3 11:23:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F3092C0; Sat, 3 May 2014 11:23:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6037B12B0; Sat, 3 May 2014 11:23:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s43BNBDo018561; Sat, 3 May 2014 11:23:11 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43BNAOl018558; Sat, 3 May 2014 11:23:10 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201405031123.s43BNAOl018558@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 3 May 2014 11:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265262 - in head/sys: dev/drm2/radeon modules/drm2/radeonkms X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 11:23:11 -0000 Author: dumbbell Date: Sat May 3 11:23:10 2014 New Revision: 265262 URL: http://svnweb.freebsd.org/changeset/base/265262 Log: drm/radeon: Add 32bit ioctls support This allows to run 32bit applications on a 64bit host. This was tested successfully with Wine (emulators/i386-wine-devel) and StarCraft II. Submitted by: Jan Kokemüller MFC after: 1 week Modified: head/sys/dev/drm2/radeon/radeon_drv.c head/sys/dev/drm2/radeon/radeon_ioc32.c head/sys/modules/drm2/radeonkms/Makefile Modified: head/sys/dev/drm2/radeon/radeon_drv.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_drv.c Sat May 3 11:15:28 2014 (r265261) +++ head/sys/dev/drm2/radeon/radeon_drv.c Sat May 3 11:23:10 2014 (r265262) @@ -85,6 +85,10 @@ extern int radeon_get_crtc_scanoutpos(st int *vpos, int *hpos); extern struct drm_ioctl_desc radeon_ioctls_kms[]; extern int radeon_max_kms_ioctl; +#ifdef COMPAT_FREEBSD32 +extern struct drm_ioctl_desc radeon_compat_ioctls[]; +extern int radeon_num_compat_ioctls; +#endif #ifdef DUMBBELL_WIP int radeon_mmap(struct file *filp, struct vm_area_struct *vma); #endif /* DUMBBELL_WIP */ @@ -466,6 +470,10 @@ radeon_attach(device_t kdev) if (radeon_modeset == 1) { kms_driver.driver_features |= DRIVER_MODESET; kms_driver.max_ioctl = radeon_max_kms_ioctl; +#ifdef COMPAT_FREEBSD32 + kms_driver.compat_ioctls = radeon_compat_ioctls; + kms_driver.compat_ioctls_nr = &radeon_num_compat_ioctls; +#endif radeon_register_atpx_handler(); } dev->driver = &kms_driver; Modified: head/sys/dev/drm2/radeon/radeon_ioc32.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_ioc32.c Sat May 3 11:15:28 2014 (r265261) +++ head/sys/dev/drm2/radeon/radeon_ioc32.c Sat May 3 11:23:10 2014 (r265262) @@ -31,10 +31,13 @@ #include __FBSDID("$FreeBSD$"); -#include +#include "opt_compat.h" -#include -#include +#ifdef COMPAT_FREEBSD32 + +#include +#include +#include #include "radeon_drv.h" typedef struct drm_radeon_init32 { @@ -60,42 +63,37 @@ typedef struct drm_radeon_init32 { u32 gart_textures_offset; } drm_radeon_init32_t; -static int compat_radeon_cp_init(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_cp_init(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { - drm_radeon_init32_t init32; - drm_radeon_init_t __user *init; + drm_radeon_init32_t *init32; + drm_radeon_init_t __user init; - if (copy_from_user(&init32, (void __user *)arg, sizeof(init32))) - return -EFAULT; + init32 = arg; - init = compat_alloc_user_space(sizeof(*init)); - if (!access_ok(VERIFY_WRITE, init, sizeof(*init)) - || __put_user(init32.func, &init->func) - || __put_user(init32.sarea_priv_offset, &init->sarea_priv_offset) - || __put_user(init32.is_pci, &init->is_pci) - || __put_user(init32.cp_mode, &init->cp_mode) - || __put_user(init32.gart_size, &init->gart_size) - || __put_user(init32.ring_size, &init->ring_size) - || __put_user(init32.usec_timeout, &init->usec_timeout) - || __put_user(init32.fb_bpp, &init->fb_bpp) - || __put_user(init32.front_offset, &init->front_offset) - || __put_user(init32.front_pitch, &init->front_pitch) - || __put_user(init32.back_offset, &init->back_offset) - || __put_user(init32.back_pitch, &init->back_pitch) - || __put_user(init32.depth_bpp, &init->depth_bpp) - || __put_user(init32.depth_offset, &init->depth_offset) - || __put_user(init32.depth_pitch, &init->depth_pitch) - || __put_user(init32.fb_offset, &init->fb_offset) - || __put_user(init32.mmio_offset, &init->mmio_offset) - || __put_user(init32.ring_offset, &init->ring_offset) - || __put_user(init32.ring_rptr_offset, &init->ring_rptr_offset) - || __put_user(init32.buffers_offset, &init->buffers_offset) - || __put_user(init32.gart_textures_offset, - &init->gart_textures_offset)) - return -EFAULT; + init.func = init32->func; + init.sarea_priv_offset = (unsigned long)init32->sarea_priv_offset; + init.is_pci = init32->is_pci; + init.cp_mode = init32->cp_mode; + init.gart_size = init32->gart_size; + init.ring_size = init32->ring_size; + init.usec_timeout = init32->usec_timeout; + init.fb_bpp = init32->fb_bpp; + init.front_offset = init32->front_offset; + init.front_pitch = init32->front_pitch; + init.back_offset = init32->back_offset; + init.back_pitch = init32->back_pitch; + init.depth_bpp = init32->depth_bpp; + init.depth_offset = init32->depth_offset; + init.depth_pitch = init32->depth_pitch; + init.fb_offset = (unsigned long)init32->fb_offset; + init.mmio_offset = (unsigned long)init32->mmio_offset; + init.ring_offset = (unsigned long)init32->ring_offset; + init.ring_rptr_offset = (unsigned long)init32->ring_rptr_offset; + init.buffers_offset = (unsigned long)init32->buffers_offset; + init.gart_textures_offset = (unsigned long)init32->gart_textures_offset; - return drm_ioctl(file, DRM_IOCTL_RADEON_CP_INIT, (unsigned long)init); + return radeon_cp_init(dev, &init, file_priv); } typedef struct drm_radeon_clear32 { @@ -107,50 +105,37 @@ typedef struct drm_radeon_clear32 { u32 depth_boxes; } drm_radeon_clear32_t; -static int compat_radeon_cp_clear(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_cp_clear(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { - drm_radeon_clear32_t clr32; - drm_radeon_clear_t __user *clr; + drm_radeon_clear32_t *clr32; + drm_radeon_clear_t __user clr; - if (copy_from_user(&clr32, (void __user *)arg, sizeof(clr32))) - return -EFAULT; + clr32 = arg; - clr = compat_alloc_user_space(sizeof(*clr)); - if (!access_ok(VERIFY_WRITE, clr, sizeof(*clr)) - || __put_user(clr32.flags, &clr->flags) - || __put_user(clr32.clear_color, &clr->clear_color) - || __put_user(clr32.clear_depth, &clr->clear_depth) - || __put_user(clr32.color_mask, &clr->color_mask) - || __put_user(clr32.depth_mask, &clr->depth_mask) - || __put_user((void __user *)(unsigned long)clr32.depth_boxes, - &clr->depth_boxes)) - return -EFAULT; + clr.flags = clr32->flags; + clr.clear_color = clr32->clear_color; + clr.clear_depth = clr32->clear_depth; + clr.color_mask = clr32->color_mask; + clr.depth_mask = clr32->depth_mask; + clr.depth_boxes = (drm_radeon_clear_rect_t *)(unsigned long)clr32->depth_boxes; - return drm_ioctl(file, DRM_IOCTL_RADEON_CLEAR, (unsigned long)clr); + return radeon_ioctls[DRM_IOCTL_RADEON_CLEAR].func(dev, &clr, file_priv); } typedef struct drm_radeon_stipple32 { u32 mask; } drm_radeon_stipple32_t; -static int compat_radeon_cp_stipple(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_cp_stipple(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { drm_radeon_stipple32_t __user *argp = (void __user *)arg; - drm_radeon_stipple_t __user *request; - u32 mask; + drm_radeon_stipple_t __user request; - if (get_user(mask, &argp->mask)) - return -EFAULT; + request.mask = (unsigned int *)(unsigned long)argp->mask; - request = compat_alloc_user_space(sizeof(*request)); - if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) - || __put_user((unsigned int __user *)(unsigned long)mask, - &request->mask)) - return -EFAULT; - - return drm_ioctl(file, DRM_IOCTL_RADEON_STIPPLE, (unsigned long)request); + return radeon_ioctls[DRM_IOCTL_RADEON_STIPPLE].func(dev, &request, file_priv); } typedef struct drm_radeon_tex_image32 { @@ -168,43 +153,32 @@ typedef struct drm_radeon_texture32 { u32 image; } drm_radeon_texture32_t; -static int compat_radeon_cp_texture(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_cp_texture(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { - drm_radeon_texture32_t req32; - drm_radeon_texture_t __user *request; - drm_radeon_tex_image32_t img32; - drm_radeon_tex_image_t __user *image; - - if (copy_from_user(&req32, (void __user *)arg, sizeof(req32))) - return -EFAULT; - if (req32.image == 0) + drm_radeon_texture32_t *req32; + drm_radeon_texture_t __user request; + drm_radeon_tex_image32_t *img32; + drm_radeon_tex_image_t __user image; + + req32 = arg; + if (req32->image == 0) return -EINVAL; - if (copy_from_user(&img32, (void __user *)(unsigned long)req32.image, - sizeof(img32))) - return -EFAULT; - - request = compat_alloc_user_space(sizeof(*request) + sizeof(*image)); - if (!access_ok(VERIFY_WRITE, request, - sizeof(*request) + sizeof(*image))) - return -EFAULT; - image = (drm_radeon_tex_image_t __user *) (request + 1); - - if (__put_user(req32.offset, &request->offset) - || __put_user(req32.pitch, &request->pitch) - || __put_user(req32.format, &request->format) - || __put_user(req32.width, &request->width) - || __put_user(req32.height, &request->height) - || __put_user(image, &request->image) - || __put_user(img32.x, &image->x) - || __put_user(img32.y, &image->y) - || __put_user(img32.width, &image->width) - || __put_user(img32.height, &image->height) - || __put_user((const void __user *)(unsigned long)img32.data, - &image->data)) - return -EFAULT; + img32 = (drm_radeon_tex_image32_t *)(unsigned long)req32->image; - return drm_ioctl(file, DRM_IOCTL_RADEON_TEXTURE, (unsigned long)request); + request.offset = req32->offset; + request.pitch = req32->pitch; + request.format = req32->format; + request.width = req32->width; + request.height = req32->height; + request.image = ℑ + image.x = img32->x; + image.y = img32->y; + image.width = img32->width; + image.height = img32->height; + image.data = (void *)(unsigned long)img32->data; + + return radeon_ioctls[DRM_IOCTL_RADEON_TEXTURE].func(dev, &request, file_priv); } typedef struct drm_radeon_vertex2_32 { @@ -216,28 +190,22 @@ typedef struct drm_radeon_vertex2_32 { u32 prim; } drm_radeon_vertex2_32_t; -static int compat_radeon_cp_vertex2(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_cp_vertex2(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { - drm_radeon_vertex2_32_t req32; - drm_radeon_vertex2_t __user *request; + drm_radeon_vertex2_32_t *req32; + drm_radeon_vertex2_t __user request; - if (copy_from_user(&req32, (void __user *)arg, sizeof(req32))) - return -EFAULT; + req32 = arg; - request = compat_alloc_user_space(sizeof(*request)); - if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) - || __put_user(req32.idx, &request->idx) - || __put_user(req32.discard, &request->discard) - || __put_user(req32.nr_states, &request->nr_states) - || __put_user((void __user *)(unsigned long)req32.state, - &request->state) - || __put_user(req32.nr_prims, &request->nr_prims) - || __put_user((void __user *)(unsigned long)req32.prim, - &request->prim)) - return -EFAULT; + request.idx = req32->idx; + request.discard = req32->discard; + request.nr_states = req32->nr_states; + request.state = (drm_radeon_state_t *)(unsigned long)req32->state; + request.nr_prims = req32->nr_prims; + request.prim = (drm_radeon_prim_t *)(unsigned long)req32->prim; - return drm_ioctl(file, DRM_IOCTL_RADEON_VERTEX2, (unsigned long)request); + return radeon_ioctls[DRM_IOCTL_RADEON_VERTEX2].func(dev, &request, file_priv); } typedef struct drm_radeon_cmd_buffer32 { @@ -247,26 +215,20 @@ typedef struct drm_radeon_cmd_buffer32 { u32 boxes; } drm_radeon_cmd_buffer32_t; -static int compat_radeon_cp_cmdbuf(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_cp_cmdbuf(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { - drm_radeon_cmd_buffer32_t req32; - drm_radeon_cmd_buffer_t __user *request; + drm_radeon_cmd_buffer32_t *req32; + drm_radeon_cmd_buffer_t __user request; - if (copy_from_user(&req32, (void __user *)arg, sizeof(req32))) - return -EFAULT; + req32 = arg; - request = compat_alloc_user_space(sizeof(*request)); - if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) - || __put_user(req32.bufsz, &request->bufsz) - || __put_user((void __user *)(unsigned long)req32.buf, - &request->buf) - || __put_user(req32.nbox, &request->nbox) - || __put_user((void __user *)(unsigned long)req32.boxes, - &request->boxes)) - return -EFAULT; + request.bufsz = req32->bufsz; + request.buf = (char *)(unsigned long)req32->buf; + request.nbox = req32->nbox; + request.boxes = (struct drm_clip_rect *)(unsigned long)req32->boxes; - return drm_ioctl(file, DRM_IOCTL_RADEON_CMDBUF, (unsigned long)request); + return radeon_ioctls[DRM_IOCTL_RADEON_CMDBUF].func(dev, &request, file_priv); } typedef struct drm_radeon_getparam32 { @@ -274,23 +236,18 @@ typedef struct drm_radeon_getparam32 { u32 value; } drm_radeon_getparam32_t; -static int compat_radeon_cp_getparam(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_cp_getparam(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { - drm_radeon_getparam32_t req32; - drm_radeon_getparam_t __user *request; + drm_radeon_getparam32_t *req32; + drm_radeon_getparam_t __user request; - if (copy_from_user(&req32, (void __user *)arg, sizeof(req32))) - return -EFAULT; + req32 = arg; - request = compat_alloc_user_space(sizeof(*request)); - if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) - || __put_user(req32.param, &request->param) - || __put_user((void __user *)(unsigned long)req32.value, - &request->value)) - return -EFAULT; + request.param = req32->param; + request.value = (void *)(unsigned long)req32->value; - return drm_ioctl(file, DRM_IOCTL_RADEON_GETPARAM, (unsigned long)request); + return radeon_ioctls[DRM_IOCTL_RADEON_GETPARAM].func(dev, &request, file_priv); } typedef struct drm_radeon_mem_alloc32 { @@ -300,129 +257,71 @@ typedef struct drm_radeon_mem_alloc32 { u32 region_offset; /* offset from start of fb or GART */ } drm_radeon_mem_alloc32_t; -static int compat_radeon_mem_alloc(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_mem_alloc(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { - drm_radeon_mem_alloc32_t req32; - drm_radeon_mem_alloc_t __user *request; + drm_radeon_mem_alloc32_t *req32; + drm_radeon_mem_alloc_t __user request; - if (copy_from_user(&req32, (void __user *)arg, sizeof(req32))) - return -EFAULT; + req32 = arg; - request = compat_alloc_user_space(sizeof(*request)); - if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) - || __put_user(req32.region, &request->region) - || __put_user(req32.alignment, &request->alignment) - || __put_user(req32.size, &request->size) - || __put_user((int __user *)(unsigned long)req32.region_offset, - &request->region_offset)) - return -EFAULT; + request.region = req32->region; + request.alignment = req32->alignment; + request.size = req32->size; + request.region_offset = (int *)(unsigned long)req32->region_offset; - return drm_ioctl(file, DRM_IOCTL_RADEON_ALLOC, (unsigned long)request); + return radeon_mem_alloc(dev, &request, file_priv); } typedef struct drm_radeon_irq_emit32 { u32 irq_seq; } drm_radeon_irq_emit32_t; -static int compat_radeon_irq_emit(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_irq_emit(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { - drm_radeon_irq_emit32_t req32; - drm_radeon_irq_emit_t __user *request; + drm_radeon_irq_emit32_t *req32; + drm_radeon_irq_emit_t __user request; - if (copy_from_user(&req32, (void __user *)arg, sizeof(req32))) - return -EFAULT; + req32 = arg; - request = compat_alloc_user_space(sizeof(*request)); - if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) - || __put_user((int __user *)(unsigned long)req32.irq_seq, - &request->irq_seq)) - return -EFAULT; + request.irq_seq = (int *)(unsigned long)req32->irq_seq; - return drm_ioctl(file, DRM_IOCTL_RADEON_IRQ_EMIT, (unsigned long)request); + return radeon_irq_emit(dev, &request, file_priv); } /* The two 64-bit arches where alignof(u64)==4 in 32-bit code */ -#if defined (CONFIG_X86_64) || defined(CONFIG_IA64) typedef struct drm_radeon_setparam32 { int param; u64 value; } __attribute__((packed)) drm_radeon_setparam32_t; -static int compat_radeon_cp_setparam(struct file *file, unsigned int cmd, - unsigned long arg) +static int compat_radeon_cp_setparam(struct drm_device *dev, void *arg, + struct drm_file *file_priv) { - drm_radeon_setparam32_t req32; - drm_radeon_setparam_t __user *request; - - if (copy_from_user(&req32, (void __user *) arg, sizeof(req32))) - return -EFAULT; + drm_radeon_setparam32_t *req32; + drm_radeon_setparam_t __user request; - request = compat_alloc_user_space(sizeof(*request)); - if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) - || __put_user(req32.param, &request->param) - || __put_user((void __user *)(unsigned long)req32.value, - &request->value)) - return -EFAULT; + req32 = arg; - return drm_ioctl(file, DRM_IOCTL_RADEON_SETPARAM, (unsigned long) request); -} -#else -#define compat_radeon_cp_setparam NULL -#endif /* X86_64 || IA64 */ - -static drm_ioctl_compat_t *radeon_compat_ioctls[] = { - [DRM_RADEON_CP_INIT] = compat_radeon_cp_init, - [DRM_RADEON_CLEAR] = compat_radeon_cp_clear, - [DRM_RADEON_STIPPLE] = compat_radeon_cp_stipple, - [DRM_RADEON_TEXTURE] = compat_radeon_cp_texture, - [DRM_RADEON_VERTEX2] = compat_radeon_cp_vertex2, - [DRM_RADEON_CMDBUF] = compat_radeon_cp_cmdbuf, - [DRM_RADEON_GETPARAM] = compat_radeon_cp_getparam, - [DRM_RADEON_SETPARAM] = compat_radeon_cp_setparam, - [DRM_RADEON_ALLOC] = compat_radeon_mem_alloc, - [DRM_RADEON_IRQ_EMIT] = compat_radeon_irq_emit, + request.param = req32->param; + request.value = req32->value; + + return radeon_ioctls[DRM_IOCTL_RADEON_SETPARAM].func(dev, &request, file_priv); +} + +struct drm_ioctl_desc radeon_compat_ioctls[] = { + DRM_IOCTL_DEF(DRM_RADEON_CP_INIT, compat_radeon_cp_init, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + DRM_IOCTL_DEF(DRM_RADEON_CLEAR, compat_radeon_cp_clear, DRM_AUTH), + DRM_IOCTL_DEF(DRM_RADEON_STIPPLE, compat_radeon_cp_stipple, DRM_AUTH), + DRM_IOCTL_DEF(DRM_RADEON_TEXTURE, compat_radeon_cp_texture, DRM_AUTH), + DRM_IOCTL_DEF(DRM_RADEON_VERTEX2, compat_radeon_cp_vertex2, DRM_AUTH), + DRM_IOCTL_DEF(DRM_RADEON_CMDBUF, compat_radeon_cp_cmdbuf, DRM_AUTH), + DRM_IOCTL_DEF(DRM_RADEON_GETPARAM, compat_radeon_cp_getparam, DRM_AUTH), + DRM_IOCTL_DEF(DRM_RADEON_SETPARAM, compat_radeon_cp_setparam, DRM_AUTH), + DRM_IOCTL_DEF(DRM_RADEON_ALLOC, compat_radeon_mem_alloc, DRM_AUTH), + DRM_IOCTL_DEF(DRM_RADEON_IRQ_EMIT, compat_radeon_irq_emit, DRM_AUTH) }; +int radeon_num_compat_ioctls = DRM_ARRAY_SIZE(radeon_compat_ioctls); -/** - * Called whenever a 32-bit process running under a 64-bit kernel - * performs an ioctl on /dev/dri/card. - * - * \param filp file pointer. - * \param cmd command. - * \param arg user argument. - * \return zero on success or negative number on failure. - */ -long radeon_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) -{ - unsigned int nr = DRM_IOCTL_NR(cmd); - drm_ioctl_compat_t *fn = NULL; - int ret; - - if (nr < DRM_COMMAND_BASE) - return drm_compat_ioctl(filp, cmd, arg); - - if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(radeon_compat_ioctls)) - fn = radeon_compat_ioctls[nr - DRM_COMMAND_BASE]; - - if (fn != NULL) - ret = (*fn) (filp, cmd, arg); - else - ret = drm_ioctl(filp, cmd, arg); - - return ret; -} - -long radeon_kms_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) -{ - unsigned int nr = DRM_IOCTL_NR(cmd); - int ret; - - if (nr < DRM_COMMAND_BASE) - return drm_compat_ioctl(filp, cmd, arg); - - ret = drm_ioctl(filp, cmd, arg); - - return ret; -} +#endif Modified: head/sys/modules/drm2/radeonkms/Makefile ============================================================================== --- head/sys/modules/drm2/radeonkms/Makefile Sat May 3 11:15:28 2014 (r265261) +++ head/sys/modules/drm2/radeonkms/Makefile Sat May 3 11:23:10 2014 (r265262) @@ -88,7 +88,10 @@ SRCS += \ si.c \ si_blit_shaders.c -#radeon_ioc32.c +.if ${MACHINE_CPUARCH} == "amd64" +SRCS += radeon_ioc32.c +.endif + #radeon_prime.c #--radeon_trace_points.c From owner-svn-src-head@FreeBSD.ORG Sat May 3 11:34:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 943E7566; Sat, 3 May 2014 11:34:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67521135A; Sat, 3 May 2014 11:34:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s43BYtjL022828; Sat, 3 May 2014 11:34:55 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43BYtwn022827; Sat, 3 May 2014 11:34:55 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405031134.s43BYtwn022827@svn.freebsd.org> From: Christian Brueffer Date: Sat, 3 May 2014 11:34:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265263 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 11:34:55 -0000 Author: brueffer Date: Sat May 3 11:34:54 2014 New Revision: 265263 URL: http://svnweb.freebsd.org/changeset/base/265263 Log: Make this manpage ready for hardware notes generation, add more Xrefs and perform general cleanup. In particular, don't claim rsu(4) devices can be configured with hostname(1)... MFC after: 1 week Modified: head/share/man/man4/rsu.4 Modified: head/share/man/man4/rsu.4 ============================================================================== --- head/share/man/man4/rsu.4 Sat May 3 11:23:10 2014 (r265262) +++ head/share/man/man4/rsu.4 Sat May 3 11:34:54 2014 (r265263) @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd July 29 2013 +.Dd May 3, 2014 .Dt RSU 4 .Os .Sh NAME @@ -40,7 +40,8 @@ place the following line in if_rsu_load="YES" .Ed .Pp -After you have read the license in /usr/share/doc/legal/realtek +After you have read the license in +.Pa /usr/share/doc/legal/realtek you will want to add the following lines to .Xr loader.conf 5 : .Bd -literal -offset indent @@ -93,18 +94,19 @@ due to serious weaknesses in it. The .Nm driver can be configured at runtime with -.Xr ifconfig 8 -or on boot with -.Xr hostname 1 . +.Xr ifconfig 8 . .Sh FILES The driver needs at least version 1.2 of the following firmware file, which is loaded when an interface is attached: .Pp .Bl -tag -width Ds -offset indent -compact -.It /boot/kernel/rsu-rtl8712fw.ko +.It Pa /boot/kernel/rsu-rtl8712fw.ko .El .Sh HARDWARE -The following adapters should work: +The +.Nm +driver provices support for Realtek RTL8188SU/RTL8192SU USB IEEE 802.11b/g/n +wireless network adapters, including: .Pp .Bl -tag -width Ds -offset indent -compact .It ASUS USB-N10 @@ -149,14 +151,15 @@ The driver will reset the hardware. This should not happen. .El .Sh SEE ALSO -.Xr hostname 1 , .Xr intro 1 , -.Xr usb 3 , +.Xr usb 4 , .Xr netintro 4 , .Xr rsufw 4 , .Xr wlan 4 , .Xr arp 8 , -.Xr ifconfig 8 +.Xr hostapd 8 , +.Xr ifconfig 8 , +.Xr wpa_supplicant 8 .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Sat May 3 11:39:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9990741; Sat, 3 May 2014 11:39:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D64A3138A; Sat, 3 May 2014 11:39:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s43Bd46q023355; Sat, 3 May 2014 11:39:04 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43Bd4ta023353; Sat, 3 May 2014 11:39:04 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405031139.s43Bd4ta023353@svn.freebsd.org> From: Christian Brueffer Date: Sat, 3 May 2014 11:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265264 - in head/release/doc: en_US.ISO8859-1/hardware share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 11:39:05 -0000 Author: brueffer Date: Sat May 3 11:39:04 2014 New Revision: 265264 URL: http://svnweb.freebsd.org/changeset/base/265264 Log: Add rsu(4) to the hardware notes. MFC after: 1 week Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml head/release/doc/share/misc/dev.archlist.txt Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Sat May 3 11:34:54 2014 (r265263) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Sat May 3 11:39:04 2014 (r265264) @@ -1012,6 +1012,8 @@ &hwlist.ral; + &hwlist.rsu; + &hwlist.rum; &hwlist.run; Modified: head/release/doc/share/misc/dev.archlist.txt ============================================================================== --- head/release/doc/share/misc/dev.archlist.txt Sat May 3 11:34:54 2014 (r265263) +++ head/release/doc/share/misc/dev.archlist.txt Sat May 3 11:39:04 2014 (r265264) @@ -108,6 +108,7 @@ qlxgbe amd64 qlxge amd64 rc i386 ral i386,amd64 +rsu i386,amd64 rue i386,pc98,amd64 rum i386,amd64 run i386,amd64 From owner-svn-src-head@FreeBSD.ORG Sat May 3 15:03:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16C1F1A8; Sat, 3 May 2014 15:03:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0331E1585; Sat, 3 May 2014 15:03:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s43F3lqx010242; Sat, 3 May 2014 15:03:47 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43F3ltB010241; Sat, 3 May 2014 15:03:47 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201405031503.s43F3ltB010241@svn.freebsd.org> From: Bryan Drewery Date: Sat, 3 May 2014 15:03:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265267 - head/usr.bin/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 15:03:48 -0000 Author: bdrewery Date: Sat May 3 15:03:47 2014 New Revision: 265267 URL: http://svnweb.freebsd.org/changeset/base/265267 Log: Fix width/alignment of JID column. Make it support up to the maximum 7-wide JIDs. On a system using jails for common tasks the JID can quickly increase. MFC after: 2 weeks Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Sat May 3 14:04:04 2014 (r265266) +++ head/usr.bin/top/machine.c Sat May 3 15:03:47 2014 (r265267) @@ -67,6 +67,9 @@ static int namelength = TOP_USERNAME_LEN #else static int namelength = 8; #endif +/* TOP_JID_LEN based on max of 999999 */ +#define TOP_JID_LEN 7 +static int jidlength; static int cmdlengthdelta; /* Prototypes for top internals */ @@ -101,26 +104,26 @@ struct handle { */ static char io_header[] = - " PID%s %-*.*s VCSW IVCSW READ WRITE FAULT TOTAL PERCENT COMMAND"; + " PID%*s %-*.*s VCSW IVCSW READ WRITE FAULT TOTAL PERCENT COMMAND"; #define io_Proc_format \ - "%5d%s %-*.*s %6ld %6ld %6ld %6ld %6ld %6ld %6.2f%% %.*s" + "%5d%*s %-*.*s %6ld %6ld %6ld %6ld %6ld %6ld %6.2f%% %.*s" static char smp_header_thr[] = - " PID%s %-*.*s THR PRI NICE SIZE RES STATE C TIME %7s COMMAND"; + " PID%*s %-*.*s THR PRI NICE SIZE RES STATE C TIME %7s COMMAND"; static char smp_header[] = - " PID%s %-*.*s " "PRI NICE SIZE RES STATE C TIME %7s COMMAND"; + " PID%*s %-*.*s " "PRI NICE SIZE RES STATE C TIME %7s COMMAND"; #define smp_Proc_format \ - "%5d%s %-*.*s %s%3d %4s%7s %6s %-6.6s %2d%7s %6.2f%% %.*s" + "%5d%*s %-*.*s %s%3d %4s%7s %6s %-6.6s %2d%7s %6.2f%% %.*s" static char up_header_thr[] = - " PID%s %-*.*s THR PRI NICE SIZE RES STATE TIME %7s COMMAND"; + " PID%*s %-*.*s THR PRI NICE SIZE RES STATE TIME %7s COMMAND"; static char up_header[] = - " PID%s %-*.*s " "PRI NICE SIZE RES STATE TIME %7s COMMAND"; + " PID%*s %-*.*s " "PRI NICE SIZE RES STATE TIME %7s COMMAND"; #define up_Proc_format \ - "%5d%s %-*.*s %s%3d %4s%7s %6s %-6.6s%.0d%7s %6.2f%% %.*s" + "%5d%*s %-*.*s %s%3d %4s%7s %6s %-6.6s%.0d%7s %6.2f%% %.*s" /* process state names for the "STATE" column of the display */ @@ -393,6 +396,11 @@ format_header(char *uname_field) { static char Header[128]; const char *prehead; + + if (ps.jail) + jidlength = TOP_JID_LEN + 1; /* +1 for extra left space. */ + else + jidlength = 0; switch (displaymode) { case DISP_CPU: @@ -406,14 +414,14 @@ format_header(char *uname_field) (ps.thread ? smp_header : smp_header_thr) : (ps.thread ? up_header : up_header_thr); snprintf(Header, sizeof(Header), prehead, - ps.jail ? " JID" : "", + jidlength, ps.jail ? " JID" : "", namelength, namelength, uname_field, ps.wcpu ? "WCPU" : "CPU"); break; case DISP_IO: prehead = io_header; snprintf(Header, sizeof(Header), prehead, - ps.jail ? " JID" : "", + jidlength, ps.jail ? " JID" : "", namelength, namelength, uname_field); break; } @@ -806,7 +814,7 @@ format_next_process(caddr_t handle, char int cpu, state; struct rusage ru, *rup; long p_tot, s_tot; - char *proc_fmt, thr_buf[6], jid_buf[6]; + char *proc_fmt, thr_buf[6], jid_buf[TOP_JID_LEN + 1]; char *cmdbuf = NULL; char **args; const int cmdlen = 128; @@ -962,8 +970,8 @@ format_next_process(caddr_t handle, char if (ps.jail == 0) jid_buf[0] = '\0'; else - snprintf(jid_buf, sizeof(jid_buf), " %*d", - sizeof(jid_buf) - 3, pp->ki_jid); + snprintf(jid_buf, sizeof(jid_buf), "%*d", + jidlength - 1, pp->ki_jid); if (displaymode == DISP_IO) { oldp = get_old_proc(pp); @@ -984,7 +992,7 @@ format_next_process(caddr_t handle, char snprintf(fmt, sizeof(fmt), io_Proc_format, pp->ki_pid, - jid_buf, + jidlength, jid_buf, namelength, namelength, (*get_userid)(pp->ki_ruid), rup->ru_nvcsw, rup->ru_nivcsw, @@ -1019,7 +1027,7 @@ format_next_process(caddr_t handle, char snprintf(fmt, sizeof(fmt), proc_fmt, pp->ki_pid, - jid_buf, + jidlength, jid_buf, namelength, namelength, (*get_userid)(pp->ki_ruid), thr_buf, pp->ki_pri.pri_level - PZERO, From owner-svn-src-head@FreeBSD.ORG Sat May 3 15:31:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A66589D; Sat, 3 May 2014 15:31:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 870E31775; Sat, 3 May 2014 15:31:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s43FVsB3022743; Sat, 3 May 2014 15:31:54 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43FVsf2022742; Sat, 3 May 2014 15:31:54 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405031531.s43FVsf2022742@svn.freebsd.org> From: Christian Brueffer Date: Sat, 3 May 2014 15:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265269 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 15:31:54 -0000 Author: brueffer Date: Sat May 3 15:31:54 2014 New Revision: 265269 URL: http://svnweb.freebsd.org/changeset/base/265269 Log: Make the HARDWARE section ready for release notes generation; sort SEE ALSO. MFC after: 1 week Modified: head/share/man/man4/urtwn.4 Modified: head/share/man/man4/urtwn.4 ============================================================================== --- head/share/man/man4/urtwn.4 Sat May 3 15:27:30 2014 (r265268) +++ head/share/man/man4/urtwn.4 Sat May 3 15:31:54 2014 (r265269) @@ -14,7 +14,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 25, 2014 +.Dd May 3, 2014 .Dt URTWN 4 .Os .Sh NAME @@ -80,7 +80,10 @@ must be agreed by adding the following l firmware license .El .Sh HARDWARE -The following adapters should work: +The +.Nm +driver supports Realtek RTL8188CU/RTL8188EU/RTL8192CU based USB +IEEE 802.11b/g/n wireless network adapters, including: .Pp .Bl -tag -width Ds -offset indent -compact .It ASUS USB-N10 NANO @@ -122,9 +125,9 @@ The driver will reset the hardware. This should not happen. .El .Sh SEE ALSO -.Xr urtwnfw 4 , .Xr intro 4 , .Xr netintro 4 , +.Xr urtwnfw 4 , .Xr usb 4 , .Xr wlan 4 , .Xr wlan_ccmp 4 , From owner-svn-src-head@FreeBSD.ORG Sat May 3 15:33:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05E009F0; Sat, 3 May 2014 15:33:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6CCC177E; Sat, 3 May 2014 15:33:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s43FXmGW023029; Sat, 3 May 2014 15:33:48 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43FXmQJ023028; Sat, 3 May 2014 15:33:48 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405031533.s43FXmQJ023028@svn.freebsd.org> From: Christian Brueffer Date: Sat, 3 May 2014 15:33:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265270 - head/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 15:33:49 -0000 Author: brueffer Date: Sat May 3 15:33:48 2014 New Revision: 265270 URL: http://svnweb.freebsd.org/changeset/base/265270 Log: Add urtwn(4) to the hardware notes. MFC after: 1 week Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Sat May 3 15:31:54 2014 (r265269) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Sat May 3 15:33:48 2014 (r265270) @@ -1026,6 +1026,8 @@ &hwlist.urtw; + &hwlist.urtwn; + [&arch.amd64;, &arch.i386;, &arch.pc98;] Lucent Technologies WaveLAN/IEEE 802.11b wireless network adapters and workalikes using the Lucent Hermes, Intersil PRISM-II, From owner-svn-src-head@FreeBSD.ORG Sat May 3 16:11:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2EE4B88B; Sat, 3 May 2014 16:11:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BF3A1A85; Sat, 3 May 2014 16:11:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s43GBtqP039828; Sat, 3 May 2014 16:11:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43GBtXV039826; Sat, 3 May 2014 16:11:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405031611.s43GBtXV039826@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 3 May 2014 16:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265275 - head/sys/fs/msdosfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 16:11:56 -0000 Author: kib Date: Sat May 3 16:11:55 2014 New Revision: 265275 URL: http://svnweb.freebsd.org/changeset/base/265275 Log: After r254627, the deupdate() started writing the directory entries to disk. That has a side effect of corrupting the "." entries names on rename, since the call to createde() in the msdosfs_rename() sets the de_Name to the target name. If any change to the directory attributes is performed, the wrong name is written back to the on-disk direntry on update. Overwrite the de_Name for the directories on rename to correct the dot name. Submitted by: bde MFC after: 1 week Modified: head/sys/fs/msdosfs/msdosfs_vnops.c Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Sat May 3 16:09:08 2014 (r265274) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Sat May 3 16:11:55 2014 (r265275) @@ -1240,6 +1240,17 @@ abortit: VOP_UNLOCK(fvp, 0); goto bad; } + /* + * If ip is for a directory, then its name should always + * be "." since it is for the directory entry in the + * directory itself (msdosfs_lookup() always translates + * to the "." entry so as to get a unique denode, except + * for the root directory there are different + * complications). However, we just corrupted its name + * to pass the correct name to createde(). Undo this. + */ + if ((ip->de_Attributes & ATTR_DIRECTORY) != 0) + bcopy(oldname, ip->de_Name, 11); ip->de_refcnt++; zp->de_fndoffset = from_diroffset; error = removede(zp, ip); From owner-svn-src-head@FreeBSD.ORG Sat May 3 16:18:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51562A47; Sat, 3 May 2014 16:18:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3ED5A1AAB; Sat, 3 May 2014 16:18:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s43GIhdw040752; Sat, 3 May 2014 16:18:43 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43GIh7N040751; Sat, 3 May 2014 16:18:43 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405031618.s43GIh7N040751@svn.freebsd.org> From: Mark Johnston Date: Sat, 3 May 2014 16:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265276 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 16:18:43 -0000 Author: markj Date: Sat May 3 16:18:42 2014 New Revision: 265276 URL: http://svnweb.freebsd.org/changeset/base/265276 Log: Fix a typo. MFC after: 3 days Modified: head/lib/libutil/kinfo_getfile.3 Modified: head/lib/libutil/kinfo_getfile.3 ============================================================================== --- head/lib/libutil/kinfo_getfile.3 Sat May 3 16:11:55 2014 (r265275) +++ head/lib/libutil/kinfo_getfile.3 Sat May 3 16:18:42 2014 (r265276) @@ -48,7 +48,7 @@ field contains the process identifier. This should be the a process that you have privilege to access. The .Ar cntp -field is allows the caller to know how many records are returned. +field allows the caller to know how many records are returned. .Pp This function is a wrapper around .Xr sysctl 3 From owner-svn-src-head@FreeBSD.ORG Sat May 3 16:28:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DDA35312; Sat, 3 May 2014 16:28:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE5121B93; Sat, 3 May 2014 16:28:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s43GStFn045296; Sat, 3 May 2014 16:28:55 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43GSsfH045292; Sat, 3 May 2014 16:28:54 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201405031628.s43GSsfH045292@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 3 May 2014 16:28:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265279 - in head/sys: net netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 16:28:56 -0000 Author: melifaro Date: Sat May 3 16:28:54 2014 New Revision: 265279 URL: http://svnweb.freebsd.org/changeset/base/265279 Log: Pass radix head ptr along with rte to rtexpunge(). Rename rtexpunge to rt_expunge(). Modified: head/sys/net/route.c head/sys/net/route.h head/sys/netinet/in_rmx.c head/sys/netinet6/in6_ifattach.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat May 3 16:24:41 2014 (r265278) +++ head/sys/net/route.c Sat May 3 16:28:54 2014 (r265279) @@ -898,7 +898,7 @@ rt_getifa_fib(struct rt_addrinfo *info, * The route must be locked. */ int -rtexpunge(struct rtentry *rt) +rt_expunge(struct radix_node_head *rnh, struct rtentry *rt) { #if !defined(RADIX_MPATH) struct radix_node *rn; @@ -907,17 +907,10 @@ rtexpunge(struct rtentry *rt) int fib; struct rtentry *rt0; #endif - struct radix_node_head *rnh; struct ifaddr *ifa; int error = 0; - /* - * Find the correct routing tree to use for this Address Family - */ - rnh = rt_tables_get_rnh(rt->rt_fibnum, rt_key(rt)->sa_family); RT_LOCK_ASSERT(rt); - if (rnh == NULL) - return (EAFNOSUPPORT); RADIX_NODE_HEAD_LOCK_ASSERT(rnh); #ifdef RADIX_MPATH Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sat May 3 16:24:41 2014 (r265278) +++ head/sys/net/route.h Sat May 3 16:28:54 2014 (r265279) @@ -371,7 +371,7 @@ int rtsock_routemsg(int, struct ifnet *i * RTFREE() uses an unlocked entry. */ -int rtexpunge(struct rtentry *); +int rt_expunge(struct radix_node_head *, struct rtentry *); void rtfree(struct rtentry *); int rt_check(struct rtentry **, struct rtentry **, struct sockaddr *); Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Sat May 3 16:24:41 2014 (r265278) +++ head/sys/netinet/in_rmx.c Sat May 3 16:28:54 2014 (r265279) @@ -169,9 +169,8 @@ in_clsroute(struct radix_node *rn, struc if (V_rtq_reallyold != 0) { rt->rt_flags |= RTPRF_OURS; rt->rt_expire = time_uptime + V_rtq_reallyold; - } else { - rtexpunge(rt); - } + } else + rt_expunge(head, rt); } struct rtqk_arg { @@ -388,6 +387,7 @@ in_detachhead(void **head, int off) * plug back in. */ struct in_ifadown_arg { + struct radix_node_head *rnh; struct ifaddr *ifa; int del; }; @@ -411,7 +411,7 @@ in_ifadownkill(struct radix_node *rn, vo * Disconnect it from the tree and permit protocols * to cleanup. */ - rtexpunge(rt); + rt_expunge(ap->rnh, rt); /* * At this point it is an rttrash node, and in case * the above is the only reference we must free it. Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Sat May 3 16:24:41 2014 (r265278) +++ head/sys/netinet6/in6_ifattach.c Sat May 3 16:28:54 2014 (r265279) @@ -863,7 +863,7 @@ in6_ifdetach(struct ifnet *ifp) RT_DEFAULT_FIB); if (rt) { if (rt->rt_ifp == ifp) - rtexpunge(rt); + rt_expunge(rnh, rt); RTFREE_LOCKED(rt); } RADIX_NODE_HEAD_UNLOCK(rnh); From owner-svn-src-head@FreeBSD.ORG Sat May 3 16:38:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C74B9949; Sat, 3 May 2014 16:38:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B46211C6D; Sat, 3 May 2014 16:38:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s43Gc5kj049405; Sat, 3 May 2014 16:38:05 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43Gc5uT049404; Sat, 3 May 2014 16:38:05 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201405031638.s43Gc5uT049404@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 3 May 2014 16:38:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265280 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 16:38:05 -0000 Author: melifaro Date: Sat May 3 16:38:05 2014 New Revision: 265280 URL: http://svnweb.freebsd.org/changeset/base/265280 Log: Remove additional fib checks from rtalloc1_fib. It looks like current consumers are either unaware of MRT (and uses RT_DEFAULT_FIB implicitly) or know what thay are doing, In latter case they will be either hit by KASSERT or ESCRH will be returned due to NULL rnh. Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sat May 3 16:28:54 2014 (r265279) +++ head/sys/net/route.c Sat May 3 16:38:05 2014 (r265280) @@ -402,15 +402,6 @@ rtalloc1_fib(struct sockaddr *dst, int r int needlock; KASSERT((fibnum < rt_numfibs), ("rtalloc1_fib: bad fibnum")); - switch (dst->sa_family) { - case AF_INET6: - case AF_INET: - /* We support multiple FIBs. */ - break; - default: - fibnum = RT_DEFAULT_FIB; - break; - } rnh = rt_tables_get_rnh(fibnum, dst->sa_family); newrt = NULL; if (rnh == NULL) From owner-svn-src-head@FreeBSD.ORG Sat May 3 17:57:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5F1B719; Sat, 3 May 2014 17:57:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EAE4148A; Sat, 3 May 2014 17:57:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s43Hv6dj082214; Sat, 3 May 2014 17:57:06 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43Hv6B2082213; Sat, 3 May 2014 17:57:06 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201405031757.s43Hv6B2082213@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 3 May 2014 17:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265283 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 17:57:06 -0000 Author: melifaro Date: Sat May 3 17:57:06 2014 New Revision: 265283 URL: http://svnweb.freebsd.org/changeset/base/265283 Log: Fix sysctl_ifmalist() broken in r265019. Reported by: Olivier Cochard-Labbé MFC with: r265019 Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sat May 3 17:39:03 2014 (r265282) +++ head/sys/net/rtsock.c Sat May 3 17:57:06 2014 (r265283) @@ -1741,7 +1741,7 @@ sysctl_ifmalist(int af, struct walkarg * info.rti_info[RTAX_GATEWAY] = (ifma->ifma_addr->sa_family != AF_LINK) ? ifma->ifma_lladdr : NULL; - error = rtsock_msg_buffer(RTM_NEWADDR, &info, w, &len); + error = rtsock_msg_buffer(RTM_NEWMADDR, &info, w, &len); if (error != 0) goto done; if (w->w_req && w->w_tmem) { From owner-svn-src-head@FreeBSD.ORG Sat May 3 18:50:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0DC6307; Sat, 3 May 2014 18:50:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD36B184F; Sat, 3 May 2014 18:50:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s43IomeL004257; Sat, 3 May 2014 18:50:48 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43Iom8Q004254; Sat, 3 May 2014 18:50:48 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201405031850.s43Iom8Q004254@svn.freebsd.org> From: Sergey Kandaurov Date: Sat, 3 May 2014 18:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265285 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 18:50:48 -0000 Author: pluknet Date: Sat May 3 18:50:47 2014 New Revision: 265285 URL: http://svnweb.freebsd.org/changeset/base/265285 Log: Documented the pget(9) system kernel interface. Reviewed by: trociny, kib MFC after: 1 week Added: head/share/man/man9/pget.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sat May 3 18:12:26 2014 (r265284) +++ head/share/man/man9/Makefile Sat May 3 18:50:47 2014 (r265285) @@ -192,6 +192,7 @@ MAN= accept_filter.9 \ pci.9 \ pfil.9 \ pfind.9 \ + pget.9 \ pgfind.9 \ physio.9 \ pmap.9 \ Added: head/share/man/man9/pget.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/pget.9 Sat May 3 18:50:47 2014 (r265285) @@ -0,0 +1,105 @@ +.\" Copyright (c) 2011 Sergey Kandaurov +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 3, 2014 +.Dt PGET 9 +.Os +.Sh NAME +.Nm pget +.Nd locate a process by number +.Sh SYNOPSIS +.In sys/param.h +.In sys/proc.h +.Ft int +.Fn pget "pid_t pid" "int flags" "struct proc **pp" +.Sh DESCRIPTION +This function +takes a +.Fa pid +as its argument, +which can be either a process or thread id, +and fills a pointer to the +.Vt proc +structure in +.Fa *pp . +In the latter case, a process owning the specified thread is looked for. +The actual operation is performed by invoking the +.Xr pfind 9 +function. +The found process is returned locked. +Only for +.Dv PGET_HOLD +case it is returned unlocked (but held). +The +.Fn pget +function can +perform additional manipulations, depending on a +.Fa flags +argument. +.Pp +The +.Fa flags +argument is the logical OR of some subset of: +.Bl -tag -width ".Dv PGET_NOTINEXEC" +.It Dv PGET_HOLD +If set, the found process will be referenced and unlocked. +.It Dv PGET_CANSEE +If set, the found process will be checked for its visibility. +See +.Xr p_cansee 9 . +.It Dv PGET_CANDEBUG +If set, the found process will be checked for its debuggability. +See +.Xr p_candebug 9 . +.It Dv PGET_ISCURRENT +If set, the found process will be checked that it matches the current +process context. +.It Dv PGET_NOTWEXIT +If set, the found process will be checked that it does not have the process +flag +.Dv P_WEXIT +set. +.It Dv PGET_NOTINEXEC +If set, the found process will be checked that it does not have the process +flag +.Dv P_INEXEC +set. +.It Dv PGET_NOTID +If set, +.Fa pid +is not assumed as a thread id for values larger than +.Dv PID_MAX . +.It Dv PGET_WANTREAD +A shorthand for +.Pq Dv PGET_HOLD | PGET_CANDEBUG | PGET_NOTWEXIT . +.El +.Sh RETURN VALUES +If the process is found in the specified way, then zero is returned, +otherwise an appropriate error code is returned. +.Sh SEE ALSO +.Xr p_candebug 9 , +.Xr p_cansee 9 , +.Xr pfind 9 From owner-svn-src-head@FreeBSD.ORG Sat May 3 19:57:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D483408; Sat, 3 May 2014 19:57:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AA351E64; Sat, 3 May 2014 19:57:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s43JvIQ2035996; Sat, 3 May 2014 19:57:18 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43JvIv1035995; Sat, 3 May 2014 19:57:18 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201405031957.s43JvIv1035995@svn.freebsd.org> From: Bryan Venteicher Date: Sat, 3 May 2014 19:57:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265287 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 19:57:18 -0000 Author: bryanv Date: Sat May 3 19:57:17 2014 New Revision: 265287 URL: http://svnweb.freebsd.org/changeset/base/265287 Log: Fix SYNOPSIS ("device if_vtnet" -> "device vtnet"). Obtained from: DragonFlyBSD MFC after: 3 days Modified: head/share/man/man4/vtnet.4 Modified: head/share/man/man4/vtnet.4 ============================================================================== --- head/share/man/man4/vtnet.4 Sat May 3 19:40:41 2014 (r265286) +++ head/share/man/man4/vtnet.4 Sat May 3 19:57:17 2014 (r265287) @@ -35,7 +35,7 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent -.Cd "device if_vtnet" +.Cd "device vtnet" .Ed .Pp Alternatively, to load the driver as a From owner-svn-src-head@FreeBSD.ORG Sat May 3 20:22:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA21CB7B; Sat, 3 May 2014 20:22:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C706A1232; Sat, 3 May 2014 20:22:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s43KMDwk051481; Sat, 3 May 2014 20:22:13 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43KMDDI051480; Sat, 3 May 2014 20:22:13 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201405032022.s43KMDDI051480@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 3 May 2014 20:22:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265288 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 20:22:13 -0000 Author: melifaro Date: Sat May 3 20:22:13 2014 New Revision: 265288 URL: http://svnweb.freebsd.org/changeset/base/265288 Log: Fix panic on IPv4 address removal introduced in r265279. Reported by: Trond Endrestøl MFC with: r265279 Modified: head/sys/netinet/in_rmx.c Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Sat May 3 19:57:17 2014 (r265287) +++ head/sys/netinet/in_rmx.c Sat May 3 20:22:13 2014 (r265288) @@ -441,6 +441,7 @@ in_ifadown(struct ifaddr *ifa, int delet for ( fibnum = 0; fibnum < rt_numfibs; fibnum++) { rnh = rt_tables_get_rnh(fibnum, AF_INET); + arg.rnh = rnh; arg.ifa = ifa; arg.del = delete; RADIX_NODE_HEAD_LOCK(rnh); From owner-svn-src-head@FreeBSD.ORG Sat May 3 20:33:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CA08166; Sat, 3 May 2014 20:33:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5317130D; Sat, 3 May 2014 20:33:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s43KX01A056958; Sat, 3 May 2014 20:33:00 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s43KX0Jl056950; Sat, 3 May 2014 20:33:00 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405032033.s43KX0Jl056950@svn.freebsd.org> From: Luiz Otavio O Souza Date: Sat, 3 May 2014 20:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265289 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2014 20:33:01 -0000 Author: loos Date: Sat May 3 20:33:00 2014 New Revision: 265289 URL: http://svnweb.freebsd.org/changeset/base/265289 Log: Really sort out the headers. sys/systm.h must always come after sys/param.h. Remove sys/types.h which should never be included together with sys/param.h. Add sys/malloc.h for correctness even if it seems to don't be needed. Remove more unused headers found by unusedinc (from bde@) and tested with a universe build. Reported by: bde Modified: head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Sat May 3 20:22:13 2014 (r265288) +++ head/sys/dev/gpio/gpiobus.c Sat May 3 20:33:00 2014 (r265289) @@ -28,13 +28,11 @@ __FBSDID("$FreeBSD$"); #include +#include #include -#include #include #include #include -#include -#include #include Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Sat May 3 20:22:13 2014 (r265288) +++ head/sys/dev/gpio/gpiobusvar.h Sat May 3 20:33:00 2014 (r265289) @@ -32,7 +32,6 @@ #include "opt_platform.h" -#include #include #include Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Sat May 3 20:22:13 2014 (r265288) +++ head/sys/dev/gpio/ofw_gpiobus.c Sat May 3 20:33:00 2014 (r265289) @@ -30,18 +30,16 @@ __FBSDID("$FreeBSD$"); #include +#include #include -#include #include +#include #include -#include #include #include -#include #include "gpio_if.h" -#include "gpiobus_if.h" static int ofw_gpiobus_parse_gpios(struct gpiobus_softc *, struct gpiobus_ivar *, phandle_t); From owner-svn-src-head@FreeBSD.ORG Sun May 4 01:32:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2AC93695; Sun, 4 May 2014 01:32:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17E741BA1; Sun, 4 May 2014 01:32:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s441WtH4090629; Sun, 4 May 2014 01:32:55 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s441WtQr090628; Sun, 4 May 2014 01:32:55 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405040132.s441WtQr090628@svn.freebsd.org> From: Glen Barber Date: Sun, 4 May 2014 01:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265303 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 01:32:56 -0000 Author: gjb Date: Sun May 4 01:32:55 2014 New Revision: 265303 URL: http://svnweb.freebsd.org/changeset/base/265303 Log: Document r265132, addition of full(4). Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun May 4 01:03:54 2014 (r265302) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun May 4 01:32:55 2014 (r265303) @@ -104,6 +104,14 @@ Kernel Changes + The &man.full.4; device has been added, + and the &man.lindev.4; device has been removed. Prior to this + change, &man.lindev.4; provided only the + /dev/null character device, returning + ENOSPC on write attempts. As this device is + not specific to &linux;, a native &os; version has been + added. + Support for GPS ports has been added to &man.uhso.4;. From owner-svn-src-head@FreeBSD.ORG Sun May 4 01:32:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A13827CA; Sun, 4 May 2014 01:32:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F4FD1BA4; Sun, 4 May 2014 01:32:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s441WxMO090705; Sun, 4 May 2014 01:32:59 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s441Wxgt090704; Sun, 4 May 2014 01:32:59 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405040132.s441Wxgt090704@svn.freebsd.org> From: Glen Barber Date: Sun, 4 May 2014 01:32:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265305 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 01:32:59 -0000 Author: gjb Date: Sun May 4 01:32:59 2014 New Revision: 265305 URL: http://svnweb.freebsd.org/changeset/base/265305 Log: Wrap lindev(4) references in tags. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun May 4 01:32:57 2014 (r265304) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun May 4 01:32:59 2014 (r265305) @@ -105,9 +105,9 @@ Kernel Changes The &man.full.4; device has been added, - and the lindev(4) device has been removed. Prior to this - change, lindev(4) provided only the - /dev/null character device, returning + and the lindev(4) device has been removed. + Prior to this change, lindev(4) provided only + the /dev/null character device, returning ENOSPC on write attempts. As this device is not specific to &linux;, a native &os; version has been added. From owner-svn-src-head@FreeBSD.ORG Sun May 4 01:32:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 060B073E; Sun, 4 May 2014 01:32:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB4BD1BA2; Sun, 4 May 2014 01:32:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s441WvHj090665; Sun, 4 May 2014 01:32:57 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s441Wv6Y090663; Sun, 4 May 2014 01:32:57 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405040132.s441Wv6Y090663@svn.freebsd.org> From: Glen Barber Date: Sun, 4 May 2014 01:32:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265304 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 01:32:58 -0000 Author: gjb Date: Sun May 4 01:32:57 2014 New Revision: 265304 URL: http://svnweb.freebsd.org/changeset/base/265304 Log: Dereference man.lindev.4 macros, since the device is removed. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun May 4 01:32:55 2014 (r265303) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun May 4 01:32:57 2014 (r265304) @@ -105,8 +105,8 @@ Kernel Changes The &man.full.4; device has been added, - and the &man.lindev.4; device has been removed. Prior to this - change, &man.lindev.4; provided only the + and the lindev(4) device has been removed. Prior to this + change, lindev(4) provided only the /dev/null character device, returning ENOSPC on write attempts. As this device is not specific to &linux;, a native &os; version has been From owner-svn-src-head@FreeBSD.ORG Sun May 4 01:33:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C8139A8; Sun, 4 May 2014 01:33:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 504B61BA6; Sun, 4 May 2014 01:33:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s441X1rp090804; Sun, 4 May 2014 01:33:01 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s441X10i090802; Sun, 4 May 2014 01:33:01 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405040133.s441X10i090802@svn.freebsd.org> From: Glen Barber Date: Sun, 4 May 2014 01:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265306 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 01:33:02 -0000 Author: gjb Date: Sun May 4 01:33:00 2014 New Revision: 265306 URL: http://svnweb.freebsd.org/changeset/base/265306 Log: Document r264601, addition of if_nf10bmac(4) (with no corresponding manual page, so tags are used). Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun May 4 01:32:59 2014 (r265305) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun May 4 01:33:00 2014 (r265306) @@ -112,6 +112,15 @@ not specific to &linux;, a native &os; version has been added. + The if_nf10bmac(4) + device has been added, providing support for NetFPGA-10G + Embedded CPU Ethernet Core. + + + The if_nf10bmac(4) driver operates on + the FPGA, and is not suited for the PCI host interface. + + Support for GPS ports has been added to &man.uhso.4;. From owner-svn-src-head@FreeBSD.ORG Sun May 4 01:33:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 270FF9EE; Sun, 4 May 2014 01:33:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14A251BA7; Sun, 4 May 2014 01:33:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s441X2vU090870; Sun, 4 May 2014 01:33:02 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s441X2Di090869; Sun, 4 May 2014 01:33:02 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405040133.s441X2Di090869@svn.freebsd.org> From: Glen Barber Date: Sun, 4 May 2014 01:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265307 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 01:33:03 -0000 Author: gjb Date: Sun May 4 01:33:02 2014 New Revision: 265307 URL: http://svnweb.freebsd.org/changeset/base/265307 Log: Document r265229[1], r265249[2]: '-J' flag added to ps(1) [1], and top(1) [2]. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun May 4 01:33:00 2014 (r265306) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun May 4 01:33:02 2014 (r265307) @@ -231,6 +231,17 @@ Userland Changes + The &man.top.1; utility has been updated + to filter by &man.jail.8; ID or name, in followup to the + &man.ps.1; change in r265229. + + The &man.ps.1; utility has been + updated to include the -J flag, used to + filter output by matching &man.jail.8; IDs and names. + Additionally, argument 0 can be used to + -J to only list processes running on the + host system. + Support for displaying VPD for PCI devices via &man.pciconf.8; has been added. From owner-svn-src-head@FreeBSD.ORG Sun May 4 02:48:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC2B2507; Sun, 4 May 2014 02:48:48 +0000 (UTC) Received: from mail-we0-x230.google.com (mail-we0-x230.google.com [IPv6:2a00:1450:400c:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE39A11AE; Sun, 4 May 2014 02:48:47 +0000 (UTC) Received: by mail-we0-f176.google.com with SMTP id q59so3774020wes.35 for ; Sat, 03 May 2014 19:48:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=4RfkdfFIafN5RV4BO34VxL6JEWLwws6/GpdvvQJsppA=; b=l5wJPvCeYr/yksXnyLgu4H1RDRemUeaOC/jxDIL536RaTYZQ63NVFEhhMv7h+bnqsL A2QF9XIv9bJHs7PqMHs1KLkBCEw0wRizL6ldkv/hxkL42P0/M+vy2shrFgvS7SzihHTL mm+zk2uO/DArB/ewmU3iDU/LSkspLKSNkGoGV4/z1a3D5m0IwN3Rwx4Fdc9gfmuuUbRy KZQMzwazaQyu3iIFcrGGYrRW4hvgQnSNWXs28NZDXWO1v5WbHgY0OR2EhMP47X9edYT5 d2se9dBcmTyGymMedGgbvHz41UTnmXhc8tkeQR2Mk4BgcZdKwglmRJqLnJ6UtRkGo8QV QY8g== MIME-Version: 1.0 X-Received: by 10.194.6.106 with SMTP id z10mr20842174wjz.1.1399171724961; Sat, 03 May 2014 19:48:44 -0700 (PDT) Received: by 10.216.168.194 with HTTP; Sat, 3 May 2014 19:48:44 -0700 (PDT) In-Reply-To: <20140502180115.I1337@besplex.bde.org> References: <201405011409.s41E9mun075016@svn.freebsd.org> <20140502180115.I1337@besplex.bde.org> Date: Sat, 3 May 2014 23:48:44 -0300 Message-ID: Subject: Re: svn commit: r265191 - head/sys/dev/gpio From: Luiz Otavio O Souza To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Cc: Luiz Otavio O Souza , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 02:48:48 -0000 On Fri, May 2, 2014 at 5:34 AM, Bruce Evans wrote: > On Thu, 1 May 2014, Luiz Otavio O Souza wrote: > >> Log: >> Remove unnecessary headers. Sort out the headers. Add a missing header >> on >> ofw_gpiobus.c (it was working because of sys/libkern.h). > > > Do you use /usr/src/tools/tools/kerninclude/kerninclude.sh to find the > unused includes? There are many false positives and negatives which are > hard to find without a lot of testing. kerninclude.sh automates some of > the testing. I think it is rarely used and has rotted. A full universe > build is probably required, but kerninclude.sh is i386-centric and only > tests LINT, GENERIC and GENERIC98 (GENERIC98 last existed in the source > tree in FreeBSD-3, but the script creates it by copying GENERIC and > building with pc98 options). > > I prefer my unusedinc script. It is easier to run 1 on file at a time, > but does less hacking to reduce the false positives and negatives. I wasn't aware of the existence of kerninclude.sh. I usually go with clearly unused headers (not as aggressive as with the automated tools). Much of the code i touch has a lot of copy and paste leftovers. A few examples can be found in sys/etherswitch/arswitch/* which includes iic headers when it isn't needed, but i avoid to make these changes until i have time to test it. Your script seems to be less complex to use and, indeed, has helped to find all the unused includes in these files. As for test, i usually run my changes through a universe build anyway. Most of the last minute changes (which won't pass by universe test) tends to bring issues. > > >> Modified: head/sys/dev/gpio/gpiobus.c >> >> ============================================================================== >> --- head/sys/dev/gpio/gpiobus.c Thu May 1 14:08:19 2014 (r265190) >> +++ head/sys/dev/gpio/gpiobus.c Thu May 1 14:09:47 2014 (r265191) >> @@ -28,21 +28,16 @@ >> __FBSDID("$FreeBSD$"); >> >> #include >> -#include > > > This unsorts the includes. must be included after > , and should be always included, since other headers may > depend on it (for things like KASSERT() in inline functions). Some > broken headers include it nested. This makes it difficult to tell > whether it is used. Some other headers that don't do this may > compile accidentally because they are included after the polluted > ones. Fixed. > >> +#include >> +#include >> +#include >> #include >> #include >> -#include >> -#include > > > is probably used. It is included nested in many headers, > and this is not considered pollution, unlike for , but it > makes it very hard to determine if is included as needed > in other headers and .c files. > > kerninclude.sh attempts to determine if headers like are > needed by doing things like replacing it by an empty header in some > contexts. I suspect this doesn't handle the full complications. > Ideally, the include of in a .c file should be explicit > iff the .c files uses any queue macro. No queue macros are in use in these files. > >> -#include >> +#include >> #include > > > is certainly not needed. It is standard pollution in > , and it is a style bug to not depend on that. It is > also usually a style bug (in kernel code) to include > and not include . Many things depend on the standard > pollution, or might be changed to depend on it. Fixed, this is even documented on style(9)... My bad... > >> Modified: head/sys/dev/gpio/ofw_gpiobus.c >> >> ============================================================================== >> --- head/sys/dev/gpio/ofw_gpiobus.c Thu May 1 14:08:19 2014 >> (r265190) >> +++ head/sys/dev/gpio/ofw_gpiobus.c Thu May 1 14:09:47 2014 >> (r265191) >> @@ -33,17 +33,13 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> -#include > > > Correct. is standard pollution in , and it > is a style bug to include it directly. > > >> -#include >> #include >> -#include >> +#include > > > Not using mutexes may indicate missing locking. I think this works because > almost everything in new-bus is Giant-locked and Giant locking hides its > own details very well. Mutexes are in use here, but sys/lock.h and sys/mutex.h comes from gpiobusvar.h (which i may need to validate again). [...] Thanks for the review, it is greatly appreciated. Regards, Luiz From owner-svn-src-head@FreeBSD.ORG Sun May 4 03:34:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26F4A28B; Sun, 4 May 2014 03:34:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 141F7169C; Sun, 4 May 2014 03:34:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s443YWVB042312; Sun, 4 May 2014 03:34:32 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s443YWZW042309; Sun, 4 May 2014 03:34:32 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405040334.s443YWZW042309@svn.freebsd.org> From: Mark Johnston Date: Sun, 4 May 2014 03:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265308 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 03:34:33 -0000 Author: markj Date: Sun May 4 03:34:32 2014 New Revision: 265308 URL: http://svnweb.freebsd.org/changeset/base/265308 Log: If the traced process stops because it received a signal, libproc needs to ensure that the signal is forwarded when proc_continue() is called. MFC after: 3 weeks Modified: head/lib/libproc/libproc.h head/lib/libproc/proc_bkpt.c head/lib/libproc/proc_util.c Modified: head/lib/libproc/libproc.h ============================================================================== --- head/lib/libproc/libproc.h Sun May 4 01:33:02 2014 (r265307) +++ head/lib/libproc/libproc.h Sun May 4 03:34:32 2014 (r265308) @@ -102,6 +102,7 @@ typedef struct lwpstatus { #define PR_FAULTED 2 #define PR_SYSENTRY 3 #define PR_SYSEXIT 4 +#define PR_SIGNALLED 5 int pr_what; #define FLTBPT -1 } lwpstatus_t; Modified: head/lib/libproc/proc_bkpt.c ============================================================================== --- head/lib/libproc/proc_bkpt.c Sun May 4 01:33:02 2014 (r265307) +++ head/lib/libproc/proc_bkpt.c Sun May 4 03:34:32 2014 (r265308) @@ -55,13 +55,6 @@ __FBSDID("$FreeBSD$"); #error "Add support for your architecture" #endif -static void -proc_cont(struct proc_handle *phdl) -{ - - ptrace(PT_CONTINUE, proc_getpid(phdl), (caddr_t)1, 0); -} - static int proc_stop(struct proc_handle *phdl) { @@ -87,7 +80,7 @@ proc_bkptset(struct proc_handle *phdl, u { struct ptrace_io_desc piod; unsigned long paddr, caddr; - int ret = 0; + int ret = 0, stopped; *saved = 0; if (phdl->status == PS_DEAD || phdl->status == PS_UNDEAD || @@ -98,9 +91,12 @@ proc_bkptset(struct proc_handle *phdl, u DPRINTFX("adding breakpoint at 0x%lx", address); - if (phdl->status != PS_STOP) + stopped = 0; + if (phdl->status != PS_STOP) { if (proc_stop(phdl) != 0) return (-1); + stopped = 1; + } /* * Read the original instruction. @@ -135,9 +131,9 @@ proc_bkptset(struct proc_handle *phdl, u } done: - if (phdl->status != PS_STOP) + if (stopped) /* Restart the process if we had to stop it. */ - proc_cont(phdl); + proc_continue(phdl); return (ret); } @@ -148,7 +144,7 @@ proc_bkptdel(struct proc_handle *phdl, u { struct ptrace_io_desc piod; unsigned long paddr, caddr; - int ret = 0; + int ret = 0, stopped; if (phdl->status == PS_DEAD || phdl->status == PS_UNDEAD || phdl->status == PS_IDLE) { @@ -158,9 +154,12 @@ proc_bkptdel(struct proc_handle *phdl, u DPRINTFX("removing breakpoint at 0x%lx", address); - if (phdl->status != PS_STOP) + stopped = 0; + if (phdl->status != PS_STOP) { if (proc_stop(phdl) != 0) return (-1); + stopped = 1; + } /* * Overwrite the breakpoint instruction that we setup previously. @@ -177,9 +176,9 @@ proc_bkptdel(struct proc_handle *phdl, u ret = -1; } - if (phdl->status != PS_STOP) + if (stopped) /* Restart the process if we had to stop it. */ - proc_cont(phdl); + proc_continue(phdl); return (ret); } Modified: head/lib/libproc/proc_util.c ============================================================================== --- head/lib/libproc/proc_util.c Sun May 4 01:33:02 2014 (r265307) +++ head/lib/libproc/proc_util.c Sun May 4 03:34:32 2014 (r265308) @@ -35,10 +35,9 @@ #include #include #include -#include -#include #include #include +#include #include "_libproc.h" int @@ -59,11 +58,14 @@ proc_clearflags(struct proc_handle *phdl int proc_continue(struct proc_handle *phdl) { + int pending = 0; if (phdl == NULL) return (-1); - if (ptrace(PT_CONTINUE, phdl->pid, (caddr_t)(uintptr_t) 1, 0) != 0) + if (phdl->status == PS_STOP && WSTOPSIG(phdl->wstat) != SIGTRAP) + pending = WSTOPSIG(phdl->wstat); + if (ptrace(PT_CONTINUE, phdl->pid, (caddr_t)(uintptr_t)1, pending) != 0) return (-1); phdl->status = PS_RUN; @@ -208,12 +210,16 @@ proc_getlwpstatus(struct proc_handle *ph return (NULL); siginfo = &lwpinfo.pl_siginfo; if (lwpinfo.pl_event == PL_EVENT_SIGNAL && - (lwpinfo.pl_flags & PL_FLAG_SI) && - siginfo->si_signo == SIGTRAP && - (siginfo->si_code == TRAP_BRKPT || - siginfo->si_code == TRAP_TRACE)) { - psp->pr_why = PR_FAULTED; - psp->pr_what = FLTBPT; + (lwpinfo.pl_flags & PL_FLAG_SI) != 0) { + if (siginfo->si_signo == SIGTRAP && + (siginfo->si_code == TRAP_BRKPT || + siginfo->si_code == TRAP_TRACE)) { + psp->pr_why = PR_FAULTED; + psp->pr_what = FLTBPT; + } else { + psp->pr_why = PR_SIGNALLED; + psp->pr_what = siginfo->si_signo; + } } else if (lwpinfo.pl_flags & PL_FLAG_SCE) { psp->pr_why = PR_SYSENTRY; } else if (lwpinfo.pl_flags & PL_FLAG_SCX) { From owner-svn-src-head@FreeBSD.ORG Sun May 4 03:37:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2EEE467; Sun, 4 May 2014 03:37:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E043216C2; Sun, 4 May 2014 03:37:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s443bd9W042704; Sun, 4 May 2014 03:37:39 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s443bdZt042703; Sun, 4 May 2014 03:37:39 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405040337.s443bdZt042703@svn.freebsd.org> From: Mark Johnston Date: Sun, 4 May 2014 03:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265309 - head/cddl/lib/libdtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 03:37:40 -0000 Author: markj Date: Sun May 4 03:37:39 2014 New Revision: 265309 URL: http://svnweb.freebsd.org/changeset/base/265309 Log: Remove a duplicate definition. MFC after: 3 days Modified: head/cddl/lib/libdtrace/libproc_compat.h Modified: head/cddl/lib/libdtrace/libproc_compat.h ============================================================================== --- head/cddl/lib/libdtrace/libproc_compat.h Sun May 4 03:34:32 2014 (r265308) +++ head/cddl/lib/libdtrace/libproc_compat.h Sun May 4 03:37:39 2014 (r265309) @@ -54,7 +54,6 @@ #define Psetbkpt proc_bkptset #define Psetflags proc_setflags #define Pstate proc_state -#define Pstate proc_state #define Psymbol_iter_by_addr proc_iter_symbyaddr #define Punsetflags proc_clearflags #define Pupdate_maps(p) do { } while (0) From owner-svn-src-head@FreeBSD.ORG Sun May 4 04:01:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D2B4715; Sun, 4 May 2014 04:01:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBAEC1892; Sun, 4 May 2014 04:01:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4441RJI052686; Sun, 4 May 2014 04:01:27 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4441Ql3052377; Sun, 4 May 2014 04:01:26 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405040401.s4441Ql3052377@svn.freebsd.org> From: Luiz Otavio O Souza Date: Sun, 4 May 2014 04:01:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265310 - in head/sys/dev: gpio ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 04:01:28 -0000 Author: loos Date: Sun May 4 04:01:26 2014 New Revision: 265310 URL: http://svnweb.freebsd.org/changeset/base/265310 Log: Move gpiobus routines to dev/gpio. Avoid polluting ofw_bus with bus specific parts. Requested by: nwhitehorn Modified: head/sys/dev/gpio/gpio_if.m head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h head/sys/dev/gpio/ofw_gpiobus.c head/sys/dev/ofw/ofw_bus.h head/sys/dev/ofw/ofw_bus_if.m Modified: head/sys/dev/gpio/gpio_if.m ============================================================================== --- head/sys/dev/gpio/gpio_if.m Sun May 4 03:37:39 2014 (r265309) +++ head/sys/dev/gpio/gpio_if.m Sun May 4 04:01:26 2014 (r265310) @@ -31,6 +31,32 @@ INTERFACE gpio; +CODE { + static gpio_map_gpios_t gpio_default_map_gpios; + + int + gpio_default_map_gpios(device_t bus, phandle_t dev, + phandle_t gparent, int gcells, pcell_t *gpios, uint32_t *pin, + uint32_t *flags) + { + /* Propagate up the bus hierarchy until someone handles it. */ + if (device_get_parent(bus) != NULL) + return (GPIO_MAP_GPIOS(device_get_parent(bus), dev, + gparent, gcells, gpios, pin, flags)); + + /* If that fails, then assume the FreeBSD defaults. */ + *pin = gpios[0]; + if (gcells == 2 || gcells == 3) + *flags = gpios[gcells - 1]; + + return (0); + } +}; + +HEADER { + #include +}; + # # Get total number of pins # @@ -100,3 +126,16 @@ METHOD int pin_setflags { uint32_t pin_num; uint32_t flags; }; + +# +# Allow the GPIO controller to map the gpio-specifier on its own. +# +METHOD int map_gpios { + device_t bus; + phandle_t dev; + phandle_t gparent; + int gcells; + pcell_t *gpios; + uint32_t *pin; + uint32_t *flags; +} DEFAULT gpio_default_map_gpios; Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Sun May 4 03:37:39 2014 (r265309) +++ head/sys/dev/gpio/gpiobus.c Sun May 4 04:01:26 2014 (r265310) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include -#include "gpio_if.h" #include "gpiobus_if.h" static int gpiobus_parse_pins(struct gpiobus_softc *, device_t, int); Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Sun May 4 03:37:39 2014 (r265309) +++ head/sys/dev/gpio/gpiobusvar.h Sun May 4 04:01:26 2014 (r265310) @@ -39,6 +39,8 @@ #include #endif +#include "gpio_if.h" + #define GPIOBUS_IVAR(d) (struct gpiobus_ivar *) device_get_ivars(d) #define GPIOBUS_SOFTC(d) (struct gpiobus_softc *) device_get_softc(d) #define GPIOBUS_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) @@ -72,6 +74,13 @@ struct ofw_gpiobus_devinfo { struct ofw_bus_devinfo opd_obdinfo; }; +static __inline int +gpio_map_gpios(device_t bus, phandle_t dev, phandle_t gparent, int gcells, + pcell_t *gpios, uint32_t *pin, uint32_t *flags) +{ + return (GPIO_MAP_GPIOS(bus, dev, gparent, gcells, gpios, pin, flags)); +} + device_t ofw_gpiobus_add_fdt_child(device_t, phandle_t); #endif void gpiobus_print_pins(struct gpiobus_ivar *); Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Sun May 4 03:37:39 2014 (r265309) +++ head/sys/dev/gpio/ofw_gpiobus.c Sun May 4 04:01:26 2014 (r265310) @@ -39,8 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "gpio_if.h" - static int ofw_gpiobus_parse_gpios(struct gpiobus_softc *, struct gpiobus_ivar *, phandle_t); static struct ofw_gpiobus_devinfo *ofw_gpiobus_setup_devinfo(device_t, @@ -180,7 +178,7 @@ ofw_gpiobus_parse_gpios(struct gpiobus_s } /* Get the GPIO pin number and flags. */ - if (ofw_bus_map_gpios(sc->sc_dev, child, gpio, cells, + if (gpio_map_gpios(sc->sc_dev, child, gpio, cells, &gpios[i + 1], &dinfo->pins[j], &dinfo->flags[j]) != 0) { ofw_gpiobus_free_ivars(dinfo); free(gpios, M_DEVBUF); Modified: head/sys/dev/ofw/ofw_bus.h ============================================================================== --- head/sys/dev/ofw/ofw_bus.h Sun May 4 03:37:39 2014 (r265309) +++ head/sys/dev/ofw/ofw_bus.h Sun May 4 04:01:26 2014 (r265310) @@ -76,12 +76,4 @@ ofw_bus_map_intr(device_t dev, phandle_t return (OFW_BUS_MAP_INTR(dev, dev, iparent, icells, intr)); } -static __inline int -ofw_bus_map_gpios(device_t bus, phandle_t dev, phandle_t gparent, int gcells, - pcell_t *gpios, uint32_t *pin, uint32_t *flags) -{ - return (OFW_BUS_MAP_GPIOS(bus, dev, gparent, gcells, gpios, pin, - flags)); -} - #endif /* !_DEV_OFW_OFW_BUS_H_ */ Modified: head/sys/dev/ofw/ofw_bus_if.m ============================================================================== --- head/sys/dev/ofw/ofw_bus_if.m Sun May 4 03:37:39 2014 (r265309) +++ head/sys/dev/ofw/ofw_bus_if.m Sun May 4 04:01:26 2014 (r265310) @@ -58,7 +58,6 @@ CODE { static ofw_bus_get_node_t ofw_bus_default_get_node; static ofw_bus_get_type_t ofw_bus_default_get_type; static ofw_bus_map_intr_t ofw_bus_default_map_intr; - static ofw_bus_map_gpios_t ofw_bus_default_map_gpios; static const struct ofw_bus_devinfo * ofw_bus_default_get_devinfo(device_t bus, device_t dev) @@ -114,24 +113,6 @@ CODE { /* If that fails, then assume a one-domain system */ return (interrupt[0]); } - - int - ofw_bus_default_map_gpios(device_t bus, phandle_t dev, - phandle_t gparent, int gcells, pcell_t *gpios, uint32_t *pin, - uint32_t *flags) - { - /* Propagate up the bus hierarchy until someone handles it. */ - if (device_get_parent(bus) != NULL) - return OFW_BUS_MAP_GPIOS(device_get_parent(bus), dev, - gparent, gcells, gpios, pin, flags); - - /* If that fails, then assume the FreeBSD defaults. */ - *pin = gpios[0]; - if (gcells == 2 || gcells == 3) - *flags = gpios[gcells - 1]; - - return (0); - } }; # Get the ofw_bus_devinfo struct for the device dev on the bus. Used for bus @@ -188,14 +169,3 @@ METHOD int map_intr { int icells; pcell_t *interrupt; } DEFAULT ofw_bus_default_map_intr; - -# Map the GPIO controller specific gpio-specifier to GPIO pin and flags. -METHOD int map_gpios { - device_t bus; - phandle_t dev; - phandle_t gparent; - int gcells; - pcell_t *gpios; - uint32_t *pin; - uint32_t *flags; -} DEFAULT ofw_bus_default_map_gpios; From owner-svn-src-head@FreeBSD.ORG Sun May 4 10:14:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB496CC9; Sun, 4 May 2014 10:14:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7B26158C; Sun, 4 May 2014 10:14:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s44AEQxk008809; Sun, 4 May 2014 10:14:26 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s44AEPUt008805; Sun, 4 May 2014 10:14:25 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201405041014.s44AEPUt008805@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 4 May 2014 10:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265318 - head/sys/geom/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 10:14:26 -0000 Author: ae Date: Sun May 4 10:14:25 2014 New Revision: 265318 URL: http://svnweb.freebsd.org/changeset/base/265318 Log: For schemes that do an automatic partition aligning move this code to separate function. MFC after: 1 week Modified: head/sys/geom/part/g_part_ebr.c head/sys/geom/part/g_part_mbr.c head/sys/geom/part/g_part_pc98.c head/sys/geom/part/g_part_vtoc8.c Modified: head/sys/geom/part/g_part_ebr.c ============================================================================== --- head/sys/geom/part/g_part_ebr.c Sun May 4 09:07:45 2014 (r265317) +++ head/sys/geom/part/g_part_ebr.c Sun May 4 10:14:25 2014 (r265318) @@ -220,47 +220,54 @@ ebr_set_chs(struct g_part_table *table, } static int +ebr_align(struct g_part_table *basetable, uint32_t *start, uint32_t *size) +{ + uint32_t sectors; + + sectors = basetable->gpt_sectors; + if (*size < 2 * sectors) + return (EINVAL); + if (*start % sectors) { + *size += (*start % sectors) - sectors; + *start -= (*start % sectors) - sectors; + } + if (*size % sectors) + *size -= (*size % sectors); + if (*size < 2 * sectors) + return (EINVAL); + return (0); +} + + +static int g_part_ebr_add(struct g_part_table *basetable, struct g_part_entry *baseentry, struct g_part_parms *gpp) { - struct g_geom *gp; struct g_provider *pp; struct g_part_ebr_entry *entry; - uint32_t start, size, sectors; + uint32_t start, size; if (gpp->gpp_parms & G_PART_PARM_LABEL) return (EINVAL); - gp = basetable->gpt_gp; - pp = LIST_FIRST(&gp->consumer)->provider; - sectors = basetable->gpt_sectors; - + pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider; entry = (struct g_part_ebr_entry *)baseentry; - start = gpp->gpp_start; size = gpp->gpp_size; - if (size < 2 * sectors) - return (EINVAL); - if (start % sectors) { - size = size - sectors + (start % sectors); - start = start - (start % sectors) + sectors; - } - if (size % sectors) - size = size - (size % sectors); - if (size < 2 * sectors) + if (ebr_align(basetable, &start, &size) != 0) return (EINVAL); - if (baseentry->gpe_deleted) bzero(&entry->ent, sizeof(entry->ent)); KASSERT(baseentry->gpe_start <= start, ("%s", __func__)); KASSERT(baseentry->gpe_end >= start + size - 1, ("%s", __func__)); - baseentry->gpe_index = (start / sectors) + 1; - baseentry->gpe_offset = (off_t)(start + sectors) * pp->sectorsize; + baseentry->gpe_index = (start / basetable->gpt_sectors) + 1; + baseentry->gpe_offset = + (off_t)(start + basetable->gpt_sectors) * pp->sectorsize; baseentry->gpe_start = start; baseentry->gpe_end = start + size - 1; - entry->ent.dp_start = sectors; - entry->ent.dp_size = size - sectors; + entry->ent.dp_start = basetable->gpt_sectors; + entry->ent.dp_size = size - basetable->gpt_sectors; ebr_set_chs(basetable, entry->ent.dp_start, &entry->ent.dp_scyl, &entry->ent.dp_shd, &entry->ent.dp_ssect); ebr_set_chs(basetable, baseentry->gpe_end, &entry->ent.dp_ecyl, Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Sun May 4 09:07:45 2014 (r265317) +++ head/sys/geom/part/g_part_mbr.c Sun May 4 10:14:25 2014 (r265318) @@ -195,34 +195,39 @@ mbr_set_chs(struct g_part_table *table, } static int +mbr_align(struct g_part_table *basetable, uint32_t *start, uint32_t *size) +{ + uint32_t sectors; + + sectors = basetable->gpt_sectors; + if (*size < sectors) + return (EINVAL); + if (start != NULL && (*start % sectors)) { + *size += (*start % sectors) - sectors; + *start -= (*start % sectors) - sectors; + } + if (*size % sectors) + *size -= (*size % sectors); + if (*size < sectors) + return (EINVAL); + return (0); +} + +static int g_part_mbr_add(struct g_part_table *basetable, struct g_part_entry *baseentry, struct g_part_parms *gpp) { struct g_part_mbr_entry *entry; - struct g_part_mbr_table *table; - uint32_t start, size, sectors; + uint32_t start, size; if (gpp->gpp_parms & G_PART_PARM_LABEL) return (EINVAL); - sectors = basetable->gpt_sectors; - entry = (struct g_part_mbr_entry *)baseentry; - table = (struct g_part_mbr_table *)basetable; - start = gpp->gpp_start; size = gpp->gpp_size; - if (size < sectors) - return (EINVAL); - if (start % sectors) { - size = size - sectors + (start % sectors); - start = start - (start % sectors) + sectors; - } - if (size % sectors) - size = size - (size % sectors); - if (size < sectors) + if (mbr_align(basetable, &start, &size) != 0) return (EINVAL); - if (baseentry->gpe_deleted) bzero(&entry->ent, sizeof(entry->ent)); @@ -337,7 +342,7 @@ g_part_mbr_resize(struct g_part_table *b { struct g_part_mbr_entry *entry; struct g_provider *pp; - uint32_t size, sectors; + uint32_t size; if (baseentry == NULL) { pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider; @@ -345,14 +350,8 @@ g_part_mbr_resize(struct g_part_table *b UINT32_MAX) - 1; return (0); } - sectors = basetable->gpt_sectors; size = gpp->gpp_size; - - if (size < sectors) - return (EINVAL); - if (size % sectors) - size = size - (size % sectors); - if (size < sectors) + if (mbr_align(basetable, NULL, &size) != 0) return (EINVAL); entry = (struct g_part_mbr_entry *)baseentry; Modified: head/sys/geom/part/g_part_pc98.c ============================================================================== --- head/sys/geom/part/g_part_pc98.c Sun May 4 09:07:45 2014 (r265317) +++ head/sys/geom/part/g_part_pc98.c Sun May 4 10:14:25 2014 (r265318) @@ -175,32 +175,37 @@ pc98_set_chs(struct g_part_table *table, } static int +pc98_align(struct g_part_table *basetable, uint32_t *start, uint32_t *size) +{ + uint32_t cyl; + + cyl = basetable->gpt_heads * basetable->gpt_sectors; + if (*size < cyl) + return (EINVAL); + if (start != NULL && (*start % cyl)) { + *size += (*start % cyl) - cyl; + *start -= (*start % cyl) - cyl; + } + if (*size % cyl) + *size -= (*size % cyl); + if (*size < cyl) + return (EINVAL); + return (0); +} + +static int g_part_pc98_add(struct g_part_table *basetable, struct g_part_entry *baseentry, struct g_part_parms *gpp) { struct g_part_pc98_entry *entry; - struct g_part_pc98_table *table; - uint32_t cyl, start, size; + uint32_t start, size; int error; - cyl = basetable->gpt_heads * basetable->gpt_sectors; - entry = (struct g_part_pc98_entry *)baseentry; - table = (struct g_part_pc98_table *)basetable; - start = gpp->gpp_start; size = gpp->gpp_size; - if (size < cyl) - return (EINVAL); - if (start % cyl) { - size = size - cyl + (start % cyl); - start = start - (start % cyl) + cyl; - } - if (size % cyl) - size = size - (size % cyl); - if (size < cyl) + if (pc98_align(basetable, &start, &size) != 0) return (EINVAL); - if (baseentry->gpe_deleted) bzero(&entry->ent, sizeof(entry->ent)); else @@ -344,7 +349,7 @@ g_part_pc98_resize(struct g_part_table * { struct g_part_pc98_entry *entry; struct g_provider *pp; - uint32_t size, cyl; + uint32_t size; if (baseentry == NULL) { pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider; @@ -352,14 +357,8 @@ g_part_pc98_resize(struct g_part_table * UINT32_MAX) - 1; return (0); } - cyl = basetable->gpt_heads * basetable->gpt_sectors; size = gpp->gpp_size; - - if (size < cyl) - return (EINVAL); - if (size % cyl) - size = size - (size % cyl); - if (size < cyl) + if (pc98_align(basetable, NULL, &size) != 0) return (EINVAL); entry = (struct g_part_pc98_entry *)baseentry; Modified: head/sys/geom/part/g_part_vtoc8.c ============================================================================== --- head/sys/geom/part/g_part_vtoc8.c Sun May 4 09:07:45 2014 (r265317) +++ head/sys/geom/part/g_part_vtoc8.c Sun May 4 10:14:25 2014 (r265318) @@ -143,6 +143,23 @@ vtoc8_parse_type(const char *type, uint1 } static int +vtoc8_align(struct g_part_vtoc8_table *table, uint64_t *start, uint64_t *size) +{ + + if (*size < table->secpercyl) + return (EINVAL); + if (start != NULL && (*start % table->secpercyl)) { + *size += (*start % table->secpercyl) - table->secpercyl; + *start -= (*start % table->secpercyl) - table->secpercyl; + } + if (*size % table->secpercyl) + *size -= (*size % table->secpercyl); + if (*size < table->secpercyl) + return (EINVAL); + return (0); +} + +static int g_part_vtoc8_add(struct g_part_table *basetable, struct g_part_entry *entry, struct g_part_parms *gpp) { @@ -160,16 +177,9 @@ g_part_vtoc8_add(struct g_part_table *ba table = (struct g_part_vtoc8_table *)basetable; index = entry->gpe_index - 1; - start = gpp->gpp_start; size = gpp->gpp_size; - if (start % table->secpercyl) { - size = size - table->secpercyl + (start % table->secpercyl); - start = start - (start % table->secpercyl) + table->secpercyl; - } - if (size % table->secpercyl) - size = size - (size % table->secpercyl); - if (size < table->secpercyl) + if (vtoc8_align(table, &start, &size) != 0) return (EINVAL); KASSERT(entry->gpe_start <= start, (__func__)); @@ -355,9 +365,7 @@ g_part_vtoc8_resize(struct g_part_table } table = (struct g_part_vtoc8_table *)basetable; size = gpp->gpp_size; - if (size % table->secpercyl) - size = size - (size % table->secpercyl); - if (size < table->secpercyl) + if (vtoc8_align(table, NULL, &size) != 0) return (EINVAL); entry->gpe_end = entry->gpe_start + size - 1; From owner-svn-src-head@FreeBSD.ORG Sun May 4 12:20:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 580695CC; Sun, 4 May 2014 12:20:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 452F51FCA; Sun, 4 May 2014 12:20:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s44CKfMb060224; Sun, 4 May 2014 12:20:41 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s44CKeDR060222; Sun, 4 May 2014 12:20:40 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201405041220.s44CKeDR060222@svn.freebsd.org> From: Sergey Kandaurov Date: Sun, 4 May 2014 12:20:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265319 - head/usr.bin/nl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 12:20:41 -0000 Author: pluknet Date: Sun May 4 12:20:40 2014 New Revision: 265319 URL: http://svnweb.freebsd.org/changeset/base/265319 Log: Treat the '-' as meaning standard input. Obtained from: NetBSD Modified: head/usr.bin/nl/nl.1 head/usr.bin/nl/nl.c Modified: head/usr.bin/nl/nl.1 ============================================================================== --- head/usr.bin/nl/nl.1 Sun May 4 10:14:25 2014 (r265318) +++ head/usr.bin/nl/nl.1 Sun May 4 12:20:40 2014 (r265319) @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 26, 2005 +.Dd May 4, 2014 .Dt NL 1 .Os .Sh NAME @@ -71,12 +71,16 @@ The .Nm utility reads lines from the named +.Ar file , +applies a configurable line numbering filter operation, +and writes the result to the standard output. +If .Ar file -or the standard input if the -.Ar file -argument is omitted, -applies a configurable line numbering filter operation and writes the result -to the standard output. +is a single dash +.Pq Sq Fl +or absent, +.Nm +reads from the standard input. .Pp The .Nm Modified: head/usr.bin/nl/nl.c ============================================================================== --- head/usr.bin/nl/nl.c Sun May 4 10:14:25 2014 (r265318) +++ head/usr.bin/nl/nl.c Sun May 4 12:20:40 2014 (r265319) @@ -242,7 +242,8 @@ main(int argc, char *argv[]) case 0: break; case 1: - if (freopen(argv[0], "r", stdin) == NULL) + if (strcmp(argv[0], "-") != 0 && + freopen(argv[0], "r", stdin) == NULL) err(EXIT_FAILURE, "%s", argv[0]); break; default: From owner-svn-src-head@FreeBSD.ORG Sun May 4 12:32:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AAD807EF; Sun, 4 May 2014 12:32:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97B2110C1; Sun, 4 May 2014 12:32:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s44CWbDl067381; Sun, 4 May 2014 12:32:37 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s44CWbNF067380; Sun, 4 May 2014 12:32:37 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201405041232.s44CWbNF067380@svn.freebsd.org> From: Sergey Kandaurov Date: Sun, 4 May 2014 12:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265320 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 12:32:37 -0000 Author: pluknet Date: Sun May 4 12:32:37 2014 New Revision: 265320 URL: http://svnweb.freebsd.org/changeset/base/265320 Log: Expand PGET_WANTREAD. Language fixes. Submitted by: jmg Modified: head/share/man/man9/pget.9 Modified: head/share/man/man9/pget.9 ============================================================================== --- head/share/man/man9/pget.9 Sun May 4 12:20:40 2014 (r265319) +++ head/share/man/man9/pget.9 Sun May 4 12:32:37 2014 (r265320) @@ -46,13 +46,13 @@ and fills a pointer to the structure in .Fa *pp . In the latter case, a process owning the specified thread is looked for. -The actual operation is performed by invoking the +The operation is performed by invoking the .Xr pfind 9 function. The found process is returned locked. -Only for +For the .Dv PGET_HOLD -case it is returned unlocked (but held). +case, it is returned unlocked (but held). The .Fn pget function can @@ -65,7 +65,7 @@ The argument is the logical OR of some subset of: .Bl -tag -width ".Dv PGET_NOTINEXEC" .It Dv PGET_HOLD -If set, the found process will be referenced and unlocked. +If set, the found process will be held and unlocked. .It Dv PGET_CANSEE If set, the found process will be checked for its visibility. See @@ -93,6 +93,8 @@ If set, is not assumed as a thread id for values larger than .Dv PID_MAX . .It Dv PGET_WANTREAD +If set, the found process will be checked that the caller may get +a read access to its structure. A shorthand for .Pq Dv PGET_HOLD | PGET_CANDEBUG | PGET_NOTWEXIT . .El From owner-svn-src-head@FreeBSD.ORG Sun May 4 14:05:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B29D0B1B; Sun, 4 May 2014 14:05:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 858CD1792; Sun, 4 May 2014 14:05:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s44E5F9R006215; Sun, 4 May 2014 14:05:15 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s44E5FU9006213; Sun, 4 May 2014 14:05:15 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201405041405.s44E5FU9006213@svn.freebsd.org> From: Steven Hartland Date: Sun, 4 May 2014 14:05:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265321 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 14:05:15 -0000 Author: smh Date: Sun May 4 14:05:14 2014 New Revision: 265321 URL: http://svnweb.freebsd.org/changeset/base/265321 Log: Use a zio flag to prevent recursion of vdev_queue_io_done which can cause stack overflow for IO's which return ZIO_PIPELINE_CONTINUE from the zio_vdev_io_start stage and hence don't suspend and complete in a different thread. This prevents double fault panic on slow machines running ZFS on GELI volumes which return EOPNOTSUPP directly to BIO_DELETE requests. MFC after: 1 month X-MFC-With: r265152 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sun May 4 12:32:37 2014 (r265320) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sun May 4 14:05:14 2014 (r265321) @@ -196,6 +196,7 @@ enum zio_flag { ZIO_FLAG_NOPWRITE = 1 << 25, ZIO_FLAG_REEXECUTED = 1 << 26, ZIO_FLAG_DELEGATED = 1 << 27, + ZIO_FLAG_QUEUE_IO_DONE = 1 << 28, }; #define ZIO_FLAG_MUSTSUCCEED 0 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Sun May 4 12:32:37 2014 (r265320) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Sun May 4 14:05:14 2014 (r265321) @@ -796,14 +796,25 @@ vdev_queue_io_done(zio_t *zio) vq->vq_io_complete_ts = gethrtime(); + if (zio->io_flags & ZIO_FLAG_QUEUE_IO_DONE) { + /* + * Executing from a previous vdev_queue_io_done so + * to avoid recursion we just unlock and return. + */ + mutex_exit(&vq->vq_lock); + return; + } + while ((nio = vdev_queue_io_to_issue(vq)) != NULL) { mutex_exit(&vq->vq_lock); + nio->io_flags |= ZIO_FLAG_QUEUE_IO_DONE; if (nio->io_done == vdev_queue_agg_io_done) { zio_nowait(nio); } else { zio_vdev_io_reissue(nio); zio_execute(nio); } + nio->io_flags &= ~ZIO_FLAG_QUEUE_IO_DONE; mutex_enter(&vq->vq_lock); } From owner-svn-src-head@FreeBSD.ORG Sun May 4 15:35:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86EB0FA4; Sun, 4 May 2014 15:35:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 680481FC6; Sun, 4 May 2014 15:35:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s44FZ55u044335; Sun, 4 May 2014 15:35:05 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s44FZ56l044334; Sun, 4 May 2014 15:35:05 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405041535.s44FZ56l044334@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 4 May 2014 15:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265323 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 15:35:05 -0000 Author: trasz Date: Sun May 4 15:35:04 2014 New Revision: 265323 URL: http://svnweb.freebsd.org/changeset/base/265323 Log: Provide better descriptions for 'struct ctl_scsiio' fields; based mostly on emails from ken@. Modified: head/sys/cam/ctl/ctl_io.h Modified: head/sys/cam/ctl/ctl_io.h ============================================================================== --- head/sys/cam/ctl/ctl_io.h Sun May 4 15:05:53 2014 (r265322) +++ head/sys/cam/ctl/ctl_io.h Sun May 4 15:35:04 2014 (r265323) @@ -293,21 +293,60 @@ union ctl_io; */ struct ctl_scsiio { struct ctl_io_hdr io_hdr; /* common to all I/O types */ + + /* + * The ext_* fields are generally intended for frontend use; CTL itself + * doesn't modify or use them. + */ uint32_t ext_sg_entries; /* 0 = no S/G list, > 0 = num entries */ uint8_t *ext_data_ptr; /* data buffer or S/G list */ uint32_t ext_data_len; /* Data transfer length */ uint32_t ext_data_filled; /* Amount of data filled so far */ - uint32_t kern_sg_entries; /* 0 = no S/G list, > 0 = num entries */ - uint32_t rem_sg_entries; /* 0 = no S/G list, > 0 = num entries */ - uint8_t *kern_data_ptr; /* data buffer or S/G list */ - uint32_t kern_data_len; /* Length of this S/G list/buffer */ - uint32_t kern_total_len; /* Total length of this transaction */ - uint32_t kern_data_resid; /* Length left to transfer after this*/ - uint32_t kern_rel_offset; /* Byte Offset of this transfer */ + + /* + * The number of scatter/gather entries in the list pointed to + * by kern_data_ptr. 0 means there is no list, just a data pointer. + */ + uint32_t kern_sg_entries; + + uint32_t rem_sg_entries; /* Unused. */ + + /* + * The data pointer or a pointer to the scatter/gather list. + */ + uint8_t *kern_data_ptr; + + /* + * Length of the data buffer or scatter/gather list. It's also + * the length of this particular piece of the data transfer, + * ie. number of bytes expected to be transferred by the current + * invocation of frontend's datamove() callback. It's always + * less than or equal to kern_total_len. + */ + uint32_t kern_data_len; + + /* + * Total length of data to be transferred during this particular + * SCSI command, as decoded from SCSI CDB. + */ + uint32_t kern_total_len; + + /* + * Amount of data left after the current data transfer. + */ + uint32_t kern_data_resid; + + /* + * Byte offset of this transfer, equal to the amount of data + * already transferred for this SCSI command during previous + * datamove() invocations. + */ + uint32_t kern_rel_offset; + struct scsi_sense_data sense_data; /* sense data */ uint8_t sense_len; /* Returned sense length */ uint8_t scsi_status; /* SCSI status byte */ - uint8_t sense_residual; /* sense residual length */ + uint8_t sense_residual; /* Unused. */ uint32_t residual; /* data residual length */ uint32_t tag_num; /* tag number */ ctl_tag_type tag_type; /* simple, ordered, head of queue,etc.*/ From owner-svn-src-head@FreeBSD.ORG Sun May 4 16:38:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5695D50; Sun, 4 May 2014 16:38:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91DE218F4; Sun, 4 May 2014 16:38:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s44GcMx3070289; Sun, 4 May 2014 16:38:22 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s44GcM2B070287; Sun, 4 May 2014 16:38:22 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201405041638.s44GcM2B070287@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 4 May 2014 16:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265329 - in head/sys: amd64/conf i386/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 16:38:22 -0000 Author: nwhitehorn Date: Sun May 4 16:38:21 2014 New Revision: 265329 URL: http://svnweb.freebsd.org/changeset/base/265329 Log: Disable ACPI and P4TCC throttling by default, following discussion on freebsd-current. These CPU speed control techniques are usually unhelpful at best. For now, continue building the relevant code into GENERIC so that it can trivially be re-enabled at runtime if anyone wants it. MFC after: 1 month Modified: head/sys/amd64/conf/GENERIC.hints head/sys/i386/conf/GENERIC.hints Modified: head/sys/amd64/conf/GENERIC.hints ============================================================================== --- head/sys/amd64/conf/GENERIC.hints Sun May 4 16:00:59 2014 (r265328) +++ head/sys/amd64/conf/GENERIC.hints Sun May 4 16:38:21 2014 (r265329) @@ -31,3 +31,5 @@ hint.attimer.0.at="isa" hint.attimer.0.port="0x40" hint.attimer.0.irq="0" hint.wbwd.0.at="isa" +hint.acpi_throttle.0.disabled="1" +hint.p4tcc.0.disabled="1" Modified: head/sys/i386/conf/GENERIC.hints ============================================================================== --- head/sys/i386/conf/GENERIC.hints Sun May 4 16:00:59 2014 (r265328) +++ head/sys/i386/conf/GENERIC.hints Sun May 4 16:38:21 2014 (r265329) @@ -39,3 +39,5 @@ hint.attimer.0.at="isa" hint.attimer.0.port="0x40" hint.attimer.0.irq="0" hint.wbwd.0.at="isa" +hint.acpi_throttle.0.disabled="1" +hint.p4tcc.0.disabled="1" From owner-svn-src-head@FreeBSD.ORG Sun May 4 16:43:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24C4415A; Sun, 4 May 2014 16:43:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0610C19A9; Sun, 4 May 2014 16:43:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s44GhvB5073957; Sun, 4 May 2014 16:43:57 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s44GhvJR073951; Sun, 4 May 2014 16:43:57 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201405041643.s44GhvJR073951@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 4 May 2014 16:43:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265331 - head/sys/geom/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 16:43:58 -0000 Author: ae Date: Sun May 4 16:43:57 2014 New Revision: 265331 URL: http://svnweb.freebsd.org/changeset/base/265331 Log: Prevent an unexpected shrinking on resizing due to alignment for MBR, PC98 and VTOC8 schemes. Reported by: jmg MFC after: 1 week Modified: head/sys/geom/part/g_part_mbr.c head/sys/geom/part/g_part_pc98.c head/sys/geom/part/g_part_vtoc8.c Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Sun May 4 16:39:18 2014 (r265330) +++ head/sys/geom/part/g_part_mbr.c Sun May 4 16:43:57 2014 (r265331) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "g_part_if.h" @@ -353,7 +354,11 @@ g_part_mbr_resize(struct g_part_table *b size = gpp->gpp_size; if (mbr_align(basetable, NULL, &size) != 0) return (EINVAL); - + /* XXX: prevent unexpected shrinking. */ + pp = baseentry->gpe_pp; + if ((g_debugflags & 16) == 0 && size < gpp->gpp_size && + (pp->acr > 0 || pp->acw > 0 || pp->ace > 0)) + return (EBUSY); entry = (struct g_part_mbr_entry *)baseentry; baseentry->gpe_end = baseentry->gpe_start + size - 1; entry->ent.dp_size = size; Modified: head/sys/geom/part/g_part_pc98.c ============================================================================== --- head/sys/geom/part/g_part_pc98.c Sun May 4 16:39:18 2014 (r265330) +++ head/sys/geom/part/g_part_pc98.c Sun May 4 16:43:57 2014 (r265331) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "g_part_if.h" @@ -360,7 +361,11 @@ g_part_pc98_resize(struct g_part_table * size = gpp->gpp_size; if (pc98_align(basetable, NULL, &size) != 0) return (EINVAL); - + /* XXX: prevent unexpected shrinking. */ + pp = baseentry->gpe_pp; + if ((g_debugflags & 0x10) == 0 && size < gpp->gpp_size && + (pp->acr > 0 || pp->acw > 0 || pp->ace > 0)) + return (EBUSY); entry = (struct g_part_pc98_entry *)baseentry; baseentry->gpe_end = baseentry->gpe_start + size - 1; pc98_set_chs(basetable, baseentry->gpe_end, &entry->ent.dp_ecyl, Modified: head/sys/geom/part/g_part_vtoc8.c ============================================================================== --- head/sys/geom/part/g_part_vtoc8.c Sun May 4 16:39:18 2014 (r265330) +++ head/sys/geom/part/g_part_vtoc8.c Sun May 4 16:43:57 2014 (r265331) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "g_part_if.h" @@ -367,7 +368,11 @@ g_part_vtoc8_resize(struct g_part_table size = gpp->gpp_size; if (vtoc8_align(table, NULL, &size) != 0) return (EINVAL); - + /* XXX: prevent unexpected shrinking. */ + pp = entry->gpe_pp; + if ((g_debugflags & 0x10) == 0 && size < gpp->gpp_size && + (pp->acr > 0 || pp->acw > 0 || pp->ace > 0)) + return (EBUSY); entry->gpe_end = entry->gpe_start + size - 1; be32enc(&table->vtoc.map[entry->gpe_index - 1].nblks, size); From owner-svn-src-head@FreeBSD.ORG Sun May 4 16:55:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 953D7652; Sun, 4 May 2014 16:55:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81F131AC5; Sun, 4 May 2014 16:55:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s44GtpqE078401; Sun, 4 May 2014 16:55:51 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s44GtpX7078400; Sun, 4 May 2014 16:55:51 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201405041655.s44GtpX7078400@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 4 May 2014 16:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265333 - head/sys/geom/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 16:55:51 -0000 Author: ae Date: Sun May 4 16:55:51 2014 New Revision: 265333 URL: http://svnweb.freebsd.org/changeset/base/265333 Log: Add better error description for case when we are doing resize and scheme-specific method returns EBUSY. MFC after: 1 week Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Sun May 4 16:55:27 2014 (r265332) +++ head/sys/geom/part/g_part.c Sun May 4 16:55:51 2014 (r265333) @@ -1316,7 +1316,9 @@ g_part_ctl_resize(struct gctl_req *req, error = G_PART_RESIZE(table, entry, gpp); if (error) { - gctl_error(req, "%d", error); + gctl_error(req, "%d%s", error, error != EBUSY ? "": + " resizing will lead to unexpected shrinking" + " due to alignment"); return (error); } From owner-svn-src-head@FreeBSD.ORG Sun May 4 17:53:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51BC4FDB; Sun, 4 May 2014 17:53:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E7D61061; Sun, 4 May 2014 17:53:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s44Hr2uk002892; Sun, 4 May 2014 17:53:02 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s44Hr2f6002891; Sun, 4 May 2014 17:53:02 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405041753.s44Hr2f6002891@svn.freebsd.org> From: Glen Barber Date: Sun, 4 May 2014 17:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265334 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 17:53:02 -0000 Author: gjb Date: Sun May 4 17:53:01 2014 New Revision: 265334 URL: http://svnweb.freebsd.org/changeset/base/265334 Log: Fix typo: s/null/full Spotted by: jilles Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun May 4 16:55:51 2014 (r265333) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sun May 4 17:53:01 2014 (r265334) @@ -107,7 +107,7 @@ The &man.full.4; device has been added, and the lindev(4) device has been removed. Prior to this change, lindev(4) provided only - the /dev/null character device, returning + the /dev/full character device, returning ENOSPC on write attempts. As this device is not specific to &linux;, a native &os; version has been added. From owner-svn-src-head@FreeBSD.ORG Sun May 4 20:00:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A6A7F80; Sun, 4 May 2014 20:00:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5780A195A; Sun, 4 May 2014 20:00:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s44K09u5054675; Sun, 4 May 2014 20:00:09 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s44K09Pd054674; Sun, 4 May 2014 20:00:09 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201405042000.s44K09Pd054674@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 4 May 2014 20:00:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265336 - head/sys/geom/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 20:00:09 -0000 Author: ae Date: Sun May 4 20:00:08 2014 New Revision: 265336 URL: http://svnweb.freebsd.org/changeset/base/265336 Log: Add an advice what to do when partition was automatically resized. X-MFC after: r256690 Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Sun May 4 18:15:07 2014 (r265335) +++ head/sys/geom/part/g_part.c Sun May 4 20:00:08 2014 (r265336) @@ -2065,8 +2065,10 @@ g_part_resize(struct g_consumer *cp) table->gpt_opened = 1; } if (G_PART_RESIZE(table, NULL, NULL) == 0) - printf("GEOM_PART: %s was automatically resized\n", - cp->geom->name); + printf("GEOM_PART: %s was automatically resized.\n" + " Use `gpart commit %s` to save changes or " + "`gpart undo %s` to revert them.\n", cp->geom->name, + cp->geom->name, cp->geom->name); if (g_part_check_integrity(table, cp) != 0) { g_access(cp, -1, -1, -1); table->gpt_opened = 0; From owner-svn-src-head@FreeBSD.ORG Sun May 4 20:42:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0B03A37; Sun, 4 May 2014 20:42:31 +0000 (UTC) Received: from mail-qg0-x235.google.com (mail-qg0-x235.google.com [IPv6:2607:f8b0:400d:c04::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EFB61C48; Sun, 4 May 2014 20:42:31 +0000 (UTC) Received: by mail-qg0-f53.google.com with SMTP id f51so6078324qge.26 for ; Sun, 04 May 2014 13:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ZkWcqYeaaJn9Dten3NUkeJtbe9Ja3G3yM/NWBuZ1TuY=; b=SPcICApzXPkeNtAPc02BoJ2g2/ENLF7AHd0g6q0wR5B8TZ9z9eaUi2pGky64hOnXip N1DWHsYelOfolkLJesVsoZqexFMRgBkA9BYhFapJH0ms20CeQCSVH/sw/IT2hDp24Rs7 5eXk1rMgG41pPlcAlUOpajhmhvShFRkWBmZFExdb1aC9GaqQrdJUH3M/htbSkXS1DvVA /F8uuURrny+cX4bXwr45xW9GM0a5i0XTymFoA3wqXMJkssDGQCedil34O/AueKmQKCN1 52MDThFqEELFiyAoArqDvivHOcj+lbIdYyXtTKQ6geX9DnPNTwoPF5boVR4qxPcJgTCC QTiw== MIME-Version: 1.0 X-Received: by 10.229.198.2 with SMTP id em2mr4618759qcb.21.1399236150429; Sun, 04 May 2014 13:42:30 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.191.201 with HTTP; Sun, 4 May 2014 13:42:30 -0700 (PDT) In-Reply-To: <201405041638.s44GcM2B070287@svn.freebsd.org> References: <201405041638.s44GcM2B070287@svn.freebsd.org> Date: Sun, 4 May 2014 13:42:30 -0700 X-Google-Sender-Auth: OCSZdrEjjwcwE4lP6sMQ8A6N_UY Message-ID: Subject: Re: svn commit: r265329 - in head/sys: amd64/conf i386/conf From: Adrian Chadd To: Nathan Whitehorn Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 20:42:31 -0000 .. and much cheering was had. :) -a On 4 May 2014 09:38, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sun May 4 16:38:21 2014 > New Revision: 265329 > URL: http://svnweb.freebsd.org/changeset/base/265329 > > Log: > Disable ACPI and P4TCC throttling by default, following discussion on > freebsd-current. These CPU speed control techniques are usually unhelpful > at best. For now, continue building the relevant code into GENERIC so that > it can trivially be re-enabled at runtime if anyone wants it. > > MFC after: 1 month > > Modified: > head/sys/amd64/conf/GENERIC.hints > head/sys/i386/conf/GENERIC.hints > > Modified: head/sys/amd64/conf/GENERIC.hints > ============================================================================== > --- head/sys/amd64/conf/GENERIC.hints Sun May 4 16:00:59 2014 (r265328) > +++ head/sys/amd64/conf/GENERIC.hints Sun May 4 16:38:21 2014 (r265329) > @@ -31,3 +31,5 @@ hint.attimer.0.at="isa" > hint.attimer.0.port="0x40" > hint.attimer.0.irq="0" > hint.wbwd.0.at="isa" > +hint.acpi_throttle.0.disabled="1" > +hint.p4tcc.0.disabled="1" > > Modified: head/sys/i386/conf/GENERIC.hints > ============================================================================== > --- head/sys/i386/conf/GENERIC.hints Sun May 4 16:00:59 2014 (r265328) > +++ head/sys/i386/conf/GENERIC.hints Sun May 4 16:38:21 2014 (r265329) > @@ -39,3 +39,5 @@ hint.attimer.0.at="isa" > hint.attimer.0.port="0x40" > hint.attimer.0.irq="0" > hint.wbwd.0.at="isa" > +hint.acpi_throttle.0.disabled="1" > +hint.p4tcc.0.disabled="1" > From owner-svn-src-head@FreeBSD.ORG Sun May 4 23:25:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DE21FD7; Sun, 4 May 2014 23:25:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 505171CFC; Sun, 4 May 2014 23:25:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s44NPYt8089628; Sun, 4 May 2014 23:25:34 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s44NPXwD089621; Sun, 4 May 2014 23:25:33 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201405042325.s44NPXwD089621@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 4 May 2014 23:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265338 - in head/sys: netinet sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 23:25:34 -0000 Author: glebius Date: Sun May 4 23:25:32 2014 New Revision: 265338 URL: http://svnweb.freebsd.org/changeset/base/265338 Log: The FreeBSD-SA-14:08.tcp was a lesson on not doing acrobatics with mixing on stack memory and UMA memory in one linked list. Thus, rewrite TCP reassembly code in terms of memory usage. The algorithm remains unchanged. We actually do not need extra memory to build a reassembly queue. Arriving mbufs are always packet header mbufs. So we got the length of data as pkthdr.len. We got m_nextpkt for linkage. And we need only one pointer to point at the tcphdr, use PH_loc for that. In tcpcb the t_segq fields becomes mbuf pointer. The t_segqlen field now counts not packets, but bytes in the queue. This gives us more precision when comparing to socket buffer limits. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_reass.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h head/sys/sys/mbuf.h Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sun May 4 20:21:41 2014 (r265337) +++ head/sys/netinet/tcp_input.c Sun May 4 23:25:32 2014 (r265338) @@ -1639,8 +1639,7 @@ tcp_do_segment(struct mbuf *m, struct tc tp->snd_nxt == tp->snd_max && tiwin && tiwin == tp->snd_wnd && ((tp->t_flags & (TF_NEEDSYN|TF_NEEDFIN)) == 0) && - LIST_EMPTY(&tp->t_segq) && - ((to.to_flags & TOF_TS) == 0 || + tp->t_segq == NULL && ((to.to_flags & TOF_TS) == 0 || TSTMP_GEQ(to.to_tsval, tp->ts_recent)) ) { /* @@ -2908,8 +2907,7 @@ dodata: /* XXX */ * immediately when segments are out of order (so * fast retransmit can work). */ - if (th->th_seq == tp->rcv_nxt && - LIST_EMPTY(&tp->t_segq) && + if (th->th_seq == tp->rcv_nxt && tp->t_segq == NULL && TCPS_HAVEESTABLISHED(tp->t_state)) { if (DELAY_ACK(tp, tlen)) tp->t_flags |= TF_DELACK; Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Sun May 4 20:21:41 2014 (r265337) +++ head/sys/netinet/tcp_reass.c Sun May 4 23:25:32 2014 (r265338) @@ -71,19 +71,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef TCPDEBUG -#include -#endif /* TCPDEBUG */ static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0, "TCP Segment Reassembly Queue"); -static VNET_DEFINE(int, tcp_reass_maxseg) = 0; -#define V_tcp_reass_maxseg VNET(tcp_reass_maxseg) -SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, maxsegments, CTLFLAG_RDTUN, - &VNET_NAME(tcp_reass_maxseg), 0, - "Global maximum number of TCP Segments in Reassembly Queue"); - static VNET_DEFINE(int, tcp_reass_overflows) = 0; #define V_tcp_reass_overflows VNET(tcp_reass_overflows) SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, overflows, @@ -91,78 +82,32 @@ SYSCTL_VNET_INT(_net_inet_tcp_reass, OID &VNET_NAME(tcp_reass_overflows), 0, "Global number of TCP Segment Reassembly Queue Overflows"); -static VNET_DEFINE(uma_zone_t, tcp_reass_zone); -#define V_tcp_reass_zone VNET(tcp_reass_zone) -SYSCTL_UMA_CUR(_net_inet_tcp_reass, OID_AUTO, cursegments, CTLFLAG_VNET, - &VNET_NAME(tcp_reass_zone), - "Global number of TCP Segments currently in Reassembly Queue"); - -/* Initialize TCP reassembly queue */ -static void -tcp_reass_zone_change(void *tag) -{ - - /* Set the zone limit and read back the effective value. */ - V_tcp_reass_maxseg = nmbclusters / 16; - V_tcp_reass_maxseg = uma_zone_set_max(V_tcp_reass_zone, - V_tcp_reass_maxseg); -} - -void -tcp_reass_init(void) -{ - - V_tcp_reass_maxseg = nmbclusters / 16; - TUNABLE_INT_FETCH("net.inet.tcp.reass.maxsegments", - &V_tcp_reass_maxseg); - V_tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); - /* Set the zone limit and read back the effective value. */ - V_tcp_reass_maxseg = uma_zone_set_max(V_tcp_reass_zone, - V_tcp_reass_maxseg); - EVENTHANDLER_REGISTER(nmbclusters_change, - tcp_reass_zone_change, NULL, EVENTHANDLER_PRI_ANY); -} - -#ifdef VIMAGE -void -tcp_reass_destroy(void) -{ - - uma_zdestroy(V_tcp_reass_zone); -} -#endif - void tcp_reass_flush(struct tcpcb *tp) { - struct tseg_qent *qe; + struct mbuf *m; INP_WLOCK_ASSERT(tp->t_inpcb); - while ((qe = LIST_FIRST(&tp->t_segq)) != NULL) { - LIST_REMOVE(qe, tqe_q); - m_freem(qe->tqe_m); - uma_zfree(V_tcp_reass_zone, qe); - tp->t_segqlen--; + while ((m = tp->t_segq) != NULL) { + tp->t_segq = m->m_nextpkt; + tp->t_segqlen -= m->m_pkthdr.len; + m_freem(m); } KASSERT((tp->t_segqlen == 0), - ("TCP reass queue %p segment count is %d instead of 0 after flush.", + ("TCP reass queue %p length is %d instead of 0 after flush.", tp, tp->t_segqlen)); } +#define M_TCPHDR(m) ((struct tcphdr *)((m)->m_pkthdr.pkt_tcphdr)) + int tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tlenp, struct mbuf *m) { - struct tseg_qent *q; - struct tseg_qent *p = NULL; - struct tseg_qent *nq; - struct tseg_qent *te = NULL; struct socket *so = tp->t_inpcb->inp_socket; - char *s = NULL; - int flags; - struct tseg_qent tqs; + struct mbuf *mq, *mp; + int flags, wakeup; INP_WLOCK_ASSERT(tp->t_inpcb); @@ -178,6 +123,10 @@ tcp_reass(struct tcpcb *tp, struct tcphd if (th == NULL) goto present; + M_ASSERTPKTHDR(m); + KASSERT(*tlenp == m->m_pkthdr.len, ("%s: tlenp %u len %u", __func__, + *tlenp, m->m_pkthdr.len)); + /* * Limit the number of segments that can be queued to reduce the * potential for mbuf exhaustion. For best performance, we want to be @@ -188,19 +137,17 @@ tcp_reass(struct tcpcb *tp, struct tcphd * Always let the missing segment through which caused this queue. * NB: Access to the socket buffer is left intentionally unlocked as we * can tolerate stale information here. - * - * XXXLAS: Using sbspace(so->so_rcv) instead of so->so_rcv.sb_hiwat - * should work but causes packets to be dropped when they shouldn't. - * Investigate why and re-evaluate the below limit after the behaviour - * is understood. */ if ((th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) && - tp->t_segqlen >= (so->so_rcv.sb_hiwat / tp->t_maxseg) + 1) { + tp->t_segqlen + m->m_pkthdr.len >= sbspace(&so->so_rcv)) { + char *s; + V_tcp_reass_overflows++; TCPSTAT_INC(tcps_rcvmemdrop); m_freem(m); *tlenp = 0; - if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) { + if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, + NULL))) { log(LOG_DEBUG, "%s; %s: queue limit reached, " "segment dropped\n", s, __func__); free(s, M_TCPLOG); @@ -209,46 +156,13 @@ tcp_reass(struct tcpcb *tp, struct tcphd } /* - * Allocate a new queue entry. If we can't, or hit the zone limit - * just drop the pkt. - * - * Use a temporary structure on the stack for the missing segment - * when the zone is exhausted. Otherwise we may get stuck. - */ - te = uma_zalloc(V_tcp_reass_zone, M_NOWAIT); - if (te == NULL) { - if (th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) { - TCPSTAT_INC(tcps_rcvmemdrop); - m_freem(m); - *tlenp = 0; - if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, - NULL))) { - log(LOG_DEBUG, "%s; %s: global zone limit " - "reached, segment dropped\n", s, __func__); - free(s, M_TCPLOG); - } - return (0); - } else { - bzero(&tqs, sizeof(struct tseg_qent)); - te = &tqs; - if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, - NULL))) { - log(LOG_DEBUG, - "%s; %s: global zone limit reached, using " - "stack for missing segment\n", s, __func__); - free(s, M_TCPLOG); - } - } - } - tp->t_segqlen++; - - /* * Find a segment which begins after this one does. */ - LIST_FOREACH(q, &tp->t_segq, tqe_q) { - if (SEQ_GT(q->tqe_th->th_seq, th->th_seq)) + mp = NULL; + for (mq = tp->t_segq; mq != NULL; mq = mq->m_nextpkt) { + if (SEQ_GT(M_TCPHDR(mq)->th_seq, th->th_seq)) break; - p = q; + mp = mq; } /* @@ -256,18 +170,16 @@ tcp_reass(struct tcpcb *tp, struct tcphd * our data already. If so, drop the data from the incoming * segment. If it provides all of our data, drop us. */ - if (p != NULL) { + if (mp != NULL) { int i; + /* conversion to int (in i) handles seq wraparound */ - i = p->tqe_th->th_seq + p->tqe_len - th->th_seq; + i = M_TCPHDR(mp)->th_seq + mp->m_pkthdr.len - th->th_seq; if (i > 0) { if (i >= *tlenp) { TCPSTAT_INC(tcps_rcvduppack); TCPSTAT_ADD(tcps_rcvdupbyte, *tlenp); m_freem(m); - if (te != &tqs) - uma_zfree(V_tcp_reass_zone, te); - tp->t_segqlen--; /* * Try to present any queued data * at the left window edge to the user. @@ -289,37 +201,40 @@ tcp_reass(struct tcpcb *tp, struct tcphd * While we overlap succeeding segments trim them or, * if they are completely covered, dequeue them. */ - while (q) { - int i = (th->th_seq + *tlenp) - q->tqe_th->th_seq; + while (mq) { + struct mbuf *nq; + int i; + + i = (th->th_seq + *tlenp) - M_TCPHDR(mq)->th_seq; if (i <= 0) break; - if (i < q->tqe_len) { - q->tqe_th->th_seq += i; - q->tqe_len -= i; - m_adj(q->tqe_m, i); + if (i < mq->m_pkthdr.len) { + M_TCPHDR(mq)->th_seq += i; + m_adj(mq, i); + tp->t_segqlen -= i; break; } - nq = LIST_NEXT(q, tqe_q); - LIST_REMOVE(q, tqe_q); - m_freem(q->tqe_m); - uma_zfree(V_tcp_reass_zone, q); - tp->t_segqlen--; - q = nq; + nq = mq->m_nextpkt; + tp->t_segqlen -= mq->m_pkthdr.len; + m_freem(mq); + if (mp) + mp->m_nextpkt = nq; + else + tp->t_segq = nq; + mq = nq; } /* Insert the new segment queue entry into place. */ - te->tqe_m = m; - te->tqe_th = th; - te->tqe_len = *tlenp; - - if (p == NULL) { - LIST_INSERT_HEAD(&tp->t_segq, te, tqe_q); + if (mp) { + m->m_nextpkt = mp->m_nextpkt; + mp->m_nextpkt = m; } else { - KASSERT(te != &tqs, ("%s: temporary stack based entry not " - "first element in queue", __func__)); - LIST_INSERT_AFTER(p, te, tqe_q); + m->m_nextpkt = tp->t_segq; + tp->t_segq = m ; } + m->m_pkthdr.pkt_tcphdr = th; + tp->t_segqlen += m->m_pkthdr.len; present: /* @@ -328,25 +243,30 @@ present: */ if (!TCPS_HAVEESTABLISHED(tp->t_state)) return (0); - q = LIST_FIRST(&tp->t_segq); - if (!q || q->tqe_th->th_seq != tp->rcv_nxt) - return (0); + + flags = 0; + wakeup = 0; SOCKBUF_LOCK(&so->so_rcv); - do { - tp->rcv_nxt += q->tqe_len; - flags = q->tqe_th->th_flags & TH_FIN; - nq = LIST_NEXT(q, tqe_q); - LIST_REMOVE(q, tqe_q); + while ((mq = tp->t_segq) != NULL && + M_TCPHDR(mq)->th_seq == tp->rcv_nxt) { + tp->t_segq = mq->m_nextpkt; + + tp->rcv_nxt += mq->m_pkthdr.len; + tp->t_segqlen -= mq->m_pkthdr.len; + flags = M_TCPHDR(mq)->th_flags & TH_FIN; + if (so->so_rcv.sb_state & SBS_CANTRCVMORE) - m_freem(q->tqe_m); - else - sbappendstream_locked(&so->so_rcv, q->tqe_m); - if (q != &tqs) - uma_zfree(V_tcp_reass_zone, q); - tp->t_segqlen--; - q = nq; - } while (q && q->tqe_th->th_seq == tp->rcv_nxt); + m_freem(mq); + else { + mq->m_nextpkt = NULL; + sbappendstream_locked(&so->so_rcv, mq); + wakeup = 1; + } + } ND6_HINT(tp); - sorwakeup_locked(so); + if (wakeup) + sorwakeup_locked(so); + else + SOCKBUF_UNLOCK(&so->so_rcv); return (flags); } Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sun May 4 20:21:41 2014 (r265337) +++ head/sys/netinet/tcp_subr.c Sun May 4 23:25:32 2014 (r265338) @@ -375,7 +375,6 @@ tcp_init(void) tcp_tw_init(); syncache_init(); tcp_hc_init(); - tcp_reass_init(); TUNABLE_INT_FETCH("net.inet.tcp.sack.enable", &V_tcp_do_sack); V_sack_hole_zone = uma_zcreate("sackhole", sizeof(struct sackhole), @@ -433,7 +432,6 @@ tcp_destroy(void) { int error; - tcp_reass_destroy(); tcp_hc_destroy(); syncache_destroy(); tcp_tw_destroy(); Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Sun May 4 20:21:41 2014 (r265337) +++ head/sys/netinet/tcp_usrreq.c Sun May 4 23:25:32 2014 (r265338) @@ -1949,7 +1949,7 @@ db_print_tcpcb(struct tcpcb *tp, const c db_print_indent(indent); db_printf("t_segq first: %p t_segqlen: %d t_dupacks: %d\n", - LIST_FIRST(&tp->t_segq), tp->t_segqlen, tp->t_dupacks); + tp->t_segq, tp->t_segqlen, tp->t_dupacks); db_print_indent(indent); db_printf("tt_rexmt: %p tt_persist: %p tt_keep: %p\n", Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Sun May 4 20:21:41 2014 (r265337) +++ head/sys/netinet/tcp_var.h Sun May 4 23:25:32 2014 (r265338) @@ -46,15 +46,6 @@ VNET_DECLARE(int, tcp_do_rfc1323); #endif /* _KERNEL */ -/* TCP segment queue entry */ -struct tseg_qent { - LIST_ENTRY(tseg_qent) tqe_q; - int tqe_len; /* TCP segment data length */ - struct tcphdr *tqe_th; /* a pointer to tcp header */ - struct mbuf *tqe_m; /* mbuf contains packet */ -}; -LIST_HEAD(tsegqe_head, tseg_qent); - struct sackblk { tcp_seq start; /* start seq no. of sack block */ tcp_seq end; /* end seq no. */ @@ -100,7 +91,7 @@ do { \ * Organized for 16 byte cacheline efficiency. */ struct tcpcb { - struct tsegqe_head t_segq; /* segment reassembly queue */ + struct mbuf *t_segq; /* segment reassembly queue */ void *t_pspare[2]; /* new reassembly queue */ int t_segqlen; /* segment reassembly queue length */ int t_dupacks; /* consecutive dup acks recd */ @@ -663,11 +654,7 @@ char *tcp_log_addrs(struct in_conninfo * char *tcp_log_vain(struct in_conninfo *, struct tcphdr *, void *, const void *); int tcp_reass(struct tcpcb *, struct tcphdr *, int *, struct mbuf *); -void tcp_reass_init(void); void tcp_reass_flush(struct tcpcb *); -#ifdef VIMAGE -void tcp_reass_destroy(void); -#endif void tcp_input(struct mbuf *, int); u_long tcp_maxmtu(struct in_conninfo *, struct tcp_ifcap *); u_long tcp_maxmtu6(struct in_conninfo *, struct tcp_ifcap *); Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Sun May 4 20:21:41 2014 (r265337) +++ head/sys/sys/mbuf.h Sun May 4 23:25:32 2014 (r265338) @@ -159,6 +159,7 @@ struct pkthdr { #define tso_segsz PH_per.sixteen[1] #define csum_phsum PH_per.sixteen[2] #define csum_data PH_per.thirtytwo[1] +#define pkt_tcphdr PH_loc.ptr /* * Description of external storage mapped into mbuf; valid only if M_EXT is From owner-svn-src-head@FreeBSD.ORG Sun May 4 23:42:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62DD1248; Sun, 4 May 2014 23:42:06 +0000 (UTC) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0611B1E70; Sun, 4 May 2014 23:42:05 +0000 (UTC) Received: from macbook-air.wifi.xcllnt.net (atc.xcllnt.net [50.0.150.213]) (authenticated bits=0) by mail.xcllnt.net (8.14.8/8.14.8) with ESMTP id s44Ng34A066391 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 4 May 2014 16:42:04 -0700 (PDT) (envelope-from marcel@xcllnt.net) Content-Type: multipart/signed; boundary="Apple-Mail=_0D290E8F-B4AC-4A1D-AB83-7594EAB7E83B"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r262957 - in head/etc: etc.arm etc.ia64 etc.mips etc.powerpc etc.sparc64 From: Marcel Moolenaar In-Reply-To: <53608DAF.7070606@freebsd.org> Date: Sun, 4 May 2014 16:42:03 -0700 Message-Id: <03B7BFB3-4472-4612-9AD7-F3B8D478813F@xcllnt.net> References: <201403092106.s29L6M3D056313@svn.freebsd.org> <53608DAF.7070606@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 23:42:06 -0000 --Apple-Mail=_0D290E8F-B4AC-4A1D-AB83-7594EAB7E83B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Apr 29, 2014, at 10:44 PM, Nathan Whitehorn = wrote: > On 03/09/14 14:06, Marcel Moolenaar wrote: >> Author: marcel >> Date: Sun Mar 9 21:06:22 2014 >> New Revision: 262957 >> URL: http://svnweb.freebsd.org/changeset/base/262957 >>=20 >> Log: >> Change the terminal type/class for enabled serial lines to 3wire. = This >> allows us to change the uart(4) driver to not hardcode specific = line >> settings for the serial console. >> A terminal type of 3wire makes sure the console still works when = no DCD >> signal is present, which preserves behviour. When it is known that = the >> terminal server (or DCE in general) provides DCD, a terminal = type/class >> of std can be used. This has the effect of being logged out when = one >> disconnects from the console -- improving security overall. >> Likewise, when uart(4) does not fixate the baudrate, one can = change >> the terminal type/class to set a specific baudrate. An operator can = use >> this to change the console speed mid-flight, without needing a = reboot. >> Of course it helps in this respect if and when the firmware can be >> configured from the OS. >> The above mentioned capabilities depend on uart(4) being = changed, which >> is to happen next. >>=20 >=20 > Should we set onifconsole for x86 UARTs as well? That enables them if = they are the kernel console and is probably a user friendliness = improvement. Sorry for the delay... I think that's a very good idea. I wasn't even aware of this flag. We could mark all ttyu# lines as onifconsole by default across all architectures and if that unifies the contents of the /etc/ttys file, revert back to a single one... --=20 Marcel Moolenaar marcel@xcllnt.net --Apple-Mail=_0D290E8F-B4AC-4A1D-AB83-7594EAB7E83B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iEYEARECAAYFAlNm0EsACgkQpgWlLWHuifaQ7gCeJDhhtCUrpB66NhKw4zxfatRP 9sIAnAjAwQ6H12AXArtgsvx0AoWSU20c =DilW -----END PGP SIGNATURE----- --Apple-Mail=_0D290E8F-B4AC-4A1D-AB83-7594EAB7E83B-- From owner-svn-src-head@FreeBSD.ORG Sun May 4 23:44:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A41539D; Sun, 4 May 2014 23:44:54 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 1BFB41E80; Sun, 4 May 2014 23:44:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 9D7D9383D1; Sun, 4 May 2014 18:44:52 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id xHkWUIcO94YB; Sun, 4 May 2014 18:44:52 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 4A823383D0; Sun, 4 May 2014 18:44:51 -0500 (CDT) Message-ID: <5366D0F1.4010805@freebsd.org> Date: Sun, 04 May 2014 16:44:49 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Marcel Moolenaar Subject: Re: svn commit: r262957 - in head/etc: etc.arm etc.ia64 etc.mips etc.powerpc etc.sparc64 References: <201403092106.s29L6M3D056313@svn.freebsd.org> <53608DAF.7070606@freebsd.org> <03B7BFB3-4472-4612-9AD7-F3B8D478813F@xcllnt.net> In-Reply-To: <03B7BFB3-4472-4612-9AD7-F3B8D478813F@xcllnt.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 23:44:54 -0000 On 05/04/14 16:42, Marcel Moolenaar wrote: > On Apr 29, 2014, at 10:44 PM, Nathan Whitehorn wrote: > >> On 03/09/14 14:06, Marcel Moolenaar wrote: >>> Author: marcel >>> Date: Sun Mar 9 21:06:22 2014 >>> New Revision: 262957 >>> URL: http://svnweb.freebsd.org/changeset/base/262957 >>> >>> Log: >>> Change the terminal type/class for enabled serial lines to 3wire. This >>> allows us to change the uart(4) driver to not hardcode specific line >>> settings for the serial console. >>> A terminal type of 3wire makes sure the console still works when no DCD >>> signal is present, which preserves behviour. When it is known that the >>> terminal server (or DCE in general) provides DCD, a terminal type/class >>> of std can be used. This has the effect of being logged out when one >>> disconnects from the console -- improving security overall. >>> Likewise, when uart(4) does not fixate the baudrate, one can change >>> the terminal type/class to set a specific baudrate. An operator can use >>> this to change the console speed mid-flight, without needing a reboot. >>> Of course it helps in this respect if and when the firmware can be >>> configured from the OS. >>> The above mentioned capabilities depend on uart(4) being changed, which >>> is to happen next. >>> >> Should we set onifconsole for x86 UARTs as well? That enables them if they are the kernel console and is probably a user friendliness improvement. > Sorry for the delay... > > I think that's a very good idea. I wasn't even aware of this > flag. We could mark all ttyu# lines as onifconsole by default > across all architectures and if that unifies the contents of > the /etc/ttys file, revert back to a single one... > A single ttys file would be fantastic! Could you take the lead here? I'm pretty busy at the moment. -Nathan From owner-svn-src-head@FreeBSD.ORG Mon May 5 01:14:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46868365; Mon, 5 May 2014 01:14:31 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EE7761652; Mon, 5 May 2014 01:14:29 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s451EP5S023572 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 5 May 2014 05:14:25 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s451EPmk023571; Mon, 5 May 2014 05:14:25 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 5 May 2014 05:14:25 +0400 From: Gleb Smirnoff To: Eitan Adler Subject: Re: svn commit: r265215 - in head/sys: amd64/conf boot/forth conf i386/conf pc98/conf sys Message-ID: <20140505011425.GH938@FreeBSD.org> References: <201405020714.s427EMew099192@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201405020714.s427EMew099192@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 01:14:31 -0000 On Fri, May 02, 2014 at 07:14:22AM +0000, Eitan Adler wrote: E> Author: eadler E> Date: Fri May 2 07:14:22 2014 E> New Revision: 265215 E> URL: http://svnweb.freebsd.org/changeset/base/265215 E> E> Log: E> lindev(4): finish the partial commit in r265212 E> E> lindev(4) was only used to provide /dev/full which is now a standard feature of E> FreeBSD. /dev/full was never linux-specific and provides a generally useful E> feature. E> E> Document this in UPDATING and bump __FreeBSD_version. This will be documented E> in the PH shortly. E> E> Reported by: jkim E> E> Modified: E> head/sys/amd64/conf/NOTES E> head/sys/boot/forth/loader.conf E> head/sys/conf/files.amd64 E> head/sys/conf/files.i386 E> head/sys/i386/conf/NOTES E> head/sys/pc98/conf/NOTES E> head/sys/sys/param.h ObsoletedFiles.inc should also be modified. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon May 5 01:47:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5546B9B6; Mon, 5 May 2014 01:47:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4345A1879; Mon, 5 May 2014 01:47:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s451l6iR049387; Mon, 5 May 2014 01:47:06 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s451l6Xe049386; Mon, 5 May 2014 01:47:06 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201405050147.s451l6Xe049386@svn.freebsd.org> From: Eitan Adler Date: Mon, 5 May 2014 01:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265344 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 01:47:06 -0000 Author: eadler Date: Mon May 5 01:47:05 2014 New Revision: 265344 URL: http://svnweb.freebsd.org/changeset/base/265344 Log: lindev(4): add to ObsoleteFiles - add man page - past removals did not add the .ko so don't add it this time either Reported by: gleb Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon May 5 01:29:33 2014 (r265343) +++ head/ObsoleteFiles.inc Mon May 5 01:47:05 2014 (r265344) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20140502: Removal of lindev(4) +OLD_FILES+=usr/share/man/man4/lindev.4.gz # 20140314: AppleTalk OLD_DIRS+=usr/include/netatalk OLD_FILES+=usr/include/netatalk/aarp.h @@ -49,7 +51,6 @@ OLD_FILES+=usr/include/netatalk/ddp_pcb. OLD_FILES+=usr/include/netatalk/ddp_var.h OLD_FILES+=usr/include/netatalk/endian.h OLD_FILES+=usr/include/netatalk/phase2.h - # 20140314: Remove IPX/SPX OLD_LIBS+=lib/libipx.so.5 OLD_FILES+=usr/include/netipx/ipx.h From owner-svn-src-head@FreeBSD.ORG Mon May 5 07:58:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DEF52DFE; Mon, 5 May 2014 07:58:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1C331B18; Mon, 5 May 2014 07:58:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s457w5st046161; Mon, 5 May 2014 07:58:05 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s457w5CU046159; Mon, 5 May 2014 07:58:05 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405050758.s457w5CU046159@svn.freebsd.org> From: Adrian Chadd Date: Mon, 5 May 2014 07:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265348 - in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath/ath_hal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 07:58:06 -0000 Author: adrian Date: Mon May 5 07:58:05 2014 New Revision: 265348 URL: http://svnweb.freebsd.org/changeset/base/265348 Log: Add Atheros AR1111 support to the HAL. This seems to probe/attach as an AR9485 and thus nothing else besides adding the device id seems to be required. ath0: mem 0xf4800000-0xf487ffff irq 19 at device 0.0 on pci5 ath0: [HT] enabling HT modes ath0: [HT] enabling short-GI in 20MHz mode ath0: [HT] 1 stream STBC receive enabled ath0: [HT] 1 RX streams; 1 TX streams ath0: AR9485 mac 576.1 RF5110 phy 1926.8 ath0: 2GHz radio: 0x0000; 5GHz radio: 0x0000 The NIC I have here is a 1 antenna, 2GHz only device. Thankyou to Jim Thompson for the AR1111 NIC. Tested: * AR1111 (pretending not to be an AR9485, but failing miserably); STA mode with powersave. Relnotes: yes Sponsored by: Netgate Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c head/sys/dev/ath/ath_hal/ah_devid.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Mon May 5 07:40:55 2014 (r265347) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c Mon May 5 07:58:05 2014 (r265348) @@ -4113,6 +4113,8 @@ ar9300_probe(uint16_t vendorid, uint16_t return "Qualcomm Atheros QCA955x"; case AR9300_DEVID_QCA9565: /* Aphrodite */ return "Qualcomm Atheros AR9565"; + case AR9300_DEVID_AR1111_PCIE: + return "Atheros AR1111"; default: return AH_NULL; } Modified: head/sys/dev/ath/ath_hal/ah_devid.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_devid.h Mon May 5 07:40:55 2014 (r265347) +++ head/sys/dev/ath/ath_hal/ah_devid.h Mon May 5 07:58:05 2014 (r265348) @@ -92,6 +92,7 @@ #define AR9300_DEVID_AR946X_PCIE 0x0034 #define AR9300_DEVID_AR9330 0x0035 #define AR9300_DEVID_QCA9565 0x0036 +#define AR9300_DEVID_AR1111_PCIE 0x0037 #define AR9300_DEVID_QCA955X 0x0039 #define AR_SUBVENDOR_ID_NOG 0x0e11 /* No 11G subvendor ID */ From owner-svn-src-head@FreeBSD.ORG Mon May 5 08:00:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40D7EF65; Mon, 5 May 2014 08:00:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13E8A1BB3; Mon, 5 May 2014 08:00:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4580oQo048466; Mon, 5 May 2014 08:00:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4580oZg048464; Mon, 5 May 2014 08:00:50 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405050800.s4580oZg048464@svn.freebsd.org> From: Adrian Chadd Date: Mon, 5 May 2014 08:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265349 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 08:00:51 -0000 Author: adrian Date: Mon May 5 08:00:50 2014 New Revision: 265349 URL: http://svnweb.freebsd.org/changeset/base/265349 Log: Quieten the RX/TX descriptor and FIFO setup debugging. Tested: * AR9485, STA mode Modified: head/sys/dev/ath/if_ath_rx_edma.c head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Mon May 5 07:58:05 2014 (r265348) +++ head/sys/dev/ath/if_ath_rx_edma.c Mon May 5 08:00:50 2014 (r265349) @@ -888,10 +888,13 @@ ath_edma_setup_rxfifo(struct ath_softc * qtype); return (-EINVAL); } - device_printf(sc->sc_dev, "%s: type=%d, FIFO depth = %d entries\n", - __func__, - qtype, - re->m_fifolen); + + if (bootverbose) + device_printf(sc->sc_dev, + "%s: type=%d, FIFO depth = %d entries\n", + __func__, + qtype, + re->m_fifolen); /* Allocate ath_buf FIFO array, pre-zero'ed */ re->m_fifo = malloc(sizeof(struct ath_buf *) * re->m_fifolen, @@ -982,10 +985,12 @@ ath_recv_setup_edma(struct ath_softc *sc (void) ath_hal_setrxbufsize(sc->sc_ah, sc->sc_edma_bufsize - sc->sc_rx_statuslen); - device_printf(sc->sc_dev, "RX status length: %d\n", - sc->sc_rx_statuslen); - device_printf(sc->sc_dev, "RX buffer size: %d\n", - sc->sc_edma_bufsize); + if (bootverbose) { + device_printf(sc->sc_dev, "RX status length: %d\n", + sc->sc_rx_statuslen); + device_printf(sc->sc_dev, "RX buffer size: %d\n", + sc->sc_edma_bufsize); + } sc->sc_rx.recv_stop = ath_edma_stoprecv; sc->sc_rx.recv_start = ath_edma_startrecv; Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Mon May 5 07:58:05 2014 (r265348) +++ head/sys/dev/ath/if_ath_tx_edma.c Mon May 5 08:00:50 2014 (r265349) @@ -866,12 +866,14 @@ ath_xmit_setup_edma(struct ath_softc *sc (void) ath_hal_gettxstatuslen(sc->sc_ah, &sc->sc_tx_statuslen); (void) ath_hal_getntxmaps(sc->sc_ah, &sc->sc_tx_nmaps); - device_printf(sc->sc_dev, "TX descriptor length: %d\n", - sc->sc_tx_desclen); - device_printf(sc->sc_dev, "TX status length: %d\n", - sc->sc_tx_statuslen); - device_printf(sc->sc_dev, "TX buffers per descriptor: %d\n", - sc->sc_tx_nmaps); + if (bootverbose) { + device_printf(sc->sc_dev, "TX descriptor length: %d\n", + sc->sc_tx_desclen); + device_printf(sc->sc_dev, "TX status length: %d\n", + sc->sc_tx_statuslen); + device_printf(sc->sc_dev, "TX buffers per descriptor: %d\n", + sc->sc_tx_nmaps); + } sc->sc_tx.xmit_setup = ath_edma_dma_txsetup; sc->sc_tx.xmit_teardown = ath_edma_dma_txteardown; From owner-svn-src-head@FreeBSD.ORG Mon May 5 08:12:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBC45333; Mon, 5 May 2014 08:12:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FFA61CA7; Mon, 5 May 2014 08:12:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s458CLSv054609; Mon, 5 May 2014 08:12:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s458CLXZ054608; Mon, 5 May 2014 08:12:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405050812.s458CLXZ054608@svn.freebsd.org> From: Adrian Chadd Date: Mon, 5 May 2014 08:12:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265350 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 08:12:21 -0000 Author: adrian Date: Mon May 5 08:12:21 2014 New Revision: 265350 URL: http://svnweb.freebsd.org/changeset/base/265350 Log: Break out the multicast programming into its own hardware specific call, which assumes the hardware is awake. Turn ath_update_mcast() into a routine that's only called from the net80211 layer - and it forces the hardware awake first. This fixes a LOR from the EDMA RX path which calls ath_mode_init() with the RX lock held - the driver lock can't also be grabbed. This path assumes that the ath_mode_init() callers all wake up the NIC first. Tested: * AR9485, STA mode, powersave Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon May 5 08:00:50 2014 (r265349) +++ head/sys/dev/ath/if_ath.c Mon May 5 08:12:21 2014 (r265350) @@ -165,6 +165,7 @@ static void ath_bmiss_vap(struct ieee802 static void ath_bmiss_proc(void *, int); static void ath_key_update_begin(struct ieee80211vap *); static void ath_key_update_end(struct ieee80211vap *); +static void ath_update_mcast_hw(struct ath_softc *); static void ath_update_mcast(struct ifnet *); static void ath_update_promisc(struct ifnet *); static void ath_updateslot(struct ifnet *); @@ -3379,10 +3380,15 @@ ath_update_promisc(struct ifnet *ifp) DPRINTF(sc, ATH_DEBUG_MODE, "%s: RX filter 0x%x\n", __func__, rfilt); } +/* + * Driver-internal mcast update call. + * + * Assumes the hardware is already awake. + */ static void -ath_update_mcast(struct ifnet *ifp) +ath_update_mcast_hw(struct ath_softc *sc) { - struct ath_softc *sc = ifp->if_softc; + struct ifnet *ifp = sc->sc_ifp; u_int32_t mfilt[2]; /* calculate and install multicast filter */ @@ -3410,13 +3416,31 @@ ath_update_mcast(struct ifnet *ifp) if_maddr_runlock(ifp); } else mfilt[0] = mfilt[1] = ~0; + + ath_hal_setmcastfilter(sc->sc_ah, mfilt[0], mfilt[1]); + + DPRINTF(sc, ATH_DEBUG_MODE, "%s: MC filter %08x:%08x\n", + __func__, mfilt[0], mfilt[1]); +} + +/* + * Called from the net80211 layer - force the hardware + * awake before operating. + */ +static void +ath_update_mcast(struct ifnet *ifp) +{ + struct ath_softc *sc = ifp->if_softc; + ATH_LOCK(sc); ath_power_set_power_state(sc, HAL_PM_AWAKE); - ath_hal_setmcastfilter(sc->sc_ah, mfilt[0], mfilt[1]); + ATH_UNLOCK(sc); + + ath_update_mcast_hw(sc); + + ATH_LOCK(sc); ath_power_restore_power_state(sc); ATH_UNLOCK(sc); - DPRINTF(sc, ATH_DEBUG_MODE, "%s: MC filter %08x:%08x\n", - __func__, mfilt[0], mfilt[1]); } void @@ -3444,7 +3468,7 @@ ath_mode_init(struct ath_softc *sc) ath_hal_setmac(ah, IF_LLADDR(ifp)); /* calculate and install multicast filter */ - ath_update_mcast(ifp); + ath_update_mcast_hw(sc); } /* From owner-svn-src-head@FreeBSD.ORG Mon May 5 09:20:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2CF8D3; Mon, 5 May 2014 09:20:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF44F1359; Mon, 5 May 2014 09:20:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s459KU6T081999; Mon, 5 May 2014 09:20:30 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s459KUfi081998; Mon, 5 May 2014 09:20:30 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405050920.s459KUfi081998@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 5 May 2014 09:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265351 - head/sys/geom/label X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 09:20:31 -0000 Author: trasz Date: Mon May 5 09:20:30 2014 New Revision: 265351 URL: http://svnweb.freebsd.org/changeset/base/265351 Log: Make r242379 - the fix for UFS labels disappearing after resizing the provider - also apply to UFS1 filesystems. This should help with resizing filesystems created by makefs(8), which still uses UFS1. Tested by: jmg@ Sponsored by: The FreeBSD Foundation Modified: head/sys/geom/label/g_label_ufs.c Modified: head/sys/geom/label/g_label_ufs.c ============================================================================== --- head/sys/geom/label/g_label_ufs.c Mon May 5 08:12:21 2014 (r265350) +++ head/sys/geom/label/g_label_ufs.c Mon May 5 09:20:30 2014 (r265351) @@ -81,13 +81,15 @@ g_label_ufs_taste_common(struct g_consum fs = (struct fs *)g_read_data(cp, superblock, SBLOCKSIZE, NULL); if (fs == NULL) continue; - /* Check for magic. We also need to check if file system size is equal + /* + * Check for magic. We also need to check if file system size is equal * to providers size, because sysinstall(8) used to bogusly put first * partition at offset 0 instead of 16, and glabel/ufs would find file * system on slice instead of partition. */ if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_fsize > 0 && - pp->mediasize / fs->fs_fsize == fs->fs_old_size) { + ((pp->mediasize / fs->fs_fsize == fs->fs_old_size) || + (pp->mediasize / fs->fs_fsize == fs->fs_providersize))) { /* Valid UFS1. */ } else if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_fsize > 0 && ((pp->mediasize / fs->fs_fsize == fs->fs_size) || From owner-svn-src-head@FreeBSD.ORG Mon May 5 11:50:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E58DA971; Mon, 5 May 2014 11:50:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFA741489; Mon, 5 May 2014 11:50:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45BoqEw055516; Mon, 5 May 2014 11:50:52 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45BoqID055514; Mon, 5 May 2014 11:50:52 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405051150.s45BoqID055514@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 5 May 2014 11:50:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265358 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 11:50:53 -0000 Author: hselasky Date: Mon May 5 11:50:52 2014 New Revision: 265358 URL: http://svnweb.freebsd.org/changeset/base/265358 Log: Improve DWC OTG USB host side support for isochronous FULL and HIGH speed data traffic going directly to a USB device or through a so-called USB transaction translator. Add checks that we are not overusing the TX FIFO. MFC after: 2 weeks Modified: head/sys/dev/usb/controller/dwc_otg.c head/sys/dev/usb/controller/dwc_otg.h head/sys/dev/usb/controller/dwc_otgreg.h Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Mon May 5 11:30:45 2014 (r265357) +++ head/sys/dev/usb/controller/dwc_otg.c Mon May 5 11:50:52 2014 (r265358) @@ -207,6 +207,12 @@ dwc_otg_init_fifo(struct dwc_otg_softc * /* reset active endpoints */ sc->sc_active_rx_ep = 0; + /* reset TX size */ + sc->sc_tx_cur_size = 0; + + /* reset TT info */ + memset(sc->sc_tt_info, 0, sizeof(sc->sc_tt_info)); + fifo_size /= 2; DWC_OTG_WRITE_4(sc, DOTG_GNPTXFSIZ, @@ -215,19 +221,17 @@ dwc_otg_init_fifo(struct dwc_otg_softc * tx_start += fifo_size; + for (x = 0; x != sc->sc_host_ch_max; x++) { + /* enable all needed interrupts */ + DWC_OTG_WRITE_4(sc, DOTG_HCINTMSK(x), HCINT_DEFAULT_MASK); + } + DWC_OTG_WRITE_4(sc, DOTG_HPTXFSIZ, ((fifo_size / 4) << 16) | (tx_start / 4)); - for (x = 0; x != sc->sc_host_ch_max; x++) { - /* enable interrupts */ - DWC_OTG_WRITE_4(sc, DOTG_HCINTMSK(x), - HCINT_STALL | HCINT_BBLERR | - HCINT_XACTERR | - HCINT_NAK | HCINT_ACK | HCINT_NYET | - HCINT_CHHLTD | HCINT_FRMOVRUN | - HCINT_DATATGLERR); - } + /* store maximum TX FIFO size */ + sc->sc_tx_max_size = fifo_size; /* enable host channel interrupts */ DWC_OTG_WRITE_4(sc, DOTG_HAINTMSK, @@ -309,6 +313,12 @@ dwc_otg_init_fifo(struct dwc_otg_softc * } else { /* reset active endpoints */ sc->sc_active_rx_ep = 0; + + /* reset TX size */ + sc->sc_tx_cur_size = 0; + + /* reset TT info */ + memset(sc->sc_tt_info, 0, sizeof(sc->sc_tt_info)); } return (0); } @@ -376,9 +386,9 @@ dwc_otg_pull_down(struct dwc_otg_softc * static void dwc_otg_enable_sof_irq(struct dwc_otg_softc *sc) { - if (sc->sc_irq_mask & GINTSTS_SOF) + if (sc->sc_irq_mask & GINTMSK_SOFMSK) return; - sc->sc_irq_mask |= GINTSTS_SOF; + sc->sc_irq_mask |= GINTMSK_SOFMSK; DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); } @@ -506,6 +516,7 @@ dwc_otg_clear_hcint(struct dwc_otg_softc { uint32_t hcint; + /* clear all pending interrupts */ hcint = DWC_OTG_READ_4(sc, DOTG_HCINT(x)); DWC_OTG_WRITE_4(sc, DOTG_HCINT(x), hcint); @@ -513,6 +524,10 @@ dwc_otg_clear_hcint(struct dwc_otg_softc sc->sc_chan_state[x].hcint = 0; } +/* + * This function waits until a DWC OTG host channel is ready to be + * used again: + */ static uint8_t dwc_otg_host_channel_wait(struct dwc_otg_td *td) { @@ -545,6 +560,9 @@ dwc_otg_host_channel_wait(struct dwc_otg sc->sc_chan_state[td->channel].allocated = 0; sc->sc_chan_state[x].allocated = 1; + sc->sc_chan_state[x].tx_size = + sc->sc_chan_state[td->channel].tx_size; + if (sc->sc_chan_state[td->channel].suspended) { sc->sc_chan_state[td->channel].suspended = 0; sc->sc_chan_state[x].suspended = 1; @@ -579,6 +597,7 @@ static uint8_t dwc_otg_host_channel_alloc(struct dwc_otg_td *td) { struct dwc_otg_softc *sc; + uint32_t tx_size; uint8_t x; uint8_t max_channel; @@ -591,9 +610,25 @@ dwc_otg_host_channel_alloc(struct dwc_ot if ((td->hcchar & HCCHAR_EPNUM_MASK) == 0) { max_channel = 1; x = 0; + tx_size = td->max_packet_size; + if ((sc->sc_tx_cur_size + tx_size) > sc->sc_tx_max_size) { + DPRINTF("Too little FIFO space\n"); + return (1); /* too little FIFO */ + } } else { max_channel = sc->sc_host_ch_max; x = 1; + if ((td->hcchar & HCCHAR_EPDIR) == HCCHAR_EPDIR_OUT) { + tx_size = td->max_packet_size; + if (td->hcsplt != 0 && tx_size > HCSPLT_XACTLEN_MAX) + tx_size = HCSPLT_XACTLEN_MAX; + if ((sc->sc_tx_cur_size + tx_size) > sc->sc_tx_max_size) { + DPRINTF("Too little FIFO space\n"); + return (1); /* too little FIFO */ + } + } else { + tx_size = 0; + } } for (; x != max_channel; x++) { @@ -604,6 +639,10 @@ dwc_otg_host_channel_alloc(struct dwc_ot continue; sc->sc_chan_state[x].allocated = 1; + sc->sc_chan_state[x].tx_size = tx_size; + + /* keep track of used FIFO */ + sc->sc_tx_cur_size += tx_size; /* clear interrupts */ dwc_otg_clear_hcint(sc, x); @@ -663,6 +702,9 @@ dwc_otg_host_channel_free(struct dwc_otg sc->sc_chan_state[x].allocated = 0; sc->sc_chan_state[x].suspended = 0; + /* keep track of used FIFO */ + sc->sc_tx_cur_size -= sc->sc_chan_state[x].tx_size; + /* ack any pending messages */ if (sc->sc_last_rx_status != 0 && GRXSTSRD_CHNUM_GET(sc->sc_last_rx_status) == x) { @@ -724,6 +766,8 @@ dwc_otg_host_setup_tx(struct dwc_otg_td switch (td->state) { case DWC_CHAN_ST_START: + if (!dwc_otg_host_channel_wait(td)) + break; goto send_pkt; case DWC_CHAN_ST_WAIT_ANE: @@ -731,6 +775,7 @@ dwc_otg_host_setup_tx(struct dwc_otg_td if (!dwc_otg_host_channel_wait(td)) break; td->did_nak = 1; + td->tt_scheduled = 0; goto send_pkt; } if (hcint & (HCINT_ACK | HCINT_NYET)) { @@ -739,14 +784,17 @@ dwc_otg_host_setup_tx(struct dwc_otg_td td->offset += td->tx_bytes; td->remainder -= td->tx_bytes; td->toggle = 1; + td->tt_scheduled = 0; return (0); /* complete */ } break; + case DWC_CHAN_ST_WAIT_S_ANE: if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { if (!dwc_otg_host_channel_wait(td)) break; td->did_nak = 1; + td->tt_scheduled = 0; goto send_pkt; } if (hcint & (HCINT_ACK | HCINT_NYET)) { @@ -755,6 +803,7 @@ dwc_otg_host_setup_tx(struct dwc_otg_td goto send_cpkt; } break; + case DWC_CHAN_ST_WAIT_C_ANE: if (hcint & HCINT_NYET) { if (!dwc_otg_host_channel_wait(td)) @@ -765,6 +814,7 @@ dwc_otg_host_setup_tx(struct dwc_otg_td if (!dwc_otg_host_channel_wait(td)) break; td->did_nak = 1; + td->tt_scheduled = 0; goto send_pkt; } if (hcint & HCINT_ACK) { @@ -776,8 +826,12 @@ dwc_otg_host_setup_tx(struct dwc_otg_td return (0); /* complete */ } break; - case DWC_CHAN_ST_TX_PKT_SYNC: - goto send_pkt_sync; + + case DWC_CHAN_ST_WAIT_C_PKT: + if (!dwc_otg_host_channel_wait(td)) + break; + goto send_cpkt; + default: break; } @@ -789,19 +843,13 @@ send_pkt: return (0); /* complete */ } -send_pkt_sync: if (td->hcsplt != 0) { - uint32_t count; - - count = DWC_OTG_READ_4(sc, DOTG_HFNUM) & 7; - /* check for not first microframe */ - if (count != 0) { - /* enable SOF interrupt */ - dwc_otg_enable_sof_irq(sc); - /* set state */ - td->state = DWC_CHAN_ST_TX_PKT_SYNC; - dwc_otg_host_channel_free(td); - return (1); /* busy */ + /* Wait for our turn, if TT transfer */ + if (td->tt_scheduled == 0 || + (sc->sc_last_frame_num & 7) < td->tt_start_slot) { + /* set return state */ + td->state = DWC_CHAN_ST_START; + goto tt_wait; } td->hcsplt &= ~HCSPLT_COMPSPLT; @@ -835,6 +883,16 @@ send_pkt_sync: return (1); /* busy */ send_cpkt: + /* Wait for our turn, if TT transfer */ + if (td->tt_scheduled == 0 || + (sc->sc_last_frame_num & 7) < td->tt_complete_slot) { + /* set return state */ + td->state = DWC_CHAN_ST_WAIT_C_PKT; + goto tt_wait; + } + /* wait until next slot before trying again */ + td->tt_complete_slot++; + td->hcsplt |= HCSPLT_COMPSPLT; td->state = DWC_CHAN_ST_WAIT_C_ANE; @@ -848,7 +906,14 @@ send_cpkt: /* must enable channel before writing data to FIFO */ DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel), hcchar); + return (1); /* busy */ +tt_wait: + /* enable SOF interrupt */ + dwc_otg_enable_sof_irq(sc); + + /* free allocated channel */ + dwc_otg_host_channel_free(td); return (1); /* busy */ } @@ -984,6 +1049,25 @@ not_complete: } static uint8_t +dwc_otg_host_rate_check_interrupt(struct dwc_otg_softc *sc, struct dwc_otg_td *td) +{ + uint8_t delta; + + delta = sc->sc_tmr_val - td->tmr_val; + if (delta >= 128) + return (1); /* busy */ + + td->tmr_val = sc->sc_tmr_val + td->tmr_res; + + /* set toggle, if any */ + if (td->set_toggle) { + td->set_toggle = 0; + td->toggle = 1; + } + return (0); +} + +static uint8_t dwc_otg_host_rate_check(struct dwc_otg_td *td) { struct dwc_otg_softc *sc; @@ -992,31 +1076,30 @@ dwc_otg_host_rate_check(struct dwc_otg_t /* get pointer to softc */ sc = DWC_OTG_PC2SC(td->pc); + if (td->channel < DWC_OTG_MAX_CHANNELS && + sc->sc_chan_state[td->channel].suspended) + goto busy; + ep_type = ((td->hcchar & HCCHAR_EPTYPE_MASK) >> HCCHAR_EPTYPE_SHIFT); - if (sc->sc_chan_state[td->channel].suspended) - goto busy; - if (ep_type == UE_ISOCHRONOUS) { - if (td->tmr_val & 1) - td->hcchar |= HCCHAR_ODDFRM; - else - td->hcchar &= ~HCCHAR_ODDFRM; - td->tmr_val += td->tmr_res; - } else if (ep_type == UE_INTERRUPT) { - uint8_t delta; - delta = sc->sc_tmr_val - td->tmr_val; - if (delta >= 128) + /* non TT isochronous traffic */ + if ((td->tmr_val != 0) || + (sc->sc_last_frame_num & (td->tmr_res - 1))) { + /* enable SOF interrupt */ + dwc_otg_enable_sof_irq(sc); goto busy; - td->tmr_val = sc->sc_tmr_val + td->tmr_res; + } + td->tmr_val = 1; /* executed */ + td->toggle = 0; + + } else if (ep_type == UE_INTERRUPT) { + /* non TT interrupt traffic */ + return (dwc_otg_host_rate_check_interrupt(sc, td)); } else if (td->did_nak != 0) { goto busy; - } - - if (ep_type == UE_ISOCHRONOUS) { - td->toggle = 0; } else if (td->set_toggle) { td->set_toggle = 0; td->toggle = 1; @@ -1065,8 +1148,10 @@ dwc_otg_host_data_rx(struct dwc_otg_td * DPRINTF("CH=%d ERROR\n", td->channel); td->errcnt++; if (td->hcsplt != 0 || td->errcnt >= 3) { - td->error_any = 1; - return (0); /* complete */ + if (ep_type != UE_ISOCHRONOUS) { + td->error_any = 1; + return (0); /* complete */ + } } } @@ -1103,25 +1188,42 @@ dwc_otg_host_data_rx(struct dwc_otg_td * break; } - td->toggle ^= 1; - /* get the packet byte count */ count = GRXSTSRD_BCNT_GET(sc->sc_last_rx_status); - /* verify the packet byte count */ - if (count != td->max_packet_size) { - if (count < td->max_packet_size) { - /* we have a short packet */ - td->short_pkt = 1; - td->got_short = 1; + /* check for isochronous transfer or high-speed bandwidth endpoint */ + if (ep_type == UE_ISOCHRONOUS || td->max_packet_count > 1) { + if ((sc->sc_last_rx_status & GRXSTSRD_DPID_MASK) != GRXSTSRD_DPID_DATA0) { + td->tt_xactpos = HCSPLT_XACTPOS_MIDDLE; } else { - /* invalid USB packet */ - td->error_any = 1; + td->tt_xactpos = HCSPLT_XACTPOS_BEGIN; + + /* verify the packet byte count */ + if (count < td->max_packet_size) { + /* we have a short packet */ + td->short_pkt = 1; + td->got_short = 1; + } + } + td->toggle = 0; + } else { + /* verify the packet byte count */ + if (count != td->max_packet_size) { + if (count < td->max_packet_size) { + /* we have a short packet */ + td->short_pkt = 1; + td->got_short = 1; + } else { + /* invalid USB packet */ + td->error_any = 1; - /* release FIFO */ - dwc_otg_common_rx_ack(sc); - return (0); /* we are complete */ + /* release FIFO */ + dwc_otg_common_rx_ack(sc); + return (0); /* we are complete */ + } } + td->toggle ^= 1; + td->tt_scheduled = 0; } /* verify the packet byte count */ @@ -1144,7 +1246,6 @@ dwc_otg_host_data_rx(struct dwc_otg_td * break; default: - DPRINTF("OTHER\n"); break; } /* release FIFO */ @@ -1153,6 +1254,8 @@ dwc_otg_host_data_rx(struct dwc_otg_td * check_state: switch (td->state) { case DWC_CHAN_ST_START: + if (!dwc_otg_host_channel_wait(td)) + break; if (td->hcsplt != 0) goto receive_spkt; else @@ -1164,6 +1267,7 @@ check_state: break; td->did_nak = 1; + td->tt_scheduled = 0; if (td->hcsplt != 0) goto receive_spkt; else @@ -1171,11 +1275,13 @@ check_state: } if (!(hcint & HCINT_SOFTWARE_ONLY)) { if (hcint & HCINT_NYET) { - if (td->hcsplt != 0) { - if (!dwc_otg_host_channel_wait(td)) - break; - goto receive_pkt; + if (ep_type == UE_ISOCHRONOUS) { + /* we missed the service interval */ + return (0); /* complete */ } + if (!dwc_otg_host_channel_wait(td)) + break; + goto receive_pkt; } break; } @@ -1183,29 +1289,44 @@ check_state: if (!dwc_otg_host_channel_wait(td)) break; - /* check if we are complete */ - if ((td->remainder == 0) || (td->got_short != 0)) { - if (td->short_pkt) + if (ep_type == UE_ISOCHRONOUS) { + /* check if we are complete */ + if ((td->remainder == 0) || + (td->tt_xactpos == HCSPLT_XACTPOS_BEGIN)) return (0); /* complete */ - /* - * Else need to receive a zero length - * packet. - */ - } - if (td->hcsplt != 0) - goto receive_spkt; - else goto receive_pkt; + } else { + /* check if we are complete */ + if ((td->remainder == 0) || (td->got_short != 0)) { + if (td->short_pkt) + return (0); /* complete */ + + /* + * Else need to receive a zero length + * packet. + */ + } + td->tt_scheduled = 0; + if (td->hcsplt != 0) + goto receive_spkt; + else + goto receive_pkt; + } } break; case DWC_CHAN_ST_WAIT_S_ANE: + /* + * NOTE: The DWC OTG hardware provides a fake ACK in + * case of interrupt and isochronous transfers: + */ if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { if (!dwc_otg_host_channel_wait(td)) break; td->did_nak = 1; + td->tt_scheduled = 0; goto receive_spkt; } if (hcint & (HCINT_ACK | HCINT_NYET)) { @@ -1215,100 +1336,91 @@ check_state: } break; - case DWC_CHAN_ST_RX_PKT: + case DWC_CHAN_ST_WAIT_C_PKT: + if (!dwc_otg_host_channel_wait(td)) + break; goto receive_pkt; - case DWC_CHAN_ST_RX_SPKT: - goto receive_spkt; - - case DWC_CHAN_ST_RX_SPKT_SYNC: - goto receive_spkt_sync; - default: break; } goto busy; receive_pkt: - if (td->hcsplt != 0) { - count = DWC_OTG_READ_4(sc, DOTG_HFNUM) & 7; - - /* check for even microframes */ - if (count == td->curr_frame) { - td->state = DWC_CHAN_ST_RX_PKT; - dwc_otg_host_channel_free(td); - /* enable SOF interrupt */ - dwc_otg_enable_sof_irq(sc); - goto busy; - } else if (count == 0) { - /* check for start split timeout */ - goto receive_spkt; + if (td->hcsplt != 0) { + /* Wait for our turn, if TT transfer */ + if (td->tt_scheduled == 0 || + (sc->sc_last_frame_num & 7) < td->tt_complete_slot) { + /* set return state */ + td->state = DWC_CHAN_ST_WAIT_C_PKT; + goto tt_wait; + } + /* wait until next slot before trying again */ + td->tt_complete_slot++; + + /* set toggle, if any */ + if (td->set_toggle) { + td->set_toggle = 0; + td->toggle = 1; } - - td->curr_frame = count; td->hcsplt |= HCSPLT_COMPSPLT; - } else if (dwc_otg_host_rate_check(td)) { - td->state = DWC_CHAN_ST_RX_PKT; + count = HCSPLT_XACTLEN_MAX; + } else if (td->tt_xactpos == HCSPLT_XACTPOS_BEGIN && + dwc_otg_host_rate_check(td)) { + td->state = DWC_CHAN_ST_START; dwc_otg_host_channel_free(td); goto busy; + } else { + count = td->max_packet_size; } - td->state = DWC_CHAN_ST_WAIT_ANE; /* receive one packet */ DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), - (td->max_packet_size << HCTSIZ_XFERSIZE_SHIFT) | + (count << HCTSIZ_XFERSIZE_SHIFT) | (1 << HCTSIZ_PKTCNT_SHIFT) | (td->toggle ? (HCTSIZ_PID_DATA1 << HCTSIZ_PID_SHIFT) : (HCTSIZ_PID_DATA0 << HCTSIZ_PID_SHIFT))); DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel), td->hcsplt); + /* send ASAP */ + if ((ep_type == UE_ISOCHRONOUS) && !(sc->sc_last_frame_num & 1)) + td->hcchar |= HCCHAR_ODDFRM; + else + td->hcchar &= ~HCCHAR_ODDFRM; + hcchar = td->hcchar; hcchar |= HCCHAR_EPDIR_IN; /* must enable channel before data can be received */ DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel), hcchar); - goto busy; receive_spkt: - if (dwc_otg_host_rate_check(td)) { - td->state = DWC_CHAN_ST_RX_SPKT; - dwc_otg_host_channel_free(td); - goto busy; - } - -receive_spkt_sync: - if (ep_type == UE_INTERRUPT || - ep_type == UE_ISOCHRONOUS) { - count = DWC_OTG_READ_4(sc, DOTG_HFNUM) & 7; - td->curr_frame = count; - - /* check for non-zero microframe */ - if (count != 0) { - /* enable SOF interrupt */ - dwc_otg_enable_sof_irq(sc); - /* set state */ - td->state = DWC_CHAN_ST_RX_SPKT_SYNC; - dwc_otg_host_channel_free(td); - goto busy; - } - } else { - count = DWC_OTG_READ_4(sc, DOTG_HFNUM) & 7; - td->curr_frame = count; - - /* check for two last frames */ - if (count >= 6) { - /* enable SOF interrupt */ - dwc_otg_enable_sof_irq(sc); - /* set state */ - td->state = DWC_CHAN_ST_RX_SPKT_SYNC; + /* Wait for our turn, if TT transfer */ + if (td->tt_scheduled == 0) { + if (ep_type == UE_INTERRUPT) { + td->state = DWC_CHAN_ST_START; dwc_otg_host_channel_free(td); goto busy; } + /* set return state */ + td->state = DWC_CHAN_ST_START; + goto tt_wait; + } + if ((sc->sc_last_frame_num & 7) < td->tt_start_slot) { + /* set return state */ + td->state = DWC_CHAN_ST_START; + goto tt_wait; } + /* send ASAP */ + if ((ep_type == UE_ISOCHRONOUS) && !(sc->sc_last_frame_num & 1)) + td->hcchar |= HCCHAR_ODDFRM; + else + td->hcchar &= ~HCCHAR_ODDFRM; + td->hcsplt &= ~HCSPLT_COMPSPLT; td->state = DWC_CHAN_ST_WAIT_S_ANE; @@ -1324,7 +1436,14 @@ receive_spkt_sync: /* must enable channel before data can be received */ DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel), hcchar); + goto busy; + +tt_wait: + /* enable SOF interrupt */ + dwc_otg_enable_sof_irq(sc); + /* free allocated channel */ + dwc_otg_host_channel_free(td); busy: return (1); /* busy */ } @@ -1497,6 +1616,8 @@ dwc_otg_host_data_tx(struct dwc_otg_td * switch (td->state) { case DWC_CHAN_ST_START: + if (!dwc_otg_host_channel_wait(td)) + break; goto send_pkt; case DWC_CHAN_ST_WAIT_ANE: @@ -1504,6 +1625,7 @@ dwc_otg_host_data_tx(struct dwc_otg_td * if (!dwc_otg_host_channel_wait(td)) break; td->did_nak = 1; + td->tt_scheduled = 0; goto send_pkt; } if (hcint & (HCINT_ACK | HCINT_NYET)) { @@ -1513,6 +1635,7 @@ dwc_otg_host_data_tx(struct dwc_otg_td * td->offset += td->tx_bytes; td->remainder -= td->tx_bytes; td->toggle ^= 1; + td->tt_scheduled = 0; /* check remainder */ if (td->remainder == 0) { @@ -1527,11 +1650,13 @@ dwc_otg_host_data_tx(struct dwc_otg_td * goto send_pkt; } break; + case DWC_CHAN_ST_WAIT_S_ANE: if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { if (!dwc_otg_host_channel_wait(td)) break; td->did_nak = 1; + td->tt_scheduled = 0; goto send_pkt; } if (hcint & (HCINT_ACK | HCINT_NYET)) { @@ -1540,6 +1665,7 @@ dwc_otg_host_data_tx(struct dwc_otg_td * goto send_cpkt; } break; + case DWC_CHAN_ST_WAIT_C_ANE: if (hcint & HCINT_NYET) { if (!dwc_otg_host_channel_wait(td)) @@ -1550,6 +1676,7 @@ dwc_otg_host_data_tx(struct dwc_otg_td * if (!dwc_otg_host_channel_wait(td)) break; td->did_nak = 1; + td->tt_scheduled = 0; goto send_pkt; } if (hcint & HCINT_ACK) { @@ -1558,6 +1685,7 @@ dwc_otg_host_data_tx(struct dwc_otg_td * td->offset += td->tx_bytes; td->remainder -= td->tx_bytes; td->toggle ^= 1; + td->tt_scheduled = 0; /* check remainder */ if (td->remainder == 0) { @@ -1570,64 +1698,204 @@ dwc_otg_host_data_tx(struct dwc_otg_td * } break; - case DWC_CHAN_ST_TX_PKT: - goto send_pkt; + case DWC_CHAN_ST_WAIT_C_PKT: + if (!dwc_otg_host_channel_wait(td)) + break; + goto send_cpkt; - case DWC_CHAN_ST_TX_PKT_SYNC: - goto send_pkt_sync; + case DWC_CHAN_ST_TX_WAIT_ISOC: - case DWC_CHAN_ST_TX_CPKT: - goto send_cpkt; + /* Check if isochronous OUT traffic is complete */ + if ((hcint & HCINT_ACK) == 0) + break; + + td->offset += td->tx_bytes; + td->remainder -= td->tx_bytes; + /* Update split token according to specification */ + if (td->hcsplt != 0) { + if (td->tt_xactpos == HCSPLT_XACTPOS_BEGIN) + td->tt_xactpos = HCSPLT_XACTPOS_MIDDLE; + } else if (td->max_packet_count > 1) { + td->tt_xactpos++; + } + + dwc_otg_host_channel_disable(sc, td->channel); + + if (td->remainder == 0) + return (0); /* complete */ + + td->state = DWC_CHAN_ST_TX_PKT_ISOC; + + /* FALLTHROUGH */ + + case DWC_CHAN_ST_TX_PKT_ISOC: + if (!dwc_otg_host_channel_wait(td)) + break; + + if (td->hcsplt != 0) { + if ((sc->sc_last_frame_num & 7) < td->tt_start_slot) + goto tt_wait; + /* packets must be 125us apart */ + td->tt_start_slot++; + } + goto send_isoc_pkt; default: break; } goto busy; send_pkt: - if (dwc_otg_host_rate_check(td)) { - td->state = DWC_CHAN_ST_TX_PKT; + if (td->hcsplt != 0) { + /* Wait for our turn, if TT transfer */ + if (td->tt_scheduled == 0) { + if (ep_type == UE_INTERRUPT) { + td->state = DWC_CHAN_ST_START; + dwc_otg_host_channel_free(td); + goto busy; + } + /* set return state */ + td->state = DWC_CHAN_ST_START; + goto tt_wait; + } + if ((sc->sc_last_frame_num & 7) < td->tt_start_slot) { + /* set return state */ + td->state = DWC_CHAN_ST_START; + goto tt_wait; + } + + /* packets must be 125us apart */ + td->tt_start_slot++; + + /* set toggle, if any */ + if (td->set_toggle) { + td->set_toggle = 0; + td->toggle = 1; + } + } else if (dwc_otg_host_rate_check(td)) { + td->state = DWC_CHAN_ST_START; dwc_otg_host_channel_free(td); goto busy; } -send_pkt_sync: - if (td->hcsplt != 0) { - count = DWC_OTG_READ_4(sc, DOTG_HFNUM) & 7; - /* check for first or last microframe */ - if (count == 7 || count == 0) { - /* enable SOF interrupt */ - dwc_otg_enable_sof_irq(sc); - /* set state */ - td->state = DWC_CHAN_ST_TX_PKT_SYNC; - dwc_otg_host_channel_free(td); - goto busy; + if (ep_type == UE_ISOCHRONOUS) { +send_isoc_pkt: + /* Isochronous OUT transfers don't have any ACKs */ + td->state = DWC_CHAN_ST_TX_WAIT_ISOC; + td->hcsplt &= ~HCSPLT_COMPSPLT; + if (td->hcsplt != 0) { + /* get maximum transfer length */ + count = td->remainder; + + /* Update split token according to specification */ + if (td->tt_xactpos == HCSPLT_XACTPOS_BEGIN) { + if (count <= HCSPLT_XACTLEN_MAX) + td->tt_xactpos = HCSPLT_XACTPOS_ALL; + else + count = HCSPLT_XACTLEN_MAX; + } else if (td->tt_xactpos == HCSPLT_XACTPOS_MIDDLE) { + if (count <= HCSPLT_XACTLEN_MAX) + td->tt_xactpos = HCSPLT_XACTPOS_LAST; + else + count = HCSPLT_XACTLEN_MAX; + } + + /* Update transaction position */ + td->hcsplt &= ~HCSPLT_XACTPOS_MASK; + td->hcsplt |= ((uint32_t)td->tt_xactpos << HCSPLT_XACTPOS_SHIFT); + } else { + /* send one packet at a time */ + count = td->max_packet_size; + if (td->remainder < count) { + /* we have a short packet */ + td->short_pkt = 1; + count = td->remainder; + } } + } else if (td->hcsplt != 0) { td->hcsplt &= ~HCSPLT_COMPSPLT; + + /* Wait for ACK/NAK/ERR from TT */ td->state = DWC_CHAN_ST_WAIT_S_ANE; + + /* send one packet at a time */ + count = td->max_packet_size; + if (td->remainder < count) { + /* we have a short packet */ + td->short_pkt = 1; + count = td->remainder; + } } else { + /* Wait for ACK/NAK/STALL from device */ td->state = DWC_CHAN_ST_WAIT_ANE; - } - /* send one packet at a time */ - count = td->max_packet_size; - if (td->remainder < count) { - /* we have a short packet */ - td->short_pkt = 1; - count = td->remainder; + /* send one packet at a time */ + count = td->max_packet_size; + if (td->remainder < count) { + /* we have a short packet */ + td->short_pkt = 1; + count = td->remainder; + } } - /* TODO: HCTSIZ_DOPNG */ + /* check for High-Speed multi-packets */ + if ((td->hcsplt == 0) && (td->max_packet_count > 1)) { + if (td->npkt == 0) { + if (td->remainder >= (3 * td->max_packet_size)) + td->npkt = 3; + else if (td->remainder >= (2 * td->max_packet_size)) + td->npkt = 2; + else + td->npkt = 1; - DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), - (count << HCTSIZ_XFERSIZE_SHIFT) | - (1 << HCTSIZ_PKTCNT_SHIFT) | - (td->toggle ? (HCTSIZ_PID_DATA1 << HCTSIZ_PID_SHIFT) : - (HCTSIZ_PID_DATA0 << HCTSIZ_PID_SHIFT))); + if (td->npkt > td->max_packet_count) + td->npkt = td->max_packet_count; + + td->tt_xactpos = 1; /* overload */ + } + if (td->tt_xactpos == td->npkt) { + if (td->npkt == 1) { + DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), + (count << HCTSIZ_XFERSIZE_SHIFT) | + (1 << HCTSIZ_PKTCNT_SHIFT) | + (HCTSIZ_PID_DATA0 << HCTSIZ_PID_SHIFT)); + } else if (td->npkt == 2) { + DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), + (count << HCTSIZ_XFERSIZE_SHIFT) | + (1 << HCTSIZ_PKTCNT_SHIFT) | + (HCTSIZ_PID_DATA1 << HCTSIZ_PID_SHIFT)); + } else { + DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), + (count << HCTSIZ_XFERSIZE_SHIFT) | + (1 << HCTSIZ_PKTCNT_SHIFT) | + (HCTSIZ_PID_DATA2 << HCTSIZ_PID_SHIFT)); + } + td->npkt = 0; + } else { + DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), + (count << HCTSIZ_XFERSIZE_SHIFT) | + (1 << HCTSIZ_PKTCNT_SHIFT) | + (HCTSIZ_PID_MDATA << HCTSIZ_PID_SHIFT)); + } + } else { + /* TODO: HCTSIZ_DOPNG */ + + DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), + (count << HCTSIZ_XFERSIZE_SHIFT) | + (1 << HCTSIZ_PKTCNT_SHIFT) | + (td->toggle ? (HCTSIZ_PID_DATA1 << HCTSIZ_PID_SHIFT) : + (HCTSIZ_PID_DATA0 << HCTSIZ_PID_SHIFT))); + } DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel), td->hcsplt); + /* send ASAP */ + if ((ep_type == UE_ISOCHRONOUS) && !(sc->sc_last_frame_num & 1)) + td->hcchar |= HCCHAR_ODDFRM; + else + td->hcchar &= ~HCCHAR_ODDFRM; + hcchar = td->hcchar; hcchar &= ~HCCHAR_EPDIR_IN; @@ -1651,18 +1919,20 @@ send_pkt_sync: /* store number of bytes transmitted */ td->tx_bytes = count; - goto busy; send_cpkt: - count = DWC_OTG_READ_4(sc, DOTG_HFNUM) & 7; - /* check for first microframe */ - if (count == 0) { - /* send packet again */ - goto send_pkt; + /* Wait for our turn, if TT transfer */ + if (td->tt_scheduled == 0 || + (sc->sc_last_frame_num & 7) < td->tt_complete_slot) { + /* set return state */ + td->state = DWC_CHAN_ST_WAIT_C_PKT; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon May 5 14:31:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46F4224F; Mon, 5 May 2014 14:31:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33A3B13AD; Mon, 5 May 2014 14:31:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45EVZRb027730; Mon, 5 May 2014 14:31:35 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45EVZ2q027729; Mon, 5 May 2014 14:31:35 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405051431.s45EVZ2q027729@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 5 May 2014 14:31:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265359 - head/sys/modules/sound/sound X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 14:31:35 -0000 Author: hselasky Date: Mon May 5 14:31:34 2014 New Revision: 265359 URL: http://svnweb.freebsd.org/changeset/base/265359 Log: Build the kernel sound module without ISA DMA support for ARM and MIPS platforms, because these platforms do not implement the ISA DMA API. Else the sound modules cannot be loaded when running these platforms. MFC after: 2 weeks Modified: head/sys/modules/sound/sound/Makefile Modified: head/sys/modules/sound/sound/Makefile ============================================================================== --- head/sys/modules/sound/sound/Makefile Mon May 5 11:50:52 2014 (r265358) +++ head/sys/modules/sound/sound/Makefile Mon May 5 14:31:34 2014 (r265359) @@ -44,7 +44,8 @@ CLEANFILES+= feeder_eq_gen.h feeder_rate EXPORT_SYMS= YES # XXX evaluate -.if ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "powerpc" +.if ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "powerpc" || \ + ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" # Create an empty opt_isa.h in order to keep kmod.mk from linking in an # existing one from KERNBUILDDIR which possibly has DEV_ISA defined so # sound.ko is always built without isadma support. From owner-svn-src-head@FreeBSD.ORG Mon May 5 14:50:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5AA1B401; Mon, 5 May 2014 14:50:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47A06159E; Mon, 5 May 2014 14:50:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45EojZk035670; Mon, 5 May 2014 14:50:45 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45EojWL035669; Mon, 5 May 2014 14:50:45 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405051450.s45EojWL035669@svn.freebsd.org> From: Christian Brueffer Date: Mon, 5 May 2014 14:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265360 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 14:50:45 -0000 Author: brueffer Date: Mon May 5 14:50:44 2014 New Revision: 265360 URL: http://svnweb.freebsd.org/changeset/base/265360 Log: Remove stray comma. MFC after: 3 days Modified: head/share/man/man4/tnt4882.4 Modified: head/share/man/man4/tnt4882.4 ============================================================================== --- head/share/man/man4/tnt4882.4 Mon May 5 14:31:34 2014 (r265359) +++ head/share/man/man4/tnt4882.4 Mon May 5 14:50:44 2014 (r265360) @@ -44,7 +44,7 @@ This chip emulates a NEC \(mcPD7210 cont interface between the host computer and the instrument bus. .Sh SEE ALSO .Xr gpib 3 , -.Xr gpib 4 , +.Xr gpib 4 .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Mon May 5 14:57:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60DA57F6; Mon, 5 May 2014 14:57:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D6D31667; Mon, 5 May 2014 14:57:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45EvdVn038950; Mon, 5 May 2014 14:57:39 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45EvdHY038949; Mon, 5 May 2014 14:57:39 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405051457.s45EvdHY038949@svn.freebsd.org> From: Christian Brueffer Date: Mon, 5 May 2014 14:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265362 - head/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 14:57:39 -0000 Author: brueffer Date: Mon May 5 14:57:38 2014 New Revision: 265362 URL: http://svnweb.freebsd.org/changeset/base/265362 Log: Mention the axge(4) driver in the hardware notes. MFC after: 1 week Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Mon May 5 14:50:53 2014 (r265361) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Mon May 5 14:57:38 2014 (r265362) @@ -821,6 +821,9 @@ &hwlist.axe; + ASIX Electronics AX88178A/AX88179 USB Gigabit Ethernet + adapters (&man.axge.4; driver) + &hwlist.bce; [&arch.amd64;, &arch.i386;] Broadcom BCM4401 based Fast From owner-svn-src-head@FreeBSD.ORG Mon May 5 15:59:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECDAEAAA; Mon, 5 May 2014 15:59:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA5141CB7; Mon, 5 May 2014 15:59:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45FxV60065506; Mon, 5 May 2014 15:59:31 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45FxViA065500; Mon, 5 May 2014 15:59:31 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201405051559.s45FxViA065500@svn.freebsd.org> From: Don Lewis Date: Mon, 5 May 2014 15:59:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265363 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 15:59:32 -0000 Author: truckman Date: Mon May 5 15:59:31 2014 New Revision: 265363 URL: http://svnweb.freebsd.org/changeset/base/265363 Log: Avoid unsigned integer overflow which can cause rman_reserve_resource_bound() to return incorrect results. Continue the initial search until the first viable region is found. Add a comment to explain the search termination test. PR: kern/188534 Reviewed by: jhb (previous version) MFC after: 1 week Modified: head/sys/kern/subr_rman.c Modified: head/sys/kern/subr_rman.c ============================================================================== --- head/sys/kern/subr_rman.c Mon May 5 14:57:38 2014 (r265362) +++ head/sys/kern/subr_rman.c Mon May 5 15:59:31 2014 (r265363) @@ -456,7 +456,7 @@ rman_reserve_resource_bound(struct rman mtx_lock(rm->rm_mtx); for (r = TAILQ_FIRST(&rm->rm_list); - r && r->r_end < start; + r && r->r_end < start + count - 1; r = TAILQ_NEXT(r, r_link)) ; @@ -466,6 +466,11 @@ rman_reserve_resource_bound(struct rman } amask = (1ul << RF_ALIGNMENT(flags)) - 1; + if (start + amask < start) { + DPRINTF(("start+amask wrapped around\n")); + goto out; + } + /* If bound is 0, bmask will also be 0 */ bmask = ~(bound - 1); /* @@ -473,11 +478,20 @@ rman_reserve_resource_bound(struct rman */ for (s = r; s; s = TAILQ_NEXT(s, r_link)) { DPRINTF(("considering [%#lx, %#lx]\n", s->r_start, s->r_end)); - if (s->r_start + count - 1 > end) { + /* + * The resource list is sorted, so there is no point in + * searching further once r_start is too large. + */ + if (s->r_start > end - (count - 1)) { DPRINTF(("s->r_start (%#lx) + count - 1> end (%#lx)\n", s->r_start, end)); break; } + if (s->r_start + amask < s->r_start) { + DPRINTF(("s->r_start (%#lx) + amask (%#lx) wrapped\n", + s->r_start, amask)); + break; + } if (s->r_flags & RF_ALLOCATED) { DPRINTF(("region is allocated\n")); continue; From owner-svn-src-head@FreeBSD.ORG Mon May 5 16:19:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76B09F91; Mon, 5 May 2014 16:19:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 644A51FF1; Mon, 5 May 2014 16:19:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45GJPpi074678; Mon, 5 May 2014 16:19:25 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45GJPr6074677; Mon, 5 May 2014 16:19:25 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405051619.s45GJPr6074677@svn.freebsd.org> From: Neel Natu Date: Mon, 5 May 2014 16:19:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265364 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 16:19:25 -0000 Author: neel Date: Mon May 5 16:19:24 2014 New Revision: 265364 URL: http://svnweb.freebsd.org/changeset/base/265364 Log: Virtual machine halt detection is turned on by default. Allow it to be disabled via the tunable 'hw.vmm.halt_detection'. Modified: head/sys/amd64/vmm/vmm.c Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Mon May 5 15:59:31 2014 (r265363) +++ head/sys/amd64/vmm/vmm.c Mon May 5 16:19:24 2014 (r265364) @@ -189,6 +189,16 @@ static VMM_STAT(VCPU_TOTAL_RUNTIME, "vcp SYSCTL_NODE(_hw, OID_AUTO, vmm, CTLFLAG_RW, NULL, NULL); +/* + * Halt the guest if all vcpus are executing a HLT instruction with + * interrupts disabled. + */ +static int halt_detection_enabled = 1; +TUNABLE_INT("hw.vmm.halt_detection", &halt_detection_enabled); +SYSCTL_INT(_hw_vmm, OID_AUTO, halt_detection, CTLFLAG_RDTUN, + &halt_detection_enabled, 0, + "Halt VM if all vcpus execute HLT with interrupts disabled"); + static int vmm_ipinum; SYSCTL_INT(_hw_vmm, OID_AUTO, ipinum, CTLFLAG_RD, &vmm_ipinum, 0, "IPI vector used for vcpu notifications"); @@ -1047,7 +1057,7 @@ vm_handle_hlt(struct vm *vm, int vcpuid, if (intr_disabled) { wmesg = "vmhalt"; VCPU_CTR0(vm, vcpuid, "Halted"); - if (!vcpu_halted) { + if (!vcpu_halted && halt_detection_enabled) { vcpu_halted = 1; CPU_SET_ATOMIC(vcpuid, &vm->halted_cpus); } From owner-svn-src-head@FreeBSD.ORG Mon May 5 16:26:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2904C92E; Mon, 5 May 2014 16:26:25 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03A0E124; Mon, 5 May 2014 16:26:25 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E9A64B941; Mon, 5 May 2014 12:26:23 -0400 (EDT) From: John Baldwin To: Don Lewis Subject: Re: svn commit: r265363 - head/sys/kern Date: Mon, 5 May 2014 12:26:01 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201405051559.s45FxViA065500@svn.freebsd.org> In-Reply-To: <201405051559.s45FxViA065500@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201405051226.01182.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 05 May 2014 12:26:24 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 16:26:25 -0000 On Monday, May 05, 2014 11:59:31 am Don Lewis wrote: > Author: truckman > Date: Mon May 5 15:59:31 2014 > New Revision: 265363 > URL: http://svnweb.freebsd.org/changeset/base/265363 > > Log: > Avoid unsigned integer overflow which can cause > rman_reserve_resource_bound() to return incorrect results. > > Continue the initial search until the first viable region is found. > > Add a comment to explain the search termination test. > > PR: kern/188534 > Reviewed by: jhb (previous version) > MFC after: 1 week > > Modified: > head/sys/kern/subr_rman.c Thanks for tracking this down! -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon May 5 16:30:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FCD2BB4; Mon, 5 May 2014 16:30:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1D3F16B; Mon, 5 May 2014 16:30:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45GU32M079625; Mon, 5 May 2014 16:30:03 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45GU3LA079624; Mon, 5 May 2014 16:30:03 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405051630.s45GU3LA079624@svn.freebsd.org> From: Neel Natu Date: Mon, 5 May 2014 16:30:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265365 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 16:30:04 -0000 Author: neel Date: Mon May 5 16:30:03 2014 New Revision: 265365 URL: http://svnweb.freebsd.org/changeset/base/265365 Log: Re-adding an event to a kqueue modifies the parameters of the original event. However, if the original knote had been disabled then it is not automatically re-enabled. Fix this by using EV_ADD to create an mevent and EV_ENABLE to enable it. Adding a kevent for the first time implicitly enables it so existing callers of mevent_add() don't need to change. Reviewed by: grehan Modified: head/usr.sbin/bhyve/mevent.c Modified: head/usr.sbin/bhyve/mevent.c ============================================================================== --- head/usr.sbin/bhyve/mevent.c Mon May 5 16:19:24 2014 (r265364) +++ head/usr.sbin/bhyve/mevent.c Mon May 5 16:30:03 2014 (r265365) @@ -52,9 +52,10 @@ __FBSDID("$FreeBSD$"); #define MEVENT_MAX 64 -#define MEV_ENABLE 1 -#define MEV_DISABLE 2 -#define MEV_DEL_PENDING 3 +#define MEV_ADD 1 +#define MEV_ENABLE 2 +#define MEV_DISABLE 3 +#define MEV_DEL_PENDING 4 extern char *vmname; @@ -147,10 +148,11 @@ mevent_kq_flags(struct mevent *mevp) int ret; switch (mevp->me_state) { + case MEV_ADD: + ret = EV_ADD; /* implicitly enabled */ + break; case MEV_ENABLE: - ret = EV_ADD; - if (mevp->me_type == EVF_TIMER) - ret |= EV_ENABLE; + ret = EV_ENABLE; break; case MEV_DISABLE: ret = EV_DISABLE; @@ -158,6 +160,9 @@ mevent_kq_flags(struct mevent *mevp) case MEV_DEL_PENDING: ret = EV_DELETE; break; + default: + assert(0); + break; } return (ret); @@ -284,7 +289,7 @@ mevent_add(int tfd, enum ev_type type, LIST_INSERT_HEAD(&change_head, mevp, me_list); mevp->me_cq = 1; - mevp->me_state = MEV_ENABLE; + mevp->me_state = MEV_ADD; mevent_notify(); exit: From owner-svn-src-head@FreeBSD.ORG Mon May 5 16:35:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72827D39; Mon, 5 May 2014 16:35:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6093D1F6; Mon, 5 May 2014 16:35:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45GZcMS083307; Mon, 5 May 2014 16:35:38 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45GZcw7083306; Mon, 5 May 2014 16:35:38 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405051635.s45GZcw7083306@svn.freebsd.org> From: Neel Natu Date: Mon, 5 May 2014 16:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265366 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 16:35:38 -0000 Author: neel Date: Mon May 5 16:35:37 2014 New Revision: 265366 URL: http://svnweb.freebsd.org/changeset/base/265366 Log: Remove misleading "addcpu" in an error message emitted by fbsdrun_deletecpu(). Pointed out by: novel Modified: head/usr.sbin/bhyve/bhyverun.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Mon May 5 16:30:03 2014 (r265365) +++ head/usr.sbin/bhyve/bhyverun.c Mon May 5 16:35:37 2014 (r265366) @@ -229,8 +229,7 @@ fbsdrun_deletecpu(struct vmctx *ctx, int { if (!CPU_ISSET(vcpu, &cpumask)) { - fprintf(stderr, "addcpu: attempting to delete unknown cpu %d\n", - vcpu); + fprintf(stderr, "Attempting to delete unknown cpu %d\n", vcpu); exit(1); } From owner-svn-src-head@FreeBSD.ORG Mon May 5 16:41:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0E2913D; Mon, 5 May 2014 16:41:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EB122A6; Mon, 5 May 2014 16:41:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45GfFma086424; Mon, 5 May 2014 16:41:15 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45GfFje086423; Mon, 5 May 2014 16:41:15 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405051641.s45GfFje086423@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 5 May 2014 16:41:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265367 - head/lib/libc/regex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 16:41:15 -0000 Author: pfg Date: Mon May 5 16:41:15 2014 New Revision: 265367 URL: http://svnweb.freebsd.org/changeset/base/265367 Log: regex: Use calloc instead of malloc. Mostly to reduce differences with OpenBSD. Obtained from: OpenBSD (CVS rev. 1.17) MFC after: 3 days Modified: head/lib/libc/regex/regcomp.c Modified: head/lib/libc/regex/regcomp.c ============================================================================== --- head/lib/libc/regex/regcomp.c Mon May 5 16:35:37 2014 (r265366) +++ head/lib/libc/regex/regcomp.c Mon May 5 16:41:15 2014 (r265367) @@ -214,7 +214,7 @@ regcomp(regex_t * __restrict preg, if (g == NULL) return(REG_ESPACE); p->ssize = len/(size_t)2*(size_t)3 + (size_t)1; /* ugh */ - p->strip = (sop *)malloc(p->ssize * sizeof(sop)); + p->strip = (sop *)calloc(p->ssize, sizeof(sop)); p->slen = 0; if (p->strip == NULL) { free((char *)g); From owner-svn-src-head@FreeBSD.ORG Mon May 5 17:06:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7DEC9D9; Mon, 5 May 2014 17:06:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95B4C680; Mon, 5 May 2014 17:06:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45H6eMj096691; Mon, 5 May 2014 17:06:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45H6emW096690; Mon, 5 May 2014 17:06:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405051706.s45H6emW096690@svn.freebsd.org> From: Adrian Chadd Date: Mon, 5 May 2014 17:06:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265370 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 17:06:40 -0000 Author: adrian Date: Mon May 5 17:06:40 2014 New Revision: 265370 URL: http://svnweb.freebsd.org/changeset/base/265370 Log: Wake up the hardware before calling ath_mode_init() in the ioctl() path. Tested: * AR5416, STA + powersave Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon May 5 17:00:17 2014 (r265369) +++ head/sys/dev/ath/if_ath.c Mon May 5 17:06:40 2014 (r265370) @@ -6504,7 +6504,9 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, * only reflect promisc mode settings. */ ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); ath_mode_init(sc); + ath_power_restore_power_state(sc); ATH_UNLOCK(sc); } else if (ifp->if_flags & IFF_UP) { /* From owner-svn-src-head@FreeBSD.ORG Mon May 5 17:30:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 316F7F52; Mon, 5 May 2014 17:30:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5449886; Mon, 5 May 2014 17:30:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45HU5XF006017; Mon, 5 May 2014 17:30:05 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45HU5cV006016; Mon, 5 May 2014 17:30:05 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201405051730.s45HU5cV006016@svn.freebsd.org> From: Michael Tuexen Date: Mon, 5 May 2014 17:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265371 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 17:30:06 -0000 Author: tuexen Date: Mon May 5 17:30:05 2014 New Revision: 265371 URL: http://svnweb.freebsd.org/changeset/base/265371 Log: Fill in csum_data only for UDP or TCP packets. This fixes a bug where SCTP were reported to have always a correct checksum if they don't contain any ethernet padding. MFC after: 3 days Modified: head/sys/dev/usb/net/if_smsc.c Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Mon May 5 17:06:40 2014 (r265370) +++ head/sys/dev/usb/net/if_smsc.c Mon May 5 17:30:05 2014 (r265371) @@ -86,6 +86,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include "opt_platform.h" #ifdef FDT @@ -1025,25 +1028,32 @@ smsc_bulk_read_callback(struct usb_xfer * * Ignore H/W csum for non-IPv4 packets. */ - if (be16toh(eh->ether_type) == ETHERTYPE_IP && pktlen > ETHER_MIN_LEN) { - - /* Indicate the UDP/TCP csum has been calculated */ - m->m_pkthdr.csum_flags |= CSUM_DATA_VALID; - - /* Copy the TCP/UDP checksum from the last 2 bytes - * of the transfer and put in the csum_data field. - */ - usbd_copy_out(pc, (off + pktlen), - &m->m_pkthdr.csum_data, 2); - - /* The data is copied in network order, but the - * csum algorithm in the kernel expects it to be - * in host network order. - */ - m->m_pkthdr.csum_data = ntohs(m->m_pkthdr.csum_data); - - smsc_dbg_printf(sc, "RX checksum offloaded (0x%04x)\n", - m->m_pkthdr.csum_data); + if ((be16toh(eh->ether_type) == ETHERTYPE_IP) && + (pktlen > ETHER_MIN_LEN)) { + struct ip *ip; + + ip = (struct ip *)(eh + 1); + if ((ip->ip_v == IPVERSION) && + ((ip->ip_p == IPPROTO_TCP) || + (ip->ip_p == IPPROTO_UDP))) { + /* Indicate the UDP/TCP csum has been calculated */ + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID; + + /* Copy the TCP/UDP checksum from the last 2 bytes + * of the transfer and put in the csum_data field. + */ + usbd_copy_out(pc, (off + pktlen), + &m->m_pkthdr.csum_data, 2); + + /* The data is copied in network order, but the + * csum algorithm in the kernel expects it to be + * in host network order. + */ + m->m_pkthdr.csum_data = ntohs(m->m_pkthdr.csum_data); + + smsc_dbg_printf(sc, "RX checksum offloaded (0x%04x)\n", + m->m_pkthdr.csum_data); + } } /* Need to adjust the offset as well or we'll be off From owner-svn-src-head@FreeBSD.ORG Mon May 5 17:42:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 047B5482 for ; Mon, 5 May 2014 17:42:27 +0000 (UTC) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com [209.85.215.47]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F804A22 for ; Mon, 5 May 2014 17:42:26 +0000 (UTC) Received: by mail-la0-f47.google.com with SMTP id e16so2160817lan.20 for ; Mon, 05 May 2014 10:42:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=1RBLc5HSWF+5UBNxL34xJiRII3ovnV0IVLUKki3pM98=; b=e1O1R3GUAiCV/p4V0UlamAFvY86Glfvh/zH/zYKuMmT3rTy0eaXoEYtgvKRP1vrhJB 68bZR8agAaASR7QBd9IFL6ZVF1S3PpLFsnSk38LLGLvFYhpjaVgetcv+O8ttz/PugC13 oEcQ8ZjZ8/Kuh8mEDOI4n8gmu4Ck9IPKpEKGreSDIS5GB/+ifJHZuQUAQ4Su2dwjobEI BhcD+fhyb2x560Q4EUBhdwrlaAYgSKc7W++QMadYUcjVSzsAGBrZcsBvk0Hw71vwzIen Jz1UGVOV/n+eWK8vWV/TG2HwDXn6A1fHrwAITn6hld+Wd7HERx4jDbZuUSJzHsI9uLZe 9eBg== X-Gm-Message-State: ALoCoQmD7QdE1sgUOgB34Vk8mHrNiNpZPsVeg8PdAdQMd7WJu99cASl+m4G1EqGAzL6T51Cv2S9c X-Received: by 10.112.137.39 with SMTP id qf7mr26110246lbb.18.1399311737778; Mon, 05 May 2014 10:42:17 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id zx3sm10293024lbc.2.2014.05.05.10.42.16 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 10:42:16 -0700 (PDT) Message-ID: <5367CD77.40909@freebsd.org> Date: Mon, 05 May 2014 21:42:15 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r265367 - head/lib/libc/regex References: <201405051641.s45GfFje086423@svn.freebsd.org> In-Reply-To: <201405051641.s45GfFje086423@svn.freebsd.org> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 17:42:27 -0000 On 05.05.2014 20:41, Pedro F. Giffuni wrote: > Log: > regex: Use calloc instead of malloc. > > Mostly to reduce differences with OpenBSD. Please don't commit OpenBSD errors. Now you mix calloc() with the realloc() for the same variable later which makes calloc() zeroing pointless and waste of CPU. -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Mon May 5 18:04:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7CC8CBA; Mon, 5 May 2014 18:04:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B56EDBF4; Mon, 5 May 2014 18:04:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45I4vkS022242; Mon, 5 May 2014 18:04:57 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45I4vMS022241; Mon, 5 May 2014 18:04:57 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405051804.s45I4vMS022241@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 5 May 2014 18:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265375 - head/lib/libc/regex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 18:04:57 -0000 Author: pfg Date: Mon May 5 18:04:57 2014 New Revision: 265375 URL: http://svnweb.freebsd.org/changeset/base/265375 Log: Revert r265367: Use of calloc instead of malloc in regex (from OpenBSD). In this case the change makes no sense since we are using realloc() later. Reported by: ache Modified: head/lib/libc/regex/regcomp.c Modified: head/lib/libc/regex/regcomp.c ============================================================================== --- head/lib/libc/regex/regcomp.c Mon May 5 17:58:00 2014 (r265374) +++ head/lib/libc/regex/regcomp.c Mon May 5 18:04:57 2014 (r265375) @@ -214,7 +214,7 @@ regcomp(regex_t * __restrict preg, if (g == NULL) return(REG_ESPACE); p->ssize = len/(size_t)2*(size_t)3 + (size_t)1; /* ugh */ - p->strip = (sop *)calloc(p->ssize, sizeof(sop)); + p->strip = (sop *)malloc(p->ssize * sizeof(sop)); p->slen = 0; if (p->strip == NULL) { free((char *)g); From owner-svn-src-head@FreeBSD.ORG Mon May 5 18:06:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71616E27; Mon, 5 May 2014 18:06:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EF82C11; Mon, 5 May 2014 18:06:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45I6aFF022601; Mon, 5 May 2014 18:06:36 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45I6acX022599; Mon, 5 May 2014 18:06:36 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405051806.s45I6acX022599@svn.freebsd.org> From: Neel Natu Date: Mon, 5 May 2014 18:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265376 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 18:06:36 -0000 Author: neel Date: Mon May 5 18:06:35 2014 New Revision: 265376 URL: http://svnweb.freebsd.org/changeset/base/265376 Log: Modify the "-p" option to be more flexible when associating a 'vcpu' with a 'hostcpu'. The new format of the argument string is "vcpu:hostcpu". This allows pinning a subset of the vcpus if desired. It also allows pinning a vcpu to more than a single 'hostcpu'. Submitted by: novel (initial version) Modified: head/usr.sbin/bhyve/bhyve.8 head/usr.sbin/bhyve/bhyverun.c Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Mon May 5 18:04:57 2014 (r265375) +++ head/usr.sbin/bhyve/bhyve.8 Mon May 5 18:06:35 2014 (r265376) @@ -35,7 +35,7 @@ .Op Fl aehwxAHPW .Op Fl c Ar numcpus .Op Fl g Ar gdbport -.Op Fl p Ar pinnedcpu +.Op Fl p Ar vcpu:hostcpu .Op Fl s Ar slot,emulation Ns Op , Ns Ar conf .Op Fl l Ar lpcdev Ns Op , Ns Ar conf .Ar vmname @@ -80,12 +80,11 @@ For allow a remote kernel kgdb to be relayed to the guest kernel gdb stub via a local IPv4 address and this port. This option will be deprecated in a future version. -.It Fl p Ar pinnedcpu -Force guest virtual CPUs to be pinned to host CPUs. -Virtual CPU -.Em n -is pinned to host CPU -.Em pinnedcpu+n . +.It Fl p Ar vcpu:hostcpu +Pin guest's virtual CPU +.Em vcpu +to +.Em hostcpu . .It Fl P Force the guest virtual CPU to exit when a PAUSE instruction is detected. .It Fl W Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Mon May 5 18:04:57 2014 (r265375) +++ head/usr.sbin/bhyve/bhyverun.c Mon May 5 18:06:35 2014 (r265376) @@ -85,7 +85,6 @@ char *vmname; int guest_ncpus; char *guest_uuid_str; -static int pincpu = -1; static int guest_vmexit_on_hlt, guest_vmexit_on_pause; static int virtio_msix = 1; static int x2apic_mode = 0; /* default is xAPIC */ @@ -123,18 +122,20 @@ struct mt_vmm_info { int mt_vcpu; } mt_vmm_info[VM_MAXCPU]; +static cpuset_t *vcpumap[VM_MAXCPU] = { NULL }; + static void usage(int code) { fprintf(stderr, - "Usage: %s [-aehwAHIPW] [-g ] [-s ]\n" - " %*s [-c vcpus] [-p pincpu] [-m mem] [-l ] \n" + "Usage: %s [-aehwAHIPW] [-g ] [-s ] [-c vcpus]\n" + " %*s [-p vcpu:hostcpu] [-m mem] [-l ] \n" " -a: local apic is in xAPIC mode (deprecated)\n" " -A: create an ACPI table\n" " -g: gdb port\n" " -c: # cpus (default 1)\n" - " -p: pin vcpu 'n' to host cpu 'pincpu + n'\n" + " -p: pin 'vcpu' to 'hostcpu'\n" " -H: vmexit from the guest on hlt\n" " -P: vmexit from the guest on pause\n" " -W: force virtio to use single-vector MSI\n" @@ -152,6 +153,39 @@ usage(int code) exit(code); } +static int +pincpu_parse(const char *opt) +{ + int vcpu, pcpu; + + if (sscanf(opt, "%d:%d", &vcpu, &pcpu) != 2) { + fprintf(stderr, "invalid format: %s\n", opt); + return (-1); + } + + if (vcpu < 0 || vcpu >= VM_MAXCPU) { + fprintf(stderr, "vcpu '%d' outside valid range from 0 to %d\n", + vcpu, VM_MAXCPU - 1); + return (-1); + } + + if (pcpu < 0 || pcpu >= CPU_SETSIZE) { + fprintf(stderr, "hostcpu '%d' outside valid range from " + "0 to %d\n", pcpu, CPU_SETSIZE - 1); + return (-1); + } + + if (vcpumap[vcpu] == NULL) { + if ((vcpumap[vcpu] = malloc(sizeof(cpuset_t))) == NULL) { + perror("malloc"); + return (-1); + } + CPU_ZERO(vcpumap[vcpu]); + } + CPU_SET(pcpu, vcpumap[vcpu]); + return (0); +} + void * paddr_guest2host(struct vmctx *ctx, uintptr_t gaddr, size_t len) { @@ -498,16 +532,13 @@ static vmexit_handler_t handler[VM_EXITC static void vm_loop(struct vmctx *ctx, int vcpu, uint64_t rip) { - cpuset_t mask; int error, rc, prevcpu; enum vm_exitcode exitcode; enum vm_suspend_how how; - if (pincpu >= 0) { - CPU_ZERO(&mask); - CPU_SET(pincpu + vcpu, &mask); + if (vcpumap[vcpu] != NULL) { error = pthread_setaffinity_np(pthread_self(), - sizeof(mask), &mask); + sizeof(cpuset_t), vcpumap[vcpu]); assert(error == 0); } @@ -640,7 +671,10 @@ main(int argc, char *argv[]) bvmcons = 1; break; case 'p': - pincpu = atoi(optarg); + if (pincpu_parse(optarg) != 0) { + errx(EX_USAGE, "invalid vcpu pinning " + "configuration '%s'", optarg); + } break; case 'c': guest_ncpus = atoi(optarg); From owner-svn-src-head@FreeBSD.ORG Mon May 5 18:55:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68E48797; Mon, 5 May 2014 18:55:55 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 34B601224; Mon, 5 May 2014 18:55:54 +0000 (UTC) Received: from [192.168.0.7] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s45ISgYU034184 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 5 May 2014 18:28:44 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=koi8-r Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265367 - head/lib/libc/regex From: David Chisnall In-Reply-To: <5367CD77.40909@freebsd.org> Date: Mon, 5 May 2014 19:28:37 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> To: Andrey Chernov X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Pedro F. Giffuni" , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 18:55:55 -0000 On 5 May 2014, at 18:42, Andrey Chernov wrote: > Please don't commit OpenBSD errors. Now you mix calloc() with the > realloc() for the same variable later which makes calloc() zeroing > pointless and waste of CPU. The purpose of calloc() here is not (primarily) to get the zero'd size, = it's to get the overflow-checking behaviour for calloc. =20 The uses of realloc() later do still potentially overflow, as they = follow the realloc(pointer, size * sizeof(type)) antipattern. =20 David From owner-svn-src-head@FreeBSD.ORG Mon May 5 19:38:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10B713B3; Mon, 5 May 2014 19:38:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7BD75EBB; Mon, 5 May 2014 19:38:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45JcURn039234; Mon, 5 May 2014 19:38:30 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45JcU2f039231; Mon, 5 May 2014 19:38:30 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201405051938.s45JcU2f039231@svn.freebsd.org> From: Alan Somers Date: Mon, 5 May 2014 19:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265385 - in head: . etc/mtree sbin/ifconfig sbin/ifconfig/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 19:38:31 -0000 Author: asomers Date: Mon May 5 19:38:29 2014 New Revision: 265385 URL: http://svnweb.freebsd.org/changeset/base/265385 Log: Remove the ifconfig test added in rev 263445. After discussion with melifaro, we agreed that ifconfig's behavior was not a bug. The main motivation for bin/187551 was to partially resolve kern/187549, but we resolved kern/187549 in a different way instead. ObsoleteFiles.inc etc/mtree/BSD.tests.dist sbin/ifconfig/tests/fibs_test.sh sbin/ifconfig/tests/Makefile sbin/ifconfig/Makefile Remove /usr/tests/sbin/ifconfig PR: bin/187551 MFC after: 3 days Sponsored by: Spectra Logic Deleted: head/sbin/ifconfig/tests/Makefile head/sbin/ifconfig/tests/fibs_test.sh Modified: head/ObsoleteFiles.inc head/etc/mtree/BSD.tests.dist head/sbin/ifconfig/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon May 5 19:35:32 2014 (r265384) +++ head/ObsoleteFiles.inc Mon May 5 19:38:29 2014 (r265385) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20140505: Reject PR kern/187551 +OLD_DIRS+=usr/tests/sbin/ifconfig +OLD_FILES+=usr/tests/sbin/ifconfig/Kyuafile +OLD_FILES+=usr/tests/sbin/ifconfig/fibs_test # 20140502: Removal of lindev(4) OLD_FILES+=usr/share/man/man4/lindev.4.gz # 20140314: AppleTalk Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon May 5 19:35:32 2014 (r265384) +++ head/etc/mtree/BSD.tests.dist Mon May 5 19:38:29 2014 (r265385) @@ -97,8 +97,6 @@ .. growfs .. - ifconfig - .. mdconfig .. .. Modified: head/sbin/ifconfig/Makefile ============================================================================== --- head/sbin/ifconfig/Makefile Mon May 5 19:35:32 2014 (r265384) +++ head/sbin/ifconfig/Makefile Mon May 5 19:38:29 2014 (r265385) @@ -63,8 +63,4 @@ MAN= ifconfig.8 CFLAGS+= -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs WARNS?= 2 -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif - .include From owner-svn-src-head@FreeBSD.ORG Mon May 5 19:53:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 383419AC; Mon, 5 May 2014 19:53:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED065A1; Mon, 5 May 2014 19:53:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45Jr36X046868; Mon, 5 May 2014 19:53:03 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45Jr3Ro046866; Mon, 5 May 2014 19:53:03 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201405051953.s45Jr3Ro046866@svn.freebsd.org> From: "Kenneth D. Merry" Date: Mon, 5 May 2014 19:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265386 - head/sys/dev/mpr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 19:53:04 -0000 Author: ken Date: Mon May 5 19:53:03 2014 New Revision: 265386 URL: http://svnweb.freebsd.org/changeset/base/265386 Log: Adjust #if statements inside mprsas_send_smpcmd() to more accurately reflect when unmapped I/O support was added. For FreeBSD 10, it arrived just prior to __FreeBSD_version 1000028. For FreeBSD 9, it arrived just prior to __FreeBSD_version 902001. Also, fix compiler warnings in mprsas_send_smpcmd() that happen in the i386 PAE build for non-unmapped I/O builds. These were fixed in mps(4) in revision 241145, but didn't make it into the mpr(4) driver. This change should only affect FreeBSD versions outside the above revisions, and thus doesn't affect head. MFC after: 3 days Sponsored by: Spectra Logic Corporation Modified: head/sys/dev/mpr/mpr_sas.c Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Mon May 5 19:38:29 2014 (r265385) +++ head/sys/dev/mpr/mpr_sas.c Mon May 5 19:53:03 2014 (r265386) @@ -2501,7 +2501,8 @@ mprsas_send_smpcmd(struct mprsas_softc * sg = NULL; error = 0; -#if __FreeBSD_version >= 1000029 +#if (__FreeBSD_version >= 1000028) || \ + ((__FreeBSD_version >= 902001) && (__FreeBSD_version < 1000000)) switch (ccb->ccb_h.flags & CAM_DATA_MASK) { case CAM_DATA_PADDR: case CAM_DATA_SG_PADDR: @@ -2561,7 +2562,7 @@ mprsas_send_smpcmd(struct mprsas_softc * xpt_done(ccb); return; } -#else //__FreeBSD_version < 1000029 +#else /* __FreeBSD_version < 1000028 */ /* * XXX We don't yet support physical addresses here. */ @@ -2604,7 +2605,7 @@ mprsas_send_smpcmd(struct mprsas_softc * bus_dma_segment_t *req_sg; req_sg = (bus_dma_segment_t *)ccb->smpio.smp_request; - request = (uint8_t *)req_sg[0].ds_addr; + request = (uint8_t *)(uintptr_t)req_sg[0].ds_addr; } else request = ccb->smpio.smp_request; @@ -2612,14 +2613,14 @@ mprsas_send_smpcmd(struct mprsas_softc * bus_dma_segment_t *rsp_sg; rsp_sg = (bus_dma_segment_t *)ccb->smpio.smp_response; - response = (uint8_t *)rsp_sg[0].ds_addr; + response = (uint8_t *)(uintptr_t)rsp_sg[0].ds_addr; } else response = ccb->smpio.smp_response; } else { request = ccb->smpio.smp_request; response = ccb->smpio.smp_response; } -#endif //__FreeBSD_version >= 1000029 +#endif /* __FreeBSD_version < 1000028 */ cm = mpr_alloc_command(sc); if (cm == NULL) { From owner-svn-src-head@FreeBSD.ORG Mon May 5 19:56:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 780F1B4B for ; Mon, 5 May 2014 19:56:17 +0000 (UTC) Received: from nm36-vm2.bullet.mail.bf1.yahoo.com (nm36-vm2.bullet.mail.bf1.yahoo.com [72.30.238.138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0026EC7 for ; Mon, 5 May 2014 19:56:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1399319380; bh=3hFInMOsQKBCZ1n8PXKK5qdB8LOpGH+g65TLBNm9auA=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:Organization:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=XvrR+Tz5SnHMvwXLVmmEMP983/IX2Pdn4M8S6bGz3fc7f2iLZj1IgqjDcsEgfm7QoaZlpudruhkEcZwG+euta8qB7Tzl0+Om+OTUWPX25XzrGSoE3p4BoDT6Mi3KiNmLr8h0SyxUmP6V1vMBD87F24L2bMZrZ7QMIFDPs6ye8FpqJks0DfN+j2VTOGvQBjcc+DxZMcB6zrBH8AzmJfn1MZQj0wGY8SR8I4nqW4VlsUPvuiRnNydf4xaJRAqnxHWg7DYYKsYkvsawOh7TiWMtEsXob8hCyBK2H4YiLo3gGL3ayvf7iqOveJ1N/kb1OaLBTMFjTUt6oxwpNvRKKD16OA== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=bFD71vSD+yn2P1Ipy53JKmwy6wuQYOsTAPrnNFhX6rUe/49u+v4RkHHZM4eiyWPm7opeG+NjCfjTzt3AlNSant8ycFpkCq3KjAXP0li5LeLu6WIutHAhjxcFoya5OTR58ht741eQzArUu7SudtDEHEO1C1vwxR0SxwZd3JtwIsy6nRqT4So+1Y3FsWnhOOH4wr6dpEyeVlgd6DLj6BRxzTIdeWMeRp4AU2r3BXBeoBvU66dxKjiyu8B5ujcu4sCm5WuCc8USGf2fEJYSKEhy2TOj8KzDF6rmv0S0KZrTF83sJA+AFB5hTixyYbuisfyjrBzbQtn0mP0eq2oppI/5qw==; Received: from [98.139.215.141] by nm36.bullet.mail.bf1.yahoo.com with NNFMP; 05 May 2014 19:49:40 -0000 Received: from [98.139.211.163] by tm12.bullet.mail.bf1.yahoo.com with NNFMP; 05 May 2014 19:49:40 -0000 Received: from [127.0.0.1] by smtp220.mail.bf1.yahoo.com with NNFMP; 05 May 2014 19:49:40 -0000 X-Yahoo-Newman-Id: 130731.35938.bm@smtp220.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: LSipnMYVM1m0n4KsDKsSMTDDkZ7s_1Lbnq8uZsq6DT2isMK gNgBTdP4PiBYE6KSNY_3KKe9HEk6Ys7CQg8505daBN.bPMGanOuptEgM7Wxq 3BfK4ct_ndywrSfhVan5nFNWgUPkPC91Rg17jyGfaRw4pXrUSo31rNIZfmhF ZaP7YKFFynokNpaI4m49kHWrbJXwYzpvdKYpWl27oMUN3B2FRi72P8nrW0av h28CUbA8G4SDe_rtQv4V9ylRQN_rglV3gbK3FPbJPLr9ggwsHU3iV.z9wmXL zDdSg1T2vykLCoy6sexGsoR5TFujIVcAUa5kXYG7l8KvHs9MR6P13UYKTyx1 sTiTws2ilM3JtsV3T.2PnC4xods1gI5lhIFgaxhd4C_2eJLse.lrHqkzKcEg SSKtX4deTPt9e9qfBTRGVUygixnOTs5HnAxcPhi8oLKPvPRAHaP9g1P.UAcK TquqxhsIKWjjYMBqjKaaCadAuAkdH3EQskLn1SX0t7lXmH02HLrocTMQ5aun oDRdc7u1bXEw4k9G69_sEAjIuLg-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain [63.250.193.228]) by smtp220.mail.bf1.yahoo.com with SMTP; 05 May 2014 19:49:40 +0000 UTC Message-ID: <5367EB54.1080109@FreeBSD.org> Date: Mon, 05 May 2014 14:49:40 -0500 From: Pedro Giffuni Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: David Chisnall , Andrey Chernov Subject: Re: svn commit: r265367 - head/lib/libc/regex References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 19:56:17 -0000 El 5/5/2014 1:28 PM, David Chisnall escribió: > On 5 May 2014, at 18:42, Andrey Chernov wrote: > >> Please don't commit OpenBSD errors. Now you mix calloc() with the >> realloc() for the same variable later which makes calloc() zeroing >> pointless and waste of CPU. > > The purpose of calloc() here is not (primarily) to get the zero'd size, it's to get the overflow-checking behaviour for calloc. > Yes, but I reverted it because there are other ways to check for overflows without the performance hit. > The uses of realloc() later do still potentially overflow, as they follow the realloc(pointer, size * sizeof(type)) antipattern. > FWIW, I actually got to this by checking kern/169302: unfortunately it is unclear if the NetBSD patch there (with or without the OpenBSD change) helps with the test case. Pedro. From owner-svn-src-head@FreeBSD.ORG Mon May 5 20:39:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8853569 for ; Mon, 5 May 2014 20:39:56 +0000 (UTC) Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB1593C8 for ; Mon, 5 May 2014 20:39:56 +0000 (UTC) Received: by mail-pa0-f51.google.com with SMTP id kq14so3379865pab.38 for ; Mon, 05 May 2014 13:39:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=RBkdnU5zN//FAJHapXGSqE+zuuu2CWvzd3+U2m4hVnw=; b=e48T4vjYjq+hj3Zmr2coj6KZrIIM8rGC4Tk+o+9AJmnygIyEHaMMreh2pCDUxE/qsT 8qS76MzUGvvptFAkprMqIO5il8DKHwkOKbTMAt1rPQXRnGqqEgnhyoffgb2OD6Zg9fmw hwjvPGxsrqBwZVGqPuuaQU8gxd8KisIjbh+reuJt3GLxnuhH8GTlLL/poI+2oXbmcmaM TDKiQHUFL8P95FyuFWFVzcAe3Dvjnfsj5H9rbHKas0Sp/mDH+ydpqGYURkuQPgHH5XbO gqTHFL6PGfyz77QOYsWmMr3XA9M+LlU/y8nlvKQY1eAreg3fR3/3egbIPDqg+qSTONXt QSdw== X-Gm-Message-State: ALoCoQnY4xElFnus0+lcJyTanLigQbKggzELX7w5x7ZTzRqCvAfzF5Rml2240wMJYFT/JSHgtXla X-Received: by 10.66.158.132 with SMTP id wu4mr75658048pab.66.1399322390225; Mon, 05 May 2014 13:39:50 -0700 (PDT) Received: from [10.64.26.239] (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id nx12sm79409125pab.6.2014.05.05.13.39.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 13:39:49 -0700 (PDT) Sender: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265359 - head/sys/modules/sound/sound From: Warner Losh In-Reply-To: <201405051431.s45EVZ2q027729@svn.freebsd.org> Date: Mon, 5 May 2014 14:39:46 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <7745BD19-5BAE-47BD-8DE4-10CF7E23FA9D@gmail.com> References: <201405051431.s45EVZ2q027729@svn.freebsd.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 20:39:57 -0000 On May 5, 2014, at 8:31 AM, Hans Petter Selasky = wrote: > Author: hselasky > Date: Mon May 5 14:31:34 2014 > New Revision: 265359 > URL: http://svnweb.freebsd.org/changeset/base/265359 >=20 > Log: > Build the kernel sound module without ISA DMA support for ARM and = MIPS > platforms, because these platforms do not implement the ISA DMA > API. Else the sound modules cannot be loaded when running these > platforms. >=20 > MFC after: 2 weeks >=20 > Modified: > head/sys/modules/sound/sound/Makefile >=20 > Modified: head/sys/modules/sound/sound/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/modules/sound/sound/Makefile Mon May 5 11:50:52 2014 = (r265358) > +++ head/sys/modules/sound/sound/Makefile Mon May 5 14:31:34 2014 = (r265359) > @@ -44,7 +44,8 @@ CLEANFILES+=3D feeder_eq_gen.h feeder_rate >=20 > EXPORT_SYMS=3D YES # XXX evaluate >=20 > -.if ${MACHINE_CPUARCH} =3D=3D "sparc64" || ${MACHINE_CPUARCH} =3D=3D = "powerpc" > +.if ${MACHINE_CPUARCH} =3D=3D "sparc64" || ${MACHINE_CPUARCH} =3D=3D = "powerpc" || \ > + ${MACHINE_CPUARCH} =3D=3D "arm" || ${MACHINE_CPUARCH} =3D=3D = "mips" > # Create an empty opt_isa.h in order to keep kmod.mk from linking in = an > # existing one from KERNBUILDDIR which possibly has DEV_ISA defined so > # sound.ko is always built without isadma support. Rather than an opt-in approach here, why not lust list the three that = have it since they are the only ones that will ever have it=85 Warner= From owner-svn-src-head@FreeBSD.ORG Mon May 5 21:24:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A7C843F; Mon, 5 May 2014 21:24:43 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 565FE89C; Mon, 5 May 2014 21:24:42 +0000 (UTC) Received: from [192.168.0.7] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s45LObCa035099 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 5 May 2014 21:24:39 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265367 - head/lib/libc/regex From: David Chisnall In-Reply-To: <5367EB54.1080109@FreeBSD.org> Date: Mon, 5 May 2014 22:21:59 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <3C7CFFB7-5C84-4AC1-9A81-C718D184E87B@FreeBSD.org> References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> <5367EB54.1080109@FreeBSD.org> To: Pedro Giffuni X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrey Chernov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 21:24:43 -0000 On 5 May 2014, at 20:49, Pedro Giffuni wrote: > Yes, but I reverted it because there are other ways to check for = overflows without the performance hit. Do we have a good reusable routine for doing this somewhere? Clang and = gcc both have some idiom recognisers that try to spot when people are = attempting to do this. Clang also has a builtin, which would be good to = use when available. Overflow checking is very cheap on modern CPUs = (add, branch on carry), so it would be nice if we could start looking = for this malloc() and realloc() pattern and replacing the multiply with = something that checks for the error. David From owner-svn-src-head@FreeBSD.ORG Mon May 5 21:29:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87CD6864; Mon, 5 May 2014 21:29:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 763148CA; Mon, 5 May 2014 21:29:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45LTvO5079481; Mon, 5 May 2014 21:29:57 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45LTv38079480; Mon, 5 May 2014 21:29:57 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405052129.s45LTv38079480@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 5 May 2014 21:29:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265391 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 21:29:57 -0000 Author: ray Date: Mon May 5 21:29:56 2014 New Revision: 265391 URL: http://svnweb.freebsd.org/changeset/base/265391 Log: Define a new method for probing vt(4) driver before attach it at early stage. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt.h Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Mon May 5 20:55:37 2014 (r265390) +++ head/sys/dev/vt/vt.h Mon May 5 21:29:56 2014 (r265391) @@ -277,6 +277,7 @@ struct vt_window { */ typedef int vd_init_t(struct vt_device *vd); +typedef int vd_probe_t(struct vt_device *vd); typedef void vd_postswitch_t(struct vt_device *vd); typedef void vd_blank_t(struct vt_device *vd, term_color_t color); typedef void vd_bitbltchr_t(struct vt_device *vd, const uint8_t *src, @@ -295,7 +296,9 @@ typedef void vd_drawrect_t(struct vt_dev typedef void vd_setpixel_t(struct vt_device *, int, int, term_color_t); struct vt_driver { + char vd_name[16]; /* Console attachment. */ + vd_probe_t *vd_probe; vd_init_t *vd_init; /* Drawing. */ From owner-svn-src-head@FreeBSD.ORG Mon May 5 21:31:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4CC9DB29; Mon, 5 May 2014 21:31:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B12A8F9; Mon, 5 May 2014 21:31:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45LV1aj080373; Mon, 5 May 2014 21:31:01 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45LV1ol080372; Mon, 5 May 2014 21:31:01 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405052131.s45LV1ol080372@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 5 May 2014 21:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265392 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 21:31:01 -0000 Author: ray Date: Mon May 5 21:31:00 2014 New Revision: 265392 URL: http://svnweb.freebsd.org/changeset/base/265392 Log: Create dataset for vt(4) drivers. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt.h Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Mon May 5 21:29:56 2014 (r265391) +++ head/sys/dev/vt/vt.h Mon May 5 21:31:00 2014 (r265392) @@ -394,6 +394,9 @@ TERMINAL_DECLARE_EARLY(driver ## _conste SYSINIT(vt_early_cons, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_ANY, \ vt_upgrade, &driver ## _consdev) +/* name argument is not used yet. */ +#define VT_DRIVER_DECLARE(name, drv) DATA_SET(vt_drv_set, drv) + /* * Fonts. * From owner-svn-src-head@FreeBSD.ORG Mon May 5 21:33:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F7DDCBA; Mon, 5 May 2014 21:33:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D5D1928; Mon, 5 May 2014 21:33:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45LXL8O082030; Mon, 5 May 2014 21:33:21 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45LXLf7082029; Mon, 5 May 2014 21:33:21 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201405052133.s45LXLf7082029@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 5 May 2014 21:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265393 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 21:33:21 -0000 Author: glebius Date: Mon May 5 21:33:20 2014 New Revision: 265393 URL: http://svnweb.freebsd.org/changeset/base/265393 Log: The tcp_log_addrs() uses th pointer, which points into the mbuf, thus we can not free the mbuf before tcp_log_addrs(). Sponsored by: Nginx, Inc. Sponsored by: Netflix Modified: head/sys/netinet/tcp_reass.c Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Mon May 5 21:31:00 2014 (r265392) +++ head/sys/netinet/tcp_reass.c Mon May 5 21:33:20 2014 (r265393) @@ -144,7 +144,6 @@ tcp_reass(struct tcpcb *tp, struct tcphd V_tcp_reass_overflows++; TCPSTAT_INC(tcps_rcvmemdrop); - m_freem(m); *tlenp = 0; if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) { @@ -152,6 +151,7 @@ tcp_reass(struct tcpcb *tp, struct tcphd "segment dropped\n", s, __func__); free(s, M_TCPLOG); } + m_freem(m); return (0); } From owner-svn-src-head@FreeBSD.ORG Mon May 5 21:34:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 905ADDF9 for ; Mon, 5 May 2014 21:34:03 +0000 (UTC) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 610EC930 for ; Mon, 5 May 2014 21:34:03 +0000 (UTC) Received: by mail-pa0-f50.google.com with SMTP id fb1so3182586pad.23 for ; Mon, 05 May 2014 14:33:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=IF7uDLrw9VNTp1r2QjDGBQQeelyGe9w9koCZmjcGD0Q=; b=FYT4e3GOPvZOBPuODEEddg4kTOkiDmYUr9oZl1MmiMLgK/aBuBqmCF3tCccAqSy6xH d/6KOOeNEzR/wl8jNmk0brXhunfOGsZWd5aVauxDJBWDMI1nE3FO4GNVGov8qDb9Gdm3 QKGPpiXZj7J+a6/fI8QtHotf4W+D1AnW16a8MK8hFhlrUpQuR85YDYa/3mtCkXdY9xut ioKDBUxTJVN2UA5pdyP/hB93Sz+P04qJ0dAh2qY940VOvHMMZlBZSQuzXO4bJiNDpyqo ugNBdjIRJPX/zsJF1h4iVQEkiQl4v5x9eIIWNxFPMhNHE3tMH9w/7HK+prZg7Nr73tqe UE1A== X-Gm-Message-State: ALoCoQnsXKAupeY4PGLzvDLfv3w5Joc2Cz458AWA+QDODm4SuUsLjeAyhyvw1dGADX6/khYlFpuY X-Received: by 10.66.102.72 with SMTP id fm8mr76297882pab.86.1399325636807; Mon, 05 May 2014 14:33:56 -0700 (PDT) Received: from [10.64.26.239] (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id ff4sm80941357pad.24.2014.05.05.14.33.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 14:33:56 -0700 (PDT) Sender: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265367 - head/lib/libc/regex From: Warner Losh In-Reply-To: <3C7CFFB7-5C84-4AC1-9A81-C718D184E87B@FreeBSD.org> Date: Mon, 5 May 2014 15:33:54 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <7D7A417E-17C3-4001-8E79-0B57636A70E1@gmail.com> References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> <5367EB54.1080109@FreeBSD.org> <3C7CFFB7-5C84-4AC1-9A81-C718D184E87B@FreeBSD.org> To: David Chisnall X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Pedro Giffuni , Andrey Chernov , src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 21:34:03 -0000 On May 5, 2014, at 3:21 PM, David Chisnall wrote: > On 5 May 2014, at 20:49, Pedro Giffuni wrote: >=20 >> Yes, but I reverted it because there are other ways to check for = overflows without the performance hit. >=20 > Do we have a good reusable routine for doing this somewhere? Clang = and gcc both have some idiom recognisers that try to spot when people = are attempting to do this. Clang also has a builtin, which would be = good to use when available. Overflow checking is very cheap on modern = CPUs (add, branch on carry), so it would be nice if we could start = looking for this malloc() and realloc() pattern and replacing the = multiply with something that checks for the error. reallocf(): The reallocf() function is identical to the realloc() function, = except that it will free the passed pointer when the requested memory = cannot be allocated. This is a FreeBSD specific API designed to ease the = problems with traditional coding styles for realloc() causing memory leaks = in libraries. ... The reallocf() function first appeared in FreeBSD 3.0. Warner= From owner-svn-src-head@FreeBSD.ORG Mon May 5 21:40:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85ABA473 for ; Mon, 5 May 2014 21:40:12 +0000 (UTC) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBC779A4 for ; Mon, 5 May 2014 21:40:11 +0000 (UTC) Received: by mail-lb0-f171.google.com with SMTP id 10so585550lbg.30 for ; Mon, 05 May 2014 14:40:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=+6DuMZvjek2XrvMOrxkF1HsMDRYyR2h6LYGSFvw/A+E=; b=XcrpR32WGochDOpYSjqXZJTqu1qEu/Vy0chXoFdFNJJBxOmnO0RFlr3Kxkw7qzQA79 2285KAT3CwXJvCw7aWI3HojpH+uqX/dDGAgvj01FDtEwpQ0I0fAJvkPr9j6x5oEhtu7m U6zDOk5ctb8Aau36sBNV0iifT4sNFcjm2UaAONzWqpkpwxOmFuK/3Br2RDwBEjhIIL39 zqaBfzgxEWQ9Ax1dakeOZWViw7I6KiltfMxxbLfrhOBeIMaVKVBy+Sn40rTXG3s+22Fs B4KXwSlpHRCV4i3EzVROydpOPqKtVlfIzSxXNLU/pf5AsL9M8fnaby9ckZ0B98c/h6A6 NIrw== X-Gm-Message-State: ALoCoQlTdcoiTV23KR4bWPCap2ZYwOlvwC7gJ/uHh+JK7PRkR37fDLFa/xfYfkTYLw/gwLD2G3O9 X-Received: by 10.112.106.40 with SMTP id gr8mr27059253lbb.0.1399326003543; Mon, 05 May 2014 14:40:03 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id rd5sm10893243lbb.0.2014.05.05.14.40.02 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 14:40:02 -0700 (PDT) Message-ID: <53680532.7050605@freebsd.org> Date: Tue, 06 May 2014 01:40:02 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: David Chisnall Subject: Re: svn commit: r265367 - head/lib/libc/regex References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Pedro F. Giffuni" , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 21:40:12 -0000 On 05.05.2014 22:28, David Chisnall wrote: > On 5 May 2014, at 18:42, Andrey Chernov wrote: > >> Please don't commit OpenBSD errors. Now you mix calloc() with the >> realloc() for the same variable later which makes calloc() zeroing >> pointless and waste of CPU. > > The purpose of calloc() here is not (primarily) to get the zero'd size, it's to get the overflow-checking behaviour for calloc. It is better to avoid using undocumented intrinsic knowledge of standard function particular implementation, this is unportable at least and hard to understand too. Moreover, choosing some standard function just due to its arcane side effect is semantically incorrect. If you need bounds checking, you can either making it transparent from the library code point of view (preferred) or use literal visible methods (pragma, online function, etc). > The uses of realloc() later do still potentially overflow, as they follow the realloc(pointer, size * sizeof(type)) antipattern. The code can become completely mess if not follows simple strategies above. -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Mon May 5 21:44:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6BA81535; Mon, 5 May 2014 21:44:04 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 330809E1; Mon, 5 May 2014 21:44:03 +0000 (UTC) Received: from [192.168.0.7] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s45LhvD7035233 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 5 May 2014 21:44:00 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265367 - head/lib/libc/regex From: David Chisnall In-Reply-To: <7D7A417E-17C3-4001-8E79-0B57636A70E1@gmail.com> Date: Mon, 5 May 2014 22:43:52 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> <5367EB54.1080109@FreeBSD.org> <3C7CFFB7-5C84-4AC1-9A81-C718D184E87B@FreeBSD.org> <7D7A417E-17C3-4001-8E79-0B57636A70E1@gmail.com> To: Warner Losh X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Pedro Giffuni , Andrey Chernov , src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 21:44:04 -0000 On 5 May 2014, at 22:33, Warner Losh wrote: > reallocf(): > The reallocf() function is identical to the realloc() function, = except > that it will free the passed pointer when the requested memory = cannot be > allocated. This is a FreeBSD specific API designed to ease the = problems > with traditional coding styles for realloc() causing memory leaks = in > libraries. > ... > The reallocf() function first appeared in FreeBSD 3.0. While reallocf() is nice, it doesn't address the problem of overflow. = It takes a single size, forcing the caller to do the number-of-elements = * element-size multiplication, which is the problematic one. If an = attacker can control the number of elements, then it's possible to make = the multiplication overflow so reallocf() will return a valid pointer to = an area of memory that is much smaller than the caller was expecting. =20= David From owner-svn-src-head@FreeBSD.ORG Mon May 5 21:44:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B50967C; Mon, 5 May 2014 21:44:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CF169E7; Mon, 5 May 2014 21:44:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45LisSG085659; Mon, 5 May 2014 21:44:54 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45Lis6X085658; Mon, 5 May 2014 21:44:54 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405052144.s45Lis6X085658@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 5 May 2014 21:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265395 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 21:44:54 -0000 Author: ray Date: Mon May 5 21:44:53 2014 New Revision: 265395 URL: http://svnweb.freebsd.org/changeset/base/265395 Log: Set of updates to vt(4) core part. o Declare vt(4) drivers dataset. o Create single static structures for all early drivers. o Add vt(4) to be by default in the kernel consoles list. o Create one more sysinit point, to be able to initialize memory and lock requirement of early drivers. o Implement early drivers select. (Only best available will be selected). o Fix one missed "return (0)" for VTYLOCK. o Improve locking for cases when one driver replace another. o Make driver replacement notification less debug-look-like. Minor spell fixes. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Mon May 5 21:34:10 2014 (r265394) +++ head/sys/dev/vt/vt_core.c Mon May 5 21:44:53 2014 (r265395) @@ -144,6 +144,83 @@ static int vt_window_switch(struct vt_wi static int vt_late_window_switch(struct vt_window *); static int vt_proc_alive(struct vt_window *); static void vt_resize(struct vt_device *); +static void vt_update_static(void *); + +SET_DECLARE(vt_drv_set, struct vt_driver); + +#define _VTDEFH MAX(100, PIXEL_HEIGHT(VT_FB_DEFAULT_HEIGHT)) +#define _VTDEFW MAX(200, PIXEL_WIDTH(VT_FB_DEFAULT_WIDTH)) + +static struct terminal vt_consterm; +static struct vt_window vt_conswindow; +static struct vt_device vt_consdev = { + .vd_driver = NULL, + .vd_softc = NULL, + .vd_flags = VDF_INVALID, + .vd_windows = { [VT_CONSWINDOW] = &vt_conswindow, }, + .vd_curwindow = &vt_conswindow, + .vd_markedwin = NULL, + .vd_kbstate = 0, +}; +static term_char_t vt_constextbuf[(_VTDEFW) * (VBF_DEFAULT_HISTORY_SIZE)]; +static term_char_t *vt_constextbufrows[VBF_DEFAULT_HISTORY_SIZE]; +static struct vt_window vt_conswindow = { + .vw_number = VT_CONSWINDOW, + .vw_flags = VWF_CONSOLE, + .vw_buf = { + .vb_buffer = vt_constextbuf, + .vb_rows = vt_constextbufrows, + .vb_history_size = VBF_DEFAULT_HISTORY_SIZE, + .vb_curroffset = 0, + .vb_roffset = 0, + .vb_flags = VBF_STATIC, + .vb_mark_start = {.tp_row = 0, .tp_col = 0,}, + .vb_mark_end = {.tp_row = 0, .tp_col = 0,}, + .vb_scr_size = { + .tp_row = _VTDEFH, + .tp_col = _VTDEFW, + }, + }, + .vw_device = &vt_consdev, + .vw_terminal = &vt_consterm, + .vw_kbdmode = K_XLATE, +}; +static struct terminal vt_consterm = { + .tm_class = &vt_termclass, + .tm_softc = &vt_conswindow, + .tm_flags = TF_CONS, +}; +static struct consdev vt_consterm_consdev = { + .cn_ops = &termcn_cnops, + .cn_arg = &vt_consterm, + .cn_name = "ttyv0", +}; + +/* Add to set of consoles. */ +DATA_SET(cons_set, vt_consterm_consdev); + +/* + * Right after kmem is done to allow early drivers to use locking and allocate + * memory. + */ +SYSINIT(vt_update_static, SI_SUB_KMEM, SI_ORDER_ANY, vt_update_static, + &vt_consdev); +/* Delay until all devices attached, to not waste time. */ +SYSINIT(vt_early_cons, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_ANY, vt_upgrade, + &vt_consdev); + +/* Initialize locks/mem depended members. */ +static void +vt_update_static(void *dummy) +{ + + if (main_vd != NULL) { + printf("VT: running with driver \"%s\".\n", + main_vd->vd_driver->vd_name); + mtx_init(&main_vd->vd_lock, "vtdev", NULL, MTX_DEF); + cv_init(&main_vd->vd_winswitch, "vtwswt"); + } +} static void vt_switch_timer(void *arg) @@ -775,7 +852,7 @@ vt_flush(struct vt_device *vd) if ((vd->vd_flags & (VDF_MOUSECURSOR|VDF_TEXTMODE)) == VDF_MOUSECURSOR) { m = &vt_default_mouse_pointer; - bpl = (m->w + 7) >> 3; /* Bytes per sorce line. */ + bpl = (m->w + 7) >> 3; /* Bytes per source line. */ w = m->w; h = m->h; @@ -851,9 +928,11 @@ vtterm_splash(struct vt_device *vd) } #endif + static void vtterm_cnprobe(struct terminal *tm, struct consdev *cp) { + struct vt_driver *vtd, **vtdlist, *vtdbest = NULL; struct vt_window *vw = tm->tm_softc; struct vt_device *vd = vw->vw_device; struct winsize wsz; @@ -862,6 +941,24 @@ vtterm_cnprobe(struct terminal *tm, stru /* Initialization already done. */ return; + SET_FOREACH(vtdlist, vt_drv_set) { + vtd = *vtdlist; + if (vtd->vd_probe == NULL) + continue; + if (vtd->vd_probe(vd) == CN_DEAD) + continue; + if ((vtdbest == NULL) || + (vtd->vd_priority > vtdbest->vd_priority)) + vtdbest = vtd; + } + if (vtdbest == NULL) { + cp->cn_pri = CN_DEAD; + vd->vd_flags |= VDF_DEAD; + return; + } + + vd->vd_driver = vtdbest; + cp->cn_pri = vd->vd_driver->vd_init(vd); if (cp->cn_pri == CN_DEAD) { vd->vd_flags |= VDF_DEAD; @@ -1705,6 +1802,7 @@ skip_thunk: vw->vw_flags |= VWF_VTYLOCK; else vw->vw_flags &= ~VWF_VTYLOCK; + return (0); case VT_OPENQRY: VT_LOCK(vd); for (i = 0; i < VT_MAXWINDOWS; i++) { @@ -1871,12 +1969,6 @@ vt_upgrade(struct vt_device *vd) return; vd->vd_flags |= VDF_ASYNC; - mtx_init(&vd->vd_lock, "vtdev", NULL, MTX_DEF); - cv_init(&vd->vd_winswitch, "vtwswt"); - - /* Init 25 Hz timer. */ - callout_init_mtx(&vd->vd_timer, &vd->vd_lock, 0); - for (i = 0; i < VT_MAXWINDOWS; i++) { vw = vd->vd_windows[i]; if (vw == NULL) { @@ -1894,6 +1986,7 @@ vt_upgrade(struct vt_device *vd) terminal_maketty(vw->vw_terminal, "v%r", VT_UNIT(vw)); } + VT_LOCK(vd); if (vd->vd_curwindow == NULL) vd->vd_curwindow = vd->vd_windows[VT_CONSWINDOW]; @@ -1901,8 +1994,12 @@ vt_upgrade(struct vt_device *vd) vt_allocate_keyboard(vd); DPRINTF(20, "%s: vd_keyboard = %d\n", __func__, vd->vd_keyboard); + /* Init 25 Hz timer. */ + callout_init_mtx(&vd->vd_timer, &vd->vd_lock, 0); + /* Start timer when everything ready. */ callout_reset(&vd->vd_timer, hz / VT_TIMERFREQ, vt_timer, vd); + VT_UNLOCK(vd); } static void @@ -1913,9 +2010,11 @@ vt_resize(struct vt_device *vd) for (i = 0; i < VT_MAXWINDOWS; i++) { vw = vd->vd_windows[i]; + VT_LOCK(vd); /* Assign default font to window, if not textmode. */ if (!(vd->vd_flags & VDF_TEXTMODE) && vw->vw_font == NULL) vw->vw_font = vtfont_ref(&vt_font_default); + VT_UNLOCK(vd); /* Resize terminal windows */ vt_change_font(vw, vw->vw_font); } @@ -1929,21 +2028,26 @@ vt_allocate(struct vt_driver *drv, void if (main_vd == NULL) { main_vd = malloc(sizeof *vd, M_VT, M_WAITOK|M_ZERO); - printf("%s: VT initialize with new VT driver.\n", __func__); + printf("VT: initialize with new VT driver \"%s\".\n", + drv->vd_name); + mtx_init(&main_vd->vd_lock, "vtdev", NULL, MTX_DEF); + cv_init(&main_vd->vd_winswitch, "vtwswt"); + } else { /* * Check if have rights to replace current driver. For example: * it is bad idea to replace KMS driver with generic VGA one. */ if (drv->vd_priority <= main_vd->vd_driver->vd_priority) { - printf("%s: Driver priority %d too low. Current %d\n ", - __func__, drv->vd_priority, - main_vd->vd_driver->vd_priority); + printf("VT: Driver priority %d too low. Current %d\n ", + drv->vd_priority, main_vd->vd_driver->vd_priority); return; } - printf("%s: Replace existing VT driver.\n", __func__); + printf("VT: Replacing driver \"%s\" with new \"%s\".\n", + main_vd->vd_driver->vd_name, drv->vd_name); } vd = main_vd; + VT_LOCK(vd); if (drv->vd_maskbitbltchr == NULL) drv->vd_maskbitbltchr = drv->vd_bitbltchr; @@ -1966,6 +2070,7 @@ vt_allocate(struct vt_driver *drv, void vd->vd_driver = drv; vd->vd_softc = softc; vd->vd_driver->vd_init(vd); + VT_UNLOCK(vd); vt_upgrade(vd); From owner-svn-src-head@FreeBSD.ORG Mon May 5 21:46:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2590811; Mon, 5 May 2014 21:46:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A06269FB; Mon, 5 May 2014 21:46:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45LkAx8085945; Mon, 5 May 2014 21:46:10 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45LkAwe085944; Mon, 5 May 2014 21:46:10 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201405052146.s45LkAwe085944@svn.freebsd.org> From: Robert Watson Date: Mon, 5 May 2014 21:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265396 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 21:46:10 -0000 Author: rwatson Date: Mon May 5 21:46:10 2014 New Revision: 265396 URL: http://svnweb.freebsd.org/changeset/base/265396 Log: Garbage collect two more unused sysinit subsystems: SI_SUB_KVM_RSRC and SI_SUB_CLISTS. MFC after: 3 days Modified: head/sys/sys/kernel.h Modified: head/sys/sys/kernel.h ============================================================================== --- head/sys/sys/kernel.h Mon May 5 21:44:53 2014 (r265395) +++ head/sys/sys/kernel.h Mon May 5 21:46:10 2014 (r265396) @@ -94,7 +94,6 @@ enum sysinit_sub_id { SI_SUB_MTX_POOL_STATIC = 0x0900000, /* static mutex pool */ SI_SUB_VM = 0x1000000, /* virtual memory system init*/ SI_SUB_KMEM = 0x1800000, /* kernel memory*/ - SI_SUB_KVM_RSRC = 0x1A00000, /* kvm operational limits*/ SI_SUB_HYPERVISOR = 0x1A40000, /* * Hypervisor detection and * virtualization support @@ -138,7 +137,6 @@ enum sysinit_sub_id { SI_SUB_CONFIGURE = 0x3800000, /* Configure devices */ SI_SUB_VFS = 0x4000000, /* virtual filesystem*/ SI_SUB_CLOCKS = 0x4800000, /* real time and stat clocks*/ - SI_SUB_CLIST = 0x5800000, /* clists*/ SI_SUB_SYSV_SHM = 0x6400000, /* System V shared memory*/ SI_SUB_SYSV_SEM = 0x6800000, /* System V semaphores*/ SI_SUB_SYSV_MSG = 0x6C00000, /* System V message queues*/ From owner-svn-src-head@FreeBSD.ORG Mon May 5 21:48:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9AFD69E5; Mon, 5 May 2014 21:48:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D4D4A15; Mon, 5 May 2014 21:48:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45LmK4A086283; Mon, 5 May 2014 21:48:20 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45LmJi6086278; Mon, 5 May 2014 21:48:19 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405052148.s45LmJi6086278@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 5 May 2014 21:48:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265397 - in head/sys/dev/vt/hw: efifb fb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 21:48:20 -0000 Author: ray Date: Mon May 5 21:48:19 2014 New Revision: 265397 URL: http://svnweb.freebsd.org/changeset/base/265397 Log: Switch fb and efifb drivers to use names and new vt(4) driver probe method. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/hw/efifb/efifb.c head/sys/dev/vt/hw/fb/vt_early_fb.c head/sys/dev/vt/hw/fb/vt_fb.c head/sys/dev/vt/hw/fb/vt_fb.h Modified: head/sys/dev/vt/hw/efifb/efifb.c ============================================================================== --- head/sys/dev/vt/hw/efifb/efifb.c Mon May 5 21:46:10 2014 (r265396) +++ head/sys/dev/vt/hw/efifb/efifb.c Mon May 5 21:48:19 2014 (r265397) @@ -51,36 +51,58 @@ __FBSDID("$FreeBSD$"); #include #include -static vd_init_t vt_efb_init; +static vd_init_t vt_efifb_init; +static vd_probe_t vt_efifb_probe; -static struct vt_driver vt_efb_driver = { - .vd_init = vt_efb_init, +static struct vt_driver vt_efifb_driver = { + .vd_name = "efifb", + .vd_probe = vt_efifb_probe, + .vd_init = vt_efifb_init, .vd_blank = vt_fb_blank, .vd_bitbltchr = vt_fb_bitbltchr, + .vd_maskbitbltchr = vt_fb_maskbitbltchr, /* Better than VGA, but still generic driver. */ .vd_priority = VD_PRIORITY_GENERIC + 1, }; -static struct fb_info info; -VT_CONSDEV_DECLARE(vt_efb_driver, - MAX(80, PIXEL_WIDTH(VT_FB_DEFAULT_WIDTH)), - MAX(25, PIXEL_HEIGHT(VT_FB_DEFAULT_HEIGHT)), &info); +static struct fb_info local_info; +VT_DRIVER_DECLARE(vt_efifb, vt_efifb_driver); static int -vt_efb_init(struct vt_device *vd) +vt_efifb_probe(struct vt_device *vd) { - int depth, d, disable, i, len; - struct fb_info *info; + int disabled; struct efi_fb *efifb; caddr_t kmdp; - info = vd->vd_softc; + disabled = 0; + TUNABLE_INT_FETCH("hw.syscons.disable", &disabled); + if (disabled != 0) + return (CN_DEAD); - disable = 0; - TUNABLE_INT_FETCH("hw.syscons.disable", &disable); - if (disable != 0) + kmdp = preload_search_by_type("elf kernel"); + if (kmdp == NULL) + kmdp = preload_search_by_type("elf64 kernel"); + efifb = (struct efi_fb *)preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_EFI_FB); + if (efifb == NULL) return (CN_DEAD); + return (CN_INTERNAL); +} + +static int +vt_efifb_init(struct vt_device *vd) +{ + int depth, d, i, len; + struct fb_info *info; + struct efi_fb *efifb; + caddr_t kmdp; + + info = vd->vd_softc; + if (info == NULL) + info = vd->vd_softc = (void *)&local_info; + kmdp = preload_search_by_type("elf kernel"); if (kmdp == NULL) kmdp = preload_search_by_type("elf64 kernel"); @@ -136,7 +158,8 @@ vt_efb_init(struct vt_device *vd) fb_probe(info); vt_fb_init(vd); + /* Clear the screen. */ + vt_fb_blank(vd, TC_BLACK); return (CN_INTERNAL); } - Modified: head/sys/dev/vt/hw/fb/vt_early_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_early_fb.c Mon May 5 21:46:10 2014 (r265396) +++ head/sys/dev/vt/hw/fb/vt_early_fb.c Mon May 5 21:48:19 2014 (r265397) @@ -52,18 +52,19 @@ __FBSDID("$FreeBSD$"); #include static vd_init_t vt_efb_init; +static vd_probe_t vt_efb_probe; static struct vt_driver vt_fb_early_driver = { + .vd_name = "efb", + .vd_probe = vt_efb_probe, .vd_init = vt_efb_init, .vd_blank = vt_fb_blank, .vd_bitbltchr = vt_fb_bitbltchr, .vd_priority = VD_PRIORITY_GENERIC, }; -static struct fb_info info; -VT_CONSDEV_DECLARE(vt_fb_early_driver, - MAX(80, PIXEL_WIDTH(VT_FB_DEFAULT_WIDTH)), - MAX(25, PIXEL_HEIGHT(VT_FB_DEFAULT_HEIGHT)), &info); +static struct fb_info local_info; +VT_DRIVER_DECLARE(vt_efb, vt_fb_early_driver); static void #ifdef FDT @@ -126,30 +127,62 @@ vt_efb_initialize(struct fb_info *info) } } -static int -vt_efb_init(struct vt_device *vd) +static phandle_t +vt_efb_get_fbnode() { - struct ofw_pci_register pciaddrs[8]; - struct fb_info *info; - int i, len, n_pciaddrs; phandle_t chosen, node; ihandle_t stdout; char type[64]; - info = vd->vd_softc; - chosen = OF_finddevice("/chosen"); OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)); node = OF_instance_to_package(stdout); - if (node == -1) { - /* - * The "/chosen/stdout" does not exist try - * using "screen" directly. - */ - node = OF_finddevice("screen"); + if (node != -1) { + /* The "/chosen/stdout" present. */ + OF_getprop(node, "device_type", type, sizeof(type)); + /* Check if it has "display" type. */ + if (strcmp(type, "display") == 0) + return (node); } - OF_getprop(node, "device_type", type, sizeof(type)); - if (strcmp(type, "display") != 0) + /* Try device with name "screen". */ + node = OF_finddevice("screen"); + + return (node); +} + +static int +vt_efb_probe(struct vt_device *vd) +{ + phandle_t node; + + node = vt_efb_get_fbnode(); + if (node == -1) + return (CN_DEAD); + + if ((OF_getproplen(node, "height") <= 0) || + (OF_getproplen(node, "width") <= 0) || + (OF_getproplen(node, "depth") <= 0) || + (OF_getproplen(node, "linebytes") <= 0)) + return (CN_DEAD); + + return (CN_INTERNAL); +} + +static int +vt_efb_init(struct vt_device *vd) +{ + struct ofw_pci_register pciaddrs[8]; + struct fb_info *info; + int i, len, n_pciaddrs; + phandle_t node; + + if (vd->vd_softc == NULL) + vd->vd_softc = (void *)&local_info; + + info = vd->vd_softc; + + node = vt_efb_get_fbnode(); + if (node == -1) return (CN_DEAD); #define GET(name, var) \ @@ -249,7 +282,6 @@ vt_efb_init(struct vt_device *vd) #endif } - /* blank full size */ len = info->fb_size / 4; for (i = 0; i < len; i++) { @@ -274,6 +306,5 @@ vt_efb_init(struct vt_device *vd) fb_probe(info); vt_fb_init(vd); - return (CN_INTERNAL); } Modified: head/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.c Mon May 5 21:46:10 2014 (r265396) +++ head/sys/dev/vt/hw/fb/vt_fb.c Mon May 5 21:48:19 2014 (r265397) @@ -50,9 +50,11 @@ void vt_fb_drawrect(struct vt_device *vd void vt_fb_setpixel(struct vt_device *vd, int x, int y, term_color_t color); static struct vt_driver vt_fb_driver = { + .vd_name = "fb", .vd_init = vt_fb_init, .vd_blank = vt_fb_blank, .vd_bitbltchr = vt_fb_bitbltchr, + .vd_maskbitbltchr = vt_fb_maskbitbltchr, .vd_drawrect = vt_fb_drawrect, .vd_setpixel = vt_fb_setpixel, .vd_postswitch = vt_fb_postswitch, @@ -61,6 +63,8 @@ static struct vt_driver vt_fb_driver = { .vd_fb_mmap = vt_fb_mmap, }; +VT_DRIVER_DECLARE(vt_fb, vt_fb_driver); + static int vt_fb_ioctl(struct vt_device *vd, u_long cmd, caddr_t data, struct thread *td) { @@ -189,6 +193,68 @@ vt_fb_bitbltchr(struct vt_device *vd, co uint32_t fgc, bgc, cc, o; int c, l, bpp; u_long line; + uint8_t b; + const uint8_t *ch; + + info = vd->vd_softc; + bpp = FBTYPE_GET_BYTESPP(info); + fgc = info->fb_cmap[fg]; + bgc = info->fb_cmap[bg]; + b = 0; + if (bpl == 0) + bpl = (width + 7) >> 3; /* Bytes per sorce line. */ + + /* Don't try to put off screen pixels */ + if (((left + width) > info->fb_width) || ((top + height) > + info->fb_height)) + return; + + line = (info->fb_stride * top) + (left * bpp); + for (l = 0; l < height; l++) { + ch = src; + for (c = 0; c < width; c++) { + if (c % 8 == 0) + b = *ch++; + else + b <<= 1; + o = line + (c * bpp); + cc = b & 0x80 ? fgc : bgc; + + switch(bpp) { + case 1: + info->wr1(info, o, cc); + break; + case 2: + info->wr2(info, o, cc); + break; + case 3: + /* Packed mode, so unaligned. Byte access. */ + info->wr1(info, o, (cc >> 16) & 0xff); + info->wr1(info, o + 1, (cc >> 8) & 0xff); + info->wr1(info, o + 2, cc & 0xff); + break; + case 4: + info->wr4(info, o, cc); + break; + default: + /* panic? */ + break; + } + } + line += info->fb_stride; + src += bpl; + } +} + +void +vt_fb_maskbitbltchr(struct vt_device *vd, const uint8_t *src, const uint8_t *mask, + int bpl, vt_axis_t top, vt_axis_t left, unsigned int width, + unsigned int height, term_color_t fg, term_color_t bg) +{ + struct fb_info *info; + uint32_t fgc, bgc, cc, o; + int c, l, bpp; + u_long line; uint8_t b, m; const uint8_t *ch; Modified: head/sys/dev/vt/hw/fb/vt_fb.h ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.h Mon May 5 21:46:10 2014 (r265396) +++ head/sys/dev/vt/hw/fb/vt_fb.h Mon May 5 21:48:19 2014 (r265397) @@ -41,7 +41,7 @@ int fb_probe(struct fb_info *info); vd_init_t vt_fb_init; vd_blank_t vt_fb_blank; vd_bitbltchr_t vt_fb_bitbltchr; +vd_maskbitbltchr_t vt_fb_maskbitbltchr; vd_postswitch_t vt_fb_postswitch; - #endif /* _DEV_VT_HW_FB_VT_FB_H_ */ From owner-svn-src-head@FreeBSD.ORG Mon May 5 21:49:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1EFE2B4D; Mon, 5 May 2014 21:49:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D2D7A29; Mon, 5 May 2014 21:49:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45LnVne086486; Mon, 5 May 2014 21:49:31 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45LnVx4086485; Mon, 5 May 2014 21:49:31 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405052149.s45LnVx4086485@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 5 May 2014 21:49:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265398 - head/sys/dev/vt/hw/ofwfb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 21:49:32 -0000 Author: ray Date: Mon May 5 21:49:31 2014 New Revision: 265398 URL: http://svnweb.freebsd.org/changeset/base/265398 Log: Add vt(4) driver name for ofwfb driver. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Mon May 5 21:48:19 2014 (r265397) +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Mon May 5 21:49:31 2014 (r265398) @@ -63,6 +63,7 @@ static vd_blank_t ofwfb_blank; static vd_bitbltchr_t ofwfb_bitbltchr; static const struct vt_driver vt_ofwfb_driver = { + .vd_name = "ofwfb", .vd_init = ofwfb_init, .vd_blank = ofwfb_blank, .vd_bitbltchr = ofwfb_bitbltchr, From owner-svn-src-head@FreeBSD.ORG Mon May 5 21:51:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F12FD80 for ; Mon, 5 May 2014 21:51:30 +0000 (UTC) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E558CA51 for ; Mon, 5 May 2014 21:51:29 +0000 (UTC) Received: by mail-lb0-f181.google.com with SMTP id z11so5795868lbi.12 for ; Mon, 05 May 2014 14:51:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=1/repdtWv6sNAd8w3YLiRZzPgwarwv11o1mQ1t6GavI=; b=gj1f3b5nuOqtXia5WUASPAOr6GD0TJl69zRM9cQG4gff6t9LsrOLLgnqn1SRD3JpRk +IniANU4y/WRBZaV8OIJc5/djXe7viyo66K3iFvzeAgPoIjIWvTO43HmfsOZ/MBMtEyQ 2KEoplyRTckcUlqEAh+1ZjnoepugIPQu1AliE3ZwqvPQAXI8QdOYOnt0CKlaPlBvgffM obYzyDND2w3ka87m8qOXOjl+SvkkZb17aypNLAJIpv4BWce8WU1mH8hR+nhbsckufkIQ uGjz2zWYO7ZLTOVVPYwPayWzVLh4E58/EXqpv8V7t6GIj13B7KAroXn+zHUnevOgGQj+ NcmA== X-Gm-Message-State: ALoCoQm4cccNMYOXg3U0+I/Gd/sYfMV9gn05/5QNn5kDQ16TsvF1hnACCpXItOEuELqxIA6fkyeT X-Received: by 10.152.29.168 with SMTP id l8mr3792273lah.35.1399326681742; Mon, 05 May 2014 14:51:21 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id k9sm1507548lam.11.2014.05.05.14.51.20 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 14:51:21 -0700 (PDT) Message-ID: <536807D8.9000005@freebsd.org> Date: Tue, 06 May 2014 01:51:20 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: David Chisnall , Warner Losh Subject: Re: svn commit: r265367 - head/lib/libc/regex References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> <5367EB54.1080109@FreeBSD.org> <3C7CFFB7-5C84-4AC1-9A81-C718D184E87B@FreeBSD.org> <7D7A417E-17C3-4001-8E79-0B57636A70E1@gmail.com> In-Reply-To: Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Pedro Giffuni , src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 21:51:30 -0000 On 06.05.2014 1:43, David Chisnall wrote: > While reallocf() is nice, it doesn't address the problem of overflow. It takes a single size, forcing the caller to do the number-of-elements * element-size multiplication, which is the problematic one. If an attacker can control the number of elements, then it's possible to make the multiplication overflow so reallocf() will return a valid pointer to an area of memory that is much smaller than the caller was expecting. For standard malloc/realloc interface it is up to the caller to check n*size not overflows. You must trust caller already does such check. Using calloc() to enforce it instead of caller is semantically wrong, and especially strange when the caller is standard C library under your control. -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Mon May 5 21:52:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 771BBE08; Mon, 5 May 2014 21:52:37 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 427D7A6D; Mon, 5 May 2014 21:52:36 +0000 (UTC) Received: from [192.168.0.7] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s45LqRsA035299 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 5 May 2014 21:52:32 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=koi8-r Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265367 - head/lib/libc/regex From: David Chisnall In-Reply-To: <53680532.7050605@freebsd.org> Date: Mon, 5 May 2014 22:52:21 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> <53680532.7050605@freebsd.org> To: Andrey Chernov X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Pedro F. Giffuni" , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 21:52:37 -0000 On 5 May 2014, at 22:40, Andrey Chernov wrote: > On 05.05.2014 22:28, David Chisnall wrote: >> On 5 May 2014, at 18:42, Andrey Chernov wrote: >>=20 >>> Please don't commit OpenBSD errors. Now you mix calloc() with the >>> realloc() for the same variable later which makes calloc() zeroing >>> pointless and waste of CPU. >>=20 >> The purpose of calloc() here is not (primarily) to get the zero'd = size, it's to get the overflow-checking behaviour for calloc. =20 >=20 > It is better to avoid using undocumented intrinsic knowledge of = standard > function particular implementation, this is unportable at least and = hard > to understand too. calloc() is required to return either NULL or a valid pointer to the = requested amount of memory. An implementation that does not correctly = check for overflow is buggy and will be regarded as a security hole = (see: http://cert.uni-stuttgart.de/ticker/advisories/calloc.html), but = fortunately these were all fixed by around 2004. This is not relying on undocumented intrinsic knowledge, this is relying = on the standard library doing what is required of it. There is a reason = why secure coding standards have, for over a decade, said to prefer = calloc() over malloc() unless profiling shows that calloc() is a = bottleneck: it means that only one person needs to get the overflow = checking right in one place, rather than everyone getting it right = everywhere. =20 David From owner-svn-src-head@FreeBSD.ORG Mon May 5 22:00:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56FCB368 for ; Mon, 5 May 2014 22:00:32 +0000 (UTC) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE405ABC for ; Mon, 5 May 2014 22:00:31 +0000 (UTC) Received: by mail-la0-f41.google.com with SMTP id ec20so4574045lab.0 for ; Mon, 05 May 2014 15:00:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=tj2L+0iQboEK7mq9JX53GZ6uxzvbP3ixXucCBHemmsw=; b=TPOYG7TOukqfoXU1ECJaa9O5nWHN6jMa78mQYtdHa3KBY60eVoEEBu2FVCsqk+lJob iZNVv7/ux63ydwMZ0N0Dlop6+hQQiDxwk9Wi6b6sNI7Jgf1yBFOpnV5YAuuKsvVJy3dB b8cfEcOQvRnSSjMX5V6Qik3GUpzFiuTSvSD6yvpbmDCBZpU0zvTti508GAbSbM3b6Bhu FDI7NPg3rVlF3nKbBe5Q7Nanu+w0YHzW8hj4+sH7UnMy30BmlLU2b6kPKjOuX0X1VnyH Hx9leyt0vFJqKCUdAFwGdJiMJ5FyjpcKxWg4dVdvKLNsM06KHtqowyvcMmM7fN66eTRk wg5g== X-Gm-Message-State: ALoCoQlr0nkrzZq5JxpNmhSEQprrvXeXGXuEtYIgHdNbfaQzHdtXvaOHTAynOv7OAKFR44qE/ugx X-Received: by 10.152.29.8 with SMTP id f8mr14116285lah.11.1399327224068; Mon, 05 May 2014 15:00:24 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id dl4sm10938218lbc.4.2014.05.05.15.00.23 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 15:00:23 -0700 (PDT) Message-ID: <536809F6.8000302@freebsd.org> Date: Tue, 06 May 2014 02:00:22 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: David Chisnall Subject: Re: svn commit: r265367 - head/lib/libc/regex References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> <53680532.7050605@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Pedro F. Giffuni" , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 22:00:32 -0000 On 06.05.2014 1:52, David Chisnall wrote: > This is not relying on undocumented intrinsic knowledge, this is relying on the standard library doing what is required of it. There is a reason why secure coding standards have, for over a decade, said to prefer calloc() over malloc() unless profiling shows that calloc() is a bottleneck: it means that only one person needs to get the overflow checking right in one place, rather than everyone getting it right everywhere. It was unclear what type of ckecking you mean initially and confirm my statement that such code is hard to understand. Even if it is for arithmetic overflow, it is still semantically incorrect, see my other answer. Main purpose of calloc is to zero memory, not to check its argument, so its argument checking is side effect. It should be implemented by the caller (as I already answer) and not by the price of zeroing. -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Mon May 5 22:02:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4B6248E; Mon, 5 May 2014 22:02:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78AF9AF9; Mon, 5 May 2014 22:02:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45M2mF7093059; Mon, 5 May 2014 22:02:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45M2mFH093058; Mon, 5 May 2014 22:02:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405052202.s45M2mFH093058@svn.freebsd.org> From: Warner Losh Date: Mon, 5 May 2014 22:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265399 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 22:02:48 -0000 Author: imp Date: Mon May 5 22:02:48 2014 New Revision: 265399 URL: http://svnweb.freebsd.org/changeset/base/265399 Log: [1] Make WITHOUT_FOO alway trump WITH_FOO, regardless of the system default. This restores more of the historical expectations that were broken when we started disallowing both WITH_FOO and WITHOUT_FOO to be defined. [2] Document this new behavior, and improve the documentation in general here. Submitted by: sjg@ [1]. Modified: head/share/mk/bsd.mkopt.mk Modified: head/share/mk/bsd.mkopt.mk ============================================================================== --- head/share/mk/bsd.mkopt.mk Mon May 5 21:49:31 2014 (r265398) +++ head/share/mk/bsd.mkopt.mk Mon May 5 22:02:48 2014 (r265399) @@ -1,22 +1,34 @@ # # $FreeBSD$ # -# Generic mechanism to deal with WITH and WITHOUT options and turn them into MK_ options. +# Generic mechanism to deal with WITH and WITHOUT options and turn +# them into MK_ options. # +# For each option FOO in __DEFUALT_YES_OPTIONS, MK_FOO is set to +# "yes", unless WITHOUT_FOO is defined, in which case it is set to +# "no". +# +# For each option FOO in __DEFUALT_NO_OPTIONS, MK_FOO is set to "no", +# unless WITH_FOO is defined, in which case it is set to "yes". +# +# If both WITH_FOO and WITHOUT_FOO are defined, WITHOUT_FOO wins and +# MK_FOO is set to "no" regardless of which list it was in. +# +# Both __DEFAULT_YES_OPTIONS and __DEFAULT_NO_OPTIONS are undef'd +# after all this processing, allowing this file to be included +# multiple times with different lists. +# +# Users should generally define WITH_FOO or WITHOUT_FOO, but the build +# system should use MK_FOO={yes,no} when it needs to override the +# user's desires or default behavior. # -# For each option FOO that defaults to YES, MK_FOO is set to yes, unless WITHOUT_FOO -# is defined, in which case it is set to no. If both WITH_FOO and WITHOUT_FOO are -# defined, WITHOUT_FOO wins. The list of default yes options is contained in the -# __DEFAULT_YES_OPTIONS variable, which is undefined after expansion. -# -# For each option FOO that defaults to NO, MK_FOO is set to no, unless WITH_FOO -# is defined, in which case it is set to yes. If both WITH_FOO and WITHOUT_FOO are -# defined, WITH_FOO wins. The list of default no options is contained in the -# __DEFAULT_NO_OPTIONS variable, which is undefined after expansion. + +# +# MK_* options which default to "yes". # .for var in ${__DEFAULT_YES_OPTIONS} .if !defined(MK_${var}) -.if defined(WITHOUT_${var}) # IF both WITH and WITHOUT defined, WITHOUT wins. +.if defined(WITHOUT_${var}) # WITHOUT always wins MK_${var}:= no .else MK_${var}:= yes @@ -30,7 +42,7 @@ MK_${var}:= yes # .for var in ${__DEFAULT_NO_OPTIONS} .if !defined(MK_${var}) -.if defined(WITH_${var}) # If both WITH and WITHOUT defined, WITH wins +.if definfed(WITH_${var} && !defined(WITHOUT_${var}) # WITHOUT aways wins MK_${var}:= yes .else MK_${var}:= no From owner-svn-src-head@FreeBSD.ORG Mon May 5 22:03:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2379B5D1; Mon, 5 May 2014 22:03:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0507DB02; Mon, 5 May 2014 22:03:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45M311L093191; Mon, 5 May 2014 22:03:01 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45M31qr093189; Mon, 5 May 2014 22:03:01 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405052203.s45M31qr093189@svn.freebsd.org> From: Warner Losh Date: Mon, 5 May 2014 22:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265400 - in head: share/mk sys/boot/i386/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 22:03:02 -0000 Author: imp Date: Mon May 5 22:03:01 2014 New Revision: 265400 URL: http://svnweb.freebsd.org/changeset/base/265400 Log: Introduce CWARNFLAGS.${COMPILER_TYPE} and use that to simplify the thicket of .if ${COMPILER_TYPE} == "clang" that controls warnings. Also, use CFLAGS.clang in a couple places in preference to having a similar construct that's related to the CWARNFLAGS changes. Modified: head/share/mk/bsd.sys.mk head/sys/boot/i386/boot2/Makefile Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Mon May 5 22:02:48 2014 (r265399) +++ head/share/mk/bsd.sys.mk Mon May 5 22:03:01 2014 (r265400) @@ -52,9 +52,8 @@ CWARNFLAGS+= -Wcast-align .if ${WARNS} >= 6 CWARNFLAGS+= -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls\ -Wold-style-definition -.if ${COMPILER_TYPE} == "clang" && !defined(EARLY_BUILD) && \ - !defined(NO_WMISSING_VARIABLE_DECLARATIONS) -CWARNFLAGS+= -Wmissing-variable-declarations +.if !defined(EARLY_BUILD) && !defined(NO_WMISSING_VARIABLE_DECLARATIONS) +CWARNFLAGS.clang+= -Wmissing-variable-declarations .endif .endif # WARNS >= 6 .if ${WARNS} >= 2 && ${WARNS} <= 4 @@ -65,24 +64,24 @@ CWARNFLAGS+= -Wno-uninitialized CWARNFLAGS+= -Wno-pointer-sign # Clang has more warnings enabled by default, and when using -Wall, so if WARNS # is set to low values, these have to be disabled explicitly. -.if ${COMPILER_TYPE} == "clang" && !defined(EARLY_BUILD) +.if !defined(EARLY_BUILD) .if ${WARNS} <= 6 -CWARNFLAGS+= -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable +CWARNFLAGS.clang+= -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable .endif # WARNS <= 6 .if ${WARNS} <= 3 -CWARNFLAGS+= -Wno-tautological-compare -Wno-unused-value\ +CWARNFLAGS.clang+= -Wno-tautological-compare -Wno-unused-value\ -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion .endif # WARNS <= 3 .if ${WARNS} <= 2 -CWARNFLAGS+= -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter +CWARNFLAGS.clang+= -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter .endif # WARNS <= 2 .if ${WARNS} <= 1 -CWARNFLAGS+= -Wno-parentheses +CWARNFLAGS.clang+= -Wno-parentheses .endif # WARNS <= 1 .if defined(NO_WARRAY_BOUNDS) -CWARNFLAGS+= -Wno-array-bounds +CWARNFLAGS.clang+= -Wno-array-bounds .endif # NO_WARRAY_BOUNDS -.endif # CLANG +.endif # !EARLY_BUILD .endif # WARNS .if defined(FORMAT_AUDIT) @@ -92,11 +91,11 @@ WFORMAT= 1 .if ${WFORMAT} > 0 #CWARNFLAGS+= -Wformat-nonliteral -Wformat-security -Wno-format-extra-args CWARNFLAGS+= -Wformat=2 -Wno-format-extra-args -.if ${COMPILER_TYPE} == "clang" && !defined(EARLY_BUILD) +.if !defined(EARLY_BUILD) .if ${WARNS} <= 3 -CWARNFLAGS+= -Wno-format-nonliteral +CWARNFLAGS.clang+= -Wno-format-nonliteral .endif # WARNS <= 3 -.endif # CLANG +.endif # !EARLY_BUILD .if !defined(NO_WERROR) && !defined(NO_WERROR.${COMPILER_TYPE}) CWARNFLAGS+= -Werror .endif # !NO_WERROR && !NO_WERROR.${COMPILER_TYPE} @@ -111,23 +110,25 @@ CWARNFLAGS+= -Wno-format CWARNFLAGS+= -Wno-unknown-pragmas .endif # IGNORE_PRAGMA -.if !defined(EARLY_BUILD) .if ${COMPILER_TYPE} == "clang" +# Would love to do this unconditionally, but can't due to its use in +# kernel build coupled with CFLAGS.${TARGET} feature CLANG_NO_IAS= -no-integrated-as +.endif CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\ -mllvm -enable-load-pre=false -mllvm -simplifycfg-dup-ret -CFLAGS+= -Qunused-arguments +.if !defined(EARLY_BUILD) +CFLAGS.clang+= -Qunused-arguments .if ${MACHINE_CPUARCH} == "sparc64" # Don't emit .cfi directives, since we must use GNU as on sparc64, for now. -CFLAGS+= -fno-dwarf2-cfi-asm +CFLAGS.clang+= -fno-dwarf2-cfi-asm .endif # SPARC64 # The libc++ headers use c++11 extensions. These are normally silenced because # they are treated as system headers, but we explicitly disable that warning # suppression when building the base system to catch bugs in our headers. # Eventually we'll want to start building the base system C++ code as C++11, # but not yet. -CXXFLAGS+= -Wno-c++11-extensions -.endif # CLANG +CXXFLAGS.clang+= -Wno-c++11-extensions CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} CXXFLAGS+= ${CXXFLAGS.${COMPILER_TYPE}} .endif # !EARLY_BUILD @@ -140,8 +141,7 @@ CFLAGS+= ${SSP_CFLAGS} .endif # SSP && !IA64 && !ARM && !MIPS # Allow user-specified additional warning flags -CFLAGS+= ${CWARNFLAGS} - +CFLAGS+= ${CWARNFLAGS} ${CWARNFLAGS.${COMPILER_TYPE}} # Tell bmake not to mistake standard targets for things to be searched for # or expect to ever be up-to-date. Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Mon May 5 22:02:48 2014 (r265399) +++ head/sys/boot/i386/boot2/Makefile Mon May 5 22:03:01 2014 (r265400) @@ -38,13 +38,14 @@ CFLAGS= -Os \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -Winline \ - ${CLANG_OPT_SMALL} CFLAGS.gcc+= -fno-guess-branch-probability \ -fno-unit-at-a-time \ -mno-align-long-strings \ --param max-inline-insns-single=100 +CFLAGS.clang+=${CLANG_OPT_SMALL} + LD_FLAGS=-static -N --gc-sections # Pick up ../Makefile.inc early. From owner-svn-src-head@FreeBSD.ORG Mon May 5 22:03:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7211C70D; Mon, 5 May 2014 22:03:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F4C6B06; Mon, 5 May 2014 22:03:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45M39nF093261; Mon, 5 May 2014 22:03:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45M39sg093260; Mon, 5 May 2014 22:03:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405052203.s45M39sg093260@svn.freebsd.org> From: Warner Losh Date: Mon, 5 May 2014 22:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265401 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 22:03:09 -0000 Author: imp Date: Mon May 5 22:03:08 2014 New Revision: 265401 URL: http://svnweb.freebsd.org/changeset/base/265401 Log: Simplify use of the semi-bogus EARLY_BUILD variable. Also, simplify use of semi-bogus NO_WARNS variable. Both of these, in this case, should collapse to WITHOUT_WARNS in a future commit. Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Mon May 5 22:03:01 2014 (r265400) +++ head/share/mk/bsd.sys.mk Mon May 5 22:03:08 2014 (r265401) @@ -24,7 +24,6 @@ CFLAGS+= -std=iso9899:1999 .else # CSTD CFLAGS+= -std=${CSTD} .endif # CSTD -.if !defined(NO_WARNS) # -pedantic is problematic because it also imposes namespace restrictions #CFLAGS+= -pedantic .if defined(WARNS) @@ -52,7 +51,7 @@ CWARNFLAGS+= -Wcast-align .if ${WARNS} >= 6 CWARNFLAGS+= -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls\ -Wold-style-definition -.if !defined(EARLY_BUILD) && !defined(NO_WMISSING_VARIABLE_DECLARATIONS) +.if !defined(NO_WMISSING_VARIABLE_DECLARATIONS) CWARNFLAGS.clang+= -Wmissing-variable-declarations .endif .endif # WARNS >= 6 @@ -64,7 +63,6 @@ CWARNFLAGS+= -Wno-uninitialized CWARNFLAGS+= -Wno-pointer-sign # Clang has more warnings enabled by default, and when using -Wall, so if WARNS # is set to low values, these have to be disabled explicitly. -.if !defined(EARLY_BUILD) .if ${WARNS} <= 6 CWARNFLAGS.clang+= -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable .endif # WARNS <= 6 @@ -81,7 +79,6 @@ CWARNFLAGS.clang+= -Wno-parentheses .if defined(NO_WARRAY_BOUNDS) CWARNFLAGS.clang+= -Wno-array-bounds .endif # NO_WARRAY_BOUNDS -.endif # !EARLY_BUILD .endif # WARNS .if defined(FORMAT_AUDIT) @@ -91,11 +88,9 @@ WFORMAT= 1 .if ${WFORMAT} > 0 #CWARNFLAGS+= -Wformat-nonliteral -Wformat-security -Wno-format-extra-args CWARNFLAGS+= -Wformat=2 -Wno-format-extra-args -.if !defined(EARLY_BUILD) .if ${WARNS} <= 3 CWARNFLAGS.clang+= -Wno-format-nonliteral .endif # WARNS <= 3 -.endif # !EARLY_BUILD .if !defined(NO_WERROR) && !defined(NO_WERROR.${COMPILER_TYPE}) CWARNFLAGS+= -Werror .endif # !NO_WERROR && !NO_WERROR.${COMPILER_TYPE} @@ -104,7 +99,6 @@ CWARNFLAGS+= -Werror .if defined(NO_WFORMAT) || defined(NO_WFORMAT.${COMPILER_TYPE}) CWARNFLAGS+= -Wno-format .endif # NO_WFORMAT || NO_WFORMAT.${COMPILER_TYPE} -.endif # !NO_WARNS .if defined(IGNORE_PRAGMA) CWARNFLAGS+= -Wno-unknown-pragmas @@ -117,7 +111,6 @@ CLANG_NO_IAS= -no-integrated-as .endif CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\ -mllvm -enable-load-pre=false -mllvm -simplifycfg-dup-ret -.if !defined(EARLY_BUILD) CFLAGS.clang+= -Qunused-arguments .if ${MACHINE_CPUARCH} == "sparc64" # Don't emit .cfi directives, since we must use GNU as on sparc64, for now. @@ -129,9 +122,6 @@ CFLAGS.clang+= -fno-dwarf2-cfi-asm # Eventually we'll want to start building the base system C++ code as C++11, # but not yet. CXXFLAGS.clang+= -Wno-c++11-extensions -CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} -CXXFLAGS+= ${CXXFLAGS.${COMPILER_TYPE}} -.endif # !EARLY_BUILD .if ${MK_SSP} != "no" && ${MACHINE_CPUARCH} != "ia64" && \ ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" @@ -140,8 +130,19 @@ SSP_CFLAGS?= -fstack-protector CFLAGS+= ${SSP_CFLAGS} .endif # SSP && !IA64 && !ARM && !MIPS -# Allow user-specified additional warning flags +# Allow user-specified additional warning flags, plus compiler specific flag overrides. +# Unless we're early in the build, in which case don't (which is lame, this should +# be handled by NO_WARNS which needs to migrate to something else. +.if !defined(NO_WARNS) && !defined(EARLY_BUILD) CFLAGS+= ${CWARNFLAGS} ${CWARNFLAGS.${COMPILER_TYPE}} +.endif + +# Not sure this is 100% kosher, but I think that EARLY_BUILD must be only +# defined when we're not building programs that use the CFLAGS.foo feature. +.if !defined(EARLY_BUILD) +CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} +CXXFLAGS+= ${CXXFLAGS.${COMPILER_TYPE}} +.endif # Tell bmake not to mistake standard targets for things to be searched for # or expect to ever be up-to-date. From owner-svn-src-head@FreeBSD.ORG Mon May 5 22:10:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 280C29BD; Mon, 5 May 2014 22:10:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16348B6C; Mon, 5 May 2014 22:10:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45MAVvl095812; Mon, 5 May 2014 22:10:31 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45MAVfj095811; Mon, 5 May 2014 22:10:31 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405052210.s45MAVfj095811@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 5 May 2014 22:10:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265402 - head/sys/dev/vt/hw/vga X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 22:10:32 -0000 Author: ray Date: Mon May 5 22:10:31 2014 New Revision: 265402 URL: http://svnweb.freebsd.org/changeset/base/265402 Log: Revert r264997 and r265026. It is not required anymore. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/hw/vga/vga.c Modified: head/sys/dev/vt/hw/vga/vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vga.c Mon May 5 22:03:08 2014 (r265401) +++ head/sys/dev/vt/hw/vga/vga.c Mon May 5 22:10:31 2014 (r265402) @@ -45,10 +45,8 @@ __FBSDID("$FreeBSD$"); #if defined(__amd64__) || defined(__i386__) #include #include -#include #include #include -#include #endif /* __amd64__ || __i386__ */ struct vga_softc { @@ -638,19 +636,6 @@ vga_init(struct vt_device *vd) struct vga_softc *sc = vd->vd_softc; int textmode = 0; -#if defined(__amd64__) - /* Disable if EFI framebuffer present. Should be handled by priority - * logic in vt(9), but this will do for now. XXX */ - - caddr_t kmdp, efifb; - kmdp = preload_search_by_type("elf kernel"); - if (kmdp == NULL) - kmdp = preload_search_by_type("elf64 kernel"); - efifb = preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_EFI_FB); - if (efifb != NULL) - return (CN_DEAD); -#endif - #if defined(__amd64__) || defined(__i386__) sc->vga_fb_tag = X86_BUS_SPACE_MEM; sc->vga_fb_handle = KERNBASE + VGA_MEM_BASE; From owner-svn-src-head@FreeBSD.ORG Mon May 5 22:12:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10837B15; Mon, 5 May 2014 22:12:17 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C86B3B80; Mon, 5 May 2014 22:12:16 +0000 (UTC) Received: from [192.168.0.7] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s45MCBr3035447 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 5 May 2014 22:12:13 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=koi8-r Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265367 - head/lib/libc/regex From: David Chisnall In-Reply-To: <536807D8.9000005@freebsd.org> Date: Mon, 5 May 2014 23:12:05 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <9349EAA9-F92C-4170-A1C0-2200FD490E5F@FreeBSD.org> References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> <5367EB54.1080109@FreeBSD.org> <3C7CFFB7-5C84-4AC1-9A81-C718D184E87B@FreeBSD.org> <7D7A417E-17C3-4001-8E79-0B57636A70E1@gmail.com> <536807D8.9000005@freebsd.org> To: Andrey Chernov X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Pedro Giffuni , src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 22:12:17 -0000 On 5 May 2014, at 22:51, Andrey Chernov wrote: > For standard malloc/realloc interface it is up to the caller to check > n*size not overflows. You must trust caller already does such check. Do a search of the CVE database sometime to see how well placed that = trust generally is. Or even look at the code in question, where none of = the realloc() or malloc() calls does overflow checking. > Using calloc() to enforce it instead of caller is semantically wrong, Relying on a standard function to behave according to the standard is = semantically wrong? > and especially strange when the caller is standard C library under = your > control. I don't follow this. If libc can't rely on standards conformance from = itself then other code stands no chance. > It was unclear what type of ckecking you mean initially You mean when I said 'the overflow-checking behaviour of calloc'? I'm = sorry, but I'm not sure how I could have made that clearer. > and confirm my > statement that such code is hard to understand. I disagree. Favouring calloc() over malloc() unless profiling indicates = that calloc() is a bottleneck has been recommended practice for a *very* = long time and I'm honestly surprised to encounter C programmers who have = not come across the advice. =20 > Even if it is for > arithmetic overflow, it is still semantically incorrect, see my other > answer. Your other answer did not say *why* you think it's 'semantically = incorrect'. The standard requires calloc() to do overflow checking and = that is the reason for its use in the overwhelming number of cases. > Main purpose of calloc is to zero memory, not to check its > argument, so its argument checking is side effect. It should be > implemented by the caller (as I already answer) and not by the price = of > zeroing. It is unfortunate that the zeroing and the overflow checking were = conflated in the standard, but that certainly doesn't mean that it is = the only purpose of calloc. =20 If you want to argue that the price of zeroing is too high, then I would = like to see some profiling data to back it up. Between the cost of = performing an allocation and the cost of doing a regex search, I'd be = surprised if the cost of a bzero() were not in the noise. To offset = this, you'd be increasing i-cache usage at every malloc() call site by = wrapping it in an overflow check (if you want the code to be *correct* = as well as fast), which is likely to be a bigger hit. =20 The reason that calloc() does zeroing in the first place rather than = just having malloc() followed by memset() / bzero() is that the memory = that malloc() gets from the kernel is already zero'd, and so the 'price' = for the zeroing is often nothing. David P.S. A quick look at Coverity shows 4 other bugs in this file, one of = which looks like it might actually be serious. =20= From owner-svn-src-head@FreeBSD.ORG Mon May 5 22:12:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A5ABC52; Mon, 5 May 2014 22:12:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 589E2B84; Mon, 5 May 2014 22:12:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45MClro097170; Mon, 5 May 2014 22:12:47 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45MCldG097169; Mon, 5 May 2014 22:12:47 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405052212.s45MCldG097169@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 5 May 2014 22:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265403 - head/sys/dev/vt/hw/vga X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 22:12:47 -0000 Author: ray Date: Mon May 5 22:12:46 2014 New Revision: 265403 URL: http://svnweb.freebsd.org/changeset/base/265403 Log: Switch vga drivers to use names and new vt(4) driver probe method. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/hw/vga/vga.c Modified: head/sys/dev/vt/hw/vga/vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vga.c Mon May 5 22:10:31 2014 (r265402) +++ head/sys/dev/vt/hw/vga/vga.c Mon May 5 22:12:46 2014 (r265403) @@ -71,6 +71,7 @@ struct vga_softc { #define VT_VGA_HEIGHT 480 #define VT_VGA_MEMSIZE (VT_VGA_WIDTH * VT_VGA_HEIGHT / 8) +static vd_probe_t vga_probe; static vd_init_t vga_init; static vd_blank_t vga_blank; static vd_bitbltchr_t vga_bitbltchr; @@ -81,6 +82,8 @@ static vd_putchar_t vga_putchar; static vd_postswitch_t vga_postswitch; static const struct vt_driver vt_vga_driver = { + .vd_name = "vga", + .vd_probe = vga_probe, .vd_init = vga_init, .vd_blank = vga_blank, .vd_bitbltchr = vga_bitbltchr, @@ -97,8 +100,7 @@ static const struct vt_driver vt_vga_dri * buffer is always big enough to support both. */ static struct vga_softc vga_conssoftc; -VT_CONSDEV_DECLARE(vt_vga_driver, MAX(80, PIXEL_WIDTH(VT_VGA_WIDTH)), - MAX(25, PIXEL_HEIGHT(VT_VGA_HEIGHT)), &vga_conssoftc); +VT_DRIVER_DECLARE(vt_vga, vt_vga_driver); static inline void vga_setcolor(struct vt_device *vd, term_color_t color) @@ -631,10 +633,22 @@ vga_initialize(struct vt_device *vd, int } static int +vga_probe(struct vt_device *vd) +{ + + return (CN_INTERNAL); +} + +static int vga_init(struct vt_device *vd) { - struct vga_softc *sc = vd->vd_softc; - int textmode = 0; + struct vga_softc *sc; + int textmode; + + if (vd->vd_softc == NULL) + vd->vd_softc = (void *)&vga_conssoftc; + sc = vd->vd_softc; + textmode = 0; #if defined(__amd64__) || defined(__i386__) sc->vga_fb_tag = X86_BUS_SPACE_MEM; From owner-svn-src-head@FreeBSD.ORG Mon May 5 22:17:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82609ECE for ; Mon, 5 May 2014 22:17:37 +0000 (UTC) Received: from nm43-vm8.bullet.mail.bf1.yahoo.com (nm43-vm8.bullet.mail.bf1.yahoo.com [216.109.114.239]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 086E0BD6 for ; Mon, 5 May 2014 22:17:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1399327858; bh=8V9SDt6K1+kstkRWZ0DfiOqLScphesFdbZtI4R18f/8=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:Organization:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=XmdaNkRz8bkMi8pEsrLvu1FmUStzsif5U/6WsD9gTo5+eOFO1NH6gzIdN8xnKiXnObn2DjKA7DazlsxPU/XgGkLK0YiNb+bE/cdC41ijt4UDdCokb7Coxk8r1z/jC/DT8oj9pwEJ3UjRD6NXo1w48ZgEn+OqQVKqQ0Lz/gKkqmF7o0NUst8JeaiO1hzLKFEROLehL94XRyBORqRtYMnoND5qHqady1PXsmYbf0TsH4QHaFWWRva4nsLAi+a+3DmCzrFn5I8iUN9/Sm7n1k+fWumJiEc0DGXJt47rkzB54Pyfmook3bKwWyh6VpQ2qtC6NUrbBC7UGdwKkePwhLKngA== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=rJ755XPjg/s/DW2qEPYPT0k5ZugOQ6shuL7HsuR5jkRh3CPGuMGKt+srptp50ces1DZBE0+UN1RWN8/Y34Z94aCAL/g6wbwLO6PmrgI99RcPbTzKlPpK4Ho6qbJTIU8W3SfPHynI850sXnZovbo246X/7LiKqd5YN9uUgd+ij/pzGrr16dSjaTmQChDXHYKgwGs8COMfltYAXMhKjaH333FF0YFuxVAO/Q9Ov9SKamTh/jC67s+VhJmj1XPnwWbYim8+drW3vA3Spb/81iwzweZjXhtHE3Hk44O5uRSZp4h2R+kCkbSsv+6DaDqPygCqk1gqCCYVnWoEH+QuhY6fkg==; Received: from [66.196.81.172] by nm43.bullet.mail.bf1.yahoo.com with NNFMP; 05 May 2014 22:10:58 -0000 Received: from [68.142.230.73] by tm18.bullet.mail.bf1.yahoo.com with NNFMP; 05 May 2014 22:10:58 -0000 Received: from [127.0.0.1] by smtp230.mail.bf1.yahoo.com with NNFMP; 05 May 2014 22:10:58 -0000 X-Yahoo-Newman-Id: 71619.44312.bm@smtp230.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: zU4kFMgVM1mUiRtpFXlcsGxwBq7zNQ8AbzlbdX8uZtsto1d 2Gq8Hh7u48QJDWctRrgmyPpufZzO0rXdZMJusY0RyEmNuiVHRmC9VGp1cH57 3izFdinU.zSSjZSXXJD8RY6hJAW3PA.ob4lylnTLKLA4JI7hotH5unhfEqC. B7U_qZ9kxHDbcL5bWp4RW57m9ZDmnhlw85VEI0SIbBnUZQAnGOLPxNq9hS7I fYgzMLBJIEQCohFwiMUYuxIJnxXUaYIWRcND_apdWzjf43BNlhWCjGffjFWX pUQ9.gHb3xfdngZMftfrR.Furxj1aXr31JecYJGQmMR80ewgr_.kJst3LN4n 39EJk9fhgiux.2oV9CwTfHi1rcyoixKM8GIyZKExjOYKURMpJJjvAF7JaK3. 1FMnlZIeRD.wfCn6j8mOJzgeQKgLZQQuoxrrXX6N2TaShE8UsLmgWQZ94AcS 9wMsEQQB_K5l5FsVuYu1.4pwB7dKzAaJA0NKzjOmwjQtSrY7E3tXuCoJxaii BP67vtTqsZefz29prC5vKrwc2uo0- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain [98.139.211.125]) by smtp230.mail.bf1.yahoo.com with SMTP; 05 May 2014 22:10:58 +0000 UTC Message-ID: <53680C72.10809@FreeBSD.org> Date: Mon, 05 May 2014 17:10:58 -0500 From: Pedro Giffuni Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: David Chisnall Subject: Re: svn commit: r265367 - head/lib/libc/regex References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> <5367EB54.1080109@FreeBSD.org> <3C7CFFB7-5C84-4AC1-9A81-C718D184E87B@FreeBSD.org> In-Reply-To: <3C7CFFB7-5C84-4AC1-9A81-C718D184E87B@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrey Chernov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 22:17:37 -0000 El 5/5/2014 4:21 PM, David Chisnall escribió: > On 5 May 2014, at 20:49, Pedro Giffuni wrote: > >> Yes, but I reverted it because there are other ways to check for overflows without the performance hit. > FWIW, in this particular case I think the overflow simply doesn't happen: apparently it is easier to be hit by a DoS first. > Do we have a good reusable routine for doing this somewhere? Clang and gcc both have some idiom recognisers that try to spot when people are attempting to do this. Clang also has a builtin, which would be good to use when available. Overflow checking is very cheap on modern CPUs (add, branch on carry), so it would be nice if we could start looking for this malloc() and realloc() pattern and replacing the multiply with something that checks for the error. > We don't. OpenBSD introduced an extension: reallocarray(). Pedro. From owner-svn-src-head@FreeBSD.ORG Mon May 5 22:20:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A9BED7 for ; Mon, 5 May 2014 22:20:05 +0000 (UTC) Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B32FBF5 for ; Mon, 5 May 2014 22:20:05 +0000 (UTC) Received: by mail-pa0-f49.google.com with SMTP id lj1so5010952pab.22 for ; Mon, 05 May 2014 15:19:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=Evw6yi28scFhgS+JMehy9SpPct7EFvcCv7cA8GAC6ic=; b=kc4vnP/bXb8C6bCw6CefwvxTpnhVBfjXWJo312MAKBBqAbT97M8rWpX40MDSQKzJvE N9tSU5neRkyPyI+eMoJQx7wNIvp8xp5fxtZaXuQuhXigW8RIus0MPt+rUMu049lLh4ss XqgPn+Gr9YUGCzdWJ5WORp7HeJNP1ktu0AnABm+ywAChN/OmTU74WDs5OJHOklOfcTQn JhJrJutOhmrcBIXuIjtgHwAh1u6d1syGBNY0/3tmGiUUxIxOgXLHkImnocV6zkiu/3PL mhRKnhiXz9rLOlAdglEe0D4RjmgESuKbpPHIIgpsn0FPpBXIZRFrclrw9hl6h89rkhSl QL0g== X-Gm-Message-State: ALoCoQkHbln/iMcv2knQAZOtdDvOoExIku+FTPKq4dFpj6c0rKUS65C0D0+wMrOwSPgxgaaNi2Km X-Received: by 10.66.252.69 with SMTP id zq5mr77861427pac.54.1399328398860; Mon, 05 May 2014 15:19:58 -0700 (PDT) Received: from [10.64.26.239] (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id ai11sm28636978pac.30.2014.05.05.15.19.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 15:19:58 -0700 (PDT) Sender: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265367 - head/lib/libc/regex From: Warner Losh In-Reply-To: <53680C72.10809@FreeBSD.org> Date: Mon, 5 May 2014 16:19:54 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <04AFAEF4-1AF7-4310-9248-8654B1EAA560@gmail.com> References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> <5367EB54.1080109@FreeBSD.org> <3C7CFFB7-5C84-4AC1-9A81-C718D184E87B@FreeBSD.org> <53680C72.10809@FreeBSD.org> To: Pedro Giffuni X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, Andrey Chernov , svn-src-all@freebsd.org, src-committers@freebsd.org, David Chisnall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 22:20:05 -0000 On May 5, 2014, at 4:10 PM, Pedro Giffuni wrote: > El 5/5/2014 4:21 PM, David Chisnall escribi=F3: >> On 5 May 2014, at 20:49, Pedro Giffuni wrote: >>=20 >>> Yes, but I reverted it because there are other ways to check for = overflows without the performance hit. >>=20 >=20 > FWIW, in this particular case I think the overflow simply doesn't = happen: apparently it is easier to be hit by a DoS first. >=20 >=20 >> Do we have a good reusable routine for doing this somewhere? Clang = and gcc both have some idiom recognisers that try to spot when people = are attempting to do this. Clang also has a builtin, which would be = good to use when available. Overflow checking is very cheap on modern = CPUs (add, branch on carry), so it would be nice if we could start = looking for this malloc() and realloc() pattern and replacing the = multiply with something that checks for the error. >>=20 >=20 > We don't. OpenBSD introduced an extension: reallocarray(). We do. reallocf(), which first appeared in FreeBSD 3.0. Warner From owner-svn-src-head@FreeBSD.ORG Mon May 5 22:52:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87AC1AD3 for ; Mon, 5 May 2014 22:52:36 +0000 (UTC) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04C8DE86 for ; Mon, 5 May 2014 22:52:35 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id p9so1488469lbv.35 for ; Mon, 05 May 2014 15:52:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=EuuAx8swSzUxIg4hr5PecUXRQ9bhiVlvTWAvvu+sSS8=; b=GBORT4Yu62KG6ew9ed0YotBT7REIHfuagHPrsb/XqTslM0oaZv7yCA7PcpCkZzgKdr jeR0L0fN9YHygpRMzRB4rvgI46tUgMt11Wlqk+cbnVhfHO0mud3Q3Bi/aXOsRLQRcHsD DYvpdj5eCjbPz8a2GrOMB7pCt/VESUlVvrUbQ5hTZtGn7kZef3O+AjPyyO7Qczkf06Wh NHxg2kvOGTEFkqWya/akF6QdnVO/DWxxo+1zbJ5K/DZei/OSIlIhfwLr2ZiOHVEDO2YJ c6ovD66PrOSF/elqp8W8WaJ+B7gHXrGQCgNTuTpVnoHW6JYqh43SKq0bC2d/xwJTetps PtXA== X-Gm-Message-State: ALoCoQnDhfh4kXszEHLCF82WH9QWN9wtUG4m5vfZjJCpEoVgEkzxff0CJWq4utSD6ue/yJcCrfuJ X-Received: by 10.152.87.71 with SMTP id v7mr14308124laz.10.1399330348155; Mon, 05 May 2014 15:52:28 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id ms3sm11046078lbb.17.2014.05.05.15.52.27 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 15:52:27 -0700 (PDT) Message-ID: <5368162A.9000002@freebsd.org> Date: Tue, 06 May 2014 02:52:26 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: David Chisnall Subject: Re: svn commit: r265367 - head/lib/libc/regex References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> <5367EB54.1080109@FreeBSD.org> <3C7CFFB7-5C84-4AC1-9A81-C718D184E87B@FreeBSD.org> <7D7A417E-17C3-4001-8E79-0B57636A70E1@gmail.com> <536807D8.9000005@freebsd.org> <9349EAA9-F92C-4170-A1C0-2200FD490E5F@FreeBSD.org> In-Reply-To: <9349EAA9-F92C-4170-A1C0-2200FD490E5F@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Pedro Giffuni , src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 22:52:36 -0000 On 06.05.2014 2:12, David Chisnall wrote: > On 5 May 2014, at 22:51, Andrey Chernov wrote: > >> For standard malloc/realloc interface it is up to the caller to check >> n*size not overflows. You must trust caller already does such check. > > Do a search of the CVE database sometime to see how well placed that trust generally is. Or even look at the code in question, where none of the realloc() or malloc() calls does overflow checking. I know current situation and disagree with OpenBSD way to fix it. Public interface assumes that caller should be trusted. Period. How well it is really trusted is up to the caller and should be fixed in it clearly, allowing human to trace the logic. >> Using calloc() to enforce it instead of caller is semantically wrong, > > Relying on a standard function to behave according to the standard is semantically wrong? Yes. Generally it is using a function outside of its purpose. I.e. you can use calloc() just to check n*size and nothing else (free() result immediately afterwards) instead of writing just single check by yourself. It will be legal usage but semantically wrong and misleading. >> and especially strange when the caller is standard C library under your >> control. > > I don't follow this. If libc can't rely on standards conformance from itself then other code stands no chance. Libc here is the caller which is well under control because of the same codebase. It means that n*size check can be easily added before malloc call instead of using side effects with hidden logic. As I mention initially, literal enough checks is what we need to make logic clear. In the case we discuss realloc() can be changed by reallocf() which does n*size and NULL checks and literal "if" should be added before malloc() to check overflow. -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Mon May 5 22:59:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A945BDA7 for ; Mon, 5 May 2014 22:59:14 +0000 (UTC) Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74994EAE for ; Mon, 5 May 2014 22:59:14 +0000 (UTC) Received: by mail-pd0-f178.google.com with SMTP id r10so4828275pdi.9 for ; Mon, 05 May 2014 15:59:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=j3+niS88DzaJcqJ97FcWhesEAOpY/nDr68oRtu+lF9U=; b=l/nXvxpLHffYOtK0XapAFg0RXrl9bjCEQ0OLBdFwxwBA6+0mV0V9rr6B4dj60H+MLX imsHzqdrEwqxyXOYFvm3KvAroj2TQws/PShhI6NyeJtF5CAJ9SNyHdPGZObMyV54XL0U oDs7IWMPj7WSR6UUl519a3JsjJNjdBA0ygkaAQxoCKD5S9BaznmnuMYUMPVLjF7nqSsV bKLxnwRgPCQ3Oi1r3eLSkwV5LB8rHX3RjCn5AMn5wUmlDm5iBA2ukZiCJcHJ3ZhaJFWL m4h1LHsXqjxl+b5OZXieWbvmLg0YkVgXEyK61uR9SPd8325ASls6UsBvhjHSwa11ykHW PYhQ== X-Gm-Message-State: ALoCoQnTEV/FQCfW0+np5/MFh6Yxb4nm7QiQFzp4aZH11O87ieXu1wa6zTGcciztTdXuyOGJTq0n X-Received: by 10.66.197.135 with SMTP id iu7mr76221575pac.149.1399330747906; Mon, 05 May 2014 15:59:07 -0700 (PDT) Received: from [10.64.26.239] (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id g6sm81526059pat.2.2014.05.05.15.59.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 15:59:06 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_500DE851-7984-4064-8FC1-CACBF83B04B3"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265367 - head/lib/libc/regex From: Warner Losh In-Reply-To: Date: Mon, 5 May 2014 16:59:03 -0600 Message-Id: References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> <5367EB54.1080109@FreeBSD.org> <3C7CFFB7-5C84-4AC1-9A81-C718D184E87B@FreeBSD.org> <7D7A417E-17C3-4001-8E79-0B57636A70E1@gmail.com> To: David Chisnall X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Pedro Giffuni , Andrey Chernov , src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 22:59:14 -0000 --Apple-Mail=_500DE851-7984-4064-8FC1-CACBF83B04B3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On May 5, 2014, at 3:43 PM, David Chisnall wrote: > On 5 May 2014, at 22:33, Warner Losh wrote: >=20 >> reallocf(): >> The reallocf() function is identical to the realloc() function, = except >> that it will free the passed pointer when the requested memory = cannot be >> allocated. This is a FreeBSD specific API designed to ease the = problems >> with traditional coding styles for realloc() causing memory leaks = in >> libraries. >> ... >> The reallocf() function first appeared in FreeBSD 3.0. >=20 > While reallocf() is nice, it doesn't address the problem of overflow. = It takes a single size, forcing the caller to do the number-of-elements = * element-size multiplication, which is the problematic one. If an = attacker can control the number of elements, then it's possible to make = the multiplication overflow so reallocf() will return a valid pointer to = an area of memory that is much smaller than the caller was expecting. =20= Stupid is as stupid does. malloc and realloc both have this same issue. = While an interesting theoretical attack, the size doesn=92t necessarily = come from multiplication. Careful coding is still required, not matter = what spin you put on this. reallocf() solves the memory leak issue, but = not the problem with overflow (which the realloc() interface has too). = The caller can check to make sure they aren=92t requesting too much = memory and overflowing. The interface isn=92t designed to solve the = problem you are complaining about. There=92s only so much you can do to prevent programming errors. = calloc() isn=92t going to solve the world=92s problems for you, and = introduces a non-trivial amount of overhead for the trivial amount of = overhead that is =93saved=94 by moving the overflow check from the = caller to the callee... Warner --Apple-Mail=_500DE851-7984-4064-8FC1-CACBF83B04B3 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTaBe3AAoJEGwc0Sh9sBEARgsQANEtHGWk/H7xDYulO1C8k3de 7gp7Ru73TaE4v9ntXgwnFMwhN0iJ1UPoLNM6CaXpqN2QH6+a21z3xdi+U91d7PON HmQiB4PUIa/NLrGWJlLx5rS0BfKrG5OiA0ezxudptGTNM3fqBbJPGPX95NIfQ2vO Zf+OqgYhSH4aC3xJNQv0D8fjZlKOTbnLsOUdOy0j/KgYZbuBhwusFB3B7xtMwpJf e3UeoA1kiKkO4NlXxft1tSBShJD2Ah0RV7oQswtb78JTDyxON/vHKTAoOF8Adx3B MCyQJ9OxmmQdS9DsUWXIRIpmNdJ5Iz0p+9z3ywAZLEGjZ5Y/hG3E3NIKb+FiOOEx t51GWLkFMKmBcrSvGYD84gw28yeVaaMJNJQ7yMYUIAP4IE3sFQl+urL9ttj9dPow O95W124c9I5OQwPHEVD78eapterGNKIEN5I7NZDfiLt7bisKU4N0xFEy3A+NV36w FVIrOX3q2hAWITrGKogQjk6i63mRdhlTdy9e9cChJQ+zgf2B9xgT9jeNpipdhuXe F5j/deRhaqlMHBX/PyioaymryGRm6zqjYGIFBp+w7UB7pNT7mTIMUS1LJBAVlko0 DUtLIVPr6z1TqTag5pgu6fQxTpNuW1Q5SfgPDS/lsbvqel8YWcDJU+3QeL+lPX7A nGdSYtoddOy98ZoWsP7O =yL9a -----END PGP SIGNATURE----- --Apple-Mail=_500DE851-7984-4064-8FC1-CACBF83B04B3-- From owner-svn-src-head@FreeBSD.ORG Mon May 5 23:01:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A27CAEB4; Mon, 5 May 2014 23:01:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 907A9EC1; Mon, 5 May 2014 23:01:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45N118v019360; Mon, 5 May 2014 23:01:01 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45N11hd019359; Mon, 5 May 2014 23:01:01 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405052301.s45N11hd019359@svn.freebsd.org> From: Glen Barber Date: Mon, 5 May 2014 23:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265405 - head/release/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 23:01:01 -0000 Author: gjb Date: Mon May 5 23:01:01 2014 New Revision: 265405 URL: http://svnweb.freebsd.org/changeset/base/265405 Log: Add a helper script for parsing 'svn log' for the 'Relnotes:' tag in case 'yes' is not explicitly the first string value following the tab. As it turns out, a number of commits have bypassed my filters (both email and 'svn log --search'), and this script returns the results I want when doing these searches. Sponsored by: The FreeBSD Foundation Added: head/release/scripts/relnotes-search.sh (contents, props changed) Added: head/release/scripts/relnotes-search.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/scripts/relnotes-search.sh Mon May 5 23:01:01 2014 (r265405) @@ -0,0 +1,133 @@ +#!/bin/sh +#- +# Copyright (c) 2014 The FreeBSD Foundation +# All rights reserved. +# +# This software were developed by Glen Barber +# under sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +set -C + +PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin" +export PATH + +usage() { + echo "Usage:" + echo -n "$(basename ${0}) [-rNNNNNN]" + echo " [-l /path/for/output] /path/to/branch" + echo " -r: The oldest commit to include in the search" + echo "" + exit 1 +} + +main() { + while getopts "l:r:" arg ; do + case ${arg} in + l) + # Disallow '-rNNNNNN' argument for oldest + # revision # from becoming the log file + # accidentally. + where="${OPTARG##-r*}" + [ -z "${where}" ] && usage + if [ -e "${where}" ]; then + echo "Log file already exists:" + echo " (${where})" + exit 2 + fi + ;; + r) + rev="${OPTARG##-r}" + c=$(echo -n ${rev} | tr -d '0-9' | wc -c) + if [ ${c} -ne 0 ]; then + echo "Revision number must be numeric." + exit 2 + fi + # Since the last specified revision is + # specified, mangle the variable to + # make svn syntax happy. + rev="-r${rev}:rHEAD" + ;; + *) + usage + ;; + esac + done + shift $(( ${OPTIND} - 1 )) + + # This assumes a local working copy, which svn search + # allows exactly one repository path (although the root + # can still be the path). + [ "$#" -ne 1 ] && usage + + # If no log file, write to stdout. + [ -z "${where}" ] && where=/dev/stdout + + svn= + # Where is svn? + for s in /usr/bin /usr/local/bin; do + if [ -x ${s}/svn ]; then + svn=${s}/svn + break + fi + if [ -x ${s}/svnlite ]; then + svn=${s}/svnlite + break + fi + done + # Did we find svn? + if [ -z "${svn}" ]; then + echo "svn(1) binary not found." + exit 2 + fi + # Is more than one path specified? (This should never + # be triggered, because the argument count is checked + # above, but better safe than sorry.) + if [ $# -gt 1 ]; then + echo "Cannot specify more than one working path." + exit 2 + fi + # Does the directory exist? + if [ ! -d "${1}" ]; then + echo "Specified path (${1}) is not a directory." + exit 2 + fi + # Is it a subversion repository checkout? + ${svn} info ${1} >/dev/null 2>&1 + if [ "$?" -ne 0 ]; then + echo "Cannot determine svn repository information for ${1}" + exit 2 + fi + + # All tests passed. Let's see what can possibly go wrong + # from here. The search string specified should match this + # in PCRE speak: ':[\t ]*' + ${svn} log ${rev} --search 'Relnotes:?[^ ]*' ${1} > ${where} + return $? +} + +main "${@}" +exit $? From owner-svn-src-head@FreeBSD.ORG Mon May 5 23:08:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DB76132 for ; Mon, 5 May 2014 23:08:36 +0000 (UTC) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com [209.85.215.50]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F0A9F69 for ; Mon, 5 May 2014 23:08:35 +0000 (UTC) Received: by mail-la0-f50.google.com with SMTP id mc6so1284054lab.23 for ; Mon, 05 May 2014 16:08:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=0R6EA6/kME4R+NcEytuwuEg3deeTnZVqamCv+Z+2qHQ=; b=VYg+s4LGGTd8J7uIb5oS9795zDkQTncDlr0SCjK6mP/ZWZ237pIR4PzGNvbY8v90vd WLfU+vadrsgBv+U8JG5ol0gEYifmRnYAREqkRwPQ8EMXNDafTkh74UAyIRoJmxob3TS+ IdW+dmIoNxjSDYqv2f/SE17ZsBdH/K1b0okaDCL3VpvUIVQa0aVo4afrdWoFHAARuuWB YlzvRlZ4LbIDc/bRwbd1RxG85QJmiJQt4s14c1Cld5URGKp+j1W1TOZs+N2iul4lhnPu mR1yrsPt+d1REtI1hu+fTyaAqK0PIl0UOJW02oBW5RJojHT9vfTTbGeIN+1aq51/k4TD FE1g== X-Gm-Message-State: ALoCoQkoBb3hsrBMGFTZUwdUb1Vj0Lp60rYulH2mzrf1gymJVK0t5YaZ4HjmQhwfAY9ruC5cXItY X-Received: by 10.112.168.170 with SMTP id zx10mr3959861lbb.35.1399331313652; Mon, 05 May 2014 16:08:33 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id z10sm11100823lbu.1.2014.05.05.16.08.32 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 16:08:33 -0700 (PDT) Message-ID: <536819F0.1090507@freebsd.org> Date: Tue, 06 May 2014 03:08:32 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: David Chisnall Subject: Re: svn commit: r265367 - head/lib/libc/regex References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> <5367EB54.1080109@FreeBSD.org> <3C7CFFB7-5C84-4AC1-9A81-C718D184E87B@FreeBSD.org> <7D7A417E-17C3-4001-8E79-0B57636A70E1@gmail.com> <536807D8.9000005@freebsd.org> <9349EAA9-F92C-4170-A1C0-2200FD490E5F@FreeBSD.org> <5368162A.9000002@freebsd.org> In-Reply-To: <5368162A.9000002@freebsd.org> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Pedro Giffuni , src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 23:08:36 -0000 On 06.05.2014 2:52, Andrey Chernov wrote: > As I mention initially, literal enough checks is what we need to make > logic clear. In the case we discuss realloc() can be changed by > reallocf() which does n*size and NULL checks and literal "if" should be > added before malloc() to check overflow. Sorry crumpled phrase. Literal "if" for overflow checking should be added before both malloc() and reallocf(). Other ways will make the code obscure for human and hard to support. -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Mon May 5 23:15:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96C33325 for ; Mon, 5 May 2014 23:15:46 +0000 (UTC) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 151DC79 for ; Mon, 5 May 2014 23:15:45 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id p9so1485079lbv.21 for ; Mon, 05 May 2014 16:15:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=X6hT0e2HaTVu+txpBELzsMKsP4f5BgcHhauttU8oeHg=; b=cFGrdeEWXNANjNz+C/TpD4ZH40u6JPik/wEYORMaUpb7lja1gprH6iIy/fH2aNyCz+ 9aMVVV8pjYxIgfEEsHsqA1DCrlcMzhBxFPbPHOj57I0ZuoNwiPiYWO87ZFvfg+hj3LE4 TkT3MuJtYwdpEvK6oFgUj9pZv+j36RyJ3KqkLt1Z55gsUe+yIONv5M6rEGTCks1ijNTA xZuFMmRYcnTZTKWpOt7edivdddbL+iouK0/hBXJKo1nLf+s7PM8Rt0A++H6zGzew3A0D Qho5cRV2UuK7fg/uncVYMlcflAsLZwtZcwGxr/4zYT8gwrMu0LSxr6jscb91cnL2VvgW BdPQ== X-Gm-Message-State: ALoCoQlnVV3Ns+/mrfu4WCcpDZnCpy96iNoZfszJSnhHC9dmATjD7yxDecMuS3DBsLradlrA5RvU X-Received: by 10.112.12.103 with SMTP id x7mr3985345lbb.36.1399331743825; Mon, 05 May 2014 16:15:43 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id c6sm9598706laa.16.2014.05.05.16.15.42 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 16:15:42 -0700 (PDT) Message-ID: <53681B94.103@freebsd.org> Date: Tue, 06 May 2014 03:15:32 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Warner Losh , David Chisnall Subject: Re: svn commit: r265367 - head/lib/libc/regex References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> <5367EB54.1080109@FreeBSD.org> <3C7CFFB7-5C84-4AC1-9A81-C718D184E87B@FreeBSD.org> <7D7A417E-17C3-4001-8E79-0B57636A70E1@gmail.com> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QMWMFIo3uWxGbgQmFRojTiauNNW53EpuS" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Pedro Giffuni , src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 23:15:46 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --QMWMFIo3uWxGbgQmFRojTiauNNW53EpuS Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06.05.2014 2:59, Warner Losh wrote: > Stupid is as stupid does. malloc and realloc both have this same issue.= While an interesting theoretical attack, the size doesn=E2=80=99t necess= arily come from multiplication. Careful coding is still required, not mat= ter what spin you put on this. reallocf() solves the memory leak issue, b= ut not the problem with overflow (which the realloc() interface has too).= The caller can check to make sure they aren=E2=80=99t requesting too muc= h memory and overflowing. The interface isn=E2=80=99t designed to solve t= he problem you are complaining about. >=20 > There=E2=80=99s only so much you can do to prevent programming errors. = calloc() isn=E2=80=99t going to solve the world=E2=80=99s problems for yo= u, and introduces a non-trivial amount of overhead for the trivial amount= of overhead that is =E2=80=9Csaved=E2=80=9D by moving the overflow check= from the caller to the callee... I agree completely. --=20 http://ache.vniz.net/ --QMWMFIo3uWxGbgQmFRojTiauNNW53EpuS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlNoG54ACgkQVg5YK5ZEdN1NLQCgusr3bvds8O+SZFi9e3fwUEeB li0An2KrVfKXGSc4J/lIJWuraM4R0daW =RGRk -----END PGP SIGNATURE----- --QMWMFIo3uWxGbgQmFRojTiauNNW53EpuS-- From owner-svn-src-head@FreeBSD.ORG Mon May 5 23:36:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A92EA56B; Mon, 5 May 2014 23:36:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9761F1E9; Mon, 5 May 2014 23:36:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45Nak5k034699; Mon, 5 May 2014 23:36:46 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45Nakod034698; Mon, 5 May 2014 23:36:46 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405052336.s45Nakod034698@svn.freebsd.org> From: Glen Barber Date: Mon, 5 May 2014 23:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265406 - head/release/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 23:36:46 -0000 Author: gjb Date: Mon May 5 23:36:46 2014 New Revision: 265406 URL: http://svnweb.freebsd.org/changeset/base/265406 Log: Use 'return' instead of 'exit' in main(), since the script exits with the last returned exit code. Sponsored by: The FreeBSD Foundation Modified: head/release/scripts/relnotes-search.sh Modified: head/release/scripts/relnotes-search.sh ============================================================================== --- head/release/scripts/relnotes-search.sh Mon May 5 23:01:01 2014 (r265405) +++ head/release/scripts/relnotes-search.sh Mon May 5 23:36:46 2014 (r265406) @@ -56,7 +56,7 @@ main() { if [ -e "${where}" ]; then echo "Log file already exists:" echo " (${where})" - exit 2 + return 2 fi ;; r) @@ -64,7 +64,7 @@ main() { c=$(echo -n ${rev} | tr -d '0-9' | wc -c) if [ ${c} -ne 0 ]; then echo "Revision number must be numeric." - exit 2 + return 2 fi # Since the last specified revision is # specified, mangle the variable to @@ -101,25 +101,25 @@ main() { # Did we find svn? if [ -z "${svn}" ]; then echo "svn(1) binary not found." - exit 2 + return 2 fi # Is more than one path specified? (This should never # be triggered, because the argument count is checked # above, but better safe than sorry.) if [ $# -gt 1 ]; then echo "Cannot specify more than one working path." - exit 2 + return 2 fi # Does the directory exist? if [ ! -d "${1}" ]; then echo "Specified path (${1}) is not a directory." - exit 2 + return 2 fi # Is it a subversion repository checkout? ${svn} info ${1} >/dev/null 2>&1 if [ "$?" -ne 0 ]; then echo "Cannot determine svn repository information for ${1}" - exit 2 + return 2 fi # All tests passed. Let's see what can possibly go wrong From owner-svn-src-head@FreeBSD.ORG Mon May 5 23:54:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DB71787; Mon, 5 May 2014 23:54:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF509315; Mon, 5 May 2014 23:54:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s45NsDPT043226; Mon, 5 May 2014 23:54:13 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s45NsDOT043225; Mon, 5 May 2014 23:54:13 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405052354.s45NsDOT043225@svn.freebsd.org> From: Neel Natu Date: Mon, 5 May 2014 23:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265407 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2014 23:54:14 -0000 Author: neel Date: Mon May 5 23:54:13 2014 New Revision: 265407 URL: http://svnweb.freebsd.org/changeset/base/265407 Log: Disable the 'uart_drain()' callback when the emulated receive FIFO is full. Failing to do this will cause the kevent(2) notification to trigger continuously and the bhyve(8) mevent thread will hog the cpu until the characters on the backend tty device are drained. Also, make the uart backend file descriptor non-blocking to avoid a select(2) before every byte read from that backend. Reviewed by: grehan Modified: head/usr.sbin/bhyve/uart_emul.c Modified: head/usr.sbin/bhyve/uart_emul.c ============================================================================== --- head/usr.sbin/bhyve/uart_emul.c Mon May 5 23:36:46 2014 (r265406) +++ head/usr.sbin/bhyve/uart_emul.c Mon May 5 23:54:13 2014 (r265407) @@ -110,6 +110,7 @@ struct uart_softc { uint8_t dlh; /* Baudrate divisor latch MSB */ struct fifo rxfifo; + struct mevent *mev; struct ttyfd tty; bool thre_int_pending; /* THRE interrupt pending */ @@ -145,34 +146,15 @@ ttyopen(struct ttyfd *tf) } } -static bool -tty_char_available(struct ttyfd *tf) -{ - fd_set rfds; - struct timeval tv; - - FD_ZERO(&rfds); - FD_SET(tf->fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - if (select(tf->fd + 1, &rfds, NULL, NULL, &tv) > 0 ) { - return (true); - } else { - return (false); - } -} - static int ttyread(struct ttyfd *tf) { - char rb; + unsigned char rb; - if (tty_char_available(tf)) { - read(tf->fd, &rb, 1); - return (rb & 0xff); - } else { + if (read(tf->fd, &rb, 1) == 1) + return (rb); + else return (-1); - } } static void @@ -183,62 +165,111 @@ ttywrite(struct ttyfd *tf, unsigned char } static void -fifo_reset(struct fifo *fifo, int size) +rxfifo_reset(struct uart_softc *sc, int size) { + char flushbuf[32]; + struct fifo *fifo; + ssize_t nread; + int error; + fifo = &sc->rxfifo; bzero(fifo, sizeof(struct fifo)); fifo->size = size; + + if (sc->tty.opened) { + /* + * Flush any unread input from the tty buffer. + */ + while (1) { + nread = read(sc->tty.fd, flushbuf, sizeof(flushbuf)); + if (nread != sizeof(flushbuf)) + break; + } + + /* + * Enable mevent to trigger when new characters are available + * on the tty fd. + */ + error = mevent_enable(sc->mev); + assert(error == 0); + } +} + +static int +rxfifo_available(struct uart_softc *sc) +{ + struct fifo *fifo; + + fifo = &sc->rxfifo; + return (fifo->num < fifo->size); } static int -fifo_putchar(struct fifo *fifo, uint8_t ch) +rxfifo_putchar(struct uart_softc *sc, uint8_t ch) { + struct fifo *fifo; + int error; + + fifo = &sc->rxfifo; if (fifo->num < fifo->size) { fifo->buf[fifo->windex] = ch; fifo->windex = (fifo->windex + 1) % fifo->size; fifo->num++; + if (!rxfifo_available(sc)) { + if (sc->tty.opened) { + /* + * Disable mevent callback if the FIFO is full. + */ + error = mevent_disable(sc->mev); + assert(error == 0); + } + } return (0); } else return (-1); } static int -fifo_getchar(struct fifo *fifo) +rxfifo_getchar(struct uart_softc *sc) { - int c; + struct fifo *fifo; + int c, error, wasfull; + wasfull = 0; + fifo = &sc->rxfifo; if (fifo->num > 0) { + if (!rxfifo_available(sc)) + wasfull = 1; c = fifo->buf[fifo->rindex]; fifo->rindex = (fifo->rindex + 1) % fifo->size; fifo->num--; + if (wasfull) { + if (sc->tty.opened) { + error = mevent_enable(sc->mev); + assert(error == 0); + } + } return (c); } else return (-1); } static int -fifo_numchars(struct fifo *fifo) +rxfifo_numchars(struct uart_softc *sc) { + struct fifo *fifo = &sc->rxfifo; return (fifo->num); } -static int -fifo_available(struct fifo *fifo) -{ - - return (fifo->num < fifo->size); -} - static void uart_opentty(struct uart_softc *sc) { - struct mevent *mev; ttyopen(&sc->tty); - mev = mevent_add(sc->tty.fd, EVF_READ, uart_drain, sc); - assert(mev); + sc->mev = mevent_add(sc->tty.fd, EVF_READ, uart_drain, sc); + assert(sc->mev != NULL); } /* @@ -255,7 +286,7 @@ uart_intr_reason(struct uart_softc *sc) if ((sc->lsr & LSR_OE) != 0 && (sc->ier & IER_ERLS) != 0) return (IIR_RLS); - else if (fifo_numchars(&sc->rxfifo) > 0 && (sc->ier & IER_ERXRDY) != 0) + else if (rxfifo_numchars(sc) > 0 && (sc->ier & IER_ERXRDY) != 0) return (IIR_RXTOUT); else if (sc->thre_int_pending && (sc->ier & IER_ETXRDY) != 0) return (IIR_TXRDY); @@ -274,7 +305,7 @@ uart_reset(struct uart_softc *sc) sc->dll = divisor; sc->dlh = divisor >> 16; - fifo_reset(&sc->rxfifo, 1); /* no fifo until enabled by software */ + rxfifo_reset(sc, 1); /* no fifo until enabled by software */ } /* @@ -315,9 +346,9 @@ uart_drain(int fd, enum ev_type ev, void if ((sc->mcr & MCR_LOOPBACK) != 0) { (void) ttyread(&sc->tty); } else { - while (fifo_available(&sc->rxfifo) && + while (rxfifo_available(sc) && ((ch = ttyread(&sc->tty)) != -1)) { - fifo_putchar(&sc->rxfifo, ch); + rxfifo_putchar(sc, ch); } uart_toggle_intr(sc); } @@ -351,7 +382,7 @@ uart_write(struct uart_softc *sc, int of switch (offset) { case REG_DATA: if (sc->mcr & MCR_LOOPBACK) { - if (fifo_putchar(&sc->rxfifo, value) != 0) + if (rxfifo_putchar(sc, value) != 0) sc->lsr |= LSR_OE; } else if (sc->tty.opened) { ttywrite(&sc->tty, value); @@ -372,7 +403,7 @@ uart_write(struct uart_softc *sc, int of */ if ((sc->fcr & FCR_ENABLE) ^ (value & FCR_ENABLE)) { fifosz = (value & FCR_ENABLE) ? FIFOSZ : 1; - fifo_reset(&sc->rxfifo, fifosz); + rxfifo_reset(sc, fifosz); } /* @@ -383,7 +414,7 @@ uart_write(struct uart_softc *sc, int of sc->fcr = 0; } else { if ((value & FCR_RCV_RST) != 0) - fifo_reset(&sc->rxfifo, FIFOSZ); + rxfifo_reset(sc, FIFOSZ); sc->fcr = value & (FCR_ENABLE | FCR_DMA | FCR_RX_MASK); @@ -480,7 +511,7 @@ uart_read(struct uart_softc *sc, int off switch (offset) { case REG_DATA: - reg = fifo_getchar(&sc->rxfifo); + reg = rxfifo_getchar(sc); break; case REG_IER: reg = sc->ier; @@ -511,7 +542,7 @@ uart_read(struct uart_softc *sc, int off sc->lsr |= LSR_TEMT | LSR_THRE; /* Check for new receive data */ - if (fifo_numchars(&sc->rxfifo) > 0) + if (rxfifo_numchars(sc) > 0) sc->lsr |= LSR_RXRDY; else sc->lsr &= ~LSR_RXRDY; @@ -615,6 +646,10 @@ uart_set_backend(struct uart_softc *sc, retval = 0; } + /* Make the backend file descriptor non-blocking */ + if (retval == 0) + retval = fcntl(sc->tty.fd, F_SETFL, O_NONBLOCK); + if (retval == 0) uart_opentty(sc); From owner-svn-src-head@FreeBSD.ORG Tue May 6 00:00:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 499A396C; Tue, 6 May 2014 00:00:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C083355; Tue, 6 May 2014 00:00:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46008cR044389; Tue, 6 May 2014 00:00:08 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46007s6044383; Tue, 6 May 2014 00:00:07 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201405060000.s46007s6044383@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 6 May 2014 00:00:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265408 - in head: sys/netinet usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 00:00:08 -0000 Author: glebius Date: Tue May 6 00:00:07 2014 New Revision: 265408 URL: http://svnweb.freebsd.org/changeset/base/265408 Log: - Remove net.inet.tcp.reass.overflows sysctl. It counts exactly same events that tcpstat's tcps_rcvmemdrop counter counts. - Rename tcps_rcvmemdrop to tcps_rcvreassfull and improve its description in netstat(1) output. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/netinet/tcp_reass.c head/sys/netinet/tcp_var.h head/usr.bin/netstat/inet.c Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Mon May 5 23:54:13 2014 (r265407) +++ head/sys/netinet/tcp_reass.c Tue May 6 00:00:07 2014 (r265408) @@ -72,16 +72,6 @@ __FBSDID("$FreeBSD$"); #include #include -static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0, - "TCP Segment Reassembly Queue"); - -static VNET_DEFINE(int, tcp_reass_overflows) = 0; -#define V_tcp_reass_overflows VNET(tcp_reass_overflows) -SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, overflows, - CTLTYPE_INT | CTLFLAG_RD, - &VNET_NAME(tcp_reass_overflows), 0, - "Global number of TCP Segment Reassembly Queue Overflows"); - void tcp_reass_flush(struct tcpcb *tp) { @@ -142,8 +132,7 @@ tcp_reass(struct tcpcb *tp, struct tcphd tp->t_segqlen + m->m_pkthdr.len >= sbspace(&so->so_rcv)) { char *s; - V_tcp_reass_overflows++; - TCPSTAT_INC(tcps_rcvmemdrop); + TCPSTAT_INC(tcps_rcvreassfull); *tlenp = 0; if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) { Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Mon May 5 23:54:13 2014 (r265407) +++ head/sys/netinet/tcp_var.h Tue May 6 00:00:07 2014 (r265408) @@ -426,7 +426,7 @@ struct tcpstat { uint64_t tcps_rcvbyte; /* bytes received in sequence */ uint64_t tcps_rcvbadsum; /* packets received with ccksum errs */ uint64_t tcps_rcvbadoff; /* packets received with bad offset */ - uint64_t tcps_rcvmemdrop; /* packets dropped for lack of memory */ + uint64_t tcps_rcvreassfull; /* packets dropped for no reass space */ uint64_t tcps_rcvshort; /* packets received too short */ uint64_t tcps_rcvduppack; /* duplicate-only packets received */ uint64_t tcps_rcvdupbyte; /* duplicate-only bytes received */ Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Mon May 5 23:54:13 2014 (r265407) +++ head/usr.bin/netstat/inet.c Tue May 6 00:00:07 2014 (r265408) @@ -660,7 +660,8 @@ tcp_stats(u_long off, const char *name, p(tcps_rcvbadsum, "\t\t%ju discarded for bad checksum%s\n"); p(tcps_rcvbadoff, "\t\t%ju discarded for bad header offset field%s\n"); p1a(tcps_rcvshort, "\t\t%ju discarded because packet too short\n"); - p1a(tcps_rcvmemdrop, "\t\t%ju discarded due to memory problems\n"); + p1a(tcps_rcvreassfull, + "\t\t%ju discarded due to no space in reassembly queue\n"); p(tcps_connattempt, "\t%ju connection request%s\n"); p(tcps_accepts, "\t%ju connection accept%s\n"); p(tcps_badsyn, "\t%ju bad connection attempt%s\n"); From owner-svn-src-head@FreeBSD.ORG Tue May 6 00:08:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2158BB49; Tue, 6 May 2014 00:08:56 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask.apl.washington.edu", Issuer "troutmask.apl.washington.edu" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D98DE405; Tue, 6 May 2014 00:08:55 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.8/8.14.8) with ESMTP id s4600RB6021086 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 5 May 2014 17:00:27 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.8/8.14.8/Submit) id s4600ROX021085; Mon, 5 May 2014 17:00:27 -0700 (PDT) (envelope-from sgk) Date: Mon, 5 May 2014 17:00:27 -0700 From: Steve Kargl To: Aleksandr Rybalko Subject: Re: svn commit: r265391 - head/sys/dev/vt Message-ID: <20140506000027.GA21010@troutmask.apl.washington.edu> References: <201405052129.s45LTv38079480@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201405052129.s45LTv38079480@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 00:08:56 -0000 On Mon, May 05, 2014 at 09:29:57PM +0000, Aleksandr Rybalko wrote: > Author: ray > Date: Mon May 5 21:29:56 2014 > New Revision: 265391 > URL: http://svnweb.freebsd.org/changeset/base/265391 > > Log: > Define a new method for probing vt(4) driver before attach it at early stage. > Can you please commit a vt.4 manual page or stop referring to vt(4) in your commit messages? -- Steve From owner-svn-src-head@FreeBSD.ORG Tue May 6 01:15:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 281B01F9; Tue, 6 May 2014 01:15:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A10BB0D; Tue, 6 May 2014 01:15:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s461Fgot080703; Tue, 6 May 2014 01:15:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s461Fgm6080700; Tue, 6 May 2014 01:15:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405060115.s461Fgm6080700@svn.freebsd.org> From: Adrian Chadd Date: Tue, 6 May 2014 01:15:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265409 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 01:15:43 -0000 Author: adrian Date: Tue May 6 01:15:42 2014 New Revision: 265409 URL: http://svnweb.freebsd.org/changeset/base/265409 Log: Modify the RX path to keep the previous RX descriptor around once it's used. It turns out that the RX DMA engine does the same last-descriptor-link- pointer-re-reading trick that the TX DMA engine. That is, the hardware re-reads the link pointer before it moves onto the next descriptor. Thus we can't free a descriptor before we move on; it's possible the hardware will need to re-read the link pointer before we overwrite it with a new one. Tested: * AR5416, STA mode TODO: * more thorough AP and STA mode testing! * test on other pre-AR9380 NICs, just to be sure. * Break out the RX descriptor grabbing bits from the RX completion bits, like what is done in the RX EDMA code, so .. * .. the RX lock can be held during ath_rx_proc(), but not across packet input. Modified: head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Tue May 6 00:00:07 2014 (r265408) +++ head/sys/dev/ath/if_ath_rx.c Tue May 6 01:15:42 2014 (r265409) @@ -245,6 +245,8 @@ ath_legacy_rxbuf_init(struct ath_softc * struct mbuf *m; struct ath_desc *ds; + /* XXX TODO: ATH_RX_LOCK_ASSERT(sc); */ + m = bf->bf_m; if (m == NULL) { /* @@ -974,6 +976,14 @@ rx_next: #define ATH_RX_MAX 128 +/* + * XXX TODO: break out the "get buffers" from "call ath_rx_pkt()" like + * the EDMA code does. + * + * XXX TODO: then, do all of the RX list management stuff inside + * ATH_RX_LOCK() so we don't end up potentially racing. The EDMA + * code is doing it right. + */ static void ath_rx_proc(struct ath_softc *sc, int resched) { @@ -995,6 +1005,7 @@ ath_rx_proc(struct ath_softc *sc, int re u_int64_t tsf; int npkts = 0; int kickpcu = 0; + int ret; /* XXX we must not hold the ATH_LOCK here */ ATH_UNLOCK_ASSERT(sc); @@ -1094,8 +1105,26 @@ ath_rx_proc(struct ath_softc *sc, int re if (ath_rx_pkt(sc, rs, status, tsf, nf, HAL_RX_QUEUE_HP, bf, m)) ngood++; rx_proc_next: - TAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); - } while (ath_rxbuf_init(sc, bf) == 0); + /* + * If there's a holding buffer, insert that onto + * the RX list; the hardware is now definitely not pointing + * to it now. + */ + ret = 0; + if (sc->sc_rxedma[HAL_RX_QUEUE_HP].m_holdbf != NULL) { + TAILQ_INSERT_TAIL(&sc->sc_rxbuf, + sc->sc_rxedma[HAL_RX_QUEUE_HP].m_holdbf, + bf_list); + ret = ath_rxbuf_init(sc, + sc->sc_rxedma[HAL_RX_QUEUE_HP].m_holdbf); + } + /* + * Next, throw our buffer into the holding entry. The hardware + * may use the descriptor to read the link pointer before + * DMAing the next descriptor in to write out a packet. + */ + sc->sc_rxedma[HAL_RX_QUEUE_HP].m_holdbf = bf; + } while (ret == 0); /* rx signal state monitoring */ ath_hal_rxmonitor(ah, &sc->sc_halstats, sc->sc_curchan); @@ -1127,6 +1156,13 @@ rx_proc_next: * constantly write over the same frame, leading * the RX driver code here to get heavily confused. */ + /* + * XXX Has RX DMA stopped enough here to just call + * ath_startrecv()? + * XXX Do we need to use the holding buffer to restart + * RX DMA by appending entries to the final + * descriptor? Quite likely. + */ #if 1 ath_startrecv(sc); #else @@ -1217,6 +1253,58 @@ ath_legacy_flushrecv(struct ath_softc *s ath_rx_proc(sc, 0); } +static void +ath_legacy_flush_rxpending(struct ath_softc *sc) +{ + + /* XXX ATH_RX_LOCK_ASSERT(sc); */ + + if (sc->sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending != NULL) { + m_freem(sc->sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending); + sc->sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending = NULL; + } + if (sc->sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending != NULL) { + m_freem(sc->sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending); + sc->sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending = NULL; + } +} + +static int +ath_legacy_flush_rxholdbf(struct ath_softc *sc) +{ + struct ath_buf *bf; + + /* XXX ATH_RX_LOCK_ASSERT(sc); */ + /* + * If there are RX holding buffers, free them here and return + * them to the list. + * + * XXX should just verify that bf->bf_m is NULL, as it must + * be at this point! + */ + bf = sc->sc_rxedma[HAL_RX_QUEUE_HP].m_holdbf; + if (bf != NULL) { + if (bf->bf_m != NULL) + m_freem(bf->bf_m); + bf->bf_m = NULL; + TAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); + (void) ath_rxbuf_init(sc, bf); + } + sc->sc_rxedma[HAL_RX_QUEUE_HP].m_holdbf = NULL; + + bf = sc->sc_rxedma[HAL_RX_QUEUE_LP].m_holdbf; + if (bf != NULL) { + if (bf->bf_m != NULL) + m_freem(bf->bf_m); + bf->bf_m = NULL; + TAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); + (void) ath_rxbuf_init(sc, bf); + } + sc->sc_rxedma[HAL_RX_QUEUE_LP].m_holdbf = NULL; + + return (0); +} + /* * Disable the receive h/w in preparation for a reset. */ @@ -1228,6 +1316,8 @@ ath_legacy_stoprecv(struct ath_softc *sc ((_pa) - (_sc)->sc_rxdma.dd_desc_paddr))) struct ath_hal *ah = sc->sc_ah; + ATH_RX_LOCK(sc); + ath_hal_stoppcurecv(ah); /* disable PCU */ ath_hal_setrxfilter(ah, 0); /* clear recv filter */ ath_hal_stopdmarecv(ah); /* disable DMA engine */ @@ -1261,22 +1351,23 @@ ath_legacy_stoprecv(struct ath_softc *sc } } #endif - /* - * Free both high/low RX pending, just in case. - */ - if (sc->sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending != NULL) { - m_freem(sc->sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending); - sc->sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending = NULL; - } - if (sc->sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending != NULL) { - m_freem(sc->sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending); - sc->sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending = NULL; - } + + (void) ath_legacy_flush_rxpending(sc); + (void) ath_legacy_flush_rxholdbf(sc); + sc->sc_rxlink = NULL; /* just in case */ + + ATH_RX_UNLOCK(sc); #undef PA2DESC } /* + * XXX TODO: something was calling startrecv without calling + * stoprecv. Let's figure out what/why. It was showing up + * as a mbuf leak (rxpending) and ath_buf leak (holdbf.) + */ + +/* * Enable the receive h/w following a reset. */ static int @@ -1285,9 +1376,18 @@ ath_legacy_startrecv(struct ath_softc *s struct ath_hal *ah = sc->sc_ah; struct ath_buf *bf; + ATH_RX_LOCK(sc); + + /* + * XXX should verify these are already all NULL! + */ sc->sc_rxlink = NULL; - sc->sc_rxedma[HAL_RX_QUEUE_LP].m_rxpending = NULL; - sc->sc_rxedma[HAL_RX_QUEUE_HP].m_rxpending = NULL; + (void) ath_legacy_flush_rxpending(sc); + (void) ath_legacy_flush_rxholdbf(sc); + + /* + * Re-chain all of the buffers in the RX buffer list. + */ TAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) { int error = ath_rxbuf_init(sc, bf); if (error != 0) { @@ -1303,6 +1403,8 @@ ath_legacy_startrecv(struct ath_softc *s ath_hal_rxena(ah); /* enable recv descriptors */ ath_mode_init(sc); /* set filters, etc. */ ath_hal_startpcurecv(ah); /* re-enable PCU/DMA engine */ + + ATH_RX_UNLOCK(sc); return 0; } Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Tue May 6 00:00:07 2014 (r265408) +++ head/sys/dev/ath/if_ath_sysctl.c Tue May 6 01:15:42 2014 (r265409) @@ -413,12 +413,14 @@ ath_sysctl_txagg(SYSCTL_HANDLER_ARGS) ATH_RX_LOCK(sc); for (i = 0; i < 2; i++) { - printf("%d: fifolen: %d/%d; head=%d; tail=%d\n", + printf("%d: fifolen: %d/%d; head=%d; tail=%d; m_pending=%p, m_holdbf=%p\n", i, sc->sc_rxedma[i].m_fifo_depth, sc->sc_rxedma[i].m_fifolen, sc->sc_rxedma[i].m_fifo_head, - sc->sc_rxedma[i].m_fifo_tail); + sc->sc_rxedma[i].m_fifo_tail, + sc->sc_rxedma[i].m_rxpending, + sc->sc_rxedma[i].m_holdbf); } i = 0; TAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) { Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue May 6 00:00:07 2014 (r265408) +++ head/sys/dev/ath/if_athvar.h Tue May 6 01:15:42 2014 (r265409) @@ -510,6 +510,7 @@ struct ath_rx_edma { int m_fifo_tail; int m_fifo_depth; struct mbuf *m_rxpending; + struct ath_buf *m_holdbf; }; struct ath_tx_edma_fifo { From owner-svn-src-head@FreeBSD.ORG Tue May 6 02:32:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C91D2EBE; Tue, 6 May 2014 02:32:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B403A1BD; Tue, 6 May 2014 02:32:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s462WWIb015947; Tue, 6 May 2014 02:32:32 GMT (envelope-from davidcs@svn.freebsd.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s462WRtH015916; Tue, 6 May 2014 02:32:27 GMT (envelope-from davidcs@svn.freebsd.org) Message-Id: <201405060232.s462WRtH015916@svn.freebsd.org> From: David C Somayajulu Date: Tue, 6 May 2014 02:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265411 - in head/sys: dev/bxe modules/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 02:32:32 -0000 Author: davidcs Date: Tue May 6 02:32:27 2014 New Revision: 265411 URL: http://svnweb.freebsd.org/changeset/base/265411 Log: Modify Copyright information to reflect Qlogic Corporation's purchase of Broadcom's NetXtreme business Submitted by:David C Somayajulu (davidcs@freebsd.org) QLogic Corporation MFC after:5 days Modified: head/sys/dev/bxe/57710_init_values.c head/sys/dev/bxe/57710_int_offsets.h head/sys/dev/bxe/57711_init_values.c head/sys/dev/bxe/57711_int_offsets.h head/sys/dev/bxe/57712_init_values.c head/sys/dev/bxe/57712_int_offsets.h head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_dcb.h head/sys/dev/bxe/bxe_debug.c head/sys/dev/bxe/bxe_elink.c head/sys/dev/bxe/bxe_elink.h head/sys/dev/bxe/bxe_stats.c head/sys/dev/bxe/bxe_stats.h head/sys/dev/bxe/ecore_fw_defs.h head/sys/dev/bxe/ecore_hsi.h head/sys/dev/bxe/ecore_init.h head/sys/dev/bxe/ecore_init_ops.h head/sys/dev/bxe/ecore_mfw_req.h head/sys/dev/bxe/ecore_reg.h head/sys/dev/bxe/ecore_sp.c head/sys/dev/bxe/ecore_sp.h head/sys/modules/bxe/Makefile Modified: head/sys/dev/bxe/57710_init_values.c ============================================================================== --- head/sys/dev/bxe/57710_init_values.c Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/57710_init_values.c Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/57710_int_offsets.h ============================================================================== --- head/sys/dev/bxe/57710_int_offsets.h Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/57710_int_offsets.h Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/57711_init_values.c ============================================================================== --- head/sys/dev/bxe/57711_init_values.c Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/57711_init_values.c Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/57711_int_offsets.h ============================================================================== --- head/sys/dev/bxe/57711_int_offsets.h Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/57711_int_offsets.h Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/57712_init_values.c ============================================================================== --- head/sys/dev/bxe/57712_init_values.c Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/57712_init_values.c Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/57712_int_offsets.h ============================================================================== --- head/sys/dev/bxe/57712_int_offsets.h Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/57712_int_offsets.h Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/bxe.c Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/bxe.h ============================================================================== --- head/sys/dev/bxe/bxe.h Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/bxe.h Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/bxe_dcb.h ============================================================================== --- head/sys/dev/bxe/bxe_dcb.h Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/bxe_dcb.h Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/bxe_debug.c ============================================================================== --- head/sys/dev/bxe/bxe_debug.c Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/bxe_debug.c Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/bxe_elink.c ============================================================================== --- head/sys/dev/bxe/bxe_elink.c Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/bxe_elink.c Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/bxe_elink.h ============================================================================== --- head/sys/dev/bxe/bxe_elink.h Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/bxe_elink.h Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/bxe_stats.c ============================================================================== --- head/sys/dev/bxe/bxe_stats.c Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/bxe_stats.c Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/bxe_stats.h ============================================================================== --- head/sys/dev/bxe/bxe_stats.h Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/bxe_stats.h Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/ecore_fw_defs.h ============================================================================== --- head/sys/dev/bxe/ecore_fw_defs.h Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/ecore_fw_defs.h Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/ecore_hsi.h ============================================================================== --- head/sys/dev/bxe/ecore_hsi.h Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/ecore_hsi.h Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/ecore_init.h ============================================================================== --- head/sys/dev/bxe/ecore_init.h Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/ecore_init.h Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/ecore_init_ops.h ============================================================================== --- head/sys/dev/bxe/ecore_init_ops.h Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/ecore_init_ops.h Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/ecore_mfw_req.h ============================================================================== --- head/sys/dev/bxe/ecore_mfw_req.h Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/ecore_mfw_req.h Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/ecore_reg.h ============================================================================== --- head/sys/dev/bxe/ecore_reg.h Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/ecore_reg.h Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/ecore_sp.c ============================================================================== --- head/sys/dev/bxe/ecore_sp.c Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/ecore_sp.c Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/ecore_sp.h ============================================================================== --- head/sys/dev/bxe/ecore_sp.h Tue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/ecore_sp.h Tue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/modules/bxe/Makefile ============================================================================== --- head/sys/modules/bxe/Makefile Tue May 6 02:22:52 2014 (r265410) +++ head/sys/modules/bxe/Makefile Tue May 6 02:32:27 2014 (r265411) @@ -15,4 +15,9 @@ SRCS += bxe.c \ CFLAGS += -I${BXE} +clean: + rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms + rm -f *.o *.kld *.ko + rm -f @ machine x86 + .include From owner-svn-src-head@FreeBSD.ORG Tue May 6 03:42:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85FAA104; Tue, 6 May 2014 03:42:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59C2DA46; Tue, 6 May 2014 03:42:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s463g5p4047448; Tue, 6 May 2014 03:42:05 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s463g5Fx047447; Tue, 6 May 2014 03:42:05 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201405060342.s463g5Fx047447@svn.freebsd.org> From: Alan Cox Date: Tue, 6 May 2014 03:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265418 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 03:42:05 -0000 Author: alc Date: Tue May 6 03:42:04 2014 New Revision: 265418 URL: http://svnweb.freebsd.org/changeset/base/265418 Log: Prior to r254304, a separate function, vm_pageout_page_stats(), was used to periodically update the reference status of the active pages. This function was called, instead of vm_pageout_scan(), when memory was not scarce. The objective was to provide up to date reference status for active pages in case memory did become scarce and active pages needed to be deactivated. The active page queue scan performed by vm_pageout_page_stats() was virtually identical to that performed by vm_pageout_scan(), and so r254304 eliminated vm_pageout_page_stats(). Instead, vm_pageout_scan() is called with the parameter "pass" set to zero. The intention was that when pass is zero, vm_pageout_scan() would only scan the active queue. However, the variable page_shortage can still be greater than zero when memory is not scarce and vm_pageout_scan() is called with pass equal to zero. Consequently, the inactive queue may be scanned and dirty pages laundered even though that was not intended by r254304. This revision fixes that. Reported by: avg MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Tue May 6 03:38:04 2014 (r265417) +++ head/sys/vm/vm_pageout.c Tue May 6 03:42:04 2014 (r265418) @@ -942,13 +942,15 @@ vm_pageout_scan(struct vm_domain *vmd, i */ addl_page_shortage = 0; - deficit = atomic_readandclear_int(&vm_pageout_deficit); - /* * Calculate the number of pages we want to either free or move * to the cache. */ - page_shortage = vm_paging_target() + deficit; + if (pass > 0) { + deficit = atomic_readandclear_int(&vm_pageout_deficit); + page_shortage = vm_paging_target() + deficit; + } else + page_shortage = deficit = 0; /* * maxlaunder limits the number of dirty pages we flush per scan. From owner-svn-src-head@FreeBSD.ORG Tue May 6 03:57:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86BD9413; Tue, 6 May 2014 03:57:06 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 45890B39; Tue, 6 May 2014 03:57:05 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 9F15CD643C4; Tue, 6 May 2014 13:56:58 +1000 (EST) Date: Tue, 6 May 2014 13:56:57 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov Subject: Re: svn commit: r265367 - head/lib/libc/regex In-Reply-To: <53680532.7050605@freebsd.org> Message-ID: <20140506133145.G1596@besplex.bde.org> References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> <53680532.7050605@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eojmkOZX c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=mAlE_CWfnZ8A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=M_1yASzfUti_sNIsEuAA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Pedro F. Giffuni" , David Chisnall , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 03:57:06 -0000 On Tue, 6 May 2014, Andrey Chernov wrote: > On 05.05.2014 22:28, David Chisnall wrote: >> On 5 May 2014, at 18:42, Andrey Chernov wrote: >> >>> Please don't commit OpenBSD errors. Now you mix calloc() with the >>> realloc() for the same variable later which makes calloc() zeroing >>> pointless and waste of CPU. The existence of calloc() is a bug. OpenBSD might be using it to zero memory, but this zeroing should be explicit. I didn't really notice before that the implicit zeroing doesn't even give much shorter code, since you still need explicit zeroing after realloc() if you have a policy of zeroing everything. >> The purpose of calloc() here is not (primarily) to get the zero'd size, it's to get the overflow-checking behaviour for calloc. It didn't help get the line-length overflow checking in mail. > It is better to avoid using undocumented intrinsic knowledge of standard > function particular implementation, this is unportable at least and hard > to understand too. It is unportable. The behaviour on overflow is undefined. See another reply. The overflow checking is painful, but doing it in calloc() is only a minor simplification. In ps, I needed the following. It is complicated enough even for system input ({ARG_MAX}) that can be trusted to some extent. % if (buf == NULL) { % if ((arg_max = sysconf(_SC_ARG_MAX)) == -1) % errx(1, "sysconf _SC_ARG_MAX failed"); % if (arg_max >= LONG_MAX / 4 || arg_max >= (long)(SIZE_MAX / 4)) % errx(1, "sysconf _SC_ARG_MAX preposterously large"); % buf_size = 4 * arg_max + 1; % if ((buf = malloc(buf_size)) == NULL) % errx(1, "malloc failed"); % } Here we can't simply use calloc(4, sysconf(...)) (or is it calloc(sysconf(...), 4)?) because: - sysconf() has type long, which differs from size_t, so we can't even pass sysconf() to calloc() in general - sysconf() has an out of band error value - we don't quite have an array, and want to add 1. Adding 1 might overflow. The above is long partly because it has excessive error handling. This much error handling is probably justified for user input but not for sysconf(). Now I don't even like checking if malloc() failed. malloc() never fails, and if it does then there is nothing much you can do. A core dump is quite good error handling for it. But error handling like this allows giving specific error messages. If you use calloc() and the multiplication overflows, then the behaviour can be anything. If the behaviour is to return 0 and set errno to indicate the error, then the best that you can do is hope than errno is set to the undocumented value EINVAL or EOVERFLOW and then possibly check the multiplication yourself so as to determine if that was the error, and then print a specific error message. Bruce From owner-svn-src-head@FreeBSD.ORG Tue May 6 04:11:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92524819; Tue, 6 May 2014 04:11:21 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 64EE5C24; Tue, 6 May 2014 04:11:21 +0000 (UTC) Received: from jre-mbp.elischer.org (ppp121-45-232-70.lns20.per1.internode.on.net [121.45.232.70]) (authenticated bits=0) by vps1.elischer.org (8.14.8/8.14.8) with ESMTP id s464B5un000332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 5 May 2014 21:11:13 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <536860D3.5030205@freebsd.org> Date: Tue, 06 May 2014 12:10:59 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Neel Natu , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r265364 - head/sys/amd64/vmm References: <201405051619.s45GJPr6074677@svn.freebsd.org> In-Reply-To: <201405051619.s45GJPr6074677@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 04:11:21 -0000 On 5/6/14, 12:19 AM, Neel Natu wrote: > Author: neel > Date: Mon May 5 16:19:24 2014 > New Revision: 265364 > URL: http://svnweb.freebsd.org/changeset/base/265364 > > Log: > Virtual machine halt detection is turned on by default. Allow it to be > disabled via the tunable 'hw.vmm.halt_detection'. So this can only be changed at boot time for the host? not even as a sysctl? Why is that? Why can this not be done from the App? > Modified: > head/sys/amd64/vmm/vmm.c > > Modified: head/sys/amd64/vmm/vmm.c > ============================================================================== > --- head/sys/amd64/vmm/vmm.c Mon May 5 15:59:31 2014 (r265363) > +++ head/sys/amd64/vmm/vmm.c Mon May 5 16:19:24 2014 (r265364) > @@ -189,6 +189,16 @@ static VMM_STAT(VCPU_TOTAL_RUNTIME, "vcp > > SYSCTL_NODE(_hw, OID_AUTO, vmm, CTLFLAG_RW, NULL, NULL); > > +/* > + * Halt the guest if all vcpus are executing a HLT instruction with > + * interrupts disabled. > + */ > +static int halt_detection_enabled = 1; > +TUNABLE_INT("hw.vmm.halt_detection", &halt_detection_enabled); > +SYSCTL_INT(_hw_vmm, OID_AUTO, halt_detection, CTLFLAG_RDTUN, > + &halt_detection_enabled, 0, > + "Halt VM if all vcpus execute HLT with interrupts disabled"); > + > static int vmm_ipinum; > SYSCTL_INT(_hw_vmm, OID_AUTO, ipinum, CTLFLAG_RD, &vmm_ipinum, 0, > "IPI vector used for vcpu notifications"); > @@ -1047,7 +1057,7 @@ vm_handle_hlt(struct vm *vm, int vcpuid, > if (intr_disabled) { > wmesg = "vmhalt"; > VCPU_CTR0(vm, vcpuid, "Halted"); > - if (!vcpu_halted) { > + if (!vcpu_halted && halt_detection_enabled) { > vcpu_halted = 1; > CPU_SET_ATOMIC(vcpuid, &vm->halted_cpus); > } > > > From owner-svn-src-head@FreeBSD.ORG Tue May 6 04:21:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8996AAE4; Tue, 6 May 2014 04:21:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75AECD3B; Tue, 6 May 2014 04:21:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s464LndY065690; Tue, 6 May 2014 04:21:49 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s464LnXl065686; Tue, 6 May 2014 04:21:49 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405060421.s464LnXl065686@svn.freebsd.org> From: Warner Losh Date: Tue, 6 May 2014 04:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265419 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 04:21:49 -0000 Author: imp Date: Tue May 6 04:21:48 2014 New Revision: 265419 URL: http://svnweb.freebsd.org/changeset/base/265419 Log: Move the /usr/src specific options to src.opts.mk. Move inclusion of /etc/src.conf to this file as well. Now, it will only affect builds of /usr/src and not others that use the bsd.*.mk files. Specifically don't install src.opts.mk so we can catch when it 'leaks' into bsd.*.mk again and have there be errors when this happens. Future commits will move to including src.opts.mk instead of bsd.own.mk when all that's needed is one of the MK_FOO options from src.opts.mk. Future options should be placed here, unless they directly affect a bsd.*.mk file, in which case they should be placed in bsd.opts.mk. Added: head/share/mk/src.opts.mk - copied, changed from r265418, head/share/mk/bsd.own.mk Modified: head/share/mk/Makefile head/share/mk/bsd.opts.mk Modified: head/share/mk/Makefile ============================================================================== --- head/share/mk/Makefile Tue May 6 03:42:04 2014 (r265418) +++ head/share/mk/Makefile Tue May 6 04:21:48 2014 (r265419) @@ -42,6 +42,9 @@ FILES= \ sys.mk \ version_gen.awk +# Installed for the moment, but not may not be in the future. +FILES+= src.opts.mk + NO_OBJ= FILESDIR= ${BINDIR}/mk Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Tue May 6 03:42:04 2014 (r265418) +++ head/share/mk/bsd.opts.mk Tue May 6 04:21:48 2014 (r265419) @@ -31,11 +31,6 @@ ____: .if !defined(_WITHOUT_SRCCONF) -SRCCONF?= /etc/src.conf -.if exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf" -.include "${SRCCONF}" -.endif - # # Define MK_* variables (which are either "yes" or "no") for users # to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the @@ -66,354 +61,12 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ CTF \ DEBUG_FILES \ - INSTALL_AS_USER \ - -.include - -# Note: __DEFAULT_{YES,NO}_OPTIONS unset by bsd.mkopt.mk - -# These options are used by src the builds - -__DEFAULT_YES_OPTIONS = \ - ACCT \ - ACPI \ - AMD \ - APM \ - ARM_EABI \ - AT \ - ATM \ - AUDIT \ - AUTHPF \ - BINUTILS \ - BINUTILS_BOOTSTRAP \ - BLUETOOTH \ - BMAKE \ - BOOT \ - BSD_CPIO \ - BSNMP \ - BZIP2 \ - CALENDAR \ - CAPSICUM \ - CASPER \ - CDDL \ - CPP \ - CROSS_COMPILER \ - CRYPT \ - CTM \ - CXX \ - DICT \ - DMAGENT \ - DYNAMICROOT \ - ED_CRYPTO \ - EXAMPLES \ - FDT \ - FLOPPY \ - FMTREE \ - FORMAT_EXTENSIONS \ - FORTH \ - FP_LIBC \ - FREEBSD_UPDATE \ - GAMES \ - GCOV \ - GDB \ - GNU \ - GNU_GREP_COMPAT \ - GPIB \ - GPIO \ - GPL_DTC \ - GROFF \ - HTML \ - ICONV \ - INET \ - INET6 \ - IPFILTER \ - IPFW \ - JAIL \ - KDUMP \ - KERNEL_SYMBOLS \ - KVM \ - LDNS \ - LDNS_UTILS \ - LEGACY_CONSOLE \ - LIB32 \ - LIBPTHREAD \ - LIBTHR \ - LOCALES \ - LOCATE \ - LPR \ - LS_COLORS \ - LZMA_SUPPORT \ - MAIL \ - MAILWRAPPER \ - MAKE \ - NCURSESW \ - NDIS \ - NETCAT \ - NETGRAPH \ - NLS_CATALOGS \ - NS_CACHING \ - NTP \ - OPENSSL \ - PAM \ - PC_SYSINSTALL \ - PF \ - PKGBOOTSTRAP \ - PMC \ - PORTSNAP \ - PPP \ - QUOTAS \ - RCMDS \ - RCS \ - RESCUE \ - ROUTED \ - SENDMAIL \ - SETUID_LOGIN \ - SHAREDOCS \ - SOURCELESS \ - SOURCELESS_HOST \ - SOURCELESS_UCODE \ - SVNLITE \ - SYSCALL_COMPAT \ - SYSCONS \ - SYSINSTALL \ - TCSH \ - TELNET \ - TEXTPROC \ - UNBOUND \ - USB \ - UTMPX \ - VI \ - WIRELESS \ - WPA_SUPPLICANT_EAPOL \ - ZFS \ - ZONEINFO - -__DEFAULT_NO_OPTIONS = \ - BSD_GREP \ - CLANG_EXTRAS \ - EISA \ - HESIOD \ - LLDB \ - NAND \ - OFED \ - OPENLDAP \ - OPENSSH_NONE_CIPHER \ - SHARED_TOOLCHAIN \ - SORT_THREADS \ - SVN \ - TESTS \ - USB_GADGET_EXAMPLES - -# -# Default behaviour of some options depends on the architecture. Unfortunately -# this means that we have to test TARGET_ARCH (the buildworld case) as well -# as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not -# used at all in bsd.*.mk, but we have to make an exception here if we want -# to allow defaults for some things like clang to vary by target architecture. -# Additional, per-target behavior should be rarely added only after much -# gnashing of teeth and grinding of gears. -# -.if defined(TARGET_ARCH) -__T=${TARGET_ARCH} -.else -__T=${MACHINE_ARCH} -.endif -.if defined(TARGET) -__TT=${TARGET} -.else -__TT=${MACHINE} -.endif -# Clang is only for x86, powerpc and little-endian arm right now, by default. -.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*} -__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP -.elif ${__T} == "arm" || ${__T} == "armv6" || ${__T} == "armv6hf" -__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP -# GCC is unable to build the full clang on arm, disable it by default. -__DEFAULT_NO_OPTIONS+=CLANG_FULL -.else -__DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP -.endif -# Clang the default system compiler only on little-endian arm and x86. -.if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \ - ${__T} == "armv6hf" || ${__T} == "i386" -__DEFAULT_YES_OPTIONS+=CLANG_IS_CC -__DEFAULT_NO_OPTIONS+=GNUCXX -# The pc98 bootloader requires gcc to build and so we must leave gcc enabled -# for pc98 for now. -.if ${__TT} == "pc98" -__DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP -.else -__DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP -.endif -.else -# If clang is not cc, then build gcc by default -__DEFAULT_NO_OPTIONS+=CLANG_IS_CC CLANG CLANG_BOOTSTRAP -__DEFAULT_YES_OPTIONS+=GCC GNUCXX GCC_BOOTSTRAP -.endif + INSTALL_AS_USER .include -# -# Supported NO_* options (if defined, MK_* will be forced to "no", -# regardless of user's setting). -# -# These are transitional and will disappaer in the FreeBSD 12. -# -.for var in \ - CTF \ - DEBUG_FILES \ - INSTALLLIB \ - MAN \ - PROFILE -.if defined(NO_${var}) -.warning "NO_${var} is defined, but deprecated. Please use MK_${var}=no instead." -MK_${var}:=no -.endif -.endfor - -# -# MK_* options that default to "yes" if the compiler is a C++11 compiler. -# -.include -.for var in \ - LIBCPLUSPLUS -.if !defined(MK_${var}) -.if ${COMPILER_FEATURES:Mc++11} -.if defined(WITHOUT_${var}) -MK_${var}:= no -.else -MK_${var}:= yes -.endif -.else -.if defined(WITH_${var}) -MK_${var}:= yes -.else -MK_${var}:= no -.endif -.endif -.endif -.endfor - -# -# Force some options off if their dependencies are off. -# Order is somewhat important. -# -.if ${MK_LIBPTHREAD} == "no" -MK_LIBTHR:= no -.endif - -.if ${MK_LDNS} == "no" -MK_LDNS_UTILS:= no -MK_UNBOUND:= no -.endif - -.if ${MK_SOURCELESS} == "no" -MK_SOURCELESS_HOST:= no -MK_SOURCELESS_UCODE:= no -.endif - -.if ${MK_CDDL} == "no" -MK_ZFS:= no -MK_CTF:= no -.endif - -.if ${MK_CRYPT} == "no" -MK_OPENSSL:= no -MK_OPENSSH:= no -MK_KERBEROS:= no -.endif - -.if ${MK_CXX} == "no" -MK_CLANG:= no -MK_GROFF:= no -.endif - -.if ${MK_MAIL} == "no" -MK_MAILWRAPPER:= no -MK_SENDMAIL:= no -MK_DMAGENT:= no -.endif - -.if ${MK_NETGRAPH} == "no" -MK_ATM:= no -MK_BLUETOOTH:= no -.endif - -.if ${MK_OPENSSL} == "no" -MK_OPENSSH:= no -MK_KERBEROS:= no -.endif - -.if ${MK_PF} == "no" -MK_AUTHPF:= no -.endif - -.if ${MK_TEXTPROC} == "no" -MK_GROFF:= no -.endif - -.if ${MK_CROSS_COMPILER} == "no" -MK_BINUTILS_BOOTSTRAP:= no -MK_CLANG_BOOTSTRAP:= no -MK_GCC_BOOTSTRAP:= no -.endif - -.if ${MK_TOOLCHAIN} == "no" -MK_BINUTILS:= no -MK_CLANG:= no -MK_GCC:= no -MK_GDB:= no -.endif - -.if ${MK_CLANG} == "no" -MK_CLANG_EXTRAS:= no -MK_CLANG_FULL:= no -.endif - -# -# Set defaults for the MK_*_SUPPORT variables. -# - -# -# MK_*_SUPPORT options which default to "yes" unless their corresponding -# MK_* variable is set to "no". -# -.for var in \ - BZIP2 \ - GNU \ - INET \ - INET6 \ - KERBEROS \ - KVM \ - NETGRAPH \ - PAM \ - WIRELESS -.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no" -MK_${var}_SUPPORT:= no -.else -MK_${var}_SUPPORT:= yes -.endif -.endfor - -# -# MK_* options whose default value depends on another option. -# -.for vv in \ - GSSAPI/KERBEROS \ - MAN_UTILS/MAN -.if defined(WITH_${vv:H}) -MK_${vv:H}:= yes -.elif defined(WITHOUT_${vv:H}) -MK_${vv:H}:= no -.else -MK_${vv:H}:= ${MK_${vv:T}} -.endif -.endfor - -.if !${COMPILER_FEATURES:Mc++11} -MK_LLDB:= no -.endif - +# This should be elsewhere, but needs to be here first for now. +.include .endif # !_WITHOUT_SRCCONF .endif Copied and modified: head/share/mk/src.opts.mk (from r265418, head/share/mk/bsd.own.mk) ============================================================================== --- head/share/mk/bsd.own.mk Tue May 6 03:42:04 2014 (r265418, copy source) +++ head/share/mk/src.opts.mk Tue May 6 04:21:48 2014 (r265419) @@ -1,237 +1,392 @@ # $FreeBSD$ # -# The include file set common variables for owner, -# group, mode, and directories. Defaults are in brackets. +# Option file for FreeBSD /usr/src builds. # +# Users define WITH_FOO and WITHOUT_FOO on the command line or in /etc/src.conf +# and /etc/make.conf files. These translate in the build system to MK_FOO={yes,no} +# with sensible (usually) defaults. # -# +++ variables +++ +# Makefiles must include bsd.opts.mk after defining specific MK_FOO options that +# are applicable for that Makefile (typically there are none, but sometimes there +# are exceptions). Recursive makes usually add MK_FOO=no for options that they wish +# to omit from that make. # -# DESTDIR Change the tree where the file gets installed. [not set] +# Makefiles must include bsd.srcpot.mk before they test the value of any MK_FOO +# variable. # -# DISTDIR Change the tree where the file for a distribution -# gets installed (see /usr/src/release/Makefile). [not set] +# Makefiles may also assume that this file is included by bsd.own.mk should it +# need variables defined there prior to the end of the Makefile where +# bsd.{subdir,lib.bin}.mk is traditionally included. # -# COMPRESS_CMD Program to compress documents. -# Output is to stdout. [gzip -cn] +# The old-style YES_FOO and NO_FOO are being phased out. No new instances of them +# should be added. Old instances should be removed since they were just to +# bridge the gap between FreeBSD 4 and FreeBSD 5. # -# COMPRESS_EXT File name extension of ${COMPRESS_CMD} command. [.gz] +# Makefiles should never test WITH_FOO or WITHOUT_FOO directly (although an +# exception is made for _WITHOUT_SRCONF which turns off this mechanism +# completely). # -# BINOWN Binary owner. [root] -# -# BINGRP Binary group. [wheel] -# -# BINMODE Binary mode. [555] -# -# NOBINMODE Mode for non-executable files. [444] -# -# LIBDIR Base path for libraries. [/usr/lib] -# -# LIBCOMPATDIR Base path for compat libraries. [/usr/lib/compat] -# -# LIBPRIVATEDIR Base path for private libraries. [/usr/lib/private] -# -# LIBDATADIR Base path for misc. utility data files. [/usr/libdata] -# -# LIBEXECDIR Base path for system daemons and utilities. [/usr/libexec] -# -# LINTLIBDIR Base path for lint libraries. [/usr/libdata/lint] -# -# SHLIBDIR Base path for shared libraries. [${LIBDIR}] -# -# LIBOWN Library owner. [${BINOWN}] -# -# LIBGRP Library group. [${BINGRP}] -# -# LIBMODE Library mode. [${NOBINMODE}] -# -# -# DEBUGDIR Base path for standalone debug files. [/usr/lib/debug] -# -# DEBUGMODE Mode for debug files. [${NOBINMODE}] -# -# -# KMODDIR Base path for loadable kernel modules -# (see kld(4)). [/boot/kernel] -# -# KMODOWN Kernel and KLD owner. [${BINOWN}] -# -# KMODGRP Kernel and KLD group. [${BINGRP}] -# -# KMODMODE KLD mode. [${BINMODE}] -# -# -# SHAREDIR Base path for architecture-independent ascii -# text files. [/usr/share] -# -# SHAREOWN ASCII text file owner. [root] -# -# SHAREGRP ASCII text file group. [wheel] -# -# SHAREMODE ASCII text file mode. [${NOBINMODE}] -# -# -# CONFDIR Base path for configuration files. [/etc] -# -# CONFOWN Configuration file owner. [root] -# -# CONFGRP Configuration file group. [wheel] -# -# CONFMODE Configuration file mode. [644] -# -# -# DOCDIR Base path for system documentation (e.g. PSD, USD, -# handbook, FAQ etc.). [${SHAREDIR}/doc] -# -# DOCOWN Documentation owner. [${SHAREOWN}] -# -# DOCGRP Documentation group. [${SHAREGRP}] -# -# DOCMODE Documentation mode. [${NOBINMODE}] -# -# -# INFODIR Base path for GNU's hypertext system -# called Info (see info(1)). [${SHAREDIR}/info] -# -# INFOOWN Info owner. [${SHAREOWN}] -# -# INFOGRP Info group. [${SHAREGRP}] -# -# INFOMODE Info mode. [${NOBINMODE}] -# -# -# MANDIR Base path for manual installation. [${SHAREDIR}/man/man] -# -# MANOWN Manual owner. [${SHAREOWN}] -# -# MANGRP Manual group. [${SHAREGRP}] + +.if !target(____) +____: + +# Allow user to configure things, but in the future this will move +# elsehwere... + +SRCCONF?= /etc/src.conf +.if exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf" +.include "${SRCCONF}" +.endif + # -# MANMODE Manual mode. [${NOBINMODE}] +# Define MK_* variables (which are either "yes" or "no") for users +# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the +# make(1) environment. +# These should be tested with `== "no"' or `!= "no"' in makefiles. +# The NO_* variables should only be set by makefiles for variables +# that haven't been converted over. +# + +# These options are used by src the builds + +__DEFAULT_YES_OPTIONS = \ + ACCT \ + ACPI \ + AMD \ + APM \ + ARM_EABI \ + AT \ + ATM \ + AUDIT \ + AUTHPF \ + BINUTILS \ + BINUTILS_BOOTSTRAP \ + BLUETOOTH \ + BMAKE \ + BOOT \ + BSD_CPIO \ + BSNMP \ + BZIP2 \ + CALENDAR \ + CAPSICUM \ + CASPER \ + CDDL \ + CPP \ + CROSS_COMPILER \ + CRYPT \ + CTM \ + CXX \ + DICT \ + DMAGENT \ + DYNAMICROOT \ + ED_CRYPTO \ + EXAMPLES \ + FDT \ + FLOPPY \ + FMTREE \ + FORMAT_EXTENSIONS \ + FORTH \ + FP_LIBC \ + FREEBSD_UPDATE \ + GAMES \ + GCOV \ + GDB \ + GNU \ + GNU_GREP_COMPAT \ + GPIB \ + GPIO \ + GPL_DTC \ + GROFF \ + HTML \ + ICONV \ + INET \ + INET6 \ + IPFILTER \ + IPFW \ + JAIL \ + KDUMP \ + KERNEL_SYMBOLS \ + KVM \ + LDNS \ + LDNS_UTILS \ + LEGACY_CONSOLE \ + LIB32 \ + LIBPTHREAD \ + LIBTHR \ + LOCALES \ + LOCATE \ + LPR \ + LS_COLORS \ + LZMA_SUPPORT \ + MAIL \ + MAILWRAPPER \ + MAKE \ + NCURSESW \ + NDIS \ + NETCAT \ + NETGRAPH \ + NLS_CATALOGS \ + NS_CACHING \ + NTP \ + OPENSSL \ + PAM \ + PC_SYSINSTALL \ + PF \ + PKGBOOTSTRAP \ + PMC \ + PORTSNAP \ + PPP \ + QUOTAS \ + RCMDS \ + RCS \ + RESCUE \ + ROUTED \ + SENDMAIL \ + SETUID_LOGIN \ + SHAREDOCS \ + SOURCELESS \ + SOURCELESS_HOST \ + SOURCELESS_UCODE \ + SVNLITE \ + SYSCALL_COMPAT \ + SYSCONS \ + SYSINSTALL \ + TCSH \ + TELNET \ + TEXTPROC \ + UNBOUND \ + USB \ + UTMPX \ + VI \ + WIRELESS \ + WPA_SUPPLICANT_EAPOL \ + ZFS \ + ZONEINFO + +__DEFAULT_NO_OPTIONS = \ + BSD_GREP \ + CLANG_EXTRAS \ + EISA \ + HESIOD \ + LLDB \ + NAND \ + OFED \ + OPENLDAP \ + OPENSSH_NONE_CIPHER \ + SHARED_TOOLCHAIN \ + SORT_THREADS \ + SVN \ + TESTS \ + USB_GADGET_EXAMPLES + +# +# Default behaviour of some options depends on the architecture. Unfortunately +# this means that we have to test TARGET_ARCH (the buildworld case) as well +# as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not +# used at all in bsd.*.mk, but we have to make an exception here if we want +# to allow defaults for some things like clang to vary by target architecture. +# Additional, per-target behavior should be rarely added only after much +# gnashing of teeth and grinding of gears. # +.if defined(TARGET_ARCH) +__T=${TARGET_ARCH} +.else +__T=${MACHINE_ARCH} +.endif +.if defined(TARGET) +__TT=${TARGET} +.else +__TT=${MACHINE} +.endif +# Clang is only for x86, powerpc and little-endian arm right now, by default. +.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*} +__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP +.elif ${__T} == "arm" || ${__T} == "armv6" || ${__T} == "armv6hf" +__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP +# GCC is unable to build the full clang on arm, disable it by default. +__DEFAULT_NO_OPTIONS+=CLANG_FULL +.else +__DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP +.endif +# Clang the default system compiler only on little-endian arm and x86. +.if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \ + ${__T} == "armv6hf" || ${__T} == "i386" +__DEFAULT_YES_OPTIONS+=CLANG_IS_CC +__DEFAULT_NO_OPTIONS+=GNUCXX +# The pc98 bootloader requires gcc to build and so we must leave gcc enabled +# for pc98 for now. +.if ${__TT} == "pc98" +__DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP +.else +__DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP +.endif +.else +# If clang is not cc, then build gcc by default +__DEFAULT_NO_OPTIONS+=CLANG_IS_CC CLANG CLANG_BOOTSTRAP +__DEFAULT_YES_OPTIONS+=GCC GNUCXX GCC_BOOTSTRAP +.endif + +.include + # -# NLSDIR Base path for National Language Support files -# installation. [${SHAREDIR}/nls] +# Supported NO_* options (if defined, MK_* will be forced to "no", +# regardless of user's setting). # -# NLSOWN National Language Support files owner. [${SHAREOWN}] +# These are transitional and will disappaer in the FreeBSD 12. # -# NLSGRP National Language Support files group. [${SHAREGRP}] +.for var in \ + CTF \ + DEBUG_FILES \ + INSTALLLIB \ + MAN \ + PROFILE +.if defined(NO_${var}) +.warning "NO_${var} is defined, but deprecated. Please use MK_${var}=no instead." +MK_${var}:=no +.endif +.endfor + # -# NLSMODE National Language Support files mode. [${NOBINMODE}] +# MK_* options that default to "yes" if the compiler is a C++11 compiler. # -# INCLUDEDIR Base path for standard C include files [/usr/include] - -.if !target(____) -____: - -.include - -.if !defined(_WITHOUT_SRCCONF) - -.if ${MK_CTF} != "no" -CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -.elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300) -CTFCONVERT_CMD= +.include +.for var in \ + LIBCPLUSPLUS +.if !defined(MK_${var}) +.if ${COMPILER_FEATURES:Mc++11} +.if defined(WITHOUT_${var}) +MK_${var}:= no .else -CTFCONVERT_CMD= @: -.endif - -.if ${MK_INSTALL_AS_USER} != "no" -_uid!= id -u -.if ${_uid} != 0 -.if !defined(USER) -USER!= id -un +MK_${var}:= yes +.endif +.else +.if defined(WITH_${var}) +MK_${var}:= yes +.else +MK_${var}:= no +.endif .endif -_gid!= id -gn -.for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE -$xOWN= ${USER} -$xGRP= ${_gid} -.endfor .endif +.endfor + +# +# Force some options off if their dependencies are off. +# Order is somewhat important. +# +.if ${MK_LIBPTHREAD} == "no" +MK_LIBTHR:= no .endif -.endif # !_WITHOUT_SRCCONF +.if ${MK_LDNS} == "no" +MK_LDNS_UTILS:= no +MK_UNBOUND:= no +.endif -# Binaries -BINOWN?= root -BINGRP?= wheel -BINMODE?= 555 -NOBINMODE?= 444 +.if ${MK_SOURCELESS} == "no" +MK_SOURCELESS_HOST:= no +MK_SOURCELESS_UCODE:= no +.endif -.if defined(MODULES_WITH_WORLD) -KMODDIR?= /boot/modules -.else -KMODDIR?= /boot/kernel +.if ${MK_CDDL} == "no" +MK_ZFS:= no +MK_CTF:= no .endif -KMODOWN?= ${BINOWN} -KMODGRP?= ${BINGRP} -KMODMODE?= ${BINMODE} -LIBDIR?= /usr/lib -LIBCOMPATDIR?= /usr/lib/compat -LIBPRIVATEDIR?= /usr/lib/private -LIBDATADIR?= /usr/libdata -LIBEXECDIR?= /usr/libexec -LINTLIBDIR?= /usr/libdata/lint -SHLIBDIR?= ${LIBDIR} -LIBOWN?= ${BINOWN} -LIBGRP?= ${BINGRP} -LIBMODE?= ${NOBINMODE} +.if ${MK_CRYPT} == "no" +MK_OPENSSL:= no +MK_OPENSSH:= no +MK_KERBEROS:= no +.endif -DEBUGDIR?= /usr/lib/debug -DEBUGMODE?= ${NOBINMODE} +.if ${MK_CXX} == "no" +MK_CLANG:= no +MK_GROFF:= no +.endif +.if ${MK_MAIL} == "no" +MK_MAILWRAPPER:= no +MK_SENDMAIL:= no +MK_DMAGENT:= no +.endif -# Share files -SHAREDIR?= /usr/share -SHAREOWN?= root -SHAREGRP?= wheel -SHAREMODE?= ${NOBINMODE} +.if ${MK_NETGRAPH} == "no" +MK_ATM:= no +MK_BLUETOOTH:= no +.endif -CONFDIR?= /etc -CONFOWN?= root -CONFGRP?= wheel -CONFMODE?= 644 +.if ${MK_OPENSSL} == "no" +MK_OPENSSH:= no +MK_KERBEROS:= no +.endif -MANDIR?= ${SHAREDIR}/man/man -MANOWN?= ${SHAREOWN} -MANGRP?= ${SHAREGRP} -MANMODE?= ${NOBINMODE} +.if ${MK_PF} == "no" +MK_AUTHPF:= no +.endif -DOCDIR?= ${SHAREDIR}/doc -DOCOWN?= ${SHAREOWN} -DOCGRP?= ${SHAREGRP} -DOCMODE?= ${NOBINMODE} +.if ${MK_TEXTPROC} == "no" +MK_GROFF:= no +.endif -INFODIR?= ${SHAREDIR}/info -INFOOWN?= ${SHAREOWN} -INFOGRP?= ${SHAREGRP} -INFOMODE?= ${NOBINMODE} +.if ${MK_CROSS_COMPILER} == "no" +MK_BINUTILS_BOOTSTRAP:= no +MK_CLANG_BOOTSTRAP:= no +MK_GCC_BOOTSTRAP:= no +.endif -NLSDIR?= ${SHAREDIR}/nls -NLSOWN?= ${SHAREOWN} -NLSGRP?= ${SHAREGRP} -NLSMODE?= ${NOBINMODE} +.if ${MK_TOOLCHAIN} == "no" +MK_BINUTILS:= no +MK_CLANG:= no +MK_GCC:= no +MK_GDB:= no +.endif -INCLUDEDIR?= /usr/include +.if ${MK_CLANG} == "no" +MK_CLANG_EXTRAS:= no +MK_CLANG_FULL:= no +.endif # -# install(1) parameters. +# Set defaults for the MK_*_SUPPORT variables. # -HRDLINK?= -l h -SYMLINK?= -l s - -INSTALL_LINK?= ${INSTALL} ${HRDLINK} -INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK} -# Common variables -.if !defined(DEBUG_FLAGS) -STRIP?= -s +# +# MK_*_SUPPORT options which default to "yes" unless their corresponding +# MK_* variable is set to "no". +# +.for var in \ + BZIP2 \ + GNU \ + INET \ + INET6 \ + KERBEROS \ + KVM \ + NETGRAPH \ + PAM \ + WIRELESS +.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no" +MK_${var}_SUPPORT:= no +.else +MK_${var}_SUPPORT:= yes .endif +.endfor -COMPRESS_CMD?= gzip -cn -COMPRESS_EXT?= .gz +# +# MK_* options whose default value depends on another option. +# +.for vv in \ + GSSAPI/KERBEROS \ + MAN_UTILS/MAN +.if defined(WITH_${vv:H}) +MK_${vv:H}:= yes +.elif defined(WITHOUT_${vv:H}) +MK_${vv:H}:= no +.else +MK_${vv:H}:= ${MK_${vv:T}} +.endif +.endfor -# Pointer to the top directory into which tests are installed. Should not be -# overriden by Makefiles, but the user may choose to set this in src.conf(5). -TESTSBASE?= /usr/tests +.if !${COMPILER_FEATURES:Mc++11} +MK_LLDB:= no +.endif -.endif # !target(____) +.endif From owner-svn-src-head@FreeBSD.ORG Tue May 6 04:22:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DEBA2D58; Tue, 6 May 2014 04:22:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C892ED58; Tue, 6 May 2014 04:22:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s464MLst065993; Tue, 6 May 2014 04:22:21 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s464M1nm065820; Tue, 6 May 2014 04:22:01 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405060422.s464M1nm065820@svn.freebsd.org> From: Warner Losh Date: Tue, 6 May 2014 04:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265420 - in head: . bin bin/csh bin/date bin/ed bin/ls bin/mv bin/pax bin/pkill bin/sh bin/test cddl cddl/lib cddl/sbin cddl/usr.bin cddl/usr.sbin etc etc/mtree etc/periodic/daily etc/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 04:22:22 -0000 Author: imp Date: Tue May 6 04:22:01 2014 New Revision: 265420 URL: http://svnweb.freebsd.org/changeset/base/265420 Log: Use src.opts.mk in preference to bsd.own.mk except where we need stuff from the latter. Modified: head/Makefile.inc1 head/bin/Makefile head/bin/Makefile.inc head/bin/csh/Makefile head/bin/date/Makefile head/bin/ed/Makefile head/bin/ls/Makefile head/bin/mv/Makefile head/bin/pax/Makefile head/bin/pkill/Makefile head/bin/sh/Makefile head/bin/test/Makefile head/cddl/Makefile head/cddl/lib/Makefile head/cddl/sbin/Makefile head/cddl/usr.bin/Makefile head/cddl/usr.sbin/Makefile head/etc/Makefile head/etc/mtree/Makefile head/etc/periodic/daily/Makefile head/etc/periodic/monthly/Makefile head/etc/periodic/security/Makefile head/etc/periodic/weekly/Makefile head/etc/rc.d/Makefile head/games/Makefile head/games/factor/Makefile head/gnu/Makefile head/gnu/lib/Makefile head/gnu/lib/csu/Makefile head/gnu/lib/libgcc/Makefile head/gnu/lib/libgcov/Makefile head/gnu/lib/libstdc++/Makefile head/gnu/lib/libsupc++/Makefile head/gnu/usr.bin/Makefile head/gnu/usr.bin/binutils/as/Makefile head/gnu/usr.bin/binutils/ld/Makefile head/gnu/usr.bin/cc/Makefile head/gnu/usr.bin/cc/Makefile.inc head/gnu/usr.bin/cc/c++/Makefile head/gnu/usr.bin/cc/cc/Makefile head/gnu/usr.bin/cc/cc1/Makefile head/gnu/usr.bin/cc/cc1plus/Makefile head/gnu/usr.bin/cc/cc_tools/Makefile head/gnu/usr.bin/cc/cpp/Makefile head/gnu/usr.bin/dialog/Makefile head/gnu/usr.bin/grep/Makefile head/include/Makefile head/include/arpa/Makefile head/kerberos5/Makefile.inc head/lib/Makefile head/lib/atf/Makefile head/lib/atf/libatf-c++/Makefile head/lib/atf/libatf-c/Makefile head/lib/clang/Makefile head/lib/clang/clang.build.mk head/lib/clang/libllvmanalysis/Makefile head/lib/clang/libllvmipa/Makefile head/lib/clang/libllvmipo/Makefile head/lib/clang/libllvmmc/Makefile head/lib/clang/libllvmscalaropts/Makefile head/lib/clang/libllvmsupport/Makefile head/lib/clang/libllvmtransformutils/Makefile head/lib/clang/libllvmx86disassembler/Makefile head/lib/libarchive/Makefile head/lib/libbsnmp/libbsnmp/Makefile head/lib/libc/Makefile head/lib/libc_nonshared/Makefile head/lib/libcompiler_rt/Makefile head/lib/libcrypt/Makefile head/lib/libfetch/Makefile head/lib/libipsec/Makefile head/lib/libkiconv/Makefile head/lib/libmilter/Makefile head/lib/libpam/modules/modules.inc head/lib/libpam/modules/pam_unix/Makefile head/lib/libpcap/Makefile head/lib/libproc/Makefile head/lib/libprocstat/Makefile head/lib/libradius/Makefile head/lib/librpcsvc/Makefile head/lib/libsm/Makefile head/lib/libsmb/Makefile head/lib/libstand/Makefile head/lib/libtelnet/Makefile head/lib/libthr/Makefile head/lib/libulog/Makefile head/lib/libutil/Makefile head/lib/libwrap/Makefile head/lib/ncurses/Makefile head/lib/ncurses/ncurses/Makefile head/libexec/Makefile head/libexec/atf/atf-check/Makefile head/libexec/ftpd/Makefile head/libexec/rlogind/Makefile head/libexec/rtld-elf/Makefile head/libexec/tcpd/Makefile head/libexec/telnetd/Makefile head/release/picobsd/tinyware/login/Makefile head/rescue/librescue/Makefile head/rescue/rescue/Makefile head/sbin/Makefile head/sbin/Makefile.inc head/sbin/atm/atmconfig/Makefile head/sbin/dhclient/Makefile head/sbin/geom/class/Makefile head/sbin/ggate/Makefile head/sbin/growfs/Makefile head/sbin/hastctl/Makefile head/sbin/hastd/Makefile head/sbin/ifconfig/Makefile head/sbin/ipfw/Makefile head/sbin/mdconfig/Makefile head/sbin/pfctl/Makefile head/sbin/ping/Makefile head/sbin/route/Makefile head/sbin/setkey/Makefile head/secure/Makefile head/secure/Makefile.inc head/secure/lib/Makefile head/secure/lib/libssh/Makefile head/secure/libexec/Makefile head/secure/libexec/sftp-server/Makefile head/secure/libexec/ssh-keysign/Makefile head/secure/libexec/ssh-pkcs11-helper/Makefile head/secure/usr.bin/Makefile head/secure/usr.bin/scp/Makefile head/secure/usr.bin/sftp/Makefile head/secure/usr.bin/ssh-add/Makefile head/secure/usr.bin/ssh-agent/Makefile head/secure/usr.bin/ssh-keygen/Makefile head/secure/usr.bin/ssh-keyscan/Makefile head/secure/usr.bin/ssh/Makefile head/secure/usr.sbin/Makefile head/secure/usr.sbin/sshd/Makefile head/share/Makefile head/share/doc/Makefile head/share/doc/smm/Makefile head/share/dtrace/Makefile head/share/examples/Makefile head/share/man/Makefile head/share/man/man1/Makefile head/share/man/man3/Makefile head/share/man/man4/Makefile head/share/man/man5/Makefile head/share/mk/Makefile head/share/mk/bsd.opts.mk head/share/mk/bsd.own.mk head/share/mk/src.opts.mk head/sys/Makefile head/sys/boot/Makefile head/sys/boot/amd64/efi/Makefile head/sys/boot/arm/at91/bootspi/Makefile head/sys/boot/arm/at91/libat91/Makefile head/sys/boot/arm/ixp425/boot2/Makefile head/sys/boot/arm/uboot/Makefile head/sys/boot/i386/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/ia64/common/Makefile head/sys/boot/ia64/efi/Makefile head/sys/boot/ia64/ski/Makefile head/sys/boot/libstand32/Makefile head/sys/boot/mips/beri/loader/Makefile head/sys/boot/pc98/loader/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/powerpc/uboot/Makefile head/sys/boot/sparc64/loader/Makefile head/sys/boot/uboot/lib/Makefile head/sys/boot/userboot/userboot/Makefile head/sys/conf/kern.pre.mk head/sys/modules/Makefile head/sys/modules/aic7xxx/ahc/Makefile head/sys/modules/carp/Makefile head/sys/modules/cxgb/Makefile head/sys/modules/cxgb/cxgb/Makefile head/sys/modules/cxgb/iw_cxgb/Makefile head/sys/modules/cxgb/tom/Makefile head/sys/modules/cxgbe/Makefile head/sys/modules/cxgbe/if_cxgbe/Makefile head/sys/modules/cxgbe/iw_cxgbe/Makefile head/sys/modules/cxgbe/tom/Makefile head/sys/modules/dpt/Makefile head/sys/modules/drm/Makefile head/sys/modules/dummynet/Makefile head/sys/modules/em/Makefile head/sys/modules/ep/Makefile head/sys/modules/if_bridge/Makefile head/sys/modules/if_gif/Makefile head/sys/modules/if_lagg/Makefile head/sys/modules/igb/Makefile head/sys/modules/ipdivert/Makefile head/sys/modules/ipfilter/Makefile head/sys/modules/ipfw/Makefile head/sys/modules/ipoib/Makefile head/sys/modules/ixgbe/Makefile head/sys/modules/mlx4/Makefile head/sys/modules/mlx4ib/Makefile head/sys/modules/mlxen/Makefile head/sys/modules/mthca/Makefile head/sys/modules/netgraph/Makefile head/sys/modules/netgraph/ipfw/Makefile head/sys/modules/netgraph/netflow/Makefile head/sys/modules/pf/Makefile head/sys/modules/pflog/Makefile head/sys/modules/pfsync/Makefile head/sys/modules/sound/driver/Makefile head/sys/modules/usb/Makefile head/sys/modules/virtio/network/Makefile head/sys/modules/vmware/vmxnet3/Makefile head/sys/modules/vx/Makefile head/sys/ofed/drivers/infiniband/hw/mlx4/Makefile head/sys/ofed/drivers/net/mlx4/Makefile head/tools/regression/priv/Makefile head/tools/tools/net80211/wlanwatch/Makefile head/usr.bin/Makefile head/usr.bin/apply/Makefile head/usr.bin/ar/Makefile head/usr.bin/atf/atf-sh/Makefile head/usr.bin/bmake/Makefile.inc head/usr.bin/calendar/Makefile head/usr.bin/chkey/Makefile head/usr.bin/chpass/Makefile head/usr.bin/clang/Makefile head/usr.bin/clang/clang/Makefile head/usr.bin/comm/Makefile head/usr.bin/cpio/Makefile head/usr.bin/fetch/Makefile head/usr.bin/file2c/Makefile head/usr.bin/ftp/Makefile head/usr.bin/grep/Makefile head/usr.bin/gzip/Makefile head/usr.bin/id/Makefile head/usr.bin/join/Makefile head/usr.bin/jot/Makefile head/usr.bin/kdump/Makefile head/usr.bin/lastcomm/Makefile head/usr.bin/lex/lib/Makefile head/usr.bin/logger/Makefile head/usr.bin/login/Makefile head/usr.bin/m4/Makefile head/usr.bin/make/Makefile head/usr.bin/ncal/Makefile head/usr.bin/netstat/Makefile head/usr.bin/newkey/Makefile head/usr.bin/passwd/Makefile head/usr.bin/printf/Makefile head/usr.bin/sed/Makefile head/usr.bin/sort/Makefile head/usr.bin/su/Makefile head/usr.bin/svn/Makefile.inc head/usr.bin/svn/lib/libapr_util/Makefile head/usr.bin/systat/Makefile head/usr.bin/tar/Makefile head/usr.bin/telnet/Makefile head/usr.bin/tr/Makefile head/usr.bin/uudecode/Makefile head/usr.bin/uuencode/Makefile head/usr.bin/vi/Makefile head/usr.bin/xargs/Makefile head/usr.bin/yacc/Makefile head/usr.sbin/Makefile head/usr.sbin/amd/Makefile.inc head/usr.sbin/amd/amd/Makefile head/usr.sbin/amd/include/Makefile head/usr.sbin/bootparamd/bootparamd/Makefile head/usr.sbin/bsdinstall/distextract/Makefile head/usr.sbin/bsdinstall/distfetch/Makefile head/usr.sbin/bsdinstall/partedit/Makefile head/usr.sbin/bsnmpd/bsnmpd/Makefile head/usr.sbin/bsnmpd/modules/Makefile head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile head/usr.sbin/bsnmpd/tools/bsnmptools/Makefile head/usr.sbin/etcupdate/Makefile head/usr.sbin/flowctl/Makefile head/usr.sbin/gssd/Makefile head/usr.sbin/ifmcstat/Makefile head/usr.sbin/inetd/Makefile head/usr.sbin/jail/Makefile head/usr.sbin/jls/Makefile head/usr.sbin/lpr/Makefile.inc head/usr.sbin/mailwrapper/Makefile head/usr.sbin/mtest/Makefile head/usr.sbin/newsyslog/Makefile head/usr.sbin/ngctl/Makefile head/usr.sbin/ntp/Makefile.inc head/usr.sbin/ntp/doc/Makefile head/usr.sbin/ntp/ntp-keygen/Makefile head/usr.sbin/ntp/ntpd/Makefile head/usr.sbin/ppp/Makefile head/usr.sbin/rpcbind/Makefile head/usr.sbin/sa/Makefile head/usr.sbin/sendmail/Makefile head/usr.sbin/syslogd/Makefile head/usr.sbin/tcpdchk/Makefile head/usr.sbin/tcpdmatch/Makefile head/usr.sbin/tcpdump/tcpdump/Makefile head/usr.sbin/trpt/Makefile head/usr.sbin/tzsetup/Makefile head/usr.sbin/wpa/hostapd/Makefile head/usr.sbin/wpa/wpa_supplicant/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue May 6 04:21:48 2014 (r265419) +++ head/Makefile.inc1 Tue May 6 04:22:01 2014 (r265420) @@ -45,7 +45,7 @@ .error "Both TARGET and TARGET_ARCH must be defined." .endif -.include +.include .include .include @@ -1808,7 +1808,7 @@ check-old: check-old-files check-old-lib # showconfig - show build configuration. # showconfig: - @${MAKE} -n -f bsd.own.mk -V dummy -dg1 2>&1 | grep ^MK_ | sort + @${MAKE} -n -f src.opts.mk -V dummy -dg1 2>&1 | grep ^MK_ | sort .if !empty(KRNLOBJDIR) && !empty(KERNCONF) DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/ Modified: head/bin/Makefile ============================================================================== --- head/bin/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/bin/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # From: @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ -.include +.include SUBDIR= cat \ chflags \ Modified: head/bin/Makefile.inc ============================================================================== --- head/bin/Makefile.inc Tue May 6 04:21:48 2014 (r265419) +++ head/bin/Makefile.inc Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # @(#)Makefile.inc 8.1 (Berkeley) 5/31/93 # $FreeBSD$ -.include +.include BINDIR?= /bin WARNS?= 6 Modified: head/bin/csh/Makefile ============================================================================== --- head/bin/csh/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/bin/csh/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -6,7 +6,7 @@ # # To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile. -.include +.include TCSHDIR= ${.CURDIR}/../../contrib/tcsh .PATH: ${TCSHDIR} Modified: head/bin/date/Makefile ============================================================================== --- head/bin/date/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/bin/date/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ -.include +.include PROG= date SRCS= date.c netdate.c vary.c Modified: head/bin/ed/Makefile ============================================================================== --- head/bin/ed/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/bin/ed/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include PROG= ed SRCS= buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c Modified: head/bin/ls/Makefile ============================================================================== --- head/bin/ls/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/bin/ls/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/2/93 # $FreeBSD$ -.include +.include PROG= ls SRCS= cmp.c ls.c print.c util.c Modified: head/bin/mv/Makefile ============================================================================== --- head/bin/mv/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/bin/mv/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # @(#)Makefile 8.2 (Berkeley) 4/2/94 # $FreeBSD$ -.include +.include PROG= mv Modified: head/bin/pax/Makefile ============================================================================== --- head/bin/pax/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/bin/pax/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ -.include +.include # To install on versions prior to BSD 4.4 the following may have to be # defined with CFLAGS += Modified: head/bin/pkill/Makefile ============================================================================== --- head/bin/pkill/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/bin/pkill/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # $NetBSD: Makefile,v 1.1 2002/03/01 11:21:58 ad Exp $ # $FreeBSD$ -.include +.include PROG= pkill Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/bin/sh/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # @(#)Makefile 8.4 (Berkeley) 5/5/95 # $FreeBSD$ -.include +.include PROG= sh INSTALLFLAGS= -S Modified: head/bin/test/Makefile ============================================================================== --- head/bin/test/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/bin/test/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ -.include +.include PROG= test LINKS= ${BINDIR}/test ${BINDIR}/[ Modified: head/cddl/Makefile ============================================================================== --- head/cddl/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/cddl/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include SUBDIR= lib sbin usr.bin usr.sbin Modified: head/cddl/lib/Makefile ============================================================================== --- head/cddl/lib/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/cddl/lib/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include SUBDIR= ${_drti} \ libavl \ Modified: head/cddl/sbin/Makefile ============================================================================== --- head/cddl/sbin/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/cddl/sbin/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include SUBDIR= ${_tests} ${_zfs} ${_zpool} Modified: head/cddl/usr.bin/Makefile ============================================================================== --- head/cddl/usr.bin/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/cddl/usr.bin/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include SUBDIR= \ ctfconvert \ Modified: head/cddl/usr.sbin/Makefile ============================================================================== --- head/cddl/usr.sbin/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/cddl/usr.sbin/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include SUBDIR= ${_dtrace} \ ${_dtruss} \ Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/etc/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # from: @(#)Makefile 5.11 (Berkeley) 5/21/91 # $FreeBSD$ -.include +.include .if ${MK_SENDMAIL} != "no" SUBDIR= sendmail Modified: head/etc/mtree/Makefile ============================================================================== --- head/etc/mtree/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/etc/mtree/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include FILES= ${_BSD.debug.dist} \ BSD.include.dist \ Modified: head/etc/periodic/daily/Makefile ============================================================================== --- head/etc/periodic/daily/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/etc/periodic/daily/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include FILES= 100.clean-disks \ 110.clean-tmps \ Modified: head/etc/periodic/monthly/Makefile ============================================================================== --- head/etc/periodic/monthly/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/etc/periodic/monthly/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include FILES= 450.status-security \ 999.local Modified: head/etc/periodic/security/Makefile ============================================================================== --- head/etc/periodic/security/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/etc/periodic/security/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include FILES= 100.chksetuid \ 110.neggrpperm \ Modified: head/etc/periodic/weekly/Makefile ============================================================================== --- head/etc/periodic/weekly/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/etc/periodic/weekly/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include FILES= 340.noid \ 450.status-security \ Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/etc/rc.d/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include FILES= DAEMON \ FILESYSTEMS \ Modified: head/games/Makefile ============================================================================== --- head/games/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/games/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include SUBDIR= \ bcd \ Modified: head/games/factor/Makefile ============================================================================== --- head/games/factor/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/games/factor/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ -.include +.include PROG= factor SRCS= factor.c pr_tbl.c Modified: head/gnu/Makefile ============================================================================== --- head/gnu/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # @(#)Makefile 5.33.1.1 (Berkeley) 5/6/91 # $FreeBSD$ -.include +.include SUBDIR= lib ${_tests} usr.bin Modified: head/gnu/lib/Makefile ============================================================================== --- head/gnu/lib/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/lib/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include SUBDIR= csu libgcc libgcov libdialog libgomp libregex libreadline Modified: head/gnu/lib/csu/Makefile ============================================================================== --- head/gnu/lib/csu/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/lib/csu/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include MK_SSP= no GCCDIR= ${.CURDIR}/../../../contrib/gcc Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/lib/libgcc/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -6,7 +6,7 @@ GCCLIB= ${.CURDIR}/../../../contrib/gccl SHLIB_NAME= libgcc_s.so.1 SHLIBDIR?= /lib -.include +.include # # libgcc is linked in last and thus cannot depend on ssp symbols coming # from earlier libraries. Disable stack protection for this library. Modified: head/gnu/lib/libgcov/Makefile ============================================================================== --- head/gnu/lib/libgcov/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/lib/libgcov/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -3,7 +3,7 @@ MK_PROFILE= no MK_SSP= no -.include +.include .include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt" GCCDIR= ${.CURDIR}/../../../contrib/gcc Modified: head/gnu/lib/libstdc++/Makefile ============================================================================== --- head/gnu/lib/libstdc++/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/lib/libstdc++/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include GCCVER= 4.2 GCCDIR= ${.CURDIR}/../../../contrib/gcc Modified: head/gnu/lib/libsupc++/Makefile ============================================================================== --- head/gnu/lib/libsupc++/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/lib/libsupc++/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include GCCVER= 4.2 GCCDIR= ${.CURDIR}/../../../contrib/gcc Modified: head/gnu/usr.bin/Makefile ============================================================================== --- head/gnu/usr.bin/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/usr.bin/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include SUBDIR= ${_binutils} \ ${_cc} \ Modified: head/gnu/usr.bin/binutils/as/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/as/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/usr.bin/binutils/as/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -4,7 +4,7 @@ # BINDIR .include "${.CURDIR}/../../Makefile.inc" .include "${.CURDIR}/../Makefile.inc0" -.include +.include .PATH: ${SRCDIR}/gas ${SRCDIR}/gas/config Modified: head/gnu/usr.bin/binutils/ld/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/ld/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/usr.bin/binutils/ld/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # $FreeBSD$ .include "../Makefile.inc0" -.include +.include .PATH: ${SRCDIR}/ld Modified: head/gnu/usr.bin/cc/Makefile ============================================================================== --- head/gnu/usr.bin/cc/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/usr.bin/cc/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include # The order of some of these are rather important. Some depend on previous # subdirs. Modified: head/gnu/usr.bin/cc/Makefile.inc ============================================================================== --- head/gnu/usr.bin/cc/Makefile.inc Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/usr.bin/cc/Makefile.inc Tue May 6 04:22:01 2014 (r265420) @@ -1,5 +1,6 @@ # $FreeBSD$ +.include .include "../Makefile.inc" # Sometimes this is .include'd several times... Modified: head/gnu/usr.bin/cc/c++/Makefile ============================================================================== --- head/gnu/usr.bin/cc/c++/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/usr.bin/cc/c++/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # $FreeBSD$ MAN= -.include +.include .include "../Makefile.inc" .include "../Makefile.fe" Modified: head/gnu/usr.bin/cc/cc/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/usr.bin/cc/cc/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include .include "../Makefile.inc" .include "../Makefile.fe" Modified: head/gnu/usr.bin/cc/cc1/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc1/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/usr.bin/cc/cc1/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # $FreeBSD$ MAN= -.include +.include .include "../Makefile.inc" Modified: head/gnu/usr.bin/cc/cc1plus/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc1plus/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/usr.bin/cc/cc1plus/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # $FreeBSD$ MAN= -.include +.include .include "../Makefile.inc" Modified: head/gnu/usr.bin/cc/cc_tools/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/usr.bin/cc/cc_tools/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include CFLAGS+= -I. Modified: head/gnu/usr.bin/cc/cpp/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cpp/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/usr.bin/cc/cpp/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include .include "../Makefile.inc" .include "../Makefile.fe" Modified: head/gnu/usr.bin/dialog/Makefile ============================================================================== --- head/gnu/usr.bin/dialog/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/usr.bin/dialog/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -10,7 +10,7 @@ CFLAGS+= -I${.CURDIR} -I${DIALOG} WARNS?= 6 -.include +.include .if ${MK_NCURSESW} == "no" DPADD+= ${LIBNCURSES} Modified: head/gnu/usr.bin/grep/Makefile ============================================================================== --- head/gnu/usr.bin/grep/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/gnu/usr.bin/grep/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include GREP_LIBZ=YES Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/include/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -3,7 +3,7 @@ # # Doing a "make install" builds /usr/include. -.include +.include CLEANFILES= osreldate.h version vers.c SUBDIR= arpa gssapi protocols rpcsvc rpc xlocale Modified: head/include/arpa/Makefile ============================================================================== --- head/include/arpa/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/include/arpa/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include NO_OBJ= INCS= ftp.h inet.h nameser.h nameser_compat.h tftp.h Modified: head/kerberos5/Makefile.inc ============================================================================== --- head/kerberos5/Makefile.inc Tue May 6 04:21:48 2014 (r265419) +++ head/kerberos5/Makefile.inc Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include NO_LINT= Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -.include +.include # To satisfy shared library or ELF linkage when only the libraries being # built are visible: Modified: head/lib/atf/Makefile ============================================================================== --- head/lib/atf/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/atf/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -25,7 +25,7 @@ # # $FreeBSD$ -.include +.include SUBDIR= libatf-c \ libatf-c++ \ Modified: head/lib/atf/libatf-c++/Makefile ============================================================================== --- head/lib/atf/libatf-c++/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/atf/libatf-c++/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -25,6 +25,7 @@ # # $FreeBSD$ +.include .include LIB= atf-c++ Modified: head/lib/atf/libatf-c/Makefile ============================================================================== --- head/lib/atf/libatf-c/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/atf/libatf-c/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -25,6 +25,7 @@ # # $FreeBSD$ +.include .include LIB= atf-c Modified: head/lib/clang/Makefile ============================================================================== --- head/lib/clang/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/clang/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include .if !make(install) .if !defined(EARLY_BUILD) Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Tue May 6 04:21:48 2014 (r265419) +++ head/lib/clang/clang.build.mk Tue May 6 04:22:01 2014 (r265420) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + CLANG_SRCS= ${LLVM_SRCS}/tools/clang CFLAGS+= -I${LLVM_SRCS}/include -I${CLANG_SRCS}/include \ Modified: head/lib/clang/libllvmanalysis/Makefile ============================================================================== --- head/lib/clang/libllvmanalysis/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/clang/libllvmanalysis/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include LIB= llvmanalysis Modified: head/lib/clang/libllvmipa/Makefile ============================================================================== --- head/lib/clang/libllvmipa/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/clang/libllvmipa/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include LIB= llvmipa Modified: head/lib/clang/libllvmipo/Makefile ============================================================================== --- head/lib/clang/libllvmipo/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/clang/libllvmipo/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include LIB= llvmipo Modified: head/lib/clang/libllvmmc/Makefile ============================================================================== --- head/lib/clang/libllvmmc/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/clang/libllvmmc/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include LIB= llvmmc Modified: head/lib/clang/libllvmscalaropts/Makefile ============================================================================== --- head/lib/clang/libllvmscalaropts/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/clang/libllvmscalaropts/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include LIB= llvmscalaropts Modified: head/lib/clang/libllvmsupport/Makefile ============================================================================== --- head/lib/clang/libllvmsupport/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/clang/libllvmsupport/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include LIB= llvmsupport Modified: head/lib/clang/libllvmtransformutils/Makefile ============================================================================== --- head/lib/clang/libllvmtransformutils/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/clang/libllvmtransformutils/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include LIB= llvmtransformutils Modified: head/lib/clang/libllvmx86disassembler/Makefile ============================================================================== --- head/lib/clang/libllvmx86disassembler/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/clang/libllvmx86disassembler/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include LIB= llvmx86disassembler Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libarchive/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,5 +1,5 @@ # $FreeBSD$ -.include +.include LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive Modified: head/lib/libbsnmp/libbsnmp/Makefile ============================================================================== --- head/lib/libbsnmp/libbsnmp/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libbsnmp/libbsnmp/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -2,7 +2,7 @@ # # Author: Harti Brandt -.include +.include CONTRIB= ${.CURDIR}/../../../contrib/bsnmp/lib .PATH: ${CONTRIB} Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libc/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -3,7 +3,7 @@ SHLIBDIR?= /lib -.include +.include LIBC_SRCTOP?= ${.CURDIR} Modified: head/lib/libc_nonshared/Makefile ============================================================================== --- head/lib/libc_nonshared/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libc_nonshared/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -5,7 +5,7 @@ # compile modes. # bsd.lib.mk doesn't have an easy way to express that. MK_PROFILE?=no -.include +.include NO_PIC= # -fpic on some platforms, -fPIC on others. CFLAGS+=${PICFLAG} -DPIC -fvisibility=hidden Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libcompiler_rt/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include LIB= compiler_rt NO_PIC= Modified: head/lib/libcrypt/Makefile ============================================================================== --- head/lib/libcrypt/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libcrypt/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -4,7 +4,7 @@ SHLIBDIR?= /lib -.include +.include SHLIB_MAJOR= 5 LIB= crypt Modified: head/lib/libfetch/Makefile ============================================================================== --- head/lib/libfetch/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libfetch/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include LIB= fetch CFLAGS+= -I. Modified: head/lib/libipsec/Makefile ============================================================================== --- head/lib/libipsec/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libipsec/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -29,7 +29,7 @@ SHLIBDIR?= /lib -.include +.include LIB= ipsec SHLIB_MAJOR= 4 Modified: head/lib/libkiconv/Makefile ============================================================================== --- head/lib/libkiconv/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libkiconv/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -2,7 +2,7 @@ SHLIBDIR?= /lib -.include +.include LIB= kiconv SRCS= kiconv_sysctl.c xlat16_iconv.c xlat16_sysctl.c Modified: head/lib/libmilter/Makefile ============================================================================== --- head/lib/libmilter/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libmilter/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail .PATH: ${SENDMAIL_DIR}/libmilter ${SENDMAIL_DIR}/libsm Modified: head/lib/libpam/modules/modules.inc ============================================================================== --- head/lib/libpam/modules/modules.inc Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libpam/modules/modules.inc Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include MODULES = MODULES += pam_chroot Modified: head/lib/libpam/modules/pam_unix/Makefile ============================================================================== --- head/lib/libpam/modules/pam_unix/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libpam/modules/pam_unix/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -34,6 +34,7 @@ # # $FreeBSD$ +.include .include LIB= pam_unix Modified: head/lib/libpcap/Makefile ============================================================================== --- head/lib/libpcap/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libpcap/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -3,7 +3,7 @@ SHLIBDIR?= /lib -.include +.include LIB= pcap SRCS= grammar.y tokdefs.h version.h pcap-bpf.c \ Modified: head/lib/libproc/Makefile ============================================================================== --- head/lib/libproc/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libproc/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include LIB= proc Modified: head/lib/libprocstat/Makefile ============================================================================== --- head/lib/libprocstat/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libprocstat/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include LIB= procstat Modified: head/lib/libradius/Makefile ============================================================================== --- head/lib/libradius/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libradius/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -24,7 +24,7 @@ # # $FreeBSD$ -.include +.include LIB= radius SRCS= radlib.c Modified: head/lib/librpcsvc/Makefile ============================================================================== --- head/lib/librpcsvc/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/librpcsvc/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # from: @(#)Makefile 5.10 (Berkeley) 6/24/90 # $FreeBSD$ -.include +.include .PATH: ${.CURDIR}/../../include/rpcsvc Modified: head/lib/libsm/Makefile ============================================================================== --- head/lib/libsm/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libsm/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail .PATH: ${SENDMAIL_DIR}/libsm Modified: head/lib/libsmb/Makefile ============================================================================== --- head/lib/libsmb/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libsmb/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include CONTRIBDIR= ${.CURDIR}/../../contrib/smbfs .PATH: ${CONTRIBDIR}/lib/smb Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libstand/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -9,7 +9,7 @@ MK_PROFILE= no MK_SSP= no -.include +.include LIB= stand NO_PIC= Modified: head/lib/libtelnet/Makefile ============================================================================== --- head/lib/libtelnet/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libtelnet/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # From: @(#)Makefile 8.2 (Berkeley) 12/15/93 # $FreeBSD$ -.include +.include TELNETDIR= ${.CURDIR}/../../contrib/telnet .PATH: ${TELNETDIR}/libtelnet Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libthr/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -10,7 +10,7 @@ SHLIBDIR?= /lib -.include +.include MK_SSP= no LIB=thr Modified: head/lib/libulog/Makefile ============================================================================== --- head/lib/libulog/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libulog/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -2,7 +2,7 @@ SHLIBDIR?=/lib -.include +.include LIB= ulog SHLIB_MAJOR= 0 Modified: head/lib/libutil/Makefile ============================================================================== --- head/lib/libutil/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libutil/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -3,7 +3,7 @@ SHLIBDIR?= /lib -.include +.include LIB= util SHLIB_MAJOR= 9 Modified: head/lib/libwrap/Makefile ============================================================================== --- head/lib/libwrap/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/libwrap/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -2,7 +2,7 @@ # $FreeBSD$ # -.include +.include LIB= wrap SHLIB_MAJOR= 6 Modified: head/lib/ncurses/Makefile ============================================================================== --- head/lib/ncurses/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/ncurses/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include SUBDIR= ncurses form menu panel Modified: head/lib/ncurses/ncurses/Makefile ============================================================================== --- head/lib/ncurses/ncurses/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/lib/ncurses/ncurses/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -7,7 +7,7 @@ SHLIBDIR?= /lib MK_MAN=no .endif -.include +.include .include "${.CURDIR}/../config.mk" Modified: head/libexec/Makefile ============================================================================== --- head/libexec/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/libexec/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -.include +.include SUBDIR= ${_atf} \ ${_atrun} \ Modified: head/libexec/atf/atf-check/Makefile ============================================================================== --- head/libexec/atf/atf-check/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/libexec/atf/atf-check/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -25,6 +25,7 @@ # # $FreeBSD$ +.include .include ATF= ${.CURDIR:H:H:H}/contrib/atf Modified: head/libexec/ftpd/Makefile ============================================================================== --- head/libexec/ftpd/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/libexec/ftpd/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # @(#)Makefile 8.2 (Berkeley) 4/4/94 # $FreeBSD$ -.include +.include PROG= ftpd MAN= ftpd.8 ftpchroot.5 Modified: head/libexec/rlogind/Makefile ============================================================================== --- head/libexec/rlogind/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/libexec/rlogind/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -.include +.include PROG= rlogind MAN= rlogind.8 Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Tue May 6 04:21:48 2014 (r265419) +++ head/libexec/rtld-elf/Makefile Tue May 6 04:22:01 2014 (r265420) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include MK_SSP= no *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue May 6 04:22:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3D77E9C; Tue, 6 May 2014 04:22:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A41CED5B; Tue, 6 May 2014 04:22:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s464MUYT066053; Tue, 6 May 2014 04:22:30 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s464MU7J066051; Tue, 6 May 2014 04:22:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405060422.s464MU7J066051@svn.freebsd.org> From: Warner Losh Date: Tue, 6 May 2014 04:22:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265422 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 04:22:30 -0000 Author: imp Date: Tue May 6 04:22:29 2014 New Revision: 265422 URL: http://svnweb.freebsd.org/changeset/base/265422 Log: Document src.opts.mk changes and the decoupling of /etc/src.conf from anything but the source tree. Modified: head/Makefile.inc1 head/UPDATING Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue May 6 04:22:06 2014 (r265421) +++ head/Makefile.inc1 Tue May 6 04:22:29 2014 (r265422) @@ -45,7 +45,7 @@ .error "Both TARGET and TARGET_ARCH must be defined." .endif -.include +.include "share/mk/src.opts.mk" .include .include Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue May 6 04:22:06 2014 (r265421) +++ head/UPDATING Tue May 6 04:22:29 2014 (r265422) @@ -12,9 +12,9 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. NOTE: FreeBSD has switched from gcc to clang. If you have trouble bootstrapping -from older versions of FreeBSD, try WITHOUT_CLANG to bootstrap to the tip of -head, and then rebuild without this option. The bootstrap process from -older version of current is a bit fragile. +from older versions of FreeBSD, try WITHOUT_CLANG and WITH_GCC to bootstrap to +the tip of head, and then rebuild without this option. The bootstrap process from +older version of current accorss the gcc/clang cutover is a bit fragile. NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW: FreeBSD 11.x has many debugging features turned on, in both the kernel @@ -31,6 +31,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20140505: + /etc/src.conf now affects only builds of the FreeBSD src tree. In the + past, it affected all builds that used the bsd.*.mk files. The old + behavior was a bug, but people may have relied upon it. To get this + behavior back, you can .include /etc/src.conf from /etc/make.conf + (which is still global and isn't changed). This also changes the + behavior of incremental builds inside the tree of individual + directories. Set MAKESYSPATH to ".../share/mk" to do that. + Although this has survived make universe and some upgrade scenarios, + other upgrade scenarios may have broken. + 20140430: The lindev device has been removed since /dev/full has been made a standard device. __FreeBSD_version has been bumped. From owner-svn-src-head@FreeBSD.ORG Tue May 6 04:22:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D97FFD8; Tue, 6 May 2014 04:22:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEB3CD5F; Tue, 6 May 2014 04:22:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s464McEc066119; Tue, 6 May 2014 04:22:38 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s464Mb2h066111; Tue, 6 May 2014 04:22:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405060422.s464Mb2h066111@svn.freebsd.org> From: Warner Losh Date: Tue, 6 May 2014 04:22:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265423 - in head: . share/mk usr.bin usr.bin/bmake usr.bin/make X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 04:22:39 -0000 Author: imp Date: Tue May 6 04:22:37 2014 New Revision: 265423 URL: http://svnweb.freebsd.org/changeset/base/265423 Log: Remove support for WITHOUT_BMAKE. bmake is now the only make that can build world, so it is the only make we build or install. fmake is still in the tree, but disconnected, and upgrades from older systems that still have bmake has not been removed, but its state has not been tested (it should work given how minimal the work to upgrade to bmake is). Modified: head/Makefile head/share/mk/src.opts.mk head/usr.bin/Makefile head/usr.bin/bmake/Makefile.inc head/usr.bin/make/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Tue May 6 04:22:29 2014 (r265422) +++ head/Makefile Tue May 6 04:22:37 2014 (r265423) @@ -139,11 +139,7 @@ _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH # Choices add to complexity though. # We cannot blindly use a make which may not be the one we want # so be exlicit - until all choice is removed. -.if !defined(WITHOUT_BMAKE) WANT_MAKE= bmake -.else -WANT_MAKE= fmake -.endif MYMAKE= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}/${WANT_MAKE} .if defined(.PARSEDIR) HAVE_MAKE= bmake @@ -152,7 +148,7 @@ HAVE_MAKE= fmake .endif .if exists(${MYMAKE}) SUB_MAKE:= ${MYMAKE} -m ${.CURDIR}/share/mk -.elif ${WANT_MAKE} != ${HAVE_MAKE} || ${WANT_MAKE} != "bmake" +.elif ${WANT_MAKE} != ${HAVE_MAKE} # It may not exist yet but we may cause it to. # In the case of fmake, upgrade_checks may cause a newer version to be built. SUB_MAKE= `test -x ${MYMAKE} && echo ${MYMAKE} || echo ${MAKE}` \ Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue May 6 04:22:29 2014 (r265422) +++ head/share/mk/src.opts.mk Tue May 6 04:22:37 2014 (r265423) @@ -65,7 +65,6 @@ __DEFAULT_YES_OPTIONS = \ BINUTILS \ BINUTILS_BOOTSTRAP \ BLUETOOTH \ - BMAKE \ BOOT \ BSD_CPIO \ BSNMP \ Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Tue May 6 04:22:29 2014 (r265422) +++ head/usr.bin/Makefile Tue May 6 04:22:37 2014 (r265423) @@ -279,11 +279,7 @@ SUBDIR+= msgs .endif .if ${MK_MAKE} != "no" -.if ${MK_BMAKE} != "no" SUBDIR+= bmake -.else -SUBDIR+= make -.endif .endif .if ${MK_MAN_UTILS} != "no" Modified: head/usr.bin/bmake/Makefile.inc ============================================================================== --- head/usr.bin/bmake/Makefile.inc Tue May 6 04:22:29 2014 (r265422) +++ head/usr.bin/bmake/Makefile.inc Tue May 6 04:22:37 2014 (r265423) @@ -7,15 +7,7 @@ .export SRCTOP .endif -# Sadly, we cannot assume src.opts.mk did its job, -# nor can we safely include the one we want -.if !defined(WITHOUT_BMAKE) -MK_BMAKE= yes -.endif - -.if defined(MK_BMAKE) && ${MK_BMAKE} != "no" PROG= make -.endif .if !defined(MK_SHARED_TOOLCHAIN) || ${MK_SHARED_TOOLCHAIN} == "no" NO_SHARED?= YES Modified: head/usr.bin/make/Makefile ============================================================================== --- head/usr.bin/make/Makefile Tue May 6 04:22:29 2014 (r265422) +++ head/usr.bin/make/Makefile Tue May 6 04:22:37 2014 (r265423) @@ -111,12 +111,10 @@ CFLAGS+= -DDEFSHELLNAME=\"${MAKE_SHELL}\ .error "MAKE_SHELL must be set to one of \"csh\", \"sh\" or \"ksh\"." .endif -.if defined(MK_BMAKE) && ${MK_BMAKE} != "no" # if we are here we don't want this called 'make' PROG= fmake fmake.1: make.1 cp ${.ALLSRC} ${.TARGET} -.endif .if ${MK_TESTS} != "no" SUBDIR+= tests From owner-svn-src-head@FreeBSD.ORG Tue May 6 04:42:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66A2F729; Tue, 6 May 2014 04:42:14 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3ACEDEEA; Tue, 6 May 2014 04:42:13 +0000 (UTC) Received: from jre-mbp.elischer.org (ppp121-45-232-70.lns20.per1.internode.on.net [121.45.232.70]) (authenticated bits=0) by vps1.elischer.org (8.14.8/8.14.8) with ESMTP id s464g9aP000429 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 5 May 2014 21:42:12 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <5368681C.9020108@freebsd.org> Date: Tue, 06 May 2014 12:42:04 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Warner Losh , svn-src-head@freebsd.org Subject: Re: svn commit: r265419 - head/share/mk References: <201405060421.s464LnXl065686@svn.freebsd.org> In-Reply-To: <201405060421.s464LnXl065686@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 04:42:14 -0000 While you are wandering around in the Makefiles, I was wondering if you could estimate the amount of work to have the ability to specify the location of the build toolchain a bit better.. Currently it's $(OBJPREFIX)/$(.CURDIR)/tmp or something (different if cross compiling of course), but it'd be nice to be able to generate a crossbuild toolchain externally that can be used by other software.. It'd be really nice to be able to use our sources to generate an ARM crossbuild set that could then be used on third party software to make pi binaries for example. We have all this neat crossbuild capabilityin our source tree.. it's be truely spectacular if that was an exportable target. "make TARGET=ARM-pi crossbuildtools" which could be used with a given make,conf file to "just build" ARM-rpi binaries. At $JOB we currently we have a build env (which is incredibly broken but that another story) that expects to pull all includes, libs and tools from a certain place... I currently prepopulate it by doing make DESTDIR=$PLACE installworld. which is a bit of an overkill, but at least it works.. The toolchain set we use in buildworld would be about perfect to drop in there.. but "make toolchain && cp -pr /obj/...../tmp/* $PLACE" doesn't strike me as the most elegant way to do it.. J From owner-svn-src-head@FreeBSD.ORG Tue May 6 04:46:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6BFEC914; Tue, 6 May 2014 04:46:47 +0000 (UTC) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 189B2F47; Tue, 6 May 2014 04:46:46 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id C0573D44AFE; Tue, 6 May 2014 14:46:43 +1000 (EST) Date: Tue, 6 May 2014 14:46:43 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov Subject: Re: svn commit: r265367 - head/lib/libc/regex In-Reply-To: <5368162A.9000002@freebsd.org> Message-ID: <20140506135706.T1596@besplex.bde.org> References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> <5367EB54.1080109@FreeBSD.org> <3C7CFFB7-5C84-4AC1-9A81-C718D184E87B@FreeBSD.org> <7D7A417E-17C3-4001-8E79-0B57636A70E1@gmail.com> <536807D8.9000005@freebsd.org> <9349EAA9-F92C-4170-A1C0-2200FD490E5F@FreeBSD.org> <5368162A.9000002@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eojmkOZX c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=mAlE_CWfnZ8A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=tdNqX4nCuuD4MD8TwAQA:9 a=qahZVF4bb32W-GKS:21 a=-Li8O5LmJa_Gh2pa:21 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 Cc: src-committers , svn-src-all@freebsd.org, David Chisnall , Pedro Giffuni , svn-src-head@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 04:46:47 -0000 On Tue, 6 May 2014, Andrey Chernov wrote: > On 06.05.2014 2:12, David Chisnall wrote: >> On 5 May 2014, at 22:51, Andrey Chernov wrote: >> >>> For standard malloc/realloc interface it is up to the caller to check >>> n*size not overflows. You must trust caller already does such check. >> >> Do a search of the CVE database sometime to see how well placed that trust generally is. Or even look at the code in question, where none of the realloc() or malloc() calls does overflow checking. > > I know current situation and disagree with OpenBSD way to fix it. Public > interface assumes that caller should be trusted. Period. How well it is > really trusted is up to the caller and should be fixed in it clearly, > allowing human to trace the logic. > >>> Using calloc() to enforce it instead of caller is semantically wrong, >> >> Relying on a standard function to behave according to the standard is semantically wrong? The standard behaviour is undefined. It cannot be relied on. From C99 (n869.txt): % 7.20.3.1 The calloc function % % Synopsis % % [#1] % % #include % void *calloc(size_t nmemb, size_t size); % % Description % % [#2] The calloc function allocates space for an array of % nmemb objects, each of whose size is size. The space is % initialized to all bits zero.238) Oops, there is no object to begin with, so perhaps the behaviour is defined after all. This is unclear. It is also unclear if objects can have size too large to represent as a size_t. C99 says that sizeof(object) is the size in bytes of an object, but it also says that the value of sizeof() is implementation-defined. If the multiplication overflows, then it can be argued that the behaviour is undefined (because the object cannot exist since sizeof() is required to actually return the size), and it can be argued that the behaviour is defined in some cases even when the multiplication overflows (because sizeof() is only required to return an implementation-defined value like the actual size modulo SIZE_MAX; then the object might exist). calloc() may have been actually useful orginally to handle the weird second case. In K&R1, size_t didn't exist and whether sizeof() worked was even less clear than now. The type of sizeof() was "an integer". malloc() took an int arg IIRC. malloc() is not even in the index in K&R1. But objects of size larger than INT_MAX were useful, and it would be reasonable to ask for calloc() to allocate one. K&R1 has calloc() in the index and documents it as calloc(n, sizeof(object)), where n and sizeof() are apparently implicit-int. So calloc(16368, 2) should give an object of size 32768 if possible. sizeof(this) is then unrepresentable as a 16-bit int. I used arrays larger than 32768 quite often on 16-bit systems, but only with 16-bit unsigned size_t. > Yes. Generally it is using a function outside of its purpose. I.e. you > can use calloc() just to check n*size and nothing else (free() result > immediately afterwards) instead of writing just single check by > yourself. It will be legal usage but semantically wrong and misleading. > >>> and especially strange when the caller is standard C library under your >>> control. >> >> I don't follow this. If libc can't rely on standards conformance from itself then other code stands no chance. calloc() in FreeBSD is controlled too, but in 4.4BSD it just did the multiplication blindly. This was fixed (if it is a bug) in FreeBSD in 2002 (by tjr). The errno was the nondescript ENOMEM. Now, calloc() is sophisticated but the errno still seems to be ENOMEM. I think calloc() should check for overflow but callers shouldn't depend on this. In practice, the multiplication is less likely to overflow than malloc() is to fail, which "can't happen". You could limit the number of elements to something reasonable like 2**28 to ensure that the multiplication can't overflow with an element size of 8. The rare program that needs to support allocating more than 2**28 elements on 32-bit systems according to user input can be more careful. On 64-bit systems, you can use a less modest limit. Bruce From owner-svn-src-head@FreeBSD.ORG Tue May 6 06:18:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D75C7C9; Tue, 6 May 2014 06:18:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FEAF88F; Tue, 6 May 2014 06:18:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s466Ih2A016133; Tue, 6 May 2014 06:18:43 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s466Ihcb016132; Tue, 6 May 2014 06:18:43 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201405060618.s466Ihcb016132@svn.freebsd.org> From: "Kenneth D. Merry" Date: Tue, 6 May 2014 06:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265424 - head/sys/dev/mpr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 06:18:44 -0000 Author: ken Date: Tue May 6 06:18:43 2014 New Revision: 265424 URL: http://svnweb.freebsd.org/changeset/base/265424 Log: Fix a problem with async notifications in the mpr(4) driver. This problem only occurs on versions of FreeBSD prior to the recent CAM locking changes. (i.e. stable/9 and older versions of stable/10) This change should be a no-op for head and stable/10. If a path isn't specified, xpt_register_async() will create a fully wildcarded path and acquire a lock (the XPT lock in older versions, and via xpt_path_lock() in newer versions) to call xpt_action() for the XPT_SASYNC_CB CCB. It will then drop the lock and if the requested event includes AC_FOUND_DEVICE or AC_PATH_REGISTERED, it will get the caller up to date with any device arrivals or path registrations. The issue is that before the locking changes, each SIM lock would get acquired in turn during the EDT tree traversal process. If a path is specified for xpt_register_async(), it won't acquire and drop its own lock, but instead expects the caller to hold its own SIM lock. That works for the first part of xpt_register_async(), but causes a recursive lock acquisition once the EDT traversal happens and it comes to the SIM in question. And it isn't possible to call xpt_action() without holding a SIM lock. The locking changes fix this by using the XPT topology lock for EDT traversal, so it is no longer an issue to hold the SIM lock while calling xpt_register_async(). The solution for FreeBSD versions before the locking changes is to request notification of all device arrivals (so we pass a NULL path into xpt_register_async()) and then filter out the arrivals that are not ours. MFC After: 3 days Sponsored by: Spectra Logic Corporation Modified: head/sys/dev/mpr/mpr_sas.c Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Tue May 6 04:22:37 2014 (r265423) +++ head/sys/dev/mpr/mpr_sas.c Tue May 6 06:18:43 2014 (r265424) @@ -813,8 +813,49 @@ mpr_attach_sas(struct mpr_softc *sc) #else event = AC_FOUND_DEVICE; #endif + + /* + * Prior to the CAM locking improvements, we can't call + * xpt_register_async() with a particular path specified. + * + * If a path isn't specified, xpt_register_async() will + * generate a wildcard path and acquire the XPT lock while + * it calls xpt_action() to execute the XPT_SASYNC_CB CCB. + * It will then drop the XPT lock once that is done. + * + * If a path is specified for xpt_register_async(), it will + * not acquire and drop the XPT lock around the call to + * xpt_action(). xpt_action() asserts that the caller + * holds the SIM lock, so the SIM lock has to be held when + * calling xpt_register_async() when the path is specified. + * + * But xpt_register_async calls xpt_for_all_devices(), + * which calls xptbustraverse(), which will acquire each + * SIM lock. When it traverses our particular bus, it will + * necessarily acquire the SIM lock, which will lead to a + * recursive lock acquisition. + * + * The CAM locking changes fix this problem by acquiring + * the XPT topology lock around bus traversal in + * xptbustraverse(), so the caller can hold the SIM lock + * and it does not cause a recursive lock acquisition. + * + * These __FreeBSD_version values are approximate, especially + * for stable/10, which is two months later than the actual + * change. + */ + +#if (__FreeBSD_version < 1000703) || \ + ((__FreeBSD_version >= 1100000) && (__FreeBSD_version < 1100002)) + mpr_unlock(sc); + status = xpt_register_async(event, mprsas_async, sc, + NULL); + mpr_lock(sc); +#else status = xpt_register_async(event, mprsas_async, sc, sassc->path); +#endif + if (status != CAM_REQ_CMP) { mpr_dprint(sc, MPR_ERROR, "Error %#x registering async handler for " @@ -2988,6 +3029,18 @@ mprsas_async(void *callback_arg, uint32_ break; /* + * See the comment in mpr_attach_sas() for a detailed + * explanation. In these versions of FreeBSD we register + * for all events and filter out the events that don't + * apply to us. + */ +#if (__FreeBSD_version < 1000703) || \ + ((__FreeBSD_version >= 1100000) && (__FreeBSD_version < 1100002)) + if (xpt_path_path_id(path) != sassc->sim->path_id) + break; +#endif + + /* * We should have a handle for this, but check to make sure. */ KASSERT(xpt_path_target_id(path) < sassc->maxtargets, @@ -3044,8 +3097,21 @@ mprsas_async(void *callback_arg, uint32_ case AC_FOUND_DEVICE: { struct ccb_getdev *cgd; + /* + * See the comment in mpr_attach_sas() for a detailed + * explanation. In these versions of FreeBSD we register + * for all events and filter out the events that don't + * apply to us. + */ +#if (__FreeBSD_version < 1000703) || \ + ((__FreeBSD_version >= 1100000) && (__FreeBSD_version < 1100002)) + if (xpt_path_path_id(path) != sc->sassc->sim->path_id) + break; +#endif + cgd = arg; mprsas_prepare_ssu(sc, path, cgd); + #if (__FreeBSD_version < 901503) || \ ((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000006)) mprsas_check_eedp(sc, path, cgd); From owner-svn-src-head@FreeBSD.ORG Tue May 6 08:06:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 650E25EF; Tue, 6 May 2014 08:06:59 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 26DFE191; Tue, 6 May 2014 08:06:59 +0000 (UTC) Received: from [192.168.0.7] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s4686oSR039096 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 6 May 2014 08:06:52 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265367 - head/lib/libc/regex From: David Chisnall In-Reply-To: <20140506135706.T1596@besplex.bde.org> Date: Tue, 6 May 2014 09:06:45 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <0FCEDD3C-A512-4B83-A8C8-5A1B7A33AAF2@FreeBSD.org> References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> <5367EB54.1080109@FreeBSD.org> <3C7CFFB7-5C84-4AC1-9A81-C718D184E87B@FreeBSD.org> <7D7A417E-17C3-4001-8E79-0B57636A70E1@gmail.com> <536807D8.9000005@freebsd.org> <9349EAA9-F92C-4170-A1C0-2200FD490E5F@FreeBSD.org> <5368162A.9000002@freebsd.org> <20140506135706.T1596@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1874) Cc: src-committers , Andrey Chernov , svn-src-all@freebsd.org, Pedro Giffuni , svn-src-head@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 08:06:59 -0000 Bruce, On 6 May 2014, at 05:46, Bruce Evans wrote: > The standard behaviour is undefined. It cannot be relied on. =46rom = C99 > (n869.txt): >=20 > % 7.20.3.1 The calloc function > % % Synopsis > % % [#1] > % % #include > % void *calloc(size_t nmemb, size_t size); > % % Description > % % [#2] The calloc function allocates space for an array = of > % nmemb objects, each of whose size is size. The space is > % initialized to all bits zero.238) >=20 > Oops, there is no object to begin with, so perhaps the behaviour is > defined after all. This is unclear. =20 You're missing off the next line: > =95 3 The calloc function returns either a null pointer or a = pointer to the allocated space. Clarifications from WG14 have indicated that this means that calloc() = *must* return either NULL or enough space for nmemb objects of size = size. The text of the standard was not changed in C11 because it seemed = to be the consensus of library authors that this is obvious from the = existing text. See the CERT report from my previous email - in 2002 it = was regarded as a security hole (and a lack of standards conformance) if = your calloc did not do this and all known calloc implementations that = did not were fixed. Now, you can argue that either: - In this case, we can statically prove that the multiplication won't = overflow so we don't need a check, or - It is better to do the overflow check on the caller side and increase = i-cache usage to save some memory zeroing. But please don't try to argue that it is permitted for calloc() to not = correctly handle integer overflow. It is both non-conformant and = dangerous for it to fail to do so. > It is also unclear if objects > can have size too large to represent as a size_t That is implementation defined, however if sizeof(ptrdiff_t) <=3D = sizeof(size_t) then they can not because you must be able to represent = the difference between any two pointers as a ptrdiff_t[1]. If you want = to be pedantic, _Static_assert(sizeof(ptrdiff_t) <=3D sizeof(size_t), = "Unsupported platform!") to make sure you catch it at compile time if = this might change. =20 David [1] This also means, on our platforms, that the maximum size of an = object must be one byte less than the total size of the address space, = as C only defines pointer comparisons between valid pointers to the same = object and allows pointers to be one element past the end of an array. From owner-svn-src-head@FreeBSD.ORG Tue May 6 09:12:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13EE4EF7; Tue, 6 May 2014 09:12:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00B04930; Tue, 6 May 2014 09:12:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s469CWqW097392; Tue, 6 May 2014 09:12:32 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s469CWnZ097391; Tue, 6 May 2014 09:12:32 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405060912.s469CWnZ097391@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 6 May 2014 09:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265427 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 09:12:33 -0000 Author: hselasky Date: Tue May 6 09:12:32 2014 New Revision: 265427 URL: http://svnweb.freebsd.org/changeset/base/265427 Log: Reduce the number of interrupts in USB host mode for the DWC OTG controller driver by piggybacking the SOF interrupt when issuing new and checking old transfers. Number of interrupts was reduced by 30% when doing Isochronous transfers. Use correct GINTMSK_XXX macros when accessing the DWC OTG interrupt mask register. Add code to adjust the frame interval register which influences the SOF rate. MFC after: 2 weeks Modified: head/sys/dev/usb/controller/dwc_otg.c Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Tue May 6 07:21:50 2014 (r265426) +++ head/sys/dev/usb/controller/dwc_otg.c Tue May 6 09:12:32 2014 (r265427) @@ -93,15 +93,13 @@ DWC_OTG_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus) #define DWC_OTG_MSK_GINT_ENABLED \ - (GINTSTS_ENUMDONE | \ - GINTSTS_USBRST | \ - GINTSTS_USBSUSP | \ - GINTSTS_IEPINT | \ - GINTSTS_RXFLVL | \ - GINTSTS_SESSREQINT | \ + (GINTMSK_ENUMDONEMSK | \ + GINTMSK_USBRSTMSK | \ + GINTMSK_USBSUSPMSK | \ + GINTMSK_IEPINTMSK | \ + GINTMSK_SESSREQINTMSK | \ GINTMSK_OTGINTMSK | \ - GINTMSK_HCHINTMSK | \ - GINTSTS_PRTINT) + GINTMSK_PRTINTMSK) static int dwc_otg_use_hsic; @@ -222,8 +220,8 @@ dwc_otg_init_fifo(struct dwc_otg_softc * tx_start += fifo_size; for (x = 0; x != sc->sc_host_ch_max; x++) { - /* enable all needed interrupts */ - DWC_OTG_WRITE_4(sc, DOTG_HCINTMSK(x), HCINT_DEFAULT_MASK); + /* disable all host interrupts */ + DWC_OTG_WRITE_4(sc, DOTG_HCINTMSK(x), 0); } DWC_OTG_WRITE_4(sc, DOTG_HPTXFSIZ, @@ -233,9 +231,8 @@ dwc_otg_init_fifo(struct dwc_otg_softc * /* store maximum TX FIFO size */ sc->sc_tx_max_size = fifo_size; - /* enable host channel interrupts */ - DWC_OTG_WRITE_4(sc, DOTG_HAINTMSK, - (1U << sc->sc_host_ch_max) - 1U); + /* disable all host channel interrupts */ + DWC_OTG_WRITE_4(sc, DOTG_HAINTMSK, 0); } if (mode == DWC_MODE_DEVICE) { @@ -324,6 +321,36 @@ dwc_otg_init_fifo(struct dwc_otg_softc * } static void +dwc_otg_update_host_frame_interval(struct dwc_otg_softc *sc) +{ + uint32_t temp; + + /* setup HOST frame interval register, based on existing value */ + temp = DWC_OTG_READ_4(sc, DOTG_HFIR) & HFIR_FRINT_MASK; + if (temp >= 10000) + temp /= 1000; + else + temp /= 125; + + /* figure out nearest X-tal value */ + if (temp >= 54) + temp = 60; /* MHz */ + else if (temp >= 39) + temp = 48; /* MHz */ + else + temp = 30; /* MHz */ + + if (sc->sc_flags.status_high_speed) + temp *= 125; + else + temp *= 1000; + + DPRINTF("HFIR=0x%08x\n", temp); + + DWC_OTG_WRITE_4(sc, DOTG_HFIR, temp); +} + +static void dwc_otg_clocks_on(struct dwc_otg_softc *sc) { if (sc->sc_flags.clocks_off && @@ -386,7 +413,9 @@ dwc_otg_pull_down(struct dwc_otg_softc * static void dwc_otg_enable_sof_irq(struct dwc_otg_softc *sc) { - if (sc->sc_irq_mask & GINTMSK_SOFMSK) + /* In device mode we don't use the SOF interrupt */ + if (sc->sc_flags.status_device_mode != 0 || + (sc->sc_irq_mask & GINTMSK_SOFMSK) != 0) return; sc->sc_irq_mask |= GINTMSK_SOFMSK; DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); @@ -405,8 +434,8 @@ dwc_otg_resume_irq(struct dwc_otg_softc * Disable resume interrupt and enable suspend * interrupt: */ - sc->sc_irq_mask &= ~GINTSTS_WKUPINT; - sc->sc_irq_mask |= GINTSTS_USBSUSP; + sc->sc_irq_mask &= ~GINTMSK_WKUPINTMSK; + sc->sc_irq_mask |= GINTMSK_USBSUSPMSK; DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); } @@ -428,8 +457,8 @@ dwc_otg_suspend_irq(struct dwc_otg_softc * Disable suspend interrupt and enable resume * interrupt: */ - sc->sc_irq_mask &= ~GINTSTS_USBSUSP; - sc->sc_irq_mask |= GINTSTS_WKUPINT; + sc->sc_irq_mask &= ~GINTMSK_USBSUSPMSK; + sc->sc_irq_mask |= GINTMSK_WKUPINTMSK; DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); } @@ -503,9 +532,11 @@ dwc_otg_common_rx_ack(struct dwc_otg_sof { DPRINTFN(5, "RX status clear\n"); - /* enable RX FIFO level interrupt */ - sc->sc_irq_mask |= GINTSTS_RXFLVL; - DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); + if (sc->sc_flags.status_device_mode != 0) { + /* enable RX FIFO level interrupt */ + sc->sc_irq_mask |= GINTMSK_RXFLVLMSK; + DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); + } /* clear cached status */ sc->sc_last_rx_status = 0; @@ -674,8 +705,6 @@ dwc_otg_host_channel_disable(struct dwc_ HCCHAR_CHENA | HCCHAR_CHDIS); /* don't re-use channel until next SOF is transmitted */ sc->sc_chan_state[x].wait_sof = 2; - /* enable SOF interrupt */ - dwc_otg_enable_sof_irq(sc); } } @@ -724,7 +753,7 @@ dwc_otg_host_setup_tx(struct dwc_otg_td uint32_t hcchar; if (dwc_otg_host_channel_alloc(td)) - return (1); /* busy */ + goto busy; /* get pointer to softc */ sc = DWC_OTG_PC2SC(td->pc); @@ -743,13 +772,13 @@ dwc_otg_host_setup_tx(struct dwc_otg_td DPRINTF("CH=%d STALL\n", td->channel); td->error_stall = 1; td->error_any = 1; - return (0); /* complete */ + goto complete; } else if (hcint & HCINT_ERRORS) { DPRINTF("CH=%d ERROR\n", td->channel); td->errcnt++; if (td->hcsplt != 0 || td->errcnt >= 3) { td->error_any = 1; - return (0); /* complete */ + goto complete; } } @@ -785,7 +814,7 @@ dwc_otg_host_setup_tx(struct dwc_otg_td td->remainder -= td->tx_bytes; td->toggle = 1; td->tt_scheduled = 0; - return (0); /* complete */ + goto complete; } break; @@ -823,7 +852,7 @@ dwc_otg_host_setup_tx(struct dwc_otg_td td->offset += td->tx_bytes; td->remainder -= td->tx_bytes; td->toggle = 1; - return (0); /* complete */ + goto complete; } break; @@ -835,12 +864,12 @@ dwc_otg_host_setup_tx(struct dwc_otg_td default: break; } - return (1); /* busy */ + goto busy; send_pkt: if (sizeof(req) != td->remainder) { td->error_any = 1; - return (0); /* complete */ + goto complete; } if (td->hcsplt != 0) { @@ -880,7 +909,7 @@ send_pkt: /* store number of bytes transmitted */ td->tx_bytes = sizeof(req); - return (1); /* busy */ + goto busy; send_cpkt: /* Wait for our turn, if TT transfer */ @@ -906,15 +935,15 @@ send_cpkt: /* must enable channel before writing data to FIFO */ DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel), hcchar); - return (1); /* busy */ + goto busy; tt_wait: - /* enable SOF interrupt */ - dwc_otg_enable_sof_irq(sc); - /* free allocated channel */ dwc_otg_host_channel_free(td); +busy: return (1); /* busy */ +complete: + return (0); /* complete */ } static uint8_t @@ -1088,16 +1117,15 @@ dwc_otg_host_rate_check(struct dwc_otg_t /* non TT isochronous traffic */ if ((td->tmr_val != 0) || (sc->sc_last_frame_num & (td->tmr_res - 1))) { - /* enable SOF interrupt */ - dwc_otg_enable_sof_irq(sc); goto busy; } td->tmr_val = 1; /* executed */ td->toggle = 0; } else if (ep_type == UE_INTERRUPT) { - /* non TT interrupt traffic */ - return (dwc_otg_host_rate_check_interrupt(sc, td)); + if (!td->tt_scheduled) + goto busy; + td->tt_scheduled = 0; } else if (td->did_nak != 0) { goto busy; } else if (td->set_toggle) { @@ -1119,7 +1147,7 @@ dwc_otg_host_data_rx(struct dwc_otg_td * uint8_t ep_type; if (dwc_otg_host_channel_alloc(td)) - return (1); /* busy */ + goto busy; /* get pointer to softc */ sc = DWC_OTG_PC2SC(td->pc); @@ -1143,14 +1171,14 @@ dwc_otg_host_data_rx(struct dwc_otg_td * DPRINTF("CH=%d STALL\n", td->channel); td->error_stall = 1; td->error_any = 1; - return (0); /* complete */ + goto complete; } else if (hcint & HCINT_ERRORS) { DPRINTF("CH=%d ERROR\n", td->channel); td->errcnt++; if (td->hcsplt != 0 || td->errcnt >= 3) { if (ep_type != UE_ISOCHRONOUS) { td->error_any = 1; - return (0); /* complete */ + goto complete; } } } @@ -1219,7 +1247,7 @@ dwc_otg_host_data_rx(struct dwc_otg_td * /* release FIFO */ dwc_otg_common_rx_ack(sc); - return (0); /* we are complete */ + goto complete; } } td->toggle ^= 1; @@ -1233,7 +1261,7 @@ dwc_otg_host_data_rx(struct dwc_otg_td * /* release FIFO */ dwc_otg_common_rx_ack(sc); - return (0); /* we are complete */ + goto complete; } usbd_copy_in(td->pc, td->offset, @@ -1277,7 +1305,7 @@ check_state: if (hcint & HCINT_NYET) { if (ep_type == UE_ISOCHRONOUS) { /* we missed the service interval */ - return (0); /* complete */ + goto complete; } if (!dwc_otg_host_channel_wait(td)) break; @@ -1293,14 +1321,14 @@ check_state: /* check if we are complete */ if ((td->remainder == 0) || (td->tt_xactpos == HCSPLT_XACTPOS_BEGIN)) - return (0); /* complete */ + goto complete; goto receive_pkt; } else { /* check if we are complete */ if ((td->remainder == 0) || (td->got_short != 0)) { if (td->short_pkt) - return (0); /* complete */ + goto complete; /* * Else need to receive a zero length @@ -1439,13 +1467,12 @@ receive_spkt: goto busy; tt_wait: - /* enable SOF interrupt */ - dwc_otg_enable_sof_irq(sc); - /* free allocated channel */ dwc_otg_host_channel_free(td); busy: return (1); /* busy */ +complete: + return (0); /* complete */ } static uint8_t @@ -1571,7 +1598,7 @@ dwc_otg_host_data_tx(struct dwc_otg_td * uint8_t ep_type; if (dwc_otg_host_channel_alloc(td)) - return (1); /* busy */ + goto busy; /* get pointer to softc */ sc = DWC_OTG_PC2SC(td->pc); @@ -1593,13 +1620,13 @@ dwc_otg_host_data_tx(struct dwc_otg_td * DPRINTF("CH=%d STALL\n", td->channel); td->error_stall = 1; td->error_any = 1; - return (0); /* complete */ + goto complete; } else if (hcint & HCINT_ERRORS) { DPRINTF("CH=%d ERROR\n", td->channel); td->errcnt++; if (td->hcsplt != 0 || td->errcnt >= 3) { td->error_any = 1; - return (0); /* complete */ + goto complete; } } @@ -1640,7 +1667,7 @@ dwc_otg_host_data_tx(struct dwc_otg_td * /* check remainder */ if (td->remainder == 0) { if (td->short_pkt) - return (0); /* complete */ + goto complete; /* * Else we need to transmit a short @@ -1690,7 +1717,7 @@ dwc_otg_host_data_tx(struct dwc_otg_td * /* check remainder */ if (td->remainder == 0) { if (td->short_pkt) - return (0); /* complete */ + goto complete; /* else we need to transmit a short packet */ } @@ -1723,7 +1750,7 @@ dwc_otg_host_data_tx(struct dwc_otg_td * dwc_otg_host_channel_disable(sc, td->channel); if (td->remainder == 0) - return (0); /* complete */ + goto complete; td->state = DWC_CHAN_ST_TX_PKT_ISOC; @@ -1949,13 +1976,12 @@ send_cpkt: goto busy; tt_wait: - /* enable SOF interrupt */ - dwc_otg_enable_sof_irq(sc); - /* free allocated channel */ dwc_otg_host_channel_free(td); busy: return (1); /* busy */ +complete: + return (0); /* complete */ } static uint8_t @@ -2280,8 +2306,8 @@ dwc_otg_timer(void *_sc) td->did_nak = 0; } - /* poll jobs */ - dwc_otg_interrupt_poll(sc); + /* enable SOF interrupt, which will poll jobs */ + dwc_otg_enable_sof_irq(sc); if (sc->sc_timer_active) { /* restart timer */ @@ -2318,7 +2344,7 @@ dwc_otg_timer_stop(struct dwc_otg_softc } static void -dwc_otg_update_host_transfer_state(struct dwc_otg_softc *sc) +dwc_otg_update_host_transfer_schedule(struct dwc_otg_softc *sc) { TAILQ_HEAD(, usb_xfer) head; struct usb_xfer *xfer; @@ -2364,11 +2390,16 @@ dwc_otg_update_host_transfer_state(struc struct dwc_otg_tt_info *pinfo; td = xfer->td_transfer_cache; - if (td == NULL || td->hcsplt == 0 || + if (td == NULL || td->did_nak != 0 || (td->hcchar & HCCHAR_EPTYPE_MASK) != (UE_CONTROL << HCCHAR_EPTYPE_SHIFT)) continue; + needsof = 1; + + if (td->hcsplt == 0) + continue; + /* Reset state if stuck waiting for complete split */ if (td->state == DWC_CHAN_ST_WAIT_C_PKT) td->state = DWC_CHAN_ST_START; @@ -2385,7 +2416,6 @@ dwc_otg_update_host_transfer_state(struc td->tt_complete_slot = pinfo->slot_index + 2; if (td->tt_complete_slot < 8) { td->tt_scheduled = 1; - needsof = 1; TAILQ_REMOVE(&sc->sc_bus.intr_q.head, xfer, wait_entry); TAILQ_INSERT_TAIL(&head, xfer, wait_entry); } else { @@ -2437,7 +2467,7 @@ dwc_otg_update_host_transfer_state(struc struct dwc_otg_tt_info *pinfo; td = xfer->td_transfer_cache; - if (td == NULL || td->hcsplt == 0 || + if (td == NULL || (td->hcchar & HCCHAR_EPTYPE_MASK) != (UE_INTERRUPT << HCCHAR_EPTYPE_SHIFT)) { continue; @@ -2446,6 +2476,13 @@ dwc_otg_update_host_transfer_state(struc if (dwc_otg_host_rate_check_interrupt(sc, td)) continue; + needsof = 1; + + if (td->hcsplt == 0) { + td->tt_scheduled = 1; + continue; + } + /* Reset state if stuck waiting for complete split */ if (td->state == DWC_CHAN_ST_WAIT_C_PKT) td->state = DWC_CHAN_ST_START; @@ -2462,7 +2499,6 @@ dwc_otg_update_host_transfer_state(struc td->tt_complete_slot = pinfo->slot_index + 2; if (td->tt_complete_slot < 8) { td->tt_scheduled = 1; - needsof = 1; TAILQ_REMOVE(&sc->sc_bus.intr_q.head, xfer, wait_entry); TAILQ_INSERT_TAIL(&head, xfer, wait_entry); } else { @@ -2476,12 +2512,17 @@ dwc_otg_update_host_transfer_state(struc struct dwc_otg_tt_info *pinfo; td = xfer->td_transfer_cache; - if (td == NULL || td->hcsplt == 0 || + if (td == NULL || td->did_nak != 0 || (td->hcchar & HCCHAR_EPTYPE_MASK) != (UE_BULK << HCCHAR_EPTYPE_SHIFT)) { continue; } + needsof = 1; + + if (td->hcsplt == 0) + continue; + if ((temp & 7) == 0) { /* Reset state if stuck waiting for complete split */ if (td->state == DWC_CHAN_ST_WAIT_C_PKT) @@ -2501,7 +2542,6 @@ dwc_otg_update_host_transfer_state(struc td->tt_complete_slot = pinfo->slot_index + 2; if (td->tt_complete_slot < 8) { td->tt_scheduled = 1; - needsof = 1; TAILQ_REMOVE(&sc->sc_bus.intr_q.head, xfer, wait_entry); TAILQ_INSERT_TAIL(&head, xfer, wait_entry); } else { @@ -2621,9 +2661,7 @@ repeat: got_rx_status = 1; } - /* update SOF related information */ - dwc_otg_update_host_transfer_state(sc); - + /* scan for completion events first */ TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { if (!dwc_otg_xfer_do_fifo(xfer)) { /* queue has been modified */ @@ -2631,13 +2669,26 @@ repeat: } } + if (sc->sc_flags.status_device_mode == 0) { + /* update host transfer schedule, so that new transfers can be issued */ + dwc_otg_update_host_transfer_schedule(sc); + + /* start re-scheduled transfers */ + TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { + if (!dwc_otg_xfer_do_fifo(xfer)) { + /* queue has been modified */ + goto repeat; + } + } + } + if (got_rx_status) { /* check if data was consumed */ if (sc->sc_last_rx_status == 0) goto repeat; /* disable RX FIFO level interrupt */ - sc->sc_irq_mask &= ~GINTSTS_RXFLVL; + sc->sc_irq_mask &= ~GINTMSK_RXFLVLMSK; DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); } } @@ -2699,6 +2750,12 @@ dwc_otg_interrupt(struct dwc_otg_softc * sc->sc_flags.change_suspend = 0; sc->sc_flags.change_connect = 1; + /* Disable SOF interrupt */ + sc->sc_irq_mask &= ~GINTMSK_SOFMSK; + /* Enable RX frame interrupt */ + sc->sc_irq_mask |= GINTMSK_RXFLVLMSK; + DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); + /* complete root HUB interrupt endpoint */ dwc_otg_root_intr(sc); } @@ -2732,10 +2789,12 @@ dwc_otg_interrupt(struct dwc_otg_softc * else sc->sc_flags.status_high_speed = 0; - /* disable resume interrupt and enable suspend interrupt */ - - sc->sc_irq_mask &= ~GINTSTS_WKUPINT; - sc->sc_irq_mask |= GINTSTS_USBSUSP; + /* + * Disable resume and SOF interrupt, and enable + * suspend and RX frame interrupt: + */ + sc->sc_irq_mask &= ~(GINTMSK_WKUPINTMSK | GINTMSK_SOFMSK); + sc->sc_irq_mask |= (GINTMSK_USBSUSPMSK | GINTMSK_RXFLVLMSK); DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); /* complete root HUB interrupt endpoint */ @@ -2805,6 +2864,13 @@ dwc_otg_interrupt(struct dwc_otg_softc * /* complete root HUB interrupt endpoint */ dwc_otg_root_intr(sc); + + /* disable RX FIFO level interrupt */ + sc->sc_irq_mask &= ~GINTMSK_RXFLVLMSK; + DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); + + /* update host frame interval */ + dwc_otg_update_host_frame_interval(sc); } /* @@ -2853,10 +2919,6 @@ dwc_otg_interrupt(struct dwc_otg_softc * } } - /* check for SOF interrupt */ - if (status & GINTSTS_SOF) - dwc_otg_update_host_transfer_state(sc); - /* poll FIFO(s) */ dwc_otg_interrupt_poll(sc); @@ -3223,9 +3285,6 @@ dwc_otg_start_standard_chain(struct usb_ DPRINTFN(9, "\n"); - /* update SOF related information */ - dwc_otg_update_host_transfer_state(sc); - /* poll one time - will turn on interrupts */ if (dwc_otg_xfer_do_fifo(xfer)) { @@ -3237,6 +3296,9 @@ dwc_otg_start_standard_chain(struct usb_ usbd_transfer_timeout_ms(xfer, &dwc_otg_timeout, xfer->timeout); } + + /* enable SOF interrupt, if any */ + dwc_otg_enable_sof_irq(sc); } } From owner-svn-src-head@FreeBSD.ORG Tue May 6 10:53:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C4C679E; Tue, 6 May 2014 10:53:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79FAE3E1; Tue, 6 May 2014 10:53:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46Arqam043199; Tue, 6 May 2014 10:53:52 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46Arq8W043198; Tue, 6 May 2014 10:53:52 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201405061053.s46Arq8W043198@svn.freebsd.org> From: Robert Watson Date: Tue, 6 May 2014 10:53:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265432 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 10:53:52 -0000 Author: rwatson Date: Tue May 6 10:53:51 2014 New Revision: 265432 URL: http://svnweb.freebsd.org/changeset/base/265432 Log: Spell raccdt in a more conventional way in a comment. MFC after: 3 days Modified: head/sys/sys/kernel.h Modified: head/sys/sys/kernel.h ============================================================================== --- head/sys/sys/kernel.h Tue May 6 09:55:49 2014 (r265431) +++ head/sys/sys/kernel.h Tue May 6 10:53:51 2014 (r265432) @@ -166,7 +166,7 @@ enum sysinit_sub_id { SI_SUB_KTHREAD_UPDATE = 0xec00000, /* update daemon*/ SI_SUB_KTHREAD_IDLE = 0xee00000, /* idle procs*/ SI_SUB_SMP = 0xf000000, /* start the APs*/ - SI_SUB_RACCTD = 0xf100000, /* start raccd*/ + SI_SUB_RACCTD = 0xf100000, /* start racctd*/ SI_SUB_LAST = 0xfffffff /* final initialization */ }; From owner-svn-src-head@FreeBSD.ORG Tue May 6 11:12:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4FFA8D6; Tue, 6 May 2014 11:12:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2D218CE; Tue, 6 May 2014 11:12:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46BCukH052439; Tue, 6 May 2014 11:12:56 GMT (envelope-from se@svn.freebsd.org) Received: (from se@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46BCuNf052436; Tue, 6 May 2014 11:12:56 GMT (envelope-from se@svn.freebsd.org) Message-Id: <201405061112.s46BCuNf052436@svn.freebsd.org> From: Stefan Esser Date: Tue, 6 May 2014 11:12:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265433 - in head/sys: conf modules/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 11:12:56 -0000 Author: se Date: Tue May 6 11:12:56 2014 New Revision: 265433 URL: http://svnweb.freebsd.org/changeset/base/265433 Log: Fix buildkernel breakage, which was fall-out from the move of options to src.opts.mk. Modified: head/sys/conf/kmod.mk head/sys/modules/drm2/Makefile Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue May 6 10:53:51 2014 (r265432) +++ head/sys/conf/kmod.mk Tue May 6 11:12:56 2014 (r265433) @@ -72,6 +72,7 @@ OBJCOPY?= objcopy .error "Do not use KMODDEPS on 5.0+; use MODULE_VERSION/MODULE_DEPEND" .endif +.include .include .include Modified: head/sys/modules/drm2/Makefile ============================================================================== --- head/sys/modules/drm2/Makefile Tue May 6 10:53:51 2014 (r265432) +++ head/sys/modules/drm2/Makefile Tue May 6 11:12:56 2014 (r265433) @@ -1,5 +1,6 @@ # $FreeBSD$ +.include .include .if ${MACHINE_CPUARCH} == "amd64" From owner-svn-src-head@FreeBSD.ORG Tue May 6 11:42:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37E36C1F; Tue, 6 May 2014 11:42:41 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id E600DC69; Tue, 6 May 2014 11:42:40 +0000 (UTC) Received: from terran (unknown [192.168.99.1]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPA id 896B3C4927; Tue, 6 May 2014 14:42:38 +0300 (EEST) Date: Tue, 6 May 2014 14:46:15 +0300 From: Aleksandr Rybalko To: Steve Kargl Subject: Re: svn commit: r265391 - head/sys/dev/vt Message-Id: <20140506144615.c038cfa1661f30ba63b7d2a6@freebsd.org> In-Reply-To: <20140506000027.GA21010@troutmask.apl.washington.edu> References: <201405052129.s45LTv38079480@svn.freebsd.org> <20140506000027.GA21010@troutmask.apl.washington.edu> X-Mailer: Sylpheed 3.3.1 (GTK+ 2.24.22; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Aleksandr Rybalko , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 11:42:41 -0000 On Mon, 5 May 2014 17:00:27 -0700 Steve Kargl wrote: > On Mon, May 05, 2014 at 09:29:57PM +0000, Aleksandr Rybalko wrote: > > Author: ray > > Date: Mon May 5 21:29:56 2014 > > New Revision: 265391 > > URL: http://svnweb.freebsd.org/changeset/base/265391 > > > > Log: > > Define a new method for probing vt(4) driver before attach it at early stage. > > > > Can you please commit a vt.4 manual page or stop referring to vt(4) > in your commit messages? > > -- > Steve Hi Steve, sorry for large delay with man pages. Currently work on manual pages in progress, with great help by wblock@. And will come up shortly. I'm understand how much important it is, and will try to do it ASAP. Thanks! WBW -- Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Tue May 6 12:31:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0EC84A0D; Tue, 6 May 2014 12:31:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F10DD3BB; Tue, 6 May 2014 12:31:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46CVHit087259; Tue, 6 May 2014 12:31:17 GMT (envelope-from se@svn.freebsd.org) Received: (from se@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46CVH1j087258; Tue, 6 May 2014 12:31:17 GMT (envelope-from se@svn.freebsd.org) Message-Id: <201405061231.s46CVH1j087258@svn.freebsd.org> From: Stefan Esser Date: Tue, 6 May 2014 12:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265436 - head/usr.bin/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 12:31:18 -0000 Author: se Date: Tue May 6 12:31:17 2014 New Revision: 265436 URL: http://svnweb.freebsd.org/changeset/base/265436 Log: Fix include statement to accept src.opts.mk from a source directory instead of from /usr/share/mk. I'm not sure that this will let buildworld complete on a system with no installed src.opts.mk (make buildworld is still running), but the tinderbox builds are all failing earlyon without this patch. Modified: head/usr.bin/bmake/Makefile.inc Modified: head/usr.bin/bmake/Makefile.inc ============================================================================== --- head/usr.bin/bmake/Makefile.inc Tue May 6 12:20:07 2014 (r265435) +++ head/usr.bin/bmake/Makefile.inc Tue May 6 12:31:17 2014 (r265436) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include "src.opts.mk" +.include .if defined(.PARSEDIR) # make sure this is available to unit-tests/Makefile From owner-svn-src-head@FreeBSD.ORG Tue May 6 12:39:11 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2EFD211; Tue, 6 May 2014 12:39:11 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97735646; Tue, 6 May 2014 12:39:11 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WheeG-000MAP-GA; Tue, 06 May 2014 12:39:04 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s46Cd1tw025582; Tue, 6 May 2014 06:39:01 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18ZaMM2m9y8j0qUbfuws9Tp Subject: Re: svn commit: r265418 - head/sys/vm From: Ian Lepore To: Alan Cox In-Reply-To: <201405060342.s463g5Fx047447@svn.freebsd.org> References: <201405060342.s463g5Fx047447@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Tue, 06 May 2014 06:39:01 -0600 Message-ID: <1399379941.22079.263.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 12:39:11 -0000 On Tue, 2014-05-06 at 03:42 +0000, Alan Cox wrote: > Author: alc > Date: Tue May 6 03:42:04 2014 > New Revision: 265418 > URL: http://svnweb.freebsd.org/changeset/base/265418 > > Log: > Prior to r254304, a separate function, vm_pageout_page_stats(), was used to > periodically update the reference status of the active pages. This function > was called, instead of vm_pageout_scan(), when memory was not scarce. The > objective was to provide up to date reference status for active pages in > case memory did become scarce and active pages needed to be deactivated. > > The active page queue scan performed by vm_pageout_page_stats() was > virtually identical to that performed by vm_pageout_scan(), and so r254304 > eliminated vm_pageout_page_stats(). Instead, vm_pageout_scan() is > called with the parameter "pass" set to zero. The intention was that when > pass is zero, vm_pageout_scan() would only scan the active queue. However, > the variable page_shortage can still be greater than zero when memory is not > scarce and vm_pageout_scan() is called with pass equal to zero. > Consequently, the inactive queue may be scanned and dirty pages laundered > even though that was not intended by r254304. This revision fixes that. > > Reported by: avg > MFC after: 1 week > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/vm/vm_pageout.c > > Modified: head/sys/vm/vm_pageout.c > ============================================================================== > --- head/sys/vm/vm_pageout.c Tue May 6 03:38:04 2014 (r265417) > +++ head/sys/vm/vm_pageout.c Tue May 6 03:42:04 2014 (r265418) > @@ -942,13 +942,15 @@ vm_pageout_scan(struct vm_domain *vmd, i > */ > addl_page_shortage = 0; > > - deficit = atomic_readandclear_int(&vm_pageout_deficit); > - > /* > * Calculate the number of pages we want to either free or move > * to the cache. > */ > - page_shortage = vm_paging_target() + deficit; > + if (pass > 0) { > + deficit = atomic_readandclear_int(&vm_pageout_deficit); > + page_shortage = vm_paging_target() + deficit; > + } else > + page_shortage = deficit = 0; > > /* > * maxlaunder limits the number of dirty pages we flush per scan. > Does this address the observation that several folks have made on current@ that pages are being pushed to swap much more agressively than in the past, even when the system doesn't seem short of memory? -- Ian From owner-svn-src-head@FreeBSD.ORG Tue May 6 13:08:00 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7CC47AC; Tue, 6 May 2014 13:08:00 +0000 (UTC) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 5B7B4A92; Tue, 6 May 2014 13:07:59 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 91B8DD440E5; Tue, 6 May 2014 23:07:56 +1000 (EST) Date: Tue, 6 May 2014 23:07:55 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Chisnall Subject: Re: svn commit: r265367 - head/lib/libc/regex In-Reply-To: <0FCEDD3C-A512-4B83-A8C8-5A1B7A33AAF2@FreeBSD.org> Message-ID: <20140506222048.V3154@besplex.bde.org> References: <201405051641.s45GfFje086423@svn.freebsd.org> <5367CD77.40909@freebsd.org> <5367EB54.1080109@FreeBSD.org> <3C7CFFB7-5C84-4AC1-9A81-C718D184E87B@FreeBSD.org> <7D7A417E-17C3-4001-8E79-0B57636A70E1@gmail.com> <536807D8.9000005@freebsd.org> <9349EAA9-F92C-4170-A1C0-2200FD490E5F@FreeBSD.org> <5368162A.9000002@freebsd.org> <20140506135706.T1596@besplex.bde.org> <0FCEDD3C-A512-4B83-A8C8-5A1B7A33AAF2@FreeBSD.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eojmkOZX c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=mAlE_CWfnZ8A:10 a=JzwRw_2MAAAA:8 a=nlC_4_pT8q9DhB4Ho9EA:9 a=cz2ZRIgtxKwA:10 a=wJWlkF7cXJYA:10 a=ZESbhQi-6epPCpVhwmcA:9 a=U0yl2-4bFfA83MZJ:21 a=7BNQl34o2nK4l0sd:21 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: src-committers , Andrey Chernov , svn-src-all@FreeBSD.org, Pedro Giffuni , Bruce Evans , svn-src-head@FreeBSD.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 13:08:00 -0000 On Tue, 6 May 2014, David Chisnall wrote: > On 6 May 2014, at 05:46, Bruce Evans wrote: > >> The standard behaviour is undefined. It cannot be relied on. From C99 >> (n869.txt): >> >> % 7.20.3.1 The calloc function >> % % Synopsis >> % % [#1] >> % % #include >> % void *calloc(size_t nmemb, size_t size); >> % % Description >> % % [#2] The calloc function allocates space for an array of >> % nmemb objects, each of whose size is size. The space is >> % initialized to all bits zero.238) >> >> Oops, there is no object to begin with, so perhaps the behaviour is >> defined after all. This is unclear. > > You're missing off the next line: > >> =09=95 3 The calloc function returns either a null pointer or a pointer= to the allocated space. It takes more that that to give defined behaviour. There is a similar example for snprintf(). It is specified to return a count in an int variable, but it is possible for the correct count to be unrepresentable as an int. The behaviour is then implicitly undefined. The function parameters are just invalid, and undefined behaviour occurs because snprintf() just doesn't support invalid parameters. Here calloc() can sort of support invalid parameters by returning a nondescript error for them. The question is if it is required to do this. > Clarifications from WG14 have indicated that this means that calloc() *mu= st* return either NULL or enough space for nmemb objects of size size. The= text of the standard was not changed in C11 because it seemed to be the co= nsensus of library authors that this is obvious from the existing text. Se= e the CERT report from my previous email - in 2002 it was regarded as a sec= urity hole (and a lack of standards conformance) if your calloc did not do = this and all known calloc implementations that did not were fixed. It is not obvious. C11 (n1570.pdf) also didn't change the wording for snprintf(). It is not obvious that (because of 20+ year old design errors) it has more undefined cases that might be expected. > Now, you can argue that either: > > - In this case, we can statically prove that the multiplication won't ove= rflow so we don't need a check, or > > - It is better to do the overflow check on the caller side and increase i= -cache usage to save some memory zeroing. > > But please don't try to argue that it is permitted for calloc() to not co= rrectly handle integer overflow. It is both non-conformant and dangerous f= or it to fail to do so. calloc() is not even required to do the multiplication... >> It is also unclear if objects >> can have size too large to represent as a size_t =2E.. A silly implementation of calloc() could do sbrk() 1 element at a ti= me. This is a slow way of doing the multiplication as well as the allocation. It might work to allocate an object(?) larger than SIZE_MAX. Is calloc() allowed to do this? > That is implementation defined, however if sizeof(ptrdiff_t) <=3D sizeof(= size_t) then they can not because you must be able to represent the differe= nce between any two pointers as a ptrdiff_t[1]. If you want to be pedantic= , _Static_assert(sizeof(ptrdiff_t) <=3D sizeof(size_t), "Unsupported platfo= rm!") to make sure you catch it at compile time if this might change. ptrdiff_t is much more broken as designed than size_t. Apart from the sign problem, it is not required to work useful unless the difference betwe= en the pointers is between -65535 and 65335 (the behaviour of pointer subtraction is undefined unless the result is represntable as a ptrdiff_t, and ptrdiff_t is not required to be any larger than 1's complement with 17 bits even if size_t is much larger). The unclear point is if the implementation-defined result of sizeof() can be different to the size of the object due to the latter being too large to represent in a size_t. > [1] This also means, on our platforms, that the maximum size of an object= must be one byte less than the total size of the address space, as C only = defines pointer comparisons between valid pointers to the same object and a= llows pointers to be one element past the end of an array. I used to run into this problem on 16-bit systems where half of the address space is the good buffer or heap size 32K. C90 didn't have PTRDIFF_MIN/MAX and pre-C90 had even less, so most implementations had ptrdiff_t =3D int and the undefined behaviour from pointer subtraction occurred in practice. Bruce From owner-svn-src-head@FreeBSD.ORG Tue May 6 13:38:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B276CC0; Tue, 6 May 2014 13:38:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58C6EEF4; Tue, 6 May 2014 13:38:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46DcZgu017479; Tue, 6 May 2014 13:38:35 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46DcZJv017477; Tue, 6 May 2014 13:38:35 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405061338.s46DcZJv017477@svn.freebsd.org> From: Ian Lepore Date: Tue, 6 May 2014 13:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265440 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 13:38:35 -0000 Author: ian Date: Tue May 6 13:38:34 2014 New Revision: 265440 URL: http://svnweb.freebsd.org/changeset/base/265440 Log: Move the pl310.enabled tunable to hw.pl310.enabled. Clean up a few minor style(9) nits. Use DEVMETHOD_END. Modified: head/sys/arm/arm/pl310.c Modified: head/sys/arm/arm/pl310.c ============================================================================== --- head/sys/arm/arm/pl310.c Tue May 6 12:39:23 2014 (r265439) +++ head/sys/arm/arm/pl310.c Tue May 6 13:38:34 2014 (r265440) @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); } while(0); static int pl310_enabled = 1; -TUNABLE_INT("pl310.enabled", &pl310_enabled); +TUNABLE_INT("hw.pl310.enabled", &pl310_enabled); static uint32_t g_l2cache_way_mask; @@ -149,7 +149,8 @@ static __inline void pl310_wait_background_op(uint32_t off, uint32_t mask) { - while (pl310_read4(pl310_softc, off) & mask); + while (pl310_read4(pl310_softc, off) & mask) + continue; } @@ -167,6 +168,7 @@ pl310_wait_background_op(uint32_t off, u static __inline void pl310_cache_sync(void) { + if ((pl310_softc == NULL) || !pl310_softc->sc_enabled) return; @@ -335,12 +337,13 @@ static int pl310_attach(device_t dev) { struct pl310_softc *sc = device_get_softc(dev); - int rid = 0; + int rid; uint32_t aux_value; uint32_t ctrl_value; uint32_t cache_id; sc->sc_dev = dev; + rid = 0; sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->sc_mem_res == NULL) @@ -446,7 +449,7 @@ pl310_attach(device_t dev) static device_method_t pl310_methods[] = { DEVMETHOD(device_probe, pl310_probe), DEVMETHOD(device_attach, pl310_attach), - {0, 0}, + DEVMETHOD_END }; static driver_t pl310_driver = { From owner-svn-src-head@FreeBSD.ORG Tue May 6 13:46:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC750DC0; Tue, 6 May 2014 13:46:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9D6AA7; Tue, 6 May 2014 13:46:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46Dka09021518; Tue, 6 May 2014 13:46:36 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46Dka0O021517; Tue, 6 May 2014 13:46:36 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405061346.s46Dka0O021517@svn.freebsd.org> From: Ian Lepore Date: Tue, 6 May 2014 13:46:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265441 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 13:46:36 -0000 Author: ian Date: Tue May 6 13:46:36 2014 New Revision: 265441 URL: http://svnweb.freebsd.org/changeset/base/265441 Log: Break out the code that figures out the L2 cache geometry to its own routine, so that it can be called from multiple places in upcoming changes. Modified: head/sys/arm/arm/pl310.c Modified: head/sys/arm/arm/pl310.c ============================================================================== --- head/sys/arm/arm/pl310.c Tue May 6 13:38:34 2014 (r265440) +++ head/sys/arm/arm/pl310.c Tue May 6 13:46:36 2014 (r265441) @@ -320,6 +320,23 @@ pl310_inv_range(vm_paddr_t start, vm_siz PL310_UNLOCK(pl310_softc); } +static void +pl310_set_way_sizes(struct pl310_softc *sc) +{ + uint32_t aux_value; + + aux_value = pl310_read4(sc, PL310_AUX_CTRL); + g_way_size = (aux_value & AUX_CTRL_WAY_SIZE_MASK) >> + AUX_CTRL_WAY_SIZE_SHIFT; + g_way_size = 1 << (g_way_size + 13); + if (aux_value & (1 << AUX_CTRL_ASSOCIATIVITY_SHIFT)) + g_ways_assoc = 16; + else + g_ways_assoc = 8; + g_l2cache_way_mask = (1 << g_ways_assoc) - 1; + g_l2cache_size = g_way_size * g_ways_assoc; +} + static int pl310_probe(device_t dev) { @@ -371,16 +388,9 @@ pl310_attach(device_t dev) device_printf(dev, "Part number: 0x%x, release: 0x%x\n", (cache_id >> CACHE_ID_PARTNUM_SHIFT) & CACHE_ID_PARTNUM_MASK, (cache_id >> CACHE_ID_RELEASE_SHIFT) & CACHE_ID_RELEASE_MASK); - aux_value = pl310_read4(sc, PL310_AUX_CTRL); - g_way_size = (aux_value & AUX_CTRL_WAY_SIZE_MASK) >> - AUX_CTRL_WAY_SIZE_SHIFT; - g_way_size = 1 << (g_way_size + 13); - if (aux_value & (1 << AUX_CTRL_ASSOCIATIVITY_SHIFT)) - g_ways_assoc = 16; - else - g_ways_assoc = 8; - g_l2cache_way_mask = (1 << g_ways_assoc) - 1; - g_l2cache_size = g_way_size * g_ways_assoc; + + pl310_set_way_sizes(); + /* Print the information */ device_printf(dev, "L2 Cache: %uKB/%dB %d ways\n", (g_l2cache_size / 1024), g_l2cache_line_size, g_ways_assoc); From owner-svn-src-head@FreeBSD.ORG Tue May 6 13:52:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79DD7DE9; Tue, 6 May 2014 13:52:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67FEC1BD; Tue, 6 May 2014 13:52:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46DqESp025251; Tue, 6 May 2014 13:52:14 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46DqE9a025250; Tue, 6 May 2014 13:52:14 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405061352.s46DqE9a025250@svn.freebsd.org> From: Aleksandr Rybalko Date: Tue, 6 May 2014 13:52:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265442 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 13:52:14 -0000 Author: ray Date: Tue May 6 13:52:13 2014 New Revision: 265442 URL: http://svnweb.freebsd.org/changeset/base/265442 Log: Implement KDMKTONE ioctl. Submitted by: Matthew D.Fuller (original version) MFC: 7 days PR: kern/189170 Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Tue May 6 13:46:36 2014 (r265441) +++ head/sys/dev/vt/vt_core.c Tue May 6 13:52:13 2014 (r265442) @@ -1732,9 +1732,17 @@ skip_thunk: td->td_frame->tf_rflags &= ~PSL_IOPL; #endif return (0); - case KDMKTONE: /* sound the bell */ - /* TODO */ + case KDMKTONE: { /* sound the bell */ + int freq, period; + + freq = 1193182 / ((*(int*)data) & 0xffff); + period = (((*(int*)data)>>16) & 0xffff) * hz / 1000; + if(*(int*)data) + sysbeep(freq, period); + else + vtterm_bell(tm); return (0); + } case KIOCSOUND: /* make tone (*data) hz */ /* TODO */ return (0); From owner-svn-src-head@FreeBSD.ORG Tue May 6 14:01:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49A2C420; Tue, 6 May 2014 14:01:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 375AA302; Tue, 6 May 2014 14:01:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46E1nx4029393; Tue, 6 May 2014 14:01:49 GMT (envelope-from se@svn.freebsd.org) Received: (from se@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46E1nZr029392; Tue, 6 May 2014 14:01:49 GMT (envelope-from se@svn.freebsd.org) Message-Id: <201405061401.s46E1nZr029392@svn.freebsd.org> From: Stefan Esser Date: Tue, 6 May 2014 14:01:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265443 - head/usr.bin/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 14:01:49 -0000 Author: se Date: Tue May 6 14:01:48 2014 New Revision: 265443 URL: http://svnweb.freebsd.org/changeset/base/265443 Log: Revert r265436, since it is not the correct fix. Modified: head/usr.bin/bmake/Makefile.inc Modified: head/usr.bin/bmake/Makefile.inc ============================================================================== --- head/usr.bin/bmake/Makefile.inc Tue May 6 13:52:13 2014 (r265442) +++ head/usr.bin/bmake/Makefile.inc Tue May 6 14:01:48 2014 (r265443) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include "src.opts.mk" .if defined(.PARSEDIR) # make sure this is available to unit-tests/Makefile From owner-svn-src-head@FreeBSD.ORG Tue May 6 14:03:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A313377E; Tue, 6 May 2014 14:03:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84FBE334; Tue, 6 May 2014 14:03:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46E3ZZN030248; Tue, 6 May 2014 14:03:35 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46E3Z99030247; Tue, 6 May 2014 14:03:35 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405061403.s46E3Z99030247@svn.freebsd.org> From: Ian Lepore Date: Tue, 6 May 2014 14:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265444 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 14:03:35 -0000 Author: ian Date: Tue May 6 14:03:35 2014 New Revision: 265444 URL: http://svnweb.freebsd.org/changeset/base/265444 Log: Call platform_pl310_init() before enabling the controller, and handle the case where the controller is already enabled. Some of the pl310 configuration registers cannot be changed while the controller is active, so if there is any platform-specific init to be done it must happen before enabling the controller. The controller should not be enabled upon entry to the kernel, but u-boot has recently developed the bad habit of leaving caches enabled when launching the kernel, and since we have no control over that source code we have to do our best to cope with it. The PL310 manual doesn't document a safe sequence for disabling the controller, but the sequence used here (force write-through mode and disable linefill allocations, then clean and invalidate the current contents before disabling the hardware) appears to be sound both by analysis and empirical testing. These changes were developed and tested in collaboration with Svatopluk Kraus . Reviewed by: cognet@ Modified: head/sys/arm/arm/pl310.c Modified: head/sys/arm/arm/pl310.c ============================================================================== --- head/sys/arm/arm/pl310.c Tue May 6 14:01:48 2014 (r265443) +++ head/sys/arm/arm/pl310.c Tue May 6 14:03:35 2014 (r265444) @@ -355,9 +355,7 @@ pl310_attach(device_t dev) { struct pl310_softc *sc = device_get_softc(dev); int rid; - uint32_t aux_value; - uint32_t ctrl_value; - uint32_t cache_id; + uint32_t cache_id, debug_ctrl; sc->sc_dev = dev; rid = 0; @@ -376,7 +374,6 @@ pl310_attach(device_t dev) pl310_softc = sc; mtx_init(&sc->sc_mtx, "pl310lock", NULL, MTX_SPIN); - sc->sc_enabled = pl310_enabled; /* activate the interrupt */ bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, @@ -389,31 +386,48 @@ pl310_attach(device_t dev) (cache_id >> CACHE_ID_PARTNUM_SHIFT) & CACHE_ID_PARTNUM_MASK, (cache_id >> CACHE_ID_RELEASE_SHIFT) & CACHE_ID_RELEASE_MASK); - pl310_set_way_sizes(); - - /* Print the information */ - device_printf(dev, "L2 Cache: %uKB/%dB %d ways\n", (g_l2cache_size / 1024), - g_l2cache_line_size, g_ways_assoc); - - ctrl_value = pl310_read4(sc, PL310_CTRL); + /* + * If L2 cache is already enabled then something has violated the rules, + * because caches are supposed to be off at kernel entry. The cache + * must be disabled to write the configuration registers without + * triggering an access error (SLVERR), but there's no documented safe + * procedure for disabling the L2 cache in the manual. So we'll try to + * invent one: + * - Use the debug register to force write-through mode and prevent + * linefills (allocation of new lines on read); now anything we do + * will not cause new data to come into the L2 cache. + * - Writeback and invalidate the current contents. + * - Disable the controller. + * - Restore the original debug settings. + */ + if (pl310_read4(sc, PL310_CTRL) & CTRL_ENABLED) { + device_printf(dev, "Warning: L2 Cache should not already be " + "active; trying to de-activate and re-initialize...\n"); + sc->sc_enabled = 1; + debug_ctrl = pl310_read4(sc, PL310_DEBUG_CTRL); + platform_pl310_write_debug(sc, debug_ctrl | + DEBUG_CTRL_DISABLE_WRITEBACK | DEBUG_CTRL_DISABLE_LINEFILL); + pl310_set_way_sizes(sc); + pl310_wbinv_all(); + platform_pl310_write_ctrl(sc, CTRL_DISABLED); + platform_pl310_write_debug(sc, debug_ctrl); + } + sc->sc_enabled = pl310_enabled; - if (sc->sc_enabled && !(ctrl_value & CTRL_ENABLED)) { - /* invalidate current content */ + if (sc->sc_enabled) { + platform_pl310_init(sc); + pl310_set_way_sizes(sc); /* platform init might change these */ pl310_write4(pl310_softc, PL310_INV_WAY, 0xffff); pl310_wait_background_op(PL310_INV_WAY, 0xffff); - - /* Enable the L2 cache if disabled */ platform_pl310_write_ctrl(sc, CTRL_ENABLED); - device_printf(dev, "L2 Cache enabled\n"); + device_printf(dev, "L2 Cache enabled: %uKB/%dB %d ways\n", + (g_l2cache_size / 1024), g_l2cache_line_size, g_ways_assoc); if (bootverbose) pl310_print_config(sc); - } - - if (!sc->sc_enabled && (ctrl_value & CTRL_ENABLED)) { + } else { /* - * Set counters so when cache event happens - * we'll get interrupt and be warned that something - * is off + * Set counters so when cache event happens we'll get interrupt + * and be warned that something is off. */ /* Cache Line Eviction for Counter 0 */ @@ -423,12 +437,6 @@ pl310_attach(device_t dev) pl310_write4(sc, PL310_EVENT_COUNTER1_CONF, EVENT_COUNTER_CONF_INCR | EVENT_COUNTER_CONF_DRREQ); - /* Temporary switch on for final flush*/ - sc->sc_enabled = 1; - pl310_wbinv_all(); - sc->sc_enabled = 0; - platform_pl310_write_ctrl(sc, CTRL_DISABLED); - /* Enable and clear pending interrupts */ pl310_write4(sc, PL310_INTR_CLEAR, INTR_MASK_ECNTR); pl310_write4(sc, PL310_INTR_MASK, INTR_MASK_ALL); @@ -442,11 +450,6 @@ pl310_attach(device_t dev) device_printf(dev, "L2 Cache disabled\n"); } - if (sc->sc_enabled) - platform_pl310_init(sc); - - pl310_wbinv_all(); - /* Set the l2 functions in the set of cpufuncs */ cpufuncs.cf_l2cache_wbinv_all = pl310_wbinv_all; cpufuncs.cf_l2cache_wbinv_range = pl310_wbinv_range; From owner-svn-src-head@FreeBSD.ORG Tue May 6 14:08:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40779A13; Tue, 6 May 2014 14:08:01 +0000 (UTC) Received: from mail-qg0-x231.google.com (mail-qg0-x231.google.com [IPv6:2607:f8b0:400d:c04::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C441F378; Tue, 6 May 2014 14:08:00 +0000 (UTC) Received: by mail-qg0-f49.google.com with SMTP id a108so2671285qge.8 for ; Tue, 06 May 2014 07:08:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=0NL2Y4/k0Y1LIRtg/4G+SR6+daha3oszg+yHNW6qMUU=; b=pBQGSwWCvbOqwQGjti0Tn7mJYAaHmSHBBMmrkCj5zPCMYttOyNJHVLw7/8iMdSn+Mx 2FlhZb6h3+tAZd3vF/ERvcneJetCw4nPQmL58imMckC24X0Qtv13N6v+smkWFZVelTJs kTZ8rId841OVSMwLAcpzH46bAQBKX5PG9OT3Re7+FDQPqAsxc9W6T2SZMkuSfhbAzy7B KpcFx4apTWYAGaduka0tAQAb9ZNtfzKCllymkqPd6aIVbwSdj29Rs5nW98tfEXDq4w3/ t7HnWa64HUxi9FyOChR8SLInwiDpHmy1/ttRUQYZGOou8x7C84r3S4JuG872OcBDdwGo DhZQ== MIME-Version: 1.0 X-Received: by 10.224.6.10 with SMTP id 10mr55877414qax.45.1399385279863; Tue, 06 May 2014 07:07:59 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.229.170.195 with HTTP; Tue, 6 May 2014 07:07:59 -0700 (PDT) In-Reply-To: <201405061352.s46DqE9a025250@svn.freebsd.org> References: <201405061352.s46DqE9a025250@svn.freebsd.org> Date: Tue, 6 May 2014 07:07:59 -0700 X-Google-Sender-Auth: YMuqKuTwxkMjoJBmLnLfcTx9t1A Message-ID: Subject: Re: svn commit: r265442 - head/sys/dev/vt From: Matthew Fleming To: Aleksandr Rybalko Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 14:08:01 -0000 On Tue, May 6, 2014 at 6:52 AM, Aleksandr Rybalko wrote: > Author: ray > Date: Tue May 6 13:52:13 2014 > New Revision: 265442 > URL: http://svnweb.freebsd.org/changeset/base/265442 > > Log: > Implement KDMKTONE ioctl. > > Submitted by: Matthew D.Fuller (original version) > MFC: 7 days > PR: kern/189170 > > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/dev/vt/vt_core.c > > Modified: head/sys/dev/vt/vt_core.c > ============================================================================== > --- head/sys/dev/vt/vt_core.c Tue May 6 13:46:36 2014 (r265441) > +++ head/sys/dev/vt/vt_core.c Tue May 6 13:52:13 2014 (r265442) > @@ -1732,9 +1732,17 @@ skip_thunk: > td->td_frame->tf_rflags &= ~PSL_IOPL; > #endif > return (0); > - case KDMKTONE: /* sound the bell */ > - /* TODO */ > + case KDMKTONE: { /* sound the bell */ > + int freq, period; > + > + freq = 1193182 / ((*(int*)data) & 0xffff); This data comes from a user and can't be trusted. This is a potential divide-by-zero. > + period = (((*(int*)data)>>16) & 0xffff) * hz / 1000; This is signed shift which I can't recall if it's well-defined if the number is negative. Using u_int would definitely be defined. Thanks, matthew From owner-svn-src-head@FreeBSD.ORG Tue May 6 14:08:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5761EB52; Tue, 6 May 2014 14:08:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44DD837E; Tue, 6 May 2014 14:08:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46E8hiL031164; Tue, 6 May 2014 14:08:43 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46E8hkw031163; Tue, 6 May 2014 14:08:43 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405061408.s46E8hkw031163@svn.freebsd.org> From: Ian Lepore Date: Tue, 6 May 2014 14:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265445 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 14:08:43 -0000 Author: ian Date: Tue May 6 14:08:42 2014 New Revision: 265445 URL: http://svnweb.freebsd.org/changeset/base/265445 Log: Add defines for the bits in the PL310 debug control register. This should have been part of r265444. Modified: head/sys/arm/include/pl310.h Modified: head/sys/arm/include/pl310.h ============================================================================== --- head/sys/arm/include/pl310.h Tue May 6 14:03:35 2014 (r265444) +++ head/sys/arm/include/pl310.h Tue May 6 14:08:42 2014 (r265445) @@ -113,6 +113,8 @@ #define PL310_ADDR_FILTER_STAR 0xC00 #define PL310_ADDR_FILTER_END 0xC04 #define PL310_DEBUG_CTRL 0xF40 +#define DEBUG_CTRL_DISABLE_LINEFILL (1 << 0) +#define DEBUG_CTRL_DISABLE_WRITEBACK (1 << 1) #define PL310_PREFETCH_CTRL 0xF60 #define PREFETCH_CTRL_OFFSET_MASK (0x1f) #define PREFETCH_CTRL_NOTSAMEID (1 << 21) From owner-svn-src-head@FreeBSD.ORG Tue May 6 14:19:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94790EE3; Tue, 6 May 2014 14:19:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 756A16D7; Tue, 6 May 2014 14:19:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46EJt4M036490; Tue, 6 May 2014 14:19:55 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46EJtbL036487; Tue, 6 May 2014 14:19:55 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405061419.s46EJtbL036487@svn.freebsd.org> From: Ian Lepore Date: Tue, 6 May 2014 14:19:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265446 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 14:19:55 -0000 Author: ian Date: Tue May 6 14:19:54 2014 New Revision: 265446 URL: http://svnweb.freebsd.org/changeset/base/265446 Log: Add a public routine to set the L2 cache ram latencies. This can be called by platform init routines to fine-tune cache performance. Modified: head/sys/arm/arm/pl310.c head/sys/arm/include/pl310.h Modified: head/sys/arm/arm/pl310.c ============================================================================== --- head/sys/arm/arm/pl310.c Tue May 6 14:08:42 2014 (r265445) +++ head/sys/arm/arm/pl310.c Tue May 6 14:19:54 2014 (r265446) @@ -125,6 +125,35 @@ pl310_print_config(struct pl310_softc *s (prefetch & PREFETCH_CTRL_OFFSET_MASK)); } +void +pl310_set_ram_latency(struct pl310_softc *sc, uint32_t which_reg, + uint32_t read, uint32_t write, uint32_t setup) +{ + uint32_t v; + + KASSERT(which_reg == PL310_TAG_RAM_CTRL || + which_reg == PL310_DATA_RAM_CTRL, + ("bad pl310 ram latency register address")); + + v = pl310_read4(sc, which_reg); + if (setup != 0) { + KASSERT(setup <= 8, ("bad pl310 setup latency: %d", setup)); + v &= ~RAM_CTRL_SETUP_MASK; + v |= (setup - 1) << RAM_CTRL_SETUP_SHIFT; + } + if (read != 0) { + KASSERT(read <= 8, ("bad pl310 read latency: %d", read)); + v &= ~RAM_CTRL_READ_MASK; + v |= (read - 1) << RAM_CTRL_READ_SHIFT; + } + if (write != 0) { + KASSERT(write <= 8, ("bad pl310 write latency: %d", write)); + v &= ~RAM_CTRL_WRITE_MASK; + v |= (write - 1) << RAM_CTRL_WRITE_SHIFT; + } + pl310_write4(sc, which_reg, v); +} + static int pl310_filter(void *arg) { Modified: head/sys/arm/include/pl310.h ============================================================================== --- head/sys/arm/include/pl310.h Tue May 6 14:08:42 2014 (r265445) +++ head/sys/arm/include/pl310.h Tue May 6 14:19:54 2014 (r265446) @@ -62,6 +62,14 @@ #define AUX_CTRL_DATA_PREFETCH (1 << 28) #define AUX_CTRL_INSTR_PREFETCH (1 << 29) #define AUX_CTRL_EARLY_BRESP (1 << 30) +#define PL310_TAG_RAM_CTRL 0x108 +#define PL310_DATA_RAM_CTRL 0x10C +#define RAM_CTRL_WRITE_SHIFT 8 +#define RAM_CTRL_WRITE_MASK (0x7 << 8) +#define RAM_CTRL_READ_SHIFT 4 +#define RAM_CTRL_READ_MASK (0x7 << 4) +#define RAM_CTRL_SETUP_SHIFT 0 +#define RAM_CTRL_SETUP_MASK (0x7 << 0) #define PL310_EVENT_COUNTER_CTRL 0x200 #define EVENT_COUNTER_CTRL_ENABLED (1 << 0) #define EVENT_COUNTER_CTRL_C0_RESET (1 << 1) @@ -115,6 +123,7 @@ #define PL310_DEBUG_CTRL 0xF40 #define DEBUG_CTRL_DISABLE_LINEFILL (1 << 0) #define DEBUG_CTRL_DISABLE_WRITEBACK (1 << 1) +#define DEBUG_CTRL_SPNIDEN (1 << 2) #define PL310_PREFETCH_CTRL 0xF60 #define PREFETCH_CTRL_OFFSET_MASK (0x1f) #define PREFETCH_CTRL_NOTSAMEID (1 << 21) @@ -125,6 +134,8 @@ #define PREFETCH_CTRL_INSTR_PREFETCH (1 << 29) #define PREFETCH_CTRL_DL (1 << 30) #define PL310_POWER_CTRL 0xF60 +#define POWER_CTRL_ENABLE_GATING (1 << 0) +#define POWER_CTRL_ENABLE_STANDBY (1 << 1) struct pl310_softc { device_t sc_dev; @@ -164,6 +175,8 @@ pl310_write4(struct pl310_softc *sc, bus } void pl310_print_config(struct pl310_softc *sc); +void pl310_set_ram_latency(struct pl310_softc *sc, uint32_t which_reg, + uint32_t read, uint32_t write, uint32_t setup); void platform_pl310_init(struct pl310_softc *); void platform_pl310_write_ctrl(struct pl310_softc *, uint32_t); From owner-svn-src-head@FreeBSD.ORG Tue May 6 14:26:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E431BEB6; Tue, 6 May 2014 14:26:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1BDD86A; Tue, 6 May 2014 14:26:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46EQO72041309; Tue, 6 May 2014 14:26:24 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46EQOEb041308; Tue, 6 May 2014 14:26:24 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405061426.s46EQOEb041308@svn.freebsd.org> From: Ian Lepore Date: Tue, 6 May 2014 14:26:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265447 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 14:26:25 -0000 Author: ian Date: Tue May 6 14:26:24 2014 New Revision: 265447 URL: http://svnweb.freebsd.org/changeset/base/265447 Log: Enable PL310 power-saving modes and tune the cache ram latencies for imx6. Modified: head/sys/arm/freescale/imx/imx6_pl310.c Modified: head/sys/arm/freescale/imx/imx6_pl310.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_pl310.c Tue May 6 14:19:54 2014 (r265446) +++ head/sys/arm/freescale/imx/imx6_pl310.c Tue May 6 14:26:24 2014 (r265447) @@ -44,6 +44,19 @@ __FBSDID("$FreeBSD$"); void platform_pl310_init(struct pl310_softc *sc) { + uint32_t reg; + + /* + * Enable power saving modes: + * - Dynamic Gating stops the clock when the controller is idle. + * - Standby stops the clock when the cores are in WFI mode. + */ + reg = pl310_read4(sc, PL310_POWER_CTRL); + reg |= POWER_CTRL_ENABLE_GATING | POWER_CTRL_ENABLE_STANDBY; + pl310_write4(sc, PL310_POWER_CTRL, reg); + + pl310_set_ram_latency(sc, PL310_TAG_RAM_CTRL, 4, 2, 3); + pl310_set_ram_latency(sc, PL310_DATA_RAM_CTRL, 4, 2, 3); } void From owner-svn-src-head@FreeBSD.ORG Tue May 6 14:33:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D257E396; Tue, 6 May 2014 14:33:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFED39B1; Tue, 6 May 2014 14:33:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46EXIW0046212; Tue, 6 May 2014 14:33:18 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46EXIVc046211; Tue, 6 May 2014 14:33:18 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405061433.s46EXIVc046211@svn.freebsd.org> From: Warner Losh Date: Tue, 6 May 2014 14:33:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265448 - head/usr.bin/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 14:33:18 -0000 Author: imp Date: Tue May 6 14:33:18 2014 New Revision: 265448 URL: http://svnweb.freebsd.org/changeset/base/265448 Log: Fix the upgrade path for fmake by allowing the include of src.opts.mk to fail and falling back on the conservative testing of variables already in place. This should stop the tide of tinderbox mail. Modified: head/usr.bin/bmake/Makefile.inc Modified: head/usr.bin/bmake/Makefile.inc ============================================================================== --- head/usr.bin/bmake/Makefile.inc Tue May 6 14:26:24 2014 (r265447) +++ head/usr.bin/bmake/Makefile.inc Tue May 6 14:33:18 2014 (r265448) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include "src.opts.mk" +.sinclude .if defined(.PARSEDIR) # make sure this is available to unit-tests/Makefile From owner-svn-src-head@FreeBSD.ORG Tue May 6 15:18:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26E05F3C for ; Tue, 6 May 2014 15:18:21 +0000 (UTC) Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA801D8E for ; Tue, 6 May 2014 15:18:20 +0000 (UTC) Received: by mail-pd0-f172.google.com with SMTP id g10so9665123pdj.3 for ; Tue, 06 May 2014 08:18:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=t71TOFxeFL+W5mMyncCYoKQKUc6d38OeGZr+QsmL140=; b=HHD4198C/t2pmoAQ+QcMNnfnJ7aDeNDKHNiB9iaOFyWGIuQNWn+zNQ5gSybqeLhZ4c znqHmb2UmpJiIh5CcW8Z5Ox4xlfVgeH2oZrSmd/iJRd9qhENHkIptQeEanXQNW8eQg2p zDpFyEL4ubfErSp6t/fSccf695IJxRUWQhPUutYODD3/ohTOKoxo3fmS4tzv9FdY/xm+ hXDlw8kAu5HiyL9eDcDA7sYS+GNg08duYIzWR5uERBvI3YgBNABpOky3O5KmmwAjylcV uliyMRAw3xl/cLmAuLTum8wKRmgNBx22YSSim/urHZuaeGNcnbmHJi+/6iwJw3N5bW4Q iSaA== X-Gm-Message-State: ALoCoQn2At2T7RFMs4O6nBHCkJ4g7Lh2PN2AJo7eHFsI7ZvimABdeyzSZNa34CEZBBTP2GwGvd1X X-Received: by 10.66.251.101 with SMTP id zj5mr7345497pac.154.1399389499777; Tue, 06 May 2014 08:18:19 -0700 (PDT) Received: from [10.64.26.239] (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id xx4sm963031pbb.51.2014.05.06.08.18.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 May 2014 08:18:18 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_9AFB977B-5CF7-4419-A96F-2758EE50DCD7"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265419 - head/share/mk From: Warner Losh In-Reply-To: <5368681C.9020108@freebsd.org> Date: Tue, 6 May 2014 09:18:15 -0600 Message-Id: <913B82D9-D361-4631-A32E-16330CB55E17@bsdimp.com> References: <201405060421.s464LnXl065686@svn.freebsd.org> <5368681C.9020108@freebsd.org> To: Julian Elischer X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 15:18:21 -0000 --Apple-Mail=_9AFB977B-5CF7-4419-A96F-2758EE50DCD7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On May 5, 2014, at 10:42 PM, Julian Elischer wrote: > While you are wandering around in the Makefiles, I was wondering > if you could estimate the amount of work to have the ability to > specify the location of the build toolchain a bit better.. For building the /usr/src tree, this is easy. > Currently it's $(OBJPREFIX)/$(.CURDIR)/tmp or something > (different if cross compiling of course), but it'd > be nice to be able to generate a crossbuild toolchain externally > that can be used by other software.. It'd be really nice to be able > to use our sources to generate an ARM crossbuild set that > could then be used on third party software to make pi binaries for = example. make xdev is intended to do exactly that. > We have all this neat crossbuild capabilityin our source tree.. it's = be truely spectacular > if that was an exportable target. "make TARGET=3DARM-pi = crossbuildtools" which > could be used with a given make,conf file to "just build" ARM-rpi = binaries. make xdev should be what you want. Please let me know how it doesn=92t = meet your needs. You can either use it as a full cross compiler (the names are chosen so common tools = pick them up right), or you can do path games and have it appear as cc, as, etc. > At $JOB we currently we have a build env (which is incredibly broken = but that another story) > that expects to pull all includes, libs and tools from a certain = place... > I currently prepopulate it by doing make DESTDIR=3D$PLACE = installworld. > which is a bit of an overkill, but at least it works.. The toolchain = set we use in > buildworld would be about perfect to drop in there.. but > "make toolchain && cp -pr /obj/...../tmp/* $PLACE" > doesn't strike me as the most elegant way to do it.. Maybe xdev is right for you :) As far as I know, there=92s no = =91install-toolchain=92, but perhaps there should be. Warner --Apple-Mail=_9AFB977B-5CF7-4419-A96F-2758EE50DCD7 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTaP03AAoJEGwc0Sh9sBEAzFgP/2phnVGgyf+CWsniViYQ77v2 PJ7yJc9IFIpmYvzFUPxvUFf7d7iS3Vrvt7Eo83e3Hmh9Ykt/QFeyGJrr+VGfN/wg qxl+737AsWpg4Ox/QQgrt5sgVjyrw4zR2IJ/d5ebeGohg8IvUMOpi6W5sIwjLvUQ 7KcXUSzmdE6t+LYNH5d6je9BfWP4Wtz1BpA4026fgVquSJQS/c8/014Z/fZCSvbt ezvMS/Y3CfPNFUQsZW6CdYQUNb6rx42+P0aEr+U6sVeRWIL7D+DyYFJTzAX7ZOhx H6tHoZvPPqzfJXrRsghnyzkJM0AgsHe77/uPeGXw6SAROjJ9k+bWIAwEqzw7IFlc ZebcHSdzpbvqvy5HX5cv4Azvs+X5xX1tGDfLzrXtQWacfmJCURf27p+6wPPPCcdn 9mJEtqMt3AAwvHdFTAxv7wYEgflHy1cHGekVZwbfJ1cEGAyCuxOKPuLzomC/4JEU KgrEA3vHFTQJW+OJh4cm8KfgJPkFiFTPP6JRtna8H/wDkBY/EIqOLoCYv5PX4vO8 1+5kW8zp23p1QnRqEA+O3cv5jirT1AsdwNFCvUDMjmmD20icjERj5eqpofBRjkJ+ Xoo01FLh1PzguFhTW28cyvzArtYiKo6OpMlwVcRIik716kbJc2/KohU1t4bcMmVC 3y0H4lqDSXepLzkNf+V2 =muxn -----END PGP SIGNATURE----- --Apple-Mail=_9AFB977B-5CF7-4419-A96F-2758EE50DCD7-- From owner-svn-src-head@FreeBSD.ORG Tue May 6 15:44:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65761870; Tue, 6 May 2014 15:44:11 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2781C7F; Tue, 6 May 2014 15:44:10 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 9718C1FE029; Tue, 6 May 2014 17:44:09 +0200 (CEST) Message-ID: <53690381.9040909@selasky.org> Date: Tue, 06 May 2014 17:45:05 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Warner Losh Subject: Re: svn commit: r265359 - head/sys/modules/sound/sound References: <201405051431.s45EVZ2q027729@svn.freebsd.org> <7745BD19-5BAE-47BD-8DE4-10CF7E23FA9D@gmail.com> In-Reply-To: <7745BD19-5BAE-47BD-8DE4-10CF7E23FA9D@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 15:44:11 -0000 On 05/05/14 22:39, Warner Losh wrote: > > On May 5, 2014, at 8:31 AM, Hans Petter Selasky wrote: > >> Author: hselasky >> Date: Mon May 5 14:31:34 2014 >> New Revision: 265359 >> URL: http://svnweb.freebsd.org/changeset/base/265359 >> >> Log: >> Build the kernel sound module without ISA DMA support for ARM and MIPS >> platforms, because these platforms do not implement the ISA DMA >> API. Else the sound modules cannot be loaded when running these >> platforms. >> >> MFC after: 2 weeks >> >> Modified: >> head/sys/modules/sound/sound/Makefile >> >> Modified: head/sys/modules/sound/sound/Makefile >> ============================================================================== >> --- head/sys/modules/sound/sound/Makefile Mon May 5 11:50:52 2014 (r265358) >> +++ head/sys/modules/sound/sound/Makefile Mon May 5 14:31:34 2014 (r265359) >> @@ -44,7 +44,8 @@ CLEANFILES+= feeder_eq_gen.h feeder_rate >> >> EXPORT_SYMS= YES # XXX evaluate >> >> -.if ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "powerpc" >> +.if ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "powerpc" || \ >> + ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" >> # Create an empty opt_isa.h in order to keep kmod.mk from linking in an >> # existing one from KERNBUILDDIR which possibly has DEV_ISA defined so >> # sound.ko is always built without isadma support. > > Rather than an opt-in approach here, why not lust list the three that have it since > they are the only ones that will ever have it… > > Warner > Hi, Maybe the sound DMA file belongs in its own module? --HPS From owner-svn-src-head@FreeBSD.ORG Tue May 6 15:44:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B02309AE; Tue, 6 May 2014 15:44:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DBF889; Tue, 6 May 2014 15:44:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46FiYbJ080846; Tue, 6 May 2014 15:44:34 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46FiYfF080845; Tue, 6 May 2014 15:44:34 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405061544.s46FiYfF080845@svn.freebsd.org> From: Warner Losh Date: Tue, 6 May 2014 15:44:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265451 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 15:44:34 -0000 Author: imp Date: Tue May 6 15:44:34 2014 New Revision: 265451 URL: http://svnweb.freebsd.org/changeset/base/265451 Log: Add helpful note about possible workarounds for (as yet) unknown breakage. Also fix typo. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue May 6 15:38:44 2014 (r265450) +++ head/UPDATING Tue May 6 15:44:34 2014 (r265451) @@ -14,7 +14,7 @@ Items affecting the ports and packages s NOTE: FreeBSD has switched from gcc to clang. If you have trouble bootstrapping from older versions of FreeBSD, try WITHOUT_CLANG and WITH_GCC to bootstrap to the tip of head, and then rebuild without this option. The bootstrap process from -older version of current accorss the gcc/clang cutover is a bit fragile. +older version of current across the gcc/clang cutover is a bit fragile. NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW: FreeBSD 11.x has many debugging features turned on, in both the kernel @@ -40,7 +40,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 behavior of incremental builds inside the tree of individual directories. Set MAKESYSPATH to ".../share/mk" to do that. Although this has survived make universe and some upgrade scenarios, - other upgrade scenarios may have broken. + other upgrade scenarios may have broken. At least one form of + temporary breakage was fixed with MAKESYSPATH settings for buildworld + as well... 20140430: The lindev device has been removed since /dev/full has been made a From owner-svn-src-head@FreeBSD.ORG Tue May 6 15:44:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64258AE5; Tue, 6 May 2014 15:44:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FFA68E; Tue, 6 May 2014 15:44:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46Figid080913; Tue, 6 May 2014 15:44:42 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46FigfR080912; Tue, 6 May 2014 15:44:42 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405061544.s46FigfR080912@svn.freebsd.org> From: Warner Losh Date: Tue, 6 May 2014 15:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265452 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 15:44:42 -0000 Author: imp Date: Tue May 6 15:44:41 2014 New Revision: 265452 URL: http://svnweb.freebsd.org/changeset/base/265452 Log: Time to prune entries for RELENG_7 and stable/8. They are still in svn, for the historically minded. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue May 6 15:44:34 2014 (r265451) +++ head/UPDATING Tue May 6 15:44:41 2014 (r265452) @@ -665,1264 +665,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 The stable/9 branch created in subversion. This corresponds to the RELENG_9 branch in CVS. -20110913: - This commit modifies vfs_register() so that it uses a hash - calculation to set vfc_typenum, which is enabled by default. - The first time a system is booted after this change, the - vfc_typenum values will change for all file systems. The - main effect of this is a change to the NFS server file handles - for file systems that use vfc_typenum in their fsid, such as ZFS. - It will, however, prevent vfc_typenum from changing when file - systems are loaded in a different order for subsequent reboots. - To disable this, you can set vfs.typenumhash=0 in /boot/loader.conf - until you are ready to remount all NFS clients after a reboot. - -20110828: - Bump the shared library version numbers for libraries that - do not use symbol versioning, have changed the ABI compared - to stable/8 and which shared library version was not bumped. - Done as part of 9.0-RELEASE cycle. - -20110815: - During the merge of Capsicum features, the fget(9) KPI was modified. - This may require the rebuilding of out-of-tree device drivers -- - issues have been reported specifically with the nVidia device driver. - __FreeBSD_version is bumped to 900041. - - Also, there is a period between 20110811 and 20110814 where the - special devices /dev/{stdin,stdout,stderr} did not work correctly. - Building world from a kernel during that window may not work. - -20110628: - The packet filter (pf) code has been updated to OpenBSD 4.5. - You need to update userland tools to be in sync with kernel. - This update breaks backward compatibility with earlier pfsync(4) - versions. Care must be taken when updating redundant firewall setups. - -20110608: - The following sysctls and tunables are retired on x86 platforms: - machdep.hlt_cpus - machdep.hlt_logical_cpus - The following sysctl is retired: - machdep.hyperthreading_allowed - The sysctls were supposed to provide a way to dynamically offline and - online selected CPUs on x86 platforms, but the implementation has not - been reliable especially with SCHED_ULE scheduler. - machdep.hyperthreading_allowed tunable is still available to ignore - hyperthreading CPUs at OS level. - Individual CPUs can be disabled using hint.lapic.X.disabled tunable, - where X is an APIC ID of a CPU. Be advised, though, that disabling - CPUs in non-uniform fashion will result in non-uniform topology and - may lead to sub-optimal system performance with SCHED_ULE, which is - a default scheduler. - -20110607: - cpumask_t type is retired and cpuset_t is used in order to describe - a mask of CPUs. - -20110531: - Changes to ifconfig(8) for dynamic address family detection mandate - that you are running a kernel of 20110525 or later. Make sure to - follow the update procedure to boot a new kernel before installing - world. - -20110513: - Support for sun4v architecture is officially dropped - -20110503: - Several KPI breaking changes have been committed to the mii(4) layer, - the PHY drivers and consequently some Ethernet drivers using mii(4). - This means that miibus.ko and the modules of the affected Ethernet - drivers need to be recompiled. - - Note to kernel developers: Given that the OUI bit reversion problem - was fixed as part of these changes all mii(4) commits related to OUIs, - i.e. to sys/dev/mii/miidevs, PHY driver probing and vendor specific - handling, no longer can be merged verbatim to stable/8 and previous - branches. - -20110430: - Users of the Atheros AR71xx SoC code now need to add 'device ar71xx_pci' - into their kernel configurations along with 'device pci'. - -20110427: - The default NFS client is now the new NFS client, so fstype "newnfs" - is now "nfs" and the regular/old NFS client is now fstype "oldnfs". - Although mounts via fstype "nfs" will usually work without userland - changes, it is recommended that the mount(8) and mount_nfs(8) - commands be rebuilt from sources and that a link to mount_nfs called - mount_oldnfs be created. The new client is compiled into the - kernel with "options NFSCL" and this is needed for diskless root - file systems. The GENERIC kernel configs have been changed to use - NFSCL and NFSD (the new server) instead of NFSCLIENT and NFSSERVER. - To use the regular/old client, you can "mount -t oldnfs ...". For - a diskless root file system, you must also include a line like: - - vfs.root.mountfrom="oldnfs:" - - in the boot/loader.conf on the root fs on the NFS server to make - a diskless root fs use the old client. - -20110424: - The GENERIC kernels for all architectures now default to the new - CAM-based ATA stack. It means that all legacy ATA drivers were - removed and replaced by respective CAM drivers. If you are using - ATA device names in /etc/fstab or other places, make sure to update - them respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX -> saY, - where 'Y's are the sequential numbers starting from zero for each type - in order of detection, unless configured otherwise with tunables, - see cam(4)). There will be symbolic links created in /dev/ to map - old adX devices to the respective adaY. They should provide basic - compatibility for file systems mounting in most cases, but they do - not support old user-level APIs and do not have respective providers - in GEOM. Consider using updated management tools with new device names. - - It is possible to load devices ahci, ata, siis and mvs as modules, - but option ATA_CAM should remain in kernel configuration to make ata - module work as CAM driver supporting legacy ATA controllers. Device ata - still can be used in modular fashion (atacore + ...). Modules atadisk - and atapi* are not used and won't affect operation in ATA_CAM mode. - Note that to use CAM-based ATA kernel should include CAM devices - scbus, pass, da (or explicitly ada), cd and optionally others. All of - them are parts of the cam module. - - ataraid(4) functionality is now supported by the RAID GEOM class. - To use it you can load geom_raid kernel module and use graid(8) tool - for management. Instead of /dev/arX device names, use /dev/raid/rX. - - No kernel config options or code have been removed, so if a problem - arises, please report it and optionally revert to the old ATA stack. - In order to do it you can remove from the kernel config: - options ATA_CAM - device ahci - device mvs - device siis - , and instead add back: - device atadisk # ATA disk drives - device ataraid # ATA RAID drives - device atapicd # ATAPI CDROM drives - device atapifd # ATAPI floppy drives - device atapist # ATAPI tape drives - -20110423: - The default NFS server has been changed to the new server, which - was referred to as the experimental server. If you need to switch - back to the old NFS server, you must now put the "-o" option on - both the mountd and nfsd commands. This can be done using the - mountd_flags and nfs_server_flags rc.conf variables until an - update to the rc scripts is committed, which is coming soon. - -20110418: - The GNU Objective-C runtime library (libobjc), and other Objective-C - related components have been removed from the base system. If you - require an Objective-C library, please use one of the available ports. - -20110331: - ath(4) has been split into bus- and device- modules. if_ath contains - the HAL, the TX rate control and the network device code. if_ath_pci - contains the PCI bus glue. For Atheros MIPS embedded systems, if_ath_ahb - contains the AHB glue. Users need to load both if_ath_pci and if_ath - in order to use ath on everything else. - - TO REPEAT: if_ath_ahb is not needed for normal users. Normal users only - need to load if_ath and if_ath_pci for ath(4) operation. - -20110314: - As part of the replacement of sysinstall, the process of building - release media has changed significantly. For details, please re-read - release(7), which has been updated to reflect the new build process. - -20110218: - GNU binutils 2.17.50 (as of 2007-07-03) has been merged to -HEAD. This - is the last available version under GPLv2. It brings a number of new - features, such as support for newer x86 CPU's (with SSE-3, SSSE-3, SSE - 4.1 and SSE 4.2), better support for powerpc64, a number of new - directives, and lots of other small improvements. See the ChangeLog - file in contrib/binutils for the full details. - -20110218: - IPsec's HMAC_SHA256-512 support has been fixed to be RFC4868 - compliant, and will now use half of hash for authentication. - This will break interoperability with all stacks (including all - actual FreeBSD versions) who implement - draft-ietf-ipsec-ciph-sha-256-00 (they use 96 bits of hash for - authentication). - The only workaround with such peers is to use another HMAC - algorithm for IPsec ("phase 2") authentication. - -20110207: - Remove the uio_yield prototype and symbol. This function has - been misnamed since it was introduced and should not be - globally exposed with this name. The equivalent functionality - is now available using kern_yield(curthread->td_user_pri). - The function remains undocumented. - -20110112: - A SYSCTL_[ADD_]UQUAD was added for unsigned uint64_t pointers, - symmetric with the existing SYSCTL_[ADD_]QUAD. Type checking - for scalar sysctls is defined but disabled. Code that needs - UQUAD to pass the type checking that must compile on older - systems where the define is not present can check against - __FreeBSD_version >= 900030. - - The system dialog(1) has been replaced with a new version previously - in ports as devel/cdialog. dialog(1) is mostly command-line compatible - with the previous version, but the libdialog associated with it has - a largely incompatible API. As such, the original version of libdialog - will be kept temporarily as libodialog, until its base system consumers - are replaced or updated. Bump __FreeBSD_version to 900030. - -20110103: - If you are trying to run make universe on a -stable system, and you get - the following warning: - "Makefile", line 356: "Target architecture for i386/conf/GENERIC - unknown. config(8) likely too old." - or something similar to it, then you must upgrade your -stable system - to 8.2-Release or newer (really, any time after r210146 7/15/2010 in - stable/8) or build the config from the latest stable/8 branch and - install it on your system. - - Prior to this date, building a current universe on 8-stable system from - between 7/15/2010 and 1/2/2011 would result in a weird shell parsing - error in the first kernel build phase. A new config on those old - systems will fix that problem for older versions of -current. - -20101228: - The TCP stack has been modified to allow Khelp modules to interact with - it via helper hook points and store per-connection data in the TCP - control block. Bump __FreeBSD_version to 900029. User space tools that - rely on the size of struct tcpcb in tcp_var.h (e.g. sockstat) need to - be recompiled. - -20101114: - Generic IEEE 802.3 annex 31B full duplex flow control support has been - added to mii(4) and bge(4), bce(4), msk(4), nfe(4) and stge(4) along - with brgphy(4), e1000phy(4) as well as ip1000phy() have been converted - to take advantage of it instead of using custom implementations. This - means that these drivers now no longer unconditionally advertise - support for flow control but only do so if flow control is a selected - media option. This was implemented in the generic support that way in - order to allow flow control to be switched on and off via ifconfig(8) - with the PHY specific default to typically off in order to protect - from unwanted effects. Consequently, if you used flow control with - one of the above mentioned drivers you now need to explicitly enable - it, for example via: - ifconfig bge0 media auto mediaopt flowcontrol - - Along with the above mentioned changes generic support for setting - 1000baseT master mode also has been added and brgphy(4), ciphy(4), - e1000phy(4) as well as ip1000phy(4) have been converted to take - advantage of it. This means that these drivers now no longer take the - link0 parameter for selecting master mode but the master media option - has to be used instead, for example like in the following: - ifconfig bge0 media 1000baseT mediaopt full-duplex,master - - Selection of master mode now is also available with all other PHY - drivers supporting 1000baseT. - -20101111: - The TCP stack has received a significant update to add support for - modularised congestion control and generally improve the clarity of - congestion control decisions. Bump __FreeBSD_version to 900025. User - space tools that rely on the size of struct tcpcb in tcp_var.h (e.g. - sockstat) need to be recompiled. - -20101002: - The man(1) utility has been replaced by a new version that no longer - uses /etc/manpath.config. Please consult man.conf(5) for how to - migrate local entries to the new format. - -20100928: - The copyright strings printed by login(1) and sshd(8) at the time of a - new connection have been removed to follow other operating systems and - upstream sshd. - -20100915: - A workaround for a fixed ld bug has been removed in kernel code, - so make sure that your system ld is built from sources after - revision 210245 from 2010-07-19 (r211583 if building head kernel - on stable/8, r211584 for stable/7; both from 2010-08-21). - A symptom of incorrect ld version is different addresses for - set_pcpu section and __start_set_pcpu symbol in kernel and/or modules. - -20100913: - The $ipv6_prefer variable in rc.conf(5) has been split into - $ip6addrctl_policy and $ipv6_activate_all_interfaces. - - The $ip6addrctl_policy is a variable to choose a pre-defined - address selection policy set by ip6addrctl(8). A value - "ipv4_prefer", "ipv6_prefer" or "AUTO" can be specified. The - default is "AUTO". - - The $ipv6_activate_all_interfaces specifies whether IFDISABLED - flag (see an entry of 20090926) is set on an interface with no - corresponding $ifconfig_IF_ipv6 line. The default is "NO" for - security reason. If you want IPv6 link-local address on all - interfaces by default, set this to "YES". - - The old ipv6_prefer="YES" is equivalent to - ipv6_activate_all_interfaces="YES" and - ip6addrctl_policy="ipv6_prefer". - -20100913: - DTrace has grown support for userland tracing. Due to this, DTrace is - now i386 and amd64 only. - dtruss(1) is now installed by default on those systems and a new - kernel module is needed for userland tracing: fasttrap. - No changes to your kernel config file are necessary to enable - userland tracing, but you might consider adding 'STRIP=' and - 'CFLAGS+=-fno-omit-frame-pointer' to your make.conf if you want - to have informative userland stack traces in DTrace (ustack). - -20100725: - The acpi_aiboost(4) driver has been removed in favor of the new - aibs(4) driver. You should update your kernel configuration file. - -20100722: - BSD grep has been imported to the base system and it is built by - default. It is completely BSD licensed, highly GNU-compatible, uses - less memory than its GNU counterpart and has a small codebase. - However, it is slower than its GNU counterpart, which is mostly - noticeable for larger searches, for smaller ones it is measurable - but not significant. The reason is complex, the most important factor - is that we lack a modern and efficient regex library and GNU - overcomes this by optimizing the searches internally. Future work - on improving the regex performance is planned, for the meantime, - users that need better performance, can build GNU grep instead by - setting the WITH_GNU_GREP knob. - -20100713: - Due to the import of powerpc64 support, all existing powerpc kernel - configuration files must be updated with a machine directive like this: - machine powerpc powerpc - - In addition, an updated config(8) is required to build powerpc kernels - after this change. - -20100713: - A new version of ZFS (version 15) has been merged to -HEAD. - This version uses a python library for the following subcommands: - zfs allow, zfs unallow, zfs groupspace, zfs userspace. - For full functionality of these commands the following port must - be installed: sysutils/py-zfs - -20100429: - 'vm_page's are now hashed by physical address to an array of mutexes. - Currently this is only used to serialize access to hold_count. Over - time the page queue mutex will be peeled away. This changes the size - of pmap on every architecture. And requires all callers of vm_page_hold - and vm_page_unhold to be updated. - -20100402: - WITH_CTF can now be specified in src.conf (not recommended, there - are some problems with static executables), make.conf (would also - affect ports which do not use GNU make and do not override the - compile targets) or in the kernel config (via "makeoptions - WITH_CTF=yes"). - When WITH_CTF was specified there before this was silently ignored, - so make sure that WITH_CTF is not used in places which could lead - to unwanted behavior. - -20100311: - The kernel option COMPAT_IA32 has been replaced with COMPAT_FREEBSD32 - to allow 32-bit compatibility on non-x86 platforms. All kernel - configurations on amd64 and ia64 platforms using these options must - be modified accordingly. - -20100113: - The utmp user accounting database has been replaced with utmpx, - the user accounting interface standardized by POSIX. - Unfortunately the semantics of utmp and utmpx don't match, - making it practically impossible to support both interfaces. - The user accounting database is used by tools like finger(1), - last(1), talk(1), w(1) and ac(8). - - All applications in the base system use utmpx. This means only - local binaries (e.g. from the ports tree) may still use these - utmp database files. These applications must be rebuilt to make - use of utmpx. - - After the system has been upgraded, it is safe to remove the old - log files (/var/run/utmp, /var/log/lastlog and /var/log/wtmp*), - assuming their contents is of no importance anymore. Old wtmp - databases can only be used by last(1) and ac(8) after they have - been converted to the new format using wtmpcvt(1). - -20100108: - Introduce the kernel thread "deadlock resolver" (which can be enabled - via the DEADLKRES option, see NOTES for more details) and the - sleepq_type() function for sleepqueues. - -20091202: - The rc.firewall and rc.firewall6 were unified, and - rc.firewall6 and rc.d/ip6fw were removed. - According to the removal of rc.d/ip6fw, ipv6_firewall_* rc - variables are obsoleted. Instead, the following new rc - variables are added to rc.d/ipfw: - - firewall_client_net_ipv6, firewall_simple_iif_ipv6, - firewall_simple_inet_ipv6, firewall_simple_oif_ipv6, - firewall_simple_onet_ipv6, firewall_trusted_ipv6 - - The meanings correspond to the relevant IPv4 variables. - -20091125: - 8.0-RELEASE. - -20091113: - The default terminal emulation for syscons(4) has been changed - from cons25 to xterm on all platforms except pc98. This means - that the /etc/ttys file needs to be updated to ensure correct - operation of applications on the console. - - The terminal emulation style can be toggled per window by using - vidcontrol(1)'s -T flag. The TEKEN_CONS25 kernel configuration - options can be used to change the compile-time default back to - cons25. - - To prevent graphical artifacts, make sure the TERM environment - variable is set to match the terminal emulation that is being - performed by syscons(4). - -20091109: - The layout of the structure ieee80211req_scan_result has changed. - Applications that require wireless scan results (e.g. ifconfig(8)) - from net80211 need to be recompiled. - - Applications such as wpa_supplicant(8) may require a full world - build without using NO_CLEAN in order to get synchronized with the - new structure. - -20091025: - The iwn(4) driver has been updated to support the 5000 and 5150 series. - There's one kernel module for each firmware. Adding "device iwnfw" - to the kernel configuration file means including all three firmware - images inside the kernel. If you want to include just the one for - your wireless card, use the devices iwn4965fw, iwn5000fw or - iwn5150fw. - -20090926: - The rc.d/network_ipv6, IPv6 configuration script has been integrated - into rc.d/netif. The changes are the following: - - 1. To use IPv6, simply define $ifconfig_IF_ipv6 like $ifconfig_IF - for IPv4. For aliases, $ifconfig_IF_aliasN should be used. - Note that both variables need the "inet6" keyword at the head. - - Do not set $ipv6_network_interfaces manually if you do not - understand what you are doing. It is not needed in most cases. - - $ipv6_ifconfig_IF and $ipv6_ifconfig_IF_aliasN still work, but - they are obsolete. - - 2. $ipv6_enable is obsolete. Use $ipv6_prefer and - "inet6 accept_rtadv" keyword in ifconfig(8) instead. - - If you define $ipv6_enable=YES, it means $ipv6_prefer=YES and - all configured interfaces have "inet6 accept_rtadv" in the - $ifconfig_IF_ipv6. These are for backward compatibility. - - 3. A new variable $ipv6_prefer has been added. If NO, IPv6 - functionality of interfaces with no corresponding - $ifconfig_IF_ipv6 is disabled by using "inet6 ifdisabled" flag, - and the default address selection policy of ip6addrctl(8) - is the IPv4-preferred one (see rc.d/ip6addrctl for more details). - Note that if you want to configure IPv6 functionality on the - disabled interfaces after boot, first you need to clear the flag by - using ifconfig(8) like: - - ifconfig em0 inet6 -ifdisabled - - If YES, the default address selection policy is set as - IPv6-preferred. - - The default value of $ipv6_prefer is NO. - - 4. If your system need to receive Router Advertisement messages, - define "inet6 accept_rtadv" in $ifconfig_IF_ipv6. The rc(8) - scripts automatically invoke rtsol(8) when the interface becomes - UP. The Router Advertisement messages are used for SLAAC - (State-Less Address AutoConfiguration). - -20090922: - 802.11s D3.03 support was committed. This is incompatible with the - previous code, which was based on D3.0. - -20090912: - A sysctl variable net.inet6.ip6.accept_rtadv now sets the default value - of a per-interface flag ND6_IFF_ACCEPT_RTADV, not a global knob to - control whether accepting Router Advertisement messages or not. - Also, a per-interface flag ND6_IFF_AUTO_LINKLOCAL has been added and - a sysctl variable net.inet6.ip6.auto_linklocal is its default value. - The ifconfig(8) utility now supports these flags. - -20090910: - ZFS snapshots are now mounted with MNT_IGNORE flag. Use -v option for - mount(8) and -a option for df(1) to see them. - -20090825: - The old tunable hw.bus.devctl_disable has been superseded by - hw.bus.devctl_queue. hw.bus.devctl_disable=1 in loader.conf should be - replaced by hw.bus.devctl_queue=0. The default for this new tunable - is 1000. - -20090813: - Remove the option STOP_NMI. The default action is now to use NMI only - for KDB via the newly introduced function stop_cpus_hard() and - maintain stop_cpus() to just use a normal IPI_STOP on ia32 and amd64. - -20090803: - The stable/8 branch created in subversion. This corresponds to the - RELENG_8 branch in CVS. - -20090719: - Bump the shared library version numbers for all libraries that do not - use symbol versioning as part of the 8.0-RELEASE cycle. Bump - __FreeBSD_version to 800105. - -20090714: - Due to changes in the implementation of virtual network stack support, - all network-related kernel modules must be recompiled. As this change - breaks the ABI, bump __FreeBSD_version to 800104. - -20090713: - The TOE interface to the TCP syncache has been modified to remove - struct tcpopt () from the ABI of the network stack. - The cxgb driver is the only TOE consumer affected by this change, and - needs to be recompiled along with the kernel. As this change breaks - the ABI, bump __FreeBSD_version to 800103. - -20090712: - Padding has been added to struct tcpcb, sackhint and tcpstat in - to facilitate future MFCs and bug fixes whilst - maintaining the ABI. However, this change breaks the ABI, so bump - __FreeBSD_version to 800102. User space tools that rely on the size of - any of these structs (e.g. sockstat) need to be recompiled. - -20090630: - The NFS_LEGACYRPC option has been removed along with the old kernel - RPC implementation that this option selected. Kernel configurations - may need to be adjusted. - -20090629: - The network interface device nodes at /dev/net/ have been - removed. All ioctl operations can be performed the normal way using - routing sockets. The kqueue functionality can generally be replaced - with routing sockets. - -20090628: - The documentation from the FreeBSD Documentation Project (Handbook, - FAQ, etc.) is now installed via packages by sysinstall(8) and under - the /usr/local/share/doc/freebsd directory instead of /usr/share/doc. - -20090624: - The ABI of various structures related to the SYSV IPC API have been - changed. As a result, the COMPAT_FREEBSD[456] and COMPAT_43 kernel - options now all require COMPAT_FREEBSD7. Bump __FreeBSD_version to - 800100. - -20090622: - Layout of struct vnet has changed as routing related variables were - moved to their own Vimage module. Modules need to be recompiled. Bump - __FreeBSD_version to 800099. - -20090619: - NGROUPS_MAX and NGROUPS have been increased from 16 to 1023 and 1024 - respectively. As long as no more than 16 groups per process are used, - no changes should be visible. When more than 16 groups are used, old - binaries may fail if they call getgroups() or getgrouplist() with - statically sized storage. Recompiling will work around this, but - applications should be modified to use dynamically allocated storage - for group arrays as POSIX.1-2008 does not cap an implementation's - number of supported groups at NGROUPS_MAX+1 as previous versions did. - - NFS and portalfs mounts may also be affected as the list of groups is - truncated to 16. Users of NFS who use more than 16 groups, should - take care that negative group permissions are not used on the exported - file systems as they will not be reliable unless a GSSAPI based - authentication method is used. - -20090616: - The compiling option ADAPTIVE_LOCKMGRS has been introduced. This - option compiles in the support for adaptive spinning for lockmgrs - which want to enable it. The lockinit() function now accepts the flag - LK_ADAPTIVE in order to make the lock object subject to adaptive - spinning when both held in write and read mode. - -20090613: - The layout of the structure returned by IEEE80211_IOC_STA_INFO has - changed. User applications that use this ioctl need to be rebuilt. - -20090611: - The layout of struct thread has changed. Kernel and modules need to - be rebuilt. - -20090608: - The layout of structs ifnet, domain, protosw and vnet_net has changed. - Kernel modules need to be rebuilt. Bump __FreeBSD_version to 800097. - -20090602: - window(1) has been removed from the base system. It can now be - installed from ports. The port is called misc/window. - -20090601: - The way we are storing and accessing `routing table' entries has - changed. Programs reading the FIB, like netstat, need to be - re-compiled. - -20090601: - A new netisr implementation has been added for FreeBSD 8. Network - file system modules, such as igmp, ipdivert, and others, should be - rebuilt. - Bump __FreeBSD_version to 800096. - -20090530: - Remove the tunable/sysctl debug.mpsafevfs as its initial purpose is no - more valid. - -20090530: - Add VOP_ACCESSX(9). File system modules need to be rebuilt. - Bump __FreeBSD_version to 800094. - -20090529: - Add mnt_xflag field to 'struct mount'. File system modules need to be - rebuilt. - Bump __FreeBSD_version to 800093. - -20090528: - The compiling option ADAPTIVE_SX has been retired while it has been - introduced the option NO_ADAPTIVE_SX which handles the reversed logic. - The KPI for sx_init_flags() changes as accepting flags: - SX_ADAPTIVESPIN flag has been retired while the SX_NOADAPTIVE flag has - been introduced in order to handle the reversed logic. - Bump __FreeBSD_version to 800092. - -20090527: - Add support for hierarchical jails. Remove global securelevel. - Bump __FreeBSD_version to 800091. - -20090523: - The layout of struct vnet_net has changed, therefore modules - need to be rebuilt. - Bump __FreeBSD_version to 800090. - -20090523: - The newly imported zic(8) produces a new format in the output. Please - run tzsetup(8) to install the newly created data to /etc/localtime. - -20090520: - The sysctl tree for the usb stack has renamed from hw.usb2.* to - hw.usb.* and is now consistent again with previous releases. - -20090520: - 802.11 monitor mode support was revised and driver api's were changed. - Drivers dependent on net80211 now support DLT_IEEE802_11_RADIO instead - of DLT_IEEE802_11. No user-visible data structures were changed but - applications that use DLT_IEEE802_11 may require changes. - Bump __FreeBSD_version to 800088. - -20090430: - The layout of the following structs has changed: sysctl_oid, - socket, ifnet, inpcbinfo, tcpcb, syncache_head, vnet_inet, - vnet_inet6 and vnet_ipfw. Most modules need to be rebuild or - panics may be experienced. World rebuild is required for - correctly checking networking state from userland. - Bump __FreeBSD_version to 800085. - -20090429: - MLDv2 and Source-Specific Multicast (SSM) have been merged - to the IPv6 stack. VIMAGE hooks are in but not yet used. - The implementation of SSM within FreeBSD's IPv6 stack closely - follows the IPv4 implementation. - - For kernel developers: - - * The most important changes are that the ip6_output() and - ip6_input() paths no longer take the IN6_MULTI_LOCK, - and this lock has been downgraded to a non-recursive mutex. - - * As with the changes to the IPv4 stack to support SSM, filtering - of inbound multicast traffic must now be performed by transport - protocols within the IPv6 stack. This does not apply to TCP and - SCTP, however, it does apply to UDP in IPv6 and raw IPv6. - - * The KPIs used by IPv6 multicast are similar to those used by - the IPv4 stack, with the following differences: - * im6o_mc_filter() is analogous to imo_multicast_filter(). - * The legacy KAME entry points in6_joingroup and in6_leavegroup() - are shimmed to in6_mc_join() and in6_mc_leave() respectively. - * IN6_LOOKUP_MULTI() has been deprecated and removed. - * IPv6 relies on MLD for the DAD mechanism. KAME's internal KPIs - for MLDv1 have an additional 'timer' argument which is used to - jitter the initial membership report for the solicited-node - multicast membership on-link. - * This is not strictly needed for MLDv2, which already jitters - its report transmissions. However, the 'timer' argument is - preserved in case MLDv1 is active on the interface. - - * The KAME linked-list based IPv6 membership implementation has - been refactored to use a vector similar to that used by the IPv4 - stack. - Code which maintains a list of its own multicast memberships - internally, e.g. carp, has been updated to reflect the new - semantics. - - * There is a known Lock Order Reversal (LOR) due to in6_setscope() - acquiring the IF_AFDATA_LOCK and being called within ip6_output(). - Whilst MLDv2 tries to avoid this otherwise benign LOR, it is an - implementation constraint which needs to be addressed in HEAD. - - For application developers: - - * The changes are broadly similar to those made for the IPv4 - stack. - - * The use of IPv4 and IPv6 multicast socket options on the same - socket, using mapped addresses, HAS NOT been tested or supported. - - * There are a number of issues with the implementation of various - IPv6 multicast APIs which need to be resolved in the API surface - before the implementation is fully compatible with KAME userland - use, and these are mostly to do with interface index treatment. - - * The literature available discusses the use of either the delta / ASM - API with setsockopt(2)/getsockopt(2), or the full-state / ASM API - using setsourcefilter(3)/getsourcefilter(3). For more information - please refer to RFC 3768, 'Socket Interface Extensions for - Multicast Source Filters'. - - * Applications which use the published RFC 3678 APIs should be fine. - - For systems administrators: - - * The mtest(8) utility has been refactored to support IPv6, in - addition to IPv4. Interface addresses are no longer accepted - as arguments, their names must be used instead. The utility - will map the interface name to its first IPv4 address as - returned by getifaddrs(3). - - * The ifmcstat(8) utility has also been updated to print the MLDv2 - endpoint state and source filter lists via sysctl(3). - - * The net.inet6.ip6.mcast.loop sysctl may be tuned to 0 to disable - loopback of IPv6 multicast datagrams by default; it defaults to 1 - to preserve the existing behaviour. Disabling multicast loopback is - recommended for optimal system performance. - - * The IPv6 MROUTING code has been changed to examine this sysctl - instead of attempting to perform a group lookup before looping - back forwarded datagrams. - - Bump __FreeBSD_version to 800084. - -20090422: - Implement low-level Bluetooth HCI API. - Bump __FreeBSD_version to 800083. - -20090419: - The layout of struct malloc_type, used by modules to register new - memory allocation types, has changed. Most modules will need to - be rebuilt or panics may be experienced. - Bump __FreeBSD_version to 800081. - -20090415: - Anticipate overflowing inp_flags - add inp_flags2. - This changes most offsets in inpcb, so checking v4 connection - state will require a world rebuild. - Bump __FreeBSD_version to 800080. - -20090415: - Add an llentry to struct route and struct route_in6. Modules - embedding a struct route will need to be recompiled. - Bump __FreeBSD_version to 800079. - -20090414: - The size of rt_metrics_lite and by extension rtentry has changed. - Networking administration apps will need to be recompiled. - The route command now supports show as an alias for get, weighting - of routes, sticky and nostick flags to alter the behavior of stateful - load balancing. - Bump __FreeBSD_version to 800078. - -20090408: - Do not use Giant for kbdmux(4) locking. This is wrong and - apparently causing more problems than it solves. This will - re-open the issue where interrupt handlers may race with - kbdmux(4) in polling mode. Typical symptoms include (but - not limited to) duplicated and/or missing characters when - low level console functions (such as gets) are used while - interrupts are enabled (for example geli password prompt, - mountroot prompt etc.). Disabling kbdmux(4) may help. - -20090407: - The size of structs vnet_net, vnet_inet and vnet_ipfw has changed; - kernel modules referencing any of the above need to be recompiled. - Bump __FreeBSD_version to 800075. - -20090320: - GEOM_PART has become the default partition slicer for storage devices, - replacing GEOM_MBR, GEOM_BSD, GEOM_PC98 and GEOM_GPT slicers. It - introduces some changes: - - MSDOS/EBR: the devices created from MSDOS extended partition entries - (EBR) can be named differently than with GEOM_MBR and are now symlinks - to devices with offset-based names. fstabs may need to be modified. - - BSD: the "geometry does not match label" warning is harmless in most - cases but it points to problems in file system misalignment with - disk geometry. The "c" partition is now implicit, covers the whole - top-level drive and cannot be (mis)used by users. - - General: Kernel dumps are now not allowed to be written to devices - whose partition types indicate they are meant to be used for file - systems (or, in case of MSDOS partitions, as something else than - the "386BSD" type). - - Most of these changes date approximately from 200812. - -20090319: - The uscanner(4) driver has been removed from the kernel. This follows - Linux removing theirs in 2.6 and making libusb the default interface - (supported by sane). - -20090319: - The multicast forwarding code has been cleaned up. netstat(1) - only relies on KVM now for printing bandwidth upcall meters. - The IPv4 and IPv6 modules are split into ip_mroute_mod and - ip6_mroute_mod respectively. The config(5) options for statically - compiling this code remain the same, i.e. 'options MROUTING'. - -20090315: - Support for the IFF_NEEDSGIANT network interface flag has been - removed, which means that non-MPSAFE network device drivers are no - longer supported. In particular, if_ar, if_sr, and network device - drivers from the old (legacy) USB stack can no longer be built or - used. - -20090313: - POSIX.1 Native Language Support (NLS) has been enabled in libc and - a bunch of new language catalog files have also been added. - This means that some common libc messages are now localized and - they depend on the LC_MESSAGES environmental variable. - -20090313: - The k8temp(4) driver has been renamed to amdtemp(4) since - support for Family 10 and Family 11 CPU families was added. - -20090309: - IGMPv3 and Source-Specific Multicast (SSM) have been merged - to the IPv4 stack. VIMAGE hooks are in but not yet used. - - For kernel developers, the most important changes are that the - ip_output() and ip_input() paths no longer take the IN_MULTI_LOCK(), - and this lock has been downgraded to a non-recursive mutex. - - Transport protocols (UDP, Raw IP) are now responsible for filtering - inbound multicast traffic according to group membership and source - filters. The imo_multicast_filter() KPI exists for this purpose. - Transports which do not use multicast (SCTP, TCP) already reject - multicast by default. Forwarding and receive performance may improve - as a mutex acquisition is no longer needed in the ip_input() - low-level input path. in_addmulti() and in_delmulti() are shimmed - to new KPIs which exist to support SSM in-kernel. - - For application developers, it is recommended that loopback of - multicast datagrams be disabled for best performance, as this - will still cause the lock to be taken for each looped-back - datagram transmission. The net.inet.ip.mcast.loop sysctl may - be tuned to 0 to disable loopback by default; it defaults to 1 - to preserve the existing behaviour. - - For systems administrators, to obtain best performance with - multicast reception and multiple groups, it is always recommended - that a card with a suitably precise hash filter is used. Hash - collisions will still result in the lock being taken within the - transport protocol input path to check group membership. - - If deploying FreeBSD in an environment with IGMP snooping switches, - it is recommended that the net.inet.igmp.sendlocal sysctl remain - enabled; this forces 224.0.0.0/24 group membership to be announced - via IGMP. - - The size of 'struct igmpstat' has changed; netstat needs to be - recompiled to reflect this. - Bump __FreeBSD_version to 800070. - -20090309: - libusb20.so.1 is now installed as libusb.so.1 and the ports system - updated to use it. This requires a buildworld/installworld in order to - update the library and dependencies (usbconfig, etc). Its advisable to - rebuild all ports which uses libusb. More specific directions are given - in the ports collection UPDATING file. Any /etc/libmap.conf entries for - libusb are no longer required and can be removed. - -20090302: - A workaround is committed to allow the creation of System V shared - memory segment of size > 2 GB on the 64-bit architectures. - Due to a limitation of the existing ABI, the shm_segsz member - of the struct shmid_ds, returned by shmctl(IPC_STAT) call is - wrong for large segments. Note that limits must be explicitly - raised to allow such segments to be created. - -20090301: - The layout of struct ifnet has changed, requiring a rebuild of all - network device driver modules. - -20090227: - The /dev handling for the new USB stack has changed, a - buildworld/installworld is required for libusb20. - -20090223: - The new USB2 stack has now been permanently moved in and all kernel and - module names reverted to their previous values (eg, usb, ehci, ohci, - ums, ...). The old usb stack can be compiled in by prefixing the name - with the letter 'o', the old usb modules have been removed. - Updating entry 20090216 for xorg and 20090215 for libmap may still - apply. - -20090217: - The rc.conf(5) option if_up_delay has been renamed to - defaultroute_delay to better reflect its purpose. If you have - customized this setting in /etc/rc.conf you need to update it to - use the new name. - -20090216: - xorg 7.4 wants to configure its input devices via hald which does not - yet work with USB2. If the keyboard/mouse does not work in xorg then - add - Option "AllowEmptyInput" "off" - to your ServerLayout section. This will cause X to use the configured - kbd and mouse sections from your xorg.conf. - -20090215: - The GENERIC kernels for all architectures now default to the new USB2 - stack. No kernel config options or code have been removed so if a - problem arises please report it and optionally revert to the old USB - stack. If you are loading USB kernel modules or have a custom kernel - that includes GENERIC then ensure that usb names are also changed over, - eg uftdi -> usb2_serial_ftdi. - - Older programs linked against the ports libusb 0.1 need to be - redirected to the new stack's libusb20. /etc/libmap.conf can - be used for this: - # Map old usb library to new one for usb2 stack - libusb-0.1.so.8 libusb20.so.1 - -20090209: - All USB ethernet devices now attach as interfaces under the name ueN - (eg. ue0). This is to provide a predictable name as vendors often - change usb chipsets in a product without notice. - -20090203: - The ichsmb(4) driver has been changed to require SMBus slave - addresses be left-justified (xxxxxxx0b) rather than right-justified. - All of the other SMBus controller drivers require left-justified - slave addresses, so this change makes all the drivers provide the - same interface. - -20090201: - INET6 statistics (struct ip6stat) was updated. - netstat(1) needs to be recompiled. - -20090119: - NTFS has been removed from GENERIC kernel on amd64 to match - GENERIC on i386. Should not cause any issues since mount_ntfs(8) - will load ntfs.ko module automatically when NTFS support is - actually needed, unless ntfs.ko is not installed or security - level prohibits loading kernel modules. If either is the case, - "options NTFS" has to be added into kernel config. - -20090115: - TCP Appropriate Byte Counting (RFC 3465) support added to kernel. - New field in struct tcpcb breaks ABI, so bump __FreeBSD_version to - 800061. User space tools that rely on the size of struct tcpcb in - tcp_var.h (e.g. sockstat) need to be recompiled. - -20081225: - ng_tty(4) module updated to match the new TTY subsystem. - Due to API change, user-level applications must be updated. - New API support added to mpd5 CVS and expected to be present - in next mpd5.3 release. - -20081219: - With __FreeBSD_version 800060 the makefs tool is part of - the base system (it was a port). - -20081216: - The afdata and ifnet locks have been changed from mutexes to - rwlocks, network modules will need to be re-compiled. - -20081214: - __FreeBSD_version 800059 incorporates the new arp-v2 rewrite. - RTF_CLONING, RTF_LLINFO and RTF_WASCLONED flags are eliminated. - The new code reduced struct rtentry{} by 16 bytes on 32-bit - architecture and 40 bytes on 64-bit architecture. The userland - applications "arp" and "ndp" have been updated accordingly. - The output from "netstat -r" shows only routing entries and *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue May 6 15:44:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8FD5BBE; Tue, 6 May 2014 15:44:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1645494; Tue, 6 May 2014 15:44:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46Fikxt080969; Tue, 6 May 2014 15:44:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46Fik0h080968; Tue, 6 May 2014 15:44:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405061544.s46Fik0h080968@svn.freebsd.org> From: Warner Losh Date: Tue, 6 May 2014 15:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265453 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 15:44:48 -0000 Author: imp Date: Tue May 6 15:44:46 2014 New Revision: 265453 URL: http://svnweb.freebsd.org/changeset/base/265453 Log: No need to install man pages for bootstrapping new make. Some environments (that I can't reproduce locally, but that others have reported) seem to get tripped up by this man page install. There's really no need to do it, so turn off the man pages using the most portable method. We can't just directly set MK_MAN=no here because we're bootstrapping in the host environment and such a setting was forbidden until very recently. NO_MAN= can produce a warning, but for now the warning is benign. Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Tue May 6 15:44:41 2014 (r265452) +++ head/Makefile Tue May 6 15:44:46 2014 (r265453) @@ -347,7 +347,7 @@ make bmake: .PHONY ${MMAKE} obj && \ ${MMAKE} depend && \ ${MMAKE} all && \ - ${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR= + ${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR= NO_MAN=t tinderbox toolchains kernel-toolchains: upgrade_checks From owner-svn-src-head@FreeBSD.ORG Tue May 6 15:52:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BC96229; Tue, 6 May 2014 15:52:31 +0000 (UTC) Received: from mail-qa0-x233.google.com (mail-qa0-x233.google.com [IPv6:2607:f8b0:400d:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B000917F; Tue, 6 May 2014 15:52:30 +0000 (UTC) Received: by mail-qa0-f51.google.com with SMTP id w8so5469630qac.10 for ; Tue, 06 May 2014 08:52:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=nel9Uvs9rYhglTBiWnH4OZ4B1zUd3bkpkF6LWdNncQA=; b=ybQZjE6dGAv6KDxkBoWhjjisFfxra6AbmAVyf9dJ5+yNyjecqJOY4tJ+kxc0ruijdi Nz6bCdsZUpn8KY2vkuB0wextP5iXAKqODrvks89BxcabyzoP9mm8a0uhWUVuiL/NK3i8 1rFciNG9OlMc3XNcpDs85v0bG2mgmAMaUrDiyWJliXMkNL50V+HD3XcP6nBdVEwZKdY/ kbeuID/huVwRGUZqKUxIP5c/djoTC8FOtdes4glaKBWU798/ue+ik1YbuSE4qltPb9nN sDZgq2g2LPxuXYuZlIRrZF36I8at0xbW8S2mkU0e/Jd9w1eJ0cOargalK6vkVxlADpH+ 3a4g== MIME-Version: 1.0 X-Received: by 10.224.126.9 with SMTP id a9mr56566542qas.39.1399391549890; Tue, 06 May 2014 08:52:29 -0700 (PDT) Received: by 10.140.50.235 with HTTP; Tue, 6 May 2014 08:52:29 -0700 (PDT) In-Reply-To: <536860D3.5030205@freebsd.org> References: <201405051619.s45GJPr6074677@svn.freebsd.org> <536860D3.5030205@freebsd.org> Date: Tue, 6 May 2014 08:52:29 -0700 Message-ID: Subject: Re: svn commit: r265364 - head/sys/amd64/vmm From: Neel Natu To: Julian Elischer Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Neel Natu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 15:52:31 -0000 Hi Julian, On Mon, May 5, 2014 at 9:10 PM, Julian Elischer wrote: > On 5/6/14, 12:19 AM, Neel Natu wrote: >> >> Author: neel >> Date: Mon May 5 16:19:24 2014 >> New Revision: 265364 >> URL: http://svnweb.freebsd.org/changeset/base/265364 >> >> Log: >> Virtual machine halt detection is turned on by default. Allow it to be >> disabled via the tunable 'hw.vmm.halt_detection'. > > So this can only be changed at boot time for the host? not even as a sysctl? The tunable can be set any time before loading vmm.ko: - If you load vmm.ko at boot time then it needs to be set via loader.conf. - If you load vmm.ko after the host is booted then it can be set via kenv(1). > Why is that? It is the easiest way to change the default without any additional complexity. > Why can this not be done from the App? It can be done but I don't think it would be used much. best Neel > >> Modified: >> head/sys/amd64/vmm/vmm.c >> >> Modified: head/sys/amd64/vmm/vmm.c >> >> ============================================================================== >> --- head/sys/amd64/vmm/vmm.c Mon May 5 15:59:31 2014 (r265363) >> +++ head/sys/amd64/vmm/vmm.c Mon May 5 16:19:24 2014 (r265364) >> @@ -189,6 +189,16 @@ static VMM_STAT(VCPU_TOTAL_RUNTIME, "vcp >> SYSCTL_NODE(_hw, OID_AUTO, vmm, CTLFLAG_RW, NULL, NULL); >> +/* >> + * Halt the guest if all vcpus are executing a HLT instruction with >> + * interrupts disabled. >> + */ >> +static int halt_detection_enabled = 1; >> +TUNABLE_INT("hw.vmm.halt_detection", &halt_detection_enabled); >> +SYSCTL_INT(_hw_vmm, OID_AUTO, halt_detection, CTLFLAG_RDTUN, >> + &halt_detection_enabled, 0, >> + "Halt VM if all vcpus execute HLT with interrupts disabled"); >> + >> static int vmm_ipinum; >> SYSCTL_INT(_hw_vmm, OID_AUTO, ipinum, CTLFLAG_RD, &vmm_ipinum, 0, >> "IPI vector used for vcpu notifications"); >> @@ -1047,7 +1057,7 @@ vm_handle_hlt(struct vm *vm, int vcpuid, >> if (intr_disabled) { >> wmesg = "vmhalt"; >> VCPU_CTR0(vm, vcpuid, "Halted"); >> - if (!vcpu_halted) { >> + if (!vcpu_halted && halt_detection_enabled) { >> vcpu_halted = 1; >> CPU_SET_ATOMIC(vcpuid, &vm->halted_cpus); >> } >> >> >> > From owner-svn-src-head@FreeBSD.ORG Tue May 6 16:01:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FE2146E; Tue, 6 May 2014 16:01:59 +0000 (UTC) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 80A3A250; Tue, 6 May 2014 16:01:58 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.8/8.14.8/ALCHEMY.FRANKEN.DE) with ESMTP id s46G1sN6094706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 May 2014 18:01:54 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.8/8.14.8/Submit) id s46G1s20094705; Tue, 6 May 2014 18:01:54 +0200 (CEST) (envelope-from marius) Date: Tue, 6 May 2014 18:01:54 +0200 From: Marius Strobl To: Hans Petter Selasky Subject: Re: svn commit: r265359 - head/sys/modules/sound/sound Message-ID: <20140506160154.GA679@alchemy.franken.de> References: <201405051431.s45EVZ2q027729@svn.freebsd.org> <7745BD19-5BAE-47BD-8DE4-10CF7E23FA9D@gmail.com> <53690381.9040909@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53690381.9040909@selasky.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (alchemy.franken.de [0.0.0.0]); Tue, 06 May 2014 18:01:54 +0200 (CEST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 16:01:59 -0000 On Tue, May 06, 2014 at 05:45:05PM +0200, Hans Petter Selasky wrote: > On 05/05/14 22:39, Warner Losh wrote: > > > > On May 5, 2014, at 8:31 AM, Hans Petter Selasky wrote: > > > >> Author: hselasky > >> Date: Mon May 5 14:31:34 2014 > >> New Revision: 265359 > >> URL: http://svnweb.freebsd.org/changeset/base/265359 > >> > >> Log: > >> Build the kernel sound module without ISA DMA support for ARM and MIPS > >> platforms, because these platforms do not implement the ISA DMA > >> API. Else the sound modules cannot be loaded when running these > >> platforms. > >> > >> MFC after: 2 weeks > >> > >> Modified: > >> head/sys/modules/sound/sound/Makefile > >> > >> Modified: head/sys/modules/sound/sound/Makefile > >> ============================================================================== > >> --- head/sys/modules/sound/sound/Makefile Mon May 5 11:50:52 2014 (r265358) > >> +++ head/sys/modules/sound/sound/Makefile Mon May 5 14:31:34 2014 (r265359) > >> @@ -44,7 +44,8 @@ CLEANFILES+= feeder_eq_gen.h feeder_rate > >> > >> EXPORT_SYMS= YES # XXX evaluate > >> > >> -.if ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "powerpc" > >> +.if ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "powerpc" || \ > >> + ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" > >> # Create an empty opt_isa.h in order to keep kmod.mk from linking in an > >> # existing one from KERNBUILDDIR which possibly has DEV_ISA defined so > >> # sound.ko is always built without isadma support. > > > > Rather than an opt-in approach here, why not lust list the three that have it since > > they are the only ones that will ever have it? > > > > Warner > > > > Hi, > > Maybe the sound DMA file belongs in its own module? > It's not just sndbuf_dma.c but also the #ifdef'ed DEV_ISA code in channel.c on architectures that have ISA but not ISA DMA support, hence the current kludge. Marius From owner-svn-src-head@FreeBSD.ORG Tue May 6 16:29:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C629FBA; Tue, 6 May 2014 16:29:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAA23660; Tue, 6 May 2014 16:29:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46GT269001727; Tue, 6 May 2014 16:29:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46GT2j8001722; Tue, 6 May 2014 16:29:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201405061629.s46GT2j8001722@svn.freebsd.org> From: Marius Strobl Date: Tue, 6 May 2014 16:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265454 - head/sbin/gvinum X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 16:29:03 -0000 Author: marius Date: Tue May 6 16:29:02 2014 New Revision: 265454 URL: http://svnweb.freebsd.org/changeset/base/265454 Log: - Allow foot shooting with the resetconfig command via the -f option. - Fix typos preventing -f to actually work with the create command. - Initialize flags to zero rather than using stack garbage when handling the grow command. MFC after: 3 days Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: head/sbin/gvinum/gvinum.8 head/sbin/gvinum/gvinum.c Modified: head/sbin/gvinum/gvinum.8 ============================================================================== --- head/sbin/gvinum/gvinum.8 Tue May 6 15:44:46 2014 (r265453) +++ head/sbin/gvinum/gvinum.8 Tue May 6 16:29:02 2014 (r265454) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 1, 2013 +.Dd May 6, 2014 .Dt GVINUM 8 .Os .Sh NAME @@ -168,7 +168,7 @@ the beginning of the plex if the .Fl f flag is specified, or otherwise at the location of the parity check pointer. All subdisks in the plex must be up for a parity check. -.It Ic resetconfig +.It Ic resetconfig Oo Fl f Oc Reset the complete .Nm configuration. Modified: head/sbin/gvinum/gvinum.c ============================================================================== --- head/sbin/gvinum/gvinum.c Tue May 6 15:44:46 2014 (r265453) +++ head/sbin/gvinum/gvinum.c Tue May 6 16:29:02 2014 (r265454) @@ -71,7 +71,7 @@ void gvinum_parityop(int, char **, int); void gvinum_printconfig(int, char **); void gvinum_raid5(int, char **); void gvinum_rename(int, char **); -void gvinum_resetconfig(void); +void gvinum_resetconfig(int, char **); void gvinum_rm(int, char **); void gvinum_saveconfig(void); void gvinum_setstate(int, char **); @@ -193,8 +193,8 @@ gvinum_create(int argc, char **argv) flags |= GV_FLAG_F; /* Else it must be a file. */ } else { - if ((tmp = fopen(argv[1], "r")) == NULL) { - warn("can't open '%s' for reading", argv[1]); + if ((tmp = fopen(argv[i], "r")) == NULL) { + warn("can't open '%s' for reading", argv[i]); return; } } @@ -723,7 +723,7 @@ gvinum_help(void) " Change the name of the specified object.\n" "rebuildparity plex [-f]\n" " Rebuild the parity blocks of a RAID-5 plex.\n" - "resetconfig\n" + "resetconfig [-f]\n" " Reset the complete gvinum configuration\n" "rm [-r] [-f] volume | plex | subdisk | drive\n" " Remove an object.\n" @@ -1102,26 +1102,40 @@ gvinum_rm(int argc, char **argv) } void -gvinum_resetconfig(void) +gvinum_resetconfig(int argc, char **argv) { struct gctl_req *req; const char *errstr; char reply[32]; + int flags, i; - if (!isatty(STDIN_FILENO)) { - warn("Please enter this command from a tty device\n"); - return; + flags = 0; + while ((i = getopt(argc, argv, "f")) != -1) { + switch (i) { + case 'f': + flags |= GV_FLAG_F; + break; + default: + warn("invalid flag: %c", i); + return; + } } - printf(" WARNING! This command will completely wipe out your gvinum" - "configuration.\n" - " All data will be lost. If you really want to do this," - " enter the text\n\n" - " NO FUTURE\n" - " Enter text -> "); - fgets(reply, sizeof(reply), stdin); - if (strcmp(reply, "NO FUTURE\n")) { - printf("\n No change\n"); - return; + if ((flags & GV_FLAG_F) == 0) { + if (!isatty(STDIN_FILENO)) { + warn("Please enter this command from a tty device\n"); + return; + } + printf(" WARNING! This command will completely wipe out" + " your gvinum configuration.\n" + " All data will be lost. If you really want to do this," + " enter the text\n\n" + " NO FUTURE\n" + " Enter text -> "); + fgets(reply, sizeof(reply), stdin); + if (strcmp(reply, "NO FUTURE\n")) { + printf("\n No change\n"); + return; + } } req = gctl_get_handle(); gctl_ro_param(req, "class", -1, "VINUM"); @@ -1262,6 +1276,7 @@ gvinum_grow(int argc, char **argv) const char *errstr; int drives, volumes, plexes, subdisks, flags; + flags = 0; drives = volumes = plexes = subdisks = 0; if (argc < 3) { warnx("usage:\tgrow plex drive\n"); @@ -1372,7 +1387,7 @@ parseline(int argc, char **argv) else if (!strcmp(argv[0], "rename")) gvinum_rename(argc, argv); else if (!strcmp(argv[0], "resetconfig")) - gvinum_resetconfig(); + gvinum_resetconfig(argc, argv); else if (!strcmp(argv[0], "rm")) gvinum_rm(argc, argv); else if (!strcmp(argv[0], "saveconfig")) From owner-svn-src-head@FreeBSD.ORG Tue May 6 16:50:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37A50EFA; Tue, 6 May 2014 16:50:13 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id D51C292C; Tue, 6 May 2014 16:50:12 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id E39D8781369; Wed, 7 May 2014 02:26:21 +1000 (EST) Date: Wed, 7 May 2014 02:26:20 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Matthew Fleming Subject: Re: svn commit: r265442 - head/sys/dev/vt In-Reply-To: Message-ID: <20140507001943.F3578@besplex.bde.org> References: <201405061352.s46DqE9a025250@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=U6SrU4bu c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=SRubDjJBntYA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=H5CCPXp9d4Vo8zz979kA:9 a=gKYRMQd8X2P9cKUT:21 a=e3IfHBkTZ2E1auAg:21 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 Cc: "svn-src-head@freebsd.org" , Aleksandr Rybalko , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 16:50:13 -0000 On Tue, 6 May 2014, Matthew Fleming wrote: > On Tue, May 6, 2014 at 6:52 AM, Aleksandr Rybalko wrote: >> Log: >> Implement KDMKTONE ioctl. Does it have to have to be even worse than syscons? >> Modified: head/sys/dev/vt/vt_core.c >> ============================================================================== >> --- head/sys/dev/vt/vt_core.c Tue May 6 13:46:36 2014 (r265441) >> +++ head/sys/dev/vt/vt_core.c Tue May 6 13:52:13 2014 (r265442) >> @@ -1732,9 +1732,17 @@ skip_thunk: >> td->td_frame->tf_rflags &= ~PSL_IOPL; >> #endif >> return (0); >> - case KDMKTONE: /* sound the bell */ >> - /* TODO */ >> + case KDMKTONE: { /* sound the bell */ >> + int freq, period; Style bugs: nested declarations, and misindented braces to make the rest not too ugly without using C++ declarations). Syscons doesn't use any local variables here. >> + >> + freq = 1193182 / ((*(int*)data) & 0xffff); This is a period in nominal x86 i8254 timer cycles, not a frequency. 1193182 would be a frequency. This is very confusing. The confusion is reduced a little in kbdcontrol and syscons by spelling the variable that is spelled 'period' here as 'duration'. The current bugs caused by this confusion seem to be: - the API has been broken. The original API (from SCO?) apparently has units of x86 timer cycles at the nominal frequency for (*(int*)data). - inverting the units fixed broken cases but broke working cases. Broken cases included: - the default "pitch" of 800 Hz was actually a period of 800 x86 timer cycles. Its frequency was actually 1193182 / 800 = 1493 Hz. This affected the default in kbdcontrol and the kernel. Working cases included anything that conformed to the API: - kbdcontrol -b 1.800 used to give 800 Hz. Now it gives 800 x86 timer cycles or 1493 Hz after a double inversion. The inversion bug is more obvious at frequencies far away from sqrt(1193182) = 1092 Hz. 800 is only moderately far away. - variable names are bad. 'pitch' is used for both frequencies and periods. Variable names were not changed to match inversion of the API, though sometimes the inversion made the variable name not so bad. syscons is better layered here. It passes the undivided "pitch" ((*(int*)data) & 0xffff) to sc_bell(). sc_bell() implements visual bell, which I use. Even KDMKTONE gets turned into visual bell. OTOH, KDMKSOUND makes a "tone", which is actually always a sound. Note that the hard-coded frequency 1193182 is almost correct, although this is x86-specific and even x86 has a variable for the timer frequency. It is part of the non-broken user API. It is sysbeep()'s resposibility to convert from nominal x86 cycles to the actual hardware. This is easier to fix with the magic number not exposed to userland. Even x86 sysbeep() never bothered to do the conversion. Conversion on x86 would only give a fix of a few ppm except on exotic hardware. > This data comes from a user and can't be trusted. This is a potential > divide-by-zero. This bug has been implemented and executed before. It was in at least the alpha version. The alpha sysbeep() did an extra inversion, so the broken cases were reversed relative to the old i386 version, as above. Better yet, the inversion implemented the divide-by-zero panic, as above. I may misremember, but in unquoted parts of the diff I saw a check for the zero-divisor case. This check is necessary to match the API. 0 is an out-of-band value that must be translated to a default value. > >> + period = (((*(int*)data)>>16) & 0xffff) * hz / 1000; > This is signed shift which I can't recall if it's well-defined if the > number is negative. Using u_int would definitely be defined. Syscons does the same thing here. The behaviour is implementation- defined IIRC. In practice, negative values for the duration give a garbage result that is very far from negative. E.g., a duration of -1 gives 0xffff after shifting. This is independent of whether the sign bit gets shifted since the high bits are masked off. But the result is garbage -- masking makes it positive. Then scaling by hz / 1000 makes 0xffff as large as possible for a duration instead of negative. Not a problem. You can get worse problems from physically impossible frequencies like 1 Hz and nearly-infinite Hz. Not 0 or infinite Hz since 0 is translated or 1193182/0 is avoided in non-buggy versions. 1 Hz is physically impossible and not a problem. Nearly-infinite Hz (a period of 0 or 1 timer cycles) might damage the speaker, but in practice the speaker just can't keep up. I think it averages out to not doing anything. Bruce From owner-svn-src-head@FreeBSD.ORG Tue May 6 16:51:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33689CF; Tue, 6 May 2014 16:51:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20F17937; Tue, 6 May 2014 16:51:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46Gp7Vc012855; Tue, 6 May 2014 16:51:07 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46Gp72I012854; Tue, 6 May 2014 16:51:07 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201405061651.s46Gp72I012854@svn.freebsd.org> From: Michael Tuexen Date: Tue, 6 May 2014 16:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265455 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 16:51:08 -0000 Author: tuexen Date: Tue May 6 16:51:07 2014 New Revision: 265455 URL: http://svnweb.freebsd.org/changeset/base/265455 Log: Remove unused code. This is triggered by the bugreport of Sylvestre Ledru which deal with useless code in the user land stack: https://bugzilla.mozilla.org/show_bug.cgi?id=1003929 MFC after: 3 days Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue May 6 16:29:02 2014 (r265454) +++ head/sys/netinet/sctp_pcb.c Tue May 6 16:51:07 2014 (r265455) @@ -2735,7 +2735,6 @@ sctp_inpcb_bind(struct socket *so, struc uint32_t vrf_id; lport = 0; - error = 0; bindall = 1; inp = (struct sctp_inpcb *)so->so_pcb; ip_inp = (struct inpcb *)so->so_pcb; @@ -2856,13 +2855,6 @@ sctp_inpcb_bind(struct socket *so, struc return (error); } } - if (p == NULL) { - SCTP_INP_DECR_REF(inp); - SCTP_INP_WUNLOCK(inp); - SCTP_INP_INFO_WUNLOCK(); - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, error); - return (error); - } SCTP_INP_WUNLOCK(inp); if (bindall) { vrf_id = inp->def_vrf_id; From owner-svn-src-head@FreeBSD.ORG Tue May 6 18:07:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1E76265; Tue, 6 May 2014 18:07:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8500273; Tue, 6 May 2014 18:07:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46I7xMJ048379; Tue, 6 May 2014 18:07:59 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46I7xxt048377; Tue, 6 May 2014 18:07:59 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405061807.s46I7xxt048377@svn.freebsd.org> From: Mark Johnston Date: Tue, 6 May 2014 18:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265456 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 18:07:59 -0000 Author: markj Date: Tue May 6 18:07:58 2014 New Revision: 265456 URL: http://svnweb.freebsd.org/changeset/base/265456 Log: Add a postinit debugger hook to rtld. This will be used by dtrace(1) to halt the victim process before its entry point is called, at which point probes and DOF data are registered with the kernel. The r_debug_state hook cannot be used for this purpose, as it is called before the program's init routines are invoked and in particular before DOF data is registered (via drti.o). Reviewed by: kib MFC after: 2 weeks Modified: head/libexec/rtld-elf/Symbol.map head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/Symbol.map ============================================================================== --- head/libexec/rtld-elf/Symbol.map Tue May 6 16:51:07 2014 (r265455) +++ head/libexec/rtld-elf/Symbol.map Tue May 6 18:07:58 2014 (r265456) @@ -30,4 +30,5 @@ FBSDprivate_1.0 { _rtld_atfork_post; _rtld_addr_phdr; _rtld_get_stack_prot; + _rtld_debug_postinit; }; Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue May 6 16:51:07 2014 (r265455) +++ head/libexec/rtld-elf/rtld.c Tue May 6 18:07:58 2014 (r265456) @@ -162,6 +162,7 @@ static bool matched_symbol(SymLook *, co const unsigned long); void r_debug_state(struct r_debug *, struct link_map *) __noinline; +void _r_debug_postinit(struct link_map *) __noinline; /* * Data declarations. @@ -637,6 +638,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ if (obj_main->crt_no_init) preinit_main(); objlist_call_init(&initlist, &lockstate); + _r_debug_postinit(&obj_main->linkmap); objlist_clear(&initlist); dbg("loading filtees"); for (obj = obj_list->next; obj != NULL; obj = obj->next) { @@ -3553,6 +3555,19 @@ r_debug_state(struct r_debug* rd, struct } /* + * A function called after init routines have completed. This can be used to + * break before a program's entry routine is called, and can be used when + * main is not available in the symbol table. + */ +void +_r_debug_postinit(struct link_map *m) +{ + + /* See r_debug_state(). */ + __asm __volatile("" : : : "memory"); +} + +/* * Get address of the pointer variable in the main program. * Prefer non-weak symbol over the weak one. */ From owner-svn-src-head@FreeBSD.ORG Tue May 6 19:03:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBA14C9; Tue, 6 May 2014 19:03:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7C497C8; Tue, 6 May 2014 19:03:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46J34Zt075312; Tue, 6 May 2014 19:03:04 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46J34FT075311; Tue, 6 May 2014 19:03:04 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405061903.s46J34FT075311@svn.freebsd.org> From: Xin LI Date: Tue, 6 May 2014 19:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265458 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 19:03:04 -0000 Author: delphij Date: Tue May 6 19:03:04 2014 New Revision: 265458 URL: http://svnweb.freebsd.org/changeset/base/265458 Log: Import George Wilson's change for Illumos #4730: 4730 metaslab group taskq should be destroyed in metaslab_group_destroy() Reviewed by: Alex Reece Reviewed by: Matthew Ahrens Reviewed by: Sebastien Roy Original author: George Wilson MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Tue May 6 18:42:24 2014 (r265457) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Tue May 6 19:03:04 2014 (r265458) @@ -411,7 +411,7 @@ metaslab_group_create(metaslab_class_t * mg->mg_class = mc; mg->mg_activation_count = 0; - mg->mg_taskq = taskq_create("metaslab_group_tasksq", metaslab_load_pct, + mg->mg_taskq = taskq_create("metaslab_group_taskq", metaslab_load_pct, minclsyspri, 10, INT_MAX, TASKQ_THREADS_CPU_PCT); return (mg); @@ -429,6 +429,7 @@ metaslab_group_destroy(metaslab_group_t */ ASSERT(mg->mg_activation_count <= 0); + taskq_destroy(mg->mg_taskq); avl_destroy(&mg->mg_metaslab_tree); mutex_destroy(&mg->mg_lock); kmem_free(mg, sizeof (metaslab_group_t)); From owner-svn-src-head@FreeBSD.ORG Tue May 6 20:34:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 081FA292; Tue, 6 May 2014 20:34:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8AEEA1; Tue, 6 May 2014 20:34:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46KYLZp018658; Tue, 6 May 2014 20:34:21 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46KYLFX018657; Tue, 6 May 2014 20:34:21 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201405062034.s46KYLFX018657@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 6 May 2014 20:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265462 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 20:34:22 -0000 Author: marcel Date: Tue May 6 20:34:21 2014 New Revision: 265462 URL: http://svnweb.freebsd.org/changeset/base/265462 Log: In apm_write(), both fd and imgsz are referenced, so don't mark the arguments as unused. Modified: head/usr.bin/mkimg/apm.c Modified: head/usr.bin/mkimg/apm.c ============================================================================== --- head/usr.bin/mkimg/apm.c Tue May 6 19:39:57 2014 (r265461) +++ head/usr.bin/mkimg/apm.c Tue May 6 20:34:21 2014 (r265462) @@ -63,7 +63,7 @@ apm_metadata(u_int where) } static int -apm_write(int fd __unused, lba_t imgsz __unused, void *bootcode __unused) +apm_write(int fd, lba_t imgsz, void *bootcode __unused) { u_char *buf; struct apm_ddr *ddr; From owner-svn-src-head@FreeBSD.ORG Tue May 6 20:40:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B41F5635; Tue, 6 May 2014 20:40:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86CAEEB; Tue, 6 May 2014 20:40:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46KeGsq020476; Tue, 6 May 2014 20:40:16 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46KeGpg020475; Tue, 6 May 2014 20:40:16 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201405062040.s46KeGpg020475@svn.freebsd.org> From: Scott Long Date: Tue, 6 May 2014 20:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265463 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 20:40:16 -0000 Author: scottl Date: Tue May 6 20:40:16 2014 New Revision: 265463 URL: http://svnweb.freebsd.org/changeset/base/265463 Log: Due to reasons unknown at this time, the system can be forced to write a journal block even when there are no journal entries to be written. Until the root cause is found, handle this case by ensuring that a valid journal segment is always written. Second, the data buffer used for writing journal entries was never being scrubbed of old data. Fix this. Submitted by: Takehara Mikihito Obtained from: Netflix, Inc. MFC after: 3 days Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Tue May 6 20:34:21 2014 (r265462) +++ head/sys/ufs/ffs/ffs_softdep.c Tue May 6 20:40:16 2014 (r265463) @@ -1275,6 +1275,7 @@ static int stat_cleanup_blkrequests; /* static int stat_cleanup_inorequests; /* Number of inode cleanup requests */ static int stat_cleanup_retries; /* Number of cleanups that needed to flush */ static int stat_cleanup_failures; /* Number of cleanup requests that failed */ +static int stat_emptyjblocks; /* Number of potentially empty journal blocks */ SYSCTL_INT(_debug_softdep, OID_AUTO, max_softdeps, CTLFLAG_RW, &max_softdeps, 0, ""); @@ -1334,6 +1335,8 @@ SYSCTL_INT(_debug_softdep, OID_AUTO, cle &stat_cleanup_failures, 0, ""); SYSCTL_INT(_debug_softdep, OID_AUTO, flushcache, CTLFLAG_RW, &softdep_flushcache, 0, ""); +SYSCTL_INT(_debug_softdep, OID_AUTO, emptyjblocks, CTLFLAG_RD, + &stat_emptyjblocks, 0, ""); SYSCTL_DECL(_vfs_ffs); @@ -3328,6 +3331,24 @@ softdep_process_journal(mp, needwk, flag */ data = bp->b_data; off = 0; + + /* + * Always put a header on the first block. + * XXX As with below, there might not be a chance to get + * into the loop. Ensure that something valid is written. + */ + jseg_write(ump, jseg, data); + off += JREC_SIZE; + data = bp->b_data + off; + + /* + * XXX Something is wrong here. There's no work to do, + * but we need to perform and I/O and allow it to complete + * anyways. + */ + if (LIST_EMPTY(&ump->softdep_journal_pending)) + stat_emptyjblocks++; + while ((wk = LIST_FIRST(&ump->softdep_journal_pending)) != NULL) { if (cnt == 0) @@ -3377,6 +3398,11 @@ softdep_process_journal(mp, needwk, flag data = bp->b_data + off; cnt--; } + + /* Clear any remaining space so we don't leak kernel data */ + if (size > off) + bzero(data, size - off); + /* * Write this one buffer and continue. */ From owner-svn-src-head@FreeBSD.ORG Tue May 6 21:30:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFCD8A06; Tue, 6 May 2014 21:30:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D40C810; Tue, 6 May 2014 21:30:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46LUxgC044817; Tue, 6 May 2014 21:30:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46LUxhC044816; Tue, 6 May 2014 21:30:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405062130.s46LUxhC044816@svn.freebsd.org> From: Xin LI Date: Tue, 6 May 2014 21:30:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265464 - head/lib/libmagic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 21:30:59 -0000 Author: delphij Date: Tue May 6 21:30:58 2014 New Revision: 265464 URL: http://svnweb.freebsd.org/changeset/base/265464 Log: Sort .ALLSRC before concatenating files together. This makes sure that the file are always built the same. (Note that Header and Localstuff must appear first and in that order, the sorting does not affect as a coincident effect). Submitted by: sjg MFC after: 3 days Modified: head/lib/libmagic/Makefile Modified: head/lib/libmagic/Makefile ============================================================================== --- head/lib/libmagic/Makefile Tue May 6 20:40:16 2014 (r265463) +++ head/lib/libmagic/Makefile Tue May 6 21:30:58 2014 (r265464) @@ -32,7 +32,7 @@ MAGFILES= ${CONTRDIR}/Header\ ${CONTRDIR}/Magdir/[a-z]* magic: ${MAGFILES} - cat ${.ALLSRC} > ${.TARGET} + cat ${.ALLSRC:O} > ${.TARGET} magic.mgc: mkmagic magic ./mkmagic magic From owner-svn-src-head@FreeBSD.ORG Tue May 6 21:34:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6013BB84; Tue, 6 May 2014 21:34:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DD1C836; Tue, 6 May 2014 21:34:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46LY2F3046065; Tue, 6 May 2014 21:34:02 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46LY2pv046064; Tue, 6 May 2014 21:34:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405062134.s46LY2pv046064@svn.freebsd.org> From: Xin LI Date: Tue, 6 May 2014 21:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265465 - head/contrib/ntp/ntpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 21:34:02 -0000 Author: delphij Date: Tue May 6 21:34:01 2014 New Revision: 265465 URL: http://svnweb.freebsd.org/changeset/base/265465 Log: Don't reply monlist request when it's not enabled. No objection from: roberto (but all bugs are mine) MFC after: 2 weeks Modified: head/contrib/ntp/ntpd/ntp_request.c Modified: head/contrib/ntp/ntpd/ntp_request.c ============================================================================== --- head/contrib/ntp/ntpd/ntp_request.c Tue May 6 21:30:58 2014 (r265464) +++ head/contrib/ntp/ntpd/ntp_request.c Tue May 6 21:34:01 2014 (r265465) @@ -1920,7 +1920,6 @@ mon_getlist_0( printf("wants monitor 0 list\n"); #endif if (!mon_enabled) { - req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA); return; } im = (struct info_monitor *)prepare_pkt(srcadr, inter, inpkt, @@ -1965,7 +1964,6 @@ mon_getlist_1( extern int mon_enabled; if (!mon_enabled) { - req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA); return; } im = (struct info_monitor_1 *)prepare_pkt(srcadr, inter, inpkt, From owner-svn-src-head@FreeBSD.ORG Tue May 6 21:51:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE411475; Tue, 6 May 2014 21:51:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1D819C5; Tue, 6 May 2014 21:51:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46LpG4O053995; Tue, 6 May 2014 21:51:16 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46LpGKD053994; Tue, 6 May 2014 21:51:16 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201405062151.s46LpGKD053994@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 6 May 2014 21:51:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265467 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 21:51:16 -0000 Author: marcel Date: Tue May 6 21:51:16 2014 New Revision: 265467 URL: http://svnweb.freebsd.org/changeset/base/265467 Log: Add missing svn:keywords property. Modified: Directory Properties: head/usr.bin/mkimg/mkimg.c (props changed) From owner-svn-src-head@FreeBSD.ORG Tue May 6 21:54:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92DF95F5; Tue, 6 May 2014 21:54:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F5CD9F1; Tue, 6 May 2014 21:54:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46Ls7ao054826; Tue, 6 May 2014 21:54:07 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46Ls59E054814; Tue, 6 May 2014 21:54:05 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201405062154.s46Ls59E054814@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 6 May 2014 21:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265468 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 21:54:07 -0000 Author: marcel Date: Tue May 6 21:54:05 2014 New Revision: 265468 URL: http://svnweb.freebsd.org/changeset/base/265468 Log: Add mkimg_write() which combines lseek(2) and write(2) and uses sector granularity for both offset and length. Have all schemes use mkimg_write() instead of mkimg_seek() followed by write(2). Now that schemes don't use lseek(2) nor write(2) directly, it's easier to support output formats other than raw disks. Modified: head/usr.bin/mkimg/apm.c head/usr.bin/mkimg/bsd.c head/usr.bin/mkimg/ebr.c head/usr.bin/mkimg/gpt.c head/usr.bin/mkimg/mbr.c head/usr.bin/mkimg/mkimg.c head/usr.bin/mkimg/mkimg.h head/usr.bin/mkimg/pc98.c head/usr.bin/mkimg/vtoc8.c Modified: head/usr.bin/mkimg/apm.c ============================================================================== --- head/usr.bin/mkimg/apm.c Tue May 6 21:51:16 2014 (r265467) +++ head/usr.bin/mkimg/apm.c Tue May 6 21:54:05 2014 (r265468) @@ -69,7 +69,6 @@ apm_write(int fd, lba_t imgsz, void *boo struct apm_ddr *ddr; struct apm_ent *ent; struct part *part; - ssize_t nbytes; int error; buf = calloc(nparts + 2, secsz); @@ -100,12 +99,7 @@ apm_write(int fd, lba_t imgsz, void *boo strcpy(ent->ent_name, part->label); } - error = mkimg_seek(fd, 0); - if (error == 0) { - nbytes = (nparts + 2) * secsz; - if (write(fd, buf, nbytes) != nbytes) - error = errno; - } + error = mkimg_write(fd, 0, buf, nparts + 2); free(buf); return (error); } Modified: head/usr.bin/mkimg/bsd.c ============================================================================== --- head/usr.bin/mkimg/bsd.c Tue May 6 21:51:16 2014 (r265467) +++ head/usr.bin/mkimg/bsd.c Tue May 6 21:54:05 2014 (r265468) @@ -111,11 +111,7 @@ bsd_write(int fd, lba_t imgsz, void *boo checksum ^= le16dec(p); le16enc(&d->d_checksum, checksum); - error = mkimg_seek(fd, 0); - if (error == 0) { - if (write(fd, buf, BBSIZE) != BBSIZE) - error = errno; - } + error = mkimg_write(fd, 0, buf, BBSIZE / secsz); free(buf); return (error); } Modified: head/usr.bin/mkimg/ebr.c ============================================================================== --- head/usr.bin/mkimg/ebr.c Tue May 6 21:51:16 2014 (r265467) +++ head/usr.bin/mkimg/ebr.c Tue May 6 21:54:05 2014 (r265468) @@ -104,11 +104,7 @@ ebr_write(int fd, lba_t imgsz __unused, le32enc(&dp->dp_size, next->size + nsecs); } - error = mkimg_seek(fd, block); - if (error == 0) { - if (write(fd, ebr, secsz) != (ssize_t)secsz) - error = errno; - } + error = mkimg_write(fd, block, ebr, 1); if (error) break; Modified: head/usr.bin/mkimg/gpt.c ============================================================================== --- head/usr.bin/mkimg/gpt.c Tue May 6 21:51:16 2014 (r265467) +++ head/usr.bin/mkimg/gpt.c Tue May 6 21:54:05 2014 (r265468) @@ -166,19 +166,6 @@ gpt_metadata(u_int where) } static int -gpt_filewrite(int fd, lba_t blk, void *buf, ssize_t bufsz) -{ - int error; - - error = mkimg_seek(fd, blk); - if (error == 0) { - if (write(fd, buf, bufsz) != bufsz) - error = errno; - } - return (error); -} - -static int gpt_write_pmbr(int fd, lba_t blks, void *bootcode) { u_char *pmbr; @@ -203,7 +190,7 @@ gpt_write_pmbr(int fd, lba_t blks, void le32enc(pmbr + DOSPARTOFF + 8, 1); le32enc(pmbr + DOSPARTOFF + 12, secs); le16enc(pmbr + DOSMAGICOFFSET, DOSMAGIC); - error = gpt_filewrite(fd, 0, pmbr, secsz); + error = mkimg_write(fd, 0, pmbr, 1); free(pmbr); return (error); } @@ -250,7 +237,7 @@ gpt_write_hdr(int fd, struct gpt_hdr *hd hdr->hdr_crc_self = 0; crc = crc32(hdr, offsetof(struct gpt_hdr, padding)); le64enc(&hdr->hdr_crc_self, crc); - return (gpt_filewrite(fd, self, hdr, secsz)); + return (mkimg_write(fd, self, hdr, 1)); } static int @@ -273,10 +260,10 @@ gpt_write(int fd, lba_t imgsz, void *boo tbl = gpt_mktbl(tblsz); if (tbl == NULL) return (errno); - error = gpt_filewrite(fd, 2, tbl, tblsz * secsz); + error = mkimg_write(fd, 2, tbl, tblsz); if (error) goto out; - error = gpt_filewrite(fd, imgsz - (tblsz + 1), tbl, tblsz * secsz); + error = mkimg_write(fd, imgsz - (tblsz + 1), tbl, tblsz); if (error) goto out; Modified: head/usr.bin/mkimg/mbr.c ============================================================================== --- head/usr.bin/mkimg/mbr.c Tue May 6 21:51:16 2014 (r265467) +++ head/usr.bin/mkimg/mbr.c Tue May 6 21:54:05 2014 (r265468) @@ -96,11 +96,7 @@ mbr_write(int fd, lba_t imgsz __unused, le32enc(&dp->dp_start, part->block); le32enc(&dp->dp_size, part->size); } - error = mkimg_seek(fd, 0); - if (error == 0) { - if (write(fd, mbr, secsz) != (ssize_t)secsz) - error = errno; - } + error = mkimg_write(fd, 0, mbr, 1); free(mbr); return (error); } Modified: head/usr.bin/mkimg/mkimg.c ============================================================================== --- head/usr.bin/mkimg/mkimg.c Tue May 6 21:51:16 2014 (r265467) +++ head/usr.bin/mkimg/mkimg.c Tue May 6 21:54:05 2014 (r265468) @@ -302,7 +302,7 @@ fdcopy(int src, int dst, uint64_t *count return (errno); } -int +static int mkimg_seek(int fd, lba_t blk) { off_t off; @@ -313,6 +313,19 @@ mkimg_seek(int fd, lba_t blk) return (0); } +int +mkimg_write(int fd, lba_t blk, void *buf, ssize_t len) +{ + + blk *= secsz; + if (lseek(fd, blk, SEEK_SET) != blk) + return (errno); + len *= secsz; + if (write(fd, buf, len) != len) + return (errno); + return (0); +} + static void mkimg(int bfd) { Modified: head/usr.bin/mkimg/mkimg.h ============================================================================== --- head/usr.bin/mkimg/mkimg.h Tue May 6 21:51:16 2014 (r265467) +++ head/usr.bin/mkimg/mkimg.h Tue May 6 21:54:05 2014 (r265468) @@ -67,6 +67,6 @@ round_block(lba_t n) return ((n + b - 1) & ~(b - 1)); } -int mkimg_seek(int fd, lba_t blk); +int mkimg_write(int fd, lba_t blk, void *buf, ssize_t len); #endif /* _MKIMG_MKIMG_H_ */ Modified: head/usr.bin/mkimg/pc98.c ============================================================================== --- head/usr.bin/mkimg/pc98.c Tue May 6 21:51:16 2014 (r265467) +++ head/usr.bin/mkimg/pc98.c Tue May 6 21:54:05 2014 (r265468) @@ -106,11 +106,7 @@ pc98_write(int fd, lba_t imgsz __unused, if (part->label != NULL) memcpy(dp->dp_name, part->label, strlen(part->label)); } - error = mkimg_seek(fd, 0); - if (error == 0) { - if (write(fd, buf, PC98_BOOTCODESZ) != PC98_BOOTCODESZ) - error = errno; - } + error = mkimg_write(fd, 0, buf, PC98_BOOTCODESZ / secsz); free(buf); return (error); } Modified: head/usr.bin/mkimg/vtoc8.c ============================================================================== --- head/usr.bin/mkimg/vtoc8.c Tue May 6 21:51:16 2014 (r265467) +++ head/usr.bin/mkimg/vtoc8.c Tue May 6 21:54:05 2014 (r265468) @@ -103,11 +103,7 @@ vtoc8_write(int fd, lba_t imgsz, void *b sum ^= be16dec(p + ofs); be16enc(&vtoc8.cksum, sum); - error = mkimg_seek(fd, 0); - if (error == 0) { - if (write(fd, &vtoc8, sizeof(vtoc8)) != sizeof(vtoc8)) - error = errno; - } + error = mkimg_write(fd, 0, &vtoc8, 1); return (error); } From owner-svn-src-head@FreeBSD.ORG Tue May 6 22:06:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D212AC9B; Tue, 6 May 2014 22:06:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF7E9AC4; Tue, 6 May 2014 22:06:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46M6d11060157; Tue, 6 May 2014 22:06:39 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46M6dxW060155; Tue, 6 May 2014 22:06:39 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201405062206.s46M6dxW060155@svn.freebsd.org> From: Alan Somers Date: Tue, 6 May 2014 22:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265472 - head/bin/dd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 22:06:40 -0000 Author: asomers Date: Tue May 6 22:06:39 2014 New Revision: 265472 URL: http://svnweb.freebsd.org/changeset/base/265472 Log: dd(1) uses gettimeofday(2) to compute the throughput statistics. However, gettimeofday returns the system clock, which may jump forward or back, especially if NTP is in use. If the time jumps backwards, then dd will see negative elapsed time, round it up to 1usec, and print an absurdly fast transfer rate. The solution is to use clock_gettime(2) with CLOCK_MONOTONIC_PRECISE as the clock_id. That clock advances steadily, regardless of changes to the system clock. Reviewed by: delphij MFC after: 3 days Sponsored by: Spectra Logic Modified: head/bin/dd/dd.c head/bin/dd/misc.c Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Tue May 6 22:04:50 2014 (r265471) +++ head/bin/dd/dd.c Tue May 6 22:06:39 2014 (r265472) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -61,6 +60,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include "dd.h" @@ -123,7 +124,7 @@ static void setup(void) { u_int cnt; - struct timeval tv; + struct timespec tv; if (in.name == NULL) { in.name = "stdin"; @@ -240,8 +241,9 @@ setup(void) ctab = casetab; } - (void)gettimeofday(&tv, NULL); - st.start = tv.tv_sec + tv.tv_usec * 1e-6; + if (clock_gettime(CLOCK_MONOTONIC_PRECISE, &tv)) + err(EX_OSERR, "clock_gettime"); + st.start = tv.tv_sec + tv.tv_nsec * 1.0e-9; } static void Modified: head/bin/dd/misc.c ============================================================================== --- head/bin/dd/misc.c Tue May 6 22:04:50 2014 (r265471) +++ head/bin/dd/misc.c Tue May 6 22:06:39 2014 (r265472) @@ -40,14 +40,16 @@ static char sccsid[] = "@(#)misc.c 8.3 ( __FBSDID("$FreeBSD$"); #include -#include +#include #include #include #include #include #include #include +#include +#include #include #include "dd.h" @@ -56,16 +58,20 @@ __FBSDID("$FreeBSD$"); void summary(void) { - struct timeval tv; - double secs; + struct timespec tv, tv_res; + double secs, res; if (ddflags & C_NOINFO) return; - (void)gettimeofday(&tv, NULL); - secs = tv.tv_sec + tv.tv_usec * 1e-6 - st.start; - if (secs < 1e-6) - secs = 1e-6; + if (clock_gettime(CLOCK_MONOTONIC_PRECISE, &tv)) + err(EX_OSERR, "clock_gettime"); + if (clock_getres(CLOCK_MONOTONIC_PRECISE, &tv_res)) + err(EX_OSERR, "clock_getres"); + secs = tv.tv_sec + tv.tv_nsec * 1.0e-9 - st.start; + res = tv_res.tv_sec + tv_res.tv_nsec * 1.0e-9; + if (secs < res) + secs = res; (void)fprintf(stderr, "%ju+%ju records in\n%ju+%ju records out\n", st.in_full, st.in_part, st.out_full, st.out_part); @@ -77,7 +83,7 @@ summary(void) st.trunc, (st.trunc == 1) ? "block" : "blocks"); if (!(ddflags & C_NOXFER)) { (void)fprintf(stderr, - "%ju bytes transferred in %.6f secs (%.0f bytes/sec)\n", + "%ju bytes transferred in %.9f secs (%.0f bytes/sec)\n", st.bytes, secs, st.bytes / secs); } need_summary = 0; From owner-svn-src-head@FreeBSD.ORG Tue May 6 22:13:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 238FDEDE; Tue, 6 May 2014 22:13:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10F5FB82; Tue, 6 May 2014 22:13:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46MDcJl064469; Tue, 6 May 2014 22:13:38 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46MDcVE064468; Tue, 6 May 2014 22:13:38 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201405062213.s46MDcVE064468@svn.freebsd.org> From: "Kenneth D. Merry" Date: Tue, 6 May 2014 22:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265473 - head/sys/dev/mpr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 22:13:39 -0000 Author: ken Date: Tue May 6 22:13:38 2014 New Revision: 265473 URL: http://svnweb.freebsd.org/changeset/base/265473 Log: Change the device name for mpr(4) from /dev/mpr_N to /dev/mprN. This is more consistent with the existing mps(4) behavior. Reviewed by: Steve McConnell MFC after: 3 days Modified: head/sys/dev/mpr/mpr_user.c Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Tue May 6 22:06:39 2014 (r265472) +++ head/sys/dev/mpr/mpr_user.c Tue May 6 22:13:38 2014 (r265473) @@ -212,7 +212,7 @@ mpr_attach_user(struct mpr_softc *sc) unit = device_get_unit(sc->mpr_dev); sc->mpr_cdev = make_dev(&mpr_cdevsw, unit, UID_ROOT, GID_OPERATOR, - 0640, "mpr_%d", unit); + 0640, "mpr%d", unit); if (sc->mpr_cdev == NULL) { return (ENOMEM); } From owner-svn-src-head@FreeBSD.ORG Tue May 6 22:56:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D47DC721; Tue, 6 May 2014 22:56:12 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AE034E84; Tue, 6 May 2014 22:56:12 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s46Mtp5e076286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 6 May 2014 15:55:52 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s46MtpEN076285; Tue, 6 May 2014 15:55:51 -0700 (PDT) (envelope-from jmg) Date: Tue, 6 May 2014 15:55:51 -0700 From: John-Mark Gurney To: Marius Strobl Subject: Re: svn commit: r265359 - head/sys/modules/sound/sound Message-ID: <20140506225551.GD43976@funkthat.com> References: <201405051431.s45EVZ2q027729@svn.freebsd.org> <7745BD19-5BAE-47BD-8DE4-10CF7E23FA9D@gmail.com> <53690381.9040909@selasky.org> <20140506160154.GA679@alchemy.franken.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140506160154.GA679@alchemy.franken.de> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 06 May 2014 15:55:52 -0700 (PDT) Cc: Hans Petter Selasky , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 22:56:13 -0000 Marius Strobl wrote this message on Tue, May 06, 2014 at 18:01 +0200: > On Tue, May 06, 2014 at 05:45:05PM +0200, Hans Petter Selasky wrote: > > On 05/05/14 22:39, Warner Losh wrote: > > > > > > On May 5, 2014, at 8:31 AM, Hans Petter Selasky wrote: > > > > > >> Author: hselasky > > >> Date: Mon May 5 14:31:34 2014 > > >> New Revision: 265359 > > >> URL: http://svnweb.freebsd.org/changeset/base/265359 > > >> > > >> Log: > > >> Build the kernel sound module without ISA DMA support for ARM and MIPS > > >> platforms, because these platforms do not implement the ISA DMA > > >> API. Else the sound modules cannot be loaded when running these > > >> platforms. > > >> > > >> MFC after: 2 weeks > > >> > > >> Modified: > > >> head/sys/modules/sound/sound/Makefile > > >> > > >> Modified: head/sys/modules/sound/sound/Makefile > > >> ============================================================================== > > >> --- head/sys/modules/sound/sound/Makefile Mon May 5 11:50:52 2014 (r265358) > > >> +++ head/sys/modules/sound/sound/Makefile Mon May 5 14:31:34 2014 (r265359) > > >> @@ -44,7 +44,8 @@ CLEANFILES+= feeder_eq_gen.h feeder_rate > > >> > > >> EXPORT_SYMS= YES # XXX evaluate > > >> > > >> -.if ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "powerpc" > > >> +.if ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "powerpc" || \ > > >> + ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" > > >> # Create an empty opt_isa.h in order to keep kmod.mk from linking in an > > >> # existing one from KERNBUILDDIR which possibly has DEV_ISA defined so > > >> # sound.ko is always built without isadma support. > > > > > > Rather than an opt-in approach here, why not lust list the three that have it since > > > they are the only ones that will ever have it? > > > > > > Warner > > > > > > > Hi, > > > > Maybe the sound DMA file belongs in its own module? > > > > It's not just sndbuf_dma.c but also the #ifdef'ed DEV_ISA code in > channel.c on architectures that have ISA but not ISA DMA support, > hence the current kludge. I thought busdma was suppose to abstract all of this away? Is it just that this was never complete? or? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Tue May 6 23:27:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B29E1C53 for ; Tue, 6 May 2014 23:27:55 +0000 (UTC) Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7ECDE127 for ; Tue, 6 May 2014 23:27:55 +0000 (UTC) Received: by mail-pa0-f51.google.com with SMTP id kq14so185430pab.38 for ; Tue, 06 May 2014 16:27:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=h7SEroYrcr63xQsIglHWB0lTbMU4urGyK7b9xhwgktA=; b=j2ZRXFhhprEsKeZ1IM3s6/BLVn52I9zZ7FArnsrE51ONIYVaxIwIxgyUMijUCCyOuK t5zpBrWzeWGdL8fJakIR3QQzwrLjSufrG7ZrB+NB268rDqrK8EZ5XcbFCvHERQnskNd3 h+6EiveGmgHA1UMLMps7Y/ZrADncj4fbwHD4w+YkiqIMfaYdu2f9s3qRxvCe+uO0/lks Az0L+VW3O2pju23/PkvOv7BPtfGNzi03HEJeCyuCrk2isg7+araYuLf9xJaV4nlxXwMb qpOUDoVxzaGTnVBUC+3ZiMNXsOeLvmtNGU48RuvD0DRTrG1sbLoxey3GB0udhniqqcLc B30g== X-Gm-Message-State: ALoCoQnV+DcERwQ6iDRpa/bYWLAmMGye/+Q1T+f3CdhIJIh1Vb7dZCS4XTPU8ToRmDqUfD74M5+P X-Received: by 10.66.149.37 with SMTP id tx5mr11687322pab.81.1399418869625; Tue, 06 May 2014 16:27:49 -0700 (PDT) Received: from [10.64.26.239] (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id xr9sm104085292pab.5.2014.05.06.16.27.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 May 2014 16:27:48 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_386D76C3-88F7-4AAD-ACF1-504F12C1A0F9"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265359 - head/sys/modules/sound/sound From: Warner Losh In-Reply-To: <20140506225551.GD43976@funkthat.com> Date: Tue, 6 May 2014 17:27:45 -0600 Message-Id: References: <201405051431.s45EVZ2q027729@svn.freebsd.org> <7745BD19-5BAE-47BD-8DE4-10CF7E23FA9D@gmail.com> <53690381.9040909@selasky.org> <20140506160154.GA679@alchemy.franken.de> <20140506225551.GD43976@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.1874) Cc: Hans Petter Selasky , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Marius Strobl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 23:27:55 -0000 --Apple-Mail=_386D76C3-88F7-4AAD-ACF1-504F12C1A0F9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On May 6, 2014, at 4:55 PM, John-Mark Gurney wrote: > Marius Strobl wrote this message on Tue, May 06, 2014 at 18:01 +0200: >> On Tue, May 06, 2014 at 05:45:05PM +0200, Hans Petter Selasky wrote: >>> On 05/05/14 22:39, Warner Losh wrote: >>>>=20 >>>> On May 5, 2014, at 8:31 AM, Hans Petter Selasky = wrote: >>>>=20 >>>>> Author: hselasky >>>>> Date: Mon May 5 14:31:34 2014 >>>>> New Revision: 265359 >>>>> URL: http://svnweb.freebsd.org/changeset/base/265359 >>>>>=20 >>>>> Log: >>>>> Build the kernel sound module without ISA DMA support for ARM and = MIPS >>>>> platforms, because these platforms do not implement the ISA DMA >>>>> API. Else the sound modules cannot be loaded when running these >>>>> platforms. >>>>>=20 >>>>> MFC after: 2 weeks >>>>>=20 >>>>> Modified: >>>>> head/sys/modules/sound/sound/Makefile >>>>>=20 >>>>> Modified: head/sys/modules/sound/sound/Makefile >>>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>>> --- head/sys/modules/sound/sound/Makefile Mon May 5 11:50:52 2014 = (r265358) >>>>> +++ head/sys/modules/sound/sound/Makefile Mon May 5 14:31:34 2014 = (r265359) >>>>> @@ -44,7 +44,8 @@ CLEANFILES+=3D feeder_eq_gen.h feeder_rate >>>>>=20 >>>>> EXPORT_SYMS=3D YES # XXX evaluate >>>>>=20 >>>>> -.if ${MACHINE_CPUARCH} =3D=3D "sparc64" || ${MACHINE_CPUARCH} =3D=3D= "powerpc" >>>>> +.if ${MACHINE_CPUARCH} =3D=3D "sparc64" || ${MACHINE_CPUARCH} =3D=3D= "powerpc" || \ >>>>> + ${MACHINE_CPUARCH} =3D=3D "arm" || ${MACHINE_CPUARCH} =3D=3D = "mips" >>>>> # Create an empty opt_isa.h in order to keep kmod.mk from linking = in an >>>>> # existing one from KERNBUILDDIR which possibly has DEV_ISA = defined so >>>>> # sound.ko is always built without isadma support. >>>>=20 >>>> Rather than an opt-in approach here, why not lust list the three = that have it since >>>> they are the only ones that will ever have it? >>>>=20 >>>> Warner >>>>=20 >>>=20 >>> Hi, >>>=20 >>> Maybe the sound DMA file belongs in its own module? >>>=20 >>=20 >> It's not just sndbuf_dma.c but also the #ifdef'ed DEV_ISA code in >> channel.c on architectures that have ISA but not ISA DMA support, >> hence the current kludge. >=20 > I thought busdma was suppose to abstract all of this away? Is it > just that this was never complete? or? Never completed for ISA DMA=85=20 Warner --Apple-Mail=_386D76C3-88F7-4AAD-ACF1-504F12C1A0F9 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTaW/xAAoJEGwc0Sh9sBEAIrIQAIOz6uEAmEuAdannwagb0w9O jwYuKq0eRb6kVnsONXkTUgCgMe3uWpuhvEjI/J15VUomy8Ax1G+fin9MP6OWIYSe Xq+0BpK+BT5NlKDvYtCyK7Vl/EOj/1EaOhgVc1gTuHy+nIIbj+XYBZcQeqqDnfh3 F0wGLwS7kaCmTR8ZeW9Ub/a0xm+70LjSa+kcuJcM9e9xVyYVMlGh+JroorL4rDuu hPE4N/2Bbny3wKrqm+PV4yu5XXag2zQSkD11ejo4/F5ojfl2FU/c75ZEgOpu0bD8 g52dyplhNJTClY01T9DjtkwIajcr7iwBvRELZEXxuwPhURnYmI9QkdO4icivU11W SdXJiA7ahUbkXP3Te/4N2MYw7FA2JvVueqfo00FUJhC3BJj0J6RR5OYJlfr+RfRM JwXgrlhFdJLTb5lcTDjXccHBZF2zni9gepgV0X5Uq2hKBhJXDcbJdcTa9DuTAevU 7SxRnzX5UfanypB8Urxm1xFBIRIHOf1WmRVxVwOA2F9QLayisBfAzGQkWjl10/yn iMtYybnNQLRnMxw0eaYkxZH8gJmrcbLTx0zE9pwrzV/AXzqh5EwxBPVuxNsSlaos 7JZv28gaayxo6DUc76fY7h/F3C/aw2LVsALffK3O2a9wGUmHIwgoOOfNHJhwNqGJ XVdkJvz88spkGYRweAON =TyIs -----END PGP SIGNATURE----- --Apple-Mail=_386D76C3-88F7-4AAD-ACF1-504F12C1A0F9-- From owner-svn-src-head@FreeBSD.ORG Tue May 6 23:28:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 410BCD4A; Tue, 6 May 2014 23:28:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EB0012B; Tue, 6 May 2014 23:28:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s46NSbcI096390; Tue, 6 May 2014 23:28:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s46NSbax096389; Tue, 6 May 2014 23:28:37 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405062328.s46NSbax096389@svn.freebsd.org> From: Adrian Chadd Date: Tue, 6 May 2014 23:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265474 - head/etc/defaults X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2014 23:28:38 -0000 Author: adrian Date: Tue May 6 23:28:37 2014 New Revision: 265474 URL: http://svnweb.freebsd.org/changeset/base/265474 Log: Bump the default C-state to Cmax, rather than the kernel default of C1. This may not stay through 11.0-RELEASE, but at least having it on by default in -HEAD will expose (more) issues with broken hardware. Note: I have no plans or desire to MFC this to stable/10. Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Tue May 6 22:13:38 2014 (r265473) +++ head/etc/defaults/rc.conf Tue May 6 23:28:37 2014 (r265474) @@ -642,9 +642,9 @@ devfs_system_ruleset="" # The name (NOT devfs_set_rulesets="" # A list of /mount/dev=ruleset_name settings to # apply (must be mounted already, i.e. fstab(5)) devfs_load_rulesets="YES" # Enable to always load the default rulesets -performance_cx_lowest="HIGH" # Online CPU idle state +performance_cx_lowest="Cmax" # Online CPU idle state performance_cpu_freq="NONE" # Online CPU frequency -economy_cx_lowest="HIGH" # Offline CPU idle state +economy_cx_lowest="Cmax" # Offline CPU idle state economy_cpu_freq="NONE" # Offline CPU frequency virecover_enable="YES" # Perform housekeeping for the vi(1) editor ugidfw_enable="NO" # Load mac_bsdextended(4) rules on boot From owner-svn-src-head@FreeBSD.ORG Wed May 7 00:00:03 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A35E1648; Wed, 7 May 2014 00:00:03 +0000 (UTC) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68E823C9; Wed, 7 May 2014 00:00:03 +0000 (UTC) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.14.5/8.14.5) with SMTP id s46NvrOO001803; Tue, 6 May 2014 19:00:01 -0500 Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by pp2.rice.edu with ESMTP id 1kq831g18v-1; Tue, 06 May 2014 19:00:01 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id 52342460110; Tue, 6 May 2014 19:00:00 -0500 (CDT) Message-ID: <5369777F.6010203@rice.edu> Date: Tue, 06 May 2014 18:59:59 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Ian Lepore , Alan Cox Subject: Re: svn commit: r265418 - head/sys/vm References: <201405060342.s463g5Fx047447@svn.freebsd.org> <1399379941.22079.263.camel@revolution.hippie.lan> In-Reply-To: <1399379941.22079.263.camel@revolution.hippie.lan> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 kscore.compositescore=0 circleOfTrustscore=0 compositescore=0.765433954564634 urlsuspect_oldscore=0.765433954564634 suspectscore=4 recipient_domain_to_sender_totalscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=1 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=0 rbsscore=0.765433954564634 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1405060341 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 00:00:03 -0000 On 05/06/2014 07:39, Ian Lepore wrote: > On Tue, 2014-05-06 at 03:42 +0000, Alan Cox wrote: >> Author: alc >> Date: Tue May 6 03:42:04 2014 >> New Revision: 265418 >> URL: http://svnweb.freebsd.org/changeset/base/265418 >> >> Log: >> Prior to r254304, a separate function, vm_pageout_page_stats(), was used to >> periodically update the reference status of the active pages. This function >> was called, instead of vm_pageout_scan(), when memory was not scarce. The >> objective was to provide up to date reference status for active pages in >> case memory did become scarce and active pages needed to be deactivated. >> >> The active page queue scan performed by vm_pageout_page_stats() was >> virtually identical to that performed by vm_pageout_scan(), and so r254304 >> eliminated vm_pageout_page_stats(). Instead, vm_pageout_scan() is >> called with the parameter "pass" set to zero. The intention was that when >> pass is zero, vm_pageout_scan() would only scan the active queue. However, >> the variable page_shortage can still be greater than zero when memory is not >> scarce and vm_pageout_scan() is called with pass equal to zero. >> Consequently, the inactive queue may be scanned and dirty pages laundered >> even though that was not intended by r254304. This revision fixes that. >> >> Reported by: avg >> MFC after: 1 week >> Sponsored by: EMC / Isilon Storage Division >> >> Modified: >> head/sys/vm/vm_pageout.c >> >> Modified: head/sys/vm/vm_pageout.c >> ============================================================================== >> --- head/sys/vm/vm_pageout.c Tue May 6 03:38:04 2014 (r265417) >> +++ head/sys/vm/vm_pageout.c Tue May 6 03:42:04 2014 (r265418) >> @@ -942,13 +942,15 @@ vm_pageout_scan(struct vm_domain *vmd, i >> */ >> addl_page_shortage = 0; >> >> - deficit = atomic_readandclear_int(&vm_pageout_deficit); >> - >> /* >> * Calculate the number of pages we want to either free or move >> * to the cache. >> */ >> - page_shortage = vm_paging_target() + deficit; >> + if (pass > 0) { >> + deficit = atomic_readandclear_int(&vm_pageout_deficit); >> + page_shortage = vm_paging_target() + deficit; >> + } else >> + page_shortage = deficit = 0; >> >> /* >> * maxlaunder limits the number of dirty pages we flush per scan. >> > Does this address the observation that several folks have made on > current@ that pages are being pushed to swap much more agressively than > in the past, even when the system doesn't seem short of memory? > I hope so. Please let me know if you see any difference. I also suspect that another side-effect of r254304 is that we are swapping out idle processes sooner, before memory has become scarce. Has anyone observed this behavior? Alan From owner-svn-src-head@FreeBSD.ORG Wed May 7 00:51:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D74C2DAB; Wed, 7 May 2014 00:51:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7CB7A06; Wed, 7 May 2014 00:51:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s470pPTw036702; Wed, 7 May 2014 00:51:25 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s470pOLA036694; Wed, 7 May 2014 00:51:24 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201405070051.s470pOLA036694@svn.freebsd.org> From: Ed Maste Date: Wed, 7 May 2014 00:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265477 - in head/contrib/llvm/tools/clang: include/clang/Driver include/clang/Frontend lib/CodeGen lib/Driver lib/Frontend X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 00:51:25 -0000 Author: emaste Date: Wed May 7 00:51:24 2014 New Revision: 265477 URL: http://svnweb.freebsd.org/changeset/base/265477 Log: Merge -fstandalone-debug from Clang r198655: Implement a new -fstandalone-debug option. rdar://problem/15685848 It controls everything that -flimit-debug-info used to, plus the vtable type optimization. The old -fno-limit-debug-info option is now an alias to -fstandalone-debug and vice versa. Standalone is the default on Darwin until dtrace is updated to work with non-standalone debug info (rdar://problem/15758808). Note: I kept the LimitedDebugInfo name in CodeGenOptions::DebugInfoKind because NoStandaloneDebugInfo sounded even more confusing. Modified: head/contrib/llvm/tools/clang/include/clang/Driver/Options.td head/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp head/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp Modified: head/contrib/llvm/tools/clang/include/clang/Driver/Options.td ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Driver/Options.td Wed May 7 00:32:49 2014 (r265476) +++ head/contrib/llvm/tools/clang/include/clang/Driver/Options.td Wed May 7 00:51:24 2014 (r265477) @@ -549,8 +549,6 @@ def finstrument_functions : Flag<["-"], def fkeep_inline_functions : Flag<["-"], "fkeep-inline-functions">, Group; def flat__namespace : Flag<["-"], "flat_namespace">; def flax_vector_conversions : Flag<["-"], "flax-vector-conversions">, Group; -def flimit_debug_info : Flag<["-"], "flimit-debug-info">, Group, Flags<[CC1Option]>, - HelpText<"Limit debug information produced to reduce size of debug binary">; def flimited_precision_EQ : Joined<["-"], "flimited-precision=">, Group; def flto : Flag<["-"], "flto">, Group; def fno_lto : Flag<["-"], "fno-lto">, Group; @@ -645,8 +643,6 @@ def fno_inline : Flag<["-"], "fno-inline def fno_keep_inline_functions : Flag<["-"], "fno-keep-inline-functions">, Group; def fno_lax_vector_conversions : Flag<["-"], "fno-lax-vector-conversions">, Group, HelpText<"Disallow implicit conversions between vectors with a different number of elements or different element types">, Flags<[CC1Option]>; -def fno_limit_debug_info : Flag<["-"], "fno-limit-debug-info">, Group, Flags<[CC1Option]>, - HelpText<"Do not limit debug information produced to reduce size of debug binary">; def fno_merge_all_constants : Flag<["-"], "fno-merge-all-constants">, Group, Flags<[CC1Option]>, HelpText<"Disallow merging of constants">; def fno_modules : Flag <["-"], "fno-modules">, Group, @@ -774,6 +770,12 @@ def fno_signed_char : Flag<["-"], "fno-s def fsplit_stack : Flag<["-"], "fsplit-stack">, Group; def fstack_protector_all : Flag<["-"], "fstack-protector-all">, Group; def fstack_protector : Flag<["-"], "fstack-protector">, Group; +def fstandalone_debug : Flag<["-"], "fstandalone-debug">, Group, Flags<[CC1Option]>, + HelpText<"Emit full debug info for all types used by the program">; +def fno_standalone_debug : Flag<["-"], "fno-standalone-debug">, Group, Flags<[CC1Option]>, + HelpText<"Limit debug information produced to reduce size of debug binary">; +def flimit_debug_info : Flag<["-"], "flimit-debug-info">, Alias; +def fno_limit_debug_info : Flag<["-"], "fno-limit-debug-info">, Alias; def fstrict_aliasing : Flag<["-"], "fstrict-aliasing">, Group; def fstrict_enums : Flag<["-"], "fstrict-enums">, Group, Flags<[CC1Option]>, HelpText<"Enable optimizations based on the strict definition of an enum's " Modified: head/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h Wed May 7 00:32:49 2014 (r265476) +++ head/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h Wed May 7 00:51:24 2014 (r265477) @@ -50,12 +50,20 @@ public: }; enum DebugInfoKind { - NoDebugInfo, // Don't generate debug info. - DebugLineTablesOnly, // Emit only debug info necessary for generating - // line number tables (-gline-tables-only). - LimitedDebugInfo, // Limit generated debug info to reduce size - // (-flimit-debug-info). - FullDebugInfo // Generate complete debug info. + NoDebugInfo, /// Don't generate debug info. + + DebugLineTablesOnly, /// Emit only debug info necessary for generating + /// line number tables (-gline-tables-only). + + LimitedDebugInfo, /// Limit generated debug info to reduce size + /// (-fno-standalone-debug). This emits + /// forward decls for types that could be + /// replaced with forward decls in the source + /// code. For dynamic C++ classes type info + /// is only emitted int the module that + /// contains the classe's vtable. + + FullDebugInfo /// Generate complete debug info. }; enum TLSModel { Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Wed May 7 00:32:49 2014 (r265476) +++ head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Wed May 7 00:51:24 2014 (r265477) @@ -1456,13 +1456,13 @@ llvm::DIType CGDebugInfo::CreateType(con // declaration. The completeType, completeRequiredType, and completeClassData // callbacks will handle promoting the declaration to a definition. if (T || + // Under -flimit-debug-info: (DebugKind <= CodeGenOptions::LimitedDebugInfo && - // Under -flimit-debug-info, emit only a declaration unless the type is - // required to be complete. - !RD->isCompleteDefinitionRequired() && CGM.getLangOpts().CPlusPlus) || - // If the class is dynamic, only emit a declaration. A definition will be - // emitted whenever the vtable is emitted. - (CXXDecl && CXXDecl->hasDefinition() && CXXDecl->isDynamicClass()) || T) { + // Emit only a forward declaration unless the type is required. + ((!RD->isCompleteDefinitionRequired() && CGM.getLangOpts().CPlusPlus) || + // If the class is dynamic, only emit a declaration. A definition will be + // emitted whenever the vtable is emitted. + (CXXDecl && CXXDecl->hasDefinition() && CXXDecl->isDynamicClass())))) { llvm::DIDescriptor FDContext = getContextDescriptor(cast(RD->getDeclContext())); if (!T) Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Wed May 7 00:32:49 2014 (r265476) +++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Wed May 7 00:51:24 2014 (r265477) @@ -3002,8 +3002,8 @@ void Clang::ConstructJob(Compilation &C, Args.AddLastArg(CmdArgs, options::OPT_femit_all_decls); Args.AddLastArg(CmdArgs, options::OPT_fformat_extensions); Args.AddLastArg(CmdArgs, options::OPT_fheinous_gnu_extensions); - Args.AddLastArg(CmdArgs, options::OPT_flimit_debug_info); - Args.AddLastArg(CmdArgs, options::OPT_fno_limit_debug_info); + Args.AddLastArg(CmdArgs, options::OPT_fstandalone_debug); + Args.AddLastArg(CmdArgs, options::OPT_fno_standalone_debug); Args.AddLastArg(CmdArgs, options::OPT_fno_operator_names); // AltiVec language extensions aren't relevant for assembling. if (!isa(JA) || Modified: head/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp Wed May 7 00:32:49 2014 (r265476) +++ head/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp Wed May 7 00:51:24 2014 (r265477) @@ -295,7 +295,8 @@ static void ParseCommentArgs(CommentOpti } static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, - DiagnosticsEngine &Diags) { + DiagnosticsEngine &Diags, + const TargetOptions &TargetOpts) { using namespace options; bool Success = true; @@ -322,10 +323,16 @@ static bool ParseCodeGenArgs(CodeGenOpti Opts.setDebugInfo(CodeGenOptions::DebugLineTablesOnly); } else if (Args.hasArg(OPT_g_Flag) || Args.hasArg(OPT_gdwarf_2) || Args.hasArg(OPT_gdwarf_3) || Args.hasArg(OPT_gdwarf_4)) { - if (Args.hasFlag(OPT_flimit_debug_info, OPT_fno_limit_debug_info, true)) - Opts.setDebugInfo(CodeGenOptions::LimitedDebugInfo); - else + bool Default = false; + // Until dtrace (via CTF) can deal with distributed debug info, + // Darwin defaults to standalone/full debug info. + if (llvm::Triple(TargetOpts.Triple).isOSDarwin()) + Default = true; + + if (Args.hasFlag(OPT_fstandalone_debug, OPT_fno_standalone_debug, Default)) Opts.setDebugInfo(CodeGenOptions::FullDebugInfo); + else + Opts.setDebugInfo(CodeGenOptions::LimitedDebugInfo); } Opts.DebugColumnInfo = Args.hasArg(OPT_dwarf_column_info); Opts.SplitDwarfFile = Args.getLastArgValue(OPT_split_dwarf_file); @@ -1657,8 +1664,9 @@ bool CompilerInvocation::CreateFromArgs( ParseFileSystemArgs(Res.getFileSystemOpts(), *Args); // FIXME: We shouldn't have to pass the DashX option around here InputKind DashX = ParseFrontendArgs(Res.getFrontendOpts(), *Args, Diags); - Success = ParseCodeGenArgs(Res.getCodeGenOpts(), *Args, DashX, Diags) - && Success; + ParseTargetArgs(Res.getTargetOpts(), *Args); + Success = ParseCodeGenArgs(Res.getCodeGenOpts(), *Args, DashX, Diags, + Res.getTargetOpts()) && Success; ParseHeaderSearchArgs(Res.getHeaderSearchOpts(), *Args); if (DashX != IK_AST && DashX != IK_LLVM_IR) { ParseLangArgs(*Res.getLangOpts(), *Args, DashX, Diags); @@ -1673,8 +1681,6 @@ bool CompilerInvocation::CreateFromArgs( ParsePreprocessorArgs(Res.getPreprocessorOpts(), *Args, FileMgr, Diags); ParsePreprocessorOutputArgs(Res.getPreprocessorOutputOpts(), *Args, Res.getFrontendOpts().ProgramAction); - ParseTargetArgs(Res.getTargetOpts(), *Args); - return Success; } From owner-svn-src-head@FreeBSD.ORG Wed May 7 03:47:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 742B69CD; Wed, 7 May 2014 03:47:48 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 1F678B11; Wed, 7 May 2014 03:47:47 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id B2345D64E06; Wed, 7 May 2014 13:47:35 +1000 (EST) Date: Wed, 7 May 2014 13:47:31 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Somers Subject: Re: svn commit: r265472 - head/bin/dd In-Reply-To: <201405062206.s46M6dxW060155@svn.freebsd.org> Message-ID: <20140507113345.B923@besplex.bde.org> References: <201405062206.s46M6dxW060155@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eojmkOZX c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=LJiQtwaW0WEA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=Dgkua-FqpuDcXRS_RLkA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 03:47:48 -0000 On Tue, 6 May 2014, Alan Somers wrote: > Log: > dd(1) uses gettimeofday(2) to compute the throughput statistics. However, > gettimeofday returns the system clock, which may jump forward or back, > especially if NTP is in use. If the time jumps backwards, then dd will see > negative elapsed time, round it up to 1usec, and print an absurdly fast > transfer rate. > > The solution is to use clock_gettime(2) with CLOCK_MONOTONIC_PRECISE as the > clock_id. That clock advances steadily, regardless of changes to the system > clock. > > Reviewed by: delphij > MFC after: 3 days > Sponsored by: Spectra Logic > ... > Modified: head/bin/dd/dd.c > ============================================================================== > --- head/bin/dd/dd.c Tue May 6 22:04:50 2014 (r265471) > +++ head/bin/dd/dd.c Tue May 6 22:06:39 2014 (r265472) > @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > > #include > #include > @@ -61,6 +60,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include Use of is a style bug. It is not used in BSD or KNF code like dd used to be. > +#include > #include > > #include "dd.h" > @@ -123,7 +124,7 @@ static void > setup(void) > { > u_int cnt; > - struct timeval tv; > + struct timespec tv; > > if (in.name == NULL) { > in.name = "stdin"; > @@ -240,8 +241,9 @@ setup(void) > ctab = casetab; > } > > - (void)gettimeofday(&tv, NULL); Not checking for errors, and especially voiding the result to say that errors need not be checked for, was sloppy. > - st.start = tv.tv_sec + tv.tv_usec * 1e-6; > + if (clock_gettime(CLOCK_MONOTONIC_PRECISE, &tv)) > + err(EX_OSERR, "clock_gettime"); The existence of CLOCK_MONOTONIC_PRECISE is a design error. It is the same as the standard CLOCK_MONOTONIC. Use of the former is just gratuitously unportable. It ensures a compile-time failure on OSes (including old versions of FreeBSD) that don't have the CLOCK_MONOTONIC_PRECISE mistake. It gives a runtime error on old versions of FreeBSD that have clock_gettime() and CLOCK_MONOTONIC but not CLOCK_MONOTONIC_PRECISE. Apart from this error, clock_gettime() is as likely to fail as gettimeofday(), or exit(). The existence of CLOCK_MONOTONIC_FAST is a larger design error. It is not fast, but just sloppy, broken and not very fast (sloppiness is the intentional part of its design). Of course there is no need to use it to speed up the whole 2 clock_gettime() calls in dd. It is almost useless for other applications too. In non-broken implementations, the speed of CLOCK_* tends to be dominated by the syscall time even when the timer hardware is slow. On freefall now, the implementation is about half as good as possible, and takes between 32 and 35 nanoseconds for all clock ids, with the least accurate clock id TIME_SECOND tieing with CLOCK_REALTIME for slowest (only about 1 nanosecond slower) since it has the worst implementation. (The implementation on freefall avoids syscalls provided the timer hardware is the TSC. The hardware timer and binuptime() are used for all syscalls including TIME_SECOND. TIME_SECOND is slowest because it does extra work to zero tv_sec after calculating it with maximal precision. Doing it this way gives the correct time in seconds, but is incompatible with the kernel (syscall and kernel seconds variable) since the kernel calculations are sloppy. The kernel time for seconds and for the sloppy "FAST" clock ids and for the corresponding kernel timestamp functions lags the precise time by up to 1/HZ seconds. This difference can easily be seen from userland. The hardware part of the 32-35 nanoseconds is 2-4 nanoseconds. This is in sloppy tests. Reading the TSC is unserialized, and loops reading it may be pipelined too well to time it accurately. Also, the times read from it are not completely accurate. But clock_gettime() doesn't serialize it either. Serializing it would make it much slower (maybe 50 nanoseconds). 2-4 nanoseconds is almost as fast as on AthlonXP 10 years ago! rdtsc tends to be slower than that on Intel CPUs and on modern CPUs. Synchronization in hardware makes it slower on modern CPUs. ISTR it took about 65 cycles on a previous generation of Intel CPUs. 32-35 nanonseconds for the libc implementation is actually less than half as good as it possible if the hardware part really is only 2-4 nanoseconds. There is a lot of overhead from layering and from working around hardware bugs that usually don't exist. ) Bad implementations can be quite bad. With an i8254 timecounter, it takes about 5000 nanoseconds to read the hardware. On a 486, it took an additional 10000-20000 nanoseconds for overheads including a syscall. On a Pentium1, it only took 1000-2000 nanoseconds for overheads in old versions of FreeBSD (much more now). With an ACPI-"fast" timecounter, it takes 1000-2000 nanoseconds to read the hardware. HPET is only a few times faster. This does dominate syscall times on modern CPUs. syscall times are more like 100-200 nanoseconds on modern CPUs. The libc implementation reduces this to 30-60 nanoseconds. > + st.start = tv.tv_sec + tv.tv_nsec * 1.0e-9; > } > > static void > > Modified: head/bin/dd/misc.c > ============================================================================== > --- head/bin/dd/misc.c Tue May 6 22:04:50 2014 (r265471) > +++ head/bin/dd/misc.c Tue May 6 22:06:39 2014 (r265472) > @@ -40,14 +40,16 @@ static char sccsid[] = "@(#)misc.c 8.3 ( > __FBSDID("$FreeBSD$"); > > #include > -#include > > +#include > #include > #include > #include > #include > #include > #include > +#include > +#include > #include > > #include "dd.h" > @@ -56,16 +58,20 @@ __FBSDID("$FreeBSD$"); > void > summary(void) > { > - struct timeval tv; > - double secs; > + struct timespec tv, tv_res; > + double secs, res; > > if (ddflags & C_NOINFO) > return; > > - (void)gettimeofday(&tv, NULL); > - secs = tv.tv_sec + tv.tv_usec * 1e-6 - st.start; > - if (secs < 1e-6) > - secs = 1e-6; Bogus fixup. secs had microseconds granularity except possibly for for tiny roundoff errors. I think the roundoff errors cannot give a result near but not identical to 1e-6 or 0 unless tv_sec has a garbage value. The difference can be 0 in the unlikely event that the run takes less than 1 microsecond, or negative when the time goes backwards. Fixing up 0 to 1e-6 is reasonable. Fixing up negative differences to 1e-6 avoids division by 0 but gives garbage results. I think this was only intended to fix up 0, and fixing up negative differences is accidental. > + if (clock_gettime(CLOCK_MONOTONIC_PRECISE, &tv)) > + err(EX_OSERR, "clock_gettime"); > + if (clock_getres(CLOCK_MONOTONIC_PRECISE, &tv_res)) > + err(EX_OSERR, "clock_getres"); clock_getres() is almost useless, and is useless here. It is broken as designed, since the precision may be less than 1 nanosecond but 1 nanosecond is the smallest positive representable value, but that is not a problem here since clock_gettime() also can't distinguish differences smaller than 1 nanosecond. > + secs = tv.tv_sec + tv.tv_nsec * 1.0e-9 - st.start; > + res = tv_res.tv_sec + tv_res.tv_nsec * 1.0e-9; IIRC, POSIX is confused about resolution vs precision and clock_getres() actually returns the resolution, so this variable has the correct name. I quote "precision" in the following to indicate this confusion. > + if (secs < res) > + secs = res; The fixup is now only reachable in 3 cases that can't happen: - when the monotonic time goes backwards due to a kernel bug - when the monotonic time doesn't increase, so that the difference is 0. Oops, this can happen for timecounters with very low "precision". You don't need to know the "precision" to check for this. - when the monotonic time does increase, but by an amount smaller than the "precision". This indicates that the "precision" is wrong. In the 3rd case, the actual difference may as well be used. It is probably slightly wrong at worst (say 999 nanoseconds when the "precision" is 1000 nanoseconds). The timing is going to be very inaccurate for short runs, so another 10% inaccuracy doesn't matter. At worst, the difference might be 1 nanosecond when it should be hundreds of nanoseconds. (I don't see how this can happen without a kernel bug. Just reading the time can take thousands of nanoseconds.) The result will be garbage, but it won't overflow. In the 1st case, we don't know the correct fixup, and a tiny value from clock_getprec() is not as good as anything, except to make the garbage in the result more obvious. In the second case, fixing up to the "precision" may give a large estimate. The fixup might as well be to a nominal value like 1 nanosecond or 1 second. CLOCK_MONOTONIC can't have a very low precision, and the timing for runs that don't take as long as a large multiple of the precision is inaccurate. We could also report the result as in this case. > (void)fprintf(stderr, > "%ju+%ju records in\n%ju+%ju records out\n", > st.in_full, st.in_part, st.out_full, st.out_part); > @@ -77,7 +83,7 @@ summary(void) > st.trunc, (st.trunc == 1) ? "block" : "blocks"); > if (!(ddflags & C_NOXFER)) { > (void)fprintf(stderr, > - "%ju bytes transferred in %.6f secs (%.0f bytes/sec)\n", > + "%ju bytes transferred in %.9f secs (%.0f bytes/sec)\n", nanoseconds resolution is excessive here, and changes the output format. The only use of it is to debug cases where the output is garbage due to the interval being about 1 nanosecond. Printing nanoseconds resolution is also inconsistent with the fussy "precision" adjustment above. > st.bytes, secs, st.bytes / secs); > } > need_summary = 0; In practice, we can depend on at least microseconds "precision" since even gettimeofday() gave that as a precision and gettimeofday() was fixed on at least x86 20-25 years ago so that it had almost the same "precision" (resolution) as its granularity. In ping(8), we still just use microseconds resolution and even non-monotonic gettimeofday(). It only had milliseconds resolution in BSD 20-25 years ago and in Linux much more recently. dg fixed it to use the microseconds resolution that became available when gettimeofday() was fixed. clock_gettime() didn't exist then. I tried converting it to use nanoseconds resolution and wasn't happy with the results. Formats like %.9f are needed to see the full resolution, but networking latency is still too large so reasolution of more tha 1 microsecond is rarely useful, and the extra digits from %.9f format just make the value harder to read. Bruce From owner-svn-src-head@FreeBSD.ORG Wed May 7 05:11:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA4F7A09; Wed, 7 May 2014 05:11:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A810E1E0; Wed, 7 May 2014 05:11:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s475BG50052943; Wed, 7 May 2014 05:11:16 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s475BGF6052942; Wed, 7 May 2014 05:11:16 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201405070511.s475BGF6052942@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 7 May 2014 05:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265484 - head/sys/dev/mpr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 05:11:16 -0000 Author: ken Date: Wed May 7 05:11:16 2014 New Revision: 265484 URL: http://svnweb.freebsd.org/changeset/base/265484 Log: Remove some debugging code. Submitted by: Steve McConnell MFC after: 3 days Modified: head/sys/dev/mpr/mpr.c Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Wed May 7 05:06:55 2014 (r265483) +++ head/sys/dev/mpr/mpr.c Wed May 7 05:11:16 2014 (r265484) @@ -2182,8 +2182,6 @@ mpr_add_chain(struct mpr_command *cm, in * code other than 0. */ if (cm->cm_flags & MPR_CM_FLAGS_SGE_SIMPLE) { -//SLM-test -printf("Trying to add a chain element to an MPI SGL\n"); mpr_dprint(sc, MPR_ERROR, "A chain element cannot be added to " "an MPI SGL.\n"); return(ENOBUFS); From owner-svn-src-head@FreeBSD.ORG Wed May 7 05:14:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21F03BC5; Wed, 7 May 2014 05:14:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C18D1FD; Wed, 7 May 2014 05:14:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s475EmXa055660; Wed, 7 May 2014 05:14:48 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s475Emlf055659; Wed, 7 May 2014 05:14:48 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201405070514.s475Emlf055659@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 7 May 2014 05:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265485 - head/sys/dev/mpr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 05:14:49 -0000 Author: ken Date: Wed May 7 05:14:48 2014 New Revision: 265485 URL: http://svnweb.freebsd.org/changeset/base/265485 Log: Hold the SIM lock when calling xpt_create_path() and xpt_action() in mprsas_SSU_to_SATA_devices(). This fixes an assertion on shutdown with INVARIANTS enabled with SATA drives present on an IR firmware controller. Reviewed by: Steve McConnell . MFC after: 3 days Modified: head/sys/dev/mpr/mpr_sas_lsi.c Modified: head/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- head/sys/dev/mpr/mpr_sas_lsi.c Wed May 7 05:11:16 2014 (r265484) +++ head/sys/dev/mpr/mpr_sas_lsi.c Wed May 7 05:14:48 2014 (r265485) @@ -1026,6 +1026,8 @@ mprsas_SSU_to_SATA_devices(struct mpr_so char path_str[64]; struct timeval cur_time, start_time; + mpr_lock(sc); + /* * For each LUN of each target, issue a StartStopUnit command to stop * the device. @@ -1041,6 +1043,7 @@ mprsas_SSU_to_SATA_devices(struct mpr_so SLIST_FOREACH(lun, &target->luns, lun_link) { ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { + mpr_unlock(sc); mpr_dprint(sc, MPR_FAULT, "Unable to alloc " "CCB to stop unit.\n"); return; @@ -1057,6 +1060,7 @@ mprsas_SSU_to_SATA_devices(struct mpr_so mpr_dprint(sc, MPR_FAULT, "Unable to " "create LUN path to stop unit.\n"); xpt_free_ccb(ccb); + mpr_unlock(sc); return; } xpt_path_string(ccb->ccb_h.path, path_str, @@ -1092,6 +1096,8 @@ mprsas_SSU_to_SATA_devices(struct mpr_so } } + mpr_unlock(sc); + /* * Wait until all of the SSU commands have completed or time has * expired (60 seconds). pause for 100ms each time through. If any From owner-svn-src-head@FreeBSD.ORG Wed May 7 06:01:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5378643D; Wed, 7 May 2014 06:01:56 +0000 (UTC) Received: from mail-lb0-x230.google.com (mail-lb0-x230.google.com [IPv6:2a00:1450:4010:c04::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C79F7B7; Wed, 7 May 2014 06:01:54 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id p9so647707lbv.35 for ; Tue, 06 May 2014 23:01:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=TM3QL/XXd2nh/UqJy2BZOeZDnQChOykeaYxb83Ic+fE=; b=YLve4qIFCB21oznuOYj+4qeP7SqTZc6cCW6xcrZvOwufC0nLw+7kEfVddqKqERXiqm 3vXC23iyMQ1Nv8qBLitYzHWIq4BZ1+BH/MbnnBR6wC4iqPlUTquu2OiOSnTxe/yUDbHi RNEblc2xz8VW3Okd3hDspd4whV10lGey7eL0B21k5ip15alOk8e1/yVv57SCRzdxbY8L gbIkC5iag2Eg4zjaSVchxjxiXNpu1Mop8Ig42vzRTZSGFULPoza3VMsIK7qR9tGmhkfU Asq/+oRAGnHbY/dnN7EtkChez43eoWxNMI6ZaWyIoCRgxMvV88gBZxJELSzwJYCaNulK Us5A== X-Received: by 10.112.137.5 with SMTP id qe5mr38188801lbb.16.1399442512929; Tue, 06 May 2014 23:01:52 -0700 (PDT) Received: from [10.0.1.4] ([176.193.191.201]) by mx.google.com with ESMTPSA id bm3sm16040652lbb.12.2014.05.06.23.01.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 May 2014 23:01:50 -0700 (PDT) Sender: Dmitry Sivachenko Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265418 - head/sys/vm From: Dmitry Sivachenko In-Reply-To: <5369777F.6010203@rice.edu> Date: Wed, 7 May 2014 10:01:49 +0400 Content-Transfer-Encoding: quoted-printable Message-Id: <4A25D43B-836F-417B-85F4-C4D730E8E2DC@FreeBSD.org> References: <201405060342.s463g5Fx047447@svn.freebsd.org> <1399379941.22079.263.camel@revolution.hippie.lan> <5369777F.6010203@rice.edu> To: Alan Cox X-Mailer: Apple Mail (2.1874) Cc: Alan Cox , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ian Lepore X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 06:01:56 -0000 On 07 =D0=BC=D0=B0=D1=8F 2014 =D0=B3., at 3:59, Alan Cox = wrote: >>>=20 >> Does this address the observation that several folks have made on >> current@ that pages are being pushed to swap much more agressively = than >> in the past, even when the system doesn't seem short of memory? >>=20 >=20 > I hope so. Please let me know if you see any difference. >=20 > I also suspect that another side-effect of r254304 is that we are > swapping out idle processes sooner, before memory has become scarce.=20= > Has anyone observed this behavior? >=20 Sure, please read this thread: = http://lists.freebsd.org/pipermail/freebsd-hackers/2014-April/044786.html From owner-svn-src-head@FreeBSD.ORG Wed May 7 07:57:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6969730A; Wed, 7 May 2014 07:57:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 570312EF; Wed, 7 May 2014 07:57:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s477vpVp030293; Wed, 7 May 2014 07:57:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s477vpBC030292; Wed, 7 May 2014 07:57:51 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405070757.s477vpBC030292@svn.freebsd.org> From: Adrian Chadd Date: Wed, 7 May 2014 07:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265527 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 07:57:51 -0000 Author: adrian Date: Wed May 7 07:57:50 2014 New Revision: 265527 URL: http://svnweb.freebsd.org/changeset/base/265527 Log: There's no need to be this paranoid - ni is deferenced before this point. Coverity ID: CID 1211937 Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Wed May 7 07:56:36 2014 (r265526) +++ head/sys/dev/ath/if_ath_rx.c Wed May 7 07:57:50 2014 (r265527) @@ -344,7 +344,7 @@ ath_recv_mgmt(struct ieee80211_node *ni, #define TU_TO_TSF(_tu) (((u_int64_t)(_tu)) << 10) tsf_intval = 1; - if (ni != NULL && ni->ni_intval > 0) { + if (ni->ni_intval > 0) { tsf_intval = TU_TO_TSF(ni->ni_intval); } #undef TU_TO_TSF From owner-svn-src-head@FreeBSD.ORG Wed May 7 08:38:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1723A98B; Wed, 7 May 2014 08:38:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 044BC984; Wed, 7 May 2014 08:38:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s478c2ms049296; Wed, 7 May 2014 08:38:02 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s478c2sI049294; Wed, 7 May 2014 08:38:02 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201405070838.s478c2sI049294@svn.freebsd.org> From: Peter Holm Date: Wed, 7 May 2014 08:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265534 - in head: lib/libc/sys sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 08:38:03 -0000 Author: pho Date: Wed May 7 08:38:02 2014 New Revision: 265534 URL: http://svnweb.freebsd.org/changeset/base/265534 Log: msync(2) must return ENOMEM and not EINVAL when the address is outside the allowed range or when one or more pages are not mapped. This according to The Open Group Base Specifications Issue 7. Discussed with: attilio, Bruce Evans Reviewed by: alc, Garrett Cooper Reported by: ATF MFC after: 2 weeks Sponsored by: EMC / Isilon storage division Modified: head/lib/libc/sys/msync.2 head/sys/vm/vm_mmap.c Modified: head/lib/libc/sys/msync.2 ============================================================================== --- head/lib/libc/sys/msync.2 Wed May 7 08:06:54 2014 (r265533) +++ head/lib/libc/sys/msync.2 Wed May 7 08:38:02 2014 (r265534) @@ -87,11 +87,13 @@ The .Fa addr argument is not a multiple of the hardware page size. -.It Bq Er EINVAL -The +.It Bq Er ENOMEM +The addresses in the range starting at +.Fa addr +and continuing for .Fa len -argument -is too large or negative. +bytes are outside the range allowed for the address space of a +process or specify one or more pages that are not mapped. .It Bq Er EINVAL The .Fa flags @@ -99,7 +101,7 @@ argument was both MS_ASYNC and MS_INVALIDATE. Only one of these flags is allowed. .It Bq Er EIO - An error occurred while writing at least one of the pages in +An error occurred while writing at least one of the pages in the specified region. .El .Sh SEE ALSO Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Wed May 7 08:06:54 2014 (r265533) +++ head/sys/vm/vm_mmap.c Wed May 7 08:38:02 2014 (r265534) @@ -556,7 +556,7 @@ sys_msync(td, uap) case KERN_SUCCESS: return (0); case KERN_INVALID_ADDRESS: - return (EINVAL); /* Sun returns ENOMEM? */ + return (ENOMEM); case KERN_INVALID_ARGUMENT: return (EBUSY); case KERN_FAILURE: From owner-svn-src-head@FreeBSD.ORG Wed May 7 09:15:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD3312A3; Wed, 7 May 2014 09:15:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A95B0CA0; Wed, 7 May 2014 09:15:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s479Fkwm067201; Wed, 7 May 2014 09:15:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s479FkJl067200; Wed, 7 May 2014 09:15:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201405070915.s479FkJl067200@svn.freebsd.org> From: Marius Strobl Date: Wed, 7 May 2014 09:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265535 - head/sbin/gvinum X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 09:15:46 -0000 Author: marius Date: Wed May 7 09:15:46 2014 New Revision: 265535 URL: http://svnweb.freebsd.org/changeset/base/265535 Log: - Sprinkle const and static as appropriate. - Fix whitespace bugs. - Remove pointless returns in void functions. - Nuke pointless switch cases mirroring the default. MFC after: 3 days Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: head/sbin/gvinum/gvinum.c Modified: head/sbin/gvinum/gvinum.c ============================================================================== --- head/sbin/gvinum/gvinum.c Wed May 7 08:38:02 2014 (r265534) +++ head/sbin/gvinum/gvinum.c Wed May 7 09:15:46 2014 (r265535) @@ -58,35 +58,36 @@ #include "gvinum.h" -void gvinum_attach(int, char **); -void gvinum_concat(int, char **); -void gvinum_create(int, char **); -void gvinum_detach(int, char **); -void gvinum_grow(int, char **); -void gvinum_help(void); -void gvinum_list(int, char **); -void gvinum_move(int, char **); -void gvinum_mirror(int, char **); -void gvinum_parityop(int, char **, int); -void gvinum_printconfig(int, char **); -void gvinum_raid5(int, char **); -void gvinum_rename(int, char **); -void gvinum_resetconfig(int, char **); -void gvinum_rm(int, char **); -void gvinum_saveconfig(void); -void gvinum_setstate(int, char **); -void gvinum_start(int, char **); -void gvinum_stop(int, char **); -void gvinum_stripe(int, char **); -void parseline(int, char **); -void printconfig(FILE *, char *); - -char *create_drive(char *); -void create_volume(int, char **, char *); -char *find_name(const char *, int, int); -char *find_pattern(char *, char *); -void copy_device(struct gv_drive *, const char *); -#define find_drive() find_name("gvinumdrive", GV_TYPE_DRIVE, GV_MAXDRIVENAME) +static void gvinum_attach(int, char * const *); +static void gvinum_concat(int, char * const *); +static void gvinum_create(int, char * const *); +static void gvinum_detach(int, char * const *); +static void gvinum_grow(int, char * const *); +static void gvinum_help(void); +static void gvinum_list(int, char * const *); +static void gvinum_move(int, char * const *); +static void gvinum_mirror(int, char * const *); +static void gvinum_parityop(int, char * const * , int); +static void gvinum_printconfig(int, char * const *); +static void gvinum_raid5(int, char * const *); +static void gvinum_rename(int, char * const *); +static void gvinum_resetconfig(int, char * const *); +static void gvinum_rm(int, char * const *); +static void gvinum_saveconfig(void); +static void gvinum_setstate(int, char * const *); +static void gvinum_start(int, char * const *); +static void gvinum_stop(int, char * const *); +static void gvinum_stripe(int, char * const *); +static void parseline(int, char * const *); +static void printconfig(FILE *, const char *); + +static char *create_drive(const char *); +static void create_volume(int, char * const * , const char *); +static char *find_name(const char *, int, int); +static const char *find_pattern(char *, const char *); +static void copy_device(struct gv_drive *, const char *); +#define find_drive() \ + find_name("gvinumdrive", GV_TYPE_DRIVE, GV_MAXDRIVENAME) int main(int argc, char **argv) @@ -132,8 +133,8 @@ main(int argc, char **argv) } /* Attach a plex to a volume or a subdisk to a plex. */ -void -gvinum_attach(int argc, char **argv) +static void +gvinum_attach(int argc, char * const *argv) { struct gctl_req *req; const char *errstr; @@ -169,8 +170,8 @@ gvinum_attach(int argc, char **argv) gctl_free(req); } -void -gvinum_create(int argc, char **argv) +static void +gvinum_create(int argc, char * const *argv) { struct gctl_req *req; struct gv_drive *d; @@ -402,8 +403,8 @@ gvinum_create(int argc, char **argv) } /* Create a concatenated volume. */ -void -gvinum_concat(int argc, char **argv) +static void +gvinum_concat(int argc, char * const *argv) { if (argc < 2) { @@ -413,10 +414,9 @@ gvinum_concat(int argc, char **argv) create_volume(argc, argv, "concat"); } - /* Create a drive quick and dirty. */ -char * -create_drive(char *device) +static char * +create_drive(const char *device) { struct gv_drive *d; struct gctl_req *req; @@ -479,12 +479,12 @@ create_drive(char *device) return (drivename); } -/* +/* * General routine for creating a volume. Mainly for use by concat, mirror, * raid5 and stripe commands. */ -void -create_volume(int argc, char **argv, char *verb) +static void +create_volume(int argc, char * const *argv, const char *verb) { struct gctl_req *req; const char *errstr; @@ -518,7 +518,7 @@ create_volume(int argc, char **argv, cha snprintf(buf, sizeof(buf), "drive%d", drives++); /* First we create the drive. */ - drivename = create_drive(argv[i]); + drivename = create_drive(argv[i]); if (drivename == NULL) goto bad; /* Then we add it to the request. */ @@ -534,7 +534,7 @@ create_volume(int argc, char **argv, cha /* Then we send a request to actually create the volumes. */ gctl_ro_param(req, "verb", -1, verb); - gctl_ro_param(req, "flags", sizeof(int), &flags); + gctl_ro_param(req, "flags", sizeof(int), &flags); gctl_ro_param(req, "drives", sizeof(int), &drives); gctl_ro_param(req, "name", -1, volname); errstr = gctl_issue(req); @@ -545,8 +545,8 @@ bad: } /* Parse a line of the config, return the word after . */ -char * -find_pattern(char *line, char *pattern) +static const char * +find_pattern(char *line, const char *pattern) { char *ptr; @@ -563,12 +563,12 @@ find_pattern(char *line, char *pattern) } /* Find a free name for an object given a prefix. */ -char * +static char * find_name(const char *prefix, int type, int namelen) { struct gctl_req *req; - char comment[1], buf[GV_CFG_LEN - 1], *name, *sname, *ptr; - const char *errstr; + char comment[1], buf[GV_CFG_LEN - 1], *sname, *ptr; + const char *errstr, *name; int i, n, begin, len, conflict; char line[1024]; @@ -633,9 +633,10 @@ find_name(const char *prefix, int type, return (NULL); } -void +static void copy_device(struct gv_drive *d, const char *device) { + if (strncmp(device, "/dev/", 5) == 0) strlcpy(d->device, (device + 5), sizeof(d->device)); else @@ -643,8 +644,8 @@ copy_device(struct gv_drive *d, const ch } /* Detach a plex or subdisk from its parent. */ -void -gvinum_detach(int argc, char **argv) +static void +gvinum_detach(int argc, char * const *argv) { const char *errstr; struct gctl_req *req; @@ -654,7 +655,7 @@ gvinum_detach(int argc, char **argv) optreset = 1; optind = 1; while ((i = getopt(argc, argv, "f")) != -1) { - switch(i) { + switch (i) { case 'f': flags |= GV_FLAG_F; break; @@ -682,9 +683,10 @@ gvinum_detach(int argc, char **argv) gctl_free(req); } -void +static void gvinum_help(void) { + printf("COMMANDS\n" "checkparity [-f] plex\n" " Check the parity blocks of a RAID-5 plex.\n" @@ -739,12 +741,10 @@ gvinum_help(void) "stripe [-fv] [-n name] drives\n" " Create a striped volume from the specified drives.\n" ); - - return; } -void -gvinum_setstate(int argc, char **argv) +static void +gvinum_setstate(int argc, char * const *argv) { struct gctl_req *req; int flags, i; @@ -798,8 +798,8 @@ gvinum_setstate(int argc, char **argv) gctl_free(req); } -void -gvinum_list(int argc, char **argv) +static void +gvinum_list(int argc, char * const *argv) { struct gctl_req *req; int flags, i, j; @@ -860,12 +860,11 @@ gvinum_list(int argc, char **argv) printf("%s", config); gctl_free(req); - return; } /* Create a mirrored volume. */ -void -gvinum_mirror(int argc, char **argv) +static void +gvinum_mirror(int argc, char * const *argv) { if (argc < 2) { @@ -876,8 +875,8 @@ gvinum_mirror(int argc, char **argv) } /* Note that move is currently of form '[-r] target object [...]' */ -void -gvinum_move(int argc, char **argv) +static void +gvinum_move(int argc, char * const *argv) { struct gctl_req *req; const char *errstr; @@ -927,17 +926,17 @@ gvinum_move(int argc, char **argv) if (errstr != NULL) warnx("can't move object(s): %s", errstr); gctl_free(req); - return; } -void -gvinum_printconfig(int argc, char **argv) +static void +gvinum_printconfig(int argc, char * const *argv) { + printconfig(stdout, ""); } -void -gvinum_parityop(int argc, char **argv, int rebuild) +static void +gvinum_parityop(int argc, char * const *argv, int rebuild) { struct gctl_req *req; int flags, i; @@ -961,7 +960,6 @@ gvinum_parityop(int argc, char **argv, i case 'v': flags |= GV_FLAG_V; break; - case '?': default: warnx("invalid flag '%c'", i); return; @@ -989,8 +987,8 @@ gvinum_parityop(int argc, char **argv, i } /* Create a RAID-5 volume. */ -void -gvinum_raid5(int argc, char **argv) +static void +gvinum_raid5(int argc, char * const *argv) { if (argc < 2) { @@ -1000,9 +998,8 @@ gvinum_raid5(int argc, char **argv) create_volume(argc, argv, "raid5"); } - -void -gvinum_rename(int argc, char **argv) +static void +gvinum_rename(int argc, char * const *argv) { struct gctl_req *req; const char *errstr; @@ -1018,7 +1015,6 @@ gvinum_rename(int argc, char **argv) case 'r': flags |= GV_FLAG_R; break; - case '?': default: return; } @@ -1051,11 +1047,10 @@ gvinum_rename(int argc, char **argv) if (errstr != NULL) warnx("can't rename object: %s", errstr); gctl_free(req); - return; } -void -gvinum_rm(int argc, char **argv) +static void +gvinum_rm(int argc, char * const *argv) { struct gctl_req *req; int flags, i, j; @@ -1073,7 +1068,6 @@ gvinum_rm(int argc, char **argv) case 'r': flags |= GV_FLAG_R; break; - case '?': default: return; } @@ -1101,8 +1095,8 @@ gvinum_rm(int argc, char **argv) gctl_free(req); } -void -gvinum_resetconfig(int argc, char **argv) +static void +gvinum_resetconfig(int argc, char * const *argv) { struct gctl_req *req; const char *errstr; @@ -1150,7 +1144,7 @@ gvinum_resetconfig(int argc, char **argv printf("gvinum configuration obliterated\n"); } -void +static void gvinum_saveconfig(void) { struct gctl_req *req; @@ -1165,8 +1159,8 @@ gvinum_saveconfig(void) gctl_free(req); } -void -gvinum_start(int argc, char **argv) +static void +gvinum_start(int argc, char * const *argv) { struct gctl_req *req; int i, initsize, j; @@ -1186,7 +1180,6 @@ gvinum_start(int argc, char **argv) case 'S': initsize = atoi(optarg); break; - case '?': default: return; } @@ -1218,8 +1211,8 @@ gvinum_start(int argc, char **argv) gctl_free(req); } -void -gvinum_stop(int argc, char **argv) +static void +gvinum_stop(int argc, char * const *argv) { int err, fileid; @@ -1253,8 +1246,8 @@ gvinum_stop(int argc, char **argv) } /* Create a striped volume. */ -void -gvinum_stripe(int argc, char **argv) +static void +gvinum_stripe(int argc, char * const *argv) { if (argc < 2) { @@ -1265,8 +1258,8 @@ gvinum_stripe(int argc, char **argv) } /* Grow a subdisk by adding disk backed by provider. */ -void -gvinum_grow(int argc, char **argv) +static void +gvinum_grow(int argc, char * const *argv) { struct gctl_req *req; char *drive, *sdname; @@ -1344,9 +1337,10 @@ gvinum_grow(int argc, char **argv) gctl_free(req); } -void -parseline(int argc, char **argv) +static void +parseline(int argc, char * const *argv) { + if (argc <= 0) return; @@ -1406,8 +1400,6 @@ parseline(int argc, char **argv) gvinum_parityop(argc, argv, 1); else printf("unknown command '%s'\n", argv[0]); - - return; } /* @@ -1415,8 +1407,8 @@ parseline(int argc, char **argv) * gvinum_create when called without an argument, in order to give the user * something to edit. */ -void -printconfig(FILE *of, char *comment) +static void +printconfig(FILE *of, const char *comment) { struct gctl_req *req; struct utsname uname_s; From owner-svn-src-head@FreeBSD.ORG Wed May 7 11:18:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28303E9F; Wed, 7 May 2014 11:18:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFDF2AE5; Wed, 7 May 2014 11:18:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47BISWr023514; Wed, 7 May 2014 11:18:28 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47BIS6G023511; Wed, 7 May 2014 11:18:28 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201405071118.s47BIS6G023511@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 7 May 2014 11:18:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265539 - head/sys/geom/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 11:18:29 -0000 Author: ae Date: Wed May 7 11:18:27 2014 New Revision: 265539 URL: http://svnweb.freebsd.org/changeset/base/265539 Log: It is safe to allow shrinking, when aligned size is bigger than current. Tested by: jmg MFC after: 1 week Modified: head/sys/geom/part/g_part_mbr.c head/sys/geom/part/g_part_pc98.c head/sys/geom/part/g_part_vtoc8.c Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Wed May 7 09:56:28 2014 (r265538) +++ head/sys/geom/part/g_part_mbr.c Wed May 7 11:18:27 2014 (r265539) @@ -356,8 +356,8 @@ g_part_mbr_resize(struct g_part_table *b return (EINVAL); /* XXX: prevent unexpected shrinking. */ pp = baseentry->gpe_pp; - if ((g_debugflags & 16) == 0 && size < gpp->gpp_size && - (pp->acr > 0 || pp->acw > 0 || pp->ace > 0)) + if ((g_debugflags & 0x10) == 0 && size < gpp->gpp_size && + pp->mediasize / pp->sectorsize > size) return (EBUSY); entry = (struct g_part_mbr_entry *)baseentry; baseentry->gpe_end = baseentry->gpe_start + size - 1; Modified: head/sys/geom/part/g_part_pc98.c ============================================================================== --- head/sys/geom/part/g_part_pc98.c Wed May 7 09:56:28 2014 (r265538) +++ head/sys/geom/part/g_part_pc98.c Wed May 7 11:18:27 2014 (r265539) @@ -364,7 +364,7 @@ g_part_pc98_resize(struct g_part_table * /* XXX: prevent unexpected shrinking. */ pp = baseentry->gpe_pp; if ((g_debugflags & 0x10) == 0 && size < gpp->gpp_size && - (pp->acr > 0 || pp->acw > 0 || pp->ace > 0)) + pp->mediasize / pp->sectorsize > size) return (EBUSY); entry = (struct g_part_pc98_entry *)baseentry; baseentry->gpe_end = baseentry->gpe_start + size - 1; Modified: head/sys/geom/part/g_part_vtoc8.c ============================================================================== --- head/sys/geom/part/g_part_vtoc8.c Wed May 7 09:56:28 2014 (r265538) +++ head/sys/geom/part/g_part_vtoc8.c Wed May 7 11:18:27 2014 (r265539) @@ -371,7 +371,7 @@ g_part_vtoc8_resize(struct g_part_table /* XXX: prevent unexpected shrinking. */ pp = entry->gpe_pp; if ((g_debugflags & 0x10) == 0 && size < gpp->gpp_size && - (pp->acr > 0 || pp->acw > 0 || pp->ace > 0)) + pp->mediasize / pp->sectorsize > size) return (EBUSY); entry->gpe_end = entry->gpe_start + size - 1; be32enc(&table->vtoc.map[entry->gpe_index - 1].nblks, size); From owner-svn-src-head@FreeBSD.ORG Wed May 7 12:14:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10EC9C7E; Wed, 7 May 2014 12:14:25 +0000 (UTC) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0CA3FB3; Wed, 7 May 2014 12:14:24 +0000 (UTC) Received: from compute5.internal (compute5.nyi.mail.srv.osa [10.202.2.45]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id F3E6821124; Wed, 7 May 2014 08:14:21 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Wed, 07 May 2014 08:14:22 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=w2M/3zFpJCm3DXwFho/nTG4XiCM=; b=nTHVMABaSBbqA8EtwVpzPNbl8IbM 5zV1augF0Kp7I32J4UFPzsvSx/LQEBqpbU9VFuFIYfbSn/Ph752QrK43ylnwYNnM dRfZBKSwVAUrKa9vrQgRbK8jtjStUOeHqaIt609TojpmpViJj8HbH8bhwuAinLvW kaY+8mzyIbjKy1s= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=w2M/3zFpJCm3DXwFho/nTG 4XiCM=; b=juh7To1bny6l8Nj48cu3oKBPpduelNPvzLYD3GpTcVrsUO9k/idMFy NQCVXLdYUyqU83yoy4Afzf3v/CoiI2WsHaSmWS/sdlot8n6wi/iV9nnOdK8txZ31 O1MjM9RL2sJy4baRhma7aT2jK30KTEiBjrDGk1bbBGl4V1Hags1uk= X-Sasl-enc: vQLd2WGvWe9TWgjAeurqwgE43xXw5/+Y1CsoMWy+UGTp 1399464859 Received: from [192.168.1.70] (unknown [109.148.243.31]) by mail.messagingengine.com (Postfix) with ESMTPA id 47CCF680532; Wed, 7 May 2014 08:14:19 -0400 (EDT) Message-ID: <536A239A.8020502@fastmail.net> Date: Wed, 07 May 2014 13:14:18 +0100 From: Bruce Simpson User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r265456 - head/libexec/rtld-elf References: <201405061807.s46I7xxt048377@svn.freebsd.org> In-Reply-To: <201405061807.s46I7xxt048377@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 12:14:25 -0000 Mark, On 06/05/2014 19:07, Mark Johnston wrote: > Log: > Add a postinit debugger hook to rtld. This will be used by dtrace(1) to halt > the victim process before its entry point is called, at which point probes > and DOF data are registered with the kernel. I recently had a situation where I had to run gdb on a static (and stripped) Linux binary, under the Linuxolator. Perhaps this change can be used there too? Bruce From owner-svn-src-head@FreeBSD.ORG Wed May 7 12:45:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 227E3632; Wed, 7 May 2014 12:45:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 109062A1; Wed, 7 May 2014 12:45:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47CjQS3063974; Wed, 7 May 2014 12:45:26 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47CjQCT063973; Wed, 7 May 2014 12:45:26 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405071245.s47CjQCT063973@svn.freebsd.org> From: Glen Barber Date: Wed, 7 May 2014 12:45:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265540 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 12:45:27 -0000 Author: gjb Date: Wed May 7 12:45:26 2014 New Revision: 265540 URL: http://svnweb.freebsd.org/changeset/base/265540 Log: Document r265236, addition of mpr(4). Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 11:18:27 2014 (r265539) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 12:45:26 2014 (r265540) @@ -104,6 +104,10 @@ Kernel Changes + The &man.mpr.4; device has been added, + providing support for LSI Fusion-MPT 3 12Gb SCSI/SATA + controllers. + The &man.full.4; device has been added, and the lindev(4) device has been removed. Prior to this change, lindev(4) provided only From owner-svn-src-head@FreeBSD.ORG Wed May 7 12:45:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0CA23702; Wed, 7 May 2014 12:45:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4A0F2A2; Wed, 7 May 2014 12:45:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47CjSAf064016; Wed, 7 May 2014 12:45:28 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47CjSKF064015; Wed, 7 May 2014 12:45:28 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405071245.s47CjSKF064015@svn.freebsd.org> From: Glen Barber Date: Wed, 7 May 2014 12:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265541 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 12:45:29 -0000 Author: gjb Date: Wed May 7 12:45:28 2014 New Revision: 265541 URL: http://svnweb.freebsd.org/changeset/base/265541 Log: Document r265348, Atheros AR1111 support. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 12:45:26 2014 (r265540) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 12:45:28 2014 (r265541) @@ -104,6 +104,9 @@ Kernel Changes + The &man.ath.hal.4; driver has been + updated to support the Atheros AR1111 chipset. + The &man.mpr.4; device has been added, providing support for LSI Fusion-MPT 3 12Gb SCSI/SATA controllers. From owner-svn-src-head@FreeBSD.ORG Wed May 7 12:45:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4CD17972; Wed, 7 May 2014 12:45:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A1602A5; Wed, 7 May 2014 12:45:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47CjYLK064131; Wed, 7 May 2014 12:45:34 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47CjYTL064130; Wed, 7 May 2014 12:45:34 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405071245.s47CjYTL064130@svn.freebsd.org> From: Glen Barber Date: Wed, 7 May 2014 12:45:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265544 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 12:45:34 -0000 Author: gjb Date: Wed May 7 12:45:33 2014 New Revision: 265544 URL: http://svnweb.freebsd.org/changeset/base/265544 Log: Add svn revision number to sendmail entry and wrap line. Fix capitalization of Sendmail. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 12:45:31 2014 (r265543) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 12:45:33 2014 (r265544) @@ -306,8 +306,8 @@ &man.jemalloc.3; has been updated to version 3.5.0. - sendmail has been - updated from 8.14.7 to 8.14.8. + Sendmail + has been updated from 8.14.7 to 8.14.8. bmake has been updated to version 20140101. From owner-svn-src-head@FreeBSD.ORG Wed May 7 12:45:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B15A776B; Wed, 7 May 2014 12:45:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EC4E2A3; Wed, 7 May 2014 12:45:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47CjUWc064051; Wed, 7 May 2014 12:45:30 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47CjUIx064050; Wed, 7 May 2014 12:45:30 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405071245.s47CjUIx064050@svn.freebsd.org> From: Glen Barber Date: Wed, 7 May 2014 12:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265542 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 12:45:30 -0000 Author: gjb Date: Wed May 7 12:45:30 2014 New Revision: 265542 URL: http://svnweb.freebsd.org/changeset/base/265542 Log: Move r265348 to 'net-if' section. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 12:45:28 2014 (r265541) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 12:45:30 2014 (r265542) @@ -104,9 +104,6 @@ Kernel Changes - The &man.ath.hal.4; driver has been - updated to support the Atheros AR1111 chipset. - The &man.mpr.4; device has been added, providing support for LSI Fusion-MPT 3 12Gb SCSI/SATA controllers. @@ -189,6 +186,9 @@ Network Interface Support + The &man.ath.hal.4; driver has been + updated to support the Atheros AR1111 chipset. + Firmware for &intel; Centrino™ Wireless-N 105 devices has been added to the base system. From owner-svn-src-head@FreeBSD.ORG Wed May 7 12:45:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF4E4957; Wed, 7 May 2014 12:45:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67CB72A4; Wed, 7 May 2014 12:45:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47CjWEP064092; Wed, 7 May 2014 12:45:32 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47CjWZE064091; Wed, 7 May 2014 12:45:32 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405071245.s47CjWZE064091@svn.freebsd.org> From: Glen Barber Date: Wed, 7 May 2014 12:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265543 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 12:45:33 -0000 Author: gjb Date: Wed May 7 12:45:31 2014 New Revision: 265543 URL: http://svnweb.freebsd.org/changeset/base/265543 Log: Sort entries by svn revision as oldest-newest to match entry order in other branches. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 12:45:30 2014 (r265542) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 12:45:31 2014 (r265543) @@ -104,17 +104,12 @@ Kernel Changes - The &man.mpr.4; device has been added, - providing support for LSI Fusion-MPT 3 12Gb SCSI/SATA - controllers. + The VT kernel + configuration file has been added, which enables the new + vt console driver. - The &man.full.4; device has been added, - and the lindev(4) device has been removed. - Prior to this change, lindev(4) provided only - the /dev/full character device, returning - ENOSPC on write attempts. As this device is - not specific to &linux;, a native &os; version has been - added. + Support for GPS ports has been added to + &man.uhso.4;. The if_nf10bmac(4) device has been added, providing support for NetFPGA-10G @@ -125,24 +120,28 @@ the FPGA, and is not suited for the PCI host interface. - Support for GPS ports has been added to - &man.uhso.4;. + The &man.full.4; device has been added, + and the lindev(4) device has been removed. + Prior to this change, lindev(4) provided only + the /dev/full character device, returning + ENOSPC on write attempts. As this device is + not specific to &linux;, a native &os; version has been + added. - The VT kernel - configuration file has been added, which enables the new - vt console driver. + The &man.mpr.4; device has been added, + providing support for LSI Fusion-MPT 3 12Gb SCSI/SATA + controllers. Virtualization support - The &man.virtio_random.4; driver has - been added to harvest entropy from the host system. - - Unmapped IO support has been added to - &man.virtio_scsi.4;. - - Unmapped IO support has been added to - &man.virtio_blk.4;. + Support for the Virtual Interrupt + Delivery feature of &intel; VT-x is enabled if + supported by the CPU. This feature can be disabled by running + sysctl hw.vmm.vmx.use_apic_vid=0. + Additionally, to persist this setting across reboots, add + hw.vmm.vmx.use_apic_vid=0 to + /etc/sysctl.conf. Support for Posted Interrupt Processing is enabled if supported by the CPU. This @@ -152,13 +151,14 @@ hw.vmm.vmx.use_apic_pir=0 to /etc/sysctl.conf. - Support for the Virtual Interrupt - Delivery feature of &intel; VT-x is enabled if - supported by the CPU. This feature can be disabled by running - sysctl hw.vmm.vmx.use_apic_vid=0. - Additionally, to persist this setting across reboots, add - hw.vmm.vmx.use_apic_vid=0 to - /etc/sysctl.conf. + Unmapped IO support has been added to + &man.virtio_blk.4;. + + Unmapped IO support has been added to + &man.virtio_scsi.4;. + + The &man.virtio_random.4; driver has + been added to harvest entropy from the host system. @@ -186,25 +186,25 @@ Network Interface Support - The &man.ath.hal.4; driver has been - updated to support the Atheros AR1111 chipset. - - Firmware for &intel; - Centrino™ Wireless-N 105 devices has been added - to the base system. + Support for Broadcom chipsets + BCM57764, BCM57767, BCM57782, BCM57786 and BCM57787 has + been added to &man.bge.4;. Support for the &intel; Centrino™ Wireless-N 135 chipset has been added. - Support for Broadcom chipsets - BCM57764, BCM57767, BCM57782, BCM57786 and BCM57787 has - been added to &man.bge.4;. + Firmware for &intel; + Centrino™ Wireless-N 105 devices has been added + to the base system. The deprecated nve(4) driver has been removed. Users of NVIDIA nForce MCP network adapters are advised to use the &man.nfe.4; driver instead, which has been the default driver for this hardware since &os; 7.0. + + The &man.ath.hal.4; driver has been + updated to support the Atheros AR1111 chipset. @@ -238,25 +238,14 @@ Userland Changes - The &man.top.1; utility has been updated - to filter by &man.jail.8; ID or name, in followup to the - &man.ps.1; change in r265229. - - The &man.ps.1; utility has been - updated to include the -J flag, used to - filter output by matching &man.jail.8; IDs and names. - Additionally, argument 0 can be used to - -J to only list processes running on the - host system. - - Support for displaying VPD for PCI devices - via &man.pciconf.8; has been added. + The &man.casperd.8; daemon has been added, + which provides access to functionality that is not available in + the capability mode sandbox. - A new flag, onifconsole has - been added to /etc/ttys. This allows the - system to provide a login prompt via serial console if the - device is an active kernel console, otherwise it is equivalent - to off. + When unable to load a kernel module with + &man.kldload.8;, a message informing to view output of + &man.dmesg.8; is now printed, opposed to the previous output + Exec format error.. Allow &man.pciconf.8; to identify PCI devices that are attached to a driver to be identified by their @@ -265,14 +254,14 @@ to restrict the output to only listing details about a single device. - When unable to load a kernel module with - &man.kldload.8;, a message informing to view output of - &man.dmesg.8; is now printed, opposed to the previous output - Exec format error.. + A new flag, onifconsole has + been added to /etc/ttys. This allows the + system to provide a login prompt via serial console if the + device is an active kernel console, otherwise it is equivalent + to off. - The &man.casperd.8; daemon has been added, - which provides access to functionality that is not available in - the capability mode sandbox. + Support for displaying VPD for PCI devices + via &man.pciconf.8; has been added. &man.ping.8; protects against malicious network packets using the Capsicum framework to drop @@ -281,6 +270,17 @@ &os;/&arch.i386; guests can be run under bhyve. + The &man.ps.1; utility has been + updated to include the -J flag, used to + filter output by matching &man.jail.8; IDs and names. + Additionally, argument 0 can be used to + -J to only list processes running on the + host system. + + The &man.top.1; utility has been updated + to filter by &man.jail.8; ID or name, in followup to the + &man.ps.1; change in r265229. + <filename>/etc/rc.d</filename> Scripts @@ -291,14 +291,14 @@ Contributed Software - &man.byacc.1; has been updated to version - 20140101. + &man.lldb.1; has been updated to upstream + snapshot version r196259. Timezone data files have been updated to version 2013i. - &man.lldb.1; has been updated to upstream - snapshot version r196259. + &man.byacc.1; has been updated to version + 20140101. OpenSSL has been updated to version 1.0.1.f. @@ -309,15 +309,15 @@ sendmail has been updated from 8.14.7 to 8.14.8. - OpenSSH has - been updated to 6.5p1. - bmake has been updated to version 20140101. libc++ has been updated to version 3.4. + OpenSSH has + been updated to 6.5p1. + mdocml has been updated to version 1.12.3. From owner-svn-src-head@FreeBSD.ORG Wed May 7 13:05:22 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D336F398; Wed, 7 May 2014 13:05:22 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6B7B692; Wed, 7 May 2014 13:05:21 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Wi1XE-000CkB-DJ; Wed, 07 May 2014 13:05:20 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s47D5GfW027506; Wed, 7 May 2014 07:05:16 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+2HtPrEMBq5HgE1n70yw6F Subject: Re: svn commit: r265418 - head/sys/vm From: Ian Lepore To: Alan Cox In-Reply-To: <5369777F.6010203@rice.edu> References: <201405060342.s463g5Fx047447@svn.freebsd.org> <1399379941.22079.263.camel@revolution.hippie.lan> <5369777F.6010203@rice.edu> Content-Type: text/plain; charset="us-ascii" Date: Wed, 07 May 2014 07:05:16 -0600 Message-ID: <1399467916.22079.289.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Alan Cox , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 13:05:23 -0000 On Tue, 2014-05-06 at 18:59 -0500, Alan Cox wrote: > On 05/06/2014 07:39, Ian Lepore wrote: > > On Tue, 2014-05-06 at 03:42 +0000, Alan Cox wrote: > >> Author: alc > >> Date: Tue May 6 03:42:04 2014 > >> New Revision: 265418 > >> URL: http://svnweb.freebsd.org/changeset/base/265418 > >> > >> Log: > >> Prior to r254304, a separate function, vm_pageout_page_stats(), was used to > >> periodically update the reference status of the active pages. This function > >> was called, instead of vm_pageout_scan(), when memory was not scarce. The > >> objective was to provide up to date reference status for active pages in > >> case memory did become scarce and active pages needed to be deactivated. > >> > >> The active page queue scan performed by vm_pageout_page_stats() was > >> virtually identical to that performed by vm_pageout_scan(), and so r254304 > >> eliminated vm_pageout_page_stats(). Instead, vm_pageout_scan() is > >> called with the parameter "pass" set to zero. The intention was that when > >> pass is zero, vm_pageout_scan() would only scan the active queue. However, > >> the variable page_shortage can still be greater than zero when memory is not > >> scarce and vm_pageout_scan() is called with pass equal to zero. > >> Consequently, the inactive queue may be scanned and dirty pages laundered > >> even though that was not intended by r254304. This revision fixes that. > >> > >> Reported by: avg > >> MFC after: 1 week > >> Sponsored by: EMC / Isilon Storage Division > >> > >> Modified: > >> head/sys/vm/vm_pageout.c > >> > >> Modified: head/sys/vm/vm_pageout.c > >> ============================================================================== > >> --- head/sys/vm/vm_pageout.c Tue May 6 03:38:04 2014 (r265417) > >> +++ head/sys/vm/vm_pageout.c Tue May 6 03:42:04 2014 (r265418) > >> @@ -942,13 +942,15 @@ vm_pageout_scan(struct vm_domain *vmd, i > >> */ > >> addl_page_shortage = 0; > >> > >> - deficit = atomic_readandclear_int(&vm_pageout_deficit); > >> - > >> /* > >> * Calculate the number of pages we want to either free or move > >> * to the cache. > >> */ > >> - page_shortage = vm_paging_target() + deficit; > >> + if (pass > 0) { > >> + deficit = atomic_readandclear_int(&vm_pageout_deficit); > >> + page_shortage = vm_paging_target() + deficit; > >> + } else > >> + page_shortage = deficit = 0; > >> > >> /* > >> * maxlaunder limits the number of dirty pages we flush per scan. > >> > > Does this address the observation that several folks have made on > > current@ that pages are being pushed to swap much more agressively than > > in the past, even when the system doesn't seem short of memory? > > > > I hope so. Please let me know if you see any difference. > > I also suspect that another side-effect of r254304 is that we are > swapping out idle processes sooner, before memory has become scarce. > Has anyone observed this behavior? > > Alan > I haven't seen the problem myself (I generally use option NO_SWAPPING on my ARM stuff), but there was some mailing-list talk about it. This is the main thread I was thinking of: http://lists.freebsd.org/pipermail/freebsd-stable/2014-April/078361.html I wonder if this one could be related too? http://lists.freebsd.org/pipermail/freebsd-stable/2014-January/077044.html -- Ian From owner-svn-src-head@FreeBSD.ORG Wed May 7 13:53:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 392E03CA; Wed, 7 May 2014 13:53:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26D04B74; Wed, 7 May 2014 13:53:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47DrdDq094064; Wed, 7 May 2014 13:53:39 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47DrdBI094063; Wed, 7 May 2014 13:53:39 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405071353.s47DrdBI094063@svn.freebsd.org> From: Aleksandr Rybalko Date: Wed, 7 May 2014 13:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265546 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 13:53:39 -0000 Author: ray Date: Wed May 7 13:53:38 2014 New Revision: 265546 URL: http://svnweb.freebsd.org/changeset/base/265546 Log: Fix possible divide by zero. Spotted by: many Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Wed May 7 12:48:18 2014 (r265545) +++ head/sys/dev/vt/vt_core.c Wed May 7 13:53:38 2014 (r265546) @@ -678,6 +678,22 @@ vtterm_bell(struct terminal *tm) } static void +vtterm_beep(struct terminal *tm, u_int param) +{ + u_int freq, period; + + if ((param == 0) || ((param & 0xffff) == 0)) { + vtterm_bell(tm); + return; + } + + period = ((param >> 16) & 0xffff) * hz / 1000; + freq = 1193182 / (param & 0xffff); + + sysbeep(freq, period); +} + +static void vtterm_cursor(struct terminal *tm, const term_pos_t *p) { struct vt_window *vw = tm->tm_softc; @@ -1732,17 +1748,9 @@ skip_thunk: td->td_frame->tf_rflags &= ~PSL_IOPL; #endif return (0); - case KDMKTONE: { /* sound the bell */ - int freq, period; - - freq = 1193182 / ((*(int*)data) & 0xffff); - period = (((*(int*)data)>>16) & 0xffff) * hz / 1000; - if(*(int*)data) - sysbeep(freq, period); - else - vtterm_bell(tm); + case KDMKTONE: /* sound the bell */ + vtterm_beep(tm, *(u_int *)data); return (0); - } case KIOCSOUND: /* make tone (*data) hz */ /* TODO */ return (0); From owner-svn-src-head@FreeBSD.ORG Wed May 7 13:59:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F541599; Wed, 7 May 2014 13:59:29 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id AD701BB0; Wed, 7 May 2014 13:59:28 +0000 (UTC) Received: from terran (unknown [192.168.99.1]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPA id 50454C4935; Wed, 7 May 2014 16:59:27 +0300 (EEST) Date: Wed, 7 May 2014 16:59:27 +0300 From: Aleksandr Rybalko To: Bruce Evans Subject: Re: svn commit: r265442 - head/sys/dev/vt Message-Id: <20140507165927.ede049ac7a79b0c19c6d95bf@freebsd.org> In-Reply-To: <20140507001943.F3578@besplex.bde.org> References: <201405061352.s46DqE9a025250@svn.freebsd.org> <20140507001943.F3578@besplex.bde.org> X-Mailer: Sylpheed 3.3.1 (GTK+ 2.24.22; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , Matthew Fleming , Aleksandr Rybalko , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 13:59:29 -0000 On Wed, 7 May 2014 02:26:20 +1000 (EST) Bruce Evans wrote: > On Tue, 6 May 2014, Matthew Fleming wrote: > > > On Tue, May 6, 2014 at 6:52 AM, Aleksandr Rybalko wrote: > >> Log: > >> Implement KDMKTONE ioctl. > > Does it have to have to be even worse than syscons? > > >> Modified: head/sys/dev/vt/vt_core.c > >> ============================================================================== > >> --- head/sys/dev/vt/vt_core.c Tue May 6 13:46:36 2014 (r265441) > >> +++ head/sys/dev/vt/vt_core.c Tue May 6 13:52:13 2014 (r265442) > >> @@ -1732,9 +1732,17 @@ skip_thunk: > >> td->td_frame->tf_rflags &= ~PSL_IOPL; > >> #endif > >> return (0); > >> - case KDMKTONE: /* sound the bell */ > >> - /* TODO */ > >> + case KDMKTONE: { /* sound the bell */ > >> + int freq, period; > > Style bugs: nested declarations, and misindented braces to make the rest > not too ugly without using C++ declarations). Syscons doesn't use any > local variables here. > > >> + > >> + freq = 1193182 / ((*(int*)data) & 0xffff); > > This is a period in nominal x86 i8254 timer cycles, not a frequency. > 1193182 would be a frequency. This is very confusing. The confusion > is reduced a little in kbdcontrol and syscons by spelling the variable > that is spelled 'period' here as 'duration'. > > The current bugs caused by this confusion seem to be: > - the API has been broken. The original API (from SCO?) apparently has > units of x86 timer cycles at the nominal frequency for (*(int*)data). > - inverting the units fixed broken cases but broke working cases. Broken > cases included: > - the default "pitch" of 800 Hz was actually a period of 800 x86 timer > cycles. Its frequency was actually 1193182 / 800 = 1493 Hz. This > affected the default in kbdcontrol and the kernel. > Working cases included anything that conformed to the API: > - kbdcontrol -b 1.800 used to give 800 Hz. Now it gives 800 x86 timer > cycles or 1493 Hz after a double inversion. > The inversion bug is more obvious at frequencies far away from > sqrt(1193182) = 1092 Hz. 800 is only moderately far away. > - variable names are bad. 'pitch' is used for both frequencies and periods. > Variable names were not changed to match inversion of the API, though > sometimes the inversion made the variable name not so bad. > > syscons is better layered here. It passes the undivided "pitch" > ((*(int*)data) & 0xffff) to sc_bell(). sc_bell() implements visual > bell, which I use. Even KDMKTONE gets turned into visual bell. OTOH, > KDMKSOUND makes a "tone", which is actually always a sound. > > Note that the hard-coded frequency 1193182 is almost correct, although > this is x86-specific and even x86 has a variable for the timer > frequency. It is part of the non-broken user API. It is sysbeep()'s > resposibility to convert from nominal x86 cycles to the actual hardware. > This is easier to fix with the magic number not exposed to userland. > Even x86 sysbeep() never bothered to do the conversion. Conversion > on x86 would only give a fix of a few ppm except on exotic hardware. > > > This data comes from a user and can't be trusted. This is a potential > > divide-by-zero. > > This bug has been implemented and executed before. It was in at least > the alpha version. The alpha sysbeep() did an extra inversion, so the > broken cases were reversed relative to the old i386 version, as above. > Better yet, the inversion implemented the divide-by-zero panic, as above. > > I may misremember, but in unquoted parts of the diff I saw a check for > the zero-divisor case. This check is necessary to match the API. 0 > is an out-of-band value that must be translated to a default value. > > > > >> + period = (((*(int*)data)>>16) & 0xffff) * hz / 1000; > > > This is signed shift which I can't recall if it's well-defined if the > > number is negative. Using u_int would definitely be defined. > > Syscons does the same thing here. The behaviour is implementation- > defined IIRC. In practice, negative values for the duration give a > garbage result that is very far from negative. E.g., a duration of > -1 gives 0xffff after shifting. This is independent of whether the > sign bit gets shifted since the high bits are masked off. But the > result is garbage -- masking makes it positive. Then scaling by hz / > 1000 makes 0xffff as large as possible for a duration instead of > negative. Not a problem. > > You can get worse problems from physically impossible frequencies like > 1 Hz and nearly-infinite Hz. Not 0 or infinite Hz since 0 is translated > or 1193182/0 is avoided in non-buggy versions. 1 Hz is physically > impossible and not a problem. Nearly-infinite Hz (a period of 0 or 1 > timer cycles) might damage the speaker, but in practice the speaker > just can't keep up. I think it averages out to not doing anything. > > Bruce Hi Matthew! Hi Bruce! Thank you very much for pointing that. And sorry for my mistakes :) It looks like fixed in r265546. P.S. Bruce, I very like your explanations (all, not only this one), but sometime I got tired before I done with reading. Can you please be a bit less verbose sometime? :) Thanks a lot! WBW -- Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Wed May 7 16:16:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E22B4484; Wed, 7 May 2014 16:16:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCE9BC67; Wed, 7 May 2014 16:16:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47GGooH057256; Wed, 7 May 2014 16:16:50 GMT (envelope-from ambrisko@svn.freebsd.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47GGoLE057251; Wed, 7 May 2014 16:16:50 GMT (envelope-from ambrisko@svn.freebsd.org) Message-Id: <201405071616.s47GGoLE057251@svn.freebsd.org> From: Doug Ambrisko Date: Wed, 7 May 2014 16:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265555 - in head: share/man/man4 sys/conf sys/dev/mrsas sys/modules sys/modules/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 16:16:51 -0000 Author: ambrisko Date: Wed May 7 16:16:49 2014 New Revision: 265555 URL: http://svnweb.freebsd.org/changeset/base/265555 Log: Add mrsas(4) driver from LSI official support of newer MegaRAID SAS cards. LSI has been maintaining this driver outside of the FreeBSD tree. It overlaps support of ThunderBolt and Invader cards that mfi(4) supports. By default mfi(4) will attach to cards. If the tunable: hw.mfi.mrsas_enable=1 is set then mfi(4) will not probe and attach to these newer cards and allow mrsas(4) to attach. So by default this driver will not effect a FreeBSD system unless mfi(4) is removed from the kernel or the tunable is enabled. mrsas(4) attaches disks to the CAM layer so it depends on CAM and devices show up as /dev/daX. mfiutil(8) does not work with mrsas. The FreeBSD version of MegaCli and StorCli from LSI do work with mrsas. It appears that StorCli only works with mrsas. MegaCli appears to work with mfi(4) and mrsas(4). It would be good to add mfiutil(4) support to mrsas, emulations modes, kernel logging, device aliases to ease the transition between mfi(4) and mrsas(4). Style issues should be resolved by LSI when they get committers approved. The plan is get this driver in FreeBSD 9.3 to improve HW support. Thanks to LSI for developing, testing and working with FreeBSD to make this driver co-exist in FreeBSD. This improves the overall support of MegaRAID SAS. Submitted by: Kashyap Desai Reviewed by: scottl MFC after: 3 days Sponsored by: LSI Added: head/share/man/man4/mrsas.4 (contents, props changed) head/sys/dev/mrsas/ head/sys/dev/mrsas/mrsas.c (contents, props changed) head/sys/dev/mrsas/mrsas.h (contents, props changed) head/sys/dev/mrsas/mrsas_cam.c (contents, props changed) head/sys/dev/mrsas/mrsas_fp.c (contents, props changed) head/sys/dev/mrsas/mrsas_ioctl.c (contents, props changed) head/sys/dev/mrsas/mrsas_ioctl.h (contents, props changed) head/sys/modules/mrsas/ head/sys/modules/mrsas/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed May 7 15:52:41 2014 (r265554) +++ head/share/man/man4/Makefile Wed May 7 16:16:49 2014 (r265555) @@ -265,6 +265,7 @@ MAN= aac.4 \ mpr.4 \ mps.4 \ mpt.4 \ + mrsas.4 \ msk.4 \ mtio.4 \ multicast.4 \ Added: head/share/man/man4/mrsas.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/mrsas.4 Wed May 7 16:16:49 2014 (r265555) @@ -0,0 +1,374 @@ +.\" Copyright (c) 2014 LSI Corp +.\" All rights reserved. +.\" Author: Kashyap Desai +.\" Support: freebsdraid@lsi.com +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the nor the names of its +.\" contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +.\" COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. + +.\" The views and conclusions contained in the software and documentation +.\" are those of the authors and should not be interpreted as representing +.\" official policies,either expressed or implied, of the FreeBSD Project +.\" +.\" $FreeBSD$ +.\" + + +.Dd Apr 12, 2013 +.Dt MRSAS 4 +.Os +.Sh NAME +.Nm mrsas +.Nd "LSI MegaRAID 6Gb/s and 12Gb/s SAS+SATA Raid controller driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device pci" +.Cd "device mrsas" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +mrsas_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver will detect LSI's next generation (6Gb/s and 12Gb/s) PCI Express +SAS/SATA RAID controllers. +See the +.Nm HARDWARE +section for the supported devices list. +A disk (virtual disk/physical disk) attached to the +.Nm +driver will be visible to the user through +.Xr camcontrol 8 as +.Pa /dev/da? +device nodes. +A simple management interface is also provided on a per-controller basis via the +.Pa /dev/mrsas? +device node. +.Pp +The +.Nm +name is derived from the phrase "MegaRAID SAS HBA", which is +substantially different than the old "MegaRAID" Driver +.Xr mfi 4 +which does not connect targets +to the +.Xr cam 4 +layer and thus requires a new driver which attaches targets to the +.Xr cam 4 +layer. Older MegaRAID controllers are supported by +.Xr mfi 4 +and will not work with +.Nm , +but both the +.Xr mfi 4 +and +.Nm +drivers can detect and manage the LSI MegaRAID SAS 2208/2308/3008/3108 series of +controllers. +.Pp +The +.Nm device.hints +option is provided to tune the +.Nm +driver's behavior for LSI MegaRAID SAS 2208/2308/3008/3108 controllers. +By default, the +.Xr mfi 4 +driver will detect these controllers. See the +.Nm PRIORITY +section to know more about driver priority for MR-Fusion devices. +.Pp +.Nm +will provide a priority of (-30) (between BUS_PROBE_DEFAULT and +BUS_PROBE_LOW_PRIORITY) at probe call for device id's 0x005B, 0x005D, and +0x005F so that +.Nm +does not take control of these devices without user intervention. +.Sh HARDWARE +The +.Nm +driver supports the following hardware: +.Pp +.Bl -bullet -compact +[ Thunderbolt 6Gbp/s MR controller ] +.It +LSI MegaRAID SAS 9265 +.It +LSI MegaRAID SAS 9266 +.It +LSI MegaRAID SAS 9267 +.It +LSI MegaRAID SAS 9270 +.It +LSI MegaRAID SAS 9271 +.It +LSI MegaRAID SAS 9272 +.It +LSI MegaRAID SAS 9285 +.It +LSI MegaRAID SAS 9286 +.It +DELL PERC H810 +.It +DELL PERC H710/P +.El +.Pp +.Bl -bullet -compact +[ Invader/Fury 12Gpb/s MR controller ] +.It +LSI MegaRAID SAS 9380 +.It +LSI MegaRAID SAS 9361 +.It +LSI MegaRAID SAS 9341 +.It +DELL PERC H830 +.It +DELL PERC H730/P +.It +DELL PERC H330 +.El +.Sh CONFIGURATION +To disable Online Controller Reset(OCR) for a specific +.Nm +driver instance, set the +following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mrsas.X.disable_ocr=1 +.Ed +.Pp +where X is the adapter number. +.Pp +To change the IO timeout value for a specific +.Nm +driver instance, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mrsas.X.mrsas_io_timeout=NNNNNN +.Ed +.Pp +where NNNNNN is the timeout value in milli-seconds. +.Pp +To change the firmware fault check timer value for a specific +.Nm +driver instance, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mrsas.X.mrsas_fw_fault_check_delay=NN +.Ed +.Pp +where NN is the fault check delay value in seconds. +.Pp +The current number of active I/O commands is shown in the +dev.mrsas.X.fw_outstanding +.Xr sysctl 8 +variable. +.Sh DEBUGGING +To enable debugging prints from the +.Nm +driver, set the +.Bd -literal -offset indent +hw.mrsas.X.debug_level +.Ed +.Pp +variable, where X is the adapter number, either in +.Xr loader.conf 5 +or via +.Xr sysctl 8 . +The following bits have the described effects: +.Bl -tag -offset indent +.It 0x01 +Enable informational prints. +.It 0x02 +Enable tracing prints. +.It 0x04 +Enable prints for driver faults. +.It 0x08 +Enable prints for OCR and IO timeout. +.It 0x10 +Enable prints for AEN events. +.El +.Sh PRIORITY +The +.Nm +driver will always set a default (-30) priority in the pci subsystem for +selection of MR-Fusion cards. (It is between BUS_PROBE_DEFAULT and +BUS_PROBE_LOW_PRIORITY). MR-Fusion Controllers include all cards with the +Device IDs - +0x005B, +0x005D, +0x005F. +.Pp +The +.Xr mfi 4 +driver will set a priority of either BUS_PROBE_DEFAULT or +BUS_PROBE_LOW_PRIORITY (depending on the device.hint setting) in the pci +subsystem for selection of MR-Fusion cards. With the above design in place, the +.Xr mfi 4 +driver will attach to a MR-Fusion card given that it has a higher priority than +.Nm . +.Pp +Using /boot/device.hints (as mentioned below), the user can provide a preference +for the +.Nm +driver to detect a MR-Fusion card instead of the +.Xr mfi 4 +driver. +.Bd -ragged -offset indent +.Cd hw.mfi.mrsas_enable="1" +.Ed +.Pp +At boot time, the +.Xr mfi 4 +driver will get priority to detect MR-Fusion controllers by default. Before +changing this default driver selection policy, LSI advises users to understand +how the driver selection policy works. LSI's policy is to provide priority to +the +.Xr mfi 4 +driver to detect MR-Fusion cards, but allow for the ability to choose the +.Nm +driver to detect MR-Fusion cards. +.Pp +LSI recommends setting hw.mfi.mrsas_enable="0" for customers who are using the +older +.Xr mfi 4 +driver and do not want to switch to +.Nm . +For those customers who are using a MR-Fusion controller for the first time, LSI +recommends using the +.Nm +driver and setting hw.mfi.mrsas_enable="1". +.Pp +Changing the default behavior is well tested under most conditions, but +unexpected behavior may pop up if more complex and unrealistic operations are +executed by switching between the +.Xr mfi 4 and +.Nm +drivers for MR-Fusion. +Switching drivers is designed to happen only one time. Although multiple +switching is possible, it is not recommended. The user should decide from +.Nm Start of Day +which driver they want to use for the MR-Fusion card. +.Pp +The user may see different device names when switching from +.Xr mfi 4 +to +.Nm . +This behavior is +.Nm Functions As Designed +and the user needs to change the fstab +entry manually if they are doing any experiments with +.Xr mfi 4 +and +.Nm +interoperability. +.Sh FILES +.Bl -tag -width ".Pa /dev/mrsas?" -compact +.It /dev/da? +array/logical disk interface +.It /dev/mrsas? +management interface +.El +.Sh SEE ALSO +.Xr pci 4 , +.Xr mfi 4 , +.Xr cam 4 , +.Xr device.hints 5 , +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 10.0 . +.Bd -ragged +.Cd "mfi Driver:" +.Xr mfi 4 +is the old FreeBSD driver which started with support for Gen-1 Controllers and +was extended to support up to MR-Fusion (Device ID = 0x005B, 0x005D, 0x005F). +.Ed +.Bd -ragged +.Cd "mrsas Driver:" +.Nm +is the new driver reworked by LSI which supports Thunderbolt and onward +products. The SAS+SATA RAID controller with device id 0x005b is referred to as +the Thunderbolt controller throughout in this man page. +.Ed +.Bd -ragged +.Nm cam aware HBA drivers: +FreeBSD has a +.Xr cam 4 +layer which attaches storage devices and provides a common access mechanism to +storage controllers and attached devices. The +.Nm +driver is +.Xr cam 4 aware and devices associated with +.Nm +can be seen using +.Xr camcontrol 8 . +The +.Xr mfi 4 +driver does not understand the +.Xr cam 4 +layer and it directly associates storage disks to the block layer. +.Pp +.Nm Thunderbolt Controller: +This is the 6Gb/s MegaRAID HBA card which has device id 0x005B. +.Pp +.Nm Invader Controller: +This is 12Gb/s MegaRAID HBA card which has device id 0x005D. +.Pp +.Nm Fury Controller: +This is the 12Gb/s MegaRAID HBA card which has device id 0x005F. +.Ed +.Sh AUTHORS +The +.Nm +driver and this manual page were written by +.An Kashyap Desai Aq Kashyap.Desai@lsi.com . +.Sh TODO +The driver does not support big-endian architectures at this time. +.Pp +The driver does not support alias for device name (it is required when the user +switches between two drivers and does not want to edit /etc/fstab manually). +.Pp +The +.Nm +driver exposes devices as /dev/da?, whereas +.Xr mfi 4 +exposes deivces as /dev/mfid? +.Pp +.Nm +does not support the Linux Emulator interface. +.Pp +.Nm +will not work with +.Xr mfiutil 8 Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed May 7 15:52:41 2014 (r265554) +++ head/sys/conf/files Wed May 7 16:16:49 2014 (r265555) @@ -1832,6 +1832,10 @@ dev/mpt/mpt_debug.c optional mpt dev/mpt/mpt_pci.c optional mpt pci dev/mpt/mpt_raid.c optional mpt dev/mpt/mpt_user.c optional mpt +dev/mrsas/mrsas.c optional mrsas +dev/mrsas/mrsas_cam.c optional mrsas +dev/mrsas/mrsas_ioctl.c optional mrsas +dev/mrsas/mrsas_fp.c optional mrsas dev/msk/if_msk.c optional msk dev/mvs/mvs.c optional mvs dev/mvs/mvs_if.m optional mvs Added: head/sys/dev/mrsas/mrsas.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mrsas/mrsas.c Wed May 7 16:16:49 2014 (r265555) @@ -0,0 +1,3672 @@ +/* + * Copyright (c) 2014, LSI Corp. + * All rights reserved. + * Author: Marian Choy + * Support: freebsdraid@lsi.com + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of the nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation + * are those of the authors and should not be interpreted as representing + * official policies,either expressed or implied, of the FreeBSD Project. + * + * Send feedback to: + * Mail to: LSI Corporation, 1621 Barber Lane, Milpitas, CA 95035 + * ATTN: MegaRaid FreeBSD + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include + +#include +#include +#include +#include + + +/* + * Function prototypes + */ +static d_open_t mrsas_open; +static d_close_t mrsas_close; +static d_read_t mrsas_read; +static d_write_t mrsas_write; +static d_ioctl_t mrsas_ioctl; + +static struct mrsas_ident *mrsas_find_ident(device_t); +static void mrsas_shutdown_ctlr(struct mrsas_softc *sc, u_int32_t opcode); +static void mrsas_flush_cache(struct mrsas_softc *sc); +static void mrsas_reset_reply_desc(struct mrsas_softc *sc); +static void mrsas_ocr_thread(void *arg); +static int mrsas_get_map_info(struct mrsas_softc *sc); +static int mrsas_get_ld_map_info(struct mrsas_softc *sc); +static int mrsas_sync_map_info(struct mrsas_softc *sc); +static int mrsas_get_pd_list(struct mrsas_softc *sc); +static int mrsas_get_ld_list(struct mrsas_softc *sc); +static int mrsas_setup_irq(struct mrsas_softc *sc); +static int mrsas_alloc_mem(struct mrsas_softc *sc); +static int mrsas_init_fw(struct mrsas_softc *sc); +static int mrsas_setup_raidmap(struct mrsas_softc *sc); +static int mrsas_complete_cmd(struct mrsas_softc *sc); +static int mrsas_clear_intr(struct mrsas_softc *sc); +static int mrsas_get_ctrl_info(struct mrsas_softc *sc, + struct mrsas_ctrl_info *ctrl_info); +static int mrsas_issue_blocked_abort_cmd(struct mrsas_softc *sc, + struct mrsas_mfi_cmd *cmd_to_abort); +u_int32_t mrsas_read_reg(struct mrsas_softc *sc, int offset); +u_int8_t mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, + struct mrsas_mfi_cmd *mfi_cmd); +int mrsas_transition_to_ready(struct mrsas_softc *sc, int ocr); +int mrsas_init_adapter(struct mrsas_softc *sc); +int mrsas_alloc_mpt_cmds(struct mrsas_softc *sc); +int mrsas_alloc_ioc_cmd(struct mrsas_softc *sc); +int mrsas_alloc_ctlr_info_cmd(struct mrsas_softc *sc); +int mrsas_ioc_init(struct mrsas_softc *sc); +int mrsas_bus_scan(struct mrsas_softc *sc); +int mrsas_issue_dcmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); +int mrsas_issue_polled(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); +int mrsas_reset_ctrl(struct mrsas_softc *sc); +int mrsas_wait_for_outstanding(struct mrsas_softc *sc); +int mrsas_issue_blocked_cmd(struct mrsas_softc *sc, + struct mrsas_mfi_cmd *cmd); +int mrsas_alloc_tmp_dcmd(struct mrsas_softc *sc, struct mrsas_tmp_dcmd *tcmd, + int size); +void mrsas_release_mfi_cmd(struct mrsas_mfi_cmd *cmd); +void mrsas_wakeup(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); +void mrsas_complete_aen(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); +void mrsas_complete_abort(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); +void mrsas_disable_intr(struct mrsas_softc *sc); +void mrsas_enable_intr(struct mrsas_softc *sc); +void mrsas_free_ioc_cmd(struct mrsas_softc *sc); +void mrsas_free_mem(struct mrsas_softc *sc); +void mrsas_free_tmp_dcmd(struct mrsas_tmp_dcmd *tmp); +void mrsas_isr(void *arg); +void mrsas_teardown_intr(struct mrsas_softc *sc); +void mrsas_addr_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error); +void mrsas_kill_hba (struct mrsas_softc *sc); +void mrsas_aen_handler(struct mrsas_softc *sc); +void mrsas_write_reg(struct mrsas_softc *sc, int offset, + u_int32_t value); +void mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, + u_int32_t req_desc_hi); +void mrsas_free_ctlr_info_cmd(struct mrsas_softc *sc); +void mrsas_complete_mptmfi_passthru(struct mrsas_softc *sc, + struct mrsas_mfi_cmd *cmd, u_int8_t status); +void mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, u_int8_t status, + u_int8_t extStatus); +struct mrsas_mfi_cmd* mrsas_get_mfi_cmd(struct mrsas_softc *sc); +MRSAS_REQUEST_DESCRIPTOR_UNION * mrsas_build_mpt_cmd(struct mrsas_softc *sc, + struct mrsas_mfi_cmd *cmd); + +extern int mrsas_cam_attach(struct mrsas_softc *sc); +extern void mrsas_cam_detach(struct mrsas_softc *sc); +extern void mrsas_cmd_done(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd); +extern void mrsas_free_frame(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); +extern int mrsas_alloc_mfi_cmds(struct mrsas_softc *sc); +extern void mrsas_release_mpt_cmd(struct mrsas_mpt_cmd *cmd); +extern struct mrsas_mpt_cmd *mrsas_get_mpt_cmd(struct mrsas_softc *sc); +extern int mrsas_passthru(struct mrsas_softc *sc, void *arg); +extern uint8_t MR_ValidateMapInfo(struct mrsas_softc *sc); +extern u_int16_t MR_GetLDTgtId(u_int32_t ld, MR_FW_RAID_MAP_ALL *map); +extern MR_LD_RAID *MR_LdRaidGet(u_int32_t ld, MR_FW_RAID_MAP_ALL *map); +extern void mrsas_xpt_freeze(struct mrsas_softc *sc); +extern void mrsas_xpt_release(struct mrsas_softc *sc); +extern MRSAS_REQUEST_DESCRIPTOR_UNION *mrsas_get_request_desc(struct mrsas_softc *sc, + u_int16_t index); +extern int mrsas_bus_scan_sim(struct mrsas_softc *sc, struct cam_sim *sim); +static int mrsas_alloc_evt_log_info_cmd(struct mrsas_softc *sc); +static void mrsas_free_evt_log_info_cmd(struct mrsas_softc *sc); +SYSCTL_NODE(_hw, OID_AUTO, mrsas, CTLFLAG_RD, 0, "MRSAS Driver Parameters"); + + +/** + * PCI device struct and table + * + */ +typedef struct mrsas_ident { + uint16_t vendor; + uint16_t device; + uint16_t subvendor; + uint16_t subdevice; + const char *desc; +} MRSAS_CTLR_ID; + +MRSAS_CTLR_ID device_table[] = { + {0x1000, MRSAS_TBOLT, 0xffff, 0xffff, "LSI Thunderbolt SAS Controller"}, + {0x1000, MRSAS_INVADER, 0xffff, 0xffff, "LSI Invader SAS Controller"}, + {0x1000, MRSAS_FURY, 0xffff, 0xffff, "LSI Fury SAS Controller"}, + {0, 0, 0, 0, NULL} +}; + +/** + * Character device entry points + * + */ +static struct cdevsw mrsas_cdevsw = { + .d_version = D_VERSION, + .d_open = mrsas_open, + .d_close = mrsas_close, + .d_read = mrsas_read, + .d_write = mrsas_write, + .d_ioctl = mrsas_ioctl, + .d_name = "mrsas", +}; + +MALLOC_DEFINE(M_MRSAS, "mrsasbuf", "Buffers for the MRSAS driver"); + +/** + * In the cdevsw routines, we find our softc by using the si_drv1 member + * of struct cdev. We set this variable to point to our softc in our + * attach routine when we create the /dev entry. + */ +int +mrsas_open(struct cdev *dev, int oflags, int devtype, d_thread_t *td) +{ + struct mrsas_softc *sc; + + sc = dev->si_drv1; + return (0); +} + +int +mrsas_close(struct cdev *dev, int fflag, int devtype, d_thread_t *td) +{ + struct mrsas_softc *sc; + + sc = dev->si_drv1; + return (0); +} + +int +mrsas_read(struct cdev *dev, struct uio *uio, int ioflag) +{ + struct mrsas_softc *sc; + + sc = dev->si_drv1; + return (0); +} +int +mrsas_write(struct cdev *dev, struct uio *uio, int ioflag) +{ + struct mrsas_softc *sc; + + sc = dev->si_drv1; + return (0); +} + +/** + * Register Read/Write Functions + * + */ +void +mrsas_write_reg(struct mrsas_softc *sc, int offset, + u_int32_t value) +{ + bus_space_tag_t bus_tag = sc->bus_tag; + bus_space_handle_t bus_handle = sc->bus_handle; + + bus_space_write_4(bus_tag, bus_handle, offset, value); +} + +u_int32_t +mrsas_read_reg(struct mrsas_softc *sc, int offset) +{ + bus_space_tag_t bus_tag = sc->bus_tag; + bus_space_handle_t bus_handle = sc->bus_handle; + + return((u_int32_t)bus_space_read_4(bus_tag, bus_handle, offset)); +} + + +/** + * Interrupt Disable/Enable/Clear Functions + * + */ +void mrsas_disable_intr(struct mrsas_softc *sc) +{ + u_int32_t mask = 0xFFFFFFFF; + u_int32_t status; + + mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask), mask); + /* Dummy read to force pci flush */ + status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask)); +} + +void mrsas_enable_intr(struct mrsas_softc *sc) +{ + u_int32_t mask = MFI_FUSION_ENABLE_INTERRUPT_MASK; + u_int32_t status; + + mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status), ~0); + status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); + + mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask), ~mask); + status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_mask)); +} + +static int mrsas_clear_intr(struct mrsas_softc *sc) +{ + u_int32_t status, fw_status, fw_state; + + /* Read received interrupt */ + status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); + + /* If FW state change interrupt is received, write to it again to clear */ + if (status & MRSAS_FW_STATE_CHNG_INTERRUPT) { + fw_status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + outbound_scratch_pad)); + fw_state = fw_status & MFI_STATE_MASK; + if (fw_state == MFI_STATE_FAULT) { + device_printf(sc->mrsas_dev, "FW is in FAULT state!\n"); + if(sc->ocr_thread_active) + wakeup(&sc->ocr_chan); + } + mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status), status); + mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); + return(1); + } + + /* Not our interrupt, so just return */ + if (!(status & MFI_FUSION_ENABLE_INTERRUPT_MASK)) + return(0); + + /* We got a reply interrupt */ + return(1); +} + +/** + * PCI Support Functions + * + */ +static struct mrsas_ident * mrsas_find_ident(device_t dev) +{ + struct mrsas_ident *pci_device; + + for (pci_device=device_table; pci_device->vendor != 0; pci_device++) + { + if ((pci_device->vendor == pci_get_vendor(dev)) && + (pci_device->device == pci_get_device(dev)) && + ((pci_device->subvendor == pci_get_subvendor(dev)) || + (pci_device->subvendor == 0xffff)) && + ((pci_device->subdevice == pci_get_subdevice(dev)) || + (pci_device->subdevice == 0xffff))) + return (pci_device); + } + return (NULL); +} + +static int mrsas_probe(device_t dev) +{ + static u_int8_t first_ctrl = 1; + struct mrsas_ident *id; + + if ((id = mrsas_find_ident(dev)) != NULL) { + if (first_ctrl) { + printf("LSI MegaRAID SAS FreeBSD mrsas driver version: %s\n", MRSAS_VERSION); + first_ctrl = 0; + } + device_set_desc(dev, id->desc); + /* between BUS_PROBE_DEFAULT and BUS_PROBE_LOW_PRIORITY */ + return (-30); + } + return (ENXIO); +} + +/** + * mrsas_setup_sysctl: setup sysctl values for mrsas + * input: Adapter instance soft state + * + * Setup sysctl entries for mrsas driver. + */ +static void +mrsas_setup_sysctl(struct mrsas_softc *sc) +{ + struct sysctl_ctx_list *sysctl_ctx = NULL; + struct sysctl_oid *sysctl_tree = NULL; + char tmpstr[80], tmpstr2[80]; + + /* + * Setup the sysctl variable so the user can change the debug level + * on the fly. + */ + snprintf(tmpstr, sizeof(tmpstr), "MRSAS controller %d", + device_get_unit(sc->mrsas_dev)); + snprintf(tmpstr2, sizeof(tmpstr2), "%d", device_get_unit(sc->mrsas_dev)); + + sysctl_ctx = device_get_sysctl_ctx(sc->mrsas_dev); + if (sysctl_ctx != NULL) + sysctl_tree = device_get_sysctl_tree(sc->mrsas_dev); + + if (sysctl_tree == NULL) { + sysctl_ctx_init(&sc->sysctl_ctx); + sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctx, + SYSCTL_STATIC_CHILDREN(_hw_mrsas), OID_AUTO, tmpstr2, + CTLFLAG_RD, 0, tmpstr); + if (sc->sysctl_tree == NULL) + return; + sysctl_ctx = &sc->sysctl_ctx; + sysctl_tree = sc->sysctl_tree; + } + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "disable_ocr", CTLFLAG_RW, &sc->disableOnlineCtrlReset, 0, + "Disable the use of OCR"); + + SYSCTL_ADD_STRING(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "driver_version", CTLFLAG_RD, MRSAS_VERSION, + strlen(MRSAS_VERSION), "driver version"); + + SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "reset_count", CTLFLAG_RD, + &sc->reset_count, 0, "number of ocr from start of the day"); + + SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "fw_outstanding", CTLFLAG_RD, + &sc->fw_outstanding, 0, "FW outstanding commands"); + + SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "io_cmds_highwater", CTLFLAG_RD, + &sc->io_cmds_highwater, 0, "Max FW outstanding commands"); + + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "mrsas_debug", CTLFLAG_RW, &sc->mrsas_debug, 0, + "Driver debug level"); + + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "mrsas_io_timeout", CTLFLAG_RW, &sc->mrsas_io_timeout, + 0, "Driver IO timeout value in mili-second."); + + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "mrsas_fw_fault_check_delay", CTLFLAG_RW, + &sc->mrsas_fw_fault_check_delay, + 0, "FW fault check thread delay in seconds. "); + + SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "reset_in_progress", CTLFLAG_RD, + &sc->reset_in_progress, 0, "ocr in progress status"); + +} + +/** + * mrsas_get_tunables: get tunable parameters. + * input: Adapter instance soft state + * + * Get tunable parameters. This will help to debug driver at boot time. + */ +static void +mrsas_get_tunables(struct mrsas_softc *sc) +{ + char tmpstr[80]; + + /* XXX default to some debugging for now */ + sc->mrsas_debug = MRSAS_FAULT; + sc->mrsas_io_timeout = MRSAS_IO_TIMEOUT; + sc->mrsas_fw_fault_check_delay = 1; + sc->reset_count = 0; + sc->reset_in_progress = 0; + + /* + * Grab the global variables. + */ + TUNABLE_INT_FETCH("hw.mrsas.debug_level", &sc->mrsas_debug); + + /* Grab the unit-instance variables */ + snprintf(tmpstr, sizeof(tmpstr), "dev.mrsas.%d.debug_level", + device_get_unit(sc->mrsas_dev)); + TUNABLE_INT_FETCH(tmpstr, &sc->mrsas_debug); +} + +/** + * mrsas_alloc_evt_log_info cmd: Allocates memory to get event log information. + * Used to get sequence number at driver load time. + * input: Adapter soft state + * + * Allocates DMAable memory for the event log info internal command. + */ +int mrsas_alloc_evt_log_info_cmd(struct mrsas_softc *sc) +{ + int el_info_size; + + /* Allocate get event log info command */ + el_info_size = sizeof(struct mrsas_evt_log_info); + if (bus_dma_tag_create( sc->mrsas_parent_tag, // parent + 1, 0, // algnmnt, boundary + BUS_SPACE_MAXADDR_32BIT,// lowaddr + BUS_SPACE_MAXADDR, // highaddr + NULL, NULL, // filter, filterarg + el_info_size, // maxsize + 1, // msegments + el_info_size, // maxsegsize + BUS_DMA_ALLOCNOW, // flags + NULL, NULL, // lockfunc, lockarg + &sc->el_info_tag)) { + device_printf(sc->mrsas_dev, "Cannot allocate event log info tag\n"); + return (ENOMEM); + } + if (bus_dmamem_alloc(sc->el_info_tag, (void **)&sc->el_info_mem, + BUS_DMA_NOWAIT, &sc->el_info_dmamap)) { + device_printf(sc->mrsas_dev, "Cannot allocate event log info cmd mem\n"); + return (ENOMEM); + } + if (bus_dmamap_load(sc->el_info_tag, sc->el_info_dmamap, + sc->el_info_mem, el_info_size, mrsas_addr_cb, + &sc->el_info_phys_addr, BUS_DMA_NOWAIT)) { + device_printf(sc->mrsas_dev, "Cannot load event log info cmd mem\n"); + return (ENOMEM); + } + + memset(sc->el_info_mem, 0, el_info_size); + return (0); +} + +/** + * mrsas_free_evt_info_cmd: Free memory for Event log info command + * input: Adapter soft state + * + * Deallocates memory for the event log info internal command. + */ +void mrsas_free_evt_log_info_cmd(struct mrsas_softc *sc) +{ + if (sc->el_info_phys_addr) + bus_dmamap_unload(sc->el_info_tag, sc->el_info_dmamap); + if (sc->el_info_mem != NULL) + bus_dmamem_free(sc->el_info_tag, sc->el_info_mem, sc->el_info_dmamap); + if (sc->el_info_tag != NULL) + bus_dma_tag_destroy(sc->el_info_tag); +} + +/** + * mrsas_get_seq_num: Get latest event sequence number + * @sc: Adapter soft state + * @eli: Firmware event log sequence number information. + * Firmware maintains a log of all events in a non-volatile area. + * Driver get the sequence number using DCMD + * "MR_DCMD_CTRL_EVENT_GET_INFO" at driver load time. + */ + +static int +mrsas_get_seq_num(struct mrsas_softc *sc, + struct mrsas_evt_log_info *eli) +{ + struct mrsas_mfi_cmd *cmd; + struct mrsas_dcmd_frame *dcmd; + + cmd = mrsas_get_mfi_cmd(sc); + + if (!cmd) { + device_printf(sc->mrsas_dev, "Failed to get a free cmd\n"); + return -ENOMEM; + } + + dcmd = &cmd->frame->dcmd; + + if (mrsas_alloc_evt_log_info_cmd(sc) != SUCCESS) { + device_printf(sc->mrsas_dev, "Cannot allocate evt log info cmd\n"); + mrsas_release_mfi_cmd(cmd); + return -ENOMEM; + } + + memset(dcmd->mbox.b, 0, MFI_MBOX_SIZE); + + dcmd->cmd = MFI_CMD_DCMD; + dcmd->cmd_status = 0x0; + dcmd->sge_count = 1; + dcmd->flags = MFI_FRAME_DIR_READ; + dcmd->timeout = 0; + dcmd->pad_0 = 0; + dcmd->data_xfer_len = sizeof(struct mrsas_evt_log_info); + dcmd->opcode = MR_DCMD_CTRL_EVENT_GET_INFO; + dcmd->sgl.sge32[0].phys_addr = sc->el_info_phys_addr; + dcmd->sgl.sge32[0].length = sizeof(struct mrsas_evt_log_info); + + mrsas_issue_blocked_cmd(sc, cmd); + + /* + * Copy the data back into callers buffer + */ + memcpy(eli, sc->el_info_mem, sizeof(struct mrsas_evt_log_info)); + mrsas_free_evt_log_info_cmd(sc); + mrsas_release_mfi_cmd(cmd); + + return 0; +} + + +/** + * mrsas_register_aen: Register for asynchronous event notification + * @sc: Adapter soft state + * @seq_num: Starting sequence number + * @class_locale: Class of the event + * This function subscribes for events beyond the @seq_num + * and type @class_locale. + * + * */ +static int +mrsas_register_aen(struct mrsas_softc *sc, u_int32_t seq_num, + u_int32_t class_locale_word) +{ + int ret_val; + struct mrsas_mfi_cmd *cmd; + struct mrsas_dcmd_frame *dcmd; + union mrsas_evt_class_locale curr_aen; + union mrsas_evt_class_locale prev_aen; + +/* + * If there an AEN pending already (aen_cmd), check if the + * class_locale of that pending AEN is inclusive of the new + * AEN request we currently have. If it is, then we don't have + * to do anything. In other words, whichever events the current + * AEN request is subscribing to, have already been subscribed + * to. + * If the old_cmd is _not_ inclusive, then we have to abort + * that command, form a class_locale that is superset of both + * old and current and re-issue to the FW + * */ + + curr_aen.word = class_locale_word; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed May 7 17:21:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A79E8FF; Wed, 7 May 2014 17:21:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 582D939E; Wed, 7 May 2014 17:21:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47HLN3D088034; Wed, 7 May 2014 17:21:23 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47HLNQi088032; Wed, 7 May 2014 17:21:23 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405071721.s47HLNQi088032@svn.freebsd.org> From: Mark Johnston Date: Wed, 7 May 2014 17:21:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265578 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 17:21:23 -0000 Author: markj Date: Wed May 7 17:21:22 2014 New Revision: 265578 URL: http://svnweb.freebsd.org/changeset/base/265578 Log: - Export the function added in r265456 rather than the non-existent _rtld_debug_postinit(). [1] - Use __compiler_membar() instead of inline asm in _r_debug_state() and _r_debug_postinit(). [2] Pointy hat to: markj [1] Reported by: attilio [2] Discussed with: kib X-MFC-With: r265456 Modified: head/libexec/rtld-elf/Symbol.map head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/Symbol.map ============================================================================== --- head/libexec/rtld-elf/Symbol.map Wed May 7 17:20:15 2014 (r265577) +++ head/libexec/rtld-elf/Symbol.map Wed May 7 17:21:22 2014 (r265578) @@ -30,5 +30,5 @@ FBSDprivate_1.0 { _rtld_atfork_post; _rtld_addr_phdr; _rtld_get_stack_prot; - _rtld_debug_postinit; + _r_debug_postinit; }; Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed May 7 17:20:15 2014 (r265577) +++ head/libexec/rtld-elf/rtld.c Wed May 7 17:21:22 2014 (r265578) @@ -3551,7 +3551,7 @@ r_debug_state(struct r_debug* rd, struct * even when marked __noinline. However, gdb depends on those * calls being made. */ - __asm __volatile("" : : : "memory"); + __compiler_membar(); } /* @@ -3564,7 +3564,7 @@ _r_debug_postinit(struct link_map *m) { /* See r_debug_state(). */ - __asm __volatile("" : : : "memory"); + __compiler_membar(); } /* From owner-svn-src-head@FreeBSD.ORG Wed May 7 17:31:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E83AF4E; Wed, 7 May 2014 17:31:44 +0000 (UTC) Received: from mail-vc0-x234.google.com (mail-vc0-x234.google.com [IPv6:2607:f8b0:400c:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF0F96A6; Wed, 7 May 2014 17:31:43 +0000 (UTC) Received: by mail-vc0-f180.google.com with SMTP id hy4so898527vcb.25 for ; Wed, 07 May 2014 10:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=jFzvV32ypdjFfl7u3LMQhURv3HMJhRi/aExtRMBX4po=; b=eH/1CHugdjNUBLL8YPoeHFGd74skgV6++UHArvzd05NO28mqeIK7z6s4JKVBdTzbDj KpOyjBQvgKvEp7fVeVwoqbGGdJOOx+5tiYO7O9TalTmit/J9SVjUalvF8uQ5LDR4TUCE 0+ZoQF0lP2BNTFj2BjmhrJQ1e4V2v10Q2qJY4MzGD528xrWvNDUeRo0yMcbL2/mUS40F O8QnNP/KNHv39Otsh7TnWP3hIZongHAm+VmtfFaCXwV1NtyQgWijctjENWjyhlznB1g9 5gttbZe+r9rcwCNXRXr9N18b8ZyP8nJrSmKFdb8mTsbZyG34DATvW24k/17Rf1u2Joj7 Cg/w== MIME-Version: 1.0 X-Received: by 10.52.117.237 with SMTP id kh13mr1173782vdb.96.1399483902810; Wed, 07 May 2014 10:31:42 -0700 (PDT) Sender: markjdb@gmail.com Received: by 10.220.162.68 with HTTP; Wed, 7 May 2014 10:31:42 -0700 (PDT) In-Reply-To: <536A239A.8020502@fastmail.net> References: <201405061807.s46I7xxt048377@svn.freebsd.org> <536A239A.8020502@fastmail.net> Date: Wed, 7 May 2014 13:31:42 -0400 X-Google-Sender-Auth: NiRemtzSw-b8MoqsBf9Ik4qlfbU Message-ID: Subject: Re: svn commit: r265456 - head/libexec/rtld-elf From: Mark Johnston To: Bruce Simpson Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 17:31:44 -0000 On Wed, May 7, 2014 at 8:14 AM, Bruce Simpson wrote: > Mark, > > > On 06/05/2014 19:07, Mark Johnston wrote: >> >> Log: >> Add a postinit debugger hook to rtld. This will be used by dtrace(1) to >> halt >> the victim process before its entry point is called, at which point >> probes >> and DOF data are registered with the kernel. > > > I recently had a situation where I had to run gdb on a static (and stripped) > Linux binary, under the Linuxolator. Perhaps this change can be used there > too? The Linuxulator makes use of Linux's loader rather than rtld; this was the source of the problem fixed in r254018, for example. Static binaries are not invoked through rtld either, so I don't think this change would have helped anyway. :) -Mark From owner-svn-src-head@FreeBSD.ORG Wed May 7 18:10:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70A6B5F1; Wed, 7 May 2014 18:10:34 +0000 (UTC) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8370DA13; Wed, 7 May 2014 18:10:33 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id bs8so6369986wib.1 for ; Wed, 07 May 2014 11:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=07+uaw44r/u4Zk6aOv6ICD81/z56RmVZFaLui5E9RNU=; b=umrKkTcZJPAY8eCY+57Ur8x9UkiocNv2YlnNvksvVXX6y1myfaImcmbYyIH+N9ZyF6 4MLdtvptsWDcQc6IjY+dpu04D+tZHweo3lmuMnbsyW4zpazJBDpv0ef5rt67irMd+4o+ ZfvnHOzFADa4W9ARdO77vmDNw65xFoq0uUKMDfWe55rC8EDaPOadIo9RLEZHKqfO5eun P0o62gGG5E6UZEjkeQulbVk9FTeVwdh/yTDgopluRYaNsJGvYwy/ao9GMGjRsrAAOp+i nu1eSv5+c1yeg1EXMOJr7JqTS7/BZb928qeaMqvuOKfiKD+rcfWO2zv/Xp4NalikoBTF Cykw== MIME-Version: 1.0 X-Received: by 10.194.59.43 with SMTP id w11mr3717355wjq.65.1399486231671; Wed, 07 May 2014 11:10:31 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.194.168.130 with HTTP; Wed, 7 May 2014 11:10:31 -0700 (PDT) In-Reply-To: <20140507113345.B923@besplex.bde.org> References: <201405062206.s46M6dxW060155@svn.freebsd.org> <20140507113345.B923@besplex.bde.org> Date: Wed, 7 May 2014 12:10:31 -0600 X-Google-Sender-Auth: 9N12hnlMz9tkL5F9aKZFW_pfJH4 Message-ID: Subject: Re: svn commit: r265472 - head/bin/dd From: Alan Somers To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Alan Somers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 18:10:34 -0000 On Tue, May 6, 2014 at 9:47 PM, Bruce Evans wrote: > On Tue, 6 May 2014, Alan Somers wrote: > >> Log: >> dd(1) uses gettimeofday(2) to compute the throughput statistics. >> However, >> gettimeofday returns the system clock, which may jump forward or back, >> especially if NTP is in use. If the time jumps backwards, then dd will >> see >> negative elapsed time, round it up to 1usec, and print an absurdly fast >> transfer rate. >> >> The solution is to use clock_gettime(2) with CLOCK_MONOTONIC_PRECISE as >> the >> clock_id. That clock advances steadily, regardless of changes to the >> system >> clock. >> >> Reviewed by: delphij >> MFC after: 3 days >> Sponsored by: Spectra Logic >> ... >> >> Modified: head/bin/dd/dd.c >> >> ============================================================================== >> --- head/bin/dd/dd.c Tue May 6 22:04:50 2014 (r265471) >> +++ head/bin/dd/dd.c Tue May 6 22:06:39 2014 (r265472) >> @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> -#include >> >> #include >> #include >> @@ -61,6 +60,8 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include > > > Use of is a style bug. It is not used in BSD or KNF code > like dd used to be. sysexits.h is recommended by the err(3) man page. Is that recommendation meant to apply selectively, or is it obsolete, or is some sort of edit war being waged by man page authors? > > >> +#include >> #include >> >> #include "dd.h" >> @@ -123,7 +124,7 @@ static void >> setup(void) >> { >> u_int cnt; >> - struct timeval tv; >> + struct timespec tv; >> >> if (in.name == NULL) { >> in.name = "stdin"; >> @@ -240,8 +241,9 @@ setup(void) >> ctab = casetab; >> } >> >> - (void)gettimeofday(&tv, NULL); > > > Not checking for errors, and especially voiding the result to say that > errors need not be checked for, was sloppy. > > >> - st.start = tv.tv_sec + tv.tv_usec * 1e-6; >> + if (clock_gettime(CLOCK_MONOTONIC_PRECISE, &tv)) >> + err(EX_OSERR, "clock_gettime"); > > > The existence of CLOCK_MONOTONIC_PRECISE is a design error. It is the > same as the standard CLOCK_MONOTONIC. Use of the former is just > gratuitously unportable. It ensures a compile-time failure on OSes > (including old versions of FreeBSD) that don't have the > CLOCK_MONOTONIC_PRECISE mistake. It gives a runtime error on old > versions of FreeBSD that have clock_gettime() and CLOCK_MONOTONIC but > not CLOCK_MONOTONIC_PRECISE. Apart from this error, clock_gettime() > is as likely to fail as gettimeofday(), or exit(). > > The existence of CLOCK_MONOTONIC_FAST is a larger design error. It > is not fast, but just sloppy, broken and not very fast (sloppiness is > the intentional part of its design). Of course there is no need to > use it to speed up the whole 2 clock_gettime() calls in dd. It is > almost useless for other applications too. In non-broken implementations, > the speed of CLOCK_* tends to be dominated by the syscall time even > when the timer hardware is slow. On freefall now, the implementation > is about half as good as possible, and takes between 32 and 35 nanoseconds > for all clock ids, with the least accurate clock id TIME_SECOND tieing > with CLOCK_REALTIME for slowest (only about 1 nanosecond slower) since > it has the worst implementation. > (The implementation on freefall avoids syscalls provided the timer > hardware is the TSC. The hardware timer and binuptime() are used for > all syscalls including TIME_SECOND. TIME_SECOND is slowest because > it does extra work to zero tv_sec after calculating it with maximal > precision. Doing it this way gives the correct time in seconds, but > is incompatible with the kernel (syscall and kernel seconds variable) > since the kernel calculations are sloppy. The kernel time for seconds > and for the sloppy "FAST" clock ids and for the corresponding kernel > timestamp functions lags the precise time by up to 1/HZ seconds. This > difference can easily be seen from userland. > > The hardware part of the 32-35 nanoseconds is 2-4 nanoseconds. This is > in sloppy tests. Reading the TSC is unserialized, and loops reading it > may be pipelined too well to time it accurately. Also, the times read > from it are not completely accurate. But clock_gettime() doesn't > serialize > it either. Serializing it would make it much slower (maybe 50 > nanoseconds). > > 2-4 nanoseconds is almost as fast as on AthlonXP 10 years ago! rdtsc > tends to be slower than that on Intel CPUs and on modern CPUs. > Synchronization in hardware makes it slower on modern CPUs. ISTR it > took about 65 cycles on a previous generation of Intel CPUs. > > 32-35 nanonseconds for the libc implementation is actually less than > half as good as it possible if the hardware part really is only 2-4 > nanoseconds. There is a lot of overhead from layering and from working > around hardware bugs that usually don't exist. > ) > > Bad implementations can be quite bad. With an i8254 timecounter, it takes > about 5000 nanoseconds to read the hardware. On a 486, it took an > additional > 10000-20000 nanoseconds for overheads including a syscall. On a Pentium1, > it only took 1000-2000 nanoseconds for overheads in old versions of FreeBSD > (much more now). With an ACPI-"fast" timecounter, it takes 1000-2000 > nanoseconds to read the hardware. HPET is only a few times faster. This > does dominate syscall times on modern CPUs. syscall times are more like > 100-200 nanoseconds on modern CPUs. The libc implementation reduces this > to 30-60 nanoseconds. > > >> + st.start = tv.tv_sec + tv.tv_nsec * 1.0e-9; >> } >> >> static void >> >> Modified: head/bin/dd/misc.c >> >> ============================================================================== >> --- head/bin/dd/misc.c Tue May 6 22:04:50 2014 (r265471) >> +++ head/bin/dd/misc.c Tue May 6 22:06:39 2014 (r265472) >> @@ -40,14 +40,16 @@ static char sccsid[] = "@(#)misc.c 8.3 ( >> __FBSDID("$FreeBSD$"); >> >> #include >> -#include >> >> +#include >> #include >> #include >> #include >> #include >> #include >> #include >> +#include >> +#include >> #include >> >> #include "dd.h" >> @@ -56,16 +58,20 @@ __FBSDID("$FreeBSD$"); >> void >> summary(void) >> { >> - struct timeval tv; >> - double secs; >> + struct timespec tv, tv_res; >> + double secs, res; >> >> if (ddflags & C_NOINFO) >> return; >> >> - (void)gettimeofday(&tv, NULL); >> - secs = tv.tv_sec + tv.tv_usec * 1e-6 - st.start; >> - if (secs < 1e-6) >> - secs = 1e-6; > > > Bogus fixup. secs had microseconds granularity except possibly for > for tiny roundoff errors. I think the roundoff errors cannot give > a result near but not identical to 1e-6 or 0 unless tv_sec has > a garbage value. The difference can be 0 in the unlikely event > that the run takes less than 1 microsecond, or negative when the > time goes backwards. Fixing up 0 to 1e-6 is reasonable. Fixing up > negative differences to 1e-6 avoids division by 0 but gives garbage > results. I think this was only intended to fix up 0, and fixing up > negative differences is accidental. > > >> + if (clock_gettime(CLOCK_MONOTONIC_PRECISE, &tv)) >> + err(EX_OSERR, "clock_gettime"); >> + if (clock_getres(CLOCK_MONOTONIC_PRECISE, &tv_res)) >> + err(EX_OSERR, "clock_getres"); > > > clock_getres() is almost useless, and is useless here. It is broken > as designed, since the precision may be less than 1 nanosecond but > 1 nanosecond is the smallest positive representable value, but that > is not a problem here since clock_gettime() also can't distinguish > differences smaller than 1 nanosecond. Since it's reporting the clock resolution and not precision, and since clock_gettime() only reports with 1ns resolution, I don't think it's a problem for clock_getres to report with 1ns resolution too. > > >> + secs = tv.tv_sec + tv.tv_nsec * 1.0e-9 - st.start; >> + res = tv_res.tv_sec + tv_res.tv_nsec * 1.0e-9; > > > IIRC, POSIX is confused about resolution vs precision and clock_getres() > actually returns the resolution, so this variable has the correct name. > I quote "precision" in the following to indicate this confusion. > > >> + if (secs < res) >> + secs = res; > > > The fixup is now only reachable in 3 cases that can't happen: > - when the monotonic time goes backwards due to a kernel bug > - when the monotonic time doesn't increase, so that the difference is 0. > Oops, this can happen for timecounters with very low "precision". > You don't need to know the "precision" to check for this. On my Xeon E5504 systems, I can see adjacent calls to clock_gettime return equal values when using one of the _FAST clocks. It can't be proven that this case will never happen with any other clock either, so the program needs to handle it. > - when the monotonic time does increase, but by an amount smaller than > the "precision". This indicates that the "precision" is wrong. > > In the 3rd case, the actual difference may as well be used. It is > probably slightly wrong at worst (say 999 nanoseconds when the > "precision" is 1000 nanoseconds). The timing is going to be very > inaccurate for short runs, so another 10% inaccuracy doesn't matter. > At worst, the difference might be 1 nanosecond when it should be > hundreds of nanoseconds. (I don't see how this can happen without > a kernel bug. Just reading the time can take thousands of nanoseconds.) > The result will be garbage, but it won't overflow. > > In the 1st case, we don't know the correct fixup, and a tiny value > from clock_getprec() is not as good as anything, except to make the > garbage in the result more obvious. > > In the second case, fixing up to the "precision" may give a large > estimate. The fixup might as well be to a nominal value like 1 > nanosecond or 1 second. CLOCK_MONOTONIC can't have a very low > precision, and the timing for runs that don't take as long as a > large multiple of the precision is inaccurate. We could also > report the result as in this case. The second case is the one I'm most concerned about. Assuming that the precision is correct, clock_getres() seems like the best value for the fixup. Anything less than the reported precision would be unnecessarily small and give unnecessarily inaccurate results. Anything greater would make an implicit and unportable assumption about the speed of the hardware. Do you really think it's a problem to fixup to clock_getres() ? > > >> (void)fprintf(stderr, >> "%ju+%ju records in\n%ju+%ju records out\n", >> st.in_full, st.in_part, st.out_full, st.out_part); >> @@ -77,7 +83,7 @@ summary(void) >> st.trunc, (st.trunc == 1) ? "block" : "blocks"); >> if (!(ddflags & C_NOXFER)) { >> (void)fprintf(stderr, >> - "%ju bytes transferred in %.6f secs (%.0f >> bytes/sec)\n", >> + "%ju bytes transferred in %.9f secs (%.0f >> bytes/sec)\n", > > > nanoseconds resolution is excessive here, and changes the output format. > The only use of it is to debug cases where the output is garbage due > to the interval being about 1 nanosecond. Printing nanoseconds resolution > is also inconsistent with the fussy "precision" adjustment above. The higher resolution printf doesn't conflict with the resolution adjustment above. Freefall actually reports 1ns resolution. But I can buy that it's not useful to the user. Would you like me to change it back to %.6 ? > > >> st.bytes, secs, st.bytes / secs); >> } >> need_summary = 0; > > > In practice, we can depend on at least microseconds "precision" since > even gettimeofday() gave that as a precision and gettimeofday() was fixed > on at least x86 20-25 years ago so that it had almost the same "precision" > (resolution) as its granularity. > > In ping(8), we still just use microseconds resolution and even > non-monotonic gettimeofday(). It only had milliseconds resolution in > BSD 20-25 years ago and in Linux much more recently. dg fixed it to > use the microseconds resolution that became available when > gettimeofday() was fixed. clock_gettime() didn't exist then. I tried > converting it to use nanoseconds resolution and wasn't happy with the > results. Formats like %.9f are needed to see the full resolution, > but networking latency is still too large so reasolution of more tha > 1 microsecond is rarely useful, and the extra digits from %.9f format > just make the value harder to read. Even if nanosecond resolution isn't useful, monotonicity is. Nobody should be using a nonmonotonic clock just to measure durations. I started an audit of all of FreeBSD to look for other programs that use gettimeofday to measure durations. I haven't finished, but I've already found a lot, including xz, ping, hastd, fetch, systat, powerd, and others. I don't have time to fix them, though. Would you be interested, or do you know anyone else who would? -Alan > > Bruce From owner-svn-src-head@FreeBSD.ORG Wed May 7 18:14:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A404831; Wed, 7 May 2014 18:14:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D91CAB3; Wed, 7 May 2014 18:14:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47IEu3m010809; Wed, 7 May 2014 18:14:56 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47IEuh2010806; Wed, 7 May 2014 18:14:56 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405071814.s47IEuh2010806@svn.freebsd.org> From: Warner Losh Date: Wed, 7 May 2014 18:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265580 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 18:14:57 -0000 Author: imp Date: Wed May 7 18:14:56 2014 New Revision: 265580 URL: http://svnweb.freebsd.org/changeset/base/265580 Log: All the NO_foo options processed in src.opts.mk are really bsd.opts.mk options, so move their processing there. This fixes issues with Makefiles that define NO_MAN=t and only inlcude bsd.*.mk files. A few ports fell into this category, and they should be fixed by this change. Also, for now, disable the warning about NO_foo being deprecated. More work is needed than anticipated before we can do that, so kill the noise for now. Modified: head/share/mk/bsd.opts.mk head/share/mk/src.opts.mk Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Wed May 7 17:33:31 2014 (r265579) +++ head/share/mk/bsd.opts.mk Wed May 7 18:14:56 2014 (r265580) @@ -65,6 +65,25 @@ __DEFAULT_NO_OPTIONS = \ .include +# +# Supported NO_* options (if defined, MK_* will be forced to "no", +# regardless of user's setting). +# +# These are transitional and will disappaer in the FreeBSD 12. +# +.for var in \ + CTF \ + DEBUG_FILES \ + INSTALLLIB \ + MAN \ + PROFILE +.if defined(NO_${var}) +# This warning may be premature... +#.warning "NO_${var} is defined, but deprecated. Please use MK_${var}=no instead." +MK_${var}:=no +.endif +.endfor + .endif # !_WITHOUT_SRCCONF .endif Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed May 7 17:33:31 2014 (r265579) +++ head/share/mk/src.opts.mk Wed May 7 18:14:56 2014 (r265580) @@ -231,24 +231,6 @@ __DEFAULT_YES_OPTIONS+=GCC GNUCXX GCC_BO .include # -# Supported NO_* options (if defined, MK_* will be forced to "no", -# regardless of user's setting). -# -# These are transitional and will disappaer in the FreeBSD 12. -# -.for var in \ - CTF \ - DEBUG_FILES \ - INSTALLLIB \ - MAN \ - PROFILE -.if defined(NO_${var}) -.warning "NO_${var} is defined, but deprecated. Please use MK_${var}=no instead." -MK_${var}:=no -.endif -.endfor - -# # MK_* options that default to "yes" if the compiler is a C++11 compiler. # .include From owner-svn-src-head@FreeBSD.ORG Wed May 7 18:15:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB551969; Wed, 7 May 2014 18:15:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF4CCAB5; Wed, 7 May 2014 18:15:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47IF3Ee010962; Wed, 7 May 2014 18:15:03 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47IF3t1010953; Wed, 7 May 2014 18:15:03 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405071815.s47IF3t1010953@svn.freebsd.org> From: Warner Losh Date: Wed, 7 May 2014 18:15:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265581 - in head: . share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 18:15:03 -0000 Author: imp Date: Wed May 7 18:15:02 2014 New Revision: 265581 URL: http://svnweb.freebsd.org/changeset/base/265581 Log: bsd.compiler.mk was implicitly included by bsd.own.mk in historical versions. With its movement to src.opts.mk, bsd.prog.mk was testing COMPILER_TYPE without including the bsd.compiler.mk anymore. In the source tree, this caused no problems, for reasons that aren't clear, but does cause problems outside of the source tree. Allow bsd.compiler.mk to be included multiple times safely, and always include bsd.compiler.mk at the top of bsd.prog.mk. Resist the urge to put it in bsd.init.mk, since that would reintroduce the implicit include. Modified: head/UPDATING head/share/mk/bsd.compiler.mk head/share/mk/bsd.prog.mk Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed May 7 18:14:56 2014 (r265580) +++ head/UPDATING Wed May 7 18:15:02 2014 (r265581) @@ -44,6 +44,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 temporary breakage was fixed with MAKESYSPATH settings for buildworld as well... + One side effect of all this cleaning up is that bsd.compiler.mk + is no longer implicitly included by bsd.own.mk. If you wish to + use COMPILER_TYPE, you must now explicitly include bsd.compiler.mk + as well. + 20140430: The lindev device has been removed since /dev/full has been made a standard device. __FreeBSD_version has been bumped. Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Wed May 7 18:14:56 2014 (r265580) +++ head/share/mk/bsd.compiler.mk Wed May 7 18:15:02 2014 (r265581) @@ -1,5 +1,8 @@ # $FreeBSD$ +.if !target(____) +____: + .if !defined(COMPILER_TYPE) . if ${CC:T:Mgcc*} COMPILER_TYPE:= gcc @@ -25,3 +28,5 @@ COMPILER_FEATURES= c++11 .else COMPILER_FEATURES= .endif + +.endif # !target(____) Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Wed May 7 18:14:56 2014 (r265580) +++ head/share/mk/bsd.prog.mk Wed May 7 18:15:02 2014 (r265581) @@ -2,6 +2,7 @@ # $FreeBSD$ .include +.include .SUFFIXES: .out .o .c .cc .cpp .cxx .C .m .y .l .ln .s .S .asm From owner-svn-src-head@FreeBSD.ORG Wed May 7 18:21:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9667FA2; Wed, 7 May 2014 18:21:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A553FB81; Wed, 7 May 2014 18:21:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47ILcAF015254; Wed, 7 May 2014 18:21:38 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47ILcAb015253; Wed, 7 May 2014 18:21:38 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405071821.s47ILcAb015253@svn.freebsd.org> From: Christian Brueffer Date: Wed, 7 May 2014 18:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265583 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 18:21:38 -0000 Author: brueffer Date: Wed May 7 18:21:38 2014 New Revision: 265583 URL: http://svnweb.freebsd.org/changeset/base/265583 Log: First cleanup pass: new sentence -> new line, mdoc, typos and style. Modified: head/share/man/man4/mrsas.4 Modified: head/share/man/man4/mrsas.4 ============================================================================== --- head/share/man/man4/mrsas.4 Wed May 7 18:15:20 2014 (r265582) +++ head/share/man/man4/mrsas.4 Wed May 7 18:21:38 2014 (r265583) @@ -27,21 +27,19 @@ .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. - +.\" .\" The views and conclusions contained in the software and documentation .\" are those of the authors and should not be interpreted as representing -.\" official policies,either expressed or implied, of the FreeBSD Project +.\" official policies, either expressed or implied, of the FreeBSD Project. .\" .\" $FreeBSD$ .\" - - -.Dd Apr 12, 2013 +.Dd May 7, 2014 .Dt MRSAS 4 .Os .Sh NAME .Nm mrsas -.Nd "LSI MegaRAID 6Gb/s and 12Gb/s SAS+SATA Raid controller driver" +.Nd "LSI MegaRAID 6Gb/s and 12Gb/s SAS+SATA RAID controller driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -68,7 +66,8 @@ section for the supported devices list. A disk (virtual disk/physical disk) attached to the .Nm driver will be visible to the user through -.Xr camcontrol 8 as +.Xr camcontrol 8 +as .Pa /dev/da? device nodes. A simple management interface is also provided on a per-controller basis via the @@ -85,7 +84,8 @@ to the .Xr cam 4 layer and thus requires a new driver which attaches targets to the .Xr cam 4 -layer. Older MegaRAID controllers are supported by +layer. +Older MegaRAID controllers are supported by .Xr mfi 4 and will not work with .Nm , @@ -97,19 +97,23 @@ drivers can detect and manage the LSI Me controllers. .Pp The -.Nm device.hints +.Xr device.hints 5 option is provided to tune the .Nm driver's behavior for LSI MegaRAID SAS 2208/2308/3008/3108 controllers. By default, the .Xr mfi 4 -driver will detect these controllers. See the +driver will detect these controllers. +See the .Nm PRIORITY section to know more about driver priority for MR-Fusion devices. .Pp .Nm -will provide a priority of (-30) (between BUS_PROBE_DEFAULT and -BUS_PROBE_LOW_PRIORITY) at probe call for device id's 0x005B, 0x005D, and +will provide a priority of (-30) (between +.Dv BUS_PROBE_DEFAULT +and +.Dv BUS_PROBE_LOW_PRIORITY ) +at probe call for device id's 0x005B, 0x005D, and 0x005F so that .Nm does not take control of these devices without user intervention. @@ -118,8 +122,8 @@ The .Nm driver supports the following hardware: .Pp -.Bl -bullet -compact [ Thunderbolt 6Gbp/s MR controller ] +.Bl -bullet -compact .It LSI MegaRAID SAS 9265 .It @@ -142,8 +146,8 @@ DELL PERC H810 DELL PERC H710/P .El .Pp -.Bl -bullet -compact [ Invader/Fury 12Gpb/s MR controller ] +.Bl -bullet -compact .It LSI MegaRAID SAS 9380 .It @@ -169,7 +173,7 @@ dev.mrsas.X.disable_ocr=1 .Pp where X is the adapter number. .Pp -To change the IO timeout value for a specific +To change the I/O timeout value for a specific .Nm driver instance, set the following tunable value in .Xr loader.conf 5 : @@ -190,17 +194,14 @@ dev.mrsas.X.mrsas_fw_fault_check_delay=N where NN is the fault check delay value in seconds. .Pp The current number of active I/O commands is shown in the -dev.mrsas.X.fw_outstanding +.Va dev.mrsas.X.fw_outstanding .Xr sysctl 8 variable. .Sh DEBUGGING To enable debugging prints from the .Nm driver, set the -.Bd -literal -offset indent -hw.mrsas.X.debug_level -.Ed -.Pp +.Va hw.mrsas.X.debug_level variable, where X is the adapter number, either in .Xr loader.conf 5 or via @@ -214,16 +215,20 @@ Enable tracing prints. .It 0x04 Enable prints for driver faults. .It 0x08 -Enable prints for OCR and IO timeout. +Enable prints for OCR and I/O timeout. .It 0x10 Enable prints for AEN events. .El .Sh PRIORITY The .Nm -driver will always set a default (-30) priority in the pci subsystem for -selection of MR-Fusion cards. (It is between BUS_PROBE_DEFAULT and -BUS_PROBE_LOW_PRIORITY). MR-Fusion Controllers include all cards with the +driver will always set a default (-30) priority in the PCI subsystem for +selection of MR-Fusion cards. +(It is between +.Dv BUS_PROBE_DEFAULT +and +.Dv BUS_PROBE_LOW_PRIORITY ) . +MR-Fusion Controllers include all cards with the Device IDs - 0x005B, 0x005D, @@ -231,14 +236,20 @@ Device IDs - .Pp The .Xr mfi 4 -driver will set a priority of either BUS_PROBE_DEFAULT or -BUS_PROBE_LOW_PRIORITY (depending on the device.hint setting) in the pci -subsystem for selection of MR-Fusion cards. With the above design in place, the +driver will set a priority of either +.Dv BUS_PROBE_DEFAULT +or +.Dv BUS_PROBE_LOW_PRIORITY +(depending on the device.hints setting) in the PCI +subsystem for selection of MR-Fusion cards. +With the above design in place, the .Xr mfi 4 driver will attach to a MR-Fusion card given that it has a higher priority than .Nm . .Pp -Using /boot/device.hints (as mentioned below), the user can provide a preference +Using +.Pa /boot/device.hints +(as mentioned below), the user can provide a preference for the .Nm driver to detect a MR-Fusion card instead of the @@ -250,9 +261,11 @@ driver. .Pp At boot time, the .Xr mfi 4 -driver will get priority to detect MR-Fusion controllers by default. Before +driver will get priority to detect MR-Fusion controllers by default. +Before changing this default driver selection policy, LSI advises users to understand -how the driver selection policy works. LSI's policy is to provide priority to +how the driver selection policy works. +LSI's policy is to provide priority to the .Xr mfi 4 driver to detect MR-Fusion cards, but allow for the ability to choose the @@ -272,11 +285,14 @@ driver and setting hw.mfi.mrsas_enable=" Changing the default behavior is well tested under most conditions, but unexpected behavior may pop up if more complex and unrealistic operations are executed by switching between the -.Xr mfi 4 and +.Xr mfi 4 +and .Nm drivers for MR-Fusion. -Switching drivers is designed to happen only one time. Although multiple -switching is possible, it is not recommended. The user should decide from +Switching drivers is designed to happen only one time. +Although multiple +switching is possible, it is not recommended. +The user should decide from .Nm Start of Day which driver they want to use for the MR-Fusion card. .Pp @@ -286,7 +302,8 @@ to .Nm . This behavior is .Nm Functions As Designed -and the user needs to change the fstab +and the user needs to change the +.Xr fstab 5 entry manually if they are doing any experiments with .Xr mfi 4 and @@ -294,43 +311,50 @@ and interoperability. .Sh FILES .Bl -tag -width ".Pa /dev/mrsas?" -compact -.It /dev/da? +.It Pa /dev/da? array/logical disk interface -.It /dev/mrsas? +.It Pa /dev/mrsas? management interface .El .Sh SEE ALSO -.Xr pci 4 , -.Xr mfi 4 , .Xr cam 4 , +.Xr mfi 4 , +.Xr pci 4 , .Xr device.hints 5 , +.Xt camcontrol 8 .Sh HISTORY The .Nm driver first appeared in -.Fx 10.0 . +.Fx 10.1 . .Bd -ragged .Cd "mfi Driver:" .Xr mfi 4 -is the old FreeBSD driver which started with support for Gen-1 Controllers and +is the old +.Fx +driver which started with support for Gen-1 Controllers and was extended to support up to MR-Fusion (Device ID = 0x005B, 0x005D, 0x005F). .Ed .Bd -ragged .Cd "mrsas Driver:" .Nm is the new driver reworked by LSI which supports Thunderbolt and onward -products. The SAS+SATA RAID controller with device id 0x005b is referred to as -the Thunderbolt controller throughout in this man page. +products. +The SAS+SATA RAID controller with device id 0x005b is referred to as +the Thunderbolt controller throughout this man page. .Ed .Bd -ragged .Nm cam aware HBA drivers: -FreeBSD has a +.Fx +has a .Xr cam 4 layer which attaches storage devices and provides a common access mechanism to -storage controllers and attached devices. The +storage controllers and attached devices. +The .Nm driver is -.Xr cam 4 aware and devices associated with +.Xr cam 4 +aware and devices associated with .Nm can be seen using .Xr camcontrol 8 . @@ -358,17 +382,22 @@ driver and this manual page were written The driver does not support big-endian architectures at this time. .Pp The driver does not support alias for device name (it is required when the user -switches between two drivers and does not want to edit /etc/fstab manually). +switches between two drivers and does not want to edit +.Pa /etc/fstab +manually). .Pp The .Nm -driver exposes devices as /dev/da?, whereas +driver exposes devices as +.Pa /dev/da? , +whereas .Xr mfi 4 -exposes deivces as /dev/mfid? +exposes devices as +.Pa /dev/mfid? . .Pp .Nm does not support the Linux Emulator interface. .Pp .Nm will not work with -.Xr mfiutil 8 +.Xr mfiutil 8 . From owner-svn-src-head@FreeBSD.ORG Wed May 7 18:27:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F2D260C; Wed, 7 May 2014 18:27:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7CF77BD2; Wed, 7 May 2014 18:27:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47IRCh9016044; Wed, 7 May 2014 18:27:12 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47IRCAM016043; Wed, 7 May 2014 18:27:12 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405071827.s47IRCAM016043@svn.freebsd.org> From: Christian Brueffer Date: Wed, 7 May 2014 18:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265585 - head/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 18:27:13 -0000 Author: brueffer Date: Wed May 7 18:27:12 2014 New Revision: 265585 URL: http://svnweb.freebsd.org/changeset/base/265585 Log: Generate hardware notes for mrsas(4). Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Wed May 7 18:22:30 2014 (r265584) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Wed May 7 18:27:12 2014 (r265585) @@ -739,6 +739,8 @@ &hwlist.mpt; + &hwlist.mrsas; + &hwlist.mvs; &hwlist.ncr; From owner-svn-src-head@FreeBSD.ORG Wed May 7 19:07:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B06EDEA4; Wed, 7 May 2014 19:07:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DA31FC5; Wed, 7 May 2014 19:07:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47J7jOI033574; Wed, 7 May 2014 19:07:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47J7jcn033573; Wed, 7 May 2014 19:07:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405071907.s47J7jcn033573@svn.freebsd.org> From: Adrian Chadd Date: Wed, 7 May 2014 19:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265588 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 19:07:45 -0000 Author: adrian Date: Wed May 7 19:07:45 2014 New Revision: 265588 URL: http://svnweb.freebsd.org/changeset/base/265588 Log: Add casts to have it compile on amd64 without complaining about mismatched types. Tested: * AR9280, TDMA slave, amd64. Modified: head/sys/dev/ath/if_ath_tdma.c Modified: head/sys/dev/ath/if_ath_tdma.c ============================================================================== --- head/sys/dev/ath/if_ath_tdma.c Wed May 7 19:05:14 2014 (r265587) +++ head/sys/dev/ath/if_ath_tdma.c Wed May 7 19:07:45 2014 (r265588) @@ -477,16 +477,19 @@ ath_tdma_update(struct ieee80211_node *n DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, "rs->rstamp %llu rstamp %llu tsf %llu txtime %d, nextslot %llu, " "nextslottu %d, nextslottume %d\n", - (unsigned long long) rs->rs_tstamp, rstamp, tsf, txtime, - nextslot, nextslottu, TSF_TO_TU(nextslot >> 32, nextslot)); + (unsigned long long) rs->rs_tstamp, + (unsigned long long) rstamp, + (unsigned long long) tsf, txtime, + (unsigned long long) nextslot, + nextslottu, TSF_TO_TU(nextslot >> 32, nextslot)); DPRINTF(sc, ATH_DEBUG_TDMA, " beacon tstamp: %llu (0x%016llx)\n", - le64toh(ni->ni_tstamp.tsf), - le64toh(ni->ni_tstamp.tsf)); + (unsigned long long) le64toh(ni->ni_tstamp.tsf), + (unsigned long long) le64toh(ni->ni_tstamp.tsf)); DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, "nexttbtt %llu (0x%08llx) tsfdelta %d avg +%d/-%d\n", - nexttbtt, + (unsigned long long) nexttbtt, (long long) nexttbtt, tsfdelta, TDMA_AVG(sc->sc_avgtsfdeltap), TDMA_AVG(sc->sc_avgtsfdeltam)); @@ -580,7 +583,7 @@ ath_tdma_update(struct ieee80211_node *n DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, "%s: calling ath_hal_adjusttsf: TSF=%llu, tsfdelta=%d\n", __func__, - tsf, + (unsigned long long) tsf, tsfdelta); #ifdef ATH_DEBUG_ALQ From owner-svn-src-head@FreeBSD.ORG Wed May 7 19:20:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E9257CF; Wed, 7 May 2014 19:20:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F66D12B; Wed, 7 May 2014 19:20:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47JKttH041638; Wed, 7 May 2014 19:20:55 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47JKt66041613; Wed, 7 May 2014 19:20:55 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405071920.s47JKt66041613@svn.freebsd.org> From: Glen Barber Date: Wed, 7 May 2014 19:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265590 - head/release/doc/share/xml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 19:20:55 -0000 Author: gjb Date: Wed May 7 19:20:54 2014 New Revision: 265590 URL: http://svnweb.freebsd.org/changeset/base/265590 Log: Modify release.xsl to allow proper attribution for sponsored and/or contributed works. This works similarly to how the subversion revision is suffixed in release notes entries when 'revision="NNNNNN"' is set. The tag in relnotes/article.xml can now take the following new elements: - contrib: defined to what type of contribution the change is. Right now, only 'vendor' or 'sponsor' are used. 'vendor' is intended for vendor-contributed code, such as driver updates, etc. 'sponsor' is intended for sponsored work (the 'Sponsored by:' in the commit template). - vendor: The canonical name of the vendor. - sponsor: The canonical name of the sponsor. - vendorurl: The URL for the vendor website, if applicable. - sponsorurl: The URL for the sponsor website, if applicable. If 'vendor' or 'sponsor' are set, but 'contrib' is not, nothing is rendered. If 'contrib' is set, but no 'vendor' or 'sponsor' are defined, nothing is printed. If 'vendorurl' or 'sponsorurl' are set, the 'vendor' or 'sponsor' text is link, otherwise is non-clickable text. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/share/xml/release.xsl Modified: head/release/doc/share/xml/release.xsl ============================================================================== --- head/release/doc/share/xml/release.xsl Wed May 7 19:13:09 2014 (r265589) +++ head/release/doc/share/xml/release.xsl Wed May 7 19:20:54 2014 (r265590) @@ -43,6 +43,51 @@ + + + + + + + + + (Sponsored by + + + + + + + + + + + + + + + + + + (Contributed / provided by + + + + + + + + + + + + + + + + + +

From owner-svn-src-head@FreeBSD.ORG Wed May 7 19:22:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FABE9B4; Wed, 7 May 2014 19:22:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8BD41C0; Wed, 7 May 2014 19:22:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47JMs8t042028; Wed, 7 May 2014 19:22:54 GMT (envelope-from thomas@svn.freebsd.org) Received: (from thomas@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47JMs6Q042026; Wed, 7 May 2014 19:22:54 GMT (envelope-from thomas@svn.freebsd.org) Message-Id: <201405071922.s47JMs6Q042026@svn.freebsd.org> From: Thomas Quinot Date: Wed, 7 May 2014 19:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265591 - head/usr.bin/stat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 19:22:55 -0000 Author: thomas Date: Wed May 7 19:22:54 2014 New Revision: 265591 URL: http://svnweb.freebsd.org/changeset/base/265591 Log: Introduce a new command line switch '-H' for stat(1) causing arguments to be interpreted as NFS file handles. Reviewed by: -arch (jhb, eadler) MFC after: 1 month Modified: head/usr.bin/stat/stat.1 head/usr.bin/stat/stat.c Modified: head/usr.bin/stat/stat.1 ============================================================================== --- head/usr.bin/stat/stat.1 Wed May 7 19:20:54 2014 (r265590) +++ head/usr.bin/stat/stat.1 Wed May 7 19:22:54 2014 (r265591) @@ -38,7 +38,7 @@ .Nd display file status .Sh SYNOPSIS .Nm -.Op Fl FLnq +.Op Fl FHLnq .Op Fl f Ar format | Fl l | r | s | x .Op Fl t Ar timefmt .Op Ar @@ -124,6 +124,12 @@ The use of .Fl F implies .Fl l . +.It Fl H +Treat each argument as the hexadecimal representation of an NFS file handle, +and use +.Xr fhstat 2 +instead of +.Xr lstat 2 . .It Fl L Use .Xr stat 2 Modified: head/usr.bin/stat/stat.c ============================================================================== --- head/usr.bin/stat/stat.c Wed May 7 19:20:54 2014 (r265590) +++ head/usr.bin/stat/stat.c Wed May 7 19:22:54 2014 (r265591) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -203,15 +204,17 @@ main(int argc, char *argv[]) { struct stat st; int ch, rc, errs, am_readlink; - int lsF, fmtchar, usestat, fn, nonl, quiet; + int lsF, fmtchar, usestat, nfs_handle, fn, nonl, quiet; const char *statfmt, *options, *synopsis; char dname[sizeof _PATH_DEV + SPECNAMELEN] = _PATH_DEV; + fhandle_t fhnd; const char *file; am_readlink = 0; lsF = 0; fmtchar = '\0'; usestat = 0; + nfs_handle = 0; nonl = 0; quiet = 0; linkfail = 0; @@ -226,9 +229,9 @@ main(int argc, char *argv[]) fmtchar = 'f'; quiet = 1; } else { - options = "f:FlLnqrst:x"; + options = "f:FHlLnqrst:x"; synopsis = "[-FLnq] [-f format | -l | -r | -s | -x] " - "[-t timefmt] [file ...]"; + "[-t timefmt] [file|handle ...]"; } while ((ch = getopt(argc, argv, options)) != -1) @@ -236,6 +239,9 @@ main(int argc, char *argv[]) case 'F': lsF = 1; break; + case 'H': + nfs_handle = 1; + break; case 'L': usestat = 1; break; @@ -320,8 +326,35 @@ main(int argc, char *argv[]) file = "(stdin)"; rc = fstat(STDIN_FILENO, &st); } else { + int j; + char *inval; + file = argv[0]; - if (usestat) { + if (nfs_handle) { + rc = 0; + bzero (&fhnd, sizeof fhnd); + j = MIN(2 * sizeof fhnd, strlen(file)); + if (j & 1) { + rc = -1; + } else { + while (j) { + ((char*) &fhnd)[j / 2 - 1] = + strtol(&file[j - 2], + &inval, 16); + if (inval != NULL) { + rc = -1; + break; + } + argv[0][j - 2] = '\0'; + j -= 2; + } + if (!rc) + rc = fhstat(&fhnd, &st); + else + errno = EINVAL; + } + + } else if (usestat) { /* * Try stat() and if it fails, fall back to * lstat() just in case we're examining a From owner-svn-src-head@FreeBSD.ORG Wed May 7 19:30:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFB9420C; Wed, 7 May 2014 19:30:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D04FA238; Wed, 7 May 2014 19:30:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47JUS3u043274; Wed, 7 May 2014 19:30:28 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47JUSX7043273; Wed, 7 May 2014 19:30:28 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405071930.s47JUSX7043273@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 7 May 2014 19:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265592 - head/usr.bin/printf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 19:30:29 -0000 Author: pfg Date: Wed May 7 19:30:28 2014 New Revision: 265592 URL: http://svnweb.freebsd.org/changeset/base/265592 Log: Add width and precision specifiers to printf(1) %n$. This actually completes r264743 so that width and precision specifiers work properly with %n$. These keeps consistency with ksh93 and zsh. Requested by: jilles Obtained from: Garrett D'Amore (Illumos) MFC after: 4 days Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Wed May 7 19:22:54 2014 (r265591) +++ head/usr.bin/printf/printf.c Wed May 7 19:30:28 2014 (r265592) @@ -1,4 +1,5 @@ /*- + * Copyright 2014 Garrett D'Amore * Copyright 2010 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -50,6 +51,7 @@ static const char rcsid[] = #include +#include #include #include #include @@ -70,11 +72,6 @@ static const char rcsid[] = #define PF(f, func) do { \ char *b = NULL; \ - int dollar = 0; \ - if (*f == '$') { \ - dollar++; \ - *f = '%'; \ - } \ if (havewidth) \ if (haveprec) \ (void)asprintf(&b, f, fieldwidth, precision, func); \ @@ -88,8 +85,6 @@ static const char rcsid[] = (void)fputs(b, stdout); \ free(b); \ } \ - if (dollar) \ - *f = '$'; \ } while (0) static int asciicode(void); @@ -104,9 +99,12 @@ static const char static char *mknum(char *, char); static void usage(void); +static const char digits[] = "0123456789"; + static int myargc; static char **myargv; static char **gargv; +static char **maxargv; int main(int argc, char *argv[]) @@ -158,7 +156,7 @@ main(int argc, char *argv[]) gargv = ++argv; for (;;) { - char **maxargv = gargv; + maxargv = gargv; myargv = gargv; for (myargc = 0; gargv[myargc]; myargc++) @@ -212,57 +210,115 @@ main(int argc, char *argv[]) static char * -printf_doformat(char *start, int *rval) +printf_doformat(char *fmt, int *rval) { static const char skip1[] = "#'-+ 0"; - static const char skip2[] = "0123456789"; - char *fmt; int fieldwidth, haveprec, havewidth, mod_ldbl, precision; char convch, nextch; + char *start; + char **fargv; + char *dptr; + int l; + + start = alloca(strlen(fmt) + 1); + + dptr = start; + *dptr++ = '%'; + *dptr = 0; - fmt = start + 1; + fmt++; /* look for "n$" field index specifier */ - fmt += strspn(fmt, skip2); - if ((*fmt == '$') && (fmt != (start + 1))) { - int idx = atoi(start + 1); + l = strspn(fmt, digits); + if ((l > 0) && (fmt[l] == '$')) { + int idx = atoi(fmt); if (idx <= myargc) { gargv = &myargv[idx - 1]; } else { gargv = &myargv[myargc]; } - start = fmt; - fmt++; + if (gargv > maxargv) + maxargv = gargv; + fmt += l + 1; + + /* save format argument */ + fargv = gargv; } else { - fmt = start + 1; + fargv = NULL; } /* skip to field width */ - fmt += strspn(fmt, skip1); + while (strchr(skip1, *fmt) != NULL) { + *dptr++ = *fmt++; + *dptr = 0; + } + if (*fmt == '*') { + + fmt++; + l = strspn(fmt, digits); + if ((l > 0) && (fmt[l] == '$')) { + int idx = atoi(fmt); + if (idx <= myargc) { + gargv = &myargv[idx - 1]; + } else { + gargv = &myargv[myargc]; + } + fmt += l + 1; + } + if (getint(&fieldwidth)) return (NULL); + if (gargv > maxargv) + maxargv = gargv; havewidth = 1; - ++fmt; + + *dptr++ = '*'; + *dptr = 0; } else { havewidth = 0; /* skip to possible '.', get following precision */ - fmt += strspn(fmt, skip2); + while (isdigit(*fmt)) { + *dptr++ = *fmt++; + *dptr = 0; + } } + if (*fmt == '.') { /* precision present? */ - ++fmt; + fmt++; + *dptr++ = '.'; + if (*fmt == '*') { + + fmt++; + l = strspn(fmt, digits); + if ((l > 0) && (fmt[l] == '$')) { + int idx = atoi(fmt); + if (idx <= myargc) { + gargv = &myargv[idx - 1]; + } else { + gargv = &myargv[myargc]; + } + fmt += l + 1; + } + if (getint(&precision)) return (NULL); + if (gargv > maxargv) + maxargv = gargv; haveprec = 1; - ++fmt; + *dptr++ = '*'; + *dptr = 0; } else { haveprec = 0; /* skip to conversion char */ - fmt += strspn(fmt, skip2); + while (isdigit(*fmt)) { + *dptr++ = *fmt++; + *dptr = 0; + } } } else haveprec = 0; @@ -270,6 +326,8 @@ printf_doformat(char *start, int *rval) warnx("missing format character"); return (NULL); } + *dptr++ = *fmt; + *dptr = 0; /* * Look for a length modifier. POSIX doesn't have these, so @@ -292,8 +350,14 @@ printf_doformat(char *start, int *rval) mod_ldbl = 0; } + /* save the current arg offset, and set to the format arg */ + if (fargv != NULL) { + gargv = fargv; + } + convch = *fmt; nextch = *++fmt; + *fmt = '\0'; switch (convch) { case 'b': { @@ -365,6 +429,7 @@ printf_doformat(char *start, int *rval) return (NULL); } *fmt = nextch; + /* return the gargv to the next element */ return (fmt); } @@ -508,7 +573,7 @@ getnum(intmax_t *ip, uintmax_t *uip, int int rval; if (!*gargv) { - *ip = *uip = 0; + *ip = 0; return (0); } if (**gargv == '"' || **gargv == '\'') { From owner-svn-src-head@FreeBSD.ORG Wed May 7 19:33:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EBD3390; Wed, 7 May 2014 19:33:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B9852B7; Wed, 7 May 2014 19:33:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47JXUUK046698; Wed, 7 May 2014 19:33:30 GMT (envelope-from thomas@svn.freebsd.org) Received: (from thomas@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47JXUx0046697; Wed, 7 May 2014 19:33:30 GMT (envelope-from thomas@svn.freebsd.org) Message-Id: <201405071933.s47JXUx0046697@svn.freebsd.org> From: Thomas Quinot Date: Wed, 7 May 2014 19:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265593 - head/bin/dd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 19:33:30 -0000 Author: thomas Date: Wed May 7 19:33:29 2014 New Revision: 265593 URL: http://svnweb.freebsd.org/changeset/base/265593 Log: (dd_out): Fix handling of all-zeroes block at end of input with conv=sparse. This change fixes two separate issues observed when the last output block is all zeroes, and conv=sparse is in use. In this case, care must be taken to roll back the last seek and write the entire last zero block at the original offset where it should have occurred: when the destination file is a block device, it is not possible to roll back by just one character as the write would then not be properly aligned. Furthermore, the buffer used to write this last all-zeroes block needs to be properly zeroed-out. This was not the case previously, resulting in a junk data byte appearing instead of a zero in the output stream. PR: bin/189174 PR: bin/189284 Reviewed by: kib MFC after: 2 weeks Modified: head/bin/dd/dd.c Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Wed May 7 19:30:28 2014 (r265592) +++ head/bin/dd/dd.c Wed May 7 19:33:29 2014 (r265593) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -77,6 +78,7 @@ STAT st; /* statistics */ void (*cfunc)(void); /* conversion function */ uintmax_t cpy_cnt; /* # of blocks to copy */ static off_t pending = 0; /* pending seek if sparse */ +static off_t last_sp = 0; /* size of last added sparse block */ u_int ddflags = 0; /* conversion options */ size_t cbsz; /* conversion block size */ uintmax_t files_cnt = 1; /* # of files to copy */ @@ -174,6 +176,8 @@ setup(void) } else if ((in.db = malloc(MAX(in.dbsz, cbsz) + cbsz)) == NULL || (out.db = malloc(out.dbsz + cbsz)) == NULL) err(1, "output buffer"); + + /* dbp is the first free position in each buffer. */ in.dbp = in.db; out.dbp = out.db; @@ -436,8 +440,15 @@ dd_out(int force) * we play games with the buffer size, and it's usually a partial write. */ outp = out.db; + + /* + * If force, first try to write all pending data, else try to write + * just one block. Subsequently always write data one full block at + * a time at most. + */ for (n = force ? out.dbcnt : out.dbsz;; n = out.dbsz) { - for (cnt = n;; cnt -= nw) { + cnt = n; + do { sparse = 0; if (ddflags & C_SPARSE) { sparse = 1; /* Is buffer sparse? */ @@ -449,18 +460,24 @@ dd_out(int force) } if (sparse && !force) { pending += cnt; + last_sp = cnt; nw = cnt; } else { if (pending != 0) { - if (force) - pending--; + /* If forced to write, and we have no + * data left, we need to write the last + * sparse block explicitly. + */ + if (force && cnt == 0) { + pending -= last_sp; + assert(outp == out.db); + memset(outp, 0, cnt); + } if (lseek(out.fd, pending, SEEK_CUR) == -1) err(2, "%s: seek error creating sparse file", out.name); - if (force) - write(out.fd, outp, 1); - pending = 0; + pending = last_sp = 0; } if (cnt) nw = write(out.fd, outp, cnt); @@ -475,27 +492,29 @@ dd_out(int force) err(1, "%s", out.name); nw = 0; } + outp += nw; st.bytes += nw; - if ((size_t)nw == n) { - if (n != out.dbsz) - ++st.out_part; - else - ++st.out_full; - break; - } - ++st.out_part; - if ((size_t)nw == cnt) - break; - if (out.flags & ISTAPE) - errx(1, "%s: short write on tape device", - out.name); - if (out.flags & ISCHR && !warned) { - warned = 1; - warnx("%s: short write on character device", - out.name); + + if ((size_t)nw == n && n == out.dbsz) + ++st.out_full; + else + ++st.out_part; + + if ((size_t) nw != cnt) { + if (out.flags & ISTAPE) + errx(1, "%s: short write on tape device", + out.name); + if (out.flags & ISCHR && !warned) { + warned = 1; + warnx("%s: short write on character device", + out.name); + } } - } + + cnt -= nw; + } while (cnt != 0); + if ((out.dbcnt -= n) < out.dbsz) break; } From owner-svn-src-head@FreeBSD.ORG Wed May 7 19:43:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C892A7F9; Wed, 7 May 2014 19:43:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B61953CC; Wed, 7 May 2014 19:43:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47JhNkI050775; Wed, 7 May 2014 19:43:23 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47JhNEI050773; Wed, 7 May 2014 19:43:23 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405071943.s47JhNEI050773@svn.freebsd.org> From: Glen Barber Date: Wed, 7 May 2014 19:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265594 - head/release/doc/share/xml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 19:43:23 -0000 Author: gjb Date: Wed May 7 19:43:23 2014 New Revision: 265594 URL: http://svnweb.freebsd.org/changeset/base/265594 Log: Add two new entity files in followup to r265590, sponsor.ent and vendor.ent, which will be used for sponsor/vendor names and URLs. Sponsored by: The FreeBSD Foundation Added: head/release/doc/share/xml/sponsor.ent (contents, props changed) head/release/doc/share/xml/vendor.ent (contents, props changed) Added: head/release/doc/share/xml/sponsor.ent ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/doc/share/xml/sponsor.ent Wed May 7 19:43:23 2014 (r265594) @@ -0,0 +1,10 @@ + + + + Added: head/release/doc/share/xml/vendor.ent ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/doc/share/xml/vendor.ent Wed May 7 19:43:23 2014 (r265594) @@ -0,0 +1,7 @@ + From owner-svn-src-head@FreeBSD.ORG Wed May 7 19:44:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF0BEAF1; Wed, 7 May 2014 19:44:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBCEF3E9; Wed, 7 May 2014 19:44:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47Jiimj051006; Wed, 7 May 2014 19:44:44 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47Jiiin051001; Wed, 7 May 2014 19:44:44 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405071944.s47Jiiin051001@svn.freebsd.org> From: Glen Barber Date: Wed, 7 May 2014 19:44:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265595 - in head/release/doc: en_US.ISO8859-1/relnotes share/xml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 19:44:44 -0000 Author: gjb Date: Wed May 7 19:44:44 2014 New Revision: 265595 URL: http://svnweb.freebsd.org/changeset/base/265595 Log: Add references to sponsor.ent and vendor.ent in relnotes/article.xml and share/xml/catalog.xml. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml head/release/doc/share/xml/catalog.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 19:43:23 2014 (r265594) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 19:44:44 2014 (r265595) @@ -3,6 +3,10 @@ "../../../share/xml/freebsd50.dtd" [ %release; + + %sponsor; + + %vendor; ]>
&os; &release.current; Release Notes Modified: head/release/doc/share/xml/catalog.xml ============================================================================== --- head/release/doc/share/xml/catalog.xml Wed May 7 19:43:23 2014 (r265594) +++ head/release/doc/share/xml/catalog.xml Wed May 7 19:44:44 2014 (r265595) @@ -7,5 +7,7 @@ rewritePrefix="../../"/> + + From owner-svn-src-head@FreeBSD.ORG Wed May 7 19:53:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 010E5212; Wed, 7 May 2014 19:53:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E27F76B1; Wed, 7 May 2014 19:53:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47JrpnH055099; Wed, 7 May 2014 19:53:51 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47JrpnG055098; Wed, 7 May 2014 19:53:51 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405071953.s47JrpnG055098@svn.freebsd.org> From: Glen Barber Date: Wed, 7 May 2014 19:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265596 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 19:53:52 -0000 Author: gjb Date: Wed May 7 19:53:51 2014 New Revision: 265596 URL: http://svnweb.freebsd.org/changeset/base/265596 Log: Add sponsorship attribution for r258838 (casperd(8)). Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 19:44:44 2014 (r265595) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 19:53:51 2014 (r265596) @@ -242,7 +242,8 @@ Userland Changes - The &man.casperd.8; daemon has been added, + The &man.casperd.8; daemon has been added, which provides access to functionality that is not available in the capability mode sandbox. From owner-svn-src-head@FreeBSD.ORG Wed May 7 20:15:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C76C9F83; Wed, 7 May 2014 20:15:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B48159CD; Wed, 7 May 2014 20:15:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47KFUHk064597; Wed, 7 May 2014 20:15:30 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47KFUSN064594; Wed, 7 May 2014 20:15:30 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405072015.s47KFUSN064594@svn.freebsd.org> From: Glen Barber Date: Wed, 7 May 2014 20:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265599 - in head/release/doc: en_US.ISO8859-1/relnotes share/xml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 20:15:30 -0000 Author: gjb Date: Wed May 7 20:15:30 2014 New Revision: 265599 URL: http://svnweb.freebsd.org/changeset/base/265599 Log: Add attribution for r258884. Add DARPA, AFRL to sponsor.ent. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml head/release/doc/share/xml/sponsor.ent Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 20:13:46 2014 (r265598) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 20:15:30 2014 (r265599) @@ -296,7 +296,8 @@ Contributed Software - &man.lldb.1; has been updated to upstream + &man.lldb.1; has been updated to upstream snapshot version r196259. Timezone data files have been updated to Modified: head/release/doc/share/xml/sponsor.ent ============================================================================== --- head/release/doc/share/xml/sponsor.ent Wed May 7 20:13:46 2014 (r265598) +++ head/release/doc/share/xml/sponsor.ent Wed May 7 20:15:30 2014 (r265599) @@ -6,5 +6,7 @@ --> + + From owner-svn-src-head@FreeBSD.ORG Wed May 7 20:15:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 248E2145; Wed, 7 May 2014 20:15:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09B1B9CF; Wed, 7 May 2014 20:15:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47KFY4p064674; Wed, 7 May 2014 20:15:34 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47KFYuw064672; Wed, 7 May 2014 20:15:34 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405072015.s47KFYuw064672@svn.freebsd.org> From: Glen Barber Date: Wed, 7 May 2014 20:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265601 - in head/release/doc: en_US.ISO8859-1/relnotes share/xml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 20:15:35 -0000 Author: gjb Date: Wed May 7 20:15:34 2014 New Revision: 265601 URL: http://svnweb.freebsd.org/changeset/base/265601 Log: Add attribution for r265236. Add LSI and Spectra Logic to sponsor.ent. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml head/release/doc/share/xml/sponsor.ent Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 20:15:32 2014 (r265600) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 20:15:34 2014 (r265601) @@ -133,9 +133,10 @@ not specific to &linux;, a native &os; version has been added. - The &man.mpr.4; device has been added, - providing support for LSI Fusion-MPT 3 12Gb SCSI/SATA - controllers. + The &man.mpr.4; + device has been added, providing support for LSI Fusion-MPT + 3 12Gb SCSI/SATA controllers. Virtualization support Modified: head/release/doc/share/xml/sponsor.ent ============================================================================== --- head/release/doc/share/xml/sponsor.ent Wed May 7 20:15:32 2014 (r265600) +++ head/release/doc/share/xml/sponsor.ent Wed May 7 20:15:34 2014 (r265601) @@ -10,3 +10,6 @@ + + + From owner-svn-src-head@FreeBSD.ORG Wed May 7 20:15:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2631EE3; Wed, 7 May 2014 20:15:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C4739CE; Wed, 7 May 2014 20:15:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47KFWnM064635; Wed, 7 May 2014 20:15:32 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47KFWpa064634; Wed, 7 May 2014 20:15:32 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405072015.s47KFWpa064634@svn.freebsd.org> From: Glen Barber Date: Wed, 7 May 2014 20:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265600 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 20:15:34 -0000 Author: gjb Date: Wed May 7 20:15:32 2014 New Revision: 265600 URL: http://svnweb.freebsd.org/changeset/base/265600 Log: Add attribution for r264601. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 20:15:30 2014 (r265599) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 20:15:32 2014 (r265600) @@ -115,7 +115,8 @@ Support for GPS ports has been added to &man.uhso.4;. - The if_nf10bmac(4) + The if_nf10bmac(4) device has been added, providing support for NetFPGA-10G Embedded CPU Ethernet Core. From owner-svn-src-head@FreeBSD.ORG Wed May 7 20:15:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C0B530A; Wed, 7 May 2014 20:15:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89EA29D0; Wed, 7 May 2014 20:15:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47KFa0u064719; Wed, 7 May 2014 20:15:36 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47KFaOi064717; Wed, 7 May 2014 20:15:36 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405072015.s47KFaOi064717@svn.freebsd.org> From: Glen Barber Date: Wed, 7 May 2014 20:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265602 - in head/release/doc: en_US.ISO8859-1/relnotes share/xml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 20:15:39 -0000 Author: gjb Date: Wed May 7 20:15:36 2014 New Revision: 265602 URL: http://svnweb.freebsd.org/changeset/base/265602 Log: Add attribution for r265348. Add Netgate to sponsor.ent. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml head/release/doc/share/xml/sponsor.ent Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 20:15:34 2014 (r265601) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 20:15:36 2014 (r265602) @@ -209,7 +209,8 @@ advised to use the &man.nfe.4; driver instead, which has been the default driver for this hardware since &os; 7.0. - The &man.ath.hal.4; driver has been + The &man.ath.hal.4; driver has been updated to support the Atheros AR1111 chipset. Modified: head/release/doc/share/xml/sponsor.ent ============================================================================== --- head/release/doc/share/xml/sponsor.ent Wed May 7 20:15:34 2014 (r265601) +++ head/release/doc/share/xml/sponsor.ent Wed May 7 20:15:36 2014 (r265602) @@ -12,4 +12,7 @@ + + + From owner-svn-src-head@FreeBSD.ORG Wed May 7 20:18:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 710727C6; Wed, 7 May 2014 20:18:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E63BA0B; Wed, 7 May 2014 20:18:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47KIp67065200; Wed, 7 May 2014 20:18:51 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47KIpho065198; Wed, 7 May 2014 20:18:51 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405072018.s47KIpho065198@svn.freebsd.org> From: Glen Barber Date: Wed, 7 May 2014 20:18:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265603 - head/release/doc/share/xml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 20:18:51 -0000 Author: gjb Date: Wed May 7 20:18:50 2014 New Revision: 265603 URL: http://svnweb.freebsd.org/changeset/base/265603 Log: Add a note to keep the entity lists sorted alphabetically. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/share/xml/sponsor.ent head/release/doc/share/xml/vendor.ent Modified: head/release/doc/share/xml/sponsor.ent ============================================================================== --- head/release/doc/share/xml/sponsor.ent Wed May 7 20:15:36 2014 (r265602) +++ head/release/doc/share/xml/sponsor.ent Wed May 7 20:18:50 2014 (r265603) @@ -4,6 +4,8 @@ Sponsors of various works. + Please keep the entity list sorted alphabetically. + --> Modified: head/release/doc/share/xml/vendor.ent ============================================================================== --- head/release/doc/share/xml/vendor.ent Wed May 7 20:15:36 2014 (r265602) +++ head/release/doc/share/xml/vendor.ent Wed May 7 20:18:50 2014 (r265603) @@ -4,4 +4,6 @@ Vendors and contributors. + Please keep the entity list sorted alphabetically. + --> From owner-svn-src-head@FreeBSD.ORG Wed May 7 20:26:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DEAE7B11; Wed, 7 May 2014 20:26:26 +0000 (UTC) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7145BAC8; Wed, 7 May 2014 20:26:26 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id AB6E2B8069; Wed, 7 May 2014 22:26:23 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 97A3328497; Wed, 7 May 2014 22:26:23 +0200 (CEST) Date: Wed, 7 May 2014 22:26:23 +0200 From: Jilles Tjoelker To: Alan Somers Subject: Re: svn commit: r265472 - head/bin/dd Message-ID: <20140507202623.GA14233@stack.nl> References: <201405062206.s46M6dxW060155@svn.freebsd.org> <20140507113345.B923@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 20:26:27 -0000 On Wed, May 07, 2014 at 12:10:31PM -0600, Alan Somers wrote: > On Tue, May 6, 2014 at 9:47 PM, Bruce Evans wrote: > > On Tue, 6 May 2014, Alan Somers wrote: > > > >> Log: > >> dd(1) uses gettimeofday(2) to compute the throughput statistics. > >> However, > >> gettimeofday returns the system clock, which may jump forward or back, > >> especially if NTP is in use. If the time jumps backwards, then dd will > >> see > >> negative elapsed time, round it up to 1usec, and print an absurdly fast > >> transfer rate. > >> > >> The solution is to use clock_gettime(2) with CLOCK_MONOTONIC_PRECISE as > >> the > >> clock_id. That clock advances steadily, regardless of changes to the > >> system > >> clock. > >> > >> Reviewed by: delphij > >> MFC after: 3 days > >> Sponsored by: Spectra Logic > >> ... > >> > >> Modified: head/bin/dd/dd.c > >> > >> ============================================================================== > >> --- head/bin/dd/dd.c Tue May 6 22:04:50 2014 (r265471) > >> +++ head/bin/dd/dd.c Tue May 6 22:06:39 2014 (r265472) > >> @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); > >> #include > >> #include > >> #include > >> -#include > >> > >> #include > >> #include > >> @@ -61,6 +60,8 @@ __FBSDID("$FreeBSD$"); > >> #include > >> #include > >> #include > >> +#include > > Use of is a style bug. It is not used in BSD or KNF code > > like dd used to be. > sysexits.h is recommended by the err(3) man page. Is that > recommendation meant to apply selectively, or is it obsolete, or is > some sort of edit war being waged by man page authors? The recommendation for was incompletely removed, yes. > [snip] > >> - st.start = tv.tv_sec + tv.tv_usec * 1e-6; > >> + if (clock_gettime(CLOCK_MONOTONIC_PRECISE, &tv)) > >> + err(EX_OSERR, "clock_gettime"); > [snip] > >> + st.start = tv.tv_sec + tv.tv_nsec * 1.0e-9; > >> } The floating point addition starts losing precision after 8388608 seconds (slightly more than 97 days, a plausible uptime for a server). It is better to subtract the timespecs to avoid this issue. With microseconds, the precision of a double is sufficient for 272 years, so that calculation is probably acceptable. I think I agree with Bruce that using CLOCK_MONOTONIC_PRECISE is not necessary here; the standard CLOCK_MONOTONIC should suffice. > [snip] > Even if nanosecond resolution isn't useful, monotonicity is. Nobody > should be using a nonmonotonic clock just to measure durations. I > started an audit of all of FreeBSD to look for other programs that use > gettimeofday to measure durations. I haven't finished, but I've > already found a lot, including xz, ping, hastd, fetch, systat, powerd, > and others. I don't have time to fix them, though. Would you be > interested, or do you know anyone else who would? I have a local patch for time(1). Whether the monotonic clock is right also depends on how long the durations typically are. For very long durations, users might refer to wall clocks and CLOCK_REALTIME may be more appropriate. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Wed May 7 20:27:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74EBDD39; Wed, 7 May 2014 20:27:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61A38AD8; Wed, 7 May 2014 20:27:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47KRwlE069476; Wed, 7 May 2014 20:27:58 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47KRwVI069474; Wed, 7 May 2014 20:27:58 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405072027.s47KRwVI069474@svn.freebsd.org> From: Glen Barber Date: Wed, 7 May 2014 20:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265605 - in head/release/doc: en_US.ISO8859-1/relnotes share/xml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 20:27:58 -0000 Author: gjb Date: Wed May 7 20:27:57 2014 New Revision: 265605 URL: http://svnweb.freebsd.org/changeset/base/265605 Log: Correct attribution for casperd, co-sponsored by The FreeBSD Foundation and Google, Inc.[1] Since this was dual-sponsored, the sponsorurl needs to be empty. Add Google to the sponsor.ent file. Reminded by: rwatson [1] Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml head/release/doc/share/xml/sponsor.ent Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 20:20:52 2014 (r265604) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 20:27:57 2014 (r265605) @@ -245,8 +245,8 @@ Userland Changes - The &man.casperd.8; daemon has been added, + The &man.casperd.8; daemon has been added, which provides access to functionality that is not available in the capability mode sandbox. Modified: head/release/doc/share/xml/sponsor.ent ============================================================================== --- head/release/doc/share/xml/sponsor.ent Wed May 7 20:20:52 2014 (r265604) +++ head/release/doc/share/xml/sponsor.ent Wed May 7 20:27:57 2014 (r265605) @@ -13,6 +13,8 @@ + + From owner-svn-src-head@FreeBSD.ORG Wed May 7 20:29:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E32EFB2; Wed, 7 May 2014 20:29:32 +0000 (UTC) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47E93AE6; Wed, 7 May 2014 20:29:31 +0000 (UTC) Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id B014E20EAF; Wed, 7 May 2014 16:29:19 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Wed, 07 May 2014 16:29:20 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=4T8OaNgq944KIuUgZU5K9CU1phQ=; b=UWS5ZriWxG7wjZdzUJYdrDhl0tQ0 osUxYsgyokiSiQ6w/rDAOSOFozfdZ7J5j26jaYGkknlUtfW5GhAuOTh32b1TBArL XFwk46BhoWjFXcRtHmGW/jjpV/qGIjyonVW8ificmg1qMUDrHTwMFPHBc8byMZMf DAIiXBjC95OosuA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=4T8OaNgq944KIuUgZU5K9C U1phQ=; b=I2HwIOy/rwevIkGVmpb/slPRLNuVPRHaTB7kVkOZhETr9z63wYWvrG gSi/iDAmfwHeHXXNPCmab3hc/EXDJMAAh/pe/XuIEIUGlhXjovEhnIdptuTUisSE qrSDZ7XLODvWrcdEnmVVY+YHcWODEXEira7e1cPLIGA18HUA+NaUk= X-Sasl-enc: RPkx34UfdxTDY44EGmIJr+KV5y747p0dV2flarW0PiuW 1399494559 Received: from [192.168.1.70] (unknown [109.148.243.31]) by mail.messagingengine.com (Postfix) with ESMTPA id EA96068053E; Wed, 7 May 2014 16:29:18 -0400 (EDT) Message-ID: <536A979E.7060302@fastmail.net> Date: Wed, 07 May 2014 21:29:18 +0100 From: Bruce Simpson User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Mark Johnston Subject: Re: svn commit: r265456 - head/libexec/rtld-elf References: <201405061807.s46I7xxt048377@svn.freebsd.org> <536A239A.8020502@fastmail.net> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 20:29:32 -0000 On 07/05/2014 18:31, Mark Johnston wrote: > The Linuxulator makes use of Linux's loader rather than rtld; this was > the source of the problem fixed in r254018, for example. Static > binaries are not invoked through rtld either, so I don't think this > change would have helped anyway. I'm aware that the rtld code is otherwise unrelated to how Linux ELF images are activated, and should have been clearer in my original message. Sorry about that. My question is really: is there an easy way of setting a "start of program" breakpoint for such binaries e.g. where "_start" and/or "main" are not exposed in the (nonexistent) symbol table? Currently I have to inspect the ELF load address and set a breakpoint manually in such cases. This is something which might be addressed by a GDB macro, although we may not always be using GDB. From owner-svn-src-head@FreeBSD.ORG Wed May 7 20:31:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0108723F; Wed, 7 May 2014 20:31:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E20F2B71; Wed, 7 May 2014 20:31:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47KVirh073083; Wed, 7 May 2014 20:31:44 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47KVi6o073081; Wed, 7 May 2014 20:31:44 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405072031.s47KVi6o073081@svn.freebsd.org> From: Glen Barber Date: Wed, 7 May 2014 20:31:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265607 - in head/release/doc: en_US.ISO8859-1/relnotes share/xml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 20:31:45 -0000 Author: gjb Date: Wed May 7 20:31:44 2014 New Revision: 265607 URL: http://svnweb.freebsd.org/changeset/base/265607 Log: Separate &darpa; entity and create &darpa_afrl to avoid confusion. Suggested by: rwatson Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml head/release/doc/share/xml/sponsor.ent Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 20:28:27 2014 (r265606) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 20:31:44 2014 (r265607) @@ -116,7 +116,7 @@ &man.uhso.4;. The if_nf10bmac(4) + sponsor="&darpa_afrl;">The if_nf10bmac(4) device has been added, providing support for NetFPGA-10G Embedded CPU Ethernet Core. @@ -300,7 +300,7 @@ Contributed Software &man.lldb.1; has been updated to upstream + sponsor="&darpa_afrl;">&man.lldb.1; has been updated to upstream snapshot version r196259. Timezone data files have been updated to Modified: head/release/doc/share/xml/sponsor.ent ============================================================================== --- head/release/doc/share/xml/sponsor.ent Wed May 7 20:28:27 2014 (r265606) +++ head/release/doc/share/xml/sponsor.ent Wed May 7 20:31:44 2014 (r265607) @@ -8,7 +8,10 @@ --> - + + + + From owner-svn-src-head@FreeBSD.ORG Wed May 7 20:46:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA43088E; Wed, 7 May 2014 20:46:54 +0000 (UTC) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAB51C84; Wed, 7 May 2014 20:46:53 +0000 (UTC) Received: by mail-wi0-f178.google.com with SMTP id hm4so2035403wib.17 for ; Wed, 07 May 2014 13:46:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=7pmjOV7mkF2yOOEM4ANDnq0Zfa1Q0hzxRlBYWYosoFY=; b=hF5RPQsHx/HKL4PQPIgN93ZrHmQx1MyKvNMQendU83sFnDZoS+BC9XeqdSOS4MUifx HIH7mnkqzrPvvEMoTnY/cgACjgwT3RBPvmCXbSNfCk/VdyOludHME7fs0hsb0v2BJusR ECpBA6Ws1OHLZDMajRyMhVRUn472nzJBDHu/GFfyYVCBRePAwrbWX8mXKshgoiYPZoik ZcTnT/opLY0I9XD2R1ebAJ5epv0ktCyHm/QnB1fRRufxp//MdDOoi61WZS+3jdhtczsu TCSgXiICUwr4c7gHdf2al3pqJN+qxIrzP6VMP17y1GJChXSnI6ixU3dS3uo88JlqslnB iiVA== MIME-Version: 1.0 X-Received: by 10.194.91.175 with SMTP id cf15mr40870196wjb.5.1399495612048; Wed, 07 May 2014 13:46:52 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.194.168.130 with HTTP; Wed, 7 May 2014 13:46:51 -0700 (PDT) In-Reply-To: <20140507202623.GA14233@stack.nl> References: <201405062206.s46M6dxW060155@svn.freebsd.org> <20140507113345.B923@besplex.bde.org> <20140507202623.GA14233@stack.nl> Date: Wed, 7 May 2014 14:46:51 -0600 X-Google-Sender-Auth: MYxe_hf6OBZluJpRbQwylGOvQUc Message-ID: Subject: Re: svn commit: r265472 - head/bin/dd From: Alan Somers To: Jilles Tjoelker Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Bruce Evans , Alan Somers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 20:46:54 -0000 On Wed, May 7, 2014 at 2:26 PM, Jilles Tjoelker wrote: > On Wed, May 07, 2014 at 12:10:31PM -0600, Alan Somers wrote: >> On Tue, May 6, 2014 at 9:47 PM, Bruce Evans wrote: >> > On Tue, 6 May 2014, Alan Somers wrote: >> > >> >> Log: >> >> dd(1) uses gettimeofday(2) to compute the throughput statistics. >> >> However, >> >> gettimeofday returns the system clock, which may jump forward or back, >> >> especially if NTP is in use. If the time jumps backwards, then dd will >> >> see >> >> negative elapsed time, round it up to 1usec, and print an absurdly fast >> >> transfer rate. >> >> >> >> The solution is to use clock_gettime(2) with CLOCK_MONOTONIC_PRECISE as >> >> the >> >> clock_id. That clock advances steadily, regardless of changes to the >> >> system >> >> clock. >> >> >> >> Reviewed by: delphij >> >> MFC after: 3 days >> >> Sponsored by: Spectra Logic >> >> ... >> >> >> >> Modified: head/bin/dd/dd.c >> >> >> >> ============================================================================== >> >> --- head/bin/dd/dd.c Tue May 6 22:04:50 2014 (r265471) >> >> +++ head/bin/dd/dd.c Tue May 6 22:06:39 2014 (r265472) >> >> @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); >> >> #include >> >> #include >> >> #include >> >> -#include >> >> >> >> #include >> >> #include >> >> @@ -61,6 +60,8 @@ __FBSDID("$FreeBSD$"); >> >> #include >> >> #include >> >> #include >> >> +#include > >> > Use of is a style bug. It is not used in BSD or KNF code >> > like dd used to be. > >> sysexits.h is recommended by the err(3) man page. Is that >> recommendation meant to apply selectively, or is it obsolete, or is >> some sort of edit war being waged by man page authors? > > The recommendation for was incompletely removed, yes. > >> [snip] >> >> - st.start = tv.tv_sec + tv.tv_usec * 1e-6; >> >> + if (clock_gettime(CLOCK_MONOTONIC_PRECISE, &tv)) >> >> + err(EX_OSERR, "clock_gettime"); >> [snip] >> >> + st.start = tv.tv_sec + tv.tv_nsec * 1.0e-9; >> >> } > > The floating point addition starts losing precision after 8388608 > seconds (slightly more than 97 days, a plausible uptime for a server). > It is better to subtract the timespecs to avoid this issue. > > With microseconds, the precision of a double is sufficient for 272 > years, so that calculation is probably acceptable. Good point. I'll fix it. BTW, FreeBSD does not have a timespecsub, but I notice that NetBSD does. This seems like a good candidate to import. http://netbsd.gw.com/cgi-bin/man-cgi?timespecsub++NetBSD-current > > I think I agree with Bruce that using CLOCK_MONOTONIC_PRECISE is not > necessary here; the standard CLOCK_MONOTONIC should suffice. > >> [snip] >> Even if nanosecond resolution isn't useful, monotonicity is. Nobody >> should be using a nonmonotonic clock just to measure durations. I >> started an audit of all of FreeBSD to look for other programs that use >> gettimeofday to measure durations. I haven't finished, but I've >> already found a lot, including xz, ping, hastd, fetch, systat, powerd, >> and others. I don't have time to fix them, though. Would you be >> interested, or do you know anyone else who would? > > I have a local patch for time(1). > > Whether the monotonic clock is right also depends on how long the > durations typically are. For very long durations, users might refer to > wall clocks and CLOCK_REALTIME may be more appropriate. I would say that gettimeofday() or CLOCK_REALTIME() should be used whenever the absolute value of the result matters. For example, if it's written to disk, displayed to the user, or used as an absolute wakeup time for something like at(1). But if only the relative value of 2 or more calls matter, then I think that a monotonic clock should always be used. A corollary is that durations that cross a reboot cycle, or when the start and end times are measured by different machines, must use the realtime clock. -Alan > > -- > Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Wed May 7 21:00:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8075CDD; Wed, 7 May 2014 21:00:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DA39D97; Wed, 7 May 2014 21:00:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47L0A9Z083203; Wed, 7 May 2014 21:00:10 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47L0AqG083202; Wed, 7 May 2014 21:00:10 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405072100.s47L0AqG083202@svn.freebsd.org> From: Glen Barber Date: Wed, 7 May 2014 21:00:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265611 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 21:00:10 -0000 Author: gjb Date: Wed May 7 21:00:09 2014 New Revision: 265611 URL: http://svnweb.freebsd.org/changeset/base/265611 Log: Document r265555, addition of mrsas(4). Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 20:57:16 2014 (r265610) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 7 21:00:09 2014 (r265611) @@ -138,6 +138,23 @@ device has been added, providing support for LSI Fusion-MPT 3 12Gb SCSI/SATA controllers. + The &man.mrsas.4; driver has been added, + providing support for LSI MegaRAID SAS controllers. The + &man.mfi.4; driver will attach to the controller, by default. + To enable &man.mrsas.4; add + hw.mfi.mrsas_enable=1 to + /boot/loader.conf, which turns off + &man.mfi.4; device probing. + + + At this time, the &man.mfiutil.8; utility and + the &os; version of + MegaCLI and + StorCli do not work with + &man.mrsas.4;. + + Virtualization support From owner-svn-src-head@FreeBSD.ORG Wed May 7 21:16:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABF19837; Wed, 7 May 2014 21:16:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98F54F0C; Wed, 7 May 2014 21:16:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47LGmDf092040; Wed, 7 May 2014 21:16:48 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47LGmlp092039; Wed, 7 May 2014 21:16:48 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201405072116.s47LGmlp092039@svn.freebsd.org> From: Ed Maste Date: Wed, 7 May 2014 21:16:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265613 - head/usr.bin/elfdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 21:16:48 -0000 Author: emaste Date: Wed May 7 21:16:47 2014 New Revision: 265613 URL: http://svnweb.freebsd.org/changeset/base/265613 Log: Handle ELF files with 65280 or more sections If e_shnum or e_shstrndx are at least SHN_LORESERVE (0xff00) then an escape value is used to indicate that the actual value is found in one of section 0's fields. Sponsored by: DARPA, AFRL Modified: head/usr.bin/elfdump/elfdump.c Modified: head/usr.bin/elfdump/elfdump.c ============================================================================== --- head/usr.bin/elfdump/elfdump.c Wed May 7 21:01:35 2014 (r265612) +++ head/usr.bin/elfdump/elfdump.c Wed May 7 21:16:47 2014 (r265613) @@ -368,7 +368,7 @@ static u_int64_t elf_get_half(Elf32_Ehdr static u_int64_t elf_get_word(Elf32_Ehdr *e, void *base, elf_member_t member); static u_int64_t elf_get_quad(Elf32_Ehdr *e, void *base, elf_member_t member); -static void elf_print_ehdr(Elf32_Ehdr *e); +static void elf_print_ehdr(Elf32_Ehdr *e, void *sh); static void elf_print_phdr(Elf32_Ehdr *e, void *p); static void elf_print_shdr(Elf32_Ehdr *e, void *sh); static void elf_print_symtab(Elf32_Ehdr *e, void *sh, char *str); @@ -382,6 +382,33 @@ static void elf_print_note(Elf32_Ehdr *e static void usage(void); +/* + * Helpers for ELF files with shnum or shstrndx values that don't fit in the + * ELF header. If the values are too large then an escape value is used to + * indicate that the actual value is found in one of section 0's fields. + */ +static uint64_t +elf_get_shnum(Elf32_Ehdr *e, void *sh) +{ + uint64_t shnum; + + shnum = elf_get_quarter(e, e, E_SHNUM); + if (shnum == 0) + shnum = elf_get_word(e, (char *)sh, SH_SIZE); + return shnum; +} + +static uint64_t +elf_get_shstrndx(Elf32_Ehdr *e, void *sh) +{ + uint64_t shstrndx; + + shstrndx = elf_get_quarter(e, e, E_SHSTRNDX); + if (shstrndx == SHN_XINDEX) + shstrndx = elf_get_word(e, (char *)sh, SH_LINK); + return shstrndx; +} + int main(int ac, char **av) { @@ -467,10 +494,10 @@ main(int ac, char **av) phentsize = elf_get_quarter(e, e, E_PHENTSIZE); phnum = elf_get_quarter(e, e, E_PHNUM); shentsize = elf_get_quarter(e, e, E_SHENTSIZE); - shnum = elf_get_quarter(e, e, E_SHNUM); - shstrndx = elf_get_quarter(e, e, E_SHSTRNDX); p = (char *)e + phoff; sh = (char *)e + shoff; + shnum = elf_get_shnum(e, sh); + shstrndx = elf_get_shstrndx(e, sh); offset = elf_get_off(e, (char *)sh + shstrndx * shentsize, SH_OFFSET); shstrtab = (char *)e + offset; for (i = 0; (u_int64_t)i < shnum; i++) { @@ -482,7 +509,7 @@ main(int ac, char **av) dynstr = (char *)e + offset; } if (flags & ED_EHDR) - elf_print_ehdr(e); + elf_print_ehdr(e, sh); if (flags & ED_PHDR) elf_print_phdr(e, p); if (flags & ED_SHDR) @@ -556,7 +583,7 @@ main(int ac, char **av) } static void -elf_print_ehdr(Elf32_Ehdr *e) +elf_print_ehdr(Elf32_Ehdr *e, void *sh) { u_int64_t class; u_int64_t data; @@ -589,8 +616,8 @@ elf_print_ehdr(Elf32_Ehdr *e) phentsize = elf_get_quarter(e, e, E_PHENTSIZE); phnum = elf_get_quarter(e, e, E_PHNUM); shentsize = elf_get_quarter(e, e, E_SHENTSIZE); - shnum = elf_get_quarter(e, e, E_SHNUM); - shstrndx = elf_get_quarter(e, e, E_SHSTRNDX); + shnum = elf_get_shnum(e, sh); + shstrndx = elf_get_shstrndx(e, sh); fprintf(out, "\nelf header:\n"); fprintf(out, "\n"); fprintf(out, "\te_ident: %s %s %s\n", ei_classes[class], ei_data[data], @@ -671,7 +698,7 @@ elf_print_shdr(Elf32_Ehdr *e, void *sh) int i; shentsize = elf_get_quarter(e, e, E_SHENTSIZE); - shnum = elf_get_quarter(e, e, E_SHNUM); + shnum = elf_get_shnum(e, sh); fprintf(out, "\nsection header:\n"); for (i = 0; (u_int64_t)i < shnum; i++) { v = (char *)sh + i * shentsize; From owner-svn-src-head@FreeBSD.ORG Wed May 7 21:45:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A03AD2AD; Wed, 7 May 2014 21:45:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 731C520A; Wed, 7 May 2014 21:45:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s47LjQe2004498; Wed, 7 May 2014 21:45:26 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s47LjPpg004492; Wed, 7 May 2014 21:45:25 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201405072145.s47LjPpg004492@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 7 May 2014 21:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265616 - head/bin/sh/tests/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2014 21:45:26 -0000 Author: jilles Date: Wed May 7 21:45:25 2014 New Revision: 265616 URL: http://svnweb.freebsd.org/changeset/base/265616 Log: sh: Add some tests for normal use of getopts. Added: head/bin/sh/tests/builtins/getopts3.0 (contents, props changed) head/bin/sh/tests/builtins/getopts4.0 (contents, props changed) head/bin/sh/tests/builtins/getopts5.0 (contents, props changed) Modified: head/bin/sh/tests/builtins/Makefile Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Wed May 7 21:39:01 2014 (r265615) +++ head/bin/sh/tests/builtins/Makefile Wed May 7 21:45:25 2014 (r265616) @@ -80,6 +80,9 @@ FILES+= for2.0 FILES+= for3.0 FILES+= getopts1.0 getopts1.0.stdout FILES+= getopts2.0 getopts2.0.stdout +FILES+= getopts3.0 +FILES+= getopts4.0 +FILES+= getopts5.0 FILES+= hash1.0 hash1.0.stdout FILES+= hash2.0 hash2.0.stdout FILES+= hash3.0 hash3.0.stdout Added: head/bin/sh/tests/builtins/getopts3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/getopts3.0 Wed May 7 21:45:25 2014 (r265616) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +shift $# +getopts x opt +r=$? +[ "$r" != 0 ] && [ "$OPTIND" = 1 ] Added: head/bin/sh/tests/builtins/getopts4.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/getopts4.0 Wed May 7 21:45:25 2014 (r265616) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +set -- -x +opt=not +getopts x opt +r1=$? OPTIND1=$OPTIND opt1=$opt +getopts x opt +r2=$? OPTIND2=$OPTIND +[ "$r1" = 0 ] && [ "$OPTIND1" = 2 ] && [ "$opt1" = x ] && [ "$r2" != 0 ] && + [ "$OPTIND2" = 2 ] Added: head/bin/sh/tests/builtins/getopts5.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/getopts5.0 Wed May 7 21:45:25 2014 (r265616) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +set -- -x arg +opt=not +getopts x opt +r1=$? OPTIND1=$OPTIND opt1=$opt +getopts x opt +r2=$? OPTIND2=$OPTIND +[ "$r1" = 0 ] && [ "$OPTIND1" = 2 ] && [ "$opt1" = x ] && [ "$r2" != 0 ] && + [ "$OPTIND2" = 2 ] From owner-svn-src-head@FreeBSD.ORG Thu May 8 00:26:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F381BDA; Thu, 8 May 2014 00:26:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CC62188; Thu, 8 May 2014 00:26:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s480QLX7074972; Thu, 8 May 2014 00:26:21 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s480QLBl074971; Thu, 8 May 2014 00:26:21 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201405080026.s480QLBl074971@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Thu, 8 May 2014 00:26:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265624 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 00:26:22 -0000 Author: ganbold Date: Thu May 8 00:26:21 2014 New Revision: 265624 URL: http://svnweb.freebsd.org/changeset/base/265624 Log: Silence no interrupt-parent found message during boot. Approved by: stas (mentor) Modified: head/sys/boot/fdt/dts/arm/rk3188.dtsi Modified: head/sys/boot/fdt/dts/arm/rk3188.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/rk3188.dtsi Thu May 8 00:08:19 2014 (r265623) +++ head/sys/boot/fdt/dts/arm/rk3188.dtsi Thu May 8 00:26:21 2014 (r265624) @@ -31,6 +31,8 @@ #address-cells = <1>; #size-cells = <1>; + interrupt-parent = <&GIC>; + aliases { soc = &SOC; }; From owner-svn-src-head@FreeBSD.ORG Thu May 8 01:57:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F413E39; Thu, 8 May 2014 01:57:50 +0000 (UTC) Date: Thu, 8 May 2014 17:57:20 -0400 From: Glen Barber To: Warner Losh Subject: Re: svn commit: r265581 - in head: . share/mk Message-ID: <20140508215720.GB1212@hub.FreeBSD.org> References: <201405071815.s47IF3t1010953@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DKU6Jbt7q3WqK7+M" Content-Disposition: inline In-Reply-To: <201405071815.s47IF3t1010953@svn.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 01:57:51 -0000 --DKU6Jbt7q3WqK7+M Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 07, 2014 at 06:15:03PM +0000, Warner Losh wrote: > Author: imp > Date: Wed May 7 18:15:02 2014 > New Revision: 265581 > URL: http://svnweb.freebsd.org/changeset/base/265581 >=20 > Log: > bsd.compiler.mk was implicitly included by bsd.own.mk in historical > versions. With its movement to src.opts.mk, bsd.prog.mk was testing > COMPILER_TYPE without including the bsd.compiler.mk anymore. In the > source tree, this caused no problems, for reasons that aren't clear, > but does cause problems outside of the source tree. Allow > bsd.compiler.mk to be included multiple times safely, and always > include bsd.compiler.mk at the top of bsd.prog.mk. Resist the urge to > put it in bsd.init.mk, since that would reintroduce the implicit > include. >=20 > Modified: > head/UPDATING > head/share/mk/bsd.compiler.mk > head/share/mk/bsd.prog.mk >=20 Something here is breaking head/ release builds. I don't know if it is this exact change set or not. -------------------------------------------------------------- >>> Kernel build for GENERIC completed on Thu May 8 01:47:57 UTC 2014 -------------------------------------------------------------- make: "/usr/share/mk/bsd.obj.mk" line 43: Could not find bsd.own.mk make: "/usr/share/mk/bsd.init.mk" line 15: Could not find bsd.own.mk make: Fatal errors encountered -- cannot continue make: stopped in /usr/src/release Glen --DKU6Jbt7q3WqK7+M Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTa/3AAAoJELls3eqvi17Q+0MP/1me2biKfiwDVkmSYE5K+ZqK Bg4MIU/TyFpy1vQI5tDdEiXLAm4t4+/Y5KcHd9QfPp3dbPr1yHEg0B+VR8PDTNJ3 x9lZB6wUpMyZVW0nkvFxiU5CarQhFoZJtjNizVEnWLzytfTpnzSdOeWmFuEcidIf I687zSSS3juw1Y2LiMEhdV724Cjsq/5VC4jhEejH9ORFrdrNdELKnuTypzjVUdS7 4NYugflM9R+031rve7km5m9vg8XIH+XMbvoB6yhefw8QvBQ7G/ScWqVihj0uWdF1 zmhVm7HVv8dDWc2k1IV0o29Cj6bBCDtxSWL5oHe7VLWW1E+7oRC/Vw8Md8vyECgh BMVD4SpDYiElYo2p80RErw0ALJpRLi7UkO7ArOWVjdvA0seTrDUPolQ5benzEIdf 7a53rPvUJiSxsBkmU16RbOJh+gjuzGafKDxTQFDD+Igw498nvoGU5nBtx/Wj9on6 L2o/EaIPIksfmZL7cDyii6zeWPuXvo4Icf1od8f2JkkLrM05cq/IOZ0yLYsg9PTz ttiYecTtIbwFH1ubvxxVptFdLfizYE5yC+plxyKPLgy22RYm/IROEhcWruQa/QK6 W91P6sLwIKENzNl/5lxO4DojC8wwJIZBQpTRyuDM2tX9Vv3emYyNEtycLR5hrbBQ yKaxwT//sMSWHC+Qw3P7 =5DwN -----END PGP SIGNATURE----- --DKU6Jbt7q3WqK7+M-- From owner-svn-src-head@FreeBSD.ORG Thu May 8 02:04:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76B9DBA; Thu, 8 May 2014 02:04:49 +0000 (UTC) Date: Thu, 8 May 2014 18:04:35 -0400 From: Glen Barber To: Warner Losh Subject: Re: svn commit: r265581 - in head: . share/mk Message-ID: <20140508220435.GC1212@hub.FreeBSD.org> References: <201405071815.s47IF3t1010953@svn.freebsd.org> <20140508215720.GB1212@hub.FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bKyqfOwhbdpXa4YI" Content-Disposition: inline In-Reply-To: <20140508215720.GB1212@hub.FreeBSD.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 02:04:50 -0000 --bKyqfOwhbdpXa4YI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 08, 2014 at 05:57:20PM -0400, Glen Barber wrote: > On Wed, May 07, 2014 at 06:15:03PM +0000, Warner Losh wrote: > > Author: imp > > Date: Wed May 7 18:15:02 2014 > > New Revision: 265581 > > URL: http://svnweb.freebsd.org/changeset/base/265581 > >=20 > > Log: > > bsd.compiler.mk was implicitly included by bsd.own.mk in historical > > versions. With its movement to src.opts.mk, bsd.prog.mk was testing > > COMPILER_TYPE without including the bsd.compiler.mk anymore. In the > > source tree, this caused no problems, for reasons that aren't clear, > > but does cause problems outside of the source tree. Allow > > bsd.compiler.mk to be included multiple times safely, and always > > include bsd.compiler.mk at the top of bsd.prog.mk. Resist the urge to > > put it in bsd.init.mk, since that would reintroduce the implicit > > include. > >=20 > > Modified: > > head/UPDATING > > head/share/mk/bsd.compiler.mk > > head/share/mk/bsd.prog.mk > >=20 >=20 > Something here is breaking head/ release builds. I don't know if it is > this exact change set or not. >=20 > -------------------------------------------------------------- > >>> Kernel build for GENERIC completed on Thu May 8 01:47:57 UTC 2014 > -------------------------------------------------------------- > make: "/usr/share/mk/bsd.obj.mk" line 43: Could not find bsd.own.mk > make: "/usr/share/mk/bsd.init.mk" line 15: Could not find bsd.own.mk > make: Fatal errors encountered -- cannot continue > make: stopped in /usr/src/release >=20 The revision I'm building against is r265621, for what it is worth. Glen --bKyqfOwhbdpXa4YI Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTa/9zAAoJELls3eqvi17QFnsP/3k2DcKmHVYeHqQwDpnrFp3I vl5a2lRczS1Mdx3zGuQV15hlzcBQMFz3l/S0mtymxQHYEisiACLvujtgQwkawpZr FpQKFUjtEn8sWHzHhBhOHyE9zMVf3eFNrODE1r2V9sVU7UARFxhjYrHnOxyiN+dj bG3jNV9XNsW8w48qaDp0fbyKnFHiN7PKrzOUXapiPE0H+hNm9/qT285HqP5UtYq3 ronxOuXsK5eCgDU6HSXWjSh5hyvk6hVPvpPSK3LBzRXSxpeQppDrrmnvU4b28qlv w0dgSkAsqRRD6qKaegdc/WdvQQ9y5ekMGy4YH4/sbZj7aIKMk+NO2P9lIlmjHw3c mj3Nl1n9rxGB8Z+Dg/u7p6cOe3/n9u+v++06wrbpAU7Tj8IPlBz1KNi/GygYKK4d qSgUrQXJ1GWkAasWy4lCH6ntCMtcjFzTt/GP7M9xxIzd7wcPntF6HTHzbzJbbCZp JSuowi0cSJ+/D2+eU7IEAAUrCJKSYtvK1sw6zUBryhzpxqN2P1Fg/uCjBE4llBKv 82ysZJ8s7rcoTMI7iF/r9b58112bnuzTeX/fyE/dNbc3hghYwI2o17wAFGBiTLok 25E3aJPRyWpXk3gPAkBpZ7k6GaSw7aAyqvFA3+XZ5CE7el9z0PO8yEFkgS4YYJLS kDH9YiRiryDSB2JfqKlM =s2hS -----END PGP SIGNATURE----- --bKyqfOwhbdpXa4YI-- From owner-svn-src-head@FreeBSD.ORG Thu May 8 02:09:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A25F629F for ; Thu, 8 May 2014 02:09:09 +0000 (UTC) Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FFC3B10 for ; Thu, 8 May 2014 02:09:09 +0000 (UTC) Received: by mail-pa0-f49.google.com with SMTP id lj1so1987317pab.36 for ; Wed, 07 May 2014 19:09:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=hBgyeKLiaH70ugScarCjSoDk5WTwqirIzs2wExp0aXM=; b=l7EWreKFmAYSqMsSOy1KBrV077PWt6kfi/LrT925Q/1SjCxiJZPyHBIGuAn5r6vmlu azwzdVysqpCLNRtoy0Zs/57l4FX29V4czJhn/GfDOLwSvL6KDOtrCcwLB4BgVXge+oLD lwLEuagmPnrdAp0lZCcKfzHF4UEKyAmbctgoT6FIUydXLdMWsf3fo32G/eqocEABVT3l eRRLkcn0OFpewlAzo5A17XGrVNC7N7QYMw99P/vpCxpcjPVMemF0kH0UdhPV+YuoKiON GVFUCRXc3bGK8ut1fto1ruC8c6lhgjo3n0g7BIxX8ov5kl9ZNsjK0tBF0HML3ee8PJXj rWog== X-Gm-Message-State: ALoCoQmRcvN8QWAD62Rk67k2vQmx7QAWuSpXKHeYULojeFCV2Oy+GcIH7Q9fX8+fgWzHYCWHNVA7 X-Received: by 10.66.149.102 with SMTP id tz6mr1683291pab.76.1399514948537; Wed, 07 May 2014 19:09:08 -0700 (PDT) Received: from [10.0.100.170] ([50.242.69.61]) by mx.google.com with ESMTPSA id iv2sm5605242pbc.19.2014.05.07.19.09.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 May 2014 19:09:07 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_C3441F7A-6C45-4CA0-ADB8-DE1BB83845AF"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265581 - in head: . share/mk From: Warner Losh In-Reply-To: <20140508220435.GC1212@hub.FreeBSD.org> Date: Wed, 7 May 2014 19:09:05 -0700 Message-Id: References: <201405071815.s47IF3t1010953@svn.freebsd.org> <20140508215720.GB1212@hub.FreeBSD.org> <20140508220435.GC1212@hub.FreeBSD.org> To: Glen Barber X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 02:09:09 -0000 --Apple-Mail=_C3441F7A-6C45-4CA0-ADB8-DE1BB83845AF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On May 8, 2014, at 3:04 PM, Glen Barber wrote: > On Thu, May 08, 2014 at 05:57:20PM -0400, Glen Barber wrote: >> On Wed, May 07, 2014 at 06:15:03PM +0000, Warner Losh wrote: >>> Author: imp >>> Date: Wed May 7 18:15:02 2014 >>> New Revision: 265581 >>> URL: http://svnweb.freebsd.org/changeset/base/265581 >>>=20 >>> Log: >>> bsd.compiler.mk was implicitly included by bsd.own.mk in historical >>> versions. With its movement to src.opts.mk, bsd.prog.mk was testing >>> COMPILER_TYPE without including the bsd.compiler.mk anymore. In the >>> source tree, this caused no problems, for reasons that aren't = clear, >>> but does cause problems outside of the source tree. Allow >>> bsd.compiler.mk to be included multiple times safely, and always >>> include bsd.compiler.mk at the top of bsd.prog.mk. Resist the urge = to >>> put it in bsd.init.mk, since that would reintroduce the implicit >>> include. >>>=20 >>> Modified: >>> head/UPDATING >>> head/share/mk/bsd.compiler.mk >>> head/share/mk/bsd.prog.mk >>>=20 >>=20 >> Something here is breaking head/ release builds. I don't know if it = is >> this exact change set or not. >>=20 >> -------------------------------------------------------------- >>>>> Kernel build for GENERIC completed on Thu May 8 01:47:57 UTC 2014 >> -------------------------------------------------------------- >> make: "/usr/share/mk/bsd.obj.mk" line 43: Could not find bsd.own.mk >> make: "/usr/share/mk/bsd.init.mk" line 15: Could not find bsd.own.mk >> make: Fatal errors encountered -- cannot continue >> make: stopped in /usr/src/release >>=20 >=20 > The revision I'm building against is r265621, for what it is worth. OK. That=92s a weird error. I haven=92t deleted bsd.own.mk=85 Any chance you can do some bisection to see if there=92s a specific = change you can narrow this down to? But /usr/share/mk suggests there=92s = some host contamination going on, which implies needing to have a = synchronized host environment (I can=92t recall if make release is fully = virtualized or not). But before all that, can you confirm you have a = /usr/share/mk/bsd.own.mk? Warner --Apple-Mail=_C3441F7A-6C45-4CA0-ADB8-DE1BB83845AF Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTaudBAAoJEGwc0Sh9sBEAs9EQAIhRKV24m90f0UfLpUKbTdWp JZHIcxEs1CPEz8+6cKVIEMG72JjW+nSXd2uaY61FBMHBNavXXvsOYFLOBAOeuIkN 9gZC5/bvRVCDCuKfasG0aZEizfjc/V+RU3JdbcwDgBluyPt/I6KByHh46501QZEn 1Vs7E/ES9jD+gMTImWBDcyurDpPNAa9bCe26nba2XV6mKb2PHO7+0o6icTIE0EHz 8Z4daUSiPnZSL+J+WnKdsHrR0wJ5AvOXGFB+dd+SX6qFpGxy/GqmtJD5yegnPYd2 ISWV4mzyzleIztEuL1GFMl36ImHalBngHKesyg6zjO1PU1e3yj+ZwvL/iuCA+a33 qYpHS+j/jAZwSlDrRXPtPoQaVLXevg9VZ5VYw6vacTtoy4MlFKjSThriWh8+hsuJ aIJYgRHXIwlp6CRmzeOeWd36zRIa25fG5IshoFkfV0Wn3zBJSdBkmJ8CBLNGzN43 WObOlKTpE3f7CXC8m8I5wUE7s4OHeEm62fyPYJDExw8zhZM9b7+mmmH887y7I2NL riWRASbWloBTvzPV0yxuAWaD0O69skCaVu5biU3+aASD/sT3oZZ1naPGin2P/3bd XAEmFoE3EdhGwRfbEtU+W00HXpif6ocG6G5zbUtPpXA39xQdqDkYYdXLzLteBm9L bHcOgysJAn5v6QCrT0m1 =kOep -----END PGP SIGNATURE----- --Apple-Mail=_C3441F7A-6C45-4CA0-ADB8-DE1BB83845AF-- From owner-svn-src-head@FreeBSD.ORG Thu May 8 02:18:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8C3D46A; Thu, 8 May 2014 02:18:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D69A1BAB; Thu, 8 May 2014 02:18:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s482Ia5Y022665; Thu, 8 May 2014 02:18:36 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s482Iang022664; Thu, 8 May 2014 02:18:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405080218.s482Iang022664@svn.freebsd.org> From: Warner Losh Date: Thu, 8 May 2014 02:18:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265627 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 02:18:37 -0000 Author: imp Date: Thu May 8 02:18:36 2014 New Revision: 265627 URL: http://svnweb.freebsd.org/changeset/base/265627 Log: Fix a typo make should have complained about. Submitted by: Mark Johnston Modified: head/share/mk/bsd.mkopt.mk Modified: head/share/mk/bsd.mkopt.mk ============================================================================== --- head/share/mk/bsd.mkopt.mk Thu May 8 01:43:33 2014 (r265626) +++ head/share/mk/bsd.mkopt.mk Thu May 8 02:18:36 2014 (r265627) @@ -42,7 +42,7 @@ MK_${var}:= yes # .for var in ${__DEFAULT_NO_OPTIONS} .if !defined(MK_${var}) -.if definfed(WITH_${var} && !defined(WITHOUT_${var}) # WITHOUT aways wins +.if defined(WITH_${var} && !defined(WITHOUT_${var}) # WITHOUT aways wins MK_${var}:= yes .else MK_${var}:= no From owner-svn-src-head@FreeBSD.ORG Thu May 8 02:20:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E31A5AE; Thu, 8 May 2014 02:20:17 +0000 (UTC) Date: Thu, 8 May 2014 18:20:02 -0400 From: Glen Barber To: Warner Losh Subject: Re: svn commit: r265581 - in head: . share/mk Message-ID: <20140508222002.GD1212@hub.FreeBSD.org> References: <201405071815.s47IF3t1010953@svn.freebsd.org> <20140508215720.GB1212@hub.FreeBSD.org> <20140508220435.GC1212@hub.FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="at6+YcpfzWZg/htY" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 02:20:18 -0000 --at6+YcpfzWZg/htY Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 07, 2014 at 07:09:05PM -0700, Warner Losh wrote: >=20 > On May 8, 2014, at 3:04 PM, Glen Barber wrote: >=20 > > On Thu, May 08, 2014 at 05:57:20PM -0400, Glen Barber wrote: > >> On Wed, May 07, 2014 at 06:15:03PM +0000, Warner Losh wrote: > >>> Author: imp > >>> Date: Wed May 7 18:15:02 2014 > >>> New Revision: 265581 > >>> URL: http://svnweb.freebsd.org/changeset/base/265581 > >>>=20 > >>> Log: > >>> bsd.compiler.mk was implicitly included by bsd.own.mk in historical > >>> versions. With its movement to src.opts.mk, bsd.prog.mk was testing > >>> COMPILER_TYPE without including the bsd.compiler.mk anymore. In the > >>> source tree, this caused no problems, for reasons that aren't clear, > >>> but does cause problems outside of the source tree. Allow > >>> bsd.compiler.mk to be included multiple times safely, and always > >>> include bsd.compiler.mk at the top of bsd.prog.mk. Resist the urge to > >>> put it in bsd.init.mk, since that would reintroduce the implicit > >>> include. > >>>=20 > >>> Modified: > >>> head/UPDATING > >>> head/share/mk/bsd.compiler.mk > >>> head/share/mk/bsd.prog.mk > >>>=20 > >>=20 > >> Something here is breaking head/ release builds. I don't know if it is > >> this exact change set or not. > >>=20 > >> -------------------------------------------------------------- > >>>>> Kernel build for GENERIC completed on Thu May 8 01:47:57 UTC 2014 > >> -------------------------------------------------------------- > >> make: "/usr/share/mk/bsd.obj.mk" line 43: Could not find bsd.own.mk > >> make: "/usr/share/mk/bsd.init.mk" line 15: Could not find bsd.own.mk > >> make: Fatal errors encountered -- cannot continue > >> make: stopped in /usr/src/release > >>=20 > >=20 > > The revision I'm building against is r265621, for what it is worth. >=20 > OK. That=E2=80=99s a weird error. I haven=E2=80=99t deleted bsd.own.mk... >=20 > Any chance you can do some bisection to see if there=E2=80=99s a specific > change you can narrow this down to? But /usr/share/mk suggests > there=E2=80=99s some host contamination going on, which implies needing to > have a synchronized host environment (I can=E2=80=99t recall if make rele= ase > is fully virtualized or not). >=20 > But before all that, can you confirm you have a /usr/share/mk/bsd.own.mk? >=20 Ugh... This is the problem... root@grind:/releng/11-amd64-GENERIC-snap # ll usr/share/mk/bsd.own.mk ls: usr/share/mk/bsd.own.mk: No such file or directory This doesn't make any sense to me though, unless I misunderstand a prior change here. The host does the buildworld in /releng/11-amd64-GENERIC-snap/usr/src with MAKEOBJDIRPREFIX set to a non-default location, and installworld from that. In this specific case, the build was done as an "upgrade" build, not "clean" build (meaning, to seed the build chroot for a clean release build). I tend to alternate if MAKEOBJDIR is pristine every other week to try to capture cases where we expect "just 'rm -rf /usr/obj'" as a "fix" for problems. Glen --at6+YcpfzWZg/htY Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTbAMSAAoJELls3eqvi17Q2LQQALulu/tsEiUe/SAE/DDLFKth 23wXT0lWQFQ2ythuPG4q/wW/uwaCe8aOzqzFz2s4xpTREcg5P47lJL3JG8y5swZr dviunsdLJ614fzHAa6ceW6dXcDt2yF8X0iVvW97pS7zjzQSeVuXepMZtYzP27DXl k6v6WwPqPR7GxRwJbb3Co6wj3TMTuDcVRNUuEQdyPlmXsOPP0sxRRwEUYddPFlss EeelZNykcx/dBS42G4BFFNPir02kKZfwvftMbklOnhYIlOFHBZdm8p82WhTn99Mh BgB+NqkfFtZmhHZaI5IBk5J9Vgy4CJVinxDLdenXENspMssMdPAn06KQw7EziLIe r312UiYMgxs587cdXIOEby7daIZ5GUdhqZgRXbfsXRU95hTmNhJqJIzIFyHXL4eu LEePeILQK4RsmOtEHdp5Nzi+/oQ6c1ne43WNZpjaGkrBrtKUAjo+9Zv7iCOrQHFK NH+TGoVUDLvkFK5EfilO+cWp1CgEmQFhn5ej43jK5QCVZjrWr0+we/mMDZ2gaUyh YrAiN/nqEGnSRKSeNdzgQfF0gmKVU1eS4NNT9IuRPTJb+5tO30kM6Fq9bYFgJJt6 QbzHT6xPXZRadZ7BB3BZ299lELfTSwrBLsPrqOKr2Y5he83cd3O6z4dqQ97q3QvI iQ/yIRVB4jFjJefSVevf =IfJW -----END PGP SIGNATURE----- --at6+YcpfzWZg/htY-- From owner-svn-src-head@FreeBSD.ORG Thu May 8 02:24:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0BD580D for ; Thu, 8 May 2014 02:24:13 +0000 (UTC) Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D69CC3E for ; Thu, 8 May 2014 02:24:13 +0000 (UTC) Received: by mail-pd0-f171.google.com with SMTP id r10so1793896pdi.16 for ; Wed, 07 May 2014 19:24:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=4ExISb4+B3HCraZmxvYHTJEDDNKn6ptdONQiUbsVwk0=; b=IsTeVlmCEGhXdToWCxg3Sgj22Ixr+IGs5a64jZSBGoA1WhBASPVYOF1VIUndKcoaM0 2FUr8dbBJk0zirIH2W+0Ky4g2PF2r78Nik7c+Cg7oD8H9LRndRKG5mA+v1BHFE5ZynYl WvvzHxcmMcES2fpZpZh9baZl9+M+twGTC8PqT2t3QRczSqgYwnr63qOmQ5+hQaL565Yn jQR+4kdPJdI60PPSvFk2L22sEIhZmae6rbO8wuTG6K9ND4PHerw+PZsrB3z3qDJRMBqu IakK8RYyPSpyLN2nbG7evbtIDqN7H+UiFQCoC2cBCuEXMrcCKnTXX55TVeBqsRtQCbVv urOw== X-Gm-Message-State: ALoCoQk1u9qU7364VYLJlun5CKmBIyvHd6DhicbSKCCoLWjrOL3Xx+XxGyIWK+gAV3vS+I6f31qA X-Received: by 10.66.142.132 with SMTP id rw4mr1954284pab.6.1399515847156; Wed, 07 May 2014 19:24:07 -0700 (PDT) Received: from [10.0.100.170] ([50.242.69.61]) by mx.google.com with ESMTPSA id nh8sm5645050pbc.25.2014.05.07.19.24.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 May 2014 19:24:06 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_539ED38B-702D-43B2-98DD-1366F43D3199"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265581 - in head: . share/mk From: Warner Losh In-Reply-To: <20140508222002.GD1212@hub.FreeBSD.org> Date: Wed, 7 May 2014 19:24:03 -0700 Message-Id: <463883C9-98DE-4C40-A630-FB580432BECE@bsdimp.com> References: <201405071815.s47IF3t1010953@svn.freebsd.org> <20140508215720.GB1212@hub.FreeBSD.org> <20140508220435.GC1212@hub.FreeBSD.org> <20140508222002.GD1212@hub.FreeBSD.org> To: Glen Barber X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 02:24:13 -0000 --Apple-Mail=_539ED38B-702D-43B2-98DD-1366F43D3199 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On May 8, 2014, at 3:20 PM, Glen Barber wrote: > On Wed, May 07, 2014 at 07:09:05PM -0700, Warner Losh wrote: >>=20 >> On May 8, 2014, at 3:04 PM, Glen Barber wrote: >>=20 >>> On Thu, May 08, 2014 at 05:57:20PM -0400, Glen Barber wrote: >>>> On Wed, May 07, 2014 at 06:15:03PM +0000, Warner Losh wrote: >>>>> Author: imp >>>>> Date: Wed May 7 18:15:02 2014 >>>>> New Revision: 265581 >>>>> URL: http://svnweb.freebsd.org/changeset/base/265581 >>>>>=20 >>>>> Log: >>>>> bsd.compiler.mk was implicitly included by bsd.own.mk in = historical >>>>> versions. With its movement to src.opts.mk, bsd.prog.mk was = testing >>>>> COMPILER_TYPE without including the bsd.compiler.mk anymore. In = the >>>>> source tree, this caused no problems, for reasons that aren't = clear, >>>>> but does cause problems outside of the source tree. Allow >>>>> bsd.compiler.mk to be included multiple times safely, and always >>>>> include bsd.compiler.mk at the top of bsd.prog.mk. Resist the urge = to >>>>> put it in bsd.init.mk, since that would reintroduce the implicit >>>>> include. >>>>>=20 >>>>> Modified: >>>>> head/UPDATING >>>>> head/share/mk/bsd.compiler.mk >>>>> head/share/mk/bsd.prog.mk >>>>>=20 >>>>=20 >>>> Something here is breaking head/ release builds. I don't know if = it is >>>> this exact change set or not. >>>>=20 >>>> -------------------------------------------------------------- >>>>>>> Kernel build for GENERIC completed on Thu May 8 01:47:57 UTC = 2014 >>>> -------------------------------------------------------------- >>>> make: "/usr/share/mk/bsd.obj.mk" line 43: Could not find bsd.own.mk >>>> make: "/usr/share/mk/bsd.init.mk" line 15: Could not find = bsd.own.mk >>>> make: Fatal errors encountered -- cannot continue >>>> make: stopped in /usr/src/release >>>>=20 >>>=20 >>> The revision I'm building against is r265621, for what it is worth. >>=20 >> OK. That=92s a weird error. I haven=92t deleted bsd.own.mk... >>=20 >> Any chance you can do some bisection to see if there=92s a specific >> change you can narrow this down to? But /usr/share/mk suggests >> there=92s some host contamination going on, which implies needing to >> have a synchronized host environment (I can=92t recall if make = release >> is fully virtualized or not). >>=20 >> But before all that, can you confirm you have a = /usr/share/mk/bsd.own.mk? >>=20 >=20 > Ugh... This is the problem... >=20 > root@grind:/releng/11-amd64-GENERIC-snap # ll usr/share/mk/bsd.own.mk > ls: usr/share/mk/bsd.own.mk: No such file or directory >=20 > This doesn't make any sense to me though, unless I misunderstand a = prior > change here. The host does the buildworld in > /releng/11-amd64-GENERIC-snap/usr/src with MAKEOBJDIRPREFIX set to > a non-default location, and installworld from that. >=20 > In this specific case, the build was done as an "upgrade" build, not > "clean" build (meaning, to seed the build chroot for a clean release > build). I tend to alternate if MAKEOBJDIR is pristine every other = week > to try to capture cases where we expect "just 'rm -rf /usr/obj'" as > a "fix" for problems. That=92s really odd=85 Doh, one too many s/bsd.own.mk/src.opts.mk/g is the cause. fix coming. Warner --Apple-Mail=_539ED38B-702D-43B2-98DD-1366F43D3199 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTaurEAAoJEGwc0Sh9sBEAlosP/3hq42qYhja8z8FArT5m6sKX HfGSdGa3HcEd9lrzH8/30zXdoNIWoONxVhpa9Tiz6qV/zOhUZ9ih+uJxTC0L5o+z H1UdhiFk904JE3sxxltx0owlhfSo0HzNR9bvNzyqJpsdZvG7moWLX3r/6DsrVzKY JdwHX/bGTkqP1pQ6Gfk9O7m9o3BGhR81LETAufEGDFA0EBVXIuNfW6bkV7EtXyky 4BeCN6SzgyHivQLreiZP4s8ll/lajkb50R4R65l/Kfg81EDMeDWfF6sqUhP2BiI3 fmNeMzC9/OVu2PBbKzcbfrTj4aK2DJh+Xs2yTpgf1F1H4hn2jrQ5NEOmlQh4VS4S MXy02Hs0Cf49EwNUN2CKxCn5plhRlW/avnNA8PB4H8hlOD1onZHPoJaBiLDF1ULe pQSz192TgUM/kX45ybusciB+/kBenDzS9xXtmtJ5oFxFq+9XUwISukZ/xfFQiDlg tnIZYF8Vm83jp4f71RV4Acgi+xHMyL6d5o2JO2pCt/C3wTMaWcqowQSpjdDnNB6m XSYTizXNniW44ORF4xerMr3oANhtsmgE5anPH/T5i+mu2lzOjicrWMjPMzlaxYt3 m1vFtIsYcmXQ+a/VHcAulguuqu9I/k5GD+UY1Tblz+ex0+fv/lQheb4RNliap/ib P3y7o1KmPipBl7/ciRxU =qPK8 -----END PGP SIGNATURE----- --Apple-Mail=_539ED38B-702D-43B2-98DD-1366F43D3199-- From owner-svn-src-head@FreeBSD.ORG Thu May 8 02:24:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14C2C86C; Thu, 8 May 2014 02:24:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0235BC41; Thu, 8 May 2014 02:24:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s482OUXd026370; Thu, 8 May 2014 02:24:30 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s482OU5w026368; Thu, 8 May 2014 02:24:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405080224.s482OU5w026368@svn.freebsd.org> From: Warner Losh Date: Thu, 8 May 2014 02:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265628 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 02:24:31 -0000 Author: imp Date: Thu May 8 02:24:30 2014 New Revision: 265628 URL: http://svnweb.freebsd.org/changeset/base/265628 Log: Put bsd.own.mk back in the list, and take src.opts.mk out. Fix a silly typo. Modified: head/share/mk/Makefile head/share/mk/bsd.mkopt.mk Modified: head/share/mk/Makefile ============================================================================== --- head/share/mk/Makefile Thu May 8 02:18:36 2014 (r265627) +++ head/share/mk/Makefile Thu May 8 02:24:30 2014 (r265628) @@ -26,7 +26,7 @@ FILES= \ bsd.nls.mk \ bsd.obj.mk \ bsd.opts.mk \ - src.opts.mk \ + bsd.own.mk \ bsd.port.mk \ bsd.port.options.mk \ bsd.port.post.mk \ Modified: head/share/mk/bsd.mkopt.mk ============================================================================== --- head/share/mk/bsd.mkopt.mk Thu May 8 02:18:36 2014 (r265627) +++ head/share/mk/bsd.mkopt.mk Thu May 8 02:24:30 2014 (r265628) @@ -42,7 +42,7 @@ MK_${var}:= yes # .for var in ${__DEFAULT_NO_OPTIONS} .if !defined(MK_${var}) -.if defined(WITH_${var} && !defined(WITHOUT_${var}) # WITHOUT aways wins +.if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT aways wins MK_${var}:= yes .else MK_${var}:= no From owner-svn-src-head@FreeBSD.ORG Thu May 8 02:36:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BDE9A24; Thu, 8 May 2014 02:36:16 +0000 (UTC) Date: Thu, 8 May 2014 18:36:02 -0400 From: Glen Barber To: Warner Losh Subject: Re: svn commit: r265581 - in head: . share/mk Message-ID: <20140508223602.GF1212@hub.FreeBSD.org> References: <201405071815.s47IF3t1010953@svn.freebsd.org> <20140508215720.GB1212@hub.FreeBSD.org> <20140508220435.GC1212@hub.FreeBSD.org> <20140508222002.GD1212@hub.FreeBSD.org> <463883C9-98DE-4C40-A630-FB580432BECE@bsdimp.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NQTVMVnDVuULnIzU" Content-Disposition: inline In-Reply-To: <463883C9-98DE-4C40-A630-FB580432BECE@bsdimp.com> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 02:36:17 -0000 --NQTVMVnDVuULnIzU Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 07, 2014 at 07:24:03PM -0700, Warner Losh wrote: > > In this specific case, the build was done as an "upgrade" build, not > > "clean" build (meaning, to seed the build chroot for a clean release > > build). I tend to alternate if MAKEOBJDIR is pristine every other week > > to try to capture cases where we expect "just 'rm -rf /usr/obj'" as > > a "fix" for problems. >=20 > That=E2=80=99s really odd=E2=80=A6 >=20 To be clear, the symptoms, or the reason that I'm doing what I'm doing? > Doh, one too many s/bsd.own.mk/src.opts.mk/g is the cause. fix coming. >=20 Thanks. Kicked the build again. Glen --NQTVMVnDVuULnIzU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTbAbSAAoJELls3eqvi17QQCoQAJ5rdDKl4o7k4BOk/TEp4e86 xNZh/srFbICz6G5Mt6Dq1vHk5nKa9C0HySwhyqm1Lpo7zBP4UbUQSqwz8iEYvnUr aOT1RPnUFwt+zebiXzqqXh1I7CcfMkkSqbUFEzYpD6hAeiNfUVCzHHukU7RI2QbU GLBgXA//Cu/8xIiS3FuTAP/a1E5UO0KqCqxizE9vdrEVNaquvheGg+MNJZvb0On2 dZfvWgplEysHHSHFNcIT5wKzj4Zzz5/BegUMZkiYiY8qSTEYSnVoxAo4LK6J3szR h8IYIIMj7EB0QAsZhoV2oMTjyiAcM40xBQ02Ou50g9bkzTShczMouZlAN/xHxSwa 4Cq7Qm4TQwDHuDHQLCptjDAe1W2dK1RCiErPgPddIXt0iCIx73pElHdju3AKNy8E YsCU/RYVXV/ETATIbhyvaMeKROgO8hCqP6SYrqsXt+b+eE6SUFTnhDKhDqbuxpfy TwVmy5klgvIJTFGK+mMRMHtjbBWuAUuxClFBwHt3WayrLn/QLvCAcgEaR41SlmIv h3EwZkL05SZ9FaGxSaRfhO1FGAFcu5chSVCl8egnzpZ+IiVgpfP77UuvHroFXmAr sCqP2b3TDxWHTa8hcw/JN/lqi9P9LodZUw9+kGsRhpuObitXryOqPOWJLmnjwUZ8 39udIWaK8NpvOSKaj6zV =AqXX -----END PGP SIGNATURE----- --NQTVMVnDVuULnIzU-- From owner-svn-src-head@FreeBSD.ORG Thu May 8 02:37:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D39EABC2 for ; Thu, 8 May 2014 02:37:52 +0000 (UTC) Received: from mail-pd0-f169.google.com (mail-pd0-f169.google.com [209.85.192.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F2BCD0A for ; Thu, 8 May 2014 02:37:52 +0000 (UTC) Received: by mail-pd0-f169.google.com with SMTP id z10so1817882pdj.28 for ; Wed, 07 May 2014 19:37:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=gn5YCWWIQLN5Ypxq++ibpXFwVBMj6SQT9GfJ925tR64=; b=XYsKzcXwVpQ+kJ/zpLgSAR8VhAazHZXVcMmzkFkoAQQzIltNYdymC0XCB9WGRSXdYx GmhqaZq99guS+MPlfW9CHvihjOn31I+npdp4ROURirKpEtqcb0SnXIxOy2nwnu04TJKG 98wGtYQtuPBN09oadwZuY/YcbPqHjalanOUaGGRK8cX/1hZuXlKoaYQz2A/BbocQqLiq 30Bhj6GHSl4zFmyaCS163cZS7k+ccgJ0+cXdMPtSlGeEDNIMrGGDLMGtoy0h49D5XMQ6 2j2eo9U4JRDY4B9Z6Oizu7AKxRnkzSiI32XChTxo1nX+ED0Y8bPjMpfzPEOxdeyS9yis 1tXw== X-Gm-Message-State: ALoCoQkHOmMfC/uj17ml46V92hZu7qVaRkrF7vxro7MpGqXLLP45Ks1AonM7n9xcU5cUN/roOomn X-Received: by 10.66.254.198 with SMTP id ak6mr1827515pad.156.1399516666419; Wed, 07 May 2014 19:37:46 -0700 (PDT) Received: from [10.0.100.170] ([50.242.69.61]) by mx.google.com with ESMTPSA id yj6sm120736528pab.19.2014.05.07.19.37.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 May 2014 19:37:45 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_38F7313E-96E2-4914-A96A-91A671BD999A"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265581 - in head: . share/mk From: Warner Losh In-Reply-To: <20140508223602.GF1212@hub.FreeBSD.org> Date: Wed, 7 May 2014 19:37:42 -0700 Message-Id: <93A5DFD0-A763-4132-AB2C-8DB144E5FE1E@bsdimp.com> References: <201405071815.s47IF3t1010953@svn.freebsd.org> <20140508215720.GB1212@hub.FreeBSD.org> <20140508220435.GC1212@hub.FreeBSD.org> <20140508222002.GD1212@hub.FreeBSD.org> <463883C9-98DE-4C40-A630-FB580432BECE@bsdimp.com> <20140508223602.GF1212@hub.FreeBSD.org> To: Glen Barber X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 02:37:53 -0000 --Apple-Mail=_38F7313E-96E2-4914-A96A-91A671BD999A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On May 8, 2014, at 3:36 PM, Glen Barber wrote: > On Wed, May 07, 2014 at 07:24:03PM -0700, Warner Losh wrote: >>> In this specific case, the build was done as an "upgrade" build, not >>> "clean" build (meaning, to seed the build chroot for a clean release >>> build). I tend to alternate if MAKEOBJDIR is pristine every other = week >>> to try to capture cases where we expect "just 'rm -rf /usr/obj'" as >>> a "fix" for problems. >>=20 >> That=92s really odd=85 >>=20 >=20 > To be clear, the symptoms, or the reason that I'm doing what I'm = doing? Seems broken to me... >> Doh, one too many s/bsd.own.mk/src.opts.mk/g is the cause. fix = coming. >>=20 >=20 > Thanks. Kicked the build again. Yea=85 Thinking about putting src.opts.mk into ObsoleteFiles, since we = really don=92t want that installed Warner --Apple-Mail=_38F7313E-96E2-4914-A96A-91A671BD999A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTau32AAoJEGwc0Sh9sBEAcN0QAJvYYRd4E6BUNKcjhK0e+SM3 pJtRDLqqpvVYkUBOF3sNIYfBmUPHEDSDV2189c+1LFgzXXMw1Q066oV4r/XqhAz7 ge7K7VWJBdasfvTGhEp9PzTfcFGtK5AuwHfUUBPJsP8jt539u7EQJcHwnuAkOP5m 0ho+oa6kenaOSwWllBQMSOLJAIYKFz07pouUdr2dph9n8u1zzyTxo8DTOojLGye3 QFSatQWCiQ8AUHKNWqVKuGWvwLjxKZg4pVu6ovm7mgd8eF3UaAjPfb/NGRv37T9r JfWHFJUyKghnfPUCl/oGR7gyWpS7blR/6FAr1DS8Hqu3IjwWb5fLD5n8hlxr5ij5 y0UFr0EcSarRjz8vLDB5rN89ptceOTW+IvXEclRKmZ4b9Ihq9a2KDl9VRG3bLbI5 2bDPCtctiBOmr+uiAbgk63vF0p10IpBqWRw7Ajl22w5bQx49cCgP7FohI1KqEXMw Xm/z1zo+6shx9Jn/Dzkq1M3KTGddMN+Cc1j5Z7ruE/OM3NpLYH/2ZwzJil47atra cTYgDHID/7AKdmzKk5XqRTFmjpVXSgsSPG4i7qNkDd04B5OaPIT675Tv7w5YmjpU 2zi+MKdUyo7u84yye9S5cHbamYbmYWA00z9m9gMN56yB4I/32IyMVRDLalHOkwO5 eTnxrVxDWZcb3h75NnW5 =LR1O -----END PGP SIGNATURE----- --Apple-Mail=_38F7313E-96E2-4914-A96A-91A671BD999A-- From owner-svn-src-head@FreeBSD.ORG Thu May 8 02:40:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECBA6CF3; Thu, 8 May 2014 02:40:29 +0000 (UTC) Date: Thu, 8 May 2014 18:40:15 -0400 From: Glen Barber To: Warner Losh Subject: Re: svn commit: r265581 - in head: . share/mk Message-ID: <20140508224015.GG1212@hub.FreeBSD.org> References: <201405071815.s47IF3t1010953@svn.freebsd.org> <20140508215720.GB1212@hub.FreeBSD.org> <20140508220435.GC1212@hub.FreeBSD.org> <20140508222002.GD1212@hub.FreeBSD.org> <463883C9-98DE-4C40-A630-FB580432BECE@bsdimp.com> <20140508223602.GF1212@hub.FreeBSD.org> <93A5DFD0-A763-4132-AB2C-8DB144E5FE1E@bsdimp.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="t4apE7yKrX2dGgJC" Content-Disposition: inline In-Reply-To: <93A5DFD0-A763-4132-AB2C-8DB144E5FE1E@bsdimp.com> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 02:40:30 -0000 --t4apE7yKrX2dGgJC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 07, 2014 at 07:37:42PM -0700, Warner Losh wrote: > > To be clear, the symptoms, or the reason that I'm doing what I'm doing? >=20 > Seems broken to me... >=20 That's what I'm (still) unclear on. *What* seems broken? Glen --t4apE7yKrX2dGgJC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTbAfPAAoJELls3eqvi17QeB8P/2J2GaKp642MwbXhzVPXqY1n hi3vFduKH5G7MPAocFYtV9vPkvyjkN4p51Gt72VNY57moyy9PBBuk36FMnPA0vey 3p+KRljZVIVhSGLj7W9IjSpZTtkvAay8Nud4VLMgCKUNocXrlLRPSM/QSCABCoZN v2joB+Wq4YmEsnYdYEHsjS70XF56+K+9f42b/xmdAxbcJ55gjdFrkwHeuFSe8KA8 kX/6SzoJN3A6uqCahA9q0GYDnI0jMiNEM6RMYb5UOa2drLK61xTk8fXmxLCSKUwm 5iQ4mkVx2Jc+O6qa9fINuwfWUPx4DOYusp1X/6i7LVDaAnUqyvfSUaWAp1qq4hKe Cv5iAm29xeSWw+Mk+ovECnBN149oX1u4I7/pYKoptDHitKyRnlihb/O4zivLMzQP xbZ4nyDhOMDw86Djkfh/UAmI6DJgHQbtHwHqliq9cXUHAwECeUttYWtjmz1pOVld d/AMRarUB5lQyIf5rvsIXZZzqdwhIAEwtmQoTIa0Lx+0uDwb5a8ZcOJ4oUxQVD2P YcpblL3Uq1H6hzAvVHyFSdiaHFCTebYSeh+FvouarLhUwzF73x+M9ZHlqTzdZ/OG pPvFjzZk+l+tAB75bzjJCILiorSld1cNy0bqGoAgf7CBmwe1UGlG8JwwVpfCyKth RhOlvuPRM6vWj4Ut8ve/ =sV+Y -----END PGP SIGNATURE----- --t4apE7yKrX2dGgJC-- From owner-svn-src-head@FreeBSD.ORG Thu May 8 03:26:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05C6ACBE; Thu, 8 May 2014 03:26:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC9411CA; Thu, 8 May 2014 03:26:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s483QPdt054188; Thu, 8 May 2014 03:26:25 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s483QPOC054185; Thu, 8 May 2014 03:26:25 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405080326.s483QPOC054185@svn.freebsd.org> From: Mark Johnston Date: Thu, 8 May 2014 03:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265629 - head/lib/librtld_db X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 03:26:26 -0000 Author: markj Date: Thu May 8 03:26:25 2014 New Revision: 265629 URL: http://svnweb.freebsd.org/changeset/base/265629 Log: Handle the different event types properly in rd_event_addr(). In particular, with r265456 _r_debug_postinit can be used for RD_POSTINIT events. rtld(1) uses r_debug_state for dl state transitions, so we use its address for RD_DLACTIVITY events. MFC after: 2 weeks Modified: head/lib/librtld_db/rtld_db.c head/lib/librtld_db/rtld_db.h Modified: head/lib/librtld_db/rtld_db.c ============================================================================== --- head/lib/librtld_db/rtld_db.c Thu May 8 02:24:30 2014 (r265628) +++ head/lib/librtld_db/rtld_db.c Thu May 8 03:26:25 2014 (r265629) @@ -81,20 +81,40 @@ rd_errstr(rd_err_e rderr) } rd_err_e -rd_event_addr(rd_agent_t *rdap, rd_event_e event __unused, rd_notify_t *notify) +rd_event_addr(rd_agent_t *rdap, rd_event_e event, rd_notify_t *notify) { - DPRINTF("%s rdap %p notify %p\n", __func__, rdap, notify); + rd_err_e ret; - notify->type = RD_NOTIFY_BPT; - notify->u.bptaddr = rdap->rda_addr; + DPRINTF("%s rdap %p event %d notify %p\n", __func__, rdap, event, + notify); - return (RD_OK); + ret = RD_OK; + switch (event) { + case RD_NONE: + break; + case RD_PREINIT: + notify->type = RD_NOTIFY_BPT; + notify->u.bptaddr = rdap->rda_preinit_addr; + break; + case RD_POSTINIT: + notify->type = RD_NOTIFY_BPT; + notify->u.bptaddr = rdap->rda_postinit_addr; + break; + case RD_DLACTIVITY: + notify->type = RD_NOTIFY_BPT; + notify->u.bptaddr = rdap->rda_dlactivity_addr; + break; + default: + ret = RD_ERR; + break; + } + return (ret); } rd_err_e rd_event_enable(rd_agent_t *rdap __unused, int onoff) { - DPRINTF("%s onoff %d\n", __func__, onoff); + DPRINTF("%s onoff %d\n", __func__, onoff); return (RD_OK); } @@ -220,7 +240,15 @@ rd_reset(rd_agent_t *rdap) &sym) < 0) return (RD_ERR); DPRINTF("found r_debug_state at 0x%lx\n", (unsigned long)sym.st_value); - rdap->rda_addr = sym.st_value; + rdap->rda_preinit_addr = sym.st_value; + rdap->rda_dlactivity_addr = sym.st_value; + + if (proc_name2sym(rdap->rda_php, "ld-elf.so.1", "_r_debug_postinit", + &sym) < 0) + return (RD_ERR); + DPRINTF("found _r_debug_postinit at 0x%lx\n", + (unsigned long)sym.st_value); + rdap->rda_postinit_addr = sym.st_value; return (RD_OK); } Modified: head/lib/librtld_db/rtld_db.h ============================================================================== --- head/lib/librtld_db/rtld_db.h Thu May 8 02:24:30 2014 (r265628) +++ head/lib/librtld_db/rtld_db.h Thu May 8 03:26:25 2014 (r265629) @@ -51,7 +51,9 @@ typedef enum { typedef struct rd_agent { struct proc_handle *rda_php; - uintptr_t rda_addr; /* address of r_debug_state */ + uintptr_t rda_dlactivity_addr; + uintptr_t rda_preinit_addr; + uintptr_t rda_postinit_addr; } rd_agent_t; typedef struct rd_loadobj { From owner-svn-src-head@FreeBSD.ORG Thu May 8 03:33:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4121B187; Thu, 8 May 2014 03:33:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EEF1271; Thu, 8 May 2014 03:33:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s483Xtn9058550; Thu, 8 May 2014 03:33:55 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s483Xt5X058549; Thu, 8 May 2014 03:33:55 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405080333.s483Xt5X058549@svn.freebsd.org> From: Mark Johnston Date: Thu, 8 May 2014 03:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265630 - head/lib/librtld_db X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 03:33:55 -0000 Author: markj Date: Thu May 8 03:33:54 2014 New Revision: 265630 URL: http://svnweb.freebsd.org/changeset/base/265630 Log: Fix the rd_event_addr prototype and slightly clarify the use of the "event" parameter. MFC after: 3 days Modified: head/lib/librtld_db/librtld_db.3 Modified: head/lib/librtld_db/librtld_db.3 ============================================================================== --- head/lib/librtld_db/librtld_db.3 Thu May 8 03:26:25 2014 (r265629) +++ head/lib/librtld_db/librtld_db.3 Thu May 8 03:33:54 2014 (r265630) @@ -48,7 +48,7 @@ .Fc .Ft rd_err_e .Fo rd_event_addr -.Fa "rd_agent_t *rdap, rd_notify_t *notify" +.Fa "rd_agent_t *rdap, rd_event_e event, rd_notify_t *notify" .Fc .Ft rd_err_e .Fo rd_event_enable @@ -142,10 +142,10 @@ enables reporting of events. This function always returns RD_OK. .Pp .Fn rd_event_addr -returns the event address in the +returns the event address corresponding to the .Ft event parameter. -At the moment we only report RD_NOTIFY_BPT events. +At the moment we only report events of type RD_NOTIFY_BPT. .Pp .Fn rd_event_getmsg returns the message associated with the latest event. From owner-svn-src-head@FreeBSD.ORG Thu May 8 03:39:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49F994B6; Thu, 8 May 2014 03:39:22 +0000 (UTC) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id BFCA02A4; Thu, 8 May 2014 03:39:21 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 783C4420C7F; Thu, 8 May 2014 13:39:13 +1000 (EST) Date: Thu, 8 May 2014 13:39:09 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jilles Tjoelker Subject: Re: svn commit: r265472 - head/bin/dd In-Reply-To: <20140507202623.GA14233@stack.nl> Message-ID: <20140508111443.S1000@besplex.bde.org> References: <201405062206.s46M6dxW060155@svn.freebsd.org> <20140507113345.B923@besplex.bde.org> <20140507202623.GA14233@stack.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=QIpRGG7L c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=LJiQtwaW0WEA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=69LBMda2I0V_o8eXsfwA:9 a=CjuIK1q_8ugA:10 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Bruce Evans , Alan Somers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 03:39:22 -0000 On Wed, 7 May 2014, Jilles Tjoelker wrote: > On Wed, May 07, 2014 at 12:10:31PM -0600, Alan Somers wrote: >> On Tue, May 6, 2014 at 9:47 PM, Bruce Evans wrote: >>> On Tue, 6 May 2014, Alan Somers wrote: >>>> ... >>>> The solution is to use clock_gettime(2) with CLOCK_MONOTONIC_PRECISE as >>>> the >>>> clock_id. That clock advances steadily, regardless of changes to the >>>> system >>>> clock. >>>> ... >>>> +#include > >>> Use of is a style bug. It is not used in BSD or KNF code >>> like dd used to be. > >> sysexits.h is recommended by the err(3) man page. Is that >> recommendation meant to apply selectively, or is it obsolete, or is >> some sort of edit war being waged by man page authors? Bug in the err(3) man page. Sort of an edit war. Just 2 FreeBSD committers liked sysexits and used it in their code and added a recommendation to use it in some man pages. But it has negative advantages, and normal BSD programs don't use it. It has been edited in and out of style(9). > The recommendation for was incompletely removed, yes. It is still in err(3), and sysexits(3) still justifies itself by pointing to partly-removed words in style(9). err(3) is the last place that should recommend using sysexits. err() gives a nice way of encouraging text descriptions for all exits. With text descriptions, there is almost no need for cryptic numeric exit codes. Only sets of programs that communicate a little status in the exit code should use sysexits (or perhaps their own exit codes, or certain standard exit codes like 126 or 127 for xargs and some other utilities). Some of the uses of the standard exit codes are even. I don't know of any utility except possibly sendmail that documents that it uses sysexits enough for its exit codes to be useful for more than a binary success/fail decision. Certainly not dd after these changes. If its use of sysexits were documented, then the documentation would say "dd uses sysexits to report 3 errors that can't happen; otherwise, it uses the normal 2-state exit codes (there is a macro for them. It expands to the concise but grammatically challenged "exits 0 on success, and >0 if an error occurs". Here ">0" standardises the usual sloppiness of not distinguishing codes between 1 and 127). sysexits(3) now says: % DESCRIPTION % According to style(9), it is not a good practice to call exit(3) with % arbitrary values to indicate a failure condition when ending a program. % Instead, the pre-defined exit codes from sysexits should be used, so the % caller of the process can get a rough estimation about the failure class % without looking up the source code. but style(9) now says: % Exits should be 0 on success, or 1 on failure. % % exit(0); /* % * Avoid obvious comments such as % * "Exit 0 on success." % */ % } The latter is not what I asked for either. In previous discussion of this, I think we agreed to at least mention EXIT_SUCCESS and EXIT_FAILURE, and possibly deprecate sysexits. This is a weakened version of the 4.4BSD style rules, which say: % /* % * Exits should be 0 on success, and 1 on failure. Don't denote % * all the possible exit points, using the integers 1 through 300. % */ % exit(0); /* Avoid obvious comments such as "Exit 0 on success." */ The main point of this is to disallow cryptic undocumented exit statuses. Recommending sysexits almost reverses this. It gives cryptic undocumented error statuses that are not even easy to decrypt for programs. Programs can look up sysexits, but without documentation there is no guarantee that the encoding is according to sysexits. Actually documenting use of sysexits would make it even more painful to use. >> [snip] >>>> - st.start = tv.tv_sec + tv.tv_usec * 1e-6; >>>> + if (clock_gettime(CLOCK_MONOTONIC_PRECISE, &tv)) >>>> + err(EX_OSERR, "clock_gettime"); >> [snip] >>>> + st.start = tv.tv_sec + tv.tv_nsec * 1.0e-9; >>>> } > > The floating point addition starts losing precision after 8388608 > seconds (slightly more than 97 days, a plausible uptime for a server). > It is better to subtract the timespecs to avoid this issue. No, it is better to use floating point for results that only need to be approximate. Especially when the inputs are approximate and the final approximation doesn't need to be very accurate. Floating point is good for all timespec and timeval calculations, except in the kernel where it is unavailable. timespecs and timevals are mostly used for timeouts, and the kernel isn't very careful about exact timeouts. Short timeouts have inherent large inaccuracy due to interrupt granularity and latency. Long timeouts can be relatively more accurate, but only if the kernel is careful about them. It is only careful in some places. > With microseconds, the precision of a double is sufficient for 272 > years, so that calculation is probably acceptable. dd actually uses double, but float would be plenty. systat uses a mixture of float and double. double througout is better because using the smaller type float tends to give negative optimizations. devstat uses long double. That's really silly for statistics. On some arches, it is no different from double (so nothing can depend on extra precision from it). On sparc64, it is a negative optimization by a factor of hundreds. >> [snip] >> Even if nanosecond resolution isn't useful, monotonicity is. Nobody >> should be using a nonmonotonic clock just to measure durations. I >> started an audit of all of FreeBSD to look for other programs that use >> gettimeofday to measure durations. I haven't finished, but I've >> already found a lot, including xz, ping, hastd, fetch, systat, powerd, >> and others. I don't have time to fix them, though. Would you be >> interested, or do you know anyone else who would? > > I have a local patch for time(1). > > Whether the monotonic clock is right also depends on how long the > durations typically are. For very long durations, users might refer to > wall clocks and CLOCK_REALTIME may be more appropriate. Yes, monotonic clocks are often best, but there are many bugs in this area. The most relevant one is perhaps that CLOCK_MONOTONIC is only monotonic. It is unclear if standards require it to have any relation to actual time. In practice in FreeBSD, it gives the actual time that the system is up and is not suspended. It is thus especially unusable for setting alarm clocks in the morning since suspension overnight is more likely than at other times. Alarm clocks need to use real time anyway. nanosleep() is almost unusable for setting alarm clocks due to this problem, its bugs, and other reasons: - nanosleep() is specified to sleep on real time, but in FreeBSD it sleeps on monotonic time. clock_nanosleep() is specified to sleep on a specified clock id, but is not implemented in FreeBSD. - I don't see any way to use the broken nanosleep() for setting realtime alarms except to take short sleeps and check the real time on waking up. Kernel timer code does things like this internally, but not very accurately, and for nanosleep() its sleeps are not short enough to work and it checks the wrong clock id on waking up. - nanosleep() takes a relative time, so even a nanosleep() that sleeps on the correct clock id would be hard to use with an overnight timeout. You would have to know about daylight savings adjustments and either compensate for them up front or wake up an hour or 2 early to check for a switch. - there are some POSIX realtime functions that support sleeping on an arbitrary clock id, and also support sleeping until an absolute time. These are supported FreeBSD. I haven't actually used them. They are sloppy in different ways than older FreeBSD timer code (and not as up to date with the change to sbintime_t). They seem to be unaware of daylight savings and not use short enough sleeps to work across switches. - nanosleep() is specified to sleep in realtime. Actually more specifically, to use CLOCK_REALTIME for its clock id. But its interval is relative, so it is unclear even what this means. Taking averages over days has similar problems. They should probably use the monotonic system up time, not the system up time less the system suspension time. Due to the bug of not counting suspension time, using the real time clock is probably better. It may jump by up to about 1 hour across daylight savings switches, but that won't take it backwards, but the monotonic clock may fail to advance by much more than 1 hour. POSIX doesn't actually teh monotonic clock to fail to advance across suspsensions or for other reasons. From an old draft: % 6679 MON If the Monotonic Clock option is supported, all implementations shall support a clock_id of % 6680 CLOCK_MONOTONIC defined in . This clock represents the monotonic clock for the % 6681 system. For this clock, the value returned by clock_gettime( ) represents the amount of time (in % 6682 seconds and nanoseconds) since an unspecified point in the past (for example, system start-up % 6683 time, or the Epoch). This point does not change after system start-up time. The value of the Here "amount of time" is fuzzy, but clearly it should be in physical time and as accurate as possible. FreeBSD's implementation also breaks the "unspecified point in the past" by frobbing it to implement the real time. It is only unspecified in POSIX. In FreeBSD, you can see it using sysctl kern.boottime and indirectly using uptime(1). uptime (that is, w), has been changed to use CLOCK_UPTIME, and that gives some of the long-term timing bugs mentioned above. Suppose for example that the system booted at 1:00 am on a certain day. The boot time is whatever it is, and shouldn't change. It serves as the "unspecified point in the past". It is not affected by DST switches or by micro-adjustments using adjtime() or ntpd. However, suppose the clock drifts by 1 second and the real time is fixed up by stepping the clock. The real time becomes correct, but the monotonic time remains off by 1 second. This is implemented by stepping the boot time to 1:01 am or 0:59 am. The boot time becomes wrong too. CLOCK_UPTIME is the same as CLOCK_MONOTONIC, so it is also off by 1 second. This can be seen in uptime(1) output. The errors may accumulate. Of course, the monotonic clock cannot be stepped backwards. Stepping it foward wouldn't break it much more than leaving it off by 1 second forever. However, the only reasonably correct implementation is to micro-adjust it until it catches up with any steps in the realtime clock. Only do this for small adjustments. After suspension, it should be stepped forwards by a large amount. I think bad things happen to the boot time after suspension too. The real time must be stepped forward by a large amount, and doing that steps the boot time by a large amount. Similarly for booting if the realtime is initially local. It is stepped to make it UTC. This is confusing. It happens on my system, and sysctl kern.boottime shows the boot time apparently-correctly. But it is correct as a local time. The boot time is in UTC. sysctl doesn't translate to local time, so the apparently-correct time is actually off by the step (10 hours). Bugs in the boot time can be fixed more easily than by micro-adjusting the monotonic clock. Just keep the initial boot time (except adjust it when it was initially local instead of UTC) and frob the real time using a different variable. Export both variables so that applications can compensate for the frobbing at the cost of some complexity. E.g., in uptime(1): clock_gettime(CLOCK_UPTIME, &ts); /* * Actually, do the compensations in the kernel for CLOCK_UPTIME. * It doesn't need to be monotonic. But suppose it is the same * as the unfixed CLOCK_MONOTONIC and compensate here. * * Also fix the bogus variable name 'tp'. */ sysctl_mumble(&boottime); sysctl_mumble(&frobbed_boottime); uptime = ts.tv_sec +- (boottime.tv_sec - frobbed_boottime.tv_sec); Note that the compensation may go backwards, so this method doesn't work in general for monotonic times. However, it can be used if the compensation is non-negative or relatively small negative. dd could use this method. It already has to fix up for zero times and still has parts of the old method that fixes up for negative times. Note that the compensation may be very large across a suspension. You might start dd, SIGSTOP it, suspend the system and restart everything a day later. The compensation would be about 1 day. The average from this wouldn't be very useful, but it would be the same as if dd was stopped for a day but the system was not suspended. Bruce From owner-svn-src-head@FreeBSD.ORG Thu May 8 03:43:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6D127E0; Thu, 8 May 2014 03:43:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C40F6335; Thu, 8 May 2014 03:43:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s483hIFq062918; Thu, 8 May 2014 03:43:18 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s483hIpV062917; Thu, 8 May 2014 03:43:18 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405080343.s483hIpV062917@svn.freebsd.org> From: Mark Johnston Date: Thu, 8 May 2014 03:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265631 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 03:43:18 -0000 Author: markj Date: Thu May 8 03:43:18 2014 New Revision: 265631 URL: http://svnweb.freebsd.org/changeset/base/265631 Log: Re-apply r248644. This fixes an annoying problem which caused dtrace -c to fail to attach to stripped binaries. With the _r_debug_postinit symbol, dtrace(1) can now set a breakpoint in the victim process after it has registered its DOF table(s) with the kernel. r_debug_state cannot be used for this purpose since it is called before DOF is made available, in which case dtrace(1) cannot create USDT probes before the program begins execution. MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Thu May 8 03:33:54 2014 (r265630) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Thu May 8 03:43:18 2014 (r265631) @@ -1138,7 +1138,7 @@ alloc: #if defined(sun) dtp->dt_prcmode = DT_PROC_STOP_PREINIT; #else - dtp->dt_prcmode = DT_PROC_STOP_MAIN; + dtp->dt_prcmode = DT_PROC_STOP_POSTINIT; #endif dtp->dt_linkmode = DT_LINK_KERNEL; dtp->dt_linktype = DT_LTYP_ELF; From owner-svn-src-head@FreeBSD.ORG Thu May 8 04:31:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 834464C7; Thu, 8 May 2014 04:31:04 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 164948B1; Thu, 8 May 2014 04:31:03 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id CA7EF1041F64; Thu, 8 May 2014 14:30:52 +1000 (EST) Date: Thu, 8 May 2014 14:30:51 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Somers Subject: Re: svn commit: r265472 - head/bin/dd In-Reply-To: Message-ID: <20140508133943.K1439@besplex.bde.org> References: <201405062206.s46M6dxW060155@svn.freebsd.org> <20140507113345.B923@besplex.bde.org> <20140507202623.GA14233@stack.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=U6SrU4bu c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=LJiQtwaW0WEA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=0mq98zFbAAAA:8 a=aCotxLo4ST4bQJ_kP_gA:9 a=CjuIK1q_8ugA:10 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Bruce Evans , Jilles Tjoelker X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 04:31:04 -0000 On Wed, 7 May 2014, Alan Somers wrote: > On Wed, May 7, 2014 at 2:26 PM, Jilles Tjoelker wrote: >> The floating point addition starts losing precision after 8388608 >> seconds (slightly more than 97 days, a plausible uptime for a server). >> It is better to subtract the timespecs to avoid this issue. >> >> With microseconds, the precision of a double is sufficient for 272 >> years, so that calculation is probably acceptable. > > Good point. I'll fix it. BTW, FreeBSD does not have a timespecsub, > but I notice that NetBSD does. This seems like a good candidate to > import. > > http://netbsd.gw.com/cgi-bin/man-cgi?timespecsub++NetBSD-current Hrmph. This was intentionally left out in FreeBSD. Floating point works better. Unfortunately, floating point is unavailable in kernels, or was too slow, especially in 1980, so APIs use the not so good timespec and timeval APIs. Not to mention bintimes, sbintimes and struct tm. sbintime or just nanoseconds would be better if floating point is unavailable. struct tm is too bloated to be good for syscalls although not bloated enough to support sub-second times. FreeBSD does have the corresponding design errors for timeval APIs: timeradd(), etc. These are even documented, but in a wrong way as prototypes. They are actually unsafe macros spelled as if they are safe. Some of them could be functions, but timercmp() must be a macro. Design errors in them start with their names (timer* instead of tv*). has rather complicated ifdefs to keep these APIs in or out of the kernel. It already has timespecsub(), but limits it to the kernel. The efficiency of these functions is unimportant, and some like timevalsub() are extern functions in the kernel. This helps give the complicated ifdefs and confusing namespaces: - bintime_sub() is kernel inline - bintime_sub() is user inline (undocumented pollution) - bintime_sub() uses an extra underscore - the good name btsub() is not used - timevalsub() is kernel extern - timersub() is user macro (otherBSD compatibility cruft) - the good name tvsub() is not used. timersub() is an especially bad name for an API that handles timevals. timevals were intentionally left out of old versions of POSIX. POSIX invented timespecs instead. The old APIs using timevals couldn't be killed so easily, and POSIX eventually had to standardize them. POSIX also standardized many new timespec APIs. Then, just when the timevals could be killed better, the unnecessary APIs for manipulating them were introduced, though not in POSIX. The non-kernel versions of them have a name that is particularly when there is more than 1 timer struct. - timespecsub() is kernel macro - timespecsub() as user API is intentionally left out - the good name tssub() is not used. Parameter names and orders for these APIs are also inconsistent and mostly bad. In the macro timersub(), the parameters are (tvp, uvp, vvp). You might thing tvp is the target, but it is one of the sources. In the man page "prototype", they are (a, b, res). Slightly better, but now missing a 'p'. But 'p' is not missing in the man page for timerset() or timerclear(). The ordering with the target last is an old convention. bintime functions mostly but not always go the other way. Floating point is easier to use than these functions, except for conversion from floating point back to a timespec or timeval. That takes about 2 statements instead of 1 function call. It's just a bit inelegant to go through floating point when you start with timespecs and have to convert back to timespecs. Bruce From owner-svn-src-head@FreeBSD.ORG Thu May 8 07:17:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BE731F2; Thu, 8 May 2014 07:17:32 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 0C7C0867; Thu, 8 May 2014 07:17:31 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 322431044630; Thu, 8 May 2014 17:17:30 +1000 (EST) Date: Thu, 8 May 2014 17:17:29 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Somers Subject: Re: svn commit: r265472 - head/bin/dd In-Reply-To: Message-ID: <20140508143138.O1548@besplex.bde.org> References: <201405062206.s46M6dxW060155@svn.freebsd.org> <20140507113345.B923@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=U6SrU4bu c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=LJiQtwaW0WEA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=g_Y2XnwOqm0eHwlY9OAA:9 a=CjuIK1q_8ugA:10 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 07:17:32 -0000 On Wed, 7 May 2014, Alan Somers wrote: > On Tue, May 6, 2014 at 9:47 PM, Bruce Evans wrote: >> On Tue, 6 May 2014, Alan Somers wrote: This is about some minor details that I didn't reply to for later followups. >>> + if (clock_gettime(CLOCK_MONOTONIC_PRECISE, &tv)) >>> + err(EX_OSERR, "clock_gettime"); >>> + if (clock_getres(CLOCK_MONOTONIC_PRECISE, &tv_res)) >>> + err(EX_OSERR, "clock_getres"); >> >> >> clock_getres() is almost useless, and is useless here. It is broken >> as designed, since the precision may be less than 1 nanosecond but >> 1 nanosecond is the smallest positive representable value, but that >> is not a problem here since clock_gettime() also can't distinguish >> differences smaller than 1 nanosecond. > > Since it's reporting the clock resolution and not precision, and since > clock_gettime() only reports with 1ns resolution, I don't think it's a > problem for clock_getres to report with 1ns resolution too. I got most of the backwardness backwards. The syscall is clock_getres(), not clock_getprec(), and the variable name matches this. But what it returns is the precision. The resolution is just that of a timespec (1 nanosecond). No API is needed to report this. APIs are needed to report: - the precision. The API is misnamed clock_getres() - the granularity. This is the minimum time between successive measurements. It can be determined by actually doing some measurements. - the accuracy. No API is available For clocks based on timecounters, we use time timecounter clock period rounded up to nanoseconds for the precision. With a TSC, this is always 1 nanosecond above 1GHz. dd needs more like the granularity than the precision, but it doesn't really matter since the runtime must be much larger than the granularity for the statistics to be accurate, and usually is. >> The fixup is now only reachable in 3 cases that can't happen: >> - when the monotonic time goes backwards due to a kernel bug >> - when the monotonic time doesn't increase, so that the difference is 0. >> Oops, this can happen for timecounters with very low "precision". >> You don't need to know the "precision" to check for this. > > On my Xeon E5504 systems, I can see adjacent calls to clock_gettime > return equal values when using one of the _FAST clocks. It can't be > proven that this case will never happen with any other clock either, > so the program needs to handle it. Hrmph. This is either from the design error of the existence of the _FAST clocks, or from the design error of the existence of TSC-low. First, the _FAST clocks are only supposed to have a resolution of 1/hz. clock_getres() is quite broken here. It returns the timecounter precision for the _FAST clocks too. Also, if it returned 1/hz, then it would be inconsistent with the libc implementation of clock_gettime(). The latter gives gives the timecounter precision. TSC-low intentionally destroys the hardware TSC precision by right shifting, due to FUD and to handle a minor problem above 4GHz. The shift used to be excessive in most cases. On freefall it used to be about 7, so the precision of ~1/2.67 nsec was reduced to ~48 nsec. This was easy to see in tests programs for such things. Now the shift is just 1. Since 1<<1 is less than 2.67, the loss of precision from the shift is less than the loss of precision from converting from bintimes to timespecs. The shift is still a pessimization. sysctl has a read-only tunable kern.timecounter.tsc_shift. Use of this seems to be quite broken. The shift count is determined dynamically, and the tunable barely effects this. The active shift count is not written back to the tunable, so you can't see what it is easy. However, the shift count is now always 1 except in exceptional cases. The tunable defaults to 1. This is for CPU speeds between 2GHz and 4GHz to implement the support for the FUD at these speeds. Above 4GHz, the shift is increased to 2 without changing the tunable. Above 8GHz, the shift is increased to 3. That can't happen yet, but you can tune higher to get a higher shift count at lower speeds. You can also tune to 0 to avoid the shift up to 4GHz. The shift together with some fencing pessimizations that are not even done in the kernel version (only libc) is due to FUD. rdtsc is not a serializing instruction, so its direct use may give surprising results. I think it is serialized with respect to itself on the same CPU. It is obviously not serialized with respect to other instructions on the same CPU. So it doesn't work properly in code like "rdtsc; ; v++; rdtsc; " even with quite a bit more than v++ between the rdtsc's. Normally there is much more than v++ between rdtsc's so code like this works well in practice. When the rdtsc's are on separate CPUs, it is just a bug to depend on their order unless there are synchronization instructions for more than the rdtsc's. The old kernel code is sloppy about such things. It tries to do everything without atomic locking or mutexes. This mostly works, but I think it depends on the slowness of syscalls and locking in unrelated code for some corner cases. Syscalls put hundreds or thousands of instructions between successive timecounter hardware reads, so even if these reads are done on different CPUs the first one has had plenty of time to complete. Also, one CPU's TSC is acausal with respect to another's, the difference is hopefully a backwards step of at most a couple of cycles. This would be lost in the nose of the hundreds or thousands of cycles for the slow syscalls. Also, any context switch will do lots of locking operations that may synchronize the rdtscs. There is official FUD about some of these problems. An early "fix" was to shift the TSC count. I think this "works" just by breaking the precision of the counter enough for backwards steps to be invisible in most cases. A large shift count of 7 reduces the precision to 128 cycles. That should hide most problems. But I think it only works in about 127 of 128 problem cases if the problem is an acausality of 2 cycles. Suppose CPU1 reads the TSC at time 128 and sees 128, and CPU2 reads the TSC at time 129 and sees 127. CPU2 does the read later but sees an earlier time. I chose the times near a multiple of 128 so that even rounding to a multiple of 128 doesn't fix the problem. The current normal shift count of 1 hide so many problem cases. It can probably hide more than a few cycles of acausality since the shift instruction itself is so slow (several cycles). libc worries about the locking problems more than the kernel, and uses some fence instructions. Oops, these are in the kernel now. They are easier to see in the kernel too (they are spelled as *fence in asm there, but as rmb() in libc). Fence instructions don't serialize rdtsc, but may be needed for something. The rmb()'s in libc are replacements for atomic ops. Such locking operations are intentionally left out of the software parts of the kernel since the algorithm is supposed to work without them (it only clearly for UP in-order). However, the kernel now gets locking operations (mfence or lfence) in some TSC read functions, depending on the CPU (fences are mostly selected according to if the CPU supports SSE2; lfence is prefered, but mfence is used on AMD CPUs for some reason). There is lots of bloat to support this. libc only has the shifting pessimization. >> - when the monotonic time does increase, but by an amount smaller than >> the "precision". This indicates that the "precision" is wrong. We have the reverse bug that the precision is too small for the _FAST syscall case. The precision is adjusted to match the shifts. >> In the second case, fixing up to the "precision" may give a large >> estimate. The fixup might as well be to a nominal value like 1 >> nanosecond or 1 second. CLOCK_MONOTONIC can't have a very low >> precision, and the timing for runs that don't take as long as a >> large multiple of the precision is inaccurate. We could also >> report the result as in this case. > > The second case is the one I'm most concerned about. Assuming that > the precision is correct, clock_getres() seems like the best value for > the fixup. Anything less than the reported precision would be > unnecessarily small and give unnecessarily inaccurate results. > Anything greater would make an implicit and unportable assumption > about the speed of the hardware. Do you really think it's a problem > to fixup to clock_getres() ? And it is the case broken for the _FAST syscall case (except this case shouldn't exist, and dd doesn't use it). Then the time only changes every 1/hz seconds and the fixup converts differences of nearly 1/hz seconds (but 0 due to the granularity) to 1 nanosecond (for x86 with TSC). With hz = 1000, the error is a factor of 1000000. I would just use an arbitrary fixup. I think I pointed out that ping(8) doesn't worry about this. It just assumes that the precision of gettimeofday() is the same as its resolution (1 usec) and that no times of interest below 1 usec occur (not quite true, since ping latency is in the microseconds range and you can do very short tests using ping -fq -c1). >>> @@ -77,7 +83,7 @@ summary(void) >>> st.trunc, (st.trunc == 1) ? "block" : "blocks"); >>> if (!(ddflags & C_NOXFER)) { >>> (void)fprintf(stderr, >>> - "%ju bytes transferred in %.6f secs (%.0f >>> bytes/sec)\n", >>> + "%ju bytes transferred in %.9f secs (%.0f >>> bytes/sec)\n", >> >> >> nanoseconds resolution is excessive here, and changes the output format. >> The only use of it is to debug cases where the output is garbage due >> to the interval being about 1 nanosecond. Printing nanoseconds resolution >> is also inconsistent with the fussy "precision" adjustment above. > > The higher resolution printf doesn't conflict with the resolution > adjustment above. Freefall actually reports 1ns resolution. But I > can buy that it's not useful to the user. Would you like me to change > it back to %.6 ? Yes, just change back. %.6f is probably excessive to. 4.4BSD uses just seconds and %u. > Even if nanosecond resolution isn't useful, monotonicity is. Nobody > should be using a nonmonotonic clock just to measure durations. I > started an audit of all of FreeBSD to look for other programs that use > gettimeofday to measure durations. I haven't finished, but I've > already found a lot, including xz, ping, hastd, fetch, systat, powerd, > and others. I don't have time to fix them, though. Would you be > interested, or do you know anyone else who would? There are indeed a lot. Too many for me to fix :-). The problem is limited, since for short runs the realtime isn't stepped, and for long runs the real time may be more appropriate. Hmm, cron uses CLOCK_REALTIME, sleep(1 or 60) and nanosleep(at most 600), while crontab uses gettimeofday() and sleep(1). It has real problems that are hopefully mostly avoided by using short sleeps and special handling for minutes rollovers). Realtime is appropriate for it. It is unclear what time even sleep() gives. It should sleep on monotonic time that is not broken by suspension, but is too old for POSIX to say anything about that. POSIX mentions the old alarm() implementation. FreeBSD now implements it using nanosleep(), but nanosleep() is specified to sleep on CLOCK_REALTIME. Oops, I found some POSIX words that may allow not-so-bizarre behaviour for nanosleep(): from an old draft: % 6688 CS If the value of the CLOCK_REALTIME clock is set via clock_settime( ), the new value of the clock % 6689 shall be used to determine the time at which the system shall awaken a thread blocked on an % 6690 absolute clock_nanosleep( ) call based upon the CLOCK_REALTIME clock. If the absolute time % 6691 requested at the invocation of such a time service is before the new value of the clock, the call % 6692 shall return immediately as if the clock had reached the requested time normally. % 6693 Setting the value of the CLOCK_REALTIME clock via clock_settime( ) shall have no effect on any % 6694 thread that is blocked on a relative clock_nanosleep( ) call. Consequently, the call shall return % 6695 when the requested relative interval elapses, independently of the new or old value of the clock. So for clock_gettime(), even when the clock id is CLOCK_REALTIME, stepping the clock doesn't affect the interval. But It is now unclear on which clock the interval is measured. And what heppens for leap seconds where the clock is stepped by a non-POSIX method? For nanosleep(): % 26874 system. But, except for the case of being interrupted by a signal, the suspension time shall not be % 26875 less than the time specified by rqtp, as measured by the system clock, CLOCK_REALTIME. % 26876 The use of the nanosleep( ) function has no effect on the action or blockage of any signal. Here there is no mention of stepping the time, and no option to measure the time by a clock other that CLOCK_REALTIME. Does CLOCK_REALTIME "measure" the time across steps? Bruce From owner-svn-src-head@FreeBSD.ORG Thu May 8 07:17:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B415A335; Thu, 8 May 2014 07:17:50 +0000 (UTC) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3419786D; Thu, 8 May 2014 07:17:50 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 76D093C23AD; Thu, 8 May 2014 17:17:42 +1000 (EST) Date: Thu, 8 May 2014 17:17:42 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Somers Subject: Re: svn commit: r265472 - head/bin/dd In-Reply-To: Message-ID: <20140508171730.T1548@besplex.bde.org> References: <201405062206.s46M6dxW060155@svn.freebsd.org> <20140507113345.B923@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=U6SrU4bu c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=LJiQtwaW0WEA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=g_Y2XnwOqm0eHwlY9OAA:9 a=CjuIK1q_8ugA:10 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 07:17:50 -0000 On Wed, 7 May 2014, Alan Somers wrote: > On Tue, May 6, 2014 at 9:47 PM, Bruce Evans wrote: >> On Tue, 6 May 2014, Alan Somers wrote: This is about some minor details that I didn't reply to for later followups. >>> + if (clock_gettime(CLOCK_MONOTONIC_PRECISE, &tv)) >>> + err(EX_OSERR, "clock_gettime"); >>> + if (clock_getres(CLOCK_MONOTONIC_PRECISE, &tv_res)) >>> + err(EX_OSERR, "clock_getres"); >> >> >> clock_getres() is almost useless, and is useless here. It is broken >> as designed, since the precision may be less than 1 nanosecond but >> 1 nanosecond is the smallest positive representable value, but that >> is not a problem here since clock_gettime() also can't distinguish >> differences smaller than 1 nanosecond. > > Since it's reporting the clock resolution and not precision, and since > clock_gettime() only reports with 1ns resolution, I don't think it's a > problem for clock_getres to report with 1ns resolution too. I got most of the backwardness backwards. The syscall is clock_getres(), not clock_getprec(), and the variable name matches this. But what it returns is the precision. The resolution is just that of a timespec (1 nanosecond). No API is needed to report this. APIs are needed to report: - the precision. The API is misnamed clock_getres() - the granularity. This is the minimum time between successive measurements. It can be determined by actually doing some measurements. - the accuracy. No API is available For clocks based on timecounters, we use time timecounter clock period rounded up to nanoseconds for the precision. With a TSC, this is always 1 nanosecond above 1GHz. dd needs more like the granularity than the precision, but it doesn't really matter since the runtime must be much larger than the granularity for the statistics to be accurate, and usually is. >> The fixup is now only reachable in 3 cases that can't happen: >> - when the monotonic time goes backwards due to a kernel bug >> - when the monotonic time doesn't increase, so that the difference is 0. >> Oops, this can happen for timecounters with very low "precision". >> You don't need to know the "precision" to check for this. > > On my Xeon E5504 systems, I can see adjacent calls to clock_gettime > return equal values when using one of the _FAST clocks. It can't be > proven that this case will never happen with any other clock either, > so the program needs to handle it. Hrmph. This is either from the design error of the existence of the _FAST clocks, or from the design error of the existence of TSC-low. First, the _FAST clocks are only supposed to have a resolution of 1/hz. clock_getres() is quite broken here. It returns the timecounter precision for the _FAST clocks too. Also, if it returned 1/hz, then it would be inconsistent with the libc implementation of clock_gettime(). The latter gives gives the timecounter precision. TSC-low intentionally destroys the hardware TSC precision by right shifting, due to FUD and to handle a minor problem above 4GHz. The shift used to be excessive in most cases. On freefall it used to be about 7, so the precision of ~1/2.67 nsec was reduced to ~48 nsec. This was easy to see in tests programs for such things. Now the shift is just 1. Since 1<<1 is less than 2.67, the loss of precision from the shift is less than the loss of precision from converting from bintimes to timespecs. The shift is still a pessimization. sysctl has a read-only tunable kern.timecounter.tsc_shift. Use of this seems to be quite broken. The shift count is determined dynamically, and the tunable barely effects this. The active shift count is not written back to the tunable, so you can't see what it is easy. However, the shift count is now always 1 except in exceptional cases. The tunable defaults to 1. This is for CPU speeds between 2GHz and 4GHz to implement the support for the FUD at these speeds. Above 4GHz, the shift is increased to 2 without changing the tunable. Above 8GHz, the shift is increased to 3. That can't happen yet, but you can tune higher to get a higher shift count at lower speeds. You can also tune to 0 to avoid the shift up to 4GHz. The shift together with some fencing pessimizations that are not even done in the kernel version (only libc) is due to FUD. rdtsc is not a serializing instruction, so its direct use may give surprising results. I think it is serialized with respect to itself on the same CPU. It is obviously not serialized with respect to other instructions on the same CPU. So it doesn't work properly in code like "rdtsc; ; v++; rdtsc; " even with quite a bit more than v++ between the rdtsc's. Normally there is much more than v++ between rdtsc's so code like this works well in practice. When the rdtsc's are on separate CPUs, it is just a bug to depend on their order unless there are synchronization instructions for more than the rdtsc's. The old kernel code is sloppy about such things. It tries to do everything without atomic locking or mutexes. This mostly works, but I think it depends on the slowness of syscalls and locking in unrelated code for some corner cases. Syscalls put hundreds or thousands of instructions between successive timecounter hardware reads, so even if these reads are done on different CPUs the first one has had plenty of time to complete. Also, one CPU's TSC is acausal with respect to another's, the difference is hopefully a backwards step of at most a couple of cycles. This would be lost in the nose of the hundreds or thousands of cycles for the slow syscalls. Also, any context switch will do lots of locking operations that may synchronize the rdtscs. There is official FUD about some of these problems. An early "fix" was to shift the TSC count. I think this "works" just by breaking the precision of the counter enough for backwards steps to be invisible in most cases. A large shift count of 7 reduces the precision to 128 cycles. That should hide most problems. But I think it only works in about 127 of 128 problem cases if the problem is an acausality of 2 cycles. Suppose CPU1 reads the TSC at time 128 and sees 128, and CPU2 reads the TSC at time 129 and sees 127. CPU2 does the read later but sees an earlier time. I chose the times near a multiple of 128 so that even rounding to a multiple of 128 doesn't fix the problem. The current normal shift count of 1 hide so many problem cases. It can probably hide more than a few cycles of acausality since the shift instruction itself is so slow (several cycles). libc worries about the locking problems more than the kernel, and uses some fence instructions. Oops, these are in the kernel now. They are easier to see in the kernel too (they are spelled as *fence in asm there, but as rmb() in libc). Fence instructions don't serialize rdtsc, but may be needed for something. The rmb()'s in libc are replacements for atomic ops. Such locking operations are intentionally left out of the software parts of the kernel since the algorithm is supposed to work without them (it only clearly for UP in-order). However, the kernel now gets locking operations (mfence or lfence) in some TSC read functions, depending on the CPU (fences are mostly selected according to if the CPU supports SSE2; lfence is prefered, but mfence is used on AMD CPUs for some reason). There is lots of bloat to support this. libc only has the shifting pessimization. >> - when the monotonic time does increase, but by an amount smaller than >> the "precision". This indicates that the "precision" is wrong. We have the reverse bug that the precision is too small for the _FAST syscall case. The precision is adjusted to match the shifts. >> In the second case, fixing up to the "precision" may give a large >> estimate. The fixup might as well be to a nominal value like 1 >> nanosecond or 1 second. CLOCK_MONOTONIC can't have a very low >> precision, and the timing for runs that don't take as long as a >> large multiple of the precision is inaccurate. We could also >> report the result as in this case. > > The second case is the one I'm most concerned about. Assuming that > the precision is correct, clock_getres() seems like the best value for > the fixup. Anything less than the reported precision would be > unnecessarily small and give unnecessarily inaccurate results. > Anything greater would make an implicit and unportable assumption > about the speed of the hardware. Do you really think it's a problem > to fixup to clock_getres() ? And it is the case broken for the _FAST syscall case (except this case shouldn't exist, and dd doesn't use it). Then the time only changes every 1/hz seconds and the fixup converts differences of nearly 1/hz seconds (but 0 due to the granularity) to 1 nanosecond (for x86 with TSC). With hz = 1000, the error is a factor of 1000000. I would just use an arbitrary fixup. I think I pointed out that ping(8) doesn't worry about this. It just assumes that the precision of gettimeofday() is the same as its resolution (1 usec) and that no times of interest below 1 usec occur (not quite true, since ping latency is in the microseconds range and you can do very short tests using ping -fq -c1). >>> @@ -77,7 +83,7 @@ summary(void) >>> st.trunc, (st.trunc == 1) ? "block" : "blocks"); >>> if (!(ddflags & C_NOXFER)) { >>> (void)fprintf(stderr, >>> - "%ju bytes transferred in %.6f secs (%.0f >>> bytes/sec)\n", >>> + "%ju bytes transferred in %.9f secs (%.0f >>> bytes/sec)\n", >> >> >> nanoseconds resolution is excessive here, and changes the output format. >> The only use of it is to debug cases where the output is garbage due >> to the interval being about 1 nanosecond. Printing nanoseconds resolution >> is also inconsistent with the fussy "precision" adjustment above. > > The higher resolution printf doesn't conflict with the resolution > adjustment above. Freefall actually reports 1ns resolution. But I > can buy that it's not useful to the user. Would you like me to change > it back to %.6 ? Yes, just change back. %.6f is probably excessive to. 4.4BSD uses just seconds and %u. > Even if nanosecond resolution isn't useful, monotonicity is. Nobody > should be using a nonmonotonic clock just to measure durations. I > started an audit of all of FreeBSD to look for other programs that use > gettimeofday to measure durations. I haven't finished, but I've > already found a lot, including xz, ping, hastd, fetch, systat, powerd, > and others. I don't have time to fix them, though. Would you be > interested, or do you know anyone else who would? There are indeed a lot. Too many for me to fix :-). The problem is limited, since for short runs the realtime isn't stepped, and for long runs the real time may be more appropriate. Hmm, cron uses CLOCK_REALTIME, sleep(1 or 60) and nanosleep(at most 600), while crontab uses gettimeofday() and sleep(1). It has real problems that are hopefully mostly avoided by using short sleeps and special handling for minutes rollovers). Realtime is appropriate for it. It is unclear what time even sleep() gives. It should sleep on monotonic time that is not broken by suspension, but is too old for POSIX to say anything about that. POSIX mentions the old alarm() implementation. FreeBSD now implements it using nanosleep(), but nanosleep() is specified to sleep on CLOCK_REALTIME. Oops, I found some POSIX words that may allow not-so-bizarre behaviour for nanosleep(): from an old draft: % 6688 CS If the value of the CLOCK_REALTIME clock is set via clock_settime( ), the new value of the clock % 6689 shall be used to determine the time at which the system shall awaken a thread blocked on an % 6690 absolute clock_nanosleep( ) call based upon the CLOCK_REALTIME clock. If the absolute time % 6691 requested at the invocation of such a time service is before the new value of the clock, the call % 6692 shall return immediately as if the clock had reached the requested time normally. % 6693 Setting the value of the CLOCK_REALTIME clock via clock_settime( ) shall have no effect on any % 6694 thread that is blocked on a relative clock_nanosleep( ) call. Consequently, the call shall return % 6695 when the requested relative interval elapses, independently of the new or old value of the clock. So for clock_gettime(), even when the clock id is CLOCK_REALTIME, stepping the clock doesn't affect the interval. But It is now unclear on which clock the interval is measured. And what heppens for leap seconds where the clock is stepped by a non-POSIX method? For nanosleep(): % 26874 system. But, except for the case of being interrupted by a signal, the suspension time shall not be % 26875 less than the time specified by rqtp, as measured by the system clock, CLOCK_REALTIME. % 26876 The use of the nanosleep( ) function has no effect on the action or blockage of any signal. Here there is no mention of stepping the time, and no option to measure the time by a clock other that CLOCK_REALTIME. Does CLOCK_REALTIME "measure" the time across steps? Bruce From owner-svn-src-head@FreeBSD.ORG Thu May 8 11:56:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27BC7592; Thu, 8 May 2014 11:56:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13AE439D; Thu, 8 May 2014 11:56:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48Bu6KL076442; Thu, 8 May 2014 11:56:06 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48Bu6fo076440; Thu, 8 May 2014 11:56:06 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201405081156.s48Bu6fo076440@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Thu, 8 May 2014 11:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265666 - in head: sbin/route sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 11:56:07 -0000 Author: melifaro Date: Thu May 8 11:56:06 2014 New Revision: 265666 URL: http://svnweb.freebsd.org/changeset/base/265666 Log: Fix incorrect netmasks being passed via rtsock. Since radix has been ignoring sa_family in passed sockaddrs, no one ever has bothered filling valid sa_family in netmasks. Additionally, radix adjusts sa_len field in every netmask not to compare zero bytes at all. This leads us to rt_mask with sa_family of AF_UNSPEC (-1) and arbitrary sa_len field (0 for default route, for example). However, rtsock have been passing that rt_mask intact for ages, requiring all rtsock consumers to make ther own local hacks. We even have unfixed on in base: do `route -n monitor` in one window and issue `route -n get addr` for some directly-connected address. You will probably see the following: got message of size 304 on Thu May 8 15:06:06 2014 RTM_GET: Report Metrics: len 304, pid: 30493, seq 1, errno 0, flags: locks: inits: sockaddrs: 10.0.0.0 link#1 (255) ffff ffff ff em0:8.0.27.c5.29.d4 10.0.0.92 _________________^^^^^^^^^^^^^^^^^^ after the change: got message of size 312 on Thu May 8 15:44:07 2014 RTM_GET: Report Metrics: len 312, pid: 2895, seq 1, errno 0, flags: locks: inits: sockaddrs: 10.0.0.0 link#1 255.255.255.0 em0:8.0.27.c5.29.d4 10.0.0.92 _________________^^^^^^^^^^^^^^^^^^ Sponsored by: Yandex LLC MFC after: 1 month Modified: head/sbin/route/route.c head/sys/net/rtsock.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Thu May 8 08:37:32 2014 (r265665) +++ head/sbin/route/route.c Thu May 8 11:56:06 2014 (r265666) @@ -1727,8 +1727,6 @@ print_getmsg(struct rt_msghdr *rtm, int (sp[RTAX_IFP]->sa_family != AF_LINK || ((struct sockaddr_dl *)(void *)sp[RTAX_IFP])->sdl_nlen == 0)) sp[RTAX_IFP] = NULL; - if (sp[RTAX_DST] && sp[RTAX_NETMASK]) - sp[RTAX_NETMASK]->sa_family = sp[RTAX_DST]->sa_family; /* XXX */ if (sp[RTAX_DST]) (void)printf("destination: %s\n", routename(sp[RTAX_DST])); if (sp[RTAX_NETMASK]) Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Thu May 8 08:37:32 2014 (r265665) +++ head/sys/net/rtsock.c Thu May 8 11:56:06 2014 (r265666) @@ -162,6 +162,8 @@ static int sysctl_ifmalist(int af, struc static int route_output(struct mbuf *m, struct socket *so); static void rt_getmetrics(const struct rtentry *rt, struct rt_metrics *out); static void rt_dispatch(struct mbuf *, sa_family_t); +static struct sockaddr *rtsock_fix_netmask(struct sockaddr *dst, + struct sockaddr *smask, struct sockaddr_storage *dmask); static struct netisr_handler rtsock_nh = { .nh_name = "rtsock", @@ -520,8 +522,8 @@ route_output(struct mbuf *m, struct sock struct rtentry *rt = NULL; struct radix_node_head *rnh; struct rt_addrinfo info; -#ifdef INET6 struct sockaddr_storage ss; +#ifdef INET6 struct sockaddr_in6 *sin6; int i, rti_need_deembed = 0; #endif @@ -784,7 +786,8 @@ report: } info.rti_info[RTAX_DST] = rt_key(rt); info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; - info.rti_info[RTAX_NETMASK] = rt_mask(rt); + info.rti_info[RTAX_NETMASK] = rtsock_fix_netmask(rt_key(rt), + rt_mask(rt), &ss); info.rti_info[RTAX_GENMASK] = 0; if (rtm->rtm_addrs & (RTA_IFP | RTA_IFA)) { ifp = rt->rt_ifp; @@ -967,6 +970,25 @@ rt_xaddrs(caddr_t cp, caddr_t cplim, str } /* + * Fill in @dmask with valid netmask leaving original @smask + * intact. Mostly used with radix netmasks. + */ +static struct sockaddr * +rtsock_fix_netmask(struct sockaddr *dst, struct sockaddr *smask, + struct sockaddr_storage *dmask) +{ + if (dst == NULL || smask == NULL) + return (NULL); + + memset(dmask, 0, dst->sa_len); + memcpy(dmask, smask, smask->sa_len); + dmask->ss_len = dst->sa_len; + dmask->ss_family = dst->sa_family; + + return ((struct sockaddr *)dmask); +} + +/* * Used by the routing socket. */ static struct mbuf * @@ -1247,6 +1269,7 @@ rtsock_addrmsg(int cmd, struct ifaddr *i struct mbuf *m; struct ifa_msghdr *ifam; struct ifnet *ifp = ifa->ifa_ifp; + struct sockaddr_storage ss; if (V_route_cb.any_count == 0) return (0); @@ -1256,7 +1279,8 @@ rtsock_addrmsg(int cmd, struct ifaddr *i bzero((caddr_t)&info, sizeof(info)); info.rti_info[RTAX_IFA] = sa = ifa->ifa_addr; info.rti_info[RTAX_IFP] = ifp->if_addr->ifa_addr; - info.rti_info[RTAX_NETMASK] = ifa->ifa_netmask; + info.rti_info[RTAX_NETMASK] = rtsock_fix_netmask( + info.rti_info[RTAX_IFP], ifa->ifa_netmask, &ss); info.rti_info[RTAX_BRD] = ifa->ifa_dstaddr; if ((m = rt_msg1(ncmd, &info)) == NULL) return (ENOBUFS); @@ -1295,13 +1319,14 @@ rtsock_routemsg(int cmd, struct ifnet *i struct sockaddr *sa; struct mbuf *m; struct rt_msghdr *rtm; + struct sockaddr_storage ss; if (V_route_cb.any_count == 0) return (0); bzero((caddr_t)&info, sizeof(info)); - info.rti_info[RTAX_NETMASK] = rt_mask(rt); info.rti_info[RTAX_DST] = sa = rt_key(rt); + info.rti_info[RTAX_NETMASK] = rtsock_fix_netmask(sa, rt_mask(rt), &ss); info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; if ((m = rt_msg1(cmd, &info)) == NULL) return (ENOBUFS); @@ -1473,6 +1498,7 @@ sysctl_dumpentry(struct radix_node *rn, struct rtentry *rt = (struct rtentry *)rn; int error = 0, size; struct rt_addrinfo info; + struct sockaddr_storage ss; if (w->w_op == NET_RT_FLAGS && !(rt->rt_flags & w->w_arg)) return 0; @@ -1483,7 +1509,8 @@ sysctl_dumpentry(struct radix_node *rn, bzero((caddr_t)&info, sizeof(info)); info.rti_info[RTAX_DST] = rt_key(rt); info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; - info.rti_info[RTAX_NETMASK] = rt_mask(rt); + info.rti_info[RTAX_NETMASK] = rtsock_fix_netmask(rt_key(rt), + rt_mask(rt), &ss); info.rti_info[RTAX_GENMASK] = 0; if (rt->rt_ifp) { info.rti_info[RTAX_IFP] = rt->rt_ifp->if_addr->ifa_addr; @@ -1659,6 +1686,7 @@ sysctl_iflist(int af, struct walkarg *w) struct ifaddr *ifa; struct rt_addrinfo info; int len, error = 0; + struct sockaddr_storage ss; bzero((caddr_t)&info, sizeof(info)); IFNET_RLOCK_NOSLEEP(); @@ -1687,7 +1715,8 @@ sysctl_iflist(int af, struct walkarg *w) ifa->ifa_addr) != 0) continue; info.rti_info[RTAX_IFA] = ifa->ifa_addr; - info.rti_info[RTAX_NETMASK] = ifa->ifa_netmask; + info.rti_info[RTAX_NETMASK] = rtsock_fix_netmask( + ifa->ifa_addr, ifa->ifa_netmask, &ss); info.rti_info[RTAX_BRD] = ifa->ifa_dstaddr; error = rtsock_msg_buffer(RTM_NEWADDR, &info, w, &len); if (error != 0) @@ -1704,8 +1733,9 @@ sysctl_iflist(int af, struct walkarg *w) } } IF_ADDR_RUNLOCK(ifp); - info.rti_info[RTAX_IFA] = info.rti_info[RTAX_NETMASK] = - info.rti_info[RTAX_BRD] = NULL; + info.rti_info[RTAX_IFA] = NULL; + info.rti_info[RTAX_NETMASK] = NULL; + info.rti_info[RTAX_BRD] = NULL; } done: if (ifp != NULL) From owner-svn-src-head@FreeBSD.ORG Thu May 8 13:38:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 612879CB; Thu, 8 May 2014 13:38:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F22B72; Thu, 8 May 2014 13:38:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48DcU9p021688; Thu, 8 May 2014 13:38:30 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48DcUfp021687; Thu, 8 May 2014 13:38:30 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405081338.s48DcUfp021687@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 8 May 2014 13:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265680 - head/sys/dev/vt/hw/fb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 13:38:30 -0000 Author: ray Date: Thu May 8 13:38:29 2014 New Revision: 265680 URL: http://svnweb.freebsd.org/changeset/base/265680 Log: No need to assign fields required and checked on probe. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/hw/fb/vt_early_fb.c Modified: head/sys/dev/vt/hw/fb/vt_early_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_early_fb.c Thu May 8 13:31:01 2014 (r265679) +++ head/sys/dev/vt/hw/fb/vt_early_fb.c Thu May 8 13:38:29 2014 (r265680) @@ -291,13 +291,6 @@ vt_efb_init(struct vt_device *vd) /* Get pixel storage size. */ info->fb_bpp = info->fb_stride / info->fb_width * 8; - /* - * Early FB driver work with static window buffer 80x25, so reduce - * size to 640x480. - */ - info->fb_width = VT_FB_DEFAULT_WIDTH; - info->fb_height = VT_FB_DEFAULT_HEIGHT; - #ifdef FDT vt_efb_initialize(info, node); #else From owner-svn-src-head@FreeBSD.ORG Thu May 8 13:46:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1C3CD37; Thu, 8 May 2014 13:46:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF9EC14C; Thu, 8 May 2014 13:46:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48Dkaeh025719; Thu, 8 May 2014 13:46:36 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48DkaGF025715; Thu, 8 May 2014 13:46:36 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405081346.s48DkaGF025715@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 8 May 2014 13:46:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265681 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 13:46:37 -0000 Author: ray Date: Thu May 8 13:46:36 2014 New Revision: 265681 URL: http://svnweb.freebsd.org/changeset/base/265681 Log: Fix scrollback. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_buf.c head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_buf.c ============================================================================== --- head/sys/dev/vt/vt_buf.c Thu May 8 13:38:29 2014 (r265680) +++ head/sys/dev/vt/vt_buf.c Thu May 8 13:46:36 2014 (r265681) @@ -448,8 +448,9 @@ vtbuf_grow(struct vt_buf *vb, const term history_size = MAX(history_size, p->tp_row); - if (history_size > vb->vb_history_size || p->tp_col > - vb->vb_scr_size.tp_col) { + /* If new screen/history size bigger or buffer is VBF_STATIC. */ + if ((history_size > vb->vb_history_size) || (p->tp_col > + vb->vb_scr_size.tp_col) || (vb->vb_flags & VBF_STATIC)) { /* Allocate new buffer. */ bufsize = history_size * p->tp_col * sizeof(term_char_t); new = malloc(bufsize, M_VTBUF, M_WAITOK | M_ZERO); Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Thu May 8 13:38:29 2014 (r265680) +++ head/sys/dev/vt/vt_core.c Thu May 8 13:46:36 2014 (r265681) @@ -2016,6 +2016,10 @@ vt_upgrade(struct vt_device *vd) /* Start timer when everything ready. */ callout_reset(&vd->vd_timer, hz / VT_TIMERFREQ, vt_timer, vd); VT_UNLOCK(vd); + + /* Refill settings with new sizes. */ + vt_resize(vd); + } static void @@ -2090,9 +2094,6 @@ vt_allocate(struct vt_driver *drv, void vt_upgrade(vd); - /* Refill settings with new sizes. */ - vt_resize(vd); - #ifdef DEV_SPLASH if (vd->vd_flags & VDF_SPLASH) vtterm_splash(vd); From owner-svn-src-head@FreeBSD.ORG Thu May 8 13:54:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7AE5C50C; Thu, 8 May 2014 13:54:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67E5623E; Thu, 8 May 2014 13:54:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48DswRW029707; Thu, 8 May 2014 13:54:58 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48DswEp029706; Thu, 8 May 2014 13:54:58 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201405081354.s48DswEp029706@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Thu, 8 May 2014 13:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265682 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 13:54:58 -0000 Author: melifaro Date: Thu May 8 13:54:57 2014 New Revision: 265682 URL: http://svnweb.freebsd.org/changeset/base/265682 Log: Rename rt_msg1() to more handy rtsock_msg_mbuf(). (Just for history purposes: rt_msg2() was renamed to rtsock_msg_buffer() in r265019). Sponsored by: Yandex LLC MFC after: 1 month Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Thu May 8 13:46:36 2014 (r265681) +++ head/sys/net/rtsock.c Thu May 8 13:54:57 2014 (r265682) @@ -151,7 +151,7 @@ struct walkarg { }; static void rts_input(struct mbuf *m); -static struct mbuf *rt_msg1(int type, struct rt_addrinfo *rtinfo); +static struct mbuf *rtsock_msg_mbuf(int type, struct rt_addrinfo *rtinfo); static int rtsock_msg_buffer(int type, struct rt_addrinfo *rtinfo, struct walkarg *w, int *plen); static int rt_xaddrs(caddr_t cp, caddr_t cplim, @@ -989,10 +989,14 @@ rtsock_fix_netmask(struct sockaddr *dst, } /* - * Used by the routing socket. + * Writes information related to @rtinfo object to newly-allocated mbuf. + * Assumes MCLBYTES is enough to construct any message. + * Used for OS notifications of vaious events (if/ifa announces,etc) + * + * Returns allocated mbuf or NULL on failure. */ static struct mbuf * -rt_msg1(int type, struct rt_addrinfo *rtinfo) +rtsock_msg_mbuf(int type, struct rt_addrinfo *rtinfo) { struct rt_msghdr *rtm; struct mbuf *m; @@ -1204,7 +1208,7 @@ rt_missmsg_fib(int type, struct rt_addri if (V_route_cb.any_count == 0) return; - m = rt_msg1(type, rtinfo); + m = rtsock_msg_mbuf(type, rtinfo); if (m == NULL) return; @@ -1243,7 +1247,7 @@ rt_ifmsg(struct ifnet *ifp) if (V_route_cb.any_count == 0) return; bzero((caddr_t)&info, sizeof(info)); - m = rt_msg1(RTM_IFINFO, &info); + m = rtsock_msg_mbuf(RTM_IFINFO, &info); if (m == NULL) return; ifm = mtod(m, struct if_msghdr *); @@ -1282,7 +1286,7 @@ rtsock_addrmsg(int cmd, struct ifaddr *i info.rti_info[RTAX_NETMASK] = rtsock_fix_netmask( info.rti_info[RTAX_IFP], ifa->ifa_netmask, &ss); info.rti_info[RTAX_BRD] = ifa->ifa_dstaddr; - if ((m = rt_msg1(ncmd, &info)) == NULL) + if ((m = rtsock_msg_mbuf(ncmd, &info)) == NULL) return (ENOBUFS); ifam = mtod(m, struct ifa_msghdr *); ifam->ifam_index = ifp->if_index; @@ -1328,7 +1332,7 @@ rtsock_routemsg(int cmd, struct ifnet *i info.rti_info[RTAX_DST] = sa = rt_key(rt); info.rti_info[RTAX_NETMASK] = rtsock_fix_netmask(sa, rt_mask(rt), &ss); info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; - if ((m = rt_msg1(cmd, &info)) == NULL) + if ((m = rtsock_msg_mbuf(cmd, &info)) == NULL) return (ENOBUFS); rtm = mtod(m, struct rt_msghdr *); rtm->rtm_index = ifp->if_index; @@ -1370,7 +1374,7 @@ rt_newmaddrmsg(int cmd, struct ifmultiad * (similarly to how ARP entries, e.g., are presented). */ info.rti_info[RTAX_GATEWAY] = ifma->ifma_lladdr; - m = rt_msg1(cmd, &info); + m = rtsock_msg_mbuf(cmd, &info); if (m == NULL) return; ifmam = mtod(m, struct ifma_msghdr *); @@ -1391,7 +1395,7 @@ rt_makeifannouncemsg(struct ifnet *ifp, if (V_route_cb.any_count == 0) return NULL; bzero((caddr_t)info, sizeof(*info)); - m = rt_msg1(type, info); + m = rtsock_msg_mbuf(type, info); if (m != NULL) { ifan = mtod(m, struct if_announcemsghdr *); ifan->ifan_index = ifp->if_index; From owner-svn-src-head@FreeBSD.ORG Thu May 8 15:37:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1634C7E0; Thu, 8 May 2014 15:37:40 +0000 (UTC) Received: from mail-we0-x22d.google.com (mail-we0-x22d.google.com [IPv6:2a00:1450:400c:c03::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A84BE63; Thu, 8 May 2014 15:37:39 +0000 (UTC) Received: by mail-we0-f173.google.com with SMTP id u57so2678512wes.18 for ; Thu, 08 May 2014 08:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=c1VAbJ10lsFZ/1gy8p3w2gMMIK9AKR2EwZXzK75oRgA=; b=zRT24L402qaUgs0BRlBF9KnngtsK7Vyo+nfx5mmlpS33jmmqIglOk5lZ3VSoKfS1EA fB9HryZJiU3JditB1F5/Oqm3rjQNV8rRtd1fbeCd4YxtxEHh8/JCCx15HRj9xnE5lmOJ dhavdB5DMV5bONcYOAn4xtSfjajZER/wYIyYMJWp5n4WzIJwPmzdVp7dZlqBCj6zT0zi aKzZiVfBrH+x1WzjAAKmM9fAovk0dcAJe05M0YWdeWxY4wt69VfWnMyguXrfagy9Rxlm 7qc7XoH+vUpy6PtfH15QPv5zKDHAMX57Vb4pveKYX2u174H4Lfw1I5bG8RzbVbG5VDqv ihjA== MIME-Version: 1.0 X-Received: by 10.180.14.233 with SMTP id s9mr4066226wic.53.1399563457474; Thu, 08 May 2014 08:37:37 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.194.168.130 with HTTP; Thu, 8 May 2014 08:37:37 -0700 (PDT) In-Reply-To: <20140508111443.S1000@besplex.bde.org> References: <201405062206.s46M6dxW060155@svn.freebsd.org> <20140507113345.B923@besplex.bde.org> <20140507202623.GA14233@stack.nl> <20140508111443.S1000@besplex.bde.org> Date: Thu, 8 May 2014 09:37:37 -0600 X-Google-Sender-Auth: 8nRL954M4MwMJZh0djxcaEywkUo Message-ID: Subject: Re: svn commit: r265472 - head/bin/dd From: Alan Somers To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Alan Somers , Jilles Tjoelker X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 15:37:40 -0000 On Wed, May 7, 2014 at 9:39 PM, Bruce Evans wrote: > On Wed, 7 May 2014, Jilles Tjoelker wrote: > >> On Wed, May 07, 2014 at 12:10:31PM -0600, Alan Somers wrote: >>> >>> On Tue, May 6, 2014 at 9:47 PM, Bruce Evans wrote: >>>> >>>> On Tue, 6 May 2014, Alan Somers wrote: >>>>> >>>>> ... >>>>> >>>>> The solution is to use clock_gettime(2) with CLOCK_MONOTONIC_PRECISE >>>>> as >>>>> the >>>>> clock_id. That clock advances steadily, regardless of changes to the >>>>> system >>>>> clock. >>>>> ... >>>>> +#include >> >> >>>> Use of is a style bug. It is not used in BSD or KNF code >>>> like dd used to be. >> >> >>> sysexits.h is recommended by the err(3) man page. Is that >>> recommendation meant to apply selectively, or is it obsolete, or is >>> some sort of edit war being waged by man page authors? > > > Bug in the err(3) man page. Sort of an edit war. Just 2 FreeBSD > committers liked sysexits and used it in their code and added a > recommendation to use it in some man pages. But it has negative > advantages, and normal BSD programs don't use it. It has been > edited in and out of style(9). > > >> The recommendation for was incompletely removed, yes. > > > It is still in err(3), and sysexits(3) still justifies itself by > pointing to partly-removed words in style(9). > > err(3) is the last place that should recommend using sysexits. err() > gives a nice way of encouraging text descriptions for all exits. > With text descriptions, there is almost no need for cryptic numeric > exit codes. Only sets of programs that communicate a little status > in the exit code should use sysexits (or perhaps their own exit > codes, or certain standard exit codes like 126 or 127 for xargs and > some other utilities). Some of the uses of the standard exit codes > are even. I don't know of any utility except possibly sendmail that > documents that it uses sysexits enough for its exit codes to be > useful for more than a binary success/fail decision. Certainly not > dd after these changes. If its use of sysexits were documented, > then the documentation would say "dd uses sysexits to report 3 errors > that can't happen; otherwise, it uses the normal 2-state exit codes > (there is a macro for them. It expands to the concise but > grammatically challenged "exits 0 on success, and >0 if an error > occurs". Here ">0" standardises the usual sloppiness of not > distinguishing codes between 1 and 127). > > sysexits(3) now says: > > % DESCRIPTION > % According to style(9), it is not a good practice to call exit(3) with > % arbitrary values to indicate a failure condition when ending a > program. > % Instead, the pre-defined exit codes from sysexits should be used, so > the > % caller of the process can get a rough estimation about the failure > class > % without looking up the source code. > > but style(9) now says: > > % Exits should be 0 on success, or 1 on failure. > % % exit(0); /* > % * Avoid obvious comments such as > % * "Exit 0 on success." > % */ > % } > > The latter is not what I asked for either. In previous discussion > of this, I think we agreed to at least mention EXIT_SUCCESS and > EXIT_FAILURE, and possibly deprecate sysexits. > > This is a weakened version of the 4.4BSD style rules, which say: > > % /* > % * Exits should be 0 on success, and 1 on failure. Don't denote > % * all the possible exit points, using the integers 1 through 300. > % */ > % exit(0); /* Avoid obvious comments such as "Exit 0 on success." > */ > > The main point of this is to disallow cryptic undocumented exit statuses. > Recommending sysexits almost reverses this. It gives cryptic undocumented > error statuses that are not even easy to decrypt for programs. Programs > can look up sysexits, but without documentation there is no guarantee that > the encoding is according to sysexits. Actually documenting use of > sysexits would make it even more painful to use. > > >>> [snip] >>>>> >>>>> - st.start = tv.tv_sec + tv.tv_usec * 1e-6; >>>>> + if (clock_gettime(CLOCK_MONOTONIC_PRECISE, &tv)) >>>>> + err(EX_OSERR, "clock_gettime"); >>> >>> [snip] >>>>> >>>>> + st.start = tv.tv_sec + tv.tv_nsec * 1.0e-9; >>>>> } >> >> >> The floating point addition starts losing precision after 8388608 >> seconds (slightly more than 97 days, a plausible uptime for a server). >> It is better to subtract the timespecs to avoid this issue. > > > No, it is better to use floating point for results that only need to > be approximate. Especially when the inputs are approximate and the > final approximation doesn't need to be very accurate. > > Floating point is good for all timespec and timeval calculations, > except in the kernel where it is unavailable. timespecs and timevals > are mostly used for timeouts, and the kernel isn't very careful about > exact timeouts. Short timeouts have inherent large inaccuracy due > to interrupt granularity and latency. Long timeouts can be relatively > more accurate, but only if the kernel is careful about them. It is > only careful in some places. No, Jilles is right. The problem isn't that dd uses doubles; it's that dd converts longs to doubles _before_ subtracting the values. That causes rounding if the tv_sec values are large. If the implementation of CLOCK_MONOTONIC ever changed to measure time since the Epoch, or something similar, then the rounding error would be extremely significant. Better to subtract the timespecs, then convert to double. > > >> With microseconds, the precision of a double is sufficient for 272 >> years, so that calculation is probably acceptable. > > > dd actually uses double, but float would be plenty. systat uses a > mixture of float and double. double througout is better because > using the smaller type float tends to give negative optimizations. > devstat uses long double. That's really silly for statistics. > On some arches, it is no different from double (so nothing can > depend on extra precision from it). On sparc64, it is a negative > optimization by a factor of hundreds. > > >>> [snip] >>> Even if nanosecond resolution isn't useful, monotonicity is. Nobody >>> should be using a nonmonotonic clock just to measure durations. I >>> started an audit of all of FreeBSD to look for other programs that use >>> gettimeofday to measure durations. I haven't finished, but I've >>> already found a lot, including xz, ping, hastd, fetch, systat, powerd, >>> and others. I don't have time to fix them, though. Would you be >>> interested, or do you know anyone else who would? >> >> >> I have a local patch for time(1). >> >> Whether the monotonic clock is right also depends on how long the >> durations typically are. For very long durations, users might refer to >> wall clocks and CLOCK_REALTIME may be more appropriate. > > > Yes, monotonic clocks are often best, but there are many bugs in this > area. The most relevant one is perhaps that CLOCK_MONOTONIC is only > monotonic. It is unclear if standards require it to have any relation > to actual time. In practice in FreeBSD, it gives the actual time that > the system is up and is not suspended. It is thus especially unusable > for setting alarm clocks in the morning since suspension overnight is > more likely than at other times. Alarm clocks need to use real time > anyway. nanosleep() is almost unusable for setting alarm clocks due > to this problem, its bugs, and other reasons: > - nanosleep() is specified to sleep on real time, but in FreeBSD it sleeps > on monotonic time. clock_nanosleep() is specified to sleep on a > specified clock id, but is not implemented in FreeBSD. > - I don't see any way to use the broken nanosleep() for setting realtime > alarms except to take short sleeps and check the real time on waking > up. Kernel timer code does things like this internally, but not > very accurately, and for nanosleep() its sleeps are not short enough > to work and it checks the wrong clock id on waking up. > - nanosleep() takes a relative time, so even a nanosleep() that sleeps > on the correct clock id would be hard to use with an overnight timeout. > You would have to know about daylight savings adjustments and either > compensate for them up front or wake up an hour or 2 early to check > for a switch. > - there are some POSIX realtime functions that support sleeping on an > arbitrary clock id, and also support sleeping until an absolute > time. These are supported FreeBSD. I haven't actually used them. > They are sloppy in different ways than older FreeBSD timer code (and > not as up to date with the change to sbintime_t). They seem to be > unaware of daylight savings and not use short enough sleeps to work > across switches. > - nanosleep() is specified to sleep in realtime. Actually more > specifically, to use CLOCK_REALTIME for its clock id. But its interval > is relative, so it is unclear even what this means. > > Taking averages over days has similar problems. They should probably > use the monotonic system up time, not the system up time less the > system suspension time. Due to the bug of not counting suspension > time, using the real time clock is probably better. It may jump by > up to about 1 hour across daylight savings switches, but that won't > take it backwards, but the monotonic clock may fail to advance by > much more than 1 hour. > > POSIX doesn't actually teh monotonic clock to fail to advance across > suspsensions or for other reasons. From an old draft: > > % 6679 MON If the Monotonic Clock option is supported, all > implementations shall support a clock_id of > % 6680 CLOCK_MONOTONIC defined in . This clock > represents the monotonic clock for the > % 6681 system. For this clock, the value returned by > clock_gettime( ) represents the amount of time (in > % 6682 seconds and nanoseconds) since an unspecified point in > the past (for example, system start-up > % 6683 time, or the Epoch). This point does not change after > system start-up time. The value of the > > Here "amount of time" is fuzzy, but clearly it should be in physical time > and as accurate as possible. > > FreeBSD's implementation also breaks the "unspecified point in the past" > by frobbing it to implement the real time. It is only unspecified in > POSIX. In FreeBSD, you can see it using sysctl kern.boottime and > indirectly using uptime(1). uptime (that is, w), has been changed to > use CLOCK_UPTIME, and that gives some of the long-term timing bugs > mentioned above. Suppose for example that the system booted at 1:00 am > on a certain day. The boot time is whatever it is, and shouldn't > change. It serves as the "unspecified point in the past". It is not > affected by DST switches or by micro-adjustments using adjtime() or ntpd. > However, suppose the clock drifts by 1 second and the real time is fixed > up by stepping the clock. The real time becomes correct, but the monotonic > time remains off by 1 second. This is implemented by stepping the boot > time to 1:01 am or 0:59 am. The boot time becomes wrong too. CLOCK_UPTIME > is the same as CLOCK_MONOTONIC, so it is also off by 1 second. This can > be seen in uptime(1) output. The errors may accumulate. > > Of course, the monotonic clock cannot be stepped backwards. Stepping > it foward wouldn't break it much more than leaving it off by 1 second > forever. However, the only reasonably correct implementation is to > micro-adjust it until it catches up with any steps in the realtime > clock. Only do this for small adjustments. After suspension, it > should be stepped forwards by a large amount. > > I think bad things happen to the boot time after suspension too. The > real time must be stepped forward by a large amount, and doing that > steps the boot time by a large amount. > > Similarly for booting if the realtime is initially local. It is > stepped to make it UTC. This is confusing. It happens on my > system, and sysctl kern.boottime shows the boot time > apparently-correctly. But it is correct as a local time. The boot > time is in UTC. sysctl doesn't translate to local time, so the > apparently-correct time is actually off by the step (10 hours). > > Bugs in the boot time can be fixed more easily than by micro-adjusting > the monotonic clock. Just keep the initial boot time (except adjust it > when it was initially local instead of UTC) and frob the real time > using a different variable. Export both variables so that applications > can compensate for the frobbing at the cost of some complexity. E.g., > in uptime(1): > > clock_gettime(CLOCK_UPTIME, &ts); > /* > * Actually, do the compensations in the kernel for CLOCK_UPTIME. > * It doesn't need to be monotonic. But suppose it is the same > * as the unfixed CLOCK_MONOTONIC and compensate here. > * > * Also fix the bogus variable name 'tp'. > */ > sysctl_mumble(&boottime); > sysctl_mumble(&frobbed_boottime); > uptime = ts.tv_sec +- (boottime.tv_sec - frobbed_boottime.tv_sec); > > Note that the compensation may go backwards, so this method doesn't work > in general for monotonic times. However, it can be used if the compensation > is non-negative or relatively small negative. dd could use this method. > It already has to fix up for zero times and still has parts of the old > method that fixes up for negative times. Note that the compensation may > be very large across a suspension. You might start dd, SIGSTOP it, suspend > the system and restart everything a day later. The compensation would be > about 1 day. The average from this wouldn't be very useful, but it would > be the same as if dd was stopped for a day but the system was not suspended. Wouldn't it be simpler just for the kernel to adjust CLOCK_MONOTONIC to add suspension time? -Alan > > Bruce From owner-svn-src-head@FreeBSD.ORG Thu May 8 15:58:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED9F7261; Thu, 8 May 2014 15:58:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBB09C2; Thu, 8 May 2014 15:58:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48FwYdP082734; Thu, 8 May 2014 15:58:34 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48FwYoR082731; Thu, 8 May 2014 15:58:34 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405081558.s48FwYoR082731@svn.freebsd.org> From: Warner Losh Date: Thu, 8 May 2014 15:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265686 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 15:58:35 -0000 Author: imp Date: Thu May 8 15:58:34 2014 New Revision: 265686 URL: http://svnweb.freebsd.org/changeset/base/265686 Log: Add usr/share/mk/src.opts.mk to obsolete files. It never should have been installed in the first place, and it must be removed ASAP or weird build errors may start happening in the future if this file is ever taken from the installed system. Add note to UPDATING. Modified: head/ObsoleteFiles.inc head/UPDATING Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu May 8 15:33:52 2014 (r265685) +++ head/ObsoleteFiles.inc Thu May 8 15:58:34 2014 (r265686) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20140505: Bogusly installing src.opts.mk +OLD_FILES+=usr/share/mk/src.opts.mk # 20140505: Reject PR kern/187551 OLD_DIRS+=usr/tests/sbin/ifconfig OLD_FILES+=usr/tests/sbin/ifconfig/Kyuafile Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu May 8 15:33:52 2014 (r265685) +++ head/UPDATING Thu May 8 15:58:34 2014 (r265686) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20140508: + We bogusly installed src.opts.mk in /usr/share/mk. This file should + be removed to avoid issues in the future (and has been added to + ObsoleteFiles.inc). + 20140505: /etc/src.conf now affects only builds of the FreeBSD src tree. In the past, it affected all builds that used the bsd.*.mk files. The old From owner-svn-src-head@FreeBSD.ORG Thu May 8 16:59:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE6079BD; Thu, 8 May 2014 16:59:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EC53943; Thu, 8 May 2014 16:59:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48Gxbga013393; Thu, 8 May 2014 16:59:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48Gxaos013388; Thu, 8 May 2014 16:59:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405081659.s48Gxaos013388@svn.freebsd.org> From: Alexander Motin Date: Thu, 8 May 2014 16:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265689 - in head/cddl: compat/opensolaris/include compat/opensolaris/misc lib/libzfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 16:59:37 -0000 Author: mav Date: Thu May 8 16:59:36 2014 New Revision: 265689 URL: http://svnweb.freebsd.org/changeset/base/265689 Log: Import adapted OpenSolaris' thread pool API implementation. The thread pool is used by libzfs to implement parallel disk scanning. Without this change our dummy wrapper made `zpool import ZZZ` command to scan all disks sequentially from the single thread when searching for pools. This change makes it use two threads per CPU, same as in OpenSolaris. On system with 200 HDDs this change reduces ZFS pool import time from 35 to 22 seconds. Added: head/cddl/compat/opensolaris/misc/thread_pool.c (contents, props changed) head/cddl/compat/opensolaris/misc/thread_pool_impl.h (contents, props changed) Modified: head/cddl/compat/opensolaris/include/thread_pool.h head/cddl/lib/libzfs/Makefile Modified: head/cddl/compat/opensolaris/include/thread_pool.h ============================================================================== --- head/cddl/compat/opensolaris/include/thread_pool.h Thu May 8 16:26:36 2014 (r265688) +++ head/cddl/compat/opensolaris/include/thread_pool.h Thu May 8 16:59:36 2014 (r265689) @@ -1,39 +1,78 @@ -/*- - * Copyright (c) 2010 Pawel Jakub Dawidek - * All rights reserved. +/* + * CDDL HEADER START * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. + * 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. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * 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] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* * $FreeBSD$ */ -#ifndef _OPENSOLARIS_THREAD_POOL_H_ -#define _OPENSOLARIS_THREAD_POOL_H_ +#ifndef _THREAD_POOL_H_ +#define _THREAD_POOL_H_ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct tpool tpool_t; /* opaque thread pool descriptor */ + +#if defined(__STDC__) + +extern tpool_t *tpool_create(uint_t min_threads, uint_t max_threads, + uint_t linger, pthread_attr_t *attr); +extern int tpool_dispatch(tpool_t *tpool, + void (*func)(void *), void *arg); +extern void tpool_destroy(tpool_t *tpool); +extern void tpool_abandon(tpool_t *tpool); +extern void tpool_wait(tpool_t *tpool); +extern void tpool_suspend(tpool_t *tpool); +extern int tpool_suspended(tpool_t *tpool); +extern void tpool_resume(tpool_t *tpool); +extern int tpool_member(tpool_t *tpool); + +#else /* Non ANSI */ + +extern tpool_t *tpool_create(); +extern int tpool_dispatch(); +extern void tpool_destroy(); +extern void tpool_abandon(); +extern void tpool_wait(); +extern void tpool_suspend(); +extern int tpool_suspended(); +extern void tpool_resume(); +extern int tpool_member(); -typedef int tpool_t; +#endif /* __STDC__ */ -#define tpool_create(a, b, c, d) (0) -#define tpool_dispatch(pool, func, arg) func(arg) -#define tpool_wait(pool) do { } while (0) -#define tpool_destroy(pool) do { } while (0) +#ifdef __cplusplus +} +#endif -#endif /* !_OPENSOLARIS_THREAD_POOL_H_ */ +#endif /* _THREAD_POOL_H_ */ Added: head/cddl/compat/opensolaris/misc/thread_pool.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/compat/opensolaris/misc/thread_pool.c Thu May 8 16:59:36 2014 (r265689) @@ -0,0 +1,430 @@ +/* + * CDDL HEADER START + * + * 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] + * + * CDDL HEADER END + */ + +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include +__FBSDID("$FreeBSD$"); + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include +#include +#include +#include "thread_pool_impl.h" + +typedef void (*_Voidfp)(void*); /* pointer to extern "C" function */ + +static void +delete_pool(tpool_t *tpool) +{ + tpool_job_t *job; + + /* + * There should be no pending jobs, but just in case... + */ + for (job = tpool->tp_head; job != NULL; job = tpool->tp_head) { + tpool->tp_head = job->tpj_next; + free(job); + } + (void) pthread_attr_destroy(&tpool->tp_attr); + free(tpool); +} + +/* + * Worker thread is terminating. + */ +static void +worker_cleanup(void *arg) +{ + tpool_t *tpool = arg; + + if (--tpool->tp_current == 0 && + (tpool->tp_flags & (TP_DESTROY | TP_ABANDON))) { + if (tpool->tp_flags & TP_ABANDON) { + pthread_mutex_unlock(&tpool->tp_mutex); + delete_pool(tpool); + return; + } + if (tpool->tp_flags & TP_DESTROY) + (void) pthread_cond_broadcast(&tpool->tp_busycv); + } + pthread_mutex_unlock(&tpool->tp_mutex); +} + +static void +notify_waiters(tpool_t *tpool) +{ + if (tpool->tp_head == NULL && tpool->tp_active == NULL) { + tpool->tp_flags &= ~TP_WAIT; + (void) pthread_cond_broadcast(&tpool->tp_waitcv); + } +} + +/* + * Called by a worker thread on return from a tpool_dispatch()d job. + */ +static void +job_cleanup(void *arg) +{ + tpool_t *tpool = arg; + pthread_t my_tid = pthread_self(); + tpool_active_t *activep; + tpool_active_t **activepp; + + pthread_mutex_lock(&tpool->tp_mutex); + /* CSTYLED */ + for (activepp = &tpool->tp_active;; activepp = &activep->tpa_next) { + activep = *activepp; + if (activep->tpa_tid == my_tid) { + *activepp = activep->tpa_next; + break; + } + } + if (tpool->tp_flags & TP_WAIT) + notify_waiters(tpool); +} + +static void * +tpool_worker(void *arg) +{ + tpool_t *tpool = (tpool_t *)arg; + int elapsed; + tpool_job_t *job; + void (*func)(void *); + tpool_active_t active; + sigset_t maskset; + + pthread_mutex_lock(&tpool->tp_mutex); + pthread_cleanup_push(worker_cleanup, tpool); + + /* + * This is the worker's main loop. + * It will only be left if a timeout or an error has occured. + */ + active.tpa_tid = pthread_self(); + for (;;) { + elapsed = 0; + tpool->tp_idle++; + if (tpool->tp_flags & TP_WAIT) + notify_waiters(tpool); + while ((tpool->tp_head == NULL || + (tpool->tp_flags & TP_SUSPEND)) && + !(tpool->tp_flags & (TP_DESTROY | TP_ABANDON))) { + if (tpool->tp_current <= tpool->tp_minimum || + tpool->tp_linger == 0) { + (void) pthread_cond_wait(&tpool->tp_workcv, + &tpool->tp_mutex); + } else { + struct timespec timeout; + + clock_gettime(CLOCK_MONOTONIC, &timeout); + timeout.tv_sec += tpool->tp_linger; + if (pthread_cond_timedwait(&tpool->tp_workcv, + &tpool->tp_mutex, &timeout) != 0) { + elapsed = 1; + break; + } + } + } + tpool->tp_idle--; + if (tpool->tp_flags & TP_DESTROY) + break; + if (tpool->tp_flags & TP_ABANDON) { + /* can't abandon a suspended pool */ + if (tpool->tp_flags & TP_SUSPEND) { + tpool->tp_flags &= ~TP_SUSPEND; + (void) pthread_cond_broadcast(&tpool->tp_workcv); + } + if (tpool->tp_head == NULL) + break; + } + if ((job = tpool->tp_head) != NULL && + !(tpool->tp_flags & TP_SUSPEND)) { + elapsed = 0; + func = job->tpj_func; + arg = job->tpj_arg; + tpool->tp_head = job->tpj_next; + if (job == tpool->tp_tail) + tpool->tp_tail = NULL; + tpool->tp_njobs--; + active.tpa_next = tpool->tp_active; + tpool->tp_active = &active; + pthread_mutex_unlock(&tpool->tp_mutex); + pthread_cleanup_push(job_cleanup, tpool); + free(job); + /* + * Call the specified function. + */ + func(arg); + /* + * We don't know what this thread has been doing, + * so we reset its signal mask and cancellation + * state back to the initial values. + */ + sigfillset(&maskset); + (void) pthread_sigmask(SIG_SETMASK, &maskset, NULL); + (void) pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, + NULL); + (void) pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, + NULL); + pthread_cleanup_pop(1); + } + if (elapsed && tpool->tp_current > tpool->tp_minimum) { + /* + * We timed out and there is no work to be done + * and the number of workers exceeds the minimum. + * Exit now to reduce the size of the pool. + */ + break; + } + } + pthread_cleanup_pop(1); + return (arg); +} + +/* + * Create a worker thread, with all signals blocked. + */ +static int +create_worker(tpool_t *tpool) +{ + sigset_t maskset, oset; + pthread_t thread; + int error; + + sigfillset(&maskset); + (void) pthread_sigmask(SIG_SETMASK, &maskset, &oset); + error = pthread_create(&thread, &tpool->tp_attr, tpool_worker, tpool); + (void) pthread_sigmask(SIG_SETMASK, &oset, NULL); + return (error); +} + +tpool_t * +tpool_create(uint_t min_threads, uint_t max_threads, uint_t linger, + pthread_attr_t *attr) +{ + tpool_t *tpool; + int error; + + if (min_threads > max_threads || max_threads < 1) { + errno = EINVAL; + return (NULL); + } + + tpool = malloc(sizeof (*tpool)); + if (tpool == NULL) { + errno = ENOMEM; + return (NULL); + } + bzero(tpool, sizeof(*tpool)); + (void) pthread_mutex_init(&tpool->tp_mutex, NULL); + (void) pthread_cond_init(&tpool->tp_busycv, NULL); + (void) pthread_cond_init(&tpool->tp_workcv, NULL); + (void) pthread_cond_init(&tpool->tp_waitcv, NULL); + tpool->tp_minimum = min_threads; + tpool->tp_maximum = max_threads; + tpool->tp_linger = linger; + + /* make all pool threads be detached daemon threads */ + (void) pthread_attr_init(&tpool->tp_attr); + (void) pthread_attr_setdetachstate(&tpool->tp_attr, + PTHREAD_CREATE_DETACHED); + + return (tpool); +} + +/* + * Dispatch a work request to the thread pool. + * If there are idle workers, awaken one. + * Else, if the maximum number of workers has + * not been reached, spawn a new worker thread. + * Else just return with the job added to the queue. + */ +int +tpool_dispatch(tpool_t *tpool, void (*func)(void *), void *arg) +{ + tpool_job_t *job; + + if ((job = malloc(sizeof (*job))) == NULL) + return (-1); + bzero(job, sizeof(*job)); + job->tpj_next = NULL; + job->tpj_func = func; + job->tpj_arg = arg; + + pthread_mutex_lock(&tpool->tp_mutex); + + if (tpool->tp_head == NULL) + tpool->tp_head = job; + else + tpool->tp_tail->tpj_next = job; + tpool->tp_tail = job; + tpool->tp_njobs++; + + if (!(tpool->tp_flags & TP_SUSPEND)) { + if (tpool->tp_idle > 0) + (void) pthread_cond_signal(&tpool->tp_workcv); + else if (tpool->tp_current < tpool->tp_maximum && + create_worker(tpool) == 0) + tpool->tp_current++; + } + + pthread_mutex_unlock(&tpool->tp_mutex); + return (0); +} + +/* + * Assumes: by the time tpool_destroy() is called no one will use this + * thread pool in any way and no one will try to dispatch entries to it. + * Calling tpool_destroy() from a job in the pool will cause deadlock. + */ +void +tpool_destroy(tpool_t *tpool) +{ + tpool_active_t *activep; + + pthread_mutex_lock(&tpool->tp_mutex); + pthread_cleanup_push((_Voidfp)pthread_mutex_unlock, &tpool->tp_mutex); + + /* mark the pool as being destroyed; wakeup idle workers */ + tpool->tp_flags |= TP_DESTROY; + tpool->tp_flags &= ~TP_SUSPEND; + (void) pthread_cond_broadcast(&tpool->tp_workcv); + + /* cancel all active workers */ + for (activep = tpool->tp_active; activep; activep = activep->tpa_next) + (void) pthread_cancel(activep->tpa_tid); + + /* wait for all active workers to finish */ + while (tpool->tp_active != NULL) { + tpool->tp_flags |= TP_WAIT; + (void) pthread_cond_wait(&tpool->tp_waitcv, &tpool->tp_mutex); + } + + /* the last worker to terminate will wake us up */ + while (tpool->tp_current != 0) + (void) pthread_cond_wait(&tpool->tp_busycv, &tpool->tp_mutex); + + pthread_cleanup_pop(1); /* pthread_mutex_unlock(&tpool->tp_mutex); */ + delete_pool(tpool); +} + +/* + * Like tpool_destroy(), but don't cancel workers or wait for them to finish. + * The last worker to terminate will delete the pool. + */ +void +tpool_abandon(tpool_t *tpool) +{ + + pthread_mutex_lock(&tpool->tp_mutex); + if (tpool->tp_current == 0) { + /* no workers, just delete the pool */ + pthread_mutex_unlock(&tpool->tp_mutex); + delete_pool(tpool); + } else { + /* wake up all workers, last one will delete the pool */ + tpool->tp_flags |= TP_ABANDON; + tpool->tp_flags &= ~TP_SUSPEND; + (void) pthread_cond_broadcast(&tpool->tp_workcv); + pthread_mutex_unlock(&tpool->tp_mutex); + } +} + +/* + * Wait for all jobs to complete. + * Calling tpool_wait() from a job in the pool will cause deadlock. + */ +void +tpool_wait(tpool_t *tpool) +{ + + pthread_mutex_lock(&tpool->tp_mutex); + pthread_cleanup_push((_Voidfp)pthread_mutex_unlock, &tpool->tp_mutex); + while (tpool->tp_head != NULL || tpool->tp_active != NULL) { + tpool->tp_flags |= TP_WAIT; + (void) pthread_cond_wait(&tpool->tp_waitcv, &tpool->tp_mutex); + } + pthread_cleanup_pop(1); /* pthread_mutex_unlock(&tpool->tp_mutex); */ +} + +void +tpool_suspend(tpool_t *tpool) +{ + + pthread_mutex_lock(&tpool->tp_mutex); + tpool->tp_flags |= TP_SUSPEND; + pthread_mutex_unlock(&tpool->tp_mutex); +} + +int +tpool_suspended(tpool_t *tpool) +{ + int suspended; + + pthread_mutex_lock(&tpool->tp_mutex); + suspended = (tpool->tp_flags & TP_SUSPEND) != 0; + pthread_mutex_unlock(&tpool->tp_mutex); + + return (suspended); +} + +void +tpool_resume(tpool_t *tpool) +{ + int excess; + + pthread_mutex_lock(&tpool->tp_mutex); + if (!(tpool->tp_flags & TP_SUSPEND)) { + pthread_mutex_unlock(&tpool->tp_mutex); + return; + } + tpool->tp_flags &= ~TP_SUSPEND; + (void) pthread_cond_broadcast(&tpool->tp_workcv); + excess = tpool->tp_njobs - tpool->tp_idle; + while (excess-- > 0 && tpool->tp_current < tpool->tp_maximum) { + if (create_worker(tpool) != 0) + break; /* pthread_create() failed */ + tpool->tp_current++; + } + pthread_mutex_unlock(&tpool->tp_mutex); +} + +int +tpool_member(tpool_t *tpool) +{ + pthread_t my_tid = pthread_self(); + tpool_active_t *activep; + + pthread_mutex_lock(&tpool->tp_mutex); + for (activep = tpool->tp_active; activep; activep = activep->tpa_next) { + if (activep->tpa_tid == my_tid) { + pthread_mutex_unlock(&tpool->tp_mutex); + return (1); + } + } + pthread_mutex_unlock(&tpool->tp_mutex); + return (0); +} Added: head/cddl/compat/opensolaris/misc/thread_pool_impl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/compat/opensolaris/misc/thread_pool_impl.h Thu May 8 16:59:36 2014 (r265689) @@ -0,0 +1,99 @@ +/* + * CDDL HEADER START + * + * 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] + * + * CDDL HEADER END + */ + +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* + * $FreeBSD$ + */ + +#ifndef _THREAD_POOL_IMPL_H +#define _THREAD_POOL_IMPL_H + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Thread pool implementation definitions. + * See for interface declarations. + */ + +/* + * FIFO queued job + */ +typedef struct tpool_job tpool_job_t; +struct tpool_job { + tpool_job_t *tpj_next; /* list of jobs */ + void (*tpj_func)(void *); /* function to call */ + void *tpj_arg; /* its argument */ +}; + +/* + * List of active threads, linked through their stacks. + */ +typedef struct tpool_active tpool_active_t; +struct tpool_active { + tpool_active_t *tpa_next; /* list of active threads */ + pthread_t tpa_tid; /* active thread id */ +}; + +/* + * The thread pool. + */ +struct tpool { + tpool_t *tp_forw; /* circular list of all thread pools */ + tpool_t *tp_back; + mutex_t tp_mutex; /* protects the pool data */ + cond_t tp_busycv; /* synchronization in tpool_dispatch */ + cond_t tp_workcv; /* synchronization with workers */ + cond_t tp_waitcv; /* synchronization in tpool_wait() */ + tpool_active_t *tp_active; /* threads performing work */ + tpool_job_t *tp_head; /* FIFO job queue */ + tpool_job_t *tp_tail; + pthread_attr_t tp_attr; /* attributes of the workers */ + int tp_flags; /* see below */ + uint_t tp_linger; /* seconds before idle workers exit */ + int tp_njobs; /* number of jobs in job queue */ + int tp_minimum; /* minimum number of worker threads */ + int tp_maximum; /* maximum number of worker threads */ + int tp_current; /* current number of worker threads */ + int tp_idle; /* number of idle workers */ +}; + +/* tp_flags */ +#define TP_WAIT 0x01 /* waiting in tpool_wait() */ +#define TP_SUSPEND 0x02 /* pool is being suspended */ +#define TP_DESTROY 0x04 /* pool is being destroyed */ +#define TP_ABANDON 0x08 /* pool is abandoned (auto-destroy) */ + +#ifdef __cplusplus +} +#endif + +#endif /* _THREAD_POOL_IMPL_H */ Modified: head/cddl/lib/libzfs/Makefile ============================================================================== --- head/cddl/lib/libzfs/Makefile Thu May 8 16:26:36 2014 (r265688) +++ head/cddl/lib/libzfs/Makefile Thu May 8 16:59:36 2014 (r265689) @@ -14,6 +14,7 @@ SRCS= deviceid.c \ fsshare.c \ mkdirp.c \ mnttab.c \ + thread_pool.c \ zmount.c \ zone.c From owner-svn-src-head@FreeBSD.ORG Thu May 8 17:20:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3FCE8371; Thu, 8 May 2014 17:20:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 205C8B2D; Thu, 8 May 2014 17:20:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48HKjK2034673; Thu, 8 May 2014 17:20:45 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48HKjCM034671; Thu, 8 May 2014 17:20:45 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405081720.s48HKjCM034671@svn.freebsd.org> From: Ian Lepore Date: Thu, 8 May 2014 17:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265690 - head/sys/arm/xilinx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 17:20:46 -0000 Author: ian Date: Thu May 8 17:20:45 2014 New Revision: 265690 URL: http://svnweb.freebsd.org/changeset/base/265690 Log: Use edge-triggered interrupts rather than polling loops to avoid missing transitions of the INIT_B line. Also, release the mutex during uiomove(). Submitted by: Thomas Skibo Modified: head/sys/arm/xilinx/zy7_devcfg.c Modified: head/sys/arm/xilinx/zy7_devcfg.c ============================================================================== --- head/sys/arm/xilinx/zy7_devcfg.c Thu May 8 16:59:36 2014 (r265689) +++ head/sys/arm/xilinx/zy7_devcfg.c Thu May 8 17:20:45 2014 (r265690) @@ -267,24 +267,35 @@ zy7_devcfg_reset_pl(struct zy7_devcfg_so devcfg_ctl = RD4(sc, ZY7_DEVCFG_CTRL); + /* Clear sticky bits and set up INIT signal positive edge interrupt. */ + WR4(sc, ZY7_DEVCFG_INT_STATUS, ZY7_DEVCFG_INT_ALL); + WR4(sc, ZY7_DEVCFG_INT_MASK, ~ZY7_DEVCFG_INT_PCFG_INIT_PE); + /* Deassert PROG_B (active low). */ devcfg_ctl |= ZY7_DEVCFG_CTRL_PCFG_PROG_B; WR4(sc, ZY7_DEVCFG_CTRL, devcfg_ctl); - /* Wait for INIT_B deasserted (active low). */ - tries = 0; - while ((RD4(sc, ZY7_DEVCFG_STATUS) & - ZY7_DEVCFG_STATUS_PCFG_INIT) == 0) { - if (++tries >= 100) - return (EIO); - DELAY(5); + /* + * Wait for INIT to assert. If it is already asserted, we may not get + * an edge interrupt so cancel it and continue. + */ + if ((RD4(sc, ZY7_DEVCFG_STATUS) & + ZY7_DEVCFG_STATUS_PCFG_INIT) != 0) { + /* Already asserted. Cancel interrupt. */ + WR4(sc, ZY7_DEVCFG_INT_MASK, ~0); + } + else { + /* Wait for positive edge interrupt. */ + err = mtx_sleep(sc, &sc->sc_mtx, PCATCH, "zy7i1", hz); + if (err != 0) + return (err); } - - /* Reassert PROG_B. */ + + /* Reassert PROG_B (active low). */ devcfg_ctl &= ~ZY7_DEVCFG_CTRL_PCFG_PROG_B; WR4(sc, ZY7_DEVCFG_CTRL, devcfg_ctl); - /* Wait for INIT_B asserted. */ + /* Wait for INIT deasserted. This happens almost instantly. */ tries = 0; while ((RD4(sc, ZY7_DEVCFG_STATUS) & ZY7_DEVCFG_STATUS_PCFG_INIT) != 0) { @@ -293,7 +304,7 @@ zy7_devcfg_reset_pl(struct zy7_devcfg_so DELAY(5); } - /* Clear sticky bits and set up INIT_B positive edge interrupt. */ + /* Clear sticky bits and set up INIT positive edge interrupt. */ WR4(sc, ZY7_DEVCFG_INT_STATUS, ZY7_DEVCFG_INT_ALL); WR4(sc, ZY7_DEVCFG_INT_MASK, ~ZY7_DEVCFG_INT_PCFG_INIT_PE); @@ -301,11 +312,11 @@ zy7_devcfg_reset_pl(struct zy7_devcfg_so devcfg_ctl |= ZY7_DEVCFG_CTRL_PCFG_PROG_B; WR4(sc, ZY7_DEVCFG_CTRL, devcfg_ctl); - /* Wait for INIT_B deasserted indicating FPGA internal initialization - * is complete. This takes much longer than the previous waits for - * INIT_B transition (on the order of 700us). + /* + * Wait for INIT asserted indicating FPGA internal initialization + * is complete. */ - err = mtx_sleep(sc, &sc->sc_mtx, PCATCH, "zy7in", hz); + err = mtx_sleep(sc, &sc->sc_mtx, PCATCH, "zy7i2", hz); if (err != 0) return (err); @@ -404,7 +415,9 @@ zy7_devcfg_write(struct cdev *dev, struc /* uiomove the data from user buffer to our dma map. */ segsz = MIN(PAGE_SIZE, uio->uio_resid); + DEVCFG_SC_UNLOCK(sc); err = uiomove(dma_mem, segsz, uio); + DEVCFG_SC_LOCK(sc); if (err != 0) break; From owner-svn-src-head@FreeBSD.ORG Thu May 8 17:27:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D94D994C; Thu, 8 May 2014 17:27:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6EDCC08; Thu, 8 May 2014 17:27:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48HRkla056079; Thu, 8 May 2014 17:27:46 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48HRkiT056077; Thu, 8 May 2014 17:27:46 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201405081727.s48HRkiT056077@svn.freebsd.org> From: Michael Tuexen Date: Thu, 8 May 2014 17:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265691 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 17:27:46 -0000 Author: tuexen Date: Thu May 8 17:27:46 2014 New Revision: 265691 URL: http://svnweb.freebsd.org/changeset/base/265691 Log: For some UDP packets (for example with 200 byte payload) and IP options, the IP header and the UDP header are not in the same mbuf. Add code to in_delayed_cksum() to deal with this case. MFC after: 3 days Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Thu May 8 17:20:45 2014 (r265690) +++ head/sys/netinet/ip_output.c Thu May 8 17:27:46 2014 (r265691) @@ -887,15 +887,23 @@ in_delayed_cksum(struct mbuf *m) csum = 0xffff; offset += m->m_pkthdr.csum_data; /* checksum offset */ + /* find the mbuf in the chain where the checksum starts*/ + while ((m != NULL) && (offset >= m->m_len)) { + offset -= m->m_len; + m = m->m_next; + } + if (m == NULL) { + /* This should not happen. */ + printf("in_delayed_cksum(): checksum outside mbuf chain.\n"); + return; + } if (offset + sizeof(u_short) > m->m_len) { - printf("delayed m_pullup, m->len: %d off: %d p: %d\n", - m->m_len, offset, ip->ip_p); /* * XXX - * this shouldn't happen, but if it does, the - * correct behavior may be to insert the checksum - * in the appropriate next mbuf in the chain. + * This should not happen, but if it does, it might make more + * sense to fix the caller than to add code to split it here. */ + printf("in_delayed_cksum(): checksum split between mbufs.\n"); return; } *(u_short *)(m->m_data + offset) = csum; From owner-svn-src-head@FreeBSD.ORG Thu May 8 17:45:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78076264; Thu, 8 May 2014 17:45:26 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 23AABDA5; Thu, 8 May 2014 17:45:25 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 55441D6455F; Fri, 9 May 2014 03:45:18 +1000 (EST) Date: Fri, 9 May 2014 03:45:17 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Somers Subject: Re: svn commit: r265472 - head/bin/dd In-Reply-To: Message-ID: <20140509023225.A3651@besplex.bde.org> References: <201405062206.s46M6dxW060155@svn.freebsd.org> <20140507113345.B923@besplex.bde.org> <20140507202623.GA14233@stack.nl> <20140508111443.S1000@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eojmkOZX c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=LJiQtwaW0WEA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=m8AT1P5qA7dGg_VJnPoA:9 a=CjuIK1q_8ugA:10 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Jilles Tjoelker , Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 17:45:26 -0000 On Thu, 8 May 2014, Alan Somers wrote: > On Wed, May 7, 2014 at 9:39 PM, Bruce Evans wrote: >> On Wed, 7 May 2014, Jilles Tjoelker wrote: >> >>> On Wed, May 07, 2014 at 12:10:31PM -0600, Alan Somers wrote: >>>> >>>> On Tue, May 6, 2014 at 9:47 PM, Bruce Evans wrote: >>>>> >>>>> On Tue, 6 May 2014, Alan Somers wrote: >>>> [snip] >>>>>> >>>>>> + st.start = tv.tv_sec + tv.tv_nsec * 1.0e-9; >>>>>> } >>> >>> >>> The floating point addition starts losing precision after 8388608 >>> seconds (slightly more than 97 days, a plausible uptime for a server). >>> It is better to subtract the timespecs to avoid this issue. >> >> No, it is better to use floating point for results that only need to >> be approximate. Especially when the inputs are approximate and the >> final approximation doesn't need to be very accurate. >> >> Floating point is good for all timespec and timeval calculations, >> except in the kernel where it is unavailable. timespecs and timevals >> are mostly used for timeouts, and the kernel isn't very careful about >> exact timeouts. Short timeouts have inherent large inaccuracy due >> to interrupt granularity and latency. Long timeouts can be relatively >> more accurate, but only if the kernel is careful about them. It is >> only careful in some places. > > No, Jilles is right. The problem isn't that dd uses doubles; it's > that dd converts longs to doubles _before_ subtracting the values. > That causes rounding if the tv_sec values are large. If the > implementation of CLOCK_MONOTONIC ever changed to measure time since > the Epoch, or something similar, then the rounding error would be > extremely significant. Better to subtract the timespecs, then convert > to double. Nowhere near a problem. Conversion from long to double is exact up to 2**53 seconds or 285 megayears. So it works for seconds since the POSIX Epoch although not for seconds since the big bang. It would be a problem for floats. Actually, I didn't notice the fragile conversion order. >>> With microseconds, the precision of a double is sufficient for 272 >>> years, so that calculation is probably acceptable. Actually 285 years. A measly 0.285 years in nanoseconds before exactness is lost. The subtraction problem also affects tv_nsec, but is not very serious since it wouldn't hurt to ignore the nanoseconds part of a runtime of 0.285 years. We are 54 years from the Epoch now. That is a bit more than 0.285, so we lose a significant part of the nanoseconds precision. But we get microseconds precision for 285 years since the Epoch. About 5 times that now. >> ... >> Bugs in the boot time can be fixed more easily than by micro-adjusting >> the monotonic clock. Just keep the initial boot time (except adjust it >> when it was initially local instead of UTC) and frob the real time >> using a different variable. Export both variables so that applications >> can compensate for the frobbing at the cost of some complexity. E.g., >> in uptime(1): >> >> clock_gettime(CLOCK_UPTIME, &ts); >> /* >> * Actually, do the compensations in the kernel for CLOCK_UPTIME. >> * It doesn't need to be monotonic. But suppose it is the same >> * as the unfixed CLOCK_MONOTONIC and compensate here. >> * >> * Also fix the bogus variable name 'tp'. >> */ >> sysctl_mumble(&boottime); >> sysctl_mumble(&frobbed_boottime); >> uptime = ts.tv_sec +- (boottime.tv_sec - frobbed_boottime.tv_sec); >> >> Note that the compensation may go backwards, so this method doesn't work >> in general for monotonic times. However, it can be used if the compensation >> is non-negative or relatively small negative. dd could use this method. >> It already has to fix up for zero times and still has parts of the old >> method that fixes up for negative times. Note that the compensation may >> be very large across a suspension. You might start dd, SIGSTOP it, suspend >> the system and restart everything a day later. The compensation would be >> about 1 day. The average from this wouldn't be very useful, but it would >> be the same as if dd was stopped for a day but the system was not suspended. > > Wouldn't it be simpler just for the kernel to adjust CLOCK_MONOTONIC > to add suspension time? That works for forward jumps like ones for suspension. BTW, I do a similar adjustment for "suspension" that is actually sitting in ddb. I only step the real time. My accuracy is better than 10 ppm. Good enough for an ntp server. The stepping is done in rtcintr() on seconds rollover interrupts 3 seconds after ddb has exited and remained inactive, occurding to measurements made every 64 seconds rollover interrupt (the delay is to prevent adjustments while single stepping). Nothing much notices this stepping, but for monotonic time you have to do something about scheduled timeouts. Strictly, stepping the monotonic clock forward by a lot should cause many timeouts to expire. This is the correct behaviour, but it won't happen automatially, and it would cause thundering herds. Cron should have similar scheduling problems after the realtime clock is stepped, but I don't use it much. Bruce From owner-svn-src-head@FreeBSD.ORG Thu May 8 18:36:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A98EE4C; Thu, 8 May 2014 18:36:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 270C2279; Thu, 8 May 2014 18:36:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48IahXY060214; Thu, 8 May 2014 18:36:43 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48IagNn060190; Thu, 8 May 2014 18:36:42 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405081836.s48IagNn060190@svn.freebsd.org> From: Ian Lepore Date: Thu, 8 May 2014 18:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265694 - in head/sys/arm: arm mv/armadaxp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 18:36:43 -0000 Author: ian Date: Thu May 8 18:36:42 2014 New Revision: 265694 URL: http://svnweb.freebsd.org/changeset/base/265694 Log: Move the mptramp code which is specific to the Marvell ArmadaXP SoC out of the common locore.S file and into the mv/armadaxp directory. Added: head/sys/arm/mv/armadaxp/mptramp.S (contents, props changed) Modified: head/sys/arm/arm/locore.S head/sys/arm/mv/armadaxp/files.armadaxp Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Thu May 8 18:09:32 2014 (r265693) +++ head/sys/arm/arm/locore.S Thu May 8 18:36:42 2014 (r265694) @@ -349,52 +349,9 @@ pagetable: .word _C_LABEL(cpufuncs) #if defined(SMP) -Lsramaddr: - .word 0xffff0080 - -#if 0 -#define AP_DEBUG(tmp) \ - mrc p15, 0, r1, c0, c0, 5; \ - ldr r0, Lsramaddr; \ - add r0, r1, lsl #2; \ - mov r1, tmp; \ - str r1, [r0], #0x0000; -#else -#define AP_DEBUG(tmp) -#endif - - -ASENTRY_NP(mptramp) - mov r0, #0 - mcr p15, 0, r0, c7, c7, 0 - - AP_DEBUG(#1) - - mrs r3, cpsr - bic r3, r3, #(PSR_MODE) - orr r3, r3, #(PSR_SVC32_MODE) - msr cpsr_fsxc, r3 - - mrc p15, 0, r0, c0, c0, 5 - and r0, #0x0f /* Get CPU ID */ - - /* Read boot address for CPU */ - mov r1, #0x100 - mul r2, r0, r1 - ldr r1, Lpmureg - add r0, r2, r1 - ldr r1, [r0], #0x00 - - mov pc, r1 - -Lpmureg: - .word 0xd0022124 -END(mptramp) ASENTRY_NP(mpentry) - AP_DEBUG(#2) - /* Make sure interrupts are disabled. */ mrs r7, cpsr orr r7, r7, #(I32_bit|F32_bit) @@ -417,8 +374,6 @@ ASENTRY_NP(mpentry) nop nop - AP_DEBUG(#3) - Ltag: ldr r0, Lstartup_pagetable_secondary bic r0, r0, #0xf0000000 @@ -435,8 +390,6 @@ Ltag: mcr p15, 0, r0, c13, c0, 1 /* Set ASID to 0 */ #endif - AP_DEBUG(#4) - /* Set the Domain Access register. Very important! */ mov r0, #((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT) mcr p15, 0, r0, c3, c0, 0 Modified: head/sys/arm/mv/armadaxp/files.armadaxp ============================================================================== --- head/sys/arm/mv/armadaxp/files.armadaxp Thu May 8 18:09:32 2014 (r265693) +++ head/sys/arm/mv/armadaxp/files.armadaxp Thu May 8 18:36:42 2014 (r265694) @@ -4,3 +4,5 @@ arm/mv/armadaxp/armadaxp.c standard arm/mv/mpic.c standard arm/mv/rtc.c standard arm/mv/armadaxp/armadaxp_mp.c optional smp +arm/mv/armadaxp/mptramp.S optional smp + Added: head/sys/arm/mv/armadaxp/mptramp.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/mv/armadaxp/mptramp.S Thu May 8 18:36:42 2014 (r265694) @@ -0,0 +1,56 @@ +/*- + * Copyright 2011 Semihalf + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +__FBSDID("$FreeBSD$"); + +ASENTRY_NP(mptramp) + mov r0, #0 + mcr p15, 0, r0, c7, c7, 0 + + mrs r3, cpsr + bic r3, r3, #(PSR_MODE) + orr r3, r3, #(PSR_SVC32_MODE) + msr cpsr_fsxc, r3 + + mrc p15, 0, r0, c0, c0, 5 + and r0, #0x0f /* Get CPU ID */ + + /* Read boot address for CPU */ + mov r1, #0x100 + mul r2, r0, r1 + ldr r1, Lpmureg + add r0, r2, r1 + ldr r1, [r0], #0x00 + + mov pc, r1 + +Lpmureg: + .word 0xd0022124 +END(mptramp) + From owner-svn-src-head@FreeBSD.ORG Thu May 8 19:10:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE1B4CFC; Thu, 8 May 2014 19:10:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B639824; Thu, 8 May 2014 19:10:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48JA5aw055384; Thu, 8 May 2014 19:10:05 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48JA5Us055372; Thu, 8 May 2014 19:10:05 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201405081910.s48JA5Us055372@svn.freebsd.org> From: Alan Somers Date: Thu, 8 May 2014 19:10:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265698 - head/bin/dd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 19:10:05 -0000 Author: asomers Date: Thu May 8 19:10:04 2014 New Revision: 265698 URL: http://svnweb.freebsd.org/changeset/base/265698 Log: Incorporate feedback from bde and jilles regarding r265472 to dd(1). * Don't use sysexits.h. Just exit 1 on error and 0 otherwise. * Don't sacrifice precision by converting the output of clock_gettime() to a double and then comparing the results. Instead, subtract the values of the two clock_gettime() calls, then convert to double. * Don't use CLOCK_MONOTONIC_PRECISE. It's an unportable synonym for CLOCK_MONOTONIC. * Use more appropriate names for some local variables. * In the summary message, round elapsed time to the nearest microsecond. Reported by: bde, jilles MFC after: 3 days X-MFC-With: 265472 Modified: head/bin/dd/dd.c head/bin/dd/dd.h head/bin/dd/misc.c Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Thu May 8 19:08:07 2014 (r265697) +++ head/bin/dd/dd.c Thu May 8 19:10:04 2014 (r265698) @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -126,7 +125,6 @@ static void setup(void) { u_int cnt; - struct timespec tv; if (in.name == NULL) { in.name = "stdin"; @@ -245,9 +243,8 @@ setup(void) ctab = casetab; } - if (clock_gettime(CLOCK_MONOTONIC_PRECISE, &tv)) - err(EX_OSERR, "clock_gettime"); - st.start = tv.tv_sec + tv.tv_nsec * 1.0e-9; + if (clock_gettime(CLOCK_MONOTONIC, &st.start)) + err(1, "clock_gettime"); } static void Modified: head/bin/dd/dd.h ============================================================================== --- head/bin/dd/dd.h Thu May 8 19:08:07 2014 (r265697) +++ head/bin/dd/dd.h Thu May 8 19:10:04 2014 (r265698) @@ -64,7 +64,7 @@ typedef struct { uintmax_t trunc; /* # of truncated records */ uintmax_t swab; /* # of odd-length swab blocks */ uintmax_t bytes; /* # of bytes written */ - double start; /* start time of dd */ + struct timespec start; /* start time of dd */ } STAT; /* Flags (in ddflags). */ Modified: head/bin/dd/misc.c ============================================================================== --- head/bin/dd/misc.c Thu May 8 19:08:07 2014 (r265697) +++ head/bin/dd/misc.c Thu May 8 19:10:04 2014 (r265698) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -58,18 +57,19 @@ __FBSDID("$FreeBSD$"); void summary(void) { - struct timespec tv, tv_res; + struct timespec end, ts_res; double secs, res; if (ddflags & C_NOINFO) return; - if (clock_gettime(CLOCK_MONOTONIC_PRECISE, &tv)) - err(EX_OSERR, "clock_gettime"); - if (clock_getres(CLOCK_MONOTONIC_PRECISE, &tv_res)) - err(EX_OSERR, "clock_getres"); - secs = tv.tv_sec + tv.tv_nsec * 1.0e-9 - st.start; - res = tv_res.tv_sec + tv_res.tv_nsec * 1.0e-9; + if (clock_gettime(CLOCK_MONOTONIC, &end)) + err(1, "clock_gettime"); + if (clock_getres(CLOCK_MONOTONIC, &ts_res)) + err(1, "clock_getres"); + secs = (end.tv_sec - st.start.tv_sec) + \ + (end.tv_nsec - st.start.tv_nsec) * 1e-9; + res = ts_res.tv_sec + ts_res.tv_nsec * 1e-9; if (secs < res) secs = res; (void)fprintf(stderr, @@ -83,7 +83,7 @@ summary(void) st.trunc, (st.trunc == 1) ? "block" : "blocks"); if (!(ddflags & C_NOXFER)) { (void)fprintf(stderr, - "%ju bytes transferred in %.9f secs (%.0f bytes/sec)\n", + "%ju bytes transferred in %.6f secs (%.0f bytes/sec)\n", st.bytes, secs, st.bytes / secs); } need_summary = 0; From owner-svn-src-head@FreeBSD.ORG Thu May 8 19:40:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 255A5D4E; Thu, 8 May 2014 19:40:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FADBB06; Thu, 8 May 2014 19:40:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48JedmQ041898; Thu, 8 May 2014 19:40:39 GMT (envelope-from davidcs@svn.freebsd.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48Jebh5041824; Thu, 8 May 2014 19:40:37 GMT (envelope-from davidcs@svn.freebsd.org) Message-Id: <201405081940.s48Jebh5041824@svn.freebsd.org> From: David C Somayajulu Date: Thu, 8 May 2014 19:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 19:40:39 -0000 Author: davidcs Date: Thu May 8 19:40:37 2014 New Revision: 265703 URL: http://svnweb.freebsd.org/changeset/base/265703 Log: Modify Copyright information and other strings to reflect Qlogic Corporation's purchase of Broadcom's NetXtreme business. Added clean option to Makefile Submitted by:David C Somayajulu (davidcs@freebsd.org) QLogic Corporation MFC after:5 days Modified: head/share/man/man4/bce.4 head/share/man/man4/bxe.4 head/sys/dev/bce/if_bce.c head/sys/dev/bce/if_bcefw.h head/sys/dev/bce/if_bcereg.h head/sys/dev/bxe/bxe.c head/sys/modules/bce/Makefile Modified: head/share/man/man4/bce.4 ============================================================================== --- head/share/man/man4/bce.4 Thu May 8 19:35:29 2014 (r265702) +++ head/share/man/man4/bce.4 Thu May 8 19:40:37 2014 (r265703) @@ -1,5 +1,4 @@ -.\" Copyright (c) 2006 Broadcom Corporation -.\" David Christensen . All rights reserved. +.\" Copyright (c) 2006-2014 QLogic Corporation .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -10,9 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. Neither the name of Broadcom Corporation nor the name of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written consent. .\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' .\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -33,7 +29,7 @@ .Os .Sh NAME .Nm bce -.Nd "Broadcom NetXtreme II (BCM5706/5708/5709/5716) PCI/PCIe Gigabit Ethernet adapter driver" +.Nd "QLogic NetXtreme II (BCM5706/5708/5709/5716) PCI/PCIe Gigabit Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -52,7 +48,7 @@ if_bce_load="YES" .Sh DESCRIPTION The .Nm -driver supports Broadcom's NetXtreme II product family, including the +driver supports QLogic's NetXtreme II product family, including the BCM5706, BCM5708, BCM5709 and BCM5716 Ethernet controllers. .Pp The NetXtreme II product family is composed of various Converged NIC (or CNIC) @@ -141,25 +137,25 @@ For more information on configuring this .Sh HARDWARE The .Nm -driver provides support for various NICs based on the Broadcom NetXtreme II +driver provides support for various NICs based on the QLogic NetXtreme II family of Gigabit Ethernet controllers, including the following: .Pp .Bl -bullet -compact .It -Broadcom NetXtreme II BCM5706 1000Base-SX +QLogic NetXtreme II BCM5706 1000Base-SX .It -Broadcom NetXtreme II BCM5706 1000Base-T +QLogic NetXtreme II BCM5706 1000Base-T .It -Broadcom NetXtreme II BCM5708 1000Base-SX +QLogic NetXtreme II BCM5708 1000Base-SX .It -Broadcom NetXtreme II BCM5708 1000Base-T +QLogic NetXtreme II BCM5708 1000Base-T .It -Broadcom NetXtreme II BCM5709 1000Base-SX +QLogic NetXtreme II BCM5709 1000Base-SX .It -Broadcom NetXtreme II BCM5709 1000Base-T +QLogic NetXtreme II BCM5709 1000Base-T .It -Broadcom NetXtreme II BCM5716 1000Base-T +QLogic NetXtreme II BCM5716 1000Base-T .It Dell PowerEdge 1950 integrated BCM5708 NIC .It @@ -411,9 +407,11 @@ A controller hardware failure has occurr If the problem continues replace the controller. .El .Sh SUPPORT -For general information and support, -go to the Broadcom NIC Open Source Developer Resource Site: -.Pa http://www.broadcom.com/support/ethernet_nic/open_source.php . +For support questions please contact your QLogic approved reseller or +QLogic Technical Support at +.Pa http://support.qlogic.com , +or by E-mail at +.Aq support@qlogic.com . .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , Modified: head/share/man/man4/bxe.4 ============================================================================== --- head/share/man/man4/bxe.4 Thu May 8 19:35:29 2014 (r265702) +++ head/share/man/man4/bxe.4 Thu May 8 19:40:37 2014 (r265703) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2013 Broadcom Corporation. All rights reserved. +.\" Copyright (c) 2014 Qlogic Corporation. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -9,9 +9,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. Neither the name of Broadcom Corporation nor the name of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written consent. .\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' .\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -32,7 +29,7 @@ .Os .Sh NAME .Nm bxe -.Nd Broadcom NetXtreme II Ethernet 10Gb PCIe adapter driver +.Nd QLogic NetXtreme II Ethernet 10Gb PCIe adapter driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -50,7 +47,7 @@ if_bxe_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for PCIe 10Gb Ethernet adapters based on the Broadcom +driver provides support for PCIe 10Gb Ethernet adapters based on the QLogic NetXtreme II family of 10Gb chips. The driver supports Jumbo Frames, VLAN tagging, checksum offload (IPv4, TCP, UDP, IPv6-TCP, IPv6-UDP), MSI-X @@ -59,32 +56,32 @@ Receive Side Scaling (RSS). .Sh HARDWARE The .Nm -driver provides support for various NICs based on the Broadcom NetXtreme II +driver provides support for various NICs based on the QLogic NetXtreme II family of 10Gb Ethernet controller chips, including the following: .Pp .Bl -bullet -compact .It -Broadcom NetXtreme II BCM57710 10Gb +QLogic NetXtreme II BCM57710 10Gb .It -Broadcom NetXtreme II BCM57711 10Gb +QLogic NetXtreme II BCM57711 10Gb .It -Broadcom NetXtreme II BCM57711E 10Gb +QLogic NetXtreme II BCM57711E 10Gb .It -Broadcom NetXtreme II BCM57712 10Gb +QLogic NetXtreme II BCM57712 10Gb .It -Broadcom NetXtreme II BCM57712-MF 10Gb +QLogic NetXtreme II BCM57712-MF 10Gb .It -Broadcom NetXtreme II BCM57800 10Gb +QLogic NetXtreme II BCM57800 10Gb .It -Broadcom NetXtreme II BCM57800-MF 10Gb +QLogic NetXtreme II BCM57800-MF 10Gb .It -Broadcom NetXtreme II BCM57810 10Gb +QLogic NetXtreme II BCM57810 10Gb .It -Broadcom NetXtreme II BCM57810-MF 10Gb +QLogic NetXtreme II BCM57810-MF 10Gb .It -Broadcom NetXtreme II BCM57840 10Gb / 20Gb +QLogic NetXtreme II BCM57840 10Gb / 20Gb .It -Broadcom NetXtreme II BCM57840-MF 10Gb +QLogic NetXtreme II BCM57840-MF 10Gb .El .Sh CONFIGURATION There a number of configuration parameters that can be set to tweak the @@ -318,6 +315,12 @@ When finished turn the logging back off: .Bd -literal -offset indent # sysctl dev.bxe.0.debug=0 .Ed +.Sh SUPPORT +For support questions please contact your QLogic approved reseller or +QLogic Technical Support at +.Pa http://support.qlogic.com , +or by E-mail at +.Aq support@qlogic.com . .Sh SEE ALSO .Xr netstat 1 , .Xr altq 4 , Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Thu May 8 19:35:29 2014 (r265702) +++ head/sys/dev/bce/if_bce.c Thu May 8 19:40:37 2014 (r265703) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2006-2010 Broadcom Corporation - * David Christensen . All rights reserved. + * Copyright (c) 2006-2014 QLogic Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -11,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -154,13 +150,13 @@ static const struct bce_type bce_devs[] { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, HP_VENDORID, 0x1709, "HP NC371i Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5706, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM5706 1000Base-T" }, + "QLogic NetXtreme II BCM5706 1000Base-T" }, /* BCM5706S controllers and OEM boards. */ { BRCM_VENDORID, BRCM_DEVICEID_BCM5706S, HP_VENDORID, 0x3102, "HP NC370F Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5706S, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM5706 1000Base-SX" }, + "QLogic NetXtreme II BCM5706 1000Base-SX" }, /* BCM5708C controllers and OEM boards. */ { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, HP_VENDORID, 0x7037, @@ -170,7 +166,7 @@ static const struct bce_type bce_devs[] { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, HP_VENDORID, 0x7045, "HP NC374m PCIe Multifunction Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5708, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM5708 1000Base-T" }, + "QLogic NetXtreme II BCM5708 1000Base-T" }, /* BCM5708S controllers and OEM boards. */ { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x1706, @@ -180,7 +176,7 @@ static const struct bce_type bce_devs[] { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, HP_VENDORID, 0x703d, "HP NC373F PCIe Multifunc Giga Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5708S, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM5708 1000Base-SX" }, + "QLogic NetXtreme II BCM5708 1000Base-SX" }, /* BCM5709C controllers and OEM boards. */ { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, HP_VENDORID, 0x7055, @@ -188,7 +184,7 @@ static const struct bce_type bce_devs[] { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, HP_VENDORID, 0x7059, "HP NC382T PCIe DP Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5709, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM5709 1000Base-T" }, + "QLogic NetXtreme II BCM5709 1000Base-T" }, /* BCM5709S controllers and OEM boards. */ { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, HP_VENDORID, 0x171d, @@ -196,11 +192,11 @@ static const struct bce_type bce_devs[] { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, HP_VENDORID, 0x7056, "HP NC382i DP Multifunction Gigabit Server Adapter" }, { BRCM_VENDORID, BRCM_DEVICEID_BCM5709S, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM5709 1000Base-SX" }, + "QLogic NetXtreme II BCM5709 1000Base-SX" }, /* BCM5716 controllers and OEM boards. */ { BRCM_VENDORID, BRCM_DEVICEID_BCM5716, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM5716 1000Base-T" }, + "QLogic NetXtreme II BCM5716 1000Base-T" }, { 0, 0, 0, 0, NULL } }; Modified: head/sys/dev/bce/if_bcefw.h ============================================================================== --- head/sys/dev/bce/if_bcefw.h Thu May 8 19:35:29 2014 (r265702) +++ head/sys/dev/bce/if_bcefw.h Thu May 8 19:40:37 2014 (r265703) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2006-2011 Broadcom Corporation - * David Christensen . All rights reserved. + * Copyright (c) 2006-2014 QLogic Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,9 +9,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -31,7 +27,7 @@ /* * This file contains firmware data derived from proprietary unpublished - * source code, Copyright (c) 2004-2011 Broadcom Corporation. + * source code, Copyright (c) 2004-2014 QLogic Corporation. * * Permission is hereby granted for the distribution of this firmware data * in hexadecimal or equivalent format, provided this copyright notice also Modified: head/sys/dev/bce/if_bcereg.h ============================================================================== --- head/sys/dev/bce/if_bcereg.h Thu May 8 19:35:29 2014 (r265702) +++ head/sys/dev/bce/if_bcereg.h Thu May 8 19:40:37 2014 (r265703) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2006-2010 Broadcom Corporation - * David Christensen . All rights reserved. + * Copyright (c) 2006-2014 QLogic Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,9 +9,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Thu May 8 19:35:29 2014 (r265702) +++ head/sys/dev/bxe/bxe.c Thu May 8 19:40:37 2014 (r265703) @@ -98,126 +98,126 @@ static struct bxe_device_type bxe_devs[] BRCM_VENDORID, CHIP_NUM_57710, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57710 10GbE" + "QLogic NetXtreme II BCM57710 10GbE" }, { BRCM_VENDORID, CHIP_NUM_57711, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57711 10GbE" + "QLogic NetXtreme II BCM57711 10GbE" }, { BRCM_VENDORID, CHIP_NUM_57711E, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57711E 10GbE" + "QLogic NetXtreme II BCM57711E 10GbE" }, { BRCM_VENDORID, CHIP_NUM_57712, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57712 10GbE" + "QLogic NetXtreme II BCM57712 10GbE" }, { BRCM_VENDORID, CHIP_NUM_57712_MF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57712 MF 10GbE" + "QLogic NetXtreme II BCM57712 MF 10GbE" }, #if 0 { BRCM_VENDORID, CHIP_NUM_57712_VF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57712 VF 10GbE" + "QLogic NetXtreme II BCM57712 VF 10GbE" }, #endif { BRCM_VENDORID, CHIP_NUM_57800, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57800 10GbE" + "QLogic NetXtreme II BCM57800 10GbE" }, { BRCM_VENDORID, CHIP_NUM_57800_MF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57800 MF 10GbE" + "QLogic NetXtreme II BCM57800 MF 10GbE" }, #if 0 { BRCM_VENDORID, CHIP_NUM_57800_VF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57800 VF 10GbE" + "QLogic NetXtreme II BCM57800 VF 10GbE" }, #endif { BRCM_VENDORID, CHIP_NUM_57810, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57810 10GbE" + "QLogic NetXtreme II BCM57810 10GbE" }, { BRCM_VENDORID, CHIP_NUM_57810_MF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57810 MF 10GbE" + "QLogic NetXtreme II BCM57810 MF 10GbE" }, #if 0 { BRCM_VENDORID, CHIP_NUM_57810_VF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57810 VF 10GbE" + "QLogic NetXtreme II BCM57810 VF 10GbE" }, #endif { BRCM_VENDORID, CHIP_NUM_57811, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57811 10GbE" + "QLogic NetXtreme II BCM57811 10GbE" }, { BRCM_VENDORID, CHIP_NUM_57811_MF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57811 MF 10GbE" + "QLogic NetXtreme II BCM57811 MF 10GbE" }, #if 0 { BRCM_VENDORID, CHIP_NUM_57811_VF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57811 VF 10GbE" + "QLogic NetXtreme II BCM57811 VF 10GbE" }, #endif { BRCM_VENDORID, CHIP_NUM_57840_4_10, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57840 4x10GbE" + "QLogic NetXtreme II BCM57840 4x10GbE" }, #if 0 { BRCM_VENDORID, CHIP_NUM_57840_2_20, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57840 2x20GbE" + "QLogic NetXtreme II BCM57840 2x20GbE" }, #endif { BRCM_VENDORID, CHIP_NUM_57840_MF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57840 MF 10GbE" + "QLogic NetXtreme II BCM57840 MF 10GbE" }, #if 0 { BRCM_VENDORID, CHIP_NUM_57840_VF, PCI_ANY_ID, PCI_ANY_ID, - "Broadcom NetXtreme II BCM57840 VF 10GbE" + "QLogic NetXtreme II BCM57840 VF 10GbE" }, #endif { Modified: head/sys/modules/bce/Makefile ============================================================================== --- head/sys/modules/bce/Makefile Thu May 8 19:35:29 2014 (r265702) +++ head/sys/modules/bce/Makefile Thu May 8 19:40:37 2014 (r265703) @@ -5,4 +5,9 @@ SRCS= opt_bce.h if_bce.c miibus_if.h mii #CFLAGS += -DBCE_DEBUG=0 +clean: + rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms + rm -f *.o *.kld *.ko + rm -f @ machine x86 miibus_if.h miidevs.h opt_bce.h + .include From owner-svn-src-head@FreeBSD.ORG Thu May 8 20:02:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E24367CB; Thu, 8 May 2014 20:02:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5DC4D62; Thu, 8 May 2014 20:02:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48K2crm004200; Thu, 8 May 2014 20:02:38 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48K2cNQ004199; Thu, 8 May 2014 20:02:38 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405082002.s48K2cNQ004199@svn.freebsd.org> From: Ian Lepore Date: Thu, 8 May 2014 20:02:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265705 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 20:02:39 -0000 Author: ian Date: Thu May 8 20:02:38 2014 New Revision: 265705 URL: http://svnweb.freebsd.org/changeset/base/265705 Log: Consolitate all the AP core startup stuff under a single #ifdef SMP block. Remove some other ifdefs that came in with a copy/paste that mean basically "if this processor supports multicore stuff", because if you're starting up an AP core... it does. Modified: head/sys/arm/arm/locore.S Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Thu May 8 19:45:31 2014 (r265704) +++ head/sys/arm/arm/locore.S Thu May 8 20:02:38 2014 (r265705) @@ -308,11 +308,6 @@ Lreal_start: Lend: .word _edata -#ifdef SMP -Lstartup_pagetable_secondary: - .word temp_pagetable -#endif - .Lstart: .word _edata .word _ebss @@ -320,10 +315,6 @@ Lstartup_pagetable_secondary: .Lvirt_done: .word virt_done -#if defined(SMP) -.Lmpvirt_done: - .word mpvirt_done -#endif .Lmainreturned: .asciz "main() returned" @@ -350,6 +341,11 @@ pagetable: #if defined(SMP) +.Lmpvirt_done: + .word mpvirt_done +Lstartup_pagetable_secondary: + .word temp_pagetable + ASENTRY_NP(mpentry) /* Make sure interrupts are disabled. */ @@ -379,26 +375,20 @@ Ltag: bic r0, r0, #0xf0000000 orr r0, r0, #PHYSADDR ldr r0, [r0] -#if defined(SMP) orr r0, r0, #2 /* Set TTB shared memory flag */ -#endif mcr p15, 0, r0, c2, c0, 0 /* Set TTB */ mcr p15, 0, r0, c8, c7, 0 /* Flush TLB */ -#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) || defined(CPU_KRAIT) mov r0, #0 mcr p15, 0, r0, c13, c0, 1 /* Set ASID to 0 */ -#endif /* Set the Domain Access register. Very important! */ mov r0, #((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT) mcr p15, 0, r0, c3, c0, 0 /* Enable MMU */ mrc p15, 0, r0, c1, c0, 0 -#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) || defined(CPU_KRAIT) orr r0, r0, #CPU_CONTROL_V6_EXTPAGE orr r0, r0, #CPU_CONTROL_AF_ENABLE -#endif orr r0, r0, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE) mcr p15, 0, r0, c1, c0, 0 nop @@ -426,7 +416,7 @@ mpvirt_done: /* NOTREACHED */ .Lmpreturned: - .asciz "main() returned" + .asciz "init_secondary() returned" .align 0 END(mpentry) #endif From owner-svn-src-head@FreeBSD.ORG Thu May 8 20:21:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58C60F17; Thu, 8 May 2014 20:21:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C1C0F28; Thu, 8 May 2014 20:21:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48KKxko056006; Thu, 8 May 2014 20:20:59 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48KKxP2056005; Thu, 8 May 2014 20:20:59 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405082020.s48KKxP2056005@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 8 May 2014 20:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265706 - head/usr.bin/printf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 20:21:00 -0000 Author: pfg Date: Thu May 8 20:20:59 2014 New Revision: 265706 URL: http://svnweb.freebsd.org/changeset/base/265706 Log: Fix the incorrect handling of %b and \c in printf(1) This is required for POSIX compliance. Obtained from: Garrett D'Amore (Illumos) MFC after: 4 days Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Thu May 8 20:02:38 2014 (r265705) +++ head/usr.bin/printf/printf.c Thu May 8 20:20:59 2014 (r265706) @@ -110,7 +110,7 @@ int main(int argc, char *argv[]) { size_t len; - int chopped, end, rval; + int end, rval; char *format, *fmt, *start; #ifndef SHELL int ch; @@ -151,7 +151,7 @@ main(int argc, char *argv[]) * up the format string. */ fmt = format = *argv; - chopped = escape(fmt, 1, &len); /* backslash interpretation */ + escape(fmt, 1, &len); /* backslash interpretation */ rval = end = 0; gargv = ++argv; @@ -195,7 +195,7 @@ main(int argc, char *argv[]) return (1); } fwrite(start, 1, fmt - start, stdout); - if (chopped || !*gargv) { + if (!*gargv) { #ifdef SHELL INTON; #endif @@ -241,8 +241,8 @@ printf_doformat(char *fmt, int *rval) maxargv = gargv; fmt += l + 1; - /* save format argument */ - fargv = gargv; + /* save format argument */ + fargv = gargv; } else { fargv = NULL; } @@ -352,7 +352,7 @@ printf_doformat(char *fmt, int *rval) /* save the current arg offset, and set to the format arg */ if (fargv != NULL) { - gargv = fargv; + gargv = fargv; } convch = *fmt; @@ -371,12 +371,10 @@ printf_doformat(char *fmt, int *rval) return (NULL); } getout = escape(p, 0, &len); - *(fmt - 1) = 's'; - PF(start, p); - *(fmt - 1) = 'b'; + fputs(p, stdout); free(p); if (getout) - return (fmt); + exit(*rval); break; } case 'c': { @@ -488,9 +486,13 @@ escape(char *fmt, int percent, size_t *l *store = '\b'; break; case 'c': - *store = '\0'; - *len = store - save; - return (1); + if (!percent) { + *store = '\0'; + *len = store - save; + return (1); + } + *store = 'c'; + break; case 'f': /* form-feed */ *store = '\f'; break; From owner-svn-src-head@FreeBSD.ORG Thu May 8 20:23:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B479B147; Thu, 8 May 2014 20:23:13 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 21C88F51; Thu, 8 May 2014 20:23:12 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s48KNA7j050615 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 9 May 2014 00:23:10 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s48KNAt4050614; Fri, 9 May 2014 00:23:10 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 9 May 2014 00:23:10 +0400 From: Gleb Smirnoff To: Michael Tuexen Subject: Re: svn commit: r265691 - head/sys/netinet Message-ID: <20140508202310.GC50446@FreeBSD.org> References: <201405081727.s48HRkiT056077@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201405081727.s48HRkiT056077@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 20:23:13 -0000 On Thu, May 08, 2014 at 05:27:46PM +0000, Michael Tuexen wrote: M> Author: tuexen M> Date: Thu May 8 17:27:46 2014 M> New Revision: 265691 M> URL: http://svnweb.freebsd.org/changeset/base/265691 M> M> Log: M> For some UDP packets (for example with 200 byte payload) and IP options, M> the IP header and the UDP header are not in the same mbuf. M> Add code to in_delayed_cksum() to deal with this case. M> M> MFC after: 3 days M> M> Modified: M> head/sys/netinet/ip_output.c M> M> Modified: head/sys/netinet/ip_output.c M> ============================================================================== M> --- head/sys/netinet/ip_output.c Thu May 8 17:20:45 2014 (r265690) M> +++ head/sys/netinet/ip_output.c Thu May 8 17:27:46 2014 (r265691) M> @@ -887,15 +887,23 @@ in_delayed_cksum(struct mbuf *m) M> csum = 0xffff; M> offset += m->m_pkthdr.csum_data; /* checksum offset */ M> M> + /* find the mbuf in the chain where the checksum starts*/ M> + while ((m != NULL) && (offset >= m->m_len)) { M> + offset -= m->m_len; M> + m = m->m_next; M> + } M> + if (m == NULL) { M> + /* This should not happen. */ M> + printf("in_delayed_cksum(): checksum outside mbuf chain.\n"); M> + return; M> + } M> if (offset + sizeof(u_short) > m->m_len) { M> - printf("delayed m_pullup, m->len: %d off: %d p: %d\n", M> - m->m_len, offset, ip->ip_p); M> /* M> * XXX M> - * this shouldn't happen, but if it does, the M> - * correct behavior may be to insert the checksum M> - * in the appropriate next mbuf in the chain. M> + * This should not happen, but if it does, it might make more M> + * sense to fix the caller than to add code to split it here. M> */ M> + printf("in_delayed_cksum(): checksum split between mbufs.\n"); M> return; M> } M> *(u_short *)(m->m_data + offset) = csum; If "this should not happen" really means that we do not expect this issue at all, assuming we are coding correctly, then all these comments and printfs should be converted to KASSERTs. If "this should not happen" means 'such packets shouldn't arrrive from network", then we need to remove printfs, because having a remotely triggerable printf(9) is a DDoS vulnerability. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu May 8 20:28:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3CDA57C; Thu, 8 May 2014 20:28:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6120F93; Thu, 8 May 2014 20:28:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48KSNoi076035; Thu, 8 May 2014 20:28:23 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48KSNnJ076026; Thu, 8 May 2014 20:28:23 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201405082028.s48KSNnJ076026@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 8 May 2014 20:28:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265709 - in head/sys/dev: mpr mps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 20:28:23 -0000 Author: ken Date: Thu May 8 20:28:22 2014 New Revision: 265709 URL: http://svnweb.freebsd.org/changeset/base/265709 Log: Fix TLR (Transport Layer Retry) support in the mps(4) and mpr(4) drivers. TLR is necessary for reliable communication with SAS tape drives. This was broken by change 246713 in the mps(4) driver. It changed the cm_data field for SCSI I/O requests to point to the CCB instead of the data buffer. So, instead, look at the CCB's data pointer to determine whether or not we're talking to a tape drive. Also, take the residual into account to make sure that we don't go off the end of the request. MFC after: 3 days Sponsored by: Spectra Logic Corporation Modified: head/sys/dev/mpr/mpr_sas.c head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Thu May 8 20:27:06 2014 (r265708) +++ head/sys/dev/mpr/mpr_sas.c Thu May 8 20:28:22 2014 (r265709) @@ -2355,8 +2355,9 @@ mprsas_scsiio_complete(struct mpr_softc (csio->cdb_io.cdb_bytes[1] & SI_EVPD) && (csio->cdb_io.cdb_bytes[2] == SVPD_SUPPORTED_PAGE_LIST) && ((csio->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR) && - (csio->data_ptr != NULL) && (((uint8_t *)cm->cm_data)[0] == - T_SEQUENTIAL) && (sc->control_TLR) && + (csio->data_ptr != NULL) && + ((csio->data_ptr[0] & 0x1f) == T_SEQUENTIAL) && + (sc->control_TLR) && (sc->mapping_table[csio->ccb_h.target_id].device_info & MPI2_SAS_DEVICE_INFO_SSP_TARGET)) { vpd_list = (struct scsi_vpd_supported_page_list *) @@ -2367,6 +2368,7 @@ mprsas_scsiio_complete(struct mpr_softc TLR_on = (u8)MPI2_SCSIIO_CONTROL_TLR_ON; alloc_len = ((u16)csio->cdb_io.cdb_bytes[3] << 8) + csio->cdb_io.cdb_bytes[4]; + alloc_len -= csio->resid; for (i = 0; i < MIN(vpd_list->length, alloc_len); i++) { if (vpd_list->list[i] == 0x90) { *TLR_bits = TLR_on; Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Thu May 8 20:27:06 2014 (r265708) +++ head/sys/dev/mps/mps_sas.c Thu May 8 20:28:22 2014 (r265709) @@ -2316,8 +2316,9 @@ mpssas_scsiio_complete(struct mps_softc (csio->cdb_io.cdb_bytes[1] & SI_EVPD) && (csio->cdb_io.cdb_bytes[2] == SVPD_SUPPORTED_PAGE_LIST) && ((csio->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR) && - (csio->data_ptr != NULL) && (((uint8_t *)cm->cm_data)[0] == - T_SEQUENTIAL) && (sc->control_TLR) && + (csio->data_ptr != NULL) && + ((csio->data_ptr[0] & 0x1f) == T_SEQUENTIAL) && + (sc->control_TLR) && (sc->mapping_table[csio->ccb_h.target_id].device_info & MPI2_SAS_DEVICE_INFO_SSP_TARGET)) { vpd_list = (struct scsi_vpd_supported_page_list *) @@ -2328,6 +2329,7 @@ mpssas_scsiio_complete(struct mps_softc TLR_on = (u8)MPI2_SCSIIO_CONTROL_TLR_ON; alloc_len = ((u16)csio->cdb_io.cdb_bytes[3] << 8) + csio->cdb_io.cdb_bytes[4]; + alloc_len -= csio->resid; for (i = 0; i < MIN(vpd_list->length, alloc_len); i++) { if (vpd_list->list[i] == 0x90) { *TLR_bits = TLR_on; From owner-svn-src-head@FreeBSD.ORG Thu May 8 20:46:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CEF16FA7; Thu, 8 May 2014 20:46:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2C821A2; Thu, 8 May 2014 20:46:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48KklVN028668; Thu, 8 May 2014 20:46:47 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48Kklb3028660; Thu, 8 May 2014 20:46:47 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201405082046.s48Kklb3028660@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 8 May 2014 20:46:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265712 - head/sys/dev/mpr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 20:46:47 -0000 Author: ken Date: Thu May 8 20:46:46 2014 New Revision: 265712 URL: http://svnweb.freebsd.org/changeset/base/265712 Log: Add #ifdefs in the mpr(4) driver so that versions of stable/9 that have implemented the PIM_NOSCAN rescan functionality will have it enabled. This is a no-op for head. Reviewed by: slm Sponsored by: Spectra Logic Corporation MFC after: 3 days Modified: head/sys/dev/mpr/mpr_sas.c head/sys/dev/mpr/mpr_sas_lsi.c Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Thu May 8 20:41:39 2014 (r265711) +++ head/sys/dev/mpr/mpr_sas.c Thu May 8 20:46:46 2014 (r265712) @@ -183,7 +183,8 @@ mprsas_startup_increment(struct mprsas_s /* just starting, freeze the simq */ mpr_dprint(sassc->sc, MPR_INIT, "%s freezing simq\n", __func__); -#if __FreeBSD_version >= 1000039 +#if (__FreeBSD_version >= 1000039) || \ + ((__FreeBSD_version < 1000000) && (__FreeBSD_version >= 902502)) xpt_hold_boot(); #endif xpt_freeze_simq(sassc->sim, 1); @@ -217,7 +218,8 @@ mprsas_startup_decrement(struct mprsas_s "%s releasing simq\n", __func__); sassc->flags &= ~MPRSAS_IN_STARTUP; xpt_release_simq(sassc->sim, 1); -#if __FreeBSD_version >= 1000039 +#if (__FreeBSD_version >= 1000039) || \ + ((__FreeBSD_version < 1000000) && (__FreeBSD_version >= 902502)) xpt_release_boot(); #else mprsas_rescan_target(sassc->sc, NULL); @@ -974,7 +976,8 @@ mprsas_action(struct cam_sim *sim, union cpi->version_num = 1; cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16; cpi->target_sprt = 0; -#if __FreeBSD_version >= 1000039 +#if (__FreeBSD_version >= 1000039) || \ + ((__FreeBSD_version < 1000000) && (__FreeBSD_version >= 902502)) cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED | PIM_NOSCAN; #else cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; Modified: head/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- head/sys/dev/mpr/mpr_sas_lsi.c Thu May 8 20:41:39 2014 (r265711) +++ head/sys/dev/mpr/mpr_sas_lsi.c Thu May 8 20:46:46 2014 (r265712) @@ -801,7 +801,8 @@ mprsas_add_device(struct mpr_softc *sc, "and connector name (%4s)\n", targ->encl_level, targ->connector_name); } -#if __FreeBSD_version < 1000039 +#if ((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000039)) || \ + (__FreeBSD_version < 902502) if ((sassc->flags & MPRSAS_IN_STARTUP) == 0) #endif mprsas_rescan_target(sc, targ); @@ -992,7 +993,8 @@ mprsas_volume_add(struct mpr_softc *sc, free(lun, M_MPR); } SLIST_INIT(&targ->luns); -#if __FreeBSD_version < 1000039 +#if ((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000039)) || \ + (__FreeBSD_version < 902502) if ((sassc->flags & MPRSAS_IN_STARTUP) == 0) #endif mprsas_rescan_target(sc, targ); From owner-svn-src-head@FreeBSD.ORG Thu May 8 20:47:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D924180; Thu, 8 May 2014 20:47:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B3281AC; Thu, 8 May 2014 20:47:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48Kltxp031595; Thu, 8 May 2014 20:47:55 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48Klt8V031593; Thu, 8 May 2014 20:47:55 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201405082047.s48Klt8V031593@svn.freebsd.org> From: Michael Tuexen Date: Thu, 8 May 2014 20:47:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265713 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 20:47:55 -0000 Author: tuexen Date: Thu May 8 20:47:54 2014 New Revision: 265713 URL: http://svnweb.freebsd.org/changeset/base/265713 Log: Use KASSERTs as suggested by glebius@ MFC after: 3 days X-MFC with: 265691 Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Thu May 8 20:46:46 2014 (r265712) +++ head/sys/netinet/ip_output.c Thu May 8 20:47:54 2014 (r265713) @@ -892,20 +892,8 @@ in_delayed_cksum(struct mbuf *m) offset -= m->m_len; m = m->m_next; } - if (m == NULL) { - /* This should not happen. */ - printf("in_delayed_cksum(): checksum outside mbuf chain.\n"); - return; - } - if (offset + sizeof(u_short) > m->m_len) { - /* - * XXX - * This should not happen, but if it does, it might make more - * sense to fix the caller than to add code to split it here. - */ - printf("in_delayed_cksum(): checksum split between mbufs.\n"); - return; - } + KASSERT(m != NULL, ("in_delayed_cksum: checksum outside mbuf chain.")); + KASSERT(offset + sizeof(u_short) <= m->m_len, ("in_delayed_cksum: checksum split between mbufs.")); *(u_short *)(m->m_data + offset) = csum; } From owner-svn-src-head@FreeBSD.ORG Thu May 8 20:50:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47044301; Thu, 8 May 2014 20:50:40 +0000 (UTC) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CACEE230; Thu, 8 May 2014 20:50:39 +0000 (UTC) Received: from [192.168.1.103] (p508F057E.dip0.t-ipconnect.de [80.143.5.126]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id EB7CC1C104988; Thu, 8 May 2014 22:50:36 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265691 - head/sys/netinet From: Michael Tuexen In-Reply-To: <20140508202310.GC50446@FreeBSD.org> Date: Thu, 8 May 2014 22:50:28 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405081727.s48HRkiT056077@svn.freebsd.org> <20140508202310.GC50446@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 20:50:40 -0000 On 08 May 2014, at 22:23, Gleb Smirnoff wrote: > On Thu, May 08, 2014 at 05:27:46PM +0000, Michael Tuexen wrote: > M> Author: tuexen > M> Date: Thu May 8 17:27:46 2014 > M> New Revision: 265691 > M> URL: http://svnweb.freebsd.org/changeset/base/265691 > M>=20 > M> Log: > M> For some UDP packets (for example with 200 byte payload) and IP = options, > M> the IP header and the UDP header are not in the same mbuf. > M> Add code to in_delayed_cksum() to deal with this case. > M> =20 > M> MFC after: 3 days > M>=20 > M> Modified: > M> head/sys/netinet/ip_output.c > M>=20 > M> Modified: head/sys/netinet/ip_output.c > M> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > M> --- head/sys/netinet/ip_output.c Thu May 8 17:20:45 2014 = (r265690) > M> +++ head/sys/netinet/ip_output.c Thu May 8 17:27:46 2014 = (r265691) > M> @@ -887,15 +887,23 @@ in_delayed_cksum(struct mbuf *m) > M> csum =3D 0xffff; > M> offset +=3D m->m_pkthdr.csum_data; /* checksum offset */ > M> =20 > M> + /* find the mbuf in the chain where the checksum starts*/ > M> + while ((m !=3D NULL) && (offset >=3D m->m_len)) { > M> + offset -=3D m->m_len; > M> + m =3D m->m_next; > M> + } > M> + if (m =3D=3D NULL) { > M> + /* This should not happen. */ > M> + printf("in_delayed_cksum(): checksum outside mbuf = chain.\n"); > M> + return; > M> + } > M> if (offset + sizeof(u_short) > m->m_len) { > M> - printf("delayed m_pullup, m->len: %d off: %d p: %d\n", > M> - m->m_len, offset, ip->ip_p); > M> /* > M> * XXX > M> - * this shouldn't happen, but if it does, the > M> - * correct behavior may be to insert the checksum > M> - * in the appropriate next mbuf in the chain. > M> + * This should not happen, but if it does, it might make = more > M> + * sense to fix the caller than to add code to split it = here. > M> */ > M> + printf("in_delayed_cksum(): checksum split between = mbufs.\n"); > M> return; > M> } > M> *(u_short *)(m->m_data + offset) =3D csum; >=20 > If "this should not happen" really means that we do not expect this = issue > at all, assuming we are coding correctly, then all these comments and = printfs > should be converted to KASSERTs. I tried to keep the style of the code... However, if the first one occurs, we are setting up a packet and have it = too short to contain the checksum. This would really be bug in our code... = So a KASSERT is fine. A KASSERT for the second case is also fine. The only difference between the above and the KASSERT version is that in case of problems the above just sends packets with wrong checksums and the KASSERT version will panic (when compiled with INVARIANTS) or panic (in case of m =3D=3D NULL) or corrupt a byte. However, I also = prefer the KASSERT version, it will help to get the code right... So I committed a change in http://svnweb.freebsd.org/changeset/base/265713 Thanks for your suggestion! Best regards Michael >=20 > If "this should not happen" means 'such packets shouldn't arrrive from > network", then we need to remove printfs, because having a remotely > triggerable printf(9) is a DDoS vulnerability. >=20 > --=20 > Totus tuus, Glebius. >=20 From owner-svn-src-head@FreeBSD.ORG Thu May 8 20:54:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 201F17AB; Thu, 8 May 2014 20:54:21 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B668275; Thu, 8 May 2014 20:54:20 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s48KsHZO050845 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 9 May 2014 00:54:17 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s48KsHk5050844; Fri, 9 May 2014 00:54:17 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 9 May 2014 00:54:17 +0400 From: Gleb Smirnoff To: Michael Tuexen Subject: Re: svn commit: r265691 - head/sys/netinet Message-ID: <20140508205417.GA50679@FreeBSD.org> References: <201405081727.s48HRkiT056077@svn.freebsd.org> <20140508202310.GC50446@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 20:54:21 -0000 On Thu, May 08, 2014 at 10:50:28PM +0200, Michael Tuexen wrote: M> > If "this should not happen" really means that we do not expect this issue M> > at all, assuming we are coding correctly, then all these comments and printfs M> > should be converted to KASSERTs. M> I tried to keep the style of the code... M> However, if the first one occurs, we are setting up a packet and have it too M> short to contain the checksum. This would really be bug in our code... So a KASSERT is fine. M> A KASSERT for the second case is also fine. M> The only difference between the above and the KASSERT version is that M> in case of problems the above just sends packets with wrong checksums M> and the KASSERT version will panic (when compiled with INVARIANTS) or M> panic (in case of m == NULL) or corrupt a byte. However, I also prefer M> the KASSERT version, it will help to get the code right... M> So I committed a change in M> http://svnweb.freebsd.org/changeset/base/265713 M> M> Thanks for your suggestion! Thanks a lot, Michael! -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu May 8 21:02:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A446BE4; Thu, 8 May 2014 21:02:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6783534E; Thu, 8 May 2014 21:02:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48L2OGG073874; Thu, 8 May 2014 21:02:24 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48L2OMr073873; Thu, 8 May 2014 21:02:24 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405082102.s48L2OMr073873@svn.freebsd.org> From: Christian Brueffer Date: Thu, 8 May 2014 21:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265716 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 21:02:24 -0000 Author: brueffer Date: Thu May 8 21:02:23 2014 New Revision: 265716 URL: http://svnweb.freebsd.org/changeset/base/265716 Log: Fix two more typos. Submitted by: Trond Endrestol Modified: head/share/man/man4/mrsas.4 Modified: head/share/man/man4/mrsas.4 ============================================================================== --- head/share/man/man4/mrsas.4 Thu May 8 20:57:13 2014 (r265715) +++ head/share/man/man4/mrsas.4 Thu May 8 21:02:23 2014 (r265716) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 7, 2014 +.Dd May 8, 2014 .Dt MRSAS 4 .Os .Sh NAME @@ -122,7 +122,7 @@ The .Nm driver supports the following hardware: .Pp -[ Thunderbolt 6Gbp/s MR controller ] +[ Thunderbolt 6Gb/s MR controller ] .Bl -bullet -compact .It LSI MegaRAID SAS 9265 @@ -146,7 +146,7 @@ DELL PERC H810 DELL PERC H710/P .El .Pp -[ Invader/Fury 12Gpb/s MR controller ] +[ Invader/Fury 12Gb/s MR controller ] .Bl -bullet -compact .It LSI MegaRAID SAS 9380 From owner-svn-src-head@FreeBSD.ORG Thu May 8 22:52:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D177BE1; Thu, 8 May 2014 22:52:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3067EE79; Thu, 8 May 2014 22:52:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48Mq6WF040491; Thu, 8 May 2014 22:52:06 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48Mq5on040461; Thu, 8 May 2014 22:52:05 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405082252.s48Mq5on040461@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 8 May 2014 22:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265719 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 22:52:06 -0000 Author: ray Date: Thu May 8 22:52:05 2014 New Revision: 265719 URL: http://svnweb.freebsd.org/changeset/base/265719 Log: Hide debug messages under VT_DEBUG. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt.h head/sys/dev/vt/vt_consolectl.c head/sys/dev/vt/vt_sysmouse.c Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Thu May 8 21:12:39 2014 (r265718) +++ head/sys/dev/vt/vt.h Thu May 8 22:52:05 2014 (r265719) @@ -78,7 +78,13 @@ one 'device sc' or 'device vt'" #endif /* defined(SC_TWOBUTTON_MOUSE) || defined(VT_TWOBUTTON_MOUSE) */ #define SC_DRIVER_NAME "vt" +#ifdef VT_DEBUG #define DPRINTF(_l, ...) if (vt_debug > (_l)) printf( __VA_ARGS__ ) +#define VT_CONSOLECTL_DEBUG +#define VT_SYSMOUSE_DEBUG +#else +#define DPRINTF(_l, ...) do {} while (0) +#endif #define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG) #define VT_SYSCTL_INT(_name, _default, _descr) \ Modified: head/sys/dev/vt/vt_consolectl.c ============================================================================== --- head/sys/dev/vt/vt_consolectl.c Thu May 8 21:12:39 2014 (r265718) +++ head/sys/dev/vt/vt_consolectl.c Thu May 8 22:52:05 2014 (r265719) @@ -61,8 +61,10 @@ consolectl_ioctl(struct cdev *dev, u_lon return (0); } default: +#ifdef VT_CONSOLECTL_DEBUG printf("consolectl: unknown ioctl: %c:%lx\n", (char)IOCGROUP(cmd), IOCBASECMD(cmd)); +#endif return (ENOIOCTL); } } Modified: head/sys/dev/vt/vt_sysmouse.c ============================================================================== --- head/sys/dev/vt/vt_sysmouse.c Thu May 8 21:12:39 2014 (r265718) +++ head/sys/dev/vt/vt_sysmouse.c Thu May 8 22:52:05 2014 (r265719) @@ -376,8 +376,10 @@ sysmouse_ioctl(struct cdev *dev, u_long case MOUSE_MOUSECHAR: return (0); default: +#ifdef VT_SYSMOUSE_DEBUG printf("sysmouse: unknown ioctl: %c:%lx\n", (char)IOCGROUP(cmd), IOCBASECMD(cmd)); +#endif return (ENOIOCTL); } } From owner-svn-src-head@FreeBSD.ORG Thu May 8 22:55:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09D45EC7; Thu, 8 May 2014 22:55:41 +0000 (UTC) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BCE8E8D; Thu, 8 May 2014 22:55:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id s48MtUt7091470; Fri, 9 May 2014 02:55:30 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Fri, 9 May 2014 02:55:30 +0400 (MSK) From: Dmitry Morozovsky To: Alan Somers Subject: Re: svn commit: r265472 - head/bin/dd In-Reply-To: Message-ID: References: <201405062206.s46M6dxW060155@svn.freebsd.org> <20140507113345.B923@besplex.bde.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Fri, 09 May 2014 02:55:30 +0400 (MSK) Cc: trociny@freebsd.org, "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 22:55:41 -0000 On Wed, 7 May 2014, Alan Somers wrote: [snip] > Even if nanosecond resolution isn't useful, monotonicity is. Nobody > should be using a nonmonotonic clock just to measure durations. I > started an audit of all of FreeBSD to look for other programs that use > gettimeofday to measure durations. I haven't finished, but I've > already found a lot, including xz, ping, hastd, fetch, systat, powerd, > and others. I don't have time to fix them, though. Would you be > interested, or do you know anyone else who would? >From your list, hastd seems to be the most dangerous point to me. Adding trociny@ as one of the most active hastd-related committers so the issue would not be lost in the areas... -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@FreeBSD.ORG Thu May 8 23:00:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4ECEFE9; Thu, 8 May 2014 23:00:11 +0000 (UTC) Received: from mail-we0-x236.google.com (mail-we0-x236.google.com [IPv6:2a00:1450:400c:c03::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A202EB0; Thu, 8 May 2014 23:00:10 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id t60so3142397wes.41 for ; Thu, 08 May 2014 16:00:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=lmCcLaGMkE8sZRUOIFRXV4r/8ys+T2YB8hX2pngbTvk=; b=pjBefbacrqFLKptvhIkkqIiQofsPxuTOluYHnr4dPTN5t0hHlGCRCFEjHhsNpyDOtA P1ca3D2w0nDlVs/xNwQzSno9SbHZlJc62o6+2TIk6VBfBvSHpmmCQQodjtuqaTCeHtgn BQSoUWb577jncOXFMfkEfElUI3RIAnQe+o/B3f6XWiIyMFmK7tVrU+4OoH7f8p9B3YVw 2Avi5LtwPTinH1MMjGrvSCjN+7h8QsdEYzt317IZdQDlCowa3dohANmquqkYh148bsfz NOlWojBG0DcDhjPxRo8v8cHjctNXs0Yl20dTnccY7pF3FnwiWdmnVcIBAp/bqdV31sea z2Fw== MIME-Version: 1.0 X-Received: by 10.180.100.234 with SMTP id fb10mr419049wib.26.1399590008370; Thu, 08 May 2014 16:00:08 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.194.168.130 with HTTP; Thu, 8 May 2014 16:00:08 -0700 (PDT) In-Reply-To: References: <201405062206.s46M6dxW060155@svn.freebsd.org> <20140507113345.B923@besplex.bde.org> Date: Thu, 8 May 2014 17:00:08 -0600 X-Google-Sender-Auth: ckIcfCKu5IloQMwR9tWfum3f6t0 Message-ID: Subject: Re: svn commit: r265472 - head/bin/dd From: Alan Somers To: Dmitry Morozovsky Content-Type: text/plain; charset=UTF-8 Cc: "src-committers@freebsd.org" , Alan Somers , "svn-src-all@freebsd.org" , trociny@freebsd.org, Bruce Evans , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 23:00:11 -0000 On Thu, May 8, 2014 at 4:55 PM, Dmitry Morozovsky wrote: > On Wed, 7 May 2014, Alan Somers wrote: > > [snip] > >> Even if nanosecond resolution isn't useful, monotonicity is. Nobody >> should be using a nonmonotonic clock just to measure durations. I >> started an audit of all of FreeBSD to look for other programs that use >> gettimeofday to measure durations. I haven't finished, but I've >> already found a lot, including xz, ping, hastd, fetch, systat, powerd, >> and others. I don't have time to fix them, though. Would you be >> interested, or do you know anyone else who would? > > From your list, hastd seems to be the most dangerous point to me. > > Adding trociny@ as one of the most active hastd-related committers so the issue > would not be lost in the areas... In hastd's case, the problematic comparison is only used to print debugging info. It happens twice, in primary.c lines 1978 and 2039. > > -- > Sincerely, > D.Marck [DM5020, MCK-RIPE, DM3-RIPN] > [ FreeBSD committer: marck@FreeBSD.org ] > ------------------------------------------------------------------------ > *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** > ------------------------------------------------------------------------ From owner-svn-src-head@FreeBSD.ORG Fri May 9 04:14:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C6D0481; Fri, 9 May 2014 04:14:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE133EE9; Fri, 9 May 2014 04:14:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s494EbGV010825; Fri, 9 May 2014 04:14:37 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s494EbRR010823; Fri, 9 May 2014 04:14:37 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405090414.s494EbRR010823@svn.freebsd.org> From: Glen Barber Date: Fri, 9 May 2014 04:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265732 - head/gnu/usr.bin/groff/tmac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 04:14:38 -0000 Author: gjb Date: Fri May 9 04:14:37 2014 New Revision: 265732 URL: http://svnweb.freebsd.org/changeset/base/265732 Log: Add 9.3 to mdoc.local. Sponsored by: The FreeBSD Foundation Modified: head/gnu/usr.bin/groff/tmac/mdoc.local Modified: head/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- head/gnu/usr.bin/groff/tmac/mdoc.local Fri May 9 04:08:40 2014 (r265731) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Fri May 9 04:14:37 2014 (r265732) @@ -58,6 +58,7 @@ .ds doc-operating-system-FreeBSD-8.4 8.4 .ds doc-operating-system-FreeBSD-9.1 9.1 .ds doc-operating-system-FreeBSD-9.2 9.2 +.ds doc-operating-system-FreeBSD-9.3 9.3 .ds doc-operating-system-FreeBSD-10.0 10.0 .ds doc-operating-system-FreeBSD-10.1 10.1 .ds doc-operating-system-FreeBSD-11.0 11.0 From owner-svn-src-head@FreeBSD.ORG Fri May 9 04:49:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5163E5EC; Fri, 9 May 2014 04:49:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F1021EA; Fri, 9 May 2014 04:49:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s494niQ1015302; Fri, 9 May 2014 04:49:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s494niul015301; Fri, 9 May 2014 04:49:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405090449.s494niul015301@svn.freebsd.org> From: Warner Losh Date: Fri, 9 May 2014 04:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265737 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 04:49:44 -0000 Author: imp Date: Fri May 9 04:49:43 2014 New Revision: 265737 URL: http://svnweb.freebsd.org/changeset/base/265737 Log: Spell always the more traditional way. Modified: head/share/mk/bsd.mkopt.mk Modified: head/share/mk/bsd.mkopt.mk ============================================================================== --- head/share/mk/bsd.mkopt.mk Fri May 9 04:25:17 2014 (r265736) +++ head/share/mk/bsd.mkopt.mk Fri May 9 04:49:43 2014 (r265737) @@ -42,7 +42,7 @@ MK_${var}:= yes # .for var in ${__DEFAULT_NO_OPTIONS} .if !defined(MK_${var}) -.if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT aways wins +.if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins MK_${var}:= yes .else MK_${var}:= no From owner-svn-src-head@FreeBSD.ORG Fri May 9 04:49:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A93C8722; Fri, 9 May 2014 04:49:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96FC61EC; Fri, 9 May 2014 04:49:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s494nmSm015781; Fri, 9 May 2014 04:49:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s494nm9j015779; Fri, 9 May 2014 04:49:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405090449.s494nm9j015779@svn.freebsd.org> From: Warner Losh Date: Fri, 9 May 2014 04:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265738 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 04:49:48 -0000 Author: imp Date: Fri May 9 04:49:48 2014 New Revision: 265738 URL: http://svnweb.freebsd.org/changeset/base/265738 Log: We have to include bsd.opts.mk (included in bsd.own.mk) after /etc/src.conf so that options set there will affect the options defined in bsd.opts.mk. Fix a few comments while I'm here. Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri May 9 04:49:43 2014 (r265737) +++ head/share/mk/src.opts.mk Fri May 9 04:49:48 2014 (r265738) @@ -30,17 +30,15 @@ .if !target(____) ____: -# Compat -- needed still? -.include - -# Allow user to configure things, but in the future this will move -# elsehwere... - +# Allow user to configure things that only effect src tree builds. SRCCONF?= /etc/src.conf .if exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf" .include "${SRCCONF}" .endif +# Must be included after src.conf +.include + # # Define MK_* variables (which are either "yes" or "no") for users # to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the From owner-svn-src-head@FreeBSD.ORG Fri May 9 05:39:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A56F7504; Fri, 9 May 2014 05:39:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8768B843; Fri, 9 May 2014 05:39:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s495dw1r053269; Fri, 9 May 2014 05:39:58 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s495dvCO053265; Fri, 9 May 2014 05:39:57 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201405090539.s495dvCO053265@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Fri, 9 May 2014 05:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265739 - in head/sys/arm: conf rockchip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 05:39:58 -0000 Author: ganbold Date: Fri May 9 05:39:57 2014 New Revision: 265739 URL: http://svnweb.freebsd.org/changeset/base/265739 Log: Add the codes for enabling CPU cores of Rockchip RK3188 SoC. Enable SMP for Radxa Rock board. Approved by: stas (mentor) Added: head/sys/arm/rockchip/rk30xx_mp.c (contents, props changed) Modified: head/sys/arm/conf/RADXA head/sys/arm/rockchip/files.rk30xx head/sys/arm/rockchip/rk30xx_machdep.c Modified: head/sys/arm/conf/RADXA ============================================================================== --- head/sys/arm/conf/RADXA Fri May 9 04:49:48 2014 (r265738) +++ head/sys/arm/conf/RADXA Fri May 9 05:39:57 2014 (r265739) @@ -121,3 +121,4 @@ options FDT options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=rk3188-radxa.dts +options SMP # Enable multiple cores Modified: head/sys/arm/rockchip/files.rk30xx ============================================================================== --- head/sys/arm/rockchip/files.rk30xx Fri May 9 04:49:48 2014 (r265738) +++ head/sys/arm/rockchip/files.rk30xx Fri May 9 05:39:57 2014 (r265739) @@ -19,3 +19,4 @@ arm/rockchip/rk30xx_grf.c standard arm/rockchip/rk30xx_wdog.c standard arm/rockchip/rk30xx_gpio.c optional gpio dev/usb/controller/dwc_otg_fdt.c optional dwcotg +arm/rockchip/rk30xx_mp.c optional smp Modified: head/sys/arm/rockchip/rk30xx_machdep.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_machdep.c Fri May 9 04:49:48 2014 (r265738) +++ head/sys/arm/rockchip/rk30xx_machdep.c Fri May 9 05:39:57 2014 (r265739) @@ -85,6 +85,7 @@ int initarm_devmap_init(void) { + arm_devmap_add_entry(0x10000000, 0x00200000); arm_devmap_add_entry(0x20000000, 0x00100000); return (0); Added: head/sys/arm/rockchip/rk30xx_mp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/rockchip/rk30xx_mp.c Fri May 9 05:39:57 2014 (r265739) @@ -0,0 +1,192 @@ +/*- + * Copyright (c) 2014 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define SCU_PHYSBASE 0x1013c000 +#define SCU_SIZE 0x100 + +#define SCU_CONTROL_REG 0x00 +#define SCU_CONTROL_ENABLE (1 << 0) +#define SCU_STANDBY_EN (1 << 5) +#define SCU_CONFIG_REG 0x04 +#define SCU_CONFIG_REG_NCPU_MASK 0x03 +#define SCU_CPUPOWER_REG 0x08 +#define SCU_INV_TAGS_REG 0x0c + +#define SCU_FILTER_START_REG 0x10 +#define SCU_FILTER_END_REG 0x14 +#define SCU_SECURE_ACCESS_REG 0x18 +#define SCU_NONSECURE_ACCESS_REG 0x1c + +#define IMEM_PHYSBASE 0x10080000 +#define IMEM_SIZE 0x20 + +#define PMU_PHYSBASE 0x20004000 +#define PMU_SIZE 0x100 +#define PMU_PWRDN_CON 0x08 +#define PMU_PWRDN_SCU (1 << 4) + +extern char *mpentry_addr; +static void rk30xx_boot2(void); + +static void +rk30xx_boot2(void) +{ + + __asm __volatile( + "ldr pc, 1f\n" + ".globl mpentry_addr\n" + "mpentry_addr:\n" + "1: .space 4\n"); +} + +void +platform_mp_init_secondary(void) +{ + + gic_init_secondary(); +} + +void +platform_mp_setmaxid(void) +{ + bus_space_handle_t scu; + int ncpu; + uint32_t val; + + if (mp_ncpus != 0) + return; + + if (bus_space_map(fdtbus_bs_tag, SCU_PHYSBASE, SCU_SIZE, 0, &scu) != 0) + panic("Could not map the SCU"); + + val = bus_space_read_4(fdtbus_bs_tag, scu, SCU_CONFIG_REG); + ncpu = (val & SCU_CONFIG_REG_NCPU_MASK) + 1; + bus_space_unmap(fdtbus_bs_tag, scu, SCU_SIZE); + + mp_ncpus = ncpu; + mp_maxid = ncpu - 1; +} + +int +platform_mp_probe(void) +{ + + if (mp_ncpus == 0) + platform_mp_setmaxid(); + + return (mp_ncpus > 1); +} + +void +platform_mp_start_ap(void) +{ + bus_space_handle_t scu; + bus_space_handle_t imem; + bus_space_handle_t pmu; + uint32_t val; + int i; + + if (bus_space_map(fdtbus_bs_tag, SCU_PHYSBASE, SCU_SIZE, 0, &scu) != 0) + panic("Could not map the SCU"); + if (bus_space_map(fdtbus_bs_tag, IMEM_PHYSBASE, + IMEM_SIZE, 0, &imem) != 0) + panic("Could not map the IMEM"); + if (bus_space_map(fdtbus_bs_tag, PMU_PHYSBASE, PMU_SIZE, 0, &pmu) != 0) + panic("Could not map the PMU"); + + /* + * Invalidate SCU cache tags. The 0x0000ffff constant invalidates all + * ways on all cores 0-3. Per the ARM docs, it's harmless to write to + * the bits for cores that are not present. + */ + bus_space_write_4(fdtbus_bs_tag, scu, SCU_INV_TAGS_REG, 0x0000ffff); + + /* Make sure all cores except the first are off */ + val = bus_space_read_4(fdtbus_bs_tag, pmu, PMU_PWRDN_CON); + for (i = 1; i < mp_ncpus; i++) + val |= 1 << i; + bus_space_write_4(fdtbus_bs_tag, pmu, PMU_PWRDN_CON, val); + + /* Enable SCU power domain */ + val = bus_space_read_4(fdtbus_bs_tag, pmu, PMU_PWRDN_CON); + val &= ~PMU_PWRDN_SCU; + bus_space_write_4(fdtbus_bs_tag, pmu, PMU_PWRDN_CON, val); + + /* Enable SCU */ + val = bus_space_read_4(fdtbus_bs_tag, scu, SCU_CONTROL_REG); + bus_space_write_4(fdtbus_bs_tag, scu, SCU_CONTROL_REG, + val | SCU_CONTROL_ENABLE); + + /* + * Cores will execute the code which resides at the start of + * the on-chip bootram/sram after power-on. This sram region + * should be reserved and the trampoline code that directs + * the core to the real startup code in ram should be copied + * into this sram region. + * + * First set boot function for the sram code. + */ + mpentry_addr = (char *)pmap_kextract((vm_offset_t)mpentry); + + /* Copy trampoline to sram, that runs during startup of the core */ + bus_space_write_region_4(fdtbus_bs_tag, imem, 0, + (uint32_t *)&rk30xx_boot2, 8); + + cpu_idcache_wbinv_all(); + cpu_l2cache_wbinv_all(); + + /* Start all cores */ + val = bus_space_read_4(fdtbus_bs_tag, pmu, PMU_PWRDN_CON); + for (i = 1; i < mp_ncpus; i++) + val &= ~(1 << i); + bus_space_write_4(fdtbus_bs_tag, pmu, PMU_PWRDN_CON, val); + + armv7_sev(); + + bus_space_unmap(fdtbus_bs_tag, scu, SCU_SIZE); + bus_space_unmap(fdtbus_bs_tag, imem, IMEM_SIZE); + bus_space_unmap(fdtbus_bs_tag, pmu, PMU_SIZE); +} + +void +platform_ipi_send(cpuset_t cpus, u_int ipi) +{ + + pic_ipi_send(cpus, ipi); +} From owner-svn-src-head@FreeBSD.ORG Fri May 9 12:59:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8B656FE; Fri, 9 May 2014 12:59:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AF4A166; Fri, 9 May 2014 12:59:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s49Cxd4c046944; Fri, 9 May 2014 12:59:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49CxcMa046940; Fri, 9 May 2014 12:59:38 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201405091259.s49CxcMa046940@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 9 May 2014 12:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265766 - in head/sys: boot/fdt/dts/mips dev/netfpga10g/nf10bmac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 12:59:39 -0000 Author: bz Date: Fri May 9 12:59:38 2014 New Revision: 265766 URL: http://svnweb.freebsd.org/changeset/base/265766 Log: Adjust the register layout to allow for 64bit registers in the future for nf10bmac(4). Also, add support for and enable RX interrupts. MFC after: 2 weeks Modified: head/sys/boot/fdt/dts/mips/beri-netfpga.dts head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c head/sys/dev/netfpga10g/nf10bmac/if_nf10bmacreg.h Modified: head/sys/boot/fdt/dts/mips/beri-netfpga.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beri-netfpga.dts Fri May 9 12:13:22 2014 (r265765) +++ head/sys/boot/fdt/dts/mips/beri-netfpga.dts Fri May 9 12:59:38 2014 (r265766) @@ -135,13 +135,14 @@ ethernet@7f005000 { compatible = "netfpag10g,nf10bmac"; - // TX, RX, LOOP - reg = <0x7f005010 0xc - 0x7f005020 0xc - 0x7f005030 0x4>; + // LOOP, TX, RX, INTR + reg = <0x7f005000 0x20 + 0x7f005020 0x30 + 0x7f005050 0x30 + 0x7f005100 0x10>; // RX - #interrupts = <1>; - #interrupt-parent = <&beripic>; + interrupts = <1>; + interrupt-parent = <&beripic>; }; }; Modified: head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c ============================================================================== --- head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c Fri May 9 12:13:22 2014 (r265765) +++ head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c Fri May 9 12:59:38 2014 (r265766) @@ -92,13 +92,15 @@ static poll_handler_t nf10bmac_poll; #define NF10BMAC_LOCK_ASSERT(_sc) \ mtx_assert(&(_sc)->nf10bmac_mtx, MA_OWNED) -#define NF10BMAC_TX_LEN 0x08 -#define NF10BMAC_TX_META 0x04 +#define NF10BMAC_CTRL0 0x00 #define NF10BMAC_TX_DATA 0x00 -#define NF10BMAC_RX_LEN 0x08 -#define NF10BMAC_RX_META 0x04 +#define NF10BMAC_TX_META 0x08 +#define NF10BMAC_TX_LEN 0x10 #define NF10BMAC_RX_DATA 0x00 -#define NF10BMAC_CTRL0 0x00 +#define NF10BMAC_RX_META 0x08 +#define NF10BMAC_RX_LEN 0x10 +#define NF10BMAC_INTR_CLEAR_DIS 0x00 +#define NF10BMAC_INTR_CTRL 0x08 #define NF10BMAC_TUSER_MAC0 (1 << 0) #define NF10BMAC_TUSER_CPU0 (1 << 1) @@ -109,11 +111,12 @@ static poll_handler_t nf10bmac_poll; #define NF10BMAC_TUSER_MAC3 (1 << 6) #define NF10BMAC_TUSER_CPU3 (1 << 7) +#define NF10BMAC_DATA_LEN_MASK 0x0000ffff #define NF10BMAC_DATA_DPORT_MASK 0xff000000 #define NF10BMAC_DATA_DPORT_SHIFT 24 #define NF10BMAC_DATA_SPORT_MASK 0x00ff0000 #define NF10BMAC_DATA_SPORT_SHIFT 16 -#define NF10BMAC_DATA_LAST 0x00000080 +#define NF10BMAC_DATA_LAST 0x00008000 #define NF10BMAC_DATA_STRB 0x0000000f @@ -151,7 +154,7 @@ nf10bmac_read_4_be(struct resource *res, } #define NF10BMAC_WRITE_CTRL_4(sc, reg, val) \ - nf10bmac_write_4((sc)->nf10bmac_mem_res, (reg), (val), \ + nf10bmac_write_4((sc)->nf10bmac_ctrl_res, (reg), (val), \ __func__, __LINE__) #define NF10BMAC_WRITE_4(sc, reg, val) \ nf10bmac_write_4((sc)->nf10bmac_tx_mem_res, (reg), (val), \ @@ -166,6 +169,21 @@ nf10bmac_read_4_be(struct resource *res, nf10bmac_read_4_be((sc)->nf10bmac_rx_mem_res, (reg), \ __func__, __LINE__) +#define NF10BMAC_WRITE_INTR_4(sc, reg, val, _f, _l) \ + nf10bmac_write_4((sc)->nf10bmac_intr_res, (reg), (val), \ + (_f), (_l)) + +#define NF10BMAC_RX_INTR_CLEAR_DIS(sc) \ + NF10BMAC_WRITE_INTR_4((sc), NF10BMAC_INTR_CLEAR_DIS, 1, \ + __func__, __LINE__) +#define NF10BMAC_RX_INTR_ENABLE(sc) \ + NF10BMAC_WRITE_INTR_4((sc), NF10BMAC_INTR_CTRL, 1, \ + __func__, __LINE__) +#define NF10BMAC_RX_INTR_DISABLE(sc) \ + NF10BMAC_WRITE_INTR_4((sc), NF10BMAC_INTR_CTRL, 0, \ + __func__, __LINE__) + + #ifdef ENABLE_WATCHDOG static void nf10bmac_tick(void *); #endif @@ -318,7 +336,7 @@ nf10bmac_rx_locked(struct nf10bmac_softc * skip to tlast). */ - len = NF10BMAC_READ_4(sc, NF10BMAC_RX_LEN); + len = NF10BMAC_READ_4(sc, NF10BMAC_RX_LEN) & NF10BMAC_DATA_LEN_MASK; if (len > (MCLBYTES - ETHER_ALIGN)) { nf10bmac_eat_packet_munch_munch(sc); return (0); @@ -435,6 +453,7 @@ nf10bmac_stop_locked(struct nf10bmac_sof ifp = sc->nf10bmac_ifp; ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + NF10BMAC_RX_INTR_CLEAR_DIS(sc); sc->nf10bmac_flags &= ~NF10BMAC_FLAGS_LINK; if_link_state_change(ifp, LINK_STATE_DOWN); @@ -498,6 +517,16 @@ nf10bmac_init_locked(struct nf10bmac_sof /* Instead drain the FIFO; or at least a possible first packet.. */ nf10bmac_eat_packet_munch_munch(sc); +#ifdef DEVICE_POLLING + /* Only enable interrupts if we are not polling. */ + if (ifp->if_capenable & IFCAP_POLLING) { + NF10BMAC_RX_INTR_CLEAR_DIS(sc); + } else +#endif + { + NF10BMAC_RX_INTR_ENABLE(sc); + } + ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; @@ -556,6 +585,49 @@ nf10bmac_tick(void *xsc) } #endif +static void +nf10bmac_intr(void *arg) +{ + struct nf10bmac_softc *sc; + struct ifnet *ifp; + int rx_npkts; + + sc = (struct nf10bmac_softc *)arg; + ifp = sc->nf10bmac_ifp; + + NF10BMAC_LOCK(sc); +#ifdef DEVICE_POLLING + if (ifp->if_capenable & IFCAP_POLLING) { + NF10BMAC_UNLOCK(sc); + return; + } +#endif + + /* NF10BMAC_RX_INTR_DISABLE(sc); */ + NF10BMAC_RX_INTR_CLEAR_DIS(sc); + + /* We only have an RX interrupt and no status information. */ + rx_npkts = 0; + while (rx_npkts < NF10BMAC_MAX_PKTS) { + int c; + + c = nf10bmac_rx_locked(sc); + rx_npkts += c; + if (c == 0) + break; + } + + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + /* Re-enable interrupts. */ + NF10BMAC_RX_INTR_ENABLE(sc); + + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + nf10bmac_start_locked(ifp); + } + NF10BMAC_UNLOCK(sc); +} + + #ifdef DEVICE_POLLING static int nf10bmac_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) @@ -649,10 +721,16 @@ nf10bmac_ioctl(struct ifnet *ifp, u_long break; } + NF10BMAC_RX_INTR_CLEAR_DIS(sc); + /* * Do not allow disabling of polling if we do * not have interrupts. */ + } else if (sc->nf10bmac_rx_irq_res != NULL) { + error = ether_poll_deregister(ifp); + /* Enable interrupts. */ + NF10BMAC_RX_INTR_ENABLE(sc); } else { ifp->if_capenable ^= IFCAP_POLLING; error = EINVAL; @@ -673,7 +751,6 @@ nf10bmac_ioctl(struct ifnet *ifp, u_long return (error); } - /* * Generic device handling routines. */ @@ -733,18 +810,40 @@ nf10bmac_attach(device_t dev) ifmedia_add(&sc->nf10bmac_media, IFM_ETHER | IFM_10G_T, 0, NULL); ifmedia_set(&sc->nf10bmac_media, IFM_ETHER | IFM_10G_T); - /* Interrupts would go here. */ + /* Initialise. */ + error = 0; + + /* Hook up interrupts. Well the one. */ + if (sc->nf10bmac_rx_irq_res != NULL) { + error = bus_setup_intr(dev, sc->nf10bmac_rx_irq_res, + INTR_TYPE_NET | INTR_MPSAFE, NULL, nf10bmac_intr, + sc, &sc->nf10bmac_rx_intrhand); + if (error != 0) { + device_printf(dev, "enabling RX IRQ failed\n"); + ether_ifdetach(ifp); + goto err; + } + } + if ((ifp->if_capenable & IFCAP_POLLING) != 0 || + sc->nf10bmac_rx_irq_res == NULL) { #ifdef DEVICE_POLLING - ifp->if_capenable |= IFCAP_POLLING; - device_printf(dev, "forcing to polling due to no interrupts\n"); - error = ether_poll_register(nf10bmac_poll, ifp); - if (error != 0) - goto err; + /* If not on and no IRQs force it on. */ + if (sc->nf10bmac_rx_irq_res == NULL) { + ifp->if_capenable |= IFCAP_POLLING; + device_printf(dev, + "forcing to polling due to no interrupts\n"); + } + error = ether_poll_register(nf10bmac_poll, ifp); + if (error != 0) + goto err; #else - device_printf(dev, "no DEVICE_POLLING in kernel and no IRQs\n"); - error = ENXIO; + device_printf(dev, "no DEVICE_POLLING in kernel and no IRQs\n"); + error = ENXIO; #endif + } else { + NF10BMAC_RX_INTR_ENABLE(sc); + } err: if (error != 0) @@ -780,6 +879,10 @@ nf10bmac_detach(device_t dev) ether_ifdetach(ifp); } + if (sc->nf10bmac_rx_intrhand) + bus_teardown_intr(dev, sc->nf10bmac_rx_irq_res, + sc->nf10bmac_rx_intrhand); + if (ifp != NULL) if_free(ifp); ifmedia_removeall(&sc->nf10bmac_media); @@ -797,10 +900,15 @@ nf10bmac_detach_resources(device_t dev) sc = device_get_softc(dev); - if (sc->nf10bmac_mem_res != NULL) { + if (sc->nf10bmac_rx_irq_res != NULL) { + bus_release_resource(dev, SYS_RES_IRQ, sc->nf10bmac_rx_irq_rid, + sc->nf10bmac_rx_irq_res); + sc->nf10bmac_rx_irq_res = NULL; + } + if (sc->nf10bmac_intr_res != NULL) { bus_release_resource(dev, SYS_RES_MEMORY, - sc->nf10bmac_mem_rid, sc->nf10bmac_mem_res); - sc->nf10bmac_mem_res = NULL; + sc->nf10bmac_intr_rid, sc->nf10bmac_intr_res); + sc->nf10bmac_intr_res = NULL; } if (sc->nf10bmac_rx_mem_res != NULL) { bus_release_resource(dev, SYS_RES_MEMORY, @@ -812,6 +920,11 @@ nf10bmac_detach_resources(device_t dev) sc->nf10bmac_tx_mem_rid, sc->nf10bmac_tx_mem_res); sc->nf10bmac_tx_mem_res = NULL; } + if (sc->nf10bmac_ctrl_res != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, + sc->nf10bmac_ctrl_rid, sc->nf10bmac_ctrl_res); + sc->nf10bmac_ctrl_res = NULL; + } } int Modified: head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c ============================================================================== --- head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c Fri May 9 12:13:22 2014 (r265765) +++ head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c Fri May 9 12:59:38 2014 (r265766) @@ -85,16 +85,34 @@ nf10bmac_attach_fdt(device_t dev) /* * FDT lists our resources. For convenience we use three different * mappings. We need to attach them in the oder specified in .dts: - * TX (size 0xc), RX (size 0xc), LOOP (size 0x4). + * LOOP (size 0x1f), TX (0x2f), RX (0x2f), INTR (0xf). */ + /* + * LOOP memory region (this could be a general control region). + * 0x00: 32bit register to enable a Y-"lopback". + */ + sc->nf10bmac_ctrl_rid = 0; + sc->nf10bmac_ctrl_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->nf10bmac_ctrl_rid, RF_ACTIVE); + if (sc->nf10bmac_ctrl_res == NULL) { + device_printf(dev, "failed to map memory for CTRL region\n"); + error = ENXIO; + goto err; + } + if (bootverbose) + device_printf(sc->nf10bmac_dev, "CTRL region at mem %p-%p\n", + (void *)rman_get_start(sc->nf10bmac_ctrl_res), + (void *)(rman_get_start(sc->nf10bmac_ctrl_res) + + rman_get_size(sc->nf10bmac_ctrl_res))); + /* * TX and TX metadata FIFO memory region. * 0x00: 32bit FIFO data, - * 0x04: 32bit FIFO metadata, - * 0x08: 32bit packet length. + * 0x08: 32bit FIFO metadata, + * 0x10: 32bit packet length. */ - sc->nf10bmac_tx_mem_rid = 0; + sc->nf10bmac_tx_mem_rid = 1; sc->nf10bmac_tx_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->nf10bmac_tx_mem_rid, RF_ACTIVE); if (sc->nf10bmac_tx_mem_res == NULL) { @@ -111,10 +129,10 @@ nf10bmac_attach_fdt(device_t dev) /* * RX and RXC metadata FIFO memory region. * 0x00: 32bit FIFO data, - * 0x04: 32bit FIFO metadata, - * 0x08: 32bit packet length. + * 0x08: 32bit FIFO metadata, + * 0x10: 32bit packet length. */ - sc->nf10bmac_rx_mem_rid = 1; + sc->nf10bmac_rx_mem_rid = 2; sc->nf10bmac_rx_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->nf10bmac_rx_mem_rid, RF_ACTIVE); if (sc->nf10bmac_rx_mem_res == NULL) { @@ -129,22 +147,28 @@ nf10bmac_attach_fdt(device_t dev) rman_get_size(sc->nf10bmac_rx_mem_res))); /* - * LOOP memory region (this could be a general control region). - * 0x00: 32bit register to enable a Y-"lopback". + * Interrupt handling registers. + * 0x00: 32bit register to clear (and disable) the RX interrupt. + * 0x08: 32bit register to enable or disable the RX interrupt. */ - sc->nf10bmac_mem_rid = 2; - sc->nf10bmac_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->nf10bmac_mem_rid, RF_ACTIVE); - if (sc->nf10bmac_mem_res == NULL) { - device_printf(dev, "failed to map memory for CTRL region\n"); + sc->nf10bmac_intr_rid = 3; + sc->nf10bmac_intr_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->nf10bmac_intr_rid, RF_ACTIVE); + if (sc->nf10bmac_intr_res == NULL) { + device_printf(dev, "failed to map memory for INTR region\n"); error = ENXIO; goto err; } if (bootverbose) - device_printf(sc->nf10bmac_dev, "CTRL region at mem %p-%p\n", - (void *)rman_get_start(sc->nf10bmac_mem_res), - (void *)(rman_get_start(sc->nf10bmac_mem_res) + - rman_get_size(sc->nf10bmac_mem_res))); + device_printf(sc->nf10bmac_dev, "INTR region at mem %p-%p\n", + (void *)rman_get_start(sc->nf10bmac_intr_res), + (void *)(rman_get_start(sc->nf10bmac_intr_res) + + rman_get_size(sc->nf10bmac_intr_res))); + + /* (Optional) RX and TX IRQ. */ + sc->nf10bmac_rx_irq_rid = 0; + sc->nf10bmac_rx_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->nf10bmac_rx_irq_rid, RF_ACTIVE | RF_SHAREABLE); error = nf10bmac_attach(dev); if (error) Modified: head/sys/dev/netfpga10g/nf10bmac/if_nf10bmacreg.h ============================================================================== --- head/sys/dev/netfpga10g/nf10bmac/if_nf10bmacreg.h Fri May 9 12:13:22 2014 (r265765) +++ head/sys/dev/netfpga10g/nf10bmac/if_nf10bmacreg.h Fri May 9 12:59:38 2014 (r265766) @@ -35,15 +35,20 @@ struct nf10bmac_softc { struct ifnet *nf10bmac_ifp; + struct resource *nf10bmac_ctrl_res; struct resource *nf10bmac_tx_mem_res; struct resource *nf10bmac_rx_mem_res; - struct resource *nf10bmac_mem_res; + struct resource *nf10bmac_intr_res; + struct resource *nf10bmac_rx_irq_res; + void *nf10bmac_rx_intrhand; uint8_t *nf10bmac_tx_buf; device_t nf10bmac_dev; int nf10bmac_unit; + int nf10bmac_ctrl_rid; int nf10bmac_tx_mem_rid; int nf10bmac_rx_mem_rid; - int nf10bmac_mem_rid; + int nf10bmac_intr_rid; + int nf10bmac_rx_irq_rid; int nf10bmac_if_flags; uint32_t nf10bmac_flags; #define NF10BMAC_FLAGS_LINK 0x00000001 From owner-svn-src-head@FreeBSD.ORG Fri May 9 13:07:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49C4B9C9; Fri, 9 May 2014 13:07:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37909247; Fri, 9 May 2014 13:07:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s49D7eS8051442; Fri, 9 May 2014 13:07:40 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49D7dt6051440; Fri, 9 May 2014 13:07:39 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405091307.s49D7dt6051440@svn.freebsd.org> From: Luiz Otavio O Souza Date: Fri, 9 May 2014 13:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265767 - head/sys/dev/etherswitch/ip17x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 13:07:40 -0000 Author: loos Date: Fri May 9 13:07:39 2014 New Revision: 265767 URL: http://svnweb.freebsd.org/changeset/base/265767 Log: Fix a bug on ip17x switch initialization which will fail as soon as you disable the debug and diagnosis options from current. We must wait 2ms after the switch reset and not 2us. Tested on RB433UAH. Modified: head/sys/dev/etherswitch/ip17x/ip175c.c head/sys/dev/etherswitch/ip17x/ip175d.c Modified: head/sys/dev/etherswitch/ip17x/ip175c.c ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip175c.c Fri May 9 12:59:38 2014 (r265766) +++ head/sys/dev/etherswitch/ip17x/ip175c.c Fri May 9 13:07:39 2014 (r265767) @@ -63,7 +63,7 @@ ip175c_reset(struct ip17x_softc *sc) if (ip17x_writephy(sc->sc_dev, IP175C_RESET_PHY, IP175C_RESET_REG, 0x175c)) return (-1); - DELAY(2); + DELAY(2000); /* Force IP175C mode. */ data = ip17x_readphy(sc->sc_dev, IP175C_MODE_PHY, IP175C_MODE_REG); Modified: head/sys/dev/etherswitch/ip17x/ip175d.c ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip175d.c Fri May 9 12:59:38 2014 (r265766) +++ head/sys/dev/etherswitch/ip17x/ip175d.c Fri May 9 13:07:39 2014 (r265767) @@ -62,7 +62,7 @@ ip175d_reset(struct ip17x_softc *sc) /* Reset all the switch settings. */ ip17x_writephy(sc->sc_dev, IP175D_RESET_PHY, IP175D_RESET_REG, 0x175d); - DELAY(2); + DELAY(2000); /* Disable the special tagging mode. */ ip17x_updatephy(sc->sc_dev, 21, 22, 0x3, 0x0); From owner-svn-src-head@FreeBSD.ORG Fri May 9 13:21:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1EC78107; Fri, 9 May 2014 13:21:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3DF93D2; Fri, 9 May 2014 13:21:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s49DLYNR059472; Fri, 9 May 2014 13:21:34 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49DLYIq059470; Fri, 9 May 2014 13:21:34 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405091321.s49DLYIq059470@svn.freebsd.org> From: Luiz Otavio O Souza Date: Fri, 9 May 2014 13:21:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265770 - head/sys/dev/etherswitch/ip17x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 13:21:35 -0000 Author: loos Date: Fri May 9 13:21:34 2014 New Revision: 265770 URL: http://svnweb.freebsd.org/changeset/base/265770 Log: Fix the build with debug enabled and remove a variable used only at switch initialization, it is nonsense keep it around without futher use. Modified: head/sys/dev/etherswitch/ip17x/ip17x.c head/sys/dev/etherswitch/ip17x/ip17x_var.h Modified: head/sys/dev/etherswitch/ip17x/ip17x.c ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip17x.c Fri May 9 13:21:14 2014 (r265769) +++ head/sys/dev/etherswitch/ip17x/ip17x.c Fri May 9 13:21:34 2014 (r265770) @@ -141,9 +141,7 @@ ip17x_attach_phys(struct ip17x_softc *sc sc->ifp[port]->if_softc = sc; sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; - sc->ifname[port] = malloc(strlen(name)+1, M_IP17X, M_WAITOK); - bcopy(name, sc->ifname[port], strlen(name)+1); - if_initname(sc->ifp[port], sc->ifname[port], port); + if_initname(sc->ifp[port], name, port); sc->miibus[port] = malloc(sizeof(device_t), M_IP17X, M_WAITOK | M_ZERO); err = mii_attach(sc->sc_dev, sc->miibus[port], sc->ifp[port], @@ -204,8 +202,6 @@ ip17x_attach(device_t dev) M_WAITOK | M_ZERO); sc->pvid = malloc(sizeof(uint32_t) * sc->numports, M_IP17X, M_WAITOK | M_ZERO); - sc->ifname = malloc(sizeof(char *) * sc->numports, M_IP17X, - M_WAITOK | M_ZERO); sc->miibus = malloc(sizeof(device_t *) * sc->numports, M_IP17X, M_WAITOK | M_ZERO); sc->portphy = malloc(sizeof(int) * sc->numports, M_IP17X, @@ -257,13 +253,11 @@ ip17x_detach(device_t dev) device_delete_child(dev, (*sc->miibus[port])); if (sc->ifp[port] != NULL) if_free(sc->ifp[port]); - free(sc->ifname[port], M_IP17X); free(sc->miibus[port], M_IP17X); } free(sc->portphy, M_IP17X); free(sc->miibus, M_IP17X); - free(sc->ifname, M_IP17X); free(sc->pvid, M_IP17X); free(sc->ifp, M_IP17X); @@ -490,12 +484,13 @@ ip17x_ifmedia_upd(struct ifnet *ifp) struct ip17x_softc *sc; struct mii_data *mii; - DPRINTF(sc->sc_dev, "%s\n", __func__); sc = ifp->if_softc; + DPRINTF(sc->sc_dev, "%s\n", __func__); mii = ip17x_miiforport(sc, ifp->if_dunit); if (mii == NULL) return (ENXIO); mii_mediachg(mii); + return (0); } @@ -505,9 +500,8 @@ ip17x_ifmedia_sts(struct ifnet *ifp, str struct ip17x_softc *sc; struct mii_data *mii; - DPRINTF(sc->sc_dev, "%s\n", __func__); - sc = ifp->if_softc; + DPRINTF(sc->sc_dev, "%s\n", __func__); mii = ip17x_miiforport(sc, ifp->if_dunit); if (mii == NULL) return; Modified: head/sys/dev/etherswitch/ip17x/ip17x_var.h ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip17x_var.h Fri May 9 13:21:14 2014 (r265769) +++ head/sys/dev/etherswitch/ip17x/ip17x_var.h Fri May 9 13:21:34 2014 (r265770) @@ -52,7 +52,6 @@ struct ip17x_softc { int phyport[MII_NPHY]; int numports; /* number of ports */ int *portphy; - char **ifname; device_t **miibus; etherswitch_info_t info; ip17x_switch_type sc_switchtype; From owner-svn-src-head@FreeBSD.ORG Fri May 9 13:27:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B457A6E4; Fri, 9 May 2014 13:27:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0439607; Fri, 9 May 2014 13:27:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s49DRVIh060874; Fri, 9 May 2014 13:27:31 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49DRVwL060872; Fri, 9 May 2014 13:27:31 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201405091327.s49DRVwL060872@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 9 May 2014 13:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265772 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 13:27:31 -0000 Author: jilles Date: Fri May 9 13:27:30 2014 New Revision: 265772 URL: http://svnweb.freebsd.org/changeset/base/265772 Log: sh: Add more necessary INTOFF/INTON. Modified: head/bin/sh/main.c head/bin/sh/options.c Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Fri May 9 13:23:23 2014 (r265771) +++ head/bin/sh/main.c Fri May 9 13:27:30 2014 (r265772) @@ -140,11 +140,13 @@ main(int argc, char *argv[]) #endif rootpid = getpid(); rootshell = 1; + INTOFF; initvar(); setstackmark(&smark); setstackmark(&smark2); procargs(argc, argv); pwd_init(iflag); + INTON; if (iflag) chkmail(1); if (argv[0] && argv[0][0] == '-') { Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Fri May 9 13:23:23 2014 (r265771) +++ head/bin/sh/options.c Fri May 9 13:27:30 2014 (r265772) @@ -475,7 +475,9 @@ atend: } else { out1fmt("Illegal option -%c\n", c); + INTOFF; (void) unsetvar("OPTARG"); + INTON; } c = '?'; goto bad; @@ -494,7 +496,9 @@ atend: } else { out1fmt("No arg for -%c option\n", c); + INTOFF; (void) unsetvar("OPTARG"); + INTON; c = '?'; } goto bad; From owner-svn-src-head@FreeBSD.ORG Fri May 9 13:32:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84A2ABAE; Fri, 9 May 2014 13:32:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71F526E1; Fri, 9 May 2014 13:32:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s49DWbnQ064740; Fri, 9 May 2014 13:32:37 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49DWbuW064738; Fri, 9 May 2014 13:32:37 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201405091332.s49DWbuW064738@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 9 May 2014 13:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265773 - in head/bin/sh: . tests/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 13:32:37 -0000 Author: jilles Date: Fri May 9 13:32:36 2014 New Revision: 265773 URL: http://svnweb.freebsd.org/changeset/base/265773 Log: sh: Send getopts error messages to stderr, not stdout. Adjust a testcase for this change. Modified: head/bin/sh/options.c head/bin/sh/tests/builtins/getopts1.0 Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Fri May 9 13:27:30 2014 (r265772) +++ head/bin/sh/options.c Fri May 9 13:32:36 2014 (r265773) @@ -474,7 +474,7 @@ atend: err |= setvarsafe("OPTARG", s, 0); } else { - out1fmt("Illegal option -%c\n", c); + out2fmt_flush("Illegal option -%c\n", c); INTOFF; (void) unsetvar("OPTARG"); INTON; @@ -495,7 +495,7 @@ atend: c = ':'; } else { - out1fmt("No arg for -%c option\n", c); + out2fmt_flush("No arg for -%c option\n", c); INTOFF; (void) unsetvar("OPTARG"); INTON; Modified: head/bin/sh/tests/builtins/getopts1.0 ============================================================================== --- head/bin/sh/tests/builtins/getopts1.0 Fri May 9 13:27:30 2014 (r265772) +++ head/bin/sh/tests/builtins/getopts1.0 Fri May 9 13:32:36 2014 (r265773) @@ -15,7 +15,7 @@ printf -- '-2-\n' set -- -ab getopts "ab:" OPTION echo ${OPTION} -getopts "ab:" OPTION +getopts "ab:" OPTION 3>&2 2>&1 >&3 3>&- echo ${OPTION} # The 'shift' is aimed at causing an error. From owner-svn-src-head@FreeBSD.ORG Fri May 9 13:44:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 912EFF2E; Fri, 9 May 2014 13:44:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E8FA834; Fri, 9 May 2014 13:44:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s49Dig2L069261; Fri, 9 May 2014 13:44:42 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49DigKh069260; Fri, 9 May 2014 13:44:42 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405091344.s49DigKh069260@svn.freebsd.org> From: Luiz Otavio O Souza Date: Fri, 9 May 2014 13:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265774 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 13:44:42 -0000 Author: loos Date: Fri May 9 13:44:42 2014 New Revision: 265774 URL: http://svnweb.freebsd.org/changeset/base/265774 Log: When a GPIO pin is set to be turned on by kernel hints (hint.gpio.X.pinon) make sure the GPIO pin is configured as an output as this is not always the case. Modified: head/sys/mips/atheros/ar71xx_gpio.c Modified: head/sys/mips/atheros/ar71xx_gpio.c ============================================================================== --- head/sys/mips/atheros/ar71xx_gpio.c Fri May 9 13:32:36 2014 (r265773) +++ head/sys/mips/atheros/ar71xx_gpio.c Fri May 9 13:44:42 2014 (r265774) @@ -437,10 +437,13 @@ ar71xx_gpio_attach(device_t dev) ar71xx_gpio_pin_configure(sc, &sc->gpio_pins[i], DEFAULT_CAPS); i++; } + /* Turn on the hinted pins. */ for (i = 0; i < sc->gpio_npins; i++) { j = sc->gpio_pins[i].gp_pin; - if ((pinon & (1 << j)) != 0) + if ((pinon & (1 << j)) != 0) { + ar71xx_gpio_pin_setflags(dev, j, GPIO_PIN_OUTPUT); ar71xx_gpio_pin_set(dev, j, 1); + } } device_add_child(dev, "gpioc", device_get_unit(dev)); device_add_child(dev, "gpiobus", device_get_unit(dev)); From owner-svn-src-head@FreeBSD.ORG Fri May 9 14:02:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6B4C29D; Fri, 9 May 2014 14:02:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 897969B8; Fri, 9 May 2014 14:02:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s49E2Jhe077698; Fri, 9 May 2014 14:02:19 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49E2IPV077696; Fri, 9 May 2014 14:02:18 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405091402.s49E2IPV077696@svn.freebsd.org> From: Luiz Otavio O Souza Date: Fri, 9 May 2014 14:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265775 - in head/sys: conf mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 14:02:19 -0000 Author: loos Date: Fri May 9 14:02:18 2014 New Revision: 265775 URL: http://svnweb.freebsd.org/changeset/base/265775 Log: Add support for reading RouterBoard's memory which is passed by the loader (RouterBOOT). Tested on RouterBoards, various and on RSPRO, TP-Link MR3x20 (for regressions). Modified: head/sys/conf/options.mips head/sys/mips/atheros/ar71xx_machdep.c Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Fri May 9 13:44:42 2014 (r265774) +++ head/sys/conf/options.mips Fri May 9 14:02:18 2014 (r265775) @@ -104,6 +104,7 @@ ARGE_MDIO opt_arge.h AR71XX_REALMEM opt_ar71xx.h AR71XX_ENV_UBOOT opt_ar71xx.h AR71XX_ENV_REDBOOT opt_ar71xx.h +AR71XX_ENV_ROUTERBOOT opt_ar71xx.h AR71XX_ATH_EEPROM opt_ar71xx.h # Modified: head/sys/mips/atheros/ar71xx_machdep.c ============================================================================== --- head/sys/mips/atheros/ar71xx_machdep.c Fri May 9 13:44:42 2014 (r265774) +++ head/sys/mips/atheros/ar71xx_machdep.c Fri May 9 14:02:18 2014 (r265775) @@ -140,6 +140,34 @@ ar71xx_redboot_get_macaddr(void) } } +#ifdef AR71XX_ENV_ROUTERBOOT +/* + * RouterBoot gives us the board memory in a command line argument. + */ +static int +ar71xx_routerboot_get_mem(int argc, char **argv) +{ + int i, board_mem; + + /* + * Protect ourselves from garbage in registers. + */ + if (!MIPS_IS_VALID_PTR(argv)) + return (0); + + for (i = 0; i < argc; i++) { + if (argv[i] == NULL) + continue; + if (strncmp(argv[i], "mem=", 4) == 0) { + if (sscanf(argv[i] + 4, "%dM", &board_mem) == 1) + return (btoc(board_mem * 1024 * 1024)); + } + } + + return (0); +} +#endif + void platform_start(__register_t a0 __unused, __register_t a1 __unused, __register_t a2 __unused, __register_t a3 __unused) @@ -183,6 +211,14 @@ platform_start(__register_t a0 __unused, } } +#ifdef AR71XX_ENV_ROUTERBOOT + /* + * RouterBoot informs the board memory as a command line argument. + */ + if (realmem == 0) + realmem = ar71xx_routerboot_get_mem(argc, argv); +#endif + /* * Just wild guess. RedBoot let us down and didn't reported * memory size From owner-svn-src-head@FreeBSD.ORG Fri May 9 14:15:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B17B4DB; Fri, 9 May 2014 14:15:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 886DBA9F; Fri, 9 May 2014 14:15:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s49EFmkA082934; Fri, 9 May 2014 14:15:48 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49EFm1v082933; Fri, 9 May 2014 14:15:48 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201405091415.s49EFm1v082933@svn.freebsd.org> From: Michael Tuexen Date: Fri, 9 May 2014 14:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265776 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 14:15:48 -0000 Author: tuexen Date: Fri May 9 14:15:48 2014 New Revision: 265776 URL: http://svnweb.freebsd.org/changeset/base/265776 Log: Fix a logic bug which prevented the sending of UDP packet with 0 checksum. This bug was introduced in r264212 and should be X-MFCed with that revision, if UDP-Lite support if MFCed. Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Fri May 9 14:02:18 2014 (r265775) +++ head/sys/netinet/udp_usrreq.c Fri May 9 14:15:48 2014 (r265776) @@ -1375,7 +1375,8 @@ udp_output(struct inpcb *inp, struct mbu faddr.s_addr = INADDR_BROADCAST; if ((ui->ui_sum = in_cksum(m, sizeof(struct ip) + cscov)) == 0) ui->ui_sum = 0xffff; - } else if (V_udp_cksum || !cscov_partial) { + } else if (V_udp_cksum || pr == IPPROTO_UDPLITE) { + /* for UDP-Lite full checksum coverage is requested */ if (inp->inp_flags & INP_ONESBCAST) faddr.s_addr = INADDR_BROADCAST; ui->ui_sum = in_pseudo(ui->ui_src.s_addr, faddr.s_addr, From owner-svn-src-head@FreeBSD.ORG Fri May 9 14:23:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E7A1727; Fri, 9 May 2014 14:23:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A872B57; Fri, 9 May 2014 14:23:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s49EN7uG086882; Fri, 9 May 2014 14:23:07 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49EN7tj086880; Fri, 9 May 2014 14:23:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405091423.s49EN7tj086880@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 9 May 2014 14:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265777 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 14:23:07 -0000 Author: hselasky Date: Fri May 9 14:23:06 2014 New Revision: 265777 URL: http://svnweb.freebsd.org/changeset/base/265777 Log: Multiple DWC OTG host mode related fixes and improvements: - Rework how we allocate and free USB host channels, so that we only allocate a channel if there is a real packet going out on the USB cable. - Use BULK type for control data and status, due to instabilities in the HW it appears. - Split FIFO TX levels into one for the periodic FIFO and one for the non-periodic FIFO. - Use correct HFNUM mask when scheduling host transactions. The HFNUM register does not count the full 16-bit range. - Correct START/COMPLETION slot for TT transactions. For INTERRUPT and ISOCHRONOUS type transactions the hardware always respects the ODDFRM bit, which means we need to allocate multiple host channels when processing such endpoints, to not miss any so-called complete split opportunities. - When doing ISOCHRONOUS OUT transfers through a TT send all data payload in a single ALL-burst. This deacreases the likelyhood for isochronous data underruns. - Fixed unbalanced unlock in case of "dwc_otg_init_fifo()" failure. - Increase interrupt priority. MFC after: 2 weeks Modified: head/sys/dev/usb/controller/dwc_otg.c head/sys/dev/usb/controller/dwc_otg.h head/sys/dev/usb/controller/dwc_otg_fdt.c head/sys/dev/usb/controller/dwc_otgreg.h Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Fri May 9 14:15:48 2014 (r265776) +++ head/sys/dev/usb/controller/dwc_otg.c Fri May 9 14:23:06 2014 (r265777) @@ -92,6 +92,9 @@ #define DWC_OTG_PC2SC(pc) \ DWC_OTG_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus) +#define DWC_OTG_PC2UDEV(pc) \ + (USB_DMATAG_TO_XROOT((pc)->tag_parent)->udev) + #define DWC_OTG_MSK_GINT_ENABLED \ (GINTMSK_ENUMDONEMSK | \ GINTMSK_USBRSTMSK | \ @@ -136,8 +139,8 @@ static dwc_otg_cmd_t dwc_otg_host_data_r static void dwc_otg_device_done(struct usb_xfer *, usb_error_t); static void dwc_otg_do_poll(struct usb_bus *); static void dwc_otg_standard_done(struct usb_xfer *); -static void dwc_otg_root_intr(struct dwc_otg_softc *sc); -static void dwc_otg_interrupt_poll(struct dwc_otg_softc *sc); +static void dwc_otg_root_intr(struct dwc_otg_softc *); +static void dwc_otg_interrupt_poll(struct dwc_otg_softc *); /* * Here is a configuration that the chip supports. @@ -177,26 +180,33 @@ dwc_otg_init_fifo(struct dwc_otg_softc * fifo_size = sc->sc_fifo_size; - fifo_regs = 4 * (sc->sc_dev_ep_max + sc->sc_dev_in_ep_max); + /* + * NOTE: Reserved fixed size area at end of RAM, which must + * not be allocated to the FIFOs: + */ + fifo_regs = 4 * 16; - if (fifo_size >= fifo_regs) - fifo_size -= fifo_regs; - else - fifo_size = 0; + if (fifo_size < fifo_regs) { + DPRINTF("Too little FIFO\n"); + return (EINVAL); + } + + /* subtract FIFO regs from total once */ + fifo_size -= fifo_regs; /* split equally for IN and OUT */ fifo_size /= 2; - DWC_OTG_WRITE_4(sc, DOTG_GRXFSIZ, fifo_size / 4); - - /* align to 4-bytes */ + /* align to 4 bytes boundary */ fifo_size &= ~3; + /* set global receive FIFO size */ + DWC_OTG_WRITE_4(sc, DOTG_GRXFSIZ, fifo_size / 4); + tx_start = fifo_size; - if (fifo_size < 0x40) { + if (fifo_size < 64) { DPRINTFN(-1, "Not enough data space for EP0 FIFO.\n"); - USB_BUS_UNLOCK(&sc->sc_bus); return (EINVAL); } @@ -205,14 +215,12 @@ dwc_otg_init_fifo(struct dwc_otg_softc * /* reset active endpoints */ sc->sc_active_rx_ep = 0; - /* reset TX size */ - sc->sc_tx_cur_size = 0; - - /* reset TT info */ - memset(sc->sc_tt_info, 0, sizeof(sc->sc_tt_info)); - + /* split equally for periodic and non-periodic */ fifo_size /= 2; + /* align to 4 bytes boundary */ + fifo_size &= ~3; + DWC_OTG_WRITE_4(sc, DOTG_GNPTXFSIZ, ((fifo_size / 4) << 16) | (tx_start / 4)); @@ -228,7 +236,11 @@ dwc_otg_init_fifo(struct dwc_otg_softc * ((fifo_size / 4) << 16) | (tx_start / 4)); - /* store maximum TX FIFO size */ + /* reset FIFO TX levels */ + sc->sc_tx_cur_p_level = 0; + sc->sc_tx_cur_np_level = 0; + + /* store maximum periodic and non-periodic FIFO TX size */ sc->sc_tx_max_size = fifo_size; /* disable all host channel interrupts */ @@ -311,11 +323,12 @@ dwc_otg_init_fifo(struct dwc_otg_softc * /* reset active endpoints */ sc->sc_active_rx_ep = 0; - /* reset TX size */ - sc->sc_tx_cur_size = 0; + /* reset periodic and non-periodic FIFO TX size */ + sc->sc_tx_max_size = fifo_size; - /* reset TT info */ - memset(sc->sc_tt_info, 0, sizeof(sc->sc_tt_info)); + /* reset FIFO TX levels */ + sc->sc_tx_cur_p_level = 0; + sc->sc_tx_cur_np_level = 0; } return (0); } @@ -555,125 +568,70 @@ dwc_otg_clear_hcint(struct dwc_otg_softc sc->sc_chan_state[x].hcint = 0; } -/* - * This function waits until a DWC OTG host channel is ready to be - * used again: - */ static uint8_t -dwc_otg_host_channel_wait(struct dwc_otg_td *td) +dwc_otg_host_channel_alloc(struct dwc_otg_td *td, uint8_t which) { struct dwc_otg_softc *sc; + uint32_t tx_p_size; + uint32_t tx_np_size; uint8_t x; - x = td->channel; - - DPRINTF("CH=%d\n", x); - - /* get pointer to softc */ - sc = DWC_OTG_PC2SC(td->pc); - - if (sc->sc_chan_state[x].wait_sof == 0) { - dwc_otg_clear_hcint(sc, x); - return (1); /* done */ - } - - if (x == 0) - return (0); /* wait */ - - /* find new disabled channel */ - for (x = 1; x != sc->sc_host_ch_max; x++) { - - if (sc->sc_chan_state[x].allocated) - continue; - if (sc->sc_chan_state[x].wait_sof != 0) - continue; - - sc->sc_chan_state[td->channel].allocated = 0; - sc->sc_chan_state[x].allocated = 1; - - sc->sc_chan_state[x].tx_size = - sc->sc_chan_state[td->channel].tx_size; - - if (sc->sc_chan_state[td->channel].suspended) { - sc->sc_chan_state[td->channel].suspended = 0; - sc->sc_chan_state[x].suspended = 1; - } - - /* clear interrupts */ - dwc_otg_clear_hcint(sc, x); - - DPRINTF("CH=%d HCCHAR=0x%08x " - "HCSPLT=0x%08x\n", x, td->hcchar, td->hcsplt); - - /* ack any pending messages */ - if (sc->sc_last_rx_status != 0 && - GRXSTSRD_CHNUM_GET(sc->sc_last_rx_status) == td->channel) { - /* get rid of message */ - dwc_otg_common_rx_ack(sc); - } - - /* move active channel */ - sc->sc_active_rx_ep &= ~(1 << td->channel); - sc->sc_active_rx_ep |= (1 << x); - - /* set channel */ - td->channel = x; - - return (1); /* new channel allocated */ - } - return (0); /* wait */ -} - -static uint8_t -dwc_otg_host_channel_alloc(struct dwc_otg_td *td) -{ - struct dwc_otg_softc *sc; - uint32_t tx_size; - uint8_t x; - uint8_t max_channel; - - if (td->channel < DWC_OTG_MAX_CHANNELS) + if (td->channel[which] < DWC_OTG_MAX_CHANNELS) return (0); /* already allocated */ + /* check if device is suspended */ + if (DWC_OTG_PC2UDEV(td->pc)->flags.self_suspended != 0) + return (1); /* busy - cannot transfer data */ + /* get pointer to softc */ sc = DWC_OTG_PC2SC(td->pc); - if ((td->hcchar & HCCHAR_EPNUM_MASK) == 0) { - max_channel = 1; - x = 0; - tx_size = td->max_packet_size; - if ((sc->sc_tx_cur_size + tx_size) > sc->sc_tx_max_size) { - DPRINTF("Too little FIFO space\n"); - return (1); /* too little FIFO */ - } - } else { - max_channel = sc->sc_host_ch_max; - x = 1; - if ((td->hcchar & HCCHAR_EPDIR) == HCCHAR_EPDIR_OUT) { - tx_size = td->max_packet_size; - if (td->hcsplt != 0 && tx_size > HCSPLT_XACTLEN_MAX) - tx_size = HCSPLT_XACTLEN_MAX; - if ((sc->sc_tx_cur_size + tx_size) > sc->sc_tx_max_size) { + /* compute needed TX FIFO size */ + if (td->ep_type == UE_CONTROL) { + /* RX and TX transactions */ + tx_p_size = 0; + tx_np_size = td->max_packet_size; + } else if ((td->hcchar & HCCHAR_EPDIR) == HCCHAR_EPDIR_OUT) { + if (td->ep_type == UE_INTERRUPT || + td->ep_type == UE_ISOCHRONOUS) { + tx_p_size = td->max_packet_size; + tx_np_size = 0; + if (td->hcsplt != 0 && tx_p_size > HCSPLT_XACTLEN_BURST) + tx_p_size = HCSPLT_XACTLEN_BURST; + if ((sc->sc_tx_cur_p_level + tx_p_size) > sc->sc_tx_max_size) { DPRINTF("Too little FIFO space\n"); return (1); /* too little FIFO */ } } else { - tx_size = 0; + tx_p_size = 0; + tx_np_size = td->max_packet_size; + if (td->hcsplt != 0 && tx_np_size > HCSPLT_XACTLEN_BURST) + tx_np_size = HCSPLT_XACTLEN_BURST; + if ((sc->sc_tx_cur_np_level + tx_np_size) > sc->sc_tx_max_size) { + DPRINTF("Too little FIFO space\n"); + return (1); /* too little FIFO */ + } } + } else { + /* not a TX transaction */ + tx_p_size = 0; + tx_np_size = 0; } - for (; x != max_channel; x++) { - - if (sc->sc_chan_state[x].allocated) + for (x = 0; x != sc->sc_host_ch_max; x++) { + if (sc->sc_chan_state[x].allocated != 0) continue; + /* check if channel is still enabled */ if (sc->sc_chan_state[x].wait_sof != 0) continue; sc->sc_chan_state[x].allocated = 1; - sc->sc_chan_state[x].tx_size = tx_size; + sc->sc_chan_state[x].tx_p_size = tx_p_size; + sc->sc_chan_state[x].tx_np_size = tx_np_size; - /* keep track of used FIFO */ - sc->sc_tx_cur_size += tx_size; + /* keep track of used TX FIFO, if any */ + sc->sc_tx_cur_p_level += tx_p_size; + sc->sc_tx_cur_np_level += tx_np_size; /* clear interrupts */ dwc_otg_clear_hcint(sc, x); @@ -685,54 +643,38 @@ dwc_otg_host_channel_alloc(struct dwc_ot sc->sc_active_rx_ep |= (1 << x); /* set channel */ - td->channel = x; + td->channel[which] = x; return (0); /* allocated */ } + /* wait a bit */ + dwc_otg_enable_sof_irq(sc); return (1); /* busy */ } static void -dwc_otg_host_channel_disable(struct dwc_otg_softc *sc, uint8_t x) -{ - uint32_t hcchar; - if (sc->sc_chan_state[x].wait_sof != 0) - return; - hcchar = DWC_OTG_READ_4(sc, DOTG_HCCHAR(x)); - if (hcchar & (HCCHAR_CHENA | HCCHAR_CHDIS)) { - /* disable channel */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(x), - HCCHAR_CHENA | HCCHAR_CHDIS); - /* don't re-use channel until next SOF is transmitted */ - sc->sc_chan_state[x].wait_sof = 2; - } -} - -static void -dwc_otg_host_channel_free(struct dwc_otg_td *td) +dwc_otg_host_channel_free(struct dwc_otg_td *td, uint8_t which) { struct dwc_otg_softc *sc; uint8_t x; - if (td->channel >= DWC_OTG_MAX_CHANNELS) + if (td->channel[which] >= DWC_OTG_MAX_CHANNELS) return; /* already freed */ /* free channel */ - x = td->channel; - td->channel = DWC_OTG_MAX_CHANNELS; + x = td->channel[which]; + td->channel[which] = DWC_OTG_MAX_CHANNELS; DPRINTF("CH=%d\n", x); /* get pointer to softc */ sc = DWC_OTG_PC2SC(td->pc); - - dwc_otg_host_channel_disable(sc, x); - + sc->sc_chan_state[x].wait_sof = DWC_OTG_SLOT_IDLE_MAX; sc->sc_chan_state[x].allocated = 0; - sc->sc_chan_state[x].suspended = 0; - /* keep track of used FIFO */ - sc->sc_tx_cur_size -= sc->sc_chan_state[x].tx_size; + /* keep track of used TX FIFO, if any */ + sc->sc_tx_cur_p_level -= sc->sc_chan_state[x].tx_p_size; + sc->sc_tx_cur_np_level -= sc->sc_chan_state[x].tx_np_size; /* ack any pending messages */ if (sc->sc_last_rx_status != 0 && @@ -751,30 +693,33 @@ dwc_otg_host_setup_tx(struct dwc_otg_td struct dwc_otg_softc *sc; uint32_t hcint; uint32_t hcchar; - - if (dwc_otg_host_channel_alloc(td)) - goto busy; + uint8_t delta; /* get pointer to softc */ sc = DWC_OTG_PC2SC(td->pc); - hcint = sc->sc_chan_state[td->channel].hcint; + if (td->channel[0] < DWC_OTG_MAX_CHANNELS) { + hcint = sc->sc_chan_state[td->channel[0]].hcint; - DPRINTF("CH=%d ST=%d HCINT=0x%08x HCCHAR=0x%08x HCTSIZ=0x%08x\n", - td->channel, td->state, hcint, - DWC_OTG_READ_4(sc, DOTG_HCCHAR(td->channel)), - DWC_OTG_READ_4(sc, DOTG_HCTSIZ(td->channel))); + DPRINTF("CH=%d ST=%d HCINT=0x%08x HCCHAR=0x%08x HCTSIZ=0x%08x\n", + td->channel[0], td->state, hcint, + DWC_OTG_READ_4(sc, DOTG_HCCHAR(td->channel[0])), + DWC_OTG_READ_4(sc, DOTG_HCTSIZ(td->channel[0]))); + } else { + hcint = 0; + goto check_state; + } if (hcint & (HCINT_RETRY | HCINT_ACK | HCINT_NYET)) { /* give success bits priority over failure bits */ } else if (hcint & HCINT_STALL) { - DPRINTF("CH=%d STALL\n", td->channel); + DPRINTF("CH=%d STALL\n", td->channel[0]); td->error_stall = 1; td->error_any = 1; goto complete; } else if (hcint & HCINT_ERRORS) { - DPRINTF("CH=%d ERROR\n", td->channel); + DPRINTF("CH=%d ERROR\n", td->channel[0]); td->errcnt++; if (td->hcsplt != 0 || td->errcnt >= 3) { td->error_any = 1; @@ -782,34 +727,23 @@ dwc_otg_host_setup_tx(struct dwc_otg_td } } - /* channel must be disabled before we can complete the transfer */ - if (hcint & (HCINT_ERRORS | HCINT_RETRY | HCINT_ACK | HCINT_NYET)) { - - dwc_otg_host_channel_disable(sc, td->channel); - if (!(hcint & HCINT_ERRORS)) td->errcnt = 0; } +check_state: switch (td->state) { case DWC_CHAN_ST_START: - if (!dwc_otg_host_channel_wait(td)) - break; goto send_pkt; case DWC_CHAN_ST_WAIT_ANE: if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { - if (!dwc_otg_host_channel_wait(td)) - break; td->did_nak = 1; td->tt_scheduled = 0; goto send_pkt; - } - if (hcint & (HCINT_ACK | HCINT_NYET)) { - if (!dwc_otg_host_channel_wait(td)) - break; + } else if (hcint & (HCINT_ACK | HCINT_NYET)) { td->offset += td->tx_bytes; td->remainder -= td->tx_bytes; td->toggle = 1; @@ -820,35 +754,22 @@ dwc_otg_host_setup_tx(struct dwc_otg_td case DWC_CHAN_ST_WAIT_S_ANE: if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { - if (!dwc_otg_host_channel_wait(td)) - break; td->did_nak = 1; td->tt_scheduled = 0; goto send_pkt; - } - if (hcint & (HCINT_ACK | HCINT_NYET)) { - if (!dwc_otg_host_channel_wait(td)) - break; + } else if (hcint & (HCINT_ACK | HCINT_NYET)) { goto send_cpkt; } break; case DWC_CHAN_ST_WAIT_C_ANE: if (hcint & HCINT_NYET) { - if (!dwc_otg_host_channel_wait(td)) - break; goto send_cpkt; - } - if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { - if (!dwc_otg_host_channel_wait(td)) - break; + } else if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { td->did_nak = 1; td->tt_scheduled = 0; goto send_pkt; - } - if (hcint & HCINT_ACK) { - if (!dwc_otg_host_channel_wait(td)) - break; + } else if (hcint & HCINT_ACK) { td->offset += td->tx_bytes; td->remainder -= td->tx_bytes; td->toggle = 1; @@ -857,8 +778,6 @@ dwc_otg_host_setup_tx(struct dwc_otg_td break; case DWC_CHAN_ST_WAIT_C_PKT: - if (!dwc_otg_host_channel_wait(td)) - break; goto send_cpkt; default: @@ -867,20 +786,36 @@ dwc_otg_host_setup_tx(struct dwc_otg_td goto busy; send_pkt: + /* free existing channel, if any */ + dwc_otg_host_channel_free(td, 0); + if (sizeof(req) != td->remainder) { td->error_any = 1; goto complete; } if (td->hcsplt != 0) { - /* Wait for our turn, if TT transfer */ - if (td->tt_scheduled == 0 || - (sc->sc_last_frame_num & 7) < td->tt_start_slot) { - /* set return state */ + delta = td->tt_start_slot - sc->sc_last_frame_num - 1; + if (td->tt_scheduled == 0 || delta < DWC_OTG_TT_SLOT_MAX) { + td->state = DWC_CHAN_ST_START; + goto busy; + } + delta = sc->sc_last_frame_num - td->tt_start_slot; + if (delta > 5) { + /* missed it */ + td->tt_scheduled = 0; td->state = DWC_CHAN_ST_START; - goto tt_wait; + goto busy; } + } + /* allocate a new channel */ + if (dwc_otg_host_channel_alloc(td, 0)) { + td->state = DWC_CHAN_ST_START; + goto busy; + } + + if (td->hcsplt != 0) { td->hcsplt &= ~HCSPLT_COMPSPLT; td->state = DWC_CHAN_ST_WAIT_S_ANE; } else { @@ -889,60 +824,73 @@ send_pkt: usbd_copy_out(td->pc, 0, &req, sizeof(req)); - DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), + DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel[0]), (sizeof(req) << HCTSIZ_XFERSIZE_SHIFT) | (1 << HCTSIZ_PKTCNT_SHIFT) | (HCTSIZ_PID_SETUP << HCTSIZ_PID_SHIFT)); - DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel), td->hcsplt); + DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel[0]), td->hcsplt); hcchar = td->hcchar; - hcchar &= ~HCCHAR_EPDIR_IN; + hcchar &= ~(HCCHAR_EPDIR_IN | HCCHAR_EPTYPE_MASK); + hcchar |= UE_CONTROL << HCCHAR_EPTYPE_SHIFT; /* must enable channel before writing data to FIFO */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel), hcchar); + DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel[0]), hcchar); /* transfer data into FIFO */ bus_space_write_region_4(sc->sc_io_tag, sc->sc_io_hdl, - DOTG_DFIFO(td->channel), (uint32_t *)&req, sizeof(req) / 4); + DOTG_DFIFO(td->channel[0]), (uint32_t *)&req, sizeof(req) / 4); /* store number of bytes transmitted */ td->tx_bytes = sizeof(req); - goto busy; send_cpkt: - /* Wait for our turn, if TT transfer */ - if (td->tt_scheduled == 0 || - (sc->sc_last_frame_num & 7) < td->tt_complete_slot) { - /* set return state */ + /* free existing channel, if any */ + dwc_otg_host_channel_free(td, 0); + + delta = td->tt_complete_slot - sc->sc_last_frame_num - 1; + if (td->tt_scheduled == 0 || delta < DWC_OTG_TT_SLOT_MAX) { td->state = DWC_CHAN_ST_WAIT_C_PKT; - goto tt_wait; + goto busy; + } + delta = sc->sc_last_frame_num - td->tt_start_slot; + if (delta > DWC_OTG_TT_SLOT_MAX) { + /* we missed the service interval */ + if (td->ep_type != UE_ISOCHRONOUS) + td->error_any = 1; + goto complete; } + /* allocate a new channel */ + if (dwc_otg_host_channel_alloc(td, 0)) { + td->state = DWC_CHAN_ST_WAIT_C_PKT; + goto busy; + } + /* wait until next slot before trying again */ td->tt_complete_slot++; td->hcsplt |= HCSPLT_COMPSPLT; td->state = DWC_CHAN_ST_WAIT_C_ANE; - DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), + DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel[0]), (HCTSIZ_PID_SETUP << HCTSIZ_PID_SHIFT)); - DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel), td->hcsplt); + DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel[0]), td->hcsplt); hcchar = td->hcchar; - hcchar &= ~HCCHAR_EPDIR_IN; + hcchar &= ~(HCCHAR_EPDIR_IN | HCCHAR_EPTYPE_MASK); + hcchar |= UE_CONTROL << HCCHAR_EPTYPE_SHIFT; /* must enable channel before writing data to FIFO */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel), hcchar); - goto busy; + DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel[0]), hcchar); -tt_wait: - /* free allocated channel */ - dwc_otg_host_channel_free(td); busy: return (1); /* busy */ + complete: + dwc_otg_host_channel_free(td, 0); return (0); /* complete */ } @@ -1100,20 +1048,11 @@ static uint8_t dwc_otg_host_rate_check(struct dwc_otg_td *td) { struct dwc_otg_softc *sc; - uint8_t ep_type; /* get pointer to softc */ sc = DWC_OTG_PC2SC(td->pc); - if (td->channel < DWC_OTG_MAX_CHANNELS && - sc->sc_chan_state[td->channel].suspended) - goto busy; - - ep_type = ((td->hcchar & - HCCHAR_EPTYPE_MASK) >> HCCHAR_EPTYPE_SHIFT); - - if (ep_type == UE_ISOCHRONOUS) { - + if (td->ep_type == UE_ISOCHRONOUS) { /* non TT isochronous traffic */ if ((td->tmr_val != 0) || (sc->sc_last_frame_num & (td->tmr_res - 1))) { @@ -1122,7 +1061,7 @@ dwc_otg_host_rate_check(struct dwc_otg_t td->tmr_val = 1; /* executed */ td->toggle = 0; - } else if (ep_type == UE_INTERRUPT) { + } else if (td->ep_type == UE_INTERRUPT) { if (!td->tt_scheduled) goto busy; td->tt_scheduled = 0; @@ -1144,23 +1083,24 @@ dwc_otg_host_data_rx(struct dwc_otg_td * uint32_t hcint; uint32_t hcchar; uint32_t count; - uint8_t ep_type; - - if (dwc_otg_host_channel_alloc(td)) - goto busy; + uint8_t delta; + uint8_t channel; /* get pointer to softc */ sc = DWC_OTG_PC2SC(td->pc); + channel = td->channel[td->tt_channel_tog]; - ep_type = ((td->hcchar & - HCCHAR_EPTYPE_MASK) >> HCCHAR_EPTYPE_SHIFT); + if (channel < DWC_OTG_MAX_CHANNELS) { + hcint = sc->sc_chan_state[channel].hcint; - hcint = sc->sc_chan_state[td->channel].hcint; - - DPRINTF("CH=%d ST=%d HCINT=0x%08x HCCHAR=0x%08x HCTSIZ=0x%08x\n", - td->channel, td->state, hcint, - DWC_OTG_READ_4(sc, DOTG_HCCHAR(td->channel)), - DWC_OTG_READ_4(sc, DOTG_HCTSIZ(td->channel))); + DPRINTF("CH=%d ST=%d HCINT=0x%08x HCCHAR=0x%08x HCTSIZ=0x%08x\n", + channel, td->state, hcint, + DWC_OTG_READ_4(sc, DOTG_HCCHAR(channel)), + DWC_OTG_READ_4(sc, DOTG_HCTSIZ(channel))); + } else { + hcint = 0; + goto check_state; + } /* check interrupt bits */ @@ -1168,37 +1108,26 @@ dwc_otg_host_data_rx(struct dwc_otg_td * HCINT_ACK | HCINT_NYET)) { /* give success bits priority over failure bits */ } else if (hcint & HCINT_STALL) { - DPRINTF("CH=%d STALL\n", td->channel); + DPRINTF("CH=%d STALL\n", channel); td->error_stall = 1; td->error_any = 1; goto complete; } else if (hcint & HCINT_ERRORS) { - DPRINTF("CH=%d ERROR\n", td->channel); + DPRINTF("CH=%d ERROR\n", channel); td->errcnt++; if (td->hcsplt != 0 || td->errcnt >= 3) { - if (ep_type != UE_ISOCHRONOUS) { + if (td->ep_type != UE_ISOCHRONOUS) { td->error_any = 1; goto complete; } } } - /* channel must be disabled before we can complete the transfer */ - - if (hcint & (HCINT_ERRORS | HCINT_RETRY | - HCINT_ACK | HCINT_NYET)) { - - dwc_otg_host_channel_disable(sc, td->channel); - - if (!(hcint & HCINT_ERRORS)) - td->errcnt = 0; - } - /* check endpoint status */ if (sc->sc_last_rx_status == 0) goto check_state; - if (GRXSTSRD_CHNUM_GET(sc->sc_last_rx_status) != td->channel) + if (GRXSTSRD_CHNUM_GET(sc->sc_last_rx_status) != channel) goto check_state; switch (sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) { @@ -1220,7 +1149,7 @@ dwc_otg_host_data_rx(struct dwc_otg_td * count = GRXSTSRD_BCNT_GET(sc->sc_last_rx_status); /* check for isochronous transfer or high-speed bandwidth endpoint */ - if (ep_type == UE_ISOCHRONOUS || td->max_packet_count > 1) { + if (td->ep_type == UE_ISOCHRONOUS || td->max_packet_count > 1) { if ((sc->sc_last_rx_status & GRXSTSRD_DPID_MASK) != GRXSTSRD_DPID_DATA0) { td->tt_xactpos = HCSPLT_XACTPOS_MIDDLE; } else { @@ -1269,8 +1198,8 @@ dwc_otg_host_data_rx(struct dwc_otg_td * td->remainder -= count; td->offset += count; - hcint |= HCINT_SOFTWARE_ONLY | HCINT_ACK; - sc->sc_chan_state[td->channel].hcint = hcint; + hcint |= HCINT_SOFTWARE_ONLY; + sc->sc_chan_state[channel].hcint = hcint; break; default: @@ -1280,10 +1209,14 @@ dwc_otg_host_data_rx(struct dwc_otg_td * dwc_otg_common_rx_ack(sc); check_state: + if (hcint & (HCINT_ERRORS | HCINT_RETRY | + HCINT_ACK | HCINT_NYET)) { + if (!(hcint & HCINT_ERRORS)) + td->errcnt = 0; + } + switch (td->state) { case DWC_CHAN_ST_START: - if (!dwc_otg_host_channel_wait(td)) - break; if (td->hcsplt != 0) goto receive_spkt; else @@ -1291,38 +1224,29 @@ check_state: case DWC_CHAN_ST_WAIT_ANE: if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { - if (!dwc_otg_host_channel_wait(td)) - break; - td->did_nak = 1; td->tt_scheduled = 0; if (td->hcsplt != 0) goto receive_spkt; else goto receive_pkt; - } - if (!(hcint & HCINT_SOFTWARE_ONLY)) { - if (hcint & HCINT_NYET) { - if (ep_type == UE_ISOCHRONOUS) { - /* we missed the service interval */ - goto complete; - } - if (!dwc_otg_host_channel_wait(td)) - break; + } else if (hcint & HCINT_NYET) { + if (td->hcsplt != 0) { + /* try again */ goto receive_pkt; + } else { + /* not a valid token for IN endpoints */ + td->error_any = 1; + goto complete; } - break; - } - if (hcint & (HCINT_ACK | HCINT_NYET)) { - if (!dwc_otg_host_channel_wait(td)) - break; - - if (ep_type == UE_ISOCHRONOUS) { + } else if (hcint & HCINT_ACK) { + if (td->ep_type == UE_ISOCHRONOUS) { /* check if we are complete */ if ((td->remainder == 0) || - (td->tt_xactpos == HCSPLT_XACTPOS_BEGIN)) + (td->tt_xactpos == HCSPLT_XACTPOS_BEGIN)) { goto complete; - + } + /* get another packet */ goto receive_pkt; } else { /* check if we are complete */ @@ -1350,23 +1274,17 @@ check_state: * case of interrupt and isochronous transfers: */ if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { - if (!dwc_otg_host_channel_wait(td)) - break; - td->did_nak = 1; td->tt_scheduled = 0; goto receive_spkt; - } - if (hcint & (HCINT_ACK | HCINT_NYET)) { - if (!dwc_otg_host_channel_wait(td)) - break; + } else if (hcint & HCINT_NYET) { + td->tt_scheduled = 0; + goto receive_spkt; + } else if (hcint & HCINT_ACK) goto receive_pkt; - } break; case DWC_CHAN_ST_WAIT_C_PKT: - if (!dwc_otg_host_channel_wait(td)) - break; goto receive_pkt; default: @@ -1375,103 +1293,149 @@ check_state: goto busy; receive_pkt: + /* free existing channel, if any */ + dwc_otg_host_channel_free(td, td->tt_channel_tog); + if (td->hcsplt != 0) { - /* Wait for our turn, if TT transfer */ - if (td->tt_scheduled == 0 || - (sc->sc_last_frame_num & 7) < td->tt_complete_slot) { - /* set return state */ + delta = td->tt_complete_slot - sc->sc_last_frame_num - 1; + if (td->tt_scheduled == 0 || delta < DWC_OTG_TT_SLOT_MAX) { td->state = DWC_CHAN_ST_WAIT_C_PKT; - goto tt_wait; + goto busy; } - /* wait until next slot before trying again */ - td->tt_complete_slot++; - - /* set toggle, if any */ - if (td->set_toggle) { - td->set_toggle = 0; - td->toggle = 1; + delta = sc->sc_last_frame_num - td->tt_start_slot; + if (delta > DWC_OTG_TT_SLOT_MAX) { + /* we missed the service interval */ + if (td->ep_type != UE_ISOCHRONOUS) + td->error_any = 1; + goto complete; } + /* complete split */ td->hcsplt |= HCSPLT_COMPSPLT; - count = HCSPLT_XACTLEN_MAX; } else if (td->tt_xactpos == HCSPLT_XACTPOS_BEGIN && dwc_otg_host_rate_check(td)) { - td->state = DWC_CHAN_ST_START; - dwc_otg_host_channel_free(td); + td->state = DWC_CHAN_ST_WAIT_C_PKT; + goto busy; + } + + /* allocate a new channel */ + if (dwc_otg_host_channel_alloc(td, td->tt_channel_tog)) { + td->state = DWC_CHAN_ST_WAIT_C_PKT; goto busy; - } else { - count = td->max_packet_size; } + + channel = td->channel[td->tt_channel_tog]; + + /* set toggle, if any */ + if (td->set_toggle) { + td->set_toggle = 0; + td->toggle = 1; + } + td->state = DWC_CHAN_ST_WAIT_ANE; /* receive one packet */ - DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), - (count << HCTSIZ_XFERSIZE_SHIFT) | + DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(channel), + (td->max_packet_size << HCTSIZ_XFERSIZE_SHIFT) | (1 << HCTSIZ_PKTCNT_SHIFT) | (td->toggle ? (HCTSIZ_PID_DATA1 << HCTSIZ_PID_SHIFT) : (HCTSIZ_PID_DATA0 << HCTSIZ_PID_SHIFT))); - DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel), td->hcsplt); - - /* send ASAP */ - if ((ep_type == UE_ISOCHRONOUS) && !(sc->sc_last_frame_num & 1)) - td->hcchar |= HCCHAR_ODDFRM; - else - td->hcchar &= ~HCCHAR_ODDFRM; + DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(channel), td->hcsplt); hcchar = td->hcchar; hcchar |= HCCHAR_EPDIR_IN; - /* must enable channel before data can be received */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel), hcchar); + /* check if other channel is allocated */ + if (td->channel[td->tt_channel_tog ^ 1] < DWC_OTG_MAX_CHANNELS) { + /* second - receive after next SOF event */ + if ((sc->sc_last_frame_num & 1) != 0) + hcchar |= HCCHAR_ODDFRM; + else + hcchar &= ~HCCHAR_ODDFRM; + + /* other channel is next */ + td->tt_channel_tog ^= 1; + td->tt_complete_slot++; + + /* must enable channel before data can be received */ + DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar); + } else { + /* first - receive after second next SOF event */ + if ((sc->sc_last_frame_num & 1) == 0) + hcchar |= HCCHAR_ODDFRM; + else + hcchar &= ~HCCHAR_ODDFRM; + + /* must enable channel before data can be received */ + DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar); + + if (td->hcsplt != 0) { + if (td->ep_type == UE_ISOCHRONOUS || td->ep_type == UE_INTERRUPT) { + /* allocate a second channel */ + td->tt_channel_tog ^= 1; + goto receive_pkt; + } else { + td->tt_complete_slot++; + } + } + } goto busy; receive_spkt: - /* Wait for our turn, if TT transfer */ - if (td->tt_scheduled == 0) { - if (ep_type == UE_INTERRUPT) { - td->state = DWC_CHAN_ST_START; - dwc_otg_host_channel_free(td); - goto busy; - } - /* set return state */ + /* free existing channel(s), if any */ + dwc_otg_host_channel_free(td, 0); + dwc_otg_host_channel_free(td, 1); + + delta = td->tt_start_slot - sc->sc_last_frame_num - 1; + if (td->tt_scheduled == 0 || delta < DWC_OTG_TT_SLOT_MAX) { td->state = DWC_CHAN_ST_START; - goto tt_wait; + goto busy; } - if ((sc->sc_last_frame_num & 7) < td->tt_start_slot) { - /* set return state */ + delta = sc->sc_last_frame_num - td->tt_start_slot; + if (delta > 5) { + /* missed it */ + td->tt_scheduled = 0; td->state = DWC_CHAN_ST_START; - goto tt_wait; + goto busy; } - /* send ASAP */ - if ((ep_type == UE_ISOCHRONOUS) && !(sc->sc_last_frame_num & 1)) - td->hcchar |= HCCHAR_ODDFRM; - else - td->hcchar &= ~HCCHAR_ODDFRM; + /* allocate a new channel */ + if (dwc_otg_host_channel_alloc(td, 0)) { + td->state = DWC_CHAN_ST_START; + goto busy; + } + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri May 9 14:24:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4570086A; Fri, 9 May 2014 14:24:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 223D7B63; Fri, 9 May 2014 14:24:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s49EO3m6087035; Fri, 9 May 2014 14:24:03 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49EO2Dc087032; Fri, 9 May 2014 14:24:02 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201405091424.s49EO2Dc087032@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Fri, 9 May 2014 14:24:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265778 - head/usr.sbin/ndp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 14:24:03 -0000 Author: melifaro Date: Fri May 9 14:24:02 2014 New Revision: 265778 URL: http://svnweb.freebsd.org/changeset/base/265778 Log: Fix ndp(8) -f flag parsing PR: bin/136661 Reminded by: Vinicius Zavam MFC after: 2 weeks Modified: head/usr.sbin/ndp/ndp.8 head/usr.sbin/ndp/ndp.c Modified: head/usr.sbin/ndp/ndp.8 ============================================================================== --- head/usr.sbin/ndp/ndp.8 Fri May 9 14:23:06 2014 (r265777) +++ head/usr.sbin/ndp/ndp.8 Fri May 9 14:24:02 2014 (r265778) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jan 10, 2013 +.Dd May 9, 2014 .Dt NDP 8 .Os .\" @@ -136,9 +136,26 @@ seconds. Erase all the NDP entries. .It Fl d Delete specified NDP entry. -.It Fl f -Parse the file specified by -.Ar filename . +.It Fl f Ar filename +Cause the file +.Ar filename +to be read and multiple entries to be set in the +.Tn NDP +table. +Entries +in the file should be of the form +.Pp +.Bd -ragged -offset indent -compact +.Ar hostname ether_addr +.Op Cm temp +.Op Cm proxy +.Ed +.Pp +with argument meanings as given above. +Leading whitespace and empty lines are ignored. +A +.Ql # +character will mark the rest of the line as a comment. .It Fl H Harmonize consistency between the routing table and the default router list; install the top entry of the list into the kernel routing table. Modified: head/usr.sbin/ndp/ndp.c ============================================================================== --- head/usr.sbin/ndp/ndp.c Fri May 9 14:23:06 2014 (r265777) +++ head/usr.sbin/ndp/ndp.c Fri May 9 14:24:02 2014 (r265778) @@ -97,6 +97,7 @@ #include +#include #include #include #include @@ -126,7 +127,7 @@ char host_buf[NI_MAXHOST]; /* getnamein char ifix_buf[IFNAMSIZ]; /* if_indextoname() */ int main(int, char **); -int file(char *); +static int file(char *); void getsocket(void); int set(int, char **); void get(char *); @@ -189,7 +190,8 @@ main(int argc, char **argv) break; case 'd': case 'f': - case 'i' : + exit(file(optarg) ? 1 : 0); + case 'i': if (mode) { usage(); /*NOTREACHED*/ @@ -312,17 +314,15 @@ main(int argc, char **argv) /* * Process a file to set standard ndp entries */ -int +static int file(char *name) { FILE *fp; int i, retval; - char line[100], arg[5][50], *args[5]; + char line[100], arg[5][50], *args[5], *p; - if ((fp = fopen(name, "r")) == NULL) { - fprintf(stderr, "ndp: cannot open %s\n", name); - exit(1); - } + if ((fp = fopen(name, "r")) == NULL) + err(1, "cannot open %s", name); args[0] = &arg[0][0]; args[1] = &arg[1][0]; args[2] = &arg[2][0]; @@ -330,10 +330,15 @@ file(char *name) args[4] = &arg[4][0]; retval = 0; while (fgets(line, sizeof(line), fp) != NULL) { + if ((p = strchr(line, '#')) != NULL) + *p = '\0'; + for (p = line; isblank(*p); p++); + if (*p == '\n' || *p == '\0') + continue; i = sscanf(line, "%49s %49s %49s %49s %49s", arg[0], arg[1], arg[2], arg[3], arg[4]); if (i < 2) { - fprintf(stderr, "ndp: bad line: %s\n", line); + warnx("bad line: %s", line); retval = 1; continue; } From owner-svn-src-head@FreeBSD.ORG Fri May 9 14:28:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0B85A15; Fri, 9 May 2014 14:28:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDE47B85; Fri, 9 May 2014 14:28:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s49ESBhc087577; Fri, 9 May 2014 14:28:11 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49ESBdG087576; Fri, 9 May 2014 14:28:11 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405091428.s49ESBdG087576@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 9 May 2014 14:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265779 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 14:28:12 -0000 Author: hselasky Date: Fri May 9 14:28:11 2014 New Revision: 265779 URL: http://svnweb.freebsd.org/changeset/base/265779 Log: Fix for NULL pointer. MFC after: 1 week Modified: head/sys/dev/usb/usb_pf.c Modified: head/sys/dev/usb/usb_pf.c ============================================================================== --- head/sys/dev/usb/usb_pf.c Fri May 9 14:24:02 2014 (r265778) +++ head/sys/dev/usb/usb_pf.c Fri May 9 14:28:11 2014 (r265779) @@ -395,7 +395,7 @@ usbpf_xfertap(struct usb_xfer *xfer, int bus = xfer->xroot->bus; /* sanity checks */ - if (bus->ifp == NULL) + if (bus->ifp == NULL || bus->ifp->if_bpf == NULL) return; if (!bpf_peers_present(bus->ifp->if_bpf)) return; From owner-svn-src-head@FreeBSD.ORG Fri May 9 14:35:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AEEA0CDA; Fri, 9 May 2014 14:35:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C380C36; Fri, 9 May 2014 14:35:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s49EZ76J091572; Fri, 9 May 2014 14:35:07 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49EZ7i5091571; Fri, 9 May 2014 14:35:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405091435.s49EZ7i5091571@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 9 May 2014 14:35:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265780 - head/sys/modules/sound/sound X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 14:35:07 -0000 Author: hselasky Date: Fri May 9 14:35:07 2014 New Revision: 265780 URL: http://svnweb.freebsd.org/changeset/base/265780 Log: Invert platform check. Suggested by: imp @ MFC after: 2 weeks Modified: head/sys/modules/sound/sound/Makefile Modified: head/sys/modules/sound/sound/Makefile ============================================================================== --- head/sys/modules/sound/sound/Makefile Fri May 9 14:28:11 2014 (r265779) +++ head/sys/modules/sound/sound/Makefile Fri May 9 14:35:07 2014 (r265780) @@ -44,8 +44,8 @@ CLEANFILES+= feeder_eq_gen.h feeder_rate EXPORT_SYMS= YES # XXX evaluate -.if ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "powerpc" || \ - ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" +.if ${MACHINE_CPUARCH} != "i386" && ${MACHINE_CPUARCH} != "amd64" && \ + ${MACHINE_CPUARCH} != "ia64" && ${MACHINE_CPUARCH} != "pc98" # Create an empty opt_isa.h in order to keep kmod.mk from linking in an # existing one from KERNBUILDDIR which possibly has DEV_ISA defined so # sound.ko is always built without isadma support. From owner-svn-src-head@FreeBSD.ORG Fri May 9 16:20:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 612C7BC8; Fri, 9 May 2014 16:20:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D59F7B9; Fri, 9 May 2014 16:20:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s49GKu3o042141; Fri, 9 May 2014 16:20:56 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49GKtpv042138; Fri, 9 May 2014 16:20:55 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201405091620.s49GKtpv042138@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Fri, 9 May 2014 16:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265782 - head/usr.bin/systat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 16:20:56 -0000 Author: melifaro Date: Fri May 9 16:20:55 2014 New Revision: 265782 URL: http://svnweb.freebsd.org/changeset/base/265782 Log: Allow systat(1) interactive dispay-specific commands to be specified via command line. Submitted by: vsevolod MFC after: 2 weeks Modified: head/usr.bin/systat/ifstat.c head/usr.bin/systat/main.c head/usr.bin/systat/systat.1 Modified: head/usr.bin/systat/ifstat.c ============================================================================== --- head/usr.bin/systat/ifstat.c Fri May 9 15:55:45 2014 (r265781) +++ head/usr.bin/systat/ifstat.c Fri May 9 16:20:55 2014 (r265782) @@ -77,7 +77,7 @@ struct if_stat { u_long if_in_pps_peak; u_long if_out_pps_peak; u_int if_row; /* Index into ifmib sysctl */ - u_int if_ypos; /* 0 if not being displayed */ + int if_ypos; /* -1 if not being displayed */ u_int display; u_int match; }; @@ -210,13 +210,19 @@ showifstat(void) struct if_stat *ifp = NULL; SLIST_FOREACH(ifp, &curlist, link) { - if (ifp->display == 0 || (ifp->match == 0) || - ifp->if_ypos > LINES - 3 - 1) - continue; - PUTNAME(ifp); - PUTRATE(col2, ifp->if_ypos); - PUTRATE(col3, ifp->if_ypos); - PUTTOTAL(col4, ifp->if_ypos); + if (ifp->if_ypos < LINES - 3 && ifp->if_ypos != -1) + if (ifp->display == 0 || ifp->match == 0) { + wmove(wnd, ifp->if_ypos, 0); + wclrtoeol(wnd); + wmove(wnd, ifp->if_ypos + 1, 0); + wclrtoeol(wnd); + } + else { + PUTNAME(ifp); + PUTRATE(col2, ifp->if_ypos); + PUTRATE(col3, ifp->if_ypos); + PUTTOTAL(col4, ifp->if_ypos); + } } return; @@ -425,6 +431,8 @@ sort_interface_list(void) ifp->if_ypos = y; y += ROW_SPACING; } + else + ifp->if_ypos = -1; } needsort = 0; @@ -476,14 +484,13 @@ cmdifstat(const char *cmd, const char *a retval = ifcmd(cmd, args); /* ifcmd() returns 1 on success */ if (retval == 1) { - showifstat(); - refresh(); if (needclear) { + showifstat(); + refresh(); werase(wnd); labelifstat(); needclear = 0; } } - return (retval); } Modified: head/usr.bin/systat/main.c ============================================================================== --- head/usr.bin/systat/main.c Fri May 9 15:55:45 2014 (r265781) +++ head/usr.bin/systat/main.c Fri May 9 16:20:55 2014 (r265782) @@ -44,6 +44,7 @@ static const char copyright[] = #include #include #include +#include #include #include @@ -53,6 +54,7 @@ static const char copyright[] = #include #include #include +#include #include #include "systat.h" @@ -77,12 +79,67 @@ int use_kvm = 1; static WINDOW *wload; /* one line window for load average */ +struct cmdentry { + SLIST_ENTRY(cmdentry) link; + char *cmd; /* Command name */ + char *argv; /* Arguments vector for a command */ +}; +SLIST_HEAD(, cmdentry) commands; + +static void +parse_cmd_args (int argc, char **argv) +{ + int in_command = 0; + struct cmdentry *cmd = NULL; + double t; + + while (argc) { + if (argv[0][0] == '-') { + if (in_command) + SLIST_INSERT_HEAD(&commands, cmd, link); + + if (memcmp(argv[0], "--", 3) == 0) { + in_command = 0; /*-- ends a command explicitly*/ + argc --, argv ++; + continue; + } + cmd = calloc(1, sizeof(struct cmdentry)); + if (cmd == NULL) + errx(1, "memory allocating failure"); + cmd->cmd = strdup(&argv[0][1]); + if (cmd->cmd == NULL) + errx(1, "memory allocating failure"); + in_command = 1; + } + else if (!in_command) { + t = strtod(argv[0], NULL) * 1000000.0; + if (t > 0 && t < (double)UINT_MAX) + delay = (unsigned int)t; + } + else if (cmd != NULL) { + cmd->argv = strdup(argv[0]); + if (cmd->argv == NULL) + errx(1, "memory allocating failure"); + in_command = 0; + SLIST_INSERT_HEAD(&commands, cmd, link); + } + else + errx(1, "invalid arguments list"); + + argc--, argv++; + } + if (in_command && cmd != NULL) + SLIST_INSERT_HEAD(&commands, cmd, link); + +} + int main(int argc, char **argv) { char errbuf[_POSIX2_LINE_MAX], dummy; size_t size; double t; + struct cmdentry *cmd = NULL; #ifdef USE_WIDECHAR (void) setlocale(LC_ALL, ""); @@ -90,8 +147,9 @@ main(int argc, char **argv) (void) setlocale(LC_TIME, ""); #endif + SLIST_INIT(&commands); argc--, argv++; - while (argc > 0) { + if (argc > 0) { if (argv[0][0] == '-') { struct cmdtab *p; @@ -101,12 +159,10 @@ main(int argc, char **argv) if (p == (struct cmdtab *)0) errx(1, "%s: unknown request", &argv[0][1]); curcmd = p; - } else { - t = strtod(argv[0], NULL) * 1000000.0; - if (t > 0 && t < (double)UINT_MAX) - delay = (unsigned int)t; + argc--, argv++; } - argc--, argv++; + parse_cmd_args (argc, argv); + } kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf); if (kd != NULL) { @@ -169,8 +225,12 @@ main(int argc, char **argv) curcmd->c_flags |= CF_INIT; labels(); - dellave = 0.0; + if (curcmd->c_cmd != NULL) + SLIST_FOREACH (cmd, &commands, link) + if (!curcmd->c_cmd(cmd->cmd, cmd->argv)) + warnx("command is not understood"); + dellave = 0.0; display(); noecho(); crmode(); Modified: head/usr.bin/systat/systat.1 ============================================================================== --- head/usr.bin/systat/systat.1 Fri May 9 15:55:45 2014 (r265781) +++ head/usr.bin/systat/systat.1 Fri May 9 16:20:55 2014 (r265782) @@ -37,6 +37,7 @@ .Sh SYNOPSIS .Nm .Op Fl display +.Op Ar display-commands .Op Ar refresh-interval .Sh DESCRIPTION The @@ -108,6 +109,23 @@ The .Ar refresh-value specifies the screen refresh time interval in seconds. Time interval can be fractional. +.It Ar display-commands +A list of commands specific for this display. These commands can also +be entered interactively and are described for each display separately +below. If the command of the display requires an argument or arguments, +it is possible to specify them as separate command line argument. To finish +display commands it is possible to use double dash at the end +of the list. For example: +.Pp +.Dl Nm Fl ifstat Fl match Ar bge0,em1 Fl pps +.Pp +This will display statistics of packets per second for network interfaces +named as bge0 and em1. +.Pp +.Dl Nm Fl iostat Fl numeric Fl - Ar 2.1 +.Pp +This will display all IO statistics in a numeric format and the information +will be refreshed each 2.1 seconds. .El .Pp Certain characters cause immediate action by From owner-svn-src-head@FreeBSD.ORG Fri May 9 16:40:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07346549; Fri, 9 May 2014 16:40:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E86CE9A2; Fri, 9 May 2014 16:40:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s49GefFW054743; Fri, 9 May 2014 16:40:41 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49Gef37054742; Fri, 9 May 2014 16:40:41 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405091640.s49Gef37054742@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 9 May 2014 16:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265783 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 16:40:42 -0000 Author: hselasky Date: Fri May 9 16:40:41 2014 New Revision: 265783 URL: http://svnweb.freebsd.org/changeset/base/265783 Log: Fix a regression issue: - ACK can be received before data arrives in RX FIFO. Handle this. - Remove obsolete comment. - Some minor code styling. MFC after: 2 weeks Modified: head/sys/dev/usb/controller/dwc_otg.c Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Fri May 9 16:20:55 2014 (r265782) +++ head/sys/dev/usb/controller/dwc_otg.c Fri May 9 16:40:41 2014 (r265783) @@ -1240,6 +1240,10 @@ check_state: goto complete; } } else if (hcint & HCINT_ACK) { + /* wait for data - ACK arrived first */ + if (!(hcint & HCINT_SOFTWARE_ONLY)) + goto busy; + if (td->ep_type == UE_ISOCHRONOUS) { /* check if we are complete */ if ((td->remainder == 0) || @@ -1595,8 +1599,6 @@ dwc_otg_host_data_tx(struct dwc_otg_td * } } - /* channel must be disabled before we can complete the transfer */ - if (hcint & (HCINT_ERRORS | HCINT_RETRY | HCINT_ACK | HCINT_NYET)) { @@ -1646,15 +1648,13 @@ check_state: break; case DWC_CHAN_ST_WAIT_C_ANE: - if (hcint & HCINT_NYET) + if (hcint & HCINT_NYET) { goto send_cpkt; - - if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { + } else if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { td->did_nak = 1; td->tt_scheduled = 0; goto send_pkt; - } - if (hcint & HCINT_ACK) { + } else if (hcint & HCINT_ACK) { td->offset += td->tx_bytes; td->remainder -= td->tx_bytes; td->toggle ^= 1; From owner-svn-src-head@FreeBSD.ORG Fri May 9 19:14:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 951C428E; Fri, 9 May 2014 19:14:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68A8D961; Fri, 9 May 2014 19:14:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s49JEZQM025719; Fri, 9 May 2014 19:14:35 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49JEZK3025717; Fri, 9 May 2014 19:14:35 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405091914.s49JEZK3025717@svn.freebsd.org> From: Ian Lepore Date: Fri, 9 May 2014 19:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265784 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 19:14:35 -0000 Author: ian Date: Fri May 9 19:14:34 2014 New Revision: 265784 URL: http://svnweb.freebsd.org/changeset/base/265784 Log: Call idcache_inv_all from the AP core entry code before turning on the MMU. Also, enable instruction and branch caches, which should be safe now that they're properly initialized/invalidated first. Modified: head/sys/arm/arm/cpufunc_asm_armv7.S head/sys/arm/arm/locore.S Modified: head/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_armv7.S Fri May 9 16:40:41 2014 (r265783) +++ head/sys/arm/arm/cpufunc_asm_armv7.S Fri May 9 19:14:34 2014 (r265784) @@ -319,6 +319,10 @@ ENTRY(armv7_auxctrl) RET END(armv7_auxctrl) +/* + * Invalidate all I+D+branch cache. Used by startup code, which counts + * on the fact that only r0-r3,ip are modified and no stack space is used. + */ ENTRY(armv7_idcache_inv_all) mov r0, #0 mcr p15, 2, r0, c0, c0, 0 @ set cache level to L1 Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Fri May 9 16:40:41 2014 (r265783) +++ head/sys/arm/arm/locore.S Fri May 9 19:14:34 2014 (r265784) @@ -353,24 +353,24 @@ ASENTRY_NP(mpentry) orr r7, r7, #(I32_bit|F32_bit) msr cpsr_c, r7 - - adr r7, Ltag - bic r7, r7, #0xf0000000 - orr r7, r7, #PHYSADDR - - /* Disable MMU for a while */ + /* Disable MMU. It should be disabled already, but make sure. */ mrc p15, 0, r2, c1, c0, 0 bic r2, r2, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE |\ CPU_CONTROL_WBUF_ENABLE) bic r2, r2, #(CPU_CONTROL_IC_ENABLE) bic r2, r2, #(CPU_CONTROL_BPRD_ENABLE) mcr p15, 0, r2, c1, c0, 0 - nop nop nop + CPWAIT(r0) + +#if defined(ARM_MMU_V6) + bl armv6_idcache_inv_all /* Modifies r0 only */ +#elif defined(ARM_MMU_V7) + bl armv7_idcache_inv_all /* Modifies r0-r3, ip */ +#endif -Ltag: ldr r0, Lstartup_pagetable_secondary bic r0, r0, #0xf0000000 orr r0, r0, #PHYSADDR @@ -389,7 +389,10 @@ Ltag: mrc p15, 0, r0, c1, c0, 0 orr r0, r0, #CPU_CONTROL_V6_EXTPAGE orr r0, r0, #CPU_CONTROL_AF_ENABLE - orr r0, r0, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE) + orr r0, r0, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE |\ + CPU_CONTROL_WBUF_ENABLE) + orr r0, r0, #(CPU_CONTROL_IC_ENABLE) + orr r0, r0, #(CPU_CONTROL_BPRD_ENABLE) mcr p15, 0, r0, c1, c0, 0 nop nop From owner-svn-src-head@FreeBSD.ORG Fri May 9 21:11:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7AB11FE; Fri, 9 May 2014 21:11:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6785C6B3; Fri, 9 May 2014 21:11:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s49LBS6Z079406; Fri, 9 May 2014 21:11:28 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s49LBRMm079402; Fri, 9 May 2014 21:11:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405092111.s49LBRMm079402@svn.freebsd.org> From: Warner Losh Date: Fri, 9 May 2014 21:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265785 - in head: share/mk sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2014 21:11:28 -0000 Author: imp Date: Fri May 9 21:11:27 2014 New Revision: 265785 URL: http://svnweb.freebsd.org/changeset/base/265785 Log: Introduce kern.opts.mk to hold all the options for kernel module builds. Include this in the right places. Make src.opts.mk optional so that modules can be built outside of the tree in the ports system. PR: 189520 Added: head/sys/conf/kern.opts.mk (contents, props changed) Modified: head/share/mk/src.opts.mk head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri May 9 19:14:34 2014 (r265784) +++ head/share/mk/src.opts.mk Fri May 9 21:11:27 2014 (r265785) @@ -24,7 +24,7 @@ # # Makefiles should never test WITH_FOO or WITHOUT_FOO directly (although an # exception is made for _WITHOUT_SRCONF which turns off this mechanism -# completely). +# completely inside bsd.*.mk files). # .if !target(____) @@ -84,7 +84,6 @@ __DEFAULT_YES_OPTIONS = \ FDT \ FLOPPY \ FMTREE \ - FORMAT_EXTENSIONS \ FORTH \ FP_LIBC \ FREEBSD_UPDATE \ @@ -105,7 +104,6 @@ __DEFAULT_YES_OPTIONS = \ IPFW \ JAIL \ KDUMP \ - KERNEL_SYMBOLS \ KVM \ LDNS \ LDNS_UTILS \ Added: head/sys/conf/kern.opts.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/conf/kern.opts.mk Fri May 9 21:11:27 2014 (r265785) @@ -0,0 +1,24 @@ +# $FreeBSD$ + +# Options set in the build system that affect the kernel somehow. + +# +# Define MK_* variables (which are either "yes" or "no") for users +# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the +# make(1) environment. +# These should be tested with `== "no"' or `!= "no"' in makefiles. +# The NO_* variables should only be set by makefiles for variables +# that haven't been converted over. +# + +# These options are used by the kernel build process (kern.mk and kmod.mk) +# They have to be listed here so we can build modules outside of the +# src tree. + +__DEFAULT_YES_OPTIONS = \ + FORMAT_EXTENTIONS \ + KERNEL_SYMBOLS + +__DEFAULT_NO_OPTIONS = \ + +.include "../../share/mk/bsd.mkopt.mk" Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Fri May 9 19:14:34 2014 (r265784) +++ head/sys/conf/kern.pre.mk Fri May 9 21:11:27 2014 (r265785) @@ -5,6 +5,7 @@ .include .include +.include "kern.opts.mk" # backwards compat option for older systems. MACHINE_CPUARCH?=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Fri May 9 19:14:34 2014 (r265784) +++ head/sys/conf/kmod.mk Fri May 9 21:11:27 2014 (r265785) @@ -72,9 +72,15 @@ OBJCOPY?= objcopy .error "Do not use KMODDEPS on 5.0+; use MODULE_VERSION/MODULE_DEPEND" .endif -.include +# Note: we're really bsd.kmod.mk, so we have to allow src.opts.mk to be +# optional. Include it if we can so we can get /etc/src.conf changes, +# if we're in the tree. If we can't include it that's OK. kern.opts.mk +# has all the kernel options in it, and should be included after src.opts.mk +# so it picks everything up. +.sinclude .include .include +.include "kern.opts.mk" .SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S From owner-svn-src-head@FreeBSD.ORG Sat May 10 00:42:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 777586D8; Sat, 10 May 2014 00:42:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C5E6D0A; Sat, 10 May 2014 00:42:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4A0gisi075931; Sat, 10 May 2014 00:42:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4A0gi65075930; Sat, 10 May 2014 00:42:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405100042.s4A0gi65075930@svn.freebsd.org> From: Warner Losh Date: Sat, 10 May 2014 00:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265791 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 00:42:44 -0000 Author: imp Date: Sat May 10 00:42:43 2014 New Revision: 265791 URL: http://svnweb.freebsd.org/changeset/base/265791 Log: Fix typo in FORMAT_EXTENSIONS which breaks universe. Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Sat May 10 00:26:40 2014 (r265790) +++ head/sys/conf/kern.opts.mk Sat May 10 00:42:43 2014 (r265791) @@ -16,7 +16,7 @@ # src tree. __DEFAULT_YES_OPTIONS = \ - FORMAT_EXTENTIONS \ + FORMAT_EXTENSIONS \ KERNEL_SYMBOLS __DEFAULT_NO_OPTIONS = \ From owner-svn-src-head@FreeBSD.ORG Sat May 10 00:53:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 653C196F; Sat, 10 May 2014 00:53:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 527D3DD0; Sat, 10 May 2014 00:53:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4A0rbbY080572; Sat, 10 May 2014 00:53:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4A0rbF9080571; Sat, 10 May 2014 00:53:37 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405100053.s4A0rbF9080571@svn.freebsd.org> From: Adrian Chadd Date: Sat, 10 May 2014 00:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265792 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 00:53:37 -0000 Author: adrian Date: Sat May 10 00:53:36 2014 New Revision: 265792 URL: http://svnweb.freebsd.org/changeset/base/265792 Log: Add in support to optionally pin the swi threads. Under enough load, the swi's can actually be preempted and migrated to other currently free cores. When doing RSS experiments, this lead to the per-CPU TCP timers not lining up any more with the RX CPU said flows were ending up on, leading to increased lock contention. Since there was a little pushback on flipping them on by default, I've left the default at "don't pin." The other less obvious problem here is that the default swi is also the same as the destination swi for CPU #0. So if one pins the swi on CPU #0, there's no default floating swi. A nice future project would be to create a separate swi for the "default" floating swi, as well as per-CPU swis that are (optionally) pinned. Tested: * parallel TCP tests (2 x 1g unfortunately for now); CPU: Intel(R) Xeon(R) CPU E5-2650 Note: This is based on some initial investigation into RSS/TCP stack lock contention on FreeBSD-HEAD whilst at Netflix in January 2014. Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Sat May 10 00:42:43 2014 (r265791) +++ head/sys/kern/kern_timeout.c Sat May 10 00:53:36 2014 (r265792) @@ -104,6 +104,14 @@ static int ncallout; SYSCTL_INT(_kern, OID_AUTO, ncallout, CTLFLAG_RDTUN, &ncallout, 0, "Number of entries in callwheel and size of timeout() preallocation"); +static int pin_default_swi = 0; +static int pin_pcpu_swi = 0; + +SYSCTL_INT(_kern, OID_AUTO, pin_default_swi, CTLFLAG_RDTUN, &pin_default_swi, + 0, "Pin the default (non-per-cpu) swi (shared with PCPU 0 swi)"); +SYSCTL_INT(_kern, OID_AUTO, pin_pcpu_swi, CTLFLAG_RDTUN, &pin_pcpu_swi, + 0, "Pin the per-CPU swis (except PCPU 0, which is also default"); + /* * TODO: * allocate more timeout table slots when table overflows. @@ -273,6 +281,12 @@ callout_callwheel_init(void *dummy) callwheelmask = callwheelsize - 1; /* + * Fetch whether we're pinning the swi's or not. + */ + TUNABLE_INT_FETCH("kern.pin_default_swi", &pin_default_swi); + TUNABLE_INT_FETCH("kern.pin_pcpu_swi", &pin_pcpu_swi); + + /* * Only cpu0 handles timeout(9) and receives a preallocation. * * XXX: Once all timeout(9) consumers are converted this can @@ -355,6 +369,7 @@ start_softclock(void *dummy) char name[MAXCOMLEN]; #ifdef SMP int cpu; + struct intr_event *ie; #endif cc = CC_CPU(timeout_cpu); @@ -362,6 +377,13 @@ start_softclock(void *dummy) if (swi_add(&clk_intr_event, name, softclock, cc, SWI_CLOCK, INTR_MPSAFE, &cc->cc_cookie)) panic("died while creating standard software ithreads"); + if (pin_default_swi && + (intr_event_bind(clk_intr_event, timeout_cpu) != 0)) { + printf("%s: timeout clock couldn't be pinned to cpu %d\n", + __func__, + timeout_cpu); + } + #ifdef SMP CPU_FOREACH(cpu) { if (cpu == timeout_cpu) @@ -370,9 +392,16 @@ start_softclock(void *dummy) cc->cc_callout = NULL; /* Only cpu0 handles timeout(9). */ callout_cpu_init(cc); snprintf(name, sizeof(name), "clock (%d)", cpu); - if (swi_add(NULL, name, softclock, cc, SWI_CLOCK, + ie = NULL; + if (swi_add(&ie, name, softclock, cc, SWI_CLOCK, INTR_MPSAFE, &cc->cc_cookie)) panic("died while creating standard software ithreads"); + if (pin_pcpu_swi && (intr_event_bind(ie, cpu) != 0)) { + printf("%s: per-cpu clock couldn't be pinned to " + "cpu %d\n", + __func__, + cpu); + } } #endif } From owner-svn-src-head@FreeBSD.ORG Sat May 10 03:24:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 791CF69C; Sat, 10 May 2014 03:24:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5ACEEB61; Sat, 10 May 2014 03:24:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4A3OkPt048999; Sat, 10 May 2014 03:24:46 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4A3Okgc048998; Sat, 10 May 2014 03:24:46 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201405100324.s4A3Okgc048998@svn.freebsd.org> From: Warren Block Date: Sat, 10 May 2014 03:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265798 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 03:24:46 -0000 Author: wblock (doc committer) Date: Sat May 10 03:24:45 2014 New Revision: 265798 URL: http://svnweb.freebsd.org/changeset/base/265798 Log: Add a man page for the new vt.4 device. Reviewed by: ray, emaste (slightly earlier version) Added: head/share/man/man4/vt.4 (contents, props changed) Added: head/share/man/man4/vt.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/vt.4 Sat May 10 03:24:45 2014 (r265798) @@ -0,0 +1,230 @@ +.\" Copyright (c) 2014 Warren Block +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 9, 2014 +.Dt VIRTUAL TERMINALS 4 +.Os +.Sh NAME +.Nm vt +.Nd virtual terminal console driver +.Sh SYNOPSIS +.Cd "options VT_MAXWINDOWS=N" +.Cd "options VT_ALT_TO_ESC_HACK=1" +.Cd "options VT_TWOBUTTON_MOUSE" +.Cd "options VT_FB_DEFAULT_WIDTH=X" +.Cd "options VT_FB_DEFAULT_HEIGHT=Y" +.Cd "options SC_NO_CUTPASTE" +.Cd "options SC_NO_SYSMOUSE" +.Cd "device vt" +.Pp +In +.Xr loader.conf 5 : +.Cd hw.vga.textmode=1 +.Sh DESCRIPTION +The +.Nm +device provides multiple virtual terminals with an extensive feature +set: +.Bl -item -offset indent +.It +Unicode UTF-8 text with double-width characters. +.It +Large font maps in graphics mode, including support for Asian +character sets. +.It +Graphics-mode consoles. +.It +Integration with +KMS +.Pq Kernel Mode Setting +video drivers for switching between the +.Em X Window System +and virtual terminals. +.El +.Ss Virtual Terminals +Multiple virtual terminals are provided on a single computer. +Up to sixteen virtual terminals can be defined. +A single virtual terminal is connected to the screen and keyboard +at a time. +Key combinations are used to select a virtual terminal. +Alt-F1 through Alt-F12 correspond to the first twelve virtual terminals. +If more than twelve virtual terminals are created, Shift-Alt-F1 through +Shift-Alt-F4 are used to switch to the additional terminals. +.Ss Copying and Pasting Text with a Mouse +Copying and pasting text from the screen with a mouse is supported. +Press and hold down mouse button 1, usually the left button, while +moving the mouse to select text. +Selected text is highlighted with reversed foreground and background +colors. +To select more text after releasing mouse button 1, press mouse button +3, usually the right button. +To paste text that has been selected, press mouse button 2, usually the +middle button. +The text is entered as if it were typed at the keyboard. +The +.Dv VT_TWOBUTTON_MOUSE +kernel option can be used with mice that only have two buttons. +Setting this option makes the second mouse button into the +paste button. +See +.Xr moused 8 +for more information. +.Ss Scrolling Back +Output that has scrolled off the screen can be reviewed by pressing the +Scroll Lock key, then scrolling up and down with the arrow keys. +The Page Up and Page Down keys scroll up or down a full screen at a +time. +The Home and End keys jump to the beginning or end of the scrollback +buffer. +When finished reviewing, press the Scroll Lock key again to return to +normal use. +.Sh DRIVER CONFIGURATION +.Ss Kernel Configuration Options +These kernel options control the +.Nm +driver. +.Bl -tag -width MAXCONS +.It Dv VT_MAXWINDOWS=N +Set the number of virtual terminals to be created to +.Fa N . +The value defaults to 12. +.It Dv VT_ALT_TO_ESC_HACK=1 +When the Alt key is held down while pressing another key, send an ESC +sequence instead of the Alt key. +.It Dv VT_TWOBUTTON_MOUSE +If defined, swap the functions of mouse buttons 2 and 3. +In effect, this makes the right-hand mouse button perform a paste. +These options are checked in the order shown. +.It Dv SC_NO_CUTPASTE +Disable mouse support. +.It VT_FB_DEFAULT_WIDTH=X +Set the default width to +.Fa X . +.It VT_FB_DEFAULT_HEIGHT=Y +Set the default height to +.Fa Y . +.El +.Sh BACKWARDS COMPATIBILITY +Several options are provided for compatibility with the previous +console device, +.Xr sc 4 . +These options will be removed in a future +.Fx +version. +.Bl -column -offset indent ".Sy vt VT_TWOBUTTON_MOUSE" ".Sy SC_TWOBUTTON_MOUSE" +.It Sy vt Option Name Ta Sy sc Option Name +.It Dv VT_TWOBUTTON_MOUSE Ta Dv SC_TWOBUTTON_MOUSE +.It Dv VT_MAXWINDOWS Ta Dv MAXCONS +.It none Ta Dv SC_NO_CUTPASTE +.It none Ta Dv SC_NO_SYSMOUSE +.El +.Sh START-UP OPERATION WITH X86 BIOS SYSTEMS +The computer BIOS starts in text mode, and +the +.Fx +.Xr loader 8 +runs, loading the kernel. +If +.Va hw.vga.textmode +is set, the system remains in text mode. +Otherwise, +.Nm +switches to 640x480x16 VGA mode using +.Fn vt_vga . +If a KMS +.Pq Kernel Mode Switching +video driver is available, the display is switched to high resolution +and the KMS driver takes over. +When a KMS driver is not available, +.Fn vt_vga +remains active. +.Sh LOADER TUNABLES +These settings can be entered at the +.Xr loader 8 +prompt or in +.Xr loader.conf 5 . +.Bl -tag -width indent +.It Va hw.vga.textmode +Set to 1 to use virtual terminals in text mode instead of graphics mode. +Features that require graphics mode, like loadable fonts, will be +disabled. +.El +.Sh FILES +.Bl -tag -width /usr/share/syscons/keymaps/* -compact +.It Pa /dev/console +.It Pa /dev/consolectl +.It Pa /dev/ttyv* +virtual terminals +.It Pa /etc/ttys +terminal initialization information +.El +.Sh SEE ALSO +.Xr kbdcontrol 1 , +.Xr login 1 , +.Xr vidcontrol 1 , +.Xr atkbd 4 , +.Xr atkbdc 4 , +.Xr keyboard 4 , +.Xr screen 4 , +.Xr splash 4 , +.Xr syscons 4 , +.Xr ukbd 4 , +.Xr vga 4 , +.Xr kbdmap 5 , +.Xr rc.conf 5 , +.Xr ttys 5 , +.Xr config 8 , +.Xr getty 8 , +.Xr kbdmux 8 , +.Xr kldload 8 , +.Xr moused 8 +.\" WB: to be uncommented when an actual release contains vt(4) +.\" .Sh HISTORY +.\" The +.\" Nm +.\" driver first appeared in +.\" .Fx 9.3 . +.Sh AUTHORS +.An -nosplit +The +.Nm +device driver was developed by +.An Ed Schouten Aq ed@FreeBSD.org , +.An Ed Maste Aq emaste@FreeBSD.org , +and +.An Aleksandr Rybalko Aq ray@FreeBSD.org , +with sponsorship provided by the +.Fx +Foundation. +This manual page was written by +.An Warren Block . +.Sh CAVEATS +Paste buffer size is limited by the system value +.Brq Dv MAX_INPUT , +the number of bytes that can be stored in the terminal +input queue, usually 1024 bytes +(see +.Xr termios 4 ) . From owner-svn-src-head@FreeBSD.ORG Sat May 10 05:56:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C5A18879; Sat, 10 May 2014 05:56:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B37EE884; Sat, 10 May 2014 05:56:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4A5uAZi025279; Sat, 10 May 2014 05:56:10 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4A5uA9U025278; Sat, 10 May 2014 05:56:10 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405100556.s4A5uA9U025278@svn.freebsd.org> From: Adrian Chadd Date: Sat, 10 May 2014 05:56:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265803 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 05:56:10 -0000 Author: adrian Date: Sat May 10 05:56:10 2014 New Revision: 265803 URL: http://svnweb.freebsd.org/changeset/base/265803 Log: Fix the required calibration flags for the Centrino 1000 NIC. Modified: head/sys/dev/iwn/if_iwn_chip_cfg.h Modified: head/sys/dev/iwn/if_iwn_chip_cfg.h ============================================================================== --- head/sys/dev/iwn/if_iwn_chip_cfg.h Sat May 10 05:16:28 2014 (r265802) +++ head/sys/dev/iwn/if_iwn_chip_cfg.h Sat May 10 05:56:10 2014 (r265803) @@ -219,14 +219,16 @@ static const struct iwn_base_params iwn1 .regulatory_bands = iwn5000_regulatory_bands, .enhanced_TX_power = false, .calib_need = - ( IWN_FLG_NEED_PHY_CALIB_DC - | IWN_FLG_NEED_PHY_CALIB_LO + ( IWN_FLG_NEED_PHY_CALIB_LO + | IWN_FLG_NEED_PHY_CALIB_TX_IQ_PERIODIC | IWN_FLG_NEED_PHY_CALIB_TX_IQ - | IWN_FLG_NEED_PHY_CALIB_BASE_BAND ), + | IWN_FLG_NEED_PHY_CALIB_BASE_BAND + ), .support_hostap = false, .no_multi_vaps = true, .additional_gp_drv_bit = IWN_GP_DRIVER_NONE, - .bt_mode = IWN_BT_NONE, + /* XXX 1000 - no BT */ + .bt_mode = IWN_BT_SIMPLE, .plcp_err_threshold = IWN_PLCP_ERR_EXT_LONG_THRESHOLD, }; static const struct iwn_base_params iwn_6000_base_params = { From owner-svn-src-head@FreeBSD.ORG Sat May 10 06:37:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A429C94; Sat, 10 May 2014 06:37:40 +0000 (UTC) Received: from mail-wg0-x232.google.com (mail-wg0-x232.google.com [IPv6:2a00:1450:400c:c00::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AAE0B08; Sat, 10 May 2014 06:37:39 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id x12so4899218wgg.9 for ; Fri, 09 May 2014 23:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=DfgRJYbChNc93fUeWr+ZqK/2Qa6SorrS8Bzun5SeUGo=; b=kKbszYDZR3BDL1YtUanowU08KLWC47xA3kM5u1bJAUViJzkHZB6c73gd063D7IeuTh AirMSP66ZRLO7DffLeGahMgJqBET+L33lhPsHI/OCiZ2e2dKFEP7SPbNM4fcxrQeXPvQ EbHTUdbPwkcHu2tSDkXByI8aNA+NZJ/5YYBR+gIzxhAbj2vgzKbB6SqlDR826/xRYc3q p1EzsjQugxK9q4m2bDjU5JuDS45hk+vnyHH7Wz7/hLEoPqImQSZJieOUDfLE51kZxdLe Eq0LLXgMrA64/3rBW8uBv5RWwSe3DuuZPCzm1Rp/eelTHlsnyjez7dmDX4Kew31lNDA3 w5hA== MIME-Version: 1.0 X-Received: by 10.180.96.39 with SMTP id dp7mr6623065wib.12.1399703857653; Fri, 09 May 2014 23:37:37 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.216.169.193 with HTTP; Fri, 9 May 2014 23:37:37 -0700 (PDT) In-Reply-To: <201405100324.s4A3Okgc048998@svn.freebsd.org> References: <201405100324.s4A3Okgc048998@svn.freebsd.org> Date: Sat, 10 May 2014 10:37:37 +0400 X-Google-Sender-Auth: CfsBVUZCuEdkG8cpLBCaN5Fh4mU Message-ID: Subject: Re: svn commit: r265798 - head/share/man/man4 From: Sergey Kandaurov To: Warren Block Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 06:37:40 -0000 On 10 May 2014 07:24, Warren Block wrote: > Author: wblock (doc committer) > Date: Sat May 10 03:24:45 2014 > New Revision: 265798 > URL: http://svnweb.freebsd.org/changeset/base/265798 > > Log: > Add a man page for the new vt.4 device. > Forgot to attach to the build? > Reviewed by: ray, emaste (slightly earlier version) > > Added: > head/share/man/man4/vt.4 (contents, props changed) > [...] > +.\" > +.Dd May 9, 2014 > +.Dt VIRTUAL TERMINALS 4 This line renders badly. -- wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Sat May 10 07:37:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76605703; Sat, 10 May 2014 07:37:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57415F08; Sat, 10 May 2014 07:37:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4A7bXTB069003; Sat, 10 May 2014 07:37:33 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4A7bWBp069001; Sat, 10 May 2014 07:37:32 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405100737.s4A7bWBp069001@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 10 May 2014 07:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265806 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 07:37:33 -0000 Author: hselasky Date: Sat May 10 07:37:32 2014 New Revision: 265806 URL: http://svnweb.freebsd.org/changeset/base/265806 Log: Optimise host channel disabling: - For non-periodic traffic we only need to wait two SOFs before disabling the channel. - Make sure we release the TX FIFO tracking level after the host channel is disabled. - Make sure the host channel state gets reset/disabled initially. - Two minor code style changes. MFC after: 2 weeks Modified: head/sys/dev/usb/controller/dwc_otg.c head/sys/dev/usb/controller/dwc_otg.h Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Sat May 10 07:26:49 2014 (r265805) +++ head/sys/dev/usb/controller/dwc_otg.c Sat May 10 07:37:32 2014 (r265806) @@ -141,6 +141,7 @@ static void dwc_otg_do_poll(struct usb_b static void dwc_otg_standard_done(struct usb_xfer *); static void dwc_otg_root_intr(struct dwc_otg_softc *); static void dwc_otg_interrupt_poll(struct dwc_otg_softc *); +static void dwc_otg_host_channel_disable(struct dwc_otg_softc *, uint8_t); /* * Here is a configuration that the chip supports. @@ -210,6 +211,13 @@ dwc_otg_init_fifo(struct dwc_otg_softc * return (EINVAL); } + /* disable any leftover host channels */ + for (x = 0; x != sc->sc_host_ch_max; x++) { + if (sc->sc_chan_state[x].wait_sof == 0) + continue; + dwc_otg_host_channel_disable(sc, x); + } + if (mode == DWC_MODE_HOST) { /* reset active endpoints */ @@ -236,6 +244,9 @@ dwc_otg_init_fifo(struct dwc_otg_softc * ((fifo_size / 4) << 16) | (tx_start / 4)); + /* reset host channel state */ + memset(sc->sc_chan_state, 0, sizeof(sc->sc_chan_state)); + /* reset FIFO TX levels */ sc->sc_tx_cur_p_level = 0; sc->sc_tx_cur_np_level = 0; @@ -326,6 +337,9 @@ dwc_otg_init_fifo(struct dwc_otg_softc * /* reset periodic and non-periodic FIFO TX size */ sc->sc_tx_max_size = fifo_size; + /* reset host channel state */ + memset(sc->sc_chan_state, 0, sizeof(sc->sc_chan_state)); + /* reset FIFO TX levels */ sc->sc_tx_cur_p_level = 0; sc->sc_tx_cur_np_level = 0; @@ -569,7 +583,7 @@ dwc_otg_clear_hcint(struct dwc_otg_softc } static uint8_t -dwc_otg_host_channel_alloc(struct dwc_otg_td *td, uint8_t which) +dwc_otg_host_channel_alloc(struct dwc_otg_td *td, uint8_t which, uint8_t is_out) { struct dwc_otg_softc *sc; uint32_t tx_p_size; @@ -587,11 +601,7 @@ dwc_otg_host_channel_alloc(struct dwc_ot sc = DWC_OTG_PC2SC(td->pc); /* compute needed TX FIFO size */ - if (td->ep_type == UE_CONTROL) { - /* RX and TX transactions */ - tx_p_size = 0; - tx_np_size = td->max_packet_size; - } else if ((td->hcchar & HCCHAR_EPDIR) == HCCHAR_EPDIR_OUT) { + if (is_out != 0) { if (td->ep_type == UE_INTERRUPT || td->ep_type == UE_ISOCHRONOUS) { tx_p_size = td->max_packet_size; @@ -669,12 +679,22 @@ dwc_otg_host_channel_free(struct dwc_otg /* get pointer to softc */ sc = DWC_OTG_PC2SC(td->pc); - sc->sc_chan_state[x].wait_sof = DWC_OTG_SLOT_IDLE_MAX; - sc->sc_chan_state[x].allocated = 0; - /* keep track of used TX FIFO, if any */ - sc->sc_tx_cur_p_level -= sc->sc_chan_state[x].tx_p_size; - sc->sc_tx_cur_np_level -= sc->sc_chan_state[x].tx_np_size; + /* + * We need to let programmed host channels run till complete + * else the host channel will stop functioning. Assume that + * after a fixed given amount of time the host channel is no + * longer doing any USB traffic: + */ + if (td->ep_type == UE_ISOCHRONOUS || td->ep_type == UE_INTERRUPT) { + /* double buffered */ + sc->sc_chan_state[x].wait_sof = DWC_OTG_SLOT_IDLE_MAX; + } else { + /* single buffered */ + sc->sc_chan_state[x].wait_sof = DWC_OTG_SLOT_IDLE_MIN; + } + + sc->sc_chan_state[x].allocated = 0; /* ack any pending messages */ if (sc->sc_last_rx_status != 0 && @@ -810,7 +830,7 @@ send_pkt: } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(td, 0)) { + if (dwc_otg_host_channel_alloc(td, 0, 1)) { td->state = DWC_CHAN_ST_START; goto busy; } @@ -863,7 +883,7 @@ send_cpkt: goto complete; } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(td, 0)) { + if (dwc_otg_host_channel_alloc(td, 0, 0)) { td->state = DWC_CHAN_ST_WAIT_C_PKT; goto busy; } @@ -1322,7 +1342,7 @@ receive_pkt: } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(td, td->tt_channel_tog)) { + if (dwc_otg_host_channel_alloc(td, td->tt_channel_tog, 0)) { td->state = DWC_CHAN_ST_WAIT_C_PKT; goto busy; } @@ -1404,7 +1424,7 @@ receive_spkt: } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(td, 0)) { + if (dwc_otg_host_channel_alloc(td, 0, 0)) { td->state = DWC_CHAN_ST_START; goto busy; } @@ -1616,8 +1636,7 @@ check_state: td->did_nak = 1; td->tt_scheduled = 0; goto send_pkt; - } - if (hcint & (HCINT_ACK | HCINT_NYET)) { + } else if (hcint & (HCINT_ACK | HCINT_NYET)) { td->offset += td->tx_bytes; td->remainder -= td->tx_bytes; td->toggle ^= 1; @@ -1642,8 +1661,7 @@ check_state: td->did_nak = 1; td->tt_scheduled = 0; goto send_pkt; - } - if (hcint & (HCINT_ACK | HCINT_NYET)) + } else if (hcint & (HCINT_ACK | HCINT_NYET)) goto send_cpkt; break; @@ -1698,7 +1716,7 @@ check_state: /* FALLTHROUGH */ case DWC_CHAN_ST_TX_PKT_ISOC: - if (dwc_otg_host_channel_alloc(td, 0)) + if (dwc_otg_host_channel_alloc(td, 0, 1)) break; channel = td->channel[0]; goto send_isoc_pkt; @@ -1731,7 +1749,7 @@ send_pkt: } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(td, 0)) { + if (dwc_otg_host_channel_alloc(td, 0, 1)) { td->state = DWC_CHAN_ST_START; goto busy; } @@ -1896,7 +1914,7 @@ send_cpkt: } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(td, td->tt_channel_tog)) { + if (dwc_otg_host_channel_alloc(td, td->tt_channel_tog, 0)) { td->state = DWC_CHAN_ST_WAIT_C_PKT; goto busy; } @@ -2306,6 +2324,31 @@ dwc_otg_timer_stop(struct dwc_otg_softc usb_callout_stop(&sc->sc_timer); } +static void +dwc_otg_host_channel_disable(struct dwc_otg_softc *sc, uint8_t x) +{ + uint32_t hcchar; + + hcchar = DWC_OTG_READ_4(sc, DOTG_HCCHAR(x)); + + /* disable host channel, if any */ + if (hcchar & (HCCHAR_CHENA | HCCHAR_CHDIS)) { + /* disable channel */ + DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(x), + HCCHAR_CHENA | HCCHAR_CHDIS); + /* wait for chip to get its brains in order */ + sc->sc_chan_state[x].wait_sof = 2; + } + + /* release TX FIFO usage, if any */ + sc->sc_tx_cur_p_level -= sc->sc_chan_state[x].tx_p_size; + sc->sc_tx_cur_np_level -= sc->sc_chan_state[x].tx_np_size; + + /* don't release TX FIFO usage twice */ + sc->sc_chan_state[x].tx_p_size = 0; + sc->sc_chan_state[x].tx_np_size = 0; +} + static uint8_t dwc_otg_update_host_transfer_schedule(struct dwc_otg_softc *sc) { @@ -2326,26 +2369,12 @@ dwc_otg_update_host_transfer_schedule(st TAILQ_INIT(&head); for (x = 0; x != sc->sc_host_ch_max; x++) { - uint32_t hcchar; - if (sc->sc_chan_state[x].wait_sof == 0) continue; sc->sc_needsof = 1; - sc->sc_chan_state[x].wait_sof--; - if (sc->sc_chan_state[x].wait_sof != 0) - continue; - - hcchar = DWC_OTG_READ_4(sc, DOTG_HCCHAR(x)); - - /* disable host channel, if any */ - if (hcchar & (HCCHAR_CHENA | HCCHAR_CHDIS)) { - /* disable channel */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(x), - HCCHAR_CHENA | HCCHAR_CHDIS); - /* wait for chip to get its brains in order */ - sc->sc_chan_state[x].wait_sof = 2; - } + if (--(sc->sc_chan_state[x].wait_sof) == 0) + dwc_otg_host_channel_disable(sc, x); } if ((temp & 7) == 0) { Modified: head/sys/dev/usb/controller/dwc_otg.h ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.h Sat May 10 07:26:49 2014 (r265805) +++ head/sys/dev/usb/controller/dwc_otg.h Sat May 10 07:37:32 2014 (r265806) @@ -36,6 +36,7 @@ #define DWC_OTG_HOST_TIMER_RATE 10 /* ms */ #define DWC_OTG_TT_SLOT_MAX 8 #define DWC_OTG_SLOT_IDLE_MAX 4 +#define DWC_OTG_SLOT_IDLE_MIN 2 #define DWC_OTG_READ_4(sc, reg) \ bus_space_read_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg) From owner-svn-src-head@FreeBSD.ORG Sat May 10 08:48:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EC202A3; Sat, 10 May 2014 08:48:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C2983DF; Sat, 10 May 2014 08:48:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4A8m5Sk099815; Sat, 10 May 2014 08:48:05 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4A8m5WL099814; Sat, 10 May 2014 08:48:05 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201405100848.s4A8m5WL099814@svn.freebsd.org> From: Michael Tuexen Date: Sat, 10 May 2014 08:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265811 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 08:48:05 -0000 Author: tuexen Date: Sat May 10 08:48:04 2014 New Revision: 265811 URL: http://svnweb.freebsd.org/changeset/base/265811 Log: Whitespace change. Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Sat May 10 08:10:01 2014 (r265810) +++ head/sys/netinet/udp_usrreq.c Sat May 10 08:48:04 2014 (r265811) @@ -1340,7 +1340,7 @@ udp_output(struct inpcb *inp, struct mbu * For UDP-Lite, checksum coverage length of zero means * the entire UDPLite packet is covered by the checksum. */ - cscov_partial = (cscov == 0) ? 0 : 1; + cscov_partial = (cscov == 0) ? 0 : 1; } else ui->ui_v = IPVERSION << 4; From owner-svn-src-head@FreeBSD.ORG Sat May 10 12:19:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A1821E5; Sat, 10 May 2014 12:19:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0529C859; Sat, 10 May 2014 12:19:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4ACJ3Ou091722; Sat, 10 May 2014 12:19:03 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ACJ3ug091717; Sat, 10 May 2014 12:19:03 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405101219.s4ACJ3ug091717@svn.freebsd.org> From: Luiz Otavio O Souza Date: Sat, 10 May 2014 12:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265813 - in head: share/man/man4 sys/conf sys/dev/iicbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 12:19:04 -0000 Author: loos Date: Sat May 10 12:19:02 2014 New Revision: 265813 URL: http://svnweb.freebsd.org/changeset/base/265813 Log: Add the lm75 i2c digital temperature sensor driver. This driver supports the low and high precision models (9 and 11 bits) and it will auto-detect the both variants. The driver expose the temperature registers (actual temperature, shutdown and hysteresys temperature) and also the configuration register. It was tested on FDT systems: RPi, BBB and on non-FDT systems: AR71xx, with both, hardware i2c controllers (when available) and gpioiic(4). This provides a simple and cheap way for verifying the i2c bus on embedded systems. Added: head/share/man/man4/lm75.4 (contents, props changed) head/sys/dev/iicbus/lm75.c (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat May 10 09:17:45 2014 (r265812) +++ head/share/man/man4/Makefile Sat May 10 12:19:02 2014 (r265813) @@ -228,6 +228,7 @@ MAN= aac.4 \ led.4 \ lge.4 \ ${_linux.4} \ + lm75.4 \ lmc.4 \ lo.4 \ lp.4 \ Added: head/share/man/man4/lm75.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/lm75.4 Sat May 10 12:19:02 2014 (r265813) @@ -0,0 +1,191 @@ +.\" +.\" Copyright (c) 2014 Luiz Otavio O Souza +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 7, 2014 +.Dt LM75 4 +.Os +.Sh NAME +.Nm lm75 +.Nd lm75 i2c digital temperature sensor driver +.Sh SYNOPSIS +.Cd "device iic" +.Cd "device iicbus" +.Cd "device lm75" +.Sh DESCRIPTION +The +.Nm +driver provides access to sensor data and configuration over the +.Xr iicbus 4 . +.Pp +It provides an easy and simple way to check the functionality of an i2c bus +as it provides read and write access to the +.Nm +configuration register. +.Pp +The access to +.Nm +data is made via the +.Xr sysctl 8 +interface: +.Bd -literal +dev.lm75.0.%desc: LM75 temperature sensor +dev.lm75.0.%driver: lm75 +dev.lm75.0.%location: addr=0x49 +dev.lm75.0.%pnpinfo: name=lm750 compat=national,lm75 +dev.lm75.0.%parent: iicbus3 +dev.lm75.0.temperature: 27.1C +dev.lm75.0.thyst: 75.0C +dev.lm75.0.tos: 80.0C +dev.lm75.0.faults: 1 +dev.lm75.0.mode: comparator +dev.lm75.0.polarity: active-low +dev.lm75.0.shutdown: 0 +.Ed +.Bl -tag -width ".Va dev.lm75.%d.temperature" +.It Va dev.lm75.%d.temperature +Is the read-only value of the current temperature read by the sensor. +.It Va dev.lm75.%d.thyst +Sets the hysteresis temperature. +Once the temperature get over the overtemperature shutdown value (tos) +it need to drop bellow the hysteresis temperature to disable the output +(interrupt) pin again. +.It Va dev.lm75.%d.tos +Sets the overtemperature shutdown value. +Once the temperature get over this value the output pin will be enabled. +The way the output (interrupt) pin works, depends on the mode configuration. +.It Va dev.lm75.%d.faults +Is the number of faults that must occur consecutively to activate the +interrupt (output) pin. +It can be set to 1, 2, 4, and 6. +.It Va dev.lm75.%d.mode +Set the operation mode for the sensor interrupt pin. +It can be set to 'comparator' (default) or 'interrupt'. +.It Va dev.lm75.%d.polarity +Set the polarity of the sensor interrupt pin. +It can be set to 'active-low' (default) or 'active-high'. +Please note that the output pin is an open-drain output and it needs a +proper pull-up resistor to work. +.It Va dev.lm75.%d.shutdown +When set to '1' it shutdown the sensor. +The temperature convertion stops but the sensor remains with its i2c bus +active, i.e., it can be woken up by setting this option to '0' again. +.El +.Pp +Please check the +.Nm +datasheet for more details. +.Pp +When used together with +.Xr snmp_lm75 3 +it allows the monitoring of +.Nm +temperature data over SNMP. +.Pp +The +.Nm +driver supports both the low and the high resolution models. +.Pp +The low resolution model (lm75) provides a 9 bit output with the LSB +representing 0.5C. +.Pp +The high resolution model (lm75a) provides an 11 bit output with the LSB +representing 0.125C. +.Pp +The driver tries to auto-detect the +.Nm +model, but the detection of some +.Nm +clones may not work reliably. +.Pp +On a +.Xr device.hints 5 +based system, like +.Li MIPS , +these values are configurable for the +.Nm : +.Bl -tag -width ".Va hint.lm75.%d.addr" +.It Va hint.lm75.%d.at +Is the +.Xr iicbus 4 +you are attaching to. +.It Va hint.lm75.%d.addr +Is the +.Nm +i2c address on the +.Xr iicbus 4 . +.El +.Pp +On a +.Xr FDT 4 +based system, like +.Li ARM , +the DTS part for a +.Nm +device usually looks like: +.Bd -literal +i2c { + + ... + + lm750 { + compatible = "national,lm75"; + i2c-address = <0x49>; + }; +}; +.Ed +.Pp +Where: +.Bl -tag -width ".Va i2c-address" +.It Va compatible +Should always be set to "national,lm75". +.It Va i2c-address +The +.Va i2c-address +property indicates which i2c address the +.Nm +is wired at. +.Nm +temperature sensors can be wired to 8 different address, allowing up to 8 +sensors on the same +.Xr iicbus 4 . +.El +.Sh SEE ALSO +.Xr snmp_lm75 3 , +.Xr fdt 4 , +.Xr iic 4 , +.Xr iicbus 4 , +.Xr sysctl 8 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 11.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver and this manual page was written by +.An Luiz Otavio O Souza Aq loos@FreeBSD.org Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat May 10 09:17:45 2014 (r265812) +++ head/sys/conf/files Sat May 10 12:19:02 2014 (r265813) @@ -1444,6 +1444,7 @@ dev/iicbus/iiconf.c optional iicbus dev/iicbus/iicsmb.c optional iicsmb \ dependency "iicbus_if.h" dev/iicbus/iicoc.c optional iicoc +dev/iicbus/lm75.c optional lm75 dev/iicbus/pcf8563.c optional pcf8563 dev/iicbus/s35390a.c optional s35390a dev/iir/iir.c optional iir Added: head/sys/dev/iicbus/lm75.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/lm75.c Sat May 10 12:19:02 2014 (r265813) @@ -0,0 +1,574 @@ +/*- + * Copyright (c) 2010 Andreas Tobler. + * Copyright (c) 2013-2014 Luiz Otavio O Souza + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#ifdef FDT +#include +#include +#include +#endif + +/* LM75 registers. */ +#define LM75_TEMP 0x0 +#define LM75_CONF 0x1 +#define LM75_CONF_FSHIFT 3 +#define LM75_CONF_FAULT 0x18 +#define LM75_CONF_POL 0x04 +#define LM75_CONF_MODE 0x02 +#define LM75_CONF_SHUTD 0x01 +#define LM75_CONF_MASK 0x1f +#define LM75_THYST 0x2 +#define LM75_TOS 0x3 + +/* LM75 constants. */ +#define LM75_TEST_PATTERN 0xa +#define LM75_MIN_TEMP -55 +#define LM75_MAX_TEMP 125 +#define LM75_0500C 0x80 +#define LM75_0250C 0x40 +#define LM75_0125C 0x20 +#define LM75_MSB 0x8000 +#define LM75_NEG_BIT LM75_MSB +#define TZ_ZEROC 2732 + +/* LM75 supported models. */ +#define HWTYPE_LM75 1 +#define HWTYPE_LM75A 2 + +/* Regular bus attachment functions */ +static int lm75_probe(device_t); +static int lm75_attach(device_t); + +struct lm75_softc { + device_t sc_dev; + struct intr_config_hook enum_hook; + int32_t sc_hwtype; + uint32_t sc_addr; + uint32_t sc_conf; +}; + +static int lm75_faults[4] = { 1, 2, 4, 6 }; + +/* Utility functions */ +static int lm75_conf_read(struct lm75_softc *); +static int lm75_conf_write(struct lm75_softc *); +static int lm75_temp_read(struct lm75_softc *, uint8_t, int *); +static int lm75_temp_write(struct lm75_softc *, uint8_t, int); +static void lm75_start(void *); +static int lm75_read(device_t, uint32_t, uint8_t, uint8_t *, size_t); +static int lm75_write(device_t, uint32_t, uint8_t *, size_t); +static int lm75_str_mode(char *); +static int lm75_str_pol(char *); +static int lm75_temp_sysctl(SYSCTL_HANDLER_ARGS); +static int lm75_faults_sysctl(SYSCTL_HANDLER_ARGS); +static int lm75_mode_sysctl(SYSCTL_HANDLER_ARGS); +static int lm75_pol_sysctl(SYSCTL_HANDLER_ARGS); +static int lm75_shutdown_sysctl(SYSCTL_HANDLER_ARGS); + +static device_method_t lm75_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, lm75_probe), + DEVMETHOD(device_attach, lm75_attach), + + DEVMETHOD_END +}; + +static driver_t lm75_driver = { + "lm75", + lm75_methods, + sizeof(struct lm75_softc) +}; + +static devclass_t lm75_devclass; + +DRIVER_MODULE(lm75, iicbus, lm75_driver, lm75_devclass, 0, 0); + +static int +lm75_read(device_t dev, uint32_t addr, uint8_t reg, uint8_t *data, size_t len) +{ + struct iic_msg msg[2] = { + { addr, IIC_M_WR | IIC_M_NOSTOP, 1, ® }, + { addr, IIC_M_RD, len, data }, + }; + + if (iicbus_transfer(dev, msg, 2) != 0) + return (-1); + + return (0); +} + +static int +lm75_write(device_t dev, uint32_t addr, uint8_t *data, size_t len) +{ + struct iic_msg msg[1] = { + { addr, IIC_M_WR, len, data }, + }; + + if (iicbus_transfer(dev, msg, 1) != 0) + return (-1); + + return (0); +} + +static int +lm75_probe(device_t dev) +{ + struct lm75_softc *sc; + + sc = device_get_softc(dev); + sc->sc_hwtype = HWTYPE_LM75; +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "national,lm75")) + return (ENXIO); +#endif + device_set_desc(dev, "LM75 temperature sensor"); + + return (BUS_PROBE_GENERIC); +} + +static int +lm75_attach(device_t dev) +{ + struct lm75_softc *sc; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_addr = iicbus_get_addr(dev); + + sc->enum_hook.ich_func = lm75_start; + sc->enum_hook.ich_arg = dev; + + /* + * We have to wait until interrupts are enabled. Usually I2C read + * and write only works when the interrupts are available. + */ + if (config_intrhook_establish(&sc->enum_hook) != 0) + return (ENOMEM); + + return (0); +} + +static int +lm75_type_detect(struct lm75_softc *sc) +{ + int i, lm75a; + uint8_t buf8; + uint32_t conf; + + /* Save the contents of the configuration register. */ + if (lm75_conf_read(sc) != 0) + return (-1); + conf = sc->sc_conf; + + /* + * Just write some pattern at configuration register so we can later + * verify. The test pattern should be pretty harmless. + */ + sc->sc_conf = LM75_TEST_PATTERN; + if (lm75_conf_write(sc) != 0) + return (-1); + + /* + * Read the configuration register again and check for our test + * pattern. + */ + if (lm75_conf_read(sc) != 0) + return (-1); + if (sc->sc_conf != LM75_TEST_PATTERN) + return (-1); + + /* + * Read from nonexistent registers (0x4 ~ 0x6). + * LM75A always return 0xff for nonexistent registers. + * LM75 will return the last read value - our test pattern written to + * configuration register. + */ + lm75a = 0; + for (i = 4; i <= 6; i++) { + if (lm75_read(sc->sc_dev, sc->sc_addr, i, &buf8, 1) < 0) + return (-1); + if (buf8 != LM75_TEST_PATTERN && buf8 != 0xff) + return (-1); + if (buf8 == 0xff) + lm75a++; + } + if (lm75a == 3) + sc->sc_hwtype = HWTYPE_LM75A; + + /* Restore the configuration register. */ + sc->sc_conf = conf; + if (lm75_conf_write(sc) != 0) + return (-1); + + return (0); +} + +static void +lm75_start(void *xdev) +{ + device_t dev; + struct lm75_softc *sc; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree_node; + struct sysctl_oid_list *tree; + + dev = (device_t)xdev; + sc = device_get_softc(dev); + ctx = device_get_sysctl_ctx(dev); + tree_node = device_get_sysctl_tree(dev); + tree = SYSCTL_CHILDREN(tree_node); + + config_intrhook_disestablish(&sc->enum_hook); + + /* + * Detect the kind of chip we are attaching to. + * This may not work for LM75 clones. + */ + if (lm75_type_detect(sc) != 0) { + device_printf(dev, "cannot read from sensor.\n"); + return; + } + if (sc->sc_hwtype == HWTYPE_LM75A) + device_printf(dev, + "LM75A type sensor detected (11bits resolution).\n"); + + /* Temperature. */ + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "temperature", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev, LM75_TEMP, + lm75_temp_sysctl, "IK", "Current temperature"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "thyst", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, dev, LM75_THYST, + lm75_temp_sysctl, "IK", "Hysteresis temperature"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "tos", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, dev, LM75_TOS, + lm75_temp_sysctl, "IK", "Overtemperature"); + + /* Configuration parameters. */ + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "faults", + CTLFLAG_RW | CTLTYPE_UINT, dev, 0, + lm75_faults_sysctl, "IU", "LM75 fault queue"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "mode", + CTLFLAG_RW | CTLTYPE_STRING, dev, 0, + lm75_mode_sysctl, "A", "LM75 mode"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "polarity", + CTLFLAG_RW | CTLTYPE_STRING, dev, 0, + lm75_pol_sysctl, "A", "LM75 OS polarity"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "shutdown", + CTLFLAG_RW | CTLTYPE_UINT, dev, 0, + lm75_shutdown_sysctl, "IU", "LM75 shutdown"); +} + +static int +lm75_conf_read(struct lm75_softc *sc) +{ + uint8_t buf8; + + if (lm75_read(sc->sc_dev, sc->sc_addr, LM75_CONF, &buf8, 1) < 0) + return (-1); + + sc->sc_conf = (uint32_t)buf8; + + return (0); +} + +static int +lm75_conf_write(struct lm75_softc *sc) +{ + uint8_t buf8[2]; + + buf8[0] = LM75_CONF; + buf8[1] = (uint8_t)sc->sc_conf & LM75_CONF_MASK; + + if (lm75_write(sc->sc_dev, sc->sc_addr, buf8, 2) < 0) + return (-1); + + return (0); +} + +static int +lm75_temp_read(struct lm75_softc *sc, uint8_t reg, int *temp) +{ + uint8_t buf8[2]; + uint16_t buf; + int t; + + if (lm75_read(sc->sc_dev, sc->sc_addr, reg, buf8, 2) < 0) + return (-1); + + buf = (buf8[0] << 8) | (buf8[1] & 0xff); + + /* + * LM75 has a 9 bit ADC with resolution of 0.5 C per bit. + * LM75A has an 11 bit ADC with resolution of 0.125 C per bit. + * Temperature is stored with two's complement. + */ + if (buf & LM75_NEG_BIT) + buf = ~buf + 1; + *temp = ((int16_t)buf >> 8) * 10; + t = 0; + if (sc->sc_hwtype == HWTYPE_LM75A) { + if (buf & LM75_0125C) + t += 125; + if (buf & LM75_0250C) + t += 250; + } + if (buf & LM75_0500C) + t += 500; + t /= 100; + *temp += t; + if (buf & LM75_NEG_BIT) + *temp = -(*temp); + *temp += TZ_ZEROC; + + return (0); +} + +static int +lm75_temp_write(struct lm75_softc *sc, uint8_t reg, int temp) +{ + uint8_t buf8[3]; + uint16_t buf; + + if (temp > LM75_MAX_TEMP) + temp = LM75_MAX_TEMP; + if (temp < LM75_MIN_TEMP) + temp = LM75_MIN_TEMP; + + buf = (uint16_t)temp; + buf <<= 8; + + buf8[0] = reg; + buf8[1] = buf >> 8; + buf8[2] = buf & 0xff; + + if (lm75_write(sc->sc_dev, sc->sc_addr, buf8, 3) < 0) + return (-1); + + return (0); +} + +static int +lm75_str_mode(char *buf) +{ + int len, rtrn; + + rtrn = -1; + len = strlen(buf); + if (len > 2 && strncasecmp("interrupt", buf, len) == 0) + rtrn = 1; + else if (len > 2 && strncasecmp("comparator", buf, len) == 0) + rtrn = 0; + + return (rtrn); +} + +static int +lm75_str_pol(char *buf) +{ + int len, rtrn; + + rtrn = -1; + len = strlen(buf); + if (len > 1 && strncasecmp("high", buf, len) == 0) + rtrn = 1; + else if (len > 1 && strncasecmp("low", buf, len) == 0) + rtrn = 0; + else if (len > 8 && strncasecmp("active-high", buf, len) == 0) + rtrn = 1; + else if (len > 8 && strncasecmp("active-low", buf, len) == 0) + rtrn = 0; + + return (rtrn); +} + +static int +lm75_temp_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t dev; + int error, temp; + struct lm75_softc *sc; + uint8_t reg; + + dev = (device_t)arg1; + reg = (uint8_t)arg2; + sc = device_get_softc(dev); + + if (lm75_temp_read(sc, reg, &temp) != 0) + return (EIO); + + error = sysctl_handle_int(oidp, &temp, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (lm75_temp_write(sc, reg, temp) != 0) + return (EIO); + + return (error); +} + +static int +lm75_faults_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t dev; + int error, faults, i, newf, tmp; + struct lm75_softc *sc; + + dev = (device_t)arg1; + sc = device_get_softc(dev); + tmp = (sc->sc_conf & LM75_CONF_FAULT) >> LM75_CONF_FSHIFT; + if (tmp > nitems(lm75_faults)) + tmp = nitems(lm75_faults); + faults = lm75_faults[tmp]; + + error = sysctl_handle_int(oidp, &faults, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (faults != lm75_faults[tmp]) { + newf = 0; + for (i = 0; i < nitems(lm75_faults); i++) + if (faults >= lm75_faults[i]) + newf = i; + sc->sc_conf &= ~LM75_CONF_FAULT; + sc->sc_conf |= newf << LM75_CONF_FSHIFT; + if (lm75_conf_write(sc) != 0) + return (EIO); + } + + return (error); +} + +static int +lm75_mode_sysctl(SYSCTL_HANDLER_ARGS) +{ + char buf[16]; + device_t dev; + int error, mode, newm; + struct lm75_softc *sc; + + dev = (device_t)arg1; + sc = device_get_softc(dev); + if (sc->sc_conf & LM75_CONF_MODE) { + mode = 1; + strlcpy(buf, "interrupt", sizeof(buf)); + } else { + mode = 0; + strlcpy(buf, "comparator", sizeof(buf)); + } + + error = sysctl_handle_string(oidp, buf, sizeof(buf), req); + if (error != 0 || req->newptr == NULL) + return (error); + + newm = lm75_str_mode(buf); + if (newm != -1 && mode != newm) { + sc->sc_conf &= ~LM75_CONF_MODE; + if (newm == 1) + sc->sc_conf |= LM75_CONF_MODE; + if (lm75_conf_write(sc) != 0) + return (EIO); + } + + return (error); +} + +static int +lm75_pol_sysctl(SYSCTL_HANDLER_ARGS) +{ + char buf[16]; + device_t dev; + int error, newp, pol; + struct lm75_softc *sc; + + dev = (device_t)arg1; + sc = device_get_softc(dev); + if (sc->sc_conf & LM75_CONF_POL) { + pol = 1; + strlcpy(buf, "active-high", sizeof(buf)); + } else { + pol = 0; + strlcpy(buf, "active-low", sizeof(buf)); + } + + error = sysctl_handle_string(oidp, buf, sizeof(buf), req); + if (error != 0 || req->newptr == NULL) + return (error); + + newp = lm75_str_pol(buf); + if (newp != -1 && pol != newp) { + sc->sc_conf &= ~LM75_CONF_POL; + if (newp == 1) + sc->sc_conf |= LM75_CONF_POL; + if (lm75_conf_write(sc) != 0) + return (EIO); + } + + return (error); +} + +static int +lm75_shutdown_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t dev; + int error, shutdown, tmp; + struct lm75_softc *sc; + + dev = (device_t)arg1; + sc = device_get_softc(dev); + tmp = shutdown = (sc->sc_conf & LM75_CONF_SHUTD) ? 1 : 0; + + error = sysctl_handle_int(oidp, &shutdown, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (shutdown != tmp) { + sc->sc_conf &= ~LM75_CONF_SHUTD; + if (shutdown) + sc->sc_conf |= LM75_CONF_SHUTD; + if (lm75_conf_write(sc) != 0) + return (EIO); + } + + return (error); +} From owner-svn-src-head@FreeBSD.ORG Sat May 10 12:58:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBDBA71B; Sat, 10 May 2014 12:58:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEEA8B13; Sat, 10 May 2014 12:58:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4ACwITg008725; Sat, 10 May 2014 12:58:18 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ACwI9O008724; Sat, 10 May 2014 12:58:18 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405101258.s4ACwI9O008724@svn.freebsd.org> From: Luiz Otavio O Souza Date: Sat, 10 May 2014 12:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265814 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 12:58:19 -0000 Author: loos Date: Sat May 10 12:58:18 2014 New Revision: 265814 URL: http://svnweb.freebsd.org/changeset/base/265814 Log: Remove an old mistake of mine. This has sneak in the code i sent to gonzo at that time, but AFAIK it is only used on routerboards. Enabling GPIO_FUNC_SPI_CS[1|2]_EN will claim the use of gpio pins 0 and 1 respectivelly for use as SPI CS pins. When really needed, this can still be enabled on kernel hints using the function_set and function_clear knobs. Modified: head/sys/mips/atheros/ar71xx_gpio.c Modified: head/sys/mips/atheros/ar71xx_gpio.c ============================================================================== --- head/sys/mips/atheros/ar71xx_gpio.c Sat May 10 12:19:02 2014 (r265813) +++ head/sys/mips/atheros/ar71xx_gpio.c Sat May 10 12:58:18 2014 (r265814) @@ -352,7 +352,6 @@ ar71xx_gpio_attach(device_t dev) int error = 0; int i, j, maxpin; int mask, pinon; - int old = 0; KASSERT((device_get_unit(dev) == 0), ("ar71xx_gpio: Only one gpio module supported")); @@ -391,19 +390,12 @@ ar71xx_gpio_attach(device_t dev) "function_set", &mask) == 0) { device_printf(dev, "function_set: 0x%x\n", mask); ar71xx_gpio_function_enable(sc, mask); - old = 1; } /* Disable function bits that are required */ if (resource_int_value(device_get_name(dev), device_get_unit(dev), "function_clear", &mask) == 0) { device_printf(dev, "function_clear: 0x%x\n", mask); ar71xx_gpio_function_disable(sc, mask); - old = 1; - } - /* Handle previous behaviour */ - if (old == 0) { - ar71xx_gpio_function_enable(sc, GPIO_FUNC_SPI_CS1_EN); - ar71xx_gpio_function_enable(sc, GPIO_FUNC_SPI_CS2_EN); } /* Configure all pins as input */ @@ -457,8 +449,6 @@ ar71xx_gpio_detach(device_t dev) KASSERT(mtx_initialized(&sc->gpio_mtx), ("gpio mutex not initialized")); - ar71xx_gpio_function_disable(sc, GPIO_FUNC_SPI_CS1_EN); - ar71xx_gpio_function_disable(sc, GPIO_FUNC_SPI_CS2_EN); bus_generic_detach(dev); if (sc->gpio_mem_res) From owner-svn-src-head@FreeBSD.ORG Sat May 10 13:05:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2C5D8B6; Sat, 10 May 2014 13:05:47 +0000 (UTC) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F0FFBB4; Sat, 10 May 2014 13:05:47 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.8/8.14.8) with ESMTP id s4AD5ina084454 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 10 May 2014 07:05:44 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.8/8.14.8/Submit) with ESMTP id s4AD5iIv084451; Sat, 10 May 2014 07:05:44 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Sat, 10 May 2014 07:05:44 -0600 (MDT) From: Warren Block To: Sergey Kandaurov Subject: Re: svn commit: r265798 - head/share/man/man4 In-Reply-To: Message-ID: References: <201405100324.s4A3Okgc048998@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Sat, 10 May 2014 07:05:44 -0600 (MDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warren Block X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 13:05:47 -0000 On Sat, 10 May 2014, Sergey Kandaurov wrote: > On 10 May 2014 07:24, Warren Block wrote: >> Author: wblock (doc committer) >> Date: Sat May 10 03:24:45 2014 >> New Revision: 265798 >> URL: http://svnweb.freebsd.org/changeset/base/265798 >> >> Log: >> Add a man page for the new vt.4 device. >> > > Forgot to attach to the build? Intentionally delayed until I can get a test build of my proposed Makefile changes to work. Right now, I see "src.opts.mk" errors, which might be unrelated. Proposed changes: Index: Makefile =================================================================== --- Makefile (revision 265797) +++ Makefile (working copy) @@ -564,6 +564,7 @@ ${_vmx.4} \ vpo.4 \ vr.4 \ + ${_vt.4} \ vte.4 \ ${_vtnet.4} \ ${_vxge.4} \ @@ -806,6 +807,7 @@ _virtio_random.4= virtio_random.4 _virtio_scsi.4= virtio_scsi.4 _vmx.4= vmx.4 +_vt.4= vt.4 _vtnet.4= vtnet.4 _vxge.4= vxge.4 _padlock.4= padlock.4 >> +.\" >> +.Dd May 9, 2014 >> +.Dt VIRTUAL TERMINALS 4 > > This line renders badly. Well that's embarrassing. Working on it now, thanks! From owner-svn-src-head@FreeBSD.ORG Sat May 10 13:10:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 213A0B21; Sat, 10 May 2014 13:10:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9DDEBF9; Sat, 10 May 2014 13:10:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4ADAgBd014334; Sat, 10 May 2014 13:10:42 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ADAgBX014333; Sat, 10 May 2014 13:10:42 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201405101310.s4ADAgBX014333@svn.freebsd.org> From: Warren Block Date: Sat, 10 May 2014 13:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265815 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 13:10:43 -0000 Author: wblock (doc committer) Date: Sat May 10 13:10:42 2014 New Revision: 265815 URL: http://svnweb.freebsd.org/changeset/base/265815 Log: Fix document title. Submitted by: pluknet Modified: head/share/man/man4/vt.4 Modified: head/share/man/man4/vt.4 ============================================================================== --- head/share/man/man4/vt.4 Sat May 10 12:58:18 2014 (r265814) +++ head/share/man/man4/vt.4 Sat May 10 13:10:42 2014 (r265815) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd May 9, 2014 -.Dt VIRTUAL TERMINALS 4 +.Dt "VIRTUAL TERMINALS" 4 .Os .Sh NAME .Nm vt From owner-svn-src-head@FreeBSD.ORG Sat May 10 13:16:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D8B9CCE; Sat, 10 May 2014 13:16:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71125C7D; Sat, 10 May 2014 13:16:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4ADG5r5017697; Sat, 10 May 2014 13:16:05 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ADG5Ib017696; Sat, 10 May 2014 13:16:05 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405101316.s4ADG5Ib017696@svn.freebsd.org> From: Luiz Otavio O Souza Date: Sat, 10 May 2014 13:16:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265816 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 13:16:05 -0000 Author: loos Date: Sat May 10 13:16:04 2014 New Revision: 265816 URL: http://svnweb.freebsd.org/changeset/base/265816 Log: Do not configure all pins as outputs as this can lead to short circuits when the GPIO pin is connected to a push button (or other devices). Instead keep the boot loader settings. Calling ar71xx_gpio_pin_configure() with DEFAULT_CAPS was probably a mistake and was causing all the pins to be set as outputs. Modified: head/sys/mips/atheros/ar71xx_gpio.c Modified: head/sys/mips/atheros/ar71xx_gpio.c ============================================================================== --- head/sys/mips/atheros/ar71xx_gpio.c Sat May 10 13:10:42 2014 (r265815) +++ head/sys/mips/atheros/ar71xx_gpio.c Sat May 10 13:16:04 2014 (r265816) @@ -352,6 +352,7 @@ ar71xx_gpio_attach(device_t dev) int error = 0; int i, j, maxpin; int mask, pinon; + uint32_t oe; KASSERT((device_get_unit(dev) == 0), ("ar71xx_gpio: Only one gpio module supported")); @@ -398,8 +399,7 @@ ar71xx_gpio_attach(device_t dev) ar71xx_gpio_function_disable(sc, mask); } - /* Configure all pins as input */ - /* disable interrupts for all pins */ + /* Disable interrupts for all pins. */ GPIO_WRITE(sc, AR71XX_GPIO_INT_MASK, 0); /* Initialise all pins specified in the mask, up to the pin count */ @@ -416,6 +416,8 @@ ar71xx_gpio_attach(device_t dev) continue; sc->gpio_npins++; } + /* Iniatilize the GPIO pins, keep the loader settings. */ + oe = GPIO_READ(sc, AR71XX_GPIO_OE); sc->gpio_pins = malloc(sizeof(*sc->gpio_pins) * sc->gpio_npins, M_DEVBUF, M_WAITOK | M_ZERO); for (i = 0, j = 0; j <= maxpin; j++) { @@ -425,8 +427,10 @@ ar71xx_gpio_attach(device_t dev) "pin %d", j); sc->gpio_pins[i].gp_pin = j; sc->gpio_pins[i].gp_caps = DEFAULT_CAPS; - sc->gpio_pins[i].gp_flags = 0; - ar71xx_gpio_pin_configure(sc, &sc->gpio_pins[i], DEFAULT_CAPS); + if (oe & (1 << j)) + sc->gpio_pins[i].gp_flags = GPIO_PIN_OUTPUT; + else + sc->gpio_pins[i].gp_flags = GPIO_PIN_INPUT; i++; } /* Turn on the hinted pins. */ From owner-svn-src-head@FreeBSD.ORG Sat May 10 13:18:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 091FCE64; Sat, 10 May 2014 13:18:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAD1DC90; Sat, 10 May 2014 13:18:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4ADIKs7018008; Sat, 10 May 2014 13:18:20 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ADIKBt018007; Sat, 10 May 2014 13:18:20 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201405101318.s4ADIKBt018007@svn.freebsd.org> From: Michael Tuexen Date: Sat, 10 May 2014 13:18:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265817 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 13:18:21 -0000 Author: tuexen Date: Sat May 10 13:18:20 2014 New Revision: 265817 URL: http://svnweb.freebsd.org/changeset/base/265817 Log: UDP-Lite uses SOCK_DGRAM, not SOCK_STREAM. Modified: head/share/man/man4/udplite.4 Modified: head/share/man/man4/udplite.4 ============================================================================== --- head/share/man/man4/udplite.4 Sat May 10 13:16:04 2014 (r265816) +++ head/share/man/man4/udplite.4 Sat May 10 13:18:20 2014 (r265817) @@ -35,7 +35,7 @@ .In sys/socket.h .In netinet/udplite.h .Ft int -.Fn socket AF_INET SOCK_STREAM IPPROTO_UDPLITE +.Fn socket AF_INET SOCK_DGRAM IPPROTO_UDPLITE .Sh DESCRIPTION The .Tn UDP-Lite From owner-svn-src-head@FreeBSD.ORG Sat May 10 15:21:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C83D3905; Sat, 10 May 2014 15:21:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B6CB882; Sat, 10 May 2014 15:21:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AFLckc074020; Sat, 10 May 2014 15:21:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AFLbTR074017; Sat, 10 May 2014 15:21:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405101521.s4AFLbTR074017@svn.freebsd.org> From: Alexander Motin Date: Sat, 10 May 2014 15:21:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265821 - in head/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 15:21:38 -0000 Author: mav Date: Sat May 10 15:21:37 2014 New Revision: 265821 URL: http://svnweb.freebsd.org/changeset/base/265821 Log: Comment out some pointless device open/close around reading device IDs. FreeBSD ZFS port unlike OpenSolaris does not use device IDs, and does not implement respective devid_*() fuctions. It is pointless to open devices just to close them back immediately. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Sat May 10 14:47:53 2014 (r265820) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Sat May 10 15:21:37 2014 (r265821) @@ -512,6 +512,7 @@ make_leaf_vdev(const char *arg, uint64_t verify(nvlist_add_uint64(vdev, ZPOOL_CONFIG_WHOLE_DISK, (uint64_t)wholedisk) == 0); +#ifdef have_devid /* * For a whole disk, defer getting its devid until after labeling it. */ @@ -546,6 +547,7 @@ make_leaf_vdev(const char *arg, uint64_t (void) close(fd); } +#endif return (vdev); } Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Sat May 10 14:47:53 2014 (r265820) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Sat May 10 15:21:37 2014 (r265821) @@ -94,6 +94,7 @@ typedef struct pool_list { static char * get_devid(const char *path) { +#ifdef have_devid int fd; ddi_devid_t devid; char *minor, *ret; @@ -113,6 +114,9 @@ get_devid(const char *path) (void) close(fd); return (ret); +#else + return (NULL); +#endif } Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Sat May 10 14:47:53 2014 (r265820) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Sat May 10 15:21:37 2014 (r265821) @@ -3324,6 +3324,7 @@ devid_to_path(char *devid_str) static char * path_to_devid(const char *path) { +#ifdef have_devid int fd; ddi_devid_t devid; char *minor, *ret; @@ -3343,6 +3344,9 @@ path_to_devid(const char *path) (void) close(fd); return (ret); +#else + return (NULL); +#endif } /* From owner-svn-src-head@FreeBSD.ORG Sat May 10 15:34:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABE59C8B; Sat, 10 May 2014 15:34:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99591953; Sat, 10 May 2014 15:34:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AFYWwu078712; Sat, 10 May 2014 15:34:32 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AFYWBh078711; Sat, 10 May 2014 15:34:32 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201405101534.s4AFYWBh078711@svn.freebsd.org> From: Kevin Lo Date: Sat, 10 May 2014 15:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265822 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 15:34:32 -0000 Author: kevlo Date: Sat May 10 15:34:32 2014 New Revision: 265822 URL: http://svnweb.freebsd.org/changeset/base/265822 Log: Fix -width argument to Bl -tag. Modified: head/share/man/man4/udplite.4 Modified: head/share/man/man4/udplite.4 ============================================================================== --- head/share/man/man4/udplite.4 Sat May 10 15:21:37 2014 (r265821) +++ head/share/man/man4/udplite.4 Sat May 10 15:34:32 2014 (r265822) @@ -52,7 +52,7 @@ supports a number of socket options whic .Xr setsockopt 2 and tested with .Xr getsockopt 2 : -.Bl -tag -width ".Dv SCTP_SET_PEER_PRIMARY_ADDR" +.Bl -tag -width ".Dv UDPLITE_SEND_CSCOV" .It Dv UDPLITE_SEND_CSCOV This option sets the sender checksum coverage. A value of zero indicates that the entire packet From owner-svn-src-head@FreeBSD.ORG Sat May 10 15:38:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B30723B1; Sat, 10 May 2014 15:38:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A00A2C94; Sat, 10 May 2014 15:38:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AFcQhE079236; Sat, 10 May 2014 15:38:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AFcQmC079235; Sat, 10 May 2014 15:38:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201405101538.s4AFcQmC079235@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 10 May 2014 15:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265823 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 15:38:26 -0000 Author: nwhitehorn Date: Sat May 10 15:38:26 2014 New Revision: 265823 URL: http://svnweb.freebsd.org/changeset/base/265823 Log: Simplify code slightly. Passing an array by &array[0] does work, but is silly. Modified: head/sys/powerpc/powerpc/platform.c Modified: head/sys/powerpc/powerpc/platform.c ============================================================================== --- head/sys/powerpc/powerpc/platform.c Sat May 10 15:34:32 2014 (r265822) +++ head/sys/powerpc/powerpc/platform.c Sat May 10 15:38:26 2014 (r265823) @@ -116,7 +116,7 @@ mem_regions(struct mem_region **phys, in int i, j, still_merging; if (npregions == 0) { - PLATFORM_MEM_REGIONS(plat_obj, &pregions[0], &npregions, + PLATFORM_MEM_REGIONS(plat_obj, pregions, &npregions, aregions, &naregions); qsort(pregions, npregions, sizeof(*pregions), mr_cmp); qsort(aregions, naregions, sizeof(*aregions), mr_cmp); From owner-svn-src-head@FreeBSD.ORG Sat May 10 16:30:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9C7C1D4; Sat, 10 May 2014 16:30:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7CAE130; Sat, 10 May 2014 16:30:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AGUmoc002772; Sat, 10 May 2014 16:30:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AGUmOd002771; Sat, 10 May 2014 16:30:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405101630.s4AGUmOd002771@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 10 May 2014 16:30:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265824 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 16:30:48 -0000 Author: kib Date: Sat May 10 16:30:48 2014 New Revision: 265824 URL: http://svnweb.freebsd.org/changeset/base/265824 Log: Print the entry address in addition to the object. The variable is typically optimized out and debuggers cannot find its value. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sat May 10 15:38:26 2014 (r265823) +++ head/sys/vm/vm_map.c Sat May 10 16:30:48 2014 (r265824) @@ -1949,7 +1949,8 @@ vm_map_protect(vm_map_t map, vm_offset_t * charged clipped mapping of the same object later. */ KASSERT(obj->charge == 0, - ("vm_map_protect: object %p overcharged\n", obj)); + ("vm_map_protect: object %p overcharged (entry %p)", + obj, current)); if (!swap_reserve(ptoa(obj->size))) { VM_OBJECT_WUNLOCK(obj); vm_map_unlock(map); From owner-svn-src-head@FreeBSD.ORG Sat May 10 16:36:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2002E455; Sat, 10 May 2014 16:36:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DA431D6; Sat, 10 May 2014 16:36:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AGaDgq005706; Sat, 10 May 2014 16:36:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AGaD4S005705; Sat, 10 May 2014 16:36:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405101636.s4AGaD4S005705@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 10 May 2014 16:36:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265825 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 16:36:14 -0000 Author: kib Date: Sat May 10 16:36:13 2014 New Revision: 265825 URL: http://svnweb.freebsd.org/changeset/base/265825 Log: When printing the map with the ddb 'show procvm' command, do not dump page queues for the backing objects. The queues are huge and clutter the display, when mostly the map entries and its backing storage is interesting. The page queues can be seen with ddb 'show object' command. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sat May 10 16:30:48 2014 (r265824) +++ head/sys/vm/vm_map.c Sat May 10 16:36:13 2014 (r265825) @@ -4154,7 +4154,7 @@ vm_map_print(vm_map_t map) db_indent += 2; vm_object_print((db_expr_t)(intptr_t) entry->object.vm_object, - 1, 0, (char *)0); + 0, 0, (char *)0); db_indent -= 2; } } From owner-svn-src-head@FreeBSD.ORG Sat May 10 16:37:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 368AE68C; Sat, 10 May 2014 16:37:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2263C1F6; Sat, 10 May 2014 16:37:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AGbTbV006058; Sat, 10 May 2014 16:37:29 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AGbS9r006056; Sat, 10 May 2014 16:37:28 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405101637.s4AGbS9r006056@svn.freebsd.org> From: Warner Losh Date: Sat, 10 May 2014 16:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265826 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 16:37:29 -0000 Author: imp Date: Sat May 10 16:37:28 2014 New Revision: 265826 URL: http://svnweb.freebsd.org/changeset/base/265826 Log: Document WITHOUT_SYSCALL_COMPAT and WITHOUT_GNU_GREP_COMPAT. Added: head/tools/build/options/WITHOUT_GNU_GREP_COMPAT (contents, props changed) head/tools/build/options/WITHOUT_SYSCALL_COMPAT (contents, props changed) Added: head/tools/build/options/WITHOUT_GNU_GREP_COMPAT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_GNU_GREP_COMPAT Sat May 10 16:37:28 2014 (r265826) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set this option to omit the gnu extentions to grep from being included in +BSD grep. + Added: head/tools/build/options/WITHOUT_SYSCALL_COMPAT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_SYSCALL_COMPAT Sat May 10 16:37:28 2014 (r265826) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Do not include some compatible syscall wrappers in libc. From owner-svn-src-head@FreeBSD.ORG Sat May 10 16:37:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23DFD7BD; Sat, 10 May 2014 16:37:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11A441F9; Sat, 10 May 2014 16:37:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AGbXcm006118; Sat, 10 May 2014 16:37:33 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AGbX4x006117; Sat, 10 May 2014 16:37:33 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405101637.s4AGbX4x006117@svn.freebsd.org> From: Warner Losh Date: Sat, 10 May 2014 16:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265827 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 16:37:34 -0000 Author: imp Date: Sat May 10 16:37:33 2014 New Revision: 265827 URL: http://svnweb.freebsd.org/changeset/base/265827 Log: Remove a few more vestiges of allowing WITHOUT_BMAKE to imply you want to buid with fmake. Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sat May 10 16:37:28 2014 (r265826) +++ head/Makefile Sat May 10 16:37:33 2014 (r265827) @@ -316,13 +316,6 @@ kernel: buildkernel installkernel upgrade_checks: .if ${HAVE_MAKE} != ${WANT_MAKE} @(cd ${.CURDIR} && ${MAKE} ${WANT_MAKE:S,^f,,}) -.elif ${WANT_MAKE} == "fmake" - @if ! (cd ${.CURDIR}/tools/build/make_check && \ - PATH=${PATH} ${BINMAKE} obj >/dev/null 2>&1 && \ - PATH=${PATH} ${BINMAKE} >/dev/null 2>&1); \ - then \ - (cd ${.CURDIR} && ${MAKE} make); \ - fi .endif # @@ -336,18 +329,18 @@ MMAKEENV= MAKEOBJDIRPREFIX=${MYMAKE:H} \ MMAKE= ${MMAKEENV} ${MAKE} \ -D_UPGRADING -DNO_MAN -DNO_SHARED \ -DNO_CPU_CFLAGS -DNO_WERROR \ - DESTDIR= MK_TESTS=no PROGNAME=${MYMAKE:T} + DESTDIR= PROGNAME=${MYMAKE:T} -make bmake: .PHONY +bmake: .PHONY @echo @echo "--------------------------------------------------------------" - @echo ">>> Building an up-to-date make(1)" + @echo ">>> Building an up-to-date ${.TARGET}(1)" @echo "--------------------------------------------------------------" ${_+_}@cd ${.CURDIR}/usr.bin/${.TARGET}; \ ${MMAKE} obj && \ ${MMAKE} depend && \ ${MMAKE} all && \ - ${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR= NO_MAN=t + ${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR= tinderbox toolchains kernel-toolchains: upgrade_checks From owner-svn-src-head@FreeBSD.ORG Sat May 10 16:37:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97BD38F6; Sat, 10 May 2014 16:37:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B68D1FA; Sat, 10 May 2014 16:37:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AGbeqa006196; Sat, 10 May 2014 16:37:40 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AGbduS006189; Sat, 10 May 2014 16:37:39 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405101637.s4AGbduS006189@svn.freebsd.org> From: Warner Losh Date: Sat, 10 May 2014 16:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265828 - in head: share/mk tools/build/options usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 16:37:40 -0000 Author: imp Date: Sat May 10 16:37:39 2014 New Revision: 265828 URL: http://svnweb.freebsd.org/changeset/base/265828 Log: Optionally allow building the historical FreeBSD make program and install it as fmake. This defaults to no. This should be viewed as the first step towards evental migration of this historic code to ports and removal from the tree. Added: head/tools/build/options/WITH_FMAKE (contents, props changed) Modified: head/share/mk/src.opts.mk head/usr.bin/Makefile Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sat May 10 16:37:33 2014 (r265827) +++ head/share/mk/src.opts.mk Sat May 10 16:37:39 2014 (r265828) @@ -165,6 +165,7 @@ __DEFAULT_NO_OPTIONS = \ BSD_GREP \ CLANG_EXTRAS \ EISA \ + FMAKE \ HESIOD \ LLDB \ NAND \ Added: head/tools/build/options/WITH_FMAKE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_FMAKE Sat May 10 16:37:39 2014 (r265828) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Causes the old FreeBSD +.Xr make 1 +program to be built and installed as fmake. + Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Sat May 10 16:37:33 2014 (r265827) +++ head/usr.bin/Makefile Sat May 10 16:37:39 2014 (r265828) @@ -230,6 +230,10 @@ SUBDIR+= calendar _clang= clang .endif +.if ${MK_FMAKE} != "no" +SUBDIR+= make +.endif + .if ${MK_GPL_DTC} != "yes" SUBDIR+= dtc .endif From owner-svn-src-head@FreeBSD.ORG Sat May 10 16:37:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B5A0A2D; Sat, 10 May 2014 16:37:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 888551FF; Sat, 10 May 2014 16:37:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AGbjxG006255; Sat, 10 May 2014 16:37:45 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AGbjrg006253; Sat, 10 May 2014 16:37:45 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405101637.s4AGbjrg006253@svn.freebsd.org> From: Warner Losh Date: Sat, 10 May 2014 16:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265829 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 16:37:45 -0000 Author: imp Date: Sat May 10 16:37:44 2014 New Revision: 265829 URL: http://svnweb.freebsd.org/changeset/base/265829 Log: Support, to the extent we generate proper command lines, compiling with clang 3.3. Useful for test building -current on a -stable system in individual directories. Potentially useful if we ever want to support, say, gcc 4.8 or 4.9's new warnings when building with an external toolchain (but such support not yet committed). Document the bsd.compiler.mk interface. Modified: head/share/mk/bsd.compiler.mk head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Sat May 10 16:37:39 2014 (r265828) +++ head/share/mk/bsd.compiler.mk Sat May 10 16:37:44 2014 (r265829) @@ -1,27 +1,46 @@ # $FreeBSD$ +# Setup variables for the compiler +# +# COMPILTER_TYPE is the major type of compiler. Currently gcc and clang support +# automatic detetion. Other compiler types can be shoe-horned in, but require explicit +# setting of the compiler type. The compiler type can also be set explicitly if, say, +# you install gcc as clang... +# +# COMPILER_VERSION is a numeric constant equal to major * 10000 + minor * 100 + tiny. It +# too can be overriden on the command line. When testing it, be sure to make sure that you +# are limiting the test to a specific compiler. Testing against 30300 for gcc likely isn't +# what you wanted (since versions of gcc prior to 4.2 likely have no prayer of working). +# +# COMPILER_FEATURES will contain one or more of the following, based on compiler support +# for that feature: c++11 (supports full (or nearly full) C++11 programming environment). +# +# This file may be included multiple times, but only has effect the first time. +# + .if !target(____) ____: +_v!= ${CC} --version .if !defined(COMPILER_TYPE) . if ${CC:T:Mgcc*} COMPILER_TYPE:= gcc . elif ${CC:T:Mclang} COMPILER_TYPE:= clang -. else -_COMPILER_VERSION!= ${CC} --version -. if ${_COMPILER_VERSION:Mgcc} +. elif ${_v:Mgcc} COMPILER_TYPE:= gcc -. elif ${_COMPILER_VERSION:M\(GCC\)} +. elif ${_v:M\(GCC\)} COMPILER_TYPE:= gcc -. elif ${_COMPILER_VERSION:Mclang} +. elif ${_v:Mclang} COMPILER_TYPE:= clang -. else +. else .error Unable to determine compiler type for ${CC}. Consider setting COMPILER_TYPE. -. endif -. undef _COMPILER_VERSION . endif .endif +.if !defined(COMPILER_VERSION) +COMPILER_VERSION!=echo ${_v:M[1-9].[0-9]*} | awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' +.endif +.undef _v .if ${COMPILER_TYPE} == "clang" COMPILER_FEATURES= c++11 Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sat May 10 16:37:39 2014 (r265828) +++ head/share/mk/bsd.sys.mk Sat May 10 16:37:44 2014 (r265829) @@ -64,7 +64,10 @@ CWARNFLAGS+= -Wno-pointer-sign # Clang has more warnings enabled by default, and when using -Wall, so if WARNS # is set to low values, these have to be disabled explicitly. .if ${WARNS} <= 6 -CWARNFLAGS.clang+= -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable +CWARNFLAGS.clang+= -Wno-empty-body -Wno-string-plus-int +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} > 30300 +CWARNFLAGS.clang+= -Wno-unused-const-variable +.endif .endif # WARNS <= 6 .if ${WARNS} <= 3 CWARNFLAGS.clang+= -Wno-tautological-compare -Wno-unused-value\ From owner-svn-src-head@FreeBSD.ORG Sat May 10 16:37:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A867B62; Sat, 10 May 2014 16:37:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07F00201; Sat, 10 May 2014 16:37:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AGbsRP006331; Sat, 10 May 2014 16:37:54 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AGbsEM006325; Sat, 10 May 2014 16:37:54 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405101637.s4AGbsEM006325@svn.freebsd.org> From: Warner Losh Date: Sat, 10 May 2014 16:37:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265830 - in head: . share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 16:37:55 -0000 Author: imp Date: Sat May 10 16:37:53 2014 New Revision: 265830 URL: http://svnweb.freebsd.org/changeset/base/265830 Log: Migrate NO_WARN to MK_WARN. Support legacy NO_WARN usage. Remove a check for EARLY_BUILD because it isn't necessary (MK_WARN=no will always be defined for that). Added: head/tools/build/options/WITHOUT_WARNS (contents, props changed) Modified: head/Makefile.inc1 head/share/mk/bsd.opts.mk head/share/mk/bsd.sys.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat May 10 16:37:44 2014 (r265829) +++ head/Makefile.inc1 Sat May 10 16:37:53 2014 (r265830) @@ -248,7 +248,7 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ SSP_CFLAGS= \ MK_HTML=no MK_INFO=no NO_LINT=yes MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ - -DNO_CPU_CFLAGS -DNO_WARNS MK_CTF=no -DEARLY_BUILD MK_TESTS=no + -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no -DEARLY_BUILD MK_TESTS=no # build-tools stage TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ @@ -258,7 +258,7 @@ TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ BOOTSTRAPPING=${OSRELDATE} \ SSP_CFLAGS= \ -DNO_LINT \ - -DNO_CPU_CFLAGS -DNO_WARNS MK_CTF=no -DEARLY_BUILD MK_TESTS=no + -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no -DEARLY_BUILD MK_TESTS=no # cross-tools stage XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ @@ -277,7 +277,7 @@ KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOB SSP_CFLAGS= \ MK_HTML=no MK_INFO=no -DNO_LINT MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ - -DNO_CPU_CFLAGS -DNO_WARNS MK_CTF=no -DEARLY_BUILD + -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no -DEARLY_BUILD # world stage WMAKEENV= ${CROSSENV} \ @@ -609,7 +609,7 @@ build32: WORLDTMP=${WORLDTMP} \ MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \ - DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS MK_CTF=no \ + DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ -DEARLY_BUILD build-tools .endfor cd ${.CURDIR}; \ @@ -1846,7 +1846,7 @@ XDEV_CPUTYPE?=${TARGET_CPUTYPE} NOFUN=-DNO_FSCHG MK_HTML=no MK_INFO=no -DNO_LINT \ MK_MAN=no MK_NLS=no MK_PROFILE=no \ - MK_KERBEROS=no MK_RESCUE=no MK_TESTS=no -DNO_WARNS \ + MK_KERBEROS=no MK_RESCUE=no MK_TESTS=no MK_WARNS=no \ TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \ CPUTYPE=${XDEV_CPUTYPE} Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Sat May 10 16:37:44 2014 (r265829) +++ head/share/mk/bsd.opts.mk Sat May 10 16:37:53 2014 (r265830) @@ -56,7 +56,8 @@ __DEFAULT_YES_OPTIONS = \ PROFILE \ SSP \ SYMVER \ - TOOLCHAIN + TOOLCHAIN \ + WARNS __DEFAULT_NO_OPTIONS = \ CTF \ @@ -76,7 +77,8 @@ __DEFAULT_NO_OPTIONS = \ DEBUG_FILES \ INSTALLLIB \ MAN \ - PROFILE + PROFILE \ + WARNS .if defined(NO_${var}) # This warning may be premature... #.warning "NO_${var} is defined, but deprecated. Please use MK_${var}=no instead." Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sat May 10 16:37:44 2014 (r265829) +++ head/share/mk/bsd.sys.mk Sat May 10 16:37:53 2014 (r265830) @@ -4,7 +4,7 @@ # sources. # Enable various levels of compiler warning checks. These may be -# overridden (e.g. if using a non-gcc compiler) by defining NO_WARNS. +# overridden (e.g. if using a non-gcc compiler) by defining MK_WARNS=no. # for GCC: http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Warning-Options.html @@ -134,9 +134,8 @@ CFLAGS+= ${SSP_CFLAGS} .endif # SSP && !IA64 && !ARM && !MIPS # Allow user-specified additional warning flags, plus compiler specific flag overrides. -# Unless we're early in the build, in which case don't (which is lame, this should -# be handled by NO_WARNS which needs to migrate to something else. -.if !defined(NO_WARNS) && !defined(EARLY_BUILD) +# Unless we've overriden this... +.if ${MK_WARNS} != "no" CFLAGS+= ${CWARNFLAGS} ${CWARNFLAGS.${COMPILER_TYPE}} .endif Added: head/tools/build/options/WITHOUT_WARNS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_WARNS Sat May 10 16:37:53 2014 (r265830) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set this to not add warning flags to the compiler invocations. +Useful as a temporary workaround when code enters the tree +which triggers warnings in environments that differ from the +original develoepr. From owner-svn-src-head@FreeBSD.ORG Sat May 10 16:38:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD35AC97; Sat, 10 May 2014 16:38:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5C1A204; Sat, 10 May 2014 16:38:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AGc4HU006450; Sat, 10 May 2014 16:38:04 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AGc3xI006434; Sat, 10 May 2014 16:38:03 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405101638.s4AGc3xI006434@svn.freebsd.org> From: Warner Losh Date: Sat, 10 May 2014 16:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265831 - in head: . lib/clang share/mk usr.bin/clang/clang X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 16:38:04 -0000 Author: imp Date: Sat May 10 16:38:03 2014 New Revision: 265831 URL: http://svnweb.freebsd.org/changeset/base/265831 Log: Eliminate EARLY_BUILD flag. It is redundant and means MK_CLANG_FULL=no and MK_LLDB=no, so set those explicitly (now that we can do that). Simplify tests for these variables as well, since we know they will always be defined regardless of the phase of the build. Modified: head/Makefile.inc1 head/lib/clang/Makefile head/lib/clang/clang.build.mk head/share/mk/bsd.prog.mk head/share/mk/bsd.sys.mk head/usr.bin/clang/clang/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat May 10 16:37:53 2014 (r265830) +++ head/Makefile.inc1 Sat May 10 16:38:03 2014 (r265831) @@ -248,7 +248,8 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ SSP_CFLAGS= \ MK_HTML=no MK_INFO=no NO_LINT=yes MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ - -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no -DEARLY_BUILD MK_TESTS=no + -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ + MK_CLANG_FULL=no MK_LLDB=no MK_TESTS=no # build-tools stage TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ @@ -258,7 +259,7 @@ TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ BOOTSTRAPPING=${OSRELDATE} \ SSP_CFLAGS= \ -DNO_LINT \ - -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no -DEARLY_BUILD MK_TESTS=no + -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no MK_CLANG_FULL=no MK_LLDB=no MK_TESTS=no # cross-tools stage XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ @@ -277,7 +278,7 @@ KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOB SSP_CFLAGS= \ MK_HTML=no MK_INFO=no -DNO_LINT MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ - -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no -DEARLY_BUILD + -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no # world stage WMAKEENV= ${CROSSENV} \ @@ -610,7 +611,7 @@ build32: MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \ DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ - -DEARLY_BUILD build-tools + build-tools .endfor cd ${.CURDIR}; \ ${LIB32WMAKE} -f Makefile.inc1 libraries Modified: head/lib/clang/Makefile ============================================================================== --- head/lib/clang/Makefile Sat May 10 16:37:53 2014 (r265830) +++ head/lib/clang/Makefile Sat May 10 16:38:03 2014 (r265831) @@ -3,8 +3,7 @@ .include .if !make(install) -.if !defined(EARLY_BUILD) -.if defined(MK_CLANG_FULL) && ${MK_CLANG_FULL} != "no" +.if ${MK_CLANG_FULL} != "no" _libclangstaticanalyzer= \ libclangstaticanalyzercheckers \ libclangstaticanalyzercore \ @@ -12,13 +11,11 @@ _libclangstaticanalyzer= \ _libclangarcmigrate= \ libclangarcmigrate .endif # MK_CLANG_FULL -.if (defined(MK_CLANG_FULL) && ${MK_CLANG_FULL} != "no") || \ - (defined(MK_LLDB) && ${MK_LLDB} != "no") +.if ${MK_CLANG_FULL} != "no" || ${MK_LLDB} != "no" _libclangrewriter= \ libclangrewritecore \ libclangrewritefrontend .endif # (MK_CLANG_FULL || MK_LLDB) -.endif # !EARLY_BUILD SUBDIR= libclanganalysis \ ${_libclangarcmigrate} \ @@ -105,7 +102,7 @@ SUBDIR+=libllvmexecutionengine \ libllvmruntimedyld .endif # MK_CLANG_EXTRAS | LLDB -.if !defined(EARLY_BUILD) && ${MK_LLDB} != "no" +.if ${MK_LLDB} != "no" SUBDIR+=liblldb \ \ liblldbAPI \ @@ -141,7 +138,7 @@ SUBDIR+=liblldb \ liblldbPluginSymbolVendorELF \ liblldbPluginUnwindAssemblyInstEmulation \ liblldbPluginUnwindAssemblyX86 -.endif # !EARLY_BUILD && MK_LLDB +.endif # MK_LLDB .endif # !make(install) Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Sat May 10 16:37:53 2014 (r265830) +++ head/lib/clang/clang.build.mk Sat May 10 16:38:03 2014 (r265831) @@ -10,11 +10,11 @@ CFLAGS+= -I${LLVM_SRCS}/include -I${CLAN -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \ -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG -.if !defined(EARLY_BUILD) && defined(MK_CLANG_FULL) && ${MK_CLANG_FULL} != "no" +.if ${MK_CLANG_FULL} != "no" CFLAGS+= -DCLANG_ENABLE_ARCMT \ -DCLANG_ENABLE_REWRITER \ -DCLANG_ENABLE_STATIC_ANALYZER -.endif # !EARLY_BUILD && MK_CLANG_FULL +.endif # MK_CLANG_FULL # LLVM is not strict aliasing safe as of 12/31/2011 CFLAGS+= -fno-strict-aliasing Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Sat May 10 16:37:53 2014 (r265830) +++ head/share/mk/bsd.prog.mk Sat May 10 16:38:03 2014 (r265831) @@ -173,7 +173,7 @@ _EXTRADEPEND: .endif .else echo ${PROG}: ${LIBC} ${DPADD} >> ${DEPENDFILE} -.if defined(PROG_CXX) && !defined(EARLY_BUILD) +.if defined(PROG_CXX) .if ${COMPILER_TYPE} == "clang" && empty(CXXFLAGS:M-stdlib=libstdc++) echo ${PROG}: ${LIBCPLUSPLUS} >> ${DEPENDFILE} .else Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sat May 10 16:37:53 2014 (r265830) +++ head/share/mk/bsd.sys.mk Sat May 10 16:38:03 2014 (r265831) @@ -139,12 +139,8 @@ CFLAGS+= ${SSP_CFLAGS} CFLAGS+= ${CWARNFLAGS} ${CWARNFLAGS.${COMPILER_TYPE}} .endif -# Not sure this is 100% kosher, but I think that EARLY_BUILD must be only -# defined when we're not building programs that use the CFLAGS.foo feature. -.if !defined(EARLY_BUILD) CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} CXXFLAGS+= ${CXXFLAGS.${COMPILER_TYPE}} -.endif # Tell bmake not to mistake standard targets for things to be searched for # or expect to ever be up-to-date. Modified: head/usr.bin/clang/clang/Makefile ============================================================================== --- head/usr.bin/clang/clang/Makefile Sat May 10 16:37:53 2014 (r265830) +++ head/usr.bin/clang/clang/Makefile Sat May 10 16:38:03 2014 (r265831) @@ -36,7 +36,7 @@ TGHDRS= CC1AsOptions \ DiagnosticSemaKinds \ Options -.if !defined(EARLY_BUILD) && defined(MK_CLANG_FULL) && ${MK_CLANG_FULL} != "no" +.if ${MK_CLANG_FULL} != "no" _clangstaticanalyzer= \ clangstaticanalyzerfrontend \ clangstaticanalyzercheckers \ @@ -46,7 +46,7 @@ _clangarcmigrate= \ _clangrewriter= \ clangrewritefrontend \ clangrewritecore -.endif # !EARLY_BUILD && MK_CLANG_FULL +.endif # MK_CLANG_FULL LIBDEPS=clangfrontendtool \ clangfrontend \ From owner-svn-src-head@FreeBSD.ORG Sat May 10 16:38:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9DCDDCF; Sat, 10 May 2014 16:38:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAE75207; Sat, 10 May 2014 16:38:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AGcAC2006529; Sat, 10 May 2014 16:38:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AGc9Xk006523; Sat, 10 May 2014 16:38:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405101638.s4AGc9Xk006523@svn.freebsd.org> From: Warner Losh Date: Sat, 10 May 2014 16:38:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265832 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 16:38:10 -0000 Author: imp Date: Sat May 10 16:38:09 2014 New Revision: 265832 URL: http://svnweb.freebsd.org/changeset/base/265832 Log: Simplify clang ifdefs in the kernel a bit. Introduce CFLAGS.${COMPILER_TYPE} to mirror userland. Be explicit about which compiler needs something (not clang isn't necessarily gcc in the future). Modified: head/sys/conf/Makefile.arm head/sys/conf/kern.mk head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Sat May 10 16:38:03 2014 (r265831) +++ head/sys/conf/Makefile.arm Sat May 10 16:38:09 2014 (r265832) @@ -39,20 +39,17 @@ SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/ldscri STRIP_FLAGS = -S .endif -.if ${COMPILER_TYPE} != "clang" -CFLAGS += -mno-thumb-interwork -.endif +# We don't support gcc's thump interwork stuff, so disable it +CFLAGS.gcc += -mno-thumb-interwork .if empty(DDB_ENABLED) -.if ${MK_ARM_EABI} == "no" && ${COMPILER_TYPE} == "gcc" -CFLAGS += -mno-apcs-frame +.if ${MK_ARM_EABI} == "no" +CFLAGS.gcc += -mno-apcs-frame .endif .elif ${MK_ARM_EABI} != "no" CFLAGS += -funwind-tables -.if ${COMPILER_TYPE} == "clang" # clang requires us to tell it to emit assembly with unwind information -CFLAGS += -mllvm -arm-enable-ehabi -.endif +CFLAGS.clang += -mllvm -arm-enable-ehabi .endif # hack because genassym.c includes sys/bus.h which includes these. Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sat May 10 16:38:03 2014 (r265831) +++ head/sys/conf/kern.mk Sat May 10 16:38:09 2014 (r265832) @@ -64,11 +64,8 @@ FORMAT_EXTENSIONS= -fformat-extensions # Setting -mno-sse implies -mno-sse2, -mno-sse3, -mno-ssse3, -mno-sse41 and -mno-sse42 # .if ${MACHINE_CPUARCH} == "i386" -.if ${COMPILER_TYPE} != "clang" -CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 -.else -CFLAGS+= -mno-aes -mno-avx -.endif +CFLAGS.gcc+= -mno-align-long-strings -mpreferred-stack-boundary=2 +CFLAGS.clang+= -mno-aes -mno-avx CFLAGS+= -mno-mmx -mno-sse -msoft-float INLINE_LIMIT?= 8000 .endif @@ -93,11 +90,8 @@ INLINE_LIMIT?= 15000 # operations which it has a tendency to do. # .if ${MACHINE_CPUARCH} == "sparc64" -.if ${COMPILER_TYPE} == "clang" -CFLAGS+= -mcmodel=large -fno-dwarf2-cfi-asm -.else -CFLAGS+= -mcmodel=medany -msoft-float -.endif +CFLAGS.clang+= -mcmodel=large -fno-dwarf2-cfi-asm +CFLAGS.gcc+= -mcmodel=medany -msoft-float INLINE_LIMIT?= 15000 .endif @@ -116,9 +110,7 @@ INLINE_LIMIT?= 15000 # (-mfpmath= is not supported) # .if ${MACHINE_CPUARCH} == "amd64" -.if ${COMPILER_TYPE} == "clang" -CFLAGS+= -mno-aes -mno-avx -.endif +CFLAGS.clang+= -mno-aes -mno-avx CFLAGS+= -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float \ -fno-asynchronous-unwind-tables INLINE_LIMIT?= 8000 @@ -173,3 +165,5 @@ CFLAGS+= -fstack-protector .if ${CFLAGS:M-g} != "" && ${CFLAGS:M-gdwarf*} == "" CFLAGS+= -gdwarf-2 .endif + +CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Sat May 10 16:38:03 2014 (r265831) +++ head/sys/conf/kern.pre.mk Sat May 10 16:38:09 2014 (r265832) @@ -37,10 +37,10 @@ _MINUS_O= -O2 .endif .endif .if ${MACHINE_CPUARCH} == "amd64" -.if ${COMPILER_TYPE} != "clang" -COPTFLAGS?=-O2 -frename-registers -pipe -.else +.if ${COMPILER_TYPE} == "clang" COPTFLAGS?=-O2 -pipe +.else +COPTFLAGS?=-O2 -frename-registers -pipe .endif .else COPTFLAGS?=${_MINUS_O} -pipe @@ -86,13 +86,11 @@ CFLAGS_PARAM_LARGE_FUNCTION_GROWTH?=1000 .if ${MACHINE_CPUARCH} == "mips" CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 .endif -.if ${COMPILER_TYPE} != "clang" -CFLAGS+= -fno-common -finline-limit=${INLINE_LIMIT} -CFLAGS+= --param inline-unit-growth=${CFLAGS_PARAM_INLINE_UNIT_GROWTH} -CFLAGS+= --param large-function-growth=${CFLAGS_PARAM_LARGE_FUNCTION_GROWTH} +CFLAGS.gcc+= -fno-common -finline-limit=${INLINE_LIMIT} +CFLAGS.gcc+= --param inline-unit-growth=${CFLAGS_PARAM_INLINE_UNIT_GROWTH} +CFLAGS.gcc+= --param large-function-growth=${CFLAGS_PARAM_LARGE_FUNCTION_GROWTH} .if defined(CFLAGS_ARCH_PARAMS) -CFLAGS+=${CFLAGS_ARCH_PARAMS} -.endif +CFLAGS.gcc+=${CFLAGS_ARCH_PARAMS} .endif WERROR?= -Werror @@ -107,13 +105,11 @@ GCC_MS_EXTENSIONS= -fms-extensions .if defined(PROFLEVEL) && ${PROFLEVEL} >= 1 CFLAGS+= -DGPROF -.if ${COMPILER_TYPE} != "clang" -CFLAGS+= -falign-functions=16 -.endif +CFLAGS.gcc+= -falign-functions=16 .if ${PROFLEVEL} >= 2 CFLAGS+= -DGPROF4 -DGUPROF PROF= -pg -.if ${COMPILER_TYPE} != "clang" +.if ${COMPILER_TYPE} == "gcc" PROF+= -mprofiler-epilogue .endif .else Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Sat May 10 16:38:03 2014 (r265831) +++ head/sys/conf/kmod.mk Sat May 10 16:38:09 2014 (r265832) @@ -116,11 +116,9 @@ CFLAGS+= -I. -I@ # for example. CFLAGS+= -I@/contrib/altq -.if ${COMPILER_TYPE} != "clang" -CFLAGS+= -finline-limit=${INLINE_LIMIT} -CFLAGS+= --param inline-unit-growth=100 -CFLAGS+= --param large-function-growth=1000 -.endif +CFLAGS.gcc+= -finline-limit=${INLINE_LIMIT} +CFLAGS.gcc+= --param inline-unit-growth=100 +CFLAGS.gcc+= --param large-function-growth=1000 # Disallow common variables, and if we end up with commons from # somewhere unexpected, allocate storage for them in the module itself. From owner-svn-src-head@FreeBSD.ORG Sat May 10 16:38:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C54AF09; Sat, 10 May 2014 16:38:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29CCE20B; Sat, 10 May 2014 16:38:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AGcJv2006623; Sat, 10 May 2014 16:38:19 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AGcIbI006620; Sat, 10 May 2014 16:38:18 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405101638.s4AGcIbI006620@svn.freebsd.org> From: Warner Losh Date: Sat, 10 May 2014 16:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265833 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 16:38:19 -0000 Author: imp Date: Sat May 10 16:38:18 2014 New Revision: 265833 URL: http://svnweb.freebsd.org/changeset/base/265833 Log: Remove the compatibility hack for FreeBSD 7 systems for MACHINE_CPUARCH. Fewer places to have to hack each time a new one is added. Modified: head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Sat May 10 16:38:09 2014 (r265832) +++ head/sys/conf/kern.pre.mk Sat May 10 16:38:18 2014 (r265833) @@ -7,9 +7,6 @@ .include .include "kern.opts.mk" -# backwards compat option for older systems. -MACHINE_CPUARCH?=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} - # Can be overridden by makeoptions or /etc/make.conf KERNEL_KO?= kernel KERNEL?= kernel Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Sat May 10 16:38:09 2014 (r265832) +++ head/sys/conf/kmod.mk Sat May 10 16:38:18 2014 (r265833) @@ -60,9 +60,6 @@ # Unload a module. # -# backwards compat option for older systems. -MACHINE_CPUARCH?=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} - AWK?= awk KMODLOAD?= /sbin/kldload KMODUNLOAD?= /sbin/kldunload From owner-svn-src-head@FreeBSD.ORG Sat May 10 16:38:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66679D2; Sat, 10 May 2014 16:38:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53C3A20F; Sat, 10 May 2014 16:38:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AGcSgQ006720; Sat, 10 May 2014 16:38:28 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AGcRcP006715; Sat, 10 May 2014 16:38:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405101638.s4AGcRcP006715@svn.freebsd.org> From: Warner Losh Date: Sat, 10 May 2014 16:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265834 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 16:38:28 -0000 Author: imp Date: Sat May 10 16:38:27 2014 New Revision: 265834 URL: http://svnweb.freebsd.org/changeset/base/265834 Log: g/c unmaintained, uninstalled bsd.pkg.mk. It tied into the ports system, as it existed 9 years ago, and has been obsolete for a long time. Deleted: head/share/mk/bsd.pkg.mk Modified: head/share/mk/bsd.prog.mk head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Sat May 10 16:38:18 2014 (r265833) +++ head/share/mk/bsd.prog.mk Sat May 10 16:38:27 2014 (r265834) @@ -276,7 +276,3 @@ ${OBJS}: ${SRCS:M*.h} .include .include - -.if defined(PORTNAME) -.include -.endif Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sat May 10 16:38:18 2014 (r265833) +++ head/share/mk/bsd.sys.mk Sat May 10 16:38:27 2014 (r265834) @@ -147,15 +147,11 @@ CXXFLAGS+= ${CXXFLAGS.${COMPILER_TYPE}} PHONY_NOTMAIN = afterdepend afterinstall all beforedepend beforeinstall \ beforelinking build build-tools buildfiles buildincludes \ checkdpadd clean cleandepend cleandir cleanobj configure \ - depend dependall distclean distribute exe extract \ + depend dependall distclean distribute exe \ html includes install installfiles installincludes lint \ obj objlink objs objwarn realall realdepend \ realinstall regress subdir-all subdir-depend subdir-install \ tags whereobj -.if defined(PORTNAME) -PHONY_NOTMAIN+= fetch patch -.endif - .PHONY: ${PHONY_NOTMAIN} .NOTMAIN: ${PHONY_NOTMAIN} From owner-svn-src-head@FreeBSD.ORG Sat May 10 16:38:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C44B206; Sat, 10 May 2014 16:38:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A7AD211; Sat, 10 May 2014 16:38:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AGcWt8006785; Sat, 10 May 2014 16:38:32 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AGcW77006784; Sat, 10 May 2014 16:38:32 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405101638.s4AGcW77006784@svn.freebsd.org> From: Warner Losh Date: Sat, 10 May 2014 16:38:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265835 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 16:38:33 -0000 Author: imp Date: Sat May 10 16:38:32 2014 New Revision: 265835 URL: http://svnweb.freebsd.org/changeset/base/265835 Log: Remove some useless, commented out code. Remove name space polution in the POSIX case by moving more things under !Posix part of an if. Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Sat May 10 16:38:27 2014 (r265834) +++ head/share/mk/sys.mk Sat May 10 16:38:32 2014 (r265835) @@ -74,10 +74,6 @@ CTFMERGE ?= ctfmerge DTRACE ?= dtrace .if defined(CFLAGS) && (${CFLAGS:M-g} != "") CTFFLAGS += -g -.else -# XXX: What to do here? Is removing the CFLAGS part completely ok here? -# For now comment it out to not compile with -g unconditionally. -#CFLAGS += -g .endif CXX ?= c++ @@ -338,11 +334,7 @@ SHELL= ${__MAKE_SHELL} # Toggle on warnings .WARN: dirsyntax -.endif - -.endif - -.if defined(.PARSEDIR) +.else # is bmake # Tell bmake to expand -V VAR by default .MAKE.EXPAND_VARIABLES= yes @@ -359,7 +351,8 @@ SHELL= ${__MAKE_SHELL} echoFlag=v errFlag=e \ path=${__MAKE_SHELL:U/bin/sh} .endif - -.endif +.endif # bmake .include + +.endif # ! Posix From owner-svn-src-head@FreeBSD.ORG Sat May 10 16:38:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11246341; Sat, 10 May 2014 16:38:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2E79213; Sat, 10 May 2014 16:38:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AGcbCb006852; Sat, 10 May 2014 16:38:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AGcbB4006850; Sat, 10 May 2014 16:38:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405101638.s4AGcbB4006850@svn.freebsd.org> From: Warner Losh Date: Sat, 10 May 2014 16:38:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265836 - in head: share/mk tests/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 16:38:38 -0000 Author: imp Date: Sat May 10 16:38:37 2014 New Revision: 265836 URL: http://svnweb.freebsd.org/changeset/base/265836 Log: Remove last two NO_MAN= in the tree. In both of these cases, MAN= is what is needed. Modified: head/share/mk/bsd.test.mk head/tests/sys/netinet/Makefile Modified: head/share/mk/bsd.test.mk ============================================================================== --- head/share/mk/bsd.test.mk Sat May 10 16:38:32 2014 (r265835) +++ head/share/mk/bsd.test.mk Sat May 10 16:38:37 2014 (r265836) @@ -51,8 +51,7 @@ SUBDIR+= ${TESTS_SUBDIRS} # it is rare for test cases to have man pages .if !defined(MAN) -NO_MAN=yes -.export NO_MAN +MAN= .endif # tell progs.mk we might want to install things Modified: head/tests/sys/netinet/Makefile ============================================================================== --- head/tests/sys/netinet/Makefile Sat May 10 16:38:32 2014 (r265835) +++ head/tests/sys/netinet/Makefile Sat May 10 16:38:37 2014 (r265836) @@ -6,7 +6,7 @@ BINDIR= ${TESTSDIR} ATF_TESTS_SH+= fibs_test PROG= udp_dontroute SRCS= udp_dontroute.c -NO_MAN= +MAN= WARNS?= 6 .include From owner-svn-src-head@FreeBSD.ORG Sat May 10 16:38:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47AF4478; Sat, 10 May 2014 16:38:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35721216; Sat, 10 May 2014 16:38:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AGckdv006947; Sat, 10 May 2014 16:38:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AGckAJ006946; Sat, 10 May 2014 16:38:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405101638.s4AGckAJ006946@svn.freebsd.org> From: Warner Losh Date: Sat, 10 May 2014 16:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265837 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 16:38:46 -0000 Author: imp Date: Sat May 10 16:38:45 2014 New Revision: 265837 URL: http://svnweb.freebsd.org/changeset/base/265837 Log: We haven't done anything with _UPGRADING in ~forever (was present, but not needed, in FreeBSD 6.x, and has been absent in newer versions). This was needed to upgrade from 3.x -> 4.x, once upon a time. Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sat May 10 16:38:37 2014 (r265836) +++ head/Makefile Sat May 10 16:38:45 2014 (r265837) @@ -327,7 +327,7 @@ MMAKEENV= MAKEOBJDIRPREFIX=${MYMAKE:H} \ DESTDIR= \ INSTALL="sh ${.CURDIR}/tools/install.sh" MMAKE= ${MMAKEENV} ${MAKE} \ - -D_UPGRADING -DNO_MAN -DNO_SHARED \ + -DNO_MAN -DNO_SHARED \ -DNO_CPU_CFLAGS -DNO_WERROR \ DESTDIR= PROGNAME=${MYMAKE:T} From owner-svn-src-head@FreeBSD.ORG Sat May 10 16:38:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C76125B7; Sat, 10 May 2014 16:38:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A871921A; Sat, 10 May 2014 16:38:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AGctY6007023; Sat, 10 May 2014 16:38:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AGcsVX007017; Sat, 10 May 2014 16:38:54 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405101638.s4AGcsVX007017@svn.freebsd.org> From: Warner Losh Date: Sat, 10 May 2014 16:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265838 - in head: share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 16:38:56 -0000 Author: imp Date: Sat May 10 16:38:54 2014 New Revision: 265838 URL: http://svnweb.freebsd.org/changeset/base/265838 Log: Move DOCCOMPRESS to MK variable. Added: head/tools/build/options/WITHOUT_DOCCOMPRESS (contents, props changed) head/tools/build/options/WITHOUT_MANCOMPRESS (contents, props changed) Modified: head/share/mk/bsd.doc.mk head/share/mk/bsd.opts.mk Modified: head/share/mk/bsd.doc.mk ============================================================================== --- head/share/mk/bsd.doc.mk Sat May 10 16:38:45 2014 (r265837) +++ head/share/mk/bsd.doc.mk Sat May 10 16:38:54 2014 (r265838) @@ -19,7 +19,7 @@ # # MACROS Macro packages used to build the document. [not set] # -# NO_DOCCOMPRESS If you do not want formatted troff documents to be +# WITHOUT_DOCCOMPRESS If you do not want formatted troff documents to be # compressed when they are installed. [not set] # # PRINTERDEVICE Indicates which output formats will be generated @@ -87,7 +87,7 @@ DCOMPRESS_CMD?= ${COMPRESS_CMD} DFILE.html= ${DOC}.html .endfor .for _dev in ${PRINTERDEVICE:Nhtml} -.if defined(NO_DOCCOMPRESS) +.if ${MK_DOCCOMPRESS} == "no" DFILE.${_dev}= ${DOC}.${_dev} .else DFILE.${_dev}= ${DOC}.${_dev}${DCOMPRESS_EXT} @@ -117,7 +117,7 @@ print: ${DFILE.${_dev}} .endfor print: .for _dev in ${PRINTERDEVICE} -.if defined(NO_DOCCOMPRESS) +.if ${MK_DOCCOMPRESS} == "no" ${LPR} ${DFILE.${_dev}} .else ${DCOMPRESS_CMD} -d ${DFILE.${_dev}} | ${LPR} @@ -164,7 +164,7 @@ CLEANFILES+= _stamp.extra ${DFILE.${_dev}}: _stamp.extra .endif ${DFILE.${_dev}}: ${SRCS} -.if defined(NO_DOCCOMPRESS) +.if ${MK_DOCCOMPRESS} == "no" ${ROFF.${_dev}} ${.ALLSRC:N_stamp.extra} > ${.TARGET} .else ${ROFF.${_dev}} ${.ALLSRC:N_stamp.extra} | ${DCOMPRESS_CMD} > ${.TARGET} Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Sat May 10 16:38:45 2014 (r265837) +++ head/share/mk/bsd.opts.mk Sat May 10 16:38:54 2014 (r265838) @@ -45,6 +45,7 @@ ____: __DEFAULT_YES_OPTIONS = \ ASSERT_DEBUG \ + DOCCOMPRESS \ INFO \ INSTALLLIB \ KERBEROS \ Added: head/tools/build/options/WITHOUT_DOCCOMPRESS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_DOCCOMPRESS Sat May 10 16:38:54 2014 (r265838) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not to install compressed system documentation. +Only the uncompressed version will be installed. + Added: head/tools/build/options/WITHOUT_MANCOMPRESS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_MANCOMPRESS Sat May 10 16:38:54 2014 (r265838) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to not to install compressed man pages. +Only the uncompressed versions will be installed. + + From owner-svn-src-head@FreeBSD.ORG Sat May 10 16:39:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABDCB6E8; Sat, 10 May 2014 16:39:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 920DB21C; Sat, 10 May 2014 16:39:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AGd0qa007102; Sat, 10 May 2014 16:39:00 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AGd0bc007101; Sat, 10 May 2014 16:39:00 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405101639.s4AGd0bc007101@svn.freebsd.org> From: Warner Losh Date: Sat, 10 May 2014 16:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265839 - head/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 16:39:00 -0000 Author: imp Date: Sat May 10 16:39:00 2014 New Revision: 265839 URL: http://svnweb.freebsd.org/changeset/base/265839 Log: Sprinkle a few more .WAITs into the mix after csu, libc, msun and the early built libraries. This should be sufficient for most cases and has eliminated the issues I've seen with high -j builds. Races likely still remain, but this knocks the problem down a notch. Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sat May 10 16:38:54 2014 (r265838) +++ head/lib/Makefile Sat May 10 16:39:00 2014 (r265839) @@ -31,8 +31,12 @@ # Except it appears bind needs to be compiled last SUBDIR_ORDERED= ${_csu} \ + .WAIT \ libc \ libc_nonshared \ + .WAIT \ + msun \ + .WAIT \ libbsm \ libauditd \ libutil \ @@ -45,7 +49,6 @@ SUBDIR_ORDERED= ${_csu} \ ${_libiconv_modules} \ libkvm \ ${_libldns} \ - msun \ libmd \ ncurses \ ${_libnetgraph} \ @@ -62,6 +65,7 @@ SUBDIR_ORDERED+= libcom_err .endif SUBDIR= ${SUBDIR_ORDERED} \ + .WAIT \ libalias \ libarchive \ ${_libatm} \ From owner-svn-src-head@FreeBSD.ORG Sat May 10 16:39:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA018825; Sat, 10 May 2014 16:39:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5DA6220; Sat, 10 May 2014 16:39:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AGd8HC007191; Sat, 10 May 2014 16:39:08 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AGd8EZ007190; Sat, 10 May 2014 16:39:08 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405101639.s4AGd8EZ007190@svn.freebsd.org> From: Warner Losh Date: Sat, 10 May 2014 16:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265840 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 16:39:09 -0000 Author: imp Date: Sat May 10 16:39:08 2014 New Revision: 265840 URL: http://svnweb.freebsd.org/changeset/base/265840 Log: grep -L returns non-zero status if none of the files had the pattern in them. This is often the case, so just ignore the return code. Actual errors that are found will also be detected downstream in the rare cases where the return code is 2 instead of 1. Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sat May 10 16:39:00 2014 (r265839) +++ head/Makefile Sat May 10 16:39:08 2014 (r265840) @@ -450,7 +450,7 @@ TARGET!= uname -m .if defined(MAKE_ALL_KERNELS) _THINNER=cat .else -_THINNER=xargs grep -L "^.NO_UNIVERSE" +_THINNER=xargs grep -L "^.NO_UNIVERSE" || true .endif KERNCONFS!= cd ${KERNSRCDIR}/${TARGET}/conf && \ find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ From owner-svn-src-head@FreeBSD.ORG Sat May 10 16:39:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0B73972; Sat, 10 May 2014 16:39:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E179224; Sat, 10 May 2014 16:39:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AGdGcw007279; Sat, 10 May 2014 16:39:16 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AGdGRl007277; Sat, 10 May 2014 16:39:16 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405101639.s4AGdGRl007277@svn.freebsd.org> From: Warner Losh Date: Sat, 10 May 2014 16:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265841 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 16:39:16 -0000 Author: imp Date: Sat May 10 16:39:15 2014 New Revision: 265841 URL: http://svnweb.freebsd.org/changeset/base/265841 Log: bitrotted compat cruft removal: o KMODDEPS warning is 15 years stale. Remove it. o MK_CTF will always be defined now, so no need to test to see if it is defined. o no need to define MK_FORMAT_EXTENTIONS if undefined anymore. Modified: head/sys/conf/kern.mk head/sys/conf/kmod.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sat May 10 16:39:08 2014 (r265840) +++ head/sys/conf/kern.mk Sat May 10 16:39:15 2014 (r265841) @@ -1,8 +1,5 @@ # $FreeBSD$ -# Compat -MK_FORMAT_EXTENSIONS?=no - # # Warning flags for compiling the kernel and components of the kernel: # Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Sat May 10 16:39:08 2014 (r265840) +++ head/sys/conf/kmod.mk Sat May 10 16:39:15 2014 (r265841) @@ -65,10 +65,6 @@ KMODLOAD?= /sbin/kldload KMODUNLOAD?= /sbin/kldunload OBJCOPY?= objcopy -.if defined(KMODDEPS) -.error "Do not use KMODDEPS on 5.0+; use MODULE_VERSION/MODULE_DEPEND" -.endif - # Note: we're really bsd.kmod.mk, so we have to allow src.opts.mk to be # optional. Include it if we can so we can get /etc/src.conf changes, # if we're in the tree. If we can't include it that's OK. kern.opts.mk @@ -204,7 +200,7 @@ ${KMOD}.kld: ${OBJS} ${FULLPROG}: ${OBJS} .endif ${LD} ${LDFLAGS} -r -d -o ${.TARGET} ${OBJS} -.if defined(MK_CTF) && ${MK_CTF} != "no" +.if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} .endif .if defined(EXPORT_SYMS) From owner-svn-src-head@FreeBSD.ORG Sat May 10 16:59:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37225F0B; Sat, 10 May 2014 16:59:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B1A53C7; Sat, 10 May 2014 16:59:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AGxFtf024754; Sat, 10 May 2014 16:59:15 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AGxFcF024753; Sat, 10 May 2014 16:59:15 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201405101659.s4AGxFcF024753@svn.freebsd.org> From: Eitan Adler Date: Sat, 10 May 2014 16:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265842 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 16:59:16 -0000 Author: eadler Date: Sat May 10 16:59:15 2014 New Revision: 265842 URL: http://svnweb.freebsd.org/changeset/base/265842 Log: arcconfig: add one Add a .arcconfig to allow arc to work in its usual way. Added: head/.arcconfig (contents, props changed) Added: head/.arcconfig ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/.arcconfig Sat May 10 16:59:15 2014 (r265842) @@ -0,0 +1,3 @@ +{ + "phabricator.uri" : "https://phabric.freebsd.org/" +} From owner-svn-src-head@FreeBSD.ORG Sat May 10 17:03:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 971D4122; Sat, 10 May 2014 17:03:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 843B464A; Sat, 10 May 2014 17:03:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AH3XPX028569; Sat, 10 May 2014 17:03:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AH3Xi9028568; Sat, 10 May 2014 17:03:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405101703.s4AH3Xi9028568@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 10 May 2014 17:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265843 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 17:03:33 -0000 Author: kib Date: Sat May 10 17:03:33 2014 New Revision: 265843 URL: http://svnweb.freebsd.org/changeset/base/265843 Log: For the upgrade case in vm_fault_copy_entry(), when the entry does not need COW and is writeable (i.e. becoming writeable due to the mprotect(2) operation), do not create a new backing object for the entry. The caller of the function is vm_map_protect(), the call is made to ensure that wired entry has all pages resident and wired in the top level object and to enable the write. We might need to copy read-only page from some backing objects into the top object or remap the page with the write allowed. This fixes the issue with mishandling of the swap accounting when read-only wired mapping is upgraded to write-enabled after fork. The previous code path did not accounted the new object, but it creation is redundand anyway and the change provides an optimization for the non-common situation. Reported by: markj Suggested and reviewed by: alc (previous version) Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sat May 10 16:59:15 2014 (r265842) +++ head/sys/vm/vm_fault.c Sat May 10 17:03:33 2014 (r265843) @@ -1247,38 +1247,48 @@ vm_fault_copy_entry(vm_map_t dst_map, vm #endif /* lint */ upgrade = src_entry == dst_entry; + access = prot = dst_entry->protection; src_object = src_entry->object.vm_object; src_pindex = OFF_TO_IDX(src_entry->offset); - /* - * Create the top-level object for the destination entry. (Doesn't - * actually shadow anything - we copy the pages directly.) - */ - dst_object = vm_object_allocate(OBJT_DEFAULT, - OFF_TO_IDX(dst_entry->end - dst_entry->start)); + if (upgrade && (dst_entry->eflags & MAP_ENTRY_NEEDS_COPY) == 0) { + dst_object = src_object; + vm_object_reference(dst_object); + } else { + /* + * Create the top-level object for the destination entry. (Doesn't + * actually shadow anything - we copy the pages directly.) + */ + dst_object = vm_object_allocate(OBJT_DEFAULT, + OFF_TO_IDX(dst_entry->end - dst_entry->start)); #if VM_NRESERVLEVEL > 0 - dst_object->flags |= OBJ_COLORED; - dst_object->pg_color = atop(dst_entry->start); + dst_object->flags |= OBJ_COLORED; + dst_object->pg_color = atop(dst_entry->start); #endif + } VM_OBJECT_WLOCK(dst_object); KASSERT(upgrade || dst_entry->object.vm_object == NULL, ("vm_fault_copy_entry: vm_object not NULL")); - dst_entry->object.vm_object = dst_object; - dst_entry->offset = 0; - dst_object->charge = dst_entry->end - dst_entry->start; + if (src_object != dst_object) { + dst_entry->object.vm_object = dst_object; + dst_entry->offset = 0; + dst_object->charge = dst_entry->end - dst_entry->start; + } if (fork_charge != NULL) { KASSERT(dst_entry->cred == NULL, ("vm_fault_copy_entry: leaked swp charge")); dst_object->cred = curthread->td_ucred; crhold(dst_object->cred); *fork_charge += dst_object->charge; - } else { + } else if (dst_object->cred == NULL) { + KASSERT(dst_entry->cred != NULL, ("no cred for entry %p", + dst_entry)); dst_object->cred = dst_entry->cred; dst_entry->cred = NULL; } - access = prot = dst_entry->protection; + /* * If not an upgrade, then enter the mappings in the pmap as * read and/or execute accesses. Otherwise, enter them as @@ -1304,26 +1314,14 @@ vm_fault_copy_entry(vm_map_t dst_map, vm for (vaddr = dst_entry->start, dst_pindex = 0; vaddr < dst_entry->end; vaddr += PAGE_SIZE, dst_pindex++) { - - /* - * Allocate a page in the destination object. - */ - do { - dst_m = vm_page_alloc(dst_object, dst_pindex, - VM_ALLOC_NORMAL); - if (dst_m == NULL) { - VM_OBJECT_WUNLOCK(dst_object); - VM_WAIT; - VM_OBJECT_WLOCK(dst_object); - } - } while (dst_m == NULL); - +again: /* * Find the page in the source object, and copy it in. * Because the source is wired down, the page will be * in memory. */ - VM_OBJECT_RLOCK(src_object); + if (src_object != dst_object) + VM_OBJECT_RLOCK(src_object); object = src_object; pindex = src_pindex + dst_pindex; while ((src_m = vm_page_lookup(object, pindex)) == NULL && @@ -1343,14 +1341,39 @@ vm_fault_copy_entry(vm_map_t dst_map, vm VM_OBJECT_RLOCK(backing_object); pindex += OFF_TO_IDX(object->backing_object_offset); - VM_OBJECT_RUNLOCK(object); + if (object != dst_object) + VM_OBJECT_RUNLOCK(object); object = backing_object; } KASSERT(src_m != NULL, ("vm_fault_copy_entry: page missing")); - pmap_copy_page(src_m, dst_m); - VM_OBJECT_RUNLOCK(object); - dst_m->valid = VM_PAGE_BITS_ALL; - dst_m->dirty = VM_PAGE_BITS_ALL; + + if (object != dst_object) { + /* + * Allocate a page in the destination object. + */ + do { + dst_m = vm_page_alloc(dst_object, + (src_object == dst_object ? src_pindex : + 0) + dst_pindex, VM_ALLOC_NORMAL); + if (dst_m == NULL) { + VM_OBJECT_WUNLOCK(dst_object); + VM_OBJECT_RUNLOCK(object); + VM_WAIT; + goto again; + } + } while (dst_m == NULL); + pmap_copy_page(src_m, dst_m); + VM_OBJECT_RUNLOCK(object); + dst_m->valid = VM_PAGE_BITS_ALL; + dst_m->dirty = VM_PAGE_BITS_ALL; + } else { + dst_m = src_m; + if (vm_page_sleep_if_busy(dst_m, "fltupg")) + goto again; + vm_page_xbusy(dst_m); + KASSERT(dst_m->valid == VM_PAGE_BITS_ALL, + ("invalid dst page %p", dst_m)); + } VM_OBJECT_WUNLOCK(dst_object); /* @@ -1366,13 +1389,17 @@ vm_fault_copy_entry(vm_map_t dst_map, vm VM_OBJECT_WLOCK(dst_object); if (upgrade) { - vm_page_lock(src_m); - vm_page_unwire(src_m, 0); - vm_page_unlock(src_m); - - vm_page_lock(dst_m); - vm_page_wire(dst_m); - vm_page_unlock(dst_m); + if (src_m != dst_m) { + vm_page_lock(src_m); + vm_page_unwire(src_m, 0); + vm_page_unlock(src_m); + vm_page_lock(dst_m); + vm_page_wire(dst_m); + vm_page_unlock(dst_m); + } else { + KASSERT(dst_m->wire_count > 0, + ("dst_m %p is not wired", dst_m)); + } } else { vm_page_lock(dst_m); vm_page_activate(dst_m); From owner-svn-src-head@FreeBSD.ORG Sat May 10 17:42:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FC58EFB; Sat, 10 May 2014 17:42:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 348D295E; Sat, 10 May 2014 17:42:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AHgMd5046805; Sat, 10 May 2014 17:42:22 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AHgL9g046801; Sat, 10 May 2014 17:42:21 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201405101742.s4AHgL9g046801@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 10 May 2014 17:42:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265844 - in head/bin/sh: . tests/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 17:42:22 -0000 Author: jilles Date: Sat May 10 17:42:21 2014 New Revision: 265844 URL: http://svnweb.freebsd.org/changeset/base/265844 Log: sh: Don't discard getopts state on unknown option or missing argument. When getopts finds an invalid option or a missing option-argument, it should not reset its state and should set OPTIND as normal. This is an old ash bug that was fixed long ago in dash. Our behaviour now matches most other shells. Added: head/bin/sh/tests/builtins/getopts6.0 (contents, props changed) head/bin/sh/tests/builtins/getopts7.0 (contents, props changed) Modified: head/bin/sh/options.c Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Sat May 10 17:03:33 2014 (r265843) +++ head/bin/sh/options.c Sat May 10 17:42:21 2014 (r265844) @@ -480,7 +480,7 @@ atend: INTON; } c = '?'; - goto bad; + goto out; } if (*++q == ':') q++; @@ -501,7 +501,7 @@ atend: INTON; c = '?'; } - goto bad; + goto out; } if (p == **optnext) @@ -511,14 +511,10 @@ atend: } else setvarsafe("OPTARG", "", 0); - ind = *optnext - optfirst + 1; - goto out; -bad: - ind = 1; - *optnext = NULL; - p = NULL; out: + if (*optnext != NULL) + ind = *optnext - optfirst + 1; *optptr = p; fmtstr(s, sizeof(s), "%d", ind); err |= setvarsafe("OPTIND", s, VNOFUNC); Added: head/bin/sh/tests/builtins/getopts6.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/getopts6.0 Sat May 10 17:42:21 2014 (r265844) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +set -- -x -y +getopts :x var || echo "First getopts bad: $?" +getopts :x var +r=$? +[ r != 0 ] && [ "$OPTIND" = 3 ] Added: head/bin/sh/tests/builtins/getopts7.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/getopts7.0 Sat May 10 17:42:21 2014 (r265844) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +set -- -x +getopts :x: var +r=$? +[ r != 0 ] && [ "$OPTIND" = 2 ] From owner-svn-src-head@FreeBSD.ORG Sat May 10 18:59:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F71CEB; Sat, 10 May 2014 18:59:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CF70E30; Sat, 10 May 2014 18:59:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AIxArK079384; Sat, 10 May 2014 18:59:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AIxAor079383; Sat, 10 May 2014 18:59:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405101859.s4AIxAor079383@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 10 May 2014 18:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265845 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 18:59:10 -0000 Author: kib Date: Sat May 10 18:59:09 2014 New Revision: 265845 URL: http://svnweb.freebsd.org/changeset/base/265845 Log: Style. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/gen/sem_new.c Modified: head/lib/libc/gen/sem_new.c ============================================================================== --- head/lib/libc/gen/sem_new.c Sat May 10 17:42:21 2014 (r265844) +++ head/lib/libc/gen/sem_new.c Sat May 10 18:59:09 2014 (r265845) @@ -294,13 +294,13 @@ _sem_unlink(const char *name) return -1; } name++; - strcpy(path, SEM_PREFIX); if (strlcat(path, name, sizeof(path)) >= sizeof(path)) { errno = ENAMETOOLONG; return (-1); } - return unlink(path); + + return (unlink(path)); } int From owner-svn-src-head@FreeBSD.ORG Sat May 10 19:06:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9CFB32A9; Sat, 10 May 2014 19:06:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A340ECB; Sat, 10 May 2014 19:06:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AJ6aeu083669; Sat, 10 May 2014 19:06:36 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AJ6adD083668; Sat, 10 May 2014 19:06:36 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201405101906.s4AJ6adD083668@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 10 May 2014 19:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265846 - head/bin/sh/tests/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 19:06:36 -0000 Author: jilles Date: Sat May 10 19:06:36 2014 New Revision: 265846 URL: http://svnweb.freebsd.org/changeset/base/265846 Log: sh: Add new tests to the Makefile. Modified: head/bin/sh/tests/builtins/Makefile Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Sat May 10 18:59:09 2014 (r265845) +++ head/bin/sh/tests/builtins/Makefile Sat May 10 19:06:36 2014 (r265846) @@ -83,6 +83,8 @@ FILES+= getopts2.0 getopts2.0.stdout FILES+= getopts3.0 FILES+= getopts4.0 FILES+= getopts5.0 +FILES+= getopts6.0 +FILES+= getopts7.0 FILES+= hash1.0 hash1.0.stdout FILES+= hash2.0 hash2.0.stdout FILES+= hash3.0 hash3.0.stdout From owner-svn-src-head@FreeBSD.ORG Sat May 10 19:08:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77BD13F5; Sat, 10 May 2014 19:08:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 64FDEEDE; Sat, 10 May 2014 19:08:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AJ888u083958; Sat, 10 May 2014 19:08:08 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AJ88VT083957; Sat, 10 May 2014 19:08:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405101908.s4AJ88VT083957@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 10 May 2014 19:08:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265847 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 19:08:08 -0000 Author: kib Date: Sat May 10 19:08:07 2014 New Revision: 265847 URL: http://svnweb.freebsd.org/changeset/base/265847 Log: Invalidate the cache for the named posix semaphore when opened and actual file storing the semaphore object is different from the file created on the first open. Store the file st_dev and st_ino members of the struct stat in the semaphore structure on open, and compare them with the attributes of the opened file to detect unlink and re-creation. This fixes an issue of sem_unlink(3) failing to flush the named entry in the semaphore list for the current or remote process, making sem_unlink(3) not correctly operating if the unlinked semaphore is still opened. Reported by: Joris Giovannangeli PR: standards/189353 Reviewed by: jilles (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/gen/sem_new.c Modified: head/lib/libc/gen/sem_new.c ============================================================================== --- head/lib/libc/gen/sem_new.c Sat May 10 19:06:36 2014 (r265846) +++ head/lib/libc/gen/sem_new.c Sat May 10 19:08:07 2014 (r265847) @@ -66,6 +66,8 @@ __weak_reference(_sem_wait, sem_wait); struct sem_nameinfo { int open_count; char *name; + dev_t dev; + ino_t ino; sem_t *sem; LIST_ENTRY(sem_nameinfo) next; }; @@ -151,37 +153,46 @@ _sem_open(const char *name, int flags, . return (SEM_FAILED); } name++; - + strcpy(path, SEM_PREFIX); + if (strlcat(path, name, sizeof(path)) >= sizeof(path)) { + errno = ENAMETOOLONG; + return (SEM_FAILED); + } if (flags & ~(O_CREAT|O_EXCL)) { errno = EINVAL; return (SEM_FAILED); } - + if ((flags & O_CREAT) != 0) { + va_start(ap, flags); + mode = va_arg(ap, int); + value = va_arg(ap, int); + va_end(ap); + } + fd = -1; _pthread_once(&once, sem_module_init); _pthread_mutex_lock(&sem_llock); LIST_FOREACH(ni, &sem_list, next) { - if (strcmp(name, ni->name) == 0) { - if ((flags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL)) { - _pthread_mutex_unlock(&sem_llock); - errno = EEXIST; - return (SEM_FAILED); - } else { - ni->open_count++; - sem = ni->sem; - _pthread_mutex_unlock(&sem_llock); - return (sem); + if (ni->name != NULL && strcmp(name, ni->name) == 0) { + fd = _open(path, flags | O_RDWR | O_CLOEXEC | + O_EXLOCK, mode); + if (fd == -1 || _fstat(fd, &sb) == -1) + goto error; + if ((flags & (O_CREAT | O_EXCL)) == (O_CREAT | + O_EXCL) || ni->dev != sb.st_dev || + ni->ino != sb.st_ino) { + ni->name = NULL; + ni = NULL; + break; } + ni->open_count++; + sem = ni->sem; + _pthread_mutex_unlock(&sem_llock); + _close(fd); + return (sem); } } - if (flags & O_CREAT) { - va_start(ap, flags); - mode = va_arg(ap, int); - value = va_arg(ap, int); - va_end(ap); - } - len = sizeof(*ni) + strlen(name) + 1; ni = (struct sem_nameinfo *)malloc(len); if (ni == NULL) { @@ -192,17 +203,11 @@ _sem_open(const char *name, int flags, . ni->name = (char *)(ni+1); strcpy(ni->name, name); - strcpy(path, SEM_PREFIX); - if (strlcat(path, name, sizeof(path)) >= sizeof(path)) { - errno = ENAMETOOLONG; - goto error; + if (fd == -1) { + fd = _open(path, flags | O_RDWR | O_CLOEXEC | O_EXLOCK, mode); + if (fd == -1 || _fstat(fd, &sb) == -1) + goto error; } - - fd = _open(path, flags|O_RDWR|O_CLOEXEC|O_EXLOCK, mode); - if (fd == -1) - goto error; - if (_fstat(fd, &sb)) - goto error; if (sb.st_size < sizeof(sem_t)) { sem_t tmp; @@ -228,6 +233,8 @@ _sem_open(const char *name, int flags, . } ni->open_count = 1; ni->sem = sem; + ni->dev = sb.st_dev; + ni->ino = sb.st_ino; LIST_INSERT_HEAD(&sem_list, ni, next); _close(fd); _pthread_mutex_unlock(&sem_llock); From owner-svn-src-head@FreeBSD.ORG Sat May 10 19:18:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 581B977B; Sat, 10 May 2014 19:18:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39107F9D; Sat, 10 May 2014 19:18:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AJIoKs088669; Sat, 10 May 2014 19:18:50 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AJInll088664; Sat, 10 May 2014 19:18:49 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201405101918.s4AJInll088664@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 10 May 2014 19:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265849 - in head/bin/sh: . tests/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 19:18:50 -0000 Author: jilles Date: Sat May 10 19:18:49 2014 New Revision: 265849 URL: http://svnweb.freebsd.org/changeset/base/265849 Log: sh: In getopts, unset OPTARG where POSIX says we should. Added: head/bin/sh/tests/builtins/getopts8.0 (contents, props changed) head/bin/sh/tests/builtins/getopts8.0.stdout (contents, props changed) Modified: head/bin/sh/options.c head/bin/sh/tests/builtins/Makefile Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Sat May 10 19:10:31 2014 (r265848) +++ head/bin/sh/options.c Sat May 10 19:18:49 2014 (r265849) @@ -446,6 +446,7 @@ getopts(char *optstr, char *optvar, char int ind = 0; int err = 0; char s[10]; + const char *optarg = NULL; if ((p = *optptr) == NULL || *p == '\0') { /* Current word is done, advance */ @@ -471,14 +472,10 @@ atend: if (optstr[0] == ':') { s[0] = c; s[1] = '\0'; - err |= setvarsafe("OPTARG", s, 0); + optarg = s; } - else { + else out2fmt_flush("Illegal option -%c\n", c); - INTOFF; - (void) unsetvar("OPTARG"); - INTON; - } c = '?'; goto out; } @@ -491,14 +488,11 @@ atend: if (optstr[0] == ':') { s[0] = c; s[1] = '\0'; - err |= setvarsafe("OPTARG", s, 0); + optarg = s; c = ':'; } else { out2fmt_flush("No arg for -%c option\n", c); - INTOFF; - (void) unsetvar("OPTARG"); - INTON; c = '?'; } goto out; @@ -506,16 +500,21 @@ atend: if (p == **optnext) (*optnext)++; - setvarsafe("OPTARG", p, 0); + optarg = p; p = NULL; } - else - setvarsafe("OPTARG", "", 0); out: if (*optnext != NULL) ind = *optnext - optfirst + 1; *optptr = p; + if (optarg != NULL) + err |= setvarsafe("OPTARG", optarg, 0); + else { + INTOFF; + err |= unsetvar("OPTARG"); + INTON; + } fmtstr(s, sizeof(s), "%d", ind); err |= setvarsafe("OPTIND", s, VNOFUNC); s[0] = c; Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Sat May 10 19:10:31 2014 (r265848) +++ head/bin/sh/tests/builtins/Makefile Sat May 10 19:18:49 2014 (r265849) @@ -85,6 +85,7 @@ FILES+= getopts4.0 FILES+= getopts5.0 FILES+= getopts6.0 FILES+= getopts7.0 +FILES+= getopts8.0 getopts8.0.stdout FILES+= hash1.0 hash1.0.stdout FILES+= hash2.0 hash2.0.stdout FILES+= hash3.0 hash3.0.stdout Added: head/bin/sh/tests/builtins/getopts8.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/getopts8.0 Sat May 10 19:18:49 2014 (r265849) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +set -- -yz -wx +opt=wrong1 OPTARG=wrong2 +while getopts :x opt; do + echo "$opt:${OPTARG-unset}" +done +echo "OPTIND=$OPTIND" Added: head/bin/sh/tests/builtins/getopts8.0.stdout ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/getopts8.0.stdout Sat May 10 19:18:49 2014 (r265849) @@ -0,0 +1,5 @@ +?:y +?:z +?:w +x:unset +OPTIND=3 From owner-svn-src-head@FreeBSD.ORG Sat May 10 19:47:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E037D7D; Sat, 10 May 2014 19:47:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BFEE229; Sat, 10 May 2014 19:47:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AJl1iP004573; Sat, 10 May 2014 19:47:01 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AJl13j004572; Sat, 10 May 2014 19:47:01 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201405101947.s4AJl13j004572@svn.freebsd.org> From: Alan Cox Date: Sat, 10 May 2014 19:47:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265850 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 19:47:01 -0000 Author: alc Date: Sat May 10 19:47:00 2014 New Revision: 265850 URL: http://svnweb.freebsd.org/changeset/base/265850 Log: About 9% of the pmap_protect() calls being performed by vm_map_copy_entry() are unnecessary. Eliminate the unnecessary calls. Reviewed by: kib MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sat May 10 19:18:49 2014 (r265849) +++ head/sys/vm/vm_map.c Sat May 10 19:47:00 2014 (r265850) @@ -3023,7 +3023,8 @@ vm_map_copy_entry( * If the source entry is marked needs_copy, it is already * write-protected. */ - if ((src_entry->eflags & MAP_ENTRY_NEEDS_COPY) == 0) { + if ((src_entry->eflags & MAP_ENTRY_NEEDS_COPY) == 0 && + (src_entry->protection & VM_PROT_WRITE) != 0) { pmap_protect(src_map->pmap, src_entry->start, src_entry->end, From owner-svn-src-head@FreeBSD.ORG Sat May 10 20:03:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A854C600; Sat, 10 May 2014 20:03:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93E17395; Sat, 10 May 2014 20:03:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AK36nV013155; Sat, 10 May 2014 20:03:06 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AK34sK013136; Sat, 10 May 2014 20:03:04 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405102003.s4AK34sK013136@svn.freebsd.org> From: Ian Lepore Date: Sat, 10 May 2014 20:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265852 - in head/sys/arm: at91 cavium/cns11xx mv mv/orion s3c2xx0 xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 20:03:06 -0000 Author: ian Date: Sat May 10 20:03:03 2014 New Revision: 265852 URL: http://svnweb.freebsd.org/changeset/base/265852 Log: When mapping device memory, use PTE_DEVICE rather than PTE_NOCACHE. On armv4 these are defined as synonyms right now, but it's a bit ambiguous what NOCACHE means (is buffering/write-combining also enabled or not?); this is a first step towards replacing PTE_NOCACHE with a less ambiguous name. Modified: head/sys/arm/at91/at91_machdep.c head/sys/arm/cavium/cns11xx/econa_machdep.c head/sys/arm/mv/mv_localbus.c head/sys/arm/mv/mv_machdep.c head/sys/arm/mv/mv_pci.c head/sys/arm/mv/orion/db88f5xxx.c head/sys/arm/s3c2xx0/s3c24x0_machdep.c head/sys/arm/xscale/i80321/ep80219_machdep.c head/sys/arm/xscale/i80321/iq31244_machdep.c head/sys/arm/xscale/i8134x/crb_machdep.c head/sys/arm/xscale/ixp425/avila_machdep.c head/sys/arm/xscale/pxa/pxa_machdep.c Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Sat May 10 19:47:54 2014 (r265851) +++ head/sys/arm/at91/at91_machdep.c Sat May 10 20:03:03 2014 (r265852) @@ -126,7 +126,7 @@ const struct arm_devmap_entry at91_devma 0xfff00000, 0x00100000, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, /* There's a notion that we should do the rest of these lazily. */ /* @@ -150,7 +150,7 @@ const struct arm_devmap_entry at91_devma AT91RM92_OHCI_BASE, 0x00100000, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* CompactFlash controller. Portion of EBI CS4 1MB */ @@ -158,7 +158,7 @@ const struct arm_devmap_entry at91_devma AT91RM92_CF_BASE, 0x00100000, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, /* * The next two should be good for the 9260, 9261 and 9G20 since @@ -170,7 +170,7 @@ const struct arm_devmap_entry at91_devma AT91SAM9G20_OHCI_BASE, 0x00100000, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* EBI CS3 256MB */ @@ -178,7 +178,7 @@ const struct arm_devmap_entry at91_devma AT91SAM9G20_NAND_BASE, AT91SAM9G20_NAND_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, /* * The next should be good for the 9G45. @@ -189,7 +189,7 @@ const struct arm_devmap_entry at91_devma AT91SAM9G45_OHCI_BASE, 0x00100000, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { 0, 0, 0, 0, 0, } }; Modified: head/sys/arm/cavium/cns11xx/econa_machdep.c ============================================================================== --- head/sys/arm/cavium/cns11xx/econa_machdep.c Sat May 10 19:47:54 2014 (r265851) +++ head/sys/arm/cavium/cns11xx/econa_machdep.c Sat May 10 20:03:03 2014 (r265852) @@ -112,7 +112,7 @@ static const struct arm_devmap_entry eco ECONA_SDRAM_BASE, /*physical*/ ECONA_SDRAM_SIZE, /*size*/ VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, /* * Map the on-board devices VA == PA so that we can access them @@ -127,7 +127,7 @@ static const struct arm_devmap_entry eco ECONA_IO_BASE, /*physical*/ ECONA_IO_SIZE, /*size*/ VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* @@ -137,7 +137,7 @@ static const struct arm_devmap_entry eco ECONA_OHCI_PBASE, /*physical*/ ECONA_USB_SIZE, /*size*/ VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* @@ -147,7 +147,7 @@ static const struct arm_devmap_entry eco ECONA_CFI_PBASE, /*physical*/ ECONA_CFI_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { 0, Modified: head/sys/arm/mv/mv_localbus.c ============================================================================== --- head/sys/arm/mv/mv_localbus.c Sat May 10 19:47:54 2014 (r265851) +++ head/sys/arm/mv/mv_localbus.c Sat May 10 20:03:03 2014 (r265852) @@ -477,7 +477,7 @@ fdt_localbus_devmap(phandle_t dt_node, s fdt_devmap[j].pd_pa = offset; fdt_devmap[j].pd_size = size; fdt_devmap[j].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[j].pd_cache = PTE_NOCACHE; + fdt_devmap[j].pd_cache = PTE_DEVICE; /* Copy data to structure used by localbus driver */ localbus_banks[bank].va = fdt_devmap[j].pd_va; Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Sat May 10 19:47:54 2014 (r265851) +++ head/sys/arm/mv/mv_machdep.c Sat May 10 20:03:03 2014 (r265852) @@ -284,7 +284,7 @@ moveon: map->pd_pa = base; map->pd_size = size; map->pd_prot = VM_PROT_READ | VM_PROT_WRITE; - map->pd_cache = PTE_NOCACHE; + map->pd_cache = PTE_DEVICE; return (0); out: @@ -350,7 +350,7 @@ initarm_devmap_init(void) fdt_devmap[i].pd_pa = fdt_immr_pa; fdt_devmap[i].pd_size = fdt_immr_size; fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[i].pd_cache = PTE_NOCACHE; + fdt_devmap[i].pd_cache = PTE_DEVICE; i++; /* Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Sat May 10 19:47:54 2014 (r265851) +++ head/sys/arm/mv/mv_pci.c Sat May 10 20:03:03 2014 (r265852) @@ -235,14 +235,14 @@ mv_pci_devmap(phandle_t node, struct arm devmap->pd_pa = io_space.base_parent; devmap->pd_size = io_space.len; devmap->pd_prot = VM_PROT_READ | VM_PROT_WRITE; - devmap->pd_cache = PTE_NOCACHE; + devmap->pd_cache = PTE_DEVICE; devmap++; devmap->pd_va = (mem_va ? mem_va : mem_space.base_parent); devmap->pd_pa = mem_space.base_parent; devmap->pd_size = mem_space.len; devmap->pd_prot = VM_PROT_READ | VM_PROT_WRITE; - devmap->pd_cache = PTE_NOCACHE; + devmap->pd_cache = PTE_DEVICE; return (0); } Modified: head/sys/arm/mv/orion/db88f5xxx.c ============================================================================== --- head/sys/arm/mv/orion/db88f5xxx.c Sat May 10 19:47:54 2014 (r265851) +++ head/sys/arm/mv/orion/db88f5xxx.c Sat May 10 20:03:03 2014 (r265852) @@ -84,42 +84,42 @@ const struct pmap_devmap pmap_devmap[] = MV_PHYS_BASE, MV_SIZE, VM_PROT_READ | VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* PCIE I/O */ MV_PCIE_IO_BASE, MV_PCIE_IO_PHYS_BASE, MV_PCIE_IO_SIZE, VM_PROT_READ | VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* PCIE Memory */ MV_PCIE_MEM_BASE, MV_PCIE_MEM_PHYS_BASE, MV_PCIE_MEM_SIZE, VM_PROT_READ | VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* PCI I/O */ MV_PCI_IO_BASE, MV_PCI_IO_PHYS_BASE, MV_PCI_IO_SIZE, VM_PROT_READ | VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* PCI Memory */ MV_PCI_MEM_BASE, MV_PCI_MEM_PHYS_BASE, MV_PCI_MEM_SIZE, VM_PROT_READ | VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* 7-seg LED */ MV_DEV_CS0_BASE, MV_DEV_CS0_PHYS_BASE, MV_DEV_CS0_SIZE, VM_PROT_READ | VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { 0, 0, 0, 0, 0, } }; Modified: head/sys/arm/s3c2xx0/s3c24x0_machdep.c ============================================================================== --- head/sys/arm/s3c2xx0/s3c24x0_machdep.c Sat May 10 19:47:54 2014 (r265851) +++ head/sys/arm/s3c2xx0/s3c24x0_machdep.c Sat May 10 20:03:03 2014 (r265852) @@ -130,42 +130,42 @@ static const struct arm_devmap_entry s3c _A(S3C24X0_CLKMAN_PA_BASE), _S(S3C24X0_CLKMAN_SIZE), VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { _A(S3C24X0_GPIO_BASE), _A(S3C24X0_GPIO_PA_BASE), _S(S3C2410_GPIO_SIZE), VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { _A(S3C24X0_INTCTL_BASE), _A(S3C24X0_INTCTL_PA_BASE), _S(S3C24X0_INTCTL_SIZE), VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { _A(S3C24X0_TIMER_BASE), _A(S3C24X0_TIMER_PA_BASE), _S(S3C24X0_TIMER_SIZE), VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { _A(S3C24X0_UART0_BASE), _A(S3C24X0_UART0_PA_BASE), _S(S3C24X0_UART_PA_BASE(3) - S3C24X0_UART0_PA_BASE), VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { _A(S3C24X0_WDT_BASE), _A(S3C24X0_WDT_PA_BASE), _S(S3C24X0_WDT_SIZE), VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { 0, Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/ep80219_machdep.c Sat May 10 19:47:54 2014 (r265851) +++ head/sys/arm/xscale/i80321/ep80219_machdep.c Sat May 10 20:03:03 2014 (r265852) @@ -130,21 +130,21 @@ static const struct arm_devmap_entry ep8 IQ80321_OBIO_BASE, IQ80321_OBIO_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { IQ80321_IOW_VBASE, VERDE_OUT_XLATE_IO_WIN0_BASE, VERDE_OUT_XLATE_IO_WIN_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { IQ80321_80321_VBASE, VERDE_PMMR_BASE, VERDE_PMMR_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { 0, Modified: head/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/iq31244_machdep.c Sat May 10 19:47:54 2014 (r265851) +++ head/sys/arm/xscale/i80321/iq31244_machdep.c Sat May 10 20:03:03 2014 (r265852) @@ -128,14 +128,14 @@ static const struct arm_devmap_entry iq8 IQ80321_OBIO_BASE, IQ80321_OBIO_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { IQ80321_IOW_VBASE, VERDE_OUT_XLATE_IO_WIN0_BASE, VERDE_OUT_XLATE_IO_WIN_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { @@ -143,7 +143,7 @@ static const struct arm_devmap_entry iq8 VERDE_PMMR_BASE, VERDE_PMMR_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { 0, Modified: head/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- head/sys/arm/xscale/i8134x/crb_machdep.c Sat May 10 19:47:54 2014 (r265851) +++ head/sys/arm/xscale/i8134x/crb_machdep.c Sat May 10 20:03:03 2014 (r265852) @@ -124,7 +124,7 @@ static const struct arm_devmap_entry iq8 IOP34X_HWADDR, IOP34X_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { /* @@ -135,14 +135,14 @@ static const struct arm_devmap_entry iq8 IOP34X_PCIX_OIOBAR &~ (0x100000 - 1), 0x100000, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { IOP34X_PCE1_VADDR, IOP34X_PCE1, IOP34X_PCE1_SIZE, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { 0, Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Sat May 10 19:47:54 2014 (r265851) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Sat May 10 20:03:03 2014 (r265852) @@ -118,31 +118,31 @@ struct pv_addr minidataclean; static const struct arm_devmap_entry ixp425_devmap[] = { /* Physical/Virtual address for I/O space */ { IXP425_IO_VBASE, IXP425_IO_HWBASE, IXP425_IO_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* Expansion Bus */ { IXP425_EXP_VBASE, IXP425_EXP_HWBASE, IXP425_EXP_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* CFI Flash on the Expansion Bus */ { IXP425_EXP_BUS_CS0_VBASE, IXP425_EXP_BUS_CS0_HWBASE, - IXP425_EXP_BUS_CS0_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + IXP425_EXP_BUS_CS0_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* IXP425 PCI Configuration */ { IXP425_PCI_VBASE, IXP425_PCI_HWBASE, IXP425_PCI_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* SDRAM Controller */ { IXP425_MCU_VBASE, IXP425_MCU_HWBASE, IXP425_MCU_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* PCI Memory Space */ { IXP425_PCI_MEM_VBASE, IXP425_PCI_MEM_HWBASE, IXP425_PCI_MEM_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* Q-Mgr Memory Space */ { IXP425_QMGR_VBASE, IXP425_QMGR_HWBASE, IXP425_QMGR_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, { 0 }, }; @@ -151,45 +151,45 @@ static const struct arm_devmap_entry ixp static const struct arm_devmap_entry ixp435_devmap[] = { /* Physical/Virtual address for I/O space */ { IXP425_IO_VBASE, IXP425_IO_HWBASE, IXP425_IO_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, { IXP425_EXP_VBASE, IXP425_EXP_HWBASE, IXP425_EXP_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* IXP425 PCI Configuration */ { IXP425_PCI_VBASE, IXP425_PCI_HWBASE, IXP425_PCI_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* DDRII Controller NB: mapped same place as IXP425 */ { IXP425_MCU_VBASE, IXP435_MCU_HWBASE, IXP425_MCU_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* PCI Memory Space */ { IXP425_PCI_MEM_VBASE, IXP425_PCI_MEM_HWBASE, IXP425_PCI_MEM_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* Q-Mgr Memory Space */ { IXP425_QMGR_VBASE, IXP425_QMGR_HWBASE, IXP425_QMGR_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* CFI Flash on the Expansion Bus */ { IXP425_EXP_BUS_CS0_VBASE, IXP425_EXP_BUS_CS0_HWBASE, - IXP425_EXP_BUS_CS0_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + IXP425_EXP_BUS_CS0_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* USB1 Memory Space */ { IXP435_USB1_VBASE, IXP435_USB1_HWBASE, IXP435_USB1_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* USB2 Memory Space */ { IXP435_USB2_VBASE, IXP435_USB2_HWBASE, IXP435_USB2_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* GPS Memory Space */ { CAMBRIA_GPS_VBASE, CAMBRIA_GPS_HWBASE, CAMBRIA_GPS_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, /* RS485 Memory Space */ { CAMBRIA_RS485_VBASE, CAMBRIA_RS485_HWBASE, CAMBRIA_RS485_SIZE, - VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + VM_PROT_READ|VM_PROT_WRITE, PTE_DEVICE, }, { 0 } }; Modified: head/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_machdep.c Sat May 10 19:47:54 2014 (r265851) +++ head/sys/arm/xscale/pxa/pxa_machdep.c Sat May 10 20:03:03 2014 (r265852) @@ -129,7 +129,7 @@ static const struct arm_devmap_entry pxa PXA2X0_PERIPH_START, PXA250_PERIPH_END - PXA2X0_PERIPH_START, VM_PROT_READ|VM_PROT_WRITE, - PTE_NOCACHE, + PTE_DEVICE, }, { 0, 0, 0, 0, 0, } }; From owner-svn-src-head@FreeBSD.ORG Sat May 10 20:26:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9AF8AFC1; Sat, 10 May 2014 20:26:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 884ED78F; Sat, 10 May 2014 20:26:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AKQnhb022997; Sat, 10 May 2014 20:26:49 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AKQndH022996; Sat, 10 May 2014 20:26:49 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201405102026.s4AKQndH022996@svn.freebsd.org> From: Andrew Turner Date: Sat, 10 May 2014 20:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265853 - head/sys/arm/rockchip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 20:26:49 -0000 Author: andrew Date: Sat May 10 20:26:49 2014 New Revision: 265853 URL: http://svnweb.freebsd.org/changeset/base/265853 Log: Rename platform_gpio_init to be SoC specific, and make it static as it's only called from this file. Modified: head/sys/arm/rockchip/rk30xx_gpio.c Modified: head/sys/arm/rockchip/rk30xx_gpio.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_gpio.c Sat May 10 20:03:03 2014 (r265852) +++ head/sys/arm/rockchip/rk30xx_gpio.c Sat May 10 20:26:49 2014 (r265853) @@ -96,7 +96,7 @@ struct gpio_ctrl_entry { }; int rk30_gpios_prop_handle(phandle_t ctrl, pcell_t *gpios, int len); -int platform_gpio_init(void); +static int rk30_gpio_init(void); struct gpio_ctrl_entry gpio_controllers[] = { { "rockchip,rk30xx-gpio", &rk30_gpios_prop_handle }, @@ -509,7 +509,7 @@ rk30_gpio_attach(device_t dev) rk30_gpio_sc = sc; - platform_gpio_init(); + rk30_gpio_init(); return (bus_generic_attach(dev)); @@ -619,8 +619,8 @@ rk30_gpios_prop_handle(phandle_t ctrl, p #define MAX_PINS_PER_NODE 5 #define GPIOS_PROP_CELLS 4 -int -platform_gpio_init(void) +static int +rk30_gpio_init(void) { phandle_t child, parent, root, ctrl; pcell_t gpios[MAX_PINS_PER_NODE * GPIOS_PROP_CELLS]; From owner-svn-src-head@FreeBSD.ORG Sat May 10 20:31:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C915F1AA; Sat, 10 May 2014 20:31:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B68EA806; Sat, 10 May 2014 20:31:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AKV5O1026847; Sat, 10 May 2014 20:31:05 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AKV5a9026844; Sat, 10 May 2014 20:31:05 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201405102031.s4AKV5a9026844@svn.freebsd.org> From: Andrew Turner Date: Sat, 10 May 2014 20:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265854 - head/sys/arm/mv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 20:31:05 -0000 Author: andrew Date: Sat May 10 20:31:05 2014 New Revision: 265854 URL: http://svnweb.freebsd.org/changeset/base/265854 Log: Rename platform_gpio_init to be platform specific, and make it static as it's only used from this file. Modified: head/sys/arm/mv/gpio.c head/sys/arm/mv/mvvar.h Modified: head/sys/arm/mv/gpio.c ============================================================================== --- head/sys/arm/mv/gpio.c Sat May 10 20:26:49 2014 (r265853) +++ head/sys/arm/mv/gpio.c Sat May 10 20:31:05 2014 (r265854) @@ -74,6 +74,7 @@ static uint32_t gpio_setup[MV_GPIO_MAX_N static int mv_gpio_probe(device_t); static int mv_gpio_attach(device_t); static int mv_gpio_intr(void *); +static int mv_gpio_init(void); static void mv_gpio_intr_handler(int pin); static uint32_t mv_gpio_reg_read(uint32_t reg); @@ -201,7 +202,7 @@ mv_gpio_attach(device_t dev) } } - return (platform_gpio_init()); + return (mv_gpio_init()); } static int @@ -604,8 +605,8 @@ mv_handle_gpios_prop(phandle_t ctrl, pce #define MAX_PINS_PER_NODE 5 #define GPIOS_PROP_CELLS 4 -int -platform_gpio_init(void) +static int +mv_gpio_init(void) { phandle_t child, parent, root, ctrl; pcell_t gpios[MAX_PINS_PER_NODE * GPIOS_PROP_CELLS]; Modified: head/sys/arm/mv/mvvar.h ============================================================================== --- head/sys/arm/mv/mvvar.h Sat May 10 20:26:49 2014 (r265853) +++ head/sys/arm/mv/mvvar.h Sat May 10 20:31:05 2014 (r265854) @@ -82,7 +82,6 @@ void mv_gpio_intr_mask(int pin); void mv_gpio_intr_unmask(int pin); void mv_gpio_out(uint32_t pin, uint8_t val, uint8_t enable); uint8_t mv_gpio_in(uint32_t pin); -int platform_gpio_init(void); int soc_decode_win(void); void soc_id(uint32_t *dev, uint32_t *rev); From owner-svn-src-head@FreeBSD.ORG Sat May 10 21:27:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C02FA13; Sat, 10 May 2014 21:27:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00FBFC1D; Sat, 10 May 2014 21:27:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4ALRljG051319; Sat, 10 May 2014 21:27:47 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ALRlDC051318; Sat, 10 May 2014 21:27:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405102127.s4ALRlDC051318@svn.freebsd.org> From: Warner Losh Date: Sat, 10 May 2014 21:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265857 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 21:27:48 -0000 Author: imp Date: Sat May 10 21:27:47 2014 New Revision: 265857 URL: http://svnweb.freebsd.org/changeset/base/265857 Log: Really, I don't want to install src.opts.mk at all. Modified: head/share/mk/Makefile Modified: head/share/mk/Makefile ============================================================================== --- head/share/mk/Makefile Sat May 10 20:45:23 2014 (r265856) +++ head/share/mk/Makefile Sat May 10 21:27:47 2014 (r265857) @@ -42,9 +42,6 @@ FILES= \ sys.mk \ version_gen.awk -# Installed for the moment, but not may not be in the future. -FILES+= src.opts.mk - NO_OBJ= FILESDIR= ${BINDIR}/mk From owner-svn-src-head@FreeBSD.ORG Sat May 10 21:30:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4CE51D27; Sat, 10 May 2014 21:30:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A2F3C37; Sat, 10 May 2014 21:30:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4ALUKpe054055; Sat, 10 May 2014 21:30:20 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ALUJ5E054052; Sat, 10 May 2014 21:30:19 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201405102130.s4ALUJ5E054052@svn.freebsd.org> From: Andrew Turner Date: Sat, 10 May 2014 21:30:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265858 - head/sys/arm/lpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 21:30:20 -0000 Author: andrew Date: Sat May 10 21:30:19 2014 New Revision: 265858 URL: http://svnweb.freebsd.org/changeset/base/265858 Log: Rename platform_gpio_init to be SoC specific Modified: head/sys/arm/lpc/lpc_gpio.c head/sys/arm/lpc/lpc_machdep.c head/sys/arm/lpc/lpcvar.h Modified: head/sys/arm/lpc/lpc_gpio.c ============================================================================== --- head/sys/arm/lpc/lpc_gpio.c Sat May 10 21:27:47 2014 (r265857) +++ head/sys/arm/lpc/lpc_gpio.c Sat May 10 21:30:19 2014 (r265858) @@ -504,7 +504,7 @@ lpc_gpio_get_state(device_t dev, int pin } void -platform_gpio_init() +lpc_gpio_init() { bus_space_tag_t bst; bus_space_handle_t bsh; Modified: head/sys/arm/lpc/lpc_machdep.c ============================================================================== --- head/sys/arm/lpc/lpc_machdep.c Sat May 10 21:27:47 2014 (r265857) +++ head/sys/arm/lpc/lpc_machdep.c Sat May 10 21:30:19 2014 (r265858) @@ -78,7 +78,7 @@ initarm_gpio_init(void) /* * Set initial values of GPIO output ports */ - platform_gpio_init(); + lpc_gpio_init(); } void Modified: head/sys/arm/lpc/lpcvar.h ============================================================================== --- head/sys/arm/lpc/lpcvar.h Sat May 10 21:27:47 2014 (r265857) +++ head/sys/arm/lpc/lpcvar.h Sat May 10 21:30:19 2014 (r265858) @@ -38,7 +38,7 @@ uint32_t lpc_pwr_read(device_t, int); void lpc_pwr_write(device_t, int, uint32_t); /* GPIO */ -void platform_gpio_init(void); +void lpc_gpio_init(void); int lpc_gpio_set_flags(device_t, int, int); int lpc_gpio_set_state(device_t, int, int); int lpc_gpio_get_state(device_t, int, int *); From owner-svn-src-head@FreeBSD.ORG Sat May 10 22:16:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BFB2D2DB; Sat, 10 May 2014 22:16:53 +0000 (UTC) Received: from mail-we0-x234.google.com (mail-we0-x234.google.com [IPv6:2a00:1450:400c:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF24FFA8; Sat, 10 May 2014 22:16:52 +0000 (UTC) Received: by mail-we0-f180.google.com with SMTP id t61so5396095wes.11 for ; Sat, 10 May 2014 15:16:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=4q2J75g3CaLi9a5ebHRG7kMl93UssB5jwpdPah75SmQ=; b=pid8lPEOWHRIKO2LThKs73dMwB6eC9cIxYCuELK/bXJEcjTBzojyZTKlHJWoRiXmzW bsmVSWNNW2BOG5w42SsE70tbFhysn7LqZO+Zk2uToS0S3ZOIcojiPP/EBHyMmRADbfOk iMIBXgZ0B4UMEsg1kq1+mhhatsaxaYQlsvEhfJQsnYnRc1b1dO6rN+9lbTy4R+KMmoKA 0b0XO8oN7iC0BC6RL4m4AeO7jXjozdeVQIXqoROvMcmEo2l4CNQp6gMBl1VqnPmeRYsc OHCPrnnQnRDvCaNhMeCXRzFsTci5k6unlRtyfGBwS8vY1t3bwasG+nOn83rNG3DIU1ze vy4A== X-Received: by 10.180.211.243 with SMTP id nf19mr8990398wic.58.1399760211218; Sat, 10 May 2014 15:16:51 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id by1sm11045137wjc.26.2014.05.10.15.16.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 May 2014 15:16:49 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 11 May 2014 00:16:47 +0200 From: Baptiste Daroussin To: Eitan Adler Subject: Re: svn commit: r265842 - head Message-ID: <20140510221647.GJ36036@ivaldir.etoilebsd.net> References: <201405101659.s4AGxFcF024753@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VSaCG/zfRnOiPJtU" Content-Disposition: inline In-Reply-To: <201405101659.s4AGxFcF024753@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 22:16:53 -0000 --VSaCG/zfRnOiPJtU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 10, 2014 at 04:59:15PM +0000, Eitan Adler wrote: > Author: eadler > Date: Sat May 10 16:59:15 2014 > New Revision: 265842 > URL: http://svnweb.freebsd.org/changeset/base/265842 >=20 > Log: > arcconfig: add one > =20 > Add a .arcconfig to allow arc to work in its usual way. >=20 > Added: > head/.arcconfig (contents, props changed) >=20 > Added: head/.arcconfig > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/.arcconfig Sat May 10 16:59:15 2014 (r265842) > @@ -0,0 +1,3 @@ > +{ > + "phabricator.uri" : "https://phabric.freebsd.org/" > +} > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" You for got the project_id regards, Bapt --VSaCG/zfRnOiPJtU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iEYEARECAAYFAlNupU8ACgkQ8kTtMUmk6Ew/7wCfaw+meZwPNe7HNn1QpnVjZ7VL 14YAn3bcuDzbfZ+1bmKVYaPXLrOo8IZ3 =A9/0 -----END PGP SIGNATURE----- --VSaCG/zfRnOiPJtU-- From owner-svn-src-head@FreeBSD.ORG Sat May 10 22:27:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6622635; Sat, 10 May 2014 22:27:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93D27B5; Sat, 10 May 2014 22:27:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4AMR2ZV079060; Sat, 10 May 2014 22:27:02 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4AMR2Is079059; Sat, 10 May 2014 22:27:02 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405102227.s4AMR2Is079059@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 10 May 2014 22:27:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265860 - head/usr.bin/printf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 22:27:02 -0000 Author: pfg Date: Sat May 10 22:27:01 2014 New Revision: 265860 URL: http://svnweb.freebsd.org/changeset/base/265860 Log: prinf: replace use of alloca with variable length array. Use of alloca(3) is discouraged in FreeBSD. Using a VLA is simple and should be more portable. Requested by: jilles Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Sat May 10 21:53:07 2014 (r265859) +++ head/usr.bin/printf/printf.c Sat May 10 22:27:01 2014 (r265860) @@ -215,13 +215,11 @@ printf_doformat(char *fmt, int *rval) static const char skip1[] = "#'-+ 0"; int fieldwidth, haveprec, havewidth, mod_ldbl, precision; char convch, nextch; - char *start; + char start[strlen(fmt) + 1]; char **fargv; char *dptr; int l; - start = alloca(strlen(fmt) + 1); - dptr = start; *dptr++ = '%'; *dptr = 0; From owner-svn-src-head@FreeBSD.ORG Sat May 10 23:46:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D720DC33 for ; Sat, 10 May 2014 23:46:27 +0000 (UTC) Received: from mail-qa0-x22c.google.com (mail-qa0-x22c.google.com [IPv6:2607:f8b0:400d:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 912451D04 for ; Sat, 10 May 2014 23:46:27 +0000 (UTC) Received: by mail-qa0-f44.google.com with SMTP id j7so5585293qaq.17 for ; Sat, 10 May 2014 16:46:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=HVIwz25Q3Q0IRQcTfJ0s8BK2Rr2qDlBxXybsfC9PUKo=; b=meVlnf8WGQdZvxM6cF8EWZUCDgAg523Nt5e1cs1VSyF1isZ9qF2xOV2rHzcUUOjaMH 19TT9yzF0yeK9geqgJT4cp2MLHxPnlej5FLM3e4YpDPF4wlduwFDyn5xXQm8dihK/Dsr VV/AFLy+4XG8HK3enIl/Vm/k2kVEqL/CPx7WA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=HVIwz25Q3Q0IRQcTfJ0s8BK2Rr2qDlBxXybsfC9PUKo=; b=h8VwaV97f0wyDkCAM+1+5R+8MLGS3TJU9WuV3HxxkaoBIfA2aIhR0JDp4Yp+EItobp fmjcOhxDkzCEUnRrUPAJ0JD8ezMx/UfFEs4JV1pr1P2HOV0Q5n9X0ZTI7yThfOWjKBHU V5SBZ1fZPucJr7psjrC+kZjOpJXpHzBh1J8EeZYE70qRItTWEve6MnSKhiM3pTkZ0aBA AKD1KRVur1M/MIoJNbZwKub+vA1YFP8jebcLYfxrS6vZCGkItH5kb67y1JwZZAvWCBRa 5WNAy+hjmpmcVweypzepXeUyV7ZCko42tEDO6vVOOtBNwQnmJWHt1UBpRtjXRMB8jgqK rtsw== X-Gm-Message-State: ALoCoQkuWbpYY9LjDCayMr6pTGvWsUamgtBbcngMQNOwHNVGGd34JQ1bQGxb3J0ZsNcxI1ONlBU3 X-Received: by 10.229.79.2 with SMTP id n2mr26410180qck.11.1399765586729; Sat, 10 May 2014 16:46:26 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.42.99 with HTTP; Sat, 10 May 2014 16:45:56 -0700 (PDT) In-Reply-To: <20140510221647.GJ36036@ivaldir.etoilebsd.net> References: <201405101659.s4AGxFcF024753@svn.freebsd.org> <20140510221647.GJ36036@ivaldir.etoilebsd.net> From: Eitan Adler Date: Sat, 10 May 2014 16:45:56 -0700 X-Google-Sender-Auth: sEi8pe2OemcfVDnXwk9P2EFE-F8 Message-ID: Subject: Re: svn commit: r265842 - head To: Baptiste Daroussin Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 May 2014 23:46:27 -0000 On 10 May 2014 15:16, Baptiste Daroussin wrote: > On Sat, May 10, 2014 at 04:59:15PM +0000, Eitan Adler wrote: >> Author: eadler >> Date: Sat May 10 16:59:15 2014 >> New Revision: 265842 >> URL: http://svnweb.freebsd.org/changeset/base/265842 >> >> Log: >> arcconfig: add one >> >> Add a .arcconfig to allow arc to work in its usual way. >> >> Added: >> head/.arcconfig (contents, props changed) >> >> Added: head/.arcconfig >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/.arcconfig Sat May 10 16:59:15 2014 (r265842) >> @@ -0,0 +1,3 @@ >> +{ >> + "phabricator.uri" : "https://phabric.freebsd.org/" >> +} >> _______________________________________________ >> svn-src-all@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/svn-src-all >> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > > You for got the project_id project_id is not used anymore. Its replacement project.name as far I know is not required. Its use is directly tied to certain configuration options which I can not set. I'll let the FreeBSD phabricator admins set that up. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Sun May 11 00:43:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D46AD1CE; Sun, 11 May 2014 00:43:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1E4E20E9; Sun, 11 May 2014 00:43:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4B0h64M040967; Sun, 11 May 2014 00:43:06 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4B0h6B9040965; Sun, 11 May 2014 00:43:06 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405110043.s4B0h6B9040965@svn.freebsd.org> From: Ian Lepore Date: Sun, 11 May 2014 00:43:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265861 - in head/sys: arm/include modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 00:43:06 -0000 Author: ian Date: Sun May 11 00:43:06 2014 New Revision: 265861 URL: http://svnweb.freebsd.org/changeset/base/265861 Log: Make the hardware memory and instruction barrier functions work on armv4 and armv5 as well. Modified: head/sys/arm/include/atomic.h head/sys/modules/Makefile Modified: head/sys/arm/include/atomic.h ============================================================================== --- head/sys/arm/include/atomic.h Sat May 10 22:27:01 2014 (r265860) +++ head/sys/arm/include/atomic.h Sun May 11 00:43:06 2014 (r265861) @@ -58,9 +58,9 @@ #define dsb() __asm __volatile("mcr p15, 0, %0, c7, c10, 4" : : "r" (0) : "memory") #define dmb() __asm __volatile("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory") #else -#define isb() -#define dsb() -#define dmb() +#define isb() __asm __volatile("mcr p15, 0, %0, c7, c5, 4" : : "r" (0) : "memory") +#define dsb() __asm __volatile("mcr p15, 0, %0, c7, c10, 4" : : "r" (0) : "memory") +#define dmb() dsb() #endif #define mb() dmb() Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat May 10 22:27:01 2014 (r265860) +++ head/sys/modules/Makefile Sun May 11 00:43:06 2014 (r265861) @@ -2,6 +2,8 @@ .include +SUBDIR_PARALLEL= + # Modules that include binary-only blobs of microcode should be selectable by # MK_SOURCELESS_UCODE option (see below). From owner-svn-src-head@FreeBSD.ORG Sun May 11 01:19:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05CFB672; Sun, 11 May 2014 01:19:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE9AF2384; Sun, 11 May 2014 01:19:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4B1JtVg054907; Sun, 11 May 2014 01:19:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4B1Jttg054906; Sun, 11 May 2014 01:19:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201405110119.s4B1Jttg054906@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 11 May 2014 01:19:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265862 - head/sys/dev/vt/hw/ofwfb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 01:19:56 -0000 Author: nwhitehorn Date: Sun May 11 01:19:55 2014 New Revision: 265862 URL: http://svnweb.freebsd.org/changeset/base/265862 Log: Make ofwfb actually work again. Apparently the API it was written against still exists but is now silently ignored by the VT core. At least xboxfb needs similar changes. Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Sun May 11 00:43:06 2014 (r265861) +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Sun May 11 01:19:55 2014 (r265862) @@ -58,22 +58,48 @@ struct ofwfb_softc { uint32_t sc_colormap[16]; }; +static vd_probe_t ofwfb_probe; static vd_init_t ofwfb_init; static vd_blank_t ofwfb_blank; static vd_bitbltchr_t ofwfb_bitbltchr; static const struct vt_driver vt_ofwfb_driver = { .vd_name = "ofwfb", + .vd_probe = ofwfb_probe, .vd_init = ofwfb_init, .vd_blank = ofwfb_blank, .vd_bitbltchr = ofwfb_bitbltchr, + .vd_maskbitbltchr = ofwfb_bitbltchr, .vd_priority = VD_PRIORITY_GENERIC+1, }; static struct ofwfb_softc ofwfb_conssoftc; -VT_CONSDEV_DECLARE(vt_ofwfb_driver, PIXEL_WIDTH(1920), PIXEL_HEIGHT(1200), - &ofwfb_conssoftc); -/* XXX: hardcoded max size */ +VT_DRIVER_DECLARE(vt_ofwfb, vt_ofwfb_driver); + +static int +ofwfb_probe(struct vt_device *vd) +{ + phandle_t chosen, node; + ihandle_t stdout; + char type[64]; + + chosen = OF_finddevice("/chosen"); + OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)); + node = OF_instance_to_package(stdout); + if (node == -1) { + /* + * The "/chosen/stdout" does not exist try + * using "screen" directly. + */ + node = OF_finddevice("screen"); + } + OF_getprop(node, "device_type", type, sizeof(type)); + if (strcmp(type, "display") != 0) + return (CN_DEAD); + + /* Looks OK... */ + return (CN_INTERNAL); +} static void ofwfb_blank(struct vt_device *vd, term_color_t color) @@ -218,7 +244,7 @@ ofwfb_initialize(struct vt_device *vd) static int ofwfb_init(struct vt_device *vd) { - struct ofwfb_softc *sc = vd->vd_softc; + struct ofwfb_softc *sc; char type[64]; phandle_t chosen; ihandle_t stdout; @@ -234,6 +260,9 @@ ofwfb_init(struct vt_device *vd) int space; #endif + /* Initialize softc */ + vd->vd_softc = sc = &ofwfb_conssoftc; + chosen = OF_finddevice("/chosen"); OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)); node = OF_instance_to_package(stdout); From owner-svn-src-head@FreeBSD.ORG Sun May 11 01:44:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CEC2AE9B; Sun, 11 May 2014 01:44:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBFAC257F; Sun, 11 May 2014 01:44:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4B1iCh4067409; Sun, 11 May 2014 01:44:12 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4B1iBnK067402; Sun, 11 May 2014 01:44:11 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201405110144.s4B1iBnK067402@svn.freebsd.org> From: Eitan Adler Date: Sun, 11 May 2014 01:44:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265863 - head/lib/libedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 01:44:13 -0000 Author: eadler Date: Sun May 11 01:44:11 2014 New Revision: 265863 URL: http://svnweb.freebsd.org/changeset/base/265863 Log: libedit: add H_SAVE_FP which saves history to a file pointer. H_SAVE_FP is similar to H_SAVE but operates on a FILE* instead of a filename. This is useful when operating in capability mode. Reviewed by: christos@NetBSD.org, pfg Modified: head/lib/libedit/editline.3 head/lib/libedit/hist.h head/lib/libedit/histedit.h head/lib/libedit/history.c Modified: head/lib/libedit/editline.3 ============================================================================== --- head/lib/libedit/editline.3 Sun May 11 01:19:55 2014 (r265862) +++ head/lib/libedit/editline.3 Sun May 11 01:44:11 2014 (r265863) @@ -682,6 +682,9 @@ Load the history list stored in .It Dv H_SAVE , Fa "const char *file" Save the history list to .Fa file . +.It Dv H_SAVE_FP , Fa "FILE*" +Save the history list to the opened +.Fa FILE* . .It Dv H_SETUNIQUE , Fa "int unique" Set flag that adjacent identical event strings should not be entered into the history. Modified: head/lib/libedit/hist.h ============================================================================== --- head/lib/libedit/hist.h Sun May 11 01:19:55 2014 (r265862) +++ head/lib/libedit/hist.h Sun May 11 01:44:11 2014 (r265863) @@ -65,6 +65,7 @@ typedef struct el_history_t { #define HIST_SET(el, num) HIST_FUN(el, H_SET, num) #define HIST_LOAD(el, fname) HIST_FUN(el, H_LOAD fname) #define HIST_SAVE(el, fname) HIST_FUN(el, H_SAVE fname) +#define HIST_SAVE_FP(el, fp) HIST_FUN(el, H_SAVE_FP fp) protected int hist_init(EditLine *); protected void hist_end(EditLine *); Modified: head/lib/libedit/histedit.h ============================================================================== --- head/lib/libedit/histedit.h Sun May 11 01:19:55 2014 (r265862) +++ head/lib/libedit/histedit.h Sun May 11 01:44:11 2014 (r265863) @@ -208,6 +208,7 @@ int history(History *, HistEvent *, int #define H_NEXT_EVDATA 23 /* , const int, histdata_t *); */ #define H_DELDATA 24 /* , int, histdata_t *);*/ #define H_REPLACE 25 /* , const char *, histdata_t); */ +#define H_SAVE_FP 26 /* , FILE*); */ /* Modified: head/lib/libedit/history.c ============================================================================== --- head/lib/libedit/history.c Sun May 11 01:19:55 2014 (r265862) +++ head/lib/libedit/history.c Sun May 11 01:44:11 2014 (r265863) @@ -103,6 +103,7 @@ private int history_getunique(History *, private int history_set_fun(History *, History *); private int history_load(History *, const char *); private int history_save(History *, const char *); +private int history_save_fp(History *, FILE*); private int history_prev_event(History *, HistEvent *, int); private int history_next_event(History *, HistEvent *, int); private int history_next_string(History *, HistEvent *, const char *); @@ -773,22 +774,16 @@ done: return (i); } - -/* history_save(): - * History save function +/* history_save_fp(): + * History save with open FILE* */ -private int -history_save(History *h, const char *fname) +private int history_save_fp(History *h, FILE* fp) { - FILE *fp; HistEvent ev; int i = -1, retval; size_t len, max_size; char *ptr; - if ((fp = fopen(fname, "w")) == NULL) - return (-1); - if (fchmod(fileno(fp), S_IRUSR|S_IWUSR) == -1) goto done; if (fputs(hist_cookie, fp) == EOF) @@ -816,6 +811,26 @@ history_save(History *h, const char *fna oomem: h_free((ptr_t)ptr); done: + return (i); + +} + + +/* history_save(): + * History save function + */ +private int +history_save(History *h, const char *fname) +{ + FILE *fp; + int i; + + if ((fp = fopen(fname, "w")) == NULL) + return (-1); + + i = history_save_fp(h, fp); + +done: (void) fclose(fp); return (i); } @@ -1001,6 +1016,12 @@ history(History *h, HistEvent *ev, int f he_seterrev(ev, _HE_HIST_WRITE); break; + case H_SAVE_FP: + retval = history_save_fp(h, va_arg(va, FILE*)); + if (retval == -1) + he_seterrev(ev, _HE_HIST_WRITE); + break; + case H_PREV_EVENT: retval = history_prev_event(h, ev, va_arg(va, int)); break; From owner-svn-src-head@FreeBSD.ORG Sun May 11 01:58:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4015930A; Sun, 11 May 2014 01:58:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D28E262E; Sun, 11 May 2014 01:58:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4B1wvu6072382; Sun, 11 May 2014 01:58:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4B1wvFA072381; Sun, 11 May 2014 01:58:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201405110158.s4B1wvFA072381@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 11 May 2014 01:58:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265864 - head/sys/dev/vt/hw/ofwfb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 01:58:57 -0000 Author: nwhitehorn Date: Sun May 11 01:58:56 2014 New Revision: 265864 URL: http://svnweb.freebsd.org/changeset/base/265864 Log: Make ofwfb not be painfully slow. This reduces the time for a verbose boot on my G4 iBook by more than half. Still 10% slower than syscons, but that's much better than a factor of 2. The slowness had to do with pathological write performance on 8-bit framebuffers, which are almost universally used on Open Firmware systems. Writing 1 byte at a time, potentially nonconsecutively, resulted in many extra PCI write cycles. This patch, in the common case where it's writing one or several characters in an 8x8 font, gangs the writes together into a set of 32-bit writes. This is a port of r143830 to vt(4). The EFI framebuffer is also extremely slow, probably for the same reason, and the same patch will likely help there. Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Sun May 11 01:44:11 2014 (r265863) +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Sun May 11 01:58:56 2014 (r265864) @@ -136,6 +136,10 @@ ofwfb_bitbltchr(struct vt_device *vd, co uint32_t fgc, bgc; int c; uint8_t b, m; + union { + uint32_t l; + uint8_t c[4]; + } ch1, ch2; fgc = sc->sc_colormap[fg]; bgc = sc->sc_colormap[bg]; @@ -147,36 +151,70 @@ ofwfb_bitbltchr(struct vt_device *vd, co return; line = (sc->sc_stride * top) + left * sc->sc_depth/8; - for (; height > 0; height--) { - for (c = 0; c < width; c++) { - if (c % 8 == 0) + if (mask == NULL && sc->sc_depth == 8 && (width % 8 == 0)) { + for (; height > 0; height--) { + for (c = 0; c < width; c += 8) { b = *src++; - else - b <<= 1; - if (mask != NULL) { + + /* + * Assume that there is more background than + * foreground in characters and init accordingly + */ + ch1.l = ch2.l = (bg << 24) | (bg << 16) | + (bg << 8) | bg; + + /* + * Calculate 2 x 4-chars at a time, and then + * write these out. + */ + if (b & 0x80) ch1.c[0] = fg; + if (b & 0x40) ch1.c[1] = fg; + if (b & 0x20) ch1.c[2] = fg; + if (b & 0x10) ch1.c[3] = fg; + + if (b & 0x08) ch2.c[0] = fg; + if (b & 0x04) ch2.c[1] = fg; + if (b & 0x02) ch2.c[2] = fg; + if (b & 0x01) ch2.c[3] = fg; + + *(uint32_t *)(sc->sc_addr + line + c) = ch1.l; + *(uint32_t *)(sc->sc_addr + line + c + 4) = + ch2.l; + } + line += sc->sc_stride; + } + } else { + for (; height > 0; height--) { + for (c = 0; c < width; c++) { if (c % 8 == 0) - m = *mask++; + b = *src++; else - m <<= 1; - /* Skip pixel write, if mask has no bit set. */ - if ((m & 0x80) == 0) - continue; - } - switch(sc->sc_depth) { - case 8: - *(uint8_t *)(sc->sc_addr + line + c) = - b & 0x80 ? fg : bg; - break; - case 32: - *(uint32_t *)(sc->sc_addr + line + 4*c) = - (b & 0x80) ? fgc : bgc; - break; - default: - /* panic? */ - break; + b <<= 1; + if (mask != NULL) { + if (c % 8 == 0) + m = *mask++; + else + m <<= 1; + /* Skip pixel write, if mask not set. */ + if ((m & 0x80) == 0) + continue; + } + switch(sc->sc_depth) { + case 8: + *(uint8_t *)(sc->sc_addr + line + c) = + b & 0x80 ? fg : bg; + break; + case 32: + *(uint32_t *)(sc->sc_addr + line + 4*c) + = (b & 0x80) ? fgc : bgc; + break; + default: + /* panic? */ + break; + } } + line += sc->sc_stride; } - line += sc->sc_stride; } } From owner-svn-src-head@FreeBSD.ORG Sun May 11 02:00:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D44C476; Sun, 11 May 2014 02:00:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ADB12647; Sun, 11 May 2014 02:00:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4B20ndt073239; Sun, 11 May 2014 02:00:49 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4B20mHp073237; Sun, 11 May 2014 02:00:48 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201405110200.s4B20mHp073237@svn.freebsd.org> From: Eitan Adler Date: Sun, 11 May 2014 02:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265865 - head/usr.bin/look X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 02:00:49 -0000 Author: eadler Date: Sun May 11 02:00:48 2014 New Revision: 265865 URL: http://svnweb.freebsd.org/changeset/base/265865 Log: look(1): add compability with other implementations. On other implementations 'look -a' uses an alternate dictionary. Since we don't have one, just ignore it. Modified: head/usr.bin/look/look.1 head/usr.bin/look/look.c Modified: head/usr.bin/look/look.1 ============================================================================== --- head/usr.bin/look/look.1 Sun May 11 01:58:56 2014 (r265864) +++ head/usr.bin/look/look.1 Sun May 11 02:00:48 2014 (r265865) @@ -103,6 +103,10 @@ in comparisons when the option was specified. This was incorrect and the current man page matches the historic implementation. +.Pp +The +.Fl a +flag is ignored for compability. .Sh SEE ALSO .Xr grep 1 , .Xr sort 1 Modified: head/usr.bin/look/look.c ============================================================================== --- head/usr.bin/look/look.c Sun May 11 01:58:56 2014 (r265864) +++ head/usr.bin/look/look.c Sun May 11 02:00:48 2014 (r265865) @@ -102,8 +102,11 @@ main(int argc, char *argv[]) file = _path_words; termchar = L'\0'; - while ((ch = getopt(argc, argv, "dft:")) != -1) + while ((ch = getopt(argc, argv, "adft:")) != -1) switch(ch) { + case 'a': + /* COMPATIBILITY */ + break; case 'd': dflag = 1; break; From owner-svn-src-head@FreeBSD.ORG Sun May 11 02:04:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95FB565F; Sun, 11 May 2014 02:04:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 838C426C3; Sun, 11 May 2014 02:04:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4B24eIu076458; Sun, 11 May 2014 02:04:40 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4B24e2W076456; Sun, 11 May 2014 02:04:40 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201405110204.s4B24e2W076456@svn.freebsd.org> From: Eitan Adler Date: Sun, 11 May 2014 02:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265866 - head/usr.bin/mesg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 02:04:40 -0000 Author: eadler Date: Sun May 11 02:04:40 2014 New Revision: 265866 URL: http://svnweb.freebsd.org/changeset/base/265866 Log: mesg: remove advertising clause The University of California board of trustees has given permission to remove the advertising clause of all software attributed to it. Modified: head/usr.bin/mesg/mesg.c Modified: head/usr.bin/mesg/mesg.c ============================================================================== --- head/usr.bin/mesg/mesg.c Sun May 11 02:00:48 2014 (r265865) +++ head/usr.bin/mesg/mesg.c Sun May 11 02:04:40 2014 (r265866) @@ -15,11 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * From owner-svn-src-head@FreeBSD.ORG Sun May 11 02:16:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B1B0A1C; Sun, 11 May 2014 02:16:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5805A2783; Sun, 11 May 2014 02:16:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4B2G9kn081374; Sun, 11 May 2014 02:16:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4B2G9Z7081373; Sun, 11 May 2014 02:16:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201405110216.s4B2G9Z7081373@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 11 May 2014 02:16:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265867 - head/sys/dev/vt/hw/ofwfb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 02:16:09 -0000 Author: nwhitehorn Date: Sun May 11 02:16:08 2014 New Revision: 265867 URL: http://svnweb.freebsd.org/changeset/base/265867 Log: Port over mmap routine from syscons. This lets X11 work on PowerPC with vt. The last obstacle to switching PowerPC entirely to vt is that the Playstation 3 framebuffer driver needs to be ported over. This only applies for powerpc64, however. Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Sun May 11 02:04:40 2014 (r265866) +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Sun May 11 02:16:08 2014 (r265867) @@ -49,6 +49,10 @@ __FBSDID("$FreeBSD$"); struct ofwfb_softc { phandle_t sc_node; + struct ofw_pci_register sc_pciaddrs[8]; + int sc_num_pciaddrs; + + intptr_t sc_addr; int sc_depth; int sc_stride; @@ -62,6 +66,7 @@ static vd_probe_t ofwfb_probe; static vd_init_t ofwfb_init; static vd_blank_t ofwfb_blank; static vd_bitbltchr_t ofwfb_bitbltchr; +static vd_fb_mmap_t ofwfb_mmap; static const struct vt_driver vt_ofwfb_driver = { .vd_name = "ofwfb", @@ -70,6 +75,7 @@ static const struct vt_driver vt_ofwfb_d .vd_blank = ofwfb_blank, .vd_bitbltchr = ofwfb_bitbltchr, .vd_maskbitbltchr = ofwfb_bitbltchr, + .vd_fb_mmap = ofwfb_mmap, .vd_priority = VD_PRIORITY_GENERIC+1, }; @@ -288,8 +294,6 @@ ofwfb_init(struct vt_device *vd) ihandle_t stdout; phandle_t node; uint32_t depth, height, width; - struct ofw_pci_register pciaddrs[8]; - int n_pciaddrs; uint32_t fb_phys; int i, len; #ifdef __sparc64__ @@ -343,15 +347,15 @@ ofwfb_init(struct vt_device *vd) * child of the PCI device: in that case, try the parent for * the assigned-addresses property. */ - len = OF_getprop(node, "assigned-addresses", pciaddrs, - sizeof(pciaddrs)); + len = OF_getprop(node, "assigned-addresses", sc->sc_pciaddrs, + sizeof(sc->sc_pciaddrs)); if (len == -1) { len = OF_getprop(OF_parent(node), "assigned-addresses", - pciaddrs, sizeof(pciaddrs)); + sc->sc_pciaddrs, sizeof(sc->sc_pciaddrs)); } if (len == -1) len = 0; - n_pciaddrs = len / sizeof(struct ofw_pci_register); + sc->sc_num_pciaddrs = len / sizeof(struct ofw_pci_register); /* * Grab the physical address of the framebuffer, and then map it @@ -381,13 +385,13 @@ ofwfb_init(struct vt_device *vd) * Linux does the same thing. */ - fb_phys = n_pciaddrs; - for (i = 0; i < n_pciaddrs; i++) { + fb_phys = sc->sc_num_pciaddrs; + for (i = 0; i < sc->sc_num_pciaddrs; i++) { /* If it is too small, not the framebuffer */ - if (pciaddrs[i].size_lo < sc->sc_stride*height) + if (sc->sc_pciaddrs[i].size_lo < sc->sc_stride*height) continue; /* If it is not memory, it isn't either */ - if (!(pciaddrs[i].phys_hi & + if (!(sc->sc_pciaddrs[i].phys_hi & OFW_PCI_PHYS_HI_SPACE_MEM32)) continue; @@ -395,11 +399,12 @@ ofwfb_init(struct vt_device *vd) fb_phys = i; /* If it is prefetchable, it certainly is */ - if (pciaddrs[i].phys_hi & OFW_PCI_PHYS_HI_PREFETCHABLE) + if (sc->sc_pciaddrs[i].phys_hi & + OFW_PCI_PHYS_HI_PREFETCHABLE) break; } - if (fb_phys == n_pciaddrs) /* No candidates found */ + if (fb_phys == sc->sc_num_pciaddrs) /* No candidates found */ return (CN_DEAD); #if defined(__powerpc__) @@ -416,3 +421,37 @@ ofwfb_init(struct vt_device *vd) return (CN_INTERNAL); } +static int +ofwfb_mmap(struct vt_device *vd, vm_ooffset_t offset, vm_paddr_t *paddr, + int prot, vm_memattr_t *memattr) +{ + struct ofwfb_softc *sc = vd->vd_softc; + int i; + + /* + * Make sure the requested address lies within the PCI device's + * assigned addrs + */ + for (i = 0; i < sc->sc_num_pciaddrs; i++) + if (offset >= sc->sc_pciaddrs[i].phys_lo && + offset < (sc->sc_pciaddrs[i].phys_lo + sc->sc_pciaddrs[i].size_lo)) + { + /* + * If this is a prefetchable BAR, we can (and should) + * enable write-combining. + */ + if (sc->sc_pciaddrs[i].phys_hi & + OFW_PCI_PHYS_HI_PREFETCHABLE) + *memattr = VM_MEMATTR_WRITE_COMBINING; + + *paddr = offset; + return (0); + } + + /* + * Hack for Radeon... + */ + *paddr = offset; + return (0); +} + From owner-svn-src-head@FreeBSD.ORG Sun May 11 02:18:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D59D4B62; Sun, 11 May 2014 02:18:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C32232791; Sun, 11 May 2014 02:18:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4B2IH1u081676; Sun, 11 May 2014 02:18:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4B2IH6X081675; Sun, 11 May 2014 02:18:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201405110218.s4B2IH6X081675@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 11 May 2014 02:18:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265868 - head/sys/powerpc/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 02:18:17 -0000 Author: nwhitehorn Date: Sun May 11 02:18:17 2014 New Revision: 265868 URL: http://svnweb.freebsd.org/changeset/base/265868 Log: Use vt(4) by default on 32-bit PowerPC now that it is fully functional and fast. 64-bit PowerPC will follow along once the PS3 framebuffer driver is adapted. Modified: head/sys/powerpc/conf/GENERIC Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Sun May 11 02:16:08 2014 (r265867) +++ head/sys/powerpc/conf/GENERIC Sun May 11 02:18:17 2014 (r265868) @@ -121,12 +121,9 @@ device sa # Sequential Access (tape et device cd # CD device pass # Passthrough device (direct ATA/SCSI access) -# syscons is the default console driver, resembling an SCO console -device sc +# vt is the default console driver, resembling an SCO console +device vt # Generic console driver (pulls in OF FB) device kbdmux -options SC_OFWFB # OFW frame buffer -options SC_DFLT_FONT # compile font in -makeoptions SC_DFLT_FONT=cp437 # Serial (COM) ports device scc From owner-svn-src-head@FreeBSD.ORG Sun May 11 03:17:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43A953BC; Sun, 11 May 2014 03:17:58 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id F20762BE0; Sun, 11 May 2014 03:17:57 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id EE0DD780D1D; Sun, 11 May 2014 13:17:53 +1000 (EST) Date: Sun, 11 May 2014 13:17:46 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r265845 - head/lib/libc/gen In-Reply-To: <201405101859.s4AIxAor079383@svn.freebsd.org> Message-ID: <20140511125426.P989@besplex.bde.org> References: <201405101859.s4AIxAor079383@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eojmkOZX c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=vaJPxeoEahUA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=QpLNrAYZXdHN2xdo1PsA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 03:17:58 -0000 On Sat, 10 May 2014, Konstantin Belousov wrote: > Log: > Style. Thanks, but this adds a style bug of the same type as one that it removes. > Modified: head/lib/libc/gen/sem_new.c > ============================================================================== > --- head/lib/libc/gen/sem_new.c Sat May 10 17:42:21 2014 (r265844) > +++ head/lib/libc/gen/sem_new.c Sat May 10 18:59:09 2014 (r265845) > @@ -294,13 +294,13 @@ _sem_unlink(const char *name) > return -1; > } > name++; > - Was an extra blank line. > strcpy(path, SEM_PREFIX); > if (strlcat(path, name, sizeof(path)) >= sizeof(path)) { > errno = ENAMETOOLONG; > return (-1); > } > - return unlink(path); > + Now an extra blank line. > + return (unlink(path)); > } > > int Statements are not separated by blank lines in KNF except in exceptional circumstances. In strict KNF, even blocks starting with a block comment are not separated by blank lines. This is too much for me, so my rule is to always use blank lines for sections beginning with a comment and rarely use them otherwise (maybe every 20 lines). This file has several other style bugs. indent(1) fixes the following formatting ones: - trailing whitespace - missing indentation in struct declaration - doubled spaces after &ma - several more instances of an extra blank line - missing spaces around binary operators (about 10 instances) - non-cuddled else - non-KNF continuation indentation - missing space after 'while' indent(1) doesn't understand its own -lp option and fails to fix long lines and otherwise miswrapped lines, except for the continuation indentation. Variant formatting of extra blank lines (to remove the one that you removed and add the one that you added) would be impossibly difficult for indent(1) to fix or preserve. Non-formatting style bugs are harder to fix. Altogether, there are style bugs on about 10% of lines. Below average ugliness. Bruce From owner-svn-src-head@FreeBSD.ORG Sun May 11 04:18:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90FD0B9F; Sun, 11 May 2014 04:18:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EDA42F50; Sun, 11 May 2014 04:18:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4B4Ip1f035240; Sun, 11 May 2014 04:18:51 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4B4Ip4p035239; Sun, 11 May 2014 04:18:51 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201405110418.s4B4Ip4p035239@svn.freebsd.org> From: Peter Grehan Date: Sun, 11 May 2014 04:18:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265869 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 04:18:51 -0000 Author: grehan Date: Sun May 11 04:18:51 2014 New Revision: 265869 URL: http://svnweb.freebsd.org/changeset/base/265869 Log: Enable SMP for Exynos-based platforms (i.e. Chromebook) Reviewed by: br Modified: head/sys/arm/conf/EXYNOS5250.common Modified: head/sys/arm/conf/EXYNOS5250.common ============================================================================== --- head/sys/arm/conf/EXYNOS5250.common Sun May 11 02:18:17 2014 (r265868) +++ head/sys/arm/conf/EXYNOS5250.common Sun May 11 04:18:51 2014 (r265869) @@ -83,7 +83,7 @@ device sdhci # generic sdhci options ROOTDEVNAME=\"ufs:/dev/da0\" -#options SMP +options SMP # Pseudo devices From owner-svn-src-head@FreeBSD.ORG Sun May 11 04:24:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47A3BD2C; Sun, 11 May 2014 04:24:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A64C2FE2; Sun, 11 May 2014 04:24:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4B4Ow8v039004; Sun, 11 May 2014 04:24:58 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4B4Ov8w039000; Sun, 11 May 2014 04:24:57 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405110424.s4B4Ov8w039000@svn.freebsd.org> From: Ian Lepore Date: Sun, 11 May 2014 04:24:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265870 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 04:24:58 -0000 Author: ian Date: Sun May 11 04:24:57 2014 New Revision: 265870 URL: http://svnweb.freebsd.org/changeset/base/265870 Log: Add cpu_l2cache_drain_writebuf(), use it to implement generic_bs_barrier(). On modern ARM SoCs the L2 cache controller sits between the CPU and the AXI bus, and most on-chip memory-mapped devices are on the AXI bus. We map the device registers using the 'Device' memory attribute, which means the memory is not cached, but writes to it are buffered. Ensuring that a write has made it all the way to a device may require that the L2 controller take some action. There is currently only one implementation of the new function, for the PL310 cache controller. It invokes a function that the controller manual calls "cache sync" but it actually has nothing to do with cache at all, it triggers a drain of all pending store buffer writes and it blocks until they complete. The sheeva and xscale L2 controllers (which predate the concept of Device memory) don't seem to have a corresponding function. It appears that the standard armv5 drain_writebuf function includes draining all the way through the L2 controller. Modified: head/sys/arm/arm/bus_space_generic.c head/sys/arm/arm/cpufunc.c head/sys/arm/arm/pl310.c head/sys/arm/include/cpufunc.h Modified: head/sys/arm/arm/bus_space_generic.c ============================================================================== --- head/sys/arm/arm/bus_space_generic.c Sun May 11 04:18:51 2014 (r265869) +++ head/sys/arm/arm/bus_space_generic.c Sun May 11 04:24:57 2014 (r265870) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include /* Prototypes for all the bus_space structure functions */ @@ -110,5 +111,16 @@ generic_bs_barrier(void *t, bus_space_ha bus_size_t len, int flags) { - /* Nothing to do. */ + /* + * dsb() will drain the L1 write buffer and establish a memory access + * barrier point on platforms where that has meaning. On a write we + * also need to drain the L2 write buffer, because most on-chip memory + * mapped devices are downstream of the L2 cache. Note that this needs + * to be done even for memory mapped as Device type, because while + * Device memory is not cached, writes to it are still buffered. + */ + dsb(); + if (flags & BUS_SPACE_BARRIER_WRITE) { + cpu_l2cache_drain_writebuf(); + } } Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Sun May 11 04:18:51 2014 (r265869) +++ head/sys/arm/arm/cpufunc.c Sun May 11 04:24:57 2014 (r265870) @@ -150,6 +150,7 @@ struct cpu_functions arm9_cpufuncs = { (void *)cpufunc_nullop, /* l2cache_wbinv_range */ (void *)cpufunc_nullop, /* l2cache_inv_range */ (void *)cpufunc_nullop, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -214,6 +215,7 @@ struct cpu_functions armv5_ec_cpufuncs = (void *)cpufunc_nullop, /* l2cache_wbinv_range */ (void *)cpufunc_nullop, /* l2cache_inv_range */ (void *)cpufunc_nullop, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -276,6 +278,7 @@ struct cpu_functions sheeva_cpufuncs = { sheeva_l2cache_wbinv_range, /* l2cache_wbinv_range */ sheeva_l2cache_inv_range, /* l2cache_inv_range */ sheeva_l2cache_wb_range, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -338,6 +341,7 @@ struct cpu_functions arm10_cpufuncs = { (void *)cpufunc_nullop, /* l2cache_wbinv_range */ (void *)cpufunc_nullop, /* l2cache_inv_range */ (void *)cpufunc_nullop, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -401,6 +405,7 @@ struct cpu_functions pj4bv7_cpufuncs = { (void *)cpufunc_nullop, /* l2cache_wbinv_range */ (void *)cpufunc_nullop, /* l2cache_inv_range */ (void *)cpufunc_nullop, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -466,6 +471,7 @@ struct cpu_functions xscale_cpufuncs = { (void *)cpufunc_nullop, /* l2cache_wbinv_range */ (void *)cpufunc_nullop, /* l2cache_inv_range */ (void *)cpufunc_nullop, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -530,6 +536,7 @@ struct cpu_functions xscalec3_cpufuncs = xscalec3_l2cache_purge_rng, /* l2cache_wbinv_range */ xscalec3_l2cache_flush_rng, /* l2cache_inv_range */ xscalec3_l2cache_clean_rng, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -593,6 +600,7 @@ struct cpu_functions fa526_cpufuncs = { (void *)cpufunc_nullop, /* l2cache_wbinv_range */ (void *)cpufunc_nullop, /* l2cache_inv_range */ (void *)cpufunc_nullop, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -656,6 +664,7 @@ struct cpu_functions arm1136_cpufuncs = (void *)cpufunc_nullop, /* l2cache_wbinv_range */ (void *)cpufunc_nullop, /* l2cache_inv_range */ (void *)cpufunc_nullop, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -718,6 +727,7 @@ struct cpu_functions arm1176_cpufuncs = (void *)cpufunc_nullop, /* l2cache_wbinv_range */ (void *)cpufunc_nullop, /* l2cache_inv_range */ (void *)cpufunc_nullop, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ @@ -789,6 +799,7 @@ struct cpu_functions cortexa_cpufuncs = (void *)cpufunc_nullop, /* l2cache_wbinv_range */ (void *)cpufunc_nullop, /* l2cache_inv_range */ (void *)cpufunc_nullop, /* l2cache_wb_range */ + (void *)cpufunc_nullop, /* l2cache_drain_writebuf */ /* Other functions */ Modified: head/sys/arm/arm/pl310.c ============================================================================== --- head/sys/arm/arm/pl310.c Sun May 11 04:18:51 2014 (r265869) +++ head/sys/arm/arm/pl310.c Sun May 11 04:24:57 2014 (r265870) @@ -350,6 +350,18 @@ pl310_inv_range(vm_paddr_t start, vm_siz } static void +pl310_drain_writebuf(void) +{ + + if ((pl310_softc == NULL) || !pl310_softc->sc_enabled) + return; + + PL310_LOCK(pl310_softc); + pl310_cache_sync(); + PL310_UNLOCK(pl310_softc); +} + +static void pl310_set_way_sizes(struct pl310_softc *sc) { uint32_t aux_value; @@ -484,6 +496,7 @@ pl310_attach(device_t dev) cpufuncs.cf_l2cache_wbinv_range = pl310_wbinv_range; cpufuncs.cf_l2cache_inv_range = pl310_inv_range; cpufuncs.cf_l2cache_wb_range = pl310_wb_range; + cpufuncs.cf_l2cache_drain_writebuf = pl310_drain_writebuf; return (0); } Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Sun May 11 04:18:51 2014 (r265869) +++ head/sys/arm/include/cpufunc.h Sun May 11 04:24:57 2014 (r265870) @@ -151,6 +151,7 @@ struct cpu_functions { void (*cf_l2cache_wbinv_range) (vm_offset_t, vm_size_t); void (*cf_l2cache_inv_range) (vm_offset_t, vm_size_t); void (*cf_l2cache_wb_range) (vm_offset_t, vm_size_t); + void (*cf_l2cache_drain_writebuf) (void); /* Other functions */ @@ -252,6 +253,7 @@ void tlb_broadcast(int); #define cpu_l2cache_wb_range(a, s) cpufuncs.cf_l2cache_wb_range((a), (s)) #define cpu_l2cache_inv_range(a, s) cpufuncs.cf_l2cache_inv_range((a), (s)) #define cpu_l2cache_wbinv_range(a, s) cpufuncs.cf_l2cache_wbinv_range((a), (s)) +#define cpu_l2cache_drain_writebuf() cpufuncs.cf_l2cache_drain_writebuf() #define cpu_flush_prefetchbuf() cpufuncs.cf_flush_prefetchbuf() #define cpu_drain_writebuf() cpufuncs.cf_drain_writebuf() From owner-svn-src-head@FreeBSD.ORG Sun May 11 05:49:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1930B6E4; Sun, 11 May 2014 05:49:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04F4224AD; Sun, 11 May 2014 05:49:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4B5nZtQ073916; Sun, 11 May 2014 05:49:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4B5nZ0O073913; Sun, 11 May 2014 05:49:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201405110549.s4B5nZ0O073913@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 11 May 2014 05:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265871 - in head/sys: conf powerpc/conf powerpc/ps3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 05:49:36 -0000 Author: nwhitehorn Date: Sun May 11 05:49:35 2014 New Revision: 265871 URL: http://svnweb.freebsd.org/changeset/base/265871 Log: Move the PS3 framebuffer console to use vt instead of syscons and adjust GENERIC64 for PowerPC to use vt with it. Much to my chagrin, PS3 support seems to have bitrotted somewhat since the last time I tried it. ehci panics on attach and interrupt handling seems to be faulty. This should be fixed soon... Modified: head/sys/conf/files.powerpc head/sys/powerpc/conf/GENERIC64 head/sys/powerpc/ps3/ps3_syscons.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun May 11 04:24:57 2014 (r265870) +++ head/sys/conf/files.powerpc Sun May 11 05:49:35 2014 (r265871) @@ -222,8 +222,8 @@ powerpc/ps3/ps3bus.c optional ps3 powerpc/ps3/ps3cdrom.c optional ps3 scbus powerpc/ps3/ps3disk.c optional ps3 powerpc/ps3/ps3pic.c optional ps3 -powerpc/ps3/ps3_syscons.c optional ps3 sc -powerpc/ps3/ps3-hvcall.S optional ps3 sc +powerpc/ps3/ps3_syscons.c optional ps3 vt +powerpc/ps3/ps3-hvcall.S optional ps3 powerpc/pseries/phyp-hvcall.S optional pseries powerpc64 powerpc/pseries/mmu_phyp.c optional pseries powerpc64 powerpc/pseries/phyp_console.c optional pseries powerpc64 uart Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Sun May 11 04:24:57 2014 (r265870) +++ head/sys/powerpc/conf/GENERIC64 Sun May 11 05:49:35 2014 (r265871) @@ -119,12 +119,9 @@ device sa # Sequential Access (tape et device cd # CD device pass # Passthrough device (direct ATA/SCSI access) -# syscons is the default console driver, resembling an SCO console -device sc +# vt is the default console driver, resembling an SCO console +device vt # Core console driver device kbdmux -options SC_OFWFB # OFW frame buffer -options SC_DFLT_FONT # compile font in -makeoptions SC_DFLT_FONT=cp437 # Serial (COM) ports device scc Modified: head/sys/powerpc/ps3/ps3_syscons.c ============================================================================== --- head/sys/powerpc/ps3/ps3_syscons.c Sun May 11 04:24:57 2014 (r265870) +++ head/sys/powerpc/ps3/ps3_syscons.c Sun May 11 05:49:35 2014 (r265871) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2003 Peter Grehan + * Copyright (c) 2011-2014 Nathan Whitehorn * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,31 +29,22 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include #include #include -#include -#include -#include #include -#include #include #include -#include -#include #include #include -#include - -#include -#include +#include +#include +#include #include "ps3-hvcall.h" @@ -65,62 +56,12 @@ __FBSDID("$FreeBSD$"); #define L1GPU_DISPLAY_SYNC_VSYNC 2 #define L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP 0x0102 -extern u_char dflt_font_16[]; -extern u_char dflt_font_14[]; -extern u_char dflt_font_8[]; - -static int ps3fb_configure(int flags); +static vd_init_t ps3fb_init; +static vd_probe_t ps3fb_probe; void ps3fb_remap(void); -static vi_probe_t ps3fb_probe; -static vi_init_t ps3fb_init; -static vi_get_info_t ps3fb_get_info; -static vi_query_mode_t ps3fb_query_mode; -static vi_set_mode_t ps3fb_set_mode; -static vi_save_font_t ps3fb_save_font; -static vi_load_font_t ps3fb_load_font; -static vi_show_font_t ps3fb_show_font; -static vi_save_palette_t ps3fb_save_palette; -static vi_load_palette_t ps3fb_load_palette; -static vi_set_border_t ps3fb_set_border; -static vi_save_state_t ps3fb_save_state; -static vi_load_state_t ps3fb_load_state; -static vi_set_win_org_t ps3fb_set_win_org; -static vi_read_hw_cursor_t ps3fb_read_hw_cursor; -static vi_set_hw_cursor_t ps3fb_set_hw_cursor; -static vi_set_hw_cursor_shape_t ps3fb_set_hw_cursor_shape; -static vi_blank_display_t ps3fb_blank_display; -static vi_mmap_t ps3fb_mmap; -static vi_ioctl_t ps3fb_ioctl; -static vi_clear_t ps3fb_clear; -static vi_fill_rect_t ps3fb_fill_rect; -static vi_bitblt_t ps3fb_bitblt; -static vi_diag_t ps3fb_diag; -static vi_save_cursor_palette_t ps3fb_save_cursor_palette; -static vi_load_cursor_palette_t ps3fb_load_cursor_palette; -static vi_copy_t ps3fb_copy; -static vi_putp_t ps3fb_putp; -static vi_putc_t ps3fb_putc; -static vi_puts_t ps3fb_puts; -static vi_putm_t ps3fb_putm; - struct ps3fb_softc { - video_adapter_t sc_va; - struct cdev *sc_si; - int sc_console; - - intptr_t sc_addr; - int sc_height; - int sc_width; - int sc_stride; - int sc_ncol; - int sc_nrow; - - int sc_xmargin; - int sc_ymargin; - - u_char *sc_font; - int sc_font_height; + struct fb_info fb_info; uint64_t sc_fbhandle; uint64_t sc_fbcontext; @@ -130,106 +71,22 @@ struct ps3fb_softc { uint64_t sc_reports_size; }; -static video_switch_t ps3fbvidsw = { - .probe = ps3fb_probe, - .init = ps3fb_init, - .get_info = ps3fb_get_info, - .query_mode = ps3fb_query_mode, - .set_mode = ps3fb_set_mode, - .save_font = ps3fb_save_font, - .load_font = ps3fb_load_font, - .show_font = ps3fb_show_font, - .save_palette = ps3fb_save_palette, - .load_palette = ps3fb_load_palette, - .set_border = ps3fb_set_border, - .save_state = ps3fb_save_state, - .load_state = ps3fb_load_state, - .set_win_org = ps3fb_set_win_org, - .read_hw_cursor = ps3fb_read_hw_cursor, - .set_hw_cursor = ps3fb_set_hw_cursor, - .set_hw_cursor_shape = ps3fb_set_hw_cursor_shape, - .blank_display = ps3fb_blank_display, - .mmap = ps3fb_mmap, - .ioctl = ps3fb_ioctl, - .clear = ps3fb_clear, - .fill_rect = ps3fb_fill_rect, - .bitblt = ps3fb_bitblt, - .diag = ps3fb_diag, - .save_cursor_palette = ps3fb_save_cursor_palette, - .load_cursor_palette = ps3fb_load_cursor_palette, - .copy = ps3fb_copy, - .putp = ps3fb_putp, - .putc = ps3fb_putc, - .puts = ps3fb_puts, - .putm = ps3fb_putm, -}; - -VIDEO_DRIVER(ps3fb, ps3fbvidsw, ps3fb_configure); - -extern sc_rndr_sw_t txtrndrsw; -RENDERER(ps3fb, 0, txtrndrsw, gfb_set); - -RENDERER_MODULE(ps3fb, gfb_set); - -/* - * Define the iso6429-1983 colormap - */ -static struct { - uint8_t red; - uint8_t green; - uint8_t blue; -} ps3fb_cmap[16] = { /* # R G B Color */ - /* - - - - ----- */ - { 0x00, 0x00, 0x00 }, /* 0 0 0 0 Black */ - { 0x00, 0x00, 0xaa }, /* 1 0 0 2/3 Blue */ - { 0x00, 0xaa, 0x00 }, /* 2 0 2/3 0 Green */ - { 0x00, 0xaa, 0xaa }, /* 3 0 2/3 2/3 Cyan */ - { 0xaa, 0x00, 0x00 }, /* 4 2/3 0 0 Red */ - { 0xaa, 0x00, 0xaa }, /* 5 2/3 0 2/3 Magenta */ - { 0xaa, 0x55, 0x00 }, /* 6 2/3 1/3 0 Brown */ - { 0xaa, 0xaa, 0xaa }, /* 7 2/3 2/3 2/3 White */ - { 0x55, 0x55, 0x55 }, /* 8 1/3 1/3 1/3 Gray */ - { 0x55, 0x55, 0xff }, /* 9 1/3 1/3 1 Bright Blue */ - { 0x55, 0xff, 0x55 }, /* 10 1/3 1 1/3 Bright Green */ - { 0x55, 0xff, 0xff }, /* 11 1/3 1 1 Bright Cyan */ - { 0xff, 0x55, 0x55 }, /* 12 1 1/3 1/3 Bright Red */ - { 0xff, 0x55, 0xff }, /* 13 1 1/3 1 Bright Magenta */ - { 0xff, 0xff, 0x80 }, /* 14 1 1 1/3 Bright Yellow */ - { 0xff, 0xff, 0xff } /* 15 1 1 1 Bright White */ +static struct vt_driver vt_ps3fb_driver = { + .vd_name = "ps3fb", + .vd_probe = ps3fb_probe, + .vd_init = ps3fb_init, + .vd_blank = vt_fb_blank, + .vd_bitbltchr = vt_fb_bitbltchr, + .vd_maskbitbltchr = vt_fb_maskbitbltchr, + /* Better than VGA, but still generic driver. */ + .vd_priority = VD_PRIORITY_GENERIC + 1, }; -#define TODO printf("%s: unimplemented\n", __func__) - -static u_int16_t ps3fb_static_window[ROW*COL]; - +VT_DRIVER_DECLARE(vt_ps3fb, vt_ps3fb_driver); static struct ps3fb_softc ps3fb_softc; -static __inline int -ps3fb_background(uint8_t attr) -{ - return (attr >> 4); -} - -static __inline int -ps3fb_foreground(uint8_t attr) -{ - return (attr & 0x0f); -} - -static u_int -ps3fb_pix32(int attr) -{ - u_int retval; - - retval = (ps3fb_cmap[attr].red << 16) | - (ps3fb_cmap[attr].green << 8) | - ps3fb_cmap[attr].blue; - - return (retval); -} - static int -ps3fb_configure(int flags) +ps3fb_probe(struct vt_device *vd) { struct ps3fb_softc *sc; int disable; @@ -237,17 +94,12 @@ ps3fb_configure(int flags) #if 0 phandle_t root; #endif - static int done = 0; disable = 0; TUNABLE_INT_FETCH("hw.syscons.disable", &disable); if (disable != 0) return (0); - if (done != 0) - return (0); - done = 1; - sc = &ps3fb_softc; #if 0 @@ -260,24 +112,10 @@ ps3fb_configure(int flags) #else TUNABLE_STR_FETCH("hw.platform", compatible, sizeof(compatible)); if (strcmp(compatible, "ps3") != 0) - return (0); + return (CN_DEAD); #endif - sc->sc_console = 1; - - /* XXX: get from HV repository */ - sc->sc_height = 480; - sc->sc_width = 720; - sc->sc_stride = sc->sc_width*4; - - /* - * The loader puts the FB at 0x10000000, so use that for now. - */ - - sc->sc_addr = 0x10000000; - ps3fb_init(0, &sc->sc_va, 0); - - return (0); + return (CN_INTERNAL); } void @@ -299,474 +137,61 @@ ps3fb_remap(void) 0,L1GPU_DISPLAY_SYNC_VSYNC,0,0); lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC, 1,L1GPU_DISPLAY_SYNC_VSYNC,0,0); - lv1_gpu_memory_allocate(PS3FB_SIZE, 0, 0, 0, 0, &sc->sc_fbhandle, &fb_paddr); - lv1_gpu_context_allocate(sc->sc_fbhandle, 0, &sc->sc_fbcontext, &sc->sc_dma_control, - &sc->sc_driver_info, &sc->sc_reports, &sc->sc_reports_size); + lv1_gpu_memory_allocate(PS3FB_SIZE, 0, 0, 0, 0, &sc->sc_fbhandle, + &fb_paddr); + lv1_gpu_context_allocate(sc->sc_fbhandle, 0, &sc->sc_fbcontext, + &sc->sc_dma_control, &sc->sc_driver_info, &sc->sc_reports, + &sc->sc_reports_size); lv1_gpu_context_attribute(sc->sc_fbcontext, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 0, 0, 0, 0); lv1_gpu_context_attribute(sc->sc_fbcontext, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 1, 0, 0, 0); + sc->fb_info.fb_pbase = fb_paddr; for (va = 0; va < PS3FB_SIZE; va += PAGE_SIZE) pmap_kenter_attr(0x10000000 + va, fb_paddr + va, VM_MEMATTR_WRITE_COMBINING); } static int -ps3fb_probe(int unit, video_adapter_t **adp, void *arg, int flags) -{ - TODO; - return (0); -} - -static int -ps3fb_init(int unit, video_adapter_t *adp, int flags) +ps3fb_init(struct vt_device *vd) { struct ps3fb_softc *sc; - video_info_t *vi; - int cxborder, cyborder; - int font_height; - - sc = (struct ps3fb_softc *)adp; - vi = &adp->va_info; - - vid_init_struct(adp, "ps3fb", -1, unit); - - /* The default font size can be overridden by loader */ - font_height = 16; - TUNABLE_INT_FETCH("hw.syscons.fsize", &font_height); - if (font_height == 8) { - sc->sc_font = dflt_font_8; - sc->sc_font_height = 8; - } else if (font_height == 14) { - sc->sc_font = dflt_font_14; - sc->sc_font_height = 14; - } else { - /* default is 8x16 */ - sc->sc_font = dflt_font_16; - sc->sc_font_height = 16; - } - - /* The user can set a border in chars - default is 1 char width */ - cxborder = 8; - cyborder = 2; - TUNABLE_INT_FETCH("hw.syscons.xborder", &cxborder); - TUNABLE_INT_FETCH("hw.syscons.yborder", &cyborder); - - vi->vi_cheight = sc->sc_font_height; - vi->vi_width = sc->sc_width/8 - 2*cxborder; - vi->vi_height = sc->sc_height/sc->sc_font_height - 2*cyborder; - vi->vi_cwidth = 8; - - /* - * Clamp width/height to syscons maximums - */ - if (vi->vi_width > COL) - vi->vi_width = COL; - if (vi->vi_height > ROW) - vi->vi_height = ROW; - sc->sc_xmargin = (sc->sc_width - (vi->vi_width * vi->vi_cwidth)) / 2; - sc->sc_ymargin = (sc->sc_height - (vi->vi_height * vi->vi_cheight))/2; + /* Init softc */ + vd->vd_softc = sc = &ps3fb_softc; - /* - * Avoid huge amounts of conditional code in syscons by - * defining a dummy h/w text display buffer. - */ - adp->va_window = (vm_offset_t) ps3fb_static_window; + /* XXX: get from HV repository */ + sc->fb_info.fb_depth = 32; + sc->fb_info.fb_height = 480; + sc->fb_info.fb_width = 720; + sc->fb_info.fb_stride = sc->fb_info.fb_width*4; + sc->fb_info.fb_size = sc->fb_info.fb_height * sc->fb_info.fb_stride; + sc->fb_info.fb_bpp = sc->fb_info.fb_stride / sc->fb_info.fb_width * 8; /* - * Enable future font-loading and flag color support, as well as - * adding V_ADP_MODECHANGE so that we ps3fb_set_mode() gets called - * when the X server shuts down. This enables us to get the console - * back when X disappears. + * The loader puts the FB at 0x10000000, so use that for now. */ - adp->va_flags |= V_ADP_FONT | V_ADP_COLOR | V_ADP_MODECHANGE; - - ps3fb_set_mode(&sc->sc_va, 0); - vid_register(&sc->sc_va); - - return (0); -} - -static int -ps3fb_get_info(video_adapter_t *adp, int mode, video_info_t *info) -{ - bcopy(&adp->va_info, info, sizeof(*info)); - return (0); -} - -static int -ps3fb_query_mode(video_adapter_t *adp, video_info_t *info) -{ - TODO; - return (0); -} -static int -ps3fb_set_mode(video_adapter_t *adp, int mode) -{ - struct ps3fb_softc *sc; + sc->fb_info.fb_vbase = 0x10000000; - sc = (struct ps3fb_softc *)adp; - - /* XXX: no real mode setting at the moment */ - - ps3fb_blank_display(&sc->sc_va, V_DISPLAY_ON); + /* 32-bit VGA palette */ + vt_generate_vga_palette(sc->fb_info.fb_cmap, COLOR_FORMAT_RGB, + 255, 16, 255, 8, 255, 0); + /* Set correct graphics context */ lv1_gpu_context_attribute(sc->sc_fbcontext, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 0, 0, 0, 0); lv1_gpu_context_attribute(sc->sc_fbcontext, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 1, 0, 0, 0); - return (0); -} - -static int -ps3fb_save_font(video_adapter_t *adp, int page, int size, int width, - u_char *data, int c, int count) -{ - TODO; - return (0); -} - -static int -ps3fb_load_font(video_adapter_t *adp, int page, int size, int width, - u_char *data, int c, int count) -{ - struct ps3fb_softc *sc; - - sc = (struct ps3fb_softc *)adp; - - /* - * syscons code has already determined that current width/height - * are unchanged for this new font - */ - sc->sc_font = data; - return (0); -} - -static int -ps3fb_show_font(video_adapter_t *adp, int page) -{ - - return (0); -} - -static int -ps3fb_save_palette(video_adapter_t *adp, u_char *palette) -{ - /* TODO; */ - return (0); -} - -static int -ps3fb_load_palette(video_adapter_t *adp, u_char *palette) -{ - /* TODO; */ - return (0); -} - -static int -ps3fb_set_border(video_adapter_t *adp, int border) -{ - /* XXX Be lazy for now and blank entire screen */ - return (ps3fb_blank_display(adp, border)); -} - -static int -ps3fb_save_state(video_adapter_t *adp, void *p, size_t size) -{ - TODO; - return (0); -} - -static int -ps3fb_load_state(video_adapter_t *adp, void *p) -{ - TODO; - return (0); -} - -static int -ps3fb_set_win_org(video_adapter_t *adp, off_t offset) -{ - TODO; - return (0); -} + fb_probe(&sc->fb_info); + vt_fb_init(vd); -static int -ps3fb_read_hw_cursor(video_adapter_t *adp, int *col, int *row) -{ - *col = 0; - *row = 0; - - return (0); -} - -static int -ps3fb_set_hw_cursor(video_adapter_t *adp, int col, int row) -{ - - return (0); -} - -static int -ps3fb_set_hw_cursor_shape(video_adapter_t *adp, int base, int height, - int celsize, int blink) -{ - return (0); -} - -static int -ps3fb_blank_display(video_adapter_t *adp, int mode) -{ - struct ps3fb_softc *sc; - int i; - uint32_t *addr; - - sc = (struct ps3fb_softc *)adp; - addr = (uint32_t *) sc->sc_addr; - - for (i = 0; i < (sc->sc_stride/4)*sc->sc_height; i++) - *(addr + i) = ps3fb_pix32(ps3fb_background(SC_NORM_ATTR)); - - return (0); -} - -static int -ps3fb_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr, - int prot, vm_memattr_t *memattr) -{ - struct ps3fb_softc *sc; - - sc = (struct ps3fb_softc *)adp; - - /* - * This might be a legacy VGA mem request: if so, just point it at the - * framebuffer, since it shouldn't be touched - */ - if (offset < sc->sc_stride*sc->sc_height) { - *paddr = sc->sc_addr + offset; - return (0); - } - - return (EINVAL); -} - -static int -ps3fb_ioctl(video_adapter_t *adp, u_long cmd, caddr_t data) -{ - - return (0); -} - -static int -ps3fb_clear(video_adapter_t *adp) -{ - TODO; - return (0); -} - -static int -ps3fb_fill_rect(video_adapter_t *adp, int val, int x, int y, int cx, int cy) -{ - TODO; - return (0); -} - -static int -ps3fb_bitblt(video_adapter_t *adp, ...) -{ - TODO; - return (0); -} - -static int -ps3fb_diag(video_adapter_t *adp, int level) -{ - TODO; - return (0); -} - -static int -ps3fb_save_cursor_palette(video_adapter_t *adp, u_char *palette) -{ - TODO; - return (0); -} - -static int -ps3fb_load_cursor_palette(video_adapter_t *adp, u_char *palette) -{ - TODO; - return (0); -} - -static int -ps3fb_copy(video_adapter_t *adp, vm_offset_t src, vm_offset_t dst, int n) -{ - TODO; - return (0); -} - -static int -ps3fb_putp(video_adapter_t *adp, vm_offset_t off, uint32_t p, uint32_t a, - int size, int bpp, int bit_ltor, int byte_ltor) -{ - TODO; - return (0); -} - -static int -ps3fb_putc(video_adapter_t *adp, vm_offset_t off, uint8_t c, uint8_t a) -{ - struct ps3fb_softc *sc; - int row; - int col; - int i, j, k; - uint32_t *addr; - u_char *p; - - sc = (struct ps3fb_softc *)adp; - row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight; - col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth; - p = sc->sc_font + c*sc->sc_font_height; - addr = (uint32_t *)sc->sc_addr - + (row + sc->sc_ymargin)*(sc->sc_stride/4) - + col + sc->sc_xmargin; - - for (i = 0; i < sc->sc_font_height; i++) { - for (j = 0, k = 7; j < 8; j++, k--) { - if ((p[i] & (1 << k)) == 0) - *(addr + j) = ps3fb_pix32(ps3fb_background(a)); - else - *(addr + j) = ps3fb_pix32(ps3fb_foreground(a)); - } - addr += (sc->sc_stride/4); - } - - return (0); -} - -static int -ps3fb_puts(video_adapter_t *adp, vm_offset_t off, u_int16_t *s, int len) -{ - int i; - - for (i = 0; i < len; i++) { - ps3fb_putc(adp, off + i, s[i] & 0xff, (s[i] & 0xff00) >> 8); - } - return (0); -} - -static int -ps3fb_putm(video_adapter_t *adp, int x, int y, uint8_t *pixel_image, - uint32_t pixel_mask, int size, int width) -{ - struct ps3fb_softc *sc; - int i, j, k; - uint32_t fg, bg; - uint32_t *addr; - - sc = (struct ps3fb_softc *)adp; - addr = (uint32_t *)sc->sc_addr - + (y + sc->sc_ymargin)*(sc->sc_stride/4) - + x + sc->sc_xmargin; - - fg = ps3fb_pix32(ps3fb_foreground(SC_NORM_ATTR)); - bg = ps3fb_pix32(ps3fb_background(SC_NORM_ATTR)); - - for (i = 0; i < size && i+y < sc->sc_height - 2*sc->sc_ymargin; i++) { - for (j = 0, k = width; j < 8; j++, k--) { - if (x + j >= sc->sc_width - 2*sc->sc_xmargin) - continue; - - if (pixel_image[i] & (1 << k)) - *(addr + j) = (*(addr + j) == fg) ? bg : fg; - } - addr += (sc->sc_stride/4); - } - - return (0); -} - -/* - * Define the syscons nexus device attachment - */ -static void -ps3fb_scidentify(driver_t *driver, device_t parent) -{ - device_t child; - - /* - * Add with a priority guaranteed to make it last on - * the device list - */ - if (strcmp(installed_platform(), "ps3") == 0) - child = BUS_ADD_CHILD(parent, INT_MAX, SC_DRIVER_NAME, 0); -} - -static int -ps3fb_scprobe(device_t dev) -{ - int error; - - if (strcmp(installed_platform(), "ps3") != 0) - return (ENXIO); - - device_set_desc(dev, "System console"); - - error = sc_probe_unit(device_get_unit(dev), - device_get_flags(dev) | SC_AUTODETECT_KBD); - if (error != 0) - return (error); - - /* This is a fake device, so make sure we added it ourselves */ - return (BUS_PROBE_NOWILDCARD); -} - -static int -ps3fb_scattach(device_t dev) -{ - return (sc_attach_unit(device_get_unit(dev), - device_get_flags(dev) | SC_AUTODETECT_KBD)); -} - -static device_method_t ps3fb_sc_methods[] = { - DEVMETHOD(device_identify, ps3fb_scidentify), - DEVMETHOD(device_probe, ps3fb_scprobe), - DEVMETHOD(device_attach, ps3fb_scattach), - { 0, 0 } -}; - -static driver_t ps3fb_sc_driver = { - SC_DRIVER_NAME, - ps3fb_sc_methods, - sizeof(sc_softc_t), -}; - -static devclass_t sc_devclass; - -DRIVER_MODULE(ps3fb, nexus, ps3fb_sc_driver, sc_devclass, 0, 0); - -/* - * Define a stub keyboard driver in case one hasn't been - * compiled into the kernel - */ -#include -#include - -static int dummy_kbd_configure(int flags); - -keyboard_switch_t ps3dummysw; - -static int -dummy_kbd_configure(int flags) -{ + /* Clear the screen. */ + vt_fb_blank(vd, TC_BLACK); - return (0); + return (CN_INTERNAL); } -KEYBOARD_DRIVER(ps3dummy, ps3dummysw, dummy_kbd_configure); From owner-svn-src-head@FreeBSD.ORG Sun May 11 06:51:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0AD5FFE; Sun, 11 May 2014 06:51:39 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id F39D8282F; Sun, 11 May 2014 06:51:38 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 6B656782ACE; Sun, 11 May 2014 16:51:30 +1000 (EST) Date: Sun, 11 May 2014 16:51:23 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Nathan Whitehorn Subject: Re: svn commit: r265864 - head/sys/dev/vt/hw/ofwfb In-Reply-To: <201405110158.s4B1wvFA072381@svn.freebsd.org> Message-ID: <20140511133517.N1100@besplex.bde.org> References: <201405110158.s4B1wvFA072381@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=QIpRGG7L c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=5bbp3XeTFoQA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=822ppeBI7xFXGu7bwcMA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 06:51:39 -0000 On Sun, 11 May 2014, Nathan Whitehorn wrote: > Log: > Make ofwfb not be painfully slow. This reduces the time for a verbose boot > on my G4 iBook by more than half. Still 10% slower than syscons, but that's > much better than a factor of 2. > > The slowness had to do with pathological write performance on 8-bit > framebuffers, which are almost universally used on Open Firmware systems. > Writing 1 byte at a time, potentially nonconsecutively, resulted in many > extra PCI write cycles. This patch, in the common case where it's writing > one or several characters in an 8x8 font, gangs the writes together into > a set of 32-bit writes. This is a port of r143830 to vt(4). Only 10% slower? Bitmapped mode with 256 colors is inherently 4 times slower for an 8x8 font (8 bytes/char instead 2) of and 8 times slower for an 8x16 font. That's without any I/O pathology. Perhaps you are comparing with a syscons that is already very slow due to the hardware not supporting text mode. However, syscons has buffering that should limit this problem. > The EFI framebuffer is also extremely slow, probably for the same reason, > and the same patch will likely help there. > > Modified: > head/sys/dev/vt/hw/ofwfb/ofwfb.c > > Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c > ============================================================================== > --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Sun May 11 01:44:11 2014 (r265863) > +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Sun May 11 01:58:56 2014 (r265864) > @@ -136,6 +136,10 @@ ofwfb_bitbltchr(struct vt_device *vd, co > uint32_t fgc, bgc; > int c; > uint8_t b, m; > + union { > + uint32_t l; > + uint8_t c[4]; > + } ch1, ch2; > > fgc = sc->sc_colormap[fg]; > bgc = sc->sc_colormap[bg]; > @@ -147,36 +151,70 @@ ofwfb_bitbltchr(struct vt_device *vd, co > return; > > line = (sc->sc_stride * top) + left * sc->sc_depth/8; > - for (; height > 0; height--) { > - for (c = 0; c < width; c++) { > - if (c % 8 == 0) > + if (mask == NULL && sc->sc_depth == 8 && (width % 8 == 0)) { > + for (; height > 0; height--) { > + for (c = 0; c < width; c += 8) { > b = *src++; > - else > - b <<= 1; > - if (mask != NULL) { > + Style bug (extra newline). > + /* > + * Assume that there is more background than > + * foreground in characters and init accordingly > + */ > + ch1.l = ch2.l = (bg << 24) | (bg << 16) | > + (bg << 8) | bg; > + > + /* > + * Calculate 2 x 4-chars at a time, and then > + * write these out. > + */ > + if (b & 0x80) ch1.c[0] = fg; > + if (b & 0x40) ch1.c[1] = fg; > + if (b & 0x20) ch1.c[2] = fg; > + if (b & 0x10) ch1.c[3] = fg; > + > + if (b & 0x08) ch2.c[0] = fg; > + if (b & 0x04) ch2.c[1] = fg; > + if (b & 0x02) ch2.c[2] = fg; > + if (b & 0x01) ch2.c[3] = fg; Style bugs (missing newlines). > + > + *(uint32_t *)(sc->sc_addr + line + c) = ch1.l; > + *(uint32_t *)(sc->sc_addr + line + c + 4) = > + ch2.l; > + } > + line += sc->sc_stride; > + } > + } else { > + for (; height > 0; height--) { > + for (c = 0; c < width; c++) { > if (c % 8 == 0) > - m = *mask++; > + b = *src++; > else > - m <<= 1; > - /* Skip pixel write, if mask has no bit set. */ > - if ((m & 0x80) == 0) > - continue; > - } > - switch(sc->sc_depth) { > - case 8: > - *(uint8_t *)(sc->sc_addr + line + c) = > - b & 0x80 ? fg : bg; > - break; > - case 32: > - *(uint32_t *)(sc->sc_addr + line + 4*c) = > - (b & 0x80) ? fgc : bgc; > - break; > - default: > - /* panic? */ > - break; > + b <<= 1; > + if (mask != NULL) { > + if (c % 8 == 0) > + m = *mask++; > + else > + m <<= 1; > + /* Skip pixel write, if mask not set. */ > + if ((m & 0x80) == 0) > + continue; > + } > + switch(sc->sc_depth) { > + case 8: > + *(uint8_t *)(sc->sc_addr + line + c) = > + b & 0x80 ? fg : bg; > + break; > + case 32: > + *(uint32_t *)(sc->sc_addr + line + 4*c) > + = (b & 0x80) ? fgc : bgc; > + break; > + default: > + /* panic? */ > + break; > + } > } > + line += sc->sc_stride; > } > - line += sc->sc_stride; > } > } A correctly-implemented console driver doesn't have itty-bitty hardware i/o like the old version of this or itty-bitty buffering like the changed version. I thought that syscons always had correct buffering. Actually, it uses a hybrid scheme where, at least in text mode, the initial i/o is itty-bitty 1 character+attribute at a time (16-bit i/o), but scrolling and screen refresh is done bcopy, bcopy_io(), bcopy_fromio() and bcopy_toio() and a couple of other functions (bzero_io(), fill*()) from/to a properly cached buffer in normal memory. It used to use only bcopy() and a couple of others (bzero(), fill*()), so it automatically did 64-bit i/o's on 64-bit systems, except for fillw*() which was intentionally 16 bits for compatibilty (but it didn't use bcopy() which is needed for even more compatibility). It is unclear which old systems break with frame buffer i/o's larger (or smaller) than 16 bits. I never had any (x86) hardware that didn't work with any size. The video card might be 16-bit only, but then it should just tell the CPU this so that the CPU reduces to 16 bits using standard x86 mechanisms. Video cards have been PCI or better for about 20 years. PCI should support precisely 32-bits, but 64-bit frame buffer accesses to PCI and AGP video cards always worked for me. bcopy*io() is more technically correct, but is very badly implemented and much slower than bcopy() on most systems. Its misimplementation includes not even using bus-space on x86. All bcopy*io() functions use copyw() on x86, and copyw() is just a dumb 16-bit memcpy() written in C. Writing it in C doesn't lose anything when it is used for a slow i/o memory, but doing 16-bit i/o's does. And doing 16-bit i/o's doesn't even give compatibility, since bzero_io() is just bzero() on x86, so it always does wider i/o's. syscons has always used fillw*() and never plain fill() since it doesn't the corresponding 32-bit writes that might be given by fill(). fill() actually does 8-bit writes. fb also uses the badly named and implemented filll_io(). This doesn't actually support longs, but only u_int32_t. fill_io() is at least ifdefed on ${ARCH}, so its access size is not completely hard-coded. On arm and mips, all the ifdefed "io" functions except fill_io use plain memcpy() or memset() so they get a maximum access size and minimum hardware compatibilty. fillw() is 16 bits on these arches since the access size is hard-coded in the API (and conversion to memset() is not done). Pessimizations in syscons have made it about twice as slow as in FreeBSD-5. This is probably mostly due to switching from bcopy() to copyw(). There is a lot of bloat in upper layers, but with 2GHz CPUs it would take a factor of about 10 pessimizations there to be comparable with i/o pessimizations. A correctly-implemented console driver assembles an image of the frame buffer in fast memory and copies from there to the frame buffer in large chunks. It is tricky to keep track of changed regions so as to not copy unchanged regions. Copying everything at a refresh rate of not much slower than 20 Hz works well. 200 Hz for animation, but that is rarely needed. The bandwidth for 80x25 text mode at 20 Hz is 80 kB/ second. That was easy in 1982. I aimed for 100 Hz refresh on 2 MHz 6809 systems in 1987. PC hardware at 5 MHz was about twice as slow, especially for frame buffers. But it could do 80 kB/second. The bandwidth for 80x25 8x16 256 color bitmapped mode is 640kB/second. This was difficult in 1982, but very easy now. Yet the WindowsXP safe mode with command prompt console is about as slow at scrolling as a 1982 system in graphics mode. It uses similar techniques to implement the slowness: - a large bitmapped screen. 640x200 8 colors in 1982. Quite a bit larger (something like 1024x768 256 colors) in 20XX. - write to the screen very slowly. Use 8-bit writes with i/o artifacts if possible. The 1982 system had to do 8-bit writes to 3 color planes. 256-color mode is simpler than most. Writes can also be done very slowly by using another mode and misaligning text so that every character written needs merging with pixels from adjacent characters. - do scrolling in software by copying 1 pixel at a time, using read-modify- write - I only tested this on 5-10 year old hardware, with a 1920x1080 screen but not all of it used for the console window, and with a laptop 1024x768 screen. A good way to be slow, one that has been portable to PC systems since 1982, is to use the BIOS for video. The console was about twice as fast on the laptop. This might be due to a combination of fewer pixels and a less well pessimized BIOS. Some old screen benchmarks. The benchmark is basically to write lines of the screen width and scroll. I stopped updating this often about 15 years ago when frame buffers and CPUs became fast enough. But it appears that software bloat and design errors have caught up. % ISA ET4000: 2.4MB/sec read, 5.9MB/sec write % VLB ET4000/W32i: 6.8MB/sec read, 25.5MB/sec write % PCI S3/868: 3.5MB/sec read, 23.1MB/sec write % PCI S3/Virge: 4.1MB/sec read, 40.0MB/sec write % PCI S3/Savage: 3.3MB/sec read, 25.8MB/sec write % PCI Xpert: 5.3MB/sec read, 21.8MB/sec write % PCI R9200SE: 5.8MB/sec read, 60.2MB/sec write (but 120MB/sec fpu, 250/sec sfpu) % -o means stty flag -opost % % No-scroll: Scrolling is avoided by repositioning the cursor after every screenful. % % machine video O/S where real user sys speed % --------- ------- -------------- --------- ----- ---- ----- ----- % A/2223 PCI R9200SE FreeBSD-5.2m onscreen-o .026 0.00 .026 76.9 % A/2223 PCI R9200SE FreeBSD-5.2m offscreen-o .026 0.00 .026 76.9 % A/2223 PCI R9200SE FreeBSD-5.2m onscreen .031 0.00 .031 64.5 % A/2223 PCI R9200SE FreeBSD-5.2m offscreen .031 0.00 .031 64.5 An 11 year old system. 'onscreen' means output to an active vty, 'offscreen' to an inactive vty. The mere existence of vtys requires full buffering to fast memory for inactive vtys, since there is no hardware frame buffer memory to write to for the inactive vtys. You have to buffer the writes in a form that can be replayed when an inactive vty becomes active, and converting immediately to the final form is a good method (it does take more memory and limits history to a raw form). 'offscreen' is potentially much faster, but in most cases it is only slightly faster, due to delayed refreshes for 'onscreen' and relatively fast frame buffer memory. -opost is tested separately because the Linux console driver was amazingly slow without it. This shows that it is possible for the software bloat to be so large that it dominates hardware slowness. FreeBSD also has lots of bloat in the tty and syscons layers near opost, but it is in the noise compared with the old console Linux driver. I forget the units for these measurements, except that the speed column gives a bandwidth in MB/sec. I don't remember if this is for write(2) bandwidth or is related to frame buffer bandwidth). Interpret them as relative. On a system similar to the above, syscons scrolls at 50000 lines/sec. Non-virtually, this would require a frame buffer bandwidth of 200MB/sec, which is several times faster than possible. Since syscons only does a direct update for bytes written, it needs only about 1/25 of this bandwidth or 800KB/sec. This is not quite in the noise compared with a frame buffer bandwidth of 60.2MB/sec. % K6/233 PCI S3/Virge minix-1.6.25++ offscreen 0.2 0.00 0.12 16.0 % K6/233 PCI S3/Virge minix-1.6.25++ onscreen 0.2 0.00 0.12 16.0 The Minix driver from 1990 (rewritten to support virtual consoles and to be efficient) is faster than syscons of course. It is smarter about buffering, so the onnscreen case goes at almost the same speed as the offscreen case. % K6/233 PCI S3/Virge FreeBSD-current onscreen-o 0.23 0.00 0.23 8.85 % K6/233 PCI S3/Virge FreeBSD-current offscreen-o 0.23 0.00 0.23 8.85 syscons is just slightly slower for the offscreen case. -current was only current in ~2004. % K6/233 PCI S3/Virge FreeBSD-current onscreen 0.34 0.00 0.34 5.83 % K6/233 PCI S3/Virge FreeBSD-current offscreen 0.34 0.00 0.34 5.81 But in the onscreen case, syscons is more than 50% slower, due to less virtualization. This slowness became slower with faster frame buffers, but is still noticeable in benchmarks with the S3/Virge's write bandwidth of 40.0MB/sec. % P5/133 PCI S3/868 FreeBSD-current onscreen-o 0.39 0.00 0.39 5.10 % P5/133 PCI S3/868 FreeBSD-current offscreen-o 0.40 0.00 0.40 5.00 % P5/133 PCI S3/868 FreeBSD-current onscreen 0.51 0.00 0.50 3.92 % P5/133 PCI S3/868 FreeBSD-current offscreen 0.51 0.00 0.51 3.92 % K6/233 PCI S3/Virge linux-2.1.63 offscreen-o 0.97 0.00 0.97 2.06 % K6/233 PCI S3/Virge linux-2.1.63 onscreen-o 1.03 0.00 1.03 1.93 % K6/233 PCI S3/Virge linux-2.1.63 offscreen 1.18 0.00 1.18 1.69 % DX2/66 VLB ET4000/W32i FreeBSD-current offscreen-o 1.18 0.00 1.16 1.69 % DX2/66 VLB ET4000/W32i FreeBSD-current onscreen-o 1.27 0.02 1.23 1.57 % K6/233 PCI S3/Virge linux-2.1.63 onscreen 1.38 0.00 1.38 1.45 % 486/33 ISA ET4000 minix-1.6.25++ offscreen 2 0.01 1.45 1.37 % 486/33 ISA ET4000 minix-1.6.25++ onscreen 2 0.01 1.60 1.24 % DX2/66 VLB ET4000/W32i FreeBSD-current offscreen 1.60 0.00 1.59 1.25 % DX2/66 VLB ET4000/W32i FreeBSD-current onscreen 1.70 0.01 1.66 1.18 % 486/33 ISA ET4000 FreeBSD-current offscreen-o 2.30 0.01 2.28 0.87 % 486/33 ISA ET4000 FreeBSD-current onscreen-o 2.39 0.02 2.32 0.84 % 486/33 ISA ET4000 FreeBSD-current offscreen 3.15 0.03 3.10 0.63 % 486/33 ISA ET4000 FreeBSD-current onscreen 3.27 0.00 3.21 0.61 % DX2/66 VLB ET4000/W32i linux-1.2.13 offscreen-o 3.63 0.01 3.62 0.15 % DX2/66 VLB ET4000/W32i linux-1.2.13 onscreen-o 3.65 0.01 3.63 0.55 % DX2/66 VLB ET4000/W32i linux-1.2.13 offscreen 12.48 0.01 12.47 0.16 % 486/33 ISA ET4000 linux-1.1.36 offscreen 20.80 0.00 20.80 0.10 % DX2/66 VLB ET4000/W32i linux-1.2.13 onscreen 26.98 0.01 26.95 0.07 % 486/33 ISA ET4000 linux-1.1.36 onscreen 38.34 0.02 38.38 0.05 The speedup from the worst case (old Linux on old hardware) to the best case (old Minix on new hardware) is a factor of 38.34/0.26 = 1475. Hardware speeds only increased by a factor of about 223/33 = 67. Minix was only 1.5 times faster than syscons and 10-20 times faster than Linux on old hardware. % % Scroll: % % machine video O/S where real user sys speed % --------- ------- -------------- --------- ----- ---- ----- ----- % A/2223 PCI R9200SE FreeBSD-5.2m onscreen-o .047 0.00 .047 42.6 % A/2223 PCI R9200SE FreeBSD-5.2m offscreen-o .047 0.00 .047 42.6 % A/2223 PCI R9200SE FreeBSD-5.2m onscreen .051 0.00 .051 39.2 % A/2223 PCI R9200SE FreeBSD-5.2m offscreen .051 0.00 .051 39.2 % K6/233 PCI S3/Virge minix-1.6.25++ offscreen 0.2 0.00 0.14 14.0 % K6/233 PCI S3/Virge minix-1.6.25++ onscreen 0.2 0.00 0.14 14.0 % K6/233 PCI S3/Virge FreeBSD-current onscreen-o 0.36 0.00 0.36 5.54 % K6/233 PCI S3/Virge FreeBSD-current offscreen-o 0.40 0.00 0.40 5.01 % K6/233 PCI S3/Virge FreeBSD-current onscreen 0.47 0.00 0.47 4.22 % K6/233 PCI S3/Virge FreeBSD-current offscreen 0.51 0.00 0.51 3.92 Scrolling makes no difference for Minix due to the better virtualization. It slows down syscons by about 50%. Strangely, the onscreen case is now faster?! % P5/133 PCI S3/868 FreeBSD-current onscreen-o 1.24 0.00 1.23 1.61 % P5/133 PCI S3/868 FreeBSD-current offscreen-o 1.28 0.00 1.27 1.56 % P5/133 PCI S3/868 FreeBSD-current onscreen 1.35 0.00 1.34 1.48 % P5/133 PCI S3/868 FreeBSD-current offscreen 1.39 0.00 1.38 1.44 % K6/233 PCI S3/Virge linux-2.1.63 onscreen-o 1.49 0.00 1.49 1.34 % 486/33 ISA ET4000 minix-1.6.25++ offscreen 2 0.00 1.70 1.18 % 486/33 ISA ET4000 minix-1.6.25++ onscreen 2 0.00 1.81 1.10 % K6/233 PCI S3/Virge linux-2.1.63 onscreen 1.85 0.00 1.85 1.08 % K6/233 PCI S3/Virge linux-2.1.63 offscreen-o 2.88 0.00 2.88 0.69 % K6/233 PCI S3/Virge linux-2.1.63 offscreen 3.10 0.00 3.10 0.65 % DX2/66 VLB ET4000/W32i FreeBSD-current offscreen-o 3.39 0.02 3.36 0.59 % DX2/66 VLB ET4000/W32i FreeBSD-current onscreen-o 3.67 0.02 3.63 0.54 % DX2/66 VLB ET4000/W32i FreeBSD-current offscreen 3.82 0.00 3.81 0.52 % DX2/66 VLB ET4000/W32i FreeBSD-current onscreen 4.14 0.03 4.06 0.48 % DX2/66 VLB ET4000/W32i linux-1.2.13 onscreen-o 4.34 0.01 4.32 0.46 % 486/33 ISA ET4000 FreeBSD-current offscreen-o 5.54 0.03 5.48 0.36 % 486/33 ISA ET4000 FreeBSD-current onscreen-o 5.73 0.00 5.61 0.35 % 486/33 ISA ET4000 FreeBSD-current offscreen 6.41 0.03 6.34 0.31 % 486/33 ISA ET4000 FreeBSD-current onscreen 6.62 0.01 6.45 0.30 The old systems didn't have the CPU or frame buffer bandwidth to scroll at 50000 lines/sec. Rescaling 50000 by this 6.62 divided by the above 0.026 gives only 196 lines/sec. That was usable, but since you can see the scroll move it is not very good. Rescaling Minix's 2.0 gives 650 lines/sec, or a full screen refresh rate of 26 Hz. You can probably see the scroll flicker but not move at this rate. Of course, the implementation does delayed refresh to reach this rate, so most of the scrolling steps are virtual and you can only see the screen flicker for other reasons. syscons' scrolling is also virtual. % DX2/66 VLB ET4000/W32i linux-1.2.13 offscreen-o13.48 0.01 13.47 0.15 % DX2/66 VLB ET4000/W32i linux-1.2.13 offscreen 22.60 0.01 22.42 0.09 % 486/33 ISA ET4000 linux-1.1.36 offscreen 23.56 0.03 23.60 0.08 % DX2/66 VLB ET4000/W32i linux-1.2.13 onscreen 27.73 0.01 27.72 0.08 % 486/33 ISA ET4000 linux-1.1.36 onscreen 40.26 0.00 40.27 0.05 Rescaling 50000 by this 40.26 divided by the above 0.026 gives 26 lines/sec. That is only a bit better than 1982 pixel mode quality. But this is for text mode. Bruce From owner-svn-src-head@FreeBSD.ORG Sun May 11 07:10:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0ACDB411; Sun, 11 May 2014 07:10:10 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A02F02946; Sun, 11 May 2014 07:10:09 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.8/8.14.8) with ESMTP id s4B7A3Ms018705; Sun, 11 May 2014 10:10:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s4B7A3Ms018705 Received: (from kostik@localhost) by tom.home (8.14.8/8.14.8/Submit) id s4B7A3L8018703; Sun, 11 May 2014 10:10:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 11 May 2014 10:10:02 +0300 From: Konstantin Belousov To: Ian Lepore Subject: Re: svn commit: r265861 - in head/sys: arm/include modules Message-ID: <20140511071002.GV74331@kib.kiev.ua> References: <201405110043.s4B0h6B9040965@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4jz2RIiWkXBLiaBi" Content-Disposition: inline In-Reply-To: <201405110043.s4B0h6B9040965@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 07:10:10 -0000 --4jz2RIiWkXBLiaBi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 11, 2014 at 12:43:06AM +0000, Ian Lepore wrote: > Author: ian > Date: Sun May 11 00:43:06 2014 > New Revision: 265861 > URL: http://svnweb.freebsd.org/changeset/base/265861 >=20 > Log: > Make the hardware memory and instruction barrier functions work on armv4 > and armv5 as well. >=20 > Modified: > head/sys/arm/include/atomic.h > head/sys/modules/Makefile >=20 > Modified: head/sys/arm/include/atomic.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/arm/include/atomic.h Sat May 10 22:27:01 2014 (r265860) > +++ head/sys/arm/include/atomic.h Sun May 11 00:43:06 2014 (r265861) > @@ -58,9 +58,9 @@ > #define dsb() __asm __volatile("mcr p15, 0, %0, c7, c10, 4" : : "r" (0)= : "memory") > #define dmb() __asm __volatile("mcr p15, 0, %0, c7, c10, 5" : : "r" (0)= : "memory") > #else > -#define isb() > -#define dsb() > -#define dmb() > +#define isb() __asm __volatile("mcr p15, 0, %0, c7, c5, 4" : : "r" (0) = : "memory") > +#define dsb() __asm __volatile("mcr p15, 0, %0, c7, c10, 4" : : "r" (0)= : "memory") > +#define dmb() dsb() > #endif > =20 > #define mb() dmb() >=20 > Modified: head/sys/modules/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/modules/Makefile Sat May 10 22:27:01 2014 (r265860) > +++ head/sys/modules/Makefile Sun May 11 00:43:06 2014 (r265861) > @@ -2,6 +2,8 @@ > =20 > .include > =20 > +SUBDIR_PARALLEL=3D > + > # Modules that include binary-only blobs of microcode should be selectab= le by > # MK_SOURCELESS_UCODE option (see below). > =20 This part is unrelated and should be reverted, I suppose ? --4jz2RIiWkXBLiaBi Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJTbyJKAAoJEJDCuSvBvK1BN78P/iEgsXlLpfYyaTwxg3mhHr2q qglNtEc3kaFEIIXYXuEcDQF+D8m/RxGmnD3/O1LPwzgblC2yO8t0x8kjxYRQpN6u eetwLY0QfcC9bNcJnP0RuHli0+xASGZ3gRNuNzYSik74iYyoQZ/6k4dRb9EVJWc7 PIx8KXqGwuLT06r7rpcV9EV9b4ldzRt/w7RkuoOvhWIf8epHjiCIztG9bYKn4SoV GmTRrb9EoE2WjiJGldAVC0AL4oEatdvLW0OPeWJG67qS5gaSc56BBMNE4PssTzFD 10vEkahnnVXQbGTfK9wcsq67eDHCYDKQbDzoh5gtxtHC7DsFXrQU9JqR97m+yrIe o39jvteNLM1iCnEw2emec9VCOTDemn7mH0x93B4/h12FenujeqBZgJJK6jnty73a cUeUgA3o67oBZ5ptXnqZjMsv2gQQnr/oFuw5dCrikheg1nOFoJCSKD531RXQicET l/M8gjOBrbLSXHhVhvLPq2UyIU4pufzpdBqsqJbpV6Wqf0m9mjW5OsElX9I4NqK0 7yiig2iyyWhrB0XuKt9joV3ya5NcdG1zusPLUnbyCbyhPrbMeWYTlidQY4hWsNNw ixUtdTqiK3xCvZC0UZk5I/oZfGtoF4e+MSZKJ6818G3n+ySWuiUBsxhQSS0XNFSx RGNRF199LRFiaygLdhoY =L6x1 -----END PGP SIGNATURE----- --4jz2RIiWkXBLiaBi-- From owner-svn-src-head@FreeBSD.ORG Sun May 11 08:17:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9273B87; Sun, 11 May 2014 08:17:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B97EF2DC1; Sun, 11 May 2014 08:17:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4B8HkmX039824; Sun, 11 May 2014 08:17:46 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4B8HkiV039822; Sun, 11 May 2014 08:17:46 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405110817.s4B8HkiV039822@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 11 May 2014 08:17:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265872 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 08:17:46 -0000 Author: hselasky Date: Sun May 11 08:17:46 2014 New Revision: 265872 URL: http://svnweb.freebsd.org/changeset/base/265872 Log: Optimise host mode data roundtrip time. When BULK data is submitted to the main processing queue, clear the NAK counter for any associated BULK or CONTROL transfers and poll the endpoint(s) for 1 millisecond at 125us rate interval, before going into slow, 10ms, NAK polling mode again. This has the effect that typical ping-ping protocols respond quicker when initiated from the USB host. MFC after: 2 weeks Modified: head/sys/dev/usb/controller/dwc_otg.c head/sys/dev/usb/controller/dwc_otg.h Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Sun May 11 05:49:35 2014 (r265871) +++ head/sys/dev/usb/controller/dwc_otg.c Sun May 11 08:17:46 2014 (r265872) @@ -760,7 +760,7 @@ check_state: case DWC_CHAN_ST_WAIT_ANE: if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { - td->did_nak = 1; + td->did_nak++; td->tt_scheduled = 0; goto send_pkt; } else if (hcint & (HCINT_ACK | HCINT_NYET)) { @@ -774,7 +774,7 @@ check_state: case DWC_CHAN_ST_WAIT_S_ANE: if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { - td->did_nak = 1; + td->did_nak++; td->tt_scheduled = 0; goto send_pkt; } else if (hcint & (HCINT_ACK | HCINT_NYET)) { @@ -786,7 +786,7 @@ check_state: if (hcint & HCINT_NYET) { goto send_cpkt; } else if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { - td->did_nak = 1; + td->did_nak++; td->tt_scheduled = 0; goto send_pkt; } else if (hcint & HCINT_ACK) { @@ -1085,7 +1085,7 @@ dwc_otg_host_rate_check(struct dwc_otg_t if (!td->tt_scheduled) goto busy; td->tt_scheduled = 0; - } else if (td->did_nak != 0) { + } else if (td->did_nak >= DWC_OTG_NAK_MAX) { goto busy; } else if (td->set_toggle) { td->set_toggle = 0; @@ -1244,7 +1244,7 @@ check_state: case DWC_CHAN_ST_WAIT_ANE: if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { - td->did_nak = 1; + td->did_nak++; td->tt_scheduled = 0; if (td->hcsplt != 0) goto receive_spkt; @@ -1284,6 +1284,7 @@ check_state: */ } td->tt_scheduled = 0; + td->did_nak = 0; if (td->hcsplt != 0) goto receive_spkt; else @@ -1298,14 +1299,16 @@ check_state: * case of interrupt and isochronous transfers: */ if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { - td->did_nak = 1; + td->did_nak++; td->tt_scheduled = 0; goto receive_spkt; } else if (hcint & HCINT_NYET) { td->tt_scheduled = 0; goto receive_spkt; - } else if (hcint & HCINT_ACK) + } else if (hcint & HCINT_ACK) { + td->did_nak = 0; goto receive_pkt; + } break; case DWC_CHAN_ST_WAIT_C_PKT: @@ -1633,13 +1636,14 @@ check_state: case DWC_CHAN_ST_WAIT_ANE: if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { - td->did_nak = 1; + td->did_nak++; td->tt_scheduled = 0; goto send_pkt; } else if (hcint & (HCINT_ACK | HCINT_NYET)) { td->offset += td->tx_bytes; td->remainder -= td->tx_bytes; td->toggle ^= 1; + td->did_nak = 0; td->tt_scheduled = 0; /* check remainder */ @@ -1658,24 +1662,27 @@ check_state: case DWC_CHAN_ST_WAIT_S_ANE: if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { - td->did_nak = 1; + td->did_nak++; td->tt_scheduled = 0; goto send_pkt; - } else if (hcint & (HCINT_ACK | HCINT_NYET)) + } else if (hcint & (HCINT_ACK | HCINT_NYET)) { + td->did_nak = 0; goto send_cpkt; + } break; case DWC_CHAN_ST_WAIT_C_ANE: if (hcint & HCINT_NYET) { goto send_cpkt; } else if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { - td->did_nak = 1; + td->did_nak++; td->tt_scheduled = 0; goto send_pkt; } else if (hcint & HCINT_ACK) { td->offset += td->tx_bytes; td->remainder -= td->tx_bytes; td->toggle ^= 1; + td->did_nak = 0; td->tt_scheduled = 0; /* check remainder */ @@ -2283,8 +2290,10 @@ dwc_otg_timer(void *_sc) TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { td = xfer->td_transfer_cache; - if (td != NULL) + if (td != NULL) { + /* reset NAK counter */ td->did_nak = 0; + } } /* enable SOF interrupt, which will poll jobs */ @@ -2429,8 +2438,11 @@ dwc_otg_update_host_transfer_schedule(st TAILQ_FOREACH_SAFE(xfer, &sc->sc_bus.intr_q.head, wait_entry, xfer_next) { td = xfer->td_transfer_cache; - if (td == NULL || td->did_nak != 0 || td->ep_type != UE_CONTROL) + if (td == NULL || + td->ep_type != UE_CONTROL || + td->did_nak >= DWC_OTG_NAK_MAX) { continue; + } sc->sc_needsof = 1; @@ -2448,8 +2460,11 @@ dwc_otg_update_host_transfer_schedule(st if ((temp & 7) < 6) { TAILQ_FOREACH_SAFE(xfer, &sc->sc_bus.intr_q.head, wait_entry, xfer_next) { td = xfer->td_transfer_cache; - if (td == NULL || td->did_nak != 0 || td->ep_type != UE_BULK) + if (td == NULL || + td->ep_type != UE_BULK || + td->did_nak >= DWC_OTG_NAK_MAX) { continue; + } sc->sc_needsof = 1; @@ -3206,24 +3221,53 @@ static void dwc_otg_start_standard_chain(struct usb_xfer *xfer) { struct dwc_otg_softc *sc = DWC_OTG_BUS2SC(xfer->xroot->bus); + struct usb_xfer_root *xroot; + struct dwc_otg_td *td; DPRINTFN(9, "\n"); - /* poll one time - will turn on interrupts */ - if (dwc_otg_xfer_do_fifo(xfer)) { + /* + * Poll one time in device mode, which will turn on the + * endpoint interrupts. Else wait for SOF interrupt in host + * mode. + */ + if (sc->sc_flags.status_device_mode != 0 && + dwc_otg_xfer_do_fifo(xfer) == 0) + goto done; - /* put transfer on interrupt queue */ - usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer); + /* put transfer on interrupt queue */ + usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer); - /* start timeout, if any */ - if (xfer->timeout != 0) { - usbd_transfer_timeout_ms(xfer, - &dwc_otg_timeout, xfer->timeout); - } + /* start timeout, if any */ + if (xfer->timeout != 0) { + usbd_transfer_timeout_ms(xfer, + &dwc_otg_timeout, xfer->timeout); + } + + if (sc->sc_flags.status_device_mode != 0) + goto done; - /* enable SOF interrupt, if any */ - dwc_otg_enable_sof_irq(sc); + /* enable SOF interrupt, if any */ + dwc_otg_enable_sof_irq(sc); + + td = xfer->td_transfer_cache; + if (td->ep_type != UE_BULK) + goto done; + + xroot = xfer->xroot; + + /* + * Optimise the ping-pong effect by waking up other BULK + * transfers belonging to the same device group: + */ + TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { + td = xfer->td_transfer_cache; + if (td == NULL || td->ep_type != UE_BULK || xfer->xroot != xroot) + continue; + /* reset NAK counter */ + td->did_nak = 0; } +done:; } static void Modified: head/sys/dev/usb/controller/dwc_otg.h ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.h Sun May 11 05:49:35 2014 (r265871) +++ head/sys/dev/usb/controller/dwc_otg.h Sun May 11 08:17:46 2014 (r265872) @@ -37,6 +37,7 @@ #define DWC_OTG_TT_SLOT_MAX 8 #define DWC_OTG_SLOT_IDLE_MAX 4 #define DWC_OTG_SLOT_IDLE_MIN 2 +#define DWC_OTG_NAK_MAX 8 /* 1 ms */ #define DWC_OTG_READ_4(sc, reg) \ bus_space_read_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg) @@ -64,6 +65,7 @@ struct dwc_otg_td { uint8_t errcnt; uint8_t tmr_res; uint8_t tmr_val; + uint8_t did_nak; /* NAK counter */ uint8_t ep_no; uint8_t ep_type; uint8_t channel[2]; @@ -87,7 +89,6 @@ struct dwc_otg_td { uint8_t toggle:1; uint8_t set_toggle:1; uint8_t got_short:1; - uint8_t did_nak:1; uint8_t tt_scheduled:1; uint8_t tt_channel_tog:1; }; From owner-svn-src-head@FreeBSD.ORG Sun May 11 08:31:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A256620D; Sun, 11 May 2014 08:31:18 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DC6D2F02; Sun, 11 May 2014 08:31:17 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.82 (FreeBSD)) (envelope-from ) id 1WjPAA-000E0P-PJ; Sun, 11 May 2014 12:31:14 +0400 Date: Sun, 11 May 2014 12:31:14 +0400 From: Slawa Olhovchenkov To: Adrian Chadd Subject: Re: svn commit: r265792 - head/sys/kern Message-ID: <20140511083114.GA53503@zxy.spb.ru> References: <201405100053.s4A0rbF9080571@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201405100053.s4A0rbF9080571@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 08:31:18 -0000 On Sat, May 10, 2014 at 12:53:37AM +0000, Adrian Chadd wrote: > Author: adrian > Date: Sat May 10 00:53:36 2014 > New Revision: 265792 > URL: http://svnweb.freebsd.org/changeset/base/265792 > > Log: > Add in support to optionally pin the swi threads. > > Under enough load, the swi's can actually be preempted and migrated > to other currently free cores. When doing RSS experiments, this lead > to the per-CPU TCP timers not lining up any more with the RX CPU said > flows were ending up on, leading to increased lock contention. > > Since there was a little pushback on flipping them on by default, > I've left the default at "don't pin." > > The other less obvious problem here is that the default swi > is also the same as the destination swi for CPU #0. So if one > pins the swi on CPU #0, there's no default floating swi. > > A nice future project would be to create a separate swi for > the "default" floating swi, as well as per-CPU swis that are > (optionally) pinned. MFC planed? I have 10.0 box with aprox. 16Gbit TCP at peak. From owner-svn-src-head@FreeBSD.ORG Sun May 11 10:06:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E21C09DE; Sun, 11 May 2014 10:06:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C315A2552; Sun, 11 May 2014 10:06:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4BA6Rkk089399; Sun, 11 May 2014 10:06:27 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4BA6RN8089398; Sun, 11 May 2014 10:06:27 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405111006.s4BA6RN8089398@svn.freebsd.org> From: Christian Brueffer Date: Sun, 11 May 2014 10:06:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265875 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 10:06:28 -0000 Author: brueffer Date: Sun May 11 10:06:27 2014 New Revision: 265875 URL: http://svnweb.freebsd.org/changeset/base/265875 Log: Typo fixes and some language/punctuation improvements. Modified: head/share/man/man4/lm75.4 Modified: head/share/man/man4/lm75.4 ============================================================================== --- head/share/man/man4/lm75.4 Sun May 11 09:54:38 2014 (r265874) +++ head/share/man/man4/lm75.4 Sun May 11 10:06:27 2014 (r265875) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 7, 2014 +.Dd May 11, 2014 .Dt LM75 4 .Os .Sh NAME @@ -69,28 +69,28 @@ dev.lm75.0.shutdown: 0 Is the read-only value of the current temperature read by the sensor. .It Va dev.lm75.%d.thyst Sets the hysteresis temperature. -Once the temperature get over the overtemperature shutdown value (tos) -it need to drop bellow the hysteresis temperature to disable the output +Once the temperature gets over the overtemperature shutdown value (tos) +it needs to drop below the hysteresis temperature to disable the output (interrupt) pin again. .It Va dev.lm75.%d.tos Sets the overtemperature shutdown value. -Once the temperature get over this value the output pin will be enabled. +Once the temperature gets over this value the output pin will be enabled. The way the output (interrupt) pin works, depends on the mode configuration. .It Va dev.lm75.%d.faults Is the number of faults that must occur consecutively to activate the interrupt (output) pin. It can be set to 1, 2, 4, and 6. .It Va dev.lm75.%d.mode -Set the operation mode for the sensor interrupt pin. +Sets the operation mode for the sensor interrupt pin. It can be set to 'comparator' (default) or 'interrupt'. .It Va dev.lm75.%d.polarity -Set the polarity of the sensor interrupt pin. +Sets the polarity of the sensor interrupt pin. It can be set to 'active-low' (default) or 'active-high'. Please note that the output pin is an open-drain output and it needs a proper pull-up resistor to work. .It Va dev.lm75.%d.shutdown -When set to '1' it shutdown the sensor. -The temperature convertion stops but the sensor remains with its i2c bus +When set to '1' it shuts down the sensor. +The temperature conversion stops but the sensor remains with its i2c bus active, i.e., it can be woken up by setting this option to '0' again. .El .Pp @@ -124,7 +124,7 @@ On a .Xr device.hints 5 based system, like .Li MIPS , -these values are configurable for the +these values are configurable for .Nm : .Bl -tag -width ".Va hint.lm75.%d.addr" .It Va hint.lm75.%d.at @@ -168,7 +168,7 @@ property indicates which i2c address the .Nm is wired at. .Nm -temperature sensors can be wired to 8 different address, allowing up to 8 +temperature sensors can be wired to 8 different addresses, allowing up to 8 sensors on the same .Xr iicbus 4 . .El @@ -187,5 +187,5 @@ driver first appeared in .An -nosplit The .Nm -driver and this manual page was written by -.An Luiz Otavio O Souza Aq loos@FreeBSD.org +driver and this manual page were written by +.An Luiz Otavio O Souza Aq loos@FreeBSD.org . From owner-svn-src-head@FreeBSD.ORG Sun May 11 10:32:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BAEE82B5; Sun, 11 May 2014 10:32:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A87032765; Sun, 11 May 2014 10:32:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4BAWwaB002439; Sun, 11 May 2014 10:32:58 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4BAWwBI002438; Sun, 11 May 2014 10:32:58 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201405111032.s4BAWwBI002438@svn.freebsd.org> From: Colin Percival Date: Sun, 11 May 2014 10:32:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265876 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 10:32:58 -0000 Author: cperciva Date: Sun May 11 10:32:58 2014 New Revision: 265876 URL: http://svnweb.freebsd.org/changeset/base/265876 Log: In cf_get_method, when we don't already know what clock speed the CPU is running at, guess the nearest value instead of looking for a value within 25 MHz of the observed frequency. Prior to this change, if a system booted with Intel Turbo Boost enabled, the dev.cpu.0.freq sysctl is nonfunctional, since the ACPI-reported frequency for Turbo Boost states does not match the actual clock frequency (and thus no levels are within 25 MHz of the observed frequency) and the current performance level is read before a new level is set. MFC after: 3 days Relnotes: Bug fix in power management on CPUs with Intel Turbo Boost Modified: head/sys/kern/kern_cpu.c Modified: head/sys/kern/kern_cpu.c ============================================================================== --- head/sys/kern/kern_cpu.c Sun May 11 10:06:27 2014 (r265875) +++ head/sys/kern/kern_cpu.c Sun May 11 10:32:58 2014 (r265876) @@ -418,7 +418,7 @@ cf_get_method(device_t dev, struct cf_le struct cf_setting *curr_set, set; struct pcpu *pc; device_t *devs; - int count, error, i, n, numdevs; + int bdiff, count, diff, error, i, n, numdevs; uint64_t rate; sc = device_get_softc(dev); @@ -494,14 +494,15 @@ cf_get_method(device_t dev, struct cf_le } cpu_est_clockrate(pc->pc_cpuid, &rate); rate /= 1000000; + bdiff = 1 << 30; for (i = 0; i < count; i++) { - if (CPUFREQ_CMP(rate, levels[i].total_set.freq)) { + diff = abs(levels[i].total_set.freq - rate); + if (diff < bdiff) { + bdiff = diff; sc->curr_level = levels[i]; - CF_DEBUG("get estimated freq %d\n", curr_set->freq); - goto out; } } - error = ENXIO; + CF_DEBUG("get estimated freq %d\n", curr_set->freq); out: if (error == 0) From owner-svn-src-head@FreeBSD.ORG Sun May 11 12:53:52 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9787B188; Sun, 11 May 2014 12:53:52 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B35E209F; Sun, 11 May 2014 12:53:51 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WjTGI-000Lz8-Ik; Sun, 11 May 2014 12:53:50 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s4BCrk7o032825; Sun, 11 May 2014 06:53:46 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19QFlZpjGOKp2GP03BWPatk Subject: Re: svn commit: r265861 - in head/sys: arm/include modules From: Ian Lepore To: Konstantin Belousov In-Reply-To: <20140511071002.GV74331@kib.kiev.ua> References: <201405110043.s4B0h6B9040965@svn.freebsd.org> <20140511071002.GV74331@kib.kiev.ua> Content-Type: text/plain; charset="us-ascii" Date: Sun, 11 May 2014 06:53:46 -0600 Message-ID: <1399812826.22079.427.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 12:53:52 -0000 On Sun, 2014-05-11 at 10:10 +0300, Konstantin Belousov wrote: > On Sun, May 11, 2014 at 12:43:06AM +0000, Ian Lepore wrote: > > Author: ian > > Date: Sun May 11 00:43:06 2014 > > New Revision: 265861 > > URL: http://svnweb.freebsd.org/changeset/base/265861 > > > > Log: > > Make the hardware memory and instruction barrier functions work on armv4 > > and armv5 as well. > > > > Modified: > > head/sys/arm/include/atomic.h > > head/sys/modules/Makefile > > > > Modified: head/sys/arm/include/atomic.h > > ============================================================================== > > --- head/sys/arm/include/atomic.h Sat May 10 22:27:01 2014 (r265860) > > +++ head/sys/arm/include/atomic.h Sun May 11 00:43:06 2014 (r265861) > > @@ -58,9 +58,9 @@ > > #define dsb() __asm __volatile("mcr p15, 0, %0, c7, c10, 4" : : "r" (0) : "memory") > > #define dmb() __asm __volatile("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory") > > #else > > -#define isb() > > -#define dsb() > > -#define dmb() > > +#define isb() __asm __volatile("mcr p15, 0, %0, c7, c5, 4" : : "r" (0) : "memory") > > +#define dsb() __asm __volatile("mcr p15, 0, %0, c7, c10, 4" : : "r" (0) : "memory") > > +#define dmb() dsb() > > #endif > > > > #define mb() dmb() > > > > Modified: head/sys/modules/Makefile > > ============================================================================== > > --- head/sys/modules/Makefile Sat May 10 22:27:01 2014 (r265860) > > +++ head/sys/modules/Makefile Sun May 11 00:43:06 2014 (r265861) > > @@ -2,6 +2,8 @@ > > > > .include > > > > +SUBDIR_PARALLEL= > > + > > # Modules that include binary-only blobs of microcode should be selectable by > > # MK_SOURCELESS_UCODE option (see below). > > > This part is unrelated and should be reverted, I suppose ? Ooops, indeed, thanks. Although... it's a good change in terms of speeding up the build, I just didn't intend to commit it until it got tested with -j levels higher than I can test with my little 6-core machine. -- Ian From owner-svn-src-head@FreeBSD.ORG Sun May 11 12:55:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DEF42CC; Sun, 11 May 2014 12:55:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5941620AC; Sun, 11 May 2014 12:55:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4BCtWbC064024; Sun, 11 May 2014 12:55:32 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4BCtWXj064023; Sun, 11 May 2014 12:55:32 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405111255.s4BCtWXj064023@svn.freebsd.org> From: Ian Lepore Date: Sun, 11 May 2014 12:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265877 - head/sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 12:55:32 -0000 Author: ian Date: Sun May 11 12:55:31 2014 New Revision: 265877 URL: http://svnweb.freebsd.org/changeset/base/265877 Log: Revert accidental commit of SUBDIR_PARALLEL for sys/modules. (It hasn't been tested sufficiently). Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun May 11 10:32:58 2014 (r265876) +++ head/sys/modules/Makefile Sun May 11 12:55:31 2014 (r265877) @@ -2,8 +2,6 @@ .include -SUBDIR_PARALLEL= - # Modules that include binary-only blobs of microcode should be selectable by # MK_SOURCELESS_UCODE option (see below). From owner-svn-src-head@FreeBSD.ORG Sun May 11 12:58:50 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25067412; Sun, 11 May 2014 12:58:50 +0000 (UTC) Received: from ppsw-40.csi.cam.ac.uk (ppsw-40-v6.csi.cam.ac.uk [IPv6:2001:630:212:8::e:f40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA9DE20B9; Sun, 11 May 2014 12:58:49 +0000 (UTC) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net ([82.26.1.52]:62546 helo=[192.168.0.7]) by ppsw-40.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:587) with esmtpsa (PLAIN:dc552) (TLSv1:AES128-SHA:128) id 1WjTL4-0002P7-li (Exim 4.82_3-c0e5623) (return-path ); Sun, 11 May 2014 13:58:46 +0100 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265861 - in head/sys: arm/include modules From: David Chisnall In-Reply-To: <1399812826.22079.427.camel@revolution.hippie.lan> Date: Sun, 11 May 2014 13:58:42 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <99074AB3-B833-4C8C-8925-C826259BF46A@cl.cam.ac.uk> References: <201405110043.s4B0h6B9040965@svn.freebsd.org> <20140511071002.GV74331@kib.kiev.ua> <1399812826.22079.427.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1874) Sender: "Dr D. Chisnall" Cc: Konstantin Belousov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 12:58:50 -0000 On 11 May 2014, at 13:53, Ian Lepore wrote: > Ooops, indeed, thanks. Although... it's a good change in terms of > speeding up the build, I just didn't intend to commit it until it got > tested with -j levels higher than I can test with my little 6-core > machine. I'd be happy to test it on a 32-core machine. Are there any specific = configs you need, or is buildkernel enough? David From owner-svn-src-head@FreeBSD.ORG Sun May 11 13:05:20 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D8A45E2; Sun, 11 May 2014 13:05:20 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F24A2148; Sun, 11 May 2014 13:05:19 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WjTRO-0003Xy-V3; Sun, 11 May 2014 13:05:19 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s4BD5GGA032849; Sun, 11 May 2014 07:05:16 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18rB7iGomNmgqd0AewQhnfw Subject: Re: svn commit: r265861 - in head/sys: arm/include modules From: Ian Lepore To: David Chisnall In-Reply-To: <99074AB3-B833-4C8C-8925-C826259BF46A@cl.cam.ac.uk> References: <201405110043.s4B0h6B9040965@svn.freebsd.org> <20140511071002.GV74331@kib.kiev.ua> <1399812826.22079.427.camel@revolution.hippie.lan> <99074AB3-B833-4C8C-8925-C826259BF46A@cl.cam.ac.uk> Content-Type: text/plain; charset="us-ascii" Date: Sun, 11 May 2014 07:05:16 -0600 Message-ID: <1399813516.22079.429.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Konstantin Belousov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 13:05:20 -0000 On Sun, 2014-05-11 at 13:58 +0100, David Chisnall wrote: > On 11 May 2014, at 13:53, Ian Lepore wrote: > > > Ooops, indeed, thanks. Although... it's a good change in terms of > > speeding up the build, I just didn't intend to commit it until it got > > tested with -j levels higher than I can test with my little 6-core > > machine. > > I'd be happy to test it on a 32-core machine. Are there any specific configs you need, or is buildkernel enough? > > David > > Well eventually it'll need a universe build test, but any kernel/modules build at -j32 would be a good start. -- Ian From owner-svn-src-head@FreeBSD.ORG Sun May 11 13:22:42 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DE649A1; Sun, 11 May 2014 13:22:41 +0000 (UTC) Date: Sun, 11 May 2014 09:22:38 -0400 From: Glen Barber To: Ian Lepore Subject: Re: svn commit: r265861 - in head/sys: arm/include modules Message-ID: <20140511132238.GD1258@hub.FreeBSD.org> References: <201405110043.s4B0h6B9040965@svn.freebsd.org> <20140511071002.GV74331@kib.kiev.ua> <1399812826.22079.427.camel@revolution.hippie.lan> <99074AB3-B833-4C8C-8925-C826259BF46A@cl.cam.ac.uk> <1399813516.22079.429.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="T7mxYSe680VjQnyC" Content-Disposition: inline In-Reply-To: <1399813516.22079.429.camel@revolution.hippie.lan> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, David Chisnall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 13:22:42 -0000 --T7mxYSe680VjQnyC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 11, 2014 at 07:05:16AM -0600, Ian Lepore wrote: > On Sun, 2014-05-11 at 13:58 +0100, David Chisnall wrote: > > On 11 May 2014, at 13:53, Ian Lepore wrote: > >=20 > > > Ooops, indeed, thanks. Although... it's a good change in terms of > > > speeding up the build, I just didn't intend to commit it until it got > > > tested with -j levels higher than I can test with my little 6-core > > > machine. > >=20 > > I'd be happy to test it on a 32-core machine. Are there any specific c= onfigs you need, or is buildkernel enough? > >=20 > > David > >=20 > >=20 >=20 > Well eventually it'll need a universe build test, but any kernel/modules > build at -j32 would be a good start. >=20 I've just kicked off a test universe build with 'JFLAG=3D-j48'. Will report back when done. Glen --T7mxYSe680VjQnyC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTb3meAAoJELls3eqvi17QeasP/3FXB2BWzsDwTVBThIizDFpt n93sDeuIAcpZwz8gS5dqGNiwHH0D5mJbovz/THVG5qAcPVjMmNhUK6T8m/MPq1Lm CWS+3SSfRo/STXvb17P1remvXEfWVHX7sjVVhnc7c0hT7OIzkOT1ekmYfgCkLmjs dIbfn/X+D8+OenPyX7e+iLgAw6c0RHdJ6MtULlTU3JVzzWChJhMhhQRlrDk0WNKA seHoUEaIgJt3LTRz3eP+8JZif/I3Gkj+IduLmtfHa6skuLxxsB2FaHTKoxww25o+ dHDYS9E9Fkio9Xo171VznnFO4p4YRS07WpvawM3Hfuw5bOIQw7Lb40/l/0G6TaE1 1aPnX6Imvf6i0kRv2QP/+IvOjryNIA6EseS2TT7GLAOlLPQiaE9caGaZkC4DygHA ANIGmsnBYHVbIMfJ9SRQBgTvrn4oHWOGh4KR8DsvXTaAEaBAD+fxKUD9X7KyJ9in DoXxg5fKNGp5KIO21u8DeNBhBnno15o17AfMz671YNvvuhcLvjxUnNjbZV8W7llb AfkV2hXvRC74Kq5ivlxY/o0rvOrpHGLXMmXLHD2hPtYfsN3qaXsLKWg9Td5BHBXX +98SH3MQIQgos9c8JAmkref40n/fmuLvTFRfcpws4Xk3OhTaRtFhIMEpQRWLG0zN 5nQjKVFG9sIQPk4wkx5a =DlGf -----END PGP SIGNATURE----- --T7mxYSe680VjQnyC-- From owner-svn-src-head@FreeBSD.ORG Sun May 11 13:48:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37A8442C; Sun, 11 May 2014 13:48:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24415242B; Sun, 11 May 2014 13:48:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4BDmOt3087551; Sun, 11 May 2014 13:48:24 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4BDmMAR087534; Sun, 11 May 2014 13:48:22 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201405111348.s4BDmMAR087534@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 11 May 2014 13:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265878 - in head: include sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 13:48:24 -0000 Author: jilles Date: Sun May 11 13:48:21 2014 New Revision: 265878 URL: http://svnweb.freebsd.org/changeset/base/265878 Log: include: Remove checks for __BSD_VISIBLE where redundant with __XSI_VISIBLE or __POSIX_VISIBLE. Whenever sets __BSD_VISIBLE to non-zero, it also sets __POSIX_VISIBLE and __XSI_VISIBLE to the newest version supported. No functional change is intended. Modified: head/include/dirent.h head/include/grp.h head/include/setjmp.h head/include/signal.h head/include/stdio.h head/include/string.h head/include/termios.h head/include/unistd.h head/include/wchar.h head/sys/sys/stat.h Modified: head/include/dirent.h ============================================================================== --- head/include/dirent.h Sun May 11 12:55:31 2014 (r265877) +++ head/include/dirent.h Sun May 11 13:48:21 2014 (r265878) @@ -40,7 +40,7 @@ #include #include -#if __BSD_VISIBLE || __XSI_VISIBLE +#if __XSI_VISIBLE /* * XXX this is probably illegal in the __XSI_VISIBLE case, but brings us closer * to the specification. Modified: head/include/grp.h ============================================================================== --- head/include/grp.h Sun May 11 12:55:31 2014 (r265877) +++ head/include/grp.h Sun May 11 13:48:21 2014 (r265878) @@ -61,7 +61,7 @@ struct group { }; __BEGIN_DECLS -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE +#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE void endgrent(void); struct group *getgrent(void); #endif @@ -74,11 +74,11 @@ int pwcache_groupdb(int (*)(int), void struct group * (*)(const char *), struct group * (*)(gid_t)); #endif -#if __BSD_VISIBLE || __XSI_VISIBLE +#if __XSI_VISIBLE /* XXX IEEE Std 1003.1, 2003 specifies `void setgrent(void)' */ int setgrent(void); #endif -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE +#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **); int getgrnam_r(const char *, struct group *, char *, size_t, Modified: head/include/setjmp.h ============================================================================== --- head/include/setjmp.h Sun May 11 12:55:31 2014 (r265877) +++ head/include/setjmp.h Sun May 11 13:48:21 2014 (r265878) @@ -44,7 +44,7 @@ #include __BEGIN_DECLS -#if __BSD_VISIBLE || __XSI_VISIBLE >= 600 +#if __XSI_VISIBLE >= 600 void _longjmp(jmp_buf, int) __dead2; int _setjmp(jmp_buf) __returns_twice; #endif @@ -53,7 +53,7 @@ void longjmp(jmp_buf, int) __dead2; void longjmperror(void); #endif int setjmp(jmp_buf) __returns_twice; -#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE +#if __POSIX_VISIBLE || __XSI_VISIBLE void siglongjmp(sigjmp_buf, int) __dead2; int sigsetjmp(sigjmp_buf, int) __returns_twice; #endif Modified: head/include/signal.h ============================================================================== --- head/include/signal.h Sun May 11 12:55:31 2014 (r265877) +++ head/include/signal.h Sun May 11 13:48:21 2014 (r265878) @@ -108,7 +108,7 @@ int xsi_sigpause(int); int siginterrupt(int, int); #endif -#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE +#if __POSIX_VISIBLE >= 200809 void psignal(unsigned int, const char *); #endif Modified: head/include/stdio.h ============================================================================== --- head/include/stdio.h Sun May 11 12:55:31 2014 (r265877) +++ head/include/stdio.h Sun May 11 13:48:21 2014 (r265878) @@ -47,7 +47,7 @@ typedef __size_t size_t; #define _SIZE_T_DECLARED #endif -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 +#if __POSIX_VISIBLE >= 200809 #ifndef _OFF_T_DECLARED #define _OFF_T_DECLARED typedef __off_t off_t; @@ -58,7 +58,7 @@ typedef __ssize_t ssize_t; #endif #endif -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE +#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE #ifndef _VA_LIST_DECLARED typedef __va_list va_list; #define _VA_LIST_DECLARED @@ -342,7 +342,7 @@ int putw(int, FILE *); char *tempnam(const char *, const char *); #endif -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 +#if __POSIX_VISIBLE >= 200809 FILE *fmemopen(void * __restrict, size_t, const char * __restrict); ssize_t getdelim(char ** __restrict, size_t * __restrict, int, FILE * __restrict); @@ -387,7 +387,7 @@ ssize_t getline(char ** __restrict, siz int (dprintf)(int, const char * __restrict, ...); #endif -#endif /* __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 */ +#endif /* __POSIX_VISIBLE >= 200809 */ /* * Routines that are purely local. Modified: head/include/string.h ============================================================================== --- head/include/string.h Sun May 11 12:55:31 2014 (r265877) +++ head/include/string.h Sun May 11 13:48:21 2014 (r265878) @@ -65,7 +65,7 @@ void *memmem(const void *, size_t, const #endif void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); -#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE +#if __POSIX_VISIBLE >= 200809 char *stpcpy(char * __restrict, const char * __restrict); char *stpncpy(char * __restrict, const char * __restrict, size_t); #endif @@ -99,7 +99,7 @@ void strmode(int, char *); char *strncat(char * __restrict, const char * __restrict, size_t); int strncmp(const char *, const char *, size_t) __pure; char *strncpy(char * __restrict, const char * __restrict, size_t); -#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE +#if __POSIX_VISIBLE >= 200809 char *strndup(const char *, size_t) __malloc_like; size_t strnlen(const char *, size_t) __pure; #endif @@ -111,7 +111,7 @@ char *strrchr(const char *, int) __pure; #if __BSD_VISIBLE char *strsep(char **, const char *); #endif -#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE +#if __POSIX_VISIBLE >= 200809 char *strsignal(int); #endif size_t strspn(const char *, const char *) __pure; Modified: head/include/termios.h ============================================================================== --- head/include/termios.h Sun May 11 12:55:31 2014 (r265877) +++ head/include/termios.h Sun May 11 13:48:21 2014 (r265878) @@ -81,7 +81,7 @@ int tcflow(int, int); int tcflush(int, int); int tcsendbreak(int, int); -#if __POSIX_VISIBLE >= 200112 || __BSD_VISIBLE +#if __POSIX_VISIBLE >= 200112 pid_t tcgetsid(int); #endif #if __BSD_VISIBLE Modified: head/include/unistd.h ============================================================================== --- head/include/unistd.h Sun May 11 12:55:31 2014 (r265877) +++ head/include/unistd.h Sun May 11 13:48:21 2014 (r265878) @@ -426,7 +426,7 @@ int truncate(const char *, off_t); #endif #endif /* __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE */ -#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE +#if __POSIX_VISIBLE >= 200809 int faccessat(int, const char *, int, int); int fchownat(int, const char *, uid_t, gid_t, int); int fexecve(int, char *const [], char *const []); @@ -434,14 +434,14 @@ int linkat(int, const char *, int, const ssize_t readlinkat(int, const char * __restrict, char * __restrict, size_t); int symlinkat(const char *, int, const char *); int unlinkat(int, const char *, int); -#endif /* __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE */ +#endif /* __POSIX_VISIBLE >= 200809 */ /* * symlink() was originally in POSIX.1a, which was withdrawn after * being overtaken by events (1003.1-2001). It was in XPG4.2, and of * course has been in BSD since 4.2. */ -#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 402 || __BSD_VISIBLE +#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 402 int symlink(const char * __restrict, const char * __restrict); #endif Modified: head/include/wchar.h ============================================================================== --- head/include/wchar.h Sun May 11 12:55:31 2014 (r265877) +++ head/include/wchar.h Sun May 11 13:48:21 2014 (r265878) @@ -204,7 +204,7 @@ int wcwidth(wchar_t); #define wcwidth(_c) __wcwidth(_c) #endif -#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE +#if __POSIX_VISIBLE >= 200809 size_t mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t, size_t, mbstate_t * __restrict); FILE *open_wmemstream(wchar_t **, size_t *); Modified: head/sys/sys/stat.h ============================================================================== --- head/sys/sys/stat.h Sun May 11 12:55:31 2014 (r265877) +++ head/sys/sys/stat.h Sun May 11 13:48:21 2014 (r265878) @@ -339,12 +339,12 @@ int mknod(const char *, mode_t, dev_t); #endif int stat(const char * __restrict, struct stat * __restrict); mode_t umask(mode_t); -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 +#if __POSIX_VISIBLE >= 200809 int fstatat(int, const char *, struct stat *, int); int mkdirat(int, const char *, mode_t); int mkfifoat(int, const char *, mode_t); #endif -#if __BSD_VISIBLE || __XSI_VISIBLE >= 700 +#if __XSI_VISIBLE >= 700 int mknodat(int, const char *, mode_t, dev_t); #endif __END_DECLS From owner-svn-src-head@FreeBSD.ORG Sun May 11 15:32:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 101BDE35; Sun, 11 May 2014 15:32:36 +0000 (UTC) Received: from mail-ve0-x22d.google.com (mail-ve0-x22d.google.com [IPv6:2607:f8b0:400c:c01::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FC1F2C88; Sun, 11 May 2014 15:32:35 +0000 (UTC) Received: by mail-ve0-f173.google.com with SMTP id pa12so7635056veb.32 for ; Sun, 11 May 2014 08:32:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=MRHrMXMgfB1+i+3/QzwQzgIWyVZRwF9SIah/L8qYkkE=; b=RWgKDElNMFxU2uqH9p6dMChYnPKTZzDZrx8vTQ2GxnaxcYCUtr944CkJgng9KPlsoV j4DqjKI3uRr/tFk9IVYAAwRTJoPRc7tw1ZASiPkXUYluzC7zzAi7NhsnZdnvXBE6lV4X csvXBZBYZwt+eyppFEWTDywxKX6ds8ZS4Y2b7+9WAke8/AZvzqXb/0BAHJZH5auS1YYA Phb3rRn1pCCCX/zXIXCnLO98/5MqUUWNM9xjVKeHLFFabDPlX/mzHIjhCu2y1BiEfI1j iPI4n46XdVMHgzcRUzBlpn2P2pkU9UbWOxZh0pJLvTFFXNkIbZZcJjIB6Ls/ZNImBGn8 4Udg== MIME-Version: 1.0 X-Received: by 10.220.44.20 with SMTP id y20mr316533vce.60.1399822354656; Sun, 11 May 2014 08:32:34 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.220.186.193 with HTTP; Sun, 11 May 2014 08:32:34 -0700 (PDT) In-Reply-To: <20140511083114.GA53503@zxy.spb.ru> References: <201405100053.s4A0rbF9080571@svn.freebsd.org> <20140511083114.GA53503@zxy.spb.ru> Date: Sun, 11 May 2014 08:32:34 -0700 X-Google-Sender-Auth: Y-9WkJRyllJ_-OCYkthmdJrkyQI Message-ID: Subject: Re: svn commit: r265792 - head/sys/kern From: Adrian Chadd To: Slawa Olhovchenkov Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 15:32:36 -0000 On 11 May 2014 01:31, Slawa Olhovchenkov wrote: > On Sat, May 10, 2014 at 12:53:37AM +0000, Adrian Chadd wrote: > >> Author: adrian >> Date: Sat May 10 00:53:36 2014 >> New Revision: 265792 >> URL: http://svnweb.freebsd.org/changeset/base/265792 >> >> Log: >> Add in support to optionally pin the swi threads. >> >> Under enough load, the swi's can actually be preempted and migrated >> to other currently free cores. When doing RSS experiments, this lead >> to the per-CPU TCP timers not lining up any more with the RX CPU said >> flows were ending up on, leading to increased lock contention. >> >> Since there was a little pushback on flipping them on by default, >> I've left the default at "don't pin." >> >> The other less obvious problem here is that the default swi >> is also the same as the destination swi for CPU #0. So if one >> pins the swi on CPU #0, there's no default floating swi. >> >> A nice future project would be to create a separate swi for >> the "default" floating swi, as well as per-CPU swis that are >> (optionally) pinned. > > MFC planed? > I have 10.0 box with aprox. 16Gbit TCP at peak. I've no plans to MFC it at the present. By itself it shouldn't do very much. The rest of RSS stack and driver changes have to go in before it'll matter. (But if you try it on 10.0 and it changes things, by all means let me know.) -a From owner-svn-src-head@FreeBSD.ORG Sun May 11 15:34:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26ED7F7D; Sun, 11 May 2014 15:34:00 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id EAEBB2C94; Sun, 11 May 2014 15:33:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 650AC3806C; Sun, 11 May 2014 10:33:58 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id UApzrAbq_VY3; Sun, 11 May 2014 10:33:58 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 9828D3806B; Sun, 11 May 2014 10:33:57 -0500 (CDT) Message-ID: <536F9864.9080606@freebsd.org> Date: Sun, 11 May 2014 08:33:56 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r265864 - head/sys/dev/vt/hw/ofwfb References: <201405110158.s4B1wvFA072381@svn.freebsd.org> <20140511133517.N1100@besplex.bde.org> In-Reply-To: <20140511133517.N1100@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 15:34:00 -0000 On 05/10/14 23:51, Bruce Evans wrote: > On Sun, 11 May 2014, Nathan Whitehorn wrote: > >> Log: >> Make ofwfb not be painfully slow. This reduces the time for a >> verbose boot >> on my G4 iBook by more than half. Still 10% slower than syscons, but >> that's >> much better than a factor of 2. >> >> The slowness had to do with pathological write performance on 8-bit >> framebuffers, which are almost universally used on Open Firmware >> systems. >> Writing 1 byte at a time, potentially nonconsecutively, resulted in >> many >> extra PCI write cycles. This patch, in the common case where it's >> writing >> one or several characters in an 8x8 font, gangs the writes together >> into >> a set of 32-bit writes. This is a port of r143830 to vt(4). > > Only 10% slower? Bitmapped mode with 256 colors is inherently 4 times > slower for an 8x8 font (8 bytes/char instead 2) of and 8 times slower for > an 8x16 font. That's without any I/O pathology. Perhaps you are > comparing > with a syscons that is already very slow due to the hardware not > supporting > text mode. > > However, syscons has buffering that should limit this problem. This is indeed comparison to syscons in bitmap mode. PowerPC has no VGA text mode, so that's the best we could do. That using newcons's bitmap console instead of syscons's bitmap console almost tripled my boot time, however, was totally unreasonable and needed fixing. Whatever buffering syscons may have beyond what newcons has is at most a 10% thing. >> The EFI framebuffer is also extremely slow, probably for the same >> reason, >> and the same patch will likely help there. >> >> Modified: >> head/sys/dev/vt/hw/ofwfb/ofwfb.c >> >> Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c >> ============================================================================== >> >> --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Sun May 11 01:44:11 2014 >> (r265863) >> +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Sun May 11 01:58:56 2014 >> (r265864) >> @@ -136,6 +136,10 @@ ofwfb_bitbltchr(struct vt_device *vd, co >> uint32_t fgc, bgc; >> int c; >> uint8_t b, m; >> + union { >> + uint32_t l; >> + uint8_t c[4]; >> + } ch1, ch2; >> >> fgc = sc->sc_colormap[fg]; >> bgc = sc->sc_colormap[bg]; >> @@ -147,36 +151,70 @@ ofwfb_bitbltchr(struct vt_device *vd, co >> return; >> >> line = (sc->sc_stride * top) + left * sc->sc_depth/8; >> - for (; height > 0; height--) { >> - for (c = 0; c < width; c++) { >> - if (c % 8 == 0) >> + if (mask == NULL && sc->sc_depth == 8 && (width % 8 == 0)) { >> + for (; height > 0; height--) { >> + for (c = 0; c < width; c += 8) { >> b = *src++; >> - else >> - b <<= 1; >> - if (mask != NULL) { >> + > > Style bug (extra newline). This newline is an artifact of the weird way SVN has chosen to make a diff. There is no actual newline in the inside of this loop. >> + /* >> + * Assume that there is more background than >> + * foreground in characters and init accordingly >> + */ >> + ch1.l = ch2.l = (bg << 24) | (bg << 16) | >> + (bg << 8) | bg; >> + >> + /* >> + * Calculate 2 x 4-chars at a time, and then >> + * write these out. >> + */ >> + if (b & 0x80) ch1.c[0] = fg; >> + if (b & 0x40) ch1.c[1] = fg; >> + if (b & 0x20) ch1.c[2] = fg; >> + if (b & 0x10) ch1.c[3] = fg; >> + >> + if (b & 0x08) ch2.c[0] = fg; >> + if (b & 0x04) ch2.c[1] = fg; >> + if (b & 0x02) ch2.c[2] = fg; >> + if (b & 0x01) ch2.c[3] = fg; > > Style bugs (missing newlines). This is copied and pasted from the syscons driver. I'd prefer to keep it the same while we have both in the tree and are trying to keep them in sync. >> + >> + *(uint32_t *)(sc->sc_addr + line + c) = ch1.l; >> + *(uint32_t *)(sc->sc_addr + line + c + 4) = >> + ch2.l; >> + } >> + line += sc->sc_stride; >> + } >> + } else { >> + for (; height > 0; height--) { >> + for (c = 0; c < width; c++) { >> if (c % 8 == 0) >> - m = *mask++; >> + b = *src++; >> else >> - m <<= 1; >> - /* Skip pixel write, if mask has no bit set. */ >> - if ((m & 0x80) == 0) >> - continue; >> - } >> - switch(sc->sc_depth) { >> - case 8: >> - *(uint8_t *)(sc->sc_addr + line + c) = >> - b & 0x80 ? fg : bg; >> - break; >> - case 32: >> - *(uint32_t *)(sc->sc_addr + line + 4*c) = >> - (b & 0x80) ? fgc : bgc; >> - break; >> - default: >> - /* panic? */ >> - break; >> + b <<= 1; >> + if (mask != NULL) { >> + if (c % 8 == 0) >> + m = *mask++; >> + else >> + m <<= 1; >> + /* Skip pixel write, if mask not set. */ >> + if ((m & 0x80) == 0) >> + continue; >> + } >> + switch(sc->sc_depth) { >> + case 8: >> + *(uint8_t *)(sc->sc_addr + line + c) = >> + b & 0x80 ? fg : bg; >> + break; >> + case 32: >> + *(uint32_t *)(sc->sc_addr + line + 4*c) >> + = (b & 0x80) ? fgc : bgc; >> + break; >> + default: >> + /* panic? */ >> + break; >> + } >> } >> + line += sc->sc_stride; >> } >> - line += sc->sc_stride; >> } >> } > > A correctly-implemented console driver doesn't have itty-bitty hardware > i/o like the old version of this or itty-bitty buffering like the changed > version. There are many deficiencies in the general approach being used here. I'm trying to patch it just to work for the time being so that it isn't a huge regression in console performance compared to syscons. Hopefully, the general architectural issues -- which you outline well below -- get solved in due course. This patch at least fixes the immediate problem. -Nathan > I thought that syscons always had correct buffering. Actually, it > uses a hybrid scheme where, at least in text mode, the initial i/o is > itty-bitty 1 character+attribute at a time (16-bit i/o), but scrolling > and screen refresh is done bcopy, bcopy_io(), bcopy_fromio() and > bcopy_toio() and a couple of other functions (bzero_io(), fill*()) > from/to a properly cached buffer in normal memory. It used to use > only bcopy() and a couple of others (bzero(), fill*()), so it > automatically did 64-bit i/o's on 64-bit systems, except for fillw*() > which was intentionally 16 bits for compatibilty (but it didn't use > bcopy() which is needed for even more compatibility). It is unclear > which old systems break with frame buffer i/o's larger (or smaller) > than 16 bits. I never had any (x86) hardware that didn't work with any > size. The video card might be 16-bit only, but then it should just > tell the CPU this so that the CPU reduces to 16 bits using standard > x86 mechanisms. Video cards have been PCI or better for about 20 > years. PCI should support precisely 32-bits, but 64-bit frame buffer > accesses to PCI and AGP video cards always worked for me. > > bcopy*io() is more technically correct, but is very badly implemented > and much slower than bcopy() on most systems. Its misimplementation > includes not even using bus-space on x86. All bcopy*io() functions > use copyw() on x86, and copyw() is just a dumb 16-bit memcpy() written > in C. Writing it in C doesn't lose anything when it is used for a > slow i/o memory, but doing 16-bit i/o's does. And doing 16-bit i/o's > doesn't even give compatibility, since bzero_io() is just bzero() on > x86, so it always does wider i/o's. syscons has always used fillw*() > and never plain fill() since it doesn't the corresponding 32-bit > writes that might be given by fill(). fill() actually does 8-bit > writes. fb also uses the badly named and implemented filll_io(). > This doesn't actually support longs, but only u_int32_t. fill_io() > is at least ifdefed on ${ARCH}, so its access size is not completely > hard-coded. On arm and mips, all the ifdefed "io" functions except > fill_io use plain memcpy() or memset() so they get a maximum access > size and minimum hardware compatibilty. fillw() is 16 bits on these > arches since the access size is hard-coded in the API (and conversion > to memset() is not done). > > Pessimizations in syscons have made it about twice as slow as in > FreeBSD-5. > This is probably mostly due to switching from bcopy() to copyw(). There > is a lot of bloat in upper layers, but with 2GHz CPUs it would take a > factor of about 10 pessimizations there to be comparable with i/o > pessimizations. > > A correctly-implemented console driver assembles an image of the frame > buffer in fast memory and copies from there to the frame buffer in > large chunks. It is tricky to keep track of changed regions so as to > not copy unchanged regions. Copying everything at a refresh rate of > not much slower than 20 Hz works well. 200 Hz for animation, but that > is rarely needed. The bandwidth for 80x25 text mode at 20 Hz is 80 kB/ > second. That was easy in 1982. I aimed for 100 Hz refresh on 2 MHz > 6809 systems in 1987. PC hardware at 5 MHz was about twice as slow, > especially for frame buffers. But it could do 80 kB/second. The > bandwidth for 80x25 8x16 256 color bitmapped mode is 640kB/second. > This was difficult in 1982, but very easy now. Yet the WindowsXP > safe mode with command prompt console is about as slow at scrolling > as a 1982 system in graphics mode. It uses similar techniques to > implement the slowness: > - a large bitmapped screen. 640x200 8 colors in 1982. Quite > a bit larger (something like 1024x768 256 colors) in 20XX. > - write to the screen very slowly. Use 8-bit writes with i/o artifacts > if possible. The 1982 system had to do 8-bit writes to 3 color planes. > 256-color mode is simpler than most. Writes can also be done very > slowly by using another mode and misaligning text so that every > character written needs merging with pixels from adjacent characters. > - do scrolling in software by copying 1 pixel at a time, using > read-modify- > write > - I only tested this on 5-10 year old hardware, with a 1920x1080 screen > but not all of it used for the console window, and with a laptop > 1024x768 screen. A good way to be slow, one that has been portable to > PC systems since 1982, is to use the BIOS for video. The console was > about twice as fast on the laptop. This might be due to a combination > of fewer pixels and a less well pessimized BIOS. > > Some old screen benchmarks. The benchmark is basically to write lines > of the screen width and scroll. I stopped updating this often about 15 > years ago when frame buffers and CPUs became fast enough. But it appears > that software bloat and design errors have caught up. > > % ISA ET4000: 2.4MB/sec read, 5.9MB/sec write > % VLB ET4000/W32i: 6.8MB/sec read, 25.5MB/sec write > % PCI S3/868: 3.5MB/sec read, 23.1MB/sec write > % PCI S3/Virge: 4.1MB/sec read, 40.0MB/sec write > % PCI S3/Savage: 3.3MB/sec read, 25.8MB/sec write > % PCI Xpert: 5.3MB/sec read, 21.8MB/sec write > % PCI R9200SE: 5.8MB/sec read, 60.2MB/sec write (but 120MB/sec fpu, > 250/sec sfpu) > % -o means stty flag -opost > % % No-scroll: > > Scrolling is avoided by repositioning the cursor after every screenful. > > % % machine video O/S where real user > sys speed > % --------- ------- -------------- --------- ----- ---- > ----- ----- > % A/2223 PCI R9200SE FreeBSD-5.2m onscreen-o .026 0.00 > .026 76.9 > % A/2223 PCI R9200SE FreeBSD-5.2m offscreen-o .026 0.00 > .026 76.9 > % A/2223 PCI R9200SE FreeBSD-5.2m onscreen .031 0.00 > .031 64.5 > % A/2223 PCI R9200SE FreeBSD-5.2m offscreen .031 0.00 > .031 64.5 > > An 11 year old system. > > 'onscreen' means output to an active vty, 'offscreen' to an inactive vty. > The mere existence of vtys requires full buffering to fast memory for > inactive vtys, since there is no hardware frame buffer memory to write > to for the inactive vtys. You have to buffer the writes in a form that > can be replayed when an inactive vty becomes active, and converting > immediately to the final form is a good method (it does take more memory > and limits history to a raw form). 'offscreen' is potentially much > faster, > but in most cases it is only slightly faster, due to delayed refreshes > for 'onscreen' and relatively fast frame buffer memory. > > -opost is tested separately because the Linux console driver was > amazingly > slow without it. This shows that it is possible for the software bloat > to be so large that it dominates hardware slowness. FreeBSD also has > lots of bloat in the tty and syscons layers near opost, but it is in the > noise compared with the old console Linux driver. > > I forget the units for these measurements, except that the speed column > gives a bandwidth in MB/sec. I don't remember if this is for write(2) > bandwidth or is related to frame buffer bandwidth). Interpret them as > relative. > > On a system similar to the above, syscons scrolls at 50000 lines/sec. > Non-virtually, this would require a frame buffer bandwidth of 200MB/sec, > which is several times faster than possible. Since syscons only does > a direct update for bytes written, it needs only about 1/25 of this > bandwidth or 800KB/sec. This is not quite in the noise compared with > a frame buffer bandwidth of 60.2MB/sec. > > % K6/233 PCI S3/Virge minix-1.6.25++ offscreen 0.2 0.00 > 0.12 16.0 > % K6/233 PCI S3/Virge minix-1.6.25++ onscreen 0.2 0.00 > 0.12 16.0 > > The Minix driver from 1990 (rewritten to support virtual consoles and to > be efficient) is faster than syscons of course. It is smarter about > buffering, so the onnscreen case goes at almost the same speed as the > offscreen case. > > % K6/233 PCI S3/Virge FreeBSD-current onscreen-o 0.23 0.00 > 0.23 8.85 > % K6/233 PCI S3/Virge FreeBSD-current offscreen-o 0.23 0.00 > 0.23 8.85 > > syscons is just slightly slower for the offscreen case. -current was > only > current in ~2004. > > % K6/233 PCI S3/Virge FreeBSD-current onscreen 0.34 0.00 > 0.34 5.83 > % K6/233 PCI S3/Virge FreeBSD-current offscreen 0.34 0.00 > 0.34 5.81 > > But in the onscreen case, syscons is more than 50% slower, due to less > virtualization. This slowness became slower with faster frame buffers, > but is still noticeable in benchmarks with the S3/Virge's write bandwidth > of 40.0MB/sec. > > % P5/133 PCI S3/868 FreeBSD-current onscreen-o 0.39 0.00 > 0.39 5.10 > % P5/133 PCI S3/868 FreeBSD-current offscreen-o 0.40 0.00 > 0.40 5.00 > % P5/133 PCI S3/868 FreeBSD-current onscreen 0.51 0.00 > 0.50 3.92 > % P5/133 PCI S3/868 FreeBSD-current offscreen 0.51 0.00 > 0.51 3.92 > % K6/233 PCI S3/Virge linux-2.1.63 offscreen-o 0.97 0.00 > 0.97 2.06 > % K6/233 PCI S3/Virge linux-2.1.63 onscreen-o 1.03 0.00 > 1.03 1.93 > % K6/233 PCI S3/Virge linux-2.1.63 offscreen 1.18 0.00 > 1.18 1.69 > % DX2/66 VLB ET4000/W32i FreeBSD-current offscreen-o 1.18 0.00 > 1.16 1.69 > % DX2/66 VLB ET4000/W32i FreeBSD-current onscreen-o 1.27 0.02 > 1.23 1.57 > % K6/233 PCI S3/Virge linux-2.1.63 onscreen 1.38 0.00 > 1.38 1.45 > % 486/33 ISA ET4000 minix-1.6.25++ offscreen 2 0.01 1.45 > 1.37 > % 486/33 ISA ET4000 minix-1.6.25++ onscreen 2 0.01 1.60 > 1.24 > % DX2/66 VLB ET4000/W32i FreeBSD-current offscreen 1.60 0.00 > 1.59 1.25 > % DX2/66 VLB ET4000/W32i FreeBSD-current onscreen 1.70 0.01 > 1.66 1.18 > % 486/33 ISA ET4000 FreeBSD-current offscreen-o 2.30 0.01 > 2.28 0.87 > % 486/33 ISA ET4000 FreeBSD-current onscreen-o 2.39 0.02 > 2.32 0.84 > % 486/33 ISA ET4000 FreeBSD-current offscreen 3.15 0.03 > 3.10 0.63 > % 486/33 ISA ET4000 FreeBSD-current onscreen 3.27 0.00 > 3.21 0.61 > % DX2/66 VLB ET4000/W32i linux-1.2.13 offscreen-o 3.63 0.01 > 3.62 0.15 > % DX2/66 VLB ET4000/W32i linux-1.2.13 onscreen-o 3.65 0.01 > 3.63 0.55 > % DX2/66 VLB ET4000/W32i linux-1.2.13 offscreen 12.48 0.01 > 12.47 0.16 > % 486/33 ISA ET4000 linux-1.1.36 offscreen 20.80 0.00 > 20.80 0.10 > % DX2/66 VLB ET4000/W32i linux-1.2.13 onscreen 26.98 0.01 > 26.95 0.07 > % 486/33 ISA ET4000 linux-1.1.36 onscreen 38.34 0.02 > 38.38 0.05 > > The speedup from the worst case (old Linux on old hardware) to the > best case > (old Minix on new hardware) is a factor of 38.34/0.26 = 1475. Hardware > speeds only increased by a factor of about 223/33 = 67. Minix was only > 1.5 times faster than syscons and 10-20 times faster than Linux on old > hardware. > > % % Scroll: > % % machine video O/S where real user > sys speed > % --------- ------- -------------- --------- ----- ---- > ----- ----- > % A/2223 PCI R9200SE FreeBSD-5.2m onscreen-o .047 0.00 > .047 42.6 > % A/2223 PCI R9200SE FreeBSD-5.2m offscreen-o .047 0.00 > .047 42.6 > % A/2223 PCI R9200SE FreeBSD-5.2m onscreen .051 0.00 > .051 39.2 > % A/2223 PCI R9200SE FreeBSD-5.2m offscreen .051 0.00 > .051 39.2 > % K6/233 PCI S3/Virge minix-1.6.25++ offscreen 0.2 0.00 > 0.14 14.0 > % K6/233 PCI S3/Virge minix-1.6.25++ onscreen 0.2 0.00 > 0.14 14.0 > % K6/233 PCI S3/Virge FreeBSD-current onscreen-o 0.36 0.00 > 0.36 5.54 > % K6/233 PCI S3/Virge FreeBSD-current offscreen-o 0.40 0.00 > 0.40 5.01 > % K6/233 PCI S3/Virge FreeBSD-current onscreen 0.47 0.00 > 0.47 4.22 > % K6/233 PCI S3/Virge FreeBSD-current offscreen 0.51 0.00 > 0.51 3.92 > > Scrolling makes no difference for Minix due to the better virtualization. > It slows down syscons by about 50%. Strangely, the onscreen case is now > faster?! > > % P5/133 PCI S3/868 FreeBSD-current onscreen-o 1.24 0.00 > 1.23 1.61 > % P5/133 PCI S3/868 FreeBSD-current offscreen-o 1.28 0.00 > 1.27 1.56 > % P5/133 PCI S3/868 FreeBSD-current onscreen 1.35 0.00 > 1.34 1.48 > % P5/133 PCI S3/868 FreeBSD-current offscreen 1.39 0.00 > 1.38 1.44 > % K6/233 PCI S3/Virge linux-2.1.63 onscreen-o 1.49 0.00 > 1.49 1.34 > % 486/33 ISA ET4000 minix-1.6.25++ offscreen 2 0.00 1.70 > 1.18 > % 486/33 ISA ET4000 minix-1.6.25++ onscreen 2 0.00 1.81 > 1.10 > % K6/233 PCI S3/Virge linux-2.1.63 onscreen 1.85 0.00 > 1.85 1.08 > % K6/233 PCI S3/Virge linux-2.1.63 offscreen-o 2.88 0.00 > 2.88 0.69 > % K6/233 PCI S3/Virge linux-2.1.63 offscreen 3.10 0.00 > 3.10 0.65 > % DX2/66 VLB ET4000/W32i FreeBSD-current offscreen-o 3.39 0.02 > 3.36 0.59 > % DX2/66 VLB ET4000/W32i FreeBSD-current onscreen-o 3.67 0.02 > 3.63 0.54 > % DX2/66 VLB ET4000/W32i FreeBSD-current offscreen 3.82 0.00 > 3.81 0.52 > % DX2/66 VLB ET4000/W32i FreeBSD-current onscreen 4.14 0.03 > 4.06 0.48 > % DX2/66 VLB ET4000/W32i linux-1.2.13 onscreen-o 4.34 0.01 > 4.32 0.46 > % 486/33 ISA ET4000 FreeBSD-current offscreen-o 5.54 0.03 > 5.48 0.36 > % 486/33 ISA ET4000 FreeBSD-current onscreen-o 5.73 0.00 > 5.61 0.35 > % 486/33 ISA ET4000 FreeBSD-current offscreen 6.41 0.03 > 6.34 0.31 > % 486/33 ISA ET4000 FreeBSD-current onscreen 6.62 0.01 > 6.45 0.30 > > The old systems didn't have the CPU or frame buffer bandwidth to scroll > at 50000 lines/sec. Rescaling 50000 by this 6.62 divided by the above > 0.026 > gives only 196 lines/sec. That was usable, but since you can see the > scroll move it is not very good. Rescaling Minix's 2.0 gives 650 > lines/sec, > or a full screen refresh rate of 26 Hz. You can probably see the scroll > flicker but not move at this rate. Of course, the implementation does > delayed refresh to reach this rate, so most of the scrolling steps are > virtual and you can only see the screen flicker for other reasons. > syscons' > scrolling is also virtual. > > % DX2/66 VLB ET4000/W32i linux-1.2.13 offscreen-o13.48 0.01 > 13.47 0.15 > % DX2/66 VLB ET4000/W32i linux-1.2.13 offscreen 22.60 0.01 > 22.42 0.09 > % 486/33 ISA ET4000 linux-1.1.36 offscreen 23.56 0.03 > 23.60 0.08 > % DX2/66 VLB ET4000/W32i linux-1.2.13 onscreen 27.73 0.01 > 27.72 0.08 > % 486/33 ISA ET4000 linux-1.1.36 onscreen 40.26 0.00 > 40.27 0.05 > > Rescaling 50000 by this 40.26 divided by the above 0.026 gives 26 > lines/sec. > That is only a bit better than 1982 pixel mode quality. But this is for > text mode. > > Bruce > From owner-svn-src-head@FreeBSD.ORG Sun May 11 16:34:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45721B50; Sun, 11 May 2014 16:34:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32B7920D0; Sun, 11 May 2014 16:34:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4BGYIHv064940; Sun, 11 May 2014 16:34:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4BGYI8U064939; Sun, 11 May 2014 16:34:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201405111634.s4BGYI8U064939@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 11 May 2014 16:34:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265881 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 16:34:18 -0000 Author: jilles Date: Sun May 11 16:34:17 2014 New Revision: 265881 URL: http://svnweb.freebsd.org/changeset/base/265881 Log: include: Don't expose L_cuserid in strict C standard compliance mode. L_cuserid is supposed to be exposed only for old POSIX, or in the default (expose everything) environment. Modified: head/include/stdio.h Modified: head/include/stdio.h ============================================================================== --- head/include/stdio.h Sun May 11 15:03:24 2014 (r265880) +++ head/include/stdio.h Sun May 11 16:34:17 2014 (r265881) @@ -290,7 +290,7 @@ int vsscanf(const char * __restrict, co /* * Functions defined in all versions of POSIX 1003.1. */ -#if __BSD_VISIBLE || __POSIX_VISIBLE <= 199506 +#if __BSD_VISIBLE || (__POSIX_VISIBLE && __POSIX_VISIBLE <= 199506) #define L_cuserid 17 /* size for cuserid(3); MAXLOGNAME, legacy */ #endif From owner-svn-src-head@FreeBSD.ORG Sun May 11 16:49:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47AF7279; Sun, 11 May 2014 16:49:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34A7921BA; Sun, 11 May 2014 16:49:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4BGnWEU071231; Sun, 11 May 2014 16:49:32 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4BGnW91071230; Sun, 11 May 2014 16:49:32 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201405111649.s4BGnW91071230@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 11 May 2014 16:49:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265883 - head/sys/powerpc/ps3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 16:49:32 -0000 Author: nwhitehorn Date: Sun May 11 16:49:31 2014 New Revision: 265883 URL: http://svnweb.freebsd.org/changeset/base/265883 Log: Fix interrupt allocation after changes to nexus. This makes PS3 boot multiuser again (this commit comes from the PS3 itself). Some problems still exist with SMP, apparently, as I had to boot a non-SMP kernel to get here. Modified: head/sys/powerpc/ps3/ps3bus.c Modified: head/sys/powerpc/ps3/ps3bus.c ============================================================================== --- head/sys/powerpc/ps3/ps3bus.c Sun May 11 16:48:36 2014 (r265882) +++ head/sys/powerpc/ps3/ps3bus.c Sun May 11 16:49:31 2014 (r265883) @@ -127,6 +127,7 @@ static device_method_t ps3bus_methods[] struct ps3bus_softc { struct rman sc_mem_rman; + struct rman sc_intr_rman; struct mem_region *regions; int rcount; }; @@ -328,7 +329,11 @@ ps3bus_attach(device_t self) sc = device_get_softc(self); sc->sc_mem_rman.rm_type = RMAN_ARRAY; sc->sc_mem_rman.rm_descr = "PS3Bus Memory Mapped I/O"; + sc->sc_intr_rman.rm_type = RMAN_ARRAY; + sc->sc_intr_rman.rm_descr = "PS3Bus Interrupts"; rman_init(&sc->sc_mem_rman); + rman_init(&sc->sc_intr_rman); + rman_manage_region(&sc->sc_intr_rman, 0, ~0); /* Get memory regions for DMA */ mem_regions(&sc->regions, &sc->rcount, &sc->regions, &sc->rcount); @@ -562,8 +567,13 @@ ps3bus_alloc_resource(device_t bus, devi rm = &sc->sc_mem_rman; break; case SYS_RES_IRQ: - return (resource_list_alloc(&dinfo->resources, bus, child, - type, rid, start, end, count, flags)); + rle = resource_list_find(&dinfo->resources, SYS_RES_IRQ, + *rid); + rm = &sc->sc_intr_rman; + adjstart = rle->start; + adjcount = ulmax(count, rle->count); + adjend = ulmax(rle->end, rle->start + adjcount - 1); + break; default: device_printf(bus, "unknown resource request from %s\n", device_get_nameunit(child)); From owner-svn-src-head@FreeBSD.ORG Sun May 11 17:14:28 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE81EB2; Sun, 11 May 2014 17:14:28 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 95594241B; Sun, 11 May 2014 17:14:28 +0000 (UTC) Received: from [192.168.0.7] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s4BHEN7x086344 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 11 May 2014 17:14:25 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265861 - in head/sys: arm/include modules From: David Chisnall In-Reply-To: <1399813516.22079.429.camel@revolution.hippie.lan> Date: Sun, 11 May 2014 18:14:17 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405110043.s4B0h6B9040965@svn.freebsd.org> <20140511071002.GV74331@kib.kiev.ua> <1399812826.22079.427.camel@revolution.hippie.lan> <99074AB3-B833-4C8C-8925-C826259BF46A@cl.cam.ac.uk> <1399813516.22079.429.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1874) Cc: Konstantin Belousov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 17:14:28 -0000 On 11 May 2014, at 14:05, Ian Lepore wrote: > On Sun, 2014-05-11 at 13:58 +0100, David Chisnall wrote: >> On 11 May 2014, at 13:53, Ian Lepore wrote: >>=20 >>> Ooops, indeed, thanks. Although... it's a good change in terms of >>> speeding up the build, I just didn't intend to commit it until it = got >>> tested with -j levels higher than I can test with my little 6-core >>> machine. >>=20 >> I'd be happy to test it on a 32-core machine. Are there any specific = configs you need, or is buildkernel enough? >>=20 >> David >>=20 >>=20 >=20 > Well eventually it'll need a universe build test, but any = kernel/modules > build at -j32 would be a good start. $ make universe -j64 JFLAG=3D-j64 ... -------------------------------------------------------------- >>> make universe completed on Sun May 11 15:39:02 UTC 2014 (started Sun May 11 13:22:56 UTC 2014) -------------------------------------------------------------- This is with the revision immediately before the one where you reverted = the change. (e9e7ccdea56a38ab5bee2efec955f8b14b05fd15 from the github = mirror, which corresponds to svn r265876). David= From owner-svn-src-head@FreeBSD.ORG Sun May 11 17:28:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04B385C0; Sun, 11 May 2014 17:28:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E60702504; Sun, 11 May 2014 17:28:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4BHSvTL089396; Sun, 11 May 2014 17:28:57 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4BHSvDQ089395; Sun, 11 May 2014 17:28:57 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405111728.s4BHSvDQ089395@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 11 May 2014 17:28:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265885 - head/usr.bin/printf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 17:28:58 -0000 Author: pfg Date: Sun May 11 17:28:57 2014 New Revision: 265885 URL: http://svnweb.freebsd.org/changeset/base/265885 Log: printf: fix regression after illumos merges. The "bltin/bltin.h" wrappers do not support exit() and attempting to call it will exit sh completely. Note that errx() is acceptable but will always return with status 2. Reported by: jilles (and the testing framework) Fix by: jilles Pointyhat: pfg Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Sun May 11 17:18:09 2014 (r265884) +++ head/usr.bin/printf/printf.c Sun May 11 17:28:57 2014 (r265885) @@ -101,6 +101,8 @@ static void usage(void); static const char digits[] = "0123456789"; +static char end_fmt[1]; + static int myargc; static char **myargv; static char **gargv; @@ -171,11 +173,11 @@ main(int argc, char *argv[]) fmt += 2; } else { fmt = printf_doformat(fmt, &rval); - if (fmt == NULL) { + if (fmt == NULL || fmt == end_fmt) { #ifdef SHELL INTON; #endif - return (1); + return (fmt == NULL ? 1 : rval); } end = 0; } @@ -372,7 +374,7 @@ printf_doformat(char *fmt, int *rval) fputs(p, stdout); free(p); if (getout) - exit(*rval); + return (end_fmt); break; } case 'c': { From owner-svn-src-head@FreeBSD.ORG Sun May 11 17:41:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD230A52; Sun, 11 May 2014 17:41:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA8F72638; Sun, 11 May 2014 17:41:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4BHfTUe095019; Sun, 11 May 2014 17:41:29 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4BHfTXD095018; Sun, 11 May 2014 17:41:29 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201405111741.s4BHfTXD095018@svn.freebsd.org> From: Alan Cox Date: Sun, 11 May 2014 17:41:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265886 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 17:41:29 -0000 Author: alc Date: Sun May 11 17:41:29 2014 New Revision: 265886 URL: http://svnweb.freebsd.org/changeset/base/265886 Log: With the new-and-improved vm_fault_copy_entry() (r265843), we can always avoid soft page faults when adding write access to user wired entries in vm_map_protect(). Previously, we only avoided the soft page fault when the underlying pages were copy-on-write. In other words, we avoided the pages faults that might sleep on page allocation, but not the trivial page faults to update the physical map. Reviewed by: kib MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun May 11 17:28:57 2014 (r265885) +++ head/sys/vm/vm_map.c Sun May 11 17:41:29 2014 (r265886) @@ -1978,10 +1978,17 @@ vm_map_protect(vm_map_t map, vm_offset_t else current->protection = new_prot; - if ((current->eflags & (MAP_ENTRY_COW | MAP_ENTRY_USER_WIRED)) - == (MAP_ENTRY_COW | MAP_ENTRY_USER_WIRED) && + /* + * For user wired map entries, the normal lazy evaluation of + * write access upgrades through soft page faults is + * undesirable. Instead, immediately copy any pages that are + * copy-on-write and enable write access in the physical map. + */ + if ((current->eflags & MAP_ENTRY_USER_WIRED) != 0 && (current->protection & VM_PROT_WRITE) != 0 && (old_prot & VM_PROT_WRITE) == 0) { + KASSERT(old_prot != VM_PROT_NONE, + ("vm_map_protect: inaccessible wired map entry")); vm_fault_copy_entry(map, map, current, current, NULL); } From owner-svn-src-head@FreeBSD.ORG Sun May 11 17:43:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81326B9F; Sun, 11 May 2014 17:43:41 +0000 (UTC) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2D17E2645; Sun, 11 May 2014 17:43:40 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 6F8403C0D08; Mon, 12 May 2014 03:43:31 +1000 (EST) Date: Mon, 12 May 2014 03:43:24 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Nathan Whitehorn Subject: Re: svn commit: r265864 - head/sys/dev/vt/hw/ofwfb In-Reply-To: <536F9864.9080606@freebsd.org> Message-ID: <20140512015015.G1959@besplex.bde.org> References: <201405110158.s4B1wvFA072381@svn.freebsd.org> <20140511133517.N1100@besplex.bde.org> <536F9864.9080606@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eojmkOZX c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=5bbp3XeTFoQA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=tRt_y7I4hvYYh4juQrIA:9 a=B1gl18DMszdvRfAL:21 a=YydNsdlel4AjIjML:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 17:43:41 -0000 On Sun, 11 May 2014, Nathan Whitehorn wrote: > On 05/10/14 23:51, Bruce Evans wrote: >> On Sun, 11 May 2014, Nathan Whitehorn wrote: >> Only 10% slower? Bitmapped mode with 256 colors is inherently 4 times >> slower for an 8x8 font (8 bytes/char instead 2) of and 8 times slower for >> an 8x16 font. That's without any I/O pathology. Perhaps you are comparing >> with a syscons that is already very slow due to the hardware not supporting >> text mode. >> >> However, syscons has buffering that should limit this problem. > > This is indeed comparison to syscons in bitmap mode. PowerPC has no VGA text > mode, so that's the best we could do. That using newcons's bitmap console > instead of syscons's bitmap console almost tripled my boot time, however, was > totally unreasonable and needed fixing. Whatever buffering syscons may have > beyond what newcons has is at most a 10% thing. Really? The slowdown would need to be a factor of several hundred to be noticeable and several thousand to be painful. Syscons actually uses a slow mode with non-delayed update for kernel messages. This means that it will it must be many times slower than the best case. Calculations below. >> A correctly-implemented console driver doesn't have itty-bitty hardware >> i/o like the old version of this or itty-bitty buffering like the changed >> version. > > There are many deficiencies in the general approach being used here. I'm > trying to patch it just to work for the time being so that it isn't a huge > regression in console performance compared to syscons. Hopefully, the general > architectural issues -- which you outline well below -- get solved in due > course. This patch at least fixes the immediate problem. Some more details on the timing... >> Some old screen benchmarks. The benchmark is basically to write lines >> of the screen width and scroll. I stopped updating this often about 15 >> years ago when frame buffers and CPUs became fast enough. But it appears >> that software bloat and design errors have caught up. It is difficult to generate data fast enough for syscons to be the bottleneck. My simple test program does 1-char writes so the syscall overhead dominates. I must have used a variation of it in the old tests, but can't remember what. So I reran some tests using: dd if=/dev/zero bs=1000000 count=many | tr '\000' c | time dd bs=10000000 (or with bs reduced to time slow cases). Here tr is barely fast enough to not be a bottleneck. The final dd was needed needed to reblock, else tr sometimes does 1-char writes. c is either 'p' to test normal output, or '\012' to test scrolling. >> % machine video O/S where real user sys >> speed >> % --------- ------- -------------- --------- ----- ---- ----- >> ----- >> % A/2223 PCI R9200SE FreeBSD-5.2m onscreen-o .026 0.00 .026 >> 76.9 >> % A/2223 PCI R9200SE FreeBSD-5.2m offscreen-o .026 0.00 .026 >> 76.9 >> % A/2223 PCI R9200SE FreeBSD-5.2m onscreen .031 0.00 .031 >> 64.5 >> % A/2223 PCI R9200SE FreeBSD-5.2m offscreen .031 0.00 .031 >> 64.5 >> >> An 11 year old system. >> ... >> I forget the units for these measurements, except that the speed column >> gives a bandwidth in MB/sec. I don't remember if this is for write(2) >> bandwidth or is related to frame buffer bandwidth). Interpret them as >> relative. The speed is for write(2) bandwidth, times 2 for character+attribute. It is for writing p's. It is close to the frame buffer bandwidth. You can pessimize this speed by a factor of 1000 and still have a usable console. More than 30 thousand characters/sec instead of more than 30 million. I find 11520 for a serial tty noticeably slow, but useable. >> On a system similar to the above, syscons scrolls at 50000 lines/sec. >> Non-virtually, this would require a frame buffer bandwidth of 200MB/sec, >> which is several times faster than possible. Since syscons only does >> a direct update for bytes written, it needs only about 1/25 of this >> bandwidth or 800KB/sec. This is not quite in the noise compared with >> a frame buffer bandwidth of 60.2MB/sec. Actually, on a similar system, syscons scrolls at 1.04 million lines/sec with -opost and at 0.94 million lines/sec with opost (for printing lots of newlines). This must be mostly virtual, with most steps not done in the frame buffer. If it were physical, then the frame buffer bandwidth for the -opost case would be 8.3GB/sec. The main memory bandwidth for this is relatively trivial, since writing 1 newline only involves clearing 1 line in the history buffer and not moving a screenful to the frame buffer. It is 166MB/sec. >> % K6/233 PCI S3/Virge linux-2.1.63 offscreen-o 0.97 0.00 0.97 >> 2.06 >> % K6/233 PCI S3/Virge linux-2.1.63 onscreen-o 1.03 0.00 1.03 >> 1.93 >> % K6/233 PCI S3/Virge linux-2.1.63 offscreen 1.18 0.00 1.18 >> 1.69 I tried a newer Linux (ttylinux 2.6.30.5) console on newer hardware similar to the above. For normal output, its speed was 2.7 million characters/sec (double this to compare with the speed column above). -opost didn't make much difference for normal output. For scrolling, its speed was 22 thousand lines/sec with opost and 83 thousand lines/sec with -opost. I think it writes every line to the frame buffer, but reduces the slowness of this by using hardware scrolling. Calculations for direct updates in kernel mode: at best they go at the frame buffer bandwidth, with the whole screen copied for each scroll (hardware scrolling would help here). For 80x25, this gives 4KB to move per newline and relatively few other slow accesses. So the scrolling speed is about 20 thousand lines/sec for an 80MB/sec frame buffer. Almost the same as Linux with opost. Divide by 8 for pixel mode with 8x16 256 colors. Still plenty for kernel messages, but there is no longer a factor of hundreds to spare. Bruce From owner-svn-src-head@FreeBSD.ORG Sun May 11 17:54:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D38D835C for ; Sun, 11 May 2014 17:54:55 +0000 (UTC) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A24CC2702 for ; Sun, 11 May 2014 17:54:55 +0000 (UTC) Received: by mail-pa0-f50.google.com with SMTP id fb1so6686133pad.23 for ; Sun, 11 May 2014 10:54:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=WslZm/aJhUYzsXdmwa2Ns2UXbUCQUYgRA57WIwFOLOQ=; b=Le3xxIomxqdctM8Sdn+6tx5rl2IKZcnLhVTZpZWK56aMlNUZFY6Lh7HpCXRxSquffd 25OBObB19JJ0h0F+d1FiqcQVJJzXzOn/4E+WKEoxtGjvvgYzZU+dj/CgwkrzXU/8MUIi x3Im9v0qkyJoYr5kouJP0X4hI+dFpUXhcImCh+ztbG58RBEta0OrYrJVJh0SwVFepxNW 9SH28H/vdz8o+GnupnIlIsdbW8uDG7DSf940kRI/tJSTHgHWPik0FKbCpHF/mNHV6acg QvH+OVgVwEXM1I7QF3LVpH8eTjqYoqgCSMr0u9UQc99MpVyfXSKIXS9ryIyTrWqwJsGg ASyg== X-Gm-Message-State: ALoCoQlofhQQN6EBazXWAaK/JnkV+URGhxMAG+8maluucINKBeVlAmPQl5+sA5PtO+Xejr+e0/Sl X-Received: by 10.66.65.169 with SMTP id y9mr46067452pas.145.1399830889325; Sun, 11 May 2014 10:54:49 -0700 (PDT) Received: from lgwl-achen.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id el14sm37984402pac.31.2014.05.11.10.54.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 11 May 2014 10:54:48 -0700 (PDT) Sender: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265861 - in head/sys: arm/include modules From: Warner Losh In-Reply-To: <1399813516.22079.429.camel@revolution.hippie.lan> Date: Sun, 11 May 2014 11:54:46 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405110043.s4B0h6B9040965@svn.freebsd.org> <20140511071002.GV74331@kib.kiev.ua> <1399812826.22079.427.camel@revolution.hippie.lan> <99074AB3-B833-4C8C-8925-C826259BF46A@cl.cam.ac.uk> <1399813516.22079.429.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1874) Cc: Konstantin Belousov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, David Chisnall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 17:54:55 -0000 On May 11, 2014, at 7:05 AM, Ian Lepore wrote: > On Sun, 2014-05-11 at 13:58 +0100, David Chisnall wrote: >> On 11 May 2014, at 13:53, Ian Lepore wrote: >>=20 >>> Ooops, indeed, thanks. Although... it's a good change in terms of >>> speeding up the build, I just didn't intend to commit it until it = got >>> tested with -j levels higher than I can test with my little 6-core >>> machine. >>=20 >> I'd be happy to test it on a 32-core machine. Are there any specific = configs you need, or is buildkernel enough? >>=20 >> David >>=20 >>=20 >=20 > Well eventually it'll need a universe build test, but any = kernel/modules > build at -j32 would be a good start. With the lib races, I=92ve found that you need to do a variety of = different =91j=92 values. My 12 core box is enough to provoke the races = sometimes, but it is more likely with different j values. I routinely = use 12, 16, 20, 24, 32 and 100 when proofing my changes. Warner From owner-svn-src-head@FreeBSD.ORG Sun May 11 18:07:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A24F653; Sun, 11 May 2014 18:07:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37A0627B0; Sun, 11 May 2014 18:07:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4BI78WN006930; Sun, 11 May 2014 18:07:08 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4BI78n3006929; Sun, 11 May 2014 18:07:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405111807.s4BI78n3006929@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 11 May 2014 18:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265887 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 18:07:08 -0000 Author: kib Date: Sun May 11 18:07:07 2014 New Revision: 265887 URL: http://svnweb.freebsd.org/changeset/base/265887 Log: Fix locking. The dst_object must remain locked on the retry of the loop iteration. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 6 days Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun May 11 17:41:29 2014 (r265886) +++ head/sys/vm/vm_fault.c Sun May 11 18:07:07 2014 (r265887) @@ -1359,6 +1359,7 @@ again: VM_OBJECT_WUNLOCK(dst_object); VM_OBJECT_RUNLOCK(object); VM_WAIT; + VM_OBJECT_WLOCK(dst_object); goto again; } } while (dst_m == NULL); From owner-svn-src-head@FreeBSD.ORG Sun May 11 18:22:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 166DC868; Sun, 11 May 2014 18:22:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 038B828E8; Sun, 11 May 2014 18:22:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4BIM5kD015146; Sun, 11 May 2014 18:22:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4BIM5Sn015145; Sun, 11 May 2014 18:22:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201405111822.s4BIM5Sn015145@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 11 May 2014 18:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265888 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 18:22:06 -0000 Author: nwhitehorn Date: Sun May 11 18:22:05 2014 New Revision: 265888 URL: http://svnweb.freebsd.org/changeset/base/265888 Log: OF_peer() in IEEE 1275 returns 0 if no peer exists, not -1. Modified: head/sys/dev/ofw/ofwbus.c Modified: head/sys/dev/ofw/ofwbus.c ============================================================================== --- head/sys/dev/ofw/ofwbus.c Sun May 11 18:07:07 2014 (r265887) +++ head/sys/dev/ofw/ofwbus.c Sun May 11 18:22:05 2014 (r265888) @@ -187,7 +187,7 @@ ofwbus_identify(driver_t *driver, device { /* Check if Open Firmware has been instantiated */ - if (OF_peer(0) == -1) + if (OF_peer(0) == 0) return; if (device_find_child(parent, "ofwbus", -1) == NULL) From owner-svn-src-head@FreeBSD.ORG Sun May 11 18:47:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 687E6233; Sun, 11 May 2014 18:47:04 +0000 (UTC) Received: from mail-oa0-x230.google.com (mail-oa0-x230.google.com [IPv6:2607:f8b0:4003:c02::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F31072A50; Sun, 11 May 2014 18:47:03 +0000 (UTC) Received: by mail-oa0-f48.google.com with SMTP id i4so7227930oah.35 for ; Sun, 11 May 2014 11:47:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=C5gONxLtA8oDeLnOeUKwigoK3C7ibOoovdVM1aFUc0E=; b=CkFAOKGXJr53WXanJVeYhJZ7DtT4qlDusuyDkLerhA17M0E6Od9BSkxq0PHxzOaHMD g1aZAVqWUnTbQu5ub2K2hQS7sDbtcrYm/Kj5uJLxwjLiCBymiCUjjc22An27GHzKVZFa 87PdbTnPpMIQ22NFvr7tLqiDtjNXNWYg1LzZIawoHTs7tlcURQUaoAYnbS33RaB7tO6m bsWo3Qv5wQJcodreujm/4qBORCIFWyhUCBZ4crCfV1umFi+D5ja3iytnbuarBuj1addS II04m2n8/+f7QYfWqZUJVjwgeJ2PRS+E5ajhDLvwyUK9GdYVPKivn3faqPCVVnlxmqEW 1i9Q== MIME-Version: 1.0 X-Received: by 10.60.102.198 with SMTP id fq6mr28077578oeb.6.1399834023262; Sun, 11 May 2014 11:47:03 -0700 (PDT) Received: by 10.182.142.34 with HTTP; Sun, 11 May 2014 11:47:03 -0700 (PDT) In-Reply-To: References: <201405101659.s4AGxFcF024753@svn.freebsd.org> <20140510221647.GJ36036@ivaldir.etoilebsd.net> Date: Sun, 11 May 2014 14:47:03 -0400 Message-ID: Subject: Re: svn commit: r265842 - head From: Benjamin Kaduk To: Eitan Adler Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: "svn-src-head@freebsd.org" , Baptiste Daroussin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 18:47:04 -0000 On Sat, May 10, 2014 at 7:45 PM, Eitan Adler wrote: > On 10 May 2014 15:16, Baptiste Daroussin wrote: > > On Sat, May 10, 2014 at 04:59:15PM +0000, Eitan Adler wrote: > >> Author: eadler > >> Date: Sat May 10 16:59:15 2014 > >> New Revision: 265842 > >> URL: http://svnweb.freebsd.org/changeset/base/265842 > >> > >> Log: > >> arcconfig: add one > >> > >> Add a .arcconfig to allow arc to work in its usual way. > >> > > > > You for got the project_id > > project_id is not used anymore. Its replacement project.name as far I > know is not required. Its use is directly tied to certain > configuration options which I can not set. I'll let the FreeBSD > phabricator admins set that up. > > I would have liked to see some mention of what arc is, why it is useful for FreeBSD, and how the FreeBSD project is going to be using it, in the commit message or an email to -current. I guess one of these can still happen :) -Ben From owner-svn-src-head@FreeBSD.ORG Sun May 11 18:49:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BFF6C3E5; Sun, 11 May 2014 18:49:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 931E62A60; Sun, 11 May 2014 18:49:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4BInJi8025304; Sun, 11 May 2014 18:49:19 GMT (envelope-from thomas@svn.freebsd.org) Received: (from thomas@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4BInJwS025302; Sun, 11 May 2014 18:49:19 GMT (envelope-from thomas@svn.freebsd.org) Message-Id: <201405111849.s4BInJwS025302@svn.freebsd.org> From: Thomas Quinot Date: Sun, 11 May 2014 18:49:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265893 - head/usr.bin/stat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 18:49:19 -0000 Author: thomas Date: Sun May 11 18:49:18 2014 New Revision: 265893 URL: http://svnweb.freebsd.org/changeset/base/265893 Log: Minor fixes to previous change introducing switch -H, as per comments on -arch. Reviewed by: gleb Modified: head/usr.bin/stat/stat.1 head/usr.bin/stat/stat.c Modified: head/usr.bin/stat/stat.1 ============================================================================== --- head/usr.bin/stat/stat.1 Sun May 11 18:27:04 2014 (r265892) +++ head/usr.bin/stat/stat.1 Sun May 11 18:49:18 2014 (r265893) @@ -130,6 +130,7 @@ and use .Xr fhstat 2 instead of .Xr lstat 2 . +This requires root privileges. .It Fl L Use .Xr stat 2 Modified: head/usr.bin/stat/stat.c ============================================================================== --- head/usr.bin/stat/stat.c Sun May 11 18:27:04 2014 (r265892) +++ head/usr.bin/stat/stat.c Sun May 11 18:49:18 2014 (r265893) @@ -186,6 +186,7 @@ int format1(const struct stat *, /* stat char *, size_t, /* a place to put the output */ int, int, int, int, /* the parsed format */ int, int); +int hex2byte(const char [2]); #if HAVE_STRUCT_STAT_ST_FLAGS char *xfflagstostr(unsigned long); #endif @@ -214,7 +215,7 @@ main(int argc, char *argv[]) lsF = 0; fmtchar = '\0'; usestat = 0; - nfs_handle = 0; + nfs_handle = 0; nonl = 0; quiet = 0; linkfail = 0; @@ -327,32 +328,27 @@ main(int argc, char *argv[]) rc = fstat(STDIN_FILENO, &st); } else { int j; - char *inval; file = argv[0]; if (nfs_handle) { rc = 0; - bzero (&fhnd, sizeof fhnd); - j = MIN(2 * sizeof fhnd, strlen(file)); - if (j & 1) { + bzero(&fhnd, sizeof(fhnd)); + j = MIN(2 * sizeof(fhnd), strlen(file)); + if ((j & 1) != 0) { rc = -1; } else { while (j) { - ((char*) &fhnd)[j / 2 - 1] = - strtol(&file[j - 2], - &inval, 16); - if (inval != NULL) { - rc = -1; + rc = hex2byte(&file[j - 2]); + if (rc == -1) break; - } - argv[0][j - 2] = '\0'; + ((char*) &fhnd)[j / 2 - 1] = rc; j -= 2; } - if (!rc) - rc = fhstat(&fhnd, &st); - else - errno = EINVAL; } + if (rc == -1) + errno = EINVAL; + else + rc = fhstat(&fhnd, &st); } else if (usestat) { /* @@ -1091,3 +1087,12 @@ format1(const struct stat *st, return (snprintf(buf, blen, lfmt, data)); } + + +#define hex2nibble(c) (c <= '9' ? c - '0' : toupper(c) - 'A' + 10) +int +hex2byte(const char c[2]) { + if (!(ishexnumber(c[0]) && ishexnumber(c[1]))) + return -1; + return (hex2nibble(c[0]) << 4) + hex2nibble(c[1]); +} From owner-svn-src-head@FreeBSD.ORG Sun May 11 20:06:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A7ED446; Sun, 11 May 2014 20:06:49 +0000 (UTC) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3EBF921EC; Sun, 11 May 2014 20:06:48 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id m15so6073921wgh.20 for ; Sun, 11 May 2014 13:06:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=q+Eskq8ah4NoTp9osTeZfHn78jQcV8TByMSUMA1N6SY=; b=XfE1lf8uLJMR7EzVVXFiOGWZDgu5E7ava4rj4ODCKj6KdQAmbtEFbLkT+iMKPbp6J6 p3xe1cATc6/DnfwQvv4N9ojERf6R3QnKHGAEs5lXJcZi3f/GciKDNKkvIKO9F0KJa4TF dwihoG1yeDzaNyogv4ZYiOXl5YppjNnAUkCE4tQ6hRufythL7B+GH2nASo6idKDGOR0j WxfCE7C3mZYOVyU31yZDa7l3J1GYcqmWnlpJZ65USrLvw6eK0czufS1gMuLRe21IF55B Hlq+a9164JEbO950cH5JDwYy8Z6NwPhVC993LivgSMItZLhWoWNIcFegYWFEwxlX2cc1 iY2g== X-Received: by 10.180.82.133 with SMTP id i5mr12542729wiy.50.1399838806304; Sun, 11 May 2014 13:06:46 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id m2sm14896000wjf.42.2014.05.11.13.06.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 May 2014 13:06:45 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 11 May 2014 22:06:43 +0200 From: Baptiste Daroussin To: Benjamin Kaduk Subject: Re: svn commit: r265842 - head Message-ID: <20140511200643.GG22154@ivaldir.etoilebsd.net> References: <201405101659.s4AGxFcF024753@svn.freebsd.org> <20140510221647.GJ36036@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PpAOPzA3dXsRhoo+" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Eitan Adler X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 20:06:49 -0000 --PpAOPzA3dXsRhoo+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 11, 2014 at 02:47:03PM -0400, Benjamin Kaduk wrote: > On Sat, May 10, 2014 at 7:45 PM, Eitan Adler wrote: >=20 > > On 10 May 2014 15:16, Baptiste Daroussin wrote: > > > On Sat, May 10, 2014 at 04:59:15PM +0000, Eitan Adler wrote: > > >> Author: eadler > > >> Date: Sat May 10 16:59:15 2014 > > >> New Revision: 265842 > > >> URL: http://svnweb.freebsd.org/changeset/base/265842 > > >> > > >> Log: > > >> arcconfig: add one > > >> > > >> Add a .arcconfig to allow arc to work in its usual way. > > >> > > > > > > You for got the project_id > > > > project_id is not used anymore. Its replacement project.name as far I > > know is not required. Its use is directly tied to certain > > configuration options which I can not set. I'll let the FreeBSD > > phabricator admins set that up. > > > > > I would have liked to see some mention of what arc is, why it is useful f= or > FreeBSD, and how the FreeBSD project is going to be using it, in the comm= it > message or an email to -current. I guess one of these can still happen :) >=20 It will happen once experiment is over and most of the rough edges will be polished ;) regards, Bapt --PpAOPzA3dXsRhoo+ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iEYEARECAAYFAlNv2FMACgkQ8kTtMUmk6Ez82gCgubclGDqPSb+f1X/Z8aQU+1kH VaoAoJwbS+yAP7g5zb0diodtNM8s9D2y =fOqb -----END PGP SIGNATURE----- --PpAOPzA3dXsRhoo+-- From owner-svn-src-head@FreeBSD.ORG Sun May 11 21:07:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7AD1163C; Sun, 11 May 2014 21:07:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6812A2636; Sun, 11 May 2014 21:07:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4BL71il090068; Sun, 11 May 2014 21:07:01 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4BL71LN090061; Sun, 11 May 2014 21:07:01 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201405112107.s4BL71LN090061@svn.freebsd.org> From: Dimitry Andric Date: Sun, 11 May 2014 21:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265895 - in head/gnu/lib: libstdc++ libsupc++ X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 21:07:01 -0000 Author: dim Date: Sun May 11 21:07:00 2014 New Revision: 265895 URL: http://svnweb.freebsd.org/changeset/base/265895 Log: Allow libstdc++ and libsupc++ to compile with clang again, after the bsd.*.mk infrastructure changes. Apparently, you must now modify CXXFLAGS *before* including bsd.lib.mk, or your changes will be lost. Modified: head/gnu/lib/libstdc++/Makefile head/gnu/lib/libsupc++/Makefile Modified: head/gnu/lib/libstdc++/Makefile ============================================================================== --- head/gnu/lib/libstdc++/Makefile Sun May 11 20:44:58 2014 (r265894) +++ head/gnu/lib/libstdc++/Makefile Sun May 11 21:07:00 2014 (r265895) @@ -632,9 +632,9 @@ ${VERSION_MAP}: ${SRCDIR}/config/abi/pre CLEANFILES+= ${VERSION_MAP} +CXXFLAGS.clang+= -stdlib=libstdc++ + .include # Filter out libc++-specific flags, and -std= flags above c++98 or gnu++98. CXXFLAGS:= ${CXXFLAGS:N-stdlib=libc++:N-std=c++[01][13x]:N-std=gnu++[01][13x]} - -CXXFLAGS.clang+= -stdlib=libstdc++ Modified: head/gnu/lib/libsupc++/Makefile ============================================================================== --- head/gnu/lib/libsupc++/Makefile Sun May 11 20:44:58 2014 (r265894) +++ head/gnu/lib/libsupc++/Makefile Sun May 11 21:07:00 2014 (r265895) @@ -51,10 +51,9 @@ CLEANFILES+= unwind.h VERSION_MAP= ${.CURDIR}/Version.map +CXXFLAGS.clang+= -stdlib=libstdc++ .include # Filter out libc++-specific flags, and -std= flags above c++98 or gnu++98. CXXFLAGS:= ${CXXFLAGS:N-stdlib=libc++:N-std=c++[01][13x]:N-std=gnu++[01][13x]} - -CXXFLAGS.clang+= -stdlib=libstdc++ From owner-svn-src-head@FreeBSD.ORG Sun May 11 21:21:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7AC89B05; Sun, 11 May 2014 21:21:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 685BA2749; Sun, 11 May 2014 21:21:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4BLLFnJ099779; Sun, 11 May 2014 21:21:15 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4BLLFAA099777; Sun, 11 May 2014 21:21:15 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201405112121.s4BLLFAA099777@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 11 May 2014 21:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265896 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 21:21:15 -0000 Author: jilles Date: Sun May 11 21:21:14 2014 New Revision: 265896 URL: http://svnweb.freebsd.org/changeset/base/265896 Log: accept(),accept4(): Don't set *addrlen = 0 on [ECONNABORTED]. If the underlying protocol reported an error (e.g. because a connection was closed while waiting in the queue), this error was also indicated by returning a zero-length address. For all other kinds of errors (e.g. [EAGAIN], [ENFILE], [EMFILE]), *addrlen is unmodified and there are successful cases where a zero-length address is returned (e.g. a connection from an unbound Unix-domain socket), so this error indication is not reliable. As reported in Austin Group bug #836, modifying *addrlen on error may cause subtle bugs if applications retry the call without resetting *addrlen. Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Sun May 11 21:07:00 2014 (r265895) +++ head/sys/kern/uipc_syscalls.c Sun May 11 21:21:14 2014 (r265896) @@ -414,14 +414,8 @@ accept1(td, s, uname, anamelen, flags) error = kern_accept4(td, s, &name, &namelen, flags, &fp); - /* - * return a namelen of zero for older code which might - * ignore the return value from accept. - */ - if (error != 0) { - (void) copyout(&namelen, anamelen, sizeof(*anamelen)); + if (error != 0) return (error); - } if (error == 0 && uname != NULL) { #ifdef COMPAT_OLDSOCK @@ -555,15 +549,8 @@ kern_accept4(struct thread *td, int s, s (void) fo_ioctl(nfp, FIOASYNC, &tmp, td->td_ucred, td); sa = 0; error = soaccept(so, &sa); - if (error != 0) { - /* - * return a namelen of zero for older code which might - * ignore the return value from accept. - */ - if (name) - *namelen = 0; + if (error != 0) goto noconnection; - } if (sa == NULL) { if (name) *namelen = 0; From owner-svn-src-head@FreeBSD.ORG Sun May 11 22:08:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1BF7C605 for ; Sun, 11 May 2014 22:08:14 +0000 (UTC) Received: from mail-ie0-f169.google.com (mail-ie0-f169.google.com [209.85.223.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA0222A39 for ; Sun, 11 May 2014 22:08:13 +0000 (UTC) Received: by mail-ie0-f169.google.com with SMTP id lx4so566013iec.0 for ; Sun, 11 May 2014 15:08:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=O/jDoF5KgscGRQ+YpdzWrc9+yY9x6OC58JZIkAYqGYQ=; b=Pn5qLEctIle5tOslmadsjkCZ6D+TWMEphzy7l0ANYu40UMPrIwneE50nakASDH8azm lTZnnjFHNyGU36vmR1Q2gqAKgx0EWK3p6xgdK7Bf2xMhngosw5gigrJ4DvIKT8b+qIkR BgmpNyWYhqo3ZC7Bfb31P4Kzxyhp/YQ5QOkk4Fy3uoXw39add5MFiQAgKMpkyNxk1USi pAVF/ZsnQ5wDkL98OiyJAYe8M+K5sMSrAB/9dQgDuOJKEWgEAVnryLBt99SvweRlTu// n2l7c1Bbky5NZgbSg6sBvT6OwUaCbb7XkB0lNQjiWelLKqRmVyGhJiU22D/xKoVu+CNV EFww== X-Gm-Message-State: ALoCoQmxn8HUR+y+u+9oc0bD8fEtKZrJY+mXmSsXay6ILhQ+cMTRm5+e6VpJs1BB6DtpwWI15Iq1 X-Received: by 10.50.1.111 with SMTP id 15mr14895486igl.7.1399846087669; Sun, 11 May 2014 15:08:07 -0700 (PDT) Received: from netflix-mac.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id k8sm17124489ige.0.2014.05.11.15.08.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 11 May 2014 15:08:07 -0700 (PDT) Sender: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265895 - in head/gnu/lib: libstdc++ libsupc++ From: Warner Losh In-Reply-To: <201405112107.s4BL71LN090061@svn.freebsd.org> Date: Sun, 11 May 2014 16:08:06 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405112107.s4BL71LN090061@svn.freebsd.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 22:08:14 -0000 On May 11, 2014, at 3:07 PM, Dimitry Andric wrote: > Author: dim > Date: Sun May 11 21:07:00 2014 > New Revision: 265895 > URL: http://svnweb.freebsd.org/changeset/base/265895 >=20 > Log: > Allow libstdc++ and libsupc++ to compile with clang again, after the > bsd.*.mk infrastructure changes. Apparently, you must now modify > CXXFLAGS *before* including bsd.lib.mk, or your changes will be lost. You must modify CXXFLAGS before you finalize them with the :=3D = assignment is the real issue here. I broke this when I converted the .if to = CXXFLAGS.clang a couple of revisions back. Thanks for fixing it. > Modified: > head/gnu/lib/libstdc++/Makefile > head/gnu/lib/libsupc++/Makefile >=20 > Modified: head/gnu/lib/libstdc++/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/gnu/lib/libstdc++/Makefile Sun May 11 20:44:58 2014 = (r265894) > +++ head/gnu/lib/libstdc++/Makefile Sun May 11 21:07:00 2014 = (r265895) > @@ -632,9 +632,9 @@ ${VERSION_MAP}: ${SRCDIR}/config/abi/pre >=20 > CLEANFILES+=3D ${VERSION_MAP} >=20 > +CXXFLAGS.clang+=3D -stdlib=3Dlibstdc++ > + > .include >=20 > # Filter out libc++-specific flags, and -std=3D flags above c++98 or = gnu++98. > CXXFLAGS:=3D = ${CXXFLAGS:N-stdlib=3Dlibc++:N-std=3Dc++[01][13x]:N-std=3Dgnu++[01][13x]} > - > -CXXFLAGS.clang+=3D -stdlib=3Dlibstdc++ >=20 > Modified: head/gnu/lib/libsupc++/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/gnu/lib/libsupc++/Makefile Sun May 11 20:44:58 2014 = (r265894) > +++ head/gnu/lib/libsupc++/Makefile Sun May 11 21:07:00 2014 = (r265895) > @@ -51,10 +51,9 @@ CLEANFILES+=3D unwind.h >=20 > VERSION_MAP=3D ${.CURDIR}/Version.map >=20 > +CXXFLAGS.clang+=3D -stdlib=3Dlibstdc++ >=20 > .include >=20 > # Filter out libc++-specific flags, and -std=3D flags above c++98 or = gnu++98. > CXXFLAGS:=3D = ${CXXFLAGS:N-stdlib=3Dlibc++:N-std=3Dc++[01][13x]:N-std=3Dgnu++[01][13x]} > - > -CXXFLAGS.clang+=3D -stdlib=3Dlibstdc++ >=20 From owner-svn-src-head@FreeBSD.ORG Sun May 11 23:22:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EBD7BC2D; Sun, 11 May 2014 23:22:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D99A32F82; Sun, 11 May 2014 23:22:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4BNMWjx056368; Sun, 11 May 2014 23:22:32 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4BNMWbP056367; Sun, 11 May 2014 23:22:32 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405112322.s4BNMWbP056367@svn.freebsd.org> From: Warner Losh Date: Sun, 11 May 2014 23:22:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265898 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 May 2014 23:22:33 -0000 Author: imp Date: Sun May 11 23:22:32 2014 New Revision: 265898 URL: http://svnweb.freebsd.org/changeset/base/265898 Log: Attempt to walk a fine line between current usage (/usr/ports which does an out-of-tree build without setting MAKESYSPATH) and recently added requirements (JIRA's building the modules in a non-standard layout). So, when MAKESYSPATH is defined, trust that it will do the right thing (to catch the JIRA use case). When it isn't defined, assume a standard FreeBSD tree and reach over to grab bsd.mkopt.mk (to fix the /usr/ports use case). Both camps cannot be appeased otherwise, so we have this kludge until it can be sorted out. Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Sun May 11 22:06:06 2014 (r265897) +++ head/sys/conf/kern.opts.mk Sun May 11 23:22:32 2014 (r265898) @@ -21,4 +21,15 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ +# Kludge to allow a less painful transition. If MAKESYSPATH isn't defined, +# assume we have a standard FreeBSD src tree layout and reach over and grab +# bsd.mkopt.mk from there. If it is defined, trust it to point someplace sane +# and include bsd.mkopt.mk from there. We need the !defined case to keep ports +# kernel modules working (though arguably they should define MAKESYSPATH). We +# need the latter case to keep the JIRA case working where they specifically +# use a non-standard layout, but do define MAKESYSPATH correctly. +.if !defined(MAKESYSPATH) .include "../../share/mk/bsd.mkopt.mk" +.else +.include +.endif From owner-svn-src-head@FreeBSD.ORG Mon May 12 01:47:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1676F3B3; Mon, 12 May 2014 01:47:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 045B72A2C; Mon, 12 May 2014 01:47:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4C1ljma021476; Mon, 12 May 2014 01:47:45 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4C1ljBY021475; Mon, 12 May 2014 01:47:45 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405120147.s4C1ljBY021475@svn.freebsd.org> From: Warner Losh Date: Mon, 12 May 2014 01:47:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265899 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 01:47:46 -0000 Author: imp Date: Mon May 12 01:47:45 2014 New Revision: 265899 URL: http://svnweb.freebsd.org/changeset/base/265899 Log: s/JIRA/Jenkins/g in comments. I was confused. Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Sun May 11 23:22:32 2014 (r265898) +++ head/sys/conf/kern.opts.mk Mon May 12 01:47:45 2014 (r265899) @@ -26,8 +26,8 @@ __DEFAULT_NO_OPTIONS = \ # bsd.mkopt.mk from there. If it is defined, trust it to point someplace sane # and include bsd.mkopt.mk from there. We need the !defined case to keep ports # kernel modules working (though arguably they should define MAKESYSPATH). We -# need the latter case to keep the JIRA case working where they specifically -# use a non-standard layout, but do define MAKESYSPATH correctly. +# need the latter case to keep the Jenkins testing harness working where they +# specifically use a non-standard layout, but do define MAKESYSPATH correctly. .if !defined(MAKESYSPATH) .include "../../share/mk/bsd.mkopt.mk" .else From owner-svn-src-head@FreeBSD.ORG Mon May 12 02:56:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E7DE7A0; Mon, 12 May 2014 02:56:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6ABCC2F01; Mon, 12 May 2014 02:56:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4C2uSnA052223; Mon, 12 May 2014 02:56:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4C2uREc052219; Mon, 12 May 2014 02:56:27 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201405120256.s4C2uREc052219@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 12 May 2014 02:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265900 - in head/sys/powerpc: powerpc ps3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 02:56:28 -0000 Author: nwhitehorn Date: Mon May 12 02:56:27 2014 New Revision: 265900 URL: http://svnweb.freebsd.org/changeset/base/265900 Log: Repair some races in IPI handling: 1. Make sure IPI mask is set before sending the IPI 2. Operate atomically on PS3 PIC outstanding interrupt list 3. Make sure IPIs are EOI'ed before, not after, processing. Without this, a second IPI could be sent partway through processing the first one, get erroneously acknowledge by the EOI to the first, and be lost. In particular in the case of smp_rendezvous(), this can be fatal. In combination, this makes the PS3 boot SMP again. It probably also fixes some latent bugs elsewhere. MFC after: 2 weeks Modified: head/sys/powerpc/powerpc/intr_machdep.c head/sys/powerpc/powerpc/mp_machdep.c head/sys/powerpc/ps3/ps3pic.c Modified: head/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/intr_machdep.c Mon May 12 01:47:45 2014 (r265899) +++ head/sys/powerpc/powerpc/intr_machdep.c Mon May 12 02:56:27 2014 (r265900) @@ -103,6 +103,7 @@ struct powerpc_intr { enum intr_trigger trig; enum intr_polarity pol; int fwcode; + int ipi; }; struct pic { @@ -203,6 +204,8 @@ intr_lookup(u_int irq) i->irq = irq; i->pic = NULL; i->vector = -1; + i->fwcode = 0; + i->ipi = 0; #ifdef SMP i->cpu = all_cpus; @@ -415,6 +418,15 @@ powerpc_enable_intr(void) printf("unable to setup IPI handler\n"); return (error); } + + /* + * Some subterfuge: disable late EOI and mark this + * as an IPI to the dispatch layer. + */ + i = intr_lookup(MAP_IRQ(piclist[n].node, + piclist[n].irqs)); + i->event->ie_post_filter = NULL; + i->ipi = 1; } } #endif @@ -568,6 +580,13 @@ powerpc_dispatch_intr(u_int vector, stru ie = i->event; KASSERT(ie != NULL, ("%s: interrupt without an event", __func__)); + /* + * IPIs are magical and need to be EOI'ed before filtering. + * This prevents races in IPI handling. + */ + if (i->ipi) + PIC_EOI(i->pic, i->intline); + if (intr_event_handle(ie, tf) != 0) { goto stray; } Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Mon May 12 01:47:45 2014 (r265899) +++ head/sys/powerpc/powerpc/mp_machdep.c Mon May 12 02:56:27 2014 (r265900) @@ -336,6 +336,7 @@ ipi_send(struct pcpu *pc, int ipi) pc, pc->pc_cpuid, ipi); atomic_set_32(&pc->pc_ipimask, (1 << ipi)); + powerpc_sync(); PIC_IPI(root_pic, pc->pc_cpuid); CTR1(KTR_SMP, "%s: sent", __func__); Modified: head/sys/powerpc/ps3/ps3pic.c ============================================================================== --- head/sys/powerpc/ps3/ps3pic.c Mon May 12 01:47:45 2014 (r265899) +++ head/sys/powerpc/ps3/ps3pic.c Mon May 12 02:56:27 2014 (r265900) @@ -166,12 +166,13 @@ ps3pic_dispatch(device_t dev, struct tra sc = device_get_softc(dev); if (PCPU_GET(cpuid) == 0) { - bitmap = sc->bitmap_thread0[0]; + bitmap = atomic_readandclear_64(&sc->bitmap_thread0[0]); mask = sc->mask_thread0[0]; } else { - bitmap = sc->bitmap_thread1[0]; + bitmap = atomic_readandclear_64(&sc->bitmap_thread1[0]); mask = sc->mask_thread1[0]; } + powerpc_sync(); while ((irq = ffsl(bitmap & mask) - 1) != -1) { bitmap &= ~(1UL << irq); From owner-svn-src-head@FreeBSD.ORG Mon May 12 05:44:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A91C9D11; Mon, 12 May 2014 05:44:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96B0B2AF8; Mon, 12 May 2014 05:44:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4C5itMb027615; Mon, 12 May 2014 05:44:55 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4C5itsd027614; Mon, 12 May 2014 05:44:55 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201405120544.s4C5itsd027614@svn.freebsd.org> From: Eitan Adler Date: Mon, 12 May 2014 05:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265903 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 05:44:55 -0000 Author: eadler Date: Mon May 12 05:44:55 2014 New Revision: 265903 URL: http://svnweb.freebsd.org/changeset/base/265903 Log: units(1): use common functions No need to replicate strdup Modified: head/usr.bin/units/units.c Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Mon May 12 04:30:53 2014 (r265902) +++ head/usr.bin/units/units.c Mon May 12 05:44:55 2014 (r265903) @@ -111,10 +111,9 @@ dupstr(const char *str) { char *ret; - ret = malloc(strlen(str) + 1); + ret = strdup(str); if (!ret) - errx(3, "memory allocation error"); - strcpy(ret, str); + err(3, "dupstr"); return (ret); } From owner-svn-src-head@FreeBSD.ORG Mon May 12 06:14:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DAAFA2F2; Mon, 12 May 2014 06:14:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C83D72D1A; Mon, 12 May 2014 06:14:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4C6EE0m040878; Mon, 12 May 2014 06:14:14 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4C6EE7R040877; Mon, 12 May 2014 06:14:14 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201405120614.s4C6EE7R040877@svn.freebsd.org> From: Eitan Adler Date: Mon, 12 May 2014 06:14:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265904 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 06:14:14 -0000 Author: eadler Date: Mon May 12 06:14:14 2014 New Revision: 265904 URL: http://svnweb.freebsd.org/changeset/base/265904 Log: units(1): unbreak -f option, fix some style, increase compatibility. - Unbreak the -f option: it was missing a ':' - gunits -V spits out more information than just its version: attempt to do so as well. Modified: head/usr.bin/units/units.c Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Mon May 12 05:44:55 2014 (r265903) +++ head/usr.bin/units/units.c Mon May 12 06:14:14 2014 (r265904) @@ -80,7 +80,6 @@ static bool verbose = false; static const char * havestr; static const char * wantstr; - static int addsubunit(char *product[], char *toadd); static int addunit(struct unittype *theunit, const char *toadd, int flip, int quantity); static void cancelunit(struct unittype * theunit); @@ -719,7 +718,7 @@ main(int argc, char **argv) quiet = false; readfile = false; - while ((optchar = getopt(argc, argv, "fqvUV:")) != -1) { + while ((optchar = getopt(argc, argv, "f:qvUV")) != -1) { switch (optchar) { case 'f': readfile = true; @@ -734,6 +733,9 @@ main(int argc, char **argv) case 'v': verbose = true; break; + case 'V': + fprintf(stderr, "FreeBSD units\n"); + /* FALLTHROUGH */ case 'U': if (access(UNITSFILE, F_OK) == 0) printf("%s\n", UNITSFILE); @@ -741,10 +743,6 @@ main(int argc, char **argv) printf("Units data file not found"); exit(0); break; - case 'V': - fprintf(stderr, "FreeBSD units\n"); - usage(); - break; default: usage(); } From owner-svn-src-head@FreeBSD.ORG Mon May 12 07:14:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E48D43EA; Mon, 12 May 2014 07:14:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B88D32247; Mon, 12 May 2014 07:14:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4C7E9AH067955; Mon, 12 May 2014 07:14:09 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4C7E9qg067954; Mon, 12 May 2014 07:14:09 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201405120714.s4C7E9qg067954@svn.freebsd.org> From: Eitan Adler Date: Mon, 12 May 2014 07:14:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265907 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 07:14:10 -0000 Author: eadler Date: Mon May 12 07:14:09 2014 New Revision: 265907 URL: http://svnweb.freebsd.org/changeset/base/265907 Log: units(1): call el_end() Add missing el_end() call Modified: head/usr.bin/units/units.c Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Mon May 12 07:06:03 2014 (r265906) +++ head/usr.bin/units/units.c Mon May 12 07:14:09 2014 (r265907) @@ -810,5 +810,6 @@ main(int argc, char **argv) } history_end(inhistory); + el_end(el); return(0); } From owner-svn-src-head@FreeBSD.ORG Mon May 12 09:05:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C0D390D; Mon, 12 May 2014 09:05:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DF272C3D; Mon, 12 May 2014 09:05:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4C958ku017899; Mon, 12 May 2014 09:05:08 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4C957Rs017893; Mon, 12 May 2014 09:05:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405120905.s4C957Rs017893@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 12 May 2014 09:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265908 - in head/sys: dev/usb/controller modules/usb/saf1761 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 09:05:08 -0000 Author: hselasky Date: Mon May 12 09:05:07 2014 New Revision: 265908 URL: http://svnweb.freebsd.org/changeset/base/265908 Log: Create driver file templates, kernel module Makefile and add initial version of register definitions for ISP1761 and SAF1761 compatible chips. Sponsored by: DARPA, AFRL Added: head/sys/dev/usb/controller/saf1761_dci.c (contents, props changed) head/sys/dev/usb/controller/saf1761_dci.h (contents, props changed) head/sys/dev/usb/controller/saf1761_dci_fdt.c (contents, props changed) head/sys/dev/usb/controller/saf1761_dci_reg.h (contents, props changed) head/sys/modules/usb/saf1761/ head/sys/modules/usb/saf1761/Makefile (contents, props changed) Added: head/sys/dev/usb/controller/saf1761_dci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/saf1761_dci.c Mon May 12 09:05:07 2014 (r265908) @@ -0,0 +1,33 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2014 Hans Petter Selasky + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include Added: head/sys/dev/usb/controller/saf1761_dci.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/saf1761_dci.h Mon May 12 09:05:07 2014 (r265908) @@ -0,0 +1,36 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2014 Hans Petter Selasky + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SAF1761_DCI_H_ +#define _SAF1761_DCI_H_ + + +#endif /* _SAF1761_DCI_H_ */ Added: head/sys/dev/usb/controller/saf1761_dci_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/saf1761_dci_fdt.c Mon May 12 09:05:07 2014 (r265908) @@ -0,0 +1,34 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2014 Hans Petter Selasky + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + Added: head/sys/dev/usb/controller/saf1761_dci_reg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/saf1761_dci_reg.h Mon May 12 09:05:07 2014 (r265908) @@ -0,0 +1,156 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2014 Hans Petter Selasky + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SAF1761_DCI_REG_H_ +#define _SAF1761_DCI_REG_H_ + +/* Global registers */ + +#define SOTG_VEND_ID 0x370 +#define SOTG_PROD_ID 0x372 +#define SOTG_CTRL_SET 0x374 +#define SOTG_CTRL_CLR 0x376 +#define SOTG_CTRL_OTG_DISABLE (1 << 10) +#define SOTG_CTRL_OTG_SE0_EN (1 << 9) +#define SOTG_CTRL_BDIS_ACON_EN (1 << 8) +#define SOTG_CTRL_SW_SEL_HC_DC (1 << 7) +#define SOTG_CTRL_VBUS_CHRG (1 << 6) +#define SOTG_CTRL_VBUS_DISCHRG (1 << 5) +#define SOTG_CTRL_VBUS_DRV (1 << 4) +#define SOTG_CTRL_SEL_CP_EXT (1 << 3) +#define SOTG_CTRL_DM_PULL_DOWN (1 << 2) +#define SOTG_CTRL_DP_PULL_DOWN (1 << 1) +#define SOTG_CTRL_DP_PULL_UP (1 << 0) +#define SOTG_STATUS 0x378 +#define SOTG_STATUS_B_SE0_SRP (1 << 8) +#define SOTG_STATUS_B_SESS_END (1 << 7) +#define SOTG_STATUS_RMT_CONN (1 << 4) +#define SOTG_STATUS_ID (1 << 3) +#define SOTG_STATUS_DP_SRP (1 << 2) +#define SOTG_STATUS_A_B_SESS_VLD (1 << 1) +#define SOTG_STATUS_VBUS_VLD (1 << 0) +#define SOTG_IRQ_LATCH_SET 0x37C +#define SOTG_IRQ_LATCH_CLR 0x37E +#define SOTG_IRQ_ENABLE_SET 0x380 +#define SOTG_IRQ_ENABLE_CLR 0x382 +#define SOTG_IRQ_RISE_SET 0x384 +#define SOTG_IRQ_RISE_CLR 0x386 +#define SOTG_IRQ_OTG_TMR_TIMEOUT (1 << 9) +#define SOTG_IRQ_B_SE0_SRP (1 << 8) +#define SOTG_IRQ_B_SESS_END (1 << 7) +#define SOTG_IRQ_BDIS_ACON (1 << 6) +#define SOTG_IRQ_OTG_RESUME (1 << 5) +#define SOTG_IRQ_RMT_CONN (1 << 4) +#define SOTG_IRQ_ID (1 << 3) +#define SOTG_IRQ_DP_SRP (1 << 2) +#define SOTG_IRQ_A_B_SESS_VLD (1 << 1) +#define SOTG_IRQ_VBUS_VLD (1 << 0) +#define SOTG_TIMER_LOW_SET 0x388 +#define SOTG_TIMER_LOW_CLR 0x38A +#define SOTG_TIMER_HIGH_SET 0x38C +#define SOTG_TIMER_HIGH_CLR 0x38E +#define SOTG_TIMER_START_TMR (1U << 15) + +/* Peripheral controller specific registers */ + +#define SOTG_ADDRESS 0x200 +#define SOTG_ADDRESS_ENABLE (1 << 7) +#define SOTG_MODE 0x20C +#define SOTG_MODE_DMACLK_ON (1 << 9) +#define SOTG_MODE_VBUSSTAT (1 << 8) +#define SOTG_MODE_CLKAON (1 << 7) +#define SOTG_MODE_SNDRSU (1 << 6) +#define SOTG_MODE_GOSUSP (1 << 5) +#define SOTG_MODE_SFRESET (1 << 4) +#define SOTG_MODE_GLINTENA (1 << 3) +#define SOTG_MODE_WKUPCS (1 << 2) +#define SOTG_INTERRUPT_CFG 0x210 +#define SOTG_INTERRUPT_CFG_CDBGMOD (3 << 6) +#define SOTG_INTERRUPT_CFG_DDBGMODIN (3 << 4) +#define SOTG_INTERRUPT_CFG_DDBGMODOUT (3 << 2) +#define SOTG_INTERRUPT_CFG_INTLVL (1 << 1) +#define SOTG_INTERRUPT_CFG_INTPOL (1 << 0) +#define SOTG_DEBUG 0x212 +#define SOTG_DEBUG_SET (1 << 0) +#define SOTG_DCINTERRUPT_EN 0x214 +#define SOTG_HW_MODE_CTRL 0x300 +#define SOTG_OTG_CTRL 0x374 +#define SOTG_EP_INDEX 0x22c +#define SOTG_EP_INDEX_EP0SETUP (1 << 5) +#define SOTG_EP_INDEX_ENDP_INDEX (15 << 1) +#define SOTG_EP_INDEX_DIR_IN (1 << 0) +#define SOTG_CTRL_FUNC 0x228 +#define SOTG_CTRL_FUNC_CLBUF (1 << 4) +#define SOTG_CTRL_FUNC_VENDP (1 << 3) +#define SOTG_CTRL_FUNC_DSEN (1 << 2) +#define SOTG_CTRL_FUNC_STATUS (1 << 1) +#define SOTG_CTRL_FUNC_STALL (1 << 0) +#define SOTG_DATA_PORT 0x220 +#define SOTG_BUF_LENGTH 0x21C +#define SOTG_DCBUFFERSTATUS 0x21E +#define SOTG_EP_MAXPACKET 0x204 +#define SOTG_EP_TYPE 0x208 +#define SOTG_EP_TYPE_NOEMPPKT (1 << 4) +#define SOTG_EP_TYPE_ENABLE (1 << 3) +#define SOTG_EP_TYPE_DBLBUF (1 << 2) +#define SOTG_EP_TYPE_EP_TYPE (3 << 0) +#define SOTG_DMA_CMD 0x230 +#define SOTG_DMA_XFER_COUNT 0x234 +#define SOTG_DCDMA_CFG 0x238 +#define SOTG_DMA_HW 0x23C +#define SOTG_DMA_IRQ_REASON 0x250 +#define SOTG_DMA_IRQ_ENABLE 0x254 +#define SOTG_DMA_EP 0x258 +#define SOTG_BURST_COUNTER 0x264 +#define SOTG_DCINTERRUPT 0x218 +#define SOTG_DCINTERRUPT_IEPRX(n) (1 << (10 + (2*(n)))) +#define SOTG_DCINTERRUPT_IEPTX(n) (1 << (11 + (2*(n)))) +#define SOTG_DCINTERRUPT_IEP0SETUP (1 << 8) +#define SOTG_DCINTERRUPT_IEVBUS (1 << 7) +#define SOTG_DCINTERRUPT_IEDMA (1 << 6) +#define SOTG_DCINTERRUPT_IEHS_STA (1 << 5) +#define SOTG_DCINTERRUPT_IERESM (1 << 4) +#define SOTG_DCINTERRUPT_IESUSP (1 << 3) +#define SOTG_DCINTERRUPT_IEPSOF (1 << 2) +#define SOTG_DCINTERRUPT_IESOF (1 << 1) +#define SOTG_DCINTERRUPT_IEBRST (1 << 0) +#define SOTG_DCCHIP_ID 0x270 +#define SOTG_FRAME_NUM 0x274 +#define SOTG_FRAME_NUM_MICROSOFR 0x3800 +#define SOTG_FRAME_NUM_MICROSOFR_SHIFT 11 +#define SOTG_FRAME_NUM_SOFR 0x7FF +#define SOTG_DCSCRATCH 0x278 +#define SOTG_UNLOCK_DEVICE 0x27C +#define SOTG_UNLOCK_DEVICE_CODE 0xAA37 +#define SOTG_IRQ_PULSE_WIDTH 0x280 +#define SOTG_TEST_MODE 0x284 + +#endif /* _SAF1761_DCI_REG_H_ */ Added: head/sys/modules/usb/saf1761/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/saf1761/Makefile Mon May 12 09:05:07 2014 (r265908) @@ -0,0 +1,42 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2014 Hans Petter Selasky. All rights reserved. +# +# This software was developed by SRI International and the University of +# Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) +# ("CTSRD"), as part of the DARPA CRASH research programme. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/controller + +KMOD= saf1761 +SRCS= bus_if.h device_if.h usb_if.h \ + opt_bus.h opt_usb.h ofw_bus_if.h \ + saf1761_dci.c saf1761_dci_fdt.c \ + pci_if.h + +.include From owner-svn-src-head@FreeBSD.ORG Mon May 12 09:46:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D64F033C; Mon, 12 May 2014 09:46:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3D732FC2; Mon, 12 May 2014 09:46:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4C9kmF6035761; Mon, 12 May 2014 09:46:48 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4C9kmuZ035760; Mon, 12 May 2014 09:46:48 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201405120946.s4C9kmuZ035760@svn.freebsd.org> From: Michael Tuexen Date: Mon, 12 May 2014 09:46:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265909 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 09:46:48 -0000 Author: tuexen Date: Mon May 12 09:46:48 2014 New Revision: 265909 URL: http://svnweb.freebsd.org/changeset/base/265909 Log: Disable TX checksum offload for UDP-Lite completely. It wasn't used for partial checksum coverage, but even for full checksum coverage it doesn't work. This was discussed with Kevin Lo (kevlo@). Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Mon May 12 09:05:07 2014 (r265908) +++ head/sys/netinet/udp_usrreq.c Mon May 12 09:46:48 2014 (r265909) @@ -1370,13 +1370,17 @@ udp_output(struct inpcb *inp, struct mbu * Set up checksum and output datagram. */ ui->ui_sum = 0; - if (cscov_partial) { + if (pr == IPPROTO_UDPLITE) { if (inp->inp_flags & INP_ONESBCAST) faddr.s_addr = INADDR_BROADCAST; - if ((ui->ui_sum = in_cksum(m, sizeof(struct ip) + cscov)) == 0) - ui->ui_sum = 0xffff; - } else if (V_udp_cksum || pr == IPPROTO_UDPLITE) { - /* for UDP-Lite full checksum coverage is requested */ + if (cscov_partial) { + if ((ui->ui_sum = in_cksum(m, sizeof(struct ip) + cscov)) == 0) + ui->ui_sum = 0xffff; + } else { + if ((ui->ui_sum = in_cksum(m, sizeof(struct udpiphdr) + len)) == 0) + ui->ui_sum = 0xffff; + } + } else if (V_udp_cksum) { if (inp->inp_flags & INP_ONESBCAST) faddr.s_addr = INADDR_BROADCAST; ui->ui_sum = in_pseudo(ui->ui_src.s_addr, faddr.s_addr, From owner-svn-src-head@FreeBSD.ORG Mon May 12 13:05:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3FABDD45; Mon, 12 May 2014 13:05:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D1F923CC; Mon, 12 May 2014 13:05:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4CD54Zn026632; Mon, 12 May 2014 13:05:04 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CD54GW026630; Mon, 12 May 2014 13:05:04 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405121305.s4CD54GW026630@svn.freebsd.org> From: Ian Lepore Date: Mon, 12 May 2014 13:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265913 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 13:05:04 -0000 Author: ian Date: Mon May 12 13:05:03 2014 New Revision: 265913 URL: http://svnweb.freebsd.org/changeset/base/265913 Log: Interrupts need to be disabled on entry to cpu_sleep() for ARM. Given that and the need to be in a critical section when switching to idleclock mode for event timers, use spinlock_enter()/exit() to achieve both needs. The ARM WFI (wait for interrupt) instruction blocks until an interrupt is asserted, and it will unblock even if interrupts are masked, and it will unblock immediately if an interrupt is already pending. It is necessary to execute it with interrupts disabled, otherwise the interrupt that should unblock it may occur and be serviced just prior to executing the instruction. At that point the system is inappropriately asleep until the next timer tick or some other random interrupt happens. In general, interrupts need to be disabled continuously from the time the decision is made that there is no work to be done and sleeping is needed until actually going to sleep, to avoid a race where handling a new interrupt changes the basis for deciding there is no work to be done. Submitted by: hps@ (in slightly different form) Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Mon May 12 12:04:44 2014 (r265912) +++ head/sys/arm/arm/machdep.c Mon May 12 13:05:03 2014 (r265913) @@ -426,9 +426,9 @@ cpu_idle(int busy) CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", busy, curcpu); + spinlock_enter(); #ifndef NO_EVENTTIMERS if (!busy) { - critical_enter(); cpu_idleclock(); } #endif @@ -437,9 +437,9 @@ cpu_idle(int busy) #ifndef NO_EVENTTIMERS if (!busy) { cpu_activeclock(); - critical_exit(); } #endif + spinlock_exit(); CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", busy, curcpu); } From owner-svn-src-head@FreeBSD.ORG Mon May 12 13:08:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7E81FF; Mon, 12 May 2014 13:08:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A56CD2421; Mon, 12 May 2014 13:08:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4CD8bR4027320; Mon, 12 May 2014 13:08:37 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CD8bNF027319; Mon, 12 May 2014 13:08:37 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405121308.s4CD8bNF027319@svn.freebsd.org> From: Ian Lepore Date: Mon, 12 May 2014 13:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265914 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 13:08:37 -0000 Author: ian Date: Mon May 12 13:08:37 2014 New Revision: 265914 URL: http://svnweb.freebsd.org/changeset/base/265914 Log: Cleanup some style nits. Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Mon May 12 13:05:03 2014 (r265913) +++ head/sys/arm/arm/machdep.c Mon May 12 13:08:37 2014 (r265914) @@ -424,24 +424,20 @@ void cpu_idle(int busy) { - CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", - busy, curcpu); + CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", busy, curcpu); spinlock_enter(); #ifndef NO_EVENTTIMERS - if (!busy) { + if (!busy) cpu_idleclock(); - } #endif if (!sched_runnable()) cpu_sleep(0); #ifndef NO_EVENTTIMERS - if (!busy) { + if (!busy) cpu_activeclock(); - } #endif spinlock_exit(); - CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", - busy, curcpu); + CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", busy, curcpu); } int From owner-svn-src-head@FreeBSD.ORG Mon May 12 13:32:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1BF3593; Mon, 12 May 2014 13:32:24 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6BDA265D; Mon, 12 May 2014 13:32:24 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id A52AC1FE029; Mon, 12 May 2014 15:32:23 +0200 (CEST) Message-ID: <5370CD9A.1040409@selasky.org> Date: Mon, 12 May 2014 15:33:14 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Ian Lepore , svn-src-head@freebsd.org Subject: Re: svn commit: r265914 - head/sys/arm/arm References: <201405121308.s4CD8bNF027319@svn.freebsd.org> In-Reply-To: <201405121308.s4CD8bNF027319@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 13:32:25 -0000 On 05/12/14 15:08, Ian Lepore wrote: > Author: ian > Date: Mon May 12 13:08:37 2014 > New Revision: 265914 > URL: http://svnweb.freebsd.org/changeset/base/265914 > > Log: > Cleanup some style nits. > > Modified: > head/sys/arm/arm/machdep.c > > Modified: head/sys/arm/arm/machdep.c > ============================================================================== > --- head/sys/arm/arm/machdep.c Mon May 12 13:05:03 2014 (r265913) > +++ head/sys/arm/arm/machdep.c Mon May 12 13:08:37 2014 (r265914) > @@ -424,24 +424,20 @@ void > cpu_idle(int busy) > { > > - CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", > - busy, curcpu); > + CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", busy, curcpu); > spinlock_enter(); > #ifndef NO_EVENTTIMERS > - if (!busy) { > + if (!busy) > cpu_idleclock(); > - } > #endif > if (!sched_runnable()) > cpu_sleep(0); > #ifndef NO_EVENTTIMERS > - if (!busy) { > + if (!busy) > cpu_activeclock(); > - } > #endif > spinlock_exit(); > - CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", > - busy, curcpu); > + CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", busy, curcpu); > } > > int > Thanks! Don't forget to MFC, if any. --HPS From owner-svn-src-head@FreeBSD.ORG Mon May 12 13:33:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1E1D5B8; Mon, 12 May 2014 13:33:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF9EA2666; Mon, 12 May 2014 13:33:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4CDXCNI039804; Mon, 12 May 2014 13:33:12 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CDXC06039803; Mon, 12 May 2014 13:33:12 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405121333.s4CDXC06039803@svn.freebsd.org> From: Ian Lepore Date: Mon, 12 May 2014 13:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265915 - head/sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 13:33:12 -0000 Author: ian Date: Mon May 12 13:33:12 2014 New Revision: 265915 URL: http://svnweb.freebsd.org/changeset/base/265915 Log: Build modules in parallel. This has been tested by several people at various -j levels from 6 to 48 without problems. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon May 12 13:08:37 2014 (r265914) +++ head/sys/modules/Makefile Mon May 12 13:33:12 2014 (r265915) @@ -2,6 +2,8 @@ .include +SUBDIR_PARALLEL= + # Modules that include binary-only blobs of microcode should be selectable by # MK_SOURCELESS_UCODE option (see below). From owner-svn-src-head@FreeBSD.ORG Mon May 12 17:56:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6BB98276; Mon, 12 May 2014 17:56:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 595682F0B; Mon, 12 May 2014 17:56:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4CHurtn070225; Mon, 12 May 2014 17:56:53 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CHurlu070224; Mon, 12 May 2014 17:56:53 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201405121756.s4CHurlu070224@svn.freebsd.org> From: Don Lewis Date: Mon, 12 May 2014 17:56:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265923 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 17:56:53 -0000 Author: truckman Date: Mon May 12 17:56:52 2014 New Revision: 265923 URL: http://svnweb.freebsd.org/changeset/base/265923 Log: Nuke a couple of unnecessary assigments. Nothing uses the values of rstart and rend after this point. MFC after: 1 week Modified: head/sys/kern/subr_rman.c Modified: head/sys/kern/subr_rman.c ============================================================================== --- head/sys/kern/subr_rman.c Mon May 12 17:55:24 2014 (r265922) +++ head/sys/kern/subr_rman.c Mon May 12 17:56:52 2014 (r265923) @@ -607,8 +607,6 @@ rman_reserve_resource_bound(struct rman break; if ((s->r_flags & flags) != flags) continue; - rstart = ulmax(s->r_start, start); - rend = ulmin(s->r_end, ulmax(start + count - 1, end)); if (s->r_start >= start && s->r_end <= end && (s->r_end - s->r_start + 1) == count && (s->r_start & amask) == 0 && From owner-svn-src-head@FreeBSD.ORG Mon May 12 17:58:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 981CF3CF; Mon, 12 May 2014 17:58:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 858142F1E; Mon, 12 May 2014 17:58:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4CHwHvH070461; Mon, 12 May 2014 17:58:17 GMT (envelope-from skreuzer@svn.freebsd.org) Received: (from skreuzer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CHwHF4070460; Mon, 12 May 2014 17:58:17 GMT (envelope-from skreuzer@svn.freebsd.org) Message-Id: <201405121758.s4CHwHF4070460@svn.freebsd.org> From: Steven Kreuzer Date: Mon, 12 May 2014 17:58:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265924 - head/release/doc/en_US.ISO8859-1/readme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 17:58:17 -0000 Author: skreuzer (doc,ports committer) Date: Mon May 12 17:58:17 2014 New Revision: 265924 URL: http://svnweb.freebsd.org/changeset/base/265924 Log: Bump copyright date Approved by: hrs@ (mentor) Modified: head/release/doc/en_US.ISO8859-1/readme/article.xml Modified: head/release/doc/en_US.ISO8859-1/readme/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/readme/article.xml Mon May 12 17:56:52 2014 (r265923) +++ head/release/doc/en_US.ISO8859-1/readme/article.xml Mon May 12 17:58:17 2014 (r265924) @@ -35,6 +35,7 @@ 2011 2012 2013 + 2014 The &os; Documentation Project From owner-svn-src-head@FreeBSD.ORG Mon May 12 18:46:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8F2CF43; Mon, 12 May 2014 18:46:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D16432343; Mon, 12 May 2014 18:46:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4CIk26m092509; Mon, 12 May 2014 18:46:02 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CIjvvO092462; Mon, 12 May 2014 18:45:57 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201405121845.s4CIjvvO092462@svn.freebsd.org> From: Dimitry Andric Date: Mon, 12 May 2014 18:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265925 - in head: . contrib/llvm/include/llvm/IR contrib/llvm/include/llvm/MC contrib/llvm/lib/Analysis contrib/llvm/lib/CodeGen/AsmPrinter contrib/llvm/lib/CodeGen/SelectionDAG contri... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 18:46:03 -0000 Author: dim Date: Mon May 12 18:45:56 2014 New Revision: 265925 URL: http://svnweb.freebsd.org/changeset/base/265925 Log: Upgrade our copy of llvm/clang to 3.4.1 release. This release contains mostly fixes, for the following upstream bugs: http://llvm.org/PR16365 http://llvm.org/PR17473 http://llvm.org/PR18000 http://llvm.org/PR18068 http://llvm.org/PR18102 http://llvm.org/PR18165 http://llvm.org/PR18260 http://llvm.org/PR18290 http://llvm.org/PR18316 http://llvm.org/PR18460 http://llvm.org/PR18473 http://llvm.org/PR18515 http://llvm.org/PR18526 http://llvm.org/PR18600 http://llvm.org/PR18762 http://llvm.org/PR18773 http://llvm.org/PR18860 http://llvm.org/PR18994 http://llvm.org/PR19007 http://llvm.org/PR19010 http://llvm.org/PR19033 http://llvm.org/PR19059 http://llvm.org/PR19144 http://llvm.org/PR19326 MFC after: 2 weeks Deleted: head/contrib/llvm/patches/patch-r262809-clang-r203007-destructor-calling-conv.diff Modified: head/ObsoleteFiles.inc head/UPDATING head/contrib/llvm/include/llvm/IR/IntrinsicsX86.td head/contrib/llvm/include/llvm/MC/MCAsmInfo.h head/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp head/contrib/llvm/lib/Analysis/IVUsers.cpp head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp head/contrib/llvm/lib/MC/MCAsmInfo.cpp head/contrib/llvm/lib/MC/MCAsmInfoCOFF.cpp head/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp head/contrib/llvm/lib/MC/MCDwarf.cpp head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.td head/contrib/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp head/contrib/llvm/lib/Target/AArch64/AArch64TargetObjectFile.h head/contrib/llvm/lib/Target/ARM/A15SDOptimizer.cpp head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp head/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp head/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.h head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp head/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp head/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.td head/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.h head/contrib/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp head/contrib/llvm/lib/Target/R600/AMDGPUISelLowering.cpp head/contrib/llvm/lib/Target/R600/AMDGPUInstructions.td head/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.cpp head/contrib/llvm/lib/Target/R600/R600ControlFlowFinalizer.cpp head/contrib/llvm/lib/Target/R600/R600InstrInfo.cpp head/contrib/llvm/lib/Target/R600/R600Instructions.td head/contrib/llvm/lib/Target/R600/SIFixSGPRCopies.cpp head/contrib/llvm/lib/Target/R600/SIInsertWaits.cpp head/contrib/llvm/lib/Target/R600/SIInstrInfo.td head/contrib/llvm/lib/Target/R600/SIInstructions.td head/contrib/llvm/lib/Target/R600/SIIntrinsics.td head/contrib/llvm/lib/Target/R600/SILowerControlFlow.cpp head/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp head/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c head/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp head/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td head/contrib/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp head/contrib/llvm/lib/Transforms/Utils/LCSSA.cpp head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp head/contrib/llvm/tools/clang/include/clang/Driver/Driver.h head/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h head/contrib/llvm/tools/clang/lib/AST/ASTDumper.cpp head/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp head/contrib/llvm/tools/clang/lib/AST/StmtPrinter.cpp head/contrib/llvm/tools/clang/lib/Analysis/Consumed.cpp head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp head/contrib/llvm/tools/clang/lib/Basic/Version.cpp head/contrib/llvm/tools/clang/lib/Driver/Driver.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains.h head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp head/etc/mtree/BSD.include.dist head/lib/clang/include/Makefile head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/llvm/Config/config.h head/lib/clang/include/llvm/Config/llvm-config.h head/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon May 12 17:58:17 2014 (r265924) +++ head/ObsoleteFiles.inc Mon May 12 18:45:56 2014 (r265925) @@ -38,6 +38,43 @@ # xargs -n1 | sort | uniq -d; # done +# 20140512: new clang import which bumps version from 3.4 to 3.4.1. +OLD_FILES+=usr/include/clang/3.4/__wmmintrin_aes.h +OLD_FILES+=usr/include/clang/3.4/__wmmintrin_pclmul.h +OLD_FILES+=usr/include/clang/3.4/altivec.h +OLD_FILES+=usr/include/clang/3.4/ammintrin.h +OLD_FILES+=usr/include/clang/3.4/avx2intrin.h +OLD_FILES+=usr/include/clang/3.4/avxintrin.h +OLD_FILES+=usr/include/clang/3.4/bmi2intrin.h +OLD_FILES+=usr/include/clang/3.4/bmiintrin.h +OLD_FILES+=usr/include/clang/3.4/cpuid.h +OLD_FILES+=usr/include/clang/3.4/emmintrin.h +OLD_FILES+=usr/include/clang/3.4/f16cintrin.h +OLD_FILES+=usr/include/clang/3.4/fma4intrin.h +OLD_FILES+=usr/include/clang/3.4/fmaintrin.h +OLD_FILES+=usr/include/clang/3.4/immintrin.h +OLD_FILES+=usr/include/clang/3.4/lzcntintrin.h +OLD_FILES+=usr/include/clang/3.4/mm3dnow.h +OLD_FILES+=usr/include/clang/3.4/mm_malloc.h +OLD_FILES+=usr/include/clang/3.4/mmintrin.h +OLD_FILES+=usr/include/clang/3.4/module.map +OLD_FILES+=usr/include/clang/3.4/nmmintrin.h +OLD_FILES+=usr/include/clang/3.4/pmmintrin.h +OLD_FILES+=usr/include/clang/3.4/popcntintrin.h +OLD_FILES+=usr/include/clang/3.4/prfchwintrin.h +OLD_FILES+=usr/include/clang/3.4/rdseedintrin.h +OLD_FILES+=usr/include/clang/3.4/rtmintrin.h +OLD_FILES+=usr/include/clang/3.4/shaintrin.h +OLD_FILES+=usr/include/clang/3.4/smmintrin.h +OLD_FILES+=usr/include/clang/3.4/tbmintrin.h +OLD_FILES+=usr/include/clang/3.4/tmmintrin.h +OLD_FILES+=usr/include/clang/3.4/wmmintrin.h +OLD_FILES+=usr/include/clang/3.4/x86intrin.h +OLD_FILES+=usr/include/clang/3.4/xmmintrin.h +OLD_FILES+=usr/include/clang/3.4/xopintrin.h +OLD_FILES+=usr/include/clang/3.4/arm_neon.h +OLD_FILES+=usr/include/clang/3.4/module.map +OLD_DIRS+=usr/include/clang/3.4 # 20140505: Bogusly installing src.opts.mk OLD_FILES+=usr/share/mk/src.opts.mk # 20140505: Reject PR kern/187551 Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon May 12 17:58:17 2014 (r265924) +++ head/UPDATING Mon May 12 18:45:56 2014 (r265925) @@ -31,6 +31,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20140512: + Clang and llvm have been upgraded to 3.4.1 release. + 20140508: We bogusly installed src.opts.mk in /usr/share/mk. This file should be removed to avoid issues in the future (and has been added to Modified: head/contrib/llvm/include/llvm/IR/IntrinsicsX86.td ============================================================================== --- head/contrib/llvm/include/llvm/IR/IntrinsicsX86.td Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/include/llvm/IR/IntrinsicsX86.td Mon May 12 18:45:56 2014 (r265925) @@ -1758,68 +1758,68 @@ let TargetPrefix = "x86" in { // All in def int_x86_avx2_gather_d_pd : GCCBuiltin<"__builtin_ia32_gatherd_pd">, Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2f64_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_d_pd_256 : GCCBuiltin<"__builtin_ia32_gatherd_pd256">, Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4f64_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_q_pd : GCCBuiltin<"__builtin_ia32_gatherq_pd">, Intrinsic<[llvm_v2f64_ty], [llvm_v2f64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2f64_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_q_pd_256 : GCCBuiltin<"__builtin_ia32_gatherq_pd256">, Intrinsic<[llvm_v4f64_ty], [llvm_v4f64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4f64_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_d_ps : GCCBuiltin<"__builtin_ia32_gatherd_ps">, Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4f32_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_d_ps_256 : GCCBuiltin<"__builtin_ia32_gatherd_ps256">, Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8f32_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_q_ps : GCCBuiltin<"__builtin_ia32_gatherq_ps">, Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v4f32_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_q_ps_256 : GCCBuiltin<"__builtin_ia32_gatherq_ps256">, Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4f32_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_d_q : GCCBuiltin<"__builtin_ia32_gatherd_q">, Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v2i64_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_d_q_256 : GCCBuiltin<"__builtin_ia32_gatherd_q256">, Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i64_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_q_q : GCCBuiltin<"__builtin_ia32_gatherq_q">, Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v2i64_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_q_q_256 : GCCBuiltin<"__builtin_ia32_gatherq_q256">, Intrinsic<[llvm_v4i64_ty], [llvm_v4i64_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i64_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_d_d : GCCBuiltin<"__builtin_ia32_gatherd_d">, Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i32_ty, llvm_v4i32_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_d_d_256 : GCCBuiltin<"__builtin_ia32_gatherd_d256">, Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_ptr_ty, llvm_v8i32_ty, llvm_v8i32_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_q_d : GCCBuiltin<"__builtin_ia32_gatherq_d">, Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_ptr_ty, llvm_v2i64_ty, llvm_v4i32_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx2_gather_q_d_256 : GCCBuiltin<"__builtin_ia32_gatherq_d256">, Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_ptr_ty, llvm_v4i64_ty, llvm_v4i32_ty, llvm_i8_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; } // Misc. @@ -2909,28 +2909,28 @@ let TargetPrefix = "x86" in { def int_x86_avx512_gather_dpd_mask_512 : GCCBuiltin<"__builtin_ia32_mask_gatherdpd512">, Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_i8_ty, llvm_v8i32_ty, llvm_ptr_ty, llvm_i32_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx512_gather_dps_mask_512 : GCCBuiltin<"__builtin_ia32_mask_gatherdps512">, Intrinsic<[llvm_v16f32_ty], [llvm_v16f32_ty, llvm_i16_ty, llvm_v16i32_ty, llvm_ptr_ty, llvm_i32_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx512_gather_qpd_mask_512 : GCCBuiltin<"__builtin_ia32_mask_gatherqpd512">, Intrinsic<[llvm_v8f64_ty], [llvm_v8f64_ty, llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty, llvm_i32_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx512_gather_qps_mask_512 : GCCBuiltin<"__builtin_ia32_mask_gatherqps512">, Intrinsic<[llvm_v8f32_ty], [llvm_v8f32_ty, llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty, llvm_i32_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx512_gather_dpd_512 : GCCBuiltin<"__builtin_ia32_gatherdpd512">, Intrinsic<[llvm_v8f64_ty], [llvm_v8i32_ty, llvm_ptr_ty, llvm_i32_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx512_gather_dps_512 : GCCBuiltin<"__builtin_ia32_gatherdps512">, Intrinsic<[llvm_v16f32_ty], [llvm_v16i32_ty, llvm_ptr_ty, llvm_i32_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx512_gather_qpd_512 : GCCBuiltin<"__builtin_ia32_gatherqpd512">, Intrinsic<[llvm_v8f64_ty], [llvm_v8i64_ty, llvm_ptr_ty, llvm_i32_ty], @@ -2938,12 +2938,12 @@ let TargetPrefix = "x86" in { def int_x86_avx512_gather_qps_512 : GCCBuiltin<"__builtin_ia32_gatherqps512">, Intrinsic<[llvm_v8f32_ty], [llvm_v8i64_ty, llvm_ptr_ty, llvm_i32_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx512_gather_dpq_mask_512 : GCCBuiltin<"__builtin_ia32_mask_gatherdpq512">, Intrinsic<[llvm_v8i64_ty], [llvm_v8i64_ty, llvm_i8_ty, llvm_v8i32_ty, llvm_ptr_ty, llvm_i32_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx512_gather_dpi_mask_512 : GCCBuiltin<"__builtin_ia32_mask_gatherdpi512">, Intrinsic<[llvm_v16i32_ty], [llvm_v16i32_ty, llvm_i16_ty, llvm_v16i32_ty, llvm_ptr_ty, llvm_i32_ty], @@ -2955,7 +2955,7 @@ let TargetPrefix = "x86" in { def int_x86_avx512_gather_qpi_mask_512 : GCCBuiltin<"__builtin_ia32_mask_gatherqpi512">, Intrinsic<[llvm_v8i32_ty], [llvm_v8i32_ty, llvm_i8_ty, llvm_v8i64_ty, llvm_ptr_ty, llvm_i32_ty], - [IntrReadMem]>; + [IntrReadArgMem]>; def int_x86_avx512_gather_dpq_512 : GCCBuiltin<"__builtin_ia32_gatherdpq512">, Intrinsic<[llvm_v8i64_ty], [llvm_v8i32_ty, llvm_ptr_ty, Modified: head/contrib/llvm/include/llvm/MC/MCAsmInfo.h ============================================================================== --- head/contrib/llvm/include/llvm/MC/MCAsmInfo.h Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/include/llvm/MC/MCAsmInfo.h Mon May 12 18:45:56 2014 (r265925) @@ -266,13 +266,16 @@ namespace llvm { /// global as being a weak undefined symbol. const char *WeakRefDirective; // Defaults to NULL. - /// WeakDefDirective - This directive, if non-null, is used to declare a - /// global as being a weak defined symbol. - const char *WeakDefDirective; // Defaults to NULL. - - /// LinkOnceDirective - This directive, if non-null is used to declare a - /// global as being a weak defined symbol. This is used on cygwin/mingw. - const char *LinkOnceDirective; // Defaults to NULL. + /// True if we have a directive to declare a global as being a weak + /// defined symbol. + bool HasWeakDefDirective; // Defaults to false. + + /// True if we have a directive to declare a global as being a weak + /// defined symbol that can be hidden (unexported). + bool HasWeakDefCanBeHiddenDirective; // Defaults to false. + + /// True if we have a .linkonce directive. This is used on cygwin/mingw. + bool HasLinkOnceDirective; // Defaults to false. /// HiddenVisibilityAttr - This attribute, if not MCSA_Invalid, is used to /// declare a symbol as having hidden visibility. @@ -303,6 +306,10 @@ namespace llvm { /// uses relocations for references to other .debug_* sections. bool DwarfUsesRelocationsAcrossSections; + /// DwarfFDESymbolsUseAbsDiff - true if DWARF FDE symbol reference + /// relocations should be replaced by an absolute difference. + bool DwarfFDESymbolsUseAbsDiff; + /// DwarfRegNumForCFI - True if dwarf register numbers are printed /// instead of symbolic register names in .cfi_* directives. bool DwarfRegNumForCFI; // Defaults to false; @@ -497,8 +504,11 @@ namespace llvm { bool hasIdentDirective() const { return HasIdentDirective; } bool hasNoDeadStrip() const { return HasNoDeadStrip; } const char *getWeakRefDirective() const { return WeakRefDirective; } - const char *getWeakDefDirective() const { return WeakDefDirective; } - const char *getLinkOnceDirective() const { return LinkOnceDirective; } + bool hasWeakDefDirective() const { return HasWeakDefDirective; } + bool hasWeakDefCanBeHiddenDirective() const { + return HasWeakDefCanBeHiddenDirective; + } + bool hasLinkOnceDirective() const { return HasLinkOnceDirective; } MCSymbolAttr getHiddenVisibilityAttr() const { return HiddenVisibilityAttr;} MCSymbolAttr getHiddenDeclarationVisibilityAttr() const { @@ -528,6 +538,9 @@ namespace llvm { bool doesDwarfUseRelocationsAcrossSections() const { return DwarfUsesRelocationsAcrossSections; } + bool doDwarfFDESymbolsUseAbsDiff() const { + return DwarfFDESymbolsUseAbsDiff; + } bool useDwarfRegNumForCFI() const { return DwarfRegNumForCFI; } Modified: head/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp ============================================================================== --- head/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp Mon May 12 18:45:56 2014 (r265925) @@ -18,7 +18,10 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/CaptureTracking.h" +#include "llvm/Analysis/CFG.h" +#include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/InstructionSimplify.h" +#include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/MemoryBuiltins.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/IR/Constants.h" @@ -38,6 +41,12 @@ #include using namespace llvm; +/// Cutoff after which to stop analysing a set of phi nodes potentially involved +/// in a cycle. Because we are analysing 'through' phi nodes we need to be +/// careful with value equivalence. We use reachability to make sure a value +/// cannot be involved in a cycle. +const unsigned MaxNumPhiBBsValueReachabilityCheck = 20; + //===----------------------------------------------------------------------===// // Useful predicates //===----------------------------------------------------------------------===// @@ -403,42 +412,6 @@ DecomposeGEPExpression(const Value *V, i return V; } -/// GetIndexDifference - Dest and Src are the variable indices from two -/// decomposed GetElementPtr instructions GEP1 and GEP2 which have common base -/// pointers. Subtract the GEP2 indices from GEP1 to find the symbolic -/// difference between the two pointers. -static void GetIndexDifference(SmallVectorImpl &Dest, - const SmallVectorImpl &Src) { - if (Src.empty()) return; - - for (unsigned i = 0, e = Src.size(); i != e; ++i) { - const Value *V = Src[i].V; - ExtensionKind Extension = Src[i].Extension; - int64_t Scale = Src[i].Scale; - - // Find V in Dest. This is N^2, but pointer indices almost never have more - // than a few variable indexes. - for (unsigned j = 0, e = Dest.size(); j != e; ++j) { - if (Dest[j].V != V || Dest[j].Extension != Extension) continue; - - // If we found it, subtract off Scale V's from the entry in Dest. If it - // goes to zero, remove the entry. - if (Dest[j].Scale != Scale) - Dest[j].Scale -= Scale; - else - Dest.erase(Dest.begin()+j); - Scale = 0; - break; - } - - // If we didn't consume this entry, add it to the end of the Dest list. - if (Scale) { - VariableGEPIndex Entry = { V, Extension, -Scale }; - Dest.push_back(Entry); - } - } -} - //===----------------------------------------------------------------------===// // BasicAliasAnalysis Pass //===----------------------------------------------------------------------===// @@ -492,6 +465,7 @@ namespace { // SmallDenseMap if it ever grows larger. // FIXME: This should really be shrink_to_inline_capacity_and_clear(). AliasCache.shrink_and_clear(); + VisitedPhiBBs.clear(); return Alias; } @@ -532,9 +506,39 @@ namespace { typedef SmallDenseMap AliasCacheTy; AliasCacheTy AliasCache; + /// \brief Track phi nodes we have visited. When interpret "Value" pointer + /// equality as value equality we need to make sure that the "Value" is not + /// part of a cycle. Otherwise, two uses could come from different + /// "iterations" of a cycle and see different values for the same "Value" + /// pointer. + /// The following example shows the problem: + /// %p = phi(%alloca1, %addr2) + /// %l = load %ptr + /// %addr1 = gep, %alloca2, 0, %l + /// %addr2 = gep %alloca2, 0, (%l + 1) + /// alias(%p, %addr1) -> MayAlias ! + /// store %l, ... + SmallPtrSet VisitedPhiBBs; + // Visited - Track instructions visited by pointsToConstantMemory. SmallPtrSet Visited; + /// \brief Check whether two Values can be considered equivalent. + /// + /// In addition to pointer equivalence of \p V1 and \p V2 this checks + /// whether they can not be part of a cycle in the value graph by looking at + /// all visited phi nodes an making sure that the phis cannot reach the + /// value. We have to do this because we are looking through phi nodes (That + /// is we say noalias(V, phi(VA, VB)) if noalias(V, VA) and noalias(V, VB). + bool isValueEqualInPotentialCycles(const Value *V1, const Value *V2); + + /// \brief Dest and Src are the variable indices from two decomposed + /// GetElementPtr instructions GEP1 and GEP2 which have common base + /// pointers. Subtract the GEP2 indices from GEP1 to find the symbolic + /// difference between the two pointers. + void GetIndexDifference(SmallVectorImpl &Dest, + const SmallVectorImpl &Src); + // aliasGEP - Provide a bunch of ad-hoc rules to disambiguate a GEP // instruction against another. AliasResult aliasGEP(const GEPOperator *V1, uint64_t V1Size, @@ -1005,7 +1009,15 @@ BasicAliasAnalysis::aliasGEP(const GEPOp return NoAlias; } } else { - if (V1Size != UnknownSize) { + // We have the situation where: + // + + + // | BaseOffset | + // ---------------->| + // |-->V1Size |-------> V2Size + // GEP1 V2 + // We need to know that V2Size is not unknown, otherwise we might have + // stripped a gep with negative index ('gep , -1, ...). + if (V1Size != UnknownSize && V2Size != UnknownSize) { if (-(uint64_t)GEP1BaseOffset < V1Size) return PartialAlias; return NoAlias; @@ -1094,6 +1106,10 @@ BasicAliasAnalysis::aliasPHI(const PHINo const MDNode *PNTBAAInfo, const Value *V2, uint64_t V2Size, const MDNode *V2TBAAInfo) { + // Track phi nodes we have visited. We use this information when we determine + // value equivalence. + VisitedPhiBBs.insert(PN->getParent()); + // If the values are PHIs in the same block, we can do a more precise // as well as efficient check: just check for aliases between the values // on corresponding edges. @@ -1187,7 +1203,13 @@ BasicAliasAnalysis::aliasCheck(const Val V2 = V2->stripPointerCasts(); // Are we checking for alias of the same value? - if (V1 == V2) return MustAlias; + // Because we look 'through' phi nodes we could look at "Value" pointers from + // different iterations. We must therefore make sure that this is not the + // case. The function isValueEqualInPotentialCycles ensures that this cannot + // happen by looking at the visited phi nodes and making sure they cannot + // reach the value. + if (isValueEqualInPotentialCycles(V1, V2)) + return MustAlias; if (!V1->getType()->isPointerTy() || !V2->getType()->isPointerTy()) return NoAlias; // Scalars cannot alias each other @@ -1307,3 +1329,71 @@ BasicAliasAnalysis::aliasCheck(const Val Location(V2, V2Size, V2TBAAInfo)); return AliasCache[Locs] = Result; } + +bool BasicAliasAnalysis::isValueEqualInPotentialCycles(const Value *V, + const Value *V2) { + if (V != V2) + return false; + + const Instruction *Inst = dyn_cast(V); + if (!Inst) + return true; + + if (VisitedPhiBBs.size() > MaxNumPhiBBsValueReachabilityCheck) + return false; + + // Use dominance or loop info if available. + DominatorTree *DT = getAnalysisIfAvailable(); + LoopInfo *LI = getAnalysisIfAvailable(); + + // Make sure that the visited phis cannot reach the Value. This ensures that + // the Values cannot come from different iterations of a potential cycle the + // phi nodes could be involved in. + for (SmallPtrSet::iterator PI = VisitedPhiBBs.begin(), + PE = VisitedPhiBBs.end(); + PI != PE; ++PI) + if (isPotentiallyReachable((*PI)->begin(), Inst, DT, LI)) + return false; + + return true; +} + +/// GetIndexDifference - Dest and Src are the variable indices from two +/// decomposed GetElementPtr instructions GEP1 and GEP2 which have common base +/// pointers. Subtract the GEP2 indices from GEP1 to find the symbolic +/// difference between the two pointers. +void BasicAliasAnalysis::GetIndexDifference( + SmallVectorImpl &Dest, + const SmallVectorImpl &Src) { + if (Src.empty()) + return; + + for (unsigned i = 0, e = Src.size(); i != e; ++i) { + const Value *V = Src[i].V; + ExtensionKind Extension = Src[i].Extension; + int64_t Scale = Src[i].Scale; + + // Find V in Dest. This is N^2, but pointer indices almost never have more + // than a few variable indexes. + for (unsigned j = 0, e = Dest.size(); j != e; ++j) { + if (!isValueEqualInPotentialCycles(Dest[j].V, V) || + Dest[j].Extension != Extension) + continue; + + // If we found it, subtract off Scale V's from the entry in Dest. If it + // goes to zero, remove the entry. + if (Dest[j].Scale != Scale) + Dest[j].Scale -= Scale; + else + Dest.erase(Dest.begin() + j); + Scale = 0; + break; + } + + // If we didn't consume this entry, add it to the end of the Dest list. + if (Scale) { + VariableGEPIndex Entry = { V, Extension, -Scale }; + Dest.push_back(Entry); + } + } +} Modified: head/contrib/llvm/lib/Analysis/IVUsers.cpp ============================================================================== --- head/contrib/llvm/lib/Analysis/IVUsers.cpp Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/Analysis/IVUsers.cpp Mon May 12 18:45:56 2014 (r265925) @@ -187,15 +187,34 @@ bool IVUsers::AddUsersImpl(Instruction * if (AddUserToIVUsers) { // Okay, we found a user that we cannot reduce. - IVUses.push_back(new IVStrideUse(this, User, I)); - IVStrideUse &NewUse = IVUses.back(); + IVStrideUse &NewUse = AddUser(User, I); // Autodetect the post-inc loop set, populating NewUse.PostIncLoops. // The regular return value here is discarded; instead of recording // it, we just recompute it when we need it. + const SCEV *OriginalISE = ISE; ISE = TransformForPostIncUse(NormalizeAutodetect, ISE, User, I, NewUse.PostIncLoops, *SE, *DT); + + // PostIncNormalization effectively simplifies the expression under + // pre-increment assumptions. Those assumptions (no wrapping) might not + // hold for the post-inc value. Catch such cases by making sure the + // transformation is invertible. + if (OriginalISE != ISE) { + const SCEV *DenormalizedISE = + TransformForPostIncUse(Denormalize, ISE, User, I, + NewUse.PostIncLoops, *SE, *DT); + + // If we normalized the expression, but denormalization doesn't give the + // original one, discard this user. + if (OriginalISE != DenormalizedISE) { + DEBUG(dbgs() << " DISCARDING (NORMALIZATION ISN'T INVERTIBLE): " + << *ISE << '\n'); + IVUses.pop_back(); + return false; + } + } DEBUG(if (SE->getSCEV(I) != ISE) dbgs() << " NORMALIZED TO: " << *ISE << '\n'); } Modified: head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp ============================================================================== --- head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp Mon May 12 18:45:56 2014 (r265925) @@ -6218,7 +6218,7 @@ bool ScalarEvolution::isImpliedCond(ICmp // LHS' type is checked for above. if (getTypeSizeInBits(LHS->getType()) > getTypeSizeInBits(FoundLHS->getType())) { - if (CmpInst::isSigned(Pred)) { + if (CmpInst::isSigned(FoundPred)) { FoundLHS = getSignExtendExpr(FoundLHS, LHS->getType()); FoundRHS = getSignExtendExpr(FoundRHS, LHS->getType()); } else { Modified: head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon May 12 18:45:56 2014 (r265925) @@ -223,13 +223,14 @@ void AsmPrinter::EmitLinkage(const Globa case GlobalValue::WeakAnyLinkage: case GlobalValue::WeakODRLinkage: case GlobalValue::LinkerPrivateWeakLinkage: - if (MAI->getWeakDefDirective() != 0) { + if (MAI->hasWeakDefDirective()) { // .globl _foo OutStreamer.EmitSymbolAttribute(GVSym, MCSA_Global); bool CanBeHidden = false; - if (Linkage == GlobalValue::LinkOnceODRLinkage) { + if (Linkage == GlobalValue::LinkOnceODRLinkage && + MAI->hasWeakDefCanBeHiddenDirective()) { if (GV->hasUnnamedAddr()) { CanBeHidden = true; } else { @@ -244,7 +245,7 @@ void AsmPrinter::EmitLinkage(const Globa OutStreamer.EmitSymbolAttribute(GVSym, MCSA_WeakDefinition); else OutStreamer.EmitSymbolAttribute(GVSym, MCSA_WeakDefAutoPrivate); - } else if (MAI->getLinkOnceDirective() != 0) { + } else if (MAI->hasLinkOnceDirective()) { // .globl _foo OutStreamer.EmitSymbolAttribute(GVSym, MCSA_Global); //NOTE: linkonce is handled by the section the symbol was assigned to. Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon May 12 18:45:56 2014 (r265925) @@ -8547,7 +8547,10 @@ struct MemOpLink { // base ptr. struct ConsecutiveMemoryChainSorter { bool operator()(MemOpLink LHS, MemOpLink RHS) { - return LHS.OffsetFromBase < RHS.OffsetFromBase; + return + LHS.OffsetFromBase < RHS.OffsetFromBase || + (LHS.OffsetFromBase == RHS.OffsetFromBase && + LHS.SequenceNum > RHS.SequenceNum); } }; Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp Mon May 12 18:45:56 2014 (r265925) @@ -210,6 +210,7 @@ SDValue VectorLegalizer::LegalizeOp(SDVa case ISD::SRL: case ISD::ROTL: case ISD::ROTR: + case ISD::BSWAP: case ISD::CTLZ: case ISD::CTTZ: case ISD::CTLZ_ZERO_UNDEF: Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Mon May 12 18:45:56 2014 (r265925) @@ -219,8 +219,11 @@ void ScheduleDAGSDNodes::ClusterNeighbor DenseMap O2SMap; // Map from offset to SDNode. bool Cluster = false; SDNode *Base = Node; + // This algorithm requires a reasonably low use count before finding a match + // to avoid uselessly blowing up compile time in large blocks. + unsigned UseCount = 0; for (SDNode::use_iterator I = Chain->use_begin(), E = Chain->use_end(); - I != E; ++I) { + I != E && UseCount < 100; ++I, ++UseCount) { SDNode *User = *I; if (User == Node || !Visited.insert(User)) continue; @@ -237,6 +240,8 @@ void ScheduleDAGSDNodes::ClusterNeighbor if (Offset2 < Offset1) Base = User; Cluster = true; + // Reset UseCount to allow more matches. + UseCount = 0; } if (!Cluster) Modified: head/contrib/llvm/lib/MC/MCAsmInfo.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCAsmInfo.cpp Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/MC/MCAsmInfo.cpp Mon May 12 18:45:56 2014 (r265925) @@ -76,8 +76,9 @@ MCAsmInfo::MCAsmInfo() { HasIdentDirective = false; HasNoDeadStrip = false; WeakRefDirective = 0; - WeakDefDirective = 0; - LinkOnceDirective = 0; + HasWeakDefDirective = false; + HasWeakDefCanBeHiddenDirective = false; + HasLinkOnceDirective = false; HiddenVisibilityAttr = MCSA_Hidden; HiddenDeclarationVisibilityAttr = MCSA_Hidden; ProtectedVisibilityAttr = MCSA_Protected; @@ -85,6 +86,7 @@ MCAsmInfo::MCAsmInfo() { SupportsDebugInformation = false; ExceptionsType = ExceptionHandling::None; DwarfUsesRelocationsAcrossSections = true; + DwarfFDESymbolsUseAbsDiff = false; DwarfRegNumForCFI = false; HasMicrosoftFastStdCallMangling = false; NeedsDwarfSectionOffsetDirective = false; Modified: head/contrib/llvm/lib/MC/MCAsmInfoCOFF.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCAsmInfoCOFF.cpp Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/MC/MCAsmInfoCOFF.cpp Mon May 12 18:45:56 2014 (r265925) @@ -27,7 +27,7 @@ MCAsmInfoCOFF::MCAsmInfoCOFF() { HasSingleParameterDotFile = false; PrivateGlobalPrefix = "L"; // Prefix for private global symbols WeakRefDirective = "\t.weak\t"; - LinkOnceDirective = "\t.linkonce discard\n"; + HasLinkOnceDirective = true; // Doesn't support visibility: HiddenVisibilityAttr = HiddenDeclarationVisibilityAttr = MCSA_Invalid; Modified: head/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp Mon May 12 18:45:56 2014 (r265925) @@ -36,7 +36,8 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() { InlineAsmEnd = " InlineAsm End"; // Directives: - WeakDefDirective = "\t.weak_definition "; + HasWeakDefDirective = true; + HasWeakDefCanBeHiddenDirective = true; WeakRefDirective = "\t.weak_reference "; ZeroDirective = "\t.space\t"; // ".space N" emits N zeros. HasMachoZeroFillDirective = true; // Uses .zerofill Modified: head/contrib/llvm/lib/MC/MCDwarf.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCDwarf.cpp Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/MC/MCDwarf.cpp Mon May 12 18:45:56 2014 (r265925) @@ -839,8 +839,9 @@ static unsigned getSizeForEncoding(MCStr } } -static void EmitSymbol(MCStreamer &streamer, const MCSymbol &symbol, - unsigned symbolEncoding, const char *comment = 0) { +static void EmitFDESymbol(MCStreamer &streamer, const MCSymbol &symbol, + unsigned symbolEncoding, bool isEH, + const char *comment = 0) { MCContext &context = streamer.getContext(); const MCAsmInfo *asmInfo = context.getAsmInfo(); const MCExpr *v = asmInfo->getExprForFDESymbol(&symbol, @@ -848,7 +849,10 @@ static void EmitSymbol(MCStreamer &strea streamer); unsigned size = getSizeForEncoding(streamer, symbolEncoding); if (streamer.isVerboseAsm() && comment) streamer.AddComment(comment); - streamer.EmitAbsValue(v, size); + if (asmInfo->doDwarfFDESymbolsUseAbsDiff() && isEH) + streamer.EmitAbsValue(v, size); + else + streamer.EmitValue(v, size); } static void EmitPersonality(MCStreamer &streamer, const MCSymbol &symbol, @@ -1347,7 +1351,7 @@ MCSymbol *FrameEmitterImpl::EmitFDE(MCSt unsigned PCEncoding = IsEH ? MOFI->getFDEEncoding(UsingCFI) : (unsigned)dwarf::DW_EH_PE_absptr; unsigned PCSize = getSizeForEncoding(streamer, PCEncoding); - EmitSymbol(streamer, *frame.Begin, PCEncoding, "FDE initial location"); + EmitFDESymbol(streamer, *frame.Begin, PCEncoding, IsEH, "FDE initial location"); // PC Range const MCExpr *Range = MakeStartMinusEndExpr(streamer, *frame.Begin, @@ -1367,8 +1371,8 @@ MCSymbol *FrameEmitterImpl::EmitFDE(MCSt // Augmentation Data if (frame.Lsda) - EmitSymbol(streamer, *frame.Lsda, frame.LsdaEncoding, - "Language Specific Data Area"); + EmitFDESymbol(streamer, *frame.Lsda, frame.LsdaEncoding, true, + "Language Specific Data Area"); } // Call Frame Instructions Modified: head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Mon May 12 18:45:56 2014 (r265925) @@ -4297,6 +4297,10 @@ bool AsmParser::parseMSInlineAsm( break; } case AOK_DotOperator: + // Insert the dot if the user omitted it. + OS.flush(); + if (AsmStringIR.at(AsmStringIR.size() - 1) != '.') + OS << '.'; OS << (*I).Val; break; } Modified: head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp Mon May 12 18:45:56 2014 (r265925) @@ -31,12 +31,8 @@ using namespace llvm; static TargetLoweringObjectFile *createTLOF(AArch64TargetMachine &TM) { const AArch64Subtarget *Subtarget = &TM.getSubtarget(); - - if (Subtarget->isTargetLinux()) - return new AArch64LinuxTargetObjectFile(); - if (Subtarget->isTargetELF()) - return new TargetLoweringObjectFileELF(); - llvm_unreachable("unknown subtarget type"); + assert (Subtarget->isTargetELF() && "unknown subtarget type"); + return new AArch64ElfTargetObjectFile(); } AArch64TargetLowering::AArch64TargetLowering(AArch64TargetMachine &TM) @@ -2782,7 +2778,7 @@ AArch64TargetLowering::LowerSETCC(SDValu SDValue AArch64TargetLowering::LowerVACOPY(SDValue Op, SelectionDAG &DAG) const { const Value *DestSV = cast(Op.getOperand(3))->getValue(); - const Value *SrcSV = cast(Op.getOperand(3))->getValue(); + const Value *SrcSV = cast(Op.getOperand(4))->getValue(); // We have to make sure we copy the entire structure: 8+8+8+4+4 = 32 bytes // rather than just 8. Modified: head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.td ============================================================================== --- head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.td Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.td Mon May 12 18:45:56 2014 (r265925) @@ -2587,6 +2587,7 @@ class A64I_SRexs_impl size, bits pat, itin> { let mayStore = 1; let PostEncoderMethod = "fixLoadStoreExclusive<1,0>"; + let Constraints = "@earlyclobber $Rs"; } multiclass A64I_SRex opcode, string prefix> { Modified: head/contrib/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp Mon May 12 18:45:56 2014 (r265925) @@ -22,3 +22,10 @@ AArch64LinuxTargetObjectFile::Initialize TargetLoweringObjectFileELF::Initialize(Ctx, TM); InitializeELF(TM.Options.UseInitArray); } + +void +AArch64ElfTargetObjectFile::Initialize(MCContext &Ctx, + const TargetMachine &TM) { + TargetLoweringObjectFileELF::Initialize(Ctx, TM); + InitializeELF(TM.Options.UseInitArray); +} Modified: head/contrib/llvm/lib/Target/AArch64/AArch64TargetObjectFile.h ============================================================================== --- head/contrib/llvm/lib/Target/AArch64/AArch64TargetObjectFile.h Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/Target/AArch64/AArch64TargetObjectFile.h Mon May 12 18:45:56 2014 (r265925) @@ -20,8 +20,12 @@ namespace llvm { - /// AArch64LinuxTargetObjectFile - This implementation is used for linux - /// AArch64. + /// AArch64ElfTargetObjectFile - This implementation is used for ELF + /// AArch64 targets. + class AArch64ElfTargetObjectFile : public TargetLoweringObjectFileELF { + virtual void Initialize(MCContext &Ctx, const TargetMachine &TM); + }; + class AArch64LinuxTargetObjectFile : public TargetLoweringObjectFileELF { virtual void Initialize(MCContext &Ctx, const TargetMachine &TM); }; Modified: head/contrib/llvm/lib/Target/ARM/A15SDOptimizer.cpp ============================================================================== --- head/contrib/llvm/lib/Target/ARM/A15SDOptimizer.cpp Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/Target/ARM/A15SDOptimizer.cpp Mon May 12 18:45:56 2014 (r265925) @@ -418,7 +418,8 @@ SmallVector A15SDOptimizer: if (!MO.isReg() || !MO.isUse()) continue; if (!usesRegClass(MO, &ARM::DPRRegClass) && - !usesRegClass(MO, &ARM::QPRRegClass)) + !usesRegClass(MO, &ARM::QPRRegClass) && + !usesRegClass(MO, &ARM::DPairRegClass)) // Treat DPair as QPR continue; Defs.push_back(MO.getReg()); @@ -538,7 +539,10 @@ A15SDOptimizer::optimizeAllLanesPattern( InsertPt++; unsigned Out; - if (MRI->getRegClass(Reg)->hasSuperClassEq(&ARM::QPRRegClass)) { + // DPair has the same length as QPR and also has two DPRs as subreg. + // Treat DPair as QPR. + if (MRI->getRegClass(Reg)->hasSuperClassEq(&ARM::QPRRegClass) || + MRI->getRegClass(Reg)->hasSuperClassEq(&ARM::DPairRegClass)) { unsigned DSub0 = createExtractSubreg(MBB, InsertPt, DL, Reg, ARM::dsub_0, &ARM::DPRRegClass); unsigned DSub1 = createExtractSubreg(MBB, InsertPt, DL, Reg, @@ -571,7 +575,9 @@ A15SDOptimizer::optimizeAllLanesPattern( default: llvm_unreachable("Unknown preferred lane!"); } - bool UsesQPR = usesRegClass(MI->getOperand(0), &ARM::QPRRegClass); + // Treat DPair as QPR + bool UsesQPR = usesRegClass(MI->getOperand(0), &ARM::QPRRegClass) || + usesRegClass(MI->getOperand(0), &ARM::DPairRegClass); Out = createImplicitDef(MBB, InsertPt, DL); Out = createInsertSubreg(MBB, InsertPt, DL, Out, PrefLane, Reg); Modified: head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp Mon May 12 18:45:56 2014 (r265925) @@ -3684,6 +3684,7 @@ ARMBaseInstrInfo::getOperandLatency(cons case ARM::VLD3d16Pseudo: case ARM::VLD3d32Pseudo: case ARM::VLD1d64TPseudo: + case ARM::VLD1d64TPseudoWB_fixed: case ARM::VLD3d8Pseudo_UPD: case ARM::VLD3d16Pseudo_UPD: case ARM::VLD3d32Pseudo_UPD: @@ -3700,6 +3701,7 @@ ARMBaseInstrInfo::getOperandLatency(cons case ARM::VLD4d16Pseudo: case ARM::VLD4d32Pseudo: case ARM::VLD1d64QPseudo: + case ARM::VLD1d64QPseudoWB_fixed: case ARM::VLD4d8Pseudo_UPD: case ARM::VLD4d16Pseudo_UPD: case ARM::VLD4d32Pseudo_UPD: Modified: head/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp Mon May 12 18:45:56 2014 (r265925) @@ -136,7 +136,9 @@ static const NEONLdStTableEntry NEONLdSt { ARM::VLD1LNq8Pseudo_UPD, ARM::VLD1LNd8_UPD, true, true, true, EvenDblSpc, 1, 8 ,true}, { ARM::VLD1d64QPseudo, ARM::VLD1d64Q, true, false, false, SingleSpc, 4, 1 ,false}, +{ ARM::VLD1d64QPseudoWB_fixed, ARM::VLD1d64Qwb_fixed, true, true, false, SingleSpc, 4, 1 ,false}, { ARM::VLD1d64TPseudo, ARM::VLD1d64T, true, false, false, SingleSpc, 3, 1 ,false}, +{ ARM::VLD1d64TPseudoWB_fixed, ARM::VLD1d64Twb_fixed, true, true, false, SingleSpc, 3, 1 ,false}, { ARM::VLD2LNd16Pseudo, ARM::VLD2LNd16, true, false, false, SingleSpc, 2, 4 ,true}, { ARM::VLD2LNd16Pseudo_UPD, ARM::VLD2LNd16_UPD, true, true, true, SingleSpc, 2, 4 ,true}, @@ -1071,6 +1073,7 @@ bool ARMExpandPseudo::ExpandMI(MachineBa case ARM::VLD3d16Pseudo: case ARM::VLD3d32Pseudo: case ARM::VLD1d64TPseudo: + case ARM::VLD1d64TPseudoWB_fixed: case ARM::VLD3d8Pseudo_UPD: case ARM::VLD3d16Pseudo_UPD: case ARM::VLD3d32Pseudo_UPD: @@ -1087,6 +1090,7 @@ bool ARMExpandPseudo::ExpandMI(MachineBa case ARM::VLD4d16Pseudo: case ARM::VLD4d32Pseudo: case ARM::VLD1d64QPseudo: + case ARM::VLD1d64QPseudoWB_fixed: case ARM::VLD4d8Pseudo_UPD: case ARM::VLD4d16Pseudo_UPD: case ARM::VLD4d32Pseudo_UPD: Modified: head/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Mon May 12 17:58:17 2014 (r265924) +++ head/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Mon May 12 18:45:56 2014 (r265925) @@ -1673,9 +1673,61 @@ SDValue ARMDAGToDAGISel::GetVLDSTAlign(S return CurDAG->getTargetConstant(Alignment, MVT::i32); } +static bool isVLDfixed(unsigned Opc) +{ + switch (Opc) { + default: return false; + case ARM::VLD1d8wb_fixed : return true; + case ARM::VLD1d16wb_fixed : return true; + case ARM::VLD1d64Qwb_fixed : return true; + case ARM::VLD1d32wb_fixed : return true; + case ARM::VLD1d64wb_fixed : return true; + case ARM::VLD1d64TPseudoWB_fixed : return true; + case ARM::VLD1d64QPseudoWB_fixed : return true; + case ARM::VLD1q8wb_fixed : return true; + case ARM::VLD1q16wb_fixed : return true; + case ARM::VLD1q32wb_fixed : return true; + case ARM::VLD1q64wb_fixed : return true; + case ARM::VLD2d8wb_fixed : return true; + case ARM::VLD2d16wb_fixed : return true; + case ARM::VLD2d32wb_fixed : return true; + case ARM::VLD2q8PseudoWB_fixed : return true; + case ARM::VLD2q16PseudoWB_fixed : return true; + case ARM::VLD2q32PseudoWB_fixed : return true; + case ARM::VLD2DUPd8wb_fixed : return true; + case ARM::VLD2DUPd16wb_fixed : return true; + case ARM::VLD2DUPd32wb_fixed : return true; + } +} + +static bool isVSTfixed(unsigned Opc) +{ + switch (Opc) { + default: return false; + case ARM::VST1d8wb_fixed : return true; + case ARM::VST1d16wb_fixed : return true; + case ARM::VST1d32wb_fixed : return true; + case ARM::VST1d64wb_fixed : return true; + case ARM::VST1q8wb_fixed : return true; + case ARM::VST1q16wb_fixed : return true; + case ARM::VST1q32wb_fixed : return true; + case ARM::VST1q64wb_fixed : return true; + case ARM::VST1d64TPseudoWB_fixed : return true; + case ARM::VST1d64QPseudoWB_fixed : return true; + case ARM::VST2d8wb_fixed : return true; + case ARM::VST2d16wb_fixed : return true; + case ARM::VST2d32wb_fixed : return true; + case ARM::VST2q8PseudoWB_fixed : return true; + case ARM::VST2q16PseudoWB_fixed : return true; + case ARM::VST2q32PseudoWB_fixed : return true; + } +} + // Get the register stride update opcode of a VLD/VST instruction that // is otherwise equivalent to the given fixed stride updating instruction. static unsigned getVLDSTRegisterUpdateOpcode(unsigned Opc) { + assert((isVLDfixed(Opc) || isVSTfixed(Opc)) + && "Incorrect fixed stride updating instruction."); switch (Opc) { default: break; case ARM::VLD1d8wb_fixed: return ARM::VLD1d8wb_register; @@ -1686,6 +1738,10 @@ static unsigned getVLDSTRegisterUpdateOp case ARM::VLD1q16wb_fixed: return ARM::VLD1q16wb_register; case ARM::VLD1q32wb_fixed: return ARM::VLD1q32wb_register; case ARM::VLD1q64wb_fixed: return ARM::VLD1q64wb_register; + case ARM::VLD1d64Twb_fixed: return ARM::VLD1d64Twb_register; + case ARM::VLD1d64Qwb_fixed: return ARM::VLD1d64Qwb_register; + case ARM::VLD1d64TPseudoWB_fixed: return ARM::VLD1d64TPseudoWB_register; + case ARM::VLD1d64QPseudoWB_fixed: return ARM::VLD1d64QPseudoWB_register; case ARM::VST1d8wb_fixed: return ARM::VST1d8wb_register; case ARM::VST1d16wb_fixed: return ARM::VST1d16wb_register; @@ -1785,11 +1841,11 @@ SDNode *ARMDAGToDAGISel::SelectVLD(SDNod SDValue Inc = N->getOperand(AddrOpIdx + 1); // FIXME: VLD1/VLD2 fixed increment doesn't need Reg0. Remove the reg0 // case entirely when the rest are updated to that form, too. - if ((NumVecs == 1 || NumVecs == 2) && !isa(Inc.getNode())) + if ((NumVecs <= 2) && !isa(Inc.getNode())) Opc = getVLDSTRegisterUpdateOpcode(Opc); - // We use a VLD1 for v1i64 even if the pseudo says vld2/3/4, so + // FIXME: We use a VLD1 for v1i64 even if the pseudo says vld2/3/4, so // check for that explicitly too. Horribly hacky, but temporary. - if ((NumVecs != 1 && NumVecs != 2 && Opc != ARM::VLD1q64wb_fixed) || + if ((NumVecs > 2 && !isVLDfixed(Opc)) || !isa(Inc.getNode())) Ops.push_back(isa(Inc.getNode()) ? Reg0 : Inc); } @@ -1937,11 +1993,12 @@ SDNode *ARMDAGToDAGISel::SelectVST(SDNod // case entirely when the rest are updated to that form, too. if (NumVecs <= 2 && !isa(Inc.getNode())) Opc = getVLDSTRegisterUpdateOpcode(Opc); - // We use a VST1 for v1i64 even if the pseudo says vld2/3/4, so + // FIXME: We use a VST1 for v1i64 even if the pseudo says vld2/3/4, so // check for that explicitly too. Horribly hacky, but temporary. - if ((NumVecs > 2 && Opc != ARM::VST1q64wb_fixed) || - !isa(Inc.getNode())) - Ops.push_back(isa(Inc.getNode()) ? Reg0 : Inc); + if (!isa(Inc.getNode())) + Ops.push_back(Inc); + else if (NumVecs > 2 && !isVSTfixed(Opc)) + Ops.push_back(Reg0); } Ops.push_back(SrcReg); Ops.push_back(Pred); @@ -2834,7 +2891,7 @@ SDNode *ARMDAGToDAGISel::Select(SDNode * static const uint16_t DOpcodes[] = { ARM::VLD3d8Pseudo_UPD, ARM::VLD3d16Pseudo_UPD, ARM::VLD3d32Pseudo_UPD, - ARM::VLD1q64wb_fixed}; + ARM::VLD1d64TPseudoWB_fixed}; static const uint16_t QOpcodes0[] = { ARM::VLD3q8Pseudo_UPD, ARM::VLD3q16Pseudo_UPD, ARM::VLD3q32Pseudo_UPD }; @@ -2848,7 +2905,7 @@ SDNode *ARMDAGToDAGISel::Select(SDNode * static const uint16_t DOpcodes[] = { ARM::VLD4d8Pseudo_UPD, ARM::VLD4d16Pseudo_UPD, ARM::VLD4d32Pseudo_UPD, - ARM::VLD1q64wb_fixed}; + ARM::VLD1d64QPseudoWB_fixed}; static const uint16_t QOpcodes0[] = { ARM::VLD4q8Pseudo_UPD, ARM::VLD4q16Pseudo_UPD, ARM::VLD4q32Pseudo_UPD }; Modified: head/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td Mon May 12 17:58:17 2014 (r265924) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon May 12 19:11:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF2AC659; Mon, 12 May 2014 19:11:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCA182514; Mon, 12 May 2014 19:11:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4CJBd9H005344; Mon, 12 May 2014 19:11:39 GMT (envelope-from thomas@svn.freebsd.org) Received: (from thomas@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CJBdqQ005343; Mon, 12 May 2014 19:11:39 GMT (envelope-from thomas@svn.freebsd.org) Message-Id: <201405121911.s4CJBdqQ005343@svn.freebsd.org> From: Thomas Quinot Date: Mon, 12 May 2014 19:11:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265926 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 19:11:40 -0000 Author: thomas Date: Mon May 12 19:11:39 2014 New Revision: 265926 URL: http://svnweb.freebsd.org/changeset/base/265926 Log: (NANO_CONFIG): New variable containing path of config file, so that the configuration can reference additional files relative to its own location. (NANO_MODULES): If set to "default", install all built modules. Reviewed by: imp MFC after: 1 week Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Mon May 12 18:45:56 2014 (r265925) +++ head/tools/tools/nanobsd/nanobsd.sh Mon May 12 19:11:39 2014 (r265926) @@ -79,7 +79,8 @@ CONF_WORLD=' ' # Kernel config file to use NANO_KERNEL=GENERIC -# Kernel modules to build; default is none +# Kernel modules to install. If empty, no modules are installed. +# Use "default" to install all built modules. NANO_MODULES= # Customize commands. @@ -321,13 +322,19 @@ install_kernel ( ) ( kernconf=${NANO_KERNEL} fi + # Install all built modules if NANO_MODULES=default, + # else install only listed modules (none if NANO_MODULES is empty). + if [ "${NANO_MODULES}" != "default" ]; then + modules_override_arg="MODULES_OVERRIDE='${NANO_MODULES}'" + fi + cd ${NANO_SRC} eval "TARGET_ARCH=${NANO_ARCH} ${NANO_MAKE} installkernel \ DESTDIR='${NANO_WORLDDIR}' \ SRCCONF='${SRCCONF}' \ __MAKE_CONF='${NANO_MAKE_CONF_INSTALL}' \ ${kernconfdir_arg} KERNCONF=${kernconf} \ - MODULES_OVERRIDE='${NANO_MODULES}'" + ${modules_override_arg}" ) > ${NANO_OBJ}/_.ik 2>&1 ) @@ -925,6 +932,10 @@ do shift ;; -c) + # Make config file path available to the config file + # itself so that it can access additional files relative + # to its own location. + NANO_CONFIG=$2 . "$2" shift shift From owner-svn-src-head@FreeBSD.ORG Mon May 12 19:29:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F153AA06; Mon, 12 May 2014 19:29:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEAC22691; Mon, 12 May 2014 19:29:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4CJTcuo010968; Mon, 12 May 2014 19:29:38 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CJTcBx010967; Mon, 12 May 2014 19:29:38 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405121929.s4CJTcBx010967@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 12 May 2014 19:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265927 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 19:29:39 -0000 Author: ray Date: Mon May 12 19:29:38 2014 New Revision: 265927 URL: http://svnweb.freebsd.org/changeset/base/265927 Log: Update terminal sizes in any case when new vt(4) driver arrive. (Plus remove one unused newline) Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Mon May 12 19:11:39 2014 (r265926) +++ head/sys/dev/vt/vt_core.c Mon May 12 19:29:38 2014 (r265927) @@ -1981,8 +1981,11 @@ vt_upgrade(struct vt_device *vd) unsigned int i; /* Device didn't pass vd_init() or already upgraded. */ - if (vd->vd_flags & (VDF_ASYNC|VDF_DEAD)) + if (vd->vd_flags & (VDF_ASYNC|VDF_DEAD)) { + /* Refill settings with new sizes anyway. */ + vt_resize(vd); return; + } vd->vd_flags |= VDF_ASYNC; for (i = 0; i < VT_MAXWINDOWS; i++) { @@ -2019,7 +2022,6 @@ vt_upgrade(struct vt_device *vd) /* Refill settings with new sizes. */ vt_resize(vd); - } static void From owner-svn-src-head@FreeBSD.ORG Mon May 12 20:22:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A099DC5; Mon, 12 May 2014 20:22:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 571422BAD; Mon, 12 May 2014 20:22:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4CKMh9b037125; Mon, 12 May 2014 20:22:43 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CKMh8U037124; Mon, 12 May 2014 20:22:43 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201405122022.s4CKMh8U037124@svn.freebsd.org> From: Don Lewis Date: Mon, 12 May 2014 20:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265931 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 20:22:43 -0000 Author: truckman Date: Mon May 12 20:22:42 2014 New Revision: 265931 URL: http://svnweb.freebsd.org/changeset/base/265931 Log: Be even more paranoid about overflow. Requested by: ache Modified: head/sys/kern/subr_rman.c Modified: head/sys/kern/subr_rman.c ============================================================================== --- head/sys/kern/subr_rman.c Mon May 12 20:19:40 2014 (r265930) +++ head/sys/kern/subr_rman.c Mon May 12 20:22:42 2014 (r265931) @@ -466,8 +466,8 @@ rman_reserve_resource_bound(struct rman } amask = (1ul << RF_ALIGNMENT(flags)) - 1; - if (start + amask < start) { - DPRINTF(("start+amask wrapped around\n")); + if (start > ULONG_MAX - amask) { + DPRINTF(("start+amask would wrap around\n")); goto out; } @@ -487,8 +487,8 @@ rman_reserve_resource_bound(struct rman s->r_start, end)); break; } - if (s->r_start + amask < s->r_start) { - DPRINTF(("s->r_start (%#lx) + amask (%#lx) wrapped\n", + if (s->r_start > ULONG_MAX - amask) { + DPRINTF(("s->r_start (%#lx) + amask (%#lx) too large\n", s->r_start, amask)); break; } From owner-svn-src-head@FreeBSD.ORG Mon May 12 20:35:58 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75AF3497; Mon, 12 May 2014 20:35:58 +0000 (UTC) Received: from gw.catspoiler.org (gw.catspoiler.org [75.1.14.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56E792D43; Mon, 12 May 2014 20:35:58 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s4CKZnv0076365; Mon, 12 May 2014 13:35:53 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201405122035.s4CKZnv0076365@gw.catspoiler.org> Date: Mon, 12 May 2014 13:35:49 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r265931 - head/sys/kern To: src-committers@FreeBSD.org In-Reply-To: <201405122022.s4CKMh8U037124@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 20:35:58 -0000 On 12 May, To: src-committers@freebsd.org wrote: > Author: truckman > Date: Mon May 12 20:22:42 2014 > New Revision: 265931 > URL: http://svnweb.freebsd.org/changeset/base/265931 > > Log: > Be even more paranoid about overflow. > > Requested by: ache > > Modified: > head/sys/kern/subr_rman.c > > Modified: head/sys/kern/subr_rman.c > ============================================================================== > --- head/sys/kern/subr_rman.c Mon May 12 20:19:40 2014 (r265930) > +++ head/sys/kern/subr_rman.c Mon May 12 20:22:42 2014 (r265931) > @@ -466,8 +466,8 @@ rman_reserve_resource_bound(struct rman > } > > amask = (1ul << RF_ALIGNMENT(flags)) - 1; > - if (start + amask < start) { > - DPRINTF(("start+amask wrapped around\n")); > + if (start > ULONG_MAX - amask) { > + DPRINTF(("start+amask would wrap around\n")); > goto out; > } > > @@ -487,8 +487,8 @@ rman_reserve_resource_bound(struct rman > s->r_start, end)); > break; > } > - if (s->r_start + amask < s->r_start) { > - DPRINTF(("s->r_start (%#lx) + amask (%#lx) wrapped\n", > + if (s->r_start > ULONG_MAX - amask) { > + DPRINTF(("s->r_start (%#lx) + amask (%#lx) too large\n", > s->r_start, amask)); > break; > } > MFC after: 1 week From owner-svn-src-head@FreeBSD.ORG Mon May 12 21:21:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2745573; Mon, 12 May 2014 21:21:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF6482264; Mon, 12 May 2014 21:21:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4CLLWo2063137; Mon, 12 May 2014 21:21:32 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CLLWxT063136; Mon, 12 May 2014 21:21:32 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201405122121.s4CLLWxT063136@svn.freebsd.org> From: Julio Merino Date: Mon, 12 May 2014 21:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265933 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 21:21:32 -0000 Author: jmmv Date: Mon May 12 21:21:32 2014 New Revision: 265933 URL: http://svnweb.freebsd.org/changeset/base/265933 Log: Fix delete-old when WITH_TESTS is set. r265423 removed the WITHOUT_BMAKE option, which in turn broke a conditional in OptionalObsoleteFiles.inc that inspected MK_BMAKE. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon May 12 20:48:04 2014 (r265932) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon May 12 21:21:32 2014 (r265933) @@ -4129,7 +4129,7 @@ OLD_FILES+=usr/tests/lib/atf/libatf-c/pr OLD_FILES+=usr/tests/lib/atf/libatf-c/sanity_test OLD_FILES+=usr/tests/lib/atf/libatf-c/text_test OLD_FILES+=usr/tests/lib/atf/libatf-c/user_test -.if ${MK_MAKE} == yes && ${MK_BMAKE} == yes +.if ${MK_MAKE} == yes OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/legacy_test OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/Kyuafile OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/Makefile.test From owner-svn-src-head@FreeBSD.ORG Mon May 12 23:35:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD87FF72; Mon, 12 May 2014 23:35:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB1B52266; Mon, 12 May 2014 23:35:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4CNZAtW021810; Mon, 12 May 2014 23:35:10 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4CNZAUm021809; Mon, 12 May 2014 23:35:10 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405122335.s4CNZAUm021809@svn.freebsd.org> From: Neel Natu Date: Mon, 12 May 2014 23:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265941 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 23:35:10 -0000 Author: neel Date: Mon May 12 23:35:10 2014 New Revision: 265941 URL: http://svnweb.freebsd.org/changeset/base/265941 Log: abort(3) the process in response to a VMEXIT_ABORT. This usually happens in response to an unhandled VM exit or an unexpected error so a core is useful. Remove unused macro VMEXIT_SWITCH. Reviewed by: grehan Modified: head/usr.sbin/bhyve/bhyverun.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Mon May 12 22:33:22 2014 (r265940) +++ head/usr.sbin/bhyve/bhyverun.c Mon May 12 23:35:10 2014 (r265941) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #define GUEST_NIO_PORT 0x488 /* guest upcalls via i/o port */ -#define VMEXIT_SWITCH 0 /* force vcpu switch in mux mode */ #define VMEXIT_CONTINUE 1 /* continue from next instruction */ #define VMEXIT_RESTART 2 /* restart current instruction */ #define VMEXIT_ABORT 3 /* abort the vm run loop */ @@ -272,12 +271,6 @@ fbsdrun_deletecpu(struct vmctx *ctx, int } static int -vmexit_catch_inout(void) -{ - return (VMEXIT_ABORT); -} - -static int vmexit_handle_notify(struct vmctx *ctx, struct vm_exit *vme, int *pvcpu, uint32_t eax) { @@ -330,7 +323,7 @@ vmexit_inout(struct vmctx *ctx, struct v fprintf(stderr, "Unhandled %s%c 0x%04x\n", in ? "in" : "out", bytes == 1 ? 'b' : (bytes == 2 ? 'w' : 'l'), port); - return (vmexit_catch_inout()); + return (VMEXIT_ABORT); } } @@ -575,6 +568,8 @@ vm_loop(struct vmctx *ctx, int vcpu, uin assert(error == 0 || errno == EALREADY); rip = vmexit[vcpu].rip + vmexit[vcpu].inst_length; break; + case VMEXIT_ABORT: + abort(); default: exit(1); } From owner-svn-src-head@FreeBSD.ORG Tue May 13 05:07:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D36A5AB; Tue, 13 May 2014 05:07:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A9BC2B50; Tue, 13 May 2014 05:07:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4D57339067000; Tue, 13 May 2014 05:07:03 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4D573Qf066999; Tue, 13 May 2014 05:07:03 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201405130507.s4D573Qf066999@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 13 May 2014 05:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265942 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 05:07:03 -0000 Author: yongari Date: Tue May 13 05:07:03 2014 New Revision: 265942 URL: http://svnweb.freebsd.org/changeset/base/265942 Log: Fix checksum computation. Previously it didn't include carry. Reviewed by: tuexen Modified: head/sys/netinet/ip_input.c Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Mon May 12 23:35:10 2014 (r265941) +++ head/sys/netinet/ip_input.c Tue May 13 05:07:03 2014 (r265942) @@ -1080,8 +1080,9 @@ found: * (and not in for{} loop), though it implies we are not going to * reassemble more than 64k fragments. */ - m->m_pkthdr.csum_data = - (m->m_pkthdr.csum_data & 0xffff) + (m->m_pkthdr.csum_data >> 16); + while (m->m_pkthdr.csum_data & 0xffff0000) + m->m_pkthdr.csum_data = (m->m_pkthdr.csum_data & 0xffff) + + (m->m_pkthdr.csum_data >> 16); #ifdef MAC mac_ipq_reassemble(fp, m); mac_ipq_destroy(fp); From owner-svn-src-head@FreeBSD.ORG Tue May 13 05:19:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99C02888; Tue, 13 May 2014 05:19:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D5E82C25; Tue, 13 May 2014 05:19:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4D5JUEX071839; Tue, 13 May 2014 05:19:30 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4D5JUBi071838; Tue, 13 May 2014 05:19:30 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201405130519.s4D5JUBi071838@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 13 May 2014 05:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265943 - head/sys/dev/re X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 05:19:30 -0000 Author: yongari Date: Tue May 13 05:19:29 2014 New Revision: 265943 URL: http://svnweb.freebsd.org/changeset/base/265943 Log: Disable TX IP/TCP/UDP checksum offloading for RTL8168C/RTL8168CP. Previously only TX IP checksum offloading was disabled but it's reported that TX checksum offloading for UDP datagrams with IP options also generates corrupted frames. Reporter's controller is RTL8168CP but I guess RTL8168C also have the same issue since it shall share the same core. Reported and tested by: tuexen Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue May 13 05:07:03 2014 (r265942) +++ head/sys/dev/re/if_re.c Tue May 13 05:19:29 2014 (r265943) @@ -1619,16 +1619,18 @@ re_attach(device_t dev) ifp->if_start = re_start; /* * RTL8168/8111C generates wrong IP checksummed frame if the - * packet has IP options so disable TX IP checksum offloading. + * packet has IP options so disable TX checksum offloading. */ if (sc->rl_hwrev->rl_rev == RL_HWREV_8168C || sc->rl_hwrev->rl_rev == RL_HWREV_8168C_SPIN2 || - sc->rl_hwrev->rl_rev == RL_HWREV_8168CP) - ifp->if_hwassist = CSUM_TCP | CSUM_UDP; - else + sc->rl_hwrev->rl_rev == RL_HWREV_8168CP) { + ifp->if_hwassist = 0; + ifp->if_capabilities = IFCAP_RXCSUM | IFCAP_TSO4; + } else { ifp->if_hwassist = CSUM_IP | CSUM_TCP | CSUM_UDP; + ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_TSO4; + } ifp->if_hwassist |= CSUM_TSO; - ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_TSO4; ifp->if_capenable = ifp->if_capabilities; ifp->if_init = re_init; IFQ_SET_MAXLEN(&ifp->if_snd, RL_IFQ_MAXLEN); @@ -3364,7 +3366,6 @@ re_ioctl(struct ifnet *ifp, u_long comma struct rl_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; struct mii_data *mii; - uint32_t rev; int error = 0; switch (command) { @@ -3453,15 +3454,9 @@ re_ioctl(struct ifnet *ifp, u_long comma if ((mask & IFCAP_TXCSUM) != 0 && (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { ifp->if_capenable ^= IFCAP_TXCSUM; - if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) { - rev = sc->rl_hwrev->rl_rev; - if (rev == RL_HWREV_8168C || - rev == RL_HWREV_8168C_SPIN2 || - rev == RL_HWREV_8168CP) - ifp->if_hwassist |= CSUM_TCP | CSUM_UDP; - else - ifp->if_hwassist |= RE_CSUM_FEATURES; - } else + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) + ifp->if_hwassist |= RE_CSUM_FEATURES; + else ifp->if_hwassist &= ~RE_CSUM_FEATURES; reinit = 1; } From owner-svn-src-head@FreeBSD.ORG Tue May 13 13:20:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D54166FD; Tue, 13 May 2014 13:20:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C287625E3; Tue, 13 May 2014 13:20:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4DDKNAk084153; Tue, 13 May 2014 13:20:23 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DDKNt4084152; Tue, 13 May 2014 13:20:23 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201405131320.s4DDKNt4084152@svn.freebsd.org> From: Alan Cox Date: Tue, 13 May 2014 13:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265948 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 13:20:23 -0000 Author: alc Date: Tue May 13 13:20:23 2014 New Revision: 265948 URL: http://svnweb.freebsd.org/changeset/base/265948 Log: On a fork allow read-only wired pages to be copy-on-write shared between the parent and child processes. Previously, we copied these pages even though they are read only. However, the reason for copying them is historical and no longer exists. In recent times, vm_map_protect() has developed the ability to copy pages when write access is added to wired copy-on-write pages. So, in this case, copy-on-write sharing of wired pages is not to be feared. It is not going to lead to copy-on-write faults on wired memory. Reviewed by: kib MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Tue May 13 06:09:01 2014 (r265947) +++ head/sys/vm/vm_map.c Tue May 13 13:20:23 2014 (r265948) @@ -3024,8 +3024,8 @@ vm_map_copy_entry( if ((dst_entry->eflags|src_entry->eflags) & MAP_ENTRY_IS_SUB_MAP) return; - if (src_entry->wired_count == 0) { - + if (src_entry->wired_count == 0 || + (src_entry->protection & VM_PROT_WRITE) == 0) { /* * If the source entry is marked needs_copy, it is already * write-protected. @@ -3116,9 +3116,9 @@ vm_map_copy_entry( dst_entry->end - dst_entry->start, src_entry->start); } else { /* - * Of course, wired down pages can't be set copy-on-write. - * Cause wired pages to be copied into the new map by - * simulating faults (the new pages are pageable) + * We don't want to make writeable wired pages copy-on-write. + * Immediately copy these pages into the new map by simulating + * page faults. The new pages are pageable. */ vm_fault_copy_entry(dst_map, src_map, dst_entry, src_entry, fork_charge); From owner-svn-src-head@FreeBSD.ORG Tue May 13 13:46:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91E1DBC4; Tue, 13 May 2014 13:46:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DE5727EA; Tue, 13 May 2014 13:46:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4DDkdfs096015; Tue, 13 May 2014 13:46:39 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DDkcqS096010; Tue, 13 May 2014 13:46:38 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405131346.s4DDkcqS096010@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 13 May 2014 13:46:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265949 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 13:46:39 -0000 Author: hselasky Date: Tue May 13 13:46:38 2014 New Revision: 265949 URL: http://svnweb.freebsd.org/changeset/base/265949 Log: - Isochronous transfers should use the alternate next transfer descriptor upon receiving a short packet, in host and device mode. - Correct some comments. Modified: head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/avr32dci.c head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/uss820dci.c Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Tue May 13 13:20:23 2014 (r265948) +++ head/sys/dev/usb/controller/at91dci.c Tue May 13 13:46:38 2014 (r265949) @@ -898,7 +898,8 @@ at91dci_setup_standard_chain(struct usb_ temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; - temp.setup_alt_next = xfer->flags_int.short_frames_ok; + temp.setup_alt_next = xfer->flags_int.short_frames_ok || + xfer->flags_int.isochronous_xfr; temp.did_stall = !xfer->flags_int.control_stall; sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); @@ -1124,7 +1125,8 @@ at91dci_standard_done_sub(struct usb_xfe } /* Check for short transfer */ if (len > 0) { - if (xfer->flags_int.short_frames_ok) { + if (xfer->flags_int.short_frames_ok || + xfer->flags_int.isochronous_xfr) { /* follow alt next */ if (td->alt_next) { td = td->obj_next; Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Tue May 13 13:20:23 2014 (r265948) +++ head/sys/dev/usb/controller/atmegadci.c Tue May 13 13:46:38 2014 (r265949) @@ -804,7 +804,8 @@ atmegadci_setup_standard_chain(struct us temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; - temp.setup_alt_next = xfer->flags_int.short_frames_ok; + temp.setup_alt_next = xfer->flags_int.short_frames_ok || + xfer->flags_int.isochronous_xfr; temp.did_stall = !xfer->flags_int.control_stall; sc = ATMEGA_BUS2SC(xfer->xroot->bus); @@ -1010,7 +1011,8 @@ atmegadci_standard_done_sub(struct usb_x } /* Check for short transfer */ if (len > 0) { - if (xfer->flags_int.short_frames_ok) { + if (xfer->flags_int.short_frames_ok || + xfer->flags_int.isochronous_xfr) { /* follow alt next */ if (td->alt_next) { td = td->obj_next; @@ -1380,9 +1382,9 @@ atmegadci_do_poll(struct usb_bus *bus) } /*------------------------------------------------------------------------* - * at91dci bulk support - * at91dci control support - * at91dci interrupt support + * atmegadci bulk support + * atmegadci control support + * atmegadci interrupt support *------------------------------------------------------------------------*/ static void atmegadci_device_non_isoc_open(struct usb_xfer *xfer) @@ -1419,7 +1421,7 @@ static const struct usb_pipe_methods atm }; /*------------------------------------------------------------------------* - * at91dci full speed isochronous support + * atmegadci full speed isochronous support *------------------------------------------------------------------------*/ static void atmegadci_device_isoc_fs_open(struct usb_xfer *xfer) @@ -1505,7 +1507,7 @@ static const struct usb_pipe_methods atm }; /*------------------------------------------------------------------------* - * at91dci root control support + * atmegadci root control support *------------------------------------------------------------------------* * Simulate a hardware HUB by handling all the necessary requests. *------------------------------------------------------------------------*/ Modified: head/sys/dev/usb/controller/avr32dci.c ============================================================================== --- head/sys/dev/usb/controller/avr32dci.c Tue May 13 13:20:23 2014 (r265948) +++ head/sys/dev/usb/controller/avr32dci.c Tue May 13 13:46:38 2014 (r265949) @@ -771,7 +771,8 @@ avr32dci_setup_standard_chain(struct usb temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; - temp.setup_alt_next = xfer->flags_int.short_frames_ok; + temp.setup_alt_next = xfer->flags_int.short_frames_ok || + xfer->flags_int.isochronous_xfr; temp.did_stall = !xfer->flags_int.control_stall; sc = AVR32_BUS2SC(xfer->xroot->bus); @@ -979,7 +980,8 @@ avr32dci_standard_done_sub(struct usb_xf } /* Check for short transfer */ if (len > 0) { - if (xfer->flags_int.short_frames_ok) { + if (xfer->flags_int.short_frames_ok || + xfer->flags_int.isochronous_xfr) { /* follow alt next */ if (td->alt_next) { td = td->obj_next; @@ -1310,9 +1312,9 @@ avr32dci_do_poll(struct usb_bus *bus) } /*------------------------------------------------------------------------* - * at91dci bulk support - * at91dci control support - * at91dci interrupt support + * avr32dci bulk support + * avr32dci control support + * avr32dci interrupt support *------------------------------------------------------------------------*/ static void avr32dci_device_non_isoc_open(struct usb_xfer *xfer) @@ -1349,7 +1351,7 @@ static const struct usb_pipe_methods avr }; /*------------------------------------------------------------------------* - * at91dci full speed isochronous support + * avr32dci full speed isochronous support *------------------------------------------------------------------------*/ static void avr32dci_device_isoc_fs_open(struct usb_xfer *xfer) @@ -1434,7 +1436,7 @@ static const struct usb_pipe_methods avr }; /*------------------------------------------------------------------------* - * at91dci root control support + * avr32dci root control support *------------------------------------------------------------------------* * Simulate a hardware HUB by handling all the necessary requests. *------------------------------------------------------------------------*/ Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Tue May 13 13:20:23 2014 (r265948) +++ head/sys/dev/usb/controller/musb_otg.c Tue May 13 13:46:38 2014 (r265949) @@ -2403,7 +2403,8 @@ musbotg_setup_standard_chain(struct usb_ temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; - temp.setup_alt_next = xfer->flags_int.short_frames_ok; + temp.setup_alt_next = xfer->flags_int.short_frames_ok || + xfer->flags_int.isochronous_xfr; temp.did_stall = !xfer->flags_int.control_stall; temp.channel = -1; temp.dev_addr = dev_addr; @@ -2714,7 +2715,8 @@ musbotg_standard_done_sub(struct usb_xfe } /* Check for short transfer */ if (len > 0) { - if (xfer->flags_int.short_frames_ok) { + if (xfer->flags_int.short_frames_ok || + xfer->flags_int.isochronous_xfr) { /* follow alt next */ if (td->alt_next) { td = td->obj_next; Modified: head/sys/dev/usb/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci.c Tue May 13 13:20:23 2014 (r265948) +++ head/sys/dev/usb/controller/uss820dci.c Tue May 13 13:46:38 2014 (r265949) @@ -875,7 +875,8 @@ uss820dci_setup_standard_chain(struct us temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; - temp.setup_alt_next = xfer->flags_int.short_frames_ok; + temp.setup_alt_next = xfer->flags_int.short_frames_ok || + xfer->flags_int.isochronous_xfr; temp.did_stall = !xfer->flags_int.control_stall; sc = USS820_DCI_BUS2SC(xfer->xroot->bus); @@ -1120,7 +1121,8 @@ uss820dci_standard_done_sub(struct usb_x } /* Check for short transfer */ if (len > 0) { - if (xfer->flags_int.short_frames_ok) { + if (xfer->flags_int.short_frames_ok || + xfer->flags_int.isochronous_xfr) { /* follow alt next */ if (td->alt_next) { td = td->obj_next; @@ -1543,7 +1545,7 @@ uss820dci_do_poll(struct usb_bus *bus) } /*------------------------------------------------------------------------* - * at91dci bulk support + * uss820dci bulk support *------------------------------------------------------------------------*/ static void uss820dci_device_bulk_open(struct usb_xfer *xfer) @@ -1580,7 +1582,7 @@ static const struct usb_pipe_methods uss }; /*------------------------------------------------------------------------* - * at91dci control support + * uss820dci control support *------------------------------------------------------------------------*/ static void uss820dci_device_ctrl_open(struct usb_xfer *xfer) @@ -1617,7 +1619,7 @@ static const struct usb_pipe_methods uss }; /*------------------------------------------------------------------------* - * at91dci interrupt support + * uss820dci interrupt support *------------------------------------------------------------------------*/ static void uss820dci_device_intr_open(struct usb_xfer *xfer) @@ -1654,7 +1656,7 @@ static const struct usb_pipe_methods uss }; /*------------------------------------------------------------------------* - * at91dci full speed isochronous support + * uss820dci full speed isochronous support *------------------------------------------------------------------------*/ static void uss820dci_device_isoc_fs_open(struct usb_xfer *xfer) @@ -1736,7 +1738,7 @@ static const struct usb_pipe_methods uss }; /*------------------------------------------------------------------------* - * at91dci root control support + * uss820dci root control support *------------------------------------------------------------------------* * Simulate a hardware HUB by handling all the necessary requests. *------------------------------------------------------------------------*/ From owner-svn-src-head@FreeBSD.ORG Tue May 13 15:46:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60285721; Tue, 13 May 2014 15:46:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3F8232F; Tue, 13 May 2014 15:46:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4DFkrJo049749; Tue, 13 May 2014 15:46:53 GMT (envelope-from thomas@svn.freebsd.org) Received: (from thomas@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DFkr5o049748; Tue, 13 May 2014 15:46:53 GMT (envelope-from thomas@svn.freebsd.org) Message-Id: <201405131546.s4DFkr5o049748@svn.freebsd.org> From: Thomas Quinot Date: Tue, 13 May 2014 15:46:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265950 - head/sbin/geom/class/eli X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 15:46:53 -0000 Author: thomas Date: Tue May 13 15:46:52 2014 New Revision: 265950 URL: http://svnweb.freebsd.org/changeset/base/265950 Log: Add mention of metadata version 7 in FreeBSD 10.0 Reviewed by: pjd MFC after: 1 day Modified: head/sbin/geom/class/eli/geli.8 Modified: head/sbin/geom/class/eli/geli.8 ============================================================================== --- head/sbin/geom/class/eli/geli.8 Tue May 13 13:46:38 2014 (r265949) +++ head/sbin/geom/class/eli/geli.8 Tue May 13 15:46:52 2014 (r265950) @@ -1052,6 +1052,8 @@ metadata version supported by the given .It Li 8.2 Ta 5 .Pp .It Li 9.0 Ta 6 +.Pp +.It Li 10.0 Ta 7 .El .Sh AUTHORS .An Pawel Jakub Dawidek Aq pjd@FreeBSD.org From owner-svn-src-head@FreeBSD.ORG Tue May 13 16:40:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A3E98C3; Tue, 13 May 2014 16:40:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3ABE8283F; Tue, 13 May 2014 16:40:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4DGeSph072639; Tue, 13 May 2014 16:40:28 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DGeRKG072635; Tue, 13 May 2014 16:40:27 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405131640.s4DGeRKG072635@svn.freebsd.org> From: Neel Natu Date: Tue, 13 May 2014 16:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265951 - in head: lib/libvmmapi usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 16:40:28 -0000 Author: neel Date: Tue May 13 16:40:27 2014 New Revision: 265951 URL: http://svnweb.freebsd.org/changeset/base/265951 Log: Don't include the guest memory segments in the bhyve(8) process core dump. This has not added a lot of value when debugging bhyve issues while greatly increasing the time and space required to store the core file. Passing the "-C" option to bhyve(8) will change the default and dump guest memory in the core dump. Requested by: grehan Reviewed by: grehan Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/usr.sbin/bhyve/bhyve.8 head/usr.sbin/bhyve/bhyverun.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Tue May 13 15:46:52 2014 (r265950) +++ head/lib/libvmmapi/vmmapi.c Tue May 13 16:40:27 2014 (r265951) @@ -57,6 +57,7 @@ struct vmctx { int fd; uint32_t lowmem_limit; enum vm_mmap_style vms; + int memflags; size_t lowmem; char *lowmem_addr; size_t highmem; @@ -101,6 +102,7 @@ vm_open(const char *name) assert(vm != NULL); vm->fd = -1; + vm->memflags = 0; vm->lowmem_limit = 3 * GB; vm->name = (char *)(vm + 1); strcpy(vm->name, name); @@ -180,10 +182,17 @@ vm_set_lowmem_limit(struct vmctx *ctx, u ctx->lowmem_limit = limit; } +void +vm_set_memflags(struct vmctx *ctx, int flags) +{ + + ctx->memflags = flags; +} + static int setup_memory_segment(struct vmctx *ctx, vm_paddr_t gpa, size_t len, char **addr) { - int error; + int error, mmap_flags; struct vm_memory_segment seg; /* @@ -195,8 +204,11 @@ setup_memory_segment(struct vmctx *ctx, seg.len = len; error = ioctl(ctx->fd, VM_MAP_MEMORY, &seg); if (error == 0 && addr != NULL) { - *addr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, - ctx->fd, gpa); + mmap_flags = MAP_SHARED; + if ((ctx->memflags & VM_MEM_F_INCORE) == 0) + mmap_flags |= MAP_NOCORE; + *addr = mmap(NULL, len, PROT_READ | PROT_WRITE, mmap_flags, + ctx->fd, gpa); } return (error); } Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Tue May 13 15:46:52 2014 (r265950) +++ head/lib/libvmmapi/vmmapi.h Tue May 13 16:40:27 2014 (r265951) @@ -42,6 +42,8 @@ enum vm_mmap_style { VM_MMAP_SPARSE, /* mappings created on-demand */ }; +#define VM_MEM_F_INCORE 0x01 /* include guest memory in core file */ + int vm_create(const char *name); struct vmctx *vm_open(const char *name); void vm_destroy(struct vmctx *ctx); @@ -53,6 +55,7 @@ void *vm_map_gpa(struct vmctx *ctx, vm_p int vm_get_gpa_pmap(struct vmctx *, uint64_t gpa, uint64_t *pte, int *num); uint32_t vm_get_lowmem_limit(struct vmctx *ctx); void vm_set_lowmem_limit(struct vmctx *ctx, uint32_t limit); +void vm_set_memflags(struct vmctx *ctx, int flags); int vm_set_desc(struct vmctx *ctx, int vcpu, int reg, uint64_t base, uint32_t limit, uint32_t access); int vm_get_desc(struct vmctx *ctx, int vcpu, int reg, Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Tue May 13 15:46:52 2014 (r265950) +++ head/usr.sbin/bhyve/bhyve.8 Tue May 13 16:40:27 2014 (r265951) @@ -32,7 +32,7 @@ .Nd "run a guest operating system inside a virtual machine" .Sh SYNOPSIS .Nm -.Op Fl aehwxAHPW +.Op Fl aehwxACHPW .Op Fl c Ar numcpus .Op Fl g Ar gdbport .Op Fl p Ar vcpu:hostcpu @@ -70,6 +70,8 @@ guests. .It Fl c Ar numcpus Number of guest virtual CPUs. The default is 1 and the maximum is 16. +.It Fl C +Include guest memory in core file. .It Fl H Yield the virtual CPU thread when a HLT instruction is detected. If this option is not specified, virtual CPUs will use 100% of a host CPU. Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Tue May 13 15:46:52 2014 (r265950) +++ head/usr.sbin/bhyve/bhyverun.c Tue May 13 16:40:27 2014 (r265951) @@ -134,6 +134,7 @@ usage(int code) " -A: create an ACPI table\n" " -g: gdb port\n" " -c: # cpus (default 1)\n" + " -C: include guest memory in core file\n" " -p: pin 'vcpu' to 'hostcpu'\n" " -H: vmexit from the guest on hlt\n" " -P: vmexit from the guest on pause\n" @@ -642,19 +643,20 @@ int main(int argc, char *argv[]) { int c, error, gdb_port, err, bvmcons; - int max_vcpus, mptgen; + int dump_guest_memory, max_vcpus, mptgen; struct vmctx *ctx; uint64_t rip; size_t memsize; bvmcons = 0; + dump_guest_memory = 0; progname = basename(argv[0]); gdb_port = 0; guest_ncpus = 1; memsize = 256 * MB; mptgen = 1; - while ((c = getopt(argc, argv, "abehwxAHIPWYp:g:c:s:m:l:U:")) != -1) { + while ((c = getopt(argc, argv, "abehwxACHIPWYp:g:c:s:m:l:U:")) != -1) { switch (c) { case 'a': x2apic_mode = 0; @@ -674,6 +676,9 @@ main(int argc, char *argv[]) case 'c': guest_ncpus = atoi(optarg); break; + case 'C': + dump_guest_memory = 1; + break; case 'g': gdb_port = atoi(optarg); break; @@ -755,6 +760,8 @@ main(int argc, char *argv[]) fbsdrun_set_capabilities(ctx, BSP); + if (dump_guest_memory) + vm_set_memflags(ctx, VM_MEM_F_INCORE); err = vm_setup_memory(ctx, memsize, VM_MMAP_ALL); if (err) { fprintf(stderr, "Unable to setup memory (%d)\n", err); From owner-svn-src-head@FreeBSD.ORG Tue May 13 21:24:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 474DAF9B; Tue, 13 May 2014 21:24:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34E6E203D; Tue, 13 May 2014 21:24:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4DLOu6H004217; Tue, 13 May 2014 21:24:56 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DLOuMt004216; Tue, 13 May 2014 21:24:56 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201405132124.s4DLOuMt004216@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 13 May 2014 21:24:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265977 - head/usr.bin/printf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 21:24:56 -0000 Author: jilles Date: Tue May 13 21:24:55 2014 New Revision: 265977 URL: http://svnweb.freebsd.org/changeset/base/265977 Log: printf: Fix missing arguments for %u/%o/%x/%X after r265592. If a numeric argument is missing, zero should be assumed, for signed as well as unsigned conversions. This fixes the 'zero' regression tests. r265592 erroneously reverted r244407. Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Tue May 13 21:23:49 2014 (r265976) +++ head/usr.bin/printf/printf.c Tue May 13 21:24:55 2014 (r265977) @@ -575,7 +575,7 @@ getnum(intmax_t *ip, uintmax_t *uip, int int rval; if (!*gargv) { - *ip = 0; + *ip = *uip = 0; return (0); } if (**gargv == '"' || **gargv == '\'') { From owner-svn-src-head@FreeBSD.ORG Tue May 13 21:26:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64E35252; Tue, 13 May 2014 21:26:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45D59204B; Tue, 13 May 2014 21:26:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4DLQ0wI004552; Tue, 13 May 2014 21:26:00 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DLPxXr004546; Tue, 13 May 2014 21:25:59 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201405132125.s4DLPxXr004546@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 13 May 2014 21:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265978 - head/contrib/tzdata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 21:26:00 -0000 Author: edwin Date: Tue May 13 21:25:59 2014 New Revision: 265978 URL: http://svnweb.freebsd.org/changeset/base/265978 Log: MFV of 265975, tzdata2014c - Egypt will go into DST on 15 May 2014 Modified: head/contrib/tzdata/africa head/contrib/tzdata/asia head/contrib/tzdata/europe Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/africa ============================================================================== --- head/contrib/tzdata/africa Tue May 13 21:24:55 2014 (r265977) +++ head/contrib/tzdata/africa Tue May 13 21:25:59 2014 (r265978) @@ -335,11 +335,54 @@ Rule Egypt 2007 only - Sep Thu>=1 23:00s # http://www.worldtimezone.com/dst_news/dst_news_egypt02.html # +# From Ahmad El-Dardiry (2014-05-07): +# Egypt is to change back to Daylight system on May 15 +# http://english.ahram.org.eg/NewsContent/1/64/100735/Egypt/Politics-/Egypts-government-to-reapply-daylight-saving-time-.aspx + +# From Gunther Vermier (2015-05-13): +# our Egypt office confirms that the change will be at 15 May "midnight" (24:00) + +# From Paul Eggert (2014-05-13): +# Sarah El Deeb and Lee Keath of AP report that the Egyptian government says +# the change is because of blackouts in Cairo, even though Ahram Online (cited +# above) says DST had no affect on electricity consumption. The AP story says +# DST will not be observed during Ramadan. There is no information about when +# DST will end. See: +# http://abcnews.go.com/International/wireStory/el-sissi-pushes-egyptians-line-23614833 +# +# For now, guess that later transitions will use 2010's rules, and that +# Egypt will agree with Morocco (see below) about the date Ramadan starts and +# ends, though (unlike Morocco) it will switch at 00:00 standard time. In +# Egypt the spring-forward transitions are removed for 2020-2022, when the +# guessed spring-forward date falls during the estimated Ramadan, and all +# transitions removed for 2023-2038, where the estimated Ramadan falls entirely +# outside the guessed daylight-saving time. Ramadan intrudes on the guessed +# DST starting in 2039, but that's beyond our somewhat-arbitrary cutoff. + Rule Egypt 2008 only - Aug lastThu 23:00s 0 - Rule Egypt 2009 only - Aug 20 23:00s 0 - Rule Egypt 2010 only - Aug 11 0:00 0 - Rule Egypt 2010 only - Sep 10 0:00 1:00 S Rule Egypt 2010 only - Sep lastThu 23:00s 0 - +Rule Egypt 2014 only - May 15 24:00 1:00 S +Rule Egypt 2014 only - Jun 29 0:00s 0 - +Rule Egypt 2014 only - Jul 29 0:00s 1:00 S +Rule Egypt 2014 max - Sep lastThu 23:00s 0 - +Rule Egypt 2015 2019 - Apr lastFri 0:00s 1:00 S +Rule Egypt 2015 only - Jun 18 0:00s 0 - +Rule Egypt 2015 only - Jul 18 0:00s 1:00 S +Rule Egypt 2016 only - Jun 7 0:00s 0 - +Rule Egypt 2016 only - Jul 7 0:00s 1:00 S +Rule Egypt 2017 only - May 27 0:00s 0 - +Rule Egypt 2017 only - Jun 26 0:00s 1:00 S +Rule Egypt 2018 only - May 16 0:00s 0 - +Rule Egypt 2018 only - Jun 15 0:00s 1:00 S +Rule Egypt 2019 only - May 6 0:00s 0 - +Rule Egypt 2019 only - Jun 5 0:00s 1:00 S +Rule Egypt 2020 only - May 24 0:00s 1:00 S +Rule Egypt 2021 only - May 13 0:00s 1:00 S +Rule Egypt 2022 only - May 3 0:00s 1:00 S +Rule Egypt 2023 max - Apr lastFri 0:00s 1:00 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Cairo 2:05:09 - LMT 1900 Oct Modified: head/contrib/tzdata/asia ============================================================================== --- head/contrib/tzdata/asia Tue May 13 21:24:55 2014 (r265977) +++ head/contrib/tzdata/asia Tue May 13 21:25:59 2014 (r265978) @@ -1347,22 +1347,6 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 3 # "Jordan will switch to winter time on Friday, October 27". # -# From Phil Pizzey (2009-04-02): -# ...I think I may have spotted an error in the timezone data for -# Jordan. -# The current (2009d) asia file shows Jordan going to daylight -# saving -# time on the last Thursday in March. -# -# Rule Jordan 2000 max - Mar lastThu 0:00s 1:00 S -# -# However timeanddate.com, which I usually find reliable, shows Jordan -# going to daylight saving time on the last Friday in March since 2002. -# Please see -# -# http://www.timeanddate.com/worldclock/timezone.html?n=11 -# - # From Steffen Thorsen (2009-04-02): # This single one might be good enough, (2009-03-24, Arabic): # Modified: head/contrib/tzdata/europe ============================================================================== --- head/contrib/tzdata/europe Tue May 13 21:24:55 2014 (r265977) +++ head/contrib/tzdata/europe Tue May 13 21:25:59 2014 (r265978) @@ -2966,6 +2966,10 @@ Zone Europe/Simferopol 2:16:24 - LMT 188 # From Alexander Krivenyshev (2014-03-17): # time change at 2:00 (2am) on March 30, 2014 # http://vz.ru/news/2014/3/17/677464.html +# From Paul Eggert (2014-03-30): +# Simferopol and Sevastopol reportedly changed their central town clocks +# late the previous day, but this appears to have been ceremonial +# and the discrepancies are small enough to not worry about. 2:00 EU EE%sT 2014 Mar 30 2:00 4:00 - MSK From owner-svn-src-head@FreeBSD.ORG Tue May 13 23:17:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 290EA465; Tue, 13 May 2014 23:17:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16B59292E; Tue, 13 May 2014 23:17:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4DNHOPm054729; Tue, 13 May 2014 23:17:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4DNHOg9054728; Tue, 13 May 2014 23:17:24 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405132317.s4DNHOg9054728@svn.freebsd.org> From: Xin LI Date: Tue, 13 May 2014 23:17:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265985 - head/crypto/openssl/ssl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2014 23:17:25 -0000 Author: delphij Date: Tue May 13 23:17:24 2014 New Revision: 265985 URL: http://svnweb.freebsd.org/changeset/base/265985 Log: Fix OpenSSL NULL pointer deference vulnerability. Obtained from: OpenBSD Security: FreeBSD-SA-14:09.openssl Security: CVE-2014-0198 Modified: head/crypto/openssl/ssl/s3_pkt.c Modified: head/crypto/openssl/ssl/s3_pkt.c ============================================================================== --- head/crypto/openssl/ssl/s3_pkt.c Tue May 13 22:43:02 2014 (r265984) +++ head/crypto/openssl/ssl/s3_pkt.c Tue May 13 23:17:24 2014 (r265985) @@ -657,6 +657,10 @@ static int do_ssl3_write(SSL *s, int typ if (i <= 0) return(i); /* if it went, fall through and send more stuff */ + /* we may have released our buffer, so get it again */ + if (wb->buf == NULL) + if (!ssl3_setup_write_buffer(s)) + return -1; } if (len == 0 && !create_empty_fragment) From owner-svn-src-head@FreeBSD.ORG Wed May 14 00:50:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D6F39CC; Wed, 14 May 2014 00:50:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AC242248; Wed, 14 May 2014 00:50:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4E0oVet000452; Wed, 14 May 2014 00:50:31 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4E0oVP3000451; Wed, 14 May 2014 00:50:31 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405140050.s4E0oVP3000451@svn.freebsd.org> From: Xin LI Date: Wed, 14 May 2014 00:50:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r265995 - head/secure/lib/libcrypt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 00:50:32 -0000 Author: delphij Date: Wed May 14 00:50:31 2014 New Revision: 265995 URL: http://svnweb.freebsd.org/changeset/base/265995 Log: Switch using the new $2b$ format by default, when bcrypt is used. MFC after: 2 weeks Relnotes: default Blowfish crypt(3) format have been changed to $2b$. Modified: head/secure/lib/libcrypt/crypt-blowfish.c Modified: head/secure/lib/libcrypt/crypt-blowfish.c ============================================================================== --- head/secure/lib/libcrypt/crypt-blowfish.c Wed May 14 00:39:54 2014 (r265994) +++ head/secure/lib/libcrypt/crypt-blowfish.c Wed May 14 00:50:31 2014 (r265995) @@ -149,7 +149,7 @@ crypt_blowfish(const char *key, const ch char arounds[3]; /* Defaults */ - minr = 'a'; + minr = 'b'; logr = BCRYPT_MINLOGROUNDS; rounds = 1U << logr; From owner-svn-src-head@FreeBSD.ORG Wed May 14 07:33:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8E521D4; Wed, 14 May 2014 07:33:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95F342376; Wed, 14 May 2014 07:33:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4E7X6oQ080639; Wed, 14 May 2014 07:33:06 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4E7X6Ux080638; Wed, 14 May 2014 07:33:06 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405140733.s4E7X6Ux080638@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 14 May 2014 07:33:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266006 - head/sys/modules/sound/driver/uaudio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 07:33:06 -0000 Author: hselasky Date: Wed May 14 07:33:06 2014 New Revision: 266006 URL: http://svnweb.freebsd.org/changeset/base/266006 Log: Change the USB audio kernel module linking order, so that the USB audio device driver is detached first and not its children. This fixes a panic in some cases when unloading "snd_uaudio" while a USB device is plugged. The linking order affects the order in which the module dependencies are registered. MFC after: 1 week Modified: head/sys/modules/sound/driver/uaudio/Makefile Modified: head/sys/modules/sound/driver/uaudio/Makefile ============================================================================== --- head/sys/modules/sound/driver/uaudio/Makefile Wed May 14 04:57:55 2014 (r266005) +++ head/sys/modules/sound/driver/uaudio/Makefile Wed May 14 07:33:06 2014 (r266006) @@ -7,6 +7,6 @@ S= ${.CURDIR}/../../../.. KMOD= snd_uaudio SRCS= bus_if.h device_if.h usb_if.h vnode_if.h SRCS+= opt_usb.h opt_bus.h feeder_if.h channel_if.h usbdevs.h -SRCS+= uaudio.c uaudio_pcm.c +SRCS+= uaudio_pcm.c uaudio.c .include From owner-svn-src-head@FreeBSD.ORG Wed May 14 08:38:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44216BE6; Wed, 14 May 2014 08:38:11 +0000 (UTC) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CC62C2846; Wed, 14 May 2014 08:38:10 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.8/8.14.8/ALCHEMY.FRANKEN.DE) with ESMTP id s4E8c1Rn029991 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 14 May 2014 10:38:01 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.8/8.14.8/Submit) id s4E8c1K8029990; Wed, 14 May 2014 10:38:01 +0200 (CEST) (envelope-from marius) Date: Wed, 14 May 2014 10:38:01 +0200 From: Marius Strobl To: Hans Petter Selasky Subject: Re: svn commit: r266006 - head/sys/modules/sound/driver/uaudio Message-ID: <20140514083801.GC679@alchemy.franken.de> References: <201405140733.s4E7X6Ux080638@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201405140733.s4E7X6Ux080638@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (alchemy.franken.de [0.0.0.0]); Wed, 14 May 2014 10:38:02 +0200 (CEST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 08:38:11 -0000 On Wed, May 14, 2014 at 07:33:06AM +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Wed May 14 07:33:06 2014 > New Revision: 266006 > URL: http://svnweb.freebsd.org/changeset/base/266006 > > Log: > Change the USB audio kernel module linking order, so that the USB > audio device driver is detached first and not its children. This fixes > a panic in some cases when unloading "snd_uaudio" while a USB device > is plugged. The linking order affects the order in which the module > dependencies are registered. The right way of specifying that uaudio should be registered last, i. e. after other device drivers employing DRIVER_MODULE(), would be using: DRIVER_MODULE_ORDER(uaudio, uhub, uaudio_driver, uaudio_devclass, NULL, NULL, SI_ORDER_ANY); instead of the existing DRIVER_MODULE() in uaudio.c. Marius From owner-svn-src-head@FreeBSD.ORG Wed May 14 09:03:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA92D188; Wed, 14 May 2014 09:03:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7FC22A7D; Wed, 14 May 2014 09:03:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4E933DQ020288; Wed, 14 May 2014 09:03:03 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4E933lB020287; Wed, 14 May 2014 09:03:03 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405140903.s4E933lB020287@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 14 May 2014 09:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266007 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 09:03:03 -0000 Author: trasz Date: Wed May 14 09:03:02 2014 New Revision: 266007 URL: http://svnweb.freebsd.org/changeset/base/266007 Log: Initialize loginclass mutex using MTX_SYSINIT instead of using SI_SUB_CPU. Suggested by: rwatson@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_loginclass.c Modified: head/sys/kern/kern_loginclass.c ============================================================================== --- head/sys/kern/kern_loginclass.c Wed May 14 07:33:06 2014 (r266006) +++ head/sys/kern/kern_loginclass.c Wed May 14 09:03:02 2014 (r266007) @@ -69,9 +69,7 @@ LIST_HEAD(, loginclass) loginclasses; * Lock protecting loginclasses list. */ static struct mtx loginclasses_lock; - -static void lc_init(void); -SYSINIT(loginclass, SI_SUB_CPU, SI_ORDER_FIRST, lc_init, NULL); +MTX_SYSINIT(loginclasses_init, &loginclasses_lock, "loginclasses lock", MTX_DEF); void loginclass_hold(struct loginclass *lc) @@ -229,10 +227,3 @@ loginclass_racct_foreach(void (*callback (callback)(lc->lc_racct, arg2, arg3); mtx_unlock(&loginclasses_lock); } - -static void -lc_init(void) -{ - - mtx_init(&loginclasses_lock, "loginclasses lock", NULL, MTX_DEF); -} From owner-svn-src-head@FreeBSD.ORG Wed May 14 11:05:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DFB52A7; Wed, 14 May 2014 11:05:17 +0000 (UTC) Received: from mail-ig0-x22d.google.com (mail-ig0-x22d.google.com [IPv6:2607:f8b0:4001:c05::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23C262447; Wed, 14 May 2014 11:05:17 +0000 (UTC) Received: by mail-ig0-f173.google.com with SMTP id hn18so6419530igb.6 for ; Wed, 14 May 2014 04:05:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=f0qsiT3WN01/pNBht8aTtJOtJNX9T8kahCgW8cQG6s4=; b=Ki5KKiIb78T1I4ZKDNCHUKDY7ZoudFrKKz35GDVercpdruxEk6NrUlAIrXizFw2+0+ Omhzkuc+fgssOVBPeWkneSie0BbunPTPGenxneguSKpv3QMtcmG3Z3/kpPt/bnf8SNFk UwxRzpu5+At5+tse5HkNMIlHeVZQvtfuKZR1SNVRGuRRiME3CVP5DkNtWYIQIXgTGpFZ oZLbiOsPT7gzW9ft6vBubOT33lesW39GBCcbyUlsrfEW1e/HhD2lRpLlu5t/YOLfILzC 0PY3Dw3jS9YxopmH5qGlGBTfWXgTDlPdRxnjo0cX4U0voLNxgiOUwiAIr73OzR0V9ROV DWCA== MIME-Version: 1.0 X-Received: by 10.42.106.15 with SMTP id x15mr2424054ico.67.1400065516597; Wed, 14 May 2014 04:05:16 -0700 (PDT) Received: by 10.64.12.170 with HTTP; Wed, 14 May 2014 04:05:16 -0700 (PDT) In-Reply-To: <201405051150.s45BoqID055514@svn.freebsd.org> References: <201405051150.s45BoqID055514@svn.freebsd.org> Date: Wed, 14 May 2014 19:05:16 +0800 Message-ID: Subject: Re: svn commit: r265358 - head/sys/dev/usb/controller From: Ganbold Tsagaankhuu To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 11:05:17 -0000 Hans On Mon, May 5, 2014 at 7:50 PM, Hans Petter Selasky wrote: > Author: hselasky > Date: Mon May 5 11:50:52 2014 > New Revision: 265358 > URL: http://svnweb.freebsd.org/changeset/base/265358 > > Log: > Improve DWC OTG USB host side support for isochronous FULL and HIGH > speed data traffic going directly to a USB device or through a > so-called USB transaction translator. > > Add checks that we are not overusing the TX FIFO. > > MFC after: 2 weeks > > Modified: > head/sys/dev/usb/controller/dwc_otg.c > head/sys/dev/usb/controller/dwc_otg.h > head/sys/dev/usb/controller/dwc_otgreg.h > > Modified: head/sys/dev/usb/controller/dwc_otg.c > > ============================================================================== > --- head/sys/dev/usb/controller/dwc_otg.c Mon May 5 11:30:45 2014 > (r265357) > +++ head/sys/dev/usb/controller/dwc_otg.c Mon May 5 11:50:52 2014 > (r265358) > @@ -207,6 +207,12 @@ dwc_otg_init_fifo(struct dwc_otg_softc * > /* reset active endpoints */ > sc->sc_active_rx_ep = 0; > > + /* reset TX size */ > + sc->sc_tx_cur_size = 0; > + > + /* reset TT info */ > + memset(sc->sc_tt_info, 0, sizeof(sc->sc_tt_info)); > + > fifo_size /= 2; > > DWC_OTG_WRITE_4(sc, DOTG_GNPTXFSIZ, > @@ -215,19 +221,17 @@ dwc_otg_init_fifo(struct dwc_otg_softc * > > tx_start += fifo_size; > > + for (x = 0; x != sc->sc_host_ch_max; x++) { > + /* enable all needed interrupts */ > + DWC_OTG_WRITE_4(sc, DOTG_HCINTMSK(x), > HCINT_DEFAULT_MASK); > + } > + > DWC_OTG_WRITE_4(sc, DOTG_HPTXFSIZ, > ((fifo_size / 4) << 16) | > (tx_start / 4)); > > - for (x = 0; x != sc->sc_host_ch_max; x++) { > - /* enable interrupts */ > - DWC_OTG_WRITE_4(sc, DOTG_HCINTMSK(x), > - HCINT_STALL | HCINT_BBLERR | > - HCINT_XACTERR | > - HCINT_NAK | HCINT_ACK | HCINT_NYET | > - HCINT_CHHLTD | HCINT_FRMOVRUN | > - HCINT_DATATGLERR); > - } > + /* store maximum TX FIFO size */ > + sc->sc_tx_max_size = fifo_size; > > /* enable host channel interrupts */ > DWC_OTG_WRITE_4(sc, DOTG_HAINTMSK, > @@ -309,6 +313,12 @@ dwc_otg_init_fifo(struct dwc_otg_softc * > } else { > /* reset active endpoints */ > sc->sc_active_rx_ep = 0; > + > + /* reset TX size */ > + sc->sc_tx_cur_size = 0; > + > + /* reset TT info */ > + memset(sc->sc_tt_info, 0, sizeof(sc->sc_tt_info)); > } > return (0); > } > @@ -376,9 +386,9 @@ dwc_otg_pull_down(struct dwc_otg_softc * > static void > dwc_otg_enable_sof_irq(struct dwc_otg_softc *sc) > { > - if (sc->sc_irq_mask & GINTSTS_SOF) > + if (sc->sc_irq_mask & GINTMSK_SOFMSK) > return; > - sc->sc_irq_mask |= GINTSTS_SOF; > + sc->sc_irq_mask |= GINTMSK_SOFMSK; > DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); > } > > @@ -506,6 +516,7 @@ dwc_otg_clear_hcint(struct dwc_otg_softc > { > uint32_t hcint; > > + /* clear all pending interrupts */ > hcint = DWC_OTG_READ_4(sc, DOTG_HCINT(x)); > DWC_OTG_WRITE_4(sc, DOTG_HCINT(x), hcint); > > @@ -513,6 +524,10 @@ dwc_otg_clear_hcint(struct dwc_otg_softc > sc->sc_chan_state[x].hcint = 0; > } > > +/* > + * This function waits until a DWC OTG host channel is ready to be > + * used again: > + */ > static uint8_t > dwc_otg_host_channel_wait(struct dwc_otg_td *td) > { > @@ -545,6 +560,9 @@ dwc_otg_host_channel_wait(struct dwc_otg > sc->sc_chan_state[td->channel].allocated = 0; > sc->sc_chan_state[x].allocated = 1; > > + sc->sc_chan_state[x].tx_size = > + sc->sc_chan_state[td->channel].tx_size; > + > if (sc->sc_chan_state[td->channel].suspended) { > sc->sc_chan_state[td->channel].suspended = 0; > sc->sc_chan_state[x].suspended = 1; > @@ -579,6 +597,7 @@ static uint8_t > dwc_otg_host_channel_alloc(struct dwc_otg_td *td) > { > struct dwc_otg_softc *sc; > + uint32_t tx_size; > uint8_t x; > uint8_t max_channel; > > @@ -591,9 +610,25 @@ dwc_otg_host_channel_alloc(struct dwc_ot > if ((td->hcchar & HCCHAR_EPNUM_MASK) == 0) { > max_channel = 1; > x = 0; > + tx_size = td->max_packet_size; > + if ((sc->sc_tx_cur_size + tx_size) > sc->sc_tx_max_size) { > + DPRINTF("Too little FIFO space\n"); > + return (1); /* too little FIFO */ > + } > } else { > max_channel = sc->sc_host_ch_max; > x = 1; > + if ((td->hcchar & HCCHAR_EPDIR) == HCCHAR_EPDIR_OUT) { > + tx_size = td->max_packet_size; > + if (td->hcsplt != 0 && tx_size > > HCSPLT_XACTLEN_MAX) > + tx_size = HCSPLT_XACTLEN_MAX; > + if ((sc->sc_tx_cur_size + tx_size) > > sc->sc_tx_max_size) { > + DPRINTF("Too little FIFO space\n"); > + return (1); /* too little FIFO */ > + } > + } else { > + tx_size = 0; > + } > } > > for (; x != max_channel; x++) { > @@ -604,6 +639,10 @@ dwc_otg_host_channel_alloc(struct dwc_ot > continue; > > sc->sc_chan_state[x].allocated = 1; > + sc->sc_chan_state[x].tx_size = tx_size; > + > + /* keep track of used FIFO */ > + sc->sc_tx_cur_size += tx_size; > > /* clear interrupts */ > dwc_otg_clear_hcint(sc, x); > @@ -663,6 +702,9 @@ dwc_otg_host_channel_free(struct dwc_otg > sc->sc_chan_state[x].allocated = 0; > sc->sc_chan_state[x].suspended = 0; > > + /* keep track of used FIFO */ > + sc->sc_tx_cur_size -= sc->sc_chan_state[x].tx_size; > + > /* ack any pending messages */ > if (sc->sc_last_rx_status != 0 && > GRXSTSRD_CHNUM_GET(sc->sc_last_rx_status) == x) { > @@ -724,6 +766,8 @@ dwc_otg_host_setup_tx(struct dwc_otg_td > > switch (td->state) { > case DWC_CHAN_ST_START: > + if (!dwc_otg_host_channel_wait(td)) > + break; > goto send_pkt; > > case DWC_CHAN_ST_WAIT_ANE: > @@ -731,6 +775,7 @@ dwc_otg_host_setup_tx(struct dwc_otg_td > if (!dwc_otg_host_channel_wait(td)) > break; > td->did_nak = 1; > + td->tt_scheduled = 0; > goto send_pkt; > } > if (hcint & (HCINT_ACK | HCINT_NYET)) { > @@ -739,14 +784,17 @@ dwc_otg_host_setup_tx(struct dwc_otg_td > td->offset += td->tx_bytes; > td->remainder -= td->tx_bytes; > td->toggle = 1; > + td->tt_scheduled = 0; > return (0); /* complete */ > } > break; > + > case DWC_CHAN_ST_WAIT_S_ANE: > if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { > if (!dwc_otg_host_channel_wait(td)) > break; > td->did_nak = 1; > + td->tt_scheduled = 0; > goto send_pkt; > } > if (hcint & (HCINT_ACK | HCINT_NYET)) { > @@ -755,6 +803,7 @@ dwc_otg_host_setup_tx(struct dwc_otg_td > goto send_cpkt; > } > break; > + > case DWC_CHAN_ST_WAIT_C_ANE: > if (hcint & HCINT_NYET) { > if (!dwc_otg_host_channel_wait(td)) > @@ -765,6 +814,7 @@ dwc_otg_host_setup_tx(struct dwc_otg_td > if (!dwc_otg_host_channel_wait(td)) > break; > td->did_nak = 1; > + td->tt_scheduled = 0; > goto send_pkt; > } > if (hcint & HCINT_ACK) { > @@ -776,8 +826,12 @@ dwc_otg_host_setup_tx(struct dwc_otg_td > return (0); /* complete */ > } > break; > - case DWC_CHAN_ST_TX_PKT_SYNC: > - goto send_pkt_sync; > + > + case DWC_CHAN_ST_WAIT_C_PKT: > + if (!dwc_otg_host_channel_wait(td)) > + break; > + goto send_cpkt; > + > default: > break; > } > @@ -789,19 +843,13 @@ send_pkt: > return (0); /* complete */ > } > > -send_pkt_sync: > if (td->hcsplt != 0) { > - uint32_t count; > - > - count = DWC_OTG_READ_4(sc, DOTG_HFNUM) & 7; > - /* check for not first microframe */ > - if (count != 0) { > - /* enable SOF interrupt */ > - dwc_otg_enable_sof_irq(sc); > - /* set state */ > - td->state = DWC_CHAN_ST_TX_PKT_SYNC; > - dwc_otg_host_channel_free(td); > - return (1); /* busy */ > + /* Wait for our turn, if TT transfer */ > + if (td->tt_scheduled == 0 || > + (sc->sc_last_frame_num & 7) < td->tt_start_slot) { > + /* set return state */ > + td->state = DWC_CHAN_ST_START; > + goto tt_wait; > } > > td->hcsplt &= ~HCSPLT_COMPSPLT; > @@ -835,6 +883,16 @@ send_pkt_sync: > return (1); /* busy */ > > send_cpkt: > + /* Wait for our turn, if TT transfer */ > + if (td->tt_scheduled == 0 || > + (sc->sc_last_frame_num & 7) < td->tt_complete_slot) { > + /* set return state */ > + td->state = DWC_CHAN_ST_WAIT_C_PKT; > + goto tt_wait; > + } > + /* wait until next slot before trying again */ > + td->tt_complete_slot++; > + > td->hcsplt |= HCSPLT_COMPSPLT; > td->state = DWC_CHAN_ST_WAIT_C_ANE; > > @@ -848,7 +906,14 @@ send_cpkt: > > /* must enable channel before writing data to FIFO */ > DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel), hcchar); > + return (1); /* busy */ > > +tt_wait: > + /* enable SOF interrupt */ > + dwc_otg_enable_sof_irq(sc); > + > + /* free allocated channel */ > + dwc_otg_host_channel_free(td); > return (1); /* busy */ > } > > @@ -984,6 +1049,25 @@ not_complete: > } > > static uint8_t > +dwc_otg_host_rate_check_interrupt(struct dwc_otg_softc *sc, struct > dwc_otg_td *td) > +{ > + uint8_t delta; > + > + delta = sc->sc_tmr_val - td->tmr_val; > + if (delta >= 128) > + return (1); /* busy */ > + > + td->tmr_val = sc->sc_tmr_val + td->tmr_res; > + > + /* set toggle, if any */ > + if (td->set_toggle) { > + td->set_toggle = 0; > + td->toggle = 1; > + } > + return (0); > +} > + > +static uint8_t > dwc_otg_host_rate_check(struct dwc_otg_td *td) > { > struct dwc_otg_softc *sc; > @@ -992,31 +1076,30 @@ dwc_otg_host_rate_check(struct dwc_otg_t > /* get pointer to softc */ > sc = DWC_OTG_PC2SC(td->pc); > > + if (td->channel < DWC_OTG_MAX_CHANNELS && > + sc->sc_chan_state[td->channel].suspended) > + goto busy; > + > ep_type = ((td->hcchar & > HCCHAR_EPTYPE_MASK) >> HCCHAR_EPTYPE_SHIFT); > > - if (sc->sc_chan_state[td->channel].suspended) > - goto busy; > - > if (ep_type == UE_ISOCHRONOUS) { > - if (td->tmr_val & 1) > - td->hcchar |= HCCHAR_ODDFRM; > - else > - td->hcchar &= ~HCCHAR_ODDFRM; > - td->tmr_val += td->tmr_res; > - } else if (ep_type == UE_INTERRUPT) { > - uint8_t delta; > > - delta = sc->sc_tmr_val - td->tmr_val; > - if (delta >= 128) > + /* non TT isochronous traffic */ > + if ((td->tmr_val != 0) || > + (sc->sc_last_frame_num & (td->tmr_res - 1))) { > + /* enable SOF interrupt */ > + dwc_otg_enable_sof_irq(sc); > goto busy; > - td->tmr_val = sc->sc_tmr_val + td->tmr_res; > + } > + td->tmr_val = 1; /* executed */ > + td->toggle = 0; > + > + } else if (ep_type == UE_INTERRUPT) { > + /* non TT interrupt traffic */ > + return (dwc_otg_host_rate_check_interrupt(sc, td)); > } else if (td->did_nak != 0) { > goto busy; > - } > - > - if (ep_type == UE_ISOCHRONOUS) { > - td->toggle = 0; > } else if (td->set_toggle) { > td->set_toggle = 0; > td->toggle = 1; > @@ -1065,8 +1148,10 @@ dwc_otg_host_data_rx(struct dwc_otg_td * > DPRINTF("CH=%d ERROR\n", td->channel); > td->errcnt++; > if (td->hcsplt != 0 || td->errcnt >= 3) { > - td->error_any = 1; > - return (0); /* complete */ > + if (ep_type != UE_ISOCHRONOUS) { > + td->error_any = 1; > + return (0); /* complete */ > + } > } > } > > @@ -1103,25 +1188,42 @@ dwc_otg_host_data_rx(struct dwc_otg_td * > break; > } > > - td->toggle ^= 1; > - > /* get the packet byte count */ > count = GRXSTSRD_BCNT_GET(sc->sc_last_rx_status); > > - /* verify the packet byte count */ > - if (count != td->max_packet_size) { > - if (count < td->max_packet_size) { > - /* we have a short packet */ > - td->short_pkt = 1; > - td->got_short = 1; > + /* check for isochronous transfer or high-speed bandwidth > endpoint */ > + if (ep_type == UE_ISOCHRONOUS || td->max_packet_count > 1) > { > + if ((sc->sc_last_rx_status & GRXSTSRD_DPID_MASK) > != GRXSTSRD_DPID_DATA0) { > + td->tt_xactpos = HCSPLT_XACTPOS_MIDDLE; > } else { > - /* invalid USB packet */ > - td->error_any = 1; > + td->tt_xactpos = HCSPLT_XACTPOS_BEGIN; > + > + /* verify the packet byte count */ > + if (count < td->max_packet_size) { > + /* we have a short packet */ > + td->short_pkt = 1; > + td->got_short = 1; > + } > + } > + td->toggle = 0; > + } else { > + /* verify the packet byte count */ > + if (count != td->max_packet_size) { > + if (count < td->max_packet_size) { > + /* we have a short packet */ > + td->short_pkt = 1; > + td->got_short = 1; > + } else { > + /* invalid USB packet */ > + td->error_any = 1; > > - /* release FIFO */ > - dwc_otg_common_rx_ack(sc); > - return (0); /* we are complete */ > + /* release FIFO */ > + dwc_otg_common_rx_ack(sc); > + return (0); /* we are complete > */ > + } > } > + td->toggle ^= 1; > + td->tt_scheduled = 0; > } > > /* verify the packet byte count */ > @@ -1144,7 +1246,6 @@ dwc_otg_host_data_rx(struct dwc_otg_td * > break; > > default: > - DPRINTF("OTHER\n"); > break; > } > /* release FIFO */ > @@ -1153,6 +1254,8 @@ dwc_otg_host_data_rx(struct dwc_otg_td * > check_state: > switch (td->state) { > case DWC_CHAN_ST_START: > + if (!dwc_otg_host_channel_wait(td)) > + break; > if (td->hcsplt != 0) > goto receive_spkt; > else > @@ -1164,6 +1267,7 @@ check_state: > break; > > td->did_nak = 1; > + td->tt_scheduled = 0; > if (td->hcsplt != 0) > goto receive_spkt; > else > @@ -1171,11 +1275,13 @@ check_state: > } > if (!(hcint & HCINT_SOFTWARE_ONLY)) { > if (hcint & HCINT_NYET) { > - if (td->hcsplt != 0) { > - if (!dwc_otg_host_channel_wait(td)) > - break; > - goto receive_pkt; > + if (ep_type == UE_ISOCHRONOUS) { > + /* we missed the service interval > */ > + return (0); /* complete */ > } > + if (!dwc_otg_host_channel_wait(td)) > + break; > + goto receive_pkt; > } > break; > } > @@ -1183,29 +1289,44 @@ check_state: > if (!dwc_otg_host_channel_wait(td)) > break; > > - /* check if we are complete */ > - if ((td->remainder == 0) || (td->got_short != 0)) { > - if (td->short_pkt) > + if (ep_type == UE_ISOCHRONOUS) { > + /* check if we are complete */ > + if ((td->remainder == 0) || > + (td->tt_xactpos == > HCSPLT_XACTPOS_BEGIN)) > return (0); /* complete */ > > - /* > - * Else need to receive a zero length > - * packet. > - */ > - } > - if (td->hcsplt != 0) > - goto receive_spkt; > - else > goto receive_pkt; > + } else { > + /* check if we are complete */ > + if ((td->remainder == 0) || (td->got_short > != 0)) { > + if (td->short_pkt) > + return (0); /* > complete */ > + > + /* > + * Else need to receive a zero > length > + * packet. > + */ > + } > + td->tt_scheduled = 0; > + if (td->hcsplt != 0) > + goto receive_spkt; > + else > + goto receive_pkt; > + } > } > break; > > case DWC_CHAN_ST_WAIT_S_ANE: > + /* > + * NOTE: The DWC OTG hardware provides a fake ACK in > + * case of interrupt and isochronous transfers: > + */ > if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { > if (!dwc_otg_host_channel_wait(td)) > break; > > td->did_nak = 1; > + td->tt_scheduled = 0; > goto receive_spkt; > } > if (hcint & (HCINT_ACK | HCINT_NYET)) { > @@ -1215,100 +1336,91 @@ check_state: > } > break; > > - case DWC_CHAN_ST_RX_PKT: > + case DWC_CHAN_ST_WAIT_C_PKT: > + if (!dwc_otg_host_channel_wait(td)) > + break; > goto receive_pkt; > > - case DWC_CHAN_ST_RX_SPKT: > - goto receive_spkt; > - > - case DWC_CHAN_ST_RX_SPKT_SYNC: > - goto receive_spkt_sync; > - > default: > break; > } > goto busy; > > receive_pkt: > - if (td->hcsplt != 0) { > - count = DWC_OTG_READ_4(sc, DOTG_HFNUM) & 7; > - > - /* check for even microframes */ > - if (count == td->curr_frame) { > - td->state = DWC_CHAN_ST_RX_PKT; > - dwc_otg_host_channel_free(td); > - /* enable SOF interrupt */ > - dwc_otg_enable_sof_irq(sc); > - goto busy; > - } else if (count == 0) { > - /* check for start split timeout */ > - goto receive_spkt; > + if (td->hcsplt != 0) { > + /* Wait for our turn, if TT transfer */ > + if (td->tt_scheduled == 0 || > + (sc->sc_last_frame_num & 7) < td->tt_complete_slot) { > + /* set return state */ > + td->state = DWC_CHAN_ST_WAIT_C_PKT; > + goto tt_wait; > + } > + /* wait until next slot before trying again */ > + td->tt_complete_slot++; > + > + /* set toggle, if any */ > + if (td->set_toggle) { > + td->set_toggle = 0; > + td->toggle = 1; > } > - > - td->curr_frame = count; > td->hcsplt |= HCSPLT_COMPSPLT; > - } else if (dwc_otg_host_rate_check(td)) { > - td->state = DWC_CHAN_ST_RX_PKT; > + count = HCSPLT_XACTLEN_MAX; > + } else if (td->tt_xactpos == HCSPLT_XACTPOS_BEGIN && > + dwc_otg_host_rate_check(td)) { > + td->state = DWC_CHAN_ST_START; > dwc_otg_host_channel_free(td); > goto busy; > + } else { > + count = td->max_packet_size; > } > - > td->state = DWC_CHAN_ST_WAIT_ANE; > > /* receive one packet */ > DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), > - (td->max_packet_size << HCTSIZ_XFERSIZE_SHIFT) | > + (count << HCTSIZ_XFERSIZE_SHIFT) | > (1 << HCTSIZ_PKTCNT_SHIFT) | > (td->toggle ? (HCTSIZ_PID_DATA1 << HCTSIZ_PID_SHIFT) : > (HCTSIZ_PID_DATA0 << HCTSIZ_PID_SHIFT))); > > DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel), td->hcsplt); > > + /* send ASAP */ > + if ((ep_type == UE_ISOCHRONOUS) && !(sc->sc_last_frame_num & 1)) > + td->hcchar |= HCCHAR_ODDFRM; > + else > + td->hcchar &= ~HCCHAR_ODDFRM; > + > hcchar = td->hcchar; > hcchar |= HCCHAR_EPDIR_IN; > > /* must enable channel before data can be received */ > DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel), hcchar); > - > goto busy; > > receive_spkt: > - if (dwc_otg_host_rate_check(td)) { > - td->state = DWC_CHAN_ST_RX_SPKT; > - dwc_otg_host_channel_free(td); > - goto busy; > - } > - > -receive_spkt_sync: > - if (ep_type == UE_INTERRUPT || > - ep_type == UE_ISOCHRONOUS) { > - count = DWC_OTG_READ_4(sc, DOTG_HFNUM) & 7; > - td->curr_frame = count; > - > - /* check for non-zero microframe */ > - if (count != 0) { > - /* enable SOF interrupt */ > - dwc_otg_enable_sof_irq(sc); > - /* set state */ > - td->state = DWC_CHAN_ST_RX_SPKT_SYNC; > - dwc_otg_host_channel_free(td); > - goto busy; > - } > - } else { > - count = DWC_OTG_READ_4(sc, DOTG_HFNUM) & 7; > - td->curr_frame = count; > - > - /* check for two last frames */ > - if (count >= 6) { > - /* enable SOF interrupt */ > - dwc_otg_enable_sof_irq(sc); > - /* set state */ > - td->state = DWC_CHAN_ST_RX_SPKT_SYNC; > + /* Wait for our turn, if TT transfer */ > + if (td->tt_scheduled == 0) { > + if (ep_type == UE_INTERRUPT) { > + td->state = DWC_CHAN_ST_START; > dwc_otg_host_channel_free(td); > goto busy; > } > + /* set return state */ > + td->state = DWC_CHAN_ST_START; > + goto tt_wait; > + } > + if ((sc->sc_last_frame_num & 7) < td->tt_start_slot) { > + /* set return state */ > + td->state = DWC_CHAN_ST_START; > + goto tt_wait; > } > > + /* send ASAP */ > + if ((ep_type == UE_ISOCHRONOUS) && !(sc->sc_last_frame_num & 1)) > + td->hcchar |= HCCHAR_ODDFRM; > + else > + td->hcchar &= ~HCCHAR_ODDFRM; > + > td->hcsplt &= ~HCSPLT_COMPSPLT; > td->state = DWC_CHAN_ST_WAIT_S_ANE; > > @@ -1324,7 +1436,14 @@ receive_spkt_sync: > > /* must enable channel before data can be received */ > DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel), hcchar); > + goto busy; > + > +tt_wait: > + /* enable SOF interrupt */ > + dwc_otg_enable_sof_irq(sc); > > + /* free allocated channel */ > + dwc_otg_host_channel_free(td); > busy: > return (1); /* busy */ > } > @@ -1497,6 +1616,8 @@ dwc_otg_host_data_tx(struct dwc_otg_td * > > switch (td->state) { > case DWC_CHAN_ST_START: > + if (!dwc_otg_host_channel_wait(td)) > + break; > goto send_pkt; > > case DWC_CHAN_ST_WAIT_ANE: > @@ -1504,6 +1625,7 @@ dwc_otg_host_data_tx(struct dwc_otg_td * > if (!dwc_otg_host_channel_wait(td)) > break; > td->did_nak = 1; > + td->tt_scheduled = 0; > goto send_pkt; > } > if (hcint & (HCINT_ACK | HCINT_NYET)) { > @@ -1513,6 +1635,7 @@ dwc_otg_host_data_tx(struct dwc_otg_td * > td->offset += td->tx_bytes; > td->remainder -= td->tx_bytes; > td->toggle ^= 1; > + td->tt_scheduled = 0; > > /* check remainder */ > if (td->remainder == 0) { > @@ -1527,11 +1650,13 @@ dwc_otg_host_data_tx(struct dwc_otg_td * > goto send_pkt; > } > break; > + > case DWC_CHAN_ST_WAIT_S_ANE: > if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { > if (!dwc_otg_host_channel_wait(td)) > break; > td->did_nak = 1; > + td->tt_scheduled = 0; > goto send_pkt; > } > if (hcint & (HCINT_ACK | HCINT_NYET)) { > @@ -1540,6 +1665,7 @@ dwc_otg_host_data_tx(struct dwc_otg_td * > goto send_cpkt; > } > break; > + > case DWC_CHAN_ST_WAIT_C_ANE: > if (hcint & HCINT_NYET) { > if (!dwc_otg_host_channel_wait(td)) > @@ -1550,6 +1676,7 @@ dwc_otg_host_data_tx(struct dwc_otg_td * > if (!dwc_otg_host_channel_wait(td)) > break; > td->did_nak = 1; > + td->tt_scheduled = 0; > goto send_pkt; > } > if (hcint & HCINT_ACK) { > @@ -1558,6 +1685,7 @@ dwc_otg_host_data_tx(struct dwc_otg_td * > td->offset += td->tx_bytes; > td->remainder -= td->tx_bytes; > td->toggle ^= 1; > + td->tt_scheduled = 0; > > /* check remainder */ > if (td->remainder == 0) { > @@ -1570,64 +1698,204 @@ dwc_otg_host_data_tx(struct dwc_otg_td * > } > break; > > - case DWC_CHAN_ST_TX_PKT: > - goto send_pkt; > + case DWC_CHAN_ST_WAIT_C_PKT: > + if (!dwc_otg_host_channel_wait(td)) > + break; > + goto send_cpkt; > > - case DWC_CHAN_ST_TX_PKT_SYNC: > - goto send_pkt_sync; > + case DWC_CHAN_ST_TX_WAIT_ISOC: > > - case DWC_CHAN_ST_TX_CPKT: > - goto send_cpkt; > + /* Check if isochronous OUT traffic is complete */ > + if ((hcint & HCINT_ACK) == 0) > + break; > + > + td->offset += td->tx_bytes; > + td->remainder -= td->tx_bytes; > > + /* Update split token according to specification */ > + if (td->hcsplt != 0) { > + if (td->tt_xactpos == HCSPLT_XACTPOS_BEGIN) > + td->tt_xactpos = HCSPLT_XACTPOS_MIDDLE; > + } else if (td->max_packet_count > 1) { > + td->tt_xactpos++; > + } > + > + dwc_otg_host_channel_disable(sc, td->channel); > + > + if (td->remainder == 0) > + return (0); /* complete */ > + > + td->state = DWC_CHAN_ST_TX_PKT_ISOC; > + > + /* FALLTHROUGH */ > + > + case DWC_CHAN_ST_TX_PKT_ISOC: > + if (!dwc_otg_host_channel_wait(td)) > + break; > + > + if (td->hcsplt != 0) { > + if ((sc->sc_last_frame_num & 7) < > td->tt_start_slot) > + goto tt_wait; > + /* packets must be 125us apart */ > + td->tt_start_slot++; > + } > + goto send_isoc_pkt; > default: > break; > } > goto busy; > > send_pkt: > - if (dwc_otg_host_rate_check(td)) { > - td->state = DWC_CHAN_ST_TX_PKT; > + if (td->hcsplt != 0) { > + /* Wait for our turn, if TT transfer */ > + if (td->tt_scheduled == 0) { > + if (ep_type == UE_INTERRUPT) { > + td->state = DWC_CHAN_ST_START; > + dwc_otg_host_channel_free(td); > + goto busy; > + } > + /* set return state */ > + td->state = DWC_CHAN_ST_START; > + goto tt_wait; > + } > + if ((sc->sc_last_frame_num & 7) < td->tt_start_slot) { > + /* set return state */ > + td->state = DWC_CHAN_ST_START; > + goto tt_wait; > + } > + > + /* packets must be 125us apart */ > + td->tt_start_slot++; > + > + /* set toggle, if any */ > + if (td->set_toggle) { > + td->set_toggle = 0; > + td->toggle = 1; > + } > + } else if (dwc_otg_host_rate_check(td)) { > + td->state = DWC_CHAN_ST_START; > dwc_otg_host_channel_free(td); > goto busy; > } > > -send_pkt_sync: > - if (td->hcsplt != 0) { > - count = DWC_OTG_READ_4(sc, DOTG_HFNUM) & 7; > - /* check for first or last microframe */ > - if (count == 7 || count == 0) { > - /* enable SOF interrupt */ > - dwc_otg_enable_sof_irq(sc); > - /* set state */ > - td->state = DWC_CHAN_ST_TX_PKT_SYNC; > - dwc_otg_host_channel_free(td); > - goto busy; > + if (ep_type == UE_ISOCHRONOUS) { > +send_isoc_pkt: > + /* Isochronous OUT transfers don't have any ACKs */ > + td->state = DWC_CHAN_ST_TX_WAIT_ISOC; > + td->hcsplt &= ~HCSPLT_COMPSPLT; > + if (td->hcsplt != 0) { > + /* get maximum transfer length */ > + count = td->remainder; > + > + /* Update split token according to specification */ > + if (td->tt_xactpos == HCSPLT_XACTPOS_BEGIN) { > + if (count <= HCSPLT_XACTLEN_MAX) > + td->tt_xactpos = > HCSPLT_XACTPOS_ALL; > + else > + count = HCSPLT_XACTLEN_MAX; > + } else if (td->tt_xactpos == > HCSPLT_XACTPOS_MIDDLE) { > + if (count <= HCSPLT_XACTLEN_MAX) > + td->tt_xactpos = > HCSPLT_XACTPOS_LAST; > + else > + count = HCSPLT_XACTLEN_MAX; > + } > + > + /* Update transaction position */ > + td->hcsplt &= ~HCSPLT_XACTPOS_MASK; > + td->hcsplt |= ((uint32_t)td->tt_xactpos << > HCSPLT_XACTPOS_SHIFT); > + } else { > + /* send one packet at a time */ > + count = td->max_packet_size; > + if (td->remainder < count) { > + /* we have a short packet */ > + td->short_pkt = 1; > + count = td->remainder; > + } > } > + } else if (td->hcsplt != 0) { > > td->hcsplt &= ~HCSPLT_COMPSPLT; > + > + /* Wait for ACK/NAK/ERR from TT */ > td->state = DWC_CHAN_ST_WAIT_S_ANE; > + > + /* send one packet at a time */ > + count = td->max_packet_size; > + if (td->remainder < count) { > + /* we have a short packet */ > + td->short_pkt = 1; > + count = td->remainder; > + } > } else { > + /* Wait for ACK/NAK/STALL from device */ > td->state = DWC_CHAN_ST_WAIT_ANE; > - } > > - /* send one packet at a time */ > - count = td->max_packet_size; > - if (td->remainder < count) { > - /* we have a short packet */ > - td->short_pkt = 1; > - count = td->remainder; > + /* send one packet at a time */ > + count = td->max_packet_size; > + if (td->remainder < count) { > + /* we have a short packet */ > + td->short_pkt = 1; > + count = td->remainder; > + } > } > > - /* TODO: HCTSIZ_DOPNG */ > + /* check for High-Speed multi-packets */ > + if ((td->hcsplt == 0) && (td->max_packet_count > 1)) { > + if (td->npkt == 0) { > + if (td->remainder >= (3 * td->max_packet_size)) > + td->npkt = 3; > + else if (td->remainder >= (2 * > td->max_packet_size)) > + td->npkt = 2; > + else > + td->npkt = 1; > > - DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), > - (count << HCTSIZ_XFERSIZE_SHIFT) | > - (1 << HCTSIZ_PKTCNT_SHIFT) | > - (td->toggle ? (HCTSIZ_PID_DATA1 << HCTSIZ_PID_SHIFT) : > - (HCTSIZ_PID_DATA0 << HCTSIZ_PID_SHIFT))); > + if (td->npkt > td->max_packet_count) > + td->npkt = td->max_packet_count; > + > + td->tt_xactpos = 1; /* overload */ > + } > + if (td->tt_xactpos == td->npkt) { > + if (td->npkt == 1) { > + DWC_OTG_WRITE_4(sc, > DOTG_HCTSIZ(td->channel), > + (count << HCTSIZ_XFERSIZE_SHIFT) | > + (1 << HCTSIZ_PKTCNT_SHIFT) | > + (HCTSIZ_PID_DATA0 << > HCTSIZ_PID_SHIFT)); > + } else if (td->npkt == 2) { > + DWC_OTG_WRITE_4(sc, > DOTG_HCTSIZ(td->channel), > + (count << HCTSIZ_XFERSIZE_SHIFT) | > + (1 << HCTSIZ_PKTCNT_SHIFT) | > + (HCTSIZ_PID_DATA1 << > HCTSIZ_PID_SHIFT)); > + } else { > + DWC_OTG_WRITE_4(sc, > DOTG_HCTSIZ(td->channel), > + (count << HCTSIZ_XFERSIZE_SHIFT) | > + (1 << HCTSIZ_PKTCNT_SHIFT) | > + (HCTSIZ_PID_DATA2 << > HCTSIZ_PID_SHIFT)); > + } > + td->npkt = 0; > + } else { > + DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), > + (count << HCTSIZ_XFERSIZE_SHIFT) | > + (1 << HCTSIZ_PKTCNT_SHIFT) | > + (HCTSIZ_PID_MDATA << HCTSIZ_PID_SHIFT)); > + } > + } else { > + /* TODO: HCTSIZ_DOPNG */ > + > + DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), > + (count << HCTSIZ_XFERSIZE_SHIFT) | > + (1 << HCTSIZ_PKTCNT_SHIFT) | > + (td->toggle ? (HCTSIZ_PID_DATA1 << HCTSIZ_PID_SHIFT) : > + (HCTSIZ_PID_DATA0 << HCTSIZ_PID_SHIFT))); > + } > > DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel), td->hcsplt); > > + /* send ASAP */ > + if ((ep_type == UE_ISOCHRONOUS) && !(sc->sc_last_frame_num & 1)) > + td->hcchar |= HCCHAR_ODDFRM; > + else > + td->hcchar &= ~HCCHAR_ODDFRM; > + > hcchar = td->hcchar; > hcchar &= ~HCCHAR_EPDIR_IN; > > @@ -1651,18 +1919,20 @@ send_pkt_sync: > > /* store number of bytes transmitted */ > td->tx_bytes = count; > - > goto busy; > > send_cpkt: > - count = DWC_OTG_READ_4(sc, DOTG_HFNUM) & 7; > - /* check for first microframe */ > - if (count == 0) { > - /* send packet again */ > - goto send_pkt; > + /* Wait for our turn, if TT transfer */ > + if (td->tt_scheduled == 0 || > + (sc->sc_last_frame_num & 7) < td->tt_complete_slot) { > + /* set return state */ > + td->state = DWC_CHAN_ST_WAIT_C_PKT; > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > Somehow some of recent dwc_otg changes make Radxa Rock board unable to find usb flash and mount rootfs. Part of boot log: http://pastebin.com/tprWJapH Now I'm running latest head but no dwc_otg changes (r265357), which works in my case. Ganbold From owner-svn-src-head@FreeBSD.ORG Wed May 14 11:15:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB2594F2; Wed, 14 May 2014 11:15:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 987BC2506; Wed, 14 May 2014 11:15:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4EBFmmZ078809; Wed, 14 May 2014 11:15:48 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EBFmre078808; Wed, 14 May 2014 11:15:48 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405141115.s4EBFmre078808@svn.freebsd.org> From: Aleksandr Rybalko Date: Wed, 14 May 2014 11:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266010 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 11:15:48 -0000 Author: ray Date: Wed May 14 11:15:48 2014 New Revision: 266010 URL: http://svnweb.freebsd.org/changeset/base/266010 Log: Remove extra newlines. No functional changes. Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Wed May 14 09:13:33 2014 (r266009) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Wed May 14 11:15:48 2014 (r266010) @@ -99,7 +99,6 @@ struct bcmsc_softc { struct bcm_fb_config* fb_config; bus_addr_t fb_config_phys; struct intr_config_hook init_hook; - }; static int bcm_fb_probe(device_t); @@ -167,14 +166,10 @@ bcm_fb_init(void *arg) fb_config->xoffset, fb_config->yoffset, fb_config->bpp); - device_printf(sc->dev, "pitch %d, base 0x%08x, screen_size %d\n", fb_config->pitch, fb_config->base, fb_config->screen_size); - - - info = malloc(sizeof(struct fb_info), M_DEVBUF, M_WAITOK | M_ZERO); info->fb_name = device_get_nameunit(sc->dev); @@ -199,8 +194,6 @@ bcm_fb_init(void *arg) device_printf(sc->dev, "Failed to attach fbd device\n"); return; } - - } else { device_printf(sc->dev, "Failed to set framebuffer info\n"); return; @@ -273,7 +266,6 @@ fail: return (ENXIO); } - static void bcm_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err) { From owner-svn-src-head@FreeBSD.ORG Wed May 14 11:26:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F19CA85F; Wed, 14 May 2014 11:25:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF07625CC; Wed, 14 May 2014 11:25:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4EBPx8s083100; Wed, 14 May 2014 11:25:59 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EBPxIG083099; Wed, 14 May 2014 11:25:59 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405141125.s4EBPxIG083099@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 14 May 2014 11:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266011 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 11:26:00 -0000 Author: hselasky Date: Wed May 14 11:25:59 2014 New Revision: 266011 URL: http://svnweb.freebsd.org/changeset/base/266011 Log: Make sure the USB audio driver is loaded last. This is important when built as part of a kernel module to prevent panics when the USB audio driver kernel module is unloaded. Suggested by: marius @ MFC after: 1 week Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Wed May 14 11:15:48 2014 (r266010) +++ head/sys/dev/sound/usb/uaudio.c Wed May 14 11:25:59 2014 (r266011) @@ -5917,7 +5917,7 @@ uaudio_hid_detach(struct uaudio_softc *s usbd_transfer_unsetup(sc->sc_hid.xfer, UAUDIO_HID_N_TRANSFER); } -DRIVER_MODULE(uaudio, uhub, uaudio_driver, uaudio_devclass, NULL, 0); +DRIVER_MODULE_ORDERED(uaudio, uhub, uaudio_driver, uaudio_devclass, NULL, 0, SI_ORDER_ANY); MODULE_DEPEND(uaudio, usb, 1, 1, 1); MODULE_DEPEND(uaudio, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); MODULE_VERSION(uaudio, 1); From owner-svn-src-head@FreeBSD.ORG Wed May 14 11:32:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CBC1A12; Wed, 14 May 2014 11:32:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49C192661; Wed, 14 May 2014 11:32:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4EBWGnE086899; Wed, 14 May 2014 11:32:16 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EBWGeX086898; Wed, 14 May 2014 11:32:16 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405141132.s4EBWGeX086898@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 14 May 2014 11:32:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266012 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 11:32:16 -0000 Author: hselasky Date: Wed May 14 11:32:15 2014 New Revision: 266012 URL: http://svnweb.freebsd.org/changeset/base/266012 Log: Disable configuration of the host frame interval register until further, hence it breaks USB support on some non-RPI platforms. Modified: head/sys/dev/usb/controller/dwc_otg.c Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Wed May 14 11:25:59 2014 (r266011) +++ head/sys/dev/usb/controller/dwc_otg.c Wed May 14 11:32:15 2014 (r266012) @@ -350,6 +350,12 @@ dwc_otg_init_fifo(struct dwc_otg_softc * static void dwc_otg_update_host_frame_interval(struct dwc_otg_softc *sc) { + + /* + * Disabled until further. Assuming that the register is already + * programmed correctly by the boot loader. + */ +#if 0 uint32_t temp; /* setup HOST frame interval register, based on existing value */ @@ -375,6 +381,7 @@ dwc_otg_update_host_frame_interval(struc DPRINTF("HFIR=0x%08x\n", temp); DWC_OTG_WRITE_4(sc, DOTG_HFIR, temp); +#endif } static void From owner-svn-src-head@FreeBSD.ORG Wed May 14 11:36:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6922CC52; Wed, 14 May 2014 11:36:39 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 267AE267C; Wed, 14 May 2014 11:36:38 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id CFAC01FE029; Wed, 14 May 2014 13:36:37 +0200 (CEST) Message-ID: <53735578.8010702@selasky.org> Date: Wed, 14 May 2014 13:37:28 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Ganbold Tsagaankhuu Subject: Re: svn commit: r265358 - head/sys/dev/usb/controller References: <201405051150.s45BoqID055514@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 11:36:39 -0000 Hi, See: http://svnweb.freebsd.org/changeset/base/266012 Sorry, I cannot test all platforms currently because some configuration is specific to each hardware platform. --HPS From owner-svn-src-head@FreeBSD.ORG Wed May 14 14:19:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 038F0993; Wed, 14 May 2014 14:19:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4B4F2449; Wed, 14 May 2014 14:19:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4EEJvGT060851; Wed, 14 May 2014 14:19:57 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EEJvpS060850; Wed, 14 May 2014 14:19:57 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201405141419.s4EEJvpS060850@svn.freebsd.org> From: Ruslan Bukin Date: Wed, 14 May 2014 14:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266021 - head/sys/arm/freescale/vybrid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 14:19:58 -0000 Author: br Date: Wed May 14 14:19:57 2014 New Revision: 266021 URL: http://svnweb.freebsd.org/changeset/base/266021 Log: Fix typo. Modified: head/sys/arm/freescale/vybrid/vf_port.c Modified: head/sys/arm/freescale/vybrid/vf_port.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_port.c Wed May 14 14:17:51 2014 (r266020) +++ head/sys/arm/freescale/vybrid/vf_port.c Wed May 14 14:19:57 2014 (r266021) @@ -165,7 +165,7 @@ port_setup(int pnum, enum ev_type pevt, val = PCR_INT_FE; break; case INT_EITHER_EDGE: - val = PCR_INT_RE; + val = PCR_INT_EE; break; case INT_LOGIC_ONE: val = PCR_INT_LO; From owner-svn-src-head@FreeBSD.ORG Wed May 14 15:31:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FF97E70; Wed, 14 May 2014 15:31:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2162B3C; Wed, 14 May 2014 15:31:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4EFVHja094785; Wed, 14 May 2014 15:31:17 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EFVHA6094784; Wed, 14 May 2014 15:31:17 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405141531.s4EFVHA6094784@svn.freebsd.org> From: Glen Barber Date: Wed, 14 May 2014 15:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266032 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 15:31:17 -0000 Author: gjb Date: Wed May 14 15:31:16 2014 New Revision: 266032 URL: http://svnweb.freebsd.org/changeset/base/266032 Log: Document r265876, power management bug with Intel Turbo Boost. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 14 15:30:49 2014 (r266031) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 14 15:31:16 2014 (r266032) @@ -155,6 +155,11 @@ &man.mrsas.4;. + A kernel bug that inhibited proper + functionality of the dev.cpu.0.freq + &man.sysctl.8; on &intel; processors with Turbo + Boost ™ enabled has been fixed. + Virtualization support From owner-svn-src-head@FreeBSD.ORG Wed May 14 15:31:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FF05EB1; Wed, 14 May 2014 15:31:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0ACB32B3D; Wed, 14 May 2014 15:31:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4EFVIG9094822; Wed, 14 May 2014 15:31:18 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EFVI0i094821; Wed, 14 May 2014 15:31:18 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405141531.s4EFVI0i094821@svn.freebsd.org> From: Glen Barber Date: Wed, 14 May 2014 15:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266033 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 15:31:19 -0000 Author: gjb Date: Wed May 14 15:31:18 2014 New Revision: 266033 URL: http://svnweb.freebsd.org/changeset/base/266033 Log: Document r265995, Blowfish crypt(3) format change. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 14 15:31:16 2014 (r266032) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Wed May 14 15:31:18 2014 (r266033) @@ -311,6 +311,10 @@ to filter by &man.jail.8; ID or name, in followup to the &man.ps.1; change in r265229. + The Blowfish &man.crypt.3; default format + has been changed tox + $2b$. + <filename>/etc/rc.d</filename> Scripts From owner-svn-src-head@FreeBSD.ORG Wed May 14 17:04:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2C2B99; Wed, 14 May 2014 17:04:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0F1423F8; Wed, 14 May 2014 17:04:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4EH42B0038255; Wed, 14 May 2014 17:04:02 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EH420q038253; Wed, 14 May 2014 17:04:02 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405141704.s4EH420q038253@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 14 May 2014 17:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266051 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 17:04:03 -0000 Author: hselasky Date: Wed May 14 17:04:02 2014 New Revision: 266051 URL: http://svnweb.freebsd.org/changeset/base/266051 Log: Implement USB device side driver code for SAF1761 and compatible chips, based on datasheet and existing USS820 DCI driver. This code is not yet tested. Sponsored by: DARPA, AFRL Modified: head/sys/dev/usb/controller/saf1761_dci.c head/sys/dev/usb/controller/saf1761_dci.h head/sys/dev/usb/controller/saf1761_dci_fdt.c head/sys/dev/usb/controller/saf1761_dci_reg.h Modified: head/sys/dev/usb/controller/saf1761_dci.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_dci.c Wed May 14 17:01:35 2014 (r266050) +++ head/sys/dev/usb/controller/saf1761_dci.c Wed May 14 17:04:02 2014 (r266051) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2014 Hans Petter Selasky + * Copyright (c) 2014 Hans Petter Selasky * All rights reserved. * * This software was developed by SRI International and the University of @@ -29,5 +29,1958 @@ * SUCH DAMAGE. */ +/* + * This file contains the driver for the SAF1761 series USB OTG + * controller. + * + * Datasheet is available from: + * http://www.nxp.com/products/automotive/multimedia/usb/SAF1761BE.html + */ + +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define USB_DEBUG_VAR saf1761_dci_debug + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#endif /* USB_GLOBAL_INCLUDE_FILE */ + #include #include + +#define SAF1761_DCI_BUS2SC(bus) \ + ((struct saf1761_dci_softc *)(((uint8_t *)(bus)) - \ + ((uint8_t *)&(((struct saf1761_dci_softc *)0)->sc_bus)))) + +#ifdef USB_DEBUG +static int saf1761_dci_debug = 0; +static int saf1761_dci_forcefs = 0; + +static +SYSCTL_NODE(_hw_usb, OID_AUTO, saf1761_dci, CTLFLAG_RW, 0, + "USB SAF1761 DCI"); + +SYSCTL_INT(_hw_usb_saf1761_dci, OID_AUTO, debug, CTLFLAG_RW, + &saf1761_dci_debug, 0, "SAF1761 DCI debug level"); +SYSCTL_INT(_hw_usb_saf1761_dci, OID_AUTO, forcefs, CTLFLAG_RW, + &saf1761_dci_forcefs, 0, "SAF1761 DCI force FULL speed"); +#endif + +#define SAF1761_DCI_INTR_ENDPT 1 + +/* prototypes */ + +static const struct usb_bus_methods saf1761_dci_bus_methods; +static const struct usb_pipe_methods saf1761_dci_device_non_isoc_methods; +static const struct usb_pipe_methods saf1761_dci_device_isoc_methods; + +static saf1761_dci_cmd_t saf1761_dci_setup_rx; +static saf1761_dci_cmd_t saf1761_dci_data_rx; +static saf1761_dci_cmd_t saf1761_dci_data_tx; +static saf1761_dci_cmd_t saf1761_dci_data_tx_sync; +static void saf1761_dci_device_done(struct usb_xfer *, usb_error_t); +static void saf1761_dci_do_poll(struct usb_bus *); +static void saf1761_dci_standard_done(struct usb_xfer *); +static void saf1761_dci_intr_set(struct usb_xfer *, uint8_t); +static void saf1761_dci_root_intr(struct saf1761_dci_softc *); + +/* + * Here is a list of what the SAF1761 chip can support. The main + * limitation is that the sum of the buffer sizes must be less than + * 8192 bytes. + */ +static const struct usb_hw_ep_profile saf1761_dci_ep_profile[] = { + + [0] = { + .max_in_frame_size = 64, + .max_out_frame_size = 64, + .is_simplex = 0, + .support_control = 1, + }, + [1] = { + .max_in_frame_size = SOTG_HS_MAX_PACKET_SIZE, + .max_out_frame_size = SOTG_HS_MAX_PACKET_SIZE, + .is_simplex = 0, + .support_interrupt = 1, + .support_bulk = 1, + .support_isochronous = 1, + .support_in = 1, + .support_out = 1, + }, +}; + +static void +saf1761_dci_get_hw_ep_profile(struct usb_device *udev, + const struct usb_hw_ep_profile **ppf, uint8_t ep_addr) +{ + if (ep_addr == 0) { + *ppf = saf1761_dci_ep_profile + 0; + } else if (ep_addr < 8) { + *ppf = saf1761_dci_ep_profile + 1; + } else { + *ppf = NULL; + } +} + +static void +saf1761_dci_pull_up(struct saf1761_dci_softc *sc) +{ + /* activate pullup on D+, if possible */ + + if (!sc->sc_flags.d_pulled_up && sc->sc_flags.port_powered) { + DPRINTF("\n"); + + sc->sc_flags.d_pulled_up = 1; + + SAF1761_WRITE_2(sc, SOTG_CTRL_SET, SOTG_CTRL_DP_PULL_UP); + } +} + +static void +saf1761_dci_pull_down(struct saf1761_dci_softc *sc) +{ + /* release pullup on D+, if possible */ + + if (sc->sc_flags.d_pulled_up) { + DPRINTF("\n"); + + sc->sc_flags.d_pulled_up = 0; + + SAF1761_WRITE_2(sc, SOTG_CTRL_CLR, SOTG_CTRL_DP_PULL_UP); + } +} + +static void +saf1761_dci_wakeup_peer(struct saf1761_dci_softc *sc) +{ + uint16_t temp; + + if (!(sc->sc_flags.status_suspend)) + return; + + DPRINTFN(5, "\n"); + + temp = SAF1761_READ_2(sc, SOTG_MODE); + SAF1761_WRITE_2(sc, SOTG_MODE, temp | SOTG_MODE_SNDRSU); + SAF1761_WRITE_2(sc, SOTG_MODE, temp & ~SOTG_MODE_SNDRSU); + + /* Wait 8ms for remote wakeup to complete. */ + usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); + +} + +static void +saf1761_dci_set_address(struct saf1761_dci_softc *sc, uint8_t addr) +{ + DPRINTFN(5, "addr=%d\n", addr); + + SAF1761_WRITE_1(sc, SOTG_ADDRESS, addr | SOTG_ADDRESS_ENABLE); +} + +static void +saf1761_read_fifo(struct saf1761_dci_softc *sc, void *buf, uint32_t len) +{ + bus_space_read_multi_1((sc)->sc_io_tag, (sc)->sc_io_hdl, SOTG_DATA_PORT, buf, len); +} + +static void +saf1761_write_fifo(struct saf1761_dci_softc *sc, void *buf, uint32_t len) +{ + bus_space_write_multi_1((sc)->sc_io_tag, (sc)->sc_io_hdl, SOTG_DATA_PORT, buf, len); +} + +static uint8_t +saf1761_dci_setup_rx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +{ + struct usb_device_request req; + uint16_t count; + + /* select the correct endpoint */ + SAF1761_WRITE_1(sc, SOTG_EP_INDEX, SOTG_EP_INDEX_EP0SETUP); + + /* check buffer status */ + if ((SAF1761_READ_1(sc, SOTG_DCBUFFERSTATUS) & + SOTG_DCBUFFERSTATUS_FILLED_MASK) == 0) + goto busy; + + /* read buffer length */ + count = SAF1761_READ_2(sc, SOTG_BUF_LENGTH); + + DPRINTFN(5, "count=%u rem=%u\n", count, td->remainder); + + /* clear did stall */ + td->did_stall = 0; + + /* clear stall */ + SAF1761_WRITE_1(sc, SOTG_CTRL_FUNC, 0); + + /* verify data length */ + if (count != td->remainder) { + DPRINTFN(0, "Invalid SETUP packet " + "length, %d bytes\n", count); + goto busy; + } + if (count != sizeof(req)) { + DPRINTFN(0, "Unsupported SETUP packet " + "length, %d bytes\n", count); + goto busy; + } + /* receive data */ + saf1761_read_fifo(sc, &req, sizeof(req)); + + /* copy data into real buffer */ + usbd_copy_in(td->pc, 0, &req, sizeof(req)); + + td->offset = sizeof(req); + td->remainder = 0; + + /* sneak peek the set address */ + if ((req.bmRequestType == UT_WRITE_DEVICE) && + (req.bRequest == UR_SET_ADDRESS)) { + sc->sc_dv_addr = req.wValue[0] & 0x7F; + } else { + sc->sc_dv_addr = 0xFF; + } + return (0); /* complete */ + +busy: + /* abort any ongoing transfer */ + if (!td->did_stall) { + DPRINTFN(5, "stalling\n"); + + /* set stall */ + SAF1761_WRITE_1(sc, SOTG_CTRL_FUNC, SOTG_CTRL_FUNC_STALL); + + td->did_stall = 1; + } + return (1); /* not complete */ +} + +static uint8_t +saf1761_dci_data_rx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +{ + struct usb_page_search buf_res; + uint16_t count; + uint8_t got_short = 0; + + if (td->ep_index == 0) { + /* select the correct endpoint */ + SAF1761_WRITE_1(sc, SOTG_EP_INDEX, SOTG_EP_INDEX_EP0SETUP); + + /* check buffer status */ + if ((SAF1761_READ_1(sc, SOTG_DCBUFFERSTATUS) & + SOTG_DCBUFFERSTATUS_FILLED_MASK) != 0) { + + if (td->remainder == 0) { + /* + * We are actually complete and have + * received the next SETUP: + */ + DPRINTFN(5, "faking complete\n"); + return (0); /* complete */ + } + DPRINTFN(5, "SETUP packet while receiving data\n"); + /* + * USB Host Aborted the transfer. + */ + td->error = 1; + return (0); /* complete */ + } + } + /* select the correct endpoint */ + SAF1761_WRITE_1(sc, SOTG_EP_INDEX, + (td->ep_index << SOTG_EP_INDEX_ENDP_INDEX_SHIFT) | + SOTG_EP_INDEX_DIR_OUT); + + /* check buffer status */ + if ((SAF1761_READ_1(sc, SOTG_DCBUFFERSTATUS) & + SOTG_DCBUFFERSTATUS_FILLED_MASK) == 0) { + return (1); /* not complete */ + } + /* read buffer length */ + count = SAF1761_READ_2(sc, SOTG_BUF_LENGTH); + + DPRINTFN(5, "rem=%u count=0x%04x\n", td->remainder, count); + + /* verify the packet byte count */ + if (count != td->max_packet_size) { + if (count < td->max_packet_size) { + /* we have a short packet */ + td->short_pkt = 1; + got_short = 1; + } else { + /* invalid USB packet */ + td->error = 1; + return (0); /* we are complete */ + } + } + /* verify the packet byte count */ + if (count > td->remainder) { + /* invalid USB packet */ + td->error = 1; + return (0); /* we are complete */ + } + while (count > 0) { + usbd_get_page(td->pc, td->offset, &buf_res); + + /* get correct length */ + if (buf_res.length > count) + buf_res.length = count; + + /* receive data */ + saf1761_read_fifo(sc, buf_res.buffer, buf_res.length); + + /* update counters */ + count -= buf_res.length; + td->offset += buf_res.length; + td->remainder -= buf_res.length; + } + /* check if we are complete */ + if ((td->remainder == 0) || got_short) { + if (td->short_pkt) { + /* we are complete */ + return (0); + } + /* else need to receive a zero length packet */ + } + return (1); /* not complete */ +} + +static uint8_t +saf1761_dci_data_tx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +{ + struct usb_page_search buf_res; + uint16_t count; + uint16_t count_old; + + if (td->ep_index == 0) { + /* select the correct endpoint */ + SAF1761_WRITE_1(sc, SOTG_EP_INDEX, SOTG_EP_INDEX_EP0SETUP); + + /* check buffer status */ + if ((SAF1761_READ_1(sc, SOTG_DCBUFFERSTATUS) & + SOTG_DCBUFFERSTATUS_FILLED_MASK) != 0) { + DPRINTFN(5, "SETUP abort\n"); + /* + * USB Host Aborted the transfer. + */ + td->error = 1; + return (0); /* complete */ + } + } + /* select the correct endpoint */ + SAF1761_WRITE_1(sc, SOTG_EP_INDEX, + (td->ep_index << SOTG_EP_INDEX_ENDP_INDEX_SHIFT) | + SOTG_EP_INDEX_DIR_IN); + + /* check buffer status */ + if ((SAF1761_READ_1(sc, SOTG_DCBUFFERSTATUS) & + SOTG_DCBUFFERSTATUS_FILLED_MASK) != 0) { + return (1); /* not complete */ + } + DPRINTFN(5, "rem=%u\n", td->remainder); + + count = td->max_packet_size; + if (td->remainder < count) { + /* we have a short packet */ + td->short_pkt = 1; + count = td->remainder; + } + count_old = count; + + while (count > 0) { + + usbd_get_page(td->pc, td->offset, &buf_res); + + /* get correct length */ + if (buf_res.length > count) + buf_res.length = count; + + /* transmit data */ + saf1761_write_fifo(sc, buf_res.buffer, buf_res.length); + + /* update counters */ + count -= buf_res.length; + td->offset += buf_res.length; + td->remainder -= buf_res.length; + } + + if (td->ep_index == 0) { + if (count_old < SOTG_FS_MAX_PACKET_SIZE) { + /* set end of packet */ + SAF1761_WRITE_1(sc, SOTG_CTRL_FUNC, SOTG_CTRL_FUNC_VENDP); + } + } else { + if (count_old < SOTG_HS_MAX_PACKET_SIZE) { + /* set end of packet */ + SAF1761_WRITE_1(sc, SOTG_CTRL_FUNC, SOTG_CTRL_FUNC_VENDP); + } + } + + /* check remainder */ + if (td->remainder == 0) { + if (td->short_pkt) { + return (0); /* complete */ + } + /* else we need to transmit a short packet */ + } + return (1); /* not complete */ +} + +static uint8_t +saf1761_dci_data_tx_sync(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +{ + if (td->ep_index == 0) { + /* select the correct endpoint */ + SAF1761_WRITE_1(sc, SOTG_EP_INDEX, SOTG_EP_INDEX_EP0SETUP); + + /* check buffer status */ + if ((SAF1761_READ_1(sc, SOTG_DCBUFFERSTATUS) & + SOTG_DCBUFFERSTATUS_FILLED_MASK) != 0) { + DPRINTFN(5, "Faking complete\n"); + return (0); /* complete */ + } + } + /* select the correct endpoint */ + SAF1761_WRITE_1(sc, SOTG_EP_INDEX, + (td->ep_index << SOTG_EP_INDEX_ENDP_INDEX_SHIFT) | + SOTG_EP_INDEX_DIR_IN); + + /* check buffer status */ + if ((SAF1761_READ_1(sc, SOTG_DCBUFFERSTATUS) & + SOTG_DCBUFFERSTATUS_FILLED_MASK) != 0) + return (1); /* busy */ + + if (sc->sc_dv_addr != 0xFF) { + /* write function address */ + saf1761_dci_set_address(sc, sc->sc_dv_addr); + } + return (0); /* complete */ +} + +static uint8_t +saf1761_dci_xfer_do_fifo(struct saf1761_dci_softc *sc, struct usb_xfer *xfer) +{ + struct saf1761_dci_td *td; + + DPRINTFN(9, "\n"); + + td = xfer->td_transfer_cache; + while (1) { + if ((td->func) (sc, td)) { + /* operation in progress */ + break; + } + if (((void *)td) == xfer->td_transfer_last) { + goto done; + } + if (td->error) { + goto done; + } else if (td->remainder > 0) { + /* + * We had a short transfer. If there is no alternate + * next, stop processing ! + */ + if (!td->alt_next) { + goto done; + } + } + /* + * Fetch the next transfer descriptor. + */ + td = td->obj_next; + xfer->td_transfer_cache = td; + } + return (1); /* not complete */ + +done: + /* compute all actual lengths */ + + saf1761_dci_standard_done(xfer); + + return (0); /* complete */ +} + +static void +saf1761_dci_interrupt_poll(struct saf1761_dci_softc *sc) +{ + struct usb_xfer *xfer; + +repeat: + TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { + if (!saf1761_dci_xfer_do_fifo(sc, xfer)) { + /* queue has been modified */ + goto repeat; + } + } +} + +static void +saf1761_dci_wait_suspend(struct saf1761_dci_softc *sc, uint8_t on) +{ + if (on) { + sc->sc_intr_enable |= SOTG_DCINTERRUPT_IESUSP; + sc->sc_intr_enable &= ~SOTG_DCINTERRUPT_IERESM; + } else { + sc->sc_intr_enable &= ~SOTG_DCINTERRUPT_IESUSP; + sc->sc_intr_enable |= SOTG_DCINTERRUPT_IERESM; + } + SAF1761_WRITE_4(sc, SOTG_DCINTERRUPT_EN, sc->sc_intr_enable); +} + +static void +saf1761_dci_update_vbus(struct saf1761_dci_softc *sc) +{ + if (SAF1761_READ_4(sc, SOTG_MODE) & SOTG_MODE_VBUSSTAT) { + DPRINTFN(4, "VBUS ON\n"); + + /* VBUS present */ + if (!sc->sc_flags.status_vbus) { + sc->sc_flags.status_vbus = 1; + + /* complete root HUB interrupt endpoint */ + saf1761_dci_root_intr(sc); + } + } else { + DPRINTFN(4, "VBUS OFF\n"); + + /* VBUS not-present */ + if (sc->sc_flags.status_vbus) { + sc->sc_flags.status_vbus = 0; + sc->sc_flags.status_bus_reset = 0; + sc->sc_flags.status_suspend = 0; + sc->sc_flags.change_suspend = 0; + sc->sc_flags.change_connect = 1; + + /* complete root HUB interrupt endpoint */ + saf1761_dci_root_intr(sc); + } + } +} + +void +saf1761_dci_interrupt(struct saf1761_dci_softc *sc) +{ + uint32_t status; + + USB_BUS_LOCK(&sc->sc_bus); + + status = SAF1761_READ_4(sc, SOTG_DCINTERRUPT); + + /* acknowledge all interrupts */ + SAF1761_WRITE_4(sc, SOTG_DCINTERRUPT, status); + + if (status & SOTG_DCINTERRUPT_IEVBUS) { + /* update VBUS bit */ + saf1761_dci_update_vbus(sc); + } + if (status & SOTG_DCINTERRUPT_IEBRST) { + sc->sc_flags.status_bus_reset = 1; + sc->sc_flags.status_suspend = 0; + sc->sc_flags.change_suspend = 0; + sc->sc_flags.change_connect = 1; + + /* disable resume interrupt */ + saf1761_dci_wait_suspend(sc, 1); + /* complete root HUB interrupt endpoint */ + saf1761_dci_root_intr(sc); + } + /* + * If "RESUME" and "SUSPEND" is set at the same time we + * interpret that like "RESUME". Resume is set when there is + * at least 3 milliseconds of inactivity on the USB BUS: + */ + if (status & SOTG_DCINTERRUPT_IERESM) { + if (sc->sc_flags.status_suspend) { + sc->sc_flags.status_suspend = 0; + sc->sc_flags.change_suspend = 1; + /* disable resume interrupt */ + saf1761_dci_wait_suspend(sc, 1); + /* complete root HUB interrupt endpoint */ + saf1761_dci_root_intr(sc); + } + } else if (status & SOTG_DCINTERRUPT_IESUSP) { + if (!sc->sc_flags.status_suspend) { + sc->sc_flags.status_suspend = 1; + sc->sc_flags.change_suspend = 1; + /* enable resume interrupt */ + saf1761_dci_wait_suspend(sc, 0); + /* complete root HUB interrupt endpoint */ + saf1761_dci_root_intr(sc); + } + } + /* poll all active transfers */ + saf1761_dci_interrupt_poll(sc); + + USB_BUS_UNLOCK(&sc->sc_bus); +} + +static void +saf1761_dci_setup_standard_chain_sub(struct saf1761_dci_std_temp *temp) +{ + struct saf1761_dci_td *td; + + /* get current Transfer Descriptor */ + td = temp->td_next; + temp->td = td; + + /* prepare for next TD */ + temp->td_next = td->obj_next; + + /* fill out the Transfer Descriptor */ + td->func = temp->func; + td->pc = temp->pc; + td->offset = temp->offset; + td->remainder = temp->len; + td->error = 0; + td->did_stall = temp->did_stall; + td->short_pkt = temp->short_pkt; + td->alt_next = temp->setup_alt_next; +} + +static void +saf1761_dci_setup_standard_chain(struct usb_xfer *xfer) +{ + struct saf1761_dci_std_temp temp; + struct saf1761_dci_softc *sc; + struct saf1761_dci_td *td; + uint32_t x; + uint8_t ep_no; + + DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n", + xfer->address, UE_GET_ADDR(xfer->endpointno), + xfer->sumlen, usbd_get_speed(xfer->xroot->udev)); + + temp.max_frame_size = xfer->max_frame_size; + + td = xfer->td_start[0]; + xfer->td_transfer_first = td; + xfer->td_transfer_cache = td; + + /* setup temp */ + + temp.pc = NULL; + temp.td = NULL; + temp.td_next = xfer->td_start[0]; + temp.offset = 0; + temp.setup_alt_next = xfer->flags_int.short_frames_ok; + temp.did_stall = !xfer->flags_int.control_stall; + + sc = SAF1761_DCI_BUS2SC(xfer->xroot->bus); + ep_no = (xfer->endpointno & UE_ADDR); + + /* check if we should prepend a setup message */ + + if (xfer->flags_int.control_xfr) { + if (xfer->flags_int.control_hdr) { + + temp.func = &saf1761_dci_setup_rx; + temp.len = xfer->frlengths[0]; + temp.pc = xfer->frbuffers + 0; + temp.short_pkt = temp.len ? 1 : 0; + /* check for last frame */ + if (xfer->nframes == 1) { + /* no STATUS stage yet, SETUP is last */ + if (xfer->flags_int.control_act) + temp.setup_alt_next = 0; + } + saf1761_dci_setup_standard_chain_sub(&temp); + } + x = 1; + } else { + x = 0; + } + + if (x != xfer->nframes) { + if (xfer->endpointno & UE_DIR_IN) { + temp.func = &saf1761_dci_data_tx; + } else { + temp.func = &saf1761_dci_data_rx; + } + + /* setup "pc" pointer */ + temp.pc = xfer->frbuffers + x; + } + while (x != xfer->nframes) { + + /* DATA0 / DATA1 message */ + + temp.len = xfer->frlengths[x]; + + x++; + + if (x == xfer->nframes) { + if (xfer->flags_int.control_xfr) { + if (xfer->flags_int.control_act) { + temp.setup_alt_next = 0; + } + } else { + temp.setup_alt_next = 0; + } + } + if (temp.len == 0) { + + /* make sure that we send an USB packet */ + + temp.short_pkt = 0; + + } else { + + /* regular data transfer */ + + temp.short_pkt = (xfer->flags.force_short_xfer) ? 0 : 1; + } + + saf1761_dci_setup_standard_chain_sub(&temp); + + if (xfer->flags_int.isochronous_xfr) { + temp.offset += temp.len; + } else { + /* get next Page Cache pointer */ + temp.pc = xfer->frbuffers + x; + } + } + + /* check for control transfer */ + if (xfer->flags_int.control_xfr) { + uint8_t need_sync; + + /* always setup a valid "pc" pointer for status and sync */ + temp.pc = xfer->frbuffers + 0; + temp.len = 0; + temp.short_pkt = 0; + temp.setup_alt_next = 0; + + /* check if we should append a status stage */ + if (!xfer->flags_int.control_act) { + + /* + * Send a DATA1 message and invert the current + * endpoint direction. + */ + if (xfer->endpointno & UE_DIR_IN) { + temp.func = &saf1761_dci_data_rx; + need_sync = 0; + } else { + temp.func = &saf1761_dci_data_tx; + need_sync = 1; + } + temp.len = 0; + temp.short_pkt = 0; + + saf1761_dci_setup_standard_chain_sub(&temp); + if (need_sync) { + /* we need a SYNC point after TX */ + temp.func = &saf1761_dci_data_tx_sync; + saf1761_dci_setup_standard_chain_sub(&temp); + } + } + } + /* must have at least one frame! */ + td = temp.td; + xfer->td_transfer_last = td; +} + +static void +saf1761_dci_timeout(void *arg) +{ + struct usb_xfer *xfer = arg; + + DPRINTF("xfer=%p\n", xfer); + + USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); + + /* transfer is transferred */ + saf1761_dci_device_done(xfer, USB_ERR_TIMEOUT); +} + +static void +saf1761_dci_intr_set(struct usb_xfer *xfer, uint8_t set) +{ + struct saf1761_dci_softc *sc = SAF1761_DCI_BUS2SC(xfer->xroot->bus); + uint8_t ep_no = (xfer->endpointno & UE_ADDR); + uint32_t mask; + + DPRINTFN(15, "endpoint 0x%02x\n", xfer->endpointno); + + if (ep_no == 0) { + mask = SOTG_DCINTERRUPT_IEPRX(0) | + SOTG_DCINTERRUPT_IEPTX(0) | + SOTG_DCINTERRUPT_IEP0SETUP; + } else if (xfer->endpointno & UE_DIR_IN) { + mask = SOTG_DCINTERRUPT_IEPTX(ep_no); + } else { + mask = SOTG_DCINTERRUPT_IEPRX(ep_no); + } + + if (set) + sc->sc_intr_enable |= mask; + else + sc->sc_intr_enable &= ~mask; + + SAF1761_WRITE_4(sc, SOTG_DCINTERRUPT_EN, sc->sc_intr_enable); +} + +static void +saf1761_dci_start_standard_chain(struct usb_xfer *xfer) +{ + struct saf1761_dci_softc *sc = SAF1761_DCI_BUS2SC(xfer->xroot->bus); + + DPRINTFN(9, "\n"); + + /* poll one time */ + if (saf1761_dci_xfer_do_fifo(sc, xfer)) { + + /* + * Only enable the endpoint interrupt when we are + * actually waiting for data, hence we are dealing + * with level triggered interrupts ! + */ + saf1761_dci_intr_set(xfer, 1); + + /* put transfer on interrupt queue */ + usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer); + + /* start timeout, if any */ + if (xfer->timeout != 0) { + usbd_transfer_timeout_ms(xfer, + &saf1761_dci_timeout, xfer->timeout); + } + } +} + +static void +saf1761_dci_root_intr(struct saf1761_dci_softc *sc) +{ + DPRINTFN(9, "\n"); + + USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); + + /* set port bit - we only have one port */ + sc->sc_hub_idata[0] = 0x02; + + uhub_root_intr(&sc->sc_bus, sc->sc_hub_idata, + sizeof(sc->sc_hub_idata)); +} + +static usb_error_t +saf1761_dci_standard_done_sub(struct usb_xfer *xfer) +{ + struct saf1761_dci_td *td; + uint32_t len; + uint8_t error; + + DPRINTFN(9, "\n"); + + td = xfer->td_transfer_cache; + + do { + len = td->remainder; + + if (xfer->aframes != xfer->nframes) { + /* + * Verify the length and subtract + * the remainder from "frlengths[]": + */ + if (len > xfer->frlengths[xfer->aframes]) { + td->error = 1; + } else { + xfer->frlengths[xfer->aframes] -= len; + } + } + /* Check for transfer error */ + if (td->error) { + /* the transfer is finished */ + error = 1; + td = NULL; + break; + } + /* Check for short transfer */ + if (len > 0) { + if (xfer->flags_int.short_frames_ok) { + /* follow alt next */ + if (td->alt_next) { + td = td->obj_next; + } else { + td = NULL; + } + } else { + /* the transfer is finished */ + td = NULL; + } + error = 0; + break; + } + td = td->obj_next; + + /* this USB frame is complete */ + error = 0; + break; + + } while (0); + + /* update transfer cache */ + + xfer->td_transfer_cache = td; + + return (error ? + USB_ERR_STALLED : USB_ERR_NORMAL_COMPLETION); +} + +static void +saf1761_dci_standard_done(struct usb_xfer *xfer) +{ + usb_error_t err = 0; + + DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n", + xfer, xfer->endpoint); + + /* reset scanner */ + + xfer->td_transfer_cache = xfer->td_transfer_first; + + if (xfer->flags_int.control_xfr) { + + if (xfer->flags_int.control_hdr) { + + err = saf1761_dci_standard_done_sub(xfer); + } + xfer->aframes = 1; + + if (xfer->td_transfer_cache == NULL) { + goto done; + } + } + while (xfer->aframes != xfer->nframes) { + + err = saf1761_dci_standard_done_sub(xfer); + xfer->aframes++; + + if (xfer->td_transfer_cache == NULL) { + goto done; + } + } + + if (xfer->flags_int.control_xfr && + !xfer->flags_int.control_act) { + + err = saf1761_dci_standard_done_sub(xfer); + } +done: + saf1761_dci_device_done(xfer, err); +} + +/*------------------------------------------------------------------------* + * saf1761_dci_device_done + * + * NOTE: this function can be called more than one time on the + * same USB transfer! + *------------------------------------------------------------------------*/ +static void +saf1761_dci_device_done(struct usb_xfer *xfer, usb_error_t error) +{ + USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); + + DPRINTFN(2, "xfer=%p, endpoint=%p, error=%d\n", + xfer, xfer->endpoint, error); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed May 14 17:05:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B834A1F3; Wed, 14 May 2014 17:05:45 +0000 (UTC) Received: from mail-qg0-x22a.google.com (mail-qg0-x22a.google.com [IPv6:2607:f8b0:400d:c04::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56C58240F; Wed, 14 May 2014 17:05:45 +0000 (UTC) Received: by mail-qg0-f42.google.com with SMTP id q107so3325870qgd.15 for ; Wed, 14 May 2014 10:05:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=e/JPlXVQ5D2eUyEcy3Lb6XdxZeDleJMMReLk3kzMJ9o=; b=VWSn07tpZXxN914QuLwcQuDABvEG33284NYFp+9lX86sSXZ1H18s4CRtdojg3WDxp7 s0gViv1AK21Z7UwuvySLJL16eVXhldu5RHRGyIKionbvug+BEI3892DRp1FmEmnJw04M 5pEFDXRlxUHYPG63x2AuwkLpOi8olhVgcFfMCRGvL6b0bpLOX7htKlp59tKgbdw3UNfM crBz8UA5lFYrz+38OXtmymDg22nuasB5xLyVse/RuKJhla5YDFt24rQtyHIRo3pSt/tD MYZNkpPH3wY2eb7zbwhaPnkkWCZaxeFym7wRIdvuBZIL9Ne3idEZuBqiYs4T00XnkWYn Obpw== MIME-Version: 1.0 X-Received: by 10.140.35.212 with SMTP id n78mr7261025qgn.87.1400087144531; Wed, 14 May 2014 10:05:44 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.191.201 with HTTP; Wed, 14 May 2014 10:05:44 -0700 (PDT) In-Reply-To: <53735578.8010702@selasky.org> References: <201405051150.s45BoqID055514@svn.freebsd.org> <53735578.8010702@selasky.org> Date: Wed, 14 May 2014 10:05:44 -0700 X-Google-Sender-Auth: U6U5ZTBmWMpsRawNpatt5RxnPIg Message-ID: Subject: Re: svn commit: r265358 - head/sys/dev/usb/controller From: Adrian Chadd To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ganbold Tsagaankhuu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 17:05:45 -0000 On 14 May 2014 04:37, Hans Petter Selasky wrote: > Hi, > > See: > > http://svnweb.freebsd.org/changeset/base/266012 > > Sorry, I cannot test all platforms currently because some configuration is > specific to each hardware platform. So where do we send you hardware, and what do you need? :-) -a From owner-svn-src-head@FreeBSD.ORG Wed May 14 17:11:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA3E5854; Wed, 14 May 2014 17:11:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5F7024FA; Wed, 14 May 2014 17:11:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4EHBv4D042725; Wed, 14 May 2014 17:11:57 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EHBv1v042724; Wed, 14 May 2014 17:11:57 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201405141711.s4EHBv1v042724@svn.freebsd.org> From: Dimitry Andric Date: Wed, 14 May 2014 17:11:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266053 - head/lib/clang X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 17:11:57 -0000 Author: dim Date: Wed May 14 17:11:57 2014 New Revision: 266053 URL: http://svnweb.freebsd.org/changeset/base/266053 Log: Use the new -d option that was added to tblgen between llvm/clang 3.3 and 3.4 to generate dependency files for the '.inc.h' files generated from .td files, and .sinclude those dependency files in clang.build.mk. This will make future incremental builds of lib/clang and usr.bin/clang work correctly, whenever any of the .td files get modified. Note that this will not fix any problems with incremental builds from *before* this revision, since there will not yet be any generated dependency files. A quick workaround is to run the following: find /usr/obj -type f -name '*.inc.h' | xargs rm and then a regular incremental buildworld (e.g. with -DNO_CLEAN). MFC after: 3 days Modified: head/lib/clang/clang.build.mk Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Wed May 14 17:07:14 2014 (r266052) +++ head/lib/clang/clang.build.mk Wed May 14 17:11:57 2014 (r266053) @@ -43,17 +43,9 @@ CXXFLAGS+= -fno-exceptions -fno-rtti TBLGEN?= tblgen CLANG_TBLGEN?= clang-tblgen -Intrinsics.inc.h: ${LLVM_SRCS}/include/llvm/IR/Intrinsics.td \ - ${LLVM_SRCS}/include/llvm/IR/IntrinsicsARM.td \ - ${LLVM_SRCS}/include/llvm/IR/IntrinsicsHexagon.td \ - ${LLVM_SRCS}/include/llvm/IR/IntrinsicsMips.td \ - ${LLVM_SRCS}/include/llvm/IR/IntrinsicsNVVM.td \ - ${LLVM_SRCS}/include/llvm/IR/IntrinsicsPowerPC.td \ - ${LLVM_SRCS}/include/llvm/IR/IntrinsicsR600.td \ - ${LLVM_SRCS}/include/llvm/IR/IntrinsicsX86.td \ - ${LLVM_SRCS}/include/llvm/IR/IntrinsicsXCore.td - ${TBLGEN} -I ${LLVM_SRCS}/include \ - -gen-intrinsic -o ${.TARGET} \ +Intrinsics.inc.h: ${LLVM_SRCS}/include/llvm/IR/Intrinsics.td + ${TBLGEN} -gen-intrinsic \ + -I ${LLVM_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ ${LLVM_SRCS}/include/llvm/IR/Intrinsics.td .for arch in \ ARM/ARM Mips/Mips PowerPC/PPC Sparc/Sparc X86/X86 @@ -72,144 +64,167 @@ Intrinsics.inc.h: ${LLVM_SRCS}/include/l RegisterInfo/-gen-register-info \ SubtargetInfo/-gen-subtarget ${arch:T}Gen${hdr:H:C/$/.inc.h/}: ${LLVM_SRCS}/lib/Target/${arch:H}/${arch:T}.td - ${TBLGEN} -I ${LLVM_SRCS}/include -I ${LLVM_SRCS}/lib/Target/${arch:H} \ - ${hdr:T:C/,/ /g} -o ${.TARGET} \ + ${TBLGEN} ${hdr:T:C/,/ /g} \ + -I ${LLVM_SRCS}/include -I ${LLVM_SRCS}/lib/Target/${arch:H} \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ ${LLVM_SRCS}/lib/Target/${arch:H}/${arch:T}.td . endfor .endfor Attrs.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-classes -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-classes \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrDump.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-dump -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-dump \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrIdentifierArg.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-identifier-arg-list -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-identifier-arg-list \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-impl -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-impl \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrLateParsed.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-late-parsed-list -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-late-parsed-list \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-list -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-list \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrParsedAttrImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-parsed-attr-impl -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-impl \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrParsedAttrKinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-parsed-attr-kinds -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-kinds \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrParsedAttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-parsed-attr-list -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-list \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrPCHRead.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-pch-read -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-pch-read \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrPCHWrite.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-pch-write -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-pch-write \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrSpellings.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-spelling-list -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-spelling-list \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrSpellingListIndex.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-spelling-index -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-spelling-index \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrTemplateInstantiate.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-template-instantiate -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-template-instantiate \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} AttrTypeArg.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-attr-type-arg-list -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-attr-type-arg-list \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${.ALLSRC} CommentCommandInfo.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentCommands.td - ${CLANG_TBLGEN} \ - -gen-clang-comment-command-info -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-comment-command-info \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} CommentCommandList.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentCommands.td - ${CLANG_TBLGEN} \ - -gen-clang-comment-command-list -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-comment-command-list \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} CommentHTMLNamedCharacterReferences.inc.h: \ ${CLANG_SRCS}/include/clang/AST/CommentHTMLNamedCharacterReferences.td - ${CLANG_TBLGEN} \ - -gen-clang-comment-html-named-character-references -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-comment-html-named-character-references \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} CommentHTMLTags.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td - ${CLANG_TBLGEN} \ - -gen-clang-comment-html-tags -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-comment-html-tags \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} CommentHTMLTagsProperties.inc.h: \ ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td - ${CLANG_TBLGEN} \ - -gen-clang-comment-html-tags-properties -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-comment-html-tags-properties \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} CommentNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/CommentNodes.td - ${CLANG_TBLGEN} \ - -gen-clang-comment-nodes -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-comment-nodes \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} DeclNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/DeclNodes.td - ${CLANG_TBLGEN} \ - -gen-clang-decl-nodes -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-decl-nodes \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} StmtNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/StmtNodes.td - ${CLANG_TBLGEN} \ - -gen-clang-stmt-nodes -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-stmt-nodes \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} arm_neon.h: ${CLANG_SRCS}/include/clang/Basic/arm_neon.td - ${CLANG_TBLGEN} \ - -gen-arm-neon -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-arm-neon \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} arm_neon.inc.h: ${CLANG_SRCS}/include/clang/Basic/arm_neon.td - ${CLANG_TBLGEN} \ - -gen-arm-neon-sema -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-arm-neon-sema \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} DiagnosticGroups.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic \ - -gen-clang-diag-groups -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-diag-groups \ + -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/\.h$/.d/} \ + -o ${.TARGET} ${.ALLSRC} DiagnosticIndexName.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic \ - -gen-clang-diags-index-name -o ${.TARGET} ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-diags-index-name \ + -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/\.h$/.d/} \ + -o ${.TARGET} ${.ALLSRC} .for hdr in AST Analysis Comment Common Driver Frontend Lex Parse Sema Serialization Diagnostic${hdr}Kinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include/clang/Basic \ - -gen-clang-diags-defs -clang-component=${hdr} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_TBLGEN} -gen-clang-diags-defs -clang-component=${hdr} \ + -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/\.h$/.d/} \ + -o ${.TARGET} ${.ALLSRC} .endfor Options.inc.h: ${CLANG_SRCS}/include/clang/Driver/Options.td - ${TBLGEN} -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \ - -gen-opt-parser-defs -o ${.TARGET} ${.ALLSRC} + ${TBLGEN} -gen-opt-parser-defs \ + -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} CC1AsOptions.inc.h: ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td - ${TBLGEN} -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \ - -gen-opt-parser-defs -o ${.TARGET} ${.ALLSRC} + ${TBLGEN} -gen-opt-parser-defs \ + -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \ + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} Checkers.inc.h: ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td \ ${CLANG_SRCS}/include/clang/StaticAnalyzer/Checkers/CheckerBase.td - ${CLANG_TBLGEN} -I ${CLANG_SRCS}/include \ - -gen-clang-sa-checkers -o ${.TARGET} \ + ${CLANG_TBLGEN} -gen-clang-sa-checkers \ + -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td +.for dep in ${TGHDRS:C/$/.inc.d/} +. sinclude "${dep}" +.endfor + SRCS+= ${TGHDRS:C/$/.inc.h/} DPADD+= ${TGHDRS:C/$/.inc.h/} -CLEANFILES+= ${TGHDRS:C/$/.inc.h/} +CLEANFILES+= ${TGHDRS:C/$/.inc.h/} ${TGHDRS:C/$/.inc.d/} From owner-svn-src-head@FreeBSD.ORG Wed May 14 18:43:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03F9863D; Wed, 14 May 2014 18:43:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EF352D71; Wed, 14 May 2014 18:43:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4EIhPL4084071; Wed, 14 May 2014 18:43:25 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EIhEVT083956; Wed, 14 May 2014 18:43:14 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201405141843.s4EIhEVT083956@svn.freebsd.org> From: Julio Merino Date: Wed, 14 May 2014 18:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266074 - in head: etc/mtree usr.bin/bmake usr.bin/bmake/tests usr.bin/bmake/tests/archives usr.bin/bmake/tests/archives/fmt_44bsd usr.bin/bmake/tests/archives/fmt_44bsd_mod usr.bin/bma... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 18:43:26 -0000 Author: jmmv Date: Wed May 14 18:43:13 2014 New Revision: 266074 URL: http://svnweb.freebsd.org/changeset/base/266074 Log: Move old fmake tests into bmake and hook them to the build. This first step is mostly to prevent the code from rotting even further and to ensure these do not get wiped when fmake's code is removed from the tree. These tests are currently being skipped because they detect the underlying make is not fmake and thus disable themselves -- and the reason is that some of the tests fail, possibly due to legitimate bugs. Enabling them to run against bmake will come separately. Lastly, it would be ideal if these tests were fed upstream but they are not ready for that yet. In the interim, just put them under usr.bin/bmake/ while we sort things out. The existence of a different unit-tests directory within here makes me feel less guilty about this. Change confirmed working with a clean amd64 build. Added: head/usr.bin/bmake/tests/ - copied from r266046, head/usr.bin/make/tests/ Deleted: head/usr.bin/make/tests/ Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/bmake/Makefile head/usr.bin/bmake/tests/Makefile head/usr.bin/bmake/tests/archives/Makefile head/usr.bin/bmake/tests/archives/fmt_44bsd/Makefile head/usr.bin/bmake/tests/archives/fmt_44bsd_mod/Makefile head/usr.bin/bmake/tests/archives/fmt_oldbsd/Makefile head/usr.bin/bmake/tests/basic/Makefile head/usr.bin/bmake/tests/basic/t0/Makefile head/usr.bin/bmake/tests/basic/t1/Makefile head/usr.bin/bmake/tests/basic/t2/Makefile head/usr.bin/bmake/tests/basic/t3/Makefile head/usr.bin/bmake/tests/execution/Makefile head/usr.bin/bmake/tests/execution/ellipsis/Makefile head/usr.bin/bmake/tests/execution/empty/Makefile head/usr.bin/bmake/tests/execution/joberr/Makefile head/usr.bin/bmake/tests/execution/plus/Makefile head/usr.bin/bmake/tests/shell/Makefile head/usr.bin/bmake/tests/shell/builtin/Makefile head/usr.bin/bmake/tests/shell/meta/Makefile head/usr.bin/bmake/tests/shell/path/Makefile head/usr.bin/bmake/tests/shell/path_select/Makefile head/usr.bin/bmake/tests/shell/replace/Makefile head/usr.bin/bmake/tests/shell/select/Makefile head/usr.bin/bmake/tests/suffixes/Makefile head/usr.bin/bmake/tests/suffixes/basic/Makefile head/usr.bin/bmake/tests/suffixes/src_wild1/Makefile head/usr.bin/bmake/tests/suffixes/src_wild2/Makefile head/usr.bin/bmake/tests/syntax/Makefile head/usr.bin/bmake/tests/syntax/directive-t0/Makefile head/usr.bin/bmake/tests/syntax/enl/Makefile head/usr.bin/bmake/tests/syntax/funny-targets/Makefile head/usr.bin/bmake/tests/syntax/semi/Makefile head/usr.bin/bmake/tests/sysmk/Makefile head/usr.bin/bmake/tests/sysmk/t0/2/1/Makefile head/usr.bin/bmake/tests/sysmk/t0/2/Makefile head/usr.bin/bmake/tests/sysmk/t0/Makefile head/usr.bin/bmake/tests/sysmk/t0/mk/Makefile head/usr.bin/bmake/tests/sysmk/t1/2/1/Makefile head/usr.bin/bmake/tests/sysmk/t1/2/Makefile head/usr.bin/bmake/tests/sysmk/t1/Makefile head/usr.bin/bmake/tests/sysmk/t1/mk/Makefile head/usr.bin/bmake/tests/sysmk/t2/2/1/Makefile head/usr.bin/bmake/tests/sysmk/t2/2/Makefile head/usr.bin/bmake/tests/sysmk/t2/Makefile head/usr.bin/bmake/tests/sysmk/t2/mk/Makefile head/usr.bin/bmake/tests/variables/Makefile head/usr.bin/bmake/tests/variables/modifier_M/Makefile head/usr.bin/bmake/tests/variables/modifier_t/Makefile head/usr.bin/bmake/tests/variables/opt_V/Makefile head/usr.bin/bmake/tests/variables/t0/Makefile head/usr.bin/make/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Wed May 14 18:41:59 2014 (r266073) +++ head/etc/mtree/BSD.tests.dist Wed May 14 18:43:13 2014 (r266074) @@ -133,21 +133,7 @@ atf-sh .. .. - calendar - .. - comm - .. - file2c - .. - join - .. - jot - .. - lastcomm - .. - m4 - .. - make + bmake archives fmt_44bsd .. @@ -245,6 +231,20 @@ .. .. .. + calendar + .. + comm + .. + file2c + .. + join + .. + jot + .. + lastcomm + .. + m4 + .. ncal .. printf Modified: head/usr.bin/bmake/Makefile ============================================================================== --- head/usr.bin/bmake/Makefile Wed May 14 18:41:59 2014 (r266073) +++ head/usr.bin/bmake/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -3,6 +3,7 @@ # # $FreeBSD$ +.include .sinclude "Makefile.inc" SRCTOP?= ${.CURDIR:H:H} @@ -106,6 +107,10 @@ COPTS.meta.c += -DHAVE_FILEMON_H -I${FIL SUBDIR+= unit-tests .endif +.if ${MK_TESTS} != no +SUBDIR+= tests +.endif + MAN= ${PROG}.1 MAN1= ${MAN} Modified: head/usr.bin/bmake/tests/Makefile ============================================================================== --- head/usr.bin/make/tests/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make +TESTSDIR= ${TESTSBASE}/usr.bin/bmake FILESDIR= ${TESTSDIR} FILES= common.sh Modified: head/usr.bin/bmake/tests/archives/Makefile ============================================================================== --- head/usr.bin/make/tests/archives/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/archives/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/archives +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/archives TESTS_SUBDIRS= fmt_44bsd fmt_44bsd_mod fmt_oldbsd Modified: head/usr.bin/bmake/tests/archives/fmt_44bsd/Makefile ============================================================================== --- head/usr.bin/make/tests/archives/fmt_44bsd/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/archives/fmt_44bsd/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/archives/fmt_44bsd +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/archives/fmt_44bsd TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/archives/fmt_44bsd_mod/Makefile ============================================================================== --- head/usr.bin/make/tests/archives/fmt_44bsd_mod/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/archives/fmt_44bsd_mod/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/archives/fmt_44bsd_mod +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/archives/fmt_44bsd_mod TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/archives/fmt_oldbsd/Makefile ============================================================================== --- head/usr.bin/make/tests/archives/fmt_oldbsd/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/archives/fmt_oldbsd/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/archives/fmt_oldbsd +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/archives/fmt_oldbsd TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/basic/Makefile ============================================================================== --- head/usr.bin/make/tests/basic/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/basic/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/basic +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/basic TESTS_SUBDIRS= t0 t1 t2 t3 Modified: head/usr.bin/bmake/tests/basic/t0/Makefile ============================================================================== --- head/usr.bin/make/tests/basic/t0/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/basic/t0/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/basic/t0 +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/basic/t0 TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/basic/t1/Makefile ============================================================================== --- head/usr.bin/make/tests/basic/t1/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/basic/t1/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/basic/t1 +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/basic/t1 TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/basic/t2/Makefile ============================================================================== --- head/usr.bin/make/tests/basic/t2/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/basic/t2/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/basic/t2 +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/basic/t2 TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/basic/t3/Makefile ============================================================================== --- head/usr.bin/make/tests/basic/t3/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/basic/t3/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/basic/t3 +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/basic/t3 TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/execution/Makefile ============================================================================== --- head/usr.bin/make/tests/execution/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/execution/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/execution +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/execution TESTS_SUBDIRS= ellipsis empty joberr plus Modified: head/usr.bin/bmake/tests/execution/ellipsis/Makefile ============================================================================== --- head/usr.bin/make/tests/execution/ellipsis/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/execution/ellipsis/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/execution/ellipsis +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/execution/ellipsis TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/execution/empty/Makefile ============================================================================== --- head/usr.bin/make/tests/execution/empty/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/execution/empty/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/execution/empty +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/execution/empty TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/execution/joberr/Makefile ============================================================================== --- head/usr.bin/make/tests/execution/joberr/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/execution/joberr/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/execution/joberr +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/execution/joberr TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/execution/plus/Makefile ============================================================================== --- head/usr.bin/make/tests/execution/plus/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/execution/plus/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/execution/plus +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/execution/plus TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/shell/Makefile ============================================================================== --- head/usr.bin/make/tests/shell/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/shell/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/shell +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/shell TESTS_SUBDIRS= builtin meta path path_select replace select Modified: head/usr.bin/bmake/tests/shell/builtin/Makefile ============================================================================== --- head/usr.bin/make/tests/shell/builtin/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/shell/builtin/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/shell/builtin +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/shell/builtin TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/shell/meta/Makefile ============================================================================== --- head/usr.bin/make/tests/shell/meta/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/shell/meta/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/shell/meta +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/shell/meta TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/shell/path/Makefile ============================================================================== --- head/usr.bin/make/tests/shell/path/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/shell/path/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/shell/path +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/shell/path TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/shell/path_select/Makefile ============================================================================== --- head/usr.bin/make/tests/shell/path_select/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/shell/path_select/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/shell/path_select +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/shell/path_select TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/shell/replace/Makefile ============================================================================== --- head/usr.bin/make/tests/shell/replace/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/shell/replace/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/shell/replace +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/shell/replace TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/shell/select/Makefile ============================================================================== --- head/usr.bin/make/tests/shell/select/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/shell/select/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/shell/select +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/shell/select TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/suffixes/Makefile ============================================================================== --- head/usr.bin/make/tests/suffixes/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/suffixes/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/suffixes +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/suffixes TESTS_SUBDIRS= basic src_wild1 src_wild2 Modified: head/usr.bin/bmake/tests/suffixes/basic/Makefile ============================================================================== --- head/usr.bin/make/tests/suffixes/basic/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/suffixes/basic/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/suffixes/basic +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/suffixes/basic TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/suffixes/src_wild1/Makefile ============================================================================== --- head/usr.bin/make/tests/suffixes/src_wild1/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/suffixes/src_wild1/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/suffixes/src_wild1 +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/suffixes/src_wild1 TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/suffixes/src_wild2/Makefile ============================================================================== --- head/usr.bin/make/tests/suffixes/src_wild2/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/suffixes/src_wild2/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/suffixes/src_wild2 +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/suffixes/src_wild2 TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/syntax/Makefile ============================================================================== --- head/usr.bin/make/tests/syntax/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/syntax/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/syntax +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/syntax TESTS_SUBDIRS= directive-t0 enl funny-targets semi Modified: head/usr.bin/bmake/tests/syntax/directive-t0/Makefile ============================================================================== --- head/usr.bin/make/tests/syntax/directive-t0/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/syntax/directive-t0/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/syntax/directive-t0 +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/syntax/directive-t0 TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/syntax/enl/Makefile ============================================================================== --- head/usr.bin/make/tests/syntax/enl/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/syntax/enl/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/syntax/enl +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/syntax/enl TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/syntax/funny-targets/Makefile ============================================================================== --- head/usr.bin/make/tests/syntax/funny-targets/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/syntax/funny-targets/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/syntax/funny-targets +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/syntax/funny-targets TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/syntax/semi/Makefile ============================================================================== --- head/usr.bin/make/tests/syntax/semi/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/syntax/semi/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/syntax/semi +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/syntax/semi TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/sysmk/Makefile ============================================================================== --- head/usr.bin/make/tests/sysmk/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/sysmk/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/sysmk TESTS_SUBDIRS= t0 t1 t2 Modified: head/usr.bin/bmake/tests/sysmk/t0/2/1/Makefile ============================================================================== --- head/usr.bin/make/tests/sysmk/t0/2/1/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/sysmk/t0/2/1/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t0/2/1 +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/sysmk/t0/2/1 TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/sysmk/t0/2/Makefile ============================================================================== --- head/usr.bin/make/tests/sysmk/t0/2/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/sysmk/t0/2/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t0/2 +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/sysmk/t0/2 TESTS_SUBDIRS= 1 Modified: head/usr.bin/bmake/tests/sysmk/t0/Makefile ============================================================================== --- head/usr.bin/make/tests/sysmk/t0/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/sysmk/t0/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t0 +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/sysmk/t0 TESTS_SUBDIRS= 2 SUBDIR= mk Modified: head/usr.bin/bmake/tests/sysmk/t0/mk/Makefile ============================================================================== --- head/usr.bin/make/tests/sysmk/t0/mk/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/sysmk/t0/mk/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t0/mk +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/sysmk/t0/mk FILESDIR= ${TESTSDIR} FILES= sys.mk.test Modified: head/usr.bin/bmake/tests/sysmk/t1/2/1/Makefile ============================================================================== --- head/usr.bin/make/tests/sysmk/t1/2/1/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/sysmk/t1/2/1/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t1/2/1 +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/sysmk/t1/2/1 TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/sysmk/t1/2/Makefile ============================================================================== --- head/usr.bin/make/tests/sysmk/t1/2/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/sysmk/t1/2/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t1/2 +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/sysmk/t1/2 TESTS_SUBDIRS= 1 Modified: head/usr.bin/bmake/tests/sysmk/t1/Makefile ============================================================================== --- head/usr.bin/make/tests/sysmk/t1/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/sysmk/t1/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t1 +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/sysmk/t1 TESTS_SUBDIRS= 2 SUBDIR= mk Modified: head/usr.bin/bmake/tests/sysmk/t1/mk/Makefile ============================================================================== --- head/usr.bin/make/tests/sysmk/t1/mk/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/sysmk/t1/mk/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t1/mk +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/sysmk/t1/mk FILESDIR= ${TESTSDIR} FILES= sys.mk.test Modified: head/usr.bin/bmake/tests/sysmk/t2/2/1/Makefile ============================================================================== --- head/usr.bin/make/tests/sysmk/t2/2/1/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/sysmk/t2/2/1/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t2/2/1 +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/sysmk/t2/2/1 TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/sysmk/t2/2/Makefile ============================================================================== --- head/usr.bin/make/tests/sysmk/t2/2/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/sysmk/t2/2/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t2/2 +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/sysmk/t2/2 TESTS_SUBDIRS= 1 Modified: head/usr.bin/bmake/tests/sysmk/t2/Makefile ============================================================================== --- head/usr.bin/make/tests/sysmk/t2/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/sysmk/t2/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t2 +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/sysmk/t2 TESTS_SUBDIRS= 2 SUBDIR= mk Modified: head/usr.bin/bmake/tests/sysmk/t2/mk/Makefile ============================================================================== --- head/usr.bin/make/tests/sysmk/t2/mk/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/sysmk/t2/mk/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/sysmk/t2/mk +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/sysmk/t2/mk FILESDIR= ${TESTSDIR} FILES= sys.mk.test Modified: head/usr.bin/bmake/tests/variables/Makefile ============================================================================== --- head/usr.bin/make/tests/variables/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/variables/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/variables +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/variables TESTS_SUBDIRS= modifier_M modifier_t opt_V t0 Modified: head/usr.bin/bmake/tests/variables/modifier_M/Makefile ============================================================================== --- head/usr.bin/make/tests/variables/modifier_M/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/variables/modifier_M/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/variables/modifier_M +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/variables/modifier_M TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/variables/modifier_t/Makefile ============================================================================== --- head/usr.bin/make/tests/variables/modifier_t/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/variables/modifier_t/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/variables/modifier_t +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/variables/modifier_t TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/variables/opt_V/Makefile ============================================================================== --- head/usr.bin/make/tests/variables/opt_V/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/variables/opt_V/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/variables/opt_V +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/variables/opt_V TAP_TESTS_SH= legacy_test Modified: head/usr.bin/bmake/tests/variables/t0/Makefile ============================================================================== --- head/usr.bin/make/tests/variables/t0/Makefile Wed May 14 16:32:27 2014 (r266046) +++ head/usr.bin/bmake/tests/variables/t0/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -1,6 +1,6 @@ # $FreeBSD$ -TESTSDIR= ${TESTSBASE}/usr.bin/make/variables/t0 +TESTSDIR= ${TESTSBASE}/usr.bin/bmake/variables/t0 TAP_TESTS_SH= legacy_test Modified: head/usr.bin/make/Makefile ============================================================================== --- head/usr.bin/make/Makefile Wed May 14 18:41:59 2014 (r266073) +++ head/usr.bin/make/Makefile Wed May 14 18:43:13 2014 (r266074) @@ -116,8 +116,4 @@ PROG= fmake fmake.1: make.1 cp ${.ALLSRC} ${.TARGET} -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif - .include From owner-svn-src-head@FreeBSD.ORG Wed May 14 19:02:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 964022FF; Wed, 14 May 2014 19:02:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 767962F4F; Wed, 14 May 2014 19:02:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4EJ21Yl093173; Wed, 14 May 2014 19:02:01 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EJ20bE093156; Wed, 14 May 2014 19:02:00 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405141902.s4EJ20bE093156@svn.freebsd.org> From: Mark Johnston Date: Wed, 14 May 2014 19:02:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266082 - head/cddl/lib/libdtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 19:02:01 -0000 Author: markj Date: Wed May 14 19:02:00 2014 New Revision: 266082 URL: http://svnweb.freebsd.org/changeset/base/266082 Log: Bind ip/tcp/udp provider translators and symbols to the same versions as in illumos, rather than using "1.0" everywhere. Some of the translators use D functions that are not present in version 1.0 (e.g. inet_ntoa()) which can result in libdtrace crashing when running scripts that restrict themselves to version 1.0 (e.g. with "-x version=1.0"). MFC after: 1 week Modified: head/cddl/lib/libdtrace/ip.d head/cddl/lib/libdtrace/tcp.d head/cddl/lib/libdtrace/udp.d Modified: head/cddl/lib/libdtrace/ip.d ============================================================================== --- head/cddl/lib/libdtrace/ip.d Wed May 14 19:00:01 2014 (r266081) +++ head/cddl/lib/libdtrace/ip.d Wed May 14 19:02:00 2014 (r266082) @@ -125,53 +125,53 @@ typedef struct ipv6info { ip6_t *ipv6_hdr; /* pointer to raw header */ } ipv6info_t; -#pragma D binding "1.0" IPPROTO_IP +#pragma D binding "1.5" IPPROTO_IP inline short IPPROTO_IP = 0; -#pragma D binding "1.0" IPPROTO_ICMP +#pragma D binding "1.5" IPPROTO_ICMP inline short IPPROTO_ICMP = 1; -#pragma D binding "1.0" IPPROTO_IGMP +#pragma D binding "1.5" IPPROTO_IGMP inline short IPPROTO_IGMP = 2; -#pragma D binding "1.0" IPPROTO_IPV4 +#pragma D binding "1.5" IPPROTO_IPV4 inline short IPPROTO_IPV4 = 4; -#pragma D binding "1.0" IPPROTO_TCP +#pragma D binding "1.5" IPPROTO_TCP inline short IPPROTO_TCP = 6; -#pragma D binding "1.0" IPPROTO_UDP +#pragma D binding "1.5" IPPROTO_UDP inline short IPPROTO_UDP = 17; -#pragma D binding "1.0" IPPROTO_IPV6 +#pragma D binding "1.5" IPPROTO_IPV6 inline short IPPROTO_IPV6 = 41; -#pragma D binding "1.0" IPPROTO_ROUTING +#pragma D binding "1.5" IPPROTO_ROUTING inline short IPPROTO_ROUTING = 43; -#pragma D binding "1.0" IPPROTO_FRAGMENT +#pragma D binding "1.5" IPPROTO_FRAGMENT inline short IPPROTO_FRAGMENT = 44; -#pragma D binding "1.0" IPPROTO_RSVP +#pragma D binding "1.5" IPPROTO_RSVP inline short IPPROTO_RSVP = 46; -#pragma D binding "1.0" IPPROTO_GRE +#pragma D binding "1.5" IPPROTO_GRE inline short IPPROTO_GRE = 47; -#pragma D binding "1.0" IPPROTO_ESP +#pragma D binding "1.5" IPPROTO_ESP inline short IPPROTO_ESP = 50; -#pragma D binding "1.0" IPPROTO_AH +#pragma D binding "1.5" IPPROTO_AH inline short IPPROTO_AH = 51; -#pragma D binding "1.0" IPPROTO_MOBILE +#pragma D binding "1.5" IPPROTO_MOBILE inline short IPPROTO_MOBILE = 55; -#pragma D binding "1.0" IPPROTO_ICMPV6 +#pragma D binding "1.5" IPPROTO_ICMPV6 inline short IPPROTO_ICMPV6 = 58; -#pragma D binding "1.0" IPPROTO_DSTOPTS +#pragma D binding "1.5" IPPROTO_DSTOPTS inline short IPPROTO_DSTOPTS = 60; -#pragma D binding "1.0" IPPROTO_ETHERIP +#pragma D binding "1.5" IPPROTO_ETHERIP inline short IPPROTO_ETHERIP = 97; -#pragma D binding "1.0" IPPROTO_PIM +#pragma D binding "1.5" IPPROTO_PIM inline short IPPROTO_PIM = 103; -#pragma D binding "1.0" IPPROTO_IPCOMP +#pragma D binding "1.5" IPPROTO_IPCOMP inline short IPPROTO_IPCOMP = 108; -#pragma D binding "1.0" IPPROTO_SCTP +#pragma D binding "1.5" IPPROTO_SCTP inline short IPPROTO_SCTP = 132; -#pragma D binding "1.0" IPPROTO_RAW +#pragma D binding "1.5" IPPROTO_RAW inline short IPPROTO_RAW = 255; inline uint8_t INP_IPV4 = 0x01; inline uint8_t INP_IPV6 = 0x02; -#pragma D binding "1.0" protocols +#pragma D binding "1.5" protocols inline string protocols[int proto] = proto == IPPROTO_IP ? "IP" : proto == IPPROTO_ICMP ? "ICMP" : @@ -200,12 +200,12 @@ inline string protocols[int proto] = * This field is always NULL according to the current definition of the ip * probes. */ -#pragma D binding "1.0" translator +#pragma D binding "1.5" translator translator pktinfo_t < void *p > { pkt_addr = NULL; }; -#pragma D binding "1.0" translator +#pragma D binding "1.5" translator translator csinfo_t < void *p > { cs_addr = NULL; cs_cid = (uint64_t)p; @@ -213,7 +213,7 @@ translator csinfo_t < void *p > { cs_zoneid = 0; }; -#pragma D binding "1.0" translator +#pragma D binding "1.6.3" translator translator csinfo_t < struct inpcb *p > { cs_addr = NULL; cs_cid = (uint64_t)p; @@ -221,7 +221,7 @@ translator csinfo_t < struct inpcb *p > cs_zoneid = 0; }; -#pragma D binding "1.0" translator +#pragma D binding "1.5" translator translator ipinfo_t < uint8_t *p > { ip_ver = p == NULL ? 0 : ((struct ip *)p)->ip_v; ip_plength = p == NULL ? 0 : @@ -238,17 +238,17 @@ translator ipinfo_t < uint8_t *p > { inet_ntoa6(&((struct ip6_hdr *)p)->ip6_dst); }; -#pragma D binding "1.0" IFF_LOOPBACK +#pragma D binding "1.5" IFF_LOOPBACK inline int IFF_LOOPBACK = 0x8; -#pragma D binding "1.0" translator +#pragma D binding "1.5" translator translator ifinfo_t < struct ifnet *p > { if_name = p->if_xname; if_local = (p->if_flags & IFF_LOOPBACK) == 0 ? 0 : 1; if_addr = (uintptr_t)p; }; -#pragma D binding "1.0" translator +#pragma D binding "1.5" translator translator ipv4info_t < struct ip *p > { ipv4_ver = p == NULL ? 0 : p->ip_v; ipv4_ihl = p == NULL ? 0 : p->ip_hl; @@ -268,7 +268,7 @@ translator ipv4info_t < struct ip *p > { ipv4_hdr = (ipha_t *)p; }; -#pragma D binding "1.0" translator +#pragma D binding "1.5" translator translator ipv6info_t < struct ip6_hdr *p > { ipv6_ver = p == NULL ? 0 : (ntohl(p->ip6_ctlun.ip6_un1.ip6_un1_flow) & 0xf0000000) >> 28; ipv6_tclass = p == NULL ? 0 : (ntohl(p->ip6_ctlun.ip6_un1.ip6_un1_flow) & 0x0ff00000) >> 20; Modified: head/cddl/lib/libdtrace/tcp.d ============================================================================== --- head/cddl/lib/libdtrace/tcp.d Wed May 14 19:00:01 2014 (r266081) +++ head/cddl/lib/libdtrace/tcp.d Wed May 14 19:02:00 2014 (r266082) @@ -31,49 +31,49 @@ /* * Convert a TCP state value to a string. */ -#pragma D binding "1.0" TCPS_CLOSED +#pragma D binding "1.6.3" TCPS_CLOSED inline int TCPS_CLOSED = 0; -#pragma D binding "1.0" TCPS_LISTEN +#pragma D binding "1.6.3" TCPS_LISTEN inline int TCPS_LISTEN = 1; -#pragma D binding "1.0" TCPS_SYN_SENT +#pragma D binding "1.6.3" TCPS_SYN_SENT inline int TCPS_SYN_SENT = 2; -#pragma D binding "1.0" TCPS_SYN_RECEIVED +#pragma D binding "1.6.3" TCPS_SYN_RECEIVED inline int TCPS_SYN_RECEIVED = 3; -#pragma D binding "1.0" TCPS_ESTABLISHED +#pragma D binding "1.6.3" TCPS_ESTABLISHED inline int TCPS_ESTABLISHED = 4; -#pragma D binding "1.0" TCPS_CLOSE_WAIT +#pragma D binding "1.6.3" TCPS_CLOSE_WAIT inline int TCPS_CLOSE_WAIT = 5; -#pragma D binding "1.0" TCPS_FIN_WAIT_1 +#pragma D binding "1.6.3" TCPS_FIN_WAIT_1 inline int TCPS_FIN_WAIT_1 = 6; -#pragma D binding "1.0" TCPS_CLOSING +#pragma D binding "1.6.3" TCPS_CLOSING inline int TCPS_CLOSING = 7; -#pragma D binding "1.0" TCPS_LAST_ACK +#pragma D binding "1.6.3" TCPS_LAST_ACK inline int TCPS_LAST_ACK = 8; -#pragma D binding "1.0" TCPS_FIN_WAIT_2 +#pragma D binding "1.6.3" TCPS_FIN_WAIT_2 inline int TCPS_FIN_WAIT_2 = 9; -#pragma D binding "1.0" TCPS_TIME_WAIT +#pragma D binding "1.6.3" TCPS_TIME_WAIT inline int TCPS_TIME_WAIT = 10; /* TCP segment flags. */ -#pragma D binding "1.0" TH_FIN +#pragma D binding "1.6.3" TH_FIN inline uint8_t TH_FIN = 0x01; -#pragma D binding "1.0" TH_SYN +#pragma D binding "1.6.3" TH_SYN inline uint8_t TH_SYN = 0x02; -#pragma D binding "1.0" TH_RST +#pragma D binding "1.6.3" TH_RST inline uint8_t TH_RST = 0x04; -#pragma D binding "1.0" TH_PUSH +#pragma D binding "1.6.3" TH_PUSH inline uint8_t TH_PUSH = 0x08; -#pragma D binding "1.0" TH_ACK +#pragma D binding "1.6.3" TH_ACK inline uint8_t TH_ACK = 0x10; -#pragma D binding "1.0" TH_URG +#pragma D binding "1.6.3" TH_URG inline uint8_t TH_URG = 0x20; -#pragma D binding "1.0" TH_ECE +#pragma D binding "1.6.3" TH_ECE inline uint8_t TH_ECE = 0x40; -#pragma D binding "1.0" TH_CWR +#pragma D binding "1.6.3" TH_CWR inline uint8_t TH_CWR = 0x80; /* TCP connection state strings. */ -#pragma D binding "1.0" tcp_state_string +#pragma D binding "1.6.3" tcp_state_string inline string tcp_state_string[int32_t state] = state == TCPS_CLOSED ? "state-closed" : state == TCPS_LISTEN ? "state-listen" : @@ -160,7 +160,7 @@ typedef struct tcpinfoh { struct tcphdr *tcp_hdr; /* raw TCP header */ } tcpinfoh_t; -#pragma D binding "1.0" translator +#pragma D binding "1.6.3" translator translator csinfo_t < struct tcpcb *p > { cs_addr = NULL; cs_cid = (uint64_t)(p == NULL ? 0 : p->t_inpcb); @@ -168,7 +168,7 @@ translator csinfo_t < struct tcpcb *p > cs_zoneid = 0; }; -#pragma D binding "1.0" translator +#pragma D binding "1.6.3" translator translator tcpsinfo_t < struct tcpcb *p > { tcps_addr = (uintptr_t)p; tcps_local = -1; /* XXX */ @@ -202,7 +202,7 @@ translator tcpsinfo_t < struct tcpcb *p tcps_retransmit = p == NULL ? -1 : p->t_rxtshift > 0 ? 1 : 0; }; -#pragma D binding "1.0" translator +#pragma D binding "1.6.3" translator translator tcpinfo_t < struct tcphdr *p > { tcp_sport = p == NULL ? 0 : ntohs(p->th_sport); tcp_dport = p == NULL ? 0 : ntohs(p->th_dport); @@ -221,7 +221,7 @@ translator tcpinfo_t < struct tcphdr *p * number, acknowledgement number, window size and urgent pointer are already * in host order and thus don't need to be converted. */ -#pragma D binding "1.0" translator +#pragma D binding "1.6.3" translator translator tcpinfoh_t < struct tcphdr *p > { tcp_sport = p == NULL ? 0 : ntohs(p->th_sport); tcp_dport = p == NULL ? 0 : ntohs(p->th_dport); @@ -235,7 +235,7 @@ translator tcpinfoh_t < struct tcphdr *p tcp_hdr = (struct tcphdr *)p; }; -#pragma D binding "1.0" translator +#pragma D binding "1.6.3" translator translator tcplsinfo_t < int s > { tcps_state = s; }; Modified: head/cddl/lib/libdtrace/udp.d ============================================================================== --- head/cddl/lib/libdtrace/udp.d Wed May 14 19:00:01 2014 (r266081) +++ head/cddl/lib/libdtrace/udp.d Wed May 14 19:02:00 2014 (r266082) @@ -50,7 +50,7 @@ typedef struct udpinfo { struct udphdr *udp_hdr; /* raw UDP header */ } udpinfo_t; -#pragma D binding "1.0" translator +#pragma D binding "1.6.3" translator translator udpsinfo_t < struct inpcb *p > { udps_addr = (uintptr_t)p; udps_lport = p == NULL ? 0 : ntohs(p->inp_inc.inc_ie.ie_lport); @@ -65,7 +65,7 @@ translator udpsinfo_t < struct inpcb *p inet_ntoa6(&p->inp_inc.inc_ie.ie_dependfaddr.ie6_foreign); }; -#pragma D binding "1.0" translator +#pragma D binding "1.6.3" translator translator udpinfo_t < struct udphdr *p > { udp_sport = p == NULL ? 0 : ntohs(p->uh_sport); udp_dport = p == NULL ? 0 : ntohs(p->uh_dport); From owner-svn-src-head@FreeBSD.ORG Wed May 14 19:11:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20120598; Wed, 14 May 2014 19:11:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D6E5203E; Wed, 14 May 2014 19:11:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4EJBFoj097828; Wed, 14 May 2014 19:11:15 GMT (envelope-from markm@svn.freebsd.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EJBFZZ097826; Wed, 14 May 2014 19:11:15 GMT (envelope-from markm@svn.freebsd.org) Message-Id: <201405141911.s4EJBFZZ097826@svn.freebsd.org> From: Mark Murray Date: Wed, 14 May 2014 19:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266083 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 19:11:16 -0000 Author: markm Date: Wed May 14 19:11:15 2014 New Revision: 266083 URL: http://svnweb.freebsd.org/changeset/base/266083 Log: Give suitably-endowed ARMs a register similar to the x86 TSC register. Here, "suitably endowed" means that the System Control Coprocessor (#15) has Performance Monitoring Registers, including a CCNT (Cycle Count) register. The CCNT register is used in a way similar to the TSC register in x86 processors by the get_cyclecount(9) function. The entropy-harvesting thread is a heavy user of this function, and will benefit from not having to call binuptime(9) instead. One problem with the CCNT register is that it is 32-bit only, so the upper 32-bits of the returned number are always 0. The entropy harvester does not care, but in case any one else does, follow-up work may include an interrup trap to increment an upper-32-bit counter on CCNT overflow. Another problem is that the CCNT register is not readable in user-mode code; in can be made readable by userland, but then it is also writable, and so is a good chunk of the PMU system. For that reason, the CCNT is not enabled for user-mode access in this commit. Like the x86, there is one CCNT per core, so they don't all run in perfect sync. Reviewed by: ian@ (an earlier version) Tested by: ian@ (same earlier version) Committed from: WANDBOARD-QUAD Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/include/cpu.h Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Wed May 14 19:02:00 2014 (r266082) +++ head/sys/arm/arm/cpufunc.c Wed May 14 19:11:15 2014 (r266083) @@ -1398,6 +1398,37 @@ arm10_setup(args) } #endif /* CPU_ARM9E || CPU_ARM10 */ +#if defined(CPU_ARM1136) || defined(CPU_ARM1176) \ + || defined(CPU_MV_PJ4B) \ + || defined(CPU_CORTEXA) || defined(CPU_KRAIT) +static __inline void +cpu_scc_setup_ccnt(void) +{ +/* This is how you give userland access to the CCNT and PMCn + * registers. + * BEWARE! This gives write access also, which may not be what + * you want! + */ +#ifdef _PMC_USER_READ_WRITE_ + /* Set PMUSERENR[0] to allow userland access */ + __asm volatile ("mcr p15, 0, %0, c9, c14, 0\n\t" + : + : "r"(0x00000001)); +#endif + /* Set up the PMCCNTR register as a cyclecounter: + * Set PMINTENCLR to 0xFFFFFFFF to block interrupts + * Set PMCR[2,0] to enable counters and reset CCNT + * Set PMCNTENSET to 0x80000000 to enable CCNT */ + __asm volatile ("mcr p15, 0, %0, c9, c14, 2\n\t" + "mcr p15, 0, %1, c9, c12, 0\n\t" + "mcr p15, 0, %2, c9, c12, 1\n\t" + : + : "r"(0xFFFFFFFF), + "r"(0x00000005), + "r"(0x80000000)); +} +#endif + #if defined(CPU_ARM1136) || defined(CPU_ARM1176) struct cpu_option arm11_options[] = { { "cpu.cache", BIC, OR, (CPU_CONTROL_IC_ENABLE | CPU_CONTROL_DC_ENABLE) }, @@ -1501,6 +1532,8 @@ arm11x6_setup(char *args) /* And again. */ cpu_idcache_wbinv_all(); + + cpu_scc_setup_ccnt(); } #endif /* CPU_ARM1136 || CPU_ARM1176 */ @@ -1535,6 +1568,8 @@ pj4bv7_setup(args) /* And again. */ cpu_idcache_wbinv_all(); + + cpu_scc_setup_ccnt(); } #endif /* CPU_MV_PJ4B */ @@ -1582,6 +1617,8 @@ cortexa_setup(char *args) #ifdef SMP armv7_auxctrl((1 << 6) | (1 << 0), (1 << 6) | (1 << 0)); /* Enable SMP + TLB broadcasting */ #endif + + cpu_scc_setup_ccnt(); } #endif /* CPU_CORTEXA */ Modified: head/sys/arm/include/cpu.h ============================================================================== --- head/sys/arm/include/cpu.h Wed May 14 19:02:00 2014 (r266082) +++ head/sys/arm/include/cpu.h Wed May 14 19:11:15 2014 (r266083) @@ -14,11 +14,26 @@ void swi_vm(void *); static __inline uint64_t get_cyclecount(void) { +/* This '#if' asks the question 'Does CP15/SCC include performance counters?' */ +#if defined(CPU_ARM1136) || defined(CPU_ARM1176) \ + || defined(CPU_MV_PJ4B) \ + || defined(CPU_CORTEXA) || defined(CPU_KRAIT) + uint32_t ccnt; + uint64_t ccnt64; + + /* + * Read PMCCNTR. Curses! Its only 32 bits. + * TODO: Fix this by catching overflow with interrupt? + */ + __asm __volatile("mrc p15, 0, %0, c9, c13, 0": "=r" (ccnt)); + ccnt64 = (uint64_t)ccnt; + return (ccnt64); +#else /* No performance counters, so use binuptime(9). This is slooooow */ struct bintime bt; binuptime(&bt); return ((uint64_t)bt.sec << 56 | bt.frac >> 8); - +#endif } #endif From owner-svn-src-head@FreeBSD.ORG Wed May 14 20:16:52 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 753B7710; Wed, 14 May 2014 20:16:52 +0000 (UTC) Received: from gw.catspoiler.org (gw.catspoiler.org [75.1.14.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39C6125ED; Wed, 14 May 2014 20:16:51 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s4EKGfOb084324; Wed, 14 May 2014 13:16:45 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201405142016.s4EKGfOb084324@gw.catspoiler.org> Date: Wed, 14 May 2014 13:16:41 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r265408 - in head: sys/netinet usr.bin/netstat To: glebius@FreeBSD.org In-Reply-To: <201405060000.s46007s6044383@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 20:16:52 -0000 On 6 May, Gleb Smirnoff wrote: > Author: glebius > Date: Tue May 6 00:00:07 2014 > New Revision: 265408 > URL: http://svnweb.freebsd.org/changeset/base/265408 > > Log: > - Remove net.inet.tcp.reass.overflows sysctl. It counts exactly > same events that tcpstat's tcps_rcvmemdrop counter counts. > - Rename tcps_rcvmemdrop to tcps_rcvreassfull and improve its > description in netstat(1) output. > > Sponsored by: Netflix > Sponsored by: Nginx, Inc. > > Modified: > head/sys/netinet/tcp_reass.c > head/sys/netinet/tcp_var.h > head/usr.bin/netstat/inet.c > > Modified: head/sys/netinet/tcp_var.h > ============================================================================== > --- head/sys/netinet/tcp_var.h Mon May 5 23:54:13 2014 (r265407) > +++ head/sys/netinet/tcp_var.h Tue May 6 00:00:07 2014 (r265408) > @@ -426,7 +426,7 @@ struct tcpstat { > uint64_t tcps_rcvbyte; /* bytes received in sequence */ > uint64_t tcps_rcvbadsum; /* packets received with ccksum errs */ > uint64_t tcps_rcvbadoff; /* packets received with bad offset */ > - uint64_t tcps_rcvmemdrop; /* packets dropped for lack of memory */ > + uint64_t tcps_rcvreassfull; /* packets dropped for no reass space */ > uint64_t tcps_rcvshort; /* packets received too short */ > uint64_t tcps_rcvduppack; /* duplicate-only packets received */ > uint64_t tcps_rcvdupbyte; /* duplicate-only bytes received */ This broke emulators/wine: cc -c -I. -I. -I../../include -I../../include -D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Wstrict-prototypes -Wtype-limits -Wwrite-strings -Wpointer-arith -fno-omit-frame-pointer -I/usr/local/include -O2 -pipe -march=athlon64 -fno-strict-aliasing -o ipstats.o ipstats.c ipstats.c:1109:92: error: no member named 'tcps_rcvmemdrop' in 'struct tcpstat'; did you mean 'tcps_listendrop'? ...+ tcp_stat.tcps_rcvbadoff + tcp_stat.tcps_rcvmemdrop + tcp_stat.tcps_rcv... ^~~~~~~~~~~~~~~ I think this needs a __FreeBSD_version 1100020 and/or the addition of a #define as a compatiblity crutch. From owner-svn-src-head@FreeBSD.ORG Wed May 14 21:45:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4570B3BC; Wed, 14 May 2014 21:45:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 191272DC1; Wed, 14 May 2014 21:45:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4ELjGHp072957; Wed, 14 May 2014 21:45:16 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ELjGbj072956; Wed, 14 May 2014 21:45:16 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201405142145.s4ELjGbj072956@svn.freebsd.org> From: Warren Block Date: Wed, 14 May 2014 21:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266091 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 21:45:17 -0000 Author: wblock (doc committer) Date: Wed May 14 21:45:16 2014 New Revision: 266091 URL: http://svnweb.freebsd.org/changeset/base/266091 Log: Connect vt.4 to the build. Reviewed by: emaste Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed May 14 20:49:10 2014 (r266090) +++ head/share/man/man4/Makefile Wed May 14 21:45:16 2014 (r266091) @@ -565,6 +565,7 @@ MAN= aac.4 \ ${_vmx.4} \ vpo.4 \ vr.4 \ + vt.4 \ vte.4 \ ${_vtnet.4} \ ${_vxge.4} \ From owner-svn-src-head@FreeBSD.ORG Wed May 14 21:54:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6412F733; Wed, 14 May 2014 21:54:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51AB32EAF; Wed, 14 May 2014 21:54:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4ELsF4X077099; Wed, 14 May 2014 21:54:15 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ELsE1w077095; Wed, 14 May 2014 21:54:14 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405142154.s4ELsE1w077095@svn.freebsd.org> From: Luiz Otavio O Souza Date: Wed, 14 May 2014 21:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266092 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 21:54:15 -0000 Author: loos Date: Wed May 14 21:54:14 2014 New Revision: 266092 URL: http://svnweb.freebsd.org/changeset/base/266092 Log: gpioiic.4 and gpioled.4 will first appear in 10.1-RELEASE. Modified: head/share/man/man4/gpioiic.4 head/share/man/man4/gpioled.4 Modified: head/share/man/man4/gpioiic.4 ============================================================================== --- head/share/man/man4/gpioiic.4 Wed May 14 21:45:16 2014 (r266091) +++ head/share/man/man4/gpioiic.4 Wed May 14 21:54:14 2014 (r266092) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2014 +.Dd May 14, 2014 .Dt GPIOIIC 4 .Os .Sh NAME @@ -164,7 +164,7 @@ Optional, defaults to 1. The .Nm manual page first appeared in -.Fx 11.0 . +.Fx 10.1 . .Sh AUTHORS This manual page was written by Modified: head/share/man/man4/gpioled.4 ============================================================================== --- head/share/man/man4/gpioled.4 Wed May 14 21:45:16 2014 (r266091) +++ head/share/man/man4/gpioled.4 Wed May 14 21:54:14 2014 (r266092) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2014 +.Dd May 14, 2014 .Dt GPIOLED 4 .Os .Sh NAME @@ -149,7 +149,7 @@ to create for The .Nm manual page first appeared in -.Fx 11.0 . +.Fx 10.1 . .Sh AUTHORS This manual page was written by From owner-svn-src-head@FreeBSD.ORG Wed May 14 22:24:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3842BC62; Wed, 14 May 2014 22:24:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23A7E2121; Wed, 14 May 2014 22:24:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4EMOAUY091342; Wed, 14 May 2014 22:24:10 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4EMOAOI091338; Wed, 14 May 2014 22:24:10 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405142224.s4EMOAOI091338@svn.freebsd.org> From: Neel Natu Date: Wed, 14 May 2014 22:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266093 - in head/sys/amd64: amd64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 22:24:11 -0000 Author: neel Date: Wed May 14 22:24:09 2014 New Revision: 266093 URL: http://svnweb.freebsd.org/changeset/base/266093 Log: Increase the TSS limit by one byte. The processor requires an additional byte with all bits set to 1 beyond the I/O permission bitmap. Prior to this change accessing I/O ports [0xFFF8-0xFFFF] would trigger a #GP fault even though the I/O bitmap allowed access to those ports. For more details see section "I/O Permission Bit Map" in the Intel SDM, Vol 1. Reviewed by: kib Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/sys_machdep.c head/sys/amd64/include/param.h Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Wed May 14 21:54:14 2014 (r266092) +++ head/sys/amd64/amd64/machdep.c Wed May 14 22:24:09 2014 (r266093) @@ -1147,7 +1147,7 @@ struct soft_segment_descriptor gdt_segs[ .ssd_gran = 1 }, /* GPROC0_SEL 9 Proc 0 Tss Descriptor */ { .ssd_base = 0x0, - .ssd_limit = sizeof(struct amd64tss) + IOPAGES * PAGE_SIZE - 1, + .ssd_limit = sizeof(struct amd64tss) + IOPERM_BITMAP_SIZE - 1, .ssd_type = SDT_SYSTSS, .ssd_dpl = SEL_KPL, .ssd_p = 1, @@ -2003,8 +2003,7 @@ hammer_time(u_int64_t modulep, u_int64_t common_tss[0].tss_ist2 = (long) np; /* Set the IO permission bitmap (empty due to tss seg limit) */ - common_tss[0].tss_iobase = sizeof(struct amd64tss) + - IOPAGES * PAGE_SIZE; + common_tss[0].tss_iobase = sizeof(struct amd64tss) + IOPERM_BITMAP_SIZE; gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); ltr(gsel_tss); Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Wed May 14 21:54:14 2014 (r266092) +++ head/sys/amd64/amd64/mp_machdep.c Wed May 14 22:24:09 2014 (r266093) @@ -637,7 +637,7 @@ init_secondary(void) common_tss[cpu] = common_tss[0]; common_tss[cpu].tss_rsp0 = 0; /* not used until after switch */ common_tss[cpu].tss_iobase = sizeof(struct amd64tss) + - IOPAGES * PAGE_SIZE; + IOPERM_BITMAP_SIZE; common_tss[cpu].tss_ist1 = (long)&doublefault_stack[PAGE_SIZE]; /* The NMI stack runs on IST2. */ Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Wed May 14 21:54:14 2014 (r266092) +++ head/sys/amd64/amd64/sys_machdep.c Wed May 14 22:24:09 2014 (r266093) @@ -338,7 +338,6 @@ amd64_set_ioperm(td, uap) char *iomap; struct amd64tss *tssp; struct system_segment_descriptor *tss_sd; - u_long *addr; struct pcb *pcb; if ((error = priv_check(td, PRIV_IO)) != 0) @@ -361,9 +360,7 @@ amd64_set_ioperm(td, uap) if (tssp == NULL) return (ENOMEM); iomap = (char *)&tssp[1]; - addr = (u_long *)iomap; - for (i = 0; i < (ctob(IOPAGES) + 1) / sizeof(u_long); i++) - *addr++ = ~0; + memset(iomap, 0xff, IOPERM_BITMAP_SIZE); critical_enter(); /* Takes care of tss_rsp0. */ memcpy(tssp, &common_tss[PCPU_GET(cpuid)], Modified: head/sys/amd64/include/param.h ============================================================================== --- head/sys/amd64/include/param.h Wed May 14 21:54:14 2014 (r266092) +++ head/sys/amd64/include/param.h Wed May 14 22:24:09 2014 (r266093) @@ -120,6 +120,12 @@ #define MAXPAGESIZES 3 /* maximum number of supported page sizes */ #define IOPAGES 2 /* pages of i/o permission bitmap */ +/* + * I/O permission bitmap has a bit for each I/O port plus an additional + * byte at the end with all bits set. See section "I/O Permission Bit Map" + * in the Intel SDM for more details. + */ +#define IOPERM_BITMAP_SIZE (IOPAGES * PAGE_SIZE + 1) #ifndef KSTACK_PAGES #define KSTACK_PAGES 4 /* pages of kstack (with pcb) */ From owner-svn-src-head@FreeBSD.ORG Thu May 15 01:06:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 907B9600; Thu, 15 May 2014 01:06:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 715042E93; Thu, 15 May 2014 01:06:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4F16SBB063495; Thu, 15 May 2014 01:06:28 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4F16SnX063494; Thu, 15 May 2014 01:06:28 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201405150106.s4F16SnX063494@svn.freebsd.org> From: Peter Grehan Date: Thu, 15 May 2014 01:06:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266103 - head/sys/cddl/dev/dtrace/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 01:06:28 -0000 Author: grehan Date: Thu May 15 01:06:27 2014 New Revision: 266103 URL: http://svnweb.freebsd.org/changeset/base/266103 Log: Update dis_tables.c to the latest Illumos version. This includes decodes of recent Intel instructions, in particular VT-x and related instructions. This allows the FBT provider to locate the exit points of routines that include these new instructions. Illumos issues: 3414 Need a new word of AT_SUN_HWCAP bits 3415 Add isainfo support for f16c and rdrand 3416 Need disassembler support for rdrand and f16c 3413 isainfo -v overflows 80 columns 3417 mdb disassembler confuses rdtscp for invlpg 1518 dis should support AMD SVM/AMD-V/Pacifica instructions 1096 i386 disassembler should understand complex nops 1362 add kvmstat for monitoring of KVM statistics 1363 add vmregs[] variable to DTrace 1364 need disassembler support for VMX instructions 1365 mdb needs 16-bit disassembler support This corresponds to Illumos-gate (github) version eb23829ff08a873c612ac45d191d559394b4b408 Reviewed by: markj MFC after: 1 week Modified: head/sys/cddl/dev/dtrace/x86/dis_tables.c Modified: head/sys/cddl/dev/dtrace/x86/dis_tables.c ============================================================================== --- head/sys/cddl/dev/dtrace/x86/dis_tables.c Thu May 15 00:52:17 2014 (r266102) +++ head/sys/cddl/dev/dtrace/x86/dis_tables.c Thu May 15 01:06:27 2014 (r266103) @@ -21,6 +21,7 @@ */ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ /* @@ -104,16 +105,18 @@ enum { Mv, Mw, M, /* register or memory */ + MG9, /* register or memory in group 9 (prefix optional) */ Mb, /* register or memory, always byte sized */ MO, /* memory only (no registers) */ PREF, - SWAPGS, + SWAPGS_RDTSCP, MONITOR_MWAIT, R, RA, SEG, MR, RM, + RM_66r, /* RM, but with a required 0x66 prefix */ IA, MA, SD, @@ -228,7 +231,10 @@ enum { VEX_RRi, /* VEX mod_rm, imm8 -> mod_reg */ VEX_RM, /* VEX mod_reg -> mod_rm */ VEX_RRM, /* VEX VEX.vvvv, mod_reg -> mod_rm */ - VEX_RMX /* VEX VEX.vvvv, mod_rm -> mod_reg */ + VEX_RMX, /* VEX VEX.vvvv, mod_rm -> mod_reg */ + VMx, /* vmcall/vmlaunch/vmresume/vmxoff */ + VMxo, /* VMx instruction with optional prefix */ + SVM /* AMD SVM instructions */ }; /* @@ -496,8 +502,8 @@ const instable_t dis_op0F00[8] = { */ const instable_t dis_op0F01[8] = { -/* [0] */ TNSZ("sgdt",MO,6), TNSZ("sidt",MONITOR_MWAIT,6), TNSZ("lgdt",XGETBV_XSETBV,6), TNSZ("lidt",MO,6), -/* [4] */ TNSZ("smsw",M,2), INVALID, TNSZ("lmsw",M,2), TNS("invlpg",SWAPGS), +/* [0] */ TNSZ("sgdt",VMx,6), TNSZ("sidt",MONITOR_MWAIT,6), TNSZ("lgdt",XGETBV_XSETBV,6), TNSZ("lidt",SVM,6), +/* [4] */ TNSZ("smsw",M,2), INVALID, TNSZ("lmsw",M,2), TNS("invlpg",SWAPGS_RDTSCP), }; /* @@ -528,15 +534,44 @@ const instable_t dis_op0FBA[8] = { }; /* - * Decode table for 0x0FC7 opcode + * Decode table for 0x0FC7 opcode (group 9) */ const instable_t dis_op0FC7[8] = { /* [0] */ INVALID, TNS("cmpxchg8b",M), INVALID, INVALID, -/* [4] */ INVALID, INVALID, INVALID, INVALID, +/* [4] */ INVALID, INVALID, TNS("vmptrld",MG9), TNS("vmptrst",MG9), }; +/* + * Decode table for 0x0FC7 opcode (group 9) mode 3 + */ + +const instable_t dis_op0FC7m3[8] = { + +/* [0] */ INVALID, INVALID, INVALID, INVALID, +/* [4] */ INVALID, INVALID, TNS("rdrand",MG9), INVALID, +}; + +/* + * Decode table for 0x0FC7 opcode with 0x66 prefix + */ + +const instable_t dis_op660FC7[8] = { + +/* [0] */ INVALID, INVALID, INVALID, INVALID, +/* [4] */ INVALID, INVALID, TNS("vmclear",M), INVALID, +}; + +/* + * Decode table for 0x0FC7 opcode with 0xF3 prefix + */ + +const instable_t dis_opF30FC7[8] = { + +/* [0] */ INVALID, INVALID, INVALID, INVALID, +/* [4] */ INVALID, INVALID, TNS("vmxon",M), INVALID, +}; /* * Decode table for 0x0FC8 opcode -- 486 bswap instruction @@ -1147,7 +1182,7 @@ const instable_t dis_op0F38[256] = { /* [78] */ INVALID, INVALID, INVALID, INVALID, /* [7C] */ INVALID, INVALID, INVALID, INVALID, -/* [80] */ INVALID, INVALID, INVALID, INVALID, +/* [80] */ TNSy("invept", RM_66r), TNSy("invvpid", RM_66r),INVALID, INVALID, /* [84] */ INVALID, INVALID, INVALID, INVALID, /* [88] */ INVALID, INVALID, INVALID, INVALID, /* [8C] */ INVALID, INVALID, INVALID, INVALID, @@ -1193,7 +1228,7 @@ const instable_t dis_opAVX660F38[256] = /* [08] */ TNSZ("vpsignb",VEX_RMrX,16),TNSZ("vpsignw",VEX_RMrX,16),TNSZ("vpsignd",VEX_RMrX,16),TNSZ("vpmulhrsw",VEX_RMrX,16), /* [0C] */ TNSZ("vpermilps",VEX_RMrX,8),TNSZ("vpermilpd",VEX_RMrX,16),TNSZ("vtestps",VEX_RRI,8), TNSZ("vtestpd",VEX_RRI,16), -/* [10] */ INVALID, INVALID, INVALID, INVALID, +/* [10] */ INVALID, INVALID, INVALID, TNSZ("vcvtph2ps",VEX_MX,16), /* [14] */ INVALID, INVALID, INVALID, TNSZ("vptest",VEX_RRI,16), /* [18] */ TNSZ("vbroadcastss",VEX_MX,4),TNSZ("vbroadcastsd",VEX_MX,8),TNSZ("vbroadcastf128",VEX_MX,16),INVALID, /* [1C] */ TNSZ("vpabsb",VEX_MX,16),TNSZ("vpabsw",VEX_MX,16),TNSZ("vpabsd",VEX_MX,16),INVALID, @@ -1359,7 +1394,7 @@ const instable_t dis_opAVX660F3A[256] = /* [10] */ INVALID, INVALID, INVALID, INVALID, /* [14] */ TNSZ("vpextrb",VEX_RRi,8),TNSZ("vpextrw",VEX_RRi,16),TNSZ("vpextrd",VEX_RRi,16),TNSZ("vextractps",VEX_RM,16), /* [18] */ TNSZ("vinsertf128",VEX_RMRX,16),TNSZ("vextractf128",VEX_RX,16),INVALID, INVALID, -/* [1C] */ INVALID, INVALID, INVALID, INVALID, +/* [1C] */ INVALID, TNSZ("vcvtps2ph",VEX_RX,16), INVALID, INVALID, /* [20] */ TNSZ("vpinsrb",VEX_RMRX,8),TNSZ("vinsertps",VEX_RMRX,16),TNSZ("vpinsrd",VEX_RMRX,16),INVALID, /* [24] */ INVALID, INVALID, INVALID, INVALID, @@ -1446,7 +1481,7 @@ const instable_t dis_op0F[16][16] = { /* [10] */ TNSZ("movups",XMMO,16), TNSZ("movups",XMMOS,16),TNSZ("movlps",XMMO,8), TNSZ("movlps",XMMOS,8), /* [14] */ TNSZ("unpcklps",XMMO,16),TNSZ("unpckhps",XMMO,16),TNSZ("movhps",XMMOM,8),TNSZ("movhps",XMMOMS,8), /* [18] */ IND(dis_op0F18), INVALID, INVALID, INVALID, -/* [1C] */ INVALID, INVALID, INVALID, TS("nopw", Mw), +/* [1C] */ INVALID, INVALID, INVALID, TS("nop",Mw), }, { /* [20] */ TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), TSy("mov",SREG), /* [24] */ TSx("mov",SREG), INVALID, TSx("mov",SREG), INVALID, @@ -1475,7 +1510,7 @@ const instable_t dis_op0F[16][16] = { }, { /* [70] */ TNSZ("pshufw",MMOPM,8), TNS("psrXXX",MR), TNS("psrXXX",MR), TNS("psrXXX",MR), /* [74] */ TNSZ("pcmpeqb",MMO,8), TNSZ("pcmpeqw",MMO,8), TNSZ("pcmpeqd",MMO,8), TNS("emms",NORM), -/* [78] */ TNS("INVALID",XMMO), TNS("INVALID",XMMO), INVALID, INVALID, +/* [78] */ TNSy("vmread",RM), TNSy("vmwrite",MR), INVALID, INVALID, /* [7C] */ INVALID, INVALID, TNSZ("movd",MMOS,4), TNSZ("movq",MMOS,8), }, { /* [80] */ TNS("jo",D), TNS("jno",D), TNS("jb",D), TNS("jae",D), @@ -1859,14 +1894,14 @@ const instable_t dis_distable[16][16] = /* [1,C] */ TNS("sbbb",IA), TS("sbb",IA), TSx("push",SEG), TSx("pop",SEG), }, { /* [2,0] */ TNS("andb",RMw), TS("and",RMw), TNS("andb",MRw), TS("and",MRw), -/* [2,4] */ TNS("andb",IA), TS("and",IA), TNS("%es:",OVERRIDE), TNSx("daa",NORM), +/* [2,4] */ TNS("andb",IA), TS("and",IA), TNSx("%es:",OVERRIDE), TNSx("daa",NORM), /* [2,8] */ TNS("subb",RMw), TS("sub",RMw), TNS("subb",MRw), TS("sub",MRw), /* [2,C] */ TNS("subb",IA), TS("sub",IA), TNS("%cs:",OVERRIDE), TNSx("das",NORM), }, { /* [3,0] */ TNS("xorb",RMw), TS("xor",RMw), TNS("xorb",MRw), TS("xor",MRw), -/* [3,4] */ TNS("xorb",IA), TS("xor",IA), TNS("%ss:",OVERRIDE), TNSx("aaa",NORM), +/* [3,4] */ TNS("xorb",IA), TS("xor",IA), TNSx("%ss:",OVERRIDE), TNSx("aaa",NORM), /* [3,8] */ TNS("cmpb",RMw), TS("cmp",RMw), TNS("cmpb",MRw), TS("cmp",MRw), -/* [3,C] */ TNS("cmpb",IA), TS("cmp",IA), TNS("%ds:",OVERRIDE), TNSx("aas",NORM), +/* [3,C] */ TNS("cmpb",IA), TS("cmp",IA), TNSx("%ds:",OVERRIDE), TNSx("aas",NORM), }, { /* [4,0] */ TSx("inc",R), TSx("inc",R), TSx("inc",R), TSx("inc",R), /* [4,4] */ TSx("inc",R), TSx("inc",R), TSx("inc",R), TSx("inc",R), @@ -2905,6 +2940,7 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mod goto error; #endif switch (dp->it_adrmode) { + case RM_66r: case XMM_66r: case XMMM_66r: if (opnd_size_prefix == 0) { @@ -3054,6 +3090,59 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mod } break; + case MG9: + /* + * More horribleness: the group 9 (0xF0 0xC7) instructions are + * allowed an optional prefix of 0x66 or 0xF3. This is similar + * to the SIMD business described above, but with a different + * addressing mode (and an indirect table), so we deal with it + * separately (if similarly). + * + * Intel further complicated this with the release of Ivy Bridge + * where they overloaded these instructions based on the ModR/M + * bytes. The VMX instructions have a mode of 0 since they are + * memory instructions but rdrand instructions have a mode of + * 0b11 (REG_ONLY) because they only operate on registers. While + * there are different prefix formats, for now it is sufficient + * to use a single different table. + */ + + /* + * Calculate our offset in dis_op0FC7 (the group 9 table) + */ + if ((uintptr_t)dp - (uintptr_t)dis_op0FC7 > sizeof (dis_op0FC7)) + goto error; + + off = ((uintptr_t)dp - (uintptr_t)dis_op0FC7) / + sizeof (instable_t); + + /* + * If we have a mode of 0b11 then we have to rewrite this. + */ + dtrace_get_modrm(x, &mode, ®, &r_m); + if (mode == REG_ONLY) { + dp = (instable_t *)&dis_op0FC7m3[off]; + break; + } + + /* + * Rewrite if this instruction used one of the magic prefixes. + */ + if (rep_prefix) { + if (rep_prefix == 0xf3) + dp = (instable_t *)&dis_opF30FC7[off]; + else + goto error; + rep_prefix = 0; + } else if (opnd_size_prefix) { + dp = (instable_t *)&dis_op660FC7[off]; + opnd_size_prefix = 0; + if (opnd_size == SIZE16) + opnd_size = SIZE32; + } + break; + + case MMOSH: /* * As with the "normal" SIMD instructions, the MMX @@ -3434,14 +3523,21 @@ just_mem: dtrace_get_operand(x, mode, r_m, wbit, 0); break; - case SWAPGS: + case SWAPGS_RDTSCP: if (cpu_mode == SIZE64 && mode == 3 && r_m == 0) { #ifdef DIS_TEXT (void) strncpy(x->d86_mnem, "swapgs", OPLEN); #endif NOMEM; break; + } else if (mode == 3 && r_m == 1) { +#ifdef DIS_TEXT + (void) strncpy(x->d86_mnem, "rdtscp", OPLEN); +#endif + NOMEM; + break; } + /*FALLTHROUGH*/ /* prefetch instruction - memory operand, but no memory acess */ @@ -3451,6 +3547,7 @@ just_mem: /* single memory or register operand */ case M: + case MG9: wbit = LONG_OPND; goto just_mem; @@ -3459,6 +3556,76 @@ just_mem: wbit = BYTE_OPND; goto just_mem; + case VMx: + if (mode == 3) { +#ifdef DIS_TEXT + char *vminstr; + + switch (r_m) { + case 1: + vminstr = "vmcall"; + break; + case 2: + vminstr = "vmlaunch"; + break; + case 3: + vminstr = "vmresume"; + break; + case 4: + vminstr = "vmxoff"; + break; + default: + goto error; + } + + (void) strncpy(x->d86_mnem, vminstr, OPLEN); +#else + if (r_m < 1 || r_m > 4) + goto error; +#endif + + NOMEM; + break; + } + /*FALLTHROUGH*/ + case SVM: + if (mode == 3) { +#ifdef DIS_TEXT + char *vinstr; + + switch (r_m) { + case 0: + vinstr = "vmrun"; + break; + case 1: + vinstr = "vmmcall"; + break; + case 2: + vinstr = "vmload"; + break; + case 3: + vinstr = "vmsave"; + break; + case 4: + vinstr = "stgi"; + break; + case 5: + vinstr = "clgi"; + break; + case 6: + vinstr = "skinit"; + break; + case 7: + vinstr = "invlpga"; + break; + } + + (void) strncpy(x->d86_mnem, vinstr, OPLEN); +#endif + NOMEM; + break; + } + /*FALLTHROUGH*/ case MONITOR_MWAIT: if (mode == 3) { if (r_m == 0) { @@ -3597,6 +3764,7 @@ just_mem: break; case RM: + case RM_66r: wbit = LONG_OPND; STANDARD_MODRM(x, mode, reg, r_m, rex_prefix, wbit, 1); break; @@ -4300,7 +4468,8 @@ L_VEX_MX: dtrace_get_operand(x, REG_ONLY, reg, XMM_OPND, 1); dtrace_get_operand(x, mode, r_m, wbit, 0); } else if ((dp == &dis_opAVXF30F[0xE6]) || - (dp == &dis_opAVX0F[0x5][0xA])) { + (dp == &dis_opAVX0F[0x5][0xA]) || + (dp == &dis_opAVX660F38[0x13])) { /* vcvtdq2pd , */ /* or vcvtps2pd , */ dtrace_get_operand(x, REG_ONLY, reg, wbit, 1); @@ -4385,7 +4554,9 @@ L_VEX_MX: case VEX_RX: /* ModR/M.rm := op(ModR/M.reg) */ - if (dp == &dis_opAVX660F3A[0x19]) { /* vextractf128 */ + /* vextractf128 || vcvtps2ph */ + if (dp == &dis_opAVX660F3A[0x19] || + dp == &dis_opAVX660F3A[0x1d]) { x->d86_numopnds = 3; dtrace_get_modrm(x, &mode, ®, &r_m); From owner-svn-src-head@FreeBSD.ORG Thu May 15 01:27:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B67DF103; Thu, 15 May 2014 01:27:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3D76210B; Thu, 15 May 2014 01:27:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4F1RP6v072769; Thu, 15 May 2014 01:27:25 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4F1RPxK072767; Thu, 15 May 2014 01:27:25 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405150127.s4F1RPxK072767@svn.freebsd.org> From: Warner Losh Date: Thu, 15 May 2014 01:27:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266104 - head/usr.bin/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 01:27:25 -0000 Author: imp Date: Thu May 15 01:27:24 2014 New Revision: 266104 URL: http://svnweb.freebsd.org/changeset/base/266104 Log: Undo changes to the generated Makefile. Move tests directory to proper location, including updating the test to work in the more-fragile fmake -> bmake bootstrap environment. Modified: head/usr.bin/bmake/Makefile head/usr.bin/bmake/Makefile.inc Modified: head/usr.bin/bmake/Makefile ============================================================================== --- head/usr.bin/bmake/Makefile Thu May 15 01:06:27 2014 (r266103) +++ head/usr.bin/bmake/Makefile Thu May 15 01:27:24 2014 (r266104) @@ -3,7 +3,6 @@ # # $FreeBSD$ -.include .sinclude "Makefile.inc" SRCTOP?= ${.CURDIR:H:H} @@ -107,11 +106,6 @@ COPTS.meta.c += -DHAVE_FILEMON_H -I${FIL SUBDIR+= unit-tests .endif -.if ${MK_TESTS} != no -SUBDIR+= tests -.endif - - MAN= ${PROG}.1 MAN1= ${MAN} Modified: head/usr.bin/bmake/Makefile.inc ============================================================================== --- head/usr.bin/bmake/Makefile.inc Thu May 15 01:06:27 2014 (r266103) +++ head/usr.bin/bmake/Makefile.inc Thu May 15 01:27:24 2014 (r266104) @@ -13,5 +13,9 @@ PROG= make NO_SHARED?= YES .endif +.if defined(MK_TESTS) && ${MK_TESTS} != no +SUBDIR+= tests +.endif + WARNS=3 CFLAGS+= -DNO_PWD_OVERRIDE From owner-svn-src-head@FreeBSD.ORG Thu May 15 02:27:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A415A05; Thu, 15 May 2014 02:27:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B0762509; Thu, 15 May 2014 02:27:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4F2RBe4098904; Thu, 15 May 2014 02:27:11 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4F2RB1R098903; Thu, 15 May 2014 02:27:11 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <201405150227.s4F2RB1R098903@svn.freebsd.org> From: Ollivier Robert Date: Thu, 15 May 2014 02:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266107 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 02:27:11 -0000 Author: roberto Date: Thu May 15 02:27:10 2014 New Revision: 266107 URL: http://svnweb.freebsd.org/changeset/base/266107 Log: Here is a patch for the bsdinstall root-on-zfs stuff that adds optional encryption for swap, and optional gmirror for swap (which can be combined) Submitted by: Allan Jude Requested By: roberto Sponsored By: ScaleEngine Inc. MFC after: 2 weeks Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Thu May 15 01:37:17 2014 (r266106) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Thu May 15 02:27:10 2014 (r266107) @@ -108,6 +108,16 @@ f_include $BSDCFG_SHARE/variable.subr : ${ZFSBOOT_SWAP_SIZE:=2g} # +# Should we use geli(8) to encrypt the swap? +# +: ${ZFSBOOT_SWAP_ENCRYPTION=} + +# +# Should we use gmirror(8) to mirror the swap? +# +: ${ZFSBOOT_SWAP_MIRROR=} + +# # Default ZFS datasets for root zpool # # NOTE: Requires /tmp, /var/tmp, /$ZFSBOOT_BOOTFS_NAME/$ZFSBOOT_BOOTFS_NAME @@ -184,6 +194,7 @@ MOUNT_TYPE='mount -t %s "%s" "%s"' PRINTF_CONF="printf '%s=\"%%s\"\\\n' %s >> \"%s\"" PRINTF_FSTAB='printf "$FSTAB_FMT" "%s" "%s" "%s" "%s" "%s" "%s" >> "%s"' SHELL_TRUNCATE=':> "%s"' +SWAP_GMIRROR_LABEL='gmirror label swap %s' UMOUNT='umount "%s"' ZFS_CREATE_WITH_OPTIONS='zfs create %s "%s"' ZFS_SET='zfs set "%s" "%s"' @@ -263,6 +274,10 @@ msg_select_a_disk_device="Select a disk msg_select_virtual_device_type="Select Virtual Device type:" msg_stripe_desc="Stripe - No Redundancy" msg_stripe_help="[1+ Disks] Striping provides maximum storage but no redundancy" +msg_swap_encrypt="Encrypt Swap?" +msg_swap_encrypt_help="Encrypt swap partitions with temporary keys, discarded on reboot" +msg_swap_mirror="Mirror Swap?" +msg_swap_mirror_help="Mirror swap partitions for redundancy, breaks crash dumps" msg_swap_size="Swap Size" msg_swap_size_help="Customize how much swap space is allocated to each selected disk" msg_these_disks_are_too_small="These disks are too small given the amount of requested\nswap (%s) and/or geli(8) (%s) partitions, which would\ntake 50%% or more of each of the following selected disk\ndevices (not recommended):\n\n %s\n\nRecommend changing partition size(s) and/or selecting a\ndifferent set of devices." @@ -285,8 +300,12 @@ dialog_menu_main() local prompt="$msg_configure_options" local force4k="$msg_no" local usegeli="$msg_no" + local swapgeli="$msg_no" + local swapmirror="$msg_no" [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ] && force4k="$msg_yes" [ "$ZFSBOOT_GELI_ENCRYPTION" ] && usegeli="$msg_yes" + [ "$ZFSBOOT_SWAP_ENCRYPTION" ] && swapgeli="$msg_yes" + [ "$ZFSBOOT_SWAP_MIRROR" ] && swapmirror="$msg_yes" local disks n f_count n $ZFSBOOT_DISKS { [ $n -eq 1 ] && disks=disk; } || disks=disks # grammar @@ -309,6 +328,10 @@ dialog_menu_main() '$msg_partition_scheme_help' 'S $msg_swap_size' '$ZFSBOOT_SWAP_SIZE' '$msg_swap_size_help' + 'M $msg_swap_mirror' '$swapmirror' + '$msg_swap_mirror_help' + 'W $msg_swap_encrypt' '$swapgeli' + '$msg_swap_encrypt_help' " # END-QUOTE local defaultitem= # Calculated below local hline="$hline_alnum_arrows_punc_tab_enter" @@ -747,14 +770,14 @@ zfs_create_diskpart() return $FAILURE # NB: zpool will use the `zfs#' GPT labels - bootpart=p2 targetpart=p2 + bootpart=p2 swappart=p2 targetpart=p2 [ ${swapsize:-0} -gt 0 ] && targetpart=p3 # # Prepare boot pool if enabled (e.g., for geli(8)) # if [ "$ZFSBOOT_BOOT_POOL" ]; then - bootpart=p2 targetpart=p3 + bootpart=p2 swappart=p3 targetpart=p3 [ ${swapsize:-0} -gt 0 ] && targetpart=p4 f_eval_catch $funcname gpart \ "$GPART_ADD_LABEL_WITH_SIZE" boot$index \ @@ -781,12 +804,7 @@ zfs_create_diskpart() return $FAILURE # Pedantically nuke any old labels on the swap f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ - /dev/gpt/swap$index - # Update fstab(5) - f_eval_catch $funcname printf "$PRINTF_FSTAB" \ - /dev/gpt/swap$index none swap sw 0 0 \ - $BSDINSTALL_TMPETC/fstab || - return $FAILURE + /dev/$disk$swappart fi # @@ -827,7 +845,7 @@ zfs_create_diskpart() return $FAILURE # NB: zpool will use s1a (no labels) - bootpart=s1a targetpart=s1d mbrindex=4 + bootpart=s1a swappart=s1b targetpart=s1d mbrindex=4 # # Always prepare a boot pool on MBR @@ -858,11 +876,6 @@ zfs_create_diskpart() # Pedantically nuke any old labels on the swap f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \ /dev/${disk}s1b - # Update fstab(5) - f_eval_catch $funcname printf "$PRINTF_FSTAB" \ - /dev/${disk}s1b none swap sw 0 0 \ - $BSDINSTALL_TMPETC/fstab || - return $FAILURE fi # @@ -879,6 +892,33 @@ zfs_create_diskpart() esac # $ZFSBOOT_PARTITION_SCHEME + # Update fstab(5) + if [ "$isswapmirror" ]; then + # This is not the first disk in the mirror, do nothing + elif [ "$ZFSBOOT_SWAP_ENCRYPTION" -a "$ZFSBOOT_SWAP_MIRROR" ]; then + f_eval_catch $funcname printf "$PRINTF_FSTAB" \ + /dev/mirror/swap.eli none swap sw 0 0 \ + $BSDINSTALL_TMPETC/fstab || + return $FAILURE + isswapmirror=1 + elif [ "$ZFSBOOT_SWAP_MIRROR" ]; then + f_eval_catch $funcname printf "$PRINTF_FSTAB" \ + /dev/mirror/swap none swap sw 0 0 \ + $BSDINSTALL_TMPETC/fstab || + return $FAILURE + isswapmirror=1 + elif [ "$ZFSBOOT_SWAP_ENCRYPTION" ]; then + f_eval_catch $funcname printf "$PRINTF_FSTAB" \ + /dev/$disk${swappart}.eli none swap sw 0 0 \ + $BSDINSTALL_TMPETC/fstab || + return $FAILURE + else + f_eval_catch $funcname printf "$PRINTF_FSTAB" \ + /dev/$disk$swappart none swap sw 0 0 \ + $BSDINSTALL_TMPETC/fstab || + return $FAILURE + fi + return $SUCCESS } @@ -893,10 +933,12 @@ zfs_create_boot() local zroot_name="$1" local zroot_vdevtype="$2" local zroot_vdevs= # Calculated below + local swap_devs= # Calculated below local boot_vdevs= # Used for geli(8) and/or MBR layouts shift 2 # poolname vdev_type local disks="$*" disk - local bootpart targetpart # Set by zfs_create_diskpart() below + local isswapmirror + local bootpart targetpart swappart # Set by zfs_create_diskpart() below # # Pedantic checks; should never be seen @@ -968,7 +1010,8 @@ zfs_create_boot() local n=0 for disk in $disks; do zfs_create_diskpart $disk $n || return $FAILURE - # Now $bootpart and $targetpart are set (suffix for $disk) + # Now $bootpart, $targetpart, and $swappart are set (suffix + # for $disk) # Forced 4k alignment support using Geom NOP (see gnop(8)) if [ "$ZFSBOOT_GNOP_4K_FORCE_ALIGN" ]; then @@ -1087,6 +1130,16 @@ zfs_create_boot() return $FAILURE f_eval_catch -d $funcname umount "$UMOUNT" /mnt # tmpfs fi + # + # Create the gmirror(8) GEOMS for swap + # + if [ "$ZFSBOOT_SWAP_MIRROR" ]; then + for disk in $disks; do + swap_devs="$swap_devs $disk$swappart" + done + f_eval_catch $funcname gmirror "$SWAP_GMIRROR_LABEL" \ + "$swap_devs" || return $FAILURE + fi # # Create the ZFS root pool with desired type and disk devices @@ -1215,6 +1268,14 @@ zfs_create_boot() f_eval_catch $funcname echo "$ECHO_APPEND" \ 'kern.geom.label.disk_ident.enable=\"0\"' \ $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE + f_eval_catch $funcname echo "$ECHO_APPEND" \ + 'kern.geom.label.gptid.enable=\"0\"' \ + $BSDINSTALL_TMPBOOT/loader.conf.zfs || return $FAILURE + + if [ "$ZFSBOOT_SWAP_MIRROR" ]; then + f_eval_catch $funcname echo "$ECHO_APPEND" 'geom_mirror_load=\"YES\"' \ + $BSDINSTALL_TMPBOOT/loader.conf.gmirror || return $FAILURE + fi # We're all done unless we should go on for boot pool [ "$ZFSBOOT_BOOT_POOL" ] || return $SUCCESS @@ -1448,6 +1509,22 @@ while :; do "$ZFSBOOT_SWAP_SIZE" && ZFSBOOT_SWAP_SIZE="${input:-0}" ;; + ?" $msg_swap_mirror") + # Toggle the variable referenced both by the menu and later + if [ "$ZFSBOOT_SWAP_MIRROR" ]; then + ZFSBOOT_SWAP_MIRROR= + else + ZFSBOOT_SWAP_MIRROR=1 + fi + ;; + ?" $msg_swap_encrypt") + # Toggle the variable referenced both by the menu and later + if [ "$ZFSBOOT_SWAP_ENCRYPTION" ]; then + ZFSBOOT_SWAP_ENCRYPTION= + else + ZFSBOOT_SWAP_ENCRYPTION=1 + fi + ;; esac done From owner-svn-src-head@FreeBSD.ORG Thu May 15 02:31:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 335BCC43; Thu, 15 May 2014 02:31:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06E9E2524; Thu, 15 May 2014 02:31:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4F2V2qN001751; Thu, 15 May 2014 02:31:02 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4F2V21M001750; Thu, 15 May 2014 02:31:02 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <201405150231.s4F2V21M001750@svn.freebsd.org> From: Ollivier Robert Date: Thu, 15 May 2014 02:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266108 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 02:31:03 -0000 Author: roberto Date: Thu May 15 02:31:02 2014 New Revision: 266108 URL: http://svnweb.freebsd.org/changeset/base/266108 Log: Updates to the datasets created by zfsboot. Set compress=lz4 for the entire pool, removing it from the individual datasets Remove exec=no from /usr/src, breaks the test suite. Submitted by: Allan Jude Reviewed by: roberto MFC after: 2 weeks Sponsored by: ScaleEngine Inc. Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Thu May 15 02:27:10 2014 (r266107) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Thu May 15 02:31:02 2014 (r266108) @@ -131,7 +131,7 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATA /$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME mountpoint=/ # Compress /tmp, allow exec but not setuid - /tmp mountpoint=/tmp,compression=lz4,exec=on,setuid=off + /tmp mountpoint=/tmp,exec=on,setuid=off # Don't mount /usr so that 'base' files go to the BEROOT /usr mountpoint=/usr,canmount=off @@ -140,17 +140,17 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATA /usr/home # NB: /home is a symlink to /usr/home # Ports tree - /usr/ports compression=lz4,setuid=off + /usr/ports setuid=off # Source tree (compressed) - /usr/src compression=lz4,exec=off,setuid=off + /usr/src # Create /var and friends /var mountpoint=/var - /var/crash compression=lz4,exec=off,setuid=off - /var/log compression=lz4,exec=off,setuid=off - /var/mail compression=lz4,atime=on - /var/tmp compression=lz4,exec=on,setuid=off + /var/crash exec=off,setuid=off + /var/log exec=off,setuid=off + /var/mail atime=on + /var/tmp setuid=off " # END-QUOTE # @@ -1146,7 +1146,8 @@ zfs_create_boot() # f_dprintf "$funcname: Creating root pool..." f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ - "-o altroot=$BSDINSTALL_CHROOT -m none -f" \ + "-o altroot=$BSDINSTALL_CHROOT -O compress=lz4 + -m none -f" \ "$zroot_name" "$zroot_vdevtype" "$zroot_vdevs" || return $FAILURE From owner-svn-src-head@FreeBSD.ORG Thu May 15 02:38:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 170B3DF1; Thu, 15 May 2014 02:38:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEB4325C3; Thu, 15 May 2014 02:37:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4F2bxUl003510; Thu, 15 May 2014 02:37:59 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4F2bxTB003509; Thu, 15 May 2014 02:37:59 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <201405150237.s4F2bxTB003509@svn.freebsd.org> From: Ollivier Robert Date: Thu, 15 May 2014 02:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266109 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 02:38:00 -0000 Author: roberto Date: Thu May 15 02:37:59 2014 New Revision: 266109 URL: http://svnweb.freebsd.org/changeset/base/266109 Log: Fix the "disks" variable reuse. It starts off being used to track the grammar for the number of disks (singular vs plural) and then it is reused as the list of available disks. Replace the variable with disks_grammar and move 'disk' and 'disks' to msg_ vars so they can be translated in the future. Submitted by: Allan Jude Reviewed by: roberto MFC after: 2 weeks Sponsored by: ScaleEngine Inc. Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Thu May 15 02:31:02 2014 (r266108) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Thu May 15 02:37:59 2014 (r266109) @@ -220,6 +220,8 @@ msg_configure_options="Configure Options msg_detailed_disk_info="gpart(8) show %s:\n%s\n\ncamcontrol(8) inquiry %s:\n%s\n\n\ncamcontrol(8) identify %s:\n%s\n" msg_disk_info="Disk Info" msg_disk_info_help="Get detailed information on disk device(s)" +msg_disk_singular="disk" +msg_disk_plural="disks" msg_encrypt_disks="Encrypt Disks?" msg_encrypt_disks_help="Use geli(8) to encrypt all data partitions" msg_error="Error" @@ -306,13 +308,14 @@ dialog_menu_main() [ "$ZFSBOOT_GELI_ENCRYPTION" ] && usegeli="$msg_yes" [ "$ZFSBOOT_SWAP_ENCRYPTION" ] && swapgeli="$msg_yes" [ "$ZFSBOOT_SWAP_MIRROR" ] && swapmirror="$msg_yes" - local disks n + local disks n disks_grammar f_count n $ZFSBOOT_DISKS - { [ $n -eq 1 ] && disks=disk; } || disks=disks # grammar + { [ $n -eq 1 ] && disks_grammar=$msg_disk_singular; } || + disks_grammar=$msg_disk_plural # grammar local menu_list=" '>>> $msg_install' '$msg_install_desc' '$msg_install_help' - 'T $msg_pool_type_disks' '$ZFSBOOT_VDEV_TYPE: $n $disks' + 'T $msg_pool_type_disks' '$ZFSBOOT_VDEV_TYPE: $n $disks_grammar' '$msg_pool_type_disks_help' '- $msg_rescan_devices' '*' '$msg_rescan_devices_help' From owner-svn-src-head@FreeBSD.ORG Thu May 15 03:08:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DC75584; Thu, 15 May 2014 03:08:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECB6E2865; Thu, 15 May 2014 03:08:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4F38KYD017819; Thu, 15 May 2014 03:08:20 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4F38K7s017818; Thu, 15 May 2014 03:08:20 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201405150308.s4F38K7s017818@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 15 May 2014 03:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266111 - head/contrib/tzcode/stdtime X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 03:08:21 -0000 Author: gavin Date: Thu May 15 03:08:20 2014 New Revision: 266111 URL: http://svnweb.freebsd.org/changeset/base/266111 Log: Fix typo. Note that although this file is under contrib, it has diverged sufficiently from upstream (including a full whitespace commit and large portions rewritten) that this change does not move us further from the upstream. PR: docs/186608 Submitted by: Jamie Landeg-Jones MFC after: 3 days Modified: head/contrib/tzcode/stdtime/ctime.3 Modified: head/contrib/tzcode/stdtime/ctime.3 ============================================================================== --- head/contrib/tzcode/stdtime/ctime.3 Thu May 15 02:41:23 2014 (r266110) +++ head/contrib/tzcode/stdtime/ctime.3 Thu May 15 03:08:20 2014 (r266111) @@ -342,7 +342,7 @@ Except for and the .Fn \&_r variants of the other functions, -these functions leaves their result in an internal static object and return +these functions leave their result in an internal static object and return a pointer to that object. Subsequent calls to these function will modify the same object. From owner-svn-src-head@FreeBSD.ORG Thu May 15 03:30:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C79F1B51; Thu, 15 May 2014 03:30:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0F5B2A21; Thu, 15 May 2014 03:30:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4F3U5Te027165; Thu, 15 May 2014 03:30:05 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4F3U4IP027155; Thu, 15 May 2014 03:30:04 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201405150330.s4F3U4IP027155@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 15 May 2014 03:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266114 - in head: contrib/ldns contrib/ldns/compat contrib/ldns/drill contrib/ldns/ldns contrib/ldns/m4 contrib/unbound contrib/unbound/compat contrib/unbound/daemon contrib/unbound/do... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 03:30:05 -0000 Author: des Date: Thu May 15 03:30:03 2014 New Revision: 266114 URL: http://svnweb.freebsd.org/changeset/base/266114 Log: Upgrade to latest ldns (1.6.17) and unbound (1.4.22). MFC after: 3 weeks Added: head/contrib/ldns/README.git - copied unchanged from r266072, vendor/ldns/dist/README.git head/contrib/ldns/ldns/radix.h - copied unchanged from r266072, vendor/ldns/dist/ldns/radix.h head/contrib/ldns/m4/ - copied from r266072, vendor/ldns/dist/m4/ head/contrib/ldns/radix.c - copied unchanged from r266072, vendor/ldns/dist/radix.c head/contrib/unbound/ax_pthread.m4 - copied unchanged from r266075, vendor/unbound/dist/ax_pthread.m4 head/contrib/unbound/compat/strlcat.c - copied unchanged from r266077, vendor/unbound/dist/compat/strlcat.c head/contrib/unbound/ldns/ - copied from r266077, vendor/unbound/dist/ldns/ head/contrib/unbound/libunbound/unbound-event.h - copied unchanged from r266077, vendor/unbound/dist/libunbound/unbound-event.h Deleted: head/contrib/ldns/README.svn head/contrib/unbound/acx_pthread.m4 Modified: head/contrib/ldns/Changelog head/contrib/ldns/Makefile.in head/contrib/ldns/README head/contrib/ldns/acx_nlnetlabs.m4 head/contrib/ldns/ax_python_devel.m4 head/contrib/ldns/compat/b64_ntop.c head/contrib/ldns/compat/b64_pton.c head/contrib/ldns/compat/snprintf.c head/contrib/ldns/configure head/contrib/ldns/configure.ac head/contrib/ldns/dane.c head/contrib/ldns/dnssec.c head/contrib/ldns/dnssec_sign.c head/contrib/ldns/dnssec_zone.c head/contrib/ldns/drill/chasetrace.c head/contrib/ldns/drill/configure head/contrib/ldns/drill/configure.ac head/contrib/ldns/drill/drill.1.in head/contrib/ldns/drill/drill.c head/contrib/ldns/drill/drill_util.c head/contrib/ldns/drill/securetrace.c head/contrib/ldns/drill/work.c head/contrib/ldns/error.c head/contrib/ldns/higher.c head/contrib/ldns/host2str.c head/contrib/ldns/host2wire.c head/contrib/ldns/install-sh head/contrib/ldns/keys.c head/contrib/ldns/ldns/common.h head/contrib/ldns/ldns/common.h.in head/contrib/ldns/ldns/config.h head/contrib/ldns/ldns/config.h.in head/contrib/ldns/ldns/dane.h head/contrib/ldns/ldns/dnssec.h head/contrib/ldns/ldns/dnssec_sign.h head/contrib/ldns/ldns/dnssec_zone.h head/contrib/ldns/ldns/error.h head/contrib/ldns/ldns/host2str.h head/contrib/ldns/ldns/ldns.h head/contrib/ldns/ldns/net.h head/contrib/ldns/ldns/net.h.in head/contrib/ldns/ldns/packet.h head/contrib/ldns/ldns/rdata.h head/contrib/ldns/ldns/resolver.h head/contrib/ldns/ldns/rr.h head/contrib/ldns/ldns/str2host.h head/contrib/ldns/ldns/util.h head/contrib/ldns/ldns/util.h.in head/contrib/ldns/net.c head/contrib/ldns/packet.c head/contrib/ldns/parse.c head/contrib/ldns/rdata.c head/contrib/ldns/resolver.c head/contrib/ldns/rr.c head/contrib/ldns/sha1.c head/contrib/ldns/sha2.c head/contrib/ldns/str2host.c head/contrib/ldns/tsig.c head/contrib/ldns/util.c head/contrib/ldns/wire2host.c head/contrib/unbound/LICENSE head/contrib/unbound/Makefile.in head/contrib/unbound/acx_nlnetlabs.m4 head/contrib/unbound/compat/snprintf.c head/contrib/unbound/config.h head/contrib/unbound/config.h.in head/contrib/unbound/configure head/contrib/unbound/configure.ac head/contrib/unbound/daemon/acl_list.c head/contrib/unbound/daemon/acl_list.h head/contrib/unbound/daemon/cachedump.c head/contrib/unbound/daemon/cachedump.h head/contrib/unbound/daemon/daemon.c head/contrib/unbound/daemon/daemon.h head/contrib/unbound/daemon/remote.c head/contrib/unbound/daemon/remote.h head/contrib/unbound/daemon/stats.c head/contrib/unbound/daemon/stats.h head/contrib/unbound/daemon/unbound.c head/contrib/unbound/daemon/worker.c head/contrib/unbound/daemon/worker.h head/contrib/unbound/doc/Changelog head/contrib/unbound/doc/FEATURES head/contrib/unbound/doc/LICENSE head/contrib/unbound/doc/README head/contrib/unbound/doc/example.conf.in head/contrib/unbound/doc/libunbound.3 head/contrib/unbound/doc/libunbound.3.in head/contrib/unbound/doc/unbound-anchor.8 head/contrib/unbound/doc/unbound-anchor.8.in head/contrib/unbound/doc/unbound-checkconf.8 head/contrib/unbound/doc/unbound-checkconf.8.in head/contrib/unbound/doc/unbound-control.8 head/contrib/unbound/doc/unbound-control.8.in head/contrib/unbound/doc/unbound-host.1 head/contrib/unbound/doc/unbound.8 head/contrib/unbound/doc/unbound.8.in head/contrib/unbound/doc/unbound.conf.5 head/contrib/unbound/doc/unbound.conf.5.in head/contrib/unbound/iterator/iter_delegpt.c head/contrib/unbound/iterator/iter_delegpt.h head/contrib/unbound/iterator/iter_donotq.c head/contrib/unbound/iterator/iter_donotq.h head/contrib/unbound/iterator/iter_fwd.c head/contrib/unbound/iterator/iter_fwd.h head/contrib/unbound/iterator/iter_hints.c head/contrib/unbound/iterator/iter_hints.h head/contrib/unbound/iterator/iter_priv.c head/contrib/unbound/iterator/iter_priv.h head/contrib/unbound/iterator/iter_resptype.c head/contrib/unbound/iterator/iter_resptype.h head/contrib/unbound/iterator/iter_scrub.c head/contrib/unbound/iterator/iter_scrub.h head/contrib/unbound/iterator/iter_utils.c head/contrib/unbound/iterator/iter_utils.h head/contrib/unbound/iterator/iterator.c head/contrib/unbound/iterator/iterator.h head/contrib/unbound/ldns/parse.c head/contrib/unbound/ldns/sbuffer.c head/contrib/unbound/libunbound/context.c head/contrib/unbound/libunbound/context.h head/contrib/unbound/libunbound/libunbound.c head/contrib/unbound/libunbound/libworker.c head/contrib/unbound/libunbound/libworker.h head/contrib/unbound/libunbound/ubsyms.def head/contrib/unbound/libunbound/unbound.h head/contrib/unbound/libunbound/worker.h head/contrib/unbound/services/cache/dns.c head/contrib/unbound/services/cache/dns.h head/contrib/unbound/services/cache/infra.c head/contrib/unbound/services/cache/infra.h head/contrib/unbound/services/cache/rrset.c head/contrib/unbound/services/cache/rrset.h head/contrib/unbound/services/listen_dnsport.c head/contrib/unbound/services/listen_dnsport.h head/contrib/unbound/services/localzone.c head/contrib/unbound/services/localzone.h head/contrib/unbound/services/mesh.c head/contrib/unbound/services/mesh.h head/contrib/unbound/services/modstack.c head/contrib/unbound/services/modstack.h head/contrib/unbound/services/outbound_list.c head/contrib/unbound/services/outbound_list.h head/contrib/unbound/services/outside_network.c head/contrib/unbound/services/outside_network.h head/contrib/unbound/smallapp/unbound-anchor.c head/contrib/unbound/smallapp/unbound-checkconf.c head/contrib/unbound/smallapp/unbound-control.c head/contrib/unbound/smallapp/unbound-host.c head/contrib/unbound/smallapp/worker_cb.c head/contrib/unbound/util/alloc.c head/contrib/unbound/util/alloc.h head/contrib/unbound/util/config_file.c head/contrib/unbound/util/config_file.h head/contrib/unbound/util/configlexer.c head/contrib/unbound/util/configlexer.lex head/contrib/unbound/util/configparser.c head/contrib/unbound/util/configparser.h head/contrib/unbound/util/configparser.y head/contrib/unbound/util/data/dname.c head/contrib/unbound/util/data/dname.h head/contrib/unbound/util/data/msgencode.c head/contrib/unbound/util/data/msgencode.h head/contrib/unbound/util/data/msgparse.c head/contrib/unbound/util/data/msgparse.h head/contrib/unbound/util/data/msgreply.c head/contrib/unbound/util/data/msgreply.h head/contrib/unbound/util/data/packed_rrset.c head/contrib/unbound/util/data/packed_rrset.h head/contrib/unbound/util/fptr_wlist.c head/contrib/unbound/util/fptr_wlist.h head/contrib/unbound/util/iana_ports.inc head/contrib/unbound/util/locks.c head/contrib/unbound/util/locks.h head/contrib/unbound/util/log.c head/contrib/unbound/util/log.h head/contrib/unbound/util/mini_event.c head/contrib/unbound/util/mini_event.h head/contrib/unbound/util/module.c head/contrib/unbound/util/module.h head/contrib/unbound/util/net_help.c head/contrib/unbound/util/net_help.h head/contrib/unbound/util/netevent.c head/contrib/unbound/util/netevent.h head/contrib/unbound/util/random.c head/contrib/unbound/util/random.h head/contrib/unbound/util/rbtree.c head/contrib/unbound/util/rbtree.h head/contrib/unbound/util/regional.c head/contrib/unbound/util/regional.h head/contrib/unbound/util/rtt.c head/contrib/unbound/util/rtt.h head/contrib/unbound/util/storage/dnstree.c head/contrib/unbound/util/storage/dnstree.h head/contrib/unbound/util/storage/lookup3.c head/contrib/unbound/util/storage/lookup3.h head/contrib/unbound/util/storage/lruhash.c head/contrib/unbound/util/storage/lruhash.h head/contrib/unbound/util/storage/slabhash.c head/contrib/unbound/util/storage/slabhash.h head/contrib/unbound/util/timehist.c head/contrib/unbound/util/timehist.h head/contrib/unbound/util/tube.c head/contrib/unbound/util/tube.h head/contrib/unbound/util/winsock_event.c head/contrib/unbound/util/winsock_event.h head/contrib/unbound/validator/autotrust.c head/contrib/unbound/validator/autotrust.h head/contrib/unbound/validator/val_anchor.c head/contrib/unbound/validator/val_anchor.h head/contrib/unbound/validator/val_kcache.c head/contrib/unbound/validator/val_kcache.h head/contrib/unbound/validator/val_kentry.c head/contrib/unbound/validator/val_kentry.h head/contrib/unbound/validator/val_neg.c head/contrib/unbound/validator/val_neg.h head/contrib/unbound/validator/val_nsec.c head/contrib/unbound/validator/val_nsec.h head/contrib/unbound/validator/val_nsec3.c head/contrib/unbound/validator/val_nsec3.h head/contrib/unbound/validator/val_secalgo.c head/contrib/unbound/validator/val_secalgo.h head/contrib/unbound/validator/val_sigcrypt.c head/contrib/unbound/validator/val_sigcrypt.h head/contrib/unbound/validator/val_utils.c head/contrib/unbound/validator/val_utils.h head/contrib/unbound/validator/validator.c head/contrib/unbound/validator/validator.h head/lib/libldns/Makefile head/lib/libunbound/Makefile Directory Properties: head/contrib/ldns/ (props changed) head/contrib/unbound/ (props changed) Modified: head/contrib/ldns/Changelog ============================================================================== --- head/contrib/ldns/Changelog Thu May 15 03:22:57 2014 (r266113) +++ head/contrib/ldns/Changelog Thu May 15 03:30:03 2014 (r266114) @@ -1,3 +1,61 @@ +1.6.17 2014-01-10 + * Fix ldns_dnssec_zone_new_frm_fp_l to allow the last parsed line of a + zone to be an NSEC3 (or its RRSIG) covering an empty non terminal. + * Add --disable-dane option to configure and check availability of the + for dane needed X509_check_ca function in openssl. + * bugfix #490: Get rid of type-punned pointer warnings. + Thanks Adam Tkac. + * Make sure executables are linked against libcrypto with the + LIBSSL_LDFLAGS. Thanks Leo Baltus. + * Miscellaneous prototype fixes. Thanks Dag-Erling Smørgrav. + * README now shows preferred way to configure for examples and drill. + * Bind to source address for resolvers. drill binds to source with -I. + Thanks Bryan Duff. + * -T option for ldns-dane that has specific exit status for PKIX + validated connections without (secure) TLSA records. + * Fix b{32,64}_{ntop,pton} detection and handling. + * New RR type TKEY, but without operational practice. + * New RR types HIP, NINFO, RKEY, CDS, EUI48, EUI64, URI, CAA and TA. + * New output format flag (and accompanying functions) to print certain + RR's as unknown type + * -u and -U parameter for ldns-read-zone to mark/unmark a RR type + for printing as unknown type + * bugfix #504: GPOS RR has three rdata fields. Thanks Jelte Jansen. + * bugfix #497: Properly test for EOF when reading key files with drill. + * New functions: ldns_pkt_ixfr_request_new and + ldns_pkt_ixfr_request_new_frm_str. + * Use SNI with ldns-dane + * bugfix #507: ldnsx Fix use of non-existent variables and not + properly referring to instance variable. Patch from shussain. + * bugfix #508: ldnsx Adding NSEC3PARAM to known/allowable RR type + dictionary. Patch from shussain. + * bugfix #517: ldns_resolver_new_frm_fp error when invoked using a NULL + file pointer. + * Fix memory leak in contrib/python: ldns_pkt.new_query. + * Fix buffer overflow in fget_token and bget_token. + * ldns-verify-zone NSEC3 checking from quadratic to linear performance. + Thanks NIC MX (nicmexico.mx) + * ldns-dane setup new ssl session for each new connect to prevent hangs + * bugfix #521: drill trace continue on empty non-terminals with NSEC3 + * bugfix #525: Fix documentation of ldns_resolver_set_retry + * Remove unused LDNS_RDF_TYPE_TSIG and associated functions. + * Fix ldns_nsec_covers_name for zones with an apex only. Thanks Miek. + * Configure option to build perl bindings: --with-p5-dns-ldns + (DNS::LDNS is a contribution from Erik Ostlyngen) + * bugfix #527: Move -lssl before -lcrypto when linking + * Optimize TSIG digest function name comparison (Thanks Marc Buijsman) + * Compare names case insensitive with ldns_pkt_rr_list_by_name and + ldns_pkt_rr_list_by_name_and_type (thanks Johannes Naab) + * A separate --enable for each draft RR type: --enable-rrtype-ninfo, + --enable-rrtype-rkey, --enable-rrtype-cds, --enable-rrtype-uri and + --enable-rrtype-ta + * bugfix #530: Don't sign and verify duplicate RRs (Thanks Jelte Jansen) + * bugfix #505: Manpage and usage output fixes (Thanks Tomas Hozza) + * Adjust ldns_sha1() so that the input data is not modified (Thanks + Marc Buijsman) + * Messages to stderr are now off by default and can be reenabled with + the --enable-stderr-msgs configure option. + 1.6.16 2012-11-13 * Fix Makefile to build pyldns with BSD make * Fix typo in exporting b32_* symbols to make pyldns load again Modified: head/contrib/ldns/Makefile.in ============================================================================== --- head/contrib/ldns/Makefile.in Thu May 15 03:22:57 2014 (r266113) +++ head/contrib/ldns/Makefile.in Thu May 15 03:30:03 2014 (r266114) @@ -2,7 +2,7 @@ # See the file LICENSE for the license SHELL = @SHELL@ VERSION = @PACKAGE_VERSION@ -version_info = @LIBTOOL_VERSION_INFO@ +version_info = @VERSION_INFO@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -13,8 +13,10 @@ datadir = @datadir@ libdir = @libdir@ includedir = @includedir@ doxygen = @doxygen@ -pywrapdir = ${srcdir}/contrib/python -pyldnsxwrapdir = ${srcdir}/contrib/ldnsx +pywrapdir = $(srcdir)/contrib/python +pyldnsxwrapdir = $(srcdir)/contrib/ldnsx +p5_dns_ldns_dir = $(srcdir)/contrib/DNS-LDNS +PERL = @PERL@ swig = @swig@ swigpy_flags = -python @SWIGPY3@ python_site = @PYTHON_SITE_PKG@ @@ -57,17 +59,19 @@ LINTFLAGS += "-Dsigset_t=long" LINTFLAGS += "-D__uint16_t=uint16_t" -D"__pure2=" -D"__wchar_t=wchar_t" -D"__packed=" -D"__aligned(x)=" # Ubuntu oneiric" LINTFLAGS += -D"__BEGIN_DECLS=" -D"__ssize_t=ssize_t" -D"__intptr_t=intptr_t" -D"__nonnull(x)=" -D"__THROW=" -D"__wur=" -D"__off_t=unsigned" -D"__off64_t=unsigned" -D"__useconds_t=unsigned" -D"__uid_t=unsigned" -D"__gid_t=unsigned" -D"__attribute_deprecated__=" -D"__pid_t=unsigned" -D"__restrict=" -D"__END_DECLS=" -D"__BEGIN_NAMESPACE_STD=" -D"__END_NAMESPACE_STD=" -D"__BEGIN_NAMESPACE_C99=" -D"__END_NAMESPACE_C99=" -D"__socklen_t=unsigned" -D"sa_family_t=unsigned " -D"__mode_t=unsigned" -D"u_int16_t=uint16_t" -D"u_int32_t=uint32_t" -D"u_int8_t=uint8_t" -D"u_short=unsigned short" -D"__u16=uint16_t" -D"__u32=uint32_t" -D"__u64=uint64_t" +# FreeBSD 9 +LINTFLAGS += -D"_RuneLocale=int" DEPFLAG = @DEPFLAG@ INSTALL = $(srcdir)/install-sh LIBLOBJS = $(LIBOBJS:.o=.lo) -LDNS_LOBJS = buffer.lo dane.lo dname.lo dnssec.lo dnssec_sign.lo dnssec_verify.lo dnssec_zone.lo duration.lo error.lo higher.lo host2str.lo host2wire.lo keys.lo net.lo packet.lo parse.lo rbtree.lo rdata.lo resolver.lo rr.lo rr_functions.lo sha1.lo sha2.lo str2host.lo tsig.lo update.lo util.lo wire2host.lo zone.lo +LDNS_LOBJS = buffer.lo dane.lo dname.lo dnssec.lo dnssec_sign.lo dnssec_verify.lo dnssec_zone.lo duration.lo error.lo higher.lo host2str.lo host2wire.lo keys.lo net.lo packet.lo parse.lo radix.lo rbtree.lo rdata.lo resolver.lo rr.lo rr_functions.lo sha1.lo sha2.lo str2host.lo tsig.lo update.lo util.lo wire2host.lo zone.lo LDNS_LOBJS_EX = ^linktest\.c$$ LDNS_ALL_LOBJS = $(LDNS_LOBJS) $(LIBLOBJS) LIB = libldns.la -LDNS_HEADERS = buffer.h dane.h dname.h dnssec.h dnssec_sign.h dnssec_verify.h dnssec_zone.h duration.h error.h higher.h host2str.h host2wire.h keys.h ldns.h packet.h parse.h rbtree.h rdata.h resolver.h rr_functions.h rr.h sha1.h sha2.h str2host.h tsig.h update.h wire2host.h zone.h +LDNS_HEADERS = buffer.h dane.h dname.h dnssec.h dnssec_sign.h dnssec_verify.h dnssec_zone.h duration.h error.h higher.h host2str.h host2wire.h keys.h ldns.h packet.h parse.h radix.h rbtree.h rdata.h resolver.h rr_functions.h rr.h sha1.h sha2.h str2host.h tsig.h update.h wire2host.h zone.h LDNS_HEADERS_EX = ^config\.h|common\.h|util\.h|net\.h$$ LDNS_HEADERS_GEN= common.h util.h net.h @@ -92,16 +96,14 @@ EX_SSL_LOBJS = examples/ldns-nsec3-hash. COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) COMP_LIB = $(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) LINK = $(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) -LINK_LIB = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) \ - $(LIBS) -version-number $(version_info) -no-undefined -LINK_EXE = $(LIBTOOL) --mode=link $(CC) $(CPPFLAGS) \ - $(LIBSSL_CPPFLAGS) $(CFLAGS) $(LDFLAGS) +LINK_LIB = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) -version-number $(version_info) -no-undefined +LINK_EXE = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LIBSSL_LDFLAGS) .PHONY: clean realclean docclean manpages doc lint all lib pyldns test .PHONY: install uninstall install-doc uninstall-doc uninstall-pyldns .PHONY: install-h uninstall-h install-lib uninstall-lib install-pyldns -all: setup-builddir lib linktest manpages @PYLDNS@ @DRILL@ @EXAMPLES@ +all: setup-builddir lib linktest manpages @P5_DNS_LDNS@ @PYLDNS@ @DRILL@ @EXAMPLES@ .SUFFIXES: .c .o .a .lo .h .i @@ -205,7 +207,8 @@ clean-examples: $(LIBTOOL) --mode clean rm -f $(EXAMPLE_LOBJS) linktest: $(srcdir)/linktest.c libldns.la - $(LIBTOOL) --mode=link $(CC) $(srcdir)/linktest.c $(CPPFLAGS) $(LIBSSL_CPPFLAGS) $(CFLAGS) -lldns $(LIBS) -o linktest + $(COMP_LIB) $(LIBSSL_CPPFLAGS) -c $(srcdir)/linktest.c -o linktest.lo + $(LINK_EXE) linktest.lo $(LIBS) $(LIBSSL_LIBS) -lldns -o linktest lib: libldns.la @@ -247,9 +250,29 @@ ldns_wrapper.lo: $(pywrapdir)/ldns_wrapp _ldns.la: ldns_wrapper.lo libldns.la $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(PYTHON_CFLAGS) $(LDFLAGS) $(PYTHON_LDFLAGS) -module -version-number $(version_info) -no-undefined -o $@ ldns_wrapper.lo -rpath $(python_site) -L. -L.libs -lldns $(LIBS) -install: install-h install-lib @INSTALL_CONFIG@ install-manpages $(pyldns_inst) $(pyldnsx_inst) @INSTALL_DRILL@ @INSTALL_EXAMPLES@ +$(p5_dns_ldns_dir)/Makefile: $(p5_dns_ldns_dir)/Makefile.PL + BUILDDIR=`pwd`; cd $(p5_dns_ldns_dir); $(PERL) Makefile.PL PREFIX="$(prefix)" LIBS="-L$$BUILDDIR/.libs -lldns" INC="-I$$BUILDDIR" -uninstall: uninstall-manpages @UNINSTALL_CONFIG@ uninstall-h uninstall-lib $(pyldns_uninst) $(pyldnsx_uninst) @UNINSTALL_DRILL@ @UNINSTALL_EXAMPLES@ +$(p5_dns_ldns_dir)/blib/arch/auto/DNS/LDNS/LDNS.so: $(p5_dns_ldns_dir)/Makefile + cd $(p5_dns_ldns_dir); $(MAKE) + +p5-dns-ldns: $(p5_dns_ldns_dir)/blib/arch/auto/DNS/LDNS/LDNS.so + +install-p5-dns-ldns: $(p5_dns_ldns_dir)/Makefile + cd $(p5_dns_ldns_dir); $(MAKE) install + +uninstall-p5-dns-ldns: $(p5_dns_ldns_dir)/Makefile + cd $(p5_dns_ldns_dir); $(MAKE) uninstall + +clean-p5-dns-ldns: $(p5_dns_ldns_dir)/Makefile + cd $(p5_dns_ldns_dir); $(MAKE) clean + +test-p5-dns-ldns: $(p5_dns_ldns_dir)/Makefile + cd $(p5_dns_ldns_dir); $(MAKE) test + +install: install-h install-lib @INSTALL_CONFIG@ install-manpages $(pyldns_inst) $(pyldnsx_inst) @INSTALL_P5_DNS_LDNS@ @INSTALL_DRILL@ @INSTALL_EXAMPLES@ + +uninstall: uninstall-manpages @UNINSTALL_CONFIG@ uninstall-h uninstall-lib $(pyldns_uninst) $(pyldnsx_uninst) @UNINSTALL_P5_DNS_LDNS@ @UNINSTALL_DRILL@ @UNINSTALL_EXAMPLES@ destclean: uninstall @@ -331,7 +354,7 @@ clean-lib: $(LIBTOOL) --mode clean rm -f $(pywrapdir)/ldns_wrapper.c $(LIBTOOL) --mode clean rm -f $(pywrapdir)/ldns.py -clean: @CLEAN_DRILL@ @CLEAN_EXAMPLES@ clean-manpages clean-lib putdown-builddir +clean: @CLEAN_DRILL@ @CLEAN_EXAMPLES@ @CLEAN_P5_DNS_LDNS@ clean-manpages clean-lib putdown-builddir realclean: clean docclean rm -f config.status @@ -396,7 +419,7 @@ allclean: test-clean clean test-clean: tpkg -b test clean -test: +test: @TEST_P5_DNS_LDNS@ if test -x "`which bash`"; then bash test/test_all.sh; else sh test/test_all.sh; fi @@ -481,56 +504,56 @@ buffer.lo buffer.o: $(srcdir)/buffer.c l $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h dane.lo dane.o: $(srcdir)/dane.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h dname.lo dname.o: $(srcdir)/dname.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h dnssec.lo dnssec.o: $(srcdir)/dnssec.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h dnssec_sign.lo dnssec_sign.o: $(srcdir)/dnssec_sign.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h dnssec_verify.lo dnssec_verify.o: $(srcdir)/dnssec_verify.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h dnssec_zone.lo dnssec_zone.o: $(srcdir)/dnssec_zone.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h duration.lo duration.o: $(srcdir)/duration.c ldns/config.h $(srcdir)/ldns/duration.h error.lo error.o: $(srcdir)/error.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ @@ -538,72 +561,74 @@ error.lo error.o: $(srcdir)/error.c ldns $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h higher.lo higher.o: $(srcdir)/higher.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h host2str.lo host2str.o: $(srcdir)/host2str.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h host2wire.lo host2wire.o: $(srcdir)/host2wire.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h keys.lo keys.o: $(srcdir)/keys.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h linktest.lo linktest.o: $(srcdir)/linktest.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h net.lo net.o: $(srcdir)/net.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h packet.lo packet.o: $(srcdir)/packet.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h parse.lo parse.o: $(srcdir)/parse.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h +radix.lo radix.o: $(srcdir)/radix.c ldns/config.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/error.h ldns/util.h \ + ldns/common.h rbtree.lo rbtree.o: $(srcdir)/rbtree.c ldns/config.h $(srcdir)/ldns/rbtree.h ldns/util.h ldns/common.h rdata.lo rdata.o: $(srcdir)/rdata.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ @@ -611,40 +636,40 @@ rdata.lo rdata.o: $(srcdir)/rdata.c ldns $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h resolver.lo resolver.o: $(srcdir)/resolver.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h rr.lo rr.o: $(srcdir)/rr.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h rr_functions.lo rr_functions.o: $(srcdir)/rr_functions.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h sha1.lo sha1.o: $(srcdir)/sha1.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h sha2.lo sha2.o: $(srcdir)/sha2.c ldns/config.h $(srcdir)/ldns/sha2.h str2host.lo str2host.o: $(srcdir)/str2host.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ @@ -652,24 +677,24 @@ str2host.lo str2host.o: $(srcdir)/str2ho $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h tsig.lo tsig.o: $(srcdir)/tsig.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h update.lo update.o: $(srcdir)/update.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h util.lo util.o: $(srcdir)/util.c ldns/config.h $(srcdir)/ldns/rdata.h ldns/common.h $(srcdir)/ldns/error.h \ ldns/util.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/buffer.h wire2host.lo wire2host.o: $(srcdir)/wire2host.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ @@ -678,18 +703,16 @@ wire2host.lo wire2host.o: $(srcdir)/wire $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h zone.lo zone.o: $(srcdir)/zone.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h -compat/b32_ntop.lo compat/b32_ntop.o: $(srcdir)/compat/b32_ntop.c ldns/config.h -compat/b32_pton.lo compat/b32_pton.o: $(srcdir)/compat/b32_pton.c ldns/config.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h compat/b64_ntop.lo compat/b64_ntop.o: $(srcdir)/compat/b64_ntop.c ldns/config.h compat/b64_pton.lo compat/b64_pton.o: $(srcdir)/compat/b64_pton.c ldns/config.h compat/calloc.lo compat/calloc.o: $(srcdir)/compat/calloc.c ldns/config.h @@ -715,8 +738,8 @@ examples/ldns-chaos.lo examples/ldns-cha $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-compare-zones.lo examples/ldns-compare-zones.o: $(srcdir)/examples/ldns-compare-zones.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -724,31 +747,31 @@ examples/ldns-compare-zones.lo examples/ $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-dane.lo examples/ldns-dane.o: $(srcdir)/examples/ldns-dane.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldnsd.lo examples/ldnsd.o: $(srcdir)/examples/ldnsd.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h \ $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h \ $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h $(srcdir)/ldns/zone.h \ $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-dpa.lo examples/ldns-dpa.o: $(srcdir)/examples/ldns-dpa.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h $(srcdir)/examples/ldns-dpa.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h $(srcdir)/examples/ldns-dpa.h examples/ldns-gen-zone.lo examples/ldns-gen-zone.o: $(srcdir)/examples/ldns-gen-zone.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -756,15 +779,15 @@ examples/ldns-gen-zone.lo examples/ldns- $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-key2ds.lo examples/ldns-key2ds.o: $(srcdir)/examples/ldns-key2ds.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-keyfetcher.lo examples/ldns-keyfetcher.o: $(srcdir)/examples/ldns-keyfetcher.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -772,31 +795,31 @@ examples/ldns-keyfetcher.lo examples/ldn $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-keygen.lo examples/ldns-keygen.o: $(srcdir)/examples/ldns-keygen.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-mx.lo examples/ldns-mx.o: $(srcdir)/examples/ldns-mx.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-notify.lo examples/ldns-notify.o: $(srcdir)/examples/ldns-notify.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-nsec3-hash.lo examples/ldns-nsec3-hash.o: $(srcdir)/examples/ldns-nsec3-hash.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -804,7 +827,7 @@ examples/ldns-nsec3-hash.lo examples/ldn $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-read-zone.lo examples/ldns-read-zone.o: $(srcdir)/examples/ldns-read-zone.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -812,7 +835,7 @@ examples/ldns-read-zone.lo examples/ldns $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-resolver.lo examples/ldns-resolver.o: $(srcdir)/examples/ldns-resolver.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -820,23 +843,23 @@ examples/ldns-resolver.lo examples/ldns- $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-revoke.lo examples/ldns-revoke.o: $(srcdir)/examples/ldns-revoke.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-rrsig.lo examples/ldns-rrsig.o: $(srcdir)/examples/ldns-rrsig.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-signzone.lo examples/ldns-signzone.o: $(srcdir)/examples/ldns-signzone.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -844,7 +867,7 @@ examples/ldns-signzone.lo examples/ldns- $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-test-edns.lo examples/ldns-test-edns.o: $(srcdir)/examples/ldns-test-edns.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -852,15 +875,15 @@ examples/ldns-test-edns.lo examples/ldns $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-testns.lo examples/ldns-testns.o: $(srcdir)/examples/ldns-testns.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h $(srcdir)/examples/ldns-testpkts.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h $(srcdir)/examples/ldns-testpkts.h examples/ldns-testpkts.lo examples/ldns-testpkts.o: $(srcdir)/examples/ldns-testpkts.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -868,15 +891,16 @@ examples/ldns-testpkts.lo examples/ldns- $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h $(srcdir)/examples/ldns-testpkts.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h \ + $(srcdir)/examples/ldns-testpkts.h examples/ldns-update.lo examples/ldns-update.o: $(srcdir)/examples/ldns-update.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-verify-zone.lo examples/ldns-verify-zone.o: $(srcdir)/examples/ldns-verify-zone.c ldns/config.h $(srcdir)/ldns/ldns.h \ ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h \ $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h \ @@ -884,39 +908,39 @@ examples/ldns-verify-zone.lo examples/ld $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h \ $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h \ $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h \ - $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-version.lo examples/ldns-version.o: $(srcdir)/examples/ldns-version.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-walk.lo examples/ldns-walk.o: $(srcdir)/examples/ldns-walk.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-zcat.lo examples/ldns-zcat.o: $(srcdir)/examples/ldns-zcat.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-zsplit.lo examples/ldns-zsplit.o: $(srcdir)/examples/ldns-zsplit.c ldns/config.h $(srcdir)/ldns/ldns.h ldns/util.h \ ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h \ $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h $(srcdir)/ldns/packet.h $(srcdir)/ldns/keys.h \ $(srcdir)/ldns/zone.h $(srcdir)/ldns/resolver.h $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h \ $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h \ $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/chasetrace.lo drill/chasetrace.o: $(srcdir)/drill/chasetrace.c $(srcdir)/drill/drill.h ldns/config.h \ $(srcdir)/drill/drill_util.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h \ $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h \ @@ -924,8 +948,8 @@ drill/chasetrace.lo drill/chasetrace.o: $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h \ $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h \ $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/dnssec.lo drill/dnssec.o: $(srcdir)/drill/dnssec.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \ $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \ $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \ @@ -933,7 +957,7 @@ drill/dnssec.lo drill/dnssec.o: $(srcdir $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ - $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/drill.lo drill/drill.o: $(srcdir)/drill/drill.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \ $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \ $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \ @@ -941,7 +965,7 @@ drill/drill.lo drill/drill.o: $(srcdir)/ $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ - $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/drill_util.lo drill/drill_util.o: $(srcdir)/drill/drill_util.c $(srcdir)/drill/drill.h ldns/config.h \ $(srcdir)/drill/drill_util.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h \ $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h \ @@ -949,8 +973,8 @@ drill/drill_util.lo drill/drill_util.o: $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h \ $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h \ $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/error.lo drill/error.o: $(srcdir)/drill/error.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \ $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \ $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \ @@ -958,7 +982,7 @@ drill/error.lo drill/error.o: $(srcdir)/ $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ - $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/root.lo drill/root.o: $(srcdir)/drill/root.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \ $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \ $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \ @@ -966,7 +990,7 @@ drill/root.lo drill/root.o: $(srcdir)/dr $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ - $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/securetrace.lo drill/securetrace.o: $(srcdir)/drill/securetrace.c $(srcdir)/drill/drill.h ldns/config.h \ $(srcdir)/drill/drill_util.h $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h \ $(srcdir)/ldns/error.h $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h \ @@ -974,8 +998,8 @@ drill/securetrace.lo drill/securetrace.o $(srcdir)/ldns/tsig.h $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h \ $(srcdir)/ldns/dnssec_verify.h $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h \ $(srcdir)/ldns/host2wire.h ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h \ - $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h \ - $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/wire2host.h $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h \ + $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h drill/work.lo drill/work.o: $(srcdir)/drill/work.c $(srcdir)/drill/drill.h ldns/config.h $(srcdir)/drill/drill_util.h \ $(srcdir)/ldns/ldns.h ldns/util.h ldns/common.h $(srcdir)/ldns/buffer.h $(srcdir)/ldns/error.h \ $(srcdir)/ldns/dane.h $(srcdir)/ldns/rdata.h $(srcdir)/ldns/rr.h $(srcdir)/ldns/dname.h $(srcdir)/ldns/dnssec.h \ @@ -983,7 +1007,7 @@ drill/work.lo drill/work.o: $(srcdir)/dr $(srcdir)/ldns/dnssec_zone.h $(srcdir)/ldns/rbtree.h $(srcdir)/ldns/host2str.h $(srcdir)/ldns/dnssec_verify.h \ $(srcdir)/ldns/dnssec_sign.h $(srcdir)/ldns/duration.h $(srcdir)/ldns/higher.h $(srcdir)/ldns/host2wire.h \ ldns/net.h $(srcdir)/ldns/str2host.h $(srcdir)/ldns/update.h $(srcdir)/ldns/wire2host.h \ - $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h + $(srcdir)/ldns/rr_functions.h $(srcdir)/ldns/parse.h $(srcdir)/ldns/radix.h $(srcdir)/ldns/sha1.h $(srcdir)/ldns/sha2.h examples/ldns-chaos: examples/ldns-chaos.lo examples/ldns-chaos.o $(LIB) examples/ldns-compare-zones: examples/ldns-compare-zones.lo examples/ldns-compare-zones.o $(LIB) examples/ldnsd: examples/ldnsd.lo examples/ldnsd.o $(LIB) Modified: head/contrib/ldns/README ============================================================================== --- head/contrib/ldns/README Thu May 15 03:22:57 2014 (r266113) +++ head/contrib/ldns/README Thu May 15 03:30:03 2014 (r266114) @@ -37,11 +37,11 @@ INSTALLATION 5. make install -* Building from subversion repository +* Building from repository If you are building from the repository you will need to have (gnu) autotools like libtool and autoreconf installed. A list of all the commands -needed to build everything can be found in README.svn. Note that the actual +needed to build everything can be found in README.git. Note that the actual commands may be a little bit different on your machine. Most notable, you'll need to run libtoolize (or glibtoolize), if you skip this step, you'll get an error about missing config.sub. * Developers Copied: head/contrib/ldns/README.git (from r266072, vendor/ldns/dist/README.git) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/ldns/README.git Thu May 15 03:30:03 2014 (r266114, copy of r266072, vendor/ldns/dist/README.git) @@ -0,0 +1,22 @@ +# The ldns git repository can found at: +# git.nlnetlabs.nl/ldns/ + +# small list of commands to build all on a linux system +# libtoolize is needed for most other targets + +# on Solaris, and other systems that may not have +# the default 'automake' and 'aclocal' script aliases, +# the correct versions may need to be set. On those +# systems, the 'autoreconf' line should be changed to: +# AUTOMAKE=automake-1.10 ACLOCAL=aclocal-1.10 autoreconf + +# older versions of libtoolize do not support --install +# so you might need to remove that (with newer versions +# it is needed) +libtoolize -c --install +autoreconf --install +./configure --with-examples --with-drill # --with-pyldns --with-p5-dns-ldns +make +make doc # needs doxygen for the html pages +(cd pcat && autoreconf && ./configure && make) +(cd examples/nsd-test && autoreconf && ./configure && make) Modified: head/contrib/ldns/acx_nlnetlabs.m4 ============================================================================== --- head/contrib/ldns/acx_nlnetlabs.m4 Thu May 15 03:22:57 2014 (r266113) +++ head/contrib/ldns/acx_nlnetlabs.m4 Thu May 15 03:30:03 2014 (r266114) @@ -2,7 +2,12 @@ # Copyright 2009, Wouter Wijngaards, NLnet Labs. # BSD licensed. # -# Version 21 +# Version 26 +# 2013-09-19 FLTO help text improved. +# 2013-07-18 Enable ACX_CHECK_COMPILER_FLAG to test for -Wstrict-prototypes +# 2013-06-25 FLTO has --disable-flto option. +# 2013-05-03 Update W32_SLEEP for newer mingw that links but not defines it. +# 2013-03-22 Fix ACX_RSRC_VERSION for long version numbers. # 2012-02-09 Fix AHX_MEMCMP_BROKEN with undef in compat/memcmp.h. # 2012-01-20 Fix COMPILER_FLAGS_UNBOUND for gcc 4.6.2 assigned-not-used-warns. # 2011-12-05 Fix getaddrinfowithincludes on windows with fedora16 mingw32-gcc. @@ -17,7 +22,7 @@ # 2010-07-02 Add check for ss_family (for minix). # 2010-04-26 Fix to use CPPFLAGS for CHECK_COMPILER_FLAGS. # 2010-03-01 Fix RPATH using CONFIG_COMMANDS to run at the very end. -# 2010-02-18 WITH_SSL outputs the LIBSSL_LDFLAGS, LIBS, CPPFLAGS seperate, -ldl +# 2010-02-18 WITH_SSL outputs the LIBSSL_LDFLAGS, LIBS, CPPFLAGS separate, -ldl # 2010-02-01 added ACX_CHECK_MEMCMP_SIGNED, AHX_MEMCMP_BROKEN # 2010-01-20 added AHX_COONFIG_STRLCAT # 2009-07-14 U_CHAR detection improved for windows crosscompile. @@ -101,7 +106,7 @@ dnl Calculate comma separated windows-re dnl Picks the first three(,0) or four numbers out of the name. dnl $1: variable for the result AC_DEFUN([ACX_RSRC_VERSION], -[$1=[`echo $PACKAGE_VERSION | sed -e 's/^[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*\([0-9]\).*$/\1,\2,\3,\4/' -e 's/^[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*\([0-9]\)[^0-9]*$/\1,\2,\3,0/' `] +[$1=[`echo $PACKAGE_VERSION | sed -e 's/^[^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\).*$/\1,\2,\3,\4/' -e 's/^[^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9]*$/\1,\2,\3,0/' `] ]) dnl Routine to help check for compiler flags. @@ -116,7 +121,7 @@ AC_MSG_CHECKING(whether $CC supports -$1 cache=`echo $1 | sed 'y%.=/+-%___p_%'` AC_CACHE_VAL(cv_prog_cc_flag_$cache, [ -echo 'void f(){}' >conftest.c +echo 'void f(void){}' >conftest.c if test -z "`$CC $CPPFLAGS $CFLAGS -$1 -c conftest.c 2>&1`"; then eval "cv_prog_cc_flag_$cache=yes" else @@ -405,19 +410,22 @@ int test() { dnl Check if CC supports -flto. dnl in a way that supports clang and suncc (that flag does something else, dnl but fails to link). It sets it in CFLAGS if it works. -AC_DEFUN([ACX_CHECK_FLTO], -[AC_MSG_CHECKING([if $CC supports -flto]) -BAKCFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -flto" -AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [ - if $CC $CFLAGS -o conftest conftest.c 2>&1 | grep "warning: no debug symbols in executable" >/dev/null; then - CFLAGS="$BAKCFLAGS" - AC_MSG_RESULT(no) - else - AC_MSG_RESULT(yes) - fi - rm -f conftest conftest.c conftest.o -], [CFLAGS="$BAKCFLAGS" ; AC_MSG_RESULT(no)]) +AC_DEFUN([ACX_CHECK_FLTO], [ + AC_ARG_ENABLE([flto], AS_HELP_STRING([--disable-flto], [Disable link-time optimization (gcc specific option)])) + AS_IF([test "x$enable_flto" != "xno"], [ + AC_MSG_CHECKING([if $CC supports -flto]) + BAKCFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -flto" + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [ + if $CC $CFLAGS -o conftest conftest.c 2>&1 | grep "warning: no debug symbols in executable" >/dev/null; then + CFLAGS="$BAKCFLAGS" + AC_MSG_RESULT(no) + else + AC_MSG_RESULT(yes) + fi + rm -f conftest conftest.c conftest.o + ], [CFLAGS="$BAKCFLAGS" ; AC_MSG_RESULT(no)]) + ]) ]) dnl Check the printf-format attribute (if any) @@ -1208,7 +1216,7 @@ struct tm *gmtime_r(const time_t *timep, dnl provide w32 compat definition for sleep AC_DEFUN([AHX_CONFIG_W32_SLEEP], [ -#ifndef HAVE_SLEEP +#if !defined(HAVE_SLEEP) || defined(HAVE_WINDOWS_H) #define sleep(x) Sleep((x)*1000) /* on win32 */ #endif /* HAVE_SLEEP */ ]) Modified: head/contrib/ldns/ax_python_devel.m4 ============================================================================== --- head/contrib/ldns/ax_python_devel.m4 Thu May 15 03:22:57 2014 (r266113) +++ head/contrib/ldns/ax_python_devel.m4 Thu May 15 03:30:03 2014 (r266114) @@ -34,11 +34,12 @@ # LICENSE # # Copyright (c) 2009 Sebastian Huber -# Copyright (c) 2009 Alan W. Irwin +# Copyright (c) 2009 Alan W. Irwin # Copyright (c) 2009 Rafael Laboissiere -# Copyright (c) 2009 Andrew Collier +# Copyright (c) 2009 Andrew Collier # Copyright (c) 2009 Matteo Settenvini # Copyright (c) 2009 Horst Knorr +# Copyright (c) 2013 Daniel Mullner # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -66,7 +67,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 8 +#serial 16 AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL]) AC_DEFUN([AX_PYTHON_DEVEL],[ @@ -153,8 +154,14 @@ $ac_distutils_result]) if test -z "$PYTHON_CPPFLAGS"; then python_path=`$PYTHON -c "import distutils.sysconfig; \ print (distutils.sysconfig.get_python_inc ());"` + plat_python_path=`$PYTHON -c "import distutils.sysconfig; \ + print (distutils.sysconfig.get_python_inc (plat_specific=1));"` if test -n "${python_path}"; then - python_path="-I$python_path" + if test "${plat_python_path}" != "${python_path}"; then + python_path="-I$python_path -I$plat_python_path" + else + python_path="-I$python_path" + fi fi PYTHON_CPPFLAGS=$python_path fi @@ -173,13 +180,10 @@ $ac_distutils_result]) # join all versioning strings, on some systems # major/minor numbers could be in different list elements from distutils.sysconfig import * -ret = '' -for e in get_config_vars ('VERSION'): - if (e != None): - ret += e -print (ret) -EOD -` +e = get_config_var('VERSION') +if e is not None: + print(e) +EOD` if test -z "$ac_python_version"; then if test -n "$PYTHON_VERSION"; then @@ -199,34 +203,27 @@ EOD # There should be only one import distutils.sysconfig -for e in distutils.sysconfig.get_config_vars ('LIBDIR'): - if e != None: - print (e) - break -EOD -` - - # Before checking for libpythonX.Y, we need to know - # the extension the OS we're on uses for libraries - # (we take the first one, if there's more than one fix me!): - ac_python_soext=`$PYTHON -c \ - "import distutils.sysconfig; \ - print (distutils.sysconfig.get_config_vars('SO')[[0]])"` +e = distutils.sysconfig.get_config_var('LIBDIR') +if e is not None: + print (e) +EOD` *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu May 15 03:47:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 918CAD5B; Thu, 15 May 2014 03:47:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FB472B69; Thu, 15 May 2014 03:47:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4F3lqTx035437; Thu, 15 May 2014 03:47:52 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4F3lqkC035436; Thu, 15 May 2014 03:47:52 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201405150347.s4F3lqkC035436@svn.freebsd.org> From: Rui Paulo Date: Thu, 15 May 2014 03:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266115 - head/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 03:47:52 -0000 Author: rpaulo Date: Thu May 15 03:47:52 2014 New Revision: 266115 URL: http://svnweb.freebsd.org/changeset/base/266115 Log: Add a new target cscope-hook. This adds a Mercurial hook to automatically update the cscope data base every time you pull, switch branch, or update. Modified: head/sys/Makefile Modified: head/sys/Makefile ============================================================================== --- head/sys/Makefile Thu May 15 03:30:03 2014 (r266114) +++ head/sys/Makefile Thu May 15 03:47:52 2014 (r266115) @@ -47,6 +47,25 @@ ${.CURDIR}/cscope.files: .PHONY cscope-clean: rm -f cscope.files cscope.out cscope.in.out cscope.po.out +# +# Installs SCM hooks to update the cscope database every time the source tree +# is updated. +# cscope understands incremental updates, so it's considerably faster when only +# a few files have changed. +# +HG_DIR=${.CURDIR}/../.hg +HG_HOOK=if [ \$$HG_ERROR -eq 0 ]; then cd sys && make -m ../share/mk cscope; fi +cscope-hook: + @if [ -d ${HG_DIR} ]; then \ + if [ "`grep hooks ${HG_DIR}/hgrc`" = "" ]; then \ + echo "[hooks]" >> ${HG_DIR}/hgrc; \ + echo "update = ${HG_HOOK}" >> ${HG_DIR}/hgrc; \ + echo "Hook installed in ${HG_DIR}/hgrc"; \ + else \ + echo "Mercurial update hook already exists."; \ + fi; \ + fi + # You need the devel/global and one of editor/emacs* ports for that. TAGS ${.CURDIR}/TAGS: ${.CURDIR}/cscope.files rm -f ${.CURDIR}/TAGS From owner-svn-src-head@FreeBSD.ORG Thu May 15 04:18:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94ED85A5; Thu, 15 May 2014 04:18:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82CAF2DDF; Thu, 15 May 2014 04:18:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4F4I7Bm048800; Thu, 15 May 2014 04:18:07 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4F4I7q4048799; Thu, 15 May 2014 04:18:07 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201405150418.s4F4I7q4048799@svn.freebsd.org> From: Justin Hibbits Date: Thu, 15 May 2014 04:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266116 - head/sys/powerpc/aim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 04:18:07 -0000 Author: jhibbits Date: Thu May 15 04:18:06 2014 New Revision: 266116 URL: http://svnweb.freebsd.org/changeset/base/266116 Log: A page mask size is 12-bits, not 11. MFC after: 1 week Modified: head/sys/powerpc/aim/trap_subr32.S Modified: head/sys/powerpc/aim/trap_subr32.S ============================================================================== --- head/sys/powerpc/aim/trap_subr32.S Thu May 15 03:47:52 2014 (r266115) +++ head/sys/powerpc/aim/trap_subr32.S Thu May 15 04:18:06 2014 (r266116) @@ -677,7 +677,7 @@ disitrap: mtcr %r31 bt 17,realtrap /* branch is user mode */ mfsprg1 %r31 /* get old SP */ - clrrwi %r31,%r31,11 /* Round SP down to nearest page */ + clrrwi %r31,%r31,12 /* Round SP down to nearest page */ sub. %r30,%r31,%r30 /* SP - DAR */ bge 1f neg %r30,%r30 /* modulo value */ From owner-svn-src-head@FreeBSD.ORG Thu May 15 05:35:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58B349E; Thu, 15 May 2014 05:35:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 468C9231C; Thu, 15 May 2014 05:35:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4F5Z1Gr082688; Thu, 15 May 2014 05:35:01 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4F5Z1aI082685; Thu, 15 May 2014 05:35:01 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201405150535.s4F5Z1aI082685@svn.freebsd.org> From: Eitan Adler Date: Thu, 15 May 2014 05:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266117 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 05:35:01 -0000 Author: eadler Date: Thu May 15 05:35:00 2014 New Revision: 266117 URL: http://svnweb.freebsd.org/changeset/base/266117 Log: units(1): Fix minor typos Obtained From: DragonflyBSD Modified: head/usr.bin/units/units.c Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Thu May 15 04:18:06 2014 (r266116) +++ head/usr.bin/units/units.c Thu May 15 05:35:00 2014 (r266117) @@ -291,7 +291,7 @@ showunit(struct unittype * theunit) counter = 1; } } - if ( counter > 1) + if (counter > 1) printf("%s%d", powerstring, counter); printf("\n"); } @@ -760,7 +760,7 @@ main(int argc, char **argv) el_source(el, NULL); history(inhistory, &ev, H_SETSIZE, 800); if (inhistory == 0) - err(1, "Could not initalize history"); + err(1, "Could not initialize history"); if (cap_enter() < 0 && errno != ENOSYS) err(1, "unable to enter capability mode"); From owner-svn-src-head@FreeBSD.ORG Thu May 15 10:07:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 579C9AF8; Thu, 15 May 2014 10:07:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 457942694; Thu, 15 May 2014 10:07:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FA70XV000535; Thu, 15 May 2014 10:07:00 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FA70rF000534; Thu, 15 May 2014 10:07:00 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201405151007.s4FA70rF000534@svn.freebsd.org> From: Ruslan Bukin Date: Thu, 15 May 2014 10:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266119 - head/sys/arm/freescale/vybrid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 10:07:00 -0000 Author: br Date: Thu May 15 10:06:59 2014 New Revision: 266119 URL: http://svnweb.freebsd.org/changeset/base/266119 Log: Fix return value. Should be logic one or zero. Modified: head/sys/arm/freescale/vybrid/vf_gpio.c Modified: head/sys/arm/freescale/vybrid/vf_gpio.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_gpio.c Thu May 15 09:55:21 2014 (r266118) +++ head/sys/arm/freescale/vybrid/vf_gpio.c Thu May 15 10:06:59 2014 (r266119) @@ -242,7 +242,7 @@ vf_gpio_pin_get(device_t dev, uint32_t p return (EINVAL); GPIO_LOCK(sc); - *val = (READ4(sc, GPIO_PDOR(i)) & (1 << (i % 32))); + *val = (READ4(sc, GPIO_PDIR(i)) & (1 << (i % 32))) ? 1 : 0; GPIO_UNLOCK(sc); return (0); From owner-svn-src-head@FreeBSD.ORG Thu May 15 10:27:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0CAEDE1C; Thu, 15 May 2014 10:27:18 +0000 (UTC) Received: from mail.machdep.com (mail.machdep.com [195.91.211.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B81F52846; Thu, 15 May 2014 10:27:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=machdep.com) by mail.machdep.com with smtp (Exim 4.82 (FreeBSD)) (envelope-from ) id 1Wksqo-0001SC-1Q; Thu, 15 May 2014 14:25:22 +0400 Received: by machdep.com (nbSMTP-1.00) for uid 1001 br@machdep.com; Thu, 15 May 2014 14:25:22 +0400 (MSK) Date: Thu, 15 May 2014 14:25:21 +0400 From: Ruslan Bukin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r266119 - head/sys/arm/freescale/vybrid Message-ID: <20140515102521.GA5487@machdep.com> References: <201405151007.s4FA70rF000534@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201405151007.s4FA70rF000534@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 10:27:18 -0000 On Thu, May 15, 2014 at 10:07:00AM +0000, Ruslan Bukin wrote: > Modified: head/sys/arm/freescale/vybrid/vf_gpio.c > ============================================================================== > --- head/sys/arm/freescale/vybrid/vf_gpio.c Thu May 15 09:55:21 2014 (r266118) > +++ head/sys/arm/freescale/vybrid/vf_gpio.c Thu May 15 10:06:59 2014 (r266119) > @@ -242,7 +242,7 @@ vf_gpio_pin_get(device_t dev, uint32_t p > return (EINVAL); > > GPIO_LOCK(sc); > - *val = (READ4(sc, GPIO_PDOR(i)) & (1 << (i % 32))); > + *val = (READ4(sc, GPIO_PDIR(i)) & (1 << (i % 32))) ? 1 : 0; ^^^^ Also use correct register for data input. From owner-svn-src-head@FreeBSD.ORG Thu May 15 11:21:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37F96D8E; Thu, 15 May 2014 11:21:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CEC22CC2; Thu, 15 May 2014 11:21:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FBLcnZ035307; Thu, 15 May 2014 11:21:38 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FBLcYO035306; Thu, 15 May 2014 11:21:38 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201405151121.s4FBLcYO035306@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 15 May 2014 11:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266120 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 11:21:39 -0000 Author: bapt Date: Thu May 15 11:21:38 2014 New Revision: 266120 URL: http://svnweb.freebsd.org/changeset/base/266120 Log: Add project name to the arc config it is still required when arcanist is used with SVN Modified: head/.arcconfig Modified: head/.arcconfig ============================================================================== --- head/.arcconfig Thu May 15 10:06:59 2014 (r266119) +++ head/.arcconfig Thu May 15 11:21:38 2014 (r266120) @@ -1,3 +1,4 @@ { + "project.name": "S" "phabricator.uri" : "https://phabric.freebsd.org/" } From owner-svn-src-head@FreeBSD.ORG Thu May 15 11:30:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE9B329A; Thu, 15 May 2014 11:30:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C369C2D3A; Thu, 15 May 2014 11:30:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FBUH9L037028; Thu, 15 May 2014 11:30:17 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FBUHXW037027; Thu, 15 May 2014 11:30:17 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201405151130.s4FBUHXW037027@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 15 May 2014 11:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266121 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 11:30:18 -0000 Author: bapt Date: Thu May 15 11:30:17 2014 New Revision: 266121 URL: http://svnweb.freebsd.org/changeset/base/266121 Log: Add the missing coma Modified: head/.arcconfig Modified: head/.arcconfig ============================================================================== --- head/.arcconfig Thu May 15 11:21:38 2014 (r266120) +++ head/.arcconfig Thu May 15 11:30:17 2014 (r266121) @@ -1,4 +1,4 @@ { - "project.name": "S" + "project.name": "S", "phabricator.uri" : "https://phabric.freebsd.org/" } From owner-svn-src-head@FreeBSD.ORG Thu May 15 12:56:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 266E8DF7; Thu, 15 May 2014 12:56:58 +0000 (UTC) Received: from mail.soaustin.net (pancho.soaustin.net [76.74.250.40]) by mx1.freebsd.org (Postfix) with ESMTP id 4C279254C; Thu, 15 May 2014 12:56:57 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id 60B665607F; Thu, 15 May 2014 07:56:56 -0500 (CDT) Date: Thu, 15 May 2014 07:56:56 -0500 From: Mark Linimon To: Baptiste Daroussin Subject: Re: svn commit: r266121 - head Message-ID: <20140515125656.GA24077@lonesome.com> References: <201405151130.s4FBUHXW037027@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201405151130.s4FBUHXW037027@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 12:56:58 -0000 On Thu, May 15, 2014 at 11:30:17AM +0000, Baptiste Daroussin wrote: > Log: > Add the missing coma I thought a coma was what happened from reading mailing lists. mcl From owner-svn-src-head@FreeBSD.ORG Thu May 15 13:31:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2AC95BEA for ; Thu, 15 May 2014 13:31:15 +0000 (UTC) Received: from mail-ie0-f177.google.com (mail-ie0-f177.google.com [209.85.223.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BBD41283F for ; Thu, 15 May 2014 13:31:14 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id rp18so992525iec.22 for ; Thu, 15 May 2014 06:31:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=Ch7jFEPF/hEzDtLkLveK+I6uJodKtzobKL/BPMc/bIo=; b=TpPuGyaSi/BXfvfutpxQW+Cv1EWhn1nizTZ0cVLrB4G5fsuRRpPBgxpb9uCrIpj8gl WfN9GSZL8cJXvOVpdb25c2lQQ1fQ/579l3+oyqCL5ekuXvh6RFeb2Rs++4mFQnswYWpi YytVWCDHCdTX7IZYnIh5SPNPieSeXIpZhZvr6K8URxbQmdYfK8goBV48r7o2kX96vlNc bgevf80BXEZ5fAKicpKUagd4S3F8JXwt3fn6B9Q7xq0K26JRuncXuLblxrjlDsktACIi 4aRd46vZywTge46qv2UzzZz2c96M26Fer0JFoiYCeOTJD/Jp2ls4gTxt4zMiTMhQlWWK N+gA== X-Gm-Message-State: ALoCoQnCtQxEAm5qmSnLIvb2pp+0LYr5J57K3ZQv2I2fxMgtBVV0IyHh+V+f/YQJdPOzhUatvlsw X-Received: by 10.42.41.14 with SMTP id n14mr9218617ice.30.1400160668349; Thu, 15 May 2014 06:31:08 -0700 (PDT) Received: from [10.69.210.117] ([137.122.64.30]) by mx.google.com with ESMTPSA id n5sm13130490ige.22.2014.05.15.06.31.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 May 2014 06:31:07 -0700 (PDT) Sender: Julio Merino Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r266104 - head/usr.bin/bmake From: Julio Merino In-Reply-To: <201405150127.s4F1RPxK072767@svn.freebsd.org> Date: Thu, 15 May 2014 09:31:04 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <538F0E8D-DF1A-4593-BF82-7AC9307EAA3E@freebsd.org> References: <201405150127.s4F1RPxK072767@svn.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 13:31:15 -0000 On May 14, 2014, at 21:27, Warner Losh wrote: > Author: imp > Date: Thu May 15 01:27:24 2014 > New Revision: 266104 > URL: http://svnweb.freebsd.org/changeset/base/266104 >=20 > Log: > Undo changes to the generated Makefile. Move tests directory to = proper > location, including updating the test to work in the more-fragile > fmake -> bmake bootstrap environment. >=20 > Modified: > head/usr.bin/bmake/Makefile > head/usr.bin/bmake/Makefile.inc [...] > Modified: head/usr.bin/bmake/Makefile.inc > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/usr.bin/bmake/Makefile.inc Thu May 15 01:06:27 2014 = (r266103) > +++ head/usr.bin/bmake/Makefile.inc Thu May 15 01:27:24 2014 = (r266104) > @@ -13,5 +13,9 @@ PROG=3D make > NO_SHARED?=3D YES > .endif >=20 > +.if defined(MK_TESTS) && ${MK_TESTS} !=3D no > +SUBDIR+=3D tests > +.endif > + Ugh, and this broke the build when MK_TESTS=3Dyes. The problem is that = tests/Makefile transparently includes ../Makefile.inc, which defines = SUBDIR+=3Dtests (as above)... and this is obviously invalid within the = tests subdirectory. What's your suggestion to fix this? I can think of renaming = Makefile.inc to something different to ensure that the subdirectories = don't spuriously include it.=09= From owner-svn-src-head@FreeBSD.ORG Thu May 15 13:34:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72335D99 for ; Thu, 15 May 2014 13:34:40 +0000 (UTC) Received: from mail-ig0-f169.google.com (mail-ig0-f169.google.com [209.85.213.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3773D28C6 for ; Thu, 15 May 2014 13:34:39 +0000 (UTC) Received: by mail-ig0-f169.google.com with SMTP id hl10so381861igb.2 for ; Thu, 15 May 2014 06:34:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=i2Zkh3nwR38KNP56rZ5de3GMxfA2lb3+oI+cf660sy8=; b=PrwVVD2E4AXsJp1OZakpM1kJLq9CT6XKSAV9gtQm0RfTFKV5/AoGXvxLdSgAGaayHn uXGkmphaq3Yn8QQH2BbS6zmApkrgp9AFXGWezHokaynP6kJNR/VKJBqjz1Yj2eP/PQFx Pm7ffwqVmrHuki4mQ8ouPwQISCAflOihhrxvr+MZjVeU4MlP1dlj0UCHaIE19wSiAFZg s8M+SLR0pkHd1raUVNiX2ZxaXJjGRTzdf+6K0NJyHYQZOLgl6M8t+cQOL8HYhzxS00mc TTj5i6kJtX3BaiGYTN91pqbjVgH5fGlr+gKPVKZmx4OS7HSMiUqehZXiI1dQw1mfySGc Oc4Q== X-Gm-Message-State: ALoCoQk4+jqrwbTE9U0/S1DXsB9y4rTcEJB91xCn4JAOCcJj4PgHxacSyJPVVLjNi5P8ceZT+Yrl X-Received: by 10.50.57.17 with SMTP id e17mr72828630igq.10.1400160879155; Thu, 15 May 2014 06:34:39 -0700 (PDT) Received: from [10.69.224.86] ([137.122.64.13]) by mx.google.com with ESMTPSA id qo12sm21002907igb.21.2014.05.15.06.34.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 May 2014 06:34:38 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_5B1FB5B7-03B5-4810-B14C-2EBB27340DFD"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r266104 - head/usr.bin/bmake From: Warner Losh In-Reply-To: <538F0E8D-DF1A-4593-BF82-7AC9307EAA3E@freebsd.org> Date: Thu, 15 May 2014 09:34:36 -0400 Message-Id: References: <201405150127.s4F1RPxK072767@svn.freebsd.org> <538F0E8D-DF1A-4593-BF82-7AC9307EAA3E@freebsd.org> To: Julio Merino X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 13:34:40 -0000 --Apple-Mail=_5B1FB5B7-03B5-4810-B14C-2EBB27340DFD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On May 15, 2014, at 9:31 AM, Julio Merino wrote: > On May 14, 2014, at 21:27, Warner Losh wrote: >=20 >> Author: imp >> Date: Thu May 15 01:27:24 2014 >> New Revision: 266104 >> URL: http://svnweb.freebsd.org/changeset/base/266104 >>=20 >> Log: >> Undo changes to the generated Makefile. Move tests directory to = proper >> location, including updating the test to work in the more-fragile >> fmake -> bmake bootstrap environment. >>=20 >> Modified: >> head/usr.bin/bmake/Makefile >> head/usr.bin/bmake/Makefile.inc > [...] >> Modified: head/usr.bin/bmake/Makefile.inc >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/usr.bin/bmake/Makefile.inc Thu May 15 01:06:27 2014 = (r266103) >> +++ head/usr.bin/bmake/Makefile.inc Thu May 15 01:27:24 2014 = (r266104) >> @@ -13,5 +13,9 @@ PROG=3D make >> NO_SHARED?=3D YES >> .endif >>=20 >> +.if defined(MK_TESTS) && ${MK_TESTS} !=3D no >> +SUBDIR+=3D tests >> +.endif >> + >=20 > Ugh, and this broke the build when MK_TESTS=3Dyes. The problem is = that tests/Makefile transparently includes ../Makefile.inc, which = defines SUBDIR+=3Dtests (as above)... and this is obviously invalid = within the tests subdirectory. >=20 > What's your suggestion to fix this? I can think of renaming = Makefile.inc to something different to ensure that the subdirectories = don't spuriously include it.=09 That may be the best solution, but I=92d like a little time to think = about it=85 The other option is to toss an && exists(${.CURDIR}/tests) = on the end as well... Warner --Apple-Mail=_5B1FB5B7-03B5-4810-B14C-2EBB27340DFD Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTdMJsAAoJEGwc0Sh9sBEAALsP/0xd2s8l3N8ZutHrHCuP5Txj pkv5XEkE2kQC7//zWkYibQid00h69SIWVA6Kc/9kp0Zh8KyqkC2Bs9XWhxKgMUtB bx3dlf1A8Q0eqVvn+bnHcaNcjoPbrk8wXr/XeA8+zBLCV2C3MFblPSbEC/nl6T5F r+iFGoq1fVvnBmekdIBAT+cBDesuXkA/1/JAm03m0D4s+6zYmAOC+UlsUF0dnhNJ LMdXBCWIvuJ/96xowE2EczRVtavoPsMnmLSfpFst3QUUnt3lcTHQ+NbLcFNZ+WvX p3/JLraBnqXbZdwvtlSArThHknxFFKV79Nxy2ss58xMXLUIAUiaMFmDxflB7kynU s4Tbp6BUi2BCC+fbHd4i4MMjAxhvTI7LaHK7NhDBgwTyhQvJOFShqFgpoPUQL0e5 Pz5NAvsOGgcZ6FrurydI76XiuzFZbBiN10t/67JJ1d3+txB9LU/xAmKbHTFPMBsj wRnaSIT1MskYvQEkadujlEcXynRqrBsRh41HARv4uMjz976k7BKbCmz1W7CeDn5O zy49AD59Alj+BELnsSY96rH1oaHaKcfBtEE8DV0+vSm2oX/4YuLPhk0EiSA1YhJy 1YfgrtQyrxEz8V3ZscTZb4rEtlDDIsmfrFnFoU0JZdL4P0F/Zz3UOKZJTVO32/Wu BF/rTZfPGzOjlsQ1frZe =lQmV -----END PGP SIGNATURE----- --Apple-Mail=_5B1FB5B7-03B5-4810-B14C-2EBB27340DFD-- From owner-svn-src-head@FreeBSD.ORG Thu May 15 13:45:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0AB965C5; Thu, 15 May 2014 13:45:26 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id D2B4F29BF; Thu, 15 May 2014 13:45:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id A0C6D3805A; Thu, 15 May 2014 08:45:19 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id K1xK6xvLCNDh; Thu, 15 May 2014 08:45:19 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 11BDB38056; Thu, 15 May 2014 08:45:18 -0500 (CDT) Message-ID: <5374C4EE.9040201@freebsd.org> Date: Thu, 15 May 2014 06:45:18 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r266116 - head/sys/powerpc/aim References: <201405150418.s4F4I7q4048799@svn.freebsd.org> In-Reply-To: <201405150418.s4F4I7q4048799@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 13:45:26 -0000 On 05/14/14 21:18, Justin Hibbits wrote: > Author: jhibbits > Date: Thu May 15 04:18:06 2014 > New Revision: 266116 > URL: http://svnweb.freebsd.org/changeset/base/266116 > > Log: > A page mask size is 12-bits, not 11. > > MFC after: 1 week > > Modified: > head/sys/powerpc/aim/trap_subr32.S > > Modified: head/sys/powerpc/aim/trap_subr32.S > ============================================================================== > --- head/sys/powerpc/aim/trap_subr32.S Thu May 15 03:47:52 2014 (r266115) > +++ head/sys/powerpc/aim/trap_subr32.S Thu May 15 04:18:06 2014 (r266116) > @@ -677,7 +677,7 @@ disitrap: > mtcr %r31 > bt 17,realtrap /* branch is user mode */ > mfsprg1 %r31 /* get old SP */ > - clrrwi %r31,%r31,11 /* Round SP down to nearest page */ > + clrrwi %r31,%r31,12 /* Round SP down to nearest page */ > sub. %r30,%r31,%r30 /* SP - DAR */ > bge 1f > neg %r30,%r30 /* modulo value */ > Is it? 4096 bytes is 2^12. The mask is 4096-1, which is 11 bits all 1. -Nathan From owner-svn-src-head@FreeBSD.ORG Thu May 15 13:52:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5AE01917; Thu, 15 May 2014 13:52:03 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 2DF372A70; Thu, 15 May 2014 13:52:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id A202638054; Thu, 15 May 2014 08:52:02 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id HNimfOY6t9pe; Thu, 15 May 2014 08:52:02 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 1BC9A38056; Thu, 15 May 2014 08:52:02 -0500 (CDT) Message-ID: <5374C681.9080505@freebsd.org> Date: Thu, 15 May 2014 06:52:01 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r266116 - head/sys/powerpc/aim References: <201405150418.s4F4I7q4048799@svn.freebsd.org> <5374C4EE.9040201@freebsd.org> In-Reply-To: <5374C4EE.9040201@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 13:52:03 -0000 On 05/15/14 06:45, Nathan Whitehorn wrote: > On 05/14/14 21:18, Justin Hibbits wrote: >> Author: jhibbits >> Date: Thu May 15 04:18:06 2014 >> New Revision: 266116 >> URL: http://svnweb.freebsd.org/changeset/base/266116 >> >> Log: >> A page mask size is 12-bits, not 11. >> MFC after: 1 week >> >> Modified: >> head/sys/powerpc/aim/trap_subr32.S >> >> Modified: head/sys/powerpc/aim/trap_subr32.S >> ============================================================================== >> >> --- head/sys/powerpc/aim/trap_subr32.S Thu May 15 03:47:52 2014 >> (r266115) >> +++ head/sys/powerpc/aim/trap_subr32.S Thu May 15 04:18:06 2014 >> (r266116) >> @@ -677,7 +677,7 @@ disitrap: >> mtcr %r31 >> bt 17,realtrap /* branch is user mode */ >> mfsprg1 %r31 /* get old SP */ >> - clrrwi %r31,%r31,11 /* Round SP down to nearest page */ >> + clrrwi %r31,%r31,12 /* Round SP down to nearest page */ >> sub. %r30,%r31,%r30 /* SP - DAR */ >> bge 1f >> neg %r30,%r30 /* modulo value */ >> > > Is it? 4096 bytes is 2^12. The mask is 4096-1, which is 11 bits all 1. > -Nathan > Sorry, I can't do math. Please ignore this email. -Nathan From owner-svn-src-head@FreeBSD.ORG Thu May 15 14:16:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CBB853D; Thu, 15 May 2014 14:16:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27D692C8B; Thu, 15 May 2014 14:16:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FEGxpI014291; Thu, 15 May 2014 14:16:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FEGtIm014267; Thu, 15 May 2014 14:16:55 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405151416.s4FEGtIm014267@svn.freebsd.org> From: John Baldwin Date: Thu, 15 May 2014 14:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266125 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/io usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 14:16:59 -0000 Author: jhb Date: Thu May 15 14:16:55 2014 New Revision: 266125 URL: http://svnweb.freebsd.org/changeset/base/266125 Log: Implement a PCI interrupt router to route PCI legacy INTx interrupts to the legacy 8259A PICs. - Implement an ICH-comptabile PCI interrupt router on the lpc device with 8 steerable pins configured via config space access to byte-wide registers at 0x60-63 and 0x68-6b. - For each configured PCI INTx interrupt, route it to both an I/O APIC pin and a PCI interrupt router pin. When a PCI INTx interrupt is asserted, ensure that both pins are asserted. - Provide an initial routing of PCI interrupt router (PIRQ) pins to 8259A pins (ISA IRQs) and initialize the interrupt line config register for the corresponding PCI function with the ISA IRQ as this matches existing hardware. - Add a global _PIC method for OSPM to select the desired interrupt routing configuration. - Update the _PRT methods for PCI bridges to provide both APIC and legacy PRT tables and return the appropriate table based on the configured routing configuration. Note that if the lpc device is not configured, no routing information is provided. - When the lpc device is enabled, provide ACPI PCI link devices corresponding to each PIRQ pin. - Add a VMM ioctl to adjust the trigger mode (edge vs level) for 8259A pins via the ELCR. - Mark the power management SCI as level triggered. - Don't hardcode the number of elements in Packages in the source for the DSDT. iasl(8) will fill in the actual number of elements, and this makes it simpler to generate a Package with a variable number of elements. Reviewed by: tycho Added: head/usr.sbin/bhyve/pci_irq.c (contents, props changed) head/usr.sbin/bhyve/pci_irq.h (contents, props changed) Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/io/vatpic.c head/sys/amd64/vmm/io/vatpic.h head/sys/amd64/vmm/vmm_dev.c head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/acpi.c head/usr.sbin/bhyve/acpi.h head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/mptbl.c head/usr.sbin/bhyve/pci_emul.c head/usr.sbin/bhyve/pci_emul.h head/usr.sbin/bhyve/pci_lpc.c head/usr.sbin/bhyve/pci_lpc.h head/usr.sbin/bhyve/pm.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Thu May 15 14:01:34 2014 (r266124) +++ head/lib/libvmmapi/vmmapi.c Thu May 15 14:16:55 2014 (r266125) @@ -507,6 +507,7 @@ int vm_isa_pulse_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq) { struct vm_isa_irq isa_irq; + bzero(&isa_irq, sizeof(struct vm_isa_irq)); isa_irq.atpic_irq = atpic_irq; isa_irq.ioapic_irq = ioapic_irq; @@ -515,6 +516,19 @@ vm_isa_pulse_irq(struct vmctx *ctx, int } int +vm_isa_set_irq_trigger(struct vmctx *ctx, int atpic_irq, + enum vm_intr_trigger trigger) +{ + struct vm_isa_irq_trigger isa_irq_trigger; + + bzero(&isa_irq_trigger, sizeof(struct vm_isa_irq_trigger)); + isa_irq_trigger.atpic_irq = atpic_irq; + isa_irq_trigger.trigger = trigger; + + return (ioctl(ctx->fd, VM_ISA_SET_IRQ_TRIGGER, &isa_irq_trigger)); +} + +int vm_inject_nmi(struct vmctx *ctx, int vcpu) { struct vm_nmi vmnmi; Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Thu May 15 14:01:34 2014 (r266124) +++ head/lib/libvmmapi/vmmapi.h Thu May 15 14:16:55 2014 (r266125) @@ -78,6 +78,8 @@ int vm_ioapic_pincount(struct vmctx *ctx int vm_isa_assert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); int vm_isa_deassert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); int vm_isa_pulse_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); +int vm_isa_set_irq_trigger(struct vmctx *ctx, int atpic_irq, + enum vm_intr_trigger trigger); int vm_inject_nmi(struct vmctx *ctx, int vcpu); int vm_capability_name2type(const char *capname); const char *vm_capability_type2name(int type); Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Thu May 15 14:01:34 2014 (r266124) +++ head/sys/amd64/include/vmm.h Thu May 15 14:16:55 2014 (r266125) @@ -301,6 +301,11 @@ enum x2apic_state { X2APIC_STATE_LAST }; +enum vm_intr_trigger { + EDGE_TRIGGER, + LEVEL_TRIGGER +}; + /* * The 'access' field has the format specified in Table 21-2 of the Intel * Architecture Manual vol 3b. Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Thu May 15 14:01:34 2014 (r266124) +++ head/sys/amd64/include/vmm_dev.h Thu May 15 14:16:55 2014 (r266125) @@ -84,6 +84,11 @@ struct vm_isa_irq { int ioapic_irq; }; +struct vm_isa_irq_trigger { + int atpic_irq; + enum vm_intr_trigger trigger; +}; + struct vm_capability { int cpuid; enum vm_cap_type captype; @@ -213,6 +218,7 @@ enum { IOCNUM_ISA_ASSERT_IRQ = 80, IOCNUM_ISA_DEASSERT_IRQ = 81, IOCNUM_ISA_PULSE_IRQ = 82, + IOCNUM_ISA_SET_IRQ_TRIGGER = 83, }; #define VM_RUN \ @@ -253,6 +259,8 @@ enum { _IOW('v', IOCNUM_ISA_DEASSERT_IRQ, struct vm_isa_irq) #define VM_ISA_PULSE_IRQ \ _IOW('v', IOCNUM_ISA_PULSE_IRQ, struct vm_isa_irq) +#define VM_ISA_SET_IRQ_TRIGGER \ + _IOW('v', IOCNUM_ISA_SET_IRQ_TRIGGER, struct vm_isa_irq_trigger) #define VM_SET_CAPABILITY \ _IOW('v', IOCNUM_SET_CAPABILITY, struct vm_capability) #define VM_GET_CAPABILITY \ Modified: head/sys/amd64/vmm/io/vatpic.c ============================================================================== --- head/sys/amd64/vmm/io/vatpic.c Thu May 15 14:01:34 2014 (r266124) +++ head/sys/amd64/vmm/io/vatpic.c Thu May 15 14:16:55 2014 (r266125) @@ -446,6 +446,43 @@ vatpic_pulse_irq(struct vm *vm, int irq) return (vatpic_set_irqstate(vm, irq, IRQSTATE_PULSE)); } +int +vatpic_set_irq_trigger(struct vm *vm, int irq, enum vm_intr_trigger trigger) +{ + struct vatpic *vatpic; + + if (irq < 0 || irq > 15) + return (EINVAL); + + /* + * See comment in vatpic_elc_handler. These IRQs must be + * edge triggered. + */ + if (trigger == LEVEL_TRIGGER) { + switch (irq) { + case 0: + case 1: + case 2: + case 8: + case 13: + return (EINVAL); + } + } + + vatpic = vm_atpic(vm); + + VATPIC_LOCK(vatpic); + + if (trigger == LEVEL_TRIGGER) + vatpic->elc[irq >> 3] |= 1 << (irq & 0x7); + else + vatpic->elc[irq >> 3] &= ~(1 << (irq & 0x7)); + + VATPIC_UNLOCK(vatpic); + + return (0); +} + void vatpic_pending_intr(struct vm *vm, int *vecptr) { Modified: head/sys/amd64/vmm/io/vatpic.h ============================================================================== --- head/sys/amd64/vmm/io/vatpic.h Thu May 15 14:01:34 2014 (r266124) +++ head/sys/amd64/vmm/io/vatpic.h Thu May 15 14:16:55 2014 (r266125) @@ -49,6 +49,7 @@ int vatpic_elc_handler(void *vm, int vcp int vatpic_assert_irq(struct vm *vm, int irq); int vatpic_deassert_irq(struct vm *vm, int irq); int vatpic_pulse_irq(struct vm *vm, int irq); +int vatpic_set_irq_trigger(struct vm *vm, int irq, enum vm_intr_trigger trigger); void vatpic_pending_intr(struct vm *vm, int *vecptr); void vatpic_intr_accepted(struct vm *vm, int vector); Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Thu May 15 14:01:34 2014 (r266124) +++ head/sys/amd64/vmm/vmm_dev.c Thu May 15 14:16:55 2014 (r266125) @@ -156,6 +156,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c struct vm_lapic_msi *vmmsi; struct vm_ioapic_irq *ioapic_irq; struct vm_isa_irq *isa_irq; + struct vm_isa_irq_trigger *isa_irq_trigger; struct vm_capability *vmcap; struct vm_pptdev *pptdev; struct vm_pptdev_mmio *pptmmio; @@ -346,6 +347,11 @@ vmmdev_ioctl(struct cdev *cdev, u_long c if (error == 0 && isa_irq->ioapic_irq != -1) error = vioapic_pulse_irq(sc->vm, isa_irq->ioapic_irq); break; + case VM_ISA_SET_IRQ_TRIGGER: + isa_irq_trigger = (struct vm_isa_irq_trigger *)data; + error = vatpic_set_irq_trigger(sc->vm, + isa_irq_trigger->atpic_irq, isa_irq_trigger->trigger); + break; case VM_MAP_MEMORY: seg = (struct vm_memory_segment *)data; error = vm_malloc(sc->vm, seg->gpa, seg->len); Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Thu May 15 14:01:34 2014 (r266124) +++ head/usr.sbin/bhyve/Makefile Thu May 15 14:16:55 2014 (r266125) @@ -23,6 +23,7 @@ SRCS= \ pci_ahci.c \ pci_emul.c \ pci_hostbridge.c \ + pci_irq.c \ pci_lpc.c \ pci_passthru.c \ pci_virtio_block.c \ Modified: head/usr.sbin/bhyve/acpi.c ============================================================================== --- head/usr.sbin/bhyve/acpi.c Thu May 15 14:01:34 2014 (r266124) +++ head/usr.sbin/bhyve/acpi.c Thu May 15 14:16:55 2014 (r266125) @@ -704,7 +704,7 @@ basl_fwrite_dsdt(FILE *fp) dsdt_line("DefinitionBlock (\"bhyve_dsdt.aml\", \"DSDT\", 2," "\"BHYVE \", \"BVDSDT \", 0x00000001)"); dsdt_line("{"); - dsdt_line(" Name (_S5, Package (0x02)"); + dsdt_line(" Name (_S5, Package ()"); dsdt_line(" {"); dsdt_line(" 0x05,"); dsdt_line(" Zero,"); Modified: head/usr.sbin/bhyve/acpi.h ============================================================================== --- head/usr.sbin/bhyve/acpi.h Thu May 15 14:01:34 2014 (r266124) +++ head/usr.sbin/bhyve/acpi.h Thu May 15 14:16:55 2014 (r266125) @@ -49,5 +49,6 @@ void dsdt_fixed_irq(uint8_t irq); void dsdt_fixed_mem32(uint32_t base, uint32_t length); void dsdt_indent(int levels); void dsdt_unindent(int levels); +void sci_init(struct vmctx *ctx); #endif /* _ACPI_H_ */ Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Thu May 15 14:01:34 2014 (r266124) +++ head/usr.sbin/bhyve/bhyverun.c Thu May 15 14:16:55 2014 (r266125) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include "mevent.h" #include "mptbl.h" #include "pci_emul.h" +#include "pci_irq.h" #include "pci_lpc.h" #include "smbiostbl.h" #include "xmsr.h" @@ -770,9 +771,11 @@ main(int argc, char *argv[]) init_mem(); init_inout(); + pci_irq_init(ctx); ioapic_init(ctx); rtc_init(ctx); + sci_init(ctx); /* * Exit if a device emulation finds an error in it's initilization Modified: head/usr.sbin/bhyve/mptbl.c ============================================================================== --- head/usr.sbin/bhyve/mptbl.c Thu May 15 14:01:34 2014 (r266124) +++ head/usr.sbin/bhyve/mptbl.c Thu May 15 14:16:55 2014 (r266125) @@ -210,7 +210,8 @@ mpt_count_ioint_entries(void) } static void -mpt_generate_pci_int(int bus, int slot, int pin, int ioapic_irq, void *arg) +mpt_generate_pci_int(int bus, int slot, int pin, int pirq_pin, int ioapic_irq, + void *arg) { int_entry_ptr *mpiep, mpie; Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Thu May 15 14:01:34 2014 (r266124) +++ head/usr.sbin/bhyve/pci_emul.c Thu May 15 14:16:55 2014 (r266125) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include "ioapic.h" #include "mem.h" #include "pci_emul.h" +#include "pci_irq.h" #include "pci_lpc.h" #define CONF1_ADDR_PORT 0x0cf8 @@ -81,6 +82,7 @@ struct funcinfo { struct intxinfo { int ii_count; + int ii_pirq_pin; int ii_ioapic_irq; }; @@ -113,6 +115,7 @@ static uint64_t pci_emul_membase64; #define PCI_EMUL_MEMLIMIT64 0xFD00000000UL static struct pci_devemu *pci_emul_finddev(char *name); +static void pci_lintr_route(struct pci_devinst *pi); static void pci_lintr_update(struct pci_devinst *pi); static struct mem_range pci_mem_hole; @@ -697,6 +700,7 @@ pci_emul_init(struct vmctx *ctx, struct pthread_mutex_init(&pdi->pi_lintr.lock, NULL); pdi->pi_lintr.pin = 0; pdi->pi_lintr.state = IDLE; + pdi->pi_lintr.pirq_pin = 0; pdi->pi_lintr.ioapic_irq = 0; pdi->pi_d = pde; snprintf(pdi->pi_name, PI_NAMESZ, "%s-pci-%d", pde->pe_emu, slot); @@ -1067,6 +1071,27 @@ init_pci(struct vmctx *ctx) } /* + * PCI backends are initialized before routing INTx interrupts + * so that LPC devices are able to reserve ISA IRQs before + * routing PIRQ pins. + */ + for (bus = 0; bus < MAXBUSES; bus++) { + if ((bi = pci_businfo[bus]) == NULL) + continue; + + for (slot = 0; slot < MAXSLOTS; slot++) { + si = &bi->slotinfo[slot]; + for (func = 0; func < MAXFUNCS; func++) { + fi = &si->si_funcs[func]; + if (fi->fi_devi == NULL) + continue; + pci_lintr_route(fi->fi_devi); + } + } + } + lpc_pirq_routed(); + + /* * The guest physical memory map looks like the following: * [0, lowmem) guest system memory * [lowmem, lowmem_limit) memory hole (may be absent) @@ -1093,19 +1118,36 @@ init_pci(struct vmctx *ctx) } static void -pci_prt_entry(int bus, int slot, int pin, int ioapic_irq, void *arg) +pci_apic_prt_entry(int bus, int slot, int pin, int pirq_pin, int ioapic_irq, + void *arg) { - int *count; - count = arg; - dsdt_line(" Package (0x04)"); + dsdt_line(" Package ()"); dsdt_line(" {"); dsdt_line(" 0x%X,", slot << 16 | 0xffff); dsdt_line(" 0x%02X,", pin - 1); dsdt_line(" Zero,"); dsdt_line(" 0x%X", ioapic_irq); - dsdt_line(" }%s", *count == 1 ? "" : ","); - (*count)--; + dsdt_line(" },"); +} + +static void +pci_pirq_prt_entry(int bus, int slot, int pin, int pirq_pin, int ioapic_irq, + void *arg) +{ + char *name; + + name = lpc_pirq_name(pirq_pin); + if (name == NULL) + return; + dsdt_line(" Package ()"); + dsdt_line(" {"); + dsdt_line(" 0x%X,", slot << 16 | 0xffff); + dsdt_line(" 0x%02X,", pin - 1); + dsdt_line(" %s,", name); + dsdt_line(" 0x00"); + dsdt_line(" },"); + free(name); } /* @@ -1118,7 +1160,7 @@ pci_bus_write_dsdt(int bus) struct businfo *bi; struct slotinfo *si; struct pci_devinst *pi; - int count, slot, func; + int count, func, slot; /* * If there are no devices on this 'bus' then just return. @@ -1133,9 +1175,6 @@ pci_bus_write_dsdt(int bus) return; } - dsdt_indent(1); - dsdt_line("Scope (_SB)"); - dsdt_line("{"); dsdt_line(" Device (PC%02X)", bus); dsdt_line(" {"); dsdt_line(" Name (_HID, EisaId (\"PNP0A03\"))"); @@ -1228,10 +1267,25 @@ pci_bus_write_dsdt(int bus) count = pci_count_lintr(bus); if (count != 0) { dsdt_indent(2); - dsdt_line("Name (_PRT, Package (0x%02X)", count); + dsdt_line("Name (PPRT, Package ()"); dsdt_line("{"); - pci_walk_lintr(bus, pci_prt_entry, &count); - dsdt_line("})"); + pci_walk_lintr(bus, pci_pirq_prt_entry, NULL); + dsdt_line("})"); + dsdt_line("Name (APRT, Package ()"); + dsdt_line("{"); + pci_walk_lintr(bus, pci_apic_prt_entry, NULL); + dsdt_line("})"); + dsdt_line("Method (_PRT, 0, NotSerialized)"); + dsdt_line("{"); + dsdt_line(" If (PICM)"); + dsdt_line(" {"); + dsdt_line(" Return (APRT)"); + dsdt_line(" }"); + dsdt_line(" Else"); + dsdt_line(" {"); + dsdt_line(" Return (PPRT)"); + dsdt_line(" }"); + dsdt_line("}"); dsdt_unindent(2); } @@ -1247,8 +1301,6 @@ pci_bus_write_dsdt(int bus) dsdt_unindent(2); done: dsdt_line(" }"); - dsdt_line("}"); - dsdt_unindent(1); } void @@ -1256,8 +1308,19 @@ pci_write_dsdt(void) { int bus; + dsdt_indent(1); + dsdt_line("Name (PICM, 0x00)"); + dsdt_line("Method (_PIC, 1, NotSerialized)"); + dsdt_line("{"); + dsdt_line(" Store (Arg0, PICM)"); + dsdt_line("}"); + dsdt_line(""); + dsdt_line("Scope (_SB)"); + dsdt_line("{"); for (bus = 0; bus < MAXBUSES; bus++) pci_bus_write_dsdt(bus); + dsdt_line("}"); + dsdt_unindent(1); } int @@ -1330,18 +1393,19 @@ pci_lintr_permitted(struct pci_devinst * (cmd & PCIM_CMD_INTxDIS))); } -int +void pci_lintr_request(struct pci_devinst *pi) { struct businfo *bi; struct slotinfo *si; - int bestpin, bestcount, irq, pin; + int bestpin, bestcount, pin; bi = pci_businfo[pi->pi_bus]; assert(bi != NULL); /* - * First, allocate a pin from our slot. + * Just allocate a pin from our slot. The pin will be + * assigned IRQs later when interrupts are routed. */ si = &bi->slotinfo[pi->pi_slot]; bestpin = 0; @@ -1353,26 +1417,43 @@ pci_lintr_request(struct pci_devinst *pi } } - /* - * Attempt to allocate an I/O APIC pin for this intpin. If - * 8259A support is added we will need a separate field to - * assign the intpin to an input pin on the PCI interrupt - * router. - */ - if (si->si_intpins[bestpin].ii_count == 0) { - irq = ioapic_pci_alloc_irq(); - if (irq < 0) - return (-1); - si->si_intpins[bestpin].ii_ioapic_irq = irq; - } else - irq = si->si_intpins[bestpin].ii_ioapic_irq; si->si_intpins[bestpin].ii_count++; - pi->pi_lintr.pin = bestpin + 1; - pi->pi_lintr.ioapic_irq = irq; - pci_set_cfgdata8(pi, PCIR_INTLINE, irq); pci_set_cfgdata8(pi, PCIR_INTPIN, bestpin + 1); - return (0); +} + +static void +pci_lintr_route(struct pci_devinst *pi) +{ + struct businfo *bi; + struct intxinfo *ii; + + if (pi->pi_lintr.pin == 0) + return; + + bi = pci_businfo[pi->pi_bus]; + assert(bi != NULL); + ii = &bi->slotinfo[pi->pi_slot].si_intpins[pi->pi_lintr.pin - 1]; + + /* + * Attempt to allocate an I/O APIC pin for this intpin if one + * is not yet assigned. + */ + if (ii->ii_ioapic_irq == 0) + ii->ii_ioapic_irq = ioapic_pci_alloc_irq(); + assert(ii->ii_ioapic_irq > 0); + + /* + * Attempt to allocate a PIRQ pin for this intpin if one is + * not yet assigned. + */ + if (ii->ii_pirq_pin == 0) + ii->ii_pirq_pin = pirq_alloc_pin(pi->pi_vmctx); + assert(ii->ii_pirq_pin > 0); + + pi->pi_lintr.ioapic_irq = ii->ii_ioapic_irq; + pi->pi_lintr.pirq_pin = ii->ii_pirq_pin; + pci_set_cfgdata8(pi, PCIR_INTLINE, pirq_irq(ii->ii_pirq_pin)); } void @@ -1385,8 +1466,7 @@ pci_lintr_assert(struct pci_devinst *pi) if (pi->pi_lintr.state == IDLE) { if (pci_lintr_permitted(pi)) { pi->pi_lintr.state = ASSERTED; - vm_ioapic_assert_irq(pi->pi_vmctx, - pi->pi_lintr.ioapic_irq); + pci_irq_assert(pi); } else pi->pi_lintr.state = PENDING; } @@ -1402,7 +1482,7 @@ pci_lintr_deassert(struct pci_devinst *p pthread_mutex_lock(&pi->pi_lintr.lock); if (pi->pi_lintr.state == ASSERTED) { pi->pi_lintr.state = IDLE; - vm_ioapic_deassert_irq(pi->pi_vmctx, pi->pi_lintr.ioapic_irq); + pci_irq_deassert(pi); } else if (pi->pi_lintr.state == PENDING) pi->pi_lintr.state = IDLE; pthread_mutex_unlock(&pi->pi_lintr.lock); @@ -1414,11 +1494,11 @@ pci_lintr_update(struct pci_devinst *pi) pthread_mutex_lock(&pi->pi_lintr.lock); if (pi->pi_lintr.state == ASSERTED && !pci_lintr_permitted(pi)) { - vm_ioapic_deassert_irq(pi->pi_vmctx, pi->pi_lintr.ioapic_irq); + pci_irq_deassert(pi); pi->pi_lintr.state = PENDING; } else if (pi->pi_lintr.state == PENDING && pci_lintr_permitted(pi)) { pi->pi_lintr.state = ASSERTED; - vm_ioapic_assert_irq(pi->pi_vmctx, pi->pi_lintr.ioapic_irq); + pci_irq_assert(pi); } pthread_mutex_unlock(&pi->pi_lintr.lock); } @@ -1458,7 +1538,8 @@ pci_walk_lintr(int bus, pci_lintr_cb cb, for (pin = 0; pin < 4; pin++) { ii = &si->si_intpins[pin]; if (ii->ii_count != 0) - cb(bus, slot, pin + 1, ii->ii_ioapic_irq, arg); + cb(bus, slot, pin + 1, ii->ii_pirq_pin, + ii->ii_ioapic_irq, arg); } } } @@ -1755,20 +1836,6 @@ INOUT_PORT(pci_cfgdata, CONF1_DATA_PORT+ INOUT_PORT(pci_cfgdata, CONF1_DATA_PORT+2, IOPORT_F_INOUT, pci_emul_cfgdata); INOUT_PORT(pci_cfgdata, CONF1_DATA_PORT+3, IOPORT_F_INOUT, pci_emul_cfgdata); -/* - * I/O ports to configure PCI IRQ routing. We ignore all writes to it. - */ -static int -pci_irq_port_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, - uint32_t *eax, void *arg) -{ - assert(in == 0); - return (0); -} -INOUT_PORT(pci_irq, 0xC00, IOPORT_F_OUT, pci_irq_port_handler); -INOUT_PORT(pci_irq, 0xC01, IOPORT_F_OUT, pci_irq_port_handler); -SYSRES_IO(0xC00, 2); - #define PCI_EMUL_TEST #ifdef PCI_EMUL_TEST /* Modified: head/usr.sbin/bhyve/pci_emul.h ============================================================================== --- head/usr.sbin/bhyve/pci_emul.h Thu May 15 14:01:34 2014 (r266124) +++ head/usr.sbin/bhyve/pci_emul.h Thu May 15 14:16:55 2014 (r266125) @@ -120,6 +120,7 @@ struct pci_devinst { struct { int8_t pin; enum lintr_stat state; + int pirq_pin; int ioapic_irq; pthread_mutex_t lock; } pi_lintr; @@ -200,7 +201,8 @@ struct pciecap { uint16_t slot_status2; } __packed; -typedef void (*pci_lintr_cb)(int b, int s, int pin, int ioapic_irq, void *arg); +typedef void (*pci_lintr_cb)(int b, int s, int pin, int pirq_pin, + int ioapic_irq, void *arg); int init_pci(struct vmctx *ctx); void msicap_cfgwrite(struct pci_devinst *pi, int capoff, int offset, @@ -218,7 +220,7 @@ void pci_generate_msi(struct pci_devinst void pci_generate_msix(struct pci_devinst *pi, int msgnum); void pci_lintr_assert(struct pci_devinst *pi); void pci_lintr_deassert(struct pci_devinst *pi); -int pci_lintr_request(struct pci_devinst *pi); +void pci_lintr_request(struct pci_devinst *pi); int pci_msi_enabled(struct pci_devinst *pi); int pci_msix_enabled(struct pci_devinst *pi); int pci_msix_table_bar(struct pci_devinst *pi); Added: head/usr.sbin/bhyve/pci_irq.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/pci_irq.c Thu May 15 14:16:55 2014 (r266125) @@ -0,0 +1,349 @@ +/*- + * Copyright (c) 2014 Advanced Computing Technologies LLC + * Written by: John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "acpi.h" +#include "inout.h" +#include "pci_emul.h" +#include "pci_irq.h" +#include "pci_lpc.h" + +/* + * Implement an 8 pin PCI interrupt router compatible with the router + * present on Intel's ICH10 chip. + */ + +/* Fields in each PIRQ register. */ +#define PIRQ_DIS 0x80 +#define PIRQ_IRQ 0x0f + +/* Only IRQs 3-7, 9-12, and 14-15 are permitted. */ +#define PERMITTED_IRQS 0xdef8 +#define IRQ_PERMITTED(irq) (((1U << (irq)) & PERMITTED_IRQS) != 0) + +/* IRQ count to disable an IRQ. */ +#define IRQ_DISABLED 0xff + +static struct pirq { + uint8_t reg; + int use_count; + int active_count; + pthread_mutex_t lock; +} pirqs[8]; + +static u_char irq_counts[16]; +static int pirq_cold = 1; + +/* + * Returns true if this pin is enabled with a valid IRQ. Setting the + * register to a reserved IRQ causes interrupts to not be asserted as + * if the pin was disabled. + */ +static bool +pirq_valid_irq(int reg) +{ + + if (reg & PIRQ_DIS) + return (false); + return (IRQ_PERMITTED(reg & PIRQ_IRQ)); +} + +uint8_t +pirq_read(int pin) +{ + + assert(pin > 0 && pin <= nitems(pirqs)); + return (pirqs[pin - 1].reg); +} + +void +pirq_write(struct vmctx *ctx, int pin, uint8_t val) +{ + struct pirq *pirq; + + assert(pin > 0 && pin <= nitems(pirqs)); + pirq = &pirqs[pin - 1]; + pthread_mutex_lock(&pirq->lock); + if (pirq->reg != (val & (PIRQ_DIS | PIRQ_IRQ))) { + if (pirq->active_count != 0 && pirq_valid_irq(pirq->reg)) + vm_isa_deassert_irq(ctx, pirq->reg & PIRQ_IRQ, -1); + pirq->reg = val & (PIRQ_DIS | PIRQ_IRQ); + if (pirq->active_count != 0 && pirq_valid_irq(pirq->reg)) + vm_isa_assert_irq(ctx, pirq->reg & PIRQ_IRQ, -1); + } + pthread_mutex_unlock(&pirq->lock); +} + +void +pci_irq_reserve(int irq) +{ + + assert(irq < nitems(irq_counts)); + assert(pirq_cold); + assert(irq_counts[irq] == 0 || irq_counts[irq] == IRQ_DISABLED); + irq_counts[irq] = IRQ_DISABLED; +} + +void +pci_irq_use(int irq) +{ + + assert(irq < nitems(irq_counts)); + assert(pirq_cold); + if (irq_counts[irq] != IRQ_DISABLED) + irq_counts[irq]++; +} + +void +pci_irq_init(struct vmctx *ctx) +{ + int i; + + for (i = 0; i < nitems(pirqs); i++) { + pirqs[i].reg = PIRQ_DIS; + pirqs[i].use_count = 0; + pirqs[i].active_count = 0; + pthread_mutex_init(&pirqs[i].lock, NULL); + } + for (i = 0; i < nitems(irq_counts); i++) { + if (IRQ_PERMITTED(i)) + irq_counts[i] = 0; + else + irq_counts[i] = IRQ_DISABLED; + } +} + +void +pci_irq_assert(struct pci_devinst *pi) +{ + struct pirq *pirq; + + if (pi->pi_lintr.pirq_pin > 0) { + assert(pi->pi_lintr.pirq_pin <= nitems(pirqs)); + pirq = &pirqs[pi->pi_lintr.pirq_pin - 1]; + pthread_mutex_lock(&pirq->lock); + pirq->active_count++; + if (pirq->active_count == 1 && pirq_valid_irq(pirq->reg)) { + vm_isa_assert_irq(pi->pi_vmctx, pirq->reg & PIRQ_IRQ, + pi->pi_lintr.ioapic_irq); + pthread_mutex_unlock(&pirq->lock); + return; + } + pthread_mutex_unlock(&pirq->lock); + } + vm_ioapic_assert_irq(pi->pi_vmctx, pi->pi_lintr.ioapic_irq); +} + +void +pci_irq_deassert(struct pci_devinst *pi) +{ + struct pirq *pirq; + + if (pi->pi_lintr.pirq_pin > 0) { + assert(pi->pi_lintr.pirq_pin <= nitems(pirqs)); + pirq = &pirqs[pi->pi_lintr.pirq_pin - 1]; + pthread_mutex_lock(&pirq->lock); + pirq->active_count--; + if (pirq->active_count == 0 && pirq_valid_irq(pirq->reg)) { + vm_isa_deassert_irq(pi->pi_vmctx, pirq->reg & PIRQ_IRQ, + pi->pi_lintr.ioapic_irq); + pthread_mutex_unlock(&pirq->lock); + return; + } + pthread_mutex_unlock(&pirq->lock); + } + vm_ioapic_deassert_irq(pi->pi_vmctx, pi->pi_lintr.ioapic_irq); +} + +int +pirq_alloc_pin(struct vmctx *ctx) +{ + int best_count, best_irq, best_pin, irq, pin; + + pirq_cold = 1; + + /* First, find the least-used PIRQ pin. */ + best_pin = 0; + best_count = pirqs[0].use_count; + for (pin = 1; pin < nitems(pirqs); pin++) { + if (pirqs[pin].use_count < best_count) { + best_pin = pin; + best_count = pirqs[pin].use_count; + } + } + pirqs[best_pin].use_count++; + + /* Second, route this pin to an IRQ. */ + if (pirqs[best_pin].reg == PIRQ_DIS) { + best_irq = -1; + best_count = 0; + for (irq = 0; irq < nitems(irq_counts); irq++) { + if (irq_counts[irq] == IRQ_DISABLED) + continue; + if (best_irq == -1 || irq_counts[irq] < best_count) { + best_irq = irq; + best_count = irq_counts[irq]; + } + } + assert(best_irq != 0); + irq_counts[best_irq]++; + pirqs[best_pin].reg = best_irq; + vm_isa_set_irq_trigger(ctx, best_irq, LEVEL_TRIGGER); + } + + return (best_pin + 1); +} + +int +pirq_irq(int pin) +{ + + if (pin == -1) + return (255); + assert(pin > 0 && pin <= nitems(pirqs)); + return (pirqs[pin - 1].reg & PIRQ_IRQ); +} + +/* XXX: Generate $PIR table. */ + +static void +pirq_dsdt(void) +{ + char *irq_prs, *old; + int irq, pin; + + irq_prs = NULL; + for (irq = 0; irq < nitems(irq_counts); irq++) { + if (!IRQ_PERMITTED(irq)) + continue; + if (irq_prs == NULL) + asprintf(&irq_prs, "%d", irq); + else { + old = irq_prs; + asprintf(&irq_prs, "%s,%d", old, irq); + free(old); + } + } + + /* + * A helper method to validate a link register's value. This + * duplicates pirq_valid_irq(). + */ + dsdt_line(""); + dsdt_line("Method (PIRV, 1, NotSerialized)"); + dsdt_line("{"); + dsdt_line(" If (And (Arg0, 0x%02X))", PIRQ_DIS); + dsdt_line(" {"); + dsdt_line(" Return (0x00)"); + dsdt_line(" }"); + dsdt_line(" And (Arg0, 0x%02X, Local0)", PIRQ_IRQ); + dsdt_line(" If (LLess (Local0, 0x03))"); + dsdt_line(" {"); + dsdt_line(" Return (0x00)"); + dsdt_line(" }"); + dsdt_line(" If (LEqual (Local0, 0x08))"); + dsdt_line(" {"); + dsdt_line(" Return (0x00)"); + dsdt_line(" }"); + dsdt_line(" If (LEqual (Local0, 0x0D))"); + dsdt_line(" {"); + dsdt_line(" Return (0x00)"); + dsdt_line(" }"); + dsdt_line(" Return (0x01)"); + dsdt_line("}"); + + for (pin = 0; pin < nitems(pirqs); pin++) { + dsdt_line(""); + dsdt_line("Device (LNK%c)", 'A' + pin); + dsdt_line("{"); + dsdt_line(" Name (_HID, EisaId (\"PNP0C0F\"))"); + dsdt_line(" Name (_UID, 0x%02X)", pin + 1); + dsdt_line(" Method (_STA, 0, NotSerialized)"); + dsdt_line(" {"); + dsdt_line(" If (PIRV (PIR%c))", 'A' + pin); + dsdt_line(" {"); + dsdt_line(" Return (0x0B)"); + dsdt_line(" }"); + dsdt_line(" Else"); + dsdt_line(" {"); + dsdt_line(" Return (0x09)"); + dsdt_line(" }"); + dsdt_line(" }"); + dsdt_line(" Name (_PRS, ResourceTemplate ()"); + dsdt_line(" {"); + dsdt_line(" IRQ (Level, ActiveLow, Shared, )"); + dsdt_line(" {%s}", irq_prs); + dsdt_line(" })"); + dsdt_line(" Name (CB%02X, ResourceTemplate ()", pin + 1); + dsdt_line(" {"); + dsdt_line(" IRQ (Level, ActiveLow, Shared, )"); + dsdt_line(" {}"); + dsdt_line(" })"); + dsdt_line(" CreateWordField (CB%02X, 0x01, CIR%c)", + pin + 1, 'A' + pin); + dsdt_line(" Method (_CRS, 0, NotSerialized)"); + dsdt_line(" {"); + dsdt_line(" And (PIR%c, 0x%02X, Local0)", 'A' + pin, + PIRQ_DIS | PIRQ_IRQ); + dsdt_line(" If (PIRV (Local0))"); + dsdt_line(" {"); + dsdt_line(" ShiftLeft (0x01, Local0, CIR%c)", 'A' + pin); + dsdt_line(" }"); + dsdt_line(" Else"); + dsdt_line(" {"); + dsdt_line(" Store (0x00, CIR%c)", 'A' + pin); + dsdt_line(" }"); + dsdt_line(" Return (CB%02X)", pin + 1); + dsdt_line(" }"); + dsdt_line(" Method (_DIS, 0, NotSerialized)"); + dsdt_line(" {"); + dsdt_line(" Store (0x80, PIR%c)", 'A' + pin); + dsdt_line(" }"); + dsdt_line(" Method (_SRS, 1, NotSerialized)"); + dsdt_line(" {"); + dsdt_line(" CreateWordField (Arg0, 0x01, SIR%c)", 'A' + pin); + dsdt_line(" FindSetRightBit (SIR%c, Local0)", 'A' + pin); + dsdt_line(" Store (Decrement (Local0), PIR%c)", 'A' + pin); + dsdt_line(" }"); + dsdt_line("}"); + } + free(irq_prs); +} +LPC_DSDT(pirq_dsdt); Added: head/usr.sbin/bhyve/pci_irq.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/pci_irq.h Thu May 15 14:16:55 2014 (r266125) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2014 Advanced Computing Technologies LLC + * Written by: John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __PCI_IRQ_H__ +#define __PCI_IRQ_H__ + +struct pci_devinst; + +void pci_irq_assert(struct pci_devinst *pi); +void pci_irq_deassert(struct pci_devinst *pi); +void pci_irq_init(struct vmctx *ctx); +void pci_irq_reserve(int irq); +void pci_irq_use(int irq); +int pirq_alloc_pin(struct vmctx *ctx); +int pirq_irq(int pin); +uint8_t pirq_read(int pin); +void pirq_write(struct vmctx *ctx, int pin, uint8_t val); + +#endif Modified: head/usr.sbin/bhyve/pci_lpc.c ============================================================================== --- head/usr.sbin/bhyve/pci_lpc.c Thu May 15 14:01:34 2014 (r266124) +++ head/usr.sbin/bhyve/pci_lpc.c Thu May 15 14:16:55 2014 (r266125) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include "acpi.h" #include "inout.h" #include "pci_emul.h" +#include "pci_irq.h" #include "pci_lpc.h" #include "uart_emul.h" @@ -173,6 +174,7 @@ lpc_init(void) "LPC device %s\n", name); return (-1); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu May 15 15:17:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 412E04DF; Thu, 15 May 2014 15:17:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EE642275; Thu, 15 May 2014 15:17:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FFHjUs044354; Thu, 15 May 2014 15:17:45 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FFHjU2044353; Thu, 15 May 2014 15:17:45 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201405151517.s4FFHjU2044353@svn.freebsd.org> From: Justin Hibbits Date: Thu, 15 May 2014 15:17:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266136 - head/sys/powerpc/aim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 15:17:45 -0000 Author: jhibbits Date: Thu May 15 15:17:44 2014 New Revision: 266136 URL: http://svnweb.freebsd.org/changeset/base/266136 Log: oea64 uses 4k pages, too. MFC after: 1 week X-MFC-with: r266116 Modified: head/sys/powerpc/aim/trap_subr64.S Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Thu May 15 15:15:23 2014 (r266135) +++ head/sys/powerpc/aim/trap_subr64.S Thu May 15 15:17:44 2014 (r266136) @@ -585,7 +585,7 @@ disitrap: mtcr %r31 bt 17,realtrap /* branch is user mode */ mfsprg1 %r31 /* get old SP */ - clrrdi %r31,%r31,11 /* Round SP down to nearest page */ + clrrdi %r31,%r31,12 /* Round SP down to nearest page */ sub. %r30,%r31,%r30 /* SP - DAR */ bge 1f neg %r30,%r30 /* modulo value */ From owner-svn-src-head@FreeBSD.ORG Thu May 15 15:22:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A49A854; Thu, 15 May 2014 15:22:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 476CE2331; Thu, 15 May 2014 15:22:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FFMXKo048232; Thu, 15 May 2014 15:22:33 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FFMXhu048231; Thu, 15 May 2014 15:22:33 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201405151522.s4FFMXhu048231@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 15 May 2014 15:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266138 - in head: contrib/ldns/compat lib/libldns X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 15:22:33 -0000 Author: des Date: Thu May 15 15:22:32 2014 New Revision: 266138 URL: http://svnweb.freebsd.org/changeset/base/266138 Log: Remove dead files. Deleted: head/contrib/ldns/compat/b32_ntop.c head/contrib/ldns/compat/b32_pton.c Modified: head/lib/libldns/Makefile Modified: head/lib/libldns/Makefile ============================================================================== --- head/lib/libldns/Makefile Thu May 15 15:20:43 2014 (r266137) +++ head/lib/libldns/Makefile Thu May 15 15:22:32 2014 (r266138) @@ -16,7 +16,6 @@ SRCS= buffer.c dane.c dname.c dnssec.c d rr.c rr_functions.c sha1.c sha2.c str2host.c tsig.c update.c util.c \ wire2host.c zone.c -#SRCS+= b32_ntop.c b32_pton.c b64_ntop.c b64_pton.c SRCS+= b64_ntop.c b64_pton.c DPADD+= ${LIBCRYPTO} From owner-svn-src-head@FreeBSD.ORG Thu May 15 15:28:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C0CFD23; Thu, 15 May 2014 15:28:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D474D236C; Thu, 15 May 2014 15:28:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FFShAe049219; Thu, 15 May 2014 15:28:43 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FFShBL049218; Thu, 15 May 2014 15:28:43 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201405151528.s4FFShBL049218@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 15 May 2014 15:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266141 - in head/contrib/ldns: . ldns X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 15:28:44 -0000 Author: des Date: Thu May 15 15:28:43 2014 New Revision: 266141 URL: http://svnweb.freebsd.org/changeset/base/266141 Log: MFV: nuke autprops Modified: Directory Properties: head/contrib/ldns/ (props changed) head/contrib/ldns/dane.c (props changed) head/contrib/ldns/ldns/dane.h (props changed) head/contrib/ldns/ldns/radix.h (props changed) head/contrib/ldns/radix.c (props changed) From owner-svn-src-head@FreeBSD.ORG Thu May 15 15:28:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4853EE58; Thu, 15 May 2014 15:28:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3428C236D; Thu, 15 May 2014 15:28:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FFSoBU049272; Thu, 15 May 2014 15:28:50 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FFSoOm049271; Thu, 15 May 2014 15:28:50 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201405151528.s4FFSoOm049271@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 15 May 2014 15:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266142 - in head/contrib/unbound: compat doc ldns libunbound X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 15:28:50 -0000 Author: des Date: Thu May 15 15:28:49 2014 New Revision: 266142 URL: http://svnweb.freebsd.org/changeset/base/266142 Log: MFV: nuke autprops Modified: Directory Properties: head/contrib/unbound/ (props changed) head/contrib/unbound/compat/strlcat.c (props changed) head/contrib/unbound/doc/ietf67-design-02.odp (props changed) head/contrib/unbound/doc/ietf67-design-02.pdf (props changed) head/contrib/unbound/ldns/keyraw.c (props changed) head/contrib/unbound/ldns/keyraw.h (props changed) head/contrib/unbound/ldns/parse.c (props changed) head/contrib/unbound/ldns/parse.h (props changed) head/contrib/unbound/ldns/parseutil.c (props changed) head/contrib/unbound/ldns/parseutil.h (props changed) head/contrib/unbound/ldns/pkthdr.h (props changed) head/contrib/unbound/ldns/rrdef.c (props changed) head/contrib/unbound/ldns/rrdef.h (props changed) head/contrib/unbound/ldns/sbuffer.c (props changed) head/contrib/unbound/ldns/sbuffer.h (props changed) head/contrib/unbound/ldns/str2wire.c (props changed) head/contrib/unbound/ldns/str2wire.h (props changed) head/contrib/unbound/ldns/wire2str.c (props changed) head/contrib/unbound/ldns/wire2str.h (props changed) head/contrib/unbound/libunbound/unbound-event.h (props changed) From owner-svn-src-head@FreeBSD.ORG Thu May 15 15:45:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78D75B33; Thu, 15 May 2014 15:45:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66BE1252C; Thu, 15 May 2014 15:45:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FFjkmj058437; Thu, 15 May 2014 15:45:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FFjkrU058436; Thu, 15 May 2014 15:45:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405151545.s4FFjkrU058436@svn.freebsd.org> From: Warner Losh Date: Thu, 15 May 2014 15:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266147 - head/usr.bin/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 15:45:46 -0000 Author: imp Date: Thu May 15 15:45:45 2014 New Revision: 266147 URL: http://svnweb.freebsd.org/changeset/base/266147 Log: Makefile.inc is also included by the tests subdirectory, which results in SUBDIRS having tests added to it, which fails. Work around this by checking to make sure tests exists before adding it to subdirs and work to get the generated file fixed so we can rename Makefile.inc to something else so it isn't automatically included by subdirs... Modified: head/usr.bin/bmake/Makefile.inc Modified: head/usr.bin/bmake/Makefile.inc ============================================================================== --- head/usr.bin/bmake/Makefile.inc Thu May 15 15:43:33 2014 (r266146) +++ head/usr.bin/bmake/Makefile.inc Thu May 15 15:45:45 2014 (r266147) @@ -13,7 +13,10 @@ PROG= make NO_SHARED?= YES .endif -.if defined(MK_TESTS) && ${MK_TESTS} != no +# hack to not add tests to tests subdir since this is included from +# there and to avoid renaming things that require changes to generated +# files. +.if defined(MK_TESTS) && ${MK_TESTS} != no && exists(${.CURDIR}/tests) SUBDIR+= tests .endif From owner-svn-src-head@FreeBSD.ORG Thu May 15 15:49:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7BDC621D; Thu, 15 May 2014 15:49:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F7CC2561; Thu, 15 May 2014 15:49:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FFnDsa059498; Thu, 15 May 2014 15:49:13 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FFnDNS059497; Thu, 15 May 2014 15:49:13 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201405151549.s4FFnDNS059497@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 15 May 2014 15:49:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266149 - head/contrib/ldns/drill X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 15:49:13 -0000 Author: des Date: Thu May 15 15:49:12 2014 New Revision: 266149 URL: http://svnweb.freebsd.org/changeset/base/266149 Log: MFV: re-add svn:mime-type where needed Modified: Directory Properties: head/contrib/ldns/ (props changed) head/contrib/ldns/drill/drill.1 (props changed) From owner-svn-src-head@FreeBSD.ORG Thu May 15 15:49:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E82F62EE; Thu, 15 May 2014 15:49:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFC832562; Thu, 15 May 2014 15:49:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FFnGek059539; Thu, 15 May 2014 15:49:16 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FFnGh5059538; Thu, 15 May 2014 15:49:16 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201405151549.s4FFnGh5059538@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 15 May 2014 15:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266150 - head/contrib/unbound/doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 15:49:17 -0000 Author: des Date: Thu May 15 15:49:16 2014 New Revision: 266150 URL: http://svnweb.freebsd.org/changeset/base/266150 Log: MFV: re-add svn:mime-type where needed Modified: Directory Properties: head/contrib/unbound/ (props changed) head/contrib/unbound/doc/ietf67-design-02.odp (props changed) head/contrib/unbound/doc/ietf67-design-02.pdf (props changed) From owner-svn-src-head@FreeBSD.ORG Thu May 15 15:50:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD85F4C4; Thu, 15 May 2014 15:50:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B4622572; Thu, 15 May 2014 15:50:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FFobWC060314; Thu, 15 May 2014 15:50:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FFobln060313; Thu, 15 May 2014 15:50:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405151550.s4FFobln060313@svn.freebsd.org> From: Warner Losh Date: Thu, 15 May 2014 15:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266151 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 15:50:37 -0000 Author: imp Date: Thu May 15 15:50:37 2014 New Revision: 266151 URL: http://svnweb.freebsd.org/changeset/base/266151 Log: Bump FreeBSD_version for src.opts.mk changes (about a week late). Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu May 15 15:49:16 2014 (r266150) +++ head/sys/sys/param.h Thu May 15 15:50:37 2014 (r266151) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100020 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100021 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Thu May 15 16:44:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC5B9964; Thu, 15 May 2014 16:44:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6E7F2A6F; Thu, 15 May 2014 16:44:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FGiRc8086426; Thu, 15 May 2014 16:44:27 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FGiPBX086416; Thu, 15 May 2014 16:44:25 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201405151644.s4FGiPBX086416@svn.freebsd.org> From: Brooks Davis Date: Thu, 15 May 2014 16:44:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266157 - in head: gnu/usr.bin/dialog lib/ncurses share/mk usr.bin/systat usr.bin/vi usr.sbin/bsdinstall/distextract usr.sbin/bsdinstall/distfetch usr.sbin/bsdinstall/partedit usr.sbin/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 16:44:27 -0000 Author: brooks Date: Thu May 15 16:44:25 2014 New Revision: 266157 URL: http://svnweb.freebsd.org/changeset/base/266157 Log: Revert r261296. This removes the WITHOUT_NCURSESW option. It was the wrong direction. We will instead remove use of the non-wide-character supporting libncurses. Modified: head/gnu/usr.bin/dialog/Makefile head/lib/ncurses/Makefile head/share/mk/src.opts.mk head/usr.bin/systat/Makefile head/usr.bin/systat/main.c head/usr.bin/vi/Makefile head/usr.sbin/bsdinstall/distextract/Makefile head/usr.sbin/bsdinstall/distfetch/Makefile head/usr.sbin/bsdinstall/partedit/Makefile head/usr.sbin/tzsetup/Makefile Modified: head/gnu/usr.bin/dialog/Makefile ============================================================================== --- head/gnu/usr.bin/dialog/Makefile Thu May 15 16:24:20 2014 (r266156) +++ head/gnu/usr.bin/dialog/Makefile Thu May 15 16:44:25 2014 (r266157) @@ -3,21 +3,11 @@ DIALOG= ${.CURDIR}/../../../contrib/dialog PROG= dialog -DPADD= ${LIBDIALOG} ${LIBM} -LDADD= -ldialog -lm +DPADD= ${LIBDIALOG} ${LIBNCURSESW} ${LIBM} +LDADD= -ldialog -lncursesw -lm CFLAGS+= -I${.CURDIR} -I${DIALOG} .PATH: ${DIALOG} WARNS?= 6 -.include - -.if ${MK_NCURSESW} == "no" -DPADD+= ${LIBNCURSES} -LDADD+= -lncurses -.else -DPADD+= ${LIBNCURSESW} -LDADD+= -lncursesw -.endif - .include Modified: head/lib/ncurses/Makefile ============================================================================== --- head/lib/ncurses/Makefile Thu May 15 16:24:20 2014 (r266156) +++ head/lib/ncurses/Makefile Thu May 15 16:44:25 2014 (r266157) @@ -1,11 +1,6 @@ # $FreeBSD$ -.include - -SUBDIR= ncurses form menu panel - -.if ${MK_NCURSESW} != "no" -SUBDIR+= ncursesw formw menuw panelw -.endif +SUBDIR= ncurses form menu panel \ + ncursesw formw menuw panelw .include Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu May 15 16:24:20 2014 (r266156) +++ head/share/mk/src.opts.mk Thu May 15 16:44:25 2014 (r266157) @@ -119,7 +119,6 @@ __DEFAULT_YES_OPTIONS = \ MAIL \ MAILWRAPPER \ MAKE \ - NCURSESW \ NDIS \ NETCAT \ NETGRAPH \ Modified: head/usr.bin/systat/Makefile ============================================================================== --- head/usr.bin/systat/Makefile Thu May 15 16:24:20 2014 (r266156) +++ head/usr.bin/systat/Makefile Thu May 15 16:44:25 2014 (r266157) @@ -16,16 +16,7 @@ CFLAGS+= -DINET6 WARNS?= 0 -DPADD= ${LIBM} ${LIBDEVSTAT} ${LIBKVM} -LDADD= -lm -ldevstat -lkvm - -.if ${MK_NCURSESW} == "no" -DPADD+= ${LIBNCURSES} -LDADD+= -lncurses -.else -CFLAGS+= -DUSE_WIDECHAR -DPADD+= ${LIBNCURSESW} -LDADD+= -lncursesw -.endif +DPADD= ${LIBNCURSESW} ${LIBM} ${LIBDEVSTAT} ${LIBKVM} +LDADD= -lncursesw -lm -ldevstat -lkvm .include Modified: head/usr.bin/systat/main.c ============================================================================== --- head/usr.bin/systat/main.c Thu May 15 16:24:20 2014 (r266156) +++ head/usr.bin/systat/main.c Thu May 15 16:44:25 2014 (r266157) @@ -141,11 +141,7 @@ main(int argc, char **argv) double t; struct cmdentry *cmd = NULL; -#ifdef USE_WIDECHAR (void) setlocale(LC_ALL, ""); -#else - (void) setlocale(LC_TIME, ""); -#endif SLIST_INIT(&commands); argc--, argv++; Modified: head/usr.bin/vi/Makefile ============================================================================== --- head/usr.bin/vi/Makefile Thu May 15 16:24:20 2014 (r266156) +++ head/usr.bin/vi/Makefile Thu May 15 16:44:25 2014 (r266157) @@ -36,7 +36,7 @@ CFLAGS+=-I${.CURDIR} -I${SRCDIR} -I${SRC DPADD= ${LIBUTIL} LDADD= -lutil -.if defined(RESCUE) || defined(RELEASE_CRUNCH) || ${MK_NCURSESW} == "no" +.if defined(RESCUE) || defined(RELEASE_CRUNCH) DPADD+= ${LIBNCURSES} LDADD+= -lncurses .else Modified: head/usr.sbin/bsdinstall/distextract/Makefile ============================================================================== --- head/usr.sbin/bsdinstall/distextract/Makefile Thu May 15 16:24:20 2014 (r266156) +++ head/usr.sbin/bsdinstall/distextract/Makefile Thu May 15 16:44:25 2014 (r266157) @@ -2,20 +2,10 @@ BINDIR= /usr/libexec/bsdinstall PROG= distextract -DPADD= ${LIBARCHIVE} ${LIBDIALOG} ${LIBM} -LDADD= -larchive -ldialog -lm +DPADD= ${LIBARCHIVE} ${LIBNCURSESW} ${LIBDIALOG} ${LIBM} +LDADD= -larchive -lncursesw -ldialog -lm WARNS?= 6 MAN= -.include - -.if ${MK_NCURSESW} == "no" -DPADD+= ${LIBNCURSES} -LDADD+= -lncurses -.else -DPADD+= ${LIBNCURSESW} -LDADD+= -lncursesw -.endif - .include Modified: head/usr.sbin/bsdinstall/distfetch/Makefile ============================================================================== --- head/usr.sbin/bsdinstall/distfetch/Makefile Thu May 15 16:24:20 2014 (r266156) +++ head/usr.sbin/bsdinstall/distfetch/Makefile Thu May 15 16:44:25 2014 (r266157) @@ -2,20 +2,10 @@ BINDIR= /usr/libexec/bsdinstall PROG= distfetch -DPADD= ${LIBFETCH} ${LIBDIALOG} ${LIBM} -LDADD= -lfetch -ldialog -lm +DPADD= ${LIBFETCH} ${LIBNCURSESW} ${LIBDIALOG} ${LIBM} +LDADD= -lfetch -lncursesw -ldialog -lm WARNS?= 6 MAN= -.include - -.if ${MK_NCURSESW} == "no" -DPADD+= ${LIBNCURSES} -LDADD+= -lncurses -.else -DPADD+= ${LIBNCURSESW} -LDADD+= -lncursesw -.endif - .include Modified: head/usr.sbin/bsdinstall/partedit/Makefile ============================================================================== --- head/usr.sbin/bsdinstall/partedit/Makefile Thu May 15 16:24:20 2014 (r266156) +++ head/usr.sbin/bsdinstall/partedit/Makefile Thu May 15 16:44:25 2014 (r266157) @@ -5,8 +5,8 @@ PROG= partedit LINKS= ${BINDIR}/partedit ${BINDIR}/autopart \ ${BINDIR}/partedit ${BINDIR}/scriptedpart SYMLINKS= ${BINDIR}/partedit /usr/sbin/sade -DPADD= ${LIBGEOM} ${LIBUTIL} ${LIBDIALOG} ${LIBM} -LDADD= -lgeom -lutil -ldialog -lm +DPADD= ${LIBGEOM} ${LIBNCURSESW} ${LIBUTIL} ${LIBDIALOG} ${LIBM} +LDADD= -lgeom -lncursesw -lutil -ldialog -lm PARTEDIT_ARCH= ${MACHINE} .if ${MACHINE} == "i386" || ${MACHINE} == "amd64" @@ -22,14 +22,4 @@ SRCS= diskeditor.c partedit.c gpart_ops. WARNS?= 3 MAN= sade.8 -.include - -.if ${MK_NCURSESW} == "no" -DPADD+= ${LIBNCURSES} -LDADD+= -lncurses -.else -DPADD+= ${LIBNCURSESW} -LDADD+= -lncursesw -.endif - .include Modified: head/usr.sbin/tzsetup/Makefile ============================================================================== --- head/usr.sbin/tzsetup/Makefile Thu May 15 16:24:20 2014 (r266156) +++ head/usr.sbin/tzsetup/Makefile Thu May 15 16:44:25 2014 (r266157) @@ -7,17 +7,7 @@ CFLAGS+= -I${.CURDIR}/../../contrib/dial WARNS?= 3 -DPADD= ${LIBDIALOG} ${LIBM} -LDADD= -ldialog -lm - -.include - -.if ${MK_NCURSESW} == "no" -DPADD+= ${LIBNCURSES} -LDADD+= -lncurses -.else -DPADD+= ${LIBNCURSESW} -LDADD+= -lncursesw -.endif +DPADD= ${LIBDIALOG} ${LIBNCURSESW} ${LIBM} +LDADD= -ldialog -lncursesw -lm .include From owner-svn-src-head@FreeBSD.ORG Thu May 15 16:51:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3407BA9; Thu, 15 May 2014 16:51:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B44E32B56; Thu, 15 May 2014 16:51:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FGpkwU090389; Thu, 15 May 2014 16:51:46 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FGpkN1090387; Thu, 15 May 2014 16:51:46 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201405151651.s4FGpkN1090387@svn.freebsd.org> From: Brooks Davis Date: Thu, 15 May 2014 16:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266158 - in head: share/man/man5 tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 16:51:47 -0000 Author: brooks Date: Thu May 15 16:51:45 2014 New Revision: 266158 URL: http://svnweb.freebsd.org/changeset/base/266158 Log: Remove documention of WITHOUT_NCURSES removed in r266157. Remove a bit of whitespace from WITHOUT_BINUTILS. Catch up with a bunch of other commits to tools/build/options that weren't merged to src.conf.5. Deleted: head/tools/build/options/WITHOUT_NCURSESW Modified: head/share/man/man5/src.conf.5 head/tools/build/options/WITHOUT_BINUTILS Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu May 15 16:44:25 2014 (r266157) +++ head/share/man/man5/src.conf.5 Thu May 15 16:51:45 2014 (r266158) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd April 13, 2014 +.Dd May 15, 2014 .Dt SRC.CONF 5 .Os .Sh NAME @@ -125,25 +125,23 @@ Set to not build audit support into syst Set to not build .Xr authpf 8 . .It Va WITHOUT_BINUTILS -.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 255974 2013-10-01 17:40:56Z emaste -Set to not install binutils (as, c++-filt, gconv, -ld, nm, objcopy, objdump, readelf, size and strip). +.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 264660 2014-04-18 17:03:58Z imp +Set to not build or install binutils (as, c++-filt, gconv, +ld, nm, objcopy, objdump, readelf, size and strip) as part +of the normal system build. +The resulting system cannot build programs from source. +.It Va WITHOUT_BINUTILS_BOOTSTRAP +.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp +Set to not build binutils (as, c++-filt, gconv, +ld, nm, objcopy, objdump, readelf, size and strip) +as part of the bootstrap process. .Bf -symbolic -The option does not generally work for build targets, unless some alternative -toolchain is enabled. +The option does not work for build targets unless some alternative +toolchain is provided. .Ef .It Va WITHOUT_BLUETOOTH .\" from FreeBSD: head/tools/build/options/WITHOUT_BLUETOOTH 156932 2006-03-21 07:50:50Z ru Set to not build Bluetooth related kernel modules, programs and libraries. -.It Va WITHOUT_BMAKE -.\" from FreeBSD: head/tools/build/options/WITHOUT_BMAKE 263089 2014-03-12 11:53:35Z jmmv -Set to not build and install the portable BSD make (bmake) as -.Xr make 1 -instead of the traditional FreeBSD make. -This build option is temporary. -It allows developers to switch to the traditional FreeBSD make in order to -work out any remaining kinks or issues. -This option will be removed in due time. .It Va WITHOUT_BOOT .\" from FreeBSD: head/tools/build/options/WITHOUT_BOOT 156932 2006-03-21 07:50:50Z ru Set to not build the boot blocks and loader. @@ -196,8 +194,8 @@ When set, it also enforces the following .Va WITHOUT_ZFS .El .It Va WITHOUT_CLANG -.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG 208971 2010-06-10 06:20:26Z ed -Set to not build the Clang C/C++ compiler. +.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG 264660 2014-04-18 17:03:58Z imp +Set to not build the Clang C/C++ compiler during the regular phase of the build. .Pp It is a default setting on arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64. @@ -210,8 +208,23 @@ When set, it also enforces the following .Va WITHOUT_CLANG_FULL .El .It Va WITH_CLANG -.\" from FreeBSD: head/tools/build/options/WITH_CLANG 221730 2011-05-10 11:14:40Z ru -Set to build the Clang C/C++ compiler. +.\" from FreeBSD: head/tools/build/options/WITH_CLANG 264660 2014-04-18 17:03:58Z imp +Set to build the Clang C/C++ compiler during the normal phase of the build. +.Pp +It is a default setting on +amd64/amd64, arm/arm, arm/armv6, arm/armv6hf, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. +.It Va WITHOUT_CLANG_BOOTSTRAP +.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp +Set to not build the Clang C/C++ compiler during the bootstrap phase of the build. +You must enable wither gcc or clang bootstrap to be able to build the system, +unless an alternative compiiler is provided via +XCC. +.Pp +It is a default setting on +arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64. +.It Va WITH_CLANG_BOOTSTRAP +.\" from FreeBSD: head/tools/build/options/WITH_CLANG_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp +Set to build the Clang C/C++ compiler during the bootstrap phase of the build. .Pp It is a default setting on amd64/amd64, arm/arm, arm/armv6, arm/armv6hf, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. @@ -257,9 +270,29 @@ amd64/amd64, arm/arm, arm/armv6, arm/arm Set to not build .Xr cpp 1 . .It Va WITHOUT_CROSS_COMPILER -.\" from FreeBSD: head/tools/build/options/WITHOUT_CROSS_COMPILER 250659 2013-05-15 14:30:03Z brooks -Set to not build a cross compiler in the cross-tools stage of -buildworld, buildkernel, etc. +.\" from FreeBSD: head/tools/build/options/WITHOUT_CROSS_COMPILER 264660 2014-04-18 17:03:58Z imp +Set to not build any cross compiler in the cross-tools stage of buildworld. +If you are compiling a different version of +.Fx +than what is installed on the system, you will need to provide an alternate +compiler with XCC to ensure success. +If you are compiling with an identical version of +.Fx +to the host, this option may be safely used. +This option may also be safe when the host version of +.Fx +is close to the sources being built, but all bets are off if there have +been any changes to the toolchain between the versions. +When set, it also enforces the following options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_BINUTILS_BOOTSTRAP +.It +.Va WITHOUT_CLANG_BOOTSTRAP +.It +.Va WITHOUT_GCC_BOOTSTRAP +.El .It Va WITHOUT_CRYPT .\" from FreeBSD: head/tools/build/options/WITHOUT_CRYPT 156932 2006-03-21 07:50:50Z ru Set to not build any crypto code. @@ -329,6 +362,11 @@ Set to not build the Webster dictionary .It Va WITHOUT_DMAGENT .\" from FreeBSD: head/tools/build/options/WITHOUT_DMAGENT 262335 2014-02-22 13:05:23Z bapt Set to not build dma Mail Transport Agent +.It Va WITHOUT_DOCCOMPRESS +.\" from FreeBSD: head/tools/build/options/WITHOUT_DOCCOMPRESS 265838 2014-05-10 16:38:54Z imp +Set to not to install compressed system documentation. +Only the uncompressed version will be installed. + .It Va WITHOUT_DYNAMICROOT .\" from FreeBSD: head/tools/build/options/WITHOUT_DYNAMICROOT 156932 2006-03-21 07:50:50Z ru Set this if you do not want to link @@ -341,6 +379,9 @@ dynamically. Set to build .Xr ed 1 without support for encryption/decryption. +.It Va WITH_EISA +.\" from FreeBSD: head/tools/build/options/WITH_EISA 264654 2014-04-18 16:53:06Z imp +Set to build EISA kernel modules. .It Va WITHOUT_EXAMPLES .\" from FreeBSD: head/tools/build/options/WITHOUT_EXAMPLES 156938 2006-03-21 09:06:24Z ru Set to avoid installing examples to @@ -353,16 +394,16 @@ This includes the device tree compiler ( .\" from FreeBSD: head/tools/build/options/WITHOUT_FLOPPY 221540 2011-05-06 19:13:03Z ru Set to not build or install programs for operating floppy disk driver. +.It Va WITH_FMAKE +.\" from FreeBSD: head/tools/build/options/WITH_FMAKE 265828 2014-05-10 16:37:39Z imp +Causes the old FreeBSD +.Xr make 1 +program to be built and installed as fmake. + .It Va WITHOUT_FMTREE .\" from FreeBSD: head/tools/build/options/WITHOUT_FMTREE 261299 2014-01-30 21:37:43Z brooks Set to not build and install .Pa /usr/sbin/fmtree . -.It Va WITHOUT_FORMAT_EXTENSIONS -.\" from FreeBSD: head/tools/build/options/WITHOUT_FORMAT_EXTENSIONS 250658 2013-05-15 13:04:10Z brooks -Set to not enable -.Fl fformat-extensions -when compiling the kernel. -Also disables all format checking. .It Va WITHOUT_FORTH .\" from FreeBSD: head/tools/build/options/WITHOUT_FORTH 156932 2006-03-21 07:50:50Z ru Set to build bootloaders without Forth support. @@ -379,8 +420,8 @@ Set to not build .\" from FreeBSD: head/tools/build/options/WITHOUT_GAMES 156932 2006-03-21 07:50:50Z ru Set to not build games. .It Va WITHOUT_GCC -.\" from FreeBSD: head/tools/build/options/WITHOUT_GCC 255326 2013-09-06 20:49:48Z zeising -Set to not build and install gcc and g++. +.\" from FreeBSD: head/tools/build/options/WITHOUT_GCC 264660 2014-04-18 17:03:58Z imp +Set to not build and install gcc and g++ as part of the normal build process. .Pp It is a default setting on amd64/amd64, arm/arm, arm/armv6, arm/armv6hf and i386/i386. @@ -390,6 +431,21 @@ Set to build and install gcc and g++. .Pp It is a default setting on arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +.It Va WITHOUT_GCC_BOOTSTRAP +.\" from FreeBSD: head/tools/build/options/WITHOUT_GCC_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp +Set to not build gcc and g++ as part of the bootstrap process. +You must enable wither gcc or clang bootstrap to be able to build the system, +unless an alternative compiiler is provided via +XCC. +.Pp +It is a default setting on +amd64/amd64, arm/arm, arm/armv6, arm/armv6hf and i386/i386. +.It Va WITH_GCC_BOOTSTRAP +.\" from FreeBSD: head/tools/build/options/WITH_GCC_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp +Set to build gcc and g++ as part of the bootstrap process. +.Pp +It is a default setting on +arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_GCOV .\" from FreeBSD: head/tools/build/options/WITHOUT_GCOV 156932 2006-03-21 07:50:50Z ru Set to not build the @@ -427,6 +483,11 @@ This is the default on platforms where g .Pp It is a default setting on arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +.It Va WITHOUT_GNU_GREP_COMPAT +.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_GREP_COMPAT 265826 2014-05-10 16:37:28Z imp +Set this option to omit the gnu extentions to grep from being included in +BSD grep. + .It Va WITHOUT_GNU_SUPPORT .\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build some programs without optional GNU support. @@ -438,6 +499,10 @@ Set to not build GPIB bus support. Set to not build .Xr gpioctl 8 as part of the base system. +.It Va WITHOUT_GPL_DTC +.\" from FreeBSD: head/tools/build/options/WITHOUT_GPL_DTC 264515 2014-04-15 20:41:55Z imp +Set to build the BSD licensed version of the device tree compiler, instead of the +GPL'd one from elinux.org. .It Va WITHOUT_GROFF .\" from FreeBSD: head/tools/build/options/WITHOUT_GROFF 218941 2011-02-22 08:13:49Z uqs Set to not build @@ -546,12 +611,6 @@ Set to build some programs without Kerbe .Xr sshd 8 , and .Xr telnetd 8 . -.It Va WITHOUT_KERNEL_SYMBOLS -.\" from FreeBSD: head/tools/build/options/WITHOUT_KERNEL_SYMBOLS 222189 2011-05-22 18:23:17Z imp -Set to not install kernel symbol files. -.Bf -symbolic -This option is recommended for those people who have small root partitions. -.Ef .It Va WITHOUT_KVM .\" from FreeBSD: head/tools/build/options/WITHOUT_KVM 174550 2007-12-12 16:43:17Z ru Set to not build the @@ -679,6 +738,12 @@ When set, the following options are also .Va WITH_MAN_UTILS is set explicitly) .El +.It Va WITHOUT_MANCOMPRESS +.\" from FreeBSD: head/tools/build/options/WITHOUT_MANCOMPRESS 265838 2014-05-10 16:38:54Z imp +Set to not to install compressed man pages. +Only the uncompressed versions will be installed. + + .It Va WITHOUT_MAN_UTILS .\" from FreeBSD: head/tools/build/options/WITHOUT_MAN_UTILS 208322 2010-05-20 00:07:21Z jkim Set to not build utilities for manual pages, @@ -692,11 +757,6 @@ and related support files. .It Va WITH_NAND .\" from FreeBSD: head/tools/build/options/WITH_NAND 235537 2012-05-17 10:11:18Z gber Set to build the NAND Flash components. -.It Va WITHOUT_NCURSESW -.\" from FreeBSD: head/tools/build/options/WITHOUT_NCURSESW 261300 2014-01-30 21:41:25Z brooks -Set to not build or depend on the -.Nm libncursesw -library. .It Va WITHOUT_NDIS .\" from FreeBSD: head/tools/build/options/WITHOUT_NDIS 183242 2008-09-21 22:02:26Z sam Set to not build programs and libraries @@ -758,6 +818,9 @@ and related programs. Set to build the .Dq "OpenFabrics Enterprise Distribution" Infiniband software stack. +.It Va WITH_OPENLDAP +.\" from FreeBSD: head/tools/build/options/WITH_OPENLDAP 264902 2014-04-24 23:17:31Z imp +Enable building openldap support for kerberos. .It Va WITHOUT_OPENSSH .\" from FreeBSD: head/tools/build/options/WITHOUT_OPENSSH 156932 2006-03-21 07:50:50Z ru Set to not build OpenSSH. @@ -936,6 +999,9 @@ and related programs. .It Va WITHOUT_SYMVER .\" from FreeBSD: head/tools/build/options/WITHOUT_SYMVER 169649 2007-05-17 05:03:24Z deischen Set to disable symbol versioning when building shared libraries. +.It Va WITHOUT_SYSCALL_COMPAT +.\" from FreeBSD: head/tools/build/options/WITHOUT_SYSCALL_COMPAT 265826 2014-05-10 16:37:28Z imp +Do not include some compatible syscall wrappers in libc. .It Va WITHOUT_SYSCONS .\" from FreeBSD: head/tools/build/options/WITHOUT_SYSCONS 156932 2006-03-21 07:50:50Z ru Set to not build @@ -1020,6 +1086,15 @@ Set to not build user accounting tools s .Xr lastlogin 8 and .Xr utx 8 . +.It Va WITHOUT_VI +.\" from FreeBSD: head/tools/build/options/WITHOUT_VI 264903 2014-04-24 23:17:40Z imp +Set to not build and install vi, view, ex and related programs. +.It Va WITHOUT_WARNS +.\" from FreeBSD: head/tools/build/options/WITHOUT_WARNS 265830 2014-05-10 16:37:53Z imp +Set this to not add warning flags to the compiler invocations. +Useful as a temporary workaround when code enters the tree +which triggers warnings in environments that differ from the +original develoepr. .It Va WITHOUT_WIRELESS .\" from FreeBSD: head/tools/build/options/WITHOUT_WIRELESS 183242 2008-09-21 22:02:26Z sam Set to not build programs used for 802.11 wireless networks; especially Modified: head/tools/build/options/WITHOUT_BINUTILS ============================================================================== --- head/tools/build/options/WITHOUT_BINUTILS Thu May 15 16:44:25 2014 (r266157) +++ head/tools/build/options/WITHOUT_BINUTILS Thu May 15 16:51:45 2014 (r266158) @@ -3,5 +3,3 @@ Set to not build or install binutils (as ld, nm, objcopy, objdump, readelf, size and strip) as part of the normal system build. The resulting system cannot build programs from source. - - From owner-svn-src-head@FreeBSD.ORG Thu May 15 18:12:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB74CC08; Thu, 15 May 2014 18:12:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8D0A2337; Thu, 15 May 2014 18:12:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FIClnw027645; Thu, 15 May 2014 18:12:47 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FICl8W027644; Thu, 15 May 2014 18:12:47 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201405151812.s4FICl8W027644@svn.freebsd.org> From: "George V. Neville-Neil" Date: Thu, 15 May 2014 18:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266166 - head/usr.sbin/pmcannotate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 18:12:47 -0000 Author: gnn Date: Thu May 15 18:12:47 2014 New Revision: 266166 URL: http://svnweb.freebsd.org/changeset/base/266166 Log: Extend the size of the function or symbol that can be annotated. MFC after: 2 weeks Modified: head/usr.sbin/pmcannotate/pmcannotate.c Modified: head/usr.sbin/pmcannotate/pmcannotate.c ============================================================================== --- head/usr.sbin/pmcannotate/pmcannotate.c Thu May 15 18:07:35 2014 (r266165) +++ head/usr.sbin/pmcannotate/pmcannotate.c Thu May 15 18:12:47 2014 (r266166) @@ -41,8 +41,8 @@ __FBSDID("$FreeBSD$"); #include -#define FNBUFF 161 -#define LNBUFF 161 +#define FNBUFF 512 +#define LNBUFF 512 #define TMPPATH "/tmp/pmcannotate.XXXXXX" From owner-svn-src-head@FreeBSD.ORG Thu May 15 18:34:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF5FD503; Thu, 15 May 2014 18:34:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCB1D2582; Thu, 15 May 2014 18:34:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FIYVxO036774; Thu, 15 May 2014 18:34:31 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FIYVFH036773; Thu, 15 May 2014 18:34:31 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405151834.s4FIYVFH036773@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 15 May 2014 18:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266169 - head/usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 18:34:32 -0000 Author: trasz Date: Thu May 15 18:34:31 2014 New Revision: 266169 URL: http://svnweb.freebsd.org/changeset/base/266169 Log: Remove unused variable. Modified: head/usr.sbin/iscsid/login.c Modified: head/usr.sbin/iscsid/login.c ============================================================================== --- head/usr.sbin/iscsid/login.c Thu May 15 18:18:53 2014 (r266168) +++ head/usr.sbin/iscsid/login.c Thu May 15 18:34:31 2014 (r266169) @@ -772,7 +772,6 @@ login(struct connection *conn) { struct pdu *request, *response; struct keys *request_keys, *response_keys; - struct iscsi_bhs_login_request *bhslr; struct iscsi_bhs_login_response *bhslr2; const char *auth_method; int i; @@ -781,9 +780,6 @@ login(struct connection *conn) log_debugx("beginning Login phase; sending Login PDU"); request = login_new_request(conn); - - bhslr = (struct iscsi_bhs_login_request *)request->pdu_bhs; - request_keys = keys_new(); if (conn->conn_conf.isc_mutual_user[0] != '\0') { keys_add(request_keys, "AuthMethod", "CHAP"); From owner-svn-src-head@FreeBSD.ORG Thu May 15 18:46:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38A3EBCB; Thu, 15 May 2014 18:46:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 261B926DF; Thu, 15 May 2014 18:46:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FIkHXx041837; Thu, 15 May 2014 18:46:17 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FIkH6s041836; Thu, 15 May 2014 18:46:17 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201405151846.s4FIkH6s041836@svn.freebsd.org> From: "George V. Neville-Neil" Date: Thu, 15 May 2014 18:46:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266171 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 18:46:17 -0000 Author: gnn Date: Thu May 15 18:46:16 2014 New Revision: 266171 URL: http://svnweb.freebsd.org/changeset/base/266171 Log: Update the amount of data we can collect for hwpmc(4) by default to work with modern processors and available memory. Submitted by: Julien Charbon MFC after: 2 weeks Modified: head/sys/sys/pmc.h Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Thu May 15 18:38:19 2014 (r266170) +++ head/sys/sys/pmc.h Thu May 15 18:46:16 2014 (r266171) @@ -598,11 +598,11 @@ struct pmc_op_getdyneventinfo { #include -#define PMC_HASH_SIZE 16 -#define PMC_MTXPOOL_SIZE 32 +#define PMC_HASH_SIZE 1024 +#define PMC_MTXPOOL_SIZE 2048 #define PMC_LOG_BUFFER_SIZE 4 -#define PMC_NLOGBUFFERS 64 -#define PMC_NSAMPLES 512 +#define PMC_NLOGBUFFERS 1024 +#define PMC_NSAMPLES 1024 #define PMC_CALLCHAIN_DEPTH 8 #define PMC_SYSCTL_NAME_PREFIX "kern." PMC_MODULE_NAME "." From owner-svn-src-head@FreeBSD.ORG Thu May 15 18:51:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27AE1EC3; Thu, 15 May 2014 18:51:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 153A9278F; Thu, 15 May 2014 18:51:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FIp1x3045143; Thu, 15 May 2014 18:51:01 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FIp1lT045142; Thu, 15 May 2014 18:51:01 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201405151851.s4FIp1lT045142@svn.freebsd.org> From: John-Mark Gurney Date: Thu, 15 May 2014 18:51:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266173 - head/usr.sbin/pmcannotate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 18:51:02 -0000 Author: jmg Date: Thu May 15 18:51:01 2014 New Revision: 266173 URL: http://svnweb.freebsd.org/changeset/base/266173 Log: make a note that FNBUFF cannot overflow as long as LNBUFF is smaller.. MFC after: 2 weeks Modified: head/usr.sbin/pmcannotate/pmcannotate.c Modified: head/usr.sbin/pmcannotate/pmcannotate.c ============================================================================== --- head/usr.sbin/pmcannotate/pmcannotate.c Thu May 15 18:47:07 2014 (r266172) +++ head/usr.sbin/pmcannotate/pmcannotate.c Thu May 15 18:51:01 2014 (r266173) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include +/* NB: Make sure FNBUFF is as large as LNBUFF, otherwise it could overflow */ #define FNBUFF 512 #define LNBUFF 512 From owner-svn-src-head@FreeBSD.ORG Thu May 15 18:53:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 124F0BD; Thu, 15 May 2014 18:53:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3E4D27B5; Thu, 15 May 2014 18:53:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FIr27c045789; Thu, 15 May 2014 18:53:02 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FIr2Rt045788; Thu, 15 May 2014 18:53:02 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201405151853.s4FIr2Rt045788@svn.freebsd.org> From: "George V. Neville-Neil" Date: Thu, 15 May 2014 18:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266174 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 18:53:03 -0000 Author: gnn Date: Thu May 15 18:53:02 2014 New Revision: 266174 URL: http://svnweb.freebsd.org/changeset/base/266174 Log: Upgrade the default callchain depth MFC after: 2 weeks Modified: head/sys/sys/pmc.h Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Thu May 15 18:51:01 2014 (r266173) +++ head/sys/sys/pmc.h Thu May 15 18:53:02 2014 (r266174) @@ -603,7 +603,7 @@ struct pmc_op_getdyneventinfo { #define PMC_LOG_BUFFER_SIZE 4 #define PMC_NLOGBUFFERS 1024 #define PMC_NSAMPLES 1024 -#define PMC_CALLCHAIN_DEPTH 8 +#define PMC_CALLCHAIN_DEPTH 16 #define PMC_SYSCTL_NAME_PREFIX "kern." PMC_MODULE_NAME "." From owner-svn-src-head@FreeBSD.ORG Thu May 15 19:20:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B6F8AF9; Thu, 15 May 2014 19:20:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C59129E5; Thu, 15 May 2014 19:20:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FJK0qe056338; Thu, 15 May 2014 19:20:00 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FJJwmt056261; Thu, 15 May 2014 19:19:58 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201405151919.s4FJJwmt056261@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 15 May 2014 19:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266176 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 19:20:01 -0000 Author: marcel Date: Thu May 15 19:19:57 2014 New Revision: 266176 URL: http://svnweb.freebsd.org/changeset/base/266176 Log: MFuser/marcel/mkimg: Add support for different output formats: 1. The output file that was previously written is now called the raw format. 2. Add the vmdk output format to create VMDK images. When the format is not given, the raw output format is assumed. Added: head/usr.bin/mkimg/format.c - copied unchanged from r266175, user/marcel/mkimg/format.c head/usr.bin/mkimg/format.h - copied unchanged from r266175, user/marcel/mkimg/format.h head/usr.bin/mkimg/image.c - copied unchanged from r266175, user/marcel/mkimg/image.c head/usr.bin/mkimg/image.h - copied unchanged from r266175, user/marcel/mkimg/image.h head/usr.bin/mkimg/raw.c - copied unchanged from r266175, user/marcel/mkimg/raw.c head/usr.bin/mkimg/vmdk.c - copied unchanged from r266175, user/marcel/mkimg/vmdk.c Modified: head/usr.bin/mkimg/Makefile (contents, props changed) head/usr.bin/mkimg/apm.c head/usr.bin/mkimg/bsd.c head/usr.bin/mkimg/ebr.c head/usr.bin/mkimg/gpt.c head/usr.bin/mkimg/mbr.c head/usr.bin/mkimg/mkimg.1 (contents, props changed) head/usr.bin/mkimg/mkimg.c head/usr.bin/mkimg/mkimg.h head/usr.bin/mkimg/pc98.c head/usr.bin/mkimg/scheme.c (contents, props changed) head/usr.bin/mkimg/scheme.h (contents, props changed) head/usr.bin/mkimg/vtoc8.c Directory Properties: head/usr.bin/mkimg/ (props changed) Modified: head/usr.bin/mkimg/Makefile ============================================================================== --- head/usr.bin/mkimg/Makefile Thu May 15 19:09:31 2014 (r266175) +++ head/usr.bin/mkimg/Makefile Thu May 15 19:19:57 2014 (r266176) @@ -1,11 +1,16 @@ # $FreeBSD$ PROG= mkimg -SRCS= mkimg.c scheme.c +SRCS= format.c image.c mkimg.c scheme.c MAN= mkimg.1 CFLAGS+=-DSPARSE_WRITE +# List of formats to support +SRCS+= \ + raw.c \ + vmdk.c + # List of schemes to support SRCS+= \ apm.c \ Modified: head/usr.bin/mkimg/apm.c ============================================================================== --- head/usr.bin/mkimg/apm.c Thu May 15 19:09:31 2014 (r266175) +++ head/usr.bin/mkimg/apm.c Thu May 15 19:19:57 2014 (r266176) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "image.h" #include "mkimg.h" #include "scheme.h" @@ -63,7 +64,7 @@ apm_metadata(u_int where) } static int -apm_write(int fd, lba_t imgsz, void *bootcode __unused) +apm_write(lba_t imgsz, void *bootcode __unused) { u_char *buf; struct apm_ddr *ddr; @@ -99,7 +100,7 @@ apm_write(int fd, lba_t imgsz, void *boo strcpy(ent->ent_name, part->label); } - error = mkimg_write(fd, 0, buf, nparts + 2); + error = image_write(0, buf, nparts + 2); free(buf); return (error); } Modified: head/usr.bin/mkimg/bsd.c ============================================================================== --- head/usr.bin/mkimg/bsd.c Thu May 15 19:09:31 2014 (r266175) +++ head/usr.bin/mkimg/bsd.c Thu May 15 19:19:57 2014 (r266176) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "image.h" #include "mkimg.h" #include "scheme.h" @@ -61,7 +62,7 @@ bsd_metadata(u_int where) } static int -bsd_write(int fd, lba_t imgsz, void *bootcode) +bsd_write(lba_t imgsz, void *bootcode) { u_char *buf, *p; struct disklabel *d; @@ -80,7 +81,9 @@ bsd_write(int fd, lba_t imgsz, void *boo memset(buf, 0, BBSIZE); imgsz = ncyls * nheads * nsecs; - ftruncate(fd, imgsz * secsz); + error = image_set_size(imgsz); + if (error) + return (error); d = (void *)(buf + secsz); le32enc(&d->d_magic, DISKMAGIC); @@ -111,7 +114,7 @@ bsd_write(int fd, lba_t imgsz, void *boo checksum ^= le16dec(p); le16enc(&d->d_checksum, checksum); - error = mkimg_write(fd, 0, buf, BBSIZE / secsz); + error = image_write(0, buf, BBSIZE / secsz); free(buf); return (error); } Modified: head/usr.bin/mkimg/ebr.c ============================================================================== --- head/usr.bin/mkimg/ebr.c Thu May 15 19:09:31 2014 (r266175) +++ head/usr.bin/mkimg/ebr.c Thu May 15 19:19:57 2014 (r266176) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "image.h" #include "mkimg.h" #include "scheme.h" @@ -67,7 +68,7 @@ ebr_chs(u_char *cyl, u_char *hd, u_char } static int -ebr_write(int fd, lba_t imgsz __unused, void *bootcode __unused) +ebr_write(lba_t imgsz __unused, void *bootcode __unused) { u_char *ebr; struct dos_partition *dp; @@ -104,7 +105,7 @@ ebr_write(int fd, lba_t imgsz __unused, le32enc(&dp->dp_size, next->size + nsecs); } - error = mkimg_write(fd, block, ebr, 1); + error = image_write(block, ebr, 1); if (error) break; Copied: head/usr.bin/mkimg/format.c (from r266175, user/marcel/mkimg/format.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/format.c Thu May 15 19:19:57 2014 (r266176, copy of r266175, user/marcel/mkimg/format.c) @@ -0,0 +1,91 @@ +/*- + * Copyright (c) 2014 Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "image.h" +#include "format.h" +#include "mkimg.h" + +static struct mkimg_format *format; + +int +format_resize(lba_t end) +{ + + if (format == NULL) + return (ENOSYS); + return (format->resize(end)); +} + +int +format_select(const char *spec) +{ + struct mkimg_format *f, **iter; + + SET_FOREACH(iter, formats) { + f = *iter; + if (strcasecmp(spec, f->name) == 0) { + format = f; + return (0); + } + } + return (EINVAL); +} + +struct mkimg_format * +format_selected(void) +{ + + return (format); +} + +int +format_write(int fd) +{ + lba_t size; + int error; + + if (format == NULL) + return (ENOSYS); + size = image_get_size(); + error = format->resize(size); + if (!error) + error = format->write(fd); + return (error); +} Copied: head/usr.bin/mkimg/format.h (from r266175, user/marcel/mkimg/format.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/format.h Thu May 15 19:19:57 2014 (r266176, copy of r266175, user/marcel/mkimg/format.h) @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2014 Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MKIMG_FORMAT_H_ +#define _MKIMG_FORMAT_H_ + +#include + +struct mkimg_format { + const char *name; + const char *description; + int (*resize)(lba_t); + int (*write)(int); +}; + +SET_DECLARE(formats, struct mkimg_format); +#define FORMAT_DEFINE(nm) DATA_SET(formats, nm) + +int format_resize(lba_t); +int format_select(const char *); +struct mkimg_format *format_selected(void); +int format_write(int); + +#endif /* _MKIMG_FORMAT_H_ */ Modified: head/usr.bin/mkimg/gpt.c ============================================================================== --- head/usr.bin/mkimg/gpt.c Thu May 15 19:09:31 2014 (r266175) +++ head/usr.bin/mkimg/gpt.c Thu May 15 19:19:57 2014 (r266176) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "image.h" #include "mkimg.h" #include "scheme.h" @@ -166,7 +167,7 @@ gpt_metadata(u_int where) } static int -gpt_write_pmbr(int fd, lba_t blks, void *bootcode) +gpt_write_pmbr(lba_t blks, void *bootcode) { u_char *pmbr; uint32_t secs; @@ -190,7 +191,7 @@ gpt_write_pmbr(int fd, lba_t blks, void le32enc(pmbr + DOSPARTOFF + 8, 1); le32enc(pmbr + DOSPARTOFF + 12, secs); le16enc(pmbr + DOSMAGICOFFSET, DOSMAGIC); - error = mkimg_write(fd, 0, pmbr, 1); + error = image_write(0, pmbr, 1); free(pmbr); return (error); } @@ -226,8 +227,7 @@ gpt_mktbl(u_int tblsz) } static int -gpt_write_hdr(int fd, struct gpt_hdr *hdr, uint64_t self, uint64_t alt, - uint64_t tbl) +gpt_write_hdr(struct gpt_hdr *hdr, uint64_t self, uint64_t alt, uint64_t tbl) { uint32_t crc; @@ -237,11 +237,11 @@ gpt_write_hdr(int fd, struct gpt_hdr *hd hdr->hdr_crc_self = 0; crc = crc32(hdr, offsetof(struct gpt_hdr, padding)); le64enc(&hdr->hdr_crc_self, crc); - return (mkimg_write(fd, self, hdr, 1)); + return (image_write(self, hdr, 1)); } static int -gpt_write(int fd, lba_t imgsz, void *bootcode) +gpt_write(lba_t imgsz, void *bootcode) { uuid_t uuid; struct gpt_ent *tbl; @@ -251,7 +251,7 @@ gpt_write(int fd, lba_t imgsz, void *boo int error; /* PMBR */ - error = gpt_write_pmbr(fd, imgsz, bootcode); + error = gpt_write_pmbr(imgsz, bootcode); if (error) return (error); @@ -260,10 +260,10 @@ gpt_write(int fd, lba_t imgsz, void *boo tbl = gpt_mktbl(tblsz); if (tbl == NULL) return (errno); - error = mkimg_write(fd, 2, tbl, tblsz); + error = image_write(2, tbl, tblsz); if (error) goto out; - error = mkimg_write(fd, imgsz - (tblsz + 1), tbl, tblsz); + error = image_write(imgsz - (tblsz + 1), tbl, tblsz); if (error) goto out; @@ -285,9 +285,9 @@ gpt_write(int fd, lba_t imgsz, void *boo le32enc(&hdr->hdr_entsz, sizeof(struct gpt_ent)); crc = crc32(tbl, nparts * sizeof(struct gpt_ent)); le32enc(&hdr->hdr_crc_table, crc); - error = gpt_write_hdr(fd, hdr, 1, imgsz - 1, 2); + error = gpt_write_hdr(hdr, 1, imgsz - 1, 2); if (!error) - error = gpt_write_hdr(fd, hdr, imgsz - 1, 1, imgsz - tblsz - 1); + error = gpt_write_hdr(hdr, imgsz - 1, 1, imgsz - tblsz - 1); free(hdr); out: Copied: head/usr.bin/mkimg/image.c (from r266175, user/marcel/mkimg/image.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/image.c Thu May 15 19:19:57 2014 (r266176, copy of r266175, user/marcel/mkimg/image.c) @@ -0,0 +1,167 @@ +/*- + * Copyright (c) 2014 Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include "image.h" +#include "mkimg.h" + +#define BUFFER_SIZE (1024*1024) + +static char image_tmpfile[] = "/tmp/mkimg-XXXXXX"; +static int image_fd = -1; +static lba_t image_size; + +static void +cleanup(void) +{ + + if (image_fd != -1) + close(image_fd); + unlink(image_tmpfile); +} + +int +image_copyin(lba_t blk, int fd, uint64_t *sizep) +{ + char *buffer; + uint64_t bytesize; + ssize_t bcnt, rdsz; + int error, partial; + + assert(BUFFER_SIZE % secsz == 0); + + buffer = malloc(BUFFER_SIZE); + if (buffer == NULL) + return (ENOMEM); + bytesize = 0; + partial = 0; + while (1) { + rdsz = read(fd, buffer, BUFFER_SIZE); + if (rdsz <= 0) { + error = (rdsz < 0) ? errno : 0; + break; + } + if (partial) + abort(); + bytesize += rdsz; + bcnt = (rdsz + secsz - 1) / secsz; + error = image_write(blk, buffer, bcnt); + if (error) + break; + blk += bcnt; + partial = ((ssize_t)(bcnt * secsz) != rdsz) ? 1 : 0; + } + free(buffer); + if (sizep != NULL) + *sizep = bytesize; + return (error); +} + +int +image_copyout(int fd) +{ + char *buffer; + off_t ofs; + ssize_t rdsz, wrsz; + int error; + + ofs = lseek(fd, 0L, SEEK_CUR); + + buffer = malloc(BUFFER_SIZE); + if (buffer == NULL) + return (errno); + if (lseek(image_fd, 0, SEEK_SET) != 0) + return (errno); + error = 0; + while (1) { + rdsz = read(image_fd, buffer, BUFFER_SIZE); + if (rdsz <= 0) { + error = (rdsz < 0) ? errno : 0; + break; + } + wrsz = (ofs == -1) ? + write(fd, buffer, rdsz) : + sparse_write(fd, buffer, rdsz); + if (wrsz < 0) { + error = errno; + break; + } + } + free(buffer); + ofs = lseek(fd, 0L, SEEK_CUR); + ftruncate(fd, ofs); + return (error); +} + +lba_t +image_get_size(void) +{ + + return (image_size); +} + +int +image_set_size(lba_t blk) +{ + + image_size = blk; + if (ftruncate(image_fd, blk * secsz) == -1) + return (errno); + return (0); +} + +int +image_write(lba_t blk, void *buf, ssize_t len) +{ + + blk *= secsz; + if (lseek(image_fd, blk, SEEK_SET) != blk) + return (errno); + len *= secsz; + if (sparse_write(image_fd, buf, len) != len) + return (errno); + return (0); +} + +int +image_init(void) +{ + + if (atexit(cleanup) == -1) + return (errno); + image_fd = mkstemp(image_tmpfile); + if (image_fd == -1) + return (errno); + return (0); +} Copied: head/usr.bin/mkimg/image.h (from r266175, user/marcel/mkimg/image.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/image.h Thu May 15 19:19:57 2014 (r266176, copy of r266175, user/marcel/mkimg/image.h) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2014 Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MKIMG_IMAGE_H_ +#define _MKIMG_IMAGE_H_ + +typedef int64_t lba_t; + +int image_copyin(lba_t blk, int fd, uint64_t *sizep); +int image_copyout(int fd); +lba_t image_get_size(void); +int image_init(void); +int image_set_size(lba_t blk); +int image_write(lba_t blk, void *buf, ssize_t len); + +#endif /* _MKIMG_IMAGE_H_ */ Modified: head/usr.bin/mkimg/mbr.c ============================================================================== --- head/usr.bin/mkimg/mbr.c Thu May 15 19:09:31 2014 (r266175) +++ head/usr.bin/mkimg/mbr.c Thu May 15 19:19:57 2014 (r266176) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "image.h" #include "mkimg.h" #include "scheme.h" @@ -68,7 +69,7 @@ mbr_chs(u_char *cyl, u_char *hd, u_char } static int -mbr_write(int fd, lba_t imgsz __unused, void *bootcode) +mbr_write(lba_t imgsz __unused, void *bootcode) { u_char *mbr; struct dos_partition *dpbase, *dp; @@ -96,7 +97,7 @@ mbr_write(int fd, lba_t imgsz __unused, le32enc(&dp->dp_start, part->block); le32enc(&dp->dp_size, part->size); } - error = mkimg_write(fd, 0, mbr, 1); + error = image_write(0, mbr, 1); free(mbr); return (error); } Modified: head/usr.bin/mkimg/mkimg.1 ============================================================================== --- head/usr.bin/mkimg/mkimg.1 Thu May 15 19:09:31 2014 (r266175) +++ head/usr.bin/mkimg/mkimg.1 Thu May 15 19:19:57 2014 (r266176) @@ -37,6 +37,7 @@ .Op Fl S Ar secsz .Op Fl T Ar tracksz .Op Fl b Ar bootcode +.Op Fl f Ar format .Op Fl o Ar outfile .Op Fl v .Fl s Ar scheme @@ -56,6 +57,10 @@ The disk image is written to by default or the file specified with the .Ar outfile argument. +The image file is a raw disk image by default, but the format of the +image file can be specified with the +.Ar format +argument. .Pp The disk image can be made bootable by specifying the scheme-specific boot block contents with the @@ -106,8 +111,8 @@ option increases the level of output tha .Nm utility prints. .Pp -For a complete list of supported partitioning schemes or for a detailed -description of how to specify partitions, run the +For a complete list of supported partitioning schemes or supported output +format, or for a detailed description of how to specify partitions, run the .Nm utility without any arguments. .Sh EXAMPLES @@ -121,6 +126,14 @@ utility as follows: -p freebsd-ufs:=root-file-system.ufs -p freebsd-swap::1G \ -o gpt.img .Pp +The command line given above results in a raw image file. +This is because no output format was given. +To create a VMDK image for example, add the +.Fl f Ar vmdk +argument to the +.Nm +utility and name the output file accordingly. +.Pp A nested partitioning scheme is created by running the .Nm utility twice. Modified: head/usr.bin/mkimg/mkimg.c ============================================================================== --- head/usr.bin/mkimg/mkimg.c Thu May 15 19:09:31 2014 (r266175) +++ head/usr.bin/mkimg/mkimg.c Thu May 15 19:19:57 2014 (r266176) @@ -42,15 +42,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include "image.h" +#include "format.h" #include "mkimg.h" #include "scheme.h" -#if !defined(SPARSE_WRITE) -#define sparse_write write -#endif - -#define BUFFER_SIZE (1024*1024) - struct partlisthead partlist = STAILQ_HEAD_INITIALIZER(partlist); u_int nparts = 0; @@ -62,31 +58,18 @@ u_int nsecs = 1; u_int secsz = 512; u_int blksz = 0; -static int bcfd = -1; -static int outfd = 0; -static int tmpfd = -1; - -static char tmpfname[] = "/tmp/mkimg-XXXXXX"; - -static void -cleanup(void) -{ - - if (tmpfd != -1) - close(tmpfd); - unlink(tmpfname); -} - static void usage(const char *why) { - struct mkimg_scheme *s, **iter; + struct mkimg_format *f, **f_iter; + struct mkimg_scheme *s, **s_iter; warnx("error: %s", why); fprintf(stderr, "\nusage: %s \n", getprogname()); fprintf(stderr, " options:\n"); fprintf(stderr, "\t-b \t- file containing boot code\n"); + fprintf(stderr, "\t-f \n"); fprintf(stderr, "\t-o \t- file to write image into\n"); fprintf(stderr, "\t-p \n"); fprintf(stderr, "\t-s \n"); @@ -95,13 +78,19 @@ usage(const char *why) fprintf(stderr, "\t-S \t- logical sector size\n"); fprintf(stderr, "\t-T \t- number of tracks to simulate\n"); - fprintf(stderr, " schemes:\n"); - SET_FOREACH(iter, schemes) { - s = *iter; + fprintf(stderr, "\n formats:\n"); + SET_FOREACH(f_iter, formats) { + f = *f_iter; + fprintf(stderr, "\t%s\t- %s\n", f->name, f->description); + } + + fprintf(stderr, "\n schemes:\n"); + SET_FOREACH(s_iter, schemes) { + s = *s_iter; fprintf(stderr, "\t%s\t- %s\n", s->name, s->description); } - fprintf(stderr, " partition specification:\n"); + fprintf(stderr, "\n partition specification:\n"); fprintf(stderr, "\t[/]::\t- empty partition of given " "size\n"); fprintf(stderr, "\t[/]:=\t- partition content and size " @@ -228,14 +217,15 @@ parse_part(const char *spec) } #if defined(SPARSE_WRITE) -static ssize_t -sparse_write(int fd, const char *buf, size_t sz) +ssize_t +sparse_write(int fd, const void *ptr, size_t sz) { - const char *p; + const char *buf, *p; off_t ofs; size_t len; ssize_t wr, wrsz; + buf = ptr; wrsz = 0; p = memchr(buf, 0, sz); while (sz > 0) { @@ -268,66 +258,8 @@ sparse_write(int fd, const char *buf, si } #endif /* SPARSE_WRITE */ -static int -fdcopy(int src, int dst, uint64_t *count) -{ - char *buffer; - off_t ofs; - ssize_t rdsz, wrsz; - - /* A return value of -1 means that we can't write a sparse file. */ - ofs = lseek(dst, 0L, SEEK_CUR); - - if (count != NULL) - *count = 0; - - buffer = malloc(BUFFER_SIZE); - if (buffer == NULL) - return (errno); - while (1) { - rdsz = read(src, buffer, BUFFER_SIZE); - if (rdsz <= 0) { - free(buffer); - return ((rdsz < 0) ? errno : 0); - } - if (count != NULL) - *count += rdsz; - wrsz = (ofs == -1) ? - write(dst, buffer, rdsz) : - sparse_write(dst, buffer, rdsz); - if (wrsz < 0) - break; - } - free(buffer); - return (errno); -} - -static int -mkimg_seek(int fd, lba_t blk) -{ - off_t off; - - off = blk * secsz; - if (lseek(fd, off, SEEK_SET) != off) - return (errno); - return (0); -} - -int -mkimg_write(int fd, lba_t blk, void *buf, ssize_t len) -{ - - blk *= secsz; - if (lseek(fd, blk, SEEK_SET) != blk) - return (errno); - len *= secsz; - if (write(fd, buf, len) != len) - return (errno); - return (0); -} - static void -mkimg(int bfd) +mkimg(void) { FILE *fp; struct part *part; @@ -335,10 +267,6 @@ mkimg(int bfd) off_t bytesize; int error, fd; - error = scheme_bootcode(bfd); - if (error) - errc(EX_DATAERR, error, "boot code"); - /* First check partition information */ STAILQ_FOREACH(part, &partlist, link) { error = scheme_check_part(part); @@ -353,7 +281,6 @@ mkimg(int bfd) fprintf(stderr, "partition %d: starting block %llu " "... ", part->index + 1, (long long)block); part->block = block; - error = mkimg_seek(tmpfd, block); switch (part->kind) { case PART_KIND_SIZE: if (expand_number(part->contents, &bytesize) == -1) @@ -362,7 +289,7 @@ mkimg(int bfd) case PART_KIND_FILE: fd = open(part->contents, O_RDONLY, 0); if (fd != -1) { - error = fdcopy(fd, tmpfd, &bytesize); + error = image_copyin(block, fd, &bytesize); close(fd); } else error = errno; @@ -370,7 +297,8 @@ mkimg(int bfd) case PART_KIND_PIPE: fp = popen(part->contents, "r"); if (fp != NULL) { - error = fdcopy(fileno(fp), tmpfd, &bytesize); + fd = fileno(fp); + error = image_copyin(block, fd, &bytesize); pclose(fp); } else error = errno; @@ -389,15 +317,27 @@ mkimg(int bfd) } block = scheme_metadata(SCHEME_META_IMG_END, block); - error = (scheme_write(tmpfd, block)); + error = image_set_size(block); + if (!error) + error = format_resize(block); + if (error) + errc(EX_IOERR, error, "image sizing"); + block = image_get_size(); + ncyls = block / (nsecs * nheads); + error = (scheme_write(block)); + if (error) + errc(EX_IOERR, error, "writing metadata"); } int main(int argc, char *argv[]) { + int bcfd, outfd; int c, error; - while ((c = getopt(argc, argv, "b:o:p:s:vH:P:S:T:")) != -1) { + bcfd = -1; + outfd = 1; /* Write to stdout by default */ + while ((c = getopt(argc, argv, "b:f:o:p:s:vH:P:S:T:")) != -1) { switch (c) { case 'b': /* BOOT CODE */ if (bcfd != -1) @@ -406,8 +346,15 @@ main(int argc, char *argv[]) if (bcfd == -1) err(EX_UNAVAILABLE, "%s", optarg); break; + case 'f': /* OUTPUT FORMAT */ + if (format_selected() != NULL) + usage("multiple formats given"); + error = format_select(optarg); + if (error) + errc(EX_DATAERR, error, "format"); + break; case 'o': /* OUTPUT FILE */ - if (outfd != 0) + if (outfd != 1) usage("multiple output files given"); outfd = open(optarg, O_WRONLY | O_CREAT | O_TRUNC, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH); @@ -480,35 +427,43 @@ main(int argc, char *argv[]) errx(EX_DATAERR, "%d partitions supported; %d given", scheme_max_parts(), nparts); - if (outfd == 0) { - if (atexit(cleanup) == -1) - err(EX_OSERR, "cannot register cleanup function"); - outfd = 1; - tmpfd = mkstemp(tmpfname); - if (tmpfd == -1) - err(EX_OSERR, "cannot create temporary file"); - } else - tmpfd = outfd; + if (format_selected() == NULL) + format_select("raw"); + + if (bcfd != -1) { + error = scheme_bootcode(bcfd); + close(bcfd); + if (error) + errc(EX_DATAERR, error, "boot code"); + } if (verbose) { fprintf(stderr, "Logical sector size: %u\n", secsz); fprintf(stderr, "Physical block size: %u\n", blksz); fprintf(stderr, "Sectors per track: %u\n", nsecs); fprintf(stderr, "Number of heads: %u\n", nheads); + fputc('\n', stderr); + fprintf(stderr, "Partitioning scheme: %s\n", + scheme_selected()->name); + fprintf(stderr, "Output file format: %s\n", + format_selected()->name); + fputc('\n', stderr); } - mkimg(bcfd); + error = image_init(); + if (error) + errc(EX_OSERR, error, "cannot initialize"); - if (verbose) - fprintf(stderr, "Number of cylinders: %u\n", ncyls); + mkimg(); - if (tmpfd != outfd) { - error = mkimg_seek(tmpfd, 0); - if (error == 0) - error = fdcopy(tmpfd, outfd, NULL); - if (error) - errc(EX_IOERR, error, "writing to stdout"); + if (verbose) { + fputc('\n', stderr); + fprintf(stderr, "Number of cylinders: %u\n", ncyls); } + error = format_write(outfd); + if (error) + errc(EX_IOERR, error, "writing image"); + return (0); } Modified: head/usr.bin/mkimg/mkimg.h ============================================================================== --- head/usr.bin/mkimg/mkimg.h Thu May 15 19:09:31 2014 (r266175) +++ head/usr.bin/mkimg/mkimg.h Thu May 15 19:19:57 2014 (r266176) @@ -31,8 +31,6 @@ #include -typedef int64_t lba_t; - struct part { STAILQ_ENTRY(part) link; char *alias; /* Partition type alias. */ @@ -67,6 +65,10 @@ round_block(lba_t n) return ((n + b - 1) & ~(b - 1)); } -int mkimg_write(int fd, lba_t blk, void *buf, ssize_t len); +#if !defined(SPARSE_WRITE) +#define sparse_write write +#else +ssize_t sparse_write(int, const void *, size_t); +#endif #endif /* _MKIMG_MKIMG_H_ */ Modified: head/usr.bin/mkimg/pc98.c ============================================================================== --- head/usr.bin/mkimg/pc98.c Thu May 15 19:09:31 2014 (r266175) +++ head/usr.bin/mkimg/pc98.c Thu May 15 19:19:57 2014 (r266176) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "image.h" #include "mkimg.h" #include "scheme.h" @@ -77,7 +78,7 @@ pc98_chs(u_short *cyl, u_char *hd, u_cha } static int -pc98_write(int fd, lba_t imgsz __unused, void *bootcode) +pc98_write(lba_t imgsz __unused, void *bootcode) { struct part *part; struct pc98_partition *dpbase, *dp; @@ -106,7 +107,7 @@ pc98_write(int fd, lba_t imgsz __unused, if (part->label != NULL) memcpy(dp->dp_name, part->label, strlen(part->label)); } - error = mkimg_write(fd, 0, buf, PC98_BOOTCODESZ / secsz); + error = image_write(0, buf, PC98_BOOTCODESZ / secsz); free(buf); return (error); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu May 15 19:26:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C9BBF15; Thu, 15 May 2014 19:26:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A2B82ADC; Thu, 15 May 2014 19:26:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FJQLCv060325; Thu, 15 May 2014 19:26:21 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FJQLeM060324; Thu, 15 May 2014 19:26:21 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201405151926.s4FJQLeM060324@svn.freebsd.org> From: Hiroki Sato Date: Thu, 15 May 2014 19:26:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266177 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 19:26:21 -0000 Author: hrs Date: Thu May 15 19:26:20 2014 New Revision: 266177 URL: http://svnweb.freebsd.org/changeset/base/266177 Log: - Do not override sin6_scope_id in LLA when it is already set to non-zero. This fixes destination list in output of netstat -r. - Plug a memory leak. - Add RTM_VERSION check. - Minor style fixes. Modified: head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Thu May 15 19:19:57 2014 (r266176) +++ head/usr.bin/netstat/route.c Thu May 15 19:26:20 2014 (r266177) @@ -586,8 +586,9 @@ p_rtable_sysctl(int fibnum, int af) mib[4] = NET_RT_DUMP; mib[5] = 0; mib[6] = fibnum; - if (sysctl(mib, 7, NULL, &needed, NULL, 0) < 0) { - err(1, "sysctl: net.route.0.%d.dump.%d estimate", af, fibnum); + if (sysctl(mib, nitems(mib), NULL, &needed, NULL, 0) < 0) { + err(EX_OSERR, "sysctl: net.route.0.%d.dump.%d estimate", af, + fibnum); } if ((buf = malloc(needed)) == 0) { @@ -599,6 +600,8 @@ p_rtable_sysctl(int fibnum, int af) lim = buf + needed; for (next = buf; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)next; + if (rtm->rtm_version != RTM_VERSION) + continue; /* * Peek inside header to determine AF */ @@ -611,6 +614,7 @@ p_rtable_sysctl(int fibnum, int af) } p_rtentry_sysctl(rtm); } + free(buf); } static void @@ -971,9 +975,9 @@ in6_fillscopeid(struct sockaddr_in6 *sa6 if (IN6_IS_ADDR_LINKLOCAL(&sa6->sin6_addr) || IN6_IS_ADDR_MC_NODELOCAL(&sa6->sin6_addr) || IN6_IS_ADDR_MC_LINKLOCAL(&sa6->sin6_addr)) { - /* XXX: override is ok? */ - sa6->sin6_scope_id = - ntohs(*(u_int16_t *)&sa6->sin6_addr.s6_addr[2]); + if (sa6->sin6_scope_id == 0) + sa6->sin6_scope_id = + ntohs(*(u_int16_t *)&sa6->sin6_addr.s6_addr[2]); sa6->sin6_addr.s6_addr[2] = sa6->sin6_addr.s6_addr[3] = 0; } #endif From owner-svn-src-head@FreeBSD.ORG Thu May 15 19:48:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9AE9782; Thu, 15 May 2014 19:48:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD2F72CA9; Thu, 15 May 2014 19:48:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FJmDRv069533; Thu, 15 May 2014 19:48:13 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FJmDaF069532; Thu, 15 May 2014 19:48:13 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201405151948.s4FJmDaF069532@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 15 May 2014 19:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266179 - head/contrib/unbound/smallapp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 19:48:13 -0000 Author: des Date: Thu May 15 19:48:13 2014 New Revision: 266179 URL: http://svnweb.freebsd.org/changeset/base/266179 Log: diff reduction Modified: head/contrib/unbound/smallapp/unbound-control-setup.sh.in Modified: head/contrib/unbound/smallapp/unbound-control-setup.sh.in ============================================================================== --- head/contrib/unbound/smallapp/unbound-control-setup.sh.in Thu May 15 19:28:52 2014 (r266178) +++ head/contrib/unbound/smallapp/unbound-control-setup.sh.in Thu May 15 19:48:13 2014 (r266179) @@ -22,16 +22,16 @@ # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # settings: From owner-svn-src-head@FreeBSD.ORG Thu May 15 19:48:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5B758BD; Thu, 15 May 2014 19:48:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7895C2CAE; Thu, 15 May 2014 19:48:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FJmql5069644; Thu, 15 May 2014 19:48:52 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FJmqD7069643; Thu, 15 May 2014 19:48:52 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201405151948.s4FJmqD7069643@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 15 May 2014 19:48:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266180 - head/contrib/unbound/smallapp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 19:48:52 -0000 Author: des Date: Thu May 15 19:48:52 2014 New Revision: 266180 URL: http://svnweb.freebsd.org/changeset/base/266180 Log: regenerate Modified: head/contrib/unbound/smallapp/unbound-control-setup.sh Modified: head/contrib/unbound/smallapp/unbound-control-setup.sh ============================================================================== --- head/contrib/unbound/smallapp/unbound-control-setup.sh Thu May 15 19:48:13 2014 (r266179) +++ head/contrib/unbound/smallapp/unbound-control-setup.sh Thu May 15 19:48:52 2014 (r266180) @@ -22,16 +22,16 @@ # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # settings: From owner-svn-src-head@FreeBSD.ORG Thu May 15 20:41:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFCDA50A; Thu, 15 May 2014 20:41:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAD992148; Thu, 15 May 2014 20:41:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FKfGI0095192; Thu, 15 May 2014 20:41:16 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FKfGQI095190; Thu, 15 May 2014 20:41:16 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201405152041.s4FKfGQI095190@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 15 May 2014 20:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266193 - in head/contrib/ldns: . ldns X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 20:41:17 -0000 Author: des Date: Thu May 15 20:41:16 2014 New Revision: 266193 URL: http://svnweb.freebsd.org/changeset/base/266193 Log: ldns_axfr_abort is apparently an undocumented API function. Unstaticize and add a prototype + documentation to the relevant header. Modified: head/contrib/ldns/ldns/resolver.h head/contrib/ldns/resolver.c Modified: head/contrib/ldns/ldns/resolver.h ============================================================================== --- head/contrib/ldns/ldns/resolver.h Thu May 15 20:27:57 2014 (r266192) +++ head/contrib/ldns/ldns/resolver.h Thu May 15 20:41:16 2014 (r266193) @@ -740,6 +740,12 @@ void ldns_resolver_deep_free(ldns_resolv ldns_rr* ldns_axfr_next(ldns_resolver *resolver); /** + * Abort a transfer that is in progress + * \param[in] resolver the resolver that is used + */ +void ldns_axfr_abort(ldns_resolver *resolver); + +/** * Returns true if the axfr transfer has completed (i.e. 2 SOA RRs and no errors were encountered * \param[in] resolver the resolver that is used * \return bool true if axfr transfer was completed without error Modified: head/contrib/ldns/resolver.c ============================================================================== --- head/contrib/ldns/resolver.c Thu May 15 20:27:57 2014 (r266192) +++ head/contrib/ldns/resolver.c Thu May 15 20:41:16 2014 (r266193) @@ -1372,7 +1372,7 @@ ldns_axfr_next(ldns_resolver *resolver) * library staying in an indetermined state because the socket for the * AXFR is never closed */ -static void +void ldns_axfr_abort(ldns_resolver *resolver) { /* Only abort if an actual AXFR is in progress */ From owner-svn-src-head@FreeBSD.ORG Thu May 15 21:19:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53E1FC3D; Thu, 15 May 2014 21:19:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4130124A9; Thu, 15 May 2014 21:19:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4FLJE6O010875; Thu, 15 May 2014 21:19:14 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4FLJExd010870; Thu, 15 May 2014 21:19:14 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405152119.s4FLJExd010870@svn.freebsd.org> From: Mark Johnston Date: Thu, 15 May 2014 21:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266195 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 21:19:15 -0000 Author: markj Date: Thu May 15 21:19:13 2014 New Revision: 266195 URL: http://svnweb.freebsd.org/changeset/base/266195 Log: Remove some prototypes for undefined functions. MFC after: 3 days Modified: head/sys/dev/hwpmc/hwpmc_core.h head/sys/dev/hwpmc/hwpmc_uncore.h Modified: head/sys/dev/hwpmc/hwpmc_core.h ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.h Thu May 15 20:58:23 2014 (r266194) +++ head/sys/dev/hwpmc/hwpmc_core.h Thu May 15 21:19:13 2014 (r266195) @@ -179,8 +179,6 @@ int pmc_core_initialize(struct pmc_mdep int _version_override); void pmc_core_finalize(struct pmc_mdep *_md); -void pmc_core_mark_started(int _cpu, int _pmc); - int pmc_iaf_initialize(struct pmc_mdep *_md, int _maxcpu, int _npmc, int _width); void pmc_iaf_finalize(struct pmc_mdep *_md); Modified: head/sys/dev/hwpmc/hwpmc_uncore.h ============================================================================== --- head/sys/dev/hwpmc/hwpmc_uncore.h Thu May 15 20:58:23 2014 (r266194) +++ head/sys/dev/hwpmc/hwpmc_uncore.h Thu May 15 21:19:13 2014 (r266195) @@ -115,8 +115,6 @@ struct pmc_md_ucp_pmc { int pmc_uncore_initialize(struct pmc_mdep *_md, int _maxcpu); void pmc_uncore_finalize(struct pmc_mdep *_md); -void pmc_uncore_mark_started(int _cpu, int _pmc); - int pmc_ucf_initialize(struct pmc_mdep *_md, int _maxcpu, int _npmc, int _width); void pmc_ucf_finalize(struct pmc_mdep *_md); From owner-svn-src-head@FreeBSD.ORG Fri May 16 01:38:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 596B75E9; Fri, 16 May 2014 01:38:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D0382793; Fri, 16 May 2014 01:38:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4G1cdhA027097; Fri, 16 May 2014 01:38:39 GMT (envelope-from silby@svn.freebsd.org) Received: (from silby@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4G1ccjS027095; Fri, 16 May 2014 01:38:38 GMT (envelope-from silby@svn.freebsd.org) Message-Id: <201405160138.s4G1ccjS027095@svn.freebsd.org> From: Mike Silbersack Date: Fri, 16 May 2014 01:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266205 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 01:38:39 -0000 Author: silby Date: Fri May 16 01:38:38 2014 New Revision: 266205 URL: http://svnweb.freebsd.org/changeset/base/266205 Log: Remove the function tcp_twrecycleable; it has been #if 0'd for eight years. The original concept was to improve the corner case where you run out of ephemeral ports, but it was causing performance problems and the mechanism of limiting the number of time_wait sockets serves the same purpose in the end. Reviewed by: bz Modified: head/sys/netinet/tcp_timewait.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Fri May 16 01:30:30 2014 (r266204) +++ head/sys/netinet/tcp_timewait.c Fri May 16 01:38:38 2014 (r266205) @@ -357,39 +357,6 @@ tcp_twstart(struct tcpcb *tp) INP_WUNLOCK(inp); } -#if 0 -/* - * The appromixate rate of ISN increase of Microsoft TCP stacks; - * the actual rate is slightly higher due to the addition of - * random positive increments. - * - * Most other new OSes use semi-randomized ISN values, so we - * do not need to worry about them. - */ -#define MS_ISN_BYTES_PER_SECOND 250000 - -/* - * Determine if the ISN we will generate has advanced beyond the last - * sequence number used by the previous connection. If so, indicate - * that it is safe to recycle this tw socket by returning 1. - */ -int -tcp_twrecycleable(struct tcptw *tw) -{ - tcp_seq new_iss = tw->iss; - tcp_seq new_irs = tw->irs; - - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); - new_iss += (ticks - tw->t_starttime) * (ISN_BYTES_PER_SECOND / hz); - new_irs += (ticks - tw->t_starttime) * (MS_ISN_BYTES_PER_SECOND / hz); - - if (SEQ_GT(new_iss, tw->snd_nxt) && SEQ_GT(new_irs, tw->rcv_nxt)) - return (1); - else - return (0); -} -#endif - /* * Returns 1 if the TIME_WAIT state was killed and we should start over, * looking for a pcb in the listen state. Returns 0 otherwise. Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Fri May 16 01:30:30 2014 (r266204) +++ head/sys/netinet/tcp_var.h Fri May 16 01:38:38 2014 (r266205) @@ -635,9 +635,6 @@ struct tcpcb * tcp_close(struct tcpcb *); void tcp_discardcb(struct tcpcb *); void tcp_twstart(struct tcpcb *); -#if 0 -int tcp_twrecycleable(struct tcptw *tw); -#endif void tcp_twclose(struct tcptw *_tw, int _reuse); void tcp_ctlinput(int, struct sockaddr *, void *); int tcp_ctloutput(struct socket *, struct sockopt *); From owner-svn-src-head@FreeBSD.ORG Fri May 16 01:50:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E4B6937; Fri, 16 May 2014 01:50:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEEA8284C; Fri, 16 May 2014 01:50:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4G1o4KD031669; Fri, 16 May 2014 01:50:04 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4G1o43X031668; Fri, 16 May 2014 01:50:04 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201405160150.s4G1o43X031668@svn.freebsd.org> From: Benjamin Kaduk Date: Fri, 16 May 2014 01:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266206 - head/usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 01:50:05 -0000 Author: bjk (doc committer) Date: Fri May 16 01:50:04 2014 New Revision: 266206 URL: http://svnweb.freebsd.org/changeset/base/266206 Log: Review pass through jail.8 Replace usage of "prison" with "jail", since that term has mostly dropped out of use. Note once at the beginning that the "prison" term is equivalent, but do not use it otherwise. [1] Some grammar issues. Some mdoc formatting fixes. Consistently use \(em for em dashes, with spaces around it. Avoid contractions. Prefer ssh to telnet. PR: docs/176832 [1] Approved by: hrs (mentor) Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Fri May 16 01:38:38 2014 (r266205) +++ head/usr.sbin/jail/jail.8 Fri May 16 01:50:04 2014 (r266206) @@ -63,7 +63,9 @@ The .Nm utility creates new jails, or modifies or removes existing jails. -A jail is specified via parameters on the command line, or in the +A jail +.Pq or Dq prison +is specified via parameters on the command line, or in the .Xr jail.conf 5 file. .Pp @@ -73,7 +75,7 @@ At least one of the options or .Fl r must be specified. -These options are used alone or in combination describe the operation to +These options are used alone or in combination to describe the operation to perform: .Bl -tag -width indent .It Fl c @@ -82,8 +84,7 @@ The jail .Va jid and .Va name -parameters (if specified) on the command line, -or any jails +parameters (if specified on the command line) must not refer to an existing jail. .It Fl m Modify an existing jail. @@ -97,14 +98,15 @@ Some parameters may not be changed on a Remove the .Ar jail specified by jid or name. -All jailed processes are killed, and all children of this jail are also +All jailed processes are killed, and all jails that are +children of this jail are also removed. .It Fl rc Restart an existing jail. The jail is first removed and then re-created, as if -.Dq Nm Fl c -and .Dq Nm Fl r +and +.Dq Nm Fl c were run in succession. .It Fl cm Create a jail if it does not exist, or modify the jail if it does exist. @@ -134,7 +136,7 @@ Resolve the parameter (or .Va hostname ) and add all IP addresses returned by the resolver -to the list of addresses for this prison. +to the list of addresses for this jail. This is equivalent to the .Va ip_hostname parameter. @@ -146,7 +148,7 @@ option. .It Fl J Ar jid_file Write a .Ar jid_file -file, containing parameters used to start the jail. +file, containing the parameters used to start the jail. .It Fl l Run commands in a clean environment. This is deprecated and is equivalent to the exec.clean parameter. @@ -166,7 +168,7 @@ Only error messages will be printed. A variation of the .Fl r option that removes an existing jail without using the configuration file. -No removal-related parameters for this jail will be used - the jail will +No removal-related parameters for this jail will be used \(em the jail will simply be removed. .It Fl s Ar securelevel Set the @@ -183,7 +185,7 @@ and .Va exec.system_jail_user parameters. .It Fl U Ar username -The user name from jailed environment as whom jailed commands should run. +The user name from the jailed environment as whom jailed commands should run. This is deprecated and is equivalent to the .Va exec.jail_user parameter. @@ -237,13 +239,12 @@ This mode will always create a new jail, .Fl c and .Fl m -options don't apply (and must not exist). +options do not apply (and must not be present). .Ss Jail Parameters Parameters in the .Xr jail.conf 5 -file, or on the command line, are generally in -.Dq name=value -form. +file, or on the command line, are generally of the form +.Dq name=value . Some parameters are boolean, and do not have a value but are set by the name alone with or without a .Dq no @@ -264,9 +265,10 @@ for details). .Pp The .Nm -utility recognizes two classes of parameters. There are the true jail +utility recognizes two classes of parameters. +There are the true jail parameters that are passed to the kernel when the jail is created, -can be seen with +which can be seen with .Xr jls 8 , and can (usually) be changed with .Dq Nm Fl m . @@ -314,26 +316,26 @@ parameter is implied by the file format, and need not be explicitly set when using the configuration file. .It Va path -The directory which is to be the root of the prison. -Any commands run inside the prison, either by +The directory which is to be the root of the jail. +Any commands run inside the jail, either by .Nm or from .Xr jexec 8 , are run from this directory. .It Va ip4.addr -A list of IPv4 addresses assigned to the prison. +A list of IPv4 addresses assigned to the jail. If this is set, the jail is restricted to using only these addresses. Any attempts to use other addresses fail, and attempts to use wildcard addresses silently use the jailed address instead. -For IPv4 the first address given will be kept used as the source address -in case source address selection on unbound sockets cannot find a better +For IPv4 the first address given will be used as the source address +when source address selection on unbound sockets cannot find a better match. -It is only possible to start multiple jails with the same IP address, +It is only possible to start multiple jails with the same IP address if none of the jails has more than this single overlapping IP address assigned to itself. .It Va ip4.saddrsel A boolean option to change the formerly mentioned behaviour and disable -IPv4 source address selection for the prison in favour of the primary +IPv4 source address selection for the jail in favour of the primary IPv4 address of the jail. Source address selection is enabled by default for all jails and the .Va ip4.nosaddrsel @@ -345,8 +347,8 @@ Possible values are to allow unrestricted access to all system addresses, .Dq new to restrict addresses via -.Va ip4.addr -above, and +.Va ip4.addr , +and .Dq disable to stop the jail from using IPv4 entirely. Setting the @@ -354,14 +356,14 @@ Setting the parameter implies a value of .Dq new . .It Va ip6.addr , Va ip6.saddrsel , Va ip6 -A set of IPv6 options for the prison, the counterparts to +A set of IPv6 options for the jail, the counterparts to .Va ip4.addr , .Va ip4.saddrsel and .Va ip4 above. .It vnet -Create the prison with its own virtual network stack, +Create the jail with its own virtual network stack, with its own network interfaces, addresses, routing table, etc. The kernel must have been compiled with the .Sy VIMAGE option @@ -373,7 +375,7 @@ and .Dq new to create a new network stack. .It Va host.hostname -The hostname of the prison. +The hostname of the jail. Other similar parameters are .Va host.domainname , .Va host.hostuuid @@ -392,7 +394,7 @@ Setting any of the above fields implies The value of the jail's .Va kern.securelevel sysctl. -A jail never has a lower securelevel than the default system, but by +A jail never has a lower securelevel than its parent system, but by setting this parameter it may have a higher one. If the system securelevel is changed, any jail securelevels will be at least as secure. @@ -432,12 +434,12 @@ section for more information. The number of descendants of this jail, including its own child jails and any jails created under them. .It Va enforce_statfs -This determines which information processes in a jail are able to get +This determines what information processes in a jail are able to get about mount points. It affects the behaviour of the following syscalls: .Xr statfs 2 , .Xr fstatfs 2 , -.Xr getfsstat 2 +.Xr getfsstat 2 , and .Xr fhstatfs 2 (as well as similar compatibility syscalls). @@ -488,12 +490,12 @@ namespace across the host and jail envir within a jail would be able to communicate with (and potentially interfere with) processes outside of the jail, and in other jails. .It Va allow.raw_sockets -The prison root is allowed to create raw sockets. +The jail root is allowed to create raw sockets. Setting this parameter allows utilities like .Xr ping 8 and .Xr traceroute 8 -to operate inside the prison. +to operate inside the jail. If this is set, the source IP addresses are enforced to comply with the IP address bound to the jail, regardless of whether or not the @@ -523,10 +525,10 @@ privileged users inside the jail will be devfs file system. This permission is effective only together with .Va allow.mount -and if +and only when .Va enforce_statfs is set to a value lower than 2. -Please consider restricting the devfs ruleset with the +The devfs ruleset should be restricted from the default by using the .Va devfs_ruleset option. .It Va allow.mount.nullfs @@ -534,7 +536,7 @@ privileged users inside the jail will be nullfs file system. This permission is effective only together with .Va allow.mount -and if +and only when .Va enforce_statfs is set to a value lower than 2. .It Va allow.mount.procfs @@ -542,7 +544,7 @@ privileged users inside the jail will be procfs file system. This permission is effective only together with .Va allow.mount -and if +and only when .Va enforce_statfs is set to a value lower than 2. .It Va allow.mount.tmpfs @@ -550,7 +552,7 @@ privileged users inside the jail will be tmpfs file system. This permission is effective only together with .Va allow.mount -and if +and only when .Va enforce_statfs is set to a value lower than 2. .It Va allow.mount.zfs @@ -558,7 +560,7 @@ privileged users inside the jail will be ZFS file system. This permission is effective only together with .Va allow.mount -and if +and only when .Va enforce_statfs is set to a value lower than 2. See @@ -566,7 +568,7 @@ See for information on how to configure the ZFS filesystem to operate from within a jail. .It Va allow.quotas -The prison root may administer quotas on the jail's filesystem(s). +The jail root may administer quotas on the jail's filesystem(s). This includes filesystems that the jail may share with other jails or with non-jailed parts of the system. .It Va allow.socket_af @@ -576,33 +578,33 @@ have not had jail functionality added to .El .El .Pp -There are pseudo-parameters that aren't passed to the kernel, but are +There are pseudo-parameters that are not passed to the kernel, but are used by .Nm -to set up the prison environment, often by running specified commands +to set up the jail environment, often by running specified commands when jails are created or removed. The .Va exec.* command parameters are .Xr sh 1 -command lines that are run in either the system or prison environment. +command lines that are run in either the system or jail environment. They may be given multiple values, which run would the specified commands in sequence. All commands must succeed (return a zero exit status), or the jail will -not be created or removed. +not be created or removed, as appropriate. .Pp The pseudo-parameters are: .Bl -tag -width indent .It Va exec.prestart -Command(s) to run in the system environment before a prison is created. +Command(s) to run in the system environment before a jail is created. .It Va exec.start -Command(s) to run in the prison environment when a jail is created. +Command(s) to run in the jail environment when a jail is created. A typical command to run is .Dq sh /etc/rc . .It Va command A synonym for .Va exec.start -for use when specifying a prison directly on the command line. +for use when specifying a jail directly on the command line. Unlike other parameters whose value is a single string, .Va command uses the remainder of the @@ -616,7 +618,7 @@ commands have completed. .It Va exec.prestop Command(s) to run in the system environment before a jail is removed. .It Va exec.stop -Command(s) to run in the prison environment before a jail is removed, +Command(s) to run in the jail environment before a jail is removed, and after any .Va exec.prestop commands have completed. @@ -641,76 +643,77 @@ is imported from the current environment The environment variables from the login class capability database for the target login are also set. .It Va exec.jail_user -The user to run commands as, when running in the prison environment. +The user to run commands as, when running in the jail environment. The default is to run the commands as the current user. .It Va exec.system_jail_user This boolean option looks for the .Va exec.jail_user in the system .Xr passwd 5 -file, instead of in the prison's file. +file, instead of in the jail's file. .It Va exec.system_user The user to run commands as, when running in the system environment. The default is to run the commands as the current user. .It Va exec.timeout The maximum amount of time to wait for a command to complete. If a command is still running after this many seconds have passed, -the jail not be created or removed. +the jail will not be created or removed, as appropriate. .It Va exec.consolelog A file to direct command output (stdout and stderr) to. .It Va exec.fib -The FIB (routing table) to set when running commands inside the prison. +The FIB (routing table) to set when running commands inside the jail. .It Va stop.timeout -The maximum amount of time to wait for a prison's processes to exit +The maximum amount of time to wait for a jail's processes to exit after sending them a .Dv SIGTERM signal (which happens after the .Va exec.stop commands have completed). -After this many seconds have passed, the prison will be removed, which +After this many seconds have passed, the jail will be removed, which will kill any remaining processes. If this is set to zero, no .Dv SIGTERM -is sent and the prison is immediately removed. +is sent and the jail is immediately removed. The default is 10 seconds. .It Va interface -A network interface to add the prison's IP addresses +A network interface to add the jail's IP addresses .Va ( ip4.addr and .Va ip6.addr ) to. An alias for each address will be added to the interface before the -prison is created, and will be removed from the interface after the -prison is removed. +jail is created, and will be removed from the interface after the +jail is removed. .It Va ip4.addr -In addition to the IP addresses that are passed to the kernel, and +In addition to the IP addresses that are passed to the kernel, an interface and/or a netmask may also be specified, in the form .Dq Ar interface Ns | Ns Ar ip-address Ns / Ns Ar netmask . If an interface is given before the IP address, an alias for the address will be added to that interface, as it is with the .Va interface -parameter. If a netmask in either dotted-quad or CIDR form is given -after IP address, it will be used when adding the IP alias. +parameter. +If a netmask in either dotted-quad or CIDR form is given +after an IP address, it will be used when adding the IP alias. .It Va ip6.addr In addition to the IP addresses that are passed to the kernel, -and interface and/or a prefix may also be specified, in the form +an interface and/or a prefix may also be specified, in the form .Dq Ar interface Ns | Ns Ar ip-address Ns / Ns Ar prefix . .It Va vnet.interface A network interface to give to a vnet-enabled jail after is it created. -The interface will automatically be returned when the jail is removed. +The interface will automatically be released when the jail is removed. .It Va ip_hostname Resolve the .Va host.hostname parameter and add all IP addresses returned by the resolver to the list of addresses -.Va ( ip4.addr +.Po Va ip4.addr or -.Va ip6.addr ) -for this prison. +.Va ip6.addr Pc +for this jail. This may affect default address selection for outgoing IPv4 connections -of prisons. +from jails. The address first returned by the resolver for each address family -will be used as primary address. +will be used as the primary address. .It Va mount A filesystem to mount before creating the jail (and to unmount after removing it), given as a single @@ -728,7 +731,7 @@ filesystem on the chrooted directory, and apply the ruleset in the .Va devfs_ruleset parameter (or a default of ruleset 4: devfsrules_jail) -to restrict the devices visible inside the prison. +to restrict the devices visible inside the jail. .It Va mount.fdescfs Mount a .Xr fdescfs 5 @@ -761,11 +764,11 @@ is required, so as to provide the necessary command line tools, daemons, libraries, application configuration files, etc. However, for a virtual server configuration, a fair amount of -additional work is required so as to configure the +additional work is required so as to replace the .Dq boot process. This manual page documents the configuration steps necessary to support -either of these steps, although the configuration steps may be +either of these steps, although the configuration steps may need to be refined based on local requirements. .Ss "Setting up a Jail Directory Tree" To set up a jail directory tree containing an entire @@ -785,7 +788,7 @@ In many cases this example would put far In the other extreme case a jail might contain only one file: the executable to be run in the jail. .Pp -We recommend experimentation and caution that it is a lot easier to +We recommend experimentation, and caution that it is a lot easier to start with a .Dq fat jail and remove things until it stops working, @@ -804,13 +807,13 @@ for a jail named Substitute below as needed with your own directory, IP address, and hostname. .Ss "Setting up the Host Environment" -First, you will want to set up your real system's environment to be +First, set up the real system's environment to be .Dq jail-friendly . For consistency, we will refer to the parent box as the .Dq "host environment" , and to the jailed virtual machine as the .Dq "jail environment" . -Since jail is implemented using IP aliases, one of the first things to do +Since jails are implemented using IP aliases, one of the first things to do is to disable IP services on the host system that listen on all local IP addresses for a service. If a network service is present in the host environment that binds all @@ -833,13 +836,12 @@ rpcbind_enable="NO" is the native IP address for the host system, in this example. Daemons that run out of .Xr inetd 8 -can be easily set to use only the specified host IP address. +can be easily configured to use only the specified host IP address. Other daemons -will need to be manually configured\(emfor some this is possible through -the +will need to be manually configured \(em for some this is possible through .Xr rc.conf 5 flags entries; for others it is necessary to modify per-application -configuration files, or to recompile the applications. +configuration files, or to recompile the application. The following frequently deployed services must have their individual configuration files modified to limit the application to listening to a specific IP address: @@ -877,7 +879,7 @@ easily reconfigured to use only specific hosted directly from the kernel. Any third-party network software running in the host environment should also be checked and configured so that it -does not bind all IP addresses, which would result in those services' also +does not bind all IP addresses, which would result in those services also appearing to be offered by the jail environments. .Pp Once @@ -890,7 +892,7 @@ etc.). Start any jail for the first time without configuring the network interface so that you can clean it up a little and set up accounts. As -with any machine (virtual or not) you will need to set a root password, time +with any machine (virtual or not), you will need to set a root password, time zone, etc. Some of these steps apply only if you intend to run a full virtual server inside the jail; others apply both for constraining a particular application @@ -915,7 +917,7 @@ etc. .It Configure .Pa /etc/resolv.conf -so that name resolution within the jail will work correctly +so that name resolution within the jail will work correctly. .It Run .Xr newaliases 1 @@ -923,13 +925,13 @@ to quell .Xr sendmail 8 warnings. .It -Set a root password, probably different from the real host system +Set a root password, probably different from the real host system. .It -Set the timezone +Set the timezone. .It -Add accounts for users in the jail environment +Add accounts for users in the jail environment. .It -Install any packages the environment requires +Install any packages the environment requires. .El .Pp You may also want to perform any package-specific configuration (web servers, @@ -989,11 +991,12 @@ and other processes running within the j with the .Ql J flag appearing beside jailed processes. -To see an active list of jails, use the -.Xr jls 8 -utility. -You should also be able to -.Xr telnet 1 +To see an active list of jails, use +.Xr jls 8 . +If +.Xr sshd 8 +is enabled in the jail environment, you should be able to +.Xr ssh 1 to the hostname or IP address of the jailed environment, and log in using the accounts you created previously. .Pp @@ -1021,7 +1024,7 @@ This will send the .Dv SIGTERM or .Dv SIGKILL -signals to all processes in the jail - be careful not to run this from +signals to all processes in the jail \(em be careful not to run this from the host environment! Once all of the jail's processes have died, unless the jail was created with the @@ -1076,18 +1079,18 @@ or any file system inside a jail unless the file system is marked jail-friendly, the jail's .Va allow.mount -parameter is set and the jail's +parameter is set, and the jail's .Va enforce_statfs parameter is lower than 2. .Pp Multiple jails sharing the same file system can influence each other. -For example a user in one jail can fill the file system also +For example, a user in one jail can fill the file system, leaving no space for processes in the other jail. Trying to use .Xr quota 1 -to prevent this will not work either as the file system quotas +to prevent this will not work either, as the file system quotas are not aware of jails but only look at the user and group IDs. -This means the same user ID in two jails share the same file +This means the same user ID in two jails share a single file system quota. One would need to use one file system per jail to make this work. .Ss "Sysctl MIB Entries" @@ -1098,11 +1101,11 @@ is one) or not (value is zero). .Pp The variable .Va security.jail.max_af_ips -determines how may address per address family a prison may have. +determines how may address per address family a jail may have. The default is 255. .Pp Some MIB variables have per-jail settings. -Changes to these variables by a jailed process do not effect the host +Changes to these variables by a jailed process do not affect the host environment, only the jail environment. These variables are .Va kern.securelevel , @@ -1127,7 +1130,7 @@ of 0 indicates the jail is a child of th jail if the current process isn't jailed). .Pp Jailed processes are not allowed to confer greater permissions than they -themselves are given, e.g. if a jail is created with +themselves are given, e.g., if a jail is created with .Va allow.nomount , it is not able to create a jail with .Va allow.mount From owner-svn-src-head@FreeBSD.ORG Fri May 16 03:05:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6687E79; Fri, 16 May 2014 03:05:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2E5F2EE0; Fri, 16 May 2014 03:05:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4G35rbg067511; Fri, 16 May 2014 03:05:53 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4G35ro0067510; Fri, 16 May 2014 03:05:53 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201405160305.s4G35ro0067510@svn.freebsd.org> From: Ed Maste Date: Fri, 16 May 2014 03:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266208 - head/usr.sbin/pmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 03:05:53 -0000 Author: emaste Date: Fri May 16 03:05:53 2014 New Revision: 266208 URL: http://svnweb.freebsd.org/changeset/base/266208 Log: Speed up pmcstat by improving string hash In one case generating callgraph output from a 24MB system-wide sampling data file took 17.4 seconds on average. Profiling showed pmcstat spending a lot of time in strcmp, due to hash collisions. Replacing the XOR-only hash with FNV-1a reduces the run time for my test by 40%. Modified: head/usr.sbin/pmcstat/pmcstat_log.c Modified: head/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat_log.c Fri May 16 02:21:51 2014 (r266207) +++ head/usr.sbin/pmcstat/pmcstat_log.c Fri May 16 03:05:53 2014 (r266208) @@ -307,10 +307,10 @@ pmcstat_stats_reset(int reset_global) static int pmcstat_string_compute_hash(const char *s) { - int hash; + unsigned hash; - for (hash = 0; *s; s++) - hash ^= *s; + for (hash = 2166136261; *s; s++) + hash = (hash ^ *s) * 16777619; return (hash & PMCSTAT_HASH_MASK); } From owner-svn-src-head@FreeBSD.ORG Fri May 16 03:18:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23B375FA; Fri, 16 May 2014 03:18:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 046B7200E; Fri, 16 May 2014 03:18:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4G3I9GS073020; Fri, 16 May 2014 03:18:09 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4G3I9Ov073017; Fri, 16 May 2014 03:18:09 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201405160318.s4G3I9Ov073017@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 16 May 2014 03:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266209 - head/usr.sbin/pmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 03:18:10 -0000 Author: gnn Date: Fri May 16 03:18:09 2014 New Revision: 266209 URL: http://svnweb.freebsd.org/changeset/base/266209 Log: Add a command line argument (-l) to end event collection after some number of seconds. The number of seconds may be a fraction. Submitted by: Julien Charbon MFC after: 2 weeks Relnotes: yes Modified: head/usr.sbin/pmcstat/pmcstat.8 head/usr.sbin/pmcstat/pmcstat.c head/usr.sbin/pmcstat/pmcstat.h Modified: head/usr.sbin/pmcstat/pmcstat.8 ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.8 Fri May 16 03:05:53 2014 (r266208) +++ head/usr.sbin/pmcstat/pmcstat.8 Fri May 16 03:18:09 2014 (r266209) @@ -52,6 +52,7 @@ .Op Fl f Ar pluginopt .Op Fl g .Op Fl k Ar kerneldir +.Op Fl l Ar secs .Op Fl m Ar pathname .Op Fl n Ar rate .Op Fl o Ar outputfile @@ -274,6 +275,13 @@ This directory specifies where should look for the kernel and its modules. The default is .Pa /boot/kernel . +.It Fl l Ar secs +Set system-wide performance measurement duration for +.Ar secs +seconds. +The argument +.Ar secs +may be a fractional value. .It Fl m Ar pathname Print the sampled PCs with the name, the start and ending addresses of the function within they live. Modified: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Fri May 16 03:05:53 2014 (r266208) +++ head/usr.sbin/pmcstat/pmcstat.c Fri May 16 03:18:09 2014 (r266209) @@ -509,6 +509,7 @@ pmcstat_show_usage(void) "\t -f spec\t pass \"spec\" to as plugin option\n" "\t -g\t\t produce gprof(1) compatible profiles\n" "\t -k dir\t\t set the path to the kernel\n" + "\t -l secs\t set duration time\n" "\t -m file\t print sampled PCs to \"file\"\n" "\t -n rate\t set sampling rate\n" "\t -o file\t send print output to \"file\"\n" @@ -551,6 +552,7 @@ main(int argc, char **argv) { cpuset_t cpumask; double interval; + double duration; int hcpu, option, npmc, ncpu; int c, check_driver_stats, current_sampling_count; int do_callchain, do_descendants, do_logproccsw, do_logprocexit; @@ -600,6 +602,7 @@ main(int argc, char **argv) args.pa_toptty = 0; args.pa_topcolor = 0; args.pa_mergepmc = 0; + args.pa_duration = 0.0; STAILQ_INIT(&args.pa_events); SLIST_INIT(&args.pa_targets); bzero(&ds_start, sizeof(ds_start)); @@ -618,7 +621,7 @@ main(int argc, char **argv) CPU_SET(hcpu, &cpumask); while ((option = getopt(argc, argv, - "CD:EF:G:M:NO:P:R:S:TWa:c:df:gk:m:n:o:p:qr:s:t:vw:z:")) != -1) + "CD:EF:G:M:NO:P:R:S:TWa:c:df:gk:l:m:n:o:p:qr:s:t:vw:z:")) != -1) switch (option) { case 'a': /* Annotate + callgraph */ args.pa_flags |= FLAG_DO_ANNOTATE; @@ -692,6 +695,15 @@ main(int argc, char **argv) args.pa_flags |= FLAG_HAS_KERNELPATH; break; + case 'l': /* time duration in seconds */ + duration = strtod(optarg, &end); + if (*end != '\0' || duration <= 0) + errx(EX_USAGE, "ERROR: Illegal duration time " + "value \"%s\".", optarg); + args.pa_flags |= FLAG_HAS_DURATION; + args.pa_duration = duration; + break; + case 'm': args.pa_flags |= FLAG_DO_ANNOTATE; args.pa_plugin = PMCSTAT_PL_ANNOTATE; @@ -922,6 +934,12 @@ main(int argc, char **argv) errx(EX_USAGE, "ERROR: options -O and -R are mutually exclusive."); + /* disallow -T and -l together */ + if ((args.pa_flags & FLAG_HAS_DURATION) && + (args.pa_flags & FLAG_DO_TOP)) + errx(EX_USAGE, "ERROR: options -T and -l are mutually " + "exclusive."); + /* -m option is allowed with -R only. */ if (args.pa_flags & FLAG_DO_ANNOTATE && args.pa_inputpath == NULL) errx(EX_USAGE, "ERROR: option %s requires an input file", @@ -1279,6 +1297,20 @@ main(int argc, char **argv) "ERROR: Cannot register kevent for timer"); } + /* + * Setup a duration timer if we have sampling mode PMCs and + * a duration time is set + */ + if ((args.pa_flags & FLAG_HAS_SAMPLING_PMCS) && + (args.pa_flags & FLAG_HAS_DURATION)) { + EV_SET(&kev, 0, EVFILT_TIMER, EV_ADD, 0, + args.pa_duration * 1000, NULL); + + if (kevent(pmcstat_kq, &kev, 1, NULL, 0, NULL) < 0) + err(EX_OSERR, "ERROR: Cannot register kevent for " + "time duration"); + } + /* attach PMCs to the target process, starting it if specified */ if (args.pa_flags & FLAG_HAS_COMMANDLINE) pmcstat_create_process(); @@ -1355,7 +1387,7 @@ main(int argc, char **argv) /* * loop till either the target process (if any) exits, or we - * are killed by a SIGINT. + * are killed by a SIGINT or we reached the time duration. */ runstate = PMCSTAT_RUNNING; do_print = do_read = 0; @@ -1422,7 +1454,13 @@ main(int argc, char **argv) break; - case EVFILT_TIMER: /* print out counting PMCs */ + case EVFILT_TIMER: + /* time duration reached, exit */ + if (args.pa_flags & FLAG_HAS_DURATION) { + runstate = PMCSTAT_FINISHED; + break; + } + /* print out counting PMCs */ if ((args.pa_flags & FLAG_DO_TOP) && pmc_flush_logfile() == 0) do_read = 1; Modified: head/usr.sbin/pmcstat/pmcstat.h ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.h Fri May 16 03:05:53 2014 (r266208) +++ head/usr.sbin/pmcstat/pmcstat.h Fri May 16 03:18:09 2014 (r266209) @@ -54,6 +54,7 @@ #define FLAG_DO_TOP 0x00010000 /* -T */ #define FLAG_DO_ANALYSIS 0x00020000 /* -g or -G or -m or -T */ #define FLAGS_HAS_CPUMASK 0x00040000 /* -c */ +#define FLAG_HAS_DURATION 0x00080000 /* -l secs */ #define DEFAULT_SAMPLE_COUNT 65536 #define DEFAULT_WAIT_INTERVAL 5.0 @@ -149,6 +150,7 @@ struct pmcstat_args { int pa_toptty; /* output to tty or file */ int pa_topcolor; /* terminal support color */ int pa_mergepmc; /* merge PMC with same name */ + double pa_duration; /* time duration */ int pa_argc; char **pa_argv; STAILQ_HEAD(, pmcstat_ev) pa_events; From owner-svn-src-head@FreeBSD.ORG Fri May 16 10:30:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74AE2647; Fri, 16 May 2014 10:30:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EC892FC4; Fri, 16 May 2014 10:30:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4GAUV9K062013; Fri, 16 May 2014 10:30:31 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GAUUCE062010; Fri, 16 May 2014 10:30:30 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405161030.s4GAUUCE062010@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 16 May 2014 10:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266214 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 10:30:31 -0000 Author: hselasky Date: Fri May 16 10:30:30 2014 New Revision: 266214 URL: http://svnweb.freebsd.org/changeset/base/266214 Log: - Correct some programming details for the SAF1761 driver. - Add some more register details. Sponsored by: DARPA, AFRL Modified: head/sys/dev/usb/controller/saf1761_dci.c head/sys/dev/usb/controller/saf1761_dci.h head/sys/dev/usb/controller/saf1761_dci_reg.h Modified: head/sys/dev/usb/controller/saf1761_dci.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_dci.c Fri May 16 05:11:15 2014 (r266213) +++ head/sys/dev/usb/controller/saf1761_dci.c Fri May 16 10:30:30 2014 (r266214) @@ -163,8 +163,6 @@ saf1761_dci_pull_up(struct saf1761_dci_s DPRINTF("\n"); sc->sc_flags.d_pulled_up = 1; - - SAF1761_WRITE_2(sc, SOTG_CTRL_SET, SOTG_CTRL_DP_PULL_UP); } } @@ -177,8 +175,6 @@ saf1761_dci_pull_down(struct saf1761_dci DPRINTF("\n"); sc->sc_flags.d_pulled_up = 0; - - SAF1761_WRITE_2(sc, SOTG_CTRL_CLR, SOTG_CTRL_DP_PULL_UP); } } @@ -212,13 +208,15 @@ saf1761_dci_set_address(struct saf1761_d static void saf1761_read_fifo(struct saf1761_dci_softc *sc, void *buf, uint32_t len) { - bus_space_read_multi_1((sc)->sc_io_tag, (sc)->sc_io_hdl, SOTG_DATA_PORT, buf, len); + bus_space_read_multi_1((sc)->sc_io_tag, (sc)->sc_io_hdl, + SOTG_DATA_PORT, buf, len); } static void saf1761_write_fifo(struct saf1761_dci_softc *sc, void *buf, uint32_t len) { - bus_space_write_multi_1((sc)->sc_io_tag, (sc)->sc_io_hdl, SOTG_DATA_PORT, buf, len); + bus_space_write_multi_1((sc)->sc_io_tag, (sc)->sc_io_hdl, + SOTG_DATA_PORT, buf, len); } static uint8_t @@ -270,6 +268,7 @@ saf1761_dci_setup_rx(struct saf1761_dci_ if ((req.bmRequestType == UT_WRITE_DEVICE) && (req.bRequest == UR_SET_ADDRESS)) { sc->sc_dv_addr = req.wValue[0] & 0x7F; + DPRINTF("Set address %d\n", sc->sc_dv_addr); } else { sc->sc_dv_addr = 0xFF; } @@ -563,10 +562,16 @@ saf1761_dci_wait_suspend(struct saf1761_ static void saf1761_dci_update_vbus(struct saf1761_dci_softc *sc) { - if (SAF1761_READ_4(sc, SOTG_MODE) & SOTG_MODE_VBUSSTAT) { - DPRINTFN(4, "VBUS ON\n"); + uint16_t status; + + /* read fresh status */ + status = SAF1761_READ_2(sc, SOTG_STATUS); - /* VBUS present */ + DPRINTFN(4, "STATUS=0x%04x\n", status); + + if ((status & SOTG_STATUS_VBUS_VLD) && + (status & SOTG_STATUS_ID)) { + /* VBUS present and device mode */ if (!sc->sc_flags.status_vbus) { sc->sc_flags.status_vbus = 1; @@ -574,9 +579,7 @@ saf1761_dci_update_vbus(struct saf1761_d saf1761_dci_root_intr(sc); } } else { - DPRINTFN(4, "VBUS OFF\n"); - - /* VBUS not-present */ + /* VBUS not-present or host mode */ if (sc->sc_flags.status_vbus) { sc->sc_flags.status_vbus = 0; sc->sc_flags.status_bus_reset = 0; @@ -602,11 +605,23 @@ saf1761_dci_interrupt(struct saf1761_dci /* acknowledge all interrupts */ SAF1761_WRITE_4(sc, SOTG_DCINTERRUPT, status); + DPRINTF("DCINTERRUPT=0x%08x SOF=0x%04x\n", status, + SAF1761_READ_2(sc, SOTG_FRAME_NUM)); + + /* update VBUS and ID bits, if any */ if (status & SOTG_DCINTERRUPT_IEVBUS) { - /* update VBUS bit */ saf1761_dci_update_vbus(sc); } + if (status & SOTG_DCINTERRUPT_IEBRST) { + /* unlock device */ + SAF1761_WRITE_2(sc, SOTG_UNLOCK_DEVICE, + SOTG_UNLOCK_DEVICE_CODE); + + /* Enable device address */ + SAF1761_WRITE_1(sc, SOTG_ADDRESS, + SOTG_ADDRESS_ENABLE); + sc->sc_flags.status_bus_reset = 1; sc->sc_flags.status_suspend = 0; sc->sc_flags.change_suspend = 0; @@ -623,6 +638,10 @@ saf1761_dci_interrupt(struct saf1761_dci * at least 3 milliseconds of inactivity on the USB BUS: */ if (status & SOTG_DCINTERRUPT_IERESM) { + /* unlock device */ + SAF1761_WRITE_2(sc, SOTG_UNLOCK_DEVICE, + SOTG_UNLOCK_DEVICE_CODE); + if (sc->sc_flags.status_suspend) { sc->sc_flags.status_suspend = 0; sc->sc_flags.change_suspend = 1; @@ -833,7 +852,7 @@ saf1761_dci_intr_set(struct usb_xfer *xf uint8_t ep_no = (xfer->endpointno & UE_ADDR); uint32_t mask; - DPRINTFN(15, "endpoint 0x%02x\n", xfer->endpointno); + DPRINTFN(15, "endpoint=%d set=%d\n", xfer->endpointno, set); if (ep_no == 0) { mask = SOTG_DCINTERRUPT_IEPRX(0) | @@ -1121,7 +1140,7 @@ saf1761_dci_init(struct saf1761_dci_soft const struct usb_hw_ep_profile *pf; uint8_t x; - DPRINTF("start\n"); + DPRINTF("\n"); /* set up the bus structure */ sc->sc_bus.usbrev = USB_REV_2_0; @@ -1129,6 +1148,19 @@ saf1761_dci_init(struct saf1761_dci_soft USB_BUS_LOCK(&sc->sc_bus); + /* Enable interrupts */ + sc->sc_hw_mode |= SOTG_HW_MODE_CTRL_GLOBAL_INTR_EN | + SOTG_HW_MODE_CTRL_COMN_INT; + + /* + * Set correct hardware mode, must be written twice if bus + * width is changed: + */ + SAF1761_WRITE_2(sc, SOTG_HW_MODE_CTRL, sc->sc_hw_mode); + SAF1761_WRITE_4(sc, SOTG_HW_MODE_CTRL, sc->sc_hw_mode); + + DPRINTF("DCID=0x%08x\n", SAF1761_READ_4(sc, SOTG_DCCHIP_ID)); + /* reset device */ SAF1761_WRITE_2(sc, SOTG_MODE, SOTG_MODE_SFRESET); SAF1761_WRITE_2(sc, SOTG_MODE, 0); @@ -1142,7 +1174,7 @@ saf1761_dci_init(struct saf1761_dci_soft /* wait 10ms for pulldown to stabilise */ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100); - for (x = 0;; x++) { + for (x = 1;; x++) { saf1761_dci_get_hw_ep_profile(NULL, &pf, x); if (pf == NULL) @@ -1156,10 +1188,6 @@ saf1761_dci_init(struct saf1761_dci_soft /* select the maximum packet size */ SAF1761_WRITE_2(sc, SOTG_EP_MAXPACKET, pf->max_in_frame_size); - if (x == 0) { - /* enable control endpoint */ - SAF1761_WRITE_2(sc, SOTG_EP_TYPE, SOTG_EP_TYPE_ENABLE); - } /* select the correct endpoint */ SAF1761_WRITE_1(sc, SOTG_EP_INDEX, (x << SOTG_EP_INDEX_ENDP_INDEX_SHIFT) | @@ -1167,20 +1195,35 @@ saf1761_dci_init(struct saf1761_dci_soft /* select the maximum packet size */ SAF1761_WRITE_2(sc, SOTG_EP_MAXPACKET, pf->max_out_frame_size); - - if (x == 0) { - /* enable control endpoint */ - SAF1761_WRITE_2(sc, SOTG_EP_TYPE, SOTG_EP_TYPE_ENABLE); - } } /* enable interrupts */ - SAF1761_WRITE_2(sc, SOTG_MODE, SOTG_MODE_GLINTENA); + SAF1761_WRITE_2(sc, SOTG_MODE, SOTG_MODE_GLINTENA | + SOTG_MODE_CLKAON | SOTG_MODE_WKUPCS); + + /* set default values */ + SAF1761_WRITE_1(sc, SOTG_INTERRUPT_CFG, + SOTG_INTERRUPT_CFG_CDBGMOD | + SOTG_INTERRUPT_CFG_DDBGMODIN | + SOTG_INTERRUPT_CFG_DDBGMODOUT); + + /* enable VBUS and ID interrupt */ + SAF1761_WRITE_2(sc, SOTG_IRQ_ENABLE_CLR, 0xFFFF); + SAF1761_WRITE_2(sc, SOTG_IRQ_ENABLE_SET, + SOTG_IRQ_ID | SOTG_IRQ_VBUS_VLD); /* enable interrupts */ - sc->sc_intr_enable = SOTG_DCINTERRUPT_EN, SOTG_DCINTERRUPT_IEVBUS | + sc->sc_intr_enable = SOTG_DCINTERRUPT_IEVBUS | SOTG_DCINTERRUPT_IEBRST | SOTG_DCINTERRUPT_IESUSP; - SAF1761_WRITE_2(sc, SOTG_DCINTERRUPT_EN, sc->sc_intr_enable); + SAF1761_WRITE_4(sc, SOTG_DCINTERRUPT_EN, sc->sc_intr_enable); + + /* connect ATX port 1 to device controller */ + SAF1761_WRITE_2(sc, SOTG_CTRL_CLR, 0xFFFF); + SAF1761_WRITE_2(sc, SOTG_CTRL_SET, SOTG_CTRL_SW_SEL_HC_DC | + SOTG_CTRL_BDIS_ACON_EN); + + /* disable device address */ + SAF1761_WRITE_1(sc, SOTG_ADDRESS, 0); /* poll initial VBUS status */ saf1761_dci_update_vbus(sc); Modified: head/sys/dev/usb/controller/saf1761_dci.h ============================================================================== --- head/sys/dev/usb/controller/saf1761_dci.h Fri May 16 05:11:15 2014 (r266213) +++ head/sys/dev/usb/controller/saf1761_dci.h Fri May 16 10:30:30 2014 (r266214) @@ -107,7 +107,6 @@ struct saf1761_dci_flags { uint8_t port_powered:1; uint8_t port_enabled:1; uint8_t d_pulled_up:1; - uint8_t mcsr_feat:1; }; struct saf1761_dci_softc { @@ -123,6 +122,7 @@ struct saf1761_dci_softc { bus_space_handle_t sc_io_hdl; uint32_t sc_intr_enable; /* enabled interrupts */ + uint32_t sc_hw_mode; /* hardware mode */ uint8_t sc_rt_addr; /* root HUB address */ uint8_t sc_dv_addr; /* device address */ Modified: head/sys/dev/usb/controller/saf1761_dci_reg.h ============================================================================== --- head/sys/dev/usb/controller/saf1761_dci_reg.h Fri May 16 05:11:15 2014 (r266213) +++ head/sys/dev/usb/controller/saf1761_dci_reg.h Fri May 16 10:30:30 2014 (r266214) @@ -102,6 +102,17 @@ #define SOTG_DEBUG_SET (1 << 0) #define SOTG_DCINTERRUPT_EN 0x214 #define SOTG_HW_MODE_CTRL 0x300 +#define SOTG_HW_MODE_CTRL_ALL_ATX_RESET (1 << 31) +#define SOTG_HW_MODE_CTRL_ANA_DIGI_OC (1 << 15) +#define SOTG_HW_MODE_CTRL_DEV_DMA (1 << 11) +#define SOTG_HW_MODE_CTRL_COMN_INT (1 << 10) +#define SOTG_HW_MODE_CTRL_COMN_DMA (1 << 9) +#define SOTG_HW_MODE_CTRL_DATA_BUS_WIDTH (1 << 8) +#define SOTG_HW_MODE_CTRL_DACK_POL (1 << 6) +#define SOTG_HW_MODE_CTRL_DREQ_POL (1 << 5) +#define SOTG_HW_MODE_CTRL_INTR_POL (1 << 2) +#define SOTG_HW_MODE_CTRL_INTR_LEVEL (1 << 1) +#define SOTG_HW_MODE_CTRL_GLOBAL_INTR_EN (1 << 0) #define SOTG_OTG_CTRL 0x374 #define SOTG_EP_INDEX 0x22c #define SOTG_EP_INDEX_EP0SETUP (1 << 5) @@ -155,5 +166,29 @@ #define SOTG_UNLOCK_DEVICE_CODE 0xAA37 #define SOTG_IRQ_PULSE_WIDTH 0x280 #define SOTG_TEST_MODE 0x284 +#define SOTG_TEST_MODE_FORCEHS (1 << 7) +#define SOTG_TEST_MODE_FORCEFS (1 << 4) +#define SOTG_TEST_MODE_PRBS (1 << 3) +#define SOTG_TEST_MODE_KSTATE (1 << 2) +#define SOTG_TEST_MODE_JSTATE (1 << 1) +#define SOTG_TEST_MODE_SE0_NAK (1 << 0) + +/* Host controller specific registers */ + +#define SOTG_CONFIGFLAG 0x0060 +#define SOTG_CONFIGFLAG_ENABLE (1 << 0) +#define SOTG_PORTSC1 0x0064 +#define SOTG_PORTSC1_PO (1 << 13) +#define SOTG_PORTSC1_PP (1 << 12) +#define SOTG_PORTSC1_PR (1 << 8) +#define SOTG_PORTSC1_SUSP (1 << 7) +#define SOTG_PORTSC1_FPR (1 << 6) +#define SOTG_PORTSC1_PED (1 << 2) +#define SOTG_PORTSC1_ECSC (1 << 1) +#define SOTG_PORTSC1_ECCS (1 << 0) +#define SOTG_ASYNC_PDT(x) (0x400 + (60 * 1024) + ((x) * 32)) +#define SOTG_INTR_PDT(x) (0x400 + (61 * 1024) + ((x) * 32)) +#define SOTG_ISOC_PDT(x) (0x400 + (62 * 1024) + ((x) * 32)) +#define SOTG_HC_MEMORY_ADDR(x) (((x) - 0x400) >> 3) #endif /* _SAF1761_DCI_REG_H_ */ From owner-svn-src-head@FreeBSD.ORG Fri May 16 10:35:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79BF97EB; Fri, 16 May 2014 10:35:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B8B32058; Fri, 16 May 2014 10:35:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4GAZMnZ064792; Fri, 16 May 2014 10:35:22 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GAZMBh064791; Fri, 16 May 2014 10:35:22 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405161035.s4GAZMBh064791@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 16 May 2014 10:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266215 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 10:35:22 -0000 Author: hselasky Date: Fri May 16 10:35:21 2014 New Revision: 266215 URL: http://svnweb.freebsd.org/changeset/base/266215 Log: - Add flattended device tree probe-, attach- and detach code for the SAF1761 driver, compatible to existing Linux based FDT tables for the same hardware. Sponsored by: DARPA, AFRL Modified: head/sys/dev/usb/controller/saf1761_dci_fdt.c Modified: head/sys/dev/usb/controller/saf1761_dci_fdt.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_dci_fdt.c Fri May 16 10:30:30 2014 (r266214) +++ head/sys/dev/usb/controller/saf1761_dci_fdt.c Fri May 16 10:35:21 2014 (r266215) @@ -50,6 +50,13 @@ #include #include #include +#include + +#include + +#include +#include +#include #include #include @@ -68,3 +75,179 @@ #include #include + +static device_probe_t saf1761_dci_fdt_probe; +static device_attach_t saf1761_dci_fdt_attach; +static device_detach_t saf1761_dci_fdt_detach; + +static device_method_t saf1761_dci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, saf1761_dci_fdt_probe), + DEVMETHOD(device_attach, saf1761_dci_fdt_attach), + DEVMETHOD(device_detach, saf1761_dci_fdt_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + DEVMETHOD_END +}; + +static driver_t saf1761_dci_driver = { + .name = "saf1761", + .methods = saf1761_dci_methods, + .size = sizeof(struct saf1761_dci_softc), +}; + +static devclass_t saf1761_dci_devclass; + +DRIVER_MODULE(saf1761, simplebus, saf1761_dci_driver, saf1761_dci_devclass, 0, 0); +MODULE_DEPEND(saf1761, usb, 1, 1, 1); + +static int +saf1761_dci_fdt_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "nxp,usb-isp1761")) + return (ENXIO); + + device_set_desc(dev, "ISP1761/SAF1761 DCI USB 2.0 Device Controller"); + + return (0); +} + +static int +saf1761_dci_fdt_attach(device_t dev) +{ + struct saf1761_dci_softc *sc = device_get_softc(dev); + char param[24]; + int err; + int rid; + + /* get configuration from FDT */ + + /* get bus-width, if any */ + if (OF_getprop(ofw_bus_get_node(dev), "bus-width", + ¶m, sizeof(param)) > 0) { + param[sizeof(param) - 1] = 0; + if (strcmp(param, "32") == 0) + sc->sc_hw_mode |= SOTG_HW_MODE_CTRL_DATA_BUS_WIDTH; + } else { + /* assume 32-bit data bus */ + sc->sc_hw_mode |= SOTG_HW_MODE_CTRL_DATA_BUS_WIDTH; + } + + /* get analog over-current setting */ + if (OF_getprop(ofw_bus_get_node(dev), "analog-oc", + ¶m, sizeof(param)) > 0) { + sc->sc_hw_mode |= SOTG_HW_MODE_CTRL_ANA_DIGI_OC; + } + + /* get DACK polarity */ + if (OF_getprop(ofw_bus_get_node(dev), "dack-polarity", + ¶m, sizeof(param)) > 0) { + sc->sc_hw_mode |= SOTG_HW_MODE_CTRL_DACK_POL; + } + + /* get DREQ polarity */ + if (OF_getprop(ofw_bus_get_node(dev), "dreq-polarity", + ¶m, sizeof(param)) > 0) { + sc->sc_hw_mode |= SOTG_HW_MODE_CTRL_DREQ_POL; + } + + /* initialise some bus fields */ + sc->sc_bus.parent = dev; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = SOTG_MAX_DEVICES; + + /* get all DMA memory */ + if (usb_bus_mem_alloc_all(&sc->sc_bus, + USB_GET_DMA_TAG(dev), NULL)) { + return (ENOMEM); + } + rid = 0; + sc->sc_io_res = + bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); + + if (!sc->sc_io_res) { + goto error; + } + sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); + sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); + sc->sc_io_size = rman_get_size(sc->sc_io_res); + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); + if (sc->sc_irq_res == NULL) { + goto error; + } + sc->sc_bus.bdev = device_add_child(dev, "usbus", -1); + if (!(sc->sc_bus.bdev)) { + goto error; + } + device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); + + err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)saf1761_dci_interrupt, sc, &sc->sc_intr_hdl); + if (err) { + sc->sc_intr_hdl = NULL; + goto error; + } + err = saf1761_dci_init(sc); + if (err) { + device_printf(dev, "Init failed\n"); + goto error; + } + err = device_probe_and_attach(sc->sc_bus.bdev); + if (err) { + device_printf(dev, "USB probe and attach failed\n"); + goto error; + } + return (0); + +error: + saf1761_dci_fdt_detach(dev); + return (ENXIO); +} + +static int +saf1761_dci_fdt_detach(device_t dev) +{ + struct saf1761_dci_softc *sc = device_get_softc(dev); + device_t bdev; + int err; + + if (sc->sc_bus.bdev) { + bdev = sc->sc_bus.bdev; + device_detach(bdev); + device_delete_child(dev, bdev); + } + /* during module unload there are lots of children leftover */ + device_delete_children(dev); + + if (sc->sc_irq_res && sc->sc_intr_hdl) { + /* + * Only call uninit() after init() + */ + saf1761_dci_uninit(sc); + + err = bus_teardown_intr(dev, sc->sc_irq_res, + sc->sc_intr_hdl); + sc->sc_intr_hdl = NULL; + } + if (sc->sc_irq_res) { + bus_release_resource(dev, SYS_RES_IRQ, 0, + sc->sc_irq_res); + sc->sc_irq_res = NULL; + } + if (sc->sc_io_res) { + bus_release_resource(dev, SYS_RES_IOPORT, 0, + sc->sc_io_res); + sc->sc_io_res = NULL; + } + usb_bus_mem_free_all(&sc->sc_bus, NULL); + + return (0); +} From owner-svn-src-head@FreeBSD.ORG Fri May 16 10:37:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59A62A39; Fri, 16 May 2014 10:37:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46E9B2092; Fri, 16 May 2014 10:37:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4GAbQvl065135; Fri, 16 May 2014 10:37:26 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GAbQ0p065134; Fri, 16 May 2014 10:37:26 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405161037.s4GAbQ0p065134@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 16 May 2014 10:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266216 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 10:37:26 -0000 Author: hselasky Date: Fri May 16 10:37:25 2014 New Revision: 266216 URL: http://svnweb.freebsd.org/changeset/base/266216 Log: - Allow the SAF1761 driver to attach to the root HUB USB driver. Sponsored by: DARPA, AFRL Modified: head/sys/dev/usb/controller/usb_controller.c Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Fri May 16 10:35:21 2014 (r266215) +++ head/sys/dev/usb/controller/usb_controller.c Fri May 16 10:37:25 2014 (r266216) @@ -138,6 +138,7 @@ DRIVER_MODULE(usbus, octusb, usb_driver, /* Dual Mode Drivers */ DRIVER_MODULE(usbus, dwcotg, usb_driver, usb_devclass, 0, 0); +DRIVER_MODULE(usbus, saf1761, usb_driver, usb_devclass, 0, 0); /*------------------------------------------------------------------------* * usb_probe From owner-svn-src-head@FreeBSD.ORG Fri May 16 14:27:47 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7066D307; Fri, 16 May 2014 14:27:47 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D27A4249D; Fri, 16 May 2014 14:27:45 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s4GERgmQ000894 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 16 May 2014 18:27:42 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s4GERgiR000893; Fri, 16 May 2014 18:27:42 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 16 May 2014 18:27:42 +0400 From: Gleb Smirnoff To: Don Lewis Subject: Re: svn commit: r265408 - in head: sys/netinet usr.bin/netstat Message-ID: <20140516142742.GJ50679@FreeBSD.org> References: <201405060000.s46007s6044383@svn.freebsd.org> <201405142016.s4EKGfOb084324@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201405142016.s4EKGfOb084324@gw.catspoiler.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 14:27:47 -0000 On Wed, May 14, 2014 at 01:16:41PM -0700, Don Lewis wrote: D> On 6 May, Gleb Smirnoff wrote: D> > Author: glebius D> > Date: Tue May 6 00:00:07 2014 D> > New Revision: 265408 D> > URL: http://svnweb.freebsd.org/changeset/base/265408 D> > D> > Log: D> > - Remove net.inet.tcp.reass.overflows sysctl. It counts exactly D> > same events that tcpstat's tcps_rcvmemdrop counter counts. D> > - Rename tcps_rcvmemdrop to tcps_rcvreassfull and improve its D> > description in netstat(1) output. D> > D> > Sponsored by: Netflix D> > Sponsored by: Nginx, Inc. D> > D> > Modified: D> > head/sys/netinet/tcp_reass.c D> > head/sys/netinet/tcp_var.h D> > head/usr.bin/netstat/inet.c D> > D> D> D> > Modified: head/sys/netinet/tcp_var.h D> > ============================================================================== D> > --- head/sys/netinet/tcp_var.h Mon May 5 23:54:13 2014 (r265407) D> > +++ head/sys/netinet/tcp_var.h Tue May 6 00:00:07 2014 (r265408) D> > @@ -426,7 +426,7 @@ struct tcpstat { D> > uint64_t tcps_rcvbyte; /* bytes received in sequence */ D> > uint64_t tcps_rcvbadsum; /* packets received with ccksum errs */ D> > uint64_t tcps_rcvbadoff; /* packets received with bad offset */ D> > - uint64_t tcps_rcvmemdrop; /* packets dropped for lack of memory */ D> > + uint64_t tcps_rcvreassfull; /* packets dropped for no reass space */ D> > uint64_t tcps_rcvshort; /* packets received too short */ D> > uint64_t tcps_rcvduppack; /* duplicate-only packets received */ D> > uint64_t tcps_rcvdupbyte; /* duplicate-only bytes received */ D> D> This broke emulators/wine: D> D> cc -c -I. -I. -I../../include -I../../include -D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Wstrict-prototypes -Wtype-limits -Wwrite-strings -Wpointer-arith -fno-omit-frame-pointer -I/usr/local/include -O2 -pipe -march=athlon64 -fno-strict-aliasing -o ipstats.o ipstats.c D> ipstats.c:1109:92: error: no member named 'tcps_rcvmemdrop' in 'struct tcpstat'; D> did you mean 'tcps_listendrop'? D> ...+ tcp_stat.tcps_rcvbadoff + tcp_stat.tcps_rcvmemdrop + D> tcp_stat.tcps_rcv... D> ^~~~~~~~~~~~~~~ D> D> I think this needs a __FreeBSD_version 1100020 and/or the addition D> of a #define as a compatiblity crutch. I will add a #define as soon as I get proper Internet connection. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri May 16 14:48:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 862FA4CB; Fri, 16 May 2014 14:48:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7416426C4; Fri, 16 May 2014 14:48:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4GEmMm6078874; Fri, 16 May 2014 14:48:22 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GEmM3s078873; Fri, 16 May 2014 14:48:22 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201405161448.s4GEmM3s078873@svn.freebsd.org> From: Hiroki Sato Date: Fri, 16 May 2014 14:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266225 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 14:48:22 -0000 Author: hrs Date: Fri May 16 14:48:21 2014 New Revision: 266225 URL: http://svnweb.freebsd.org/changeset/base/266225 Log: Move configuration of IPv6 NDP flags to a point before handling ifconfig_IF. This fixes a race that a non-IPv4 interface can get an EUI64 LLA even if it has IFDISABLED nd6 flag at boot time. Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Fri May 16 14:47:18 2014 (r266224) +++ head/etc/network.subr Fri May 16 14:48:21 2014 (r266225) @@ -132,13 +132,6 @@ ifconfig_up() _cfg=0 fi - # ifconfig_IF - ifconfig_args=`ifconfig_getargs $1` - if [ -n "${ifconfig_args}" ]; then - eval ${IFCONFIG_CMD} $1 ${ifconfig_args} - _cfg=0 - fi - # inet6 specific if ! noafif $1 && afexists inet6; then if checkyesno ipv6_activate_all_interfaces; then @@ -174,7 +167,17 @@ ifconfig_up() if [ -n "${_ipv6_opts}" ]; then ${IFCONFIG_CMD} $1 inet6 ${_ipv6_opts} fi + fi + # ifconfig_IF + ifconfig_args=`ifconfig_getargs $1` + if [ -n "${ifconfig_args}" ]; then + eval ${IFCONFIG_CMD} $1 ${ifconfig_args} + _cfg=0 + fi + + # inet6 specific + if ! noafif $1 && afexists inet6; then # ifconfig_IF_ipv6 ifconfig_args=`ifconfig_getargs $1 ipv6` if [ -n "${ifconfig_args}" ]; then From owner-svn-src-head@FreeBSD.ORG Fri May 16 15:32:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D552DB3; Fri, 16 May 2014 15:32:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 510102B59; Fri, 16 May 2014 15:32:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4GFWHbg006506; Fri, 16 May 2014 15:32:17 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GFWGvh006504; Fri, 16 May 2014 15:32:16 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201405161532.s4GFWGvh006504@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 16 May 2014 15:32:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266238 - head/contrib/ldns/ldns X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 15:32:17 -0000 Author: des Date: Fri May 16 15:32:16 2014 New Revision: 266238 URL: http://svnweb.freebsd.org/changeset/base/266238 Log: Don't cast away the const qualifier. Fixes gcc build. Modified: head/contrib/ldns/ldns/util.h head/contrib/ldns/ldns/util.h.in Modified: head/contrib/ldns/ldns/util.h ============================================================================== --- head/contrib/ldns/ldns/util.h Fri May 16 15:02:12 2014 (r266237) +++ head/contrib/ldns/ldns/util.h Fri May 16 15:32:16 2014 (r266238) @@ -70,9 +70,9 @@ INLINE uint16_t ldns_read_uint16(const void *src) { #ifdef ALLOW_UNALIGNED_ACCESSES - return ntohs(*(uint16_t *) src); + return ntohs(*(const uint16_t *) src); #else - uint8_t *p = (uint8_t *) src; + const uint8_t *p = (const uint8_t *) src; return ((uint16_t) p[0] << 8) | (uint16_t) p[1]; #endif } @@ -81,9 +81,9 @@ INLINE uint32_t ldns_read_uint32(const void *src) { #ifdef ALLOW_UNALIGNED_ACCESSES - return ntohl(*(uint32_t *) src); + return ntohl(*(const uint32_t *) src); #else - uint8_t *p = (uint8_t *) src; + const uint8_t *p = (const uint8_t *) src; return ( ((uint32_t) p[0] << 24) | ((uint32_t) p[1] << 16) | ((uint32_t) p[2] << 8) Modified: head/contrib/ldns/ldns/util.h.in ============================================================================== --- head/contrib/ldns/ldns/util.h.in Fri May 16 15:02:12 2014 (r266237) +++ head/contrib/ldns/ldns/util.h.in Fri May 16 15:32:16 2014 (r266238) @@ -70,9 +70,9 @@ INLINE uint16_t ldns_read_uint16(const void *src) { #ifdef ALLOW_UNALIGNED_ACCESSES - return ntohs(*(uint16_t *) src); + return ntohs(*(const uint16_t *) src); #else - uint8_t *p = (uint8_t *) src; + const uint8_t *p = (const uint8_t *) src; return ((uint16_t) p[0] << 8) | (uint16_t) p[1]; #endif } @@ -81,9 +81,9 @@ INLINE uint32_t ldns_read_uint32(const void *src) { #ifdef ALLOW_UNALIGNED_ACCESSES - return ntohl(*(uint32_t *) src); + return ntohl(*(const uint32_t *) src); #else - uint8_t *p = (uint8_t *) src; + const uint8_t *p = (const uint8_t *) src; return ( ((uint32_t) p[0] << 24) | ((uint32_t) p[1] << 16) | ((uint32_t) p[2] << 8) From owner-svn-src-head@FreeBSD.ORG Fri May 16 15:41:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 150C430E; Fri, 16 May 2014 15:41:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 015FF2C59; Fri, 16 May 2014 15:41:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4GFft6o009739; Fri, 16 May 2014 15:41:55 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GFfteG009737; Fri, 16 May 2014 15:41:55 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405161541.s4GFfteG009737@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 16 May 2014 15:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266241 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 15:41:56 -0000 Author: hselasky Date: Fri May 16 15:41:55 2014 New Revision: 266241 URL: http://svnweb.freebsd.org/changeset/base/266241 Log: Implement basic support for the USB host controller found in the SAF1761 chip, supporting BULK and CONTROL endpoints. This code is not yet tested. Sponsored by: DARPA, AFRL Modified: head/sys/dev/usb/controller/saf1761_dci.c head/sys/dev/usb/controller/saf1761_dci.h head/sys/dev/usb/controller/saf1761_dci_reg.h Modified: head/sys/dev/usb/controller/saf1761_dci.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_dci.c Fri May 16 15:39:11 2014 (r266240) +++ head/sys/dev/usb/controller/saf1761_dci.c Fri May 16 15:41:55 2014 (r266241) @@ -103,13 +103,20 @@ SYSCTL_INT(_hw_usb_saf1761_dci, OID_AUTO /* prototypes */ static const struct usb_bus_methods saf1761_dci_bus_methods; -static const struct usb_pipe_methods saf1761_dci_device_non_isoc_methods; +static const struct usb_pipe_methods saf1761_otg_non_isoc_methods; static const struct usb_pipe_methods saf1761_dci_device_isoc_methods; -static saf1761_dci_cmd_t saf1761_dci_setup_rx; -static saf1761_dci_cmd_t saf1761_dci_data_rx; -static saf1761_dci_cmd_t saf1761_dci_data_tx; -static saf1761_dci_cmd_t saf1761_dci_data_tx_sync; +static saf1761_dci_cmd_t saf1761_host_setup_tx; +static saf1761_dci_cmd_t saf1761_host_bulk_data_rx; +static saf1761_dci_cmd_t saf1761_host_bulk_data_tx; +static saf1761_dci_cmd_t saf1761_host_intr_data_rx; +static saf1761_dci_cmd_t saf1761_host_intr_data_tx; +static saf1761_dci_cmd_t saf1761_host_isoc_data_rx; +static saf1761_dci_cmd_t saf1761_host_isoc_data_tx; +static saf1761_dci_cmd_t saf1761_device_setup_rx; +static saf1761_dci_cmd_t saf1761_device_data_rx; +static saf1761_dci_cmd_t saf1761_device_data_tx; +static saf1761_dci_cmd_t saf1761_device_data_tx_sync; static void saf1761_dci_device_done(struct usb_xfer *, usb_error_t); static void saf1761_dci_do_poll(struct usb_bus *); static void saf1761_dci_standard_done(struct usb_xfer *); @@ -197,6 +204,357 @@ saf1761_dci_wakeup_peer(struct saf1761_d } +static uint8_t +saf1761_host_channel_alloc(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +{ + uint32_t x; + + if (td->channel < SOTG_HOST_CHANNEL_MAX) + return (0); + + switch (td->ep_type) { + case UE_INTERRUPT: + for (x = 0; x != 32; x++) { + if (sc->sc_host_intr_map & (1 << x)) + continue; + sc->sc_host_intr_map |= (1 << x); + td->channel = 32 + x; + return (0); + } + break; + case UE_ISOCHRONOUS: + for (x = 0; x != 32; x++) { + if (sc->sc_host_isoc_map & (1 << x)) + continue; + sc->sc_host_isoc_map |= (1 << x); + td->channel = 64 + x; + return (0); + } + break; + default: + for (x = 0; x != 32; x++) { + if (sc->sc_host_async_map & (1 << x)) + continue; + sc->sc_host_async_map |= (1 << x); + td->channel = x; + return (0); + } + break; + } + return (1); +} + +static void +saf1761_host_channel_free(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +{ + uint32_t x; + + if (td->channel >= SOTG_HOST_CHANNEL_MAX) + return; + + /* disable channel */ + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 3), 0); + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 0), 0); + + switch (td->ep_type) { + case UE_INTERRUPT: + x = td->channel - 32; + sc->sc_host_intr_map &= ~(1 << x); + td->channel = SOTG_HOST_CHANNEL_MAX; + break; + case UE_ISOCHRONOUS: + x = td->channel - 64; + sc->sc_host_isoc_map &= ~(1 << x); + td->channel = SOTG_HOST_CHANNEL_MAX; + break; + default: + x = td->channel - 64; + sc->sc_host_async_map &= ~(1 << x); + td->channel = SOTG_HOST_CHANNEL_MAX; + break; + } +} + +static void +saf1761_read_host_fifo_1(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td, + void *buf, uint32_t len) +{ + bus_space_read_region_1((sc)->sc_io_tag, (sc)->sc_io_hdl, + SOTG_DATA_ADDR(td->channel), buf, len); +} + +static void +saf1761_write_host_fifo_1(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td, + void *buf, uint32_t len) +{ + bus_space_write_region_1((sc)->sc_io_tag, (sc)->sc_io_hdl, + SOTG_DATA_ADDR(td->channel), buf, len); +} + +static uint8_t +saf1761_host_setup_tx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +{ + struct usb_device_request req __aligned(4); + uint32_t status; + uint32_t count; + + if (td->channel < SOTG_HOST_CHANNEL_MAX) { + status = SAF1761_READ_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 3)); + if (status & (1 << 31)) { + goto busy; + } else if (status & (1 << 30)) { + td->error_stall = 1; + td->error_any = 1; + } else if (status & (3 << 28)) { + td->error_any = 1; + } + count = (status & 0x7FFF); + + saf1761_host_channel_free(sc, td); + goto complete; + } + if (saf1761_host_channel_alloc(sc, td)) + goto busy; + + if (sizeof(req) != td->remainder) { + td->error_any = 1; + goto complete; + } + + count = sizeof(req); + + usbd_copy_out(td->pc, 0, &req, count); + + saf1761_write_host_fifo_1(sc, td, &req, count); + + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 7), 0); + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 6), 0); + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 5), 0); + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 4), 0); + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 3), + (1 << 31) | (td->toggle << 25) | (3 << 23)); + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 2), + SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8); + + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 1), + td->dw1_value | + (2 << 10) /* SETUP PID */ | + (td->ep_index >> 1)); + + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 0), + (td->ep_index << 31) | + (1 << 29) /* pkt-multiplier */ | + (td->max_packet_size << 18) /* wMaxPacketSize */ | + (count << 3) /* transfer count */ | + 1 /* valid */); + + td->offset += count; + td->remainder -= count; + td->toggle = 1; +busy: + return (1); /* busy */ +complete: + return (0); /* complete */ +} + +static uint8_t +saf1761_host_bulk_data_rx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +{ + if (td->channel < SOTG_HOST_CHANNEL_MAX) { + uint32_t status; + uint32_t count; + uint8_t got_short; + + status = SAF1761_READ_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 3)); + + if (status & (1 << 31)) { + goto busy; + } else if (status & (1 << 30)) { + td->error_stall = 1; + td->error_any = 1; + goto complete; + } else if (status & (3 << 28)) { + td->error_any = 1; + goto complete; + } + count = (status & 0x7FFF); + got_short = 0; + + /* verify the packet byte count */ + if (count != td->max_packet_size) { + if (count < td->max_packet_size) { + /* we have a short packet */ + td->short_pkt = 1; + got_short = 1; + } else { + /* invalid USB packet */ + td->error_any = 1; + goto complete; + } + } + td->toggle ^= 1; + + /* verify the packet byte count */ + if (count > td->remainder) { + /* invalid USB packet */ + td->error_any = 1; + goto complete; + } + + saf1761_read_host_fifo_1(sc, td, + sc->sc_bounce_buffer, count); + usbd_copy_in(td->pc, td->offset, + sc->sc_bounce_buffer, count); + + td->remainder -= count; + td->offset += count; + + saf1761_host_channel_free(sc, td); + + /* check if we are complete */ + if ((td->remainder == 0) || got_short) { + if (td->short_pkt) + goto complete; + /* else need to receive a zero length packet */ + } + } + if (saf1761_host_channel_alloc(sc, td)) + goto busy; + + /* set toggle, if any */ + if (td->set_toggle) { + td->set_toggle = 0; + td->toggle = 1; + } + + /* receive one more packet */ + + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 7), 0); + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 6), 0); + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 5), 0); + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 4), 0); + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 3), + (1 << 31) | (td->toggle << 25) | (3 << 23)); + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 2), + SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8); + + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 1), + td->dw1_value | + (1 << 10) /* IN-PID */ | + (td->ep_index >> 1)); + + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 0), + (td->ep_index << 31) | + (1 << 29) /* pkt-multiplier */ | + (td->max_packet_size << 18) /* wMaxPacketSize */ | + (td->max_packet_size << 3) /* transfer count */ | + 1 /* valid */); +busy: + return (1); /* busy */ +complete: + return (0); /* complete */ +} + +static uint8_t +saf1761_host_bulk_data_tx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +{ + uint32_t count; + + if (td->channel < SOTG_HOST_CHANNEL_MAX) { + uint32_t status; + + status = SAF1761_READ_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 3)); + if (status & (1 << 31)) { + goto busy; + } else if (status & (1 << 30)) { + td->error_stall = 1; + td->error_any = 1; + } else if (status & (3 << 28)) { + td->error_any = 1; + } + + saf1761_host_channel_free(sc, td); + + /* check remainder */ + if (td->remainder == 0) { + if (td->short_pkt) + goto complete; + /* else we need to transmit a short packet */ + } + } + if (saf1761_host_channel_alloc(sc, td)) + goto busy; + + count = td->max_packet_size; + if (td->remainder < count) { + /* we have a short packet */ + td->short_pkt = 1; + count = td->remainder; + } + + usbd_copy_out(td->pc, td->offset, sc->sc_bounce_buffer, count); + saf1761_write_host_fifo_1(sc, td, sc->sc_bounce_buffer, count); + + /* set toggle, if any */ + if (td->set_toggle) { + td->set_toggle = 0; + td->toggle = 1; + } + + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 7), 0); + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 6), 0); + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 5), 0); + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 4), 0); + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 3), + (1 << 31) | (td->toggle << 25) | (3 << 23)); + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 2), + SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8); + + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 1), + td->dw1_value | + (0 << 10) /* OUT-PID */ | + (td->ep_index >> 1)); + + SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 0), + (td->ep_index << 31) | + (1 << 29) /* pkt-multiplier */ | + (td->max_packet_size << 18) /* wMaxPacketSize */ | + (count << 3) /* transfer count */ | + 1 /* valid */); + + td->offset += count; + td->remainder -= count; + td->toggle ^= 1; +busy: + return (1); /* busy */ +complete: + return (0); /* complete */ +} + +static uint8_t +saf1761_host_intr_data_rx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +{ + return (1); /* busy */ +} + +static uint8_t +saf1761_host_intr_data_tx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +{ + return (1); /* busy */ +} + +static uint8_t +saf1761_host_isoc_data_rx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +{ + return (1); /* busy */ +} + +static uint8_t +saf1761_host_isoc_data_tx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +{ + return (1); /* busy */ +} + static void saf1761_dci_set_address(struct saf1761_dci_softc *sc, uint8_t addr) { @@ -206,21 +564,21 @@ saf1761_dci_set_address(struct saf1761_d } static void -saf1761_read_fifo(struct saf1761_dci_softc *sc, void *buf, uint32_t len) +saf1761_read_device_fifo_1(struct saf1761_dci_softc *sc, void *buf, uint32_t len) { bus_space_read_multi_1((sc)->sc_io_tag, (sc)->sc_io_hdl, SOTG_DATA_PORT, buf, len); } static void -saf1761_write_fifo(struct saf1761_dci_softc *sc, void *buf, uint32_t len) +saf1761_write_device_fifo_1(struct saf1761_dci_softc *sc, void *buf, uint32_t len) { bus_space_write_multi_1((sc)->sc_io_tag, (sc)->sc_io_hdl, SOTG_DATA_PORT, buf, len); } static uint8_t -saf1761_dci_setup_rx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +saf1761_device_setup_rx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) { struct usb_device_request req; uint16_t count; @@ -256,7 +614,7 @@ saf1761_dci_setup_rx(struct saf1761_dci_ goto busy; } /* receive data */ - saf1761_read_fifo(sc, &req, sizeof(req)); + saf1761_read_device_fifo_1(sc, &req, sizeof(req)); /* copy data into real buffer */ usbd_copy_in(td->pc, 0, &req, sizeof(req)); @@ -288,7 +646,7 @@ busy: } static uint8_t -saf1761_dci_data_rx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +saf1761_device_data_rx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) { struct usb_page_search buf_res; uint16_t count; @@ -314,7 +672,7 @@ saf1761_dci_data_rx(struct saf1761_dci_s /* * USB Host Aborted the transfer. */ - td->error = 1; + td->error_any = 1; return (0); /* complete */ } } @@ -323,6 +681,12 @@ saf1761_dci_data_rx(struct saf1761_dci_s (td->ep_index << SOTG_EP_INDEX_ENDP_INDEX_SHIFT) | SOTG_EP_INDEX_DIR_OUT); + /* enable data stage */ + if (td->set_toggle) { + td->set_toggle = 0; + SAF1761_WRITE_1(sc, SOTG_CTRL_FUNC, SOTG_CTRL_FUNC_DSEN); + } + /* check buffer status */ if ((SAF1761_READ_1(sc, SOTG_DCBUFFERSTATUS) & SOTG_DCBUFFERSTATUS_FILLED_MASK) == 0) { @@ -341,14 +705,14 @@ saf1761_dci_data_rx(struct saf1761_dci_s got_short = 1; } else { /* invalid USB packet */ - td->error = 1; + td->error_any = 1; return (0); /* we are complete */ } } /* verify the packet byte count */ if (count > td->remainder) { /* invalid USB packet */ - td->error = 1; + td->error_any = 1; return (0); /* we are complete */ } while (count > 0) { @@ -359,7 +723,7 @@ saf1761_dci_data_rx(struct saf1761_dci_s buf_res.length = count; /* receive data */ - saf1761_read_fifo(sc, buf_res.buffer, buf_res.length); + saf1761_read_device_fifo_1(sc, buf_res.buffer, buf_res.length); /* update counters */ count -= buf_res.length; @@ -378,7 +742,7 @@ saf1761_dci_data_rx(struct saf1761_dci_s } static uint8_t -saf1761_dci_data_tx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +saf1761_device_data_tx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) { struct usb_page_search buf_res; uint16_t count; @@ -395,7 +759,7 @@ saf1761_dci_data_tx(struct saf1761_dci_s /* * USB Host Aborted the transfer. */ - td->error = 1; + td->error_any = 1; return (0); /* complete */ } } @@ -409,6 +773,13 @@ saf1761_dci_data_tx(struct saf1761_dci_s SOTG_DCBUFFERSTATUS_FILLED_MASK) != 0) { return (1); /* not complete */ } + + /* enable data stage */ + if (td->set_toggle) { + td->set_toggle = 0; + SAF1761_WRITE_1(sc, SOTG_CTRL_FUNC, SOTG_CTRL_FUNC_DSEN); + } + DPRINTFN(5, "rem=%u\n", td->remainder); count = td->max_packet_size; @@ -428,7 +799,7 @@ saf1761_dci_data_tx(struct saf1761_dci_s buf_res.length = count; /* transmit data */ - saf1761_write_fifo(sc, buf_res.buffer, buf_res.length); + saf1761_write_device_fifo_1(sc, buf_res.buffer, buf_res.length); /* update counters */ count -= buf_res.length; @@ -459,7 +830,7 @@ saf1761_dci_data_tx(struct saf1761_dci_s } static uint8_t -saf1761_dci_data_tx_sync(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +saf1761_device_data_tx_sync(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) { if (td->ep_index == 0) { /* select the correct endpoint */ @@ -493,6 +864,7 @@ static uint8_t saf1761_dci_xfer_do_fifo(struct saf1761_dci_softc *sc, struct usb_xfer *xfer) { struct saf1761_dci_td *td; + uint8_t toggle; DPRINTFN(9, "\n"); @@ -505,7 +877,7 @@ saf1761_dci_xfer_do_fifo(struct saf1761_ if (((void *)td) == xfer->td_transfer_last) { goto done; } - if (td->error) { + if (td->error_any) { goto done; } else if (td->remainder > 0) { /* @@ -519,7 +891,9 @@ saf1761_dci_xfer_do_fifo(struct saf1761_ /* * Fetch the next transfer descriptor. */ + toggle = td->toggle; td = td->obj_next; + td->toggle = toggle; xfer->td_transfer_cache = td; } return (1); /* not complete */ @@ -683,10 +1057,13 @@ saf1761_dci_setup_standard_chain_sub(str td->pc = temp->pc; td->offset = temp->offset; td->remainder = temp->len; - td->error = 0; + td->error_any = 0; + td->error_stall = 0; + td->set_toggle = 0; td->did_stall = temp->did_stall; td->short_pkt = temp->short_pkt; td->alt_next = temp->setup_alt_next; + td->channel = SOTG_HOST_CHANNEL_MAX; } static void @@ -697,6 +1074,9 @@ saf1761_dci_setup_standard_chain(struct struct saf1761_dci_td *td; uint32_t x; uint8_t ep_no; + uint8_t ep_type; + uint8_t need_sync; + uint8_t is_host; DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n", xfer->address, UE_GET_ADDR(xfer->endpointno), @@ -717,15 +1097,22 @@ saf1761_dci_setup_standard_chain(struct temp.setup_alt_next = xfer->flags_int.short_frames_ok; temp.did_stall = !xfer->flags_int.control_stall; + is_host = (xfer->xroot->udev->flags.usb_mode == USB_MODE_HOST); + sc = SAF1761_DCI_BUS2SC(xfer->xroot->bus); ep_no = (xfer->endpointno & UE_ADDR); + ep_type = (xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE); /* check if we should prepend a setup message */ if (xfer->flags_int.control_xfr) { if (xfer->flags_int.control_hdr) { - temp.func = &saf1761_dci_setup_rx; + if (is_host) + temp.func = &saf1761_host_setup_tx; + else + temp.func = &saf1761_device_setup_rx; + temp.len = xfer->frlengths[0]; temp.pc = xfer->frbuffers + 0; temp.short_pkt = temp.len ? 1 : 0; @@ -744,14 +1131,39 @@ saf1761_dci_setup_standard_chain(struct if (x != xfer->nframes) { if (xfer->endpointno & UE_DIR_IN) { - temp.func = &saf1761_dci_data_tx; + if (is_host) { + if (ep_type == UE_INTERRUPT) + temp.func = &saf1761_host_intr_data_rx; + else if (ep_type == UE_ISOCHRONOUS) + temp.func = &saf1761_host_isoc_data_rx; + else + temp.func = &saf1761_host_bulk_data_rx; + need_sync = 0; + } else { + temp.func = &saf1761_device_data_tx; + need_sync = 1; + } } else { - temp.func = &saf1761_dci_data_rx; + if (is_host) { + if (ep_type == UE_INTERRUPT) + temp.func = &saf1761_host_intr_data_tx; + else if (ep_type == UE_ISOCHRONOUS) + temp.func = &saf1761_host_isoc_data_tx; + else + temp.func = &saf1761_host_bulk_data_tx; + need_sync = 0; + } else { + temp.func = &saf1761_device_data_rx; + need_sync = 0; + } } /* setup "pc" pointer */ temp.pc = xfer->frbuffers + x; + } else { + need_sync = 0; } + while (x != xfer->nframes) { /* DATA0 / DATA1 message */ @@ -794,8 +1206,6 @@ saf1761_dci_setup_standard_chain(struct /* check for control transfer */ if (xfer->flags_int.control_xfr) { - uint8_t need_sync; - /* always setup a valid "pc" pointer for status and sync */ temp.pc = xfer->frbuffers + 0; temp.len = 0; @@ -810,26 +1220,59 @@ saf1761_dci_setup_standard_chain(struct * endpoint direction. */ if (xfer->endpointno & UE_DIR_IN) { - temp.func = &saf1761_dci_data_rx; - need_sync = 0; + if (is_host) { + temp.func = &saf1761_host_bulk_data_tx; + need_sync = 0; + } else { + temp.func = &saf1761_device_data_rx; + need_sync = 0; + } } else { - temp.func = &saf1761_dci_data_tx; - need_sync = 1; + if (is_host) { + temp.func = &saf1761_host_bulk_data_rx; + need_sync = 0; + } else { + temp.func = &saf1761_device_data_tx; + need_sync = 1; + } } temp.len = 0; temp.short_pkt = 0; saf1761_dci_setup_standard_chain_sub(&temp); + + /* data toggle should be DATA1 */ + td = temp.td; + td->set_toggle = 1; + if (need_sync) { /* we need a SYNC point after TX */ - temp.func = &saf1761_dci_data_tx_sync; + temp.func = &saf1761_device_data_tx_sync; saf1761_dci_setup_standard_chain_sub(&temp); } } + } else { + if (need_sync) { + temp.pc = xfer->frbuffers + 0; + temp.len = 0; + temp.short_pkt = 0; + temp.setup_alt_next = 0; + + /* we need a SYNC point after TX */ + temp.func = &saf1761_device_data_tx_sync; + saf1761_dci_setup_standard_chain_sub(&temp); + } } + /* must have at least one frame! */ td = temp.td; xfer->td_transfer_last = td; + + if (is_host) { + /* get first again */ + td = xfer->td_transfer_first; + td->toggle = (xfer->endpoint->toggle_next ? 1 : 0); + } } static void @@ -919,7 +1362,7 @@ saf1761_dci_standard_done_sub(struct usb { struct saf1761_dci_td *td; uint32_t len; - uint8_t error; + usb_error_t error; DPRINTFN(9, "\n"); @@ -928,21 +1371,25 @@ saf1761_dci_standard_done_sub(struct usb do { len = td->remainder; + /* store last data toggle */ + xfer->endpoint->toggle_next = td->toggle; + if (xfer->aframes != xfer->nframes) { /* * Verify the length and subtract * the remainder from "frlengths[]": */ if (len > xfer->frlengths[xfer->aframes]) { - td->error = 1; + td->error_any = 1; } else { xfer->frlengths[xfer->aframes] -= len; } } /* Check for transfer error */ - if (td->error) { + if (td->error_any) { /* the transfer is finished */ - error = 1; + error = (td->error_stall ? + USB_ERR_STALLED : USB_ERR_IOERROR); td = NULL; break; } @@ -974,8 +1421,7 @@ saf1761_dci_standard_done_sub(struct usb xfer->td_transfer_cache = td; - return (error ? - USB_ERR_STALLED : USB_ERR_NORMAL_COMPLETION); + return (error); } static void @@ -1030,13 +1476,23 @@ done: static void saf1761_dci_device_done(struct usb_xfer *xfer, usb_error_t error) { + struct saf1761_dci_softc *sc = SAF1761_DCI_BUS2SC(xfer->xroot->bus); + USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); DPRINTFN(2, "xfer=%p, endpoint=%p, error=%d\n", xfer, xfer->endpoint, error); - if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) + if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) { saf1761_dci_intr_set(xfer, 0); + } else { + struct saf1761_dci_td *td; + + td = xfer->td_transfer_first; + + if (td != NULL) + saf1761_host_channel_free(sc, td); + } /* dequeue transfer and start next transfer */ usbd_transfer_done(xfer, error); @@ -1059,6 +1515,12 @@ saf1761_dci_set_stall(struct usb_device USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED); + /* check mode */ + if (udev->flags.usb_mode != USB_MODE_DEVICE) { + /* not supported */ + return; + } + DPRINTFN(5, "endpoint=%p\n", ep); /* set FORCESTALL */ @@ -1138,7 +1600,7 @@ usb_error_t saf1761_dci_init(struct saf1761_dci_softc *sc) { const struct usb_hw_ep_profile *pf; - uint8_t x; + uint32_t x; DPRINTF("\n"); @@ -1161,13 +1623,26 @@ saf1761_dci_init(struct saf1761_dci_soft DPRINTF("DCID=0x%08x\n", SAF1761_READ_4(sc, SOTG_DCCHIP_ID)); - /* reset device */ + /* reset device controller */ SAF1761_WRITE_2(sc, SOTG_MODE, SOTG_MODE_SFRESET); SAF1761_WRITE_2(sc, SOTG_MODE, 0); /* wait a bit */ DELAY(1000); + /* reset host controller */ + SAF1761_WRITE_4(sc, SOTG_SW_RESET, SOTG_SW_RESET_HC); + SAF1761_WRITE_4(sc, SOTG_USBCMD, SOTG_USBCMD_HCRESET); + + /* wait a bit */ + DELAY(1000); + + SAF1761_WRITE_4(sc, SOTG_SW_RESET, 0); + SAF1761_WRITE_4(sc, SOTG_USBCMD, 0); + + /* wait a bit */ + DELAY(1000); + /* do a pulldown */ saf1761_dci_pull_down(sc); @@ -1225,6 +1700,22 @@ saf1761_dci_init(struct saf1761_dci_soft /* disable device address */ SAF1761_WRITE_1(sc, SOTG_ADDRESS, 0); + /* enable host controller clock */ + SAF1761_WRITE_4(sc, SOTG_POWER_DOWN, SOTG_POWER_DOWN_HC_CLK_EN); + + /* wait 10ms for clock */ + usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100); + + /* enable configuration flag */ + SAF1761_WRITE_4(sc, SOTG_CONFIGFLAG, SOTG_CONFIGFLAG_ENABLE); + + /* clear RAM block */ + for (x = 0x400; x != 0x10000; x += 4) + SAF1761_WRITE_4(sc, x, 0); + + /* start the HC */ + SAF1761_WRITE_4(sc, SOTG_USBCMD, SOTG_USBCMD_RS); + /* poll initial VBUS status */ saf1761_dci_update_vbus(sc); @@ -1309,7 +1800,7 @@ saf1761_dci_device_non_isoc_start(struct saf1761_dci_start_standard_chain(xfer); } -static const struct usb_pipe_methods saf1761_dci_device_non_isoc_methods = +static const struct usb_pipe_methods saf1761_otg_non_isoc_methods = { .open = saf1761_dci_device_non_isoc_open, .close = saf1761_dci_device_non_isoc_close, @@ -1465,7 +1956,7 @@ static const struct saf1761_dci_config_d static const struct usb_hub_descriptor_min saf1761_dci_hubd = { .bDescLength = sizeof(saf1761_dci_hubd), .bDescriptorType = UDESC_HUB, - .bNbrPorts = 1, + .bNbrPorts = SOTG_NUM_PORTS, HSETW(.wHubCharacteristics, (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL)), .bPwrOn2PwrGood = 50, .bHubContrCurrent = 0, @@ -1490,6 +1981,8 @@ saf1761_dci_roothub_exec(struct usb_devi uint16_t len; uint16_t value; uint16_t index; + uint32_t temp; + uint32_t i; usb_error_t err; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -1620,9 +2113,19 @@ saf1761_dci_roothub_exec(struct usb_devi case UT_WRITE_CLASS_OTHER: switch (req->bRequest) { case UR_CLEAR_FEATURE: - goto tr_handle_clear_port_feature; + if (index == SOTG_HOST_PORT_NUM) + goto tr_handle_clear_port_feature_host; + else if (index == SOTG_DEVICE_PORT_NUM) + goto tr_handle_clear_port_feature_device; + else + goto tr_stalled; case UR_SET_FEATURE: - goto tr_handle_set_port_feature; + if (index == SOTG_HOST_PORT_NUM) + goto tr_handle_set_port_feature_host; + else if (index == SOTG_DEVICE_PORT_NUM) + goto tr_handle_set_port_feature_device; + else + goto tr_stalled; case UR_CLEAR_TT_BUFFER: case UR_RESET_TT: case UR_STOP_TT: @@ -1638,7 +2141,12 @@ saf1761_dci_roothub_exec(struct usb_devi case UR_GET_TT_STATE: goto tr_handle_get_tt_state; case UR_GET_STATUS: - goto tr_handle_get_port_status; + if (index == SOTG_HOST_PORT_NUM) + goto tr_handle_get_port_status_host; + else if (index == SOTG_DEVICE_PORT_NUM) + goto tr_handle_get_port_status_device; + else + goto tr_stalled; default: goto tr_stalled; } @@ -1748,10 +2256,8 @@ tr_handle_clear_wakeup: tr_handle_clear_halt: goto tr_valid; -tr_handle_clear_port_feature: - if (index != 1) - goto tr_stalled; - DPRINTFN(9, "UR_CLEAR_PORT_FEATURE on port %d\n", index); +tr_handle_clear_port_feature_device: + DPRINTFN(9, "UR_CLEAR_FEATURE on port %d\n", index); switch (value) { case UHF_PORT_SUSPEND: @@ -1785,10 +2291,52 @@ tr_handle_clear_port_feature: } goto tr_valid; -tr_handle_set_port_feature: - if (index != 1) - goto tr_stalled; - DPRINTFN(9, "UR_SET_PORT_FEATURE\n"); +tr_handle_clear_port_feature_host: + DPRINTFN(9, "UR_CLEAR_FEATURE on port %d\n", index); + + temp = SAF1761_READ_4(sc, SOTG_PORTSC1); + + switch (value) { + case UHF_PORT_ENABLE: + SAF1761_WRITE_4(sc, SOTG_PORTSC1, temp & ~SOTG_PORTSC1_PED); + break; + case UHF_PORT_SUSPEND: + if ((temp & SOTG_PORTSC1_SUSP) && (!(temp & SOTG_PORTSC1_FPR))) + SAF1761_WRITE_4(sc, SOTG_PORTSC1, temp | SOTG_PORTSC1_FPR); + + /* wait 20ms for resume sequence to complete */ + usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 50); + + SAF1761_WRITE_4(sc, SOTG_PORTSC1, temp & ~(SOTG_PORTSC1_SUSP | + SOTG_PORTSC1_FPR | SOTG_PORTSC1_LS /* High Speed */ )); + + /* 4ms settle time */ + usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 250); + break; + case UHF_PORT_INDICATOR: + SAF1761_WRITE_4(sc, SOTG_PORTSC1, temp & ~SOTG_PORTSC1_PIC); + break; + case UHF_PORT_TEST: + case UHF_C_PORT_ENABLE: + case UHF_C_PORT_OVER_CURRENT: + case UHF_C_PORT_RESET: + case UHF_C_PORT_SUSPEND: + /* NOPs */ + break; + case UHF_PORT_POWER: + SAF1761_WRITE_4(sc, SOTG_PORTSC1, temp & ~SOTG_PORTSC1_PP); + break; + case UHF_C_PORT_CONNECTION: + SAF1761_WRITE_4(sc, SOTG_PORTSC1, temp & ~SOTG_PORTSC1_ECSC); + break; + default: + err = USB_ERR_IOERROR; + goto tr_valid; + } + goto tr_valid; + +tr_handle_set_port_feature_device: + DPRINTFN(9, "UR_SET_FEATURE on port %d\n", index); switch (value) { case UHF_PORT_ENABLE: @@ -1809,12 +2357,73 @@ tr_handle_set_port_feature: } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri May 16 15:50:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08E35A75; Fri, 16 May 2014 15:50:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8D742CCB; Fri, 16 May 2014 15:50:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4GFoLCP014502; Fri, 16 May 2014 15:50:21 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GFoL7K014500; Fri, 16 May 2014 15:50:21 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405161550.s4GFoL7K014500@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 16 May 2014 15:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266244 - in head/sys: dev/usb/controller modules/usb/saf1761 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 15:50:22 -0000 Author: hselasky Date: Fri May 16 15:50:21 2014 New Revision: 266244 URL: http://svnweb.freebsd.org/changeset/base/266244 Log: Rename "saf1761_dci_xxx" into "saf1761_otg_xxx" to reflect that this driver supports both host and device side mode. Sponsored by: DARPA, AFRL Added: head/sys/dev/usb/controller/saf1761_otg.c - copied, changed from r266241, head/sys/dev/usb/controller/saf1761_dci.c head/sys/dev/usb/controller/saf1761_otg.h - copied, changed from r266241, head/sys/dev/usb/controller/saf1761_dci.h head/sys/dev/usb/controller/saf1761_otg_fdt.c - copied, changed from r266215, head/sys/dev/usb/controller/saf1761_dci_fdt.c head/sys/dev/usb/controller/saf1761_otg_reg.h - copied, changed from r266241, head/sys/dev/usb/controller/saf1761_dci_reg.h Modified: head/sys/modules/usb/saf1761/Makefile Copied and modified: head/sys/dev/usb/controller/saf1761_otg.c (from r266241, head/sys/dev/usb/controller/saf1761_dci.c) ============================================================================== --- head/sys/dev/usb/controller/saf1761_dci.c Fri May 16 15:41:55 2014 (r266241, copy source) +++ head/sys/dev/usb/controller/saf1761_otg.c Fri May 16 15:50:21 2014 (r266244) @@ -62,7 +62,7 @@ #include #include -#define USB_DEBUG_VAR saf1761_dci_debug +#define USB_DEBUG_VAR saf1761_otg_debug #include #include @@ -77,58 +77,58 @@ #include #endif /* USB_GLOBAL_INCLUDE_FILE */ -#include -#include +#include +#include -#define SAF1761_DCI_BUS2SC(bus) \ - ((struct saf1761_dci_softc *)(((uint8_t *)(bus)) - \ - ((uint8_t *)&(((struct saf1761_dci_softc *)0)->sc_bus)))) +#define SAF1761_OTG_BUS2SC(bus) \ + ((struct saf1761_otg_softc *)(((uint8_t *)(bus)) - \ + ((uint8_t *)&(((struct saf1761_otg_softc *)0)->sc_bus)))) #ifdef USB_DEBUG -static int saf1761_dci_debug = 0; -static int saf1761_dci_forcefs = 0; +static int saf1761_otg_debug = 0; +static int saf1761_otg_forcefs = 0; static -SYSCTL_NODE(_hw_usb, OID_AUTO, saf1761_dci, CTLFLAG_RW, 0, +SYSCTL_NODE(_hw_usb, OID_AUTO, saf1761_otg, CTLFLAG_RW, 0, "USB SAF1761 DCI"); -SYSCTL_INT(_hw_usb_saf1761_dci, OID_AUTO, debug, CTLFLAG_RW, - &saf1761_dci_debug, 0, "SAF1761 DCI debug level"); -SYSCTL_INT(_hw_usb_saf1761_dci, OID_AUTO, forcefs, CTLFLAG_RW, - &saf1761_dci_forcefs, 0, "SAF1761 DCI force FULL speed"); +SYSCTL_INT(_hw_usb_saf1761_otg, OID_AUTO, debug, CTLFLAG_RW, + &saf1761_otg_debug, 0, "SAF1761 DCI debug level"); +SYSCTL_INT(_hw_usb_saf1761_otg, OID_AUTO, forcefs, CTLFLAG_RW, + &saf1761_otg_forcefs, 0, "SAF1761 DCI force FULL speed"); #endif -#define SAF1761_DCI_INTR_ENDPT 1 +#define SAF1761_OTG_INTR_ENDPT 1 /* prototypes */ -static const struct usb_bus_methods saf1761_dci_bus_methods; +static const struct usb_bus_methods saf1761_otg_bus_methods; static const struct usb_pipe_methods saf1761_otg_non_isoc_methods; -static const struct usb_pipe_methods saf1761_dci_device_isoc_methods; +static const struct usb_pipe_methods saf1761_otg_device_isoc_methods; -static saf1761_dci_cmd_t saf1761_host_setup_tx; -static saf1761_dci_cmd_t saf1761_host_bulk_data_rx; -static saf1761_dci_cmd_t saf1761_host_bulk_data_tx; -static saf1761_dci_cmd_t saf1761_host_intr_data_rx; -static saf1761_dci_cmd_t saf1761_host_intr_data_tx; -static saf1761_dci_cmd_t saf1761_host_isoc_data_rx; -static saf1761_dci_cmd_t saf1761_host_isoc_data_tx; -static saf1761_dci_cmd_t saf1761_device_setup_rx; -static saf1761_dci_cmd_t saf1761_device_data_rx; -static saf1761_dci_cmd_t saf1761_device_data_tx; -static saf1761_dci_cmd_t saf1761_device_data_tx_sync; -static void saf1761_dci_device_done(struct usb_xfer *, usb_error_t); -static void saf1761_dci_do_poll(struct usb_bus *); -static void saf1761_dci_standard_done(struct usb_xfer *); -static void saf1761_dci_intr_set(struct usb_xfer *, uint8_t); -static void saf1761_dci_root_intr(struct saf1761_dci_softc *); +static saf1761_otg_cmd_t saf1761_host_setup_tx; +static saf1761_otg_cmd_t saf1761_host_bulk_data_rx; +static saf1761_otg_cmd_t saf1761_host_bulk_data_tx; +static saf1761_otg_cmd_t saf1761_host_intr_data_rx; +static saf1761_otg_cmd_t saf1761_host_intr_data_tx; +static saf1761_otg_cmd_t saf1761_host_isoc_data_rx; +static saf1761_otg_cmd_t saf1761_host_isoc_data_tx; +static saf1761_otg_cmd_t saf1761_device_setup_rx; +static saf1761_otg_cmd_t saf1761_device_data_rx; +static saf1761_otg_cmd_t saf1761_device_data_tx; +static saf1761_otg_cmd_t saf1761_device_data_tx_sync; +static void saf1761_otg_device_done(struct usb_xfer *, usb_error_t); +static void saf1761_otg_do_poll(struct usb_bus *); +static void saf1761_otg_standard_done(struct usb_xfer *); +static void saf1761_otg_intr_set(struct usb_xfer *, uint8_t); +static void saf1761_otg_root_intr(struct saf1761_otg_softc *); /* * Here is a list of what the SAF1761 chip can support. The main * limitation is that the sum of the buffer sizes must be less than * 8192 bytes. */ -static const struct usb_hw_ep_profile saf1761_dci_ep_profile[] = { +static const struct usb_hw_ep_profile saf1761_otg_ep_profile[] = { [0] = { .max_in_frame_size = 64, @@ -149,20 +149,20 @@ static const struct usb_hw_ep_profile sa }; static void -saf1761_dci_get_hw_ep_profile(struct usb_device *udev, +saf1761_otg_get_hw_ep_profile(struct usb_device *udev, const struct usb_hw_ep_profile **ppf, uint8_t ep_addr) { if (ep_addr == 0) { - *ppf = saf1761_dci_ep_profile + 0; + *ppf = saf1761_otg_ep_profile + 0; } else if (ep_addr < 8) { - *ppf = saf1761_dci_ep_profile + 1; + *ppf = saf1761_otg_ep_profile + 1; } else { *ppf = NULL; } } static void -saf1761_dci_pull_up(struct saf1761_dci_softc *sc) +saf1761_otg_pull_up(struct saf1761_otg_softc *sc) { /* activate pullup on D+, if possible */ @@ -174,7 +174,7 @@ saf1761_dci_pull_up(struct saf1761_dci_s } static void -saf1761_dci_pull_down(struct saf1761_dci_softc *sc) +saf1761_otg_pull_down(struct saf1761_otg_softc *sc) { /* release pullup on D+, if possible */ @@ -186,7 +186,7 @@ saf1761_dci_pull_down(struct saf1761_dci } static void -saf1761_dci_wakeup_peer(struct saf1761_dci_softc *sc) +saf1761_otg_wakeup_peer(struct saf1761_otg_softc *sc) { uint16_t temp; @@ -205,7 +205,7 @@ saf1761_dci_wakeup_peer(struct saf1761_d } static uint8_t -saf1761_host_channel_alloc(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +saf1761_host_channel_alloc(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { uint32_t x; @@ -245,7 +245,7 @@ saf1761_host_channel_alloc(struct saf176 } static void -saf1761_host_channel_free(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +saf1761_host_channel_free(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { uint32_t x; @@ -276,7 +276,7 @@ saf1761_host_channel_free(struct saf1761 } static void -saf1761_read_host_fifo_1(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td, +saf1761_read_host_fifo_1(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td, void *buf, uint32_t len) { bus_space_read_region_1((sc)->sc_io_tag, (sc)->sc_io_hdl, @@ -284,7 +284,7 @@ saf1761_read_host_fifo_1(struct saf1761_ } static void -saf1761_write_host_fifo_1(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td, +saf1761_write_host_fifo_1(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td, void *buf, uint32_t len) { bus_space_write_region_1((sc)->sc_io_tag, (sc)->sc_io_hdl, @@ -292,7 +292,7 @@ saf1761_write_host_fifo_1(struct saf1761 } static uint8_t -saf1761_host_setup_tx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +saf1761_host_setup_tx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { struct usb_device_request req __aligned(4); uint32_t status; @@ -358,7 +358,7 @@ complete: } static uint8_t -saf1761_host_bulk_data_rx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +saf1761_host_bulk_data_rx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { if (td->channel < SOTG_HOST_CHANNEL_MAX) { uint32_t status; @@ -456,7 +456,7 @@ complete: } static uint8_t -saf1761_host_bulk_data_tx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +saf1761_host_bulk_data_tx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { uint32_t count; @@ -532,31 +532,31 @@ complete: } static uint8_t -saf1761_host_intr_data_rx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +saf1761_host_intr_data_rx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { return (1); /* busy */ } static uint8_t -saf1761_host_intr_data_tx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +saf1761_host_intr_data_tx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { return (1); /* busy */ } static uint8_t -saf1761_host_isoc_data_rx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +saf1761_host_isoc_data_rx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { return (1); /* busy */ } static uint8_t -saf1761_host_isoc_data_tx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +saf1761_host_isoc_data_tx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { return (1); /* busy */ } static void -saf1761_dci_set_address(struct saf1761_dci_softc *sc, uint8_t addr) +saf1761_otg_set_address(struct saf1761_otg_softc *sc, uint8_t addr) { DPRINTFN(5, "addr=%d\n", addr); @@ -564,21 +564,21 @@ saf1761_dci_set_address(struct saf1761_d } static void -saf1761_read_device_fifo_1(struct saf1761_dci_softc *sc, void *buf, uint32_t len) +saf1761_read_device_fifo_1(struct saf1761_otg_softc *sc, void *buf, uint32_t len) { bus_space_read_multi_1((sc)->sc_io_tag, (sc)->sc_io_hdl, SOTG_DATA_PORT, buf, len); } static void -saf1761_write_device_fifo_1(struct saf1761_dci_softc *sc, void *buf, uint32_t len) +saf1761_write_device_fifo_1(struct saf1761_otg_softc *sc, void *buf, uint32_t len) { bus_space_write_multi_1((sc)->sc_io_tag, (sc)->sc_io_hdl, SOTG_DATA_PORT, buf, len); } static uint8_t -saf1761_device_setup_rx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +saf1761_device_setup_rx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { struct usb_device_request req; uint16_t count; @@ -646,7 +646,7 @@ busy: } static uint8_t -saf1761_device_data_rx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +saf1761_device_data_rx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { struct usb_page_search buf_res; uint16_t count; @@ -742,7 +742,7 @@ saf1761_device_data_rx(struct saf1761_dc } static uint8_t -saf1761_device_data_tx(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +saf1761_device_data_tx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { struct usb_page_search buf_res; uint16_t count; @@ -830,7 +830,7 @@ saf1761_device_data_tx(struct saf1761_dc } static uint8_t -saf1761_device_data_tx_sync(struct saf1761_dci_softc *sc, struct saf1761_dci_td *td) +saf1761_device_data_tx_sync(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { if (td->ep_index == 0) { /* select the correct endpoint */ @@ -855,15 +855,15 @@ saf1761_device_data_tx_sync(struct saf17 if (sc->sc_dv_addr != 0xFF) { /* write function address */ - saf1761_dci_set_address(sc, sc->sc_dv_addr); + saf1761_otg_set_address(sc, sc->sc_dv_addr); } return (0); /* complete */ } static uint8_t -saf1761_dci_xfer_do_fifo(struct saf1761_dci_softc *sc, struct usb_xfer *xfer) +saf1761_otg_xfer_do_fifo(struct saf1761_otg_softc *sc, struct usb_xfer *xfer) { - struct saf1761_dci_td *td; + struct saf1761_otg_td *td; uint8_t toggle; DPRINTFN(9, "\n"); @@ -901,19 +901,19 @@ saf1761_dci_xfer_do_fifo(struct saf1761_ done: /* compute all actual lengths */ - saf1761_dci_standard_done(xfer); + saf1761_otg_standard_done(xfer); return (0); /* complete */ } static void -saf1761_dci_interrupt_poll(struct saf1761_dci_softc *sc) +saf1761_otg_interrupt_poll(struct saf1761_otg_softc *sc) { struct usb_xfer *xfer; repeat: TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { - if (!saf1761_dci_xfer_do_fifo(sc, xfer)) { + if (!saf1761_otg_xfer_do_fifo(sc, xfer)) { /* queue has been modified */ goto repeat; } @@ -921,7 +921,7 @@ repeat: } static void -saf1761_dci_wait_suspend(struct saf1761_dci_softc *sc, uint8_t on) +saf1761_otg_wait_suspend(struct saf1761_otg_softc *sc, uint8_t on) { if (on) { sc->sc_intr_enable |= SOTG_DCINTERRUPT_IESUSP; @@ -934,7 +934,7 @@ saf1761_dci_wait_suspend(struct saf1761_ } static void -saf1761_dci_update_vbus(struct saf1761_dci_softc *sc) +saf1761_otg_update_vbus(struct saf1761_otg_softc *sc) { uint16_t status; @@ -950,7 +950,7 @@ saf1761_dci_update_vbus(struct saf1761_d sc->sc_flags.status_vbus = 1; /* complete root HUB interrupt endpoint */ - saf1761_dci_root_intr(sc); + saf1761_otg_root_intr(sc); } } else { /* VBUS not-present or host mode */ @@ -962,13 +962,13 @@ saf1761_dci_update_vbus(struct saf1761_d sc->sc_flags.change_connect = 1; /* complete root HUB interrupt endpoint */ - saf1761_dci_root_intr(sc); + saf1761_otg_root_intr(sc); } } } void -saf1761_dci_interrupt(struct saf1761_dci_softc *sc) +saf1761_otg_interrupt(struct saf1761_otg_softc *sc) { uint32_t status; @@ -984,7 +984,7 @@ saf1761_dci_interrupt(struct saf1761_dci /* update VBUS and ID bits, if any */ if (status & SOTG_DCINTERRUPT_IEVBUS) { - saf1761_dci_update_vbus(sc); + saf1761_otg_update_vbus(sc); } if (status & SOTG_DCINTERRUPT_IEBRST) { @@ -1002,9 +1002,9 @@ saf1761_dci_interrupt(struct saf1761_dci sc->sc_flags.change_connect = 1; /* disable resume interrupt */ - saf1761_dci_wait_suspend(sc, 1); + saf1761_otg_wait_suspend(sc, 1); /* complete root HUB interrupt endpoint */ - saf1761_dci_root_intr(sc); + saf1761_otg_root_intr(sc); } /* * If "RESUME" and "SUSPEND" is set at the same time we @@ -1020,30 +1020,30 @@ saf1761_dci_interrupt(struct saf1761_dci sc->sc_flags.status_suspend = 0; sc->sc_flags.change_suspend = 1; /* disable resume interrupt */ - saf1761_dci_wait_suspend(sc, 1); + saf1761_otg_wait_suspend(sc, 1); /* complete root HUB interrupt endpoint */ - saf1761_dci_root_intr(sc); + saf1761_otg_root_intr(sc); } } else if (status & SOTG_DCINTERRUPT_IESUSP) { if (!sc->sc_flags.status_suspend) { sc->sc_flags.status_suspend = 1; sc->sc_flags.change_suspend = 1; /* enable resume interrupt */ - saf1761_dci_wait_suspend(sc, 0); + saf1761_otg_wait_suspend(sc, 0); /* complete root HUB interrupt endpoint */ - saf1761_dci_root_intr(sc); + saf1761_otg_root_intr(sc); } } /* poll all active transfers */ - saf1761_dci_interrupt_poll(sc); + saf1761_otg_interrupt_poll(sc); USB_BUS_UNLOCK(&sc->sc_bus); } static void -saf1761_dci_setup_standard_chain_sub(struct saf1761_dci_std_temp *temp) +saf1761_otg_setup_standard_chain_sub(struct saf1761_otg_std_temp *temp) { - struct saf1761_dci_td *td; + struct saf1761_otg_td *td; /* get current Transfer Descriptor */ td = temp->td_next; @@ -1067,11 +1067,11 @@ saf1761_dci_setup_standard_chain_sub(str } static void -saf1761_dci_setup_standard_chain(struct usb_xfer *xfer) +saf1761_otg_setup_standard_chain(struct usb_xfer *xfer) { - struct saf1761_dci_std_temp temp; - struct saf1761_dci_softc *sc; - struct saf1761_dci_td *td; + struct saf1761_otg_std_temp temp; + struct saf1761_otg_softc *sc; + struct saf1761_otg_td *td; uint32_t x; uint8_t ep_no; uint8_t ep_type; @@ -1099,7 +1099,7 @@ saf1761_dci_setup_standard_chain(struct is_host = (xfer->xroot->udev->flags.usb_mode == USB_MODE_HOST); - sc = SAF1761_DCI_BUS2SC(xfer->xroot->bus); + sc = SAF1761_OTG_BUS2SC(xfer->xroot->bus); ep_no = (xfer->endpointno & UE_ADDR); ep_type = (xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE); @@ -1122,7 +1122,7 @@ saf1761_dci_setup_standard_chain(struct if (xfer->flags_int.control_act) temp.setup_alt_next = 0; } - saf1761_dci_setup_standard_chain_sub(&temp); + saf1761_otg_setup_standard_chain_sub(&temp); } x = 1; } else { @@ -1194,7 +1194,7 @@ saf1761_dci_setup_standard_chain(struct temp.short_pkt = (xfer->flags.force_short_xfer) ? 0 : 1; } - saf1761_dci_setup_standard_chain_sub(&temp); + saf1761_otg_setup_standard_chain_sub(&temp); if (xfer->flags_int.isochronous_xfr) { temp.offset += temp.len; @@ -1239,7 +1239,7 @@ saf1761_dci_setup_standard_chain(struct temp.len = 0; temp.short_pkt = 0; - saf1761_dci_setup_standard_chain_sub(&temp); + saf1761_otg_setup_standard_chain_sub(&temp); /* data toggle should be DATA1 */ td = temp.td; @@ -1248,7 +1248,7 @@ saf1761_dci_setup_standard_chain(struct if (need_sync) { /* we need a SYNC point after TX */ temp.func = &saf1761_device_data_tx_sync; - saf1761_dci_setup_standard_chain_sub(&temp); + saf1761_otg_setup_standard_chain_sub(&temp); } } } else { @@ -1260,7 +1260,7 @@ saf1761_dci_setup_standard_chain(struct /* we need a SYNC point after TX */ temp.func = &saf1761_device_data_tx_sync; - saf1761_dci_setup_standard_chain_sub(&temp); + saf1761_otg_setup_standard_chain_sub(&temp); } } @@ -1276,7 +1276,7 @@ saf1761_dci_setup_standard_chain(struct } static void -saf1761_dci_timeout(void *arg) +saf1761_otg_timeout(void *arg) { struct usb_xfer *xfer = arg; @@ -1285,13 +1285,13 @@ saf1761_dci_timeout(void *arg) USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); /* transfer is transferred */ - saf1761_dci_device_done(xfer, USB_ERR_TIMEOUT); + saf1761_otg_device_done(xfer, USB_ERR_TIMEOUT); } static void -saf1761_dci_intr_set(struct usb_xfer *xfer, uint8_t set) +saf1761_otg_intr_set(struct usb_xfer *xfer, uint8_t set) { - struct saf1761_dci_softc *sc = SAF1761_DCI_BUS2SC(xfer->xroot->bus); + struct saf1761_otg_softc *sc = SAF1761_OTG_BUS2SC(xfer->xroot->bus); uint8_t ep_no = (xfer->endpointno & UE_ADDR); uint32_t mask; @@ -1316,21 +1316,21 @@ saf1761_dci_intr_set(struct usb_xfer *xf } static void -saf1761_dci_start_standard_chain(struct usb_xfer *xfer) +saf1761_otg_start_standard_chain(struct usb_xfer *xfer) { - struct saf1761_dci_softc *sc = SAF1761_DCI_BUS2SC(xfer->xroot->bus); + struct saf1761_otg_softc *sc = SAF1761_OTG_BUS2SC(xfer->xroot->bus); DPRINTFN(9, "\n"); /* poll one time */ - if (saf1761_dci_xfer_do_fifo(sc, xfer)) { + if (saf1761_otg_xfer_do_fifo(sc, xfer)) { /* * Only enable the endpoint interrupt when we are * actually waiting for data, hence we are dealing * with level triggered interrupts ! */ - saf1761_dci_intr_set(xfer, 1); + saf1761_otg_intr_set(xfer, 1); /* put transfer on interrupt queue */ usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer); @@ -1338,13 +1338,13 @@ saf1761_dci_start_standard_chain(struct /* start timeout, if any */ if (xfer->timeout != 0) { usbd_transfer_timeout_ms(xfer, - &saf1761_dci_timeout, xfer->timeout); + &saf1761_otg_timeout, xfer->timeout); } } } static void -saf1761_dci_root_intr(struct saf1761_dci_softc *sc) +saf1761_otg_root_intr(struct saf1761_otg_softc *sc) { DPRINTFN(9, "\n"); @@ -1358,9 +1358,9 @@ saf1761_dci_root_intr(struct saf1761_dci } static usb_error_t -saf1761_dci_standard_done_sub(struct usb_xfer *xfer) +saf1761_otg_standard_done_sub(struct usb_xfer *xfer) { - struct saf1761_dci_td *td; + struct saf1761_otg_td *td; uint32_t len; usb_error_t error; @@ -1425,7 +1425,7 @@ saf1761_dci_standard_done_sub(struct usb } static void -saf1761_dci_standard_done(struct usb_xfer *xfer) +saf1761_otg_standard_done(struct usb_xfer *xfer) { usb_error_t err = 0; @@ -1440,7 +1440,7 @@ saf1761_dci_standard_done(struct usb_xfe if (xfer->flags_int.control_hdr) { - err = saf1761_dci_standard_done_sub(xfer); + err = saf1761_otg_standard_done_sub(xfer); } xfer->aframes = 1; @@ -1450,7 +1450,7 @@ saf1761_dci_standard_done(struct usb_xfe } while (xfer->aframes != xfer->nframes) { - err = saf1761_dci_standard_done_sub(xfer); + err = saf1761_otg_standard_done_sub(xfer); xfer->aframes++; if (xfer->td_transfer_cache == NULL) { @@ -1461,22 +1461,22 @@ saf1761_dci_standard_done(struct usb_xfe if (xfer->flags_int.control_xfr && !xfer->flags_int.control_act) { - err = saf1761_dci_standard_done_sub(xfer); + err = saf1761_otg_standard_done_sub(xfer); } done: - saf1761_dci_device_done(xfer, err); + saf1761_otg_device_done(xfer, err); } /*------------------------------------------------------------------------* - * saf1761_dci_device_done + * saf1761_otg_device_done * * NOTE: this function can be called more than one time on the * same USB transfer! *------------------------------------------------------------------------*/ static void -saf1761_dci_device_done(struct usb_xfer *xfer, usb_error_t error) +saf1761_otg_device_done(struct usb_xfer *xfer, usb_error_t error) { - struct saf1761_dci_softc *sc = SAF1761_DCI_BUS2SC(xfer->xroot->bus); + struct saf1761_otg_softc *sc = SAF1761_OTG_BUS2SC(xfer->xroot->bus); USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); @@ -1484,9 +1484,9 @@ saf1761_dci_device_done(struct usb_xfer xfer, xfer->endpoint, error); if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) { - saf1761_dci_intr_set(xfer, 0); + saf1761_otg_intr_set(xfer, 0); } else { - struct saf1761_dci_td *td; + struct saf1761_otg_td *td; td = xfer->td_transfer_first; @@ -1499,16 +1499,16 @@ saf1761_dci_device_done(struct usb_xfer } static void -saf1761_dci_xfer_stall(struct usb_xfer *xfer) +saf1761_otg_xfer_stall(struct usb_xfer *xfer) { - saf1761_dci_device_done(xfer, USB_ERR_STALLED); + saf1761_otg_device_done(xfer, USB_ERR_STALLED); } static void -saf1761_dci_set_stall(struct usb_device *udev, +saf1761_otg_set_stall(struct usb_device *udev, struct usb_endpoint *ep, uint8_t *did_stall) { - struct saf1761_dci_softc *sc; + struct saf1761_otg_softc *sc; uint8_t ep_no; uint8_t ep_type; uint8_t ep_dir; @@ -1524,7 +1524,7 @@ saf1761_dci_set_stall(struct usb_device DPRINTFN(5, "endpoint=%p\n", ep); /* set FORCESTALL */ - sc = SAF1761_DCI_BUS2SC(udev->bus); + sc = SAF1761_OTG_BUS2SC(udev->bus); ep_no = (ep->edesc->bEndpointAddress & UE_ADDR); ep_dir = (ep->edesc->bEndpointAddress & (UE_DIR_IN | UE_DIR_OUT)); ep_type = (ep->edesc->bmAttributes & UE_XFERTYPE); @@ -1544,7 +1544,7 @@ saf1761_dci_set_stall(struct usb_device } static void -saf1761_dci_clear_stall_sub(struct saf1761_dci_softc *sc, +saf1761_otg_clear_stall_sub(struct saf1761_otg_softc *sc, uint8_t ep_no, uint8_t ep_type, uint8_t ep_dir) { if (ep_type == UE_CONTROL) { @@ -1569,9 +1569,9 @@ saf1761_dci_clear_stall_sub(struct saf17 } static void -saf1761_dci_clear_stall(struct usb_device *udev, struct usb_endpoint *ep) +saf1761_otg_clear_stall(struct usb_device *udev, struct usb_endpoint *ep) { - struct saf1761_dci_softc *sc; + struct saf1761_otg_softc *sc; struct usb_endpoint_descriptor *ed; USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED); @@ -1584,20 +1584,20 @@ saf1761_dci_clear_stall(struct usb_devic return; } /* get softc */ - sc = SAF1761_DCI_BUS2SC(udev->bus); + sc = SAF1761_OTG_BUS2SC(udev->bus); /* get endpoint descriptor */ ed = ep->edesc; /* reset endpoint */ - saf1761_dci_clear_stall_sub(sc, + saf1761_otg_clear_stall_sub(sc, (ed->bEndpointAddress & UE_ADDR), (ed->bmAttributes & UE_XFERTYPE), (ed->bEndpointAddress & (UE_DIR_IN | UE_DIR_OUT))); } usb_error_t -saf1761_dci_init(struct saf1761_dci_softc *sc) +saf1761_otg_init(struct saf1761_otg_softc *sc) { const struct usb_hw_ep_profile *pf; uint32_t x; @@ -1606,7 +1606,7 @@ saf1761_dci_init(struct saf1761_dci_soft /* set up the bus structure */ sc->sc_bus.usbrev = USB_REV_2_0; - sc->sc_bus.methods = &saf1761_dci_bus_methods; + sc->sc_bus.methods = &saf1761_otg_bus_methods; USB_BUS_LOCK(&sc->sc_bus); @@ -1644,14 +1644,14 @@ saf1761_dci_init(struct saf1761_dci_soft DELAY(1000); /* do a pulldown */ - saf1761_dci_pull_down(sc); + saf1761_otg_pull_down(sc); /* wait 10ms for pulldown to stabilise */ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100); for (x = 1;; x++) { - saf1761_dci_get_hw_ep_profile(NULL, &pf, x); + saf1761_otg_get_hw_ep_profile(NULL, &pf, x); if (pf == NULL) break; @@ -1717,19 +1717,19 @@ saf1761_dci_init(struct saf1761_dci_soft SAF1761_WRITE_4(sc, SOTG_USBCMD, SOTG_USBCMD_RS); /* poll initial VBUS status */ - saf1761_dci_update_vbus(sc); + saf1761_otg_update_vbus(sc); USB_BUS_UNLOCK(&sc->sc_bus); /* catch any lost interrupts */ - saf1761_dci_do_poll(&sc->sc_bus); + saf1761_otg_do_poll(&sc->sc_bus); return (0); /* success */ } void -saf1761_dci_uninit(struct saf1761_dci_softc *sc) +saf1761_otg_uninit(struct saf1761_otg_softc *sc) { USB_BUS_LOCK(&sc->sc_bus); @@ -1743,90 +1743,90 @@ saf1761_dci_uninit(struct saf1761_dci_so sc->sc_flags.change_suspend = 0; sc->sc_flags.change_connect = 1; - saf1761_dci_pull_down(sc); + saf1761_otg_pull_down(sc); USB_BUS_UNLOCK(&sc->sc_bus); } static void -saf1761_dci_suspend(struct saf1761_dci_softc *sc) +saf1761_otg_suspend(struct saf1761_otg_softc *sc) { /* TODO */ } static void -saf1761_dci_resume(struct saf1761_dci_softc *sc) +saf1761_otg_resume(struct saf1761_otg_softc *sc) { /* TODO */ } static void -saf1761_dci_do_poll(struct usb_bus *bus) +saf1761_otg_do_poll(struct usb_bus *bus) { - struct saf1761_dci_softc *sc = SAF1761_DCI_BUS2SC(bus); + struct saf1761_otg_softc *sc = SAF1761_OTG_BUS2SC(bus); USB_BUS_LOCK(&sc->sc_bus); - saf1761_dci_interrupt_poll(sc); + saf1761_otg_interrupt_poll(sc); USB_BUS_UNLOCK(&sc->sc_bus); } /*------------------------------------------------------------------------* - * saf1761_dci control support - * saf1761_dci interrupt support - * saf1761_dci bulk support + * saf1761_otg control support + * saf1761_otg interrupt support + * saf1761_otg bulk support *------------------------------------------------------------------------*/ static void -saf1761_dci_device_non_isoc_open(struct usb_xfer *xfer) +saf1761_otg_device_non_isoc_open(struct usb_xfer *xfer) { return; } static void -saf1761_dci_device_non_isoc_close(struct usb_xfer *xfer) +saf1761_otg_device_non_isoc_close(struct usb_xfer *xfer) { - saf1761_dci_device_done(xfer, USB_ERR_CANCELLED); + saf1761_otg_device_done(xfer, USB_ERR_CANCELLED); } static void -saf1761_dci_device_non_isoc_enter(struct usb_xfer *xfer) +saf1761_otg_device_non_isoc_enter(struct usb_xfer *xfer) { return; } static void -saf1761_dci_device_non_isoc_start(struct usb_xfer *xfer) +saf1761_otg_device_non_isoc_start(struct usb_xfer *xfer) { /* setup TDs */ - saf1761_dci_setup_standard_chain(xfer); - saf1761_dci_start_standard_chain(xfer); + saf1761_otg_setup_standard_chain(xfer); + saf1761_otg_start_standard_chain(xfer); } static const struct usb_pipe_methods saf1761_otg_non_isoc_methods = { - .open = saf1761_dci_device_non_isoc_open, - .close = saf1761_dci_device_non_isoc_close, - .enter = saf1761_dci_device_non_isoc_enter, - .start = saf1761_dci_device_non_isoc_start, + .open = saf1761_otg_device_non_isoc_open, + .close = saf1761_otg_device_non_isoc_close, + .enter = saf1761_otg_device_non_isoc_enter, + .start = saf1761_otg_device_non_isoc_start, }; /*------------------------------------------------------------------------* - * saf1761_dci isochronous support + * saf1761_otg isochronous support *------------------------------------------------------------------------*/ static void -saf1761_dci_device_isoc_open(struct usb_xfer *xfer) +saf1761_otg_device_isoc_open(struct usb_xfer *xfer) { return; } static void -saf1761_dci_device_isoc_close(struct usb_xfer *xfer) +saf1761_otg_device_isoc_close(struct usb_xfer *xfer) { - saf1761_dci_device_done(xfer, USB_ERR_CANCELLED); + saf1761_otg_device_done(xfer, USB_ERR_CANCELLED); } static void -saf1761_dci_device_isoc_enter(struct usb_xfer *xfer) +saf1761_otg_device_isoc_enter(struct usb_xfer *xfer) { - struct saf1761_dci_softc *sc = SAF1761_DCI_BUS2SC(xfer->xroot->bus); + struct saf1761_otg_softc *sc = SAF1761_OTG_BUS2SC(xfer->xroot->bus); uint32_t temp; uint32_t nframes; @@ -1872,31 +1872,31 @@ saf1761_dci_device_isoc_enter(struct usb xfer->endpoint->isoc_next += xfer->nframes; /* setup TDs */ - saf1761_dci_setup_standard_chain(xfer); + saf1761_otg_setup_standard_chain(xfer); } static void -saf1761_dci_device_isoc_start(struct usb_xfer *xfer) +saf1761_otg_device_isoc_start(struct usb_xfer *xfer) { /* start TD chain */ - saf1761_dci_start_standard_chain(xfer); + saf1761_otg_start_standard_chain(xfer); } -static const struct usb_pipe_methods saf1761_dci_device_isoc_methods = +static const struct usb_pipe_methods saf1761_otg_device_isoc_methods = { - .open = saf1761_dci_device_isoc_open, - .close = saf1761_dci_device_isoc_close, - .enter = saf1761_dci_device_isoc_enter, - .start = saf1761_dci_device_isoc_start, + .open = saf1761_otg_device_isoc_open, + .close = saf1761_otg_device_isoc_close, + .enter = saf1761_otg_device_isoc_enter, + .start = saf1761_otg_device_isoc_start, }; /*------------------------------------------------------------------------* - * saf1761_dci root control support + * saf1761_otg root control support *------------------------------------------------------------------------* * Simulate a hardware HUB by handling all the necessary requests. *------------------------------------------------------------------------*/ -static const struct usb_device_descriptor saf1761_dci_devd = { +static const struct usb_device_descriptor saf1761_otg_devd = { .bLength = sizeof(struct usb_device_descriptor), .bDescriptorType = UDESC_DEVICE, .bcdUSB = {0x00, 0x02}, @@ -1910,7 +1910,7 @@ static const struct usb_device_descripto .bNumConfigurations = 1, }; -static const struct usb_device_qualifier saf1761_dci_odevd = { +static const struct usb_device_qualifier saf1761_otg_odevd = { .bLength = sizeof(struct usb_device_qualifier), .bDescriptorType = UDESC_DEVICE_QUALIFIER, .bcdUSB = {0x00, 0x02}, @@ -1921,11 +1921,11 @@ static const struct usb_device_qualifier .bNumConfigurations = 0, }; -static const struct saf1761_dci_config_desc saf1761_dci_confd = { +static const struct saf1761_otg_config_desc saf1761_otg_confd = { .confd = { .bLength = sizeof(struct usb_config_descriptor), .bDescriptorType = UDESC_CONFIG, - .wTotalLength[0] = sizeof(saf1761_dci_confd), + .wTotalLength[0] = sizeof(saf1761_otg_confd), .bNumInterface = 1, .bConfigurationValue = 1, .iConfiguration = 0, @@ -1944,7 +1944,7 @@ static const struct saf1761_dci_config_d .endpd = { .bLength = sizeof(struct usb_endpoint_descriptor), .bDescriptorType = UDESC_ENDPOINT, - .bEndpointAddress = (UE_DIR_IN | SAF1761_DCI_INTR_ENDPT), + .bEndpointAddress = (UE_DIR_IN | SAF1761_OTG_INTR_ENDPT), .bmAttributes = UE_INTERRUPT, .wMaxPacketSize[0] = 8, .bInterval = 255, @@ -1953,8 +1953,8 @@ static const struct saf1761_dci_config_d #define HSETW(ptr, val) ptr = { (uint8_t)(val), (uint8_t)((val) >> 8) } -static const struct usb_hub_descriptor_min saf1761_dci_hubd = { - .bDescLength = sizeof(saf1761_dci_hubd), +static const struct usb_hub_descriptor_min saf1761_otg_hubd = { + .bDescLength = sizeof(saf1761_otg_hubd), .bDescriptorType = UDESC_HUB, .bNbrPorts = SOTG_NUM_PORTS, HSETW(.wHubCharacteristics, (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL)), @@ -1969,14 +1969,14 @@ static const struct usb_hub_descriptor_m #define STRING_PRODUCT \ "D\0C\0I\0 \0R\0o\0o\0t\0 \0H\0U\0B" -USB_MAKE_STRING_DESC(STRING_VENDOR, saf1761_dci_vendor); -USB_MAKE_STRING_DESC(STRING_PRODUCT, saf1761_dci_product); +USB_MAKE_STRING_DESC(STRING_VENDOR, saf1761_otg_vendor); +USB_MAKE_STRING_DESC(STRING_PRODUCT, saf1761_otg_product); static usb_error_t -saf1761_dci_roothub_exec(struct usb_device *udev, +saf1761_otg_roothub_exec(struct usb_device *udev, struct usb_device_request *req, const void **pptr, uint16_t *plength) { - struct saf1761_dci_softc *sc = SAF1761_DCI_BUS2SC(udev->bus); + struct saf1761_otg_softc *sc = SAF1761_OTG_BUS2SC(udev->bus); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri May 16 15:53:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06F09D86; Fri, 16 May 2014 15:53:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E870C2D90; Fri, 16 May 2014 15:53:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4GFrEpX019198; Fri, 16 May 2014 15:53:14 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GFrELN019197; Fri, 16 May 2014 15:53:14 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405161553.s4GFrELN019197@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 16 May 2014 15:53:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266246 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 15:53:15 -0000 Author: hselasky Date: Fri May 16 15:53:14 2014 New Revision: 266246 URL: http://svnweb.freebsd.org/changeset/base/266246 Log: Fix a compile warning about unused variable. Sponsored by: DARPA, AFRL Modified: head/sys/dev/usb/controller/saf1761_otg.c Modified: head/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.c Fri May 16 15:51:37 2014 (r266245) +++ head/sys/dev/usb/controller/saf1761_otg.c Fri May 16 15:53:14 2014 (r266246) @@ -2629,12 +2629,9 @@ static void saf1761_otg_ep_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc, struct usb_endpoint *ep) { - struct saf1761_otg_softc *sc = SAF1761_OTG_BUS2SC(udev->bus); - - DPRINTFN(2, "endpoint=%p, addr=%d, endpt=%d, mode=%d (%d)\n", + DPRINTFN(2, "endpoint=%p, addr=%d, endpt=%d, mode=%d\n", ep, udev->address, - edesc->bEndpointAddress, udev->flags.usb_mode, - sc->sc_rt_addr); + edesc->bEndpointAddress, udev->flags.usb_mode); if (udev->parent_hub == NULL) { /* root HUB has special endpoint handling */ From owner-svn-src-head@FreeBSD.ORG Fri May 16 15:53:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FC5CFEB; Fri, 16 May 2014 15:53:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFD262D96; Fri, 16 May 2014 15:53:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4GFrVwX019326; Fri, 16 May 2014 15:53:31 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GFrVa3019325; Fri, 16 May 2014 15:53:31 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201405161553.s4GFrVa3019325@svn.freebsd.org> From: Hiroki Sato Date: Fri, 16 May 2014 15:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266248 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 15:53:32 -0000 Author: hrs Date: Fri May 16 15:53:31 2014 New Revision: 266248 URL: http://svnweb.freebsd.org/changeset/base/266248 Log: Cancel DAD for an ifa when the ifp has ND6_IFF_IFDISABLED as early as possible and do not clear IN6_IFF_TENTATIVE. If IFDISABLED was accidentally set after a DAD started, TENTATIVE could be cleared because no NA was received due to IFDISABLED, and as a result it could prevent DAD when manually clearing IFDISABLED after that. Modified: head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Fri May 16 15:53:27 2014 (r266247) +++ head/sys/netinet6/nd6_nbr.c Fri May 16 15:53:31 2014 (r266248) @@ -1312,6 +1312,7 @@ nd6_dad_timer(struct dadq *dp) { CURVNET_SET(dp->dad_vnet); struct ifaddr *ifa = dp->dad_ifa; + struct ifnet *ifp = dp->dad_ifa->ifa_ifp; struct in6_ifaddr *ia = (struct in6_ifaddr *)ifa; char ip6buf[INET6_ADDRSTRLEN]; @@ -1320,6 +1321,16 @@ nd6_dad_timer(struct dadq *dp) log(LOG_ERR, "nd6_dad_timer: called with null parameter\n"); goto done; } + if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) { + /* Do not need DAD for ifdisabled interface. */ + TAILQ_REMOVE(&V_dadq, (struct dadq *)dp, dad_list); + log(LOG_ERR, "nd6_dad_timer: cancel DAD on %s because of " + "ND6_IFF_IFDISABLED.\n", ifp->if_xname); + free(dp, M_IP6NDP); + dp = NULL; + ifa_free(ifa); + goto done; + } if (ia->ia6_flags & IN6_IFF_DUPLICATED) { log(LOG_ERR, "nd6_dad_timer: called with duplicated address " "%s(%s)\n", @@ -1384,9 +1395,12 @@ nd6_dad_timer(struct dadq *dp) } else { /* * We are done with DAD. No NA came, no NS came. - * No duplicate address found. + * No duplicate address found. Check IFDISABLED flag + * again in case that it is changed between the + * beginning of this function and here. */ - ia->ia6_flags &= ~IN6_IFF_TENTATIVE; + if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) == 0) + ia->ia6_flags &= ~IN6_IFF_TENTATIVE; nd6log((LOG_DEBUG, "%s: DAD complete for %s - no duplicates found\n", From owner-svn-src-head@FreeBSD.ORG Fri May 16 15:53:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3548C1B4; Fri, 16 May 2014 15:53:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0993B2D9C; Fri, 16 May 2014 15:53:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4GFrlPW019402; Fri, 16 May 2014 15:53:47 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GFrlEH019401; Fri, 16 May 2014 15:53:47 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405161553.s4GFrlEH019401@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 16 May 2014 15:53:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266249 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 15:53:48 -0000 Author: hselasky Date: Fri May 16 15:53:47 2014 New Revision: 266249 URL: http://svnweb.freebsd.org/changeset/base/266249 Log: Remove old files. Sponsored by: DARPA, AFRL Deleted: head/sys/dev/usb/controller/saf1761_dci.c head/sys/dev/usb/controller/saf1761_dci.h head/sys/dev/usb/controller/saf1761_dci_fdt.c head/sys/dev/usb/controller/saf1761_dci_reg.h From owner-svn-src-head@FreeBSD.ORG Fri May 16 16:28:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3463BAC8; Fri, 16 May 2014 16:28:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D35B20C9; Fri, 16 May 2014 16:28:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4GGS9en039788; Fri, 16 May 2014 16:28:09 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GGS9hk039787; Fri, 16 May 2014 16:28:09 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201405161628.s4GGS9hk039787@svn.freebsd.org> From: Gavin Atkinson Date: Fri, 16 May 2014 16:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266261 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 16:28:10 -0000 Author: gavin Date: Fri May 16 16:28:09 2014 New Revision: 266261 URL: http://svnweb.freebsd.org/changeset/base/266261 Log: USB endpoints are almost always single-digits, fix the path in the man page to be clearer. PR: docs/175560 Submitted by: Andreas Gustafsson MFC after: 3 days Modified: head/share/man/man4/ugen.4 Modified: head/share/man/man4/ugen.4 ============================================================================== --- head/share/man/man4/ugen.4 Fri May 16 16:21:17 2014 (r266260) +++ head/share/man/man4/ugen.4 Fri May 16 16:28:09 2014 (r266261) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 22, 2012 +.Dd May 16, 2014 .Dt UGEN 4 .Os .Sh NAME @@ -292,10 +292,10 @@ and should be set to .Dv USB_CURRENT_ALT_INDEX . .Sh FILES -.Bl -tag -width ".Pa /dev/ugen Ns Ar N Ns Pa \&. Ns Ar EE" -compact -.It Pa /dev/ugen Ns Ar N Ns Pa \&. Ns Ar EE +.Bl -tag -width ".Pa /dev/ugen Ns Ar N Ns Pa \&. Ns Ar E" -compact +.It Pa /dev/ugen Ns Ar N Ns Pa \&. Ns Ar E Endpoint -.Ar EE +.Ar E of device .Ar N . .El From owner-svn-src-head@FreeBSD.ORG Fri May 16 16:36:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D80CD36; Fri, 16 May 2014 16:36:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71FBE2185; Fri, 16 May 2014 16:36:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4GGa8YB045541; Fri, 16 May 2014 16:36:08 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GGa8g4045538; Fri, 16 May 2014 16:36:08 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405161636.s4GGa8g4045538@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 16 May 2014 16:36:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266262 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 16:36:08 -0000 Author: hselasky Date: Fri May 16 16:36:07 2014 New Revision: 266262 URL: http://svnweb.freebsd.org/changeset/base/266262 Log: Enable host controller interrupts. Sponsored by: DARPA, AFRL Modified: head/sys/dev/usb/controller/saf1761_otg.c head/sys/dev/usb/controller/saf1761_otg_reg.h Modified: head/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.c Fri May 16 16:28:09 2014 (r266261) +++ head/sys/dev/usb/controller/saf1761_otg.c Fri May 16 16:36:07 2014 (r266262) @@ -971,16 +971,20 @@ void saf1761_otg_interrupt(struct saf1761_otg_softc *sc) { uint32_t status; + uint32_t hcstat; USB_BUS_LOCK(&sc->sc_bus); - status = SAF1761_READ_4(sc, SOTG_DCINTERRUPT); + hcstat = SAF1761_READ_4(sc, SOTG_HCINTERRUPT); + /* acknowledge all host controller interrupts */ + SAF1761_WRITE_4(sc, SOTG_HCINTERRUPT, hcstat); - /* acknowledge all interrupts */ + status = SAF1761_READ_4(sc, SOTG_DCINTERRUPT); + /* acknowledge all device controller interrupts */ SAF1761_WRITE_4(sc, SOTG_DCINTERRUPT, status); - DPRINTF("DCINTERRUPT=0x%08x SOF=0x%04x\n", status, - SAF1761_READ_2(sc, SOTG_FRAME_NUM)); + DPRINTF("DCINTERRUPT=0x%08x HCINTERRUPT=0x%08x SOF=0x%04x\n", + status, hcstat, SAF1761_READ_2(sc, SOTG_FRAME_NUM)); /* update VBUS and ID bits, if any */ if (status & SOTG_DCINTERRUPT_IEVBUS) { @@ -1716,6 +1720,13 @@ saf1761_otg_init(struct saf1761_otg_soft /* start the HC */ SAF1761_WRITE_4(sc, SOTG_USBCMD, SOTG_USBCMD_RS); + /* enable HC interrupts */ + SAF1761_WRITE_4(sc, SOTG_HCINTERRUPT_ENABLE, + SOTG_HCINTERRUPT_OTG_IRQ | + SOTG_HCINTERRUPT_ISO_IRQ | + SOTG_HCINTERRUPT_ALT_IRQ | + SOTG_HCINTERRUPT_INT_IRQ); + /* poll initial VBUS status */ saf1761_otg_update_vbus(sc); Modified: head/sys/dev/usb/controller/saf1761_otg_reg.h ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg_reg.h Fri May 16 16:28:09 2014 (r266261) +++ head/sys/dev/usb/controller/saf1761_otg_reg.h Fri May 16 16:36:07 2014 (r266262) @@ -210,5 +210,15 @@ #define SOTG_USBCMD_LHCR (1 << 7) #define SOTG_USBCMD_HCRESET (1 << 1) #define SOTG_USBCMD_RS (1 << 0) +#define SOTG_HCINTERRUPT 0x310 +#define SOTG_HCINTERRUPT_OTG_IRQ (1 << 10) +#define SOTG_HCINTERRUPT_ISO_IRQ (1 << 9) +#define SOTG_HCINTERRUPT_ALT_IRQ (1 << 8) +#define SOTG_HCINTERRUPT_INT_IRQ (1 << 7) +#define SOTG_HCINTERRUPT_CLKREADY (1 << 6) +#define SOTG_HCINTERRUPT_HCSUSP (1 << 5) +#define SOTG_HCINTERRUPT_DMAEOTINT (1 << 3) +#define SOTG_HCINTERRUPT_SOFITLINT (1 << 1) +#define SOTG_HCINTERRUPT_ENABLE 0x314 #endif /* _SAF1761_OTG_REG_H_ */ From owner-svn-src-head@FreeBSD.ORG Fri May 16 17:45:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A905AE6F; Fri, 16 May 2014 17:45:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 964432755; Fri, 16 May 2014 17:45:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4GHjAIi087694; Fri, 16 May 2014 17:45:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GHjAtA087691; Fri, 16 May 2014 17:45:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405161745.s4GHjAtA087691@svn.freebsd.org> From: John Baldwin Date: Fri, 16 May 2014 17:45:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266263 - in head/sys: amd64/amd64 x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 17:45:10 -0000 Author: jhb Date: Fri May 16 17:45:09 2014 New Revision: 266263 URL: http://svnweb.freebsd.org/changeset/base/266263 Log: Add definitions for more structured extended features as well as XSAVE Extended Features for AVX512 and MPX (Memory Protection Extensions). Obtained from: Intel's Instruction Set Extensions Programming Reference (March 2014) Modified: head/sys/amd64/amd64/identcpu.c head/sys/x86/include/specialreg.h Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Fri May 16 16:36:07 2014 (r266262) +++ head/sys/amd64/amd64/identcpu.c Fri May 16 17:45:09 2014 (r266263) @@ -385,11 +385,11 @@ printcpuinfo(void) } if (cpu_stdext_feature != 0) { - printf("\n Standard Extended Features=0x%b", + printf("\n Structured Extended Features=0x%b", cpu_stdext_feature, "\020" /* RDFSBASE/RDGSBASE/WRFSBASE/WRGSBASE */ - "\001GSFSBASE" + "\001FSGSBASE" "\002TSCADJ" /* Bit Manipulation Instructions */ "\004BMI1" @@ -401,17 +401,27 @@ printcpuinfo(void) "\010SMEP" /* Bit Manipulation Instructions */ "\011BMI2" - "\012ENHMOVSB" + "\012ERMS" /* Invalidate Processor Context ID */ "\013INVPCID" /* Restricted Transactional Memory */ "\014RTM" + /* Intel Memory Protection Extensions */ + "\017MPX" + /* AVX512 Foundation */ + "\021AVX512F" /* Enhanced NRBG */ "\023RDSEED" /* ADCX + ADOX */ "\024ADX" /* Supervisor Mode Access Prevention */ "\025SMAP" + "\030CLFLUSHOPT" + "\032PROCTRACE" + "\033AVX512PF" + "\034AVX512ER" + "\035AVX512CD" + "\036SHA" ); } Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Fri May 16 16:36:07 2014 (r266262) +++ head/sys/x86/include/specialreg.h Fri May 16 17:45:09 2014 (r266263) @@ -87,12 +87,23 @@ */ #define XCR0 0 /* XFEATURE_ENABLED_MASK register */ -#define XFEATURE_ENABLED_X87 0x00000001 -#define XFEATURE_ENABLED_SSE 0x00000002 -#define XFEATURE_ENABLED_AVX 0x00000004 +#define XFEATURE_ENABLED_X87 0x00000001 +#define XFEATURE_ENABLED_SSE 0x00000002 +#define XFEATURE_ENABLED_YMM_HI128 0x00000004 +#define XFEATURE_ENABLED_AVX XFEATURE_ENABLED_YMM_HI128 +#define XFEATURE_ENABLED_BNDREGS 0x00000008 +#define XFEATURE_ENABLED_BNDCSR 0x00000010 +#define XFEATURE_ENABLED_OPMASK 0x00000020 +#define XFEATURE_ENABLED_ZMM_HI256 0x00000040 +#define XFEATURE_ENABLED_HI16_ZMM 0x00000080 #define XFEATURE_AVX \ (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE | XFEATURE_ENABLED_AVX) +#define XFEATURE_AVX512 \ + (XFEATURE_ENABLED_OPMASK | XFEATURE_ENABLED_ZMM_HI256 | \ + XFEATURE_ENABLED_HI16_ZMM) +#define XFEATURE_MPX \ + (XFEATURE_ENABLED_BNDREGS | XFEATURE_ENABLED_BNDCSR) /* * CPUID instruction features register @@ -308,7 +319,7 @@ #define AMDID_COREID_SIZE_SHIFT 12 /* - * Structured Extended Features + * CPUID instruction 7 Structured Extended Features, leaf 0 ebx info */ #define CPUID_STDEXT_FSGSBASE 0x00000001 #define CPUID_STDEXT_TSC_ADJUST 0x00000002 @@ -317,12 +328,20 @@ #define CPUID_STDEXT_AVX2 0x00000020 #define CPUID_STDEXT_SMEP 0x00000080 #define CPUID_STDEXT_BMI2 0x00000100 -#define CPUID_STDEXT_ENH_MOVSB 0x00000200 -#define CPUID_STDEXT_RTM 0x00000800 +#define CPUID_STDEXT_ERMS 0x00000200 #define CPUID_STDEXT_INVPCID 0x00000400 +#define CPUID_STDEXT_RTM 0x00000800 +#define CPUID_STDEXT_MPX 0x00004000 +#define CPUID_STDEXT_AVX512F 0x00010000 #define CPUID_STDEXT_RDSEED 0x00040000 #define CPUID_STDEXT_ADX 0x00080000 #define CPUID_STDEXT_SMAP 0x00100000 +#define CPUID_STDEXT_CLFLUSHOPT 0x00800000 +#define CPUID_STDEXT_PROCTRACE 0x02000000 +#define CPUID_STDEXT_AVX512PF 0x04000000 +#define CPUID_STDEXT_AVX512ER 0x08000000 +#define CPUID_STDEXT_AVX512CD 0x10000000 +#define CPUID_STDEXT_SHA 0x20000000 /* * CPUID manufacturers identifiers From owner-svn-src-head@FreeBSD.ORG Fri May 16 18:44:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D90EC309; Fri, 16 May 2014 18:44:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6FCA2C7A; Fri, 16 May 2014 18:44:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4GIiNeB024895; Fri, 16 May 2014 18:44:23 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GIiNhN024894; Fri, 16 May 2014 18:44:23 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201405161844.s4GIiNhN024894@svn.freebsd.org> From: Hiroki Sato Date: Fri, 16 May 2014 18:44:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266267 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 18:44:23 -0000 Author: hrs Date: Fri May 16 18:44:23 2014 New Revision: 266267 URL: http://svnweb.freebsd.org/changeset/base/266267 Log: Fix an issue in range specification handling when a "-foo" is specified in ifconfig_IF_aliasN. Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Fri May 16 17:57:14 2014 (r266266) +++ head/etc/network.subr Fri May 16 18:44:23 2014 (r266267) @@ -1040,7 +1040,7 @@ ifalias_af_common_handler() case $_c in ${_af}) case $_tmpargs in - ${_af}\ *-*) + ${_af}\ *[0-9a-fA-F]-*) ifalias_af_common_handler $_if $_af $_action \ `ifalias_expand_addr $_af $_action ${_tmpargs#${_af}\ }` ;; @@ -1058,7 +1058,7 @@ ifalias_af_common_handler() # Process the last component if any. if [ -n "$_tmpargs}" ]; then case $_tmpargs in - ${_af}\ *-*) + ${_af}\ *[0-9][a-f][A-F]-*) ifalias_af_common_handler $_if $_af $_action \ `ifalias_expand_addr $_af $_action ${_tmpargs#${_af}\ }` ;; From owner-svn-src-head@FreeBSD.ORG Fri May 16 21:19:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DA43F97; Fri, 16 May 2014 21:19:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2E1029E6; Fri, 16 May 2014 21:19:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4GLJJXB017550; Fri, 16 May 2014 21:19:19 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GLJI3D017541; Fri, 16 May 2014 21:19:18 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405162119.s4GLJI3D017541@svn.freebsd.org> From: Christian Brueffer Date: Fri, 16 May 2014 21:19:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266270 - in head/sys/dev: firewire my nfe siba sis sk tx usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 21:19:20 -0000 Author: brueffer Date: Fri May 16 21:19:17 2014 New Revision: 266270 URL: http://svnweb.freebsd.org/changeset/base/266270 Log: Remove some unused variables. Found with: Clang Static Analyzer MFC after: 2 weeks Modified: head/sys/dev/firewire/sbp.c head/sys/dev/my/if_my.c head/sys/dev/nfe/if_nfe.c head/sys/dev/siba/siba_core.c head/sys/dev/sis/if_sis.c head/sys/dev/sk/if_sk.c head/sys/dev/tx/if_tx.c head/sys/dev/usb/net/if_axge.c Modified: head/sys/dev/firewire/sbp.c ============================================================================== --- head/sys/dev/firewire/sbp.c Fri May 16 19:28:22 2014 (r266269) +++ head/sys/dev/firewire/sbp.c Fri May 16 21:19:17 2014 (r266270) @@ -2748,7 +2748,6 @@ sbp_dequeue_ocb(struct sbp_dev *sdev, st struct sbp_ocb *ocb; struct sbp_ocb *next; int s = splfw(), order = 0; - int flags; SBP_DEBUG(1) device_printf(sdev->target->sbp->fd.dev, @@ -2762,7 +2761,6 @@ END_DEBUG SBP_LOCK(sdev->target->sbp); for (ocb = STAILQ_FIRST(&sdev->ocbs); ocb != NULL; ocb = next) { next = STAILQ_NEXT(ocb, ocb); - flags = ocb->flags; if (OCB_MATCH(ocb, sbp_status)) { /* found */ STAILQ_REMOVE(&sdev->ocbs, ocb, sbp_ocb, ocb); Modified: head/sys/dev/my/if_my.c ============================================================================== --- head/sys/dev/my/if_my.c Fri May 16 19:28:22 2014 (r266269) +++ head/sys/dev/my/if_my.c Fri May 16 21:19:17 2014 (r266270) @@ -658,10 +658,8 @@ static void my_setmode_mii(struct my_softc * sc, int media) { u_int16_t bmcr; - struct ifnet *ifp; MY_LOCK_ASSERT(sc); - ifp = sc->my_ifp; /* * If an autoneg session is in progress, stop it. */ Modified: head/sys/dev/nfe/if_nfe.c ============================================================================== --- head/sys/dev/nfe/if_nfe.c Fri May 16 19:28:22 2014 (r266269) +++ head/sys/dev/nfe/if_nfe.c Fri May 16 21:19:17 2014 (r266270) @@ -1376,15 +1376,12 @@ nfe_free_rx_ring(struct nfe_softc *sc, s { struct nfe_rx_data *data; void *desc; - int i, descsize; + int i; - if (sc->nfe_flags & NFE_40BIT_ADDR) { + if (sc->nfe_flags & NFE_40BIT_ADDR) desc = ring->desc64; - descsize = sizeof (struct nfe_desc64); - } else { + else desc = ring->desc32; - descsize = sizeof (struct nfe_desc32); - } for (i = 0; i < NFE_RX_RING_COUNT; i++) { data = &ring->data[i]; Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Fri May 16 19:28:22 2014 (r266269) +++ head/sys/dev/siba/siba_core.c Fri May 16 21:19:17 2014 (r266270) @@ -1740,12 +1740,10 @@ static void siba_pcicore_init(struct siba_pci *spc) { struct siba_dev_softc *sd = spc->spc_dev; - struct siba_softc *siba; if (sd == NULL) return; - siba = sd->sd_bus; if (!siba_dev_isup_sub(sd)) siba_dev_up_sub(sd, 0); Modified: head/sys/dev/sis/if_sis.c ============================================================================== --- head/sys/dev/sis/if_sis.c Fri May 16 19:28:22 2014 (r266269) +++ head/sys/dev/sis/if_sis.c Fri May 16 21:19:17 2014 (r266270) @@ -1617,11 +1617,9 @@ sis_tick(void *xsc) { struct sis_softc *sc; struct mii_data *mii; - struct ifnet *ifp; sc = xsc; SIS_LOCK_ASSERT(sc); - ifp = sc->sis_ifp; mii = device_get_softc(sc->sis_miibus); mii_tick(mii); Modified: head/sys/dev/sk/if_sk.c ============================================================================== --- head/sys/dev/sk/if_sk.c Fri May 16 19:28:22 2014 (r266269) +++ head/sys/dev/sk/if_sk.c Fri May 16 21:19:17 2014 (r266270) @@ -2877,13 +2877,11 @@ static void sk_txeof(sc_if) struct sk_if_softc *sc_if; { - struct sk_softc *sc; struct sk_txdesc *txd; struct sk_tx_desc *cur_tx; struct ifnet *ifp; u_int32_t idx, sk_ctl; - sc = sc_if->sk_softc; ifp = sc_if->sk_ifp; txd = STAILQ_FIRST(&sc_if->sk_cdata.sk_txbusyq); Modified: head/sys/dev/tx/if_tx.c ============================================================================== --- head/sys/dev/tx/if_tx.c Fri May 16 19:28:22 2014 (r266269) +++ head/sys/dev/tx/if_tx.c Fri May 16 21:19:17 2014 (r266270) @@ -1151,12 +1151,10 @@ epic_ifmedia_sts(struct ifnet *ifp, stru { epic_softc_t *sc; struct mii_data *mii; - struct ifmedia *ifm; sc = ifp->if_softc; mii = device_get_softc(sc->miibus); EPIC_LOCK(sc); - ifm = &mii->mii_media; /* Nothing should be selected if interface is down. */ if ((ifp->if_flags & IFF_UP) == 0) { Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Fri May 16 19:28:22 2014 (r266269) +++ head/sys/dev/usb/net/if_axge.c Fri May 16 21:19:17 2014 (r266270) @@ -910,7 +910,6 @@ axge_ioctl(struct ifnet *ifp, u_long cmd static int axge_rx_frame(struct usb_ether *ue, struct usb_page_cache *pc, int actlen) { - struct axge_softc *sc; struct axge_csum_hdr csum_hdr; int error, len, pos; int pkt_cnt; @@ -918,7 +917,6 @@ axge_rx_frame(struct usb_ether *ue, stru uint16_t hdr_off; uint16_t pktlen; - sc = uether_getsc(ue); pos = 0; len = 0; error = 0; From owner-svn-src-head@FreeBSD.ORG Fri May 16 21:20:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 304F21CF; Fri, 16 May 2014 21:20:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DE3729F1; Fri, 16 May 2014 21:20:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4GLKDwP017779; Fri, 16 May 2014 21:20:13 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4GLKDR9017778; Fri, 16 May 2014 21:20:13 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201405162120.s4GLKDR9017778@svn.freebsd.org> From: Gavin Atkinson Date: Fri, 16 May 2014 21:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266271 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2014 21:20:14 -0000 Author: gavin Date: Fri May 16 21:20:13 2014 New Revision: 266271 URL: http://svnweb.freebsd.org/changeset/base/266271 Log: Fix spelling mistake in comment. Spotted during: http://www.bsdcan.org/2014/schedule/events/484.en.html Modified: head/sys/arm/arm/locore.S Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Fri May 16 21:19:17 2014 (r266270) +++ head/sys/arm/arm/locore.S Fri May 16 21:20:13 2014 (r266271) @@ -82,7 +82,7 @@ ASENTRY_NP(_start) mov r9, r0 /* 0 or boot mode from boot2 */ mov r8, r1 /* Save Machine type */ mov ip, r2 /* Save meta data */ - mov fp, r3 /* Future expantion */ + mov fp, r3 /* Future expansion */ /* Make sure interrupts are disabled. */ mrs r7, cpsr From owner-svn-src-head@FreeBSD.ORG Sat May 17 00:09:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8045DD8; Sat, 17 May 2014 00:09:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A55FC2747; Sat, 17 May 2014 00:09:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4H09CSb021812; Sat, 17 May 2014 00:09:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4H09CbY021811; Sat, 17 May 2014 00:09:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405170009.s4H09CbY021811@svn.freebsd.org> From: Adrian Chadd Date: Sat, 17 May 2014 00:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266276 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 00:09:12 -0000 Author: adrian Date: Sat May 17 00:09:12 2014 New Revision: 266276 URL: http://svnweb.freebsd.org/changeset/base/266276 Log: Reserve IP_FLOWID, IP_FLOWTYPE, IP_RSSCPUID socket option IDs for near-term future use. These are intended to fetch the current flow id, flow hash type (M_HASHTYPE_* from the sys/mbuf.h) and if RSS is enabled, the RSS destined CPU ID for the receive path. Modified: head/sys/netinet/in.h Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Fri May 16 23:49:40 2014 (r266275) +++ head/sys/netinet/in.h Sat May 17 00:09:12 2014 (r266276) @@ -468,6 +468,9 @@ __END_DECLS #define IP_MINTTL 66 /* minimum TTL for packet or drop */ #define IP_DONTFRAG 67 /* don't fragment packet */ #define IP_RECVTOS 68 /* bool; receive IP TOS w/dgram */ +#define IP_FLOWID 69 /* flow id for the given socket/inp */ +#define IP_FLOWTYPE 70 /* flow type (M_HASHTYPE) */ +#define IP_RSSCPUID 71 /* RSS flowid -> CPU id mapping */ /* IPv4 Source Filter Multicast API [RFC3678] */ #define IP_ADD_SOURCE_MEMBERSHIP 70 /* join a source-specific group */ From owner-svn-src-head@FreeBSD.ORG Sat May 17 01:47:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A48947A9; Sat, 17 May 2014 01:47:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77C2D2E8F; Sat, 17 May 2014 01:47:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4H1l7Dp081738; Sat, 17 May 2014 01:47:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4H1l6nW081735; Sat, 17 May 2014 01:47:06 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405170147.s4H1l6nW081735@svn.freebsd.org> From: Warner Losh Date: Sat, 17 May 2014 01:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266278 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 01:47:07 -0000 Author: imp Date: Sat May 17 01:47:06 2014 New Revision: 266278 URL: http://svnweb.freebsd.org/changeset/base/266278 Log: Read in SRCCONF early and consistently, if src.sys.mk exists, which is should for all normal builds. Read /etc/make.conf earlier than before, but consistently before SRCCONF and local.sys.mk. Added: head/share/mk/src.sys.mk (contents, props changed) Modified: head/share/mk/src.opts.mk head/share/mk/sys.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sat May 17 00:53:12 2014 (r266277) +++ head/share/mk/src.opts.mk Sat May 17 01:47:06 2014 (r266278) @@ -30,13 +30,6 @@ .if !target(____) ____: -# Allow user to configure things that only effect src tree builds. -SRCCONF?= /etc/src.conf -.if exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf" -.include "${SRCCONF}" -.endif - -# Must be included after src.conf .include # Added: head/share/mk/src.sys.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/mk/src.sys.mk Sat May 17 01:47:06 2014 (r266278) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +# Allow user to configure things that only effect src tree builds. +SRCCONF?= /etc/src.conf +.if exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf" +.include "${SRCCONF}" +.endif Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Sat May 17 00:53:12 2014 (r266277) +++ head/share/mk/sys.mk Sat May 17 01:47:06 2014 (r266278) @@ -14,11 +14,22 @@ unix ?= We run FreeBSD, not UNIX. # for something different in FreeBSD. # MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/} + +# Pull in global settings. +__MAKE_CONF?=/etc/make.conf +.if exists(${__MAKE_CONF}) +.include "${__MAKE_CONF}" .endif +# Setup anything for the FreeBSD source build, if we're building +# inside the source tree. Needs to be after make.conf, but before +# local stuff. +.sinclude + # Set any local definitions first. Place this early, but it needs # MACHINE_CPUARCH to be defined. .sinclude +.endif # If the special target .POSIX appears (without prerequisites or # commands) before the first noncomment line in the makefile, make shall @@ -314,12 +325,6 @@ YFLAGS ?= -d rm -f ${.PREFIX}.tmp.c ${CTFCONVERT_CMD} -# FreeBSD build pollution. Hide it in the non-POSIX part of the ifdef. -__MAKE_CONF?=/etc/make.conf -.if exists(${__MAKE_CONF}) -.include "${__MAKE_CONF}" -.endif - .if defined(__MAKE_SHELL) && !empty(__MAKE_SHELL) SHELL= ${__MAKE_SHELL} .SHELL: path=${__MAKE_SHELL} From owner-svn-src-head@FreeBSD.ORG Sat May 17 02:26:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D7B7DE6; Sat, 17 May 2014 02:26:57 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 0E17B2155; Sat, 17 May 2014 02:26:56 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id DDECDA968; Sat, 17 May 2014 02:26:48 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id B24E53029B; Sat, 17 May 2014 04:26:51 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Bruce Evans Subject: Re: svn commit: r266238 - head/contrib/ldns/ldns References: <201405161532.s4GFWGvh006504@svn.freebsd.org> <20140517112645.N925@besplex.bde.org> Date: Sat, 17 May 2014 04:26:51 +0200 In-Reply-To: <20140517112645.N925@besplex.bde.org> (Bruce Evans's message of "Sat, 17 May 2014 11:46:16 +1000 (EST)") Message-ID: <86ppjdjg2c.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 02:26:57 -0000 Bruce Evans writes: > -Wcast-qual is especially onerous in contrib'ed code written to a lower > standard. Well, I could have just lowered WARNS... LDNS actually isn't that bad. Unbound is much worse. > Converting this to use system endianness conversion functions wouldn't > take much more churn. Do our standard endianness conversion functions handle unaligned accesses? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Sat May 17 02:45:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74231619; Sat, 17 May 2014 02:45:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61D3622C5; Sat, 17 May 2014 02:45:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4H2j5Gx018050; Sat, 17 May 2014 02:45:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4H2j50i018049; Sat, 17 May 2014 02:45:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405170245.s4H2j50i018049@svn.freebsd.org> From: John Baldwin Date: Sat, 17 May 2014 02:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266281 - head/sys/dev/aac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 02:45:05 -0000 Author: jhb Date: Sat May 17 02:45:04 2014 New Revision: 266281 URL: http://svnweb.freebsd.org/changeset/base/266281 Log: Clear the data buffer length field when freeing a command structure so that it doesn't leak through when the command structure is reused for a user command without a data buffer. PR: amd64/189668 Tested by: Pete Long MFC after: 1 week Modified: head/sys/dev/aac/aac.c Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Sat May 17 02:39:20 2014 (r266280) +++ head/sys/dev/aac/aac.c Sat May 17 02:45:04 2014 (r266281) @@ -1408,6 +1408,7 @@ aac_release_command(struct aac_command * fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); /* (re)initialize the command/FIB */ + cm->cm_datalen = 0; cm->cm_sgtable = NULL; cm->cm_flags = 0; cm->cm_complete = NULL; From owner-svn-src-head@FreeBSD.ORG Sat May 17 02:53:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0927C9D0; Sat, 17 May 2014 02:53:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D11F0237B; Sat, 17 May 2014 02:53:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4H2rAv5023781; Sat, 17 May 2014 02:53:10 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4H2rAds023780; Sat, 17 May 2014 02:53:10 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201405170253.s4H2rAds023780@svn.freebsd.org> From: Benjamin Kaduk Date: Sat, 17 May 2014 02:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266283 - head/usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 02:53:11 -0000 Author: bjk (doc committer) Date: Sat May 17 02:53:10 2014 New Revision: 266283 URL: http://svnweb.freebsd.org/changeset/base/266283 Log: Bump .Dd, missed in r266206 Approved by: hrs (mentor, implicit) Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sat May 17 02:45:59 2014 (r266282) +++ head/usr.sbin/jail/jail.8 Sat May 17 02:53:10 2014 (r266283) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 12, 2013 +.Dd May 16, 2014 .Dt JAIL 8 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Sat May 17 03:05:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CF7FE5A; Sat, 17 May 2014 03:05:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5ADFA24ED; Sat, 17 May 2014 03:05:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4H35rI1031293; Sat, 17 May 2014 03:05:53 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4H35r9J031292; Sat, 17 May 2014 03:05:53 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201405170305.s4H35r9J031292@svn.freebsd.org> From: Benjamin Kaduk Date: Sat, 17 May 2014 03:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266285 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 03:05:53 -0000 Author: bjk (doc committer) Date: Sat May 17 03:05:52 2014 New Revision: 266285 URL: http://svnweb.freebsd.org/changeset/base/266285 Log: Correct documentation of the limit on how much memory can be mlock()ed vm.max_wired is a system-wide limit, not per-process. Reword the section to make this more clear. PR: docs/189214 Submitted by: Lawrence Chen (original text) Approved by: hrs (mentor) Modified: head/lib/libc/sys/mlock.2 Modified: head/lib/libc/sys/mlock.2 ============================================================================== --- head/lib/libc/sys/mlock.2 Sat May 17 03:03:17 2014 (r266284) +++ head/lib/libc/sys/mlock.2 Sat May 17 03:05:52 2014 (r266285) @@ -28,7 +28,7 @@ .\" @(#)mlock.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd March 18, 2013 +.Dd May 17, 2014 .Dt MLOCK 2 .Os .Sh NAME @@ -91,14 +91,21 @@ Locked mappings are not inherited by the .Pp Since physical memory is a potentially scarce resource, processes are limited in how much they can lock down. -A single process can +The amount of memory that a single process can .Fn mlock -the minimum of -a system-wide ``wired pages'' limit -.Va vm.max_wired -and the per-process +is limited by both the per-process .Li RLIMIT_MEMLOCK -resource limit. +resource limit and the +system-wide +.Dq wired pages +limit +.Va vm.max_wired . +.Va vm.max_wired +applies to the system as a whole, so the amount available to a single +process at any given time is the difference between +.Va vm.max_wired +and +.Va vm.stats.vm.v_wire_count . .Pp If .Va security.bsd.unprivileged_mlock From owner-svn-src-head@FreeBSD.ORG Sat May 17 03:39:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C22CCEB; Sat, 17 May 2014 03:39:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49B8827A1; Sat, 17 May 2014 03:39:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4H3dvDo050944; Sat, 17 May 2014 03:39:57 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4H3dv2j050943; Sat, 17 May 2014 03:39:57 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201405170339.s4H3dv2j050943@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sat, 17 May 2014 03:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266291 - head/lib/libfetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 03:39:57 -0000 Author: des Date: Sat May 17 03:39:56 2014 New Revision: 266291 URL: http://svnweb.freebsd.org/changeset/base/266291 Log: Look for root certificates in /usr/local/etc/ssl before /etc/ssl. MFH: 1 week Modified: head/lib/libfetch/common.c Modified: head/lib/libfetch/common.c ============================================================================== --- head/lib/libfetch/common.c Sat May 17 03:28:43 2014 (r266290) +++ head/lib/libfetch/common.c Sat May 17 03:39:56 2014 (r266291) @@ -688,6 +688,8 @@ fetch_ssl_setup_transport_layer(SSL_CTX /* * Configure peer verification based on environment. */ +#define LOCAL_CERT_FILE "/usr/local/etc/ssl/cert.pem" +#define BASE_CERT_FILE "/etc/ssl/cert.pem" static int fetch_ssl_setup_peer_verification(SSL_CTX *ctx, int verbose) { @@ -696,8 +698,12 @@ fetch_ssl_setup_peer_verification(SSL_CT const char *ca_cert_file, *ca_cert_path, *crl_file; if (getenv("SSL_NO_VERIFY_PEER") == NULL) { - ca_cert_file = getenv("SSL_CA_CERT_FILE") != NULL ? - getenv("SSL_CA_CERT_FILE") : "/etc/ssl/cert.pem"; + ca_cert_file = getenv("SSL_CA_CERT_FILE"); + if (ca_cert_file == NULL && + access(LOCAL_CERT_FILE, R_OK) == 0) + ca_cert_file = LOCAL_CERT_FILE; + if (ca_cert_file == NULL) + ca_cert_file = BASE_CERT_FILE; ca_cert_path = getenv("SSL_CA_CERT_PATH"); if (verbose) { fetch_info("Peer verification enabled"); From owner-svn-src-head@FreeBSD.ORG Sat May 17 03:50:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 138821EB for ; Sat, 17 May 2014 03:50:38 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D66BC286A for ; Sat, 17 May 2014 03:50:37 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s4H3obR0097669 for ; Sat, 17 May 2014 03:50:37 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s4H3obkd097666 for svn-src-head@freebsd.org; Sat, 17 May 2014 03:50:37 GMT (envelope-from bdrewery) Received: (qmail 51595 invoked from network); 16 May 2014 22:50:35 -0500 Received: from unknown (HELO roundcube.xk42.net) (10.10.5.5) by sweb.xzibition.com with SMTP; 16 May 2014 22:50:35 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Fri, 16 May 2014 23:50:34 -0400 From: Bryan Drewery To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r266291 - head/lib/libfetch Organization: FreeBSD In-Reply-To: <201405170339.s4H3dv2j050943@svn.freebsd.org> References: <201405170339.s4H3dv2j050943@svn.freebsd.org> Message-ID: <511c8ee74b80cf5d7f6af531bfda3b18@shatow.net> X-Sender: bdrewery@FreeBSD.org User-Agent: Roundcube Webmail/0.9.5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 03:50:38 -0000 Thanks! This is really needed for 9.3 for ports. So I hope re@ doesn't mind if it comes in after the freeze. Thanks, Bryan On 2014-05-16 23:39, Dag-Erling Smørgrav wrote: > Author: des > Date: Sat May 17 03:39:56 2014 > New Revision: 266291 > URL: http://svnweb.freebsd.org/changeset/base/266291 > > Log: > Look for root certificates in /usr/local/etc/ssl before /etc/ssl. > > MFH: 1 week > > Modified: > head/lib/libfetch/common.c > > Modified: head/lib/libfetch/common.c > ============================================================================== > --- head/lib/libfetch/common.c Sat May 17 03:28:43 2014 (r266290) > +++ head/lib/libfetch/common.c Sat May 17 03:39:56 2014 (r266291) > @@ -688,6 +688,8 @@ fetch_ssl_setup_transport_layer(SSL_CTX > /* > * Configure peer verification based on environment. > */ > +#define LOCAL_CERT_FILE "/usr/local/etc/ssl/cert.pem" > +#define BASE_CERT_FILE "/etc/ssl/cert.pem" > static int > fetch_ssl_setup_peer_verification(SSL_CTX *ctx, int verbose) > { > @@ -696,8 +698,12 @@ fetch_ssl_setup_peer_verification(SSL_CT > const char *ca_cert_file, *ca_cert_path, *crl_file; > > if (getenv("SSL_NO_VERIFY_PEER") == NULL) { > - ca_cert_file = getenv("SSL_CA_CERT_FILE") != NULL ? > - getenv("SSL_CA_CERT_FILE") : "/etc/ssl/cert.pem"; > + ca_cert_file = getenv("SSL_CA_CERT_FILE"); > + if (ca_cert_file == NULL && > + access(LOCAL_CERT_FILE, R_OK) == 0) > + ca_cert_file = LOCAL_CERT_FILE; > + if (ca_cert_file == NULL) > + ca_cert_file = BASE_CERT_FILE; > ca_cert_path = getenv("SSL_CA_CERT_PATH"); > if (verbose) { > fetch_info("Peer verification enabled"); -- Regards, Bryan Drewery From owner-svn-src-head@FreeBSD.ORG Sat May 17 03:54:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 366D0388; Sat, 17 May 2014 03:54:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1788628FD; Sat, 17 May 2014 03:54:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4H3sq61062338; Sat, 17 May 2014 03:54:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4H3sqgI062328; Sat, 17 May 2014 03:54:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405170354.s4H3sqgI062328@svn.freebsd.org> From: John Baldwin Date: Sat, 17 May 2014 03:54:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266293 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 03:54:53 -0000 Author: jhb Date: Sat May 17 03:54:51 2014 New Revision: 266293 URL: http://svnweb.freebsd.org/changeset/base/266293 Log: - Add support for dumping current resource usage for processes via a new -r flag to procstat. - Add an -H flag to request information about threads rather than processes when dumping statistics. Currently it is only used for -r to display resource usage for individual threads instead of the entire process. Reviewed by: kib (older version without -H) MFC after: 1 month Added: head/usr.bin/procstat/procstat_rusage.c (contents, props changed) Modified: head/usr.bin/procstat/Makefile head/usr.bin/procstat/procstat.1 head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat.h Modified: head/usr.bin/procstat/Makefile ============================================================================== --- head/usr.bin/procstat/Makefile Sat May 17 03:49:29 2014 (r266292) +++ head/usr.bin/procstat/Makefile Sat May 17 03:54:51 2014 (r266293) @@ -11,6 +11,7 @@ SRCS= procstat.c \ procstat_files.c \ procstat_kstack.c \ procstat_rlimit.c \ + procstat_rusage.c \ procstat_sigs.c \ procstat_threads.c \ procstat_vm.c Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Sat May 17 03:49:29 2014 (r266292) +++ head/usr.bin/procstat/procstat.1 Sat May 17 03:54:51 2014 (r266293) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 11, 2014 +.Dd May 16, 2014 .Dt PROCSTAT 1 .Os .Sh NAME @@ -33,11 +33,9 @@ .Nd get detailed process information .Sh SYNOPSIS .Nm -.Op Fl h -.Op Fl n -.Op Fl C +.Op Fl CHhn .Op Fl w Ar interval -.Op Fl b | c | e | f | i | j | k | l | s | t | v | x +.Op Fl b | c | e | f | i | j | k | l | r | s | t | v | x .Op Fl a | Ar pid | Ar core ... .Sh DESCRIPTION The @@ -73,6 +71,8 @@ If the flag is repeated, function offset printed. .It Fl l Display resource limits for the process. +.It Fl r +Display resource usage information for the process. .It Fl s Display security credential information for the process. .It Fl t @@ -102,6 +102,13 @@ The flag requests the printing of additional capability information in the file descriptor view. .Pp +The +.Fl H +flag may be used to request per-thread statistics rather than per-process +statistics for some options. +For those options, the second field in the table will list the thread ID +to which the row of information corresponds. +.Pp Some information, such as VM and file descriptor information, is available only to the owner of a process or the superuser. .Ss Binary Information Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Sat May 17 03:49:29 2014 (r266292) +++ head/usr.bin/procstat/procstat.c Sat May 17 03:54:51 2014 (r266293) @@ -39,18 +39,19 @@ #include "procstat.h" -static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag, lflag, sflag; -static int tflag, vflag, xflag; -int hflag, nflag, Cflag; +static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag, lflag, rflag; +static int sflag, tflag, vflag, xflag; +int hflag, nflag, Cflag, Hflag; static void usage(void) { - fprintf(stderr, "usage: procstat [-h] [-C] [-M core] [-N system] " + fprintf(stderr, "usage: procstat [-CHhn] [-M core] [-N system] " "[-w interval] \n"); fprintf(stderr, " [-b | -c | -e | -f | -i | -j | -k | " - "-l | -s | -t | -v | -x] [-a | pid | core ...]\n"); + "-l | -r | -s | -t | -v | -x]\n"); + fprintf(stderr, " [-a | pid | core ...]\n"); exit(EX_USAGE); } @@ -74,6 +75,8 @@ procstat(struct procstat *prstat, struct procstat_kstack(prstat, kipp, kflag); else if (lflag) procstat_rlimit(prstat, kipp); + else if (rflag) + procstat_rusage(prstat, kipp); else if (sflag) procstat_cred(prstat, kipp); else if (tflag) @@ -125,12 +128,16 @@ main(int argc, char *argv[]) interval = 0; memf = nlistf = NULL; - while ((ch = getopt(argc, argv, "CN:M:abcefijklhstvw:x")) != -1) { + while ((ch = getopt(argc, argv, "CHN:M:abcefijklhrstvw:x")) != -1) { switch (ch) { case 'C': Cflag++; break; + case 'H': + Hflag++; + break; + case 'M': memf = optarg; break; @@ -181,6 +188,10 @@ main(int argc, char *argv[]) hflag++; break; + case 'r': + rflag++; + break; + case 's': sflag++; break; @@ -217,7 +228,7 @@ main(int argc, char *argv[]) /* We require that either 0 or 1 mode flags be set. */ tmp = bflag + cflag + eflag + fflag + iflag + jflag + (kflag ? 1 : 0) + - lflag + sflag + tflag + vflag + xflag; + lflag + rflag + sflag + tflag + vflag + xflag; if (!(tmp == 0 || tmp == 1)) usage(); Modified: head/usr.bin/procstat/procstat.h ============================================================================== --- head/usr.bin/procstat/procstat.h Sat May 17 03:49:29 2014 (r266292) +++ head/usr.bin/procstat/procstat.h Sat May 17 03:54:51 2014 (r266293) @@ -29,7 +29,7 @@ #ifndef PROCSTAT_H #define PROCSTAT_H -extern int hflag, nflag, Cflag; +extern int hflag, nflag, Cflag, Hflag; struct kinfo_proc; void kinfo_proc_sort(struct kinfo_proc *kipp, int count); @@ -44,6 +44,7 @@ void procstat_files(struct procstat *prs void procstat_kstack(struct procstat *prstat, struct kinfo_proc *kipp, int kflag); void procstat_rlimit(struct procstat *prstat, struct kinfo_proc *kipp); +void procstat_rusage(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_sigs(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_threads(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_threads_sigs(struct procstat *prstat, struct kinfo_proc *kipp); Added: head/usr.bin/procstat/procstat_rusage.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/procstat/procstat_rusage.c Sat May 17 03:54:51 2014 (r266293) @@ -0,0 +1,160 @@ +/*- + * Copyright (c) 2012 Advanced Computing Technologies LLC + * Written by: John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include + +#include "procstat.h" + +static struct { + const char *ri_name; + bool ri_humanize; + int ri_scale; +} rusage_info[] = { + { "maximum RSS", true, 1 }, + { "integral shared memory", true, 1 }, + { "integral unshared data", true, 1 }, + { "integral unshared stack", true, 1 }, + { "page reclaims", false, 0 }, + { "page faults", false, 0 }, + { "swaps", false, 0 }, + { "block reads", false, 0 }, + { "block writes", false, 0 }, + { "messages sent", false, 0 }, + { "messages received", false, 0 }, + { "signals received", false, 0 }, + { "voluntary context switches", false, 0 }, + { "involuntary context switches", false, 0 } +}; + +/* xxx days hh:mm:ss.uuuuuu */ +static const char * +format_time(struct timeval *tv) +{ + static char buffer[32]; + int days, hours, minutes, seconds, used; + + minutes = tv->tv_sec / 60; + seconds = tv->tv_sec % 60; + hours = minutes / 60; + minutes %= 60; + days = hours / 24; + hours %= 24; + used = 0; + if (days == 1) + used += snprintf(buffer, sizeof(buffer), "1 day "); + else if (days > 0) + used += snprintf(buffer, sizeof(buffer), "%u days ", days); + + snprintf(buffer + used, sizeof(buffer) - used, "%02u:%02u:%02u.%06u ", + hours, minutes, seconds, (unsigned int)tv->tv_usec); + return (buffer); +} + +static const char * +format_value(long value, bool humanize, int scale) +{ + static char buffer[14]; + + if (scale != 0) + value <<= scale * 10; + if (humanize) + humanize_number(buffer, sizeof(buffer), value, "B", + scale, HN_DECIMAL); + else + snprintf(buffer, sizeof(buffer), "%ld ", value); + return (buffer); +} + +static void +print_prefix(struct kinfo_proc *kipp) +{ + + printf("%5d ", kipp->ki_pid); + if (Hflag) + printf("%6d ", kipp->ki_tid); + printf("%-16s ", kipp->ki_comm); +} + +static void +print_rusage(struct kinfo_proc *kipp) +{ + long *lp; + unsigned int i; + + print_prefix(kipp); + printf("%-14s %32s\n", "user time", + format_time(&kipp->ki_rusage.ru_utime)); + print_prefix(kipp); + printf("%-14s %32s\n", "system time", + format_time(&kipp->ki_rusage.ru_stime)); + lp = &kipp->ki_rusage.ru_maxrss; + for (i = 0; i < nitems(rusage_info); i++) { + print_prefix(kipp); + printf("%-32s %14s\n", rusage_info[i].ri_name, + format_value(*lp, rusage_info[i].ri_humanize, + rusage_info[i].ri_scale)); + lp++; + } +} + +void +procstat_rusage(struct procstat *procstat, struct kinfo_proc *kipp) +{ + struct kinfo_proc *kip; + unsigned int count, i; + + if (!hflag) { + printf("%5s ", "PID"); + if (Hflag) + printf("%6s ", "TID"); + printf("%-16s %-32s %14s\n", "COMM", "TYPE", "VALUE "); + } + + if (!Hflag) { + print_rusage(kipp); + return; + } + + kip = procstat_getprocs(procstat, KERN_PROC_PID | KERN_PROC_INC_THREAD, + kipp->ki_pid, &count); + if (kip == NULL) + return; + kinfo_proc_sort(kip, count); + for (i = 0; i < count; i++) + print_rusage(&kip[i]); + procstat_freeprocs(procstat, kip); +} From owner-svn-src-head@FreeBSD.ORG Sat May 17 04:04:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BEF608AB; Sat, 17 May 2014 04:04:52 +0000 (UTC) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 73DB929B5; Sat, 17 May 2014 04:04:52 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 4185E3C5F7C; Sat, 17 May 2014 14:04:49 +1000 (EST) Date: Sat, 17 May 2014 14:04:48 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= Subject: Re: svn commit: r266238 - head/contrib/ldns/ldns In-Reply-To: <86ppjdjg2c.fsf@nine.des.no> Message-ID: <20140517123901.I1213@besplex.bde.org> References: <201405161532.s4GFWGvh006504@svn.freebsd.org> <20140517112645.N925@besplex.bde.org> <86ppjdjg2c.fsf@nine.des.no> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=U6SrU4bu c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=LV8e_ZrhAycA:10 a=JzwRw_2MAAAA:8 a=nlC_4_pT8q9DhB4Ho9EA:9 a=cz2ZRIgtxKwA:10 a=wJWlkF7cXJYA:10 a=HtokZ0_NjwZIkMot0iYA:9 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 04:04:52 -0000 On Sat, 17 May 2014, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote: > Bruce Evans writes: >> -Wcast-qual is especially onerous in contrib'ed code written to a lower >> standard. > > Well, I could have just lowered WARNS... LDNS actually isn't that bad. > Unbound is much worse. > >> Converting this to use system endianness conversion functions wouldn't >> take much more churn. > > Do our standard endianness conversion functions handle unaligned > accesses? Yes. They intentionally use pessimal bytewise accesses for everything. However, clang optimizes away all the pessimizations in many useful cases, at last on amd64. This depends on the functions being inline. When clang can see that the pointed-to object is aligned, it generates minimal code (at most a load-store for a null conversion, and I think at most a load-bswap-store for a swapping conversion (I only checked related cases for the latter)). The case where the pointed-to object is just an array of uint8_t is still pessimized. Callers wanting to avoid the pessimal case can avoid it by copying from the array to a local variable. gcc-4-2.1 doesn't optimize away any of the pessimizations. However, in even more complicated conversions in FP code, it optimizes the union hack just as well as clang. Bruce From owner-svn-src-head@FreeBSD.ORG Sat May 17 04:06:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A139ACD; Sat, 17 May 2014 04:06:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3802729C7; Sat, 17 May 2014 04:06:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4H46tnA069217; Sat, 17 May 2014 04:06:55 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4H46se3069216; Sat, 17 May 2014 04:06:55 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405170406.s4H46se3069216@svn.freebsd.org> From: John Baldwin Date: Sat, 17 May 2014 04:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266296 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 04:06:55 -0000 Author: jhb Date: Sat May 17 04:06:54 2014 New Revision: 266296 URL: http://svnweb.freebsd.org/changeset/base/266296 Log: Correct some minor nits in the per-thread signal format description such as missing posessives and misordering of fields. MFC after: 1 week Modified: head/usr.bin/procstat/procstat.1 Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Sat May 17 04:00:18 2014 (r266295) +++ head/usr.bin/procstat/procstat.1 Sat May 17 04:06:54 2014 (r266296) @@ -63,7 +63,7 @@ Display file descriptor information for .It Fl i Display signal pending and disposition information for the process. .It Fl j -Display signal pending and blocked information for the process threads. +Display signal pending and blocked information for the process's threads. .It Fl k Display the stacks of kernel threads in the process, excluding stacks of threads currently running on a CPU and threads with stacks swapped to disk. @@ -267,15 +267,15 @@ If .Fl n switch is given, the signal numbers are shown instead of signal names. .Ss Thread Signal Information -Display signal pending and blocked for a process threads: +Display signal pending and blocked for a process's threads: .Pp .Bl -tag -width ident -compact .It PID process ID -.It COMM -command .It TID thread ID +.It COMM +command .It SIG signal name .It FLAGS @@ -292,7 +292,7 @@ The .Fl n switch has the same effect as for the .Fl i -switch, the signals numbers are shown instead of signal names. +switch: the signal numbers are shown instead of signal names. .Ss Kernel Thread Stacks Display kernel thread stacks for a process, allowing further interpretation of thread wait channels. From owner-svn-src-head@FreeBSD.ORG Sat May 17 04:12:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC48AD00 for ; Sat, 17 May 2014 04:12:38 +0000 (UTC) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DA692A62 for ; Sat, 17 May 2014 04:12:38 +0000 (UTC) Received: by mail-pa0-f43.google.com with SMTP id hz1so3363633pad.30 for ; Fri, 16 May 2014 21:12:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=TJLDxsjiT0H1QK5FW9Qu21X02q5cW/wq9eJYM41+FVA=; b=YVy5X96H7JO/eWdUqhlD5HXhGwLUnteB40mSTwosyUjf7nyLne725ncFm+IV4QSkhG L8USgkqQ6fXYYKCfQ5oDhVxBpgkTjZQE0EQE2RdpvpS8HsXfrbV3wVvWkGKY1Oqq2aHF upgtC5a927x+MUBeC5IuiUwveWatQAhR0tMjULC7a6UBP9NbIcJRmyN+qwR0AT7Rs3k2 UVxOXaIq8T4LHCFkcSf8kJS6AYrzIPTJwgvjKTuHZvtOKdlm4vA6ubgHp32N0pJ26hoy DYvTcM59pVhPc9nySnawNoa9jNLUfkACSKxokmEMETjSzYiA/S/fVnezHFmm8XkfcDSZ l9Ow== X-Gm-Message-State: ALoCoQnPrU/hI3979xEH21kgI7kxtowGo+/62aI43DHZVla4zc/p4jsfUq84ZqXqQOaX3RWlmZza X-Received: by 10.68.193.100 with SMTP id hn4mr26024747pbc.50.1400299497836; Fri, 16 May 2014 21:04:57 -0700 (PDT) Received: from [10.64.24.248] (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id qv3sm17317048pbb.87.2014.05.16.21.04.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 May 2014 21:04:57 -0700 (PDT) Sender: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r266238 - head/contrib/ldns/ldns From: Warner Losh In-Reply-To: <86ppjdjg2c.fsf@nine.des.no> Date: Sat, 17 May 2014 00:04:43 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <4A83A11B-EFDD-46C5-B9D4-D81EBD4FAAAE@gmail.com> References: <201405161532.s4GFWGvh006504@svn.freebsd.org> <20140517112645.N925@besplex.bde.org> <86ppjdjg2c.fsf@nine.des.no> To: =?windows-1252?Q?Dag-Erling_Sm=F8rgrav?= X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 04:12:38 -0000 On May 16, 2014, at 10:26 PM, Dag-Erling Sm=F8rgrav wrote: > Bruce Evans writes: >> -Wcast-qual is especially onerous in contrib'ed code written to a = lower >> standard. >=20 > Well, I could have just lowered WARNS... LDNS actually isn't that = bad. > Unbound is much worse. >=20 >> Converting this to use system endianness conversion functions = wouldn't >> take much more churn. >=20 > Do our standard endianness conversion functions handle unaligned > accesses? No. The warning appears to be telling us something that=92s being = papered over. Warner From owner-svn-src-head@FreeBSD.ORG Sat May 17 04:29:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C5FC7FE; Sat, 17 May 2014 04:29:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3C462BF9; Sat, 17 May 2014 04:29:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4H4TEZo082155; Sat, 17 May 2014 04:29:14 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4H4TEeZ082154; Sat, 17 May 2014 04:29:14 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201405170429.s4H4TEeZ082154@svn.freebsd.org> From: Devin Teske Date: Sat, 17 May 2014 04:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266297 - head/usr.sbin/bsdconfig/share/media X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 04:29:14 -0000 Author: dteske Date: Sat May 17 04:29:14 2014 New Revision: 266297 URL: http://svnweb.freebsd.org/changeset/base/266297 Log: Update example portion of comment to coincide with r264840 changes. MFC after: 3 days Modified: head/usr.sbin/bsdconfig/share/media/common.subr Modified: head/usr.sbin/bsdconfig/share/media/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/common.subr Sat May 17 04:06:54 2014 (r266296) +++ head/usr.sbin/bsdconfig/share/media/common.subr Sat May 17 04:29:14 2014 (r266297) @@ -44,7 +44,8 @@ MOUNTPOINT=/dist # # Media probe values to use for `f_media_get_TYPE media $file $PROBE' or -# `f_device_get media $file $PROBE' (where $PROBE is one of the below values). +# `f_device_get device_media $file $PROBE' (where $PROBE is one of the below +# values). # PROBE_EXIST=1 PROBE_SIZE=2 From owner-svn-src-head@FreeBSD.ORG Sat May 17 11:27:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71CD07B6; Sat, 17 May 2014 11:27:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 525DC27C9; Sat, 17 May 2014 11:27:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HBReU2035268; Sat, 17 May 2014 11:27:40 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HBRbc3035247; Sat, 17 May 2014 11:27:37 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201405171127.s4HBRbc3035247@svn.freebsd.org> From: Andrew Turner Date: Sat, 17 May 2014 11:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266301 - in head/sys: arm/allwinner arm/arm arm/broadcom/bcm2835 arm/conf arm/freescale/imx arm/freescale/vybrid arm/include arm/lpc arm/mv arm/rockchip arm/samsung/exynos arm/tegra ar... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 11:27:40 -0000 Author: andrew Date: Sat May 17 11:27:36 2014 New Revision: 266301 URL: http://svnweb.freebsd.org/changeset/base/266301 Log: Add the start of the ARM platform code. This is based on the PowerPC platform code, it is expected these will be merged in the future when the ARM code is more complete. Until more boards can be tested only use this with the Raspberry Pi and rrename the functions on the other SoCs. Reviewed by: ian@ Added: head/sys/arm/arm/platform.c (contents, props changed) head/sys/arm/arm/platform_if.m (contents, props changed) head/sys/arm/include/platform.h (contents, props changed) head/sys/arm/include/platformvar.h (contents, props changed) head/sys/dev/fdt/fdt_arm_platform.c (contents, props changed) Modified: head/sys/arm/allwinner/a10_machdep.c head/sys/arm/arm/machdep.c head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c head/sys/arm/conf/RPI-B head/sys/arm/freescale/imx/imx51_machdep.c head/sys/arm/freescale/imx/imx53_machdep.c head/sys/arm/freescale/imx/imx6_machdep.c head/sys/arm/freescale/vybrid/vf_machdep.c head/sys/arm/include/machdep.h head/sys/arm/lpc/lpc_machdep.c head/sys/arm/mv/mv_machdep.c head/sys/arm/rockchip/rk30xx_machdep.c head/sys/arm/samsung/exynos/exynos5_machdep.c head/sys/arm/tegra/tegra2_machdep.c head/sys/arm/ti/ti_machdep.c head/sys/arm/versatile/versatile_machdep.c head/sys/arm/xilinx/zy7_machdep.c head/sys/conf/files.arm head/sys/conf/options.arm Modified: head/sys/arm/allwinner/a10_machdep.c ============================================================================== --- head/sys/arm/allwinner/a10_machdep.c Sat May 17 11:26:54 2014 (r266300) +++ head/sys/arm/allwinner/a10_machdep.c Sat May 17 11:27:36 2014 (r266301) @@ -45,30 +45,31 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include vm_offset_t -initarm_lastaddr(void) +platform_lastaddr(void) { return (arm_devmap_lastaddr()); } void -initarm_early_init(void) +platform_probe_and_attach(void) { } void -initarm_gpio_init(void) +platform_gpio_init(void) { } void -initarm_late_init(void) +platform_late_init(void) { } @@ -83,7 +84,7 @@ initarm_late_init(void) * perhaps a 1MB block would be more appropriate. */ int -initarm_devmap_init(void) +platform_devmap_init(void) { arm_devmap_add_entry(0x01C00000, 0x00400000); /* 4MB */ Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat May 17 11:26:54 2014 (r266300) +++ head/sys/arm/arm/machdep.c Sat May 17 11:27:36 2014 (r266301) @@ -98,6 +98,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1091,7 +1092,7 @@ initarm(struct arm_boot_params *abp) EXFLAG_NODUMP | EXFLAG_NOALLOC); /* Platform-specific initialisation */ - initarm_early_init(); + platform_probe_and_attach(); pcpu0_init(); @@ -1207,9 +1208,9 @@ initarm(struct arm_boot_params *abp) VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE, PTE_CACHE); /* Establish static device mappings. */ - err_devmap = initarm_devmap_init(); + err_devmap = platform_devmap_init(); arm_devmap_bootstrap(l1pagetable, NULL); - vm_max_kernel_address = initarm_lastaddr(); + vm_max_kernel_address = platform_lastaddr(); cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | DOMAIN_CLIENT); pmap_pa = kernel_l1pt.pv_pa; @@ -1229,7 +1230,7 @@ initarm(struct arm_boot_params *abp) */ OF_interpret("perform-fixup", 0); - initarm_gpio_init(); + platform_gpio_init(); cninit(); @@ -1247,7 +1248,7 @@ initarm(struct arm_boot_params *abp) printf("WARNING: could not fully configure devmap, error=%d\n", err_devmap); - initarm_late_init(); + platform_late_init(); /* * Pages were allocated during the secondary bootstrap for the Added: head/sys/arm/arm/platform.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/platform.c Sat May 17 11:27:36 2014 (r266301) @@ -0,0 +1,179 @@ +/*- + * Copyright (c) 2005 Peter Grehan + * Copyright (c) 2009 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Dispatch platform calls to the appropriate platform implementation + * through a previously registered kernel object. + */ + +#define _ARM32_BUS_DMA_PRIVATE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "platform_if.h" + +static platform_def_t *plat_def_impl; +static platform_t plat_obj; +static struct kobj_ops plat_kernel_kops; +static struct platform_kobj plat_kernel_obj; + +static char plat_name[64] = ""; +SYSCTL_STRING(_hw, OID_AUTO, platform, CTLFLAG_RDTUN, plat_name, 0, + "Platform currently in use"); + +/* + * Platform install routines. Highest priority wins, using the same + * algorithm as bus attachment. + */ +SET_DECLARE(platform_set, platform_def_t); + +void +platform_probe_and_attach(void) +{ + platform_def_t **platpp, *platp; + int prio, best_prio; + + plat_obj = &plat_kernel_obj; + best_prio = 0; + + /* + * We are unable to use TUNABLE_STR as the read will happen + * well after this function has returned. + */ + TUNABLE_STR_FETCH("hw.platform", plat_name, sizeof(plat_name)); + + /* + * Try to locate the best platform kobj + */ + SET_FOREACH(platpp, platform_set) { + platp = *platpp; + + /* + * Take care of compiling the selected class, and + * then statically initialise the MMU object + */ + kobj_class_compile_static(platp, &plat_kernel_kops); + kobj_init_static((kobj_t)plat_obj, platp); + + plat_obj->cls = platp; + + prio = PLATFORM_PROBE(plat_obj); + + /* Check for errors */ + if (prio > 0) + continue; + + /* + * Check if this module was specifically requested through + * the loader tunable we provide. + */ + if (strcmp(platp->name,plat_name) == 0) { + plat_def_impl = platp; + break; + } + + /* Otherwise, see if it is better than our current best */ + if (plat_def_impl == NULL || prio > best_prio) { + best_prio = prio; + plat_def_impl = platp; + } + + /* + * We can't free the KOBJ, since it is static. Reset the ops + * member of this class so that we can come back later. + */ + platp->ops = NULL; + } + + if (plat_def_impl == NULL) + panic("No platform module found!"); + + /* + * Recompile to make sure we ended with the + * correct one, and then attach. + */ + + kobj_class_compile_static(plat_def_impl, &plat_kernel_kops); + kobj_init_static((kobj_t)plat_obj, plat_def_impl); + + strlcpy(plat_name,plat_def_impl->name,sizeof(plat_name)); + + PLATFORM_ATTACH(plat_obj); +} + +int +platform_devmap_init(void) +{ + + return PLATFORM_DEVMAP_INIT(plat_obj); +} + +vm_offset_t +platform_lastaddr(void) +{ + + return PLATFORM_LASTADDR(plat_obj); +} + +void +platform_gpio_init(void) +{ + + PLATFORM_GPIO_INIT(plat_obj); +} + +void +platform_late_init(void) +{ + + PLATFORM_LATE_INIT(plat_obj); +} + Added: head/sys/arm/arm/platform_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/platform_if.m Sat May 17 11:27:36 2014 (r266301) @@ -0,0 +1,116 @@ +#- +# Copyright (c) 2009 Nathan Whitehorn +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +/** + * @defgroup PLATFORM platform - KObj methods for ARM platform + * implementations + * @brief A set of methods required by all platform implementations. + * These are used to bring up secondary CPUs, supply the physical memory + * map, etc. + *@{ + */ + +INTERFACE platform; + +# +# Default implementations +# +CODE { + static void platform_null_attach(platform_t plat) + { + return; + } +}; + +/** + * @brief Probe for whether we are on this platform, returning the standard + * newbus probe codes. If we have Open Firmware or a flattened device tree, + * it is guaranteed to be available at this point. + */ +METHOD int probe { + platform_t _plat; +}; + +/** + * @brief Attach this platform module. This happens before the MMU is online, + * so the platform module can install its own high-priority MMU module at + * this point. + */ +METHOD int attach { + platform_t _plat; +} DEFAULT platform_null_attach; + +/** + * @brief Called as one of the last steps of early virtual memory + * initialization, shortly before the new page tables are installed. + */ +METHOD int devmap_init { + platform_t _plat; +}; + +/** + * @brief Called after devmap_init(), and must return the address of the + * first byte of unusable KVA space. This allows a platform to carve out + * of the top of the KVA space whatever reserves it needs for things like + * static device mapping, and this is called to get the value before + * calling pmap_bootstrap() which uses the value to size the available KVA. + */ +METHOD vm_offset_t lastaddr { + platform_t _plat; +}; + +/** + * @brief Called after the static device mappings are established and just + * before cninit(). The intention is that the routine can do any hardware + * setup (such as gpio or pinmux) necessary to make the console functional. + */ +METHOD void gpio_init { + platform_t _plat; +}; + +/** + * @brief Called just after cninit(). This is the first of the init + * routines that can use printf() and expect the output to appear on + * a standard console. + */ +METHOD void late_init { + platform_t _plat; +}; + Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sat May 17 11:26:54 2014 (r266300) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sat May 17 11:27:36 2014 (r266301) @@ -54,31 +54,24 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include -vm_offset_t -initarm_lastaddr(void) -{ - - return (arm_devmap_lastaddr()); -} +#include "platform_if.h" -void -initarm_early_init(void) +static vm_offset_t +bcm2835_lastaddr(platform_t plat) { + return (arm_devmap_lastaddr()); } -void -initarm_gpio_init(void) -{ -} - -void -initarm_late_init(void) +static void +bcm2835_late_init(platform_t plat) { phandle_t system; pcell_t cells[2]; @@ -101,8 +94,8 @@ initarm_late_init(void) * All on-chip peripherals exist in a 16MB range starting at 0x20000000. * Map the entire range using 1MB section mappings. */ -int -initarm_devmap_init(void) +static int +bcm2835_devmap_init(platform_t plat) { arm_devmap_add_entry(0x20000000, 0x01000000); @@ -129,4 +122,13 @@ cpu_reset() bcmwd_watchdog_reset(); while (1); } +static platform_method_t bcm2835_methods[] = { + PLATFORMMETHOD(platform_devmap_init, bcm2835_devmap_init), + PLATFORMMETHOD(platform_lastaddr, bcm2835_lastaddr), + PLATFORMMETHOD(platform_late_init, bcm2835_late_init), + + PLATFORMMETHOD_END, +}; + +FDT_PLATFORM_DEF(bcm2835, "bcm2835", 0, "raspberrypi,model-b"); Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Sat May 17 11:26:54 2014 (r266300) +++ head/sys/arm/conf/RPI-B Sat May 17 11:27:36 2014 (r266301) @@ -59,6 +59,7 @@ options KBD_INSTALL_CDEV # install a CD #options ROOTDEVNAME=\"ufs:mmcsd0s2\" options PREEMPTION +options PLATFORM device bpf device loop Modified: head/sys/arm/freescale/imx/imx51_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_machdep.c Sat May 17 11:26:54 2014 (r266300) +++ head/sys/arm/freescale/imx/imx51_machdep.c Sat May 17 11:27:36 2014 (r266301) @@ -39,18 +39,19 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include vm_offset_t -initarm_lastaddr(void) +platform_lastaddr(void) { return (arm_devmap_lastaddr()); } void -initarm_early_init(void) +platform_probe_and_attach(void) { /* XXX - Get rid of this stuff soon. */ @@ -59,13 +60,13 @@ initarm_early_init(void) } void -initarm_gpio_init(void) +platform_gpio_init(void) { } void -initarm_late_init(void) +platform_late_init(void) { } @@ -78,7 +79,7 @@ initarm_late_init(void) * Notably missing are entries for GPU, IPU, in general anything video related. */ int -initarm_devmap_init(void) +platform_devmap_init(void) { arm_devmap_add_entry(0x70000000, 0x00100000); Modified: head/sys/arm/freescale/imx/imx53_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx53_machdep.c Sat May 17 11:26:54 2014 (r266300) +++ head/sys/arm/freescale/imx/imx53_machdep.c Sat May 17 11:27:36 2014 (r266301) @@ -39,17 +39,19 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + #include vm_offset_t -initarm_lastaddr(void) +platform_lastaddr(void) { return (arm_devmap_lastaddr()); } void -initarm_early_init(void) +platform_probe_and_attach(void) { /* XXX - Get rid of this stuff soon. */ @@ -58,13 +60,13 @@ initarm_early_init(void) } void -initarm_gpio_init(void) +platform_gpio_init(void) { } void -initarm_late_init(void) +platform_late_init(void) { } @@ -77,7 +79,7 @@ initarm_late_init(void) * Notably missing are entries for GPU, IPU, in general anything video related. */ int -initarm_devmap_init(void) +platform_devmap_init(void) { arm_devmap_add_entry(0x50000000, 0x00100000); Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Sat May 17 11:26:54 2014 (r266300) +++ head/sys/arm/freescale/imx/imx6_machdep.c Sat May 17 11:27:36 2014 (r266301) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -46,14 +47,14 @@ __FBSDID("$FreeBSD$"); #include vm_offset_t -initarm_lastaddr(void) +platform_lastaddr(void) { return (arm_devmap_lastaddr()); } void -initarm_early_init(void) +platform_probe_and_attach(void) { /* Inform the MPCore timer driver that its clock is variable. */ @@ -61,13 +62,13 @@ initarm_early_init(void) } void -initarm_gpio_init(void) +platform_gpio_init(void) { } void -initarm_late_init(void) +platform_late_init(void) { } @@ -89,7 +90,7 @@ initarm_late_init(void) * as OCRAM that probably shouldn't be mapped as PTE_DEVICE memory. */ int -initarm_devmap_init(void) +platform_devmap_init(void) { const uint32_t IMX6_ARMMP_PHYS = 0x00a00000; const uint32_t IMX6_ARMMP_SIZE = 0x00100000; Modified: head/sys/arm/freescale/vybrid/vf_machdep.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_machdep.c Sat May 17 11:26:54 2014 (r266300) +++ head/sys/arm/freescale/vybrid/vf_machdep.c Sat May 17 11:27:36 2014 (r266301) @@ -41,36 +41,37 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include vm_offset_t -initarm_lastaddr(void) +platform_lastaddr(void) { return (arm_devmap_lastaddr()); } void -initarm_early_init(void) +platform_probe_and_attach(void) { } void -initarm_gpio_init(void) +platform_gpio_init(void) { } void -initarm_late_init(void) +platform_late_init(void) { } int -initarm_devmap_init(void) +platform_devmap_init(void) { arm_devmap_add_entry(0x40000000, 0x100000); Modified: head/sys/arm/include/machdep.h ============================================================================== --- head/sys/arm/include/machdep.h Sat May 17 11:26:54 2014 (r266300) +++ head/sys/arm/include/machdep.h Sat May 17 11:27:36 2014 (r266301) @@ -34,40 +34,6 @@ vm_offset_t fake_preload_metadata(struct vm_offset_t parse_boot_param(struct arm_boot_params *abp); void arm_generic_initclocks(void); -/* - * Initialization functions called by the common initarm() function in - * arm/machdep.c (but not necessarily from the custom initarm() functions of - * older code). - * - * - initarm_early_init() is called very early, after parsing the boot params - * and after physical memory has been located and sized. - * - * - initarm_devmap_init() is called as one of the last steps of early virtual - * memory initialization, shortly before the new page tables are installed. - * - * - initarm_lastaddr() is called after initarm_devmap_init(), and must return - * the address of the first byte of unusable KVA space. This allows a - * platform to carve out of the top of the KVA space whatever reserves it - * needs for things like static device mapping, and this is called to get the - * value before calling pmap_bootstrap() which uses the value to size the - * available KVA. - * - * - initarm_gpio_init() is called after the static device mappings are - * established and just before cninit(). The intention is that the routine - * can do any hardware setup (such as gpio or pinmux) necessary to make the - * console functional. - * - * - initarm_late_init() is called just after cninit(). This is the first of - * the init routines that can use printf() and expect the output to appear on - * a standard console. - * - */ -void initarm_early_init(void); -int initarm_devmap_init(void); -vm_offset_t initarm_lastaddr(void); -void initarm_gpio_init(void); -void initarm_late_init(void); - /* Board-specific attributes */ void board_set_serial(uint64_t); void board_set_revision(uint32_t); Added: head/sys/arm/include/platform.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/include/platform.h Sat May 17 11:27:36 2014 (r266301) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_PLATFORM_H_ +#define _MACHINE_PLATFORM_H_ + +void platform_probe_and_attach(void); +int platform_devmap_init(void); +vm_offset_t platform_lastaddr(void); +void platform_gpio_init(void); +void platform_late_init(void); + +#endif /* _MACHINE_PLATFORM_H_ */ Added: head/sys/arm/include/platformvar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/include/platformvar.h Sat May 17 11:27:36 2014 (r266301) @@ -0,0 +1,104 @@ +/*- + * Copyright (c) 2005 Peter Grehan + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_PLATFORMVAR_H_ +#define _MACHINE_PLATFORMVAR_H_ + +/* + * An ARM platform implementation is declared with a kernel object and + * an associated method table, similar to a device driver. + * + * e.g. + * + * static platform_method_t bcm2835_methods[] = { + * PLATFORMMETHOD(platform_probe, bcm2835_probe), + * ... + * PLATFORMMETHOD_END + * }; + * + * static platform_def_t bcm3835_platform = { + * "bcm2835", + * bcm2835_methods, + * sizeof(bcm2835_platform_softc), // or 0 if no softc + * }; + * + * PLATFORM_DEF(bcm2835_platform); + */ + +#include +#include + +struct platform_kobj { + /* + * A platform instance is a kernel object + */ + KOBJ_FIELDS; + + /* Platform class, for access to class specific data */ + struct kobj_class *cls; +}; + +typedef struct platform_kobj *platform_t; +typedef struct kobj_class platform_def_t; +#define platform_method_t kobj_method_t + +#define PLATFORMMETHOD KOBJMETHOD +#define PLATFORMMETHOD_END KOBJMETHOD_END + +#define PLATFORM_DEF(name) DATA_SET(platform_set, name) + +#ifdef FDT +struct fdt_platform_class { + KOBJ_CLASS_FIELDS; + + const char *fdt_compatible; +}; + +typedef struct fdt_platform_class fdt_platform_def_t; + +extern platform_method_t fdt_platform_methods[]; + +#define FDT_PLATFORM_DEF(NAME, NAME_STR, size, compatible) \ +static fdt_platform_def_t NAME ## _fdt_platform = { \ + .name = NAME_STR, \ + .methods = fdt_platform_methods, \ + .fdt_compatible = compatible, \ +}; \ +static kobj_class_t NAME ## _baseclasses[] = \ + { (kobj_class_t)&NAME ## _fdt_platform, NULL }; \ +static platform_def_t NAME ## _platform = { \ + NAME_STR, \ + NAME ## _methods, \ + size, \ + NAME ## _baseclasses, \ +}; \ +DATA_SET(platform_set, NAME ## _platform) + +#endif + +#endif /* _MACHINE_PLATFORMVAR_H_ */ Modified: head/sys/arm/lpc/lpc_machdep.c ============================================================================== --- head/sys/arm/lpc/lpc_machdep.c Sat May 17 11:26:54 2014 (r266300) +++ head/sys/arm/lpc/lpc_machdep.c Sat May 17 11:27:36 2014 (r266301) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -60,19 +61,19 @@ __FBSDID("$FreeBSD$"); #include vm_offset_t -initarm_lastaddr(void) +platform_lastaddr(void) { return (arm_devmap_lastaddr()); } void -initarm_early_init(void) +platform_probe_and_attach(void) { } void -initarm_gpio_init(void) +platform_gpio_init(void) { /* @@ -82,7 +83,7 @@ initarm_gpio_init(void) } void -initarm_late_init(void) +platform_late_init(void) { } @@ -92,7 +93,7 @@ initarm_late_init(void) * dts file when this code was converted to arm_devmap_add_entry(). */ int -initarm_devmap_init(void) +platform_devmap_init(void) { arm_devmap_add_entry(LPC_DEV_PHYS_BASE, LPC_DEV_SIZE); Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Sat May 17 11:26:54 2014 (r266300) +++ head/sys/arm/mv/mv_machdep.c Sat May 17 11:27:36 2014 (r266301) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* XXX */ #include /* XXX eventually this should be eliminated */ @@ -201,14 +202,14 @@ moveon: } vm_offset_t -initarm_lastaddr(void) +platform_lastaddr(void) { return (fdt_immr_va); } void -initarm_early_init(void) +platform_probe_and_attach(void) { if (fdt_immr_addr(MV_BASE) != 0) @@ -216,7 +217,7 @@ initarm_early_init(void) } void -initarm_gpio_init(void) +platform_gpio_init(void) { /* @@ -228,7 +229,7 @@ initarm_gpio_init(void) } void -initarm_late_init(void) +platform_late_init(void) { /* * Re-initialise decode windows @@ -297,7 +298,7 @@ out: * Supply a default do-nothing implementation of mv_pci_devmap() via a weak * alias. Many Marvell platforms don't support a PCI interface, but to support * those that do, we end up with a reference to this function below, in - * initarm_devmap_init(). If "device pci" appears in the kernel config, the + * platform_devmap_init(). If "device pci" appears in the kernel config, the * real implementation of this function in arm/mv/mv_pci.c overrides the weak * alias defined here. */ @@ -321,7 +322,7 @@ __weak_reference(mv_default_fdt_pci_devm * Construct pmap_devmap[] with DT-derived config data. */ int -initarm_devmap_init(void) +platform_devmap_init(void) { phandle_t root, child; pcell_t bank_count; Modified: head/sys/arm/rockchip/rk30xx_machdep.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_machdep.c Sat May 17 11:26:54 2014 (r266300) +++ head/sys/arm/rockchip/rk30xx_machdep.c Sat May 17 11:27:36 2014 (r266301) @@ -46,31 +46,32 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include vm_offset_t -initarm_lastaddr(void) +platform_lastaddr(void) { return (arm_devmap_lastaddr()); } void -initarm_early_init(void) +platform_probe_and_attach(void) { } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat May 17 11:29:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBD7EA37; Sat, 17 May 2014 11:29:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B996F27DA; Sat, 17 May 2014 11:29:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HBTiTU035639; Sat, 17 May 2014 11:29:44 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HBTi5t035638; Sat, 17 May 2014 11:29:44 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201405171129.s4HBTi5t035638@svn.freebsd.org> From: Andrew Turner Date: Sat, 17 May 2014 11:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266303 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 11:29:44 -0000 Author: andrew Date: Sat May 17 11:29:44 2014 New Revision: 266303 URL: http://svnweb.freebsd.org/changeset/base/266303 Log: Fix a comment s/initarm_/platform_/ Modified: head/sys/arm/include/devmap.h Modified: head/sys/arm/include/devmap.h ============================================================================== --- head/sys/arm/include/devmap.h Sat May 17 11:29:32 2014 (r266302) +++ head/sys/arm/include/devmap.h Sat May 17 11:29:44 2014 (r266303) @@ -45,7 +45,7 @@ struct arm_devmap_entry { * Return the lowest KVA address used in any entry in the registered devmap * table. This works with whatever table is registered, including the internal * table used by arm_devmap_add_entry() if that routine was used. Platforms can - * implement initarm_lastaddr() by calling this if static device mappings are + * implement platform_lastaddr() by calling this if static device mappings are * their only use of high KVA space. */ vm_offset_t arm_devmap_lastaddr(void); From owner-svn-src-head@FreeBSD.ORG Sat May 17 12:08:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E602A00; Sat, 17 May 2014 12:08:59 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 5D93D2B2B; Sat, 17 May 2014 12:08:59 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id E19ABA492; Sat, 17 May 2014 12:08:56 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id E7F53305C0; Sat, 17 May 2014 14:08:59 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Warner Losh Subject: Re: svn commit: r266238 - head/contrib/ldns/ldns References: <201405161532.s4GFWGvh006504@svn.freebsd.org> <20140517112645.N925@besplex.bde.org> <86ppjdjg2c.fsf@nine.des.no> <4A83A11B-EFDD-46C5-B9D4-D81EBD4FAAAE@gmail.com> Date: Sat, 17 May 2014 14:08:59 +0200 In-Reply-To: <4A83A11B-EFDD-46C5-B9D4-D81EBD4FAAAE@gmail.com> (Warner Losh's message of "Sat, 17 May 2014 00:04:43 -0400") Message-ID: <86lhu0k3ok.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 12:08:59 -0000 Warner Losh writes: > Dag-Erling Sm=C3=B8rgrav writes: > > Do our standard endianness conversion functions handle unaligned > > accesses? > No. The warning appears to be telling us something that=E2=80=99s being > papered over. No, the conversion is fine, they were just casting away the const qualifier before reading from the pointer (or rather, forgetting to preserve the qualifier in the cast). DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Sat May 17 12:30:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C6E31EB; Sat, 17 May 2014 12:30:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FFC62CAC; Sat, 17 May 2014 12:30:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HCUSHZ075154; Sat, 17 May 2014 12:30:28 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HCUSti075153; Sat, 17 May 2014 12:30:28 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201405171230.s4HCUSti075153@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 17 May 2014 12:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266307 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 12:30:28 -0000 Author: glebius Date: Sat May 17 12:30:27 2014 New Revision: 266307 URL: http://svnweb.freebsd.org/changeset/base/266307 Log: o In pf_normalize_ip() we don't need mtag in !(PFRULE_FRAGCROP|PFRULE_FRAGDROP) case. o In the (PFRULE_FRAGCROP|PFRULE_FRAGDROP) case we should allocate mtag if we don't find any. Tested by: Ian FREISLICH Modified: head/sys/netpfil/pf/pf_norm.c Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Sat May 17 11:43:14 2014 (r266306) +++ head/sys/netpfil/pf/pf_norm.c Sat May 17 12:30:27 2014 (r266307) @@ -984,18 +984,6 @@ pf_normalize_ip(struct mbuf **m0, int di if (m == NULL) return (PF_DROP); - /* use mtag from concatenated mbuf chain */ - pd->pf_mtag = pf_find_mtag(m); -#ifdef DIAGNOSTIC - if (pd->pf_mtag == NULL) { - printf("%s: pf_find_mtag returned NULL(1)\n", __func__); - if ((pd->pf_mtag = pf_get_mtag(m)) == NULL) { - m_freem(m); - *m0 = NULL; - goto no_mem; - } - } -#endif if (frag != NULL && (frag->fr_flags & PFFRAG_DROP)) goto drop; @@ -1004,7 +992,8 @@ pf_normalize_ip(struct mbuf **m0, int di /* non-buffering fragment cache (drops or masks overlaps) */ int nomem = 0; - if (dir == PF_OUT && pd->pf_mtag->flags & PF_TAG_FRAGCACHE) { + if (dir == PF_OUT && pd->pf_mtag && + pd->pf_mtag->flags & PF_TAG_FRAGCACHE) { /* * Already passed the fragment cache in the * input direction. If we continued, it would @@ -1033,20 +1022,16 @@ pf_normalize_ip(struct mbuf **m0, int di goto drop; } - /* use mtag from copied and trimmed mbuf chain */ - pd->pf_mtag = pf_find_mtag(m); -#ifdef DIAGNOSTIC - if (pd->pf_mtag == NULL) { - printf("%s: pf_find_mtag returned NULL(2)\n", __func__); - if ((pd->pf_mtag = pf_get_mtag(m)) == NULL) { + if (dir == PF_IN) { + /* Use mtag from copied and trimmed mbuf chain. */ + pd->pf_mtag = pf_get_mtag(m); + if (pd->pf_mtag == NULL) { m_freem(m); *m0 = NULL; goto no_mem; } - } -#endif - if (dir == PF_IN) pd->pf_mtag->flags |= PF_TAG_FRAGCACHE; + } if (frag != NULL && (frag->fr_flags & PFFRAG_DROP)) goto drop; From owner-svn-src-head@FreeBSD.ORG Sat May 17 12:33:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC62D341; Sat, 17 May 2014 12:33:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9F292D32; Sat, 17 May 2014 12:33:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HCXRLK077380; Sat, 17 May 2014 12:33:27 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HCXR6A077379; Sat, 17 May 2014 12:33:27 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201405171233.s4HCXR6A077379@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 17 May 2014 12:33:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266308 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 12:33:27 -0000 Author: glebius Date: Sat May 17 12:33:27 2014 New Revision: 266308 URL: http://svnweb.freebsd.org/changeset/base/266308 Log: Provide compatibility #define after r265408. Suggested by: truckman Modified: head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Sat May 17 12:30:27 2014 (r266307) +++ head/sys/netinet/tcp_var.h Sat May 17 12:33:27 2014 (r266308) @@ -505,6 +505,8 @@ struct tcpstat { uint64_t _pad[12]; /* 6 UTO, 6 TBD */ }; +#define tcps_rcvmemdrop tcps_rcvreassfull /* compat */ + #ifdef _KERNEL #include From owner-svn-src-head@FreeBSD.ORG Sat May 17 13:45:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57D994B1; Sat, 17 May 2014 13:45:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AFBE22D5; Sat, 17 May 2014 13:45:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HDj480020342; Sat, 17 May 2014 13:45:04 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HDj3LK020332; Sat, 17 May 2014 13:45:03 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201405171345.s4HDj3LK020332@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sat, 17 May 2014 13:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266310 - in head: sbin/ipfw sys/netinet sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 13:45:04 -0000 Author: melifaro Date: Sat May 17 13:45:03 2014 New Revision: 266310 URL: http://svnweb.freebsd.org/changeset/base/266310 Log: Fix wrong formatting of 0.0.0.0/X table records in ipfw(8). Add `flags` u16 field to the hole in ipfw_table_xentry structure. Kernel has been guessing address family for supplied record based on xent length size. Userland, however, has been getting fixed-size ipfw_table_xentry structures guessing address family by checking address by IN6_IS_ADDR_V4COMPAT(). Fix this behavior by providing specific IPFW_TCF_INET flag for IPv4 records. PR: bin/189471 Submitted by: Dennis Yusupoff MFC after: 2 weeks Modified: head/sbin/ipfw/ipfw2.c head/sys/netinet/ip_fw.h head/sys/netpfil/ipfw/ip_fw_table.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Sat May 17 12:47:11 2014 (r266309) +++ head/sbin/ipfw/ipfw2.c Sat May 17 13:45:03 2014 (r266310) @@ -4389,7 +4389,7 @@ table_list(uint16_t num, int need_header addr6 = &xent->k.addr6; - if (IN6_IS_ADDR_V4COMPAT(addr6)) { + if ((xent->flags & IPFW_TCF_INET) != 0) { /* IPv4 address */ inet_ntop(AF_INET, &addr6->s6_addr32[3], tbuf, sizeof(tbuf)); } else { Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Sat May 17 12:47:11 2014 (r266309) +++ head/sys/netinet/ip_fw.h Sat May 17 13:45:03 2014 (r266310) @@ -614,6 +614,7 @@ typedef struct _ipfw_table_xentry { uint8_t type; /* entry type */ uint8_t masklen; /* mask length */ uint16_t tbl; /* table number */ + uint16_t flags; /* record flags */ uint32_t value; /* value */ union { /* Longest field needs to be aligned by 4-byte boundary */ @@ -621,6 +622,7 @@ typedef struct _ipfw_table_xentry { char iface[IF_NAMESIZE]; /* interface name */ } k; } ipfw_table_xentry; +#define IPFW_TCF_INET 0x01 /* CIDR flags: IPv4 record */ typedef struct _ipfw_table { u_int32_t size; /* size of entries in bytes */ Modified: head/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table.c Sat May 17 12:47:11 2014 (r266309) +++ head/sys/netpfil/ipfw/ip_fw_table.c Sat May 17 13:45:03 2014 (r266310) @@ -697,6 +697,7 @@ dump_table_xentry_base(struct radix_node xent->masklen = 33 - ffs(ntohl(n->mask.sin_addr.s_addr)); /* Save IPv4 address as deprecated IPv6 compatible */ xent->k.addr6.s6_addr32[3] = n->addr.sin_addr.s_addr; + xent->flags = IPFW_TCF_INET; xent->value = n->value; tbl->cnt++; return (0); From owner-svn-src-head@FreeBSD.ORG Sat May 17 13:56:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76802B88; Sat, 17 May 2014 13:56:16 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "CAcert Class 3 Root" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F2C3923D9; Sat, 17 May 2014 13:56:15 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::307e:8fe5:fab4:9592] (unknown [IPv6:2001:7b8:3a7:0:307e:8fe5:fab4:9592]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id D74BB5C43; Sat, 17 May 2014 15:56:12 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_2344AFC2-2E3D-434F-B5A1-4AA0BF43D966"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266278 - head/share/mk From: Dimitry Andric In-Reply-To: <201405170147.s4H1l6nW081735@svn.freebsd.org> Date: Sat, 17 May 2014 15:56:01 +0200 Message-Id: References: <201405170147.s4H1l6nW081735@svn.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "O. Hartmann" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 13:56:16 -0000 --Apple-Mail=_2344AFC2-2E3D-434F-B5A1-4AA0BF43D966 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 17 May 2014, at 03:47, Warner Losh wrote: > Author: imp > Date: Sat May 17 01:47:06 2014 > New Revision: 266278 > URL: http://svnweb.freebsd.org/changeset/base/266278 >=20 > Log: > Read in SRCCONF early and consistently, if src.sys.mk exists, which = is > should for all normal builds. Read /etc/make.conf earlier than = before, > but consistently before SRCCONF and local.sys.mk. I'm not yet sure why, but this breaks buildworld badly. During = bootstrap-tools, you immediately get: -------------------------------------------------------------- >>> stage 1.2: bootstrap tools -------------------------------------------------------------- ... mkdep -f .depend -a -std=3Dc++11 -std=3Dc++11 -stdlib=3Dlibc++ = -stdlib=3Dlibc++ = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APFloa= t.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APInt.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APSInt= .cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Alloca= tor.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Atomic= .cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/BlockF= requency.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Branch= Probability.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Comman= dLine.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Consta= ntRange.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Conver= tUTFWrapper.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/CrashR= ecoveryContext.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/DAGDel= taAlgorithm.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/DataEx= tractor.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Debug.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/DeltaA= lgorithm.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Dwarf.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Dynami= cLibrary.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Errno.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/ErrorH= andling.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/FileOu= tputBuffer.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Foldin= gSet.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Format= tedStream.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/GraphW= riter.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Hashin= g.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Host.c= pp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Includ= eFile.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/IntEqC= lasses.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Interv= alMap.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Intrus= iveRefCntPtr.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/IsInf.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/IsNAN.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Locale= .cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/LockFi= leManager.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/MD5.cp= p = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Manage= dStatic.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Memory= .cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Memory= Buffer.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Memory= Object.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Mutex.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Path.c= pp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Plugin= Loader.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Pretty= StackTrace.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Proces= s.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Progra= m.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/RWMute= x.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Regex.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Search= ForAddressOfSpecialSymbol.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Signal= s.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/SmallP= trSet.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/SmallV= ector.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Source= Mgr.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Statis= tic.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Stream= ableMemoryObject.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/String= Extras.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/String= Map.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/String= Pool.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/String= Ref.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/String= RefMemoryObject.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Target= Registry.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Thread= Local.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Thread= ing.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/TimeVa= lue.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Timer.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/ToolOu= tputFile.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Triple= .cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Twine.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Unicod= e.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Valgri= nd.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Watchd= og.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/YAMLPa= rser.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/YAMLTr= aits.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/circul= ar_raw_ostream.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_os= _ostream.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_os= tream.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/system= _error.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Disass= embler.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Compre= ssion.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/DataSt= ream.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/FileUt= ilities.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/System= Utils.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APFloa= t.cpp:15:10: fatal error: 'llvm/ADT/APFloat.h' file not found #include "llvm/ADT/APFloat.h" ^ 1 error generated. = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APInt.= cpp:16:10: fatal error: 'llvm/ADT/APInt.h' file not found #include "llvm/ADT/APInt.h" ^ 1 error generated. For some reason, this revision seems to destroy the -I flags normally = passed to mkdep. -Dimitry --Apple-Mail=_2344AFC2-2E3D-434F-B5A1-4AA0BF43D966 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlN3ansACgkQsF6jCi4glqPEzACgmSTRf+xFUr0vGgeanzr6czVm 8dUAoI5Gz2hsWXfg/DiH6gNWO7Wiekx1 =otlX -----END PGP SIGNATURE----- --Apple-Mail=_2344AFC2-2E3D-434F-B5A1-4AA0BF43D966-- From owner-svn-src-head@FreeBSD.ORG Sat May 17 14:33:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E292C912 for ; Sat, 17 May 2014 14:33:01 +0000 (UTC) Received: from mail-ie0-f177.google.com (mail-ie0-f177.google.com [209.85.223.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A65502730 for ; Sat, 17 May 2014 14:33:01 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id y20so868699ier.8 for ; Sat, 17 May 2014 07:32:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=oQuf6sr7Y/v6vC8lqwDRrX0Lb8txaJbCaDE1StGNNPY=; b=QLZsVnQ7s3GCcmeUu5NnbDE4JwdY+dNCIiE7mRLPpzNGDTiD9igdy5NQ8to+KO+TOk qc/dtG8fqC+ekw1e4nbiWArj///UcdDXzaDd9eDEiRhL4cRBzXh2I3gflc6RoO4RtCYE AswcpilPRT6OPMOfG4TsITXEbfYQKJXl1ob6lfXsdLvJxYhNV/CVLPQVfbXPQA4I2Mh8 zods1SWu1RfHAaeb/D7bnUN92u+hMRMjVO84U7QvqDATpmprqAHgpVj/PRv5q6CB6MXF 4+fKYzj6NVin126q2N8mZmKrRBdHHrPsjtgvWje9ZxXagJX7mMz2aWoboK0RVyp6zq4r GpFw== X-Gm-Message-State: ALoCoQn+gi9Pzl19jDUuhKZ+m7Wg1WyjAhJxNQ4SQrzZl4jG4w71QnxCkMkjqwAO9938qaPCA1Ym X-Received: by 10.50.50.197 with SMTP id e5mr4621889igo.46.1400336848187; Sat, 17 May 2014 07:27:28 -0700 (PDT) Received: from [10.69.227.146] ([137.122.64.12]) by mx.google.com with ESMTPSA id ii6sm5937513igb.17.2014.05.17.07.27.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 17 May 2014 07:27:27 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_251016BE-A144-42D6-B615-5E840F11CE2D"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r266278 - head/share/mk From: Warner Losh In-Reply-To: Date: Sat, 17 May 2014 10:27:25 -0400 Message-Id: <3ADF8926-8AEF-4324-A205-2E7D8D5393A2@bsdimp.com> References: <201405170147.s4H1l6nW081735@svn.freebsd.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, "O. Hartmann" , svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 14:33:02 -0000 --Apple-Mail=_251016BE-A144-42D6-B615-5E840F11CE2D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On May 17, 2014, at 9:56 AM, Dimitry Andric wrote: > On 17 May 2014, at 03:47, Warner Losh wrote: >> Author: imp >> Date: Sat May 17 01:47:06 2014 >> New Revision: 266278 >> URL: http://svnweb.freebsd.org/changeset/base/266278 >>=20 >> Log: >> Read in SRCCONF early and consistently, if src.sys.mk exists, which = is >> should for all normal builds. Read /etc/make.conf earlier than = before, >> but consistently before SRCCONF and local.sys.mk. >=20 > I'm not yet sure why, but this breaks buildworld badly. During = bootstrap-tools, you immediately get: Haven=92t seen this in my testing. Please send me your /etc/make.conf = and /etc/src.conf. Or tell me your environment. Would love to fix it... Warner > -------------------------------------------------------------- >>>> stage 1.2: bootstrap tools > -------------------------------------------------------------- > ... > mkdep -f .depend -a -std=3Dc++11 -std=3Dc++11 -stdlib=3Dlibc++ = -stdlib=3Dlibc++ = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APFloa= t.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APInt.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APSInt= .cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Alloca= tor.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Atomic= .cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/BlockF= requency.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Branch= Probability.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Comman= dLine.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Consta= ntRange.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Conver= tUTFWrapper.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/CrashR= ecoveryContext.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/DAGDel= taAlgorithm.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/DataEx= tractor.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Debug.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/DeltaA= lgorithm.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Dwarf.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Dynami= cLibrary.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Errno.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/ErrorH= andling.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/FileOu= tputBuffer.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Foldin= gSet.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Format= tedStream.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/GraphW= riter.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Hashin= g.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Host.c= pp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Includ= eFile.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/IntEqC= lasses.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Interv= alMap.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Intrus= iveRefCntPtr.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/IsInf.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/IsNAN.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Locale= .cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/LockFi= leManager.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/MD5.cp= p = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Manage= dStatic.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Memory= .cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Memory= Buffer.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Memory= Object.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Mutex.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Path.c= pp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Plugin= Loader.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Pretty= StackTrace.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Proces= s.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Progra= m.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/RWMute= x.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Regex.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Search= ForAddressOfSpecialSymbol.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Signal= s.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/SmallP= trSet.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/SmallV= ector.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Source= Mgr.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Statis= tic.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Stream= ableMemoryObject.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/String= Extras.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/String= Map.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/String= Pool.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/String= Ref.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/String= RefMemoryObject.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Target= Registry.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Thread= Local.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Thread= ing.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/TimeVa= lue.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Timer.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/ToolOu= tputFile.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Triple= .cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Twine.= cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Unicod= e.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Valgri= nd.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Watchd= og.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/YAMLPa= rser.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/YAMLTr= aits.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/circul= ar_raw_ostream.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_os= _ostream.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/raw_os= tream.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/system= _error.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Disass= embler.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Compre= ssion.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/DataSt= ream.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/FileUt= ilities.cpp = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/System= Utils.cpp > = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APFloa= t.cpp:15:10: fatal error: 'llvm/ADT/APFloat.h' file not found > #include "llvm/ADT/APFloat.h" > ^ > 1 error generated. > = /usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/APInt.= cpp:16:10: fatal error: 'llvm/ADT/APInt.h' file not found > #include "llvm/ADT/APInt.h" > ^ > 1 error generated. >=20 > For some reason, this revision seems to destroy the -I flags normally = passed to mkdep. >=20 > -Dimitry >=20 --Apple-Mail=_251016BE-A144-42D6-B615-5E840F11CE2D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTd3HNAAoJEGwc0Sh9sBEA64IP/A7c7WM8fD675CpWy1mCZjn+ eXpxQdWXE2L1VHt9L/6xSyhxVziaTd/3CGZb/aSIYAVbMtWggIJ38O7Yq05Tk5tH Up+Rw4refmPoek97F/qPkqu7WVJ6M5iCqYzYsav9r0Ekx6bIrxWGYW2RFaydIhb1 q7jaRoVw66gxCnBneeoeaCCXAi2CpLPMnuCXZnEQVwSWkUiyZkiUx1hNP7lDtzQn 3WkG233NGx8p4CfWUetyJr5IJfgR+dlKfCOG/2AQZjY5QmH12XvzFN2AzB2qxPRM TFlfxmBdQbfEFgqYdiTdlDkxK+G/zNF3YxzH5r2Dbz1Z2UXbPh9DK6Qe70oxXvHq dH7P0ScYaLxJNAeN1LOPTevCXH0JBIDW1TEZB/1E00XS4prhHO7apIa7DvTJSHxW aOvptnWlFDW/e8WCC/F7TtdftAMeI2dDXmhJrIev3qQ5fGDIeY3v1+lgpKPZVijY KVst7T9c3cFNGj+ul8RhJW8yvd8cUQftpKqnfOoXsq/kUHIBiYcz5xEnFkTy9fSM eRkoc9OuXhQ+WqKx8ElF3/UIB1D7lG3QJwEnNbE36UBoBEB6HqNeJAqGHira0JBg UESWP4WUrW9SBDeAaXOXpffWMgMWRXGHsqk2SGa6qT4trCM4wIJr/ILmqciJ0XSs TRG4KV4lYxuD9/BKlCo4 =Q2nw -----END PGP SIGNATURE----- --Apple-Mail=_251016BE-A144-42D6-B615-5E840F11CE2D-- From owner-svn-src-head@FreeBSD.ORG Sat May 17 14:57:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9D73539; Sat, 17 May 2014 14:57:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9713E2A85; Sat, 17 May 2014 14:57:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HEvZ83063478; Sat, 17 May 2014 14:57:35 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HEvZpr063476; Sat, 17 May 2014 14:57:35 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201405171457.s4HEvZpr063476@svn.freebsd.org> From: Andrew Turner Date: Sat, 17 May 2014 14:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266318 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 14:57:35 -0000 Author: andrew Date: Sat May 17 14:57:34 2014 New Revision: 266318 URL: http://svnweb.freebsd.org/changeset/base/266318 Log: Mark the i.MX51 and i.MX53 boards as compatible with the i.MX51 and i.MX53 respectively. MFC after: 1 week Modified: head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts head/sys/boot/fdt/dts/arm/efikamx.dts Modified: head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts Sat May 17 14:41:18 2014 (r266317) +++ head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts Sat May 17 14:57:34 2014 (r266318) @@ -37,7 +37,7 @@ / { model = "Digi ConnectCore Wi-i.MX53"; - compatible = "digi,imx53-ccwm53"; + compatible = "digi,imx53-ccwm53", "fsl,imx53"; memory { /* RAM 512M */ Modified: head/sys/boot/fdt/dts/arm/efikamx.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/efikamx.dts Sat May 17 14:41:18 2014 (r266317) +++ head/sys/boot/fdt/dts/arm/efikamx.dts Sat May 17 14:57:34 2014 (r266318) @@ -36,7 +36,7 @@ / { model = "Genesi Efika MX"; - compatible = "genesi,imx51-efikamx"; + compatible = "genesi,imx51-efikamx", "fsl,imx51"; memory { /* RAM 512M */ From owner-svn-src-head@FreeBSD.ORG Sat May 17 14:57:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B847674; Sat, 17 May 2014 14:57:50 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "CAcert Class 3 Root" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 243C92A8B; Sat, 17 May 2014 14:57:50 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::d0d9:188b:7212:8819] (unknown [IPv6:2001:7b8:3a7:0:d0d9:188b:7212:8819]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 9B2725C43; Sat, 17 May 2014 16:57:46 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_3E5964C8-77AF-4A69-A80A-9A2ED87BC35D"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266278 - head/share/mk From: Dimitry Andric In-Reply-To: <3ADF8926-8AEF-4324-A205-2E7D8D5393A2@bsdimp.com> Date: Sat, 17 May 2014 16:57:37 +0200 Message-Id: References: <201405170147.s4H1l6nW081735@svn.freebsd.org> <3ADF8926-8AEF-4324-A205-2E7D8D5393A2@bsdimp.com> To: Warner Losh X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@freebsd.org, "O. Hartmann" , svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 14:57:50 -0000 --Apple-Mail=_3E5964C8-77AF-4A69-A80A-9A2ED87BC35D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 17 May 2014, at 16:27, Warner Losh wrote: >=20 > On May 17, 2014, at 9:56 AM, Dimitry Andric wrote: >=20 >> On 17 May 2014, at 03:47, Warner Losh wrote: >>> Author: imp >>> Date: Sat May 17 01:47:06 2014 >>> New Revision: 266278 >>> URL: http://svnweb.freebsd.org/changeset/base/266278 >>>=20 >>> Log: >>> Read in SRCCONF early and consistently, if src.sys.mk exists, which = is >>> should for all normal builds. Read /etc/make.conf earlier than = before, >>> but consistently before SRCCONF and local.sys.mk. >>=20 >> I'm not yet sure why, but this breaks buildworld badly. During = bootstrap-tools, you immediately get: >=20 > Haven=92t seen this in my testing. Please send me your /etc/make.conf = and /etc/src.conf. Or tell me your environment. Would love to fix it... Try an empty make.conf (or __MAKE_CONF=3D/dev/null), and just this line = in src.conf: CXXFLAGS+=3D -std=3Dc++11 That breaks it. -Dimitry --Apple-Mail=_3E5964C8-77AF-4A69-A80A-9A2ED87BC35D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlN3eOcACgkQsF6jCi4glqOgIwCgqP854vCEsos3dzEtxPlPkmHm mYoAn3yGvMNgNhIArijlcNL3mR5W/SHR =S1rm -----END PGP SIGNATURE----- --Apple-Mail=_3E5964C8-77AF-4A69-A80A-9A2ED87BC35D-- From owner-svn-src-head@FreeBSD.ORG Sat May 17 15:07:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E83EB8EC; Sat, 17 May 2014 15:07:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D65722B5A; Sat, 17 May 2014 15:07:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HF7046077695; Sat, 17 May 2014 15:07:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HF70qg077693; Sat, 17 May 2014 15:07:00 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405171507.s4HF70qg077693@svn.freebsd.org> From: Alexander Motin Date: Sat, 17 May 2014 15:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266319 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 15:07:01 -0000 Author: mav Date: Sat May 17 15:07:00 2014 New Revision: 266319 URL: http://svnweb.freebsd.org/changeset/base/266319 Log: Make GEOM DISK to account also BIO_FLUSH operations. Modified: head/sys/geom/geom_disk.c Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Sat May 17 14:57:34 2014 (r266318) +++ head/sys/geom/geom_disk.c Sat May 17 15:07:00 2014 (r266319) @@ -223,7 +223,7 @@ g_disk_done(struct bio *bp) if (bp2->bio_error == 0) bp2->bio_error = bp->bio_error; bp2->bio_completed += bp->bio_completed; - if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) != 0) + if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE|BIO_FLUSH)) != 0) devstat_end_transaction_bio_bt(sc->dp->d_devstat, bp, &now); bp2->bio_inbed++; if (bp2->bio_children == bp2->bio_inbed) { @@ -244,7 +244,7 @@ g_disk_done_single(struct bio *bp) bp->bio_completed = bp->bio_length - bp->bio_resid; bp->bio_done = (void *)bp->bio_to; bp->bio_to = LIST_FIRST(&bp->bio_disk->d_geom->provider); - if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) != 0) { + if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE|BIO_FLUSH)) != 0) { binuptime(&now); sc = bp->bio_to->private; mtx_lock(&sc->done_mtx); @@ -418,6 +418,9 @@ g_disk_start(struct bio *bp) bp->bio_disk = dp; bp->bio_to = (void *)bp->bio_done; bp->bio_done = g_disk_done_single; + mtx_lock(&sc->start_mtx); + devstat_start_transaction_bio(dp->d_devstat, bp); + mtx_unlock(&sc->start_mtx); dp->d_strategy(bp); break; default: From owner-svn-src-head@FreeBSD.ORG Sat May 17 15:22:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFBF9C48 for ; Sat, 17 May 2014 15:22:44 +0000 (UTC) Received: from mail-ig0-f180.google.com (mail-ig0-f180.google.com [209.85.213.180]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 940F52CD2 for ; Sat, 17 May 2014 15:22:44 +0000 (UTC) Received: by mail-ig0-f180.google.com with SMTP id c1so1937002igq.7 for ; Sat, 17 May 2014 08:22:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=x0PFg7i4MXfJ0hVm+qIL99tY4SlrikwCMICROnwsS9U=; b=iwJQAMPb7EsG3ZSoWo1vJSeLdFAzUwiRGkwlz8s/61O0XL0ZOcGo708MZVdkOguJe5 UAJDt+5oYoynCh3NpnPdEe5MyuvyfPzwFfFtKMbyhzMhWImpfQeo3nyZqS/k0XIkjMS/ Xy8nOH1qRwZCIAGGDFUS5f7Ob4obcBAI5S2EvVV2F4uRVV2i4lBkPMIXJXCp5j1ThOsE ZRcGsqtUSxtNigGLXCnvyi4NAwX68ehV3whDTSWr0XfQqgTa1o3RKDlcOx6IpmbMGxVM M3tWU8+7NfrmHt+Soy8iF1WP62JdF++mehpFgrkvM3rs22ivL4dUOyEd8/5mTMp/RbXL VCuw== X-Gm-Message-State: ALoCoQmHFaaww5BVcAf8lXyAba05qHXtd6PFkr9cyHM4Fn1j883puIwoe7IiNsrAZNqkPwF5MBOJ X-Received: by 10.50.50.231 with SMTP id f7mr4834811igo.42.1400340158331; Sat, 17 May 2014 08:22:38 -0700 (PDT) Received: from [10.69.227.146] ([137.122.64.12]) by mx.google.com with ESMTPSA id qo12sm6227589igb.21.2014.05.17.08.22.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 17 May 2014 08:22:37 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_A3C9D56F-4107-4984-ADD2-F3FA33553F31"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r266278 - head/share/mk From: Warner Losh In-Reply-To: Date: Sat, 17 May 2014 11:22:35 -0400 Message-Id: References: <201405170147.s4H1l6nW081735@svn.freebsd.org> <3ADF8926-8AEF-4324-A205-2E7D8D5393A2@bsdimp.com> To: Dimitry Andric X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, "O. Hartmann" , svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 15:22:45 -0000 --Apple-Mail=_A3C9D56F-4107-4984-ADD2-F3FA33553F31 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On May 17, 2014, at 10:57 AM, Dimitry Andric wrote: > On 17 May 2014, at 16:27, Warner Losh wrote: >>=20 >> On May 17, 2014, at 9:56 AM, Dimitry Andric wrote: >>=20 >>> On 17 May 2014, at 03:47, Warner Losh wrote: >>>> Author: imp >>>> Date: Sat May 17 01:47:06 2014 >>>> New Revision: 266278 >>>> URL: http://svnweb.freebsd.org/changeset/base/266278 >>>>=20 >>>> Log: >>>> Read in SRCCONF early and consistently, if src.sys.mk exists, which = is >>>> should for all normal builds. Read /etc/make.conf earlier than = before, >>>> but consistently before SRCCONF and local.sys.mk. >>>=20 >>> I'm not yet sure why, but this breaks buildworld badly. During = bootstrap-tools, you immediately get: >>=20 >> Haven=92t seen this in my testing. Please send me your /etc/make.conf = and /etc/src.conf. Or tell me your environment. Would love to fix it... >=20 > Try an empty make.conf (or __MAKE_CONF=3D/dev/null), and just this = line in src.conf: >=20 > CXXFLAGS+=3D -std=3Dc++11 >=20 > That breaks it. OK. I=92ll look into it. src.conf is included earlier now than it used = to be=85 Warner --Apple-Mail=_A3C9D56F-4107-4984-ADD2-F3FA33553F31 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTd367AAoJEGwc0Sh9sBEA6XEQALFUSj+1DrsupBvXp0WPKDiS fzN4RQ/6VjsJhH0zLojxIZxuj4ENviKS0iW7q0E3wlhjnO7TMhxrq9NcZvRzO8LX Qkgie7AwDVOWtZpm/xMBaBxezCKGWKbXncUdogEZbQjsJxJM32IS6jPCkpwODOBu D4cmX7KHBzjmgmHrNqGAAcrRCONZadiBNhtCI/Jp7ofHL5dqOaHY5Gm2hKDvLwvL q3651rv5MPVpn4x1rIVHOvarxm74f2SyLFpBz2HFxRyKJwVT1FhbCAVc5wJiAxQO nmzPcJhnZUOWNC+l3Rzf4lkT4FFv+31dbg4qArO/bUZXTULMZwPTcO43IwK4RZUP cfa1RxVFWl/sr75CmOQNbFR1oOcwk8DY2ZzEwd4YJ5MtdCWmN3v1Q8SQoaFbbojm v257JaFbzfbO0G3VHFyxQhaINKQq8o05lgdKKbTwMsemf+QiYxoD+nxOfUnt3p9p rKa8kdNfmh3jxHdQCRtrBhtMuqK0f0ImlCl+L9/6NX+/0Myb9Ats1kP6Aa5IU5UV 8H9yPmkn0TLMz3I3vyqKYQ+hpKeo3VQiVZH7RRXIF1IW5Zk3q04WNBTNblItvn7E Rn3RkLzmuoUzp8+nifHPKY+IVMSbxq6/B+zDla7dVkPgBELbxTOTryQc1D9KNJBN lR5FfX16n4RCt9aGsgWD =fl8Q -----END PGP SIGNATURE----- --Apple-Mail=_A3C9D56F-4107-4984-ADD2-F3FA33553F31-- From owner-svn-src-head@FreeBSD.ORG Sat May 17 15:26:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4560DF05; Sat, 17 May 2014 15:26:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 268302CF8; Sat, 17 May 2014 15:26:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HFQ9k0032162; Sat, 17 May 2014 15:26:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HFQ8dX032155; Sat, 17 May 2014 15:26:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405171526.s4HFQ8dX032155@svn.freebsd.org> From: Alexander Motin Date: Sat, 17 May 2014 15:26:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266320 - head/usr.sbin/gstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 15:26:09 -0000 Author: mav Date: Sat May 17 15:26:08 2014 New Revision: 266320 URL: http://svnweb.freebsd.org/changeset/base/266320 Log: Add -o option to gstat to display "other" operatins (e.g. BIO_FLUSH). MFC after: 1 week Modified: head/usr.sbin/gstat/gstat.8 head/usr.sbin/gstat/gstat.c Modified: head/usr.sbin/gstat/gstat.8 ============================================================================== --- head/usr.sbin/gstat/gstat.8 Sat May 17 15:07:00 2014 (r266319) +++ head/usr.sbin/gstat/gstat.8 Sat May 17 15:26:08 2014 (r266320) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 12, 2009 +.Dd May 17, 2014 .Dt GSTAT 8 .Os .Sh NAME @@ -32,7 +32,7 @@ .Nd print statistics about GEOM disks .Sh SYNOPSIS .Nm -.Op Fl abcd +.Op Fl abcdo .Op Fl f Ar filter .Op Fl I Ar interval .Sh DESCRIPTION @@ -69,6 +69,9 @@ Only devices with the names matching will be displayed. The format of the regular expression is described in .Xr re_format 7 . +.It Fl o +Enable display of statistics for other operations +.Pq Dv BIO_FLUSH . .It Fl I Ar interval Refresh the .Nm Modified: head/usr.sbin/gstat/gstat.c ============================================================================== --- head/usr.sbin/gstat/gstat.c Sat May 17 15:07:00 2014 (r266319) +++ head/usr.sbin/gstat/gstat.c Sat May 17 15:26:08 2014 (r266320) @@ -51,7 +51,7 @@ #include #include -static int flag_a, flag_b, flag_c, flag_d; +static int flag_a, flag_b, flag_c, flag_d, flag_o; static int flag_I = 1000000; #define PRINTMSG(...) do { \ @@ -88,7 +88,7 @@ main(int argc, char **argv) char *p; char f_s[100], pf_s[100], tmp_f_s[100]; const char *line; - long double ld[11]; + long double ld[13]; uint64_t u64; EditLine *el; History *hist; @@ -104,7 +104,7 @@ main(int argc, char **argv) flag_b = 1; f_s[0] = '\0'; - while ((i = getopt(argc, argv, "adcf:I:b")) != -1) { + while ((i = getopt(argc, argv, "abdcf:oI:")) != -1) { switch (i) { case 'a': flag_a = 1; @@ -126,6 +126,9 @@ main(int argc, char **argv) "Invalid filter - see re_format(7)"); strncpy(f_s, optarg, sizeof(f_s)); break; + case 'o': + flag_o = 1; + break; case 'I': p = NULL; i = strtoul(optarg, &p, 0); @@ -229,6 +232,8 @@ main(int argc, char **argv) PRINTMSG(" w/s kBps ms/w "); if (flag_d) PRINTMSG(" d/s kBps ms/d "); + if (flag_o) + PRINTMSG(" o/s ms/o "); PRINTMSG("%%busy Name\n"); for (;;) { gsp = geom_stats_snapshot_next(sp); @@ -279,9 +284,14 @@ main(int argc, char **argv) DSM_MS_PER_TRANSACTION_WRITE, &ld[6], DSM_BUSY_PCT, &ld[7], + DSM_TRANSFERS_PER_SECOND_FREE, &ld[8], DSM_MB_PER_SECOND_FREE, &ld[9], DSM_MS_PER_TRANSACTION_FREE, &ld[10], + + DSM_TRANSFERS_PER_SECOND_OTHER, &ld[11], + DSM_MS_PER_TRANSACTION_OTHER, &ld[12], + DSM_NONE); if (flag_a && ld[7] < 0.1) { @@ -313,6 +323,14 @@ main(int argc, char **argv) PRINTMSG(" %6.1f", (double)ld[10]); } + if (flag_o) { + PRINTMSG(" %6.0f", (double)ld[11]); + if (ld[12] > 1e3) + PRINTMSG(" %6.0f", (double)ld[12]); + else + PRINTMSG(" %6.1f", (double)ld[12]); + } + if (ld[7] > 80) i = 3; else if (ld[7] > 50) From owner-svn-src-head@FreeBSD.ORG Sat May 17 16:11:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1962D43; Sat, 17 May 2014 16:11:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF6E32051; Sat, 17 May 2014 16:11:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HGB6UT083294; Sat, 17 May 2014 16:11:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HGB6K6083292; Sat, 17 May 2014 16:11:06 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405171611.s4HGB6K6083292@svn.freebsd.org> From: John Baldwin Date: Sat, 17 May 2014 16:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266322 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 16:11:06 -0000 Author: jhb Date: Sat May 17 16:11:06 2014 New Revision: 266322 URL: http://svnweb.freebsd.org/changeset/base/266322 Log: Use 'RESOURCE' instead of the more generic 'TYPE' for the resource name column header when displaying resource usage. This more closely matches other procstat displays. Modified: head/usr.bin/procstat/procstat_rusage.c Modified: head/usr.bin/procstat/procstat_rusage.c ============================================================================== --- head/usr.bin/procstat/procstat_rusage.c Sat May 17 16:00:25 2014 (r266321) +++ head/usr.bin/procstat/procstat_rusage.c Sat May 17 16:11:06 2014 (r266322) @@ -141,7 +141,8 @@ procstat_rusage(struct procstat *procsta printf("%5s ", "PID"); if (Hflag) printf("%6s ", "TID"); - printf("%-16s %-32s %14s\n", "COMM", "TYPE", "VALUE "); + printf("%-16s %-32s %14s\n", "COMM", "RESOURCE", + "VALUE "); } if (!Hflag) { From owner-svn-src-head@FreeBSD.ORG Sat May 17 16:12:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CAA9EA7; Sat, 17 May 2014 16:12:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5045A20D9; Sat, 17 May 2014 16:12:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HGCpU3091152; Sat, 17 May 2014 16:12:51 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HGCpmH091149; Sat, 17 May 2014 16:12:51 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405171612.s4HGCpmH091149@svn.freebsd.org> From: John Baldwin Date: Sat, 17 May 2014 16:12:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266323 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 16:12:51 -0000 Author: jhb Date: Sat May 17 16:12:50 2014 New Revision: 266323 URL: http://svnweb.freebsd.org/changeset/base/266323 Log: Add descriptions of the display formats for -e, -l, -r, and -x. Fix a few typos in indent settings while here. Modified: head/usr.bin/procstat/procstat.1 Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Sat May 17 16:11:06 2014 (r266322) +++ head/usr.bin/procstat/procstat.1 Sat May 17 16:12:50 2014 (r266323) @@ -135,6 +135,17 @@ command .It ARGS command line arguments (if available) .El +.Ss Environment Variables +Display the process ID, command, and environment variables: +.Pp +.Bl -tag -width "ENVIRONMENT" -compact +.It PID +process ID +.It COMM +command +.It ENVIRONMENT +environment variables (if available) +.El .Ss File Descriptors Display detailed information about each file descriptor referenced by a process, including the process ID, command, file descriptor number, and @@ -244,7 +255,7 @@ present for each capability descriptor. .Ss Signal Disposition Information Display signal pending and disposition for a process: .Pp -.Bl -tag -width ident -compact +.Bl -tag -width indent -compact .It PID process ID .It COMM @@ -269,7 +280,7 @@ switch is given, the signal numbers are .Ss Thread Signal Information Display signal pending and blocked for a process's threads: .Pp -.Bl -tag -width ident -compact +.Bl -tag -width indent -compact .It PID process ID .It TID @@ -318,6 +329,45 @@ thread name .It KSTACK kernel thread call stack .El +.Ss Resource Limits +Display resource limits for a process: +.Pp +.Bl -tag -width indent -compact +.It PID +process ID +.It COMM +command +.It RLIMIT +resource limit name +.It SOFT +soft limit +.It HARD +hard limit +.El +.Ss Resource Usage +Display resource usage for a process. +If the +.Fl H +flag is specified, +resource usage for individual threads is displayed instead. +.Pp +.Bl -tag -width "RESOURCE" -compact +.It PID +process ID +.It TID +thread ID +.Po +if +.Fl H +is specified +.Pc +.It COMM +command +.It RESOURCE +resource name +.It VALUE +current usage +.El .Ss Security Credentials Display process credential information: .Pp @@ -450,6 +500,19 @@ grows down (top-down stack) .It U grows up (bottom-up stack) .El +.Ss ELF Auxiliary Vector +Display ELF auxiliary vector values: +.Pp +.Bl -tag -width indent -compact +.It PID +process ID +.It COMM +command +.It AUXV +auxiliary vector name +.It VALUE +auxiliary vector value +.El .Sh EXIT STATUS .Ex -std .Sh SEE ALSO From owner-svn-src-head@FreeBSD.ORG Sat May 17 17:30:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD03322A for ; Sat, 17 May 2014 17:30:47 +0000 (UTC) Received: from mail-pb0-f51.google.com (mail-pb0-f51.google.com [209.85.160.51]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8B6626F4 for ; Sat, 17 May 2014 17:30:47 +0000 (UTC) Received: by mail-pb0-f51.google.com with SMTP id ma3so3939947pbc.24 for ; Sat, 17 May 2014 10:30:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=CWqU31HoexRLBr6nlxkyLKTXfNKeajdeD53wLeYKHUQ=; b=Jh+0YE2vj4t2WsyR0S4pIyE5qtbtiI8eCflP5JZMEnsDq6RH5HOpcomOjRxOUlFrvg aJo+86eHTImlF2yLvRux44Dx1AMv1hwn6si/IjxDSnJGeOtgNc2OcHGGfR/31Xo7zH1c Z9+qAh7iBFg/ONzGKYAJTbiv36TRWspIRJEoF5162M9wOs9J7sKugEgjGcrPoygiGe9s UdbajlnSB7DUEOuJOgegSIWQj0W9OZt/ESN5PZdE4K9xXsTvvXKBnvihwGBDWkAZZXw3 PFy8WIZpBryIufNQz/eRrmMv3Sqd9r86v39pFbWcPJoZFH02GDe8OR4byHilNtYfTgjg zUKQ== X-Gm-Message-State: ALoCoQnLkX2Elsw5k7yoNOTNFGph047oga9ChGBKLty17PwyLrfs6iwT2S1HNpLHYLL52a9lakED X-Received: by 10.66.148.197 with SMTP id tu5mr30292607pab.108.1400346529400; Sat, 17 May 2014 10:08:49 -0700 (PDT) Received: from lgmac-ksadekar.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id ih6sm20879680pbc.22.2014.05.17.10.08.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 17 May 2014 10:08:48 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_AFBCE886-6710-44BE-A989-ED3F195BA4D6"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r266278 - head/share/mk From: Warner Losh In-Reply-To: Date: Sat, 17 May 2014 13:08:45 -0400 Message-Id: <7FEE0AEE-A055-4257-8C51-C01B562DCEED@bsdimp.com> References: <201405170147.s4H1l6nW081735@svn.freebsd.org> <3ADF8926-8AEF-4324-A205-2E7D8D5393A2@bsdimp.com> To: Dimitry Andric X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, "O. Hartmann" , svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 17:30:47 -0000 --Apple-Mail=_AFBCE886-6710-44BE-A989-ED3F195BA4D6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On May 17, 2014, at 10:57 AM, Dimitry Andric wrote: > On 17 May 2014, at 16:27, Warner Losh wrote: >>=20 >> On May 17, 2014, at 9:56 AM, Dimitry Andric wrote: >>=20 >>> On 17 May 2014, at 03:47, Warner Losh wrote: >>>> Author: imp >>>> Date: Sat May 17 01:47:06 2014 >>>> New Revision: 266278 >>>> URL: http://svnweb.freebsd.org/changeset/base/266278 >>>>=20 >>>> Log: >>>> Read in SRCCONF early and consistently, if src.sys.mk exists, which = is >>>> should for all normal builds. Read /etc/make.conf earlier than = before, >>>> but consistently before SRCCONF and local.sys.mk. >>>=20 >>> I'm not yet sure why, but this breaks buildworld badly. During = bootstrap-tools, you immediately get: >>=20 >> Haven=92t seen this in my testing. Please send me your /etc/make.conf = and /etc/src.conf. Or tell me your environment. Would love to fix it... >=20 > Try an empty make.conf (or __MAKE_CONF=3D/dev/null), and just this = line in src.conf: >=20 > CXXFLAGS+=3D -std=3Dc++11 >=20 > That breaks it. We define CXXFLAGS later rather than sooner now. CXXFLAGS ?=3D = ${CFLAGS:N-std=3D*:N-Wnested-externs:N-W*-prototypes:N-Wno-pointer-sign:N-= Wold-style-definition} would have been executed, but the change caused that to not happen = (since you effectively set CXXFLAGS to -std=3Dc++11). I=92m not sure what I think of this breakage, but I=92ll look into = correcting it. I=92m not really sure what the proper fix is though=85 Warner --Apple-Mail=_AFBCE886-6710-44BE-A989-ED3F195BA4D6 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTd5eeAAoJEGwc0Sh9sBEAb+oQAODPfL2zM+wn0Cngo3QstBEa tuc/+WkSAY6LxlohSNWXFi13ilMXiB6v61r/Rf+eRTHilA+hfwiGS5YCNc6bBGry RR09VBBdVFg8rwBspNi4R2XUvBA/yN+yufIOFUOb067vQl7jI8n4U0D97Bue/C7B t/ds8+wZIU23RLze3PIdDAWvlKWqui4e36vKkMKhSc2d3Og9ak4hHjygSmvEj78q 932nweOE/KMECDt+B5FnybaOZ0YNvE3DIhyWnjeX0rhUCu6YH9nGXJlizzY7dLre EWe+8blGJ95qK9uybyl5p90xC+QSL459ux9ro+f5USCbYt0wGq2jpTkDOQSmQGM2 DgNV35o+jfPi1+n0WlTZyadYN0NuSZJ5KBRnCFb7J/Kbc1bqFRkxkaR9BZTMl7qO 878V1gTgp9yHRbZ+4/rGbR622WmSojsRA3nBBSlrU2ejCxCTvaNxypwtNbjw/UFc bF4FQHE5mUFFfk/yQ0CMtRJbfrM9GZxVnh4E5TiQy9KOsOQqYVzZzhMn5DIcZKKt SaJMRPLanVv0rM7/NGlBDNHpWyqJK3yJTljT7kkvQfol+vFhQWf3dvibvMw6OvZD n7evhH4/xOrbvybBQMFWnEeotZIxrqGQMEQ82py7KtS5t5Oeuz3L3h8dRAzHcLTs U77G9uWxpO5Fp1DuEwzE =2Pzu -----END PGP SIGNATURE----- --Apple-Mail=_AFBCE886-6710-44BE-A989-ED3F195BA4D6-- From owner-svn-src-head@FreeBSD.ORG Sat May 17 18:02:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AAE34B94; Sat, 17 May 2014 18:02:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9820029C8; Sat, 17 May 2014 18:02:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HI2k6q082918; Sat, 17 May 2014 18:02:46 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HI2kwL082917; Sat, 17 May 2014 18:02:46 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201405171802.s4HI2kwL082917@svn.freebsd.org> From: Andrew Turner Date: Sat, 17 May 2014 18:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266333 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 18:02:46 -0000 Author: andrew Date: Sat May 17 18:02:46 2014 New Revision: 266333 URL: http://svnweb.freebsd.org/changeset/base/266333 Log: Add FDT_PLATFORM_DEF2 for when there are multiple platforms needing to use the same platform methods. Modified: head/sys/arm/include/platformvar.h Modified: head/sys/arm/include/platformvar.h ============================================================================== --- head/sys/arm/include/platformvar.h Sat May 17 17:54:38 2014 (r266332) +++ head/sys/arm/include/platformvar.h Sat May 17 18:02:46 2014 (r266333) @@ -83,21 +83,24 @@ typedef struct fdt_platform_class fdt_pl extern platform_method_t fdt_platform_methods[]; -#define FDT_PLATFORM_DEF(NAME, NAME_STR, size, compatible) \ -static fdt_platform_def_t NAME ## _fdt_platform = { \ - .name = NAME_STR, \ - .methods = fdt_platform_methods, \ - .fdt_compatible = compatible, \ -}; \ -static kobj_class_t NAME ## _baseclasses[] = \ - { (kobj_class_t)&NAME ## _fdt_platform, NULL }; \ -static platform_def_t NAME ## _platform = { \ - NAME_STR, \ - NAME ## _methods, \ - size, \ - NAME ## _baseclasses, \ -}; \ -DATA_SET(platform_set, NAME ## _platform) +#define FDT_PLATFORM_DEF2(NAME, VAR_NAME, NAME_STR, size, compatible) \ +static fdt_platform_def_t VAR_NAME ## _fdt_platform = { \ + .name = NAME_STR, \ + .methods = fdt_platform_methods, \ + .fdt_compatible = compatible, \ +}; \ +static kobj_class_t VAR_NAME ## _baseclasses[] = \ + { (kobj_class_t)&VAR_NAME ## _fdt_platform, NULL }; \ +static platform_def_t VAR_NAME ## _platform = { \ + NAME_STR, \ + NAME ## _methods, \ + size, \ + VAR_NAME ## _baseclasses, \ +}; \ +DATA_SET(platform_set, VAR_NAME ## _platform) + +#define FDT_PLATFORM_DEF(NAME, NAME_STR, size, compatible) \ + FDT_PLATFORM_DEF2(NAME, NAME, NAME_STR, size, compatible) #endif From owner-svn-src-head@FreeBSD.ORG Sat May 17 18:35:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E57A405; Sat, 17 May 2014 18:35:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BAFC2C16; Sat, 17 May 2014 18:35:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HIZN12002171; Sat, 17 May 2014 18:35:23 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HIZM9M002167; Sat, 17 May 2014 18:35:22 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201405171835.s4HIZM9M002167@svn.freebsd.org> From: Andrew Turner Date: Sat, 17 May 2014 18:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266334 - in head/sys/arm: conf ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 18:35:23 -0000 Author: andrew Date: Sat May 17 18:35:22 2014 New Revision: 266334 URL: http://svnweb.freebsd.org/changeset/base/266334 Log: Move the Ti SoCs to use the ARM platform. This should help allowing a single kernel to work on both PandaBoard and BeagleBone. Modified: head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/PANDABOARD head/sys/arm/ti/ti_machdep.c Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Sat May 17 18:02:46 2014 (r266333) +++ head/sys/arm/conf/BEAGLEBONE Sat May 17 18:35:22 2014 (r266334) @@ -50,6 +50,7 @@ options SYSVSEM # SYSV-style semaphor options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev options PREEMPTION +options PLATFORM options FREEBSD_BOOT_LOADER options VFP # vfp/neon Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Sat May 17 18:02:46 2014 (r266333) +++ head/sys/arm/conf/PANDABOARD Sat May 17 18:35:22 2014 (r266334) @@ -72,6 +72,7 @@ options KBD_INSTALL_CDEV # install a CD options FREEBSD_BOOT_LOADER options PREEMPTION +options PLATFORM # MMC/SD/SDIO Card slot support device mmc # mmc/sd bus Modified: head/sys/arm/ti/ti_machdep.c ============================================================================== --- head/sys/arm/ti/ti_machdep.c Sat May 17 18:02:46 2014 (r266333) +++ head/sys/arm/ti/ti_machdep.c Sat May 17 18:35:22 2014 (r266334) @@ -51,45 +51,40 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include +#include "platform_if.h" + void (*ti_cpu_reset)(void) = NULL; -vm_offset_t -platform_lastaddr(void) +static vm_offset_t +ti_lastaddr(platform_t plat) { return (arm_devmap_lastaddr()); } -void -platform_probe_and_attach(void) -{ -} - -void -platform_gpio_init(void) -{ -} - -void -platform_late_init(void) -{ -} - /* * Construct static devmap entries to map out the most frequently used * peripherals using 1mb section mappings. */ -int -platform_devmap_init(void) -{ #if defined(SOC_OMAP4) +static int +ti_omap4_devmap_init(platform_t plat) +{ arm_devmap_add_entry(0x48000000, 0x01000000); /*16mb L4_PER devices */ arm_devmap_add_entry(0x4A000000, 0x01000000); /*16mb L4_CFG devices */ -#elif defined(SOC_TI_AM335X) + return (0); +} +#endif + +#if defined(SOC_TI_AM335X) +static int +ti_am335x_devmap_init(platform_t plat) +{ + arm_devmap_add_entry(0x44C00000, 0x00400000); /* 4mb L4_WKUP devices*/ arm_devmap_add_entry(0x47400000, 0x00100000); /* 1mb USB */ arm_devmap_add_entry(0x47800000, 0x00100000); /* 1mb mmchs2 */ @@ -97,11 +92,9 @@ platform_devmap_init(void) arm_devmap_add_entry(0x49000000, 0x00100000); /* 1mb edma3 */ arm_devmap_add_entry(0x49800000, 0x00300000); /* 3mb edma3 */ arm_devmap_add_entry(0x4A000000, 0x01000000); /*16mb L4_FAST devices*/ -#else -#error "Unknown SoC" -#endif return (0); } +#endif struct arm32_dma_range * bus_dma_get_range(void) @@ -127,3 +120,24 @@ cpu_reset() printf("Reset failed!\n"); while (1); } + +#if defined(SOC_OMAP4) +static platform_method_t omap4_methods[] = { + PLATFORMMETHOD(platform_devmap_init, ti_omap4_devmap_init), + PLATFORMMETHOD(platform_lastaddr, ti_lastaddr), + + PLATFORMMETHOD_END, +}; +FDT_PLATFORM_DEF(omap4, "omap4", 0, "ti,omap4430"); +#endif + +#if defined(SOC_TI_AM335X) +static platform_method_t am335x_methods[] = { + PLATFORMMETHOD(platform_devmap_init, ti_am335x_devmap_init), + PLATFORMMETHOD(platform_lastaddr, ti_lastaddr), + + PLATFORMMETHOD_END, +}; + +FDT_PLATFORM_DEF(am335x, "am335x", 0, "ti,am335x"); +#endif From owner-svn-src-head@FreeBSD.ORG Sat May 17 18:40:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3288587; Sat, 17 May 2014 18:40:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0C292CB1; Sat, 17 May 2014 18:40:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HIehNr004079; Sat, 17 May 2014 18:40:43 GMT (envelope-from lwhsu@svn.freebsd.org) Received: (from lwhsu@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HIehLe004056; Sat, 17 May 2014 18:40:43 GMT (envelope-from lwhsu@svn.freebsd.org) Message-Id: <201405171840.s4HIehLe004056@svn.freebsd.org> From: Li-Wen Hsu Date: Sat, 17 May 2014 18:40:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266335 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 18:40:44 -0000 Author: lwhsu (ports committer) Date: Sat May 17 18:40:43 2014 New Revision: 266335 URL: http://svnweb.freebsd.org/changeset/base/266335 Log: ADd axge(4) to LINT Approved by: markj Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sat May 17 18:35:22 2014 (r266334) +++ head/sys/conf/NOTES Sat May 17 18:40:43 2014 (r266335) @@ -2686,6 +2686,8 @@ device aue # ASIX Electronics AX88172 USB 2.0 ethernet driver. Used in the # LinkSys USB200M and various other adapters. device axe +# ASIX Electronics AX88178A/AX88179 USB 2.0/3.0 gigabit ethernet driver. +device axge # # Devices which communicate using Ethernet over USB, particularly From owner-svn-src-head@FreeBSD.ORG Sat May 17 18:52:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D562A43; Sat, 17 May 2014 18:52:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 009E82D7C; Sat, 17 May 2014 18:52:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HIqKVj013920; Sat, 17 May 2014 18:52:20 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HIqK2O013919; Sat, 17 May 2014 18:52:20 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201405171852.s4HIqK2O013919@svn.freebsd.org> From: Andrew Turner Date: Sat, 17 May 2014 18:52:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266336 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 18:52:21 -0000 Author: andrew Date: Sat May 17 18:52:20 2014 New Revision: 266336 URL: http://svnweb.freebsd.org/changeset/base/266336 Log: Allow us to compile the Ti iic driver for both OMAP4 and AM335x. MFC after: 1 week Modified: head/sys/arm/ti/ti_i2c.c Modified: head/sys/arm/ti/ti_i2c.c ============================================================================== --- head/sys/arm/ti/ti_i2c.c Sat May 17 18:40:43 2014 (r266335) +++ head/sys/arm/ti/ti_i2c.c Sat May 17 18:52:20 2014 (r266336) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -106,21 +107,23 @@ struct ti_i2c_clock_config uint8_t hssclh; /* High Speed mode SCL high time */ }; -static struct ti_i2c_clock_config ti_i2c_clock_configs[] = { - #if defined(SOC_OMAP4) +static struct ti_i2c_clock_config ti_omap4_i2c_clock_configs[] = { { IIC_SLOW, 100000, 23, 13, 15, 0, 0}, { IIC_FAST, 400000, 9, 5, 7, 0, 0}, { IIC_FASTEST, 3310000, 1, 113, 115, 7, 10}, -#elif defined(SOC_TI_AM335X) + { -1, 0 } +}; +#endif + +#if defined(SOC_TI_AM335X) +static struct ti_i2c_clock_config ti_am335x_i2c_clock_configs[] = { { IIC_SLOW, 100000, 3, 53, 55, 0, 0}, { IIC_FAST, 400000, 3, 8, 10, 0, 0}, { IIC_FASTEST, 400000, 3, 8, 10, 0, 0}, /* This might be higher */ -#else -#error "TI I2C driver is not supported on this SoC" -#endif { -1, 0 } }; +#endif #define TI_I2C_REV1 0x003C /* OMAP3 */ @@ -280,7 +283,20 @@ ti_i2c_reset(device_t dev, u_char speed, struct ti_i2c_clock_config *clkcfg; uint16_t con_reg; - clkcfg = ti_i2c_clock_configs; + switch (ti_chip()) { +#ifdef SOC_OMAP4 + case CHIP_OMAP_4: + clkcfg = ti_omap4_i2c_clock_configs; + break; +#endif +#ifdef SOC_TI_AM335X + case CHIP_AM335X: + clkcfg = ti_am335x_i2c_clock_configs; + break; +#endif + default: + panic("Unknown Ti SoC, unable to reset the i2c"); + } while (clkcfg->speed != -1) { if (clkcfg->speed == speed) break; From owner-svn-src-head@FreeBSD.ORG Sat May 17 19:45:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DD88C11; Sat, 17 May 2014 19:45:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B0E32149; Sat, 17 May 2014 19:45:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HJjOWe045532; Sat, 17 May 2014 19:45:24 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HJjO9E045531; Sat, 17 May 2014 19:45:24 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405171945.s4HJjO9E045531@svn.freebsd.org> From: Glen Barber Date: Sat, 17 May 2014 19:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266342 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 19:45:24 -0000 Author: gjb Date: Sat May 17 19:45:23 2014 New Revision: 266342 URL: http://svnweb.freebsd.org/changeset/base/266342 Log: Document r266209, pmcstat(8) '-l' flag. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat May 17 19:37:04 2014 (r266341) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat May 17 19:45:23 2014 (r266342) @@ -315,6 +315,11 @@ has been changed tox $2b$. + The &man.pmcstat.8; utility has been + updated to include a new flag, -l, which + adds event collection after the specified number of + seconds. + <filename>/etc/rc.d</filename> Scripts From owner-svn-src-head@FreeBSD.ORG Sat May 17 20:31:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4F40FC6; Sat, 17 May 2014 20:31:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1A4324D0; Sat, 17 May 2014 20:31:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HKVZx0073893; Sat, 17 May 2014 20:31:35 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HKVY51073386; Sat, 17 May 2014 20:31:34 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405172031.s4HKVY51073386@svn.freebsd.org> From: Warner Losh Date: Sat, 17 May 2014 20:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266349 - in head: share/mk sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 20:31:35 -0000 Author: imp Date: Sat May 17 20:31:34 2014 New Revision: 266349 URL: http://svnweb.freebsd.org/changeset/base/266349 Log: The time is not yet ripe to break the lack of dependencies between src/sys and the rest of the tree for builds. o eliminate including bsd.mkopts.mk for the moment in kern.opts.mk o No need to include src.opts.mk at all anymore. The reasons for it are now coverted in sys.mk and src.sys.mk. Modified: head/share/mk/src.sys.mk head/sys/conf/kern.opts.mk head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk Modified: head/share/mk/src.sys.mk ============================================================================== --- head/share/mk/src.sys.mk Sat May 17 20:22:22 2014 (r266348) +++ head/share/mk/src.sys.mk Sat May 17 20:31:34 2014 (r266349) @@ -1,7 +1,13 @@ # $FreeBSD$ +# Note: This file is also duplicated in the sys/conf/kern.pre.mk so +# it will always grab SRCCONF, even if it isn't being built in-tree +# to preserve historical (and useful) behavior. Changes here need to +# be reflected there so SRCCONF isn't included multiple times. + # Allow user to configure things that only effect src tree builds. SRCCONF?= /etc/src.conf -.if exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf" +.if (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && !target(_srcconf_included_) .include "${SRCCONF}" +_srcconf_included_: .endif Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Sat May 17 20:22:22 2014 (r266348) +++ head/sys/conf/kern.opts.mk Sat May 17 20:31:34 2014 (r266349) @@ -19,17 +19,15 @@ __DEFAULT_YES_OPTIONS = \ FORMAT_EXTENSIONS \ KERNEL_SYMBOLS -__DEFAULT_NO_OPTIONS = \ +# expanded inline from bsd.mkopt.mk: -# Kludge to allow a less painful transition. If MAKESYSPATH isn't defined, -# assume we have a standard FreeBSD src tree layout and reach over and grab -# bsd.mkopt.mk from there. If it is defined, trust it to point someplace sane -# and include bsd.mkopt.mk from there. We need the !defined case to keep ports -# kernel modules working (though arguably they should define MAKESYSPATH). We -# need the latter case to keep the Jenkins testing harness working where they -# specifically use a non-standard layout, but do define MAKESYSPATH correctly. -.if !defined(MAKESYSPATH) -.include "../../share/mk/bsd.mkopt.mk" +.for var in ${__DEFAULT_YES_OPTIONS} +.if !defined(MK_${var}) +.if defined(WITHOUT_${var}) # WITHOUT always wins +MK_${var}:= no .else -.include +MK_${var}:= yes .endif +.endif +.endfor +.undef __DEFAULT_YES_OPTIONS Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Sat May 17 20:22:22 2014 (r266348) +++ head/sys/conf/kern.pre.mk Sat May 17 20:31:34 2014 (r266349) @@ -3,7 +3,19 @@ # Part of a unified Makefile for building kernels. This part contains all # of the definitions that need to be before %BEFORE_DEPEND. -.include +# Allow user to configure things that only effect src tree builds. +# Note: This is duplicated from src.sys.mk to ensure that we include +# /etc/src.conf when building the kernel. Kernels can be built without +# the rest of /usr/src, but they still always process SRCCONF even though +# the normal mechanisms to prevent that (compiling out of tree) won't +# work. To ensure they do work, we have to duplicate thee few lines here. +SRCCONF?= /etc/src.conf +.if (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && !target(_srcconf_included_) +.include "${SRCCONF}" +_srcconf_included_: +.endif + +.include .include .include "kern.opts.mk" Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Sat May 17 20:22:22 2014 (r266348) +++ head/sys/conf/kmod.mk Sat May 17 20:31:34 2014 (r266349) @@ -65,15 +65,10 @@ KMODLOAD?= /sbin/kldload KMODUNLOAD?= /sbin/kldunload OBJCOPY?= objcopy -# Note: we're really bsd.kmod.mk, so we have to allow src.opts.mk to be -# optional. Include it if we can so we can get /etc/src.conf changes, -# if we're in the tree. If we can't include it that's OK. kern.opts.mk -# has all the kernel options in it, and should be included after src.opts.mk -# so it picks everything up. -.sinclude +# Grab all the options for a kernel build. +.include "kern.opts.mk" .include .include -.include "kern.opts.mk" .SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S From owner-svn-src-head@FreeBSD.ORG Sat May 17 20:31:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4FDE3188; Sat, 17 May 2014 20:31:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D76C24D1; Sat, 17 May 2014 20:31:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HKVfQj076285; Sat, 17 May 2014 20:31:41 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HKVf0B076284; Sat, 17 May 2014 20:31:41 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405172031.s4HKVf0B076284@svn.freebsd.org> From: Warner Losh Date: Sat, 17 May 2014 20:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266350 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 20:31:41 -0000 Author: imp Date: Sat May 17 20:31:40 2014 New Revision: 266350 URL: http://svnweb.freebsd.org/changeset/base/266350 Log: Move inclusion of /etc/make.conf and others to old location (this also moves local.sys.mk). The new location broke adding things to CXXFLAGS in /etc/src.conf with +=. Move it back until that's sorted out... Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Sat May 17 20:31:34 2014 (r266349) +++ head/share/mk/sys.mk Sat May 17 20:31:40 2014 (r266350) @@ -14,21 +14,6 @@ unix ?= We run FreeBSD, not UNIX. # for something different in FreeBSD. # MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/} - -# Pull in global settings. -__MAKE_CONF?=/etc/make.conf -.if exists(${__MAKE_CONF}) -.include "${__MAKE_CONF}" -.endif - -# Setup anything for the FreeBSD source build, if we're building -# inside the source tree. Needs to be after make.conf, but before -# local stuff. -.sinclude - -# Set any local definitions first. Place this early, but it needs -# MACHINE_CPUARCH to be defined. -.sinclude .endif # If the special target .POSIX appears (without prerequisites or @@ -325,6 +310,21 @@ YFLAGS ?= -d rm -f ${.PREFIX}.tmp.c ${CTFCONVERT_CMD} +# Pull in global settings. +__MAKE_CONF?=/etc/make.conf +.if exists(${__MAKE_CONF}) +.include "${__MAKE_CONF}" +.endif + +# Setup anything for the FreeBSD source build, if we're building +# inside the source tree. Needs to be after make.conf, but before +# local stuff. +.sinclude + +# Set any local definitions first. Place this early, but it needs +# MACHINE_CPUARCH to be defined. +.sinclude + .if defined(__MAKE_SHELL) && !empty(__MAKE_SHELL) SHELL= ${__MAKE_SHELL} .SHELL: path=${__MAKE_SHELL} From owner-svn-src-head@FreeBSD.ORG Sat May 17 20:39:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA456566; Sat, 17 May 2014 20:39:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7D2D251F; Sat, 17 May 2014 20:39:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HKddwV078376; Sat, 17 May 2014 20:39:39 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HKddav078375; Sat, 17 May 2014 20:39:39 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201405172039.s4HKddav078375@svn.freebsd.org> From: Ryan Stone Date: Sat, 17 May 2014 20:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266351 - head/lib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 20:39:39 -0000 Author: rstone Date: Sat May 17 20:39:39 2014 New Revision: 266351 URL: http://svnweb.freebsd.org/changeset/base/266351 Log: Correct a typo. MFC after: 1 week Modified: head/lib/libnv/nv.3 Modified: head/lib/libnv/nv.3 ============================================================================== --- head/lib/libnv/nv.3 Sat May 17 20:31:40 2014 (r266350) +++ head/lib/libnv/nv.3 Sat May 17 20:39:39 2014 (r266351) @@ -194,7 +194,7 @@ The API supports the following data type .Bl -ohang -offset indent .It Sy null ( NV_TYPE_NULL ) There is no data associated with the name. -.It Sy bool ( NV_TYPE_BOLL ) +.It Sy bool ( NV_TYPE_BOOL ) The value can be either .Dv true or From owner-svn-src-head@FreeBSD.ORG Sat May 17 21:10:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E7A9C2; Sat, 17 May 2014 21:10:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0233A2743; Sat, 17 May 2014 21:10:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4HLA3Zl097293; Sat, 17 May 2014 21:10:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4HLA3Xg097292; Sat, 17 May 2014 21:10:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405172110.s4HLA3Xg097292@svn.freebsd.org> From: John Baldwin Date: Sat, 17 May 2014 21:10:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266354 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2014 21:10:04 -0000 Author: jhb Date: Sat May 17 21:10:03 2014 New Revision: 266354 URL: http://svnweb.freebsd.org/changeset/base/266354 Log: Add support for decoding rdrand and rdseed. Modified: head/sys/amd64/amd64/db_disasm.c Modified: head/sys/amd64/amd64/db_disasm.c ============================================================================== --- head/sys/amd64/amd64/db_disasm.c Sat May 17 21:07:54 2014 (r266353) +++ head/sys/amd64/amd64/db_disasm.c Sat May 17 21:10:03 2014 (r266354) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #define R 5 /* register, in 'reg' field */ #define Rw 6 /* word register, in 'reg' field */ #define Rq 39 /* quad register, in 'reg' field */ +#define Rv 40 /* register in 'r/m' field */ #define Ri 7 /* register in instruction */ #define S 8 /* segment reg, in 'reg' field */ #define Si 9 /* segment reg, in instruction */ @@ -628,6 +629,17 @@ static const struct inst db_Grp5[] = { { "", TRUE, NONE, 0, 0 } }; +static const struct inst db_Grp9b[] = { + { "", TRUE, NONE, 0, 0 }, + { "", TRUE, NONE, 0, 0 }, + { "", TRUE, NONE, 0, 0 }, + { "", TRUE, NONE, 0, 0 }, + { "", TRUE, NONE, 0, 0 }, + { "", TRUE, NONE, 0, 0 }, + { "rdrand",TRUE, LONG, op1(Rv), 0 }, + { "rdseed",TRUE, LONG, op1(Rv), 0 } +}; + static const struct inst db_inst_table[256] = { /*00*/ { "add", TRUE, BYTE, op2(R, E), 0 }, /*01*/ { "add", TRUE, LONG, op2(R, E), 0 }, @@ -1300,7 +1312,13 @@ db_disasm(loc, altfmt) i_size = ip->i_size; i_mode = ip->i_mode; - if (ip->i_extra == db_Grp1 || ip->i_extra == db_Grp2 || + if (ip->i_extra == db_Grp9 && f_mod(rex, regmodrm) == 3) { + ip = &db_Grp9b[f_reg(rex, regmodrm)]; + i_name = ip->i_name; + i_size = ip->i_size; + i_mode = ip->i_mode; + } + else if (ip->i_extra == db_Grp1 || ip->i_extra == db_Grp2 || ip->i_extra == db_Grp6 || ip->i_extra == db_Grp7 || ip->i_extra == db_Grp8 || ip->i_extra == db_Grp9 || ip->i_extra == db_Grp15) { @@ -1511,6 +1529,10 @@ db_disasm(loc, altfmt) db_printf("%s", db_reg[rex != 0 ? 1 : 0][(rex & REX_R) ? QUAD : LONG][f_rm(rex, inst)]); break; + case Rv: + db_printf("%s", db_reg[rex != 0 ? 1 : 0][(size == LONG && (rex & REX_W)) ? QUAD : size][f_rm(rex, regmodrm)]); + break; + case S: db_printf("%s", db_seg_reg[f_reg(rex, regmodrm)]); break; From owner-svn-src-head@FreeBSD.ORG Sun May 18 03:50:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DAE46E2A; Sun, 18 May 2014 03:50:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDC422432; Sun, 18 May 2014 03:50:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4I3oHXJ048068; Sun, 18 May 2014 03:50:17 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4I3oHkl048065; Sun, 18 May 2014 03:50:17 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201405180350.s4I3oHkl048065@svn.freebsd.org> From: Peter Grehan Date: Sun, 18 May 2014 03:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266390 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 03:50:18 -0000 Author: grehan Date: Sun May 18 03:50:17 2014 New Revision: 266390 URL: http://svnweb.freebsd.org/changeset/base/266390 Log: Make the vmx asm code dtrace-fbt-friendly by - inserting frame enter/leave sequences - restructuring the vmx_enter_guest routine so that it subsumes the vm_exit_guest block, which was the #vmexit RIP and not a callable routine. Reviewed by: neel MFC after: 3 weeks Modified: head/sys/amd64/vmm/intel/vmx.h head/sys/amd64/vmm/intel/vmx_support.S Modified: head/sys/amd64/vmm/intel/vmx.h ============================================================================== --- head/sys/amd64/vmm/intel/vmx.h Sun May 18 01:20:51 2014 (r266389) +++ head/sys/amd64/vmm/intel/vmx.h Sun May 18 03:50:17 2014 (r266390) @@ -67,7 +67,7 @@ struct vmxctx { int inst_fail_status; /* - * The pmap needs to be deactivated in vmx_exit_guest() + * The pmap needs to be deactivated in vmx_enter_guest() * so keep a copy of the 'pmap' in each vmxctx. */ struct pmap *pmap; @@ -121,10 +121,11 @@ CTASSERT((offsetof(struct vmx, pir_desc[ #define VMX_VMLAUNCH_ERROR 2 #define VMX_INVEPT_ERROR 3 int vmx_enter_guest(struct vmxctx *ctx, struct vmx *vmx, int launched); -void vmx_exit_guest(void); void vmx_call_isr(uintptr_t entry); u_long vmx_fix_cr0(u_long cr0); u_long vmx_fix_cr4(u_long cr4); +extern char vmx_exit_guest[]; + #endif Modified: head/sys/amd64/vmm/intel/vmx_support.S ============================================================================== --- head/sys/amd64/vmm/intel/vmx_support.S Sun May 18 01:20:51 2014 (r266389) +++ head/sys/amd64/vmm/intel/vmx_support.S Sun May 18 03:50:17 2014 (r266390) @@ -37,6 +37,10 @@ #define LK #endif +/* Be friendly to DTrace FBT's prologue/epilogue pattern matching */ +#define VENTER push %rbp ; mov %rsp,%rbp +#define VLEAVE pop %rbp + /* * Assumes that %rdi holds a pointer to the 'vmxctx'. * @@ -98,6 +102,7 @@ * Interrupts must be disabled on entry. */ ENTRY(vmx_enter_guest) + VENTER /* * Save host state before doing anything else. */ @@ -183,14 +188,17 @@ inst_error: LK btrl %r10d, PM_ACTIVE(%r11) VMX_HOST_RESTORE + VLEAVE ret -END(vmx_enter_guest) /* - * void vmx_exit_guest(void) - * %rsp points to the struct vmxctx + * Non-error VM-exit from the guest. Make this a label so it can + * be used by C code when setting up the VMCS. + * The VMCS-restored %rsp points to the struct vmxctx */ -ENTRY(vmx_exit_guest) + ALIGN_TEXT + .globl vmx_exit_guest +vmx_exit_guest: /* * Save guest state that is not automatically saved in the vmcs. */ @@ -229,8 +237,9 @@ ENTRY(vmx_exit_guest) * value of VMX_GUEST_VMEXIT. */ movl $VMX_GUEST_VMEXIT, %eax + VLEAVE ret -END(vmx_exit_guest) +END(vmx_enter_guest) /* * %rdi = interrupt handler entry point @@ -239,6 +248,7 @@ END(vmx_exit_guest) * instruction in Intel SDM, Vol 2. */ ENTRY(vmx_call_isr) + VENTER mov %rsp, %r11 /* save %rsp */ and $~0xf, %rsp /* align on 16-byte boundary */ pushq $KERNEL_SS /* %ss */ @@ -247,5 +257,6 @@ ENTRY(vmx_call_isr) pushq $KERNEL_CS /* %cs */ cli /* disable interrupts */ callq *%rdi /* push %rip and call isr */ + VLEAVE ret END(vmx_call_isr) From owner-svn-src-head@FreeBSD.ORG Sun May 18 03:57:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6706FFDC; Sun, 18 May 2014 03:57:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4666024D8; Sun, 18 May 2014 03:57:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4I3vt1I050497; Sun, 18 May 2014 03:57:55 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4I3vsrL050494; Sun, 18 May 2014 03:57:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405180357.s4I3vsrL050494@svn.freebsd.org> From: John Baldwin Date: Sun, 18 May 2014 03:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266391 - head/contrib/binutils/opcodes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 03:57:55 -0000 Author: jhb Date: Sun May 18 03:57:54 2014 New Revision: 266391 URL: http://svnweb.freebsd.org/changeset/base/266391 Log: Add support for the 'rdseed' instruction. Modified: head/contrib/binutils/opcodes/i386-dis.c head/contrib/binutils/opcodes/i386-opc.tbl head/contrib/binutils/opcodes/i386-tbl.h Modified: head/contrib/binutils/opcodes/i386-dis.c ============================================================================== --- head/contrib/binutils/opcodes/i386-dis.c Sun May 18 03:50:17 2014 (r266390) +++ head/contrib/binutils/opcodes/i386-dis.c Sun May 18 03:57:54 2014 (r266391) @@ -85,6 +85,7 @@ static void OP_MS (int, int); static void OP_XS (int, int); static void OP_M (int, int); static void OP_VMX (int, int); +static void OP_VMX2 (int, int); static void OP_0fae (int, int); static void OP_0f07 (int, int); static void NOP_Fixup1 (int, int); @@ -318,6 +319,7 @@ fetch_data (struct disassemble_info *inf #define EMC { OP_EMC, v_mode } #define MXC { OP_MXC, 0 } #define VM { OP_VMX, q_mode } +#define VM2 { OP_VMX2, q_mode } #define OPSUF { OP_3DNowSuffix, 0 } #define OPSIMD { OP_SIMD_Suffix, 0 } #define XMM0 { XMM_Fixup, 0 } @@ -1732,7 +1734,7 @@ static const struct dis386 grps[][8] = { { "(bad)", { XX } }, { "(bad)", { XX } }, { "", { VM } }, /* See OP_VMX. */ - { "vmptrst", { Mq } }, + { "", { VM2 } }, /* See OP_VMX2. */ }, /* GRP11_C6 */ { @@ -6467,6 +6469,21 @@ OP_VMX (int bytemode, int sizeflag) } static void +OP_VMX2 (int bytemode, int sizeflag) +{ + if (modrm.mod == 3) + { + strcpy (obuf, "rdseed"); + OP_E (v_mode, sizeflag); + } + else + { + strcpy (obuf, "vmptrst"); + OP_M (q_mode, sizeflag); + } +} + +static void REP_Fixup (int bytemode, int sizeflag) { /* The 0xf3 prefix should be displayed as "rep" for ins, outs, movs, Modified: head/contrib/binutils/opcodes/i386-opc.tbl ============================================================================== --- head/contrib/binutils/opcodes/i386-opc.tbl Sun May 18 03:50:17 2014 (r266390) +++ head/contrib/binutils/opcodes/i386-opc.tbl Sun May 18 03:57:54 2014 (r266391) @@ -1524,3 +1524,4 @@ pclmulhqhqdq, 2, 0x660f3a44, 0x11, CpuPC // Intel Random Number Generator extensions rdrand, 1, 0x0fc7, 0x6, CpuRdRnd, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { Reg16|Reg32|Reg64 } +rdseed, 1, 0x0fc7, 0x7, CpuRdRnd, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf, { Reg16|Reg32|Reg64 } Modified: head/contrib/binutils/opcodes/i386-tbl.h ============================================================================== --- head/contrib/binutils/opcodes/i386-tbl.h Sun May 18 03:50:17 2014 (r266390) +++ head/contrib/binutils/opcodes/i386-tbl.h Sun May 18 03:57:54 2014 (r266391) @@ -4391,6 +4391,9 @@ const template i386_optab[] = {"rdrand", 1, 0x0fc7, 0x6, CpuRdRnd, Modrm|NoSuf, { Reg16|Reg32|Reg64 } }, + {"rdseed", 1, 0x0fc7, 0x7, CpuRdRnd, + Modrm|NoSuf, + { Reg16|Reg32|Reg64 } }, /* Intel Supervisor Mode Access Prevention extensions */ {"clac", 0, 0x0f01, 0xca, CpuSMAP, From owner-svn-src-head@FreeBSD.ORG Sun May 18 04:21:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BEAFC3FB; Sun, 18 May 2014 04:21:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8514226AD; Sun, 18 May 2014 04:21:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4I4LDUE063967; Sun, 18 May 2014 04:21:13 GMT (envelope-from allanjude@svn.freebsd.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4I4LDtK063965; Sun, 18 May 2014 04:21:13 GMT (envelope-from allanjude@svn.freebsd.org) Message-Id: <201405180421.s4I4LDtK063965@svn.freebsd.org> From: Allan Jude Date: Sun, 18 May 2014 04:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266392 - in head: share/misc usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 04:21:13 -0000 Author: allanjude (doc committer) Date: Sun May 18 04:21:12 2014 New Revision: 266392 URL: http://svnweb.freebsd.org/changeset/base/266392 Log: Note my mentors in the committers graph. Add my birthday to the calendar. Approved by: bcr (mentor) Modified: head/share/misc/committers-doc.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-doc.dot ============================================================================== --- head/share/misc/committers-doc.dot Sun May 18 03:57:54 2014 (r266391) +++ head/share/misc/committers-doc.dot Sun May 18 04:21:12 2014 (r266392) @@ -51,6 +51,7 @@ node [color=lightblue2, style=filled, bg # Current doc committers go here. Try to keep things sorted. ale [label="Alex Dupre\nale@FreeBSD.org\n2003/12/22"] +allanjude [label="Allan Jude\nallanjude@FreeBSD.org\n2014/05/17"] bcr [label="Benedict Reuschling\nbcr@FreeBSD.org\n2009/12/24"] blackend [label="Marc Fonvieille\nblackend@FreeBSD.org\n2002/06/16"] brd [label="Brad Davis\nbrd@FreeBSD.org\n2005/06/01"] @@ -100,6 +101,7 @@ bcr -> eadler bcr -> dru bcr -> crees bcr -> jgh +bcr -> allanjude blackend -> ale @@ -116,6 +118,8 @@ den -> marck delphij -> chinsan delphij -> loader +eadler -> allanjude + gabor -> pgj gabor -> manolis gabor -> taras @@ -176,4 +180,5 @@ trhodes -> danger trhodes -> jcamou wblock -> jgh +wblock -> allanjude } Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Sun May 18 03:57:54 2014 (r266391) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sun May 18 04:21:12 2014 (r266392) @@ -279,6 +279,7 @@ 09/01 Pyun YongHyeon born in Kimcheon, Korea, 1968 09/01 William Grzybowski born in Parana, Brazil, 1988 09/03 Max Khon born in Novosibirsk, USSR, 1976 +09/03 Allan Jude born in Hamilton, Ontario, Canada, 1984 09/03 Cheng-Lung Sung born in Taipei, Taiwan, Republic of China, 1977 09/05 Mark Robert Vaughan Murray born in Harare, Mashonaland, Zimbabwe, 1961 09/05 Adrian Harold Chadd born in Perth, Western Australia, Australia, 1979 From owner-svn-src-head@FreeBSD.ORG Sun May 18 09:13:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35CA1932; Sun, 18 May 2014 09:13:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2228A2921; Sun, 18 May 2014 09:13:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4I9DV6D044155; Sun, 18 May 2014 09:13:31 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4I9DT3x044147; Sun, 18 May 2014 09:13:29 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405180913.s4I9DT3x044147@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 18 May 2014 09:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266394 - in head/sys/dev/usb: . controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 09:13:31 -0000 Author: hselasky Date: Sun May 18 09:13:29 2014 New Revision: 266394 URL: http://svnweb.freebsd.org/changeset/base/266394 Log: - Add softc pointer argument to FIFO functions as an optimisation. - Implement support for interrupt filters in the DWC OTG driver, to reduce the amount of CPU task switching when only feeding the FIFOs. - Add common spinlock to the USB bus structure. MFC after: 2 weeks Modified: head/sys/dev/usb/controller/dwc_otg.c head/sys/dev/usb/controller/dwc_otg.h head/sys/dev/usb/controller/dwc_otg_atmelarm.c head/sys/dev/usb/controller/dwc_otg_fdt.c head/sys/dev/usb/controller/usb_controller.c head/sys/dev/usb/usb_bus.h head/sys/dev/usb/usb_core.h Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Sun May 18 04:33:24 2014 (r266393) +++ head/sys/dev/usb/controller/dwc_otg.c Sun May 18 09:13:29 2014 (r266394) @@ -89,9 +89,6 @@ ((struct dwc_otg_softc *)(((uint8_t *)(bus)) - \ ((uint8_t *)&(((struct dwc_otg_softc *)0)->sc_bus)))) -#define DWC_OTG_PC2SC(pc) \ - DWC_OTG_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus) - #define DWC_OTG_PC2UDEV(pc) \ (USB_DMATAG_TO_XROOT((pc)->tag_parent)->udev) @@ -104,6 +101,11 @@ GINTMSK_OTGINTMSK | \ GINTMSK_PRTINTMSK) +#define DWC_OTG_MSK_GINT_THREAD_IRQ \ + (GINTSTS_USBRST | GINTSTS_ENUMDONE | GINTSTS_PRTINT | \ + GINTSTS_WKUPINT | GINTSTS_USBSUSP | GINTMSK_OTGINTMSK | \ + GINTSTS_SESSREQINT) + static int dwc_otg_use_hsic; static SYSCTL_NODE(_hw_usb, OID_AUTO, dwc_otg, CTLFLAG_RW, 0, "USB DWC OTG"); @@ -590,9 +592,8 @@ dwc_otg_clear_hcint(struct dwc_otg_softc } static uint8_t -dwc_otg_host_channel_alloc(struct dwc_otg_td *td, uint8_t which, uint8_t is_out) +dwc_otg_host_channel_alloc(struct dwc_otg_softc *sc, struct dwc_otg_td *td, uint8_t which, uint8_t is_out) { - struct dwc_otg_softc *sc; uint32_t tx_p_size; uint32_t tx_np_size; uint8_t x; @@ -604,9 +605,6 @@ dwc_otg_host_channel_alloc(struct dwc_ot if (DWC_OTG_PC2UDEV(td->pc)->flags.self_suspended != 0) return (1); /* busy - cannot transfer data */ - /* get pointer to softc */ - sc = DWC_OTG_PC2SC(td->pc); - /* compute needed TX FIFO size */ if (is_out != 0) { if (td->ep_type == UE_INTERRUPT || @@ -670,9 +668,8 @@ dwc_otg_host_channel_alloc(struct dwc_ot } static void -dwc_otg_host_channel_free(struct dwc_otg_td *td, uint8_t which) +dwc_otg_host_channel_free(struct dwc_otg_softc *sc, struct dwc_otg_td *td, uint8_t which) { - struct dwc_otg_softc *sc; uint8_t x; if (td->channel[which] >= DWC_OTG_MAX_CHANNELS) @@ -684,9 +681,6 @@ dwc_otg_host_channel_free(struct dwc_otg DPRINTF("CH=%d\n", x); - /* get pointer to softc */ - sc = DWC_OTG_PC2SC(td->pc); - /* * We need to let programmed host channels run till complete * else the host channel will stop functioning. Assume that @@ -714,17 +708,13 @@ dwc_otg_host_channel_free(struct dwc_otg } static uint8_t -dwc_otg_host_setup_tx(struct dwc_otg_td *td) +dwc_otg_host_setup_tx(struct dwc_otg_softc *sc, struct dwc_otg_td *td) { struct usb_device_request req __aligned(4); - struct dwc_otg_softc *sc; uint32_t hcint; uint32_t hcchar; uint8_t delta; - /* get pointer to softc */ - sc = DWC_OTG_PC2SC(td->pc); - if (td->channel[0] < DWC_OTG_MAX_CHANNELS) { hcint = sc->sc_chan_state[td->channel[0]].hcint; @@ -814,7 +804,7 @@ check_state: send_pkt: /* free existing channel, if any */ - dwc_otg_host_channel_free(td, 0); + dwc_otg_host_channel_free(sc, td, 0); if (sizeof(req) != td->remainder) { td->error_any = 1; @@ -837,7 +827,7 @@ send_pkt: } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(td, 0, 1)) { + if (dwc_otg_host_channel_alloc(sc, td, 0, 1)) { td->state = DWC_CHAN_ST_START; goto busy; } @@ -875,7 +865,7 @@ send_pkt: send_cpkt: /* free existing channel, if any */ - dwc_otg_host_channel_free(td, 0); + dwc_otg_host_channel_free(sc, td, 0); delta = td->tt_complete_slot - sc->sc_last_frame_num - 1; if (td->tt_scheduled == 0 || delta < DWC_OTG_TT_SLOT_MAX) { @@ -890,7 +880,7 @@ send_cpkt: goto complete; } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(td, 0, 0)) { + if (dwc_otg_host_channel_alloc(sc, td, 0, 0)) { td->state = DWC_CHAN_ST_WAIT_C_PKT; goto busy; } @@ -917,21 +907,17 @@ busy: return (1); /* busy */ complete: - dwc_otg_host_channel_free(td, 0); + dwc_otg_host_channel_free(sc, td, 0); return (0); /* complete */ } static uint8_t -dwc_otg_setup_rx(struct dwc_otg_td *td) +dwc_otg_setup_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td) { - struct dwc_otg_softc *sc; struct usb_device_request req __aligned(4); uint32_t temp; uint16_t count; - /* get pointer to softc */ - sc = DWC_OTG_PC2SC(td->pc); - /* check endpoint status */ if (sc->sc_last_rx_status == 0) @@ -1072,13 +1058,8 @@ dwc_otg_host_rate_check_interrupt(struct } static uint8_t -dwc_otg_host_rate_check(struct dwc_otg_td *td) +dwc_otg_host_rate_check(struct dwc_otg_softc *sc, struct dwc_otg_td *td) { - struct dwc_otg_softc *sc; - - /* get pointer to softc */ - sc = DWC_OTG_PC2SC(td->pc); - if (td->ep_type == UE_ISOCHRONOUS) { /* non TT isochronous traffic */ if ((td->tmr_val != 0) || @@ -1104,17 +1085,14 @@ busy: } static uint8_t -dwc_otg_host_data_rx(struct dwc_otg_td *td) +dwc_otg_host_data_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td) { - struct dwc_otg_softc *sc; uint32_t hcint; uint32_t hcchar; uint32_t count; uint8_t delta; uint8_t channel; - /* get pointer to softc */ - sc = DWC_OTG_PC2SC(td->pc); channel = td->channel[td->tt_channel_tog]; if (channel < DWC_OTG_MAX_CHANNELS) { @@ -1328,7 +1306,7 @@ check_state: receive_pkt: /* free existing channel, if any */ - dwc_otg_host_channel_free(td, td->tt_channel_tog); + dwc_otg_host_channel_free(sc, td, td->tt_channel_tog); if (td->hcsplt != 0) { delta = td->tt_complete_slot - sc->sc_last_frame_num - 1; @@ -1346,13 +1324,13 @@ receive_pkt: /* complete split */ td->hcsplt |= HCSPLT_COMPSPLT; } else if (td->tt_xactpos == HCSPLT_XACTPOS_BEGIN && - dwc_otg_host_rate_check(td)) { + dwc_otg_host_rate_check(sc, td)) { td->state = DWC_CHAN_ST_WAIT_C_PKT; goto busy; } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(td, td->tt_channel_tog, 0)) { + if (dwc_otg_host_channel_alloc(sc, td, td->tt_channel_tog, 0)) { td->state = DWC_CHAN_ST_WAIT_C_PKT; goto busy; } @@ -1417,8 +1395,8 @@ receive_pkt: receive_spkt: /* free existing channel(s), if any */ - dwc_otg_host_channel_free(td, 0); - dwc_otg_host_channel_free(td, 1); + dwc_otg_host_channel_free(sc, td, 0); + dwc_otg_host_channel_free(sc, td, 1); delta = td->tt_start_slot - sc->sc_last_frame_num - 1; if (td->tt_scheduled == 0 || delta < DWC_OTG_TT_SLOT_MAX) { @@ -1434,7 +1412,7 @@ receive_spkt: } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(td, 0, 0)) { + if (dwc_otg_host_channel_alloc(sc, td, 0, 0)) { td->state = DWC_CHAN_ST_START; goto busy; } @@ -1468,24 +1446,20 @@ busy: return (1); /* busy */ complete: - dwc_otg_host_channel_free(td, 0); - dwc_otg_host_channel_free(td, 1); + dwc_otg_host_channel_free(sc, td, 0); + dwc_otg_host_channel_free(sc, td, 1); return (0); /* complete */ } static uint8_t -dwc_otg_data_rx(struct dwc_otg_td *td) +dwc_otg_data_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td) { - struct dwc_otg_softc *sc; uint32_t temp; uint16_t count; uint8_t got_short; got_short = 0; - /* get pointer to softc */ - sc = DWC_OTG_PC2SC(td->pc); - /* check endpoint status */ if (sc->sc_last_rx_status == 0) goto not_complete; @@ -1587,17 +1561,14 @@ not_complete: } static uint8_t -dwc_otg_host_data_tx(struct dwc_otg_td *td) +dwc_otg_host_data_tx(struct dwc_otg_softc *sc, struct dwc_otg_td *td) { - struct dwc_otg_softc *sc; uint32_t count; uint32_t hcint; uint32_t hcchar; uint8_t delta; uint8_t channel; - /* get pointer to softc */ - sc = DWC_OTG_PC2SC(td->pc); channel = td->channel[td->tt_channel_tog]; if (channel < DWC_OTG_MAX_CHANNELS) { @@ -1723,14 +1694,14 @@ check_state: td->tt_xactpos++; /* free existing channel, if any */ - dwc_otg_host_channel_free(td, td->tt_channel_tog); + dwc_otg_host_channel_free(sc, td, td->tt_channel_tog); td->state = DWC_CHAN_ST_TX_PKT_ISOC; /* FALLTHROUGH */ case DWC_CHAN_ST_TX_PKT_ISOC: - if (dwc_otg_host_channel_alloc(td, 0, 1)) + if (dwc_otg_host_channel_alloc(sc, td, 0, 1)) break; channel = td->channel[0]; goto send_isoc_pkt; @@ -1741,8 +1712,8 @@ check_state: send_pkt: /* free existing channel(s), if any */ - dwc_otg_host_channel_free(td, 0); - dwc_otg_host_channel_free(td, 1); + dwc_otg_host_channel_free(sc, td, 0); + dwc_otg_host_channel_free(sc, td, 1); if (td->hcsplt != 0) { delta = td->tt_start_slot - sc->sc_last_frame_num - 1; @@ -1757,13 +1728,13 @@ send_pkt: td->state = DWC_CHAN_ST_START; goto busy; } - } else if (dwc_otg_host_rate_check(td)) { + } else if (dwc_otg_host_rate_check(sc, td)) { td->state = DWC_CHAN_ST_START; goto busy; } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(td, 0, 1)) { + if (dwc_otg_host_channel_alloc(sc, td, 0, 1)) { td->state = DWC_CHAN_ST_START; goto busy; } @@ -1912,7 +1883,7 @@ send_isoc_pkt: send_cpkt: /* free existing channel, if any */ - dwc_otg_host_channel_free(td, td->tt_channel_tog); + dwc_otg_host_channel_free(sc, td, td->tt_channel_tog); delta = td->tt_complete_slot - sc->sc_last_frame_num - 1; if (td->tt_scheduled == 0 || delta < DWC_OTG_TT_SLOT_MAX) { @@ -1928,7 +1899,7 @@ send_cpkt: } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(td, td->tt_channel_tog, 0)) { + if (dwc_otg_host_channel_alloc(sc, td, td->tt_channel_tog, 0)) { td->state = DWC_CHAN_ST_WAIT_C_PKT; goto busy; } @@ -1986,15 +1957,14 @@ busy: return (1); /* busy */ complete: - dwc_otg_host_channel_free(td, 0); - dwc_otg_host_channel_free(td, 1); + dwc_otg_host_channel_free(sc, td, 0); + dwc_otg_host_channel_free(sc, td, 1); return (0); /* complete */ } static uint8_t -dwc_otg_data_tx(struct dwc_otg_td *td) +dwc_otg_data_tx(struct dwc_otg_softc *sc, struct dwc_otg_td *td) { - struct dwc_otg_softc *sc; uint32_t max_buffer; uint32_t count; uint32_t fifo_left; @@ -2004,9 +1974,6 @@ dwc_otg_data_tx(struct dwc_otg_td *td) to = 3; /* don't loop forever! */ - /* get pointer to softc */ - sc = DWC_OTG_PC2SC(td->pc); - max_buffer = sc->sc_hw_ep_profile[td->ep_no].max_buffer; repeat: @@ -2184,14 +2151,10 @@ not_complete: } static uint8_t -dwc_otg_data_tx_sync(struct dwc_otg_td *td) +dwc_otg_data_tx_sync(struct dwc_otg_softc *sc, struct dwc_otg_td *td) { - struct dwc_otg_softc *sc; uint32_t temp; - /* get pointer to softc */ - sc = DWC_OTG_PC2SC(td->pc); - /* * If all packets are transferred we are complete: */ @@ -2228,8 +2191,8 @@ not_complete: return (1); /* not complete */ } -static uint8_t -dwc_otg_xfer_do_fifo(struct usb_xfer *xfer) +static void +dwc_otg_xfer_do_fifo(struct dwc_otg_softc *sc, struct usb_xfer *xfer) { struct dwc_otg_td *td; uint8_t toggle; @@ -2239,9 +2202,11 @@ dwc_otg_xfer_do_fifo(struct usb_xfer *xf DPRINTFN(9, "\n"); td = xfer->td_transfer_cache; + if (td == NULL) + return; while (1) { - if ((td->func) (td)) { + if ((td->func) (sc, td)) { /* operation in progress */ break; } @@ -2272,13 +2237,27 @@ dwc_otg_xfer_do_fifo(struct usb_xfer *xf td->tmr_res = tmr_res; td->tmr_val = tmr_val; } - return (1); /* not complete */ + return; done: - /* compute all actual lengths */ + xfer->td_transfer_cache = NULL; + sc->sc_xfer_complete = 1; +} - dwc_otg_standard_done(xfer); - return (0); /* complete */ +static uint8_t +dwc_otg_xfer_do_complete(struct dwc_otg_softc *sc, struct usb_xfer *xfer) +{ + struct dwc_otg_td *td; + + DPRINTFN(9, "\n"); + + td = xfer->td_transfer_cache; + if (td == NULL) { + /* compute all actual lengths */ + dwc_otg_standard_done(xfer); + return (1); + } + return (0); } static void @@ -2292,6 +2271,8 @@ dwc_otg_timer(void *_sc) DPRINTF("\n"); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + /* increment timer value */ sc->sc_tmr_val++; @@ -2306,6 +2287,8 @@ dwc_otg_timer(void *_sc) /* enable SOF interrupt, which will poll jobs */ dwc_otg_enable_sof_irq(sc); + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); + if (sc->sc_timer_active) { /* restart timer */ usb_callout_reset(&sc->sc_timer, @@ -2621,13 +2604,9 @@ repeat: got_rx_status = 1; } - /* scan for completion events first */ - TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { - if (!dwc_otg_xfer_do_fifo(xfer)) { - /* queue has been modified */ - goto repeat; - } - } + /* execute FIFOs */ + TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) + dwc_otg_xfer_do_fifo(sc, xfer); if (got_rx_status) { /* check if data was consumed */ @@ -2639,7 +2618,7 @@ repeat: DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); } - if (sc->sc_flags.status_device_mode == 0) { + if (sc->sc_flags.status_device_mode == 0 && sc->sc_xfer_complete == 0) { /* update host transfer schedule, so that new transfers can be issued */ if (dwc_otg_update_host_transfer_schedule(sc)) goto repeat; @@ -2647,6 +2626,18 @@ repeat: } static void +dwc_otg_interrupt_complete(struct dwc_otg_softc *sc) +{ + struct usb_xfer *xfer; +repeat: + /* scan for completion events */ + TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { + if (dwc_otg_xfer_do_complete(sc, xfer)) + goto repeat; + } +} + +static void dwc_otg_vbus_interrupt(struct dwc_otg_softc *sc, uint8_t is_on) { DPRINTFN(5, "vbus = %u\n", is_on); @@ -2679,16 +2670,64 @@ dwc_otg_vbus_interrupt(struct dwc_otg_so } } +int +dwc_otg_filter_interrupt(void *arg) +{ + struct dwc_otg_softc *sc = arg; + int retval = FILTER_HANDLED; + uint32_t status; + + /* read and clear interrupt status */ + status = DWC_OTG_READ_4(sc, DOTG_GINTSTS); + + /* clear interrupts we are handling here */ + DWC_OTG_WRITE_4(sc, DOTG_GINTSTS, status & ~DWC_OTG_MSK_GINT_THREAD_IRQ); + + /* check for USB state change interrupts */ + if ((status & DWC_OTG_MSK_GINT_THREAD_IRQ) != 0) + retval = FILTER_SCHEDULE_THREAD; + + /* clear all IN endpoint interrupts */ + if (status & GINTSTS_IEPINT) { + uint32_t temp; + uint8_t x; + + for (x = 0; x != sc->sc_dev_in_ep_max; x++) { + temp = DWC_OTG_READ_4(sc, DOTG_DIEPINT(x)); + if (temp & DIEPMSK_XFERCOMPLMSK) { + DWC_OTG_WRITE_4(sc, DOTG_DIEPINT(x), + DIEPMSK_XFERCOMPLMSK); + } + } + } + + USB_BUS_SPIN_LOCK(&sc->sc_bus); + + /* poll FIFOs, if any */ + dwc_otg_interrupt_poll(sc); + + if (sc->sc_xfer_complete != 0) + retval = FILTER_SCHEDULE_THREAD; + + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); + + return (retval); +} + void -dwc_otg_interrupt(struct dwc_otg_softc *sc) +dwc_otg_interrupt(void *arg) { + struct dwc_otg_softc *sc = arg; uint32_t status; USB_BUS_LOCK(&sc->sc_bus); + USB_BUS_SPIN_LOCK(&sc->sc_bus); /* read and clear interrupt status */ status = DWC_OTG_READ_4(sc, DOTG_GINTSTS); - DWC_OTG_WRITE_4(sc, DOTG_GINTSTS, status); + + /* clear interrupts we are handling here */ + DWC_OTG_WRITE_4(sc, DOTG_GINTSTS, status & DWC_OTG_MSK_GINT_THREAD_IRQ); DPRINTFN(14, "GINTSTS=0x%08x HAINT=0x%08x HFNUM=0x%08x\n", status, DWC_OTG_READ_4(sc, DOTG_HAINT), @@ -2858,23 +2897,20 @@ dwc_otg_interrupt(struct dwc_otg_softc * (temp & (GOTGCTL_ASESVLD | GOTGCTL_BSESVLD)) ? 1 : 0); } - /* clear all IN endpoint interrupts */ - if (status & GINTSTS_IEPINT) { - uint32_t temp; - uint8_t x; + if (sc->sc_xfer_complete != 0) { + sc->sc_xfer_complete = 0; - for (x = 0; x != sc->sc_dev_in_ep_max; x++) { - temp = DWC_OTG_READ_4(sc, DOTG_DIEPINT(x)); - if (temp & DIEPMSK_XFERCOMPLMSK) { - DWC_OTG_WRITE_4(sc, DOTG_DIEPINT(x), - DIEPMSK_XFERCOMPLMSK); - } + /* complete FIFOs, if any */ + dwc_otg_interrupt_complete(sc); + + if (sc->sc_flags.status_device_mode == 0) { + /* update host transfer schedule, so that new transfers can be issued */ + if (dwc_otg_update_host_transfer_schedule(sc)) + dwc_otg_interrupt_poll(sc); } } - /* poll FIFO(s) */ - dwc_otg_interrupt_poll(sc); - + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); USB_BUS_UNLOCK(&sc->sc_bus); } @@ -3238,9 +3274,12 @@ dwc_otg_start_standard_chain(struct usb_ * endpoint interrupts. Else wait for SOF interrupt in host * mode. */ - if (sc->sc_flags.status_device_mode != 0 && - dwc_otg_xfer_do_fifo(xfer) == 0) - goto done; + if (sc->sc_flags.status_device_mode != 0) { + dwc_otg_xfer_do_fifo(sc, xfer); + if (dwc_otg_xfer_do_complete(sc, xfer)) + return; + } + USB_BUS_SPIN_LOCK(&sc->sc_bus); /* put transfer on interrupt queue */ usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer); @@ -3274,7 +3313,8 @@ dwc_otg_start_standard_chain(struct usb_ /* reset NAK counter */ td->did_nak = 0; } -done:; +done: + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void @@ -3411,19 +3451,21 @@ done: static void dwc_otg_device_done(struct usb_xfer *xfer, usb_error_t error) { + struct dwc_otg_softc *sc = DWC_OTG_BUS2SC(xfer->xroot->bus); + DPRINTFN(9, "xfer=%p, endpoint=%p, error=%d\n", xfer, xfer->endpoint, error); if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) { - DPRINTFN(15, "disabled interrupts!\n"); + /* Interrupts are cleared by the interrupt handler */ } else { struct dwc_otg_td *td; td = xfer->td_transfer_first; if (td != NULL) { - dwc_otg_host_channel_free(td, 0); - dwc_otg_host_channel_free(td, 1); + dwc_otg_host_channel_free(sc, td, 0); + dwc_otg_host_channel_free(sc, td, 1); } } /* dequeue transfer and start next transfer */ @@ -3484,6 +3526,7 @@ dwc_otg_set_stall(struct usb_device *ude dwc_otg_common_rx_ack(sc); /* poll interrupt */ dwc_otg_interrupt_poll(sc); + dwc_otg_interrupt_complete(sc); } } } @@ -3548,6 +3591,7 @@ dwc_otg_clear_stall_sub(struct dwc_otg_s /* poll interrupt */ dwc_otg_interrupt_poll(sc); + dwc_otg_interrupt_complete(sc); } static void @@ -3846,7 +3890,15 @@ dwc_otg_do_poll(struct usb_bus *bus) struct dwc_otg_softc *sc = DWC_OTG_BUS2SC(bus); USB_BUS_LOCK(&sc->sc_bus); + USB_BUS_SPIN_LOCK(&sc->sc_bus); dwc_otg_interrupt_poll(sc); + dwc_otg_interrupt_complete(sc); + if (sc->sc_flags.status_device_mode == 0) { + /* update host transfer schedule, so that new transfers can be issued */ + if (dwc_otg_update_host_transfer_schedule(sc)) + dwc_otg_interrupt_poll(sc); + } + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); USB_BUS_UNLOCK(&sc->sc_bus); } Modified: head/sys/dev/usb/controller/dwc_otg.h ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.h Sun May 18 04:33:24 2014 (r266393) +++ head/sys/dev/usb/controller/dwc_otg.h Sun May 18 09:13:29 2014 (r266394) @@ -48,7 +48,7 @@ struct dwc_otg_td; struct dwc_otg_softc; -typedef uint8_t (dwc_otg_cmd_t)(struct dwc_otg_td *td); +typedef uint8_t (dwc_otg_cmd_t)(struct dwc_otg_softc *sc, struct dwc_otg_td *td); struct dwc_otg_td { struct dwc_otg_td *obj_next; @@ -184,6 +184,7 @@ struct dwc_otg_softc { struct dwc_otg_chan_state sc_chan_state[DWC_OTG_MAX_CHANNELS]; uint32_t sc_tmr_val; uint32_t sc_hprt_val; + uint32_t sc_xfer_complete; uint16_t sc_active_rx_ep; uint16_t sc_last_frame_num; @@ -207,7 +208,8 @@ struct dwc_otg_softc { /* prototypes */ -void dwc_otg_interrupt(struct dwc_otg_softc *); +driver_filter_t dwc_otg_filter_interrupt; +driver_intr_t dwc_otg_interrupt; int dwc_otg_init(struct dwc_otg_softc *); void dwc_otg_uninit(struct dwc_otg_softc *); Modified: head/sys/dev/usb/controller/dwc_otg_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg_atmelarm.c Sun May 18 04:33:24 2014 (r266393) +++ head/sys/dev/usb/controller/dwc_otg_atmelarm.c Sun May 18 09:13:29 2014 (r266394) @@ -116,7 +116,7 @@ dwc_otg_attach(device_t dev) device_set_ivars(sc->sc_otg.sc_bus.bdev, &sc->sc_otg.sc_bus); err = bus_setup_intr(dev, sc->sc_otg.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)dwc_otg_interrupt, sc, &sc->sc_otg.sc_intr_hdl); + &dwc_otg_filter_interrupt, &dwc_otg_interrupt, sc, &sc->sc_otg.sc_intr_hdl); if (err) { sc->sc_otg.sc_intr_hdl = NULL; goto error; Modified: head/sys/dev/usb/controller/dwc_otg_fdt.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg_fdt.c Sun May 18 04:33:24 2014 (r266393) +++ head/sys/dev/usb/controller/dwc_otg_fdt.c Sun May 18 09:13:29 2014 (r266394) @@ -147,7 +147,7 @@ dwc_otg_attach(device_t dev) device_set_ivars(sc->sc_otg.sc_bus.bdev, &sc->sc_otg.sc_bus); err = bus_setup_intr(dev, sc->sc_otg.sc_irq_res, INTR_TYPE_TTY | INTR_MPSAFE, - NULL, (driver_intr_t *)dwc_otg_interrupt, sc, &sc->sc_otg.sc_intr_hdl); + &dwc_otg_filter_interrupt, &dwc_otg_interrupt, sc, &sc->sc_otg.sc_intr_hdl); if (err) { sc->sc_otg.sc_intr_hdl = NULL; goto error; Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Sun May 18 04:33:24 2014 (r266393) +++ head/sys/dev/usb/controller/usb_controller.c Sun May 18 09:13:29 2014 (r266394) @@ -901,6 +901,9 @@ usb_bus_mem_alloc_all(struct usb_bus *bu mtx_init(&bus->bus_mtx, device_get_nameunit(bus->parent), NULL, MTX_DEF | MTX_RECURSE); + mtx_init(&bus->bus_spin_lock, device_get_nameunit(bus->parent), + NULL, MTX_SPIN | MTX_RECURSE); + usb_callout_init_mtx(&bus->power_wdog, &bus->bus_mtx, 0); @@ -954,6 +957,7 @@ usb_bus_mem_free_all(struct usb_bus *bus #endif mtx_destroy(&bus->bus_mtx); + mtx_destroy(&bus->bus_spin_lock); } /* convenience wrappers */ Modified: head/sys/dev/usb/usb_bus.h ============================================================================== --- head/sys/dev/usb/usb_bus.h Sun May 18 04:33:24 2014 (r266393) +++ head/sys/dev/usb/usb_bus.h Sun May 18 09:13:29 2014 (r266394) @@ -87,6 +87,7 @@ struct usb_bus { * This mutex protects the USB hardware: */ struct mtx bus_mtx; + struct mtx bus_spin_lock; struct usb_xfer_queue intr_q; struct usb_callout power_wdog; /* power management */ Modified: head/sys/dev/usb/usb_core.h ============================================================================== --- head/sys/dev/usb/usb_core.h Sun May 18 04:33:24 2014 (r266393) +++ head/sys/dev/usb/usb_core.h Sun May 18 09:13:29 2014 (r266394) @@ -44,6 +44,9 @@ #define USB_BUS_LOCK(_b) mtx_lock(&(_b)->bus_mtx) #define USB_BUS_UNLOCK(_b) mtx_unlock(&(_b)->bus_mtx) #define USB_BUS_LOCK_ASSERT(_b, _t) mtx_assert(&(_b)->bus_mtx, _t) +#define USB_BUS_SPIN_LOCK(_b) mtx_lock_spin(&(_b)->bus_spin_lock) +#define USB_BUS_SPIN_UNLOCK(_b) mtx_unlock_spin(&(_b)->bus_spin_lock) +#define USB_BUS_SPIN_LOCK_ASSERT(_b, _t) mtx_assert(&(_b)->bus_spin_lock, _t) #define USB_XFER_LOCK(_x) mtx_lock((_x)->xroot->xfer_mtx) #define USB_XFER_UNLOCK(_x) mtx_unlock((_x)->xroot->xfer_mtx) #define USB_XFER_LOCK_ASSERT(_x, _t) mtx_assert((_x)->xroot->xfer_mtx, _t) From owner-svn-src-head@FreeBSD.ORG Sun May 18 09:19:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB973AB4; Sun, 18 May 2014 09:19:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8A462941; Sun, 18 May 2014 09:19:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4I9JDUO044950; Sun, 18 May 2014 09:19:13 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4I9JDY2044949; Sun, 18 May 2014 09:19:13 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405180919.s4I9JDY2044949@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 18 May 2014 09:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266395 - in head/sys: dev/usb/controller modules/usb/dwc_otg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 09:19:14 -0000 Author: hselasky Date: Sun May 18 09:19:13 2014 New Revision: 266395 URL: http://svnweb.freebsd.org/changeset/base/266395 Log: - Remove no longer used file. FDT is used to attach device drivers. Deleted: head/sys/dev/usb/controller/dwc_otg_atmelarm.c Modified: head/sys/modules/usb/dwc_otg/Makefile Modified: head/sys/modules/usb/dwc_otg/Makefile ============================================================================== --- head/sys/modules/usb/dwc_otg/Makefile Sun May 18 09:13:29 2014 (r266394) +++ head/sys/modules/usb/dwc_otg/Makefile Sun May 18 09:19:13 2014 (r266395) @@ -35,8 +35,4 @@ SRCS= bus_if.h device_if.h usb_if.h \ dwc_otg.c dwc_otg_fdt.c \ pci_if.h -.if defined(HAS_ATMELARM) -SRCS+= dwc_otg_atmelarm.c -.endif - .include From owner-svn-src-head@FreeBSD.ORG Sun May 18 09:29:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 550A9C68; Sun, 18 May 2014 09:29:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3658929F5; Sun, 18 May 2014 09:29:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4I9T1sL050826; Sun, 18 May 2014 09:29:01 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4I9T06Q050824; Sun, 18 May 2014 09:29:00 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405180929.s4I9T06Q050824@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 18 May 2014 09:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266396 - head/sys/boot/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 09:29:01 -0000 Author: hselasky Date: Sun May 18 09:29:00 2014 New Revision: 266396 URL: http://svnweb.freebsd.org/changeset/base/266396 Log: Fix build after recent DWC OTG changes. Modified: head/sys/boot/usb/bsd_kernel.c head/sys/boot/usb/bsd_kernel.h Modified: head/sys/boot/usb/bsd_kernel.c ============================================================================== --- head/sys/boot/usb/bsd_kernel.c Sun May 18 09:19:13 2014 (r266395) +++ head/sys/boot/usb/bsd_kernel.c Sun May 18 09:29:00 2014 (r266396) @@ -380,8 +380,10 @@ device_get_parent(device_t dev) } void -device_set_interrupt(device_t dev, intr_fn_t *fn, void *arg) +device_set_interrupt(device_t dev, driver_filter_t *filter, + driver_intr_t *fn, void *arg) { + dev->dev_irq_filter = filter; dev->dev_irq_fn = fn; dev->dev_irq_arg = arg; } @@ -395,8 +397,16 @@ device_run_interrupts(device_t parent) return; TAILQ_FOREACH(child, &parent->dev_children, dev_link) { - if (child->dev_irq_fn != NULL) - (child->dev_irq_fn) (child->dev_irq_arg); + int status; + if (child->dev_irq_filter != NULL) + status = child->dev_irq_filter(child->dev_irq_arg); + else + status = FILTER_SCHEDULE_THREAD; + + if (status == FILTER_SCHEDULE_THREAD) { + if (child->dev_irq_fn != NULL) + (child->dev_irq_fn) (child->dev_irq_arg); + } } } Modified: head/sys/boot/usb/bsd_kernel.h ============================================================================== --- head/sys/boot/usb/bsd_kernel.h Sun May 18 09:19:13 2014 (r266395) +++ head/sys/boot/usb/bsd_kernel.h Sun May 18 09:29:00 2014 (r266396) @@ -96,6 +96,7 @@ SYSINIT_ENTRY(uniq##_entry, "sysuninit", #define MIN(a,b) (((a) < (b)) ? (a) : (b)) #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #define MTX_DEF 0 +#define MTX_SPIN 0 #define MTX_RECURSE 0 #define SX_DUPOK 0 #define SX_NOWITNESS 0 @@ -201,6 +202,8 @@ struct mtx { void mtx_init(struct mtx *, const char *, const char *, int); void mtx_lock(struct mtx *); void mtx_unlock(struct mtx *); +#define mtx_lock_spin(x) mtx_lock(x) +#define mtx_unlock_spin(x) mtx_unlock(x) int mtx_owned(struct mtx *); void mtx_destroy(struct mtx *); @@ -266,7 +269,11 @@ struct module_data; typedef struct driver driver_t; typedef struct devclass *devclass_t; typedef struct device *device_t; -typedef void (intr_fn_t)(void *arg); +typedef void (driver_intr_t)(void *arg); +typedef int (driver_filter_t)(void *arg); +#define FILTER_STRAY 0x01 +#define FILTER_HANDLED 0x02 +#define FILTER_SCHEDULE_THREAD 0x04 typedef int device_attach_t (device_t dev); typedef int device_detach_t (device_t dev); @@ -294,7 +301,8 @@ struct device { const struct module_data *dev_module; void *dev_sc; void *dev_aux; - intr_fn_t *dev_irq_fn; + driver_filter_t *dev_irq_filter; + driver_intr_t *dev_irq_fn; void *dev_irq_arg; uint16_t dev_unit; @@ -341,7 +349,7 @@ const char *device_get_nameunit(device_t printf("%s: " fmt, device_get_nameunit(dev),## __VA_ARGS__) device_t device_add_child(device_t dev, const char *name, int unit); void device_quiet(device_t dev); -void device_set_interrupt(device_t dev, intr_fn_t *fn, void *arg); +void device_set_interrupt(device_t dev, driver_filter_t *, driver_intr_t *, void *); void device_run_interrupts(device_t parent); void device_set_ivars(device_t dev, void *ivars); void *device_get_ivars(device_t dev); From owner-svn-src-head@FreeBSD.ORG Sun May 18 14:04:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57997852; Sun, 18 May 2014 14:04:09 +0000 (UTC) Received: from smtp.mullet.se (smtp.mullet.se [94.247.168.122]) by mx1.freebsd.org (Postfix) with ESMTP id 17D212CEB; Sun, 18 May 2014 14:04:08 +0000 (UTC) Received: from Martin-Nilssons-MacBook-Pro.local (m83-182-89-175.cust.tele2.se [83.182.89.175]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.mullet.se (Postfix) with ESMTPSA id 8434362719C7; Sun, 18 May 2014 15:55:56 +0200 (CEST) Message-ID: <5378BBEC.7080508@gneto.com> Date: Sun, 18 May 2014 15:55:56 +0200 From: Martin Nilsson User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Doug Ambrisko , src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r261491 - in head: share/man/man4 sys/dev/mfi References: <201402041735.s14HZgb8073409@svn.freebsd.org> In-Reply-To: <201402041735.s14HZgb8073409@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 14:04:09 -0000 Hi, Can you MFC this to stable 10 & 9 so it's easier to test the new mrsas driver? Best Regards, Martin On 2014-02-04 18:35, Doug Ambrisko wrote: > Author: ambrisko > Date: Tue Feb 4 17:35:41 2014 > New Revision: 261491 > URL:http://svnweb.freebsd.org/changeset/base/261491 > > Log: > Add a tunable "hw.mfi.mrsas_enable" to allow mfi(4) to drop priority and > allow mrsas(4) from LSI to attach to newer LSI cards that are support by > mrsas(4). If mrsas(4) is not loaded into the system at boot then mfi(4) > will always attach. If a modified mrsas(4) is loaded in the system. That > modification is return "-30" in it's probe since that is between > BUS_PROBE_DEFAULT and BUS_PROBE_LOW_PRIORITY. > > This option is controller by a new probe flag "MFI_FLAGS_MRSAS" in mfi_ident > that denotes cards that should work with mrsas(4). New entries that should > have this option. > > This is the first step to get mrsas(4) checked into FreeBSD and to avoid > collision with people that use mrsas(4) from LSI. Since mfi(4) takes > priority, then mrsas(4) users need to rebuild GENERIC. Using the > .disabled="1" method doesn't work since that blocks attaching and the > probe gave it to mfi(4). > > Discussed with: LSI (Kashyap Desai) > > Modified: > head/share/man/man4/mfi.4 > head/sys/dev/mfi/mfi_pci.c > head/sys/dev/mfi/mfivar.h From owner-svn-src-head@FreeBSD.ORG Sun May 18 14:25:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FDA2CCD; Sun, 18 May 2014 14:25:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D33F2E5B; Sun, 18 May 2014 14:25:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4IEPJPB037550; Sun, 18 May 2014 14:25:19 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IEPJgN037549; Sun, 18 May 2014 14:25:19 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201405181425.s4IEPJgN037549@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 18 May 2014 14:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266399 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 14:25:20 -0000 Author: ae Date: Sun May 18 14:25:19 2014 New Revision: 266399 URL: http://svnweb.freebsd.org/changeset/base/266399 Log: Since ipfw nat configures all options in one step, we should set all bits in the mask when calling LibAliasSetMode() to properly clear unneeded options. PR: 189655 MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw_nat.c Modified: head/sys/netpfil/ipfw/ip_fw_nat.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_nat.c Sun May 18 14:18:23 2014 (r266398) +++ head/sys/netpfil/ipfw/ip_fw_nat.c Sun May 18 14:25:19 2014 (r266399) @@ -443,7 +443,7 @@ ipfw_nat_cfg(struct sockopt *sopt) ptr->ip = cfg->ip; ptr->redir_cnt = cfg->redir_cnt; ptr->mode = cfg->mode; - LibAliasSetMode(ptr->lib, cfg->mode, cfg->mode); + LibAliasSetMode(ptr->lib, cfg->mode, ~0); LibAliasSetAddress(ptr->lib, ptr->ip); memcpy(ptr->if_name, cfg->if_name, IF_NAMESIZE); From owner-svn-src-head@FreeBSD.ORG Sun May 18 15:31:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A767D6B; Sun, 18 May 2014 15:31:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E1322316; Sun, 18 May 2014 15:31:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4IFVsne082885; Sun, 18 May 2014 15:31:54 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IFVsbK082884; Sun, 18 May 2014 15:31:54 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201405181531.s4IFVsbK082884@svn.freebsd.org> From: "George V. Neville-Neil" Date: Sun, 18 May 2014 15:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266403 - head/usr.sbin/pmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 15:31:54 -0000 Author: gnn Date: Sun May 18 15:31:53 2014 New Revision: 266403 URL: http://svnweb.freebsd.org/changeset/base/266403 Log: Update the date on the manual page. Pointed out by: bz Modified: head/usr.sbin/pmcstat/pmcstat.8 Modified: head/usr.sbin/pmcstat/pmcstat.8 ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.8 Sun May 18 15:31:02 2014 (r266402) +++ head/usr.sbin/pmcstat/pmcstat.8 Sun May 18 15:31:53 2014 (r266403) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2014 +.Dd May 16, 2014 .Dt PMCSTAT 8 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Sun May 18 17:14:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4632E305; Sun, 18 May 2014 17:14:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33C172A73; Sun, 18 May 2014 17:14:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4IHE92w048967; Sun, 18 May 2014 17:14:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IHE9mT048966; Sun, 18 May 2014 17:14:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405181714.s4IHE9mT048966@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 18 May 2014 17:14:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266411 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 17:14:09 -0000 Author: kib Date: Sun May 18 17:14:08 2014 New Revision: 266411 URL: http://svnweb.freebsd.org/changeset/base/266411 Log: Fix LD_LIBMAP. The r232862 passed the pointer to end of string to lmc_parse() and free(). Submitted by: Wolfgang Jenkner MFC after: 1 week Modified: head/libexec/rtld-elf/libmap.c Modified: head/libexec/rtld-elf/libmap.c ============================================================================== --- head/libexec/rtld-elf/libmap.c Sun May 18 16:43:47 2014 (r266410) +++ head/libexec/rtld-elf/libmap.c Sun May 18 17:14:08 2014 (r266411) @@ -80,7 +80,7 @@ lm_init(char *libmap_override) if (libmap_override) { /* - * Do some character replacement to make $LIBMAP look + * Do some character replacement to make $LDLIBMAP look * like a text file, then parse it. */ libmap_override = xstrdup(libmap_override); @@ -94,8 +94,8 @@ lm_init(char *libmap_override) break; } } - lmc_parse(p, strlen(p)); - free(p); + lmc_parse(libmap_override, p - libmap_override); + free(libmap_override); } return (lm_count == 0); From owner-svn-src-head@FreeBSD.ORG Sun May 18 19:56:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 755AE446; Sun, 18 May 2014 19:56:14 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id 59A5326AA; Sun, 18 May 2014 19:56:14 +0000 (UTC) Received: from bender.Home (97e07ba1.skybroadband.com [151.224.123.161]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 237C45DEFE; Sun, 18 May 2014 19:56:13 +0000 (UTC) Date: Sun, 18 May 2014 20:56:05 +0100 From: Andrew Turner To: Warner Losh Subject: Re: svn commit: r266349 - in head: share/mk sys/conf Message-ID: <20140518205605.70159532@bender.Home> In-Reply-To: <201405172031.s4HKVY51073386@svn.freebsd.org> References: <201405172031.s4HKVY51073386@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 19:56:14 -0000 On Sat, 17 May 2014 20:31:34 +0000 (UTC) Warner Losh wrote: > Author: imp > Date: Sat May 17 20:31:34 2014 > New Revision: 266349 > URL: http://svnweb.freebsd.org/changeset/base/266349 > > Log: > The time is not yet ripe to break the lack of dependencies between > src/sys and the rest of the tree for builds. > o eliminate including bsd.mkopts.mk for the moment in kern.opts.mk > o No need to include src.opts.mk at all anymore. The reasons for it > are now coverted in sys.mk and src.sys.mk. This breaks ARM kernel builds as MK_ARM_EABI is undefined, at least on 9.x. The below patch fixes it for me. Andrew Index: sys/conf/kern.opts.mk =================================================================== --- sys/conf/kern.opts.mk (revision 266414) +++ sys/conf/kern.opts.mk (working copy) @@ -16,6 +16,7 @@ # src tree. __DEFAULT_YES_OPTIONS = \ + ARM_EABI \ FORMAT_EXTENSIONS \ KERNEL_SYMBOLS From owner-svn-src-head@FreeBSD.ORG Sun May 18 21:05:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0DE29A6; Sun, 18 May 2014 21:05:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78ABE2BCD; Sun, 18 May 2014 21:05:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4IL5tkW099916; Sun, 18 May 2014 21:05:55 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IL5tJ9099912; Sun, 18 May 2014 21:05:55 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201405182105.s4IL5tJ9099912@svn.freebsd.org> From: Benjamin Kaduk Date: Sun, 18 May 2014 21:05:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266416 - in head/share/man: man5 man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 21:05:55 -0000 Author: bjk (doc committer) Date: Sun May 18 21:05:54 2014 New Revision: 266416 URL: http://svnweb.freebsd.org/changeset/base/266416 Log: Document some user-settable make variables in ports.7 This is not a comprehensive list, as the variables themselves are spread out over multiple files, but it is a start. Add a section to make.conf noting that variables may be set there that affect ports builds, but refer to ports.7 and elsewhere for the actual listing; any listing in make.conf.5 would likely become out of date fairly quickly. PR: docs/189199 Reviewed by: bdrewery (previous version) Approved by: hrs (mentor) Modified: head/share/man/man5/make.conf.5 head/share/man/man7/ports.7 Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Sun May 18 19:52:36 2014 (r266415) +++ head/share/man/man5/make.conf.5 Sun May 18 21:05:54 2014 (r266416) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 2, 2014 +.Dd May 17, 2014 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -658,6 +658,14 @@ for simple printers, or for postscript or graphics printers with a ghostscript filter, or both. .El +.Ss "BUILDING PORTS" +Several make variables can be set that affect the building of ports. +These variables and their effects are documented in +.Xr ports 7 , +.Pa ${PORTSDIR}/Mk/* +and the +.Fx +Porter's Handbook. .Sh FILES .Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact .It Pa /etc/make.conf Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Sun May 18 19:52:36 2014 (r266415) +++ head/share/man/man7/ports.7 Sun May 18 21:05:54 2014 (r266416) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 18, 2012 +.Dd May 17, 2014 .Dt PORTS 7 .Os .Sh NAME @@ -486,6 +486,44 @@ have been configured will have a uniquel single file .Pa options . .El +.Sh MAKE VARIABLES +The following list provides a name and short description for many of the +variables that are used when building ports. +More information on these and other related variables may be found in +.Pa ${PORTSDIR}/Mk/* +and the +.Fx +Porter's Handbook. +.Bl -tag -width ".Va OVERRIDE_LINUX_BASE_PORT" +.It Va WITH_OPENSSL_PORT +.Pq Vt bool +If set, causes ports that make use of OpenSSL to use the OpenSSL from +ports +.Pq if available +instead of the OpenSSL from the base system. +.It Va WITH_DEBUG +.Pq Vt bool +If set, debugging symbols are installed for ports binaries. +.It Va WITH_DEBUG_PORTS +A list of origins for which to set +.Va WITH_DEBUG_PORTS . +.It Va WITH_SSP_PORTS +.Pq Vt bool +If set, enables +.Fl fstack-protector +for most ports. +.It Va WITH_GHOSTSCRIPT_VER +If set, the version of ghostscript to be used by ports. +.It Va OVERRIDE_LINUX_BASE_PORT +The default linux base to use. +.It Va WITH_CCACHE_BUILD +.Pq Vt bool +If set, enables the use of +.Xr ccache 1 +for building ports. +.It Va CCACHE_DIR +Which directory to use for the ccache data. +.El .Sh FILES .Bl -tag -width ".Pa /usr/ports/Mk/bsd.port.mk" -compact .It Pa /usr/ports @@ -495,6 +533,7 @@ The big Kahuna. .El .Sh SEE ALSO .Xr make 1 , +.Xr make.conf 5 , .Xr pkg 8 , .Xr portsnap 8 .Pp From owner-svn-src-head@FreeBSD.ORG Sun May 18 21:17:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F30BF2A9; Sun, 18 May 2014 21:16:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6F332CB7; Sun, 18 May 2014 21:16:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4ILGxRR007400; Sun, 18 May 2014 21:16:59 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ILGx1m007399; Sun, 18 May 2014 21:16:59 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201405182116.s4ILGx1m007399@svn.freebsd.org> From: Benjamin Kaduk Date: Sun, 18 May 2014 21:16:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266417 - head/sbin/md5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 21:17:00 -0000 Author: bjk (doc committer) Date: Sun May 18 21:16:59 2014 New Revision: 266417 URL: http://svnweb.freebsd.org/changeset/base/266417 Log: Assorted updates to md5.1 Note that the -c argument's parameter is compared against the digest of the file, not the file. [1] Update the "current time" parentheticals for notes about reversing and colliding the hash functions. [1] Some general mdoc updates. PR: docs/188043 [1] Submitted by: Jamie Landeg-Jones [1] Approved by: hrs (mentor) MFC after: 1 week Modified: head/sbin/md5/md5.1 Modified: head/sbin/md5/md5.1 ============================================================================== --- head/sbin/md5/md5.1 Sun May 18 21:05:54 2014 (r266416) +++ head/sbin/md5/md5.1 Sun May 18 21:16:59 2014 (r266417) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd July 31, 2012 +.Dd May 17, 2014 .Dt MD5 1 .Os .Sh NAME @@ -63,12 +63,12 @@ concerned, and should not be relied upon This also means that .Tn MD5 should not be used as part of a cryptographic signature scheme. -At the current time (2009-01-06) there is no publicly known method to +At the current time (2014-05-17) there is no publicly known method to .Dq reverse MD5, i.e., to find an input given a hash value. .Pp .Tn SHA-1 -currently (2009-01-06) has no known collisions, but an attack has been +currently (2014-05-17) has no known collisions, but an attack has been found which is faster than a brute-force search, placing the security of .Tn SHA-1 in doubt. @@ -83,15 +83,15 @@ The hexadecimal checksum of each file li after the options are processed. .Bl -tag -width indent .It Fl c Ar string -Compare files to this md5 string. -(Note that this option is not yet useful if multiple files are specified.) +Compare the digest of the file against this string. +.Pq Note that this option is not yet useful if multiple files are specified. .It Fl s Ar string Print a checksum of the given .Ar string . .It Fl p Echo stdin to stdout and append the checksum to stdout. .It Fl q -Quiet mode - only the checksum is printed out. +Quiet mode \(em only the checksum is printed out. Overrides the .Fl r option. @@ -114,7 +114,9 @@ and .Nm rmd160 utilities exit 0 on success, 1 if at least one of the input files could not be read, -and 2 if at least one file does not have the same hash as the -c option. +and 2 if at least one file does not have the same hash as the +.Fl c +option. .Sh SEE ALSO .Xr cksum 1 , .Xr md5 3 , From owner-svn-src-head@FreeBSD.ORG Sun May 18 22:30:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D49F2EEC; Sun, 18 May 2014 22:30:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C21AC2196; Sun, 18 May 2014 22:30:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4IMUCB7052821; Sun, 18 May 2014 22:30:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IMUCmR052820; Sun, 18 May 2014 22:30:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405182230.s4IMUCmR052820@svn.freebsd.org> From: Adrian Chadd Date: Sun, 18 May 2014 22:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266418 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 22:30:12 -0000 Author: adrian Date: Sun May 18 22:30:12 2014 New Revision: 266418 URL: http://svnweb.freebsd.org/changeset/base/266418 Log: Add the flowtype to the inpcb. The flowid isn't enough to use as part of any RSS related CPU affinity lookups - the RSS code would like to know what kind of hash it is. Modified: head/sys/netinet/in_pcb.h Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Sun May 18 21:16:59 2014 (r266417) +++ head/sys/netinet/in_pcb.h Sun May 18 22:30:12 2014 (r266418) @@ -180,7 +180,8 @@ struct inpcb { uint32_t inp_flowid; /* (x) flow id / queue id */ u_int inp_refcount; /* (i) refcount */ void *inp_pspare[5]; /* (x) route caching / general use */ - u_int inp_ispare[6]; /* (x) route caching / user cookie / + uint32_t inp_flowtype; /* (x) M_HASHTYPE value */ + u_int inp_ispare[5]; /* (x) route caching / user cookie / * general use */ /* Local and foreign ports, local and foreign addr. */ From owner-svn-src-head@FreeBSD.ORG Sun May 18 22:32:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17CB1CC; Sun, 18 May 2014 22:32:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF8CD2215; Sun, 18 May 2014 22:32:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4IMW4rT057335; Sun, 18 May 2014 22:32:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IMW468057333; Sun, 18 May 2014 22:32:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405182232.s4IMW468057333@svn.freebsd.org> From: Adrian Chadd Date: Sun, 18 May 2014 22:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266419 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 22:32:05 -0000 Author: adrian Date: Sun May 18 22:32:04 2014 New Revision: 266419 URL: http://svnweb.freebsd.org/changeset/base/266419 Log: Add a new function to do a CPU ID lookup based on RSS hash information. This is intended to be used by various places that wish to hash some information about a TCP/UDP/IP flow but don't necessarily have a live mbuf to do it with. Refactor rss_m2cpuid() to use the refactored function. Modified: head/sys/netinet/in_rss.c head/sys/netinet/in_rss.h Modified: head/sys/netinet/in_rss.c ============================================================================== --- head/sys/netinet/in_rss.c Sun May 18 22:30:12 2014 (r266418) +++ head/sys/netinet/in_rss.c Sun May 18 22:32:04 2014 (r266419) @@ -407,27 +407,34 @@ rss_getcpu(u_int bucket) } /* - * netisr CPU affinity lookup routine for use by protocols. + * netisr CPU affinity lookup given just the hash and hashtype. */ -struct mbuf * -rss_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid) +u_int +rss_hash2cpuid(uint32_t hash_val, uint32_t hash_type) { - M_ASSERTPKTHDR(m); - - switch (M_HASHTYPE_GET(m)) { + switch (hash_type) { case M_HASHTYPE_RSS_IPV4: case M_HASHTYPE_RSS_TCP_IPV4: - *cpuid = rss_getcpu(rss_getbucket(m->m_pkthdr.flowid)); - return (m); - + return (rss_getcpu(rss_getbucket(hash_val))); default: - *cpuid = NETISR_CPUID_NONE; - return (m); + return (NETISR_CPUID_NONE); } } /* + * netisr CPU affinity lookup routine for use by protocols. + */ +struct mbuf * +rss_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid) +{ + + M_ASSERTPKTHDR(m); + *cpuid = rss_hash2cpuid(m->m_pkthdr.flowid, M_HASHTYPE_GET(m)); + return (m); +} + +/* * Query the RSS hash algorithm. */ u_int Modified: head/sys/netinet/in_rss.h ============================================================================== --- head/sys/netinet/in_rss.h Sun May 18 22:30:12 2014 (r266418) +++ head/sys/netinet/in_rss.h Sun May 18 22:32:04 2014 (r266419) @@ -90,5 +90,6 @@ uint32_t rss_hash_ip6_2tuple(struct in6_ * Network stack interface to query desired CPU affinity of a packet. */ struct mbuf *rss_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid); +u_int rss_hash2cpuid(uint32_t hash_val, uint32_t hash_type); #endif /* !_NETINET_IN_RSS_H_ */ From owner-svn-src-head@FreeBSD.ORG Sun May 18 22:34:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF479218; Sun, 18 May 2014 22:34:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA4C72221; Sun, 18 May 2014 22:34:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4IMY6tW057734; Sun, 18 May 2014 22:34:06 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IMY6If057732; Sun, 18 May 2014 22:34:06 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405182234.s4IMY6If057732@svn.freebsd.org> From: Adrian Chadd Date: Sun, 18 May 2014 22:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266420 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 22:34:06 -0000 Author: adrian Date: Sun May 18 22:34:06 2014 New Revision: 266420 URL: http://svnweb.freebsd.org/changeset/base/266420 Log: Ensure that the flowid hashtype is assigned to the inp if the flowid is also assigned. Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sun May 18 22:32:04 2014 (r266419) +++ head/sys/netinet/tcp_input.c Sun May 18 22:34:06 2014 (r266420) @@ -905,6 +905,7 @@ findpcb: inp->inp_flags |= INP_HW_FLOWID; inp->inp_flags &= ~INP_SW_FLOWID; inp->inp_flowid = m->m_pkthdr.flowid; + inp->inp_flowtype = M_HASHTYPE_GET(m); } #ifdef IPSEC #ifdef INET6 Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sun May 18 22:32:04 2014 (r266419) +++ head/sys/netinet/tcp_syncache.c Sun May 18 22:34:06 2014 (r266420) @@ -718,6 +718,7 @@ syncache_socket(struct syncache *sc, str inp->inp_flags |= INP_HW_FLOWID; inp->inp_flags &= ~INP_SW_FLOWID; inp->inp_flowid = m->m_pkthdr.flowid; + inp->inp_flowtype = M_HASHTYPE_GET(m); } /* From owner-svn-src-head@FreeBSD.ORG Sun May 18 22:37:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A520342D; Sun, 18 May 2014 22:37:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 787BE225E; Sun, 18 May 2014 22:37:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4IMbV3s058298; Sun, 18 May 2014 22:37:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IMbVmx058297; Sun, 18 May 2014 22:37:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405182237.s4IMbVmx058297@svn.freebsd.org> From: Adrian Chadd Date: Sun, 18 May 2014 22:37:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266421 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 22:37:31 -0000 Author: adrian Date: Sun May 18 22:37:31 2014 New Revision: 266421 URL: http://svnweb.freebsd.org/changeset/base/266421 Log: * When copying the flowid from inp -> outbound mbuf, also assign the hashtype to to the outbound mbuf as well as the flowid. * Add in socket options to fetch the hashid, the hashtype and RSS CPU ID for a given socket. Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Sun May 18 22:34:06 2014 (r266420) +++ head/sys/netinet/ip_output.c Sun May 18 22:37:31 2014 (r266421) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "opt_mpath.h" #include "opt_route.h" #include "opt_sctp.h" +#include "opt_rss.h" #include #include @@ -71,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -144,6 +146,7 @@ ip_output(struct mbuf *m, struct mbuf *o M_SETFIB(m, inp->inp_inc.inc_fibnum); if (inp->inp_flags & (INP_HW_FLOWID|INP_SW_FLOWID)) { m->m_pkthdr.flowid = inp->inp_flowid; + M_HASHTYPE_SET(m, inp->inp_flowtype); m->m_flags |= M_FLOWID; } } @@ -1171,6 +1174,11 @@ ip_ctloutput(struct socket *so, struct s case IP_DONTFRAG: case IP_BINDANY: case IP_RECVTOS: + case IP_FLOWID: + case IP_FLOWTYPE: +#ifdef RSS + case IP_RSSCPUID: +#endif switch (sopt->sopt_name) { case IP_TOS: @@ -1232,6 +1240,18 @@ ip_ctloutput(struct socket *so, struct s case IP_RECVTOS: optval = OPTBIT(INP_RECVTOS); break; + case IP_FLOWID: + optval = inp->inp_flowid; + break; + case IP_FLOWTYPE: + optval = inp->inp_flowtype; + break; +#ifdef RSS + case IP_RSSCPUID: + optval = rss_hash2cpuid(inp->inp_flowid, + inp->inp_flowtype); + break; +#endif } error = sooptcopyout(sopt, &optval, sizeof optval); break; From owner-svn-src-head@FreeBSD.ORG Sun May 18 22:39:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE494580; Sun, 18 May 2014 22:39:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBB0F2270; Sun, 18 May 2014 22:39:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4IMd1SB058566; Sun, 18 May 2014 22:39:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IMd1iJ058565; Sun, 18 May 2014 22:39:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405182239.s4IMd1iJ058565@svn.freebsd.org> From: Adrian Chadd Date: Sun, 18 May 2014 22:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266422 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 22:39:02 -0000 Author: adrian Date: Sun May 18 22:39:01 2014 New Revision: 266422 URL: http://svnweb.freebsd.org/changeset/base/266422 Log: When RSS is enabled and per cpu TCP timers are enabled, do an RSS lookup for the inp flowid/flowtype to destination CPU. This only modifies the case where RSS is enabled and the per-cpu tcp timer option is enabled. Otherwise the behaviour should be the same as before. Modified: head/sys/netinet/tcp_timer.c Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Sun May 18 22:37:31 2014 (r266421) +++ head/sys/netinet/tcp_timer.c Sun May 18 22:39:01 2014 (r266422) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_tcpdebug.h" +#include "opt_rss.h" #include #include @@ -51,10 +52,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include #ifdef INET6 #include @@ -128,8 +131,49 @@ static int per_cpu_timers = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, per_cpu_timers, CTLFLAG_RW, &per_cpu_timers , 0, "run tcp timers on all cpus"); +#if 0 #define INP_CPU(inp) (per_cpu_timers ? (!CPU_ABSENT(((inp)->inp_flowid % (mp_maxid+1))) ? \ ((inp)->inp_flowid % (mp_maxid+1)) : curcpu) : 0) +#endif + +/* + * Map the given inp to a CPU id. + * + * This queries RSS if it's compiled in, else it defaults to the current + * CPU ID. + */ +static inline int +inp_to_cpuid(struct inpcb *inp) +{ + u_int cpuid; + +#ifdef RSS + if (per_cpu_timers) { + cpuid = rss_hash2cpuid(inp->inp_flowid, inp->inp_flowtype); + if (cpuid == NETISR_CPUID_NONE) + return (curcpu); /* XXX */ + else + return (cpuid); + } +#else + /* Legacy, pre-RSS behaviour */ + if (per_cpu_timers) { + /* + * We don't have a flowid -> cpuid mapping, so cheat and + * just map unknown cpuids to curcpu. Not the best, but + * apparently better than defaulting to swi 0. + */ + cpuid = inp->inp_flowid % (mp_maxid + 1); + if (! CPU_ABSENT(cpuid)) + return (cpuid); + return (curcpu); + } +#endif + /* Default for RSS and non-RSS - cpuid 0 */ + else { + return (0); + } +} /* * Tcp protocol timeout routine called every 500 ms. @@ -271,7 +315,8 @@ tcp_timer_2msl(void *xtp) if (tp->t_state != TCPS_TIME_WAIT && ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) callout_reset_on(&tp->t_timers->tt_2msl, - TP_KEEPINTVL(tp), tcp_timer_2msl, tp, INP_CPU(inp)); + TP_KEEPINTVL(tp), tcp_timer_2msl, tp, + inp_to_cpuid(inp)); else tp = tcp_close(tp); } @@ -361,10 +406,10 @@ tcp_timer_keep(void *xtp) free(t_template, M_TEMP); } callout_reset_on(&tp->t_timers->tt_keep, TP_KEEPINTVL(tp), - tcp_timer_keep, tp, INP_CPU(inp)); + tcp_timer_keep, tp, inp_to_cpuid(inp)); } else callout_reset_on(&tp->t_timers->tt_keep, TP_KEEPIDLE(tp), - tcp_timer_keep, tp, INP_CPU(inp)); + tcp_timer_keep, tp, inp_to_cpuid(inp)); #ifdef TCPDEBUG if (inp->inp_socket->so_options & SO_DEBUG) @@ -649,7 +694,7 @@ tcp_timer_activate(struct tcpcb *tp, int struct callout *t_callout; void *f_callout; struct inpcb *inp = tp->t_inpcb; - int cpu = INP_CPU(inp); + int cpu = inp_to_cpuid(inp); #ifdef TCP_OFFLOAD if (tp->t_flags & TF_TOE) From owner-svn-src-head@FreeBSD.ORG Mon May 19 01:21:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97F4E3E5; Mon, 19 May 2014 01:21:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78E6D2E4E; Mon, 19 May 2014 01:21:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4J1L3k7068344; Mon, 19 May 2014 01:21:03 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4J1L3qA068339; Mon, 19 May 2014 01:21:03 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201405190121.s4J1L3qA068339@svn.freebsd.org> From: Jack F Vogel Date: Mon, 19 May 2014 01:21:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266423 - in head/sys: conf dev/i40e modules/i40e X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 01:21:03 -0000 Author: jfv Date: Mon May 19 01:21:02 2014 New Revision: 266423 URL: http://svnweb.freebsd.org/changeset/base/266423 Log: This is the beta release of the driver for the new Intel 40G Ethernet Controller XL710 Family. This is the core driver, a VF driver called i40evf, will be following soon. Questions or comments to myself or my co-developer Eric Joyner. Cheers! Added: head/sys/dev/i40e/ head/sys/dev/i40e/i40e.h (contents, props changed) head/sys/dev/i40e/i40e_adminq.c (contents, props changed) head/sys/dev/i40e/i40e_adminq.h (contents, props changed) head/sys/dev/i40e/i40e_adminq_cmd.h (contents, props changed) head/sys/dev/i40e/i40e_alloc.h (contents, props changed) head/sys/dev/i40e/i40e_common.c (contents, props changed) head/sys/dev/i40e/i40e_hmc.c (contents, props changed) head/sys/dev/i40e/i40e_hmc.h (contents, props changed) head/sys/dev/i40e/i40e_lan_hmc.c (contents, props changed) head/sys/dev/i40e/i40e_lan_hmc.h (contents, props changed) head/sys/dev/i40e/i40e_nvm.c (contents, props changed) head/sys/dev/i40e/i40e_osdep.c (contents, props changed) head/sys/dev/i40e/i40e_osdep.h (contents, props changed) head/sys/dev/i40e/i40e_pf.h (contents, props changed) head/sys/dev/i40e/i40e_prototype.h (contents, props changed) head/sys/dev/i40e/i40e_register.h (contents, props changed) head/sys/dev/i40e/i40e_register_x710_int.h (contents, props changed) head/sys/dev/i40e/i40e_status.h (contents, props changed) head/sys/dev/i40e/i40e_txrx.c (contents, props changed) head/sys/dev/i40e/i40e_type.h (contents, props changed) head/sys/dev/i40e/i40e_virtchnl.h (contents, props changed) head/sys/dev/i40e/if_i40e.c (contents, props changed) head/sys/modules/i40e/ head/sys/modules/i40e/Makefile (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun May 18 22:39:01 2014 (r266422) +++ head/sys/conf/files Mon May 19 01:21:02 2014 (r266423) @@ -1417,6 +1417,22 @@ dev/hptiop/hptiop.c optional hptiop scb dev/hwpmc/hwpmc_logging.c optional hwpmc dev/hwpmc/hwpmc_mod.c optional hwpmc dev/hwpmc/hwpmc_soft.c optional hwpmc +dev/i40e/if_i40e.c optional i40e inet \ + compile-with "${NORMAL_C} -I$S/dev/i40e -DSMP" +dev/i40e/i40e_txrx.c optional i40e inet \ + compile-with "${NORMAL_C} -I$S/dev/i40e -DSMP" +dev/i40e/i40e_osdep.c optional i40e inet \ + compile-with "${NORMAL_C} -I$S/dev/i40e -DSMP" +dev/i40e/i40e_nvm.c optional i40e inet \ + compile-with "${NORMAL_C} -I$S/dev/i40e -DSMP" +dev/i40e/i40e_lan_hmc.c optional i40e inet \ + compile-with "${NORMAL_C} -I$S/dev/i40e -DSMP" +dev/i40e/i40e_hmc.c optional i40e inet \ + compile-with "${NORMAL_C} -I$S/dev/i40e -DSMP" +dev/i40e/i40e_common.c optional i40e inet \ + compile-with "${NORMAL_C} -I$S/dev/i40e -DSMP" +dev/i40e/i40e_adminq.c optional i40e inet \ + compile-with "${NORMAL_C} -I$S/dev/i40e -DSMP" dev/ichsmb/ichsmb.c optional ichsmb dev/ichsmb/ichsmb_pci.c optional ichsmb pci dev/ida/ida.c optional ida Added: head/sys/dev/i40e/i40e.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/i40e/i40e.h Mon May 19 01:21:02 2014 (r266423) @@ -0,0 +1,491 @@ +/****************************************************************************** + + Copyright (c) 2013-2014, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +******************************************************************************/ +/*$FreeBSD$*/ + + +#ifndef _I40E_H_ +#define _I40E_H_ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "i40e_type.h" +#include "i40e_prototype.h" + +#ifdef I40E_DEBUG +#define MAC_FORMAT "%02x:%02x:%02x:%02x:%02x:%02x" +#define MAC_FORMAT_ARGS(mac_addr) \ + (mac_addr)[0], (mac_addr)[1], (mac_addr)[2], (mac_addr)[3], \ + (mac_addr)[4], (mac_addr)[5] +#define ON_OFF_STR(is_set) ((is_set) ? "On" : "Off") + +// static void i40e_dump_desc(void *, u8, u16); +#endif + +/* Tunables */ + +/* + * Ring Descriptors Valid Range: 32-4096 Default Value: 1024 This value is the + * number of tx/rx descriptors allocated by the driver. Increasing this + * value allows the driver to queue more operations. Each descriptor is 16 + * or 32 bytes (configurable in FVL) + */ +#define DEFAULT_RING 1024 +#define PERFORM_RING 2048 +#define MAX_RING 4096 +#define MIN_RING 32 + +/* Alignment for rings */ +#define DBA_ALIGN 128 + +/* + * This parameter controls the maximum no of times the driver will loop in + * the isr. Minimum Value = 1 + */ +#define MAX_LOOP 10 + +/* + * This is the max watchdog interval, ie. the time that can + * pass between any two TX clean operations, such only happening + * when the TX hardware is functioning. + */ +#define I40E_WATCHDOG (10 * hz) + +/* + * This parameters control when the driver calls the routine to reclaim + * transmit descriptors. + */ +#define I40E_TX_CLEANUP_THRESHOLD (que->num_desc / 8) +#define I40E_TX_OP_THRESHOLD (que->num_desc / 32) + +/* Flow control constants */ +#define I40E_FC_PAUSE 0xFFFF +#define I40E_FC_HI 0x20000 +#define I40E_FC_LO 0x10000 + +/* Defines for printing debug information */ +#define DEBUG_INIT 0 +#define DEBUG_IOCTL 0 +#define DEBUG_HW 0 + +#define INIT_DEBUGOUT(S) if (DEBUG_INIT) printf(S "\n") +#define INIT_DEBUGOUT1(S, A) if (DEBUG_INIT) printf(S "\n", A) +#define INIT_DEBUGOUT2(S, A, B) if (DEBUG_INIT) printf(S "\n", A, B) +#define IOCTL_DEBUGOUT(S) if (DEBUG_IOCTL) printf(S "\n") +#define IOCTL_DEBUGOUT1(S, A) if (DEBUG_IOCTL) printf(S "\n", A) +#define IOCTL_DEBUGOUT2(S, A, B) if (DEBUG_IOCTL) printf(S "\n", A, B) +#define HW_DEBUGOUT(S) if (DEBUG_HW) printf(S "\n") +#define HW_DEBUGOUT1(S, A) if (DEBUG_HW) printf(S "\n", A) +#define HW_DEBUGOUT2(S, A, B) if (DEBUG_HW) printf(S "\n", A, B) + +#define MAX_MULTICAST_ADDR 128 + +#define I40E_BAR 3 +#define I40E_ADM_LIMIT 2 +#define I40E_TSO_SIZE 65535 +#define I40E_TX_BUF_SZ ((u32) 1514) +#define I40E_AQ_BUF_SZ ((u32) 4096) +#define I40E_RX_HDR 128 +#define I40E_AQ_LEN 32 +#define I40E_AQ_BUFSZ 4096 +#define I40E_RX_LIMIT 512 +#define I40E_RX_ITR 0 +#define I40E_TX_ITR 1 +#define I40E_ITR_NONE 3 +#define I40E_QUEUE_EOL 0x7FF +#define I40E_MAX_FRAME 0x2600 +#define I40E_MAX_SEGS 32 +#define I40E_MAX_FILTERS 256 /* This is artificial */ +#define I40E_MAX_TX_BUSY 10 + +/* + * Interrupt Moderation parameters + */ +#define I40E_MAX_ITR 0x07FF +#define I40E_ITR_100K 0x0005 +#define I40E_ITR_20K 0x0019 +#define I40E_ITR_8K 0x003E +#define I40E_ITR_4K 0x007A +#define I40E_ITR_DYNAMIC 0x8000 +#define I40E_LOW_LATENCY 0 +#define I40E_AVE_LATENCY 1 +#define I40E_BULK_LATENCY 2 + +/* MacVlan Flags */ +#define I40E_FILTER_USED (u16)(1 << 0) +#define I40E_FILTER_VLAN (u16)(1 << 1) +#define I40E_FILTER_ADD (u16)(1 << 2) +#define I40E_FILTER_DEL (u16)(1 << 3) +#define I40E_FILTER_MC (u16)(1 << 4) + +/* used in the vlan field of the filter when not a vlan */ +#define I40E_VLAN_ANY -1 + +#define CSUM_OFFLOAD (CSUM_IP|CSUM_TCP|CSUM_UDP|CSUM_SCTP) + +/* Misc flags for i40e_vsi.flags */ +#define I40E_FLAGS_KEEP_TSO4 (1 << 0) +#define I40E_FLAGS_KEEP_TSO6 (1 << 1) + +#define I40E_TX_LOCK(_sc) mtx_lock(&(_sc)->mtx) +#define I40E_TX_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx) +#define I40E_TX_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->mtx) +#define I40E_TX_TRYLOCK(_sc) mtx_trylock(&(_sc)->mtx) +#define I40E_TX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->mtx, MA_OWNED) + +#define I40E_RX_LOCK(_sc) mtx_lock(&(_sc)->mtx) +#define I40E_RX_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx) +#define I40E_RX_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->mtx) + +/* + ***************************************************************************** + * vendor_info_array + * + * This array contains the list of Subvendor/Subdevice IDs on which the driver + * should load. + * + ***************************************************************************** + */ +typedef struct _i40e_vendor_info_t { + unsigned int vendor_id; + unsigned int device_id; + unsigned int subvendor_id; + unsigned int subdevice_id; + unsigned int index; +} i40e_vendor_info_t; + + +struct i40e_tx_buf { + u32 eop_index; + struct mbuf *m_head; + bus_dmamap_t map; +}; + +struct i40e_rx_buf { + struct mbuf *m_head; + struct mbuf *m_pack; + struct mbuf *fmp; + bus_dmamap_t hmap; + bus_dmamap_t pmap; +}; + +struct i40e_pkt_info { + u16 etype; + u32 elen; + u32 iplen; + struct ip *ip; + struct ip6_hdr *ip6; + struct tcphdr *th; +}; + +/* +** This struct has multiple uses, multicast +** addresses, vlans, and mac filters all use it. +*/ +struct i40e_mac_filter { + SLIST_ENTRY(i40e_mac_filter) next; + u8 macaddr[ETHER_ADDR_LEN]; + s16 vlan; + u16 flags; +}; + + +/* + * The Transmit ring control struct + */ +struct tx_ring { + struct i40e_queue *que; + struct mtx mtx; + int watchdog; + struct i40e_tx_desc *base; + struct i40e_dma_mem dma; + u16 next_avail; + u16 next_to_clean; + u16 atr_rate; + u16 atr_count; + u16 itr; + u16 latency; + struct i40e_tx_buf *buffers; + volatile u16 avail; + u32 cmd; + bus_dma_tag_t tag; + char mtx_name[16]; + struct buf_ring *br; + + /* Soft Stats */ + u32 packets; + u32 bytes; + u64 no_desc; + u64 total_packets; +}; + + +/* + * The Receive ring control struct + */ +struct rx_ring { + struct i40e_queue *que; + struct mtx mtx; + union i40e_rx_desc *base; + struct i40e_dma_mem dma; + struct lro_ctrl lro; + bool lro_enabled; + bool hdr_split; + bool discard; + u16 next_refresh; + u16 next_check; + u16 itr; + u16 latency; + char mtx_name[16]; + struct i40e_rx_buf *buffers; + u32 mbuf_sz; + bus_dma_tag_t htag; + bus_dma_tag_t ptag; + + /* Soft stats */ + u32 packets; + u32 bytes; + + u64 split; + u64 rx_packets; + u64 rx_bytes; + u64 discarded; + u64 not_done; +}; + +/* +** Driver queue struct: this is the interrupt container +** for the associated tx and rx ring pair. +*/ +struct i40e_queue { + struct i40e_vsi *vsi; + u32 me; + u32 msix; /* This queue's MSIX vector */ + u32 eims; /* This queue's EIMS bit */ + struct resource *res; + void *tag; + int num_desc; /* both tx and rx */ + int busy; + struct tx_ring txr; + struct rx_ring rxr; + struct task task; + struct task tx_task; + struct taskqueue *tq; + + /* Queue stats */ + u64 irqs; + u64 tso; + u64 mbuf_defrag_failed; + u64 mbuf_hdr_failed; + u64 mbuf_pkt_failed; + u64 tx_map_avail; + u64 tx_dma_setup; + u64 dropped_pkts; +}; + +/* +** Virtual Station interface: +** there would be one of these per traffic class/type +** for now just one, and its embedded in the pf +*/ +SLIST_HEAD(i40e_ftl_head, i40e_mac_filter); +struct i40e_vsi { + void *back; + struct ifnet *ifp; + struct device *dev; + struct i40e_hw *hw; + struct ifmedia media; + u64 que_mask; + int id; + u16 msix_base; /* station base MSIX vector */ + u16 num_queues; + u16 rx_itr_setting; + u16 tx_itr_setting; + struct i40e_queue *queues; /* head of queues */ + bool link_active; + u16 seid; + u16 max_frame_size; + u32 link_speed; + bool link_up; + u32 fc; /* local flow ctrl setting */ + + /* MAC/VLAN Filter list */ + struct i40e_ftl_head ftl; + + struct i40e_aqc_vsi_properties_data info; + + eventhandler_tag vlan_attach; + eventhandler_tag vlan_detach; + u16 num_vlans; + + /* Per-VSI stats from hardware */ + struct i40e_eth_stats eth_stats; + struct i40e_eth_stats eth_stats_offsets; + bool stat_offsets_loaded; + + /* Driver statistics */ + u64 hw_filters_del; + u64 hw_filters_add; + + /* Misc. */ + u64 flags; +}; + +/* +** Find the number of unrefreshed RX descriptors +*/ +static inline u16 +i40e_rx_unrefreshed(struct i40e_queue *que) +{ + struct rx_ring *rxr = &que->rxr; + + if (rxr->next_check > rxr->next_refresh) + return (rxr->next_check - rxr->next_refresh - 1); + else + return ((que->num_desc + rxr->next_check) - + rxr->next_refresh - 1); +} + +/* +** Find the next available unused filter +*/ +static inline struct i40e_mac_filter * +i40e_get_filter(struct i40e_vsi *vsi) +{ + struct i40e_mac_filter *f; + + // create a new empty filter + f = malloc(sizeof(struct i40e_mac_filter) , M_DEVBUF, M_NOWAIT | M_ZERO); + SLIST_INSERT_HEAD(&vsi->ftl, f, next); + + return (f); +} + +/* +** Compare two ethernet addresses +*/ +static inline bool +cmp_etheraddr(u8 *ea1, u8 *ea2) +{ + bool cmp = FALSE; + + if ((ea1[0] == ea2[0]) && (ea1[1] == ea2[1]) && + (ea1[2] == ea2[2]) && (ea1[3] == ea2[3]) && + (ea1[4] == ea2[4]) && (ea1[5] == ea2[5])) + cmp = TRUE; + + return (cmp); +} + +/* + * Info for stats sysctls + */ +struct i40e_sysctl_info { + u64 *stat; + char *name; + char *description; +}; + +extern int i40e_atr_rate; + + +/********************************************************************* + * TXRX Function prototypes + *********************************************************************/ +int i40e_allocate_tx_data(struct i40e_queue *); +int i40e_allocate_rx_data(struct i40e_queue *); +void i40e_init_tx_ring(struct i40e_queue *); +int i40e_init_rx_ring(struct i40e_queue *); +bool i40e_rxeof(struct i40e_queue *, int); +bool i40e_txeof(struct i40e_queue *); +int i40e_mq_start(struct ifnet *, struct mbuf *); +int i40e_mq_start_locked(struct ifnet *, struct tx_ring *); +void i40e_deferred_mq_start(void *, int); +void i40e_qflush(struct ifnet *); +void i40e_free_vsi(struct i40e_vsi *); +void i40e_free_que_tx(struct i40e_queue *); +void i40e_free_que_rx(struct i40e_queue *); +#ifdef I40E_FDIR +void i40e_atr(struct i40e_queue *, struct tcphdr *, int); +#endif + +#endif /* _I40E_H_ */ Added: head/sys/dev/i40e/i40e_adminq.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/i40e/i40e_adminq.c Mon May 19 01:21:02 2014 (r266423) @@ -0,0 +1,1089 @@ +/****************************************************************************** + + Copyright (c) 2013-2014, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +******************************************************************************/ +/*$FreeBSD$*/ + +#include "i40e_status.h" +#include "i40e_type.h" +#include "i40e_register.h" +#include "i40e_adminq.h" +#include "i40e_prototype.h" + +/** + * i40e_is_nvm_update_op - return TRUE if this is an NVM update operation + * @desc: API request descriptor + **/ +static INLINE bool i40e_is_nvm_update_op(struct i40e_aq_desc *desc) +{ + return (desc->opcode == CPU_TO_LE16(i40e_aqc_opc_nvm_erase) || + desc->opcode == CPU_TO_LE16(i40e_aqc_opc_nvm_update)); +} + +/** + * i40e_adminq_init_regs - Initialize AdminQ registers + * @hw: pointer to the hardware structure + * + * This assumes the alloc_asq and alloc_arq functions have already been called + **/ +static void i40e_adminq_init_regs(struct i40e_hw *hw) +{ + /* set head and tail registers in our local struct */ + if (hw->mac.type == I40E_MAC_VF) { + hw->aq.asq.tail = I40E_VF_ATQT1; + hw->aq.asq.head = I40E_VF_ATQH1; + hw->aq.asq.len = I40E_VF_ATQLEN1; + hw->aq.arq.tail = I40E_VF_ARQT1; + hw->aq.arq.head = I40E_VF_ARQH1; + hw->aq.arq.len = I40E_VF_ARQLEN1; + } else { + hw->aq.asq.tail = I40E_PF_ATQT; + hw->aq.asq.head = I40E_PF_ATQH; + hw->aq.asq.len = I40E_PF_ATQLEN; + hw->aq.arq.tail = I40E_PF_ARQT; + hw->aq.arq.head = I40E_PF_ARQH; + hw->aq.arq.len = I40E_PF_ARQLEN; + } +} + +/** + * i40e_alloc_adminq_asq_ring - Allocate Admin Queue send rings + * @hw: pointer to the hardware structure + **/ +enum i40e_status_code i40e_alloc_adminq_asq_ring(struct i40e_hw *hw) +{ + enum i40e_status_code ret_code; + + ret_code = i40e_allocate_dma_mem(hw, &hw->aq.asq.desc_buf, + i40e_mem_atq_ring, + (hw->aq.num_asq_entries * + sizeof(struct i40e_aq_desc)), + I40E_ADMINQ_DESC_ALIGNMENT); + if (ret_code) + return ret_code; + + ret_code = i40e_allocate_virt_mem(hw, &hw->aq.asq.cmd_buf, + (hw->aq.num_asq_entries * + sizeof(struct i40e_asq_cmd_details))); + if (ret_code) { + i40e_free_dma_mem(hw, &hw->aq.asq.desc_buf); + return ret_code; + } + + return ret_code; +} + +/** + * i40e_alloc_adminq_arq_ring - Allocate Admin Queue receive rings + * @hw: pointer to the hardware structure + **/ +enum i40e_status_code i40e_alloc_adminq_arq_ring(struct i40e_hw *hw) +{ + enum i40e_status_code ret_code; + + ret_code = i40e_allocate_dma_mem(hw, &hw->aq.arq.desc_buf, + i40e_mem_arq_ring, + (hw->aq.num_arq_entries * + sizeof(struct i40e_aq_desc)), + I40E_ADMINQ_DESC_ALIGNMENT); + + return ret_code; +} + +/** + * i40e_free_adminq_asq - Free Admin Queue send rings + * @hw: pointer to the hardware structure + * + * This assumes the posted send buffers have already been cleaned + * and de-allocated + **/ +void i40e_free_adminq_asq(struct i40e_hw *hw) +{ + i40e_free_dma_mem(hw, &hw->aq.asq.desc_buf); +} + +/** + * i40e_free_adminq_arq - Free Admin Queue receive rings + * @hw: pointer to the hardware structure + * + * This assumes the posted receive buffers have already been cleaned + * and de-allocated + **/ +void i40e_free_adminq_arq(struct i40e_hw *hw) +{ + i40e_free_dma_mem(hw, &hw->aq.arq.desc_buf); +} + +/** + * i40e_alloc_arq_bufs - Allocate pre-posted buffers for the receive queue + * @hw: pointer to the hardware structure + **/ +static enum i40e_status_code i40e_alloc_arq_bufs(struct i40e_hw *hw) +{ + enum i40e_status_code ret_code; + struct i40e_aq_desc *desc; + struct i40e_dma_mem *bi; + int i; + + /* We'll be allocating the buffer info memory first, then we can + * allocate the mapped buffers for the event processing + */ + + /* buffer_info structures do not need alignment */ + ret_code = i40e_allocate_virt_mem(hw, &hw->aq.arq.dma_head, + (hw->aq.num_arq_entries * sizeof(struct i40e_dma_mem))); + if (ret_code) + goto alloc_arq_bufs; + hw->aq.arq.r.arq_bi = (struct i40e_dma_mem *)hw->aq.arq.dma_head.va; + + /* allocate the mapped buffers */ + for (i = 0; i < hw->aq.num_arq_entries; i++) { + bi = &hw->aq.arq.r.arq_bi[i]; + ret_code = i40e_allocate_dma_mem(hw, bi, + i40e_mem_arq_buf, + hw->aq.arq_buf_size, + I40E_ADMINQ_DESC_ALIGNMENT); + if (ret_code) + goto unwind_alloc_arq_bufs; + + /* now configure the descriptors for use */ + desc = I40E_ADMINQ_DESC(hw->aq.arq, i); + + desc->flags = CPU_TO_LE16(I40E_AQ_FLAG_BUF); + if (hw->aq.arq_buf_size > I40E_AQ_LARGE_BUF) + desc->flags |= CPU_TO_LE16(I40E_AQ_FLAG_LB); + desc->opcode = 0; + /* This is in accordance with Admin queue design, there is no + * register for buffer size configuration + */ + desc->datalen = CPU_TO_LE16((u16)bi->size); + desc->retval = 0; + desc->cookie_high = 0; + desc->cookie_low = 0; + desc->params.external.addr_high = + CPU_TO_LE32(I40E_HI_DWORD(bi->pa)); + desc->params.external.addr_low = + CPU_TO_LE32(I40E_LO_DWORD(bi->pa)); + desc->params.external.param0 = 0; + desc->params.external.param1 = 0; + } + +alloc_arq_bufs: + return ret_code; + +unwind_alloc_arq_bufs: + /* don't try to free the one that failed... */ + i--; + for (; i >= 0; i--) + i40e_free_dma_mem(hw, &hw->aq.arq.r.arq_bi[i]); + i40e_free_virt_mem(hw, &hw->aq.arq.dma_head); + + return ret_code; +} + +/** + * i40e_alloc_asq_bufs - Allocate empty buffer structs for the send queue + * @hw: pointer to the hardware structure + **/ +static enum i40e_status_code i40e_alloc_asq_bufs(struct i40e_hw *hw) +{ + enum i40e_status_code ret_code; + struct i40e_dma_mem *bi; + int i; + + /* No mapped memory needed yet, just the buffer info structures */ + ret_code = i40e_allocate_virt_mem(hw, &hw->aq.asq.dma_head, + (hw->aq.num_asq_entries * sizeof(struct i40e_dma_mem))); + if (ret_code) + goto alloc_asq_bufs; + hw->aq.asq.r.asq_bi = (struct i40e_dma_mem *)hw->aq.asq.dma_head.va; + + /* allocate the mapped buffers */ + for (i = 0; i < hw->aq.num_asq_entries; i++) { + bi = &hw->aq.asq.r.asq_bi[i]; + ret_code = i40e_allocate_dma_mem(hw, bi, + i40e_mem_asq_buf, + hw->aq.asq_buf_size, + I40E_ADMINQ_DESC_ALIGNMENT); + if (ret_code) + goto unwind_alloc_asq_bufs; + } +alloc_asq_bufs: + return ret_code; + +unwind_alloc_asq_bufs: + /* don't try to free the one that failed... */ + i--; + for (; i >= 0; i--) + i40e_free_dma_mem(hw, &hw->aq.asq.r.asq_bi[i]); + i40e_free_virt_mem(hw, &hw->aq.asq.dma_head); + + return ret_code; +} + +/** + * i40e_free_arq_bufs - Free receive queue buffer info elements + * @hw: pointer to the hardware structure + **/ +static void i40e_free_arq_bufs(struct i40e_hw *hw) +{ + int i; + + /* free descriptors */ + for (i = 0; i < hw->aq.num_arq_entries; i++) + i40e_free_dma_mem(hw, &hw->aq.arq.r.arq_bi[i]); + + /* free the descriptor memory */ + i40e_free_dma_mem(hw, &hw->aq.arq.desc_buf); + + /* free the dma header */ + i40e_free_virt_mem(hw, &hw->aq.arq.dma_head); +} + +/** + * i40e_free_asq_bufs - Free send queue buffer info elements + * @hw: pointer to the hardware structure + **/ +static void i40e_free_asq_bufs(struct i40e_hw *hw) +{ + int i; + + /* only unmap if the address is non-NULL */ + for (i = 0; i < hw->aq.num_asq_entries; i++) + if (hw->aq.asq.r.asq_bi[i].pa) + i40e_free_dma_mem(hw, &hw->aq.asq.r.asq_bi[i]); + + /* free the buffer info list */ + i40e_free_virt_mem(hw, &hw->aq.asq.cmd_buf); + + /* free the descriptor memory */ + i40e_free_dma_mem(hw, &hw->aq.asq.desc_buf); + + /* free the dma header */ + i40e_free_virt_mem(hw, &hw->aq.asq.dma_head); +} + +/** + * i40e_config_asq_regs - configure ASQ registers + * @hw: pointer to the hardware structure + * + * Configure base address and length registers for the transmit queue + **/ +static enum i40e_status_code i40e_config_asq_regs(struct i40e_hw *hw) +{ + enum i40e_status_code ret_code = I40E_SUCCESS; + u32 reg = 0; + + /* Clear Head and Tail */ + wr32(hw, hw->aq.asq.head, 0); + wr32(hw, hw->aq.asq.tail, 0); + + if (hw->mac.type == I40E_MAC_VF) { + /* configure the transmit queue */ + wr32(hw, I40E_VF_ATQBAH1, + I40E_HI_DWORD(hw->aq.asq.desc_buf.pa)); + wr32(hw, I40E_VF_ATQBAL1, + I40E_LO_DWORD(hw->aq.asq.desc_buf.pa)); + wr32(hw, I40E_VF_ATQLEN1, (hw->aq.num_asq_entries | + I40E_VF_ATQLEN1_ATQENABLE_MASK)); + reg = rd32(hw, I40E_VF_ATQBAL1); + } else { + /* configure the transmit queue */ + wr32(hw, I40E_PF_ATQBAH, + I40E_HI_DWORD(hw->aq.asq.desc_buf.pa)); + wr32(hw, I40E_PF_ATQBAL, + I40E_LO_DWORD(hw->aq.asq.desc_buf.pa)); + wr32(hw, I40E_PF_ATQLEN, (hw->aq.num_asq_entries | + I40E_PF_ATQLEN_ATQENABLE_MASK)); + reg = rd32(hw, I40E_PF_ATQBAL); + } + + /* Check one register to verify that config was applied */ + if (reg != I40E_LO_DWORD(hw->aq.asq.desc_buf.pa)) + ret_code = I40E_ERR_ADMIN_QUEUE_ERROR; + + return ret_code; +} + +/** + * i40e_config_arq_regs - ARQ register configuration + * @hw: pointer to the hardware structure + * + * Configure base address and length registers for the receive (event queue) + **/ +static enum i40e_status_code i40e_config_arq_regs(struct i40e_hw *hw) +{ + enum i40e_status_code ret_code = I40E_SUCCESS; + u32 reg = 0; + + /* Clear Head and Tail */ + wr32(hw, hw->aq.arq.head, 0); + wr32(hw, hw->aq.arq.tail, 0); + + if (hw->mac.type == I40E_MAC_VF) { + /* configure the receive queue */ + wr32(hw, I40E_VF_ARQBAH1, + I40E_HI_DWORD(hw->aq.arq.desc_buf.pa)); + wr32(hw, I40E_VF_ARQBAL1, + I40E_LO_DWORD(hw->aq.arq.desc_buf.pa)); + wr32(hw, I40E_VF_ARQLEN1, (hw->aq.num_arq_entries | + I40E_VF_ARQLEN1_ARQENABLE_MASK)); + reg = rd32(hw, I40E_VF_ARQBAL1); + } else { + /* configure the receive queue */ + wr32(hw, I40E_PF_ARQBAH, + I40E_HI_DWORD(hw->aq.arq.desc_buf.pa)); + wr32(hw, I40E_PF_ARQBAL, + I40E_LO_DWORD(hw->aq.arq.desc_buf.pa)); + wr32(hw, I40E_PF_ARQLEN, (hw->aq.num_arq_entries | + I40E_PF_ARQLEN_ARQENABLE_MASK)); + reg = rd32(hw, I40E_PF_ARQBAL); + } + + /* Update tail in the HW to post pre-allocated buffers */ + wr32(hw, hw->aq.arq.tail, hw->aq.num_arq_entries - 1); + + /* Check one register to verify that config was applied */ + if (reg != I40E_LO_DWORD(hw->aq.arq.desc_buf.pa)) + ret_code = I40E_ERR_ADMIN_QUEUE_ERROR; + + return ret_code; +} + +/** + * i40e_init_asq - main initialization routine for ASQ + * @hw: pointer to the hardware structure + * + * This is the main initialization routine for the Admin Send Queue + * Prior to calling this function, drivers *MUST* set the following fields + * in the hw->aq structure: + * - hw->aq.num_asq_entries + * - hw->aq.arq_buf_size + * + * Do *NOT* hold the lock when calling this as the memory allocation routines + * called are not going to be atomic context safe + **/ +enum i40e_status_code i40e_init_asq(struct i40e_hw *hw) +{ + enum i40e_status_code ret_code = I40E_SUCCESS; + + if (hw->aq.asq.count > 0) { + /* queue already initialized */ + ret_code = I40E_ERR_NOT_READY; + goto init_adminq_exit; + } + + /* verify input for valid configuration */ + if ((hw->aq.num_asq_entries == 0) || + (hw->aq.asq_buf_size == 0)) { + ret_code = I40E_ERR_CONFIG; + goto init_adminq_exit; + } + + hw->aq.asq.next_to_use = 0; + hw->aq.asq.next_to_clean = 0; + hw->aq.asq.count = hw->aq.num_asq_entries; + + /* allocate the ring memory */ + ret_code = i40e_alloc_adminq_asq_ring(hw); + if (ret_code != I40E_SUCCESS) + goto init_adminq_exit; + + /* allocate buffers in the rings */ + ret_code = i40e_alloc_asq_bufs(hw); + if (ret_code != I40E_SUCCESS) + goto init_adminq_free_rings; + + /* initialize base registers */ + ret_code = i40e_config_asq_regs(hw); + if (ret_code != I40E_SUCCESS) + goto init_adminq_free_rings; + + /* success! */ + goto init_adminq_exit; + +init_adminq_free_rings: + i40e_free_adminq_asq(hw); + +init_adminq_exit: + return ret_code; +} + +/** + * i40e_init_arq - initialize ARQ + * @hw: pointer to the hardware structure + * + * The main initialization routine for the Admin Receive (Event) Queue. + * Prior to calling this function, drivers *MUST* set the following fields + * in the hw->aq structure: + * - hw->aq.num_asq_entries + * - hw->aq.arq_buf_size + * + * Do *NOT* hold the lock when calling this as the memory allocation routines + * called are not going to be atomic context safe + **/ +enum i40e_status_code i40e_init_arq(struct i40e_hw *hw) +{ + enum i40e_status_code ret_code = I40E_SUCCESS; + + if (hw->aq.arq.count > 0) { + /* queue already initialized */ + ret_code = I40E_ERR_NOT_READY; + goto init_adminq_exit; + } + + /* verify input for valid configuration */ + if ((hw->aq.num_arq_entries == 0) || + (hw->aq.arq_buf_size == 0)) { + ret_code = I40E_ERR_CONFIG; + goto init_adminq_exit; + } + + hw->aq.arq.next_to_use = 0; + hw->aq.arq.next_to_clean = 0; + hw->aq.arq.count = hw->aq.num_arq_entries; + + /* allocate the ring memory */ + ret_code = i40e_alloc_adminq_arq_ring(hw); + if (ret_code != I40E_SUCCESS) + goto init_adminq_exit; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon May 19 01:41:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B12E8CB5; Mon, 19 May 2014 01:41:38 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 816222FDD; Mon, 19 May 2014 01:41:38 +0000 (UTC) Received: from jre-mbp.elischer.org (ppp121-45-232-70.lns20.per1.internode.on.net [121.45.232.70]) (authenticated bits=0) by vps1.elischer.org (8.14.8/8.14.8) with ESMTP id s4J1fXhQ057120 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 18 May 2014 18:41:35 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <53796149.8060000@freebsd.org> Date: Mon, 19 May 2014 09:41:29 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Jack F Vogel , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r266423 - in head/sys: conf dev/i40e modules/i40e References: <201405190121.s4J1L3qA068339@svn.freebsd.org> In-Reply-To: <201405190121.s4J1L3qA068339@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 01:41:38 -0000 On 5/19/14, 9:21 AM, Jack F Vogel wrote: > Author: jfv > Date: Mon May 19 01:21:02 2014 > New Revision: 266423 > URL: http://svnweb.freebsd.org/changeset/base/266423 > > Log: > This is the beta release of the driver for the new > Intel 40G Ethernet Controller XL710 Family. This is > the core driver, a VF driver called i40evf, will be > following soon. Questions or comments to myself or > my co-developer Eric Joyner. Cheers! love the name.. From owner-svn-src-head@FreeBSD.ORG Mon May 19 03:50:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91A85335; Mon, 19 May 2014 03:50:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72A7529B9; Mon, 19 May 2014 03:50:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4J3o8UR065277; Mon, 19 May 2014 03:50:08 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4J3o7VL064868; Mon, 19 May 2014 03:50:07 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405190350.s4J3o7VL064868@svn.freebsd.org> From: Neel Natu Date: Mon, 19 May 2014 03:50:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266424 - in head/sys/amd64: include vmm vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 03:50:08 -0000 Author: neel Date: Mon May 19 03:50:07 2014 New Revision: 266424 URL: http://svnweb.freebsd.org/changeset/base/266424 Log: Add PG_U (user/supervisor) checks when translating a guest linear address to a guest physical address. PG_PS (page size) field is valid only in a PDE or a PDPTE so it is now checked only in non-terminal paging entries. Ignore the upper 32-bits of the CR3 for PAE paging. Modified: head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_instruction_emul.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Mon May 19 01:21:02 2014 (r266423) +++ head/sys/amd64/include/vmm.h Mon May 19 03:50:07 2014 (r266424) @@ -361,6 +361,7 @@ struct vm_exit { uint64_t cr3; enum vie_cpu_mode cpu_mode; enum vie_paging_mode paging_mode; + int cpl; struct vie vie; } inst_emul; /* Modified: head/sys/amd64/include/vmm_instruction_emul.h ============================================================================== --- head/sys/amd64/include/vmm_instruction_emul.h Mon May 19 01:21:02 2014 (r266423) +++ head/sys/amd64/include/vmm_instruction_emul.h Mon May 19 03:50:07 2014 (r266424) @@ -119,7 +119,8 @@ int vmm_emulate_instruction(void *vm, in */ int vmm_fetch_instruction(struct vm *vm, int cpuid, uint64_t rip, int inst_length, uint64_t cr3, - enum vie_paging_mode paging_mode, struct vie *vie); + enum vie_paging_mode paging_mode, int cpl, + struct vie *vie); void vie_init(struct vie *vie); Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Mon May 19 01:21:02 2014 (r266423) +++ head/sys/amd64/vmm/intel/vmx.c Mon May 19 03:50:07 2014 (r266424) @@ -1492,6 +1492,18 @@ vmx_emulate_cr_access(struct vmx *vmx, i return (HANDLED); } +/* + * From section "Guest Register State" in the Intel SDM: CPL = SS.DPL + */ +static int +vmx_cpl(void) +{ + uint32_t ssar; + + ssar = vmcs_read(VMCS_GUEST_SS_ACCESS_RIGHTS); + return ((ssar >> 5) & 0x3); +} + static enum vie_cpu_mode vmx_cpu_mode(void) { @@ -1516,6 +1528,18 @@ vmx_paging_mode(void) return (PAGING_MODE_PAE); } +static void +vmexit_inst_emul(struct vm_exit *vmexit, uint64_t gpa, uint64_t gla) +{ + vmexit->exitcode = VM_EXITCODE_INST_EMUL; + vmexit->u.inst_emul.gpa = gpa; + vmexit->u.inst_emul.gla = gla; + vmexit->u.inst_emul.cr3 = vmcs_guest_cr3(); + vmexit->u.inst_emul.cpu_mode = vmx_cpu_mode(); + vmexit->u.inst_emul.paging_mode = vmx_paging_mode(); + vmexit->u.inst_emul.cpl = vmx_cpl(); +} + static int ept_fault_type(uint64_t ept_qual) { @@ -1707,12 +1731,8 @@ vmx_handle_apic_access(struct vmx *vmx, } if (allowed) { - vmexit->exitcode = VM_EXITCODE_INST_EMUL; - vmexit->u.inst_emul.gpa = DEFAULT_APIC_BASE + offset; - vmexit->u.inst_emul.gla = VIE_INVALID_GLA; - vmexit->u.inst_emul.cr3 = vmcs_guest_cr3(); - vmexit->u.inst_emul.cpu_mode = vmx_cpu_mode(); - vmexit->u.inst_emul.paging_mode = vmx_paging_mode(); + vmexit_inst_emul(vmexit, DEFAULT_APIC_BASE + offset, + VIE_INVALID_GLA); } /* @@ -1943,12 +1963,7 @@ vmx_exit_process(struct vmx *vmx, int vc vmexit->u.paging.fault_type = ept_fault_type(qual); vmm_stat_incr(vmx->vm, vcpu, VMEXIT_NESTED_FAULT, 1); } else if (ept_emulation_fault(qual)) { - vmexit->exitcode = VM_EXITCODE_INST_EMUL; - vmexit->u.inst_emul.gpa = gpa; - vmexit->u.inst_emul.gla = vmcs_gla(); - vmexit->u.inst_emul.cr3 = vmcs_guest_cr3(); - vmexit->u.inst_emul.cpu_mode = vmx_cpu_mode(); - vmexit->u.inst_emul.paging_mode = vmx_paging_mode(); + vmexit_inst_emul(vmexit, gpa, vmcs_gla()); vmm_stat_incr(vmx->vm, vcpu, VMEXIT_INST_EMUL, 1); } /* Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Mon May 19 01:21:02 2014 (r266423) +++ head/sys/amd64/vmm/vmm.c Mon May 19 03:50:07 2014 (r266424) @@ -1131,7 +1131,7 @@ vm_handle_inst_emul(struct vm *vm, int v struct vie *vie; struct vcpu *vcpu; struct vm_exit *vme; - int error, inst_length; + int cpl, error, inst_length; uint64_t rip, gla, gpa, cr3; enum vie_cpu_mode cpu_mode; enum vie_paging_mode paging_mode; @@ -1147,6 +1147,7 @@ vm_handle_inst_emul(struct vm *vm, int v gla = vme->u.inst_emul.gla; gpa = vme->u.inst_emul.gpa; cr3 = vme->u.inst_emul.cr3; + cpl = vme->u.inst_emul.cpl; cpu_mode = vme->u.inst_emul.cpu_mode; paging_mode = vme->u.inst_emul.paging_mode; vie = &vme->u.inst_emul.vie; @@ -1155,7 +1156,7 @@ vm_handle_inst_emul(struct vm *vm, int v /* Fetch, decode and emulate the faulting instruction */ if (vmm_fetch_instruction(vm, vcpuid, rip, inst_length, cr3, - paging_mode, vie) != 0) + paging_mode, cpl, vie) != 0) return (EFAULT); if (vmm_decode_instruction(vm, vcpuid, gla, cpu_mode, vie) != 0) Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Mon May 19 01:21:02 2014 (r266423) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Mon May 19 03:50:07 2014 (r266424) @@ -572,14 +572,16 @@ vie_init(struct vie *vie) } static int -gla2gpa(struct vm *vm, uint64_t gla, uint64_t ptpphys, - uint64_t *gpa, enum vie_paging_mode paging_mode) +gla2gpa(struct vm *vm, uint64_t gla, uint64_t ptpphys, uint64_t *gpa, + enum vie_paging_mode paging_mode, int cpl) { - int nlevels, ptpshift, ptpindex; + int nlevels, ptpshift, ptpindex, usermode; uint64_t *ptpbase, pte, pgsize; uint32_t *ptpbase32, pte32; void *cookie; + usermode = (cpl == 3 ? 1 : 0); + if (paging_mode == PAGING_MODE_FLAT) { *gpa = gla; return (0); @@ -593,7 +595,7 @@ gla2gpa(struct vm *vm, uint64_t gla, uin ptpbase32 = vm_gpa_hold(vm, ptpphys, PAGE_SIZE, VM_PROT_READ, &cookie); - + if (ptpbase32 == NULL) goto error; @@ -608,7 +610,11 @@ gla2gpa(struct vm *vm, uint64_t gla, uin if ((pte32 & PG_V) == 0) goto error; - if (pte32 & PG_PS) + if (usermode && (pte32 & PG_U) == 0) + goto error; + + /* XXX must be ignored if CR4.PSE=0 */ + if (nlevels > 0 && (pte32 & PG_PS) != 0) break; ptpphys = pte32; @@ -621,8 +627,8 @@ gla2gpa(struct vm *vm, uint64_t gla, uin } if (paging_mode == PAGING_MODE_PAE) { - /* Zero out the lower 5 bits and the upper 12 bits */ - ptpphys >>= 5; ptpphys <<= 17; ptpphys >>= 12; + /* Zero out the lower 5 bits and the upper 32 bits */ + ptpphys &= 0xffffffe0UL; ptpbase = vm_gpa_hold(vm, ptpphys, sizeof(*ptpbase) * 4, VM_PROT_READ, &cookie); @@ -663,7 +669,10 @@ gla2gpa(struct vm *vm, uint64_t gla, uin if ((pte & PG_V) == 0) goto error; - if (pte & PG_PS) { + if (usermode && (pte & PG_U) == 0) + goto error; + + if (nlevels > 0 && (pte & PG_PS) != 0) { if (pgsize > 1 * GB) goto error; else @@ -684,7 +693,7 @@ error: int vmm_fetch_instruction(struct vm *vm, int cpuid, uint64_t rip, int inst_length, - uint64_t cr3, enum vie_paging_mode paging_mode, + uint64_t cr3, enum vie_paging_mode paging_mode, int cpl, struct vie *vie) { int n, err, prot; @@ -701,7 +710,7 @@ vmm_fetch_instruction(struct vm *vm, int /* Copy the instruction into 'vie' */ while (vie->num_valid < inst_length) { - err = gla2gpa(vm, rip, cr3, &gpa, paging_mode); + err = gla2gpa(vm, rip, cr3, &gpa, paging_mode, cpl); if (err) break; From owner-svn-src-head@FreeBSD.ORG Mon May 19 04:40:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73679B98; Mon, 19 May 2014 04:40:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 618752D4B; Mon, 19 May 2014 04:40:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4J4e3hZ096029; Mon, 19 May 2014 04:40:03 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4J4e3I2096028; Mon, 19 May 2014 04:40:03 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201405190440.s4J4e3I2096028@svn.freebsd.org> From: John-Mark Gurney Date: Mon, 19 May 2014 04:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266425 - head/tools/tools/makeroot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 04:40:03 -0000 Author: jmg Date: Mon May 19 04:40:02 2014 New Revision: 266425 URL: http://svnweb.freebsd.org/changeset/base/266425 Log: remove trailing white space... fix spelling of unnecessary... Modified: head/tools/tools/makeroot/makeroot.sh Modified: head/tools/tools/makeroot/makeroot.sh ============================================================================== --- head/tools/tools/makeroot/makeroot.sh Mon May 19 03:50:07 2014 (r266424) +++ head/tools/tools/makeroot/makeroot.sh Mon May 19 04:40:02 2014 (r266425) @@ -160,7 +160,7 @@ if [ -n "${FILELIST}" ]; then while [ -n "${path}" ]; do echo ".${path}" path="${path%/*}" - done + done done) | sort -u ${BSDROOT}/METALOG - | \ awk ' !/ type=/ { file = $1 } @@ -199,7 +199,7 @@ done # /etc/rcorder.start allows the startup order to be stable even if # not all startup scripts are installed. In theory it should be -# unnecessicary, but dependencies in rc.d appear to be under recorded. +# unnecessary, but dependencies in rc.d appear to be under recorded. # This is a hack local to beri/cheribsd. # echo /etc/rc.d/FIRST > ${tmpdir}/rcorder.start From owner-svn-src-head@FreeBSD.ORG Mon May 19 04:44:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4208ED79; Mon, 19 May 2014 04:44:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FA9D2DD5; Mon, 19 May 2014 04:44:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4J4iSg7001477; Mon, 19 May 2014 04:44:28 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4J4iSgD001476; Mon, 19 May 2014 04:44:28 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201405190444.s4J4iSgD001476@svn.freebsd.org> From: Don Lewis Date: Mon, 19 May 2014 04:44:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266426 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 04:44:28 -0000 Author: truckman Date: Mon May 19 04:44:27 2014 New Revision: 266426 URL: http://svnweb.freebsd.org/changeset/base/266426 Log: Slightly restructure the final loop in rman_reserve_resource_bound(). Replace with the existing loop termination test with a similar condition from the nested "if" that may terminate the loop a bit sooner, but still not too early. This condition can then be removed from the nested "if". Relocate an operator to be style(9) compliant. MFC after: 3 days Modified: head/sys/kern/subr_rman.c Modified: head/sys/kern/subr_rman.c ============================================================================== --- head/sys/kern/subr_rman.c Mon May 19 04:40:02 2014 (r266425) +++ head/sys/kern/subr_rman.c Mon May 19 04:44:27 2014 (r266426) @@ -602,13 +602,10 @@ rman_reserve_resource_bound(struct rman if ((flags & (RF_SHAREABLE | RF_TIMESHARE)) == 0) goto out; - for (s = r; s; s = TAILQ_NEXT(s, r_link)) { - if (s->r_start > end) - break; - if ((s->r_flags & flags) != flags) - continue; - if (s->r_start >= start && s->r_end <= end - && (s->r_end - s->r_start + 1) == count && + for (s = r; s && s->r_end <= end; s = TAILQ_NEXT(s, r_link)) { + if ((s->r_flags & flags) == flags && + s->r_start >= start && + (s->r_end - s->r_start + 1) == count && (s->r_start & amask) == 0 && ((s->r_start ^ s->r_end) & bmask) == 0) { rv = int_alloc_resource(M_NOWAIT); From owner-svn-src-head@FreeBSD.ORG Mon May 19 15:26:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80EE6125 for ; Mon, 19 May 2014 15:26:59 +0000 (UTC) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 455E126B1 for ; Mon, 19 May 2014 15:26:58 +0000 (UTC) Received: by mail-ie0-f182.google.com with SMTP id as1so2318809iec.27 for ; Mon, 19 May 2014 08:26:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=A1+++IjuZF6uJQ7xsJ0r1ktJeyJ0PojI9yHuUN9/m/8=; b=Jmu03kRmaJcVonJF7z60E0rLrLpJD2n1PsRDyegV0g0pQub21/p5pOg2GGl3+DW/gw aApTVKgFnJckRzOJFJ+oBpk9TRkqAruf0Ex/6P8heR3L9UKvWrr3IFLWwHFil6zbQly9 OqCle1WNhVWJXkSU+zM1IdDKLj/jYUOsM8H7fG+TXac+eOBrEnSFwc+uMMTipMAbGdfh GL5igpYeTs6zRLEqEFiKZNdzKnfHOz7QGvjA+NdvW/S4FDzUgCeUptlkxzY+kB9yXGz2 NyaJOOg/baoW3i7sNhlydkaSgv+WuCoJ5CxEGLj7TRXKNAT4MSvBmYmPCRCc7wg+qxjS Gd8w== X-Gm-Message-State: ALoCoQn+zHHvSs77O3wmM9POq3u6bgi0rrvD2V5LrAe06LhesJDkKu2zHlWnumafFXsL+QWrkpCE X-Received: by 10.50.43.225 with SMTP id z1mr17526705igl.29.1400513212198; Mon, 19 May 2014 08:26:52 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id ql7sm21663710igc.19.2014.05.19.08.26.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 May 2014 08:26:51 -0700 (PDT) Sender: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266349 - in head: share/mk sys/conf From: Warner Losh In-Reply-To: <20140518205605.70159532@bender.Home> Date: Mon, 19 May 2014 09:26:50 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405172031.s4HKVY51073386@svn.freebsd.org> <20140518205605.70159532@bender.Home> To: Andrew Turner X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 15:26:59 -0000 On May 18, 2014, at 1:56 PM, Andrew Turner wrote: > On Sat, 17 May 2014 20:31:34 +0000 (UTC) > Warner Losh wrote: >=20 >> Author: imp >> Date: Sat May 17 20:31:34 2014 >> New Revision: 266349 >> URL: http://svnweb.freebsd.org/changeset/base/266349 >>=20 >> Log: >> The time is not yet ripe to break the lack of dependencies between >> src/sys and the rest of the tree for builds. >> o eliminate including bsd.mkopts.mk for the moment in kern.opts.mk >> o No need to include src.opts.mk at all anymore. The reasons for it >> are now coverted in sys.mk and src.sys.mk. >=20 > This breaks ARM kernel builds as MK_ARM_EABI is undefined, at least on > 9.x. The below patch fixes it for me. >=20 > Andrew >=20 > Index: sys/conf/kern.opts.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/conf/kern.opts.mk (revision 266414) > +++ sys/conf/kern.opts.mk (working copy) > @@ -16,6 +16,7 @@ > # src tree. >=20 > __DEFAULT_YES_OPTIONS =3D \ > + ARM_EABI \ > FORMAT_EXTENSIONS \ > KERNEL_SYMBOLS Yea, this will fix it. I=92ll commit the fix. But do we support (and have it work) building !EABI for ARM? If not, it = should be retired from the tree because it really is an ABI affecting = make option, of which there should be zero. If we want to support arm + = oabi, then that will need a new uname. I don=92t think we do, but we = could easily make armeb the only one to do this... Warner From owner-svn-src-head@FreeBSD.ORG Mon May 19 16:05:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EB6ED5B; Mon, 19 May 2014 16:05:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C3DA2A1D; Mon, 19 May 2014 16:05:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4JG5hTc043015; Mon, 19 May 2014 16:05:43 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4JG5hIm043014; Mon, 19 May 2014 16:05:43 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201405191605.s4JG5hIm043014@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 19 May 2014 16:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266444 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 16:05:43 -0000 Author: ae Date: Mon May 19 16:05:42 2014 New Revision: 266444 URL: http://svnweb.freebsd.org/changeset/base/266444 Log: We have two functions from where a geom orphan method could be called: g_orphan_register and g_resize_provider_event. Both are called from the event queue. Also we have GEOM_DEV class, which does deferred destroy for its consumers via g_dev_destroy (also called from the event queue). So it is possible, that for some consumers an orphan method will be called twice. This triggers panic in g_dev_orphan. Check that consumer isn't already orphaned before call orphan method. MFC after: 2 weeks Modified: head/sys/geom/geom_event.c Modified: head/sys/geom/geom_event.c ============================================================================== --- head/sys/geom/geom_event.c Mon May 19 14:01:48 2014 (r266443) +++ head/sys/geom/geom_event.c Mon May 19 16:05:42 2014 (r266444) @@ -206,6 +206,14 @@ g_orphan_register(struct g_provider *pp) KASSERT(cp->geom->orphan != NULL, ("geom %s has no orphan, class %s", cp->geom->name, cp->geom->class->name)); + /* + * XXX: g_dev_orphan method does deferred destroying + * and it is possible, that other event could already + * call the orphan method. Check consumer's flags to + * do not schedule it twice. + */ + if (cp->flags & G_CF_ORPHAN) + continue; cp->flags |= G_CF_ORPHAN; cp->geom->orphan(cp); } From owner-svn-src-head@FreeBSD.ORG Mon May 19 16:08:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38EF713C; Mon, 19 May 2014 16:08:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26C312A5D; Mon, 19 May 2014 16:08:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4JG8GNL043692; Mon, 19 May 2014 16:08:16 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4JG8Ge6043691; Mon, 19 May 2014 16:08:16 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201405191608.s4JG8Ge6043691@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 19 May 2014 16:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266445 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 16:08:16 -0000 Author: ae Date: Mon May 19 16:08:15 2014 New Revision: 266445 URL: http://svnweb.freebsd.org/changeset/base/266445 Log: Add a topology trace to the g_spoil_event. MFC after: 1 week Modified: head/sys/geom/geom_subr.c Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Mon May 19 16:05:42 2014 (r266444) +++ head/sys/geom/geom_subr.c Mon May 19 16:08:15 2014 (r266445) @@ -1071,6 +1071,8 @@ g_spoil_event(void *arg, int flag) return; pp = arg; G_VALID_PROVIDER(pp); + g_trace(G_T_TOPOLOGY, "%s %p(%s:%s:%s)", __func__, pp, + pp->geom->class->name, pp->geom->name, pp->name); for (cp = LIST_FIRST(&pp->consumers); cp != NULL; cp = cp2) { cp2 = LIST_NEXT(cp, consumers); if ((cp->flags & G_CF_SPOILED) == 0) From owner-svn-src-head@FreeBSD.ORG Mon May 19 16:13:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 040773BA; Mon, 19 May 2014 16:13:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5F322B03; Mon, 19 May 2014 16:13:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4JGDeT6049568; Mon, 19 May 2014 16:13:40 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4JGDexx049567; Mon, 19 May 2014 16:13:40 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405191613.s4JGDexx049567@svn.freebsd.org> From: Warner Losh Date: Mon, 19 May 2014 16:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266446 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 16:13:41 -0000 Author: imp Date: Mon May 19 16:13:40 2014 New Revision: 266446 URL: http://svnweb.freebsd.org/changeset/base/266446 Log: Add ARM_EABI to the list, since arm kernels need it # Note: MK_ARM_EABI likely is going to die soon. Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Mon May 19 16:08:15 2014 (r266445) +++ head/sys/conf/kern.opts.mk Mon May 19 16:13:40 2014 (r266446) @@ -16,6 +16,7 @@ # src tree. __DEFAULT_YES_OPTIONS = \ + ARM_EABI \ FORMAT_EXTENSIONS \ KERNEL_SYMBOLS From owner-svn-src-head@FreeBSD.ORG Mon May 19 17:11:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE1A6A1C; Mon, 19 May 2014 17:11:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FA5F206E; Mon, 19 May 2014 17:11:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4JHBiTo088443; Mon, 19 May 2014 17:11:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4JHBiZR088438; Mon, 19 May 2014 17:11:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405191711.s4JHBiZR088438@svn.freebsd.org> From: Adrian Chadd Date: Mon, 19 May 2014 17:11:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266448 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 17:11:44 -0000 Author: adrian Date: Mon May 19 17:11:43 2014 New Revision: 266448 URL: http://svnweb.freebsd.org/changeset/base/266448 Log: Add -R to netstat to dump RSS/flow information. This is intended to help in diagnostics and debugging of NIC and stack flowid support. Eventually this will grow another column (RSS CPU ID) but that currently isn't cached in the inpcb. There's also no clean flowtype -> flowtype identifier string. This is the mbuf M_HASHTYPE_* values for RSS. Here's some example output: adrian@adrian-hackbox:~/work/freebsd/head/src % netstat -Rn | more Active Internet connections Proto Recv-Q Send-Q Local Address Foreign Address flowid ftype tcp4 0 0 10.11.1.65.22 10.11.1.64.12409 29041942 2 udp4 0 0 127.0.0.1.123 *.* 00000000 0 udp6 0 0 fe80::1%lo0.123 *.* 00000000 0 udp6 0 0 ::1.123 *.* 00000000 0 udp4 0 0 10.11.1.65.123 *.* 00000000 0 Tested: * amd64 system w/ igb NIC; local driver changes to expose RSS flowid in if_igb. Modified: head/usr.bin/netstat/inet.c head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.h Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Mon May 19 16:15:27 2014 (r266447) +++ head/usr.bin/netstat/inet.c Mon May 19 17:11:43 2014 (r266448) @@ -429,7 +429,7 @@ protopr(u_long off, const char *name, in "%-5.5s %-6.6s %-6.6s %-22.22s %-22.22s", "Proto", "Recv-Q", "Send-Q", "Local Address", "Foreign Address"); - if (!xflag) + if (!xflag && !Rflag) printf(" (state)"); } if (xflag) { @@ -441,6 +441,9 @@ protopr(u_long off, const char *name, in printf(" %7.7s %7.7s %7.7s %7.7s %7.7s %7.7s", "rexmt", "persist", "keep", "2msl", "delack", "rcvtime"); + } else if (Rflag) { + printf (" %8.8s %5.5s", + "flowid", "ftype"); } putchar('\n'); first = 0; @@ -549,7 +552,7 @@ protopr(u_long off, const char *name, in timer->tt_delack / 1000, (timer->tt_delack % 1000) / 10, timer->t_rcvtime / 1000, (timer->t_rcvtime % 1000) / 10); } - if (istcp && !Lflag && !xflag && !Tflag) { + if (istcp && !Lflag && !xflag && !Tflag && !Rflag) { if (tp->t_state < 0 || tp->t_state >= TCP_NSTATES) printf("%d", tp->t_state); else { @@ -560,7 +563,12 @@ protopr(u_long off, const char *name, in putchar('*'); #endif /* defined(TF_NEEDSYN) && defined(TF_NEEDFIN) */ } - } + } + if (Rflag) { + printf(" %08x %5d", + inp->inp_flowid, + inp->inp_flowtype); + } putchar('\n'); } if (xig != oxig && xig->xig_gen != oxig->xig_gen) { Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Mon May 19 16:15:27 2014 (r266447) +++ head/usr.bin/netstat/main.c Mon May 19 17:11:43 2014 (r266448) @@ -295,6 +295,7 @@ int numeric_port; /* show ports numerica static int pflag; /* show given protocol */ int Qflag; /* show netisr information */ int rflag; /* show routing tables (or routing stats) */ +int Rflag; /* show flow / RSS statistics */ int sflag; /* show protocol statistics */ int Wflag; /* wide display */ int Tflag; /* TCP Information */ @@ -319,7 +320,7 @@ main(int argc, char *argv[]) af = AF_UNSPEC; - while ((ch = getopt(argc, argv, "46AaBbdF:f:ghI:iLlM:mN:np:Qq:rSTsuWw:xz")) + while ((ch = getopt(argc, argv, "46AaBbdF:f:ghI:iLlM:mN:np:Qq:RrSTsuWw:xz")) != -1) switch(ch) { case '4': @@ -433,6 +434,9 @@ main(int argc, char *argv[]) case 'r': rflag = 1; break; + case 'R': + Rflag = 1; + break; case 's': ++sflag; break; @@ -820,7 +824,7 @@ static void usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", -"usage: netstat [-46AaLnSTWx] [-f protocol_family | -p protocol]\n" +"usage: netstat [-46AaLnRSTWx] [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", " netstat -i | -I interface [-46abdhnW] [-f address_family]\n" " [-M core] [-N system]", Modified: head/usr.bin/netstat/netstat.h ============================================================================== --- head/usr.bin/netstat/netstat.h Mon May 19 16:15:27 2014 (r266447) +++ head/usr.bin/netstat/netstat.h Mon May 19 17:11:43 2014 (r266448) @@ -45,6 +45,7 @@ extern int noutputs; /* how much outputs extern int numeric_addr; /* show addresses numerically */ extern int numeric_port; /* show ports numerically */ extern int rflag; /* show routing tables (or routing stats) */ +extern int Rflag; /* show flowid / RSS information */ extern int sflag; /* show protocol statistics */ extern int Tflag; /* show TCP control block info */ extern int Wflag; /* wide display */ From owner-svn-src-head@FreeBSD.ORG Mon May 19 17:50:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBF28185; Mon, 19 May 2014 17:50:37 +0000 (UTC) Received: from felyko.com (felyko.com [IPv6:2001:470:1:2d5:26:3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id BC3182485; Mon, 19 May 2014 17:50:37 +0000 (UTC) Received: from [IPv6:2620:149:4:f01:f9bc:677d:cbab:7c71] (unknown [IPv6:2620:149:4:f01:f9bc:677d:cbab:7c71]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id DDD7234A9E7; Mon, 19 May 2014 10:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1400521837; bh=5Aaru8LGbXUl6rGfI/t4XOI5cDFLxEueqrn/B73a/AU=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=VHVUoK2zOzXLLhtrCipVcVN8hI75tmWlxhpDZuEHDNf6vwfsoMR8Op6/TrCAEdUMa /t6hQmXYHXhhekvSlGMedh6DB5JQPUBF0GhIwjHKSqK8yEE+xnOqvdQ1tHNLNYxoEL 8uM0ikZEVErHgejMll8OwJ17CEtvCtYC1ilNSfEo= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1947\)) Subject: Re: svn commit: r266423 - in head/sys: conf dev/i40e modules/i40e From: Rui Paulo In-Reply-To: <53796149.8060000@freebsd.org> Date: Mon, 19 May 2014 10:50:36 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405190121.s4J1L3qA068339@svn.freebsd.org> <53796149.8060000@freebsd.org> To: Julian Elischer X-Mailer: Apple Mail (2.1947) Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 17:50:38 -0000 On 18 May 2014, at 18:41, Julian Elischer wrote: > On 5/19/14, 9:21 AM, Jack F Vogel wrote: >> Author: jfv >> Date: Mon May 19 01:21:02 2014 >> New Revision: 266423 >> URL: http://svnweb.freebsd.org/changeset/base/266423 >>=20 >> Log: >> This is the beta release of the driver for the new >> Intel 40G Ethernet Controller XL710 Family. This is >> the core driver, a VF driver called i40evf, will be >> following soon. Questions or comments to myself or >> my co-developer Eric Joyner. Cheers! > love the name.. Aesthetics aside, I think the name should be changed. Network drivers = always used [a-z] for name and [0-9] for unit. Can you find an example = where this is not true? -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Mon May 19 18:07:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8D2F9FC; Mon, 19 May 2014 18:07:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 966BC25AF; Mon, 19 May 2014 18:07:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4JI7baZ021860; Mon, 19 May 2014 18:07:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4JI7b79021859; Mon, 19 May 2014 18:07:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405191807.s4JI7b79021859@svn.freebsd.org> From: John Baldwin Date: Mon, 19 May 2014 18:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266449 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 18:07:37 -0000 Author: jhb Date: Mon May 19 18:07:37 2014 New Revision: 266449 URL: http://svnweb.freebsd.org/changeset/base/266449 Log: Add support for decoding the AMD SVM instructions. Modified: head/sys/amd64/amd64/db_disasm.c Modified: head/sys/amd64/amd64/db_disasm.c ============================================================================== --- head/sys/amd64/amd64/db_disasm.c Mon May 19 17:11:43 2014 (r266448) +++ head/sys/amd64/amd64/db_disasm.c Mon May 19 18:07:37 2014 (r266449) @@ -1391,6 +1391,46 @@ db_disasm(loc, altfmt) i_size = NONE; i_mode = 0; break; + case 0xd8: + i_name = "vmrun"; + i_size = NONE; + i_mode = 0; + break; + case 0xd9: + i_name = "vmmcall"; + i_size = NONE; + i_mode = 0; + break; + case 0xda: + i_name = "vmload"; + i_size = NONE; + i_mode = 0; + break; + case 0xdb: + i_name = "vmsave"; + i_size = NONE; + i_mode = 0; + break; + case 0xdc: + i_name = "stgi"; + i_size = NONE; + i_mode = 0; + break; + case 0xdd: + i_name = "clgi"; + i_size = NONE; + i_mode = 0; + break; + case 0xde: + i_name = "skinit"; + i_size = NONE; + i_mode = 0; + break; + case 0xdf: + i_name = "invlpga"; + i_size = NONE; + i_mode = 0; + break; case 0xf8: i_name = "swapgs"; i_size = NONE; From owner-svn-src-head@FreeBSD.ORG Mon May 19 18:13:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1816FA4; Mon, 19 May 2014 18:13:20 +0000 (UTC) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id CEA312688; Mon, 19 May 2014 18:13:19 +0000 (UTC) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by alto.onthenet.com.au (Postfix) with ESMTPS id 823F7124B2; Tue, 20 May 2014 04:12:40 +1000 (EST) Received: from Peter-Grehans-MacBook-Pro-2.local (c-174-51-225-141.hsd1.co.comcast.net [174.51.225.141]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BUH97080 (AUTH peterg@ptree32.com.au); Tue, 20 May 2014 04:12:39 +1000 Message-ID: <537A4994.1070801@freebsd.org> Date: Mon, 19 May 2014 12:12:36 -0600 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r266449 - head/sys/amd64/amd64 References: <201405191807.s4JI7b79021859@svn.freebsd.org> In-Reply-To: <201405191807.s4JI7b79021859@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 18:13:20 -0000 > Add support for decoding the AMD SVM instructions. Thankyou !! later, Peter. From owner-svn-src-head@FreeBSD.ORG Mon May 19 18:25:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B8BB9E6; Mon, 19 May 2014 18:25:30 +0000 (UTC) Received: from mail-qc0-x235.google.com (mail-qc0-x235.google.com [IPv6:2607:f8b0:400d:c01::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAB592797; Mon, 19 May 2014 18:25:29 +0000 (UTC) Received: by mail-qc0-f181.google.com with SMTP id m20so9469326qcx.26 for ; Mon, 19 May 2014 11:25:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Ipe5oDlIzkXnzP+4kpt1qvOdlNk6oGvlzJZPJgOVcfg=; b=Sj6dTIrF3J6p2oWtJx4rEex1oXSUw5L+ka24LAD93ujG1p/vzClj1eFPwwcriU74y3 3dYEoc2fYrmMc0Q3c3BlyS7v1JUOZbxlIhILTR11zXEYlaVK+QY291VpBajMbVSapuM/ GgXILqIT8juc3du4Om5e2z7eZNIqqX7UnmWehIsPB9ZcInfXQwx/5PaKxVJP4TBM37UY /pH/Kh7qM3yUDgTRguDMaHQqwAbM75BUc9rv1l7XHcSNRb2B1dwmcdKigBXHvOEREKk2 M9J8HVp9hyJYu899bl2qP0vYZNCYVPeFJc7v/YGVZaYQQ2aq06qMKLwKCri8nsZ0iKIy lipw== MIME-Version: 1.0 X-Received: by 10.224.6.10 with SMTP id 10mr50399341qax.45.1400523928994; Mon, 19 May 2014 11:25:28 -0700 (PDT) Sender: hiren.panchasara@gmail.com Received: by 10.96.10.161 with HTTP; Mon, 19 May 2014 11:25:28 -0700 (PDT) Received: by 10.96.10.161 with HTTP; Mon, 19 May 2014 11:25:28 -0700 (PDT) In-Reply-To: References: <201405190121.s4J1L3qA068339@svn.freebsd.org> <53796149.8060000@freebsd.org> Date: Mon, 19 May 2014 11:25:28 -0700 X-Google-Sender-Auth: diSeHxGBMNb9IfURjr0Ppkcwlv4 Message-ID: Subject: Re: svn commit: r266423 - in head/sys: conf dev/i40e modules/i40e From: hiren panchasara To: Rui Paulo Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: svn-src-head , Jack F Vogel , svn-src-all@freebsd.org, src-committers@freebsd.org, Julian Elischer X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 18:25:30 -0000 On May 19, 2014 10:50 AM, "Rui Paulo" wrote: > > On 18 May 2014, at 18:41, Julian Elischer wrote: > > > On 5/19/14, 9:21 AM, Jack F Vogel wrote: > >> Author: jfv > >> Date: Mon May 19 01:21:02 2014 > >> New Revision: 266423 > >> URL: http://svnweb.freebsd.org/changeset/base/266423 > >> > >> Log: > >> This is the beta release of the driver for the new > >> Intel 40G Ethernet Controller XL710 Family. This is > >> the core driver, a VF driver called i40evf, will be > >> following soon. Questions or comments to myself or > >> my co-developer Eric Joyner. Cheers! > > love the name.. > > Aesthetics aside, I think the name should be changed. Network drivers always used [a-z] for name and [0-9] for unit. Can you find an example where this is not true? > +1 I'd also like this name consistency to be maintained, if possible. Cheers, Hiren From owner-svn-src-head@FreeBSD.ORG Mon May 19 18:36:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0CB6C206; Mon, 19 May 2014 18:36:03 +0000 (UTC) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E851128B6; Mon, 19 May 2014 18:36:02 +0000 (UTC) Received: by mail.lifanov.com (Postfix, from userid 58) id 514DF1B0835; Mon, 19 May 2014 14:29:04 -0400 (EDT) Received: from [10.1.3.5] (cnet520-windstream.mcclatchyinteractive.com [166.108.16.2]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.lifanov.com (Postfix) with ESMTPSA id 709351B0830; Mon, 19 May 2014 14:29:02 -0400 (EDT) Message-ID: <537A4D6D.7070608@mail.lifanov.com> Date: Mon, 19 May 2014 14:29:01 -0400 From: Nikolai Lifanov User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "Alexander V. Chernikov" , src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r266310 - in head: sbin/ipfw sys/netinet sys/netpfil/ipfw References: <201405171345.s4HDj3LK020332@svn.freebsd.org> In-Reply-To: <201405171345.s4HDj3LK020332@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 18:36:03 -0000 On 05/17/14 09:45, Alexander V. Chernikov wrote: > Author: melifaro > Date: Sat May 17 13:45:03 2014 > New Revision: 266310 > URL: http://svnweb.freebsd.org/changeset/base/266310 > > Log: > Fix wrong formatting of 0.0.0.0/X table records in ipfw(8). > > Add `flags` u16 field to the hole in ipfw_table_xentry structure. > Kernel has been guessing address family for supplied record based > on xent length size. > Userland, however, has been getting fixed-size ipfw_table_xentry structures > guessing address family by checking address by IN6_IS_ADDR_V4COMPAT(). > > Fix this behavior by providing specific IPFW_TCF_INET flag for IPv4 records. > > PR: bin/189471 > Submitted by: Dennis Yusupoff > MFC after: 2 weeks > > Modified: > head/sbin/ipfw/ipfw2.c > head/sys/netinet/ip_fw.h > head/sys/netpfil/ipfw/ip_fw_table.c > This seems to break things for me: ===> sbin/ipfw (all) cc -O2 -pipe -march=corei7-avx -DPF -g -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Qunused-arguments -c /usr/src/sbin/ipfw/ipfw2.c /usr/src/sbin/ipfw/ipfw2.c:4392:15: error: no member named 'flags' in 'struct _ipfw_table_xentry' if ((xent->flags & IPFW_TCF_INET) != 0) { ~~~~ ^ /usr/src/sbin/ipfw/ipfw2.c:4392:23: error: use of undeclared identifier 'IPFW_TCF_INET' if ((xent->flags & IPFW_TCF_INET) != 0) { ^ 2 errors generated. *** Error code 1 Stop. I'm building from 266216, and I tried several revisions in between this one and r266447. - Nikolai Lifanov From owner-svn-src-head@FreeBSD.ORG Mon May 19 18:41:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95A1C1D9; Mon, 19 May 2014 18:41:56 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58DA62999; Mon, 19 May 2014 18:41:56 +0000 (UTC) Received: from 95.108.170.210-red.dhcp.yndx.net ([95.108.170.210] helo=ptichko.yndx.net) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1WmObF-000JOr-1o; Mon, 19 May 2014 18:31:33 +0400 Message-ID: <537A5014.7020001@FreeBSD.org> Date: Mon, 19 May 2014 22:40:20 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Nikolai Lifanov , src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r266310 - in head: sbin/ipfw sys/netinet sys/netpfil/ipfw References: <201405171345.s4HDj3LK020332@svn.freebsd.org> <537A4D6D.7070608@mail.lifanov.com> In-Reply-To: <537A4D6D.7070608@mail.lifanov.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 18:41:56 -0000 On 19.05.2014 22:29, Nikolai Lifanov wrote: > On 05/17/14 09:45, Alexander V. Chernikov wrote: >> Author: melifaro >> Date: Sat May 17 13:45:03 2014 >> New Revision: 266310 >> URL: http://svnweb.freebsd.org/changeset/base/266310 >> >> Log: >> Fix wrong formatting of 0.0.0.0/X table records in ipfw(8). >> >> Add `flags` u16 field to the hole in ipfw_table_xentry structure. >> Kernel has been guessing address family for supplied record based >> on xent length size. >> Userland, however, has been getting fixed-size ipfw_table_xentry structures >> guessing address family by checking address by IN6_IS_ADDR_V4COMPAT(). >> >> Fix this behavior by providing specific IPFW_TCF_INET flag for IPv4 records. >> >> PR: bin/189471 >> Submitted by: Dennis Yusupoff >> MFC after: 2 weeks >> >> Modified: >> head/sbin/ipfw/ipfw2.c >> head/sys/netinet/ip_fw.h >> head/sys/netpfil/ipfw/ip_fw_table.c >> > This seems to break things for me: > > ===> sbin/ipfw (all) > cc -O2 -pipe -march=corei7-avx -DPF -g -std=gnu99 -fstack-protector > -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized > -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int > -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value > -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion > -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter > -Qunused-arguments -c /usr/src/sbin/ipfw/ipfw2.c > /usr/src/sbin/ipfw/ipfw2.c:4392:15: error: no member named 'flags' in > 'struct > _ipfw_table_xentry' > if ((xent->flags & IPFW_TCF_INET) != 0) { > ~~~~ ^ > /usr/src/sbin/ipfw/ipfw2.c:4392:23: error: use of undeclared identifier > 'IPFW_TCF_INET' > if ((xent->flags & IPFW_TCF_INET) != 0) { It looks like your build is using old ip_fw.h version. Are you doing clean buildworld? > ^ > 2 errors generated. > *** Error code 1 > > Stop. > > I'm building from 266216, and I tried several revisions in between this > one and r266447. > > - Nikolai Lifanov > > > From owner-svn-src-head@FreeBSD.ORG Mon May 19 19:08:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64660F60; Mon, 19 May 2014 19:08:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51ED62BC3; Mon, 19 May 2014 19:08:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4JJ8lLc061822; Mon, 19 May 2014 19:08:47 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4JJ8llK061821; Mon, 19 May 2014 19:08:47 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201405191908.s4JJ8llK061821@svn.freebsd.org> From: "Simon J. Gerraty" Date: Mon, 19 May 2014 19:08:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266450 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 19:08:47 -0000 Author: sjg Date: Mon May 19 19:08:46 2014 New Revision: 266450 URL: http://svnweb.freebsd.org/changeset/base/266450 Log: _SUBDIR is marked .MAKE - since it runs a sub-make. Targets thus marked are supposed to run even with -n. As such they should not do anything except run the sub-make. Use an intermediate target _* to associate with _SUBDIR and which depends on installincludes etc so that we get the correct behavior with -n. Reviewed by: marcel Modified: head/share/mk/bsd.subdir.mk Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Mon May 19 18:07:37 2014 (r266449) +++ head/share/mk/bsd.subdir.mk Mon May 19 19:08:46 2014 (r266450) @@ -104,8 +104,9 @@ ${__target}: _SUBDIR .for __target in files includes .for __stage in build install ${__stage}${__target}: +_${__stage}${__target}: ${__stage}${__target} .if make(${__stage}${__target}) -${__stage}${__target}: _SUBDIR +_${__stage}${__target}: _SUBDIR .endif .endfor ${__target}: .MAKE From owner-svn-src-head@FreeBSD.ORG Mon May 19 19:34:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F7DD3CF; Mon, 19 May 2014 19:34:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D2902F1D; Mon, 19 May 2014 19:34:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4JJYiVa080251; Mon, 19 May 2014 19:34:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4JJYiOA080250; Mon, 19 May 2014 19:34:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405191934.s4JJYiOA080250@svn.freebsd.org> From: Adrian Chadd Date: Mon, 19 May 2014 19:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266451 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 19:34:44 -0000 Author: adrian Date: Mon May 19 19:34:44 2014 New Revision: 266451 URL: http://svnweb.freebsd.org/changeset/base/266451 Log: Let's just use the mib0 partition for our configurations pace. It's a convenient thing. tested: * AP93 Modified: head/sys/mips/conf/AP93.hints Modified: head/sys/mips/conf/AP93.hints ============================================================================== --- head/sys/mips/conf/AP93.hints Mon May 19 19:08:46 2014 (r266450) +++ head/sys/mips/conf/AP93.hints Mon May 19 19:34:44 2014 (r266451) @@ -121,8 +121,9 @@ hint.map.3.readonly=1 hint.map.4.at="flash/spi0" hint.map.4.start=0x00880000 hint.map.4.end=0x00890000 -hint.map.4.name="mib0" -hint.map.4.readonly=1 +# hint.map.4.name="mib0" +hint.map.4.name="cfg" +# hint.map.4.readonly=1 hint.map.5.at="flash/spi0" hint.map.5.start=0x00890000 From owner-svn-src-head@FreeBSD.ORG Mon May 19 19:46:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFC1E771; Mon, 19 May 2014 19:46:06 +0000 (UTC) Received: from mail-la0-x235.google.com (mail-la0-x235.google.com [IPv6:2a00:1450:4010:c03::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E9B22024; Mon, 19 May 2014 19:46:05 +0000 (UTC) Received: by mail-la0-f53.google.com with SMTP id ec20so4397431lab.26 for ; Mon, 19 May 2014 12:46:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=wsRyeeIymJ/ssiESeLGam31MGnlj1Ltp5DRXt3ugL+M=; b=xtoaJWhh6dYh2jMXGqbPm/3H2tN4grndEzFQF80TRwTxHnfgB/J3HZw76PXy7HSMtc xo5Picub/Zb4GPQDRBuz6ucbOplMl7AlgsnBNSR4aS1bnL3w1Z0CT/fuUfZoP/B9fq80 0q1h2WP4t7YLsRMqErwTfyJnRRgk0vvYqfmWaPJ91Bah8y/pR9lGr6F5m8CmzkF+A0q5 mRB48HQ7w0UYt3a4uohqIIvpzeK1hMsEItD9+obHhl29aVfS5mjv+m9YiFA/0MIrps/r hz7ki7WqR/Y8Neo7fI77xiN/g/S9pBcaDDnInI+FIqzMw98nSN4gF2bTjmnO9ZSTcBQy sGPQ== MIME-Version: 1.0 X-Received: by 10.112.13.137 with SMTP id h9mr26221298lbc.33.1400528763289; Mon, 19 May 2014 12:46:03 -0700 (PDT) Received: by 10.114.70.238 with HTTP; Mon, 19 May 2014 12:46:03 -0700 (PDT) In-Reply-To: References: <201405190121.s4J1L3qA068339@svn.freebsd.org> <53796149.8060000@freebsd.org> Date: Mon, 19 May 2014 20:46:03 +0100 Message-ID: Subject: Re: svn commit: r266423 - in head/sys: conf dev/i40e modules/i40e From: Dominic Marks To: hiren panchasara Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Jack F Vogel , Rui Paulo , svn-src-head , Julian Elischer X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 19:46:06 -0000 'umble user here. Yes, please don't do this. ietN? Dominic On Mon, May 19, 2014 at 7:25 PM, hiren panchasara wrote: > On May 19, 2014 10:50 AM, "Rui Paulo" wrote: > > > > On 18 May 2014, at 18:41, Julian Elischer wrote: > > > > > On 5/19/14, 9:21 AM, Jack F Vogel wrote: > > >> Author: jfv > > >> Date: Mon May 19 01:21:02 2014 > > >> New Revision: 266423 > > >> URL: http://svnweb.freebsd.org/changeset/base/266423 > > >> > > >> Log: > > >> This is the beta release of the driver for the new > > >> Intel 40G Ethernet Controller XL710 Family. This is > > >> the core driver, a VF driver called i40evf, will be > > >> following soon. Questions or comments to myself or > > >> my co-developer Eric Joyner. Cheers! > > > love the name.. > > > > Aesthetics aside, I think the name should be changed. Network drivers > always used [a-z] for name and [0-9] for unit. Can you find an example > where this is not true? > > > > +1 > > I'd also like this name consistency to be maintained, if possible. > > Cheers, > Hiren > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > From owner-svn-src-head@FreeBSD.ORG Mon May 19 20:11:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7311D29E; Mon, 19 May 2014 20:11:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FD4B22DE; Mon, 19 May 2014 20:11:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4JKBuBW005593; Mon, 19 May 2014 20:11:56 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4JKBt9v005590; Mon, 19 May 2014 20:11:55 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405192011.s4JKBt9v005590@svn.freebsd.org> From: Mark Johnston Date: Mon, 19 May 2014 20:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266454 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil tools/test/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 20:11:56 -0000 Author: markj Date: Mon May 19 20:11:55 2014 New Revision: 266454 URL: http://svnweb.freebsd.org/changeset/base/266454 Log: Fix tst.ZeroModuleProbes.d.ksh, which was incorrectly modified in r178534. Since "BEGIN" is not the name of a module, the test would just hang. MFC after: 3 days Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh head/tools/test/dtrace/Makefile Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh Mon May 19 19:54:21 2014 (r266453) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh Mon May 19 20:11:55 2014 (r266454) @@ -46,7 +46,7 @@ fi dtrace=$1 $dtrace -qZm wassup'{printf("Iamkool");}' \ --qm BEGIN'{printf("I am done"); exit(0);}' +-qm kernel'{printf("I am done"); exit(0);}' status=$? Modified: head/tools/test/dtrace/Makefile ============================================================================== --- head/tools/test/dtrace/Makefile Mon May 19 19:54:21 2014 (r266453) +++ head/tools/test/dtrace/Makefile Mon May 19 20:11:55 2014 (r266454) @@ -188,7 +188,6 @@ NOTWORK+= \ # Tests that just don't complete (even to fail) at the moment... NOTWORK+= \ - ${TESTSRCDIR}/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh \ ${TESTSRCDIR}/tst/common/printa/tst.many.d \ ${TESTSRCDIR}/tst/common/scalars/err.D_OP_INCOMPAT.dupgtype.d \ ${TESTSRCDIR}/tst/common/scalars/err.D_OP_INCOMPAT.dupltype.d \ From owner-svn-src-head@FreeBSD.ORG Mon May 19 21:55:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0325B4D3; Mon, 19 May 2014 21:55:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4E752C3F; Mon, 19 May 2014 21:55:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4JLtlvs068509; Mon, 19 May 2014 21:55:47 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4JLtlAS068508; Mon, 19 May 2014 21:55:47 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201405192155.s4JLtlAS068508@svn.freebsd.org> From: "Simon J. Gerraty" Date: Mon, 19 May 2014 21:55:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266456 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 May 2014 21:55:48 -0000 Author: sjg Date: Mon May 19 21:55:47 2014 New Revision: 266456 URL: http://svnweb.freebsd.org/changeset/base/266456 Log: Revert previous change - doesn't cover all cases. Modified: head/share/mk/bsd.subdir.mk Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Mon May 19 20:28:00 2014 (r266455) +++ head/share/mk/bsd.subdir.mk Mon May 19 21:55:47 2014 (r266456) @@ -104,9 +104,8 @@ ${__target}: _SUBDIR .for __target in files includes .for __stage in build install ${__stage}${__target}: -_${__stage}${__target}: ${__stage}${__target} .if make(${__stage}${__target}) -_${__stage}${__target}: _SUBDIR +${__stage}${__target}: _SUBDIR .endif .endfor ${__target}: .MAKE From owner-svn-src-head@FreeBSD.ORG Tue May 20 02:59:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D781951; Tue, 20 May 2014 02:59:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B73A2244; Tue, 20 May 2014 02:59:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4K2xEa4055335; Tue, 20 May 2014 02:59:14 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4K2xECK055334; Tue, 20 May 2014 02:59:14 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201405200259.s4K2xECK055334@svn.freebsd.org> From: Peter Grehan Date: Tue, 20 May 2014 02:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266462 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 02:59:14 -0000 Author: grehan Date: Tue May 20 02:59:13 2014 New Revision: 266462 URL: http://svnweb.freebsd.org/changeset/base/266462 Log: Bump bhyve allocation up to 20 bits to avoid birthday-paradox style address collisions when bhyve VMs are connected to the same broadcoast domain and are using pseudo-random allocations. Reviewed by: gnn MFC after: 1 week Modified: head/sys/net/ieee_oui.h Modified: head/sys/net/ieee_oui.h ============================================================================== --- head/sys/net/ieee_oui.h Tue May 20 01:17:59 2014 (r266461) +++ head/sys/net/ieee_oui.h Tue May 20 02:59:13 2014 (r266462) @@ -62,6 +62,6 @@ * allocated for any reason. */ -/* Allocate 64K to bhyve */ +/* Allocate 20 bits to bhyve */ #define OUI_FREEBSD_BHYVE_LOW OUI_FREEBSD(0x000001) -#define OUI_FREEBSD_BHYVE_HIGH OUI_FREEBSD(0x00ffff) +#define OUI_FREEBSD_BHYVE_HIGH OUI_FREEBSD(0x0fffff) From owner-svn-src-head@FreeBSD.ORG Tue May 20 03:00:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F13BAFC; Tue, 20 May 2014 03:00:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41AE9225A; Tue, 20 May 2014 03:00:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4K30LQI056132; Tue, 20 May 2014 03:00:21 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4K30KxV056127; Tue, 20 May 2014 03:00:20 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201405200300.s4K30KxV056127@svn.freebsd.org> From: Bryan Drewery Date: Tue, 20 May 2014 03:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266463 - in head: etc etc/mtree usr.sbin/newsyslog X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 03:00:21 -0000 Author: bdrewery Date: Tue May 20 03:00:20 2014 New Revision: 266463 URL: http://svnweb.freebsd.org/changeset/base/266463 Log: - Include /etc/newsyslog.conf.d/* and /usr/local/etc/newsyslog.conf.d/* by default for newsyslog(8). The /usr/local/etc/newsyslog.conf.d will give packages an opportunity to install a default configuration to handle their own log files. MFC after: 2 weeks Relnotes: yes Modified: head/etc/mtree/BSD.root.dist head/etc/newsyslog.conf head/usr.sbin/newsyslog/newsyslog.8 Modified: head/etc/mtree/BSD.root.dist ============================================================================== --- head/etc/mtree/BSD.root.dist Tue May 20 02:59:13 2014 (r266462) +++ head/etc/mtree/BSD.root.dist Tue May 20 03:00:20 2014 (r266463) @@ -42,6 +42,8 @@ .. mtree .. + newsyslog.conf.d + .. ntp mode=0700 .. pam.d Modified: head/etc/newsyslog.conf ============================================================================== --- head/etc/newsyslog.conf Tue May 20 02:59:13 2014 (r266462) +++ head/etc/newsyslog.conf Tue May 20 03:00:20 2014 (r266463) @@ -38,3 +38,6 @@ /var/log/utx.log 644 3 * @01T05 B /var/log/weekly.log 640 5 * $W6D0 JN /var/log/xferlog 600 7 100 * JC + + /etc/newsyslog.conf.d/* + /usr/local/etc/newsyslog.conf.d/* Modified: head/usr.sbin/newsyslog/newsyslog.8 ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.8 Tue May 20 02:59:13 2014 (r266462) +++ head/usr.sbin/newsyslog/newsyslog.8 Tue May 20 03:00:20 2014 (r266463) @@ -17,7 +17,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd January 31, 2011 +.Dd May 19, 2014 .Dt NEWSYSLOG 8 .Os .Sh NAME @@ -261,10 +261,16 @@ If additional command line arguments are will only examine log files that match those arguments; otherwise, it will examine all files listed in the configuration file. .Sh FILES -.Bl -tag -width /etc/newsyslog.confxxxx -compact +.Bl -tag -width /usr/local/etc/newsyslog.conf.d -compact .It Pa /etc/newsyslog.conf .Nm configuration file +.It Pa /etc/newsyslog.conf.d +Each file in this directory will be included by the default +.Pa newsyslog.conf . +.It Pa /usr/local/etc/newsyslog.conf.d +Each file in this directory will be included by the default +.Pa newsyslog.conf . .El .Sh COMPATIBILITY Previous versions of the From owner-svn-src-head@FreeBSD.ORG Tue May 20 09:19:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71BE5C37; Tue, 20 May 2014 09:19:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5ED3A2F85; Tue, 20 May 2014 09:19:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4K9JadG087768; Tue, 20 May 2014 09:19:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4K9JZvg087765; Tue, 20 May 2014 09:19:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405200919.s4K9JZvg087765@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 20 May 2014 09:19:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266464 - in head/sys: kern sys vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 09:19:36 -0000 Author: kib Date: Tue May 20 09:19:35 2014 New Revision: 266464 URL: http://svnweb.freebsd.org/changeset/base/266464 Log: When exec_new_vmspace() decides that current vmspace cannot be reused on execve(2), it calls vmspace_exec(), which frees the current vmspace. The thread executing an exec syscall gets new vmspace assigned, and old vmspace is freed if only referenced by the current process. The free operation includes pmap_release(), which de-constructs the paging structures used by hardware. If the calling process is multithreaded, other threads are suspended in the thread_suspend_check(), and need to be unsuspended and run to be able to exit on successfull exec. Now, since the old vmspace is destroyed, paging structures are invalid, threads are resumed on the non-existent pmaps (page tables), which leads to triple fault on x86. To fix, postpone the free of old vmspace until the threads are resumed and exited. To avoid modifications to all image activators all of which use exec_new_vmspace(), memoize the current (old) vmspace in kern_execve(), and notify it about the need to call vmspace_free() with a thread-private flag TDP_EXECVMSPC. http://bugs.debian.org/743141 Reported by: Ivo De Decker through secteam Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/kern_exec.c head/sys/sys/proc.h head/sys/vm/vm_map.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Tue May 20 03:00:20 2014 (r266463) +++ head/sys/kern/kern_exec.c Tue May 20 09:19:35 2014 (r266464) @@ -282,6 +282,7 @@ kern_execve(td, args, mac_p) struct mac *mac_p; { struct proc *p = td->td_proc; + struct vmspace *oldvmspace; int error; AUDIT_ARG_ARGV(args->begin_argv, args->argc, @@ -298,6 +299,8 @@ kern_execve(td, args, mac_p) PROC_UNLOCK(p); } + KASSERT((td->td_pflags & TDP_EXECVMSPC) == 0, ("nested execve")); + oldvmspace = td->td_proc->p_vmspace; error = do_execve(td, args, mac_p); if (p->p_flag & P_HADTHREADS) { @@ -312,6 +315,12 @@ kern_execve(td, args, mac_p) thread_single_end(); PROC_UNLOCK(p); } + if ((td->td_pflags & TDP_EXECVMSPC) != 0) { + KASSERT(td->td_proc->p_vmspace != oldvmspace, + ("oldvmspace still used")); + vmspace_free(oldvmspace); + td->td_pflags &= ~TDP_EXECVMSPC; + } return (error); } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Tue May 20 03:00:20 2014 (r266463) +++ head/sys/sys/proc.h Tue May 20 09:19:35 2014 (r266464) @@ -429,6 +429,7 @@ do { \ #define TDP_NERRNO 0x08000000 /* Last errno is already in td_errno */ #define TDP_UIOHELD 0x10000000 /* Current uio has pages held in td_ma */ #define TDP_DEVMEMIO 0x20000000 /* Accessing memory for /dev/mem */ +#define TDP_EXECVMSPC 0x40000000 /* Execve destroyed old vmspace */ /* * Reasons that the current thread can not be run yet. Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Tue May 20 03:00:20 2014 (r266463) +++ head/sys/vm/vm_map.c Tue May 20 09:19:35 2014 (r266464) @@ -3758,6 +3758,8 @@ vmspace_exec(struct proc *p, vm_offset_t struct vmspace *oldvmspace = p->p_vmspace; struct vmspace *newvmspace; + KASSERT((curthread->td_pflags & TDP_EXECVMSPC) == 0, + ("vmspace_exec recursed")); newvmspace = vmspace_alloc(minuser, maxuser, NULL); if (newvmspace == NULL) return (ENOMEM); @@ -3774,7 +3776,7 @@ vmspace_exec(struct proc *p, vm_offset_t PROC_VMSPACE_UNLOCK(p); if (p == curthread->td_proc) pmap_activate(curthread); - vmspace_free(oldvmspace); + curthread->td_pflags |= TDP_EXECVMSPC; return (0); } From owner-svn-src-head@FreeBSD.ORG Tue May 20 10:28:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F15B9AF; Tue, 20 May 2014 10:28:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C675254F; Tue, 20 May 2014 10:28:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4KASKTg030258; Tue, 20 May 2014 10:28:20 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4KASKCc030257; Tue, 20 May 2014 10:28:20 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201405201028.s4KASKCc030257@svn.freebsd.org> From: Steven Hartland Date: Tue, 20 May 2014 10:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266465 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 10:28:20 -0000 Author: smh Date: Tue May 20 10:28:19 2014 New Revision: 266465 URL: http://svnweb.freebsd.org/changeset/base/266465 Log: Change comment about HPNDisabled to match the style of other options to avoid confusion. Sponsored by: Multiplay Modified: head/crypto/openssh/sshd_config Modified: head/crypto/openssh/sshd_config ============================================================================== --- head/crypto/openssh/sshd_config Tue May 20 09:19:35 2014 (r266464) +++ head/crypto/openssh/sshd_config Tue May 20 10:28:19 2014 (r266465) @@ -128,7 +128,7 @@ # override default of no subsystems Subsystem sftp /usr/libexec/sftp-server -# Disable HPN tuning improvements. +# Change to yes to disable HPN tuning improvements. #HPNDisabled no # Buffer size for HPN to non-HPN connections. From owner-svn-src-head@FreeBSD.ORG Tue May 20 12:22:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D917DACF; Tue, 20 May 2014 12:22:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5F152FA1; Tue, 20 May 2014 12:22:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4KCMr10002707; Tue, 20 May 2014 12:22:53 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4KCMrZQ002706; Tue, 20 May 2014 12:22:53 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405201222.s4KCMrZQ002706@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 20 May 2014 12:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266466 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 12:22:53 -0000 Author: hselasky Date: Tue May 20 12:22:53 2014 New Revision: 266466 URL: http://svnweb.freebsd.org/changeset/base/266466 Log: Make sure detach code is executed in all cases. This fixes a panic when debugging is enabled. Reported by: Idwer Vollering MFC after: 3 days Modified: head/sys/dev/usb/wlan/if_rsu.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Tue May 20 10:28:19 2014 (r266465) +++ head/sys/dev/usb/wlan/if_rsu.c Tue May 20 12:22:53 2014 (r266466) @@ -423,8 +423,6 @@ rsu_detach(device_t self) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; - if (!device_is_attached(self)) - return (0); rsu_stop(ifp, 1); usbd_transfer_unsetup(sc->sc_xfer, RSU_N_TRANSFER); ieee80211_ifdetach(ic); @@ -454,7 +452,7 @@ rsu_do_request(struct rsu_softc *sc, str while (ntries--) { err = usbd_do_request_flags(sc->sc_udev, &sc->sc_mtx, req, data, 0, NULL, 250 /* ms */); - if (err == 0 || !device_is_attached(sc->sc_dev)) + if (err == 0 || err == USB_ERR_NOT_CONFIGURED) break; DPRINTFN(1, "Control request failed, %s (retrying)\n", usbd_errstr(err)); From owner-svn-src-head@FreeBSD.ORG Tue May 20 13:49:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E6B1445; Tue, 20 May 2014 13:49:58 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 414712725; Tue, 20 May 2014 13:49:58 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 742FAB941; Tue, 20 May 2014 09:49:56 -0400 (EDT) From: John Baldwin To: Dominic Marks Subject: Re: svn commit: r266423 - in head/sys: conf dev/i40e modules/i40e Date: Tue, 20 May 2014 09:25:02 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201405190121.s4J1L3qA068339@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201405200925.02456.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 20 May 2014 09:49:56 -0400 (EDT) Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, hiren panchasara , Jack F Vogel , Rui Paulo , svn-src-head , Julian Elischer X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 13:49:58 -0000 On Monday, May 19, 2014 3:46:03 pm Dominic Marks wrote: > 'umble user here. Yes, please don't do this. > > ietN? ixfeN or some variation thereof? (f for "forty" or "Fortville") -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue May 20 14:00:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CD3FADF; Tue, 20 May 2014 14:00:38 +0000 (UTC) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 06808286C; Tue, 20 May 2014 14:00:38 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 5EEE01A4811; Tue, 20 May 2014 23:40:06 +1000 (EST) Date: Tue, 20 May 2014 23:40:01 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Rui Paulo Subject: Re: svn commit: r266423 - in head/sys: conf dev/i40e modules/i40e In-Reply-To: Message-ID: <20140520223516.R2836@besplex.bde.org> References: <201405190121.s4J1L3qA068339@svn.freebsd.org> <53796149.8060000@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=QIpRGG7L c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=JD0ISiim65UA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=xjiYolVHbQJGdE8LeK8A:9 a=FYLPom_J4c2nfgwm:21 a=nlPr7huRk_mjOq8e:21 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Julian Elischer X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 14:00:38 -0000 On Mon, 19 May 2014, Rui Paulo wrote: > On 18 May 2014, at 18:41, Julian Elischer wrote: > >> On 5/19/14, 9:21 AM, Jack F Vogel wrote: >>> Author: jfv >>> Date: Mon May 19 01:21:02 2014 >>> New Revision: 266423 >>> URL: http://svnweb.freebsd.org/changeset/base/266423 >>> >>> Log: >>> This is the beta release of the driver for the new >>> Intel 40G Ethernet Controller XL710 Family. This is >>> the core driver, a VF driver called i40evf, will be >>> following soon. Questions or comments to myself or >>> my co-developer Eric Joyner. Cheers! >> love the name.. > > Aesthetics aside, I think the name should be changed. Network drivers always used [a-z] for name and [0-9] for unit. Can you find an example where this is not true? Also, verbose names break formatting. E.g., netstat -r has 5 columns available under Netif for the driver name and device number. netstat -i has about the same under Name (possibly 1 or 2 not directly under Name, but reserved for the Name column). systat has 3 columns available, but with a more flexible format that truncates other info. All driver name+numbers are broken now on freefall: 2 users Load 0.07 0.04 0.01 May 20 11:46 Mem:KB REAL VIRTUAL VN PAGER SWAP PAGER Tot Share Tot Share Free in out in out Act 27100 5768 566228 9656 2578420 count All 11821k 6964 1075549k 22040 pages Proc: Interrupts r p d s w Csw Trp Sys Int Sof Flt cow 130 total 25 252 3 35 9 65 zfod uart0 4 ozfod 44 cpu0:timer 0.2%Sys 0.0%Intr 0.0%User 0.0%Nice 99.8%Idle %ozfod 2 igb0:que 0 | | | | | | | | | | | daefr 1 igb0:que 1 prcfr 1 igb0:que 2 dtbuf totfr 1 igb0:que 3 Namei Name-cache Dir-cache 484467 desvn react 2 igb0:que 4 Calls hits % hits % 309999 numvn pdwak 1 igb0:que 5 3 3 100 120414 frevn pdpgs 1 igb0:que 6 intrn 1 igb0:que 7 Disks ada0 ada1 ada2 ada3 pass0 pass1 pass2 20279528 wire igb0:link KB/t 0.00 0.00 0.00 0.00 0.00 0.00 0.00 179464 act ahci0 274 tps 0 0 0 0 0 0 0 1323416 inact 48 cpu1:timer MB/s 0.00 0.00 0.00 0.00 0.00 0.00 0.00 532604 cache 1 cpu9:timer %busy 0 0 0 0 0 0 0 2045816 free 2 cpu23:time 1694240 buf 1 cpu11:time 1 cpu22:time systat is hard-coded for 80 columns (it can handle more than 25 rows but only uses then to display more interrupts). igb0 is already 1 too long. "igb0: que N" is 8 too long. This destroys all the space meant for showing the interrupt number. "que N" is almost as good. The multitude of igb queues (handling a whole 1 interrupt/second each) also defeats sysstat's vertical formatting. Fortunately there are almost no other peripheral devices that ever interrupted on freefall, (just uart and ahci0), so their interrupts aren't pushed off the display. uart and ahci have even more verbose names than igb. Only most of the cpuN:timer interrupts are pushed off. cpuN:timer is an even more verbose name than uart and ahci. top is considerably more broken with 80x25 but is not completely hard-coded for 80 columns. -SH output is now almost useless on freefall: last pid: 23715; load averages: 0.02, 0.05, 0.01 up 15+06:28:30 12:05:06 436 processes: 25 running, 356 sleeping, 55 waiting CPU: 0.1% user, 0.0% nice, 0.1% system, 0.0% interrupt, 99.9% idle Mem: 176M Active, 1293M Inact, 19G Wired, 520M Cache, 1655M Buf, 1996M Free ARC: 15G Total, 7008M MFU, 4317M MRU, 18K Anon, 536M Header, 3240M Other Swap: 8192M Total, 10M Used, 8182M Free PID USERNAME PRI NICE SIZE RES STATE C TIME WCPU COMMAND 11 root 155 ki31 0K 384K CPU2 2 363.7H 100.00% idle{idle: 11 root 155 ki31 0K 384K CPU3 3 363.7H 100.00% idle{idle: ... Whenever there are more CPUs than rows, top -SH can't even display all the idle threads. Without -H, it doesn't display any interrupts, and without -S it doesn't display any detail about interrupts. 47 rows is just enough for all the CPUs and a couple of igb interrupts. Non-curses top output (top -SH >file) displays any number of rows in a not so useful way of course. Now I use it to show other problems: - It truncates the bad verbose description "idle{idle:" as above - there is a formatting error for "100.00%" that uses 1 more column than allocated and thus steals one from the COMMAND column. 100.00% used to be unusual for any process, but is now normal for idle threads - too much space is wasted for the USERNAME column. In some previous version, even more space was wasted. - top uses the tty's number of columns for file output. This is bug for bug compatible with ps. The default for a file should be 80 columns, but changeable using something like the COLUMNS environment variable (not the tty's attribute). - COLUMNS does work for top and ps. ROWS works for systat. - with COLUMNS=80, igb0 is truncated out of existence in top -SH 100 >file. Not igb's fault. - with COLUMNS=114, igb0 is finally visible in top output (top -SH 100 >file): 12 root -92 - 0K 880K WAIT 0 1:03 0.00% intr{irq256: igb0:que} 12 root -92 - 0K 880K WAIT 6 0:47 0.00% intr{irq262: igb0:que} 12 root -92 - 0K 880K WAIT 2 0:34 0.00% intr{irq258: igb0:que} Something truncated "que N" to just the useless "que". It is collateral with the ABI breakage for tdname. (Process names were expanded from length 16 to 19, and the old space was reserved for ABI compatibility of struct kinfo_proc. ki_comm is the new name and ki_ocomm was the old name. Interrupt names use length 19. The reserved space was abused for tdname. Later, ki_ocomm was renamed to ki_tdname. The tdname length needs to be at least as large as the command name so as to hold copies of the command name, since due to compatibility hacks related to the abuse, ki_tdname is used to return what should be in ki_comm and (?) vice versa. Here we see the results of truncation from this. The full interrupt name is "irq256:igb0 que N". This has length 18, so it would fit in ki_ocomm, but it is truncated to length 16, giving "irq256:igb0 que" when it is returned in ki_tdname. When showing threads, top and ps just increase the mess by truncating ki_comm and ki_tdname and adding braces to waste even more space. ki_comm provides no extra info for interrupts and some other threads. It just says "intr" and doesn't need 19 characters for this. "intr" is repeated as "irq" in ki_tdname. ki_tdname needs more space for details but has less.) Previous regressions changed interrupt command names from something like "igb0 que 3 irq256" on i386 to "irq256:igb0 que 3" on all arches (move irqN: from last to first and add punctuation). This unimproved truncated cases since it is better to truncate the irq number than anything else.) systat -v works around some of these bugs as follows: - it doesn't use kinfo_proc or ki_tdname. It fetches the interrupt name by a different mechanism, so it is not truncated - it edits the interrupt name to put the irq number at the end, to remove punctuation that would waste space. Then if truncation would still occur, it removes "irq" Much more complicated editing would be needed to parse ki_comm and ki_tdname and discard redundant and space-wasting bits. This is too hard. The kernel should be more careful to make the strings directly usable. Interrupt names for top and ps could be fixed by expanding ki_tdname (breaking the ABI again :-() and putting the full interrupt name in it, and putting nothing instead of "intr" in ki_comm. Or maybe do any concatenation in the kernel, depending on a syscall parameter, and never using ki_tdname. Other wasteful redundancies in ki_comm{ki_tdname}: % idle{idle: cpuN} % geom{g_down} Not too bad, but g_ is an improved spelling of geom. % intr{swi4: clock} Lots of these, with the important info truncated in several steps. Old versions of top displayed something like "swi4: clock clk:cy+" for the non-threads case and "swi4: clock clk" for the threads case. This was from when kernel threads were separate processes. Several drivers are attached to "swi4: clock" (clk, cy, sio at least). 19 characters in the interrupt name is too short, so the name is truncated. (This is a regression from previous version written by me. That used a string space so that the length was unlimited but combined length was several times smaller since most names are short.) At least it writes "+" to indicate the truncation. The "+" is then lost by blind truncation on copying to ki_tdname, so the truncation is not obvious in top and ps. systat and vmstat never supported SWIs, so the usual method of seeing the non-truncated non-edited names doesn't work (it is to use vmstat -i). systat would run out of vertical space showing SWIs. % kernel{swapper} % kernel{zio_null_issue} "kernel" for kernel threads is almost as useless as "intr". The full thread name in ki_tdname says more. % zfskern{arc_reclaim_thre} This and other zfskern names are the only examples of good ki_comm/ki_tdname decompositions. "zfs*" is not repeated in ki_tdname, so only "kern" in ki_comm becomes redundant when ki_kdname is appended. Bruce From owner-svn-src-head@FreeBSD.ORG Tue May 20 14:15:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5791DEC7; Tue, 20 May 2014 14:15:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A4F22A01; Tue, 20 May 2014 14:15:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4KEF4mx070532; Tue, 20 May 2014 14:15:04 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4KEF3wx070529; Tue, 20 May 2014 14:15:03 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405201415.s4KEF3wx070529@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 20 May 2014 14:15:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266467 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 14:15:04 -0000 Author: hselasky Date: Tue May 20 14:15:03 2014 New Revision: 266467 URL: http://svnweb.freebsd.org/changeset/base/266467 Log: Correct some programming details. The layout of the PDTs were different from what was initially thought. Fix re-programming of hardware mode register after reset. Sponsored by: DARPA, AFRL Modified: head/sys/dev/usb/controller/saf1761_otg.c head/sys/dev/usb/controller/saf1761_otg_reg.h Modified: head/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.c Tue May 20 12:22:53 2014 (r266466) +++ head/sys/dev/usb/controller/saf1761_otg.c Tue May 20 14:15:03 2014 (r266467) @@ -227,7 +227,7 @@ saf1761_host_channel_alloc(struct saf176 if (sc->sc_host_isoc_map & (1 << x)) continue; sc->sc_host_isoc_map |= (1 << x); - td->channel = 64 + x; + td->channel = x; return (0); } break; @@ -236,7 +236,7 @@ saf1761_host_channel_alloc(struct saf176 if (sc->sc_host_async_map & (1 << x)) continue; sc->sc_host_async_map |= (1 << x); - td->channel = x; + td->channel = 64 + x; return (0); } break; @@ -253,8 +253,8 @@ saf1761_host_channel_free(struct saf1761 return; /* disable channel */ - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 3), 0); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 0), 0); + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 3), 0); + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 0), 0); switch (td->ep_type) { case UE_INTERRUPT: @@ -263,7 +263,7 @@ saf1761_host_channel_free(struct saf1761 td->channel = SOTG_HOST_CHANNEL_MAX; break; case UE_ISOCHRONOUS: - x = td->channel - 64; + x = td->channel; sc->sc_host_isoc_map &= ~(1 << x); td->channel = SOTG_HOST_CHANNEL_MAX; break; @@ -276,19 +276,23 @@ saf1761_host_channel_free(struct saf1761 } static void -saf1761_read_host_fifo_1(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td, - void *buf, uint32_t len) +saf1761_read_host_memory_4(struct saf1761_otg_softc *sc, uint32_t offset, + void *buf, uint32_t count) { - bus_space_read_region_1((sc)->sc_io_tag, (sc)->sc_io_hdl, - SOTG_DATA_ADDR(td->channel), buf, len); + if (count == 0) + return; + SAF1761_WRITE_4(sc, SOTG_MEMORY_REG, SOTG_HC_MEMORY_ADDR(offset)); + DELAY(1); /* read prefetch time is 90ns */ + bus_space_read_region_4((sc)->sc_io_tag, (sc)->sc_io_hdl, offset, buf, count); } static void -saf1761_write_host_fifo_1(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td, - void *buf, uint32_t len) +saf1761_write_host_memory_4(struct saf1761_otg_softc *sc, uint32_t offset, + void *buf, uint32_t count) { - bus_space_write_region_1((sc)->sc_io_tag, (sc)->sc_io_hdl, - SOTG_DATA_ADDR(td->channel), buf, len); + if (count == 0) + return; + bus_space_write_region_4((sc)->sc_io_tag, (sc)->sc_io_hdl, offset, buf, count); } static uint8_t @@ -299,7 +303,7 @@ saf1761_host_setup_tx(struct saf1761_otg uint32_t count; if (td->channel < SOTG_HOST_CHANNEL_MAX) { - status = SAF1761_READ_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 3)); + status = SAF1761_READ_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 3)); if (status & (1 << 31)) { goto busy; } else if (status & (1 << 30)) { @@ -325,23 +329,24 @@ saf1761_host_setup_tx(struct saf1761_otg usbd_copy_out(td->pc, 0, &req, count); - saf1761_write_host_fifo_1(sc, td, &req, count); + saf1761_write_host_memory_4(sc, SOTG_DATA_ADDR(td->channel), + &req, (count + 3) / 4); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 7), 0); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 6), 0); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 5), 0); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 4), 0); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 3), + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 7), 0); + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 6), 0); + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 5), 0); + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 4), 0); + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 3), (1 << 31) | (td->toggle << 25) | (3 << 23)); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 2), + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 2), SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 1), + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 1), td->dw1_value | (2 << 10) /* SETUP PID */ | (td->ep_index >> 1)); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 0), + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 0), (td->ep_index << 31) | (1 << 29) /* pkt-multiplier */ | (td->max_packet_size << 18) /* wMaxPacketSize */ | @@ -365,7 +370,7 @@ saf1761_host_bulk_data_rx(struct saf1761 uint32_t count; uint8_t got_short; - status = SAF1761_READ_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 3)); + status = SAF1761_READ_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 3)); if (status & (1 << 31)) { goto busy; @@ -401,8 +406,9 @@ saf1761_host_bulk_data_rx(struct saf1761 goto complete; } - saf1761_read_host_fifo_1(sc, td, - sc->sc_bounce_buffer, count); + saf1761_read_host_memory_4(sc, SOTG_DATA_ADDR(td->channel), + sc->sc_bounce_buffer, (count + 3) / 4); + usbd_copy_in(td->pc, td->offset, sc->sc_bounce_buffer, count); @@ -429,21 +435,21 @@ saf1761_host_bulk_data_rx(struct saf1761 /* receive one more packet */ - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 7), 0); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 6), 0); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 5), 0); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 4), 0); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 3), + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 7), 0); + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 6), 0); + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 5), 0); + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 4), 0); + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 3), (1 << 31) | (td->toggle << 25) | (3 << 23)); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 2), + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 2), SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 1), + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 1), td->dw1_value | (1 << 10) /* IN-PID */ | (td->ep_index >> 1)); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 0), + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 0), (td->ep_index << 31) | (1 << 29) /* pkt-multiplier */ | (td->max_packet_size << 18) /* wMaxPacketSize */ | @@ -463,7 +469,7 @@ saf1761_host_bulk_data_tx(struct saf1761 if (td->channel < SOTG_HOST_CHANNEL_MAX) { uint32_t status; - status = SAF1761_READ_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 3)); + status = SAF1761_READ_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 3)); if (status & (1 << 31)) { goto busy; } else if (status & (1 << 30)) { @@ -493,7 +499,8 @@ saf1761_host_bulk_data_tx(struct saf1761 } usbd_copy_out(td->pc, td->offset, sc->sc_bounce_buffer, count); - saf1761_write_host_fifo_1(sc, td, sc->sc_bounce_buffer, count); + saf1761_write_host_memory_4(sc, SOTG_DATA_ADDR(td->channel), + sc->sc_bounce_buffer, (count + 3) / 4); /* set toggle, if any */ if (td->set_toggle) { @@ -501,21 +508,21 @@ saf1761_host_bulk_data_tx(struct saf1761 td->toggle = 1; } - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 7), 0); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 6), 0); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 5), 0); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 4), 0); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 3), + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 7), 0); + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 6), 0); + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 5), 0); + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 4), 0); + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 3), (1 << 31) | (td->toggle << 25) | (3 << 23)); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 2), + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 2), SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 1), + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 1), td->dw1_value | (0 << 10) /* OUT-PID */ | (td->ep_index >> 1)); - SAF1761_WRITE_4(sc, SOTG_ASYNC_PDT(td->channel) + (4 * 0), + SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 0), (td->ep_index << 31) | (1 << 29) /* pkt-multiplier */ | (td->max_packet_size << 18) /* wMaxPacketSize */ | @@ -566,6 +573,8 @@ saf1761_otg_set_address(struct saf1761_o static void saf1761_read_device_fifo_1(struct saf1761_otg_softc *sc, void *buf, uint32_t len) { + if (len == 0) + return; bus_space_read_multi_1((sc)->sc_io_tag, (sc)->sc_io_hdl, SOTG_DATA_PORT, buf, len); } @@ -573,6 +582,8 @@ saf1761_read_device_fifo_1(struct saf176 static void saf1761_write_device_fifo_1(struct saf1761_otg_softc *sc, void *buf, uint32_t len) { + if (len == 0) + return; bus_space_write_multi_1((sc)->sc_io_tag, (sc)->sc_io_hdl, SOTG_DATA_PORT, buf, len); } @@ -1614,10 +1625,29 @@ saf1761_otg_init(struct saf1761_otg_soft USB_BUS_LOCK(&sc->sc_bus); + /* Reset Host controller, including HW mode */ + SAF1761_WRITE_2(sc, SOTG_SW_RESET, SOTG_SW_RESET_ALL); + + DELAY(1000); + + /* Reset Host controller, including HW mode */ + SAF1761_WRITE_2(sc, SOTG_SW_RESET, SOTG_SW_RESET_HC); + + /* wait a bit */ + DELAY(1000); + + SAF1761_WRITE_2(sc, SOTG_SW_RESET, 0); + + /* wait a bit */ + DELAY(1000); + /* Enable interrupts */ sc->sc_hw_mode |= SOTG_HW_MODE_CTRL_GLOBAL_INTR_EN | SOTG_HW_MODE_CTRL_COMN_INT; + /* unlock device */ + SAF1761_WRITE_2(sc, SOTG_UNLOCK_DEVICE, SOTG_UNLOCK_DEVICE_CODE); + /* * Set correct hardware mode, must be written twice if bus * width is changed: @@ -1625,7 +1655,14 @@ saf1761_otg_init(struct saf1761_otg_soft SAF1761_WRITE_2(sc, SOTG_HW_MODE_CTRL, sc->sc_hw_mode); SAF1761_WRITE_4(sc, SOTG_HW_MODE_CTRL, sc->sc_hw_mode); - DPRINTF("DCID=0x%08x\n", SAF1761_READ_4(sc, SOTG_DCCHIP_ID)); + SAF1761_WRITE_4(sc, SOTG_DCSCRATCH, 0xdeadbeef); + + DPRINTF("DCID=0x%08x VEND=0x%04x PROD=0x%04x HWMODE=0x%08x SCRATCH=0x%08x\n", + SAF1761_READ_4(sc, SOTG_DCCHIP_ID), + SAF1761_READ_2(sc, SOTG_VEND_ID), + SAF1761_READ_2(sc, SOTG_PROD_ID), + SAF1761_READ_4(sc, SOTG_HW_MODE_CTRL), + SAF1761_READ_4(sc, SOTG_DCSCRATCH)); /* reset device controller */ SAF1761_WRITE_2(sc, SOTG_MODE, SOTG_MODE_SFRESET); @@ -1635,14 +1672,22 @@ saf1761_otg_init(struct saf1761_otg_soft DELAY(1000); /* reset host controller */ - SAF1761_WRITE_4(sc, SOTG_SW_RESET, SOTG_SW_RESET_HC); SAF1761_WRITE_4(sc, SOTG_USBCMD, SOTG_USBCMD_HCRESET); + /* wait for reset to clear */ + for (x = 0; x != 10; x++) { + if ((SAF1761_READ_4(sc, SOTG_USBCMD) & SOTG_USBCMD_HCRESET) == 0) + break; + usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 10); + } + + SAF1761_WRITE_4(sc, SOTG_HW_MODE_CTRL, sc->sc_hw_mode | + SOTG_HW_MODE_CTRL_ALL_ATX_RESET); + /* wait a bit */ DELAY(1000); - SAF1761_WRITE_4(sc, SOTG_SW_RESET, 0); - SAF1761_WRITE_4(sc, SOTG_USBCMD, 0); + SAF1761_WRITE_4(sc, SOTG_HW_MODE_CTRL, sc->sc_hw_mode); /* wait a bit */ DELAY(1000); @@ -1696,10 +1741,14 @@ saf1761_otg_init(struct saf1761_otg_soft SOTG_DCINTERRUPT_IEBRST | SOTG_DCINTERRUPT_IESUSP; SAF1761_WRITE_4(sc, SOTG_DCINTERRUPT_EN, sc->sc_intr_enable); - /* connect ATX port 1 to device controller */ + /* + * Connect ATX port 1 to device controller, select external + * charge pump and driver VBUS to +5V: + */ SAF1761_WRITE_2(sc, SOTG_CTRL_CLR, 0xFFFF); SAF1761_WRITE_2(sc, SOTG_CTRL_SET, SOTG_CTRL_SW_SEL_HC_DC | - SOTG_CTRL_BDIS_ACON_EN); + SOTG_CTRL_BDIS_ACON_EN | SOTG_CTRL_SEL_CP_EXT | + SOTG_CTRL_VBUS_DRV); /* disable device address */ SAF1761_WRITE_1(sc, SOTG_ADDRESS, 0); @@ -1720,6 +1769,8 @@ saf1761_otg_init(struct saf1761_otg_soft /* start the HC */ SAF1761_WRITE_4(sc, SOTG_USBCMD, SOTG_USBCMD_RS); + DPRINTF("USBCMD=0x%08x\n", SAF1761_READ_4(sc, SOTG_USBCMD)); + /* enable HC interrupts */ SAF1761_WRITE_4(sc, SOTG_HCINTERRUPT_ENABLE, SOTG_HCINTERRUPT_OTG_IRQ | @@ -2477,7 +2528,8 @@ tr_handle_get_port_status_host: temp = SAF1761_READ_4(sc, SOTG_PORTSC1); - DPRINTFN(9, "port status=0x%04x\n", temp); + DPRINTFN(9, "UR_GET_PORT_STATUS on port %d = 0x%08x\n", index, temp); + i = UPS_HIGH_SPEED; if (temp & SOTG_PORTSC1_ECCS) Modified: head/sys/dev/usb/controller/saf1761_otg_reg.h ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg_reg.h Tue May 20 12:22:53 2014 (r266466) +++ head/sys/dev/usb/controller/saf1761_otg_reg.h Tue May 20 14:15:03 2014 (r266467) @@ -78,6 +78,7 @@ #define SOTG_TIMER_HIGH_SET 0x38C #define SOTG_TIMER_HIGH_CLR 0x38E #define SOTG_TIMER_START_TMR (1U << 15) +#define SOTG_MEMORY_REG 0x33c /* Peripheral controller specific registers */ @@ -188,10 +189,10 @@ #define SOTG_PORTSC1_PED (1 << 2) #define SOTG_PORTSC1_ECSC (1 << 1) #define SOTG_PORTSC1_ECCS (1 << 0) -#define SOTG_DATA_ADDR(x) (0x400 + (512 * (x))) -#define SOTG_ASYNC_PDT(x) (0x400 + (60 * 1024) + ((x) * 32)) -#define SOTG_INTR_PDT(x) (0x400 + (61 * 1024) + ((x) * 32)) -#define SOTG_ISOC_PDT(x) (0x400 + (62 * 1024) + ((x) * 32)) +#define SOTG_DATA_ADDR(x) (0x1000 + (512 * (x))) +#define SOTG_ASYNC_PDT(x) (0xC00 + ((x) * 32)) +#define SOTG_INTR_PDT(x) (0x800 + ((x) * 32)) +#define SOTG_ISOC_PDT(x) (0x400 + ((x) * 32)) #define SOTG_HC_MEMORY_ADDR(x) (((x) - 0x400) >> 3) #define SOTG_SW_RESET 0x30C #define SOTG_SW_RESET_HC (1 << 1) @@ -210,6 +211,7 @@ #define SOTG_USBCMD_LHCR (1 << 7) #define SOTG_USBCMD_HCRESET (1 << 1) #define SOTG_USBCMD_RS (1 << 0) +#define SOTG_HCSCRATCH 0x308 #define SOTG_HCINTERRUPT 0x310 #define SOTG_HCINTERRUPT_OTG_IRQ (1 << 10) #define SOTG_HCINTERRUPT_ISO_IRQ (1 << 9) From owner-svn-src-head@FreeBSD.ORG Tue May 20 14:39:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46F0E971; Tue, 20 May 2014 14:39:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BF7B2C35; Tue, 20 May 2014 14:39:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4KEdMUH083104; Tue, 20 May 2014 14:39:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4KEdMSA083100; Tue, 20 May 2014 14:39:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405201439.s4KEdMSA083100@svn.freebsd.org> From: Alexander Motin Date: Tue, 20 May 2014 14:39:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266468 - in head: sys/dev/pci usr.sbin/pciconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 14:39:23 -0000 Author: mav Date: Tue May 20 14:39:22 2014 New Revision: 266468 URL: http://svnweb.freebsd.org/changeset/base/266468 Log: Add IOMMU PCI subclass, found on Tyan S8236 motherboard. Submitted by: Dmitry Luhtionov MFC after: 2 weeks Modified: head/sys/dev/pci/pci.c head/sys/dev/pci/pcireg.h head/usr.sbin/pciconf/pciconf.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue May 20 14:15:03 2014 (r266467) +++ head/sys/dev/pci/pci.c Tue May 20 14:39:22 2014 (r266468) @@ -4024,6 +4024,7 @@ static const struct {PCIC_BASEPERIPH, PCIS_BASEPERIPH_RTC, 1, "realtime clock"}, {PCIC_BASEPERIPH, PCIS_BASEPERIPH_PCIHOT, 1, "PCI hot-plug controller"}, {PCIC_BASEPERIPH, PCIS_BASEPERIPH_SDHC, 1, "SD host controller"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_IOMMU, 1, "IOMMU"}, {PCIC_INPUTDEV, -1, 1, "input device"}, {PCIC_INPUTDEV, PCIS_INPUTDEV_KEYBOARD, 1, "keyboard"}, {PCIC_INPUTDEV, PCIS_INPUTDEV_DIGITIZER,1, "digitizer"}, Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Tue May 20 14:15:03 2014 (r266467) +++ head/sys/dev/pci/pcireg.h Tue May 20 14:39:22 2014 (r266468) @@ -384,6 +384,7 @@ #define PCIS_BASEPERIPH_RTC 0x03 #define PCIS_BASEPERIPH_PCIHOT 0x04 #define PCIS_BASEPERIPH_SDHC 0x05 +#define PCIS_BASEPERIPH_IOMMU 0x06 #define PCIS_BASEPERIPH_OTHER 0x80 #define PCIC_INPUTDEV 0x09 Modified: head/usr.sbin/pciconf/pciconf.c ============================================================================== --- head/usr.sbin/pciconf/pciconf.c Tue May 20 14:15:03 2014 (r266467) +++ head/usr.sbin/pciconf/pciconf.c Tue May 20 14:39:22 2014 (r266468) @@ -466,6 +466,7 @@ static struct {PCIC_BASEPERIPH, PCIS_BASEPERIPH_RTC, "realtime clock"}, {PCIC_BASEPERIPH, PCIS_BASEPERIPH_PCIHOT, "PCI hot-plug controller"}, {PCIC_BASEPERIPH, PCIS_BASEPERIPH_SDHC, "SD host controller"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_IOMMU, "IOMMU"}, {PCIC_INPUTDEV, -1, "input device"}, {PCIC_INPUTDEV, PCIS_INPUTDEV_KEYBOARD, "keyboard"}, {PCIC_INPUTDEV, PCIS_INPUTDEV_DIGITIZER,"digitizer"}, From owner-svn-src-head@FreeBSD.ORG Tue May 20 15:03:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9429F64D; Tue, 20 May 2014 15:03:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 658912EC2; Tue, 20 May 2014 15:03:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4KF3O3q001444; Tue, 20 May 2014 15:03:24 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4KF3ObK001443; Tue, 20 May 2014 15:03:24 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405201503.s4KF3ObK001443@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 20 May 2014 15:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266470 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 15:03:24 -0000 Author: hselasky Date: Tue May 20 15:03:23 2014 New Revision: 266470 URL: http://svnweb.freebsd.org/changeset/base/266470 Log: Optimise reading of pending interrupt registers. If there are no pending interrupt bits, skip the bit iteration loop. Reviewed by: ian @ Modified: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_intr.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Tue May 20 14:52:56 2014 (r266469) +++ head/sys/arm/broadcom/bcm2835/bcm2835_intr.c Tue May 20 15:03:23 2014 (r266470) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #define BANK1_END (BANK1_START + 32 - 1) #define BANK2_START (BANK1_START + 32) #define BANK2_END (BANK2_START + 32 - 1) +#define BANK3_START (BANK2_START + 32) #define IS_IRQ_BASIC(n) (((n) >= 0) && ((n) < BANK1_START)) #define IS_IRQ_BANK1(n) (((n) >= BANK1_START) && ((n) <= BANK1_END)) @@ -150,29 +151,36 @@ arm_get_next_irq(int last_irq) /* Sanity check */ if (irq < 0) irq = 0; - + /* TODO: should we mask last_irq? */ - pending = intc_read_4(INTC_PENDING_BASIC); - while (irq < BANK1_START) { - if (pending & (1 << irq)) - return irq; - irq++; + if (irq < BANK1_START) { + pending = intc_read_4(INTC_PENDING_BASIC); + if ((pending & 0xFF) == 0) { + irq = BANK1_START; /* skip to next bank */ + } else do { + if (pending & (1 << irq)) + return irq; + irq++; + } while (irq < BANK1_START); } - - pending = intc_read_4(INTC_PENDING_BANK1); - while (irq < BANK2_START) { - if (pending & (1 << IRQ_BANK1(irq))) - return irq; - irq++; + if (irq < BANK2_START) { + pending = intc_read_4(INTC_PENDING_BANK1); + if (pending == 0) { + irq = BANK2_START; /* skip to next bank */ + } else do { + if (pending & (1 << IRQ_BANK1(irq))) + return irq; + irq++; + } while (irq < BANK2_START); } - - pending = intc_read_4(INTC_PENDING_BANK2); - while (irq <= BANK2_END) { - if (pending & (1 << IRQ_BANK2(irq))) - return irq; - irq++; + if (irq < BANK3_START) { + pending = intc_read_4(INTC_PENDING_BANK2); + if (pending != 0) do { + if (pending & (1 << IRQ_BANK2(irq))) + return irq; + irq++; + } while (irq < BANK3_START); } - return (-1); } From owner-svn-src-head@FreeBSD.ORG Tue May 20 15:14:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D94BEB08; Tue, 20 May 2014 15:14:38 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A8CF82FE5; Tue, 20 May 2014 15:14:38 +0000 (UTC) Received: from Julian-MBP3.local (ppp121-45-232-70.lns20.per1.internode.on.net [121.45.232.70]) (authenticated bits=0) by vps1.elischer.org (8.14.8/8.14.8) with ESMTP id s4KFEN4t063747 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 20 May 2014 08:14:26 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <537B714A.5080500@freebsd.org> Date: Tue, 20 May 2014 23:14:18 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Rui Paulo Subject: Re: svn commit: r266423 - in head/sys: conf dev/i40e modules/i40e References: <201405190121.s4J1L3qA068339@svn.freebsd.org> <53796149.8060000@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 15:14:38 -0000 On 5/20/14, 1:50 AM, Rui Paulo wrote: > On 18 May 2014, at 18:41, Julian Elischer wrote: > >> On 5/19/14, 9:21 AM, Jack F Vogel wrote: >>> Author: jfv >>> Date: Mon May 19 01:21:02 2014 >>> New Revision: 266423 >>> URL: http://svnweb.freebsd.org/changeset/base/266423 >>> >>> Log: >>> This is the beta release of the driver for the new >>> Intel 40G Ethernet Controller XL710 Family. This is >>> the core driver, a VF driver called i40evf, will be >>> following soon. Questions or comments to myself or >>> my co-developer Eric Joyner. Cheers! >> love the name.. > Aesthetics aside, I think the name should be changed. Network drivers always used [a-z] for name and [0-9] for unit. Can you find an example where this is not true? I just meant the XL (Roman Numeral 40) part.. > > -- > Rui Paulo > > > > > > From owner-svn-src-head@FreeBSD.ORG Tue May 20 15:19:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E033CD55; Tue, 20 May 2014 15:19:20 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AE34F201F; Tue, 20 May 2014 15:19:20 +0000 (UTC) Received: from Julian-MBP3.local (ppp121-45-232-70.lns20.per1.internode.on.net [121.45.232.70]) (authenticated bits=0) by vps1.elischer.org (8.14.8/8.14.8) with ESMTP id s4KFJE2I063757 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 20 May 2014 08:19:17 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <537B726C.1080000@freebsd.org> Date: Tue, 20 May 2014 23:19:08 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Rui Paulo Subject: Re: svn commit: r266423 - in head/sys: conf dev/i40e modules/i40e References: <201405190121.s4J1L3qA068339@svn.freebsd.org> <53796149.8060000@freebsd.org> <537B714A.5080500@freebsd.org> In-Reply-To: <537B714A.5080500@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 15:19:21 -0000 On 5/20/14, 11:14 PM, Julian Elischer wrote: > On 5/20/14, 1:50 AM, Rui Paulo wrote: >> On 18 May 2014, at 18:41, Julian Elischer wrote: >> >>> On 5/19/14, 9:21 AM, Jack F Vogel wrote: >>>> Author: jfv >>>> Date: Mon May 19 01:21:02 2014 >>>> New Revision: 266423 >>>> URL: http://svnweb.freebsd.org/changeset/base/266423 >>>> >>>> Log: >>>> This is the beta release of the driver for the new >>>> Intel 40G Ethernet Controller XL710 Family. This is >>>> the core driver, a VF driver called i40evf, will be >>>> following soon. Questions or comments to myself or >>>> my co-developer Eric Joyner. Cheers! >>> love the name.. >> Aesthetics aside, I think the name should be changed. Network >> drivers always used [a-z] for name and [0-9] for unit. Can you >> find an example where this is not true? > > I just meant the XL (Roman Numeral 40) part.. sorry to have caused this fuss jsut because I like the use of the common "XL" name to (in this case) hint at 40. the device name in netstat could be ixlgNNN (intel 40gig) even if the device is aimed at the 710 (and later 720 etc..) >> >> -- >> Rui Paulo >> >> >> >> >> >> > > > > From owner-svn-src-head@FreeBSD.ORG Tue May 20 15:35:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 846D828D; Tue, 20 May 2014 15:35:12 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 61A3121D5; Tue, 20 May 2014 15:35:11 +0000 (UTC) Received: from Julian-MBP3.local (ppp121-45-232-70.lns20.per1.internode.on.net [121.45.232.70]) (authenticated bits=0) by vps1.elischer.org (8.14.8/8.14.8) with ESMTP id s4KFZ6Wf063809 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 20 May 2014 08:35:09 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <537B7625.4080908@freebsd.org> Date: Tue, 20 May 2014 23:35:01 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r266464 - in head/sys: kern sys vm References: <201405200919.s4K9JZvg087765@svn.freebsd.org> In-Reply-To: <201405200919.s4K9JZvg087765@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 15:35:12 -0000 On 5/20/14, 5:19 PM, Konstantin Belousov wrote: > Author: kib > Date: Tue May 20 09:19:35 2014 > New Revision: 266464 > URL: http://svnweb.freebsd.org/changeset/base/266464 > > Log: > When exec_new_vmspace() decides that current vmspace cannot be reused > on execve(2), it calls vmspace_exec(), which frees the current > vmspace. The thread executing an exec syscall gets new vmspace > assigned, and old vmspace is freed if only referenced by the current > process. The free operation includes pmap_release(), which > de-constructs the paging structures used by hardware. > > If the calling process is multithreaded, other threads are suspended > in the thread_suspend_check(), and need to be unsuspended and run to > be able to exit on successfull exec. Now, since the old vmspace is > destroyed, paging structures are invalid, threads are resumed on the > non-existent pmaps (page tables), which leads to triple fault on x86. > > To fix, postpone the free of old vmspace until the threads are resumed > and exited. To avoid modifications to all image activators all of > which use exec_new_vmspace(), memoize the current (old) vmspace in > kern_execve(), and notify it about the need to call vmspace_free() > with a thread-private flag TDP_EXECVMSPC. I was sure that we covered this case at some time in the past.. I think all threads but the caller were killed at the kernel boundary and exec waited for that to happen. > > http://bugs.debian.org/743141 > > Reported by: Ivo De Decker through secteam > Sponsored by: The FreeBSD Foundation > MFC after: 3 days > > Modified: > head/sys/kern/kern_exec.c > head/sys/sys/proc.h > head/sys/vm/vm_map.c > > Modified: head/sys/kern/kern_exec.c > ============================================================================== > --- head/sys/kern/kern_exec.c Tue May 20 03:00:20 2014 (r266463) > +++ head/sys/kern/kern_exec.c Tue May 20 09:19:35 2014 (r266464) > @@ -282,6 +282,7 @@ kern_execve(td, args, mac_p) > struct mac *mac_p; > { > struct proc *p = td->td_proc; > + struct vmspace *oldvmspace; > int error; > > AUDIT_ARG_ARGV(args->begin_argv, args->argc, > @@ -298,6 +299,8 @@ kern_execve(td, args, mac_p) > PROC_UNLOCK(p); > } > > + KASSERT((td->td_pflags & TDP_EXECVMSPC) == 0, ("nested execve")); > + oldvmspace = td->td_proc->p_vmspace; > error = do_execve(td, args, mac_p); > > if (p->p_flag & P_HADTHREADS) { > @@ -312,6 +315,12 @@ kern_execve(td, args, mac_p) > thread_single_end(); > PROC_UNLOCK(p); > } > + if ((td->td_pflags & TDP_EXECVMSPC) != 0) { > + KASSERT(td->td_proc->p_vmspace != oldvmspace, > + ("oldvmspace still used")); > + vmspace_free(oldvmspace); > + td->td_pflags &= ~TDP_EXECVMSPC; > + } > > return (error); > } > > Modified: head/sys/sys/proc.h > ============================================================================== > --- head/sys/sys/proc.h Tue May 20 03:00:20 2014 (r266463) > +++ head/sys/sys/proc.h Tue May 20 09:19:35 2014 (r266464) > @@ -429,6 +429,7 @@ do { \ > #define TDP_NERRNO 0x08000000 /* Last errno is already in td_errno */ > #define TDP_UIOHELD 0x10000000 /* Current uio has pages held in td_ma */ > #define TDP_DEVMEMIO 0x20000000 /* Accessing memory for /dev/mem */ > +#define TDP_EXECVMSPC 0x40000000 /* Execve destroyed old vmspace */ > > /* > * Reasons that the current thread can not be run yet. > > Modified: head/sys/vm/vm_map.c > ============================================================================== > --- head/sys/vm/vm_map.c Tue May 20 03:00:20 2014 (r266463) > +++ head/sys/vm/vm_map.c Tue May 20 09:19:35 2014 (r266464) > @@ -3758,6 +3758,8 @@ vmspace_exec(struct proc *p, vm_offset_t > struct vmspace *oldvmspace = p->p_vmspace; > struct vmspace *newvmspace; > > + KASSERT((curthread->td_pflags & TDP_EXECVMSPC) == 0, > + ("vmspace_exec recursed")); > newvmspace = vmspace_alloc(minuser, maxuser, NULL); > if (newvmspace == NULL) > return (ENOMEM); > @@ -3774,7 +3776,7 @@ vmspace_exec(struct proc *p, vm_offset_t > PROC_VMSPACE_UNLOCK(p); > if (p == curthread->td_proc) > pmap_activate(curthread); > - vmspace_free(oldvmspace); > + curthread->td_pflags |= TDP_EXECVMSPC; > return (0); > } > > > > From owner-svn-src-head@FreeBSD.ORG Tue May 20 15:41:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34A644D4; Tue, 20 May 2014 15:41:18 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E06A12228; Tue, 20 May 2014 15:41:17 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.82 (FreeBSD)) (envelope-from ) id 1WmmAD-00067n-T1; Tue, 20 May 2014 19:41:13 +0400 Date: Tue, 20 May 2014 19:41:13 +0400 From: Slawa Olhovchenkov To: Adrian Chadd Subject: Re: svn commit: r265792 - head/sys/kern Message-ID: <20140520154113.GA23318@zxy.spb.ru> References: <201405100053.s4A0rbF9080571@svn.freebsd.org> <20140511083114.GA53503@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 15:41:18 -0000 On Sun, May 11, 2014 at 08:32:34AM -0700, Adrian Chadd wrote: > On 11 May 2014 01:31, Slawa Olhovchenkov wrote: > > On Sat, May 10, 2014 at 12:53:37AM +0000, Adrian Chadd wrote: > > > >> Author: adrian > >> Date: Sat May 10 00:53:36 2014 > >> New Revision: 265792 > >> URL: http://svnweb.freebsd.org/changeset/base/265792 > >> > >> Log: > >> Add in support to optionally pin the swi threads. > >> > >> Under enough load, the swi's can actually be preempted and migrated > >> to other currently free cores. When doing RSS experiments, this lead > >> to the per-CPU TCP timers not lining up any more with the RX CPU said > >> flows were ending up on, leading to increased lock contention. > >> > >> Since there was a little pushback on flipping them on by default, > >> I've left the default at "don't pin." > >> > >> The other less obvious problem here is that the default swi > >> is also the same as the destination swi for CPU #0. So if one > >> pins the swi on CPU #0, there's no default floating swi. > >> > >> A nice future project would be to create a separate swi for > >> the "default" floating swi, as well as per-CPU swis that are > >> (optionally) pinned. > > > > MFC planed? > > I have 10.0 box with aprox. 16Gbit TCP at peak. > > I've no plans to MFC it at the present. > > By itself it shouldn't do very much. The rest of RSS stack and driver > changes have to go in before it'll matter. > > (But if you try it on 10.0 and it changes things, by all means let me know.) I am try on 10.0, but not sure about significant improvement (may be 10%). For current CPU (E5-2650 v2 @ 2.60GHz) hwpmc don't working (1. after collect some data `pmcstat -R sample.out -G out.txt` don't decode any; 2. kldunload hwpmc do kernel crash) and I can't collect detailed profile information. From owner-svn-src-head@FreeBSD.ORG Tue May 20 15:44:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1D56657; Tue, 20 May 2014 15:44:18 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7445422BF; Tue, 20 May 2014 15:44:18 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.8/8.14.8) with ESMTP id s4KFiCDn068092; Tue, 20 May 2014 18:44:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s4KFiCDn068092 Received: (from kostik@localhost) by tom.home (8.14.8/8.14.8/Submit) id s4KFiCTT068091; Tue, 20 May 2014 18:44:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 20 May 2014 18:44:12 +0300 From: Konstantin Belousov To: Julian Elischer Subject: Re: svn commit: r266464 - in head/sys: kern sys vm Message-ID: <20140520154412.GM74331@kib.kiev.ua> References: <201405200919.s4K9JZvg087765@svn.freebsd.org> <537B7625.4080908@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="c0R9lMW4BuILQA0o" Content-Disposition: inline In-Reply-To: <537B7625.4080908@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 15:44:19 -0000 --c0R9lMW4BuILQA0o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 20, 2014 at 11:35:01PM +0800, Julian Elischer wrote: > On 5/20/14, 5:19 PM, Konstantin Belousov wrote: > > Author: kib > > Date: Tue May 20 09:19:35 2014 > > New Revision: 266464 > > URL: http://svnweb.freebsd.org/changeset/base/266464 > > > > Log: > > When exec_new_vmspace() decides that current vmspace cannot be reused > > on execve(2), it calls vmspace_exec(), which frees the current > > vmspace. The thread executing an exec syscall gets new vmspace > > assigned, and old vmspace is freed if only referenced by the current > > process. The free operation includes pmap_release(), which > > de-constructs the paging structures used by hardware. > > =20 > > If the calling process is multithreaded, other threads are suspended > > in the thread_suspend_check(), and need to be unsuspended and run to > > be able to exit on successfull exec. Now, since the old vmspace is > > destroyed, paging structures are invalid, threads are resumed on the > > non-existent pmaps (page tables), which leads to triple fault on x86. > > =20 > > To fix, postpone the free of old vmspace until the threads are resum= ed > > and exited. To avoid modifications to all image activators all of > > which use exec_new_vmspace(), memoize the current (old) vmspace in > > kern_execve(), and notify it about the need to call vmspace_free() > > with a thread-private flag TDP_EXECVMSPC. > I was sure that we covered this case at some time in the past.. > I think all threads but the caller were killed at the kernel boundary=20 > and exec waited for that to happen. No, what you describe cannot be done. Threads cannot be killed until we are committed for exec to either success, or we do not have any other route except killing the process. If we return in the context of the image executing execve(2), then we must return an error, and other threads must survive. Threads are gracefully terminated after the kern_exec() committed to something. This is correctly handled in the code, except the glitch fixed in the commit. --c0R9lMW4BuILQA0o Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJTe3hMAAoJEJDCuSvBvK1B9HYQAKAroFKlgE3OPMMLyQHNWaiM V6q2swFPi4Uv9mM0PnD3t9kkuBMgeUGw5GAH41cimhOjJ7BRQW9ECP0Sp+78wWSx F7Fc+7WH7Zo6NfKy6irBvJbKmp79HGMkedIE2FcRu//P/BVZuzwohtkSS6gwr77m CCe+iCI5MrfaEixIxAXNIAmYuoryjn1bDnum5UrSHcnqmg5J7hM9ak7OoafYPgob rueb0vpVHXvdqjyVHHqZmQ6Wsn1OP97cPCKgPfi57YwjZ7Gdl3ft1FjzNodOyUHe v/0ROBudKQFLL0JbN7a/9/hDXbmqys+K8gyDfKm/KAWpC5O+yLkuaa5mtZPuVEvK HSWLr2uv8FyW+R5bw0FebpVYyqHTNxvLpkSDSG30GphmehQRDDJgC+xv1d5UN3SL J8JIcrwDltlefArnnHrJe5LIHsRqCba8X3MrRbLN5zE2Ci9r11FzQ/BPkVrd4gLP sD7zvCuh3uhv5LoIN4sLPMXv5mmtKj78zJpXrR9ZHtWO8ONBFq4+iTdGEMHOD18+ aU2VobSn5aQHohB51NmhGeD7TPvf+gi8EfFKVjbUEhjpr7bpFW9Tp7LpQww/w7Cl ScmygybfSOjCg4uy2sP4VDHU8QFLGutFsizMaw6UviZ5NMsRUR4QpLljG3bpqLdx 1SVpeqetTye/4ZmS2fJd =Vohx -----END PGP SIGNATURE----- --c0R9lMW4BuILQA0o-- From owner-svn-src-head@FreeBSD.ORG Tue May 20 15:47:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65E497CD; Tue, 20 May 2014 15:47:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52CA322E6; Tue, 20 May 2014 15:47:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4KFlcnb026595; Tue, 20 May 2014 15:47:38 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4KFlcPA026594; Tue, 20 May 2014 15:47:38 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405201547.s4KFlcPA026594@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 20 May 2014 15:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266471 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 15:47:38 -0000 Author: hselasky Date: Tue May 20 15:47:37 2014 New Revision: 266471 URL: http://svnweb.freebsd.org/changeset/base/266471 Log: - The DELAY() should not be used in USB drivers. - The usb_pause_mtx() function takes ticks and not milliseconds as last argument. MFC after: 3 days Modified: head/sys/dev/usb/wlan/if_rsu.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Tue May 20 15:03:23 2014 (r266470) +++ head/sys/dev/usb/wlan/if_rsu.c Tue May 20 15:47:37 2014 (r266471) @@ -195,6 +195,7 @@ static void rsu_start_locked(struct ifne static int rsu_ioctl(struct ifnet *, u_long, caddr_t); static void rsu_stop(struct ifnet *, int); static void rsu_stop_locked(struct ifnet *, int); +static void rsu_ms_delay(struct rsu_softc *); static device_method_t rsu_methods[] = { DEVMETHOD(device_probe, rsu_match), @@ -756,11 +757,11 @@ rsu_fw_iocmd(struct rsu_softc *sc, uint3 int ntries; rsu_write_4(sc, R92S_IOCMD_CTRL, iocmd); - DELAY(100); + rsu_ms_delay(sc); for (ntries = 0; ntries < 50; ntries++) { if (rsu_read_4(sc, R92S_IOCMD_CTRL) == 0) return (0); - DELAY(10); + rsu_ms_delay(sc); } return (ETIMEDOUT); } @@ -780,7 +781,7 @@ rsu_efuse_read_1(struct rsu_softc *sc, u reg = rsu_read_4(sc, R92S_EFUSE_CTRL); if (reg & R92S_EFUSE_CTRL_VALID) return (MS(reg, R92S_EFUSE_CTRL_DATA)); - DELAY(5); + rsu_ms_delay(sc); } device_printf(sc->sc_dev, "could not read efuse byte at address 0x%x\n", addr); @@ -804,7 +805,7 @@ rsu_read_rom(struct rsu_softc *sc) /* Turn on 2.5V to prevent eFuse leakage. */ reg = rsu_read_1(sc, R92S_EFUSE_TEST + 3); rsu_write_1(sc, R92S_EFUSE_TEST + 3, reg | 0x80); - DELAY(1000); + rsu_ms_delay(sc); rsu_write_1(sc, R92S_EFUSE_TEST + 3, reg & ~0x80); /* Read full ROM image. */ @@ -1942,7 +1943,7 @@ rsu_power_on_bcut(struct rsu_softc *sc) } rsu_write_1(sc, R92S_SYS_FUNC_EN + 1, rsu_read_1(sc, R92S_SYS_FUNC_EN + 1) & ~0x8c); - DELAY(1000); + rsu_ms_delay(sc); rsu_write_1(sc, R92S_SPS0_CTRL + 1, 0x53); rsu_write_1(sc, R92S_SPS0_CTRL + 0, 0x57); @@ -1975,11 +1976,11 @@ rsu_power_on_bcut(struct rsu_softc *sc) /* Enable AFE PLL macro block. */ reg = rsu_read_1(sc, R92S_AFE_PLL_CTRL); rsu_write_1(sc, R92S_AFE_PLL_CTRL, reg | 0x11); - DELAY(500); + rsu_ms_delay(sc); rsu_write_1(sc, R92S_AFE_PLL_CTRL, reg | 0x51); - DELAY(500); + rsu_ms_delay(sc); rsu_write_1(sc, R92S_AFE_PLL_CTRL, reg | 0x11); - DELAY(500); + rsu_ms_delay(sc); /* Attach AFE PLL to MACTOP/BB. */ rsu_write_1(sc, R92S_SYS_ISO_CTRL, @@ -2026,14 +2027,14 @@ rsu_power_on_bcut(struct rsu_softc *sc) if ((reg & (R92S_TCR_IMEM_CHK_RPT | R92S_TCR_EMEM_CHK_RPT)) == (R92S_TCR_IMEM_CHK_RPT | R92S_TCR_EMEM_CHK_RPT)) break; - DELAY(5); + rsu_ms_delay(sc); } if (ntries == 20) { DPRINTF("TxDMA is not ready\n"); /* Reset TxDMA. */ reg = rsu_read_1(sc, R92S_CR); rsu_write_1(sc, R92S_CR, reg & ~R92S_CR_TXDMA_EN); - DELAY(2); + rsu_ms_delay(sc); rsu_write_1(sc, R92S_CR, reg | R92S_CR_TXDMA_EN); } } @@ -2220,7 +2221,7 @@ rsu_load_firmware(struct rsu_softc *sc) for (ntries = 0; ntries < 100; ntries++) { if (rsu_read_2(sc, R92S_TCR) & R92S_TCR_IMEM_RDY) break; - DELAY(1000); + rsu_ms_delay(sc); } if (ntries == 100) { device_printf(sc->sc_dev, @@ -2252,7 +2253,7 @@ rsu_load_firmware(struct rsu_softc *sc) for (ntries = 0; ntries < 100; ntries++) { if (rsu_read_2(sc, R92S_TCR) & R92S_TCR_DMEM_CODE_DONE) break; - DELAY(1000); + rsu_ms_delay(sc); } if (ntries == 100) { device_printf(sc->sc_dev, "timeout waiting for %s transfer\n", @@ -2264,7 +2265,7 @@ rsu_load_firmware(struct rsu_softc *sc) for (ntries = 0; ntries < 60; ntries++) { if (!(rsu_read_2(sc, R92S_TCR) & R92S_TCR_FWRDY)) break; - DELAY(1000); + rsu_ms_delay(sc); } if (ntries == 60) { device_printf(sc->sc_dev, @@ -2385,8 +2386,8 @@ rsu_init_locked(struct rsu_softc *sc) rsu_write_region_1(sc, R92S_MACID, IF_LLADDR(ifp), IEEE80211_ADDR_LEN); - /* NB: it really takes that long for firmware to boot. */ - usb_pause_mtx(&sc->sc_mtx, 1500); + /* It really takes 1.5 seconds for the firmware to boot: */ + usb_pause_mtx(&sc->sc_mtx, (3 * hz) / 2); DPRINTF("setting MAC address to %s\n", ether_sprintf(IF_LLADDR(ifp))); error = rsu_fw_cmd(sc, R92S_CMD_SET_MAC_ADDRESS, IF_LLADDR(ifp), @@ -2469,3 +2470,8 @@ rsu_stop_locked(struct ifnet *ifp, int d usbd_transfer_stop(sc->sc_xfer[i]); } +static void +rsu_ms_delay(struct rsu_softc *sc) +{ + usb_pause_mtx(&sc->sc_mtx, hz / 1000); +} From owner-svn-src-head@FreeBSD.ORG Tue May 20 15:49:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C89FA9C7; Tue, 20 May 2014 15:49:41 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 895732301; Tue, 20 May 2014 15:49:41 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 32960D636D6; Wed, 21 May 2014 01:49:39 +1000 (EST) Date: Wed, 21 May 2014 01:49:38 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Julian Elischer Subject: Re: svn commit: r266423 - in head/sys: conf dev/i40e modules/i40e In-Reply-To: <537B726C.1080000@freebsd.org> Message-ID: <20140521014355.V3433@besplex.bde.org> References: <201405190121.s4J1L3qA068339@svn.freebsd.org> <53796149.8060000@freebsd.org> <537B714A.5080500@freebsd.org> <537B726C.1080000@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=U6SrU4bu c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=JD0ISiim65UA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=dkgnPKtVp_qkzpxtsWUA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 15:49:41 -0000 On Tue, 20 May 2014, Julian Elischer wrote: > On 5/20/14, 11:14 PM, Julian Elischer wrote: >> On 5/20/14, 1:50 AM, Rui Paulo wrote: >>> On 18 May 2014, at 18:41, Julian Elischer wrote: >>> >>>> On 5/19/14, 9:21 AM, Jack F Vogel wrote: >>>>> Author: jfv >>>>> Date: Mon May 19 01:21:02 2014 >>>>> New Revision: 266423 >>>>> URL: http://svnweb.freebsd.org/changeset/base/266423 >>>>> >>>>> Log: >>>>> This is the beta release of the driver for the new >>>>> Intel 40G Ethernet Controller XL710 Family. This is >>>>> the core driver, a VF driver called i40evf, will be >>>>> following soon. Questions or comments to myself or >>>>> my co-developer Eric Joyner. Cheers! >>>> love the name.. >>> Aesthetics aside, I think the name should be changed. Network drivers >>> always used [a-z] for name and [0-9] for unit. Can you find an example >>> where this is not true? >> >> I just meant the XL (Roman Numeral 40) part.. > > sorry to have caused this fuss jsut because I like the use of the common "XL" > name to (in this case) hint at 40. > the device name in netstat could be ixlgNNN (intel 40gig) even if the device > is aimed at the 710 (and later 720 etc..) Then the correct name is xlN, but unfortunately ;) wpaul already used up most of the 2-letter namespace (xl went in 1998). ixl would be OK. Bruce From owner-svn-src-head@FreeBSD.ORG Tue May 20 15:53:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68F36C05; Tue, 20 May 2014 15:53:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49EF323C7; Tue, 20 May 2014 15:53:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4KFrIph032029; Tue, 20 May 2014 15:53:18 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4KFrIG5032028; Tue, 20 May 2014 15:53:18 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405201553.s4KFrIG5032028@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 20 May 2014 15:53:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266472 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 15:53:18 -0000 Author: hselasky Date: Tue May 20 15:53:17 2014 New Revision: 266472 URL: http://svnweb.freebsd.org/changeset/base/266472 Log: - The DELAY() should not be used in USB drivers. - The usb_pause_mtx() function takes ticks and not milliseconds as last argument. MFC after: 3 days Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Tue May 20 15:47:37 2014 (r266471) +++ head/sys/dev/usb/wlan/if_urtwn.c Tue May 20 15:53:17 2014 (r266472) @@ -271,6 +271,7 @@ static void urtwn_stop_locked(struct if static void urtwn_abort_xfers(struct urtwn_softc *); static int urtwn_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); +static void urtwn_ms_delay(struct urtwn_softc *); /* Aliases. */ #define urtwn_bb_write urtwn_write_4 @@ -1060,7 +1061,7 @@ urtwn_fw_cmd(struct urtwn_softc *sc, uin for (ntries = 0; ntries < 100; ntries++) { if (!(urtwn_read_1(sc, R92C_HMETFR) & (1 << sc->fwcur))) break; - DELAY(1); + urtwn_ms_delay(sc); } if (ntries == 100) { device_printf(sc->sc_dev, @@ -1120,16 +1121,16 @@ urtwn_rf_read(struct urtwn_softc *sc, in urtwn_bb_write(sc, R92C_HSSI_PARAM2(0), reg[0] & ~R92C_HSSI_PARAM2_READ_EDGE); - DELAY(1000); + urtwn_ms_delay(sc); urtwn_bb_write(sc, R92C_HSSI_PARAM2(chain), RW(reg[chain], R92C_HSSI_PARAM2_READ_ADDR, addr) | R92C_HSSI_PARAM2_READ_EDGE); - DELAY(1000); + urtwn_ms_delay(sc); urtwn_bb_write(sc, R92C_HSSI_PARAM2(0), reg[0] | R92C_HSSI_PARAM2_READ_EDGE); - DELAY(1000); + urtwn_ms_delay(sc); if (urtwn_bb_read(sc, R92C_HSSI_PARAM1(chain)) & R92C_HSSI_PARAM1_PI) val = urtwn_bb_read(sc, R92C_HSPI_READBACK(chain)); @@ -1152,7 +1153,7 @@ urtwn_llt_write(struct urtwn_softc *sc, if (MS(urtwn_read_4(sc, R92C_LLT_INIT), R92C_LLT_INIT_OP) == R92C_LLT_INIT_OP_NO_ACTIVE) return (0); - DELAY(5); + urtwn_ms_delay(sc); } return (ETIMEDOUT); } @@ -1172,7 +1173,7 @@ urtwn_efuse_read_1(struct urtwn_softc *s reg = urtwn_read_4(sc, R92C_EFUSE_CTRL); if (reg & R92C_EFUSE_CTRL_VALID) return (MS(reg, R92C_EFUSE_CTRL_DATA)); - DELAY(5); + urtwn_ms_delay(sc); } device_printf(sc->sc_dev, "could not read efuse byte at address 0x%x\n", addr); @@ -2099,7 +2100,7 @@ urtwn_r92c_power_on(struct urtwn_softc * for (ntries = 0; ntries < 1000; ntries++) { if (urtwn_read_1(sc, R92C_APS_FSMCO) & R92C_APS_FSMCO_PFM_ALDN) break; - DELAY(5); + urtwn_ms_delay(sc); } if (ntries == 1000) { device_printf(sc->sc_dev, @@ -2111,13 +2112,13 @@ urtwn_r92c_power_on(struct urtwn_softc * urtwn_write_1(sc, R92C_RSV_CTRL, 0); /* Move SPS into PWM mode. */ urtwn_write_1(sc, R92C_SPS0_CTRL, 0x2b); - DELAY(100); + urtwn_ms_delay(sc); reg = urtwn_read_1(sc, R92C_LDOV12D_CTRL); if (!(reg & R92C_LDOV12D_CTRL_LDV12_EN)) { urtwn_write_1(sc, R92C_LDOV12D_CTRL, reg | R92C_LDOV12D_CTRL_LDV12_EN); - DELAY(100); + urtwn_ms_delay(sc); urtwn_write_1(sc, R92C_SYS_ISO_CTRL, urtwn_read_1(sc, R92C_SYS_ISO_CTRL) & ~R92C_SYS_ISO_CTRL_MD2PP); @@ -2130,7 +2131,7 @@ urtwn_r92c_power_on(struct urtwn_softc * if (!(urtwn_read_2(sc, R92C_APS_FSMCO) & R92C_APS_FSMCO_APFM_ONMAC)) break; - DELAY(5); + urtwn_ms_delay(sc); } if (ntries == 1000) { device_printf(sc->sc_dev, @@ -2154,7 +2155,7 @@ urtwn_r92c_power_on(struct urtwn_softc * if (!(urtwn_read_1(sc, R92C_APSD_CTRL) & R92C_APSD_CTRL_OFF_STATUS)) break; - DELAY(5); + urtwn_ms_delay(sc); } if (ntries == 200) { device_printf(sc->sc_dev, @@ -2186,7 +2187,7 @@ urtwn_r88e_power_on(struct urtwn_softc * val = urtwn_read_1(sc, 0x6) & 0x2; if (val == 0x2) break; - DELAY(10); + urtwn_ms_delay(sc); } if (ntries == 5000) { device_printf(sc->sc_dev, @@ -2211,7 +2212,7 @@ urtwn_r88e_power_on(struct urtwn_softc * for (ntries = 0; ntries < 5000; ntries++) { if (!(urtwn_read_1(sc, 0x5) & 0x1)) break; - DELAY(10); + urtwn_ms_delay(sc); } if (ntries == 5000) return (ETIMEDOUT); @@ -2275,7 +2276,7 @@ urtwn_fw_reset(struct urtwn_softc *sc) reg = urtwn_read_2(sc, R92C_SYS_FUNC_EN); if (!(reg & R92C_SYS_FUNC_EN_CPUEN)) return; - DELAY(50); + urtwn_ms_delay(sc); } /* Force 8051 reset. */ urtwn_write_2(sc, R92C_SYS_FUNC_EN, reg & ~R92C_SYS_FUNC_EN_CPUEN); @@ -2409,7 +2410,7 @@ urtwn_load_firmware(struct urtwn_softc * for (ntries = 0; ntries < 1000; ntries++) { if (urtwn_read_4(sc, R92C_MCUFWDL) & R92C_MCUFWDL_CHKSUM_RPT) break; - DELAY(5); + urtwn_ms_delay(sc); } if (ntries == 1000) { device_printf(sc->sc_dev, @@ -2427,7 +2428,7 @@ urtwn_load_firmware(struct urtwn_softc * for (ntries = 0; ntries < 1000; ntries++) { if (urtwn_read_4(sc, R92C_MCUFWDL) & R92C_MCUFWDL_WINTINI_RDY) break; - DELAY(5); + urtwn_ms_delay(sc); } if (ntries == 1000) { device_printf(sc->sc_dev, @@ -2646,7 +2647,7 @@ urtwn_bb_init(struct urtwn_softc *sc) /* Write BB initialization values. */ for (i = 0; i < prog->count; i++) { urtwn_bb_write(sc, prog->regs[i], prog->vals[i]); - DELAY(1); + urtwn_ms_delay(sc); } if (sc->chip & URTWN_CHIP_92C_1T2R) { @@ -2692,14 +2693,14 @@ urtwn_bb_init(struct urtwn_softc *sc) for (i = 0; i < prog->agccount; i++) { urtwn_bb_write(sc, R92C_OFDM0_AGCRSSITABLE, prog->agcvals[i]); - DELAY(1); + urtwn_ms_delay(sc); } if (sc->chip & URTWN_CHIP_88E) { urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), 0x69553422); - DELAY(1); + urtwn_ms_delay(sc); urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), 0x69553420); - DELAY(1); + urtwn_ms_delay(sc); crystalcap = sc->r88e_rom[0xb9]; if (crystalcap == 0xff) @@ -2747,21 +2748,21 @@ urtwn_rf_init(struct urtwn_softc *sc) reg = urtwn_bb_read(sc, R92C_FPGA0_RFIFACEOE(i)); reg |= 0x100000; urtwn_bb_write(sc, R92C_FPGA0_RFIFACEOE(i), reg); - DELAY(1); + urtwn_ms_delay(sc); /* Set RF_ENV output high. */ reg = urtwn_bb_read(sc, R92C_FPGA0_RFIFACEOE(i)); reg |= 0x10; urtwn_bb_write(sc, R92C_FPGA0_RFIFACEOE(i), reg); - DELAY(1); + urtwn_ms_delay(sc); /* Set address and data lengths of RF registers. */ reg = urtwn_bb_read(sc, R92C_HSSI_PARAM2(i)); reg &= ~R92C_HSSI_PARAM2_ADDR_LENGTH; urtwn_bb_write(sc, R92C_HSSI_PARAM2(i), reg); - DELAY(1); + urtwn_ms_delay(sc); reg = urtwn_bb_read(sc, R92C_HSSI_PARAM2(i)); reg &= ~R92C_HSSI_PARAM2_DATA_LENGTH; urtwn_bb_write(sc, R92C_HSSI_PARAM2(i), reg); - DELAY(1); + urtwn_ms_delay(sc); /* Write RF initialization values for this chain. */ for (j = 0; j < prog[i].count; j++) { @@ -2771,12 +2772,12 @@ urtwn_rf_init(struct urtwn_softc *sc) * These are fake RF registers offsets that * indicate a delay is required. */ - usb_pause_mtx(&sc->sc_mtx, 50); + usb_pause_mtx(&sc->sc_mtx, hz / 20); /* 50ms */ continue; } urtwn_rf_write(sc, i, prog[i].regs[j], prog[i].vals[j]); - DELAY(1); + urtwn_ms_delay(sc); } /* Restore RF_ENV control type. */ @@ -3250,7 +3251,7 @@ urtwn_lc_calib(struct urtwn_softc *sc) urtwn_rf_read(sc, 0, R92C_RF_CHNLBW) | R92C_RF_CHNLBW_LCSTART); /* Give calibration the time to complete. */ - usb_pause_mtx(&sc->sc_mtx, 100); + usb_pause_mtx(&sc->sc_mtx, hz / 10); /* 100ms */ /* Restore configuration. */ if ((txmode & 0x70) != 0) { @@ -3533,6 +3534,12 @@ urtwn_raw_xmit(struct ieee80211_node *ni return (0); } +static void +urtwn_ms_delay(struct urtwn_softc *sc) +{ + usb_pause_mtx(&sc->sc_mtx, hz / 1000); +} + static device_method_t urtwn_methods[] = { /* Device interface */ DEVMETHOD(device_probe, urtwn_match), From owner-svn-src-head@FreeBSD.ORG Tue May 20 16:04:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B7A4165; Tue, 20 May 2014 16:04:27 +0000 (UTC) Received: from mail-qg0-x231.google.com (mail-qg0-x231.google.com [IPv6:2607:f8b0:400d:c04::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C18124B6; Tue, 20 May 2014 16:04:26 +0000 (UTC) Received: by mail-qg0-f49.google.com with SMTP id a108so1075573qge.22 for ; Tue, 20 May 2014 09:04:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=jxEbovZGBnG87/TkG33hEyTqjDUU6DPFkdfanQxMNw8=; b=FZl3kK2Ijr0C5sDvasFN5396vBu1PVbTfQFq2X0Om4vlkZUdiJKI2//wVfeovRQNSW Len8RE4MsPw2tNmJqGsVWhgeAI04t/tuAXDrC5QFVEPjE8Rqh2Ie+fJlRswp08W5Oano zx270vY6ExzDpU2wT3KWLseFoB46rXBggGVNu2lb9gAd+R+2QQm5MtUZLjX5GqdYkLyc C/L2m4uYm4lh60ys3S0QUXSEHBJblGLdpA+p8mtIBnClIj4mcMtiq2ZVgEyCT8t4QN5n ODvoHALbgMUJfR/Bi3i7nGbu0TiJIMsnHaVyaEK7aLm7ox42iY1WjqqjxUnuqgBISzjg CfQw== MIME-Version: 1.0 X-Received: by 10.224.16.199 with SMTP id p7mr60042787qaa.76.1400601865781; Tue, 20 May 2014 09:04:25 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.191.201 with HTTP; Tue, 20 May 2014 09:04:25 -0700 (PDT) In-Reply-To: <20140520154113.GA23318@zxy.spb.ru> References: <201405100053.s4A0rbF9080571@svn.freebsd.org> <20140511083114.GA53503@zxy.spb.ru> <20140520154113.GA23318@zxy.spb.ru> Date: Tue, 20 May 2014 09:04:25 -0700 X-Google-Sender-Auth: 2BA7OtUkkns2bD-3VXVeE9jDicg Message-ID: Subject: Re: svn commit: r265792 - head/sys/kern From: Adrian Chadd To: Slawa Olhovchenkov Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 16:04:27 -0000 On 20 May 2014 08:41, Slawa Olhovchenkov wrote: >> (But if you try it on 10.0 and it changes things, by all means let me know.) > > I am try on 10.0, but not sure about significant improvement (may be > 10%). > > For current CPU (E5-2650 v2 @ 2.60GHz) hwpmc don't working (1. after > collect some data `pmcstat -R sample.out -G out.txt` don't decode any; > 2. kldunload hwpmc do kernel crash) and I can't collect detailed > profile information. Yup. I'm starting to get really ticked off at how pmc logging on multi-core devices just "stops" after a while. I'll talk with other pmc people and see if we can figure out what the heck is going on. :( -a From owner-svn-src-head@FreeBSD.ORG Tue May 20 16:08:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B833335; Tue, 20 May 2014 16:08:51 +0000 (UTC) Received: from mail-vc0-x233.google.com (mail-vc0-x233.google.com [IPv6:2607:f8b0:400c:c03::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82FD524FB; Tue, 20 May 2014 16:08:50 +0000 (UTC) Received: by mail-vc0-f179.google.com with SMTP id im17so896118vcb.38 for ; Tue, 20 May 2014 09:08:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=jJQRl4D6q4IvOm7dJfaxt6mZnmTBMt81oSHqEWjBJyM=; b=KorNt60dXr7WKGMgt64zlwGh9hWnkIn6/FDDfJbAlx6g8RJ5OTngjA/R/8eZI6gIk+ vKQ2wsVJGUAkoj8a/ates2zFRmWZHjbLU9GnVXQM0LD9ayTgdSny79l2lBfWWRS4FlU3 neI7fQ0y+knMh/J4bNLUSd1Rm1916ygq0HadeVXnYGYBOcKpnwZUSopTFY00fAz4WOSp tNf+6/ejtprAFCKvJGgBxZOVhKtTvz+VJxbu96W7lZks0nSYI7sSboUqNPgh4WebwLXP zoNoQA3w1ztG+UwJBJ9zXyC4W3WtAr1+xwTi55WEyd0nWb5o9XuboqobhlQn6iqgUimw Z0HA== MIME-Version: 1.0 X-Received: by 10.220.81.194 with SMTP id y2mr4663588vck.29.1400602129670; Tue, 20 May 2014 09:08:49 -0700 (PDT) Received: by 10.221.5.74 with HTTP; Tue, 20 May 2014 09:08:49 -0700 (PDT) In-Reply-To: <20140521014355.V3433@besplex.bde.org> References: <201405190121.s4J1L3qA068339@svn.freebsd.org> <53796149.8060000@freebsd.org> <537B714A.5080500@freebsd.org> <537B726C.1080000@freebsd.org> <20140521014355.V3433@besplex.bde.org> Date: Tue, 20 May 2014 09:08:49 -0700 Message-ID: Subject: Re: svn commit: r266423 - in head/sys: conf dev/i40e modules/i40e From: Jack Vogel To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Rui Paulo , Jack F Vogel , Julian Elischer X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 16:08:51 -0000 If you don't like the name there's this wonderful feature of ifconfig ifconfig i40e0 name eth0 (or whatever pleases you...) Oh and Bruce, I did run into the string length issue, so with this driver the queues are all named 'q%d', I might go back and change the earlier drivers. I found the 'too long' strings caused some really weird behavior with vmstat once you had 32 queues, btw. Jack On Tue, May 20, 2014 at 8:49 AM, Bruce Evans wrote: > On Tue, 20 May 2014, Julian Elischer wrote: > > On 5/20/14, 11:14 PM, Julian Elischer wrote: >> >>> On 5/20/14, 1:50 AM, Rui Paulo wrote: >>> >>>> On 18 May 2014, at 18:41, Julian Elischer wrote: >>>> >>>> On 5/19/14, 9:21 AM, Jack F Vogel wrote: >>>>> >>>>>> Author: jfv >>>>>> Date: Mon May 19 01:21:02 2014 >>>>>> New Revision: 266423 >>>>>> URL: http://svnweb.freebsd.org/changeset/base/266423 >>>>>> >>>>>> Log: >>>>>> This is the beta release of the driver for the new >>>>>> Intel 40G Ethernet Controller XL710 Family. This is >>>>>> the core driver, a VF driver called i40evf, will be >>>>>> following soon. Questions or comments to myself or >>>>>> my co-developer Eric Joyner. Cheers! >>>>>> >>>>> love the name.. >>>>> >>>> Aesthetics aside, I think the name should be changed. Network drivers >>>> always used [a-z] for name and [0-9] for unit. Can you find an example >>>> where this is not true? >>>> >>> >>> I just meant the XL (Roman Numeral 40) part.. >>> >> >> sorry to have caused this fuss jsut because I like the use of the common >> "XL" name to (in this case) hint at 40. >> the device name in netstat could be ixlgNNN (intel 40gig) even if the >> device is aimed at the 710 (and later 720 etc..) >> > > Then the correct name is xlN, but unfortunately ;) wpaul already used up > most > of the 2-letter namespace (xl went in 1998). ixl would be OK. > > Bruce > From owner-svn-src-head@FreeBSD.ORG Tue May 20 16:27:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F001772; Tue, 20 May 2014 16:27:06 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA42826B6; Tue, 20 May 2014 16:27:05 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.82 (FreeBSD)) (envelope-from ) id 1WmmsT-0006nv-E4; Tue, 20 May 2014 20:26:57 +0400 Date: Tue, 20 May 2014 20:26:57 +0400 From: Slawa Olhovchenkov To: Adrian Chadd Subject: Re: svn commit: r265792 - head/sys/kern Message-ID: <20140520162657.GG3327@zxy.spb.ru> References: <201405100053.s4A0rbF9080571@svn.freebsd.org> <20140511083114.GA53503@zxy.spb.ru> <20140520154113.GA23318@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 16:27:06 -0000 On Tue, May 20, 2014 at 09:04:25AM -0700, Adrian Chadd wrote: > On 20 May 2014 08:41, Slawa Olhovchenkov wrote: > > >> (But if you try it on 10.0 and it changes things, by all means let me know.) > > > > I am try on 10.0, but not sure about significant improvement (may be > > 10%). > > > > For current CPU (E5-2650 v2 @ 2.60GHz) hwpmc don't working (1. after > > collect some data `pmcstat -R sample.out -G out.txt` don't decode any; > > 2. kldunload hwpmc do kernel crash) and I can't collect detailed > > profile information. > > Yup. I'm starting to get really ticked off at how pmc logging on > multi-core devices just "stops" after a while. I'll talk with other > pmc people and see if we can figure out what the heck is going on. :( pmc work on E5-2620 @ 2.00GHz (NOT E5 _v2_) From owner-svn-src-head@FreeBSD.ORG Tue May 20 16:37:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EC08B9F; Tue, 20 May 2014 16:37:46 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 02D3227D6; Tue, 20 May 2014 16:37:45 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 54EA825D388C; Tue, 20 May 2014 16:37:43 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 6A762C22B99; Tue, 20 May 2014 16:37:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 1YITq8WdSS41; Tue, 20 May 2014 16:37:41 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (unknown [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 80328C22B98; Tue, 20 May 2014 16:37:38 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r265792 - head/sys/kern From: "Bjoern A. Zeeb" In-Reply-To: <20140520162657.GG3327@zxy.spb.ru> Date: Tue, 20 May 2014 16:37:38 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <52888028-FF0D-44A1-9395-788130B83F16@lists.zabbadoz.net> References: <201405100053.s4A0rbF9080571@svn.freebsd.org> <20140511083114.GA53503@zxy.spb.ru> <20140520154113.GA23318@zxy.spb.ru> <20140520162657.GG3327@zxy.spb.ru> To: Slawa Olhovchenkov X-Mailer: Apple Mail (2.1874) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 16:37:46 -0000 On 20 May 2014, at 16:26 , Slawa Olhovchenkov wrote: > On Tue, May 20, 2014 at 09:04:25AM -0700, Adrian Chadd wrote: >=20 >> On 20 May 2014 08:41, Slawa Olhovchenkov wrote: >>=20 >>>> (But if you try it on 10.0 and it changes things, by all means let = me know.) >>>=20 >>> I am try on 10.0, but not sure about significant improvement (may be >>> 10%). >>>=20 >>> For current CPU (E5-2650 v2 @ 2.60GHz) hwpmc don't working (1. after >>> collect some data `pmcstat -R sample.out -G out.txt` don't decode = any; >>> 2. kldunload hwpmc do kernel crash) and I can't collect detailed >>> profile information. >>=20 >> Yup. I'm starting to get really ticked off at how pmc logging on >> multi-core devices just "stops" after a while. I'll talk with other >> pmc people and see if we can figure out what the heck is going on. :( >=20 > pmc work on E5-2620 @ 2.00GHz (NOT E5 _v2_) I am looking into E5-2643 v2 issues on HEAD currently. Just in case this will help anyone. =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@FreeBSD.ORG Tue May 20 17:16:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00D22A16; Tue, 20 May 2014 17:16:19 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 788B02BBB; Tue, 20 May 2014 17:16:18 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s4KHGDE1028743 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 20 May 2014 21:16:13 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s4KHGDhR028742; Tue, 20 May 2014 21:16:13 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 20 May 2014 21:16:13 +0400 From: Gleb Smirnoff To: Bruce Evans Subject: Re: svn commit: r266423 - in head/sys: conf dev/i40e modules/i40e Message-ID: <20140520171613.GM50679@FreeBSD.org> References: <201405190121.s4J1L3qA068339@svn.freebsd.org> <53796149.8060000@freebsd.org> <20140520223516.R2836@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140520223516.R2836@besplex.bde.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Rui Paulo , Jack F Vogel , Julian Elischer X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 17:16:20 -0000 On Tue, May 20, 2014 at 11:40:01PM +1000, Bruce Evans wrote: B> Also, verbose names break formatting. E.g., netstat -r has 5 columns B> available under Netif for the driver name and device number. netstat B> -i has about the same under Name (possibly 1 or 2 not directly under B> Name, but reserved for the Name column). systat has 3 columns B> available, but with a more flexible format that truncates other info. B> All driver name+numbers are broken now on freefall: We must admit that nowadays 80x25 terminal is not enough :( Would be cool if most of tools (netstat, systat, etc...) could determine size of terminal and dynamically widen all their fields. Thus, tool can run w/o any abbreviations when run in a script mode, run abbreviated on a small terminal, and run verbose on a wide terminal. This sounds like a generic library providing a special version of printf(3), which specifies minimal and maximum sizes for fields and when extra terminal width is available it distributes this width evenly between all fields. Name it 'elastic printf'. Sounds like a nice Google SoC project. Or might be that such library already exists. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue May 20 18:16:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72E45C8B; Tue, 20 May 2014 18:16:33 +0000 (UTC) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D92D216D; Tue, 20 May 2014 18:16:33 +0000 (UTC) Received: from hater-dm.corp.yahoo.com (nat-dip4.cfw-a-gci.corp.yahoo.com [209.131.62.113]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) (Authenticated sender: peter) by smtp2.wemm.org (Postfix) with ESMTPSA id 4B8CD44A; Tue, 20 May 2014 11:16:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1400609792; bh=H0BGroW0osNaZO03GrZHHe/QTPwhWMD8GJlhmJEBIPY=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=Z6ARTPNGqfBF4wToQKjo0tYHe2KLYOwHfTQr35MCVeJKP8XlvxOCOH9jro6gu6R7f K1WWBk7/POe1snHcLARRTN+dqKrSJ87bGBB2vmEgcabvHaUFW4ABklF+wlxJUvqCB/ sxevgWynjvTlHQQ4x2THYhJAH9AMMtF0Zjf9Vl+g= Message-ID: <537B9BFE.4010304@wemm.org> Date: Tue, 20 May 2014 11:16:30 -0700 From: Peter Wemm User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Jack Vogel , Bruce Evans Subject: Re: svn commit: r266423 - in head/sys: conf dev/i40e modules/i40e References: <201405190121.s4J1L3qA068339@svn.freebsd.org> <53796149.8060000@freebsd.org> <537B714A.5080500@freebsd.org> <537B726C.1080000@freebsd.org> <20140521014355.V3433@besplex.bde.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Rui Paulo , Jack F Vogel , Julian Elischer X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 18:16:33 -0000 On 5/20/14, 9:08 AM, Jack Vogel wrote: > If you don't like the name there's this wonderful feature of ifconfig > > ifconfig i40e0 name eth0 (or whatever pleases you...) > > Oh and Bruce, I did run into the string length issue, so with this driver > the queues > are all named 'q%d', I might go back and change the earlier drivers. > > I found the 'too long' strings caused some really weird behavior with > vmstat once > you had 32 queues, btw. > > Jack > > > > On Tue, May 20, 2014 at 8:49 AM, Bruce Evans > wrote: > > On Tue, 20 May 2014, Julian Elischer wrote: > > On 5/20/14, 11:14 PM, Julian Elischer wrote: > > On 5/20/14, 1:50 AM, Rui Paulo wrote: > > On 18 May 2014, at 18:41, Julian Elischer > > wrote: > > On 5/19/14, 9:21 AM, Jack F Vogel wrote: > > Author: jfv > Date: Mon May 19 01:21:02 2014 > New Revision: 266423 > URL: http://svnweb.freebsd.org/changeset/base/266423 > > Log: > This is the beta release of the driver for the new > Intel 40G Ethernet Controller XL710 Family. > This is > the core driver, a VF driver called i40evf, > will be > following soon. Questions or comments to myself or > my co-developer Eric Joyner. Cheers! > > love the name.. > > Aesthetics aside, I think the name should be changed. > Network drivers always used [a-z] for name and [0-9] for > unit. Can you find an example where this is not true? > > > I just meant the XL (Roman Numeral 40) part.. > > > sorry to have caused this fuss jsut because I like the use of the > common "XL" name to (in this case) hint at 40. > the device name in netstat could be ixlgNNN (intel 40gig) even > if the device is aimed at the 710 (and later 720 etc..) > > > Then the correct name is xlN, but unfortunately ;) wpaul already used > up most > of the 2-letter namespace (xl went in 1998). ixl would be OK. > > Bruce > > I'm pretty sure the original naming would have caused drama at work with their monitoring system - I seem to recall that they "know" that interface names are alpha chars followed by an interface instance number. I suspect that that might exclude I would much rather see something like ixlN -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV From owner-svn-src-head@FreeBSD.ORG Tue May 20 18:25:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA2FC1F5; Tue, 20 May 2014 18:25:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E4CE2269; Tue, 20 May 2014 18:25:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4KIPkNa015750; Tue, 20 May 2014 18:25:46 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4KIPkhh015749; Tue, 20 May 2014 18:25:46 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201405201825.s4KIPkhh015749@svn.freebsd.org> From: "Simon J. Gerraty" Date: Tue, 20 May 2014 18:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266473 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 18:25:46 -0000 Author: sjg Date: Tue May 20 18:25:46 2014 New Revision: 266473 URL: http://svnweb.freebsd.org/changeset/base/266473 Log: Use an intermediate target to associate with _SUBDIR which is marked .MAKE this allows make -n to do tree walks as expected without doing anything else (as intended). Use prefix _sub. to help avoid conflict with any real target. Reviewed by: imp Modified: head/share/mk/bsd.subdir.mk Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Tue May 20 15:53:17 2014 (r266472) +++ head/share/mk/bsd.subdir.mk Tue May 20 18:25:46 2014 (r266473) @@ -47,15 +47,15 @@ _SUBDIR: .USE .MAKE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) @${_+_}set -e; for entry in ${SUBDIR:N.WAIT}; do \ if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \ - ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE_ARCH} (${.TARGET:realinstall=install})"; \ + ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE_ARCH} (${.TARGET:S,realinstall,install,:S,^_sub.,,})"; \ edir=$${entry}.${MACHINE_ARCH}; \ cd ${.CURDIR}/$${edir}; \ else \ - ${ECHODIR} "===> ${DIRPRFX}$$entry (${.TARGET:realinstall=install})"; \ + ${ECHODIR} "===> ${DIRPRFX}$$entry (${.TARGET:S,realinstall,install,:S,^_sub.,,})"; \ edir=$${entry}; \ cd ${.CURDIR}/$${edir}; \ fi; \ - ${MAKE} ${.TARGET:realinstall=install} \ + ${MAKE} ${.TARGET:S,realinstall,install,:S,^_sub.,,} \ DIRPRFX=${DIRPRFX}$$edir/; \ done .endif @@ -97,7 +97,8 @@ ${__target}_subdir_${__dir}: .MAKE .endfor ${__target}: ${__subdir_targets} .else -${__target}: _SUBDIR +${__target}: _sub.${__target} +_sub.${__target}: _SUBDIR .endif .endfor @@ -105,11 +106,14 @@ ${__target}: _SUBDIR .for __stage in build install ${__stage}${__target}: .if make(${__stage}${__target}) -${__stage}${__target}: _SUBDIR +${__stage}${__target}: _sub.${__stage}${__target} +_sub.${__stage}${__target}: _SUBDIR .endif .endfor +.if !target(${__target}) ${__target}: .MAKE ${_+_}set -e; cd ${.CURDIR}; ${MAKE} build${__target}; ${MAKE} install${__target} +.endif .endfor .if !target(install) From owner-svn-src-head@FreeBSD.ORG Tue May 20 19:55:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 996C6418; Tue, 20 May 2014 19:55:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 836D22B34; Tue, 20 May 2014 19:55:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4KJt8u7056988; Tue, 20 May 2014 19:55:08 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4KJt7A1056980; Tue, 20 May 2014 19:55:07 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201405201955.s4KJt7A1056980@svn.freebsd.org> From: Jim Harris Date: Tue, 20 May 2014 19:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266474 - in head: share/man/man4 sys/conf sys/dev/ismt sys/modules/i2c/controllers sys/modules/i2c/controllers/ismt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 19:55:08 -0000 Author: jimharris Date: Tue May 20 19:55:06 2014 New Revision: 266474 URL: http://svnweb.freebsd.org/changeset/base/266474 Log: Add ismt(4) driver. ismt(4) supports the SMBus Message Transport controller found on Intel C2000 series (Avoton) and S1200 series (Briarwood) Atom SoCs. Sponsored by: Intel Added: head/share/man/man4/ismt.4 (contents, props changed) head/sys/dev/ismt/ head/sys/dev/ismt/ismt.c (contents, props changed) head/sys/modules/i2c/controllers/ismt/ head/sys/modules/i2c/controllers/ismt/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/modules/i2c/controllers/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue May 20 18:25:46 2014 (r266473) +++ head/share/man/man4/Makefile Tue May 20 19:55:06 2014 (r266474) @@ -207,6 +207,7 @@ MAN= aac.4 \ ipwfw.4 \ isci.4 \ iscsi_initiator.4 \ + ismt.4 \ isp.4 \ ispfw.4 \ iwi.4 \ Added: head/share/man/man4/ismt.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/ismt.4 Tue May 20 19:55:06 2014 (r266474) @@ -0,0 +1,59 @@ +.\" +.\" Copyright (c) 2014 Intel Corporation +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions, and the following disclaimer, +.\" without modification. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of Intel Corporation nor the names of its +.\" contributors may be used to endorse or promote products derived from +.\" this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR +.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGES. +.\" +.\" ismt driver man page. +.\" +.\" Author: Jim Harris +.\" +.\" $FreeBSD$ +.\" +.Dd May 9, 2014 +.Dt ISMT 4 +.Os +.Sh NAME +.Nm ismt +.Nd Intel SMBus Message Transport (SMBus 2.0) driver +.Sh SYNOPSIS +.Cd device pci +.Cd device smbus +.Cd device smb +.Cd device ismt +.Sh DESCRIPTION +This driver provides access to the SMBus 2.0 controller device contained +in the Intel Atom S1200 and C2000 CPUs. +.Sh SEE ALSO +.Xr smb 4 , +.Xr smbus 4 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 11.0 . +.Sh AUTHORS +.An Jim Harris Aq jimharris@FreeBSD.org Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue May 20 18:25:46 2014 (r266473) +++ head/sys/conf/NOTES Tue May 20 19:55:06 2014 (r266474) @@ -2467,6 +2467,7 @@ device sdhci # amdsmb AMD 8111 SMBus 2.0 Controller # nfpm NVIDIA nForce Power Management Unit # nfsmb NVIDIA nForce2/3/4 MCP SMBus 2.0 Controller +# ismt Intel SMBus 2.0 controller chips (on Atom S1200, C2000) # device smbus # Bus support, required for smb below. @@ -2478,6 +2479,7 @@ device amdpm device amdsmb device nfpm device nfsmb +device ismt device smb Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue May 20 18:25:46 2014 (r266473) +++ head/sys/conf/files Tue May 20 19:55:06 2014 (r266474) @@ -1525,6 +1525,7 @@ dev/iscsi_initiator/isc_cam.c optional i dev/iscsi_initiator/isc_soc.c optional iscsi_initiator scbus dev/iscsi_initiator/isc_sm.c optional iscsi_initiator scbus dev/iscsi_initiator/isc_subr.c optional iscsi_initiator scbus +dev/ismt/ismt.c optional ismt dev/isp/isp.c optional isp dev/isp/isp_freebsd.c optional isp dev/isp/isp_library.c optional isp Added: head/sys/dev/ismt/ismt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ismt/ismt.c Tue May 20 19:55:06 2014 (r266474) @@ -0,0 +1,778 @@ +/*- + * Copyright (C) 2014 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include "smbus_if.h" + +#define ISMT_DESC_ENTRIES 32 + +/* Hardware Descriptor Constants - Control Field */ +#define ISMT_DESC_CWRL 0x01 /* Command/Write Length */ +#define ISMT_DESC_BLK 0X04 /* Perform Block Transaction */ +#define ISMT_DESC_FAIR 0x08 /* Set fairness flag upon successful arbit. */ +#define ISMT_DESC_PEC 0x10 /* Packet Error Code */ +#define ISMT_DESC_I2C 0x20 /* I2C Enable */ +#define ISMT_DESC_INT 0x40 /* Interrupt */ +#define ISMT_DESC_SOE 0x80 /* Stop On Error */ + +/* Hardware Descriptor Constants - Status Field */ +#define ISMT_DESC_SCS 0x01 /* Success */ +#define ISMT_DESC_DLTO 0x04 /* Data Low Time Out */ +#define ISMT_DESC_NAK 0x08 /* NAK Received */ +#define ISMT_DESC_CRC 0x10 /* CRC Error */ +#define ISMT_DESC_CLTO 0x20 /* Clock Low Time Out */ +#define ISMT_DESC_COL 0x40 /* Collisions */ +#define ISMT_DESC_LPR 0x80 /* Large Packet Received */ + +/* Macros */ +#define ISMT_DESC_ADDR_RW(addr, is_read) ((addr) | (is_read)) + +/* iSMT General Register address offsets (SMBBAR + ) */ +#define ISMT_GR_GCTRL 0x000 /* General Control */ +#define ISMT_GR_SMTICL 0x008 /* SMT Interrupt Cause Location */ +#define ISMT_GR_ERRINTMSK 0x010 /* Error Interrupt Mask */ +#define ISMT_GR_ERRAERMSK 0x014 /* Error AER Mask */ +#define ISMT_GR_ERRSTS 0x018 /* Error Status */ +#define ISMT_GR_ERRINFO 0x01c /* Error Information */ + +/* iSMT Master Registers */ +#define ISMT_MSTR_MDBA 0x100 /* Master Descriptor Base Address */ +#define ISMT_MSTR_MCTRL 0x108 /* Master Control */ +#define ISMT_MSTR_MSTS 0x10c /* Master Status */ +#define ISMT_MSTR_MDS 0x110 /* Master Descriptor Size */ +#define ISMT_MSTR_RPOLICY 0x114 /* Retry Policy */ + +/* iSMT Miscellaneous Registers */ +#define ISMT_SPGT 0x300 /* SMBus PHY Global Timing */ + +/* General Control Register (GCTRL) bit definitions */ +#define ISMT_GCTRL_TRST 0x04 /* Target Reset */ +#define ISMT_GCTRL_KILL 0x08 /* Kill */ +#define ISMT_GCTRL_SRST 0x40 /* Soft Reset */ + +/* Master Control Register (MCTRL) bit definitions */ +#define ISMT_MCTRL_SS 0x01 /* Start/Stop */ +#define ISMT_MCTRL_MEIE 0x10 /* Master Error Interrupt Enable */ +#define ISMT_MCTRL_FMHP 0x00ff0000 /* Firmware Master Head Ptr (FMHP) */ + +/* Master Status Register (MSTS) bit definitions */ +#define ISMT_MSTS_HMTP 0xff0000 /* HW Master Tail Pointer (HMTP) */ +#define ISMT_MSTS_MIS 0x20 /* Master Interrupt Status (MIS) */ +#define ISMT_MSTS_MEIS 0x10 /* Master Error Int Status (MEIS) */ +#define ISMT_MSTS_IP 0x01 /* In Progress */ + +/* Master Descriptor Size (MDS) bit definitions */ +#define ISMT_MDS_MASK 0xff /* Master Descriptor Size mask (MDS) */ + +/* SMBus PHY Global Timing Register (SPGT) bit definitions */ +#define ISMT_SPGT_SPD_MASK 0xc0000000 /* SMBus Speed mask */ +#define ISMT_SPGT_SPD_80K 0x00 /* 80 kHz */ +#define ISMT_SPGT_SPD_100K (0x1 << 30) /* 100 kHz */ +#define ISMT_SPGT_SPD_400K (0x2 << 30) /* 400 kHz */ +#define ISMT_SPGT_SPD_1M (0x3 << 30) /* 1 MHz */ + +/* MSI Control Register (MSICTL) bit definitions */ +#define ISMT_MSICTL_MSIE 0x01 /* MSI Enable */ + +#define ISMT_MAX_BLOCK_SIZE 32 /* per SMBus spec */ + +//#define ISMT_DEBUG device_printf +#ifndef ISMT_DEBUG +#define ISMT_DEBUG(...) +#endif + +/* iSMT Hardware Descriptor */ +struct ismt_desc { + uint8_t tgtaddr_rw; /* target address & r/w bit */ + uint8_t wr_len_cmd; /* write length in bytes or a command */ + uint8_t rd_len; /* read length */ + uint8_t control; /* control bits */ + uint8_t status; /* status bits */ + uint8_t retry; /* collision retry and retry count */ + uint8_t rxbytes; /* received bytes */ + uint8_t txbytes; /* transmitted bytes */ + uint32_t dptr_low; /* lower 32 bit of the data pointer */ + uint32_t dptr_high; /* upper 32 bit of the data pointer */ +} __packed; + +#define DESC_SIZE (ISMT_DESC_ENTRIES * sizeof(struct ismt_desc)) + +#define DMA_BUFFER_SIZE 64 + +struct ismt_softc { + device_t pcidev; + device_t smbdev; + + struct thread *bus_reserved; + + int intr_rid; + struct resource *intr_res; + void *intr_handle; + + bus_space_tag_t mmio_tag; + bus_space_handle_t mmio_handle; + int mmio_rid; + struct resource *mmio_res; + + uint8_t head; + + struct ismt_desc *desc; + bus_dma_tag_t desc_dma_tag; + bus_dmamap_t desc_dma_map; + uint64_t desc_bus_addr; + + uint8_t *dma_buffer; + bus_dma_tag_t dma_buffer_dma_tag; + bus_dmamap_t dma_buffer_dma_map; + uint64_t dma_buffer_bus_addr; + + uint8_t using_msi; +}; + +static void +ismt_intr(void *arg) +{ + struct ismt_softc *sc = arg; + uint32_t val; + + val = bus_read_4(sc->mmio_res, ISMT_MSTR_MSTS); + ISMT_DEBUG(sc->pcidev, "%s MSTS=0x%x\n", __func__, val); + + val |= (ISMT_MSTS_MIS | ISMT_MSTS_MEIS); + bus_write_4(sc->mmio_res, ISMT_MSTR_MSTS, val); + + wakeup(sc); +} + +static int +ismt_callback(device_t dev, int index, void *data) +{ + struct ismt_softc *sc; + int acquired, err; + + sc = device_get_softc(dev); + + switch (index) { + case SMB_REQUEST_BUS: + acquired = atomic_cmpset_ptr( + (uintptr_t *)&sc->bus_reserved, + (uintptr_t)NULL, (uintptr_t)curthread); + ISMT_DEBUG(dev, "SMB_REQUEST_BUS acquired=%d\n", acquired); + if (acquired) + err = 0; + else + err = EWOULDBLOCK; + break; + case SMB_RELEASE_BUS: + KASSERT(sc->bus_reserved == curthread, + ("SMB_RELEASE_BUS called by wrong thread\n")); + ISMT_DEBUG(dev, "SMB_RELEASE_BUS\n"); + atomic_store_rel_ptr((uintptr_t *)&sc->bus_reserved, + (uintptr_t)NULL); + err = 0; + break; + default: + err = SMB_EABORT; + break; + } + + return (err); +} + +static struct ismt_desc * +ismt_alloc_desc(struct ismt_softc *sc) +{ + struct ismt_desc *desc; + + KASSERT(sc->bus_reserved == curthread, + ("curthread %p did not request bus (%p has reserved)\n", + curthread, sc->bus_reserved)); + + desc = &sc->desc[sc->head++]; + if (sc->head == ISMT_DESC_ENTRIES) + sc->head = 0; + + memset(desc, 0, sizeof(*desc)); + + return (desc); +} + +static int +ismt_submit(struct ismt_softc *sc, struct ismt_desc *desc, uint8_t slave, + uint8_t is_read) +{ + uint32_t err, fmhp, val; + + desc->control |= ISMT_DESC_FAIR; + if (sc->using_msi) + desc->control |= ISMT_DESC_INT; + + desc->tgtaddr_rw = ISMT_DESC_ADDR_RW(slave, is_read); + desc->dptr_low = (sc->dma_buffer_bus_addr & 0xFFFFFFFFLL); + desc->dptr_high = (sc->dma_buffer_bus_addr >> 32); + + wmb(); + + fmhp = sc->head << 16; + val = bus_read_4(sc->mmio_res, ISMT_MSTR_MCTRL); + val &= ~ISMT_MCTRL_FMHP; + val |= fmhp; + bus_write_4(sc->mmio_res, ISMT_MSTR_MCTRL, val); + + /* set the start bit */ + val = bus_read_4(sc->mmio_res, ISMT_MSTR_MCTRL); + val |= ISMT_MCTRL_SS; + bus_write_4(sc->mmio_res, ISMT_MSTR_MCTRL, val); + + err = tsleep(sc, PWAIT, "ismt_wait", 5 * hz); + + if (err != 0) { + ISMT_DEBUG(sc->pcidev, "%s timeout\n", __func__); + return (SMB_ETIMEOUT); + } + + ISMT_DEBUG(sc->pcidev, "%s status=0x%x\n", __func__, desc->status); + + if (desc->status & ISMT_DESC_SCS) + return (SMB_ENOERR); + + if (desc->status & ISMT_DESC_NAK) + return (SMB_ENOACK); + + if (desc->status & ISMT_DESC_CRC) + return (SMB_EBUSERR); + + if (desc->status & ISMT_DESC_COL) + return (SMB_ECOLLI); + + if (desc->status & ISMT_DESC_LPR) + return (SMB_EINVAL); + + if (desc->status & (ISMT_DESC_DLTO | ISMT_DESC_CLTO)) + return (SMB_ETIMEOUT); + + return (SMB_EBUSERR); +} + + +static int +ismt_quick(device_t dev, u_char slave, int how) +{ + struct ismt_desc *desc; + struct ismt_softc *sc; + int is_read; + + ISMT_DEBUG(dev, "%s\n", __func__); + + if (how != SMB_QREAD && how != SMB_QWRITE) { + return (SMB_ENOTSUPP); + } + + sc = device_get_softc(dev); + desc = ismt_alloc_desc(sc); + is_read = (how == SMB_QREAD ? 1 : 0); + return (ismt_submit(sc, desc, slave, is_read)); +} + +static int +ismt_sendb(device_t dev, u_char slave, char byte) +{ + struct ismt_desc *desc; + struct ismt_softc *sc; + + ISMT_DEBUG(dev, "%s\n", __func__); + + sc = device_get_softc(dev); + desc = ismt_alloc_desc(sc); + desc->control = ISMT_DESC_CWRL; + desc->wr_len_cmd = byte; + + return (ismt_submit(sc, desc, slave, 0)); +} + +static int +ismt_recvb(device_t dev, u_char slave, char *byte) +{ + struct ismt_desc *desc; + struct ismt_softc *sc; + int err; + + ISMT_DEBUG(dev, "%s\n", __func__); + + sc = device_get_softc(dev); + desc = ismt_alloc_desc(sc); + desc->rd_len = 1; + + err = ismt_submit(sc, desc, slave, 1); + + if (err != SMB_ENOERR) + return (err); + + *byte = sc->dma_buffer[0]; + + return (err); +} + +static int +ismt_writeb(device_t dev, u_char slave, char cmd, char byte) +{ + struct ismt_desc *desc; + struct ismt_softc *sc; + + ISMT_DEBUG(dev, "%s\n", __func__); + + sc = device_get_softc(dev); + desc = ismt_alloc_desc(sc); + desc->wr_len_cmd = 2; + sc->dma_buffer[0] = cmd; + sc->dma_buffer[1] = byte; + + return (ismt_submit(sc, desc, slave, 0)); +} + +static int +ismt_writew(device_t dev, u_char slave, char cmd, short word) +{ + struct ismt_desc *desc; + struct ismt_softc *sc; + + ISMT_DEBUG(dev, "%s\n", __func__); + + sc = device_get_softc(dev); + desc = ismt_alloc_desc(sc); + desc->wr_len_cmd = 3; + sc->dma_buffer[0] = cmd; + sc->dma_buffer[1] = word & 0xFF; + sc->dma_buffer[2] = word >> 8; + + return (ismt_submit(sc, desc, slave, 0)); +} + +static int +ismt_readb(device_t dev, u_char slave, char cmd, char *byte) +{ + struct ismt_desc *desc; + struct ismt_softc *sc; + int err; + + ISMT_DEBUG(dev, "%s\n", __func__); + + sc = device_get_softc(dev); + desc = ismt_alloc_desc(sc); + desc->control = ISMT_DESC_CWRL; + desc->wr_len_cmd = cmd; + desc->rd_len = 1; + + err = ismt_submit(sc, desc, slave, 1); + + if (err != SMB_ENOERR) + return (err); + + *byte = sc->dma_buffer[0]; + + return (err); +} + +static int +ismt_readw(device_t dev, u_char slave, char cmd, short *word) +{ + struct ismt_desc *desc; + struct ismt_softc *sc; + int err; + + ISMT_DEBUG(dev, "%s\n", __func__); + + sc = device_get_softc(dev); + desc = ismt_alloc_desc(sc); + desc->control = ISMT_DESC_CWRL; + desc->wr_len_cmd = cmd; + desc->rd_len = 2; + + err = ismt_submit(sc, desc, slave, 1); + + if (err != SMB_ENOERR) + return (err); + + *word = sc->dma_buffer[0] | (sc->dma_buffer[1] << 8); + + return (err); +} + +static int +ismt_pcall(device_t dev, u_char slave, char cmd, short sdata, short *rdata) +{ + struct ismt_desc *desc; + struct ismt_softc *sc; + int err; + + ISMT_DEBUG(dev, "%s\n", __func__); + + sc = device_get_softc(dev); + desc = ismt_alloc_desc(sc); + desc->wr_len_cmd = 3; + desc->rd_len = 2; + sc->dma_buffer[0] = cmd; + sc->dma_buffer[1] = sdata & 0xff; + sc->dma_buffer[2] = sdata >> 8; + + err = ismt_submit(sc, desc, slave, 0); + + if (err != SMB_ENOERR) + return (err); + + *rdata = sc->dma_buffer[0] | (sc->dma_buffer[1] << 8); + + return (err); +} + +static int +ismt_bwrite(device_t dev, u_char slave, char cmd, u_char count, char *buf) +{ + struct ismt_desc *desc; + struct ismt_softc *sc; + + ISMT_DEBUG(dev, "%s\n", __func__); + + if (count == 0 || count > ISMT_MAX_BLOCK_SIZE) + return (SMB_EINVAL); + + sc = device_get_softc(dev); + desc = ismt_alloc_desc(sc); + desc->control = ISMT_DESC_I2C; + desc->wr_len_cmd = count + 1; + sc->dma_buffer[0] = cmd; + memcpy(&sc->dma_buffer[1], buf, count); + + return (ismt_submit(sc, desc, slave, 0)); +} + +static int +ismt_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf) +{ + struct ismt_desc *desc; + struct ismt_softc *sc; + int err; + + ISMT_DEBUG(dev, "%s\n", __func__); + + if (*count == 0 || *count > ISMT_MAX_BLOCK_SIZE) + return (SMB_EINVAL); + + sc = device_get_softc(dev); + desc = ismt_alloc_desc(sc); + desc->control = ISMT_DESC_I2C | ISMT_DESC_CWRL; + desc->wr_len_cmd = cmd; + desc->rd_len = *count; + + err = ismt_submit(sc, desc, slave, 0); + + if (err != SMB_ENOERR) + return (err); + + memcpy(buf, sc->dma_buffer, desc->rxbytes); + *count = desc->rxbytes; + + return (err); +} + +static int +ismt_detach(device_t dev) +{ + struct ismt_softc *sc; + int error; + + ISMT_DEBUG(dev, "%s\n", __func__); + sc = device_get_softc(dev); + + error = bus_generic_detach(dev); + if (error) + return (error); + + device_delete_child(dev, sc->smbdev); + + if (sc->intr_handle != NULL) { + bus_teardown_intr(dev, sc->intr_res, sc->intr_handle); + sc->intr_handle = NULL; + } + if (sc->intr_res != NULL) { + bus_release_resource(dev, + SYS_RES_IRQ, sc->intr_rid, sc->intr_res); + sc->intr_res = NULL; + } + if (sc->using_msi == 1) + pci_release_msi(dev); + + if (sc->mmio_res != NULL) { + bus_release_resource(dev, + SYS_RES_MEMORY, sc->mmio_rid, sc->mmio_res); + sc->mmio_res = NULL; + } + + bus_dmamap_unload(sc->desc_dma_tag, sc->desc_dma_map); + bus_dmamap_unload(sc->dma_buffer_dma_tag, sc->dma_buffer_dma_map); + + bus_dmamem_free(sc->desc_dma_tag, sc->desc, + sc->desc_dma_map); + bus_dmamem_free(sc->dma_buffer_dma_tag, sc->dma_buffer, + sc->dma_buffer_dma_map); + + bus_dma_tag_destroy(sc->desc_dma_tag); + bus_dma_tag_destroy(sc->dma_buffer_dma_tag); + + pci_disable_busmaster(dev); + + return 0; +} + +static void +ismt_single_map(void *arg, bus_dma_segment_t *seg, int nseg, int error) +{ + uint64_t *bus_addr = (uint64_t *)arg; + + KASSERT(error == 0, ("%s: error=%d\n", __func__, error)); + KASSERT(nseg == 1, ("%s: nseg=%d\n", __func__, nseg)); + + *bus_addr = seg[0].ds_addr; +} + +static int +ismt_attach(device_t dev) +{ + struct ismt_softc *sc = device_get_softc(dev); + int err, num_vectors, val; + + sc->pcidev = dev; + pci_enable_busmaster(dev); + + if ((sc->smbdev = device_add_child(dev, "smbus", -1)) == NULL) { + device_printf(dev, "no smbus child found\n"); + err = ENXIO; + goto fail; + } + + sc->mmio_rid = PCIR_BAR(0); + sc->mmio_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->mmio_rid, RF_ACTIVE); + if (sc->mmio_res == NULL) { + device_printf(dev, "cannot allocate mmio region\n"); + err = ENOMEM; + goto fail; + } + + sc->mmio_tag = rman_get_bustag(sc->mmio_res); + sc->mmio_handle = rman_get_bushandle(sc->mmio_res); + + /* Attach "smbus" child */ + if ((err = bus_generic_attach(dev)) != 0) { + device_printf(dev, "failed to attach child: %d\n", err); + err = ENXIO; + goto fail; + } + + bus_dma_tag_create(bus_get_dma_tag(dev), 4, PAGE_SIZE, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + DESC_SIZE, 1, DESC_SIZE, + 0, NULL, NULL, &sc->desc_dma_tag); + + bus_dma_tag_create(bus_get_dma_tag(dev), 4, PAGE_SIZE, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + DMA_BUFFER_SIZE, 1, DMA_BUFFER_SIZE, + 0, NULL, NULL, &sc->dma_buffer_dma_tag); + + bus_dmamap_create(sc->desc_dma_tag, 0, + &sc->desc_dma_map); + bus_dmamap_create(sc->dma_buffer_dma_tag, 0, + &sc->dma_buffer_dma_map); + + bus_dmamem_alloc(sc->desc_dma_tag, + (void **)&sc->desc, BUS_DMA_WAITOK, + &sc->desc_dma_map); + bus_dmamem_alloc(sc->dma_buffer_dma_tag, + (void **)&sc->dma_buffer, BUS_DMA_WAITOK, + &sc->dma_buffer_dma_map); + + bus_dmamap_load(sc->desc_dma_tag, + sc->desc_dma_map, sc->desc, DESC_SIZE, + ismt_single_map, &sc->desc_bus_addr, 0); + bus_dmamap_load(sc->dma_buffer_dma_tag, + sc->dma_buffer_dma_map, sc->dma_buffer, DMA_BUFFER_SIZE, + ismt_single_map, &sc->dma_buffer_bus_addr, 0); + + bus_write_4(sc->mmio_res, ISMT_MSTR_MDBA, + (sc->desc_bus_addr & 0xFFFFFFFFLL)); + bus_write_4(sc->mmio_res, ISMT_MSTR_MDBA + 4, + (sc->desc_bus_addr >> 32)); + + /* initialize the Master Control Register (MCTRL) */ + bus_write_4(sc->mmio_res, ISMT_MSTR_MCTRL, ISMT_MCTRL_MEIE); + + /* initialize the Master Status Register (MSTS) */ + bus_write_4(sc->mmio_res, ISMT_MSTR_MSTS, 0); + + /* initialize the Master Descriptor Size (MDS) */ + val = bus_read_4(sc->mmio_res, ISMT_MSTR_MDS); + val &= ~ISMT_MDS_MASK; + val |= (ISMT_DESC_ENTRIES - 1); + bus_write_4(sc->mmio_res, ISMT_MSTR_MDS, val); + + sc->using_msi = 1; + + if (pci_msi_count(dev) == 0) { + sc->using_msi = 0; + goto intx; + } + + num_vectors = 1; + if (pci_alloc_msi(dev, &num_vectors) != 0) { + sc->using_msi = 0; + goto intx; + } + + sc->intr_rid = 1; + sc->intr_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->intr_rid, RF_ACTIVE); + + if (sc->intr_res == NULL) { + sc->using_msi = 0; + pci_release_msi(dev); + } + +intx: + if (sc->using_msi == 0) { + sc->intr_rid = 0; + sc->intr_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->intr_rid, RF_SHAREABLE | RF_ACTIVE); + if (sc->intr_res == NULL) { + device_printf(dev, "cannot allocate irq\n"); + err = ENXIO; + goto fail; + } + } + + ISMT_DEBUG(dev, "using_msi = %d\n", sc->using_msi); + + err = bus_setup_intr(dev, sc->intr_res, + INTR_TYPE_MISC | INTR_MPSAFE, NULL, ismt_intr, sc, + &sc->intr_handle); + if (err != 0) { + device_printf(dev, "cannot setup interrupt\n"); + err = ENXIO; + goto fail; + } + + return (0); + +fail: + ismt_detach(dev); + return (err); +} + +#define ID_INTEL_S1200_SMT0 0x0c598086 +#define ID_INTEL_S1200_SMT1 0x0c5a8086 +#define ID_INTEL_C2000_SMT 0x1f158086 + +static int +ismt_probe(device_t dev) +{ + const char *desc; + + switch (pci_get_devid(dev)) { + case ID_INTEL_S1200_SMT0: + desc = "Atom Processor S1200 SMBus 2.0 Controller 0"; + break; + case ID_INTEL_S1200_SMT1: + desc = "Atom Processor S1200 SMBus 2.0 Controller 1"; + break; + case ID_INTEL_C2000_SMT: + desc = "Atom Processor C2000 SMBus 2.0"; + break; + default: + return (ENXIO); + } + + device_set_desc(dev, desc); + return (BUS_PROBE_DEFAULT); +} + +/* Device methods */ +static device_method_t ismt_pci_methods[] = { + DEVMETHOD(device_probe, ismt_probe), + DEVMETHOD(device_attach, ismt_attach), + DEVMETHOD(device_detach, ismt_detach), + + DEVMETHOD(smbus_callback, ismt_callback), + DEVMETHOD(smbus_quick, ismt_quick), + DEVMETHOD(smbus_sendb, ismt_sendb), + DEVMETHOD(smbus_recvb, ismt_recvb), + DEVMETHOD(smbus_writeb, ismt_writeb), + DEVMETHOD(smbus_writew, ismt_writew), + DEVMETHOD(smbus_readb, ismt_readb), + DEVMETHOD(smbus_readw, ismt_readw), + DEVMETHOD(smbus_pcall, ismt_pcall), + DEVMETHOD(smbus_bwrite, ismt_bwrite), + DEVMETHOD(smbus_bread, ismt_bread), + + DEVMETHOD_END +}; + +static driver_t ismt_pci_driver = { + "ismt", + ismt_pci_methods, + sizeof(struct ismt_softc) +}; + +static devclass_t ismt_pci_devclass; + +DRIVER_MODULE(ismt, pci, ismt_pci_driver, ismt_pci_devclass, 0, 0); +DRIVER_MODULE(smbus, ismt, smbus_driver, smbus_devclass, 0, 0); + +MODULE_DEPEND(ismt, pci, 1, 1, 1); +MODULE_DEPEND(ismt, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER); +MODULE_VERSION(ismt, 1); Modified: head/sys/modules/i2c/controllers/Makefile ============================================================================== --- head/sys/modules/i2c/controllers/Makefile Tue May 20 18:25:46 2014 (r266473) +++ head/sys/modules/i2c/controllers/Makefile Tue May 20 19:55:06 2014 (r266474) @@ -3,7 +3,7 @@ .if ${MACHINE} == "pc98" SUBDIR = lpbb .else -SUBDIR = alpm amdpm amdsmb ichsmb intpm nfsmb viapm lpbb pcf +SUBDIR = alpm amdpm amdsmb ichsmb intpm ismt nfsmb viapm lpbb pcf .endif .include Added: head/sys/modules/i2c/controllers/ismt/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/i2c/controllers/ismt/Makefile Tue May 20 19:55:06 2014 (r266474) @@ -0,0 +1,8 @@ +#$FreeBSD$ + +.PATH: ${.CURDIR}/../../../../dev/ismt +KMOD = ismt +SRCS = device_if.h bus_if.h iicbb_if.h pci_if.h smbus_if.h \ + ismt.c + +.include From owner-svn-src-head@FreeBSD.ORG Tue May 20 19:55:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF166570; Tue, 20 May 2014 19:55:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC5D02B3D; Tue, 20 May 2014 19:55:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4KJtxIB057112; Tue, 20 May 2014 19:55:59 GMT (envelope-from rea@svn.freebsd.org) Received: (from rea@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4KJtx65057111; Tue, 20 May 2014 19:55:59 GMT (envelope-from rea@svn.freebsd.org) Message-Id: <201405201955.s4KJtx65057111@svn.freebsd.org> From: Eygene Ryabinkin Date: Tue, 20 May 2014 19:55:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266475 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 19:56:00 -0000 Author: rea (ports committer) Date: Tue May 20 19:55:59 2014 New Revision: 266475 URL: http://svnweb.freebsd.org/changeset/base/266475 Log: Fix warning messages after r252015 $alias used to hold alias number, but now it carries full variable name, so messages were tuned to account for that. Other fixes: - eliminate unneeded double spaces; - tell user where inet/inet6 keywords are expected to be. Reviewed by: hrs MFC after: 1 week Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Tue May 20 19:55:06 2014 (r266474) +++ head/etc/network.subr Tue May 20 19:55:59 2014 (r266475) @@ -184,7 +184,7 @@ ifconfig_up() # backward compatibility: inet6 keyword case "${ifconfig_args}" in :*|[0-9a-fA-F]*:*) - warn "\$ifconfig_$1_ipv6 needs " \ + warn "\$ifconfig_$1_ipv6 needs leading" \ "\"inet6\" keyword for an IPv6 address." ifconfig_args="inet6 ${ifconfig_args}" ;; @@ -1110,7 +1110,7 @@ ifalias_af_common() ;; inet:alias:"":*) _aliasn="$_aliasn inet $ifconfig_args" - warn "\$ifconfig_${_if}_alias${alias} needs " \ + warn "\$${alias} needs leading" \ "\"inet\" keyword for an IPv4 address." esac done @@ -1128,9 +1128,8 @@ ifalias_af_common() ;; alias:*) _aliasn="${_aliasn} inet6 ${ifconfig_args}" - warn "\$ipv6_ifconfig_${_if}_alias${alias} " \ - "is obsolete. Use ifconfig_$1_aliasN " \ - "instead." + warn "\$${alias} is obsolete. " \ + "Use ifconfig_$1_aliasN instead." ;; esac done From owner-svn-src-head@FreeBSD.ORG Tue May 20 20:30:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8FC39DF; Tue, 20 May 2014 20:30:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88F172F53; Tue, 20 May 2014 20:30:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4KKUShB073741; Tue, 20 May 2014 20:30:28 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4KKUSw5073740; Tue, 20 May 2014 20:30:28 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405202030.s4KKUSw5073740@svn.freebsd.org> From: Neel Natu Date: Tue, 20 May 2014 20:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266476 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 20:30:28 -0000 Author: neel Date: Tue May 20 20:30:28 2014 New Revision: 266476 URL: http://svnweb.freebsd.org/changeset/base/266476 Log: Add PG_RW check when translating a guest linear to guest physical address. Set the accessed and dirty bits in the page table entry. If it fails then restart the page table walk from the beginning. This might happen if another vcpu modifies the page tables simultaneously. Reviewed by: alc, kib Modified: head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Tue May 20 19:55:59 2014 (r266475) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Tue May 20 20:30:28 2014 (r266476) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -571,20 +572,48 @@ vie_init(struct vie *vie) vie->index_register = VM_REG_LAST; } +static void +ptp_release(void **cookie) +{ + if (*cookie != NULL) { + vm_gpa_release(*cookie); + *cookie = NULL; + } +} + +static void * +ptp_hold(struct vm *vm, vm_paddr_t ptpphys, size_t len, void **cookie) +{ + void *ptr; + + ptp_release(cookie); + ptr = vm_gpa_hold(vm, ptpphys, len, VM_PROT_RW, cookie); + return (ptr); +} + static int gla2gpa(struct vm *vm, uint64_t gla, uint64_t ptpphys, uint64_t *gpa, - enum vie_paging_mode paging_mode, int cpl) + enum vie_paging_mode paging_mode, int cpl, int prot) { - int nlevels, ptpshift, ptpindex, usermode; + int nlevels, ptpshift, ptpindex, retval, usermode, writable; + u_int retries; uint64_t *ptpbase, pte, pgsize; uint32_t *ptpbase32, pte32; void *cookie; usermode = (cpl == 3 ? 1 : 0); + writable = prot & VM_PROT_WRITE; + cookie = NULL; + retval = -1; + retries = 0; +restart: + ptp_release(&cookie); + if (retries++ > 0) + maybe_yield(); if (paging_mode == PAGING_MODE_FLAT) { *gpa = gla; - return (0); + goto done; } if (paging_mode == PAGING_MODE_32) { @@ -593,8 +622,7 @@ gla2gpa(struct vm *vm, uint64_t gla, uin /* Zero out the lower 12 bits. */ ptpphys &= ~0xfff; - ptpbase32 = vm_gpa_hold(vm, ptpphys, PAGE_SIZE, - VM_PROT_READ, &cookie); + ptpbase32 = ptp_hold(vm, ptpphys, PAGE_SIZE, &cookie); if (ptpbase32 == NULL) goto error; @@ -605,14 +633,29 @@ gla2gpa(struct vm *vm, uint64_t gla, uin pte32 = ptpbase32[ptpindex]; - vm_gpa_release(cookie); - if ((pte32 & PG_V) == 0) goto error; if (usermode && (pte32 & PG_U) == 0) goto error; + if (writable && (pte32 & PG_RW) == 0) + goto error; + + /* + * Emulate the x86 MMU's management of the accessed + * and dirty flags. While the accessed flag is set + * at every level of the page table, the dirty flag + * is only set at the last level providing the guest + * physical address. + */ + if ((pte32 & PG_A) == 0) { + if (atomic_cmpset_32(&ptpbase32[ptpindex], + pte32, pte32 | PG_A) == 0) { + goto restart; + } + } + /* XXX must be ignored if CR4.PSE=0 */ if (nlevels > 0 && (pte32 & PG_PS) != 0) break; @@ -620,18 +663,25 @@ gla2gpa(struct vm *vm, uint64_t gla, uin ptpphys = pte32; } + /* Set the dirty bit in the page table entry if necessary */ + if (writable && (pte32 & PG_M) == 0) { + if (atomic_cmpset_32(&ptpbase32[ptpindex], + pte32, pte32 | PG_M) == 0) { + goto restart; + } + } + /* Zero out the lower 'ptpshift' bits */ pte32 >>= ptpshift; pte32 <<= ptpshift; *gpa = pte32 | (gla & (pgsize - 1)); - return (0); + goto done; } if (paging_mode == PAGING_MODE_PAE) { /* Zero out the lower 5 bits and the upper 32 bits */ ptpphys &= 0xffffffe0UL; - ptpbase = vm_gpa_hold(vm, ptpphys, sizeof(*ptpbase) * 4, - VM_PROT_READ, &cookie); + ptpbase = ptp_hold(vm, ptpphys, sizeof(*ptpbase) * 4, &cookie); if (ptpbase == NULL) goto error; @@ -639,8 +689,6 @@ gla2gpa(struct vm *vm, uint64_t gla, uin pte = ptpbase[ptpindex]; - vm_gpa_release(cookie); - if ((pte & PG_V) == 0) goto error; @@ -653,8 +701,7 @@ gla2gpa(struct vm *vm, uint64_t gla, uin /* Zero out the lower 12 bits and the upper 12 bits */ ptpphys >>= 12; ptpphys <<= 24; ptpphys >>= 12; - ptpbase = vm_gpa_hold(vm, ptpphys, PAGE_SIZE, VM_PROT_READ, - &cookie); + ptpbase = ptp_hold(vm, ptpphys, PAGE_SIZE, &cookie); if (ptpbase == NULL) goto error; @@ -664,14 +711,23 @@ gla2gpa(struct vm *vm, uint64_t gla, uin pte = ptpbase[ptpindex]; - vm_gpa_release(cookie); - if ((pte & PG_V) == 0) goto error; if (usermode && (pte & PG_U) == 0) goto error; + if (writable && (pte & PG_RW) == 0) + goto error; + + /* Set the accessed bit in the page table entry */ + if ((pte & PG_A) == 0) { + if (atomic_cmpset_64(&ptpbase[ptpindex], + pte, pte | PG_A) == 0) { + goto restart; + } + } + if (nlevels > 0 && (pte & PG_PS) != 0) { if (pgsize > 1 * GB) goto error; @@ -682,13 +738,20 @@ gla2gpa(struct vm *vm, uint64_t gla, uin ptpphys = pte; } + /* Set the dirty bit in the page table entry if necessary */ + if (writable && (pte & PG_M) == 0) { + if (atomic_cmpset_64(&ptpbase[ptpindex], pte, pte | PG_M) == 0) + goto restart; + } + /* Zero out the lower 'ptpshift' bits and the upper 12 bits */ pte >>= ptpshift; pte <<= (ptpshift + 12); pte >>= 12; *gpa = pte | (gla & (pgsize - 1)); - return (0); - +done: + retval = 0; error: - return (-1); + ptp_release(&cookie); + return (retval); } int @@ -710,7 +773,7 @@ vmm_fetch_instruction(struct vm *vm, int /* Copy the instruction into 'vie' */ while (vie->num_valid < inst_length) { - err = gla2gpa(vm, rip, cr3, &gpa, paging_mode, cpl); + err = gla2gpa(vm, rip, cr3, &gpa, paging_mode, cpl, prot); if (err) break; From owner-svn-src-head@FreeBSD.ORG Tue May 20 21:14:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69F32A2D; Tue, 20 May 2014 21:14:26 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 488AA2403; Tue, 20 May 2014 21:14:25 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s4KLEOQQ062539 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 May 2014 14:14:24 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s4KLENRM062538; Tue, 20 May 2014 14:14:23 -0700 (PDT) (envelope-from jmg) Date: Tue, 20 May 2014 14:14:23 -0700 From: John-Mark Gurney To: Andrew Turner Subject: Re: svn commit: r266349 - in head: share/mk sys/conf Message-ID: <20140520211423.GT43976@funkthat.com> References: <201405172031.s4HKVY51073386@svn.freebsd.org> <20140518205605.70159532@bender.Home> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140518205605.70159532@bender.Home> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 20 May 2014 14:14:24 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 21:14:26 -0000 Andrew Turner wrote this message on Sun, May 18, 2014 at 20:56 +0100: > On Sat, 17 May 2014 20:31:34 +0000 (UTC) > Warner Losh wrote: > > > Author: imp > > Date: Sat May 17 20:31:34 2014 > > New Revision: 266349 > > URL: http://svnweb.freebsd.org/changeset/base/266349 > > > > Log: > > The time is not yet ripe to break the lack of dependencies between > > src/sys and the rest of the tree for builds. > > o eliminate including bsd.mkopts.mk for the moment in kern.opts.mk > > o No need to include src.opts.mk at all anymore. The reasons for it > > are now coverted in sys.mk and src.sys.mk. > > This breaks ARM kernel builds as MK_ARM_EABI is undefined, at least on > 9.x. The below patch fixes it for me. But isn't armeb's ABI OABI on 9? so defaulting this to yes would change the ABI as you build on 9.x wouldn't it? Or am I just confused by your throwing in 9.x into the mix? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Tue May 20 21:16:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6EF4CBC for ; Tue, 20 May 2014 21:16:18 +0000 (UTC) Received: from mail-pd0-f180.google.com (mail-pd0-f180.google.com [209.85.192.180]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 755862420 for ; Tue, 20 May 2014 21:16:18 +0000 (UTC) Received: by mail-pd0-f180.google.com with SMTP id y13so676729pdi.25 for ; Tue, 20 May 2014 14:16:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=M37TV25uk09JXoYVquD5c0VbhIAJRJuGCtMgIl+V7+Q=; b=ZdjwEiexZu9bxrycUNMYjLjYGbeS1YeOxkow2w1CBHfo+oijWk4tO4iUYNjGJ1eLGx s81axgwJeKij9wIrf4z2KJTRjnsD4mcUSby3pblsm2uMzKVpH7LNQIXUR8hUrJonRACn lQiEgKuPY2dT8T6UnRwyCDP2Qz5TGvdjcRanwd8W7SuB03YMnvfg1JY1CTPBWQHQ9Q0R MgXAUV2G+tLFxHF6+lo0gq3WxSxd5jleYLcLjJvkzSI2ae8FKG2K+i1CeekZw7xY5TSJ aAly7wUCJ5m/qUG/ITLZHk3X+ouj9ChVFoeBRdmlRxFSZJ5Wc9C8QHVlaGMSZFJsyBxe zqqA== X-Gm-Message-State: ALoCoQmH0nP4cpW5R7n/7J/l/8m/r+l1BQi7YBCiBLUjyDRFWcB80IIlt4AjshEs+hDBTq0KSNVi X-Received: by 10.68.164.4 with SMTP id ym4mr53884685pbb.53.1400620577319; Tue, 20 May 2014 14:16:17 -0700 (PDT) Received: from [10.64.26.239] (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id qv9sm4654053pbc.71.2014.05.20.14.16.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 20 May 2014 14:16:16 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_10E6EDD2-7330-456C-A05E-3A9D2EBA5B03"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266349 - in head: share/mk sys/conf From: Warner Losh In-Reply-To: <20140520211423.GT43976@funkthat.com> Date: Tue, 20 May 2014 15:16:14 -0600 Message-Id: References: <201405172031.s4HKVY51073386@svn.freebsd.org> <20140518205605.70159532@bender.Home> <20140520211423.GT43976@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh , Andrew Turner X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 21:16:18 -0000 --Apple-Mail=_10E6EDD2-7330-456C-A05E-3A9D2EBA5B03 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On May 20, 2014, at 3:14 PM, John-Mark Gurney wrote: > Andrew Turner wrote this message on Sun, May 18, 2014 at 20:56 +0100: >> On Sat, 17 May 2014 20:31:34 +0000 (UTC) >> Warner Losh wrote: >>=20 >>> Author: imp >>> Date: Sat May 17 20:31:34 2014 >>> New Revision: 266349 >>> URL: http://svnweb.freebsd.org/changeset/base/266349 >>>=20 >>> Log: >>> The time is not yet ripe to break the lack of dependencies between >>> src/sys and the rest of the tree for builds. >>> o eliminate including bsd.mkopts.mk for the moment in kern.opts.mk >>> o No need to include src.opts.mk at all anymore. The reasons for it >>> are now coverted in sys.mk and src.sys.mk. >>=20 >> This breaks ARM kernel builds as MK_ARM_EABI is undefined, at least = on >> 9.x. The below patch fixes it for me. >=20 > But isn't armeb's ABI OABI on 9? so defaulting this to yes would = change > the ABI as you build on 9.x wouldn't it? Or am I just confused by = your > throwing in 9.x into the mix? First, this is current only. Second, I=92m not changing the ABI on 9. Third, building 9.x armeb binaries is unaffected by the host compiler = and build environment. It will continue to be what it was last week or = last month independent of my changes. Warner --Apple-Mail=_10E6EDD2-7330-456C-A05E-3A9D2EBA5B03 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTe8YeAAoJEGwc0Sh9sBEAtt8P/0qX4fDtyCB//Kx639YUqJ7l LUnB3VhWlwjlA+YsOU+RiXXFhHBOJSbu7wFGxqM8guEgcmPpL40G2U8OpCHnzm6K W6Iztz6B4u7uFnD4wFG0+RAvsiddQHox3fGhQmOZ4j0BeBeOzUnBdCeZ5Ubt8o97 NKgNZROVDUnLFvpzkOgE0uDacsGIkvUFbeK+C7w2AlKEB8tbXS4qalbqzGS6y6mU qfm5NmePq9gNJcVU8qm7SxJ8M9KptxGyRFFB5TBZyCN2aTW8xddnrsW+4c1b5PML gV3mOUtkUo5IBm2g1vn2Hhy7cHSBknGZN5bPDgp2QcZl9Y5Vw+CnEnpu5dK3FIBH F7eiwejF5qK2ZyCJWx0hQ3aihKfZcM3CnWRULtV34H4JTXJYLYL/ocOU1jAGV81s yvP6jOjenm1bRupfMsRnmgf0qd9uU1TC/+SPRLCY7eomGQKj3ztrqJeMQKHDy4kq 34GyYyVCl1oJKsSiXtDDvEMHd7Ow/bhh+ACjt3Cp8OABe5dDs5qxX5Fr9anX78Cb JKUoDqJh+A4f0yIRVmSR9qltoMzrIUym5Rdweji4+nhU8ei6dGJSHtDe4xTiYoo3 c516gR9abQh3kZiOYWxlzMmtSOckSGp0Z9g/i3fbfq3iYJrKWBw3meMUIWqtwBzd 8Pe/g7YMtKYsc4HzAqkZ =OdSl -----END PGP SIGNATURE----- --Apple-Mail=_10E6EDD2-7330-456C-A05E-3A9D2EBA5B03-- From owner-svn-src-head@FreeBSD.ORG Tue May 20 21:20:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26DFAF2F; Tue, 20 May 2014 21:20:07 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DDD792460; Tue, 20 May 2014 21:20:06 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s4KLK5wJ062660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 May 2014 14:20:05 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s4KLK5S9062659; Tue, 20 May 2014 14:20:05 -0700 (PDT) (envelope-from jmg) Date: Tue, 20 May 2014 14:20:05 -0700 From: John-Mark Gurney To: Warner Losh Subject: Re: svn commit: r266349 - in head: share/mk sys/conf Message-ID: <20140520212004.GU43976@funkthat.com> References: <201405172031.s4HKVY51073386@svn.freebsd.org> <20140518205605.70159532@bender.Home> <20140520211423.GT43976@funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 20 May 2014 14:20:05 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh , Andrew Turner X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 21:20:07 -0000 Warner Losh wrote this message on Tue, May 20, 2014 at 15:16 -0600: > > On May 20, 2014, at 3:14 PM, John-Mark Gurney wrote: > > > Andrew Turner wrote this message on Sun, May 18, 2014 at 20:56 +0100: > >> On Sat, 17 May 2014 20:31:34 +0000 (UTC) > >> Warner Losh wrote: > >> > >>> Author: imp > >>> Date: Sat May 17 20:31:34 2014 > >>> New Revision: 266349 > >>> URL: http://svnweb.freebsd.org/changeset/base/266349 > >>> > >>> Log: > >>> The time is not yet ripe to break the lack of dependencies between > >>> src/sys and the rest of the tree for builds. > >>> o eliminate including bsd.mkopts.mk for the moment in kern.opts.mk > >>> o No need to include src.opts.mk at all anymore. The reasons for it > >>> are now coverted in sys.mk and src.sys.mk. > >> > >> This breaks ARM kernel builds as MK_ARM_EABI is undefined, at least on > >> 9.x. The below patch fixes it for me. > > > > But isn't armeb's ABI OABI on 9? so defaulting this to yes would change > > the ABI as you build on 9.x wouldn't it? Or am I just confused by your > > throwing in 9.x into the mix? > > First, this is current only. > > Second, I?m not changing the ABI on 9. > > Third, building 9.x armeb binaries is unaffected by the host compiler and build environment. It will continue to be what it was last week or last month independent of my changes. Oh, I think Andy was complaining about building -HEAD on 9.x, not about building 9.x ARM... Then this change makes more sense and as you said, isn't changing the ABI on 9... Ok, if that's the case, the confusion has been cleared... Thanks. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Tue May 20 21:24:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 576141A9; Tue, 20 May 2014 21:24:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44355251A; Tue, 20 May 2014 21:24:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4KLOGvi098987; Tue, 20 May 2014 21:24:16 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4KLOGXA098986; Tue, 20 May 2014 21:24:16 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201405202124.s4KLOGXA098986@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 20 May 2014 21:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266479 - head/gnu/usr.bin/groff/tmac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 21:24:16 -0000 Author: pluknet Date: Tue May 20 21:24:15 2014 New Revision: 266479 URL: http://svnweb.freebsd.org/changeset/base/266479 Log: Move Nx definition to a separate block. Noticed by: ru (a while ago) Modified: head/gnu/usr.bin/groff/tmac/mdoc.local Modified: head/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- head/gnu/usr.bin/groff/tmac/mdoc.local Tue May 20 21:15:47 2014 (r266478) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Tue May 20 21:24:15 2014 (r266479) @@ -62,6 +62,8 @@ .ds doc-operating-system-FreeBSD-10.0 10.0 .ds doc-operating-system-FreeBSD-10.1 10.1 .ds doc-operating-system-FreeBSD-11.0 11.0 +. +.\" Definitions for other *BSDs not (yet) in doc-common .ds doc-operating-system-NetBSD-7.0 7.0 . .\" Definitions not (yet) in doc-syms From owner-svn-src-head@FreeBSD.ORG Tue May 20 21:32:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3FFF5B8 for ; Tue, 20 May 2014 21:32:24 +0000 (UTC) Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F8DC2601 for ; Tue, 20 May 2014 21:32:24 +0000 (UTC) Received: by mail-pa0-f44.google.com with SMTP id ld10so697397pab.17 for ; Tue, 20 May 2014 14:32:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=ECUoslPJ7va35a0q7hVgRu3Jbc9+tYrBc5b4jEJhf20=; b=TySFDMwpjyZ49IMUPsI7eluBfhuvyirm1OEr41TG2UHU2dxgZwAFRbNaBsX24dJ48n hb3zSjAoYt1msLZ+vS4hrTVfsspdlHBcIZ70El9S7U2PiHecRl1POYW1gxEGfaC89GGL q4YiJm0+19A3ji8RWi/uyvh6V98/gQOc0M15kNLXl1uw/YhfgVcc6Na6LFGp/toC6LiP WsWHDCkVzVEBufeM5TVGXgiJyXPml2iMR5IllaK/VGefwEi2s0IrDQO77OVobGNG00f9 mm2FFSqee9hv7o+A39KNlfDLJc8HwMLS7APVlhEyULCo18ihgMFEzAzr6KYFMoUbKvTa DGTw== X-Gm-Message-State: ALoCoQl9AzA7G0+G5Kq5lFUwohFqnmMLXinE6KuWUa3lq1ZVA9TWvLeRQIrRTp5/KgxOq21Mvba+ X-Received: by 10.68.237.67 with SMTP id va3mr2832362pbc.19.1400621052428; Tue, 20 May 2014 14:24:12 -0700 (PDT) Received: from [10.64.26.239] (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id fe2sm4671483pbc.68.2014.05.20.14.24.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 20 May 2014 14:24:11 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_216FFB48-D7B4-44E3-84B8-86CF13715719"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266349 - in head: share/mk sys/conf From: Warner Losh In-Reply-To: <20140520212004.GU43976@funkthat.com> Date: Tue, 20 May 2014 15:24:05 -0600 Message-Id: References: <201405172031.s4HKVY51073386@svn.freebsd.org> <20140518205605.70159532@bender.Home> <20140520211423.GT43976@funkthat.com> <20140520212004.GU43976@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh , Andrew Turner X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 21:32:24 -0000 --Apple-Mail=_216FFB48-D7B4-44E3-84B8-86CF13715719 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On May 20, 2014, at 3:20 PM, John-Mark Gurney wrote: > Warner Losh wrote this message on Tue, May 20, 2014 at 15:16 -0600: >>=20 >> On May 20, 2014, at 3:14 PM, John-Mark Gurney = wrote: >>=20 >>> Andrew Turner wrote this message on Sun, May 18, 2014 at 20:56 = +0100: >>>> On Sat, 17 May 2014 20:31:34 +0000 (UTC) >>>> Warner Losh wrote: >>>>=20 >>>>> Author: imp >>>>> Date: Sat May 17 20:31:34 2014 >>>>> New Revision: 266349 >>>>> URL: http://svnweb.freebsd.org/changeset/base/266349 >>>>>=20 >>>>> Log: >>>>> The time is not yet ripe to break the lack of dependencies between >>>>> src/sys and the rest of the tree for builds. >>>>> o eliminate including bsd.mkopts.mk for the moment in kern.opts.mk >>>>> o No need to include src.opts.mk at all anymore. The reasons for = it >>>>> are now coverted in sys.mk and src.sys.mk. >>>>=20 >>>> This breaks ARM kernel builds as MK_ARM_EABI is undefined, at least = on >>>> 9.x. The below patch fixes it for me. >>>=20 >>> But isn't armeb's ABI OABI on 9? so defaulting this to yes would = change >>> the ABI as you build on 9.x wouldn't it? Or am I just confused by = your >>> throwing in 9.x into the mix? >>=20 >> First, this is current only. >>=20 >> Second, I?m not changing the ABI on 9. >>=20 >> Third, building 9.x armeb binaries is unaffected by the host compiler = and build environment. It will continue to be what it was last week or = last month independent of my changes. >=20 > Oh, I think Andy was complaining about building -HEAD on 9.x, not = about > building 9.x ARM... Then this change makes more sense and as you = said, > isn't changing the ABI on 9... >=20 > Ok, if that's the case, the confusion has been cleared... Yea, that issue has been corrected. The new build system didn=92t define = something, and 9.x was incidental=85 Warner --Apple-Mail=_216FFB48-D7B4-44E3-84B8-86CF13715719 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTe8f1AAoJEGwc0Sh9sBEA4JwQAK5ul3bSDzMW6LlrIUT43kMz CKq1RgkTCzkANeXX5IEB5pH2txbrXi7UUFxXO24RliltlTVlt85pja7t6hnofn2g Q8tzEmbu4DFzVjCOxDqof80FTBMP46d1bGwV9cWqDuHPaAOpMZ/Jnn17hKJIfcqR 1OpuetQK9zLOdt5SvKME3bJajTki1MWY6naZxngg9+IIBJw98TYTiB159+ImYGOl q/AolLnCccq4NS6Tl89KtpanOM2p+xYezPJY3tN+EuEdzHVgE6GJv5BiZ3TdvqZv uvQNOy8Ai9BermjEbgjO3MLzO5yw++S/c5bS21MY8EVIb3VFMP8XyNSTJFXfNbZk CiCJIl9r0EYFmhKcXrewnCrJIEV1H/YasfzuGyt5eBmChdKnbDn8mh0oF6VUtiq6 gwAnPz2J0IYnwwSiCHPqr0XvbQlKOOLefnz57AERU8KmrKAxZjn3RUEj7swEEjT0 9MYJ+Y+mqfv70nFGifMnBQzUGN3PFXrkQeFP4pIBpqh6frVLfq47SHGU37kMpX7J YcLhedqUL++KYAbuHc78im7IUohMfyi+Qy4IjONO6Iqer1LFBMLrMMFvvqXYV0SM ZXsojRRm4Rv4lm8PkOKU4DodsHJn5ysRSE+bA0HXRZ2/YcFhVmSBMEMJgszA9P33 vcOYNSDyzT+EIgWHPvGj =YDi+ -----END PGP SIGNATURE----- --Apple-Mail=_216FFB48-D7B4-44E3-84B8-86CF13715719-- From owner-svn-src-head@FreeBSD.ORG Tue May 20 22:11:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E1C9A8E; Tue, 20 May 2014 22:11:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B56E2965; Tue, 20 May 2014 22:11:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4KMBr5C020170; Tue, 20 May 2014 22:11:53 GMT (envelope-from slm@svn.freebsd.org) Received: (from slm@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4KMBrGI020169; Tue, 20 May 2014 22:11:53 GMT (envelope-from slm@svn.freebsd.org) Message-Id: <201405202211.s4KMBrGI020169@svn.freebsd.org> From: Stephen McConnell Date: Tue, 20 May 2014 22:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266480 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 22:11:53 -0000 Author: slm Date: Tue May 20 22:11:52 2014 New Revision: 266480 URL: http://svnweb.freebsd.org/changeset/base/266480 Log: - Add myself to committers-src.dot Approved by: ken/scottl (mentors) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Tue May 20 21:24:15 2014 (r266479) +++ head/share/misc/committers-src.dot Tue May 20 22:11:52 2014 (r266480) @@ -270,6 +270,7 @@ sephe [label="Sepherosa Ziehau\nsephe@Fr sepotvin [label="Stephane E. Potvin\nsepotvin@FreeBSD.org\n2007/02/15"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2006/03/07"] sjg [label="Simon J. Gerraty\nsjg@FreeBSD.org\n2012/10/23"] +slm [label="Stephen McConnell\nslm@FreeBSD.org\n2014/05/07"] smh [label="Steven Hartland\nsmh@FreeBSD.org\n2012/11/12"] sobomax [label="Maxim Sobolev\nsobomax@FreeBSD.org\n2001/07/25"] sos [label="Soren Schmidt\nsos@FreeBSD.org\n????/??/??"] @@ -525,6 +526,7 @@ julian -> mp kan -> kib ken -> asomers +ken -> slm kib -> ae kib -> dchagin @@ -664,6 +666,7 @@ scottl -> jimharris scottl -> pjd scottl -> sah scottl -> sbruno +scottl -> slm scottl -> yongari sheldonh -> dwmalone From owner-svn-src-head@FreeBSD.ORG Tue May 20 22:43:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 964F4224; Tue, 20 May 2014 22:43:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 773EC2BD7; Tue, 20 May 2014 22:43:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4KMhIUh033127; Tue, 20 May 2014 22:43:18 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4KMhIRu033126; Tue, 20 May 2014 22:43:18 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201405202243.s4KMhIRu033126@svn.freebsd.org> From: Scott Long Date: Tue, 20 May 2014 22:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266481 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 22:43:18 -0000 Author: scottl Date: Tue May 20 22:43:17 2014 New Revision: 266481 URL: http://svnweb.freebsd.org/changeset/base/266481 Log: Old PCIe implementations cannot allow a DMA transfer to cross a 4GB boundary. This was addressed several years ago by creating a parent tag hierarchy for the root buses that set the boundary restriction for appropriate buses and allowed child deviced to inherit it. Somewhere along the way, this restriction was turned into a case for marking the tag as a candidate for needing bounce buffers, instead of just splitting the segment along the boundary line. This flag also causes all maps associated with this tag to be non-NULL, which in turn causes bus_dmamap_sync() to take the slow path of function pointer indirection to discover that there's no bouncing work to do. The end result is a lot of pages set aside in bounce pools that will never be used, and a slow path for data buffers in nearly every DMA-capable PCIe device. For example, our workload at Netflix was spending nearly 1% of all CPU time going through this slow path. Fix this problem by being more selective about when to set the COULD_BOUNCE flag. Only set it when the boundary restriction exists and the consumer cannot do more than a single DMA segment at once. This fixes the case of dynamic buffers (mbufs, bio's) but doesn't address static buffers allocated from bus_dmamem_alloc(). That case will be addressed in the future. For those interested, this was discovered thanks to Dtrace Flame Graphs. Discussed with: jhb, kib Obtained from: Netflix, Inc. MFC after: 3 days Modified: head/sys/x86/x86/busdma_bounce.c Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Tue May 20 22:11:52 2014 (r266480) +++ head/sys/x86/x86/busdma_bounce.c Tue May 20 22:43:17 2014 (r266481) @@ -172,12 +172,35 @@ bounce_bus_dma_tag_create(bus_dma_tag_t newtag->map_count = 0; newtag->segments = NULL; + /* + * Bouncing might be needed if there's a filter. + * XXX Filters are likely broken as there's no way to + * guarantee that bounce pages will also satisfy the + * filter requirement. + */ if (parent != NULL && ((newtag->common.filter != NULL) || ((parent->common.flags & BUS_DMA_COULD_BOUNCE) != 0))) newtag->common.flags |= BUS_DMA_COULD_BOUNCE; - if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem) || - newtag->common.alignment > 1) + /* + * Bouncing might be needed if there's an upper memory + * restriction. + */ + if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem)) + newtag->common.flags |= BUS_DMA_COULD_BOUNCE; + + /* + * Bouncing might be needed if there's an alignment + * restriction that can't be satisfied by breaking up + * the segment. + * XXX Need to consider non-natural alignment. + * XXX Static allocations that tie to bus_dmamem_alloc() + * will likely pass this test and be penalized with + * the COULD_BOUNCE flag. Should probably have + * bus_dmamem_alloc() clear this flag. + */ + if ((newtag->common.nsegments <= 1) && + (newtag->common.alignment > 1)) newtag->common.flags |= BUS_DMA_COULD_BOUNCE; if (((newtag->common.flags & BUS_DMA_COULD_BOUNCE) != 0) && From owner-svn-src-head@FreeBSD.ORG Wed May 21 03:11:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B57B8955; Wed, 21 May 2014 03:11:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1DC720B5; Wed, 21 May 2014 03:11:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4L3BRJJ047002; Wed, 21 May 2014 03:11:27 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4L3BROu047001; Wed, 21 May 2014 03:11:27 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201405210311.s4L3BROu047001@svn.freebsd.org> From: Benjamin Kaduk Date: Wed, 21 May 2014 03:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266482 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 03:11:27 -0000 Author: bjk (doc committer) Date: Wed May 21 03:11:27 2014 New Revision: 266482 URL: http://svnweb.freebsd.org/changeset/base/266482 Log: Check for mismatched vref()/vdrop() Assert that the hold count has not fallen below the use count, a situation that would only happen when a vref() (or similar) is erroneously paired with a vdrop(). This situation has not been observed in the wild, but could be helpful for someone implementing a new filesystem. Reviewed by: kib Approved by: hrs (mentor) Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue May 20 22:43:17 2014 (r266481) +++ head/sys/kern/vfs_subr.c Wed May 21 03:11:27 2014 (r266482) @@ -2343,6 +2343,8 @@ vdropl(struct vnode *vp) if (vp->v_holdcnt <= 0) panic("vdrop: holdcnt %d", vp->v_holdcnt); vp->v_holdcnt--; + VNASSERT(vp->v_holdcnt >= vp->v_usecount, vp, + ("hold count less than use count")); if (vp->v_holdcnt > 0) { VI_UNLOCK(vp); return; From owner-svn-src-head@FreeBSD.ORG Wed May 21 03:17:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3ECC9E9B; Wed, 21 May 2014 03:17:20 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F8CF20F8; Wed, 21 May 2014 03:17:19 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s4L3HIdT067248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 May 2014 20:17:19 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s4L3HIkB067247; Tue, 20 May 2014 20:17:18 -0700 (PDT) (envelope-from jmg) Date: Tue, 20 May 2014 20:17:18 -0700 From: John-Mark Gurney To: Scott Long Subject: Re: svn commit: r266481 - head/sys/x86/x86 Message-ID: <20140521031718.GZ43976@funkthat.com> References: <201405202243.s4KMhIRu033126@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201405202243.s4KMhIRu033126@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 20 May 2014 20:17:19 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 03:17:20 -0000 Scott Long wrote this message on Tue, May 20, 2014 at 22:43 +0000: > For those interested, this was discovered thanks to Dtrace Flame > Graphs. btw, Dtrace Flame Graphs are VERY easy to generate... The README in the git repository contains the commands, and for me it was simply copy/pasting the commands (make sure you have dtraceall loaded) and they worked... Page: http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Wed May 21 05:27:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C417F652; Wed, 21 May 2014 05:27:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B192D2A01; Wed, 21 May 2014 05:27:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4L5RvFm003455; Wed, 21 May 2014 05:27:57 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4L5RvQ9003454; Wed, 21 May 2014 05:27:57 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201405210527.s4L5RvQ9003454@svn.freebsd.org> From: Dmitry Morozovsky Date: Wed, 21 May 2014 05:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266483 - head/sbin/geom/class/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 05:27:57 -0000 Author: marck (doc committer) Date: Wed May 21 05:27:57 2014 New Revision: 266483 URL: http://svnweb.freebsd.org/changeset/base/266483 Log: Document VMware-related filesystems additions. Reviewed by: jmg MFC after: 1 week Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Wed May 21 03:11:27 2014 (r266482) +++ head/sbin/geom/class/part/gpart.8 Wed May 21 05:27:57 2014 (r266483) @@ -657,6 +657,30 @@ A partition that contains a NTFS or exFA The scheme-specific type is .Qq Li "!7" for MBR. +.It Cm vmware-vmfs +A partition that contains a VMware File System (VMFS). +The scheme-specific types are +.Qq Li "!251" +for MBR and +.Qq Li "!aa31e02a-400f-11db-9590-000c2911d1b8" +for GPT. +.It Cm vmware-vmkdiag +A partition that contains a VMware diagostic filesystem. +The scheme-specific types are +.Qq Li "!252" +for MBR and +.Qq Li "!9d275380-40ad-11db-bf97-000c2911d1b8" +for GPT. +.It Cm vmware-reserved +A VMware reserved partition. +The scheme-specific type is +.Qq Li "!9198effc-31c0-11db-8f-78-000c2911d1b8" +for GPT. +.It Cm vmware-vsanhdr +A partition claimed by VMware VSAN. +The scheme-specific type is +.Qq Li "!381cfccc-7288-11e0-92ee-000c2911d0b2" +for GPT. .El .Sh ATTRIBUTES The scheme-specific attributes for EBR: From owner-svn-src-head@FreeBSD.ORG Wed May 21 06:23:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1328CBB0; Wed, 21 May 2014 06:23:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E852A2F10; Wed, 21 May 2014 06:23:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4L6NqLt030952; Wed, 21 May 2014 06:23:52 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4L6NqGl030951; Wed, 21 May 2014 06:23:52 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405210623.s4L6NqGl030951@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 21 May 2014 06:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266484 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 06:23:53 -0000 Author: hselasky Date: Wed May 21 06:23:52 2014 New Revision: 266484 URL: http://svnweb.freebsd.org/changeset/base/266484 Log: Avoid starting a USB transfer inside the callback function, right after its been submitted. MFC after: 3 days Modified: head/sys/dev/usb/wlan/if_rsu.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Wed May 21 05:27:57 2014 (r266483) +++ head/sys/dev/usb/wlan/if_rsu.c Wed May 21 06:23:52 2014 (r266484) @@ -189,9 +189,9 @@ static void rsu_init(void *); static void rsu_init_locked(struct rsu_softc *); static void rsu_watchdog(void *); static int rsu_tx_start(struct rsu_softc *, struct ieee80211_node *, - struct mbuf *, struct rsu_data *); + struct mbuf *, struct rsu_data *, struct usb_xfer *); static void rsu_start(struct ifnet *); -static void rsu_start_locked(struct ifnet *); +static void rsu_start_locked(struct ifnet *, struct usb_xfer *); static int rsu_ioctl(struct ifnet *, u_long, caddr_t); static void rsu_stop(struct ifnet *, int); static void rsu_stop_locked(struct ifnet *, int); @@ -1610,7 +1610,7 @@ tr_setup: usbd_xfer_set_frame_data(xfer, 0, data->buf, data->buflen); DPRINTF("submitting transfer %p\n", data); usbd_transfer_submit(xfer); - rsu_start_locked(ifp); + rsu_start_locked(ifp, xfer); break; default: data = STAILQ_FIRST(&sc->sc_tx_active); @@ -1631,7 +1631,7 @@ tr_setup: static int rsu_tx_start(struct rsu_softc *sc, struct ieee80211_node *ni, - struct mbuf *m0, struct rsu_data *data) + struct mbuf *m0, struct rsu_data *data, struct usb_xfer *xfer_self) { struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; @@ -1736,8 +1736,9 @@ rsu_tx_start(struct rsu_softc *sc, struc data->ni = ni; data->m = m0; STAILQ_INSERT_TAIL(&sc->sc_tx_pending, data, next); - usbd_transfer_start(xfer); + if (xfer != xfer_self) + usbd_transfer_start(xfer); return (0); } @@ -1750,12 +1751,12 @@ rsu_start(struct ifnet *ifp) return; RSU_LOCK(sc); - rsu_start_locked(ifp); + rsu_start_locked(ifp, NULL); RSU_UNLOCK(sc); } static void -rsu_start_locked(struct ifnet *ifp) +rsu_start_locked(struct ifnet *ifp, struct usb_xfer *xfer_self) { struct rsu_softc *sc = ifp->if_softc; struct ieee80211_node *ni; @@ -1776,7 +1777,7 @@ rsu_start_locked(struct ifnet *ifp) ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; m->m_pkthdr.rcvif = NULL; - if (rsu_tx_start(sc, ni, m, bf) != 0) { + if (rsu_tx_start(sc, ni, m, bf, xfer_self) != 0) { ifp->if_oerrors++; STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); ieee80211_free_node(ni); @@ -2303,7 +2304,7 @@ rsu_raw_xmit(struct ieee80211_node *ni, return (ENOBUFS); } ifp->if_opackets++; - if (rsu_tx_start(sc, ni, m, bf) != 0) { + if (rsu_tx_start(sc, ni, m, bf, NULL) != 0) { ieee80211_free_node(ni); ifp->if_oerrors++; STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); From owner-svn-src-head@FreeBSD.ORG Wed May 21 08:09:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EFE0C28; Wed, 21 May 2014 08:09:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C5EE2A52; Wed, 21 May 2014 08:09:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4L89jdD075921; Wed, 21 May 2014 08:09:45 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4L89jXL075920; Wed, 21 May 2014 08:09:45 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201405210809.s4L89jXL075920@svn.freebsd.org> From: Kevin Lo Date: Wed, 21 May 2014 08:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266490 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 08:09:45 -0000 Author: kevlo Date: Wed May 21 08:09:44 2014 New Revision: 266490 URL: http://svnweb.freebsd.org/changeset/base/266490 Log: - Configure Rx bulk - Announce flow control capability to PHY drivers Modified: head/sys/dev/usb/net/if_axge.c Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Wed May 21 07:42:42 2014 (r266489) +++ head/sys/dev/usb/net/if_axge.c Wed May 21 08:09:44 2014 (r266490) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Kevin Lo + * Copyright (c) 2013-2014 Kevin Lo * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -71,12 +71,16 @@ static const STRUCT_USB_HOST_ID axge_dev }; static const struct { - unsigned char ctrl, timer_l, timer_h, size, ifg; -} AX88179_BULKIN_SIZE[] = { - {7, 0x4f, 0, 0x12, 0xff}, - {7, 0x20, 3, 0x16, 0xff}, - {7, 0xae, 7, 0x18, 0xff}, - {7, 0xcc, 0x4c, 0x18, 8}, + uint8_t ctrl; + uint8_t timer_l; + uint8_t timer_h; + uint8_t size; + uint8_t ifg; +} axge_bulk_size[] = { + { 7, 0x4f, 0x00, 0x12, 0xff }, + { 7, 0x20, 0x03, 0x16, 0xff }, + { 7, 0xae, 0x07, 0x18, 0xff }, + { 7, 0xcc, 0x4c, 0x18, 0x08 } }; /* prototypes */ @@ -104,6 +108,8 @@ static int axge_read_mem(struct axge_sof uint16_t, void *, int); static void axge_write_mem(struct axge_softc *, uint8_t, uint16_t, uint16_t, void *, int); +static uint8_t axge_read_cmd_1(struct axge_softc *, uint8_t, uint16_t, + uint16_t); static uint16_t axge_read_cmd_2(struct axge_softc *, uint8_t, uint16_t, uint16_t); static void axge_write_cmd_1(struct axge_softc *, uint8_t, uint16_t, @@ -233,6 +239,16 @@ axge_write_mem(struct axge_softc *sc, ui } } +static uint8_t +axge_read_cmd_1(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t reg) +{ + uint8_t val; + + axge_read_mem(sc, cmd, index, reg, &val, 1); + return (val); +} + static uint16_t axge_read_cmd_2(struct axge_softc *sc, uint8_t cmd, uint16_t index, uint16_t reg) @@ -307,6 +323,7 @@ axge_miibus_statchg(device_t dev) struct axge_softc *sc; struct mii_data *mii; struct ifnet *ifp; + uint8_t link_status, tmp[5]; uint16_t val; int locked; @@ -339,6 +356,8 @@ axge_miibus_statchg(device_t dev) if ((sc->sc_flags & AXGE_FLAG_LINK) == 0) goto done; + link_status = axge_read_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_LINK_STATUS); + val = 0; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { val |= AXGE_MEDIUM_FULL_DUPLEX; @@ -347,18 +366,32 @@ axge_miibus_statchg(device_t dev) if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) val |= AXGE_MEDIUM_RXFLOW_CTRLEN; } - val |= AXGE_MEDIUM_RECEIVE_EN | AXGE_MEDIUM_ALWAYS_ONE; + val |= AXGE_MEDIUM_RECEIVE_EN; switch (IFM_SUBTYPE(mii->mii_media_active)) { case IFM_1000_T: - val |= AXGE_MEDIUM_GIGAMODE; + val |= AXGE_MEDIUM_GIGAMODE | AXGE_MEDIUM_EN_125MHZ; + if (link_status & AXGE_LINK_STATUS_USB_SS) + memcpy(tmp, &axge_bulk_size[0], 5); + else if (link_status & AXGE_LINK_STATUS_USB_HS) + memcpy(tmp, &axge_bulk_size[1], 5); + else + memcpy(tmp, &axge_bulk_size[3], 5); + break; case IFM_100_TX: val |= AXGE_MEDIUM_PS; + if (link_status & + (AXGE_LINK_STATUS_USB_SS | AXGE_LINK_STATUS_USB_HS)) + memcpy(tmp, &axge_bulk_size[2], 5); + else + memcpy(tmp, &axge_bulk_size[3], 5); + break; case IFM_10_T: - /* Doesn't need to be handled. */ + memcpy(tmp, &axge_bulk_size[3], 5); break; } + /* Rx bulk configuration. */ + axge_write_mem(sc, AXGE_ACCESS_MAC, 5, AXGE_RX_BULKIN_QCTRL, tmp, 5); axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MEDIUM_STATUS_MODE, val); - done: if (!locked) AXGE_UNLOCK(sc); @@ -401,16 +434,12 @@ static void axge_attach_post(struct usb_ether *ue) { struct axge_softc *sc; - uint8_t tmp[5]; sc = uether_getsc(ue); sc->sc_phyno = 3; /* Initialize controller and get station address. */ axge_chip_init(sc); - - memcpy(tmp, &AX88179_BULKIN_SIZE[0], 5); - axge_read_mem(sc, AXGE_ACCESS_MAC, 5, AXGE_RX_BULKIN_QCTRL, tmp, 5); axge_read_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NODE_ID, ue->ue_eaddr, ETHER_ADDR_LEN); } @@ -439,7 +468,7 @@ axge_attach_post_sub(struct usb_ether *u mtx_lock(&Giant); error = mii_attach(ue->ue_dev, &ue->ue_miibus, ifp, uether_ifmedia_upd, ue->ue_methods->ue_mii_sts, - BMSR_DEFCAPMASK, sc->sc_phyno, MII_OFFSET_ANY, 0); + BMSR_DEFCAPMASK, sc->sc_phyno, MII_OFFSET_ANY, MIIF_DOPAUSE); mtx_unlock(&Giant); return (error); From owner-svn-src-head@FreeBSD.ORG Wed May 21 08:19:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B908606; Wed, 21 May 2014 08:19:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69B9B2B7C; Wed, 21 May 2014 08:19:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4L8J5Ge080526; Wed, 21 May 2014 08:19:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4L8J52M080525; Wed, 21 May 2014 08:19:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405210819.s4L8J52M080525@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 21 May 2014 08:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266491 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 08:19:05 -0000 Author: kib Date: Wed May 21 08:19:04 2014 New Revision: 266491 URL: http://svnweb.freebsd.org/changeset/base/266491 Log: Remove redundand loop. The inner goto restarts the whole page handling in the situation identical to the loop condition. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed May 21 08:09:44 2014 (r266490) +++ head/sys/vm/vm_fault.c Wed May 21 08:19:04 2014 (r266491) @@ -1351,18 +1351,16 @@ again: /* * Allocate a page in the destination object. */ - do { - dst_m = vm_page_alloc(dst_object, - (src_object == dst_object ? src_pindex : - 0) + dst_pindex, VM_ALLOC_NORMAL); - if (dst_m == NULL) { - VM_OBJECT_WUNLOCK(dst_object); - VM_OBJECT_RUNLOCK(object); - VM_WAIT; - VM_OBJECT_WLOCK(dst_object); - goto again; - } - } while (dst_m == NULL); + dst_m = vm_page_alloc(dst_object, (src_object == + dst_object ? src_pindex : 0) + dst_pindex, + VM_ALLOC_NORMAL); + if (dst_m == NULL) { + VM_OBJECT_WUNLOCK(dst_object); + VM_OBJECT_RUNLOCK(object); + VM_WAIT; + VM_OBJECT_WLOCK(dst_object); + goto again; + } pmap_copy_page(src_m, dst_m); VM_OBJECT_RUNLOCK(object); dst_m->valid = VM_PAGE_BITS_ALL; From owner-svn-src-head@FreeBSD.ORG Wed May 21 09:11:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1E78D35; Wed, 21 May 2014 09:11:19 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97A1E21B4; Wed, 21 May 2014 09:11:19 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.82 (FreeBSD)) (envelope-from ) id 1Wn2YL-0002nq-OD; Wed, 21 May 2014 13:11:13 +0400 Date: Wed, 21 May 2014 13:11:13 +0400 From: Slawa Olhovchenkov To: Gleb Smirnoff Subject: Re: svn commit: r266423 - in head/sys: conf dev/i40e modules/i40e Message-ID: <20140521091113.GA10086@zxy.spb.ru> References: <201405190121.s4J1L3qA068339@svn.freebsd.org> <53796149.8060000@freebsd.org> <20140520223516.R2836@besplex.bde.org> <20140520171613.GM50679@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140520171613.GM50679@FreeBSD.org> User-Agent: Mutt/1.5.22 (2013-10-16) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Jack F Vogel , Rui Paulo , Bruce Evans , svn-src-head@freebsd.org, Julian Elischer X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 09:11:20 -0000 On Tue, May 20, 2014 at 09:16:13PM +0400, Gleb Smirnoff wrote: > On Tue, May 20, 2014 at 11:40:01PM +1000, Bruce Evans wrote: > B> Also, verbose names break formatting. E.g., netstat -r has 5 columns > B> available under Netif for the driver name and device number. netstat > B> -i has about the same under Name (possibly 1 or 2 not directly under > B> Name, but reserved for the Name column). systat has 3 columns > B> available, but with a more flexible format that truncates other info. > B> All driver name+numbers are broken now on freefall: > > We must admit that nowadays 80x25 terminal is not enough :( > > Would be cool if most of tools (netstat, systat, etc...) could > determine size of terminal and dynamically widen all their fields. > Thus, tool can run w/o any abbreviations when run in a script mode, > run abbreviated on a small terminal, and run verbose on a wide > terminal. > > This sounds like a generic library providing a special version > of printf(3), which specifies minimal and maximum sizes for fields > and when extra terminal width is available it distributes this > width evenly between all fields. Name it 'elastic printf'. > Sounds like a nice Google SoC project. Or might be that such > library already exists. Sound like 'universal common distributed enterprise serial bus' from Rambler. Just simple check size of screen and select items and precession for display. From owner-svn-src-head@FreeBSD.ORG Wed May 21 09:17:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF47B102; Wed, 21 May 2014 09:17:11 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B5D0A2267; Wed, 21 May 2014 09:17:11 +0000 (UTC) Received: from [192.168.0.96] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s4L9H1rT048317 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 21 May 2014 09:17:02 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r266423 - in head/sys: conf dev/i40e modules/i40e From: David Chisnall In-Reply-To: <20140520171613.GM50679@FreeBSD.org> Date: Wed, 21 May 2014 10:16:46 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405190121.s4J1L3qA068339@svn.freebsd.org> <53796149.8060000@freebsd.org> <20140520223516.R2836@besplex.bde.org> <20140520171613.GM50679@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1874) Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Rui Paulo , Bruce Evans , Jack F Vogel , Julian Elischer X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 09:17:12 -0000 On 20 May 2014, at 18:16, Gleb Smirnoff wrote: > Would be cool if most of tools (netstat, systat, etc...) could > determine size of terminal and dynamically widen all their fields. > Thus, tool can run w/o any abbreviations when run in a script mode, > run abbreviated on a small terminal, and run verbose on a wide > terminal. >=20 > This sounds like a generic library providing a special version > of printf(3), which specifies minimal and maximum sizes for fields > and when extra terminal width is available it distributes this > width evenly between all fields. Name it 'elastic printf'. > Sounds like a nice Google SoC project. Or might be that such > library already exists. We have a summer of code project to teach (some of) these tools to = produce a structured, machine-readable, output and write a few generic = tools for processing them. This should make it a lot easier to produce = simple tools that can fit the information that you actually want into a = terminal (or send HTML to netcat, or whatever). David From owner-svn-src-head@FreeBSD.ORG Wed May 21 09:26:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A61F15DD; Wed, 21 May 2014 09:26:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 875732376; Wed, 21 May 2014 09:26:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4L9Q3eZ010325; Wed, 21 May 2014 09:26:03 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4L9Q3hh010322; Wed, 21 May 2014 09:26:03 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405210926.s4L9Q3hh010322@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 21 May 2014 09:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266493 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 09:26:03 -0000 Author: hselasky Date: Wed May 21 09:26:02 2014 New Revision: 266493 URL: http://svnweb.freebsd.org/changeset/base/266493 Log: - Replace some constants with macros. - Need to set the pre-fetch memory address when reading the host memory. - We currently assume that no endianness conversion is needed. Sponsored by: DARPA, AFRL Modified: head/sys/dev/usb/controller/saf1761_otg.c head/sys/dev/usb/controller/saf1761_otg_reg.h Modified: head/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.c Wed May 21 09:19:05 2014 (r266492) +++ head/sys/dev/usb/controller/saf1761_otg.c Wed May 21 09:26:02 2014 (r266493) @@ -253,8 +253,8 @@ saf1761_host_channel_free(struct saf1761 return; /* disable channel */ - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 3), 0); - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 0), 0); + SAF1761_WRITE_4(sc, SOTG_PDT(td->channel) + SOTG_PDT_DW3, 0); + SAF1761_WRITE_4(sc, SOTG_PDT(td->channel) + SOTG_PDT_DW0, 0); switch (td->ep_type) { case UE_INTERRUPT: @@ -299,20 +299,25 @@ static uint8_t saf1761_host_setup_tx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { struct usb_device_request req __aligned(4); + uint32_t pdt_addr; uint32_t status; uint32_t count; + uint32_t temp; if (td->channel < SOTG_HOST_CHANNEL_MAX) { - status = SAF1761_READ_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 3)); - if (status & (1 << 31)) { + pdt_addr = SOTG_PDT(td->channel); + + saf1761_read_host_memory_4(sc, pdt_addr + SOTG_PDT_DW3, &status, 1); + + if (status & SOTG_PDT_DW3_ACTIVE) { goto busy; - } else if (status & (1 << 30)) { + } else if (status & SOTG_PDT_DW3_HALTED) { td->error_stall = 1; td->error_any = 1; - } else if (status & (3 << 28)) { + } else if (status & SOTG_PDT_DW3_ERRORS) { td->error_any = 1; } - count = (status & 0x7FFF); + count = (status & SOTG_PDT_DW3_XFER_COUNT); saf1761_host_channel_free(sc, td); goto complete; @@ -332,26 +337,27 @@ saf1761_host_setup_tx(struct saf1761_otg saf1761_write_host_memory_4(sc, SOTG_DATA_ADDR(td->channel), &req, (count + 3) / 4); - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 7), 0); - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 6), 0); - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 5), 0); - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 4), 0); - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 3), - (1 << 31) | (td->toggle << 25) | (3 << 23)); - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 2), - SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8); - - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 1), - td->dw1_value | - (2 << 10) /* SETUP PID */ | - (td->ep_index >> 1)); - - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 0), - (td->ep_index << 31) | - (1 << 29) /* pkt-multiplier */ | + pdt_addr = SOTG_PDT(td->channel); + + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW7, 0); + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW6, 0); + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW5, 0); + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW4, 0); + + temp = SOTG_PDT_DW3_ACTIVE | (td->toggle << 25) | SOTG_PDT_DW3_CERR; + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW3, temp); + + temp = SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8; + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW2, temp); + + temp = td->dw1_value | (2 << 10) /* SETUP PID */ | (td->ep_index >> 1); + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW1, temp); + + temp = (td->ep_index << 31) | (1 << 29) /* pkt-multiplier */ | (td->max_packet_size << 18) /* wMaxPacketSize */ | (count << 3) /* transfer count */ | - 1 /* valid */); + SOTG_PDT_DW0_VALID; + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW0, temp); td->offset += count; td->remainder -= count; @@ -365,24 +371,29 @@ complete: static uint8_t saf1761_host_bulk_data_rx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { + uint32_t pdt_addr; + uint32_t temp; + if (td->channel < SOTG_HOST_CHANNEL_MAX) { uint32_t status; uint32_t count; uint8_t got_short; - status = SAF1761_READ_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 3)); + pdt_addr = SOTG_PDT(td->channel); + + saf1761_read_host_memory_4(sc, pdt_addr + SOTG_PDT_DW3, &status, 1); - if (status & (1 << 31)) { + if (status & SOTG_PDT_DW3_ACTIVE) { goto busy; - } else if (status & (1 << 30)) { + } else if (status & SOTG_PDT_DW3_HALTED) { td->error_stall = 1; td->error_any = 1; goto complete; - } else if (status & (3 << 28)) { + } else if (status & SOTG_PDT_DW3_ERRORS) { td->error_any = 1; goto complete; } - count = (status & 0x7FFF); + count = (status & SOTG_PDT_DW3_XFER_COUNT); got_short = 0; /* verify the packet byte count */ @@ -435,26 +446,27 @@ saf1761_host_bulk_data_rx(struct saf1761 /* receive one more packet */ - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 7), 0); - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 6), 0); - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 5), 0); - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 4), 0); - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 3), - (1 << 31) | (td->toggle << 25) | (3 << 23)); - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 2), - SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8); - - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 1), - td->dw1_value | - (1 << 10) /* IN-PID */ | - (td->ep_index >> 1)); - - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 0), - (td->ep_index << 31) | - (1 << 29) /* pkt-multiplier */ | + pdt_addr = SOTG_PDT(td->channel); + + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW7, 0); + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW6, 0); + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW5, 0); + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW4, 0); + + temp = SOTG_PDT_DW3_ACTIVE | (td->toggle << 25) | SOTG_PDT_DW3_CERR; + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW3, temp); + + temp = SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8; + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW2, temp); + + temp = td->dw1_value | (1 << 10) /* IN-PID */ | (td->ep_index >> 1); + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW1, temp); + + temp = (td->ep_index << 31) | (1 << 29) /* pkt-multiplier */ | (td->max_packet_size << 18) /* wMaxPacketSize */ | (td->max_packet_size << 3) /* transfer count */ | - 1 /* valid */); + SOTG_PDT_DW0_VALID; + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW0, temp); busy: return (1); /* busy */ complete: @@ -464,18 +476,23 @@ complete: static uint8_t saf1761_host_bulk_data_tx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { + uint32_t pdt_addr; + uint32_t temp; uint32_t count; if (td->channel < SOTG_HOST_CHANNEL_MAX) { uint32_t status; - status = SAF1761_READ_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 3)); - if (status & (1 << 31)) { + pdt_addr = SOTG_PDT(td->channel); + + saf1761_read_host_memory_4(sc, pdt_addr + SOTG_PDT_DW3, &status, 1); + + if (status & SOTG_PDT_DW3_ACTIVE) { goto busy; - } else if (status & (1 << 30)) { + } else if (status & SOTG_PDT_DW3_HALTED) { td->error_stall = 1; td->error_any = 1; - } else if (status & (3 << 28)) { + } else if (status & SOTG_PDT_DW3_ERRORS) { td->error_any = 1; } @@ -508,26 +525,29 @@ saf1761_host_bulk_data_tx(struct saf1761 td->toggle = 1; } - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 7), 0); - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 6), 0); - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 5), 0); - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 4), 0); - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 3), - (1 << 31) | (td->toggle << 25) | (3 << 23)); - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 2), - SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8); - - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 1), - td->dw1_value | - (0 << 10) /* OUT-PID */ | - (td->ep_index >> 1)); - - SAF1761_WRITE_4(sc, SOTG_ISOC_PDT(td->channel) + (4 * 0), - (td->ep_index << 31) | - (1 << 29) /* pkt-multiplier */ | + /* send one more packet */ + + pdt_addr = SOTG_PDT(td->channel); + + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW7, 0); + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW6, 0); + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW5, 0); + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW4, 0); + + temp = SOTG_PDT_DW3_ACTIVE | (td->toggle << 25) | SOTG_PDT_DW3_CERR; + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW3, temp); + + temp = SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8; + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW2, temp); + + temp = td->dw1_value | (0 << 10) /* OUT-PID */ | (td->ep_index >> 1); + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW1, temp); + + temp = (td->ep_index << 31) | (1 << 29) /* pkt-multiplier */ | (td->max_packet_size << 18) /* wMaxPacketSize */ | (count << 3) /* transfer count */ | - 1 /* valid */); + SOTG_PDT_DW0_VALID; + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW0, temp); td->offset += count; td->remainder -= count; Modified: head/sys/dev/usb/controller/saf1761_otg_reg.h ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg_reg.h Wed May 21 09:19:05 2014 (r266492) +++ head/sys/dev/usb/controller/saf1761_otg_reg.h Wed May 21 09:26:02 2014 (r266493) @@ -189,10 +189,25 @@ #define SOTG_PORTSC1_PED (1 << 2) #define SOTG_PORTSC1_ECSC (1 << 1) #define SOTG_PORTSC1_ECCS (1 << 0) +#define SOTG_PDT_DW0 0 +#define SOTG_PDT_DW0_VALID 1U +#define SOTG_PDT_DW1 4 +#define SOTG_PDT_DW2 8 +#define SOTG_PDT_DW3 12 +#define SOTG_PDT_DW3_ACTIVE (1U << 31) +#define SOTG_PDT_DW3_HALTED (1U << 30) +#define SOTG_PDT_DW3_ERRORS (3U << 28) +#define SOTG_PDT_DW3_CERR (3U << 23) +#define SOTG_PDT_DW3_XFER_COUNT 0x7FFF +#define SOTG_PDT_DW4 16 +#define SOTG_PDT_DW5 20 +#define SOTG_PDT_DW6 24 +#define SOTG_PDT_DW7 28 #define SOTG_DATA_ADDR(x) (0x1000 + (512 * (x))) #define SOTG_ASYNC_PDT(x) (0xC00 + ((x) * 32)) #define SOTG_INTR_PDT(x) (0x800 + ((x) * 32)) #define SOTG_ISOC_PDT(x) (0x400 + ((x) * 32)) +#define SOTG_PDT(x) (0x400 + ((x) * 32)) #define SOTG_HC_MEMORY_ADDR(x) (((x) - 0x400) >> 3) #define SOTG_SW_RESET 0x30C #define SOTG_SW_RESET_HC (1 << 1) From owner-svn-src-head@FreeBSD.ORG Wed May 21 09:28:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3D3F801; Wed, 21 May 2014 09:28:36 +0000 (UTC) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 6FBAE23A0; Wed, 21 May 2014 09:28:35 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 275F8D46A6A; Wed, 21 May 2014 19:03:45 +1000 (EST) Date: Wed, 21 May 2014 19:03:44 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jack Vogel Subject: Re: svn commit: r266423 - in head/sys: conf dev/i40e modules/i40e In-Reply-To: Message-ID: <20140521164516.I974@besplex.bde.org> References: <201405190121.s4J1L3qA068339@svn.freebsd.org> <53796149.8060000@freebsd.org> <537B714A.5080500@freebsd.org> <537B726C.1080000@freebsd.org> <20140521014355.V3433@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eojmkOZX c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=JD0ISiim65UA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=bcTnmpMzrbkznxxsaCkA:9 a=a3Fqpw3XbYTMFsea:21 a=n-AMvmRKszQcaNyp:21 a=CjuIK1q_8ugA:10 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Rui Paulo , Bruce Evans , Jack F Vogel , Julian Elischer X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 09:28:36 -0000 On Tue, 20 May 2014, Jack Vogel wrote: > If you don't like the name there's this wonderful feature of ifconfig > > ifconfig i40e0 name eth0 (or whatever pleases you...) Ah, another bug :-). If you use this to make a non-null change to the name, then the name becomes inconsistent with the interrupt name, since the latter is set at driver initialization time and is not updated if the if name is changed. > Oh and Bruce, I did run into the string length issue, so with this driver > the queues > are all named 'q%d', I might go back and change the earlier drivers. Also, there is no way for the user to changes this. setproctitle() only works on non-kernel processes Also, setproctitle() is deficient for renaming even the process name. It renames something from p_comm/ki_comm and doesn't go near ki_tdname. ps and top -a merge ki_comm with the proctitle in a bad way to end up with a bad combination "foo: bar (foo)". More lossage from combining ki_comm with ki_tdname: on freefall now, there are 206 non-kernel threads with more than 1 per process. After removing duplicates, there are just 4 combined names in COLUMNS=1000 top -H output: auditdistd{auditdistd} irssi{irssi} nfsd{nfsd: master} nfsd{nfsd: service} In all cases, the ki_comm name is uselessly repeated in ki_tdname, and in almost all cases ki_td_name is useless for distinguishing the threads. It distinguish the 1 nfsd "master" from the 191 nfsd "services". The "master" is in the same process as the "services". There is also a separate nfsd process with no threads. The names are confusing. According to logic and nfsd(8), all these threads are servers, not services. nfsd(8) says to kill the "master" to kill all the children, but I think the "master" is the independent process and not the thread named "nfsd: master", since killing applies to processes so it makes no sense to have a special thread for killing the others. Indeed, the documentation matches old versions of FreeBSD when the nfsd's were separate processes: FreeBSD-5.2 (now ps laxwH output): % 0 556 1 392 4 0 704 456 accept Is ?? 0:00.01 nfsd: master (nfsd) % 0 558 556 319 4 0 576 324 - I ?? 0:00.00 nfsd: server (nfsd) % 0 559 556 319 4 0 576 324 - I ?? 0:00.00 nfsd: server (nfsd) % ... This also shows the bad combination of ki_comm proctitle, and the name "server" not regressed to "service". -current (ps laxwH): % 0 707 1 0 52 0 20408 1064 select Is - 0:00.03 nfsd: master (nfsd) % 0 709 707 0 52 0 12216 4104 rpcsvc S - 0:01.59 nfsd: server (nfsd) % 0 709 707 0 52 0 12216 4104 rpcsvc I - 0:00.00 nfsd: server (nfsd) Oops, everything is correct for ps output (the only change is to use threads. proctitle(3) is used correctly to add master/server to the name, except it is missing numbering of the servers in both. Numbering is much more needed with the disfustingly bloated number of servers on freefall. It is top that has the bad names. These are only in ki_tdname. ps is broken in another way -- it doesn't show the broken ki_tdname since it doesn't even display ki_tdname for nfsd. (It does display ki_tdname for kernel threads. The bug there is primarily that it uses a different format to top. It also has a keyword "tdnam" for displaying ki_tdname. Bugs in this start with its name not being spelled with an "e" and being undocumented. It is unclear if it is used in standard formats. It is used in some cases in -wH. The editing problems for combining names are especially large for using this keyword. Adding -o any to a standard format makes a mess generally, and adding -o tdnam may or may not duplicate details in the standard format. In practice, ps laxwH -o tdnam gives: ... % 0 0 0 0 -92 0 0 5856 - DLs - 0:00.08 [kernel/igb0 que igb0 que % 0 12 0 0 -92 0 0 1120 - WL - 9:37.90 [intr/irq256: ig irq256: igb0:que % 0 707 1 0 52 0 20408 1064 select Is - 0:00.03 nfsd: master (nf % 0 709 707 0 52 0 12216 4104 rpcsvc S - 0:01.59 nfsd: server (nf nfsd: master % 0 709 707 0 52 0 12216 4104 rpcsvc I - 0:00.00 nfsd: server (nf nfsd: service Various bugs are now more evident: - laxwH contains ki_tdname precisely for kernel threads. So adding -o tdnam gives duplication for igb0 bug not for nfsd* - truncation causes various messes: - the igb0 proctitle and tdnam (sic) get truncated after "que". Even the "]" delimiter is truncated away for igb0 - the nfsd proctitle gets truncated after "nf". The nfsd tdnam doesn't get truncated. FreeBSD-5.2 (top -Ha output): % 556 root 4 0 704K 456K accept 0:00 0.00% nfsd: master (nfsd) % 558 root 4 0 576K 324K - 0:00 0.00% nfsd: server (nfsd) % 561 root 4 0 576K 324K - 0:00 0.00% nfsd: server (nfsd) % ... Nothing changed since there are no threads. I now see that "nfsd: " is part of the proctitle, so the verboseness is not all ps's fault. nfsd didn't ask setproctitle() to not keep the original name, so the extension "master" or "server" was added in an undocumented format (after a colon and a space). Then ps adds the original name in parentheses. It shouldn't add this when the original name is still in the proctitle. Combining these names has similar problem to combining ki_comm with ki_tdnam. With standard parts of the format undocumented, it is difficult to edit away unintentional redundancies. FreeBSD-5.2 (top -Ha output): % 707 root 52 0 20408K 1064K select 6 0:00 0.00% nfsd: master (nfsd) % 709 root 52 0 12216K 4104K rpcsvc 10 0:02 0.00% nfsd: server (nfsd){nfsd: master} % 709 root 52 0 12216K 4104K rpcsvc 13 0:00 0.00% nfsd: server (nfsd){nfsd: service} % ... This is now similar to ps laxwH -o tdnam. The truncation is not quite as bad. For igb0, "intr" and irq261:" are not lost (ps is apparently using a completely different naming scheme for kernel threads. I added tdnam to get the thread name for nfsd*, but it didn't give the thread name for igb0. The thread name for igb0 is "irq261:...". This isn't in the plain laxwH output either. Adding tdnam doubled something other than the thread name for igb0). For nfsd, there is no truncation after "nf". Even more excessive delimiters "[]" are used for kernel threads, but at least they don't get truncated (in this best case with COLUMNS=1000; curses output is of course truncated at the window margin). The following naming regressions are now evident for nfsd: - the proctitle part of the name is unchanged and correct - the ki_tdnam part of the name (delimited by {}) is inconsistent with the proctitle part, and wrong: - it misnames first server thread as "master" - it misnames all the other server threads as "service". ki_tdname is supposed to be the thread name, not fine details of what is in the proctitle. Bruce From owner-svn-src-head@FreeBSD.ORG Wed May 21 10:04:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A88E1FF; Wed, 21 May 2014 10:04:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DE172724; Wed, 21 May 2014 10:04:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4LA4ph8027064; Wed, 21 May 2014 10:04:51 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4LA4pw2027063; Wed, 21 May 2014 10:04:51 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201405211004.s4LA4pw2027063@svn.freebsd.org> From: Hiroki Sato Date: Wed, 21 May 2014 10:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266494 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 10:04:52 -0000 Author: hrs Date: Wed May 21 10:04:51 2014 New Revision: 266494 URL: http://svnweb.freebsd.org/changeset/base/266494 Log: - Fix a bug which can make sysctl() fail when -F is specified. - Increase WID_IF_DEFAULT() from 6 to 8 (the default for AF_INET6) because we have interfaces with longer names than 6 chars like epairN{a,b}. - Style fixes. Modified: head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Wed May 21 09:26:02 2014 (r266493) +++ head/usr.bin/netstat/route.c Wed May 21 10:04:51 2014 (r266494) @@ -230,13 +230,13 @@ pr_family(int af1) #ifndef INET6 #define WID_DST_DEFAULT(af) 18 /* width of destination column */ #define WID_GW_DEFAULT(af) 18 /* width of gateway column */ -#define WID_IF_DEFAULT(af) (Wflag ? 8 : 6) /* width of netif column */ +#define WID_IF_DEFAULT(af) (Wflag ? 10 : 8) /* width of netif column */ #else #define WID_DST_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 33: 18) : 18) #define WID_GW_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 29 : 18) : 18) -#define WID_IF_DEFAULT(af) ((af) == AF_INET6 ? 8 : (Wflag ? 8 : 6)) +#define WID_IF_DEFAULT(af) ((af) == AF_INET6 ? 8 : (Wflag ? 10 : 8)) #endif /*INET6*/ static int wid_dst; @@ -586,17 +586,13 @@ p_rtable_sysctl(int fibnum, int af) mib[4] = NET_RT_DUMP; mib[5] = 0; mib[6] = fibnum; - if (sysctl(mib, nitems(mib), NULL, &needed, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), NULL, &needed, NULL, 0) < 0) err(EX_OSERR, "sysctl: net.route.0.%d.dump.%d estimate", af, fibnum); - } - - if ((buf = malloc(needed)) == 0) { + if ((buf = malloc(needed)) == NULL) errx(2, "malloc(%lu)", (unsigned long)needed); - } - if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) { + if (sysctl(mib, nitems(mib), buf, &needed, NULL, 0) < 0) err(1, "sysctl: net.route.0.%d.dump.%d", af, fibnum); - } lim = buf + needed; for (next = buf; next < lim; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)next; From owner-svn-src-head@FreeBSD.ORG Wed May 21 11:15:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE082F81; Wed, 21 May 2014 11:15:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB1A92C9D; Wed, 21 May 2014 11:15:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4LBFcID057533; Wed, 21 May 2014 11:15:38 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4LBFcPw057532; Wed, 21 May 2014 11:15:38 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405211115.s4LBFcPw057532@svn.freebsd.org> From: Aleksandr Rybalko Date: Wed, 21 May 2014 11:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266495 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 11:15:38 -0000 Author: ray Date: Wed May 21 11:15:38 2014 New Revision: 266495 URL: http://svnweb.freebsd.org/changeset/base/266495 Log: Fix tty locking. o Correct expected values for VT_LOCKSWITCH ioctl. o Check current window for locked state. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Wed May 21 10:04:51 2014 (r266494) +++ head/sys/dev/vt/vt_core.c Wed May 21 11:15:38 2014 (r266495) @@ -280,12 +280,12 @@ vt_proc_window_switch(struct vt_window * struct vt_device *vd; int ret; - if (vw->vw_flags & VWF_VTYLOCK) - return (EBUSY); - vd = vw->vw_device; curvw = vd->vd_curwindow; + if (curvw->vw_flags & VWF_VTYLOCK) + return (EBUSY); + /* Ask current process permitions to switch away. */ if (curvw->vw_smode.mode == VT_PROCESS) { DPRINTF(30, "%s: VT_PROCESS ", __func__); @@ -1814,10 +1814,12 @@ skip_thunk: return (0); case VT_LOCKSWITCH: /* TODO: Check current state, switching can be in progress. */ - if ((*(int *)data) & 0x01) + if ((*(int *)data) == 0x01) + vw->vw_flags &= ~VWF_VTYLOCK; + else if ((*(int *)data) == 0x02) vw->vw_flags |= VWF_VTYLOCK; else - vw->vw_flags &= ~VWF_VTYLOCK; + return (EINVAL); return (0); case VT_OPENQRY: VT_LOCK(vd); From owner-svn-src-head@FreeBSD.ORG Wed May 21 11:53:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79509744; Wed, 21 May 2014 11:53:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6650B2F9E; Wed, 21 May 2014 11:53:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4LBrGL2073951; Wed, 21 May 2014 11:53:16 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4LBrGb6073950; Wed, 21 May 2014 11:53:16 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405211153.s4LBrGb6073950@svn.freebsd.org> From: Aleksandr Rybalko Date: Wed, 21 May 2014 11:53:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266496 - head/usr.bin/lock X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 11:53:16 -0000 Author: ray Date: Wed May 21 11:53:15 2014 New Revision: 266496 URL: http://svnweb.freebsd.org/changeset/base/266496 Log: Sync lock(1) on VT_LOCKSWITCH usage with syscons(4), vt(4) and vidcontrol(1). Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/lock/lock.c Modified: head/usr.bin/lock/lock.c ============================================================================== --- head/usr.bin/lock/lock.c Wed May 21 11:15:38 2014 (r266495) +++ head/usr.bin/lock/lock.c Wed May 21 11:53:15 2014 (r266496) @@ -121,7 +121,7 @@ main(int argc, char **argv) no_timeout = 1; break; case 'v': - vtylock = 1; + vtylock = 0x2; break; case '?': default: @@ -193,7 +193,7 @@ main(int argc, char **argv) (void)tcsetattr(0, TCSADRAIN|TCSASOFT, &tty); err(1, "locking vty"); } - vtyunlock = 0x2; + vtyunlock = 0x1; } /* header info */ From owner-svn-src-head@FreeBSD.ORG Wed May 21 13:36:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6B64CB9; Wed, 21 May 2014 13:36:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6E78280A; Wed, 21 May 2014 13:36:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4LDa4ZF017270; Wed, 21 May 2014 13:36:04 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4LDa4VR017269; Wed, 21 May 2014 13:36:04 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201405211336.s4LDa4VR017269@svn.freebsd.org> From: Steven Hartland Date: Wed, 21 May 2014 13:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266497 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 13:36:04 -0000 Author: smh Date: Wed May 21 13:36:04 2014 New Revision: 266497 URL: http://svnweb.freebsd.org/changeset/base/266497 Log: Added sysctls / tunables for ZFS dirty data tuning Added the following new sysctls / tunables: * vfs.zfs.dirty_data_max * vfs.zfs.dirty_data_max_max * vfs.zfs.dirty_data_max_percent * vfs.zfs.dirty_data_sync * vfs.zfs.delay_min_dirty_percent * vfs.zfs.delay_scale PR: kern/189865 MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Wed May 21 11:53:15 2014 (r266496) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Wed May 21 13:36:04 2014 (r266497) @@ -46,6 +46,11 @@ #include #include +#ifdef __FreeBSD__ +#include +#include +#endif + /* * ZFS Write Throttle * ------------------ @@ -130,33 +135,83 @@ uint64_t zfs_delay_scale = 1000 * 1000 * * per-pool basis using zfs.conf. */ +#ifdef __FreeBSD__ + +extern int zfs_vdev_async_write_active_max_dirty_percent; SYSCTL_DECL(_vfs_zfs); -#if 0 -TUNABLE_INT("vfs.zfs.no_write_throttle", &zfs_no_write_throttle); -SYSCTL_INT(_vfs_zfs, OID_AUTO, no_write_throttle, CTLFLAG_RDTUN, - &zfs_no_write_throttle, 0, ""); -TUNABLE_INT("vfs.zfs.write_limit_shift", &zfs_write_limit_shift); -SYSCTL_INT(_vfs_zfs, OID_AUTO, write_limit_shift, CTLFLAG_RDTUN, - &zfs_write_limit_shift, 0, "2^N of physical memory"); -SYSCTL_DECL(_vfs_zfs_txg); -TUNABLE_INT("vfs.zfs.txg.synctime_ms", &zfs_txg_synctime_ms); -SYSCTL_INT(_vfs_zfs_txg, OID_AUTO, synctime_ms, CTLFLAG_RDTUN, - &zfs_txg_synctime_ms, 0, "Target milliseconds to sync a txg"); - -TUNABLE_QUAD("vfs.zfs.write_limit_min", &zfs_write_limit_min); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, write_limit_min, CTLFLAG_RDTUN, - &zfs_write_limit_min, 0, "Minimum write limit"); -TUNABLE_QUAD("vfs.zfs.write_limit_max", &zfs_write_limit_max); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, write_limit_max, CTLFLAG_RDTUN, - &zfs_write_limit_max, 0, "Maximum data payload per txg"); -TUNABLE_QUAD("vfs.zfs.write_limit_inflated", &zfs_write_limit_inflated); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, write_limit_inflated, CTLFLAG_RDTUN, - &zfs_write_limit_inflated, 0, "Maximum size of the dynamic write limit"); -TUNABLE_QUAD("vfs.zfs.write_limit_override", &zfs_write_limit_override); -SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, write_limit_override, CTLFLAG_RDTUN, - &zfs_write_limit_override, 0, - "Force a txg if dirty buffers exceed this value (bytes)"); + +TUNABLE_QUAD("vfs.zfs.dirty_data_max", &zfs_dirty_data_max); +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_max, CTLFLAG_RWTUN, + &zfs_dirty_data_max, 0, + "The dirty space limit in bytes after which new writes are halted until " + "space becomes available"); + +TUNABLE_QUAD("vfs.zfs.dirty_data_max_max", &zfs_dirty_data_max_max); +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_max_max, CTLFLAG_RDTUN, + &zfs_dirty_data_max_max, 0, + "The absolute cap on diry_data_max when auto calculating"); + +TUNABLE_INT("vfs.zfs.dirty_data_max_percent", &zfs_dirty_data_max_percent); +SYSCTL_INT(_vfs_zfs, OID_AUTO, dirty_data_max_percent, CTLFLAG_RDTUN, + &zfs_dirty_data_max_percent, 0, + "The percent of physical memory used to auto calculate dirty_data_max"); + +TUNABLE_QUAD("vfs.zfs.dirty_data_sync", &zfs_dirty_data_sync); +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_sync, CTLFLAG_RWTUN, + &zfs_dirty_data_sync, 0, + "Force at txg if the number of dirty buffer bytes exceed this value"); + +static int sysctl_zfs_delay_min_dirty_percent(SYSCTL_HANDLER_ARGS); +/* No zfs_delay_min_dirty_percent tunable due to limit requirements */ +SYSCTL_PROC(_vfs_zfs, OID_AUTO, delay_min_dirty_percent, + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(int), + sysctl_zfs_delay_min_dirty_percent, "I", + "The limit of outstanding dirty data before transations are delayed"); + +static int sysctl_zfs_delay_scale(SYSCTL_HANDLER_ARGS); +/* No zfs_delay_scale tunable due to limit requirements */ +SYSCTL_PROC(_vfs_zfs, OID_AUTO, delay_scale, + CTLTYPE_U64 | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(uint64_t), + sysctl_zfs_delay_scale, "QU", + "Controls how quickly the delay approaches infinity"); + +static int +sysctl_zfs_delay_min_dirty_percent(SYSCTL_HANDLER_ARGS) +{ + int val, err; + + val = zfs_delay_min_dirty_percent; + err = sysctl_handle_int(oidp, &val, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + if (val < zfs_vdev_async_write_active_max_dirty_percent) + return (EINVAL); + + zfs_delay_min_dirty_percent = val; + + return (0); +} + +static int +sysctl_zfs_delay_scale(SYSCTL_HANDLER_ARGS) +{ + uint64_t val; + int err; + + val = zfs_delay_scale; + err = sysctl_handle_64(oidp, &val, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + if (val > UINT64_MAX / zfs_dirty_data_max) + return (EINVAL); + + zfs_delay_scale = val; + + return (0); +} #endif hrtime_t zfs_throttle_delay = MSEC2NSEC(10); From owner-svn-src-head@FreeBSD.ORG Wed May 21 16:01:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AF0C359; Wed, 21 May 2014 16:01:29 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 46B6E247C; Wed, 21 May 2014 16:01:28 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 3EFBCD655B5; Thu, 22 May 2014 02:01:19 +1000 (EST) Date: Thu, 22 May 2014 02:01:18 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Peter Wemm Subject: Re: svn commit: r266423 - in head/sys: conf dev/i40e modules/i40e In-Reply-To: <537B9BFE.4010304@wemm.org> Message-ID: <20140522014840.H974@besplex.bde.org> References: <201405190121.s4J1L3qA068339@svn.freebsd.org> <53796149.8060000@freebsd.org> <537B714A.5080500@freebsd.org> <537B726C.1080000@freebsd.org> <20140521014355.V3433@besplex.bde.org> <537B9BFE.4010304@wemm.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=QIpRGG7L c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=JD0ISiim65UA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=mGqkz-j3yaw_C7h8dYkA:9 a=Q5pyhGHwbYprPueF:21 a=sGZJodiVctteXxoK:21 a=CjuIK1q_8ugA:10 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Jack Vogel , Bruce Evans , Jack F Vogel , Julian Elischer , Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 16:01:29 -0000 Mostly off-topic: On Tue, 20 May 2014, Peter Wemm wrote: > On 5/20/14, 9:08 AM, Jack Vogel wrote: >> ... >> Log: >> This is the beta release of the driver for the new >> Intel 40G Ethernet Controller XL710 Family. >> ... He didn't write it quite like that, and in another mail mangling program it was displayed as: Log: This is the beta release of the driver for the new Intel 40G Ethernet Controller XL710 Family. Hopefully this doesn't get demangled (the original had about 1 line after "Log:". This was mangled to 2 lines when it got to my editor, with quotes broken but some still present, but in my bad mail program it was displayed in 18 lines with 1 word per line, and with quotes completely broken. Good for small screens, but even I don't want formatting for 10-column terminals. This is the worst I've seen in mail. Normally the bugs go the other way, with lines joined and different bad mail programs displaying them differently. In usenet lately, Gurgle goops has been mangling the line feeds much more, usually by doubling them on every followup, so their number is exponential in the number of followups. Bruce From owner-svn-src-head@FreeBSD.ORG Wed May 21 16:03:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84927549; Wed, 21 May 2014 16:03:44 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 237E224AB; Wed, 21 May 2014 16:03:43 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.8/8.14.8) with ESMTP id s4LG3ZEw089209; Wed, 21 May 2014 19:03:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s4LG3ZEw089209 Received: (from kostik@localhost) by tom.home (8.14.8/8.14.8/Submit) id s4LG3ZAr089208; Wed, 21 May 2014 19:03:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 21 May 2014 19:03:35 +0300 From: Konstantin Belousov To: Scott Long Subject: Re: svn commit: r266481 - head/sys/x86/x86 Message-ID: <20140521160335.GT74331@kib.kiev.ua> References: <201405202243.s4KMhIRu033126@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uquXjW9+X8a4Yk6h" Content-Disposition: inline In-Reply-To: <201405202243.s4KMhIRu033126@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 16:03:44 -0000 --uquXjW9+X8a4Yk6h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 20, 2014 at 10:43:18PM +0000, Scott Long wrote: > Author: scottl > Date: Tue May 20 22:43:17 2014 > New Revision: 266481 > URL: http://svnweb.freebsd.org/changeset/base/266481 >=20 > Log: > Old PCIe implementations cannot allow a DMA transfer to cross a 4GB > boundary. This was addressed several years ago by creating a parent > tag hierarchy for the root buses that set the boundary restriction > for appropriate buses and allowed child deviced to inherit it. > Somewhere along the way, this restriction was turned into a case for > marking the tag as a candidate for needing bounce buffers, instead > of just splitting the segment along the boundary line. This flag > also causes all maps associated with this tag to be non-NULL, which > in turn causes bus_dmamap_sync() to take the slow path of function > pointer indirection to discover that there's no bouncing work to > do. The end result is a lot of pages set aside in bounce pools > that will never be used, and a slow path for data buffers in nearly > every DMA-capable PCIe device. For example, our workload at Netflix > was spending nearly 1% of all CPU time going through this slow path. > =20 > Fix this problem by being more selective about when to set the > COULD_BOUNCE flag. Only set it when the boundary restriction > exists and the consumer cannot do more than a single DMA segment > at once. This fixes the case of dynamic buffers (mbufs, bio's) > but doesn't address static buffers allocated from bus_dmamem_alloc(). > That case will be addressed in the future. > =20 > For those interested, this was discovered thanks to Dtrace Flame > Graphs. > =20 > Discussed with: jhb, kib > Obtained from: Netflix, Inc. > MFC after: 3 days >=20 > Modified: > head/sys/x86/x86/busdma_bounce.c >=20 > Modified: head/sys/x86/x86/busdma_bounce.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/x86/x86/busdma_bounce.c Tue May 20 22:11:52 2014 (r266480) > +++ head/sys/x86/x86/busdma_bounce.c Tue May 20 22:43:17 2014 (r266481) > @@ -172,12 +172,35 @@ bounce_bus_dma_tag_create(bus_dma_tag_t=20 > newtag->map_count =3D 0; > newtag->segments =3D NULL; > =20 > + /* > + * Bouncing might be needed if there's a filter. > + * XXX Filters are likely broken as there's no way to > + * guarantee that bounce pages will also satisfy the > + * filter requirement. > + */ > if (parent !=3D NULL && ((newtag->common.filter !=3D NULL) || > ((parent->common.flags & BUS_DMA_COULD_BOUNCE) !=3D 0))) > newtag->common.flags |=3D BUS_DMA_COULD_BOUNCE; > =20 > - if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem) || > - newtag->common.alignment > 1) > + /* > + * Bouncing might be needed if there's an upper memory > + * restriction. > + */ > + if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem)) > + newtag->common.flags |=3D BUS_DMA_COULD_BOUNCE; > + > + /* > + * Bouncing might be needed if there's an alignment > + * restriction that can't be satisfied by breaking up > + * the segment. > + * XXX Need to consider non-natural alignment. > + * XXX Static allocations that tie to bus_dmamem_alloc() > + * will likely pass this test and be penalized with > + * the COULD_BOUNCE flag. Should probably have > + * bus_dmamem_alloc() clear this flag. > + */ > + if ((newtag->common.nsegments <=3D 1) && > + (newtag->common.alignment > 1)) > newtag->common.flags |=3D BUS_DMA_COULD_BOUNCE; > =20 > if (((newtag->common.flags & BUS_DMA_COULD_BOUNCE) !=3D 0) && You changed the handling of the alignment, which is probably not correct. The problematic parameter, if any, is boundary. --uquXjW9+X8a4Yk6h Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJTfM5WAAoJEJDCuSvBvK1BWSoP/1Xw9my9yPXgROku55QRi+Bi Ccatu/hRWZN5Z6B/+3ZbAHAp+lUPKXlMsUjMJTvjqW9iJsoU/91Znffn8hglmEd7 OYtAcDH+blImaoB7ooidg5IUmiiuiuSHmJqTLCRzwQcGPPixhtwZNKRCABm5Sn2g MTS74zPm8gJGZBcLhUG3r/pA9sWs4MEMqAgTeAyAfr1S4pgiu+e634e32mklx0nc hZBjgp5ihTYntaF4Xf+2ylDC/R2rzjTTdpnasevwcQu57XUW0dXhvsG/9BUHpdOc 3jlJnY/Ysx/pJbxYbO47MdW0qZuW8DoV3okQkXoGiqMLJFVerbU8DVU1NDiqA9aU llkVKrnLMIFY8qW2SgmEPqLxrjaTZ32U52rZ/rwjgLsQfyuziqpfzYg/1R7QYLkW wV6WMIvEQxqujE4xkdJfWbsiSoplpUyIV65tKLacIDBMPKUWv/IyX7ayZte9dyAK NTSCLmbW/CbWsh3YKT+joIjOk6NqE4s7cO/Q9+VLg1q0Hvf3V6acRkD8Vva56Ybf O0NFzwLTqucb4SGr4/4byxONC9+q/kzM41LHii9BSvByBaLjRSqs4AYQHmD+ZqKH OW1N0CDJyHsNOt2urLFlSQpBCimKDpv+FANCDIZiG3H6kAbL3M6z8y8SM2CaqvMN t2ycXMRzYWfw5Dgt2qjZ =i9mV -----END PGP SIGNATURE----- --uquXjW9+X8a4Yk6h-- From owner-svn-src-head@FreeBSD.ORG Wed May 21 16:06:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C74A66BF; Wed, 21 May 2014 16:06:14 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 4867724CB; Wed, 21 May 2014 16:06:14 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 68BE0781770; Thu, 22 May 2014 01:43:31 +1000 (EST) Date: Thu, 22 May 2014 01:43:31 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gleb Smirnoff Subject: Re: svn commit: r266423 - in head/sys: conf dev/i40e modules/i40e In-Reply-To: <20140520171613.GM50679@FreeBSD.org> Message-ID: <20140521190353.U974@besplex.bde.org> References: <201405190121.s4J1L3qA068339@svn.freebsd.org> <53796149.8060000@freebsd.org> <20140520223516.R2836@besplex.bde.org> <20140520171613.GM50679@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=QIpRGG7L c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=JD0ISiim65UA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=AXO4mayRf3EEWKXxS8gA:9 a=ItVfWD_4TXz5l3mK:21 a=ur02btxSU7qdEW1z:21 a=CjuIK1q_8ugA:10 a=xW-gOTbM36EA:10 a=y9Lmiy5wWV0A:10 a=HwfidlGBIzgA:10 a=O_wSirOHFWgA:10 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Rui Paulo , Bruce Evans , Jack F Vogel , Julian Elischer X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 16:06:14 -0000 On Tue, 20 May 2014, Gleb Smirnoff wrote: > On Tue, May 20, 2014 at 11:40:01PM +1000, Bruce Evans wrote: > B> Also, verbose names break formatting. E.g., netstat -r has 5 columns > B> available under Netif for the driver name and device number. netstat > B> -i has about the same under Name (possibly 1 or 2 not directly under > B> Name, but reserved for the Name column). systat has 3 columns > B> available, but with a more flexible format that truncates other info. > B> All driver name+numbers are broken now on freefall: > > We must admit that nowadays 80x25 terminal is not enough :( Yes, much smaller formats are needed now for small portable screens. My phone is low-end so it is 29 or 30 wide. 80 is also too wide. Most books use more like 60. Most (?) newspapers use more like 30, with many columns. > Would be cool if most of tools (netstat, systat, etc...) could > determine size of terminal and dynamically widen all their fields. You mean, determine the size and dynamically narrow all their fields :-). This is hard to do. Curses-based applications like top and systat should do a combination of horizontal and vertical scrolling and variant displays, but this is also hard to do. top and systat already have some variant displays but are too simple to do much. You can send raw output to a terminal or window that does the scrolling, but this doesn't work for repeated output. > Thus, tool can run w/o any abbreviations when run in a script mode, > run abbreviated on a small terminal, and run verbose on a wide > terminal. > > This sounds like a generic library providing a special version > of printf(3), which specifies minimal and maximum sizes for fields > and when extra terminal width is available it distributes this > width evenly between all fields. Name it 'elastic printf'. > Sounds like a nice Google SoC project. Or might be that such > library already exists. Try doing that with systat -v output. Even programming tools for generating fixed forms like the ones used in systat are deficient in FreeBSD. All screen locations are almost hard-coded (just as offsets) and hard to change. Some of this is from primitive use of curses, with no subwindows. Before doing that, just handle arbitrary columnar output (with headers) in a filter. This can almost be done in an awk script. Field separators might be a problem. Consider "vmstat 1 output". It is messed up by the header being 2 lines with the first line not being in normal columnar format (some of its keywords are for multiple columns). A dumb filter can handle headers without knowing that they are special provided they are in columnar format, but even this minor complication seems to be difficult to handle without knowing what the headers mean. Here is a not so dumb filter using awk. vmstat output is so broken in -current that even this simple filter improves the formatting significantly. @BEGIN { @ columns = 79 # XXX @} @ @{ @ # Determine fields and field widths for current line. @ # awk's field splitting feature turned out to be inadequate, @ # and this would be even easier in C. @ n = split($0, a, "") @ f = 1 @ j = 1 @ while (j <= n) { @ cpw[f] = 0; @ cfw[f] = 0; @ while (j <= n && a[j] == " ") { @ cpw[f]++ # current (left) padding width @ j++ @ } @ while (j <= n && a[j] != " ") { @ cfw[f]++ # current field width without padding @ j++ @ } @ fld[f] = substr($0, j - cfw[f], cfw[f]) @ f++ @ } @ nf = f # no need to use or trust NF @ @ if (NR == 1 || NR < 10 && nf != anf) { @ # Make current field widths active. When NR > 1, this @ # discards the previous active field widths. Good enough @ # for vmstat, where the widths from NR == 1 are garbage. @ anf = nf @ for (f = 1; f <= anf; f++) @ afw[f] = cpw[f] + cfw[f] @ @ # Convert current (unpadded) field widths to minumum (padded) @ # field widths. @ mfw[1] = cfw[1] @ for (f = 2; f <= anf; f++) @ mfw[f] = 1 + cfw[f] @ } else if (nf != anf) { @ # Some non-tabular line after warming up. Probably an ornate @ # line in the next header. Too hard to handle properly. @ printf("%.*s\n", columns, $0) @ fflush(stdout) @ next @ } else { @ # Update and minimum field widths if this line needs @ # wider fields. @ if (afw[1] < cfw[1]) @ afw[1] = cfw[1] @ len = afw[1] @ if (mfw[1] < cfw[1]) @ mfw[1] = cfw[1] @ for (f = 2; f <= nf; f++) { @ if (afw[f] < cfw[f] + 1) @ afw[f] = cfw[f] + 1 @ len += afw[f] @ if (mfw[f] < cfw[f] + 1) @ mfw[f] = cfw[f] + 1 @ } @ @ # But if the line would be too wide, reset the active field @ # widths to minimum ones. @ if (len > columns) @ for (f = 1; f <= nf; f++) @ afw[f] = mfw[f] @ } @ s = "" @ for (f = 1; f <= nf; f++) @ s = s sprintf("%*s", afw[f], fld[f]) @ printf("%.*s\n", columns, s) @ fflush(stdout) @} Examples: vmstat wasn't broken in FreeBSD-5.2, at least in my version: ttyv2:bde@besplex:/tmp/s1> vmstat 1 procs memory page disks faults cpu r b w avm fre flt re pi po fr sr ad0 ad1 in sy cs us sy id 0 0 0 48928 905436 8 0 0 0 6 0 0 0 235 52 596 0 0 100 0 0 0 48928 905436 0 0 0 0 2 0 2 0 234 107 587 0 0 100 0 0 0 48928 905436 0 0 0 0 0 0 0 0 231 107 580 0 0 100 ... 0 0 0 48928 905436 0 0 0 0 0 0 0 0 232 107 582 0 0 100 procs memory page disks faults cpu r b w avm fre flt re pi po fr sr ad0 ad1 in sy cs us sy id 0 0 0 48928 905436 0 0 0 0 0 0 0 0 231 120 581 0 0 100 0 0 0 48928 905436 0 0 0 0 0 0 0 0 231 107 579 0 0 100 0 0 0 48928 905436 0 0 0 0 0 0 0 0 231 115 580 0 0 100 Running this through the filter makes little difference: ttyv2:bde@besplex:/tmp/s1> vmstat 1 |awk -f z procs memory page disks faults cpu r b w avm fre flt re pi po fr sr ad0 ad1 in sy cs us sy id 0 1 0 49408 905232 8 0 0 0 6 0 0 0 235 52 596 0 0 100 0 1 0 49480 905176 14 0 0 0 0 0 0 0 232 118 583 0 0 100 0 1 0 49480 905176 0 0 0 0 0 0 0 0 231 117 582 0 0 100 ... procs memory page disks faults cpu r b w avm fre flt re pi po fr sr ad0 ad1 in sy cs us sy id 0 1 0 49480 905176 0 0 0 0 0 0 0 0 233 115 587 0 0 100 0 1 0 49480 905176 0 0 0 0 0 0 0 0 232 118 584 1 0 99 1 1 0 49480 905176 0 0 0 0 0 0 0 0 231 109 581 0 0 100 The filter just eventually fixes the misformatting of 100% by right justifying its header. The formatting is %2.0f under "id", but 100 doesn't fit. 100 also wouldn't fit under us or sy, but only id is often 100. This last worked in about 1985 where 100 was impossible for id too, since just running vmstat every second took more than 1% CPU. The broken output in -current looks like this in on freefall: pts/18:bde@freefall:~/s> vmstat 1 procs memory page disks faults cpu r b w avm fre flt re pi po fr sr da0 da1 in sy cs us sy i d 0 0 16 7312M 755M 751 2 2 0 1531 158 0 0 1850 1678 251 1 1 98 0 0 16 7312M 755M 46 0 0 0 88 25 0 0 751 610 2456 0 0 100 0 0 16 7384M 752M 551 0 0 0 186 25 0 0 722 1133 2374 0 0 100 ... procs memory page disks faults cpu r b w avm fre flt re pi po fr sr da0 da1 in sy cs us sy i d 1 0 16 7541M 744M 2172 0 0 0 1566 28 0 0 1012 76327 18683 1 2 97 1 0 16 7420M 746M 913 0 0 0 1744 27 0 0 1067 104617 20083 1 4 95 1 0 16 7487M 740M 1970 0 0 0 755 28 44 45 1496 124350 23887 1 5 94 I used a vidcontrol screen dump to preserve its full uglyness. Note that the header formatting has been destroyed even though it is not dynamic: - the first line of the header was not updated when the second line was expanded (except "cpu" was moved slightly, but it has an off by 1 error in the move) - the second header line is unconditionally too wide for an 80 column terminal Note that avm and fre are now formatted in dehumanized (scientific) form. My 5.2 system doesn't have much memory, so it doesn't need this. This makes avm and fre narrow enough to fit, but the formatting is otherwise broken so they don't. The "M" part never fits under the header. This might be intentional, but it looks strange. It is actually clearly unintentional since all the fields after avm and fre, through in, are similarly misaligned with the header. Then the bugs are from dynamic values being too large: - despite expansion of the faults sy, the value is often too large to fit, so the fields from that point are shifted by 1 or 2 more more relative to the header. - the cpu cs has been expanded too, but not enough for all cases - the worst cases don't all occur on the same line, so the maximum shift relative to the header is 4. When the output is not to a terminal, vmstat no longer dehumanizes some large numbers: pts/18:bde@freefall:~/s> vmstat 1|cat procs memory page disks faults cpu r b w avm fre flt re pi po fr sr da0 da1 in sy cs us sy i d 0 0 16 7504352 751956 752 2 2 0 1532 157 0 0 1850 1691 259 1 1 98 0 0 16 7500132 751900 118 0 0 0 164 50 1 1 726 476 2423 0 0 100 ... procs memory page disks faults cpu r b w avm fre flt re pi po fr sr da0 da1 in sy cs us sy i d 0 0 16 7500132 751924 547 0 0 0 1522 25 0 0 747 1218 2639 0 0 100 0 0 16 7500132 751924 46 0 0 0 88 25 0 0 668 348 2324 0 0 100 Note that the dehumanization didn't even improve the formatting in this case. The off-by-1 error in the field width and/or alignment gives just enough space for the large avm. freefall became less active while I was testing this, so many of the numbers aren't so large now. The filter cleans this up to: pts/18:bde@freefall:~/s> vmstat 1|awk -f ../z procs memory page disks faults cpu r b w avm fre flt re pi po fr sr da0 da1 in sy cs us sy 2 0 16 7542196 812772 753 2 2 0 1532 157 0 0 1850 1694 260 1 1 98 0 0 16 7558808 809868 220 0 0 0 4117 27 0 0 6661 1392 18283 2 1 97 0 0 16 7558808 807060 46 0 0 0 3993 27 23 23 6640 1122 19186 2 1 97 1 0 16 7558808 804252 46 0 0 0 3995 27 28 27 6629 1131 19041 2 2 97 1 0 16 7750064 796536 1793 0 0 0 4761 27 0 0 6348 3978 17538 1 2 97 0 0 16 7750064 793648 46 0 0 0 4101 28 0 0 6304 1143 17556 1 1 97 ... procs memory page disks faults cpu r b w avm fre flt re pi po fr sr da0 da1 in sy cs us sy id 1 0 16 7591172 756388 112 0 0 0 5173 28 0 0 6389 1169 17547 2 1 97 0 0 16 7654924 752004 1967 0 0 0 6374 29 0 0 6621 3846 18279 2 2 97 0 0 16 7600364 754668 586 0 0 0 3416 28 54 54 3584 1618 12072 1 1 98 0 0 16 7409108 759696 104 0 0 0 1402 27 0 0 457 488 1428 0 0 100 0 0 16 7600364 754668 1804 0 0 0 934 25 0 0 454 3303 1544 0 0 100 It took a while to stabilize, and significant activity would push it to a stable setting wanting more than 80 columns. Dehumanized numbers for just avm would help avoid this. Note that the filter never shrinks the columns except once to squeeze out spaces in the header. It is too simple to do that. It also responds too quickly to transient changes. netstat -i is also broken in -current (netstat -r in -current shows less details so it fits easil): pts/18:bde@freefall:~/s> netstat -i Name Mtu Network Address Ipkts Ierrs Idrop Opkts Oerrs Coll igb0 1500 68:b5:99:b5:2a:02 2821384398 0 0 1778806163 0 0 igb0 - 8.8.178.128/2 freefall 217503944 - - 175357038 - - igb0 - fe80::6ab5:99 fe80::6ab5:99ff:f 104258 - - 104297 - - igb0 - freefall.free 2001:1900:2254:20 2576868711 - - 1641398377 - - igb0 - 8.8.178.141/3 people 24407600 - - 0 - - igb0 - people.freebs 2001:1900:2254:20 1171548 - - 642454 - - igb1 1500 68:b5:99:b5:2a:03 0 0 0 0 0 0 lo0 16384 2466053 0 0 2466037 0 0 lo0 - localhost ::1 55872 - - 55992 - - lo0 - fe80::1%lo0 fe80::1%lo0 0 - - 0 - - lo0 - your-net localhost 2402292 - - 2410186 - - The filter cleans this up to: pts/18:bde@freefall:~/s> netstat -i|awk -f ../z Name Mtu Network Address Ipkts Ierrs Idrop Opkts Oerrs igb0 1500 68:b5:99:b5:2a:02 2821393981 0 0 1778816441 0 igb0 - 8.8.178.128/2 freefall 217504375 - - 175357732 igb0 - fe80::6ab5:99 fe80::6ab5:99ff:f 104261 - - 104300 igb0 - freefall.free 2001:1900:2254:20 2576877564 - - 1641408119 igb0 - 8.8.178.141/3 people 24407836 - - 0 igb0 - people.freebs 2001:1900:2254:20 1171564 - - 642460 igb1 1500 68:b5:99:b5:2a:03 0 0 0 0 lo0 16384 2466061 0 0 2466045 0 lo0 - localhost ::1 55872 - - 55992 - lo0 - fe80::1%lo0 fe80::1%lo0 0 - - 0 - lo0 - your-net localhost 2402300 - - 2410194 - It looks almost readable at first, but further examination shows that the filter is not working as intended. The Coll field got truncated away fairly cleanly, and the first line for lo0 is unparseable since it has spaces instead of "-" for the Address field. The second of these breaks the header hack. After modifying the hack, it works to pass 2 copies through the filter and discard the first half: pts/18:bde@freefall:~/s> cat z Name Mtu Network Address Ipkts Ierrs Idrop Opkts Oer igb0 1500 68:b5:99:b5:2a:02 2822276782 0 0 1779538929 igb0 - 8.8.178.128/2 freefall 217533292 - - 175425951 igb0 - fe80::6ab5:99 fe80::6ab5:99ff:f 104397 - - 104436 igb0 - freefall.free 2001:1900:2254:20 2577700440 - - 1642086286 igb0 - 8.8.178.141/3 people 24435004 - - 0 igb0 - people.freebs 2001:1900:2254:20 1173149 - - 643437 igb1 1500 68:b5:99:b5:2a:03 0 0 0 0 lo0 16384 2467437 0 0 2467421 0 lo0 - localhost ::1 55880 - - 56000 lo0 - fe80::1%lo0 fe80::1%lo0 0 - - 0 lo0 - your-net localhost 2403657 - - 2411562 Now Oerrs is truncated too (uncleanly), and the first lo0 line remains unfixable. It accidentally almost lines up with the header, since only the Opkts field in the header got moved. Note that the second igb0 field is obviously truncated before it gets to the filter. The full field can be seen using netstat -rn, and is 8 characters wider. Many of the other fields are truncated. This is less clear, but all of the Address fields that use the full field are probably truncated. netstat -rn uses a separate format with very wide fields for the inet6 case to avoid this problem. This is ugly in a different way. Bruce From owner-svn-src-head@FreeBSD.ORG Wed May 21 16:52:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B61357E4; Wed, 21 May 2014 16:52:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A26522982; Wed, 21 May 2014 16:52:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4LGqtUu002224; Wed, 21 May 2014 16:52:55 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4LGqtOC002222; Wed, 21 May 2014 16:52:55 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405211652.s4LGqtOC002222@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 21 May 2014 16:52:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266505 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 16:52:55 -0000 Author: hselasky Date: Wed May 21 16:52:55 2014 New Revision: 266505 URL: http://svnweb.freebsd.org/changeset/base/266505 Log: - Split transmit queue into one for each type. Apparently there will be a race when using a single active queue for all transmit types. - Last argument of usb_pause_mtx() is ticks and not milliseconds. - Remove unused watchdog. - Remove some unused fields from the RSU softc structure. - Workaround usbd_transfer_start() recursion from inside of completion callback. MFC after: 3 days Modified: head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rsureg.h Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Wed May 21 16:50:22 2014 (r266504) +++ head/sys/dev/usb/wlan/if_rsu.c Wed May 21 16:52:55 2014 (r266505) @@ -128,7 +128,10 @@ static const STRUCT_USB_HOST_ID rsu_devs static device_probe_t rsu_match; static device_attach_t rsu_attach; static device_detach_t rsu_detach; -static usb_callback_t rsu_bulk_tx_callback; +static usb_callback_t rsu_bulk_tx_callback_0; +static usb_callback_t rsu_bulk_tx_callback_1; +static usb_callback_t rsu_bulk_tx_callback_2; +static usb_callback_t rsu_bulk_tx_callback_3; static usb_callback_t rsu_bulk_rx_callback; static usb_error_t rsu_do_request(struct rsu_softc *, struct usb_device_request *, void *); @@ -187,11 +190,10 @@ static int rsu_raw_xmit(struct ieee80211 const struct ieee80211_bpf_params *); static void rsu_init(void *); static void rsu_init_locked(struct rsu_softc *); -static void rsu_watchdog(void *); static int rsu_tx_start(struct rsu_softc *, struct ieee80211_node *, - struct mbuf *, struct rsu_data *, struct usb_xfer *); + struct mbuf *, struct rsu_data *); static void rsu_start(struct ifnet *); -static void rsu_start_locked(struct ifnet *, struct usb_xfer *); +static void rsu_start_locked(struct ifnet *); static int rsu_ioctl(struct ifnet *, u_long, caddr_t); static void rsu_stop(struct ifnet *, int); static void rsu_stop_locked(struct ifnet *, int); @@ -241,7 +243,7 @@ static const struct usb_config rsu_confi .pipe_bof = 1, .force_short_xfer = 1 }, - .callback = rsu_bulk_tx_callback, + .callback = rsu_bulk_tx_callback_0, .timeout = RSU_TX_TIMEOUT }, [RSU_BULK_TX_BK] = { @@ -254,7 +256,7 @@ static const struct usb_config rsu_confi .pipe_bof = 1, .force_short_xfer = 1 }, - .callback = rsu_bulk_tx_callback, + .callback = rsu_bulk_tx_callback_1, .timeout = RSU_TX_TIMEOUT }, [RSU_BULK_TX_VI] = { @@ -267,7 +269,7 @@ static const struct usb_config rsu_confi .pipe_bof = 1, .force_short_xfer = 1 }, - .callback = rsu_bulk_tx_callback, + .callback = rsu_bulk_tx_callback_2, .timeout = RSU_TX_TIMEOUT }, [RSU_BULK_TX_VO] = { @@ -280,7 +282,7 @@ static const struct usb_config rsu_confi .pipe_bof = 1, .force_short_xfer = 1 }, - .callback = rsu_bulk_tx_callback, + .callback = rsu_bulk_tx_callback_3, .timeout = RSU_TX_TIMEOUT }, }; @@ -316,7 +318,6 @@ rsu_attach(device_t self) MTX_DEF); TIMEOUT_TASK_INIT(taskqueue_thread, &sc->calib_task, 0, rsu_calib_task, sc); - callout_init(&sc->sc_watchdog_ch, 0); iface_index = 0; error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, @@ -428,7 +429,6 @@ rsu_detach(device_t self) usbd_transfer_unsetup(sc->sc_xfer, RSU_N_TRANSFER); ieee80211_ifdetach(ic); - callout_drain(&sc->sc_watchdog_ch); taskqueue_drain_timeout(taskqueue_thread, &sc->calib_task); /* Free Tx/Rx buffers. */ @@ -598,9 +598,12 @@ rsu_alloc_tx_list(struct rsu_softc *sc) if (error != 0) return (error); - STAILQ_INIT(&sc->sc_tx_active); STAILQ_INIT(&sc->sc_tx_inactive); - STAILQ_INIT(&sc->sc_tx_pending); + + for (i = 0; i != RSU_MAX_TX_EP; i++) { + STAILQ_INIT(&sc->sc_tx_active[i]); + STAILQ_INIT(&sc->sc_tx_pending[i]); + } for (i = 0; i < RSU_TX_LIST_COUNT; i++) { STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, &sc->sc_tx[i], next); @@ -843,10 +846,12 @@ rsu_read_rom(struct rsu_softc *sc) static int rsu_fw_cmd(struct rsu_softc *sc, uint8_t code, void *buf, int len) { + const uint8_t which = RSU_BULK_TX_VO - RSU_BULK_TX_BE; struct rsu_data *data; struct r92s_tx_desc *txd; struct r92s_fw_cmd_hdr *cmd; - int cmdsz, xferlen; + int cmdsz; + int xferlen; data = rsu_getbuf(sc); if (data == NULL) @@ -879,8 +884,8 @@ rsu_fw_cmd(struct rsu_softc *sc, uint8_t DPRINTFN(2, "Tx cmd code=0x%x len=0x%x\n", code, cmdsz); data->buflen = xferlen; - STAILQ_INSERT_TAIL(&sc->sc_tx_pending, data, next); - usbd_transfer_start(sc->sc_xfer[RSU_BULK_TX_VO]); + STAILQ_INSERT_TAIL(&sc->sc_tx_pending[which], data, next); + usbd_transfer_start(sc->sc_xfer[which + RSU_BULK_TX_BE]); return (0); } @@ -1574,13 +1579,13 @@ rsu_txeof(struct usb_xfer *xfer, struct ieee80211_free_node(data->ni); data->ni = NULL; } - sc->sc_tx_timer = 0; ifp->if_opackets++; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } static void -rsu_bulk_tx_callback(struct usb_xfer *xfer, usb_error_t error) +rsu_bulk_tx_callback_sub(struct usb_xfer *xfer, usb_error_t error, + uint8_t which) { struct rsu_softc *sc = usbd_xfer_softc(xfer); struct ifnet *ifp = sc->sc_ifp; @@ -1590,37 +1595,36 @@ rsu_bulk_tx_callback(struct usb_xfer *xf switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - data = STAILQ_FIRST(&sc->sc_tx_active); + data = STAILQ_FIRST(&sc->sc_tx_active[which]); if (data == NULL) goto tr_setup; DPRINTF("transfer done %p\n", data); - STAILQ_REMOVE_HEAD(&sc->sc_tx_active, next); + STAILQ_REMOVE_HEAD(&sc->sc_tx_active[which], next); rsu_txeof(xfer, data); STAILQ_INSERT_TAIL(&sc->sc_tx_inactive, data, next); /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: - data = STAILQ_FIRST(&sc->sc_tx_pending); + data = STAILQ_FIRST(&sc->sc_tx_pending[which]); if (data == NULL) { DPRINTF("empty pending queue sc %p\n", sc); return; } - STAILQ_REMOVE_HEAD(&sc->sc_tx_pending, next); - STAILQ_INSERT_TAIL(&sc->sc_tx_active, data, next); + STAILQ_REMOVE_HEAD(&sc->sc_tx_pending[which], next); + STAILQ_INSERT_TAIL(&sc->sc_tx_active[which], data, next); usbd_xfer_set_frame_data(xfer, 0, data->buf, data->buflen); DPRINTF("submitting transfer %p\n", data); usbd_transfer_submit(xfer); - rsu_start_locked(ifp, xfer); break; default: - data = STAILQ_FIRST(&sc->sc_tx_active); - if (data == NULL) - goto tr_setup; - if (data->ni != NULL) { - ieee80211_free_node(data->ni); - data->ni = NULL; - ifp->if_oerrors++; + data = STAILQ_FIRST(&sc->sc_tx_active[which]); + if (data != NULL) { + STAILQ_REMOVE_HEAD(&sc->sc_tx_active[which], next); + rsu_txeof(xfer, data); + STAILQ_INSERT_TAIL(&sc->sc_tx_inactive, data, next); } + ifp->if_oerrors++; + if (error != USB_ERR_CANCELLED) { usbd_xfer_set_stall(xfer); goto tr_setup; @@ -1629,9 +1633,33 @@ tr_setup: } } +static void +rsu_bulk_tx_callback_0(struct usb_xfer *xfer, usb_error_t error) +{ + rsu_bulk_tx_callback_sub(xfer, error, 0); +} + +static void +rsu_bulk_tx_callback_1(struct usb_xfer *xfer, usb_error_t error) +{ + rsu_bulk_tx_callback_sub(xfer, error, 1); +} + +static void +rsu_bulk_tx_callback_2(struct usb_xfer *xfer, usb_error_t error) +{ + rsu_bulk_tx_callback_sub(xfer, error, 2); +} + +static void +rsu_bulk_tx_callback_3(struct usb_xfer *xfer, usb_error_t error) +{ + rsu_bulk_tx_callback_sub(xfer, error, 3); +} + static int rsu_tx_start(struct rsu_softc *sc, struct ieee80211_node *ni, - struct mbuf *m0, struct rsu_data *data, struct usb_xfer *xfer_self) + struct mbuf *m0, struct rsu_data *data) { struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; @@ -1639,15 +1667,11 @@ rsu_tx_start(struct rsu_softc *sc, struc struct ieee80211_frame *wh; struct ieee80211_key *k = NULL; struct r92s_tx_desc *txd; - struct usb_xfer *xfer; - uint8_t type, tid = 0; - int hasqos, xferlen; - struct usb_xfer *rsu_pipes[4] = { - sc->sc_xfer[RSU_BULK_TX_BE], - sc->sc_xfer[RSU_BULK_TX_BK], - sc->sc_xfer[RSU_BULK_TX_VI], - sc->sc_xfer[RSU_BULK_TX_VO] - }; + uint8_t type; + uint8_t tid = 0; + uint8_t which; + int hasqos; + int xferlen; RSU_ASSERT_LOCKED(sc); @@ -1668,12 +1692,12 @@ rsu_tx_start(struct rsu_softc *sc, struc switch (type) { case IEEE80211_FC0_TYPE_CTL: case IEEE80211_FC0_TYPE_MGT: - xfer = sc->sc_xfer[RSU_BULK_TX_VO]; + which = RSU_BULK_TX_VO - RSU_BULK_TX_BE; break; default: KASSERT(M_WME_GETAC(m0) < 4, ("unsupported WME pipe %d", M_WME_GETAC(m0))); - xfer = rsu_pipes[M_WME_GETAC(m0)]; + which = M_WME_GETAC(m0) + RSU_BULK_TX_BE; break; } hasqos = 0; @@ -1735,10 +1759,10 @@ rsu_tx_start(struct rsu_softc *sc, struc data->buflen = xferlen; data->ni = ni; data->m = m0; - STAILQ_INSERT_TAIL(&sc->sc_tx_pending, data, next); + STAILQ_INSERT_TAIL(&sc->sc_tx_pending[which], data, next); - if (xfer != xfer_self) - usbd_transfer_start(xfer); + /* start transfer, if any */ + usbd_transfer_start(sc->sc_xfer[which + RSU_BULK_TX_BE]); return (0); } @@ -1751,17 +1775,17 @@ rsu_start(struct ifnet *ifp) return; RSU_LOCK(sc); - rsu_start_locked(ifp, NULL); + rsu_start_locked(ifp); RSU_UNLOCK(sc); } static void -rsu_start_locked(struct ifnet *ifp, struct usb_xfer *xfer_self) +rsu_start_locked(struct ifnet *ifp) { struct rsu_softc *sc = ifp->if_softc; struct ieee80211_node *ni; - struct mbuf *m; struct rsu_data *bf; + struct mbuf *m; RSU_ASSERT_LOCKED(sc); @@ -1769,39 +1793,19 @@ rsu_start_locked(struct ifnet *ifp, stru IFQ_DRV_DEQUEUE(&ifp->if_snd, m); if (m == NULL) break; - bf = rsu_getbuf(sc); - if (bf == NULL) { - IFQ_DRV_PREPEND(&ifp->if_snd, m); - break; - } ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; m->m_pkthdr.rcvif = NULL; - if (rsu_tx_start(sc, ni, m, bf, xfer_self) != 0) { + bf = rsu_getbuf(sc); + if (bf == NULL) { + ifp->if_iqdrops++; + m_freem(m); + ieee80211_free_node(ni); + } else if (rsu_tx_start(sc, ni, m, bf) != 0) { ifp->if_oerrors++; STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); ieee80211_free_node(ni); - break; } - sc->sc_tx_timer = 5; - callout_reset(&sc->sc_watchdog_ch, hz, rsu_watchdog, sc); - } -} - -static void -rsu_watchdog(void *arg) -{ - struct rsu_softc *sc = arg; - struct ifnet *ifp = sc->sc_ifp; - - if (sc->sc_tx_timer > 0) { - if (--sc->sc_tx_timer == 0) { - device_printf(sc->sc_dev, "device timeout\n"); - /* rsu_init(ifp); XXX needs a process context! */ - ifp->if_oerrors++; - return; - } - callout_reset(&sc->sc_watchdog_ch, hz, rsu_watchdog, sc); } } @@ -1933,7 +1937,7 @@ rsu_power_on_bcut(struct rsu_softc *sc) /* Prevent eFuse leakage. */ rsu_write_1(sc, 0x37, 0xb0); - usb_pause_mtx(&sc->sc_mtx, 10); + usb_pause_mtx(&sc->sc_mtx, hz / 100); rsu_write_1(sc, 0x37, 0x30); /* Switch the control path to hardware. */ @@ -2045,7 +2049,7 @@ rsu_power_off(struct rsu_softc *sc) { /* Turn RF off. */ rsu_write_1(sc, R92S_RF_CTRL, 0x00); - usb_pause_mtx(&sc->sc_mtx, 5); + usb_pause_mtx(&sc->sc_mtx, hz / 200); /* Turn MAC off. */ /* Switch control path. */ @@ -2073,6 +2077,7 @@ rsu_power_off(struct rsu_softc *sc) static int rsu_fw_loadsection(struct rsu_softc *sc, const uint8_t *buf, int len) { + const uint8_t which = RSU_BULK_TX_VO - RSU_BULK_TX_BE; struct rsu_data *data; struct r92s_tx_desc *txd; int mlen; @@ -2093,12 +2098,11 @@ rsu_fw_loadsection(struct rsu_softc *sc, memcpy(&txd[1], buf, mlen); data->buflen = sizeof(*txd) + mlen; DPRINTF("starting transfer %p\n", data); - STAILQ_INSERT_TAIL(&sc->sc_tx_pending, data, next); + STAILQ_INSERT_TAIL(&sc->sc_tx_pending[which], data, next); buf += mlen; len -= mlen; } - usbd_transfer_start(sc->sc_xfer[RSU_BULK_TX_VO]); - + usbd_transfer_start(sc->sc_xfer[RSU_BULK_TX_BE + which]); return (0); } @@ -2169,7 +2173,7 @@ rsu_load_firmware(struct rsu_softc *sc) } /* Wait for load to complete. */ for (ntries = 0; ntries < 10; ntries++) { - usb_pause_mtx(&sc->sc_mtx, 10); + usb_pause_mtx(&sc->sc_mtx, hz / 100); reg = rsu_read_2(sc, R92S_TCR); if (reg & R92S_TCR_IMEM_CODE_DONE) break; @@ -2190,7 +2194,7 @@ rsu_load_firmware(struct rsu_softc *sc) } /* Wait for load to complete. */ for (ntries = 0; ntries < 10; ntries++) { - usb_pause_mtx(&sc->sc_mtx, 10); + usb_pause_mtx(&sc->sc_mtx, hz / 100); reg = rsu_read_2(sc, R92S_TCR); if (reg & R92S_TCR_EMEM_CODE_DONE) break; @@ -2235,7 +2239,7 @@ rsu_load_firmware(struct rsu_softc *sc) dmem = __DECONST(struct r92s_fw_priv *, &hdr->priv); memset(dmem, 0, sizeof(*dmem)); dmem->hci_sel = R92S_HCI_SEL_USB | R92S_HCI_SEL_8172; - dmem->nendpoints = sc->npipes; + dmem->nendpoints = 0; dmem->rf_config = 0x12; /* 1T2R */ dmem->vcs_type = R92S_VCS_TYPE_AUTO; dmem->vcs_mode = R92S_VCS_MODE_RTS_CTS; @@ -2304,7 +2308,7 @@ rsu_raw_xmit(struct ieee80211_node *ni, return (ENOBUFS); } ifp->if_opackets++; - if (rsu_tx_start(sc, ni, m, bf, NULL) != 0) { + if (rsu_tx_start(sc, ni, m, bf) != 0) { ieee80211_free_node(ni); ifp->if_oerrors++; STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); @@ -2312,7 +2316,6 @@ rsu_raw_xmit(struct ieee80211_node *ni, return (EIO); } RSU_UNLOCK(sc); - sc->sc_tx_timer = 5; return (0); } @@ -2433,9 +2436,6 @@ rsu_init_locked(struct rsu_softc *sc) /* We're ready to go. */ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_drv_flags |= IFF_DRV_RUNNING; - - callout_reset(&sc->sc_watchdog_ch, hz, rsu_watchdog, sc); - return; fail: rsu_free_rx_list(sc); @@ -2460,7 +2460,6 @@ rsu_stop_locked(struct ifnet *ifp, int d int i; ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); - callout_stop(&sc->sc_watchdog_ch); sc->sc_calibrating = 0; taskqueue_cancel_timeout(taskqueue_thread, &sc->calib_task, NULL); Modified: head/sys/dev/usb/wlan/if_rsureg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rsureg.h Wed May 21 16:50:22 2014 (r266504) +++ head/sys/dev/usb/wlan/if_rsureg.h Wed May 21 16:52:55 2014 (r266505) @@ -1,4 +1,3 @@ - /*- * Copyright (c) 2010 Damien Bergamini * @@ -18,9 +17,6 @@ * $FreeBSD$ */ -/* Maximum number of pipes is 11. */ -#define R92S_MAX_EP 11 - /* USB Requests. */ #define R92S_REQ_REGS 0x05 @@ -519,7 +515,7 @@ struct r92s_rx_stat { uint32_t rxdw4; uint32_t rxdw5; -} __packed __attribute__((aligned(4))); +} __packed __aligned(4); /* Rx PHY descriptor. */ struct r92s_rx_phystat { @@ -531,7 +527,7 @@ struct r92s_rx_phystat { uint32_t phydw5; uint32_t phydw6; uint32_t phydw7; -} __packed __attribute__((aligned(4))); +} __packed __aligned(4); /* Rx PHY CCK descriptor. */ struct r92s_rx_cck { @@ -595,18 +591,14 @@ struct r92s_tx_desc { uint16_t txbufsize; uint16_t reserved1; -} __packed __attribute__((aligned(4))); +} __packed __aligned(4); /* * Driver definitions. */ #define RSU_RX_LIST_COUNT 1 -#ifdef __OpenBSD__ -#define RSU_TX_LIST_COUNT (8 + 1) /* NB: +1 for FW commands. */ -#else #define RSU_TX_LIST_COUNT 32 -#endif #define RSU_HOST_CMD_RING_COUNT 32 @@ -735,6 +727,8 @@ struct rsu_vap { #define RSU_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) #define RSU_ASSERT_LOCKED(sc) mtx_assert(&(sc)->sc_mtx, MA_OWNED) +#define RSU_MAX_TX_EP 4 + struct rsu_softc { struct ifnet *sc_ifp; device_t sc_dev; @@ -743,15 +737,11 @@ struct rsu_softc { enum ieee80211_state, int); struct usbd_interface *sc_iface; struct timeout_task calib_task; - struct callout sc_watchdog_ch; - struct usbd_pipe *pipe[R92S_MAX_EP]; - int npipes; const uint8_t *qid2idx; struct mtx sc_mtx; u_int cut; int scan_pass; - int sc_tx_timer; struct rsu_host_cmd_ring cmdq; struct rsu_data sc_rx[RSU_RX_LIST_COUNT]; struct rsu_data sc_tx[RSU_TX_LIST_COUNT]; @@ -764,9 +754,9 @@ struct rsu_softc { STAILQ_HEAD(, rsu_data) sc_rx_active; STAILQ_HEAD(, rsu_data) sc_rx_inactive; - STAILQ_HEAD(, rsu_data) sc_tx_active; + STAILQ_HEAD(, rsu_data) sc_tx_active[RSU_MAX_TX_EP]; STAILQ_HEAD(, rsu_data) sc_tx_inactive; - STAILQ_HEAD(, rsu_data) sc_tx_pending; + STAILQ_HEAD(, rsu_data) sc_tx_pending[RSU_MAX_TX_EP]; union { struct rsu_rx_radiotap_header th; From owner-svn-src-head@FreeBSD.ORG Wed May 21 17:22:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C62274CD; Wed, 21 May 2014 17:22:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B300D2BFF; Wed, 21 May 2014 17:22:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4LHMfdx016034; Wed, 21 May 2014 17:22:41 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4LHMfCp016032; Wed, 21 May 2014 17:22:41 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405211722.s4LHMfCp016032@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 21 May 2014 17:22:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266508 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 17:22:41 -0000 Author: hselasky Date: Wed May 21 17:22:41 2014 New Revision: 266508 URL: http://svnweb.freebsd.org/changeset/base/266508 Log: Implement interrupt endpoint methods for host mode transfers. Sponsored by: DARPA, AFRL Modified: head/sys/dev/usb/controller/saf1761_otg.c head/sys/dev/usb/controller/saf1761_otg.h Modified: head/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.c Wed May 21 17:02:21 2014 (r266507) +++ head/sys/dev/usb/controller/saf1761_otg.c Wed May 21 17:22:41 2014 (r266508) @@ -561,13 +561,195 @@ complete: static uint8_t saf1761_host_intr_data_rx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { + uint32_t pdt_addr; + uint32_t temp; + + if (td->channel < SOTG_HOST_CHANNEL_MAX) { + uint32_t status; + uint32_t count; + uint8_t got_short; + + pdt_addr = SOTG_PDT(td->channel); + + saf1761_read_host_memory_4(sc, pdt_addr + SOTG_PDT_DW3, &status, 1); + + if (status & SOTG_PDT_DW3_ACTIVE) { + goto busy; + } else if (status & SOTG_PDT_DW3_HALTED) { + td->error_stall = 1; + td->error_any = 1; + goto complete; + } + + count = (status & SOTG_PDT_DW3_XFER_COUNT); + got_short = 0; + + /* verify the packet byte count */ + if (count != td->max_packet_size) { + if (count < td->max_packet_size) { + /* we have a short packet */ + td->short_pkt = 1; + got_short = 1; + } else { + /* invalid USB packet */ + td->error_any = 1; + goto complete; + } + } + td->toggle ^= 1; + + /* verify the packet byte count */ + if (count > td->remainder) { + /* invalid USB packet */ + td->error_any = 1; + goto complete; + } + + saf1761_read_host_memory_4(sc, SOTG_DATA_ADDR(td->channel), + sc->sc_bounce_buffer, (count + 3) / 4); + + usbd_copy_in(td->pc, td->offset, + sc->sc_bounce_buffer, count); + + td->remainder -= count; + td->offset += count; + + saf1761_host_channel_free(sc, td); + + /* check if we are complete */ + if ((td->remainder == 0) || got_short) { + if (td->short_pkt) + goto complete; + /* else need to receive a zero length packet */ + } + } + if (saf1761_host_channel_alloc(sc, td)) + goto busy; + + /* set toggle, if any */ + if (td->set_toggle) { + td->set_toggle = 0; + td->toggle = 1; + } + + /* receive one more packet */ + + pdt_addr = SOTG_PDT(td->channel); + + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW7, 0); + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW6, 0); + + temp = (0xFC << td->uframe) & 0xFF; /* complete split */ + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW5, temp); + + temp = (1U << td->uframe); /* start split */ + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW4, temp); + + temp = SOTG_PDT_DW3_ACTIVE | (td->toggle << 25) | SOTG_PDT_DW3_CERR; + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW3, temp); + + temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8) | td->interval; + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW2, temp); + + temp = td->dw1_value | (1 << 10) /* IN-PID */ | (td->ep_index >> 1); + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW1, temp); + + temp = (td->ep_index << 31) | (1 << 29) /* pkt-multiplier */ | + (td->max_packet_size << 18) /* wMaxPacketSize */ | + (td->max_packet_size << 3) /* transfer count */ | + SOTG_PDT_DW0_VALID; + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW0, temp); +busy: return (1); /* busy */ +complete: + return (0); /* complete */ } static uint8_t saf1761_host_intr_data_tx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { + uint32_t pdt_addr; + uint32_t temp; + uint32_t count; + + if (td->channel < SOTG_HOST_CHANNEL_MAX) { + uint32_t status; + + pdt_addr = SOTG_PDT(td->channel); + + saf1761_read_host_memory_4(sc, pdt_addr + SOTG_PDT_DW3, &status, 1); + + if (status & SOTG_PDT_DW3_ACTIVE) { + goto busy; + } else if (status & SOTG_PDT_DW3_HALTED) { + td->error_stall = 1; + td->error_any = 1; + } + + saf1761_host_channel_free(sc, td); + + /* check remainder */ + if (td->remainder == 0) { + if (td->short_pkt) + goto complete; + /* else we need to transmit a short packet */ + } + } + if (saf1761_host_channel_alloc(sc, td)) + goto busy; + + count = td->max_packet_size; + if (td->remainder < count) { + /* we have a short packet */ + td->short_pkt = 1; + count = td->remainder; + } + + usbd_copy_out(td->pc, td->offset, sc->sc_bounce_buffer, count); + saf1761_write_host_memory_4(sc, SOTG_DATA_ADDR(td->channel), + sc->sc_bounce_buffer, (count + 3) / 4); + + /* set toggle, if any */ + if (td->set_toggle) { + td->set_toggle = 0; + td->toggle = 1; + } + + /* send one more packet */ + + pdt_addr = SOTG_PDT(td->channel); + + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW7, 0); + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW6, 0); + + temp = (0xFC << td->uframe) & 0xFF; /* complete split */ + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW5, temp); + + temp = (1U << td->uframe); /* start split */ + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW4, temp); + + temp = SOTG_PDT_DW3_ACTIVE | (td->toggle << 25) | SOTG_PDT_DW3_CERR; + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW3, temp); + + temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8) | td->interval; + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW2, temp); + + temp = td->dw1_value | (0 << 10) /* OUT-PID */ | (td->ep_index >> 1); + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW1, temp); + + temp = (td->ep_index << 31) | (1 << 29) /* pkt-multiplier */ | + (td->max_packet_size << 18) /* wMaxPacketSize */ | + (count << 3) /* transfer count */ | + SOTG_PDT_DW0_VALID; + SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW0, temp); + + td->offset += count; + td->remainder -= count; + td->toggle ^= 1; +busy: return (1); /* busy */ +complete: + return (0); /* complete */ } static uint8_t @@ -2692,7 +2874,15 @@ saf1761_otg_xfer_setup(struct usb_setup_ td->ep_index = ep_no; td->ep_type = ep_type; td->dw1_value = dw1; - + td->uframe = 0; + if (ep_type == UE_INTERRUPT) { + if (xfer->interval > 32) + td->interval = 32 / 2; + else + td->interval = xfer->interval / 2; + } else { + td->interval = 0; + } td->obj_next = last_obj; last_obj = td; @@ -2739,6 +2929,7 @@ saf1761_otg_ep_init(struct usb_device *u switch (edesc->bmAttributes & UE_XFERTYPE) { case UE_CONTROL: case UE_BULK: + case UE_INTERRUPT: ep->methods = &saf1761_otg_non_isoc_methods; break; default: Modified: head/sys/dev/usb/controller/saf1761_otg.h ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.h Wed May 21 17:02:21 2014 (r266507) +++ head/sys/dev/usb/controller/saf1761_otg.h Wed May 21 17:22:41 2014 (r266508) @@ -70,6 +70,8 @@ struct saf1761_otg_td { uint8_t ep_index; uint8_t ep_type; uint8_t channel; + uint8_t uframe; + uint8_t interval; uint8_t error_any:1; uint8_t error_stall:1; uint8_t alt_next:1; From owner-svn-src-head@FreeBSD.ORG Wed May 21 17:34:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B650A33; Wed, 21 May 2014 17:34:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58A172CFB; Wed, 21 May 2014 17:34:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4LHYpso020749; Wed, 21 May 2014 17:34:51 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4LHYpoi020747; Wed, 21 May 2014 17:34:51 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201405211734.s4LHYpoi020747@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 21 May 2014 17:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266509 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 17:34:51 -0000 Author: marcel Date: Wed May 21 17:34:50 2014 New Revision: 266509 URL: http://svnweb.freebsd.org/changeset/base/266509 Log: Fix CID 1215129: move the call to lseek(2) before the call to malloc(3) so that the error path (taken due to lseek(2) failing) isn't leaking memory. Modified: head/usr.bin/mkimg/image.c Modified: head/usr.bin/mkimg/image.c ============================================================================== --- head/usr.bin/mkimg/image.c Wed May 21 17:22:41 2014 (r266508) +++ head/usr.bin/mkimg/image.c Wed May 21 17:34:50 2014 (r266509) @@ -98,11 +98,11 @@ image_copyout(int fd) ofs = lseek(fd, 0L, SEEK_CUR); + if (lseek(image_fd, 0, SEEK_SET) != 0) + return (errno); buffer = malloc(BUFFER_SIZE); if (buffer == NULL) return (errno); - if (lseek(image_fd, 0, SEEK_SET) != 0) - return (errno); error = 0; while (1) { rdsz = read(image_fd, buffer, BUFFER_SIZE); From owner-svn-src-head@FreeBSD.ORG Wed May 21 17:36:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9FB6CBB0; Wed, 21 May 2014 17:36:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D5012D15; Wed, 21 May 2014 17:36:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4LHaCVi020975; Wed, 21 May 2014 17:36:12 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4LHaC5J020974; Wed, 21 May 2014 17:36:12 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201405211736.s4LHaC5J020974@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 21 May 2014 17:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266510 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 17:36:12 -0000 Author: marcel Date: Wed May 21 17:36:12 2014 New Revision: 266510 URL: http://svnweb.freebsd.org/changeset/base/266510 Log: Fix CID 1215128: Free the allocated buf when image_set_size() returns and error and we return from bsd_write(). Modified: head/usr.bin/mkimg/bsd.c Modified: head/usr.bin/mkimg/bsd.c ============================================================================== --- head/usr.bin/mkimg/bsd.c Wed May 21 17:34:50 2014 (r266509) +++ head/usr.bin/mkimg/bsd.c Wed May 21 17:36:12 2014 (r266510) @@ -82,8 +82,10 @@ bsd_write(lba_t imgsz, void *bootcode) imgsz = ncyls * nheads * nsecs; error = image_set_size(imgsz); - if (error) + if (error) { + free(buf); return (error); + } d = (void *)(buf + secsz); le32enc(&d->d_magic, DISKMAGIC); From owner-svn-src-head@FreeBSD.ORG Wed May 21 17:37:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E3AED22; Wed, 21 May 2014 17:37:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C3C42D3F; Wed, 21 May 2014 17:37:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4LHbMkI021143; Wed, 21 May 2014 17:37:22 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4LHbM8T021142; Wed, 21 May 2014 17:37:22 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201405211737.s4LHbM8T021142@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 21 May 2014 17:37:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266511 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 17:37:23 -0000 Author: marcel Date: Wed May 21 17:37:22 2014 New Revision: 266511 URL: http://svnweb.freebsd.org/changeset/base/266511 Log: Fix CID 1215125: fstat(2) returns -1 on error and sets errno. It does not return the error (oops). Modified: head/usr.bin/mkimg/scheme.c Modified: head/usr.bin/mkimg/scheme.c ============================================================================== --- head/usr.bin/mkimg/scheme.c Wed May 21 17:36:12 2014 (r266510) +++ head/usr.bin/mkimg/scheme.c Wed May 21 17:37:22 2014 (r266511) @@ -103,14 +103,12 @@ int scheme_bootcode(int fd) { struct stat sb; - int error; if (scheme->bootcode == 0) return (ENXIO); - error = fstat(fd, &sb); - if (error) - return (error); + if (fstat(fd, &sb) == -1) + return (errno); if (sb.st_size > scheme->bootcode) return (EFBIG); From owner-svn-src-head@FreeBSD.ORG Wed May 21 17:38:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9FBEE70; Wed, 21 May 2014 17:38:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B769F2D48; Wed, 21 May 2014 17:38:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4LHcEtq021286; Wed, 21 May 2014 17:38:14 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4LHcEmj021285; Wed, 21 May 2014 17:38:14 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201405211738.s4LHcEmj021285@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 21 May 2014 17:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266512 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 17:38:14 -0000 Author: marcel Date: Wed May 21 17:38:14 2014 New Revision: 266512 URL: http://svnweb.freebsd.org/changeset/base/266512 Log: Fix CID 1215124: Handle errors properly. Modified: head/usr.bin/mkimg/image.c Modified: head/usr.bin/mkimg/image.c ============================================================================== --- head/usr.bin/mkimg/image.c Wed May 21 17:37:22 2014 (r266511) +++ head/usr.bin/mkimg/image.c Wed May 21 17:38:14 2014 (r266512) @@ -119,8 +119,12 @@ image_copyout(int fd) } } free(buffer); + if (error) + return (error); ofs = lseek(fd, 0L, SEEK_CUR); - ftruncate(fd, ofs); + if (ofs == -1) + return (errno); + error = (ftruncate(fd, ofs) == -1) ? errno : 0; return (error); } From owner-svn-src-head@FreeBSD.ORG Wed May 21 17:38:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 569E6FBD; Wed, 21 May 2014 17:38:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4489B2D50; Wed, 21 May 2014 17:38:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4LHcvql021396; Wed, 21 May 2014 17:38:57 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4LHcv3u021395; Wed, 21 May 2014 17:38:57 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201405211738.s4LHcv3u021395@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 21 May 2014 17:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266513 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 17:38:57 -0000 Author: marcel Date: Wed May 21 17:38:56 2014 New Revision: 266513 URL: http://svnweb.freebsd.org/changeset/base/266513 Log: Fix CID 1204394: Use strncpy(3) instead of strcpy(3). Note that it's ok to not have the name and type strings terminated. Modified: head/usr.bin/mkimg/apm.c Modified: head/usr.bin/mkimg/apm.c ============================================================================== --- head/usr.bin/mkimg/apm.c Wed May 21 17:38:14 2014 (r266512) +++ head/usr.bin/mkimg/apm.c Wed May 21 17:38:56 2014 (r266513) @@ -86,8 +86,8 @@ apm_write(lba_t imgsz, void *bootcode __ be32enc(&ent->ent_pmblkcnt, nparts + 1); be32enc(&ent->ent_start, 1); be32enc(&ent->ent_size, nparts + 1); - strcpy(ent->ent_type, APM_ENT_TYPE_SELF); - strcpy(ent->ent_name, "Apple"); + strncpy(ent->ent_type, APM_ENT_TYPE_SELF, sizeof(ent->ent_type)); + strncpy(ent->ent_name, "Apple", sizeof(ent->ent_name)); STAILQ_FOREACH(part, &partlist, link) { ent = (void *)(buf + (part->index + 2) * secsz); @@ -95,9 +95,11 @@ apm_write(lba_t imgsz, void *bootcode __ be32enc(&ent->ent_pmblkcnt, nparts + 1); be32enc(&ent->ent_start, part->block); be32enc(&ent->ent_size, part->size); - strcpy(ent->ent_type, ALIAS_TYPE2PTR(part->type)); + strncpy(ent->ent_type, ALIAS_TYPE2PTR(part->type), + sizeof(ent->ent_type)); if (part->label != NULL) - strcpy(ent->ent_name, part->label); + strncpy(ent->ent_name, part->label, + sizeof(ent->ent_name)); } error = image_write(0, buf, nparts + 2); From owner-svn-src-head@FreeBSD.ORG Wed May 21 17:39:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98A6418C; Wed, 21 May 2014 17:39:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85F1E2D58; Wed, 21 May 2014 17:39:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4LHdobA021531; Wed, 21 May 2014 17:39:50 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4LHdoG1021529; Wed, 21 May 2014 17:39:50 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201405211739.s4LHdoG1021529@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 21 May 2014 17:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266514 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 17:39:50 -0000 Author: marcel Date: Wed May 21 17:39:49 2014 New Revision: 266514 URL: http://svnweb.freebsd.org/changeset/base/266514 Log: Fix CID 1204379 (vtoc8.c) & CID 1204380 (bsd.c): Cast ncyls to lba_t before multiplying the 32-bit integrals to avoid any possibility of truncation before widening. Not a likely scenario to begin with... Modified: head/usr.bin/mkimg/bsd.c head/usr.bin/mkimg/vtoc8.c Modified: head/usr.bin/mkimg/bsd.c ============================================================================== --- head/usr.bin/mkimg/bsd.c Wed May 21 17:38:56 2014 (r266513) +++ head/usr.bin/mkimg/bsd.c Wed May 21 17:39:49 2014 (r266514) @@ -80,7 +80,7 @@ bsd_write(lba_t imgsz, void *bootcode) } else memset(buf, 0, BBSIZE); - imgsz = ncyls * nheads * nsecs; + imgsz = (lba_t)ncyls * nheads * nsecs; error = image_set_size(imgsz); if (error) { free(buf); Modified: head/usr.bin/mkimg/vtoc8.c ============================================================================== --- head/usr.bin/mkimg/vtoc8.c Wed May 21 17:38:56 2014 (r266513) +++ head/usr.bin/mkimg/vtoc8.c Wed May 21 17:39:49 2014 (r266514) @@ -71,7 +71,7 @@ vtoc8_write(lba_t imgsz, void *bootcode int error, n; uint16_t ofs, sum; - imgsz = ncyls * nheads * nsecs; + imgsz = (lba_t)ncyls * nheads * nsecs; memset(&vtoc8, 0, sizeof(vtoc8)); sprintf(vtoc8.ascii, "FreeBSD%lldM", From owner-svn-src-head@FreeBSD.ORG Wed May 21 18:02:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3214B7BC; Wed, 21 May 2014 18:02:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F6832FA1; Wed, 21 May 2014 18:02:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4LI2JGc033463; Wed, 21 May 2014 18:02:19 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4LI2JDq033462; Wed, 21 May 2014 18:02:19 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405211802.s4LI2JDq033462@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 21 May 2014 18:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266515 - head/sys/boot/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 18:02:20 -0000 Author: hselasky Date: Wed May 21 18:02:19 2014 New Revision: 266515 URL: http://svnweb.freebsd.org/changeset/base/266515 Log: "%p" formatting already includes "0x" prefix in printout. Modified: head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Wed May 21 17:39:49 2014 (r266514) +++ head/sys/boot/fdt/fdt_loader_cmd.c Wed May 21 18:02:19 2014 (r266515) @@ -233,7 +233,7 @@ fdt_load_dtb_addr(struct fdt_header *hea { int err; - debugf("fdt_load_dtb_addr(0x%p)\n", header); + debugf("fdt_load_dtb_addr(%p)\n", header); fdtp_size = fdt_totalsize(header); err = fdt_check_header(header); @@ -321,7 +321,7 @@ fdt_setup_fdtp() if (*p == '\0') { if (fdt_load_dtb_addr(hdr) == 0) { printf("Using DTB provided by U-Boot at " - "address 0x%p.\n", hdr); + "address %p.\n", hdr); return (0); } } From owner-svn-src-head@FreeBSD.ORG Wed May 21 20:14:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A626C74; Wed, 21 May 2014 20:14:30 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 290242BCA; Wed, 21 May 2014 20:14:29 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id C6C931FE026; Wed, 21 May 2014 22:14:27 +0200 (CEST) Message-ID: <537D0952.2040001@selasky.org> Date: Wed, 21 May 2014 22:15:14 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Mark Murray , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r266083 - in head/sys/arm: arm include References: <201405141911.s4EJBFZZ097826@svn.freebsd.org> In-Reply-To: <201405141911.s4EJBFZZ097826@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 20:14:30 -0000 On 05/14/14 21:11, Mark Murray wrote: > Author: markm > Date: Wed May 14 19:11:15 2014 > New Revision: 266083 > URL: http://svnweb.freebsd.org/changeset/base/266083 > > Log: > Give suitably-endowed ARMs a register similar to the x86 TSC register. > Hi, Regression issue: This commit prevents RPI-B from booting. --HPS From owner-svn-src-head@FreeBSD.ORG Wed May 21 20:20:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 055B0F3B; Wed, 21 May 2014 20:20:14 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B829E2C11; Wed, 21 May 2014 20:20:13 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 4F7C31FE027; Wed, 21 May 2014 22:20:12 +0200 (CEST) Message-ID: <537D0AAB.3090303@selasky.org> Date: Wed, 21 May 2014 22:20:59 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Aleksandr Rybalko , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r265927 - head/sys/dev/vt References: <201405121929.s4CJTcBx010967@svn.freebsd.org> In-Reply-To: <201405121929.s4CJTcBx010967@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 20:20:14 -0000 On 05/12/14 21:29, Aleksandr Rybalko wrote: > Author: ray > Date: Mon May 12 19:29:38 2014 > New Revision: 265927 > URL: http://svnweb.freebsd.org/changeset/base/265927 > > Log: > Update terminal sizes in any case when new vt(4) driver arrive. > (Plus remove one unused newline) > > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/dev/vt/vt_core.c > This patch causes panic when booting the RPI-B: VT: initialize with new VT driver "fb". panic: mtx_lock() of spin mutex (null) @ /usr/img/freebsd/sys/dev/vt/vt_core.c:2037 KDB: enter: panic [ thread pid 0 tid 100000 ] Stopped at $d: ldrb r15, [r15, r15, ror r15]! __mtx_lock_flags() at vt_resize() at vt_upgrade() at mi_startup() at mi_startup+0x11c --HPS From owner-svn-src-head@FreeBSD.ORG Wed May 21 21:30:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B35B6919; Wed, 21 May 2014 21:30:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A12BD2252; Wed, 21 May 2014 21:30:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4LLU0AX021734; Wed, 21 May 2014 21:30:00 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4LLU0VX021732; Wed, 21 May 2014 21:30:00 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201405212130.s4LLU0VX021732@svn.freebsd.org> From: Sean Bruno Date: Wed, 21 May 2014 21:30:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266518 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 21:30:00 -0000 Author: sbruno Date: Wed May 21 21:30:00 2014 New Revision: 266518 URL: http://svnweb.freebsd.org/changeset/base/266518 Log: Remove duplicate: option AH_DEBUG_ALQ Modified: head/sys/mips/conf/AR933X_BASE Modified: head/sys/mips/conf/AR933X_BASE ============================================================================== --- head/sys/mips/conf/AR933X_BASE Wed May 21 20:30:52 2014 (r266517) +++ head/sys/mips/conf/AR933X_BASE Wed May 21 21:30:00 2014 (r266518) @@ -90,7 +90,6 @@ device ath_ar9300 # AR9330 HAL; no nee option AH_DEBUG option AH_SUPPORT_AR5416 # 11n HAL support option AH_SUPPORT_AR9330 # Chipset support -option AH_DEBUG_ALQ option AH_AR5416_INTERRUPT_MITIGATION device mii From owner-svn-src-head@FreeBSD.ORG Wed May 21 23:43:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BFEA9771 for ; Wed, 21 May 2014 23:43:33 +0000 (UTC) Received: from nm19-vm5.bullet.mail.ne1.yahoo.com (nm19-vm5.bullet.mail.ne1.yahoo.com [98.138.91.241]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 819FB2E0C for ; Wed, 21 May 2014 23:43:33 +0000 (UTC) Received: from [98.138.100.116] by nm19.bullet.mail.ne1.yahoo.com with NNFMP; 21 May 2014 23:43:31 -0000 Received: from [98.138.84.47] by tm107.bullet.mail.ne1.yahoo.com with NNFMP; 21 May 2014 23:43:31 -0000 Received: from [127.0.0.1] by smtp115.mail.ne1.yahoo.com with NNFMP; 21 May 2014 23:43:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1400715811; bh=FddDulrcgWWwF4cX7cNfhhtdZkk1b5etQ44vRQlA/bo=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Subject:Mime-Version:Content-Type:X-Pgp-Agent:From:In-Reply-To:Date:Cc:Message-Id:References:To:X-Mailer; b=H+MzgUG4asWnIlveTjx767a6Rg74bB8OuCPF6o5jkgC6+fLquxcFbw1t8SsxH7wiQ9NEj7ZDfl6b0iLptoKJMo9vUyZdEDZd/kpDBMvmEXhdUc9/iQopot9ydJQFM3r0ImOPxN/omed8am/6KG91Q/XOg2kzGMtufgXhVT1aITo= X-Yahoo-Newman-Id: 839712.34019.bm@smtp115.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: .QFapv0VM1mAPLzsTPj3vAKNLShY13V9HwHKUGPh7SVsQVX hXORT52T8U.tcet4hS29qAsHTl2YRe4Ar_J68SUwQSV_ged9nUhsefmEiJ8J qOqIcKRyXDw7bikRj68I2levSuj1xZ.UAQvxLRhhI0oJIrJUUHAR49GMkhwC IKNFIluZ2u0Z9p7QpXrDsCESFeRE_VmdakC2HBLFoXg8B9ifyfg27BuDLxBn 1mQJtS1I1aCIR.3Q4lPRaA5xrBLcEZBmzLvJFt4Q12U3uaeu2f.G1cS52kFb gRs5hOFeniZ7x0Fs6y_ocXoBhNRFvbBtsEstivehGZsjdndpq0sDCXiEClZN tjOm0BVMrfUORhI8Tb01vT7XiBeLwOEcqic3noEf9EXXv7bfYqtrllcYaPae 4c6ZPN1kQoriOgYf1JeQqnUQuHFTK96QA8BdlqErxanpg6ND0lOF8r2qTkON zaXuvFlY6BFn_Su4taJbZgrrHAIzNfdruFHgiRpX9U0S14wAp4dnTbGvHhSl mgyVCvFKg.7cLhO4bAQvQ_7d0yem6Gqvg422qF6SXF3.YNw-- X-Yahoo-SMTP: clhABp.swBB7fs.LwIJpv3jkWgo2NU8- X-Rocket-Received: from [10.64.24.45] (scott4long@69.53.236.251 with plain [98.138.105.21]) by smtp115.mail.ne1.yahoo.com with SMTP; 21 May 2014 16:43:31 -0700 PDT Subject: Re: svn commit: r266481 - head/sys/x86/x86 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Content-Type: multipart/signed; boundary="Apple-Mail=_80D93F0F-B127-42B7-82D4-1F7CB83E6C47"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.1 (fa49d90+) From: Scott Long In-Reply-To: <20140521160335.GT74331@kib.kiev.ua> Date: Wed, 21 May 2014 17:43:27 -0600 Message-Id: References: <201405202243.s4KMhIRu033126@svn.freebsd.org> <20140521160335.GT74331@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Scott Long X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 23:43:33 -0000 --Apple-Mail=_80D93F0F-B127-42B7-82D4-1F7CB83E6C47 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On May 21, 2014, at 10:03 AM, Konstantin Belousov = wrote: >>=20 > You changed the handling of the alignment, which is probably not = correct. > The problematic parameter, if any, is boundary. Thanks, this crept in when I re-formatted the code for check-in. I=92ll = fix it. Scott --Apple-Mail=_80D93F0F-B127-42B7-82D4-1F7CB83E6C47 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJTfTofAAoJEIxiMIkw8yo4kxUH/jYydp4CoZFPFaZjUQphQnOS AuYN7IZKBJyrD/fpESGoG6xM1lkH4qKzxxjOZZKz5yeME2IVnunmmrnchHQxyn0V X5oSmLQ0W1RDysT+FKcESyZm526Qoq2ntwZtzopvhQFQZScBel4AK18TQOV/HFnF 6hkVx4sVaC44Rb4zQDxsFLLQneF6ZKtoOrT8OjmP4GYccb+5ntNyUfiW6xLj/WrF 1DNfRivXtV1ngMKPG/IrcPTqn7eUe2QOhdys6T67jmed698zIlooXPmW6M9PXQ5e 06BxnrlI5ykhQxM5WwLyv4WKHIwpH4uk6SgO+IgXyAfUzhtiJI95ESmtEuLHrYc= =6LQ5 -----END PGP SIGNATURE----- --Apple-Mail=_80D93F0F-B127-42B7-82D4-1F7CB83E6C47-- From owner-svn-src-head@FreeBSD.ORG Thu May 22 00:01:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38C869FC; Thu, 22 May 2014 00:01:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2681D2F63; Thu, 22 May 2014 00:01:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4M01WSb089644; Thu, 22 May 2014 00:01:32 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4M01W9C089643; Thu, 22 May 2014 00:01:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405220001.s4M01W9C089643@svn.freebsd.org> From: Xin LI Date: Thu, 22 May 2014 00:01:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266520 - head/cddl/lib/libzfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 00:01:32 -0000 Author: delphij Date: Thu May 22 00:01:31 2014 New Revision: 266520 URL: http://svnweb.freebsd.org/changeset/base/266520 Log: Explicitly link libzfs against libavl as it is done in OpenSolaris (4543:12bb2876a62e). Without this, some third party applications may break because the lack of AVL related symbols. FreeBSD base system are not affected because the FreeBSD ZFS command line tools were all linked against libavl and thus hide the underlying issue. PR: java/183081 Tested by: jkim MFC after: 3 days Modified: head/cddl/lib/libzfs/Makefile Modified: head/cddl/lib/libzfs/Makefile ============================================================================== --- head/cddl/lib/libzfs/Makefile Wed May 21 23:04:47 2014 (r266519) +++ head/cddl/lib/libzfs/Makefile Thu May 22 00:01:31 2014 (r266520) @@ -7,8 +7,8 @@ LIB= zfs DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL} ${LIBM} ${LIBNVPAIR} \ - ${LIBZFS_CORE} -LDADD= -lmd -lpthread -lumem -lutil -lm -lnvpair -lzfs_core + ${LIBAVL} ${LIBZFS_CORE} +LDADD= -lmd -lpthread -lumem -lutil -lm -lnvpair -lavl -lzfs_core SRCS= deviceid.c \ fsshare.c \ From owner-svn-src-head@FreeBSD.ORG Thu May 22 03:14:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CE01A48; Thu, 22 May 2014 03:14:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 795032CE8; Thu, 22 May 2014 03:14:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4M3Ethg073939; Thu, 22 May 2014 03:14:55 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4M3Esdn073934; Thu, 22 May 2014 03:14:54 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405220314.s4M3Esdn073934@svn.freebsd.org> From: Neel Natu Date: Thu, 22 May 2014 03:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266524 - in head/sys/amd64: include vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 03:14:55 -0000 Author: neel Date: Thu May 22 03:14:54 2014 New Revision: 266524 URL: http://svnweb.freebsd.org/changeset/base/266524 Log: Inject page fault into the guest if the page table walker detects an invalid translation for the guest linear address. Modified: head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_instruction_emul.h head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Thu May 22 00:46:03 2014 (r266523) +++ head/sys/amd64/include/vmm.h Thu May 22 03:14:54 2014 (r266524) @@ -236,6 +236,7 @@ int vm_exception_pending(struct vm *vm, void vm_inject_gp(struct vm *vm, int vcpuid); /* general protection fault */ void vm_inject_ud(struct vm *vm, int vcpuid); /* undefined instruction fault */ +void vm_inject_pf(struct vm *vm, int vcpuid, int error_code); /* page fault */ #endif /* KERNEL */ Modified: head/sys/amd64/include/vmm_instruction_emul.h ============================================================================== --- head/sys/amd64/include/vmm_instruction_emul.h Thu May 22 00:46:03 2014 (r266523) +++ head/sys/amd64/include/vmm_instruction_emul.h Thu May 22 03:14:54 2014 (r266524) @@ -122,6 +122,16 @@ int vmm_fetch_instruction(struct vm *vm, enum vie_paging_mode paging_mode, int cpl, struct vie *vie); +/* + * Translate the guest linear address 'gla' to a guest physical address. + * + * Returns 0 on success and '*gpa' contains the result of the translation. + * Returns 1 if a page fault exception was injected into the guest. + * Returns -1 otherwise. + */ +int vmm_gla2gpa(struct vm *vm, int vcpuid, uint64_t gla, uint64_t cr3, + uint64_t *gpa, enum vie_paging_mode paging_mode, int cpl, int prot); + void vie_init(struct vie *vie); /* Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Thu May 22 00:46:03 2014 (r266523) +++ head/sys/amd64/vmm/vmm.c Thu May 22 03:14:54 2014 (r266524) @@ -1155,9 +1155,14 @@ vm_handle_inst_emul(struct vm *vm, int v vie_init(vie); /* Fetch, decode and emulate the faulting instruction */ - if (vmm_fetch_instruction(vm, vcpuid, rip, inst_length, cr3, - paging_mode, cpl, vie) != 0) + error = vmm_fetch_instruction(vm, vcpuid, rip, inst_length, cr3, + paging_mode, cpl, vie); + if (error == 1) + return (0); /* Resume guest to handle page fault */ + else if (error == -1) return (EFAULT); + else if (error != 0) + panic("%s: vmm_fetch_instruction error %d", __func__, error); if (vmm_decode_instruction(vm, vcpuid, gla, cpu_mode, vie) != 0) return (EFAULT); @@ -1431,6 +1436,18 @@ vm_inject_fault(struct vm *vm, int vcpui } void +vm_inject_pf(struct vm *vm, int vcpuid, int error_code) +{ + struct vm_exception pf = { + .vector = IDT_PF, + .error_code_valid = 1, + .error_code = error_code + }; + + vm_inject_fault(vm, vcpuid, &pf); +} + +void vm_inject_gp(struct vm *vm, int vcpuid) { struct vm_exception gpf = { Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Thu May 22 00:46:03 2014 (r266523) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Thu May 22 03:14:54 2014 (r266524) @@ -572,6 +572,23 @@ vie_init(struct vie *vie) vie->index_register = VM_REG_LAST; } +static int +pf_error_code(int usermode, int prot, uint64_t pte) +{ + int error_code = 0; + + if (pte & PG_V) + error_code |= PGEX_P; + if (prot & VM_PROT_WRITE) + error_code |= PGEX_W; + if (usermode) + error_code |= PGEX_U; + if (prot & VM_PROT_EXECUTE) + error_code |= PGEX_I; + + return (error_code); +} + static void ptp_release(void **cookie) { @@ -591,11 +608,11 @@ ptp_hold(struct vm *vm, vm_paddr_t ptpph return (ptr); } -static int -gla2gpa(struct vm *vm, uint64_t gla, uint64_t ptpphys, uint64_t *gpa, - enum vie_paging_mode paging_mode, int cpl, int prot) +int +vmm_gla2gpa(struct vm *vm, int vcpuid, uint64_t gla, uint64_t ptpphys, + uint64_t *gpa, enum vie_paging_mode paging_mode, int cpl, int prot) { - int nlevels, ptpshift, ptpindex, retval, usermode, writable; + int nlevels, pfcode, ptpshift, ptpindex, retval, usermode, writable; u_int retries; uint64_t *ptpbase, pte, pgsize; uint32_t *ptpbase32, pte32; @@ -604,7 +621,7 @@ gla2gpa(struct vm *vm, uint64_t gla, uin usermode = (cpl == 3 ? 1 : 0); writable = prot & VM_PROT_WRITE; cookie = NULL; - retval = -1; + retval = 0; retries = 0; restart: ptp_release(&cookie); @@ -633,11 +650,13 @@ restart: pte32 = ptpbase32[ptpindex]; - if ((pte32 & PG_V) == 0) - goto error; - - if (usermode && (pte32 & PG_U) == 0) - goto error; + if ((pte32 & PG_V) == 0 || + (usermode && (pte32 & PG_U) == 0) || + (writable && (pte32 & PG_RW) == 0)) { + pfcode = pf_error_code(usermode, prot, pte32); + vm_inject_pf(vm, vcpuid, pfcode); + goto pagefault; + } if (writable && (pte32 & PG_RW) == 0) goto error; @@ -689,8 +708,11 @@ restart: pte = ptpbase[ptpindex]; - if ((pte & PG_V) == 0) - goto error; + if ((pte & PG_V) == 0) { + pfcode = pf_error_code(usermode, prot, pte); + vm_inject_pf(vm, vcpuid, pfcode); + goto pagefault; + } ptpphys = pte; @@ -711,11 +733,13 @@ restart: pte = ptpbase[ptpindex]; - if ((pte & PG_V) == 0) - goto error; - - if (usermode && (pte & PG_U) == 0) - goto error; + if ((pte & PG_V) == 0 || + (usermode && (pte & PG_U) == 0) || + (writable && (pte & PG_RW) == 0)) { + pfcode = pf_error_code(usermode, prot, pte); + vm_inject_pf(vm, vcpuid, pfcode); + goto pagefault; + } if (writable && (pte & PG_RW) == 0) goto error; @@ -748,10 +772,14 @@ restart: pte >>= ptpshift; pte <<= (ptpshift + 12); pte >>= 12; *gpa = pte | (gla & (pgsize - 1)); done: - retval = 0; -error: ptp_release(&cookie); return (retval); +error: + retval = -1; + goto done; +pagefault: + retval = 1; + goto done; } int @@ -759,7 +787,7 @@ vmm_fetch_instruction(struct vm *vm, int uint64_t cr3, enum vie_paging_mode paging_mode, int cpl, struct vie *vie) { - int n, err, prot; + int n, error, prot; uint64_t gpa, off; void *hpa, *cookie; @@ -773,9 +801,10 @@ vmm_fetch_instruction(struct vm *vm, int /* Copy the instruction into 'vie' */ while (vie->num_valid < inst_length) { - err = gla2gpa(vm, rip, cr3, &gpa, paging_mode, cpl, prot); - if (err) - break; + error = vmm_gla2gpa(vm, cpuid, rip, cr3, &gpa, paging_mode, + cpl, prot); + if (error) + return (error); off = gpa & PAGE_MASK; n = min(inst_length - vie->num_valid, PAGE_SIZE - off); From owner-svn-src-head@FreeBSD.ORG Thu May 22 04:39:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF026C9B; Thu, 22 May 2014 04:39:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97D3A2331; Thu, 22 May 2014 04:39:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4M4davZ010396; Thu, 22 May 2014 04:39:36 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4M4dIKT010277; Thu, 22 May 2014 04:39:18 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201405220439.s4M4dIKT010277@svn.freebsd.org> From: Gregory Neil Shapiro Date: Thu, 22 May 2014 04:39:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266527 - in head/contrib/sendmail: . cf cf/cf cf/domain cf/feature cf/hack cf/m4 cf/mailer cf/ostype cf/sh contrib doc/op editmap include/libmilter include/libsmdb include/sendmail inc... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 04:39:36 -0000 Author: gshapiro Date: Thu May 22 04:39:17 2014 New Revision: 266527 URL: http://svnweb.freebsd.org/changeset/base/266527 Log: Merge sendmail 8.14.9 to HEAD MFC after: 3 days Modified: head/contrib/sendmail/CACerts head/contrib/sendmail/FAQ head/contrib/sendmail/INSTALL head/contrib/sendmail/KNOWNBUGS head/contrib/sendmail/LICENSE head/contrib/sendmail/Makefile head/contrib/sendmail/PGPKEYS head/contrib/sendmail/README head/contrib/sendmail/RELEASE_NOTES head/contrib/sendmail/cf/README head/contrib/sendmail/cf/cf/Makefile head/contrib/sendmail/cf/cf/README head/contrib/sendmail/cf/cf/chez.cs.mc head/contrib/sendmail/cf/cf/clientproto.mc head/contrib/sendmail/cf/cf/cs-hpux10.mc head/contrib/sendmail/cf/cf/cs-hpux9.mc head/contrib/sendmail/cf/cf/cs-osf1.mc head/contrib/sendmail/cf/cf/cs-solaris2.mc head/contrib/sendmail/cf/cf/cs-sunos4.1.mc head/contrib/sendmail/cf/cf/cs-ultrix4.mc head/contrib/sendmail/cf/cf/cyrusproto.mc head/contrib/sendmail/cf/cf/generic-bsd4.4.mc head/contrib/sendmail/cf/cf/generic-hpux10.mc head/contrib/sendmail/cf/cf/generic-hpux9.mc head/contrib/sendmail/cf/cf/generic-linux.mc head/contrib/sendmail/cf/cf/generic-mpeix.mc head/contrib/sendmail/cf/cf/generic-nextstep3.3.mc head/contrib/sendmail/cf/cf/generic-osf1.mc head/contrib/sendmail/cf/cf/generic-solaris.mc head/contrib/sendmail/cf/cf/generic-sunos4.1.mc head/contrib/sendmail/cf/cf/generic-ultrix4.mc head/contrib/sendmail/cf/cf/huginn.cs.mc head/contrib/sendmail/cf/cf/knecht.mc head/contrib/sendmail/cf/cf/mail.cs.mc head/contrib/sendmail/cf/cf/mail.eecs.mc head/contrib/sendmail/cf/cf/mailspool.cs.mc head/contrib/sendmail/cf/cf/python.cs.mc head/contrib/sendmail/cf/cf/s2k-osf1.mc head/contrib/sendmail/cf/cf/s2k-ultrix4.mc head/contrib/sendmail/cf/cf/submit.cf head/contrib/sendmail/cf/cf/submit.mc head/contrib/sendmail/cf/cf/tcpproto.mc head/contrib/sendmail/cf/cf/ucbarpa.mc head/contrib/sendmail/cf/cf/ucbvax.mc head/contrib/sendmail/cf/cf/uucpproto.mc head/contrib/sendmail/cf/cf/vangogh.cs.mc head/contrib/sendmail/cf/domain/Berkeley.EDU.m4 head/contrib/sendmail/cf/domain/CS.Berkeley.EDU.m4 head/contrib/sendmail/cf/domain/EECS.Berkeley.EDU.m4 head/contrib/sendmail/cf/domain/S2K.Berkeley.EDU.m4 head/contrib/sendmail/cf/domain/berkeley-only.m4 head/contrib/sendmail/cf/domain/generic.m4 head/contrib/sendmail/cf/feature/accept_unqualified_senders.m4 head/contrib/sendmail/cf/feature/accept_unresolvable_domains.m4 head/contrib/sendmail/cf/feature/access_db.m4 head/contrib/sendmail/cf/feature/allmasquerade.m4 head/contrib/sendmail/cf/feature/always_add_domain.m4 head/contrib/sendmail/cf/feature/authinfo.m4 head/contrib/sendmail/cf/feature/badmx.m4 head/contrib/sendmail/cf/feature/bestmx_is_local.m4 head/contrib/sendmail/cf/feature/bitdomain.m4 head/contrib/sendmail/cf/feature/blacklist_recipients.m4 head/contrib/sendmail/cf/feature/block_bad_helo.m4 head/contrib/sendmail/cf/feature/compat_check.m4 head/contrib/sendmail/cf/feature/conncontrol.m4 head/contrib/sendmail/cf/feature/delay_checks.m4 head/contrib/sendmail/cf/feature/dnsbl.m4 head/contrib/sendmail/cf/feature/domaintable.m4 head/contrib/sendmail/cf/feature/enhdnsbl.m4 head/contrib/sendmail/cf/feature/generics_entire_domain.m4 head/contrib/sendmail/cf/feature/genericstable.m4 head/contrib/sendmail/cf/feature/greet_pause.m4 head/contrib/sendmail/cf/feature/ldap_routing.m4 head/contrib/sendmail/cf/feature/limited_masquerade.m4 head/contrib/sendmail/cf/feature/local_lmtp.m4 head/contrib/sendmail/cf/feature/local_no_masquerade.m4 head/contrib/sendmail/cf/feature/local_procmail.m4 head/contrib/sendmail/cf/feature/lookupdotdomain.m4 head/contrib/sendmail/cf/feature/loose_relay_check.m4 head/contrib/sendmail/cf/feature/mailertable.m4 head/contrib/sendmail/cf/feature/masquerade_entire_domain.m4 head/contrib/sendmail/cf/feature/masquerade_envelope.m4 head/contrib/sendmail/cf/feature/msp.m4 head/contrib/sendmail/cf/feature/mtamark.m4 head/contrib/sendmail/cf/feature/no_default_msa.m4 head/contrib/sendmail/cf/feature/nocanonify.m4 head/contrib/sendmail/cf/feature/notsticky.m4 head/contrib/sendmail/cf/feature/nouucp.m4 head/contrib/sendmail/cf/feature/nullclient.m4 head/contrib/sendmail/cf/feature/preserve_local_plus_detail.m4 head/contrib/sendmail/cf/feature/preserve_luser_host.m4 head/contrib/sendmail/cf/feature/promiscuous_relay.m4 head/contrib/sendmail/cf/feature/queuegroup.m4 head/contrib/sendmail/cf/feature/ratecontrol.m4 head/contrib/sendmail/cf/feature/redirect.m4 head/contrib/sendmail/cf/feature/relay_based_on_MX.m4 head/contrib/sendmail/cf/feature/relay_entire_domain.m4 head/contrib/sendmail/cf/feature/relay_hosts_only.m4 head/contrib/sendmail/cf/feature/relay_local_from.m4 head/contrib/sendmail/cf/feature/relay_mail_from.m4 head/contrib/sendmail/cf/feature/require_rdns.m4 head/contrib/sendmail/cf/feature/smrsh.m4 head/contrib/sendmail/cf/feature/stickyhost.m4 head/contrib/sendmail/cf/feature/use_client_ptr.m4 head/contrib/sendmail/cf/feature/use_ct_file.m4 head/contrib/sendmail/cf/feature/use_cw_file.m4 head/contrib/sendmail/cf/feature/uucpdomain.m4 head/contrib/sendmail/cf/feature/virtuser_entire_domain.m4 head/contrib/sendmail/cf/feature/virtusertable.m4 head/contrib/sendmail/cf/hack/cssubdomain.m4 head/contrib/sendmail/cf/m4/cf.m4 head/contrib/sendmail/cf/m4/cfhead.m4 head/contrib/sendmail/cf/m4/proto.m4 head/contrib/sendmail/cf/m4/version.m4 head/contrib/sendmail/cf/mailer/cyrus.m4 head/contrib/sendmail/cf/mailer/cyrusv2.m4 head/contrib/sendmail/cf/mailer/fax.m4 head/contrib/sendmail/cf/mailer/local.m4 head/contrib/sendmail/cf/mailer/mail11.m4 head/contrib/sendmail/cf/mailer/phquery.m4 head/contrib/sendmail/cf/mailer/pop.m4 head/contrib/sendmail/cf/mailer/procmail.m4 head/contrib/sendmail/cf/mailer/qpage.m4 head/contrib/sendmail/cf/mailer/smtp.m4 head/contrib/sendmail/cf/mailer/usenet.m4 head/contrib/sendmail/cf/mailer/uucp.m4 head/contrib/sendmail/cf/ostype/a-ux.m4 head/contrib/sendmail/cf/ostype/aix3.m4 head/contrib/sendmail/cf/ostype/aix4.m4 head/contrib/sendmail/cf/ostype/aix5.m4 head/contrib/sendmail/cf/ostype/altos.m4 head/contrib/sendmail/cf/ostype/amdahl-uts.m4 head/contrib/sendmail/cf/ostype/bsd4.3.m4 head/contrib/sendmail/cf/ostype/bsd4.4.m4 head/contrib/sendmail/cf/ostype/bsdi.m4 head/contrib/sendmail/cf/ostype/bsdi1.0.m4 head/contrib/sendmail/cf/ostype/bsdi2.0.m4 head/contrib/sendmail/cf/ostype/darwin.m4 head/contrib/sendmail/cf/ostype/dgux.m4 head/contrib/sendmail/cf/ostype/domainos.m4 head/contrib/sendmail/cf/ostype/dragonfly.m4 head/contrib/sendmail/cf/ostype/dynix3.2.m4 head/contrib/sendmail/cf/ostype/freebsd4.m4 head/contrib/sendmail/cf/ostype/freebsd5.m4 head/contrib/sendmail/cf/ostype/freebsd6.m4 head/contrib/sendmail/cf/ostype/gnu.m4 head/contrib/sendmail/cf/ostype/hpux10.m4 head/contrib/sendmail/cf/ostype/hpux11.m4 head/contrib/sendmail/cf/ostype/hpux9.m4 head/contrib/sendmail/cf/ostype/irix4.m4 head/contrib/sendmail/cf/ostype/irix5.m4 head/contrib/sendmail/cf/ostype/irix6.m4 head/contrib/sendmail/cf/ostype/isc4.1.m4 head/contrib/sendmail/cf/ostype/linux.m4 head/contrib/sendmail/cf/ostype/maxion.m4 head/contrib/sendmail/cf/ostype/mklinux.m4 head/contrib/sendmail/cf/ostype/mpeix.m4 head/contrib/sendmail/cf/ostype/nextstep.m4 head/contrib/sendmail/cf/ostype/openbsd.m4 head/contrib/sendmail/cf/ostype/osf1.m4 head/contrib/sendmail/cf/ostype/powerux.m4 head/contrib/sendmail/cf/ostype/ptx2.m4 head/contrib/sendmail/cf/ostype/qnx.m4 head/contrib/sendmail/cf/ostype/riscos4.5.m4 head/contrib/sendmail/cf/ostype/sco-uw-2.1.m4 head/contrib/sendmail/cf/ostype/sco3.2.m4 head/contrib/sendmail/cf/ostype/sinix.m4 head/contrib/sendmail/cf/ostype/solaris11.m4 head/contrib/sendmail/cf/ostype/solaris2.m4 head/contrib/sendmail/cf/ostype/solaris2.ml.m4 head/contrib/sendmail/cf/ostype/solaris2.pre5.m4 head/contrib/sendmail/cf/ostype/solaris8.m4 head/contrib/sendmail/cf/ostype/sunos3.5.m4 head/contrib/sendmail/cf/ostype/sunos4.1.m4 head/contrib/sendmail/cf/ostype/svr4.m4 head/contrib/sendmail/cf/ostype/ultrix4.m4 head/contrib/sendmail/cf/ostype/unicos.m4 head/contrib/sendmail/cf/ostype/unicosmk.m4 head/contrib/sendmail/cf/ostype/unicosmp.m4 head/contrib/sendmail/cf/ostype/unixware7.m4 head/contrib/sendmail/cf/ostype/unknown.m4 head/contrib/sendmail/cf/ostype/uxpds.m4 head/contrib/sendmail/cf/sendmail.schema head/contrib/sendmail/cf/sh/makeinfo.sh head/contrib/sendmail/contrib/README head/contrib/sendmail/contrib/bsdi.mc head/contrib/sendmail/contrib/buildvirtuser head/contrib/sendmail/contrib/cidrexpand head/contrib/sendmail/contrib/dnsblaccess.m4 head/contrib/sendmail/contrib/link_hash.sh head/contrib/sendmail/contrib/qtool.8 head/contrib/sendmail/contrib/qtool.pl head/contrib/sendmail/contrib/smcontrol.pl head/contrib/sendmail/contrib/socketmapClient.pl head/contrib/sendmail/contrib/socketmapServer.pl head/contrib/sendmail/doc/op/Makefile head/contrib/sendmail/doc/op/README head/contrib/sendmail/doc/op/op.me head/contrib/sendmail/editmap/Makefile head/contrib/sendmail/editmap/Makefile.m4 head/contrib/sendmail/editmap/editmap.8 head/contrib/sendmail/editmap/editmap.c head/contrib/sendmail/include/libmilter/mfapi.h head/contrib/sendmail/include/libmilter/mfdef.h head/contrib/sendmail/include/libmilter/milter.h head/contrib/sendmail/include/libsmdb/smdb.h head/contrib/sendmail/include/sendmail/mailstats.h head/contrib/sendmail/include/sendmail/pathnames.h head/contrib/sendmail/include/sendmail/sendmail.h head/contrib/sendmail/include/sm/assert.h head/contrib/sendmail/include/sm/bdb.h head/contrib/sendmail/include/sm/bitops.h head/contrib/sendmail/include/sm/cdefs.h head/contrib/sendmail/include/sm/cf.h head/contrib/sendmail/include/sm/clock.h head/contrib/sendmail/include/sm/conf.h head/contrib/sendmail/include/sm/config.h head/contrib/sendmail/include/sm/debug.h head/contrib/sendmail/include/sm/errstring.h head/contrib/sendmail/include/sm/exc.h head/contrib/sendmail/include/sm/fdset.h head/contrib/sendmail/include/sm/gen.h head/contrib/sendmail/include/sm/heap.h head/contrib/sendmail/include/sm/io.h head/contrib/sendmail/include/sm/ldap.h head/contrib/sendmail/include/sm/limits.h head/contrib/sendmail/include/sm/mbdb.h head/contrib/sendmail/include/sm/misc.h head/contrib/sendmail/include/sm/os/sm_os_aix.h head/contrib/sendmail/include/sm/os/sm_os_dragonfly.h head/contrib/sendmail/include/sm/os/sm_os_freebsd.h head/contrib/sendmail/include/sm/os/sm_os_hp.h head/contrib/sendmail/include/sm/os/sm_os_irix.h head/contrib/sendmail/include/sm/os/sm_os_linux.h head/contrib/sendmail/include/sm/os/sm_os_mpeix.h head/contrib/sendmail/include/sm/os/sm_os_next.h head/contrib/sendmail/include/sm/os/sm_os_openbsd.h head/contrib/sendmail/include/sm/os/sm_os_openunix.h head/contrib/sendmail/include/sm/os/sm_os_osf1.h head/contrib/sendmail/include/sm/os/sm_os_qnx.h head/contrib/sendmail/include/sm/os/sm_os_sunos.h head/contrib/sendmail/include/sm/os/sm_os_ultrix.h head/contrib/sendmail/include/sm/os/sm_os_unicos.h head/contrib/sendmail/include/sm/os/sm_os_unicosmk.h head/contrib/sendmail/include/sm/os/sm_os_unicosmp.h head/contrib/sendmail/include/sm/os/sm_os_unixware.h head/contrib/sendmail/include/sm/path.h head/contrib/sendmail/include/sm/rpool.h head/contrib/sendmail/include/sm/sem.h head/contrib/sendmail/include/sm/setjmp.h head/contrib/sendmail/include/sm/shm.h head/contrib/sendmail/include/sm/signal.h head/contrib/sendmail/include/sm/string.h head/contrib/sendmail/include/sm/sysexits.h head/contrib/sendmail/include/sm/tailq.h head/contrib/sendmail/include/sm/test.h head/contrib/sendmail/include/sm/time.h head/contrib/sendmail/include/sm/types.h head/contrib/sendmail/include/sm/varargs.h head/contrib/sendmail/include/sm/xtrap.h head/contrib/sendmail/libmilter/Makefile head/contrib/sendmail/libmilter/Makefile.m4 head/contrib/sendmail/libmilter/README head/contrib/sendmail/libmilter/comm.c head/contrib/sendmail/libmilter/docs/api.html head/contrib/sendmail/libmilter/docs/design.html head/contrib/sendmail/libmilter/docs/index.html head/contrib/sendmail/libmilter/docs/installation.html head/contrib/sendmail/libmilter/docs/other.html head/contrib/sendmail/libmilter/docs/overview.html head/contrib/sendmail/libmilter/docs/sample.html head/contrib/sendmail/libmilter/docs/smfi_addheader.html head/contrib/sendmail/libmilter/docs/smfi_addrcpt.html head/contrib/sendmail/libmilter/docs/smfi_addrcpt_par.html head/contrib/sendmail/libmilter/docs/smfi_chgfrom.html head/contrib/sendmail/libmilter/docs/smfi_chgheader.html head/contrib/sendmail/libmilter/docs/smfi_delrcpt.html head/contrib/sendmail/libmilter/docs/smfi_getpriv.html head/contrib/sendmail/libmilter/docs/smfi_getsymval.html head/contrib/sendmail/libmilter/docs/smfi_insheader.html head/contrib/sendmail/libmilter/docs/smfi_main.html head/contrib/sendmail/libmilter/docs/smfi_opensocket.html head/contrib/sendmail/libmilter/docs/smfi_progress.html head/contrib/sendmail/libmilter/docs/smfi_quarantine.html head/contrib/sendmail/libmilter/docs/smfi_register.html head/contrib/sendmail/libmilter/docs/smfi_replacebody.html head/contrib/sendmail/libmilter/docs/smfi_setbacklog.html head/contrib/sendmail/libmilter/docs/smfi_setconn.html head/contrib/sendmail/libmilter/docs/smfi_setdbg.html head/contrib/sendmail/libmilter/docs/smfi_setmlreply.html head/contrib/sendmail/libmilter/docs/smfi_setpriv.html head/contrib/sendmail/libmilter/docs/smfi_setreply.html head/contrib/sendmail/libmilter/docs/smfi_setsymlist.html head/contrib/sendmail/libmilter/docs/smfi_settimeout.html head/contrib/sendmail/libmilter/docs/smfi_stop.html head/contrib/sendmail/libmilter/docs/smfi_version.html head/contrib/sendmail/libmilter/docs/xxfi_abort.html head/contrib/sendmail/libmilter/docs/xxfi_body.html head/contrib/sendmail/libmilter/docs/xxfi_close.html head/contrib/sendmail/libmilter/docs/xxfi_connect.html head/contrib/sendmail/libmilter/docs/xxfi_data.html head/contrib/sendmail/libmilter/docs/xxfi_envfrom.html head/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html head/contrib/sendmail/libmilter/docs/xxfi_eoh.html head/contrib/sendmail/libmilter/docs/xxfi_eom.html head/contrib/sendmail/libmilter/docs/xxfi_header.html head/contrib/sendmail/libmilter/docs/xxfi_helo.html head/contrib/sendmail/libmilter/docs/xxfi_negotiate.html head/contrib/sendmail/libmilter/docs/xxfi_unknown.html head/contrib/sendmail/libmilter/engine.c head/contrib/sendmail/libmilter/example.c head/contrib/sendmail/libmilter/handler.c head/contrib/sendmail/libmilter/libmilter.h head/contrib/sendmail/libmilter/listener.c head/contrib/sendmail/libmilter/main.c head/contrib/sendmail/libmilter/monitor.c head/contrib/sendmail/libmilter/signal.c head/contrib/sendmail/libmilter/sm_gethost.c head/contrib/sendmail/libmilter/smfi.c head/contrib/sendmail/libmilter/worker.c head/contrib/sendmail/libsm/Makefile head/contrib/sendmail/libsm/Makefile.m4 head/contrib/sendmail/libsm/README head/contrib/sendmail/libsm/assert.c head/contrib/sendmail/libsm/assert.html head/contrib/sendmail/libsm/b-strcmp.c head/contrib/sendmail/libsm/b-strl.c head/contrib/sendmail/libsm/cdefs.html head/contrib/sendmail/libsm/cf.c head/contrib/sendmail/libsm/clock.c head/contrib/sendmail/libsm/clrerr.c head/contrib/sendmail/libsm/config.c head/contrib/sendmail/libsm/debug.c head/contrib/sendmail/libsm/debug.html head/contrib/sendmail/libsm/errstring.c head/contrib/sendmail/libsm/exc.c head/contrib/sendmail/libsm/exc.html head/contrib/sendmail/libsm/fclose.c head/contrib/sendmail/libsm/feof.c head/contrib/sendmail/libsm/ferror.c head/contrib/sendmail/libsm/fflush.c head/contrib/sendmail/libsm/fget.c head/contrib/sendmail/libsm/findfp.c head/contrib/sendmail/libsm/flags.c head/contrib/sendmail/libsm/fopen.c head/contrib/sendmail/libsm/fpos.c head/contrib/sendmail/libsm/fprintf.c head/contrib/sendmail/libsm/fpurge.c head/contrib/sendmail/libsm/fput.c head/contrib/sendmail/libsm/fread.c head/contrib/sendmail/libsm/fscanf.c head/contrib/sendmail/libsm/fseek.c head/contrib/sendmail/libsm/fvwrite.c head/contrib/sendmail/libsm/fvwrite.h head/contrib/sendmail/libsm/fwalk.c head/contrib/sendmail/libsm/fwrite.c head/contrib/sendmail/libsm/gen.html head/contrib/sendmail/libsm/get.c head/contrib/sendmail/libsm/glue.h head/contrib/sendmail/libsm/heap.c head/contrib/sendmail/libsm/heap.html head/contrib/sendmail/libsm/index.html head/contrib/sendmail/libsm/inet6_ntop.c head/contrib/sendmail/libsm/io.html head/contrib/sendmail/libsm/ldap.c head/contrib/sendmail/libsm/local.h head/contrib/sendmail/libsm/makebuf.c head/contrib/sendmail/libsm/match.c head/contrib/sendmail/libsm/mbdb.c head/contrib/sendmail/libsm/memstat.c head/contrib/sendmail/libsm/mpeix.c head/contrib/sendmail/libsm/niprop.c head/contrib/sendmail/libsm/path.c head/contrib/sendmail/libsm/put.c head/contrib/sendmail/libsm/refill.c head/contrib/sendmail/libsm/rewind.c head/contrib/sendmail/libsm/rpool.c head/contrib/sendmail/libsm/rpool.html head/contrib/sendmail/libsm/sem.c head/contrib/sendmail/libsm/setvbuf.c head/contrib/sendmail/libsm/shm.c head/contrib/sendmail/libsm/signal.c head/contrib/sendmail/libsm/smstdio.c head/contrib/sendmail/libsm/snprintf.c head/contrib/sendmail/libsm/sscanf.c head/contrib/sendmail/libsm/stdio.c head/contrib/sendmail/libsm/strcasecmp.c head/contrib/sendmail/libsm/strdup.c head/contrib/sendmail/libsm/strerror.c head/contrib/sendmail/libsm/strexit.c head/contrib/sendmail/libsm/string.c head/contrib/sendmail/libsm/stringf.c head/contrib/sendmail/libsm/strio.c head/contrib/sendmail/libsm/strl.c head/contrib/sendmail/libsm/strrevcmp.c head/contrib/sendmail/libsm/strto.c head/contrib/sendmail/libsm/syslogio.c head/contrib/sendmail/libsm/t-cf.c head/contrib/sendmail/libsm/t-event.c head/contrib/sendmail/libsm/t-exc.c head/contrib/sendmail/libsm/t-fget.c head/contrib/sendmail/libsm/t-float.c head/contrib/sendmail/libsm/t-fopen.c head/contrib/sendmail/libsm/t-heap.c head/contrib/sendmail/libsm/t-inet6_ntop.c head/contrib/sendmail/libsm/t-match.c head/contrib/sendmail/libsm/t-memstat.c head/contrib/sendmail/libsm/t-path.c head/contrib/sendmail/libsm/t-qic.c head/contrib/sendmail/libsm/t-rpool.c head/contrib/sendmail/libsm/t-scanf.c head/contrib/sendmail/libsm/t-sem.c head/contrib/sendmail/libsm/t-shm.c head/contrib/sendmail/libsm/t-smstdio.c head/contrib/sendmail/libsm/t-string.c head/contrib/sendmail/libsm/t-strio.c head/contrib/sendmail/libsm/t-strl.c head/contrib/sendmail/libsm/t-strrevcmp.c head/contrib/sendmail/libsm/t-types.c head/contrib/sendmail/libsm/test.c head/contrib/sendmail/libsm/ungetc.c head/contrib/sendmail/libsm/util.c head/contrib/sendmail/libsm/vasprintf.c head/contrib/sendmail/libsm/vfprintf.c head/contrib/sendmail/libsm/vfscanf.c head/contrib/sendmail/libsm/vprintf.c head/contrib/sendmail/libsm/vsnprintf.c head/contrib/sendmail/libsm/wbuf.c head/contrib/sendmail/libsm/wsetup.c head/contrib/sendmail/libsm/xtrap.c head/contrib/sendmail/libsmdb/Makefile head/contrib/sendmail/libsmdb/Makefile.m4 head/contrib/sendmail/libsmdb/smdb.c head/contrib/sendmail/libsmdb/smdb1.c head/contrib/sendmail/libsmdb/smdb2.c head/contrib/sendmail/libsmdb/smndbm.c head/contrib/sendmail/libsmutil/Makefile head/contrib/sendmail/libsmutil/Makefile.m4 head/contrib/sendmail/libsmutil/cf.c head/contrib/sendmail/libsmutil/debug.c head/contrib/sendmail/libsmutil/err.c head/contrib/sendmail/libsmutil/lockfile.c head/contrib/sendmail/libsmutil/safefile.c head/contrib/sendmail/libsmutil/snprintf.c head/contrib/sendmail/mail.local/Makefile head/contrib/sendmail/mail.local/Makefile.m4 head/contrib/sendmail/mail.local/README head/contrib/sendmail/mail.local/mail.local.8 head/contrib/sendmail/mail.local/mail.local.c head/contrib/sendmail/mailstats/Makefile head/contrib/sendmail/mailstats/Makefile.m4 head/contrib/sendmail/mailstats/mailstats.8 head/contrib/sendmail/mailstats/mailstats.c head/contrib/sendmail/makemap/Makefile head/contrib/sendmail/makemap/Makefile.m4 head/contrib/sendmail/makemap/makemap.8 head/contrib/sendmail/makemap/makemap.c head/contrib/sendmail/praliases/Makefile head/contrib/sendmail/praliases/Makefile.m4 head/contrib/sendmail/praliases/praliases.8 head/contrib/sendmail/praliases/praliases.c head/contrib/sendmail/rmail/Makefile head/contrib/sendmail/rmail/Makefile.m4 head/contrib/sendmail/rmail/rmail.8 head/contrib/sendmail/rmail/rmail.c head/contrib/sendmail/smrsh/Makefile head/contrib/sendmail/smrsh/Makefile.m4 head/contrib/sendmail/smrsh/README head/contrib/sendmail/smrsh/smrsh.8 head/contrib/sendmail/smrsh/smrsh.c head/contrib/sendmail/src/Makefile head/contrib/sendmail/src/Makefile.m4 head/contrib/sendmail/src/README head/contrib/sendmail/src/SECURITY head/contrib/sendmail/src/TRACEFLAGS head/contrib/sendmail/src/TUNING head/contrib/sendmail/src/alias.c head/contrib/sendmail/src/aliases head/contrib/sendmail/src/aliases.5 head/contrib/sendmail/src/arpadate.c head/contrib/sendmail/src/bf.c head/contrib/sendmail/src/bf.h head/contrib/sendmail/src/collect.c head/contrib/sendmail/src/conf.c head/contrib/sendmail/src/conf.h head/contrib/sendmail/src/control.c head/contrib/sendmail/src/convtime.c head/contrib/sendmail/src/daemon.c head/contrib/sendmail/src/daemon.h head/contrib/sendmail/src/deliver.c head/contrib/sendmail/src/domain.c head/contrib/sendmail/src/envelope.c head/contrib/sendmail/src/err.c head/contrib/sendmail/src/headers.c head/contrib/sendmail/src/helpfile head/contrib/sendmail/src/macro.c head/contrib/sendmail/src/mailq.1 head/contrib/sendmail/src/main.c head/contrib/sendmail/src/map.c head/contrib/sendmail/src/map.h head/contrib/sendmail/src/mci.c head/contrib/sendmail/src/milter.c head/contrib/sendmail/src/mime.c head/contrib/sendmail/src/newaliases.1 head/contrib/sendmail/src/parseaddr.c head/contrib/sendmail/src/queue.c head/contrib/sendmail/src/ratectrl.c head/contrib/sendmail/src/readcf.c head/contrib/sendmail/src/recipient.c head/contrib/sendmail/src/sasl.c head/contrib/sendmail/src/savemail.c head/contrib/sendmail/src/sendmail.8 head/contrib/sendmail/src/sendmail.h head/contrib/sendmail/src/sfsasl.c head/contrib/sendmail/src/sfsasl.h head/contrib/sendmail/src/shmticklib.c head/contrib/sendmail/src/sm_resolve.c head/contrib/sendmail/src/sm_resolve.h head/contrib/sendmail/src/srvrsmtp.c head/contrib/sendmail/src/stab.c head/contrib/sendmail/src/stats.c head/contrib/sendmail/src/statusd_shm.h head/contrib/sendmail/src/sysexits.c head/contrib/sendmail/src/timers.c head/contrib/sendmail/src/timers.h head/contrib/sendmail/src/tls.c head/contrib/sendmail/src/trace.c head/contrib/sendmail/src/udb.c head/contrib/sendmail/src/usersmtp.c head/contrib/sendmail/src/util.c head/contrib/sendmail/src/version.c head/contrib/sendmail/test/Makefile head/contrib/sendmail/test/Makefile.m4 head/contrib/sendmail/test/README head/contrib/sendmail/test/Results head/contrib/sendmail/test/t_dropgid.c head/contrib/sendmail/test/t_exclopen.c head/contrib/sendmail/test/t_pathconf.c head/contrib/sendmail/test/t_seteuid.c head/contrib/sendmail/test/t_setgid.c head/contrib/sendmail/test/t_setreuid.c head/contrib/sendmail/test/t_setuid.c head/contrib/sendmail/test/t_snprintf.c head/contrib/sendmail/vacation/Makefile head/contrib/sendmail/vacation/Makefile.m4 head/contrib/sendmail/vacation/vacation.1 head/contrib/sendmail/vacation/vacation.c Directory Properties: head/contrib/sendmail/ (props changed) Modified: head/contrib/sendmail/CACerts ============================================================================== --- head/contrib/sendmail/CACerts Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/CACerts Thu May 22 04:39:17 2014 (r266527) @@ -1,4 +1,4 @@ -# $Id: CACerts,v 8.6 2013/01/18 15:14:17 ca Exp $ +# $Id: CACerts,v 8.6 2013-01-18 15:14:17 ca Exp $ # This file contains some CA certificates that are used to sign the # certificates of mail servers of members of the sendmail consortium # who may reply to questions etc sent to sendmail.org. Modified: head/contrib/sendmail/FAQ ============================================================================== --- head/contrib/sendmail/FAQ Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/FAQ Thu May 22 04:39:17 2014 (r266527) @@ -5,4 +5,4 @@ A plain-text version of the questions on the answers, is posted to comp.mail.sendmail on the 10th and 25th of each month. -$Revision: 8.24 $, Last updated $Date: 1999/02/07 03:21:03 $ +$Revision: 8.24 $, Last updated $Date: 1999-02-07 03:21:03 $ Modified: head/contrib/sendmail/INSTALL ============================================================================== --- head/contrib/sendmail/INSTALL Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/INSTALL Thu May 22 04:39:17 2014 (r266527) @@ -43,4 +43,4 @@ sendmail/SECURITY for more installation in case you are now using a different (and thereby incompatible) version of Berkeley DB. -$Revision: 8.16 $, Last updated $Date: 2007/10/03 21:00:28 $ +$Revision: 8.16 $, Last updated $Date: 2007-10-03 21:00:28 $ Modified: head/contrib/sendmail/KNOWNBUGS ============================================================================== --- head/contrib/sendmail/KNOWNBUGS Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/KNOWNBUGS Thu May 22 04:39:17 2014 (r266527) @@ -266,4 +266,4 @@ Kresolve sequence dnsmx canon be used if set instead of LOCAL_RELAY ($R). This will be fixed in a future version. -$Revision: 8.61 $, Last updated $Date: 2011/04/07 17:48:23 $ +$Revision: 8.61 $, Last updated $Date: 2011-04-07 17:48:23 $ Modified: head/contrib/sendmail/LICENSE ============================================================================== --- head/contrib/sendmail/LICENSE Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/LICENSE Thu May 22 04:39:17 2014 (r266527) @@ -35,7 +35,7 @@ each of the following conditions is met: forth as paragraph 6 below, in the documentation and/or other materials provided with the distribution. For the purposes of binary distribution the "Copyright Notice" refers to the following language: - "Copyright (c) 1998-2013 Proofpoint, Inc. All rights reserved." + "Copyright (c) 1998-2014 Proofpoint, Inc. All rights reserved." 4. Neither the name of Proofpoint, Inc. nor the University of California nor names of their contributors may be used to endorse or promote @@ -78,4 +78,4 @@ each of the following conditions is met: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -$Revision: 8.22 $, Last updated $Date: 2013/11/23 04:37:36 $, Document 139848.1 +$Revision: 8.23 $, Last updated $Date: 2014-01-26 20:10:01 $, Document 139848.1 Modified: head/contrib/sendmail/Makefile ============================================================================== --- head/contrib/sendmail/Makefile Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/Makefile Thu May 22 04:39:17 2014 (r266527) @@ -1,4 +1,4 @@ -# $Id: Makefile.dist,v 8.15 2001/08/23 20:44:39 ca Exp $ +# $Id: Makefile.dist,v 8.15 2001-08-23 20:44:39 ca Exp $ SHELL= /bin/sh SUBDIRS= libsm libsmutil libsmdb sendmail editmap mail.local \ Modified: head/contrib/sendmail/PGPKEYS ============================================================================== --- head/contrib/sendmail/PGPKEYS Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/PGPKEYS Thu May 22 04:39:17 2014 (r266527) @@ -2613,4 +2613,4 @@ DnF3FZZEzV7oqPwC2jzv/1dD6GFhtgy0cnyoPGUJ =nES8 -----END PGP PUBLIC KEY BLOCK----- -$Revision: 8.46 $, Last updated $Date: 2014/01/18 00:20:24 $ +$Revision: 8.46 $, Last updated $Date: 2014-01-18 00:20:24 $ Modified: head/contrib/sendmail/README ============================================================================== --- head/contrib/sendmail/README Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/README Thu May 22 04:39:17 2014 (r266527) @@ -465,4 +465,4 @@ sendmail Source for the sendmail program test Some test scripts (currently only for compilation aids). vacation Source for the vacation program. NOT PART OF SENDMAIL! -$Revision: 8.96 $, Last updated $Date: 2013/11/22 20:51:01 $ +$Revision: 8.96 $, Last updated $Date: 2013-11-22 20:51:01 $ Modified: head/contrib/sendmail/RELEASE_NOTES ============================================================================== --- head/contrib/sendmail/RELEASE_NOTES Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/RELEASE_NOTES Thu May 22 04:39:17 2014 (r266527) @@ -1,11 +1,20 @@ SENDMAIL RELEASE NOTES - $Id: RELEASE_NOTES,v 8.2043 2014/01/23 20:27:19 ca Exp $ This listing shows the version of the sendmail binary, the version of the sendmail configuration files, the date of release, and a summary of the changes in that release. +8.14.9/8.14.9 2014/05/21 + SECURITY: Properly set the close-on-exec flag for file descriptors + (except stdin, stdout, and stderr) before executing mailers. + Fix a misformed comment in conf.c: "/*" within comment + which may cause a compilation error on some systems. + Problem reported by John Beck of Oracle. + DEVTOOLS: Fix regression in auto-detection of libraries when only + shared libraries are available. Problem reported by + Bryan Costales. + 8.14.8/8.14.8 2014/01/26 Properly initialize all OpenSSL algorithms for versions before OpenSSL 0.9.8o. Without this SHA2 algorithms may not Modified: head/contrib/sendmail/cf/README ============================================================================== --- head/contrib/sendmail/cf/README Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/README Thu May 22 04:39:17 2014 (r266527) @@ -4704,4 +4704,4 @@ M4 DIVERSIONS 8 DNS based blacklists 9 special local rulesets (1 and 2) -$Revision: 8.730 $, Last updated $Date: 2014/01/16 15:55:51 $ +$Revision: 8.730 $, Last updated $Date: 2014-01-16 15:55:51 $ Modified: head/contrib/sendmail/cf/cf/Makefile ============================================================================== --- head/contrib/sendmail/cf/cf/Makefile Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/Makefile Thu May 22 04:39:17 2014 (r266527) @@ -1,7 +1,7 @@ # # Makefile for configuration files. # -# $Id: Makefile,v 8.60 2005/06/14 02:16:34 gshapiro Exp $ +# $Id: Makefile,v 8.60 2005-06-14 02:16:34 gshapiro Exp $ # # Modified: head/contrib/sendmail/cf/cf/README ============================================================================== --- head/contrib/sendmail/cf/cf/README Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/README Thu May 22 04:39:17 2014 (r266527) @@ -31,4 +31,4 @@ The name of the source file for "submit. For more details see Makefile. -$Revision: 1.2 $, Last updated $Date: 2002/02/22 00:33:54 $ +$Revision: 1.2 $, Last updated $Date: 2002-02-22 00:33:54 $ Modified: head/contrib/sendmail/cf/cf/chez.cs.mc ============================================================================== --- head/contrib/sendmail/cf/cf/chez.cs.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/chez.cs.mc Thu May 22 04:39:17 2014 (r266527) @@ -24,7 +24,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: chez.cs.mc,v 8.15 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: chez.cs.mc,v 8.15 2013-11-22 20:51:08 ca Exp $') OSTYPE(bsd4.4)dnl DOMAIN(CS.Berkeley.EDU)dnl define(`LOCAL_RELAY', vangogh.CS.Berkeley.EDU)dnl Modified: head/contrib/sendmail/cf/cf/clientproto.mc ============================================================================== --- head/contrib/sendmail/cf/cf/clientproto.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/clientproto.mc Thu May 22 04:39:17 2014 (r266527) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: clientproto.mc,v 8.17 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: clientproto.mc,v 8.17 2013-11-22 20:51:08 ca Exp $') OSTYPE(unknown) FEATURE(nullclient, mailhost.$m) Modified: head/contrib/sendmail/cf/cf/cs-hpux10.mc ============================================================================== --- head/contrib/sendmail/cf/cf/cs-hpux10.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/cs-hpux10.mc Thu May 22 04:39:17 2014 (r266527) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: cs-hpux10.mc,v 8.14 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: cs-hpux10.mc,v 8.14 2013-11-22 20:51:08 ca Exp $') OSTYPE(hpux10)dnl DOMAIN(CS.Berkeley.EDU)dnl define(`MAIL_HUB', mailspool.CS.Berkeley.EDU)dnl Modified: head/contrib/sendmail/cf/cf/cs-hpux9.mc ============================================================================== --- head/contrib/sendmail/cf/cf/cs-hpux9.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/cs-hpux9.mc Thu May 22 04:39:17 2014 (r266527) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: cs-hpux9.mc,v 8.15 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: cs-hpux9.mc,v 8.15 2013-11-22 20:51:08 ca Exp $') OSTYPE(hpux9)dnl DOMAIN(CS.Berkeley.EDU)dnl define(`MAIL_HUB', mailspool.CS.Berkeley.EDU)dnl Modified: head/contrib/sendmail/cf/cf/cs-osf1.mc ============================================================================== --- head/contrib/sendmail/cf/cf/cs-osf1.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/cs-osf1.mc Thu May 22 04:39:17 2014 (r266527) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: cs-osf1.mc,v 8.14 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: cs-osf1.mc,v 8.14 2013-11-22 20:51:08 ca Exp $') OSTYPE(osf1)dnl DOMAIN(CS.Berkeley.EDU)dnl MAILER(local)dnl Modified: head/contrib/sendmail/cf/cf/cs-solaris2.mc ============================================================================== --- head/contrib/sendmail/cf/cf/cs-solaris2.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/cs-solaris2.mc Thu May 22 04:39:17 2014 (r266527) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: cs-solaris2.mc,v 8.13 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: cs-solaris2.mc,v 8.13 2013-11-22 20:51:08 ca Exp $') OSTYPE(solaris2)dnl DOMAIN(CS.Berkeley.EDU)dnl MAILER(local)dnl Modified: head/contrib/sendmail/cf/cf/cs-sunos4.1.mc ============================================================================== --- head/contrib/sendmail/cf/cf/cs-sunos4.1.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/cs-sunos4.1.mc Thu May 22 04:39:17 2014 (r266527) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: cs-sunos4.1.mc,v 8.14 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: cs-sunos4.1.mc,v 8.14 2013-11-22 20:51:08 ca Exp $') OSTYPE(sunos4.1)dnl DOMAIN(CS.Berkeley.EDU)dnl MAILER(local)dnl Modified: head/contrib/sendmail/cf/cf/cs-ultrix4.mc ============================================================================== --- head/contrib/sendmail/cf/cf/cs-ultrix4.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/cs-ultrix4.mc Thu May 22 04:39:17 2014 (r266527) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: cs-ultrix4.mc,v 8.14 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: cs-ultrix4.mc,v 8.14 2013-11-22 20:51:08 ca Exp $') OSTYPE(ultrix4)dnl DOMAIN(CS.Berkeley.EDU)dnl MAILER(local)dnl Modified: head/contrib/sendmail/cf/cf/cyrusproto.mc ============================================================================== --- head/contrib/sendmail/cf/cf/cyrusproto.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/cyrusproto.mc Thu May 22 04:39:17 2014 (r266527) @@ -27,7 +27,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: cyrusproto.mc,v 8.7 1999/09/07 14:57:10 ca Exp $') +VERSIONID(`$Id: cyrusproto.mc,v 8.7 1999-09-07 14:57:10 ca Exp $') define(`confBIND_OPTS',`-DNSRCH -DEFNAMES') define(`confLOCAL_MAILER', `cyrus') FEATURE(`nocanonify') Modified: head/contrib/sendmail/cf/cf/generic-bsd4.4.mc ============================================================================== --- head/contrib/sendmail/cf/cf/generic-bsd4.4.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/generic-bsd4.4.mc Thu May 22 04:39:17 2014 (r266527) @@ -21,7 +21,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-bsd4.4.mc,v 8.11 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-bsd4.4.mc,v 8.11 2013-11-22 20:51:08 ca Exp $') OSTYPE(bsd4.4)dnl DOMAIN(generic)dnl MAILER(local)dnl Modified: head/contrib/sendmail/cf/cf/generic-hpux10.mc ============================================================================== --- head/contrib/sendmail/cf/cf/generic-hpux10.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/generic-hpux10.mc Thu May 22 04:39:17 2014 (r266527) @@ -20,7 +20,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-hpux10.mc,v 8.14 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-hpux10.mc,v 8.14 2013-11-22 20:51:08 ca Exp $') OSTYPE(hpux10)dnl DOMAIN(generic)dnl MAILER(local)dnl Modified: head/contrib/sendmail/cf/cf/generic-hpux9.mc ============================================================================== --- head/contrib/sendmail/cf/cf/generic-hpux9.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/generic-hpux9.mc Thu May 22 04:39:17 2014 (r266527) @@ -20,7 +20,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-hpux9.mc,v 8.12 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-hpux9.mc,v 8.12 2013-11-22 20:51:08 ca Exp $') OSTYPE(hpux9)dnl DOMAIN(generic)dnl MAILER(local)dnl Modified: head/contrib/sendmail/cf/cf/generic-linux.mc ============================================================================== --- head/contrib/sendmail/cf/cf/generic-linux.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/generic-linux.mc Thu May 22 04:39:17 2014 (r266527) @@ -20,7 +20,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-linux.mc,v 8.2 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-linux.mc,v 8.2 2013-11-22 20:51:08 ca Exp $') OSTYPE(linux)dnl DOMAIN(generic)dnl MAILER(local)dnl Modified: head/contrib/sendmail/cf/cf/generic-mpeix.mc ============================================================================== --- head/contrib/sendmail/cf/cf/generic-mpeix.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/generic-mpeix.mc Thu May 22 04:39:17 2014 (r266527) @@ -17,7 +17,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-mpeix.mc,v 8.2 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-mpeix.mc,v 8.2 2013-11-22 20:51:08 ca Exp $') OSTYPE(mpeix)dnl DOMAIN(generic)dnl define(`confFORWARD_PATH', `$z/.forward')dnl Modified: head/contrib/sendmail/cf/cf/generic-nextstep3.3.mc ============================================================================== --- head/contrib/sendmail/cf/cf/generic-nextstep3.3.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/generic-nextstep3.3.mc Thu May 22 04:39:17 2014 (r266527) @@ -20,7 +20,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-nextstep3.3.mc,v 8.11 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-nextstep3.3.mc,v 8.11 2013-11-22 20:51:08 ca Exp $') OSTYPE(nextstep)dnl DOMAIN(generic)dnl MAILER(local)dnl Modified: head/contrib/sendmail/cf/cf/generic-osf1.mc ============================================================================== --- head/contrib/sendmail/cf/cf/generic-osf1.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/generic-osf1.mc Thu May 22 04:39:17 2014 (r266527) @@ -20,7 +20,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-osf1.mc,v 8.12 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-osf1.mc,v 8.12 2013-11-22 20:51:08 ca Exp $') OSTYPE(osf1)dnl DOMAIN(generic)dnl MAILER(local)dnl Modified: head/contrib/sendmail/cf/cf/generic-solaris.mc ============================================================================== --- head/contrib/sendmail/cf/cf/generic-solaris.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/generic-solaris.mc Thu May 22 04:39:17 2014 (r266527) @@ -22,7 +22,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-solaris.mc,v 8.14 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-solaris.mc,v 8.14 2013-11-22 20:51:08 ca Exp $') OSTYPE(solaris2)dnl DOMAIN(generic)dnl MAILER(local)dnl Modified: head/contrib/sendmail/cf/cf/generic-sunos4.1.mc ============================================================================== --- head/contrib/sendmail/cf/cf/generic-sunos4.1.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/generic-sunos4.1.mc Thu May 22 04:39:17 2014 (r266527) @@ -20,7 +20,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-sunos4.1.mc,v 8.12 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-sunos4.1.mc,v 8.12 2013-11-22 20:51:08 ca Exp $') OSTYPE(sunos4.1)dnl DOMAIN(generic)dnl MAILER(local)dnl Modified: head/contrib/sendmail/cf/cf/generic-ultrix4.mc ============================================================================== --- head/contrib/sendmail/cf/cf/generic-ultrix4.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/generic-ultrix4.mc Thu May 22 04:39:17 2014 (r266527) @@ -20,7 +20,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: generic-ultrix4.mc,v 8.12 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: generic-ultrix4.mc,v 8.12 2013-11-22 20:51:08 ca Exp $') OSTYPE(ultrix4)dnl DOMAIN(generic)dnl MAILER(local)dnl Modified: head/contrib/sendmail/cf/cf/huginn.cs.mc ============================================================================== --- head/contrib/sendmail/cf/cf/huginn.cs.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/huginn.cs.mc Thu May 22 04:39:17 2014 (r266527) @@ -22,7 +22,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: huginn.cs.mc,v 8.16 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: huginn.cs.mc,v 8.16 2013-11-22 20:51:08 ca Exp $') OSTYPE(hpux9)dnl DOMAIN(CS.Berkeley.EDU)dnl MASQUERADE_AS(CS.Berkeley.EDU)dnl Modified: head/contrib/sendmail/cf/cf/knecht.mc ============================================================================== --- head/contrib/sendmail/cf/cf/knecht.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/knecht.mc Thu May 22 04:39:17 2014 (r266527) @@ -19,7 +19,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: knecht.mc,v 8.63 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: knecht.mc,v 8.63 2013-11-22 20:51:08 ca Exp $') OSTYPE(bsd4.4) DOMAIN(generic) Modified: head/contrib/sendmail/cf/cf/mail.cs.mc ============================================================================== --- head/contrib/sendmail/cf/cf/mail.cs.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/mail.cs.mc Thu May 22 04:39:17 2014 (r266527) @@ -22,7 +22,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: mail.cs.mc,v 8.19 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: mail.cs.mc,v 8.19 2013-11-22 20:51:08 ca Exp $') OSTYPE(ultrix4)dnl DOMAIN(Berkeley.EDU)dnl MASQUERADE_AS(CS.Berkeley.EDU)dnl Modified: head/contrib/sendmail/cf/cf/mail.eecs.mc ============================================================================== --- head/contrib/sendmail/cf/cf/mail.eecs.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/mail.eecs.mc Thu May 22 04:39:17 2014 (r266527) @@ -22,7 +22,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: mail.eecs.mc,v 8.19 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: mail.eecs.mc,v 8.19 2013-11-22 20:51:08 ca Exp $') OSTYPE(ultrix4)dnl DOMAIN(EECS.Berkeley.EDU)dnl MASQUERADE_AS(EECS.Berkeley.EDU)dnl Modified: head/contrib/sendmail/cf/cf/mailspool.cs.mc ============================================================================== --- head/contrib/sendmail/cf/cf/mailspool.cs.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/mailspool.cs.mc Thu May 22 04:39:17 2014 (r266527) @@ -24,7 +24,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: mailspool.cs.mc,v 8.13 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: mailspool.cs.mc,v 8.13 2013-11-22 20:51:08 ca Exp $') OSTYPE(sunos4.1)dnl DOMAIN(CS.Berkeley.EDU)dnl MAILER(local)dnl Modified: head/contrib/sendmail/cf/cf/python.cs.mc ============================================================================== --- head/contrib/sendmail/cf/cf/python.cs.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/python.cs.mc Thu May 22 04:39:17 2014 (r266527) @@ -24,7 +24,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: python.cs.mc,v 8.13 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: python.cs.mc,v 8.13 2013-11-22 20:51:08 ca Exp $') OSTYPE(bsd4.4)dnl DOMAIN(CS.Berkeley.EDU)dnl define(`LOCAL_RELAY', vangogh.CS.Berkeley.EDU)dnl Modified: head/contrib/sendmail/cf/cf/s2k-osf1.mc ============================================================================== --- head/contrib/sendmail/cf/cf/s2k-osf1.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/s2k-osf1.mc Thu May 22 04:39:17 2014 (r266527) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: s2k-osf1.mc,v 8.14 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: s2k-osf1.mc,v 8.14 2013-11-22 20:51:08 ca Exp $') OSTYPE(osf1)dnl DOMAIN(S2K.Berkeley.EDU)dnl MAILER(local)dnl Modified: head/contrib/sendmail/cf/cf/s2k-ultrix4.mc ============================================================================== --- head/contrib/sendmail/cf/cf/s2k-ultrix4.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/s2k-ultrix4.mc Thu May 22 04:39:17 2014 (r266527) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: s2k-ultrix4.mc,v 8.14 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: s2k-ultrix4.mc,v 8.14 2013-11-22 20:51:08 ca Exp $') OSTYPE(ultrix4)dnl DOMAIN(S2K.Berkeley.EDU)dnl MAILER(local)dnl Modified: head/contrib/sendmail/cf/cf/submit.cf ============================================================================== --- head/contrib/sendmail/cf/cf/submit.cf Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/submit.cf Thu May 22 04:39:17 2014 (r266527) @@ -16,8 +16,8 @@ ##### ##### SENDMAIL CONFIGURATION FILE ##### -##### built by ca@lab.smi.sendmail.com on Thu Jan 23 12:29:13 PST 2014 -##### in /home/ca/sm8-rel/sm-8.14.8/OpenSource/sendmail-8.14.8/cf/cf +##### built by ca@lab.smi.sendmail.com on Tue May 20 12:12:52 PDT 2014 +##### in /home/ca/sm8.git/sendmail/OpenSource/sendmail-8.14.9/cf/cf ##### using ../ as configuration include directory ##### ###################################################################### @@ -27,15 +27,15 @@ ###################################################################### ###################################################################### -##### $Id: cfhead.m4,v 8.122 2013/11/22 20:51:13 ca Exp $ ##### -##### $Id: cf.m4,v 8.33 2013/11/22 20:51:13 ca Exp $ ##### -##### $Id: submit.mc,v 8.15 2013/11/22 20:51:08 ca Exp $ ##### -##### $Id: msp.m4,v 1.34 2013/11/22 20:51:11 ca Exp $ ##### +##### $Id: cfhead.m4,v 8.122 2013-11-22 20:51:13 ca Exp $ ##### +##### $Id: cf.m4,v 8.33 2013-11-22 20:51:13 ca Exp $ ##### +##### $Id: submit.mc,v 8.15 2013-11-22 20:51:08 ca Exp $ ##### +##### $Id: msp.m4,v 1.34 2013-11-22 20:51:11 ca Exp $ ##### -##### $Id: no_default_msa.m4,v 8.3 2013/11/22 20:51:11 ca Exp $ ##### +##### $Id: no_default_msa.m4,v 8.3 2013-11-22 20:51:11 ca Exp $ ##### -##### $Id: proto.m4,v 8.762 2013/11/22 20:51:13 ca Exp $ ##### +##### $Id: proto.m4,v 8.762 2013-11-22 20:51:13 ca Exp $ ##### # level 10 config file format V10/Berkeley @@ -114,7 +114,7 @@ D{MTAHost}[127.0.0.1] # Configuration version number -DZ8.14.8/Submit +DZ8.14.9/Submit ############### @@ -1299,7 +1299,7 @@ R$* $#relay $@ ${MTAHost} $: $1 < @ $j ### Local and Program Mailer specification ### ################################################## -##### $Id: local.m4,v 8.60 2013/11/22 20:51:14 ca Exp $ ##### +##### $Id: local.m4,v 8.60 2013-11-22 20:51:14 ca Exp $ ##### # # Envelope sender rewriting @@ -1351,7 +1351,7 @@ Mprog, P=[IPC], F=lmDFMuXk5, S=EnvFromL ### SMTP Mailer specification ### ##################################### -##### $Id: smtp.m4,v 8.66 2013/11/22 20:51:14 ca Exp $ ##### +##### $Id: smtp.m4,v 8.66 2013-11-22 20:51:14 ca Exp $ ##### # # common sender and masquerading recipient rewriting @@ -1457,7 +1457,7 @@ Mrelay, P=[IPC], F=mDFMuXa8k, S=EnvFrom # # # # divert(0)dnl -# VERSIONID(`$Id: submit.mc,v 8.15 2013/11/22 20:51:08 ca Exp $') +# VERSIONID(`$Id: submit.mc,v 8.15 2013-11-22 20:51:08 ca Exp $') # define(`confCF_VERSION', `Submit')dnl # define(`__OSTYPE__',`')dnl dirty hack to keep proto.m4 from complaining # define(`_USE_DECNET_SYNTAX_', `1')dnl support DECnet Modified: head/contrib/sendmail/cf/cf/submit.mc ============================================================================== --- head/contrib/sendmail/cf/cf/submit.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/submit.mc Thu May 22 04:39:17 2014 (r266527) @@ -15,7 +15,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: submit.mc,v 8.15 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: submit.mc,v 8.15 2013-11-22 20:51:08 ca Exp $') define(`confCF_VERSION', `Submit')dnl define(`__OSTYPE__',`')dnl dirty hack to keep proto.m4 from complaining define(`_USE_DECNET_SYNTAX_', `1')dnl support DECnet Modified: head/contrib/sendmail/cf/cf/tcpproto.mc ============================================================================== --- head/contrib/sendmail/cf/cf/tcpproto.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/tcpproto.mc Thu May 22 04:39:17 2014 (r266527) @@ -26,7 +26,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: tcpproto.mc,v 8.15 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: tcpproto.mc,v 8.15 2013-11-22 20:51:08 ca Exp $') OSTYPE(`unknown') FEATURE(`nouucp', `reject') MAILER(`local') Modified: head/contrib/sendmail/cf/cf/ucbarpa.mc ============================================================================== --- head/contrib/sendmail/cf/cf/ucbarpa.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/ucbarpa.mc Thu May 22 04:39:17 2014 (r266527) @@ -21,7 +21,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: ucbarpa.mc,v 8.13 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: ucbarpa.mc,v 8.13 2013-11-22 20:51:08 ca Exp $') DOMAIN(CS.Berkeley.EDU)dnl OSTYPE(bsd4.4)dnl MAILER(local)dnl Modified: head/contrib/sendmail/cf/cf/ucbvax.mc ============================================================================== --- head/contrib/sendmail/cf/cf/ucbvax.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/ucbvax.mc Thu May 22 04:39:17 2014 (r266527) @@ -22,7 +22,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: ucbvax.mc,v 8.15 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: ucbvax.mc,v 8.15 2013-11-22 20:51:08 ca Exp $') OSTYPE(bsd4.3) DOMAIN(CS.Berkeley.EDU) MASQUERADE_AS(CS.Berkeley.EDU) Modified: head/contrib/sendmail/cf/cf/uucpproto.mc ============================================================================== --- head/contrib/sendmail/cf/cf/uucpproto.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/uucpproto.mc Thu May 22 04:39:17 2014 (r266527) @@ -26,7 +26,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: uucpproto.mc,v 8.16 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: uucpproto.mc,v 8.16 2013-11-22 20:51:08 ca Exp $') OSTYPE(unknown) FEATURE(promiscuous_relay)dnl FEATURE(accept_unresolvable_domains)dnl Modified: head/contrib/sendmail/cf/cf/vangogh.cs.mc ============================================================================== --- head/contrib/sendmail/cf/cf/vangogh.cs.mc Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/cf/vangogh.cs.mc Thu May 22 04:39:17 2014 (r266527) @@ -23,7 +23,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: vangogh.cs.mc,v 8.14 2013/11/22 20:51:08 ca Exp $') +VERSIONID(`$Id: vangogh.cs.mc,v 8.14 2013-11-22 20:51:08 ca Exp $') DOMAIN(CS.Berkeley.EDU)dnl OSTYPE(bsd4.4)dnl MAILER(local)dnl Modified: head/contrib/sendmail/cf/domain/Berkeley.EDU.m4 ============================================================================== --- head/contrib/sendmail/cf/domain/Berkeley.EDU.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/domain/Berkeley.EDU.m4 Thu May 22 04:39:17 2014 (r266527) @@ -12,7 +12,7 @@ divert(-1) # # divert(0) -VERSIONID(`$Id: Berkeley.EDU.m4,v 8.18 2013/11/22 20:51:10 ca Exp $') +VERSIONID(`$Id: Berkeley.EDU.m4,v 8.18 2013-11-22 20:51:10 ca Exp $') DOMAIN(berkeley-only)dnl define(`BITNET_RELAY', `bitnet-relay.Berkeley.EDU')dnl define(`UUCP_RELAY', `uucp-relay.Berkeley.EDU')dnl Modified: head/contrib/sendmail/cf/domain/CS.Berkeley.EDU.m4 ============================================================================== --- head/contrib/sendmail/cf/domain/CS.Berkeley.EDU.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/domain/CS.Berkeley.EDU.m4 Thu May 22 04:39:17 2014 (r266527) @@ -12,7 +12,7 @@ divert(-1) # # divert(0) -VERSIONID(`$Id: CS.Berkeley.EDU.m4,v 8.11 2013/11/22 20:51:10 ca Exp $') +VERSIONID(`$Id: CS.Berkeley.EDU.m4,v 8.11 2013-11-22 20:51:10 ca Exp $') DOMAIN(Berkeley.EDU)dnl HACK(cssubdomain)dnl define(`confUSERDB_SPEC', Modified: head/contrib/sendmail/cf/domain/EECS.Berkeley.EDU.m4 ============================================================================== --- head/contrib/sendmail/cf/domain/EECS.Berkeley.EDU.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/domain/EECS.Berkeley.EDU.m4 Thu May 22 04:39:17 2014 (r266527) @@ -12,6 +12,6 @@ divert(-1) # # divert(0) -VERSIONID(`$Id: EECS.Berkeley.EDU.m4,v 8.11 2013/11/22 20:51:10 ca Exp $') +VERSIONID(`$Id: EECS.Berkeley.EDU.m4,v 8.11 2013-11-22 20:51:10 ca Exp $') DOMAIN(Berkeley.EDU)dnl MASQUERADE_AS(EECS.Berkeley.EDU)dnl Modified: head/contrib/sendmail/cf/domain/S2K.Berkeley.EDU.m4 ============================================================================== --- head/contrib/sendmail/cf/domain/S2K.Berkeley.EDU.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/domain/S2K.Berkeley.EDU.m4 Thu May 22 04:39:17 2014 (r266527) @@ -12,6 +12,6 @@ divert(-1) # # divert(0) -VERSIONID(`$Id: S2K.Berkeley.EDU.m4,v 8.11 2013/11/22 20:51:10 ca Exp $') +VERSIONID(`$Id: S2K.Berkeley.EDU.m4,v 8.11 2013-11-22 20:51:10 ca Exp $') DOMAIN(CS.Berkeley.EDU)dnl MASQUERADE_AS(postgres.Berkeley.EDU)dnl Modified: head/contrib/sendmail/cf/domain/berkeley-only.m4 ============================================================================== --- head/contrib/sendmail/cf/domain/berkeley-only.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/domain/berkeley-only.m4 Thu May 22 04:39:17 2014 (r266527) @@ -12,7 +12,7 @@ divert(-1) # # divert(0) -VERSIONID(`$Id: unspecified-domain.m4,v 8.11 2013/11/22 20:51:10 ca Exp $') +VERSIONID(`$Id: unspecified-domain.m4,v 8.11 2013-11-22 20:51:10 ca Exp $') errprint(`*** ERROR: You are trying to use the Berkeley sample configuration') errprint(` files outside of the Computer Science Division at Berkeley.') errprint(` The configuration (.mc) files must be customized to reference') Modified: head/contrib/sendmail/cf/domain/generic.m4 ============================================================================== --- head/contrib/sendmail/cf/domain/generic.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/domain/generic.m4 Thu May 22 04:39:17 2014 (r266527) @@ -20,7 +20,7 @@ divert(-1) # files. # divert(0) -VERSIONID(`$Id: generic.m4,v 8.16 2013/11/22 20:51:10 ca Exp $') +VERSIONID(`$Id: generic.m4,v 8.16 2013-11-22 20:51:10 ca Exp $') define(`confFORWARD_PATH', `$z/.forward.$w+$h:$z/.forward+$h:$z/.forward.$w:$z/.forward')dnl define(`confMAX_HEADERS_LENGTH', `32768')dnl FEATURE(`redirect')dnl Modified: head/contrib/sendmail/cf/feature/accept_unqualified_senders.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/accept_unqualified_senders.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/accept_unqualified_senders.m4 Thu May 22 04:39:17 2014 (r266527) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: accept_unqualified_senders.m4,v 8.7 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: accept_unqualified_senders.m4,v 8.7 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_ACCEPT_UNQUALIFIED_SENDERS_', 1) Modified: head/contrib/sendmail/cf/feature/accept_unresolvable_domains.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/accept_unresolvable_domains.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/accept_unresolvable_domains.m4 Thu May 22 04:39:17 2014 (r266527) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: accept_unresolvable_domains.m4,v 8.11 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: accept_unresolvable_domains.m4,v 8.11 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_ACCEPT_UNRESOLVABLE_DOMAINS_', 1) Modified: head/contrib/sendmail/cf/feature/access_db.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/access_db.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/access_db.m4 Thu May 22 04:39:17 2014 (r266527) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: access_db.m4,v 8.28 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: access_db.m4,v 8.28 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_ACCESS_TABLE_', `') Modified: head/contrib/sendmail/cf/feature/allmasquerade.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/allmasquerade.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/allmasquerade.m4 Thu May 22 04:39:17 2014 (r266527) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: allmasquerade.m4,v 8.14 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: allmasquerade.m4,v 8.14 2013-11-22 20:51:11 ca Exp $') divert(-1) ifdef(`_MAILER_local_', Modified: head/contrib/sendmail/cf/feature/always_add_domain.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/always_add_domain.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/always_add_domain.m4 Thu May 22 04:39:17 2014 (r266527) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: always_add_domain.m4,v 8.12 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: always_add_domain.m4,v 8.12 2013-11-22 20:51:11 ca Exp $') divert(-1) ifdef(`_MAILER_local_', Modified: head/contrib/sendmail/cf/feature/authinfo.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/authinfo.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/authinfo.m4 Thu May 22 04:39:17 2014 (r266527) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: authinfo.m4,v 1.10 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: authinfo.m4,v 1.10 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_AUTHINFO_TABLE_', `') Modified: head/contrib/sendmail/cf/feature/badmx.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/badmx.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/badmx.m4 Thu May 22 04:39:17 2014 (r266527) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: badmx.m4,v 1.2 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: badmx.m4,v 1.2 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_BADMX_CHK_', 1) Modified: head/contrib/sendmail/cf/feature/bestmx_is_local.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/bestmx_is_local.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/bestmx_is_local.m4 Thu May 22 04:39:17 2014 (r266527) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: bestmx_is_local.m4,v 8.27 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: bestmx_is_local.m4,v 8.27 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_BESTMX_IS_LOCAL_', _ARG_) Modified: head/contrib/sendmail/cf/feature/bitdomain.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/bitdomain.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/bitdomain.m4 Thu May 22 04:39:17 2014 (r266527) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: bitdomain.m4,v 8.31 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: bitdomain.m4,v 8.31 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_BITDOMAIN_TABLE_', `') Modified: head/contrib/sendmail/cf/feature/blacklist_recipients.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/blacklist_recipients.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/blacklist_recipients.m4 Thu May 22 04:39:17 2014 (r266527) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: blacklist_recipients.m4,v 8.14 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: blacklist_recipients.m4,v 8.14 2013-11-22 20:51:11 ca Exp $') divert(-1) ifdef(`_ACCESS_TABLE_', Modified: head/contrib/sendmail/cf/feature/block_bad_helo.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/block_bad_helo.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/block_bad_helo.m4 Thu May 22 04:39:17 2014 (r266527) @@ -10,7 +10,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: block_bad_helo.m4,v 1.2 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: block_bad_helo.m4,v 1.2 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_BLOCK_BAD_HELO_', `')dnl Modified: head/contrib/sendmail/cf/feature/compat_check.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/compat_check.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/compat_check.m4 Thu May 22 04:39:17 2014 (r266527) @@ -9,7 +9,7 @@ divert(-1) # # divert(0) -VERSIONID(`$Id: compat_check.m4,v 1.5 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: compat_check.m4,v 1.5 2013-11-22 20:51:11 ca Exp $') divert(-1) ifdef(`_ACCESS_TABLE_', `', `errprint(`FEATURE(`compat_check') requires FEATURE(`access_db') Modified: head/contrib/sendmail/cf/feature/conncontrol.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/conncontrol.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/conncontrol.m4 Thu May 22 04:39:17 2014 (r266527) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: conncontrol.m4,v 1.5 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: conncontrol.m4,v 1.5 2013-11-22 20:51:11 ca Exp $') divert(-1) ifdef(`_ACCESS_TABLE_', ` Modified: head/contrib/sendmail/cf/feature/delay_checks.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/delay_checks.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/delay_checks.m4 Thu May 22 04:39:17 2014 (r266527) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: delay_checks.m4,v 8.9 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: delay_checks.m4,v 8.9 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_DELAY_CHECKS_', 1) Modified: head/contrib/sendmail/cf/feature/dnsbl.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/dnsbl.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/dnsbl.m4 Thu May 22 04:39:17 2014 (r266527) @@ -12,7 +12,7 @@ divert(-1) ifdef(`DNSBL_MAP', `', `define(`DNSBL_MAP', `dns -R A')') divert(0) ifdef(`_DNSBL_R_',`dnl',`dnl -VERSIONID(`$Id: dnsbl.m4,v 8.34 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: dnsbl.m4,v 8.34 2013-11-22 20:51:11 ca Exp $') define(`_DNSBL_R_',`') ifelse(defn(`_ARG_'), `', `errprint(`*** ERROR: missing argument for FEATURE(`dnsbl')')') Modified: head/contrib/sendmail/cf/feature/domaintable.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/domaintable.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/domaintable.m4 Thu May 22 04:39:17 2014 (r266527) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: domaintable.m4,v 8.25 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: domaintable.m4,v 8.25 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_DOMAIN_TABLE_', `') Modified: head/contrib/sendmail/cf/feature/enhdnsbl.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/enhdnsbl.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/enhdnsbl.m4 Thu May 22 04:39:17 2014 (r266527) @@ -13,7 +13,7 @@ ifelse(defn(`_ARG_'), `', `errprint(`*** ERROR: missing argument for FEATURE(`enhdnsbl')')') divert(0) ifdef(`_EDNSBL_R_',`dnl',`dnl -VERSIONID(`$Id: enhdnsbl.m4,v 1.13 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: enhdnsbl.m4,v 1.13 2013-11-22 20:51:11 ca Exp $') LOCAL_CONFIG define(`_EDNSBL_R_',`')dnl # map for enhanced DNS based blacklist lookups Modified: head/contrib/sendmail/cf/feature/generics_entire_domain.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/generics_entire_domain.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/generics_entire_domain.m4 Thu May 22 04:39:17 2014 (r266527) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: generics_entire_domain.m4,v 8.2 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: generics_entire_domain.m4,v 8.2 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_GENERICS_ENTIRE_DOMAIN_', 1) Modified: head/contrib/sendmail/cf/feature/genericstable.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/genericstable.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/genericstable.m4 Thu May 22 04:39:17 2014 (r266527) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: genericstable.m4,v 8.24 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: genericstable.m4,v 8.24 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_GENERICS_TABLE_', `') Modified: head/contrib/sendmail/cf/feature/greet_pause.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/greet_pause.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/greet_pause.m4 Thu May 22 04:39:17 2014 (r266527) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: greet_pause.m4,v 1.5 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: greet_pause.m4,v 1.5 2013-11-22 20:51:11 ca Exp $') divert(-1) ifelse(len(X`'_ARG_),`1',`ifdef(`_ACCESS_TABLE_', `', Modified: head/contrib/sendmail/cf/feature/ldap_routing.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/ldap_routing.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/ldap_routing.m4 Thu May 22 04:39:17 2014 (r266527) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: ldap_routing.m4,v 8.21 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: ldap_routing.m4,v 8.21 2013-11-22 20:51:11 ca Exp $') divert(-1) # Check first two arguments. If they aren't set, may need to warn in proto.m4 Modified: head/contrib/sendmail/cf/feature/limited_masquerade.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/limited_masquerade.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/limited_masquerade.m4 Thu May 22 04:39:17 2014 (r266527) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: limited_masquerade.m4,v 8.10 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: limited_masquerade.m4,v 8.10 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_LIMITED_MASQUERADE_', 1) Modified: head/contrib/sendmail/cf/feature/local_lmtp.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/local_lmtp.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/local_lmtp.m4 Thu May 22 04:39:17 2014 (r266527) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: local_lmtp.m4,v 8.18 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: local_lmtp.m4,v 8.18 2013-11-22 20:51:11 ca Exp $') divert(-1) ifdef(`_MAILER_local_', Modified: head/contrib/sendmail/cf/feature/local_no_masquerade.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/local_no_masquerade.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/local_no_masquerade.m4 Thu May 22 04:39:17 2014 (r266527) @@ -9,7 +9,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: local_no_masquerade.m4,v 1.3 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: local_no_masquerade.m4,v 1.3 2013-11-22 20:51:11 ca Exp $') divert(-1) ifdef(`_MAILER_local_', Modified: head/contrib/sendmail/cf/feature/local_procmail.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/local_procmail.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/local_procmail.m4 Thu May 22 04:39:17 2014 (r266527) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: local_procmail.m4,v 8.23 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: local_procmail.m4,v 8.23 2013-11-22 20:51:11 ca Exp $') divert(-1) ifdef(`_MAILER_local_', Modified: head/contrib/sendmail/cf/feature/lookupdotdomain.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/lookupdotdomain.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/lookupdotdomain.m4 Thu May 22 04:39:17 2014 (r266527) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: lookupdotdomain.m4,v 1.2 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: lookupdotdomain.m4,v 1.2 2013-11-22 20:51:11 ca Exp $') divert(-1) ifdef(`_ACCESS_TABLE_', Modified: head/contrib/sendmail/cf/feature/loose_relay_check.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/loose_relay_check.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/loose_relay_check.m4 Thu May 22 04:39:17 2014 (r266527) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: loose_relay_check.m4,v 8.7 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: loose_relay_check.m4,v 8.7 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_LOOSE_RELAY_CHECK_', 1) Modified: head/contrib/sendmail/cf/feature/mailertable.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/mailertable.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/mailertable.m4 Thu May 22 04:39:17 2014 (r266527) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: mailertable.m4,v 8.26 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: mailertable.m4,v 8.26 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_MAILER_TABLE_', `') Modified: head/contrib/sendmail/cf/feature/masquerade_entire_domain.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/masquerade_entire_domain.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/masquerade_entire_domain.m4 Thu May 22 04:39:17 2014 (r266527) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: masquerade_entire_domain.m4,v 8.10 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: masquerade_entire_domain.m4,v 8.10 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_MASQUERADE_ENTIRE_DOMAIN_', 1) Modified: head/contrib/sendmail/cf/feature/masquerade_envelope.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/masquerade_envelope.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/masquerade_envelope.m4 Thu May 22 04:39:17 2014 (r266527) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: masquerade_envelope.m4,v 8.10 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: masquerade_envelope.m4,v 8.10 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_MASQUERADE_ENVELOPE_', 1) Modified: head/contrib/sendmail/cf/feature/msp.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/msp.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/msp.m4 Thu May 22 04:39:17 2014 (r266527) @@ -10,7 +10,7 @@ divert(-1) # divert(0)dnl -VERSIONID(`$Id: msp.m4,v 1.34 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: msp.m4,v 1.34 2013-11-22 20:51:11 ca Exp $') divert(-1) undefine(`ALIAS_FILE') define(`confDELIVERY_MODE', `i') Modified: head/contrib/sendmail/cf/feature/mtamark.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/mtamark.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/mtamark.m4 Thu May 22 04:39:17 2014 (r266527) @@ -11,7 +11,7 @@ divert(-1) divert(0) ifdef(`_MTAMARK_R',`dnl',`dnl -VERSIONID(`$Id: mtamark.m4,v 1.3 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: mtamark.m4,v 1.3 2013-11-22 20:51:11 ca Exp $') LOCAL_CONFIG define(`_MTAMARK_R',`')dnl # map for MTA mark Modified: head/contrib/sendmail/cf/feature/no_default_msa.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/no_default_msa.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/no_default_msa.m4 Thu May 22 04:39:17 2014 (r266527) @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: no_default_msa.m4,v 8.3 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: no_default_msa.m4,v 8.3 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_NO_MSA_', `1') Modified: head/contrib/sendmail/cf/feature/nocanonify.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/nocanonify.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/nocanonify.m4 Thu May 22 04:39:17 2014 (r266527) @@ -13,7 +13,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: nocanonify.m4,v 8.13 2013/11/22 20:51:11 ca Exp $') +VERSIONID(`$Id: nocanonify.m4,v 8.13 2013-11-22 20:51:11 ca Exp $') divert(-1) define(`_NO_CANONIFY_', 1) Modified: head/contrib/sendmail/cf/feature/notsticky.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/notsticky.m4 Thu May 22 03:49:56 2014 (r266526) +++ head/contrib/sendmail/cf/feature/notsticky.m4 Thu May 22 04:39:17 2014 (r266527) @@ -13,7 +13,7 @@ divert(-1) # *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu May 22 04:41:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34539DFD; Thu, 22 May 2014 04:41:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2223F23A6; Thu, 22 May 2014 04:41:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4M4fCub012970; Thu, 22 May 2014 04:41:12 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4M4fCuW012969; Thu, 22 May 2014 04:41:12 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201405220441.s4M4fCuW012969@svn.freebsd.org> From: Gregory Neil Shapiro Date: Thu, 22 May 2014 04:41:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266528 - head/contrib/sendmail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 04:41:12 -0000 Author: gshapiro Date: Thu May 22 04:41:11 2014 New Revision: 266528 URL: http://svnweb.freebsd.org/changeset/base/266528 Log: Update for sendmail 8.14.9 import MFC after: 3 days Modified: head/contrib/sendmail/FREEBSD-upgrade Modified: head/contrib/sendmail/FREEBSD-upgrade ============================================================================== --- head/contrib/sendmail/FREEBSD-upgrade Thu May 22 04:39:17 2014 (r266527) +++ head/contrib/sendmail/FREEBSD-upgrade Thu May 22 04:41:11 2014 (r266528) @@ -1,6 +1,6 @@ $FreeBSD$ -sendmail 8.14.8 +sendmail 8.14.9 originals can be found at: ftp://ftp.sendmail.org/pub/sendmail/ For the import of sendmail, the following directories were renamed: @@ -97,4 +97,4 @@ infrastructure in FreeBSD: usr.sbin/mailwrapper/Makefile gshapiro@FreeBSD.org -26-January-2014 +21-May-2014 From owner-svn-src-head@FreeBSD.ORG Thu May 22 04:43:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBCC0F58; Thu, 22 May 2014 04:43:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A98D923BA; Thu, 22 May 2014 04:43:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4M4hfn9014023; Thu, 22 May 2014 04:43:41 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4M4hfOe014021; Thu, 22 May 2014 04:43:41 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201405220443.s4M4hfOe014021@svn.freebsd.org> From: Gregory Neil Shapiro Date: Thu, 22 May 2014 04:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266529 - head/etc/sendmail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 04:43:41 -0000 Author: gshapiro Date: Thu May 22 04:43:40 2014 New Revision: 266529 URL: http://svnweb.freebsd.org/changeset/base/266529 Log: Minor changes to force commit these files so new freebsd*.cf files are built to use the new sendmail-8.14.9/cf tree. MFC after: 3 days Modified: head/etc/sendmail/freebsd.mc head/etc/sendmail/freebsd.submit.mc Modified: head/etc/sendmail/freebsd.mc ============================================================================== --- head/etc/sendmail/freebsd.mc Thu May 22 04:41:11 2014 (r266528) +++ head/etc/sendmail/freebsd.mc Thu May 22 04:43:40 2014 (r266529) @@ -33,7 +33,6 @@ divert(-1) # SUCH DAMAGE. # - # # This is a generic configuration file for FreeBSD 6.X and later systems. # If you want to customize it, copy it to a name appropriate for your Modified: head/etc/sendmail/freebsd.submit.mc ============================================================================== --- head/etc/sendmail/freebsd.submit.mc Thu May 22 04:41:11 2014 (r266528) +++ head/etc/sendmail/freebsd.submit.mc Thu May 22 04:43:40 2014 (r266529) @@ -9,7 +9,6 @@ divert(-1) # # - # # This is the FreeBSD configuration for a set-group-ID sm-msp sendmail # that acts as a initial mail submission program. From owner-svn-src-head@FreeBSD.ORG Thu May 22 04:46:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18509230; Thu, 22 May 2014 04:46:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05AF523E2; Thu, 22 May 2014 04:46:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4M4kp8F014626; Thu, 22 May 2014 04:46:51 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4M4kpPX014625; Thu, 22 May 2014 04:46:51 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201405220446.s4M4kpPX014625@svn.freebsd.org> From: Gregory Neil Shapiro Date: Thu, 22 May 2014 04:46:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266530 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 04:46:52 -0000 Author: gshapiro Date: Thu May 22 04:46:51 2014 New Revision: 266530 URL: http://svnweb.freebsd.org/changeset/base/266530 Log: Note merge to head for sendmail 8.14.9. MFC after: 3 days Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 22 04:43:40 2014 (r266529) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 22 04:46:51 2014 (r266530) @@ -347,7 +347,7 @@ version 3.5.0. Sendmail - has been updated from 8.14.7 to 8.14.8. + has been updated from 8.14.7 to 8.14.9. bmake has been updated to version 20140101. From owner-svn-src-head@FreeBSD.ORG Thu May 22 05:04:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 005197CB; Thu, 22 May 2014 05:04:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5BD7253F; Thu, 22 May 2014 05:04:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4M54gnk023266; Thu, 22 May 2014 05:04:42 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4M54eNr023252; Thu, 22 May 2014 05:04:40 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201405220504.s4M54eNr023252@svn.freebsd.org> From: Justin Hibbits Date: Thu, 22 May 2014 05:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266531 - in head/sys: amd64/conf conf i386/conf modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 05:04:43 -0000 Author: jhibbits Date: Thu May 22 05:04:40 2014 New Revision: 266531 URL: http://svnweb.freebsd.org/changeset/base/266531 Log: imagact_binmisc builds for all supported architectures, so enable it for all. Any bugs in execution will be dealt with as they crop up. MFC after: 3 weeks Relnotes: Yes Modified: head/sys/amd64/conf/NOTES head/sys/conf/NOTES head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/options head/sys/conf/options.amd64 head/sys/conf/options.i386 head/sys/i386/conf/NOTES head/sys/modules/Makefile Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Thu May 22 04:46:51 2014 (r266530) +++ head/sys/amd64/conf/NOTES Thu May 22 05:04:40 2014 (r266531) @@ -646,6 +646,3 @@ options VM_KMEM_SIZE_SCALE # Enable NDIS binary driver support options NDISAPI device ndis - -# Module to enable execution of application via emulators like QEMU -options IMAGACT_BINMISC Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu May 22 04:46:51 2014 (r266530) +++ head/sys/conf/NOTES Thu May 22 05:04:40 2014 (r266531) @@ -2968,3 +2968,6 @@ options RANDOM_YARROW # Yarrow RNG ##options RANDOM_FORTUNA # Fortuna RNG - not yet implemented options RANDOM_DEBUG # Debugging messages options RANDOM_RWFILE # Read and write entropy cache + +# Module to enable execution of application via emulators like QEMU +options IMAGACT_BINMISC Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu May 22 04:46:51 2014 (r266530) +++ head/sys/conf/files Thu May 22 05:04:40 2014 (r266531) @@ -2850,6 +2850,7 @@ kern/bus_if.m standard kern/clock_if.m standard kern/cpufreq_if.m standard kern/device_if.m standard +kern/imgact_binmisc.c optional imagact_binmisc kern/imgact_elf.c standard kern/imgact_elf32.c optional compat_freebsd32 kern/imgact_shell.c standard Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu May 22 04:46:51 2014 (r266530) +++ head/sys/conf/files.amd64 Thu May 22 05:04:40 2014 (r266531) @@ -438,7 +438,6 @@ dev/virtio/scsi/virtio_scsi.c optional dev/virtio/random/virtio_random.c optional virtio_random isa/syscons_isa.c optional sc isa/vga_isa.c optional vga -kern/imgact_binmisc.c optional imagact_binmisc kern/kern_clocksource.c standard kern/link_elf_obj.c standard # Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Thu May 22 04:46:51 2014 (r266530) +++ head/sys/conf/files.i386 Thu May 22 05:04:40 2014 (r266531) @@ -520,7 +520,6 @@ isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/kern_clocksource.c standard kern/imgact_aout.c optional compat_aout -kern/imgact_binmisc.c optional imagact_binmisc kern/imgact_gzip.c optional gzip libkern/divdi3.c standard libkern/flsll.c standard Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu May 22 04:46:51 2014 (r266530) +++ head/sys/conf/options Thu May 22 05:04:40 2014 (r266531) @@ -91,6 +91,7 @@ DIRECTIO FILEMON opt_dontuse.h FFCLOCK FULL_PREEMPTION opt_sched.h +IMAGACT_BINMISC opt_dontuse.h IPI_PREEMPTION opt_sched.h GEOM_AES opt_geom.h GEOM_BDE opt_geom.h Modified: head/sys/conf/options.amd64 ============================================================================== --- head/sys/conf/options.amd64 Thu May 22 04:46:51 2014 (r266530) +++ head/sys/conf/options.amd64 Thu May 22 05:04:40 2014 (r266531) @@ -21,7 +21,6 @@ COMPAT_FREEBSD32 opt_compat.h COMPAT_LINUX32 opt_compat.h #COMPAT_SVR4 opt_dontuse.h #DEBUG_SVR4 opt_svr4.h -IMAGACT_BINMISC opt_dontuse.h LINPROCFS opt_dontuse.h LINSYSFS opt_dontuse.h NDISAPI opt_dontuse.h Modified: head/sys/conf/options.i386 ============================================================================== --- head/sys/conf/options.i386 Thu May 22 04:46:51 2014 (r266530) +++ head/sys/conf/options.i386 Thu May 22 05:04:40 2014 (r266531) @@ -26,7 +26,6 @@ IBCS2 opt_dontuse.h COMPAT_LINUX opt_dontuse.h COMPAT_SVR4 opt_dontuse.h DEBUG_SVR4 opt_svr4.h -IMAGACT_BINMISC opt_binmisc.h LINPROCFS opt_dontuse.h LINSYSFS opt_dontuse.h NDISAPI opt_dontuse.h Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Thu May 22 04:46:51 2014 (r266530) +++ head/sys/i386/conf/NOTES Thu May 22 05:04:40 2014 (r266531) @@ -1056,6 +1056,3 @@ options VM_KMEM_SIZE_SCALE # asr old ioctls support, needed by raidutils options ASR_COMPAT - -# Module to enable execution of application via emulators like QEMU -options IMAGACT_BINMISC Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu May 22 04:46:51 2014 (r266530) +++ head/sys/modules/Makefile Thu May 22 05:04:40 2014 (r266531) @@ -150,7 +150,7 @@ SUBDIR= \ if_vlan \ ${_igb} \ ${_iir} \ - ${_imgact_binmisc} \ + imgact_binmisc \ ${_io} \ ${_ipoib} \ ${_ipdivert} \ @@ -377,7 +377,6 @@ SUBDIR= \ .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" _filemon= filemon -_imgact_binmisc= imgact_binmisc _vmware= vmware .endif From owner-svn-src-head@FreeBSD.ORG Thu May 22 05:30:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90CA3E92; Thu, 22 May 2014 05:30:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6487B2766; Thu, 22 May 2014 05:30:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4M5UdIK033634; Thu, 22 May 2014 05:30:39 GMT (envelope-from allanjude@svn.freebsd.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4M5UdxY033633; Thu, 22 May 2014 05:30:39 GMT (envelope-from allanjude@svn.freebsd.org) Message-Id: <201405220530.s4M5UdxY033633@svn.freebsd.org> From: Allan Jude Date: Thu, 22 May 2014 05:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266533 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 05:30:39 -0000 Author: allanjude (doc committer) Date: Thu May 22 05:30:38 2014 New Revision: 266533 URL: http://svnweb.freebsd.org/changeset/base/266533 Log: Improve sysctl descriptions for new ZFS sysctls: vfs.zfs.dirty_data_max vfs.zfs.dirty_data_max_max vfs.zfs.dirty_data_sync Reviewed by: smh Approved by: wblock (mentor) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Thu May 22 05:20:21 2014 (r266532) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Thu May 22 05:30:38 2014 (r266533) @@ -144,13 +144,13 @@ SYSCTL_DECL(_vfs_zfs); TUNABLE_QUAD("vfs.zfs.dirty_data_max", &zfs_dirty_data_max); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_max, CTLFLAG_RWTUN, &zfs_dirty_data_max, 0, - "The dirty space limit in bytes after which new writes are halted until " - "space becomes available"); + "The maximum amount of dirty data in bytes after which new writes are " + "halted until space becomes available"); TUNABLE_QUAD("vfs.zfs.dirty_data_max_max", &zfs_dirty_data_max_max); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_max_max, CTLFLAG_RDTUN, &zfs_dirty_data_max_max, 0, - "The absolute cap on diry_data_max when auto calculating"); + "The absolute cap on dirty_data_max when auto calculating"); TUNABLE_INT("vfs.zfs.dirty_data_max_percent", &zfs_dirty_data_max_percent); SYSCTL_INT(_vfs_zfs, OID_AUTO, dirty_data_max_percent, CTLFLAG_RDTUN, @@ -160,7 +160,7 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, dirty_dat TUNABLE_QUAD("vfs.zfs.dirty_data_sync", &zfs_dirty_data_sync); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_sync, CTLFLAG_RWTUN, &zfs_dirty_data_sync, 0, - "Force at txg if the number of dirty buffer bytes exceed this value"); + "Force a txg if the number of dirty buffer bytes exceed this value"); static int sysctl_zfs_delay_min_dirty_percent(SYSCTL_HANDLER_ARGS); /* No zfs_delay_min_dirty_percent tunable due to limit requirements */ From owner-svn-src-head@FreeBSD.ORG Thu May 22 05:33:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB20810A; Thu, 22 May 2014 05:33:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D96BC27ED; Thu, 22 May 2014 05:33:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4M5XoLv036726; Thu, 22 May 2014 05:33:50 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4M5XoFp036725; Thu, 22 May 2014 05:33:50 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405220533.s4M5XoFp036725@svn.freebsd.org> From: Xin LI Date: Thu, 22 May 2014 05:33:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266534 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 05:33:51 -0000 Author: delphij Date: Thu May 22 05:33:50 2014 New Revision: 266534 URL: http://svnweb.freebsd.org/changeset/base/266534 Log: Fix build: Build libavl as prebuild-lib. X-MFC-With: 266520 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu May 22 05:30:38 2014 (r266533) +++ head/Makefile.inc1 Thu May 22 05:33:50 2014 (r266534) @@ -1475,6 +1475,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 lib/libopie lib/libpam ${_lib_libthr} \ lib/libradius lib/libsbuf lib/libtacplus \ ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \ + ${_cddl_lib_libavl} \ ${_cddl_lib_libzfs_core} \ lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_lib_libldns} \ @@ -1520,6 +1521,7 @@ lib/libopie__L lib/libtacplus__L: lib/li .if ${MK_CDDL} != "no" _cddl_lib_libumem= cddl/lib/libumem _cddl_lib_libnvpair= cddl/lib/libnvpair +_cddl_lib_libavl= cddl/lib/libavl _cddl_lib_libzfs_core= cddl/lib/libzfs_core _cddl_lib= cddl/lib cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L From owner-svn-src-head@FreeBSD.ORG Thu May 22 05:51:25 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4FE7BC7E; Thu, 22 May 2014 05:51:25 +0000 (UTC) Received: from gw.catspoiler.org (gw.catspoiler.org [75.1.14.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C4802982; Thu, 22 May 2014 05:51:24 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s4M5p9Gp033128; Wed, 21 May 2014 22:51:13 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201405220551.s4M5p9Gp033128@gw.catspoiler.org> Date: Wed, 21 May 2014 22:51:09 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r266534 - head To: delphij@FreeBSD.org In-Reply-To: <201405220533.s4M5XoFp036725@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 05:51:25 -0000 On 22 May, Xin LI wrote: > Author: delphij > Date: Thu May 22 05:33:50 2014 > New Revision: 266534 > URL: http://svnweb.freebsd.org/changeset/base/266534 > > Log: > Fix build: Build libavl as prebuild-lib. Thanks! From owner-svn-src-head@FreeBSD.ORG Thu May 22 06:28:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8332869; Thu, 22 May 2014 06:28:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5BF22C91; Thu, 22 May 2014 06:28:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4M6S9SR061401; Thu, 22 May 2014 06:28:09 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4M6S9TB061400; Thu, 22 May 2014 06:28:09 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405220628.s4M6S9TB061400@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 22 May 2014 06:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266535 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 06:28:10 -0000 Author: hselasky Date: Thu May 22 06:28:09 2014 New Revision: 266535 URL: http://svnweb.freebsd.org/changeset/base/266535 Log: - Stop transfers when RSU init fails. - Make sure TX/RX lists don't leak and are only allocated once. - Fix off-by one transfer index computation. - Give firmware loading more time. MFC after: 3 days Modified: head/sys/dev/usb/wlan/if_rsu.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Thu May 22 05:33:50 2014 (r266534) +++ head/sys/dev/usb/wlan/if_rsu.c Thu May 22 06:28:09 2014 (r266535) @@ -319,6 +319,20 @@ rsu_attach(device_t self) TIMEOUT_TASK_INIT(taskqueue_thread, &sc->calib_task, 0, rsu_calib_task, sc); + /* Allocate Tx/Rx buffers. */ + error = rsu_alloc_rx_list(sc); + if (error != 0) { + device_printf(sc->sc_dev, "could not allocate Rx buffers\n"); + goto fail_usb; + } + + error = rsu_alloc_tx_list(sc); + if (error != 0) { + device_printf(sc->sc_dev, "could not allocate Tx buffers\n"); + rsu_free_rx_list(sc); + goto fail_usb; + } + iface_index = 0; error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, rsu_config, RSU_N_TRANSFER, sc, &sc->sc_mtx); @@ -615,12 +629,26 @@ rsu_alloc_tx_list(struct rsu_softc *sc) static void rsu_free_tx_list(struct rsu_softc *sc) { + int i; + + /* prevent further allocations from TX list(s) */ + STAILQ_INIT(&sc->sc_tx_inactive); + + for (i = 0; i != RSU_MAX_TX_EP; i++) { + STAILQ_INIT(&sc->sc_tx_active[i]); + STAILQ_INIT(&sc->sc_tx_pending[i]); + } + rsu_free_list(sc, sc->sc_tx, RSU_TX_LIST_COUNT); } static void rsu_free_rx_list(struct rsu_softc *sc) { + /* prevent further allocations from RX list(s) */ + STAILQ_INIT(&sc->sc_rx_inactive); + STAILQ_INIT(&sc->sc_rx_active); + rsu_free_list(sc, sc->sc_rx, RSU_RX_LIST_COUNT); } @@ -1695,9 +1723,9 @@ rsu_tx_start(struct rsu_softc *sc, struc which = RSU_BULK_TX_VO - RSU_BULK_TX_BE; break; default: - KASSERT(M_WME_GETAC(m0) < 4, - ("unsupported WME pipe %d", M_WME_GETAC(m0))); - which = M_WME_GETAC(m0) + RSU_BULK_TX_BE; + which = M_WME_GETAC(m0); + KASSERT(which < RSU_MAX_TX_EP, + ("unsupported WME pipe %d", which)); break; } hasqos = 0; @@ -2172,15 +2200,14 @@ rsu_load_firmware(struct rsu_softc *sc) goto fail; } /* Wait for load to complete. */ - for (ntries = 0; ntries < 10; ntries++) { + for (ntries = 0; ntries != 50; ntries++) { usb_pause_mtx(&sc->sc_mtx, hz / 100); reg = rsu_read_2(sc, R92S_TCR); if (reg & R92S_TCR_IMEM_CODE_DONE) break; } - if (ntries == 10 || !(reg & R92S_TCR_IMEM_CHK_RPT)) { - device_printf(sc->sc_dev, "timeout waiting for %s transfer\n", - "IMEM"); + if (ntries == 50) { + device_printf(sc->sc_dev, "timeout waiting for IMEM transfer\n"); error = ETIMEDOUT; goto fail; } @@ -2193,15 +2220,14 @@ rsu_load_firmware(struct rsu_softc *sc) goto fail; } /* Wait for load to complete. */ - for (ntries = 0; ntries < 10; ntries++) { + for (ntries = 0; ntries != 10; ntries++) { usb_pause_mtx(&sc->sc_mtx, hz / 100); reg = rsu_read_2(sc, R92S_TCR); if (reg & R92S_TCR_EMEM_CODE_DONE) break; } - if (ntries == 10 || !(reg & R92S_TCR_EMEM_CHK_RPT)) { - device_printf(sc->sc_dev, "timeout waiting for %s transfer\n", - "EMEM"); + if (ntries == 10) { + device_printf(sc->sc_dev, "timeout waiting for EMEM transfer\n"); error = ETIMEDOUT; goto fail; } @@ -2336,22 +2362,11 @@ rsu_init_locked(struct rsu_softc *sc) struct ifnet *ifp = sc->sc_ifp; struct r92s_set_pwr_mode cmd; int error; + int i; /* Init host async commands ring. */ sc->cmdq.cur = sc->cmdq.next = sc->cmdq.queued = 0; - /* Allocate Tx/Rx buffers. */ - error = rsu_alloc_rx_list(sc); - if (error != 0) { - device_printf(sc->sc_dev, "could not allocate Rx buffers\n"); - return; - } - error = rsu_alloc_tx_list(sc); - if (error != 0) { - device_printf(sc->sc_dev, "could not allocate Tx buffers\n"); - rsu_free_rx_list(sc); - return; - } /* Power on adapter. */ if (sc->cut == 1) rsu_power_on_acut(sc); @@ -2438,9 +2453,9 @@ rsu_init_locked(struct rsu_softc *sc) ifp->if_drv_flags |= IFF_DRV_RUNNING; return; fail: - rsu_free_rx_list(sc); - rsu_free_tx_list(sc); - return; + /* Need to stop all failed transfers, if any */ + for (i = 0; i != RSU_N_TRANSFER; i++) + usbd_transfer_stop(sc->sc_xfer[i]); } static void From owner-svn-src-head@FreeBSD.ORG Thu May 22 06:40:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D3AC497; Thu, 22 May 2014 06:40:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B9EE2DEB; Thu, 22 May 2014 06:40:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4M6e8qa066698; Thu, 22 May 2014 06:40:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4M6e8Rd066697; Thu, 22 May 2014 06:40:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405220640.s4M6e8Rd066697@svn.freebsd.org> From: Alexander Motin Date: Thu, 22 May 2014 06:40:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266536 - head/sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 06:40:08 -0000 Author: mav Date: Thu May 22 06:40:07 2014 New Revision: 266536 URL: http://svnweb.freebsd.org/changeset/base/266536 Log: Use NG_WAITOK as ng_package_msg() argument instead of M_WAITOK. Submitted by: Dmitry Luhtionov Modified: head/sys/netgraph/ng_socket.c Modified: head/sys/netgraph/ng_socket.c ============================================================================== --- head/sys/netgraph/ng_socket.c Thu May 22 06:28:09 2014 (r266535) +++ head/sys/netgraph/ng_socket.c Thu May 22 06:40:07 2014 (r266536) @@ -301,7 +301,7 @@ ngc_send(struct socket *so, int flags, s } } - item = ng_package_msg(msg, M_WAITOK); + item = ng_package_msg(msg, NG_WAITOK); if ((error = ng_address_path((pcbp->sockdata->node), item, path, 0)) != 0) { #ifdef TRACE_MESSAGES From owner-svn-src-head@FreeBSD.ORG Thu May 22 07:09:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1825FC9B; Thu, 22 May 2014 07:09:27 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5C0420F4; Thu, 22 May 2014 07:09:26 +0000 (UTC) Received: from [2001:470:9174:1:ed1c:526:21b:2628] by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1WnN7v-000JpB-Mt; Thu, 22 May 2014 08:09:24 +0100 Subject: Re: svn commit: r266083 - in head/sys/arm: arm include Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Content-Type: text/plain; charset=windows-1252 From: Mark R V Murray In-Reply-To: <537D0952.2040001@selasky.org> Date: Thu, 22 May 2014 08:09:26 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org> References: <201405141911.s4EJBFZZ097826@svn.freebsd.org> <537D0952.2040001@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1878.2) X-SA-Score: -1.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 07:09:27 -0000 On 21 May 2014, at 21:15, Hans Petter Selasky wrote: > On 05/14/14 21:11, Mark Murray wrote: >> Author: markm >> Date: Wed May 14 19:11:15 2014 >> New Revision: 266083 >> URL: http://svnweb.freebsd.org/changeset/base/266083 >>=20 >> Log: >> Give suitably-endowed ARMs a register similar to the x86 TSC = register. >>=20 >=20 > Hi, >=20 > Regression issue: > This commit prevents RPI-B from booting. Thanks, I=92ll look at it ASAP. M --=20 Mark R V Murray From owner-svn-src-head@FreeBSD.ORG Thu May 22 07:25:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03DAEE1; Thu, 22 May 2014 07:25:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E605B227B; Thu, 22 May 2014 07:25:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4M7PaNV088485; Thu, 22 May 2014 07:25:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4M7PaQA088484; Thu, 22 May 2014 07:25:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405220725.s4M7PaQA088484@svn.freebsd.org> From: Adrian Chadd Date: Thu, 22 May 2014 07:25:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266537 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 07:25:37 -0000 Author: adrian Date: Thu May 22 07:25:36 2014 New Revision: 266537 URL: http://svnweb.freebsd.org/changeset/base/266537 Log: Use CPU_FIRST() / CPU_NEXT() to iterate over the valid CPU IDs. Modified: head/sys/netinet/in_rss.c Modified: head/sys/netinet/in_rss.c ============================================================================== --- head/sys/netinet/in_rss.c Thu May 22 06:40:07 2014 (r266536) +++ head/sys/netinet/in_rss.c Thu May 22 07:25:36 2014 (r266537) @@ -176,6 +176,7 @@ static void rss_init(__unused void *arg) { u_int i; + u_int cpuid; /* * Validate tunables, coerce to sensible values. @@ -245,11 +246,12 @@ rss_init(__unused void *arg) /* * Set up initial CPU assignments: round-robin by default. - * - * XXXRW: Need a mapping to non-contiguous IDs here. */ - for (i = 0; i < rss_buckets; i++) - rss_table[i].rte_cpu = i % rss_ncpus; + cpuid = CPU_FIRST(); + for (i = 0; i < rss_buckets; i++) { + rss_table[i].rte_cpu = cpuid; + cpuid = CPU_NEXT(cpuid); + } /* * Randomize rrs_key. From owner-svn-src-head@FreeBSD.ORG Thu May 22 07:27:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE504417; Thu, 22 May 2014 07:27:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A21CA22B1; Thu, 22 May 2014 07:27:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4M7R46l088718; Thu, 22 May 2014 07:27:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4M7R4tk088717; Thu, 22 May 2014 07:27:04 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405220727.s4M7R4tk088717@svn.freebsd.org> From: Alexander Motin Date: Thu, 22 May 2014 07:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266538 - head/sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 07:27:04 -0000 Author: mav Date: Thu May 22 07:27:04 2014 New Revision: 266538 URL: http://svnweb.freebsd.org/changeset/base/266538 Log: Make ng_mppc to not disable the node in case of multiple packet loss. Quite often it can be just packet reorder, and killing link in such case is inconvenient. Add few sysctl's to control that behavior. PR: kern/182212 Submitted by: Eugene Grosbein MFC after: 2 weeks Modified: head/sys/netgraph/ng_mppc.c Modified: head/sys/netgraph/ng_mppc.c ============================================================================== --- head/sys/netgraph/ng_mppc.c Thu May 22 07:25:36 2014 (r266537) +++ head/sys/netgraph/ng_mppc.c Thu May 22 07:27:04 2014 (r266538) @@ -55,6 +55,7 @@ #include #include #include +#include #include #include @@ -107,6 +108,23 @@ static MALLOC_DEFINE(M_NETGRAPH_MPPC, "n */ #define MPPE_MAX_REKEY 1000 +SYSCTL_NODE(_net_graph, OID_AUTO, mppe, CTLFLAG_RW, 0, "MPPE"); + +static int mppe_block_on_max_rekey = 0; +TUNABLE_INT("net.graph.mppe.block_on_max_rekey", &mppe_block_on_max_rekey); +SYSCTL_INT(_net_graph_mppe, OID_AUTO, block_on_max_rekey, CTLFLAG_RW, + &mppe_block_on_max_rekey, 0, "Block node on max MPPE key re-calculations"); + +static int mppe_log_max_rekey = 1; +TUNABLE_INT("net.graph.mppe.log_max_rekey", &mppe_log_max_rekey); +SYSCTL_INT(_net_graph_mppe, OID_AUTO, log_max_rekey, CTLFLAG_RW, + &mppe_log_max_rekey, 0, "Log max MPPE key re-calculations event"); + +static int mppe_max_rekey = MPPE_MAX_REKEY; +TUNABLE_INT("net.graph.mppe.max_rekey", &mppe_max_rekey); +SYSCTL_INT(_net_graph_mppe, OID_AUTO, max_rekey, CTLFLAG_RW, + &mppe_max_rekey, 0, "Maximum number of MPPE key re-calculations"); + /* MPPC packet header bits */ #define MPPC_FLAG_FLUSHED 0x8000 /* xmitter reset state */ #define MPPC_FLAG_RESTART 0x4000 /* compress history restart */ @@ -646,12 +664,23 @@ ng_mppc_decompress(node_p node, struct m /* How many times are we going to have to re-key? */ rekey = ((d->cfg.bits & MPPE_STATELESS) != 0) ? numLost : (numLost / (MPPE_UPDATE_MASK + 1)); - if (rekey > MPPE_MAX_REKEY) { - log(LOG_ERR, "%s: too many (%d) packets" - " dropped, disabling node %p!", - __func__, numLost, node); + if (rekey > mppe_max_rekey) { + if (mppe_block_on_max_rekey) { + if (mppe_log_max_rekey) { + log(LOG_ERR, "%s: too many (%d) packets" + " dropped, disabling node %p!\n", + __func__, numLost, node); + } priv->recv.cfg.enable = 0; goto failed; + } else { + if (mppe_log_max_rekey) { + log(LOG_ERR, "%s: %d packets" + " dropped, node %p\n", + __func__, numLost, node); + } + goto failed; + } } /* Re-key as necessary to catch up to peer */ From owner-svn-src-head@FreeBSD.ORG Thu May 22 09:28:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47871CA9; Thu, 22 May 2014 09:28:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 350B12CF2; Thu, 22 May 2014 09:28:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4M9SbUX043179; Thu, 22 May 2014 09:28:37 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4M9Sbvo043178; Thu, 22 May 2014 09:28:37 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405220928.s4M9Sbvo043178@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 22 May 2014 09:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266539 - head/usr.bin/lock X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 09:28:37 -0000 Author: ray Date: Thu May 22 09:28:36 2014 New Revision: 266539 URL: http://svnweb.freebsd.org/changeset/base/266539 Log: Rollback r266496. Different meaning of flags for lock(1) and vidcontrol(1) confuse me. Pointy hat to: ray Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/lock/lock.c Modified: head/usr.bin/lock/lock.c ============================================================================== --- head/usr.bin/lock/lock.c Thu May 22 07:27:04 2014 (r266538) +++ head/usr.bin/lock/lock.c Thu May 22 09:28:36 2014 (r266539) @@ -121,7 +121,7 @@ main(int argc, char **argv) no_timeout = 1; break; case 'v': - vtylock = 0x2; + vtylock = 1; break; case '?': default: @@ -193,7 +193,7 @@ main(int argc, char **argv) (void)tcsetattr(0, TCSADRAIN|TCSASOFT, &tty); err(1, "locking vty"); } - vtyunlock = 0x1; + vtyunlock = 0x2; } /* header info */ From owner-svn-src-head@FreeBSD.ORG Thu May 22 09:31:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27026DF7; Thu, 22 May 2014 09:31:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14B032D02; Thu, 22 May 2014 09:31:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4M9VI2w044540; Thu, 22 May 2014 09:31:18 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4M9VIJ6044539; Thu, 22 May 2014 09:31:18 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405220931.s4M9VIJ6044539@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 22 May 2014 09:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266540 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 09:31:19 -0000 Author: ray Date: Thu May 22 09:31:18 2014 New Revision: 266540 URL: http://svnweb.freebsd.org/changeset/base/266540 Log: Proper fix of VT_LOCKSWITCH ioctl. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Thu May 22 09:28:36 2014 (r266539) +++ head/sys/dev/vt/vt_core.c Thu May 22 09:31:18 2014 (r266540) @@ -1815,9 +1815,9 @@ skip_thunk: case VT_LOCKSWITCH: /* TODO: Check current state, switching can be in progress. */ if ((*(int *)data) == 0x01) - vw->vw_flags &= ~VWF_VTYLOCK; - else if ((*(int *)data) == 0x02) vw->vw_flags |= VWF_VTYLOCK; + else if ((*(int *)data) == 0x02) + vw->vw_flags &= ~VWF_VTYLOCK; else return (EINVAL); return (0); From owner-svn-src-head@FreeBSD.ORG Thu May 22 11:58:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4FAF062B; Thu, 22 May 2014 11:58:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22E0F29D2; Thu, 22 May 2014 11:58:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4MBwGUQ013364; Thu, 22 May 2014 11:58:16 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4MBwFRw013363; Thu, 22 May 2014 11:58:15 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405221158.s4MBwFRw013363@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 22 May 2014 11:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266541 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 11:58:16 -0000 Author: hselasky Date: Thu May 22 11:58:15 2014 New Revision: 266541 URL: http://svnweb.freebsd.org/changeset/base/266541 Log: - Fix a bug where the TLBPC value was forced to being odd for IN direction isochronous transfers. - Remove setting of fields which does not belong to the respective TRBs. These fields are currently set as zero and this is more a cosmetic change. MFC after: 3 days Submitted by: Horse Ma Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Thu May 22 09:31:18 2014 (r266540) +++ head/sys/dev/usb/controller/xhci.c Thu May 22 11:58:15 2014 (r266541) @@ -1849,31 +1849,25 @@ restart: XHCI_TRB_3_ISO_SIA_BIT; } if (temp->direction == UE_DIR_IN) - dword |= XHCI_TRB_3_DIR_IN | XHCI_TRB_3_ISP_BIT; + dword |= XHCI_TRB_3_ISP_BIT; break; case XHCI_TRB_TYPE_DATA_STAGE: dword = XHCI_TRB_3_CHAIN_BIT | XHCI_TRB_3_CYCLE_BIT | - XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_DATA_STAGE) | - XHCI_TRB_3_TBC_SET(temp->tbc) | - XHCI_TRB_3_TLBPC_SET(temp->tlbpc); + XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_DATA_STAGE); if (temp->direction == UE_DIR_IN) dword |= XHCI_TRB_3_DIR_IN | XHCI_TRB_3_ISP_BIT; break; case XHCI_TRB_TYPE_STATUS_STAGE: dword = XHCI_TRB_3_CHAIN_BIT | XHCI_TRB_3_CYCLE_BIT | - XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_STATUS_STAGE) | - XHCI_TRB_3_TBC_SET(temp->tbc) | - XHCI_TRB_3_TLBPC_SET(temp->tlbpc); + XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_STATUS_STAGE); if (temp->direction == UE_DIR_IN) dword |= XHCI_TRB_3_DIR_IN; break; default: /* XHCI_TRB_TYPE_NORMAL */ dword = XHCI_TRB_3_CHAIN_BIT | XHCI_TRB_3_CYCLE_BIT | - XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_NORMAL) | - XHCI_TRB_3_TBC_SET(temp->tbc) | - XHCI_TRB_3_TLBPC_SET(temp->tlbpc); + XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_NORMAL); if (temp->direction == UE_DIR_IN) - dword |= XHCI_TRB_3_DIR_IN | XHCI_TRB_3_ISP_BIT; + dword |= XHCI_TRB_3_ISP_BIT; break; } td->td_trb[x].dwTrb3 = htole32(dword); From owner-svn-src-head@FreeBSD.ORG Thu May 22 12:01:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C82A69F5; Thu, 22 May 2014 12:01:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B574A2A9A; Thu, 22 May 2014 12:01:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4MC1hBS016679; Thu, 22 May 2014 12:01:43 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4MC1h83016678; Thu, 22 May 2014 12:01:43 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405221201.s4MC1h83016678@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 22 May 2014 12:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266542 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 12:01:43 -0000 Author: hselasky Date: Thu May 22 12:01:43 2014 New Revision: 266542 URL: http://svnweb.freebsd.org/changeset/base/266542 Log: - Give firmware loading more time. MFC after: 3 days Modified: head/sys/dev/usb/wlan/if_rsu.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Thu May 22 11:58:15 2014 (r266541) +++ head/sys/dev/usb/wlan/if_rsu.c Thu May 22 12:01:43 2014 (r266542) @@ -2220,13 +2220,13 @@ rsu_load_firmware(struct rsu_softc *sc) goto fail; } /* Wait for load to complete. */ - for (ntries = 0; ntries != 10; ntries++) { + for (ntries = 0; ntries != 50; ntries++) { usb_pause_mtx(&sc->sc_mtx, hz / 100); reg = rsu_read_2(sc, R92S_TCR); if (reg & R92S_TCR_EMEM_CODE_DONE) break; } - if (ntries == 10) { + if (ntries == 50) { device_printf(sc->sc_dev, "timeout waiting for EMEM transfer\n"); error = ETIMEDOUT; goto fail; From owner-svn-src-head@FreeBSD.ORG Thu May 22 12:30:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29D0F2F9; Thu, 22 May 2014 12:30:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 174E52CD1; Thu, 22 May 2014 12:30:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4MCUu1I029703; Thu, 22 May 2014 12:30:56 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4MCUuhq029702; Thu, 22 May 2014 12:30:56 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201405221230.s4MCUuhq029702@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 22 May 2014 12:30:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266543 - head/release/picobsd/build X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 12:30:57 -0000 Author: luigi Date: Thu May 22 12:30:56 2014 New Revision: 266543 URL: http://svnweb.freebsd.org/changeset/base/266543 Log: fix picobsd cross builds on stable/10 Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Thu May 22 12:01:43 2014 (r266542) +++ head/release/picobsd/build/picobsd Thu May 22 12:30:56 2014 (r266543) @@ -996,7 +996,9 @@ set_build_parameters() { export TARGET_ARCH=${o_arch} TARGET=${o_arch} # XXX 20131001 see if CLANG fixes the build export WITHOUT_CLANG_IS_CC=yes + export WITHOUT_CLANG_BOOTSTRAP=yes export WITH_GCC=yes + export WITH_GCC_BOOTSTRAP=yes export WITH_GNUCXX=yes export WITHOUT_CLANG=yes export WITHOUT_ICONV=yes From owner-svn-src-head@FreeBSD.ORG Thu May 22 13:10:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2BD5EF34; Thu, 22 May 2014 13:10:09 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA0C5204D; Thu, 22 May 2014 13:10:08 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id EE9151FE026; Thu, 22 May 2014 15:10:07 +0200 (CEST) Message-ID: <537DF75B.9040607@selasky.org> Date: Thu, 22 May 2014 15:10:51 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Aleksandr Rybalko , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r265927 - head/sys/dev/vt References: <201405121929.s4CJTcBx010967@svn.freebsd.org> <537D0AAB.3090303@selasky.org> In-Reply-To: <537D0AAB.3090303@selasky.org> Content-Type: multipart/mixed; boundary="------------060600010908060603090709" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 13:10:09 -0000 This is a multi-part message in MIME format. --------------060600010908060603090709 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 05/21/14 22:20, Hans Petter Selasky wrote: > On 05/12/14 21:29, Aleksandr Rybalko wrote: >> Author: ray >> Date: Mon May 12 19:29:38 2014 >> New Revision: 265927 >> URL: http://svnweb.freebsd.org/changeset/base/265927 >> >> Log: >> Update terminal sizes in any case when new vt(4) driver arrive. >> (Plus remove one unused newline) >> >> Sponsored by: The FreeBSD Foundation >> >> Modified: >> head/sys/dev/vt/vt_core.c >> > > This patch causes panic when booting the RPI-B: > > VT: initialize with new VT driver "fb". > panic: mtx_lock() of spin mutex (null) @ > /usr/img/freebsd/sys/dev/vt/vt_core.c:2037 > KDB: enter: panic > [ thread pid 0 tid 100000 ] > Stopped at $d: ldrb r15, [r15, r15, ror r15]! > > __mtx_lock_flags() at > vt_resize() at vt_upgrade() at > mi_startup() at mi_startup+0x11c > > > --HPS > This patch fixes it. Not sure if it is correct. --HPS > diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c > index 39b9265..d85d5e8 100644 > --- a/sys/dev/vt/vt_core.c > +++ b/sys/dev/vt/vt_core.c > @@ -145,6 +145,7 @@ static int vt_late_window_switch(struct vt_window *); > static int vt_proc_alive(struct vt_window *); > static void vt_resize(struct vt_device *); > static void vt_update_static(void *); > +static void vt_upgrade_static(void *); > > SET_DECLARE(vt_drv_set, struct vt_driver); > > @@ -203,23 +204,28 @@ DATA_SET(cons_set, vt_consterm_consdev); > * Right after kmem is done to allow early drivers to use locking and allocate > * memory. > */ > -SYSINIT(vt_update_static, SI_SUB_KMEM, SI_ORDER_ANY, vt_update_static, > - &vt_consdev); > +SYSINIT(vt_init_1, SI_SUB_KMEM, SI_ORDER_ANY, vt_update_static, NULL); > /* Delay until all devices attached, to not waste time. */ > -SYSINIT(vt_early_cons, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_ANY, vt_upgrade, > - &vt_consdev); > +SYSINIT(vt_init_2, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_ANY, vt_upgrade_static, NULL); > > /* Initialize locks/mem depended members. */ > static void > vt_update_static(void *dummy) > { > + if (main_vd == NULL) > + return; > + printf("VT: running with driver \"%s\".\n", > + main_vd->vd_driver->vd_name); > + mtx_init(&main_vd->vd_lock, "vtdev", NULL, MTX_DEF); > + cv_init(&main_vd->vd_winswitch, "vtwswt"); > +} > > - if (main_vd != NULL) { > - printf("VT: running with driver \"%s\".\n", > - main_vd->vd_driver->vd_name); > - mtx_init(&main_vd->vd_lock, "vtdev", NULL, MTX_DEF); > - cv_init(&main_vd->vd_winswitch, "vtwswt"); > - } > +static void > +vt_upgrade_static(void *dummy) > +{ > + if (main_vd == NULL) > + return; > + vt_upgrade(main_vd); > } > > static void --------------060600010908060603090709 Content-Type: text/x-diff; name="vt.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="vt.diff" diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index 39b9265..d85d5e8 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -145,6 +145,7 @@ static int vt_late_window_switch(struct vt_window *); static int vt_proc_alive(struct vt_window *); static void vt_resize(struct vt_device *); static void vt_update_static(void *); +static void vt_upgrade_static(void *); SET_DECLARE(vt_drv_set, struct vt_driver); @@ -203,23 +204,28 @@ DATA_SET(cons_set, vt_consterm_consdev); * Right after kmem is done to allow early drivers to use locking and allocate * memory. */ -SYSINIT(vt_update_static, SI_SUB_KMEM, SI_ORDER_ANY, vt_update_static, - &vt_consdev); +SYSINIT(vt_init_1, SI_SUB_KMEM, SI_ORDER_ANY, vt_update_static, NULL); /* Delay until all devices attached, to not waste time. */ -SYSINIT(vt_early_cons, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_ANY, vt_upgrade, - &vt_consdev); +SYSINIT(vt_init_2, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_ANY, vt_upgrade_static, NULL); /* Initialize locks/mem depended members. */ static void vt_update_static(void *dummy) { + if (main_vd == NULL) + return; + printf("VT: running with driver \"%s\".\n", + main_vd->vd_driver->vd_name); + mtx_init(&main_vd->vd_lock, "vtdev", NULL, MTX_DEF); + cv_init(&main_vd->vd_winswitch, "vtwswt"); +} - if (main_vd != NULL) { - printf("VT: running with driver \"%s\".\n", - main_vd->vd_driver->vd_name); - mtx_init(&main_vd->vd_lock, "vtdev", NULL, MTX_DEF); - cv_init(&main_vd->vd_winswitch, "vtwswt"); - } +static void +vt_upgrade_static(void *dummy) +{ + if (main_vd == NULL) + return; + vt_upgrade(main_vd); } static void --------------060600010908060603090709-- From owner-svn-src-head@FreeBSD.ORG Thu May 22 14:56:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A52CAAA4; Thu, 22 May 2014 14:56:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8605129F1; Thu, 22 May 2014 14:56:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4MEuYuM095775; Thu, 22 May 2014 14:56:34 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4MEuYkb095774; Thu, 22 May 2014 14:56:34 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405221456.s4MEuYkb095774@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 22 May 2014 14:56:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266544 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 14:56:34 -0000 Author: trasz Date: Thu May 22 14:56:34 2014 New Revision: 266544 URL: http://svnweb.freebsd.org/changeset/base/266544 Log: Make iwn(4) able to get itself back into working condition after "fatal firmware error" happens. Previously it was neccessary to reset it manually, using "/etc/rc.d/netif restart". Approved by: adrian@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Thu May 22 12:30:56 2014 (r266543) +++ head/sys/dev/iwn/if_iwn.c Thu May 22 14:56:34 2014 (r266544) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -342,6 +343,7 @@ static void iwn_set_channel(struct ieee8 static void iwn_scan_curchan(struct ieee80211_scan_state *, unsigned long); static void iwn_scan_mindwell(struct ieee80211_scan_state *); static void iwn_hw_reset(void *, int); +static void iwn_reinit_thread(void *); #ifdef IWN_DEBUG static char *iwn_get_csr_string(int); static void iwn_debug_register(struct iwn_softc *); @@ -1197,6 +1199,8 @@ iwn4965_attach(struct iwn_softc *sc, uin /* Enable normal btcoex */ sc->sc_flags |= IWN_FLAG_BTCOEX; + kthread_add(iwn_reinit_thread, sc, NULL, NULL, 0, 0, "iwn_reinit"); + DPRINTF(sc, IWN_DEBUG_TRACE, "%s: end\n",__func__); return 0; @@ -3884,6 +3888,52 @@ iwn_fatal_intr(struct iwn_softc *sc) } static void +iwn_reinit_thread(void *arg) +{ + struct iwn_softc *sc = arg; + int error; + + mtx_lock(&sc->sc_mtx); + for (;;) { + struct ifnet *ifp; + struct ieee80211com *ic; + struct ieee80211vap *vap; + + msleep(&sc->fwname, &sc->sc_mtx, PCATCH, "iwn_reinit", 0); + + ifp = sc->sc_ifp; + ic = ifp->if_l2com; + vap = TAILQ_FIRST(&ic->ic_vaps); + + if (vap == NULL) { + printf("%s: null vap\n", __func__); + continue; + } + + device_printf(sc->sc_dev, "%s: controller panicked; " + "resetting; iv_state = %d...\n", __func__, vap->iv_state); + mtx_unlock(&sc->sc_mtx); + iwn_stop(sc); + iwn_init(sc); + iwn_start(sc->sc_ifp); + if (vap->iv_state >= IEEE80211_S_AUTH && + (error = iwn_auth(sc, vap)) != 0) { + device_printf(sc->sc_dev, + "%s: could not move to auth state\n", __func__); + } + if (vap->iv_state >= IEEE80211_S_RUN && + (error = iwn_run(sc, vap)) != 0) { + device_printf(sc->sc_dev, + "%s: could not move to run state\n", __func__); + } + mtx_lock(&sc->sc_mtx); + } + mtx_unlock(&sc->sc_mtx); + + kthread_exit(); +} + +static void iwn_intr(void *arg) { struct iwn_softc *sc = arg; @@ -3944,8 +3994,10 @@ iwn_intr(void *arg) #endif /* Dump firmware error log and stop. */ iwn_fatal_intr(sc); - ifp->if_flags &= ~IFF_UP; - iwn_stop_locked(sc); + + device_printf(sc->sc_dev, "%s: reinit; %p\n", + __func__, &sc->fwname); + wakeup(&sc->fwname); goto done; } if ((r1 & (IWN_INT_FH_RX | IWN_INT_SW_RX | IWN_INT_RX_PERIODIC)) || From owner-svn-src-head@FreeBSD.ORG Thu May 22 15:00:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E41FF1B; Thu, 22 May 2014 15:00:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 716A52A59; Thu, 22 May 2014 15:00:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4MF0X0n098731; Thu, 22 May 2014 15:00:33 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4MF0XWx098730; Thu, 22 May 2014 15:00:33 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405221500.s4MF0XWx098730@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 22 May 2014 15:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266545 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 15:00:33 -0000 Author: trasz Date: Thu May 22 15:00:32 2014 New Revision: 266545 URL: http://svnweb.freebsd.org/changeset/base/266545 Log: Erm, revert r266544; wrong tree. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Thu May 22 14:56:34 2014 (r266544) +++ head/sys/dev/iwn/if_iwn.c Thu May 22 15:00:32 2014 (r266545) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -343,7 +342,6 @@ static void iwn_set_channel(struct ieee8 static void iwn_scan_curchan(struct ieee80211_scan_state *, unsigned long); static void iwn_scan_mindwell(struct ieee80211_scan_state *); static void iwn_hw_reset(void *, int); -static void iwn_reinit_thread(void *); #ifdef IWN_DEBUG static char *iwn_get_csr_string(int); static void iwn_debug_register(struct iwn_softc *); @@ -1199,8 +1197,6 @@ iwn4965_attach(struct iwn_softc *sc, uin /* Enable normal btcoex */ sc->sc_flags |= IWN_FLAG_BTCOEX; - kthread_add(iwn_reinit_thread, sc, NULL, NULL, 0, 0, "iwn_reinit"); - DPRINTF(sc, IWN_DEBUG_TRACE, "%s: end\n",__func__); return 0; @@ -3888,52 +3884,6 @@ iwn_fatal_intr(struct iwn_softc *sc) } static void -iwn_reinit_thread(void *arg) -{ - struct iwn_softc *sc = arg; - int error; - - mtx_lock(&sc->sc_mtx); - for (;;) { - struct ifnet *ifp; - struct ieee80211com *ic; - struct ieee80211vap *vap; - - msleep(&sc->fwname, &sc->sc_mtx, PCATCH, "iwn_reinit", 0); - - ifp = sc->sc_ifp; - ic = ifp->if_l2com; - vap = TAILQ_FIRST(&ic->ic_vaps); - - if (vap == NULL) { - printf("%s: null vap\n", __func__); - continue; - } - - device_printf(sc->sc_dev, "%s: controller panicked; " - "resetting; iv_state = %d...\n", __func__, vap->iv_state); - mtx_unlock(&sc->sc_mtx); - iwn_stop(sc); - iwn_init(sc); - iwn_start(sc->sc_ifp); - if (vap->iv_state >= IEEE80211_S_AUTH && - (error = iwn_auth(sc, vap)) != 0) { - device_printf(sc->sc_dev, - "%s: could not move to auth state\n", __func__); - } - if (vap->iv_state >= IEEE80211_S_RUN && - (error = iwn_run(sc, vap)) != 0) { - device_printf(sc->sc_dev, - "%s: could not move to run state\n", __func__); - } - mtx_lock(&sc->sc_mtx); - } - mtx_unlock(&sc->sc_mtx); - - kthread_exit(); -} - -static void iwn_intr(void *arg) { struct iwn_softc *sc = arg; @@ -3994,10 +3944,8 @@ iwn_intr(void *arg) #endif /* Dump firmware error log and stop. */ iwn_fatal_intr(sc); - - device_printf(sc->sc_dev, "%s: reinit; %p\n", - __func__, &sc->fwname); - wakeup(&sc->fwname); + ifp->if_flags &= ~IFF_UP; + iwn_stop_locked(sc); goto done; } if ((r1 & (IWN_INT_FH_RX | IWN_INT_SW_RX | IWN_INT_RX_PERIODIC)) || From owner-svn-src-head@FreeBSD.ORG Thu May 22 15:29:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54DA6BBF; Thu, 22 May 2014 15:29:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41DE12D49; Thu, 22 May 2014 15:29:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4MFTQMp010215; Thu, 22 May 2014 15:29:26 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4MFTPxv010213; Thu, 22 May 2014 15:29:25 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201405221529.s4MFTPxv010213@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 22 May 2014 15:29:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266546 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 15:29:26 -0000 Author: trasz Date: Thu May 22 15:29:25 2014 New Revision: 266546 URL: http://svnweb.freebsd.org/changeset/base/266546 Log: Make iwn(4) able to get itself back into working condition after "fatal firmware error" happens. Previously it was neccessary to reset it manually, using "/etc/rc.d/netif restart". Approved by: adrian@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnvar.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Thu May 22 15:00:32 2014 (r266545) +++ head/sys/dev/iwn/if_iwn.c Thu May 22 15:29:25 2014 (r266546) @@ -332,6 +332,7 @@ static int iwn_hw_init(struct iwn_softc static void iwn_hw_stop(struct iwn_softc *); static void iwn_radio_on(void *, int); static void iwn_radio_off(void *, int); +static void iwn_panicked(void *, int); static void iwn_init_locked(struct iwn_softc *); static void iwn_init(void *); static void iwn_stop_locked(struct iwn_softc *); @@ -671,6 +672,15 @@ iwn_attach(device_t dev) TASK_INIT(&sc->sc_reinit_task, 0, iwn_hw_reset, sc); TASK_INIT(&sc->sc_radioon_task, 0, iwn_radio_on, sc); TASK_INIT(&sc->sc_radiooff_task, 0, iwn_radio_off, sc); + TASK_INIT(&sc->sc_panic_task, 0, iwn_panicked, sc); + + sc->sc_tq = taskqueue_create("iwn_taskq", M_WAITOK, + taskqueue_thread_enqueue, &sc->sc_tq); + error = taskqueue_start_threads(&sc->sc_tq, 1, 0, "iwn_taskq"); + if (error != 0) { + device_printf(dev, "can't start threads, error %d\n", error); + goto fail; + } iwn_sysctlattach(sc); @@ -1334,6 +1344,10 @@ iwn_detach(device_t dev) ieee80211_draintask(ic, &sc->sc_radiooff_task); iwn_stop(sc); + + taskqueue_drain_all(sc->sc_tq); + taskqueue_free(sc->sc_tq); + callout_drain(&sc->watchdog_to); callout_drain(&sc->calib_to); ieee80211_ifdetach(ic); @@ -3944,8 +3958,8 @@ iwn_intr(void *arg) #endif /* Dump firmware error log and stop. */ iwn_fatal_intr(sc); - ifp->if_flags &= ~IFF_UP; - iwn_stop_locked(sc); + + taskqueue_enqueue(sc->sc_tq, &sc->sc_panic_task); goto done; } if ((r1 & (IWN_INT_FH_RX | IWN_INT_SW_RX | IWN_INT_RX_PERIODIC)) || @@ -8412,6 +8426,38 @@ iwn_radio_off(void *arg0, int pending) } static void +iwn_panicked(void *arg0, int pending) +{ + struct iwn_softc *sc = arg0; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + int error; + + if (vap == NULL) { + printf("%s: null vap\n", __func__); + return; + } + + device_printf(sc->sc_dev, "%s: controller panicked, iv_state = %d; " + "resetting...\n", __func__, vap->iv_state); + + iwn_stop(sc); + iwn_init(sc); + iwn_start(sc->sc_ifp); + if (vap->iv_state >= IEEE80211_S_AUTH && + (error = iwn_auth(sc, vap)) != 0) { + device_printf(sc->sc_dev, + "%s: could not move to auth state\n", __func__); + } + if (vap->iv_state >= IEEE80211_S_RUN && + (error = iwn_run(sc, vap)) != 0) { + device_printf(sc->sc_dev, + "%s: could not move to run state\n", __func__); + } +} + +static void iwn_init_locked(struct iwn_softc *sc) { struct ifnet *ifp = sc->sc_ifp; Modified: head/sys/dev/iwn/if_iwnvar.h ============================================================================== --- head/sys/dev/iwn/if_iwnvar.h Thu May 22 15:00:32 2014 (r266545) +++ head/sys/dev/iwn/if_iwnvar.h Thu May 22 15:29:25 2014 (r266546) @@ -308,6 +308,10 @@ struct iwn_softc { struct task sc_reinit_task; struct task sc_radioon_task; struct task sc_radiooff_task; + struct task sc_panic_task; + + /* Taskqueue */ + struct taskqueue *sc_tq; /* Calibration information */ struct callout calib_to; From owner-svn-src-head@FreeBSD.ORG Thu May 22 16:30:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF4ECB35; Thu, 22 May 2014 16:30:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CCF623A5; Thu, 22 May 2014 16:30:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4MGUWkF039632; Thu, 22 May 2014 16:30:32 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4MGUWEg039631; Thu, 22 May 2014 16:30:32 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201405221630.s4MGUWEg039631@svn.freebsd.org> From: Don Lewis Date: Thu, 22 May 2014 16:30:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266547 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 16:30:32 -0000 Author: truckman Date: Thu May 22 16:30:32 2014 New Revision: 266547 URL: http://svnweb.freebsd.org/changeset/base/266547 Log: Don't delete our new vt(4) man page. X-MFC-With: r265798 Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu May 22 15:29:25 2014 (r266546) +++ head/ObsoleteFiles.inc Thu May 22 16:30:32 2014 (r266547) @@ -2854,7 +2854,6 @@ OLD_DIRS+=usr/share/misc/pcvtfonts OLD_FILES+=usr/share/misc/keycap.pcvt OLD_FILES+=usr/share/man/man8/ispcvt.8.gz OLD_FILES+=usr/share/man/man5/keycap.5.gz -OLD_FILES+=usr/share/man/man4/vt.4.gz OLD_FILES+=usr/share/man/man4/pcvt.4.gz OLD_FILES+=usr/share/man/man3/kgetstr.3.gz OLD_FILES+=usr/share/man/man3/kgetnum.3.gz From owner-svn-src-head@FreeBSD.ORG Thu May 22 17:22:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87639C7F; Thu, 22 May 2014 17:22:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7477627E6; Thu, 22 May 2014 17:22:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4MHMcbr064322; Thu, 22 May 2014 17:22:38 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4MHMbBW064319; Thu, 22 May 2014 17:22:37 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405221722.s4MHMbBW064319@svn.freebsd.org> From: Neel Natu Date: Thu, 22 May 2014 17:22:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266550 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 17:22:38 -0000 Author: neel Date: Thu May 22 17:22:37 2014 New Revision: 266550 URL: http://svnweb.freebsd.org/changeset/base/266550 Log: Allow vmx_getdesc() and vmx_setdesc() to be called for a vcpu that is in the VCPU_RUNNING state. This will let the VMX exit handler inspect the vcpu's segment descriptors without having to exit the critical section. Modified: head/sys/amd64/vmm/intel/vmcs.c head/sys/amd64/vmm/intel/vmcs.h head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/intel/vmcs.c ============================================================================== --- head/sys/amd64/vmm/intel/vmcs.c Thu May 22 16:36:01 2014 (r266549) +++ head/sys/amd64/vmm/intel/vmcs.c Thu May 22 17:22:37 2014 (r266550) @@ -231,7 +231,7 @@ vmcs_setreg(struct vmcs *vmcs, int runni } int -vmcs_setdesc(struct vmcs *vmcs, int seg, struct seg_desc *desc) +vmcs_setdesc(struct vmcs *vmcs, int running, int seg, struct seg_desc *desc) { int error; uint32_t base, limit, access; @@ -240,7 +240,8 @@ vmcs_setdesc(struct vmcs *vmcs, int seg, if (error != 0) panic("vmcs_setdesc: invalid segment register %d", seg); - VMPTRLD(vmcs); + if (!running) + VMPTRLD(vmcs); if ((error = vmwrite(base, desc->base)) != 0) goto done; @@ -252,12 +253,13 @@ vmcs_setdesc(struct vmcs *vmcs, int seg, goto done; } done: - VMCLEAR(vmcs); + if (!running) + VMCLEAR(vmcs); return (error); } int -vmcs_getdesc(struct vmcs *vmcs, int seg, struct seg_desc *desc) +vmcs_getdesc(struct vmcs *vmcs, int running, int seg, struct seg_desc *desc) { int error; uint32_t base, limit, access; @@ -267,7 +269,8 @@ vmcs_getdesc(struct vmcs *vmcs, int seg, if (error != 0) panic("vmcs_getdesc: invalid segment register %d", seg); - VMPTRLD(vmcs); + if (!running) + VMPTRLD(vmcs); if ((error = vmread(base, &u64)) != 0) goto done; desc->base = u64; @@ -282,7 +285,8 @@ vmcs_getdesc(struct vmcs *vmcs, int seg, desc->access = u64; } done: - VMCLEAR(vmcs); + if (!running) + VMCLEAR(vmcs); return (error); } Modified: head/sys/amd64/vmm/intel/vmcs.h ============================================================================== --- head/sys/amd64/vmm/intel/vmcs.h Thu May 22 16:36:01 2014 (r266549) +++ head/sys/amd64/vmm/intel/vmcs.h Thu May 22 17:22:37 2014 (r266550) @@ -49,9 +49,9 @@ int vmcs_set_msr_save(struct vmcs *vmcs, int vmcs_init(struct vmcs *vmcs); int vmcs_getreg(struct vmcs *vmcs, int running, int ident, uint64_t *rv); int vmcs_setreg(struct vmcs *vmcs, int running, int ident, uint64_t val); -int vmcs_getdesc(struct vmcs *vmcs, int ident, +int vmcs_getdesc(struct vmcs *vmcs, int running, int ident, struct seg_desc *desc); -int vmcs_setdesc(struct vmcs *vmcs, int ident, +int vmcs_setdesc(struct vmcs *vmcs, int running, int ident, struct seg_desc *desc); static __inline uint64_t Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Thu May 22 16:36:01 2014 (r266549) +++ head/sys/amd64/vmm/intel/vmx.c Thu May 22 17:22:37 2014 (r266550) @@ -2409,17 +2409,27 @@ vmx_setreg(void *arg, int vcpu, int reg, static int vmx_getdesc(void *arg, int vcpu, int reg, struct seg_desc *desc) { + int hostcpu, running; struct vmx *vmx = arg; - return (vmcs_getdesc(&vmx->vmcs[vcpu], reg, desc)); + running = vcpu_is_running(vmx->vm, vcpu, &hostcpu); + if (running && hostcpu != curcpu) + panic("vmx_getdesc: %s%d is running", vm_name(vmx->vm), vcpu); + + return (vmcs_getdesc(&vmx->vmcs[vcpu], running, reg, desc)); } static int vmx_setdesc(void *arg, int vcpu, int reg, struct seg_desc *desc) { + int hostcpu, running; struct vmx *vmx = arg; - return (vmcs_setdesc(&vmx->vmcs[vcpu], reg, desc)); + running = vcpu_is_running(vmx->vm, vcpu, &hostcpu); + if (running && hostcpu != curcpu) + panic("vmx_setdesc: %s%d is running", vm_name(vmx->vm), vcpu); + + return (vmcs_setdesc(&vmx->vmcs[vcpu], running, reg, desc)); } static int From owner-svn-src-head@FreeBSD.ORG Thu May 22 18:13:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EA05C02; Thu, 22 May 2014 18:13:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BDBC2C0B; Thu, 22 May 2014 18:13:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4MIDIIh087251; Thu, 22 May 2014 18:13:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4MIDIEC087250; Thu, 22 May 2014 18:13:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405221813.s4MIDIEC087250@svn.freebsd.org> From: John Baldwin Date: Thu, 22 May 2014 18:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266551 - head/sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 18:13:18 -0000 Author: jhb Date: Thu May 22 18:13:17 2014 New Revision: 266551 URL: http://svnweb.freebsd.org/changeset/base/266551 Log: Whitespace fix. Submitted by: kib Modified: head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Thu May 22 17:22:37 2014 (r266550) +++ head/sys/x86/include/specialreg.h Thu May 22 18:13:17 2014 (r266551) @@ -100,10 +100,10 @@ #define XFEATURE_AVX \ (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE | XFEATURE_ENABLED_AVX) #define XFEATURE_AVX512 \ - (XFEATURE_ENABLED_OPMASK | XFEATURE_ENABLED_ZMM_HI256 | \ - XFEATURE_ENABLED_HI16_ZMM) + (XFEATURE_ENABLED_OPMASK | XFEATURE_ENABLED_ZMM_HI256 | \ + XFEATURE_ENABLED_HI16_ZMM) #define XFEATURE_MPX \ - (XFEATURE_ENABLED_BNDREGS | XFEATURE_ENABLED_BNDCSR) + (XFEATURE_ENABLED_BNDREGS | XFEATURE_ENABLED_BNDCSR) /* * CPUID instruction features register From owner-svn-src-head@FreeBSD.ORG Thu May 22 18:22:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47592F3D; Thu, 22 May 2014 18:22:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34A4C2CD5; Thu, 22 May 2014 18:22:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4MIM3DC091766; Thu, 22 May 2014 18:22:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4MIM3NO091765; Thu, 22 May 2014 18:22:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405221822.s4MIM3NO091765@svn.freebsd.org> From: John Baldwin Date: Thu, 22 May 2014 18:22:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266552 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 18:22:03 -0000 Author: jhb Date: Thu May 22 18:22:02 2014 New Revision: 266552 URL: http://svnweb.freebsd.org/changeset/base/266552 Log: Don't permit users to request a subset of the AVX512 or MPX xsave masks. These masks are documented in the Intel Architecture Instruction Set Extensions Programming Reference (March 2014). Reviewed by: kib MFC after: 1 month Modified: head/sys/amd64/amd64/fpu.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Thu May 22 18:13:17 2014 (r266551) +++ head/sys/amd64/amd64/fpu.c Thu May 22 18:22:02 2014 (r266552) @@ -199,6 +199,10 @@ fpuinit_bsp1(void) TUNABLE_ULONG_FETCH("hw.xsave_mask", &xsave_mask_user); xsave_mask_user |= XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE; xsave_mask &= xsave_mask_user; + if ((xsave_mask & XFEATURE_AVX512) != XFEATURE_AVX512) + xsave_mask &= ~XFEATURE_AVX512; + if ((xsave_mask & XFEATURE_MPX) != XFEATURE_MPX) + xsave_mask &= ~XFEATURE_MPX; cpuid_count(0xd, 0x1, cp); if ((cp[0] & CPUID_EXTSTATE_XSAVEOPT) != 0) { From owner-svn-src-head@FreeBSD.ORG Thu May 22 19:22:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B714851E; Thu, 22 May 2014 19:22:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A46D92268; Thu, 22 May 2014 19:22:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4MJM4H3025266; Thu, 22 May 2014 19:22:04 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4MJM4Y9025265; Thu, 22 May 2014 19:22:04 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405221922.s4MJM4Y9025265@svn.freebsd.org> From: Glen Barber Date: Thu, 22 May 2014 19:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266553 - head/release/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 19:22:04 -0000 Author: gjb Date: Thu May 22 19:22:03 2014 New Revision: 266553 URL: http://svnweb.freebsd.org/changeset/base/266553 Log: Add forward-compatibility glue with pkg-1.3: - Use ASSUME_ALWAYS_YES=YES instead of ASSUME_ALWAYS_YES=1 since pkg-1.3 expects "yes" or "true" values. - Before exporting PKG_ABI, strip extra characters from what is parsed from 'pkg -vv'. This causes problems further down when creating the packages directory for inclusion on the dvd1.iso. Previously PKG_ABI would be 'freebsd:9:x86:64', but now is '"freebsd:9:x86:64";' in pkg-1.3 Tested on: stable/9@r265858 with ports-mgmt/pkg-devel MFC After: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/scripts/pkg-stage.sh Modified: head/release/scripts/pkg-stage.sh ============================================================================== --- head/release/scripts/pkg-stage.sh Thu May 22 18:22:02 2014 (r266552) +++ head/release/scripts/pkg-stage.sh Thu May 22 19:22:03 2014 (r266553) @@ -5,7 +5,7 @@ set -e -export ASSUME_ALWAYS_YES=1 +export ASSUME_ALWAYS_YES="YES" export PKG_DBDIR="/tmp/pkg" export PERMISSIVE="YES" export REPO_AUTOUPDATE="NO" @@ -40,7 +40,10 @@ if [ ! -x /usr/local/sbin/pkg ]; then /usr/bin/make -C /usr/ports/ports-mgmt/pkg install clean fi -export PKG_ABI=$(pkg -vv | grep ^ABI | awk '{print $3}') +PKG_ABI=$(pkg -vv | grep ^ABI | awk '{print $3}') +PKG_ABI="${PKG_ABI%\";}" +PKG_ABI="${PKG_ABI#\"}" +export PKG_ABI export PKG_CACHEDIR="dvd/packages/${PKG_ABI}" /bin/mkdir -p ${PKG_CACHEDIR} From owner-svn-src-head@FreeBSD.ORG Thu May 22 19:25:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23C837C6; Thu, 22 May 2014 19:25:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 113EC22A3; Thu, 22 May 2014 19:25:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4MJPffS026284; Thu, 22 May 2014 19:25:41 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4MJPfpq026283; Thu, 22 May 2014 19:25:41 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405221925.s4MJPfpq026283@svn.freebsd.org> From: Glen Barber Date: Thu, 22 May 2014 19:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266554 - head/release/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 19:25:42 -0000 Author: gjb Date: Thu May 22 19:25:41 2014 New Revision: 266554 URL: http://svnweb.freebsd.org/changeset/base/266554 Log: Disable the main FreeBSD pkg(7) repositories in the dvd repository configuration to avoid fetching from upstream in case there may be conflicts. MFC After: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/scripts/FreeBSD_install_cdrom.conf Modified: head/release/scripts/FreeBSD_install_cdrom.conf ============================================================================== --- head/release/scripts/FreeBSD_install_cdrom.conf Thu May 22 19:22:03 2014 (r266553) +++ head/release/scripts/FreeBSD_install_cdrom.conf Thu May 22 19:25:41 2014 (r266554) @@ -10,3 +10,7 @@ FreeBSD_install_cdrom: { enabled: yes } +FreeBSD: { + enabled: no +} + From owner-svn-src-head@FreeBSD.ORG Thu May 22 19:36:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 614CDCED; Thu, 22 May 2014 19:36:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E296239F; Thu, 22 May 2014 19:36:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4MJaUrW032369; Thu, 22 May 2014 19:36:30 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4MJaUcq032368; Thu, 22 May 2014 19:36:30 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201405221936.s4MJaUcq032368@svn.freebsd.org> From: Devin Teske Date: Thu, 22 May 2014 19:36:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266555 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 19:36:30 -0000 Author: dteske Date: Thu May 22 19:36:29 2014 New Revision: 266555 URL: http://svnweb.freebsd.org/changeset/base/266555 Log: Fix syntax error thrown at the point of creating the root pool, caused by an embedded newline appearing within the options string surrounded by double-quotes. Rework the logic that goes into setting dataset options on the root pool dataset while we're here -- added two new variables (which can be altered via scripting) ZFSBOOT_POOL_CREATE_OPTIONS and also ZFSBOOT_BOOT_POOL_CREATE_OPTIONS for setting pool/dataset attributes at the time of pool creation. The former is for setting options on the root pool (zroot) and the latter is for setting options on the optional separate boot pool (bootpool) implicitly enabled when using either GELI or MBR. The default value for the root pool variable (ZFSBOOT_POOL_CREATE_OPTIONS) is "-O compress=lz4 -O atime=off" and the default value for separate boot pool variable (ZFSBOOT_BOOT_POOL_CREATE_OPTIONS) is NULL (no additional options for the separate boot pool dataset). Reviewed by: allanjude MFC after: 7 days X-MFC-with: r266107-266109 Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Thu May 22 19:25:41 2014 (r266554) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Thu May 22 19:36:29 2014 (r266555) @@ -45,6 +45,11 @@ f_include $BSDCFG_SHARE/variable.subr : ${ZFSBOOT_POOL_NAME:=zroot} # +# Default options to use when creating zroot pool +# +: ${ZFSBOOT_POOL_CREATE_OPTIONS:=-O compress=lz4 -O atime=off} + +# # Default name for the boot environment parent dataset # : ${ZFSBOOT_BEROOT_NAME:=ROOT} @@ -82,6 +87,11 @@ f_include $BSDCFG_SHARE/variable.subr : ${ZFSBOOT_BOOT_POOL=} # +# Options to use when creating separate boot pool (if any) +# +: ${ZFSBOOT_BOOT_POOL_CREATE_OPTIONS:=} + +# # Default name for boot pool when enabled (e.g., geli(8) or MBR) # : ${ZFSBOOT_BOOT_POOL_NAME:=bootpool} @@ -942,6 +952,7 @@ zfs_create_boot() local disks="$*" disk local isswapmirror local bootpart targetpart swappart # Set by zfs_create_diskpart() below + local create_options # # Pedantic checks; should never be seen @@ -1066,7 +1077,9 @@ zfs_create_boot() f_count nvdevs $boot_vdevs [ $nvdevs -gt 1 ] && bootpool_vdevtype=mirror + create_options="$ZFSBOOT_BOOT_POOL_CREATE_OPTIONS" bootpool_options="-o altroot=$BSDINSTALL_CHROOT" + bootpool_options="$bootpool_options $create_options" bootpool_options="$bootpool_options -m \"/$bootpool_name\" -f" f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ "$bootpool_options" "$bootpool_name" \ @@ -1148,19 +1161,11 @@ zfs_create_boot() # Create the ZFS root pool with desired type and disk devices # f_dprintf "$funcname: Creating root pool..." + create_options="$ZFSBOOT_POOL_CREATE_OPTIONS" f_eval_catch $funcname zpool "$ZPOOL_CREATE_WITH_OPTIONS" \ - "-o altroot=$BSDINSTALL_CHROOT -O compress=lz4 - -m none -f" \ - "$zroot_name" "$zroot_vdevtype" "$zroot_vdevs" || - return $FAILURE - - # Customize the zroot a bit... - local option - f_dprintf "$funcname: Setting miscellaneous options on root pool..." - for option in atime=off; do - f_eval_catch $funcname zfs "$ZFS_SET" $option "$zroot_name" || - return $FAILURE - done + "-o altroot=$BSDINSTALL_CHROOT $create_options -m none -f" \ + "$zroot_name" "$zroot_vdevtype" "$zroot_vdevs" || + return $FAILURE # # Create ZFS dataset layout within the new root pool From owner-svn-src-head@FreeBSD.ORG Thu May 22 20:24:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6ACAEC01; Thu, 22 May 2014 20:24:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DDD827D1; Thu, 22 May 2014 20:24:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4MKOVOS061189; Thu, 22 May 2014 20:24:31 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4MKOUnm061187; Thu, 22 May 2014 20:24:30 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201405222024.s4MKOUnm061187@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 22 May 2014 20:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266556 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 20:24:31 -0000 Author: marcel Date: Thu May 22 20:24:30 2014 New Revision: 266556 URL: http://svnweb.freebsd.org/changeset/base/266556 Log: Create our temporary file in $TMPDIR, if the environment variable is set. /tmp otherwise. Submitted by: Dan McGregor Modified: head/usr.bin/mkimg/image.c head/usr.bin/mkimg/mkimg.1 Modified: head/usr.bin/mkimg/image.c ============================================================================== --- head/usr.bin/mkimg/image.c Thu May 22 19:36:29 2014 (r266555) +++ head/usr.bin/mkimg/image.c Thu May 22 20:24:30 2014 (r266556) @@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include #include @@ -38,7 +41,7 @@ __FBSDID("$FreeBSD$"); #define BUFFER_SIZE (1024*1024) -static char image_tmpfile[] = "/tmp/mkimg-XXXXXX"; +static char image_tmpfile[PATH_MAX]; static int image_fd = -1; static lba_t image_size; @@ -161,9 +164,14 @@ image_write(lba_t blk, void *buf, ssize_ int image_init(void) { + const char *tmpdir; if (atexit(cleanup) == -1) return (errno); + if ((tmpdir = getenv("TMPDIR")) == NULL || *tmpdir == '\0') + tmpdir = _PATH_TMP; + snprintf(image_tmpfile, sizeof(image_tmpfile), "%s/mkimg-XXXXXX", + tmpdir); image_fd = mkstemp(image_tmpfile); if (image_fd == -1) return (errno); Modified: head/usr.bin/mkimg/mkimg.1 ============================================================================== --- head/usr.bin/mkimg/mkimg.1 Thu May 22 19:36:29 2014 (r266555) +++ head/usr.bin/mkimg/mkimg.1 Thu May 22 20:24:30 2014 (r266556) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2014 +.Dd May 22, 2014 .Dt MKIMG 1 .Os .Sh NAME @@ -159,6 +159,11 @@ For partitioning schemes that feature pa utility supports assigning labels to the partitions specified. In the following example the file system partition is labeled as 'backup': .Dl % mkimg -s gpt -p freebsd-ufs/backup:=file-system.ufs -o gpt.img +.Sh ENVIRONMENT +.Bl -tag -width "TMPDIR" -compact +.It Ev TMPDIR +Directory to put temporary files in; default is +.Pa /tmp . .Sh SEE ALSO .Xr gpart 8 .Xr makefs 8 From owner-svn-src-head@FreeBSD.ORG Thu May 22 23:38:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB600F22; Thu, 22 May 2014 23:38:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F8EA273C; Thu, 22 May 2014 23:38:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4MNcHxW066695; Thu, 22 May 2014 23:38:17 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4MNcHYA066694; Thu, 22 May 2014 23:38:17 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405222338.s4MNcHYA066694@svn.freebsd.org> From: Ian Lepore Date: Thu, 22 May 2014 23:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266565 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2014 23:38:17 -0000 Author: ian Date: Thu May 22 23:38:17 2014 New Revision: 266565 URL: http://svnweb.freebsd.org/changeset/base/266565 Log: Map device memory using PTE_DEVICE attributes, and also ensure that the shared flag is set on normal-memory mappings made via pmap_kenter() for SMP. The "shared flag" part of this change isn't obvious from the diff, here's the deal... by using the array of preformatted page table entry templates instead of constructing the PTE from scratch, we automatically get the right attribute bits set for both caching and shared. MFC after: 1 week Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Thu May 22 23:18:17 2014 (r266564) +++ head/sys/arm/arm/pmap-v6.c Thu May 22 23:38:17 2014 (r266565) @@ -381,7 +381,8 @@ struct l2_dtable { /* pmap_kenter_internal flags */ #define KENTER_CACHE 0x1 -#define KENTER_USER 0x2 +#define KENTER_DEVICE 0x2 +#define KENTER_USER 0x4 /* * Given an L1 table index, calculate the corresponding l2_dtable index @@ -2401,12 +2402,17 @@ pmap_kenter_internal(vm_offset_t va, vm_ ptep = &l2b->l2b_kva[l2pte_index(va)]; opte = *ptep; + if (flags & KENTER_CACHE) + *ptep = L2_S_PROTO | l2s_mem_types[PTE_CACHE] | pa | L2_S_REF; + else if (flags & KENTER_DEVICE) + *ptep = L2_S_PROTO |l2s_mem_types[PTE_DEVICE] | pa | L2_S_REF; + else + *ptep =L2_S_PROTO | l2s_mem_types[PTE_NOCACHE] | pa | L2_S_REF; + if (flags & KENTER_CACHE) { - *ptep = L2_S_PROTO | pa | pte_l2_s_cache_mode | L2_S_REF; pmap_set_prot(ptep, VM_PROT_READ | VM_PROT_WRITE, flags & KENTER_USER); } else { - *ptep = L2_S_PROTO | pa | L2_S_REF; pmap_set_prot(ptep, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE, 0); } @@ -2444,11 +2450,7 @@ void pmap_kenter_device(vm_offset_t va, vm_paddr_t pa) { - /* - * XXX - Need a way for kenter_internal to handle PTE_DEVICE mapping as - * a potentially different thing than PTE_NOCACHE. - */ - pmap_kenter_internal(va, pa, 0); + pmap_kenter_internal(va, pa, KENTER_DEVICE); } void From owner-svn-src-head@FreeBSD.ORG Fri May 23 00:20:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95AEE59C; Fri, 23 May 2014 00:20:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83A1C2A20; Fri, 23 May 2014 00:20:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4N0Ki8E086860; Fri, 23 May 2014 00:20:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4N0KiLx086859; Fri, 23 May 2014 00:20:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405230020.s4N0KiLx086859@svn.freebsd.org> From: Warner Losh Date: Fri, 23 May 2014 00:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266566 - head/usr.bin/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 00:20:44 -0000 Author: imp Date: Fri May 23 00:20:44 2014 New Revision: 266566 URL: http://svnweb.freebsd.org/changeset/base/266566 Log: Add .../share/mk to the default system make path. This will fix the problem with broken in-tree builds (which are used far more pervasively than I'd known outside the tree). However, weird results may now happen if at any point in the tree above you there happens to be a directory that has subdirectory of share/mk, as unpredictable results will follow. This was considered the lessor of the two evils, at least for now. In the future this will be removed again when the underlying issues are resolved. Modified: head/usr.bin/bmake/Makefile Modified: head/usr.bin/bmake/Makefile ============================================================================== --- head/usr.bin/bmake/Makefile Thu May 22 23:38:17 2014 (r266565) +++ head/usr.bin/bmake/Makefile Fri May 23 00:20:44 2014 (r266566) @@ -166,7 +166,6 @@ accept test: # override some simple things BINDIR= /usr/bin MANDIR= /usr/share/man/man -DEFAULT_SYS_PATH= /usr/share/mk # make sure we get this CFLAGS+= ${COPTS.${.IMPSRC:T}} From owner-svn-src-head@FreeBSD.ORG Fri May 23 00:20:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18A206D2; Fri, 23 May 2014 00:20:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06D412A22; Fri, 23 May 2014 00:20:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4N0KmGZ086923; Fri, 23 May 2014 00:20:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4N0Kmbv086922; Fri, 23 May 2014 00:20:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405230020.s4N0Kmbv086922@svn.freebsd.org> From: Warner Losh Date: Fri, 23 May 2014 00:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266567 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 00:20:49 -0000 Author: imp Date: Fri May 23 00:20:48 2014 New Revision: 266567 URL: http://svnweb.freebsd.org/changeset/base/266567 Log: When libelf and libdwarf were updated, we didn't bump the minimal version needed for CTF tools, so sometimes we'd use the host's CTF tools that didn't work. Be sure to bootstrap in that case. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri May 23 00:20:44 2014 (r266566) +++ head/Makefile.inc1 Fri May 23 00:20:48 2014 (r266567) @@ -1238,9 +1238,8 @@ _clang_tblgen= \ .endif # dtrace tools are required for older bootstrap env and cross-build -.if ${MK_CDDL} != "no" && \ - ((${BOOTSTRAPPING} < 1000034 && \ - !(${BOOTSTRAPPING} >= 901505 && ${BOOTSTRAPPING} < 999999)) \ +# pre libdwarf +.if ${MK_CDDL} != "no" && (${BOOTSTRAPPING} < 1100006 \ || (${MACHINE} != ${TARGET} || ${MACHINE_ARCH} != ${TARGET_ARCH})) _dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge From owner-svn-src-head@FreeBSD.ORG Fri May 23 00:20:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACEA480C; Fri, 23 May 2014 00:20:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AD932A25; Fri, 23 May 2014 00:20:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4N0Krbg087414; Fri, 23 May 2014 00:20:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4N0KrZr087384; Fri, 23 May 2014 00:20:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405230020.s4N0KrZr087384@svn.freebsd.org> From: Warner Losh Date: Fri, 23 May 2014 00:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266568 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 00:20:53 -0000 Author: imp Date: Fri May 23 00:20:53 2014 New Revision: 266568 URL: http://svnweb.freebsd.org/changeset/base/266568 Log: Fix the comment. This really isn't just a 4.x compatibility thing, but is used pervasively through our tree, making it really part of the API. Modified: head/sys/sys/bus.h Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Fri May 23 00:20:48 2014 (r266567) +++ head/sys/sys/bus.h Fri May 23 00:20:53 2014 (r266568) @@ -122,8 +122,7 @@ typedef struct kobj_class driver_t; typedef struct devclass *devclass_t; /** - * @brief A device method (included mainly for compatibility with - * FreeBSD 4.x). + * @brief A device method */ #define device_method_t kobj_method_t From owner-svn-src-head@FreeBSD.ORG Fri May 23 00:20:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 478C4942; Fri, 23 May 2014 00:20:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CCBB2A29; Fri, 23 May 2014 00:20:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4N0Kvnh088765; Fri, 23 May 2014 00:20:57 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4N0KvK5088764; Fri, 23 May 2014 00:20:57 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405230020.s4N0KvK5088764@svn.freebsd.org> From: Warner Losh Date: Fri, 23 May 2014 00:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266569 - head/rescue/rescue X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 00:20:58 -0000 Author: imp Date: Fri May 23 00:20:57 2014 New Revision: 266569 URL: http://svnweb.freebsd.org/changeset/base/266569 Log: Minor style nits... Modified: head/rescue/rescue/Makefile Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Fri May 23 00:20:53 2014 (r266568) +++ head/rescue/rescue/Makefile Fri May 23 00:20:57 2014 (r266569) @@ -1,9 +1,9 @@ #$FreeBSD$ # @(#)Makefile 8.1 (Berkeley) 6/2/93 -MAN= - .include + +MAN= MK_SSP= no PROG= rescue From owner-svn-src-head@FreeBSD.ORG Fri May 23 00:21:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BEF0DA81; Fri, 23 May 2014 00:21:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD07D2A2D; Fri, 23 May 2014 00:21:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4N0L2t4088846; Fri, 23 May 2014 00:21:02 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4N0L2ko088845; Fri, 23 May 2014 00:21:02 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405230021.s4N0L2ko088845@svn.freebsd.org> From: Warner Losh Date: Fri, 23 May 2014 00:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266570 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 00:21:02 -0000 Author: imp Date: Fri May 23 00:21:02 2014 New Revision: 266570 URL: http://svnweb.freebsd.org/changeset/base/266570 Log: Remove NetBSD implementation details not relevant to FreeBSD. Modified: head/sys/arm/include/ucontext.h Modified: head/sys/arm/include/ucontext.h ============================================================================== --- head/sys/arm/include/ucontext.h Fri May 23 00:20:57 2014 (r266569) +++ head/sys/arm/include/ucontext.h Fri May 23 00:21:02 2014 (r266570) @@ -97,12 +97,4 @@ typedef struct { #define _UC_SETSTACK 0x00020000 #define _UC_CLRSTACK 0x00040000 -#define _UC_MACHINE_PAD 3 /* Padding appended to ucontext_t */ - -#define _UC_MACHINE_SP(uc) ((uc)->uc_mcontext.__gregs[_REG_SP]) -#define _UC_MACHINE_PC(uc) ((uc)->uc_mcontext.__gregs[_REG_PC]) -#define _UC_MACHINE_INTRV(uc) ((uc)->uc_mcontext.__gregs[_REG_R0]) - -#define _UC_MACHINE_SET_PC(uc, pc) _UC_MACHINE_PC(uc) = (pc) - #endif /* !_MACHINE_MCONTEXT_H_ */ From owner-svn-src-head@FreeBSD.ORG Fri May 23 01:45:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0A44D19; Fri, 23 May 2014 01:45:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E5082155; Fri, 23 May 2014 01:45:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4N1jiHU025772; Fri, 23 May 2014 01:45:44 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4N1jihM025771; Fri, 23 May 2014 01:45:44 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201405230145.s4N1jihM025771@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 23 May 2014 01:45:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266571 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 01:45:44 -0000 Author: np Date: Fri May 23 01:45:44 2014 New Revision: 266571 URL: http://svnweb.freebsd.org/changeset/base/266571 Log: cxgbe(4): Remove stray if_up from the code that creates the tracing ifnet. Modified: head/sys/dev/cxgbe/t4_tracer.c Modified: head/sys/dev/cxgbe/t4_tracer.c ============================================================================== --- head/sys/dev/cxgbe/t4_tracer.c Fri May 23 00:21:02 2014 (r266570) +++ head/sys/dev/cxgbe/t4_tracer.c Fri May 23 01:45:44 2014 (r266571) @@ -193,7 +193,6 @@ t4_cloner_create(struct if_clone *ifc, c ifmedia_add(&sc->media, IFM_ETHER | IFM_FDX | IFM_NONE, 0, NULL); ifmedia_set(&sc->media, IFM_ETHER | IFM_FDX | IFM_NONE); ether_ifattach(ifp, lla); - if_up(ifp); mtx_lock(&sc->ifp_lock); ifp->if_softc = sc; From owner-svn-src-head@FreeBSD.ORG Fri May 23 04:07:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DB63EA; Fri, 23 May 2014 04:07:08 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A4882CE5; Fri, 23 May 2014 04:07:07 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s4N46wNO049213 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 23 May 2014 08:06:58 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s4N46wXM049212; Fri, 23 May 2014 08:06:58 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 23 May 2014 08:06:58 +0400 From: Gleb Smirnoff To: Edward Tomasz Napierala Subject: Re: svn commit: r266544 - head/sys/dev/iwn Message-ID: <20140523040658.GG50679@FreeBSD.org> References: <201405221456.s4MEuYkb095774@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201405221456.s4MEuYkb095774@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 04:07:08 -0000 On Thu, May 22, 2014 at 02:56:34PM +0000, Edward Tomasz Napierala wrote: E> Author: trasz E> Date: Thu May 22 14:56:34 2014 E> New Revision: 266544 E> URL: http://svnweb.freebsd.org/changeset/base/266544 E> E> Log: E> Make iwn(4) able to get itself back into working condition after E> "fatal firmware error" happens. Previously it was neccessary to reset E> it manually, using "/etc/rc.d/netif restart". Do we really need a full kernel thread for that task? Why not to use taskqueue(9) task and post it to standard thread taskqueue? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri May 23 04:07:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D537236; Fri, 23 May 2014 04:07:50 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D99B82CEC; Fri, 23 May 2014 04:07:49 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s4N47lHY049231 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 23 May 2014 08:07:47 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s4N47lL8049230; Fri, 23 May 2014 08:07:47 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 23 May 2014 08:07:47 +0400 From: Gleb Smirnoff To: Edward Tomasz Napierala Subject: Re: svn commit: r266544 - head/sys/dev/iwn Message-ID: <20140523040747.GH50679@FreeBSD.org> References: <201405221456.s4MEuYkb095774@svn.freebsd.org> <20140523040658.GG50679@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140523040658.GG50679@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 04:07:50 -0000 On Fri, May 23, 2014 at 08:06:58AM +0400, Gleb Smirnoff wrote: T> On Thu, May 22, 2014 at 02:56:34PM +0000, Edward Tomasz Napierala wrote: T> E> Author: trasz T> E> Date: Thu May 22 14:56:34 2014 T> E> New Revision: 266544 T> E> URL: http://svnweb.freebsd.org/changeset/base/266544 T> E> T> E> Log: T> E> Make iwn(4) able to get itself back into working condition after T> E> "fatal firmware error" happens. Previously it was neccessary to reset T> E> it manually, using "/etc/rc.d/netif restart". T> T> Do we really need a full kernel thread for that task? T> T> Why not to use taskqueue(9) task and post it to standard thread taskqueue? Nice :) Your next commit does that :) -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri May 23 04:16:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9281605; Fri, 23 May 2014 04:16:32 +0000 (UTC) Received: from mail-qc0-x234.google.com (mail-qc0-x234.google.com [IPv6:2607:f8b0:400d:c01::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 273A82D9A; Fri, 23 May 2014 04:16:32 +0000 (UTC) Received: by mail-qc0-f180.google.com with SMTP id i17so7213335qcy.39 for ; Thu, 22 May 2014 21:16:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=0RweWvY4GDHZrwx8r7VN5DPGaNXJWTlujwccKq+xm6s=; b=UWke4S0NLhM3zawJoCSBAf6wAn3sy+KlUiHzx/AtE5TypA35wbyiImfhLNKImPiTf7 Jd4z7xiJRhBKbyeu42jFOTfmGR1UZz+bxNJqmSwq1Hyzq5kssHUNqupY+iCB0GAXSAfr j1z+kUftaBkkvXhQNUy/NzfsAulNkkaKFVOr7LGwZ+bBeiPUqbtGIxLsGdZvTjPoOasp 2KVPZQPTebTvVveqAPjAr4pNOgj8AqdVnXabEpToiLeXfdwvGrBdiz1K1TjJOhU1kQ1q cqjmWQGdf5z7453LNbZTUboWpB7ip5wzJwOnVrpXdAhgv9PooegVYCGXFZg2XhRCISgX 09Hw== MIME-Version: 1.0 X-Received: by 10.140.96.51 with SMTP id j48mr2882652qge.24.1400818591316; Thu, 22 May 2014 21:16:31 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.191.201 with HTTP; Thu, 22 May 2014 21:16:31 -0700 (PDT) In-Reply-To: <20140523040747.GH50679@FreeBSD.org> References: <201405221456.s4MEuYkb095774@svn.freebsd.org> <20140523040658.GG50679@FreeBSD.org> <20140523040747.GH50679@FreeBSD.org> Date: Thu, 22 May 2014 21:16:31 -0700 X-Google-Sender-Auth: pLQ9DV27hgKxdUqvugb7m5Rays8 Message-ID: Subject: Re: svn commit: r266544 - head/sys/dev/iwn From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Edward Tomasz Napierala X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 04:16:32 -0000 On 22 May 2014 21:07, Gleb Smirnoff wrote: > On Fri, May 23, 2014 at 08:06:58AM +0400, Gleb Smirnoff wrote: > T> On Thu, May 22, 2014 at 02:56:34PM +0000, Edward Tomasz Napierala wrote: > T> E> Author: trasz > T> E> Date: Thu May 22 14:56:34 2014 > T> E> New Revision: 266544 > T> E> URL: http://svnweb.freebsd.org/changeset/base/266544 > T> E> > T> E> Log: > T> E> Make iwn(4) able to get itself back into working condition after > T> E> "fatal firmware error" happens. Previously it was neccessary to reset > T> E> it manually, using "/etc/rc.d/netif restart". > T> > T> Do we really need a full kernel thread for that task? > T> > T> Why not to use taskqueue(9) task and post it to standard thread taskqueue? > > Nice :) Your next commit does that :) Yup. I asked him to do that. He just committed the wrong revision. :) -a From owner-svn-src-head@FreeBSD.ORG Fri May 23 05:04:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B47D8C1D; Fri, 23 May 2014 05:04:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 938AE2116; Fri, 23 May 2014 05:04:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4N54oYK014931; Fri, 23 May 2014 05:04:50 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4N54omh014930; Fri, 23 May 2014 05:04:50 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405230504.s4N54omh014930@svn.freebsd.org> From: Neel Natu Date: Fri, 23 May 2014 05:04:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266572 - head/sys/amd64/vmm/io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 05:04:50 -0000 Author: neel Date: Fri May 23 05:04:50 2014 New Revision: 266572 URL: http://svnweb.freebsd.org/changeset/base/266572 Log: A Centos 6.4 guest will write 0xff to the 8259 mask register before beginning the proper ICWx initialization sequence. It assumes, probably correctly, that the boot firmware has done the 8259 initialization. Since grub-bhyve does not initialize the 8259 this write to the mask register takes a code path in which 'error' remains uninitialized (ready=0,icw_num=0). Fix this by initializing 'error' at the start of the function. Modified: head/sys/amd64/vmm/io/vatpic.c Modified: head/sys/amd64/vmm/io/vatpic.c ============================================================================== --- head/sys/amd64/vmm/io/vatpic.c Fri May 23 01:45:44 2014 (r266571) +++ head/sys/amd64/vmm/io/vatpic.c Fri May 23 05:04:50 2014 (r266572) @@ -591,6 +591,7 @@ vatpic_write(struct vatpic *vatpic, stru int error; uint8_t val; + error = 0; val = *eax; VATPIC_LOCK(vatpic); From owner-svn-src-head@FreeBSD.ORG Fri May 23 05:15:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4FC2EE89; Fri, 23 May 2014 05:15:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2446121CC; Fri, 23 May 2014 05:15:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4N5FKdj019699; Fri, 23 May 2014 05:15:20 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4N5FHoE019681; Fri, 23 May 2014 05:15:17 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405230515.s4N5FHoE019681@svn.freebsd.org> From: Neel Natu Date: Fri, 23 May 2014 05:15:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266573 - in head: sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 05:15:20 -0000 Author: neel Date: Fri May 23 05:15:17 2014 New Revision: 266573 URL: http://svnweb.freebsd.org/changeset/base/266573 Log: Add emulation of the "outsb" instruction. NetBSD guests use this to write to the UART FIFO. The emulation is constrained in a number of ways: 64-bit only, doesn't check for all exception conditions, limited to i/o ports emulated in userspace. Some of these constraints will be relaxed in followup commits. Requested by: grehan Reviewed by: tychon (partially and a much earlier version) Modified: head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_instruction_emul.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_instruction_emul.c head/sys/amd64/vmm/vmm_ioport.c head/sys/amd64/vmm/vmm_ioport.h head/sys/amd64/vmm/vmm_ktr.h head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/inout.c head/usr.sbin/bhyve/inout.h Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Fri May 23 05:04:50 2014 (r266572) +++ head/sys/amd64/include/vmm.h Fri May 23 05:15:17 2014 (r266573) @@ -54,6 +54,7 @@ struct vmspace; struct vm_object; struct pmap; +enum vm_reg_name; enum x2apic_state; typedef int (*vmm_init_func_t)(int ipinum); @@ -238,6 +239,8 @@ void vm_inject_gp(struct vm *vm, int vcp void vm_inject_ud(struct vm *vm, int vcpuid); /* undefined instruction fault */ void vm_inject_pf(struct vm *vm, int vcpuid, int error_code); /* page fault */ +enum vm_reg_name vm_segment_name(int seg_encoding); + #endif /* KERNEL */ #include @@ -336,22 +339,43 @@ enum vm_exitcode { VM_EXITCODE_RENDEZVOUS, VM_EXITCODE_IOAPIC_EOI, VM_EXITCODE_SUSPENDED, + VM_EXITCODE_INOUT_STR, VM_EXITCODE_MAX }; +struct vm_inout { + uint16_t bytes:3; /* 1 or 2 or 4 */ + uint16_t in:1; + uint16_t string:1; + uint16_t rep:1; + uint16_t port; + uint32_t eax; /* valid for out */ +}; + +struct vm_inout_str { + struct vm_inout inout; /* must be the first element */ + enum vie_cpu_mode cpu_mode; + enum vie_paging_mode paging_mode; + uint64_t rflags; + uint64_t cr0; + uint64_t cr3; + uint64_t index; + uint64_t count; /* rep=1 (%rcx), rep=0 (1) */ + int cpl; + int addrsize; + enum vm_reg_name seg_name; + struct seg_desc seg_desc; + uint64_t gla; /* may be set to VIE_INVALID_GLA */ + uint64_t gpa; +}; + struct vm_exit { enum vm_exitcode exitcode; int inst_length; /* 0 means unknown */ uint64_t rip; union { - struct { - uint16_t bytes:3; /* 1 or 2 or 4 */ - uint16_t in:1; /* out is 0, in is 1 */ - uint16_t string:1; - uint16_t rep:1; - uint16_t port; - uint32_t eax; /* valid for out */ - } inout; + struct vm_inout inout; + struct vm_inout_str inout_str; struct { uint64_t gpa; int fault_type; Modified: head/sys/amd64/include/vmm_instruction_emul.h ============================================================================== --- head/sys/amd64/include/vmm_instruction_emul.h Fri May 23 05:04:50 2014 (r266572) +++ head/sys/amd64/include/vmm_instruction_emul.h Fri May 23 05:15:17 2014 (r266573) @@ -29,6 +29,8 @@ #ifndef _VMM_INSTRUCTION_EMUL_H_ #define _VMM_INSTRUCTION_EMUL_H_ +enum vm_reg_name; + enum vie_cpu_mode { CPU_MODE_COMPATIBILITY, /* IA-32E mode (CS.L = 0) */ CPU_MODE_64BIT, /* IA-32E mode (CS.L = 1) */ @@ -111,6 +113,9 @@ int vmm_emulate_instruction(void *vm, in mem_region_read_t mrr, mem_region_write_t mrw, void *mrarg); +int vie_update_register(void *vm, int vcpuid, enum vm_reg_name reg, + uint64_t val, int size); + #ifdef _KERNEL /* * APIs to fetch and decode the instruction from nested page fault handler. @@ -134,6 +139,11 @@ int vmm_gla2gpa(struct vm *vm, int vcpui void vie_init(struct vie *vie); +uint64_t vie_size2mask(int size); + +uint64_t vie_segbase(enum vm_reg_name segment, enum vie_cpu_mode cpu_mode, + const struct seg_desc *desc); + /* * Decode the instruction fetched into 'vie' so it can be emulated. * Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Fri May 23 05:04:50 2014 (r266572) +++ head/sys/amd64/vmm/intel/vmx.c Fri May 23 05:15:17 2014 (r266573) @@ -185,6 +185,8 @@ SYSCTL_UINT(_hw_vmm_vmx, OID_AUTO, vpid_ */ #define APIC_ACCESS_ADDRESS 0xFFFFF000 +static int vmx_getdesc(void *arg, int vcpu, int reg, struct seg_desc *desc); +static int vmx_getreg(void *arg, int vcpu, int reg, uint64_t *retval); static void vmx_inject_pir(struct vlapic *vlapic); #ifdef KTR @@ -530,7 +532,7 @@ static int vmx_init(int ipinum) { int error, use_tpr_shadow; - uint64_t fixed0, fixed1, feature_control; + uint64_t basic, fixed0, fixed1, feature_control; uint32_t tmp, procbased2_vid_bits; /* CPUID.1:ECX[bit 5] must be 1 for processor to support VMX */ @@ -550,6 +552,17 @@ vmx_init(int ipinum) return (ENXIO); } + /* + * Verify capabilities MSR_VMX_BASIC: + * - bit 54 indicates support for INS/OUTS decoding + */ + basic = rdmsr(MSR_VMX_BASIC); + if ((basic & (1UL << 54)) == 0) { + printf("vmx_init: processor does not support desired basic " + "capabilities\n"); + return (EINVAL); + } + /* Check support for primary processor-based VM-execution controls */ error = vmx_set_ctlreg(MSR_VMX_PROCBASED_CTLS, MSR_VMX_TRUE_PROCBASED_CTLS, @@ -1528,6 +1541,71 @@ vmx_paging_mode(void) return (PAGING_MODE_PAE); } +static uint64_t +inout_str_index(struct vmx *vmx, int vcpuid, int in) +{ + uint64_t val; + int error; + enum vm_reg_name reg; + + reg = in ? VM_REG_GUEST_RDI : VM_REG_GUEST_RSI; + error = vmx_getreg(vmx, vcpuid, reg, &val); + KASSERT(error == 0, ("%s: vmx_getreg error %d", __func__, error)); + return (val); +} + +static uint64_t +inout_str_count(struct vmx *vmx, int vcpuid, int rep) +{ + uint64_t val; + int error; + + if (rep) { + error = vmx_getreg(vmx, vcpuid, VM_REG_GUEST_RCX, &val); + KASSERT(!error, ("%s: vmx_getreg error %d", __func__, error)); + } else { + val = 1; + } + return (val); +} + +static int +inout_str_addrsize(uint32_t inst_info) +{ + uint32_t size; + + size = (inst_info >> 7) & 0x7; + switch (size) { + case 0: + return (2); /* 16 bit */ + case 1: + return (4); /* 32 bit */ + case 2: + return (8); /* 64 bit */ + default: + panic("%s: invalid size encoding %d", __func__, size); + } +} + +static void +inout_str_seginfo(struct vmx *vmx, int vcpuid, uint32_t inst_info, int in, + struct vm_inout_str *vis) +{ + int error, s; + + if (in) { + vis->seg_name = VM_REG_GUEST_ES; + } else { + s = (inst_info >> 15) & 0x7; + vis->seg_name = vm_segment_name(s); + } + + error = vmx_getdesc(vmx, vcpuid, vis->seg_name, &vis->seg_desc); + KASSERT(error == 0, ("%s: vmx_getdesc error %d", __func__, error)); + + /* XXX modify svm.c to update bit 16 of seg_desc.access (unusable) */ +} + static void vmexit_inst_emul(struct vm_exit *vmexit, uint64_t gpa, uint64_t gla) { @@ -1749,10 +1827,12 @@ vmx_handle_apic_access(struct vmx *vmx, static int vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) { - int error, handled; + int error, handled, in; struct vmxctx *vmxctx; struct vlapic *vlapic; - uint32_t eax, ecx, edx, idtvec_info, idtvec_err, intr_info, reason; + struct vm_inout_str *vis; + uint32_t eax, ecx, edx, idtvec_info, idtvec_err, intr_info, inst_info; + uint32_t reason; uint64_t qual, gpa; bool retu; @@ -1909,15 +1989,26 @@ vmx_exit_process(struct vmx *vmx, int vc vmm_stat_incr(vmx->vm, vcpu, VMEXIT_INOUT, 1); vmexit->exitcode = VM_EXITCODE_INOUT; vmexit->u.inout.bytes = (qual & 0x7) + 1; - vmexit->u.inout.in = (qual & 0x8) ? 1 : 0; + vmexit->u.inout.in = in = (qual & 0x8) ? 1 : 0; vmexit->u.inout.string = (qual & 0x10) ? 1 : 0; vmexit->u.inout.rep = (qual & 0x20) ? 1 : 0; vmexit->u.inout.port = (uint16_t)(qual >> 16); vmexit->u.inout.eax = (uint32_t)(vmxctx->guest_rax); - error = emulate_ioport(vmx->vm, vcpu, vmexit); - if (error == 0) { - handled = 1; - vmxctx->guest_rax = vmexit->u.inout.eax; + if (vmexit->u.inout.string) { + inst_info = vmcs_read(VMCS_EXIT_INSTRUCTION_INFO); + vmexit->exitcode = VM_EXITCODE_INOUT_STR; + vis = &vmexit->u.inout_str; + vis->cpu_mode = vmx_cpu_mode(); + vis->paging_mode = vmx_paging_mode(); + vis->rflags = vmcs_read(VMCS_GUEST_RFLAGS); + vis->cr0 = vmcs_read(VMCS_GUEST_CR0); + vis->cr3 = vmcs_read(VMCS_GUEST_CR3); + vis->cpl = vmx_cpl(); + vis->index = inout_str_index(vmx, vcpu, in); + vis->count = inout_str_count(vmx, vcpu, vis->inout.rep); + vis->addrsize = inout_str_addrsize(inst_info); + inout_str_seginfo(vmx, vcpu, inst_info, in, vis); + vis->gla = vmcs_gla(); } break; case EXIT_REASON_CPUID: Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Fri May 23 05:04:50 2014 (r266572) +++ head/sys/amd64/vmm/vmm.c Fri May 23 05:15:17 2014 (r266573) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "vmm_ioport.h" #include "vmm_ktr.h" #include "vmm_host.h" #include "vmm_mem.h" @@ -1354,6 +1355,10 @@ restart: case VM_EXITCODE_INST_EMUL: error = vm_handle_inst_emul(vm, vcpuid, &retu); break; + case VM_EXITCODE_INOUT: + case VM_EXITCODE_INOUT_STR: + error = vm_handle_inout(vm, vcpuid, vme, &retu); + break; default: retu = true; /* handled in userland */ break; @@ -1874,3 +1879,20 @@ vm_atpit(struct vm *vm) { return (vm->vatpit); } + +enum vm_reg_name +vm_segment_name(int seg) +{ + static enum vm_reg_name seg_names[] = { + VM_REG_GUEST_ES, + VM_REG_GUEST_CS, + VM_REG_GUEST_SS, + VM_REG_GUEST_DS, + VM_REG_GUEST_FS, + VM_REG_GUEST_GS + }; + + KASSERT(seg >= 0 && seg < nitems(seg_names), + ("%s: invalid segment encoding %d", __func__, seg)); + return (seg_names[seg]); +} Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Fri May 23 05:04:50 2014 (r266572) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Fri May 23 05:15:17 2014 (r266573) @@ -206,7 +206,7 @@ vie_read_bytereg(void *vm, int vcpuid, s return (error); } -static int +int vie_update_register(void *vm, int vcpuid, enum vm_reg_name reg, uint64_t val, int size) { @@ -1218,4 +1218,50 @@ vmm_decode_instruction(struct vm *vm, in return (0); } + +uint64_t +vie_size2mask(int size) +{ + KASSERT(size == 1 || size == 2 || size == 4 || size == 8, + ("vie_size2mask: invalid size %d", size)); + return (size2mask[size]); +} + +uint64_t +vie_segbase(enum vm_reg_name seg, enum vie_cpu_mode cpu_mode, + const struct seg_desc *desc) +{ + int basesize; + + basesize = 4; /* default segment width in bytes */ + + switch (seg) { + case VM_REG_GUEST_ES: + case VM_REG_GUEST_CS: + case VM_REG_GUEST_SS: + case VM_REG_GUEST_DS: + if (cpu_mode == CPU_MODE_64BIT) { + /* + * Segments having an implicit base address of 0 + * in 64-bit mode. + */ + return (0); + } + break; + case VM_REG_GUEST_FS: + case VM_REG_GUEST_GS: + if (cpu_mode == CPU_MODE_64BIT) { + /* + * In 64-bit mode the FS and GS base address is 8 bytes + * wide. + */ + basesize = 8; + } + break; + default: + panic("%s: invalid segment register %d", __func__, seg); + } + + return (desc->base & size2mask[basesize]); +} #endif /* _KERNEL */ Modified: head/sys/amd64/vmm/vmm_ioport.c ============================================================================== --- head/sys/amd64/vmm/vmm_ioport.c Fri May 23 05:04:50 2014 (r266572) +++ head/sys/amd64/vmm/vmm_ioport.c Fri May 23 05:15:17 2014 (r266573) @@ -33,11 +33,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include +#include #include "vatpic.h" #include "vatpit.h" #include "vmm_ioport.h" +#include "vmm_ktr.h" #define MAX_IOPORTS 1280 @@ -55,32 +59,64 @@ ioport_handler_func_t ioport_handler[MAX [IO_ELCR2] = vatpic_elc_handler, }; -int -emulate_ioport(struct vm *vm, int vcpuid, struct vm_exit *vmexit) +#ifdef KTR +static const char * +inout_instruction(struct vm_exit *vmexit) { - ioport_handler_func_t handler; - uint32_t mask, val; - int error; + int index; - if (vmexit->u.inout.port >= MAX_IOPORTS) - return (-1); - - handler = ioport_handler[vmexit->u.inout.port]; - if (handler == NULL) - return (-1); + static const char *iodesc[] = { + "outb", "outw", "outl", + "inb", "inw", "inl", + "outsb", "outsw", "outsd" + "insb", "insw", "insd", + }; switch (vmexit->u.inout.bytes) { case 1: - mask = 0xff; + index = 0; break; case 2: - mask = 0xffff; + index = 1; break; default: - mask = 0xffffffff; + index = 2; break; } + if (vmexit->u.inout.in) + index += 3; + + if (vmexit->u.inout.string) + index += 6; + + KASSERT(index < nitems(iodesc), ("%s: invalid index %d", + __func__, index)); + + return (iodesc[index]); +} +#endif /* KTR */ + +static int +emulate_inout_port(struct vm *vm, int vcpuid, struct vm_exit *vmexit, + bool *retu) +{ + ioport_handler_func_t handler; + uint32_t mask, val; + int error; + + error = 0; + *retu = true; + + if (vmexit->u.inout.port >= MAX_IOPORTS) + goto done; + + handler = ioport_handler[vmexit->u.inout.port]; + if (handler == NULL) + goto done; + + mask = vie_size2mask(vmexit->u.inout.bytes); + if (!vmexit->u.inout.in) { val = vmexit->u.inout.eax & mask; } @@ -88,10 +124,121 @@ emulate_ioport(struct vm *vm, int vcpuid error = (*handler)(vm, vcpuid, vmexit->u.inout.in, vmexit->u.inout.port, vmexit->u.inout.bytes, &val); - if (!error && vmexit->u.inout.in) { - vmexit->u.inout.eax &= ~mask; - vmexit->u.inout.eax |= val & mask; + if (!error) { + *retu = false; + if (vmexit->u.inout.in) { + vmexit->u.inout.eax &= ~mask; + vmexit->u.inout.eax |= val & mask; + error = vm_set_register(vm, vcpuid, + VM_REG_GUEST_RAX, vmexit->u.inout.eax); + KASSERT(error == 0, ("emulate_ioport: error %d " + "setting guest rax register", error)); + } + } +done: + return (error); +} + +static int +emulate_inout_str(struct vm *vm, int vcpuid, struct vm_exit *vmexit, bool *retu) +{ + struct vm_inout_str *vis; + uint64_t gla, index, segbase; + int bytes, error, in; + + vis = &vmexit->u.inout_str; + in = vis->inout.in; + + /* + * ins/outs VM exit takes precedence over the following error + * conditions that would ordinarily be checked by the processor: + * + * - #GP(0) due to segment being unusable. + * - #GP(0) due to memory operand effective address outside the limit + * of the segment. + * - #AC(0) if alignment checking is enabled and an unaligned memory + * reference is made at CPL=3 + */ + + /* + * XXX + * inout string emulation only supported in 64-bit mode and only + * for byte instructions. + * + * The #GP(0) fault conditions described above don't apply in + * 64-bit mode. + * + * The #AC(0) fault condition described above does not apply + * because byte accesses don't have alignment constraints. + */ + if (vis->cpu_mode != CPU_MODE_64BIT) { + VCPU_CTR1(vm, vcpuid, "ins/outs not emulated in cpu mode %d", + vis->cpu_mode); + return (EINVAL); + } + + bytes = vis->inout.bytes; + if (bytes != 1) { + VCPU_CTR1(vm, vcpuid, "ins/outs operand size %d not supported", + bytes); + return (EINVAL); } + /* + * XXX insb/insw/insd instructions not emulated at this time. + */ + if (in) { + VCPU_CTR0(vm, vcpuid, "ins emulation not implemented"); + return (EINVAL); + } + + segbase = vie_segbase(vis->seg_name, vis->cpu_mode, &vis->seg_desc); + index = vis->index & vie_size2mask(vis->addrsize); + gla = segbase + index; + + /* + * Verify that the computed linear address matches with the one + * provided by hardware. + */ + if (vis->gla != VIE_INVALID_GLA) { + KASSERT(gla == vis->gla, ("%s: gla mismatch " + "%#lx/%#lx", __func__, gla, vis->gla)); + } + vis->gla = gla; + + error = vmm_gla2gpa(vm, vcpuid, gla, vis->cr3, &vis->gpa, + vis->paging_mode, vis->cpl, in ? VM_PROT_WRITE : VM_PROT_READ); + KASSERT(error == 0 || error == 1 || error == -1, + ("%s: vmm_gla2gpa unexpected error %d", __func__, error)); + if (error == -1) { + return (EFAULT); + } else if (error == 1) { + return (0); /* Resume guest to handle page fault */ + } else { + *retu = true; + return (0); /* Return to userspace to finish emulation */ + } +} + +int +vm_handle_inout(struct vm *vm, int vcpuid, struct vm_exit *vmexit, bool *retu) +{ + int bytes, error; + + bytes = vmexit->u.inout.bytes; + KASSERT(bytes == 1 || bytes == 2 || bytes == 4, + ("vm_handle_inout: invalid operand size %d", bytes)); + + if (vmexit->u.inout.string) + error = emulate_inout_str(vm, vcpuid, vmexit, retu); + else + error = emulate_inout_port(vm, vcpuid, vmexit, retu); + + VCPU_CTR4(vm, vcpuid, "%s%s 0x%04x: %s", + vmexit->u.inout.rep ? "rep " : "", + inout_instruction(vmexit), + vmexit->u.inout.port, + error ? "error" : (*retu ? "userspace" : "handled")); + return (error); } Modified: head/sys/amd64/vmm/vmm_ioport.h ============================================================================== --- head/sys/amd64/vmm/vmm_ioport.h Fri May 23 05:04:50 2014 (r266572) +++ head/sys/amd64/vmm/vmm_ioport.h Fri May 23 05:15:17 2014 (r266573) @@ -32,6 +32,6 @@ typedef int (*ioport_handler_func_t)(void *vm, int vcpuid, bool in, int port, int bytes, uint32_t *val); -int emulate_ioport(struct vm *vm, int vcpuid, struct vm_exit *vmexit); +int vm_handle_inout(struct vm *vm, int vcpuid, struct vm_exit *vme, bool *retu); #endif /* _VMM_IOPORT_H_ */ Modified: head/sys/amd64/vmm/vmm_ktr.h ============================================================================== --- head/sys/amd64/vmm/vmm_ktr.h Fri May 23 05:04:50 2014 (r266572) +++ head/sys/amd64/vmm/vmm_ktr.h Fri May 23 05:15:17 2014 (r266573) @@ -48,6 +48,10 @@ CTR4(KTR_VMM, "vm %s[%d]: " format, vm_n #define VCPU_CTR3(vm, vcpuid, format, p1, p2, p3) \ CTR5(KTR_VMM, "vm %s[%d]: " format, vm_name((vm)), (vcpuid), (p1), (p2), (p3)) +#define VCPU_CTR4(vm, vcpuid, format, p1, p2, p3, p4) \ +CTR6(KTR_VMM, "vm %s[%d]: " format, vm_name((vm)), (vcpuid), \ + (p1), (p2), (p3), (p4)) + #define VM_CTR0(vm, format) \ CTR1(KTR_VMM, "vm %s: " format, vm_name((vm))) Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Fri May 23 05:04:50 2014 (r266572) +++ head/usr.sbin/bhyve/bhyverun.c Fri May 23 05:15:17 2014 (r266573) @@ -288,33 +288,34 @@ static int vmexit_inout(struct vmctx *ctx, struct vm_exit *vme, int *pvcpu) { int error; - int bytes, port, in, out; - uint32_t eax; + int bytes, port, in, out, string; int vcpu; vcpu = *pvcpu; port = vme->u.inout.port; bytes = vme->u.inout.bytes; - eax = vme->u.inout.eax; + string = vme->u.inout.string; in = vme->u.inout.in; out = !in; - /* We don't deal with these */ - if (vme->u.inout.string || vme->u.inout.rep) - return (VMEXIT_ABORT); - /* Extra-special case of host notifications */ - if (out && port == GUEST_NIO_PORT) - return (vmexit_handle_notify(ctx, vme, pvcpu, eax)); + if (out && port == GUEST_NIO_PORT) { + error = vmexit_handle_notify(ctx, vme, pvcpu, vme->u.inout.eax); + return (error); + } - error = emulate_inout(ctx, vcpu, in, port, bytes, &eax, strictio); - if (error == INOUT_OK && in) - error = vm_set_register(ctx, vcpu, VM_REG_GUEST_RAX, eax); + error = emulate_inout(ctx, vcpu, vme, strictio); + if (error == INOUT_OK && in && !string) { + error = vm_set_register(ctx, vcpu, VM_REG_GUEST_RAX, + vme->u.inout.eax); + } switch (error) { case INOUT_OK: return (VMEXIT_CONTINUE); + case INOUT_RESTART: + return (VMEXIT_RESTART); case INOUT_RESET: stats.io_reset++; return (VMEXIT_RESET); @@ -514,6 +515,7 @@ vmexit_suspend(struct vmctx *ctx, struct static vmexit_handler_t handler[VM_EXITCODE_MAX] = { [VM_EXITCODE_INOUT] = vmexit_inout, + [VM_EXITCODE_INOUT_STR] = vmexit_inout, [VM_EXITCODE_VMX] = vmexit_vmx, [VM_EXITCODE_BOGUS] = vmexit_bogus, [VM_EXITCODE_RDMSR] = vmexit_rdmsr, Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Fri May 23 05:04:50 2014 (r266572) +++ head/usr.sbin/bhyve/inout.c Fri May 23 05:15:17 2014 (r266573) @@ -32,10 +32,16 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include +#include + #include #include #include +#include "bhyverun.h" #include "inout.h" SET_DECLARE(inout_port_set, struct inout_port); @@ -91,52 +97,127 @@ register_default_iohandler(int start, in } int -emulate_inout(struct vmctx *ctx, int vcpu, int in, int port, int bytes, - uint32_t *eax, int strict) +emulate_inout(struct vmctx *ctx, int vcpu, struct vm_exit *vmexit, int strict) { - int flags; - uint32_t mask, val; + int addrsize, bytes, flags, in, port, rep; + uint64_t gpa, gpaend; + uint32_t val; inout_func_t handler; void *arg; - int error; + char *gva; + int error, retval; + enum vm_reg_name idxreg; + uint64_t index, count; + struct vm_inout_str *vis; + + static uint64_t size2mask[] = { + [1] = 0xff, + [2] = 0xffff, + [4] = 0xffffffff, + [8] = 0xffffffffffffffff, + }; + + bytes = vmexit->u.inout.bytes; + in = vmexit->u.inout.in; + port = vmexit->u.inout.port; assert(port < MAX_IOPORTS); + assert(bytes == 1 || bytes == 2 || bytes == 4); handler = inout_handlers[port].handler; if (strict && handler == default_inout) return (-1); - switch (bytes) { - case 1: - mask = 0xff; - break; - case 2: - mask = 0xffff; - break; - default: - mask = 0xffffffff; - break; - } - - if (!in) { - val = *eax & mask; - } - flags = inout_handlers[port].flags; arg = inout_handlers[port].arg; - if ((in && (flags & IOPORT_F_IN)) || (!in && (flags & IOPORT_F_OUT))) - error = (*handler)(ctx, vcpu, in, port, bytes, &val, arg); - else - error = -1; - - if (!error && in) { - *eax &= ~mask; - *eax |= val & mask; - } + if (in) { + if (!(flags & IOPORT_F_IN)) + return (-1); + } else { + if (!(flags & IOPORT_F_OUT)) + return (-1); + } + + retval = 0; + if (vmexit->u.inout.string) { + vis = &vmexit->u.inout_str; + rep = vis->inout.rep; + addrsize = vis->addrsize; + assert(addrsize == 2 || addrsize == 4 || addrsize == 8); + + /* Index register */ + idxreg = in ? VM_REG_GUEST_RDI : VM_REG_GUEST_RSI; + index = vis->index & size2mask[addrsize]; + + /* Count register */ + count = vis->count & size2mask[addrsize]; + + gpa = vis->gpa; + gpaend = rounddown(gpa + PAGE_SIZE, PAGE_SIZE); + gva = paddr_guest2host(ctx, gpa, gpaend - gpa); + + while (count != 0 && gpa < gpaend) { + /* + * XXX this may not work for unaligned accesses because + * the last access on the page may spill over into the + * adjacent page in the linear address space. This is a + * problem because we don't have a gla2gpa() mapping of + * this adjacent page. + */ + assert(gpaend - gpa >= bytes); + + val = 0; + if (!in) + bcopy(gva, &val, bytes); + + retval = handler(ctx, vcpu, in, port, bytes, &val, arg); + if (retval != 0) + break; + + if (in) + bcopy(&val, gva, bytes); + + /* Update index */ + if (vis->rflags & PSL_D) + index -= bytes; + else + index += bytes; + + count--; + gva += bytes; + gpa += bytes; + } + + /* Update index register */ + error = vie_update_register(ctx, vcpu, idxreg, index, addrsize); + assert(error == 0); + + /* + * Update count register only if the instruction had a repeat + * prefix. + */ + if (rep) { + error = vie_update_register(ctx, vcpu, VM_REG_GUEST_RCX, + count, addrsize); + assert(error == 0); + } - return (error); + /* Restart the instruction if more iterations remain */ + if (retval == INOUT_OK && count != 0) + retval = INOUT_RESTART; + } else { + if (!in) { + val = vmexit->u.inout.eax & size2mask[bytes]; + } + retval = handler(ctx, vcpu, in, port, bytes, &val, arg); + if (retval == 0 && in) { + vmexit->u.inout.eax &= ~size2mask[bytes]; + vmexit->u.inout.eax |= val & size2mask[bytes]; + } + } + return (retval); } void Modified: head/usr.sbin/bhyve/inout.h ============================================================================== --- head/usr.sbin/bhyve/inout.h Fri May 23 05:04:50 2014 (r266572) +++ head/usr.sbin/bhyve/inout.h Fri May 23 05:15:17 2014 (r266573) @@ -32,12 +32,14 @@ #include struct vmctx; +struct vm_exit; /* Handler return values. */ #define INOUT_ERROR -1 #define INOUT_OK 0 -#define INOUT_RESET 1 -#define INOUT_POWEROFF 2 +#define INOUT_RESTART 1 +#define INOUT_RESET 2 +#define INOUT_POWEROFF 3 typedef int (*inout_func_t)(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg); @@ -72,8 +74,8 @@ struct inout_port { DATA_SET(inout_port_set, __CONCAT(__inout_port, __LINE__)) void init_inout(void); -int emulate_inout(struct vmctx *, int vcpu, int in, int port, int bytes, - uint32_t *eax, int strict); +int emulate_inout(struct vmctx *, int vcpu, struct vm_exit *vmexit, + int strict); int register_inout(struct inout_port *iop); int unregister_inout(struct inout_port *iop); void init_bvmcons(void); From owner-svn-src-head@FreeBSD.ORG Fri May 23 08:10:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33B6AECA; Fri, 23 May 2014 08:10:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 217FB2F87; Fri, 23 May 2014 08:10:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4N8A8as095660; Fri, 23 May 2014 08:10:08 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4N8A77p095659; Fri, 23 May 2014 08:10:07 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201405230810.s4N8A77p095659@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 23 May 2014 08:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266579 - head/release/picobsd/build X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 08:10:08 -0000 Author: luigi Date: Fri May 23 08:10:07 2014 New Revision: 266579 URL: http://svnweb.freebsd.org/changeset/base/266579 Log: add libraries to the initial build for picobsd. add a -j option so we can tune the amount of parallel make, the default we used (-j 8) is large and was giving problems with SUBDIR_PARALLEL due to some missing dependencies. Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Fri May 23 06:47:47 2014 (r266578) +++ head/release/picobsd/build/picobsd Fri May 23 08:10:07 2014 (r266579) @@ -177,7 +177,7 @@ create_includes_and_libraries2() { # opt cd $1 ; ${BINMAKE} ${o_par} $2 # specific target, e.g. ld-elf.so else export MAKEOBJDIRPREFIX=${l_objtree} - make ${o_par} $no toolchain + make ${o_par} $no toolchain libraries # XXX do we need any of these ? eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V WMAKEENV` [ ${o_arch} != `uname -m` ] && \ @@ -1055,8 +1055,13 @@ set_defaults while [ true ]; do log "Parsing $1" case $1 in + -j) + o_par="-j $2" + shift + ;; + --par) - o_par="-j 8" + o_par="-j 8" # watch out, this might be too large ;; --src) # set the source path instead of /usr/src From owner-svn-src-head@FreeBSD.ORG Fri May 23 08:34:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16F48541; Fri, 23 May 2014 08:34:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC3FB21C3; Fri, 23 May 2014 08:34:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4N8YU5e008208; Fri, 23 May 2014 08:34:30 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4N8YUee008207; Fri, 23 May 2014 08:34:30 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201405230834.s4N8YUee008207@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 23 May 2014 08:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266580 - head/release/picobsd/build X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 08:34:31 -0000 Author: luigi Date: Fri May 23 08:34:30 2014 New Revision: 266580 URL: http://svnweb.freebsd.org/changeset/base/266580 Log: remove unused code (building older releases should use the picobsd file in the release itself) Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Fri May 23 08:10:07 2014 (r266579) +++ head/release/picobsd/build/picobsd Fri May 23 08:34:30 2014 (r266580) @@ -164,13 +164,11 @@ set_defaults() { # no arguments create_includes_and_libraries2() { # opt_dir opt_target local no log "create_includes_and_libraries2() for ${SRC} $1" - if [ ${OSVERSION} -ge 600000 ] ; then - no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITHOUT_CDDL=1" - no="$no -DWITHOUT_CASPER" - no="$no -DMALLOC_PRODUCTION" - else - no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R" - fi + + no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITHOUT_CDDL=1" + no="$no -DWITHOUT_CASPER" + no="$no -DMALLOC_PRODUCTION" + ( cd ${SRC}; # make -DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R -DPICOBSD buildworld if [ -d "$1" ] ; then @@ -186,48 +184,6 @@ create_includes_and_libraries2() { # opt ) } -# entry for 4.x and earlier trees -create_includes_and_libraries() { - local e i - - log "create_includes_and_libraries() for ${SRC}" - # Optionally creates include directory and libraries. - mkdir -p ${l_usrtree}/include # the include directory... - mkdir -p ${l_usrtree}/share/misc # a few things go here - mkdir -p ${l_usrtree}/lib # libraries - mkdir -p ${l_usrtree}/sbin # some binaries - # override variables for ownershiip and destinations - # BINOWN:BINGRP are also used for include files - (cd ${SRC}; \ - BINOWN=`id -un` BINGRP=`id -gn` \ - DESTDIR=${l_usrtree}/.. \ - make -m ${SRC}/share/mk includes ) || fail $? includes - # Pick up the correct headers for libraries. - CFLAGS="-nostdinc -I${l_usrtree}/include" ; export CFLAGS - - (cd ${SRC} - # $e is the invocation of make with correct environment - # XXX check the NO* options below, maybe system dependent. - e="MAKEOBJDIRPREFIX=${l_objtree}/picobsd/libraries \ - BINOWN=`id -un` BINGRP=`id -gn` \ - DESTDIR=${l_usrtree}/.. \ - make -m ${SRC}/share/mk \ - -DNOHTML -DNOINFO -DNOMAN -DNOSHARE -DNOFSCHG " - log "do a 'make obj' in a few places." - # This is very version-specific... The following works for 5.0 - for i in lib secure/lib gnu/lib \ - gnu/usr.bin/perl usr.bin/lex usr.sbin/config ; do - (cd ${i}; eval $e obj) - done - log "now make the static libraries" - eval $e -DNOPROFILE -DNOPIC libraries - (cd ${SRC}/usr.sbin/config - eval $e # build binary - eval $e install # install it - ) - ) || fail $? "libraries" - log "Libraries done" -} # set_type [the_site] looks in user or system directories # for the directory named as the first argument, reads the configuration @@ -964,11 +920,11 @@ fill_floppy_image() { dd of=${BUILDDIR}/${c_img} oseek=1 obs=788 conv=notrunc 2>/dev/null log "done disk image" # XXX (log "Fixing permissions"; cd ${dst}; chown -R root *) + df -ik ${dst} | colrm 70 > .build.reply # leave build stuff if verbose [ ${o_verbose} -gt 0 ] && return rm -rf ${BUILDDIR}/floppy.tree || true # cleanup - # df -ik ${dst} | colrm 70 > .build.reply rm -rf ${dst} rm ${BUILDDIR}/${c_fs} # rm ${BUILDDIR}/kernel.gz @@ -991,7 +947,7 @@ set_build_parameters() { set `grep "#define[\t ]__FreeBSD_version" ${SRC}/sys/sys/param.h` OSVERSION=$3 log "OSVERSION is ${OSVERSION}" - if [ ${OSVERSION} -ge 500035 ] ; then + export MAKEOBJDIRPREFIX=${l_objtree} export TARGET_ARCH=${o_arch} TARGET=${o_arch} # XXX 20131001 see if CLANG fixes the build @@ -1010,26 +966,12 @@ set_build_parameters() { eval "export BINMAKE=\"`cd ${SRC}; make -f Makefile -V BINMAKE`\"" [ "$BINMAKE" = "" ] && \ eval "export BINMAKE=\"`cd ${SRC}; make -f Makefile -V SUB_MAKE`\"" - fi if [ "${o_init_src}" != "" ] ; then - if [ ${OSVERSION} -lt 500035 ] ; then - create_includes_and_libraries - else - create_includes_and_libraries2 - fi + create_includes_and_libraries2 else eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V WMAKEENV` fi - if [ ${OSVERSION} -lt 500035 ] ; then - # Create the right LIBS and CFLAGS for further builds. - # and build the config program - LIBS="-L${l_usrtree}/lib" - CFLAGS="-nostdinc -I${l_usrtree}/include" - export LIBS CFLAGS - CONFIG=${l_usrtree}/sbin/config - export CONFIG - fi # if we have o_objdir, find where bin/ is if [ ! -z "${o_objdir}" ] ; then @@ -1049,7 +991,6 @@ set_build_parameters() { # Main entry of the script. Initialize variables, parse command line # arguments. -# o_par="-j 8" # parallel make and other make options set_defaults while [ true ]; do From owner-svn-src-head@FreeBSD.ORG Fri May 23 08:46:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1DDFD92F; Fri, 23 May 2014 08:46:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 087DC22CD; Fri, 23 May 2014 08:46:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4N8kUg9012877; Fri, 23 May 2014 08:46:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4N8kSK1012870; Fri, 23 May 2014 08:46:28 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405230846.s4N8kSK1012870@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 23 May 2014 08:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266581 - in head: etc/mtree include lib/libcuse sys/conf sys/fs/cuse sys/modules/cuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 08:46:30 -0000 Author: hselasky Date: Fri May 23 08:46:28 2014 New Revision: 266581 URL: http://svnweb.freebsd.org/changeset/base/266581 Log: Initial import of character device in userspace support for FreeBSD. The CUSE library is a wrapper for the devfs kernel functionality which is exposed through /dev/cuse . In order to function the CUSE kernel code must either be enabled in the kernel configuration file or loaded separately as a module. Currently none of the committed items are connected to the default builds, except for installing the needed header files. The CUSE code will be connected to the default world and kernel builds in a follow-up commit. The CUSE module was written by Hans Petter Selasky, somewhat inspired by similar functionality found in FUSE. The CUSE library can be used for many purposes. Currently CUSE is used when running Linux kernel drivers in user-space, which need to create a character device node to communicate with its applications. CUSE has full support for almost all devfs functionality found in the kernel: - kevents - read - write - ioctl - poll - open - close - mmap - private per file handle data Requested by several people. Also see "multimedia/cuse4bsd-kmod" in ports. Added: head/lib/libcuse/ head/lib/libcuse/Makefile (contents, props changed) head/lib/libcuse/cuse.3 (contents, props changed) head/lib/libcuse/cuse.h (contents, props changed) head/lib/libcuse/cuse_lib.c (contents, props changed) head/sys/fs/cuse/ head/sys/fs/cuse/cuse.c (contents, props changed) head/sys/fs/cuse/cuse_defs.h (contents, props changed) head/sys/fs/cuse/cuse_ioctl.h (contents, props changed) head/sys/modules/cuse/ head/sys/modules/cuse/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/sys/conf/files Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Fri May 23 08:34:30 2014 (r266580) +++ head/etc/mtree/BSD.include.dist Fri May 23 08:46:28 2014 (r266581) @@ -162,6 +162,8 @@ .. .. fs + cuse + .. devfs .. fdescfs Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Fri May 23 08:34:30 2014 (r266580) +++ head/include/Makefile Fri May 23 08:46:28 2014 (r266581) @@ -45,6 +45,7 @@ LSUBDIRS= cam/ata cam/scsi \ dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/nvme \ dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ + fs/cuse \ fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/nullfs \ fs/procfs fs/smbfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ Added: head/lib/libcuse/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcuse/Makefile Fri May 23 08:46:28 2014 (r266581) @@ -0,0 +1,64 @@ +# $FreeBSD$ +# +# Copyright (c) 2010 Hans Petter Selasky. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +LIB= cuse +SHLIB_MAJOR= 1 +SHLIB_MINOR= 0 +SRCS= cuse_lib.c +INCS= cuse.h +MAN= cuse.3 +PTHREAD_LIBS?= -lpthread +CFLAGS+= -D_GNU_SOURCE +.if defined(HAVE_DEBUG) +CFLAGS+= -g +CFLAGS+= -DHAVE_DEBUG +.endif +LDADD+= ${PTHREAD_LIBS} + +MLINKS= +MLINKS+= cuse.3 cuse_alloc_unit_number.3 +MLINKS+= cuse.3 cuse_copy_in.3 +MLINKS+= cuse.3 cuse_copy_out.3 +MLINKS+= cuse.3 cuse_dev_create.3 +MLINKS+= cuse.3 cuse_dev_destroy.3 +MLINKS+= cuse.3 cuse_dev_get_current.3 +MLINKS+= cuse.3 cuse_dev_get_per_file_handle.3 +MLINKS+= cuse.3 cuse_dev_get_priv0.3 +MLINKS+= cuse.3 cuse_dev_get_priv1.3 +MLINKS+= cuse.3 cuse_dev_set_per_file_handle.3 +MLINKS+= cuse.3 cuse_free_unit_number.3 +MLINKS+= cuse.3 cuse_got_peer_signal.3 +MLINKS+= cuse.3 cuse_init.3 +MLINKS+= cuse.3 cuse_poll_wakeup.3 +MLINKS+= cuse.3 cuse_set_local.3 +MLINKS+= cuse.3 cuse_get_local.3 +MLINKS+= cuse.3 cuse_uninit.3 +MLINKS+= cuse.3 cuse_vmalloc.3 +MLINKS+= cuse.3 cuse_is_vmalloc_addr.3 +MLINKS+= cuse.3 cuse_vmfree.3 +MLINKS+= cuse.3 cuse_wait_and_process.3 + +.include Added: head/lib/libcuse/cuse.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcuse/cuse.3 Fri May 23 08:46:28 2014 (r266581) @@ -0,0 +1,393 @@ +.\" $FreeBSD$ +.\" +.\" Copyright (c) 2010-2013 Hans Petter Selasky +.\" +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd May 23, 2014 +.Dt CUSE 3 +.Os +.Sh NAME +.Nm libcuse +. +.Nd "Userland character device library" +. +. +.Sh LIBRARY +. +. +Userland character device library (libcuse -lcuse) +. +. +.Sh SYNOPSIS +. +.Pp +To load the required kernel module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +cuse_load="YES" +.Ed +. +.Pp +. +.In cuse.h +. +. +.Sh DESCRIPTION +The +.Nm +library contains functions to create a character device in userspace. The +.Nm +library is thread safe. +. +. +.Sh LIBRARY INITIALISATION / DEINITIALISATION +. +.Pp +. +.Ft "int" +.Fn "cuse_init" "void" +This function initialises +.Nm . +Must be called at the beginning of the program. +This function returns 0 on success or a negative value on failure. +See CUSE_ERR_XXX for known error codes. +If the cuse kernel module is not loaded, CUSE_ERR_NOT_LOADED is +returned. +. +.Pp +. +.Ft "int" +.Fn "cuse_uninit" "void" +Deinitialise +.Nm . +Can be called at the end of the application. +This function returns 0 on success or a negative value on failure. +See CUSE_ERR_XXX for known error codes. +. +. +.Sh UNIT MANAGEMENT +. +.Ft "int" +.Fn "cuse_alloc_unit_number" "int *" +This function stores a uniq system unit number at the pointed +integer loation. +This function returns 0 on success or a negative value on failure. +See CUSE_ERR_XXX for known error codes. +. +.Pp +. +.Ft "int" +.Fn "cuse_alloc_unit_number_by_id" "int *" "int id" +This function stores a uniq system unit number at the pointed +integer loation. +The returned unit number is uniq within the given ID. +Valid ID values are defined by the cuse include file. +See the CUSE_ID_XXX() macros for more information. +This function returns 0 on success or a negative value on failure. +See CUSE_ERR_XXX for known error codes. +. +.Pp +. +.Ft "int" +.Fn "cuse_free_unit_number" "int" +This function frees the given allocated system unit number. +This function returns 0 on success or a negative value on failure. +See CUSE_ERR_XXX for known error codes. +. +.Pp +. +.Ft "int" +.Fn "cuse_free_unit_number_by_id" "int unit" "int id" +This function frees the given allocated system unit number belonging +to the given ID. +If both the unit and id argument is -1, all allocated units will be freed. +This function returns 0 on success or a negative value on failure. +See CUSE_ERR_XXX for known error codes. +. +. +.Sh LIBRARY USAGE +. +. +.Ft "void *" +.Fn "cuse_vmalloc" "int size" +This function allocates +.Ar size +bytes of memory. Only memory allocated by this function can be memory +mapped by mmap(). This function returns a valid data pointer on success or +NULL on failure. +. +.Pp +. +.Ft "int" +.Fn "cuse_is_vmalloc_addr" "void *" +This function returns non-zero if the passed pointer points to a valid +and non-freed allocation, as returned by "cuse_vmalloc()". +Else this function returns zero. +. +.Pp +. +.Ft "void" +.Fn "cuse_vmfree" "void *" +This function frees memory allocated by cuse_vmalloc(). Note that the +cuse library will internally not free the memory until the +cuse_uninit() function is called and that the number of uniq +allocations is limited. +. +. +.Pp +. +.Ft "unsigned long" +.Fn "cuse_vmoffset" "void *" +This function returns the mmap offset that the client must use to +access the allocated memory. +. +.Pp +. +.Ft "struct cuse_dev *" +.Fn "cuse_dev_create" "const struct cuse_methods *mtod" "void *priv0" "void *priv1" "uid_t" "gid_t" "int permission" "const char *fmt" "..." +This function creates a new character device according to the given +parameters. This function returns a valid cuse_dev structure pointer +on success or NULL on failure. The device name can only contain a-z, +A-Z, 0-9, dot, / and underscore characters. +. +.Pp +. +.Ft "void" +.Fn "cuse_dev_destroy" "struct cuse_dev *" +This functions destroys a previously created character device. +. +.Pp +. +. +.Ft "void *" +.Fn "cuse_dev_get_priv0" "struct cuse_dev *" +, +.Ft "void *" +.Fn "cuse_dev_get_priv1" "struct cuse_dev *" +, +.Ft "void" +.Fn "cuse_dev_set_priv0" "struct cuse_dev *" "void *" +, +.Ft "void" +.Fn "cuse_dev_set_priv1" "struct cuse_dev *" "void *" +These functions are used to set and get the private data of the given +cuse device. +. +.Pp +. +.Ft "int" +.Fn "cuse_wait_and_process" "void" +This function will block and do event processing. If parallell I/O is +required multiple threads must be created looping on this +function. +This function returns 0 on success or a negative value on failure. +See CUSE_ERR_XXX for known error codes. +. +.Pp +. +.Ft "void *" +.Fn "cuse_dev_get_per_file_handle" "struct cuse_dev *" +, +.Ft "void" +.Fn "cuse_dev_set_per_file_handle" "struct cuse_dev *" "void *" +These functions are used to set and get the per-file-open specific handle +and should only be used inside the cuse file operation callbacks. +. +.Pp +. +.Ft "void" +.Fn "cuse_set_local" "int" +This function instructs cuse_copy_out() and cuse_copy_in() that the +user pointer is local, if the argument passed to it is non-zero. +Else the user pointer is assumed to be at the peer application. +This function should only be used inside the cuse file operation callbacks. +The value is reset to zero when the given file operation returns, and +does not affect any other file operation callbacks. +. +.Pp +. +.Ft "int" +.Fn "cuse_get_local" "void" +Return current local state. See "cuse_set_local" function. +. +.Pp +. +.Ft "int" +.Fn "cuse_copy_out" "const void *src" "void *peer_dst" "int len" +, +.Ft "int" +.Fn "cuse_copy_in" "const void *peer_src" "void *dst" "int len" +These functions are used to transfer data between the local +application and the peer application. These functions must be used +when operating on the data pointers passed to the cm_read(), +cm_write() and cm_ioctl() callback functions. +These functions return 0 on success or a negative value on failure. +See CUSE_ERR_XXX for known error codes. +. +.Pp +. +.Ft "int" +.Fn "cuse_got_peer_signal" "void" +This function is used to check if a signal has been delivered to the +peer application and should only be used inside the cuse file +operation callbacks. This function returns 0 if a signal has been +delivered to the caller. +Else it returns a negative value. +See CUSE_ERR_XXX for known error codes. +. +.Pp +. +.Ft "struct cuse_dev *" +.Fn "cuse_dev_get_current" "int *pcmd" +This function is used to get the current cuse device pointer and the +currently executing command, by CUSE_CMD_XXX value. The pcmd argument +is allowed to be NULL. This function should only be used inside the +cuse file operation callbacks. On success a valid cuse device pointer +is returned. On failure NULL is returned. +. +.Pp +. +.Ft "void" +.Fn "cuse_poll_wakeup" "void" +This function will wake up any file pollers. +. +.Pp +. +.Sh LIBRARY LIMITATIONS +. +. +Transfer lengths for read, write, cuse_copy_in and cuse_copy_out +should not exceed what can fit into a 32-bit signed integer and is +defined by the CUSE_LENGTH_MAX macro. +. +Transfer lengths for ioctls should not exceed what is defined by the +CUSE_BUFFER_MAX macro. +. +. +.Sh LIBRARY CALLBACK METHODS +. +In general fflags are defined by CUSE_FFLAG_XXX and errors are defined by CUSE_ERR_XXX. +. +.Bd -literal -offset indent +enum { + CUSE_ERR_NONE + CUSE_ERR_BUSY + CUSE_ERR_WOULDBLOCK + CUSE_ERR_INVALID + CUSE_ERR_NO_MEMORY + CUSE_ERR_FAULT + CUSE_ERR_SIGNAL + CUSE_ERR_OTHER + CUSE_ERR_NOT_LOADED + + CUSE_POLL_NONE + CUSE_POLL_READ + CUSE_POLL_WRITE + CUSE_POLL_ERROR + + CUSE_FFLAG_NONE + CUSE_FFLAG_READ + CUSE_FFLAG_WRITE + CUSE_FFLAG_NONBLOCK + + CUSE_CMD_NONE + CUSE_CMD_OPEN + CUSE_CMD_CLOSE + CUSE_CMD_READ + CUSE_CMD_WRITE + CUSE_CMD_IOCTL + CUSE_CMD_POLL + CUSE_CMD_SIGNAL + CUSE_CMD_SYNC + CUSE_CMD_MAX +}; +.Ed +. +.Pp +. +.Ft "int" +.Fn "cuse_open_t" "struct cuse_dev *" "int fflags" +This functions returns a CUSE_ERR_XXX value. +. +.Pp +. +.Ft "int" +.Fn "cuse_close_t" "struct cuse_dev *" "int fflags" +This functions returns a CUSE_ERR_XXX value. +. +.Pp +. +.Ft "int" +.Fn "cuse_read_t" "struct cuse_dev *" "int fflags" "void *peer_ptr" "int len" +This functions returns a CUSE_ERR_XXX value in case of failure or the +actually transferred length in case of success. cuse_copy_in() and +cuse_copy_out() must be used to transfer data to and from the +peer_ptr. +. +.Pp +. +.Ft "int" +.Fn "cuse_write_t" "struct cuse_dev *" "int fflags" "const void *peer_ptr" "int len" +This functions returns a CUSE_ERR_XXX value in case of failure or the +actually transferred length in case of success. cuse_copy_in() and +cuse_copy_out() must be used to transfer data to and from the +peer_ptr. +. +.Pp +. +.Ft "int" +.Fn "cuse_ioctl_t" "struct cuse_dev *" "int fflags" "unsigned long cmd" "void *peer_data" +This functions returns a CUSE_ERR_XXX value in case of failure or zero +in case of success. cuse_copy_in() and cuse_copy_out() must be used to +transfer data to and from the peer_data. +. +.Pp +. +.Ft "int" +.Fn "cuse_poll_t" "struct cuse_dev *" "int fflags" "int events" +This functions returns a mask of CUSE_POLL_XXX values in case of +failure and success. The events argument is also a mask of +CUSE_POLL_XXX values. +. +.Pp +. +.Bd -literal -offset indent +struct cuse_methods { + cuse_open_t *cm_open; + cuse_close_t *cm_close; + cuse_read_t *cm_read; + cuse_write_t *cm_write; + cuse_ioctl_t *cm_ioctl; + cuse_poll_t *cm_poll; +}; +.Ed +. +. +.Sh SEE ALSO +. +.Sh HISTORY +. +.Nm +was written by Hans Petter Selasky . Added: head/lib/libcuse/cuse.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcuse/cuse.h Fri May 23 08:46:28 2014 (r266581) @@ -0,0 +1,97 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2014 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _CUSE_H_ +#define _CUSE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +struct cuse_dev; + +typedef int (cuse_open_t)(struct cuse_dev *, int fflags); +typedef int (cuse_close_t)(struct cuse_dev *, int fflags); +typedef int (cuse_read_t)(struct cuse_dev *, int fflags, void *user_ptr, int len); +typedef int (cuse_write_t)(struct cuse_dev *, int fflags, const void *user_ptr, int len); +typedef int (cuse_ioctl_t)(struct cuse_dev *, int fflags, unsigned long cmd, void *user_data); +typedef int (cuse_poll_t)(struct cuse_dev *, int fflags, int events); + +struct cuse_methods { + cuse_open_t *cm_open; + cuse_close_t *cm_close; + cuse_read_t *cm_read; + cuse_write_t *cm_write; + cuse_ioctl_t *cm_ioctl; + cuse_poll_t *cm_poll; +}; + +int cuse_init(void); +int cuse_uninit(void); + +void *cuse_vmalloc(int); +int cuse_is_vmalloc_addr(void *); +void cuse_vmfree(void *); +unsigned long cuse_vmoffset(void *ptr); + +int cuse_alloc_unit_number_by_id(int *, int); +int cuse_free_unit_number_by_id(int, int); +int cuse_alloc_unit_number(int *); +int cuse_free_unit_number(int); + +struct cuse_dev *cuse_dev_create(const struct cuse_methods *, void *, void *, uid_t, gid_t, int, const char *,...); +void cuse_dev_destroy(struct cuse_dev *); + +void *cuse_dev_get_priv0(struct cuse_dev *); +void *cuse_dev_get_priv1(struct cuse_dev *); + +void cuse_dev_set_priv0(struct cuse_dev *, void *); +void cuse_dev_set_priv1(struct cuse_dev *, void *); + +void cuse_set_local(int); +int cuse_get_local(void); + +int cuse_wait_and_process(void); + +void cuse_dev_set_per_file_handle(struct cuse_dev *, void *); +void *cuse_dev_get_per_file_handle(struct cuse_dev *); + +int cuse_copy_out(const void *src, void *user_dst, int len); +int cuse_copy_in(const void *user_src, void *dst, int len); +int cuse_got_peer_signal(void); +void cuse_poll_wakeup(void); + +struct cuse_dev *cuse_dev_get_current(int *); + +extern int cuse_debug_level; + +#ifdef __cplusplus +} +#endif + +#endif /* _CUSE_H_ */ Added: head/lib/libcuse/cuse_lib.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcuse/cuse_lib.c Fri May 23 08:46:28 2014 (r266581) @@ -0,0 +1,800 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2010-2012 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include "cuse.h" + +int cuse_debug_level; + +#ifdef HAVE_DEBUG +static const char *cuse_cmd_str(int cmd); + +#define DPRINTF(...) do { \ + if (cuse_debug_level != 0) \ + printf(__VA_ARGS__); \ +} while (0) +#else +#define DPRINTF(...) do { } while (0) +#endif + +struct cuse_vm_allocation { + uint8_t *ptr; + uint32_t size; +}; + +struct cuse_dev_entered { + TAILQ_ENTRY(cuse_dev_entered) entry; + pthread_t thread; + void *per_file_handle; + struct cuse_dev *cdev; + int cmd; + int is_local; + int got_signal; +}; + +struct cuse_dev { + TAILQ_ENTRY(cuse_dev) entry; + const struct cuse_methods *mtod; + void *priv0; + void *priv1; +}; + +static TAILQ_HEAD(, cuse_dev) h_cuse; +static TAILQ_HEAD(, cuse_dev_entered) h_cuse_entered; +static int f_cuse = -1; +static pthread_mutex_t m_cuse; +static struct cuse_vm_allocation a_cuse[CUSE_ALLOC_UNIT_MAX]; + +static void +cuse_lock(void) +{ + pthread_mutex_lock(&m_cuse); +} + +static void +cuse_unlock(void) +{ + pthread_mutex_unlock(&m_cuse); +} + +int +cuse_init(void) +{ + pthread_mutexattr_t attr; + + f_cuse = open("/dev/cuse", O_RDWR); + if (f_cuse < 0) { + if (feature_present("cuse") == 0) + return (CUSE_ERR_NOT_LOADED); + else + return (CUSE_ERR_INVALID); + } + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&m_cuse, &attr); + + TAILQ_INIT(&h_cuse); + TAILQ_INIT(&h_cuse_entered); + + return (0); +} + +int +cuse_uninit(void) +{ + int f; + + if (f_cuse < 0) + return (CUSE_ERR_INVALID); + + f = f_cuse; + f_cuse = -1; + + close(f); + + pthread_mutex_destroy(&m_cuse); + + memset(a_cuse, 0, sizeof(a_cuse)); + + return (0); +} + +unsigned long +cuse_vmoffset(void *_ptr) +{ + uint8_t *ptr_min; + uint8_t *ptr_max; + uint8_t *ptr = _ptr; + unsigned long remainder; + int n; + + cuse_lock(); + for (n = 0; n != CUSE_ALLOC_UNIT_MAX; n++) { + if (a_cuse[n].ptr == NULL) + continue; + + ptr_min = a_cuse[n].ptr; + ptr_max = a_cuse[n].ptr + a_cuse[n].size - 1; + + if ((ptr >= ptr_min) && (ptr <= ptr_max)) { + + cuse_unlock(); + + remainder = (ptr - ptr_min); + + remainder -= remainder % PAGE_SIZE; + + return ((n * PAGE_SIZE * CUSE_ALLOC_PAGES_MAX) + remainder); + } + } + cuse_unlock(); + + return (0x80000000UL); /* failure */ +} + +void * +cuse_vmalloc(int size) +{ + struct cuse_alloc_info info; + void *ptr; + int error; + int n; + + if (f_cuse < 0) + return (NULL); + + memset(&info, 0, sizeof(info)); + + if (size < 1) + return (NULL); + + info.page_count = (size + PAGE_SIZE - 1) / PAGE_SIZE; + + cuse_lock(); + for (n = 0; n != CUSE_ALLOC_UNIT_MAX; n++) { + + if (a_cuse[n].ptr != NULL) + continue; + + a_cuse[n].ptr = ((uint8_t *)1); /* reserve */ + a_cuse[n].size = 0; + + cuse_unlock(); + + info.alloc_nr = n; + + error = ioctl(f_cuse, CUSE_IOCTL_ALLOC_MEMORY, &info); + + if (error) { + + cuse_lock(); + + a_cuse[n].ptr = NULL; + + if (errno == EBUSY) + continue; + else + break; + } + ptr = mmap(NULL, info.page_count * PAGE_SIZE, + PROT_READ | PROT_WRITE, + MAP_SHARED, f_cuse, CUSE_ALLOC_PAGES_MAX * + PAGE_SIZE * n); + + if (ptr == MAP_FAILED) { + + error = ioctl(f_cuse, CUSE_IOCTL_FREE_MEMORY, &info); + + if (error) { + /* ignore */ + } + cuse_lock(); + + a_cuse[n].ptr = NULL; + + break; + } + cuse_lock(); + a_cuse[n].ptr = ptr; + a_cuse[n].size = size; + cuse_unlock(); + + return (ptr); /* success */ + } + cuse_unlock(); + return (NULL); /* failure */ +} + +int +cuse_is_vmalloc_addr(void *ptr) +{ + int n; + + if (f_cuse < 0 || ptr == NULL) + return (0); /* false */ + + cuse_lock(); + for (n = 0; n != CUSE_ALLOC_UNIT_MAX; n++) { + if (a_cuse[n].ptr == ptr) + break; + } + cuse_unlock(); + + return (n != CUSE_ALLOC_UNIT_MAX); +} + +void +cuse_vmfree(void *ptr) +{ + struct cuse_alloc_info info; + int error; + int n; + + if (f_cuse < 0) + return; + + memset(&info, 0, sizeof(info)); + + cuse_lock(); + for (n = 0; n != CUSE_ALLOC_UNIT_MAX; n++) { + if (a_cuse[n].ptr != ptr) + continue; + + cuse_unlock(); + + info.alloc_nr = n; + + munmap(ptr, a_cuse[n].size); + + error = ioctl(f_cuse, CUSE_IOCTL_FREE_MEMORY, &info); + + if (error) { + /* ignore */ + } + cuse_lock(); + + a_cuse[n].ptr = NULL; + a_cuse[n].size = 0; + + break; + } + cuse_unlock(); +} + +int +cuse_alloc_unit_number_by_id(int *pnum, int id) +{ + int error; + + if (f_cuse < 0) + return (CUSE_ERR_INVALID); + + *pnum = (id & CUSE_ID_MASK); + + error = ioctl(f_cuse, CUSE_IOCTL_ALLOC_UNIT_BY_ID, pnum); + if (error) + return (CUSE_ERR_NO_MEMORY); + + return (0); + +} + +int +cuse_free_unit_number_by_id(int num, int id) +{ + int error; + + if (f_cuse < 0) + return (CUSE_ERR_INVALID); + + if (num != -1 || id != -1) + num = (id & CUSE_ID_MASK) | (num & 0xFF); + + error = ioctl(f_cuse, CUSE_IOCTL_FREE_UNIT_BY_ID, &num); + if (error) + return (CUSE_ERR_NO_MEMORY); + + return (0); +} + +int +cuse_alloc_unit_number(int *pnum) +{ + int error; + + if (f_cuse < 0) + return (CUSE_ERR_INVALID); + + error = ioctl(f_cuse, CUSE_IOCTL_ALLOC_UNIT, pnum); + if (error) + return (CUSE_ERR_NO_MEMORY); + + return (0); +} + +int +cuse_free_unit_number(int num) +{ + int error; + + if (f_cuse < 0) + return (CUSE_ERR_INVALID); + + error = ioctl(f_cuse, CUSE_IOCTL_FREE_UNIT, &num); + if (error) + return (CUSE_ERR_NO_MEMORY); + + return (0); +} + +struct cuse_dev * +cuse_dev_create(const struct cuse_methods *mtod, void *priv0, void *priv1, + uid_t _uid, gid_t _gid, int _perms, const char *_fmt,...) +{ + struct cuse_create_dev info; + struct cuse_dev *cdev; + va_list args; + int error; + + if (f_cuse < 0) + return (NULL); + + cdev = malloc(sizeof(*cdev)); + if (cdev == NULL) + return (NULL); + + memset(cdev, 0, sizeof(*cdev)); + + cdev->mtod = mtod; + cdev->priv0 = priv0; + cdev->priv1 = priv1; + + memset(&info, 0, sizeof(info)); + + info.dev = cdev; + info.user_id = _uid; + info.group_id = _gid; + info.permissions = _perms; + + va_start(args, _fmt); + vsnprintf(info.devname, sizeof(info.devname), _fmt, args); + va_end(args); + + error = ioctl(f_cuse, CUSE_IOCTL_CREATE_DEV, &info); + if (error) { + free(cdev); + return (NULL); + } + cuse_lock(); + TAILQ_INSERT_TAIL(&h_cuse, cdev, entry); + cuse_unlock(); + + return (cdev); +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri May 23 11:22:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E0D8E2A; Fri, 23 May 2014 11:22:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BD362098; Fri, 23 May 2014 11:22:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4NBMi75086494; Fri, 23 May 2014 11:22:44 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4NBMiu5086493; Fri, 23 May 2014 11:22:44 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201405231122.s4NBMiu5086493@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 23 May 2014 11:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266584 - head/release/picobsd/build X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 11:22:44 -0000 Author: luigi Date: Fri May 23 11:22:44 2014 New Revision: 266584 URL: http://svnweb.freebsd.org/changeset/base/266584 Log: do not build libraries, they require a lot more stuff Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Fri May 23 09:48:42 2014 (r266583) +++ head/release/picobsd/build/picobsd Fri May 23 11:22:44 2014 (r266584) @@ -175,7 +175,8 @@ create_includes_and_libraries2() { # opt cd $1 ; ${BINMAKE} ${o_par} $2 # specific target, e.g. ld-elf.so else export MAKEOBJDIRPREFIX=${l_objtree} - make ${o_par} $no toolchain libraries + make ${o_par} $no toolchain + # XXX do we need any of these ? eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V WMAKEENV` [ ${o_arch} != `uname -m` ] && \ From owner-svn-src-head@FreeBSD.ORG Fri May 23 12:20:46 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12F287CB; Fri, 23 May 2014 12:20:46 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC97E260F; Fri, 23 May 2014 12:20:45 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WnoSp-0008X1-P6; Fri, 23 May 2014 12:20:43 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s4NCKft8047612; Fri, 23 May 2014 06:20:41 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+x6Hx1njYh0P++GarAZWOM Subject: Re: svn commit: r266579 - head/release/picobsd/build From: Ian Lepore To: Luigi Rizzo In-Reply-To: <201405230810.s4N8A77p095659@svn.freebsd.org> References: <201405230810.s4N8A77p095659@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Fri, 23 May 2014 06:20:40 -0600 Message-ID: <1400847640.1152.308.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 12:20:46 -0000 On Fri, 2014-05-23 at 08:10 +0000, Luigi Rizzo wrote: > Author: luigi > Date: Fri May 23 08:10:07 2014 > New Revision: 266579 > URL: http://svnweb.freebsd.org/changeset/base/266579 > > Log: > add libraries to the initial build for picobsd. > > add a -j option so we can tune the amount of parallel make, > the default we used (-j 8) is large and was giving problems > with SUBDIR_PARALLEL due to some missing dependencies. > Do you have info on what missing dependencies? Were they in the lib/ hierarchy, or somewhere else? I have a sketchy hand-wavy plan for handling dependencies with finer-grained control than the current .WAIT mechanism, but I haven't hurried to work on it because I didn't think anyone was having any trouble. -- Ian From owner-svn-src-head@FreeBSD.ORG Fri May 23 14:08:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2732C81F; Fri, 23 May 2014 14:08:21 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 016F32051; Fri, 23 May 2014 14:08:21 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 037E9B946; Fri, 23 May 2014 10:08:19 -0400 (EDT) From: John Baldwin To: Ian Lepore Subject: Re: svn commit: r266565 - head/sys/arm/arm Date: Fri, 23 May 2014 09:12:46 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201405222338.s4MNcHYA066694@svn.freebsd.org> In-Reply-To: <201405222338.s4MNcHYA066694@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201405230912.47217.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 23 May 2014 10:08:19 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 14:08:21 -0000 On Thursday, May 22, 2014 7:38:17 pm Ian Lepore wrote: > Author: ian > Date: Thu May 22 23:38:17 2014 > New Revision: 266565 > URL: http://svnweb.freebsd.org/changeset/base/266565 > > Log: > Map device memory using PTE_DEVICE attributes, and also ensure that the > shared flag is set on normal-memory mappings made via pmap_kenter() for SMP. > > The "shared flag" part of this change isn't obvious from the diff, here's > the deal... by using the array of preformatted page table entry templates > instead of constructing the PTE from scratch, we automatically get the > right attribute bits set for both caching and shared. > > MFC after: 1 week One tiny nit: > Modified: head/sys/arm/arm/pmap-v6.c > ============================================================================== > --- head/sys/arm/arm/pmap-v6.c Thu May 22 23:18:17 2014 (r266564) > +++ head/sys/arm/arm/pmap-v6.c Thu May 22 23:38:17 2014 (r266565) > @@ -2401,12 +2402,17 @@ pmap_kenter_internal(vm_offset_t va, vm_ > ptep = &l2b->l2b_kva[l2pte_index(va)]; > opte = *ptep; > > + if (flags & KENTER_CACHE) > + *ptep = L2_S_PROTO | l2s_mem_types[PTE_CACHE] | pa | L2_S_REF; > + else if (flags & KENTER_DEVICE) > + *ptep = L2_S_PROTO |l2s_mem_types[PTE_DEVICE] | pa | L2_S_REF; > + else > + *ptep =L2_S_PROTO | l2s_mem_types[PTE_NOCACHE] | pa | L2_S_REF; > + The whitespace around operators for the last two assignments is inconsistent. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri May 23 14:32:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D88C9384; Fri, 23 May 2014 14:32:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5CAE233D; Fri, 23 May 2014 14:32:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4NEWv2v075248; Fri, 23 May 2014 14:32:57 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4NEWvcL075247; Fri, 23 May 2014 14:32:57 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <201405231432.s4NEWvcL075247@svn.freebsd.org> From: Tom Rhodes Date: Fri, 23 May 2014 14:32:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266586 - head/sbin/fsck X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 14:32:57 -0000 Author: trhodes Date: Fri May 23 14:32:57 2014 New Revision: 266586 URL: http://svnweb.freebsd.org/changeset/base/266586 Log: If called without -T or -t, fsck attempts to detect the file system type. If this fails, fsck will fail with "unknown file system type" message. PR: 188214 Modified: head/sbin/fsck/fsck.8 Modified: head/sbin/fsck/fsck.8 ============================================================================== --- head/sbin/fsck/fsck.8 Fri May 23 11:56:32 2014 (r266585) +++ head/sbin/fsck/fsck.8 Fri May 23 14:32:57 2014 (r266586) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2009 +.Dd May 23, 2014 .Dt FSCK 8 .Os .Sh NAME @@ -111,6 +111,18 @@ The disk drive containing each file syst of the device name that ends in a digit; the remaining characters are assumed to be the partition and slice designators. .Pp +If the +.Fl t +or +.Fl T +flags are not specified, +.Nm +will attempt to determine the file system type and call the +appropriated file system check utility. +Failure to detect the file system type will cause +.Nm +to fail with a message that the partition has an unknown file system type. +.Pp The options are as follows: .Bl -tag -width indent .It Fl C From owner-svn-src-head@FreeBSD.ORG Fri May 23 14:34:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00B104F5; Fri, 23 May 2014 14:34:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E21282355; Fri, 23 May 2014 14:34:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4NEYMbB075538; Fri, 23 May 2014 14:34:22 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4NEYMHU075537; Fri, 23 May 2014 14:34:22 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405231434.s4NEYMHU075537@svn.freebsd.org> From: Warner Losh Date: Fri, 23 May 2014 14:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266587 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 14:34:23 -0000 Author: imp Date: Fri May 23 14:34:22 2014 New Revision: 266587 URL: http://svnweb.freebsd.org/changeset/base/266587 Log: Allow CC to not actually exist. During the ports INDEX run, all the Makefiles are evaluated without building things. In a normal build, the prerequisites would be built, and CC would be an actual thing. In an INDEX build, though, they don't exists. Redirect stderr to get rid of annoying messages, and assume that the compiler version is 0 if the actual compiler can't tell us. Do this in preference to guessing based on numbers because gcc410 might be 4.10, or 4.1.0 and without carefully crafted special knowledge we differentiate between them easily (also ming-gcc has no clues at all). Elsewhere, don't trust the compiler version if it is 0. Modified: head/share/mk/bsd.compiler.mk Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Fri May 23 14:32:57 2014 (r266586) +++ head/share/mk/bsd.compiler.mk Fri May 23 14:34:22 2014 (r266587) @@ -21,11 +21,11 @@ .if !target(____) ____: -_v!= ${CC} --version +_v!= ${CC} --version 2>/dev/null || echo 0.0.0 .if !defined(COMPILER_TYPE) -. if ${CC:T:Mgcc*} +. if ${CC:T:M*gcc*} COMPILER_TYPE:= gcc -. elif ${CC:T:Mclang} +. elif ${CC:T:M*clang*} COMPILER_TYPE:= clang . elif ${_v:Mgcc} COMPILER_TYPE:= gcc From owner-svn-src-head@FreeBSD.ORG Fri May 23 15:19:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8EC321F; Fri, 23 May 2014 15:19:43 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 9CC1E273A; Fri, 23 May 2014 15:19:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 7FC943805E; Fri, 23 May 2014 10:19:36 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id r1GOyVppmz2y; Fri, 23 May 2014 10:19:36 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id ADA883805B; Fri, 23 May 2014 10:19:35 -0500 (CDT) Message-ID: <537F6706.6070509@freebsd.org> Date: Fri, 23 May 2014 08:19:34 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Glen Barber , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r266553 - head/release/scripts References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> In-Reply-To: <201405221922.s4MJM4Y9025265@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 15:19:43 -0000 Is there any chance of finally switching the pkg abi identifiers to just be uname -p? -Nathan On 05/22/14 12:22, Glen Barber wrote: > Author: gjb > Date: Thu May 22 19:22:03 2014 > New Revision: 266553 > URL: http://svnweb.freebsd.org/changeset/base/266553 > > Log: > Add forward-compatibility glue with pkg-1.3: > - Use ASSUME_ALWAYS_YES=YES instead of ASSUME_ALWAYS_YES=1 > since pkg-1.3 expects "yes" or "true" values. > - Before exporting PKG_ABI, strip extra characters from what > is parsed from 'pkg -vv'. This causes problems further down > when creating the packages directory for inclusion on the > dvd1.iso. Previously PKG_ABI would be 'freebsd:9:x86:64', > but now is '"freebsd:9:x86:64";' in pkg-1.3 > > Tested on: stable/9@r265858 with ports-mgmt/pkg-devel > MFC After: 3 days > Sponsored by: The FreeBSD Foundation > > Modified: > head/release/scripts/pkg-stage.sh > > Modified: head/release/scripts/pkg-stage.sh > ============================================================================== > --- head/release/scripts/pkg-stage.sh Thu May 22 18:22:02 2014 (r266552) > +++ head/release/scripts/pkg-stage.sh Thu May 22 19:22:03 2014 (r266553) > @@ -5,7 +5,7 @@ > > set -e > > -export ASSUME_ALWAYS_YES=1 > +export ASSUME_ALWAYS_YES="YES" > export PKG_DBDIR="/tmp/pkg" > export PERMISSIVE="YES" > export REPO_AUTOUPDATE="NO" > @@ -40,7 +40,10 @@ if [ ! -x /usr/local/sbin/pkg ]; then > /usr/bin/make -C /usr/ports/ports-mgmt/pkg install clean > fi > > -export PKG_ABI=$(pkg -vv | grep ^ABI | awk '{print $3}') > +PKG_ABI=$(pkg -vv | grep ^ABI | awk '{print $3}') > +PKG_ABI="${PKG_ABI%\";}" > +PKG_ABI="${PKG_ABI#\"}" > +export PKG_ABI > export PKG_CACHEDIR="dvd/packages/${PKG_ABI}" > > /bin/mkdir -p ${PKG_CACHEDIR} > From owner-svn-src-head@FreeBSD.ORG Fri May 23 15:25:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FBB9408; Fri, 23 May 2014 15:25:54 +0000 (UTC) Date: Fri, 23 May 2014 11:25:51 -0400 From: Glen Barber To: Nathan Whitehorn Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140523152551.GI68335@hub.FreeBSD.org> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pe+tqlI1iYzVj1X/" Content-Disposition: inline In-Reply-To: <537F6706.6070509@freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 15:25:56 -0000 --pe+tqlI1iYzVj1X/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable It would certainly make my life easier. But until such thing is done in pkg(7) code, I have to put things in a directory structure that pkg(7) can "just use" for on-disc packages. Glen On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: > Is there any chance of finally switching the pkg abi identifiers to just = be > uname -p? > -Nathan >=20 > On 05/22/14 12:22, Glen Barber wrote: > >Author: gjb > >Date: Thu May 22 19:22:03 2014 > >New Revision: 266553 > >URL: http://svnweb.freebsd.org/changeset/base/266553 > > > >Log: > > Add forward-compatibility glue with pkg-1.3: > > - Use ASSUME_ALWAYS_YES=3DYES instead of ASSUME_ALWAYS_YES=3D1 > > since pkg-1.3 expects "yes" or "true" values. > > - Before exporting PKG_ABI, strip extra characters from what > > is parsed from 'pkg -vv'. This causes problems further down > > when creating the packages directory for inclusion on the > > dvd1.iso. Previously PKG_ABI would be 'freebsd:9:x86:64', > > but now is '"freebsd:9:x86:64";' in pkg-1.3 > > Tested on: stable/9@r265858 with ports-mgmt/pkg-devel > > MFC After: 3 days > > Sponsored by: The FreeBSD Foundation > > > >Modified: > > head/release/scripts/pkg-stage.sh > > > >Modified: head/release/scripts/pkg-stage.sh > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- head/release/scripts/pkg-stage.sh Thu May 22 18:22:02 2014 (r266552) > >+++ head/release/scripts/pkg-stage.sh Thu May 22 19:22:03 2014 (r266553) > >@@ -5,7 +5,7 @@ > > set -e > >-export ASSUME_ALWAYS_YES=3D1 > >+export ASSUME_ALWAYS_YES=3D"YES" > > export PKG_DBDIR=3D"/tmp/pkg" > > export PERMISSIVE=3D"YES" > > export REPO_AUTOUPDATE=3D"NO" > >@@ -40,7 +40,10 @@ if [ ! -x /usr/local/sbin/pkg ]; then > > /usr/bin/make -C /usr/ports/ports-mgmt/pkg install clean > > fi > >-export PKG_ABI=3D$(pkg -vv | grep ^ABI | awk '{print $3}') > >+PKG_ABI=3D$(pkg -vv | grep ^ABI | awk '{print $3}') > >+PKG_ABI=3D"${PKG_ABI%\";}" > >+PKG_ABI=3D"${PKG_ABI#\"}" > >+export PKG_ABI > > export PKG_CACHEDIR=3D"dvd/packages/${PKG_ABI}" > > /bin/mkdir -p ${PKG_CACHEDIR} > > --pe+tqlI1iYzVj1X/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTf2h/AAoJELls3eqvi17Q0MoQAIdQmJ2Pnk+Zvh1YVcWbLaax te4f6k0dK+zsOFmdh/fwVHpmBmu7Xxskdhr3fXy+eQ+vEg8Ba/FSYHIidZNF9BEX XIV475QJtO0pA5NosDK9Imj46Z6NKtc7l0mAXpbG85hfWU1+WDuv/j8WjWS13QhC LxIB8D/jAlguzUrn6+H+NwaxiE0nVlhYVTSij/lPmr6+WkAZMgb5WltShy1Hpe9a RHa+GdAvUtuPDLbLwnx+mh06Zcv7nd4CT+RYF6ZFJj619Jd8h9OetrXxApxhB06s V9ix+Z50xSWSxmpKTJoK5awPPDCe6ou7QksKwWaFuQ/Af9Cvz1y3yGbWKyaYaxx1 DbmBCk8kexJG5IVmNVJ9Gux13whaz9V+BN/fCyBrFFjwwqyZcAFXlcC5pnmUP69F WlZKmoQ1foI7aR7d5GIItakouEtbdwIE5wK2uiRkb1ms6+McW71ODWNtR3uxe7Rr DJc48gBu0mKDKXa4cqigfpwwIL1PjEE3kaurcAyTx0YlpP03K+spzq0yaoS21ake n7Pwt5WRabL4wDGVb5JF+fEpL9Oh4rPL3IJSi2+7D5n5KgTSwqyQkiVD926VzTjM Tr7B1TRWKyPxdfZI3TW8qgvj4aPFmxYI4+csD5bCaeQI+ktPHNiC3G/lWMJ+xKY+ SiKEWXAZCXPol5xmU+mx =Mpxa -----END PGP SIGNATURE----- --pe+tqlI1iYzVj1X/-- From owner-svn-src-head@FreeBSD.ORG Fri May 23 15:36:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61B1578D; Fri, 23 May 2014 15:36:25 +0000 (UTC) Received: from mail-wi0-x22f.google.com (mail-wi0-x22f.google.com [IPv6:2a00:1450:400c:c05::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B9D62937; Fri, 23 May 2014 15:36:24 +0000 (UTC) Received: by mail-wi0-f175.google.com with SMTP id f8so1045787wiw.2 for ; Fri, 23 May 2014 08:36:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=PcvgZzvvPd90IJKO1gPVVXdiiMMyHfsmC54BMjEVhME=; b=y2tme4WLPReg2LCwKwJAUID4/laB9KfhVTO8GzkghA7tY+EREtAPjllJw6bW7o11OL H1B6RK7ilAVzNAViwMNlzjvTC9Vr3hZJTYgIKLi82o+IZcZrsU9MHFM+IX/YyfeVf1Cr mTKGG2FZ41rHRQqd4Uo0QO4z7XNfR4gkc6EzcFuqJz0a7mi60dQZG7tz99a7E/e8X6nf /t8835sTlqB77pFW0p6W5Grh4gVgghS1x6sJFBdvrmcD9uf9vAZyMfcZEjOSTxvd4pxh FFebOcWWYyRWRbE2Hgfi6i7wYBPSSFUcKSWfYPFgTvuTh7PZAs9VXw2kHTmS5Vepm1xz rbwg== X-Received: by 10.194.142.205 with SMTP id ry13mr3370463wjb.69.1400859382665; Fri, 23 May 2014 08:36:22 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id s9sm3494329wix.13.2014.05.23.08.36.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 May 2014 08:36:21 -0700 (PDT) Sender: Baptiste Daroussin Date: Fri, 23 May 2014 17:36:19 +0200 From: Baptiste Daroussin To: Nathan Whitehorn Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140523153619.GF72340@ivaldir.etoilebsd.net> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Zs/RYxT/hKAHzkfQ" Content-Disposition: inline In-Reply-To: <537F6706.6070509@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 15:36:25 -0000 --Zs/RYxT/hKAHzkfQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: > Is there any chance of finally switching the pkg abi identifiers to just= =20 > be uname -p? > -Nathan Keeping asking won't make it happen, I have explained a large number of tim= e why it happened, why it is not easy for compatibility and why uname -p is still not representing the ABI we do support, and what flexibility we need that the current string offers to us. if one is willing to do the work, please be my guess, just dig into the arc= hives and join the pkg development otherwise: no it won't happen before a while because we have way too much work on the todo and this item is stored at the very end of this todo. regards, Bapt --Zs/RYxT/hKAHzkfQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iEYEARECAAYFAlN/avMACgkQ8kTtMUmk6ExhOwCfVDjsbYbr28L4rVfP+0jFFXvK XecAoLKcqskWJawSshkQr1bdwIT+yNGR =mWRH -----END PGP SIGNATURE----- --Zs/RYxT/hKAHzkfQ-- From owner-svn-src-head@FreeBSD.ORG Fri May 23 15:52:30 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7096E57; Fri, 23 May 2014 15:52:30 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 823332B0B; Fri, 23 May 2014 15:52:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 33D6738064; Fri, 23 May 2014 10:52:30 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id PQtpSqGBXLNW; Fri, 23 May 2014 10:52:30 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 8A0AC38059; Fri, 23 May 2014 10:52:29 -0500 (CDT) Message-ID: <537F6EBC.3080008@freebsd.org> Date: Fri, 23 May 2014 08:52:28 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Baptiste Daroussin Subject: Re: svn commit: r266553 - head/release/scripts References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> In-Reply-To: <20140523153619.GF72340@ivaldir.etoilebsd.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, Glen Barber , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 15:52:30 -0000 On 05/23/14 08:36, Baptiste Daroussin wrote: > On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: >> Is there any chance of finally switching the pkg abi identifiers to just >> be uname -p? >> -Nathan > Keeping asking won't make it happen, I have explained a large number of time why it > happened, why it is not easy for compatibility and why uname -p is still not > representing the ABI we do support, and what flexibility we need that the > current string offers to us. > > if one is willing to do the work, please be my guess, just dig into the archives > and join the pkg development otherwise: no it won't happen before a while > because we have way too much work on the todo and this item is stored at the > very end of this todo. > > regards, > Bapt I'm happy to do the work, and have volunteered now many times. If uname -p does not describe the ABI fully, then uname -p needs changes on the relevant platforms. Which are they? What extra flexibility does the string give you if uname -p describes the ABI completely? -Nathan From owner-svn-src-head@FreeBSD.ORG Fri May 23 16:20:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C69D607; Fri, 23 May 2014 16:20:26 +0000 (UTC) Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com [IPv6:2a00:1450:400c:c00::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 928892D59; Fri, 23 May 2014 16:20:25 +0000 (UTC) Received: by mail-wg0-f42.google.com with SMTP id y10so4942215wgg.25 for ; Fri, 23 May 2014 09:20:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=Bl+8lJoyNPx9ep72zmMmh6L6XSiSogRWczH26AZWGYE=; b=PZRvKzAmFdJ+gSsIci49REAo1SJIi+olkhzhY6LZlqRCsVZ/aBUDexFbhCSjbez5Y/ GCRJc2eK2HKPM2OxlvoxcLAHNXpZe2kOPsmWI7YuGMGXxndPAc653Ug/HeCYKuj571qr 4DSYpsN84qfgXGwVt2Sau9rwd9gKGfqgfxAbQSeOfMVPWWZRHFQu94zsysPTdtqBA7rI aaipy6C1xGoY/Q1oNFrS63vVzv+Pyx7ibuSZJBx5BaY5LVucfLPxMrLLi5Qr/f6I2kyq pDHnHmBTw479LEhAPFUWsp2kyAO0djaissNWqwuObv+ayWZW2YBvrDb8IB4cNRaa4Dcg yL8Q== X-Received: by 10.180.206.163 with SMTP id lp3mr4163148wic.29.1400862023793; Fri, 23 May 2014 09:20:23 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id wu6sm4429452wjb.46.2014.05.23.09.20.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 May 2014 09:20:22 -0700 (PDT) Sender: Baptiste Daroussin Date: Fri, 23 May 2014 18:20:20 +0200 From: Baptiste Daroussin To: Nathan Whitehorn Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140523162020.GG72340@ivaldir.etoilebsd.net> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5UGlQXeG3ziZS81+" Content-Disposition: inline In-Reply-To: <537F6EBC.3080008@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@FreeBSD.org, Glen Barber , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 16:20:26 -0000 --5UGlQXeG3ziZS81+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: > On 05/23/14 08:36, Baptiste Daroussin wrote: > > On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: > >> Is there any chance of finally switching the pkg abi identifiers to ju= st > >> be uname -p? > >> -Nathan > > Keeping asking won't make it happen, I have explained a large number of= time why it > > happened, why it is not easy for compatibility and why uname -p is stil= l not > > representing the ABI we do support, and what flexibility we need that t= he > > current string offers to us. > > > > if one is willing to do the work, please be my guess, just dig into the= archives > > and join the pkg development otherwise: no it won't happen before a whi= le > > because we have way too much work on the todo and this item is stored a= t the > > very end of this todo. > > > > regards, > > Bapt >=20 > I'm happy to do the work, and have volunteered now many times. If uname= =20 > -p does not describe the ABI fully, then uname -p needs changes on the=20 > relevant platforms. Which are they? What extra flexibility does the=20 > string give you if uname -p describes the ABI completely? > -Nathan just simple examples in armv6: - eabi vs oabi - The different float abi (even if only one is supported for now others are being worked on) - little endian vs big endian the extras flexibilit is being able to say this binary do support freebsd i= 386 and amd64 in one key, freebsd:9:x86:*, or or all arches freebsd:10:* regards, Bapt --5UGlQXeG3ziZS81+ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iEYEARECAAYFAlN/dUQACgkQ8kTtMUmk6Eyk6gCfUQMn/SJJYKW0+3IQGTEDsSlg o38AoLt6koQisAcV7cnF0BoXUhIqU233 =iaZc -----END PGP SIGNATURE----- --5UGlQXeG3ziZS81+-- From owner-svn-src-head@FreeBSD.ORG Fri May 23 16:22:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59115844; Fri, 23 May 2014 16:22:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46A082DE2; Fri, 23 May 2014 16:22:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4NGMbH0024235; Fri, 23 May 2014 16:22:37 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4NGMbNg024234; Fri, 23 May 2014 16:22:37 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201405231622.s4NGMbNg024234@svn.freebsd.org> From: Alan Cox Date: Fri, 23 May 2014 16:22:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266588 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 16:22:37 -0000 Author: alc Date: Fri May 23 16:22:36 2014 New Revision: 266588 URL: http://svnweb.freebsd.org/changeset/base/266588 Log: There is no reason to perform the pmap_remove() on the kernel pmap while the kmem object lock is held. Do the pmap_remove() before acquiring the kmem object lock. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_kern.c Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Fri May 23 14:34:22 2014 (r266587) +++ head/sys/vm/vm_kern.c Fri May 23 16:22:36 2014 (r266588) @@ -396,9 +396,9 @@ kmem_unback(vm_object_t object, vm_offse KASSERT(object == kmem_object || object == kernel_object, ("kmem_unback: only supports kernel objects.")); + pmap_remove(kernel_pmap, addr, addr + size); offset = addr - VM_MIN_KERNEL_ADDRESS; VM_OBJECT_WLOCK(object); - pmap_remove(kernel_pmap, addr, addr + size); for (i = 0; i < size; i += PAGE_SIZE) { m = vm_page_lookup(object, OFF_TO_IDX(offset + i)); vm_page_unwire(m, 0); From owner-svn-src-head@FreeBSD.ORG Fri May 23 16:38:17 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD5E24AB; Fri, 23 May 2014 16:38:17 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 5BBFC2F08; Fri, 23 May 2014 16:38:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 6C5C33806A; Fri, 23 May 2014 11:38:16 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id GRXOqTHxXdho; Fri, 23 May 2014 11:38:16 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id B705338064; Fri, 23 May 2014 11:38:15 -0500 (CDT) Message-ID: <537F7976.3060705@freebsd.org> Date: Fri, 23 May 2014 09:38:14 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Baptiste Daroussin Subject: Re: svn commit: r266553 - head/release/scripts References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> In-Reply-To: <20140523162020.GG72340@ivaldir.etoilebsd.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, Glen Barber , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 16:38:17 -0000 On 05/23/14 09:20, Baptiste Daroussin wrote: > On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: >> On 05/23/14 08:36, Baptiste Daroussin wrote: >>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: >>>> Is there any chance of finally switching the pkg abi identifiers to just >>>> be uname -p? >>>> -Nathan >>> Keeping asking won't make it happen, I have explained a large number of time why it >>> happened, why it is not easy for compatibility and why uname -p is still not >>> representing the ABI we do support, and what flexibility we need that the >>> current string offers to us. >>> >>> if one is willing to do the work, please be my guess, just dig into the archives >>> and join the pkg development otherwise: no it won't happen before a while >>> because we have way too much work on the todo and this item is stored at the >>> very end of this todo. >>> >>> regards, >>> Bapt >> I'm happy to do the work, and have volunteered now many times. If uname >> -p does not describe the ABI fully, then uname -p needs changes on the >> relevant platforms. Which are they? What extra flexibility does the >> string give you if uname -p describes the ABI completely? >> -Nathan > just simple examples in armv6: > - eabi vs oabi OABI is almost entirely dead, and will be entirely dead soon. > - The different float abi (even if only one is supported for now others are > being worked on) armv6 and armv6hf > - little endian vs big endian armv6 and armv6eb (though I think armv6eb support in general has been removed from the tree, but armeb is still there) These all already exist. > the extras flexibilit is being able to say this binary do support freebsd i386 > and amd64 in one key, freebsd:9:x86:*, or or all arches freebsd:10:* > The second one already would work, wouldn't it? Just replacing x86:64 with amd64 won't change anything. The first has to be outweighed by being able to reliably figure out where to fetch from without a lookup table. We also added the kern.supported_archs sysctl last year to all branches to enable figuring out which architectures a given running kernel supports (e.g. amd64 and i386 on most amd64 systems). This was designed specifically to help pkg figure out what packages it can install. -Nathan From owner-svn-src-head@FreeBSD.ORG Fri May 23 16:45:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1E4B786; Fri, 23 May 2014 16:45:28 +0000 (UTC) Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [IPv6:2a00:1450:400c:c00::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9765A2FD1; Fri, 23 May 2014 16:45:27 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id l18so5145706wgh.35 for ; Fri, 23 May 2014 09:45:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=Z5W0eB0X3UGt0ZUnyRWPo47GZw2v0OPkUlKBpnqkY6A=; b=LNzCZN4s8DOiOrusuRKDo4vfcxolEhe0KuXOgMkAOh0Gr98YRubZooYCOh97zBWzfM QvveVi5foSQllnmYKsTcX9jsaiOP8lMNHzfAD/YOl7d8wmtJmy10RWwqMV5T5LLuM3j7 ZpXX8Y1pm7l4VhVyVW7DY0hCmn3jhqgbeu7zqAWHVYx146ZiLLdT5zAldnm8A+tktwL/ xH3M4NiWMe5cmJYSliX5WTrCwNIBavNoZ9/pzCrbGX5AszC/v0T1iK+34wmtv1Mr50w4 27kxYEQBSUyOojFjpHnmKigpEJ3jdUyVl9lPM89qupgnvvvXvwzaOEoUFAr9Hp2ysfrK iotg== X-Received: by 10.180.8.136 with SMTP id r8mr4313203wia.60.1400863524977; Fri, 23 May 2014 09:45:24 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id c2sm4523465wja.18.2014.05.23.09.45.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 May 2014 09:45:24 -0700 (PDT) Sender: Baptiste Daroussin Date: Fri, 23 May 2014 18:45:21 +0200 From: Baptiste Daroussin To: Nathan Whitehorn Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140523164521.GH72340@ivaldir.etoilebsd.net> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <537F7976.3060705@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bygAmIonOAIqBxQB" Content-Disposition: inline In-Reply-To: <537F7976.3060705@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@FreeBSD.org, Glen Barber , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 16:45:28 -0000 --bygAmIonOAIqBxQB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 23, 2014 at 09:38:14AM -0700, Nathan Whitehorn wrote: > On 05/23/14 09:20, Baptiste Daroussin wrote: > > On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: > >> On 05/23/14 08:36, Baptiste Daroussin wrote: > >>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: > >>>> Is there any chance of finally switching the pkg abi identifiers to = just > >>>> be uname -p? > >>>> -Nathan > >>> Keeping asking won't make it happen, I have explained a large number = of time why it > >>> happened, why it is not easy for compatibility and why uname -p is st= ill not > >>> representing the ABI we do support, and what flexibility we need that= the > >>> current string offers to us. > >>> > >>> if one is willing to do the work, please be my guess, just dig into t= he archives > >>> and join the pkg development otherwise: no it won't happen before a w= hile > >>> because we have way too much work on the todo and this item is stored= at the > >>> very end of this todo. > >>> > >>> regards, > >>> Bapt > >> I'm happy to do the work, and have volunteered now many times. If uname > >> -p does not describe the ABI fully, then uname -p needs changes on the > >> relevant platforms. Which are they? What extra flexibility does the > >> string give you if uname -p describes the ABI completely? > >> -Nathan > > just simple examples in armv6: > > - eabi vs oabi >=20 > OABI is almost entirely dead, and will be entirely dead soon. Maybe but still for now it is there and pkg has to work now >=20 > > - The different float abi (even if only one is supported for now others= are > > being worked on) >=20 > armv6 and armv6hf >=20 > > - little endian vs big endian >=20 > armv6 and armv6eb (though I think armv6eb support in general has been=20 > removed from the tree, but armeb is still there) what about combinaison? armv6 + eb + hf? >=20 > These all already exist. >=20 > > the extras flexibilit is being able to say this binary do support freeb= sd i386 > > and amd64 in one key, freebsd:9:x86:*, or or all arches freebsd:10:* > > arm was en example what about mips? >=20 > The second one already would work, wouldn't it? Just replacing x86:64=20 > with amd64 won't change anything. The first has to be outweighed by=20 > being able to reliably figure out where to fetch from without a lookup=20 > table. >=20 > We also added the kern.supported_archs sysctl last year to all branches= =20 > to enable figuring out which architectures a given running kernel=20 > supports (e.g. amd64 and i386 on most amd64 systems). This was designed= =20 > specifically to help pkg figure out what packages it can install. I know, it means that we can switch only when freebsd 8 and 9 are EOL which= means in a couple of years And it defeats cross installation (which is the reason why the ABI supporte= d is read from a binary and not from kernel) and last thing is the current build packages should just work meaning that = we would need to have a kind of mapping table --bygAmIonOAIqBxQB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iEYEARECAAYFAlN/eyEACgkQ8kTtMUmk6Ez5RQCguLMPi4avjhTXGN2uyGfdzO43 OU0AnRWITWirZWTBSWImGXlZeHu3klxi =+FLK -----END PGP SIGNATURE----- --bygAmIonOAIqBxQB-- From owner-svn-src-head@FreeBSD.ORG Fri May 23 17:11:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32B03621; Fri, 23 May 2014 17:11:50 +0000 (UTC) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17CEA22B2; Fri, 23 May 2014 17:11:49 +0000 (UTC) Received: from zeppelin.tachypleus.net (airbears2-136-152-142-26.AirBears2.Berkeley.EDU [136.152.142.26]) (authenticated bits=0) by d.mail.sonic.net (8.14.4/8.14.4) with ESMTP id s4NHBlA0014781 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 23 May 2014 10:11:48 -0700 Message-ID: <537F8153.7080808@freebsd.org> Date: Fri, 23 May 2014 10:11:47 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Baptiste Daroussin Subject: Re: svn commit: r266553 - head/release/scripts References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <537F7976.3060705@freebsd.org> <20140523164521.GH72340@ivaldir.etoilebsd.net> In-Reply-To: <20140523164521.GH72340@ivaldir.etoilebsd.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-ID: C;hCraUp3i4xGhsVMaeQW9yA== M;6A0GU53i4xGhsVMaeQW9yA== Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 17:11:50 -0000 On 05/23/14 09:45, Baptiste Daroussin wrote: > On Fri, May 23, 2014 at 09:38:14AM -0700, Nathan Whitehorn wrote: >> On 05/23/14 09:20, Baptiste Daroussin wrote: >>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: >>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: >>>>>> Is there any chance of finally switching the pkg abi identifiers to just >>>>>> be uname -p? >>>>>> -Nathan >>>>> Keeping asking won't make it happen, I have explained a large number of time why it >>>>> happened, why it is not easy for compatibility and why uname -p is still not >>>>> representing the ABI we do support, and what flexibility we need that the >>>>> current string offers to us. >>>>> >>>>> if one is willing to do the work, please be my guess, just dig into the archives >>>>> and join the pkg development otherwise: no it won't happen before a while >>>>> because we have way too much work on the todo and this item is stored at the >>>>> very end of this todo. >>>>> >>>>> regards, >>>>> Bapt >>>> I'm happy to do the work, and have volunteered now many times. If uname >>>> -p does not describe the ABI fully, then uname -p needs changes on the >>>> relevant platforms. Which are they? What extra flexibility does the >>>> string give you if uname -p describes the ABI completely? >>>> -Nathan >>> just simple examples in armv6: >>> - eabi vs oabi >> OABI is almost entirely dead, and will be entirely dead soon. > Maybe but still for now it is there and pkg has to work now We don't provide packages for ARM. Also, no platforms have defaulted to OABI for a very long time. Not making a distinction was a deliberate decision of the ARM group, since it was meant to be a clean switchover. >>> - The different float abi (even if only one is supported for now others are >>> being worked on) >> armv6 and armv6hf >> >>> - little endian vs big endian >> armv6 and armv6eb (though I think armv6eb support in general has been >> removed from the tree, but armeb is still there) > what about combinaison? armv6 + eb + hf? That would be armv6hfeb, I assume, if FreeBSD actually supported big-endian ARMv6 at all, which it doesn't. >> These all already exist. >> >>> the extras flexibilit is being able to say this binary do support freebsd i386 >>> and amd64 in one key, freebsd:9:x86:*, or or all arches freebsd:10:* >>> > arm was en example what about mips? The same. There is mips64el, mipsel, mips, mips64, etc. that go through all possible combinations. This is true for all platforms and has been for ages. There was a brief period (2007-2010, I think) where some Tier-3 embedded platforms didn't have enough options, but that era was obscure and is long past. >> The second one already would work, wouldn't it? Just replacing x86:64 >> with amd64 won't change anything. The first has to be outweighed by >> being able to reliably figure out where to fetch from without a lookup >> table. >> >> We also added the kern.supported_archs sysctl last year to all branches >> to enable figuring out which architectures a given running kernel >> supports (e.g. amd64 and i386 on most amd64 systems). This was designed >> specifically to help pkg figure out what packages it can install. > I know, it means that we can switch only when freebsd 8 and 9 are EOL which means > in a couple of years Why does it mean that? That doesn't make sense. A couple of symlinks on the FTP server ensure compatibility. For the sysctl, it has been merged all the back to 7. > And it defeats cross installation (which is the reason why the ABI supported is > read from a binary and not from kernel) No. That's the point of the sysctl. > and last thing is the current build packages should just work meaning that we > would need to have a kind of mapping table Sure, as a compat measure. No reason to lock it in forever. You could also detect old-style strings with a warning and install them unconditionally. It's not a big deal. -nathan From owner-svn-src-head@FreeBSD.ORG Fri May 23 17:24:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8892FC4 for ; Fri, 23 May 2014 17:24:39 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A36623E8 for ; Fri, 23 May 2014 17:24:39 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s4NHOdQM034794 for ; Fri, 23 May 2014 17:24:39 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s4NHOd8K034788 for svn-src-head@freebsd.org; Fri, 23 May 2014 17:24:39 GMT (envelope-from bdrewery) Received: (qmail 95965 invoked from network); 23 May 2014 12:24:37 -0500 Received: from unknown (HELO roundcube.xk42.net) (10.10.5.5) by sweb.xzibition.com with SMTP; 23 May 2014 12:24:37 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 23 May 2014 12:24:37 -0500 From: Bryan Drewery To: Nathan Whitehorn Subject: Re: svn commit: r266553 - head/release/scripts Organization: FreeBSD In-Reply-To: <537F8153.7080808@freebsd.org> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <537F7976.3060705@freebsd.org> <20140523164521.GH72340@ivaldir.etoilebsd.net> <537F8153.7080808@freebsd.org> Message-ID: <0087791e401a70e5224e8dc2253b4e40@shatow.net> X-Sender: bdrewery@FreeBSD.org User-Agent: Roundcube Webmail/0.9.5 Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 17:24:39 -0000 On 2014-05-23 12:11, Nathan Whitehorn wrote: > On 05/23/14 09:45, Baptiste Daroussin wrote: >> On Fri, May 23, 2014 at 09:38:14AM -0700, Nathan Whitehorn wrote: >>> On 05/23/14 09:20, Baptiste Daroussin wrote: >>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: >>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: >>>>>>> Is there any chance of finally switching the pkg abi identifiers >>>>>>> to just >>>>>>> be uname -p? >>>>>>> -Nathan >>>>>> Keeping asking won't make it happen, I have explained a large >>>>>> number of time why it >>>>>> happened, why it is not easy for compatibility and why uname -p is >>>>>> still not >>>>>> representing the ABI we do support, and what flexibility we need >>>>>> that the >>>>>> current string offers to us. >>>>>> >>>>>> if one is willing to do the work, please be my guess, just dig >>>>>> into the archives >>>>>> and join the pkg development otherwise: no it won't happen before >>>>>> a while >>>>>> because we have way too much work on the todo and this item is >>>>>> stored at the >>>>>> very end of this todo. >>>>>> >>>>>> regards, >>>>>> Bapt >>>>> I'm happy to do the work, and have volunteered now many times. If >>>>> uname >>>>> -p does not describe the ABI fully, then uname -p needs changes on >>>>> the >>>>> relevant platforms. Which are they? What extra flexibility does the >>>>> string give you if uname -p describes the ABI completely? >>>>> -Nathan >>>> just simple examples in armv6: >>>> - eabi vs oabi >>> OABI is almost entirely dead, and will be entirely dead soon. >> Maybe but still for now it is there and pkg has to work now > > We don't provide packages for ARM. Also, no platforms have defaulted > to OABI for a very long time. Not making a distinction was a > deliberate decision of the ARM group, since it was meant to be a clean > switchover. > >>>> - The different float abi (even if only one is supported for now >>>> others are >>>> being worked on) >>> armv6 and armv6hf >>> >>>> - little endian vs big endian >>> armv6 and armv6eb (though I think armv6eb support in general has been >>> removed from the tree, but armeb is still there) >> what about combinaison? armv6 + eb + hf? > > That would be armv6hfeb, I assume, if FreeBSD actually supported > big-endian ARMv6 at all, which it doesn't. > >>> These all already exist. >>> >>>> the extras flexibilit is being able to say this binary do support >>>> freebsd i386 >>>> and amd64 in one key, freebsd:9:x86:*, or or all arches freebsd:10:* >>>> >> arm was en example what about mips? > > The same. There is mips64el, mipsel, mips, mips64, etc. that go > through all possible combinations. This is true for all platforms and > has been for ages. There was a brief period (2007-2010, I think) where > some Tier-3 embedded platforms didn't have enough options, but that > era was obscure and is long past. > >>> The second one already would work, wouldn't it? Just replacing x86:64 >>> with amd64 won't change anything. The first has to be outweighed by >>> being able to reliably figure out where to fetch from without a >>> lookup >>> table. >>> >>> We also added the kern.supported_archs sysctl last year to all >>> branches >>> to enable figuring out which architectures a given running kernel >>> supports (e.g. amd64 and i386 on most amd64 systems). This was >>> designed >>> specifically to help pkg figure out what packages it can install. >> I know, it means that we can switch only when freebsd 8 and 9 are EOL >> which means >> in a couple of years > > Why does it mean that? That doesn't make sense. A couple of symlinks > on the FTP server ensure compatibility. For the sysctl, it has been > merged all the back to 7. Symlinks are irrelevant for pkg. It may fetch based on ABI in the URL, but once it opens the package it also compares the ABI from the package and repository to the ABI of /bin/sh on the system. So the symlink wouldn't help. > >> And it defeats cross installation (which is the reason why the ABI >> supported is >> read from a binary and not from kernel) > > No. That's the point of the sysctl. > >> and last thing is the current build packages should just work meaning >> that we >> would need to have a kind of mapping table > > Sure, as a compat measure. No reason to lock it in forever. You could > also detect old-style strings with a warning and install them > unconditionally. It's not a big deal. > -nathan -- Regards, Bryan Drewery From owner-svn-src-head@FreeBSD.ORG Fri May 23 17:26:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E215528A; Fri, 23 May 2014 17:26:42 +0000 (UTC) Received: from mail-wg0-x232.google.com (mail-wg0-x232.google.com [IPv6:2a00:1450:400c:c00::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5CEA23FF; Fri, 23 May 2014 17:26:41 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id x12so5083622wgg.21 for ; Fri, 23 May 2014 10:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=JvEeBlA+wY26T4d0GRA7ROfXklBw58pUIPGsxFjXbEc=; b=Lw/pKgyPDnS3G//xTbqfq7+GtAx/spZRc5wbbx8EqTyLzXrQ990B/QKGqs7cXThkMT Eveqq9ralgTyfREYKNIH2Hjpahi5THvUIahln2OZZWJe0dVSNQiNBytvWsLq8rLha3CK yEPxBV8JGbTGwAPVr9dpMCllElEqchOiDLvSACKp/AB8qNgcHVJmsqmtHDYEaaolC61i /6+Ahuplt8gmgffRhTfUT80+sfo0AZ7L8hPBeWTHU+cHXacHr22h1C8Er9sVWThJZF2u YgOXSUXLQmLYIilel4NdvfZ1vpaAfJunQg9+3hSipfBW5MFramkE9Auhs6/xXQufiHS2 Cn+Q== X-Received: by 10.194.1.164 with SMTP id 4mr5501677wjn.17.1400866000065; Fri, 23 May 2014 10:26:40 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id k2sm4645344wjq.20.2014.05.23.10.26.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 May 2014 10:26:39 -0700 (PDT) Sender: Baptiste Daroussin Date: Fri, 23 May 2014 19:26:36 +0200 From: Baptiste Daroussin To: Nathan Whitehorn Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140523172636.GK72340@ivaldir.etoilebsd.net> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <537F7976.3060705@freebsd.org> <20140523164521.GH72340@ivaldir.etoilebsd.net> <537F8153.7080808@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vbzKE9fGfpHIBC6T" Content-Disposition: inline In-Reply-To: <537F8153.7080808@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 17:26:43 -0000 --vbzKE9fGfpHIBC6T Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 23, 2014 at 10:11:47AM -0700, Nathan Whitehorn wrote: >=20 > On 05/23/14 09:45, Baptiste Daroussin wrote: > > On Fri, May 23, 2014 at 09:38:14AM -0700, Nathan Whitehorn wrote: > >> On 05/23/14 09:20, Baptiste Daroussin wrote: > >>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: > >>>> On 05/23/14 08:36, Baptiste Daroussin wrote: > >>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: > >>>>>> Is there any chance of finally switching the pkg abi identifiers t= o just > >>>>>> be uname -p? > >>>>>> -Nathan > >>>>> Keeping asking won't make it happen, I have explained a large numbe= r of time why it > >>>>> happened, why it is not easy for compatibility and why uname -p is = still not > >>>>> representing the ABI we do support, and what flexibility we need th= at the > >>>>> current string offers to us. > >>>>> > >>>>> if one is willing to do the work, please be my guess, just dig into= the archives > >>>>> and join the pkg development otherwise: no it won't happen before a= while > >>>>> because we have way too much work on the todo and this item is stor= ed at the > >>>>> very end of this todo. > >>>>> > >>>>> regards, > >>>>> Bapt > >>>> I'm happy to do the work, and have volunteered now many times. If un= ame > >>>> -p does not describe the ABI fully, then uname -p needs changes on t= he > >>>> relevant platforms. Which are they? What extra flexibility does the > >>>> string give you if uname -p describes the ABI completely? > >>>> -Nathan > >>> just simple examples in armv6: > >>> - eabi vs oabi > >> OABI is almost entirely dead, and will be entirely dead soon. > > Maybe but still for now it is there and pkg has to work now >=20 > We don't provide packages for ARM. Also, no platforms have defaulted to= =20 > OABI for a very long time. Not making a distinction was a deliberate=20 > decision of the ARM group, since it was meant to be a clean switchover. >=20 > >>> - The different float abi (even if only one is supported for now othe= rs are > >>> being worked on) > >> armv6 and armv6hf > >> > >>> - little endian vs big endian > >> armv6 and armv6eb (though I think armv6eb support in general has been > >> removed from the tree, but armeb is still there) > > what about combinaison? armv6 + eb + hf? >=20 > That would be armv6hfeb, I assume, if FreeBSD actually supported=20 > big-endian ARMv6 at all, which it doesn't. >=20 > >> These all already exist. > >> > >>> the extras flexibilit is being able to say this binary do support fre= ebsd i386 > >>> and amd64 in one key, freebsd:9:x86:*, or or all arches freebsd:10:* > >>> > > arm was en example what about mips? >=20 > The same. There is mips64el, mipsel, mips, mips64, etc. that go through= =20 > all possible combinations. This is true for all platforms and has been=20 > for ages. There was a brief period (2007-2010, I think) where some=20 > Tier-3 embedded platforms didn't have enough options, but that era was=20 > obscure and is long past. >=20 > >> The second one already would work, wouldn't it? Just replacing x86:64 > >> with amd64 won't change anything. The first has to be outweighed by > >> being able to reliably figure out where to fetch from without a lookup > >> table. > >> > >> We also added the kern.supported_archs sysctl last year to all branches > >> to enable figuring out which architectures a given running kernel > >> supports (e.g. amd64 and i386 on most amd64 systems). This was designed > >> specifically to help pkg figure out what packages it can install. > > I know, it means that we can switch only when freebsd 8 and 9 are EOL w= hich means > > in a couple of years >=20 > Why does it mean that? That doesn't make sense. A couple of symlinks on= =20 > the FTP server ensure compatibility. For the sysctl, it has been merged= =20 > all the back to 7. So We can switch after 8.4 death which is a good news (except if you say th= at it is in 8.4) >=20 > > And it defeats cross installation (which is the reason why the ABI supp= orted is > > read from a binary and not from kernel) >=20 > No. That's the point of the sysctl. I'm speaking of installing packages in a arm chroot on a amd64 host I will = need to know what arch could be supported by the "content" of the chroot. >=20 > > and last thing is the current build packages should just work meaning t= hat we > > would need to have a kind of mapping table >=20 > Sure, as a compat measure. No reason to lock it in forever. You could=20 > also detect old-style strings with a warning and install them=20 > unconditionally. It's not a big deal. sure but one has to write it :) > -nathan >=20 regards, Bapt --vbzKE9fGfpHIBC6T Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iEYEARECAAYFAlN/hMwACgkQ8kTtMUmk6Ex9mgCbBk7yesPgm0JNLT9LUkA+09pz UdYAnjPMSDStELEef3/zmXWGkDs0iV6G =Hh5Z -----END PGP SIGNATURE----- --vbzKE9fGfpHIBC6T-- From owner-svn-src-head@FreeBSD.ORG Fri May 23 17:33:58 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AC9B53C; Fri, 23 May 2014 17:33:58 +0000 (UTC) Received: from gw.catspoiler.org (gw.catspoiler.org [75.1.14.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFDF124AD; Fri, 23 May 2014 17:33:57 +0000 (UTC) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.3/8.13.3) with ESMTP id s4NHXgFC060060; Fri, 23 May 2014 10:33:46 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201405231733.s4NHXgFC060060@gw.catspoiler.org> Date: Fri, 23 May 2014 10:33:42 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r266587 - head/share/mk To: imp@FreeBSD.org In-Reply-To: <201405231434.s4NEYMHU075537@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 17:33:58 -0000 On 23 May, Warner Losh wrote: > Author: imp > Date: Fri May 23 14:34:22 2014 > New Revision: 266587 > URL: http://svnweb.freebsd.org/changeset/base/266587 > > Log: > Allow CC to not actually exist. During the ports INDEX run, all the > Makefiles are evaluated without building things. In a normal build, > the prerequisites would be built, and CC would be an actual thing. In > an INDEX build, though, they don't exists. Redirect stderr to get rid > of annoying messages, and assume that the compiler version is 0 if the > actual compiler can't tell us. Do this in preference to guessing based > on numbers because gcc410 might be 4.10, or 4.1.0 and without > carefully crafted special knowledge we differentiate between them > easily (also ming-gcc has no clues at all). Elsewhere, don't trust > the compiler version if it is 0. > > Modified: > head/share/mk/bsd.compiler.mk > > Modified: head/share/mk/bsd.compiler.mk > ============================================================================== > --- head/share/mk/bsd.compiler.mk Fri May 23 14:32:57 2014 (r266586) > +++ head/share/mk/bsd.compiler.mk Fri May 23 14:34:22 2014 (r266587) > @@ -21,11 +21,11 @@ > .if !target(____) > ____: > > -_v!= ${CC} --version > +_v!= ${CC} --version 2>/dev/null || echo 0.0.0 > .if !defined(COMPILER_TYPE) > -. if ${CC:T:Mgcc*} > +. if ${CC:T:M*gcc*} > COMPILER_TYPE:= gcc > -. elif ${CC:T:Mclang} > +. elif ${CC:T:M*clang*} > COMPILER_TYPE:= clang > . elif ${_v:Mgcc} > COMPILER_TYPE:= gcc > Thanks! From owner-svn-src-head@FreeBSD.ORG Fri May 23 18:39:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1787F37; Fri, 23 May 2014 18:39:11 +0000 (UTC) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5DA62A66; Fri, 23 May 2014 18:39:11 +0000 (UTC) Received: from zeppelin.tachypleus.net (airbears2-136-152-142-26.AirBears2.Berkeley.EDU [136.152.142.26]) (authenticated bits=0) by d.mail.sonic.net (8.14.4/8.14.4) with ESMTP id s4NId9qe003340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 23 May 2014 11:39:10 -0700 Message-ID: <537F9582.4060400@freebsd.org> Date: Fri, 23 May 2014 11:37:54 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Bryan Drewery Subject: Re: svn commit: r266553 - head/release/scripts References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <537F7976.3060705@freebsd.org> <20140523164521.GH72340@ivaldir.etoilebsd.net> <537F8153.7080808@freebsd.org> <0087791e401a70e5224e8dc2253b4e40@shatow.net> In-Reply-To: <0087791e401a70e5224e8dc2253b4e40@shatow.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-ID: C;XJtQh6ni4xGzF1MaeQW9yA== M;YDp7h6ni4xGzF1MaeQW9yA== Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 18:39:12 -0000 On 05/23/14 10:24, Bryan Drewery wrote: > On 2014-05-23 12:11, Nathan Whitehorn wrote: >> On 05/23/14 09:45, Baptiste Daroussin wrote: >>> On Fri, May 23, 2014 at 09:38:14AM -0700, Nathan Whitehorn wrote: >>>> On 05/23/14 09:20, Baptiste Daroussin wrote: >>>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: >>>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: >>>>>>>> Is there any chance of finally switching the pkg abi >>>>>>>> identifiers to just >>>>>>>> be uname -p? >>>>>>>> -Nathan >>>>>>> Keeping asking won't make it happen, I have explained a large >>>>>>> number of time why it >>>>>>> happened, why it is not easy for compatibility and why uname -p >>>>>>> is still not >>>>>>> representing the ABI we do support, and what flexibility we need >>>>>>> that the >>>>>>> current string offers to us. >>>>>>> >>>>>>> if one is willing to do the work, please be my guess, just dig >>>>>>> into the archives >>>>>>> and join the pkg development otherwise: no it won't happen >>>>>>> before a while >>>>>>> because we have way too much work on the todo and this item is >>>>>>> stored at the >>>>>>> very end of this todo. >>>>>>> >>>>>>> regards, >>>>>>> Bapt >>>>>> I'm happy to do the work, and have volunteered now many times. If >>>>>> uname >>>>>> -p does not describe the ABI fully, then uname -p needs changes >>>>>> on the >>>>>> relevant platforms. Which are they? What extra flexibility does the >>>>>> string give you if uname -p describes the ABI completely? >>>>>> -Nathan >>>>> just simple examples in armv6: >>>>> - eabi vs oabi >>>> OABI is almost entirely dead, and will be entirely dead soon. >>> Maybe but still for now it is there and pkg has to work now >> >> We don't provide packages for ARM. Also, no platforms have defaulted >> to OABI for a very long time. Not making a distinction was a >> deliberate decision of the ARM group, since it was meant to be a clean >> switchover. >> >>>>> - The different float abi (even if only one is supported for now >>>>> others are >>>>> being worked on) >>>> armv6 and armv6hf >>>> >>>>> - little endian vs big endian >>>> armv6 and armv6eb (though I think armv6eb support in general has been >>>> removed from the tree, but armeb is still there) >>> what about combinaison? armv6 + eb + hf? >> >> That would be armv6hfeb, I assume, if FreeBSD actually supported >> big-endian ARMv6 at all, which it doesn't. >> >>>> These all already exist. >>>> >>>>> the extras flexibilit is being able to say this binary do support >>>>> freebsd i386 >>>>> and amd64 in one key, freebsd:9:x86:*, or or all arches freebsd:10:* >>>>> >>> arm was en example what about mips? >> >> The same. There is mips64el, mipsel, mips, mips64, etc. that go >> through all possible combinations. This is true for all platforms and >> has been for ages. There was a brief period (2007-2010, I think) where >> some Tier-3 embedded platforms didn't have enough options, but that >> era was obscure and is long past. >> >>>> The second one already would work, wouldn't it? Just replacing x86:64 >>>> with amd64 won't change anything. The first has to be outweighed by >>>> being able to reliably figure out where to fetch from without a lookup >>>> table. >>>> >>>> We also added the kern.supported_archs sysctl last year to all >>>> branches >>>> to enable figuring out which architectures a given running kernel >>>> supports (e.g. amd64 and i386 on most amd64 systems). This was >>>> designed >>>> specifically to help pkg figure out what packages it can install. >>> I know, it means that we can switch only when freebsd 8 and 9 are >>> EOL which means >>> in a couple of years >> >> Why does it mean that? That doesn't make sense. A couple of symlinks >> on the FTP server ensure compatibility. For the sysctl, it has been >> merged all the back to 7. > > Symlinks are irrelevant for pkg. It may fetch based on ABI in the URL, > but once it opens the package it also compares the ABI from the package > and repository to the ABI of /bin/sh on the system. So the symlink > wouldn't > help. That is a highly questionable design choice. Why not just check MACHINE_ARCH? In any case, packages only exist for i386 and amd64 in the wild in a supported way. Those two can be special cased for compatibility in about two lines of code if you're worried about this. -Nathan From owner-svn-src-head@FreeBSD.ORG Fri May 23 19:01:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21958945; Fri, 23 May 2014 19:01:17 +0000 (UTC) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 058F22CA4; Fri, 23 May 2014 19:01:16 +0000 (UTC) Received: from zeppelin.tachypleus.net (airbears2-136-152-142-8.AirBears2.Berkeley.EDU [136.152.142.8]) (authenticated bits=0) by c.mail.sonic.net (8.14.4/8.14.4) with ESMTP id s4NJ183r029607 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 23 May 2014 12:01:09 -0700 Message-ID: <537F9AF4.1070502@freebsd.org> Date: Fri, 23 May 2014 12:01:08 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Baptiste Daroussin Subject: Re: svn commit: r266553 - head/release/scripts References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <537F7976.3060705@freebsd.org> <20140523164521.GH72340@ivaldir.etoilebsd.net> <537F8153.7080808@freebsd.org> <20140523172636.GK72340@ivaldir.etoilebsd.net> In-Reply-To: <20140523172636.GK72340@ivaldir.etoilebsd.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-ID: C;mJxTmazi4xGv41dpoNQ8UQ== M;emKSmazi4xGv41dpoNQ8UQ== Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 19:01:17 -0000 On 05/23/14 10:26, Baptiste Daroussin wrote: > On Fri, May 23, 2014 at 10:11:47AM -0700, Nathan Whitehorn wrote: >> On 05/23/14 09:45, Baptiste Daroussin wrote: >>> On Fri, May 23, 2014 at 09:38:14AM -0700, Nathan Whitehorn wrote: >>>> On 05/23/14 09:20, Baptiste Daroussin wrote: >>>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: >>>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: >>>>>>>> Is there any chance of finally switching the pkg abi identifiers to just >>>>>>>> be uname -p? >>>>>>>> -Nathan >>>>>>> Keeping asking won't make it happen, I have explained a large number of time why it >>>>>>> happened, why it is not easy for compatibility and why uname -p is still not >>>>>>> representing the ABI we do support, and what flexibility we need that the >>>>>>> current string offers to us. >>>>>>> >>>>>>> if one is willing to do the work, please be my guess, just dig into the archives >>>>>>> and join the pkg development otherwise: no it won't happen before a while >>>>>>> because we have way too much work on the todo and this item is stored at the >>>>>>> very end of this todo. >>>>>>> >>>>>>> regards, >>>>>>> Bapt >>>>>> I'm happy to do the work, and have volunteered now many times. If uname >>>>>> -p does not describe the ABI fully, then uname -p needs changes on the >>>>>> relevant platforms. Which are they? What extra flexibility does the >>>>>> string give you if uname -p describes the ABI completely? >>>>>> -Nathan >>>>> just simple examples in armv6: >>>>> - eabi vs oabi >>>> OABI is almost entirely dead, and will be entirely dead soon. >>> Maybe but still for now it is there and pkg has to work now >> We don't provide packages for ARM. Also, no platforms have defaulted to >> OABI for a very long time. Not making a distinction was a deliberate >> decision of the ARM group, since it was meant to be a clean switchover. >> >>>>> - The different float abi (even if only one is supported for now others are >>>>> being worked on) >>>> armv6 and armv6hf >>>> >>>>> - little endian vs big endian >>>> armv6 and armv6eb (though I think armv6eb support in general has been >>>> removed from the tree, but armeb is still there) >>> what about combinaison? armv6 + eb + hf? >> That would be armv6hfeb, I assume, if FreeBSD actually supported >> big-endian ARMv6 at all, which it doesn't. >> >>>> These all already exist. >>>> >>>>> the extras flexibilit is being able to say this binary do support freebsd i386 >>>>> and amd64 in one key, freebsd:9:x86:*, or or all arches freebsd:10:* >>>>> >>> arm was en example what about mips? >> The same. There is mips64el, mipsel, mips, mips64, etc. that go through >> all possible combinations. This is true for all platforms and has been >> for ages. There was a brief period (2007-2010, I think) where some >> Tier-3 embedded platforms didn't have enough options, but that era was >> obscure and is long past. >> >>>> The second one already would work, wouldn't it? Just replacing x86:64 >>>> with amd64 won't change anything. The first has to be outweighed by >>>> being able to reliably figure out where to fetch from without a lookup >>>> table. >>>> >>>> We also added the kern.supported_archs sysctl last year to all branches >>>> to enable figuring out which architectures a given running kernel >>>> supports (e.g. amd64 and i386 on most amd64 systems). This was designed >>>> specifically to help pkg figure out what packages it can install. >>> I know, it means that we can switch only when freebsd 8 and 9 are EOL which means >>> in a couple of years >> Why does it mean that? That doesn't make sense. A couple of symlinks on >> the FTP server ensure compatibility. For the sysctl, it has been merged >> all the back to 7. > So We can switch after 8.4 death which is a good news (except if you say that it > is in 8.4) It means we can do it now. Very few people install i386 packages on amd64 anyway. It means people with very old releases on old branches might face a warning in an unusual situation. Not a big deal. Since we only provide i386 and amd64 packages anyway, this is also a trivial special case if you really want that. >>> And it defeats cross installation (which is the reason why the ABI supported is >>> read from a binary and not from kernel) >> No. That's the point of the sysctl. > I'm speaking of installing packages in a arm chroot on a amd64 host I will need > to know what arch could be supported by the "content" of the chroot. uname -p in the chroot (I guess this is with qemu) should return the right answer, just as it does with an i386 chroot. If it doesn't, something is broken in the qemu user mode support. >>> and last thing is the current build packages should just work meaning that we >>> would need to have a kind of mapping table >> Sure, as a compat measure. No reason to lock it in forever. You could >> also detect old-style strings with a warning and install them >> unconditionally. It's not a big deal. > sure but one has to write it :) > That's fine. I'm happy to. -Nathan From owner-svn-src-head@FreeBSD.ORG Fri May 23 19:27:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75168E97; Fri, 23 May 2014 19:27:07 +0000 (UTC) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AC342E70; Fri, 23 May 2014 19:27:06 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id r20so1345565wiv.7 for ; Fri, 23 May 2014 12:27:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=lCrNXcIqHFUCaT8nvON/rH4x250NldTY1KtT+YwDgis=; b=enn78PD64ofon7wBwViSd632VAYjn1mg+af8h6J3Vrs8CrkLjpEeEYNZlem16SZg2F TYJzyW5/x7EUuGfrAbwJH3JZEma+vgQ+VQhx7bJcFNTQxxBsw0OBWD5Y3MuOrEdwAFRO x5nrChkmY+AZkGhoupwSDyO6cwGL6kU5/G3jCJRqP9TtLNPWhSgbNPly98bv5X0Qn9Ih mvGnGhJ6Lo+FKv9tBed9PqiNVuhZHPU/Yd5CDLc4bLrD0J4mtVM5fCARNZZDe2k02zpB IbzZ5eqxRMNHNLVbJSdwv6/xGkHhGii13dJLmW31kXb+z1bUzSPNZCCHr55US1TtAmtl OCNg== X-Received: by 10.180.94.98 with SMTP id db2mr5082908wib.1.1400873224781; Fri, 23 May 2014 12:27:04 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id rw4sm4975127wjb.44.2014.05.23.12.27.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 May 2014 12:27:03 -0700 (PDT) Sender: Baptiste Daroussin Date: Fri, 23 May 2014 21:27:01 +0200 From: Baptiste Daroussin To: Nathan Whitehorn Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140523192701.GL72340@ivaldir.etoilebsd.net> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <537F7976.3060705@freebsd.org> <20140523164521.GH72340@ivaldir.etoilebsd.net> <537F8153.7080808@freebsd.org> <20140523172636.GK72340@ivaldir.etoilebsd.net> <537F9AF4.1070502@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="c8JyeaiReRNoiMDS" Content-Disposition: inline In-Reply-To: <537F9AF4.1070502@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 19:27:07 -0000 --c8JyeaiReRNoiMDS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 23, 2014 at 12:01:08PM -0700, Nathan Whitehorn wrote: >=20 > On 05/23/14 10:26, Baptiste Daroussin wrote: > > On Fri, May 23, 2014 at 10:11:47AM -0700, Nathan Whitehorn wrote: > >> On 05/23/14 09:45, Baptiste Daroussin wrote: > >>> On Fri, May 23, 2014 at 09:38:14AM -0700, Nathan Whitehorn wrote: > >>>> On 05/23/14 09:20, Baptiste Daroussin wrote: > >>>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: > >>>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: > >>>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: > >>>>>>>> Is there any chance of finally switching the pkg abi identifiers= to just > >>>>>>>> be uname -p? > >>>>>>>> -Nathan > >>>>>>> Keeping asking won't make it happen, I have explained a large num= ber of time why it > >>>>>>> happened, why it is not easy for compatibility and why uname -p i= s still not > >>>>>>> representing the ABI we do support, and what flexibility we need = that the > >>>>>>> current string offers to us. > >>>>>>> > >>>>>>> if one is willing to do the work, please be my guess, just dig in= to the archives > >>>>>>> and join the pkg development otherwise: no it won't happen before= a while > >>>>>>> because we have way too much work on the todo and this item is st= ored at the > >>>>>>> very end of this todo. > >>>>>>> > >>>>>>> regards, > >>>>>>> Bapt > >>>>>> I'm happy to do the work, and have volunteered now many times. If = uname > >>>>>> -p does not describe the ABI fully, then uname -p needs changes on= the > >>>>>> relevant platforms. Which are they? What extra flexibility does the > >>>>>> string give you if uname -p describes the ABI completely? > >>>>>> -Nathan > >>>>> just simple examples in armv6: > >>>>> - eabi vs oabi > >>>> OABI is almost entirely dead, and will be entirely dead soon. > >>> Maybe but still for now it is there and pkg has to work now > >> We don't provide packages for ARM. Also, no platforms have defaulted to > >> OABI for a very long time. Not making a distinction was a deliberate > >> decision of the ARM group, since it was meant to be a clean switchover. > >> > >>>>> - The different float abi (even if only one is supported for now ot= hers are > >>>>> being worked on) > >>>> armv6 and armv6hf > >>>> > >>>>> - little endian vs big endian > >>>> armv6 and armv6eb (though I think armv6eb support in general has been > >>>> removed from the tree, but armeb is still there) > >>> what about combinaison? armv6 + eb + hf? > >> That would be armv6hfeb, I assume, if FreeBSD actually supported > >> big-endian ARMv6 at all, which it doesn't. > >> > >>>> These all already exist. > >>>> > >>>>> the extras flexibilit is being able to say this binary do support f= reebsd i386 > >>>>> and amd64 in one key, freebsd:9:x86:*, or or all arches freebsd:10:* > >>>>> > >>> arm was en example what about mips? > >> The same. There is mips64el, mipsel, mips, mips64, etc. that go through > >> all possible combinations. This is true for all platforms and has been > >> for ages. There was a brief period (2007-2010, I think) where some > >> Tier-3 embedded platforms didn't have enough options, but that era was > >> obscure and is long past. > >> > >>>> The second one already would work, wouldn't it? Just replacing x86:64 > >>>> with amd64 won't change anything. The first has to be outweighed by > >>>> being able to reliably figure out where to fetch from without a look= up > >>>> table. > >>>> > >>>> We also added the kern.supported_archs sysctl last year to all branc= hes > >>>> to enable figuring out which architectures a given running kernel > >>>> supports (e.g. amd64 and i386 on most amd64 systems). This was desig= ned > >>>> specifically to help pkg figure out what packages it can install. > >>> I know, it means that we can switch only when freebsd 8 and 9 are EOL= which means > >>> in a couple of years > >> Why does it mean that? That doesn't make sense. A couple of symlinks on > >> the FTP server ensure compatibility. For the sysctl, it has been merged > >> all the back to 7. > > So We can switch after 8.4 death which is a good news (except if you sa= y that it > > is in 8.4) >=20 > It means we can do it now. Very few people install i386 packages on=20 > amd64 anyway. It means people with very old releases on old branches=20 > might face a warning in an unusual situation. Not a big deal. Since we=20 > only provide i386 and amd64 packages anyway, this is also a trivial=20 > special case if you really want that. >=20 > >>> And it defeats cross installation (which is the reason why the ABI su= pported is > >>> read from a binary and not from kernel) > >> No. That's the point of the sysctl. > > I'm speaking of installing packages in a arm chroot on a amd64 host I w= ill need > > to know what arch could be supported by the "content" of the chroot. >=20 > uname -p in the chroot (I guess this is with qemu) should return the=20 > right answer, just as it does with an i386 chroot. If it doesn't,=20 > something is broken in the qemu user mode support. nope that is not with qemu it is basically cross buildworld, install in a destdir, install packages in that destdir which is a very common usage that= a lot do expect to work >=20 > >>> and last thing is the current build packages should just work meaning= that we > >>> would need to have a kind of mapping table > >> Sure, as a compat measure. No reason to lock it in forever. You could > >> also detect old-style strings with a warning and install them > >> unconditionally. It's not a big deal. > > sure but one has to write it :) > > >=20 > That's fine. I'm happy to. > -Nathan > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" --c8JyeaiReRNoiMDS Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iEYEARECAAYFAlN/oQUACgkQ8kTtMUmk6Ey5VACeKoOCqibxWc4XnEBpniIQ4zFe w74An3j+oPNGb2Q9vAP8pvovK7/Vr6YG =1bbm -----END PGP SIGNATURE----- --c8JyeaiReRNoiMDS-- From owner-svn-src-head@FreeBSD.ORG Fri May 23 19:59:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 836357BD; Fri, 23 May 2014 19:59:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FA4320C2; Fri, 23 May 2014 19:59:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4NJxF1a021389; Fri, 23 May 2014 19:59:15 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4NJxEx3021385; Fri, 23 May 2014 19:59:14 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405231959.s4NJxEx3021385@svn.freebsd.org> From: Neel Natu Date: Fri, 23 May 2014 19:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266595 - in head: sys/amd64/include sys/amd64/vmm usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 19:59:15 -0000 Author: neel Date: Fri May 23 19:59:14 2014 New Revision: 266595 URL: http://svnweb.freebsd.org/changeset/base/266595 Log: Check for alignment check violation when processing in/out string instructions. Modified: head/sys/amd64/include/vmm_instruction_emul.h head/sys/amd64/vmm/vmm_instruction_emul.c head/sys/amd64/vmm/vmm_ioport.c head/usr.sbin/bhyve/inout.c Modified: head/sys/amd64/include/vmm_instruction_emul.h ============================================================================== --- head/sys/amd64/include/vmm_instruction_emul.h Fri May 23 19:43:20 2014 (r266594) +++ head/sys/amd64/include/vmm_instruction_emul.h Fri May 23 19:59:14 2014 (r266595) @@ -116,6 +116,14 @@ int vmm_emulate_instruction(void *vm, in int vie_update_register(void *vm, int vcpuid, enum vm_reg_name reg, uint64_t val, int size); +/* + * Returns 1 if an alignment check exception should be injected and 0 otherwise. + */ +int vie_alignment_check(int cpl, int operand_size, uint64_t cr0, + uint64_t rflags, uint64_t gla); + +uint64_t vie_size2mask(int size); + #ifdef _KERNEL /* * APIs to fetch and decode the instruction from nested page fault handler. @@ -139,8 +147,6 @@ int vmm_gla2gpa(struct vm *vm, int vcpui void vie_init(struct vie *vie); -uint64_t vie_size2mask(int size); - uint64_t vie_segbase(enum vm_reg_name segment, enum vie_cpu_mode cpu_mode, const struct seg_desc *desc); Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Fri May 23 19:43:20 2014 (r266594) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Fri May 23 19:59:14 2014 (r266595) @@ -47,9 +47,14 @@ __FBSDID("$FreeBSD$"); #include +#include #include +#define KASSERT(exp,msg) assert((exp)) #endif /* _KERNEL */ +#include +#include + /* struct vie_op.op_type */ enum { VIE_OP_TYPE_NONE = 0, @@ -561,6 +566,27 @@ vmm_emulate_instruction(void *vm, int vc return (error); } +int +vie_alignment_check(int cpl, int size, uint64_t cr0, uint64_t rf, uint64_t gla) +{ + KASSERT(size == 1 || size == 2 || size == 4 || size == 8, + ("%s: invalid size %d", __func__, size)); + KASSERT(cpl >= 0 && cpl <= 3, ("%s: invalid cpl %d", __func__, cpl)); + + if (cpl != 3 || (cr0 & CR0_AM) == 0 || (rf & PSL_AC) == 0) + return (0); + + return ((gla & (size - 1)) ? 1 : 0); +} + +uint64_t +vie_size2mask(int size) +{ + KASSERT(size == 1 || size == 2 || size == 4 || size == 8, + ("vie_size2mask: invalid size %d", size)); + return (size2mask[size]); +} + #ifdef _KERNEL void vie_init(struct vie *vie) @@ -1220,14 +1246,6 @@ vmm_decode_instruction(struct vm *vm, in } uint64_t -vie_size2mask(int size) -{ - KASSERT(size == 1 || size == 2 || size == 4 || size == 8, - ("vie_size2mask: invalid size %d", size)); - return (size2mask[size]); -} - -uint64_t vie_segbase(enum vm_reg_name seg, enum vie_cpu_mode cpu_mode, const struct seg_desc *desc) { Modified: head/sys/amd64/vmm/vmm_ioport.c ============================================================================== --- head/sys/amd64/vmm/vmm_ioport.c Fri May 23 19:43:20 2014 (r266594) +++ head/sys/amd64/vmm/vmm_ioport.c Fri May 23 19:59:14 2014 (r266595) @@ -144,7 +144,7 @@ emulate_inout_str(struct vm *vm, int vcp { struct vm_inout_str *vis; uint64_t gla, index, segbase; - int bytes, error, in; + int error, in; vis = &vmexit->u.inout_str; in = vis->inout.in; @@ -162,14 +162,10 @@ emulate_inout_str(struct vm *vm, int vcp /* * XXX - * inout string emulation only supported in 64-bit mode and only - * for byte instructions. + * inout string emulation only supported in 64-bit mode. * * The #GP(0) fault conditions described above don't apply in * 64-bit mode. - * - * The #AC(0) fault condition described above does not apply - * because byte accesses don't have alignment constraints. */ if (vis->cpu_mode != CPU_MODE_64BIT) { VCPU_CTR1(vm, vcpuid, "ins/outs not emulated in cpu mode %d", @@ -177,13 +173,6 @@ emulate_inout_str(struct vm *vm, int vcp return (EINVAL); } - bytes = vis->inout.bytes; - if (bytes != 1) { - VCPU_CTR1(vm, vcpuid, "ins/outs operand size %d not supported", - bytes); - return (EINVAL); - } - /* * XXX insb/insw/insd instructions not emulated at this time. */ Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Fri May 23 19:43:20 2014 (r266594) +++ head/usr.sbin/bhyve/inout.c Fri May 23 19:59:14 2014 (r266595) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -110,13 +111,6 @@ emulate_inout(struct vmctx *ctx, int vcp uint64_t index, count; struct vm_inout_str *vis; - static uint64_t size2mask[] = { - [1] = 0xff, - [2] = 0xffff, - [4] = 0xffffffff, - [8] = 0xffffffffffffffff, - }; - bytes = vmexit->u.inout.bytes; in = vmexit->u.inout.in; port = vmexit->u.inout.port; @@ -149,15 +143,22 @@ emulate_inout(struct vmctx *ctx, int vcp /* Index register */ idxreg = in ? VM_REG_GUEST_RDI : VM_REG_GUEST_RSI; - index = vis->index & size2mask[addrsize]; + index = vis->index & vie_size2mask(addrsize); /* Count register */ - count = vis->count & size2mask[addrsize]; + count = vis->count & vie_size2mask(addrsize); gpa = vis->gpa; gpaend = rounddown(gpa + PAGE_SIZE, PAGE_SIZE); gva = paddr_guest2host(ctx, gpa, gpaend - gpa); + if (vie_alignment_check(vis->cpl, bytes, vis->cr0, + vis->rflags, vis->gla)) { + error = vm_inject_exception2(ctx, vcpu, IDT_AC, 0); + assert(error == 0); + return (INOUT_RESTART); + } + while (count != 0 && gpa < gpaend) { /* * XXX this may not work for unaligned accesses because @@ -209,12 +210,12 @@ emulate_inout(struct vmctx *ctx, int vcp retval = INOUT_RESTART; } else { if (!in) { - val = vmexit->u.inout.eax & size2mask[bytes]; + val = vmexit->u.inout.eax & vie_size2mask(bytes); } retval = handler(ctx, vcpu, in, port, bytes, &val, arg); if (retval == 0 && in) { - vmexit->u.inout.eax &= ~size2mask[bytes]; - vmexit->u.inout.eax |= val & size2mask[bytes]; + vmexit->u.inout.eax &= ~vie_size2mask(bytes); + vmexit->u.inout.eax |= val & vie_size2mask(bytes); } } return (retval); From owner-svn-src-head@FreeBSD.ORG Fri May 23 20:15:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C245DFDA; Fri, 23 May 2014 20:15:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A36892264; Fri, 23 May 2014 20:15:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4NKF2bg030490; Fri, 23 May 2014 20:15:02 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4NKF2Hc030483; Fri, 23 May 2014 20:15:02 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201405232015.s4NKF2Hc030483@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 23 May 2014 20:15:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266596 - in head/sys: dev/cxgbe/tom netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 20:15:02 -0000 Author: bz Date: Fri May 23 20:15:01 2014 New Revision: 266596 URL: http://svnweb.freebsd.org/changeset/base/266596 Log: Move the tcp_fields_to_host() and tcp_fields_to_net() (inline) functions to the tcp_var.h header file in order to avoid further duplication with upcoming commits. Reviewed by: np MFC after: 2 weeks Modified: head/sys/dev/cxgbe/tom/t4_listen.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_var.h Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Fri May 23 19:59:14 2014 (r266595) +++ head/sys/dev/cxgbe/tom/t4_listen.c Fri May 23 20:15:01 2014 (r266596) @@ -1052,17 +1052,6 @@ calc_opt2p(struct adapter *sc, struct po return htobe32(opt2); } -/* XXX: duplication. */ -static inline void -tcp_fields_to_host(struct tcphdr *th) -{ - - th->th_seq = ntohl(th->th_seq); - th->th_ack = ntohl(th->th_ack); - th->th_win = ntohs(th->th_win); - th->th_urp = ntohs(th->th_urp); -} - static void pass_accept_req_to_protohdrs(const struct mbuf *m, struct in_conninfo *inc, struct tcphdr *th) Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri May 23 19:59:14 2014 (r266595) +++ head/sys/netinet/tcp_input.c Fri May 23 20:15:01 2014 (r266596) @@ -455,27 +455,7 @@ cc_post_recovery(struct tcpcb *tp, struc tp->t_bytes_acked = 0; } -static inline void -tcp_fields_to_host(struct tcphdr *th) -{ - - th->th_seq = ntohl(th->th_seq); - th->th_ack = ntohl(th->th_ack); - th->th_win = ntohs(th->th_win); - th->th_urp = ntohs(th->th_urp); -} - #ifdef TCP_SIGNATURE -static inline void -tcp_fields_to_net(struct tcphdr *th) -{ - - th->th_seq = htonl(th->th_seq); - th->th_ack = htonl(th->th_ack); - th->th_win = htons(th->th_win); - th->th_urp = htons(th->th_urp); -} - static inline int tcp_signature_verify_input(struct mbuf *m, int off0, int tlen, int optlen, struct tcpopt *to, struct tcphdr *th, u_int tcpbflag) Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Fri May 23 19:59:14 2014 (r266595) +++ head/sys/netinet/tcp_var.h Fri May 23 20:15:01 2014 (r266596) @@ -719,6 +719,27 @@ u_long tcp_seq_subtract(u_long, u_long void cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type); +static inline void +tcp_fields_to_host(struct tcphdr *th) +{ + + th->th_seq = ntohl(th->th_seq); + th->th_ack = ntohl(th->th_ack); + th->th_win = ntohs(th->th_win); + th->th_urp = ntohs(th->th_urp); +} + +#ifdef TCP_SIGNATURE +static inline void +tcp_fields_to_net(struct tcphdr *th) +{ + + th->th_seq = htonl(th->th_seq); + th->th_ack = htonl(th->th_ack); + th->th_win = htons(th->th_win); + th->th_urp = htons(th->th_urp); +} +#endif #endif /* _KERNEL */ #endif /* _NETINET_TCP_VAR_H_ */ From owner-svn-src-head@FreeBSD.ORG Fri May 23 21:12:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18365321; Fri, 23 May 2014 21:12:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 059232738; Fri, 23 May 2014 21:12:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4NLCXYU057112; Fri, 23 May 2014 21:12:33 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4NLCXSu057111; Fri, 23 May 2014 21:12:33 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201405232112.s4NLCXSu057111@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 23 May 2014 21:12:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266597 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 21:12:34 -0000 Author: bz Date: Fri May 23 21:12:33 2014 New Revision: 266597 URL: http://svnweb.freebsd.org/changeset/base/266597 Log: Remove the prototypes for things that are no longer file local but were moved to the header file. Pointy hat to: clang || bz MFC after: 2 weeks X-MFC with: r266596 Reported by: gcc build of sparc64 Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri May 23 20:15:01 2014 (r266596) +++ head/sys/netinet/tcp_input.c Fri May 23 21:12:33 2014 (r266597) @@ -229,9 +229,7 @@ static void tcp_pulloutofband(struct so struct tcphdr *, struct mbuf *, int); static void tcp_xmit_timer(struct tcpcb *, int); static void tcp_newreno_partial_ack(struct tcpcb *, struct tcphdr *); -static void inline tcp_fields_to_host(struct tcphdr *); #ifdef TCP_SIGNATURE -static void inline tcp_fields_to_net(struct tcphdr *); static int inline tcp_signature_verify_input(struct mbuf *, int, int, int, struct tcpopt *, struct tcphdr *, u_int); #endif From owner-svn-src-head@FreeBSD.ORG Fri May 23 21:19:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1BB9A585; Fri, 23 May 2014 21:19:13 +0000 (UTC) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F281F2775; Fri, 23 May 2014 21:19:12 +0000 (UTC) Received: from zeppelin.tachypleus.net (airbears2-136-152-142-24.AirBears2.Berkeley.EDU [136.152.142.24]) (authenticated bits=0) by d.mail.sonic.net (8.14.4/8.14.4) with ESMTP id s4NLJAEV025486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 23 May 2014 14:19:10 -0700 Message-ID: <537FBB4E.2010409@freebsd.org> Date: Fri, 23 May 2014 14:19:10 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Baptiste Daroussin Subject: Re: svn commit: r266553 - head/release/scripts References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <537F7976.3060705@freebsd.org> <20140523164521.GH72340@ivaldir.etoilebsd.net> <537F8153.7080808@freebsd.org> <20140523172636.GK72340@ivaldir.etoilebsd.net> <537F9AF4.1070502@freebsd.org> <20140523192701.GL72340@ivaldir.etoilebsd.net> In-Reply-To: <20140523192701.GL72340@ivaldir.etoilebsd.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-ID: C;jJGg4b/i4xGGAlMaeQW9yA== M;TkPI4b/i4xGGAlMaeQW9yA== Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 21:19:13 -0000 On 05/23/14 12:27, Baptiste Daroussin wrote: > On Fri, May 23, 2014 at 12:01:08PM -0700, Nathan Whitehorn wrote: >> On 05/23/14 10:26, Baptiste Daroussin wrote: >>> On Fri, May 23, 2014 at 10:11:47AM -0700, Nathan Whitehorn wrote: >>>> On 05/23/14 09:45, Baptiste Daroussin wrote: >>>>> On Fri, May 23, 2014 at 09:38:14AM -0700, Nathan Whitehorn wrote: >>>>>> On 05/23/14 09:20, Baptiste Daroussin wrote: >>>>>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: >>>>>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: >>>>>>>>>> Is there any chance of finally switching the pkg abi identifiers to just >>>>>>>>>> be uname -p? >>>>>>>>>> -Nathan >>>>>>>>> Keeping asking won't make it happen, I have explained a large number of time why it >>>>>>>>> happened, why it is not easy for compatibility and why uname -p is still not >>>>>>>>> representing the ABI we do support, and what flexibility we need that the >>>>>>>>> current string offers to us. >>>>>>>>> >>>>>>>>> if one is willing to do the work, please be my guess, just dig into the archives >>>>>>>>> and join the pkg development otherwise: no it won't happen before a while >>>>>>>>> because we have way too much work on the todo and this item is stored at the >>>>>>>>> very end of this todo. >>>>>>>>> >>>>>>>>> regards, >>>>>>>>> Bapt >>>>>>>> I'm happy to do the work, and have volunteered now many times. If uname >>>>>>>> -p does not describe the ABI fully, then uname -p needs changes on the >>>>>>>> relevant platforms. Which are they? What extra flexibility does the >>>>>>>> string give you if uname -p describes the ABI completely? >>>>>>>> -Nathan >>>>>>> just simple examples in armv6: >>>>>>> - eabi vs oabi >>>>>> OABI is almost entirely dead, and will be entirely dead soon. >>>>> Maybe but still for now it is there and pkg has to work now >>>> We don't provide packages for ARM. Also, no platforms have defaulted to >>>> OABI for a very long time. Not making a distinction was a deliberate >>>> decision of the ARM group, since it was meant to be a clean switchover. >>>> >>>>>>> - The different float abi (even if only one is supported for now others are >>>>>>> being worked on) >>>>>> armv6 and armv6hf >>>>>> >>>>>>> - little endian vs big endian >>>>>> armv6 and armv6eb (though I think armv6eb support in general has been >>>>>> removed from the tree, but armeb is still there) >>>>> what about combinaison? armv6 + eb + hf? >>>> That would be armv6hfeb, I assume, if FreeBSD actually supported >>>> big-endian ARMv6 at all, which it doesn't. >>>> >>>>>> These all already exist. >>>>>> >>>>>>> the extras flexibilit is being able to say this binary do support freebsd i386 >>>>>>> and amd64 in one key, freebsd:9:x86:*, or or all arches freebsd:10:* >>>>>>> >>>>> arm was en example what about mips? >>>> The same. There is mips64el, mipsel, mips, mips64, etc. that go through >>>> all possible combinations. This is true for all platforms and has been >>>> for ages. There was a brief period (2007-2010, I think) where some >>>> Tier-3 embedded platforms didn't have enough options, but that era was >>>> obscure and is long past. >>>> >>>>>> The second one already would work, wouldn't it? Just replacing x86:64 >>>>>> with amd64 won't change anything. The first has to be outweighed by >>>>>> being able to reliably figure out where to fetch from without a lookup >>>>>> table. >>>>>> >>>>>> We also added the kern.supported_archs sysctl last year to all branches >>>>>> to enable figuring out which architectures a given running kernel >>>>>> supports (e.g. amd64 and i386 on most amd64 systems). This was designed >>>>>> specifically to help pkg figure out what packages it can install. >>>>> I know, it means that we can switch only when freebsd 8 and 9 are EOL which means >>>>> in a couple of years >>>> Why does it mean that? That doesn't make sense. A couple of symlinks on >>>> the FTP server ensure compatibility. For the sysctl, it has been merged >>>> all the back to 7. >>> So We can switch after 8.4 death which is a good news (except if you say that it >>> is in 8.4) >> It means we can do it now. Very few people install i386 packages on >> amd64 anyway. It means people with very old releases on old branches >> might face a warning in an unusual situation. Not a big deal. Since we >> only provide i386 and amd64 packages anyway, this is also a trivial >> special case if you really want that. >> >>>>> And it defeats cross installation (which is the reason why the ABI supported is >>>>> read from a binary and not from kernel) >>>> No. That's the point of the sysctl. >>> I'm speaking of installing packages in a arm chroot on a amd64 host I will need >>> to know what arch could be supported by the "content" of the chroot. >> uname -p in the chroot (I guess this is with qemu) should return the >> right answer, just as it does with an i386 chroot. If it doesn't, >> something is broken in the qemu user mode support. > nope that is not with qemu it is basically cross buildworld, install in a > destdir, install packages in that destdir which is a very common usage that a > lot do expect to work > Knowing a priori which architectures are "supported" by a chroot based on ELF type of /bin/sh doesn't even work. How do you know what kernel will be running in there and how it will be configured? You don't. IA64 can -- sometimes -- run i386 binaries, for example. amd64 may or may not be able to run i386, depending on kernel options. In any case, I wouldn't really characterize this situation as "common" in any sense -- and I don't even see why it applies to this discussion. Whatever logic calculates your own private version of architecture strings can calculate the correct ones. Allowing it to ignore the architecture optionally, just like you how you already have to add flags to install in a chroot, would also work. Lots of things like that. This issue is basically wholly unrelated to whether you use normal architecture strings or not. I'm perfectly happy to write 100% of the code to enable pkg to use the same architecture strings that the rest of the operating system uses. Having private ones is just a recipe for confusion. From this discussion, there don't seem to be any actually existing reasons why MACHINE_ARCH doesn't work for this. -Nathan From owner-svn-src-head@FreeBSD.ORG Fri May 23 21:34:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F43EA1D for ; Fri, 23 May 2014 21:34:09 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3DD028C9 for ; Fri, 23 May 2014 21:34:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s4NLY8S5017773 for ; Fri, 23 May 2014 21:34:08 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s4NLY8RH017764 for svn-src-head@freebsd.org; Fri, 23 May 2014 21:34:08 GMT (envelope-from bdrewery) Received: (qmail 1027 invoked from network); 23 May 2014 16:34:07 -0500 Received: from unknown (HELO roundcube.xk42.net) (10.10.5.5) by sweb.xzibition.com with SMTP; 23 May 2014 16:34:07 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 23 May 2014 16:34:06 -0500 From: Bryan Drewery To: Nathan Whitehorn Subject: Re: svn commit: r266553 - head/release/scripts Organization: FreeBSD In-Reply-To: <537FBB4E.2010409@freebsd.org> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <537F7976.3060705@freebsd.org> <20140523164521.GH72340@ivaldir.etoilebsd.net> <537F8153.7080808@freebsd.org> <20140523172636.GK72340@ivaldir.etoilebsd.net> <537F9AF4.1070502@freebsd.org> <20140523192701.GL72340@ivaldir.etoilebsd.net> <537FBB4E.2010409@freebsd.org> Message-ID: <8740c21d1e7467ea0e0355c5d05729c9@shatow.net> X-Sender: bdrewery@FreeBSD.org User-Agent: Roundcube Webmail/0.9.5 Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 21:34:09 -0000 On 2014-05-23 16:19, Nathan Whitehorn wrote: > On 05/23/14 12:27, Baptiste Daroussin wrote: >> On Fri, May 23, 2014 at 12:01:08PM -0700, Nathan Whitehorn wrote: >>> On 05/23/14 10:26, Baptiste Daroussin wrote: >>>> On Fri, May 23, 2014 at 10:11:47AM -0700, Nathan Whitehorn wrote: >>>>> On 05/23/14 09:45, Baptiste Daroussin wrote: >>>>>> On Fri, May 23, 2014 at 09:38:14AM -0700, Nathan Whitehorn wrote: >>>>>>> On 05/23/14 09:20, Baptiste Daroussin wrote: >>>>>>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn >>>>>>>> wrote: >>>>>>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>>>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn >>>>>>>>>> wrote: >>>>>>>>>>> Is there any chance of finally switching the pkg abi >>>>>>>>>>> identifiers to just >>>>>>>>>>> be uname -p? >>>>>>>>>>> -Nathan >>>>>>>>>> Keeping asking won't make it happen, I have explained a large >>>>>>>>>> number of time why it >>>>>>>>>> happened, why it is not easy for compatibility and why uname >>>>>>>>>> -p is still not >>>>>>>>>> representing the ABI we do support, and what flexibility we >>>>>>>>>> need that the >>>>>>>>>> current string offers to us. >>>>>>>>>> >>>>>>>>>> if one is willing to do the work, please be my guess, just dig >>>>>>>>>> into the archives >>>>>>>>>> and join the pkg development otherwise: no it won't happen >>>>>>>>>> before a while >>>>>>>>>> because we have way too much work on the todo and this item is >>>>>>>>>> stored at the >>>>>>>>>> very end of this todo. >>>>>>>>>> >>>>>>>>>> regards, >>>>>>>>>> Bapt >>>>>>>>> I'm happy to do the work, and have volunteered now many times. >>>>>>>>> If uname >>>>>>>>> -p does not describe the ABI fully, then uname -p needs changes >>>>>>>>> on the >>>>>>>>> relevant platforms. Which are they? What extra flexibility does >>>>>>>>> the >>>>>>>>> string give you if uname -p describes the ABI completely? >>>>>>>>> -Nathan >>>>>>>> just simple examples in armv6: >>>>>>>> - eabi vs oabi >>>>>>> OABI is almost entirely dead, and will be entirely dead soon. >>>>>> Maybe but still for now it is there and pkg has to work now >>>>> We don't provide packages for ARM. Also, no platforms have >>>>> defaulted to >>>>> OABI for a very long time. Not making a distinction was a >>>>> deliberate >>>>> decision of the ARM group, since it was meant to be a clean >>>>> switchover. >>>>> >>>>>>>> - The different float abi (even if only one is supported for now >>>>>>>> others are >>>>>>>> being worked on) >>>>>>> armv6 and armv6hf >>>>>>> >>>>>>>> - little endian vs big endian >>>>>>> armv6 and armv6eb (though I think armv6eb support in general has >>>>>>> been >>>>>>> removed from the tree, but armeb is still there) >>>>>> what about combinaison? armv6 + eb + hf? >>>>> That would be armv6hfeb, I assume, if FreeBSD actually supported >>>>> big-endian ARMv6 at all, which it doesn't. >>>>> >>>>>>> These all already exist. >>>>>>> >>>>>>>> the extras flexibilit is being able to say this binary do >>>>>>>> support freebsd i386 >>>>>>>> and amd64 in one key, freebsd:9:x86:*, or or all arches >>>>>>>> freebsd:10:* >>>>>>>> >>>>>> arm was en example what about mips? >>>>> The same. There is mips64el, mipsel, mips, mips64, etc. that go >>>>> through >>>>> all possible combinations. This is true for all platforms and has >>>>> been >>>>> for ages. There was a brief period (2007-2010, I think) where some >>>>> Tier-3 embedded platforms didn't have enough options, but that era >>>>> was >>>>> obscure and is long past. >>>>> >>>>>>> The second one already would work, wouldn't it? Just replacing >>>>>>> x86:64 >>>>>>> with amd64 won't change anything. The first has to be outweighed >>>>>>> by >>>>>>> being able to reliably figure out where to fetch from without a >>>>>>> lookup >>>>>>> table. >>>>>>> >>>>>>> We also added the kern.supported_archs sysctl last year to all >>>>>>> branches >>>>>>> to enable figuring out which architectures a given running kernel >>>>>>> supports (e.g. amd64 and i386 on most amd64 systems). This was >>>>>>> designed >>>>>>> specifically to help pkg figure out what packages it can install. >>>>>> I know, it means that we can switch only when freebsd 8 and 9 are >>>>>> EOL which means >>>>>> in a couple of years >>>>> Why does it mean that? That doesn't make sense. A couple of >>>>> symlinks on >>>>> the FTP server ensure compatibility. For the sysctl, it has been >>>>> merged >>>>> all the back to 7. >>>> So We can switch after 8.4 death which is a good news (except if you >>>> say that it >>>> is in 8.4) >>> It means we can do it now. Very few people install i386 packages on >>> amd64 anyway. It means people with very old releases on old branches >>> might face a warning in an unusual situation. Not a big deal. Since >>> we >>> only provide i386 and amd64 packages anyway, this is also a trivial >>> special case if you really want that. >>> >>>>>> And it defeats cross installation (which is the reason why the ABI >>>>>> supported is >>>>>> read from a binary and not from kernel) >>>>> No. That's the point of the sysctl. >>>> I'm speaking of installing packages in a arm chroot on a amd64 host >>>> I will need >>>> to know what arch could be supported by the "content" of the chroot. >>> uname -p in the chroot (I guess this is with qemu) should return the >>> right answer, just as it does with an i386 chroot. If it doesn't, >>> something is broken in the qemu user mode support. >> nope that is not with qemu it is basically cross buildworld, install >> in a >> destdir, install packages in that destdir which is a very common usage >> that a >> lot do expect to work >> > > Knowing a priori which architectures are "supported" by a chroot based > on ELF type of /bin/sh doesn't even work. How do you know what kernel > will be running in there and how it will be configured? You don't. > IA64 can -- sometimes -- run i386 binaries, for example. amd64 may or > may not be able to run i386, depending on kernel options. > You're assuming that you would only use a chroot to RUN things. This is also useful for building images. Install a world into a chroot, run pkg -c install whatever and it picks the right ABI. Just an example. > In any case, I wouldn't really characterize this situation as "common" > in any sense -- and I don't even see why it applies to this > discussion. Whatever logic calculates your own private version of > architecture strings can calculate the correct ones. Allowing it to > ignore the architecture optionally, just like you how you already have > to add flags to install in a chroot, would also work. Lots of things > like that. This issue is basically wholly unrelated to whether you use > normal architecture strings or not. > > I'm perfectly happy to write 100% of the code to enable pkg to use the > same architecture strings that the rest of the operating system uses. > Having private ones is just a recipe for confusion. From this > discussion, there don't seem to be any actually existing reasons why > MACHINE_ARCH doesn't work for this. pkg is *not* FreeBSD-specific. Is MACHINE_ARCH portable? > -Nathan -- Regards, Bryan Drewery From owner-svn-src-head@FreeBSD.ORG Fri May 23 21:39:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A236DD96; Fri, 23 May 2014 21:39:11 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F720291F; Fri, 23 May 2014 21:39:11 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s4NLdA4p025925 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 23 May 2014 14:39:10 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s4NLdAtx025924; Fri, 23 May 2014 14:39:10 -0700 (PDT) (envelope-from jmg) Date: Fri, 23 May 2014 14:39:10 -0700 From: John-Mark Gurney To: Bryan Drewery Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140523213909.GV43976@funkthat.com> References: <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <537F7976.3060705@freebsd.org> <20140523164521.GH72340@ivaldir.etoilebsd.net> <537F8153.7080808@freebsd.org> <20140523172636.GK72340@ivaldir.etoilebsd.net> <537F9AF4.1070502@freebsd.org> <20140523192701.GL72340@ivaldir.etoilebsd.net> <537FBB4E.2010409@freebsd.org> <8740c21d1e7467ea0e0355c5d05729c9@shatow.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8740c21d1e7467ea0e0355c5d05729c9@shatow.net> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Fri, 23 May 2014 14:39:10 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, Nathan Whitehorn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 21:39:11 -0000 Bryan Drewery wrote this message on Fri, May 23, 2014 at 16:34 -0500: > On 2014-05-23 16:19, Nathan Whitehorn wrote: > >Knowing a priori which architectures are "supported" by a chroot based > >on ELF type of /bin/sh doesn't even work. How do you know what kernel > >will be running in there and how it will be configured? You don't. > >IA64 can -- sometimes -- run i386 binaries, for example. amd64 may or > >may not be able to run i386, depending on kernel options. > > > > You're assuming that you would only use a chroot to RUN things. This is > also useful for building images. Install a world into a chroot, run > pkg -c install whatever and it picks the right ABI. Just an example. Will there be a mode to output an mtree file (or append to one) w/ the correct permissions? We are slowly moving to not requiring root to build images, and if you now need to have root to chroot or chown files, then it won't be as useful for building images... Right now I'm looking at tools/tools/makeroot that allows merging of mtree files, which will allow us to easily customize the built image.. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Fri May 23 23:15:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BDF5F1C; Fri, 23 May 2014 23:15:08 +0000 (UTC) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D13E2FBF; Fri, 23 May 2014 23:15:07 +0000 (UTC) Received: from zeppelin.tachypleus.net (airbears2-136-152-142-24.AirBears2.Berkeley.EDU [136.152.142.24]) (authenticated bits=0) by c.mail.sonic.net (8.14.4/8.14.4) with ESMTP id s4NNF53W027771 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 23 May 2014 16:15:06 -0700 Message-ID: <537FD679.6020503@freebsd.org> Date: Fri, 23 May 2014 16:15:05 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Bryan Drewery Subject: Re: svn commit: r266553 - head/release/scripts References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <537F7976.3060705@freebsd.org> <20140523164521.GH72340@ivaldir.etoilebsd.net> <537F8153.7080808@freebsd.org> <20140523172636.GK72340@ivaldir.etoilebsd.net> <537F9AF4.1070502@freebsd.org> <20140523192701.GL72340@ivaldir.etoilebsd.net> <537FBB4E.2010409@freebsd.org> <8740c21d1e7467ea0e0355c5d05729c9@shatow.net> In-Reply-To: <8740c21d1e7467ea0e0355c5d05729c9@shatow.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-ID: C;QthcE9Di4xGh6GiuoNQ8UQ== M;WvyJE9Di4xGh6GiuoNQ8UQ== Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 23:15:08 -0000 On 05/23/14 14:34, Bryan Drewery wrote: > On 2014-05-23 16:19, Nathan Whitehorn wrote: >> On 05/23/14 12:27, Baptiste Daroussin wrote: >>> On Fri, May 23, 2014 at 12:01:08PM -0700, Nathan Whitehorn wrote: >>>> On 05/23/14 10:26, Baptiste Daroussin wrote: >>>>> On Fri, May 23, 2014 at 10:11:47AM -0700, Nathan Whitehorn wrote: >>>>>> On 05/23/14 09:45, Baptiste Daroussin wrote: >>>>>>> On Fri, May 23, 2014 at 09:38:14AM -0700, Nathan Whitehorn wrote: >>>>>>>> On 05/23/14 09:20, Baptiste Daroussin wrote: >>>>>>>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: >>>>>>>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>>>>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn >>>>>>>>>>> wrote: >>>>>>>>>>>> Is there any chance of finally switching the pkg abi >>>>>>>>>>>> identifiers to just >>>>>>>>>>>> be uname -p? >>>>>>>>>>>> -Nathan >>>>>>>>>>> Keeping asking won't make it happen, I have explained a >>>>>>>>>>> large number of time why it >>>>>>>>>>> happened, why it is not easy for compatibility and why uname >>>>>>>>>>> -p is still not >>>>>>>>>>> representing the ABI we do support, and what flexibility we >>>>>>>>>>> need that the >>>>>>>>>>> current string offers to us. >>>>>>>>>>> >>>>>>>>>>> if one is willing to do the work, please be my guess, just >>>>>>>>>>> dig into the archives >>>>>>>>>>> and join the pkg development otherwise: no it won't happen >>>>>>>>>>> before a while >>>>>>>>>>> because we have way too much work on the todo and this item >>>>>>>>>>> is stored at the >>>>>>>>>>> very end of this todo. >>>>>>>>>>> >>>>>>>>>>> regards, >>>>>>>>>>> Bapt >>>>>>>>>> I'm happy to do the work, and have volunteered now many >>>>>>>>>> times. If uname >>>>>>>>>> -p does not describe the ABI fully, then uname -p needs >>>>>>>>>> changes on the >>>>>>>>>> relevant platforms. Which are they? What extra flexibility >>>>>>>>>> does the >>>>>>>>>> string give you if uname -p describes the ABI completely? >>>>>>>>>> -Nathan >>>>>>>>> just simple examples in armv6: >>>>>>>>> - eabi vs oabi >>>>>>>> OABI is almost entirely dead, and will be entirely dead soon. >>>>>>> Maybe but still for now it is there and pkg has to work now >>>>>> We don't provide packages for ARM. Also, no platforms have >>>>>> defaulted to >>>>>> OABI for a very long time. Not making a distinction was a deliberate >>>>>> decision of the ARM group, since it was meant to be a clean >>>>>> switchover. >>>>>> >>>>>>>>> - The different float abi (even if only one is supported for >>>>>>>>> now others are >>>>>>>>> being worked on) >>>>>>>> armv6 and armv6hf >>>>>>>> >>>>>>>>> - little endian vs big endian >>>>>>>> armv6 and armv6eb (though I think armv6eb support in general >>>>>>>> has been >>>>>>>> removed from the tree, but armeb is still there) >>>>>>> what about combinaison? armv6 + eb + hf? >>>>>> That would be armv6hfeb, I assume, if FreeBSD actually supported >>>>>> big-endian ARMv6 at all, which it doesn't. >>>>>> >>>>>>>> These all already exist. >>>>>>>> >>>>>>>>> the extras flexibilit is being able to say this binary do >>>>>>>>> support freebsd i386 >>>>>>>>> and amd64 in one key, freebsd:9:x86:*, or or all arches >>>>>>>>> freebsd:10:* >>>>>>>>> >>>>>>> arm was en example what about mips? >>>>>> The same. There is mips64el, mipsel, mips, mips64, etc. that go >>>>>> through >>>>>> all possible combinations. This is true for all platforms and has >>>>>> been >>>>>> for ages. There was a brief period (2007-2010, I think) where some >>>>>> Tier-3 embedded platforms didn't have enough options, but that >>>>>> era was >>>>>> obscure and is long past. >>>>>> >>>>>>>> The second one already would work, wouldn't it? Just replacing >>>>>>>> x86:64 >>>>>>>> with amd64 won't change anything. The first has to be >>>>>>>> outweighed by >>>>>>>> being able to reliably figure out where to fetch from without a >>>>>>>> lookup >>>>>>>> table. >>>>>>>> >>>>>>>> We also added the kern.supported_archs sysctl last year to all >>>>>>>> branches >>>>>>>> to enable figuring out which architectures a given running kernel >>>>>>>> supports (e.g. amd64 and i386 on most amd64 systems). This was >>>>>>>> designed >>>>>>>> specifically to help pkg figure out what packages it can install. >>>>>>> I know, it means that we can switch only when freebsd 8 and 9 >>>>>>> are EOL which means >>>>>>> in a couple of years >>>>>> Why does it mean that? That doesn't make sense. A couple of >>>>>> symlinks on >>>>>> the FTP server ensure compatibility. For the sysctl, it has been >>>>>> merged >>>>>> all the back to 7. >>>>> So We can switch after 8.4 death which is a good news (except if >>>>> you say that it >>>>> is in 8.4) >>>> It means we can do it now. Very few people install i386 packages on >>>> amd64 anyway. It means people with very old releases on old branches >>>> might face a warning in an unusual situation. Not a big deal. Since we >>>> only provide i386 and amd64 packages anyway, this is also a trivial >>>> special case if you really want that. >>>> >>>>>>> And it defeats cross installation (which is the reason why the >>>>>>> ABI supported is >>>>>>> read from a binary and not from kernel) >>>>>> No. That's the point of the sysctl. >>>>> I'm speaking of installing packages in a arm chroot on a amd64 >>>>> host I will need >>>>> to know what arch could be supported by the "content" of the chroot. >>>> uname -p in the chroot (I guess this is with qemu) should return the >>>> right answer, just as it does with an i386 chroot. If it doesn't, >>>> something is broken in the qemu user mode support. >>> nope that is not with qemu it is basically cross buildworld, install >>> in a >>> destdir, install packages in that destdir which is a very common >>> usage that a >>> lot do expect to work >>> >> >> Knowing a priori which architectures are "supported" by a chroot based >> on ELF type of /bin/sh doesn't even work. How do you know what kernel >> will be running in there and how it will be configured? You don't. >> IA64 can -- sometimes -- run i386 binaries, for example. amd64 may or >> may not be able to run i386, depending on kernel options. >> > > You're assuming that you would only use a chroot to RUN things. This is > also useful for building images. Install a world into a chroot, run > pkg -c install whatever and it picks the right ABI. Just an example. No, I'm not. Suppose you make an amd64 jail and install an i386 package into it. That's fine (or is potentially fine anyway). But there is no way to be sure since whether it's fine or not depends on the kernel you happen to run. >> In any case, I wouldn't really characterize this situation as "common" >> in any sense -- and I don't even see why it applies to this >> discussion. Whatever logic calculates your own private version of >> architecture strings can calculate the correct ones. Allowing it to >> ignore the architecture optionally, just like you how you already have >> to add flags to install in a chroot, would also work. Lots of things >> like that. This issue is basically wholly unrelated to whether you use >> normal architecture strings or not. >> >> I'm perfectly happy to write 100% of the code to enable pkg to use the >> same architecture strings that the rest of the operating system uses. >> Having private ones is just a recipe for confusion. From this >> discussion, there don't seem to be any actually existing reasons why >> MACHINE_ARCH doesn't work for this. > > pkg is *not* FreeBSD-specific. Is MACHINE_ARCH portable? Yes, of course. I think it's part of POSIX. The GNU and OS X versions of uname have it anyway. I'm really quite mystified why you're so insistent on having your own private ABI identifier strings. If you're really set on this, I of course can't make you change. As you note, pkg is not something that lives in FreeBSD and I have no power to change it. And, from this conversation, I now strongly suspect that if I did put in the work to fix this, my patch would be ignored or rejected. But it does mystify me. -Nathan From owner-svn-src-head@FreeBSD.ORG Fri May 23 23:22:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA4C925B for ; Fri, 23 May 2014 23:22:27 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 646CD2071 for ; Fri, 23 May 2014 23:22:27 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id tp5so5533083ieb.25 for ; Fri, 23 May 2014 16:22:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:content-type:mime-version:subject :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=SteCm+eSClQsCe1oek3UqDfeHwH8wNdehU20aW9hrBc=; b=RofpZ9Wvha5h23fXcns3+amktqBuEEasWZosZwNpcl/qygybK+Kdzad1VtNxMnzOyc Vli5xVYL+mz5ILKGnAGqEiFaMU9NlNfPaF23+H1dJivDnedwU1YU51wfy57uCLEwAqnU Fc/NGibNcs9PMV9ETMz4F2enOuz5GQ0WK1YUc0df7NMJy3KZQb9PLM3GBrWFx0wJj2oT 4PEKluJceRBi7JLwNlEmsQTbT9iBiOY4DGEdPiLYyamSd5laisaGHlixuGbLol96yQ12 uHKU+E1leB1AqaFWuMWohZFZUxOplRmYnt5hj+iZnmHelvowzjg4mvwTJ0ajnK+R4paP XMig== X-Gm-Message-State: ALoCoQmNjv3FcAqKILhpJl76+1YMVWO6o+BpMyJZuCVbsVFswEEJNSDOPAxVkGOmZzWBsW1hgJIH X-Received: by 10.42.84.131 with SMTP id m3mr8006168icl.18.1400887340745; Fri, 23 May 2014 16:22:20 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id ri2sm7515747igc.1.2014.05.23.16.22.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 16:22:20 -0700 (PDT) Sender: Warner Losh From: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266553 - head/release/scripts In-Reply-To: <8740c21d1e7467ea0e0355c5d05729c9@shatow.net> Date: Fri, 23 May 2014 17:22:26 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <537F7976.3060705@freebsd.org> <20140523164521.GH72340@ivaldir.etoilebsd.net> <537F8153.7080808@freebsd.org> <20140523172636.GK72340@ivaldir.etoilebsd.net> <537F9AF4.1070502@freebsd.org> <20140523192701.GL72340@ivaldir.etoilebsd.net> <537FBB4E.2010409@freebsd.org> <8740c21d1e7467ea0e0355c5d05729c9@shatow.net> To: Bryan Drewery X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, Nathan Whitehorn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 23:22:27 -0000 On May 23, 2014, at 3:34 PM, Bryan Drewery wrote: > On 2014-05-23 16:19, Nathan Whitehorn wrote: >> On 05/23/14 12:27, Baptiste Daroussin wrote: >>> On Fri, May 23, 2014 at 12:01:08PM -0700, Nathan Whitehorn wrote: >>>> On 05/23/14 10:26, Baptiste Daroussin wrote: >>>>> On Fri, May 23, 2014 at 10:11:47AM -0700, Nathan Whitehorn wrote: >>>>>> On 05/23/14 09:45, Baptiste Daroussin wrote: >>>>>>> On Fri, May 23, 2014 at 09:38:14AM -0700, Nathan Whitehorn = wrote: >>>>>>>> On 05/23/14 09:20, Baptiste Daroussin wrote: >>>>>>>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn = wrote: >>>>>>>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>>>>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn = wrote: >>>>>>>>>>>> Is there any chance of finally switching the pkg abi = identifiers to just >>>>>>>>>>>> be uname -p? >>>>>>>>>>>> -Nathan >>>>>>>>>>> Keeping asking won't make it happen, I have explained a = large number of time why it >>>>>>>>>>> happened, why it is not easy for compatibility and why uname = -p is still not >>>>>>>>>>> representing the ABI we do support, and what flexibility we = need that the >>>>>>>>>>> current string offers to us. >>>>>>>>>>> if one is willing to do the work, please be my guess, just = dig into the archives >>>>>>>>>>> and join the pkg development otherwise: no it won't happen = before a while >>>>>>>>>>> because we have way too much work on the todo and this item = is stored at the >>>>>>>>>>> very end of this todo. >>>>>>>>>>> regards, >>>>>>>>>>> Bapt >>>>>>>>>> I'm happy to do the work, and have volunteered now many = times. If uname >>>>>>>>>> -p does not describe the ABI fully, then uname -p needs = changes on the >>>>>>>>>> relevant platforms. Which are they? What extra flexibility = does the >>>>>>>>>> string give you if uname -p describes the ABI completely? >>>>>>>>>> -Nathan >>>>>>>>> just simple examples in armv6: >>>>>>>>> - eabi vs oabi >>>>>>>> OABI is almost entirely dead, and will be entirely dead soon. >>>>>>> Maybe but still for now it is there and pkg has to work now >>>>>> We don't provide packages for ARM. Also, no platforms have = defaulted to >>>>>> OABI for a very long time. Not making a distinction was a = deliberate >>>>>> decision of the ARM group, since it was meant to be a clean = switchover. >>>>>>>>> - The different float abi (even if only one is supported for = now others are >>>>>>>>> being worked on) >>>>>>>> armv6 and armv6hf >>>>>>>>> - little endian vs big endian >>>>>>>> armv6 and armv6eb (though I think armv6eb support in general = has been >>>>>>>> removed from the tree, but armeb is still there) >>>>>>> what about combinaison? armv6 + eb + hf? >>>>>> That would be armv6hfeb, I assume, if FreeBSD actually supported >>>>>> big-endian ARMv6 at all, which it doesn't. >>>>>>>> These all already exist. >>>>>>>>> the extras flexibilit is being able to say this binary do = support freebsd i386 >>>>>>>>> and amd64 in one key, freebsd:9:x86:*, or or all arches = freebsd:10:* >>>>>>> arm was en example what about mips? >>>>>> The same. There is mips64el, mipsel, mips, mips64, etc. that go = through >>>>>> all possible combinations. This is true for all platforms and has = been >>>>>> for ages. There was a brief period (2007-2010, I think) where = some >>>>>> Tier-3 embedded platforms didn't have enough options, but that = era was >>>>>> obscure and is long past. >>>>>>>> The second one already would work, wouldn't it? Just replacing = x86:64 >>>>>>>> with amd64 won't change anything. The first has to be = outweighed by >>>>>>>> being able to reliably figure out where to fetch from without a = lookup >>>>>>>> table. >>>>>>>> We also added the kern.supported_archs sysctl last year to all = branches >>>>>>>> to enable figuring out which architectures a given running = kernel >>>>>>>> supports (e.g. amd64 and i386 on most amd64 systems). This was = designed >>>>>>>> specifically to help pkg figure out what packages it can = install. >>>>>>> I know, it means that we can switch only when freebsd 8 and 9 = are EOL which means >>>>>>> in a couple of years >>>>>> Why does it mean that? That doesn't make sense. A couple of = symlinks on >>>>>> the FTP server ensure compatibility. For the sysctl, it has been = merged >>>>>> all the back to 7. >>>>> So We can switch after 8.4 death which is a good news (except if = you say that it >>>>> is in 8.4) >>>> It means we can do it now. Very few people install i386 packages on >>>> amd64 anyway. It means people with very old releases on old = branches >>>> might face a warning in an unusual situation. Not a big deal. Since = we >>>> only provide i386 and amd64 packages anyway, this is also a trivial >>>> special case if you really want that. >>>>>>> And it defeats cross installation (which is the reason why the = ABI supported is >>>>>>> read from a binary and not from kernel) >>>>>> No. That's the point of the sysctl. >>>>> I'm speaking of installing packages in a arm chroot on a amd64 = host I will need >>>>> to know what arch could be supported by the "content" of the = chroot. >>>> uname -p in the chroot (I guess this is with qemu) should return = the >>>> right answer, just as it does with an i386 chroot. If it doesn't, >>>> something is broken in the qemu user mode support. >>> nope that is not with qemu it is basically cross buildworld, install = in a >>> destdir, install packages in that destdir which is a very common = usage that a >>> lot do expect to work >> Knowing a priori which architectures are "supported" by a chroot = based >> on ELF type of /bin/sh doesn't even work. How do you know what kernel >> will be running in there and how it will be configured? You don't. >> IA64 can -- sometimes -- run i386 binaries, for example. amd64 may or >> may not be able to run i386, depending on kernel options. >=20 > You're assuming that you would only use a chroot to RUN things. This = is > also useful for building images. Install a world into a chroot, run > pkg -c install whatever and it picks the right ABI. Just an example. >=20 >> In any case, I wouldn't really characterize this situation as = "common" >> in any sense -- and I don't even see why it applies to this >> discussion. Whatever logic calculates your own private version of >> architecture strings can calculate the correct ones. Allowing it to >> ignore the architecture optionally, just like you how you already = have >> to add flags to install in a chroot, would also work. Lots of things >> like that. This issue is basically wholly unrelated to whether you = use >> normal architecture strings or not. >> I'm perfectly happy to write 100% of the code to enable pkg to use = the >> same architecture strings that the rest of the operating system uses. >> Having private ones is just a recipe for confusion. =46rom this >> discussion, there don't seem to be any actually existing reasons why >> MACHINE_ARCH doesn't work for this. >=20 > pkg is *not* FreeBSD-specific. Is MACHINE_ARCH portable? MACHINE_ARCH needs to be the basic unit on FreeBSD. Outside of FreeBSD, = all bets are off sure, but if we don=92t have an easy way to get from = MACHINE_ARCH to the pkg string, then we=92ve already lost. What is the specific reason to not use MACHINE_ARCH? I=92ve not seen one = clearly articulated in this thread that makes any sense. Warner= From owner-svn-src-head@FreeBSD.ORG Fri May 23 23:22:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1E0B2BC; Fri, 23 May 2014 23:22:45 +0000 (UTC) Received: from mail-we0-x229.google.com (mail-we0-x229.google.com [IPv6:2a00:1450:400c:c03::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A31482075; Fri, 23 May 2014 23:22:44 +0000 (UTC) Received: by mail-we0-f169.google.com with SMTP id u56so5546190wes.28 for ; Fri, 23 May 2014 16:22:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=xvjwsAL2TIgDrTrpyDHu9cWUObxjU1cbqv4ivaMZWYs=; b=SlJAD4MPOXfPzZ6trp227JB2rnpXO5EXk1xDFYCL1+CyXr9gFZ526s0Dd01BuyZuoO RhD1dL/3NDhv8F/p1IoUTByU7goSgQDz6hrpl3eM+rLXJVzvKcariFS3ngzp2yJ9dve4 ye9HbtnaBCPShXeteBqZuK0cDcQ9GSAr2/RB55bDFMLlszRimsTnGKOGOpFHO+X8e+dT iIVoMy6tYFLVF8A42WeCI1Cz8FrkOQXK9E2RPZ3ckAJp8RPHiJ5AJg2M5yGYZC0b7Mx8 +0L+OHs4QX0GYTPeZMrMyMX62Ro9z388TRF3O0LPXaV6NA6bMS5pTPhxrA4ToEjVsHEH KPWQ== X-Received: by 10.194.120.68 with SMTP id la4mr7435501wjb.40.1400887362834; Fri, 23 May 2014 16:22:42 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id g10sm6040053wjs.33.2014.05.23.16.22.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 May 2014 16:22:41 -0700 (PDT) Sender: Baptiste Daroussin Date: Sat, 24 May 2014 01:22:39 +0200 From: Baptiste Daroussin To: Nathan Whitehorn Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140523232239.GA9268@ivaldir.etoilebsd.net> References: <20140523162020.GG72340@ivaldir.etoilebsd.net> <537F7976.3060705@freebsd.org> <20140523164521.GH72340@ivaldir.etoilebsd.net> <537F8153.7080808@freebsd.org> <20140523172636.GK72340@ivaldir.etoilebsd.net> <537F9AF4.1070502@freebsd.org> <20140523192701.GL72340@ivaldir.etoilebsd.net> <537FBB4E.2010409@freebsd.org> <8740c21d1e7467ea0e0355c5d05729c9@shatow.net> <537FD679.6020503@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YZ5djTAD1cGYuMQK" Content-Disposition: inline In-Reply-To: <537FD679.6020503@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bryan Drewery X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 23:22:45 -0000 --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 23, 2014 at 04:15:05PM -0700, Nathan Whitehorn wrote: >=20 > On 05/23/14 14:34, Bryan Drewery wrote: > > On 2014-05-23 16:19, Nathan Whitehorn wrote: > >> On 05/23/14 12:27, Baptiste Daroussin wrote: > >>> On Fri, May 23, 2014 at 12:01:08PM -0700, Nathan Whitehorn wrote: > >>>> On 05/23/14 10:26, Baptiste Daroussin wrote: > >>>>> On Fri, May 23, 2014 at 10:11:47AM -0700, Nathan Whitehorn wrote: > >>>>>> On 05/23/14 09:45, Baptiste Daroussin wrote: > >>>>>>> On Fri, May 23, 2014 at 09:38:14AM -0700, Nathan Whitehorn wrote: > >>>>>>>> On 05/23/14 09:20, Baptiste Daroussin wrote: > >>>>>>>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrot= e: > >>>>>>>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: > >>>>>>>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn=20 > >>>>>>>>>>> wrote: > >>>>>>>>>>>> Is there any chance of finally switching the pkg abi=20 > >>>>>>>>>>>> identifiers to just > >>>>>>>>>>>> be uname -p? > >>>>>>>>>>>> -Nathan > >>>>>>>>>>> Keeping asking won't make it happen, I have explained a=20 > >>>>>>>>>>> large number of time why it > >>>>>>>>>>> happened, why it is not easy for compatibility and why uname= =20 > >>>>>>>>>>> -p is still not > >>>>>>>>>>> representing the ABI we do support, and what flexibility we= =20 > >>>>>>>>>>> need that the > >>>>>>>>>>> current string offers to us. > >>>>>>>>>>> > >>>>>>>>>>> if one is willing to do the work, please be my guess, just=20 > >>>>>>>>>>> dig into the archives > >>>>>>>>>>> and join the pkg development otherwise: no it won't happen=20 > >>>>>>>>>>> before a while > >>>>>>>>>>> because we have way too much work on the todo and this item= =20 > >>>>>>>>>>> is stored at the > >>>>>>>>>>> very end of this todo. > >>>>>>>>>>> > >>>>>>>>>>> regards, > >>>>>>>>>>> Bapt > >>>>>>>>>> I'm happy to do the work, and have volunteered now many=20 > >>>>>>>>>> times. If uname > >>>>>>>>>> -p does not describe the ABI fully, then uname -p needs=20 > >>>>>>>>>> changes on the > >>>>>>>>>> relevant platforms. Which are they? What extra flexibility=20 > >>>>>>>>>> does the > >>>>>>>>>> string give you if uname -p describes the ABI completely? > >>>>>>>>>> -Nathan > >>>>>>>>> just simple examples in armv6: > >>>>>>>>> - eabi vs oabi > >>>>>>>> OABI is almost entirely dead, and will be entirely dead soon. > >>>>>>> Maybe but still for now it is there and pkg has to work now > >>>>>> We don't provide packages for ARM. Also, no platforms have=20 > >>>>>> defaulted to > >>>>>> OABI for a very long time. Not making a distinction was a delibera= te > >>>>>> decision of the ARM group, since it was meant to be a clean=20 > >>>>>> switchover. > >>>>>> > >>>>>>>>> - The different float abi (even if only one is supported for=20 > >>>>>>>>> now others are > >>>>>>>>> being worked on) > >>>>>>>> armv6 and armv6hf > >>>>>>>> > >>>>>>>>> - little endian vs big endian > >>>>>>>> armv6 and armv6eb (though I think armv6eb support in general=20 > >>>>>>>> has been > >>>>>>>> removed from the tree, but armeb is still there) > >>>>>>> what about combinaison? armv6 + eb + hf? > >>>>>> That would be armv6hfeb, I assume, if FreeBSD actually supported > >>>>>> big-endian ARMv6 at all, which it doesn't. > >>>>>> > >>>>>>>> These all already exist. > >>>>>>>> > >>>>>>>>> the extras flexibilit is being able to say this binary do=20 > >>>>>>>>> support freebsd i386 > >>>>>>>>> and amd64 in one key, freebsd:9:x86:*, or or all arches=20 > >>>>>>>>> freebsd:10:* > >>>>>>>>> > >>>>>>> arm was en example what about mips? > >>>>>> The same. There is mips64el, mipsel, mips, mips64, etc. that go=20 > >>>>>> through > >>>>>> all possible combinations. This is true for all platforms and has= =20 > >>>>>> been > >>>>>> for ages. There was a brief period (2007-2010, I think) where some > >>>>>> Tier-3 embedded platforms didn't have enough options, but that=20 > >>>>>> era was > >>>>>> obscure and is long past. > >>>>>> > >>>>>>>> The second one already would work, wouldn't it? Just replacing= =20 > >>>>>>>> x86:64 > >>>>>>>> with amd64 won't change anything. The first has to be=20 > >>>>>>>> outweighed by > >>>>>>>> being able to reliably figure out where to fetch from without a= =20 > >>>>>>>> lookup > >>>>>>>> table. > >>>>>>>> > >>>>>>>> We also added the kern.supported_archs sysctl last year to all= =20 > >>>>>>>> branches > >>>>>>>> to enable figuring out which architectures a given running kernel > >>>>>>>> supports (e.g. amd64 and i386 on most amd64 systems). This was= =20 > >>>>>>>> designed > >>>>>>>> specifically to help pkg figure out what packages it can install. > >>>>>>> I know, it means that we can switch only when freebsd 8 and 9=20 > >>>>>>> are EOL which means > >>>>>>> in a couple of years > >>>>>> Why does it mean that? That doesn't make sense. A couple of=20 > >>>>>> symlinks on > >>>>>> the FTP server ensure compatibility. For the sysctl, it has been= =20 > >>>>>> merged > >>>>>> all the back to 7. > >>>>> So We can switch after 8.4 death which is a good news (except if=20 > >>>>> you say that it > >>>>> is in 8.4) > >>>> It means we can do it now. Very few people install i386 packages on > >>>> amd64 anyway. It means people with very old releases on old branches > >>>> might face a warning in an unusual situation. Not a big deal. Since = we > >>>> only provide i386 and amd64 packages anyway, this is also a trivial > >>>> special case if you really want that. > >>>> > >>>>>>> And it defeats cross installation (which is the reason why the=20 > >>>>>>> ABI supported is > >>>>>>> read from a binary and not from kernel) > >>>>>> No. That's the point of the sysctl. > >>>>> I'm speaking of installing packages in a arm chroot on a amd64=20 > >>>>> host I will need > >>>>> to know what arch could be supported by the "content" of the chroot. > >>>> uname -p in the chroot (I guess this is with qemu) should return the > >>>> right answer, just as it does with an i386 chroot. If it doesn't, > >>>> something is broken in the qemu user mode support. > >>> nope that is not with qemu it is basically cross buildworld, install= =20 > >>> in a > >>> destdir, install packages in that destdir which is a very common=20 > >>> usage that a > >>> lot do expect to work > >>> > >> > >> Knowing a priori which architectures are "supported" by a chroot based > >> on ELF type of /bin/sh doesn't even work. How do you know what kernel > >> will be running in there and how it will be configured? You don't. > >> IA64 can -- sometimes -- run i386 binaries, for example. amd64 may or > >> may not be able to run i386, depending on kernel options. > >> > > > > You're assuming that you would only use a chroot to RUN things. This is > > also useful for building images. Install a world into a chroot, run > > pkg -c install whatever and it picks the right ABI. Just an example. >=20 > No, I'm not. Suppose you make an amd64 jail and install an i386 package= =20 > into it. That's fine (or is potentially fine anyway). But there is no=20 > way to be sure since whether it's fine or not depends on the kernel you= =20 > happen to run. >=20 > >> In any case, I wouldn't really characterize this situation as "common" > >> in any sense -- and I don't even see why it applies to this > >> discussion. Whatever logic calculates your own private version of > >> architecture strings can calculate the correct ones. Allowing it to > >> ignore the architecture optionally, just like you how you already have > >> to add flags to install in a chroot, would also work. Lots of things > >> like that. This issue is basically wholly unrelated to whether you use > >> normal architecture strings or not. > >> > >> I'm perfectly happy to write 100% of the code to enable pkg to use the > >> same architecture strings that the rest of the operating system uses. > >> Having private ones is just a recipe for confusion. From this > >> discussion, there don't seem to be any actually existing reasons why > >> MACHINE_ARCH doesn't work for this. > > > > pkg is *not* FreeBSD-specific. Is MACHINE_ARCH portable? >=20 > Yes, of course. I think it's part of POSIX. The GNU and OS X versions of= =20 > uname have it anyway. >=20 > I'm really quite mystified why you're so insistent on having your own=20 > private ABI identifier strings. If you're really set on this, I of=20 > course can't make you change. As you note, pkg is not something that=20 > lives in FreeBSD and I have no power to change it. And, from this=20 > conversation, I now strongly suspect that if I did put in the work to=20 > fix this, my patch would be ignored or rejected. But it does mystify me. > -Nathan > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" We are not insistant just we needed something that work and at the time una= me -p did not, we exposed our need which really works now, dig in the code try to= have the same with uname -p and without regression on the feature we provide, and with a compat/migration path and I will be more than happy, just that is no= t as easy as it sounds as exposed in that thread I ll for sure integrate the patch if you manage to get it Bapt --YZ5djTAD1cGYuMQK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iEYEARECAAYFAlN/2D8ACgkQ8kTtMUmk6Ex97QCcDJSDrhSuVx/1sOeTOzziPOPq p+MAoJ3QzTBU6mnHkVhQStU0DIM/LXZ4 =43pA -----END PGP SIGNATURE----- --YZ5djTAD1cGYuMQK-- From owner-svn-src-head@FreeBSD.ORG Fri May 23 23:24:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1236984 for ; Fri, 23 May 2014 23:24:42 +0000 (UTC) Received: from mail-ig0-f172.google.com (mail-ig0-f172.google.com [209.85.213.172]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83B76209B for ; Fri, 23 May 2014 23:24:42 +0000 (UTC) Received: by mail-ig0-f172.google.com with SMTP id uy17so1256343igb.17 for ; Fri, 23 May 2014 16:24:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:content-type:mime-version:subject :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=Lvo6gdEP3YCKU419VAvvk5lj4JvDBuSzF2PelOtV3GY=; b=UssXbyF8FjfaKkNPGF6A5saw/epuaEsABwWnZnf9fCqUdP6zfq+/Q/tWF8OHLBxw16 9g4P9Scf0h+kT677gSx41g+u6CBPyPa4rKwSl6grRZlzBh1La3g5KQbe5FbOSqrooUK4 KRa7xA5q71QnKfv8yEgDXOYdNeGDLkyvo9s/uTQmwVd2DOEwpubzFyyx1+0WVPbHzpay A44soj/Ny6hDe0XNqHSRPCpsKLuSq8qqDX7SqsQnwIKNdTrkULyrmV0gpeeHtbxNwRrx ySQubYVLBYSC1hqa/cC84oFERThRRVaOLAjRypsyUXDwyTvmNyXihMqATQKxUHz9Iq/q brNw== X-Gm-Message-State: ALoCoQk0r0sZBht4o3Ms4sTpYfszc9/6hwFrrl990KkGwUIU2UJmdZHgelpX0ywv2Itq1vVTgixZ X-Received: by 10.43.93.5 with SMTP id bs5mr7884422icc.11.1400887476767; Fri, 23 May 2014 16:24:36 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id nk1sm7528635igb.0.2014.05.23.16.24.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 16:24:36 -0700 (PDT) Sender: Warner Losh From: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266553 - head/release/scripts In-Reply-To: <20140523232239.GA9268@ivaldir.etoilebsd.net> Date: Fri, 23 May 2014 17:24:42 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <3D377734-1545-4958-BF52-B62DE718CF85@gmail.com> References: <20140523162020.GG72340@ivaldir.etoilebsd.net> <537F7976.3060705@freebsd.org> <20140523164521.GH72340@ivaldir.etoilebsd.net> <537F8153.7080808@freebsd.org> <20140523172636.GK72340@ivaldir.etoilebsd.net> <537F9AF4.1070502@freebsd.org> <20140523192701.GL72340@ivaldir.etoilebsd.net> <537FBB4E.2010409@freebsd.org> <8740c21d1e7467ea0e0355c5d05729c9@shatow.net> <537FD679.6020503@freebsd.org> <20140523232239.GA9268@ivaldir.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Nathan Whitehorn , Bryan Drewery X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 23:24:42 -0000 On May 23, 2014, at 5:22 PM, Baptiste Daroussin = wrote: > On Fri, May 23, 2014 at 04:15:05PM -0700, Nathan Whitehorn wrote: >>=20 >> On 05/23/14 14:34, Bryan Drewery wrote: >>> On 2014-05-23 16:19, Nathan Whitehorn wrote: >>>> On 05/23/14 12:27, Baptiste Daroussin wrote: >>>>> On Fri, May 23, 2014 at 12:01:08PM -0700, Nathan Whitehorn wrote: >>>>>> On 05/23/14 10:26, Baptiste Daroussin wrote: >>>>>>> On Fri, May 23, 2014 at 10:11:47AM -0700, Nathan Whitehorn = wrote: >>>>>>>> On 05/23/14 09:45, Baptiste Daroussin wrote: >>>>>>>>> On Fri, May 23, 2014 at 09:38:14AM -0700, Nathan Whitehorn = wrote: >>>>>>>>>> On 05/23/14 09:20, Baptiste Daroussin wrote: >>>>>>>>>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn = wrote: >>>>>>>>>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>>>>>>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn=20= >>>>>>>>>>>>> wrote: >>>>>>>>>>>>>> Is there any chance of finally switching the pkg abi=20 >>>>>>>>>>>>>> identifiers to just >>>>>>>>>>>>>> be uname -p? >>>>>>>>>>>>>> -Nathan >>>>>>>>>>>>> Keeping asking won't make it happen, I have explained a=20 >>>>>>>>>>>>> large number of time why it >>>>>>>>>>>>> happened, why it is not easy for compatibility and why = uname=20 >>>>>>>>>>>>> -p is still not >>>>>>>>>>>>> representing the ABI we do support, and what flexibility = we=20 >>>>>>>>>>>>> need that the >>>>>>>>>>>>> current string offers to us. >>>>>>>>>>>>>=20 >>>>>>>>>>>>> if one is willing to do the work, please be my guess, just=20= >>>>>>>>>>>>> dig into the archives >>>>>>>>>>>>> and join the pkg development otherwise: no it won't happen=20= >>>>>>>>>>>>> before a while >>>>>>>>>>>>> because we have way too much work on the todo and this = item=20 >>>>>>>>>>>>> is stored at the >>>>>>>>>>>>> very end of this todo. >>>>>>>>>>>>>=20 >>>>>>>>>>>>> regards, >>>>>>>>>>>>> Bapt >>>>>>>>>>>> I'm happy to do the work, and have volunteered now many=20 >>>>>>>>>>>> times. If uname >>>>>>>>>>>> -p does not describe the ABI fully, then uname -p needs=20 >>>>>>>>>>>> changes on the >>>>>>>>>>>> relevant platforms. Which are they? What extra flexibility=20= >>>>>>>>>>>> does the >>>>>>>>>>>> string give you if uname -p describes the ABI completely? >>>>>>>>>>>> -Nathan >>>>>>>>>>> just simple examples in armv6: >>>>>>>>>>> - eabi vs oabi >>>>>>>>>> OABI is almost entirely dead, and will be entirely dead soon. >>>>>>>>> Maybe but still for now it is there and pkg has to work now >>>>>>>> We don't provide packages for ARM. Also, no platforms have=20 >>>>>>>> defaulted to >>>>>>>> OABI for a very long time. Not making a distinction was a = deliberate >>>>>>>> decision of the ARM group, since it was meant to be a clean=20 >>>>>>>> switchover. >>>>>>>>=20 >>>>>>>>>>> - The different float abi (even if only one is supported for=20= >>>>>>>>>>> now others are >>>>>>>>>>> being worked on) >>>>>>>>>> armv6 and armv6hf >>>>>>>>>>=20 >>>>>>>>>>> - little endian vs big endian >>>>>>>>>> armv6 and armv6eb (though I think armv6eb support in general=20= >>>>>>>>>> has been >>>>>>>>>> removed from the tree, but armeb is still there) >>>>>>>>> what about combinaison? armv6 + eb + hf? >>>>>>>> That would be armv6hfeb, I assume, if FreeBSD actually = supported >>>>>>>> big-endian ARMv6 at all, which it doesn't. >>>>>>>>=20 >>>>>>>>>> These all already exist. >>>>>>>>>>=20 >>>>>>>>>>> the extras flexibilit is being able to say this binary do=20 >>>>>>>>>>> support freebsd i386 >>>>>>>>>>> and amd64 in one key, freebsd:9:x86:*, or or all arches=20 >>>>>>>>>>> freebsd:10:* >>>>>>>>>>>=20 >>>>>>>>> arm was en example what about mips? >>>>>>>> The same. There is mips64el, mipsel, mips, mips64, etc. that go=20= >>>>>>>> through >>>>>>>> all possible combinations. This is true for all platforms and = has=20 >>>>>>>> been >>>>>>>> for ages. There was a brief period (2007-2010, I think) where = some >>>>>>>> Tier-3 embedded platforms didn't have enough options, but that=20= >>>>>>>> era was >>>>>>>> obscure and is long past. >>>>>>>>=20 >>>>>>>>>> The second one already would work, wouldn't it? Just = replacing=20 >>>>>>>>>> x86:64 >>>>>>>>>> with amd64 won't change anything. The first has to be=20 >>>>>>>>>> outweighed by >>>>>>>>>> being able to reliably figure out where to fetch from without = a=20 >>>>>>>>>> lookup >>>>>>>>>> table. >>>>>>>>>>=20 >>>>>>>>>> We also added the kern.supported_archs sysctl last year to = all=20 >>>>>>>>>> branches >>>>>>>>>> to enable figuring out which architectures a given running = kernel >>>>>>>>>> supports (e.g. amd64 and i386 on most amd64 systems). This = was=20 >>>>>>>>>> designed >>>>>>>>>> specifically to help pkg figure out what packages it can = install. >>>>>>>>> I know, it means that we can switch only when freebsd 8 and 9=20= >>>>>>>>> are EOL which means >>>>>>>>> in a couple of years >>>>>>>> Why does it mean that? That doesn't make sense. A couple of=20 >>>>>>>> symlinks on >>>>>>>> the FTP server ensure compatibility. For the sysctl, it has = been=20 >>>>>>>> merged >>>>>>>> all the back to 7. >>>>>>> So We can switch after 8.4 death which is a good news (except if=20= >>>>>>> you say that it >>>>>>> is in 8.4) >>>>>> It means we can do it now. Very few people install i386 packages = on >>>>>> amd64 anyway. It means people with very old releases on old = branches >>>>>> might face a warning in an unusual situation. Not a big deal. = Since we >>>>>> only provide i386 and amd64 packages anyway, this is also a = trivial >>>>>> special case if you really want that. >>>>>>=20 >>>>>>>>> And it defeats cross installation (which is the reason why the=20= >>>>>>>>> ABI supported is >>>>>>>>> read from a binary and not from kernel) >>>>>>>> No. That's the point of the sysctl. >>>>>>> I'm speaking of installing packages in a arm chroot on a amd64=20= >>>>>>> host I will need >>>>>>> to know what arch could be supported by the "content" of the = chroot. >>>>>> uname -p in the chroot (I guess this is with qemu) should return = the >>>>>> right answer, just as it does with an i386 chroot. If it doesn't, >>>>>> something is broken in the qemu user mode support. >>>>> nope that is not with qemu it is basically cross buildworld, = install=20 >>>>> in a >>>>> destdir, install packages in that destdir which is a very common=20= >>>>> usage that a >>>>> lot do expect to work >>>>>=20 >>>>=20 >>>> Knowing a priori which architectures are "supported" by a chroot = based >>>> on ELF type of /bin/sh doesn't even work. How do you know what = kernel >>>> will be running in there and how it will be configured? You don't. >>>> IA64 can -- sometimes -- run i386 binaries, for example. amd64 may = or >>>> may not be able to run i386, depending on kernel options. >>>>=20 >>>=20 >>> You're assuming that you would only use a chroot to RUN things. This = is >>> also useful for building images. Install a world into a chroot, run >>> pkg -c install whatever and it picks the right ABI. Just an example. >>=20 >> No, I'm not. Suppose you make an amd64 jail and install an i386 = package=20 >> into it. That's fine (or is potentially fine anyway). But there is no=20= >> way to be sure since whether it's fine or not depends on the kernel = you=20 >> happen to run. >>=20 >>>> In any case, I wouldn't really characterize this situation as = "common" >>>> in any sense -- and I don't even see why it applies to this >>>> discussion. Whatever logic calculates your own private version of >>>> architecture strings can calculate the correct ones. Allowing it to >>>> ignore the architecture optionally, just like you how you already = have >>>> to add flags to install in a chroot, would also work. Lots of = things >>>> like that. This issue is basically wholly unrelated to whether you = use >>>> normal architecture strings or not. >>>>=20 >>>> I'm perfectly happy to write 100% of the code to enable pkg to use = the >>>> same architecture strings that the rest of the operating system = uses. >>>> Having private ones is just a recipe for confusion. =46rom this >>>> discussion, there don't seem to be any actually existing reasons = why >>>> MACHINE_ARCH doesn't work for this. >>>=20 >>> pkg is *not* FreeBSD-specific. Is MACHINE_ARCH portable? >>=20 >> Yes, of course. I think it's part of POSIX. The GNU and OS X versions = of=20 >> uname have it anyway. >>=20 >> I'm really quite mystified why you're so insistent on having your own=20= >> private ABI identifier strings. If you're really set on this, I of=20 >> course can't make you change. As you note, pkg is not something that=20= >> lives in FreeBSD and I have no power to change it. And, from this=20 >> conversation, I now strongly suspect that if I did put in the work to=20= >> fix this, my patch would be ignored or rejected. But it does mystify = me. >> -Nathan >> _______________________________________________ >> svn-src-all@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/svn-src-all >> To unsubscribe, send any mail to = "svn-src-all-unsubscribe@freebsd.org" >=20 > We are not insistant just we needed something that work and at the = time uname -p > did not, we exposed our need which really works now, dig in the code = try to have > the same with uname -p and without regression on the feature we = provide, and > with a compat/migration path and I will be more than happy, just that = is not as > easy as it sounds as exposed in that thread >=20 > I ll for sure integrate the patch if you manage to get it Baptiste, can you summarize why uname -p doesn=92t work, and perhaps we = can fix any issues identified. We use it extensively now and it is the gold = standard. If there=92s scenarios where the gold standard doesn=92t work, we need to get to the = bottom of them. Warner= From owner-svn-src-head@FreeBSD.ORG Fri May 23 23:29:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CAB6EADA for ; Fri, 23 May 2014 23:29:48 +0000 (UTC) Received: from mail-ie0-f177.google.com (mail-ie0-f177.google.com [209.85.223.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CAD02105 for ; Fri, 23 May 2014 23:29:48 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id y20so5471772ier.8 for ; Fri, 23 May 2014 16:29:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:content-type:mime-version:subject :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=4dGgW78ptA2LJK1h6q8G8Y6fB4CYAvtwWC6dkalQACo=; b=SsW2CbnRxViJPwLyHIIIEcR3HXLJpEUuvJSyTORpf/Q8RetiIilbneSIBp3DJnC1mC xUvf/DeVuduA+I1jSgAnJ/QzsXfRbRtofJCiPOciFSaKItuFBnaPR43AaLDAg+nWJJkn kF+Gtxeu4ZFXOpOcwDophDQy5ZGSD1IjD5sZPAlCrs65NflQdn5AvmR/pc0U+NNTxT6Y U2v1AXUGZ8OByU9FkqnEAKSNdtE1+Fsoww6CRR6dAf5viPK2XHJPEAEoox2mGqHDEI0A fqaWLkr9Gs6uzFhYKHLB5N0RkGur2jy91oDk36eK50HqjtiN/kkOgKKXtVl/8LT01Fwx B7Rw== X-Gm-Message-State: ALoCoQm68mKzaR/isGJ2CFKRtxxeTmQmpcT3qB5o6qDVyzDZxOfts+M3VE75VL1pr82oKpEuJf1t X-Received: by 10.42.203.11 with SMTP id fg11mr7859161icb.17.1400887782008; Fri, 23 May 2014 16:29:42 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id kw1sm7543877igb.4.2014.05.23.16.29.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 16:29:41 -0700 (PDT) Sender: Warner Losh From: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266553 - head/release/scripts In-Reply-To: <20140523162020.GG72340@ivaldir.etoilebsd.net> Date: Fri, 23 May 2014 17:29:48 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@FreeBSD.org, Glen Barber , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Nathan Whitehorn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 23:29:49 -0000 On May 23, 2014, at 10:20 AM, Baptiste Daroussin = wrote: > On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: >> On 05/23/14 08:36, Baptiste Daroussin wrote: >>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: >>>> Is there any chance of finally switching the pkg abi identifiers to = just >>>> be uname -p? >>>> -Nathan >>> Keeping asking won't make it happen, I have explained a large number = of time why it >>> happened, why it is not easy for compatibility and why uname -p is = still not >>> representing the ABI we do support, and what flexibility we need = that the >>> current string offers to us. >>>=20 >>> if one is willing to do the work, please be my guess, just dig into = the archives >>> and join the pkg development otherwise: no it won't happen before a = while >>> because we have way too much work on the todo and this item is = stored at the >>> very end of this todo. >>>=20 >>> regards, >>> Bapt >>=20 >> I'm happy to do the work, and have volunteered now many times. If = uname=20 >> -p does not describe the ABI fully, then uname -p needs changes on = the=20 >> relevant platforms. Which are they? What extra flexibility does the=20= >> string give you if uname -p describes the ABI completely? >> -Nathan >=20 > just simple examples in armv6: > - eabi vs oabi > - The different float abi (even if only one is supported for now = others are > being worked on) > - little endian vs big endian All of those are encoded in the MACHINE_ARCH + freebsd version, no = exceptions on supported architectures that are tier 2 or higher. This seems like a = weak reason. > the extras flexibilit is being able to say this binary do support = freebsd i386 > and amd64 in one key, freebsd:9:x86:*, or or all arches freebsd:10:* Will there be a program to convert this new, special invention to the = standard that we=92ve used for the past 20 years? If you need the flexibility, = which I=92m not entirely sure I=92ve seen a good use case for. When would you have a x86 = binary package? Wouldn=92t it be either i386 or amd64? Warner From owner-svn-src-head@FreeBSD.ORG Fri May 23 23:32:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0EDA2D24 for ; Fri, 23 May 2014 23:32:55 +0000 (UTC) Received: from mail-ig0-f177.google.com (mail-ig0-f177.google.com [209.85.213.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CACA7218D for ; Fri, 23 May 2014 23:32:54 +0000 (UTC) Received: by mail-ig0-f177.google.com with SMTP id l13so1309082iga.10 for ; Fri, 23 May 2014 16:32:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:content-type:mime-version:subject :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=tAP4Tg+m/IJtBkEehr6GRzFIL0aMB9NQnoltHwSqiBE=; b=kr+NmjuSLBv954jazFLNYlt9/zdzD7BUxPj54dTqi3AkAdckra1qQ4R614siSLYNtV hJSLhsK3hI3AZSJsUyWQzNOWy8hVLODbt6m7yH57WoX1vu7ublJuUmxTpftP81vT5vqP W550WqapLOwA+g+MIjOmGrTE+/Zy0TsbAY5iMH3raRSzkcJUef+zaXVbabhvLjQRmL9G TZ0R6CkA55dyOjMU4zlRo4zbD0vdmu+ATUou+S6tB8NhrdK+jGpShuRPFgYkAybJdEYv UFyDgBAwak9eDapBkolMigWJ7EU6cq2lVCFYRD/7rtw75MnI2BUmEt183UJpUKQ60tey NeQw== X-Gm-Message-State: ALoCoQnmV84A/yrnoeOYRTJEmqM2uoXCvNCYxCiSxSnmSPLgsGhA9bBBeQUtXNb+s69uKLxoVbTW X-Received: by 10.50.82.105 with SMTP id h9mr8169917igy.6.1400887967913; Fri, 23 May 2014 16:32:47 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id on9sm7555078igb.11.2014.05.23.16.32.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 16:32:47 -0700 (PDT) Sender: Warner Losh From: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266553 - head/release/scripts In-Reply-To: <537F6EBC.3080008@freebsd.org> Date: Fri, 23 May 2014 17:32:53 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@FreeBSD.org, Glen Barber , Baptiste Daroussin , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 23:32:55 -0000 On May 23, 2014, at 9:52 AM, Nathan Whitehorn = wrote: > On 05/23/14 08:36, Baptiste Daroussin wrote: >> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: >>> Is there any chance of finally switching the pkg abi identifiers to = just >>> be uname -p? >>> -Nathan >> Keeping asking won't make it happen, I have explained a large number = of time why it >> happened, why it is not easy for compatibility and why uname -p is = still not >> representing the ABI we do support, and what flexibility we need that = the >> current string offers to us. What is not present? I=92ve explained this many times. All examples that = I=92ve seen offered are the result of bugs, or are for unsupported = configurations. >> if one is willing to do the work, please be my guess, just dig into = the archives >> and join the pkg development otherwise: no it won't happen before a = while >> because we have way too much work on the todo and this item is stored = at the >> very end of this todo. I=92m putting my hand up. Warner From owner-svn-src-head@FreeBSD.ORG Sat May 24 01:24:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A59DAF52; Sat, 24 May 2014 01:24:53 +0000 (UTC) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5890E2954; Sat, 24 May 2014 01:24:53 +0000 (UTC) Received: by mail.lifanov.com (Postfix, from userid 58) id 52DE81B09E6; Fri, 23 May 2014 21:24:47 -0400 (EDT) Received: from app.lifanov.com (chat.lifanov.com [206.125.175.13]) by mail.lifanov.com (Postfix) with ESMTPA id D34471B09E2; Fri, 23 May 2014 21:24:44 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 23 May 2014 21:24:44 -0400 From: Nikolai Lifanov To: Bryan Drewery Subject: Re: svn commit: r266553 - head/release/scripts In-Reply-To: <8740c21d1e7467ea0e0355c5d05729c9@shatow.net> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <537F7976.3060705@freebsd.org> <20140523164521.GH72340@ivaldir.etoilebsd.net> <537F8153.7080808@freebsd.org> <20140523172636.GK72340@ivaldir.etoilebsd.net> <537F9AF4.1070502@freebsd.org> <20140523192701.GL72340@ivaldir.etoilebsd.net> <537FBB4E.2010409@freebsd.org> <8740c21d1e7467ea0e0355c5d05729c9@shatow.net> Message-ID: <7e3c8f5196a6328a346945e0e90d3ec3@mail.lifanov.com> X-Sender: lifanov@mail.lifanov.com User-Agent: Roundcube Webmail/1.0.1 Cc: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, Nathan Whitehorn , svn-src-head@freebsd.org, owner-svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 01:24:53 -0000 On 2014-05-23 17:34, Bryan Drewery wrote: > On 2014-05-23 16:19, Nathan Whitehorn wrote: >> On 05/23/14 12:27, Baptiste Daroussin wrote: >>> On Fri, May 23, 2014 at 12:01:08PM -0700, Nathan Whitehorn wrote: >>>> On 05/23/14 10:26, Baptiste Daroussin wrote: >>>>> On Fri, May 23, 2014 at 10:11:47AM -0700, Nathan Whitehorn wrote: >>>>>> On 05/23/14 09:45, Baptiste Daroussin wrote: >>>>>>> On Fri, May 23, 2014 at 09:38:14AM -0700, Nathan Whitehorn wrote: >>>>>>>> On 05/23/14 09:20, Baptiste Daroussin wrote: >>>>>>>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn >>>>>>>>> wrote: >>>>>>>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>>>>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn >>>>>>>>>>> wrote: >>>>>>>>>>>> Is there any chance of finally switching the pkg abi >>>>>>>>>>>> identifiers to just >>>>>>>>>>>> be uname -p? >>>>>>>>>>>> -Nathan >>>>>>>>>>> Keeping asking won't make it happen, I have explained a large >>>>>>>>>>> number of time why it >>>>>>>>>>> happened, why it is not easy for compatibility and why uname >>>>>>>>>>> -p is still not >>>>>>>>>>> representing the ABI we do support, and what flexibility we >>>>>>>>>>> need that the >>>>>>>>>>> current string offers to us. >>>>>>>>>>> >>>>>>>>>>> if one is willing to do the work, please be my guess, just >>>>>>>>>>> dig into the archives >>>>>>>>>>> and join the pkg development otherwise: no it won't happen >>>>>>>>>>> before a while >>>>>>>>>>> because we have way too much work on the todo and this item >>>>>>>>>>> is stored at the >>>>>>>>>>> very end of this todo. >>>>>>>>>>> >>>>>>>>>>> regards, >>>>>>>>>>> Bapt >>>>>>>>>> I'm happy to do the work, and have volunteered now many times. >>>>>>>>>> If uname >>>>>>>>>> -p does not describe the ABI fully, then uname -p needs >>>>>>>>>> changes on the >>>>>>>>>> relevant platforms. Which are they? What extra flexibility >>>>>>>>>> does the >>>>>>>>>> string give you if uname -p describes the ABI completely? >>>>>>>>>> -Nathan >>>>>>>>> just simple examples in armv6: >>>>>>>>> - eabi vs oabi >>>>>>>> OABI is almost entirely dead, and will be entirely dead soon. >>>>>>> Maybe but still for now it is there and pkg has to work now >>>>>> We don't provide packages for ARM. Also, no platforms have >>>>>> defaulted to >>>>>> OABI for a very long time. Not making a distinction was a >>>>>> deliberate >>>>>> decision of the ARM group, since it was meant to be a clean >>>>>> switchover. >>>>>> >>>>>>>>> - The different float abi (even if only one is supported for >>>>>>>>> now others are >>>>>>>>> being worked on) >>>>>>>> armv6 and armv6hf >>>>>>>> >>>>>>>>> - little endian vs big endian >>>>>>>> armv6 and armv6eb (though I think armv6eb support in general has >>>>>>>> been >>>>>>>> removed from the tree, but armeb is still there) >>>>>>> what about combinaison? armv6 + eb + hf? >>>>>> That would be armv6hfeb, I assume, if FreeBSD actually supported >>>>>> big-endian ARMv6 at all, which it doesn't. >>>>>> >>>>>>>> These all already exist. >>>>>>>> >>>>>>>>> the extras flexibilit is being able to say this binary do >>>>>>>>> support freebsd i386 >>>>>>>>> and amd64 in one key, freebsd:9:x86:*, or or all arches >>>>>>>>> freebsd:10:* >>>>>>>>> >>>>>>> arm was en example what about mips? >>>>>> The same. There is mips64el, mipsel, mips, mips64, etc. that go >>>>>> through >>>>>> all possible combinations. This is true for all platforms and has >>>>>> been >>>>>> for ages. There was a brief period (2007-2010, I think) where some >>>>>> Tier-3 embedded platforms didn't have enough options, but that era >>>>>> was >>>>>> obscure and is long past. >>>>>> >>>>>>>> The second one already would work, wouldn't it? Just replacing >>>>>>>> x86:64 >>>>>>>> with amd64 won't change anything. The first has to be outweighed >>>>>>>> by >>>>>>>> being able to reliably figure out where to fetch from without a >>>>>>>> lookup >>>>>>>> table. >>>>>>>> >>>>>>>> We also added the kern.supported_archs sysctl last year to all >>>>>>>> branches >>>>>>>> to enable figuring out which architectures a given running >>>>>>>> kernel >>>>>>>> supports (e.g. amd64 and i386 on most amd64 systems). This was >>>>>>>> designed >>>>>>>> specifically to help pkg figure out what packages it can >>>>>>>> install. >>>>>>> I know, it means that we can switch only when freebsd 8 and 9 are >>>>>>> EOL which means >>>>>>> in a couple of years >>>>>> Why does it mean that? That doesn't make sense. A couple of >>>>>> symlinks on >>>>>> the FTP server ensure compatibility. For the sysctl, it has been >>>>>> merged >>>>>> all the back to 7. >>>>> So We can switch after 8.4 death which is a good news (except if >>>>> you say that it >>>>> is in 8.4) >>>> It means we can do it now. Very few people install i386 packages on >>>> amd64 anyway. It means people with very old releases on old branches >>>> might face a warning in an unusual situation. Not a big deal. Since >>>> we >>>> only provide i386 and amd64 packages anyway, this is also a trivial >>>> special case if you really want that. >>>> >>>>>>> And it defeats cross installation (which is the reason why the >>>>>>> ABI supported is >>>>>>> read from a binary and not from kernel) >>>>>> No. That's the point of the sysctl. >>>>> I'm speaking of installing packages in a arm chroot on a amd64 host >>>>> I will need >>>>> to know what arch could be supported by the "content" of the >>>>> chroot. >>>> uname -p in the chroot (I guess this is with qemu) should return the >>>> right answer, just as it does with an i386 chroot. If it doesn't, >>>> something is broken in the qemu user mode support. >>> nope that is not with qemu it is basically cross buildworld, install >>> in a >>> destdir, install packages in that destdir which is a very common >>> usage that a >>> lot do expect to work >>> >> >> Knowing a priori which architectures are "supported" by a chroot based >> on ELF type of /bin/sh doesn't even work. How do you know what kernel >> will be running in there and how it will be configured? You don't. >> IA64 can -- sometimes -- run i386 binaries, for example. amd64 may or >> may not be able to run i386, depending on kernel options. >> > > You're assuming that you would only use a chroot to RUN things. This is > also useful for building images. Install a world into a chroot, run > pkg -c install whatever and it picks the right ABI. Just an example. > >> In any case, I wouldn't really characterize this situation as "common" >> in any sense -- and I don't even see why it applies to this >> discussion. Whatever logic calculates your own private version of >> architecture strings can calculate the correct ones. Allowing it to >> ignore the architecture optionally, just like you how you already have >> to add flags to install in a chroot, would also work. Lots of things >> like that. This issue is basically wholly unrelated to whether you use >> normal architecture strings or not. >> >> I'm perfectly happy to write 100% of the code to enable pkg to use the >> same architecture strings that the rest of the operating system uses. >> Having private ones is just a recipe for confusion. From this >> discussion, there don't seem to be any actually existing reasons why >> MACHINE_ARCH doesn't work for this. > > pkg is *not* FreeBSD-specific. Is MACHINE_ARCH portable? > I don't think it matters whether MACHINE_ARCH is portable. FreeBSD amd64 binaries are not going to run on Linux x86_64, for example. Setting pkg ABI to something like freebsd:arm:armv6hf or freebsd:amd64:amd64 is specific enough, and could allow installation if the last triplet is in kern.supported_archs. Then you can have linux:fruit:banana packages that will correctly not install on freebsd:amd64:amd64. The current mapping is not intuitive. - Nikolai Lifanov From owner-svn-src-head@FreeBSD.ORG Sat May 24 02:33:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CEDAAFC3 for ; Sat, 24 May 2014 02:33:09 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEAC92E25 for ; Sat, 24 May 2014 02:33:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s4O2X9fK043676 for ; Sat, 24 May 2014 02:33:09 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s4O2X9AA043666 for svn-src-head@freebsd.org; Sat, 24 May 2014 02:33:09 GMT (envelope-from bdrewery) Received: (qmail 15404 invoked from network); 23 May 2014 21:33:07 -0500 Received: from unknown (HELO roundcube.xk42.net) (10.10.5.5) by sweb.xzibition.com with SMTP; 23 May 2014 21:33:07 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 23 May 2014 21:33:07 -0500 From: Bryan Drewery To: Nathan Whitehorn Subject: Re: svn commit: r266553 - head/release/scripts Organization: FreeBSD In-Reply-To: <537FD679.6020503@freebsd.org> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <537F7976.3060705@freebsd.org> <20140523164521.GH72340@ivaldir.etoilebsd.net> <537F8153.7080808@freebsd.org> <20140523172636.GK72340@ivaldir.etoilebsd.net> <537F9AF4.1070502@freebsd.org> <20140523192701.GL72340@ivaldir.etoilebsd.net> <537FBB4E.2010409@freebsd.org> <8740c21d1e7467ea0e0355c5d05729c9@shatow.net> <537FD679.6020503@freebsd.org> Message-ID: <5b0a2eff4e47cf9dd7365f3884c4e026@shatow.net> X-Sender: bdrewery@FreeBSD.org User-Agent: Roundcube Webmail/0.9.5 Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 02:33:10 -0000 On 2014-05-23 18:15, Nathan Whitehorn wrote: > On 05/23/14 14:34, Bryan Drewery wrote: >> On 2014-05-23 16:19, Nathan Whitehorn wrote: >>> On 05/23/14 12:27, Baptiste Daroussin wrote: >>>> On Fri, May 23, 2014 at 12:01:08PM -0700, Nathan Whitehorn wrote: >>>>> On 05/23/14 10:26, Baptiste Daroussin wrote: >>>>>> On Fri, May 23, 2014 at 10:11:47AM -0700, Nathan Whitehorn wrote: >>>>>>> On 05/23/14 09:45, Baptiste Daroussin wrote: >>>>>>>> On Fri, May 23, 2014 at 09:38:14AM -0700, Nathan Whitehorn >>>>>>>> wrote: >>>>>>>>> On 05/23/14 09:20, Baptiste Daroussin wrote: >>>>>>>>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn >>>>>>>>>> wrote: >>>>>>>>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>>>>>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn >>>>>>>>>>>> wrote: >>>>>>>>>>>>> Is there any chance of finally switching the pkg abi >>>>>>>>>>>>> identifiers to just >>>>>>>>>>>>> be uname -p? >>>>>>>>>>>>> -Nathan >>>>>>>>>>>> Keeping asking won't make it happen, I have explained a >>>>>>>>>>>> large number of time why it >>>>>>>>>>>> happened, why it is not easy for compatibility and why uname >>>>>>>>>>>> -p is still not >>>>>>>>>>>> representing the ABI we do support, and what flexibility we >>>>>>>>>>>> need that the >>>>>>>>>>>> current string offers to us. >>>>>>>>>>>> >>>>>>>>>>>> if one is willing to do the work, please be my guess, just >>>>>>>>>>>> dig into the archives >>>>>>>>>>>> and join the pkg development otherwise: no it won't happen >>>>>>>>>>>> before a while >>>>>>>>>>>> because we have way too much work on the todo and this item >>>>>>>>>>>> is stored at the >>>>>>>>>>>> very end of this todo. >>>>>>>>>>>> >>>>>>>>>>>> regards, >>>>>>>>>>>> Bapt >>>>>>>>>>> I'm happy to do the work, and have volunteered now many >>>>>>>>>>> times. If uname >>>>>>>>>>> -p does not describe the ABI fully, then uname -p needs >>>>>>>>>>> changes on the >>>>>>>>>>> relevant platforms. Which are they? What extra flexibility >>>>>>>>>>> does the >>>>>>>>>>> string give you if uname -p describes the ABI completely? >>>>>>>>>>> -Nathan >>>>>>>>>> just simple examples in armv6: >>>>>>>>>> - eabi vs oabi >>>>>>>>> OABI is almost entirely dead, and will be entirely dead soon. >>>>>>>> Maybe but still for now it is there and pkg has to work now >>>>>>> We don't provide packages for ARM. Also, no platforms have >>>>>>> defaulted to >>>>>>> OABI for a very long time. Not making a distinction was a >>>>>>> deliberate >>>>>>> decision of the ARM group, since it was meant to be a clean >>>>>>> switchover. >>>>>>> >>>>>>>>>> - The different float abi (even if only one is supported for >>>>>>>>>> now others are >>>>>>>>>> being worked on) >>>>>>>>> armv6 and armv6hf >>>>>>>>> >>>>>>>>>> - little endian vs big endian >>>>>>>>> armv6 and armv6eb (though I think armv6eb support in general >>>>>>>>> has been >>>>>>>>> removed from the tree, but armeb is still there) >>>>>>>> what about combinaison? armv6 + eb + hf? >>>>>>> That would be armv6hfeb, I assume, if FreeBSD actually supported >>>>>>> big-endian ARMv6 at all, which it doesn't. >>>>>>> >>>>>>>>> These all already exist. >>>>>>>>> >>>>>>>>>> the extras flexibilit is being able to say this binary do >>>>>>>>>> support freebsd i386 >>>>>>>>>> and amd64 in one key, freebsd:9:x86:*, or or all arches >>>>>>>>>> freebsd:10:* >>>>>>>>>> >>>>>>>> arm was en example what about mips? >>>>>>> The same. There is mips64el, mipsel, mips, mips64, etc. that go >>>>>>> through >>>>>>> all possible combinations. This is true for all platforms and has >>>>>>> been >>>>>>> for ages. There was a brief period (2007-2010, I think) where >>>>>>> some >>>>>>> Tier-3 embedded platforms didn't have enough options, but that >>>>>>> era was >>>>>>> obscure and is long past. >>>>>>> >>>>>>>>> The second one already would work, wouldn't it? Just replacing >>>>>>>>> x86:64 >>>>>>>>> with amd64 won't change anything. The first has to be >>>>>>>>> outweighed by >>>>>>>>> being able to reliably figure out where to fetch from without a >>>>>>>>> lookup >>>>>>>>> table. >>>>>>>>> >>>>>>>>> We also added the kern.supported_archs sysctl last year to all >>>>>>>>> branches >>>>>>>>> to enable figuring out which architectures a given running >>>>>>>>> kernel >>>>>>>>> supports (e.g. amd64 and i386 on most amd64 systems). This was >>>>>>>>> designed >>>>>>>>> specifically to help pkg figure out what packages it can >>>>>>>>> install. >>>>>>>> I know, it means that we can switch only when freebsd 8 and 9 >>>>>>>> are EOL which means >>>>>>>> in a couple of years >>>>>>> Why does it mean that? That doesn't make sense. A couple of >>>>>>> symlinks on >>>>>>> the FTP server ensure compatibility. For the sysctl, it has been >>>>>>> merged >>>>>>> all the back to 7. >>>>>> So We can switch after 8.4 death which is a good news (except if >>>>>> you say that it >>>>>> is in 8.4) >>>>> It means we can do it now. Very few people install i386 packages on >>>>> amd64 anyway. It means people with very old releases on old >>>>> branches >>>>> might face a warning in an unusual situation. Not a big deal. Since >>>>> we >>>>> only provide i386 and amd64 packages anyway, this is also a trivial >>>>> special case if you really want that. >>>>> >>>>>>>> And it defeats cross installation (which is the reason why the >>>>>>>> ABI supported is >>>>>>>> read from a binary and not from kernel) >>>>>>> No. That's the point of the sysctl. >>>>>> I'm speaking of installing packages in a arm chroot on a amd64 >>>>>> host I will need >>>>>> to know what arch could be supported by the "content" of the >>>>>> chroot. >>>>> uname -p in the chroot (I guess this is with qemu) should return >>>>> the >>>>> right answer, just as it does with an i386 chroot. If it doesn't, >>>>> something is broken in the qemu user mode support. >>>> nope that is not with qemu it is basically cross buildworld, install >>>> in a >>>> destdir, install packages in that destdir which is a very common >>>> usage that a >>>> lot do expect to work >>>> >>> >>> Knowing a priori which architectures are "supported" by a chroot >>> based >>> on ELF type of /bin/sh doesn't even work. How do you know what kernel >>> will be running in there and how it will be configured? You don't. >>> IA64 can -- sometimes -- run i386 binaries, for example. amd64 may or >>> may not be able to run i386, depending on kernel options. >>> >> >> You're assuming that you would only use a chroot to RUN things. This >> is >> also useful for building images. Install a world into a chroot, run >> pkg -c install whatever and it picks the right ABI. Just an example. > > No, I'm not. Suppose you make an amd64 jail and install an i386 > package into it. That's fine (or is potentially fine anyway). But > there is no way to be sure since whether it's fine or not depends on > the kernel you happen to run. > >>> In any case, I wouldn't really characterize this situation as >>> "common" >>> in any sense -- and I don't even see why it applies to this >>> discussion. Whatever logic calculates your own private version of >>> architecture strings can calculate the correct ones. Allowing it to >>> ignore the architecture optionally, just like you how you already >>> have >>> to add flags to install in a chroot, would also work. Lots of things >>> like that. This issue is basically wholly unrelated to whether you >>> use >>> normal architecture strings or not. >>> >>> I'm perfectly happy to write 100% of the code to enable pkg to use >>> the >>> same architecture strings that the rest of the operating system uses. >>> Having private ones is just a recipe for confusion. From this >>> discussion, there don't seem to be any actually existing reasons why >>> MACHINE_ARCH doesn't work for this. >> >> pkg is *not* FreeBSD-specific. Is MACHINE_ARCH portable? > > Yes, of course. I think it's part of POSIX. The GNU and OS X versions > of uname have it anyway. > > I'm really quite mystified why you're so insistent on having your own > private ABI identifier strings. If you're really set on this, I of > course can't make you change. As you note, pkg is not something that > lives in FreeBSD and I have no power to change it. And, from this > conversation, I now strongly suspect that if I did put in the work to > fix this, my patch would be ignored or rejected. But it does mystify > me. > -Nathan Well "highly questioning the design choice" is quite a rude attitude. It's not a good way to collaborate. -- Regards, Bryan Drewery From owner-svn-src-head@FreeBSD.ORG Sat May 24 02:38:59 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 204611B2; Sat, 24 May 2014 02:38:59 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 805332E40; Sat, 24 May 2014 02:38:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 1FDDD38064; Fri, 23 May 2014 21:38:57 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id O0TjwF3H8VwJ; Fri, 23 May 2014 21:38:57 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 5856C38063; Fri, 23 May 2014 21:38:55 -0500 (CDT) Message-ID: <5380063D.7090601@freebsd.org> Date: Fri, 23 May 2014 19:38:53 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Bryan Drewery Subject: Re: svn commit: r266553 - head/release/scripts References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <537F7976.3060705@freebsd.org> <20140523164521.GH72340@ivaldir.etoilebsd.net> <537F8153.7080808@freebsd.org> <20140523172636.GK72340@ivaldir.etoilebsd.net> <537F9AF4.1070502@freebsd.org> <20140523192701.GL72340@ivaldir.etoilebsd.net> <537FBB4E.2010409@freebsd.org> <8740c21d1e7467ea0e0355c5d05729c9@shatow.net> <537FD679.6020503@freebsd.org> <5b0a2eff4e47cf9dd7365f3884c4e026@shatow.net> In-Reply-To: <5b0a2eff4e47cf9dd7365f3884c4e026@shatow.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, Baptiste Daroussin , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 02:38:59 -0000 On 05/23/14 19:33, Bryan Drewery wrote: > On 2014-05-23 18:15, Nathan Whitehorn wrote: >> On 05/23/14 14:34, Bryan Drewery wrote: >>> On 2014-05-23 16:19, Nathan Whitehorn wrote: >>>> On 05/23/14 12:27, Baptiste Daroussin wrote: >>>>> On Fri, May 23, 2014 at 12:01:08PM -0700, Nathan Whitehorn wrote: >>>>>> On 05/23/14 10:26, Baptiste Daroussin wrote: >>>>>>> On Fri, May 23, 2014 at 10:11:47AM -0700, Nathan Whitehorn wrote: >>>>>>>> On 05/23/14 09:45, Baptiste Daroussin wrote: >>>>>>>>> On Fri, May 23, 2014 at 09:38:14AM -0700, Nathan Whitehorn wrote: >>>>>>>>>> On 05/23/14 09:20, Baptiste Daroussin wrote: >>>>>>>>>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn >>>>>>>>>>> wrote: >>>>>>>>>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>>>>>>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn >>>>>>>>>>>>> wrote: >>>>>>>>>>>>>> Is there any chance of finally switching the pkg abi >>>>>>>>>>>>>> identifiers to just >>>>>>>>>>>>>> be uname -p? >>>>>>>>>>>>>> -Nathan >>>>>>>>>>>>> Keeping asking won't make it happen, I have explained a >>>>>>>>>>>>> large number of time why it >>>>>>>>>>>>> happened, why it is not easy for compatibility and why >>>>>>>>>>>>> uname -p is still not >>>>>>>>>>>>> representing the ABI we do support, and what flexibility >>>>>>>>>>>>> we need that the >>>>>>>>>>>>> current string offers to us. >>>>>>>>>>>>> >>>>>>>>>>>>> if one is willing to do the work, please be my guess, just >>>>>>>>>>>>> dig into the archives >>>>>>>>>>>>> and join the pkg development otherwise: no it won't happen >>>>>>>>>>>>> before a while >>>>>>>>>>>>> because we have way too much work on the todo and this >>>>>>>>>>>>> item is stored at the >>>>>>>>>>>>> very end of this todo. >>>>>>>>>>>>> >>>>>>>>>>>>> regards, >>>>>>>>>>>>> Bapt >>>>>>>>>>>> I'm happy to do the work, and have volunteered now many >>>>>>>>>>>> times. If uname >>>>>>>>>>>> -p does not describe the ABI fully, then uname -p needs >>>>>>>>>>>> changes on the >>>>>>>>>>>> relevant platforms. Which are they? What extra flexibility >>>>>>>>>>>> does the >>>>>>>>>>>> string give you if uname -p describes the ABI completely? >>>>>>>>>>>> -Nathan >>>>>>>>>>> just simple examples in armv6: >>>>>>>>>>> - eabi vs oabi >>>>>>>>>> OABI is almost entirely dead, and will be entirely dead soon. >>>>>>>>> Maybe but still for now it is there and pkg has to work now >>>>>>>> We don't provide packages for ARM. Also, no platforms have >>>>>>>> defaulted to >>>>>>>> OABI for a very long time. Not making a distinction was a >>>>>>>> deliberate >>>>>>>> decision of the ARM group, since it was meant to be a clean >>>>>>>> switchover. >>>>>>>> >>>>>>>>>>> - The different float abi (even if only one is supported for >>>>>>>>>>> now others are >>>>>>>>>>> being worked on) >>>>>>>>>> armv6 and armv6hf >>>>>>>>>> >>>>>>>>>>> - little endian vs big endian >>>>>>>>>> armv6 and armv6eb (though I think armv6eb support in general >>>>>>>>>> has been >>>>>>>>>> removed from the tree, but armeb is still there) >>>>>>>>> what about combinaison? armv6 + eb + hf? >>>>>>>> That would be armv6hfeb, I assume, if FreeBSD actually supported >>>>>>>> big-endian ARMv6 at all, which it doesn't. >>>>>>>> >>>>>>>>>> These all already exist. >>>>>>>>>> >>>>>>>>>>> the extras flexibilit is being able to say this binary do >>>>>>>>>>> support freebsd i386 >>>>>>>>>>> and amd64 in one key, freebsd:9:x86:*, or or all arches >>>>>>>>>>> freebsd:10:* >>>>>>>>>>> >>>>>>>>> arm was en example what about mips? >>>>>>>> The same. There is mips64el, mipsel, mips, mips64, etc. that go >>>>>>>> through >>>>>>>> all possible combinations. This is true for all platforms and >>>>>>>> has been >>>>>>>> for ages. There was a brief period (2007-2010, I think) where some >>>>>>>> Tier-3 embedded platforms didn't have enough options, but that >>>>>>>> era was >>>>>>>> obscure and is long past. >>>>>>>> >>>>>>>>>> The second one already would work, wouldn't it? Just >>>>>>>>>> replacing x86:64 >>>>>>>>>> with amd64 won't change anything. The first has to be >>>>>>>>>> outweighed by >>>>>>>>>> being able to reliably figure out where to fetch from without >>>>>>>>>> a lookup >>>>>>>>>> table. >>>>>>>>>> >>>>>>>>>> We also added the kern.supported_archs sysctl last year to >>>>>>>>>> all branches >>>>>>>>>> to enable figuring out which architectures a given running >>>>>>>>>> kernel >>>>>>>>>> supports (e.g. amd64 and i386 on most amd64 systems). This >>>>>>>>>> was designed >>>>>>>>>> specifically to help pkg figure out what packages it can >>>>>>>>>> install. >>>>>>>>> I know, it means that we can switch only when freebsd 8 and 9 >>>>>>>>> are EOL which means >>>>>>>>> in a couple of years >>>>>>>> Why does it mean that? That doesn't make sense. A couple of >>>>>>>> symlinks on >>>>>>>> the FTP server ensure compatibility. For the sysctl, it has >>>>>>>> been merged >>>>>>>> all the back to 7. >>>>>>> So We can switch after 8.4 death which is a good news (except if >>>>>>> you say that it >>>>>>> is in 8.4) >>>>>> It means we can do it now. Very few people install i386 packages on >>>>>> amd64 anyway. It means people with very old releases on old branches >>>>>> might face a warning in an unusual situation. Not a big deal. >>>>>> Since we >>>>>> only provide i386 and amd64 packages anyway, this is also a trivial >>>>>> special case if you really want that. >>>>>> >>>>>>>>> And it defeats cross installation (which is the reason why the >>>>>>>>> ABI supported is >>>>>>>>> read from a binary and not from kernel) >>>>>>>> No. That's the point of the sysctl. >>>>>>> I'm speaking of installing packages in a arm chroot on a amd64 >>>>>>> host I will need >>>>>>> to know what arch could be supported by the "content" of the >>>>>>> chroot. >>>>>> uname -p in the chroot (I guess this is with qemu) should return the >>>>>> right answer, just as it does with an i386 chroot. If it doesn't, >>>>>> something is broken in the qemu user mode support. >>>>> nope that is not with qemu it is basically cross buildworld, >>>>> install in a >>>>> destdir, install packages in that destdir which is a very common >>>>> usage that a >>>>> lot do expect to work >>>>> >>>> >>>> Knowing a priori which architectures are "supported" by a chroot based >>>> on ELF type of /bin/sh doesn't even work. How do you know what kernel >>>> will be running in there and how it will be configured? You don't. >>>> IA64 can -- sometimes -- run i386 binaries, for example. amd64 may or >>>> may not be able to run i386, depending on kernel options. >>>> >>> >>> You're assuming that you would only use a chroot to RUN things. This is >>> also useful for building images. Install a world into a chroot, run >>> pkg -c install whatever and it picks the right ABI. Just an example. >> >> No, I'm not. Suppose you make an amd64 jail and install an i386 >> package into it. That's fine (or is potentially fine anyway). But >> there is no way to be sure since whether it's fine or not depends on >> the kernel you happen to run. >> >>>> In any case, I wouldn't really characterize this situation as "common" >>>> in any sense -- and I don't even see why it applies to this >>>> discussion. Whatever logic calculates your own private version of >>>> architecture strings can calculate the correct ones. Allowing it to >>>> ignore the architecture optionally, just like you how you already have >>>> to add flags to install in a chroot, would also work. Lots of things >>>> like that. This issue is basically wholly unrelated to whether you use >>>> normal architecture strings or not. >>>> >>>> I'm perfectly happy to write 100% of the code to enable pkg to use the >>>> same architecture strings that the rest of the operating system uses. >>>> Having private ones is just a recipe for confusion. From this >>>> discussion, there don't seem to be any actually existing reasons why >>>> MACHINE_ARCH doesn't work for this. >>> >>> pkg is *not* FreeBSD-specific. Is MACHINE_ARCH portable? >> >> Yes, of course. I think it's part of POSIX. The GNU and OS X versions >> of uname have it anyway. >> >> I'm really quite mystified why you're so insistent on having your own >> private ABI identifier strings. If you're really set on this, I of >> course can't make you change. As you note, pkg is not something that >> lives in FreeBSD and I have no power to change it. And, from this >> conversation, I now strongly suspect that if I did put in the work to >> fix this, my patch would be ignored or rejected. But it does mystify >> me. >> -Nathan > > Well "highly questioning the design choice" is quite a rude attitude. > It's not a good way to collaborate. > Apologies. I do wish you would consider the points made regardless of rudeness, however. -Nathan From owner-svn-src-head@FreeBSD.ORG Sat May 24 06:05:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C196119; Sat, 24 May 2014 06:05:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49AA32D81; Sat, 24 May 2014 06:05:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4O65MiA098052; Sat, 24 May 2014 06:05:22 GMT (envelope-from cy@svn.freebsd.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4O65MXd098051; Sat, 24 May 2014 06:05:22 GMT (envelope-from cy@svn.freebsd.org) Message-Id: <201405240605.s4O65MXd098051@svn.freebsd.org> From: Cy Schubert Date: Sat, 24 May 2014 06:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266605 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 06:05:22 -0000 Author: cy Date: Sat May 24 06:05:21 2014 New Revision: 266605 URL: http://svnweb.freebsd.org/changeset/base/266605 Log: Move mutex creation from ipf_log_soft_init() to ipf_log_soft_create() to be consistent with mutex destruction in ipf_log_soft_destroy(). As a result mutex destruction in ipf_log_soft_fini() is redundant. Approved by: glebius (mentor) Obtained from: darrenr (author) Modified: head/sys/contrib/ipfilter/netinet/ip_log.c Modified: head/sys/contrib/ipfilter/netinet/ip_log.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_log.c Sat May 24 03:09:27 2014 (r266604) +++ head/sys/contrib/ipfilter/netinet/ip_log.c Sat May 24 06:05:21 2014 (r266605) @@ -214,6 +214,7 @@ ipf_log_soft_create(softc) ipf_main_softc_t *softc; { ipf_log_softc_t *softl; + int i; KMALLOC(softl, ipf_log_softc_t *); if (softl == NULL) @@ -234,6 +235,10 @@ ipf_log_soft_create(softc) return NULL; } + for (i = IPL_LOGMAX; i >= 0; i--) { + MUTEX_INIT(&softl->ipl_mutex[i], "ipf log mutex"); + } + softl->ipl_suppress = 1; softl->ipl_logall = 0; softl->ipl_log_init = 0; @@ -267,13 +272,6 @@ ipf_log_soft_init(softc, arg) softl->iplog_ss[i].read_waiter = 0; softl->iplog_ss[i].state = 0; # endif -# if defined(linux) && defined(_KERNEL) - init_waitqueue_head(softl->iplh_linux + i); -# endif -# if SOLARIS && defined(_KERNEL) - cv_init(&softl->ipl_wait[i], NULL, CV_DRIVER, NULL); -# endif - MUTEX_INIT(&softl->ipl_mutex[i], "ipf log mutex"); } @@ -324,7 +322,7 @@ ipf_log_soft_fini(softc, arg) # endif MUTEX_ENTER(&softl->ipl_mutex[i]); } - MUTEX_DESTROY(&softl->ipl_mutex[i]); + MUTEX_EXIT(&softl->ipl_mutex[i]); } return 0; From owner-svn-src-head@FreeBSD.ORG Sat May 24 09:29:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39DFFCB0; Sat, 24 May 2014 09:29:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D6952AEA; Sat, 24 May 2014 09:29:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4O9TNsH088935; Sat, 24 May 2014 09:29:23 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4O9TNlJ088934; Sat, 24 May 2014 09:29:23 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201405240929.s4O9TNlJ088934@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 24 May 2014 09:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266606 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 09:29:24 -0000 Author: bz Date: Sat May 24 09:29:23 2014 New Revision: 266606 URL: http://svnweb.freebsd.org/changeset/base/266606 Log: Only do a ports check if this is a NAT-T SA. Otherwise other lookups providing ports may get unexpected results. MFC After: 2 weeks Modified: head/sys/netipsec/key.c Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Sat May 24 06:05:21 2014 (r266605) +++ head/sys/netipsec/key.c Sat May 24 09:29:23 2014 (r266606) @@ -1086,7 +1086,9 @@ key_allocsa( struct secasvar *sav; u_int stateidx, arraysize, state; const u_int *saorder_state_valid; - int chkport; +#ifdef IPSEC_NAT_T + int natt_chkport; +#endif IPSEC_ASSERT(dst != NULL, ("null dst address")); @@ -1094,11 +1096,9 @@ key_allocsa( printf("DP %s from %s:%u\n", __func__, where, tag)); #ifdef IPSEC_NAT_T - chkport = (dst->sa.sa_family == AF_INET && + natt_chkport = (dst->sa.sa_family == AF_INET && dst->sa.sa_len == sizeof(struct sockaddr_in) && dst->sin.sin_port != 0); -#else - chkport = 0; #endif /* @@ -1116,6 +1116,8 @@ key_allocsa( arraysize = _ARRAYLEN(saorder_state_valid_prefer_new); } LIST_FOREACH(sah, &V_sahtree, chain) { + int checkport; + /* search valid state */ for (stateidx = 0; stateidx < arraysize; stateidx++) { state = saorder_state_valid[stateidx]; @@ -1130,13 +1132,25 @@ key_allocsa( continue; if (spi != sav->spi) continue; + checkport = 0; +#ifdef IPSEC_NAT_T + /* + * Really only check ports when this is a NAT-T + * SA. Otherwise other lookups providing ports + * might suffer. + */ + if (sav->natt_type && natt_chkport) + checkport = 1; +#endif #if 0 /* don't check src */ /* check src address */ - if (key_sockaddrcmp(&src->sa, &sav->sah->saidx.src.sa, chkport) != 0) + if (key_sockaddrcmp(&src->sa, + &sav->sah->saidx.src.sa, checkport) != 0) continue; #endif /* check dst address */ - if (key_sockaddrcmp(&dst->sa, &sav->sah->saidx.dst.sa, chkport) != 0) + if (key_sockaddrcmp(&dst->sa, + &sav->sah->saidx.dst.sa, checkport) != 0) continue; sa_addref(sav); goto done; From owner-svn-src-head@FreeBSD.ORG Sat May 24 10:23:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 413155F6; Sat, 24 May 2014 10:23:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DBC22EF8; Sat, 24 May 2014 10:23:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4OAN7dU014687; Sat, 24 May 2014 10:23:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4OAN6BF014684; Sat, 24 May 2014 10:23:06 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405241023.s4OAN6BF014684@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 24 May 2014 10:23:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266609 - in head: lib/libthr/thread libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 10:23:07 -0000 Author: kib Date: Sat May 24 10:23:06 2014 New Revision: 266609 URL: http://svnweb.freebsd.org/changeset/base/266609 Log: Right now, the rtld prefork hook locks the rtld bind lock in the read mode. This allows the binder to be functional in the child after the fork (assuming no lazy loading of a filter is needed), but other rtld services which require write lock on rtld_bind_lock cause deadlock, if called by child. Change the _rtld_atfork() to lock the bind lock in write mode, making the rtld fully functional after the fork. Pre-resolve the symbols which are called by the libthr' fork() interposer, since dynamic resolution causes deadlock due to the rtld_bind_lock already owned in the write mode. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/lib/libthr/thread/thr_fork.c head/lib/libthr/thread/thr_rtld.c head/libexec/rtld-elf/rtld_lock.c Modified: head/lib/libthr/thread/thr_fork.c ============================================================================== --- head/lib/libthr/thread/thr_fork.c Sat May 24 10:20:56 2014 (r266608) +++ head/lib/libthr/thread/thr_fork.c Sat May 24 10:23:06 2014 (r266609) @@ -57,6 +57,7 @@ * */ +#include #include "namespace.h" #include #include @@ -174,8 +175,15 @@ _fork(void) was_threaded = 0; } - /* Fork a new process: */ - if ((ret = __sys_fork()) == 0) { + /* + * Fork a new process. + * There is no easy way to pre-resolve the __sys_fork symbol + * without performing the fork. Use the syscall(2) + * indirection, the syscall symbol is resolved in + * _thr_rtld_init() with side-effect free call. + */ + ret = syscall(SYS_fork); + if (ret == 0) { /* Child process */ errsave = errno; curthread->cancel_pending = 0; @@ -250,6 +258,5 @@ _fork(void) } errno = errsave; - /* Return the process ID: */ return (ret); } Modified: head/lib/libthr/thread/thr_rtld.c ============================================================================== --- head/lib/libthr/thread/thr_rtld.c Sat May 24 10:20:56 2014 (r266608) +++ head/lib/libthr/thread/thr_rtld.c Sat May 24 10:23:06 2014 (r266609) @@ -32,10 +32,12 @@ */ #include #include +#include #include #include #include +#include "libc_private.h" #include "rtld_lock.h" #include "thr_private.h" @@ -207,7 +209,24 @@ _thr_rtld_init(void) li.thread_set_flag = _thr_rtld_set_flag; li.thread_clr_flag = _thr_rtld_clr_flag; li.at_fork = NULL; - + + /* + * Preresolve the symbols needed for the fork interposer. We + * call _rtld_atfork_pre() and _rtld_atfork_post() with NULL + * argument to indicate that no actual locking inside the + * functions should happen. Neither rtld compat locks nor + * libthr rtld locks cannot work there: + * - compat locks do not handle the case of two locks taken + * in write mode (the signal mask for the thread is corrupted); + * - libthr locks would work, but locked rtld_bind_lock prevents + * symbol resolution for _rtld_atfork_post. + */ + _rtld_atfork_pre(NULL); + _rtld_atfork_post(NULL); + _malloc_prefork(); + _malloc_postfork(); + syscall(SYS_getpid); + /* mask signals, also force to resolve __sys_sigprocmask PLT */ _thr_signal_block(curthread); _rtld_thread_init(&li); Modified: head/libexec/rtld-elf/rtld_lock.c ============================================================================== --- head/libexec/rtld-elf/rtld_lock.c Sat May 24 10:20:56 2014 (r266608) +++ head/libexec/rtld-elf/rtld_lock.c Sat May 24 10:23:06 2014 (r266609) @@ -365,8 +365,19 @@ _rtld_atfork_pre(int *locks) { RtldLockState ls[2]; + if (locks == NULL) + return; + + /* + * Warning: this does not work with the rtld compat locks + * above, since the thread signal mask is corrupted (set to + * all signals blocked) if two locks are taken in write mode. + * The caller of the _rtld_atfork_pre() must provide the + * working implementation of the locks, and libthr locks are + * fine. + */ wlock_acquire(rtld_phdr_lock, &ls[0]); - rlock_acquire(rtld_bind_lock, &ls[1]); + wlock_acquire(rtld_bind_lock, &ls[1]); /* XXXKIB: I am really sorry for this. */ locks[0] = ls[1].lockstate; @@ -378,6 +389,9 @@ _rtld_atfork_post(int *locks) { RtldLockState ls[2]; + if (locks == NULL) + return; + bzero(ls, sizeof(ls)); ls[0].lockstate = locks[2]; ls[1].lockstate = locks[0]; From owner-svn-src-head@FreeBSD.ORG Sat May 24 13:00:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A77164A; Sat, 24 May 2014 13:00:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8816E29B2; Sat, 24 May 2014 13:00:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4OD0oTd083625; Sat, 24 May 2014 13:00:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4OD0oDX083623; Sat, 24 May 2014 13:00:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405241300.s4OD0oDX083623@svn.freebsd.org> From: Alexander Motin Date: Sat, 24 May 2014 13:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266615 - in head/sys/dev: mpr mps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 13:00:50 -0000 Author: mav Date: Sat May 24 13:00:49 2014 New Revision: 266615 URL: http://svnweb.freebsd.org/changeset/base/266615 Log: Increase taskqueue thread priority from idle to PRIBIO. Idle priority is not even time-share, so if system is busy in any way, those events may never be executed. Since in some cases system waits for events processed by that thread, that may cause deadlocks. Modified: head/sys/dev/mpr/mpr_sas.c head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Sat May 24 12:16:33 2014 (r266614) +++ head/sys/dev/mpr/mpr_sas.c Sat May 24 13:00:49 2014 (r266615) @@ -764,9 +764,7 @@ mpr_attach_sas(struct mpr_softc *sc) TASK_INIT(&sassc->ev_task, 0, mprsas_firmware_event_work, sc); sassc->ev_tq = taskqueue_create("mpr_taskq", M_NOWAIT | M_ZERO, taskqueue_thread_enqueue, &sassc->ev_tq); - - /* Run the task queue with lowest priority */ - taskqueue_start_threads(&sassc->ev_tq, 1, 255, "%s taskq", + taskqueue_start_threads(&sassc->ev_tq, 1, PRIBIO, "%s taskq", device_get_nameunit(sc->mpr_dev)); mpr_lock(sc); Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Sat May 24 12:16:33 2014 (r266614) +++ head/sys/dev/mps/mps_sas.c Sat May 24 13:00:49 2014 (r266615) @@ -749,9 +749,7 @@ mps_attach_sas(struct mps_softc *sc) TASK_INIT(&sassc->ev_task, 0, mpssas_firmware_event_work, sc); sassc->ev_tq = taskqueue_create("mps_taskq", M_NOWAIT | M_ZERO, taskqueue_thread_enqueue, &sassc->ev_tq); - - /* Run the task queue with lowest priority */ - taskqueue_start_threads(&sassc->ev_tq, 1, 255, "%s taskq", + taskqueue_start_threads(&sassc->ev_tq, 1, PRIBIO, "%s taskq", device_get_nameunit(sc->mps_dev)); mps_lock(sc); From owner-svn-src-head@FreeBSD.ORG Sat May 24 14:01:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7F0924D; Sat, 24 May 2014 14:01:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C62842DE2; Sat, 24 May 2014 14:01:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4OE1IeN009990; Sat, 24 May 2014 14:01:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4OE1IBZ009986; Sat, 24 May 2014 14:01:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201405241401.s4OE1IBZ009986@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 24 May 2014 14:01:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266618 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 14:01:18 -0000 Author: bz Date: Sat May 24 14:01:18 2014 New Revision: 266618 URL: http://svnweb.freebsd.org/changeset/base/266618 Log: Make tcp_twrespond() file local private; this removes it from the public KPI; it is not used anywhere else and seems it never was. MFC after: 2 weeks Modified: head/sys/netinet/tcp_timewait.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Sat May 24 13:34:41 2014 (r266617) +++ head/sys/netinet/tcp_timewait.c Sat May 24 14:01:18 2014 (r266618) @@ -122,6 +122,7 @@ static VNET_DEFINE(struct rwlock, tw_loc static void tcp_tw_2msl_reset(struct tcptw *, int); static void tcp_tw_2msl_stop(struct tcptw *, int); +static int tcp_twrespond(struct tcptw *, int); /* * tw_pcbref() bumps the reference count on an tw in order to maintain @@ -508,7 +509,7 @@ tcp_twclose(struct tcptw *tw, int reuse) TCPSTAT_INC(tcps_closed); } -int +static int tcp_twrespond(struct tcptw *tw, int flags) { struct inpcb *inp = tw->tw_inpcb; Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Sat May 24 13:34:41 2014 (r266617) +++ head/sys/netinet/tcp_var.h Sat May 24 14:01:18 2014 (r266618) @@ -678,7 +678,6 @@ void tcp_tw_destroy(void); void tcp_tw_zone_change(void); int tcp_twcheck(struct inpcb *, struct tcpopt *, struct tcphdr *, struct mbuf *, int); -int tcp_twrespond(struct tcptw *, int); void tcp_setpersist(struct tcpcb *); #ifdef TCP_SIGNATURE int tcp_signature_compute(struct mbuf *, int, int, int, u_char *, u_int); From owner-svn-src-head@FreeBSD.ORG Sat May 24 14:59:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 414FFD10; Sat, 24 May 2014 14:59:46 +0000 (UTC) Received: from mailrelay011.isp.belgacom.be (mailrelay011.isp.belgacom.be [195.238.6.178]) by mx1.freebsd.org (Postfix) with ESMTP id 02F20222C; Sat, 24 May 2014 14:59:44 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At4GAJKygFNbsXvB/2dsb2JhbABagweuWZROAYEDF3SCJQEBBTIBIyMQCw4KCSUPKh4GE4hGAddfF45SB4RAAQOZcpMogzo7 Received: from 193.123-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.123.193]) by relay.skynet.be with ESMTP; 24 May 2014 16:59:42 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.8/8.14.8) with ESMTP id s4OExf9D074611; Sat, 24 May 2014 16:59:41 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Sat, 24 May 2014 16:59:40 +0200 From: Tijl Coosemans To: Warner Losh Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140524165940.3c687553@kalimero.tijl.coosemans.org> In-Reply-To: References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: Baptiste Daroussin , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Glen Barber , Nathan Whitehorn , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 14:59:46 -0000 On Fri, 23 May 2014 17:29:48 -0600 Warner Losh wrote: > On May 23, 2014, at 10:20 AM, Baptiste Daroussin wrote: >> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: >>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: >>>>> Is there any chance of finally switching the pkg abi identifiers to just >>>>> be uname -p? >>>>> -Nathan >>>> Keeping asking won't make it happen, I have explained a large number of time why it >>>> happened, why it is not easy for compatibility and why uname -p is still not >>>> representing the ABI we do support, and what flexibility we need that the >>>> current string offers to us. >>>> >>>> if one is willing to do the work, please be my guess, just dig into the archives >>>> and join the pkg development otherwise: no it won't happen before a while >>>> because we have way too much work on the todo and this item is stored at the >>>> very end of this todo. >>>> >>>> regards, >>>> Bapt >>> >>> I'm happy to do the work, and have volunteered now many times. If uname >>> -p does not describe the ABI fully, then uname -p needs changes on the >>> relevant platforms. Which are they? What extra flexibility does the >>> string give you if uname -p describes the ABI completely? >>> -Nathan >> >> just simple examples in armv6: >> - eabi vs oabi >> - The different float abi (even if only one is supported for now others are >> being worked on) >> - little endian vs big endian > > All of those are encoded in the MACHINE_ARCH + freebsd version, no exceptions > on supported architectures that are tier 2 or higher. This seems like a weak reason. > >> the extras flexibilit is being able to say this binary do support freebsd i386 >> and amd64 in one key, freebsd:9:x86:*, or or all arches freebsd:10:* > > Will there be a program to convert this new, special invention to the standard > that we’ve used for the past 20 years? If you need the flexibility, which I’m not > entirely sure I’ve seen a good use case for. When would you have a x86 binary > package? Wouldn’t it be either i386 or amd64? ABI isn't just about the instruction set. It's also about the sizes of C types (like pointers). If I remember correctly, the pkg scheme was chosen to allow for ABIs like x32 which use the 64 bit instruction set with 32 bit pointers. MACHINE_ARCH would also be amd64 in this case. The advantage of the pkg scheme is that it has a formal structure. That's what makes it flexible, extensible, machine parsable, etc. I'd rather see the rest of FreeBSD adopt this scheme than that pkg would have to adopt the informal names. The use of x86 instead of i386/amd64 is part of the idea to merge more of sys/i386 and sys/amd64 into sys/x86 and eventually define MACHINE as "x86". Patterns like freebsd:9:* will probably become more prevalent when support for subpackages is added. Some of the subpackages (like documentation) will be ABI independent. From owner-svn-src-head@FreeBSD.ORG Sat May 24 15:03:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97200E9C; Sat, 24 May 2014 15:03:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84F6322C5; Sat, 24 May 2014 15:03:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4OF3aAQ041895; Sat, 24 May 2014 15:03:36 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4OF3aFs041894; Sat, 24 May 2014 15:03:36 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201405241503.s4OF3aFs041894@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 24 May 2014 15:03:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266619 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 15:03:36 -0000 Author: bz Date: Sat May 24 15:03:36 2014 New Revision: 266619 URL: http://svnweb.freebsd.org/changeset/base/266619 Log: syncache_lookup() is a file local function. Make it static and take it out of the public KPI; seems it was never used elsewhere. MFC after: 2 weeks Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sat May 24 14:01:18 2014 (r266618) +++ head/sys/netinet/tcp_syncache.c Sat May 24 15:03:36 2014 (r266619) @@ -122,7 +122,6 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, static void syncache_drop(struct syncache *, struct syncache_head *); static void syncache_free(struct syncache *); static void syncache_insert(struct syncache *, struct syncache_head *); -struct syncache *syncache_lookup(struct in_conninfo *, struct syncache_head **); static int syncache_respond(struct syncache *); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); @@ -482,7 +481,7 @@ syncache_timer(void *xsch) * Find an entry in the syncache. * Returns always with locked syncache_head plus a matching entry or NULL. */ -struct syncache * +static struct syncache * syncache_lookup(struct in_conninfo *inc, struct syncache_head **schp) { struct syncache *sc; From owner-svn-src-head@FreeBSD.ORG Sat May 24 15:31:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9D3252B; Sat, 24 May 2014 15:31:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D621724D2; Sat, 24 May 2014 15:31:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4OFVeib055507; Sat, 24 May 2014 15:31:40 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4OFVeRo055506; Sat, 24 May 2014 15:31:40 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201405241531.s4OFVeRo055506@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 24 May 2014 15:31:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266620 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 15:31:41 -0000 Author: bz Date: Sat May 24 15:31:40 2014 New Revision: 266620 URL: http://svnweb.freebsd.org/changeset/base/266620 Log: Remove the prototpye for the static inline function tcp_signature_verify_input(). The function is defined before first use already. MFC after: 2 weeks Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sat May 24 15:03:36 2014 (r266619) +++ head/sys/netinet/tcp_input.c Sat May 24 15:31:40 2014 (r266620) @@ -229,10 +229,6 @@ static void tcp_pulloutofband(struct so struct tcphdr *, struct mbuf *, int); static void tcp_xmit_timer(struct tcpcb *, int); static void tcp_newreno_partial_ack(struct tcpcb *, struct tcphdr *); -#ifdef TCP_SIGNATURE -static int inline tcp_signature_verify_input(struct mbuf *, int, int, - int, struct tcpopt *, struct tcphdr *, u_int); -#endif static void inline cc_ack_received(struct tcpcb *tp, struct tcphdr *th, uint16_t type); static void inline cc_conn_init(struct tcpcb *tp); From owner-svn-src-head@FreeBSD.ORG Sat May 24 16:04:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23CFCFCB; Sat, 24 May 2014 16:04:42 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 8B977273A; Sat, 24 May 2014 16:04:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 7625538064; Sat, 24 May 2014 11:04:35 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id gKvlgBymc7eL; Sat, 24 May 2014 11:04:35 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 967F838061; Sat, 24 May 2014 11:04:34 -0500 (CDT) Message-ID: <5380C311.60201@freebsd.org> Date: Sat, 24 May 2014 09:04:33 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Tijl Coosemans , Warner Losh Subject: Re: svn commit: r266553 - head/release/scripts References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> In-Reply-To: <20140524165940.3c687553@kalimero.tijl.coosemans.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, Glen Barber , Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 16:04:42 -0000 On 05/24/14 07:59, Tijl Coosemans wrote: > On Fri, 23 May 2014 17:29:48 -0600 Warner Losh wrote: >> On May 23, 2014, at 10:20 AM, Baptiste Daroussin wrote: >>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: >>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: >>>>>> Is there any chance of finally switching the pkg abi identifiers to just >>>>>> be uname -p? >>>>>> -Nathan >>>>> Keeping asking won't make it happen, I have explained a large number of time why it >>>>> happened, why it is not easy for compatibility and why uname -p is still not >>>>> representing the ABI we do support, and what flexibility we need that the >>>>> current string offers to us. >>>>> >>>>> if one is willing to do the work, please be my guess, just dig into the archives >>>>> and join the pkg development otherwise: no it won't happen before a while >>>>> because we have way too much work on the todo and this item is stored at the >>>>> very end of this todo. >>>>> >>>>> regards, >>>>> Bapt >>>> I'm happy to do the work, and have volunteered now many times. If uname >>>> -p does not describe the ABI fully, then uname -p needs changes on the >>>> relevant platforms. Which are they? What extra flexibility does the >>>> string give you if uname -p describes the ABI completely? >>>> -Nathan >>> just simple examples in armv6: >>> - eabi vs oabi >>> - The different float abi (even if only one is supported for now others are >>> being worked on) >>> - little endian vs big endian >> All of those are encoded in the MACHINE_ARCH + freebsd version, no exceptions >> on supported architectures that are tier 2 or higher. This seems like a weak reason. >> >>> the extras flexibilit is being able to say this binary do support freebsd i386 >>> and amd64 in one key, freebsd:9:x86:*, or or all arches freebsd:10:* >> Will there be a program to convert this new, special invention to the standard >> that we’ve used for the past 20 years? If you need the flexibility, which I’m not >> entirely sure I’ve seen a good use case for. When would you have a x86 binary >> package? Wouldn’t it be either i386 or amd64? > ABI isn't just about the instruction set. It's also about the sizes of C > types (like pointers). If I remember correctly, the pkg scheme was chosen > to allow for ABIs like x32 which use the 64 bit instruction set with 32 > bit pointers. MACHINE_ARCH would also be amd64 in this case. No, it wouldn't. MACHINE_ARCH would be something else (x32, probably) in such cases. MACHINE_ARCH (and uname -p, which reports it) is the FreeBSD ABI identifier and encodes 100% of the ABI information. This would be true even if there is never an x32 kernel. > The advantage of the pkg scheme is that it has a formal structure. That's > what makes it flexible, extensible, machine parsable, etc. I'd rather see > the rest of FreeBSD adopt this scheme than that pkg would have to adopt > the informal names. The use of x86 instead of i386/amd64 is part of the > idea to merge more of sys/i386 and sys/amd64 into sys/x86 and eventually > define MACHINE as "x86". We need one set of platform names. FreeBSD has used MACHINE_ARCH values for a very long time for this and uses them absolutely everywhere in the ports and src trees -- except for the internals of pkg. I don't think they can be changed at this point, even if some names are slightly cryptic. They are at least internally consistent, and that's a huge win. I agree it will be good to get i386 and amd64 sharing a MACHINE_CPUARCH and MACHINE value at some point, but it's not really related to the issue of uniform ABI tags. > Patterns like freebsd:9:* will probably become more prevalent when support > for subpackages is added. Some of the subpackages (like documentation) will > be ABI independent. > That wouldn't be affected by using standard ABI identifiers. On a more general note, any flexibility provided by things like x86:64 is illusory anyway. Not all amd64 systems can run i386 binaries. Some ia64 systems *can* run i386 binaries. i386 systems cannot run amd64 binaries on FreeBSD -- but on OS X they sometimes can. Some powerpc systems can run little-endian binaries, but not all (G5s notably cannot). It's just not possible to make static decisions here and there doesn't seem to be any reason to invent a fragile alternative definition of ABI identifiers that is at variance with everything else in FreeBSD for apparently the sole purpose of facilitating something that is intrinsically fragile and can't be relied upon. This is especially true given that the kernel *does* tell you, in MACHINE_ARCH terms, what binaries any given system can run -- but for pkg to use that information, it currently needs a mapping table! -Nathan From owner-svn-src-head@FreeBSD.ORG Sat May 24 16:21:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C871F344; Sat, 24 May 2014 16:21:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4E612880; Sat, 24 May 2014 16:21:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4OGLHRg076176; Sat, 24 May 2014 16:21:17 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4OGLGJE076170; Sat, 24 May 2014 16:21:16 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405241621.s4OGLGJE076170@svn.freebsd.org> From: Ian Lepore Date: Sat, 24 May 2014 16:21:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266621 - in head/sys/arm: arm include ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 16:21:17 -0000 Author: ian Date: Sat May 24 16:21:16 2014 New Revision: 266621 URL: http://svnweb.freebsd.org/changeset/base/266621 Log: Eliminate one of the causes of spurious interrupts on armv6. The arm weak memory ordering model allows writes to different devices to complete out of order, leading to a situation where the write that clears an interrupt source at a device can complete after a write that unmasks and EOIs the interrupt at the interrupt controller, leading to a spurious re-interrupt. This adds a generic barrier function specific to the needs of interrupt controllers, and calls that function from the GIC and TI AINTC controllers. There may still be other soc-specific controllers that need to make the call. Reviewed by: cognet, Svatopluk Kraus MFC after: 3 days Modified: head/sys/arm/arm/gic.c head/sys/arm/arm/intr.c head/sys/arm/include/intr.h head/sys/arm/ti/aintc.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Sat May 24 15:31:40 2014 (r266620) +++ head/sys/arm/arm/gic.c Sat May 24 16:21:16 2014 (r266621) @@ -83,6 +83,8 @@ __FBSDID("$FreeBSD$"); #define GICC_ABPR 0x001C /* v1 ICCABPR */ #define GICC_IIDR 0x00FC /* v1 ICCIIDR*/ +#define GIC_LAST_IPI 15 /* Irqs 0-15 are IPIs. */ + /* First bit is a polarity bit (0 - low, 1 - high) */ #define GICD_ICFGR_POL_LOW (0 << 0) #define GICD_ICFGR_POL_HIGH (1 << 0) @@ -268,6 +270,8 @@ gic_post_filter(void *arg) { uintptr_t irq = (uintptr_t) arg; + if (irq > GIC_LAST_IPI) + arm_irq_memory_barrier(irq); gic_c_write_4(GICC_EOIR, irq); } @@ -284,13 +288,13 @@ arm_get_next_irq(int last_irq) * have this information later. */ - if ((active_irq & 0x3ff) < 16) + if ((active_irq & 0x3ff) <= GIC_LAST_IPI) gic_c_write_4(GICC_EOIR, active_irq); active_irq &= 0x3FF; if (active_irq == 0x3FF) { if (last_irq == -1) - printf("Spurious interrupt detected [0x%08x]\n", active_irq); + printf("Spurious interrupt detected\n"); return -1; } @@ -309,6 +313,8 @@ void arm_unmask_irq(uintptr_t nb) { + if (nb > GIC_LAST_IPI) + arm_irq_memory_barrier(nb); gic_d_write_4(GICD_ISENABLER(nb >> 5), (1UL << (nb & 0x1F))); } Modified: head/sys/arm/arm/intr.c ============================================================================== --- head/sys/arm/arm/intr.c Sat May 24 15:31:40 2014 (r266620) +++ head/sys/arm/arm/intr.c Sat May 24 16:21:16 2014 (r266621) @@ -149,3 +149,67 @@ arm_irq_handler(struct trapframe *frame) } } } + +/* + * arm_irq_memory_barrier() + * + * Ensure all writes to device memory have reached devices before proceeding. + * + * This is intended to be called from the post-filter and post-thread routines + * of an interrupt controller implementation. A peripheral device driver should + * use bus_space_barrier() if it needs to ensure a write has reached the + * hardware for some reason other than clearing interrupt conditions. + * + * The need for this function arises from the ARM weak memory ordering model. + * Writes to locations mapped with the Device attribute bypass any caches, but + * are buffered. Multiple writes to the same device will be observed by that + * device in the order issued by the cpu. Writes to different devices may + * appear at those devices in a different order than issued by the cpu. That + * is, if the cpu writes to device A then device B, the write to device B could + * complete before the write to device A. + * + * Consider a typical device interrupt handler which services the interrupt and + * writes to a device status-acknowledge register to clear the interrupt before + * returning. That write is posted to the L2 controller which "immediately" + * places it in a store buffer and automatically drains that buffer. This can + * be less immediate than you'd think... There may be no free slots in the store + * buffers, so an existing buffer has to be drained first to make room. The + * target bus may be busy with other traffic (such as DMA for various devices), + * delaying the drain of the store buffer for some indeterminate time. While + * all this delay is happening, execution proceeds on the CPU, unwinding its way + * out of the interrupt call stack to the point where the interrupt driver code + * is ready to EOI and unmask the interrupt. The interrupt controller may be + * accessed via a faster bus than the hardware whose handler just ran; the write + * to unmask and EOI the interrupt may complete quickly while the device write + * to ack and clear the interrupt source is still lingering in a store buffer + * waiting for access to a slower bus. With the interrupt unmasked at the + * interrupt controller but still active at the device, as soon as interrupts + * are enabled on the core the device re-interrupts immediately: now you've got + * a spurious interrupt on your hands. + * + * The right way to fix this problem is for every device driver to use the + * proper bus_space_barrier() calls in its interrupt handler. For ARM a single + * barrier call at the end of the handler would work. This would have to be + * done to every driver in the system, not just arm-specific drivers. + * + * Another potential fix is to map all device memory as Strongly-Ordered rather + * than Device memory, which takes the store buffers out of the picture. This + * has a pretty big impact on overall system performance, because each strongly + * ordered memory access causes all L2 store buffers to be drained. + * + * A compromise solution is to have the interrupt controller implementation call + * this function to establish a barrier between writes to the interrupt-source + * device and writes to the interrupt controller device. + * + * This takes the interrupt number as an argument, and currently doesn't use it. + * The plan is that maybe some day there is a way to flag certain interrupts as + * "memory barrier safe" and we can avoid this overhead with them. + */ +void +arm_irq_memory_barrier(uintptr_t irq) +{ + + dsb(); + cpu_l2cache_drain_writebuf(); +} + Modified: head/sys/arm/include/intr.h ============================================================================== --- head/sys/arm/include/intr.h Sat May 24 15:31:40 2014 (r266620) +++ head/sys/arm/include/intr.h Sat May 24 16:21:16 2014 (r266621) @@ -79,6 +79,8 @@ extern void (*arm_post_filter)(void *); extern int (*arm_config_irq)(int irq, enum intr_trigger trig, enum intr_polarity pol); +void arm_irq_memory_barrier(uintptr_t); + void gic_init_secondary(void); #endif /* _MACHINE_INTR_H */ Modified: head/sys/arm/ti/aintc.c ============================================================================== --- head/sys/arm/ti/aintc.c Sat May 24 15:31:40 2014 (r266620) +++ head/sys/arm/ti/aintc.c Sat May 24 16:21:16 2014 (r266621) @@ -180,5 +180,7 @@ arm_mask_irq(uintptr_t nb) void arm_unmask_irq(uintptr_t nb) { + + arm_irq_memory_barrier(nb); aintc_write_4(INTC_MIR_CLEAR(nb >> 5), (1UL << (nb & 0x1F))); } From owner-svn-src-head@FreeBSD.ORG Sat May 24 16:53:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7347D13; Sat, 24 May 2014 16:53:59 +0000 (UTC) Received: from mailrelay010.isp.belgacom.be (mailrelay010.isp.belgacom.be [195.238.6.177]) by mx1.freebsd.org (Postfix) with ESMTP id 969EC2AAE; Sat, 24 May 2014 16:53:58 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At8GAIHNgFNbsXvB/2dsb2JhbABagweBHa08lE4BgQMXdIIlAQEFMgEjIxALDgQGCSUPKhAOBhOIRgHXXReOUgeEQAEDmXKTKIM6Ow Received: from 193.123-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.123.193]) by relay.skynet.be with ESMTP; 24 May 2014 18:53:50 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.8/8.14.8) with ESMTP id s4OGrljO078147; Sat, 24 May 2014 18:53:48 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Sat, 24 May 2014 18:53:45 +0200 From: Tijl Coosemans To: Nathan Whitehorn Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140524185345.263f230d@kalimero.tijl.coosemans.org> In-Reply-To: <5380C311.60201@freebsd.org> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, Glen Barber , svn-src-head@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 16:54:00 -0000 On Sat, 24 May 2014 09:04:33 -0700 Nathan Whitehorn wrote: > On 05/24/14 07:59, Tijl Coosemans wrote: >> On Fri, 23 May 2014 17:29:48 -0600 Warner Losh wrote: >>> On May 23, 2014, at 10:20 AM, Baptiste Daroussin wrote: >>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: >>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: >>>>>>> Is there any chance of finally switching the pkg abi identifiers to just >>>>>>> be uname -p? >>>>>>> -Nathan >>>>>> Keeping asking won't make it happen, I have explained a large number of time why it >>>>>> happened, why it is not easy for compatibility and why uname -p is still not >>>>>> representing the ABI we do support, and what flexibility we need that the >>>>>> current string offers to us. >>>>>> >>>>>> if one is willing to do the work, please be my guess, just dig into the archives >>>>>> and join the pkg development otherwise: no it won't happen before a while >>>>>> because we have way too much work on the todo and this item is stored at the >>>>>> very end of this todo. >>>>>> >>>>>> regards, >>>>>> Bapt >>>>> I'm happy to do the work, and have volunteered now many times. If uname >>>>> -p does not describe the ABI fully, then uname -p needs changes on the >>>>> relevant platforms. Which are they? What extra flexibility does the >>>>> string give you if uname -p describes the ABI completely? >>>>> -Nathan >>>> just simple examples in armv6: >>>> - eabi vs oabi >>>> - The different float abi (even if only one is supported for now others are >>>> being worked on) >>>> - little endian vs big endian >>> All of those are encoded in the MACHINE_ARCH + freebsd version, no exceptions >>> on supported architectures that are tier 2 or higher. This seems like a weak reason. >>> >>>> the extras flexibilit is being able to say this binary do support freebsd i386 >>>> and amd64 in one key, freebsd:9:x86:*, or or all arches freebsd:10:* >>> Will there be a program to convert this new, special invention to the standard >>> that we’ve used for the past 20 years? If you need the flexibility, which I’m not >>> entirely sure I’ve seen a good use case for. When would you have a x86 binary >>> package? Wouldn’t it be either i386 or amd64? >> ABI isn't just about the instruction set. It's also about the sizes of C >> types (like pointers). If I remember correctly, the pkg scheme was chosen >> to allow for ABIs like x32 which use the 64 bit instruction set with 32 >> bit pointers. MACHINE_ARCH would also be amd64 in this case. > > No, it wouldn't. MACHINE_ARCH would be something else (x32, probably) in > such cases. MACHINE_ARCH (and uname -p, which reports it) is the FreeBSD > ABI identifier and encodes 100% of the ABI information. This would be > true even if there is never an x32 kernel. No, there's no such thing as an x32 kernel. It's an amd64 kernel that supports a second userland ABI. In C preprocessor terms they are distinguished by (__amd64__ && _LP64) and (__amd64__ && !_LP64). uname -p gives you the processor architecture (the __amd64__ bit) but then you can still choose the sizes of standard C types (the _LP64 bit). So far we've always had one ABI per processor architecture but this is not strictly necessary. From owner-svn-src-head@FreeBSD.ORG Sat May 24 18:24:06 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48B36D55; Sat, 24 May 2014 18:24:06 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0216E2121; Sat, 24 May 2014 18:24:05 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WoGbu-000E5E-0a; Sat, 24 May 2014 18:23:58 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s4OINtf8049088; Sat, 24 May 2014 12:23:55 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19b5G5mov4II+e+XygBd1Ez Subject: Re: svn commit: r266553 - head/release/scripts From: Ian Lepore To: Tijl Coosemans In-Reply-To: <20140524185345.263f230d@kalimero.tijl.coosemans.org> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> Content-Type: text/plain; charset="iso-8859-7" Date: Sat, 24 May 2014 12:23:55 -0600 Message-ID: <1400955835.1152.323.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by damnhippie.dyndns.org id s4OINtf8049088 Cc: Baptiste Daroussin , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Glen Barber , Nathan Whitehorn , svn-src-head@FreeBSD.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 18:24:06 -0000 On Sat, 2014-05-24 at 18:53 +0200, Tijl Coosemans wrote: > On Sat, 24 May 2014 09:04:33 -0700 Nathan Whitehorn wrote: > > On 05/24/14 07:59, Tijl Coosemans wrote: > >> On Fri, 23 May 2014 17:29:48 -0600 Warner Losh wrote: > >>> On May 23, 2014, at 10:20 AM, Baptiste Daroussin = wrote: > >>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: > >>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: > >>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote= : > >>>>>>> Is there any chance of finally switching the pkg abi identifier= s to just > >>>>>>> be uname -p? > >>>>>>> -Nathan > >>>>>> Keeping asking won't make it happen, I have explained a large nu= mber of time why it > >>>>>> happened, why it is not easy for compatibility and why uname -p = is still not > >>>>>> representing the ABI we do support, and what flexibility we need= that the > >>>>>> current string offers to us. > >>>>>> > >>>>>> if one is willing to do the work, please be my guess, just dig i= nto the archives > >>>>>> and join the pkg development otherwise: no it won't happen befor= e a while > >>>>>> because we have way too much work on the todo and this item is s= tored at the > >>>>>> very end of this todo. > >>>>>> > >>>>>> regards, > >>>>>> Bapt > >>>>> I'm happy to do the work, and have volunteered now many times. If= uname > >>>>> -p does not describe the ABI fully, then uname -p needs changes o= n the > >>>>> relevant platforms. Which are they? What extra flexibility does t= he > >>>>> string give you if uname -p describes the ABI completely? > >>>>> -Nathan > >>>> just simple examples in armv6: > >>>> - eabi vs oabi > >>>> - The different float abi (even if only one is supported for now o= thers are > >>>> being worked on) > >>>> - little endian vs big endian > >>> All of those are encoded in the MACHINE_ARCH + freebsd version, no = exceptions > >>> on supported architectures that are tier 2 or higher. This seems li= ke a weak reason. > >>> > >>>> the extras flexibilit is being able to say this binary do support = freebsd i386 > >>>> and amd64 in one key, freebsd:9:x86:*, or or all arches freebsd:10= :* > >>> Will there be a program to convert this new, special invention to t= he standard > >>> that we=A2ve used for the past 20 years? If you need the flexibilit= y, which I=A2m not > >>> entirely sure I=A2ve seen a good use case for. When would you have = a x86 binary > >>> package? Wouldn=A2t it be either i386 or amd64? > >> ABI isn't just about the instruction set. It's also about the sizes= of C > >> types (like pointers). If I remember correctly, the pkg scheme was = chosen > >> to allow for ABIs like x32 which use the 64 bit instruction set with= 32 > >> bit pointers. MACHINE_ARCH would also be amd64 in this case. > >=20 > > No, it wouldn't. MACHINE_ARCH would be something else (x32, probably)= in=20 > > such cases. MACHINE_ARCH (and uname -p, which reports it) is the Free= BSD=20 > > ABI identifier and encodes 100% of the ABI information. This would be= =20 > > true even if there is never an x32 kernel. >=20 > No, there's no such thing as an x32 kernel. It's an amd64 kernel that > supports a second userland ABI. In C preprocessor terms they are > distinguished by (__amd64__ && _LP64) and (__amd64__ && !_LP64). > uname -p gives you the processor architecture (the __amd64__ bit) but > then you can still choose the sizes of standard C types (the _LP64 bit). > So far we've always had one ABI per processor architecture but this > is not strictly necessary. >=20 All you have to do is look at the plethora of ARM ABIs we support (and the corresponding separate kernel for each) to see the falseness of that last sentence. ARM variations include v4 vs v6, OABI vs EABI (calling and register usage standards), hard vs soft float, little vs big endian. Virtually all combinations of those are possible (there are a few combos we don't support), and each one has its own MACHINE_ARCH. -- Ian From owner-svn-src-head@FreeBSD.ORG Sat May 24 18:56:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C67FE72 for ; Sat, 24 May 2014 18:56:30 +0000 (UTC) Received: from mail-ie0-f171.google.com (mail-ie0-f171.google.com [209.85.223.171]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D75A23F2 for ; Sat, 24 May 2014 18:56:29 +0000 (UTC) Received: by mail-ie0-f171.google.com with SMTP id to1so6335138ieb.30 for ; Sat, 24 May 2014 11:56:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=vx8yWcW9df+NLXIqVvizZY+C1CGvyJcCUddybmowf7I=; b=Fm48lo0pslHH2ysp3LYWzLUvjIu1a/wtYYIRwEVaAPEunn2+CaMkqnaPxIgcAfrl4x yHDq6P89mqwFGp1VEexqicfejr5FGW5wPZH2x7cAzXTjdUdWkNekgJ9kgsz6ygf7GndO xLE3bwoPK/AwzIPjq8ZAX4k4c9HHpwnVb09iPTauj/snZepoeWid3TyI0spNxNJaz7LC AktySpsrnDXN9WqSY27ss9rNGUgCIz2F3p5P5LDOWt0vOmNXyIN8u/10heZP6kkY83Z2 N01DXGwGisQwxjQQxDrHAnkVGPZELpQl84PeXfm3OzGvuZ8ZexA3kPmzE8Epd1XCnhnb XBbA== X-Gm-Message-State: ALoCoQnmbN1MiVN8Ux7r7SDbwA5U+CkzshugRVear9bxtutiUlP6ei+K8zg0oVgFPIhV5URdoh4p X-Received: by 10.50.43.201 with SMTP id y9mr13830826igl.12.1400957783161; Sat, 24 May 2014 11:56:23 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id d6sm13757981igr.12.2014.05.24.11.56.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 24 May 2014 11:56:22 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_430514DB-3337-47FD-AF8D-5A9C63E9164F"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266553 - head/release/scripts From: Warner Losh In-Reply-To: <20140524165940.3c687553@kalimero.tijl.coosemans.org> Date: Sat, 24 May 2014 12:56:30 -0600 Message-Id: References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> To: Tijl Coosemans X-Mailer: Apple Mail (2.1878.2) Cc: Baptiste Daroussin , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Glen Barber , Nathan Whitehorn , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 18:56:30 -0000 --Apple-Mail=_430514DB-3337-47FD-AF8D-5A9C63E9164F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On May 24, 2014, at 8:59 AM, Tijl Coosemans wrote: > On Fri, 23 May 2014 17:29:48 -0600 Warner Losh wrote: >> On May 23, 2014, at 10:20 AM, Baptiste Daroussin = wrote: >>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: >>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: >>>>>> Is there any chance of finally switching the pkg abi identifiers = to just >>>>>> be uname -p? >>>>>> -Nathan >>>>> Keeping asking won't make it happen, I have explained a large = number of time why it >>>>> happened, why it is not easy for compatibility and why uname -p is = still not >>>>> representing the ABI we do support, and what flexibility we need = that the >>>>> current string offers to us. >>>>>=20 >>>>> if one is willing to do the work, please be my guess, just dig = into the archives >>>>> and join the pkg development otherwise: no it won't happen before = a while >>>>> because we have way too much work on the todo and this item is = stored at the >>>>> very end of this todo. >>>>>=20 >>>>> regards, >>>>> Bapt >>>>=20 >>>> I'm happy to do the work, and have volunteered now many times. If = uname=20 >>>> -p does not describe the ABI fully, then uname -p needs changes on = the=20 >>>> relevant platforms. Which are they? What extra flexibility does the=20= >>>> string give you if uname -p describes the ABI completely? >>>> -Nathan >>>=20 >>> just simple examples in armv6: >>> - eabi vs oabi >>> - The different float abi (even if only one is supported for now = others are >>> being worked on) >>> - little endian vs big endian >>=20 >> All of those are encoded in the MACHINE_ARCH + freebsd version, no = exceptions >> on supported architectures that are tier 2 or higher. This seems like = a weak reason. >>=20 >>> the extras flexibilit is being able to say this binary do support = freebsd i386 >>> and amd64 in one key, freebsd:9:x86:*, or or all arches freebsd:10:* >>=20 >> Will there be a program to convert this new, special invention to the = standard >> that we=92ve used for the past 20 years? If you need the flexibility, = which I=92m not >> entirely sure I=92ve seen a good use case for. When would you have a = x86 binary >> package? Wouldn=92t it be either i386 or amd64? >=20 > ABI isn't just about the instruction set. It's also about the sizes = of C > types (like pointers). If I remember correctly, the pkg scheme was = chosen > to allow for ABIs like x32 which use the 64 bit instruction set with = 32 > bit pointers. MACHINE_ARCH would also be amd64 in this case. ABIs like x32 would not have a MACHINE_ARCH of =93amd64=94 but would = have a MACHINE_ARCH of =93x32=94. This is exactly what we do with mips today. = So this ins=92t an argument for not using MACHINE_ARCH directly, rather = than having an arbitrary mapping (which is the problem with the proposed scheme). MACHINE_ARCH, as it stands in FreeBSD, uniquely defines the ABI (modulo occasional bugs that are fixed). > The advantage of the pkg scheme is that it has a formal structure. = That's > what makes it flexible, extensible, machine parsable, etc. I'd rather = see > the rest of FreeBSD adopt this scheme than that pkg would have to = adopt > the informal names. The use of x86 instead of i386/amd64 is part of = the > idea to merge more of sys/i386 and sys/amd64 into sys/x86 and = eventually > define MACHINE as "x86=94. MACHINE and MACHINE_ARCH are different. Please don=92t confuse them. > Patterns like freebsd:9:* will probably become more prevalent when = support > for subpackages is added. Some of the subpackages (like = documentation) will > be ABI independent. True, but not relevant to the machine name you use. Warner --Apple-Mail=_430514DB-3337-47FD-AF8D-5A9C63E9164F Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTgOteAAoJEGwc0Sh9sBEAIOoQANtqG5DOzMtGJDKuPF9OZc+8 xT5Z9Ahc9DxZeSdDxPj1BRdO9ZlYuU2vBXSS25sqjYrDPv5bJuDzLv8ECgETVzqn /9z5K1Dxc+Zl5CAhOuOGDk4003c5XDwDLEJqvHjF1QrmKecPsNXE5pzb9Sr2gHsB m/X5kmzHEUz9gral3Z1Y+APaAySvJVNHVWViQHqSLlNeYtvpMzOCkTyIMDL7rlNQ Mvkdh0w88ZFba+UmUSSrFu/NHba9BBa4A1+uw08lqWfn7wmW7b4G3rk4VhZeABWO zJds91bW8kN141Nh5GWeoI9lytHrpoaWVjF1c5FDmjiC5099PAcyGn77ZOM6UlS+ TEVO5HAvhhiUUShYX+Rtx9S3EUuNsCBJG6/WeC4NnCcO0gMpjcQinnJWaWusGtw7 h+OD57tId7N3tA1QjpY8Xk9jWMH/QuHzsH7/XPkkFcfBBHAOzcEbaStf+npWZa3b 7DYeUlTOJvy023AHVvsE3J/YIeAlghN9IVbqVATkD2JLFT0VRTREx287ohrmEvJe ONNbviQ80cCAUsLbRZ3hlRrXIvnKE/F/2OGDUOm2QYMVIs7epMeMsS4GlMP2CgLq CQkz6aSXB/+XV5CN2Ro4eakysCZGaFitmUrA2i6mFBas+v6cs1COhto3/4fO8nJ7 lKK6lROSdemoTkcEUipY =0Csk -----END PGP SIGNATURE----- --Apple-Mail=_430514DB-3337-47FD-AF8D-5A9C63E9164F-- From owner-svn-src-head@FreeBSD.ORG Sat May 24 18:57:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF980F78; Sat, 24 May 2014 18:57:47 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 820C02401; Sat, 24 May 2014 18:57:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 985733805C; Sat, 24 May 2014 13:57:46 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id 1RoFjikIt_v1; Sat, 24 May 2014 13:57:46 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 9635F3805B; Sat, 24 May 2014 13:57:45 -0500 (CDT) Message-ID: <5380EBA8.1030200@freebsd.org> Date: Sat, 24 May 2014 11:57:44 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Ian Lepore , Tijl Coosemans Subject: Re: svn commit: r266553 - head/release/scripts References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> In-Reply-To: <1400955835.1152.323.camel@revolution.hippie.lan> Content-Type: text/plain; charset=ISO-8859-7; format=flowed Content-Transfer-Encoding: 8bit Cc: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, Glen Barber , svn-src-head@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 18:57:48 -0000 On 05/24/14 11:23, Ian Lepore wrote: > On Sat, 2014-05-24 at 18:53 +0200, Tijl Coosemans wrote: >> On Sat, 24 May 2014 09:04:33 -0700 Nathan Whitehorn wrote: >>> On 05/24/14 07:59, Tijl Coosemans wrote: >>>> On Fri, 23 May 2014 17:29:48 -0600 Warner Losh wrote: >>>>> On May 23, 2014, at 10:20 AM, Baptiste Daroussin wrote: >>>>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: >>>>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: >>>>>>>>> Is there any chance of finally switching the pkg abi identifiers to just >>>>>>>>> be uname -p? >>>>>>>>> -Nathan >>>>>>>> Keeping asking won't make it happen, I have explained a large number of time why it >>>>>>>> happened, why it is not easy for compatibility and why uname -p is still not >>>>>>>> representing the ABI we do support, and what flexibility we need that the >>>>>>>> current string offers to us. >>>>>>>> >>>>>>>> if one is willing to do the work, please be my guess, just dig into the archives >>>>>>>> and join the pkg development otherwise: no it won't happen before a while >>>>>>>> because we have way too much work on the todo and this item is stored at the >>>>>>>> very end of this todo. >>>>>>>> >>>>>>>> regards, >>>>>>>> Bapt >>>>>>> I'm happy to do the work, and have volunteered now many times. If uname >>>>>>> -p does not describe the ABI fully, then uname -p needs changes on the >>>>>>> relevant platforms. Which are they? What extra flexibility does the >>>>>>> string give you if uname -p describes the ABI completely? >>>>>>> -Nathan >>>>>> just simple examples in armv6: >>>>>> - eabi vs oabi >>>>>> - The different float abi (even if only one is supported for now others are >>>>>> being worked on) >>>>>> - little endian vs big endian >>>>> All of those are encoded in the MACHINE_ARCH + freebsd version, no exceptions >>>>> on supported architectures that are tier 2 or higher. This seems like a weak reason. >>>>> >>>>>> the extras flexibilit is being able to say this binary do support freebsd i386 >>>>>> and amd64 in one key, freebsd:9:x86:*, or or all arches freebsd:10:* >>>>> Will there be a program to convert this new, special invention to the standard >>>>> that we¢ve used for the past 20 years? If you need the flexibility, which I¢m not >>>>> entirely sure I¢ve seen a good use case for. When would you have a x86 binary >>>>> package? Wouldn¢t it be either i386 or amd64? >>>> ABI isn't just about the instruction set. It's also about the sizes of C >>>> types (like pointers). If I remember correctly, the pkg scheme was chosen >>>> to allow for ABIs like x32 which use the 64 bit instruction set with 32 >>>> bit pointers. MACHINE_ARCH would also be amd64 in this case. >>> No, it wouldn't. MACHINE_ARCH would be something else (x32, probably) in >>> such cases. MACHINE_ARCH (and uname -p, which reports it) is the FreeBSD >>> ABI identifier and encodes 100% of the ABI information. This would be >>> true even if there is never an x32 kernel. >> No, there's no such thing as an x32 kernel. It's an amd64 kernel that >> supports a second userland ABI. In C preprocessor terms they are >> distinguished by (__amd64__ && _LP64) and (__amd64__ && !_LP64). >> uname -p gives you the processor architecture (the __amd64__ bit) but >> then you can still choose the sizes of standard C types (the _LP64 bit). >> So far we've always had one ABI per processor architecture but this >> is not strictly necessary. >> > All you have to do is look at the plethora of ARM ABIs we support (and > the corresponding separate kernel for each) to see the falseness of that > last sentence. ARM variations include v4 vs v6, OABI vs EABI (calling > and register usage standards), hard vs soft float, little vs big endian. > Virtually all combinations of those are possible (there are a few combos > we don't support), and each one has its own MACHINE_ARCH. > Exactly. This doesn't rely on the kernel either. The hw.machine_arch sysctl (what uname -p returns) gives the ABI of the calling binary rather than the kernel. So if you use a 32-bit uname (e.g. in a chroot) on an amd64 host, you get i386. The same will be true if and when we support a 32-bit amd64 userland -- even if there is no x32 kernel, an x32 uname will return "x32" (or "amd32" or whatever it ends up being called). That string will also appear in kern.supported_archs. MACHINE_ARCH completely defines the ABI, without exception, because, as a matter of policy, that's what we have defined it to mean. If there are any circumstances where it does not -- and none have been offered so far -- those are simply bugs that need fixing. -Nathan From owner-svn-src-head@FreeBSD.ORG Sat May 24 18:59:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 190751A2 for ; Sat, 24 May 2014 18:59:22 +0000 (UTC) Received: from mail-ig0-f176.google.com (mail-ig0-f176.google.com [209.85.213.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3568240E for ; Sat, 24 May 2014 18:59:21 +0000 (UTC) Received: by mail-ig0-f176.google.com with SMTP id hl10so1808570igb.15 for ; Sat, 24 May 2014 11:59:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=mpAT8b8LgfkDgFo1hQ371FtPQHaHIK8CjAvAwDNdAGg=; b=EN7LQjM1QcsvJn2gE2hzC7fupOAKK8Nf8gwbzitfj8sqRJvr4e6JstCCI5R5Ht/zRV 5mEXa0R0DUgHjKgxdUh5mhfIF9eLHUbvSFO6IJjFtJtpgii7aNNE6Ri9oY+wzYpiP+Jw fBj9Df+OHmwykpP8dALUrHE/AZ/8VDTukQOak0/554+s2POFN577OBf0UFQUef50zZxM RUSQBRZ/zFtU+Kw5SzHn3vY+I5vvTJPY7FFw55Ai22N9uhnuBYhbUxiapd8ue76tmZYf CuYBdsN3IyFebwme9o5L/sAZ8R7mTmt99K1Q2TCaQpdWlC92si6la7zAhvp4ubc6x4ga 41Qg== X-Gm-Message-State: ALoCoQmUAb/8ExapLPjhYr2XkDD+uuXYy77fS4sMntOEIxbm1JqsbJohpf8w3DoFvkYU/Oqz26wF X-Received: by 10.50.143.104 with SMTP id sd8mr13978607igb.18.1400957955178; Sat, 24 May 2014 11:59:15 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id hh13sm13748635igb.20.2014.05.24.11.59.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 24 May 2014 11:59:14 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_83082AB4-30E8-44E2-A9A8-CCF605A50F25"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266553 - head/release/scripts From: Warner Losh In-Reply-To: <20140524185345.263f230d@kalimero.tijl.coosemans.org> Date: Sat, 24 May 2014 12:59:22 -0600 Message-Id: <83440C4A-FDA6-4392-9211-DED13CF1DDDA@bsdimp.com> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> To: Tijl Coosemans X-Mailer: Apple Mail (2.1878.2) Cc: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, Glen Barber , Nathan Whitehorn , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 18:59:22 -0000 --Apple-Mail=_83082AB4-30E8-44E2-A9A8-CCF605A50F25 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On May 24, 2014, at 10:53 AM, Tijl Coosemans wrote: > On Sat, 24 May 2014 09:04:33 -0700 Nathan Whitehorn wrote: >> On 05/24/14 07:59, Tijl Coosemans wrote: >>> On Fri, 23 May 2014 17:29:48 -0600 Warner Losh wrote: >>>> On May 23, 2014, at 10:20 AM, Baptiste Daroussin = wrote: >>>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: >>>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn = wrote: >>>>>>>> Is there any chance of finally switching the pkg abi = identifiers to just >>>>>>>> be uname -p? >>>>>>>> -Nathan >>>>>>> Keeping asking won't make it happen, I have explained a large = number of time why it >>>>>>> happened, why it is not easy for compatibility and why uname -p = is still not >>>>>>> representing the ABI we do support, and what flexibility we need = that the >>>>>>> current string offers to us. >>>>>>>=20 >>>>>>> if one is willing to do the work, please be my guess, just dig = into the archives >>>>>>> and join the pkg development otherwise: no it won't happen = before a while >>>>>>> because we have way too much work on the todo and this item is = stored at the >>>>>>> very end of this todo. >>>>>>>=20 >>>>>>> regards, >>>>>>> Bapt >>>>>> I'm happy to do the work, and have volunteered now many times. If = uname >>>>>> -p does not describe the ABI fully, then uname -p needs changes = on the >>>>>> relevant platforms. Which are they? What extra flexibility does = the >>>>>> string give you if uname -p describes the ABI completely? >>>>>> -Nathan >>>>> just simple examples in armv6: >>>>> - eabi vs oabi >>>>> - The different float abi (even if only one is supported for now = others are >>>>> being worked on) >>>>> - little endian vs big endian >>>> All of those are encoded in the MACHINE_ARCH + freebsd version, no = exceptions >>>> on supported architectures that are tier 2 or higher. This seems = like a weak reason. >>>>=20 >>>>> the extras flexibilit is being able to say this binary do support = freebsd i386 >>>>> and amd64 in one key, freebsd:9:x86:*, or or all arches = freebsd:10:* >>>> Will there be a program to convert this new, special invention to = the standard >>>> that we=92ve used for the past 20 years? If you need the = flexibility, which I=92m not >>>> entirely sure I=92ve seen a good use case for. When would you have = a x86 binary >>>> package? Wouldn=92t it be either i386 or amd64? >>> ABI isn't just about the instruction set. It's also about the sizes = of C >>> types (like pointers). If I remember correctly, the pkg scheme was = chosen >>> to allow for ABIs like x32 which use the 64 bit instruction set with = 32 >>> bit pointers. MACHINE_ARCH would also be amd64 in this case. >>=20 >> No, it wouldn't. MACHINE_ARCH would be something else (x32, probably) = in=20 >> such cases. MACHINE_ARCH (and uname -p, which reports it) is the = FreeBSD=20 >> ABI identifier and encodes 100% of the ABI information. This would be=20= >> true even if there is never an x32 kernel. >=20 > No, there's no such thing as an x32 kernel. It's an amd64 kernel that > supports a second userland ABI. In C preprocessor terms they are > distinguished by (__amd64__ && _LP64) and (__amd64__ && !_LP64). > uname -p gives you the processor architecture (the __amd64__ bit) but > then you can still choose the sizes of standard C types (the _LP64 = bit). > So far we've always had one ABI per processor architecture but this > is not strictly necessary. I think we=92re talking past each other here. It absolutely would be = MACHINE_ARCH =3D=3D x32. That would be the name. And you could have an = x32 kernel, if you wanted. When we=92re building in the FreeBSD build = system, we=92d absolutely need a second MACHINE_ARCH. What you are doing here is confuse MACHINE_ARCH with MACHINE_CPUARCH. If you look at how we handle this for MIPS you=92ll see we do exactly = this for MIPS N32, which is exact likely x32. You don=92t have to have a = n32 kernel to run n32 binaries (but in MIPS=92 case you can, if you = want). Warner --Apple-Mail=_83082AB4-30E8-44E2-A9A8-CCF605A50F25 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTgOwKAAoJEGwc0Sh9sBEAu7EQANHBenYi6jGYfFllnNP4w4fa Cu0JwV5k8HDI+/kzW1CApHifEHnspB6cOHc3YA1BPruS0wyywr3LcnWQKcx+3lc9 wBpA8XPhlaiDAzxAMpZh115DiK5nadq7K+3DVwnOvQumQKgj2FP8Nhovr5Ve/DN/ MzT6ebBx/qRce4lwESiLKwhC/21ObPAZ8CRCPinyx4ask6Tey7K7wAVCHfvFQUAx OvEfiX9AAwrTzF4f+SrgU8hHVmVLwL63YFkEbL0KRIAynT7f4DyOoGCWbs+/PUy3 6I0iGDeDFJKDrPkKkOSaQNsFMWdKXsBg5IFVE98FeiodMKGTDHk+LsdMR3xfLFTL SvS9Je0Xp7R5yHPC5Z0KOzYfV0L5Zeu9Vh3434QtrfRGNhdz1+A4srGg6cvyALI2 92zAHrkpEOcj7XIyHFUeZKQHOPaLeEg0hPDZVToIrcDzfnahPogkJnvtTHIyqL0N aljKxZIf0/DkpkxwKw0Qnq+a7aTEj90lBEYMeLPm0x4mPyih5e7Ba2FQIhetSgqW uG+F/aLWwy79s4SSFCcJiO1rvxh3B3XD85gjBX3hONJIz8L/MJg1BbWwxfalDZ/S Pz1SxJucqPxwsVivgM2HtzPWYsa8EqyNX9BXQgfKRxnhMFV8R8/KA25Trjjikz8Y rrn6Bo+KKAKcC4DiST+2 =X7h2 -----END PGP SIGNATURE----- --Apple-Mail=_83082AB4-30E8-44E2-A9A8-CCF605A50F25-- From owner-svn-src-head@FreeBSD.ORG Sat May 24 19:07:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 148394D0 for ; Sat, 24 May 2014 19:07:32 +0000 (UTC) Received: from mail-ie0-f170.google.com (mail-ie0-f170.google.com [209.85.223.170]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C753A24CC for ; Sat, 24 May 2014 19:07:31 +0000 (UTC) Received: by mail-ie0-f170.google.com with SMTP id at1so6350239iec.29 for ; Sat, 24 May 2014 12:07:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=HfUYsflGyomy/YDuLhU33Hooz+yAZ17EYfcHAqu9l/I=; b=iawwaTfjyLVg0AttnLeu08s9vd068IJuxdu94XZAVF3FeAvmNrwISCXZmGNWTum3lE PPm5tYrbF1rsWzuOk+QTKJFtIx4nxoWBWzuK4OULnijXkTfGCGF+28PZ+hWcJk9G+4fz sKiTdBkNVZfGzKfpZVLVXg8Lav8padZDTQVqaBcC3JQJNEkbjDzO32nyDALthYn3c2sK YuSZ5PXKrZa+i0W4sGGBeM0aPRwVcxP+y1vOTXpM3cqRPa8G1yel5Utf9xl4qYJ1BaS3 IADPCdcGKhMVuVn681ENny/q8Yx9H30YXA4A/J1F4i5YGrlTDr1tBKNoB54mGXC7Xcjc nRaw== X-Gm-Message-State: ALoCoQmkI7iO2QzkwSvOaY98XWD+dLiuYdZ1qeSG7tX49L59LlL6tQHsT/G+VFSTpLsPFdfwhlDt X-Received: by 10.43.70.12 with SMTP id ye12mr12950971icb.46.1400958451067; Sat, 24 May 2014 12:07:31 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id v8sm13803125igk.16.2014.05.24.12.07.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 24 May 2014 12:07:30 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_953FF7A7-FD3A-4604-9377-1B090A8C2BE4"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266553 - head/release/scripts From: Warner Losh In-Reply-To: <5380EBA8.1030200@freebsd.org> Date: Sat, 24 May 2014 13:07:38 -0600 Message-Id: References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> <5380EBA8.1030200@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1878.2) Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , svn-src-head@freebsd.org, Tijl Coosemans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 19:07:32 -0000 --Apple-Mail=_953FF7A7-FD3A-4604-9377-1B090A8C2BE4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-7 On May 24, 2014, at 12:57 PM, Nathan Whitehorn = wrote: > On 05/24/14 11:23, Ian Lepore wrote: >> On Sat, 2014-05-24 at 18:53 +0200, Tijl Coosemans wrote: >>> On Sat, 24 May 2014 09:04:33 -0700 Nathan Whitehorn wrote: >>>> On 05/24/14 07:59, Tijl Coosemans wrote: >>>>> On Fri, 23 May 2014 17:29:48 -0600 Warner Losh wrote: >>>>>> On May 23, 2014, at 10:20 AM, Baptiste Daroussin = wrote: >>>>>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn = wrote: >>>>>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn = wrote: >>>>>>>>>> Is there any chance of finally switching the pkg abi = identifiers to just >>>>>>>>>> be uname -p? >>>>>>>>>> -Nathan >>>>>>>>> Keeping asking won't make it happen, I have explained a large = number of time why it >>>>>>>>> happened, why it is not easy for compatibility and why uname = -p is still not >>>>>>>>> representing the ABI we do support, and what flexibility we = need that the >>>>>>>>> current string offers to us. >>>>>>>>>=20 >>>>>>>>> if one is willing to do the work, please be my guess, just dig = into the archives >>>>>>>>> and join the pkg development otherwise: no it won't happen = before a while >>>>>>>>> because we have way too much work on the todo and this item is = stored at the >>>>>>>>> very end of this todo. >>>>>>>>>=20 >>>>>>>>> regards, >>>>>>>>> Bapt >>>>>>>> I'm happy to do the work, and have volunteered now many times. = If uname >>>>>>>> -p does not describe the ABI fully, then uname -p needs changes = on the >>>>>>>> relevant platforms. Which are they? What extra flexibility does = the >>>>>>>> string give you if uname -p describes the ABI completely? >>>>>>>> -Nathan >>>>>>> just simple examples in armv6: >>>>>>> - eabi vs oabi >>>>>>> - The different float abi (even if only one is supported for now = others are >>>>>>> being worked on) >>>>>>> - little endian vs big endian >>>>>> All of those are encoded in the MACHINE_ARCH + freebsd version, = no exceptions >>>>>> on supported architectures that are tier 2 or higher. This seems = like a weak reason. >>>>>>=20 >>>>>>> the extras flexibilit is being able to say this binary do = support freebsd i386 >>>>>>> and amd64 in one key, freebsd:9:x86:*, or or all arches = freebsd:10:* >>>>>> Will there be a program to convert this new, special invention to = the standard >>>>>> that we=A2ve used for the past 20 years? If you need the = flexibility, which I=A2m not >>>>>> entirely sure I=A2ve seen a good use case for. When would you = have a x86 binary >>>>>> package? Wouldn=A2t it be either i386 or amd64? >>>>> ABI isn't just about the instruction set. It's also about the = sizes of C >>>>> types (like pointers). If I remember correctly, the pkg scheme = was chosen >>>>> to allow for ABIs like x32 which use the 64 bit instruction set = with 32 >>>>> bit pointers. MACHINE_ARCH would also be amd64 in this case. >>>> No, it wouldn't. MACHINE_ARCH would be something else (x32, = probably) in >>>> such cases. MACHINE_ARCH (and uname -p, which reports it) is the = FreeBSD >>>> ABI identifier and encodes 100% of the ABI information. This would = be >>>> true even if there is never an x32 kernel. >>> No, there's no such thing as an x32 kernel. It's an amd64 kernel = that >>> supports a second userland ABI. In C preprocessor terms they are >>> distinguished by (__amd64__ && _LP64) and (__amd64__ && !_LP64). >>> uname -p gives you the processor architecture (the __amd64__ bit) = but >>> then you can still choose the sizes of standard C types (the _LP64 = bit). >>> So far we've always had one ABI per processor architecture but this >>> is not strictly necessary. >>>=20 >> All you have to do is look at the plethora of ARM ABIs we support = (and >> the corresponding separate kernel for each) to see the falseness of = that >> last sentence. ARM variations include v4 vs v6, OABI vs EABI = (calling >> and register usage standards), hard vs soft float, little vs big = endian. >> Virtually all combinations of those are possible (there are a few = combos >> we don't support), and each one has its own MACHINE_ARCH. >>=20 >=20 > Exactly. This doesn't rely on the kernel either. The hw.machine_arch = sysctl (what uname -p returns) gives the ABI of the calling binary = rather than the kernel. So if you use a 32-bit uname (e.g. in a chroot) = on an amd64 host, you get i386. The same will be true if and when we = support a 32-bit amd64 userland -- even if there is no x32 kernel, an = x32 uname will return "x32" (or "amd32" or whatever it ends up being = called). That string will also appear in kern.supported_archs. Yes, the supported_arch sysctl is 100% based on MACHINE_ARCH names. = That=A2s why we added it: so that the packaging system could use it to = offer which packages to install. > MACHINE_ARCH completely defines the ABI, without exception, because, = as a matter of policy, that's what we have defined it to mean. If there = are any circumstances where it does not -- and none have been offered so = far -- those are simply bugs that need fixing. Also, the list of ABIs we support is exported using MACHINE_ARCH names, = Those are the standard names that we use to describe everything else ABI = in the system. If there is a pkg layer translation, then it absolutely = must support translation to/from these names in the pkg layer so that = all the scripts that cope with packages don=A2t have to have this = translation embedded in them. If the translation isn=A2t there, then = that becomes a big barrier to entry for our users. Warner --Apple-Mail=_953FF7A7-FD3A-4604-9377-1B090A8C2BE4 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTgO36AAoJEGwc0Sh9sBEALjEQAK4ZgAcahpc2BmyXOX2FrAPI +XRidtgXPuNZVskfYO2zysGtJ/Fq96EN40AiPnI4xPWQgbuvpSd6D+K0SnCEEWrY c1OS20+Cs8+vKB4sHhSw7ER3PI7deBoeQSFDnmm26SFgqu+XuTQiErgLv/I/Nw1U 1ZUxNoLxgcncGgXPTThZMX7s+dCHINaLQ+yslJSdgTnEyQC/XcxDaTmMDzLoPcKp 5k17RYZW5pdMiy5IsuMQxahHAr/QN17xRUQs3IP5vV6XPXntDrXkkseKJCmSGYhA +5SDlP0ZnGWr8JWBg2RA6khwoDeZjEDvaZ8xSennwxKkpU/ZyoqmofBjk19Sgg56 bXXs3eJtV4UCdgKSr93JGgeKyQpHGAm6AOk8KfDYCHT6kcJ6/yXEx4P+tB9hk6hu mnZBBJVdGJ+mGiLnatRvZxY4fh5i4acyGk9oc1DjAiaz2m8+Qpeg3orVRmQ1qubQ Z+k8FTT8mD94/BURfpPbj9gH7gRY/9MYz5m+5rukqEqNQDv8Xx3gBGkRNXR0B2/d Xnla0vJ4jkw/+x/UnvW1NOIQkCT5hxjNFPvd8FdoY5pIqOnzQYsc0TOV90XlAd6D n7eNmGFQzdvSNK2e2BlGyXht6OqgEXxZphE9oWFljIiqR6E/i6V8Nw12MD8TF4Ev C5eG5i0rQBlScdppByqZ =vr3k -----END PGP SIGNATURE----- --Apple-Mail=_953FF7A7-FD3A-4604-9377-1B090A8C2BE4-- From owner-svn-src-head@FreeBSD.ORG Sat May 24 19:10:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 424B871E; Sat, 24 May 2014 19:10:02 +0000 (UTC) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03A0C24EE; Sat, 24 May 2014 19:10:02 +0000 (UTC) Received: from [192.168.1.200] (p5481968B.dip0.t-ipconnect.de [84.129.150.139]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id 055DD1C104DA2; Sat, 24 May 2014 21:09:57 +0200 (CEST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266083 - in head/sys/arm: arm include From: Michael Tuexen In-Reply-To: <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org> Date: Sat, 24 May 2014 21:09:56 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <083E3DCB-F49A-4757-9CF8-689D04267E26@freebsd.org> References: <201405141911.s4EJBFZZ097826@svn.freebsd.org> <537D0952.2040001@selasky.org> <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org> To: Mark R V Murray X-Mailer: Apple Mail (2.1878.2) Cc: Hans Petter Selasky , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 19:10:02 -0000 On 22 May 2014, at 09:09, Mark R V Murray wrote: >=20 > On 21 May 2014, at 21:15, Hans Petter Selasky wrote: >=20 >> On 05/14/14 21:11, Mark Murray wrote: >>> Author: markm >>> Date: Wed May 14 19:11:15 2014 >>> New Revision: 266083 >>> URL: http://svnweb.freebsd.org/changeset/base/266083 >>>=20 >>> Log: >>> Give suitably-endowed ARMs a register similar to the x86 TSC = register. >>>=20 >>=20 >> Hi, >>=20 >> Regression issue: >> This commit prevents RPI-B from booting. >=20 > Thanks, I=92ll look at it ASAP. Doesn't the ARM1176 use for example MRC p15, 0, , c15, c12, 1 ; Read Cycle Counter Register to read the value, whereas the=20 you use=20 __asm __volatile("mrc p15, 0, %0, c9, c13, 0": "=3Dr" (ccnt)); Best regards Michael >=20 > M > --=20 > Mark R V Murray >=20 >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Sat May 24 19:13:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E005C8A3; Sat, 24 May 2014 19:13:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFC4C257C; Sat, 24 May 2014 19:13:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4OJDQAE057520; Sat, 24 May 2014 19:13:26 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4OJDQpw057514; Sat, 24 May 2014 19:13:26 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405241913.s4OJDQpw057514@svn.freebsd.org> From: Neel Natu Date: Sat, 24 May 2014 19:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266626 - in head/sys/amd64: include vmm vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 19:13:27 -0000 Author: neel Date: Sat May 24 19:13:25 2014 New Revision: 266626 URL: http://svnweb.freebsd.org/changeset/base/266626 Log: When injecting a page fault into the guest also update the guest's %cr2 to indicate the faulting linear address. If the guest PML4 entry has the PG_PS bit set then inject a page fault into the guest with the PGEX_RSV bit set in the error_code. Get rid of redundant checks for the PG_RW violations when walking the page tables. Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Sat May 24 19:03:30 2014 (r266625) +++ head/sys/amd64/include/vmm.h Sat May 24 19:13:25 2014 (r266626) @@ -237,7 +237,7 @@ int vm_exception_pending(struct vm *vm, void vm_inject_gp(struct vm *vm, int vcpuid); /* general protection fault */ void vm_inject_ud(struct vm *vm, int vcpuid); /* undefined instruction fault */ -void vm_inject_pf(struct vm *vm, int vcpuid, int error_code); /* page fault */ +void vm_inject_pf(struct vm *vm, int vcpuid, int error_code, uint64_t cr2); enum vm_reg_name vm_segment_name(int seg_encoding); @@ -284,6 +284,7 @@ enum vm_reg_name { VM_REG_GUEST_IDTR, VM_REG_GUEST_GDTR, VM_REG_GUEST_EFER, + VM_REG_GUEST_CR2, VM_REG_LAST }; Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sat May 24 19:03:30 2014 (r266625) +++ head/sys/amd64/vmm/intel/vmx.c Sat May 24 19:13:25 2014 (r266626) @@ -2383,6 +2383,8 @@ vmxctx_regptr(struct vmxctx *vmxctx, int return (&vmxctx->guest_r14); case VM_REG_GUEST_R15: return (&vmxctx->guest_r15); + case VM_REG_GUEST_CR2: + return (&vmxctx->guest_cr2); default: break; } Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Sat May 24 19:03:30 2014 (r266625) +++ head/sys/amd64/vmm/vmm.c Sat May 24 19:13:25 2014 (r266626) @@ -1441,13 +1441,20 @@ vm_inject_fault(struct vm *vm, int vcpui } void -vm_inject_pf(struct vm *vm, int vcpuid, int error_code) +vm_inject_pf(struct vm *vm, int vcpuid, int error_code, uint64_t cr2) { struct vm_exception pf = { .vector = IDT_PF, .error_code_valid = 1, .error_code = error_code }; + int error; + + VCPU_CTR2(vm, vcpuid, "Injecting page fault: error_code %#x, cr2 %#lx", + error_code, cr2); + + error = vm_set_register(vm, vcpuid, VM_REG_GUEST_CR2, cr2); + KASSERT(error == 0, ("vm_set_register(cr2) error %d", error)); vm_inject_fault(vm, vcpuid, &pf); } Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Sat May 24 19:03:30 2014 (r266625) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Sat May 24 19:13:25 2014 (r266626) @@ -599,7 +599,7 @@ vie_init(struct vie *vie) } static int -pf_error_code(int usermode, int prot, uint64_t pte) +pf_error_code(int usermode, int prot, int rsvd, uint64_t pte) { int error_code = 0; @@ -609,6 +609,8 @@ pf_error_code(int usermode, int prot, ui error_code |= PGEX_W; if (usermode) error_code |= PGEX_U; + if (rsvd) + error_code |= PGEX_RSV; if (prot & VM_PROT_EXECUTE) error_code |= PGEX_I; @@ -679,14 +681,12 @@ restart: if ((pte32 & PG_V) == 0 || (usermode && (pte32 & PG_U) == 0) || (writable && (pte32 & PG_RW) == 0)) { - pfcode = pf_error_code(usermode, prot, pte32); - vm_inject_pf(vm, vcpuid, pfcode); + pfcode = pf_error_code(usermode, prot, 0, + pte32); + vm_inject_pf(vm, vcpuid, pfcode, gla); goto pagefault; } - if (writable && (pte32 & PG_RW) == 0) - goto error; - /* * Emulate the x86 MMU's management of the accessed * and dirty flags. While the accessed flag is set @@ -735,8 +735,8 @@ restart: pte = ptpbase[ptpindex]; if ((pte & PG_V) == 0) { - pfcode = pf_error_code(usermode, prot, pte); - vm_inject_pf(vm, vcpuid, pfcode); + pfcode = pf_error_code(usermode, prot, 0, pte); + vm_inject_pf(vm, vcpuid, pfcode, gla); goto pagefault; } @@ -762,14 +762,11 @@ restart: if ((pte & PG_V) == 0 || (usermode && (pte & PG_U) == 0) || (writable && (pte & PG_RW) == 0)) { - pfcode = pf_error_code(usermode, prot, pte); - vm_inject_pf(vm, vcpuid, pfcode); + pfcode = pf_error_code(usermode, prot, 0, pte); + vm_inject_pf(vm, vcpuid, pfcode, gla); goto pagefault; } - if (writable && (pte & PG_RW) == 0) - goto error; - /* Set the accessed bit in the page table entry */ if ((pte & PG_A) == 0) { if (atomic_cmpset_64(&ptpbase[ptpindex], @@ -779,10 +776,12 @@ restart: } if (nlevels > 0 && (pte & PG_PS) != 0) { - if (pgsize > 1 * GB) - goto error; - else - break; + if (pgsize > 1 * GB) { + pfcode = pf_error_code(usermode, prot, 1, pte); + vm_inject_pf(vm, vcpuid, pfcode, gla); + goto pagefault; + } + break; } ptpphys = pte; From owner-svn-src-head@FreeBSD.ORG Sat May 24 20:21:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 961CCAD7 for ; Sat, 24 May 2014 20:21:56 +0000 (UTC) Received: from mail-qc0-f176.google.com (mail-qc0-f176.google.com [209.85.216.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5559F2A95 for ; Sat, 24 May 2014 20:21:55 +0000 (UTC) Received: by mail-qc0-f176.google.com with SMTP id r5so10284106qcx.35 for ; Sat, 24 May 2014 13:21:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=4aG8IoLfdxS1Ifp83BBScGxrlco83pQ920GPW1/m2uk=; b=OI9RC948nEuNdqbwrjA1rYwSFdl+8CGzzs+qfLk63nP3YuqWf+y+Jg24/Wnh8fKcc4 P4a29qeWIS9Bm3IO0fOEA7j6ptL279/SWENCLohxmQPJ3ZPkL7T3vYIa0avpXCG+G0l8 rkAntDruaVm+vwqmqEjAZxfNk5EoFHNmEn5hk+oVi+zZXodsMkUHrjbBo1D17BdlFvp/ /Zn5oY4Kx6IgAD7ElaujuQVACkSG9h1Dl1QhfoNXX/c0VDUmAJ+Utr5ngn9axHxOuHcZ QVXmX6Hk2s9APDbj5tYisU1WLiyM0goDIiylOsWhhI5n0cQwzALxlgWzJgR+/xokxsWS l0ww== X-Gm-Message-State: ALoCoQnTHATJYOuPTgWKs5eOHGL00YDoWBj1SQHRatfwLtc9fBfPv+PNX4v5KHA2E78h3wANKw7C X-Received: by 10.224.130.196 with SMTP id u4mr14800158qas.13.1400962460237; Sat, 24 May 2014 13:14:20 -0700 (PDT) MIME-Version: 1.0 Sender: jmmv@meroh.net Received: by 10.96.83.99 with HTTP; Sat, 24 May 2014 13:14:00 -0700 (PDT) X-Originating-IP: [184.153.117.174] In-Reply-To: <201405230846.s4N8kSK1012870@svn.freebsd.org> References: <201405230846.s4N8kSK1012870@svn.freebsd.org> From: Julio Merino Date: Sat, 24 May 2014 16:14:00 -0400 X-Google-Sender-Auth: SBsnb49sSjEK57ijchSD6xIp4yI Message-ID: Subject: Re: svn commit: r266581 - in head: etc/mtree include lib/libcuse sys/conf sys/fs/cuse sys/modules/cuse To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 20:21:56 -0000 On Fri, May 23, 2014 at 4:46 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Fri May 23 08:46:28 2014 > New Revision: 266581 > URL: http://svnweb.freebsd.org/changeset/base/266581 > > Modified: head/etc/mtree/BSD.include.dist > ============================================================================== > --- head/etc/mtree/BSD.include.dist Fri May 23 08:34:30 2014 (r266580) > +++ head/etc/mtree/BSD.include.dist Fri May 23 08:46:28 2014 (r266581) > @@ -162,6 +162,8 @@ > .. > .. > fs > + cuse > + .. > devfs > .. > fdescfs A tab sneaked in via those lines. Please fix. From owner-svn-src-head@FreeBSD.ORG Sat May 24 20:26:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C5D19BFA; Sat, 24 May 2014 20:26:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B14382AAF; Sat, 24 May 2014 20:26:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4OKQxDM089241; Sat, 24 May 2014 20:26:59 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4OKQwb2089232; Sat, 24 May 2014 20:26:58 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405242026.s4OKQwb2089232@svn.freebsd.org> From: Neel Natu Date: Sat, 24 May 2014 20:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266627 - in head: sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 20:27:00 -0000 Author: neel Date: Sat May 24 20:26:57 2014 New Revision: 266627 URL: http://svnweb.freebsd.org/changeset/base/266627 Log: Consolidate all the information needed by the guest page table walker into 'struct vm_guest_paging'. Check for canonical addressing in vmm_gla2gpa() and inject a protection fault into the guest if a violation is detected. If the page table walk is restarted in vmm_gla2gpa() then reset 'ptpphys' to point to the root of the page tables. Modified: head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_instruction_emul.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_instruction_emul.c head/sys/amd64/vmm/vmm_ioport.c head/usr.sbin/bhyve/inout.c head/usr.sbin/bhyve/mem.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Sat May 24 19:13:25 2014 (r266626) +++ head/sys/amd64/include/vmm.h Sat May 24 20:26:57 2014 (r266627) @@ -243,8 +243,6 @@ enum vm_reg_name vm_segment_name(int seg #endif /* KERNEL */ -#include - #define VM_MAXCPU 16 /* maximum virtual cpus */ /* @@ -324,6 +322,71 @@ struct seg_desc { uint32_t access; }; +enum vm_cpu_mode { + CPU_MODE_COMPATIBILITY, /* IA-32E mode (CS.L = 0) */ + CPU_MODE_64BIT, /* IA-32E mode (CS.L = 1) */ +}; + +enum vm_paging_mode { + PAGING_MODE_FLAT, + PAGING_MODE_32, + PAGING_MODE_PAE, + PAGING_MODE_64, +}; + +struct vm_guest_paging { + uint64_t cr3; + int cpl; + enum vm_cpu_mode cpu_mode; + enum vm_paging_mode paging_mode; +}; + +/* + * The data structures 'vie' and 'vie_op' are meant to be opaque to the + * consumers of instruction decoding. The only reason why their contents + * need to be exposed is because they are part of the 'vm_exit' structure. + */ +struct vie_op { + uint8_t op_byte; /* actual opcode byte */ + uint8_t op_type; /* type of operation (e.g. MOV) */ + uint16_t op_flags; +}; + +#define VIE_INST_SIZE 15 +struct vie { + uint8_t inst[VIE_INST_SIZE]; /* instruction bytes */ + uint8_t num_valid; /* size of the instruction */ + uint8_t num_processed; + + uint8_t rex_w:1, /* REX prefix */ + rex_r:1, + rex_x:1, + rex_b:1, + rex_present:1; + + uint8_t mod:2, /* ModRM byte */ + reg:4, + rm:4; + + uint8_t ss:2, /* SIB byte */ + index:4, + base:4; + + uint8_t disp_bytes; + uint8_t imm_bytes; + + uint8_t scale; + int base_register; /* VM_REG_GUEST_xyz */ + int index_register; /* VM_REG_GUEST_xyz */ + + int64_t displacement; /* optional addr displacement */ + int64_t immediate; /* optional immediate operand */ + + uint8_t decoded; /* set to 1 if successfully decoded */ + + struct vie_op op; /* opcode description */ +}; + enum vm_exitcode { VM_EXITCODE_INOUT, VM_EXITCODE_VMX, @@ -355,14 +418,11 @@ struct vm_inout { struct vm_inout_str { struct vm_inout inout; /* must be the first element */ - enum vie_cpu_mode cpu_mode; - enum vie_paging_mode paging_mode; + struct vm_guest_paging paging; uint64_t rflags; uint64_t cr0; - uint64_t cr3; uint64_t index; uint64_t count; /* rep=1 (%rcx), rep=0 (1) */ - int cpl; int addrsize; enum vm_reg_name seg_name; struct seg_desc seg_desc; @@ -384,10 +444,7 @@ struct vm_exit { struct { uint64_t gpa; uint64_t gla; - uint64_t cr3; - enum vie_cpu_mode cpu_mode; - enum vie_paging_mode paging_mode; - int cpl; + struct vm_guest_paging paging; struct vie vie; } inst_emul; /* Modified: head/sys/amd64/include/vmm_instruction_emul.h ============================================================================== --- head/sys/amd64/include/vmm_instruction_emul.h Sat May 24 19:13:25 2014 (r266626) +++ head/sys/amd64/include/vmm_instruction_emul.h Sat May 24 20:26:57 2014 (r266627) @@ -29,66 +29,6 @@ #ifndef _VMM_INSTRUCTION_EMUL_H_ #define _VMM_INSTRUCTION_EMUL_H_ -enum vm_reg_name; - -enum vie_cpu_mode { - CPU_MODE_COMPATIBILITY, /* IA-32E mode (CS.L = 0) */ - CPU_MODE_64BIT, /* IA-32E mode (CS.L = 1) */ -}; - -enum vie_paging_mode { - PAGING_MODE_FLAT, - PAGING_MODE_32, - PAGING_MODE_PAE, - PAGING_MODE_64, -}; - -/* - * The data structures 'vie' and 'vie_op' are meant to be opaque to the - * consumers of instruction decoding. The only reason why their contents - * need to be exposed is because they are part of the 'vm_exit' structure. - */ -struct vie_op { - uint8_t op_byte; /* actual opcode byte */ - uint8_t op_type; /* type of operation (e.g. MOV) */ - uint16_t op_flags; -}; - -#define VIE_INST_SIZE 15 -struct vie { - uint8_t inst[VIE_INST_SIZE]; /* instruction bytes */ - uint8_t num_valid; /* size of the instruction */ - uint8_t num_processed; - - uint8_t rex_w:1, /* REX prefix */ - rex_r:1, - rex_x:1, - rex_b:1, - rex_present:1; - - uint8_t mod:2, /* ModRM byte */ - reg:4, - rm:4; - - uint8_t ss:2, /* SIB byte */ - index:4, - base:4; - - uint8_t disp_bytes; - uint8_t imm_bytes; - - uint8_t scale; - int base_register; /* VM_REG_GUEST_xyz */ - int index_register; /* VM_REG_GUEST_xyz */ - - int64_t displacement; /* optional addr displacement */ - int64_t immediate; /* optional immediate operand */ - - uint8_t decoded; /* set to 1 if successfully decoded */ - - struct vie_op op; /* opcode description */ -}; - /* * Callback functions to read and write memory regions. */ @@ -122,6 +62,9 @@ int vie_update_register(void *vm, int vc int vie_alignment_check(int cpl, int operand_size, uint64_t cr0, uint64_t rflags, uint64_t gla); +/* Returns 1 if the 'gla' is not canonical and 0 otherwise. */ +int vie_canonical_check(enum vm_cpu_mode cpu_mode, uint64_t gla); + uint64_t vie_size2mask(int size); #ifdef _KERNEL @@ -131,23 +74,22 @@ uint64_t vie_size2mask(int size); * 'vie' must be initialized before calling 'vmm_fetch_instruction()' */ int vmm_fetch_instruction(struct vm *vm, int cpuid, - uint64_t rip, int inst_length, uint64_t cr3, - enum vie_paging_mode paging_mode, int cpl, - struct vie *vie); + struct vm_guest_paging *guest_paging, + uint64_t rip, int inst_length, struct vie *vie); /* * Translate the guest linear address 'gla' to a guest physical address. * * Returns 0 on success and '*gpa' contains the result of the translation. - * Returns 1 if a page fault exception was injected into the guest. + * Returns 1 if an exception was injected into the guest. * Returns -1 otherwise. */ -int vmm_gla2gpa(struct vm *vm, int vcpuid, uint64_t gla, uint64_t cr3, - uint64_t *gpa, enum vie_paging_mode paging_mode, int cpl, int prot); +int vmm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, + uint64_t gla, int prot, uint64_t *gpa); void vie_init(struct vie *vie); -uint64_t vie_segbase(enum vm_reg_name segment, enum vie_cpu_mode cpu_mode, +uint64_t vie_segbase(enum vm_reg_name segment, enum vm_cpu_mode cpu_mode, const struct seg_desc *desc); /* @@ -163,7 +105,7 @@ uint64_t vie_segbase(enum vm_reg_name se */ #define VIE_INVALID_GLA (1UL << 63) /* a non-canonical address */ int vmm_decode_instruction(struct vm *vm, int cpuid, uint64_t gla, - enum vie_cpu_mode cpu_mode, struct vie *vie); + enum vm_cpu_mode cpu_mode, struct vie *vie); #endif /* _KERNEL */ #endif /* _VMM_INSTRUCTION_EMUL_H_ */ Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sat May 24 19:13:25 2014 (r266626) +++ head/sys/amd64/vmm/intel/vmx.c Sat May 24 20:26:57 2014 (r266627) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "vmm_host.h" #include "vmm_ioport.h" #include "vmm_ipi.h" @@ -1517,7 +1518,7 @@ vmx_cpl(void) return ((ssar >> 5) & 0x3); } -static enum vie_cpu_mode +static enum vm_cpu_mode vmx_cpu_mode(void) { @@ -1527,7 +1528,7 @@ vmx_cpu_mode(void) return (CPU_MODE_COMPATIBILITY); } -static enum vie_paging_mode +static enum vm_paging_mode vmx_paging_mode(void) { @@ -1607,15 +1608,21 @@ inout_str_seginfo(struct vmx *vmx, int v } static void +vmx_paging_info(struct vm_guest_paging *paging) +{ + paging->cr3 = vmcs_guest_cr3(); + paging->cpl = vmx_cpl(); + paging->cpu_mode = vmx_cpu_mode(); + paging->paging_mode = vmx_paging_mode(); +} + +static void vmexit_inst_emul(struct vm_exit *vmexit, uint64_t gpa, uint64_t gla) { vmexit->exitcode = VM_EXITCODE_INST_EMUL; vmexit->u.inst_emul.gpa = gpa; vmexit->u.inst_emul.gla = gla; - vmexit->u.inst_emul.cr3 = vmcs_guest_cr3(); - vmexit->u.inst_emul.cpu_mode = vmx_cpu_mode(); - vmexit->u.inst_emul.paging_mode = vmx_paging_mode(); - vmexit->u.inst_emul.cpl = vmx_cpl(); + vmx_paging_info(&vmexit->u.inst_emul.paging); } static int @@ -1998,12 +2005,9 @@ vmx_exit_process(struct vmx *vmx, int vc inst_info = vmcs_read(VMCS_EXIT_INSTRUCTION_INFO); vmexit->exitcode = VM_EXITCODE_INOUT_STR; vis = &vmexit->u.inout_str; - vis->cpu_mode = vmx_cpu_mode(); - vis->paging_mode = vmx_paging_mode(); + vmx_paging_info(&vis->paging); vis->rflags = vmcs_read(VMCS_GUEST_RFLAGS); vis->cr0 = vmcs_read(VMCS_GUEST_CR0); - vis->cr3 = vmcs_read(VMCS_GUEST_CR3); - vis->cpl = vmx_cpl(); vis->index = inout_str_index(vmx, vcpu, in); vis->count = inout_str_count(vmx, vcpu, vis->inout.rep); vis->addrsize = inout_str_addrsize(inst_info); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Sat May 24 19:13:25 2014 (r266626) +++ head/sys/amd64/vmm/vmm.c Sat May 24 20:26:57 2014 (r266627) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "vmm_ioport.h" #include "vmm_ktr.h" @@ -1132,32 +1133,25 @@ vm_handle_inst_emul(struct vm *vm, int v struct vie *vie; struct vcpu *vcpu; struct vm_exit *vme; - int cpl, error, inst_length; - uint64_t rip, gla, gpa, cr3; - enum vie_cpu_mode cpu_mode; - enum vie_paging_mode paging_mode; + uint64_t gla, gpa; + struct vm_guest_paging *paging; mem_region_read_t mread; mem_region_write_t mwrite; + int error; vcpu = &vm->vcpu[vcpuid]; vme = &vcpu->exitinfo; - rip = vme->rip; - inst_length = vme->inst_length; - gla = vme->u.inst_emul.gla; gpa = vme->u.inst_emul.gpa; - cr3 = vme->u.inst_emul.cr3; - cpl = vme->u.inst_emul.cpl; - cpu_mode = vme->u.inst_emul.cpu_mode; - paging_mode = vme->u.inst_emul.paging_mode; vie = &vme->u.inst_emul.vie; + paging = &vme->u.inst_emul.paging; vie_init(vie); /* Fetch, decode and emulate the faulting instruction */ - error = vmm_fetch_instruction(vm, vcpuid, rip, inst_length, cr3, - paging_mode, cpl, vie); + error = vmm_fetch_instruction(vm, vcpuid, paging, vme->rip, + vme->inst_length, vie); if (error == 1) return (0); /* Resume guest to handle page fault */ else if (error == -1) @@ -1165,7 +1159,7 @@ vm_handle_inst_emul(struct vm *vm, int v else if (error != 0) panic("%s: vmm_fetch_instruction error %d", __func__, error); - if (vmm_decode_instruction(vm, vcpuid, gla, cpu_mode, vie) != 0) + if (vmm_decode_instruction(vm, vcpuid, gla, paging->cpu_mode, vie) != 0) return (EFAULT); /* return to userland unless this is an in-kernel emulated device */ Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Sat May 24 19:13:25 2014 (r266626) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Sat May 24 20:26:57 2014 (r266627) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #define KASSERT(exp,msg) assert((exp)) #endif /* _KERNEL */ +#include #include #include @@ -579,6 +580,25 @@ vie_alignment_check(int cpl, int size, u return ((gla & (size - 1)) ? 1 : 0); } +int +vie_canonical_check(enum vm_cpu_mode cpu_mode, uint64_t gla) +{ + uint64_t mask; + + if (cpu_mode != CPU_MODE_64BIT) + return (0); + + /* + * The value of the bit 47 in the 'gla' should be replicated in the + * most significant 16 bits. + */ + mask = ~((1UL << 48) - 1); + if (gla & (1UL << 47)) + return ((gla & mask) != mask); + else + return ((gla & mask) != 0); +} + uint64_t vie_size2mask(int size) { @@ -637,31 +657,41 @@ ptp_hold(struct vm *vm, vm_paddr_t ptpph } int -vmm_gla2gpa(struct vm *vm, int vcpuid, uint64_t gla, uint64_t ptpphys, - uint64_t *gpa, enum vie_paging_mode paging_mode, int cpl, int prot) +vmm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, + uint64_t gla, int prot, uint64_t *gpa) { int nlevels, pfcode, ptpshift, ptpindex, retval, usermode, writable; u_int retries; - uint64_t *ptpbase, pte, pgsize; + uint64_t *ptpbase, ptpphys, pte, pgsize; uint32_t *ptpbase32, pte32; void *cookie; - usermode = (cpl == 3 ? 1 : 0); + usermode = (paging->cpl == 3 ? 1 : 0); writable = prot & VM_PROT_WRITE; cookie = NULL; retval = 0; retries = 0; restart: + ptpphys = paging->cr3; /* root of the page tables */ ptp_release(&cookie); if (retries++ > 0) maybe_yield(); - if (paging_mode == PAGING_MODE_FLAT) { + if (vie_canonical_check(paging->cpu_mode, gla)) { + /* + * XXX assuming a non-stack reference otherwise a stack fault + * should be generated. + */ + vm_inject_gp(vm, vcpuid); + goto fault; + } + + if (paging->paging_mode == PAGING_MODE_FLAT) { *gpa = gla; goto done; } - if (paging_mode == PAGING_MODE_32) { + if (paging->paging_mode == PAGING_MODE_32) { nlevels = 2; while (--nlevels >= 0) { /* Zero out the lower 12 bits. */ @@ -684,7 +714,7 @@ restart: pfcode = pf_error_code(usermode, prot, 0, pte32); vm_inject_pf(vm, vcpuid, pfcode, gla); - goto pagefault; + goto fault; } /* @@ -722,7 +752,7 @@ restart: goto done; } - if (paging_mode == PAGING_MODE_PAE) { + if (paging->paging_mode == PAGING_MODE_PAE) { /* Zero out the lower 5 bits and the upper 32 bits */ ptpphys &= 0xffffffe0UL; @@ -737,7 +767,7 @@ restart: if ((pte & PG_V) == 0) { pfcode = pf_error_code(usermode, prot, 0, pte); vm_inject_pf(vm, vcpuid, pfcode, gla); - goto pagefault; + goto fault; } ptpphys = pte; @@ -764,7 +794,7 @@ restart: (writable && (pte & PG_RW) == 0)) { pfcode = pf_error_code(usermode, prot, 0, pte); vm_inject_pf(vm, vcpuid, pfcode, gla); - goto pagefault; + goto fault; } /* Set the accessed bit in the page table entry */ @@ -779,7 +809,7 @@ restart: if (pgsize > 1 * GB) { pfcode = pf_error_code(usermode, prot, 1, pte); vm_inject_pf(vm, vcpuid, pfcode, gla); - goto pagefault; + goto fault; } break; } @@ -802,15 +832,14 @@ done: error: retval = -1; goto done; -pagefault: +fault: retval = 1; goto done; } int -vmm_fetch_instruction(struct vm *vm, int cpuid, uint64_t rip, int inst_length, - uint64_t cr3, enum vie_paging_mode paging_mode, int cpl, - struct vie *vie) +vmm_fetch_instruction(struct vm *vm, int cpuid, struct vm_guest_paging *paging, + uint64_t rip, int inst_length, struct vie *vie) { int n, error, prot; uint64_t gpa, off; @@ -826,8 +855,7 @@ vmm_fetch_instruction(struct vm *vm, int /* Copy the instruction into 'vie' */ while (vie->num_valid < inst_length) { - error = vmm_gla2gpa(vm, cpuid, rip, cr3, &gpa, paging_mode, - cpl, prot); + error = vmm_gla2gpa(vm, cpuid, paging, rip, prot, &gpa); if (error) return (error); @@ -930,7 +958,7 @@ decode_opcode(struct vie *vie) } static int -decode_modrm(struct vie *vie, enum vie_cpu_mode cpu_mode) +decode_modrm(struct vie *vie, enum vm_cpu_mode cpu_mode) { uint8_t x; @@ -1210,7 +1238,7 @@ verify_gla(struct vm *vm, int cpuid, uin int vmm_decode_instruction(struct vm *vm, int cpuid, uint64_t gla, - enum vie_cpu_mode cpu_mode, struct vie *vie) + enum vm_cpu_mode cpu_mode, struct vie *vie) { if (cpu_mode == CPU_MODE_64BIT) { @@ -1245,7 +1273,7 @@ vmm_decode_instruction(struct vm *vm, in } uint64_t -vie_segbase(enum vm_reg_name seg, enum vie_cpu_mode cpu_mode, +vie_segbase(enum vm_reg_name seg, enum vm_cpu_mode cpu_mode, const struct seg_desc *desc) { int basesize; Modified: head/sys/amd64/vmm/vmm_ioport.c ============================================================================== --- head/sys/amd64/vmm/vmm_ioport.c Sat May 24 19:13:25 2014 (r266626) +++ head/sys/amd64/vmm/vmm_ioport.c Sat May 24 20:26:57 2014 (r266627) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "vatpic.h" @@ -167,9 +168,9 @@ emulate_inout_str(struct vm *vm, int vcp * The #GP(0) fault conditions described above don't apply in * 64-bit mode. */ - if (vis->cpu_mode != CPU_MODE_64BIT) { + if (vis->paging.cpu_mode != CPU_MODE_64BIT) { VCPU_CTR1(vm, vcpuid, "ins/outs not emulated in cpu mode %d", - vis->cpu_mode); + vis->paging.cpu_mode); return (EINVAL); } @@ -181,7 +182,8 @@ emulate_inout_str(struct vm *vm, int vcp return (EINVAL); } - segbase = vie_segbase(vis->seg_name, vis->cpu_mode, &vis->seg_desc); + segbase = vie_segbase(vis->seg_name, vis->paging.cpu_mode, + &vis->seg_desc); index = vis->index & vie_size2mask(vis->addrsize); gla = segbase + index; @@ -195,8 +197,8 @@ emulate_inout_str(struct vm *vm, int vcp } vis->gla = gla; - error = vmm_gla2gpa(vm, vcpuid, gla, vis->cr3, &vis->gpa, - vis->paging_mode, vis->cpl, in ? VM_PROT_WRITE : VM_PROT_READ); + error = vmm_gla2gpa(vm, vcpuid, &vis->paging, gla, + in ? VM_PROT_WRITE : VM_PROT_READ, &vis->gpa); KASSERT(error == 0 || error == 1 || error == -1, ("%s: vmm_gla2gpa unexpected error %d", __func__, error)); if (error == -1) { Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Sat May 24 19:13:25 2014 (r266626) +++ head/usr.sbin/bhyve/inout.c Sat May 24 20:26:57 2014 (r266627) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -152,7 +153,7 @@ emulate_inout(struct vmctx *ctx, int vcp gpaend = rounddown(gpa + PAGE_SIZE, PAGE_SIZE); gva = paddr_guest2host(ctx, gpa, gpaend - gpa); - if (vie_alignment_check(vis->cpl, bytes, vis->cr0, + if (vie_alignment_check(vis->paging.cpl, bytes, vis->cr0, vis->rflags, vis->gla)) { error = vm_inject_exception2(ctx, vcpu, IDT_AC, 0); assert(error == 0); Modified: head/usr.sbin/bhyve/mem.c ============================================================================== --- head/usr.sbin/bhyve/mem.c Sat May 24 19:13:25 2014 (r266626) +++ head/usr.sbin/bhyve/mem.c Sat May 24 20:26:57 2014 (r266627) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Sat May 24 20:31:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10F5AD84; Sat, 24 May 2014 20:31:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F20302B3F; Sat, 24 May 2014 20:31:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4OKVt9A092552; Sat, 24 May 2014 20:31:55 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4OKVtqU092551; Sat, 24 May 2014 20:31:55 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405242031.s4OKVtqU092551@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 24 May 2014 20:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266628 - head/etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 20:31:56 -0000 Author: hselasky Date: Sat May 24 20:31:55 2014 New Revision: 266628 URL: http://svnweb.freebsd.org/changeset/base/266628 Log: Untabify. Found by: jmmv @ Modified: head/etc/mtree/BSD.include.dist Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Sat May 24 20:26:57 2014 (r266627) +++ head/etc/mtree/BSD.include.dist Sat May 24 20:31:55 2014 (r266628) @@ -162,8 +162,8 @@ .. .. fs - cuse - .. + cuse + .. devfs .. fdescfs From owner-svn-src-head@FreeBSD.ORG Sat May 24 20:37:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 325BEF6C; Sat, 24 May 2014 20:37:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EFF02B72; Sat, 24 May 2014 20:37:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4OKbFha093894; Sat, 24 May 2014 20:37:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4OKbF5U093892; Sat, 24 May 2014 20:37:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405242037.s4OKbF5U093892@svn.freebsd.org> From: Adrian Chadd Date: Sat, 24 May 2014 20:37:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266629 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 20:37:16 -0000 Author: adrian Date: Sat May 24 20:37:15 2014 New Revision: 266629 URL: http://svnweb.freebsd.org/changeset/base/266629 Log: Add a new taskqueue setup method that takes a cpuid to pin the taskqueue worker thread(s) to. For now it isn't a taskqueue/taskthread error to fail to pin to the given cpuid. Thanks to rpaulo@, kib@ and jhb@ for feedback. Tested: * igb(4), with local RSS patches to pin taskqueues. TODO: * ask the doc team for help in documenting the new API call. * add a taskqueue_start_threads_cpuset() method which takes a cpuset_t - but this may require a bunch of surgery to bring cpuset_t into scope. Modified: head/sys/kern/subr_taskqueue.c head/sys/sys/taskqueue.h Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Sat May 24 20:31:55 2014 (r266628) +++ head/sys/kern/subr_taskqueue.c Sat May 24 20:37:15 2014 (r266629) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -496,25 +497,19 @@ taskqueue_swi_giant_run(void *dummy) taskqueue_run(taskqueue_swi_giant); } -int -taskqueue_start_threads(struct taskqueue **tqp, int count, int pri, - const char *name, ...) +static int +_taskqueue_start_threads(struct taskqueue **tqp, int count, int pri, + cpuset_t *mask, const char *ktname) { - va_list ap; struct thread *td; struct taskqueue *tq; int i, error; - char ktname[MAXCOMLEN + 1]; if (count <= 0) return (EINVAL); tq = *tqp; - va_start(ap, name); - vsnprintf(ktname, sizeof(ktname), name, ap); - va_end(ap); - tq->tq_threads = malloc(sizeof(struct thread *) * count, M_TASKQUEUE, M_NOWAIT | M_ZERO); if (tq->tq_threads == NULL) { @@ -542,6 +537,19 @@ taskqueue_start_threads(struct taskqueue if (tq->tq_threads[i] == NULL) continue; td = tq->tq_threads[i]; + if (mask) { + error = cpuset_setthread(curthread->td_tid, mask); + /* + * Failing to pin is rarely an actual fatal error; + * it'll just affect performance. + */ + if (error) + printf("%s: curthread=%llu: can't pin; " + "error=%d\n", + __func__, + (unsigned long long) td->td_tid, + error); + } thread_lock(td); sched_prio(td, pri); sched_add(td, SRQ_BORING); @@ -551,6 +559,45 @@ taskqueue_start_threads(struct taskqueue return (0); } +int +taskqueue_start_threads(struct taskqueue **tqp, int count, int pri, + const char *name, ...) +{ + char ktname[MAXCOMLEN + 1]; + va_list ap; + + va_start(ap, name); + vsnprintf(ktname, sizeof(ktname), name, ap); + va_end(ap); + + return (_taskqueue_start_threads(tqp, count, pri, NULL, ktname)); +} + +int +taskqueue_start_threads_pinned(struct taskqueue **tqp, int count, int pri, + int cpu_id, const char *name, ...) +{ + char ktname[MAXCOMLEN + 1]; + va_list ap; + cpuset_t mask; + + va_start(ap, name); + vsnprintf(ktname, sizeof(ktname), name, ap); + va_end(ap); + + /* + * In case someone passes in NOCPU, just fall back to the + * default behaviour of "don't pin". + */ + if (cpu_id != NOCPU) { + CPU_ZERO(&mask); + CPU_SET(cpu_id, &mask); + } + + return (_taskqueue_start_threads(tqp, count, pri, + cpu_id == NOCPU ? NULL : &mask, ktname)); +} + static inline void taskqueue_run_callback(struct taskqueue *tq, enum taskqueue_callback_type cb_type) Modified: head/sys/sys/taskqueue.h ============================================================================== --- head/sys/sys/taskqueue.h Sat May 24 20:31:55 2014 (r266628) +++ head/sys/sys/taskqueue.h Sat May 24 20:37:15 2014 (r266629) @@ -71,6 +71,10 @@ struct taskqueue *taskqueue_create(const void *context); int taskqueue_start_threads(struct taskqueue **tqp, int count, int pri, const char *name, ...) __printflike(4, 5); +int taskqueue_start_threads_pinned(struct taskqueue **tqp, int count, + int pri, int cpu_id, const char *name, + ...) __printflike(5, 6); + int taskqueue_enqueue(struct taskqueue *queue, struct task *task); int taskqueue_enqueue_timeout(struct taskqueue *queue, struct timeout_task *timeout_task, int ticks); From owner-svn-src-head@FreeBSD.ORG Sat May 24 21:02:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D18634FA; Sat, 24 May 2014 21:02:30 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id B282B2DF9; Sat, 24 May 2014 21:02:30 +0000 (UTC) Received: from bender.Home (97e07ba1.skybroadband.com [151.224.123.161]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id A97D75DEBC; Sat, 24 May 2014 21:02:22 +0000 (UTC) Date: Sat, 24 May 2014 22:02:15 +0100 From: Andrew Turner To: Michael Tuexen Subject: Re: svn commit: r266083 - in head/sys/arm: arm include Message-ID: <20140524220215.79032279@bender.Home> In-Reply-To: <083E3DCB-F49A-4757-9CF8-689D04267E26@freebsd.org> References: <201405141911.s4EJBFZZ097826@svn.freebsd.org> <537D0952.2040001@selasky.org> <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org> <083E3DCB-F49A-4757-9CF8-689D04267E26@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: Hans Petter Selasky , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mark R V Murray X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 21:02:30 -0000 On Sat, 24 May 2014 21:09:56 +0200 Michael Tuexen wrote: > On 22 May 2014, at 09:09, Mark R V Murray wrote: > > > > > On 21 May 2014, at 21:15, Hans Petter Selasky > > wrote: > > > >> On 05/14/14 21:11, Mark Murray wrote: > >>> Author: markm > >>> Date: Wed May 14 19:11:15 2014 > >>> New Revision: 266083 > >>> URL: http://svnweb.freebsd.org/changeset/base/266083 > >>> > >>> Log: > >>> Give suitably-endowed ARMs a register similar to the x86 TSC > >>> register. > >>> > >> > >> Hi, > >> > >> Regression issue: > >> This commit prevents RPI-B from booting. > > > > Thanks, I’ll look at it ASAP. > Doesn't the ARM1176 use for example > MRC p15, 0, , c15, c12, 1 ; Read Cycle Counter Register > to read the value, whereas the > you use > __asm __volatile("mrc p15, 0, %0, c9, c13, 0": "=r" (ccnt)); On ARMv6 there is no guarantee of a cycle count register. On the ARM1176 there is one in an implementation defined section of the system control coprocessor. This is the c15 section above, and is accessible as shown. On ARMv7 there are optional performance monitor extensions. These are in parts of the c9 section of the coprocessor. As it is optional there is no requirement for implementers to include this functionality, however I would expect the ARM designs to include it, and most non-ARM designs are likely aiming for performance so will also include them. If the ARMv7 processor has the performance extensions the existing code appears correct to retrieve it. Andrew From owner-svn-src-head@FreeBSD.ORG Sat May 24 21:29:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9E49B10; Sat, 24 May 2014 21:29:33 +0000 (UTC) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9996A2F89; Sat, 24 May 2014 21:29:33 +0000 (UTC) Received: from [192.168.1.200] (p5481968B.dip0.t-ipconnect.de [84.129.150.139]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id A0A561C1049B1; Sat, 24 May 2014 23:29:29 +0200 (CEST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266083 - in head/sys/arm: arm include From: Michael Tuexen In-Reply-To: <20140524220215.79032279@bender.Home> Date: Sat, 24 May 2014 23:29:28 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <61D0CEF5-6D52-4C3B-8727-8474ECD045EA@freebsd.org> References: <201405141911.s4EJBFZZ097826@svn.freebsd.org> <537D0952.2040001@selasky.org> <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org> <083E3DCB-F49A-4757-9CF8-689D04267E26@freebsd.org> <20140524220215.79032279@bender.Home> To: Andrew Turner X-Mailer: Apple Mail (2.1878.2) Cc: Hans Petter Selasky , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mark R V Murray X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 21:29:34 -0000 On 24 May 2014, at 23:02, Andrew Turner wrote: > On Sat, 24 May 2014 21:09:56 +0200 > Michael Tuexen wrote: >=20 >> On 22 May 2014, at 09:09, Mark R V Murray wrote: >>=20 >>>=20 >>> On 21 May 2014, at 21:15, Hans Petter Selasky >>> wrote: >>>=20 >>>> On 05/14/14 21:11, Mark Murray wrote: >>>>> Author: markm >>>>> Date: Wed May 14 19:11:15 2014 >>>>> New Revision: 266083 >>>>> URL: http://svnweb.freebsd.org/changeset/base/266083 >>>>>=20 >>>>> Log: >>>>> Give suitably-endowed ARMs a register similar to the x86 TSC >>>>> register. >>>>>=20 >>>>=20 >>>> Hi, >>>>=20 >>>> Regression issue: >>>> This commit prevents RPI-B from booting. >>>=20 >>> Thanks, I=92ll look at it ASAP. >> Doesn't the ARM1176 use for example >> MRC p15, 0, , c15, c12, 1 ; Read Cycle Counter Register >> to read the value, whereas the=20 >> you use=20 >> __asm __volatile("mrc p15, 0, %0, c9, c13, 0": "=3Dr" (ccnt)); >=20 > On ARMv6 there is no guarantee of a cycle count register. On the > ARM1176 there is one in an implementation defined section of the = system > control coprocessor. This is the c15 section above, and is accessible > as shown. >=20 > On ARMv7 there are optional performance monitor extensions. These are > in parts of the c9 section of the coprocessor. As it is optional there > is no requirement for implementers to include this functionality, > however I would expect the ARM designs to include it, and most non-ARM > designs are likely aiming for performance so will also include them. >=20 > If the ARMv7 processor has the performance extensions the existing = code > appears correct to retrieve it. The code is #ifdef as #if defined(CPU_ARM1136) || defined(CPU_ARM1176) \ || defined(CPU_MV_PJ4B) \ || defined(CPU_CORTEXA) || defined(CPU_KRAIT) Isn't the Raspberry Pi defining CPU_ARM1176 and using ARMv6? So can we = use the same code for all plattforms in the #ifdef? Best regards Michael >=20 > Andrew >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Sat May 24 22:27:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF8A35AC; Sat, 24 May 2014 22:27:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA4F52352; Sat, 24 May 2014 22:27:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4OMRoij044982; Sat, 24 May 2014 22:27:50 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4OMRVqJ044860; Sat, 24 May 2014 22:27:31 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201405242227.s4OMRVqJ044860@svn.freebsd.org> From: Dimitry Andric Date: Sat, 24 May 2014 22:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266630 - head/contrib/llvm/patches X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 22:27:51 -0000 Author: dim Date: Sat May 24 22:27:31 2014 New Revision: 266630 URL: http://svnweb.freebsd.org/changeset/base/266630 Log: Add the clang patch for r265477. While here, add a description to the patch for r263619, and unify all the URLs to point to svnweb. Added: head/contrib/llvm/patches/patch-r265477-clang-r198655-standalone-debug.diff Modified: head/contrib/llvm/patches/patch-r208961-clang-version-include.diff head/contrib/llvm/patches/patch-r208987-format-extensions.diff head/contrib/llvm/patches/patch-r209107-clang-vendor-suffix.diff head/contrib/llvm/patches/patch-r213492-amd64-multi-os-dot.diff head/contrib/llvm/patches/patch-r221503-default-target-triple.diff head/contrib/llvm/patches/patch-r243830-arm-disable-clear-cache.diff head/contrib/llvm/patches/patch-r252503-arm-transient-stack-alignment.diff head/contrib/llvm/patches/patch-r257109-add-CC-aliases.diff head/contrib/llvm/patches/patch-r259053-gcc-installation-detector.diff head/contrib/llvm/patches/patch-r259498-add-fxsave.diff head/contrib/llvm/patches/patch-r261680-clang-r200899-fix-security-quantis.diff head/contrib/llvm/patches/patch-r261991-llvm-r195391-fix-dwarf2.diff head/contrib/llvm/patches/patch-r261991-llvm-r198385-fix-dwarf2.diff head/contrib/llvm/patches/patch-r261991-llvm-r198389-fix-dwarf2.diff head/contrib/llvm/patches/patch-r262261-llvm-r198028-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198029-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198030-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198145-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198149-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198157-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198280-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198281-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198286-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198480-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198484-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198533-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198565-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198567-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198580-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198591-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198592-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198658-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198681-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198738-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198739-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198740-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198893-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198909-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r198910-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r199014-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r199024-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r199028-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r199031-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r199033-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r199061-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r199186-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r199187-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r199775-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r199781-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r199786-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r199940-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r199974-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r199975-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r199977-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r200103-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r200104-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r200112-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r200130-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r200131-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r200141-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r200282-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r200368-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r200373-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r200376-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r200509-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r200617-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r200960-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r200961-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r200962-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r200963-sparc.diff head/contrib/llvm/patches/patch-r262261-llvm-r200965-sparc.diff head/contrib/llvm/patches/patch-r262262-clang-r198311-sparc.diff head/contrib/llvm/patches/patch-r262262-clang-r198312-sparc.diff head/contrib/llvm/patches/patch-r262262-clang-r198911-sparc.diff head/contrib/llvm/patches/patch-r262262-clang-r198912-sparc.diff head/contrib/llvm/patches/patch-r262262-clang-r198918-sparc.diff head/contrib/llvm/patches/patch-r262262-clang-r198923-sparc.diff head/contrib/llvm/patches/patch-r262262-clang-r199012-sparc.diff head/contrib/llvm/patches/patch-r262262-clang-r199034-sparc.diff head/contrib/llvm/patches/patch-r262262-clang-r199037-sparc.diff head/contrib/llvm/patches/patch-r262262-clang-r199188-sparc.diff head/contrib/llvm/patches/patch-r262262-clang-r199399-sparc.diff head/contrib/llvm/patches/patch-r262262-clang-r200452-sparc.diff head/contrib/llvm/patches/patch-r262264-llvm-r200453-sparc.diff head/contrib/llvm/patches/patch-r262265-llvm-r201718-sparc.diff head/contrib/llvm/patches/patch-r262303-enable-ppc-integrated-as.diff head/contrib/llvm/patches/patch-r262415-llvm-r201994-sparc.diff head/contrib/llvm/patches/patch-r262460-llvm-r202059-sparc.diff head/contrib/llvm/patches/patch-r262535-clang-r202177-sparc.diff head/contrib/llvm/patches/patch-r262536-clang-r202179-sparc.diff head/contrib/llvm/patches/patch-r262582-llvm-r202422-sparc.diff head/contrib/llvm/patches/patch-r262611-llvm-r196874-fix-invalid-pwd-crash.diff head/contrib/llvm/patches/patch-r263048-clang-r203624-fix-CC-aliases.diff head/contrib/llvm/patches/patch-r263312-llvm-r169939-inline-asm-with-realign.diff head/contrib/llvm/patches/patch-r263312-llvm-r196940-update-inline-asm-test.diff head/contrib/llvm/patches/patch-r263312-llvm-r196986-allow-realign-alloca.diff head/contrib/llvm/patches/patch-r263312-llvm-r202930-fix-alloca-esi-clobber.diff head/contrib/llvm/patches/patch-r263313-llvm-r203311-fix-sse1-oom.diff head/contrib/llvm/patches/patch-r263619-clang-r201662-arm-gnueabihf.diff head/contrib/llvm/patches/patch-r264826-llvm-r202188-variadic-fn-debug-info.diff head/contrib/llvm/patches/patch-r264827-clang-r202185-variadic-fn-debug-info.diff Modified: head/contrib/llvm/patches/patch-r208961-clang-version-include.diff ============================================================================== --- head/contrib/llvm/patches/patch-r208961-clang-version-include.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r208961-clang-version-include.diff Sat May 24 22:27:31 2014 (r266630) @@ -1,7 +1,7 @@ This patch adjusts clang's default include paths to add FreeBSD-specific directories. -Introduced here: http://svn.freebsd.org/changeset/base/208961 +Introduced here: http://svnweb.freebsd.org/changeset/base/208961 Index: tools/clang/lib/Frontend/InitHeaderSearch.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r208987-format-extensions.diff ============================================================================== --- head/contrib/llvm/patches/patch-r208987-format-extensions.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r208987-format-extensions.diff Sat May 24 22:27:31 2014 (r266630) @@ -1,7 +1,7 @@ This patch adds support for the FreeBSD-specific -fformat-extension option, which enables additional printf modifiers for the kernel. -Introduced here: http://svn.freebsd.org/changeset/base/208987 +Introduced here: http://svnweb.freebsd.org/changeset/base/208987 Index: tools/clang/lib/Frontend/CompilerInvocation.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r209107-clang-vendor-suffix.diff ============================================================================== --- head/contrib/llvm/patches/patch-r209107-clang-vendor-suffix.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r209107-clang-vendor-suffix.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ This patch adds a FreeBSD-specific suffi usually of the form "(yyyyddmm)", representing the date when the compiler was last updated. -Introduced here: http://svn.freebsd.org/changeset/base/209107 +Introduced here: http://svnweb.freebsd.org/changeset/base/209107 Index: tools/clang/lib/Basic/Version.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r213492-amd64-multi-os-dot.diff ============================================================================== --- head/contrib/llvm/patches/patch-r213492-amd64-multi-os-dot.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r213492-amd64-multi-os-dot.diff Sat May 24 22:27:31 2014 (r266630) @@ -1,7 +1,7 @@ This patch makes "clang -print-multi-os-directory" print "." on amd64, which is required by certain ports. -Introduced here: http://svn.freebsd.org/changeset/base/213492 +Introduced here: http://svnweb.freebsd.org/changeset/base/213492 Index: tools/clang/lib/Driver/Driver.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r221503-default-target-triple.diff ============================================================================== --- head/contrib/llvm/patches/patch-r221503-default-target-triple.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r221503-default-target-triple.diff Sat May 24 22:27:31 2014 (r266630) @@ -1,7 +1,7 @@ This patch ensures the target triple that is passed during the compiler build is respected, instead of mangling it. -Introduced here: http://svn.freebsd.org/changeset/base/221503 +Introduced here: http://svnweb.freebsd.org/changeset/base/221503 Index: lib/Support/Unix/Host.inc =================================================================== Modified: head/contrib/llvm/patches/patch-r243830-arm-disable-clear-cache.diff ============================================================================== --- head/contrib/llvm/patches/patch-r243830-arm-disable-clear-cache.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r243830-arm-disable-clear-cache.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ This patch ensures __clear_cache is not clang, this special builtin was emitted as a function call, leading to link errors. -Introduced here: http://svn.freebsd.org/changeset/base/243830 +Introduced here: http://svnweb.freebsd.org/changeset/base/243830 Index: lib/Support/Unix/Memory.inc =================================================================== Modified: head/contrib/llvm/patches/patch-r252503-arm-transient-stack-alignment.diff ============================================================================== --- head/contrib/llvm/patches/patch-r252503-arm-transient-stack-alignment.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r252503-arm-transient-stack-alignment.diff Sat May 24 22:27:31 2014 (r266630) @@ -1,7 +1,7 @@ This patch applies a workaround for an ARM EABI issue, where clang would sometimes incorrectly align the stack in a leaf function that uses TLS. -Introduced here: http://svn.freebsd.org/changeset/base/252503 +Introduced here: http://svnweb.freebsd.org/changeset/base/252503 Index: test/CodeGen/Thumb2/large-stack.ll =================================================================== Modified: head/contrib/llvm/patches/patch-r257109-add-CC-aliases.diff ============================================================================== --- head/contrib/llvm/patches/patch-r257109-add-CC-aliases.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r257109-add-CC-aliases.diff Sat May 24 22:27:31 2014 (r266630) @@ -1,7 +1,7 @@ This patch adds "CC" and "clang-CC" to the list of program name aliases which invoke the C++ compiler. -Introduced here: http://svn.freebsd.org/changeset/base/257109 +Introduced here: http://svnweb.freebsd.org/changeset/base/257109 Index: tools/clang/tools/driver/driver.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r259053-gcc-installation-detector.diff ============================================================================== --- head/contrib/llvm/patches/patch-r259053-gcc-installation-detector.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r259053-gcc-installation-detector.diff Sat May 24 22:27:31 2014 (r266630) @@ -1,7 +1,7 @@ This patch eliminates the unnecessary search for various gcc installation directories during each startup of clang. -Introduced here: http://svn.freebsd.org/changeset/base/259053 +Introduced here: http://svnweb.freebsd.org/changeset/base/259053 Index: tools/clang/lib/Driver/ToolChains.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r259498-add-fxsave.diff ============================================================================== --- head/contrib/llvm/patches/patch-r259498-add-fxsave.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r259498-add-fxsave.diff Sat May 24 22:27:31 2014 (r266630) @@ -1,6 +1,6 @@ This patch adds the alias bit_FXSAVE for bit_FXSR to cpuid.h. -Introduced here: http://svn.freebsd.org/changeset/base/259498 +Introduced here: http://svnweb.freebsd.org/changeset/base/259498 Index: tools/clang/lib/Headers/cpuid.h =================================================================== Modified: head/contrib/llvm/patches/patch-r261680-clang-r200899-fix-security-quantis.diff ============================================================================== --- head/contrib/llvm/patches/patch-r261680-clang-r200899-fix-security-quantis.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r261680-clang-r200899-fix-security-quantis.diff Sat May 24 22:27:31 2014 (r266630) @@ -15,7 +15,7 @@ Pull in r200899 from upstream clang trun Differential Revision: http://llvm-reviews.chandlerc.com/D2688 -Introduced here: http://svn.freebsd.org/changeset/base/261680 +Introduced here: http://svnweb.freebsd.org/changeset/base/261680 Index: tools/clang/test/SemaCXX/c99-variable-length-array.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r261991-llvm-r195391-fix-dwarf2.diff ============================================================================== --- head/contrib/llvm/patches/patch-r261991-llvm-r195391-fix-dwarf2.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r261991-llvm-r195391-fix-dwarf2.diff Sat May 24 22:27:31 2014 (r266630) @@ -18,7 +18,7 @@ Pull in r195391 from upstream llvm trunk Patch (slightly modified) by Keith Walker! -Introduced here: http://svn.freebsd.org/changeset/base/261991 +Introduced here: http://svnweb.freebsd.org/changeset/base/261991 Index: lib/CodeGen/AsmPrinter/DIE.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r261991-llvm-r198385-fix-dwarf2.diff ============================================================================== --- head/contrib/llvm/patches/patch-r261991-llvm-r198385-fix-dwarf2.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r261991-llvm-r198385-fix-dwarf2.diff Sat May 24 22:27:31 2014 (r266630) @@ -5,7 +5,7 @@ Pull in r198385 from upstream llvm trunk Apologies for the noise - we're seeing some Go failures with cgo interacting with Clang's debug info due to this change. -Introduced here: http://svn.freebsd.org/changeset/base/261991 +Introduced here: http://svnweb.freebsd.org/changeset/base/261991 Index: lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r261991-llvm-r198389-fix-dwarf2.diff ============================================================================== --- head/contrib/llvm/patches/patch-r261991-llvm-r198389-fix-dwarf2.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r261991-llvm-r198389-fix-dwarf2.diff Sat May 24 22:27:31 2014 (r266630) @@ -8,7 +8,7 @@ Pull in r198389 from upstream llvm trunk This reverts commit r198385. -Introduced here: http://svn.freebsd.org/changeset/base/261991 +Introduced here: http://svnweb.freebsd.org/changeset/base/261991 Index: lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198028-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198028-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198028-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198028 from upstream llvm trunk [Sparc] Add MCInstPrinter implementation for SPARC. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/InstPrinter/LLVMBuild.txt =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198029-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198029-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198029-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198029 from upstream llvm trunk [Sparc] Add target specific MCExpr class to handle sparc specific modifiers like %hi, %lo, etc., -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/MCTargetDesc/SparcMCExpr.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198030-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198030-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198030-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198030 from upstream llvm trunk [Sparc] Lower and MachineInstr to MC and print assembly using MCInstPrinter. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/MCTargetDesc/SparcTargetStreamer.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198145-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198145-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198145-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -3,7 +3,7 @@ Pull in r198145 from upstream llvm trunk [SparcV9]: Implement lowering of long double (fp128) arguments in Sparc64 ABI. Also, pass fp128 arguments to varargs through integer registers if necessary. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: test/CodeGen/SPARC/64abi.ll =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198149-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198149-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198149-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -3,7 +3,7 @@ Pull in r198149 from upstream llvm trunk [SparcV9] For codegen generated library calls that return float, set inreg flag manually in LowerCall(). This makes the sparc backend to generate Sparc64 ABI compliant code. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcISelLowering.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198157-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198157-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198157-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -3,7 +3,7 @@ Pull in r198157 from upstream llvm trunk [SparcV9] Use separate instruction patterns for 64 bit arithmetic instructions instead of reusing 32 bit instruction patterns. This is done to avoid spilling the result of the 64-bit instructions to a 4-byte slot. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcAsmPrinter.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198280-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198280-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198280-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198280 from upstream llvm trunk [SparcV9]: Use SRL instead of SLL to clear top 32-bits in ctpop:i32. SLL does not clear top 32 bit, only SRL does. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcInstrInfo.td =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198281-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198281-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198281-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198281 from upstream llvm trunk [SparcV9]: Custom lower UMULO/SMULO so that the arguments are send to __multi3() in correct order. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcISelLowering.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198286-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198286-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198286-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198286 from upstream llvm trunk [Sparc] Handle atomic loads/stores in sparc backend. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcInstrInfo.td =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198480-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198480-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198480-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198480 from upstream llvm trunk [SparcV9]: Implement RETURNADDR and FRAMEADDR lowering in SPARC64. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcISelLowering.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198484-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198484-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198484-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198484 from upstream llvm trunk [Sparc] Add the initial implementation of an asm parser for sparc/sparcv9. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198533-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198533-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198533-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198533 from upstream llvm trunk [Sparc] Add initial implementation of MC Code emitter for sparc. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcInstrInfo.td =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198565-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198565-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198565-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198565 from upstream llvm trunk ELF relocation types for sparc. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: include/llvm/Support/ELF.h =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198567-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198567-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198567-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198567 from upstream llvm trunk SPARC: Make helper function static. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcAsmPrinter.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198580-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198580-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198580-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198580 from upstream llvm trunk [Sparc] Add ELF Object Writer for Sparc. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198591-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198591-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198591-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198591 from upstream llvm trunk [Sparc] Add initial implementation of disassembler for sparc -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcInstrFormats.td =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198592-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198592-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198592-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198592 from upstream llvm trunk [Sparc] Explicitly cast -1 to unsigned to fix buildbot errors. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/Disassembler/SparcDisassembler.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198658-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198658-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198658-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198658 from upstream llvm trunk [Sparc] Add support for parsing memory operands in sparc AsmParser. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: test/MC/Sparc/sparc-ctrl-instructions.s =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198681-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198681-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198681-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -3,7 +3,7 @@ Pull in r198681 from upstream llvm trunk [Sparc] Add support for parsing sparc asm modifiers such as %hi, %lo etc., Also, correct the offsets for FixupsKindInfo. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198738-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198738-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198738-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198738 from upstream llvm trunk [Sparc] Add support for parsing branch instructions and conditional moves. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: test/MC/Disassembler/Sparc/sparc.txt =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198739-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198739-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198739-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198739 from upstream llvm trunk [Sparc] Correct the mask for fixup_sparc_br19. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198740-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198740-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198740-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198740 from upstream llvm trunk [SparcV9] Rename operands in some sparc64 instructions so that TableGen can encode them correctly. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: test/MC/Sparc/sparc64-alu-instructions.s =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198893-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198893-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198893-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198893 from upstream llvm trunk [Sparc] Multiclass for loads/stores. No functionality change intended. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcInstr64Bit.td =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198909-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198909-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198909-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198909 from upstream llvm trunk [Sparc] Add support for parsing jmpl instruction and make indirect call and jmp instructions as aliases to jmpl. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/AsmParser/SparcAsmParser.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r198910-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r198910-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r198910-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198910 from upstream llvm trunk [Sparc] Emit retl/ret instead of jmp instruction. It improves the readability of the assembly generated. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: test/CodeGen/SPARC/ctpop.ll =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r199014-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r199014-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r199014-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r199014 from upstream llvm trunk [Sparc] Bundle instruction with delay slow and its filler. Now, we can use -verify-machineinstrs with SPARC backend. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/DelaySlotFiller.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r199024-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r199024-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r199024-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r199024 from upstream llvm trunk [Sparc] Add missing processor types: v7 and niagara -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/Sparc.td =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r199028-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r199028-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r199028-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -13,7 +13,7 @@ Pull in r199028 from upstream llvm trunk 'inreg' flag on the return value, so that behavior is unchanged. This also happens when returning a float _Complex. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: test/CodeGen/SPARC/64abi.ll =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r199031-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r199031-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r199031-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r199031 from upstream llvm trunk [Sparc] Replace (unsigned)-1 with ~OU as suggested by Reid Kleckner. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/Disassembler/SparcDisassembler.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r199033-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r199033-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r199033-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r199033 from upstream llvm trunk [Sparc] Add support for parsing floating point instructions. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcInstrInfo.td =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r199061-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r199061-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r199061-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -8,7 +8,7 @@ Pull in r199061 from upstream llvm trunk Teach isBlockOnlyReachableByFallthrough to find any MBB operands on bundled terminators so SPARC doesn't need to specialize this function. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: test/CodeGen/SPARC/missinglabel.ll =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r199186-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r199186-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r199186-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -11,7 +11,7 @@ Pull in r199186 from upstream llvm trunk The allocation order for DPair begins with the QPR registers, so register allocation is unlikely to change much. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/ARM/ARMISelLowering.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r199187-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r199187-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r199187-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -19,7 +19,7 @@ Pull in r199187 from upstream llvm trunk This fixes a problem where InstrEmitter was picking 32-bit register classes for 64-bit values on SPARC. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: test/CodeGen/SPARC/spillsize.ll =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r199775-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r199775-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r199775-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -3,7 +3,7 @@ Pull in r199775 from upstream llvm trunk [Sparc] Do not add PC to _GLOBAL_OFFSET_TABLE_ address to access GOT in absolute code. Fixes PR#18521 -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcAsmPrinter.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r199781-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r199781-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r199781-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r199781 from upstream llvm trunk [Sparc] Add support for inline assembly constraint 'I'. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: test/CodeGen/SPARC/inlineasm.ll =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r199786-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r199786-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r199786-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r199786 from upstream llvm trunk [Sparc] Add support for inline assembly constraints which specify registers by their aliases. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcISelLowering.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r199940-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r199940-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r199940-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -4,7 +4,7 @@ Pull in r199940 from upstream llvm trunk code this looks correct, but could use review. The previous was definitely not correct. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/AsmParser/SparcAsmParser.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r199974-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r199974-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r199974-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -3,7 +3,7 @@ Pull in r199974 from upstream llvm trunk [Sparc] Correct quad register list in the asm parser. Add test cases to check parsing of v9 double registers and their aliased quad registers. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: test/MC/Disassembler/Sparc/sparc-fp.txt =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r199975-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r199975-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r199975-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -4,7 +4,7 @@ Pull in r199975 from upstream llvm trunk These all use the compare-and-swap CASA/CASXA instructions. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: test/CodeGen/SPARC/atomics.ll =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r199977-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r199977-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r199977-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -3,7 +3,7 @@ Pull in r199977 from upstream llvm trunk [SparcV9] Add support for JIT in Sparc64. With this change, all supported tests in test/ExecutionEngine pass in sparcv9. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcJITInfo.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r200103-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r200103-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r200103-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r200103 from upstream llvm trunk Missing ELF relocations for Sparc. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: include/llvm/Support/ELF.h =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r200104-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r200104-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r200104-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r200104 from upstream llvm trunk removing duplicate enum value -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: include/llvm/Support/ELF.h =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r200112-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r200112-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r200112-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r200112 from upstream llvm trunk [Sparc] Add support for sparc relocation types in ELF object file. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: test/MC/Sparc/sparc-relocations.s =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r200130-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r200130-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r200130-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -4,7 +4,7 @@ Pull in r200130 from upstream llvm trunk Found by SingleSource/UnitTests/AtomicOps.c -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcISelLowering.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r200131-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r200131-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r200131-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -5,7 +5,7 @@ Pull in r200131 from upstream llvm trunk The popc instruction is defined in the SPARCv9 instruction set architecture, but it was emulated on CPUs older than Niagara 2. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcISelLowering.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r200141-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r200141-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r200141-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r200141 from upstream llvm trunk Clean up the Legal/Expand logic for SPARC popc. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcSubtarget.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r200282-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r200282-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r200282-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -5,7 +5,7 @@ Pull in r200282 from upstream llvm trunk Also emit the stubs that were generated for references to typeinfo symbols. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcAsmPrinter.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r200368-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r200368-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r200368-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull r200368 from upstream llvm trunk (b [SparcV9] Use correct register class (I64RegClass) to hold the address of _GLOBAL_OFFSET_TABLE_ in sparcv9. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcInstrInfo.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r200373-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r200373-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r200373-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -6,7 +6,7 @@ Pull in r200373 from upstream llvm trunk combines symbols in different segments". This is because MC computes pc_rel entries with subtract expression between labels from different sections. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcTargetObjectFile.h =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r200376-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r200376-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r200376-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -4,7 +4,7 @@ Pull in r200376 from upstream llvm trunk This makes MCAsmInfo::getExprForFDESymbol() a virtual function and overrides it in SparcMCAsmInfo. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.h =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r200509-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r200509-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r200509-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r200509 from upstream llvm trunk [Sparc] Save and restore float registers that may be used for parameter passing. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcJITInfo.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r200617-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r200617-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r200617-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r200617 from upstream llvm trunk [Sparc] Set %o7 as the return address register instead of %i7 in MCRegisterInfo. Also, add CFI instructions to initialize the frame correctly. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r200960-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r200960-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r200960-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r200960 from upstream llvm trunk [Sparc] Use SparcMCExpr::VariantKind itself as MachineOperand's target flags. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcISelLowering.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r200961-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r200961-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r200961-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r200961 from upstream llvm trunk [Sparc] Emit correct relocations for PIC code when integrated assembler is used. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: test/CodeGen/SPARC/obj-relocs.ll =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r200962-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r200962-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r200962-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r200962 from upstream llvm trunk [Sparc] Emit relocations for Thread Local Storage (TLS) when integrated assembler is used. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r200963-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r200963-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r200963-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r200963 from upstream llvm trunk [Sparc] Emit correct encoding for atomic instructions. Also, add support for parsing CAS instructions to test the CAS encoding. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: test/MC/Sparc/sparc-atomic-instructions.s =================================================================== Modified: head/contrib/llvm/patches/patch-r262261-llvm-r200965-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262261-llvm-r200965-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262261-llvm-r200965-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r200965 from upstream llvm trunk [Sparc] Add support for parsing synthetic instruction 'mov'. -Introduced here: http://svn.freebsd.org/changeset/base/262261 +Introduced here: http://svnweb.freebsd.org/changeset/base/262261 Index: lib/Target/Sparc/SparcInstrAliases.td =================================================================== Modified: head/contrib/llvm/patches/patch-r262262-clang-r198311-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262262-clang-r198311-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262262-clang-r198311-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -3,7 +3,7 @@ Pull in r198311 from upstream clang trun In the FreeBSD assembler driver, inform the sparc assembler that we're producing PIC code. -Introduced here: http://svn.freebsd.org/changeset/base/262262 +Introduced here: http://svnweb.freebsd.org/changeset/base/262262 Index: tools/clang/lib/Driver/Tools.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262262-clang-r198312-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262262-clang-r198312-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262262-clang-r198312-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198312 from upstream clang trun Remove a tab that snuck in. -Introduced here: http://svn.freebsd.org/changeset/base/262262 +Introduced here: http://svnweb.freebsd.org/changeset/base/262262 Index: tools/clang/lib/Driver/Tools.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262262-clang-r198911-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262262-clang-r198911-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262262-clang-r198911-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198911 from upstream clang trun Pass -32/-64 to the assembler when building for sparc/sparc64. -Introduced here: http://svn.freebsd.org/changeset/base/262262 +Introduced here: http://svnweb.freebsd.org/changeset/base/262262 Index: tools/clang/test/Driver/linux-as.c =================================================================== Modified: head/contrib/llvm/patches/patch-r262262-clang-r198912-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262262-clang-r198912-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262262-clang-r198912-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198912 from upstream clang trun Give the linker the right ELF type for SPARC targets. -Introduced here: http://svn.freebsd.org/changeset/base/262262 +Introduced here: http://svnweb.freebsd.org/changeset/base/262262 Index: tools/clang/lib/Driver/Tools.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262262-clang-r198918-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262262-clang-r198918-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262262-clang-r198918-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198918 from upstream clang trun Locate GCC installations on SPARC systems. -Introduced here: http://svn.freebsd.org/changeset/base/262262 +Introduced here: http://svnweb.freebsd.org/changeset/base/262262 Index: tools/clang/lib/Driver/ToolChains.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262262-clang-r198923-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262262-clang-r198923-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262262-clang-r198923-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r198923 from upstream clang trun Use the right dynamic linker for SPARC Linux executables. -Introduced here: http://svn.freebsd.org/changeset/base/262262 +Introduced here: http://svnweb.freebsd.org/changeset/base/262262 Index: tools/clang/lib/Driver/Tools.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262262-clang-r199012-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262262-clang-r199012-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262262-clang-r199012-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r199012 from upstream clang trun Select the UltraSPARC instruction set when invoking the assembler. -Introduced here: http://svn.freebsd.org/changeset/base/262262 +Introduced here: http://svnweb.freebsd.org/changeset/base/262262 Index: tools/clang/lib/Driver/Tools.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262262-clang-r199034-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262262-clang-r199034-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262262-clang-r199034-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r199034 from upstream clang trun MIPS and SPARC assemblers both take the -KPIC flag. -Introduced here: http://svn.freebsd.org/changeset/base/262262 +Introduced here: http://svnweb.freebsd.org/changeset/base/262262 Index: tools/clang/lib/Driver/Tools.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262262-clang-r199037-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262262-clang-r199037-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262262-clang-r199037-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r199037 from upstream clang trun SPARC passes non-trivial C++ objects indirectly like everybody else. -Introduced here: http://svn.freebsd.org/changeset/base/262262 +Introduced here: http://svnweb.freebsd.org/changeset/base/262262 Index: tools/clang/lib/CodeGen/TargetInfo.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262262-clang-r199188-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262262-clang-r199188-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262262-clang-r199188-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -5,7 +5,7 @@ Pull in r199188 from upstream clang trun Pad these structs up so they are sret-returned even on that architecture. -Introduced here: http://svn.freebsd.org/changeset/base/262262 +Introduced here: http://svnweb.freebsd.org/changeset/base/262262 Index: tools/clang/test/CodeGen/sret.c =================================================================== Modified: head/contrib/llvm/patches/patch-r262262-clang-r199399-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262262-clang-r199399-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262262-clang-r199399-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r199399 from upstream clang trun SPARCv9 implements long double as an IEEE quad. -Introduced here: http://svn.freebsd.org/changeset/base/262262 +Introduced here: http://svnweb.freebsd.org/changeset/base/262262 Index: tools/clang/test/CodeGen/sparcv9-abi.c =================================================================== Modified: head/contrib/llvm/patches/patch-r262262-clang-r200452-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262262-clang-r200452-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262262-clang-r200452-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -4,7 +4,7 @@ Pull in r200452 from upstream clang trun Patch by Roman Divacky! -Introduced here: http://svn.freebsd.org/changeset/base/262262 +Introduced here: http://svnweb.freebsd.org/changeset/base/262262 Index: tools/clang/lib/Basic/Targets.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262264-llvm-r200453-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262264-llvm-r200453-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262264-llvm-r200453-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -6,7 +6,7 @@ Pull in r200453 from upstream llvm trunk atomic swap can be implemented in terms of CASX, like the other atomic rmw primitives. -Introduced here: http://svn.freebsd.org/changeset/base/262264 +Introduced here: http://svnweb.freebsd.org/changeset/base/262264 Index: lib/Target/Sparc/SparcInstr64Bit.td =================================================================== Modified: head/contrib/llvm/patches/patch-r262265-llvm-r201718-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262265-llvm-r201718-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262265-llvm-r201718-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r201718 from upstream llvm trunk Expand 64bit {SHL,SHR,SRA}_PARTS on sparcv9. -Introduced here: http://svn.freebsd.org/changeset/base/262265 +Introduced here: http://svnweb.freebsd.org/changeset/base/262265 Index: test/CodeGen/SPARC/parts.ll =================================================================== Modified: head/contrib/llvm/patches/patch-r262303-enable-ppc-integrated-as.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262303-enable-ppc-integrated-as.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262303-enable-ppc-integrated-as.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r197521 from upstream clang trun Use the integrated assembler by default on FreeBSD/ppc and ppc64. -Introduced here: http://svn.freebsd.org/changeset/base/262303 +Introduced here: http://svnweb.freebsd.org/changeset/base/262303 Index: tools/clang/lib/Driver/ToolChains.h =================================================================== Modified: head/contrib/llvm/patches/patch-r262415-llvm-r201994-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262415-llvm-r201994-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262415-llvm-r201994-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r201994 from upstream llvm trunk SPARC: Implement TRAP lowering. Matches what GCC emits. -Introduced here: http://svn.freebsd.org/changeset/base/262415 +Introduced here: http://svnweb.freebsd.org/changeset/base/262415 Index: lib/Target/Sparc/SparcInstrInfo.td =================================================================== Modified: head/contrib/llvm/patches/patch-r262460-llvm-r202059-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262460-llvm-r202059-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262460-llvm-r202059-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r202059 from upstream clang trun Implement getDwarfEHStackPointer() and initDwarfEHRegSizeTable() for sparcv9. -Introduced here: http://svn.freebsd.org/changeset/base/262460 +Introduced here: http://svnweb.freebsd.org/changeset/base/262460 Index: tools/clang/lib/CodeGen/TargetInfo.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262535-clang-r202177-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262535-clang-r202177-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262535-clang-r202177-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -4,7 +4,7 @@ Pull in r202177 from upstream clang trun -march which doesnt exist on sparc gcc to -mcpu. While here adjust a few tests to not write an unused temporary file. -Introduced here: http://svn.freebsd.org/changeset/base/262535 +Introduced here: http://svnweb.freebsd.org/changeset/base/262535 Index: tools/clang/lib/Basic/Targets.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262536-clang-r202179-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262536-clang-r202179-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262536-clang-r202179-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -2,7 +2,7 @@ Pull in r202179 from upstream clang trun Pass the sparc architecture variant to the assembler. -Introduced here: http://svn.freebsd.org/changeset/base/262536 +Introduced here: http://svnweb.freebsd.org/changeset/base/262536 Index: tools/clang/lib/Driver/Tools.cpp =================================================================== Modified: head/contrib/llvm/patches/patch-r262582-llvm-r202422-sparc.diff ============================================================================== --- head/contrib/llvm/patches/patch-r262582-llvm-r202422-sparc.diff Sat May 24 20:37:15 2014 (r266629) +++ head/contrib/llvm/patches/patch-r262582-llvm-r202422-sparc.diff Sat May 24 22:27:31 2014 (r266630) @@ -4,7 +4,7 @@ Pull in r202422 from upstream llvm trunk expensive libcall. Also, Qp_neg is not implemented on at least FreeBSD. This is also what gcc is doing. -Introduced here: http://svn.freebsd.org/changeset/base/262582 +Introduced here: http://svnweb.freebsd.org/changeset/base/262582 Index: lib/Target/Sparc/SparcISelLowering.cpp =================================================================== *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat May 24 22:46:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B26D860; Sat, 24 May 2014 22:46:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5910C248A; Sat, 24 May 2014 22:46:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4OMk1VH053561; Sat, 24 May 2014 22:46:01 GMT (envelope-from zbb@svn.freebsd.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4OMk1nB053560; Sat, 24 May 2014 22:46:01 GMT (envelope-from zbb@svn.freebsd.org) Message-Id: <201405242246.s4OMk1nB053560@svn.freebsd.org> From: Zbigniew Bodek Date: Sat, 24 May 2014 22:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266631 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 22:46:01 -0000 Author: zbb Date: Sat May 24 22:46:00 2014 New Revision: 266631 URL: http://svnweb.freebsd.org/changeset/base/266631 Log: Enable automatic superpages promotion by default on ARMv6/v7 From now on superpages are enabled by default on ARM. One can still disable superpages utilization by adding: vm.pmap.sp_enabled=0 to loader.conf Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sat May 24 22:27:31 2014 (r266630) +++ head/sys/arm/arm/pmap-v6.c Sat May 24 22:46:00 2014 (r266631) @@ -464,7 +464,7 @@ static const uint32_t pc_freemask[_NPCM] static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); /* Superpages utilization enabled = 1 / disabled = 0 */ -static int sp_enabled = 0; +static int sp_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, sp_enabled, CTLFLAG_RDTUN, &sp_enabled, 0, "Are large page mappings enabled?"); From owner-svn-src-head@FreeBSD.ORG Sat May 24 23:12:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 934BBF5A; Sat, 24 May 2014 23:12:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73E9C265B; Sat, 24 May 2014 23:12:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4ONCWnV066753; Sat, 24 May 2014 23:12:32 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ONCVdu066744; Sat, 24 May 2014 23:12:31 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405242312.s4ONCVdu066744@svn.freebsd.org> From: Neel Natu Date: Sat, 24 May 2014 23:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266633 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 23:12:32 -0000 Author: neel Date: Sat May 24 23:12:30 2014 New Revision: 266633 URL: http://svnweb.freebsd.org/changeset/base/266633 Log: Add libvmmapi functions vm_copyin() and vm_copyout() to copy into and out of the guest linear address space. These APIs in turn use a new ioctl 'VM_GLA2GPA' to convert the guest linear address to guest physical. Use the new copyin/copyout APIs when emulating ins/outs instruction in bhyve(8). Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/vmm_dev.c head/sys/amd64/vmm/vmm_ioport.c head/usr.sbin/bhyve/inout.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Sat May 24 22:50:58 2014 (r266632) +++ head/lib/libvmmapi/vmmapi.c Sat May 24 23:12:30 2014 (r266633) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -937,3 +938,88 @@ vm_get_hpet_capabilities(struct vmctx *c *capabilities = cap.capabilities; return (error); } + +static int +vm_gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, + uint64_t gla, int prot, int *fault, uint64_t *gpa) +{ + struct vm_gla2gpa gg; + int error; + + bzero(&gg, sizeof(struct vm_gla2gpa)); + gg.vcpuid = vcpu; + gg.prot = prot; + gg.gla = gla; + gg.paging = *paging; + + error = ioctl(ctx->fd, VM_GLA2GPA, &gg); + if (error == 0) { + *fault = gg.fault; + *gpa = gg.gpa; + } + return (error); +} + +#ifndef min +#define min(a,b) (((a) < (b)) ? (a) : (b)) +#endif + +int +vm_copyin(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, + uint64_t gla, void *vp, size_t len) +{ + char *dst; + const char *src; + uint64_t gpa; + int error, fault, n, off; + + dst = vp; + while (len) { + error = vm_gla2gpa(ctx, vcpu, paging, gla, PROT_READ, + &fault, &gpa); + if (error) + return (-1); + if (fault) + return (1); + + off = gpa & PAGE_MASK; + n = min(len, PAGE_SIZE - off); + src = vm_map_gpa(ctx, gpa, n); + bcopy(src, dst, n); + + gla += n; + dst += n; + len -= n; + } + return (0); +} + +int +vm_copyout(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, + const void *vp, uint64_t gla, size_t len) +{ + uint64_t gpa; + char *dst; + const char *src; + int error, fault, n, off; + + src = vp; + while (len) { + error = vm_gla2gpa(ctx, vcpu, paging, gla, PROT_WRITE, + &fault, &gpa); + if (error) + return (-1); + if (fault) + return (1); + + off = gpa & PAGE_MASK; + n = min(len, PAGE_SIZE - off); + dst = vm_map_gpa(ctx, gpa, n); + bcopy(src, dst, n); + + gla += n; + src += n; + len -= n; + } + return (0); +} Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Sat May 24 22:50:58 2014 (r266632) +++ head/lib/libvmmapi/vmmapi.h Sat May 24 23:12:30 2014 (r266633) @@ -109,6 +109,11 @@ int vm_set_x2apic_state(struct vmctx *ct int vm_get_hpet_capabilities(struct vmctx *ctx, uint32_t *capabilities); +int vm_copyin(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, + uint64_t gla_src, void *dst, size_t len); +int vm_copyout(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, + const void *src, uint64_t gla_dst, size_t len); + /* Reset vcpu register state */ int vcpu_reset(struct vmctx *ctx, int vcpu); Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Sat May 24 22:50:58 2014 (r266632) +++ head/sys/amd64/include/vmm.h Sat May 24 23:12:30 2014 (r266633) @@ -427,7 +427,6 @@ struct vm_inout_str { enum vm_reg_name seg_name; struct seg_desc seg_desc; uint64_t gla; /* may be set to VIE_INVALID_GLA */ - uint64_t gpa; }; struct vm_exit { Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Sat May 24 22:50:58 2014 (r266632) +++ head/sys/amd64/include/vmm_dev.h Sat May 24 23:12:30 2014 (r266633) @@ -168,6 +168,15 @@ struct vm_suspend { enum vm_suspend_how how; }; +struct vm_gla2gpa { + int vcpuid; /* inputs */ + int prot; /* PROT_READ or PROT_WRITE */ + uint64_t gla; + struct vm_guest_paging paging; + int fault; /* outputs */ + uint64_t gpa; +}; + enum { /* general routines */ IOCNUM_ABIVERS = 0, @@ -180,6 +189,7 @@ enum { IOCNUM_MAP_MEMORY = 10, IOCNUM_GET_MEMORY_SEG = 11, IOCNUM_GET_GPA_PMAP = 12, + IOCNUM_GLA2GPA = 13, /* register/state accessors */ IOCNUM_SET_REGISTER = 20, @@ -289,4 +299,6 @@ enum { _IOR('v', IOCNUM_GET_HPET_CAPABILITIES, struct vm_hpet_cap) #define VM_GET_GPA_PMAP \ _IOWR('v', IOCNUM_GET_GPA_PMAP, struct vm_gpa_pte) +#define VM_GLA2GPA \ + _IOWR('v', IOCNUM_GLA2GPA, struct vm_gla2gpa) #endif Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Sat May 24 22:50:58 2014 (r266632) +++ head/sys/amd64/vmm/vmm_dev.c Sat May 24 23:12:30 2014 (r266633) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "vmm_lapic.h" @@ -168,6 +169,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c struct vm_x2apic *x2apic; struct vm_gpa_pte *gpapte; struct vm_suspend *vmsuspend; + struct vm_gla2gpa *gg; sc = vmmdev_lookup2(cdev); if (sc == NULL) @@ -192,6 +194,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c case VM_PPTDEV_MSI: case VM_PPTDEV_MSIX: case VM_SET_X2APIC_STATE: + case VM_GLA2GPA: /* * XXX fragile, handle with care * Assumes that the first field of the ioctl data is the vcpu. @@ -415,6 +418,27 @@ vmmdev_ioctl(struct cdev *cdev, u_long c case VM_GET_HPET_CAPABILITIES: error = vhpet_getcap((struct vm_hpet_cap *)data); break; + case VM_GLA2GPA: { + CTASSERT(PROT_READ == VM_PROT_READ); + CTASSERT(PROT_WRITE == VM_PROT_WRITE); + CTASSERT(PROT_EXEC == VM_PROT_EXECUTE); + gg = (struct vm_gla2gpa *)data; + error = vmm_gla2gpa(sc->vm, gg->vcpuid, &gg->paging, gg->gla, + gg->prot, &gg->gpa); + KASSERT(error == 0 || error == 1 || error == -1, + ("%s: vmm_gla2gpa unknown error %d", __func__, error)); + if (error >= 0) { + /* + * error = 0: the translation was successful + * error = 1: a fault was injected into the guest + */ + gg->fault = error; + error = 0; + } else { + error = EFAULT; + } + break; + } default: error = ENOTTY; break; Modified: head/sys/amd64/vmm/vmm_ioport.c ============================================================================== --- head/sys/amd64/vmm/vmm_ioport.c Sat May 24 22:50:58 2014 (r266632) +++ head/sys/amd64/vmm/vmm_ioport.c Sat May 24 23:12:30 2014 (r266633) @@ -145,7 +145,7 @@ emulate_inout_str(struct vm *vm, int vcp { struct vm_inout_str *vis; uint64_t gla, index, segbase; - int error, in; + int in; vis = &vmexit->u.inout_str; in = vis->inout.in; @@ -197,18 +197,8 @@ emulate_inout_str(struct vm *vm, int vcp } vis->gla = gla; - error = vmm_gla2gpa(vm, vcpuid, &vis->paging, gla, - in ? VM_PROT_WRITE : VM_PROT_READ, &vis->gpa); - KASSERT(error == 0 || error == 1 || error == -1, - ("%s: vmm_gla2gpa unexpected error %d", __func__, error)); - if (error == -1) { - return (EFAULT); - } else if (error == 1) { - return (0); /* Resume guest to handle page fault */ - } else { - *retu = true; - return (0); /* Return to userspace to finish emulation */ - } + *retu = true; + return (0); /* Return to userspace to finish emulation */ } int Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Sat May 24 22:50:58 2014 (r266632) +++ head/usr.sbin/bhyve/inout.c Sat May 24 23:12:30 2014 (r266633) @@ -102,14 +102,12 @@ int emulate_inout(struct vmctx *ctx, int vcpu, struct vm_exit *vmexit, int strict) { int addrsize, bytes, flags, in, port, rep; - uint64_t gpa, gpaend; uint32_t val; inout_func_t handler; void *arg; - char *gva; int error, retval; enum vm_reg_name idxreg; - uint64_t index, count; + uint64_t gla, index, count; struct vm_inout_str *vis; bytes = vmexit->u.inout.bytes; @@ -149,10 +147,6 @@ emulate_inout(struct vmctx *ctx, int vcp /* Count register */ count = vis->count & vie_size2mask(addrsize); - gpa = vis->gpa; - gpaend = rounddown(gpa + PAGE_SIZE, PAGE_SIZE); - gva = paddr_guest2host(ctx, gpa, gpaend - gpa); - if (vie_alignment_check(vis->paging.cpl, bytes, vis->cr0, vis->rflags, vis->gla)) { error = vm_inject_exception2(ctx, vcpu, IDT_AC, 0); @@ -160,26 +154,34 @@ emulate_inout(struct vmctx *ctx, int vcp return (INOUT_RESTART); } - while (count != 0 && gpa < gpaend) { - /* - * XXX this may not work for unaligned accesses because - * the last access on the page may spill over into the - * adjacent page in the linear address space. This is a - * problem because we don't have a gla2gpa() mapping of - * this adjacent page. - */ - assert(gpaend - gpa >= bytes); - + gla = vis->gla; + while (count) { val = 0; - if (!in) - bcopy(gva, &val, bytes); + if (!in) { + error = vm_copyin(ctx, vcpu, &vis->paging, + gla, &val, bytes); + assert(error == 0 || error == 1 || error == -1); + if (error) { + retval = (error == 1) ? INOUT_RESTART : + INOUT_ERROR; + break; + } + } retval = handler(ctx, vcpu, in, port, bytes, &val, arg); if (retval != 0) break; - if (in) - bcopy(&val, gva, bytes); + if (in) { + error = vm_copyout(ctx, vcpu, &vis->paging, + &val, gla, bytes); + assert(error == 0 || error == 1 || error == -1); + if (error) { + retval = (error == 1) ? INOUT_RESTART : + INOUT_ERROR; + break; + } + } /* Update index */ if (vis->rflags & PSL_D) @@ -188,8 +190,7 @@ emulate_inout(struct vmctx *ctx, int vcp index += bytes; count--; - gva += bytes; - gpa += bytes; + gla += bytes; } /* Update index register */ From owner-svn-src-head@FreeBSD.ORG Sat May 24 23:13:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86674121; Sat, 24 May 2014 23:13:20 +0000 (UTC) Received: from mailrelay009.isp.belgacom.be (mailrelay009.isp.belgacom.be [195.238.6.176]) by mx1.freebsd.org (Postfix) with ESMTP id 213FE265F; Sat, 24 May 2014 23:13:18 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQGANkmgVNbsXvB/2dsb2JhbABYgweBHa0+lE4BgQMXdIIlAQEFViMQCw4EBgklDyoQDgYTiEYB11YXjh8zB4RAAQOZcpMogzo7 Received: from 193.123-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.123.193]) by relay.skynet.be with ESMTP; 25 May 2014 01:13:10 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.8/8.14.8) with ESMTP id s4OND8J6084381; Sun, 25 May 2014 01:13:08 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Sun, 25 May 2014 01:13:07 +0200 From: Tijl Coosemans To: Nathan Whitehorn Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140525011307.142b41ab@kalimero.tijl.coosemans.org> In-Reply-To: <5380EBA8.1030200@freebsd.org> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> <5380EBA8.1030200@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , svn-src-head@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 23:13:20 -0000 On Sat, 24 May 2014 11:57:44 -0700 Nathan Whitehorn wrote: > On 05/24/14 11:23, Ian Lepore wrote: >> On Sat, 2014-05-24 at 18:53 +0200, Tijl Coosemans wrote: >>> On Sat, 24 May 2014 09:04:33 -0700 Nathan Whitehorn wrote: >>>> On 05/24/14 07:59, Tijl Coosemans wrote: >>>>> On Fri, 23 May 2014 17:29:48 -0600 Warner Losh wrote: >>>>>> On May 23, 2014, at 10:20 AM, Baptiste Daroussin = wrote: >>>>>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn wrote: >>>>>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn wrote: >>>>>>>>>> Is there any chance of finally switching the pkg abi identifiers= to just >>>>>>>>>> be uname -p? >>>>>>>>>> -Nathan >>>>>>>>> Keeping asking won't make it happen, I have explained a large num= ber of time why it >>>>>>>>> happened, why it is not easy for compatibility and why uname -p i= s still not >>>>>>>>> representing the ABI we do support, and what flexibility we need = that the >>>>>>>>> current string offers to us. >>>>>>>>> >>>>>>>>> if one is willing to do the work, please be my guess, just dig in= to the archives >>>>>>>>> and join the pkg development otherwise: no it won't happen before= a while >>>>>>>>> because we have way too much work on the todo and this item is st= ored at the >>>>>>>>> very end of this todo. >>>>>>>>> >>>>>>>>> regards, >>>>>>>>> Bapt >>>>>>>> I'm happy to do the work, and have volunteered now many times. If = uname >>>>>>>> -p does not describe the ABI fully, then uname -p needs changes on= the >>>>>>>> relevant platforms. Which are they? What extra flexibility does the >>>>>>>> string give you if uname -p describes the ABI completely? >>>>>>>> -Nathan >>>>>>> just simple examples in armv6: >>>>>>> - eabi vs oabi >>>>>>> - The different float abi (even if only one is supported for now ot= hers are >>>>>>> being worked on) >>>>>>> - little endian vs big endian >>>>>> All of those are encoded in the MACHINE_ARCH + freebsd version, no e= xceptions >>>>>> on supported architectures that are tier 2 or higher. This seems lik= e a weak reason. >>>>>> >>>>>>> the extras flexibilit is being able to say this binary do support f= reebsd i386 >>>>>>> and amd64 in one key, freebsd:9:x86:*, or or all arches freebsd:10:* >>>>>> Will there be a program to convert this new, special invention to th= e standard >>>>>> that we=A2ve used for the past 20 years? If you need the flexibility= , which I=A2m not >>>>>> entirely sure I=A2ve seen a good use case for. When would you have a= x86 binary >>>>>> package? Wouldn=A2t it be either i386 or amd64? >>>>> ABI isn't just about the instruction set. It's also about the sizes = of C >>>>> types (like pointers). If I remember correctly, the pkg scheme was c= hosen >>>>> to allow for ABIs like x32 which use the 64 bit instruction set with = 32 >>>>> bit pointers. MACHINE_ARCH would also be amd64 in this case. >>>> No, it wouldn't. MACHINE_ARCH would be something else (x32, probably) = in >>>> such cases. MACHINE_ARCH (and uname -p, which reports it) is the FreeB= SD >>>> ABI identifier and encodes 100% of the ABI information. This would be >>>> true even if there is never an x32 kernel. >>> No, there's no such thing as an x32 kernel. It's an amd64 kernel that >>> supports a second userland ABI. In C preprocessor terms they are >>> distinguished by (__amd64__ && _LP64) and (__amd64__ && !_LP64). >>> uname -p gives you the processor architecture (the __amd64__ bit) but >>> then you can still choose the sizes of standard C types (the _LP64 bit). >>> So far we've always had one ABI per processor architecture but this >>> is not strictly necessary. >> >> All you have to do is look at the plethora of ARM ABIs we support (and >> the corresponding separate kernel for each) to see the falseness of that >> last sentence. ARM variations include v4 vs v6, OABI vs EABI (calling >> and register usage standards), hard vs soft float, little vs big endian. >> Virtually all combinations of those are possible (there are a few combos >> we don't support), and each one has its own MACHINE_ARCH. >=20 > Exactly. This doesn't rely on the kernel either. The hw.machine_arch=20 > sysctl (what uname -p returns) gives the ABI of the calling binary=20 > rather than the kernel. So if you use a 32-bit uname (e.g. in a chroot)=20 > on an amd64 host, you get i386. The same will be true if and when we=20 > support a 32-bit amd64 userland -- even if there is no x32 kernel, an=20 > x32 uname will return "x32" (or "amd32" or whatever it ends up being=20 > called). That string will also appear in kern.supported_archs. There isn't necessarily any chroot environment. There's one kernel, two equally valid ABIs (ILP32 and LP64) and any binary like uname might use either of them. If uname -p returns a different result depending on which of these two ABIs it was compiled for that could be a problem for any script that uses it. From owner-svn-src-head@FreeBSD.ORG Sat May 24 23:46:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9682693C; Sat, 24 May 2014 23:46:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83960285B; Sat, 24 May 2014 23:46:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4ONkhiX080330; Sat, 24 May 2014 23:46:43 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ONkg8s080321; Sat, 24 May 2014 23:46:42 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201405242346.s4ONkg8s080321@svn.freebsd.org> From: Baptiste Daroussin Date: Sat, 24 May 2014 23:46:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266636 - in head/contrib/libucl: . include src tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 23:46:43 -0000 Author: bapt Date: Sat May 24 23:46:41 2014 New Revision: 266636 URL: http://svnweb.freebsd.org/changeset/base/266636 Log: merge libucl 20140514 this version brings xpath-like interface for ucl objects Modified: head/contrib/libucl/configure.ac head/contrib/libucl/include/ucl.h head/contrib/libucl/src/ucl_internal.h head/contrib/libucl/src/ucl_parser.c head/contrib/libucl/src/ucl_util.c head/contrib/libucl/tests/test_generate.c Directory Properties: head/contrib/libucl/ (props changed) Modified: head/contrib/libucl/configure.ac ============================================================================== --- head/contrib/libucl/configure.ac Sat May 24 23:42:44 2014 (r266635) +++ head/contrib/libucl/configure.ac Sat May 24 23:46:41 2014 (r266636) @@ -1,7 +1,7 @@ m4_define([maj_ver], [0]) m4_define([med_ver], [4]) -m4_define([min_ver], [0]) -m4_define([so_version], [maj_ver:med_ver]) +m4_define([min_ver], [1]) +m4_define([so_version], [1:0:0]) m4_define([ucl_version], [maj_ver.med_ver.min_ver]) AC_INIT([libucl],[ucl_version],[https://github.com/vstakhov/libucl],[libucl]) Modified: head/contrib/libucl/include/ucl.h ============================================================================== --- head/contrib/libucl/include/ucl.h Sat May 24 23:42:44 2014 (r266635) +++ head/contrib/libucl/include/ucl.h Sat May 24 23:46:41 2014 (r266636) @@ -236,7 +236,13 @@ UCL_EXTERN ucl_object_t* ucl_object_new * @param type type of a new object * @return new object */ -UCL_EXTERN ucl_object_t* ucl_object_typed_new (unsigned int type) UCL_WARN_UNUSED_RESULT; +UCL_EXTERN ucl_object_t* ucl_object_typed_new (ucl_type_t type) UCL_WARN_UNUSED_RESULT; + +/** + * Return the type of an object + * @return the object type + */ +UCL_EXTERN ucl_type_t ucl_object_type (const ucl_object_t *obj); /** * Convert any string to an ucl object making the specified transformations @@ -413,6 +419,15 @@ UCL_EXTERN const ucl_object_t* ucl_array UCL_EXTERN ucl_object_t* ucl_array_pop_last (ucl_object_t *top); /** + * Return object identified by an index of the array `top` + * @param obj object to get a key from (must be of type UCL_ARRAY) + * @param index index to return + * @return object at the specified index or NULL if index is not found + */ +UCL_EXTERN const ucl_object_t* ucl_array_find_index (const ucl_object_t *top, + unsigned int index); + +/** * Removes the first element from the array `top`. Caller must unref the returned object when it is not * needed. * @param top array ucl object @@ -534,6 +549,15 @@ UCL_EXTERN const ucl_object_t* ucl_objec const char *key, size_t klen); /** + * Return object identified by dot notation string + * @param obj object to search in + * @param path dot.notation.path to the path to lookup. May use numeric .index on arrays + * @return object matched the specified path or NULL if path is not found + */ +UCL_EXTERN const ucl_object_t *ucl_lookup_path (const ucl_object_t *obj, + const char *path); + +/** * Returns a key of an object as a NULL terminated string * @param obj CL object * @return key or NULL if there is no key @@ -643,6 +667,19 @@ UCL_EXTERN void ucl_parser_register_macr ucl_macro_handler handler, void* ud); /** + * Handler to detect unregistered variables + * @param data variable data + * @param len length of variable + * @param replace (out) replace value for variable + * @param replace_len (out) replace length for variable + * @param need_free (out) UCL will free `dest` after usage + * @param ud opaque userdata + * @return true if variable + */ +typedef bool (*ucl_variable_handler) (const unsigned char *data, size_t len, + unsigned char **replace, size_t *replace_len, bool *need_free, void* ud); + +/** * Register new parser variable * @param parser parser object * @param var variable name @@ -652,6 +689,15 @@ UCL_EXTERN void ucl_parser_register_vari const char *value); /** + * Set handler for unknown variables + * @param parser parser structure + * @param handler desired handler + * @param ud opaque data for the handler + */ +UCL_EXTERN void ucl_parser_set_variables_handler (struct ucl_parser *parser, + ucl_variable_handler handler, void *ud); + +/** * Load new chunk to a parser * @param parser parser structure * @param data the pointer to the beginning of a chunk Modified: head/contrib/libucl/src/ucl_internal.h ============================================================================== --- head/contrib/libucl/src/ucl_internal.h Sat May 24 23:42:44 2014 (r266635) +++ head/contrib/libucl/src/ucl_internal.h Sat May 24 23:46:41 2014 (r266636) @@ -197,6 +197,8 @@ struct ucl_parser { struct ucl_chunk *chunks; struct ucl_pubkey *keys; struct ucl_variable *variables; + ucl_variable_handler var_handler; + void *var_data; UT_string *err; }; Modified: head/contrib/libucl/src/ucl_parser.c ============================================================================== --- head/contrib/libucl/src/ucl_parser.c Sat May 24 23:42:44 2014 (r266635) +++ head/contrib/libucl/src/ucl_parser.c Sat May 24 23:46:41 2014 (r266636) @@ -236,6 +236,9 @@ ucl_check_variable_safe (struct ucl_pars size_t *out_len, bool strict, bool *found) { struct ucl_variable *var; + unsigned char *dst; + size_t dstlen; + bool need_free = false; LL_FOREACH (parser->variables, var) { if (strict) { @@ -258,6 +261,19 @@ ucl_check_variable_safe (struct ucl_pars } } + /* XXX: can only handle ${VAR} */ + if (!(*found) && parser->var_handler != NULL && strict) { + /* Call generic handler */ + if (parser->var_handler (ptr, remain, &dst, &dstlen, &need_free, + parser->var_data)) { + *found = true; + if (need_free) { + free (dst); + } + return (ptr + remain); + } + } + return ptr; } @@ -271,7 +287,8 @@ ucl_check_variable_safe (struct ucl_pars * @return */ static const char * -ucl_check_variable (struct ucl_parser *parser, const char *ptr, size_t remain, size_t *out_len, bool *vars_found) +ucl_check_variable (struct ucl_parser *parser, const char *ptr, + size_t remain, size_t *out_len, bool *vars_found) { const char *p, *end, *ret = ptr; bool found = false; @@ -282,7 +299,8 @@ ucl_check_variable (struct ucl_parser *p end = ptr + remain; while (p < end) { if (*p == '}') { - ret = ucl_check_variable_safe (parser, ptr + 1, p - ptr - 1, out_len, true, &found); + ret = ucl_check_variable_safe (parser, ptr + 1, p - ptr - 1, + out_len, true, &found); if (found) { /* {} must be excluded actually */ ret ++; @@ -328,10 +346,13 @@ static const char * ucl_expand_single_variable (struct ucl_parser *parser, const char *ptr, size_t remain, unsigned char **dest) { - unsigned char *d = *dest; + unsigned char *d = *dest, *dst; const char *p = ptr + 1, *ret; struct ucl_variable *var; + size_t dstlen; + bool need_free = false; bool found = false; + bool strict = false; ret = ptr + 1; remain --; @@ -343,6 +364,7 @@ ucl_expand_single_variable (struct ucl_p } else if (*p == '{') { p ++; + strict = true; ret += 2; remain -= 2; } @@ -359,9 +381,22 @@ ucl_expand_single_variable (struct ucl_p } } if (!found) { - memcpy (d, ptr, 2); - d += 2; - ret --; + if (strict && parser->var_handler != NULL) { + if (parser->var_handler (ptr, remain, &dst, &dstlen, &need_free, + parser->var_data)) { + memcpy (d, dst, dstlen); + ret += dstlen; + d += remain; + found = true; + } + } + + /* Leave variable as is */ + if (!found) { + memcpy (d, ptr, 2); + d += 2; + ret --; + } } *dest = d; @@ -1873,6 +1908,14 @@ ucl_parser_register_variable (struct ucl } } +void +ucl_parser_set_variables_handler (struct ucl_parser *parser, + ucl_variable_handler handler, void *ud) +{ + parser->var_handler = handler; + parser->var_data = ud; +} + bool ucl_parser_add_chunk (struct ucl_parser *parser, const unsigned char *data, size_t len) Modified: head/contrib/libucl/src/ucl_util.c ============================================================================== --- head/contrib/libucl/src/ucl_util.c Sat May 24 23:42:44 2014 (r266635) +++ head/contrib/libucl/src/ucl_util.c Sat May 24 23:46:41 2014 (r266636) @@ -1330,20 +1330,10 @@ ucl_object_find_keyl (const ucl_object_t const ucl_object_t * ucl_object_find_key (const ucl_object_t *obj, const char *key) { - size_t klen; - const ucl_object_t *ret; - ucl_object_t srch; - - if (obj == NULL || obj->type != UCL_OBJECT || key == NULL) { + if (key == NULL) return NULL; - } - klen = strlen (key); - srch.key = key; - srch.keylen = klen; - ret = ucl_hash_search_obj (obj->value.ov, &srch); - - return ret; + return ucl_object_find_keyl (obj, key, strlen(key)); } const ucl_object_t* @@ -1396,6 +1386,58 @@ ucl_iterate_object (const ucl_object_t * return NULL; } +const ucl_object_t * +ucl_lookup_path (const ucl_object_t *top, const char *path_in) { + const ucl_object_t *o = NULL, *found; + const char *p, *c; + char *err_str; + unsigned index; + + if (path_in == NULL || top == NULL) { + return NULL; + } + + found = NULL; + p = path_in; + + /* Skip leading dots */ + while (*p == '.') { + p ++; + } + + c = p; + while (*p != '\0') { + p ++; + if (*p == '.' || *p == '\0') { + if (p > c) { + switch (top->type) { + case UCL_ARRAY: + /* Key should be an int */ + index = strtoul (c, &err_str, 10); + if (err_str != NULL && (*err_str != '.' && *err_str != '\0')) { + return NULL; + } + o = ucl_array_find_index (top, index); + break; + default: + o = ucl_object_find_keyl (top, c, p - c); + break; + } + if (o == NULL) { + return NULL; + } + top = o; + } + if (*p != '\0') { + c = p + 1; + } + } + } + found = o; + + return found; +} + ucl_object_t * ucl_object_new (void) @@ -1411,7 +1453,7 @@ ucl_object_new (void) } ucl_object_t * -ucl_object_typed_new (unsigned int type) +ucl_object_typed_new (ucl_type_t type) { ucl_object_t *new; new = malloc (sizeof (ucl_object_t)); @@ -1423,6 +1465,12 @@ ucl_object_typed_new (unsigned int type) return new; } +ucl_type_t +ucl_object_type (const ucl_object_t *obj) +{ + return obj->type; +} + ucl_object_t* ucl_object_fromstring (const char *str) { @@ -1591,6 +1639,27 @@ ucl_array_pop_first (ucl_object_t *top) return ucl_array_delete (top, __DECONST(ucl_object_t *, ucl_array_head (top))); } +const ucl_object_t * +ucl_array_find_index (const ucl_object_t *top, unsigned int index) +{ + ucl_object_iter_t it = NULL; + const ucl_object_t *ret; + + if (top == NULL || top->type != UCL_ARRAY || top->len == 0 || + (index + 1) > top->len) { + return NULL; + } + + while ((ret = ucl_iterate_object (top, &it, true)) != NULL) { + if (index == 0) { + return ret; + } + --index; + } + + return NULL; +} + ucl_object_t * ucl_elt_append (ucl_object_t *head, ucl_object_t *elt) { Modified: head/contrib/libucl/tests/test_generate.c ============================================================================== --- head/contrib/libucl/tests/test_generate.c Sat May 24 23:42:44 2014 (r266635) +++ head/contrib/libucl/tests/test_generate.c Sat May 24 23:46:41 2014 (r266636) @@ -30,6 +30,7 @@ int main (int argc, char **argv) { ucl_object_t *obj, *cur, *ar, *ref; + const ucl_object_t *found; FILE *out; unsigned char *emitted; const char *fname_out = NULL; @@ -114,6 +115,23 @@ main (int argc, char **argv) cur = ucl_object_frombool (true); ucl_object_insert_key (obj, cur, "k=3", 0, false); + /* Try to find using path */ + /* Should exist */ + found = ucl_lookup_path (obj, "key4.1"); + assert (found != NULL && ucl_object_toint (found) == 10); + /* . should be ignored */ + found = ucl_lookup_path (obj, ".key4.1"); + assert (found != NULL && ucl_object_toint (found) == 10); + /* moar dots... */ + found = ucl_lookup_path (obj, ".key4........1..."); + assert (found != NULL && ucl_object_toint (found) == 10); + /* No such index */ + found = ucl_lookup_path (obj, ".key4.3"); + assert (found == NULL); + /* No such key */ + found = ucl_lookup_path (obj, "key9..key1"); + assert (found == NULL); + emitted = ucl_object_emit (obj, UCL_EMIT_CONFIG); fprintf (out, "%s\n", emitted); From owner-svn-src-head@FreeBSD.ORG Sat May 24 23:53:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F4FEA98 for ; Sat, 24 May 2014 23:53:10 +0000 (UTC) Received: from mail-ig0-f181.google.com (mail-ig0-f181.google.com [209.85.213.181]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BE8D28D9 for ; Sat, 24 May 2014 23:53:09 +0000 (UTC) Received: by mail-ig0-f181.google.com with SMTP id h3so1978319igd.14 for ; Sat, 24 May 2014 16:53:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=4BcffB5iCu/Q3PbbLnEUh7hoxdVfaKeanYiEAo5OeY8=; b=Pr8Wgr6He3ocPopN5T37/y2ID8Ps7t/92HsWXy9ExsKsbdUy6Nc49vZs8YEkaDBRUp tO9tTKYRQBCjVolW3vlJZ6QASLZ8+hezGQ8Fn6H4bUs5mA6fszm2keerxDS6Q2TuKfA0 7zE8AFwMIC6z5LpDn2usmpv/Hml86bXgjah3o+qEOpKxIf3YPHacV8pM6MdlyMgnu4Yz VmznNsmVn7WvsLXCzEOEsAZtv5O2+mlc4zkKYJiLf2a8JZFFCEGQ9Xrog8K9m64vrYb5 Ll4SvZQkdCL+htmWuYsB99xbBdoghe4JBFD46u86WadOHZRa6Gvkd7u47Q+f1tPVMP3+ /dKQ== X-Gm-Message-State: ALoCoQlGwxxheAdEAyTenW3WFCHWUt8CkRnaWEDsb7Ih9y+UxJ7UXx8Dmo09u6Qq/fqSTqmmLCcp X-Received: by 10.50.122.73 with SMTP id lq9mr13052579igb.13.1400975582177; Sat, 24 May 2014 16:53:02 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id nk1sm15390438igb.0.2014.05.24.16.53.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 24 May 2014 16:53:01 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_02A95910-71D2-41B1-B1EA-81D13A907F81"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266553 - head/release/scripts From: Warner Losh In-Reply-To: <20140525011307.142b41ab@kalimero.tijl.coosemans.org> Date: Sat, 24 May 2014 17:53:09 -0600 Message-Id: <3CCAFAD3-FABE-40EF-ABF9-815FE5826349@bsdimp.com> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> <5380EBA8.1030200@freebsd.org> <20140525011307.142b41ab@kalimero.tijl.coosemans.org> To: Tijl Coosemans X-Mailer: Apple Mail (2.1878.2) Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , Nathan Whitehorn , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 May 2014 23:53:10 -0000 --Apple-Mail=_02A95910-71D2-41B1-B1EA-81D13A907F81 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-7 On May 24, 2014, at 5:13 PM, Tijl Coosemans wrote: > On Sat, 24 May 2014 11:57:44 -0700 Nathan Whitehorn wrote: >> On 05/24/14 11:23, Ian Lepore wrote: >>> On Sat, 2014-05-24 at 18:53 +0200, Tijl Coosemans wrote: >>>> On Sat, 24 May 2014 09:04:33 -0700 Nathan Whitehorn wrote: >>>>> On 05/24/14 07:59, Tijl Coosemans wrote: >>>>>> On Fri, 23 May 2014 17:29:48 -0600 Warner Losh wrote: >>>>>>> On May 23, 2014, at 10:20 AM, Baptiste Daroussin = wrote: >>>>>>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn = wrote: >>>>>>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>>>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn = wrote: >>>>>>>>>>> Is there any chance of finally switching the pkg abi = identifiers to just >>>>>>>>>>> be uname -p? >>>>>>>>>>> -Nathan >>>>>>>>>> Keeping asking won't make it happen, I have explained a large = number of time why it >>>>>>>>>> happened, why it is not easy for compatibility and why uname = -p is still not >>>>>>>>>> representing the ABI we do support, and what flexibility we = need that the >>>>>>>>>> current string offers to us. >>>>>>>>>>=20 >>>>>>>>>> if one is willing to do the work, please be my guess, just = dig into the archives >>>>>>>>>> and join the pkg development otherwise: no it won't happen = before a while >>>>>>>>>> because we have way too much work on the todo and this item = is stored at the >>>>>>>>>> very end of this todo. >>>>>>>>>>=20 >>>>>>>>>> regards, >>>>>>>>>> Bapt >>>>>>>>> I'm happy to do the work, and have volunteered now many times. = If uname >>>>>>>>> -p does not describe the ABI fully, then uname -p needs = changes on the >>>>>>>>> relevant platforms. Which are they? What extra flexibility = does the >>>>>>>>> string give you if uname -p describes the ABI completely? >>>>>>>>> -Nathan >>>>>>>> just simple examples in armv6: >>>>>>>> - eabi vs oabi >>>>>>>> - The different float abi (even if only one is supported for = now others are >>>>>>>> being worked on) >>>>>>>> - little endian vs big endian >>>>>>> All of those are encoded in the MACHINE_ARCH + freebsd version, = no exceptions >>>>>>> on supported architectures that are tier 2 or higher. This seems = like a weak reason. >>>>>>>=20 >>>>>>>> the extras flexibilit is being able to say this binary do = support freebsd i386 >>>>>>>> and amd64 in one key, freebsd:9:x86:*, or or all arches = freebsd:10:* >>>>>>> Will there be a program to convert this new, special invention = to the standard >>>>>>> that we=A2ve used for the past 20 years? If you need the = flexibility, which I=A2m not >>>>>>> entirely sure I=A2ve seen a good use case for. When would you = have a x86 binary >>>>>>> package? Wouldn=A2t it be either i386 or amd64? >>>>>> ABI isn't just about the instruction set. It's also about the = sizes of C >>>>>> types (like pointers). If I remember correctly, the pkg scheme = was chosen >>>>>> to allow for ABIs like x32 which use the 64 bit instruction set = with 32 >>>>>> bit pointers. MACHINE_ARCH would also be amd64 in this case. >>>>> No, it wouldn't. MACHINE_ARCH would be something else (x32, = probably) in >>>>> such cases. MACHINE_ARCH (and uname -p, which reports it) is the = FreeBSD >>>>> ABI identifier and encodes 100% of the ABI information. This would = be >>>>> true even if there is never an x32 kernel. >>>> No, there's no such thing as an x32 kernel. It's an amd64 kernel = that >>>> supports a second userland ABI. In C preprocessor terms they are >>>> distinguished by (__amd64__ && _LP64) and (__amd64__ && !_LP64). >>>> uname -p gives you the processor architecture (the __amd64__ bit) = but >>>> then you can still choose the sizes of standard C types (the _LP64 = bit). >>>> So far we've always had one ABI per processor architecture but this >>>> is not strictly necessary. >>>=20 >>> All you have to do is look at the plethora of ARM ABIs we support = (and >>> the corresponding separate kernel for each) to see the falseness of = that >>> last sentence. ARM variations include v4 vs v6, OABI vs EABI = (calling >>> and register usage standards), hard vs soft float, little vs big = endian. >>> Virtually all combinations of those are possible (there are a few = combos >>> we don't support), and each one has its own MACHINE_ARCH. >>=20 >> Exactly. This doesn't rely on the kernel either. The hw.machine_arch=20= >> sysctl (what uname -p returns) gives the ABI of the calling binary=20 >> rather than the kernel. So if you use a 32-bit uname (e.g. in a = chroot)=20 >> on an amd64 host, you get i386. The same will be true if and when we=20= >> support a 32-bit amd64 userland -- even if there is no x32 kernel, an=20= >> x32 uname will return "x32" (or "amd32" or whatever it ends up being=20= >> called). That string will also appear in kern.supported_archs. >=20 > There isn't necessarily any chroot environment. There's one kernel, > two equally valid ABIs (ILP32 and LP64) and any binary like uname = might > use either of them. If uname -p returns a different result depending = on > which of these two ABIs it was compiled for that could be a problem = for > any script that uses it. Well, it depends on what you want to do with the script, eh? If you want = to know the ABI of the native binary uname, that=A2s one thing. But if = you want to know the supported ABIs, you are doing it wrong by using = uname. You should be using sysctl kern.supported_abi. That will tell you = all the ABIs that you can install packages for on this machine, which is = what you really want to know. So I=A2m having trouble connecting the = dots between this and what you are saying here. I still am absolutely flabbergasted why the MACHINE_ARCH names aren=A2t = necessary and sufficient for packaging. I=A2ve yet to see any coherent = reason to not use them. Warner --Apple-Mail=_02A95910-71D2-41B1-B1EA-81D13A907F81 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTgTDlAAoJEGwc0Sh9sBEA/0YP+wff0BgZzV3tZYQiP0qp6b3I wlxdKCDQZRh0p7fcKc9+44iVkyCCzuZv0Gk97j5Y3sDZNIu5oU5uwR0X9Nsbt/Rp stbDMbv36fPsM6Kj7C07Ugb5ElN9gH/UulO9Vm3RqCL1tZJO35w/MXWwBDzZHZw8 TySBj2WUaSaFmgYGLmBv2X6sJJfEmYMl9GcC2TUpdEPfNLu5xNgDECmuO9uOmbSh aRO5pFRnprWkwWfv0PuXrBBkVJevgcWzq5euylIVfs85XTNmNugflJzQfYXiI5qx GBnJbXgI6B95qFIg37g95zKI35Ny591jy9X2oYpinYNxlhv2pRFjFlJD+liWtB0z Wpp7OnaWO1FxpQS+lSaqbjNPrJ9eLTpNMMenwXEU567t5w9P4pRjAUW/o8eFqbCj wHiRaaRAIJ5qEewF8sW33975gRufMy64ASnXCosz5RUG9wDTcXlQ5G+JiGwMo9BA 5fuEHlkHzpWZ3sCV4PfOYqWUH0Dy6YbZ74gfXI92QbyCq/4/TANG85fNC8DzZ14e FgE5WqhRzrBVJmoFFW+lQly/YV2i2Akh8xt3WqDEhPmppMCQ3uA0fGK4n7PXNmIK 2hc/E+qbMMoImT3sQ9rfVXanTCXoHdGNt+G06/C8b5d9jseElQuvuWUFeqCYq6iC TAy0uy04ejLfGBFICSb/ =Xm3M -----END PGP SIGNATURE----- --Apple-Mail=_02A95910-71D2-41B1-B1EA-81D13A907F81-- From owner-svn-src-head@FreeBSD.ORG Sun May 25 00:13:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F835163; Sun, 25 May 2014 00:13:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B9E62A49; Sun, 25 May 2014 00:13:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4P0DV1j094458; Sun, 25 May 2014 00:13:31 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4P0DTxe094446; Sun, 25 May 2014 00:13:29 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201405250013.s4P0DTxe094446@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 25 May 2014 00:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266639 - in head/contrib/byacc: . package package/debian package/pkgsrc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 00:13:31 -0000 Author: bapt Date: Sun May 25 00:13:29 2014 New Revision: 266639 URL: http://svnweb.freebsd.org/changeset/base/266639 Log: Update to 20140422 Modified: head/contrib/byacc/CHANGES head/contrib/byacc/MANIFEST head/contrib/byacc/README.BTYACC head/contrib/byacc/VERSION head/contrib/byacc/config.guess head/contrib/byacc/config.sub head/contrib/byacc/config_h.in head/contrib/byacc/configure head/contrib/byacc/configure.in head/contrib/byacc/defs.h head/contrib/byacc/main.c head/contrib/byacc/mstring.c head/contrib/byacc/output.c head/contrib/byacc/package/byacc.spec head/contrib/byacc/package/debian/changelog head/contrib/byacc/package/mingw-byacc.spec head/contrib/byacc/package/pkgsrc/Makefile Directory Properties: head/contrib/byacc/ (props changed) Modified: head/contrib/byacc/CHANGES ============================================================================== --- head/contrib/byacc/CHANGES Sun May 25 00:07:39 2014 (r266638) +++ head/contrib/byacc/CHANGES Sun May 25 00:13:29 2014 (r266639) @@ -1,3 +1,42 @@ +2014-04-22 Thomas E. Dickey + + * mstring.c: + use vsnprintf() to ensure that msprintf's buffer is large enough. + + * main.c, defs.h: add mstring_leaks() + + * configure: regen + + * output.c: fix a complementary warning + + * mstring.c: introduce vsnprintf + + * configure.in, config_h.in: add check for vsnprintf + + * output.c: quiet a type-conversion warning + + * mstring.c: fix a potential memory leak on ENOMEM + quiet a couple of type-conversion warnings + + * defs.h: add/use GCC_PRINTFLIKE for msprintf() + +2014-04-22 Tom.Shields + + * README.BTYACC: + drop "NOTES-btyacc-Changes" and "NOTES-btyacc-Disposition", merging relevant + content into README.BTYACC + +2014-04-22 Thomas E. Dickey + + * package/pkgsrc/Makefile, VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec: + bump + +2014-04-19 Thomas E. Dickey + + * config.sub: 2014-04-03 + + * config.guess: 2014-03-23 + 2014-04-09 Rick.Spates * main.c, defs.h: patch to allow DEBUG build with WIN32 system Modified: head/contrib/byacc/MANIFEST ============================================================================== --- head/contrib/byacc/MANIFEST Sun May 25 00:07:39 2014 (r266638) +++ head/contrib/byacc/MANIFEST Sun May 25 00:13:29 2014 (r266639) @@ -1,4 +1,4 @@ -MANIFEST for byacc-20140409, version t20140409 +MANIFEST for byacc-20140422, version t20140422 -------------------------------------------------------------------------------- MANIFEST this file ACKNOWLEDGEMENTS original version of byacc - 1993 @@ -6,8 +6,6 @@ AUTHORS nickname Makefile.old renamed from Makefile NEW_FEATURES original version of byacc - 1993 NOTES original version of byacc - 1993 -NOTES-btyacc-Changes byacc-btyacc-20140323 -NOTES-btyacc-Disposition byacc-btyacc-20140323 NO_WARRANTY original version of byacc - 1993 README original version of byacc - 1993 README.BTYACC byacc-btyacc-20140323 Modified: head/contrib/byacc/README.BTYACC ============================================================================== --- head/contrib/byacc/README.BTYACC Sun May 25 00:07:39 2014 (r266638) +++ head/contrib/byacc/README.BTYACC Sun May 25 00:13:29 2014 (r266639) @@ -1,4 +1,4 @@ --- $Id: README.BTYACC,v 1.1 2014/03/25 19:21:31 Tom.Shields Exp $ +-- $Id: README.BTYACC,v 1.2 2014/04/22 08:18:57 Tom.Shields Exp $ The original README from btyacc is below. @@ -8,6 +8,20 @@ byacc baseline. The %include and %define/%ifdef enhancements described below are not currently incorporated. +The position management functionality ("YYPOSN", "yyposn", "YYREDUCEPOSNFUNC", +"YYREDUCEPOSNFUNCARG" & "YYCALLREDUCEPOSN") is replaced by a bison-compatible +"%locations" implementation. + +The memory management functionality ("YYDELETEVAL" & "YYDELETEPOSN") is +replaced by a bison-compatible "%destructor" implementation. + +The detailed syntax error processing functionality ("YYERROR_DETAILED" +& "yyerror_detailed()") is subsumed by the bison-compatible "yyerror()" +implementation, as modified by the %parse-param and %locations directives. + +The debugging macro "YYDBPR()" in the parser skeleton is renamed +"YYSTYPE_TOSTRING()". + ------------------------------------------------------------------------------- BTYACC -- backtracking yacc =========================== Modified: head/contrib/byacc/VERSION ============================================================================== --- head/contrib/byacc/VERSION Sun May 25 00:07:39 2014 (r266638) +++ head/contrib/byacc/VERSION Sun May 25 00:13:29 2014 (r266639) @@ -1 +1 @@ -20140409 +20140422 Modified: head/contrib/byacc/config.guess ============================================================================== --- head/contrib/byacc/config.guess Sun May 25 00:07:39 2014 (r266638) +++ head/contrib/byacc/config.guess Sun May 25 00:13:29 2014 (r266639) @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2013 Free Software Foundation, Inc. +# Copyright 1992-2014 Free Software Foundation, Inc. -timestamp='2013-11-29' +timestamp='2014-03-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -149,7 +149,7 @@ Linux|GNU|GNU/*) LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac @@ -826,7 +826,7 @@ EOF *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) + *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) @@ -969,10 +969,10 @@ EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} exit ;; - or32:Linux:*:*) + or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) @@ -1371,154 +1371,6 @@ EOF exit ;; esac -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - cat >&2 <&5 +for ac_func in vsnprintf +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:3936: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3942 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3973: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3976: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3979: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3982: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:3992: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <&5 echo $ECHO_N "checking for maximum table size... $ECHO_C" >&6 # Check whether --with-max-table-size or --without-max-table-size was given. @@ -3940,12 +4009,12 @@ if test "${with_max_table_size+set}" = s fi; if test -n "$with_max_table_size" then - echo "$as_me:3943: result: $with_max_table_size" >&5 + echo "$as_me:4012: result: $with_max_table_size" >&5 echo "${ECHO_T}$with_max_table_size" >&6 check=`expr "$with_max_table_size" + 0` if test "x$check" != "x$with_max_table_size" then - { { echo "$as_me:3948: error: invalid value for --with-max-table-size: $with_max_table_size" >&5 + { { echo "$as_me:4017: error: invalid value for --with-max-table-size: $with_max_table_size" >&5 echo "$as_me: error: invalid value for --with-max-table-size: $with_max_table_size" >&2;} { (exit 1); exit 1; }; } fi @@ -3955,11 +4024,11 @@ cat >>confdefs.h <&5 + echo "$as_me:4027: result: default" >&5 echo "${ECHO_T}default" >&6 fi -echo "$as_me:3962: checking if backtracking extension is wanted" >&5 +echo "$as_me:4031: checking if backtracking extension is wanted" >&5 echo $ECHO_N "checking if backtracking extension is wanted... $ECHO_C" >&6 # Check whether --enable-btyacc or --disable-btyacc was given. @@ -3967,7 +4036,7 @@ if test "${enable_btyacc+set}" = set; th enableval="$enable_btyacc" fi; -echo "$as_me:3970: result: $enable_btyacc" >&5 +echo "$as_me:4039: result: $enable_btyacc" >&5 echo "${ECHO_T}$enable_btyacc" >&6 if test "$enable_btyacc" = "yes"; then @@ -3982,7 +4051,7 @@ fi if ( test "$GCC" = yes || test "$GXX" = yes ) then -echo "$as_me:3985: checking if you want to check for gcc warnings" >&5 +echo "$as_me:4054: checking if you want to check for gcc warnings" >&5 echo $ECHO_N "checking if you want to check for gcc warnings... $ECHO_C" >&6 # Check whether --with-warnings or --without-warnings was given. @@ -3992,7 +4061,7 @@ if test "${with_warnings+set}" = set; th else cf_opt_with_warnings=no fi; -echo "$as_me:3995: result: $cf_opt_with_warnings" >&5 +echo "$as_me:4064: result: $cf_opt_with_warnings" >&5 echo "${ECHO_T}$cf_opt_with_warnings" >&6 if test "$cf_opt_with_warnings" != no ; then @@ -4014,10 +4083,10 @@ cat > conftest.i <&5 + { echo "$as_me:4086: checking for $CC __attribute__ directives..." >&5 echo "$as_me: checking for $CC __attribute__ directives..." >&6;} cat > conftest.$ac_ext <&5 + if { (eval echo "$as_me:4138: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4072: \$? = $ac_status" >&5 + echo "$as_me:4141: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:4074: result: ... $cf_attribute" >&5 + test -n "$verbose" && echo "$as_me:4143: result: ... $cf_attribute" >&5 echo "${ECHO_T}... $cf_attribute" >&6 cat conftest.h >>confdefs.h case $cf_attribute in #(vi @@ -4135,12 +4204,12 @@ INTEL_COMPILER=no if test "$GCC" = yes ; then case $host_os in linux*|gnu*) - echo "$as_me:4138: checking if this is really Intel C compiler" >&5 + echo "$as_me:4207: checking if this is really Intel C compiler" >&5 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -no-gcc" cat >conftest.$ac_ext <<_ACEOF -#line 4143 "configure" +#line 4212 "configure" #include "confdefs.h" int @@ -4157,16 +4226,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4160: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4229: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4163: \$? = $ac_status" >&5 + echo "$as_me:4232: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4166: \"$ac_try\"") >&5 + { (eval echo "$as_me:4235: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4169: \$? = $ac_status" >&5 + echo "$as_me:4238: \$? = $ac_status" >&5 (exit $ac_status); }; }; then INTEL_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147" @@ -4177,7 +4246,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" - echo "$as_me:4180: result: $INTEL_COMPILER" >&5 + echo "$as_me:4249: result: $INTEL_COMPILER" >&5 echo "${ECHO_T}$INTEL_COMPILER" >&6 ;; esac @@ -4186,12 +4255,12 @@ fi CLANG_COMPILER=no if test "$GCC" = yes ; then - echo "$as_me:4189: checking if this is really Clang C compiler" >&5 + echo "$as_me:4258: checking if this is really Clang C compiler" >&5 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Qunused-arguments" cat >conftest.$ac_ext <<_ACEOF -#line 4194 "configure" +#line 4263 "configure" #include "confdefs.h" int @@ -4208,16 +4277,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4211: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4280: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4214: \$? = $ac_status" >&5 + echo "$as_me:4283: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4217: \"$ac_try\"") >&5 + { (eval echo "$as_me:4286: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4220: \$? = $ac_status" >&5 + echo "$as_me:4289: \$? = $ac_status" >&5 (exit $ac_status); }; }; then CLANG_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" @@ -4228,12 +4297,12 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" - echo "$as_me:4231: result: $CLANG_COMPILER" >&5 + echo "$as_me:4300: result: $CLANG_COMPILER" >&5 echo "${ECHO_T}$CLANG_COMPILER" >&6 fi cat > conftest.$ac_ext <&5 + { echo "$as_me:4322: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-Wall" @@ -4266,12 +4335,12 @@ echo "$as_me: checking for $CC warning o wd981 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:4269: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:4338: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4272: \$? = $ac_status" >&5 + echo "$as_me:4341: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:4274: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:4343: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi @@ -4280,7 +4349,7 @@ echo "${ECHO_T}... -$cf_opt" >&6 elif test "$GCC" = yes then - { echo "$as_me:4283: checking for $CC warning options..." >&5 + { echo "$as_me:4352: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS= @@ -4304,12 +4373,12 @@ echo "$as_me: checking for $CC warning o Wundef $cf_gcc_warnings $cf_warn_CONST Wwrite-strings do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:4307: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:4376: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4310: \$? = $ac_status" >&5 + echo "$as_me:4379: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:4312: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:4381: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 case $cf_opt in #(vi Wcast-qual) #(vi @@ -4320,7 +4389,7 @@ echo "${ECHO_T}... -$cf_opt" >&6 [34].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 -echo "${as_me:-configure}:4323: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 +echo "${as_me:-configure}:4392: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac @@ -4330,7 +4399,7 @@ echo "${as_me:-configure}:4323: testing [12].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 -echo "${as_me:-configure}:4333: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 +echo "${as_me:-configure}:4402: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac @@ -4346,7 +4415,7 @@ rm -rf conftest* fi fi -echo "$as_me:4349: checking if you want to see long compiling messages" >&5 +echo "$as_me:4418: checking if you want to see long compiling messages" >&5 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6 # Check whether --enable-echo or --disable-echo was given. @@ -4380,10 +4449,10 @@ else ECHO_CC='' fi; -echo "$as_me:4383: result: $enableval" >&5 +echo "$as_me:4452: result: $enableval" >&5 echo "${ECHO_T}$enableval" >&6 -echo "$as_me:4386: checking if you want to use dmalloc for testing" >&5 +echo "$as_me:4455: checking if you want to use dmalloc for testing" >&5 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6 # Check whether --with-dmalloc or --without-dmalloc was given. @@ -4400,7 +4469,7 @@ EOF else with_dmalloc= fi; -echo "$as_me:4403: result: ${with_dmalloc:-no}" >&5 +echo "$as_me:4472: result: ${with_dmalloc:-no}" >&5 echo "${ECHO_T}${with_dmalloc:-no}" >&6 case .$with_cflags in #(vi @@ -4494,23 +4563,23 @@ fi esac if test "$with_dmalloc" = yes ; then - echo "$as_me:4497: checking for dmalloc.h" >&5 + echo "$as_me:4566: checking for dmalloc.h" >&5 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6 if test "${ac_cv_header_dmalloc_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4503 "configure" +#line 4572 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:4507: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:4576: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:4513: \$? = $ac_status" >&5 + echo "$as_me:4582: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -4529,11 +4598,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:4532: result: $ac_cv_header_dmalloc_h" >&5 +echo "$as_me:4601: result: $ac_cv_header_dmalloc_h" >&5 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6 if test $ac_cv_header_dmalloc_h = yes; then -echo "$as_me:4536: checking for dmalloc_debug in -ldmalloc" >&5 +echo "$as_me:4605: checking for dmalloc_debug in -ldmalloc" >&5 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4541,7 +4610,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4544 "configure" +#line 4613 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -4560,16 +4629,16 @@ dmalloc_debug (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4563: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4632: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4566: \$? = $ac_status" >&5 + echo "$as_me:4635: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4569: \"$ac_try\"") >&5 + { (eval echo "$as_me:4638: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4572: \$? = $ac_status" >&5 + echo "$as_me:4641: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dmalloc_dmalloc_debug=yes else @@ -4580,7 +4649,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4583: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 +echo "$as_me:4652: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then cat >>confdefs.h <&5 +echo "$as_me:4667: checking if you want to use dbmalloc for testing" >&5 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6 # Check whether --with-dbmalloc or --without-dbmalloc was given. @@ -4612,7 +4681,7 @@ EOF else with_dbmalloc= fi; -echo "$as_me:4615: result: ${with_dbmalloc:-no}" >&5 +echo "$as_me:4684: result: ${with_dbmalloc:-no}" >&5 echo "${ECHO_T}${with_dbmalloc:-no}" >&6 case .$with_cflags in #(vi @@ -4706,23 +4775,23 @@ fi esac if test "$with_dbmalloc" = yes ; then - echo "$as_me:4709: checking for dbmalloc.h" >&5 + echo "$as_me:4778: checking for dbmalloc.h" >&5 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6 if test "${ac_cv_header_dbmalloc_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4715 "configure" +#line 4784 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:4719: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:4788: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:4725: \$? = $ac_status" >&5 + echo "$as_me:4794: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -4741,11 +4810,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:4744: result: $ac_cv_header_dbmalloc_h" >&5 +echo "$as_me:4813: result: $ac_cv_header_dbmalloc_h" >&5 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6 if test $ac_cv_header_dbmalloc_h = yes; then -echo "$as_me:4748: checking for debug_malloc in -ldbmalloc" >&5 +echo "$as_me:4817: checking for debug_malloc in -ldbmalloc" >&5 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4753,7 +4822,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldbmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4756 "configure" +#line 4825 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -4772,16 +4841,16 @@ debug_malloc (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4775: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4844: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4778: \$? = $ac_status" >&5 + echo "$as_me:4847: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4781: \"$ac_try\"") >&5 + { (eval echo "$as_me:4850: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4784: \$? = $ac_status" >&5 + echo "$as_me:4853: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dbmalloc_debug_malloc=yes else @@ -4792,7 +4861,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4795: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 +echo "$as_me:4864: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then cat >>confdefs.h <&5 +echo "$as_me:4879: checking if you want to use valgrind for testing" >&5 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6 # Check whether --with-valgrind or --without-valgrind was given. @@ -4824,7 +4893,7 @@ EOF else with_valgrind= fi; -echo "$as_me:4827: result: ${with_valgrind:-no}" >&5 +echo "$as_me:4896: result: ${with_valgrind:-no}" >&5 echo "${ECHO_T}${with_valgrind:-no}" >&6 case .$with_cflags in #(vi @@ -4917,7 +4986,7 @@ fi ;; esac -echo "$as_me:4920: checking if you want to perform memory-leak testing" >&5 +echo "$as_me:4989: checking if you want to perform memory-leak testing" >&5 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6 # Check whether --enable-leaks or --disable-leaks was given. @@ -4927,7 +4996,7 @@ if test "${enable_leaks+set}" = set; the else : ${with_no_leaks:=no} fi; -echo "$as_me:4930: result: $with_no_leaks" >&5 +echo "$as_me:4999: result: $with_no_leaks" >&5 echo "${ECHO_T}$with_no_leaks" >&6 if test "$with_no_leaks" = yes ; then @@ -5023,7 +5092,7 @@ DEFS=-DHAVE_CONFIG_H : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:5026: creating $CONFIG_STATUS" >&5 +{ echo "$as_me:5095: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL @@ -5196,7 +5265,7 @@ cat >>$CONFIG_STATUS <<\EOF echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header - { { echo "$as_me:5199: error: ambiguous option: $1 + { { echo "$as_me:5268: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} @@ -5215,7 +5284,7 @@ Try \`$0 --help' for more information." ac_need_defaults=false;; # This is an error. - -*) { { echo "$as_me:5218: error: unrecognized option: $1 + -*) { { echo "$as_me:5287: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} @@ -5252,7 +5321,7 @@ do # Handling of arguments. "makefile" ) CONFIG_FILES="$CONFIG_FILES makefile" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config_h.in" ;; - *) { { echo "$as_me:5255: error: invalid argument: $ac_config_target" >&5 + *) { { echo "$as_me:5324: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac @@ -5487,7 +5556,7 @@ done; } esac if test x"$ac_file" != x-; then - { echo "$as_me:5490: creating $ac_file" >&5 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun May 25 00:57:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E517645; Sun, 25 May 2014 00:57:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1ABB72CD0; Sun, 25 May 2014 00:57:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4P0vPah011976; Sun, 25 May 2014 00:57:25 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4P0vOWv011967; Sun, 25 May 2014 00:57:24 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405250057.s4P0vOWv011967@svn.freebsd.org> From: Neel Natu Date: Sun, 25 May 2014 00:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266641 - in head: sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 00:57:26 -0000 Author: neel Date: Sun May 25 00:57:24 2014 New Revision: 266641 URL: http://svnweb.freebsd.org/changeset/base/266641 Log: Do the linear address calculation for the ins/outs emulation using a new API function 'vie_calculate_gla()'. While the current implementation is simplistic it forms the basis of doing segmentation checks if the guest is in 32-bit protected mode. Modified: head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_instruction_emul.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm_instruction_emul.c head/sys/amd64/vmm/vmm_ioport.c head/usr.sbin/bhyve/inout.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Sun May 25 00:57:07 2014 (r266640) +++ head/sys/amd64/include/vmm.h Sun May 25 00:57:24 2014 (r266641) @@ -426,7 +426,6 @@ struct vm_inout_str { int addrsize; enum vm_reg_name seg_name; struct seg_desc seg_desc; - uint64_t gla; /* may be set to VIE_INVALID_GLA */ }; struct vm_exit { Modified: head/sys/amd64/include/vmm_instruction_emul.h ============================================================================== --- head/sys/amd64/include/vmm_instruction_emul.h Sun May 25 00:57:07 2014 (r266640) +++ head/sys/amd64/include/vmm_instruction_emul.h Sun May 25 00:57:24 2014 (r266641) @@ -67,6 +67,9 @@ int vie_canonical_check(enum vm_cpu_mode uint64_t vie_size2mask(int size); +int vie_calculate_gla(enum vm_cpu_mode cpu_mode, int addrsize, + enum vm_reg_name seg, struct seg_desc *desc, uint64_t off, uint64_t *gla); + #ifdef _KERNEL /* * APIs to fetch and decode the instruction from nested page fault handler. @@ -89,9 +92,6 @@ int vmm_gla2gpa(struct vm *vm, int vcpui void vie_init(struct vie *vie); -uint64_t vie_segbase(enum vm_reg_name segment, enum vm_cpu_mode cpu_mode, - const struct seg_desc *desc); - /* * Decode the instruction fetched into 'vie' so it can be emulated. * Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sun May 25 00:57:07 2014 (r266640) +++ head/sys/amd64/vmm/intel/vmx.c Sun May 25 00:57:24 2014 (r266641) @@ -2012,7 +2012,6 @@ vmx_exit_process(struct vmx *vmx, int vc vis->count = inout_str_count(vmx, vcpu, vis->inout.rep); vis->addrsize = inout_str_addrsize(inst_info); inout_str_seginfo(vmx, vcpu, inst_info, in, vis); - vis->gla = vmcs_gla(); } break; case EXIT_REASON_CPUID: Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Sun May 25 00:57:07 2014 (r266640) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Sun May 25 00:57:24 2014 (r266641) @@ -607,6 +607,38 @@ vie_size2mask(int size) return (size2mask[size]); } +int +vie_calculate_gla(enum vm_cpu_mode cpu_mode, int addrsize, enum vm_reg_name seg, + struct seg_desc *desc, uint64_t offset, uint64_t *gla) +{ + uint64_t segbase; + int glasize; + + KASSERT(seg >= VM_REG_GUEST_ES && seg <= VM_REG_GUEST_GS, + ("%s: invalid segment %d", __func__, seg)); + + glasize = (cpu_mode == CPU_MODE_64BIT) ? 8 : 4; + + /* + * In 64-bit mode all segments except %fs and %gs have a segment + * base address of 0. + */ + if (cpu_mode == CPU_MODE_64BIT && seg != VM_REG_GUEST_FS && + seg != VM_REG_GUEST_GS) { + segbase = 0; + } else { + segbase = desc->base; + } + + /* + * Truncate 'offset' to the effective address size before adding + * it to the segment base. + */ + offset &= vie_size2mask(addrsize); + *gla = (segbase + offset) & vie_size2mask(glasize); + return (0); +} + #ifdef _KERNEL void vie_init(struct vie *vie) @@ -1271,42 +1303,4 @@ vmm_decode_instruction(struct vm *vm, in return (0); } - -uint64_t -vie_segbase(enum vm_reg_name seg, enum vm_cpu_mode cpu_mode, - const struct seg_desc *desc) -{ - int basesize; - - basesize = 4; /* default segment width in bytes */ - - switch (seg) { - case VM_REG_GUEST_ES: - case VM_REG_GUEST_CS: - case VM_REG_GUEST_SS: - case VM_REG_GUEST_DS: - if (cpu_mode == CPU_MODE_64BIT) { - /* - * Segments having an implicit base address of 0 - * in 64-bit mode. - */ - return (0); - } - break; - case VM_REG_GUEST_FS: - case VM_REG_GUEST_GS: - if (cpu_mode == CPU_MODE_64BIT) { - /* - * In 64-bit mode the FS and GS base address is 8 bytes - * wide. - */ - basesize = 8; - } - break; - default: - panic("%s: invalid segment register %d", __func__, seg); - } - - return (desc->base & size2mask[basesize]); -} #endif /* _KERNEL */ Modified: head/sys/amd64/vmm/vmm_ioport.c ============================================================================== --- head/sys/amd64/vmm/vmm_ioport.c Sun May 25 00:57:07 2014 (r266640) +++ head/sys/amd64/vmm/vmm_ioport.c Sun May 25 00:57:24 2014 (r266641) @@ -144,7 +144,6 @@ static int emulate_inout_str(struct vm *vm, int vcpuid, struct vm_exit *vmexit, bool *retu) { struct vm_inout_str *vis; - uint64_t gla, index, segbase; int in; vis = &vmexit->u.inout_str; @@ -182,21 +181,6 @@ emulate_inout_str(struct vm *vm, int vcp return (EINVAL); } - segbase = vie_segbase(vis->seg_name, vis->paging.cpu_mode, - &vis->seg_desc); - index = vis->index & vie_size2mask(vis->addrsize); - gla = segbase + index; - - /* - * Verify that the computed linear address matches with the one - * provided by hardware. - */ - if (vis->gla != VIE_INVALID_GLA) { - KASSERT(gla == vis->gla, ("%s: gla mismatch " - "%#lx/%#lx", __func__, gla, vis->gla)); - } - vis->gla = gla; - *retu = true; return (0); /* Return to userspace to finish emulation */ } Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Sun May 25 00:57:07 2014 (r266640) +++ head/usr.sbin/bhyve/inout.c Sun May 25 00:57:24 2014 (r266641) @@ -147,15 +147,25 @@ emulate_inout(struct vmctx *ctx, int vcp /* Count register */ count = vis->count & vie_size2mask(addrsize); - if (vie_alignment_check(vis->paging.cpl, bytes, vis->cr0, - vis->rflags, vis->gla)) { - error = vm_inject_exception2(ctx, vcpu, IDT_AC, 0); - assert(error == 0); - return (INOUT_RESTART); - } - - gla = vis->gla; while (count) { + if (vie_calculate_gla(vis->paging.cpu_mode, + vis->addrsize, vis->seg_name, &vis->seg_desc, + index, &gla)) { + error = vm_inject_exception2(ctx, vcpu, + IDT_GP, 0); + assert(error == 0); + return (INOUT_RESTART); + } + + if (vie_alignment_check(vis->paging.cpl, bytes, + vis->cr0, vis->rflags, gla)) { + error = vm_inject_exception2(ctx, vcpu, + IDT_AC, 0); + assert(error == 0); + return (INOUT_RESTART); + } + + val = 0; if (!in) { error = vm_copyin(ctx, vcpu, &vis->paging, @@ -190,7 +200,6 @@ emulate_inout(struct vmctx *ctx, int vcp index += bytes; count--; - gla += bytes; } /* Update index register */ From owner-svn-src-head@FreeBSD.ORG Sun May 25 01:00:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D29BA79A for ; Sun, 25 May 2014 01:00:11 +0000 (UTC) Received: from mail-ig0-f181.google.com (mail-ig0-f181.google.com [209.85.213.181]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 907C32CE6 for ; Sun, 25 May 2014 01:00:11 +0000 (UTC) Received: by mail-ig0-f181.google.com with SMTP id h3so2003278igd.14 for ; Sat, 24 May 2014 18:00:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=Z+IMEZekvr4N7gJpIdIXzUdNTXHaCJ+2b6fYytx0xXo=; b=ViQlG4GiPOUUr8n/gkUvX+BCYbf4HL2mEeO62fUjNRFYkgBuaaSxuZjLrcYw1nqP8X Vcn+oLVuMh4VH4zlb4iey0VDhDY3XPXwn9FUg/C4wNDD5pYi2nBVCupfTzsZwkAxCEUZ k/2/2hwmBtUU9qspYlRg6EcAZ3veKhtwCMpT3zEEq31KXnayKnguHgD/FmJwDLYrmdCx LdHfL6J6/BNAtRTIWc0128XYrLSD+NAkaHotJuaXtuL+HY46CiIk7LTTNfuh9XB57EPH jD7vt+PXiySi2ROtMmK2Qnl29PtkAr1IEQjhhuw8eNyODIfpMbEOmLkOcvdAj7CbCesz jsZQ== X-Gm-Message-State: ALoCoQlPafOErP2+QgntLLTmGnuE60OFarLWQyPypDm3pzbrF8dQmQm6ehZaYnhHUVt5K79Wu/Mb X-Received: by 10.42.214.143 with SMTP id ha15mr13317518icb.59.1400979610414; Sat, 24 May 2014 18:00:10 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id z4sm15730969igl.13.2014.05.24.18.00.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 24 May 2014 18:00:09 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_D96245BB-20CC-4BA9-B917-447FFECDDD08"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266553 - head/release/scripts From: Warner Losh In-Reply-To: <3CCAFAD3-FABE-40EF-ABF9-815FE5826349@bsdimp.com> Date: Sat, 24 May 2014 19:00:18 -0600 Message-Id: <9FE34CE4-C71F-4806-9EF6-30CB1051C62F@bsdimp.com> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> <5380EBA8.1030200@freebsd.org> <20140525011307.142b41ab@kalimero.tijl.coosemans.org> <3CCAFAD3-FABE-40EF-ABF9-815FE5826349@bsdimp.com> To: Tijl Coosemans X-Mailer: Apple Mail (2.1878.2) Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , Nathan Whitehorn , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 01:00:11 -0000 --Apple-Mail=_D96245BB-20CC-4BA9-B917-447FFECDDD08 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-7 On May 24, 2014, at 5:53 PM, Warner Losh wrote: >=20 > On May 24, 2014, at 5:13 PM, Tijl Coosemans wrote: >=20 >> On Sat, 24 May 2014 11:57:44 -0700 Nathan Whitehorn wrote: >>> On 05/24/14 11:23, Ian Lepore wrote: >>>> On Sat, 2014-05-24 at 18:53 +0200, Tijl Coosemans wrote: >>>>> On Sat, 24 May 2014 09:04:33 -0700 Nathan Whitehorn wrote: >>>>>> On 05/24/14 07:59, Tijl Coosemans wrote: >>>>>>> On Fri, 23 May 2014 17:29:48 -0600 Warner Losh wrote: >>>>>>>> On May 23, 2014, at 10:20 AM, Baptiste Daroussin = wrote: >>>>>>>>> On Fri, May 23, 2014 at 08:52:28AM -0700, Nathan Whitehorn = wrote: >>>>>>>>>> On 05/23/14 08:36, Baptiste Daroussin wrote: >>>>>>>>>>> On Fri, May 23, 2014 at 08:19:34AM -0700, Nathan Whitehorn = wrote: >>>>>>>>>>>> Is there any chance of finally switching the pkg abi = identifiers to just >>>>>>>>>>>> be uname -p? >>>>>>>>>>>> -Nathan >>>>>>>>>>> Keeping asking won't make it happen, I have explained a = large number of time why it >>>>>>>>>>> happened, why it is not easy for compatibility and why uname = -p is still not >>>>>>>>>>> representing the ABI we do support, and what flexibility we = need that the >>>>>>>>>>> current string offers to us. >>>>>>>>>>>=20 >>>>>>>>>>> if one is willing to do the work, please be my guess, just = dig into the archives >>>>>>>>>>> and join the pkg development otherwise: no it won't happen = before a while >>>>>>>>>>> because we have way too much work on the todo and this item = is stored at the >>>>>>>>>>> very end of this todo. >>>>>>>>>>>=20 >>>>>>>>>>> regards, >>>>>>>>>>> Bapt >>>>>>>>>> I'm happy to do the work, and have volunteered now many = times. If uname >>>>>>>>>> -p does not describe the ABI fully, then uname -p needs = changes on the >>>>>>>>>> relevant platforms. Which are they? What extra flexibility = does the >>>>>>>>>> string give you if uname -p describes the ABI completely? >>>>>>>>>> -Nathan >>>>>>>>> just simple examples in armv6: >>>>>>>>> - eabi vs oabi >>>>>>>>> - The different float abi (even if only one is supported for = now others are >>>>>>>>> being worked on) >>>>>>>>> - little endian vs big endian >>>>>>>> All of those are encoded in the MACHINE_ARCH + freebsd version, = no exceptions >>>>>>>> on supported architectures that are tier 2 or higher. This = seems like a weak reason. >>>>>>>>=20 >>>>>>>>> the extras flexibilit is being able to say this binary do = support freebsd i386 >>>>>>>>> and amd64 in one key, freebsd:9:x86:*, or or all arches = freebsd:10:* >>>>>>>> Will there be a program to convert this new, special invention = to the standard >>>>>>>> that we=A2ve used for the past 20 years? If you need the = flexibility, which I=A2m not >>>>>>>> entirely sure I=A2ve seen a good use case for. When would you = have a x86 binary >>>>>>>> package? Wouldn=A2t it be either i386 or amd64? >>>>>>> ABI isn't just about the instruction set. It's also about the = sizes of C >>>>>>> types (like pointers). If I remember correctly, the pkg scheme = was chosen >>>>>>> to allow for ABIs like x32 which use the 64 bit instruction set = with 32 >>>>>>> bit pointers. MACHINE_ARCH would also be amd64 in this case. >>>>>> No, it wouldn't. MACHINE_ARCH would be something else (x32, = probably) in >>>>>> such cases. MACHINE_ARCH (and uname -p, which reports it) is the = FreeBSD >>>>>> ABI identifier and encodes 100% of the ABI information. This = would be >>>>>> true even if there is never an x32 kernel. >>>>> No, there's no such thing as an x32 kernel. It's an amd64 kernel = that >>>>> supports a second userland ABI. In C preprocessor terms they are >>>>> distinguished by (__amd64__ && _LP64) and (__amd64__ && !_LP64). >>>>> uname -p gives you the processor architecture (the __amd64__ bit) = but >>>>> then you can still choose the sizes of standard C types (the _LP64 = bit). >>>>> So far we've always had one ABI per processor architecture but = this >>>>> is not strictly necessary. >>>>=20 >>>> All you have to do is look at the plethora of ARM ABIs we support = (and >>>> the corresponding separate kernel for each) to see the falseness of = that >>>> last sentence. ARM variations include v4 vs v6, OABI vs EABI = (calling >>>> and register usage standards), hard vs soft float, little vs big = endian. >>>> Virtually all combinations of those are possible (there are a few = combos >>>> we don't support), and each one has its own MACHINE_ARCH. >>>=20 >>> Exactly. This doesn't rely on the kernel either. The hw.machine_arch=20= >>> sysctl (what uname -p returns) gives the ABI of the calling binary=20= >>> rather than the kernel. So if you use a 32-bit uname (e.g. in a = chroot)=20 >>> on an amd64 host, you get i386. The same will be true if and when we=20= >>> support a 32-bit amd64 userland -- even if there is no x32 kernel, = an=20 >>> x32 uname will return "x32" (or "amd32" or whatever it ends up being=20= >>> called). That string will also appear in kern.supported_archs. >>=20 >> There isn't necessarily any chroot environment. There's one kernel, >> two equally valid ABIs (ILP32 and LP64) and any binary like uname = might >> use either of them. If uname -p returns a different result depending = on >> which of these two ABIs it was compiled for that could be a problem = for >> any script that uses it. >=20 > Well, it depends on what you want to do with the script, eh? If you = want to know the ABI of the native binary uname, that=A2s one thing. But = if you want to know the supported ABIs, you are doing it wrong by using = uname. You should be using sysctl kern.supported_abi. That will tell you = all the ABIs that you can install packages for on this machine, which is = what you really want to know. So I=A2m having trouble connecting the = dots between this and what you are saying here. >=20 > I still am absolutely flabbergasted why the MACHINE_ARCH names aren=A2t = necessary and sufficient for packaging. I=A2ve yet to see any coherent = reason to not use them. Why do I care that they match? Good question. When I was doing FreeNAS, = I looked at integrating pkgng into nanobsd. At the time this was quite = difficult because every single architecture name was different between = pkgng and MACHINE_ARCH. This would mean I=A2d have to drag around a = huge table to know how to translate one to the other (there was no = simple regex either, and things like mipsn32 wouldn=A2t have fit into = the scheme at the time). I would very much like us to see us keep these = names in sync and avoid large translation tables that are difficult to = maintain. Now, do you need to get it from uname -p? No. If you want to parse elf = files to get it, that=A2s fine, so long as the names map directly to the = MACHINE_ARCH names that we=A2ve been using for years. They completely = describe the universe of supported platforms. Are they perfect? No, = around the edge there may be an odd-ball that=A2s possible to build, but = is unsupported and likely doesn=A2t work at all. Have we learned from = these mistakes? Yes. Anything that=A2s actively supported has a proper = name. This name is needed, btw, so that any machine can self-host, a = nice feature of the /usr/src system. Warner --Apple-Mail=_D96245BB-20CC-4BA9-B917-447FFECDDD08 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTgUCiAAoJEGwc0Sh9sBEA7EAQAOJpSr5bhzRhSXaeSx4tKVxw r5y8nq/QGaHCnHQy9G8y9ocFV2u5EPmanyjXnSL/4ALpy+q27L96lY62fhMr/Fst vlvRT7qsbc3XTyCXQnSHyENnrS4ksZvf8Rmei0feLMUUdkk6tjb9Ps3w1wfeQyrf 8oZnQmJUxJnQ+rlNTTvBfGgR2sjSER9wCsQzNonFIgnTQoLuIcnlD5WKiljzacbl JUE1Tbp1xgHVwHKEpV93M166pY/U3D4a1d9FOu7Ba/XlkGgkjhF7Z3C0PJKaU1bE N16dTegu3/k4jfS2fuUqoclZ4B0OTAahwZONhk8uMfSamZLzFhxe4wvWnBhaQo/q Coas142KZsVV1TJqINalcM6FH1i6Dfb2q4d+9NnVl/Ft+8G1t9+UTXDjoXPGajtr OEzfYNr+Og4ln3CM6HF6hspQJCh+W35cLX5ON5XFLlGTpUylxZ3yrByxaecOA/6v STcBFTsTk3bhfCvU8uKzEz+4sgIP8SpdFuG5U5vtGQuilihkfcb3unpxMdRZAxka sLCJ4z1FWNvpTUU7+iW6OWV6S3ZKbEjZ1v//en6C8209BEc1Eez8hgIZRMnqnMl+ zHC26KmKo+vhYMkJInZMq9dV4iE2itls1pPqhJ6/VmYjA5HCj+HXH34s/GqO3Rue CnYZlGyLll9n95puzc9L =Yv0I -----END PGP SIGNATURE----- --Apple-Mail=_D96245BB-20CC-4BA9-B917-447FFECDDD08-- From owner-svn-src-head@FreeBSD.ORG Sun May 25 02:05:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8E39DD7; Sun, 25 May 2014 02:05:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D698E2142; Sun, 25 May 2014 02:05:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4P25N0l043232; Sun, 25 May 2014 02:05:23 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4P25Npa043231; Sun, 25 May 2014 02:05:23 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405250205.s4P25Npa043231@svn.freebsd.org> From: Neel Natu Date: Sun, 25 May 2014 02:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266642 - head/sys/amd64/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 02:05:24 -0000 Author: neel Date: Sun May 25 02:05:23 2014 New Revision: 266642 URL: http://svnweb.freebsd.org/changeset/base/266642 Log: Remove restriction on insb/insw/insl emulation. These instructions are properly emulated. Modified: head/sys/amd64/vmm/vmm_ioport.c Modified: head/sys/amd64/vmm/vmm_ioport.c ============================================================================== --- head/sys/amd64/vmm/vmm_ioport.c Sun May 25 00:57:24 2014 (r266641) +++ head/sys/amd64/vmm/vmm_ioport.c Sun May 25 02:05:23 2014 (r266642) @@ -173,14 +173,6 @@ emulate_inout_str(struct vm *vm, int vcp return (EINVAL); } - /* - * XXX insb/insw/insd instructions not emulated at this time. - */ - if (in) { - VCPU_CTR0(vm, vcpuid, "ins emulation not implemented"); - return (EINVAL); - } - *retu = true; return (0); /* Return to userspace to finish emulation */ } From owner-svn-src-head@FreeBSD.ORG Sun May 25 02:45:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81185300; Sun, 25 May 2014 02:45:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E76723C5; Sun, 25 May 2014 02:45:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4P2jRED060909; Sun, 25 May 2014 02:45:27 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4P2jRAJ060908; Sun, 25 May 2014 02:45:27 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201405250245.s4P2jRAJ060908@svn.freebsd.org> From: Benjamin Kaduk Date: Sun, 25 May 2014 02:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266643 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 02:45:27 -0000 Author: bjk (doc committer) Date: Sun May 25 02:45:26 2014 New Revision: 266643 URL: http://svnweb.freebsd.org/changeset/base/266643 Log: Document taskqueue_start_threads_pinned Requested by: adrian Reviewed by: adrian Approved by: hrs (mentor) X-MFC-with: r266629 Modified: head/share/man/man9/taskqueue.9 Modified: head/share/man/man9/taskqueue.9 ============================================================================== --- head/share/man/man9/taskqueue.9 Sun May 25 02:05:23 2014 (r266642) +++ head/share/man/man9/taskqueue.9 Sun May 25 02:45:26 2014 (r266643) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 24, 2014 +.Dd May 24, 2014 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -68,6 +68,11 @@ struct timeout_task; .Fn taskqueue_create_fast "const char *name" "int mflags" "taskqueue_enqueue_fn enqueue" "void *context" .Ft int .Fn taskqueue_start_threads "struct taskqueue **tqp" "int count" "int pri" "const char *name" "..." +.Ft int +.Fo taskqueue_start_threads_pinned +.Fa "struct taskqueue **tqp" "int count" "int pri" "int cpu_id" +.Fa "const char *name" "..." +.Fc .Ft void .Fn taskqueue_set_callback "struct taskqueue *queue" "enum taskqueue_callback_type cb_type" "taskqueue_callback_fn callback" "void *context" .Ft void @@ -145,7 +150,14 @@ Any tasks that are on the queue will be which the thread servicing the queue will be signaled that it should exit. .Pp Once a taskqueue has been created, its threads should be started using -.Fn taskqueue_start_threads . +.Fn taskqueue_start_threads +or +.Fn taskqueue_start_threads_pinned . +.Fn taskqueue_start_threads_pinned +takes a +.Va cpu_id +argument which will cause the threads which are started for the taskqueue +to be pinned to run on the given CPU. Callbacks may optionally be registered using .Fn taskqueue_set_callback . Currently, callbacks may be registered for the following purposes: From owner-svn-src-head@FreeBSD.ORG Sun May 25 06:42:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46BE2F1F; Sun, 25 May 2014 06:42:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19ACC23A7; Sun, 25 May 2014 06:42:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4P6ghLu069340; Sun, 25 May 2014 06:42:43 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4P6ghOp069339; Sun, 25 May 2014 06:42:43 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405250642.s4P6ghOp069339@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 25 May 2014 06:42:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266644 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 06:42:44 -0000 Author: hselasky Date: Sun May 25 06:42:43 2014 New Revision: 266644 URL: http://svnweb.freebsd.org/changeset/base/266644 Log: Make SAF1761 driver endian safe. Sponsored by: DARPA, AFRL Modified: head/sys/dev/usb/controller/saf1761_otg.h Modified: head/sys/dev/usb/controller/saf1761_otg.h ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.h Sun May 25 02:45:26 2014 (r266643) +++ head/sys/dev/usb/controller/saf1761_otg.h Sun May 25 06:42:43 2014 (r266644) @@ -40,19 +40,27 @@ #define SOTG_DEVICE_PORT_NUM 2 #define SOTG_HOST_CHANNEL_MAX (3 * 32) -#define SAF1761_READ_1(sc, reg) \ - bus_space_read_1((sc)->sc_io_tag, (sc)->sc_io_hdl, reg) -#define SAF1761_READ_2(sc, reg) \ - bus_space_read_2((sc)->sc_io_tag, (sc)->sc_io_hdl, reg) -#define SAF1761_READ_4(sc, reg) \ - bus_space_read_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg) +/* Macros used for reading and writing registers */ + +#define SAF1761_READ_1(sc, reg) \ + bus_space_read_1((sc)->sc_io_tag, (sc)->sc_io_hdl, (reg)) +#define SAF1761_READ_2(sc, reg) ({ uint16_t _temp; \ + _temp = bus_space_read_2((sc)->sc_io_tag, (sc)->sc_io_hdl, (reg)); \ + le16toh(_temp); }) +#define SAF1761_READ_4(sc, reg) ({ uint32_t _temp; \ + _temp = bus_space_read_4((sc)->sc_io_tag, (sc)->sc_io_hdl, (reg)); \ + le32toh(_temp); }) #define SAF1761_WRITE_1(sc, reg, data) \ - bus_space_write_1((sc)->sc_io_tag, (sc)->sc_io_hdl, reg, data) -#define SAF1761_WRITE_2(sc, reg, data) \ - bus_space_write_2((sc)->sc_io_tag, (sc)->sc_io_hdl, reg, data) -#define SAF1761_WRITE_4(sc, reg, data) \ - bus_space_write_4((sc)->sc_io_tag, (sc)->sc_io_hdl, reg, data) + bus_space_write_1((sc)->sc_io_tag, (sc)->sc_io_hdl, (reg), data) +#define SAF1761_WRITE_2(sc, reg, data) do { \ + uint16_t _temp = (data); \ + bus_space_write_2((sc)->sc_io_tag, (sc)->sc_io_hdl, (reg), htole16(_temp)); \ +} while (0) +#define SAF1761_WRITE_4(sc, reg, data) do { \ + uint32_t _temp = (data); \ + bus_space_write_4((sc)->sc_io_tag, (sc)->sc_io_hdl, (reg), htole32(_temp)); \ +} while (0) struct saf1761_otg_softc; struct saf1761_otg_td; From owner-svn-src-head@FreeBSD.ORG Sun May 25 07:41:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E28F6F72; Sun, 25 May 2014 07:41:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF5D5275A; Sun, 25 May 2014 07:41:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4P7fC0q095926; Sun, 25 May 2014 07:41:12 GMT (envelope-from allanjude@svn.freebsd.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4P7fCvh095925; Sun, 25 May 2014 07:41:12 GMT (envelope-from allanjude@svn.freebsd.org) Message-Id: <201405250741.s4P7fCvh095925@svn.freebsd.org> From: Allan Jude Date: Sun, 25 May 2014 07:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266645 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 07:41:13 -0000 Author: allanjude (doc committer) Date: Sun May 25 07:41:12 2014 New Revision: 266645 URL: http://svnweb.freebsd.org/changeset/base/266645 Log: Document the new -R flag of netstat(1) introduced in r266448 that tracks the flowid for each socket. Reviewed by: adrian Approved by: eadler (mentor) Modified: head/usr.bin/netstat/netstat.1 Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Sun May 25 06:42:43 2014 (r266644) +++ head/usr.bin/netstat/netstat.1 Sun May 25 07:41:12 2014 (r266645) @@ -45,7 +45,7 @@ depending on the options for the informa .It Xo .Bk -words .Nm -.Op Fl 46AaLnSTWx +.Op Fl 46AaLnSTWxR .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system @@ -84,6 +84,9 @@ but show ports symbolically. If .Fl x is present, display socket buffer and tcp timer statistics for each internet socket. +If +.Fl R +is present, display the flowid and flowtype for each internet socket. When .Fl T is present, display information from the TCP control block, including @@ -367,6 +370,11 @@ and display them symbolically. .It Fl W In certain displays, avoid truncating addresses even if this causes some fields to overflow. +.It Fl R +Display the flowid and flowtype for each socket. +flowid is a 32 bit hardware specific identifier for each flow. +flowtype defines which protocol fields are hashed to produce the id. +A complete listing is available in sys/mbuf.h under M_HASHTYPE_* .El .Pp The default display, for active sockets, shows the local From owner-svn-src-head@FreeBSD.ORG Sun May 25 08:09:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 632A9532; Sun, 25 May 2014 08:09:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FDCB294A; Sun, 25 May 2014 08:09:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4P89uK4007784; Sun, 25 May 2014 08:09:56 GMT (envelope-from allanjude@svn.freebsd.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4P89uIO007783; Sun, 25 May 2014 08:09:56 GMT (envelope-from allanjude@svn.freebsd.org) Message-Id: <201405250809.s4P89uIO007783@svn.freebsd.org> From: Allan Jude Date: Sun, 25 May 2014 08:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266646 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 08:09:56 -0000 Author: allanjude (doc committer) Date: Sun May 25 08:09:55 2014 New Revision: 266646 URL: http://svnweb.freebsd.org/changeset/base/266646 Log: Add path markup on sys/mbuf.h to previous netstat(1) man page update Submitted by: brueffer Reviewed by: eadler (mentor) Modified: head/usr.bin/netstat/netstat.1 Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Sun May 25 07:41:12 2014 (r266645) +++ head/usr.bin/netstat/netstat.1 Sun May 25 08:09:55 2014 (r266646) @@ -374,7 +374,9 @@ some fields to overflow. Display the flowid and flowtype for each socket. flowid is a 32 bit hardware specific identifier for each flow. flowtype defines which protocol fields are hashed to produce the id. -A complete listing is available in sys/mbuf.h under M_HASHTYPE_* +A complete listing is available in +.Pa sys/mbuf.h +under M_HASHTYPE_* .El .Pp The default display, for active sockets, shows the local From owner-svn-src-head@FreeBSD.ORG Sun May 25 10:17:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DFBF2B8; Sun, 25 May 2014 10:17:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AE33226B; Sun, 25 May 2014 10:17:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4PAHR5Y066632; Sun, 25 May 2014 10:17:27 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4PAHRra066630; Sun, 25 May 2014 10:17:27 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201405251017.s4PAHRra066630@svn.freebsd.org> From: Andrew Turner Date: Sun, 25 May 2014 10:17:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266647 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 10:17:27 -0000 Author: andrew Date: Sun May 25 10:17:26 2014 New Revision: 266647 URL: http://svnweb.freebsd.org/changeset/base/266647 Log: Reduce the diff between the PandaBoard and BeableBone kernel configs to help with the creation of a more generic Ti kernel config. Modified: head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/PANDABOARD Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Sun May 25 08:09:55 2014 (r266646) +++ head/sys/arm/conf/BEAGLEBONE Sun May 25 10:17:26 2014 (r266647) @@ -54,7 +54,7 @@ options PLATFORM options FREEBSD_BOOT_LOADER options VFP # vfp/neon -# Debugging +# Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options BREAK_TO_DEBUGGER #options VERBOSE_SYSINIT # Enable verbose sysinit messages @@ -79,12 +79,17 @@ options NFSLOCKD #options BOOTP_NFSV3 #options BOOTP_WIRED_TO=cpsw0 - -# MMC/SD/SDIO card slot support +# MMC/SD/SDIO Card slot support device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards device sdhci # mmc/sd host controller +# I2C support +device iicbus +device iic +device ti_i2c +device am335x_pmic # AM335x Power Management IC (TPC65217) + # Boot device is 2nd slice on MMC/SD card options ROOTDEVNAME=\"ufs:mmcsd0s2\" @@ -96,12 +101,6 @@ device snp device md device random # Entropy device -# I2C support -device iicbus -device iic -device ti_i2c -device am335x_pmic # AM335x Power Management IC (TPC65217) - # GPIO device gpio device gpioled @@ -111,7 +110,7 @@ device ti_adc # USB support device usb -options USB_HOST_ALIGN=64 # Cacheline size is 64 on AM335x. +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. options USB_DEBUG #options USB_REQ_DEBUG #options USB_VERBOSE @@ -128,7 +127,7 @@ device smscphy device cpsw device bpf -# USB ethernet support, requires miibus +# USB Ethernet support, requires miibus device miibus device axe # ASIX Electronics USB Ethernet Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Sun May 25 08:09:55 2014 (r266646) +++ head/sys/arm/conf/PANDABOARD Sun May 25 10:17:26 2014 (r266647) @@ -12,31 +12,27 @@ # latest information. # # An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # # $FreeBSD$ ident PANDABOARD - - # This probably wants to move somewhere else. Maybe we can create a basic # OMAP4340 config, then make a PANDABOARD config that includes the basic one, # adds the start addresses and custom devices plus pulls in this hints file. -hints "PANDABOARD.hints" +hints "PANDABOARD.hints" -include "../ti/omap4/pandaboard/std.pandaboard" +include "../ti/omap4/pandaboard/std.pandaboard" #To statically compile in device wiring instead of /boot/device.hints makeoptions MODULES_OVERRIDE="" makeoptions WITHOUT_MODULES="ahc" -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options HZ=100 - options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols @@ -44,16 +40,6 @@ options FFS # Berkeley Fast Filesyste options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories -device snp -options BREAK_TO_DEBUGGER - -options NFSCL -options NFS_ROOT # NFS usable as /, requires NFSCLIENT -#options BOOTP_NFSROOT -#options BOOTP_COMPAT -#options BOOTP -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=ue0 options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme options TMPFS # Efficient memory filesystem @@ -69,10 +55,34 @@ options SYSVMSG # SYSV-style message options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options FREEBSD_BOOT_LOADER - options PREEMPTION options PLATFORM +options FREEBSD_BOOT_LOADER +options VFP # vfp/neon +options SMP # Enable multiple cores + +# Debugging for use in -current +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +options BREAK_TO_DEBUGGER +#options VERBOSE_SYSINIT # Enable verbose sysinit messages +options KDB +options DDB # Enable the kernel debugger +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options DIAGNOSTIC + +# NFS support +options NFSCL + +# NFS root +options NFS_ROOT # NFS usable as /, requires NFSCLIENT +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ue0 # MMC/SD/SDIO Card slot support device mmc # mmc/sd bus @@ -84,41 +94,28 @@ device iicbus device iic device ti_i2c -device loop -device ether -device mii -device smc -device smcphy +# Console and misc device uart device uart_ns8250 - -device gpio - device pty - +device snp +device md +device random # Entropy device device pl310 # PL310 L2 cache controller -# Debugging for use in -current -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB -options DDB # Enable the kernel debugger -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC -device md +# GPIO +device gpio # The following enables MFS as root, this seems similar to an initramfs or initrd # as used in Linux. #options MD_ROOT #options MD_ROOT_SIZE=7560 -device random # Entropy device + # USB support -options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. options USB_DEBUG #options USB_REQ_DEBUG #options USB_VERBOSE @@ -128,12 +125,19 @@ device umass device scbus # SCSI bus (required for SCSI) device da # Direct Access (disks) +# Ethernet +device loop +device ether +device mii +device smc +device smcphy +device bpf # USB Ethernet support, requires miibus device miibus #device axe # ASIX Electronics USB Ethernet device smsc # SMSC LAN95xx USB Ethernet -device bpf + # OMAP-specific devices device ti_sdma @@ -145,6 +149,3 @@ device twl_clks options FDT options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=pandaboard.dts - -options VFP # vfp/neon -options SMP # Enable multiple cores From owner-svn-src-head@FreeBSD.ORG Sun May 25 10:49:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14A6E9BC; Sun, 25 May 2014 10:49:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E99612489; Sun, 25 May 2014 10:49:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4PAn7mO079925; Sun, 25 May 2014 10:49:07 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4PAn7jd079920; Sun, 25 May 2014 10:49:07 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201405251049.s4PAn7jd079920@svn.freebsd.org> From: Andrew Turner Date: Sun, 25 May 2014 10:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266648 - in head/sys/arm/ti: . am335x omap4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 10:49:08 -0000 Author: andrew Date: Sun May 25 10:49:07 2014 New Revision: 266648 URL: http://svnweb.freebsd.org/changeset/base/266648 Log: Allow the OMAP4 and AM335x prcm drivers to be compiled in the same kernel by renaming the structures used. Modified: head/sys/arm/ti/am335x/am335x_prcm.c head/sys/arm/ti/omap4/omap4_prcm_clks.c head/sys/arm/ti/ti_prcm.c Modified: head/sys/arm/ti/am335x/am335x_prcm.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_prcm.c Sun May 25 10:17:26 2014 (r266647) +++ head/sys/arm/ti/am335x/am335x_prcm.c Sun May 25 10:49:07 2014 (r266648) @@ -190,7 +190,7 @@ static int am335x_clk_pruss_activate(str .clk_get_source_freq = am335x_clk_hsmmc_get_source_freq \ } -struct ti_clock_dev ti_clk_devmap[] = { +struct ti_clock_dev ti_am335x_clk_devmap[] = { /* System clocks */ { .id = SYS_CLK, .clk_activate = NULL, Modified: head/sys/arm/ti/omap4/omap4_prcm_clks.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_prcm_clks.c Sun May 25 10:17:26 2014 (r266647) +++ head/sys/arm/ti/omap4/omap4_prcm_clks.c Sun May 25 10:49:07 2014 (r266648) @@ -256,7 +256,7 @@ static int omap4_clk_get_arm_fclk_freq(s } -struct ti_clock_dev ti_clk_devmap[] = { +struct ti_clock_dev ti_omap4_clk_devmap[] = { /* System clocks */ { .id = SYS_CLK, Modified: head/sys/arm/ti/ti_prcm.c ============================================================================== --- head/sys/arm/ti/ti_prcm.c Sun May 25 10:17:26 2014 (r266647) +++ head/sys/arm/ti/ti_prcm.c Sun May 25 10:49:07 2014 (r266648) @@ -57,16 +57,18 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include /** - * ti_clk_devmap - Array of clock devices, should be defined one per SoC + * ti_*_clk_devmap - Array of clock devices, should be defined one per SoC * * This array is typically defined in one of the targeted *_prcm_clk.c * files and is specific to the given SoC platform. Each entry in the array * corresponds to an individual clock device. */ -extern struct ti_clock_dev ti_clk_devmap[]; +extern struct ti_clock_dev ti_omap4_clk_devmap[]; +extern struct ti_clock_dev ti_am335x_clk_devmap[]; /** * ti_prcm_clk_dev - returns a pointer to the clock device with given id @@ -90,7 +92,21 @@ ti_prcm_clk_dev(clk_ident_t clk) * loop for this, but this function should only called when a driver is * being activated so IMHO not a big issue. */ - clk_dev = &(ti_clk_devmap[0]); + clk_dev = NULL; + switch(ti_chip()) { +#ifdef SOC_OMAP4 + case CHIP_OMAP_4: + clk_dev = &(ti_omap4_clk_devmap[0]); + break; +#endif +#ifdef SOC_TI_AM335X + case CHIP_AM335X: + clk_dev = &(ti_am335x_clk_devmap[0]); + break; +#endif + } + if (clk_dev == NULL) + panic("No clock devmap found"); while (clk_dev->id != INVALID_CLK_IDENT) { if (clk_dev->id == clk) { return (clk_dev); From owner-svn-src-head@FreeBSD.ORG Sun May 25 10:56:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5821BF8; Sun, 25 May 2014 10:56:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92BA82532; Sun, 25 May 2014 10:56:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4PAukw4083919; Sun, 25 May 2014 10:56:46 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4PAukZi083917; Sun, 25 May 2014 10:56:46 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201405251056.s4PAukZi083917@svn.freebsd.org> From: Andrew Turner Date: Sun, 25 May 2014 10:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266649 - in head/sys/arm/ti: am335x omap4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 10:56:46 -0000 Author: andrew Date: Sun May 25 10:56:45 2014 New Revision: 266649 URL: http://svnweb.freebsd.org/changeset/base/266649 Log: Make ti_padconf_devmap static in both places it is defined. Modified: head/sys/arm/ti/am335x/am335x_scm_padconf.c head/sys/arm/ti/omap4/omap4_scm_padconf.c Modified: head/sys/arm/ti/am335x/am335x_scm_padconf.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_scm_padconf.c Sun May 25 10:49:07 2014 (r266648) +++ head/sys/arm/ti/am335x/am335x_scm_padconf.c Sun May 25 10:56:45 2014 (r266649) @@ -84,7 +84,7 @@ const struct ti_scm_padstate ti_padstate { .state = NULL } }; -const struct ti_scm_padconf ti_padconf_devmap[] = { +const static struct ti_scm_padconf ti_padconf_devmap[] = { _PIN(0x800, "GPMC_AD0", 32, 7,"gpmc_ad0", "mmc1_dat0", NULL, NULL, NULL, NULL, NULL, "gpio1_0"), _PIN(0x804, "GPMC_AD1", 33, 7,"gpmc_ad1", "mmc1_dat1", NULL, NULL, NULL, NULL, NULL, "gpio1_1"), _PIN(0x808, "GPMC_AD2", 34, 7,"gpmc_ad2", "mmc1_dat2", NULL, NULL, NULL, NULL, NULL, "gpio1_2"), Modified: head/sys/arm/ti/omap4/omap4_scm_padconf.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_scm_padconf.c Sun May 25 10:49:07 2014 (r266648) +++ head/sys/arm/ti/omap4/omap4_scm_padconf.c Sun May 25 10:56:45 2014 (r266649) @@ -142,7 +142,7 @@ const struct ti_scm_padstate ti_padstate /* * Table 18-10, p. 3470 */ -const struct ti_scm_padconf ti_padconf_devmap[] = { +const static struct ti_scm_padconf ti_padconf_devmap[] = { _PINDEF(0x0040, "c12", 0, 0, "gpmc_ad0", "sdmmc2_dat0", NULL, NULL, NULL, NULL, NULL, NULL), _PINDEF(0x0042, "d12", 0, 0, "gpmc_ad1", "sdmmc2_dat1", NULL, NULL, NULL, NULL, NULL, NULL), _PINDEF(0x0044, "c13", 0, 0, "gpmc_ad2", "sdmmc2_dat2", NULL, NULL, NULL, NULL, NULL, NULL), From owner-svn-src-head@FreeBSD.ORG Sun May 25 12:01:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E459D460; Sun, 25 May 2014 12:01:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C50B6293E; Sun, 25 May 2014 12:01:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4PC1Fki011541; Sun, 25 May 2014 12:01:15 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4PC1DWX011526; Sun, 25 May 2014 12:01:13 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201405251201.s4PC1DWX011526@svn.freebsd.org> From: Julio Merino Date: Sun, 25 May 2014 12:01:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266650 - in head: contrib/atf contrib/atf/atf-c contrib/atf/atf-c++ contrib/atf/atf-sh etc/mtree lib/atf/libatf-c lib/atf/libatf-c++ lib/atf/libatf-c++/tests lib/atf/libatf-c/tests lib... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 12:01:16 -0000 Author: jmmv Date: Sun May 25 12:01:13 2014 New Revision: 266650 URL: http://svnweb.freebsd.org/changeset/base/266650 Log: Change libatf-c and libatf-c++ to be private libraries. We should not be leaking these interfaces to the outside world given that it's much easier for third-party components to use the devel/atf package from ports. As a side-effect, we can also drop the ATF pkgconfig and aclocal files from the base system. Nothing in the base system needs these, and it was quite ugly to have to get them installed only so that a few ports could build. The offending ports have been fixed to depend on devel/atf explicitly. Reviewed by: bapt Deleted: head/contrib/atf/atf-c++/atf-c++.m4 head/contrib/atf/atf-c++/atf-c++.pc.in head/contrib/atf/atf-c/atf-c.m4 head/contrib/atf/atf-c/atf-c.pc.in head/contrib/atf/atf-c/atf-common.m4 head/contrib/atf/atf-sh/atf-sh.m4 head/contrib/atf/atf-sh/atf-sh.pc.in Modified: head/contrib/atf/FREEBSD-Xlist head/etc/mtree/BSD.tests.dist head/lib/atf/libatf-c++/Makefile head/lib/atf/libatf-c++/tests/Makefile head/lib/atf/libatf-c/Makefile head/lib/atf/libatf-c/tests/Makefile head/libexec/atf/atf-check/Makefile head/share/mk/atf.test.mk head/share/mk/bsd.libnames.mk head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/atf/atf-sh/Makefile Modified: head/contrib/atf/FREEBSD-Xlist ============================================================================== --- head/contrib/atf/FREEBSD-Xlist Sun May 25 10:56:45 2014 (r266649) +++ head/contrib/atf/FREEBSD-Xlist Sun May 25 12:01:13 2014 (r266650) @@ -2,6 +2,8 @@ */*/Makefile* */Atffile */Makefile* +*/*.m4 +*/*.pc.in Atffile INSTALL Makefile* Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Sun May 25 10:56:45 2014 (r266649) +++ head/etc/mtree/BSD.tests.dist Sun May 25 12:01:13 2014 (r266650) @@ -12,8 +12,6 @@ .. .. share - aclocal - .. atf .. doc Modified: head/lib/atf/libatf-c++/Makefile ============================================================================== --- head/lib/atf/libatf-c++/Makefile Sun May 25 10:56:45 2014 (r266649) +++ head/lib/atf/libatf-c++/Makefile Sun May 25 12:01:13 2014 (r266650) @@ -29,6 +29,7 @@ .include LIB= atf-c++ +PRIVATELIB= true SHLIB_MAJOR= 2 # libatf-c++ depends on the C version of the ATF library to build. @@ -73,20 +74,6 @@ INCSDIR_atf-c++.hpp= ${INCLUDEDIR} MAN= atf-c++-api.3 -all: atf-c++.pc -atf-c++.pc: atf-c++.pc.in atf-version - sed -e 's,__CXX__,${CXX},g' \ - -e 's,__INCLUDEDIR__,${INCLUDEDIR},g' \ - -e 's,__LIBDIR__,${LIBDIR},g' \ - -e "s,__ATF_VERSION__,$$(cat atf-version),g" \ - <${ATF}/atf-c++/atf-c++.pc.in >atf-c++.pc - -beforeinstall: - ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - atf-c++.pc ${DESTDIR}${LIBDATADIR}/pkgconfig - ${INSTALL} -C -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \ - ${ATF}/atf-c++/atf-c++.m4 ${DESTDIR}${SHAREDIR}/aclocal - .if ${MK_TESTS} != "no" SUBDIR= tests .endif Modified: head/lib/atf/libatf-c++/tests/Makefile ============================================================================== --- head/lib/atf/libatf-c++/tests/Makefile Sun May 25 10:56:45 2014 (r266649) +++ head/lib/atf/libatf-c++/tests/Makefile Sun May 25 12:01:13 2014 (r266650) @@ -26,6 +26,4 @@ ATF_TESTS_CXX+= ${_T} SRCS.${_T}= ${_T}.cpp test_helpers.cpp .endfor -ATF_TESTS_SH= pkg_config_test - .include Modified: head/lib/atf/libatf-c/Makefile ============================================================================== --- head/lib/atf/libatf-c/Makefile Sun May 25 10:56:45 2014 (r266649) +++ head/lib/atf/libatf-c/Makefile Sun May 25 12:01:13 2014 (r266650) @@ -29,6 +29,7 @@ .include LIB= atf-c +PRIVATELIB= true SHLIB_MAJOR= 1 ATF= ${.CURDIR:H:H:H}/contrib/atf @@ -75,22 +76,6 @@ INCSDIR_atf-c.h= ${INCLUDEDIR} MAN= atf-c-api.3 -all: atf-c.pc -atf-c.pc: atf-c.pc.in atf-version - sed -e 's,__CC__,${CC},g' \ - -e 's,__INCLUDEDIR__,${INCLUDEDIR},g' \ - -e 's,__LIBDIR__,${LIBDIR},g' \ - -e "s,__ATF_VERSION__,$$(cat atf-version),g" \ - <${ATF}/atf-c/atf-c.pc.in >atf-c.pc - -beforeinstall: - ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - atf-c.pc ${DESTDIR}${LIBDATADIR}/pkgconfig - ${INSTALL} -C -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \ - ${ATF}/atf-c/atf-common.m4 ${DESTDIR}${SHAREDIR}/aclocal - ${INSTALL} -C -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \ - ${ATF}/atf-c/atf-c.m4 ${DESTDIR}${SHAREDIR}/aclocal - .if ${MK_TESTS} != "no" SUBDIR= tests .endif Modified: head/lib/atf/libatf-c/tests/Makefile ============================================================================== --- head/lib/atf/libatf-c/tests/Makefile Sun May 25 10:56:45 2014 (r266649) +++ head/lib/atf/libatf-c/tests/Makefile Sun May 25 12:01:13 2014 (r266650) @@ -33,6 +33,4 @@ ATF_TESTS_C+= ${_T} SRCS.${_T}= ${_T}.c test_helpers.c .endfor -ATF_TESTS_SH= pkg_config_test - .include Modified: head/libexec/atf/atf-check/Makefile ============================================================================== --- head/libexec/atf/atf-check/Makefile Sun May 25 10:56:45 2014 (r266649) +++ head/libexec/atf/atf-check/Makefile Sun May 25 12:01:13 2014 (r266650) @@ -38,11 +38,11 @@ MAN= atf-check.1 CFLAGS+= -I${ATF} -DPADD+= ${LIBATF_CXX} ${LIBATF_C} - LDFLAGS+= -L${.OBJDIR}/../../../lib/atf/libatf-c++ LDFLAGS+= -L${.OBJDIR}/../../../lib/atf/libatf-c +DPADD+= ${LIBATF_CXX} ${LIBATF_C} LDADD+= -latf-c++ -latf-c +USEPRIVATELIB= atf-c++ atf-c .if ${MK_TESTS} != "no" SUBDIR+= tests Modified: head/share/mk/atf.test.mk ============================================================================== --- head/share/mk/atf.test.mk Sun May 25 10:56:45 2014 (r266649) +++ head/share/mk/atf.test.mk Sun May 25 12:01:13 2014 (r266650) @@ -72,6 +72,7 @@ MAN.${_T}?= # empty SRCS.${_T}?= ${_T}.c DPADD.${_T}+= ${LIBATF_C} LDADD.${_T}+= -latf-c +USEPRIVATELIB+= atf-c TEST_INTERFACE.${_T}= atf .endfor .endif @@ -85,6 +86,7 @@ MAN.${_T}?= # empty SRCS.${_T}?= ${_T}${CXX_SUFFIX:U.cc} DPADD.${_T}+= ${LIBATF_CXX} ${LIBATF_C} LDADD.${_T}+= -latf-c++ -latf-c +USEPRIVATELIB+= atf-c++ TEST_INTERFACE.${_T}= atf .endfor .endif Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Sun May 25 10:56:45 2014 (r266649) +++ head/share/mk/bsd.libnames.mk Sun May 25 12:01:13 2014 (r266650) @@ -13,8 +13,8 @@ LIBCRT0?= ${DESTDIR}${LIBDIR}/crt0.o LIBALIAS?= ${DESTDIR}${LIBDIR}/libalias.a LIBARCHIVE?= ${DESTDIR}${LIBDIR}/libarchive.a LIBASN1?= ${DESTDIR}${LIBDIR}/libasn1.a -LIBATF_C?= ${DESTDIR}${LIBDIR}/libatf-c.a -LIBATF_CXX?= ${DESTDIR}${LIBDIR}/libatf-c++.a +LIBATF_C?= ${DESTDIR}${LIBPRIVATEDIR}/libatf-c.a +LIBATF_CXX?= ${DESTDIR}${LIBPRIVATEDIR}/libatf-c++.a LIBATM?= ${DESTDIR}${LIBDIR}/libatm.a LIBAUDITD?= ${DESTDIR}${LIBDIR}/libauditd.a LIBAVL?= ${DESTDIR}${LIBDIR}/libavl.a Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 25 10:56:45 2014 (r266649) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 25 12:01:13 2014 (r266650) @@ -4103,7 +4103,34 @@ OLD_FILES+=usr/share/man/man8/telnetd.8. .endif .if ${MK_TESTS} == yes +OLD_LIBS+=usr/lib/libatf-c++.a +OLD_LIBS+=usr/lib/libatf-c++.so OLD_LIBS+=usr/lib/libatf-c++.so.1 +OLD_LIBS+=usr/lib/libatf-c++.so.2 +OLD_LIBS+=usr/lib/libatf-c++_p.a +OLD_LIBS+=usr/lib/libatf-c.a +OLD_LIBS+=usr/lib/libatf-c.so +OLD_LIBS+=usr/lib/libatf-c.so.1 +OLD_LIBS+=usr/lib/libatf-c_p.a +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" +OLD_LIBS+=usr/lib32/libatf-c++.a +OLD_LIBS+=usr/lib32/libatf-c++.so +OLD_LIBS+=usr/lib32/libatf-c++.so.1 +OLD_LIBS+=usr/lib32/libatf-c++.so.2 +OLD_LIBS+=usr/lib32/libatf-c++_p.a +OLD_LIBS+=usr/lib32/libatf-c.a +OLD_LIBS+=usr/lib32/libatf-c.so +OLD_LIBS+=usr/lib32/libatf-c.so.1 +OLD_LIBS+=usr/lib32/libatf-c_p.a +.endif +OLD_FILES+=usr/libdata/pkgconfig/atf-c++.pc +OLD_FILES+=usr/libdata/pkgconfig/atf-c.pc +OLD_FILES+=usr/libdata/pkgconfig/atf-sh.pc +OLD_FILES+=usr/share/aclocal/atf-c++.m4 +OLD_FILES+=usr/share/aclocal/atf-c.m4 +OLD_FILES+=usr/share/aclocal/atf-common.m4 +OLD_FILES+=usr/share/aclocal/atf-sh.m4 +OLD_DIRS+=usr/share/aclocal OLD_FILES+=usr/tests/lib/atf/libatf-c/test_helpers_test OLD_FILES+=usr/tests/lib/atf/test-programs/fork_test OLD_FILES+=usr/tests/lib/atf/libatf-c++/application_test @@ -4117,6 +4144,7 @@ OLD_FILES+=usr/tests/lib/atf/libatf-c++/ OLD_FILES+=usr/tests/lib/atf/libatf-c++/parser_test OLD_FILES+=usr/tests/lib/atf/libatf-c++/process_test OLD_FILES+=usr/tests/lib/atf/libatf-c++/sanity_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/pkg_config_test OLD_FILES+=usr/tests/lib/atf/libatf-c++/text_test OLD_FILES+=usr/tests/lib/atf/libatf-c++/ui_test OLD_FILES+=usr/tests/lib/atf/libatf-c/dynstr_test @@ -4124,6 +4152,7 @@ OLD_FILES+=usr/tests/lib/atf/libatf-c/en OLD_FILES+=usr/tests/lib/atf/libatf-c/fs_test OLD_FILES+=usr/tests/lib/atf/libatf-c/list_test OLD_FILES+=usr/tests/lib/atf/libatf-c/map_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/pkg_config_test OLD_FILES+=usr/tests/lib/atf/libatf-c/process_helpers OLD_FILES+=usr/tests/lib/atf/libatf-c/process_test OLD_FILES+=usr/tests/lib/atf/libatf-c/sanity_test Modified: head/usr.bin/atf/atf-sh/Makefile ============================================================================== --- head/usr.bin/atf/atf-sh/Makefile Sun May 25 10:56:45 2014 (r266649) +++ head/usr.bin/atf/atf-sh/Makefile Sun May 25 12:01:13 2014 (r266650) @@ -40,24 +40,13 @@ CFLAGS+= -I${ATF} DPADD+= ${LIBATF_C} ${LIBATF_CXX} LDADD+= -latf-c++ -latf-c +USEPRIVATELIB= atf-c++ atf-c FILESGROUPS= SUBR SUBRDIR= ${SHAREDIR}/atf SUBR= libatf-sh.subr -all: atf-sh.pc -atf-sh.pc: atf-sh.pc.in atf-version - sed -e 's,__EXEC_PREFIX__,/usr,g' \ - -e "s,__ATF_VERSION__,$$(cat atf-version),g" \ - <${ATF}/atf-sh/atf-sh.pc.in >atf-sh.pc - -beforeinstall: - ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - atf-sh.pc ${DESTDIR}${LIBDATADIR}/pkgconfig - ${INSTALL} -C -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \ - ${ATF}/atf-sh/atf-sh.m4 ${DESTDIR}${SHAREDIR}/aclocal - .if ${MK_TESTS} != "no" SUBDIR+= tests .endif From owner-svn-src-head@FreeBSD.ORG Sun May 25 14:01:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59766E84; Sun, 25 May 2014 14:01:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 472D22252; Sun, 25 May 2014 14:01:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4PE1Vch075913; Sun, 25 May 2014 14:01:31 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4PE1VN6075912; Sun, 25 May 2014 14:01:31 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201405251401.s4PE1VN6075912@svn.freebsd.org> From: Ian Lepore Date: Sun, 25 May 2014 14:01:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266651 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 14:01:31 -0000 Author: ian Date: Sun May 25 14:01:30 2014 New Revision: 266651 URL: http://svnweb.freebsd.org/changeset/base/266651 Log: Fix whitespace glitches. Pointed out by: jhb Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sun May 25 12:01:13 2014 (r266650) +++ head/sys/arm/arm/pmap-v6.c Sun May 25 14:01:30 2014 (r266651) @@ -2405,9 +2405,9 @@ pmap_kenter_internal(vm_offset_t va, vm_ if (flags & KENTER_CACHE) *ptep = L2_S_PROTO | l2s_mem_types[PTE_CACHE] | pa | L2_S_REF; else if (flags & KENTER_DEVICE) - *ptep = L2_S_PROTO |l2s_mem_types[PTE_DEVICE] | pa | L2_S_REF; + *ptep = L2_S_PROTO | l2s_mem_types[PTE_DEVICE] | pa | L2_S_REF; else - *ptep =L2_S_PROTO | l2s_mem_types[PTE_NOCACHE] | pa | L2_S_REF; + *ptep = L2_S_PROTO | l2s_mem_types[PTE_NOCACHE] | pa | L2_S_REF; if (flags & KENTER_CACHE) { pmap_set_prot(ptep, VM_PROT_READ | VM_PROT_WRITE, From owner-svn-src-head@FreeBSD.ORG Sun May 25 14:01:52 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2151BFC0; Sun, 25 May 2014 14:01:52 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E973D22CE; Sun, 25 May 2014 14:01:51 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WoYzl-000NGw-R8; Sun, 25 May 2014 14:01:49 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s4PE1lDr049986; Sun, 25 May 2014 08:01:47 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+Gvfw7GUQi7Or8TbVEE8rU Subject: Re: svn commit: r266565 - head/sys/arm/arm From: Ian Lepore To: John Baldwin In-Reply-To: <201405230912.47217.jhb@freebsd.org> References: <201405222338.s4MNcHYA066694@svn.freebsd.org> <201405230912.47217.jhb@freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Sun, 25 May 2014 08:01:47 -0600 Message-ID: <1401026507.1152.324.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 14:01:52 -0000 On Fri, 2014-05-23 at 09:12 -0400, John Baldwin wrote: > On Thursday, May 22, 2014 7:38:17 pm Ian Lepore wrote: > > Author: ian > > Date: Thu May 22 23:38:17 2014 > > New Revision: 266565 > > URL: http://svnweb.freebsd.org/changeset/base/266565 > > > > Log: > > Map device memory using PTE_DEVICE attributes, and also ensure that the > > shared flag is set on normal-memory mappings made via pmap_kenter() for SMP. > > > > The "shared flag" part of this change isn't obvious from the diff, here's > > the deal... by using the array of preformatted page table entry templates > > instead of constructing the PTE from scratch, we automatically get the > > right attribute bits set for both caching and shared. > > > > MFC after: 1 week > > One tiny nit: > > > Modified: head/sys/arm/arm/pmap-v6.c > > ============================================================================== > > --- head/sys/arm/arm/pmap-v6.c Thu May 22 23:18:17 2014 (r266564) > > +++ head/sys/arm/arm/pmap-v6.c Thu May 22 23:38:17 2014 (r266565) > > @@ -2401,12 +2402,17 @@ pmap_kenter_internal(vm_offset_t va, vm_ > > ptep = &l2b->l2b_kva[l2pte_index(va)]; > > opte = *ptep; > > > > + if (flags & KENTER_CACHE) > > + *ptep = L2_S_PROTO | l2s_mem_types[PTE_CACHE] | pa | L2_S_REF; > > + else if (flags & KENTER_DEVICE) > > + *ptep = L2_S_PROTO |l2s_mem_types[PTE_DEVICE] | pa | L2_S_REF; > > + else > > + *ptep =L2_S_PROTO | l2s_mem_types[PTE_NOCACHE] | pa | L2_S_REF; > > + > > The whitespace around operators for the last two assignments is inconsistent. > Fixed, thanks. -- Ian From owner-svn-src-head@FreeBSD.ORG Sun May 25 15:53:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25B93D67 for ; Sun, 25 May 2014 15:53:53 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E67632A64 for ; Sun, 25 May 2014 15:53:52 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s4PFrqx4093076 for ; Sun, 25 May 2014 15:53:52 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s4PFrqxT093068 for svn-src-head@freebsd.org; Sun, 25 May 2014 15:53:52 GMT (envelope-from bdrewery) Received: (qmail 63077 invoked from network); 25 May 2014 10:53:50 -0500 Received: from unknown (HELO roundcube.xk42.net) (10.10.5.5) by sweb.xzibition.com with SMTP; 25 May 2014 10:53:50 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 25 May 2014 10:53:50 -0500 From: Bryan Drewery To: Allan Jude Subject: Re: svn commit: r266645 - head/usr.bin/netstat Organization: FreeBSD In-Reply-To: <201405250741.s4P7fCvh095925@svn.freebsd.org> References: <201405250741.s4P7fCvh095925@svn.freebsd.org> Message-ID: <4aad9c2211e850938174998f66dd3fbb@shatow.net> X-Sender: bdrewery@FreeBSD.org User-Agent: Roundcube Webmail/0.9.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, owner-src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 15:53:53 -0000 On 2014-05-25 02:41, Allan Jude wrote: > Author: allanjude (doc committer) > Date: Sun May 25 07:41:12 2014 > New Revision: 266645 > URL: http://svnweb.freebsd.org/changeset/base/266645 > > Log: > Document the new -R flag of netstat(1) introduced in r266448 that > tracks the > flowid for each socket. > > Reviewed by: adrian > Approved by: eadler (mentor) > > Modified: > head/usr.bin/netstat/netstat.1 > > Modified: head/usr.bin/netstat/netstat.1 > ============================================================================== > --- head/usr.bin/netstat/netstat.1 Sun May 25 06:42:43 2014 (r266644) > +++ head/usr.bin/netstat/netstat.1 Sun May 25 07:41:12 2014 (r266645) > @@ -45,7 +45,7 @@ depending on the options for the informa Looks like you forgot to bump .Dd > .It Xo > .Bk -words > .Nm > -.Op Fl 46AaLnSTWx > +.Op Fl 46AaLnSTWxR > .Op Fl f Ar protocol_family | Fl p Ar protocol > .Op Fl M Ar core > .Op Fl N Ar system > @@ -84,6 +84,9 @@ but show ports symbolically. > If > .Fl x > is present, display socket buffer and tcp timer statistics for each > internet socket. > +If > +.Fl R > +is present, display the flowid and flowtype for each internet socket. > When > .Fl T > is present, display information from the TCP control block, including > @@ -367,6 +370,11 @@ and display them symbolically. > .It Fl W > In certain displays, avoid truncating addresses even if this causes > some fields to overflow. > +.It Fl R > +Display the flowid and flowtype for each socket. > +flowid is a 32 bit hardware specific identifier for each flow. > +flowtype defines which protocol fields are hashed to produce the id. > +A complete listing is available in sys/mbuf.h under M_HASHTYPE_* > .El > .Pp > The default display, for active sockets, shows the local -- Regards, Bryan Drewery From owner-svn-src-head@FreeBSD.ORG Sun May 25 18:06:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE2B1362; Sun, 25 May 2014 18:06:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B8DB2408; Sun, 25 May 2014 18:06:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4PI6WTM085738; Sun, 25 May 2014 18:06:32 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4PI6WEp085737; Sun, 25 May 2014 18:06:32 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405251806.s4PI6WEp085737@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 25 May 2014 18:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266664 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 18:06:32 -0000 Author: hselasky Date: Sun May 25 18:06:32 2014 New Revision: 266664 URL: http://svnweb.freebsd.org/changeset/base/266664 Log: Add empty LIBUSB_CALL macro, to be compatible to the libusb 1.0-API from sourceforge. PR: usb/190204 MFC after: 1 week Modified: head/lib/libusb/libusb.h Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Sun May 25 18:06:28 2014 (r266663) +++ head/lib/libusb/libusb.h Sun May 25 18:06:32 2014 (r266664) @@ -33,6 +33,8 @@ #include #endif +#define LIBUSB_CALL + #ifdef __cplusplus extern "C" { #endif From owner-svn-src-head@FreeBSD.ORG Sun May 25 18:40:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02E9A3D3; Sun, 25 May 2014 18:40:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E393126AD; Sun, 25 May 2014 18:40:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4PIeWOn000794; Sun, 25 May 2014 18:40:32 GMT (envelope-from allanjude@svn.freebsd.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4PIeWvL000792; Sun, 25 May 2014 18:40:32 GMT (envelope-from allanjude@svn.freebsd.org) Message-Id: <201405251840.s4PIeWvL000792@svn.freebsd.org> From: Allan Jude Date: Sun, 25 May 2014 18:40:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266671 - head/lib/libc/string X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 18:40:33 -0000 Author: allanjude (doc committer) Date: Sun May 25 18:40:32 2014 New Revision: 266671 URL: http://svnweb.freebsd.org/changeset/base/266671 Log: Merge strcspn.3 into strspn.3 and clarify the explaination of what they do Detach strcspn.3 from the build Add strcspn.3 to MLINKS do it will be symlinked to strspn.3 Approved by: eadler (mentor), bcr (mentor) Deleted: head/lib/libc/string/strcspn.3 Modified: head/lib/libc/string/Makefile.inc head/lib/libc/string/strspn.3 Modified: head/lib/libc/string/Makefile.inc ============================================================================== --- head/lib/libc/string/Makefile.inc Sun May 25 18:26:43 2014 (r266670) +++ head/lib/libc/string/Makefile.inc Sun May 25 18:40:32 2014 (r266671) @@ -30,7 +30,7 @@ SYM_MAPS+= ${LIBC_SRCTOP}/string/Symbol. MAN+= bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \ memcmp.3 memcpy.3 memmem.3 memmove.3 memset.3 strcasecmp.3 strcat.3 \ - strchr.3 strcmp.3 strcoll.3 strcpy.3 strcspn.3 strdup.3 strerror.3 \ + strchr.3 strcmp.3 strcoll.3 strcpy.3 strdup.3 strerror.3 \ string.3 strlcpy.3 strlen.3 strmode.3 strpbrk.3 strsep.3 \ strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 wcscoll.3 wcstok.3 \ wcswidth.3 wcsxfrm.3 wmemchr.3 @@ -60,6 +60,7 @@ MLINKS+=strerror.3 perror.3 \ strerror.3 sys_nerr.3 MLINKS+=strlcpy.3 strlcat.3 MLINKS+=strlen.3 strnlen.3 +MLINKS+=strspn.3 strcspn.3 MLINKS+=strstr.3 strcasestr.3 \ strstr.3 strnstr.3 \ strstr.3 strcasestr_l.3 Modified: head/lib/libc/string/strspn.3 ============================================================================== --- head/lib/libc/string/strspn.3 Sun May 25 18:26:43 2014 (r266670) +++ head/lib/libc/string/strspn.3 Sun May 25 18:40:32 2014 (r266671) @@ -32,11 +32,12 @@ .\" @(#)strspn.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd May 24, 2014 .Dt STRSPN 3 .Os .Sh NAME -.Nm strspn +.Nm strspn , +.Nm strcspn .Nd span a string .Sh LIBRARY .Lb libc @@ -44,6 +45,8 @@ .In string.h .Ft size_t .Fn strspn "const char *s" "const char *charset" +.Ft size_t +.Fn strcspn "const char *s" "const char *charset" .Sh DESCRIPTION The .Fn strspn @@ -54,22 +57,43 @@ as long as the characters from .Fa s occur in the null-terminated string .Fa charset . -In other words, it computes the string array index in -.Fa s +In other words, it computes the string array index of the first character of .Fa s which is not in .Fa charset , else the index of the first null character. +.Pp +The +.Fn strcspn +function +spans the initial part of the null-terminated string +.Fa s +as long as the characters from +.Fa s +do not occur in the null-terminated string +.Fa charset +(it +spans the +.Em complement +of +.Fa charset ) . +In other words, it computes the string array index +of the first character of +.Fa s +which is also in +.Fa charset , +else the index of the first null character. .Sh RETURN VALUES The .Fn strspn -function -returns the number of characters spanned. +and +.Fn strcspn +functions +return the number of characters spanned. .Sh SEE ALSO .Xr memchr 3 , .Xr strchr 3 , -.Xr strcspn 3 , .Xr strpbrk 3 , .Xr strrchr 3 , .Xr strsep 3 , @@ -79,6 +103,8 @@ returns the number of characters spanned .Sh STANDARDS The .Fn strspn -function -conforms to +and +.Fn strcspn +functions +conform to .St -isoC . From owner-svn-src-head@FreeBSD.ORG Sun May 25 18:47:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7732C70E; Sun, 25 May 2014 18:47:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6483E2752; Sun, 25 May 2014 18:47:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4PIlPCt004568; Sun, 25 May 2014 18:47:25 GMT (envelope-from zbb@svn.freebsd.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4PIlPtj004567; Sun, 25 May 2014 18:47:25 GMT (envelope-from zbb@svn.freebsd.org) Message-Id: <201405251847.s4PIlPtj004567@svn.freebsd.org> From: Zbigniew Bodek Date: Sun, 25 May 2014 18:47:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266672 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 18:47:25 -0000 Author: zbb Date: Sun May 25 18:47:24 2014 New Revision: 266672 URL: http://svnweb.freebsd.org/changeset/base/266672 Log: Fix context switch on PJ4Bv7 and remove obsolete pj4b_/arm11 functions Use armv7_setttb that sets proper PT attributes. Get rid of unused CPU functions, put nullop instead. Exchange obsolete pj4b_/arm11_ functions to the appropriate armv7_ ones. Modified: head/sys/arm/arm/cpufunc.c Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Sun May 25 18:40:32 2014 (r266671) +++ head/sys/arm/arm/cpufunc.c Sun May 25 18:47:24 2014 (r266672) @@ -369,13 +369,13 @@ struct cpu_functions pj4bv7_cpufuncs = { /* CPU functions */ cpufunc_id, /* id */ - arm11_drain_writebuf, /* cpwait */ + armv7_drain_writebuf, /* cpwait */ /* MMU functions */ cpufunc_control, /* control */ cpufunc_domains, /* Domain */ - pj4b_setttb, /* Setttb */ + armv7_setttb, /* Setttb */ cpufunc_faultstatus, /* Faultstatus */ cpufunc_faultaddress, /* Faultaddress */ @@ -409,10 +409,10 @@ struct cpu_functions pj4bv7_cpufuncs = { /* Other functions */ - pj4b_drain_readbuf, /* flush_prefetchbuf */ - arm11_drain_writebuf, /* drain_writebuf */ - pj4b_flush_brnchtgt_all, /* flush_brnchtgt_C */ - pj4b_flush_brnchtgt_va, /* flush_brnchtgt_E */ + cpufunc_nullop, /* flush_prefetchbuf */ + armv7_drain_writebuf, /* drain_writebuf */ + cpufunc_nullop, /* flush_brnchtgt_C */ + (void *)cpufunc_nullop, /* flush_brnchtgt_E */ (void *)cpufunc_nullop, /* sleep */ @@ -421,7 +421,7 @@ struct cpu_functions pj4bv7_cpufuncs = { cpufunc_null_fixup, /* dataabt_fixup */ cpufunc_null_fixup, /* prefetchabt_fixup */ - arm11_context_switch, /* context_switch */ + armv7_context_switch, /* context_switch */ pj4bv7_setup /* cpu setup */ }; From owner-svn-src-head@FreeBSD.ORG Sun May 25 19:19:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28326C55; Sun, 25 May 2014 19:19:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFA7C2964; Sun, 25 May 2014 19:19:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4PJJfcT018470; Sun, 25 May 2014 19:19:41 GMT (envelope-from zbb@svn.freebsd.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4PJJfK4018468; Sun, 25 May 2014 19:19:41 GMT (envelope-from zbb@svn.freebsd.org) Message-Id: <201405251919.s4PJJfK4018468@svn.freebsd.org> From: Zbigniew Bodek Date: Sun, 25 May 2014 19:19:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266673 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 19:19:42 -0000 Author: zbb Date: Sun May 25 19:19:41 2014 New Revision: 266673 URL: http://svnweb.freebsd.org/changeset/base/266673 Log: Delete obsolete and unused PJ4B CPU functions Since PJ4Bv7 uses armv7_ CPU functions only pj4b_config function is necessary. Remove obsolete routines. Modified: head/sys/arm/arm/cpufunc_asm_pj4b.S head/sys/arm/include/cpufunc.h Modified: head/sys/arm/arm/cpufunc_asm_pj4b.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_pj4b.S Sun May 25 18:47:24 2014 (r266672) +++ head/sys/arm/arm/cpufunc_asm_pj4b.S Sun May 25 19:19:41 2014 (r266673) @@ -37,38 +37,6 @@ __FBSDID("$FreeBSD$"); .Lpj4b_sf_ctrl_reg: .word 0xf1021820 - -ENTRY(pj4b_setttb) - /* Cache synchronization is not required as this core has PIPT caches */ - mcr p15, 0, r1, c7, c10, 4 /* drain the write buffer */ -#ifdef SMP - orr r0, r0, #2 /* Set TTB shared memory flag */ -#endif - mcr p15, 0, r0, c2, c0, 0 /* load new TTB */ - mcr p15, 0, r0, c8, c7, 0 /* invalidate I+D TLBs */ - RET -END(pj4b_setttb) - -ENTRY(pj4b_drain_readbuf) - mcr p15, 0, r0, c7, c5, 4 /* flush prefetch buffers */ - RET -END(pj4b_drain_readbuf) - -ENTRY(pj4b_flush_brnchtgt_all) - mcr p15, 0, r0, c7, c5, 6 /* flush entrie branch target cache */ - RET -END(pj4b_flush_brnchtgt_all) - -ENTRY(pj4b_flush_brnchtgt_va) - mcr p15, 0, r0, c7, c5, 7 /* flush branch target cache by VA */ - RET -END(pj4b_flush_brnchtgt_va) - -ENTRY(get_core_id) - mrc p15, 0, r0, c0, c0, 5 - RET -END(get_core_id) - ENTRY(pj4b_config) /* Set Auxiliary Debug Modes Control 0 register */ Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Sun May 25 18:47:24 2014 (r266672) +++ head/sys/arm/include/cpufunc.h Sun May 25 19:19:41 2014 (r266673) @@ -391,13 +391,6 @@ void arm11_tlb_flushD_SE (u_int va); void arm11_drain_writebuf (void); -void pj4b_setttb (u_int); - -void pj4b_drain_readbuf (void); -void pj4b_flush_brnchtgt_all (void); -void pj4b_flush_brnchtgt_va (u_int); -void pj4b_sleep (int); - void armv6_icache_sync_all (void); void armv6_icache_sync_range (vm_offset_t, vm_size_t); @@ -432,8 +425,6 @@ u_int armv7_auxctrl (u_int, u_int); void pj4bv7_setup (char *string); void pj4b_config (void); -int get_core_id (void); - void armadaxp_idcache_wbinv_all (void); void cortexa_setup (char *); From owner-svn-src-head@FreeBSD.ORG Sun May 25 19:22:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1F8DE39; Sun, 25 May 2014 19:22:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEDD029F8; Sun, 25 May 2014 19:22:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4PJMSAl021950; Sun, 25 May 2014 19:22:28 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4PJMSuI021949; Sun, 25 May 2014 19:22:28 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201405251922.s4PJMSuI021949@svn.freebsd.org> From: Dimitry Andric Date: Sun, 25 May 2014 19:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266674 - head/contrib/llvm/tools/clang/lib/Headers X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 19:22:28 -0000 Author: dim Date: Sun May 25 19:22:28 2014 New Revision: 266674 URL: http://svnweb.freebsd.org/changeset/base/266674 Log: Pull in r209489 from upstream clang trunk (by Akira Hatanaka): Fix a bug in xmmintrin.h. The last step of _mm_cvtps_pi16 should use _mm_packs_pi32, which is a function that reads two __m64 values and packs four 32-bit values into four 16-bit values. MFC after: 3 days Modified: head/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h Modified: head/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h ============================================================================== --- head/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h Sun May 25 19:19:41 2014 (r266673) +++ head/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h Sun May 25 19:22:28 2014 (r266674) @@ -903,7 +903,7 @@ _mm_cvtps_pi16(__m128 __a) __a = _mm_movehl_ps(__a, __a); __c = _mm_cvtps_pi32(__a); - return _mm_packs_pi16(__b, __c); + return _mm_packs_pi32(__b, __c); } static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) From owner-svn-src-head@FreeBSD.ORG Sun May 25 19:28:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE09C135; Sun, 25 May 2014 19:28:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 826FD2A25; Sun, 25 May 2014 19:28:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4PJSYYt022789; Sun, 25 May 2014 19:28:34 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4PJSYUx022788; Sun, 25 May 2014 19:28:34 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201405251928.s4PJSYUx022788@svn.freebsd.org> From: Dimitry Andric Date: Sun, 25 May 2014 19:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266675 - head/contrib/llvm/patches X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2014 19:28:34 -0000 Author: dim Date: Sun May 25 19:28:34 2014 New Revision: 266675 URL: http://svnweb.freebsd.org/changeset/base/266675 Log: Add the clang patch for r266674. Added: head/contrib/llvm/patches/patch-r266674-clang-r209489-fix-xmmintrin.diff Added: head/contrib/llvm/patches/patch-r266674-clang-r209489-fix-xmmintrin.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r266674-clang-r209489-fix-xmmintrin.diff Sun May 25 19:28:34 2014 (r266675) @@ -0,0 +1,49 @@ +Pull in r209489 from upstream clang trunk (by Akira Hatanaka): + + Fix a bug in xmmintrin.h. + + The last step of _mm_cvtps_pi16 should use _mm_packs_pi32, which is a function + that reads two __m64 values and packs four 32-bit values into four 16-bit + values. + + + +Pull in r209559 from upstream clang trunk (by Akira Hatanaka): + + Recommit r209532 with -ffreestanding. + + This is a test case for r209489. + +Introduced here: http://svnweb.freebsd.org/changeset/base/266674 + +Index: tools/clang/lib/Headers/xmmintrin.h +=================================================================== +--- tools/clang/lib/Headers/xmmintrin.h ++++ tools/clang/lib/Headers/xmmintrin.h +@@ -903,7 +903,7 @@ _mm_cvtps_pi16(__m128 __a) + __a = _mm_movehl_ps(__a, __a); + __c = _mm_cvtps_pi32(__a); + +- return _mm_packs_pi16(__b, __c); ++ return _mm_packs_pi32(__b, __c); + } + + static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) +Index: tools/clang/test/Headers/xmmintrin.c +=================================================================== +--- tools/clang/test/Headers/xmmintrin.c ++++ tools/clang/test/Headers/xmmintrin.c +@@ -0,0 +1,13 @@ ++// RUN: %clang_cc1 %s -ffreestanding -triple x86_64-apple-macosx10.9.0 -emit-llvm -o - | FileCheck %s ++ ++#include ++ ++// Make sure the last step of _mm_cvtps_pi16 converts <4 x i32> to <4 x i16> by ++// checking that clang emits PACKSSDW instead of PACKSSWB. ++ ++// CHECK: define i64 @test_mm_cvtps_pi16 ++// CHECK: call x86_mmx @llvm.x86.mmx.packssdw ++ ++__m64 test_mm_cvtps_pi16(__m128 a) { ++ return _mm_cvtps_pi16(a); ++} From owner-svn-src-head@FreeBSD.ORG Mon May 26 02:19:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 033A453F; Mon, 26 May 2014 02:19:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E497D28B0; Mon, 26 May 2014 02:19:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4Q2JorU006929; Mon, 26 May 2014 02:19:50 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4Q2Jopj006928; Mon, 26 May 2014 02:19:50 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201405260219.s4Q2Jopj006928@svn.freebsd.org> From: Eitan Adler Date: Mon, 26 May 2014 02:19:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266677 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 02:19:51 -0000 Author: eadler Date: Mon May 26 02:19:50 2014 New Revision: 266677 URL: http://svnweb.freebsd.org/changeset/base/266677 Log: e1000: add missing braces Obtained from: DragonFlyBSD Modified: head/sys/dev/e1000/e1000_phy.c Modified: head/sys/dev/e1000/e1000_phy.c ============================================================================== --- head/sys/dev/e1000/e1000_phy.c Mon May 26 01:37:43 2014 (r266676) +++ head/sys/dev/e1000/e1000_phy.c Mon May 26 02:19:50 2014 (r266677) @@ -4157,12 +4157,13 @@ s32 e1000_read_phy_reg_mphy(struct e1000 *data = E1000_READ_REG(hw, E1000_MPHY_DATA); /* Disable access to mPHY if it was originally disabled */ - if (locked) + if (locked) { ready = e1000_is_mphy_ready(hw); if (!ready) return -E1000_ERR_PHY; E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, E1000_MPHY_DIS_ACCESS); + } return E1000_SUCCESS; } @@ -4222,12 +4223,13 @@ s32 e1000_write_phy_reg_mphy(struct e100 E1000_WRITE_REG(hw, E1000_MPHY_DATA, data); /* Disable access to mPHY if it was originally disabled */ - if (locked) + if (locked) { ready = e1000_is_mphy_ready(hw); if (!ready) return -E1000_ERR_PHY; E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, E1000_MPHY_DIS_ACCESS); + } return E1000_SUCCESS; } From owner-svn-src-head@FreeBSD.ORG Mon May 26 07:56:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6C65A10; Mon, 26 May 2014 07:56:21 +0000 (UTC) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 8FD7A2370; Mon, 26 May 2014 07:56:20 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id E2E93421266; Mon, 26 May 2014 17:24:06 +1000 (EST) Date: Mon, 26 May 2014 17:23:52 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bryan Drewery Subject: Re: svn commit: r266645 - head/usr.bin/netstat In-Reply-To: <4aad9c2211e850938174998f66dd3fbb@shatow.net> Message-ID: <20140526145518.Y1031@besplex.bde.org> References: <201405250741.s4P7fCvh095925@svn.freebsd.org> <4aad9c2211e850938174998f66dd3fbb@shatow.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=U6SrU4bu c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=8Ejko-KZfo0A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=pO066_YVgSg2zKRLAI0A:9 a=V762NO7MSKnXJf44:21 a=k5steFizap0v9KmX:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Allan Jude , owner-src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 07:56:22 -0000 On Sun, 25 May 2014, Bryan Drewery wrote: > On 2014-05-25 02:41, Allan Jude wrote: >> ... >> Log: >> Document the new -R flag of netstat(1) introduced in r266448 that tracks >> the >> flowid for each socket. >> >> Modified: head/usr.bin/netstat/netstat.1 >> ============================================================================== >> --- head/usr.bin/netstat/netstat.1 Sun May 25 06:42:43 2014 >> (r266644) >> +++ head/usr.bin/netstat/netstat.1 Sun May 25 07:41:12 2014 >> (r266645) >> @@ -45,7 +45,7 @@ depending on the options for the informa > > Looks like you forgot to bump .Dd > >> .It Xo >> .Bk -words >> .Nm >> -.Op Fl 46AaLnSTWx >> +.Op Fl 46AaLnSTWxR Also, the alphabet. >> @@ -84,6 +84,9 @@ but show ports symbolically. >> If >> .Fl x >> is present, display socket buffer and tcp timer statistics for each >> internet socket. >> +If >> +.Fl R >> +is present, display the flowid and flowtype for each internet socket. >> When >> .Fl T >> is present, display information from the TCP control block, including Here -T was already unsorted. The syntax is very complicated and most of the options are not described in a single list, but they are mostly sorted in sub-lists starting with the ones in the synopsis. (The man page is unusually organized and doesn't actually have a SYNOPSIS section. Instead, the synopsis lines are placed in the DESCRIPTION section. I refer to the collection of them as "the synopsis" although there is no actual synopsis). >> @@ -367,6 +370,11 @@ and display them symbolically. >> .It Fl W >> In certain displays, avoid truncating addresses even if this causes >> some fields to overflow. >> +.It Fl R >> +Display the flowid and flowtype for each socket. >> +flowid is a 32 bit hardware specific identifier for each flow. >> +flowtype defines which protocol fields are hashed to produce the id. >> +A complete listing is available in sys/mbuf.h under M_HASHTYPE_* >> .El >> .Pp >> The default display, for active sockets, shows the local -R seems to have only been added to the synopsis for 1 of the displays. If that is correct, then its description doesn't belong here, even if it were sorted (this sub-list was sorted). This is the general list for options that have "the [sic] general meaning". Many of the options in this list are not really general. I think only -M and -N are really general. They are given for all except 4 displays in the synopsis. I think this is a bug in 3 or 4 of these displays in the synopsis. The others (-46fnW and now -R) are not present in most of the displays in the synopsis. I think the bugs for this are distributed. Only the above description for -W is fuzzy enough to be correct (it says "for certain displays"). Actually, this makes it is not even wrong. It is documented for just 2 of the displays, and the details of what it does are given there. PS: oops: the detals are more complicated. The above is generic for "addresses", while the details only mention "interfaces". -W seems to affect both if and only it affects either, but it sometimes affects neither when it is documented to affect "interfaces". Getopt parsing in netstat would have to be just as complicated as the synopsis to restrict to only the documented combinations. It actually seems to allow all combinations except -x with -T. Then netstat does whatever it does with the undocumented/nonsensical combinations. netstat's usage message tries to duplicate all of the synopsis lines. I didn't notice if -R was already up to date or unsorted in the usage message. Comparing the previous versions of them shows only minor bugs: @--- netstat.synopsis 2014-05-26 05:36:41.306465000 +0000 @+++ netstat.usage 2014-05-26 05:35:06.234067000 +0000 @@@ -1,2 +1,2 @@ @- netstat [-46AaLnSTWx] [-f protocol_family | -p protocol] [-M core] @- [-N system] @+usage netstat [-46AaLnSTWx] [-f protocol_family | -p protocol] [-M core] @+ [-M core] [-N system] The usage message is split gratuitously inconsistently. Unfortunately, lining up after printing "usage: " gives a 7-column indentation, while man gives a 5-column identation. (I used diff -w to avoid seeing most such differences.) Despite this, there are enough columns to preserve the line splitting here. @@@ -4,4 +4,5 @@ @- netstat -w wait [-I interface] [-d] [-M core] [-N system] [-q howmany] @- netstat -s [-s] [-46z] [-f protocol_family | -p protocol] [-M core] @- [-N system] @- netstat -i | -I interface -s [-46] [-f protocol_family | -p protocol] @+ [-M core] [-N system] @+ netstat -w wait [-I interface] [-46d] [-M core] [-N system] [-q howmany] @+ netstat -s [-s] [-46z] [-f protocol_family | -p protocol] @+ [-M core] [-N system] @+ netstat -i | -I interface [-46s] [-f protocol_family | -p protocol] The synopsis for -w is missing -46. The synopsis for -i says -s [-46] but the usage says [-46s]. It is unclear where the bug is. The line before this says -s [-s]. There the second -s is certainly correct -- it amplifies the effect of the first -s. It is unclear if the first -s is really a display selector. Some of the lines in the "synopsis" seem to be more like examples giving some but not all useful combinatations of options. The synopsis for -i is missing [-M core] [-N system]. The usage for -i mis-splits the line before either of these as usual. @@@ -10,3 +11,2 @@ @- netstat -B [-z] [-I interface] @- netstat -r [-46AanW] [-F fibnum] [-f address_family] [-M core] @- [-N system] @+ netstat -B [-I interface] @+ netstat -r [-46AanW] [-f address_family] [-M core] [-N system] The usage for -B is missing -z. The synopsis for -r is missing [-F fibnum]. I noticed that -W doesn't work very well. Its main use of avoiding truncation of interface names is completely broken (not done). For -r, as well as adding the Mtu column, it restores printing of the Use column but not the Refs column; the latter is undocumented. Examples of misformatting: Old version on my local system. Some names are about 50 wide, so the full display is almost 160 wide. It is unreadable: @Destination Gateway Flags Refs Use Mtu Netif Expire @default c122-106-144-1.carlnfd1.nsw.optusnet.com.au UGS 0 15216 1500 rl0 @122.106.144/20 link#2 UC 0 0 1500 rl0 @c122-106-144-1.carlnfd1.nsw.optusnet.com.au 00:1d:45:70:a8:d9 UHLW 1 0 1500 rl0 868 @ -current version on freefall. First with -rW: @Internet: @Destination Gateway Flags Use Mtu Netif Expire @default router.v108.ysv.fr UGS 166457765 1500 igb0 @... @Internet6: @Destination Gateway Flags Use Mtu Netif Expire @... @2001:1900:2254:206 link#1 U 2009694789 1500 igb0 @freefall.freebsd.o link#1 UHS 108 16384 lo0 Names are blindly truncated with no indication. Despite this and other space-saving measures, the formatting is still broken by large values in the Use field. The truncation is more of a problem with. ipv6 now now gives very long and cryptic numeric-like fields even without -n. Everyone can knows freefall's full name so they can un-truncate it in the above, bit not manyone can un-truncate the above ipv6 address. -W actually works with -rnW: @Internet: @Destination Gateway Flags Use Mtu Netif Expire @default 8.8.178.129 UGS 166460840 1500 igb0 @... @Internet6: @Destination Gateway Flags Use Mtu Netif Expire @... @2001:1900:2254:206c::/64 link#1 U 2009749211 1500 igb0 @2001:1900:2254:206c::16:87 link#1 UHS 108 16384 lo0 netstat is moderately smart and changes the column widths for ipv6. In my attempts to fix such misformattings using post-processing, I found (learned again) that expanding the column widths to hold a few wide entries doesn't work. In the above, ipv6 has many wide entries so the exansion is necessary (the Gateway field looks too wide in the above, but unshown entries need it. Actually, the fields are still gratuitously wide. In the above, the entry ending with ":87" is widest. The field width should be 1 wider than it, but is 8 wider). The Gateway field width is only 4 wider than it should be). Even ls -C hasn't learned how to format columns yet in FreeBSD. It uses something like the following algorithm to give horrible results when there is a single wide name: - find the widest name - add 1 - add another one for ls -F (my default), even when an extra character for -F is not needed - add 7 and truncate to a multiple of 8. This aligns to a tab boundary. So a few file names of length <= 6 are displayed well enough, 10 per line. Change one to length 7. 8 columns is still enough, especially with only 1 outlier, but the above gives length 16 for 1 name and uses it for all names. So only 5 names are displayed per line, using not 16 columns each for the first 4 and 15 for the last one, all on an 80-column terminal of course. There is a minor problem with possible auto-wrap for the last column. 5 columns of 16 each must be avoided, but it is easily avoided for the last column by leaving just 1 space between fields and not printing a space for the last column. Change one to length 15. 5 columns should still fit, but after mis-expansion of 15 to 24, only 3 columns fit. In large directories, bad verbose names are more common so reduction to 2 or 3 columns is the usual case, so -C works least well in large directories where it is most needed. ls -CF works as well as possible in gnu ls: Script started on Mon May 26 17:15:32 2014 ttyv1:root@besplex:/tmp/s2> /bin/ls -F 000000000000010 000003 000007 0000009 000004 000008 000001 000005 typescript 000002 000006 ttyv1:root@besplex:/tmp/s2> /compat/linux/bin/ls -F 000000000000010 000001 000003 000005 000007 typescript 0000009 000002 000004 000006 000008 ttyv1:root@besplex:/tmp/s2> exit Script done on Mon May 26 17:15:46 2014 gnu ls doesn't expand to a tab stop, and it uses variable-width columns. Sorting prevents it doing fancier things like grouping the wide fields in columns. Bruce From owner-svn-src-head@FreeBSD.ORG Mon May 26 09:35:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67DDE816; Mon, 26 May 2014 09:35:14 +0000 (UTC) Received: from mailrelay005.isp.belgacom.be (mailrelay005.isp.belgacom.be [195.238.6.171]) by mx1.freebsd.org (Postfix) with ESMTP id 02C942C99; Mon, 26 May 2014 09:35:12 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlAHAGkJg1NbsXvB/2dsb2JhbABZgweubJROAYEPF3SCJQEBBVYjEAsOBAYJJQ8qEA4GE4hGAdcrF44fMweEQAEDlXKEAJMogzo7 Received: from 193.123-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.123.193]) by relay.skynet.be with ESMTP; 26 May 2014 11:35:04 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.8/8.14.8) with ESMTP id s4Q9Z3P6001779; Mon, 26 May 2014 11:35:03 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Mon, 26 May 2014 11:35:02 +0200 From: Tijl Coosemans To: Warner Losh Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140526113502.239db74d@kalimero.tijl.coosemans.org> In-Reply-To: <9FE34CE4-C71F-4806-9EF6-30CB1051C62F@bsdimp.com> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> <5380EBA8.1030200@freebsd.org> <20140525011307.142b41ab@kalimero.tijl.coosemans.org> <3CCAFAD3-FABE-40EF-ABF9-815FE5826349@bsdimp.com> <9FE34CE4-C71F-4806-9EF6-30CB1051C62F@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-7 Content-Transfer-Encoding: quoted-printable Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , Nathan Whitehorn , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 09:35:14 -0000 On Sat, 24 May 2014 19:00:18 -0600 Warner Losh wrote: > On May 24, 2014, at 5:53 PM, Warner Losh wrote: >> On May 24, 2014, at 5:13 PM, Tijl Coosemans wrote: >>> There isn't necessarily any chroot environment. There's one kernel, >>> two equally valid ABIs (ILP32 and LP64) and any binary like uname might >>> use either of them. If uname -p returns a different result depending on >>> which of these two ABIs it was compiled for that could be a problem for >>> any script that uses it. >>=20 >> Well, it depends on what you want to do with the script, eh? If you want >> to know the ABI of the native binary uname, that=A2s one thing. But if y= ou >> want to know the supported ABIs, you are doing it wrong by using uname. >> You should be using sysctl kern.supported_abi. That will tell you all the >> ABIs that you can install packages for on this machine, which is what you >> really want to know. So I=A2m having trouble connecting the dots between >> this and what you are saying here. >>=20 >> I still am absolutely flabbergasted why the MACHINE_ARCH names aren=A2t >> necessary and sufficient for packaging. I=A2ve yet to see any coherent >> reason to not use them. >=20 > Why do I care that they match? Good question. When I was doing FreeNAS, I > looked at integrating pkgng into nanobsd. At the time this was quite > difficult because every single architecture name was different between > pkgng and MACHINE_ARCH. This would mean I=A2d have to drag around a huge > table to know how to translate one to the other (there was no simple regex > either, and things like mipsn32 wouldn=A2t have fit into the scheme at the > time). I would very much like us to see us keep these names in sync and > avoid large translation tables that are difficult to maintain. >=20 > Now, do you need to get it from uname -p? No. If you want to parse elf > files to get it, that=A2s fine, so long as the names map directly to the > MACHINE_ARCH names that we=A2ve been using for years. They completely > describe the universe of supported platforms. Are they perfect? No, around > the edge there may be an odd-ball that=A2s possible to build, but is > unsupported and likely doesn=A2t work at all. Have we learned from these > mistakes? Yes. Anything that=A2s actively supported has a proper name. Th= is > name is needed, btw, so that any machine can self-host, a nice feature of > the /usr/src system. ABI consists of the following elements: - OS - OS ABI version (major version number in FreeBSD) - instruction set - programming model (ILP32 or LP64) - byte order (little/big endian) These are almost orthogonal dimensions in the sense that almost any combination is possible. (A combination that isn't possible is a 32-bit instruction set with LP64.) What you are asking for now is to combine two dimensions into one and combination in this case means multiplication so if you have 3 instruction sets and 2 programming models, the combined dimension needs 6 different values. You need to make the case for why you think this is a good idea. For the past 20 years we got away with this because on every installation of FreeBSD we only used one programming model at a time. This is still the case for byte order of course. What I'm saying is to keep the option open for installations with multiple programming models, where most binaries could use ILP32 and only the ones that actually need a 64-bit address space use LP64. You query the instruction set using uname and the programming models using getconf. I suppose you could replace the "x86" in the pkg scheme with i386/amd64, but then you'd still be talking about i386:32, amd64:32 and amd64:64 instead of x86:32, x86:x32 and x86:64. From owner-svn-src-head@FreeBSD.ORG Mon May 26 14:39:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2935E107; Mon, 26 May 2014 14:39:47 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 7301F2978; Mon, 26 May 2014 14:39:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 8EC0138056; Mon, 26 May 2014 09:39:45 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id WoXjiXshSXcc; Mon, 26 May 2014 09:39:45 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 8728138051; Mon, 26 May 2014 09:39:44 -0500 (CDT) Message-ID: <5383522F.30108@freebsd.org> Date: Mon, 26 May 2014 07:39:43 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Tijl Coosemans , Warner Losh Subject: Re: svn commit: r266553 - head/release/scripts References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> <5380EBA8.1030200@freebsd.org> <20140525011307.142b41ab@kalimero.tijl.coosemans.org> <3CCAFAD3-FABE-40EF-ABF9-815FE5826349@bsdimp.com> <9FE34CE4-C71F-4806-9EF6-30CB1051C62F@bsdimp.com> <20140526113502.239db74d@kalimero.tijl.coosemans.org> In-Reply-To: <20140526113502.239db74d@kalimero.tijl.coosemans.org> Content-Type: text/plain; charset=ISO-8859-7; format=flowed Content-Transfer-Encoding: 8bit Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 14:39:47 -0000 On 05/26/14 02:35, Tijl Coosemans wrote: > On Sat, 24 May 2014 19:00:18 -0600 Warner Losh wrote: >> On May 24, 2014, at 5:53 PM, Warner Losh wrote: >>> On May 24, 2014, at 5:13 PM, Tijl Coosemans wrote: >>>> There isn't necessarily any chroot environment. There's one kernel, >>>> two equally valid ABIs (ILP32 and LP64) and any binary like uname might >>>> use either of them. If uname -p returns a different result depending on >>>> which of these two ABIs it was compiled for that could be a problem for >>>> any script that uses it. >>> Well, it depends on what you want to do with the script, eh? If you want >>> to know the ABI of the native binary uname, that¢s one thing. But if you >>> want to know the supported ABIs, you are doing it wrong by using uname. >>> You should be using sysctl kern.supported_abi. That will tell you all the >>> ABIs that you can install packages for on this machine, which is what you >>> really want to know. So I¢m having trouble connecting the dots between >>> this and what you are saying here. >>> >>> I still am absolutely flabbergasted why the MACHINE_ARCH names aren¢t >>> necessary and sufficient for packaging. I¢ve yet to see any coherent >>> reason to not use them. >> Why do I care that they match? Good question. When I was doing FreeNAS, I >> looked at integrating pkgng into nanobsd. At the time this was quite >> difficult because every single architecture name was different between >> pkgng and MACHINE_ARCH. This would mean I¢d have to drag around a huge >> table to know how to translate one to the other (there was no simple regex >> either, and things like mipsn32 wouldn¢t have fit into the scheme at the >> time). I would very much like us to see us keep these names in sync and >> avoid large translation tables that are difficult to maintain. >> >> Now, do you need to get it from uname -p? No. If you want to parse elf >> files to get it, that¢s fine, so long as the names map directly to the >> MACHINE_ARCH names that we¢ve been using for years. They completely >> describe the universe of supported platforms. Are they perfect? No, around >> the edge there may be an odd-ball that¢s possible to build, but is >> unsupported and likely doesn¢t work at all. Have we learned from these >> mistakes? Yes. Anything that¢s actively supported has a proper name. This >> name is needed, btw, so that any machine can self-host, a nice feature of >> the /usr/src system. > ABI consists of the following elements: > > - OS > - OS ABI version (major version number in FreeBSD) > - instruction set > - programming model (ILP32 or LP64) > - byte order (little/big endian) > > These are almost orthogonal dimensions in the sense that almost any > combination is possible. (A combination that isn't possible is a > 32-bit instruction set with LP64.) > > What you are asking for now is to combine two dimensions into one and > combination in this case means multiplication so if you have 3 > instruction sets and 2 programming models, the combined dimension needs > 6 different values. You need to make the case for why you think this > is a good idea. For the past 20 years we got away with this because > on every installation of FreeBSD we only used one programming model at > a time. This is still the case for byte order of course. > > What I'm saying is to keep the option open for installations with > multiple programming models, where most binaries could use ILP32 and > only the ones that actually need a 64-bit address space use LP64. > You query the instruction set using uname and the programming models > using getconf. > > I suppose you could replace the "x86" in the pkg scheme with i386/amd64, > but then you'd still be talking about i386:32, amd64:32 and amd64:64 > instead of x86:32, x86:x32 and x86:64. > No. We support multiple "models" now and have for ten years. That's what MACHINE_ARCH is for: it defines the choice of the last three things you list above. Specifically, a shared value of MACHINE_ARCH guarantees and OS version guarantees, in FreeBSD-land, complete binary compatibility of executables. Kernels support multiple ones, in general (e.g. i386 binaries on amd64, powerpc binaries on powerpc64). They may support more in the future (x32 on amd64, potentially even cross-endian binaries). We have a nice flexible scheme in FreeBSD for supporting this. If you want to find out the list of the things the installed kernel can run, check the kern.supported_archs sysctl. Simple. These strings are just as expressive as the ones in pkg. They are the standard. They're what external build systems test against, what the src, doc, and ports trees use to define what to do universally. It's what users and code expect. The wheel we've had for 20 years is perfectly good -- why invent a new, incompatible one? -Nathan From owner-svn-src-head@FreeBSD.ORG Mon May 26 14:57:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B612BAE6; Mon, 26 May 2014 14:57:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A32B42B44; Mon, 26 May 2014 14:57:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4QEvl8K071516; Mon, 26 May 2014 14:57:47 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4QEvlXE071515; Mon, 26 May 2014 14:57:47 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405261457.s4QEvlXE071515@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 26 May 2014 14:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266690 - head/usr.bin/printf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 14:57:47 -0000 Author: pfg Date: Mon May 26 14:57:47 2014 New Revision: 266690 URL: http://svnweb.freebsd.org/changeset/base/266690 Log: printf(1): warn about incomplete uses n$ Reviewed by: jilles Obtained from: Illumos MFC after: 2 weeks Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Mon May 26 13:23:36 2014 (r266689) +++ head/usr.bin/printf/printf.c Mon May 26 14:57:47 2014 (r266690) @@ -244,11 +244,11 @@ printf_doformat(char *fmt, int *rval) /* save format argument */ fargv = gargv; } else { - fargv = NULL; + fargv = NULL; } /* skip to field width */ - while (strchr(skip1, *fmt) != NULL) { + while (*fmt && strchr(skip1, *fmt) != NULL) { *dptr++ = *fmt++; *dptr = 0; } @@ -259,12 +259,19 @@ printf_doformat(char *fmt, int *rval) l = strspn(fmt, digits); if ((l > 0) && (fmt[l] == '$')) { int idx = atoi(fmt); + if (fargv == NULL) { + warnx("incomplete use of n$"); + return (NULL); + } if (idx <= myargc) { gargv = &myargv[idx - 1]; } else { gargv = &myargv[myargc]; } fmt += l + 1; + } else if (fargv != NULL) { + warnx("incomplete use of n$"); + return (NULL); } if (getint(&fieldwidth)) @@ -296,12 +303,19 @@ printf_doformat(char *fmt, int *rval) l = strspn(fmt, digits); if ((l > 0) && (fmt[l] == '$')) { int idx = atoi(fmt); + if (fargv == NULL) { + warnx("incomplete use of n$"); + return (NULL); + } if (idx <= myargc) { gargv = &myargv[idx - 1]; } else { gargv = &myargv[myargc]; } fmt += l + 1; + } else if (fargv != NULL) { + warnx("incomplete use of n$"); + return (NULL); } if (getint(&precision)) From owner-svn-src-head@FreeBSD.ORG Mon May 26 15:08:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67CE3123; Mon, 26 May 2014 15:08:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 549222C53; Mon, 26 May 2014 15:08:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4QF8eBv078191; Mon, 26 May 2014 15:08:40 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4QF8ewQ078188; Mon, 26 May 2014 15:08:40 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405261508.s4QF8ewQ078188@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 26 May 2014 15:08:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266691 - head/usr.bin/printf/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 15:08:40 -0000 Author: pfg Date: Mon May 26 15:08:39 2014 New Revision: 266691 URL: http://svnweb.freebsd.org/changeset/base/266691 Log: printf(1): add tests for warn about incomplete uses n$ Submitted by: jilles MFC after: 2 weeks Added: head/usr.bin/printf/tests/regress.missingpos1.out (contents, props changed) Modified: head/usr.bin/printf/tests/regress.sh Added: head/usr.bin/printf/tests/regress.missingpos1.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/printf/tests/regress.missingpos1.out Mon May 26 15:08:39 2014 (r266691) @@ -0,0 +1 @@ +printf: incomplete use of n$ Modified: head/usr.bin/printf/tests/regress.sh ============================================================================== --- head/usr.bin/printf/tests/regress.sh Mon May 26 14:57:47 2014 (r266690) +++ head/usr.bin/printf/tests/regress.sh Mon May 26 15:08:39 2014 (r266691) @@ -19,5 +19,13 @@ REGRESSION_TEST('zero', `printf "%u%u\n" REGRESSION_TEST('zero', `printf "%d%d\n" 15') REGRESSION_TEST('zero', `printf "%d%u\n" 15') REGRESSION_TEST('zero', `printf "%u%d\n" 15') +REGRESSION_TEST(`missingpos1', `printf "%1\$*s" 1 1 2>&1') +REGRESSION_TEST(`missingpos1', `printf "%*1\$s" 1 1 2>&1') +REGRESSION_TEST(`missingpos1', `printf "%1\$*.*s" 1 1 1 2>&1') +REGRESSION_TEST(`missingpos1', `printf "%*1\$.*s" 1 1 1 2>&1') +REGRESSION_TEST(`missingpos1', `printf "%*.*1\$s" 1 1 1 2>&1') +REGRESSION_TEST(`missingpos1', `printf "%1\$*2\$.*s" 1 1 1 2>&1') +REGRESSION_TEST(`missingpos1', `printf "%*1\$.*2\$s" 1 1 1 2>&1') +REGRESSION_TEST(`missingpos1', `printf "%1\$*.*2\$s" 1 1 1 2>&1') REGRESSION_END() From owner-svn-src-head@FreeBSD.ORG Mon May 26 15:53:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EDFAECBB for ; Mon, 26 May 2014 15:53:52 +0000 (UTC) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8E3121AF for ; Mon, 26 May 2014 15:53:52 +0000 (UTC) Received: by mail-ie0-f182.google.com with SMTP id x19so443497ier.27 for ; Mon, 26 May 2014 08:53:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=i64PCHAqA1/MwLnjtKycQ7ENrGwOKEMZYwEMk8zFrXI=; b=UB4xij70jUVmHNGllSOVtRW+0tlNHdH3sWtrbj10p9yhUgLVvfW/LvpW/UTVLfHkkU TPD5gYvoB+YkbiFNoTo9skriR3KZK+3H073vlN16qOIYU7KoxAbATBbiGavvKWCAPvTa apU9QdZLIpd/YPWWpSAKXTDmAf87qXyZXHPID1Lc+G1YMklE2KTyt4lW6IR7+Kr0qYR6 yigBDfXAqptXZpJMCUzkkTwnVIGiUeQNUFb5wFrGx039SuEiacKJZA5+3UXGSOguP2pO YjNyqFShyEJov02outoebBl3pfRGB0t0IiQXJSPB6fDUt/WqJXbB3pupq7yXGtDasxb0 fRpA== X-Gm-Message-State: ALoCoQkLDelMyi6wP0vRNLB7lvpAZalVPUcoA9AKsbwsvWljdLiM1g1PTQA/ho8PyzuC39uyP89i X-Received: by 10.42.48.147 with SMTP id s19mr3403720icf.88.1401119625790; Mon, 26 May 2014 08:53:45 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id w5sm715182igk.9.2014.05.26.08.53.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 26 May 2014 08:53:45 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_7567707D-397E-4D83-8565-B4A06EA951E5"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266553 - head/release/scripts From: Warner Losh In-Reply-To: <5383522F.30108@freebsd.org> Date: Mon, 26 May 2014 09:53:57 -0600 Message-Id: References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> <5380EBA8.1030200@freebsd.org> <20140525011307.142b41ab@kalimero.tijl.coosemans.org> <3CCAFAD3-FABE-40EF-ABF9-815FE5826349@bsdimp.com> <9FE34CE4-C71F-4806-9EF6-30CB1051C62F@bsdimp.com> <20140526113502.239db74d@kalimero.tijl.coosemans.org> <5383522F.30108@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1878.2) Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , svn-src-head@freebsd.org, Tijl Coosemans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 15:53:53 -0000 --Apple-Mail=_7567707D-397E-4D83-8565-B4A06EA951E5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1253 On May 26, 2014, at 8:39 AM, Nathan Whitehorn = wrote: > On 05/26/14 02:35, Tijl Coosemans wrote: >> On Sat, 24 May 2014 19:00:18 -0600 Warner Losh wrote: >>> On May 24, 2014, at 5:53 PM, Warner Losh wrote: >>>> On May 24, 2014, at 5:13 PM, Tijl Coosemans = wrote: >>>>> There isn't necessarily any chroot environment. There's one = kernel, >>>>> two equally valid ABIs (ILP32 and LP64) and any binary like uname = might >>>>> use either of them. If uname -p returns a different result = depending on >>>>> which of these two ABIs it was compiled for that could be a = problem for >>>>> any script that uses it. >>>> Well, it depends on what you want to do with the script, eh? If you = want >>>> to know the ABI of the native binary uname, that=92s one thing. But = if you >>>> want to know the supported ABIs, you are doing it wrong by using = uname. >>>> You should be using sysctl kern.supported_abi. That will tell you = all the >>>> ABIs that you can install packages for on this machine, which is = what you >>>> really want to know. So I=92m having trouble connecting the dots = between >>>> this and what you are saying here. >>>>=20 >>>> I still am absolutely flabbergasted why the MACHINE_ARCH names = aren=92t >>>> necessary and sufficient for packaging. I=92ve yet to see any = coherent >>>> reason to not use them. >>> Why do I care that they match? Good question. When I was doing = FreeNAS, I >>> looked at integrating pkgng into nanobsd. At the time this was quite >>> difficult because every single architecture name was different = between >>> pkgng and MACHINE_ARCH. This would mean I=92d have to drag around a = huge >>> table to know how to translate one to the other (there was no simple = regex >>> either, and things like mipsn32 wouldn=92t have fit into the scheme = at the >>> time). I would very much like us to see us keep these names in sync = and >>> avoid large translation tables that are difficult to maintain. >>>=20 >>> Now, do you need to get it from uname -p? No. If you want to parse = elf >>> files to get it, that=92s fine, so long as the names map directly to = the >>> MACHINE_ARCH names that we=92ve been using for years. They = completely >>> describe the universe of supported platforms. Are they perfect? No, = around >>> the edge there may be an odd-ball that=92s possible to build, but is >>> unsupported and likely doesn=92t work at all. Have we learned from = these >>> mistakes? Yes. Anything that=92s actively supported has a proper = name. This >>> name is needed, btw, so that any machine can self-host, a nice = feature of >>> the /usr/src system. >> ABI consists of the following elements: >>=20 >> - OS >> - OS ABI version (major version number in FreeBSD) These two are encoded in FreeBSD and major version. There=92s no problem = encoding these in the package architecture string. They are easily = scriptable and totally obvious to FreeBSD users and pose no problems. = Nobody is opposed to these, and actually they are rather a good idea. >> - instruction set >> - programming model (ILP32 or LP64) >> - byte order (little/big endian) These three are encoded in MACHINE_ARCH and have been for quite some = time. And you forgot several things as well: register conventions, = calling conventions, stack alignment, struct alignment, pointer = conversion conventions, address space layout, page size constraints, = etc. There are simply far too many to try to break down like you are = trying to do. And that=92s even before we get into shared library = conventions... >> These are almost orthogonal dimensions in the sense that almost any >> combination is possible. (A combination that isn't possible is a >> 32-bit instruction set with LP64.) All of these items are encoded in MACHINE_ARACH and have been for at = least a decade. There=92s no new argument here. If they were actually = orthogonal, then that would be one thing. But they aren=92t. They are = all closely interrelated and we only support a vanishingly small number = of possible conventions. Combinatorically, it can be hundreds. = Practically, it is usually only a handful. >> What you are asking for now is to combine two dimensions into one and >> combination in this case means multiplication so if you have 3 >> instruction sets and 2 programming models, the combined dimension = needs >> 6 different values. You need to make the case for why you think this >> is a good idea. Because uanme has to be 6 different things so the right binaries are = built. It is really that simple. And we=92ve already made the case, and = have been using this convention for a very long time. It works. I=92m = not sure that the burden is on us to justify why a convention that=92s = been in use since FreeBSD 6 needs to not change. As weird as you might = think it is, it is a convention that our users understand. >> For the past 20 years we got away with this because >> on every installation of FreeBSD we only used one programming model = at >> a time. This is still the case for byte order of course. This isn=92t true. For the past 15 years we=92ve supported two = programming models on amd64 at the same time. For longer than that we=92ve= supported linux emulation on i386. The project has known about these = things for a long long time, and has settled on MACHINE_ARCH to = represent all possible builds. We=92ve had mixed MIPS for about a = decade, though the support has varied in quality and execution. We = learned that TARGET_BIG_ENDIAN was bad, really bad, and we had to have a = separate name for each ABI we supported with no external info apart from = that name. We could have easily picked the convention you are proposing = here, but we didn=92t. We picked another one. Also, the =93for the past 20 years=94 argument cuts both ways. Look at = NetBSD. There, they have the same convention we have here of having a = separate MACHINE_ARCH for each ABI. They have been even more successful = at it that we have, and have avoided the pitfalls of TARGET_BIG_ENDIAN = much better than we have. pkgsrc ties nicely into that. so for 20 years = people have successfully used the current model, not just in FreeBSD, = but also elsewhere. >> What I'm saying is to keep the option open for installations with >> multiple programming models, where most binaries could use ILP32 and >> only the ones that actually need a 64-bit address space use LP64. >> You query the instruction set using uname and the programming models >> using getconf. What I=92m saying is I don=92t see any benefit at all to our users to = having an additional, arbitrary sting they have to deal with. There=92s = actually quite a few other details that you need to know before you can = even call getconf. >> I suppose you could replace the "x86" in the pkg scheme with = i386/amd64, >> but then you'd still be talking about i386:32, amd64:32 and amd64:64 >> instead of x86:32, x86:x32 and x86:64. I suppose you could replace these by =93i386=94, =93x32=94 (or = =93amd64x32=94) and =93amd64=94 respectively. Just like we did with = mips. As a users, how the heck am I to know what all these strange = strings map to? I have an amd64 machine, what package do I install? = x86:64 WTF is up with that? How am I supposed to message that to users? = How am I supposed to write a sane script that ties together packages and = base system when there are two different systems to describe the same = thing? I=92ve yet to see any benefit that is so huge that it trumps the = ease of use for our users and the eases of script writing for the = nanobsd and crochets of the world. >=20 > No. We support multiple "models" now and have for ten years. That's = what MACHINE_ARCH is for: it defines the choice of the last three things = you list above. Specifically, a shared value of MACHINE_ARCH guarantees = and OS version guarantees, in FreeBSD-land, complete binary = compatibility of executables. Kernels support multiple ones, in general = (e.g. i386 binaries on amd64, powerpc binaries on powerpc64). They may = support more in the future (x32 on amd64, potentially even cross-endian = binaries). We have a nice flexible scheme in FreeBSD for supporting = this. If you want to find out the list of the things the installed = kernel can run, check the kern.supported_archs sysctl. Simple. Don=92t forget we=92ve supported linux emulation for 18 years, and let=92s= not forget about IBCS and SYSV emulation, present from the very start = as well. If we look historically at BSD, I know that BSD4.2 on the VAXen = ran pdp11 binaries, which pushes back the time horizon another 10 years. > These strings are just as expressive as the ones in pkg. They are the = standard. They're what external build systems test against, what the = src, doc, and ports trees use to define what to do universally. It's = what users and code expect. The wheel we've had for 20 years is = perfectly good -- why invent a new, incompatible one? Exactly. What is the huge benefit that justifies the huge pain this is = going to cause? The FreeBSD project already has some pain because it = chose amd64 as its arch name (spread through about 2 dozen makefiles in = the base that do s/amd64/x86_64/ in places. Do you want to multiply this = times 6 architectures with arbitrary and difficult to explain = differences to our users? So rather than a repetition of the arguments that aren=92t very strong, = and certainly don=92t come close to justifying the extra pain our users = will feel, perhaps an argument for that future pain would be useful. Warner --Apple-Mail=_7567707D-397E-4D83-8565-B4A06EA951E5 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTg2OVAAoJEGwc0Sh9sBEA3A4QAM5XIi3nUSbfmpfSWniQbR6v qv4c9GKyv6UhRRVccXd6QGpfcS+beRpwqIi/LKhmFzkQQTfTG15Ao5mTKLlZqUTw fvb4IA4XdKoSuSqxJ0OwYPeXGdO4nYfMnbcBiP1QOWi7ZjGW4roC4fvaRClLRo59 y9ajXzRuB6yoFfphWNOSjFfCkVdEa22O+XLEhiCS8HB4/qZzyXuwnX8usIoeWFLM 4FKdBWEYxmO3UWv9HoZWFoU7LCWcgXxklVTlaVJKkh3JJUKssJNnRe7MFW9VG2qx eTuTXN0qq6IKnbLNzXnY3eiGV23TAlVDi1Nxxfs0poRPcSVWmP9SMN4sUvJ4pj8r CjAHF4MnPA94CUp0xRH6xiIl1vaqYkwr/NwiD9CEa6XrcywBvQ1vIjdqZBk+cZ+p uTvKlB/RSEwsF+9q75soLG3wcu2Bj6o2E/A18nJGOWMsiIsNG23wtfA5xaZKFvM0 bXCs6rWPXe2ZxTFZa98sQpddrB+00kMtTB3RsW5d2LBlaVJUe3ofUCmA8c5X4Mcz mYdtCAu9vBhkP5Y4LgKQaQGJxlwfr/CqhTT/67hNsLxCUd6Zwcs9scPjfUPDK6np 5MNRyDoSpCvhptG8Sxp4RayjvrQDWlDgP7bgKLYbACz3aKssuhDKt/oU+hkC+QT3 Dg6D88yAPgak5hfp0xTh =rcPk -----END PGP SIGNATURE----- --Apple-Mail=_7567707D-397E-4D83-8565-B4A06EA951E5-- From owner-svn-src-head@FreeBSD.ORG Mon May 26 15:54:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0BD93E18; Mon, 26 May 2014 15:54:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED4D121C4; Mon, 26 May 2014 15:54:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4QFsVH8011526; Mon, 26 May 2014 15:54:31 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4QFsVsH011525; Mon, 26 May 2014 15:54:31 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201405261554.s4QFsVsH011525@svn.freebsd.org> From: Gregory Neil Shapiro Date: Mon, 26 May 2014 15:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266702 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 15:54:32 -0000 Author: gshapiro Date: Mon May 26 15:54:31 2014 New Revision: 266702 URL: http://svnweb.freebsd.org/changeset/base/266702 Log: Note proper revision number for sendmail 8.14.9 merge. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon May 26 15:53:24 2014 (r266701) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon May 26 15:54:31 2014 (r266702) @@ -346,7 +346,7 @@ &man.jemalloc.3; has been updated to version 3.5.0. - Sendmail + Sendmail has been updated from 8.14.7 to 8.14.9. bmake has been From owner-svn-src-head@FreeBSD.ORG Mon May 26 18:02:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E708BDC2; Mon, 26 May 2014 18:02:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8DC22C81; Mon, 26 May 2014 18:02:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4QI2aF8085433; Mon, 26 May 2014 18:02:36 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4QI2a30085432; Mon, 26 May 2014 18:02:36 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201405261802.s4QI2a30085432@svn.freebsd.org> From: Andrew Turner Date: Mon, 26 May 2014 18:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266707 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 18:02:37 -0000 Author: andrew Date: Mon May 26 18:02:36 2014 New Revision: 266707 URL: http://svnweb.freebsd.org/changeset/base/266707 Log: Rework the Ti GPIO driver to work on multiple SoCs. At the moment it could work with OMAP4 and AM335x without needing to recompile. Reviewed by: loos Modified: head/sys/arm/ti/ti_gpio.c Modified: head/sys/arm/ti/ti_gpio.c ============================================================================== --- head/sys/arm/ti/ti_gpio.c Mon May 26 17:06:56 2014 (r266706) +++ head/sys/arm/ti/ti_gpio.c Mon May 26 18:02:36 2014 (r266707) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -130,24 +131,102 @@ __FBSDID("$FreeBSD$"); #endif /* Other SoC Specific definitions */ -#if defined(SOC_OMAP3) -#define MAX_GPIO_BANKS 6 -#define FIRST_GPIO_BANK 1 -#define INTR_PER_BANK 1 -#define TI_GPIO_REV 0x00000025 -#elif defined(SOC_OMAP4) +#define OMAP3_MAX_GPIO_BANKS 6 +#define OMAP3_FIRST_GPIO_BANK 1 +#define OMAP3_INTR_PER_BANK 1 +#define OMAP3_GPIO_REV 0x00000025 +#define OMAP4_MAX_GPIO_BANKS 6 +#define OMAP4_FIRST_GPIO_BANK 1 +#define OMAP4_INTR_PER_BANK 1 +#define OMAP4_GPIO_REV 0x50600801 +#define AM335X_MAX_GPIO_BANKS 4 +#define AM335X_FIRST_GPIO_BANK 0 +#define AM335X_INTR_PER_BANK 2 +#define AM335X_GPIO_REV 0x50600801 +#define PINS_PER_BANK 32 #define MAX_GPIO_BANKS 6 -#define FIRST_GPIO_BANK 1 -#define INTR_PER_BANK 1 -#define TI_GPIO_REV 0x50600801 -#elif defined(SOC_TI_AM335X) -#define MAX_GPIO_BANKS 4 -#define FIRST_GPIO_BANK 0 -#define INTR_PER_BANK 2 -#define TI_GPIO_REV 0x50600801 +/* Maximum GPIOS possible, max of *_MAX_GPIO_BANKS * *_INTR_PER_BANK */ +#define MAX_GPIO_INTRS 8 + +static u_int +ti_max_gpio_banks(void) +{ + switch(ti_chip()) { +#ifdef SOC_OMAP3 + case CHIP_OMAP_3: + return (OMAP3_MAX_GPIO_BANKS); #endif -#define PINS_PER_BANK 32 -#define MAX_GPIO_INTRS MAX_GPIO_BANKS * INTR_PER_BANK +#ifdef SOC_OMAP4 + case CHIP_OMAP_4: + return (OMAP4_MAX_GPIO_BANKS); +#endif +#ifdef SOC_TI_AM335X + case CHIP_AM335X: + return (AM335X_MAX_GPIO_BANKS); +#endif + } + return (0); +} + +static u_int +ti_max_gpio_intrs(void) +{ + switch(ti_chip()) { +#ifdef SOC_OMAP3 + case CHIP_OMAP_3: + return (OMAP3_MAX_GPIO_BANKS * OMAP3_INTR_PER_BANK); +#endif +#ifdef SOC_OMAP4 + case CHIP_OMAP_4: + return (OMAP4_MAX_GPIO_BANKS * OMAP4_INTR_PER_BANK); +#endif +#ifdef SOC_TI_AM335X + case CHIP_AM335X: + return (AM335X_MAX_GPIO_BANKS * AM335X_INTR_PER_BANK); +#endif + } + return (0); +} + +static u_int +ti_first_gpio_bank(void) +{ + switch(ti_chip()) { +#ifdef SOC_OMAP3 + case CHIP_OMAP_3: + return (OMAP3_FIRST_GPIO_BANK); +#endif +#ifdef SOC_OMAP4 + case CHIP_OMAP_4: + return (OMAP4_FIRST_GPIO_BANK); +#endif +#ifdef SOC_TI_AM335X + case CHIP_AM335X: + return (AM335X_FIRST_GPIO_BANK); +#endif + } + return (0); +} + +static uint32_t +ti_gpio_rev(void) +{ + switch(ti_chip()) { +#ifdef SOC_OMAP3 + case CHIP_OMAP_3: + return (OMAP3_GPIO_REV); +#endif +#ifdef SOC_OMAP4 + case CHIP_OMAP_4: + return (OMAP4_GPIO_REV); +#endif +#ifdef SOC_TI_AM335X + case CHIP_AM335X: + return (AM335X_GPIO_REV); +#endif + } + return (0); +} /** * ti_gpio_mem_spec - Resource specification used when allocating resources @@ -301,7 +380,7 @@ ti_gpio_pin_max(device_t dev, int *maxpi /* Calculate how many valid banks we have and then multiply that by 32 to * give use the total number of pins. */ - for (i = 0; i < MAX_GPIO_BANKS; i++) { + for (i = 0; i < ti_max_gpio_banks(); i++) { if (sc->sc_mem_res[i] != NULL) banks++; } @@ -340,7 +419,7 @@ ti_gpio_pin_getcaps(device_t dev, uint32 TI_GPIO_LOCK(sc); /* Sanity check the pin number is valid */ - if ((bank >= MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { + if ((bank >= ti_max_gpio_banks()) || (sc->sc_mem_res[bank] == NULL)) { TI_GPIO_UNLOCK(sc); return (EINVAL); } @@ -378,7 +457,7 @@ ti_gpio_pin_getflags(device_t dev, uint3 TI_GPIO_LOCK(sc); /* Sanity check the pin number is valid */ - if ((bank >= MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { + if ((bank >= ti_max_gpio_banks()) || (sc->sc_mem_res[bank] == NULL)) { TI_GPIO_UNLOCK(sc); return (EINVAL); } @@ -415,7 +494,7 @@ ti_gpio_pin_getname(device_t dev, uint32 TI_GPIO_LOCK(sc); /* Sanity check the pin number is valid */ - if ((bank >= MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { + if ((bank >= ti_max_gpio_banks()) || (sc->sc_mem_res[bank] == NULL)) { TI_GPIO_UNLOCK(sc); return (EINVAL); } @@ -469,7 +548,7 @@ ti_gpio_pin_setflags(device_t dev, uint3 TI_GPIO_LOCK(sc); /* Sanity check the pin number is valid */ - if ((bank >= MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { + if ((bank >= ti_max_gpio_banks()) || (sc->sc_mem_res[bank] == NULL)) { TI_GPIO_UNLOCK(sc); return (EINVAL); } @@ -517,7 +596,7 @@ ti_gpio_pin_set(device_t dev, uint32_t p TI_GPIO_LOCK(sc); /* Sanity check the pin number is valid */ - if ((bank >= MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { + if ((bank >= ti_max_gpio_banks()) || (sc->sc_mem_res[bank] == NULL)) { TI_GPIO_UNLOCK(sc); return (EINVAL); } @@ -556,7 +635,7 @@ ti_gpio_pin_get(device_t dev, uint32_t p TI_GPIO_LOCK(sc); /* Sanity check the pin number is valid */ - if ((bank >= MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { + if ((bank >= ti_max_gpio_banks()) || (sc->sc_mem_res[bank] == NULL)) { TI_GPIO_UNLOCK(sc); return (EINVAL); } @@ -598,7 +677,7 @@ ti_gpio_pin_toggle(device_t dev, uint32_ TI_GPIO_LOCK(sc); /* Sanity check the pin number is valid */ - if ((bank >= MAX_GPIO_BANKS) || (sc->sc_mem_res[bank] == NULL)) { + if ((bank >= ti_max_gpio_banks()) || (sc->sc_mem_res[bank] == NULL)) { TI_GPIO_UNLOCK(sc); return (EINVAL); } @@ -669,7 +748,7 @@ ti_gpio_attach_intr(device_t dev) struct ti_gpio_softc *sc; sc = device_get_softc(dev); - for (i = 0; i < MAX_GPIO_INTRS; i++) { + for (i = 0; i < ti_max_gpio_intrs(); i++) { if (sc->sc_irq_res[i] == NULL) break; @@ -696,7 +775,7 @@ ti_gpio_detach_intr(device_t dev) /* Teardown our interrupt handlers. */ sc = device_get_softc(dev); - for (i = 0; i < MAX_GPIO_INTRS; i++) { + for (i = 0; i < ti_max_gpio_intrs(); i++) { if (sc->sc_irq_res[i] == NULL) break; @@ -719,7 +798,7 @@ ti_gpio_bank_init(device_t dev, int bank sc = device_get_softc(dev); /* Enable the interface and functional clocks for the module. */ - ti_prcm_clk_enable(GPIO0_CLK + FIRST_GPIO_BANK + bank); + ti_prcm_clk_enable(GPIO0_CLK + ti_first_gpio_bank() + bank); /* * Read the revision number of the module. TI don't publish the @@ -729,7 +808,7 @@ ti_gpio_bank_init(device_t dev, int bank sc->sc_revision[bank] = ti_gpio_read_4(sc, bank, TI_GPIO_REVISION); /* Check the revision. */ - if (sc->sc_revision[bank] != TI_GPIO_REV) { + if (sc->sc_revision[bank] != ti_gpio_rev()) { device_printf(dev, "Warning: could not determine the revision " "of %u GPIO module (revision:0x%08x)\n", bank, sc->sc_revision[bank]); @@ -806,7 +885,7 @@ ti_gpio_attach(device_t dev) * pins are configured which would result in less power used if the GPIO * pins weren't used ... */ - for (i = 0; i < MAX_GPIO_BANKS; i++) { + for (i = 0; i < ti_max_gpio_banks(); i++) { if (sc->sc_mem_res[i] != NULL) { /* Initialize the GPIO module. */ err = ti_gpio_bank_init(dev, i); @@ -850,7 +929,7 @@ ti_gpio_detach(device_t dev) KASSERT(mtx_initialized(&sc->sc_mtx), ("gpio mutex not initialized")); /* Disable all interrupts */ - for (i = 0; i < MAX_GPIO_BANKS; i++) { + for (i = 0; i < ti_max_gpio_banks(); i++) { if (sc->sc_mem_res[i] != NULL) ti_gpio_intr_clr(sc, i, 0xffffffff); } From owner-svn-src-head@FreeBSD.ORG Mon May 26 18:21:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2022455; Mon, 26 May 2014 18:21:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE60C2DCB; Mon, 26 May 2014 18:21:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4QIL9ip092685; Mon, 26 May 2014 18:21:09 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4QIL9Cs092682; Mon, 26 May 2014 18:21:09 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405261821.s4QIL9Cs092682@svn.freebsd.org> From: Neel Natu Date: Mon, 26 May 2014 18:21:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266708 - in head: lib/libvmmapi usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 18:21:10 -0000 Author: neel Date: Mon May 26 18:21:08 2014 New Revision: 266708 URL: http://svnweb.freebsd.org/changeset/base/266708 Log: Fix issue with restarting an "insb/insw/insl" instruction because of a page fault on the destination buffer. Prior to this change a page fault would be detected in vm_copyout(). This was done after the I/O port access was done. If the I/O port access had side-effects (e.g. reading the uart FIFO) then restarting the instruction would result in incorrect behavior. Fix this by validating the guest linear address before doing the I/O port emulation. If the validation results in a page fault exception being injected into the guest then the instruction can now be restarted without any side-effects. Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/usr.sbin/bhyve/inout.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Mon May 26 18:02:36 2014 (r266707) +++ head/lib/libvmmapi/vmmapi.c Mon May 26 18:21:08 2014 (r266708) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -940,7 +941,7 @@ vm_get_hpet_capabilities(struct vmctx *c } static int -vm_gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, +gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, uint64_t gla, int prot, int *fault, uint64_t *gpa) { struct vm_gla2gpa gg; @@ -965,18 +966,20 @@ vm_gla2gpa(struct vmctx *ctx, int vcpu, #endif int -vm_copyin(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint64_t gla, void *vp, size_t len) +vm_gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, + uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt) { - char *dst; - const char *src; uint64_t gpa; - int error, fault, n, off; + int error, fault, i, n, off; + + for (i = 0; i < iovcnt; i++) { + iov[i].iov_base = 0; + iov[i].iov_len = 0; + } - dst = vp; while (len) { - error = vm_gla2gpa(ctx, vcpu, paging, gla, PROT_READ, - &fault, &gpa); + assert(iovcnt > 0); + error = gla2gpa(ctx, vcpu, paging, gla, prot, &fault, &gpa); if (error) return (-1); if (fault) @@ -984,42 +987,59 @@ vm_copyin(struct vmctx *ctx, int vcpu, s off = gpa & PAGE_MASK; n = min(len, PAGE_SIZE - off); - src = vm_map_gpa(ctx, gpa, n); - bcopy(src, dst, n); + + iov->iov_base = (void *)gpa; + iov->iov_len = n; + iov++; + iovcnt--; gla += n; - dst += n; len -= n; } return (0); } -int -vm_copyout(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - const void *vp, uint64_t gla, size_t len) +void +vm_copyin(struct vmctx *ctx, int vcpu, struct iovec *iov, void *vp, size_t len) { - uint64_t gpa; + const char *src; char *dst; + uint64_t gpa; + size_t n; + + dst = vp; + while (len) { + assert(iov->iov_len); + gpa = (uint64_t)iov->iov_base; + n = min(len, iov->iov_len); + src = vm_map_gpa(ctx, gpa, n); + bcopy(src, dst, n); + + iov++; + dst += n; + len -= n; + } +} + +void +vm_copyout(struct vmctx *ctx, int vcpu, const void *vp, struct iovec *iov, + size_t len) +{ const char *src; - int error, fault, n, off; + char *dst; + uint64_t gpa; + size_t n; src = vp; while (len) { - error = vm_gla2gpa(ctx, vcpu, paging, gla, PROT_WRITE, - &fault, &gpa); - if (error) - return (-1); - if (fault) - return (1); - - off = gpa & PAGE_MASK; - n = min(len, PAGE_SIZE - off); + assert(iov->iov_len); + gpa = (uint64_t)iov->iov_base; + n = min(len, iov->iov_len); dst = vm_map_gpa(ctx, gpa, n); bcopy(src, dst, n); - gla += n; + iov++; src += n; len -= n; } - return (0); } Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Mon May 26 18:02:36 2014 (r266707) +++ head/lib/libvmmapi/vmmapi.h Mon May 26 18:21:08 2014 (r266708) @@ -29,6 +29,7 @@ #ifndef _VMMAPI_H_ #define _VMMAPI_H_ +struct iovec; struct vmctx; enum x2apic_state; @@ -109,10 +110,17 @@ int vm_set_x2apic_state(struct vmctx *ct int vm_get_hpet_capabilities(struct vmctx *ctx, uint32_t *capabilities); -int vm_copyin(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - uint64_t gla_src, void *dst, size_t len); -int vm_copyout(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, - const void *src, uint64_t gla_dst, size_t len); +/* + * Translate the GLA range [gla,gla+len) into GPA segments in 'iov'. + * The 'iovcnt' should be big enough to accomodate all GPA segments. + * Returns 0 on success, 1 on a guest fault condition and -1 otherwise. + */ +int vm_gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, + uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt); +void vm_copyin(struct vmctx *ctx, int vcpu, struct iovec *guest_iov, + void *host_dst, size_t len); +void vm_copyout(struct vmctx *ctx, int vcpu, const void *host_src, + struct iovec *guest_iov, size_t len); /* Reset vcpu register state */ int vcpu_reset(struct vmctx *ctx, int vcpu); Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Mon May 26 18:02:36 2014 (r266707) +++ head/usr.sbin/bhyve/inout.c Mon May 26 18:21:08 2014 (r266708) @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include @@ -109,6 +111,7 @@ emulate_inout(struct vmctx *ctx, int vcp enum vm_reg_name idxreg; uint64_t gla, index, count; struct vm_inout_str *vis; + struct iovec iov[2]; bytes = vmexit->u.inout.bytes; in = vmexit->u.inout.in; @@ -157,6 +160,15 @@ emulate_inout(struct vmctx *ctx, int vcp return (INOUT_RESTART); } + error = vm_gla2gpa(ctx, vcpu, &vis->paging, gla, bytes, + in ? PROT_WRITE : PROT_READ, iov, nitems(iov)); + assert(error == 0 || error == 1 || error == -1); + if (error) { + retval = (error == 1) ? INOUT_RESTART : + INOUT_ERROR; + break; + } + if (vie_alignment_check(vis->paging.cpl, bytes, vis->cr0, vis->rflags, gla)) { error = vm_inject_exception2(ctx, vcpu, @@ -165,33 +177,16 @@ emulate_inout(struct vmctx *ctx, int vcp return (INOUT_RESTART); } - val = 0; - if (!in) { - error = vm_copyin(ctx, vcpu, &vis->paging, - gla, &val, bytes); - assert(error == 0 || error == 1 || error == -1); - if (error) { - retval = (error == 1) ? INOUT_RESTART : - INOUT_ERROR; - break; - } - } + if (!in) + vm_copyin(ctx, vcpu, iov, &val, bytes); retval = handler(ctx, vcpu, in, port, bytes, &val, arg); if (retval != 0) break; - if (in) { - error = vm_copyout(ctx, vcpu, &vis->paging, - &val, gla, bytes); - assert(error == 0 || error == 1 || error == -1); - if (error) { - retval = (error == 1) ? INOUT_RESTART : - INOUT_ERROR; - break; - } - } + if (in) + vm_copyout(ctx, vcpu, &val, iov, bytes); /* Update index */ if (vis->rflags & PSL_D) From owner-svn-src-head@FreeBSD.ORG Mon May 26 19:02:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D8E1D9; Mon, 26 May 2014 19:02:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2791217F; Mon, 26 May 2014 19:02:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4QJ2Yc1013443; Mon, 26 May 2014 19:02:34 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4QJ2Yk5013442; Mon, 26 May 2014 19:02:34 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405261902.s4QJ2Yk5013442@svn.freebsd.org> From: Christian Brueffer Date: Mon, 26 May 2014 19:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266709 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 19:02:35 -0000 Author: brueffer Date: Mon May 26 19:02:34 2014 New Revision: 266709 URL: http://svnweb.freebsd.org/changeset/base/266709 Log: Language cleanup. Reviewed by: mav, bcr, wblock MFC after: 1 week Modified: head/share/man/man4/attimer.4 Modified: head/share/man/man4/attimer.4 ============================================================================== --- head/share/man/man4/attimer.4 Mon May 26 18:21:08 2014 (r266708) +++ head/share/man/man4/attimer.4 Mon May 26 19:02:34 2014 (r266709) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 14, 2010 +.Dd May 26, 2014 .Dt ATTIMER 4 .Os .Sh NAME @@ -37,38 +37,48 @@ The following tunables are settable from .Xr loader 8 : .Bl -ohang .It Va hint.attimer. Ns Ar X Ns Va .clock -controls event timers functionality support. Setting to 0, disables it. -Default value is 1. +controls support for the event timer functionality. +Setting this value to +.Dv 0 +disables it. +The default value is +.Dv 1 . .It Va hint.attimer. Ns Ar X Ns Va .timecounter -controls time counter functionality support. Setting to 0, disables it. -Default value is 1. +controls support for the time counter functionality. +Setting this value to +.Dv 0 +disables it. +The default value is +.Dv 1 . .It Va hw.i8254.freq -allows to override default counter frequency. -The same value is also available in run-time via +allows overriding the default counter frequency. +The same value is also available at run-time via the .Va machdep.i8254_freq sysctl. .El .Sh DESCRIPTION This driver uses i8254 Programmable Interval Timer (AT Timer) hardware -to supply kernel with one time counter and one event timer, and generate -sound tones for system speaker. +to supply the kernel with one timecounter and one event timer, and to generate +sound tones for the system speaker. This hardware includes three channels. -Each channel includes 16bit counter, counting down with known, +Each channel includes a 16 bit counter which decreases with a known, platform-dependent frequency. Counters can operate in several different modes, including periodic and one-shot. -Output of each channel has platform-defined wiring: one channel is wired +The output of each channel has platform-defined wiring: one channel is wired to the interrupt controller and may be used as event timer, one channel is -wired to speaker and used to generate sound tones, and one timer is reserved +wired to the speaker and used to generate sound tones, and one timer is reserved for platform purposes. .Pp -Driver uses single hardware channel to provide both time counter and event +The +.Nm +driver uses a single hardware channel to provide both time counter and event timer functionality. -To make it possible, respective counter must be running in periodic more. -As result, one-shot event timer mode supported only when time counter +To make this possible, the respective counter must be running in periodic mode. +As a result, the one-shot event timer mode is supported only when time counter functionality is disabled. .Pp -Event timer provided by the driver is irrelevant to CPU power states. +The event timer provided by the driver is irrelevant to CPU power states. .Sh SEE ALSO .Xr apic 4 , .Xr atrtc 4 , From owner-svn-src-head@FreeBSD.ORG Mon May 26 20:03:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A94FC3AE; Mon, 26 May 2014 20:03:26 +0000 (UTC) Received: from mail-qc0-x232.google.com (mail-qc0-x232.google.com [IPv6:2607:f8b0:400d:c01::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B1AF2663; Mon, 26 May 2014 20:03:26 +0000 (UTC) Received: by mail-qc0-f178.google.com with SMTP id l6so12548159qcy.37 for ; Mon, 26 May 2014 13:03:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=JUAXVPyUyF1eeo+i8HOQdMaQACPJmNQJfQOj9wONsEo=; b=ECv055j2EVXTy8QATD40xEsllJploYO0ObECj5mzJNtVngo0+kscggYyP8UQPyEvo1 QPXw22EFey5/8FQxBmN4ndTj+kygydX0PNHR767tNIPUvm/Qu3AGK9yaEqAx9h6MYqB5 GIAnXdpulai/Ch/WVSGYhZjgz+VrChpBJzSorJXWxMT49myQeLsTPvLt91LLAABxT1pm cve5Sg3TIY54CXHItqaRP/Bs042odb+4QPlTglVG8M59Pc4+dDDIlYt9kQNvL9gaB84D hyUgmOlGga44+stF89F0C7YfIESQuw5N/2JtcWMaDP8pGmJ/8cUm6drcCVoInZhwyBV2 bc5g== X-Received: by 10.140.42.165 with SMTP id c34mr33902773qga.40.1401134605174; Mon, 26 May 2014 13:03:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.94.69 with HTTP; Mon, 26 May 2014 13:03:05 -0700 (PDT) In-Reply-To: <201404250801.s3P81ME1008705@svn.freebsd.org> References: <201404250801.s3P81ME1008705@svn.freebsd.org> From: Buganini Date: Tue, 27 May 2014 04:03:05 +0800 Message-ID: Subject: Re: svn commit: r264912 - in head: share/man/man4 sys/conf sys/contrib/dev/urtwn sys/dev/usb sys/dev/usb/wlan sys/modules/usb/urtwnfw sys/modules/usb/urtwnfw/urtwnrtl8188eu To: Kevin Lo Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 20:03:26 -0000 I think this accidentally removed URTWN_DEV(ASUS, USBN10NANO), 2014-04-25 16:01 GMT+08:00 Kevin Lo : > Author: kevlo > Date: Fri Apr 25 08:01:22 2014 > New Revision: 264912 > URL: http://svnweb.freebsd.org/changeset/base/264912 > > Log: > Add preliminary support for the Realtek RTL8188EUS and RTL8188ETV chipsets. > > Committed over the TP-LINK TL-WN725N v2 (RTL8188EUS) on amd64 with WPA. > > Added: > head/sys/contrib/dev/urtwn/urtwn-rtl8188eufw.fw.uu > head/sys/modules/usb/urtwnfw/urtwnrtl8188eu/ > head/sys/modules/usb/urtwnfw/urtwnrtl8188eu/Makefile (contents, props changed) > Modified: > head/share/man/man4/urtwn.4 > head/share/man/man4/urtwnfw.4 > head/sys/conf/files > head/sys/dev/usb/usbdevs > head/sys/dev/usb/wlan/if_urtwn.c > head/sys/dev/usb/wlan/if_urtwnreg.h > head/sys/modules/usb/urtwnfw/Makefile > > Modified: head/share/man/man4/urtwn.4 > ============================================================================== > --- head/share/man/man4/urtwn.4 Fri Apr 25 04:49:27 2014 (r264911) > +++ head/share/man/man4/urtwn.4 Fri Apr 25 08:01:22 2014 (r264912) > @@ -14,12 +14,12 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd October 31, 2013 > +.Dd April 25, 2014 > .Dt URTWN 4 > .Os > .Sh NAME > .Nm urtwn > -.Nd Realtek RTL8188CU/RTL8192CU USB IEEE 802.11b/g/n wireless network device > +.Nd Realtek RTL8188CU/RTL8188EU/RTL8192CU USB IEEE 802.11b/g/n wireless network device > .Sh SYNOPSIS > To compile this driver into the kernel, > place the following lines in your > @@ -50,11 +50,11 @@ legal.realtek.license_ack=1 > The > .Nm > driver supports USB 2.0 wireless network devices based on Realtek > -RTL8188CUS, RTL8188CE-VAU, RTL8188RU and RTL8192CU chipsets. > +RTL8188CUS, RTL8188CE-VAU, RTL8188EUS, RTL8188RU and RTL8192CU chipsets. > .Pp > -The RTL8188CUS is a highly integrated 802.11n adapter that combines > -a MAC, a 1T1R capable baseband and an RF in a single chip. > -It operates in the 2GHz spectrum only. > +The RTL8188CUS and RTL8188EUS are highly integrated 802.11n adapter that > +combine a MAC, a 1T1R capable baseband and an RF in a single chip. > +They operate in the 2GHz spectrum only. > The RTL8188RU is a high-power variant of the RTL8188CUS. > The RTL8188CE-VAU is a PCI Express Mini Card adapter that attaches > to the USB interface. > @@ -90,6 +90,8 @@ The following adapters should work: > .It Netgear WNA1000M > .It Realtek RTL8192CU > .It Realtek RTL8188CUS > +.It TP-LINK TL-WN723N v3 > +.It TP-LINK TL-WN725N v2 > .El > .Sh EXAMPLES > Join an existing BSS network (i.e., connect to an access point): > > Modified: head/share/man/man4/urtwnfw.4 > ============================================================================== > --- head/share/man/man4/urtwnfw.4 Fri Apr 25 04:49:27 2014 (r264911) > +++ head/share/man/man4/urtwnfw.4 Fri Apr 25 08:01:22 2014 (r264912) > @@ -22,7 +22,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd October 31, 2013 > +.Dd April 25, 2014 > .Dt URTWNFW 4 > .Os > .Sh NAME > @@ -42,6 +42,7 @@ of the following: > .Bd -ragged -offset indent > .Cd "device urtwn-rtl8192cfwT" > .Cd "device urtwn-rtl8192cfwU" > +.Cd "device urtwn-rtl8188eufw" > .Ed > .Pp > Alternatively, to load the driver as a > @@ -50,10 +51,11 @@ module at boot time, place the following > .Bd -literal -offset indent > urtwn-rtl8192cfwT_load="YES" > urtwn-rtl8192cfwU_load="YES" > +urtwn-rtl8188eufw_load="YES" > .Ed > .Sh DESCRIPTION > This module provides access to firmware sets for the > -Realtek RTL8188CUS, RTL8188CE-VAU, RTL8188RU and RTL8192CU > +Realtek RTL8188CUS, RTL8188CE-VAU, RTL8188EUS, RTL8188RU and RTL8192CU > chip based USB WiFi adapters. > It may be > statically linked into the kernel, or loaded as a module. > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Fri Apr 25 04:49:27 2014 (r264911) > +++ head/sys/conf/files Fri Apr 25 08:01:22 2014 (r264912) > @@ -2373,6 +2373,20 @@ dev/usb/wlan/if_upgt.c optional upgt > dev/usb/wlan/if_ural.c optional ural > dev/usb/wlan/if_urtw.c optional urtw > dev/usb/wlan/if_urtwn.c optional urtwn > +urtwn-rtl8188eufw.c optional urtwn-rtl8188eufw | urtwnfw \ > + compile-with "${AWK} -f $S/tools/fw_stub.awk urtwn-rtl8188eufw.fw:urtwn-rtl8188eufw:111 -murtwn-rtl8188eufw -c${.TARGET}" \ > + no-implicit-rule before-depend local \ > + clean "urtwn-rtl8188eufw.c" > +urtwn-rtl8188eufw.fwo optional urtwn-rtl8188eufw | urtwnfw \ > + dependency "urtwn-rtl8188eufw.fw" \ > + compile-with "${NORMAL_FWO}" \ > + no-implicit-rule \ > + clean "urtwn-rtl8188eufw.fwo" > +urtwn-rtl8188eufw.fw optional urtwn-rtl8188eufw | urtwnfw \ > + dependency "$S/contrib/dev/urtwn/urtwn-rtl8188eufw.fw.uu" \ > + compile-with "${NORMAL_FW}" \ > + no-obj no-implicit-rule \ > + clean "urtwn-rtl8188eufw.fw" > urtwn-rtl8192cfwT.c optional urtwn-rtl8192cfwT | urtwnfw \ > compile-with "${AWK} -f $S/tools/fw_stub.awk urtwn-rtl8192cfwT.fw:urtwn-rtl8192cfwT:111 -murtwn-rtl8192cfwT -c${.TARGET}" \ > no-implicit-rule before-depend local \ > > Added: head/sys/contrib/dev/urtwn/urtwn-rtl8188eufw.fw.uu > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/contrib/dev/urtwn/urtwn-rtl8188eufw.fw.uu Fri Apr 25 08:01:22 2014 (r264912) > @@ -0,0 +1,312 @@ > +begin 644 urtwn-rtl8188eufw.fw.uu > +MX8@0``L``0`!(1$G,#8``"T'```````````````````"14X````````````` > +M````````P6\````````````````````````````````````````````````` > +M````````````H>8````````"5O<````````````````````````````````` > +M```````````````````````````````````````````````````````````` > +M```````````````````````````````````````````````````````````` > +M```````````````````````````````````````````````````````````` > +M```````````````````````````````````````````````````````````` > +M```````````````````````````````````````````````````````````` > +M```````````````````````````````````````````````````````````` > +M```````````````````````````````````````````````````````````` > +M```````````````````````````````````````````````````````````` > +M```````````````````````````````````````````````````````````` > +M`````,*O@/XR$D($A=`+==`(JN#"C.6*)&?UBN6,-'GUC-*,["2)^.:\`P)T > +M_\.5@;1``$#.>01X@!;F"'`+PJ_F,.$#1!CVTJ\(V>WJB]`BY0S_(R2!^`\( > +M"+\$!'\`>('F,.3R`.4,PY]0(`4,=(@E#/CF_::!".:N#+X#`G3_S?CH;6#@ > +M".;`X(#VY0S3GT`GY0PDB?CFK@R^`P)T__T8YLWXY8%M8`;0X/88@/7E#"2( > +MR/85#(#3Y0PC)('X?P3"K^8PX`,0X@Q_`##A!S#C!'\(5/14?,;2KU2`0@ +M>(BF@70#8`;_"';_W_M_!.1X@/8(]@C?^GB!=C"01=YT`9/`X.23P.!#B0%U > +MBF!UC'G2C-*O(@/OTY0#0`-__R)T@2\O^.8@Y?3"K^9$,/;2KZX,[L.?4"$. > +M=(@N^.;Y".88O@,"=/_][6E@"0GG&1GW"0F`\Q86@-KNTY]`!`6!!8'NTY]` > +M(G2(+O@(YOGNM0P"J8$8!@;F_>UI8`D9&><)"?<9@/,>@-GO)(CXY@3X[R\$ > +MD$7>D_8([R^3]G\`(N_3E`-``W__(N\C)('XYC#E],*OYE2,]M*OY0RU!PIT > +MB"_XYO6!`D)-4"YTB2_XYK\#`G3__1CF^72(+_C[YOSI;&`(J`7G]AT9@/2H > +M`Z8%'^4,M0?C?P`B=(DO^.;]&(8!#W2(+_BF`0B&!.4,M0<"K('M;&`(#0FH > +M!>;W@/3E#+4'WHF!?P`B[].4`T`#?_\B[R,D@?C"K^8PY04PX`+2Y-+BQM*O > +M?P`PX@$/`D),C_#D__[E#",D@/C"J3#W#7\(YF`++?9@,%`N@` +M?@((,/`0PJ_F$. +MKU;&TJ]4@$__(L7P^*/@*/#%\/CE@A6"<`(5@^`X\"+O6__N6O[M6?WL6/PB > +M[TO_[DK^[4G][$C\(N#\H^#]H^#^H^#_(N+\".+]".+^".+_(N+[".+Y".+Z > +M".++^"+L\@CM\@CN\@CO\B*D)8+U@N7P-8/U@R+@^Z/@^J/@^2+K\*/J\*/I > +M\"+0@]""^.23 +MW>23H_CDDZ-``_:``?((W_2`*>23H_A4!R0,R,,SQ%0/1"#(@T`$]%:``4;V > +MW^2`"P$"!`@0($"`D$71Y'X!DV"\H_]4/S#E"50?_N23HV`!#L]4P"7@8*A` > +MN.23H_KDDZ/XY).CR,6"R,K%@\KPH\C%@LC*Q8/*W^G>YX"^`$&""0!!@@H` > +M08(7`%GB7"1>75^AP.#`\,"#P(+`T'70`,``P`'``L`#P`3`!<`&P`>0`<1T > +MYO!T1:/PT35TY@20`<3P=$6C\-`'T`;0!=`$T`/0`M`!T`#0T-""T(/0\-#@ > +M,I``5.!5-?4YH^!5-O4ZH^!5-_4[H^!5./4\K3E_5!(R'JTZ?U42,AZM.W]6 > +M$C(>K3Q_5Q(R'E.1[R+`X,#PP(/`@L#0==``P`#``<`"P`/`!,`%P`;`!Y`! > +MQ'1O\'1&H_`2;'CE03#D!'\"D2?E03#F`Q)LU>5#,.`#$E'"Y4,PX0,230SE > +M0S#B`Q),P>5#,.,#$FSBY4,PY`,2;03E0S#E`Q)M,^5#,.8"\0_E1##A`Q)1 > +M?W1O!)`!Q/!T1J/PT`?0!M`%T`30`]`"T`'0`-#0T(+0@]#PT.`RD(#>X+0! > +M$Y"!)^!@#9"!*^!4_O!4!W`"\2HBD($?X)"!*3#@!>#_`G2/X/]]`=,0KP'# > +MP-"0@A/M\)"!*N"0@A3PD($DX/[$$Q-4`S#@`P)(H.[$$Q,35`$PX`,"2*"0 > +M@A3@_F]P`P)(H.]P`P)(%R3^<`,"2%`D_F!1)/QP`P)(BR3\8`,"2*#NM`X# > +M$DE>D((4X'`%?P$229.0@A3@M`8#$DDTD((4X+0$#Y""$^#_8`42 +M)I""%.!D"&`#`DB@$G/3`DB@D((4X'`%?P$229.0@A3@M`8#$DDTD((4X+0. > +M"1)(I;\!`Q))7I""%.!D#&`"`:`1I>]D`6`"`:`1^@&@D((4X+0.!Q&EOP$" > +M,5Z0@A3@M`8",320@A3@M`P'$:6_`0(1^I""%.!D!'!<$G+U[V0!<%0QOH!0 > +MD((4X+0.!Q&EOP$",5Z0@A3@M`8",320@A3@M`P'$:6_`0(1^I""%.!P!'\! > +M,9.0@A3@M`0:$G.[@!60@A3@M`P.D($EX/\3$U0_,.`",;'0T)*O(M&K[V0! > +M8`B0`;AT`?"`/9"!).#_$Q,35!\PX`B0`;AT`O"`*._$5`\PX`B0`;AT!/"` > +M&9"!*>#3E`1`")`!N'0(\(`(D`&XY/!_`2*0`;ET`O!_`"*0@-[@9`%P,9"! > +M)>!4_?"0!2)T;_!_`?$-OP$2D($DX$2`\)"!*G0.\)"!(_`BD`&Y=`'PD`&X > +M!/`BD($EX)`&!"#@#.!$0/"0@2IT!/"`#N!4?_"0@2IT#/"0@2/PD`4BY/`B > +MD($EX,,3(.`(D($J=`SP@!Z0!@3@1$#PX$2`\)"!*G0$\)`%)^!$@/"0@2-T > +M!/"0!2+D\"*0@A7O\!)499""%>!@!9`%(N3PD($J=`3PD($C\"(QXY"!*G0( > +M\)"!(_`BD`4B=/_P\3J0`3=T`O#]?P-15S'CY)"!*O"0@2/P(I`%(G3_\/$Z > +MD(6[$B#:S/``P'^,?@@2+J*0A;L2(-H````4?W!^#A(NHI"!^1(@V@````#D > +M_?\251Q_?'X($BU<[$2`_)""!1(@SI""!1)$V9"%NQ(@SG]\?@@2+J*0`0!T > +M/_"CX%3]\)`%4^!$(/`BD`$T=$#P_>3_=#TO^.9-_O9T,"_U@N0T`?6#[O`B > +MTQ"O` +M[U3[3?^0@1_P[E0(_N]4]T[_\!(?I/Y4$/WO5.]-_Y"!'_#N5"#^[U3?3O`2 > +M'Z3#$R#@`F%>D($?X/\PX&V0@ +M(/"C\'U`_Y$FD($?X/T3$Q-4'S#@!Y"!R^!$$O#MQ%0/,.`'D('+X$04\)"! > +M'^#$$U0',.`'D('+X$2`\)"!R^"0!2?PD($BX&`"@1=_`8`5D('+=`'PD`4G > +M\)"!(N!D!&`"@1?_$E,.@1>0@1_@_R#@`F'GD('+=#'P[Q,35#\PX`M13I"! > +MR^!$"/"`!GU`Y/^1)I"!'^#]$Q,35!\PX`>0@ +M!/"0@ +M@$&0@2K@D($C\)`%)^!$0/"`,)"!RW0!\)`%)_"0@2/@M`(&?0%_!(`+D($C > +MX+0(!WT!?PP21SW1-)"!*1)'.1):I]#0DJ\B?0)_`I$F?0%_`G0]+_CF_NWT > +M7O[V=#`O]8+D-`'U@^[P(N]P-WUX?P*1)GT"?P.1)GW(?P(2<8^0`5?D\)`! > +M/'0"\'T!?PP21SV0@23@5/?P5._PD`8*X%3X\"*0`39T>/"C=`+P?7C_45=] > +M`G\#45>0!@K@1`?PD($RH^"0!5CPD(#>X+0!%9"!)>!4^_"0@2K@(.(.?0%_ > +M!`)'/9"!)>!$!/`BD($?X/\PX`B0@2/@9`)@.I"!)^!P!.\PX`J0@2K@9`)@ > +M*+&#D($EX!,3$U0?,.`4D($MX/^CX&]P"O'-D1R0@2[@%/"0`>;@!/`BD($? > +MX##@!I"!(70!\)"!)^!@19"!)>#_$Q,35!\PX!*0`3O@,.0+D1R0@2W@%)`% > +M<_"0@@OD=?`!$D2IPY""#."4@)"""^!D@)2`0`N0`9C@5/[PX$0!\!)U^-'6 > +MD($_X##@#.3U':/Q^Y`!5W0%\)`!ON`$\"*0@-[@9`%@`L$CD($GX'`"P2.0 > +M@2;@Q%0/9`%P(I`&J^"0@2[PD`:JX)"!+?"CX/]P")"!+>#^_X``D($N[_"0 > +M@27@1`3PY)"!,/"0@3*CX)`%6/"0`5?D\)`!/'0"\)"!*^!4_?!4[_"0@2;@ > +M_\14#R3]4`*`#Y"!'^`PX`42;?*``Q)NR9"!)>`3$Q-4'S#@#I"!+>#_H^"U > +M!P3QS9$BD($?X,,3(.`'D($EX$0$\"+1J^]P`M$\(I"!)^!D`7!FD($FX%0/ > +M8%&0@2K@<`/_,9.0@2K@9`Q@`Q)F)I`!6^3PD`$\=`3PT:OO9`%@..3U'9"! > +M.N##$U1_]1[D^_U_6'X!$E`%D`%;=`7PD`:2=`'PD($DX$0(\"*0@2K@<`=] > +M`7\$$D<](I`$&N#T8`-_`"*0!!O@5`=D!W\!8`)_`"(24&"0@2W@%)`%<_!] > +M`G\"45>0@4+@,.`MD(#>X+0!)I""%^`$\."T"@N0@43@!/#DD((7\)"!1.#_ > +MD(%#X+4'!>2C\/$+(N3_CU.0!!W@8!F0!2+@]59T__#Q.K\!`Q)T^Y`%(N56 > +M\(`#$G3[D`0?="#P?P$BY)""#_"C\)`%^.!P#Z/@<`NCX'`'H^!P`W\!(M.0 > +M@A#@E.B0@@_@E`-`"I`!P.!$(/!_`")_,GX`$C*JD((/Y'7P`1)$J8"_=!\M > +M]8+D-/SU@^!4/_#O8!UT(2WU@N0T_/6#X$00\'0?+?6"Y#3\]8/@1(#P(G0A > +M+?6"Y#3\]8/@5._P=!\M]8+D-/SU@^!$0/`B[Q20!7/PD`$_=!#P_7\#=$4O > +M^.9-_O9T."_U@N0T`?6#[O`BX$0"\.3U'9"!.>#U'N3[_7]4?@&.&8\:Y1Y4 > +M!\0S5."%&8.%&H+PY1U4!\0S5.#_Y1X3$Q-4'T^C\.M4!\0S5.#_Y1T3$Q-4 > +M'T^%&H*%&8.CH_"]`0R%&H*.@Z.CHW0#\"*%&H*%&8.CHZ-T`?`BY)"!3?"0 > +M@2?@8%B0@-[@9`%P4)"!303PY)"!+O"0@1_@,.`5D($CX+0"!>20@4WP,7/O > +M<`20@4WPD(%-X&`DD($KX$00\.3U'9"!+Q)/^Y`!5W0%\)"!*N`@X@=]`7\$ > +M$D<](N20@4SPD($GX'`"(7*0@-[@9`%@`B%RD($FX/_$5`]@(B3^8`,$<"&0 > +M@2[@%/#@_V`&D($PX&`1[W`(D($MX*/P@`"0@4QT`?"0@1_@,.`5D($CX+0" > +M!>20@4SP,7/O<`20@4SPD(%,X&!#D($KX$00\)"!,.!@`[0!">3U'9"!,."` > +M#>3U'9"!,.!U\`.D)/[_D($OX"\23_R0`5=T!?"0@2K@(.('?0%_!!)'/2*0 > +M!4/@?P`PYP)_`2*0@2?@<`>0@1_@,.`1D($?X##@!S%SOP$%05L23CPBTQ"O > +M` +M1`+PD`7\X`3PD($?X##@$*-T`?"0@1_@_\,3,.`",9X1Q)"!/^`PX`>199`% > +M(N3P(I"!'^#_,.`]D($CX'X`M`("?@&0@2+@?0"T!`)]`>U.<"/OPQ,PX`(A > +MGE%%D($CX+0(!N3]?PR`"9"!(^!P!OU_!!)'/2*0@1[@M`$/D($CX&0"8`=] > +M`7\"$D<]D($GX&0"8!20@2;@5`]@#!).J^]P!OU_#!)'/2*0@1_@_S#@/Y"! > +M(^!^`+0"`GX!D($BX'T`M`0"?0'M3G`E[\,3,.`"(9X2=*R0@2/@M`P&Y/U_ > +M"(`*D($CX+0$!N3]_Q)'/2+3$*\!P\#0D('+$D4?$A^D_Y"!'O"_`1*0@ +M11:0``$2'[UD`6`A@!V0@ > +MT-"2KR+3$*\!P\#0D($BX)""%O!O<`*!!.\48#X48&(4<`)AN!1P`F'?)`1@ > +M`H$$D((6X/^T!`2108$$[[0"!)%0@020@A;@_[0#!)%4@03O9`%@`H$$D4.! > +M!)""%N#_M`0$D?.!!.^T`@216($$D((6X/^T`P21Z($$[W!]D2N`>9""%N"T > +M!`42=&"`;9""%N"T`021(8!BD((6X+0#!1)T<8!6D((6X'!0D1^`3)""%N#_ > +MM`0%$G1,@#_OM`$$D32`-^^T`@21WX`OD((6X'`ID3*`)9""%N#_M`,%$G1[ > +M@!COM`$$D0N`$.^T`@2Q!H`(D((6X'`"D0G0T)*O(I$KD`4B=&_PD`4GX%2_ > +M\)"!(G0$\"*1*Q))W9"!(G0"\"*0@2)T`?`BD2N0!2)T__"0@2)T`_`BD?.0 > +M!2?@5+_PY)"!(O`BD5B`[Y'H@.N199`%(N3PD($B!/`BTQ"O`!$ > +M`O"0`0!T__"0!K=T"?"0!K1TAO!_?'X($BU<[%1__)""`1(@SI""`1)$V9"% > +MNQ(@SG]\?@@2+J*0A;L2(-K,P`#`?XQ^"!(NHI"%NQ(@V@#``!1_<'X.$BZB > +MD('Y$B#:``,^8.3]_[$ +MD`4GX$1`\)"!(G0!\"*199`%(G1O\)`%)^!4O_"0@2)T!/`BTQ"O` +MP`60@?D21-F0@>42(,[0!=`'$F#UT-"2KR*0@<@211_O$D4H57$`57H!58," > +M58L#590$59P@5:0A5:TC5;4D5;XE5< +M%@)E@9"!R!)%%D'`D('($D46`G78D('($D46@$20@<@211;!2Y"!R!)%%@)J > +M^)"!R!)%%N'AD('($D46`DILD('($D46`FL^D('($D46@#Z0@<@2118":TZ0 > +M`<#@1`'P(A):2Q(?I/]4`?Z0@47@5/Y.\._#$S#@%)```1(?O9"!1O"0``(2 > +M'[V0@4?P(A(?I/]4`?Z0@3_@5/Y.\)```1(?O?Z0!53@PYZ0@4#P[R#@!Y%E > +MD`4BY/"0@3_@5`&0`;SPD(%`X)`!O?`B$A^D_U1_D($G\._$$Q,35`&C\)`` > +M`1(?O?]4\,14#_Z0@2;@5/!.\)```Q(?O50!)>#^D($DX%3]3O#O5`_$5/#_ > +MD($FX%0/3_"0``02'[V0@2GPT<:0`;ET`?"0`;CPD($GX)`!NO"0@2G@D`&[ > +M\)"!)N!4#Y`!OO`BD('+$D4?$G*SD($GX/\23#Z0@2?@8!F0@ +M'[U4#_^0``(2'[W]$G+$(L#@P/#`@\""P-!UT`#``,`!P`+``\`$P`7`!L`' > +MD`'$=/?P=%:C\!)LI>5),.$#$F]YY4DPX@+QI>5),.,#$F^-Y4HPX`,2;\GE > +M2C#D`Q)P(N5+,.$"47CE2S#@`C'_Y4LPXP+QX.5,,.$%?P,21"?E3##D`Q). > +MQ.5,,.4#$G`XY4PPY@,2<,YT]P20`<3P=%:C\-`'T`;0!=`$T`/0`M`!T`#0 > +MT-""T(/0\-#@,I"!)^!@-)`&DN`PX"/D]1V0@3K@PQ-4?_4>Y/O]?UA^`1$% > +MD`%;=`7PD`:2=`'P(I"!).!4]_`21RHB(A(?I)"!,?`BD`'(Y/"C\*/P>P%Z > +M@7E1?__^$BLGOP$)D(%1X&0#8`,B`:ODD(%6\)"!5N#_PY0"0`(!YL-T_I__ > +MY)0`_GL!>H%Y4A(K)^]D`7!WD(%2X/]4P/Y@!>]4#'`6D(%2X/]4,&!G[U0# > +M8&*0@5-T`?"`!>20@5/PD(%3X)"!4G`6X/_N$Q-4/Y"!5/#O5`P3$U0_H_"` > +M#>#^5#"0@53P[E0#H_"0@53@9#!P5*/@9`)P3I``]>!40)"!5_#@<$&C=`+P > +M@!"0@5AT`?"`")"!5N`$\`$1D`'$=.GP=%>C\)"!6."0` +M@5/@D`'*\.3]?Q\2,AZ`U2*0`/?@(.<)X'\!(.8,?P(BD`#WX##F`G\#(A'G > +MD(`\[_`Q$Y`!9'0!\`(MIS&!,;$Q0#%?Y/4U]3;U-_4XK35_4!(R'JTV?U$2 > +M,AZM-W]2$C(>K3A_4P(R'G4]$.3U/G4_!W5``I`!,.4]\*/E/O"CY3_PH^5` > +M\")U10YU1@%#1A!U1P-U2&*0`3CE1?"CY4;PH^5'\*/E2/`BD`$PY/"C\*/P > +MH_"0`3CPH_"C\*/P_7]0$C(>Y/U_41(R'N3]?U(2,A[D_7]3`C(>D`$T=/_P > +MH_"C\*/PD`$\\*/PH_"C\/U_5!(R'GW_?U42,AY]_W]6$C(>??]_5P(R'I`` > +M@.!$@/U_@!(R'I#]`.!4O_`25^E1=Q(R=U')45Y_`1)#%9"!070"\/\20Q60 > +M@4'@!/!_`Q)#%9"!0>`$\#$!43^0`(#@1$#]?X`2,AYU(/]1:%'Y47_D_P)# > +MGE%B46]1IW%/48I1E9"!1>!4_O"C=`/PH_#DH_"C\"+D]4TBY)"`WO`B=>@# > +M=:B$(N20@-CPH_`BD`&4X$0!\"*0`>1T"_"C=`'P(I"!/^!4_O#DH_`BD(%" > +MX%3^\%1_\*-T"O#DH_`BD($?X%3^\%3]\%3[\%3W\%3O\%3?\.2C\*/PH_"C > +M=`SP(I`!`>!$!/"0`9QT?O"C=)+PHW2@\*-T)/"0`9MT2?"0`9ITX/"0`9GD > +M\)`!F`3P(N20@5'PH_"0`9C@?P`PY`)_`>]D`6`^PY"!4N"4B)"!4>"4$T`( > +MD`'!X$00\"*0@5'D=?`!$D2I?Q1^`!(RJM.0@5+@E#*0@5'@E`!`N9`!QN`P > +MX[(BY)"!)_"C\)"!)N!4#_!4\/"0@23@5/WP5/?P5._PD($M=`'PH_"0@23@ > +M5/OPH^!4^_#DD($P\)"!+W0'\)"!,N3PHW0"\.20@2OPD($DX%3^\)"!*70, > +M\)"!).!4W_"0@2IT#/"0@23@5+_P5'_PH^!4_O!4_?!4]_"0@302(-H````` > +MD(`\X+0!")"!,729\(`2D(`\X)"!,;0#!720\(`#=$#PD($X=`'PHW0%\*/@ > +M5`%$*/"C=`7PY*/PH^!4_?!4^_!4]_!4[_!4W_!4O_#DH_`BY)"!6?"0@5G@ > +M9`'P)"20`<3P=%RC\)"!*N#_D($IX&]@`Q)'*M$(OP$"D5^Q\A(RGK\!`K%G > +M$D)-@,K3$*\!P\#0D($DX##@))"!'^#_,.`:PQ,PX`>Q^[\!$H`*D($CX/]@ > +M`[0(!I&6@`*1IM#0DJ\BTQ"O` +M`>7@!/`BL?.0``C@5._]?P@2,A[D_X]0Y)"!6O"C\)`!">!_`##G`G\![V50 > +M8#[#D(%;X)2(D(%:X)030`B0`<#@1!#P(I"!6N1U\`$21*E_%'X`$C*JTY"! > +M6^"4,I"!6N"4`$"YD`'&X##@LB*0@3'@_7^3$C(>D($HX&`2D`$OX##G!700 > +M\(`&D`$O=)#PD``(X$00_7\($C(>?P&1RI``D.!$`?U_D!(R'G\4?@`",JK3 > +M$*\!P\#0$BVGY/52$C*>[V!S8U(!Y5(D9Y`!Q/!T7:/PD`"(X/50]5%4#V#? > +MY5`PX`L@Y`,2*<534>Z`/^50,.$6(.4.$A&][W`#0U$@D`$&Y/!34?V`).50 > +M,.(+(.8#$F<&4U'[@!3E4##C#R#G"1)A;N]P`T-1@%-1]ZU1?X@2,AZ`A]#0 > +MDJ\B(I``D.`@X/DBD($BX&0"?P%@`G\`(G\"D(%!X/[OPYY0&.\EX"2!^.8P > +MY`N0`;AT"/"C\'\`(@^`WG\!(I`"A^!@")`!N'0!\(`7D`*&X"#A")`!N'0$ > +M\(`(D`&XY/!_`2*0`;ET"/!_`"+D^_K]?P$21$Z0@;WO\&#PT7&`[-,0KP'# > +MP-"0` +M<`+AE9""">!U\`20`=`210K@D(&_\'43`744@745OW46`7L!>H%YP!(K[9"" > +M">!U\`20`=$210K@D('!\)""">!U\`20`=(210K@D('"\)""">!U\`20`=,2 > +M10K@D('#\)""">!U\`20`?`210K@D('$\)""">!U\`20`?$210K@D('%\)"" > +M">!U\`20`?(210K@D('&\)""">!U\`20`?,210K@D(''\)"!ON#_D(()X/YT > +M`:@&"(`"PS/8_/1?D(&^\)""">#_=`&H!PB``L,SV/R0` +M><$253^0@@G@!/#@5`/PP8*0`<#@1`+PT-"2KR+D^_K]?P$21$Z0@=#O\&#P > +M$FP9@.N0@=3O\*/M\*,2(-H`````Y)"!XO!_)'X($BU +M")"!VA)$V8`6ZW7P"*0D8O6"Y#2']8/@_J/@_Q(M7)"!WA(@SI"!U>#_Y/S] > +M_G@7$B"[J`2I!:H&JP>0@=X21-GM5'_][%2`_!)$S.Q$@/R0@=X2(,Z0@=H2 > +M1-GL5'_\D(6[$B#.?R1^"!(NHI"!U.!U\`BD)&+U@N0TA_6#X/ZCX/_`!L`' > +MD('>$D39D(6[$B#.T`?0!A(NHI"!VA)$V>Q$@/R0A;L2(,Y_)'X($BZBD('4 > +MX'`$?R"`"9"!U."T`19_*'X($BU<>`@2(*CO5`'_Y)"!XN_PD('BX)"!U&`. > +MX'7P"*0D9O6"Y#2'@`S@=?`(I"1D]8+D-(?U@^#^H^#_$BU<[50/_>3\D('6 > +M$B#.D('6`D39D('C[_"K!9"!Z1(@V@````"O`^3\_?YX%!(@NZ@$J06J!JL' > +MD('E$D39[50/_>3\$D3,[%0/_)"!Z1(@SI"!X^!U\`BD)&#U@N0TA_6#X/ZC > +MX/_`!L`'D('I$D39D(6[$B#.T`?0!@(NHM,0KP'#P-`27[;0T)*O(G@0=`'R > +MD`()X'@`\@AT(/(8XO\PX`4(XB2`\N_#$Y#]$/!X`>(D`/6"Y#3\]8/@>`/R > +M9`1@#>+_9`A@!^]D#&`"8=[D>`+R>`/B_QCBPY]0+>+]&.(MD(%:\.#_)`#U > +M@N0T_/6#X/YT!"WX[O+OM/\&D/T0X`3P>`+B!/*`R7@$XG@2\O]X!>)X$?)X > +M!N)X$_)X!^)X%/)X".)X,_)X">)X-/)X"N)X-?)X"^)X-O)X#.)X-_)X#>)X > +M./)X#N)X.?)X#^)X.O+D>!7R[R3X8'4D_&!L)`A@`F'`>!'BM`$%$BG%8<5X > +M$>*T`@42$;UAQ7@1XK0#!/$&8<5X$>*T$!=X%.+^&.+][?]X%N[R_@CO\O\2 > +M,JIAQ7@1XK01%W@4XOX8XOWM_W@6[O+^"._R_Q(R!F'%>!'B]&`"8<48\F'% > +M>!5T`?)X$>)D!V`"8:IX-.+_Y/S]_G@($B"[P`2I!:H&JP=X,^+_Y/S]_M`` > +M$D3,P`3`!<`&P`=X->+_Y/S]_G@0$B"[T`/0`M`!T``21,QX&!)$_G@5XG`" > +M89,8XO\8XOTQ7W@<$D3^>#CB_^3\_?YX"!(@N\`$J06J!JL'>#?B_^3\_?[0 > +M`!)$S,`$P`7`!L`'>#GB_^3\_?YX$!(@N]`#T`+0`=``$D3,>"`21/YX(!)$ > +MY1(@FW@<$D3Q$D2_P`3`!<`&P`=X&!)$Y7@@$D3Q$D2_T`/0`M`!T``21,QX > +M&!)$_G@8$D3ED('Y$B#.>!/B_0CB_Q)5'(`;>!/B_PCB_7@1XOMX%>*0@;SP > +M<>&`!7@0=`+R>!#B_\.4`E`0[V`*>`+B_QCB+_(AD'\!(G\`(JP'[:T$>"3R > +M[0CRZ[0$!W@G=`'R@`[K>">T!05T`O*``W0$\M-X)>*4_QCBE`!08^1X)O)X > +M)^+_&.+^PY]``J%_=#,N^.)X*/*0@;S@8"UT-R[XXG@R\N[_>"7B+_\8XC0` > +MCX+U@^!X*?)X,N+_]/YX*>)>_ACB_>]=3O)X)`CB_PCB+_]X*.+]$C(>>";B > +M!/*`H=-X)>*4_QCBE`=0:>1X)O)X)^+_&.+^PY]``J%_=#,N^.)X*/*0@;S@ > +M8"UX)N+__1CB+?T8XC0`C8+U@^!X*?)T-R_XXG@R\N+_]/YX*>)>_ACB_>]= > +M3O)X*.+_>";B_1CB+?T8XC0`C8+U@^_P>";B!/*`FY"!O.!@#W@DXOX(XO\2 > +M+5QX+A)$_N1X)O)X)^+_&.+^PY]0770S+OCB>"CRD(&\X&`K>"X21.5X)N+[ > +M=?`(I/GX$B"H>"GO\G0W*_CB>#+RXO[T7_]X*.+][EU/\G@HXO]X)N+]PW0# > +MG?WDE`#\>_YT*BWY=(`\^N\2'^KB!/*`F'@J$D3ED(6[$B#.>"3B_@CB_Q(N > +MHB(BD('+$D4?D``!$A^]__X2'Z3]PQ,PX!*0@ +M@<_O\)"!SN[PD('/X/Z0@<[@_].>4#B0@ +M[O!TWB_U@N0T@/6#X'`$T26`!Y"!SN#_L8"0@<[@!/"`NI"`WN!P))"!*N!P > +M!/\229.0@2K@9`Q@`M$FD($DX%3W\%3O\%2_\%1_\"(BD`8$X%1_\)`%(N3P > +MD($J=`SP(I"![>_PH^WPK0.L`N20@?7PH_"0`<1T.?!T9J/P[%0__)`!0.WP > +MK@3NH_"0@>W@)(%@-"3:8!PD/'!!D('NX,0S,S-4@)"!\O"C=&GPHW2`\(`L > +MD('NX%0!D('R\*-TI?"C=`'P@!B0@>[@Q%00D('R\*-T?_"C=!#P@`-_`"*0 > +M@?/@D`$&\)"!\N!@#I`!0O"0@?'@D`%#\(`-D`%#Y/"0@?+@D`%"\)"!].#_ > +MD`%"X%__D('RX&]@[G0Y!)`!Q/!T9J/PD`%#Y/!_`2+DD(%J\)"'7^"0@6GP > +MY)"!=O"0@6;PD(%FX/_#E$!0%71Y+_6"Y#2!]8-T__"0@6;@!/"`X>20@6;P > +MD(%IX/^0@6;@_L.?0`,":!)TWR[YY#2&=1,!]12)%746"GL!>H%Y6Q(K[9"! > +M7.#_$B\G[P20@7;PD(%;X/^CX/T2,>KO),B0@7CP=?`(I/"0@5S@5`^0@7?P > +MY)"!9?"0@6?PD(%GX/_#E`105Y"!=^#^J`<(@`+#$]C\(.`^D(%GX"7@_Y"! > +M>.`O)'GYY#2!^GL!P`/``9"!9>!U\`*D)%WY=($U\(L3]12)%746`M`!T`,2 > +M*^V0@67@!/"0@6?@!/"`GY"!=N#_D(%FX"_P`F=`Y)"!:O"0@6K@PY1`0`)! > +MK^#_)'GU@N0T@?6#X)"!;/#@_E3PQ%0/_9"!:_#N5`_^H_!T>B_U@N0T@?6# > +MX)"!;?#\[O[L^^O_D(%R[O"C[_#M$D4H:(L`:,(!:7,":J`#:8X$::\%::\& > +M::\'::\(:C,):FD*``!JKY"!:N#])'SU@N0T@?6#X/YT>RWU@N0T@?6#X/WM > +M_Y"!=.[P_*/O\)"!;>#_$B^6D(%H=`+P0:"0@6K@)'SU@N0T@?6#X/_D_/W^ > +M>`@2(+NH!*D%J@:K!Y"!:N`D>_6"Y#2!]8/@_^3\_?X21,S`!,`%P`;`!Y"! > +M:N`D??6"Y#2!]8/@_^3\_?YX$!(@N]`#T`+0`=``$D3,P`3`!<`&P`>0@6K@ > +M)'[U@N0T@?6#X/_D_/W^>!@2(+O0`]`"T`'0`!)$S)"!;A(@SI"!;A)$V9"% > +MEA(@SI"!_6"Y#2!]8/@^^3_ > +M$C#'@!F0@6W@_9"!:N`D>_6"Y#2!]8/@^^3_$C!JD(%H=`'P0:"0@6AT`O"0 > +M@6K@)'SU@N0T@?6#X/_D_/W^>`@2(+NH!*D%J@:K!Y"!:N`D>_6"Y#2!]8/@ > +M_^3\_?X21,S`!,`%P`;`!Y"!;.#_Y/S]_G@0$B"[T`/0`M`!T``21,R0@6X2 > +M(,Z0@6O@)/O_P`>0@6X21-F0@?D2(,Z0@6W@_=`'$E4<@&V0@6AT`?"0@6K@ > +M)'OYY#2!=1,!]12)%746`7O^>H!Y,Q(K[9"!;>#_D(%LX/WDD(&\\'L$@#20 > +M@6AT!/"0@6K@)'OYY#2!=1,!]12)%746!'O^>H!Y,Q(K[9"!;>#_D(%LX/WD > +MD(&\\'L&$F/AD(%HX"0"_Y"!:N`O\`$7(I`"">#]$A^D_J\%[2Z0@#WPD``! > +M$A^]_^TOD(`^\)```A(?O?_M+Y"`/_"0``,2'[W_[2^0@$#PD``$$A^]_ZX% > +M[2^0@$'P(I```A(?O?\PX"82'Z20@3CPD``!$A^]D($Y\.]4_O^CX%0!3_"0 > +M``,2'[V0@3OP(I"!.'0!\*-T!?"CX%0!1"CPHW0%\"(2'Z20@3[PD($^X)`! > +MY_`B$A^DD(%*\)```1(?O9"!2_`BTQ"O`[PH^_PY*/PH_"0@?W@ > +M_J/@]8*.@^!@+<.0@@#@E.B0@?_@E`-`"Y`!P.!$@/!_`(`5D('_Y'7P`1)$ > +MJ7\*?@`2,JJ`Q7\!T-"2KR+3$*\!P\#0D('1$D4?D((*X/\$\)```>\2'_Q_ > +MKWX!<6#O8#J0@=$211:+$XH4B160``X2'[TD`O46>P%Z`7F@$BOMD('1$D46 > +MD``.$A^]D`&N\*-T__"0` +MM08$?@&``GX`[F0!8#*0`:_@P%QMG\![V`6D(#8 > +MX`3PX'\`M`H"?P'O8`7DD(#8\-#0DJ\BCPTBCPXB(I`!-.!5/?5!H^!5/O5" > +MH^!5/_5#H^!50/5$D`$TY4'PH^5"\*/E0_"CY43P(I`!/.!51?5)H^!51O5* > +MH^!51_5+H^!52/5,D`$\Y4GPH^5*\*/E2_"CY4SP4Y'?(I"!'^`PX`7DH_"C > +M\"*0@-[@9`%P&9"!)^!@$Y`!5^3PD`$\=`(23_20`5=T!?`BD(#>X&0!<":0 > +M@2?@8""0`5?D\)`!/'0"\)"!).!4^_"0@2O@5/WP5`=P`Q)'*B*0@-[@M`$4 > +MD($GX&`.D($FX%0/9`)@`H`#T7\BD`0=X'`3D(`^X/_D_;%ICDZ/3Y`$'W0@ > +M\"+3$*\!P\#0D((.[?"0@@WO\.3]_/$W?`"M!Y""#>"0!"7PD((.X&`.=`\O > +M]8+D-/SU@^!$@/"O!70(+_6"Y#3\]8/D\'0)+_6"Y#3\]8/@5/#P="$M]8+D > +M-/SU@^!4]_"N!*\%T-"2KR*/3O%+OP$8D(!`X/]]`;%IK0>L!J].$D^"D`0? > +M="#P(I`&J>"0@4SPX/U4P'`)D($KX%3^\(!R[3#F2Y"!)^!D`G`JD($DX/_# > +M$R#@"9"!*^!$`?"`*)"!)N!4#V0!<"V0@2O@1`3P?P&QTH`@D($KX$0!\)"! > +M)N!4#V0"8`2Q3X`+T7^`!Y"!*^!4_O"0@4S@D($K,.<1$D_QD`%7=`7PD($D > +MX$0$\"+@5/WP(I`!7^3PD`$\=`CPY/4=D($ZX,,35'_U'N3[_7] +M`5]T!?"0!I)T`O"0@23@1!#PD($JX&0,8`SD_7\,$D<]Y/\23PTBY)"!3/"0 > +M!JG@D(%,\.!4P'`-D($KX%3^\%3]\`)'*I"!3.`PYB&0@2?@9`%P()"!*^!$ > +M`?"0@2;@5`]D`F`$L4^`"]%_@`>0@2O@5/[PD(%,X)"!*S#G$1)/\9`!5W0% > +M\)"!).!$!/`BX%3]\"+D_N_#$_WO,.`"?H"0_1#M\*\&(M,0KP'#P-"0!!W@ > +M8!J0!2+@5)!@!Y`!P.!$"/"0`<;@,.'D?P"``G\!T-"2KR*0@2?@8`,2<^&0 > +M@3_@,.`#$DG=(I"!)^!@-9`&DN`PX23D]1V0@3K@PQ-4?_4>Y/O]?UQ^`1)0 > +M!9`!7W0%\)`&DG0"\"*0@23@5._P$D_PD($D,.`&X$0!\(`$ > +MX%3^\)"!3>`PYA&0`2_@,.<$Y/"`!I`!+W2`\)"!).`PX!J0@3+D\*-T!_"0 > +M@3*CX)`%6/"0!.S@5-WP(I`$[.!$(O`BD(%*X&`/Y/"0!5/@1`'PD`7]X`3P > +M(I"!).#_Q!,35`,PX"?O5+_PD`3@X)"!)3#@!N!$`?"`$.!4_O"0`;ET`?"0 > +M`;AT!/`21RKD_Y"!1>`PX$B0@4G@_6!!=`%^`*@'"(`%PS/.,\[8^?^0!.#@ > +M^^];8`;DD(%)\"*0@4?@TYU0$)`!QW00\!&^D(%%X%3^\"(23PN0@4G@!/`B > +MD(`\X&0"8`>0!I#@1`'P(I"!).#_Q!,3$U0!,.`L[U1_\)`$X."0@24PX0;@ > +M1`+P@`_@5/WPD`&Y=`'PD`&X!/"0@2?@8`,21RI_`0%NP^Z4`4`*#>T3D/T0 > +M\.0O_R+#[I0!0"20_1'@;7`:D`$7X+4%#9`!Y'1W\)#]$>3P@`;M!)#]$?#D > +M+_\BY)"!3O"C\*/PD`"#X)"!3O"0`(/@_I"!3N#_M08!(L.0@5#@E&20@4_@ > +ME`!`#9`!P.!$0/"0@4[@_R*0@4_D=?`!$D2I@,)T12_XYO[M]%[^]G0X+_6" > +MY#0!]8/N\"+3$*\!P\#0D((2[?"0@A'O\-.4!U!PX/]T`:@'"(`"PS/8_/3_ > +MD`!'X%_]?T<2,AZ0@A'@_W0!J`<(@`+#,]C\_Y``1N!/_7]&$C(>D((2X&`8 > +MD((1X/]T`:@'"(`"PS/8_/^0`$7@3X`7D((1X/]T`:@'"(`"PS/8_/3_D`!% > +MX%_]?T6`?I""$>`D^/#@)`3_=`&H!PB``L,SV/ST_Y``0^!?_7]#$C(>D((1 > +MX/]T`:@'"(`"PS/8_/^0`$/@3_U_0Q(R'I""$N!@'9""$>`D!/]T`:@'"(`" > +MPS/8_/^0`$+@3_U_0H` +M'M#0DJ\BD($DX%3[\.20@3#PD($K\"+O)/Y@#`1P*)"!+70!\*/P(NUP"I"! > +M.^"0@2WP@`60@2WM\)"!+>"C\)"!)>!$"/`B$DZK[V0!8`B0`;AT`?"`9Y"! > +M*^#_5`-@")`!N'0"\(!6D($IX/[DPYY0")`!N'0$\(!$[S#B")`!N'0(\(`X > +MD($KX##D")`!N'00\(`ID($EX!,35#\@X`B0`;AT(/"`%I"!/N!@")`!N'2` > +M\(`(D`&XY/!_`2*0`;ET!/!_`"+O8$*0@-[@9`%P.I"!)>!4_O"0!2)T#_"0 > +M!@3@5+_PY/\23PV_`1*0@23@1$#PD($J=`;PD($C\"*0`;ET`?"0`;AT"/`B > +MD`4B=&_PD`4GX%2_\)"!*G0"\)"!(_`B$E1ED($J=`SPD($C\"*0@23@_Q,3 > +M5#\PX!'O5/OPD($KX%3]\%0'<$*`/9"!,.`$\)"!*^!4[_"0@3#@_[0!`H`$ > +M[[0"!I`%6.`$\)"!..#_D($PX-.?0`^0@-[@M`$+D($EX%3[\"(21RHB(I`% > +M*^!_`##G`G\!(I`%(G3_\)`%)^!$0/"0@2)T`_`BD`4GX$1`\!))W9"!(G0" > +M\"(22>.0@2)T`O`BD`4B=&_PD`4GX%2_\)"!(G0$\"*N!Q)1<[\!$I"!(^!D > +M`F`*KP9]`1)'/7\!(G\`(I`!5^!@2.3PD`$\=`+PD($DX/\3$U0_,.`,[U3[ > +M\)"!*^!4_?`BD($PX`3PD($KX%3O\)"!..#_D($PX-.?0`Z0@-[@M`$'D($E > +MX%3[\"*0@#_@_WT!$FUICE2/5:U5K%2O4Q)/@J]5KE20!(#@5`_]K`=T$2SU > +M@N0T_/6#X$0!\'01+/6"Y#3\]8/@5/OPK`=T%BSU@N0T_/6#X$3Z\'05+/6" > +MY#3\]8/@1!_PK`=T!BSU@N0T_/6#X$0/\)`$4^3PD`12\)`$473_\)`$4'3] > +M\'04+/6"Y#3\]8/@5,!-_704+_6"Y#3\]8/M\"*K!ZH&[2O[Y#KZPY"`V^"; > +MD(#:X)I0$Z/@)`'_D(#:X#0`_L/KG_OJGOKJD/T1\*\#=``O]8+D-/OU@^#_ > +M(A(?I/]4`?Z0@4+@5/Y.\._#$S#@"I```1(?O9"!0_`BD(%%X##@+9"!2.`$ > +L\.#_D(%&X+4''I`&DN!4''`+$D\+D(%)X`3P@`:0!I)T'/#DD(%(\"(`NXX` > +` > +end > > Modified: head/sys/dev/usb/usbdevs > ============================================================================== > --- head/sys/dev/usb/usbdevs Fri Apr 25 04:49:27 2014 (r264911) > +++ head/sys/dev/usb/usbdevs Fri Apr 25 08:01:22 2014 (r264912) > @@ -3677,6 +3677,7 @@ product RATOC REXUSB60F 0xb020 USB seri > /* Green House and CompUSA OEM this part */ > product REALTEK DUMMY 0x0000 Dummy product > product REALTEK USB20CRW 0x0158 USB20CRW Card Reader > +product REALTEK RTL8188ETV 0x0179 RTL8188ETV > product REALTEK RTL8188CTV 0x018a RTL8188CTV > product REALTEK USBKR100 0x8150 USBKR100 USB Ethernet > product REALTEK RTL8188CE_0 0x8170 RTL8188CE > > Modified: head/sys/dev/usb/wlan/if_urtwn.c > ============================================================================== > --- head/sys/dev/usb/wlan/if_urtwn.c Fri Apr 25 04:49:27 2014 (r264911) > +++ head/sys/dev/usb/wlan/if_urtwn.c Fri Apr 25 08:01:22 2014 (r264912) > @@ -2,6 +2,7 @@ > > /*- > * Copyright (c) 2010 Damien Bergamini > + * Copyright (c) 2014 Kevin Lo > * > * Permission to use, copy, modify, and distribute this software for any > * purpose with or without fee is hereby granted, provided that the above > @@ -20,7 +21,7 @@ > __FBSDID("$FreeBSD$"); > > /* > - * Driver for Realtek RTL8188CE-VAU/RTL8188CUS/RTL8188RU/RTL8192CU. > + * Driver for Realtek RTL8188CE-VAU/RTL8188CUS/RTL8188EU/RTL8188RU/RTL8192CU. > */ > > #include > @@ -88,11 +89,13 @@ SYSCTL_INT(_hw_usb_urtwn, OID_AUTO, debu > /* various supported device vendors/products */ > static const STRUCT_USB_HOST_ID urtwn_devs[] = { > #define URTWN_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } > +#define URTWN_RTL8188E_DEV(v,p) \ > + { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, URTWN_RTL8188E) } > +#define URTWN_RTL8188E 1 > URTWN_DEV(ABOCOM, RTL8188CU_1), > URTWN_DEV(ABOCOM, RTL8188CU_2), > URTWN_DEV(ABOCOM, RTL8192CU), > URTWN_DEV(ASUS, RTL8192CU), > - URTWN_DEV(ASUS, USBN10NANO), > URTWN_DEV(AZUREWAVE, RTL8188CE_1), > URTWN_DEV(AZUREWAVE, RTL8188CE_2), > URTWN_DEV(AZUREWAVE, RTL8188CU), > @@ -147,6 +150,10 @@ static const STRUCT_USB_HOST_ID urtwn_de > URTWN_DEV(TRENDNET, RTL8188CU), > URTWN_DEV(TRENDNET, RTL8192CU), > URTWN_DEV(ZYXEL, RTL8192CU), > + /* URTWN_RTL8188E */ > + URTWN_RTL8188E_DEV(REALTEK, RTL8188ETV), > + URTWN_RTL8188E_DEV(REALTEK, RTL8188EU), > +#undef URTWN_RTL8188E_DEV > #undef URTWN_DEV > }; > > @@ -191,15 +198,19 @@ static uint16_t urtwn_read_2(struct urt > static uint32_t urtwn_read_4(struct urtwn_softc *, uint16_t); > static int urtwn_fw_cmd(struct urtwn_softc *, uint8_t, > const void *, int); > -static void urtwn_rf_write(struct urtwn_softc *, int, uint8_t, > - uint32_t); > +static void urtwn_r92c_rf_write(struct urtwn_softc *, int, > + uint8_t, uint32_t); > +static void urtwn_r88e_rf_write(struct urtwn_softc *, int, > + uint8_t, uint32_t); > static uint32_t urtwn_rf_read(struct urtwn_softc *, int, uint8_t); > static int urtwn_llt_write(struct urtwn_softc *, uint32_t, > uint32_t); > static uint8_t urtwn_efuse_read_1(struct urtwn_softc *, uint16_t); > static void urtwn_efuse_read(struct urtwn_softc *); > +static void urtwn_efuse_switch_power(struct urtwn_softc *); > static int urtwn_read_chipid(struct urtwn_softc *); > static void urtwn_read_rom(struct urtwn_softc *); > +static void urtwn_r88e_read_rom(struct urtwn_softc *); > static int urtwn_ra_init(struct urtwn_softc *); > static void urtwn_tsf_sync_enable(struct urtwn_softc *); > static void urtwn_set_led(struct urtwn_softc *, int, int); > @@ -208,6 +219,7 @@ static int urtwn_newstate(struct ieee80 > static void urtwn_watchdog(void *); > static void urtwn_update_avgrssi(struct urtwn_softc *, int, int8_t); > static int8_t urtwn_get_rssi(struct urtwn_softc *, int, void *); > +static int8_t urtwn_r88e_get_rssi(struct urtwn_softc *, int, void *); > static int urtwn_tx_start(struct urtwn_softc *, > struct ieee80211_node *, struct mbuf *, > struct urtwn_data *); > @@ -215,13 +227,16 @@ static void urtwn_start(struct ifnet *) > static void urtwn_start_locked(struct ifnet *, > struct urtwn_softc *); > static int urtwn_ioctl(struct ifnet *, u_long, caddr_t); > -static int urtwn_power_on(struct urtwn_softc *); > +static int urtwn_r92c_power_on(struct urtwn_softc *); > +static int urtwn_r88e_power_on(struct urtwn_softc *); > static int urtwn_llt_init(struct urtwn_softc *); > static void urtwn_fw_reset(struct urtwn_softc *); > +static void urtwn_r88e_fw_reset(struct urtwn_softc *); > static int urtwn_fw_loadpage(struct urtwn_softc *, int, > const uint8_t *, int); > static int urtwn_load_firmware(struct urtwn_softc *); > -static int urtwn_dma_init(struct urtwn_softc *); > +static int urtwn_r92c_dma_init(struct urtwn_softc *); > +static int urtwn_r88e_dma_init(struct urtwn_softc *); > static void urtwn_mac_init(struct urtwn_softc *); > static void urtwn_bb_init(struct urtwn_softc *); > static void urtwn_rf_init(struct urtwn_softc *); > @@ -234,6 +249,9 @@ static void urtwn_write_txpower(struct > static void urtwn_get_txpower(struct urtwn_softc *, int, > struct ieee80211_channel *, > struct ieee80211_channel *, uint16_t[]); > +static void urtwn_r88e_get_txpower(struct urtwn_softc *, int, > + struct ieee80211_channel *, > + struct ieee80211_channel *, uint16_t[]); > static void urtwn_set_txpower(struct urtwn_softc *, > struct ieee80211_channel *, > struct ieee80211_channel *); > @@ -352,6 +370,8 @@ urtwn_attach(device_t self) > device_set_usb_desc(self); > sc->sc_udev = uaa->device; > sc->sc_dev = self; > + if (USB_GET_DRIVER_INFO(uaa) == URTWN_RTL8188E) > + sc->chip |= URTWN_CHIP_88E; > > mtx_init(&sc->sc_mtx, device_get_nameunit(self), > MTX_NETWORK_LOCK, MTX_DEF); > @@ -383,10 +403,15 @@ urtwn_attach(device_t self) > sc->ntxchains = 1; > sc->nrxchains = 1; > } > - urtwn_read_rom(sc); > + > + if (sc->chip & URTWN_CHIP_88E) > + urtwn_r88e_read_rom(sc); > + else > + urtwn_read_rom(sc); > > device_printf(sc->sc_dev, "MAC/BB RTL%s, RF 6052 %dT%dR\n", > (sc->chip & URTWN_CHIP_92C) ? "8192CU" : > + (sc->chip & URTWN_CHIP_88E) ? "8188EU" : > (sc->board_type == R92C_BOARD_TYPE_HIGHPA) ? "8188RU" : > (sc->board_type == R92C_BOARD_TYPE_MINICARD) ? "8188CE-VAU" : > "8188CUS", sc->ntxchains, sc->nrxchains); > @@ -638,7 +663,10 @@ urtwn_rx_frame(struct urtwn_softc *sc, u > > /* Get RSSI from PHY status descriptor if present. */ > if (infosz != 0 && (rxdw0 & R92C_RXDW0_PHYST)) { > - rssi = urtwn_get_rssi(sc, rate, &stat[1]); > + if (sc->chip & URTWN_CHIP_88E) > + rssi = urtwn_r88e_get_rssi(sc, rate, &stat[1]); > + else > + rssi = urtwn_get_rssi(sc, rate, &stat[1]); > /* Update our average RSSI. */ > urtwn_update_avgrssi(sc, rate, rssi); > /* > @@ -1056,14 +1084,31 @@ urtwn_fw_cmd(struct urtwn_softc *sc, uin > return (0); > } > > -static void > +static __inline void > urtwn_rf_write(struct urtwn_softc *sc, int chain, uint8_t addr, uint32_t val) > { > + > + sc->sc_rf_write(sc, chain, addr, val); > +} > + > +static void > +urtwn_r92c_rf_write(struct urtwn_softc *sc, int chain, uint8_t addr, > + uint32_t val) > +{ > urtwn_bb_write(sc, R92C_LSSI_PARAM(chain), > SM(R92C_LSSI_PARAM_ADDR, addr) | > SM(R92C_LSSI_PARAM_DATA, val)); > } > > +static void > +urtwn_r88e_rf_write(struct urtwn_softc *sc, int chain, uint8_t addr, > +uint32_t val) > +{ > + urtwn_bb_write(sc, R92C_LSSI_PARAM(chain), > + SM(R88E_LSSI_PARAM_ADDR, addr) | > + SM(R92C_LSSI_PARAM_DATA, val)); > +} > + > static uint32_t > urtwn_rf_read(struct urtwn_softc *sc, int chain, uint8_t addr) > { > @@ -1143,22 +1188,8 @@ urtwn_efuse_read(struct urtwn_softc *sc) > uint8_t off, msk; > int i; > > - reg = urtwn_read_2(sc, R92C_SYS_ISO_CTRL); > - if (!(reg & R92C_SYS_ISO_CTRL_PWC_EV12V)) { > - urtwn_write_2(sc, R92C_SYS_ISO_CTRL, > - reg | R92C_SYS_ISO_CTRL_PWC_EV12V); > - } > - reg = urtwn_read_2(sc, R92C_SYS_FUNC_EN); > - if (!(reg & R92C_SYS_FUNC_EN_ELDR)) { > - urtwn_write_2(sc, R92C_SYS_FUNC_EN, > - reg | R92C_SYS_FUNC_EN_ELDR); > - } > - reg = urtwn_read_2(sc, R92C_SYS_CLKR); > - if ((reg & (R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M)) != > - (R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M)) { > - urtwn_write_2(sc, R92C_SYS_CLKR, > - reg | R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M); > - } > + urtwn_efuse_switch_power(sc); > + > memset(&sc->rom, 0xff, sizeof(sc->rom)); > while (addr < 512) { > reg = urtwn_efuse_read_1(sc, addr); > @@ -1188,12 +1219,37 @@ urtwn_efuse_read(struct urtwn_softc *sc) > } > #endif > } > +static void > +urtwn_efuse_switch_power(struct urtwn_softc *sc) > +{ > + uint32_t reg; > + > + reg = urtwn_read_2(sc, R92C_SYS_ISO_CTRL); > + if (!(reg & R92C_SYS_ISO_CTRL_PWC_EV12V)) { > + urtwn_write_2(sc, R92C_SYS_ISO_CTRL, > + reg | R92C_SYS_ISO_CTRL_PWC_EV12V); > + } > + reg = urtwn_read_2(sc, R92C_SYS_FUNC_EN); > + if (!(reg & R92C_SYS_FUNC_EN_ELDR)) { > + urtwn_write_2(sc, R92C_SYS_FUNC_EN, > + reg | R92C_SYS_FUNC_EN_ELDR); > + } > + reg = urtwn_read_2(sc, R92C_SYS_CLKR); > + if ((reg & (R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M)) != > + (R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M)) { > + urtwn_write_2(sc, R92C_SYS_CLKR, > + reg | R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M); > + } > +} > > static int > urtwn_read_chipid(struct urtwn_softc *sc) > { > uint32_t reg; > > + if (sc->chip & URTWN_CHIP_88E) > + return (0); > + > reg = urtwn_read_4(sc, R92C_SYS_CFG); > if (reg & R92C_SYS_CFG_TRP_VAUX_EN) > return (EIO); > @@ -1230,8 +1286,69 @@ urtwn_read_rom(struct urtwn_softc *sc) > > sc->regulatory = MS(rom->rf_opt1, R92C_ROM_RF1_REGULATORY); > DPRINTF("regulatory type=%d\n", sc->regulatory); > - > IEEE80211_ADDR_COPY(sc->sc_bssid, rom->macaddr); > + > + sc->sc_rf_write = urtwn_r92c_rf_write; > + sc->sc_power_on = urtwn_r92c_power_on; > + sc->sc_dma_init = urtwn_r92c_dma_init; > +} > + > +static void > +urtwn_r88e_read_rom(struct urtwn_softc *sc) > +{ > + uint8_t *rom = sc->r88e_rom; > + uint16_t addr = 0; > + uint32_t reg; > + uint8_t off, msk, tmp; > + int i; > + > + urtwn_efuse_switch_power(sc); > + > + /* Read full ROM image. */ > + memset(&sc->r88e_rom, 0xff, sizeof(sc->r88e_rom)); > + while (addr < 1024) { > + reg = urtwn_efuse_read_1(sc, addr); > + if (reg == 0xff) > + break; > + addr++; > + if ((reg & 0x1f) == 0x0f) { > + tmp = (reg & 0xe0) >> 5; > + reg = urtwn_efuse_read_1(sc, addr); > + if ((reg & 0x0f) != 0x0f) > + off = ((reg & 0xf0) >> 1) | tmp; > + addr++; > + } else > + off = reg >> 4; > + msk = reg & 0xf; > + for (i = 0; i < 4; i++) { > + if (msk & (1 << i)) > + continue; > + rom[off * 8 + i * 2 + 0] = > + urtwn_efuse_read_1(sc, addr); > + addr++; > + rom[off * 8 + i * 2 + 1] = > + urtwn_efuse_read_1(sc, addr); > + addr++; > + } > + } > + > + addr = 0x10; > + for (i = 0; i < 6; i++) > + sc->cck_tx_pwr[i] = sc->r88e_rom[addr++]; > + for (i = 0; i < 5; i++) > + sc->ht40_tx_pwr[i] = sc->r88e_rom[addr++]; > + sc->bw20_tx_pwr_diff = (sc->r88e_rom[addr] & 0xf0) >> 4; > + if (sc->bw20_tx_pwr_diff & 0x08) > + sc->bw20_tx_pwr_diff |= 0xf0; > + sc->ofdm_tx_pwr_diff = (sc->r88e_rom[addr] & 0xf); > + if (sc->ofdm_tx_pwr_diff & 0x08) > + sc->ofdm_tx_pwr_diff |= 0xf0; > + sc->regulatory = MS(sc->r88e_rom[0xc1], R92C_ROM_RF1_REGULATORY); > + IEEE80211_ADDR_COPY(sc->sc_bssid, &sc->r88e_rom[0xd7]); > + > + sc->sc_rf_write = urtwn_r88e_rf_write; > + sc->sc_power_on = urtwn_r88e_power_on; > + sc->sc_dma_init = urtwn_r88e_dma_init; > } > > /* > @@ -1349,13 +1466,26 @@ static void > urtwn_set_led(struct urtwn_softc *sc, int led, int on) > { > uint8_t reg; > - > + > if (led == URTWN_LED_LINK) { > - reg = urtwn_read_1(sc, R92C_LEDCFG0) & 0x70; > - if (!on) > - reg |= R92C_LEDCFG0_DIS; > - urtwn_write_1(sc, R92C_LEDCFG0, reg); > - sc->ledlink = on; /* Save LED state. */ > + if (sc->chip & URTWN_CHIP_88E) { > + reg = urtwn_read_1(sc, R92C_LEDCFG2) & 0xf0; > + urtwn_write_1(sc, R92C_LEDCFG2, reg | 0x60); > + if (!on) { > + reg = urtwn_read_1(sc, R92C_LEDCFG2) & 0x90; > + urtwn_write_1(sc, R92C_LEDCFG2, > + reg | R92C_LEDCFG0_DIS); > + urtwn_write_1(sc, R92C_MAC_PINMUX_CFG, > + urtwn_read_1(sc, R92C_MAC_PINMUX_CFG) & > + 0xfe); > + } > + } else { > + reg = urtwn_read_1(sc, R92C_LEDCFG0) & 0x70; > + if (!on) > + reg |= R92C_LEDCFG0_DIS; > + urtwn_write_1(sc, R92C_LEDCFG0, reg); > + } > + sc->ledlink = on; /* Save LED state. */ > } > } > > @@ -1421,11 +1551,12 @@ urtwn_newstate(struct ieee80211vap *vap, > reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x20); > urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), reg); > > - reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1)); > - reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x20); > - urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); > + if (!(sc->chip & URTWN_CHIP_88E)) { > + reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1)); > + reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x20); > + urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); > + } > } > - > /* Make link LED blink during scan. */ > urtwn_set_led(sc, URTWN_LED_LINK, !sc->ledlink); > > @@ -1441,10 +1572,11 @@ urtwn_newstate(struct ieee80211vap *vap, > reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x32); > urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), reg); > > - reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1)); > - reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x32); > - urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); > - > + if (!(sc->chip & URTWN_CHIP_88E)) { > + reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1)); > + reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x32); > + urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); > + } > urtwn_set_chan(sc, ic->ic_curchan, NULL); > break; > case IEEE80211_S_RUN: > @@ -1497,7 +1629,11 @@ urtwn_newstate(struct ieee80211vap *vap, > urtwn_write_1(sc, R92C_T2T_SIFS + 1, 10); > > /* Intialize rate adaptation. */ > - urtwn_ra_init(sc); > + if (sc->chip & URTWN_CHIP_88E) > + ni->ni_txrate = > + ni->ni_rates.rs_rates[ni->ni_rates.rs_nrates-1]; > + else > + urtwn_ra_init(sc); > /* Turn link LED on. */ > urtwn_set_led(sc, URTWN_LED_LINK, 1); > > @@ -1543,19 +1679,21 @@ urtwn_update_avgrssi(struct urtwn_softc > pwdb = 100; > else > pwdb = 100 + rssi; > - if (rate <= 3) { > - /* CCK gain is smaller than OFDM/MCS gain. */ > - pwdb += 6; > - if (pwdb > 100) > - pwdb = 100; > - if (pwdb <= 14) > - pwdb -= 4; > - else if (pwdb <= 26) > - pwdb -= 8; > - else if (pwdb <= 34) > - pwdb -= 6; > - else if (pwdb <= 42) > - pwdb -= 2; > + if (!(sc->chip & URTWN_CHIP_88E)) { > + if (rate <= 3) { > + /* CCK gain is smaller than OFDM/MCS gain. */ > + pwdb += 6; > + if (pwdb > 100) > + pwdb = 100; > + if (pwdb <= 14) > + pwdb -= 4; > + else if (pwdb <= 26) > + pwdb -= 8; > + else if (pwdb <= 34) > + pwdb -= 6; > + else if (pwdb <= 42) > + pwdb -= 2; > + } > } > if (sc->avg_pwdb == -1) /* Init. */ > sc->avg_pwdb = pwdb; > @@ -1592,6 +1730,57 @@ urtwn_get_rssi(struct urtwn_softc *sc, i > return (rssi); > } > > +static int8_t > +urtwn_r88e_get_rssi(struct urtwn_softc *sc, int rate, void *physt) > +{ > + struct r92c_rx_phystat *phy; > + struct r88e_rx_cck *cck; > + uint8_t cck_agc_rpt, lna_idx, vga_idx; > + int8_t rssi; > + > + if (rate <= 3) { > + cck = (struct r88e_rx_cck *)physt; > + cck_agc_rpt = cck->agc_rpt; > + lna_idx = (cck_agc_rpt & 0xe0) >> 5; > + vga_idx = cck_agc_rpt & 0x1f; > + switch (lna_idx) { > + case 7: > + if (vga_idx <= 27) > + rssi = -100 + 2* (27 - vga_idx); > + else > + rssi = -100; > + break; > + case 6: > + rssi = -48 + 2 * (2 - vga_idx); > + break; > + case 5: > + rssi = -42 + 2 * (7 - vga_idx); > + break; > + case 4: > + rssi = -36 + 2 * (7 - vga_idx); > + break; > + case 3: > + rssi = -24 + 2 * (7 - vga_idx); > + break; > + case 2: > + rssi = -12 + 2 * (5 - vga_idx); > + break; > + case 1: > + rssi = 8 - (2 * vga_idx); > + break; > + case 0: > + rssi = 14 - (2 * vga_idx); > + break; > + } > + rssi += 6; > + } else { /* OFDM/HT. */ > + phy = (struct r92c_rx_phystat *)physt; > + rssi = ((le32toh(phy->phydw1) >> 1) & 0x7f) - 110; > + } > + return (rssi); > +} > + > + > static int > urtwn_tx_start(struct urtwn_softc *sc, struct ieee80211_node *ni, > struct mbuf *m0, struct urtwn_data *data) > @@ -1619,6 +1808,8 @@ urtwn_tx_start(struct urtwn_softc *sc, s > * Software crypto. > */ > wh = mtod(m0, struct ieee80211_frame *); > + type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; > + > if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { > k = ieee80211_crypto_encap(ni, m0); > if (k == NULL) { > @@ -1633,7 +1824,7 @@ urtwn_tx_start(struct urtwn_softc *sc, s > wh = mtod(m0, struct ieee80211_frame *); > } > > - switch (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) { > + switch (type) { > case IEEE80211_FC0_TYPE_CTL: > case IEEE80211_FC0_TYPE_MGT: > xfer = sc->sc_xfer[URTWN_BULK_TX_VO]; > @@ -1657,20 +1848,24 @@ urtwn_tx_start(struct urtwn_softc *sc, s > R92C_TXDW0_OWN | R92C_TXDW0_FSG | R92C_TXDW0_LSG); > if (IEEE80211_IS_MULTICAST(wh->i_addr1)) > txd->txdw0 |= htole32(R92C_TXDW0_BMCAST); > - > - type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; > if (!IEEE80211_IS_MULTICAST(wh->i_addr1) && > type == IEEE80211_FC0_TYPE_DATA) { > if (ic->ic_curmode == IEEE80211_MODE_11B) > raid = R92C_RAID_11B; > else > raid = R92C_RAID_11BG; > - txd->txdw1 |= htole32( > - SM(R92C_TXDW1_MACID, URTWN_MACID_BSS) | > - SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_BE) | > - SM(R92C_TXDW1_RAID, raid) | > - R92C_TXDW1_AGGBK); > - > + if (sc->chip & URTWN_CHIP_88E) { > + txd->txdw1 |= htole32( > + SM(R88E_TXDW1_MACID, URTWN_MACID_BSS) | > + SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_BE) | > + SM(R92C_TXDW1_RAID, raid)); > + txd->txdw2 |= htole32(R88E_TXDW2_AGGBK); > + } else { > + txd->txdw1 |= htole32( > + SM(R92C_TXDW1_MACID, URTWN_MACID_BSS) | > + SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_BE) | > + SM(R92C_TXDW1_RAID, raid) | R92C_TXDW1_AGGBK); > + } > if (ic->ic_flags & IEEE80211_F_USEPROT) { > if (ic->ic_protmode == IEEE80211_PROT_CTSONLY) { > txd->txdw4 |= htole32(R92C_TXDW4_CTS2SELF | > @@ -1684,7 +1879,10 @@ urtwn_tx_start(struct urtwn_softc *sc, s > txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE, 8)); > txd->txdw5 |= htole32(0x0001ff00); > /* Send data at OFDM54. */ > - txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, 11)); > + if (sc->chip & URTWN_CHIP_88E) > + txd->txdw5 |= htole32(0x13 & 0x3f); > + else > + txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, 11)); > } else { > txd->txdw1 |= htole32( > SM(R92C_TXDW1_MACID, 0) | > @@ -1882,9 +2080,16 @@ urtwn_alloc_tx_list(struct urtwn_softc * > return (0); > } > > -static int > +static __inline int > urtwn_power_on(struct urtwn_softc *sc) > { > + > + return sc->sc_power_on(sc); > +} > + > +static int > +urtwn_r92c_power_on(struct urtwn_softc *sc) > +{ > uint32_t reg; > int ntries; > > @@ -1968,12 +2173,73 @@ urtwn_power_on(struct urtwn_softc *sc) > } > > static int > +urtwn_r88e_power_on(struct urtwn_softc *sc) > +{ > + uint8_t val; > + uint32_t reg; > + int ntries; > + > + /* Wait for power ready bit. */ > + for (ntries = 0; ntries < 5000; ntries++) { > + val = urtwn_read_1(sc, 0x6) & 0x2; > + if (val == 0x2) > + break; > + DELAY(10); > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@FreeBSD.ORG Mon May 26 22:18:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E93E3AA; Mon, 26 May 2014 22:18:49 +0000 (UTC) Received: from mailrelay011.isp.belgacom.be (mailrelay011.isp.belgacom.be [195.238.6.178]) by mx1.freebsd.org (Postfix) with ESMTP id CB7DD20BC; Mon, 26 May 2014 22:18:47 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4GAGu9g1NbsXvB/2dsb2JhbABZgweub5RQAYEXF3SCJQEBBAEyASMjEAsOBAYJJQ8qEA4GE4g6DAHVEheJM4UfB4RAAQOVcoQAkyiDOjs Received: from 193.123-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.123.193]) by relay.skynet.be with ESMTP; 27 May 2014 00:18:13 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.8/8.14.8) with ESMTP id s4QMIBjL045663; Tue, 27 May 2014 00:18:12 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Tue, 27 May 2014 00:18:11 +0200 From: Tijl Coosemans To: Warner Losh Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140527001811.3e9d3e8d@kalimero.tijl.coosemans.org> In-Reply-To: References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> <5380EBA8.1030200@freebsd.org> <20140525011307.142b41ab@kalimero.tijl.coosemans.org> <3CCAFAD3-FABE-40EF-ABF9-815FE5826349@bsdimp.com> <9FE34CE4-C71F-4806-9EF6-30CB1051C62F@bsdimp.com> <20140526113502.239db74d@kalimero.tijl.coosemans.org> <5383522F.30108@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1253 Content-Transfer-Encoding: 8bit Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , Nathan Whitehorn , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 22:18:49 -0000 On Mon, 26 May 2014 09:53:57 -0600 Warner Losh wrote: > On May 26, 2014, at 8:39 AM, Nathan Whitehorn wrote: >> On 05/26/14 02:35, Tijl Coosemans wrote: >>> On Sat, 24 May 2014 19:00:18 -0600 Warner Losh wrote: >>>> On May 24, 2014, at 5:53 PM, Warner Losh wrote: >>>>> On May 24, 2014, at 5:13 PM, Tijl Coosemans wrote: >>>>>> There isn't necessarily any chroot environment. There's one kernel, >>>>>> two equally valid ABIs (ILP32 and LP64) and any binary like uname might >>>>>> use either of them. If uname -p returns a different result depending on >>>>>> which of these two ABIs it was compiled for that could be a problem for >>>>>> any script that uses it. >>>>> Well, it depends on what you want to do with the script, eh? If you want >>>>> to know the ABI of the native binary uname, that’s one thing. But if you >>>>> want to know the supported ABIs, you are doing it wrong by using uname. >>>>> You should be using sysctl kern.supported_abi. That will tell you all the >>>>> ABIs that you can install packages for on this machine, which is what you >>>>> really want to know. So I’m having trouble connecting the dots between >>>>> this and what you are saying here. >>>>> >>>>> I still am absolutely flabbergasted why the MACHINE_ARCH names aren’t >>>>> necessary and sufficient for packaging. I’ve yet to see any coherent >>>>> reason to not use them. >>>> Why do I care that they match? Good question. When I was doing FreeNAS, I >>>> looked at integrating pkgng into nanobsd. At the time this was quite >>>> difficult because every single architecture name was different between >>>> pkgng and MACHINE_ARCH. This would mean I’d have to drag around a huge >>>> table to know how to translate one to the other (there was no simple regex >>>> either, and things like mipsn32 wouldn’t have fit into the scheme at the >>>> time). I would very much like us to see us keep these names in sync and >>>> avoid large translation tables that are difficult to maintain. >>>> >>>> Now, do you need to get it from uname -p? No. If you want to parse elf >>>> files to get it, that’s fine, so long as the names map directly to the >>>> MACHINE_ARCH names that we’ve been using for years. They completely >>>> describe the universe of supported platforms. Are they perfect? No, around >>>> the edge there may be an odd-ball that’s possible to build, but is >>>> unsupported and likely doesn’t work at all. Have we learned from these >>>> mistakes? Yes. Anything that’s actively supported has a proper name. This >>>> name is needed, btw, so that any machine can self-host, a nice feature of >>>> the /usr/src system. >>> ABI consists of the following elements: >>> >>> - OS >>> - OS ABI version (major version number in FreeBSD) > > These two are encoded in FreeBSD and major version. There’s no problem > encoding these in the package architecture string. They are easily > scriptable and totally obvious to FreeBSD users and pose no problems. > Nobody is opposed to these, and actually they are rather a good idea. > >>> - instruction set >>> - programming model (ILP32 or LP64) >>> - byte order (little/big endian) > > These three are encoded in MACHINE_ARCH and have been for quite some > time. And you forgot several things as well: register conventions, > calling conventions, stack alignment, struct alignment, pointer > conversion conventions, address space layout, page size constraints, > etc. There are simply far too many to try to break down like you are > trying to do. And that’s even before we get into shared library > conventions... I didn't forget them, I just restricted it to the elements that came up so far. All these extra elements are like byte order: you use only one of each per combination of the first four fields so they can be discarded. Things like calling conventions and register use can be considered part of the programming model. The amd64 programming models that matter to FreeBSD (both ILP32 and LP64) are documented in the System V Application Binary Interface AMD64 Architecture Processor Supplement. >>> These are almost orthogonal dimensions in the sense that almost any >>> combination is possible. (A combination that isn't possible is a >>> 32-bit instruction set with LP64.) > > All of these items are encoded in MACHINE_ARACH and have been for at > least a decade. There’s no new argument here. If they were actually > orthogonal, then that would be one thing. But they aren’t. They are all > closely interrelated and we only support a vanishingly small number of > possible conventions. Combinatorically, it can be hundreds. Practically, > it is usually only a handful. > >>> What you are asking for now is to combine two dimensions into one and >>> combination in this case means multiplication so if you have 3 >>> instruction sets and 2 programming models, the combined dimension needs >>> 6 different values. You need to make the case for why you think this >>> is a good idea. > > Because uanme has to be 6 different things so the right binaries are > built. It is really that simple. Uname is a per system (or per jail) setting. Whether you then want a 32-bit or 64-bit address space is a separate per program or per package setting. If you want to install a package you need to know the system you're on and then you need to decide whether you'll use it with a large amount of data that requires a 64-bit address space or whether a 32-bit address space is enough and you want the performance benefit it gives (smaller pointers means lower memory and cpu cache use and 32-bit pointer arithmetic may be a bit faster). >>> For the past 20 years we got away with this because >>> on every installation of FreeBSD we only used one programming model at >>> a time. This is still the case for byte order of course. > > This isn’t true. For the past 15 years we’ve supported two programming > models on amd64 at the same time. For longer than that we’ve supported > linux emulation on i386. The project has known about these things for a > long long time, and has settled on MACHINE_ARCH to represent all possible > builds. We’ve had mixed MIPS for about a decade, though the support has > varied in quality and execution. We learned that TARGET_BIG_ENDIAN was > bad, really bad, and we had to have a separate name for each ABI we > supported with no external info apart from that name. We could have > easily picked the convention you are proposing here, but we didn’t. We > picked another one. > > Also, the “for the past 20 years” argument cuts both ways. Look at > NetBSD. There, they have the same convention we have here of having a > separate MACHINE_ARCH for each ABI. They have been even more successful > at it that we have, and have avoided the pitfalls of TARGET_BIG_ENDIAN > much better than we have. pkgsrc ties nicely into that. so for 20 years > people have successfully used the current model, not just in FreeBSD, > but also elsewhere. I'm talking about cases where the first three fields listed above are not sufficient to distinguish between ABIs. The cases you listed are already handled by those three, like linux != freebsd for the OS field and i386 != amd64 for the instruction set. >>> What I'm saying is to keep the option open for installations with >>> multiple programming models, where most binaries could use ILP32 and >>> only the ones that actually need a 64-bit address space use LP64. >>> You query the instruction set using uname and the programming models >>> using getconf. > > What I’m saying is I don’t see any benefit at all to our users to > having an additional, arbitrary sting they have to deal with. There’s > actually quite a few other details that you need to know before you can > even call getconf. getconf _POSIX_V6_ILP32_OFFBIG getconf _POSIX_V6_LP64_OFF64 It'll print "1" when supported, "undefined" otherwise. Currently only one is supported per system (or per jail) so MACHINE_ARCH is sufficient to describe the ABI. When both are supported on one system (or one jail) (i.e. both commands print "1"), the system (or jail) MACHINE_ARCH is not sufficient to distinguish between them. You have to specify something extra in this case (the fourth field) to indicate which of the two packages you want. >>> I suppose you could replace the "x86" in the pkg scheme with i386/amd64, >>> but then you'd still be talking about i386:32, amd64:32 and amd64:64 >>> instead of x86:32, x86:x32 and x86:64. > > I suppose you could replace these by “i386”, “x32” (or “amd64x32”) and > “amd64” respectively. So you're on an amd64 or mips64 system (as indicated by uname) but you want to use the 32-bit package if possible. How does your script know about the magic "x32", "amd64x32" or "mipsn32" strings? Wouldn't it be easier if you could just use "`uname -p`:32"? I do realise it doesn't quite work like this right now because pkg uses "x86" instead of "amd64" or "i386" for the third field and uses the fourth field to distinguish between them. I don't know if this is unique to the x86 family or if this is also the case for the others. This may need to be reconsidered, but the idea of a fourth field is solid as far as I can see. From owner-svn-src-head@FreeBSD.ORG Mon May 26 22:31:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CAD1B80E for ; Mon, 26 May 2014 22:31:10 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83A8121E4 for ; Mon, 26 May 2014 22:31:09 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id tp5so8147000ieb.11 for ; Mon, 26 May 2014 15:31:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=x2WBqAb2ni+mbDruimuiTXAnHskaa6Agl/hPAaBnQpU=; b=PAe3OcchKbdHwr2xckyELxpE7k/mRCjlKPCfKkq0B8HFbWGIWtqOqzKT5FWLyvwSFA CAJjjSg0CVWGi9xT0v37vzmhgC4XUJnYRgrQUNoSk0miPcNNN33ZEWetYmYqfxwH9RDS NC0ToC7d2IglNMdNZCMf/OLSFtPRc5Ben7tuCST/snOqeUnnfO5qBHpxNR5ithZ1xwlu mx6Io8ESHjAob9y2fE4Vefsi0+AvX7PFswwya+HWTNzAuRbnVVNdrLGwH39JA+Z94Npg OMxd44lGhUxbkJucq9WhaN6ziJndkv9g3tCV32QUdQ5awCAdpX+6LTvtezYTKJXarU6c zmNw== X-Gm-Message-State: ALoCoQnJEFAdPaHzAwcoXeyBDUJg6ocNXQ4K2pHzw0DGgwb8aUAy9orK8Jnl8/UwOL43flUkWKPI X-Received: by 10.50.50.231 with SMTP id f7mr28300235igo.42.1401143468751; Mon, 26 May 2014 15:31:08 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id v9sm2930662igd.14.2014.05.26.15.31.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 26 May 2014 15:31:08 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_A40E86D8-A260-43EC-A917-4D9DC2799B17"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266553 - head/release/scripts From: Warner Losh In-Reply-To: <20140527001811.3e9d3e8d@kalimero.tijl.coosemans.org> Date: Mon, 26 May 2014 16:31:21 -0600 Message-Id: <05D1A11D-5985-42EA-84AD-209A8B51D391@bsdimp.com> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> <5380EBA8.1030200@freebsd.org> <20140525011307.142b41ab@kalimero.tijl.coosemans.org> <3CCAFAD3-FABE-40EF-ABF9-815FE5826349@bsdimp.com> <9FE34CE4-C71F-4806-9EF6-30CB1051C62F@bsdimp.com> <20140526113502.239db74d@kalimero.tijl.coosemans.org> <5383522F.30108@freebsd.org> <20140527001811.3e9d3e8d@kalimero.tijl.coosemans.org> To: Tijl Coosemans X-Mailer: Apple Mail (2.1878.2) Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , Nathan Whitehorn , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 22:31:10 -0000 --Apple-Mail=_A40E86D8-A260-43EC-A917-4D9DC2799B17 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1253 On May 26, 2014, at 4:18 PM, Tijl Coosemans wrote: > On Mon, 26 May 2014 09:53:57 -0600 Warner Losh wrote: >> On May 26, 2014, at 8:39 AM, Nathan Whitehorn = wrote: >>> On 05/26/14 02:35, Tijl Coosemans wrote: >>>> On Sat, 24 May 2014 19:00:18 -0600 Warner Losh wrote: >>>>> On May 24, 2014, at 5:53 PM, Warner Losh wrote: >>>>>> On May 24, 2014, at 5:13 PM, Tijl Coosemans = wrote: >>>>>>> There isn't necessarily any chroot environment. There's one = kernel, >>>>>>> two equally valid ABIs (ILP32 and LP64) and any binary like = uname might >>>>>>> use either of them. If uname -p returns a different result = depending on >>>>>>> which of these two ABIs it was compiled for that could be a = problem for >>>>>>> any script that uses it. >>>>>> Well, it depends on what you want to do with the script, eh? If = you want >>>>>> to know the ABI of the native binary uname, that=92s one thing. = But if you >>>>>> want to know the supported ABIs, you are doing it wrong by using = uname. >>>>>> You should be using sysctl kern.supported_abi. That will tell you = all the >>>>>> ABIs that you can install packages for on this machine, which is = what you >>>>>> really want to know. So I=92m having trouble connecting the dots = between >>>>>> this and what you are saying here. >>>>>>=20 >>>>>> I still am absolutely flabbergasted why the MACHINE_ARCH names = aren=92t >>>>>> necessary and sufficient for packaging. I=92ve yet to see any = coherent >>>>>> reason to not use them. >>>>> Why do I care that they match? Good question. When I was doing = FreeNAS, I >>>>> looked at integrating pkgng into nanobsd. At the time this was = quite >>>>> difficult because every single architecture name was different = between >>>>> pkgng and MACHINE_ARCH. This would mean I=92d have to drag around = a huge >>>>> table to know how to translate one to the other (there was no = simple regex >>>>> either, and things like mipsn32 wouldn=92t have fit into the = scheme at the >>>>> time). I would very much like us to see us keep these names in = sync and >>>>> avoid large translation tables that are difficult to maintain. >>>>>=20 >>>>> Now, do you need to get it from uname -p? No. If you want to parse = elf >>>>> files to get it, that=92s fine, so long as the names map directly = to the >>>>> MACHINE_ARCH names that we=92ve been using for years. They = completely >>>>> describe the universe of supported platforms. Are they perfect? = No, around >>>>> the edge there may be an odd-ball that=92s possible to build, but = is >>>>> unsupported and likely doesn=92t work at all. Have we learned from = these >>>>> mistakes? Yes. Anything that=92s actively supported has a proper = name. This >>>>> name is needed, btw, so that any machine can self-host, a nice = feature of >>>>> the /usr/src system. >>>> ABI consists of the following elements: >>>>=20 >>>> - OS >>>> - OS ABI version (major version number in FreeBSD) >>=20 >> These two are encoded in FreeBSD and major version. There=92s no = problem >> encoding these in the package architecture string. They are easily >> scriptable and totally obvious to FreeBSD users and pose no problems. >> Nobody is opposed to these, and actually they are rather a good idea. >>=20 >>>> - instruction set >>>> - programming model (ILP32 or LP64) >>>> - byte order (little/big endian) >>=20 >> These three are encoded in MACHINE_ARCH and have been for quite some >> time. And you forgot several things as well: register conventions, >> calling conventions, stack alignment, struct alignment, pointer >> conversion conventions, address space layout, page size constraints, >> etc. There are simply far too many to try to break down like you are >> trying to do. And that=92s even before we get into shared library >> conventions... >=20 > I didn't forget them, I just restricted it to the elements that came = up > so far. All these extra elements are like byte order: you use only = one > of each per combination of the first four fields so they can be = discarded. > Things like calling conventions and register use can be considered = part > of the programming model. The amd64 programming models that matter to > FreeBSD (both ILP32 and LP64) are documented in the System V = Application > Binary Interface AMD64 Architecture Processor Supplement. Well yes and no. n32 and n64 have vastly different register conventions = than o32. But we=92re talking about something that=92s off in the weeds. = It doesn=92t matter. It also doesn=92t address my basic thesis = =93MACHINE_ARCH is enough=94 which you=92ve not shown a coherent example = of where it isn=92t. >>>> These are almost orthogonal dimensions in the sense that almost any >>>> combination is possible. (A combination that isn't possible is a >>>> 32-bit instruction set with LP64.) >>=20 >> All of these items are encoded in MACHINE_ARACH and have been for at >> least a decade. There=92s no new argument here. If they were = actually >> orthogonal, then that would be one thing. But they aren=92t. They are = all >> closely interrelated and we only support a vanishingly small number = of >> possible conventions. Combinatorically, it can be hundreds. = Practically, >> it is usually only a handful. >>=20 >>>> What you are asking for now is to combine two dimensions into one = and >>>> combination in this case means multiplication so if you have 3 >>>> instruction sets and 2 programming models, the combined dimension = needs >>>> 6 different values. You need to make the case for why you think = this >>>> is a good idea. >>=20 >> Because uanme has to be 6 different things so the right binaries are >> built. It is really that simple. >=20 > Uname is a per system (or per jail) setting. Whether you then want a > 32-bit or 64-bit address space is a separate per program or per = package > setting. If you want to install a package you need to know the system > you're on and then you need to decide whether you'll use it with a = large > amount of data that requires a 64-bit address space or whether a = 32-bit > address space is enough and you want the performance benefit it gives > (smaller pointers means lower memory and cpu cache use and 32-bit = pointer > arithmetic may be a bit faster). I fail to see how this is relevant to the discussion. If you want to = install a package, just install what uname -p returns. Unless the user = says =93do FRED instead=94 via a command line argument. Then validate = that against the list of supported ABIs (or just allow it if you are = forcing). It really should be just that simple. I=92m running on arm, = and uname returns armv6, then install the armv6 packages and not the = armv6hf or the armeb packages. No need to parse elf headers to get that. >>>> For the past 20 years we got away with this because >>>> on every installation of FreeBSD we only used one programming model = at >>>> a time. This is still the case for byte order of course. >>=20 >> This isn=92t true. For the past 15 years we=92ve supported two = programming >> models on amd64 at the same time. For longer than that we=92ve = supported >> linux emulation on i386. The project has known about these things for = a >> long long time, and has settled on MACHINE_ARCH to represent all = possible >> builds. We=92ve had mixed MIPS for about a decade, though the support = has >> varied in quality and execution. We learned that TARGET_BIG_ENDIAN = was >> bad, really bad, and we had to have a separate name for each ABI we >> supported with no external info apart from that name. We could have >> easily picked the convention you are proposing here, but we didn=92t. = We >> picked another one. >>=20 >> Also, the =93for the past 20 years=94 argument cuts both ways. Look = at >> NetBSD. There, they have the same convention we have here of having a >> separate MACHINE_ARCH for each ABI. They have been even more = successful >> at it that we have, and have avoided the pitfalls of = TARGET_BIG_ENDIAN >> much better than we have. pkgsrc ties nicely into that. so for 20 = years >> people have successfully used the current model, not just in FreeBSD, >> but also elsewhere. >=20 > I'm talking about cases where the first three fields listed above are > not sufficient to distinguish between ABIs. The cases you listed are > already handled by those three, like linux !=3D freebsd for the OS = field > and i386 !=3D amd64 for the instruction set. You=92ve yet to provide an actual example where this is the case. >>>> What I'm saying is to keep the option open for installations with >>>> multiple programming models, where most binaries could use ILP32 = and >>>> only the ones that actually need a 64-bit address space use LP64. >>>> You query the instruction set using uname and the programming = models >>>> using getconf. >>=20 >> What I=92m saying is I don=92t see any benefit at all to our users to >> having an additional, arbitrary sting they have to deal with. There=92s= >> actually quite a few other details that you need to know before you = can >> even call getconf. >=20 > getconf _POSIX_V6_ILP32_OFFBIG > getconf _POSIX_V6_LP64_OFF64 >=20 > It'll print "1" when supported, "undefined" otherwise. Currently only > one is supported per system (or per jail) so MACHINE_ARCH is = sufficient > to describe the ABI. When both are supported on one system (or one = jail) > (i.e. both commands print "1"), the system (or jail) MACHINE_ARCH is = not > sufficient to distinguish between them. You have to specify something > extra in this case (the fourth field) to indicate which of the two > packages you want. None of this is really relevant to the discussion. MACHINE_ARCH is = totally sufficient. You completely misunderstand. Let me explain. MACHINE_ARCH uniquely defines the ABI. Now, there are some kernels that support running multiple MACHINE_ARCHs. = amd64 is one. It supports amd64 and i386 (and soon i386t64). In the jail = you can ask the sysctl what are the supported things. And if you are on amd64 and want to install an i3866 package, a simple = command line argument will take care of that, and it can even be = validated with the supported abi sysctl. >>>> I suppose you could replace the "x86" in the pkg scheme with = i386/amd64, >>>> but then you'd still be talking about i386:32, amd64:32 and = amd64:64 >>>> instead of x86:32, x86:x32 and x86:64. =20 >>=20 >> I suppose you could replace these by =93i386=94, =93x32=94 (or = =93amd64x32=94) and >> =93amd64=94 respectively. >=20 > So you're on an amd64 or mips64 system (as indicated by uname) but you > want to use the 32-bit package if possible. How does your script know > about the magic "x32", "amd64x32" or "mipsn32" strings? Wouldn't it = be > easier if you could just use "`uname -p`:32=94? Oh give me a break. You know it because you know you are building for = mipsn32 because that=92s what you=92ve set MACHINE_ARCH or TARGET_ARCH = to, which might be uname -p if that=92s left unspecified. No, you can=92t = just say =91uname -p=92:32. Sorry. That=92s lame and generally won=92t = work. Have you actually tried to write a script that turns a = MACHNIE_ARCH into one of these funky pkg names? It is a maze of special = cases that has to be updated each time a new MACHINE_ARCH is added to = FreeBSD. It would be so much more convenient for script writers and = users of our system to have only one thing to specify rather than two, = the second of which is just arbitrarily different without adding any = value. > I do realise it doesn't quite work like this right now because pkg = uses > "x86" instead of "amd64" or "i386" for the third field and uses the > fourth field to distinguish between them. I don't know if this is = unique > to the x86 family or if this is also the case for the others. This = may > need to be reconsidered, but the idea of a fourth field is solid as = far > as I can see. What possible benefit is there? You keep dodging this question. So far = you=92ve shown no benefit what so ever, and lots of hassle. It is cool = because it is different, and it is more descriptive, but it doesn=92t = add any value. Warner --Apple-Mail=_A40E86D8-A260-43EC-A917-4D9DC2799B17 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTg8C5AAoJEGwc0Sh9sBEAgzEQAMyPNionFzicCadXzhv5A98b ixm0qIGs7ui8ZT4L3486929cUXVnt/fjlObp5GilJBqLIZ/8CGHCUU1ItXWWm1ws EAswGOjWhrMh0fvDW+0nKkoOCP6gbsAzTZEMrD1iVKA7Ae24mFZif6AGC5HvFgt6 5RvWS52O6iqts20f/5TFU5mpc3ZA/S6QLlbjG1aSRvOh0YpKkw9oNY0zRJWi1QsD Eqrk0ot1yaoNW+bNWOFksVGaB7584c2k+4dZWp0LgYO9Q8aG9wrkHYGSZLnwBUV2 ja0bqNFSoVO2VgW5/gdB00Hd2uCJmSBo5SgSzyD4bLyv3L0CCDWqztpUlT4HpvCb +TrvTnNsSi2cjBf2kGRUiNeFc3rBVhLbwfU+9iijVO5YYosj3cX7gSpI7+ptDXZa p/vud/mMrCkv9r+LWKydWvL4wzJA7OQN0YapJSAlWSytjTOFLkgBbKCbNGcp8cEz e2PD5X4G0pYojcftzGMSZcdYtDTKOmQdMKcNMeA2R3XSoai3meBogTX582LDC8M2 qsgmxwNCWFDe1DEideUaNX5lhLSWo/PuCjHIb1AnbHxcAml7d7JVs/CD9jRN2WJq lMBr3w3hInyKy3D9WM+nwfZvFVCGjEZhs6D4b92vgnae7y3W+MQihEvnnaFGq4DS 43M6HoVImyhy/rBKZHFZ =NHQx -----END PGP SIGNATURE----- --Apple-Mail=_A40E86D8-A260-43EC-A917-4D9DC2799B17-- From owner-svn-src-head@FreeBSD.ORG Mon May 26 23:02:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D37BDAC; Mon, 26 May 2014 23:02:59 +0000 (UTC) Received: from shxd.cx (unknown [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0073241C; Mon, 26 May 2014 23:02:58 +0000 (UTC) Received: from [64.201.244.132] (port=53313 helo=THEMADHATTER) by shxd.cx with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1Wp1nk-000LJI-Jj; Mon, 26 May 2014 13:47:20 -0700 From: To: "'Nathan Whitehorn'" , "'Tijl Coosemans'" , "'Warner Losh'" References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> <5380EBA8.1030200@freebsd.org> <20140525011307.142b41ab@kalimero.tijl.coosemans.org> <3CCAFAD3-FABE-40EF-ABF9-815FE5826349@bsdimp.com> <9FE34CE4-C71F-4806-9EF6-30CB1051C62F@bsdimp.com> <20140526113502.239db74d@kalimero.tijl.coosemans.org> <5383522F.30108@freebsd.org> In-Reply-To: <5383522F.30108@freebsd.org> Subject: RE: svn commit: r266553 - head/release/scripts Date: Mon, 26 May 2014 16:02:52 -0700 Message-ID: <004b01cf7936$9fb11050$df1330f0$@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-7" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQHdPgTFPREzQRYERns9ydjfQ/LYeQD45SvnAeiba4YCr1Q7mAHI2CoHArbLyAIC8hb2fQKTttJEAaNqp74BmbWJugHjPLPKAocC8BwBX83unAC6aFpUAfkUDtsAtgvO/JpXQ6Dw Content-Language: en-us Sender: devin@shxd.cx Cc: 'Baptiste Daroussin' , src-committers@freebsd.org, 'Ian Lepore' , svn-src-all@freebsd.org, 'Glen Barber' , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 23:02:59 -0000 > -----Original Message----- > From: owner-src-committers@freebsd.org [mailto:owner-src- > committers@freebsd.org] On Behalf Of Nathan Whitehorn > Sent: Monday, May 26, 2014 7:40 AM > To: Tijl Coosemans; Warner Losh > Cc: Ian Lepore; Baptiste Daroussin; svn-src-head@freebsd.org; Glen Barber; > svn-src-all@freebsd.org; src-committers@freebsd.org > Subject: Re: svn commit: r266553 - head/release/scripts > > On 05/26/14 02:35, Tijl Coosemans wrote: > > On Sat, 24 May 2014 19:00:18 -0600 Warner Losh wrote: > >> On May 24, 2014, at 5:53 PM, Warner Losh wrote: > >>> On May 24, 2014, at 5:13 PM, Tijl Coosemans wrote: > >>>> There isn't necessarily any chroot environment. There's one > >>>> kernel, two equally valid ABIs (ILP32 and LP64) and any binary like > >>>> uname might use either of them. If uname -p returns a different > >>>> result depending on which of these two ABIs it was compiled for > >>>> that could be a problem for any script that uses it. > >>> Well, it depends on what you want to do with the script, eh? If you > >>> want to know the ABI of the native binary uname, that?s one thing. > >>> But if you want to know the supported ABIs, you are doing it wrong by > using uname. > >>> You should be using sysctl kern.supported_abi. That will tell you > >>> all the ABIs that you can install packages for on this machine, > >>> which is what you really want to know. So I?m having trouble > >>> connecting the dots between this and what you are saying here. > >>> > >>> I still am absolutely flabbergasted why the MACHINE_ARCH names > >>> aren?t necessary and sufficient for packaging. I?ve yet to see any > >>> coherent reason to not use them. > >> Why do I care that they match? Good question. When I was doing > >> FreeNAS, I looked at integrating pkgng into nanobsd. At the time this > >> was quite difficult because every single architecture name was > >> different between pkgng and MACHINE_ARCH. This would mean I?d have > >> to drag around a huge table to know how to translate one to the other > >> (there was no simple regex either, and things like mipsn32 wouldn?t > >> have fit into the scheme at the time). I would very much like us to > >> see us keep these names in sync and avoid large translation tables that > are difficult to maintain. > >> > >> Now, do you need to get it from uname -p? No. If you want to parse > >> elf files to get it, that?s fine, so long as the names map directly > >> to the MACHINE_ARCH names that we?ve been using for years. They > >> completely describe the universe of supported platforms. Are they > >> perfect? No, around the edge there may be an odd-ball that?s possible > >> to build, but is unsupported and likely doesn?t work at all. Have we > >> learned from these mistakes? Yes. Anything that?s actively supported > >> has a proper name. This name is needed, btw, so that any machine can > >> self-host, a nice feature of the /usr/src system. > > ABI consists of the following elements: > > > > - OS > > - OS ABI version (major version number in FreeBSD) > > - instruction set > > - programming model (ILP32 or LP64) > > - byte order (little/big endian) > > > > These are almost orthogonal dimensions in the sense that almost any > > combination is possible. (A combination that isn't possible is a > > 32-bit instruction set with LP64.) > > > > What you are asking for now is to combine two dimensions into one and > > combination in this case means multiplication so if you have 3 > > instruction sets and 2 programming models, the combined dimension > > needs > > 6 different values. You need to make the case for why you think this > > is a good idea. For the past 20 years we got away with this because > > on every installation of FreeBSD we only used one programming model at > > a time. This is still the case for byte order of course. > > > > What I'm saying is to keep the option open for installations with > > multiple programming models, where most binaries could use ILP32 and > > only the ones that actually need a 64-bit address space use LP64. > > You query the instruction set using uname and the programming models > > using getconf. > > > > I suppose you could replace the "x86" in the pkg scheme with > > i386/amd64, but then you'd still be talking about i386:32, amd64:32 > > and amd64:64 instead of x86:32, x86:x32 and x86:64. > > > > No. We support multiple "models" now and have for ten years. That's what > MACHINE_ARCH is for: it defines the choice of the last three things you list > above. Specifically, a shared value of MACHINE_ARCH guarantees and OS > version guarantees, in FreeBSD-land, complete binary compatibility of > executables. Kernels support multiple ones, in general (e.g. i386 binaries on > amd64, powerpc binaries on powerpc64). They may support more in the > future (x32 on amd64, potentially even cross-endian binaries). We have a > nice flexible scheme in FreeBSD for supporting this. If you want to find out > the list of the things the installed kernel can run, check the > kern.supported_archs sysctl. Simple. > > These strings are just as expressive as the ones in pkg. They are the > standard. They're what external build systems test against, what the src, doc, > and ports trees use to define what to do universally. It's what users and code > expect. The wheel we've had for 20 years is perfectly good -- why invent a > new, incompatible one? +1 Trying to handle things like PR bin/187458 wherein I'm finding that if I want to have both a usable $PKG_ABI variable in my code _and_ not automatically bootstrap pkg to get at said ABI, I'm going to have to do one of two things: a. pepper throughout my code -- everywhere I require $PKG_ABI to be set -- some new code that will check if it is NULL (pkg hasn't been bootstrapped yet and thus cannot provide an ABI) and then prompt the user asking them if it is OK to bootstrap the thing. Alternatively... b. Build a table that maps from arch/march to proposed ABI Not ideal in my mindset, +1 to Nathan's cogent argument above and many that came prior in the thread. -- Devin From owner-svn-src-head@FreeBSD.ORG Tue May 27 01:47:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23F9D43E; Tue, 27 May 2014 01:47:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11FD82F3A; Tue, 27 May 2014 01:47:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4R1lNCc094924; Tue, 27 May 2014 01:47:23 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4R1lNBC094923; Tue, 27 May 2014 01:47:23 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201405270147.s4R1lNBC094923@svn.freebsd.org> From: Kevin Lo Date: Tue, 27 May 2014 01:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266721 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 01:47:24 -0000 Author: kevlo Date: Tue May 27 01:47:23 2014 New Revision: 266721 URL: http://svnweb.freebsd.org/changeset/base/266721 Log: Remove r264317 by accident. Spotted by: Kuan-Chung Chiu Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Mon May 26 23:47:57 2014 (r266720) +++ head/sys/dev/usb/wlan/if_urtwn.c Tue May 27 01:47:23 2014 (r266721) @@ -96,6 +96,7 @@ static const STRUCT_USB_HOST_ID urtwn_de URTWN_DEV(ABOCOM, RTL8188CU_2), URTWN_DEV(ABOCOM, RTL8192CU), URTWN_DEV(ASUS, RTL8192CU), + URTWN_DEV(ASUS, USBN10NANO), URTWN_DEV(AZUREWAVE, RTL8188CE_1), URTWN_DEV(AZUREWAVE, RTL8188CE_2), URTWN_DEV(AZUREWAVE, RTL8188CU), From owner-svn-src-head@FreeBSD.ORG Tue May 27 01:47:46 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29552578; Tue, 27 May 2014 01:47:46 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id B54162F41; Tue, 27 May 2014 01:47:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id CEE7438061; Mon, 26 May 2014 20:47:38 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id xlgKVFU5aE4A; Mon, 26 May 2014 20:47:38 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 7BDE73805B; Mon, 26 May 2014 20:47:36 -0500 (CDT) Message-ID: <5383EEB6.6010703@freebsd.org> Date: Mon, 26 May 2014 18:47:34 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: dteske@FreeBSD.org, 'Tijl Coosemans' , 'Warner Losh' Subject: Re: svn commit: r266553 - head/release/scripts References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> <5380EBA8.1030200@freebsd.org> <20140525011307.142b41ab@kalimero.tijl.coosemans.org> <3CCAFAD3-FABE-40EF-ABF9-815FE5826349@bsdimp.com> <9FE34CE4-C71F-4806-9EF6-30CB1051C62F@bsdimp.com> <20140526113502.239db74d@kalimero.tijl.coosemans.org> <5383522F.30108@freebsd.org> <004b01cf7936$9fb11050$df1330f0$@FreeBSD.org> In-Reply-To: <004b01cf7936$9fb11050$df1330f0$@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-7; format=flowed Content-Transfer-Encoding: 7bit Cc: 'Baptiste Daroussin' , src-committers@FreeBSD.org, 'Ian Lepore' , svn-src-all@FreeBSD.org, 'Glen Barber' , svn-src-head@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 01:47:46 -0000 On 05/26/14 16:02, dteske@FreeBSD.org wrote: > >> -----Original Message----- >> From: owner-src-committers@freebsd.org [mailto:owner-src- >> committers@freebsd.org] On Behalf Of Nathan Whitehorn >> Sent: Monday, May 26, 2014 7:40 AM >> To: Tijl Coosemans; Warner Losh >> Cc: Ian Lepore; Baptiste Daroussin; svn-src-head@freebsd.org; Glen Barber; >> svn-src-all@freebsd.org; src-committers@freebsd.org >> Subject: Re: svn commit: r266553 - head/release/scripts >> >> On 05/26/14 02:35, Tijl Coosemans wrote: >>> On Sat, 24 May 2014 19:00:18 -0600 Warner Losh wrote: >>>> On May 24, 2014, at 5:53 PM, Warner Losh wrote: >>>>> On May 24, 2014, at 5:13 PM, Tijl Coosemans wrote: >>>>>> There isn't necessarily any chroot environment. There's one >>>>>> kernel, two equally valid ABIs (ILP32 and LP64) and any binary like >>>>>> uname might use either of them. If uname -p returns a different >>>>>> result depending on which of these two ABIs it was compiled for >>>>>> that could be a problem for any script that uses it. >>>>> Well, it depends on what you want to do with the script, eh? If you >>>>> want to know the ABI of the native binary uname, that?s one thing. >>>>> But if you want to know the supported ABIs, you are doing it wrong by >> using uname. >>>>> You should be using sysctl kern.supported_abi. That will tell you >>>>> all the ABIs that you can install packages for on this machine, >>>>> which is what you really want to know. So I?m having trouble >>>>> connecting the dots between this and what you are saying here. >>>>> >>>>> I still am absolutely flabbergasted why the MACHINE_ARCH names >>>>> aren?t necessary and sufficient for packaging. I?ve yet to see any >>>>> coherent reason to not use them. >>>> Why do I care that they match? Good question. When I was doing >>>> FreeNAS, I looked at integrating pkgng into nanobsd. At the time this >>>> was quite difficult because every single architecture name was >>>> different between pkgng and MACHINE_ARCH. This would mean I?d have >>>> to drag around a huge table to know how to translate one to the other >>>> (there was no simple regex either, and things like mipsn32 wouldn?t >>>> have fit into the scheme at the time). I would very much like us to >>>> see us keep these names in sync and avoid large translation tables that >> are difficult to maintain. >>>> Now, do you need to get it from uname -p? No. If you want to parse >>>> elf files to get it, that?s fine, so long as the names map directly >>>> to the MACHINE_ARCH names that we?ve been using for years. They >>>> completely describe the universe of supported platforms. Are they >>>> perfect? No, around the edge there may be an odd-ball that?s possible >>>> to build, but is unsupported and likely doesn?t work at all. Have we >>>> learned from these mistakes? Yes. Anything that?s actively supported >>>> has a proper name. This name is needed, btw, so that any machine can >>>> self-host, a nice feature of the /usr/src system. >>> ABI consists of the following elements: >>> >>> - OS >>> - OS ABI version (major version number in FreeBSD) >>> - instruction set >>> - programming model (ILP32 or LP64) >>> - byte order (little/big endian) >>> >>> These are almost orthogonal dimensions in the sense that almost any >>> combination is possible. (A combination that isn't possible is a >>> 32-bit instruction set with LP64.) >>> >>> What you are asking for now is to combine two dimensions into one and >>> combination in this case means multiplication so if you have 3 >>> instruction sets and 2 programming models, the combined dimension >>> needs >>> 6 different values. You need to make the case for why you think this >>> is a good idea. For the past 20 years we got away with this because >>> on every installation of FreeBSD we only used one programming model at >>> a time. This is still the case for byte order of course. >>> >>> What I'm saying is to keep the option open for installations with >>> multiple programming models, where most binaries could use ILP32 and >>> only the ones that actually need a 64-bit address space use LP64. >>> You query the instruction set using uname and the programming models >>> using getconf. >>> >>> I suppose you could replace the "x86" in the pkg scheme with >>> i386/amd64, but then you'd still be talking about i386:32, amd64:32 >>> and amd64:64 instead of x86:32, x86:x32 and x86:64. >>> >> No. We support multiple "models" now and have for ten years. That's what >> MACHINE_ARCH is for: it defines the choice of the last three things you > list >> above. Specifically, a shared value of MACHINE_ARCH guarantees and OS >> version guarantees, in FreeBSD-land, complete binary compatibility of >> executables. Kernels support multiple ones, in general (e.g. i386 binaries > on >> amd64, powerpc binaries on powerpc64). They may support more in the >> future (x32 on amd64, potentially even cross-endian binaries). We have a >> nice flexible scheme in FreeBSD for supporting this. If you want to find > out >> the list of the things the installed kernel can run, check the >> kern.supported_archs sysctl. Simple. >> >> These strings are just as expressive as the ones in pkg. They are the >> standard. They're what external build systems test against, what the src, > doc, >> and ports trees use to define what to do universally. It's what users and > code >> expect. The wheel we've had for 20 years is perfectly good -- why invent a >> new, incompatible one? > +1 > > Trying to handle things like PR bin/187458 wherein I'm finding that if I > want to > have both a usable $PKG_ABI variable in my code _and_ not automatically > bootstrap pkg to get at said ABI, I'm going to have to do one of two things: > > a. pepper throughout my code -- everywhere I require $PKG_ABI to be set -- > some new code that will check if it is NULL (pkg hasn't been bootstrapped > yet > and thus cannot provide an ABI) and then prompt the user asking them if it > is > OK to bootstrap the thing. > > Alternatively... > > b. Build a table that maps from arch/march to proposed ABI > > Not ideal in my mindset, +1 to Nathan's cogent argument above and many > that came prior in the thread. I've written two patches today. The first (http://people.freebsd.org/~nwhitehorn/pkg_machinearch.diff) is to pkg itself and the second (http://people.freebsd.org/~nwhitehorn/pkg_bootstrap_machinearch.diff) is to the pkg bootstrapper in base. These switch pkg from using identifiers like "freebsd:11:arm:be:eabi:softfp" to identifiers like "FreeBSD:11:armeb", matching the canonical FreeBSD platform identifiers. The strings it uses can be predicted easily from scripts, as they are identical in all cases to the output of `uname -s`:`uname -r | cut -f 1 -d .`:`uname -p`. I tried to avoid changing much, so the patches are pretty short. Internally, the patch introduces a translation table to pkg that contains all extant FreeBSD and Dragonfly BSD architectures and moves between the ELF-based coding and MACHINE_ARCH values. This is kind of gross, but has the least possibility for regression, and can easily be changed behind the scenes later. Platform detection uses the same ELF-parsing code as before. The current/previous values are also kept so that the patched pkg can install a package marked either with an x86:64 or amd64-type architecture ID (symlinks will be needed for a little bit on the package server to allow both clients to work). Limited testing suggests it works well -- I can fetch and install packages fine. More testing would be great. One small issue is how to bootstrap the change for existing binary package users. The modified pkg can use packages with either architecture ID just, but the current one will barf on the FreeBSD:11:amd64 package containing its own update. There are a couple of options: manual instructions, marking that one package with the old-style architecture ID, etc. None should be more than slightly irritating, though. The least bumpy route, I think, is making directories with both the old and new names, but putting only one package in the old-named directory: a special intermediate version of pkg marked with the old architecture ID but able to install from the new one. Then you just have to deal with two rounds of updates without any other intervention, which is not so bad. -Nathan From owner-svn-src-head@FreeBSD.ORG Tue May 27 01:50:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D11E6D7; Tue, 27 May 2014 01:50:50 +0000 (UTC) Received: from ns.kevlo.org (220-135-115-6.HINET-IP.hinet.net [220.135.115.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "ns.kevlo.org", Issuer "ns.kevlo.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9526E2FC2; Tue, 27 May 2014 01:50:48 +0000 (UTC) Received: from ns.kevlo.org (localhost [127.0.0.1]) by ns.kevlo.org (8.14.8/8.14.8) with ESMTP id s4R1oOXI090413 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 27 May 2014 09:50:24 +0800 (CST) (envelope-from kevlo@ns.kevlo.org) Received: (from kevlo@localhost) by ns.kevlo.org (8.14.8/8.14.8/Submit) id s4R1oOnQ090412; Tue, 27 May 2014 09:50:24 +0800 (CST) (envelope-from kevlo) Date: Tue, 27 May 2014 09:50:23 +0800 From: Kevin Lo To: Buganini Subject: Re: svn commit: r264912 - in head: share/man/man4 sys/conf sys/contrib/dev/urtwn sys/dev/usb sys/dev/usb/wlan sys/modules/usb/urtwnfw sys/modules/usb/urtwnfw/urtwnrtl8188eu Message-ID: <20140527015023.GA90400@ns.kevlo.org> References: <201404250801.s3P81ME1008705@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 01:50:50 -0000 On Tue, May 27, 2014 at 04:03:05AM +0800, Buganini wrote: > > I think this accidentally removed > URTWN_DEV(ASUS, USBN10NANO), Fixed in r266721. Thanks for pointing that out. From owner-svn-src-head@FreeBSD.ORG Tue May 27 02:00:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63E56A61; Tue, 27 May 2014 02:00:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 513CE207B; Tue, 27 May 2014 02:00:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4R20ip1099800; Tue, 27 May 2014 02:00:44 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4R20iW6099799; Tue, 27 May 2014 02:00:44 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405270200.s4R20iW6099799@svn.freebsd.org> From: Mark Johnston Date: Tue, 27 May 2014 02:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266723 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 02:00:44 -0000 Author: markj Date: Tue May 27 02:00:43 2014 New Revision: 266723 URL: http://svnweb.freebsd.org/changeset/base/266723 Log: Garbage-collect a couple of unused identifiers. MFC after: 3 days Modified: head/sys/sys/dtrace_bsd.h Modified: head/sys/sys/dtrace_bsd.h ============================================================================== --- head/sys/sys/dtrace_bsd.h Tue May 27 01:58:05 2014 (r266722) +++ head/sys/sys/dtrace_bsd.h Tue May 27 02:00:43 2014 (r266723) @@ -60,11 +60,9 @@ int dtrace_trap(struct trapframe *, u_in extern dtrace_trap_func_t dtrace_trap_func; /* Used by the machine dependent trap() code. */ -typedef int (*dtrace_invop_func_t)(uintptr_t, uintptr_t *, uintptr_t); typedef void (*dtrace_doubletrap_func_t)(void); /* Global variables in trap.c */ -extern dtrace_invop_func_t dtrace_invop_func; extern dtrace_doubletrap_func_t dtrace_doubletrap_func; /* Pid provider hooks */ From owner-svn-src-head@FreeBSD.ORG Tue May 27 04:26:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63E50BD; Tue, 27 May 2014 04:26:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 446932B17; Tue, 27 May 2014 04:26:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4R4QOQG066532; Tue, 27 May 2014 04:26:24 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4R4QNCZ066526; Tue, 27 May 2014 04:26:23 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405270426.s4R4QNCZ066526@svn.freebsd.org> From: Neel Natu Date: Tue, 27 May 2014 04:26:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266724 - in head: sys/amd64/include sys/amd64/vmm usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 04:26:24 -0000 Author: neel Date: Tue May 27 04:26:22 2014 New Revision: 266724 URL: http://svnweb.freebsd.org/changeset/base/266724 Log: Add segment protection and limits violation checks in vie_calculate_gla() for 32-bit x86 guests. Tested using ins/outs executed in a FreeBSD/i386 guest. Modified: head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_instruction_emul.h head/sys/amd64/vmm/vmm_instruction_emul.c head/sys/amd64/vmm/vmm_ioport.c head/usr.sbin/bhyve/inout.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Tue May 27 02:00:43 2014 (r266723) +++ head/sys/amd64/include/vmm.h Tue May 27 04:26:22 2014 (r266724) @@ -321,6 +321,11 @@ struct seg_desc { uint32_t limit; uint32_t access; }; +#define SEG_DESC_TYPE(desc) ((desc)->access & 0x001f) +#define SEG_DESC_PRESENT(desc) ((desc)->access & 0x0080) +#define SEG_DESC_DEF32(desc) ((desc)->access & 0x4000) +#define SEG_DESC_GRANULARITY(desc) ((desc)->access & 0x8000) +#define SEG_DESC_UNUSABLE(desc) ((desc)->access & 0x10000) enum vm_cpu_mode { CPU_MODE_COMPATIBILITY, /* IA-32E mode (CS.L = 0) */ Modified: head/sys/amd64/include/vmm_instruction_emul.h ============================================================================== --- head/sys/amd64/include/vmm_instruction_emul.h Tue May 27 02:00:43 2014 (r266723) +++ head/sys/amd64/include/vmm_instruction_emul.h Tue May 27 04:26:22 2014 (r266724) @@ -29,6 +29,8 @@ #ifndef _VMM_INSTRUCTION_EMUL_H_ #define _VMM_INSTRUCTION_EMUL_H_ +#include + /* * Callback functions to read and write memory regions. */ @@ -67,8 +69,9 @@ int vie_canonical_check(enum vm_cpu_mode uint64_t vie_size2mask(int size); -int vie_calculate_gla(enum vm_cpu_mode cpu_mode, int addrsize, - enum vm_reg_name seg, struct seg_desc *desc, uint64_t off, uint64_t *gla); +int vie_calculate_gla(enum vm_cpu_mode cpu_mode, enum vm_reg_name seg, + struct seg_desc *desc, uint64_t off, int length, int addrsize, int prot, + uint64_t *gla); #ifdef _KERNEL /* Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Tue May 27 02:00:43 2014 (r266723) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Tue May 27 04:26:22 2014 (r266724) @@ -608,16 +608,92 @@ vie_size2mask(int size) } int -vie_calculate_gla(enum vm_cpu_mode cpu_mode, int addrsize, enum vm_reg_name seg, - struct seg_desc *desc, uint64_t offset, uint64_t *gla) +vie_calculate_gla(enum vm_cpu_mode cpu_mode, enum vm_reg_name seg, + struct seg_desc *desc, uint64_t offset, int length, int addrsize, + int prot, uint64_t *gla) { - uint64_t segbase; - int glasize; + uint64_t low_limit, high_limit, segbase; + int glasize, type; KASSERT(seg >= VM_REG_GUEST_ES && seg <= VM_REG_GUEST_GS, ("%s: invalid segment %d", __func__, seg)); + KASSERT(length == 1 || length == 2 || length == 4 || length == 8, + ("%s: invalid operand size %d", __func__, length)); + KASSERT((prot & ~(PROT_READ | PROT_WRITE)) == 0, + ("%s: invalid prot %#x", __func__, prot)); - glasize = (cpu_mode == CPU_MODE_64BIT) ? 8 : 4; + if (cpu_mode == CPU_MODE_64BIT) { + KASSERT(addrsize == 4 || addrsize == 8, ("%s: invalid address " + "size %d for cpu_mode %d", __func__, addrsize, cpu_mode)); + glasize = 8; + } else { + KASSERT(addrsize == 2 || addrsize == 4, ("%s: invalid address " + "size %d for cpu mode %d", __func__, addrsize, cpu_mode)); + glasize = 4; + /* + * If the segment selector is loaded with a NULL selector + * then the descriptor is unusable and attempting to use + * it results in a #GP(0). + */ + if (SEG_DESC_UNUSABLE(desc)) + return (-1); + + /* + * The processor generates a #NP exception when a segment + * register is loaded with a selector that points to a + * descriptor that is not present. If this was the case then + * it would have been checked before the VM-exit. + */ + KASSERT(SEG_DESC_PRESENT(desc), ("segment %d not present: %#x", + seg, desc->access)); + + /* + * The descriptor type must indicate a code/data segment. + */ + type = SEG_DESC_TYPE(desc); + KASSERT(type >= 16 && type <= 31, ("segment %d has invalid " + "descriptor type %#x", seg, type)); + + if (prot & PROT_READ) { + /* #GP on a read access to a exec-only code segment */ + if ((type & 0xA) == 0x8) + return (-1); + } + + if (prot & PROT_WRITE) { + /* + * #GP on a write access to a code segment or a + * read-only data segment. + */ + if (type & 0x8) /* code segment */ + return (-1); + + if ((type & 0xA) == 0) /* read-only data seg */ + return (-1); + } + + /* + * 'desc->limit' is fully expanded taking granularity into + * account. + */ + if ((type & 0xC) == 0x4) { + /* expand-down data segment */ + low_limit = desc->limit + 1; + high_limit = SEG_DESC_DEF32(desc) ? 0xffffffff : 0xffff; + } else { + /* code segment or expand-up data segment */ + low_limit = 0; + high_limit = desc->limit; + } + + while (length > 0) { + offset &= vie_size2mask(addrsize); + if (offset < low_limit || offset > high_limit) + return (-1); + offset++; + length--; + } + } /* * In 64-bit mode all segments except %fs and %gs have a segment Modified: head/sys/amd64/vmm/vmm_ioport.c ============================================================================== --- head/sys/amd64/vmm/vmm_ioport.c Tue May 27 02:00:43 2014 (r266723) +++ head/sys/amd64/vmm/vmm_ioport.c Tue May 27 04:26:22 2014 (r266724) @@ -143,36 +143,6 @@ done: static int emulate_inout_str(struct vm *vm, int vcpuid, struct vm_exit *vmexit, bool *retu) { - struct vm_inout_str *vis; - int in; - - vis = &vmexit->u.inout_str; - in = vis->inout.in; - - /* - * ins/outs VM exit takes precedence over the following error - * conditions that would ordinarily be checked by the processor: - * - * - #GP(0) due to segment being unusable. - * - #GP(0) due to memory operand effective address outside the limit - * of the segment. - * - #AC(0) if alignment checking is enabled and an unaligned memory - * reference is made at CPL=3 - */ - - /* - * XXX - * inout string emulation only supported in 64-bit mode. - * - * The #GP(0) fault conditions described above don't apply in - * 64-bit mode. - */ - if (vis->paging.cpu_mode != CPU_MODE_64BIT) { - VCPU_CTR1(vm, vcpuid, "ins/outs not emulated in cpu mode %d", - vis->paging.cpu_mode); - return (EINVAL); - } - *retu = true; return (0); /* Return to userspace to finish emulation */ } Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Tue May 27 02:00:43 2014 (r266723) +++ head/usr.sbin/bhyve/inout.c Tue May 27 04:26:22 2014 (r266724) @@ -103,7 +103,7 @@ register_default_iohandler(int start, in int emulate_inout(struct vmctx *ctx, int vcpu, struct vm_exit *vmexit, int strict) { - int addrsize, bytes, flags, in, port, rep; + int addrsize, bytes, flags, in, port, prot, rep; uint32_t val; inout_func_t handler; void *arg; @@ -141,6 +141,7 @@ emulate_inout(struct vmctx *ctx, int vcp vis = &vmexit->u.inout_str; rep = vis->inout.rep; addrsize = vis->addrsize; + prot = in ? PROT_WRITE : PROT_READ; assert(addrsize == 2 || addrsize == 4 || addrsize == 8); /* Index register */ @@ -152,8 +153,8 @@ emulate_inout(struct vmctx *ctx, int vcp while (count) { if (vie_calculate_gla(vis->paging.cpu_mode, - vis->addrsize, vis->seg_name, &vis->seg_desc, - index, &gla)) { + vis->seg_name, &vis->seg_desc, index, bytes, + addrsize, prot, &gla)) { error = vm_inject_exception2(ctx, vcpu, IDT_GP, 0); assert(error == 0); @@ -161,7 +162,7 @@ emulate_inout(struct vmctx *ctx, int vcp } error = vm_gla2gpa(ctx, vcpu, &vis->paging, gla, bytes, - in ? PROT_WRITE : PROT_READ, iov, nitems(iov)); + prot, iov, nitems(iov)); assert(error == 0 || error == 1 || error == -1); if (error) { retval = (error == 1) ? INOUT_RESTART : From owner-svn-src-head@FreeBSD.ORG Tue May 27 04:30:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3742233; Tue, 27 May 2014 04:30:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E08EE2B9A; Tue, 27 May 2014 04:30:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4R4Uu4G067507; Tue, 27 May 2014 04:30:56 GMT (envelope-from allanjude@svn.freebsd.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4R4UuLA067506; Tue, 27 May 2014 04:30:56 GMT (envelope-from allanjude@svn.freebsd.org) Message-Id: <201405270430.s4R4UuLA067506@svn.freebsd.org> From: Allan Jude Date: Tue, 27 May 2014 04:30:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266725 - head/lib/libc/string X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 04:30:57 -0000 Author: allanjude (doc committer) Date: Tue May 27 04:30:56 2014 New Revision: 266725 URL: http://svnweb.freebsd.org/changeset/base/266725 Log: Emphasis on 'do not' and 'complement' in the strcspn(3) Replace literal parentheses with .Po/.Pc Approved by: wblock (mentor) Modified: head/lib/libc/string/strspn.3 Modified: head/lib/libc/string/strspn.3 ============================================================================== --- head/lib/libc/string/strspn.3 Tue May 27 04:26:22 2014 (r266724) +++ head/lib/libc/string/strspn.3 Tue May 27 04:30:56 2014 (r266725) @@ -71,13 +71,14 @@ spans the initial part of the null-termi .Fa s as long as the characters from .Fa s -do not occur in the null-terminated string +.Sy do not +occur in the null-terminated string .Fa charset -(it -spans the -.Em complement +.Po it spans the +.Sy complement of -.Fa charset ) . +.Fa charset +.Pc . In other words, it computes the string array index of the first character of .Fa s From owner-svn-src-head@FreeBSD.ORG Tue May 27 04:52:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B2F66CA; Tue, 27 May 2014 04:52:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C1242D29; Tue, 27 May 2014 04:52:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4R4qX4q079540; Tue, 27 May 2014 04:52:33 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4R4qWM8079533; Tue, 27 May 2014 04:52:32 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201405270452.s4R4qWM8079533@svn.freebsd.org> From: Peter Wemm Date: Tue, 27 May 2014 04:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266728 - in head/contrib/serf: . auth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 04:52:34 -0000 Author: peter Date: Tue May 27 04:52:32 2014 New Revision: 266728 URL: http://svnweb.freebsd.org/changeset/base/266728 Log: Update serf 1.3.4 -> 1.3.5 Modified: head/contrib/serf/CHANGES head/contrib/serf/auth/auth.c head/contrib/serf/auth/auth_spnego.c head/contrib/serf/outgoing.c head/contrib/serf/serf.h head/contrib/serf/ssltunnel.c Directory Properties: head/contrib/serf/ (props changed) Modified: head/contrib/serf/CHANGES ============================================================================== --- head/contrib/serf/CHANGES Tue May 27 04:39:23 2014 (r266727) +++ head/contrib/serf/CHANGES Tue May 27 04:52:32 2014 (r266728) @@ -1,4 +1,11 @@ -Serf 1.3.4 [2014-02-08, from /tags/1.3.4, rxxxx] +Serf 1.3.5 [2014-04-27, from /tags/1.3.5, rxxxx] + Fix issue #125: no reverse lookup during Negotiate authentication for proxies. + Fix a crash caused by incorrect reuse of the ssltunnel CONNECT request (r2316) + Cancel request if response parsing failed + authn callback set (r2319) + Update the expired certificates in the test suite. + + +Serf 1.3.4 [2014-02-08, from /tags/1.3.4, r2310] Fix issue #119: Endless loop during ssl tunnel setup with Negotiate authn Fix issue #123: Can't setup ssl tunnel which sends Connection close header Fix a race condition when initializing OpenSSL from multiple threads (r2263) Modified: head/contrib/serf/auth/auth.c ============================================================================== --- head/contrib/serf/auth/auth.c Tue May 27 04:39:23 2014 (r266727) +++ head/contrib/serf/auth/auth.c Tue May 27 04:52:32 2014 (r266728) @@ -408,6 +408,7 @@ apr_status_t serf__handle_auth_response( consider the reponse body as invalid and discard it. */ status = discard_body(response); *consumed_response = 1; + if (!APR_STATUS_IS_EOF(status)) { return status; } Modified: head/contrib/serf/auth/auth_spnego.c ============================================================================== --- head/contrib/serf/auth/auth_spnego.c Tue May 27 04:39:23 2014 (r266727) +++ head/contrib/serf/auth/auth_spnego.c Tue May 27 04:52:32 2014 (r266728) @@ -335,8 +335,7 @@ do_auth(peer_t peer, &tmp, &tmp_len, gss_info); } else { - char *proxy_host; - apr_getnameinfo(&proxy_host, conn->ctx->proxy_address, 0); + char *proxy_host = conn->ctx->proxy_address->hostname; status = gss_api_get_credentials(conn, token, token_len, proxy_host, &tmp, &tmp_len, Modified: head/contrib/serf/outgoing.c ============================================================================== --- head/contrib/serf/outgoing.c Tue May 27 04:39:23 2014 (r266727) +++ head/contrib/serf/outgoing.c Tue May 27 04:52:32 2014 (r266728) @@ -916,21 +916,22 @@ static apr_status_t handle_response(serf * themselves by not registering credential callbacks. */ if (request->conn->ctx->cred_cb) { - status = serf__handle_auth_response(&consumed_response, - request, - request->resp_bkt, - request->handler_baton, - pool); - - /* If there was an error reading the response (maybe there wasn't - enough data available), don't bother passing the response to the - application. - - If the authentication was tried, but failed, pass the response - to the application, maybe it can do better. */ - if (status) { - return status; - } + status = serf__handle_auth_response(&consumed_response, + request, + request->resp_bkt, + request->handler_baton, + pool); + + if (SERF_BUCKET_READ_ERROR(status)) { + /* Report the request as 'died'/'cancelled' to the application */ + (void)(*request->handler)(request, + NULL, + request->handler_baton, + pool); + } + + if (status) + return status; } if (!consumed_response) { Modified: head/contrib/serf/serf.h ============================================================================== --- head/contrib/serf/serf.h Tue May 27 04:39:23 2014 (r266727) +++ head/contrib/serf/serf.h Tue May 27 04:52:32 2014 (r266728) @@ -1062,7 +1062,7 @@ void serf_debug__bucket_alloc_check( /* Version info */ #define SERF_MAJOR_VERSION 1 #define SERF_MINOR_VERSION 3 -#define SERF_PATCH_VERSION 4 +#define SERF_PATCH_VERSION 5 /* Version number string */ #define SERF_VERSION_STRING APR_STRINGIFY(SERF_MAJOR_VERSION) "." \ Modified: head/contrib/serf/ssltunnel.c ============================================================================== --- head/contrib/serf/ssltunnel.c Tue May 27 04:39:23 2014 (r266727) +++ head/contrib/serf/ssltunnel.c Tue May 27 04:52:32 2014 (r266728) @@ -70,12 +70,11 @@ static apr_status_t handle_response(serf req_ctx_t *ctx = handler_baton; serf_connection_t *conn = request->conn; - if (! response) { - serf_connection_request_create(conn, - setup_request, - ctx); + /* CONNECT request was cancelled. Assuming that this is during connection + reset, we can safely discard the request as a new one will be created + when setting up the next connection. */ + if (!response) return APR_SUCCESS; - } status = serf_bucket_response_status(response, &sl); if (SERF_BUCKET_READ_ERROR(status)) { From owner-svn-src-head@FreeBSD.ORG Tue May 27 04:59:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A3D5ACA; Tue, 27 May 2014 04:59:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 842322D5E; Tue, 27 May 2014 04:59:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4R4xsIS080649; Tue, 27 May 2014 04:59:54 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4R4xrvW080644; Tue, 27 May 2014 04:59:53 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201405270459.s4R4xrvW080644@svn.freebsd.org> From: Peter Wemm Date: Tue, 27 May 2014 04:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266731 - in head: contrib/subversion contrib/subversion/subversion/include contrib/subversion/subversion/include/private contrib/subversion/subversion/libsvn_client contrib/subversion/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 04:59:54 -0000 Author: peter Date: Tue May 27 04:59:53 2014 New Revision: 266731 URL: http://svnweb.freebsd.org/changeset/base/266731 Log: Merge svn-1.8.8 -> 1.8.9 Modified: head/contrib/subversion/CHANGES head/contrib/subversion/NOTICE head/contrib/subversion/build-outputs.mk head/contrib/subversion/configure head/contrib/subversion/configure.ac head/contrib/subversion/subversion/include/private/svn_cache.h head/contrib/subversion/subversion/include/private/svn_dep_compat.h head/contrib/subversion/subversion/include/svn_version.h head/contrib/subversion/subversion/libsvn_client/commit_util.c head/contrib/subversion/subversion/libsvn_client/export.c head/contrib/subversion/subversion/libsvn_client/merge.c head/contrib/subversion/subversion/libsvn_client/prop_commands.c head/contrib/subversion/subversion/libsvn_delta/svndiff.c head/contrib/subversion/subversion/libsvn_fs_fs/fs.c head/contrib/subversion/subversion/libsvn_fs_fs/fs.h head/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h head/contrib/subversion/subversion/libsvn_ra_serf/getlocks.c head/contrib/subversion/subversion/libsvn_ra_serf/inherited_props.c head/contrib/subversion/subversion/libsvn_ra_serf/locks.c head/contrib/subversion/subversion/libsvn_ra_serf/log.c head/contrib/subversion/subversion/libsvn_ra_serf/update.c head/contrib/subversion/subversion/libsvn_ra_svn/protocol head/contrib/subversion/subversion/libsvn_repos/dump.c head/contrib/subversion/subversion/libsvn_repos/fs-wrap.c head/contrib/subversion/subversion/libsvn_subr/cache-memcache.c head/contrib/subversion/subversion/libsvn_subr/config_file.c head/contrib/subversion/subversion/libsvn_subr/internal_statements.h head/contrib/subversion/subversion/libsvn_subr/io.c head/contrib/subversion/subversion/libsvn_subr/prompt.c head/contrib/subversion/subversion/libsvn_subr/sysinfo.c head/contrib/subversion/subversion/libsvn_subr/version.c head/contrib/subversion/subversion/libsvn_wc/status.c head/contrib/subversion/subversion/libsvn_wc/wc-checks.h head/contrib/subversion/subversion/libsvn_wc/wc-metadata.h head/contrib/subversion/subversion/libsvn_wc/wc-metadata.sql head/contrib/subversion/subversion/libsvn_wc/wc-queries.h head/contrib/subversion/subversion/libsvn_wc/wc-queries.sql head/contrib/subversion/subversion/libsvn_wc/wc_db.c head/contrib/subversion/subversion/libsvn_wc/wc_db.h head/contrib/subversion/subversion/libsvn_wc/wc_db_wcroot.c head/contrib/subversion/subversion/svn/conflict-callbacks.c head/contrib/subversion/subversion/svndumpfilter/svndumpfilter.c head/contrib/subversion/subversion/svnrdump/util.c head/contrib/subversion/subversion/svnserve/serve.c head/usr.bin/svn/svn_private_config.h Directory Properties: head/contrib/subversion/ (props changed) Modified: head/contrib/subversion/CHANGES ============================================================================== --- head/contrib/subversion/CHANGES Tue May 27 04:56:06 2014 (r266730) +++ head/contrib/subversion/CHANGES Tue May 27 04:59:53 2014 (r266731) @@ -1,3 +1,70 @@ +Version 1.8.9 +(07 May 2014, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.9 + + User-visible changes: + - Client-side bugfixes: + * log: use proper peg revision over DAV (r1568872) + * upgrade: allow upgrading from 1.7 with exclusive locks (r1572102 et al) + * proplist: resolve inconsitent inherited property results (r1575270 et al) + * increase minimal timestamp sleep from 1ms to 10ms (r1581305 et al) + * merge: automatic merge confused by subtree merge (issue #4481) + * propget: report proper error on invalid revision for url (r1586255) + * commit: fix an assertion when committing a deleted descendant + (r1571747, r1571787, r1571795) + * merge: resolve segfault when '--force' merges a directory delete + (r1577812, r1577813, r1579429) + * resolve: prevent interactive conflict resolution when nothing has been + done to resolve the conflict (r1577294) + * update: fix locks lost from wc with pre-1.6.17 servers (issue #4412) + * merge: honor the 'preserved-conflict-file-exts' setting (r1577151) + * list: fix '--verbose' against older servers (r1591111) + * unlock: fix ability to remove locks with timeouts (r1579588) + * copy: fix 'svn copy URL WC' on relocated working copies + (r1580626, r1580650) + * export: allow file externals to be exported (issue #4427) + * move: fix working copy db inconsistency in cert scenarios (issue #4437) + * commit: fix an issue where mixed revision copy with non copy descendants + that shadow a not present node couldn't be committed (r1518942 et al) + * delete: properly remove move_to info when the node in its original + location is removed (r1538812 et al) + * status; fix an issue where output would vary based on if the target + was the node itself or its parent (r1544597 et al) + + - Server-side bugfixes: + * ensure proper access synchronization in fsfs on Windows (r1568953 et al) + * svnadmin dump: don't let invalid mergeinfo stop dump (r1574868 et al) + * svnserve: resolve performance regression caused by iprops (r1578853 et al) + * reduce size of memory buffer when reading config files (r1581296) + * remove dead transaction if commit was blocked by hook (r1583977) + * svnrdump load: fix crash when svn:* normalization (issue #4490) + * fix memcached support (issue #4470) + * svndumpfilter: fix order of node record headers (r1578670 et al) + * mod_dav_svn: blacklist building with broken versions of httpd; 2.2.25, + 2.4.5 and 2.4.6 (r1545835) + * mod_dav_svn: allow generic DAV clients to refresh locks (issue #3515) + * mod_dav_svn: detect out of dateness correctly during commit (issue #4480) + + Developer-visible changes: + - General: + * improve consistency checks of DAV inherited property requests (r1498000) + * fix ocassional failure in autoprop_tests.py (r1567752) + * avoid duplicate sqlite analyze information rows (r1571214) + * add Mavericks to our sysinfo output (r1573088) + * bump copyright years to 2014 (r1555403) + * unbreak test suite when running as root (r1583580) + * resolve buffer overflow in testcode (r1481782) + * fix libmagic detection with custom LDFLAGS (r1577200) + * fix an out of scope variable use in merge (r1587946) + * javahl: fix crash from resolve callback throwing an exception (r1586439) + * ruby: fix two memory lifetime bugs (r1586052, r1586467) + * fix a missing null byte when handling old pre-1.4 deltas (r1587968) + * fix building with APR 0.9.x (r1585499) + * make svn_ra_get_locks() and svn_ra_get_lock() report not locked nodes + with a NULL svn_lock_t *, as documented (r1578273, r1578311, r1578326) + * fix tests for compiler flags (r1573106) + + Version 1.8.8 (19 Feb 2014, from /branches/1.8.x) http://svn.apache.org/repos/asf/subversion/tags/1.8.8 @@ -620,9 +687,36 @@ http://svn.apache.org/repos/asf/subversi * fix some reference counting bugs in swig-py bindings (r1464899, r1466524) -Version 1.7.15 -(12 Feb 2014, from /branches/1.7.x) -http://svn.apache.org/repos/asf/subversion/tags/1.7.15 +Version 1.7.17 +(07 May 2014, from /branches/1.7.x) +http://svn.apache.org/repos/asf/subversion/tags/1.7.17 + + User-visible changes: + - Client-side bugfixes: + * log: use proper peg revision over DAV (r1568872) + * move: fix errors when moving files between an external and the parent + working copy (r1551579) + * copy: fix 'svn copy URL WC' on relocated working copies + (r1580626, r1580650) + + - Server-side bugfixes: + * mod_dav_svn: blacklist building with broken versions of httpd; 2.2.25, + 2.4.5 and 2.4.6 (r1545835) + * mod_dav_svn: detect out of dateness correctly during commit (issue #4480) + + Developer-visible changes: + - General: + * fix libmagic detection with custom LDFLAGS (r1577200) + * fix a missing null byte when handling old pre-1.4 deltas (r1587968) + * support building with Serf 1.3.x (r1517123, r1535139) + + - Bindings: + * javahl: fix crash from resolve callback throwing an exception (r1586439) + + +Version 1.7.16 +(26 Feb 2014, from /branches/1.7.x) +http://svn.apache.org/repos/asf/subversion/tags/1.7.16 User-visible changes: - Client-side bugfixes: @@ -637,6 +731,11 @@ http://svn.apache.org/repos/asf/subversi - General: * fix failure in checkout_tests.py * support compiling against Cyrus sasl 2.1.25 (r1404912, r1413402) + * support compiling against neon 0.30.x (r1566320) + + +Version 1.7.15 +(Not released, see changes for 1.7.16.) Version 1.7.14 @@ -883,7 +982,7 @@ http://svn.apache.org/repos/asf/subversi * fix ra_serf against Subversion 1.2 servers (r1349367) * fix 'svn upgrade' on working copies with certain tree conflicts (r1345482) * avoid workqueue references to system temp dir (r1367854) - * allow non-existant canonical paths (r1367853) + * allow non-existent canonical paths (r1367853) * fix 'svn revert --depth files' to operate on files (r1365554) * fix ra_serf XML namespace handling against malicious server (r1337441) * fix relocate with server-relative externals (issue 4216) @@ -1235,7 +1334,7 @@ the 1.6 release: http://subversion.apac * fixed: rm -> ci -> cp = missing directory (issue #2763) * fixed: 'svn info' returns parent info on missing dirs (issue #3178) * fixed: spurious prop conflict with 'merge --reintegrate' (issue #3919) - * fixed: 'svn --version' fails with non-existant $HOME (issue #3947) + * fixed: 'svn --version' fails with non-existent $HOME (issue #3947) * fixed: unforced export silently overwites existing file (issue #3799) * fixed: reverse merge which adds subtree mergeinfo fails (issue #3978) * fixed: 'svn up -r{R>HEAD}' hangs client over ra_svn (issue #3963) @@ -1410,7 +1509,7 @@ http://svn.apache.org/repos/asf/subversi * fix crash in mod_dav_svn with GETs of baselined resources (r1104126) See CVE-2011-1752, and descriptive advisory at http://subversion.apache.org/security/CVE-2011-1752-advisory.txt - * fixed: write-through proxy could direcly commit to slave (r917523) + * fixed: write-through proxy could directly commit to slave (r917523) * detect a particular corruption condition in FSFS (r1100213) * improve error message when clients refer to unknown revisions (r939000) * bugfixes and optimizations to the DAV mirroring code (r878607) Modified: head/contrib/subversion/NOTICE ============================================================================== --- head/contrib/subversion/NOTICE Tue May 27 04:56:06 2014 (r266730) +++ head/contrib/subversion/NOTICE Tue May 27 04:59:53 2014 (r266731) @@ -1,5 +1,5 @@ Apache Subversion -Copyright 2013 The Apache Software Foundation +Copyright 2014 The Apache Software Foundation This product includes software developed by many people, and distributed under Contributor License Agreements to The Apache Software Foundation Modified: head/contrib/subversion/build-outputs.mk ============================================================================== --- head/contrib/subversion/build-outputs.mk Tue May 27 04:56:06 2014 (r266730) +++ head/contrib/subversion/build-outputs.mk Tue May 27 04:59:53 2014 (r266731) @@ -2829,17 +2829,17 @@ subversion/tests/libsvn_wc/op-depth-test subversion/tests/libsvn_wc/pristine-store-test.lo: subversion/tests/libsvn_wc/pristine-store-test.c subversion/include/private/svn_debug.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_skel.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_wc.h subversion/libsvn_wc/wc-querie s.h subversion/libsvn_wc/wc.h subversion/libsvn_wc/wc_db.h subversion/libsvn_wc/workqueue.h subversion/svn_private_config.h subversion/tests/libsvn_wc/utils.h subversion/tests/svn_test.h -subversion/tests/libsvn_wc/utils.lo: subversion/tests/libsvn_wc/utils.c subversion/include/private/svn_debug.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_skel.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_wc.h subversion/libsvn_wc/wc-queries.h subversion/libsvn_wc/wc. h subversion/libsvn_wc/wc_db.h subversion/libsvn_wc/wc_db_private.h subversion/svn_private_config.h subversion/tests/libsvn_wc/utils.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h +subversion/tests/libsvn_wc/utils.lo: subversion/tests/libsvn_wc/utils.c subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_skel.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_wc.h subversion/lib svn_wc/wc-queries.h subversion/libsvn_wc/wc.h subversion/libsvn_wc/wc_db.h subversion/libsvn_wc/wc_db_private.h subversion/svn_private_config.h subversion/tests/libsvn_wc/utils.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h -subversion/tests/libsvn_wc/utils.lo: subversion/tests/libsvn_wc/utils.c subversion/include/private/svn_debug.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_skel.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_wc.h subversion/libsvn_wc/wc-queries.h subversion/libsvn_wc/wc. h subversion/libsvn_wc/wc_db.h subversion/libsvn_wc/wc_db_private.h subversion/svn_private_config.h subversion/tests/libsvn_wc/utils.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h +subversion/tests/libsvn_wc/utils.lo: subversion/tests/libsvn_wc/utils.c subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_skel.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_wc.h subversion/lib svn_wc/wc-queries.h subversion/libsvn_wc/wc.h subversion/libsvn_wc/wc_db.h subversion/libsvn_wc/wc_db_private.h subversion/svn_private_config.h subversion/tests/libsvn_wc/utils.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h -subversion/tests/libsvn_wc/utils.lo: subversion/tests/libsvn_wc/utils.c subversion/include/private/svn_debug.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_skel.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_wc.h subversion/libsvn_wc/wc-queries.h subversion/libsvn_wc/wc. h subversion/libsvn_wc/wc_db.h subversion/libsvn_wc/wc_db_private.h subversion/svn_private_config.h subversion/tests/libsvn_wc/utils.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h +subversion/tests/libsvn_wc/utils.lo: subversion/tests/libsvn_wc/utils.c subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_skel.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_wc.h subversion/lib svn_wc/wc-queries.h subversion/libsvn_wc/wc.h subversion/libsvn_wc/wc_db.h subversion/libsvn_wc/wc_db_private.h subversion/svn_private_config.h subversion/tests/libsvn_wc/utils.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h -subversion/tests/libsvn_wc/utils.lo: subversion/tests/libsvn_wc/utils.c subversion/include/private/svn_debug.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_skel.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_wc.h subversion/libsvn_wc/wc-queries.h subversion/libsvn_wc/wc. h subversion/libsvn_wc/wc_db.h subversion/libsvn_wc/wc_db_private.h subversion/svn_private_config.h subversion/tests/libsvn_wc/utils.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h +subversion/tests/libsvn_wc/utils.lo: subversion/tests/libsvn_wc/utils.c subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_skel.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_wc.h subversion/lib svn_wc/wc-queries.h subversion/libsvn_wc/wc.h subversion/libsvn_wc/wc_db.h subversion/libsvn_wc/wc_db_private.h subversion/svn_private_config.h subversion/tests/libsvn_wc/utils.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h -subversion/tests/libsvn_wc/utils.lo: subversion/tests/libsvn_wc/utils.c subversion/include/private/svn_debug.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_skel.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_wc.h subversion/libsvn_wc/wc-queries.h subversion/libsvn_wc/wc. h subversion/libsvn_wc/wc_db.h subversion/libsvn_wc/wc_db_private.h subversion/svn_private_config.h subversion/tests/libsvn_wc/utils.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h +subversion/tests/libsvn_wc/utils.lo: subversion/tests/libsvn_wc/utils.c subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_skel.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_wc.h subversion/lib svn_wc/wc-queries.h subversion/libsvn_wc/wc.h subversion/libsvn_wc/wc_db.h subversion/libsvn_wc/wc_db_private.h subversion/svn_private_config.h subversion/tests/libsvn_wc/utils.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h -subversion/tests/libsvn_wc/utils.lo: subversion/tests/libsvn_wc/utils.c subversion/include/private/svn_debug.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_skel.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_wc.h subversion/libsvn_wc/wc-queries.h subversion/libsvn_wc/wc. h subversion/libsvn_wc/wc_db.h subversion/libsvn_wc/wc_db_private.h subversion/svn_private_config.h subversion/tests/libsvn_wc/utils.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h +subversion/tests/libsvn_wc/utils.lo: subversion/tests/libsvn_wc/utils.c subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_skel.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_wc.h subversion/lib svn_wc/wc-queries.h subversion/libsvn_wc/wc.h subversion/libsvn_wc/wc_db.h subversion/libsvn_wc/wc_db_private.h subversion/svn_private_config.h subversion/tests/libsvn_wc/utils.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h subversion/tests/libsvn_wc/wc-incomplete-tester.lo: subversion/tests/libsvn_wc/wc-incomplete-tester.c subversion/include/private/svn_debug.h subversion/include/private/svn_diff_tree.h subversion/include/private/svn_skel.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/private/svn_wc_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_wc.h subversion/libsvn_wc/wc.h subversion/libsvn_wc/wc_db.h subversion/svn_private_config.h Modified: head/contrib/subversion/configure ============================================================================== --- head/contrib/subversion/configure Tue May 27 04:56:06 2014 (r266730) +++ head/contrib/subversion/configure Tue May 27 04:59:53 2014 (r266731) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for subversion 1.8.8. +# Generated by GNU Autoconf 2.69 for subversion 1.8.9. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='subversion' PACKAGE_TARNAME='subversion' -PACKAGE_VERSION='1.8.8' -PACKAGE_STRING='subversion 1.8.8' +PACKAGE_VERSION='1.8.9' +PACKAGE_STRING='subversion 1.8.9' PACKAGE_BUGREPORT='http://subversion.apache.org/' PACKAGE_URL='' @@ -1457,7 +1457,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures subversion 1.8.8 to adapt to many kinds of systems. +\`configure' configures subversion 1.8.9 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1523,7 +1523,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of subversion 1.8.8:";; + short | recursive ) echo "Configuration of subversion 1.8.9:";; esac cat <<\_ACEOF @@ -1737,7 +1737,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -subversion configure 1.8.8 +subversion configure 1.8.9 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1789,6 +1789,52 @@ fi } # ac_fn_c_try_compile +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. @@ -1827,6 +1873,52 @@ fi } # ac_fn_cxx_try_compile +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. @@ -2028,52 +2120,6 @@ $as_echo "$ac_res" >&6; } } # ac_fn_c_check_header_compile -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly @@ -2178,52 +2224,6 @@ fi } # ac_fn_cxx_try_cpp -# ac_fn_cxx_try_link LINENO -# ------------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_link - # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache @@ -2281,7 +2281,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by subversion $as_me 1.8.8, which was +It was created by subversion $as_me 1.8.9, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2661,8 +2661,8 @@ ac_configure="$SHELL $ac_aux_dir/configu -{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.8.8" >&5 -$as_echo "$as_me: Configuring Subversion 1.8.8" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.8.9" >&5 +$as_echo "$as_me: Configuring Subversion 1.8.9" >&6;} abs_srcdir="`cd $srcdir && pwd`" @@ -3509,11 +3509,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -std=c90" >&5 $as_echo_n "checking if $CC accepts -std=c90... " >&6; } CFLAGS="-std=c90 $CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int main(void){return 0;} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3536,11 +3536,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -std=c89" >&5 $as_echo_n "checking if $CC accepts -std=c89... " >&6; } CFLAGS="-std=c89 $CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int main(void){return 0;} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3563,11 +3563,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -ansi" >&5 $as_echo_n "checking if $CC accepts -ansi... " >&6; } CFLAGS="-ansi $CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int main(void){return 0;} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3581,7 +3581,8 @@ $as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3592,7 +3593,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3603,7 +3605,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3628,11 +3631,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC accepts -Werror=unknown-warning-option... " >&6; } CFLAGS="-Werror=unknown-warning-option $CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int main(void){return 0;} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3646,7 +3649,8 @@ $as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3932,11 +3936,11 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX accepts -std=c++98" >&5 $as_echo_n "checking if $CXX accepts -std=c++98... " >&6; } CXXFLAGS="-std=c++98 $CXXFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int main(){} _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3950,7 +3954,8 @@ $as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3975,11 +3980,11 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX accepts -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CXX accepts -Werror=unknown-warning-option... " >&6; } CXXFLAGS="-Werror=unknown-warning-option $CXXFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int main(){} _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3993,7 +3998,8 @@ $as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4578,7 +4584,7 @@ fi # ==== Libraries, for which we may have source to build ====================== -APR_VER_REGEXES="0\.9\.[7-9] 0\.9\.1[0-9] 1\. 2\." +APR_VER_REGEXES="0\.9\.[7-9] 0\.9\.[12][0-9] 1\. 2\." APR_WANTED_REGEXES="$APR_VER_REGEXES" @@ -5718,6 +5724,38 @@ rm -f conftest* CPPFLAGS="$old_CPPFLAGS" fi +# check for some busted versions of mod_dav +# in particular 2.2.25, 2.4.5, and 2.4.6 had the following bugs which are +# troublesome for Subversion: +# PR 55304: https://issues.apache.org/bugzilla/show_bug.cgi?id=55304 +# PR 55306: https://issues.apache.org/bugzilla/show_bug.cgi?id=55306 +# PR 55397: https://issues.apache.org/bugzilla/show_bug.cgi?id=55397 +if test -n "$APXS" && test "$APXS" != "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking mod_dav version" >&5 +$as_echo_n "checking mod_dav version... " >&6; } + old_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES" + blacklisted_versions_regex="\"2\" \"\.\" (\"2\" \"\.\" \"25\"|\"4\" \"\.\" \"[56]\")" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include "$APXS_INCLUDE/ap_release.h" +apache_version=AP_SERVER_BASEREVISION +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "apache_version= *$blacklisted_versions_regex" >/dev/null 2>&1; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: broken" >&5 +$as_echo "broken" >&6; } + as_fn_error $? "Apache httpd version includes a broken mod_dav; use a newer version of httpd" "$LINENO" 5 +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: acceptable" >&5 +$as_echo "acceptable" >&6; } +fi +rm -f conftest* + + CPPFLAGS="$old_CPPFLAGS" +fi + # Check whether --with-apache-libexecdir was given. if test "${with_apache_libexecdir+set}" = set; then : @@ -19147,7 +19185,7 @@ if test "x$ac_cv_header_magic_h" = xyes; _ACEOF save_ldflags="$LDFLAGS" - LDFLAGS="-L$libmagic_prefix/lib" + LDFLAGS="-L$libmagic_prefix/lib $LDFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for magic_open in -lmagic" >&5 $as_echo_n "checking for magic_open in -lmagic... " >&6; } if ${ac_cv_lib_magic_magic_open+:} false; then : @@ -20013,11 +20051,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -Werror=implicit-function-declaration" >&5 $as_echo_n "checking if $CC accepts -Werror=implicit-function-declaration... " >&6; } CFLAGS="-Werror=implicit-function-declaration $CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int main(void){return 0;} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -20031,7 +20069,8 @@ $as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -20050,11 +20089,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -Werror=declaration-after-statement" >&5 $as_echo_n "checking if $CC accepts -Werror=declaration-after-statement... " >&6; } CFLAGS="-Werror=declaration-after-statement $CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int main(void){return 0;} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -20068,7 +20107,8 @@ $as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -20087,11 +20127,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -Wextra-tokens" >&5 $as_echo_n "checking if $CC accepts -Wextra-tokens... " >&6; } CFLAGS="-Wextra-tokens $CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int main(void){return 0;} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -20105,7 +20145,8 @@ $as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -20124,11 +20165,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -Wnewline-eof" >&5 $as_echo_n "checking if $CC accepts -Wnewline-eof... " >&6; } CFLAGS="-Wnewline-eof $CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int main(void){return 0;} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -20142,7 +20183,8 @@ $as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -20161,11 +20203,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -Wshorten-64-to-32" >&5 $as_echo_n "checking if $CC accepts -Wshorten-64-to-32... " >&6; } CFLAGS="-Wshorten-64-to-32 $CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int main(void){return 0;} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -20179,7 +20221,8 @@ $as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -20198,11 +20241,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -Wold-style-definition" >&5 $as_echo_n "checking if $CC accepts -Wold-style-definition... " >&6; } CFLAGS="-Wold-style-definition $CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int main(void){return 0;} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -20216,7 +20259,8 @@ $as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -20235,11 +20279,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -Wno-system-headers" >&5 $as_echo_n "checking if $CC accepts -Wno-system-headers... " >&6; } CFLAGS="-Wno-system-headers $CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int main(void){return 0;} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -20253,7 +20297,8 @@ $as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -20272,11 +20317,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -Wno-format-nonliteral" >&5 $as_echo_n "checking if $CC accepts -Wno-format-nonliteral... " >&6; } CFLAGS="-Wno-format-nonliteral $CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int main(void){return 0;} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -20290,7 +20335,8 @@ $as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -20322,11 +20368,11 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX accepts -Wextra-tokens" >&5 $as_echo_n "checking if $CXX accepts -Wextra-tokens... " >&6; } CXXFLAGS="-Wextra-tokens $CXXFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int main(){} _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -20340,7 +20386,8 @@ $as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -20359,11 +20406,11 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX accepts -Wnewline-eof" >&5 $as_echo_n "checking if $CXX accepts -Wnewline-eof... " >&6; } CXXFLAGS="-Wnewline-eof $CXXFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int main(){} _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -20377,7 +20424,8 @@ $as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -20396,11 +20444,11 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX accepts -Wshorten-64-to-32" >&5 $as_echo_n "checking if $CXX accepts -Wshorten-64-to-32... " >&6; } CXXFLAGS="-Wshorten-64-to-32 $CXXFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int main(){} _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -20414,7 +20462,8 @@ $as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -20433,11 +20482,11 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CXX accepts -Wno-system-headers" >&5 $as_echo_n "checking if $CXX accepts -Wno-system-headers... " >&6; } CXXFLAGS="-Wno-system-headers $CXXFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int main(){} _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -20451,7 +20500,8 @@ $as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -20492,11 +20542,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC accepts -fno-inline" >&5 $as_echo_n "checking if $CC accepts -fno-inline... " >&6; } CFLAGS="-fno-inline $CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +int main(void){return 0;} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -20510,7 +20560,8 @@ $as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -20529,11 +20580,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue May 27 06:35:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9A74790; Tue, 27 May 2014 06:35:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C77C3242E; Tue, 27 May 2014 06:35:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4R6ZaRM024475; Tue, 27 May 2014 06:35:36 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4R6Zam3024474; Tue, 27 May 2014 06:35:36 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201405270635.s4R6Zam3024474@svn.freebsd.org> From: Kevin Lo Date: Tue, 27 May 2014 06:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266732 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 06:35:37 -0000 Author: kevlo Date: Tue May 27 06:35:36 2014 New Revision: 266732 URL: http://svnweb.freebsd.org/changeset/base/266732 Log: Xr bktr.4 Modified: head/share/man/man4/iicbus.4 Modified: head/share/man/man4/iicbus.4 ============================================================================== --- head/share/man/man4/iicbus.4 Tue May 27 04:59:53 2014 (r266731) +++ head/share/man/man4/iicbus.4 Tue May 27 06:35:36 2014 (r266732) @@ -104,6 +104,7 @@ Some I2C interfaces are available: .It Sy bktr Ta "Brooktree848 video chipset, hardware and software master-only interface" .El .Sh SEE ALSO +.Xr bktr 4 , .Xr iicbb 4 , .Xr lpbb 4 , .Xr pcf 4 From owner-svn-src-head@FreeBSD.ORG Tue May 27 07:15:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA64FF01; Tue, 27 May 2014 07:15:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 940C226FA; Tue, 27 May 2014 07:15:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4R7FGRt042463; Tue, 27 May 2014 07:15:16 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4R7FFfH042454; Tue, 27 May 2014 07:15:15 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201405270715.s4R7FFfH042454@svn.freebsd.org> From: Peter Wemm Date: Tue, 27 May 2014 07:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266735 - in head/contrib/apr: . docs encoding file_io/unix include include/arch/unix include/private locks/unix network_io/unix passwd poll/unix shmem/unix strings support/unix tables ... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 07:15:16 -0000 Author: peter Date: Tue May 27 07:15:14 2014 New Revision: 266735 URL: http://svnweb.freebsd.org/changeset/base/266735 Log: Merge apr-1.4.8 -> apr-1.5.1 and update. Added: head/contrib/apr/CMakeLists.txt - copied unchanged from r266734, vendor/apr/dist/CMakeLists.txt head/contrib/apr/README.cmake - copied unchanged from r266734, vendor/apr/dist/README.cmake head/contrib/apr/encoding/ - copied from r266734, vendor/apr/dist/encoding/ head/contrib/apr/include/apr.hwc - copied unchanged from r266734, vendor/apr/dist/include/apr.hwc head/contrib/apr/include/apr_escape.h - copied unchanged from r266734, vendor/apr/dist/include/apr_escape.h head/contrib/apr/include/apr_skiplist.h - copied unchanged from r266734, vendor/apr/dist/include/apr_skiplist.h head/contrib/apr/include/private/ - copied from r266734, vendor/apr/dist/include/private/ head/contrib/apr/poll/unix/z_asio.c - copied unchanged from r266734, vendor/apr/dist/poll/unix/z_asio.c head/contrib/apr/tables/apr_skiplist.c - copied unchanged from r266734, vendor/apr/dist/tables/apr_skiplist.c head/contrib/apr/tools/ - copied from r266734, vendor/apr/dist/tools/ Modified: head/contrib/apr/CHANGES head/contrib/apr/LICENSE head/contrib/apr/Makefile.in head/contrib/apr/Makefile.win head/contrib/apr/NOTICE head/contrib/apr/apr.dep head/contrib/apr/apr.dsp head/contrib/apr/apr.mak head/contrib/apr/apr.spec head/contrib/apr/build-outputs.mk head/contrib/apr/build.conf head/contrib/apr/configure head/contrib/apr/configure.in head/contrib/apr/docs/canonical_filenames.html head/contrib/apr/file_io/unix/filedup.c head/contrib/apr/file_io/unix/filestat.c head/contrib/apr/file_io/unix/mktemp.c head/contrib/apr/file_io/unix/open.c head/contrib/apr/file_io/unix/pipe.c head/contrib/apr/file_io/unix/readwrite.c head/contrib/apr/include/apr.h.in head/contrib/apr/include/apr_allocator.h head/contrib/apr/include/apr_errno.h head/contrib/apr/include/apr_file_info.h head/contrib/apr/include/apr_file_io.h head/contrib/apr/include/apr_fnmatch.h head/contrib/apr/include/apr_hash.h head/contrib/apr/include/apr_inherit.h head/contrib/apr/include/apr_lib.h head/contrib/apr/include/apr_mmap.h head/contrib/apr/include/apr_network_io.h head/contrib/apr/include/apr_poll.h head/contrib/apr/include/apr_pools.h head/contrib/apr/include/apr_shm.h head/contrib/apr/include/apr_strings.h head/contrib/apr/include/apr_tables.h head/contrib/apr/include/apr_thread_mutex.h head/contrib/apr/include/apr_thread_proc.h head/contrib/apr/include/apr_time.h head/contrib/apr/include/apr_user.h head/contrib/apr/include/apr_version.h head/contrib/apr/include/arch/unix/apr_arch_poll_private.h head/contrib/apr/include/arch/unix/apr_arch_threadproc.h head/contrib/apr/include/arch/unix/apr_private.h.in head/contrib/apr/libapr.dep head/contrib/apr/libapr.dsp head/contrib/apr/libapr.mak head/contrib/apr/locks/unix/proc_mutex.c head/contrib/apr/network_io/unix/sendrecv.c head/contrib/apr/network_io/unix/sockaddr.c head/contrib/apr/network_io/unix/socket_util.c head/contrib/apr/network_io/unix/sockets.c head/contrib/apr/network_io/unix/sockopt.c head/contrib/apr/passwd/apr_getpass.c head/contrib/apr/poll/unix/pollcb.c head/contrib/apr/poll/unix/pollset.c head/contrib/apr/shmem/unix/shm.c head/contrib/apr/strings/apr_cpystrn.c head/contrib/apr/strings/apr_strings.c head/contrib/apr/support/unix/waitio.c head/contrib/apr/tables/apr_hash.c head/contrib/apr/tables/apr_tables.c Directory Properties: head/contrib/apr/ (props changed) Modified: head/contrib/apr/CHANGES ============================================================================== --- head/contrib/apr/CHANGES Tue May 27 07:00:57 2014 (r266734) +++ head/contrib/apr/CHANGES Tue May 27 07:15:14 2014 (r266735) @@ -1,235 +1,124 @@ -*- coding: utf-8 -*- -Changes for APR 1.4.8 +Changes for APR 1.5.1 - *) Fix compiltation with FreeBSD on ARM. [Olli Hauer ] + *) apr_os_proc_mutex_get() on Unix: Avoid segfault for cross- + process pthread mutexes. [Yann Ylavic ] - *) Fix 1.4.7 regression in apr_mcast_hops() and apr_mcast_loopback() - for AF_INET (IPv4) sockets on most Unix platforms. [Joe Orton] + *) When using shmget-based shared memory, the ID used for ftok is + now an APR hash of the filename instead of the constant '1'. + We do this to help avoid collisions. PR 53996 [Jim Jagielski] - *) Fix the return value of apr_threadattr_detach_get() on some - platforms like OS X and Solaris. [Rainer Jung, ] + *) apr_socket_atreadeof(): Fix breakage on OS X. [Jim Jagielski] -Changes for APR 1.4.7 + *) Fix POSIX shared memory (shm_open) use for named shared memory. + Includes adding '--enable-posix-shm' to force POSIX shm if + available, and OS X compatibility. PR 55928. + [Jozef Hatala , Jim Jagielski] - *) Fix apr_sockaddr_info_get() not returning an error in some cases. - PR 54779. [Jan Kaluža ] + *) Fix race condition when calling apr_dir_make_recursive from + multiple threads on Windows. + [Bert Huijben] - *) Fix amd64 assembler version of apr_atomic_xchgptr(). PR 51851. [Mattias - EngdegÃ¥rd ] + *) Fix apr_escape.c compilation errors on EBCDIC platforms. + [Eric Covener] - *) Fix PPC atomics to work with gcc 4.0. PR 54840. [Mattias EngdegÃ¥rd - ] + *) FreeBSD 10: Correct a regression in 1.5.0 which affected non- + blocking sockets in some applications, including httpd. [Jeff + Trawick] - *) configure: Fix detection of O_NONBLOCK inheritance on busy - systems. [Rainer Jung] + *) Windows cmake build: Fix incorrect installation of some .pdb + files. Fix incorrect use of some logic intended for Windows 9x, + including legacy filesystem interfaces and dynamic loading of + some Windows APIs. [Jeff Trawick] - *) Remove unused code, fix strict C compliance bug in SHA-256 - implementation. [Jan Kaluza ] - - *) Fix apr_ipsubnet_test() false positives when comparing IPv4 - subnet representation against an IPv6 address. PR 54047. [Joe Orton] - - *) apr_socket_accept_filter: Return success when trying to again set - the filter to the same value as before, avoiding an unhelpful - APR_EINVAL. PR 37863. [Jeff Trawick] - - *) configure: Fix Linux 3.x detection. PR 54001. [Gilles Espinasse - ] - - *) apr_time_exp_*() on Windows: Fix error in the tm_yday field of - apr_time_exp_t for times within leap years. PR 53175. + *) apr_skiplist: Add compatibility with C++ applications. [Jeff Trawick] - *) Improve platform detection by updating config.guess and config.sub. - [Rainer Jung] - - *) Add support for OSX Mountain Lion (10.8) [Jim Jagielski] - - *) Add various gcc function attributes. [Stefan Fritsch] - - *) Fix some problems in apr_sockaddr_info_get() when trying to resolve - the loopback addresses of a protocol family that is not otherwise - configured on the system. PR 52709. [Nirgal Vourgère - , Stefan Fritsch] - - *) Fix file not being unlocked if truncate call on a file fails. - [Mladen Turk] - - *) apr_mcast_hops: Fix EINVAL for IPv6 sockets caused by using byte - instead integer for setsockopt. [Mladen Turk] - - *) Windows: Fix compile-time checks for 64-bit builds, resolving a - crash in httpd's mod_rewrite. PR 49155. [] - -Changes for APR 1.4.6 - - *) Flush write buffer before truncate call on a file. - [Mladen Turk] - - *) Randomise hashes by providing a seed. - Assigned CVE-2012-0840, oCERT-2011-003, but not known to be exploitable. - [Bojan Smojver, Branko ÄŒibej, Ruediger Pluem et al.] - - *) apr_random: Prevent segfault if pool used to initialize apr_random is - destroyed before forking. [Stefan Fritsch] - - *) testrand: Improve child randomness test case. [Rainer Jung] - - *) apr_proc_fork, apr_random_after_fork: disambiguate what happens to the - proc structure passed in, and ensure that the pid is set correctly in - a newly created child; note that merely mixing a PID into the random - seed of a new child doesn't markedly increase entropy. [Sander Temme] - - *) apr_file_open: Avoid fcntl() calls if support for O_CLOEXEC works. - PR 48557. [Mike Frysinger ] - - *) apr_dir_make_recursive: Fix race condition that could lead to EEXIST - being returned. PR 51254. [William Lee , - Wim Lewis ] - - *) configure: Fix APR_RESTORE_THE_ENVIRONMENT if the original variable was - a single space. PR 50334. [Nathan Phillip Brink ] - - *) apr_proc_create: Don't close any of the new stdin/stdout/stderr in the - child if it already has the correct FD. PR 51995. - [Dan Ports ] - - *) Fix flag character '#' in combination with format character 'x' in - apr snprintf implementations. [Rainer Jung] - - *) Improve platform detection by updating config.guess and config.sub. - [Rainer Jung] - - *) Add libtool2 files to extraclean make target. [Rainer Jung] + *) Correct a regression in 1.5.0 which affected out-of-tree + builds on Unix. [Rainer Jung] - *) Don't overwrite our config.guess and config.sub - when running buildconf. [Rainer Jung] + *) Improve platform detection for bundled expat by updating + config.guess and config.sub. [Rainer Jung] - *) Silence autoconf 2.68 warnings. [Rainer Jung] +Changes for APR 1.5.0 -Changes for APR 1.4.5 - - *) Security: CVE-2011-1928 - apr_fnmatch(): Fix high CPU loop. [William Rowe] - - *) Fix top_builddir in installed apr_rules.mk. [Bojan Smojver] - -Changes for APR 1.4.4 - - *) Windows: Fix command-line builds. [William Rowe] - -Changes for APR 1.4.3 - - *) Security: CVE-2011-0419 - Reimplement apr_fnmatch() from scratch using a non-recursive - algorithm; now has improved compliance with the fnmatch() spec. - [William Rowe] - - *) Fix environment-related crash using some non-standard builds on - Windows 7/Server 2008. [Steve Hay ] - - *) poll, pollset, pollcb on Windows: Handle calls with no file/socket - descriptors. PR 49882. [Stefan Ruppert , Jeff Trawick] - - *) Fix APR_IPV6_V6ONLY issues on Windows related to run-time behavior - on Windows older than Vista and SDK/MinGW levels without IPV6_V6ONLY. - PR 45321. [Sob ] - - *) Fix address handling when accepting an AF_INET socket from a socket - bound as AF_INET6. PR 49678. [Joe Orton] + *) Fix Linux kernel version check to recognize more versions, + including versions 3.10 and later. PR 55690. [Joe Orton, + Arfrever Frehtes Taifersar Arahesis ] + + *) Add apr_sockaddr_is_wildcard() to check if a socket address + refers to the wildcard address for the protocol family (e.g., + 0.0.0.0/INADDR_ANY for IPv4). [Jeff Trawick] + + *) apr_file_dup2() on Windows: Fix debug RTL assertion when + attempting to _commit(stdout) or _commit(stderr). [Mike Rumph + ] + + *) apr_socket_connect() on Windows: Handle WSAEISCONN. PR 48736. + [, Jeff Trawick] + + *) z/OS: threadsafe apr_pollset_poll support for sockets [Greg Ames] + + *) Windows: Don't obtain a mutex for buffered file I/O unless the + file was opened with the APR_FOPEN_XTHREAD flag. [Ivan Zhakov + ] + + *) Windows: Create named shared memory segments under the "Local" + namespace if the caller is unprivileged, fixing an inability of + unprivileged callers to use apr_shm_create() with named shared + memory segments under recent Windows. As before, shared memory + segments are created under the "Global" namespace for privileged + callers. Add apr_shm_create_ex() and apr_shm_attach_ex(), which + provide the ability to override the normal namespace selection. + [Jeff Trawick] - *) Fix error return values from apr_sockaddr_info_get() on Windows for - IPv6 builds. [Ivan Zhakov ] + *) Update compile settings for MINT OS. PR 47181. [Alan Hourihane + ] - *) Add new experimental configure option --enable-allocator-uses-mmap to - use mmap instead of malloc in apr_allocator_alloc(). This greatly reduces - memory fragmentation with malloc implementations (e.g. glibc) that - don't handle allocationss of a page-size-multiples in an efficient way. - It also makes apr_allocator_max_free_set() actually have some effect - on such platforms. [Stefan Fritsch] + *) Files and pipes on Windows: Don't create an unused pollset when + files and pipes are opened. [Mladen Turk] - *) configure: Support 64 and 32 bit universal builds for Darwin/ - OS X 10.6+. [Jim Jagielski] + *) apr_socket_timeout_set() on Windows: If the socket was in a non- + blocking state before, disable that setting so that timeouts work. + [Jeff Trawick] - *) apr_sockaddr_info_get() on AIX: Fix a problem which could set - the port field in the native socket address to 1 when 0 was - specified. PR 46964. [Jeff Trawick] + *) File info APIs: Fix calculation of atime and mtime on AIX. PR 51146. + [Ruediger Pluem] - *) configure: Make definition of apr_ino_t independent of - _FILE_OFFSET_BITS even on platforms where ino_t is 'unsigned int'. - [Stefan Fritsch] + *) Add the apr_escape interface. [Graham Leggett] - *) apr_ring: Workaround for aliasing problem that causes gcc 4.5 to - miscompile some brigade related code. PR 50190. [Stefan Fritsch] + *) Cygwin build fixes. PRs 51016 and 55586. [Carlo Bramini + ] - *) apr_file_flush_locked(): Handle short writes. [Stefan Fritsch] + *) Add apr_skiplist family. [Jim Jagielski] - *) apr_pollset_create_ex(): Trap errors from pollset providers. - PR 49094. [Sami Tolvanen ] + *) Add experimental cmake-based build system for Windows. Refer to + README.cmake for more information. [Jeff Trawick, Tom Donovan] - *) apr_pollset_create*(): Fix memory lifetime problem with the wakeup - pipe when the pollset was created with APR_POLLSET_NOCOPY. - [Neil Conway ] + *) Add the apr_table_getm() call, which transparently handles the + merging of keys with multiple values. [Graham Leggett] - *) Fix detection of some Linux variants when configure is built with - recent GNU tools. [Eric Covener] + *) Add apr_hash_this_key(), apr_hash_this_key_len(), and + apr_hash_this_val() for easier access to those attributes from + a hash iterator. [Hyrum K. Wright ] - *) Avoid a redundant fcntl() call in apr_file_open() where O_CLOEXEC - is supported. PR 46297. [Joe Orton] + *) MinGW/MSYS: Support shared builds of APR, other general improvements + to support of this toolchain. PR 46175. [Carlo Bramini + ] *) Improve platform detection by updating config.guess and config.sub. [Rainer Jung] -Changes for APR 1.4.2 - - *) Undo a crash-bug introduced in 1.4.1 affecting some applications of - the apr hash and table structures, reported to affect Subversion - by Bert Huijben . [Graham Leggett] - -Changes for APR 1.4.1 - - *) Win32: Properly handle the ERROR_DIRECTORY system error code. - [Brane ÄŒibej] - -Changes for APR 1.4.0 - - *) Windows: Default build configurations assume NT or higher at run-time. - - *) Add apr_global_mutex_lockfile() for retrieving the file, if any, - associated with the mutex. Add apr_global_mutex_name() for retrieving - the name of the lock mechanism used by the underlying proc mutex. - [Jeff Trawick] - - *) Add apr_socket_atreadeof to determine whether the receive part of the - socket has been closed by the peer. - [Ruediger Pluem, Mladen Turk, Joe Orton] - - *) Make apr_pollset and apr_pollcb implementations using providers. - Added apr_pollset_create_ex and apr_pollcb_create_ex that allows - choosing non-default providers. - [Mladen Turk] - - *) Win32: Use WSAPoll as default pollset method if supported and found - inside winsock dll. [Mladen Turk] - - *) apr_temp_dir_get() now checks the TMPDIR environment variable first, - instead of third. [Jim Jagielski] - - *) Add apr_file_sync() and apr_file_datasync() calls. [Bojan Smojver] - - *) apr_pollset_wakeup() on Windows: Fix core caused by closing the - file_socket_pipe with standard file_close. - [Arsen Chaloyan, Mladen Turk] - - *) Introduce apr_hash_do() for iterating over a hash table. [Mladen Turk] + *) apr_socket_opt_set: Add support for APR_SO_BROADCAST. PR 46389. + [Armin Müller ] - *) Make sure WIN32 behaves the same as posix for file-backed shared memory - by removing the file on cleanup/remove. [Mladen Turk] + *) Enable platform specific support for the opening of a file or + pipe in non-blocking mode through the APR_FOPEN_NONBLOCK flag. + [Graham Leggett] - *) Introduce apr_pollset_wakeup() for interrupting the blocking - apr_pollset_poll() call. [Mladen Turk] +Changes for APR 1.4.x and later: - *) Add apr_file_link() function. PR 44841. [Mark Heily ] + *) http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/CHANGES?view=markup Changes for APR 1.3.x and later: Copied: head/contrib/apr/CMakeLists.txt (from r266734, vendor/apr/dist/CMakeLists.txt) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/apr/CMakeLists.txt Tue May 27 07:15:14 2014 (r266735, copy of r266734, vendor/apr/dist/CMakeLists.txt) @@ -0,0 +1,434 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Read README.cmake before using this. + +PROJECT(APR C) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +OPTION(APR_INSTALL_PRIVATE_H "Install selected private .h files (for httpd)" OFF) +OPTION(APR_HAVE_IPV6 "IPv6 support" ON) +OPTION(INSTALL_PDB "Install .pdb files (if generated)" ON) +OPTION(APR_BUILD_TESTAPR "Build the test suite" OFF) +OPTION(TEST_STATIC_LIBS "Test programs use APR static libraries instead of shared libraries?" OFF) +SET(MIN_WINDOWS_VER "Vista" + CACHE STRING "Minimum Windows version") + +# create 1-or-0 representation of feature tests for apr.h + +SET(apr_have_ipv6_10 0) + +IF(APR_HAVE_IPV6) + SET(apr_have_ipv6_10 1) +ENDIF() + +IF("${MIN_WINDOWS_VER}" STREQUAL "") + SET(win32_winnt_str "0x0600") +ELSEIF(${MIN_WINDOWS_VER} STREQUAL "Vista") + SET(win32_winnt_str "0x0600") +ELSEIF(${MIN_WINDOWS_VER} STREQUAL "Windows7") + SET(win32_winnt_str "0x0601") +ELSE() + SET(win32_winnt_str ${MIN_WINDOWS_VER}) +ENDIF() + +CONFIGURE_FILE(include/apr.hwc + ${PROJECT_BINARY_DIR}/apr.h) + +ADD_EXECUTABLE(gen_test_char tools/gen_test_char.c) +GET_TARGET_PROPERTY(GEN_TEST_CHAR_EXE gen_test_char LOCATION) +ADD_CUSTOM_COMMAND( + COMMENT "Generating character tables, apr_escape_test_char.h, for current locale" + DEPENDS gen_test_char + COMMAND ${GEN_TEST_CHAR_EXE} > ${PROJECT_BINARY_DIR}/apr_escape_test_char.h + OUTPUT ${PROJECT_BINARY_DIR}/apr_escape_test_char.h +) +ADD_CUSTOM_TARGET( + test_char_header ALL + DEPENDS ${PROJECT_BINARY_DIR}/apr_escape_test_char.h +) + +# Generated .h files are stored in PROJECT_BINARY_DIR, not the +# source tree. +# +# BROKEN: not searching PROJECT_BINARY_DIR first, so you have to +# manually delete apr.h in PROJECT_SOURCE_DIR/include if +# you've generated apr.h before using a different build + +SET(APR_INCLUDE_DIRECTORIES + ${PROJECT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/include/arch/win32 + ${CMAKE_CURRENT_SOURCE_DIR}/include/arch/unix + ${CMAKE_CURRENT_SOURCE_DIR}/include/private +) + +SET(APR_SYSTEM_LIBS + ws2_32 + mswsock + rpcrt4 +) + +INCLUDE_DIRECTORIES(${APR_INCLUDE_DIRECTORIES}) + +SET(APR_PUBLIC_HEADERS_STATIC + include/apr_allocator.h + include/apr_atomic.h + include/apr_dso.h + include/apr_env.h + include/apr_errno.h + include/apr_escape.h + include/apr_file_info.h + include/apr_file_io.h + include/apr_fnmatch.h + include/apr_general.h + include/apr_getopt.h + include/apr_global_mutex.h + include/apr_hash.h + include/apr_inherit.h + include/apr_lib.h + include/apr_mmap.h + include/apr_network_io.h + include/apr_poll.h + include/apr_pools.h + include/apr_portable.h + include/apr_proc_mutex.h + include/apr_random.h + include/apr_ring.h + include/apr_shm.h + include/apr_signal.h + include/apr_skiplist.h + include/apr_strings.h + include/apr_support.h + include/apr_tables.h + include/apr_thread_cond.h + include/apr_thread_mutex.h + include/apr_thread_proc.h + include/apr_thread_rwlock.h + include/apr_time.h + include/apr_user.h + include/apr_version.h + include/apr_want.h +) +SET(APR_PUBLIC_HEADERS_GENERATED + ${PROJECT_BINARY_DIR}/apr.h +) + +SET(APR_SOURCES + atomic/win32/apr_atomic.c + dso/win32/dso.c + encoding/apr_escape.c + file_io/unix/copy.c + file_io/unix/fileacc.c + file_io/unix/filepath_util.c + file_io/unix/fullrw.c + file_io/unix/mktemp.c + file_io/unix/tempdir.c + file_io/win32/buffer.c + file_io/win32/dir.c + file_io/win32/filedup.c + file_io/win32/filepath.c + file_io/win32/filestat.c + file_io/win32/filesys.c + file_io/win32/flock.c + file_io/win32/open.c + file_io/win32/pipe.c + file_io/win32/readwrite.c + file_io/win32/seek.c + locks/win32/proc_mutex.c + locks/win32/thread_cond.c + locks/win32/thread_mutex.c + locks/win32/thread_rwlock.c + memory/unix/apr_pools.c + misc/unix/errorcodes.c + misc/unix/getopt.c + misc/unix/otherchild.c + misc/unix/version.c + misc/win32/charset.c + misc/win32/env.c + misc/win32/internal.c + misc/win32/misc.c + misc/win32/rand.c + misc/win32/start.c + misc/win32/utf8.c + mmap/unix/common.c + mmap/win32/mmap.c + network_io/unix/inet_ntop.c + network_io/unix/inet_pton.c + network_io/unix/multicast.c + network_io/unix/sockaddr.c + network_io/unix/socket_util.c + network_io/win32/sendrecv.c + network_io/win32/sockets.c + network_io/win32/sockopt.c + passwd/apr_getpass.c + poll/unix/poll.c + poll/unix/pollcb.c + poll/unix/pollset.c + poll/unix/select.c + random/unix/apr_random.c + random/unix/sha2.c + random/unix/sha2_glue.c + shmem/win32/shm.c + strings/apr_cpystrn.c + strings/apr_fnmatch.c + strings/apr_snprintf.c + strings/apr_strings.c + strings/apr_strnatcmp.c + strings/apr_strtok.c + tables/apr_hash.c + tables/apr_skiplist.c + tables/apr_tables.c + threadproc/win32/proc.c + threadproc/win32/signals.c + threadproc/win32/thread.c + threadproc/win32/threadpriv.c + time/win32/time.c + time/win32/timestr.c + user/win32/groupinfo.c + user/win32/userinfo.c +) + +SET(APR_TEST_SOURCES + test/abts.c + test/testargs.c + test/testatomic.c + test/testcond.c + test/testdir.c + test/testdso.c + test/testdup.c + test/testenv.c + test/testescape.c + test/testfile.c + test/testfilecopy.c + test/testfileinfo.c + test/testflock.c + test/testfmt.c + test/testfnmatch.c + test/testglobalmutex.c + test/testhash.c + test/testipsub.c + test/testlfs.c + test/testlock.c + test/testmmap.c + test/testnames.c + test/testoc.c + test/testpath.c + test/testpipe.c + test/testpoll.c + test/testpools.c + test/testproc.c + test/testprocmutex.c + test/testrand.c + test/testshm.c + test/testsleep.c + test/testsock.c + test/testsockets.c + test/testsockopt.c + test/teststr.c + test/teststrnatcmp.c + test/testtable.c + test/testtemp.c + test/testthread.c + test/testtime.c + test/testud.c + test/testuser.c + test/testutil.c + test/testvsn.c +) + +SET(install_targets) +SET(install_bin_pdb) +SET(install_lib_pdb) + +# libapr-1 is shared, apr-1 is static +ADD_LIBRARY(libapr-1 SHARED ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED} libapr.rc) +SET(install_targets ${install_targets} libapr-1) +SET(install_bin_pdb ${install_bin_pdb} ${PROJECT_BINARY_DIR}/libapr-1.pdb) +TARGET_LINK_LIBRARIES(libapr-1 ${APR_SYSTEM_LIBS}) +SET_TARGET_PROPERTIES(libapr-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_EXPORT;WINNT") +ADD_DEPENDENCIES(libapr-1 test_char_header) + +ADD_LIBRARY(apr-1 STATIC ${APR_SOURCES} ${APR_PUBLIC_HEADERS_GENERATED}) +SET(install_targets ${install_targets} apr-1) +SET(install_lib_pdb ${install_lib_pdb} ${PROJECT_BINARY_DIR}/apr-1.pdb) +TARGET_LINK_LIBRARIES(apr-1 ${APR_SYSTEM_LIBS}) +SET_TARGET_PROPERTIES(apr-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;WINNT") +ADD_DEPENDENCIES(apr-1 test_char_header) + +# libaprapp-1 and aprapp-1 are static +ADD_LIBRARY(libaprapp-1 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED}) +SET(install_targets ${install_targets} libaprapp-1) +SET(install_lib_pdb ${install_lib_pdb} ${PROJECT_BINARY_DIR}/libaprapp-1.pdb) +SET_TARGET_PROPERTIES(libaprapp-1 PROPERTIES COMPILE_DEFINITIONS "APR_APP;WINNT") + +ADD_LIBRARY(aprapp-1 STATIC misc/win32/apr_app.c misc/win32/internal.c ${APR_PUBLIC_HEADERS_GENERATED}) +SET(install_targets ${install_targets} aprapp-1) +SET(install_lib_pdb ${install_lib_pdb} ${PROJECT_BINARY_DIR}/aprapp-1.pdb) +SET_TARGET_PROPERTIES(aprapp-1 PROPERTIES COMPILE_DEFINITIONS "APR_DECLARE_STATIC;APR_APP;WINNT") + +IF(APR_BUILD_TESTAPR) + ENABLE_TESTING() + # Create a "check" target that displays test program output to the console. + ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND} --verbose) + + # copy data files to build directory so that we can run programs from there + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory + ${PROJECT_BINARY_DIR}/data) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${PROJECT_SOURCE_DIR}/test/data/file_datafile.txt + ${PROJECT_BINARY_DIR}/data/file_datafile.txt) + EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${PROJECT_SOURCE_DIR}/test/data/mmap_datafile.txt + ${PROJECT_BINARY_DIR}/data/mmap_datafile.txt) + + IF(TEST_STATIC_LIBS) + SET(whichapr apr-1) + SET(whichaprapp aprapp-1) + SET(apiflag -DAPR_DECLARE_STATIC) + ELSE() + SET(whichapr libapr-1) + SET(whichaprapp libaprapp-1) + SET(apiflag) + ENDIF() + + ADD_EXECUTABLE(testapp test/testapp.c) + TARGET_LINK_LIBRARIES(testapp ${whichapr} ${whichaprapp} ${APR_SYSTEM_LIBS}) + SET_TARGET_PROPERTIES(testapp PROPERTIES LINK_FLAGS /entry:wmainCRTStartup) + IF(apiflag) + SET_TARGET_PROPERTIES(testapp PROPERTIES COMPILE_FLAGS ${apiflag}) + ENDIF() + ADD_TEST(NAME testapp COMMAND testapp) + + ADD_EXECUTABLE(testall ${APR_TEST_SOURCES}) + TARGET_LINK_LIBRARIES(testall ${whichapr} ${APR_SYSTEM_LIBS}) + IF(apiflag) + SET_TARGET_PROPERTIES(testall PROPERTIES COMPILE_FLAGS ${apiflag}) + ENDIF() + ADD_TEST(NAME testall COMMAND testall) + + ADD_LIBRARY(mod_test MODULE test/mod_test.c) + TARGET_LINK_LIBRARIES(mod_test ${whichapr} ${APR_SYSTEM_LIBS}) + SET_PROPERTY(TARGET mod_test APPEND PROPERTY LINK_FLAGS /export:print_hello) + # nasty work-around for difficulties adding more than one additional flag + # (they get joined in a bad way behind the scenes) + GET_PROPERTY(link_flags TARGET mod_test PROPERTY LINK_FLAGS) + SET(link_flags "${link_flags} /export:count_reps") + SET_TARGET_PROPERTIES(mod_test PROPERTIES LINK_FLAGS ${link_flags}) + IF(apiflag) + SET_TARGET_PROPERTIES(mod_test PROPERTIES COMPILE_FLAGS ${apiflag}) + ENDIF() + + # Build all the single-source executable files with no special build + # requirements. + SET(single_source_programs + test/echod.c + test/sendfile.c + test/sockperf.c + test/testlockperf.c + test/testmutexscope.c + test/globalmutexchild.c + test/occhild.c + test/proc_child.c + test/readchild.c + test/sockchild.c + test/testshmproducer.c + test/testshmconsumer.c + test/tryread.c + test/internal/testucs.c + ) + + FOREACH(sourcefile ${single_source_programs}) + STRING(REGEX REPLACE ".*/([^\\]+)\\.c" "\\1" proggie ${sourcefile}) + ADD_EXECUTABLE(${proggie} ${sourcefile}) + TARGET_LINK_LIBRARIES(${proggie} ${whichapr} ${APR_SYSTEM_LIBS}) + IF(apiflag) + SET_TARGET_PROPERTIES(${proggie} PROPERTIES COMPILE_FLAGS ${apiflag}) + ENDIF() + ENDFOREACH() + + # Add tests for programs that run by themselves with no arguments. + SET(simple_tests + testmutexscope + testucs + ) + + FOREACH(simple ${simple_tests}) + ADD_TEST(NAME ${simple} COMMAND ${simple}) + ENDFOREACH() + + # testlockperf takes forever on Windows with default counter limit + ADD_TEST(NAME testlockperf COMMAND testlockperf -c 50000) + + # sendfile runs multiple times with different parameters. + FOREACH(sendfile_mode blocking nonblocking timeout) + ADD_TEST(NAME sendfile-${sendfile_mode} COMMAND sendfile client ${sendfile_mode} startserver) + ENDFOREACH() + + # No test is added for echod+sockperf. Those will have to be run manually. + +ENDIF (APR_BUILD_TESTAPR) + +# Installation + +INSTALL(TARGETS ${install_targets} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) + +IF(INSTALL_PDB) + INSTALL(FILES ${install_bin_pdb} + DESTINATION bin + CONFIGURATIONS RelWithDebInfo Debug) + + INSTALL(FILES ${install_lib_pdb} + DESTINATION lib + CONFIGURATIONS RelWithDebInfo Debug) +ENDIF() + +INSTALL(FILES ${APR_PUBLIC_HEADERS_STATIC} ${APR_PUBLIC_HEADERS_GENERATED} DESTINATION include) +IF(APR_INSTALL_PRIVATE_H) + # Kludges for unexpected dependencies of httpd 2.x, not installed by default + SET(APR_PRIVATE_H_FOR_HTTPD + include/arch/win32/apr_arch_file_io.h + include/arch/win32/apr_arch_misc.h + include/arch/win32/apr_arch_utf8.h + include/arch/win32/apr_private.h + ) + INSTALL(FILES ${APR_PRIVATE_H_FOR_HTTPD} DESTINATION include/arch/win32) + INSTALL(FILES include/arch/apr_private_common.h DESTINATION include/arch) +ENDIF() + +STRING(TOUPPER "${CMAKE_BUILD_TYPE}" buildtype) +MESSAGE(STATUS "") +MESSAGE(STATUS "") +MESSAGE(STATUS "APR configuration summary:") +MESSAGE(STATUS "") + +MESSAGE(STATUS " Build type ...................... : ${CMAKE_BUILD_TYPE}") +MESSAGE(STATUS " Install .pdb (if available)...... : ${INSTALL_PDB}") +MESSAGE(STATUS " Install prefix .................. : ${CMAKE_INSTALL_PREFIX}") +MESSAGE(STATUS " C compiler ...................... : ${CMAKE_C_COMPILER}") +MESSAGE(STATUS " IPv6 ............................ : ${APR_HAVE_IPV6}") +MESSAGE(STATUS " Minimum Windows version ......... : ${MIN_WINDOWS_VER}") +MESSAGE(STATUS " Build test suite ................ : ${APR_BUILD_TESTAPR}") +IF(TEST_STATIC_LIBS) +MESSAGE(STATUS " (testing static libraries)") +ELSE() +MESSAGE(STATUS " (testing dynamic libraries)") +ENDIF() +MESSAGE(STATUS " Install private .h for httpd .... : ${APR_INSTALL_PRIVATE_H}") Modified: head/contrib/apr/LICENSE ============================================================================== --- head/contrib/apr/LICENSE Tue May 27 07:00:57 2014 (r266734) +++ head/contrib/apr/LICENSE Tue May 27 07:15:14 2014 (r266735) @@ -206,8 +206,8 @@ APACHE PORTABLE RUNTIME SUBCOMPONENTS: The Apache Portable Runtime includes a number of subcomponents with separate copyright notices and license terms. Your use of the source -code for the these subcomponents is subject to the terms and -conditions of the following licenses. +code for these subcomponents is subject to the terms and conditions +of the following licenses. From strings/apr_fnmatch.c, include/apr_fnmatch.h, misc/unix/getopt.c, file_io/unix/mktemp.c, strings/apr_strings.c: Modified: head/contrib/apr/Makefile.in ============================================================================== --- head/contrib/apr/Makefile.in Tue May 27 07:00:57 2014 (r266734) +++ head/contrib/apr/Makefile.in Tue May 27 07:15:14 2014 (r266735) @@ -18,7 +18,7 @@ APR_MAJOR_VERSION=@APR_MAJOR_VERSION@ INCDIR=./include OSDIR=$(top_srcdir)/include/arch/@OSDIR@ DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ -INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -I$(top_srcdir)/include/arch/@DEFAULT_OSDIR@ -I$(top_srcdir)/include +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -I$(top_srcdir)/include/arch/@DEFAULT_OSDIR@ -I$(top_srcdir)/include -I$(top_srcdir)/include/private -I$(top_blddir)/include/private # # Macros for target determination @@ -36,7 +36,7 @@ INSTALL_DATA = @INSTALL_DATA@ # Rules for building specific targets, starting with 'all' for # building the entire package. # -TARGETS = $(TARGET_LIB) apr.exp apr-config.out build/apr_rules.out +TARGETS = $(TARGET_LIB) include/private/apr_escape_test_char.h apr.exp apr-config.out build/apr_rules.out LT_VERSION = @LT_VERSION@ @@ -45,7 +45,9 @@ LT_VERSION = @LT_VERSION@ @INCLUDE_OUTPUTS@ CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \ - build/apr_rules.out + build/apr_rules.out tools/gen_test_char@EXEEXT@ \ + tools/gen_test_char.o tools/gen_test_char.lo \ + include/private/apr_escape_test_char.h DISTCLEAN_TARGETS = config.cache config.log config.status \ include/apr.h include/arch/unix/apr_private.h \ libtool $(APR_CONFIG) build/apr_rules.mk apr.pc \ @@ -99,6 +101,8 @@ install: $(TARGETS) $(TARGET_LIB): $(OBJECTS) $(LINK) @lib_target@ $(ALL_LIBS) +encoding/apr_escape.lo: include/private/apr_escape_test_char.h + exports.c: $(HEADERS) $(APR_MKEXPORT) $(HEADERS) > $@ @@ -125,5 +129,20 @@ check: $(TARGET_LIB) etags: etags `find . -name '*.[ch]'` +make_tools_dir: + $(APR_MKDIR) tools + +OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS) +tools/gen_test_char.lo: make_tools_dir +tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char) + $(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS) + +include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@ + $(APR_MKDIR) include/private + tools/gen_test_char@EXEEXT@ > $@ + +LINK_PROG = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LT_LDFLAGS) \ + @LT_NO_INSTALL@ $(ALL_LDFLAGS) -o $@ + # DO NOT REMOVE docs: $(INCDIR)/*.h Modified: head/contrib/apr/Makefile.win ============================================================================== --- head/contrib/apr/Makefile.win Tue May 27 07:00:57 2014 (r266734) +++ head/contrib/apr/Makefile.win Tue May 27 07:15:14 2014 (r266735) @@ -7,7 +7,7 @@ # install - compile everything # clean - mop up everything # -# You can override the build mechansim, choose only one; +# You can override the build mechanism, choose only one; # # USEMAK=1 - compile from exported make files # USEDSW=1 - compile from .dsw / .dsp VC6 projects Modified: head/contrib/apr/NOTICE ============================================================================== --- head/contrib/apr/NOTICE Tue May 27 07:00:57 2014 (r266734) +++ head/contrib/apr/NOTICE Tue May 27 07:15:14 2014 (r266735) @@ -1,7 +1,7 @@ Apache Portable Runtime -Copyright (c) 2011 The Apache Software Foundation. +Copyright (c) 2000-2014 The Apache Software Foundation. -This product includes software developed by +This product includes software developed at The Apache Software Foundation (http://www.apache.org/). Portions of this software were developed at the National Center Copied: head/contrib/apr/README.cmake (from r266734, vendor/apr/dist/README.cmake) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/apr/README.cmake Tue May 27 07:15:14 2014 (r266735, copy of r266734, vendor/apr/dist/README.cmake) @@ -0,0 +1,112 @@ +Experimental cmake-based build support for APR on Microsoft Windows + +Status +------ + +This build support is currently intended only for Microsoft Windows. +Only Windows NT-based systems can be targeted. (The traditional +Windows build support for APR can target Windows 9x as well.) + +This build support is experimental. Specifically, + +* It does not support all features of APR. +* Some components may not be built correctly and/or in a manner + compatible with the previous Windows build support. +* Build interfaces, such as the mechanisms which are used to enable + optional functionality or specify prerequisites, may change from + release to release as feedback is received from users and bugs and + limitations are resolved. + +Important: Refer to the "Known Bugs and Limitations" section for further + information. + + It is beyond the scope of this document to document or explain + how to utilize the various cmake features, such as different + build backends or provisions for finding support libraries. + + Please refer to the cmake documentation for additional information + that applies to building any project with cmake. + +Prerequisites +------------- + +The following tools must be in PATH: + +* cmake, version 2.8 or later +* If using a command-line compiler: compiler and linker and related tools + (Refer to the cmake documentation for more information.) + +How to build +------------ + +1. cd to a clean directory for building (i.e., don't build in your + source tree) + +2. Some cmake backends may want your compile tools in PATH. (Hint: "Visual + Studio Command Prompt") + +3. cmake -G "some backend, like 'NMake Makefiles'" + -DCMAKE_INSTALL_PREFIX=d:/path/to/aprinst + -DAPR-specific-flags + d:/path/to/aprsource + + Alternately, use cmake-gui and update settings in the GUI. + + APR feature flags: + + APR_INSTALL_PRIVATE_H Install extra .h files which are required when + building httpd and Subversion but which aren't + intended for use by applications. + Default: OFF + APR_HAVE_IPV6 Enable IPv6 support + Default: ON + APR_BUILD_TESTAPR Build APR test suite + Default: OFF + TEST_STATIC_LIBS Build the test suite to test the APR static + library instead of the APR dynamic library. + Default: OFF + In order to build the test suite against both + static and dynamic libraries, separate builds + will be required, one with TEST_STATIC_LIBS + set to ON. + MIN_WINDOWS_VER Minimum Windows version supported by this build + (This controls the setting of _WIN32_WINNT.) + "Vista" or "Windows7" or a numeric value like + "0x0601" + Default: "Vista" + For desktop/server equivalence or other values, + refer to + http://msdn.microsoft.com/en-us/library/windows/ + desktop/aa383745(v=vs.85).aspx + INSTALL_PDB Install .pdb files if generated. + Default: ON + + CMAKE_C_FLAGS_RELEASE, _DEBUG, _RELWITHDEBINFO, _MINSIZEREL + + CMAKE_BUILD_TYPE + + For NMake Makefiles the choices are at least DEBUG, RELEASE, + RELWITHDEBINFO, and MINSIZEREL + Other backends make have other selections. + +4. build using chosen backend (e.g., "nmake install") + +Known Bugs and Limitations +-------------------------- + +* If include/apr.h or other generated files have been created in the source + directory by another build system, they will be used unexpectedly and + cause the build to fail. +* Options should be provided for remaining features: + + APR_POOL_DEBUG +* APR-CHANGES.txt, APR-LICENSE.txt, and APR-NOTICE.txt are not installed, + though perhaps that is a job for a higher-level script. + +Generally: + +* Many APR features have not been tested with this build. +* Developers need to examine the existing Windows build in great detail and see + what is missing from the cmake-based build, whether a feature or some build + nuance. +* Any feedback you can provide on your experiences with this build will be + helpful. Modified: head/contrib/apr/apr.dep ============================================================================== --- head/contrib/apr/apr.dep Tue May 27 07:00:57 2014 (r266734) +++ head/contrib/apr/apr.dep Tue May 27 07:15:14 2014 (r266735) @@ -1,558 +1,1916 @@ -# Microsoft Developer Studio Generated Dependency File, included by apr.mak - -.\atomic\win32\apr_atomic.c : \ - ".\include\apr_atomic.h"\ - - -.\dso\win32\dso.c : \ - ".\include\apr_getopt.h"\ - ".\include\apr_lib.h"\ - ".\include\apr_poll.h"\ - ".\include\apr_portable.h"\ - ".\include\apr_strings.h"\ - ".\include\arch\win32\apr_arch_dso.h"\ - ".\include\arch\win32\apr_arch_file_io.h"\ - ".\include\arch\win32\apr_arch_utf8.h"\ - - -.\file_io\win32\buffer.c : \ - ".\include\apr_getopt.h"\ - ".\include\apr_lib.h"\ - ".\include\apr_poll.h"\ - ".\include\apr_portable.h"\ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue May 27 07:16:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E75CEA; Tue, 27 May 2014 07:16:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C3E6270F; Tue, 27 May 2014 07:16:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4R7GiZ6042710; Tue, 27 May 2014 07:16:44 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4R7GhEl042704; Tue, 27 May 2014 07:16:43 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201405270716.s4R7GhEl042704@svn.freebsd.org> From: Peter Wemm Date: Tue, 27 May 2014 07:16:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266736 - head/usr.bin/svn/lib/libapr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 07:16:44 -0000 Author: peter Date: Tue May 27 07:16:43 2014 New Revision: 266736 URL: http://svnweb.freebsd.org/changeset/base/266736 Log: Update backend files and makefiles for apr 1.4.8 -> 1.5.1 Modified: head/usr.bin/svn/lib/libapr/Makefile head/usr.bin/svn/lib/libapr/apr.h head/usr.bin/svn/lib/libapr/apr_private.h Modified: head/usr.bin/svn/lib/libapr/Makefile ============================================================================== --- head/usr.bin/svn/lib/libapr/Makefile Tue May 27 07:15:14 2014 (r266735) +++ head/usr.bin/svn/lib/libapr/Makefile Tue May 27 07:16:43 2014 (r266736) @@ -4,7 +4,7 @@ INTERNALLIB= yes LIB= apr -SRCS= apr_cpystrn.c apr_fnmatch.c apr_getpass.c apr_hash.c \ +SRCS= apr_cpystrn.c apr_fnmatch.c apr_getpass.c apr_hash.c apr_skiplist.c \ apr_pools.c apr_random.c apr_snprintf.c apr_strings.c \ apr_strnatcmp.c apr_strtok.c apr_tables.c buffer.c \ builtins.c charset.c common.c copy.c dir.c dso.c env.c \ @@ -18,7 +18,7 @@ SRCS= apr_cpystrn.c apr_fnmatch.c apr_g shm.c signals.c sockaddr.c socket_util.c sockets.c \ sockopt.c solaris.c start.c tempdir.c thread.c thread_cond.c \ thread_mutex.c thread_rwlock.c threadpriv.c time.c \ - timestr.c userinfo.c version.c waitio.c + timestr.c userinfo.c version.c waitio.c z_asio.c .PATH: ${APR}/atomic/unix ${APR}/dso/unix ${APR}/file_io/unix \ ${APR}/locks/unix ${APR}/memory/unix ${APR}/misc/unix \ Modified: head/usr.bin/svn/lib/libapr/apr.h ============================================================================== --- head/usr.bin/svn/lib/libapr/apr.h Tue May 27 07:15:14 2014 (r266735) +++ head/usr.bin/svn/lib/libapr/apr.h Tue May 27 07:16:43 2014 (r266736) @@ -118,7 +118,7 @@ * or the extern "C" namespace */ -#if APR_HAVE_WINDOWS_H +#if APR_HAVE_WINDOWS_H && defined(WIN32) /* If windows.h was already included, our preferences don't matter. * If not, include a restricted set of windows headers to our tastes. */ @@ -466,6 +466,8 @@ typedef apr_uint32_t apr_uin */ #define APR_THREAD_FUNC +#if defined(DOXYGEN) || !defined(WIN32) + /** * The public APR functions are declared with APR_DECLARE(), so they may * use the most appropriate calling convention. Public APR functions with @@ -518,6 +520,20 @@ typedef apr_uint32_t apr_uin */ #define APR_DECLARE_DATA +#elif defined(APR_DECLARE_STATIC) +#define APR_DECLARE(type) type __stdcall +#define APR_DECLARE_NONSTD(type) type __cdecl +#define APR_DECLARE_DATA +#elif defined(APR_DECLARE_EXPORT) +#define APR_DECLARE(type) __declspec(dllexport) type __stdcall +#define APR_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl +#define APR_DECLARE_DATA __declspec(dllexport) +#else +#define APR_DECLARE(type) __declspec(dllimport) type __stdcall +#define APR_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl +#define APR_DECLARE_DATA __declspec(dllimport) +#endif + /* Define APR_SSIZE_T_FMT. * If ssize_t is an integer we define it to be "d", * if ssize_t is a long int we define it to be "ld", Modified: head/usr.bin/svn/lib/libapr/apr_private.h ============================================================================== --- head/usr.bin/svn/lib/libapr/apr_private.h Tue May 27 07:15:14 2014 (r266735) +++ head/usr.bin/svn/lib/libapr/apr_private.h Tue May 27 07:16:43 2014 (r266736) @@ -86,6 +86,9 @@ /* Define if accept4 function is supported */ #define HAVE_ACCEPT4 1 +/* Define if async i/o supports message q's */ +/* #undef HAVE_AIO_MSGQ */ + /* Define to 1 if you have `alloca', as a function or macro. */ #define HAVE_ALLOCA 1 @@ -142,7 +145,7 @@ /* #undef HAVE_DL_H */ /* Define if dup3 function is supported */ -/* #undef HAVE_DUP3 */ +#define HAVE_DUP3 1 /* Define if EGD is supported */ /* #undef HAVE_EGD */ @@ -934,7 +937,7 @@ /* switch this on if we have a BeOS version below BONE */ -#if BEOS && !HAVE_BONE_VERSION +#if defined(BEOS) && !defined(HAVE_BONE_VERSION) #define BEOS_R5 1 #else #define BEOS_BONE 1 From owner-svn-src-head@FreeBSD.ORG Tue May 27 07:36:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B6E0513; Tue, 27 May 2014 07:36:20 +0000 (UTC) Received: from mailrelay011.isp.belgacom.be (mailrelay011.isp.belgacom.be [195.238.6.178]) by mx1.freebsd.org (Postfix) with ESMTP id BD6F3288D; Tue, 27 May 2014 07:36:18 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao0HALc/hFNbsXvB/2dsb2JhbABZFoJxUkutUpRQAYEKF3SCJQEBBTocIxALDgoJJQ8qHgaIWQEI1BsXjlIHhEABA5lygT6RaoM6Oy8 Received: from 193.123-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.123.193]) by relay.skynet.be with ESMTP; 27 May 2014 09:36:15 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.8/8.14.8) with ESMTP id s4R7aEFQ001068; Tue, 27 May 2014 09:36:14 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Tue, 27 May 2014 09:36:14 +0200 From: Tijl Coosemans To: Nathan Whitehorn Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140527093614.00ef5195@kalimero.tijl.coosemans.org> In-Reply-To: <5383EEB6.6010703@freebsd.org> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> <5380EBA8.1030200@freebsd.org> <20140525011307.142b41ab@kalimero.tijl.coosemans.org> <3CCAFAD3-FABE-40EF-ABF9-815FE5826349@bsdimp.com> <9FE34CE4-C71F-4806-9EF6-30CB1051C62F@bsdimp.com> <20140526113502.239db74d@kalimero.tijl.coosemans.org> <5383522F.30108@freebsd.org> <004b01cf7936$9fb11050$df1330f0$@FreeBSD.org> <5383EEB6.6010703@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: 'Baptiste Daroussin' , src-committers@FreeBSD.org, 'Ian Lepore' , svn-src-all@FreeBSD.org, 'Glen Barber' , svn-src-head@FreeBSD.org, dteske@FreeBSD.org, 'Warner Losh' X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 07:36:20 -0000 On Mon, 26 May 2014 18:47:34 -0700 Nathan Whitehorn wrote: > I've written two patches today. The first > (http://people.freebsd.org/~nwhitehorn/pkg_machinearch.diff) is to pkg > itself and the second > (http://people.freebsd.org/~nwhitehorn/pkg_bootstrap_machinearch.diff) > is to the pkg bootstrapper in base. These switch pkg from using > identifiers like "freebsd:11:arm:be:eabi:softfp" to identifiers like > "FreeBSD:11:armeb", matching the canonical FreeBSD platform identifiers. > The strings it uses can be predicted easily from scripts, as they are > identical in all cases to the output of `uname -s`:`uname -r | cut -f 1 > -d .`:`uname -p`. If those are the current names for arm then I also prefer uname -p for the third field. If each arch gets a default value of 32 or 64 for the fourth field it can also be left out in many cases. From owner-svn-src-head@FreeBSD.ORG Tue May 27 07:36:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9BD91690; Tue, 27 May 2014 07:36:44 +0000 (UTC) Received: from mailrelay009.isp.belgacom.be (mailrelay009.isp.belgacom.be [195.238.6.176]) by mx1.freebsd.org (Postfix) with ESMTP id 3B1362893; Tue, 27 May 2014 07:36:42 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AooHAFc/hFNbsXvB/2dsb2JhbABZgweub5RQAYEKF3SCJQEBBTIBIyMQCw4KCSUPKh4GE4hGAdQhF45SB4RAAQOZcpMogzo7 Received: from 193.123-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.123.193]) by relay.skynet.be with ESMTP; 27 May 2014 09:36:34 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.8/8.14.8) with ESMTP id s4R7aXAV001077; Tue, 27 May 2014 09:36:33 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Tue, 27 May 2014 09:36:33 +0200 From: Tijl Coosemans To: Warner Losh Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140527093633.0a922e13@kalimero.tijl.coosemans.org> In-Reply-To: <05D1A11D-5985-42EA-84AD-209A8B51D391@bsdimp.com> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> <5380EBA8.1030200@freebsd.org> <20140525011307.142b41ab@kalimero.tijl.coosemans.org> <3CCAFAD3-FABE-40EF-ABF9-815FE5826349@bsdimp.com> <9FE34CE4-C71F-4806-9EF6-30CB1051C62F@bsdimp.com> <20140526113502.239db74d@kalimero.tijl.coosemans.org> <5383522F.30108@freebsd.org> <20140527001811.3e9d3e8d@kalimero.tijl.coosemans.org> <05D1A11D-5985-42EA-84AD-209A8B51D391@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1253 Content-Transfer-Encoding: 8bit Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , Nathan Whitehorn , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 07:36:44 -0000 On Mon, 26 May 2014 16:31:21 -0600 Warner Losh wrote: > On May 26, 2014, at 4:18 PM, Tijl Coosemans wrote: >> On Mon, 26 May 2014 09:53:57 -0600 Warner Losh wrote: >>> On May 26, 2014, at 8:39 AM, Nathan Whitehorn wrote: >>>> On 05/26/14 02:35, Tijl Coosemans wrote: >>>>> I suppose you could replace the "x86" in the pkg scheme with i386/amd64, >>>>> but then you'd still be talking about i386:32, amd64:32 and amd64:64 >>>>> instead of x86:32, x86:x32 and x86:64. >>> >>> I suppose you could replace these by “i386”, “x32” (or “amd64x32”) and >>> “amd64” respectively. >> >> So you're on an amd64 or mips64 system (as indicated by uname) but you >> want to use the 32-bit package if possible. How does your script know >> about the magic "x32", "amd64x32" or "mipsn32" strings? Wouldn't it be >> easier if you could just use "`uname -p`:32”? > > Oh give me a break. You know it because you know you are building for > mipsn32 because that’s what you’ve set MACHINE_ARCH or TARGET_ARCH to, No, MACHINE_ARCH or TARGET_ARCH is "amd64" or "mips64". You are building the 64-bit OS and then decide separately per package whether you want the ILP32 one or the LP64 one. From owner-svn-src-head@FreeBSD.ORG Tue May 27 08:06:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECF54CB5; Tue, 27 May 2014 08:06:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA81E2B00; Tue, 27 May 2014 08:06:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4R86KlM064345; Tue, 27 May 2014 08:06:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4R86KIj064342; Tue, 27 May 2014 08:06:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405270806.s4R86KIj064342@svn.freebsd.org> From: Adrian Chadd Date: Tue, 27 May 2014 08:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266737 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 08:06:21 -0000 Author: adrian Date: Tue May 27 08:06:20 2014 New Revision: 266737 URL: http://svnweb.freebsd.org/changeset/base/266737 Log: The users of RSS shouldn't be directly concerned about hash -> CPU ID mappings. Instead, they should be first mapping to an RSS bucket and then querying the RSS bucket -> CPU ID mapping to figure out the target CPU. When (if?) RSS rebalancing is implemented or some other (non round-robin) distribution of work from buckets to CPU IDs, various bits of code - both userland and kernel - will need to know how this mapping works. So, to support this: * Add a new function rss_m2bucket() - this maps an mbuf to a given bucket. Anything which is currently doing hash -> CPU work may instead wish to do hash -> bucket, and then query the bucket->cpuid map for which CPU it belongs on. Or, map it to a bucket, then re-pin that bucket -> CPU during a rebalance operation. * For userland applications which wish to exploit affinity to RSS buckets, the bucket -> CPU ID mapping is now available via a sysctl. net.inet.rss.bucket_mapping lists the bucket to CPU ID mapping via a list of bucket:cpu pairs. Modified: head/sys/netinet/in_rss.c head/sys/netinet/in_rss.h Modified: head/sys/netinet/in_rss.c ============================================================================== --- head/sys/netinet/in_rss.c Tue May 27 07:16:43 2014 (r266736) +++ head/sys/netinet/in_rss.c Tue May 27 08:06:20 2014 (r266737) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -425,6 +426,24 @@ rss_hash2cpuid(uint32_t hash_val, uint32 } /* + * Query the RSS bucket associated with the given hash value and + * type. + */ +int +rss_hash2bucket(uint32_t hash_val, uint32_t hash_type, uint32_t *bucket_id) +{ + + switch (hash_type) { + case M_HASHTYPE_RSS_IPV4: + case M_HASHTYPE_RSS_TCP_IPV4: + *bucket_id = rss_getbucket(hash_val); + return (0); + default: + return (-1); + } +} + +/* * netisr CPU affinity lookup routine for use by protocols. */ struct mbuf * @@ -436,6 +455,16 @@ rss_m2cpuid(struct mbuf *m, uintptr_t so return (m); } +int +rss_m2bucket(struct mbuf *m, uint32_t *bucket_id) +{ + + M_ASSERTPKTHDR(m); + + return(rss_hash2bucket(m->m_pkthdr.flowid, M_HASHTYPE_GET(m), + bucket_id)); +} + /* * Query the RSS hash algorithm. */ @@ -512,3 +541,31 @@ sysctl_rss_key(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_net_inet_rss, OID_AUTO, key, CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_rss_key, "", "RSS keying material"); + +static int +sysctl_rss_bucket_mapping(SYSCTL_HANDLER_ARGS) +{ + struct sbuf *sb; + int error; + int i; + + error = 0; + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + sb = sbuf_new_for_sysctl(NULL, NULL, 512, req); + if (sb == NULL) + return (ENOMEM); + for (i = 0; i < rss_buckets; i++) { + sbuf_printf(sb, "%s%d:%d", i == 0 ? "" : " ", + i, + rss_getcpu(i)); + } + error = sbuf_finish(sb); + sbuf_delete(sb); + + return (error); +} +SYSCTL_PROC(_net_inet_rss, OID_AUTO, bucket_mapping, + CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, + sysctl_rss_bucket_mapping, "", "RSS bucket -> CPU mapping"); Modified: head/sys/netinet/in_rss.h ============================================================================== --- head/sys/netinet/in_rss.h Tue May 27 07:16:43 2014 (r266736) +++ head/sys/netinet/in_rss.h Tue May 27 08:06:20 2014 (r266737) @@ -91,5 +91,8 @@ uint32_t rss_hash_ip6_2tuple(struct in6_ */ struct mbuf *rss_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid); u_int rss_hash2cpuid(uint32_t hash_val, uint32_t hash_type); +int rss_hash2bucket(uint32_t hash_val, uint32_t hash_type, + uint32_t *bucket_id); +int rss_m2bucket(struct mbuf *m, uint32_t *bucket_id); #endif /* !_NETINET_IN_RSS_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue May 27 08:14:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07703C1; Tue, 27 May 2014 08:14:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7FCF2BE8; Tue, 27 May 2014 08:14:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4R8EsHg068976; Tue, 27 May 2014 08:14:54 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4R8Es9h068973; Tue, 27 May 2014 08:14:54 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201405270814.s4R8Es9h068973@svn.freebsd.org> From: Kevin Lo Date: Tue, 27 May 2014 08:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266738 - in head/sys/dev/usb: . net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 08:14:55 -0000 Author: kevlo Date: Tue May 27 08:14:54 2014 New Revision: 266738 URL: http://svnweb.freebsd.org/changeset/base/266738 Log: - Improve performance by fixing incorrect Rx/Tx handling - Rename definition of AXGE_* to reflect reality - Add new USB IDs Modified: head/sys/dev/usb/net/if_axge.c head/sys/dev/usb/net/if_axgereg.h head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Tue May 27 08:06:20 2014 (r266737) +++ head/sys/dev/usb/net/if_axge.c Tue May 27 08:14:54 2014 (r266738) @@ -66,7 +66,8 @@ static const STRUCT_USB_HOST_ID axge_dev #define AXGE_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } AXGE_DEV(ASIX, AX88178A), AXGE_DEV(ASIX, AX88179), - /* AXGE_DEV(SITECOMEU, LN032), */ + AXGE_DEV(DLINK, DUB1312), + AXGE_DEV(SITECOMEU, LN032), #undef AXGE_DEV }; @@ -108,12 +109,11 @@ static int axge_read_mem(struct axge_sof uint16_t, void *, int); static void axge_write_mem(struct axge_softc *, uint8_t, uint16_t, uint16_t, void *, int); -static uint8_t axge_read_cmd_1(struct axge_softc *, uint8_t, uint16_t, - uint16_t); +static uint8_t axge_read_cmd_1(struct axge_softc *, uint8_t, uint16_t); static uint16_t axge_read_cmd_2(struct axge_softc *, uint8_t, uint16_t, uint16_t); static void axge_write_cmd_1(struct axge_softc *, uint8_t, uint16_t, - uint16_t, uint8_t); + uint8_t); static void axge_write_cmd_2(struct axge_softc *, uint8_t, uint16_t, uint16_t, uint16_t); static void axge_chip_init(struct axge_softc *); @@ -125,7 +125,7 @@ static void axge_ifmedia_sts(struct ifne static int axge_ioctl(struct ifnet *, u_long, caddr_t); static int axge_rx_frame(struct usb_ether *, struct usb_page_cache *, int); static int axge_rxeof(struct usb_ether *, struct usb_page_cache *, - unsigned int, unsigned int, struct axge_csum_hdr *); + unsigned int, unsigned int, uint32_t); static void axge_csum_cfg(struct usb_ether *); #define AXGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) @@ -144,7 +144,7 @@ static const struct usb_config axge_conf .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .frames = 16, - .bufsize = 16 * (MCLBYTES + 16), + .bufsize = 16 * MCLBYTES, .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, .callback = axge_bulk_write_callback, .timeout = 10000, /* 10 seconds */ @@ -240,12 +240,11 @@ axge_write_mem(struct axge_softc *sc, ui } static uint8_t -axge_read_cmd_1(struct axge_softc *sc, uint8_t cmd, uint16_t index, - uint16_t reg) +axge_read_cmd_1(struct axge_softc *sc, uint8_t cmd, uint16_t reg) { uint8_t val; - axge_read_mem(sc, cmd, index, reg, &val, 1); + axge_read_mem(sc, cmd, 1, reg, &val, 1); return (val); } @@ -260,10 +259,9 @@ axge_read_cmd_2(struct axge_softc *sc, u } static void -axge_write_cmd_1(struct axge_softc *sc, uint8_t cmd, uint16_t index, - uint16_t reg, uint8_t val) +axge_write_cmd_1(struct axge_softc *sc, uint8_t cmd, uint16_t reg, uint8_t val) { - axge_write_mem(sc, cmd, index, reg, &val, 1); + axge_write_mem(sc, cmd, 1, reg, &val, 1); } static void @@ -356,31 +354,30 @@ axge_miibus_statchg(device_t dev) if ((sc->sc_flags & AXGE_FLAG_LINK) == 0) goto done; - link_status = axge_read_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_LINK_STATUS); + link_status = axge_read_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_PLSR); val = 0; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { - val |= AXGE_MEDIUM_FULL_DUPLEX; + val |= MSR_FD; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) - val |= AXGE_MEDIUM_TXFLOW_CTRLEN; + val |= MSR_TFC; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) - val |= AXGE_MEDIUM_RXFLOW_CTRLEN; + val |= MSR_RFC; } - val |= AXGE_MEDIUM_RECEIVE_EN; + val |= MSR_RE; switch (IFM_SUBTYPE(mii->mii_media_active)) { case IFM_1000_T: - val |= AXGE_MEDIUM_GIGAMODE | AXGE_MEDIUM_EN_125MHZ; - if (link_status & AXGE_LINK_STATUS_USB_SS) + val |= MSR_GM | MSR_EN_125MHZ; + if (link_status & PLSR_USB_SS) memcpy(tmp, &axge_bulk_size[0], 5); - else if (link_status & AXGE_LINK_STATUS_USB_HS) + else if (link_status & PLSR_USB_HS) memcpy(tmp, &axge_bulk_size[1], 5); else memcpy(tmp, &axge_bulk_size[3], 5); break; case IFM_100_TX: - val |= AXGE_MEDIUM_PS; - if (link_status & - (AXGE_LINK_STATUS_USB_SS | AXGE_LINK_STATUS_USB_HS)) + val |= MSR_PS; + if (link_status & (PLSR_USB_SS | PLSR_USB_HS)) memcpy(tmp, &axge_bulk_size[2], 5); else memcpy(tmp, &axge_bulk_size[3], 5); @@ -391,7 +388,7 @@ axge_miibus_statchg(device_t dev) } /* Rx bulk configuration. */ axge_write_mem(sc, AXGE_ACCESS_MAC, 5, AXGE_RX_BULKIN_QCTRL, tmp, 5); - axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MEDIUM_STATUS_MODE, val); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MSR, val); done: if (!locked) AXGE_UNLOCK(sc); @@ -401,11 +398,10 @@ static void axge_chip_init(struct axge_softc *sc) { /* Power up ethernet PHY. */ - axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_PHYPWR_RSTCTL, 0); - axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_PHYPWR_RSTCTL, - AXGE_PHYPWR_RSTCTL_IPRL); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_EPPRCR, 0); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_EPPRCR, EPPRCR_IPRL); uether_pause(&sc->sc_ue, hz / 4); - axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_CLK_SELECT, + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_CLK_SELECT, AXGE_CLK_SELECT_ACS | AXGE_CLK_SELECT_BCS); uether_pause(&sc->sc_ue, hz / 10); } @@ -440,7 +436,7 @@ axge_attach_post(struct usb_ether *ue) /* Initialize controller and get station address. */ axge_chip_init(sc); - axge_read_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NODE_ID, + axge_read_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NIDR, ue->ue_eaddr, ETHER_ADDR_LEN); } @@ -609,7 +605,8 @@ axge_bulk_read_callback(struct usb_xfer switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: pc = usbd_xfer_get_frame(xfer, 0); - axge_rx_frame(ue, pc, actlen); + if (axge_rx_frame(ue, pc, actlen) != 0) + goto tr_setup; /* FALLTHROUGH */ case USB_ST_SETUP: @@ -637,9 +634,7 @@ axge_bulk_write_callback(struct usb_xfer struct usb_page_cache *pc; struct mbuf *m; uint32_t txhdr; - uint32_t txhdr2; - int nframes; - int frm_len; + int nframes, pos; sc = usbd_xfer_softc(xfer); ifp = uether_getifp(&sc->sc_ue); @@ -666,26 +661,18 @@ tr_setup: break; usbd_xfer_set_frame_offset(xfer, nframes * MCLBYTES, nframes); - frm_len = 0; + pos = 0; pc = usbd_xfer_get_frame(xfer, nframes); - - txhdr = m->m_pkthdr.len; - txhdr = htole32(txhdr); + txhdr = htole32(m->m_pkthdr.len); usbd_copy_in(pc, 0, &txhdr, sizeof(txhdr)); - frm_len += sizeof(txhdr); - - txhdr2 = 0; - if ((m->m_pkthdr.len + sizeof(txhdr) + sizeof(txhdr2)) % - usbd_xfer_max_framelen(xfer) == 0) { - txhdr2 |= 0x80008000; - } - txhdr2 = htole32(txhdr2); - usbd_copy_in(pc, frm_len, &txhdr2, sizeof(txhdr2)); - frm_len += sizeof(txhdr2); - - /* Next copy in the actual packet. */ - usbd_m_copy_in(pc, frm_len, m, 0, m->m_pkthdr.len); - frm_len += m->m_pkthdr.len; + txhdr = 0; + txhdr = htole32(txhdr); + usbd_copy_in(pc, 4, &txhdr, sizeof(txhdr)); + pos += 8; + usbd_m_copy_in(pc, pos, m, 0, m->m_pkthdr.len); + pos += m->m_pkthdr.len; + if ((pos % usbd_xfer_max_framelen(xfer)) == 0) + txhdr |= 0x80008000; /* * XXX @@ -707,7 +694,7 @@ tr_setup: m_freem(m); /* Set frame length. */ - usbd_xfer_set_frame_len(xfer, nframes, frm_len); + usbd_xfer_set_frame_len(xfer, nframes, pos); } if (nframes != 0) { usbd_xfer_set_frames(xfer, nframes); @@ -762,13 +749,13 @@ axge_setmulti(struct usb_ether *ue) h = 0; AXGE_LOCK_ASSERT(sc, MA_OWNED); - rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL); + rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR); if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { - rxmode |= AXGE_RX_CTL_AMALL; - axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + rxmode |= RCR_AMALL; + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); return; } - rxmode &= ~AXGE_RX_CTL_AMALL; + rxmode &= ~RCR_AMALL; if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { @@ -780,9 +767,8 @@ axge_setmulti(struct usb_ether *ue) } if_maddr_runlock(ifp); - axge_write_mem(sc, AXGE_ACCESS_MAC, 8, AXGE_MULTI_FILTER_ARRY, - (void *)&hashtbl, 8); - axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + axge_write_mem(sc, AXGE_ACCESS_MAC, 8, AXGE_MFA, (void *)&hashtbl, 8); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); } static void @@ -794,14 +780,14 @@ axge_setpromisc(struct usb_ether *ue) sc = uether_getsc(ue); ifp = uether_getifp(ue); - rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL); + rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR); if (ifp->if_flags & IFF_PROMISC) - rxmode |= AXGE_RX_CTL_PRO; + rxmode |= RCR_PRO; else - rxmode &= ~AXGE_RX_CTL_PRO; + rxmode &= ~RCR_PRO; - axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); axge_setmulti(ue); } @@ -840,27 +826,31 @@ axge_init(struct usb_ether *ue) axge_reset(sc); /* Set MAC address. */ - axge_write_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NODE_ID, + axge_write_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NIDR, IF_LLADDR(ifp), ETHER_ADDR_LEN); - axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_PAUSE_WATERLVL_LOW, 0x34); - axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_PAUSE_WATERLVL_HIGH, - 0x52); + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_PWLLR, 0x34); + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_PWLHR, 0x52); /* Configure TX/RX checksum offloading. */ axge_csum_cfg(ue); /* Configure RX settings. */ - rxmode = (AXGE_RX_CTL_IPE | AXGE_RX_CTL_AM | AXGE_RX_CTL_START); + rxmode = (RCR_AM | RCR_SO | RCR_DROP_CRCE); + if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) + rxmode |= RCR_IPE; /* If we want promiscuous mode, set the allframes bit. */ if (ifp->if_flags & IFF_PROMISC) - rxmode |= AXGE_RX_CTL_PRO; + rxmode |= RCR_PRO; if (ifp->if_flags & IFF_BROADCAST) - rxmode |= AXGE_RX_CTL_AB; + rxmode |= RCR_AB; - axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); + + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_MMSR, + MMSR_PME_TYPE | MMSR_PME_POL | MMSR_RWMP); /* Load the multicast filter. */ axge_setmulti(ue); @@ -939,38 +929,39 @@ axge_ioctl(struct ifnet *ifp, u_long cmd static int axge_rx_frame(struct usb_ether *ue, struct usb_page_cache *pc, int actlen) { - struct axge_csum_hdr csum_hdr; - int error, len, pos; + int error, pos; int pkt_cnt; - uint32_t rxhdr; + uint32_t rxhdr, pkt_hdr; uint16_t hdr_off; - uint16_t pktlen; + uint16_t len, pktlen; pos = 0; len = 0; error = 0; usbd_copy_out(pc, actlen - sizeof(rxhdr), &rxhdr, sizeof(rxhdr)); - actlen -= sizeof(rxhdr); rxhdr = le32toh(rxhdr); pkt_cnt = (uint16_t)rxhdr; hdr_off = (uint16_t)(rxhdr >> 16); - usbd_copy_out(pc, pos + hdr_off, &csum_hdr, sizeof(csum_hdr)); - csum_hdr.len = le16toh(csum_hdr.len); - csum_hdr.cstatus = le16toh(csum_hdr.cstatus); + usbd_copy_out(pc, hdr_off, &pkt_hdr, sizeof(pkt_hdr)); - while (pkt_cnt--) { - if (actlen <= sizeof(csum_hdr) + sizeof(struct ether_header)) { + while (pkt_cnt > 0) { + if ((int)(sizeof(pkt_hdr)) > actlen) { error = EINVAL; break; } - pktlen = AXGE_CSUM_RXBYTES(csum_hdr.len); - - if (pkt_cnt == 0) - /* Skip the 2-byte IP alignment header. */ - axge_rxeof(ue, pc, 2, pktlen - 2, &csum_hdr); + pkt_hdr = le32toh(pkt_hdr); + pktlen = (pkt_hdr >> 16) & 0x1fff; + if ((pkt_hdr & AXGE_RXHDR_CRC_ERR) || + (pkt_hdr & AXGE_RXHDR_DROP_ERR)) + ue->ue_ifp->if_ierrors++; + axge_rxeof(ue, pc, pos + 2, pktlen - 6, pkt_hdr); + len = (pktlen + 7) & ~7; + pos += len; + pkt_hdr++; + pkt_cnt--; } if (error != 0) @@ -980,7 +971,7 @@ axge_rx_frame(struct usb_ether *ue, stru static int axge_rxeof(struct usb_ether *ue, struct usb_page_cache *pc, - unsigned int offset, unsigned int len, struct axge_csum_hdr *csum_hdr) + unsigned int offset, unsigned int len, uint32_t pkt_hdr) { struct ifnet *ifp; struct mbuf *m; @@ -1005,20 +996,15 @@ axge_rxeof(struct usb_ether *ue, struct m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = len; - if (csum_hdr != NULL && - csum_hdr->cstatus & AXGE_CSUM_HDR_L3_TYPE_IPV4) { - if ((csum_hdr->cstatus & (AXGE_CSUM_HDR_L4_CSUM_ERR | - AXGE_RXHDR_L4CSUM_ERR)) == 0) { - m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED | - CSUM_IP_VALID; - if ((csum_hdr->cstatus & AXGE_CSUM_HDR_L4_TYPE_MASK) == - AXGE_CSUM_HDR_L4_TYPE_TCP || - (csum_hdr->cstatus & AXGE_CSUM_HDR_L4_TYPE_MASK) == - AXGE_CSUM_HDR_L4_TYPE_UDP) { - m->m_pkthdr.csum_flags |= - CSUM_DATA_VALID | CSUM_PSEUDO_HDR; - m->m_pkthdr.csum_data = 0xffff; - } + if ((pkt_hdr & (AXGE_RXHDR_L4CSUM_ERR | AXGE_RXHDR_L3CSUM_ERR)) == 0) { + m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED | CSUM_IP_VALID; + if ((pkt_hdr & AXGE_RXHDR_L4_TYPE_MASK) == + AXGE_RXHDR_L4_TYPE_TCP || + (pkt_hdr & AXGE_RXHDR_L4_TYPE_MASK) == + AXGE_RXHDR_L4_TYPE_UDP) { + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | + CSUM_PSEUDO_HDR; + m->m_pkthdr.csum_data = 0xffff; } } @@ -1039,12 +1025,11 @@ axge_csum_cfg(struct usb_ether *ue) csum = 0; if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) - csum |= AXGE_TXCOE_IP | AXGE_TXCOE_TCP | AXGE_TXCOE_UDP; - axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_TXCOE_CTL, csum); + csum |= CTCR_IP | CTCR_TCP | CTCR_UDP; + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_CTCR, csum); csum = 0; if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) - csum |= AXGE_RXCOE_IP | AXGE_RXCOE_TCP | AXGE_RXCOE_UDP | - AXGE_RXCOE_ICMP | AXGE_RXCOE_IGMP; - axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_RXCOE_CTL, csum); + csum |= CRCR_IP | CRCR_TCP | CRCR_UDP; + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_CRCR, csum); } Modified: head/sys/dev/usb/net/if_axgereg.h ============================================================================== --- head/sys/dev/usb/net/if_axgereg.h Tue May 27 08:06:20 2014 (r266737) +++ head/sys/dev/usb/net/if_axgereg.h Tue May 27 08:14:54 2014 (r266738) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Kevin Lo + * Copyright (c) 2013-2014 Kevin Lo * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,13 +26,6 @@ * $FreeBSD$ */ -#define AX88179_PHY_ID 0x03 -#define AXGE_MCAST_FILTER_SIZE 8 -#define AXGE_MAXGE_MCAST 64 -#define AXGE_EEPROM_LEN 0x40 -#define AXGE_RX_CHECKSUM 1 -#define AXGE_TX_CHECKSUM 2 - #define AXGE_ACCESS_MAC 0x01 #define AXGE_ACCESS_PHY 0x02 #define AXGE_ACCESS_WAKEUP 0x03 @@ -43,74 +36,73 @@ #define AXGE_WRITE_EFUSE_DIS 0x0A #define AXGE_ACCESS_MFAB 0x10 -#define AXGE_LINK_STATUS 0x02 -#define AXGE_LINK_STATUS_USB_FS 0x01 -#define AXGE_LINK_STATUS_USB_HS 0x02 -#define AXGE_LINK_STATUS_USB_SS 0x04 - -#define AXGE_SROM_ADDR 0x07 -#define AXGE_SROM_DATA_LOW 0x08 -#define AXGE_SROM_DATA_HIGH 0x09 -#define AXGE_SROM_CMD 0x0a -#define AXGE_SROM_CMD_RD 0x04 /* EEprom read command */ -#define AXGE_SROM_CMD_WR 0x08 /* EEprom write command */ -#define AXGE_SROM_CMD_BUSY 0x10 /* EEprom access module busy */ - -#define AXGE_RX_CTL 0x0b -#define AXGE_RX_CTL_DROPCRCERR 0x0100 /* Drop CRC error packet */ -#define AXGE_RX_CTL_IPE 0x0200 /* 4-byte IP header alignment */ -#define AXGE_RX_CTL_TXPADCRC 0x0400 /* Csum value in rx header 3 */ -#define AXGE_RX_CTL_START 0x0080 /* Ethernet MAC start */ -#define AXGE_RX_CTL_AP 0x0020 /* Accept physical address from - multicast array */ -#define AXGE_RX_CTL_AM 0x0010 -#define AXGE_RX_CTL_AB 0x0008 -#define AXGE_RX_CTL_HA8B 0x0004 -#define AXGE_RX_CTL_AMALL 0x0002 /* Accept all multicast frames */ -#define AXGE_RX_CTL_PRO 0x0001 /* Promiscuous Mode */ -#define AXGE_RX_CTL_STOP 0x0000 /* Stop MAC */ - -#define AXGE_NODE_ID 0x10 -#define AXGE_MULTI_FILTER_ARRY 0x16 - -#define AXGE_MEDIUM_STATUS_MODE 0x22 -#define AXGE_MEDIUM_GIGAMODE 0x0001 -#define AXGE_MEDIUM_FULL_DUPLEX 0x0002 -#define AXGE_MEDIUM_ALWAYS_ONE 0x0004 -#define AXGE_MEDIUM_EN_125MHZ 0x0008 -#define AXGE_MEDIUM_RXFLOW_CTRLEN 0x0010 -#define AXGE_MEDIUM_TXFLOW_CTRLEN 0x0020 -#define AXGE_MEDIUM_RECEIVE_EN 0x0100 -#define AXGE_MEDIUM_PS 0x0200 -#define AXGE_MEDIUM_JUMBO_EN 0x8040 - -#define AXGE_MONITOR_MODE 0x24 -#define AXGE_MONITOR_MODE_RWLC 0x02 -#define AXGE_MONITOR_MODE_RWMP 0x04 -#define AXGE_MONITOR_MODE_RWWF 0x08 -#define AXGE_MONITOR_MODE_RW_FLAG 0x10 -#define AXGE_MONITOR_MODE_PMEPOL 0x20 -#define AXGE_MONITOR_MODE_PMETYPE 0x40 - -#define AXGE_GPIO_CTRL 0x25 -#define AXGE_GPIO_CTRL_GPIO3EN 0x80 -#define AXGE_GPIO_CTRL_GPIO2EN 0x40 -#define AXGE_GPIO_CTRL_GPIO1EN 0x20 - -#define AXGE_PHYPWR_RSTCTL 0x26 -#define AXGE_PHYPWR_RSTCTL_BZ 0x0010 -#define AXGE_PHYPWR_RSTCTL_IPRL 0x0020 -#define AXGE_PHYPWR_RSTCTL_AUTODETACH 0x1000 +/* Physical link status register */ +#define AXGE_PLSR 0x02 +#define PLSR_USB_FS 0x01 +#define PLSR_USB_HS 0x02 +#define PLSR_USB_SS 0x04 + +/* EEPROM address register */ +#define AXGE_EAR 0x07 + +/* EEPROM data low register */ +#define AXGE_EDLR 0x08 + +/* EEPROM data high register */ +#define AXGE_EDHR 0x09 + +/* EEPROM command register */ +#define AXGE_ECR 0x0a + +/* Rx control register */ +#define AXGE_RCR 0x0b +#define RCR_STOP 0x0000 +#define RCR_PRO 0x0001 +#define RCR_AMALL 0x0002 +#define RCR_AB 0x0008 +#define RCR_AM 0x0010 +#define RCR_AP 0x0020 +#define RCR_SO 0x0080 +#define RCR_DROP_CRCE 0x0100 +#define RCR_IPE 0x0200 +#define RCR_TX_CRC_PAD 0x0400 + +/* Node id register */ +#define AXGE_NIDR 0x10 + +/* Multicast filter array */ +#define AXGE_MFA 0x16 + +/* Medium status register */ +#define AXGE_MSR 0x22 +#define MSR_GM 0x0001 +#define MSR_FD 0x0002 +#define MSR_EN_125MHZ 0x0008 +#define MSR_RFC 0x0010 +#define MSR_TFC 0x0020 +#define MSR_RE 0x0100 +#define MSR_PS 0x0200 + +/* Monitor mode status register */ +#define AXGE_MMSR 0x24 +#define MMSR_RWLC 0x02 +#define MMSR_RWMP 0x04 +#define MMSR_RWWF 0x08 +#define MMSR_RW_FLAG 0x10 +#define MMSR_PME_POL 0x20 +#define MMSR_PME_TYPE 0x40 +#define MMSR_PME_IND 0x80 + +/* GPIO control/status register */ +#define AXGE_GPIOCR 0x25 + +/* Ethernet PHY power & reset control register */ +#define AXGE_EPPRCR 0x26 +#define EPPRCR_BZ 0x0010 +#define EPPRCR_IPRL 0x0020 +#define EPPRCR_AUTODETACH 0x1000 #define AXGE_RX_BULKIN_QCTRL 0x2e -#define AXGE_RX_BULKIN_QCTRL_TIME 0x01 -#define AXGE_RX_BULKIN_QCTRL_IFG 0x02 -#define AXGE_RX_BULKIN_QCTRL_SIZE 0x04 - -#define AXGE_RX_BULKIN_QTIMR_LOW 0x2f -#define AXGE_RX_BULKIN_QTIMR_HIGH 0x30 -#define AXGE_RX_BULKIN_QSIZE 0x31 -#define AXGE_RX_BULKIN_QIFG 0x32 #define AXGE_CLK_SELECT 0x33 #define AXGE_CLK_SELECT_BCS 0x01 @@ -118,75 +110,44 @@ #define AXGE_CLK_SELECT_ACSREQ 0x10 #define AXGE_CLK_SELECT_ULR 0x08 -#define AXGE_RXCOE_CTL 0x34 -#define AXGE_RXCOE_IP 0x01 -#define AXGE_RXCOE_TCP 0x02 -#define AXGE_RXCOE_UDP 0x04 -#define AXGE_RXCOE_ICMP 0x08 -#define AXGE_RXCOE_IGMP 0x10 -#define AXGE_RXCOE_TCPV6 0x20 -#define AXGE_RXCOE_UDPV6 0x40 -#define AXGE_RXCOE_ICMV6 0x80 - -#define AXGE_TXCOE_CTL 0x35 -#define AXGE_TXCOE_IP 0x01 -#define AXGE_TXCOE_TCP 0x02 -#define AXGE_TXCOE_UDP 0x04 -#define AXGE_TXCOE_ICMP 0x08 -#define AXGE_TXCOE_IGMP 0x10 -#define AXGE_TXCOE_TCPV6 0x20 -#define AXGE_TXCOE_UDPV6 0x40 -#define AXGE_TXCOE_ICMV6 0x80 +/* COE Rx control register */ +#define AXGE_CRCR 0x34 +#define CRCR_IP 0x01 +#define CRCR_TCP 0x02 +#define CRCR_UDP 0x04 +#define CRCR_ICMP 0x08 +#define CRCR_IGMP 0x10 +#define CRCR_TCPV6 0x20 +#define CRCR_UDPV6 0x40 +#define CRCR_ICMPV6 0x80 + +/* COE Tx control register */ +#define AXGE_CTCR 0x35 +#define CTCR_IP 0x01 +#define CTCR_TCP 0x02 +#define CTCR_UDP 0x04 +#define CTCR_ICMP 0x08 +#define CTCR_IGMP 0x10 +#define CTCR_TCPV6 0x20 +#define CTCR_UDPV6 0x40 +#define CTCR_ICMPV6 0x80 -#define AXGE_PAUSE_WATERLVL_HIGH 0x54 -#define AXGE_PAUSE_WATERLVL_LOW 0x55 +/* Pause water level high register */ +#define AXGE_PWLHR 0x54 -#define AXGE_EEP_EFUSE_CORRECT 0x00 -#define AX88179_EEPROM_MAGIC 0x17900b95 +/* Pause water level low register */ +#define AXGE_PWLLR 0x55 #define AXGE_CONFIG_IDX 0 /* config number 1 */ #define AXGE_IFACE_IDX 0 -#define AXGE_RXHDR_CRC_ERR 0x80000000 -#define AXGE_RXHDR_L4_ERR (1 << 8) -#define AXGE_RXHDR_L3_ERR (1 << 9) - -#define AXGE_RXHDR_L4_TYPE_ICMP 2 -#define AXGE_RXHDR_L4_TYPE_IGMP 3 -#define AXGE_RXHDR_L4_TYPE_TCMPV6 5 - -#define AXGE_RXHDR_L3_TYPE_IP 1 -#define AXGE_RXHDR_L3_TYPE_IPV6 2 - #define AXGE_RXHDR_L4_TYPE_MASK 0x1c +#define AXGE_RXHDR_L4CSUM_ERR 1 +#define AXGE_RXHDR_L3CSUM_ERR 2 #define AXGE_RXHDR_L4_TYPE_UDP 4 #define AXGE_RXHDR_L4_TYPE_TCP 16 -#define AXGE_RXHDR_L3CSUM_ERR 2 -#define AXGE_RXHDR_L4CSUM_ERR 1 -#define AXGE_RXHDR_CRC_ERR 0x80000000 -#define AXGE_RXHDR_DROP_ERR 0x40000000 - -struct axge_csum_hdr { - uint16_t cstatus; -#define AXGE_CSUM_HDR_L4_CSUM_ERR 0x0001 -#define AXGE_CSUM_HDR_L3_CSUM_ERR 0x0002 -#define AXGE_CSUM_HDR_L4_TYPE_UDP 0x0004 -#define AXGE_CSUM_HDR_L4_TYPE_ICMP 0x0008 -#define AXGE_CSUM_HDR_L4_TYPE_IGMP 0x000C -#define AXGE_CSUM_HDR_L4_TYPE_TCP 0x0010 -#define AXGE_CSUM_HDR_L4_TYPE_TCPV6 0x0014 -#define AXGE_CSUM_HDR_L4_TYPE_MASK 0x001C -#define AXGE_CSUM_HDR_L3_TYPE_IPV4 0x0020 -#define AXGE_CSUM_HDR_L3_TYPE_IPV6 0x0040 -#define AXGE_CSUM_HDR_VLAN_MASK 0x0700 - uint16_t len; -#define AXGE_CSUM_HDR_LEN_MASK 0x1FFF -#define AXGE_CSUM_HDR_CRC_ERR 0x2000 -#define AXGE_CSUM_HDR_MII_ERR 0x4000 -#define AXGE_CSUM_HDR_DROP 0x8000 -} __packed; - -#define AXGE_CSUM_RXBYTES(x) ((x) & AXGE_CSUM_HDR_LEN_MASK) +#define AXGE_RXHDR_CRC_ERR 0x20000000 +#define AXGE_RXHDR_DROP_ERR 0x80000000 #define GET_MII(sc) uether_getmii(&(sc)->sc_ue) Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue May 27 08:06:20 2014 (r266737) +++ head/sys/dev/usb/usbdevs Tue May 27 08:14:54 2014 (r266738) @@ -1615,6 +1615,7 @@ product DLINK DSB650TX 0x4002 10/100 Et product DLINK DSB650TX_PNA 0x4003 1/10/100 Ethernet product DLINK DSB650TX3 0x400b 10/100 Ethernet product DLINK DSB650TX2 0x4102 10/100 Ethernet +product DLINK DUB1312 0x4a00 10/100/1000 Ethernet product DLINK DSB650 0xabc1 10/100 Ethernet product DLINK DUBH7 0xf103 DUB-H7 USB 2.0 7-Port Hub product DLINK DWR510_CD 0xa805 DWR-510 CD-ROM Mode @@ -4094,6 +4095,7 @@ product SITECOMEU RT3072_6 0x004d RT3072 product SITECOMEU RTL8188CU_1 0x0052 RTL8188CU product SITECOMEU RTL8188CU_2 0x005c RTL8188CU product SITECOMEU RTL8192CU 0x0061 RTL8192CU +product SITECOMEU LN032 0x0072 LN-032 product SITECOMEU LN028 0x061c LN-028 product SITECOMEU WL113 0x9071 WL-113 product SITECOMEU ZD1211B 0x9075 ZD1211B From owner-svn-src-head@FreeBSD.ORG Tue May 27 10:01:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1B36B5D; Tue, 27 May 2014 10:01:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DE272626; Tue, 27 May 2014 10:01:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RA1JeM017313; Tue, 27 May 2014 10:01:19 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RA1JjQ017311; Tue, 27 May 2014 10:01:19 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405271001.s4RA1JjQ017311@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 27 May 2014 10:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266741 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 10:01:19 -0000 Author: hselasky Date: Tue May 27 10:01:19 2014 New Revision: 266741 URL: http://svnweb.freebsd.org/changeset/base/266741 Log: Multiple fixes and improvements: - Put "_LE_" into the register access macros to indicate little endian byte order is expected by the hardware. - Avoid using the bounce buffer when not strictly needed. Try to move data directly using bus-space functions first. - Ensure we preserve the reserved bits in the power down mode register. Else the hardware goes into a non-recoverable state. - Always use 32-bit access when writing or reading registers or FIFOs, because the hardware is 32-bit oriented and don't really understand 8- and 16-bit access. - Correct writes to the memory address register. There is no need to shift the register offset. - Correct interval for interrupt endpoints. - Optimise 90ns internal memory buffer read delay. - Rename PDT into PTD, which is how the datasheet writes it. - Add missing programming for activating host controller PTDs. Sponsored by: DARPA, AFRL Modified: head/sys/dev/usb/controller/saf1761_otg.c head/sys/dev/usb/controller/saf1761_otg.h head/sys/dev/usb/controller/saf1761_otg_reg.h Modified: head/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.c Tue May 27 09:42:07 2014 (r266740) +++ head/sys/dev/usb/controller/saf1761_otg.c Tue May 27 10:01:19 2014 (r266741) @@ -195,9 +195,9 @@ saf1761_otg_wakeup_peer(struct saf1761_o DPRINTFN(5, "\n"); - temp = SAF1761_READ_2(sc, SOTG_MODE); - SAF1761_WRITE_2(sc, SOTG_MODE, temp | SOTG_MODE_SNDRSU); - SAF1761_WRITE_2(sc, SOTG_MODE, temp & ~SOTG_MODE_SNDRSU); + temp = SAF1761_READ_LE_4(sc, SOTG_MODE); + SAF1761_WRITE_LE_4(sc, SOTG_MODE, temp | SOTG_MODE_SNDRSU); + SAF1761_WRITE_LE_4(sc, SOTG_MODE, temp & ~SOTG_MODE_SNDRSU); /* Wait 8ms for remote wakeup to complete. */ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); @@ -253,8 +253,8 @@ saf1761_host_channel_free(struct saf1761 return; /* disable channel */ - SAF1761_WRITE_4(sc, SOTG_PDT(td->channel) + SOTG_PDT_DW3, 0); - SAF1761_WRITE_4(sc, SOTG_PDT(td->channel) + SOTG_PDT_DW0, 0); + SAF1761_WRITE_LE_4(sc, SOTG_PTD(td->channel) + SOTG_PTD_DW3, 0); + SAF1761_WRITE_LE_4(sc, SOTG_PTD(td->channel) + SOTG_PTD_DW0, 0); switch (td->ep_type) { case UE_INTERRUPT: @@ -275,49 +275,143 @@ saf1761_host_channel_free(struct saf1761 } } +static uint32_t +saf1761_peek_host_memory_le_4(struct saf1761_otg_softc *sc, uint32_t offset) +{ + SAF1761_WRITE_LE_4(sc, SOTG_MEMORY_REG, offset); + SAF1761_90NS_DELAY(sc); /* read prefetch time is 90ns */ + return (SAF1761_READ_LE_4(sc, offset)); +} + static void -saf1761_read_host_memory_4(struct saf1761_otg_softc *sc, uint32_t offset, - void *buf, uint32_t count) +saf1761_read_host_memory(struct saf1761_otg_softc *sc, + struct saf1761_otg_td *td, uint32_t len) { - if (count == 0) + struct usb_page_search buf_res; + uint32_t offset; + uint32_t count; + + if (len == 0) return; - SAF1761_WRITE_4(sc, SOTG_MEMORY_REG, SOTG_HC_MEMORY_ADDR(offset)); - DELAY(1); /* read prefetch time is 90ns */ - bus_space_read_region_4((sc)->sc_io_tag, (sc)->sc_io_hdl, offset, buf, count); + + offset = SOTG_DATA_ADDR(td->channel); + SAF1761_WRITE_LE_4(sc, SOTG_MEMORY_REG, offset); + SAF1761_90NS_DELAY(sc); /* read prefetch time is 90ns */ + + /* optimised read first */ + while (len > 0) { + usbd_get_page(td->pc, td->offset, &buf_res); + + /* get correct length */ + if (buf_res.length > len) + buf_res.length = len; + + /* check buffer alignment */ + if (((uintptr_t)buf_res.buffer) & 3) + break; + + count = buf_res.length & ~3; + if (count == 0) + break; + + bus_space_read_region_4((sc)->sc_io_tag, (sc)->sc_io_hdl, + offset, buf_res.buffer, count / 4); + + len -= count; + offset += count; + + /* update remainder and offset */ + td->remainder -= count; + td->offset += count; + } + + if (len > 0) { + /* use bounce buffer */ + bus_space_read_region_4((sc)->sc_io_tag, (sc)->sc_io_hdl, + offset, sc->sc_bounce_buffer, (len + 3) / 4); + usbd_copy_in(td->pc, td->offset, + sc->sc_bounce_buffer, len); + + /* update remainder and offset */ + td->remainder -= len; + td->offset += len; + } } static void -saf1761_write_host_memory_4(struct saf1761_otg_softc *sc, uint32_t offset, - void *buf, uint32_t count) +saf1761_write_host_memory(struct saf1761_otg_softc *sc, + struct saf1761_otg_td *td, uint32_t len) { - if (count == 0) + struct usb_page_search buf_res; + uint32_t offset; + uint32_t count; + + if (len == 0) return; - bus_space_write_region_4((sc)->sc_io_tag, (sc)->sc_io_hdl, offset, buf, count); + + offset = SOTG_DATA_ADDR(td->channel); + + /* optimised write first */ + while (len > 0) { + usbd_get_page(td->pc, td->offset, &buf_res); + + /* get correct length */ + if (buf_res.length > len) + buf_res.length = len; + + /* check buffer alignment */ + if (((uintptr_t)buf_res.buffer) & 3) + break; + + count = buf_res.length & ~3; + if (count == 0) + break; + + bus_space_write_region_4((sc)->sc_io_tag, (sc)->sc_io_hdl, + offset, buf_res.buffer, count / 4); + + len -= count; + offset += count; + + /* update remainder and offset */ + td->remainder -= count; + td->offset += count; + } + if (len > 0) { + /* use bounce buffer */ + usbd_copy_out(td->pc, td->offset, sc->sc_bounce_buffer, len); + bus_space_write_region_4((sc)->sc_io_tag, (sc)->sc_io_hdl, + offset, sc->sc_bounce_buffer, (len + 3) / 4); + + /* update remainder and offset */ + td->remainder -= len; + td->offset += len; + } } static uint8_t saf1761_host_setup_tx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { - struct usb_device_request req __aligned(4); uint32_t pdt_addr; uint32_t status; uint32_t count; uint32_t temp; if (td->channel < SOTG_HOST_CHANNEL_MAX) { - pdt_addr = SOTG_PDT(td->channel); + pdt_addr = SOTG_PTD(td->channel); - saf1761_read_host_memory_4(sc, pdt_addr + SOTG_PDT_DW3, &status, 1); + status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + DPRINTFN(5, "STATUS=0x%08x\n", status); - if (status & SOTG_PDT_DW3_ACTIVE) { + if (status & SOTG_PTD_DW3_ACTIVE) { goto busy; - } else if (status & SOTG_PDT_DW3_HALTED) { + } else if (status & SOTG_PTD_DW3_HALTED) { td->error_stall = 1; td->error_any = 1; - } else if (status & SOTG_PDT_DW3_ERRORS) { + } else if (status & SOTG_PTD_DW3_ERRORS) { td->error_any = 1; } - count = (status & SOTG_PDT_DW3_XFER_COUNT); + count = (status & SOTG_PTD_DW3_XFER_COUNT); saf1761_host_channel_free(sc, td); goto complete; @@ -325,42 +419,37 @@ saf1761_host_setup_tx(struct saf1761_otg if (saf1761_host_channel_alloc(sc, td)) goto busy; - if (sizeof(req) != td->remainder) { + count = 8; + + if (count != td->remainder) { td->error_any = 1; goto complete; } - count = sizeof(req); - - usbd_copy_out(td->pc, 0, &req, count); + saf1761_write_host_memory(sc, td, count); - saf1761_write_host_memory_4(sc, SOTG_DATA_ADDR(td->channel), - &req, (count + 3) / 4); + pdt_addr = SOTG_PTD(td->channel); - pdt_addr = SOTG_PDT(td->channel); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW7, 0); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW6, 0); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW5, 0); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW4, 0); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW7, 0); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW6, 0); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW5, 0); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW4, 0); - - temp = SOTG_PDT_DW3_ACTIVE | (td->toggle << 25) | SOTG_PDT_DW3_CERR; - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW3, temp); + temp = SOTG_PTD_DW3_ACTIVE | (td->toggle << 25) | SOTG_PTD_DW3_CERR; + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW3, temp); temp = SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8; - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW2, temp); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW2, temp); temp = td->dw1_value | (2 << 10) /* SETUP PID */ | (td->ep_index >> 1); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW1, temp); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW1, temp); temp = (td->ep_index << 31) | (1 << 29) /* pkt-multiplier */ | (td->max_packet_size << 18) /* wMaxPacketSize */ | (count << 3) /* transfer count */ | - SOTG_PDT_DW0_VALID; - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW0, temp); + SOTG_PTD_DW0_VALID; + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW0, temp); - td->offset += count; - td->remainder -= count; td->toggle = 1; busy: return (1); /* busy */ @@ -379,21 +468,22 @@ saf1761_host_bulk_data_rx(struct saf1761 uint32_t count; uint8_t got_short; - pdt_addr = SOTG_PDT(td->channel); + pdt_addr = SOTG_PTD(td->channel); - saf1761_read_host_memory_4(sc, pdt_addr + SOTG_PDT_DW3, &status, 1); + status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + DPRINTFN(5, "STATUS=0x%08x\n", status); - if (status & SOTG_PDT_DW3_ACTIVE) { + if (status & SOTG_PTD_DW3_ACTIVE) { goto busy; - } else if (status & SOTG_PDT_DW3_HALTED) { + } else if (status & SOTG_PTD_DW3_HALTED) { td->error_stall = 1; td->error_any = 1; goto complete; - } else if (status & SOTG_PDT_DW3_ERRORS) { + } else if (status & SOTG_PTD_DW3_ERRORS) { td->error_any = 1; goto complete; } - count = (status & SOTG_PDT_DW3_XFER_COUNT); + count = (status & SOTG_PTD_DW3_XFER_COUNT); got_short = 0; /* verify the packet byte count */ @@ -417,14 +507,7 @@ saf1761_host_bulk_data_rx(struct saf1761 goto complete; } - saf1761_read_host_memory_4(sc, SOTG_DATA_ADDR(td->channel), - sc->sc_bounce_buffer, (count + 3) / 4); - - usbd_copy_in(td->pc, td->offset, - sc->sc_bounce_buffer, count); - - td->remainder -= count; - td->offset += count; + saf1761_read_host_memory(sc, td, count); saf1761_host_channel_free(sc, td); @@ -446,27 +529,27 @@ saf1761_host_bulk_data_rx(struct saf1761 /* receive one more packet */ - pdt_addr = SOTG_PDT(td->channel); + pdt_addr = SOTG_PTD(td->channel); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW7, 0); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW6, 0); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW5, 0); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW4, 0); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW7, 0); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW6, 0); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW5, 0); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW4, 0); - temp = SOTG_PDT_DW3_ACTIVE | (td->toggle << 25) | SOTG_PDT_DW3_CERR; - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW3, temp); + temp = SOTG_PTD_DW3_ACTIVE | (td->toggle << 25) | SOTG_PTD_DW3_CERR; + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW3, temp); temp = SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8; - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW2, temp); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW2, temp); temp = td->dw1_value | (1 << 10) /* IN-PID */ | (td->ep_index >> 1); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW1, temp); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW1, temp); temp = (td->ep_index << 31) | (1 << 29) /* pkt-multiplier */ | (td->max_packet_size << 18) /* wMaxPacketSize */ | (td->max_packet_size << 3) /* transfer count */ | - SOTG_PDT_DW0_VALID; - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW0, temp); + SOTG_PTD_DW0_VALID; + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW0, temp); busy: return (1); /* busy */ complete: @@ -483,16 +566,17 @@ saf1761_host_bulk_data_tx(struct saf1761 if (td->channel < SOTG_HOST_CHANNEL_MAX) { uint32_t status; - pdt_addr = SOTG_PDT(td->channel); + pdt_addr = SOTG_PTD(td->channel); - saf1761_read_host_memory_4(sc, pdt_addr + SOTG_PDT_DW3, &status, 1); + status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + DPRINTFN(5, "STATUS=0x%08x\n", status); - if (status & SOTG_PDT_DW3_ACTIVE) { + if (status & SOTG_PTD_DW3_ACTIVE) { goto busy; - } else if (status & SOTG_PDT_DW3_HALTED) { + } else if (status & SOTG_PTD_DW3_HALTED) { td->error_stall = 1; td->error_any = 1; - } else if (status & SOTG_PDT_DW3_ERRORS) { + } else if (status & SOTG_PTD_DW3_ERRORS) { td->error_any = 1; } @@ -515,9 +599,7 @@ saf1761_host_bulk_data_tx(struct saf1761 count = td->remainder; } - usbd_copy_out(td->pc, td->offset, sc->sc_bounce_buffer, count); - saf1761_write_host_memory_4(sc, SOTG_DATA_ADDR(td->channel), - sc->sc_bounce_buffer, (count + 3) / 4); + saf1761_write_host_memory(sc, td, count); /* set toggle, if any */ if (td->set_toggle) { @@ -527,30 +609,28 @@ saf1761_host_bulk_data_tx(struct saf1761 /* send one more packet */ - pdt_addr = SOTG_PDT(td->channel); + pdt_addr = SOTG_PTD(td->channel); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW7, 0); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW6, 0); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW5, 0); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW4, 0); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW7, 0); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW6, 0); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW5, 0); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW4, 0); - temp = SOTG_PDT_DW3_ACTIVE | (td->toggle << 25) | SOTG_PDT_DW3_CERR; - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW3, temp); + temp = SOTG_PTD_DW3_ACTIVE | (td->toggle << 25) | SOTG_PTD_DW3_CERR; + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW3, temp); temp = SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8; - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW2, temp); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW2, temp); temp = td->dw1_value | (0 << 10) /* OUT-PID */ | (td->ep_index >> 1); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW1, temp); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW1, temp); temp = (td->ep_index << 31) | (1 << 29) /* pkt-multiplier */ | (td->max_packet_size << 18) /* wMaxPacketSize */ | (count << 3) /* transfer count */ | - SOTG_PDT_DW0_VALID; - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW0, temp); + SOTG_PTD_DW0_VALID; + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW0, temp); - td->offset += count; - td->remainder -= count; td->toggle ^= 1; busy: return (1); /* busy */ @@ -569,19 +649,20 @@ saf1761_host_intr_data_rx(struct saf1761 uint32_t count; uint8_t got_short; - pdt_addr = SOTG_PDT(td->channel); + pdt_addr = SOTG_PTD(td->channel); - saf1761_read_host_memory_4(sc, pdt_addr + SOTG_PDT_DW3, &status, 1); + status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + DPRINTFN(5, "STATUS=0x%08x\n", status); - if (status & SOTG_PDT_DW3_ACTIVE) { + if (status & SOTG_PTD_DW3_ACTIVE) { goto busy; - } else if (status & SOTG_PDT_DW3_HALTED) { + } else if (status & SOTG_PTD_DW3_HALTED) { td->error_stall = 1; td->error_any = 1; goto complete; } - count = (status & SOTG_PDT_DW3_XFER_COUNT); + count = (status & SOTG_PTD_DW3_XFER_COUNT); got_short = 0; /* verify the packet byte count */ @@ -605,14 +686,7 @@ saf1761_host_intr_data_rx(struct saf1761 goto complete; } - saf1761_read_host_memory_4(sc, SOTG_DATA_ADDR(td->channel), - sc->sc_bounce_buffer, (count + 3) / 4); - - usbd_copy_in(td->pc, td->offset, - sc->sc_bounce_buffer, count); - - td->remainder -= count; - td->offset += count; + saf1761_read_host_memory(sc, td, count); saf1761_host_channel_free(sc, td); @@ -634,31 +708,31 @@ saf1761_host_intr_data_rx(struct saf1761 /* receive one more packet */ - pdt_addr = SOTG_PDT(td->channel); + pdt_addr = SOTG_PTD(td->channel); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW7, 0); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW6, 0); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW7, 0); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW6, 0); temp = (0xFC << td->uframe) & 0xFF; /* complete split */ - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW5, temp); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW5, temp); temp = (1U << td->uframe); /* start split */ - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW4, temp); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW4, temp); - temp = SOTG_PDT_DW3_ACTIVE | (td->toggle << 25) | SOTG_PDT_DW3_CERR; - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW3, temp); + temp = SOTG_PTD_DW3_ACTIVE | (td->toggle << 25) | SOTG_PTD_DW3_CERR; + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW3, temp); - temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8) | td->interval; - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW2, temp); + temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8) | (td->interval & 0xF8); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW2, temp); temp = td->dw1_value | (1 << 10) /* IN-PID */ | (td->ep_index >> 1); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW1, temp); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW1, temp); temp = (td->ep_index << 31) | (1 << 29) /* pkt-multiplier */ | (td->max_packet_size << 18) /* wMaxPacketSize */ | (td->max_packet_size << 3) /* transfer count */ | - SOTG_PDT_DW0_VALID; - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW0, temp); + SOTG_PTD_DW0_VALID; + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW0, temp); busy: return (1); /* busy */ complete: @@ -675,13 +749,14 @@ saf1761_host_intr_data_tx(struct saf1761 if (td->channel < SOTG_HOST_CHANNEL_MAX) { uint32_t status; - pdt_addr = SOTG_PDT(td->channel); + pdt_addr = SOTG_PTD(td->channel); - saf1761_read_host_memory_4(sc, pdt_addr + SOTG_PDT_DW3, &status, 1); + status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + DPRINTFN(5, "STATUS=0x%08x\n", status); - if (status & SOTG_PDT_DW3_ACTIVE) { + if (status & SOTG_PTD_DW3_ACTIVE) { goto busy; - } else if (status & SOTG_PDT_DW3_HALTED) { + } else if (status & SOTG_PTD_DW3_HALTED) { td->error_stall = 1; td->error_any = 1; } @@ -705,9 +780,7 @@ saf1761_host_intr_data_tx(struct saf1761 count = td->remainder; } - usbd_copy_out(td->pc, td->offset, sc->sc_bounce_buffer, count); - saf1761_write_host_memory_4(sc, SOTG_DATA_ADDR(td->channel), - sc->sc_bounce_buffer, (count + 3) / 4); + saf1761_write_host_memory(sc, td, count); /* set toggle, if any */ if (td->set_toggle) { @@ -717,34 +790,32 @@ saf1761_host_intr_data_tx(struct saf1761 /* send one more packet */ - pdt_addr = SOTG_PDT(td->channel); + pdt_addr = SOTG_PTD(td->channel); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW7, 0); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW6, 0); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW7, 0); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW6, 0); temp = (0xFC << td->uframe) & 0xFF; /* complete split */ - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW5, temp); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW5, temp); temp = (1U << td->uframe); /* start split */ - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW4, temp); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW4, temp); - temp = SOTG_PDT_DW3_ACTIVE | (td->toggle << 25) | SOTG_PDT_DW3_CERR; - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW3, temp); + temp = SOTG_PTD_DW3_ACTIVE | (td->toggle << 25) | SOTG_PTD_DW3_CERR; + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW3, temp); - temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8) | td->interval; - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW2, temp); + temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8) | (td->interval & 0xF8); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW2, temp); temp = td->dw1_value | (0 << 10) /* OUT-PID */ | (td->ep_index >> 1); - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW1, temp); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW1, temp); temp = (td->ep_index << 31) | (1 << 29) /* pkt-multiplier */ | (td->max_packet_size << 18) /* wMaxPacketSize */ | (count << 3) /* transfer count */ | - SOTG_PDT_DW0_VALID; - SAF1761_WRITE_4(sc, pdt_addr + SOTG_PDT_DW0, temp); + SOTG_PTD_DW0_VALID; + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW0, temp); - td->offset += count; - td->remainder -= count; td->toggle ^= 1; busy: return (1); /* busy */ @@ -769,43 +840,117 @@ saf1761_otg_set_address(struct saf1761_o { DPRINTFN(5, "addr=%d\n", addr); - SAF1761_WRITE_1(sc, SOTG_ADDRESS, addr | SOTG_ADDRESS_ENABLE); + SAF1761_WRITE_LE_4(sc, SOTG_ADDRESS, addr | SOTG_ADDRESS_ENABLE); } + static void -saf1761_read_device_fifo_1(struct saf1761_otg_softc *sc, void *buf, uint32_t len) +saf1761_read_device_fifo(struct saf1761_otg_softc *sc, + struct saf1761_otg_td *td, uint32_t len) { - if (len == 0) - return; - bus_space_read_multi_1((sc)->sc_io_tag, (sc)->sc_io_hdl, - SOTG_DATA_PORT, buf, len); + struct usb_page_search buf_res; + uint32_t count; + + /* optimised read first */ + while (len > 0) { + usbd_get_page(td->pc, td->offset, &buf_res); + + /* get correct length */ + if (buf_res.length > len) + buf_res.length = len; + + /* check buffer alignment */ + if (((uintptr_t)buf_res.buffer) & 3) + break; + + count = buf_res.length & ~3; + if (count == 0) + break; + + bus_space_read_multi_4((sc)->sc_io_tag, (sc)->sc_io_hdl, + SOTG_DATA_PORT, buf_res.buffer, count / 4); + + len -= count; + + /* update remainder and offset */ + td->remainder -= count; + td->offset += count; + } + + if (len > 0) { + /* use bounce buffer */ + bus_space_read_multi_4((sc)->sc_io_tag, (sc)->sc_io_hdl, + SOTG_DATA_PORT, sc->sc_bounce_buffer, (len + 3) / 4); + usbd_copy_in(td->pc, td->offset, + sc->sc_bounce_buffer, len); + + /* update remainder and offset */ + td->remainder -= len; + td->offset += len; + } } static void -saf1761_write_device_fifo_1(struct saf1761_otg_softc *sc, void *buf, uint32_t len) +saf1761_write_device_fifo(struct saf1761_otg_softc *sc, + struct saf1761_otg_td *td, uint32_t len) { - if (len == 0) - return; - bus_space_write_multi_1((sc)->sc_io_tag, (sc)->sc_io_hdl, - SOTG_DATA_PORT, buf, len); + struct usb_page_search buf_res; + uint32_t count; + + /* optimised write first */ + while (len > 0) { + usbd_get_page(td->pc, td->offset, &buf_res); + + /* get correct length */ + if (buf_res.length > len) + buf_res.length = len; + + /* check buffer alignment */ + if (((uintptr_t)buf_res.buffer) & 3) + break; + + count = buf_res.length & ~3; + if (count == 0) + break; + + bus_space_write_multi_4((sc)->sc_io_tag, (sc)->sc_io_hdl, + SOTG_DATA_PORT, buf_res.buffer, count / 4); + + len -= count; + + /* update remainder and offset */ + td->remainder -= count; + td->offset += count; + } + if (len > 0) { + /* use bounce buffer */ + usbd_copy_out(td->pc, td->offset, sc->sc_bounce_buffer, len); + bus_space_write_multi_4((sc)->sc_io_tag, (sc)->sc_io_hdl, + SOTG_DATA_PORT, sc->sc_bounce_buffer, (len + 3) / 4); + + /* update remainder and offset */ + td->remainder -= len; + td->offset += len; + } } static uint8_t saf1761_device_setup_rx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { struct usb_device_request req; - uint16_t count; + uint32_t count; /* select the correct endpoint */ - SAF1761_WRITE_1(sc, SOTG_EP_INDEX, SOTG_EP_INDEX_EP0SETUP); + SAF1761_WRITE_LE_4(sc, SOTG_EP_INDEX, SOTG_EP_INDEX_EP0SETUP); + + count = SAF1761_READ_LE_4(sc, SOTG_BUF_LENGTH); /* check buffer status */ - if ((SAF1761_READ_1(sc, SOTG_DCBUFFERSTATUS) & - SOTG_DCBUFFERSTATUS_FILLED_MASK) == 0) + if ((count & SOTG_BUF_LENGTH_FILLED_MASK) == 0) goto busy; - /* read buffer length */ - count = SAF1761_READ_2(sc, SOTG_BUF_LENGTH); + /* get buffer length */ + count &= SOTG_BUF_LENGTH_BUFLEN_MASK; DPRINTFN(5, "count=%u rem=%u\n", count, td->remainder); @@ -813,7 +958,7 @@ saf1761_device_setup_rx(struct saf1761_o td->did_stall = 0; /* clear stall */ - SAF1761_WRITE_1(sc, SOTG_CTRL_FUNC, 0); + SAF1761_WRITE_LE_4(sc, SOTG_CTRL_FUNC, 0); /* verify data length */ if (count != td->remainder) { @@ -827,15 +972,12 @@ saf1761_device_setup_rx(struct saf1761_o goto busy; } /* receive data */ - saf1761_read_device_fifo_1(sc, &req, sizeof(req)); - - /* copy data into real buffer */ - usbd_copy_in(td->pc, 0, &req, sizeof(req)); + saf1761_read_device_fifo(sc, td, sizeof(req)); - td->offset = sizeof(req); - td->remainder = 0; + /* extract SETUP packet again */ + usbd_copy_out(td->pc, 0, &req, sizeof(req)); - /* sneak peek the set address */ + /* sneak peek the set address request */ if ((req.bmRequestType == UT_WRITE_DEVICE) && (req.bRequest == UR_SET_ADDRESS)) { sc->sc_dv_addr = req.wValue[0] & 0x7F; @@ -851,7 +993,7 @@ busy: DPRINTFN(5, "stalling\n"); /* set stall */ - SAF1761_WRITE_1(sc, SOTG_CTRL_FUNC, SOTG_CTRL_FUNC_STALL); + SAF1761_WRITE_LE_4(sc, SOTG_CTRL_FUNC, SOTG_CTRL_FUNC_STALL); td->did_stall = 1; } @@ -861,17 +1003,17 @@ busy: static uint8_t saf1761_device_data_rx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { - struct usb_page_search buf_res; - uint16_t count; + uint32_t count; uint8_t got_short = 0; if (td->ep_index == 0) { /* select the correct endpoint */ - SAF1761_WRITE_1(sc, SOTG_EP_INDEX, SOTG_EP_INDEX_EP0SETUP); + SAF1761_WRITE_LE_4(sc, SOTG_EP_INDEX, SOTG_EP_INDEX_EP0SETUP); + + count = SAF1761_READ_LE_4(sc, SOTG_BUF_LENGTH); /* check buffer status */ - if ((SAF1761_READ_1(sc, SOTG_DCBUFFERSTATUS) & - SOTG_DCBUFFERSTATUS_FILLED_MASK) != 0) { + if ((count & SOTG_BUF_LENGTH_FILLED_MASK) != 0) { if (td->remainder == 0) { /* @@ -890,23 +1032,24 @@ saf1761_device_data_rx(struct saf1761_ot } } /* select the correct endpoint */ - SAF1761_WRITE_1(sc, SOTG_EP_INDEX, + SAF1761_WRITE_LE_4(sc, SOTG_EP_INDEX, (td->ep_index << SOTG_EP_INDEX_ENDP_INDEX_SHIFT) | SOTG_EP_INDEX_DIR_OUT); /* enable data stage */ if (td->set_toggle) { td->set_toggle = 0; - SAF1761_WRITE_1(sc, SOTG_CTRL_FUNC, SOTG_CTRL_FUNC_DSEN); + SAF1761_WRITE_LE_4(sc, SOTG_CTRL_FUNC, SOTG_CTRL_FUNC_DSEN); } + count = SAF1761_READ_LE_4(sc, SOTG_BUF_LENGTH); + /* check buffer status */ - if ((SAF1761_READ_1(sc, SOTG_DCBUFFERSTATUS) & - SOTG_DCBUFFERSTATUS_FILLED_MASK) == 0) { + if ((count & SOTG_BUF_LENGTH_FILLED_MASK) == 0) return (1); /* not complete */ - } - /* read buffer length */ - count = SAF1761_READ_2(sc, SOTG_BUF_LENGTH); + + /* get buffer length */ + count &= SOTG_BUF_LENGTH_BUFLEN_MASK; DPRINTFN(5, "rem=%u count=0x%04x\n", td->remainder, count); @@ -928,21 +1071,9 @@ saf1761_device_data_rx(struct saf1761_ot td->error_any = 1; return (0); /* we are complete */ } - while (count > 0) { - usbd_get_page(td->pc, td->offset, &buf_res); - - /* get correct length */ - if (buf_res.length > count) - buf_res.length = count; - - /* receive data */ - saf1761_read_device_fifo_1(sc, buf_res.buffer, buf_res.length); + /* receive data */ + saf1761_read_device_fifo(sc, td, count); - /* update counters */ - count -= buf_res.length; - td->offset += buf_res.length; - td->remainder -= buf_res.length; - } /* check if we are complete */ if ((td->remainder == 0) || got_short) { if (td->short_pkt) { @@ -957,17 +1088,16 @@ saf1761_device_data_rx(struct saf1761_ot static uint8_t saf1761_device_data_tx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { - struct usb_page_search buf_res; - uint16_t count; - uint16_t count_old; + uint32_t count; if (td->ep_index == 0) { /* select the correct endpoint */ - SAF1761_WRITE_1(sc, SOTG_EP_INDEX, SOTG_EP_INDEX_EP0SETUP); + SAF1761_WRITE_LE_4(sc, SOTG_EP_INDEX, SOTG_EP_INDEX_EP0SETUP); + + count = SAF1761_READ_LE_4(sc, SOTG_BUF_LENGTH); /* check buffer status */ - if ((SAF1761_READ_1(sc, SOTG_DCBUFFERSTATUS) & - SOTG_DCBUFFERSTATUS_FILLED_MASK) != 0) { + if ((count & SOTG_BUF_LENGTH_FILLED_MASK) != 0) { DPRINTFN(5, "SETUP abort\n"); /* * USB Host Aborted the transfer. @@ -977,20 +1107,20 @@ saf1761_device_data_tx(struct saf1761_ot } } /* select the correct endpoint */ - SAF1761_WRITE_1(sc, SOTG_EP_INDEX, + SAF1761_WRITE_LE_4(sc, SOTG_EP_INDEX, (td->ep_index << SOTG_EP_INDEX_ENDP_INDEX_SHIFT) | SOTG_EP_INDEX_DIR_IN); + count = SAF1761_READ_LE_4(sc, SOTG_BUF_LENGTH); + /* check buffer status */ - if ((SAF1761_READ_1(sc, SOTG_DCBUFFERSTATUS) & - SOTG_DCBUFFERSTATUS_FILLED_MASK) != 0) { + if ((count & SOTG_BUF_LENGTH_FILLED_MASK) != 0) return (1); /* not complete */ - } /* enable data stage */ if (td->set_toggle) { td->set_toggle = 0; - SAF1761_WRITE_1(sc, SOTG_CTRL_FUNC, SOTG_CTRL_FUNC_DSEN); + SAF1761_WRITE_LE_4(sc, SOTG_CTRL_FUNC, SOTG_CTRL_FUNC_DSEN); } DPRINTFN(5, "rem=%u\n", td->remainder); @@ -1001,34 +1131,18 @@ saf1761_device_data_tx(struct saf1761_ot td->short_pkt = 1; count = td->remainder; } - count_old = count; - - while (count > 0) { - - usbd_get_page(td->pc, td->offset, &buf_res); - - /* get correct length */ - if (buf_res.length > count) - buf_res.length = count; - - /* transmit data */ - saf1761_write_device_fifo_1(sc, buf_res.buffer, buf_res.length); - - /* update counters */ - count -= buf_res.length; - td->offset += buf_res.length; - td->remainder -= buf_res.length; - } + /* transmit data */ + saf1761_write_device_fifo(sc, td, count); if (td->ep_index == 0) { - if (count_old < SOTG_FS_MAX_PACKET_SIZE) { + if (count < SOTG_FS_MAX_PACKET_SIZE) { /* set end of packet */ - SAF1761_WRITE_1(sc, SOTG_CTRL_FUNC, SOTG_CTRL_FUNC_VENDP); + SAF1761_WRITE_LE_4(sc, SOTG_CTRL_FUNC, SOTG_CTRL_FUNC_VENDP); } } else { - if (count_old < SOTG_HS_MAX_PACKET_SIZE) { + if (count < SOTG_HS_MAX_PACKET_SIZE) { /* set end of packet */ - SAF1761_WRITE_1(sc, SOTG_CTRL_FUNC, SOTG_CTRL_FUNC_VENDP); + SAF1761_WRITE_LE_4(sc, SOTG_CTRL_FUNC, SOTG_CTRL_FUNC_VENDP); } } @@ -1045,25 +1159,29 @@ saf1761_device_data_tx(struct saf1761_ot static uint8_t saf1761_device_data_tx_sync(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { + uint32_t count; + if (td->ep_index == 0) { /* select the correct endpoint */ - SAF1761_WRITE_1(sc, SOTG_EP_INDEX, SOTG_EP_INDEX_EP0SETUP); + SAF1761_WRITE_LE_4(sc, SOTG_EP_INDEX, SOTG_EP_INDEX_EP0SETUP); + + count = SAF1761_READ_LE_4(sc, SOTG_BUF_LENGTH); /* check buffer status */ - if ((SAF1761_READ_1(sc, SOTG_DCBUFFERSTATUS) & - SOTG_DCBUFFERSTATUS_FILLED_MASK) != 0) { + if ((count & SOTG_BUF_LENGTH_FILLED_MASK) != 0) { DPRINTFN(5, "Faking complete\n"); return (0); /* complete */ } } /* select the correct endpoint */ - SAF1761_WRITE_1(sc, SOTG_EP_INDEX, + SAF1761_WRITE_LE_4(sc, SOTG_EP_INDEX, (td->ep_index << SOTG_EP_INDEX_ENDP_INDEX_SHIFT) | SOTG_EP_INDEX_DIR_IN); + count = SAF1761_READ_LE_4(sc, SOTG_BUF_LENGTH); + /* check buffer status */ - if ((SAF1761_READ_1(sc, SOTG_DCBUFFERSTATUS) & - SOTG_DCBUFFERSTATUS_FILLED_MASK) != 0) + if ((count & SOTG_BUF_LENGTH_FILLED_MASK) != 0) return (1); /* busy */ if (sc->sc_dv_addr != 0xFF) { @@ -1143,7 +1261,7 @@ saf1761_otg_wait_suspend(struct saf1761_ sc->sc_intr_enable &= ~SOTG_DCINTERRUPT_IESUSP; sc->sc_intr_enable |= SOTG_DCINTERRUPT_IERESM; } - SAF1761_WRITE_4(sc, SOTG_DCINTERRUPT_EN, sc->sc_intr_enable); + SAF1761_WRITE_LE_4(sc, SOTG_DCINTERRUPT_EN, sc->sc_intr_enable); } static void @@ -1152,7 +1270,7 @@ saf1761_otg_update_vbus(struct saf1761_o uint16_t status; /* read fresh status */ - status = SAF1761_READ_2(sc, SOTG_STATUS); + status = SAF1761_READ_LE_4(sc, SOTG_STATUS); DPRINTFN(4, "STATUS=0x%04x\n", status); @@ -1188,16 +1306,18 @@ saf1761_otg_interrupt(struct saf1761_otg USB_BUS_LOCK(&sc->sc_bus); - hcstat = SAF1761_READ_4(sc, SOTG_HCINTERRUPT); + hcstat = SAF1761_READ_LE_4(sc, SOTG_HCINTERRUPT); /* acknowledge all host controller interrupts */ - SAF1761_WRITE_4(sc, SOTG_HCINTERRUPT, hcstat); + SAF1761_WRITE_LE_4(sc, SOTG_HCINTERRUPT, hcstat); - status = SAF1761_READ_4(sc, SOTG_DCINTERRUPT); + status = SAF1761_READ_LE_4(sc, SOTG_DCINTERRUPT); /* acknowledge all device controller interrupts */ - SAF1761_WRITE_4(sc, SOTG_DCINTERRUPT, status); + SAF1761_WRITE_LE_4(sc, SOTG_DCINTERRUPT, status); - DPRINTF("DCINTERRUPT=0x%08x HCINTERRUPT=0x%08x SOF=0x%04x\n", - status, hcstat, SAF1761_READ_2(sc, SOTG_FRAME_NUM)); + DPRINTF("DCINTERRUPT=0x%08x HCINTERRUPT=0x%08x SOF=0x%08x " + "FRINDEX=0x%08x\n", status, hcstat, + SAF1761_READ_LE_4(sc, SOTG_FRAME_NUM), + SAF1761_READ_LE_4(sc, SOTG_FRINDEX)); /* update VBUS and ID bits, if any */ if (status & SOTG_DCINTERRUPT_IEVBUS) { @@ -1206,11 +1326,11 @@ saf1761_otg_interrupt(struct saf1761_otg if (status & SOTG_DCINTERRUPT_IEBRST) { /* unlock device */ - SAF1761_WRITE_2(sc, SOTG_UNLOCK_DEVICE, + SAF1761_WRITE_LE_4(sc, SOTG_UNLOCK_DEVICE, SOTG_UNLOCK_DEVICE_CODE); /* Enable device address */ - SAF1761_WRITE_1(sc, SOTG_ADDRESS, + SAF1761_WRITE_LE_4(sc, SOTG_ADDRESS, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue May 27 10:12:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B642E7F; Tue, 27 May 2014 10:12:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C6552771; Tue, 27 May 2014 10:12:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RACG6D022255; Tue, 27 May 2014 10:12:16 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RACGcG022252; Tue, 27 May 2014 10:12:16 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405271012.s4RACGcG022252@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 27 May 2014 10:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266742 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 10:12:17 -0000 Author: hselasky Date: Tue May 27 10:12:16 2014 New Revision: 266742 URL: http://svnweb.freebsd.org/changeset/base/266742 Log: - Correct bus space resource type for register access. - Add configuration of interrupt type and polarity via FDT. Sponsored by: DARPA, AFRL Modified: head/sys/dev/usb/controller/saf1761_otg.c head/sys/dev/usb/controller/saf1761_otg.h head/sys/dev/usb/controller/saf1761_otg_fdt.c Modified: head/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.c Tue May 27 10:01:19 2014 (r266741) +++ head/sys/dev/usb/controller/saf1761_otg.c Tue May 27 10:12:16 2014 (r266742) @@ -2052,7 +2052,8 @@ saf1761_otg_init(struct saf1761_otg_soft SAF1761_WRITE_LE_4(sc, SOTG_INTERRUPT_CFG, SOTG_INTERRUPT_CFG_CDBGMOD | SOTG_INTERRUPT_CFG_DDBGMODIN | - SOTG_INTERRUPT_CFG_DDBGMODOUT); + SOTG_INTERRUPT_CFG_DDBGMODOUT | + sc->sc_interrupt_cfg); /* enable VBUS and ID interrupt */ SAF1761_WRITE_LE_4(sc, SOTG_IRQ_ENABLE_SET_CLR, Modified: head/sys/dev/usb/controller/saf1761_otg.h ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.h Tue May 27 10:01:19 2014 (r266741) +++ head/sys/dev/usb/controller/saf1761_otg.h Tue May 27 10:12:16 2014 (r266742) @@ -144,6 +144,7 @@ struct saf1761_otg_softc { uint32_t sc_host_isoc_map; uint32_t sc_intr_enable; /* enabled interrupts */ uint32_t sc_hw_mode; /* hardware mode */ + uint32_t sc_interrupt_cfg; /* interrupt configuration */ uint32_t sc_bounce_buffer[1024 / 4]; Modified: head/sys/dev/usb/controller/saf1761_otg_fdt.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg_fdt.c Tue May 27 10:01:19 2014 (r266741) +++ head/sys/dev/usb/controller/saf1761_otg_fdt.c Tue May 27 10:12:16 2014 (r266742) @@ -156,6 +156,18 @@ saf1761_otg_fdt_attach(device_t dev) sc->sc_hw_mode |= SOTG_HW_MODE_CTRL_DREQ_POL; } + /* get IRQ polarity */ + if (OF_getprop(ofw_bus_get_node(dev), "int-polarity", + ¶m, sizeof(param)) > 0) { + sc->sc_interrupt_cfg |= SOTG_INTERRUPT_CFG_INTPOL; + } + + /* get IRQ level triggering */ + if (OF_getprop(ofw_bus_get_node(dev), "int-level", + ¶m, sizeof(param)) > 0) { + sc->sc_interrupt_cfg |= SOTG_INTERRUPT_CFG_INTLVL; + } + /* initialise some bus fields */ sc->sc_bus.parent = dev; sc->sc_bus.devices = sc->sc_devices; @@ -168,7 +180,7 @@ saf1761_otg_fdt_attach(device_t dev) } rid = 0; sc->sc_io_res = - bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); + bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (!sc->sc_io_res) { goto error; @@ -243,7 +255,7 @@ saf1761_otg_fdt_detach(device_t dev) sc->sc_irq_res = NULL; } if (sc->sc_io_res) { - bus_release_resource(dev, SYS_RES_IOPORT, 0, + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_io_res); sc->sc_io_res = NULL; } From owner-svn-src-head@FreeBSD.ORG Tue May 27 10:21:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C07DC2DC; Tue, 27 May 2014 10:21:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADF7A2836; Tue, 27 May 2014 10:21:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RALnEj026791; Tue, 27 May 2014 10:21:49 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RALnrK026790; Tue, 27 May 2014 10:21:49 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201405271021.s4RALnrK026790@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 27 May 2014 10:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266743 - head/sys/modules/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 10:21:49 -0000 Author: ae Date: Tue May 27 10:21:49 2014 New Revision: 266743 URL: http://svnweb.freebsd.org/changeset/base/266743 Log: Disconnect the following geom classes from the kernel modules build: BSD, FOX, MBR, PC98, SUNLABEL and VOL_FFS. They all have a modern replacement. Also it is still possible build them manually. Discussed with: geom Modified: head/sys/modules/geom/Makefile Modified: head/sys/modules/geom/Makefile ============================================================================== --- head/sys/modules/geom/Makefile Tue May 27 10:12:16 2014 (r266742) +++ head/sys/modules/geom/Makefile Tue May 27 10:21:49 2014 (r266743) @@ -1,34 +1,28 @@ # $FreeBSD$ SUBDIR= geom_bde \ - geom_bsd \ geom_cache \ geom_ccd \ geom_concat \ geom_eli \ - geom_fox \ geom_gate \ geom_journal \ geom_label \ geom_linux_lvm \ - geom_mbr \ geom_mirror \ geom_mountver \ geom_multipath \ geom_nop \ geom_part \ - geom_pc98 \ geom_raid \ geom_raid3 \ geom_sched \ geom_shsec \ geom_stripe \ - geom_sunlabel \ geom_uncompress \ geom_uzip \ geom_vinum \ geom_virstor \ - geom_vol_ffs \ geom_zero .include From owner-svn-src-head@FreeBSD.ORG Tue May 27 13:17:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63231B51 for ; Tue, 27 May 2014 13:17:54 +0000 (UTC) Received: from mail-ie0-f175.google.com (mail-ie0-f175.google.com [209.85.223.175]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00B802866 for ; Tue, 27 May 2014 13:17:53 +0000 (UTC) Received: by mail-ie0-f175.google.com with SMTP id y20so8465494ier.6 for ; Tue, 27 May 2014 06:17:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=MuDkQSo/KETbLTv0L41dYTDIfrCz/q7vwnruNVXctzg=; b=bFmU6vxl6O/d6ND8bbP98wKsPqq5hto2Zmy9ktRcL37uT0oFCirNkAQ5xvMZPEc+Ok 8eicAcxcBHEGPuVzfxkVsdCSEVtZ9fYKtnuH+OGfd016I7rDkiZ0UBAM9KUwb5iL4j3K 1lGVrlGV7C05XwzpCvmusIA9S1OzLeaDswN1TlI8iuDX8wmpXjaihWiJdZ/shnRd0Ixo py9R0BcOVTvY0sVeKhlb3U/oiSOresLzvtsr42W8l5MQMub79fBJPkD2/tlPZftVEaH1 1MyNXgDjHfSC1q5hvRMy2R9GjF8PCHLXVWo+mZNeMKiQ+5MkOhgt6BAXTJxSLILn78PJ mD4Q== X-Gm-Message-State: ALoCoQkCv8WOn0PsGiMWrGMcVzeKtHuWHYS9kHTBDIXZfluTxELu738M/wKo9oTSMEcAl5CNCgdV X-Received: by 10.50.153.11 with SMTP id vc11mr32788546igb.24.1401196672483; Tue, 27 May 2014 06:17:52 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id ri2sm7695518igc.1.2014.05.27.06.17.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 May 2014 06:17:51 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_97317F85-FC5E-4184-AFD6-7818C9A6F3CC"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266553 - head/release/scripts From: Warner Losh In-Reply-To: <20140527093633.0a922e13@kalimero.tijl.coosemans.org> Date: Tue, 27 May 2014 07:18:06 -0600 Message-Id: <85FABD2B-81BB-4E1A-B61E-4216A144A9DB@bsdimp.com> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> <5380EBA8.1030200@freebsd.org> <20140525011307.142b41ab@kalimero.tijl.coosemans.org> <3CCAFAD3-FABE-40EF-ABF9-815FE5826349@bsdimp.com> <9FE34CE4-C71F-4806-9EF6-30CB1051C62F@bsdimp.com> <20140526113502.239db74d@kalimero.tijl.coosemans.org> <5383522F.30108@freebsd.org> <20140527001811.3e9d3e8d@kalimero.tijl.coosemans.org> <05D1A11D-5985-42EA-84AD-209A8B51D391@bsdimp.com> <20140527093633.0a922e13@kalimero.tijl.coosemans.org> To: Tijl Coosemans X-Mailer: Apple Mail (2.1878.2) Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , Nathan Whitehorn , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 13:17:54 -0000 --Apple-Mail=_97317F85-FC5E-4184-AFD6-7818C9A6F3CC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1253 On May 27, 2014, at 1:36 AM, Tijl Coosemans wrote: > On Mon, 26 May 2014 16:31:21 -0600 Warner Losh wrote: >> On May 26, 2014, at 4:18 PM, Tijl Coosemans wrote:=20= >>> On Mon, 26 May 2014 09:53:57 -0600 Warner Losh wrote: >>>> On May 26, 2014, at 8:39 AM, Nathan Whitehorn = wrote: >>>>> On 05/26/14 02:35, Tijl Coosemans wrote: >>>>>> I suppose you could replace the "x86" in the pkg scheme with = i386/amd64, >>>>>> but then you'd still be talking about i386:32, amd64:32 and = amd64:64 >>>>>> instead of x86:32, x86:x32 and x86:64. =20 >>>>=20 >>>> I suppose you could replace these by =93i386=94, =93x32=94 (or = =93amd64x32=94) and >>>> =93amd64=94 respectively. >>>=20 >>> So you're on an amd64 or mips64 system (as indicated by uname) but = you >>> want to use the 32-bit package if possible. How does your script = know >>> about the magic "x32", "amd64x32" or "mipsn32" strings? Wouldn't it = be >>> easier if you could just use "`uname -p`:32=94? >>=20 >> Oh give me a break. You know it because you know you are building for >> mipsn32 because that=92s what you=92ve set MACHINE_ARCH or = TARGET_ARCH to, >=20 > No, MACHINE_ARCH or TARGET_ARCH is "amd64" or "mips64". You are = building > the 64-bit OS and then decide separately per package whether you want = the > ILP32 one or the LP64 one. I think I understand why we=92re talking past each other. This bit is = wrong. The LP64 one has a MACHINE_ARCH of =93amd64=94 or =93mips64=94. = The ILP32 one will have MACHINE_ARCH of =93i386=94 or =93mips=94. The = weird ones (ILP32 with 64-bit registers) will have a different = MACHINE_ARCH of =93x32=94 or =93mipsn32=94. Selection can be done on a = case by case basis, but this will be validated against the = supported_abis sysctl. There=92s no need to have different names here, = the current standard ones do just fine, are completely sufficient and = all inclusive. This is rather by definition, and your understanding of = the definition sounds flawed. While we have limited support for building 32-bit binaries, it is to = build 32-bit binaries for a different MACHINE_ARCH. -m32 on amd64 = creates i386 binaries, not amd64:32 binaries. -m32 on powerpc64 creates = powerpc binaries, not powerpc64:32 binaries. On mips, -mabi-n32 (I think = the option is) is required to create the mipsn32 binaries. In every = single one of these cases, there exists a MACHINE_ARCH that completely = describes the binary. So I=92m still waiting for a use case that requires the new names. One = has not been articulated, and I don=92t think one actually exists. Warner --Apple-Mail=_97317F85-FC5E-4184-AFD6-7818C9A6F3CC Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJThJCOAAoJEGwc0Sh9sBEA00YP+gPTsPiS2QcuZukJLG6wKhLz NPOIA2zgXl8dS9iYq/bf9uRxiYW6p2C68gmzTjxn0K3bYm/oFTTA8ZaLoaNQ4iqu /7Qk6aMkGcTiUpSPZE+Bnc8LMO6lvHQWdBJ7gBuGKMRaSTR4jN+7O5MnvLtkBthP D98Y19r44BNsvVxVwPPOzz3Vf2i8ivsn78PHngE1xfvHcCQKShnVr+uFPHmFSePX 4HHs5kaV/MWS7791Lisnr3KW5EjQmS+3DkDi8Rhtj8Jm+quak1OVwxzd8bIj6HDs /c94j/B2F0X7kch3SVIaJBPjrMLbdufkwjw/JR7PcboszgMpfYa4isDFH9DG18Xf E40O00voBQzouo2kV10STJV4UTx+3Qxm6hLt5A6aqDSL08NzXsMnxjE5lSNt8jNW 3uheHp1JLqoHt6/IcAxvc7SiVMgNn1Xu2w507cLlkvE4eM9Xspy0dueJ/Bm7xuup M9GUZOcGpLQTnEeyHUBwJyov5tLrZyzkKWaJdGloi1pV+zWGDlHaoeu7yUMwNaWd Wwb+e3S0/4oNyFDEdQSgXZdVgJiNcHDgQWzY1aeVt887rfTQ1tNe2R4CC+4mZClf bID4wFz0pfGBUUSD4j+li9fMhvES5IUj8aRVpmiDvqQkrxBWPLxakFI7MI+kj0EQ yuAwurHmTDbTq+w9Nnee =0KJ6 -----END PGP SIGNATURE----- --Apple-Mail=_97317F85-FC5E-4184-AFD6-7818C9A6F3CC-- From owner-svn-src-head@FreeBSD.ORG Tue May 27 13:35:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FDA24D9; Tue, 27 May 2014 13:35:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CFCD2A59; Tue, 27 May 2014 13:35:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RDZVQb014765; Tue, 27 May 2014 13:35:31 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RDZVKj014764; Tue, 27 May 2014 13:35:31 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201405271335.s4RDZVKj014764@svn.freebsd.org> From: Sean Bruno Date: Tue, 27 May 2014 13:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266744 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 13:35:32 -0000 Author: sbruno Date: Tue May 27 13:35:31 2014 New Revision: 266744 URL: http://svnweb.freebsd.org/changeset/base/266744 Log: Add PCI ID for AMT based serial interface found on the Lenovo T61. uart2: port 0x1830-0x1837 mem 0xfe024000-0xfe024fff irq 17 at device 3.3 on pci0 uart2: console (115200,n,8,1) Tested as tty and serial console. Seems "fine" Modified: head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Tue May 27 10:21:49 2014 (r266743) +++ head/sys/dev/uart/uart_bus_pci.c Tue May 27 13:35:31 2014 (r266744) @@ -118,6 +118,7 @@ static const struct pci_id pci_ns8250_id 8 * DEFAULT_RCLK }, { 0x8086, 0x1c3d, 0xffff, 0, "Intel AMT - KT Controller", 0x10 }, { 0x8086, 0x1d3d, 0xffff, 0, "Intel C600/X79 Series Chipset KT Controller", 0x10 }, +{ 0x8086, 0x2a07, 0xffff, 0, "Intel AMT - PM965/GM965 KT Controller", 0x10 }, { 0x8086, 0x2e17, 0xffff, 0, "4 Series Chipset Serial KT Controller", 0x10 }, { 0x8086, 0x3b67, 0xffff, 0, "5 Series/3400 Series Chipset KT Controller", 0x10 }, From owner-svn-src-head@FreeBSD.ORG Tue May 27 13:51:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4FF31C81; Tue, 27 May 2014 13:51:01 +0000 (UTC) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 262662C3F; Tue, 27 May 2014 13:51:01 +0000 (UTC) Received: by mail.lifanov.com (Postfix, from userid 58) id 551761B0ADE; Tue, 27 May 2014 09:50:54 -0400 (EDT) Received: from [10.1.3.5] (cnet520-windstream.mcclatchyinteractive.com [166.108.16.2]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.lifanov.com (Postfix) with ESMTPSA id 9E70A1B0A74; Tue, 27 May 2014 09:50:52 -0400 (EDT) Message-ID: <5384983B.3000508@mail.lifanov.com> Date: Tue, 27 May 2014 09:50:51 -0400 From: Nikolai Lifanov User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r266743 - head/sys/modules/geom References: <201405271021.s4RALnrK026790@svn.freebsd.org> In-Reply-To: <201405271021.s4RALnrK026790@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 13:51:01 -0000 On 05/27/14 06:21, Andrey V. Elsukov wrote: > Author: ae > Date: Tue May 27 10:21:49 2014 > New Revision: 266743 > URL: http://svnweb.freebsd.org/changeset/base/266743 > > Log: > Disconnect the following geom classes from the kernel modules build: > BSD, FOX, MBR, PC98, SUNLABEL and VOL_FFS. They all have a modern > replacement. Also it is still possible build them manually. > > Discussed with: geom > > Modified: > head/sys/modules/geom/Makefile > What about buggy UEFI firmware? I am writing this from a laptop running FreeBSD that will absolutely not boot in CSM mode from a GPT-partitioned disk. There is plenty of buggy hardware like this "out there". Could you reconnect MBR and BSD partitioning schemes until UEFI loader is connected to release builds (.iso media) please? - Nikolai Lifanov From owner-svn-src-head@FreeBSD.ORG Tue May 27 13:56:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFF7DE64; Tue, 27 May 2014 13:56:51 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 08C62601C; Tue, 27 May 2014 13:56:50 +0000 (UTC) Message-ID: <5384998A.30408@FreeBSD.org> Date: Tue, 27 May 2014 17:56:26 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Nikolai Lifanov , src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r266743 - head/sys/modules/geom References: <201405271021.s4RALnrK026790@svn.freebsd.org> <5384983B.3000508@mail.lifanov.com> In-Reply-To: <5384983B.3000508@mail.lifanov.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 13:56:52 -0000 On 27.05.2014 17:50, Nikolai Lifanov wrote: >> Disconnect the following geom classes from the kernel modules build: >> BSD, FOX, MBR, PC98, SUNLABEL and VOL_FFS. They all have a modern >> replacement. Also it is still possible build them manually. >> >> Discussed with: geom >> >> Modified: >> head/sys/modules/geom/Makefile >> > > What about buggy UEFI firmware? I am writing this from a laptop running > FreeBSD that will absolutely not boot in CSM mode from a GPT-partitioned > disk. There is plenty of buggy hardware like this "out there". Could you > reconnect MBR and BSD partitioning schemes until UEFI loader is > connected to release builds (.iso media) please? MBR and BSD partitioning schemes are supported by GEOM_PART class, why do you need these modules? Do you have problems with geom_part_mbr and geom_part_bsd? -- WBR, Andrey V. Elsukov From owner-svn-src-head@FreeBSD.ORG Tue May 27 14:06:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59D111A8; Tue, 27 May 2014 14:06:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4711F2D60; Tue, 27 May 2014 14:06:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RE6O8c028714; Tue, 27 May 2014 14:06:24 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RE6OBw028713; Tue, 27 May 2014 14:06:24 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201405271406.s4RE6OBw028713@svn.freebsd.org> From: Scott Long Date: Tue, 27 May 2014 14:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266745 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 14:06:24 -0000 Author: scottl Date: Tue May 27 14:06:23 2014 New Revision: 266745 URL: http://svnweb.freebsd.org/changeset/base/266745 Log: Revert r266481. It was based on faulty analysis of the problem. A correct fix is forthcoming. Obtained from: Netflix, Inc. Modified: head/sys/x86/x86/busdma_bounce.c Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Tue May 27 13:35:31 2014 (r266744) +++ head/sys/x86/x86/busdma_bounce.c Tue May 27 14:06:23 2014 (r266745) @@ -172,35 +172,12 @@ bounce_bus_dma_tag_create(bus_dma_tag_t newtag->map_count = 0; newtag->segments = NULL; - /* - * Bouncing might be needed if there's a filter. - * XXX Filters are likely broken as there's no way to - * guarantee that bounce pages will also satisfy the - * filter requirement. - */ if (parent != NULL && ((newtag->common.filter != NULL) || ((parent->common.flags & BUS_DMA_COULD_BOUNCE) != 0))) newtag->common.flags |= BUS_DMA_COULD_BOUNCE; - /* - * Bouncing might be needed if there's an upper memory - * restriction. - */ - if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem)) - newtag->common.flags |= BUS_DMA_COULD_BOUNCE; - - /* - * Bouncing might be needed if there's an alignment - * restriction that can't be satisfied by breaking up - * the segment. - * XXX Need to consider non-natural alignment. - * XXX Static allocations that tie to bus_dmamem_alloc() - * will likely pass this test and be penalized with - * the COULD_BOUNCE flag. Should probably have - * bus_dmamem_alloc() clear this flag. - */ - if ((newtag->common.nsegments <= 1) && - (newtag->common.alignment > 1)) + if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem) || + newtag->common.alignment > 1) newtag->common.flags |= BUS_DMA_COULD_BOUNCE; if (((newtag->common.flags & BUS_DMA_COULD_BOUNCE) != 0) && From owner-svn-src-head@FreeBSD.ORG Tue May 27 14:18:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D862A8CF; Tue, 27 May 2014 14:18:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8FEF2E8F; Tue, 27 May 2014 14:18:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4REIvJ9034172; Tue, 27 May 2014 14:18:57 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4REIvxu034171; Tue, 27 May 2014 14:18:57 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201405271418.s4REIvxu034171@svn.freebsd.org> From: Scott Long Date: Tue, 27 May 2014 14:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266746 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 14:18:57 -0000 Author: scottl Date: Tue May 27 14:18:57 2014 New Revision: 266746 URL: http://svnweb.freebsd.org/changeset/base/266746 Log: Now that there are separate back-end implementations of busdma, the bounce implementation shouldn't steal flags from the common front-end. Move those flags to the back-end. Obtained from: Netflix, Inc. MFC after: 3 days Modified: head/sys/x86/x86/busdma_bounce.c Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Tue May 27 14:06:23 2014 (r266745) +++ head/sys/x86/x86/busdma_bounce.c Tue May 27 14:18:57 2014 (r266746) @@ -58,16 +58,20 @@ __FBSDID("$FreeBSD$"); #else #define MAX_BPAGES 8192 #endif -#define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 -#define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 + +enum { + BUS_DMA_COULD_BOUNCE = 0x01, + BUS_DMA_MIN_ALLOC_COMP = 0x02, +}; struct bounce_zone; struct bus_dma_tag { struct bus_dma_tag_common common; - int map_count; - bus_dma_segment_t *segments; - struct bounce_zone *bounce_zone; + int map_count; + int bounce_flags; + bus_dma_segment_t *segments; + struct bounce_zone *bounce_zone; }; struct bounce_page { @@ -173,14 +177,14 @@ bounce_bus_dma_tag_create(bus_dma_tag_t newtag->segments = NULL; if (parent != NULL && ((newtag->common.filter != NULL) || - ((parent->common.flags & BUS_DMA_COULD_BOUNCE) != 0))) - newtag->common.flags |= BUS_DMA_COULD_BOUNCE; + ((parent->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0))) + newtag->bounce_flags |= BUS_DMA_COULD_BOUNCE; if (newtag->common.lowaddr < ptoa((vm_paddr_t)Maxmem) || newtag->common.alignment > 1) - newtag->common.flags |= BUS_DMA_COULD_BOUNCE; + newtag->bounce_flags |= BUS_DMA_COULD_BOUNCE; - if (((newtag->common.flags & BUS_DMA_COULD_BOUNCE) != 0) && + if (((newtag->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && (flags & BUS_DMA_ALLOCNOW) != 0) { struct bounce_zone *bz; @@ -201,7 +205,7 @@ bounce_bus_dma_tag_create(bus_dma_tag_t error = ENOMEM; } /* Performed initial allocation */ - newtag->common.flags |= BUS_DMA_MIN_ALLOC_COMP; + newtag->bounce_flags |= BUS_DMA_MIN_ALLOC_COMP; } else error = 0; @@ -279,7 +283,7 @@ bounce_bus_dmamap_create(bus_dma_tag_t d * exclusion region, a data alignment that is stricter than 1, and/or * an active address boundary. */ - if (dmat->common.flags & BUS_DMA_COULD_BOUNCE) { + if (dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) { /* Must bounce */ if (dmat->bounce_zone == NULL) { if ((error = alloc_bounce_zone(dmat)) != 0) @@ -307,17 +311,17 @@ bounce_bus_dmamap_create(bus_dma_tag_t d else maxpages = MIN(MAX_BPAGES, Maxmem - atop(dmat->common.lowaddr)); - if ((dmat->common.flags & BUS_DMA_MIN_ALLOC_COMP) == 0 || + if ((dmat->bounce_flags & BUS_DMA_MIN_ALLOC_COMP) == 0 || (bz->map_count > 0 && bz->total_bpages < maxpages)) { pages = MAX(atop(dmat->common.maxsize), 1); pages = MIN(maxpages - bz->total_bpages, pages); pages = MAX(pages, 1); if (alloc_bounce_pages(dmat, pages) < pages) error = ENOMEM; - if ((dmat->common.flags & BUS_DMA_MIN_ALLOC_COMP) + if ((dmat->bounce_flags & BUS_DMA_MIN_ALLOC_COMP) == 0) { if (error == 0) { - dmat->common.flags |= + dmat->bounce_flags |= BUS_DMA_MIN_ALLOC_COMP; } } else @@ -614,7 +618,7 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_ if (segs == NULL) segs = dmat->segments; - if ((dmat->common.flags & BUS_DMA_COULD_BOUNCE) != 0) { + if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) { _bus_dmamap_count_phys(dmat, map, buf, buflen, flags); if (map->pagesneeded != 0) { error = _bus_dmamap_reserve_pages(dmat, map, flags); @@ -626,7 +630,7 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_ while (buflen > 0) { curaddr = buf; sgsize = MIN(buflen, dmat->common.maxsegsz); - if (((dmat->common.flags & BUS_DMA_COULD_BOUNCE) != 0) && + if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && map->pagesneeded != 0 && bus_dma_run_filter(&dmat->common, curaddr)) { sgsize = MIN(sgsize, PAGE_SIZE); @@ -667,7 +671,7 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta if (segs == NULL) segs = dmat->segments; - if ((dmat->common.flags & BUS_DMA_COULD_BOUNCE) != 0) { + if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) { _bus_dmamap_count_pages(dmat, map, pmap, buf, buflen, flags); if (map->pagesneeded != 0) { error = _bus_dmamap_reserve_pages(dmat, map, flags); @@ -691,7 +695,7 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta */ max_sgsize = MIN(buflen, dmat->common.maxsegsz); sgsize = PAGE_SIZE - ((vm_offset_t)curaddr & PAGE_MASK); - if (((dmat->common.flags & BUS_DMA_COULD_BOUNCE) != 0) && + if (((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) != 0) && map->pagesneeded != 0 && bus_dma_run_filter(&dmat->common, curaddr)) { sgsize = roundup2(sgsize, dmat->common.alignment); From owner-svn-src-head@FreeBSD.ORG Tue May 27 15:52:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D508FE0; Tue, 27 May 2014 15:52:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8826283C; Tue, 27 May 2014 15:52:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RFqSC4080052; Tue, 27 May 2014 15:52:28 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RFqRYQ080048; Tue, 27 May 2014 15:52:27 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405271552.s4RFqRYQ080048@svn.freebsd.org> From: Glen Barber Date: Tue, 27 May 2014 15:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266752 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 15:52:28 -0000 Author: gjb Date: Tue May 27 15:52:27 2014 New Revision: 266752 URL: http://svnweb.freebsd.org/changeset/base/266752 Log: Remove empty lines that cause mdoc warnings. Sponsored by: The FreeBSD Foundation Modified: head/tools/build/options/WITHOUT_DOCCOMPRESS head/tools/build/options/WITHOUT_GNU_GREP_COMPAT head/tools/build/options/WITHOUT_MANCOMPRESS head/tools/build/options/WITH_FMAKE Modified: head/tools/build/options/WITHOUT_DOCCOMPRESS ============================================================================== --- head/tools/build/options/WITHOUT_DOCCOMPRESS Tue May 27 15:30:24 2014 (r266751) +++ head/tools/build/options/WITHOUT_DOCCOMPRESS Tue May 27 15:52:27 2014 (r266752) @@ -1,4 +1,3 @@ .\" $FreeBSD$ Set to not to install compressed system documentation. Only the uncompressed version will be installed. - Modified: head/tools/build/options/WITHOUT_GNU_GREP_COMPAT ============================================================================== --- head/tools/build/options/WITHOUT_GNU_GREP_COMPAT Tue May 27 15:30:24 2014 (r266751) +++ head/tools/build/options/WITHOUT_GNU_GREP_COMPAT Tue May 27 15:52:27 2014 (r266752) @@ -1,4 +1,3 @@ .\" $FreeBSD$ Set this option to omit the gnu extentions to grep from being included in BSD grep. - Modified: head/tools/build/options/WITHOUT_MANCOMPRESS ============================================================================== --- head/tools/build/options/WITHOUT_MANCOMPRESS Tue May 27 15:30:24 2014 (r266751) +++ head/tools/build/options/WITHOUT_MANCOMPRESS Tue May 27 15:52:27 2014 (r266752) @@ -1,5 +1,3 @@ .\" $FreeBSD$ Set to not to install compressed man pages. Only the uncompressed versions will be installed. - - Modified: head/tools/build/options/WITH_FMAKE ============================================================================== --- head/tools/build/options/WITH_FMAKE Tue May 27 15:30:24 2014 (r266751) +++ head/tools/build/options/WITH_FMAKE Tue May 27 15:52:27 2014 (r266752) @@ -2,4 +2,3 @@ Causes the old FreeBSD .Xr make 1 program to be built and installed as fmake. - From owner-svn-src-head@FreeBSD.ORG Tue May 27 15:55:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BAA3269; Tue, 27 May 2014 15:55:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28CAF286F; Tue, 27 May 2014 15:55:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RFtR8Z080528; Tue, 27 May 2014 15:55:27 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RFtR6T080527; Tue, 27 May 2014 15:55:27 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405271555.s4RFtR6T080527@svn.freebsd.org> From: Glen Barber Date: Tue, 27 May 2014 15:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266753 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 15:55:27 -0000 Author: gjb Date: Tue May 27 15:55:26 2014 New Revision: 266753 URL: http://svnweb.freebsd.org/changeset/base/266753 Log: Regen after r266752. Sponsored by: The FreeBSD Foundation Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue May 27 15:52:27 2014 (r266752) +++ head/share/man/man5/src.conf.5 Tue May 27 15:55:26 2014 (r266753) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd May 15, 2014 +.Dd May 27, 2014 .Dt SRC.CONF 5 .Os .Sh NAME @@ -125,7 +125,7 @@ Set to not build audit support into syst Set to not build .Xr authpf 8 . .It Va WITHOUT_BINUTILS -.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 264660 2014-04-18 17:03:58Z imp +.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 266158 2014-05-15 16:51:45Z brooks Set to not build or install binutils (as, c++-filt, gconv, ld, nm, objcopy, objdump, readelf, size and strip) as part of the normal system build. @@ -363,10 +363,9 @@ Set to not build the Webster dictionary .\" from FreeBSD: head/tools/build/options/WITHOUT_DMAGENT 262335 2014-02-22 13:05:23Z bapt Set to not build dma Mail Transport Agent .It Va WITHOUT_DOCCOMPRESS -.\" from FreeBSD: head/tools/build/options/WITHOUT_DOCCOMPRESS 265838 2014-05-10 16:38:54Z imp +.\" from FreeBSD: head/tools/build/options/WITHOUT_DOCCOMPRESS 266752 2014-05-27 15:52:27Z gjb Set to not to install compressed system documentation. Only the uncompressed version will be installed. - .It Va WITHOUT_DYNAMICROOT .\" from FreeBSD: head/tools/build/options/WITHOUT_DYNAMICROOT 156932 2006-03-21 07:50:50Z ru Set this if you do not want to link @@ -395,11 +394,10 @@ This includes the device tree compiler ( Set to not build or install programs for operating floppy disk driver. .It Va WITH_FMAKE -.\" from FreeBSD: head/tools/build/options/WITH_FMAKE 265828 2014-05-10 16:37:39Z imp +.\" from FreeBSD: head/tools/build/options/WITH_FMAKE 266752 2014-05-27 15:52:27Z gjb Causes the old FreeBSD .Xr make 1 program to be built and installed as fmake. - .It Va WITHOUT_FMTREE .\" from FreeBSD: head/tools/build/options/WITHOUT_FMTREE 261299 2014-01-30 21:37:43Z brooks Set to not build and install @@ -484,10 +482,9 @@ This is the default on platforms where g It is a default setting on arm/armeb, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. .It Va WITHOUT_GNU_GREP_COMPAT -.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_GREP_COMPAT 265826 2014-05-10 16:37:28Z imp +.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_GREP_COMPAT 266752 2014-05-27 15:52:27Z gjb Set this option to omit the gnu extentions to grep from being included in BSD grep. - .It Va WITHOUT_GNU_SUPPORT .\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build some programs without optional GNU support. @@ -739,11 +736,9 @@ When set, the following options are also is set explicitly) .El .It Va WITHOUT_MANCOMPRESS -.\" from FreeBSD: head/tools/build/options/WITHOUT_MANCOMPRESS 265838 2014-05-10 16:38:54Z imp +.\" from FreeBSD: head/tools/build/options/WITHOUT_MANCOMPRESS 266752 2014-05-27 15:52:27Z gjb Set to not to install compressed man pages. Only the uncompressed versions will be installed. - - .It Va WITHOUT_MAN_UTILS .\" from FreeBSD: head/tools/build/options/WITHOUT_MAN_UTILS 208322 2010-05-20 00:07:21Z jkim Set to not build utilities for manual pages, From owner-svn-src-head@FreeBSD.ORG Tue May 27 16:30:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89DFBF12; Tue, 27 May 2014 16:30:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7730B2BCF; Tue, 27 May 2014 16:30:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RGUto9096821; Tue, 27 May 2014 16:30:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RGUtsa096819; Tue, 27 May 2014 16:30:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201405271630.s4RGUtsa096819@svn.freebsd.org> From: Warner Losh Date: Tue, 27 May 2014 16:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266756 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 16:30:55 -0000 Author: imp Date: Tue May 27 16:30:54 2014 New Revision: 266756 URL: http://svnweb.freebsd.org/changeset/base/266756 Log: Better documentation for why KERBEROS and OPENSSH are here, and where to look for all the other options that used to be here (well, in bsd.own.mk) Suggested by: des@ Modified: head/share/mk/bsd.opts.mk head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Tue May 27 16:17:25 2014 (r266755) +++ head/share/mk/bsd.opts.mk Tue May 27 16:30:54 2014 (r266756) @@ -40,8 +40,13 @@ ____: # that haven't been converted over. # -# Only these options are used by bsd.*.mk. Most seem legit, except maybe -# OPENSSH. +# Only these options are used by bsd.*.mk. KERBEROS and OPENSSH are +# unforutnately needed to support statically linking the entire +# tree. su(1) wouldn't link since it depends on PAM which depends on +# ssh libraries when building with OPENSSH, and likewise for KERBEROS. + +# All other variables used to build /usr/src live in src.opts.mk +# and variables from both files are documented in src.conf(5). __DEFAULT_YES_OPTIONS = \ ASSERT_DEBUG \ Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Tue May 27 16:17:25 2014 (r266755) +++ head/share/mk/bsd.own.mk Tue May 27 16:30:54 2014 (r266756) @@ -122,7 +122,7 @@ .if !target(____) ____: -.include +.include # options now here or src.opts.mk .if !defined(_WITHOUT_SRCCONF) From owner-svn-src-head@FreeBSD.ORG Tue May 27 18:18:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4F7A610; Tue, 27 May 2014 18:18:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A08BF25BB; Tue, 27 May 2014 18:18:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RIIgV4045231; Tue, 27 May 2014 18:18:42 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RIIff9045225; Tue, 27 May 2014 18:18:41 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201405271818.s4RIIff9045225@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 27 May 2014 18:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266757 - in head/sys: conf dev/cxgbe dev/cxgbe/common modules/cxgbe/if_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 18:18:42 -0000 Author: np Date: Tue May 27 18:18:41 2014 New Revision: 266757 URL: http://svnweb.freebsd.org/changeset/base/266757 Log: cxgbe(4): netmap support for Terminator 5 (T5) based 10G/40G cards. Netmap gets its own hardware-assisted virtual interface and won't take over or disrupt the "normal" interface in any way. You can use both simultaneously. For kernels with DEV_NETMAP, cxgbe(4) carves out an ncxl interface (note the 'n' prefix) in the hardware to accompany each cxl interface. These two ifnet's per port share the same wire but really are separate interfaces in the hardware and software. Each gets its own L2 MAC addresses (unicast and multicast), MTU, checksum caps, etc. You should run netmap on the 'n' interfaces only, that's what they are for. With this, pkt-gen is able to transmit > 45Mpps out of a single 40G port of a T580 card. 2 port tx is at ~56Mpps total (28M + 28M) as of now. Single port receive is at 33Mpps but this is very much a work in progress. I expect it to be closer to 40Mpps once done. In any case the current effort can already saturate multiple 10G ports of a T5 card at the smallest legal packet size. T4 gear is totally untested. trantor:~# ./pkt-gen -i ncxl0 -f tx -D 00:07:43:ab:cd:ef 881.952141 main [1621] interface is ncxl0 881.952250 extract_ip_range [275] range is 10.0.0.1:0 to 10.0.0.1:0 881.952253 extract_ip_range [275] range is 10.1.0.1:0 to 10.1.0.1:0 881.962540 main [1804] mapped 334980KB at 0x801dff000 Sending on netmap:ncxl0: 4 queues, 1 threads and 1 cpus. 10.0.0.1 -> 10.1.0.1 (00:00:00:00:00:00 -> 00:07:43:ab:cd:ef) 881.962562 main [1882] Sending 512 packets every 0.000000000 s 881.962563 main [1884] Wait 2 secs for phy reset 884.088516 main [1886] Ready... 884.088535 nm_open [457] overriding ifname ncxl0 ringid 0x0 flags 0x1 884.088607 sender_body [996] start 884.093246 sender_body [1064] drop copy 885.090435 main_thread [1418] 45206353 pps (45289533 pkts in 1001840 usec) 886.091600 main_thread [1418] 45322792 pps (45375593 pkts in 1001165 usec) 887.092435 main_thread [1418] 45313992 pps (45351784 pkts in 1000834 usec) 888.094434 main_thread [1418] 45315765 pps (45406397 pkts in 1002000 usec) 889.095434 main_thread [1418] 45333218 pps (45378551 pkts in 1001000 usec) 890.097434 main_thread [1418] 45315247 pps (45405877 pkts in 1002000 usec) 891.099434 main_thread [1418] 45326515 pps (45417168 pkts in 1002000 usec) 892.101434 main_thread [1418] 45333039 pps (45423705 pkts in 1002000 usec) 893.103434 main_thread [1418] 45324105 pps (45414708 pkts in 1001999 usec) 894.105434 main_thread [1418] 45318042 pps (45408723 pkts in 1002001 usec) 895.106434 main_thread [1418] 45332430 pps (45377762 pkts in 1001000 usec) 896.107434 main_thread [1418] 45338072 pps (45383410 pkts in 1001000 usec) ... Relnotes: Yes Sponsored by: Chelsio Communications. Added: head/sys/dev/cxgbe/t4_netmap.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c head/sys/modules/cxgbe/if_cxgbe/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue May 27 16:30:54 2014 (r266756) +++ head/sys/conf/files Tue May 27 18:18:41 2014 (r266757) @@ -1127,6 +1127,8 @@ dev/cxgb/cxgb_t3fw.c optional cxgb cxgb compile-with "${NORMAL_C} -I$S/dev/cxgb" dev/cxgbe/t4_main.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/t4_netmap.c optional cxgbe pci \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_sge.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_l2t.c optional cxgbe pci \ Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue May 27 16:30:54 2014 (r266756) +++ head/sys/dev/cxgbe/adapter.h Tue May 27 18:18:41 2014 (r266757) @@ -54,6 +54,7 @@ #include #include "offload.h" +#include "common/t4_msg.h" #include "firmware/t4fw_interface.h" MALLOC_DECLARE(M_CXGBE); @@ -131,6 +132,7 @@ enum { RX_IQ_ESIZE = 64, /* At least 64 so CPL_RX_PKT will fit */ EQ_ESIZE = 64, /* All egress queues use this entry size */ + SGE_MAX_WR_NDESC = SGE_MAX_WR_LEN / EQ_ESIZE, /* max WR size in desc */ RX_FL_ESIZE = EQ_ESIZE, /* 8 64bit addresses */ #if MJUMPAGESIZE != MCLBYTES @@ -155,6 +157,17 @@ enum { }; enum { + XGMAC_MTU = (1 << 0), + XGMAC_PROMISC = (1 << 1), + XGMAC_ALLMULTI = (1 << 2), + XGMAC_VLANEX = (1 << 3), + XGMAC_UCADDR = (1 << 4), + XGMAC_MCADDRS = (1 << 5), + + XGMAC_ALL = 0xffff +}; + +enum { /* flags understood by begin_synchronized_op */ HOLD_LOCK = (1 << 0), SLEEP_OK = (1 << 1), @@ -168,7 +181,7 @@ enum { /* adapter flags */ FULL_INIT_DONE = (1 << 0), FW_OK = (1 << 1), - INTR_DIRECT = (1 << 2), /* direct interrupts for everything */ + /* INTR_DIRECT = (1 << 2), No longer used. */ MASTER_PF = (1 << 3), ADAP_SYSCTL_CTX = (1 << 4), TOM_INIT_DONE = (1 << 5), @@ -181,6 +194,10 @@ enum { PORT_INIT_DONE = (1 << 1), PORT_SYSCTL_CTX = (1 << 2), HAS_TRACEQ = (1 << 3), + INTR_RXQ = (1 << 4), /* All NIC rxq's take interrupts */ + INTR_OFLD_RXQ = (1 << 5), /* All TOE rxq's take interrupts */ + INTR_NM_RXQ = (1 << 6), /* All netmap rxq's take interrupts */ + INTR_ALL = (INTR_RXQ | INTR_OFLD_RXQ | INTR_NM_RXQ), }; #define IS_DOOMED(pi) ((pi)->flags & DOOMED) @@ -225,6 +242,19 @@ struct port_info { int nofldrxq; /* # of offload rx queues */ int first_ofld_rxq; /* index of first offload rx queue */ #endif +#ifdef DEV_NETMAP + int nnmtxq; /* # of netmap tx queues */ + int first_nm_txq; /* index of first netmap tx queue */ + int nnmrxq; /* # of netmap rx queues */ + int first_nm_rxq; /* index of first netmap rx queue */ + + struct ifnet *nm_ifp; + struct ifmedia nm_media; + int nmif_flags; + uint16_t nm_viid; + int16_t nm_xact_addr_filt; + uint16_t nm_rss_size; /* size of netmap VI's RSS table slice */ +#endif int tmr_idx; int pktc_idx; int qsize_rxq; @@ -362,7 +392,7 @@ struct sge_eq { struct tx_desc *desc; /* KVA of descriptor ring */ bus_addr_t ba; /* bus address of descriptor ring */ struct sge_qstat *spg; /* status page, for convenience */ - int doorbells; + uint16_t doorbells; volatile uint32_t *udb; /* KVA of doorbell (lies within BAR2) */ u_int udb_qid; /* relative qid within the doorbell page */ uint16_t cap; /* max # of desc, for convenience */ @@ -538,6 +568,77 @@ struct sge_wrq { uint32_t no_desc; /* out of hardware descriptors */ } __aligned(CACHE_LINE_SIZE); + +#ifdef DEV_NETMAP +#define CPL_PAD (RX_IQ_ESIZE - sizeof(struct rsp_ctrl) - \ + sizeof(struct rss_header)) +struct nm_iq_desc { + struct rss_header rss; + union { + uint8_t cpl[CPL_PAD]; + struct cpl_fw6_msg fw6_msg; + struct cpl_rx_pkt rx_pkt; + } u; + struct rsp_ctrl rsp; +}; +CTASSERT(sizeof(struct nm_iq_desc) == RX_IQ_ESIZE); + +struct sge_nm_rxq { + struct port_info *pi; + + struct nm_iq_desc *iq_desc; + uint16_t iq_abs_id; + uint16_t iq_cntxt_id; + uint16_t iq_cidx; + uint16_t iq_sidx; + uint8_t iq_gen; + + __be64 *fl_desc; + uint16_t fl_cntxt_id; + uint32_t fl_cidx; + uint32_t fl_pidx; + uint32_t fl_sidx; + uint32_t fl_db_val; + u_int fl_hwidx:4; + + u_int nid; /* netmap ring # for this queue */ + + /* infrequently used items after this */ + + bus_dma_tag_t iq_desc_tag; + bus_dmamap_t iq_desc_map; + bus_addr_t iq_ba; + int intr_idx; + + bus_dma_tag_t fl_desc_tag; + bus_dmamap_t fl_desc_map; + bus_addr_t fl_ba; +} __aligned(CACHE_LINE_SIZE); + +struct sge_nm_txq { + struct tx_desc *desc; + uint16_t cidx; + uint16_t pidx; + uint16_t sidx; + uint16_t equiqidx; /* EQUIQ last requested at this pidx */ + uint16_t equeqidx; /* EQUEQ last requested at this pidx */ + uint16_t dbidx; /* pidx of the most recent doorbell */ + uint16_t doorbells; + volatile uint32_t *udb; + u_int udb_qid; + u_int cntxt_id; + __be32 cpl_ctrl0; /* for convenience */ + u_int nid; /* netmap ring # for this queue */ + + /* infrequently used items after this */ + + bus_dma_tag_t desc_tag; + bus_dmamap_t desc_map; + bus_addr_t ba; + int iqidx; +} __aligned(CACHE_LINE_SIZE); +#endif + struct sge { int timer_val[SGE_NTIMERS]; int counter_val[SGE_NCOUNTERS]; @@ -552,6 +653,10 @@ struct sge { int nofldrxq; /* total # of TOE rx queues */ int nofldtxq; /* total # of TOE tx queues */ #endif +#ifdef DEV_NETMAP + int nnmrxq; /* total # of netmap rx queues */ + int nnmtxq; /* total # of netmap tx queues */ +#endif int niq; /* total # of ingress queues */ int neq; /* total # of egress queues */ @@ -564,6 +669,10 @@ struct sge { struct sge_wrq *ofld_txq; /* TOE tx queues */ struct sge_ofld_rxq *ofld_rxq; /* TOE rx queues */ #endif +#ifdef DEV_NETMAP + struct sge_nm_txq *nm_txq; /* netmap tx queues */ + struct sge_nm_rxq *nm_rxq; /* netmap rx queues */ +#endif uint16_t iq_start; int eq_start; @@ -629,7 +738,7 @@ struct adapter { struct l2t_data *l2t; /* L2 table */ struct tid_info tids; - int doorbells; + uint16_t doorbells; int open_device_map; #ifdef TCP_OFFLOAD int offload_map; @@ -730,6 +839,12 @@ struct adapter { #define for_each_ofld_rxq(pi, iter, q) \ for (q = &pi->adapter->sge.ofld_rxq[pi->first_ofld_rxq], iter = 0; \ iter < pi->nofldrxq; ++iter, ++q) +#define for_each_nm_txq(pi, iter, q) \ + for (q = &pi->adapter->sge.nm_txq[pi->first_nm_txq], iter = 0; \ + iter < pi->nnmtxq; ++iter, ++q) +#define for_each_nm_rxq(pi, iter, q) \ + for (q = &pi->adapter->sge.nm_rxq[pi->first_nm_rxq], iter = 0; \ + iter < pi->nnmrxq; ++iter, ++q) /* One for errors, one for firmware events */ #define T4_EXTRA_INTR 2 @@ -854,6 +969,18 @@ int t4_register_fw_msg_handler(struct ad int t4_filter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); int begin_synchronized_op(struct adapter *, struct port_info *, int, char *); void end_synchronized_op(struct adapter *, int); +int update_mac_settings(struct ifnet *, int); +int adapter_full_init(struct adapter *); +int adapter_full_uninit(struct adapter *); +int port_full_init(struct port_info *); +int port_full_uninit(struct port_info *); + +#ifdef DEV_NETMAP +/* t4_netmap.c */ +int create_netmap_ifnet(struct port_info *); +int destroy_netmap_ifnet(struct port_info *); +void t4_nm_intr(void *); +#endif /* t4_sge.c */ void t4_sge_modload(void); Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Tue May 27 16:30:54 2014 (r266756) +++ head/sys/dev/cxgbe/common/common.h Tue May 27 18:18:41 2014 (r266757) @@ -561,11 +561,11 @@ int t4_cfg_pfvf(struct adapter *adap, un unsigned int exactf, unsigned int rcaps, unsigned int wxcaps); int t4_alloc_vi_func(struct adapter *adap, unsigned int mbox, unsigned int port, unsigned int pf, unsigned int vf, - unsigned int nmac, u8 *mac, unsigned int *rss_size, + unsigned int nmac, u8 *mac, u16 *rss_size, unsigned int portfunc, unsigned int idstype); int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port, unsigned int pf, unsigned int vf, unsigned int nmac, u8 *mac, - unsigned int *rss_size); + u16 *rss_size); int t4_free_vi(struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int viid); @@ -581,6 +581,8 @@ int t4_set_addr_hash(struct adapter *ada bool ucast, u64 vec, bool sleep_ok); int t4_enable_vi(struct adapter *adap, unsigned int mbox, unsigned int viid, bool rx_en, bool tx_en); +int t4_enable_vi_ns(struct adapter *adap, unsigned int mbox, unsigned int viid, + bool rx_en, bool tx_en); int t4_identify_port(struct adapter *adap, unsigned int mbox, unsigned int viid, unsigned int nblinks); int t4_i2c_rd(struct adapter *adap, unsigned int mbox, unsigned int port_id, Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Tue May 27 16:30:54 2014 (r266756) +++ head/sys/dev/cxgbe/common/t4_hw.c Tue May 27 18:18:41 2014 (r266757) @@ -4826,7 +4826,7 @@ int t4_cfg_pfvf(struct adapter *adap, un */ int t4_alloc_vi_func(struct adapter *adap, unsigned int mbox, unsigned int port, unsigned int pf, unsigned int vf, - unsigned int nmac, u8 *mac, unsigned int *rss_size, + unsigned int nmac, u8 *mac, u16 *rss_size, unsigned int portfunc, unsigned int idstype) { int ret; @@ -4881,7 +4881,7 @@ int t4_alloc_vi_func(struct adapter *ada */ int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port, unsigned int pf, unsigned int vf, unsigned int nmac, u8 *mac, - unsigned int *rss_size) + u16 *rss_size) { return t4_alloc_vi_func(adap, mbox, port, pf, vf, nmac, mac, rss_size, FW_VI_FUNC_ETH, 0); @@ -5155,6 +5155,19 @@ int t4_enable_vi(struct adapter *adap, u return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); } +int t4_enable_vi_ns(struct adapter *adap, unsigned int mbox, unsigned int viid, + bool rx_en, bool tx_en) +{ + struct fw_vi_enable_cmd c; + + memset(&c, 0, sizeof(c)); + c.op_to_viid = htonl(V_FW_CMD_OP(FW_VI_ENABLE_CMD) | F_FW_CMD_REQUEST | + F_FW_CMD_EXEC | V_FW_VI_ENABLE_CMD_VIID(viid)); + c.ien_to_len16 = htonl(V_FW_VI_ENABLE_CMD_IEN(rx_en) | + V_FW_VI_ENABLE_CMD_EEN(tx_en) | FW_LEN16(c)); + return t4_wr_mbox_ns(adap, mbox, &c, sizeof(c), NULL); +} + /** * t4_identify_port - identify a VI's port by blinking its LED * @adap: the adapter @@ -5623,7 +5636,7 @@ int __devinit t4_port_init(struct port_i u8 addr[6]; int ret, i, j; struct fw_port_cmd c; - unsigned int rss_size; + u16 rss_size; adapter_t *adap = p->adapter; memset(&c, 0, sizeof(c)); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue May 27 16:30:54 2014 (r266756) +++ head/sys/dev/cxgbe/t4_main.c Tue May 27 18:18:41 2014 (r266757) @@ -218,6 +218,24 @@ static int t4_nofldrxq1g = -1; TUNABLE_INT("hw.cxgbe.nofldrxq1g", &t4_nofldrxq1g); #endif +#ifdef DEV_NETMAP +#define NNMTXQ_10G 2 +static int t4_nnmtxq10g = -1; +TUNABLE_INT("hw.cxgbe.nnmtxq10g", &t4_nnmtxq10g); + +#define NNMRXQ_10G 2 +static int t4_nnmrxq10g = -1; +TUNABLE_INT("hw.cxgbe.nnmrxq10g", &t4_nnmrxq10g); + +#define NNMTXQ_1G 1 +static int t4_nnmtxq1g = -1; +TUNABLE_INT("hw.cxgbe.nnmtxq1g", &t4_nnmtxq1g); + +#define NNMRXQ_1G 1 +static int t4_nnmrxq1g = -1; +TUNABLE_INT("hw.cxgbe.nnmrxq1g", &t4_nnmrxq1g); +#endif + /* * Holdoff parameters for 10G and 1G ports. */ @@ -295,19 +313,26 @@ static int t5_write_combine = 0; TUNABLE_INT("hw.cxl.write_combine", &t5_write_combine); struct intrs_and_queues { - int intr_type; /* INTx, MSI, or MSI-X */ - int nirq; /* Number of vectors */ - int intr_flags; - int ntxq10g; /* # of NIC txq's for each 10G port */ - int nrxq10g; /* # of NIC rxq's for each 10G port */ - int ntxq1g; /* # of NIC txq's for each 1G port */ - int nrxq1g; /* # of NIC rxq's for each 1G port */ - int rsrv_noflowq; /* Flag whether to reserve queue 0 */ + uint16_t intr_type; /* INTx, MSI, or MSI-X */ + uint16_t nirq; /* Total # of vectors */ + uint16_t intr_flags_10g;/* Interrupt flags for each 10G port */ + uint16_t intr_flags_1g; /* Interrupt flags for each 1G port */ + uint16_t ntxq10g; /* # of NIC txq's for each 10G port */ + uint16_t nrxq10g; /* # of NIC rxq's for each 10G port */ + uint16_t ntxq1g; /* # of NIC txq's for each 1G port */ + uint16_t nrxq1g; /* # of NIC rxq's for each 1G port */ + uint16_t rsrv_noflowq; /* Flag whether to reserve queue 0 */ #ifdef TCP_OFFLOAD - int nofldtxq10g; /* # of TOE txq's for each 10G port */ - int nofldrxq10g; /* # of TOE rxq's for each 10G port */ - int nofldtxq1g; /* # of TOE txq's for each 1G port */ - int nofldrxq1g; /* # of TOE rxq's for each 1G port */ + uint16_t nofldtxq10g; /* # of TOE txq's for each 10G port */ + uint16_t nofldrxq10g; /* # of TOE rxq's for each 10G port */ + uint16_t nofldtxq1g; /* # of TOE txq's for each 1G port */ + uint16_t nofldrxq1g; /* # of TOE rxq's for each 1G port */ +#endif +#ifdef DEV_NETMAP + uint16_t nnmtxq10g; /* # of netmap txq's for each 10G port */ + uint16_t nnmrxq10g; /* # of netmap rxq's for each 10G port */ + uint16_t nnmtxq1g; /* # of netmap txq's for each 1G port */ + uint16_t nnmrxq1g; /* # of netmap rxq's for each 1G port */ #endif }; @@ -321,17 +346,6 @@ struct filter_entry { struct t4_filter_specification fs; }; -enum { - XGMAC_MTU = (1 << 0), - XGMAC_PROMISC = (1 << 1), - XGMAC_ALLMULTI = (1 << 2), - XGMAC_VLANEX = (1 << 3), - XGMAC_UCADDR = (1 << 4), - XGMAC_MCADDRS = (1 << 5), - - XGMAC_ALL = 0xffff -}; - static int map_bars_0_and_4(struct adapter *); static int map_bar_2(struct adapter *); static void setup_memwin(struct adapter *); @@ -350,15 +364,10 @@ static int get_params__pre_init(struct a static int get_params__post_init(struct adapter *); static int set_params__post_init(struct adapter *); static void t4_set_desc(struct adapter *); -static void build_medialist(struct port_info *); -static int update_mac_settings(struct port_info *, int); +static void build_medialist(struct port_info *, struct ifmedia *); static int cxgbe_init_synchronized(struct port_info *); static int cxgbe_uninit_synchronized(struct port_info *); static int setup_intr_handlers(struct adapter *); -static int adapter_full_init(struct adapter *); -static int adapter_full_uninit(struct adapter *); -static int port_full_init(struct port_info *); -static int port_full_uninit(struct port_info *); static void quiesce_eq(struct adapter *, struct sge_eq *); static void quiesce_iq(struct adapter *, struct sge_iq *); static void quiesce_fl(struct adapter *, struct sge_fl *); @@ -556,6 +565,9 @@ t4_attach(device_t dev) #ifdef TCP_OFFLOAD int ofld_rqidx, ofld_tqidx; #endif +#ifdef DEV_NETMAP + int nm_rqidx, nm_tqidx; +#endif const char *pcie_ts; sc = device_get_softc(dev); @@ -685,6 +697,13 @@ t4_attach(device_t dev) sc->port[i] = NULL; goto done; } + rc = -t4_link_start(sc, sc->mbox, pi->tx_chan, &pi->link_cfg); + if (rc != 0) { + device_printf(dev, "port %d l1cfg failed: %d\n", i, rc); + free(pi, M_CXGBE); + sc->port[i] = NULL; + goto done; + } snprintf(pi->lockname, sizeof(pi->lockname), "%sp%d", device_get_nameunit(dev), i); @@ -726,7 +745,6 @@ t4_attach(device_t dev) sc->intr_type = iaq.intr_type; sc->intr_count = iaq.nirq; - sc->flags |= iaq.intr_flags; s = &sc->sge; s->nrxq = n10g * iaq.nrxq10g + n1g * iaq.nrxq1g; @@ -734,10 +752,8 @@ t4_attach(device_t dev) s->neq = s->ntxq + s->nrxq; /* the free list in an rxq is an eq */ s->neq += sc->params.nports + 1;/* ctrl queues: 1 per port + 1 mgmt */ s->niq = s->nrxq + 1; /* 1 extra for firmware event queue */ - #ifdef TCP_OFFLOAD if (is_offload(sc)) { - s->nofldrxq = n10g * iaq.nofldrxq10g + n1g * iaq.nofldrxq1g; s->nofldtxq = n10g * iaq.nofldtxq10g + n1g * iaq.nofldtxq1g; s->neq += s->nofldtxq + s->nofldrxq; @@ -749,6 +765,17 @@ t4_attach(device_t dev) M_CXGBE, M_ZERO | M_WAITOK); } #endif +#ifdef DEV_NETMAP + s->nnmrxq = n10g * iaq.nnmrxq10g + n1g * iaq.nnmrxq1g; + s->nnmtxq = n10g * iaq.nnmtxq10g + n1g * iaq.nnmtxq1g; + s->neq += s->nnmtxq + s->nnmrxq; + s->niq += s->nnmrxq; + + s->nm_rxq = malloc(s->nnmrxq * sizeof(struct sge_nm_rxq), + M_CXGBE, M_ZERO | M_WAITOK); + s->nm_txq = malloc(s->nnmtxq * sizeof(struct sge_nm_txq), + M_CXGBE, M_ZERO | M_WAITOK); +#endif s->ctrlq = malloc(sc->params.nports * sizeof(struct sge_wrq), M_CXGBE, M_ZERO | M_WAITOK); @@ -774,6 +801,9 @@ t4_attach(device_t dev) #ifdef TCP_OFFLOAD ofld_rqidx = ofld_tqidx = 0; #endif +#ifdef DEV_NETMAP + nm_rqidx = nm_tqidx = 0; +#endif for_each_port(sc, i) { struct port_info *pi = sc->port[i]; @@ -783,9 +813,11 @@ t4_attach(device_t dev) pi->first_rxq = rqidx; pi->first_txq = tqidx; if (is_10G_port(pi) || is_40G_port(pi)) { + pi->flags |= iaq.intr_flags_10g; pi->nrxq = iaq.nrxq10g; pi->ntxq = iaq.ntxq10g; } else { + pi->flags |= iaq.intr_flags_1g; pi->nrxq = iaq.nrxq1g; pi->ntxq = iaq.ntxq1g; } @@ -797,7 +829,6 @@ t4_attach(device_t dev) rqidx += pi->nrxq; tqidx += pi->ntxq; - #ifdef TCP_OFFLOAD if (is_offload(sc)) { pi->first_ofld_rxq = ofld_rqidx; @@ -813,6 +844,19 @@ t4_attach(device_t dev) ofld_tqidx += pi->nofldtxq; } #endif +#ifdef DEV_NETMAP + pi->first_nm_rxq = nm_rqidx; + pi->first_nm_txq = nm_tqidx; + if (is_10G_port(pi) || is_40G_port(pi)) { + pi->nnmrxq = iaq.nnmrxq10g; + pi->nnmtxq = iaq.nnmtxq10g; + } else { + pi->nnmrxq = iaq.nnmrxq1g; + pi->nnmtxq = iaq.nnmtxq1g; + } + nm_rqidx += pi->nnmrxq; + nm_tqidx += pi->nnmtxq; +#endif } rc = setup_intr_handlers(sc); @@ -902,7 +946,7 @@ t4_detach(device_t dev) for (i = 0; i < MAX_NPORTS; i++) { pi = sc->port[i]; if (pi) { - t4_free_vi(pi->adapter, sc->mbox, sc->pf, 0, pi->viid); + t4_free_vi(sc, sc->mbox, sc->pf, 0, pi->viid); if (pi->dev) device_delete_child(dev, pi->dev); @@ -939,6 +983,10 @@ t4_detach(device_t dev) free(sc->sge.ofld_rxq, M_CXGBE); free(sc->sge.ofld_txq, M_CXGBE); #endif +#ifdef DEV_NETMAP + free(sc->sge.nm_rxq, M_CXGBE); + free(sc->sge.nm_txq, M_CXGBE); +#endif free(sc->irq, M_CXGBE); free(sc->sge.rxq, M_CXGBE); free(sc->sge.txq, M_CXGBE); @@ -966,7 +1014,6 @@ t4_detach(device_t dev) return (0); } - static int cxgbe_probe(device_t dev) { @@ -989,6 +1036,8 @@ cxgbe_attach(device_t dev) { struct port_info *pi = device_get_softc(dev); struct ifnet *ifp; + char *s; + int n, o; /* Allocate an ifnet and set it up */ ifp = if_alloc(IFT_ETHER); @@ -1021,22 +1070,39 @@ cxgbe_attach(device_t dev) /* Initialize ifmedia for this port */ ifmedia_init(&pi->media, IFM_IMASK, cxgbe_media_change, cxgbe_media_status); - build_medialist(pi); + build_medialist(pi, &pi->media); pi->vlan_c = EVENTHANDLER_REGISTER(vlan_config, cxgbe_vlan_config, ifp, EVENTHANDLER_PRI_ANY); ether_ifattach(ifp, pi->hw_addr); + n = 128; + s = malloc(n, M_CXGBE, M_WAITOK); + o = snprintf(s, n, "%d txq, %d rxq (NIC)", pi->ntxq, pi->nrxq); + MPASS(n > o); #ifdef TCP_OFFLOAD if (is_offload(pi->adapter)) { - device_printf(dev, - "%d txq, %d rxq (NIC); %d txq, %d rxq (TOE)\n", - pi->ntxq, pi->nrxq, pi->nofldtxq, pi->nofldrxq); - } else + o += snprintf(s + o, n - o, "; %d txq, %d rxq (TOE)", + pi->nofldtxq, pi->nofldrxq); + MPASS(n > o); + } +#endif +#ifdef DEV_NETMAP + o += snprintf(s + o, n - o, "; %d txq, %d rxq (netmap)", pi->nnmtxq, + pi->nnmrxq); + MPASS(n > o); +#endif + device_printf(dev, "%s\n", s); + free(s, M_CXGBE); + +#ifdef DEV_NETMAP + /* nm_media handled here to keep implementation private to this file */ + ifmedia_init(&pi->nm_media, IFM_IMASK, cxgbe_media_change, + cxgbe_media_status); + build_medialist(pi, &pi->nm_media); + create_netmap_ifnet(pi); /* logs errors it something fails */ #endif - device_printf(dev, "%d txq, %d rxq\n", pi->ntxq, pi->nrxq); - cxgbe_sysctls(pi); return (0); @@ -1084,6 +1150,11 @@ cxgbe_detach(device_t dev) ether_ifdetach(pi->ifp); if_free(pi->ifp); +#ifdef DEV_NETMAP + /* XXXNM: equivalent of cxgbe_uninit_synchronized to ifdown nm_ifp */ + destroy_netmap_ifnet(pi); +#endif + ADAPTER_LOCK(sc); CLR_BUSY(sc); wakeup(&sc->flags); @@ -1126,7 +1197,7 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned if (pi->flags & PORT_INIT_DONE) { t4_update_fl_bufsize(ifp); if (ifp->if_drv_flags & IFF_DRV_RUNNING) - rc = update_mac_settings(pi, XGMAC_MTU); + rc = update_mac_settings(ifp, XGMAC_MTU); } end_synchronized_op(sc, 0); break; @@ -1141,7 +1212,7 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned flags = pi->if_flags; if ((ifp->if_flags ^ flags) & (IFF_PROMISC | IFF_ALLMULTI)) { - rc = update_mac_settings(pi, + rc = update_mac_settings(ifp, XGMAC_PROMISC | XGMAC_ALLMULTI); } } else @@ -1152,13 +1223,13 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned end_synchronized_op(sc, 0); break; - case SIOCADDMULTI: + case SIOCADDMULTI: case SIOCDELMULTI: /* these two are called with a mutex held :-( */ rc = begin_synchronized_op(sc, pi, HOLD_LOCK, "t4multi"); if (rc) return (rc); if (ifp->if_drv_flags & IFF_DRV_RUNNING) - rc = update_mac_settings(pi, XGMAC_MCADDRS); + rc = update_mac_settings(ifp, XGMAC_MCADDRS); end_synchronized_op(sc, LOCK_HELD); break; @@ -1247,7 +1318,7 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned if (mask & IFCAP_VLAN_HWTAGGING) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; if (ifp->if_drv_flags & IFF_DRV_RUNNING) - rc = update_mac_settings(pi, XGMAC_VLANEX); + rc = update_mac_settings(ifp, XGMAC_VLANEX); } if (mask & IFCAP_VLAN_MTU) { ifp->if_capenable ^= IFCAP_VLAN_MTU; @@ -1382,13 +1453,23 @@ static void cxgbe_media_status(struct ifnet *ifp, struct ifmediareq *ifmr) { struct port_info *pi = ifp->if_softc; - struct ifmedia_entry *cur = pi->media.ifm_cur; + struct ifmedia *media = NULL; + struct ifmedia_entry *cur; int speed = pi->link_cfg.speed; int data = (pi->port_type << 8) | pi->mod_type; + if (ifp == pi->ifp) + media = &pi->media; +#ifdef DEV_NETMAP + else if (ifp == pi->nm_ifp) + media = &pi->nm_media; +#endif + MPASS(media != NULL); + + cur = media->ifm_cur; if (cur->ifm_data != data) { - build_medialist(pi); - cur = pi->media.ifm_cur; + build_medialist(pi, media); + cur = media->ifm_cur; } ifmr->ifm_status = IFM_AVALID; @@ -1741,6 +1822,7 @@ cfg_itype_and_nqueues(struct adapter *sc { int rc, itype, navail, nrxq10g, nrxq1g, n; int nofldrxq10g = 0, nofldrxq1g = 0; + int nnmrxq10g = 0, nnmrxq1g = 0; bzero(iaq, sizeof(*iaq)); @@ -1757,6 +1839,12 @@ cfg_itype_and_nqueues(struct adapter *sc iaq->nofldrxq1g = nofldrxq1g = t4_nofldrxq1g; } #endif +#ifdef DEV_NETMAP + iaq->nnmtxq10g = t4_nnmtxq10g; + iaq->nnmtxq1g = t4_nnmtxq1g; + iaq->nnmrxq10g = nnmrxq10g = t4_nnmrxq10g; + iaq->nnmrxq1g = nnmrxq1g = t4_nnmrxq1g; +#endif for (itype = INTR_MSIX; itype; itype >>= 1) { @@ -1774,30 +1862,60 @@ restart: continue; iaq->intr_type = itype; - iaq->intr_flags = 0; + iaq->intr_flags_10g = 0; + iaq->intr_flags_1g = 0; /* * Best option: an interrupt vector for errors, one for the - * firmware event queue, and one each for each rxq (NIC as well - * as offload). + * firmware event queue, and one for every rxq (NIC, TOE, and + * netmap). */ iaq->nirq = T4_EXTRA_INTR; - iaq->nirq += n10g * (nrxq10g + nofldrxq10g); - iaq->nirq += n1g * (nrxq1g + nofldrxq1g); + iaq->nirq += n10g * (nrxq10g + nofldrxq10g + nnmrxq10g); + iaq->nirq += n1g * (nrxq1g + nofldrxq1g + nnmrxq1g); if (iaq->nirq <= navail && (itype != INTR_MSI || powerof2(iaq->nirq))) { - iaq->intr_flags |= INTR_DIRECT; + iaq->intr_flags_10g = INTR_ALL; + iaq->intr_flags_1g = INTR_ALL; goto allocate; } /* - * Second best option: an interrupt vector for errors, one for - * the firmware event queue, and one each for either NIC or - * offload rxq's. + * Second best option: a vector for errors, one for the firmware + * event queue, and vectors for either all the NIC rx queues or + * all the TOE rx queues. The queues that don't get vectors + * will forward their interrupts to those that do. + * + * Note: netmap rx queues cannot be created early and so they + * can't be setup to receive forwarded interrupts for others. */ iaq->nirq = T4_EXTRA_INTR; - iaq->nirq += n10g * max(nrxq10g, nofldrxq10g); - iaq->nirq += n1g * max(nrxq1g, nofldrxq1g); + if (nrxq10g >= nofldrxq10g) { + iaq->intr_flags_10g = INTR_RXQ; + iaq->nirq += n10g * nrxq10g; +#ifdef DEV_NETMAP + iaq->nnmrxq10g = min(nnmrxq10g, nrxq10g); +#endif + } else { + iaq->intr_flags_10g = INTR_OFLD_RXQ; + iaq->nirq += n10g * nofldrxq10g; +#ifdef DEV_NETMAP + iaq->nnmrxq10g = min(nnmrxq10g, nofldrxq10g); +#endif + } + if (nrxq1g >= nofldrxq1g) { + iaq->intr_flags_1g = INTR_RXQ; + iaq->nirq += n1g * nrxq1g; +#ifdef DEV_NETMAP + iaq->nnmrxq1g = min(nnmrxq1g, nrxq1g); +#endif + } else { + iaq->intr_flags_1g = INTR_OFLD_RXQ; + iaq->nirq += n1g * nofldrxq1g; +#ifdef DEV_NETMAP + iaq->nnmrxq1g = min(nnmrxq1g, nofldrxq1g); +#endif + } if (iaq->nirq <= navail && (itype != INTR_MSI || powerof2(iaq->nirq))) goto allocate; @@ -1805,8 +1923,8 @@ restart: /* * Next best option: an interrupt vector for errors, one for the * firmware event queue, and at least one per port. At this - * point we know we'll have to downsize nrxq or nofldrxq to fit - * what's available to us. + * point we know we'll have to downsize nrxq and/or nofldrxq + * and/or nnmrxq to fit what's available to us. */ iaq->nirq = T4_EXTRA_INTR; iaq->nirq += n10g + n1g; @@ -1816,6 +1934,9 @@ restart: if (n10g > 0) { int target = max(nrxq10g, nofldrxq10g); + iaq->intr_flags_10g = nrxq10g >= nofldrxq10g ? + INTR_RXQ : INTR_OFLD_RXQ; + n = 1; while (n < target && leftover >= n10g) { leftover -= n10g; @@ -1824,14 +1945,19 @@ restart: } iaq->nrxq10g = min(n, nrxq10g); #ifdef TCP_OFFLOAD - if (is_offload(sc)) - iaq->nofldrxq10g = min(n, nofldrxq10g); + iaq->nofldrxq10g = min(n, nofldrxq10g); +#endif +#ifdef DEV_NETMAP + iaq->nnmrxq10g = min(n, nnmrxq10g); #endif } if (n1g > 0) { int target = max(nrxq1g, nofldrxq1g); + iaq->intr_flags_1g = nrxq1g >= nofldrxq1g ? + INTR_RXQ : INTR_OFLD_RXQ; + n = 1; while (n < target && leftover >= n1g) { leftover -= n1g; @@ -1840,8 +1966,10 @@ restart: } iaq->nrxq1g = min(n, nrxq1g); #ifdef TCP_OFFLOAD - if (is_offload(sc)) - iaq->nofldrxq1g = min(n, nofldrxq1g); + iaq->nofldrxq1g = min(n, nofldrxq1g); +#endif +#ifdef DEV_NETMAP + iaq->nnmrxq1g = min(n, nnmrxq1g); #endif } @@ -1853,10 +1981,14 @@ restart: * Least desirable option: one interrupt vector for everything. */ iaq->nirq = iaq->nrxq10g = iaq->nrxq1g = 1; + iaq->intr_flags_10g = iaq->intr_flags_1g = 0; #ifdef TCP_OFFLOAD if (is_offload(sc)) iaq->nofldrxq10g = iaq->nofldrxq1g = 1; #endif +#ifdef DEV_NETMAP + iaq->nnmrxq10g = iaq->nnmrxq1g = 1; +#endif allocate: navail = iaq->nirq; @@ -2636,9 +2768,8 @@ t4_set_desc(struct adapter *sc) } static void -build_medialist(struct port_info *pi) +build_medialist(struct port_info *pi, struct ifmedia *media) { - struct ifmedia *media = &pi->media; int data, m; PORT_LOCK(pi); @@ -2767,17 +2898,29 @@ build_medialist(struct port_info *pi) * Program the port's XGMAC based on parameters in ifnet. The caller also * indicates which parameters should be programmed (the rest are left alone). */ -static int -update_mac_settings(struct port_info *pi, int flags) +int +update_mac_settings(struct ifnet *ifp, int flags) { - int rc; - struct ifnet *ifp = pi->ifp; + int rc = 0; + struct port_info *pi = ifp->if_softc; struct adapter *sc = pi->adapter; int mtu = -1, promisc = -1, allmulti = -1, vlanex = -1; + uint16_t viid = 0xffff; + int16_t *xact_addr_filt = NULL; ASSERT_SYNCHRONIZED_OP(sc); KASSERT(flags, ("%s: not told what to update.", __func__)); + if (ifp == pi->ifp) { + viid = pi->viid; + xact_addr_filt = &pi->xact_addr_filt; + } +#ifdef DEV_NETMAP + else if (ifp == pi->nm_ifp) { + viid = pi->nm_viid; + xact_addr_filt = &pi->nm_xact_addr_filt; + } +#endif if (flags & XGMAC_MTU) mtu = ifp->if_mtu; @@ -2790,25 +2933,28 @@ update_mac_settings(struct port_info *pi if (flags & XGMAC_VLANEX) vlanex = ifp->if_capenable & IFCAP_VLAN_HWTAGGING ? 1 : 0; - rc = -t4_set_rxmode(sc, sc->mbox, pi->viid, mtu, promisc, allmulti, 1, - vlanex, false); - if (rc) { - if_printf(ifp, "set_rxmode (%x) failed: %d\n", flags, rc); - return (rc); + if (flags & (XGMAC_MTU|XGMAC_PROMISC|XGMAC_ALLMULTI|XGMAC_VLANEX)) { + rc = -t4_set_rxmode(sc, sc->mbox, viid, mtu, promisc, allmulti, + 1, vlanex, false); + if (rc) { + if_printf(ifp, "set_rxmode (%x) failed: %d\n", flags, + rc); + return (rc); + } } if (flags & XGMAC_UCADDR) { uint8_t ucaddr[ETHER_ADDR_LEN]; bcopy(IF_LLADDR(ifp), ucaddr, sizeof(ucaddr)); - rc = t4_change_mac(sc, sc->mbox, pi->viid, pi->xact_addr_filt, - ucaddr, true, true); + rc = t4_change_mac(sc, sc->mbox, viid, *xact_addr_filt, ucaddr, + true, true); if (rc < 0) { rc = -rc; if_printf(ifp, "change_mac failed: %d\n", rc); return (rc); } else { - pi->xact_addr_filt = rc; + *xact_addr_filt = rc; rc = 0; } } @@ -2828,8 +2974,8 @@ update_mac_settings(struct port_info *pi LLADDR((struct sockaddr_dl *)ifma->ifma_addr); if (i == FW_MAC_EXACT_CHUNK) { - rc = t4_alloc_mac_filt(sc, sc->mbox, pi->viid, - del, i, mcaddr, NULL, &hash, 0); + rc = t4_alloc_mac_filt(sc, sc->mbox, viid, del, + i, mcaddr, NULL, &hash, 0); if (rc < 0) { rc = -rc; for (j = 0; j < i; j++) { @@ -2849,8 +2995,8 @@ update_mac_settings(struct port_info *pi } } if (i > 0) { - rc = t4_alloc_mac_filt(sc, sc->mbox, pi->viid, - del, i, mcaddr, NULL, &hash, 0); + rc = t4_alloc_mac_filt(sc, sc->mbox, viid, del, i, + mcaddr, NULL, &hash, 0); if (rc < 0) { rc = -rc; for (j = 0; j < i; j++) { @@ -2867,7 +3013,7 @@ update_mac_settings(struct port_info *pi } } - rc = -t4_set_addr_hash(sc, sc->mbox, pi->viid, 0, hash, 0); + rc = -t4_set_addr_hash(sc, sc->mbox, viid, 0, hash, 0); if (rc != 0) if_printf(ifp, "failed to set mc address hash: %d", rc); mcfail: @@ -2970,16 +3116,10 @@ cxgbe_init_synchronized(struct port_info ((rc = port_full_init(pi)) != 0)) return (rc); /* error message displayed already */ - rc = update_mac_settings(pi, XGMAC_ALL); + rc = update_mac_settings(ifp, XGMAC_ALL); if (rc) goto done; /* error message displayed already */ - rc = -t4_link_start(sc, sc->mbox, pi->tx_chan, &pi->link_cfg); - if (rc != 0) { - if_printf(ifp, "start_link failed: %d\n", rc); - goto done; - } - rc = -t4_enable_vi(sc, sc->mbox, pi->viid, true, true); if (rc != 0) { if_printf(ifp, "enable_vi failed: %d\n", rc); @@ -3064,61 +3204,41 @@ setup_intr_handlers(struct adapter *sc) #ifdef TCP_OFFLOAD struct sge_ofld_rxq *ofld_rxq; #endif +#ifdef DEV_NETMAP + struct sge_nm_rxq *nm_rxq; +#endif /* * Setup interrupts. */ irq = &sc->irq[0]; rid = sc->intr_type == INTR_INTX ? 0 : 1; - if (sc->intr_count == 1) { - KASSERT(!(sc->flags & INTR_DIRECT), - ("%s: single interrupt && INTR_DIRECT?", __func__)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue May 27 18:39:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11F10708; Tue, 27 May 2014 18:39:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D97EC27DF; Tue, 27 May 2014 18:39:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RIdDNw055388; Tue, 27 May 2014 18:39:13 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RIdDq8055387; Tue, 27 May 2014 18:39:13 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201405271839.s4RIdDq8055387@svn.freebsd.org> From: "Simon J. Gerraty" Date: Tue, 27 May 2014 18:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266760 - head/contrib/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 18:39:14 -0000 Author: sjg Date: Tue May 27 18:39:13 2014 New Revision: 266760 URL: http://svnweb.freebsd.org/changeset/base/266760 Log: Portmgr no longer need the UL hack. Reviewed by: obrien Modified: head/contrib/bmake/var.c Modified: head/contrib/bmake/var.c ============================================================================== --- head/contrib/bmake/var.c Tue May 27 18:27:51 2014 (r266759) +++ head/contrib/bmake/var.c Tue May 27 18:39:13 2014 (r266760) @@ -141,17 +141,6 @@ __RCSID("$NetBSD: var.c,v 1.184 2013/09/ extern int makelevel; /* - * XXX transition hack for FreeBSD ports. - * bsd.port.mk can set .MAKE.FreeBSD_UL=yes - * to cause us to treat :[LU] as aliases for :t[lu] - * To be reverted when ports converts to :t[lu] (when 8.3 is EOL) - */ -#define MAKE_FREEBSD_UL ".MAKE.FreeBSD_UL" -#ifdef MAKE_FREEBSD_UL -static int FreeBSD_UL = FALSE; -#endif - -/* * This lets us tell if we have replaced the original environ * (which we cannot free). */ @@ -990,12 +979,6 @@ Var_Set(const char *name, const char *va Var_Append(MAKEOVERRIDES, name, VAR_GLOBAL); } - -#ifdef MAKE_FREEBSD_UL - if (strcmp(MAKE_FREEBSD_UL, name) == 0) { - FreeBSD_UL = getBoolean(MAKE_FREEBSD_UL, FALSE); - } -#endif out: @@ -2689,24 +2672,8 @@ ApplyModifiers(char *nstr, const char *t free(loop.str); break; } - case 'U': -#ifdef MAKE_FREEBSD_UL - if (FreeBSD_UL) { - int nc = tstr[1]; - - /* we have to be careful, since :U is used internally */ - if (nc == ':' || nc == endc) { - char *dp = bmake_strdup(nstr); - for (newStr = dp; *dp; dp++) - *dp = toupper((unsigned char)*dp); - cp = tstr + 1; - termc = *cp; - break; /* yes inside the conditional */ - } - /* FALLTHROUGH */ - } -#endif case 'D': + case 'U': { Buffer buf; /* Buffer for patterns */ int wantit; /* want data in buffer */ @@ -2766,17 +2733,6 @@ ApplyModifiers(char *nstr, const char *t break; } case 'L': -#ifdef MAKE_FREEBSD_UL - if (FreeBSD_UL) { - char *dp = bmake_strdup(nstr); - for (newStr = dp; *dp; dp++) - *dp = tolower((unsigned char)*dp); - cp = tstr + 1; - termc = *cp; - break; - } - /* FALLTHROUGH */ -#endif { if ((v->flags & VAR_JUNK) != 0) v->flags |= VAR_KEEP; From owner-svn-src-head@FreeBSD.ORG Tue May 27 19:04:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 179AE6C8; Tue, 27 May 2014 19:04:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04F612ABD; Tue, 27 May 2014 19:04:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RJ4c0L068777; Tue, 27 May 2014 19:04:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RJ4cx4068774; Tue, 27 May 2014 19:04:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405271904.s4RJ4cx4068774@svn.freebsd.org> From: John Baldwin Date: Tue, 27 May 2014 19:04:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266765 - in head/sys/amd64/vmm: . intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 19:04:39 -0000 Author: jhb Date: Tue May 27 19:04:38 2014 New Revision: 266765 URL: http://svnweb.freebsd.org/changeset/base/266765 Log: - Rework the XSAVE/XRSTOR emulation to only expose XCR0 features to the guest for which the rules regarding xsetbv emulation are known. In particular future extensions like AVX-512 have interdependencies among feature bits that could allow a guest to trigger a GP# in the host with the current approach of allowing anything the host supports. - Add proper checking of Intel MPX and AVX-512 XSAVE features in the xsetbv emulation and allow these features to be exposed to the guest if they are enabled in the host. - Expose a subset of known-safe features from leaf 0 of the structured extended features to guests if they are supported on the host including RDFSBASE/RDGSBASE, BMI1/2, AVX2, AVX-512, HLE, ERMS, and RTM. Aside from AVX-512, these features are all new instructions available for use in ring 3 with no additional hypervisor changes needed. Reviewed by: neel Modified: head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm_host.c head/sys/amd64/vmm/x86.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Tue May 27 19:02:25 2014 (r266764) +++ head/sys/amd64/vmm/intel/vmx.c Tue May 27 19:04:38 2014 (r266765) @@ -1380,8 +1380,30 @@ vmx_emulate_xsetbv(struct vmx *vmx, int return (HANDLED); } - if ((xcrval & (XFEATURE_ENABLED_AVX | XFEATURE_ENABLED_SSE)) == - XFEATURE_ENABLED_AVX) { + /* AVX (YMM_Hi128) requires SSE. */ + if (xcrval & XFEATURE_ENABLED_AVX && + (xcrval & XFEATURE_AVX) != XFEATURE_AVX) { + vm_inject_gp(vmx->vm, vcpu); + return (HANDLED); + } + + /* + * AVX512 requires base AVX (YMM_Hi128) as well as OpMask, + * ZMM_Hi256, and Hi16_ZMM. + */ + if (xcrval & XFEATURE_AVX512 && + (xcrval & (XFEATURE_AVX512 | XFEATURE_AVX)) != + (XFEATURE_AVX512 | XFEATURE_AVX)) { + vm_inject_gp(vmx->vm, vcpu); + return (HANDLED); + } + + /* + * Intel MPX requires both bound register state flags to be + * set. + */ + if (((xcrval & XFEATURE_ENABLED_BNDREGS) != 0) != + ((xcrval & XFEATURE_ENABLED_BNDCSR) != 0)) { vm_inject_gp(vmx->vm, vcpu); return (HANDLED); } Modified: head/sys/amd64/vmm/vmm_host.c ============================================================================== --- head/sys/amd64/vmm/vmm_host.c Tue May 27 19:02:25 2014 (r266764) +++ head/sys/amd64/vmm/vmm_host.c Tue May 27 19:04:38 2014 (r266765) @@ -66,11 +66,16 @@ vmm_host_state_init(void) * XSAVE. Only permit a guest to use XSAVE features supported * by the host. This ensures that the FPU state used by the * guest is always a subset of the saved guest FPU state. + * + * In addition, only permit known XSAVE features where the + * rules for which features depend on other features is known + * to properly emulate xsetbv. */ if (vmm_host_cr4 & CR4_XSAVE) { vmm_xsave_limits.xsave_enabled = 1; vmm_host_xcr0 = rxcr(0); - vmm_xsave_limits.xcr0_allowed = vmm_host_xcr0; + vmm_xsave_limits.xcr0_allowed = vmm_host_xcr0 & + (XFEATURE_AVX | XFEATURE_MPX | XFEATURE_AVX512); cpuid_count(0xd, 0x0, regs); vmm_xsave_limits.xsave_max_size = regs[1]; Modified: head/sys/amd64/vmm/x86.c ============================================================================== --- head/sys/amd64/vmm/x86.c Tue May 27 19:02:25 2014 (r266764) +++ head/sys/amd64/vmm/x86.c Tue May 27 19:04:38 2014 (r266765) @@ -241,6 +241,26 @@ x86_emulate_cpuid(struct vm *vm, int vcp /* leaf 0 */ if (*ecx == 0) { + cpuid_count(*eax, *ecx, regs); + + /* Only leaf 0 is supported */ + regs[0] = 0; + + /* + * Expose known-safe features. + */ + regs[1] &= (CPUID_STDEXT_FSGSBASE | + CPUID_STDEXT_BMI1 | CPUID_STDEXT_HLE | + CPUID_STDEXT_AVX2 | CPUID_STDEXT_BMI2 | + CPUID_STDEXT_ERMS | CPUID_STDEXT_RTM | + CPUID_STDEXT_AVX512F | + CPUID_STDEXT_AVX512PF | + CPUID_STDEXT_AVX512ER | + CPUID_STDEXT_AVX512CD); + regs[2] = 0; + regs[3] = 0; + + /* Advertise INVPCID if it is enabled. */ error = vm_get_capability(vm, vcpu_id, VM_CAP_ENABLE_INVPCID, &enable_invpcid); if (error == 0 && enable_invpcid) From owner-svn-src-head@FreeBSD.ORG Tue May 27 19:11:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69972BA6; Tue, 27 May 2014 19:11:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D3282B7D; Tue, 27 May 2014 19:11:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RJBxQr072773; Tue, 27 May 2014 19:11:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RJBxfW072772; Tue, 27 May 2014 19:11:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405271911.s4RJBxfW072772@svn.freebsd.org> From: Xin LI Date: Tue, 27 May 2014 19:11:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266767 - head/sys/cddl/contrib/opensolaris X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 19:11:59 -0000 Author: delphij Date: Tue May 27 19:11:58 2014 New Revision: 266767 URL: http://svnweb.freebsd.org/changeset/base/266767 Log: Dummy merge r266763. The Illumos change is not applicable to FreeBSD as we solved it differently when importing LZ4 support. Modified: Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) From owner-svn-src-head@FreeBSD.ORG Tue May 27 19:15:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5C90D58; Tue, 27 May 2014 19:15:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9BA92BB6; Tue, 27 May 2014 19:15:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RJF1vN073861; Tue, 27 May 2014 19:15:01 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RJF13M073860; Tue, 27 May 2014 19:15:01 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405271915.s4RJF13M073860@svn.freebsd.org> From: Xin LI Date: Tue, 27 May 2014 19:15:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266768 - head/sys/cddl/contrib/opensolaris X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 19:15:01 -0000 Author: delphij Date: Tue May 27 19:15:01 2014 New Revision: 266768 URL: http://svnweb.freebsd.org/changeset/base/266768 Log: Note r266764 as merged (was committed as r265458). Modified: Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) From owner-svn-src-head@FreeBSD.ORG Tue May 27 19:39:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A6D1372; Tue, 27 May 2014 19:39:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFBBB2DDE; Tue, 27 May 2014 19:39:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RJdvhn083303; Tue, 27 May 2014 19:39:57 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RJdvDJ083301; Tue, 27 May 2014 19:39:57 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201405271939.s4RJdvDJ083301@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 27 May 2014 19:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266770 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 19:39:58 -0000 Author: gavin Date: Tue May 27 19:39:57 2014 New Revision: 266770 URL: http://svnweb.freebsd.org/changeset/base/266770 Log: Add support for the Intel Centrino Wireless-N 105 chipset. MFC after: 2 weeks Relnotes: yes Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwn_devid.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Tue May 27 19:37:18 2014 (r266769) +++ head/sys/dev/iwn/if_iwn.c Tue May 27 19:39:57 2014 (r266770) @@ -109,6 +109,8 @@ static const struct iwn_ident iwn_ident_ { 0x8086, IWN_DID_130_2, "Intel Centrino Wireless-N 130" }, { 0x8086, IWN_DID_100_1, "Intel Centrino Wireless-N 100" }, { 0x8086, IWN_DID_100_2, "Intel Centrino Wireless-N 100" }, + { 0x8086, IWN_DID_105_1, "Intel Centrino Wireless-N 105" }, + { 0x8086, IWN_DID_105_2, "Intel Centrino Wireless-N 105" }, { 0x8086, IWN_DID_135_1, "Intel Centrino Wireless-N 135" }, { 0x8086, IWN_DID_135_2, "Intel Centrino Wireless-N 135" }, { 0x8086, IWN_DID_4965_1, "Intel Wireless WiFi Link 4965" }, @@ -458,7 +460,7 @@ iwn_attach(device_t dev) sc->hw_type = (IWN_READ(sc, IWN_HW_REV) >> IWN_HW_REV_TYPE_SHIFT) & IWN_HW_REV_TYPE_MASK; sc->subdevice_id = pci_get_subdevice(dev); - +printf("hw %d sdid %x\n", sc->hw_type, sc->subdevice_id); /* * 4965 versus 5000 and later have different methods. * Let's set those up first. @@ -986,6 +988,31 @@ iwn_config_specific(struct iwn_softc *sc } break; +/* 105 Series */ +/* XXX: This series will need adjustment for rate. + * see rx_with_siso_diversity in linux kernel + */ + case IWN_DID_105_1: + case IWN_DID_105_2: + switch(sc->subdevice_id) { + case IWN_SDID_105_1: + case IWN_SDID_105_2: + case IWN_SDID_105_3: + //iwl105_bgn_cfg + case IWN_SDID_105_4: + //iwl105_bgn_d_cfg + sc->limits = &iwn2030_sensitivity_limits; + sc->base_params = &iwn2000_base_params; + sc->fwname = "iwn105fw"; + break; + default: + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id :" + "0x%04x rev %d not supported (subdevice)\n", pid, + sc->subdevice_id,sc->hw_type); + return ENOTSUP; + } + break; + /* 135 Series */ /* XXX: This series will need adjustment for rate. * see rx_with_siso_diversity in linux kernel Modified: head/sys/dev/iwn/if_iwn_devid.h ============================================================================== --- head/sys/dev/iwn/if_iwn_devid.h Tue May 27 19:37:18 2014 (r266769) +++ head/sys/dev/iwn/if_iwn_devid.h Tue May 27 19:39:57 2014 (r266770) @@ -228,6 +228,19 @@ /* * -------------------------------------------------------------------------- + * Device ID for 105 Series + * -------------------------------------------------------------------------- + */ +#define IWN_DID_105_1 0x0894 +#define IWN_DID_105_2 0x0895 +/* SubDevice ID */ +#define IWN_SDID_105_1 0x0022 +#define IWN_SDID_105_2 0x0222 +#define IWN_SDID_105_3 0x0422 +#define IWN_SDID_105_4 0x0822 + +/* + * -------------------------------------------------------------------------- * Device ID for 135 Series * -------------------------------------------------------------------------- */ From owner-svn-src-head@FreeBSD.ORG Tue May 27 19:40:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F28114C6; Tue, 27 May 2014 19:40:48 +0000 (UTC) Received: from mailrelay004.isp.belgacom.be (mailrelay004.isp.belgacom.be [195.238.6.170]) by mx1.freebsd.org (Postfix) with ESMTP id 4D2222E52; Tue, 27 May 2014 19:40:46 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AicHAOLphFNbsKWJ/2dsb2JhbABPCoMHrnWUUAGBDRd0giUBAQQBViMFCwsOCgklDyoeBhOIOgwB1UoXjXYEJTMHhEABA5lykyiDOjuBMAIeBg Received: from 137.165-176-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.176.165.137]) by relay.skynet.be with ESMTP; 27 May 2014 21:40:39 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.8/8.14.8) with ESMTP id s4RJecjg004426; Tue, 27 May 2014 21:40:39 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Tue, 27 May 2014 21:40:38 +0200 From: Tijl Coosemans To: Warner Losh Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140527214038.17d00369@kalimero.tijl.coosemans.org> In-Reply-To: <85FABD2B-81BB-4E1A-B61E-4216A144A9DB@bsdimp.com> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> <5380EBA8.1030200@freebsd.org> <20140525011307.142b41ab@kalimero.tijl.coosemans.org> <3CCAFAD3-FABE-40EF-ABF9-815FE5826349@bsdimp.com> <9FE34CE4-C71F-4806-9EF6-30CB1051C62F@bsdimp.com> <20140526113502.239db74d@kalimero.tijl.coosemans.org> <5383522F.30108@freebsd.org> <20140527001811.3e9d3e8d@kalimero.tijl.coosemans.org> <05D1A11D-5985-42EA-84AD-209A8B51D391@bsdimp.com> <20140527093633.0a922e13@kalimero.tijl.coosemans.org> <85FABD2B-81BB-4E1A-B61E-4216A144A9DB@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , Nathan Whitehorn , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 19:40:49 -0000 On Tue, 27 May 2014 07:18:06 -0600 Warner Losh wrote: > On May 27, 2014, at 1:36 AM, Tijl Coosemans wrote: >> On Mon, 26 May 2014 16:31:21 -0600 Warner Losh wrote: >>> On May 26, 2014, at 4:18 PM, Tijl Coosemans wrote:=20 >>>> On Mon, 26 May 2014 09:53:57 -0600 Warner Losh wrote: >>>>> On May 26, 2014, at 8:39 AM, Nathan Whitehorn wrote: >>>>>> On 05/26/14 02:35, Tijl Coosemans wrote: >>>>>>> I suppose you could replace the "x86" in the pkg scheme with i386/a= md64, >>>>>>> but then you'd still be talking about i386:32, amd64:32 and amd64:64 >>>>>>> instead of x86:32, x86:x32 and x86:64. =20 >>>>>=20 >>>>> I suppose you could replace these by ?i386?, ?x32? (or ?amd64x32?) and >>>>> ?amd64? respectively. >>>>=20 >>>> So you're on an amd64 or mips64 system (as indicated by uname) but you >>>> want to use the 32-bit package if possible. How does your script know >>>> about the magic "x32", "amd64x32" or "mipsn32" strings? Wouldn't it be >>>> easier if you could just use "`uname -p`:32?? >>>=20 >>> Oh give me a break. You know it because you know you are building for >>> mipsn32 because that?s what you?ve set MACHINE_ARCH or TARGET_ARCH to, >>=20 >> No, MACHINE_ARCH or TARGET_ARCH is "amd64" or "mips64". You are building >> the 64-bit OS and then decide separately per package whether you want the >> ILP32 one or the LP64 one. >=20 > I think I understand why we?re talking past each other. This bit is wrong. > The LP64 one has a MACHINE_ARCH of ?amd64? or ?mips64?. The ILP32 one wi= ll > have MACHINE_ARCH of ?i386? or ?mips?. The weird ones (ILP32 with 64-bit > registers) will have a different MACHINE_ARCH of ?x32? or ?mipsn32?. > Selection can be done on a case by case basis, but this will be validated > against the supported_abis sysctl. There?s no need to have different names > here, the current standard ones do just fine, are completely sufficient a= nd > all inclusive. This is rather by definition, and your understanding of the > definition sounds flawed. >=20 > While we have limited support for building 32-bit binaries, it is to build > 32-bit binaries for a different MACHINE_ARCH. -m32 on amd64 creates i386 > binaries, not amd64:32 binaries. -m32 on powerpc64 creates powerpc binari= es, > not powerpc64:32 binaries. On mips, -mabi-n32 (I think the option is) is > required to create the mipsn32 binaries. In every single one of these cas= es, > there exists a MACHINE_ARCH that completely describes the binary. amd64:32 is provided by the -mx32 compiler flag. > So I?m still waiting for a use case that requires the new names. One has > not been articulated, and I don?t think one actually exists. Imagine you've built a system with MACHINE_ARCH amd64 and one with MACHINE_ARCH mips64. Now you want to populate these systems with a list of packages for which you wrote a script. These systems each support 2 ABIs: a native 64-bit one (amd64 and mips64) and a native 32-bit one (x32 and mipsn32). Both are native in the sense that they make full use of the instruction set. This is not like i386 on amd64 or mips o32 on mips64 because those are more like compat shims that operate under special (crippled) cpu modes that nobody uses unless they're stuck with old code. Both our ABIs on the other hand are native and equally valid and which one to use for a particular package depends entirely on the use case. If your use case requires more than 4G of address space you'll have to use the 64-bit package, otherwise you can use the 32-bit package which, depending on how pointer heavy the code is, may give a performance benefit. You make this choice for each of the packages in your list and add that information to your script. Now let's work with Nathan's patch which uses the following string to identify the pkg repository to fetch packages from: `uname -s`:`uname -r | cut -f 1 -d .`:`uname -p` On our two systems that would be FreeBSD:11:amd64 and FreeBSD:11:mips64. Now if your script has to install the 32-bit version of a package how can it go from those two strings to FreeBSD:11:x32 or FreeBSD:11:mipsn32 without a lookup table? I say, you can more easily indicate whether you want the 32-bit or 64-bit package by appending :32 or :64 to the original strings, so FreeBSD:11:amd64:32 and FreeBSD:11:mips64:32. Like I said in a reply to Nathan's patch, pkg could default to :32 or :64 for every arch so it can be left out in many cases. FreeBSD:11:i386 would then be equivalent to FreeBSD:11:i386:32, FreeBSD:11:amd64 to FreeBSD:11:amd64:64, etc. This also does not preclude the existence of a mipsn32 MACHINE_ARCH in case you want to build a pure mipsn32 system (including the kernel), but I wonder how many people would use that if it is possible to have a mips64 system run n32 binaries. I don't think many people would run a pure x32 system (with x32 kernel) so I don't see the need to have an "x32" value for MACHINE_ARCH (or TARGET_ARCH). From owner-svn-src-head@FreeBSD.ORG Tue May 27 19:46:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 220058D9; Tue, 27 May 2014 19:46:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E66D02EB4; Tue, 27 May 2014 19:46:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RJkCKj087475; Tue, 27 May 2014 19:46:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RJkBGX087468; Tue, 27 May 2014 19:46:11 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405271946.s4RJkBGX087468@svn.freebsd.org> From: Xin LI Date: Tue, 27 May 2014 19:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266771 - in head: cddl/contrib/opensolaris/cmd/zfs sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 19:46:13 -0000 Author: delphij Date: Tue May 27 19:46:11 2014 New Revision: 266771 URL: http://svnweb.freebsd.org/changeset/base/266771 Log: MFV r266766: Add a new zfs property, "redundant_metadata" which can have values "all" or "most". The default will be "all", which is the current behavior. When set to all, ZFS stores an extra copy of all metadata. If a single on-disk block is corrupt, at worst a single block of user data (which is recordsize bytes long) can be lost. Setting to "most" will cause us to only store 1 copy of level-1 indirect blocks of user data files. This can improve performance of random writes, because less metadata has to be written. In practice, at worst about 100 blocks (of recordsize bytes each) of user data can be lost if a single on-disk block is corrupt. The exact behavior of which metadata blocks are stored redundantly may change in future releases. Illumos issue: 3835 zfs need not store 2 copies of all metadata MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue May 27 19:39:57 2014 (r266770) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Tue May 27 19:46:11 2014 (r266771) @@ -18,7 +18,7 @@ .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. -.\" Copyright (c) 2013 by Delphix. All rights reserved. +.\" Copyright (c) 2014 by Delphix. All rights reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" Copyright (c) 2012, Glen Barber .\" Copyright (c) 2012, Bryan Drewery @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 23, 2014 +.Dd May 27, 2014 .Dt ZFS 8 .Os .Sh NAME @@ -1193,6 +1193,53 @@ affects only files created afterward; ex .Pp This property can also be referred to by its shortened column name, .Sy recsize . +.It Sy redundant_metadata Ns = Ns Cm all | most +Controls what types of metadata are stored redundantly. +ZFS stores an extra copy of metadata, so that if a single block is corrupted, +the amount of user data lost is limited. +This extra copy is in addition to any redundancy provided at the pool level +.Pq e.g. by mirroring or RAID-Z , +and is in addition to an extra copy specified by the +.Sy copies +property +.Pq up to a total of 3 copies . +For example if the pool is mirrored, +.Cm copies Ns = Ns Ar 2 , +and +.Cm redundant_metadata Ns = Ns Ar most , +then ZFS +stores 6 copies of most metadata, and 4 copies of data and some +metadata. +.Pp +When set to +.Cm all , +ZFS stores an extra copy of all metadata. +If a +single on-disk block is corrupt, at worst a single block of user data +.Po which is +.Cm recordsize +bytes long +can be lost. +.Pc +.Pp +When set to +.Cm most , +ZFS stores an extra copy of most types of +metadata. +This can improve performance of random writes, because less +metadata must be written. +In practice, at worst about 100 blocks +.Po of +.Cm recordsize +bytes each +.Pc +of user data can be lost if a single +on-disk block is corrupt. +The exact behavior of which metadata blocks +are stored redundantly may change in future releases. +.Pp +The default value is +.Cm all . .It Sy refquota Ns = Ns Ar size | Cm none Limits the amount of space a dataset can consume. This property enforces a hard limit on the amount of space used. This hard limit does not include space used Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue May 27 19:39:57 2014 (r266770) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue May 27 19:46:11 2014 (r266771) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -206,7 +206,18 @@ zfs_prop_init(void) { NULL } }; + static zprop_index_t redundant_metadata_table[] = { + { "all", ZFS_REDUNDANT_METADATA_ALL }, + { "most", ZFS_REDUNDANT_METADATA_MOST }, + { NULL } + }; + /* inherit index properties */ + zprop_register_index(ZFS_PROP_REDUNDANT_METADATA, "redundant_metadata", + ZFS_REDUNDANT_METADATA_ALL, + PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, + "all | most", "REDUND_MD", + redundant_metadata_table); zprop_register_index(ZFS_PROP_SYNC, "sync", ZFS_SYNC_STANDARD, PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "standard | always | disabled", "SYNC", Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue May 27 19:39:57 2014 (r266770) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue May 27 19:46:11 2014 (r266771) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ /* Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ /* Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -1630,6 +1630,12 @@ TUNABLE_INT("vfs.zfs.mdcomp_disable", &z SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_disable, CTLFLAG_RW, &zfs_mdcomp_disable, 0, "Disable metadata compression"); +/* + * When the "redundant_metadata" property is set to "most", only indirect + * blocks of this level and higher will have an additional ditto block. + */ +int zfs_redundant_metadata_most_ditto_level = 2; + void dmu_write_policy(objset_t *os, dnode_t *dn, int level, int wp, zio_prop_t *zp) { @@ -1669,6 +1675,13 @@ dmu_write_policy(objset_t *os, dnode_t * if (zio_checksum_table[checksum].ci_correctable < 1 || zio_checksum_table[checksum].ci_eck) checksum = ZIO_CHECKSUM_FLETCHER_4; + + if (os->os_redundant_metadata == ZFS_REDUNDANT_METADATA_ALL || + (os->os_redundant_metadata == + ZFS_REDUNDANT_METADATA_MOST && + (level >= zfs_redundant_metadata_most_ditto_level || + DMU_OT_IS_METADATA(type) || (wp & WP_SPILL)))) + copies++; } else if (wp & WP_NOFILL) { ASSERT(level == 0); @@ -1716,7 +1729,7 @@ dmu_write_policy(objset_t *os, dnode_t * zp->zp_compress = compress; zp->zp_type = (wp & WP_SPILL) ? dn->dn_bonustype : type; zp->zp_level = level; - zp->zp_copies = MIN(copies + ismd, spa_max_replication(os->os_spa)); + zp->zp_copies = MIN(copies, spa_max_replication(os->os_spa)); zp->zp_dedup = dedup; zp->zp_dedup_verify = dedup && dedup_verify; zp->zp_nopwrite = nopwrite; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Tue May 27 19:39:57 2014 (r266770) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Tue May 27 19:46:11 2014 (r266771) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -115,13 +115,13 @@ dmu_objset_id(objset_t *os) return (ds ? ds->ds_object : 0); } -uint64_t +zfs_sync_type_t dmu_objset_syncprop(objset_t *os) { return (os->os_sync); } -uint64_t +zfs_logbias_op_t dmu_objset_logbias(objset_t *os) { return (os->os_logbias); @@ -230,6 +230,20 @@ sync_changed_cb(void *arg, uint64_t newv } static void +redundant_metadata_changed_cb(void *arg, uint64_t newval) +{ + objset_t *os = arg; + + /* + * Inheritance and range checking should have been done by now. + */ + ASSERT(newval == ZFS_REDUNDANT_METADATA_ALL || + newval == ZFS_REDUNDANT_METADATA_MOST); + + os->os_redundant_metadata = newval; +} + +static void logbias_changed_cb(void *arg, uint64_t newval) { objset_t *os = arg; @@ -364,6 +378,12 @@ dmu_objset_open_impl(spa_t *spa, dsl_dat zfs_prop_to_name(ZFS_PROP_SYNC), sync_changed_cb, os); } + if (err == 0) { + err = dsl_prop_register(ds, + zfs_prop_to_name( + ZFS_PROP_REDUNDANT_METADATA), + redundant_metadata_changed_cb, os); + } } if (err != 0) { VERIFY(arc_buf_remove_ref(os->os_phys_buf, @@ -377,9 +397,9 @@ dmu_objset_open_impl(spa_t *spa, dsl_dat os->os_compress = ZIO_COMPRESS_LZJB; os->os_copies = spa_max_replication(spa); os->os_dedup_checksum = ZIO_CHECKSUM_OFF; - os->os_dedup_verify = 0; - os->os_logbias = 0; - os->os_sync = 0; + os->os_dedup_verify = B_FALSE; + os->os_logbias = ZFS_LOGBIAS_LATENCY; + os->os_sync = ZFS_SYNC_STANDARD; os->os_primary_cache = ZFS_CACHE_ALL; os->os_secondary_cache = ZFS_CACHE_ALL; } @@ -622,6 +642,9 @@ dmu_objset_evict(objset_t *os) VERIFY0(dsl_prop_unregister(ds, zfs_prop_to_name(ZFS_PROP_SYNC), sync_changed_cb, os)); + VERIFY0(dsl_prop_unregister(ds, + zfs_prop_to_name(ZFS_PROP_REDUNDANT_METADATA), + redundant_metadata_changed_cb, os)); } VERIFY0(dsl_prop_unregister(ds, zfs_prop_to_name(ZFS_PROP_PRIMARYCACHE), Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Tue May 27 19:39:57 2014 (r266770) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Tue May 27 19:46:11 2014 (r266771) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright 2013 DEY Storage Systems, Inc. @@ -746,8 +746,8 @@ extern struct dsl_dataset *dmu_objset_ds extern void dmu_objset_name(objset_t *os, char *buf); extern dmu_objset_type_t dmu_objset_type(objset_t *os); extern uint64_t dmu_objset_id(objset_t *os); -extern uint64_t dmu_objset_syncprop(objset_t *os); -extern uint64_t dmu_objset_logbias(objset_t *os); +extern zfs_sync_type_t dmu_objset_syncprop(objset_t *os); +extern zfs_logbias_op_t dmu_objset_logbias(objset_t *os); extern int dmu_snapshot_list_next(objset_t *os, int namelen, char *name, uint64_t *id, uint64_t *offp, boolean_t *case_conflict); extern int dmu_snapshot_realname(objset_t *os, char *name, char *real, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Tue May 27 19:39:57 2014 (r266770) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Tue May 27 19:46:11 2014 (r266771) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ @@ -85,15 +85,16 @@ struct objset { zilog_t *os_zil; /* can change, under dsl_dir's locks: */ - uint8_t os_checksum; - uint8_t os_compress; + enum zio_checksum os_checksum; + enum zio_compress os_compress; uint8_t os_copies; - uint8_t os_dedup_checksum; - uint8_t os_dedup_verify; - uint8_t os_logbias; - uint8_t os_primary_cache; - uint8_t os_secondary_cache; - uint8_t os_sync; + enum zio_checksum os_dedup_checksum; + boolean_t os_dedup_verify; + zfs_logbias_op_t os_logbias; + zfs_cache_type_t os_primary_cache; + zfs_cache_type_t os_secondary_cache; + zfs_sync_type_t os_sync; + zfs_redundant_metadata_type_t os_redundant_metadata; /* no lock needed: */ struct dmu_tx *os_synctx; /* XXX sketchy */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue May 27 19:39:57 2014 (r266770) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue May 27 19:46:11 2014 (r266771) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2012, Martin Matuska . All rights reserved. @@ -150,6 +150,7 @@ typedef enum { ZFS_PROP_SNAPSHOT_LIMIT, ZFS_PROP_FILESYSTEM_COUNT, ZFS_PROP_SNAPSHOT_COUNT, + ZFS_PROP_REDUNDANT_METADATA, ZFS_NUM_PROPS } zfs_prop_t; @@ -349,6 +350,11 @@ typedef enum { ZFS_VOLMODE_NONE = 3 } zfs_volmode_t; +typedef enum { + ZFS_REDUNDANT_METADATA_ALL, + ZFS_REDUNDANT_METADATA_MOST +} zfs_redundant_metadata_type_t; + /* * On-disk version number. */ From owner-svn-src-head@FreeBSD.ORG Tue May 27 19:47:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 528FBA25; Tue, 27 May 2014 19:47:01 +0000 (UTC) Received: from mail-qg0-x229.google.com (mail-qg0-x229.google.com [IPv6:2607:f8b0:400d:c04::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FB9C2EC1; Tue, 27 May 2014 19:47:00 +0000 (UTC) Received: by mail-qg0-f41.google.com with SMTP id j5so14891141qga.28 for ; Tue, 27 May 2014 12:46:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=eNwMT4Ncj2Kqez1fM2Ph5Px0BWQ8wsK4hFuzWn6y/PI=; b=de9+SFwsiesr5eLdf1c6CpppEXfCnENuJkZRgvFP7uMKjVTvpBzO36Dtu2XgXPAXgw OBBqvHjMVH+WoRu/fCZUELPhTC669RRM6IfJ2BBN7Fp3M0mYPXnsGM9KPfruvRCL+an7 1YzGWiwAk9SPGMtwLkKDZwUQBXg8nmaOfObyE3E235fQzJCcME+OKZkAtC6WCuYES0Un yb77884CZxZDPi2z63V5oF+DdT8eJFlQEwiRTBu2adPD6lW5zOs0G+dNjRYuLdlSJsDz W8nIkqS2Ji/JewGLfUD7y4gfrDV0SHydvH6yRnglmwxKG8iqLIYmfDd1IAc/w26RtrF0 m2rQ== MIME-Version: 1.0 X-Received: by 10.224.51.2 with SMTP id b2mr47313023qag.49.1401220019592; Tue, 27 May 2014 12:46:59 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.191.201 with HTTP; Tue, 27 May 2014 12:46:59 -0700 (PDT) In-Reply-To: <201405271939.s4RJdvDJ083301@svn.freebsd.org> References: <201405271939.s4RJdvDJ083301@svn.freebsd.org> Date: Tue, 27 May 2014 12:46:59 -0700 X-Google-Sender-Auth: JABFj_pATKeW_BAvHqt25cYpWz0 Message-ID: Subject: Re: svn commit: r266770 - head/sys/dev/iwn From: Adrian Chadd To: Gavin Atkinson Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 19:47:01 -0000 woo! There's some debugging printf left in. Maybe turn it into device_printf() and hide it behind bootverbose? Is this all the linux driver did? Are the 2030 parameters okay? -a On 27 May 2014 12:39, Gavin Atkinson wrote: > Author: gavin > Date: Tue May 27 19:39:57 2014 > New Revision: 266770 > URL: http://svnweb.freebsd.org/changeset/base/266770 > > Log: > Add support for the Intel Centrino Wireless-N 105 chipset. > > MFC after: 2 weeks > Relnotes: yes > > Modified: > head/sys/dev/iwn/if_iwn.c > head/sys/dev/iwn/if_iwn_devid.h > > Modified: head/sys/dev/iwn/if_iwn.c > ============================================================================== > --- head/sys/dev/iwn/if_iwn.c Tue May 27 19:37:18 2014 (r266769) > +++ head/sys/dev/iwn/if_iwn.c Tue May 27 19:39:57 2014 (r266770) > @@ -109,6 +109,8 @@ static const struct iwn_ident iwn_ident_ > { 0x8086, IWN_DID_130_2, "Intel Centrino Wireless-N 130" }, > { 0x8086, IWN_DID_100_1, "Intel Centrino Wireless-N 100" }, > { 0x8086, IWN_DID_100_2, "Intel Centrino Wireless-N 100" }, > + { 0x8086, IWN_DID_105_1, "Intel Centrino Wireless-N 105" }, > + { 0x8086, IWN_DID_105_2, "Intel Centrino Wireless-N 105" }, > { 0x8086, IWN_DID_135_1, "Intel Centrino Wireless-N 135" }, > { 0x8086, IWN_DID_135_2, "Intel Centrino Wireless-N 135" }, > { 0x8086, IWN_DID_4965_1, "Intel Wireless WiFi Link 4965" }, > @@ -458,7 +460,7 @@ iwn_attach(device_t dev) > sc->hw_type = (IWN_READ(sc, IWN_HW_REV) >> IWN_HW_REV_TYPE_SHIFT) > & IWN_HW_REV_TYPE_MASK; > sc->subdevice_id = pci_get_subdevice(dev); > - > +printf("hw %d sdid %x\n", sc->hw_type, sc->subdevice_id); > /* > * 4965 versus 5000 and later have different methods. > * Let's set those up first. > @@ -986,6 +988,31 @@ iwn_config_specific(struct iwn_softc *sc > } > break; > > +/* 105 Series */ > +/* XXX: This series will need adjustment for rate. > + * see rx_with_siso_diversity in linux kernel > + */ > + case IWN_DID_105_1: > + case IWN_DID_105_2: > + switch(sc->subdevice_id) { > + case IWN_SDID_105_1: > + case IWN_SDID_105_2: > + case IWN_SDID_105_3: > + //iwl105_bgn_cfg > + case IWN_SDID_105_4: > + //iwl105_bgn_d_cfg > + sc->limits = &iwn2030_sensitivity_limits; > + sc->base_params = &iwn2000_base_params; > + sc->fwname = "iwn105fw"; > + break; > + default: > + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id :" > + "0x%04x rev %d not supported (subdevice)\n", pid, > + sc->subdevice_id,sc->hw_type); > + return ENOTSUP; > + } > + break; > + > /* 135 Series */ > /* XXX: This series will need adjustment for rate. > * see rx_with_siso_diversity in linux kernel > > Modified: head/sys/dev/iwn/if_iwn_devid.h > ============================================================================== > --- head/sys/dev/iwn/if_iwn_devid.h Tue May 27 19:37:18 2014 (r266769) > +++ head/sys/dev/iwn/if_iwn_devid.h Tue May 27 19:39:57 2014 (r266770) > @@ -228,6 +228,19 @@ > > /* > * -------------------------------------------------------------------------- > + * Device ID for 105 Series > + * -------------------------------------------------------------------------- > + */ > +#define IWN_DID_105_1 0x0894 > +#define IWN_DID_105_2 0x0895 > +/* SubDevice ID */ > +#define IWN_SDID_105_1 0x0022 > +#define IWN_SDID_105_2 0x0222 > +#define IWN_SDID_105_3 0x0422 > +#define IWN_SDID_105_4 0x0822 > + > +/* > + * -------------------------------------------------------------------------- > * Device ID for 135 Series > * -------------------------------------------------------------------------- > */ > From owner-svn-src-head@FreeBSD.ORG Tue May 27 19:56:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DB2CDD3; Tue, 27 May 2014 19:56:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A8622F9B; Tue, 27 May 2014 19:56:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RJu2Vv092181; Tue, 27 May 2014 19:56:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RJu2Mg092180; Tue, 27 May 2014 19:56:02 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405271956.s4RJu2Mg092180@svn.freebsd.org> From: John Baldwin Date: Tue, 27 May 2014 19:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266772 - head/sys/dev/firewire X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 19:56:02 -0000 Author: jhb Date: Tue May 27 19:56:02 2014 New Revision: 266772 URL: http://svnweb.freebsd.org/changeset/base/266772 Log: Various cleanups and fixes: - Switch from timeout() to callout_*() for per-request timers. - Use device_find_child() in the identify routine. - Use device_printf() instead of passing device_get_nameunit() to printf(). - Expand the SBP_LOCK coverage simplifying the locking. - Uninline STAILQ_FOREACH_SAFE(). Tested by: sbruno Modified: head/sys/dev/firewire/sbp.c Modified: head/sys/dev/firewire/sbp.c ============================================================================== --- head/sys/dev/firewire/sbp.c Tue May 27 19:46:11 2014 (r266771) +++ head/sys/dev/firewire/sbp.c Tue May 27 19:56:02 2014 (r266772) @@ -177,7 +177,7 @@ struct sbp_ocb { struct sbp_dev *sdev; int flags; /* XXX should be removed */ bus_dmamap_t dmamap; - struct callout_handle timeout_ch; + struct callout timer; }; #define OCB_ACT_MGM 0 @@ -250,8 +250,9 @@ struct sbp_softc { int flags; struct mtx mtx; }; -#define SBP_LOCK(sbp) mtx_lock(&(sbp)->mtx) -#define SBP_UNLOCK(sbp) mtx_unlock(&(sbp)->mtx) +#define SBP_LOCK(sbp) mtx_lock(&(sbp)->mtx) +#define SBP_UNLOCK(sbp) mtx_unlock(&(sbp)->mtx) +#define SBP_LOCK_ASSERT(sbp) mtx_assert(&(sbp)->mtx, MA_OWNED) static void sbp_post_explore (void *); static void sbp_recv (struct fw_xfer *); @@ -265,7 +266,6 @@ static void sbp_execute_ocb (void *, bu static void sbp_free_ocb (struct sbp_dev *, struct sbp_ocb *); static void sbp_abort_ocb (struct sbp_ocb *, int); static void sbp_abort_all_ocbs (struct sbp_dev *, int); -static struct fw_xfer * sbp_write_cmd_locked (struct sbp_dev *, int, int); static struct fw_xfer * sbp_write_cmd (struct sbp_dev *, int, int); static struct sbp_ocb * sbp_get_ocb (struct sbp_dev *); static struct sbp_ocb * sbp_enqueue_ocb (struct sbp_dev *, struct sbp_ocb *); @@ -337,7 +337,8 @@ SBP_DEBUG(0) printf("sbp_identify\n"); END_DEBUG - BUS_ADD_CHILD(parent, 0, "sbp", device_get_unit(parent)); + if (device_find_child(parent, "sbp", -1) == NULL) + BUS_ADD_CHILD(parent, 0, "sbp", -1); } /* @@ -346,17 +347,11 @@ END_DEBUG static int sbp_probe(device_t dev) { - device_t pa; SBP_DEBUG(0) printf("sbp_probe\n"); END_DEBUG - pa = device_get_parent(dev); - if(device_get_unit(dev) != device_get_unit(pa)){ - return(ENXIO); - } - device_set_desc(dev, "SBP-2/SCSI over FireWire"); #if 0 @@ -460,6 +455,7 @@ sbp_alloc_lun(struct sbp_target *target) int maxlun, lun, i; sbp = target->sbp; + SBP_LOCK_ASSERT(sbp); crom_init_context(&cc, target->fwdev->csrrom); /* XXX shoud parse appropriate unit directories only */ maxlun = -1; @@ -476,8 +472,7 @@ END_DEBUG crom_next(&cc); } if (maxlun < 0) - printf("%s:%d no LUN found\n", - device_get_nameunit(target->sbp->fd.dev), + device_printf(target->sbp->fd.dev, "%d no LUN found\n", target->target_id); maxlun ++; @@ -548,7 +543,7 @@ END_DEBUG sdev->lun_id = lun; sdev->target = target; STAILQ_INIT(&sdev->ocbs); - CALLOUT_INIT(&sdev->login_callout); + callout_init_mtx(&sdev->login_callout, &sbp->mtx, 0); sdev->status = SBP_DEV_RESET; new = 1; snprintf(sdev->bustgtlun, 32, "%s:%d:%d", @@ -592,7 +587,7 @@ END_DEBUG /* XXX */ goto next; } - callout_handle_init(&ocb->timeout_ch); + callout_init_mtx(&ocb->timer, &sbp->mtx, 0); sbp_free_ocb(sdev, ocb); } next: @@ -648,8 +643,8 @@ END_DEBUG STAILQ_INIT(&target->xferlist); target->n_xfer = 0; STAILQ_INIT(&target->mgm_ocb_queue); - CALLOUT_INIT(&target->mgm_ocb_timeout); - CALLOUT_INIT(&target->scan_callout); + callout_init_mtx(&target->mgm_ocb_timeout, &sbp->mtx, 0); + callout_init_mtx(&target->scan_callout, &sbp->mtx, 0); target->luns = NULL; target->num_lun = 0; @@ -693,6 +688,7 @@ static void sbp_login_callout(void *arg) { struct sbp_dev *sdev = (struct sbp_dev *)arg; + SBP_LOCK_ASSERT(sdev->target->sbp); sbp_mgm_orb(sdev, ORB_FUN_LGI, NULL); } @@ -737,6 +733,7 @@ SBP_DEBUG(1) END_DEBUG sbp = target->sbp; + SBP_LOCK_ASSERT(sbp); sbp_alloc_lun(target); /* XXX untimeout mgm_ocb and dequeue */ @@ -746,10 +743,8 @@ END_DEBUG continue; if (alive && (sdev->status != SBP_DEV_DEAD)) { if (sdev->path != NULL) { - SBP_LOCK(sbp); xpt_freeze_devq(sdev->path, 1); sdev->freeze ++; - SBP_UNLOCK(sbp); } sbp_probe_lun(sdev); sbp_show_sdev_info(sdev); @@ -778,10 +773,8 @@ SBP_DEBUG(0) __func__); END_DEBUG if (sdev->path) { - SBP_LOCK(sbp); xpt_freeze_devq(sdev->path, 1); sdev->freeze ++; - SBP_UNLOCK(sbp); } sdev->status = SBP_DEV_RETRY; sbp_cam_detach_sdev(sdev); @@ -810,13 +803,13 @@ sbp_post_busreset(void *arg) SBP_DEBUG(0) printf("sbp_post_busreset\n"); END_DEBUG + SBP_LOCK(sbp); if ((sbp->sim->flags & SIMQ_FREEZED) == 0) { - SBP_LOCK(sbp); xpt_freeze_simq(sbp->sim, /*count*/1); sbp->sim->flags |= SIMQ_FREEZED; - SBP_UNLOCK(sbp); } microtime(&sbp->last_busreset); + SBP_UNLOCK(sbp); } static void @@ -837,6 +830,7 @@ END_DEBUG if (sbp_cold > 0) sbp_cold --; + SBP_LOCK(sbp); #if 0 /* * XXX don't let CAM the bus rest. @@ -887,7 +881,6 @@ END_DEBUG if (target->num_lun == 0) sbp_free_target(target); } - SBP_LOCK(sbp); xpt_release_simq(sbp->sim, /*run queue*/TRUE); sbp->sim->flags &= ~SIMQ_FREEZED; SBP_UNLOCK(sbp); @@ -896,16 +889,15 @@ END_DEBUG #if NEED_RESPONSE static void sbp_loginres_callback(struct fw_xfer *xfer){ - int s; struct sbp_dev *sdev; sdev = (struct sbp_dev *)xfer->sc; SBP_DEBUG(1) device_printf(sdev->target->sbp->fd.dev,"%s\n", __func__); END_DEBUG /* recycle */ - s = splfw(); + SBP_LOCK(sdev->target->sbp); STAILQ_INSERT_TAIL(&sdev->target->sbp->fwb.xferlist, xfer, link); - splx(s); + SBP_UNLOCK(sdev->target->sbp); return; } #endif @@ -914,15 +906,11 @@ static __inline void sbp_xfer_free(struct fw_xfer *xfer) { struct sbp_dev *sdev; - int s; sdev = (struct sbp_dev *)xfer->sc; fw_xfer_unload(xfer); - s = splfw(); - SBP_LOCK(sdev->target->sbp); + SBP_LOCK_ASSERT(sdev->target->sbp); STAILQ_INSERT_TAIL(&sdev->target->xferlist, xfer, link); - SBP_UNLOCK(sdev->target->sbp); - splx(s); } static void @@ -937,11 +925,13 @@ sbp_reset_start_callback(struct fw_xfer "%s: %s failed: resp=%d\n", __func__, sdev->bustgtlun, xfer->resp); } + SBP_LOCK(target->sbp); for (i = 0; i < target->num_lun; i++) { tsdev = target->luns[i]; if (tsdev != NULL && tsdev->status == SBP_DEV_LOGIN) sbp_login(tsdev); } + SBP_UNLOCK(target->sbp); } static void @@ -977,8 +967,9 @@ SBP_DEBUG(1) "%s:%s\n", __func__, sdev->bustgtlun); END_DEBUG resp = xfer->resp; + SBP_LOCK(sdev->target->sbp); sbp_xfer_free(xfer); - return; + SBP_UNLOCK(sdev->target->sbp); } static struct sbp_dev * @@ -1003,6 +994,7 @@ sbp_cam_scan_lun(struct cam_periph *peri sdev = (struct sbp_dev *) ccb->ccb_h.ccb_sdev_ptr; target = sdev->target; + SBP_LOCK_ASSERT(target->sbp); SBP_DEBUG(0) device_printf(sdev->target->sbp->fd.dev, "%s:%s\n", __func__, sdev->bustgtlun); @@ -1033,6 +1025,7 @@ sbp_cam_scan_target(void *arg) struct sbp_dev *sdev; union ccb *ccb; + SBP_LOCK_ASSERT(target->sbp); sdev = sbp_next_dev(target, 0); if (sdev == NULL) { printf("sbp_cam_scan_target: nothing to do for target%d\n", @@ -1056,11 +1049,9 @@ END_DEBUG ccb->ccb_h.ccb_sdev_ptr = sdev; /* The scan is in progress now. */ - SBP_LOCK(target->sbp); xpt_action(ccb); xpt_release_devq(sdev->path, sdev->freeze, TRUE); sdev->freeze = 1; - SBP_UNLOCK(target->sbp); } static __inline void @@ -1081,6 +1072,7 @@ sbp_do_attach(struct fw_xfer *xfer) sdev = (struct sbp_dev *)xfer->sc; target = sdev->target; sbp = target->sbp; + SBP_LOCK(sbp); SBP_DEBUG(0) device_printf(sdev->target->sbp->fd.dev, "%s:%s\n", __func__, sdev->bustgtlun); @@ -1095,15 +1087,16 @@ END_DEBUG /* * Let CAM scan the bus if we are in the boot process. * XXX xpt_scan_bus cannot detect LUN larger than 0 - * if LUN 0 doesn't exists. + * if LUN 0 doesn't exist. */ if (sbp_cold > 0) { sdev->status = SBP_DEV_ATTACHED; + SBP_UNLOCK(sbp); return; } sbp_scan_dev(sdev); - return; + SBP_UNLOCK(sbp); } static void @@ -1121,13 +1114,13 @@ END_DEBUG "%s:%s resp=%d\n", __func__, sdev->bustgtlun, xfer->resp); } + SBP_LOCK(sdev->target->sbp); sbp_xfer_free(xfer); if (sdev->path) { - SBP_LOCK(sdev->target->sbp); xpt_release_devq(sdev->path, sdev->freeze, TRUE); sdev->freeze = 0; - SBP_UNLOCK(sdev->target->sbp); } + SBP_UNLOCK(sdev->target->sbp); } static void @@ -1136,6 +1129,7 @@ sbp_agent_reset(struct sbp_dev *sdev) struct fw_xfer *xfer; struct fw_pkt *fp; + SBP_LOCK_ASSERT(sdev->target->sbp); SBP_DEBUG(0) device_printf(sdev->target->sbp->fd.dev, "%s:%s\n", __func__, sdev->bustgtlun); @@ -1163,8 +1157,10 @@ SBP_DEBUG(1) device_printf(sdev->target->sbp->fd.dev, "%s:%s\n", __func__, sdev->bustgtlun); END_DEBUG + SBP_LOCK(sdev->target->sbp); sbp_xfer_free(xfer); sbp_agent_reset(sdev); + SBP_UNLOCK(sdev->target->sbp); } static void @@ -1200,9 +1196,9 @@ END_DEBUG /* XXX */ printf("%s: xfer->resp = %d\n", __func__, xfer->resp); } + SBP_LOCK(sdev->target->sbp); sbp_xfer_free(xfer); - SBP_LOCK(sdev->target->sbp); sdev->flags &= ~ORB_POINTER_ACTIVE; if ((sdev->flags & ORB_POINTER_NEED) != 0) { @@ -1229,7 +1225,7 @@ SBP_DEBUG(1) (uint32_t)ocb->bus_addr); END_DEBUG - mtx_assert(&sdev->target->sbp->mtx, MA_OWNED); + SBP_LOCK_ASSERT(sdev->target->sbp); if ((sdev->flags & ORB_POINTER_ACTIVE) != 0) { SBP_DEBUG(0) @@ -1240,7 +1236,7 @@ END_DEBUG } sdev->flags |= ORB_POINTER_ACTIVE; - xfer = sbp_write_cmd_locked(sdev, FWTCODE_WREQB, 0x08); + xfer = sbp_write_cmd(sdev, FWTCODE_WREQB, 0x08); if (xfer == NULL) return; xfer->hand = sbp_orb_pointer_callback; @@ -1252,18 +1248,11 @@ END_DEBUG htonl(((sdev->target->sbp->fd.fc->nodeid | FWLOCALBUS )<< 16)); xfer->send.payload[1] = htonl((uint32_t)ocb->bus_addr); - /* - * sbp_xfer_free() will attempt to acquire - * the SBP lock on entrance. Also, this removes - * a LOR between the firewire layer and sbp - */ - SBP_UNLOCK(sdev->target->sbp); - if(fw_asyreq(xfer->fc, -1, xfer) != 0){ - sbp_xfer_free(xfer); - ocb->ccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(ocb->ccb); + if (fw_asyreq(xfer->fc, -1, xfer) != 0) { + sbp_xfer_free(xfer); + ocb->ccb->ccb_h.status = CAM_REQ_INVALID; + xpt_done(ocb->ccb); } - SBP_LOCK(sdev->target->sbp); } static void @@ -1281,15 +1270,14 @@ END_DEBUG device_printf(sdev->target->sbp->fd.dev, "%s: xfer->resp = %d\n", __func__, xfer->resp); } + SBP_LOCK(sdev->target->sbp); sbp_xfer_free(xfer); sdev->flags &= ~ORB_DOORBELL_ACTIVE; if ((sdev->flags & ORB_DOORBELL_NEED) != 0) { sdev->flags &= ~ORB_DOORBELL_NEED; - SBP_LOCK(sdev->target->sbp); sbp_doorbell(sdev); - SBP_UNLOCK(sdev->target->sbp); } - return; + SBP_UNLOCK(sdev->target->sbp); } static void @@ -1307,7 +1295,7 @@ END_DEBUG return; } sdev->flags |= ORB_DOORBELL_ACTIVE; - xfer = sbp_write_cmd_locked(sdev, FWTCODE_WREQQ, 0x10); + xfer = sbp_write_cmd(sdev, FWTCODE_WREQQ, 0x10); if (xfer == NULL) return; xfer->hand = sbp_doorbell_callback; @@ -1317,28 +1305,25 @@ END_DEBUG } static struct fw_xfer * -sbp_write_cmd_locked(struct sbp_dev *sdev, int tcode, int offset) +sbp_write_cmd(struct sbp_dev *sdev, int tcode, int offset) { struct fw_xfer *xfer; struct fw_pkt *fp; struct sbp_target *target; - int s, new = 0; + int new = 0; - mtx_assert(&sdev->target->sbp->mtx, MA_OWNED); + SBP_LOCK_ASSERT(sdev->target->sbp); target = sdev->target; - s = splfw(); xfer = STAILQ_FIRST(&target->xferlist); if (xfer == NULL) { if (target->n_xfer > 5 /* XXX */) { printf("sbp: no more xfer for this target\n"); - splx(s); return(NULL); } xfer = fw_xfer_alloc_buf(M_SBP, 8, 0); if(xfer == NULL){ printf("sbp: fw_xfer_alloc_buf failed\n"); - splx(s); return NULL; } target->n_xfer ++; @@ -1348,7 +1333,6 @@ sbp_write_cmd_locked(struct sbp_dev *sde } else { STAILQ_REMOVE_HEAD(&target->xferlist, link); } - splx(s); if (new) { xfer->recv.pay_len = 0; @@ -1371,20 +1355,6 @@ sbp_write_cmd_locked(struct sbp_dev *sde fp->mode.wreqq.dst = FWLOCALBUS | sdev->target->fwdev->dst; return xfer; - -} - -static struct fw_xfer * -sbp_write_cmd(struct sbp_dev *sdev, int tcode, int offset) -{ - struct sbp_softc *sbp = sdev->target->sbp; - struct fw_xfer *xfer; - - SBP_LOCK(sbp); - xfer = sbp_write_cmd_locked(sdev, tcode, offset); - SBP_UNLOCK(sbp); - - return (xfer); } static void @@ -1394,31 +1364,24 @@ sbp_mgm_orb(struct sbp_dev *sdev, int fu struct fw_pkt *fp; struct sbp_ocb *ocb; struct sbp_target *target; - int s, nid; + int nid; target = sdev->target; nid = target->sbp->fd.fc->nodeid | FWLOCALBUS; - s = splfw(); - SBP_LOCK(target->sbp); + SBP_LOCK_ASSERT(target->sbp); if (func == ORB_FUN_RUNQUEUE) { ocb = STAILQ_FIRST(&target->mgm_ocb_queue); if (target->mgm_ocb_cur != NULL || ocb == NULL) { - SBP_UNLOCK(target->sbp); - splx(s); return; } STAILQ_REMOVE_HEAD(&target->mgm_ocb_queue, ocb); - SBP_UNLOCK(target->sbp); goto start; } if ((ocb = sbp_get_ocb(sdev)) == NULL) { - SBP_UNLOCK(target->sbp); - splx(s); /* XXX */ return; } - SBP_UNLOCK(target->sbp); ocb->flags = OCB_ACT_MGM; ocb->sdev = sdev; @@ -1458,15 +1421,11 @@ END_DEBUG if (target->mgm_ocb_cur != NULL) { /* there is a standing ORB */ - SBP_LOCK(target->sbp); STAILQ_INSERT_TAIL(&sdev->target->mgm_ocb_queue, ocb, ocb); - SBP_UNLOCK(target->sbp); - splx(s); return; } start: target->mgm_ocb_cur = ocb; - splx(s); callout_reset(&target->mgm_ocb_timeout, 5*hz, sbp_mgm_timeout, (caddr_t)ocb); @@ -1677,6 +1636,7 @@ printf("sbp %08x %08x %08x %08x\n", ntoh printf("sbp %08x %08x %08x %08x\n", ntohl(ld[8]), ntohl(ld[9]), ntohl(ld[10]), ntohl(ld[11])); */ sbp = (struct sbp_softc *)xfer->sc; + SBP_LOCK_ASSERT(sbp); if (xfer->resp != 0){ printf("sbp_recv: xfer->resp = %d\n", xfer->resp); goto done0; @@ -1796,10 +1756,8 @@ END_DEBUG /* we have to reset the fetch agent if it's dead */ if (sbp_status->dead) { if (sdev->path) { - SBP_LOCK(sbp); xpt_freeze_devq(sdev->path, 1); sdev->freeze ++; - SBP_UNLOCK(sbp); } reset_agent = 1; } @@ -1904,9 +1862,7 @@ END_DEBUG /* fix up inq data */ if (ccb->csio.cdb_io.cdb_bytes[0] == INQUIRY) sbp_fix_inq_data(ocb); - SBP_LOCK(sbp); xpt_done(ccb); - SBP_UNLOCK(sbp); } break; default: @@ -1945,22 +1901,19 @@ done0: fw_asyreq(xfer->fc, -1, xfer); #else /* recycle */ - /* we don't need a lock here because bottom half is serialized */ STAILQ_INSERT_TAIL(&sbp->fwb.xferlist, xfer, link); #endif - - return; - } static void sbp_recv(struct fw_xfer *xfer) { - int s; + struct sbp_softc *sbp; - s = splcam(); + sbp = (struct sbp_softc *)xfer->sc; + SBP_LOCK(sbp); sbp_recv1(xfer); - splx(s); + SBP_UNLOCK(sbp); } /* * sbp_attach() @@ -1971,7 +1924,7 @@ sbp_attach(device_t dev) struct sbp_softc *sbp; struct cam_devq *devq; struct firewire_comm *fc; - int i, s, error; + int i, error; if (DFLTPHYS > SBP_MAXPHYS) device_printf(dev, "Warning, DFLTPHYS(%dKB) is larger than " @@ -1987,8 +1940,7 @@ END_DEBUG if (cold) sbp_cold ++; - sbp = ((struct sbp_softc *)device_get_softc(dev)); - bzero(sbp, sizeof(struct sbp_softc)); + sbp = device_get_softc(dev); sbp->fd.dev = dev; sbp->fd.fc = fc = device_get_ivars(dev); mtx_init(&sbp->mtx, "sbp", NULL, MTX_DEF); @@ -2064,10 +2016,8 @@ END_DEBUG sbp->fd.post_explore = sbp_post_explore; if (fc->status != -1) { - s = splfw(); sbp_post_busreset((void *)sbp); sbp_post_explore((void *)sbp); - splx(s); } SBP_LOCK(sbp); xpt_async(AC_BUS_RESET, sbp->path, /*arg*/ NULL); @@ -2090,6 +2040,7 @@ sbp_logout_all(struct sbp_softc *sbp) SBP_DEBUG(0) printf("sbp_logout_all\n"); END_DEBUG + SBP_LOCK_ASSERT(sbp); for (i = 0 ; i < SBP_NUM_TARGETS ; i ++) { target = &sbp->targets[i]; if (target->luns == NULL) @@ -2113,23 +2064,30 @@ sbp_shutdown(device_t dev) { struct sbp_softc *sbp = ((struct sbp_softc *)device_get_softc(dev)); + SBP_LOCK(sbp); sbp_logout_all(sbp); + SBP_UNLOCK(sbp); return (0); } static void sbp_free_sdev(struct sbp_dev *sdev) { + struct sbp_softc *sbp; int i; if (sdev == NULL) return; - for (i = 0; i < SBP_QUEUE_LEN; i++) - bus_dmamap_destroy(sdev->target->sbp->dmat, - sdev->ocb[i].dmamap); - fwdma_free(sdev->target->sbp->fd.fc, &sdev->dma); + sbp = sdev->target->sbp; + SBP_UNLOCK(sbp); + callout_drain(&sdev->login_callout); + for (i = 0; i < SBP_QUEUE_LEN; i++) { + callout_drain(&sdev->ocb[i].timer); + bus_dmamap_destroy(sbp->dmat, sdev->ocb[i].dmamap); + } + fwdma_free(sbp->fd.fc, &sdev->dma); free(sdev, M_SBP); - sdev = NULL; + SBP_LOCK(sbp); } static void @@ -2141,14 +2099,16 @@ sbp_free_target(struct sbp_target *targe if (target->luns == NULL) return; - callout_stop(&target->mgm_ocb_timeout); sbp = target->sbp; + SBP_LOCK_ASSERT(sbp); + SBP_UNLOCK(sbp); + callout_drain(&target->mgm_ocb_timeout); + callout_drain(&target->scan_callout); + SBP_LOCK(sbp); for (i = 0; i < target->num_lun; i++) sbp_free_sdev(target->luns[i]); - for (xfer = STAILQ_FIRST(&target->xferlist); - xfer != NULL; xfer = next) { - next = STAILQ_NEXT(xfer, link); + STAILQ_FOREACH_SAFE(xfer, &target->xferlist, link, next) { fw_xfer_free_buf(xfer); } STAILQ_INIT(&target->xferlist); @@ -2169,23 +2129,25 @@ SBP_DEBUG(0) printf("sbp_detach\n"); END_DEBUG + SBP_LOCK(sbp); for (i = 0; i < SBP_NUM_TARGETS; i ++) sbp_cam_detach_target(&sbp->targets[i]); - SBP_LOCK(sbp); xpt_async(AC_LOST_DEVICE, sbp->path, NULL); xpt_free_path(sbp->path); xpt_bus_deregister(cam_sim_path(sbp->sim)); cam_sim_free(sbp->sim, /*free_devq*/ TRUE); - SBP_UNLOCK(sbp); sbp_logout_all(sbp); + SBP_UNLOCK(sbp); /* XXX wait for logout completion */ pause("sbpdtc", hz/2); + SBP_LOCK(sbp); for (i = 0 ; i < SBP_NUM_TARGETS ; i ++) sbp_free_target(&sbp->targets[i]); + SBP_UNLOCK(sbp); fw_bindremove(fc, &sbp->fwb); fw_xferlist_remove(&sbp->fwb.xferlist); @@ -2205,16 +2167,15 @@ sbp_cam_detach_sdev(struct sbp_dev *sdev return; if (sdev->status == SBP_DEV_RESET) return; + SBP_LOCK_ASSERT(sdev->target->sbp); sbp_abort_all_ocbs(sdev, CAM_DEV_NOT_THERE); if (sdev->path) { - SBP_LOCK(sdev->target->sbp); xpt_release_devq(sdev->path, sdev->freeze, TRUE); sdev->freeze = 0; xpt_async(AC_LOST_DEVICE, sdev->path, NULL); xpt_free_path(sdev->path); sdev->path = NULL; - SBP_UNLOCK(sdev->target->sbp); } } @@ -2223,6 +2184,7 @@ sbp_cam_detach_target(struct sbp_target { int i; + SBP_LOCK_ASSERT(target->sbp); if (target->luns != NULL) { SBP_DEBUG(0) printf("sbp_detach_target %d\n", target->target_id); @@ -2240,6 +2202,7 @@ sbp_target_reset(struct sbp_dev *sdev, i struct sbp_target *target = sdev->target; struct sbp_dev *tsdev; + SBP_LOCK_ASSERT(target->sbp); for (i = 0; i < target->num_lun; i++) { tsdev = target->luns[i]; if (tsdev == NULL) @@ -2248,10 +2211,8 @@ sbp_target_reset(struct sbp_dev *sdev, i continue; if (tsdev->status == SBP_DEV_RESET) continue; - SBP_LOCK(target->sbp); xpt_freeze_devq(tsdev->path, 1); tsdev->freeze ++; - SBP_UNLOCK(target->sbp); sbp_abort_all_ocbs(tsdev, CAM_CMD_TIMEOUT); if (method == 2) tsdev->status = SBP_DEV_LOGIN; @@ -2276,6 +2237,7 @@ sbp_mgm_timeout(void *arg) struct sbp_dev *sdev = ocb->sdev; struct sbp_target *target = sdev->target; + SBP_LOCK_ASSERT(target->sbp); device_printf(sdev->target->sbp->fd.dev, "%s:%s request timeout(mgm orb:0x%08x)\n", __func__, sdev->bustgtlun, (uint32_t)ocb->bus_addr); @@ -2302,14 +2264,13 @@ sbp_timeout(void *arg) "%s:%s request timeout(cmd orb:0x%08x) ... ", __func__, sdev->bustgtlun, (uint32_t)ocb->bus_addr); + SBP_LOCK_ASSERT(sdev->target->sbp); sdev->timeout ++; switch(sdev->timeout) { case 1: printf("agent reset\n"); - SBP_LOCK(sdev->target->sbp); xpt_freeze_devq(sdev->path, 1); sdev->freeze ++; - SBP_UNLOCK(sdev->target->sbp); sbp_abort_all_ocbs(sdev, CAM_CMD_TIMEOUT); sbp_agent_reset(sdev); break; @@ -2331,13 +2292,15 @@ sbp_timeout(void *arg) } static void -sbp_action1(struct cam_sim *sim, union ccb *ccb) +sbp_action(struct cam_sim *sim, union ccb *ccb) { struct sbp_softc *sbp = (struct sbp_softc *)sim->softc; struct sbp_target *target = NULL; struct sbp_dev *sdev = NULL; + if (sbp != NULL) + SBP_LOCK_ASSERT(sbp); /* target:lun -> sdev mapping */ if (sbp != NULL && ccb->ccb_h.target_id != CAM_TARGET_WILDCARD @@ -2459,10 +2422,8 @@ END_DEBUG if ((ocb = sbp_get_ocb(sdev)) == NULL) { ccb->ccb_h.status = CAM_RESRC_UNAVAIL; if (sdev->freeze == 0) { - SBP_LOCK(sdev->target->sbp); xpt_freeze_devq(sdev->path, 1); sdev->freeze ++; - SBP_UNLOCK(sdev->target->sbp); } xpt_done(ccb); return; @@ -2518,7 +2479,7 @@ printf("ORB %08x %08x %08x %08x\n", ntoh ccg = &ccb->ccg; if (ccg->block_size == 0) { - printf("sbp_action1: block_size is 0.\n"); + printf("sbp_action: block_size is 0.\n"); ccb->ccb_h.status = CAM_REQ_INVALID; xpt_done(ccb); break; @@ -2643,16 +2604,6 @@ END_DEBUG } static void -sbp_action(struct cam_sim *sim, union ccb *ccb) -{ - int s; - - s = splfw(); - sbp_action1(sim, ccb); - splx(s); -} - -static void sbp_execute_ocb(void *arg, bus_dma_segment_t *segments, int seg, int error) { int i; @@ -2747,7 +2698,7 @@ sbp_dequeue_ocb(struct sbp_dev *sdev, st { struct sbp_ocb *ocb; struct sbp_ocb *next; - int s = splfw(), order = 0; + int order = 0; SBP_DEBUG(1) device_printf(sdev->target->sbp->fd.dev, @@ -2758,15 +2709,13 @@ SBP_DEBUG(1) #endif __func__, sdev->bustgtlun, ntohl(sbp_status->orb_lo), sbp_status->src); END_DEBUG - SBP_LOCK(sdev->target->sbp); - for (ocb = STAILQ_FIRST(&sdev->ocbs); ocb != NULL; ocb = next) { - next = STAILQ_NEXT(ocb, ocb); + SBP_LOCK_ASSERT(sdev->target->sbp); + STAILQ_FOREACH_SAFE(ocb, &sdev->ocbs, ocb, next) { if (OCB_MATCH(ocb, sbp_status)) { /* found */ STAILQ_REMOVE(&sdev->ocbs, ocb, sbp_ocb, ocb); if (ocb->ccb != NULL) - untimeout(sbp_timeout, (caddr_t)ocb, - ocb->timeout_ch); + callout_stop(&ocb->timer); if (ntohl(ocb->orb[4]) & 0xffff) { bus_dmamap_sync(sdev->target->sbp->dmat, ocb->dmamap, @@ -2795,9 +2744,7 @@ END_DEBUG * execution. */ if (sdev->last_ocb != NULL) { - SBP_UNLOCK(sdev->target->sbp); sbp_free_ocb(sdev, sdev->last_ocb); - SBP_LOCK(sdev->target->sbp); } sdev->last_ocb = ocb; if (next != NULL && @@ -2808,8 +2755,6 @@ END_DEBUG } else order ++; } - SBP_UNLOCK(sdev->target->sbp); - splx(s); SBP_DEBUG(0) if (ocb && order > 0) { device_printf(sdev->target->sbp->fd.dev, @@ -2823,10 +2768,9 @@ END_DEBUG static struct sbp_ocb * sbp_enqueue_ocb(struct sbp_dev *sdev, struct sbp_ocb *ocb) { - int s = splfw(); struct sbp_ocb *prev, *prev2; - mtx_assert(&sdev->target->sbp->mtx, MA_OWNED); + SBP_LOCK_ASSERT(sdev->target->sbp); SBP_DEBUG(1) device_printf(sdev->target->sbp->fd.dev, #if defined(__DragonFly__) || __FreeBSD_version < 500000 @@ -2839,8 +2783,8 @@ END_DEBUG STAILQ_INSERT_TAIL(&sdev->ocbs, ocb, ocb); if (ocb->ccb != NULL) - ocb->timeout_ch = timeout(sbp_timeout, (caddr_t)ocb, - (ocb->ccb->ccb_h.timeout * hz) / 1000); + callout_reset(&ocb->timer, (ocb->ccb->ccb_h.timeout * hz) / 1000, + sbp_timeout, ocb); if (use_doorbell && prev == NULL) prev2 = sdev->last_ocb; @@ -2863,7 +2807,6 @@ END_DEBUG *(volatile uint32_t *)&prev2->orb[1] = htonl(ocb->bus_addr); *(volatile uint32_t *)&prev2->orb[0] = 0; } - splx(s); return prev; } @@ -2872,18 +2815,15 @@ static struct sbp_ocb * sbp_get_ocb(struct sbp_dev *sdev) { struct sbp_ocb *ocb; - int s = splfw(); - mtx_assert(&sdev->target->sbp->mtx, MA_OWNED); + SBP_LOCK_ASSERT(sdev->target->sbp); ocb = STAILQ_FIRST(&sdev->free_ocbs); if (ocb == NULL) { sdev->flags |= ORB_SHORTAGE; printf("ocb shortage!!!\n"); - splx(s); return NULL; } STAILQ_REMOVE_HEAD(&sdev->free_ocbs, ocb); - splx(s); ocb->ccb = NULL; return (ocb); } @@ -2894,7 +2834,7 @@ sbp_free_ocb(struct sbp_dev *sdev, struc ocb->flags = 0; ocb->ccb = NULL; - SBP_LOCK(sdev->target->sbp); + SBP_LOCK_ASSERT(sdev->target->sbp); STAILQ_INSERT_TAIL(&sdev->free_ocbs, ocb, ocb); if ((sdev->flags & ORB_SHORTAGE) != 0) { int count; @@ -2904,7 +2844,6 @@ sbp_free_ocb(struct sbp_dev *sdev, struc sdev->freeze = 0; xpt_release_devq(sdev->path, count, TRUE); } - SBP_UNLOCK(sdev->target->sbp); } static void @@ -2913,6 +2852,7 @@ sbp_abort_ocb(struct sbp_ocb *ocb, int s struct sbp_dev *sdev; sdev = ocb->sdev; + SBP_LOCK_ASSERT(sdev->target->sbp); SBP_DEBUG(0) device_printf(sdev->target->sbp->fd.dev, #if defined(__DragonFly__) || __FreeBSD_version < 500000 @@ -2932,12 +2872,9 @@ END_DEBUG bus_dmamap_unload(sdev->target->sbp->dmat, ocb->dmamap); } if (ocb->ccb != NULL) { - untimeout(sbp_timeout, (caddr_t)ocb, - ocb->timeout_ch); + callout_stop(&ocb->timer); ocb->ccb->ccb_h.status = status; - SBP_LOCK(sdev->target->sbp); xpt_done(ocb->ccb); - SBP_UNLOCK(sdev->target->sbp); } sbp_free_ocb(sdev, ocb); } @@ -2945,28 +2882,21 @@ END_DEBUG static void sbp_abort_all_ocbs(struct sbp_dev *sdev, int status) { - int s; struct sbp_ocb *ocb, *next; STAILQ_HEAD(, sbp_ocb) temp; - s = splfw(); - STAILQ_INIT(&temp); - SBP_LOCK(sdev->target->sbp); + SBP_LOCK_ASSERT(sdev->target->sbp); STAILQ_CONCAT(&temp, &sdev->ocbs); STAILQ_INIT(&sdev->ocbs); - SBP_UNLOCK(sdev->target->sbp); - for (ocb = STAILQ_FIRST(&temp); ocb != NULL; ocb = next) { - next = STAILQ_NEXT(ocb, ocb); + STAILQ_FOREACH_SAFE(ocb, &temp, ocb, next) { sbp_abort_ocb(ocb, status); } if (sdev->last_ocb != NULL) { sbp_free_ocb(sdev, sdev->last_ocb); sdev->last_ocb = NULL; } - - splx(s); } static devclass_t sbp_devclass; From owner-svn-src-head@FreeBSD.ORG Tue May 27 20:19:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C21139F; Tue, 27 May 2014 20:19:48 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 361372187; Tue, 27 May 2014 20:19:48 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1F95AB94C; Tue, 27 May 2014 16:19:47 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r266765 - in head/sys/amd64/vmm: . intel Date: Tue, 27 May 2014 15:06:25 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201405271904.s4RJ4cx4068774@svn.freebsd.org> In-Reply-To: <201405271904.s4RJ4cx4068774@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201405271506.25140.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 27 May 2014 16:19:47 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 20:19:48 -0000 On Tuesday, May 27, 2014 3:04:38 pm John Baldwin wrote: > Author: jhb > Date: Tue May 27 19:04:38 2014 > New Revision: 266765 > URL: http://svnweb.freebsd.org/changeset/base/266765 > > Log: > - Rework the XSAVE/XRSTOR emulation to only expose XCR0 features to the > guest for which the rules regarding xsetbv emulation are known. In > particular future extensions like AVX-512 have interdependencies among > feature bits that could allow a guest to trigger a GP# in the host with > the current approach of allowing anything the host supports. > - Add proper checking of Intel MPX and AVX-512 XSAVE features in the > xsetbv emulation and allow these features to be exposed to the guest if > they are enabled in the host. > - Expose a subset of known-safe features from leaf 0 of the structured > extended features to guests if they are supported on the host including > RDFSBASE/RDGSBASE, BMI1/2, AVX2, AVX-512, HLE, ERMS, and RTM. Aside > from AVX-512, these features are all new instructions available for use > in ring 3 with no additional hypervisor changes needed. > > Reviewed by: neel Unfortunately there is no production silicon with either AVX-512 or MPX that runs FreeBSD AFAIK, so I haven't been able to test that this works correctly for those features. Using plain AVX in a guest still works ok though. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue May 27 20:22:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 033256B9; Tue, 27 May 2014 20:22:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E502E2211; Tue, 27 May 2014 20:22:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RKMaiq006428; Tue, 27 May 2014 20:22:36 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RKMacK006427; Tue, 27 May 2014 20:22:36 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405272022.s4RKMacK006427@svn.freebsd.org> From: John Baldwin Date: Tue, 27 May 2014 20:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266773 - head/usr.bin/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 20:22:37 -0000 Author: jhb Date: Tue May 27 20:22:36 2014 New Revision: 266773 URL: http://svnweb.freebsd.org/changeset/base/266773 Log: Fix a couple of size_t != int warnings. Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Tue May 27 19:56:02 2014 (r266772) +++ head/usr.bin/top/machine.c Tue May 27 20:22:36 2014 (r266773) @@ -916,7 +916,7 @@ format_next_process(caddr_t handle, char argbuflen = cmdlen * 4; argbuf = (char *)malloc(argbuflen + 1); if (argbuf == NULL) { - warn("malloc(%d)", argbuflen + 1); + warn("malloc(%zd)", argbuflen + 1); free(cmdbuf); return NULL; } @@ -1023,7 +1023,7 @@ format_next_process(caddr_t handle, char thr_buf[0] = '\0'; else snprintf(thr_buf, sizeof(thr_buf), "%*d ", - sizeof(thr_buf) - 2, pp->ki_numthreads); + (int)(sizeof(thr_buf) - 2), pp->ki_numthreads); snprintf(fmt, sizeof(fmt), proc_fmt, pp->ki_pid, From owner-svn-src-head@FreeBSD.ORG Tue May 27 20:31:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0A268E8 for ; Tue, 27 May 2014 20:31:31 +0000 (UTC) Received: from mail-ig0-f174.google.com (mail-ig0-f174.google.com [209.85.213.174]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87D5D22EC for ; Tue, 27 May 2014 20:31:31 +0000 (UTC) Received: by mail-ig0-f174.google.com with SMTP id h3so1592733igd.1 for ; Tue, 27 May 2014 13:31:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=eZGeduO6oLH3YteEL0FeI/TNhnA16HRQM2pu+HgC3jM=; b=Hsd7fusiAQKdzWNuZNC+1NEc+1hovJmRtiT0rB2Zvo6S1dSH+jFFi1iJnh22As/zIA +HCwow2NznLfQQDpWVKDxFKL33nIe9zM3nMfd07H2GT4cIF/ZEI0hfJC2U8OUSTLKIvs uACBONviRBmeIrqt90qdRltwsxHsozeE9zkkAgdQJ2BbBR7Ivz1VQGUr1nlD8o76DApb Tdxocce54zXVDowgvhHNXE4EaaoARxkwutrYHz+v+BsQdIY7JP1RiqKV3dObR8q4eloA 4x8FKV554sL59WSO7o8h79JkODwcmAY+9WlC0XCzvIPIO5lE2WYyd9R38xiz+btFXscz Om8w== X-Gm-Message-State: ALoCoQmvRHTuyo7+hpSx8liicwa3jr3wQe6TD+s+QEg/oWerJLuTnMT5nrbo7s4t8trna2a4afJS X-Received: by 10.50.20.137 with SMTP id n9mr25877046ige.15.1401222689923; Tue, 27 May 2014 13:31:29 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id ng17sm7380488igb.13.2014.05.27.13.31.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 May 2014 13:31:29 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_F9B225B6-1C99-4233-A917-99CE5519C109"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266553 - head/release/scripts From: Warner Losh In-Reply-To: <20140527214038.17d00369@kalimero.tijl.coosemans.org> Date: Tue, 27 May 2014 14:31:44 -0600 Message-Id: <13EB325C-3882-46AA-9B17-3BF19997C978@bsdimp.com> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> <5380EBA8.1030200@freebsd.org> <20140525011307.142b41ab@kalimero.tijl.coosemans.org> <3CCAFAD3-FABE-40EF-ABF9-815FE5826349@bsdimp.com> <9FE34CE4-C71F-4806-9EF6-30CB1051C62F@bsdimp.com> <20140526113502.239db74d@kalimero.tijl.coosemans.org> <5383522F.30108@freebsd.org> <20140527001811.3e9d3e8d@kalimero.tijl.coosemans.org> <05D1A11D-5985-42EA-84AD-209A8B51D391@bsdimp.com> <20140527093633.0a922e13@kalimero.tijl.coosemans.org> <85FABD2B-81BB-4E1A-B61E-4216A144A9DB@bsdimp.com> <20140527214038.17d00369@kalimero.tijl.coosemans.org> To: Tijl Coosemans X-Mailer: Apple Mail (2.1878.2) Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , Nathan Whitehorn , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 20:31:31 -0000 --Apple-Mail=_F9B225B6-1C99-4233-A917-99CE5519C109 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On May 27, 2014, at 1:40 PM, Tijl Coosemans wrote: > On Tue, 27 May 2014 07:18:06 -0600 Warner Losh wrote: >> On May 27, 2014, at 1:36 AM, Tijl Coosemans wrote: >>> On Mon, 26 May 2014 16:31:21 -0600 Warner Losh wrote: >>>> On May 26, 2014, at 4:18 PM, Tijl Coosemans = wrote:=20 >>>>> On Mon, 26 May 2014 09:53:57 -0600 Warner Losh wrote: >>>>>> On May 26, 2014, at 8:39 AM, Nathan Whitehorn = wrote: >>>>>>> On 05/26/14 02:35, Tijl Coosemans wrote: >>>>>>>> I suppose you could replace the "x86" in the pkg scheme with = i386/amd64, >>>>>>>> but then you'd still be talking about i386:32, amd64:32 and = amd64:64 >>>>>>>> instead of x86:32, x86:x32 and x86:64. =20 >>>>>>=20 >>>>>> I suppose you could replace these by ?i386?, ?x32? (or = ?amd64x32?) and >>>>>> ?amd64? respectively. >>>>>=20 >>>>> So you're on an amd64 or mips64 system (as indicated by uname) but = you >>>>> want to use the 32-bit package if possible. How does your script = know >>>>> about the magic "x32", "amd64x32" or "mipsn32" strings? Wouldn't = it be >>>>> easier if you could just use "`uname -p`:32?? >>>>=20 >>>> Oh give me a break. You know it because you know you are building = for >>>> mipsn32 because that?s what you?ve set MACHINE_ARCH or TARGET_ARCH = to, >>>=20 >>> No, MACHINE_ARCH or TARGET_ARCH is "amd64" or "mips64". You are = building >>> the 64-bit OS and then decide separately per package whether you = want the >>> ILP32 one or the LP64 one. >>=20 >> I think I understand why we?re talking past each other. This bit is = wrong. >> The LP64 one has a MACHINE_ARCH of ?amd64? or ?mips64?. The ILP32 = one will >> have MACHINE_ARCH of ?i386? or ?mips?. The weird ones (ILP32 with = 64-bit >> registers) will have a different MACHINE_ARCH of ?x32? or ?mipsn32?. >> Selection can be done on a case by case basis, but this will be = validated >> against the supported_abis sysctl. There?s no need to have different = names >> here, the current standard ones do just fine, are completely = sufficient and >> all inclusive. This is rather by definition, and your understanding = of the >> definition sounds flawed. >>=20 >> While we have limited support for building 32-bit binaries, it is to = build >> 32-bit binaries for a different MACHINE_ARCH. -m32 on amd64 creates = i386 >> binaries, not amd64:32 binaries. -m32 on powerpc64 creates powerpc = binaries, >> not powerpc64:32 binaries. On mips, -mabi-n32 (I think the option is) = is >> required to create the mipsn32 binaries. In every single one of these = cases, >> there exists a MACHINE_ARCH that completely describes the binary. >=20 > amd64:32 is provided by the -mx32 compiler flag. True, but not relevant. >> So I?m still waiting for a use case that requires the new names. One = has >> not been articulated, and I don?t think one actually exists. >=20 > Imagine you've built a system with MACHINE_ARCH amd64 and one with > MACHINE_ARCH mips64. Now you want to populate these systems with a = list > of packages for which you wrote a script. These systems each support = 2 > ABIs: a native 64-bit one (amd64 and mips64) and a native 32-bit one = (x32 > and mipsn32). Both are native in the sense that they make full use of = the > instruction set. This is not like i386 on amd64 or mips o32 on mips64 > because those are more like compat shims that operate under special > (crippled) cpu modes that nobody uses unless they're stuck with old = code. > Both our ABIs on the other hand are native and equally valid and which = one > to use for a particular package depends entirely on the use case. If = your > use case requires more than 4G of address space you'll have to use the > 64-bit package, otherwise you can use the 32-bit package which, = depending > on how pointer heavy the code is, may give a performance benefit. You > make this choice for each of the packages in your list and add that > information to your script. Long hypothetical, but so what? In such a case, you=92d pick one of two = different MACHINE_ARCH values depending on the package. This this is a = fairly atypical use case, it would not be unreasonable for the person = wanting to do this to know the proper companion ABI. In both cases, you = have the choice of two other values to use. Which one you use will = depend on a variety of factors, and what might be right for one = application may be wrong for others. And in both cases, there=92s actually two choices: for amd64, you=92d = have i386 and x32. Both of these are fine choices, and it would depend = on the workload which one is better (i386 has better toolchain support = and maturity, x32 offers some interesting theoretical wins, but doesn=92t = have the same maturity). Same with mips64, you=92d have two choices as = well. In both cases, you can=92t just take uname/MACHINE_ARCH and slap = :32 on the end. > Now let's work with Nathan's patch which uses the following string to > identify the pkg repository to fetch packages from: > `uname -s`:`uname -r | cut -f 1 -d .`:`uname -p` >=20 > On our two systems that would be FreeBSD:11:amd64 and = FreeBSD:11:mips64. > Now if your script has to install the 32-bit version of a package how > can it go from those two strings to FreeBSD:11:x32 or = FreeBSD:11:mipsn32 > without a lookup table? You couldn=92t. Which is the whole reason I want to have them have a = standard name so you don=92t need the lookup table for the common case. = This is an =93off in the weeds=94 case, and optimizing for it doesn=92t = make sense. Especially because in each case, you have two different = 32-bit ABIs to choose from. You=92d have to have some kind of table in = either case. Also, the proper name for n32, in your current system, is = mips:32:n32, which (a) is wrong and (b) isn=92t regular. > I say, you can more easily indicate whether you > want the 32-bit or 64-bit package by appending :32 or :64 to the = original > strings, so FreeBSD:11:amd64:32 and FreeBSD:11:mips64:32. Except there=92s no such thing as mips64:32 in the current system. = There=92s two different ABIs that could mean. It could be o32 or n32, = with the same sort of trade offs. There=92d need to be a person in the = loop to know, so there=92s already a need to have special knowledge. You = can=92t get there by just adding :32 to the existing thing... > Like I said in a reply to Nathan's patch, pkg could default to :32 or = :64 > for every arch so it can be left out in many cases. FreeBSD:11:i386 > would then be equivalent to FreeBSD:11:i386:32, FreeBSD:11:amd64 to > FreeBSD:11:amd64:64, etc. I don=92t see what value that adds to have the extra :32 or :64. = Nathan=92s patches make it possible to have an automated build system = with the typical use case (I want to build all my binaries, packages, = etc the same). But adding a :32 isn=92t going to even work for your = hypothetical example because people actually building such systems will = need to specify which 32-bit ABI they want to use anyway. And the = degenerate case of :32 just doesn=92t work with mips=85=20 Consider too that we=92re planning a new i386 ABI, which is identical to = the current i386 ABI, except time_t is 64 bit. We=92ve penciled in the = name i386t64 for this ABI/MACHINE_ARCH. This will be much less painful, = it is thought, than finding all the current places that take time_t as = an arg and shimming=85 So if we were to do that, then your current = scheme wouldn=92t be able to encompass that eventuality and we=92d be = back to this argument... > This also does not preclude the existence of a mipsn32 MACHINE_ARCH in > case you want to build a pure mipsn32 system (including the kernel), = but > I wonder how many people would use that if it is possible to have a > mips64 system run n32 binaries. I don't think many people would run a > pure x32 system (with x32 kernel) so I don't see the need to have an > "x32" value for MACHINE_ARCH (or TARGET_ARCH). Actually, you absolutely must have a x32 MACHINE_ARCH if you want to be = able to run x32 binaries. Otherwise, how are you going to build the = libraries that use that API? Our build system simply isn=92t setup to = build them any other way. Although the usr/lib32 stuff could grow extra = goo for that, you are still building them the same way you=92d build. We = have a stylized way to create a sys root, which is needed for the = compilers to work. We=92d likely have to grow better multi lib support = than we have now as well. You=92d need some way to identify these = binaries, segregate their ld.so, etc. Even if no kernel ever is linked = this way, it is still an absolute requirement. Warner --Apple-Mail=_F9B225B6-1C99-4233-A917-99CE5519C109 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJThPYwAAoJEGwc0Sh9sBEA9EAQANrGMeeK9cJHf4BLpU61flVT HmdMcrdFzKWzEUgkzGsPgOX13a83FnNAGrROdgGANKxUqS21g0VdsqhOgLgyHS3d u6gKCJtxfe4JA6bTO8zO+uiUqiyAv3+4qrZEbH3g5kCMjM+TQjj5na4+/odq0dYx 0Ud3Ff7nu7uMlK6SojoHYU78Nvb7M3oLmvKvc0clEX9RS47hdmm8CJOjO8eMv3Gw qFrHjJwo+S4pxxuYzUOG4CHiKckJ/hlkChkWV0R0TLfxwpNZTocwpiM9rPxPfMzH qsw0Ifu9xhN9lBbXsdhKR5lAFfqtPLFh/Jb52aFl4bDQMtYHb6PG9cJDuFezFOeY L6Ga3SPXvr7tNCpUETFwmhDgxruDedsNLyfEGsat5T4/64UnkwHVM1U/9ZcGwJQ+ 3YOb9oeJpf0Js8dw+734QDVU/RQqJYHyq7N3e+EwnF1lVcgnt+YAG2ISetj+NYN9 J33Hp2Txe7qonvGpI93WdvG3+oDhAYadIO5KoPXFbrZo2nv7aVVWnF0SXb1Wkt1R 2XENnDCvkg+TgCbmxQGJpsBa9gUkhnRTGIelwWDr843jE+umtbgEIQAzykTnt85d ajlBFjqlN3v3RipxOUTk978OGw+XCCZeh/gizFhf2Zf/XCVNPkKWEtEnLNfYLCnW eGizCocprieENZyv+bKw =YhAC -----END PGP SIGNATURE----- --Apple-Mail=_F9B225B6-1C99-4233-A917-99CE5519C109-- From owner-svn-src-head@FreeBSD.ORG Tue May 27 20:45:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 732E9C30; Tue, 27 May 2014 20:45:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6095923F1; Tue, 27 May 2014 20:45:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RKjGkE015428; Tue, 27 May 2014 20:45:16 GMT (envelope-from allanjude@svn.freebsd.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RKjGRq015427; Tue, 27 May 2014 20:45:16 GMT (envelope-from allanjude@svn.freebsd.org) Message-Id: <201405272045.s4RKjGRq015427@svn.freebsd.org> From: Allan Jude Date: Tue, 27 May 2014 20:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266774 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 20:45:16 -0000 Author: allanjude (doc committer) Date: Tue May 27 20:45:15 2014 New Revision: 266774 URL: http://svnweb.freebsd.org/changeset/base/266774 Log: improve ifconfig(8) man page by describing special behaviour of -l ether PR: docs/187644 Submitted by: Andrew Merenbach (original patch) Approved by: bcr (mentor) Modified: head/sbin/ifconfig/ifconfig.8 Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Tue May 27 20:22:36 2014 (r266773) +++ head/sbin/ifconfig/ifconfig.8 Tue May 27 20:45:15 2014 (r266774) @@ -169,6 +169,18 @@ and .Dq lladdr are synonyms for .Dq link . +When using the +.Fl l +flag, the +.Dq ether +address family has special meaning and is no longer synonymous with +.Dq link +or +.Dq lladdr . +Specifying +.Fl l Dq ether +will list only ethernet interfaces, excluding all other interface types, +including the loopback interface. .It Ar dest_address Specify the address of the correspondent on the other end of a point to point link. @@ -2554,6 +2566,11 @@ The .Fl l flag may be used to list all available interfaces on the system, with no other additional information. +If an +.Ar address_family +is specified, only interfaces of that type will be listed. +.Fl l Dq ether +will list only ethernet adapters, excluding the loopback interface. Use of this flag is mutually exclusive with all other flags and commands, except for .Fl d From owner-svn-src-head@FreeBSD.ORG Tue May 27 21:31:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB29AC27; Tue, 27 May 2014 21:31:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98A8E2806; Tue, 27 May 2014 21:31:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RLVBbZ035322; Tue, 27 May 2014 21:31:11 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RLVBEU035321; Tue, 27 May 2014 21:31:11 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201405272131.s4RLVBEU035321@svn.freebsd.org> From: Scott Long Date: Tue, 27 May 2014 21:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266775 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 21:31:11 -0000 Author: scottl Date: Tue May 27 21:31:11 2014 New Revision: 266775 URL: http://svnweb.freebsd.org/changeset/base/266775 Log: Eliminate the fake contig_dmamap and replace it with a new flag, BUS_DMA_KMEM_ALLOC. They serve the same purpose, but using the flag means that the map can be NULL again, which in turn enables significant optimizations for the common case of no bouncing. Obtained from: Netflix, Inc. MFC after: 3 days Modified: head/sys/x86/x86/busdma_bounce.c Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Tue May 27 20:45:15 2014 (r266774) +++ head/sys/x86/x86/busdma_bounce.c Tue May 27 21:31:11 2014 (r266775) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); enum { BUS_DMA_COULD_BOUNCE = 0x01, BUS_DMA_MIN_ALLOC_COMP = 0x02, + BUS_DMA_KMEM_ALLOC = 0x04, }; struct bounce_zone; @@ -125,7 +126,7 @@ struct bus_dmamap { static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist; static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist; -static struct bus_dmamap nobounce_dmamap, contig_dmamap; +static struct bus_dmamap nobounce_dmamap; static void init_bounce_pages(void *dummy); static int alloc_bounce_zone(bus_dma_tag_t dmat); @@ -346,7 +347,7 @@ static int bounce_bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) { - if (map != NULL && map != &nobounce_dmamap && map != &contig_dmamap) { + if (map != NULL && map != &nobounce_dmamap) { if (STAILQ_FIRST(&map->bpages) != NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, EBUSY); @@ -420,13 +421,13 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dm *vaddr = (void *)kmem_alloc_attr(kernel_arena, dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, attr); - *mapp = &contig_dmamap; + dmat->bounce_flags |= BUS_DMA_KMEM_ALLOC; } else { *vaddr = (void *)kmem_alloc_contig(kernel_arena, dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, dmat->common.alignment != 0 ? dmat->common.alignment : 1ul, dmat->common.boundary, attr); - *mapp = &contig_dmamap; + dmat->bounce_flags |= BUS_DMA_KMEM_ALLOC; } if (*vaddr == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", @@ -449,18 +450,18 @@ bounce_bus_dmamem_free(bus_dma_tag_t dma { /* * dmamem does not need to be bounced, so the map should be - * NULL if malloc() was used and contig_dmamap if - * kmem_alloc_contig() was used. + * NULL and the BUS_DMA_KMEM_ALLOC flag cleared if malloc() + * was used and set if kmem_alloc_contig() was used. */ - if (!(map == NULL || map == &contig_dmamap)) + if (map != NULL) panic("bus_dmamem_free: Invalid map freed\n"); - if (map == NULL) + if ((dmat->bounce_flags & BUS_DMA_KMEM_ALLOC) == 0) free(vaddr, M_DEVBUF); else kmem_free(kernel_arena, (vm_offset_t)vaddr, dmat->common.maxsize); CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, - dmat->common.flags); + dmat->bounce_flags); } static void @@ -612,7 +613,7 @@ bounce_bus_dmamap_load_phys(bus_dma_tag_ bus_addr_t curaddr; int error; - if (map == NULL || map == &contig_dmamap) + if (map == NULL) map = &nobounce_dmamap; if (segs == NULL) @@ -665,7 +666,7 @@ bounce_bus_dmamap_load_buffer(bus_dma_ta vm_offset_t vaddr; int error; - if (map == NULL || map == &contig_dmamap) + if (map == NULL) map = &nobounce_dmamap; if (segs == NULL) @@ -976,7 +977,7 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ struct bounce_page *bpage; KASSERT(dmat->bounce_zone != NULL, ("no bounce zone in dma tag")); - KASSERT(map != NULL && map != &nobounce_dmamap && map != &contig_dmamap, + KASSERT(map != NULL && map != &nobounce_dmamap, ("add_bounce_page: bad map %p", map)); bz = dmat->bounce_zone; From owner-svn-src-head@FreeBSD.ORG Tue May 27 22:33:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09C4EA09; Tue, 27 May 2014 22:33:54 +0000 (UTC) Received: from mail-ig0-x233.google.com (mail-ig0-x233.google.com [IPv6:2607:f8b0:4001:c05::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD4AD2D7B; Tue, 27 May 2014 22:33:53 +0000 (UTC) Received: by mail-ig0-f179.google.com with SMTP id hn18so1736672igb.6 for ; Tue, 27 May 2014 15:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=pPx5YEDBHD7j9aV+5sTtytvV6F2PzDxept8OWHhbCYc=; b=H9GuHnDPRDmnISO0OONv1JDfpyYNWNs0rH8lJGCeh8iQ75/6xA5bL+l83RkEa7R53z 00k8kdlJ3zTWUdCAQUvQzUkuAw0YkqhvVq87dMh5/ZiQ9izj/dJz1g/WqY3dj6syGefX 2GclREZWOyZb9EDlP1FrhXCIJ43pstdhbfDOvF89W3CbSvitcnF76IgS0s32MpdXkmO7 q3OUYcr1RMbeMISHrVFe0YKTaI/AazVgNxxFwgmO3U7fMshCeDbeoXxpafD5dg/6HmoI NU7YTbEKf5cMpngh6SwGYt735z3mkspgHaqh2kDcOIN22A+btMz4Q+irQzd0+ak/oxuV 8puA== MIME-Version: 1.0 X-Received: by 10.50.97.68 with SMTP id dy4mr38035268igb.8.1401230032283; Tue, 27 May 2014 15:33:52 -0700 (PDT) Received: by 10.64.137.104 with HTTP; Tue, 27 May 2014 15:33:52 -0700 (PDT) Received: by 10.64.137.104 with HTTP; Tue, 27 May 2014 15:33:52 -0700 (PDT) In-Reply-To: References: <201405271939.s4RJdvDJ083301@svn.freebsd.org> Date: Tue, 27 May 2014 23:33:52 +0100 Message-ID: Subject: Re: svn commit: r266770 - head/sys/dev/iwn From: Gavin Atkinson To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 22:33:54 -0000 Oops, you are correct. I shall remove the debugging printf it in an hour or so. As far as treating this card like a 2030, that is also exactly what Linux does. Thanks, Gavin On 27 May 2014 20:47, "Adrian Chadd" wrote: > woo! > > There's some debugging printf left in. Maybe turn it into > device_printf() and hide it behind bootverbose? > > Is this all the linux driver did? Are the 2030 parameters okay? > > > -a > > > On 27 May 2014 12:39, Gavin Atkinson wrote: > > Author: gavin > > Date: Tue May 27 19:39:57 2014 > > New Revision: 266770 > > URL: http://svnweb.freebsd.org/changeset/base/266770 > > > > Log: > > Add support for the Intel Centrino Wireless-N 105 chipset. > > > > MFC after: 2 weeks > > Relnotes: yes > > > > Modified: > > head/sys/dev/iwn/if_iwn.c > > head/sys/dev/iwn/if_iwn_devid.h > > > > Modified: head/sys/dev/iwn/if_iwn.c > > > ============================================================================== > > --- head/sys/dev/iwn/if_iwn.c Tue May 27 19:37:18 2014 (r266769) > > +++ head/sys/dev/iwn/if_iwn.c Tue May 27 19:39:57 2014 (r266770) > > @@ -109,6 +109,8 @@ static const struct iwn_ident iwn_ident_ > > { 0x8086, IWN_DID_130_2, "Intel Centrino Wireless-N 130" > }, > > { 0x8086, IWN_DID_100_1, "Intel Centrino Wireless-N 100" > }, > > { 0x8086, IWN_DID_100_2, "Intel Centrino Wireless-N 100" > }, > > + { 0x8086, IWN_DID_105_1, "Intel Centrino Wireless-N 105" > }, > > + { 0x8086, IWN_DID_105_2, "Intel Centrino Wireless-N 105" > }, > > { 0x8086, IWN_DID_135_1, "Intel Centrino Wireless-N 135" > }, > > { 0x8086, IWN_DID_135_2, "Intel Centrino Wireless-N 135" > }, > > { 0x8086, IWN_DID_4965_1, "Intel Wireless WiFi Link 4965" > }, > > @@ -458,7 +460,7 @@ iwn_attach(device_t dev) > > sc->hw_type = (IWN_READ(sc, IWN_HW_REV) >> IWN_HW_REV_TYPE_SHIFT) > > & IWN_HW_REV_TYPE_MASK; > > sc->subdevice_id = pci_get_subdevice(dev); > > - > > +printf("hw %d sdid %x\n", sc->hw_type, sc->subdevice_id); > > /* > > * 4965 versus 5000 and later have different methods. > > * Let's set those up first. > > @@ -986,6 +988,31 @@ iwn_config_specific(struct iwn_softc *sc > > } > > break; > > > > +/* 105 Series */ > > +/* XXX: This series will need adjustment for rate. > > + * see rx_with_siso_diversity in linux kernel > > + */ > > + case IWN_DID_105_1: > > + case IWN_DID_105_2: > > + switch(sc->subdevice_id) { > > + case IWN_SDID_105_1: > > + case IWN_SDID_105_2: > > + case IWN_SDID_105_3: > > + //iwl105_bgn_cfg > > + case IWN_SDID_105_4: > > + //iwl105_bgn_d_cfg > > + sc->limits = &iwn2030_sensitivity_limits; > > + sc->base_params = &iwn2000_base_params; > > + sc->fwname = "iwn105fw"; > > + break; > > + default: > > + device_printf(sc->sc_dev, "adapter type > id : 0x%04x sub id :" > > + "0x%04x rev %d not supported > (subdevice)\n", pid, > > + sc->subdevice_id,sc->hw_type); > > + return ENOTSUP; > > + } > > + break; > > + > > /* 135 Series */ > > /* XXX: This series will need adjustment for rate. > > * see rx_with_siso_diversity in linux kernel > > > > Modified: head/sys/dev/iwn/if_iwn_devid.h > > > ============================================================================== > > --- head/sys/dev/iwn/if_iwn_devid.h Tue May 27 19:37:18 2014 > (r266769) > > +++ head/sys/dev/iwn/if_iwn_devid.h Tue May 27 19:39:57 2014 > (r266770) > > @@ -228,6 +228,19 @@ > > > > /* > > * > -------------------------------------------------------------------------- > > + * Device ID for 105 Series > > + * > -------------------------------------------------------------------------- > > + */ > > +#define IWN_DID_105_1 0x0894 > > +#define IWN_DID_105_2 0x0895 > > +/* SubDevice ID */ > > +#define IWN_SDID_105_1 0x0022 > > +#define IWN_SDID_105_2 0x0222 > > +#define IWN_SDID_105_3 0x0422 > > +#define IWN_SDID_105_4 0x0822 > > + > > +/* > > + * > -------------------------------------------------------------------------- > > * Device ID for 135 Series > > * > -------------------------------------------------------------------------- > > */ > > > From owner-svn-src-head@FreeBSD.ORG Tue May 27 23:04:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 647C91B8; Tue, 27 May 2014 23:04:16 +0000 (UTC) Received: from mail-qg0-x231.google.com (mail-qg0-x231.google.com [IPv6:2607:f8b0:400d:c04::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01D372FE0; Tue, 27 May 2014 23:04:15 +0000 (UTC) Received: by mail-qg0-f49.google.com with SMTP id a108so15316294qge.36 for ; Tue, 27 May 2014 16:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=hzz4U2PtxIri56G7Ka/6HJ13/Bde0V/CAsmOJO4yjIw=; b=KR6ZdMWPFpJOmGSeltvB9u3Prey44flxMbN/xB+SPA9x9AghWLlc8C9MOjl7+MlGLQ 3llvwoLudBSiq+JZ1M6aiiCthzDKdXhwN0RAdtAkZs6QV4WMJhXixyOUV3XXHQ16WiMm y3laMtSPTAaNtCp/vt9W/YiJ4n7GkKRieSu7rmYoRA2HlJarfVQ9OuYv8tZGJRZ9g200 ubsdPFoOCtJ/c/r5wYkzO7tgqCP0G/YvlhE0zuLVyPld6thv4PZmDQmR97yaeYt3c2Ti UmEFzyoYiCW//cnJSO1weelLnzCiVtLjxVnIvob57hrEEn33hzWeq6andRsWNzfK1tAA k5kQ== MIME-Version: 1.0 X-Received: by 10.229.97.71 with SMTP id k7mr47498025qcn.4.1401231855179; Tue, 27 May 2014 16:04:15 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.191.201 with HTTP; Tue, 27 May 2014 16:04:15 -0700 (PDT) In-Reply-To: References: <201405271939.s4RJdvDJ083301@svn.freebsd.org> Date: Tue, 27 May 2014 16:04:15 -0700 X-Google-Sender-Auth: C_V6OGbiYJYfQXap26ivsdmRpkA Message-ID: Subject: Re: svn commit: r266770 - head/sys/dev/iwn From: Adrian Chadd To: Gavin Atkinson Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 23:04:16 -0000 Sweet. Firmware? Is that included? -a On 27 May 2014 15:33, Gavin Atkinson wrote: > Oops, you are correct. I shall remove the debugging printf it in an hour or > so. > > As far as treating this card like a 2030, that is also exactly what Linux > does. > > Thanks, > > Gavin > > On 27 May 2014 20:47, "Adrian Chadd" wrote: >> >> woo! >> >> There's some debugging printf left in. Maybe turn it into >> device_printf() and hide it behind bootverbose? >> >> Is this all the linux driver did? Are the 2030 parameters okay? >> >> >> -a >> >> >> On 27 May 2014 12:39, Gavin Atkinson wrote: >> > Author: gavin >> > Date: Tue May 27 19:39:57 2014 >> > New Revision: 266770 >> > URL: http://svnweb.freebsd.org/changeset/base/266770 >> > >> > Log: >> > Add support for the Intel Centrino Wireless-N 105 chipset. >> > >> > MFC after: 2 weeks >> > Relnotes: yes >> > >> > Modified: >> > head/sys/dev/iwn/if_iwn.c >> > head/sys/dev/iwn/if_iwn_devid.h >> > >> > Modified: head/sys/dev/iwn/if_iwn.c >> > >> > ============================================================================== >> > --- head/sys/dev/iwn/if_iwn.c Tue May 27 19:37:18 2014 >> > (r266769) >> > +++ head/sys/dev/iwn/if_iwn.c Tue May 27 19:39:57 2014 >> > (r266770) >> > @@ -109,6 +109,8 @@ static const struct iwn_ident iwn_ident_ >> > { 0x8086, IWN_DID_130_2, "Intel Centrino Wireless-N 130" >> > }, >> > { 0x8086, IWN_DID_100_1, "Intel Centrino Wireless-N 100" >> > }, >> > { 0x8086, IWN_DID_100_2, "Intel Centrino Wireless-N 100" >> > }, >> > + { 0x8086, IWN_DID_105_1, "Intel Centrino Wireless-N 105" >> > }, >> > + { 0x8086, IWN_DID_105_2, "Intel Centrino Wireless-N 105" >> > }, >> > { 0x8086, IWN_DID_135_1, "Intel Centrino Wireless-N 135" >> > }, >> > { 0x8086, IWN_DID_135_2, "Intel Centrino Wireless-N 135" >> > }, >> > { 0x8086, IWN_DID_4965_1, "Intel Wireless WiFi Link 4965" >> > }, >> > @@ -458,7 +460,7 @@ iwn_attach(device_t dev) >> > sc->hw_type = (IWN_READ(sc, IWN_HW_REV) >> >> > IWN_HW_REV_TYPE_SHIFT) >> > & IWN_HW_REV_TYPE_MASK; >> > sc->subdevice_id = pci_get_subdevice(dev); >> > - >> > +printf("hw %d sdid %x\n", sc->hw_type, sc->subdevice_id); >> > /* >> > * 4965 versus 5000 and later have different methods. >> > * Let's set those up first. >> > @@ -986,6 +988,31 @@ iwn_config_specific(struct iwn_softc *sc >> > } >> > break; >> > >> > +/* 105 Series */ >> > +/* XXX: This series will need adjustment for rate. >> > + * see rx_with_siso_diversity in linux kernel >> > + */ >> > + case IWN_DID_105_1: >> > + case IWN_DID_105_2: >> > + switch(sc->subdevice_id) { >> > + case IWN_SDID_105_1: >> > + case IWN_SDID_105_2: >> > + case IWN_SDID_105_3: >> > + //iwl105_bgn_cfg >> > + case IWN_SDID_105_4: >> > + //iwl105_bgn_d_cfg >> > + sc->limits = >> > &iwn2030_sensitivity_limits; >> > + sc->base_params = &iwn2000_base_params; >> > + sc->fwname = "iwn105fw"; >> > + break; >> > + default: >> > + device_printf(sc->sc_dev, "adapter type >> > id : 0x%04x sub id :" >> > + "0x%04x rev %d not supported >> > (subdevice)\n", pid, >> > + sc->subdevice_id,sc->hw_type); >> > + return ENOTSUP; >> > + } >> > + break; >> > + >> > /* 135 Series */ >> > /* XXX: This series will need adjustment for rate. >> > * see rx_with_siso_diversity in linux kernel >> > >> > Modified: head/sys/dev/iwn/if_iwn_devid.h >> > >> > ============================================================================== >> > --- head/sys/dev/iwn/if_iwn_devid.h Tue May 27 19:37:18 2014 >> > (r266769) >> > +++ head/sys/dev/iwn/if_iwn_devid.h Tue May 27 19:39:57 2014 >> > (r266770) >> > @@ -228,6 +228,19 @@ >> > >> > /* >> > * >> > -------------------------------------------------------------------------- >> > + * Device ID for 105 Series >> > + * >> > -------------------------------------------------------------------------- >> > + */ >> > +#define IWN_DID_105_1 0x0894 >> > +#define IWN_DID_105_2 0x0895 >> > +/* SubDevice ID */ >> > +#define IWN_SDID_105_1 0x0022 >> > +#define IWN_SDID_105_2 0x0222 >> > +#define IWN_SDID_105_3 0x0422 >> > +#define IWN_SDID_105_4 0x0822 >> > + >> > +/* >> > + * >> > -------------------------------------------------------------------------- >> > * Device ID for 135 Series >> > * >> > -------------------------------------------------------------------------- >> > */ >> > From owner-svn-src-head@FreeBSD.ORG Tue May 27 23:05:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 508DA2FA; Tue, 27 May 2014 23:05:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E1A82FF2; Tue, 27 May 2014 23:05:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RN5Dsg079797; Tue, 27 May 2014 23:05:13 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RN5DYL079796; Tue, 27 May 2014 23:05:13 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201405272305.s4RN5DYL079796@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 27 May 2014 23:05:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266776 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 23:05:13 -0000 Author: gavin Date: Tue May 27 23:05:12 2014 New Revision: 266776 URL: http://svnweb.freebsd.org/changeset/base/266776 Log: Remove debugging printf that crept in in r266770. Submitted by: adrian, nwhitehorn MFC after: 2 weeks Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Tue May 27 21:31:11 2014 (r266775) +++ head/sys/dev/iwn/if_iwn.c Tue May 27 23:05:12 2014 (r266776) @@ -460,7 +460,7 @@ iwn_attach(device_t dev) sc->hw_type = (IWN_READ(sc, IWN_HW_REV) >> IWN_HW_REV_TYPE_SHIFT) & IWN_HW_REV_TYPE_MASK; sc->subdevice_id = pci_get_subdevice(dev); -printf("hw %d sdid %x\n", sc->hw_type, sc->subdevice_id); + /* * 4965 versus 5000 and later have different methods. * Let's set those up first. From owner-svn-src-head@FreeBSD.ORG Tue May 27 23:38:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94936756; Tue, 27 May 2014 23:38:47 +0000 (UTC) Received: from mail-gw11.york.ac.uk (mail-gw11.york.ac.uk [144.32.129.150]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57A2A2250; Tue, 27 May 2014 23:38:47 +0000 (UTC) Received: from ury.york.ac.uk ([144.32.64.162]:46364) by mail-gw11.york.ac.uk with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1WpQxB-0002w3-P9; Wed, 28 May 2014 00:38:45 +0100 Date: Wed, 28 May 2014 00:38:45 +0100 (BST) From: Gavin Atkinson X-X-Sender: gavin@ury.york.ac.uk To: Adrian Chadd Subject: Re: svn commit: r266770 - head/sys/dev/iwn In-Reply-To: Message-ID: References: <201405271939.s4RJdvDJ083301@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 23:38:47 -0000 On Tue, 27 May 2014, Adrian Chadd wrote: > Sweet. Firmware? Is that included? Firmware for these was committed some time ago, in r260552. Gavin From owner-svn-src-head@FreeBSD.ORG Tue May 27 23:39:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C074893; Tue, 27 May 2014 23:39:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38F2D2256; Tue, 27 May 2014 23:39:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RNdTBl093591; Tue, 27 May 2014 23:39:29 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RNdSIQ093589; Tue, 27 May 2014 23:39:28 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201405272339.s4RNdSIQ093589@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 27 May 2014 23:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266777 - head/contrib/unbound/libunbound X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 23:39:29 -0000 Author: des Date: Tue May 27 23:39:28 2014 New Revision: 266777 URL: http://svnweb.freebsd.org/changeset/base/266777 Log: Move libworker_event_done_cb() from libworker.h to worker.h. Modified: head/contrib/unbound/libunbound/libworker.h head/contrib/unbound/libunbound/worker.h Modified: head/contrib/unbound/libunbound/libworker.h ============================================================================== --- head/contrib/unbound/libunbound/libworker.h Tue May 27 23:05:12 2014 (r266776) +++ head/contrib/unbound/libunbound/libworker.h Tue May 27 23:39:28 2014 (r266777) @@ -136,10 +136,6 @@ void libworker_delete_event(struct libwo /** cleanup the cache to remove all rrset IDs from it, arg is libworker */ void libworker_alloc_cleanup(void* arg); -/** mesh callback with event results */ -void libworker_event_done_cb(void* arg, int rcode, struct sldns_buffer* buf, - enum sec_status s, char* why_bogus); - /** * fill result from parsed message, on error fills servfail * @param res: is clear at start, filled in at end. Modified: head/contrib/unbound/libunbound/worker.h ============================================================================== --- head/contrib/unbound/libunbound/worker.h Tue May 27 23:05:12 2014 (r266776) +++ head/contrib/unbound/libunbound/worker.h Tue May 27 23:39:28 2014 (r266777) @@ -91,6 +91,10 @@ void libworker_fg_done_cb(void* arg, int void libworker_bg_done_cb(void* arg, int rcode, sldns_buffer* buf, enum sec_status s, char* why_bogus); +/** mesh callback with event results */ +void libworker_event_done_cb(void* arg, int rcode, struct sldns_buffer* buf, + enum sec_status s, char* why_bogus); + /** * Worker signal handler function. User argument is the worker itself. * @param sig: signal number. From owner-svn-src-head@FreeBSD.ORG Tue May 27 23:57:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8191C29; Tue, 27 May 2014 23:57:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AADAD23E1; Tue, 27 May 2014 23:57:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4RNvMOK002064; Tue, 27 May 2014 23:57:22 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4RNvMB8002062; Tue, 27 May 2014 23:57:22 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201405272357.s4RNvMB8002062@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 27 May 2014 23:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266778 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 23:57:22 -0000 Author: nwhitehorn Date: Tue May 27 23:57:22 2014 New Revision: 266778 URL: http://svnweb.freebsd.org/changeset/base/266778 Log: Repair nested signal handling on PowerPC. The signal trampoline code was not allocating space for the parameter save area in the stack frame. If the compiler chose to save the argument to the signal handler on the stack, it would overwrite the first 32 bits of the sigaction struct with it, corrupting it for a subsequent invocation. PR: powerpc/183040 MFC after: 8 days Modified: head/sys/powerpc/powerpc/sigcode32.S head/sys/powerpc/powerpc/sigcode64.S Modified: head/sys/powerpc/powerpc/sigcode32.S ============================================================================== --- head/sys/powerpc/powerpc/sigcode32.S Tue May 27 23:39:28 2014 (r266777) +++ head/sys/powerpc/powerpc/sigcode32.S Tue May 27 23:57:22 2014 (r266778) @@ -45,9 +45,9 @@ */ .globl CNAME(sigcode32),CNAME(szsigcode32) CNAME(sigcode32): - addi 1,1,-16 /* reserved space for callee */ + addi 1,1,-20 /* reserved space for callee */ blrl - addi 3,1,16+SF_UC /* restore sp, and get &frame->sf_uc */ + addi 3,1,20+SF_UC /* restore sp, and get &frame->sf_uc */ li 0,SYS_sigreturn sc /* sigreturn(scp) */ li 0,SYS_exit Modified: head/sys/powerpc/powerpc/sigcode64.S ============================================================================== --- head/sys/powerpc/powerpc/sigcode64.S Tue May 27 23:39:28 2014 (r266777) +++ head/sys/powerpc/powerpc/sigcode64.S Tue May 27 23:57:22 2014 (r266778) @@ -45,7 +45,7 @@ */ .globl CNAME(sigcode64),CNAME(szsigcode64) CNAME(sigcode64): - addi 1,1,-48 /* reserved space for callee */ + addi 1,1,-112 /* reserved space for callee */ mflr 2 /* resolve function descriptor */ ld 0,0(2) ld 2,8(2) @@ -53,7 +53,7 @@ CNAME(sigcode64): blrl - addi 3,1,48+SF_UC /* restore sp, and get &frame->sf_uc */ + addi 3,1,112+SF_UC /* restore sp, and get &frame->sf_uc */ li 0,SYS_sigreturn sc /* sigreturn(scp) */ li 0,SYS_exit From owner-svn-src-head@FreeBSD.ORG Wed May 28 00:30:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA2E9366; Wed, 28 May 2014 00:30:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96D742658; Wed, 28 May 2014 00:30:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4S0UX89019440; Wed, 28 May 2014 00:30:33 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4S0UX7m019438; Wed, 28 May 2014 00:30:33 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201405280030.s4S0UX7m019438@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 28 May 2014 00:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266779 - in head/release/picobsd: floppy.tree/etc mfs_tree/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 00:30:33 -0000 Author: luigi Date: Wed May 28 00:30:32 2014 New Revision: 266779 URL: http://svnweb.freebsd.org/changeset/base/266779 Log: add '3wire' (no handshake lines) to gettytab and ttys so that after svn 264175 bhyve etc. work -- without that, /usr/bin/login would stop in getpass() MFC after: 3 days Modified: head/release/picobsd/floppy.tree/etc/ttys head/release/picobsd/mfs_tree/etc/gettytab Modified: head/release/picobsd/floppy.tree/etc/ttys ============================================================================== --- head/release/picobsd/floppy.tree/etc/ttys Tue May 27 23:57:22 2014 (r266778) +++ head/release/picobsd/floppy.tree/etc/ttys Wed May 28 00:30:32 2014 (r266779) @@ -32,4 +32,4 @@ ttyp6 none network secure ttyp7 none network secure ttyp8 none network secure ttyp9 none network secure -ttyu0 "/usr/libexec/getty std.9600" dialup on secure +ttyu0 "/usr/libexec/getty 3wire" dialup on secure Modified: head/release/picobsd/mfs_tree/etc/gettytab ============================================================================== --- head/release/picobsd/mfs_tree/etc/gettytab Tue May 27 23:57:22 2014 (r266778) +++ head/release/picobsd/mfs_tree/etc/gettytab Wed May 28 00:30:32 2014 (r266779) @@ -4,12 +4,15 @@ default:\ :cb:ce:ck:lc:fd#1000:cl:im=\r\nPicoBSD (%h) (%t)\r\n\r\n:sp#1200: -P|Pc|Pc console:\ +# 20140527 add nc (no carrier) to the pc console entry to fix +# devices with no handshake after svn 264175 (this also affects bhyve) +P|Pc|Pc console|3wire:\ + :nc:\ :ht:np:sp#115200: # Fixed speed entries 2|std.9600|9600-baud:\ - :np:sp#9600: + :nc:np:sp#9600: g|std.19200|19200-baud:\ :np:sp#19200: std.38400|38400-baud:\ From owner-svn-src-head@FreeBSD.ORG Wed May 28 00:36:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10F82609; Wed, 28 May 2014 00:36:57 +0000 (UTC) Received: from mail-we0-x234.google.com (mail-we0-x234.google.com [IPv6:2a00:1450:400c:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26BB626FC; Wed, 28 May 2014 00:36:56 +0000 (UTC) Received: by mail-we0-f180.google.com with SMTP id q58so1565580wes.25 for ; Tue, 27 May 2014 17:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Q5BZ4iXycHNeGze7NHlbtVvlutK6dAY9NnJT2kNqHiY=; b=eEnPxpL9+HTN2NAfJG3wtjZ5V51HdiVRcN87FZnQm7ab927hARTqu5pF1czSdmqt+A hJfAMkK5HbogtpHubnLqlYe+QdUShVeD/Bg1i/AZNF1RsothP9peyw+djLZ2TYa9JQZ6 enytjnhwIfR55avldDFR/8AnujKNQi4F86Hk3T+ORhWAhIT1GNqCpu277SEE4c9Kuv/Z ZNE7Sp3kE3uIaJIB+rxbV1tdR/Pz9IljIlBlysj8Q2yxAaUd4S+ytVoR5w9akd990oEF q06CLx3NUXMnrZjEs2dr1rRHrGP+XB9bhCoAyCAemxJZzpJ+TCEb5kIHeETJI6Yp4tIq fvpg== MIME-Version: 1.0 X-Received: by 10.180.183.131 with SMTP id em3mr42777672wic.56.1401237414141; Tue, 27 May 2014 17:36:54 -0700 (PDT) Sender: rizzo.unipi@gmail.com Received: by 10.194.246.130 with HTTP; Tue, 27 May 2014 17:36:54 -0700 (PDT) In-Reply-To: <201405271818.s4RIIff9045225@svn.freebsd.org> References: <201405271818.s4RIIff9045225@svn.freebsd.org> Date: Wed, 28 May 2014 02:36:54 +0200 X-Google-Sender-Auth: C01TUgAg1-Mf5pdZipa1zSSWm78 Message-ID: Subject: Re: svn commit: r266757 - in head/sys: conf dev/cxgbe dev/cxgbe/common modules/cxgbe/if_cxgbe From: Luigi Rizzo To: Navdeep Parhar Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 00:36:57 -0000 On Tue, May 27, 2014 at 8:18 PM, Navdeep Parhar wrote: > Author: np > Date: Tue May 27 18:18:41 2014 > New Revision: 266757 > URL: http://svnweb.freebsd.org/changeset/base/266757 > > Log: > cxgbe(4): netmap support for Terminator 5 (T5) based 10G/40G cards. > Netmap gets its own hardware-assisted virtual interface and won't take > over or disrupt the "normal" interface in any way. You can use both > simultaneously. > > For kernels with DEV_NETMAP, cxgbe(4) carves out an ncxl interface > (note the 'n' prefix) in the hardware to accompany each cxl > interface. These two ifnet's per port share the same wire but really > are separate interfaces in the hardware and software. Each gets its ow= n > L2 MAC addresses (unicast and multicast), MTU, checksum caps, etc. You > should run netmap on the 'n' interfaces only, that's what they are for. > > With this, pkt-gen is able to transmit > 45Mpps out of a single 40G por= t > =E2=80=8Band just for the records, this is with 1 core in userland. Very cool. Do you have an easy way to check what kind of throughput you get when the netmap interface has one hw queue ? cheers luigi of a T580 card. 2 port tx is at ~56Mpps total (28M + 28M) as of now. > Single port receive is at 33Mpps but this is very much a work in > progress. I expect it to be closer to 40Mpps once done. In any case > the current effort can already saturate multiple 10G ports of a T5 card > at the smallest legal packet size. T4 gear is totally untested. > > trantor:~# ./pkt-gen -i ncxl0 -f tx -D 00:07:43:ab:cd:ef > 881.952141 main [1621] interface is ncxl0 > 881.952250 extract_ip_range [275] range is 10.0.0.1:0 to 10.0.0.1:0 > 881.952253 extract_ip_range [275] range is 10.1.0.1:0 to 10.1.0.1:0 > 881.962540 main [1804] mapped 334980KB at 0x801dff000 > Sending on netmap:ncxl0: 4 queues, 1 threads and 1 cpus. > 10.0.0.1 -> 10.1.0.1 (00:00:00:00:00:00 -> 00:07:43:ab:cd:ef) > 881.962562 main [1882] Sending 512 packets every 0.000000000 s > 881.962563 main [1884] Wait 2 secs for phy reset > 884.088516 main [1886] Ready... > 884.088535 nm_open [457] overriding ifname ncxl0 ringid 0x0 flags 0x1 > 884.088607 sender_body [996] start > 884.093246 sender_body [1064] drop copy > 885.090435 main_thread [1418] 45206353 pps (45289533 pkts in 1001840 > usec) > 886.091600 main_thread [1418] 45322792 pps (45375593 pkts in 1001165 > usec) > 887.092435 main_thread [1418] 45313992 pps (45351784 pkts in 1000834 > usec) > 888.094434 main_thread [1418] 45315765 pps (45406397 pkts in 1002000 > usec) > 889.095434 main_thread [1418] 45333218 pps (45378551 pkts in 1001000 > usec) > 890.097434 main_thread [1418] 45315247 pps (45405877 pkts in 1002000 > usec) > 891.099434 main_thread [1418] 45326515 pps (45417168 pkts in 1002000 > usec) > 892.101434 main_thread [1418] 45333039 pps (45423705 pkts in 1002000 > usec) > 893.103434 main_thread [1418] 45324105 pps (45414708 pkts in 1001999 > usec) > 894.105434 main_thread [1418] 45318042 pps (45408723 pkts in 1002001 > usec) > 895.106434 main_thread [1418] 45332430 pps (45377762 pkts in 1001000 > usec) > 896.107434 main_thread [1418] 45338072 pps (45383410 pkts in 1001000 > usec) > ... > > Relnotes: Yes > Sponsored by: Chelsio Communications. > > Added: > head/sys/dev/cxgbe/t4_netmap.c (contents, props changed) > Modified: > head/sys/conf/files > head/sys/dev/cxgbe/adapter.h > head/sys/dev/cxgbe/common/common.h > head/sys/dev/cxgbe/common/t4_hw.c > head/sys/dev/cxgbe/t4_main.c > head/sys/dev/cxgbe/t4_sge.c > head/sys/modules/cxgbe/if_cxgbe/Makefile > > From owner-svn-src-head@FreeBSD.ORG Wed May 28 00:42:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B81828B3; Wed, 28 May 2014 00:42:11 +0000 (UTC) Received: from mail-pa0-x235.google.com (mail-pa0-x235.google.com [IPv6:2607:f8b0:400e:c03::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F9A827B2; Wed, 28 May 2014 00:42:11 +0000 (UTC) Received: by mail-pa0-f53.google.com with SMTP id kp14so9948201pab.26 for ; Tue, 27 May 2014 17:42:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=YcGYU8s/61iCfYYEv35u54Jk6cSckf6TByH0PRAs8KM=; b=GWywMUep5bjjOLQT7Ldfg/UO2+/8TxAlJQZpjUjQLmBEpef7ByDvmDk5KuoNp58VFw OKOKSU2A604jbIy/VD8/xWoK3VNs1z0ePPuOWNzajUJaXwv3IE+v9gLxWgDHCLQcR9Ad 8DCexNnLw1e38xZY2m9nKGIooGE7Jt31OGQRa/qsvKUTzrHzy33KqviQmdAoJSO/TsiB 84mbgLbA5M5XjGdP7OZ6CAVpZRagoQrq4Iy6IiP0oUQhXFW5ywH5aywojO61O/gpKKI+ vEzfULX1qQSlPSv8P1UsPn3ssmwqHh9TZi1ylUmMH4BNmfsyuMjRhJH4QQHfDbkTOkpO BjxA== X-Received: by 10.66.244.140 with SMTP id xg12mr35369659pac.23.1401237730662; Tue, 27 May 2014 17:42:10 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id oa3sm25319955pbb.15.2014.05.27.17.42.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 May 2014 17:42:09 -0700 (PDT) Sender: Navdeep Parhar Message-ID: <538530E0.9090309@FreeBSD.org> Date: Tue, 27 May 2014 17:42:08 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Luigi Rizzo Subject: Re: svn commit: r266757 - in head/sys: conf dev/cxgbe dev/cxgbe/common modules/cxgbe/if_cxgbe References: <201405271818.s4RIIff9045225@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 00:42:11 -0000 On 05/27/14 17:36, Luigi Rizzo wrote: >=20 >=20 >=20 > On Tue, May 27, 2014 at 8:18 PM, Navdeep Parhar > wrote: >=20 > Author: np > Date: Tue May 27 18:18:41 2014 > New Revision: 266757 > URL: http://svnweb.freebsd.org/changeset/base/266757 >=20 > Log: > cxgbe(4): netmap support for Terminator 5 (T5) based 10G/40G card= s. > Netmap gets its own hardware-assisted virtual interface and won't= take > over or disrupt the "normal" interface in any way. You can use b= oth > simultaneously. >=20 > For kernels with DEV_NETMAP, cxgbe(4) carves out an ncxl inter= face > (note the 'n' prefix) in the hardware to accompany each cxl > interface. These two ifnet's per port share the same wire but re= ally > are separate interfaces in the hardware and software. Each gets > its own > L2 MAC addresses (unicast and multicast), MTU, checksum caps, etc= =2E > You > should run netmap on the 'n' interfaces only, that's what they ar= e > for. >=20 > With this, pkt-gen is able to transmit > 45Mpps out of a single > 40G port >=20 >=20 > =E2=80=8Band just for the records, this is with 1 core in userland. > Very cool. >=20 > Do you have an easy way to check what kind of throughput > you get when the netmap interface has one hw queue ? Both tx and rx are at around ~33Mpps right now with one hardware queue. That's more than enough to saturate a 40G link with 128B sized frames. Regards, Navdeep >=20 > cheers > luigi >=20 > of a T580 card. 2 port tx is at ~56Mpps total (28M + 28M) as of = now. > Single port receive is at 33Mpps but this is very much a work in > progress. I expect it to be closer to 40Mpps once done. In any = case > the current effort can already saturate multiple 10G ports of a T= 5 > card > at the smallest legal packet size. T4 gear is totally untested. >=20 > trantor:~# ./pkt-gen -i ncxl0 -f tx -D 00:07:43:ab:cd:ef > 881.952141 main [1621] interface is ncxl0 > 881.952250 extract_ip_range [275] range is 10.0.0.1:0 > to 10.0.0.1:0 > 881.952253 extract_ip_range [275] range is 10.1.0.1:0 > to 10.1.0.1:0 > 881.962540 main [1804] mapped 334980KB at 0x801dff000 > Sending on netmap:ncxl0: 4 queues, 1 threads and 1 cpus. > 10.0.0.1 -> 10.1.0.1 (00:00:00:00:00:00 -> 00:07:43:ab:cd:ef) > 881.962562 main [1882] Sending 512 packets every 0.000000000 s > 881.962563 main [1884] Wait 2 secs for phy reset > 884.088516 main [1886] Ready... > 884.088535 nm_open [457] overriding ifname ncxl0 ringid 0x0 flags= 0x1 > 884.088607 sender_body [996] start > 884.093246 sender_body [1064] drop copy > 885.090435 main_thread [1418] 45206353 pps (45289533 pkts in > 1001840 usec) > 886.091600 main_thread [1418] 45322792 pps (45375593 pkts in > 1001165 usec) > 887.092435 main_thread [1418] 45313992 pps (45351784 pkts in > 1000834 usec) > 888.094434 main_thread [1418] 45315765 pps (45406397 pkts in > 1002000 usec) > 889.095434 main_thread [1418] 45333218 pps (45378551 pkts in > 1001000 usec) > 890.097434 main_thread [1418] 45315247 pps (45405877 pkts in > 1002000 usec) > 891.099434 main_thread [1418] 45326515 pps (45417168 pkts in > 1002000 usec) > 892.101434 main_thread [1418] 45333039 pps (45423705 pkts in > 1002000 usec) > 893.103434 main_thread [1418] 45324105 pps (45414708 pkts in > 1001999 usec) > 894.105434 main_thread [1418] 45318042 pps (45408723 pkts in > 1002001 usec) > 895.106434 main_thread [1418] 45332430 pps (45377762 pkts in > 1001000 usec) > 896.107434 main_thread [1418] 45338072 pps (45383410 pkts in > 1001000 usec) > ... >=20 > Relnotes: Yes > Sponsored by: Chelsio Communications. >=20 > Added: > head/sys/dev/cxgbe/t4_netmap.c (contents, props changed) > Modified: > head/sys/conf/files > head/sys/dev/cxgbe/adapter.h > head/sys/dev/cxgbe/common/common.h > head/sys/dev/cxgbe/common/t4_hw.c > head/sys/dev/cxgbe/t4_main.c > head/sys/dev/cxgbe/t4_sge.c > head/sys/modules/cxgbe/if_cxgbe/Makefile >=20 From owner-svn-src-head@FreeBSD.ORG Wed May 28 00:45:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4223DA43; Wed, 28 May 2014 00:45:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F26227CD; Wed, 28 May 2014 00:45:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4S0jaNO025354; Wed, 28 May 2014 00:45:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4S0jafd025353; Wed, 28 May 2014 00:45:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405280045.s4S0jafd025353@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 28 May 2014 00:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266780 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 00:45:36 -0000 Author: kib Date: Wed May 28 00:45:35 2014 New Revision: 266780 URL: http://svnweb.freebsd.org/changeset/base/266780 Log: Remove the assert which can be triggered by the userspace. The situation checked by assert is verified to not take place in vm_map_wire(), and protection permissions on the wired entry can be revoked afterward. Reported by: markj Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed May 28 00:30:32 2014 (r266779) +++ head/sys/vm/vm_map.c Wed May 28 00:45:35 2014 (r266780) @@ -1986,11 +1986,8 @@ vm_map_protect(vm_map_t map, vm_offset_t */ if ((current->eflags & MAP_ENTRY_USER_WIRED) != 0 && (current->protection & VM_PROT_WRITE) != 0 && - (old_prot & VM_PROT_WRITE) == 0) { - KASSERT(old_prot != VM_PROT_NONE, - ("vm_map_protect: inaccessible wired map entry")); + (old_prot & VM_PROT_WRITE) == 0) vm_fault_copy_entry(map, map, current, current, NULL); - } /* * When restricting access, update the physical map. Worry From owner-svn-src-head@FreeBSD.ORG Wed May 28 03:02:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D0E5B2A; Wed, 28 May 2014 03:02:26 +0000 (UTC) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40AAE223C; Wed, 28 May 2014 03:02:26 +0000 (UTC) Received: from pool-96-250-5-187.nycmny.fios.verizon.net ([96.250.5.187]:52687 helo=[192.168.1.11]) by vps.hungerhost.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80.1) (envelope-from ) id 1WpU8E-00078t-Vk; Tue, 27 May 2014 23:02:23 -0400 From: "George Neville-Neil" To: "Navdeep Parhar" Subject: Re: svn commit: r266757 - in head/sys: conf dev/cxgbe dev/cxgbe/common modules/cxgbe/if_cxgbe Date: Tue, 27 May 2014 23:02:20 -0400 Message-ID: <897F102E-BDE2-454B-964A-BAF02369E70E@neville-neil.com> In-Reply-To: <538530E0.9090309@FreeBSD.org> References: <201405271818.s4RIIff9045225@svn.freebsd.org> <538530E0.9090309@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Mailer: MailMate (1.7.2r3905) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Luigi Rizzo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 03:02:26 -0000 On 27 May 2014, at 20:42, Navdeep Parhar wrote: > On 05/27/14 17:36, Luigi Rizzo wrote: >> >> >> >> On Tue, May 27, 2014 at 8:18 PM, Navdeep Parhar > > wrote: >> >> Author: np >> Date: Tue May 27 18:18:41 2014 >> New Revision: 266757 >> URL: http://svnweb.freebsd.org/changeset/base/266757 >> >> Log: >> cxgbe(4): netmap support for Terminator 5 (T5) based 10G/40G cards. >> Netmap gets its own hardware-assisted virtual interface and won't take >> over or disrupt the "normal" interface in any way. You can use both >> simultaneously. >> >> For kernels with DEV_NETMAP, cxgbe(4) carves out an ncxl interface >> (note the 'n' prefix) in the hardware to accompany each cxl >> interface. These two ifnet's per port share the same wire but really >> are separate interfaces in the hardware and software. Each gets >> its own >> L2 MAC addresses (unicast and multicast), MTU, checksum caps, etc. >> You >> should run netmap on the 'n' interfaces only, that's what they are >> for. >> >> With this, pkt-gen is able to transmit > 45Mpps out of a single >> 40G port >> >> >> ​and just for the records, this is with 1 core in userland. >> Very cool. >> >> Do you have an easy way to check what kind of throughput >> you get when the netmap interface has one hw queue ? > > Both tx and rx are at around ~33Mpps right now with one hardware queue. > That's more than enough to saturate a 40G link with 128B sized frames. > We need to port more tools to netmap now that it's in more drivers. I'm looking at iperf3 but there are other packet oriented daemons we ought to be porting as well. PTPd is, of course, on my list. Best, George From owner-svn-src-head@FreeBSD.ORG Wed May 28 05:57:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2172683D; Wed, 28 May 2014 05:57:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F66E2E42; Wed, 28 May 2014 05:57:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4S5vZIn062070; Wed, 28 May 2014 05:57:35 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4S5vZ50062069; Wed, 28 May 2014 05:57:35 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201405280557.s4S5vZ50062069@svn.freebsd.org> From: Dmitry Chagin Date: Wed, 28 May 2014 05:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266782 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 05:57:36 -0000 Author: dchagin Date: Wed May 28 05:57:35 2014 New Revision: 266782 URL: http://svnweb.freebsd.org/changeset/base/266782 Log: In r218101 I have not changed properly the futex syscall definition. Some Linux futex ops atomically verifies that the futex address uaddr (uval) contains the value val. Comparing signed uval and unsigned val may lead to an unexpected result, mostly to a deadlock. So copyin uaddr to an unsigned int to compare the parameters correctly. While here change ktr records to print parameters in more readable format. Tested by eadler@ MFC after: 3 days Modified: head/sys/compat/linux/linux_futex.c Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Wed May 28 03:10:16 2014 (r266781) +++ head/sys/compat/linux/linux_futex.c Wed May 28 05:57:35 2014 (r266782) @@ -679,12 +679,12 @@ futex_atomic_op(struct thread *td, int e int linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args) { - int clockrt, nrwake, op_ret, ret, val; + int clockrt, nrwake, op_ret, ret; struct linux_emuldata *em; struct waiting_proc *wp; struct futex *f, *f2; int error; - uint32_t flags; + uint32_t flags, val; LIN_SDT_PROBE2(futex, linux_sys_futex, entry, td, args); @@ -721,7 +721,7 @@ linux_sys_futex(struct thread *td, struc case LINUX_FUTEX_WAIT_BITSET: LIN_SDT_PROBE3(futex, linux_sys_futex, debug_wait, args->uaddr, args->val, args->val3); - LINUX_CTR3(sys_futex, "WAIT uaddr %p val %d val3 %d", + LINUX_CTR3(sys_futex, "WAIT uaddr %p val 0x%x bitset 0x%x", args->uaddr, args->val, args->val3); error = futex_get(args->uaddr, &wp, &f, @@ -746,9 +746,9 @@ linux_sys_futex(struct thread *td, struc LIN_SDT_PROBE4(futex, linux_sys_futex, debug_wait_value_neq, args->uaddr, args->val, val, args->val3); - LINUX_CTR4(sys_futex, - "WAIT uaddr %p val %d != uval %d val3 %d", - args->uaddr, args->val, val, args->val3); + LINUX_CTR3(sys_futex, + "WAIT uaddr %p val 0x%x != uval 0x%x", + args->uaddr, args->val, val); futex_put(f, wp); LIN_SDT_PROBE1(futex, linux_sys_futex, return, @@ -766,7 +766,7 @@ linux_sys_futex(struct thread *td, struc case LINUX_FUTEX_WAKE_BITSET: LIN_SDT_PROBE3(futex, linux_sys_futex, debug_wake, args->uaddr, args->val, args->val3); - LINUX_CTR3(sys_futex, "WAKE uaddr %p val % d val3 %d", + LINUX_CTR3(sys_futex, "WAKE uaddr %p nrwake 0x%x bitset 0x%x", args->uaddr, args->val, args->val3); error = futex_get(args->uaddr, NULL, &f, @@ -791,9 +791,9 @@ linux_sys_futex(struct thread *td, struc args->uaddr, args->val, args->val3, args->uaddr2, args->timeout); LINUX_CTR5(sys_futex, "CMP_REQUEUE uaddr %p " - "val %d val3 %d uaddr2 %p val2 %d", + "nrwake 0x%x uval 0x%x uaddr2 %p nrequeue 0x%x", args->uaddr, args->val, args->val3, args->uaddr2, - (int)(unsigned long)args->timeout); + args->timeout); /* * Linux allows this, we would not, it is an incorrect @@ -842,7 +842,7 @@ linux_sys_futex(struct thread *td, struc if (val != args->val3) { LIN_SDT_PROBE2(futex, linux_sys_futex, debug_cmp_requeue_value_neq, args->val, val); - LINUX_CTR2(sys_futex, "CMP_REQUEUE val %d != uval %d", + LINUX_CTR2(sys_futex, "CMP_REQUEUE val 0x%x != uval 0x%x", args->val, val); futex_put(f2, NULL); futex_put(f, NULL); @@ -861,9 +861,9 @@ linux_sys_futex(struct thread *td, struc LIN_SDT_PROBE5(futex, linux_sys_futex, debug_wake_op, args->uaddr, args->op, args->val, args->uaddr2, args->val3); LINUX_CTR5(sys_futex, "WAKE_OP " - "uaddr %p op %d val %x uaddr2 %p val3 %x", - args->uaddr, args->op, args->val, - args->uaddr2, args->val3); + "uaddr %p nrwake 0x%x uaddr2 %p op 0x%x nrwake2 0x%x", + args->uaddr, args->val, args->uaddr2, args->val3, + args->timeout); error = futex_get(args->uaddr, NULL, &f, flags); if (error) { @@ -886,6 +886,9 @@ linux_sys_futex(struct thread *td, struc */ op_ret = futex_atomic_op(td, args->val3, args->uaddr2); + LINUX_CTR2(sys_futex, "WAKE_OP atomic_op uaddr %p ret 0x%x", + args->uaddr, op_ret); + if (op_ret < 0) { /* XXX: We don't handle the EFAULT yet. */ if (op_ret != -EFAULT) { From owner-svn-src-head@FreeBSD.ORG Wed May 28 06:00:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E1EA9DF; Wed, 28 May 2014 06:00:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B07E2ECF; Wed, 28 May 2014 06:00:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4S60u4f062769; Wed, 28 May 2014 06:00:56 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4S60tix062763; Wed, 28 May 2014 06:00:55 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201405280600.s4S60tix062763@svn.freebsd.org> From: Ruslan Bukin Date: Wed, 28 May 2014 06:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266783 - in head/sys: arm/conf boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 06:00:56 -0000 Author: br Date: Wed May 28 06:00:55 2014 New Revision: 266783 URL: http://svnweb.freebsd.org/changeset/base/266783 Log: o Add kernel configuration for HP Chromebook 11 o Use machine codename in filenames o Add GEOM_PART_GPT kernel option Submitted by: Maxim Ignatenko Added: head/sys/arm/conf/CHROMEBOOK-SNOW (contents, props changed) head/sys/arm/conf/CHROMEBOOK-SPRING (contents, props changed) head/sys/boot/fdt/dts/arm/exynos5250-chromebook-snow.dts - copied unchanged from r266781, head/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts head/sys/boot/fdt/dts/arm/exynos5250-chromebook-spring.dts (contents, props changed) Deleted: head/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts Modified: head/sys/arm/conf/CHROMEBOOK head/sys/arm/conf/EXYNOS5250.common Modified: head/sys/arm/conf/CHROMEBOOK ============================================================================== --- head/sys/arm/conf/CHROMEBOOK Wed May 28 05:57:35 2014 (r266782) +++ head/sys/arm/conf/CHROMEBOOK Wed May 28 06:00:55 2014 (r266783) @@ -1,4 +1,4 @@ -# Kernel configuration for Samsung Chromebook (Exynos5 Dual machine). +# Kernel configuration for Chromebook (Exynos5 Dual machine). # # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: @@ -34,5 +34,3 @@ device ukbd #FDT options FDT -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=exynos5250-chromebook.dts Added: head/sys/arm/conf/CHROMEBOOK-SNOW ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/CHROMEBOOK-SNOW Wed May 28 06:00:55 2014 (r266783) @@ -0,0 +1,28 @@ +# Kernel configuration for Samsung Chromebook (Exynos5 Dual machine). +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +#NO_UNIVERSE + +include "CHROMEBOOK" +ident CHROMEBOOK-SNOW + +#FDT +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=exynos5250-chromebook-snow.dts Added: head/sys/arm/conf/CHROMEBOOK-SPRING ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/CHROMEBOOK-SPRING Wed May 28 06:00:55 2014 (r266783) @@ -0,0 +1,28 @@ +# Kernel configuration for HP Chromebook 11 (Exynos5 Dual machine). +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +#NO_UNIVERSE + +include "CHROMEBOOK" +ident CHROMEBOOK-SPRING + +#FDT +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=exynos5250-chromebook-spring.dts Modified: head/sys/arm/conf/EXYNOS5250.common ============================================================================== --- head/sys/arm/conf/EXYNOS5250.common Wed May 28 05:57:35 2014 (r266782) +++ head/sys/arm/conf/EXYNOS5250.common Wed May 28 06:00:55 2014 (r266783) @@ -31,6 +31,7 @@ options INET # InterNETworking options INET6 # IPv6 communications protocols options GEOM_PART_BSD # BSD partition scheme options GEOM_PART_MBR # MBR partition scheme +options GEOM_PART_GPT # GUID partition tables options TMPFS # Efficient memory filesystem options FFS # Berkeley Fast Filesystem options SOFTUPDATES Copied: head/sys/boot/fdt/dts/arm/exynos5250-chromebook-snow.dts (from r266781, head/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/exynos5250-chromebook-snow.dts Wed May 28 06:00:55 2014 (r266783, copy of r266781, head/sys/boot/fdt/dts/arm/exynos5250-chromebook.dts) @@ -0,0 +1,72 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/include/ "exynos5250.dtsi" + +/ { + model = "Samsung Chromebook"; + + memory { + device_type = "memory"; + reg = < 0x40000000 0x80000000 >; /* 2G */ + }; + + SOC: Exynos5@0 { + + pad0: pad@11400000 { + status = "okay"; + }; + + fimd0: fimd@14400000 { + status = "okay"; + + panel-size = < 1366 768 >; + panel-hsync = < 80 32 48 >; + panel-vsync = < 14 5 3 >; + panel-clk-div = < 17 >; + panel-backlight-pin = < 25 >; + }; + + i2c4: i2c@12CA0000 { + status = "okay"; + }; + + keyboard-controller { + compatible = "google,cros-ec-keyb"; + keypad,num-rows = <8>; + keypad,num-columns = <13>; + }; + }; + + chosen { + stdin = &serial2; + stdout = &serial2; + }; +}; Added: head/sys/boot/fdt/dts/arm/exynos5250-chromebook-spring.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/exynos5250-chromebook-spring.dts Wed May 28 06:00:55 2014 (r266783) @@ -0,0 +1,72 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/include/ "exynos5250.dtsi" + +/ { + model = "HP Chromebook 11"; + + memory { + device_type = "memory"; + reg = < 0x40000000 0x80000000 >; /* 2G */ + }; + + SOC: Exynos5@0 { + + pad0: pad@11400000 { + status = "okay"; + }; + + fimd0: fimd@14400000 { + status = "okay"; + + panel-size = < 1366 768 >; + panel-hsync = < 80 32 48 >; + panel-vsync = < 14 5 3 >; + panel-clk-div = < 17 >; + panel-backlight-pin = < 25 >; + }; + + i2c4: i2c@12CA0000 { + status = "okay"; + }; + + keyboard-controller { + compatible = "google,cros-ec-keyb"; + keypad,num-rows = <8>; + keypad,num-columns = <13>; + }; + }; + + chosen { + stdin = &serial2; + stdout = &serial2; + }; +}; From owner-svn-src-head@FreeBSD.ORG Wed May 28 06:11:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C50F1CDF; Wed, 28 May 2014 06:11:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2AA42FA1; Wed, 28 May 2014 06:11:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4S6BCKo068866; Wed, 28 May 2014 06:11:12 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4S6BCR9068863; Wed, 28 May 2014 06:11:12 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201405280611.s4S6BCR9068863@svn.freebsd.org> From: Ruslan Bukin Date: Wed, 28 May 2014 06:11:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266785 - in head/sys: arm/samsung/exynos boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 06:11:13 -0000 Author: br Date: Wed May 28 06:11:12 2014 New Revision: 266785 URL: http://svnweb.freebsd.org/changeset/base/266785 Log: Describe I2C arbitrator device in DTS and use it for Chromebook Snow only. Submitted by: Maxim Ignatenko Modified: head/sys/arm/samsung/exynos/chrome_ec.c head/sys/boot/fdt/dts/arm/exynos5250-chromebook-snow.dts Modified: head/sys/arm/samsung/exynos/chrome_ec.c ============================================================================== --- head/sys/arm/samsung/exynos/chrome_ec.c Wed May 28 06:02:04 2014 (r266784) +++ head/sys/arm/samsung/exynos/chrome_ec.c Wed May 28 06:11:12 2014 (r266785) @@ -60,12 +60,11 @@ __FBSDID("$FreeBSD$"); #include -/* TODO: export to DTS */ -#define OUR_GPIO 177 -#define EC_GPIO 168 - struct ec_softc { device_t dev; + int have_arbitrator; + pcell_t our_gpio; + pcell_t ec_gpio; }; struct ec_softc *ec_sc; @@ -82,17 +81,24 @@ bus_claim(struct ec_softc *sc) device_t gpio_dev; int status; + if (sc->our_gpio == 0 || sc->ec_gpio == 0) { + device_printf(sc->dev, "i2c arbitrator is not configured\n"); + return (1); + } + gpio_dev = devclass_get_device(devclass_find("gpio"), 0); - if (gpio_dev == NULL) { + if (gpio_dev == NULL) { device_printf(sc->dev, "cant find gpio_dev\n"); return (1); } /* Say we want the bus */ - GPIO_PIN_SET(gpio_dev, OUR_GPIO, GPIO_PIN_LOW); + GPIO_PIN_SET(gpio_dev, sc->our_gpio, GPIO_PIN_LOW); + + /* TODO(imax): insert a delay to allow EC to react. */ /* Check EC decision */ - GPIO_PIN_GET(gpio_dev, EC_GPIO, &status); + GPIO_PIN_GET(gpio_dev, sc->ec_gpio, &status); if (status == 1) { /* Okay. We have bus */ @@ -108,13 +114,18 @@ bus_release(struct ec_softc *sc) { device_t gpio_dev; + if (sc->our_gpio == 0 || sc->ec_gpio == 0) { + device_printf(sc->dev, "i2c arbitrator is not configured\n"); + return (1); + } + gpio_dev = devclass_get_device(devclass_find("gpio"), 0); - if (gpio_dev == NULL) { + if (gpio_dev == NULL) { device_printf(sc->dev, "cant find gpio_dev\n"); return (1); } - GPIO_PIN_SET(gpio_dev, OUR_GPIO, GPIO_PIN_HIGH); + GPIO_PIN_SET(gpio_dev, sc->our_gpio, GPIO_PIN_HIGH); return (0); } @@ -209,6 +220,28 @@ int ec_hello(void) return (0); } +static void +configure_i2c_arbitrator(struct ec_softc *sc) +{ + phandle_t arbitrator; + + /* TODO(imax): look for compatible entry instead of hard-coded path */ + arbitrator = OF_finddevice("/i2c-arbitrator"); + if (arbitrator > 0 && + OF_hasprop(arbitrator, "freebsd,our-gpio") && + OF_hasprop(arbitrator, "freebsd,ec-gpio")) { + sc->have_arbitrator = 1; + OF_getencprop(arbitrator, "freebsd,our-gpio", + &sc->our_gpio, sizeof(sc->our_gpio)); + OF_getencprop(arbitrator, "freebsd,ec-gpio", + &sc->ec_gpio, sizeof(sc->ec_gpio)); + } else { + sc->have_arbitrator = 0; + sc->our_gpio = 0; + sc->ec_gpio = 0; + } +} + static int ec_attach(device_t dev) { @@ -219,6 +252,8 @@ ec_attach(device_t dev) ec_sc = sc; + configure_i2c_arbitrator(sc); + /* * Claim the bus. * @@ -227,7 +262,7 @@ ec_attach(device_t dev) * */ - if (bus_claim(sc) != 0) { + if (sc->have_arbitrator && bus_claim(sc) != 0) { return (ENXIO); } @@ -241,7 +276,9 @@ ec_detach(device_t dev) sc = device_get_softc(dev); - bus_release(sc); + if (sc->have_arbitrator) { + bus_release(sc); + } return (0); } Modified: head/sys/boot/fdt/dts/arm/exynos5250-chromebook-snow.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/exynos5250-chromebook-snow.dts Wed May 28 06:02:04 2014 (r266784) +++ head/sys/boot/fdt/dts/arm/exynos5250-chromebook-snow.dts Wed May 28 06:11:12 2014 (r266785) @@ -65,6 +65,11 @@ }; }; + i2c-arbitrator { + freebsd,our-gpio = <177>; + freebsd,ec-gpio = <168>; + }; + chosen { stdin = &serial2; stdout = &serial2; From owner-svn-src-head@FreeBSD.ORG Wed May 28 06:11:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E6E7E12; Wed, 28 May 2014 06:11:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C70E2FA6; Wed, 28 May 2014 06:11:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4S6BGlD068916; Wed, 28 May 2014 06:11:16 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4S6BGFW068915; Wed, 28 May 2014 06:11:16 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405280611.s4S6BGFW068915@svn.freebsd.org> From: Christian Brueffer Date: Wed, 28 May 2014 06:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266786 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 06:11:16 -0000 Author: brueffer Date: Wed May 28 06:11:16 2014 New Revision: 266786 URL: http://svnweb.freebsd.org/changeset/base/266786 Log: Document support for Intel Centrino Wireless-N 105, added in r266770. MFC after: 2 weeks Modified: head/share/man/man4/iwn.4 Modified: head/share/man/man4/iwn.4 ============================================================================== --- head/share/man/man4/iwn.4 Wed May 28 06:11:12 2014 (r266785) +++ head/share/man/man4/iwn.4 Wed May 28 06:11:16 2014 (r266786) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 9, 2014 +.Dd May 28, 2014 .Dt IWN 4 .Os .Sh NAME @@ -92,6 +92,7 @@ driver provides support for: .It Intel Centrino Advanced-N + WiMAX 6250 .It Intel Centrino Ultimate-N 6300 .It Intel Centrino Wireless-N 100 +.It Intel Centrino Wireless-N 105 .It Intel Centrino Wireless-N 130 .It Intel Centrino Wireless-N 1000 .It Intel Centrino Wireless-N 1030 From owner-svn-src-head@FreeBSD.ORG Wed May 28 06:15:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA69DF88; Wed, 28 May 2014 06:15:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8B5A2FC1; Wed, 28 May 2014 06:15:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4S6Fjsi071393; Wed, 28 May 2014 06:15:45 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4S6FjbZ071392; Wed, 28 May 2014 06:15:45 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201405280615.s4S6FjbZ071392@svn.freebsd.org> From: Ruslan Bukin Date: Wed, 28 May 2014 06:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266787 - head/sys/arm/samsung/exynos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 06:15:45 -0000 Author: br Date: Wed May 28 06:15:45 2014 New Revision: 266787 URL: http://svnweb.freebsd.org/changeset/base/266787 Log: Add simple polling mechanism that works for KDB. Submitted by: Maxim Ignatenko Modified: head/sys/arm/samsung/exynos/chrome_kb.c Modified: head/sys/arm/samsung/exynos/chrome_kb.c ============================================================================== --- head/sys/arm/samsung/exynos/chrome_kb.c Wed May 28 06:11:16 2014 (r266786) +++ head/sys/arm/samsung/exynos/chrome_kb.c Wed May 28 06:15:45 2014 (r266787) @@ -131,6 +131,7 @@ struct ckb_softc { int rows; int cols; device_t dev; + device_t gpio_dev; struct thread *sc_poll_thread; uint8_t *scan_local; @@ -331,6 +332,7 @@ ckb_read_char_locked(keyboard_t *kbd, in uint16_t key; int oldbit; int newbit; + int status; sc = kbd->kb_data; @@ -347,7 +349,20 @@ ckb_read_char_locked(keyboard_t *kbd, in }; if (sc->sc_flags & CKB_FLAG_POLLING) { - /* TODO */ + for (;;) { + GPIO_PIN_GET(sc->gpio_dev, KB_GPIO_INT, &status); + if (status == 0) { + if (ec_command(EC_CMD_MKBP_STATE, sc->scan, sc->cols, + sc->scan, sc->cols)) { + return (NOKEY); + } + break; + } + if (!wait) { + return (NOKEY); + } + DELAY(1000); + } }; for (i = 0; i < sc->cols; i++) { @@ -710,6 +725,12 @@ chrome_kb_attach(device_t dev) if ((error = parse_dts(sc)) != 0) return error; + sc->gpio_dev = devclass_get_device(devclass_find("gpio"), 0); + if (sc->gpio_dev == NULL) { + device_printf(sc->dev, "Can't find gpio device.\n"); + return (ENXIO); + } + #if 0 device_printf(sc->dev, "Keyboard matrix [%dx%d]\n", sc->cols, sc->rows); From owner-svn-src-head@FreeBSD.ORG Wed May 28 06:50:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5391E79F; Wed, 28 May 2014 06:50:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42238224E; Wed, 28 May 2014 06:50:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4S6oHNG086026; Wed, 28 May 2014 06:50:17 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4S6oHma086025; Wed, 28 May 2014 06:50:17 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201405280650.s4S6oHma086025@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 28 May 2014 06:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266790 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 06:50:17 -0000 Author: luigi Date: Wed May 28 06:50:16 2014 New Revision: 266790 URL: http://svnweb.freebsd.org/changeset/base/266790 Log: reference the correct variable in a comment MFC after: 3 days Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Wed May 28 06:38:42 2014 (r266789) +++ head/sys/dev/e1000/if_igb.c Wed May 28 06:50:16 2014 (r266790) @@ -4331,7 +4331,7 @@ igb_setup_receive_ring(struct rx_ring *r rxbuf = &rxr->rx_buffers[j]; #ifdef DEV_NETMAP if (slot) { - /* slot sj is mapped to the i-th NIC-ring entry */ + /* slot sj is mapped to the j-th NIC-ring entry */ int sj = netmap_idx_n2k(&na->rx_rings[rxr->me], j); uint64_t paddr; void *addr; From owner-svn-src-head@FreeBSD.ORG Wed May 28 08:59:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6ABAE3DB; Wed, 28 May 2014 08:59:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58BBA2D93; Wed, 28 May 2014 08:59:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4S8xOWd043453; Wed, 28 May 2014 08:59:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4S8xONf043452; Wed, 28 May 2014 08:59:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201405280859.s4S8xONf043452@svn.freebsd.org> From: Marius Strobl Date: Wed, 28 May 2014 08:59:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266792 - head/sys/dev/drm2/radeon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 08:59:24 -0000 Author: marius Date: Wed May 28 08:59:23 2014 New Revision: 266792 URL: http://svnweb.freebsd.org/changeset/base/266792 Log: Fix DMA handling in radeon_dummy_page_init(): - Based on actual usage and on what Linux does, dummy_page.addr should contain the physical bus address of the dummy page rather than its virtual one. As a side-effect, correcting this bug fixes compilation with PAE support enabled by getting rid of an inappropriate cast. - Also based on actual usage of dummy_page.addr, theoretically Radeon devices could do a maximum of 44-bit DMA. In reality, though, it is more likely that they only support 32-bit DMA, at least that is what radeon_gart_table_ram_alloc() sets up for, too. However, passing ~0 to drm_pci_alloc() as maxaddr parameter translates to 64-bit DMA on amd64/64-bit machines. Thus, use BUS_SPACE_MAXSIZE_32BIT instead, which the existing 32-bit DMA limits within the drm2 code spelled as 0xFFFFFFFF should also be changed to. Reviewed by: dumbbell MFC after: 1 week Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: head/sys/dev/drm2/radeon/radeon_device.c Modified: head/sys/dev/drm2/radeon/radeon_device.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_device.c Wed May 28 07:35:48 2014 (r266791) +++ head/sys/dev/drm2/radeon/radeon_device.c Wed May 28 08:59:23 2014 (r266792) @@ -548,10 +548,10 @@ int radeon_dummy_page_init(struct radeon if (rdev->dummy_page.dmah) return 0; rdev->dummy_page.dmah = drm_pci_alloc(rdev->ddev, - PAGE_SIZE, PAGE_SIZE, ~0); + PAGE_SIZE, PAGE_SIZE, BUS_SPACE_MAXSIZE_32BIT); if (rdev->dummy_page.dmah == NULL) return -ENOMEM; - rdev->dummy_page.addr = (dma_addr_t)rdev->dummy_page.dmah->vaddr; + rdev->dummy_page.addr = rdev->dummy_page.dmah->busaddr; return 0; } From owner-svn-src-head@FreeBSD.ORG Wed May 28 09:01:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D57567D; Wed, 28 May 2014 09:01:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 718A82E1E; Wed, 28 May 2014 09:01:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4S91aYv046619; Wed, 28 May 2014 09:01:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4S91a6v046618; Wed, 28 May 2014 09:01:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201405280901.s4S91a6v046618@svn.freebsd.org> From: Marius Strobl Date: Wed, 28 May 2014 09:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266793 - head/sys/dev/sound/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 09:01:36 -0000 Author: marius Date: Wed May 28 09:01:35 2014 New Revision: 266793 URL: http://svnweb.freebsd.org/changeset/base/266793 Log: - Fix compilation with PAE support enabled by improving the casting of physical addresses. - Nuke the unused softc of emujoy(4). - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. MFC after: 3 days Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: head/sys/dev/sound/pci/emu10k1.c Modified: head/sys/dev/sound/pci/emu10k1.c ============================================================================== --- head/sys/dev/sound/pci/emu10k1.c Wed May 28 08:59:23 2014 (r266792) +++ head/sys/dev/sound/pci/emu10k1.c Wed May 28 09:01:35 2014 (r266793) @@ -1378,7 +1378,7 @@ emu_memalloc(struct sc_info *sc, u_int32 ofs = 0; for (idx = start; idx < start + blksz; idx++) { mem->bmap[idx >> 3] |= 1 << (idx & 7); - tmp = (u_int32_t)(u_long)((u_int8_t *)blk->buf_addr + ofs); + tmp = (bus_addr_t)((u_int8_t *)(uintptr_t)blk->buf_addr + ofs); #ifdef EMUDEBUG printf("pte[%d] -> %x phys, %x virt\n", idx, tmp, ((u_int32_t)buf) + ofs); @@ -2182,7 +2182,7 @@ static device_method_t emu_methods[] = { DEVMETHOD(device_attach, emu_pci_attach), DEVMETHOD(device_detach, emu_pci_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t emu_driver = { @@ -2191,7 +2191,7 @@ static driver_t emu_driver = { PCM_SOFTC_SIZE, }; -DRIVER_MODULE(snd_emu10k1, pci, emu_driver, pcm_devclass, 0, 0); +DRIVER_MODULE(snd_emu10k1, pci, emu_driver, pcm_devclass, NULL, NULL); MODULE_DEPEND(snd_emu10k1, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); MODULE_VERSION(snd_emu10k1, 1); MODULE_DEPEND(snd_emu10k1, midi, 1, 1, 1); @@ -2220,12 +2220,14 @@ emujoy_pci_probe(device_t dev) static int emujoy_pci_attach(device_t dev) { + return 0; } static int emujoy_pci_detach(device_t dev) { + return 0; } @@ -2234,16 +2236,15 @@ static device_method_t emujoy_methods[] DEVMETHOD(device_attach, emujoy_pci_attach), DEVMETHOD(device_detach, emujoy_pci_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t emujoy_driver = { "emujoy", emujoy_methods, - 8, + 1 /* no softc */ }; static devclass_t emujoy_devclass; -DRIVER_MODULE(emujoy, pci, emujoy_driver, emujoy_devclass, 0, 0); - +DRIVER_MODULE(emujoy, pci, emujoy_driver, emujoy_devclass, NULL, NULL); From owner-svn-src-head@FreeBSD.ORG Wed May 28 10:18:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A461D08; Wed, 28 May 2014 10:18:28 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EF89D2511; Wed, 28 May 2014 10:18:27 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 25D8025D388C; Wed, 28 May 2014 10:18:24 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 333ACC22BE8; Wed, 28 May 2014 10:18:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id DYM13uLrg_CF; Wed, 28 May 2014 10:18:21 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (unknown [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id A7960C22BD5; Wed, 28 May 2014 10:18:19 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266757 - in head/sys: conf dev/cxgbe dev/cxgbe/common modules/cxgbe/if_cxgbe From: "Bjoern A. Zeeb" In-Reply-To: <201405271818.s4RIIff9045225@svn.freebsd.org> Date: Wed, 28 May 2014 10:18:16 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405271818.s4RIIff9045225@svn.freebsd.org> To: Navdeep Parhar X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 10:18:28 -0000 On 27 May 2014, at 18:18 , Navdeep Parhar wrote: > Author: np > Date: Tue May 27 18:18:41 2014 > New Revision: 266757 > URL: http://svnweb.freebsd.org/changeset/base/266757 >=20 > Log: > cxgbe(4): netmap support for Terminator 5 (T5) based 10G/40G cards. > Netmap gets its own hardware-assisted virtual interface and won't = take > over or disrupt the "normal" interface in any way. You can use both > simultaneously. >=20 > For kernels with DEV_NETMAP, cxgbe(4) carves out an ncxl interface > (note the 'n' prefix) in the hardware to accompany each cxl > interface. These two ifnet's per port share the same wire but really > are separate interfaces in the hardware and software. Each gets its = own > L2 MAC addresses (unicast and multicast), MTU, checksum caps, etc. = You > should run netmap on the 'n' interfaces only, that's what they are = for. >=20 > With this, pkt-gen is able to transmit > 45Mpps out of a single 40G = port > of a T580 card. 2 port tx is at ~56Mpps total (28M + 28M) as of now. > Single port receive is at 33Mpps but this is very much a work in > progress. I expect it to be closer to 40Mpps once done. In any case > the current effort can already saturate multiple 10G ports of a T5 = card > at the smallest legal packet size. T4 gear is totally untested. >=20 > trantor:~# ./pkt-gen -i ncxl0 -f tx -D 00:07:43:ab:cd:ef > 881.952141 main [1621] interface is ncxl0 > 881.952250 extract_ip_range [275] range is 10.0.0.1:0 to 10.0.0.1:0 > 881.952253 extract_ip_range [275] range is 10.1.0.1:0 to 10.1.0.1:0 > 881.962540 main [1804] mapped 334980KB at 0x801dff000 > Sending on netmap:ncxl0: 4 queues, 1 threads and 1 cpus. > 10.0.0.1 -> 10.1.0.1 (00:00:00:00:00:00 -> 00:07:43:ab:cd:ef) > 881.962562 main [1882] Sending 512 packets every 0.000000000 s > 881.962563 main [1884] Wait 2 secs for phy reset > 884.088516 main [1886] Ready... > 884.088535 nm_open [457] overriding ifname ncxl0 ringid 0x0 flags 0x1 > 884.088607 sender_body [996] start > 884.093246 sender_body [1064] drop copy > 885.090435 main_thread [1418] 45206353 pps (45289533 pkts in 1001840 = usec) > 886.091600 main_thread [1418] 45322792 pps (45375593 pkts in 1001165 = usec) > 887.092435 main_thread [1418] 45313992 pps (45351784 pkts in 1000834 = usec) > 888.094434 main_thread [1418] 45315765 pps (45406397 pkts in 1002000 = usec) > 889.095434 main_thread [1418] 45333218 pps (45378551 pkts in 1001000 = usec) > 890.097434 main_thread [1418] 45315247 pps (45405877 pkts in 1002000 = usec) > 891.099434 main_thread [1418] 45326515 pps (45417168 pkts in 1002000 = usec) > 892.101434 main_thread [1418] 45333039 pps (45423705 pkts in 1002000 = usec) > 893.103434 main_thread [1418] 45324105 pps (45414708 pkts in 1001999 = usec) > 894.105434 main_thread [1418] 45318042 pps (45408723 pkts in 1002001 = usec) > 895.106434 main_thread [1418] 45332430 pps (45377762 pkts in 1001000 = usec) > 896.107434 main_thread [1418] 45338072 pps (45383410 pkts in 1001000 = usec) > ... >=20 > Relnotes: Yes > Sponsored by: Chelsio Communications. Really nice :-) Thanks a lot for getting it into the tree. =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@FreeBSD.ORG Wed May 28 10:50:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D91384E8; Wed, 28 May 2014 10:50:33 +0000 (UTC) Received: from mailrelay004.isp.belgacom.be (mailrelay004.isp.belgacom.be [195.238.6.170]) by mx1.freebsd.org (Postfix) with ESMTP id 33C0F279C; Wed, 28 May 2014 10:50:31 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsGAKu+hVNbsKWJ/2dsb2JhbABPCoMHw0wBgQgXdIIlAQEEATIBIyMQCw4KCSUPKh4GE4g6DAHVXReNdlwHhEABA5l0kyiDOjs Received: from 137.165-176-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.176.165.137]) by relay.skynet.be with ESMTP; 28 May 2014 12:50:28 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.8/8.14.8) with ESMTP id s4SAoR8h002045; Wed, 28 May 2014 12:50:28 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Wed, 28 May 2014 12:50:27 +0200 From: Tijl Coosemans To: Warner Losh Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140528125027.6d0cc4fb@kalimero.tijl.coosemans.org> In-Reply-To: <13EB325C-3882-46AA-9B17-3BF19997C978@bsdimp.com> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> <5380EBA8.1030200@freebsd.org> <20140525011307.142b41ab@kalimero.tijl.coosemans.org> <3CCAFAD3-FABE-40EF-ABF9-815FE5826349@bsdimp.com> <9FE34CE4-C71F-4806-9EF6-30CB1051C62F@bsdimp.com> <20140526113502.239db74d@kalimero.tijl.coosemans.org> <5383522F.30108@freebsd.org> <20140527001811.3e9d3e8d@kalimero.tijl.coosemans.org> <05D1A11D-5985-42EA-84AD-209A8B51D391@bsdimp.com> <20140527093633.0a922e13@kalimero.tijl.coosemans.org> <85FABD2B-81BB-4E1A-B61E-4216A144A9DB@bsdimp.com> <20140527214038.17d00369@kalimero.tijl.coosemans.org> <13EB325C-3882-46AA-9B17-3BF19997C978@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , Nathan Whitehorn , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 10:50:34 -0000 On Tue, 27 May 2014 14:31:44 -0600 Warner Losh wrote: > On May 27, 2014, at 1:40 PM, Tijl Coosemans wrote: >> On Tue, 27 May 2014 07:18:06 -0600 Warner Losh wrote: >>> On May 27, 2014, at 1:36 AM, Tijl Coosemans wrote: >>>> On Mon, 26 May 2014 16:31:21 -0600 Warner Losh wrote: >>> So I?m still waiting for a use case that requires the new names. One has >>> not been articulated, and I don?t think one actually exists. >> >> Imagine you've built a system with MACHINE_ARCH amd64 and one with >> MACHINE_ARCH mips64. Now you want to populate these systems with a list >> of packages for which you wrote a script. These systems each support 2 >> ABIs: a native 64-bit one (amd64 and mips64) and a native 32-bit one (x32 >> and mipsn32). Both are native in the sense that they make full use of the >> instruction set. This is not like i386 on amd64 or mips o32 on mips64 >> because those are more like compat shims that operate under special >> (crippled) cpu modes that nobody uses unless they're stuck with old code. >> Both our ABIs on the other hand are native and equally valid and which one >> to use for a particular package depends entirely on the use case. If your >> use case requires more than 4G of address space you'll have to use the >> 64-bit package, otherwise you can use the 32-bit package which, depending >> on how pointer heavy the code is, may give a performance benefit. You >> make this choice for each of the packages in your list and add that >> information to your script. > > Long hypothetical, but so what? In such a case, you’d pick one of two > different MACHINE_ARCH values depending on the package. This this is a > fairly atypical use case, it would not be unreasonable for the person > wanting to do this to know the proper companion ABI. In both cases, you > have the choice of two other values to use. Which one you use will depend > on a variety of factors, and what might be right for one application may > be wrong for others. > > And in both cases, there’s actually two choices: for amd64, you’d have > i386 and x32. Both of these are fine choices, and it would depend on the > workload which one is better (i386 has better toolchain support and > maturity, x32 offers some interesting theoretical wins, but doesn’t have > the same maturity). Same with mips64, you’d have two choices as well. In > both cases, you can’t just take uname/MACHINE_ARCH and slap :32 on the end. As far as I can see nobody uses i386 on amd64 except in cases where you know you're dealing with i386 like an i386 jail, or you need to run an old i386 binary that you're stuck with, or with compat shims like Wine. The choice of i386 is not comparable with the generic choice between ILP32 or LP64 on a 64-bit instruction set, which is why I'm ok with changing the "x86" in the pkg scheme to either "i386" or "amd64" like you are proposing. If pkg would keep using instruction set families like "x86" or "mips" then you could distinguish between old 32-bit, new 32-bit and new 64-bit using 3 generic suffixes to avoid lookup tables. The pattern of an old 32-bit instruction set that got extended to 64-bit on which you can define a new 32-bit ABI is common to many instruction set families, but I'm ok with old 32-bit and new 64-bit having separate MACHINE_ARCH values. >> Now let's work with Nathan's patch which uses the following string to >> identify the pkg repository to fetch packages from: >> `uname -s`:`uname -r | cut -f 1 -d .`:`uname -p` >> >> On our two systems that would be FreeBSD:11:amd64 and FreeBSD:11:mips64. >> Now if your script has to install the 32-bit version of a package how >> can it go from those two strings to FreeBSD:11:x32 or FreeBSD:11:mipsn32 >> without a lookup table? > > You couldn’t. Which is the whole reason I want to have them have a > standard name so you don’t need the lookup table for the common case. > This is an “off in the weeds” case, and optimizing for it doesn’t make > sense. Especially because in each case, you have two different 32-bit > ABIs to choose from. You’d have to have some kind of table in either > case. Also, the proper name for n32, in your current system, is > mips:32:n32, which (a) is wrong and (b) isn’t regular. Well, it may not make sense to you and be off in the weeds, but it does to me. Very few processes actually need more than 4G of virtual address space. I cannot immediately find anything in /bin or /usr/bin for instance (maybe clang when compiling a very large C++ file?). I'm not sure where you're getting mips:32:n32 from. We're talking in the context of Nathan's patch here. >> I say, you can more easily indicate whether you >> want the 32-bit or 64-bit package by appending :32 or :64 to the original >> strings, so FreeBSD:11:amd64:32 and FreeBSD:11:mips64:32. > > Except there’s no such thing as mips64:32 in the current system. There’s > two different ABIs that could mean. It could be o32 or n32, with the same > sort of trade offs. There’d need to be a person in the loop to know, so > there’s already a need to have special knowledge. You can’t get there by > just adding :32 to the existing thing... Yes, I am assuming that o32 on mips64 is like i386 on amd64, i.e. only used in cases where you know you're dealing with mips o32, and that normally n32 is the 32-bit ABI of choice on mips64 because it provides better performance. >> Like I said in a reply to Nathan's patch, pkg could default to :32 or :64 >> for every arch so it can be left out in many cases. FreeBSD:11:i386 >> would then be equivalent to FreeBSD:11:i386:32, FreeBSD:11:amd64 to >> FreeBSD:11:amd64:64, etc. > > I don’t see what value that adds to have the extra :32 or :64. Nathan’s > patches make it possible to have an automated build system with the > typical use case (I want to build all my binaries, packages, etc the > same). But adding a :32 isn’t going to even work for your hypothetical > example because people actually building such systems will need to > specify which 32-bit ABI they want to use anyway. And the degenerate case > of :32 just doesn’t work with mips… > > Consider too that we’re planning a new i386 ABI, which is identical to > the current i386 ABI, except time_t is 64 bit. We’ve penciled in the > name i386t64 for this ABI/MACHINE_ARCH. This will be much less painful, > it is thought, than finding all the current places that take time_t as > an arg and shimming… So if we were to do that, then your current scheme > wouldn’t be able to encompass that eventuality and we’d be back to this > argument... Nobody will use this new ABI on amd64 when x32 is supported. X32 has more registers available and a far better calling convention. >> This also does not preclude the existence of a mipsn32 MACHINE_ARCH in >> case you want to build a pure mipsn32 system (including the kernel), but >> I wonder how many people would use that if it is possible to have a >> mips64 system run n32 binaries. I don't think many people would run a >> pure x32 system (with x32 kernel) so I don't see the need to have an >> "x32" value for MACHINE_ARCH (or TARGET_ARCH). > > Actually, you absolutely must have a x32 MACHINE_ARCH if you want to be > able to run x32 binaries. Otherwise, how are you going to build the > libraries that use that API? Our build system simply isn’t setup to > build them any other way. Although the usr/lib32 stuff could grow extra > goo for that, you are still building them the same way you’d build. We > have a stylized way to create a sys root, which is needed for the > compilers to work. We’d likely have to grow better multi lib support > than we have now as well. You’d need some way to identify these binaries, > segregate their ld.so, etc. Even if no kernel ever is linked this way, > it is still an absolute requirement. I'm kind of hoping we can close this discussion now and agree to disagree on the points that we still disagree, so I don't really want to discuss our build system. We'd be off for another week. I understand why we build compat32 libraries the way we do now. It was the only way at the time. In my opinion the choice between 32-bit or 64-bit should be like choosing between static or shared, pic or non-pic, or with or without profiling. It's just a compiler flag while our current build system treats it almost like a full blown cross compilation problem. From owner-svn-src-head@FreeBSD.ORG Wed May 28 12:27:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82A9D6F0; Wed, 28 May 2014 12:27:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FD05208E; Wed, 28 May 2014 12:27:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4SCRgMU038492; Wed, 28 May 2014 12:27:42 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4SCRgKs038491; Wed, 28 May 2014 12:27:42 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405281227.s4SCRgKs038491@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 28 May 2014 12:27:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266798 - head/usr.sbin/usbdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 12:27:42 -0000 Author: hselasky Date: Wed May 28 12:27:41 2014 New Revision: 266798 URL: http://svnweb.freebsd.org/changeset/base/266798 Log: Fix for big endian architectures. The "up_address" field is 8-bit and does not need byte swapping. MFC after: 1 week Modified: head/usr.sbin/usbdump/usbdump.c Modified: head/usr.sbin/usbdump/usbdump.c ============================================================================== --- head/usr.sbin/usbdump/usbdump.c Wed May 28 11:30:37 2014 (r266797) +++ head/usr.sbin/usbdump/usbdump.c Wed May 28 12:27:41 2014 (r266798) @@ -473,7 +473,7 @@ print_apacket(const struct header_32 *hd */ up->up_totlen = le32toh(up->up_totlen); up->up_busunit = le32toh(up->up_busunit); - up->up_address = le32toh(up->up_address); + up->up_address = up->up_address; up->up_flags = le32toh(up->up_flags); up->up_status = le32toh(up->up_status); up->up_error = le32toh(up->up_error); From owner-svn-src-head@FreeBSD.ORG Wed May 28 12:32:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70DD98AD; Wed, 28 May 2014 12:32:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DF522137; Wed, 28 May 2014 12:32:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4SCW8a7042195; Wed, 28 May 2014 12:32:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4SCW8Nu042194; Wed, 28 May 2014 12:32:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201405281232.s4SCW8Nu042194@svn.freebsd.org> From: Marius Strobl Date: Wed, 28 May 2014 12:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266799 - head/sys/dev/sound/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 12:32:08 -0000 Author: marius Date: Wed May 28 12:32:07 2014 New Revision: 266799 URL: http://svnweb.freebsd.org/changeset/base/266799 Log: Commit the right version of r266793. Modified: head/sys/dev/sound/pci/emu10k1.c Modified: head/sys/dev/sound/pci/emu10k1.c ============================================================================== --- head/sys/dev/sound/pci/emu10k1.c Wed May 28 12:27:41 2014 (r266798) +++ head/sys/dev/sound/pci/emu10k1.c Wed May 28 12:32:07 2014 (r266799) @@ -1378,7 +1378,7 @@ emu_memalloc(struct sc_info *sc, u_int32 ofs = 0; for (idx = start; idx < start + blksz; idx++) { mem->bmap[idx >> 3] |= 1 << (idx & 7); - tmp = (bus_addr_t)((u_int8_t *)(uintptr_t)blk->buf_addr + ofs); + tmp = (uintptr_t)((u_int8_t *)(uintptr_t)blk->buf_addr + ofs); #ifdef EMUDEBUG printf("pte[%d] -> %x phys, %x virt\n", idx, tmp, ((u_int32_t)buf) + ofs); From owner-svn-src-head@FreeBSD.ORG Wed May 28 12:45:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A13C0DCC; Wed, 28 May 2014 12:45:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CA3D22C9; Wed, 28 May 2014 12:45:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4SCjTwZ047179; Wed, 28 May 2014 12:45:29 GMT (envelope-from vanhu@svn.freebsd.org) Received: (from vanhu@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4SCjSCK047168; Wed, 28 May 2014 12:45:28 GMT (envelope-from vanhu@svn.freebsd.org) Message-Id: <201405281245.s4SCjSCK047168@svn.freebsd.org> From: VANHULLEBUS Yvan Date: Wed, 28 May 2014 12:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266800 - in head/sys: netinet6 netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 12:45:29 -0000 Author: vanhu Date: Wed May 28 12:45:27 2014 New Revision: 266800 URL: http://svnweb.freebsd.org/changeset/base/266800 Log: Fixed IPv4-in-IPv6 and IPv6-in-IPv4 IPsec tunnels. For IPv6-in-IPv4, you may need to do the following command on the tunnel interface if it is configured as IPv4 only: ifconfig inet6 -ifdisabled Code logic inspired from NetBSD. PR: kern/169438 Submitted by: emeric.poupon@netasq.com Reviewed by: fabient, ae Obtained from: NETASQ Modified: head/sys/netinet6/ip6_forward.c head/sys/netinet6/ip6_ipsec.c head/sys/netinet6/ip6_ipsec.h head/sys/netinet6/ip6_output.c head/sys/netinet6/ip6_var.h head/sys/netipsec/ipsec6.h head/sys/netipsec/ipsec_input.c head/sys/netipsec/ipsec_output.c head/sys/netipsec/xform_ipip.c Modified: head/sys/netinet6/ip6_forward.c ============================================================================== --- head/sys/netinet6/ip6_forward.c Wed May 28 12:32:07 2014 (r266799) +++ head/sys/netinet6/ip6_forward.c Wed May 28 12:45:27 2014 (r266800) @@ -252,7 +252,6 @@ ip6_forward(struct mbuf *m, int srcrt) { struct ipsecrequest *isr = NULL; - struct ipsec_output_state state; /* * when the kernel forwards a packet, it is not proper to apply @@ -285,18 +284,27 @@ ip6_forward(struct mbuf *m, int srcrt) * * IPv6 [ESP|AH] IPv6 [extension headers] payload */ - bzero(&state, sizeof(state)); - state.m = m; - state.ro = NULL; /* update at ipsec6_output_tunnel() */ - state.dst = NULL; /* update at ipsec6_output_tunnel() */ - error = ipsec6_output_tunnel(&state, sp, 0); + /* + * If we need to encapsulate the packet, do it here + * ipsec6_proces_packet will send the packet using ip6_output + */ + error = ipsec6_process_packet(m, sp->req); - m = state.m; KEY_FREESP(&sp); + if (error == EJUSTRETURN) { + /* + * We had a SP with a level of 'use' and no SA. We + * will just continue to process the packet without + * IPsec processing. + */ + error = 0; + goto skip_ipsec; + } + if (error) { - /* mbuf is already reclaimed in ipsec6_output_tunnel. */ + /* mbuf is already reclaimed in ipsec6_process_packet. */ switch (error) { case EHOSTUNREACH: case ENETUNREACH: @@ -319,7 +327,6 @@ ip6_forward(struct mbuf *m, int srcrt) m_freem(mcopy); #endif } - m_freem(m); return; } else { /* @@ -331,25 +338,7 @@ ip6_forward(struct mbuf *m, int srcrt) m = NULL; goto freecopy; } - - if ((m != NULL) && (ip6 != mtod(m, struct ip6_hdr *)) ){ - /* - * now tunnel mode headers are added. we are originating - * packet instead of forwarding the packet. - */ - ip6_output(m, NULL, NULL, IPV6_FORWARDING/*XXX*/, NULL, NULL, - NULL); - goto freecopy; - } - - /* adjust pointer */ - dst = (struct sockaddr_in6 *)state.dst; - rt = state.ro ? state.ro->ro_rt : NULL; - if (dst != NULL && rt != NULL) - ipsecrt = 1; } - if (ipsecrt) - goto skip_routing; skip_ipsec: #endif again: @@ -372,9 +361,6 @@ again2: goto bad; } rt = rin6.ro_rt; -#ifdef IPSEC -skip_routing: -#endif /* * Source scope check: if a packet can't be delivered to its Modified: head/sys/netinet6/ip6_ipsec.c ============================================================================== --- head/sys/netinet6/ip6_ipsec.c Wed May 28 12:32:07 2014 (r266799) +++ head/sys/netinet6/ip6_ipsec.c Wed May 28 12:45:27 2014 (r266800) @@ -221,23 +221,22 @@ ip6_ipsec_input(struct mbuf *m, int nxt) int ip6_ipsec_output(struct mbuf **m, struct inpcb *inp, int *flags, int *error, - struct ifnet **ifp, struct secpolicy **sp) + struct ifnet **ifp) { #ifdef IPSEC + struct secpolicy *sp = NULL; struct tdb_ident *tdbi; struct m_tag *mtag; /* XXX int s; */ - if (sp == NULL) - return 1; mtag = m_tag_find(*m, PACKET_TAG_IPSEC_PENDING_TDB, NULL); if (mtag != NULL) { tdbi = (struct tdb_ident *)(mtag + 1); - *sp = ipsec_getpolicy(tdbi, IPSEC_DIR_OUTBOUND); - if (*sp == NULL) + sp = ipsec_getpolicy(tdbi, IPSEC_DIR_OUTBOUND); + if (sp == NULL) *error = -EINVAL; /* force silent drop */ m_tag_delete(*m, mtag); } else { - *sp = ipsec4_checkpolicy(*m, IPSEC_DIR_OUTBOUND, *flags, + sp = ipsec4_checkpolicy(*m, IPSEC_DIR_OUTBOUND, *flags, error, inp); } @@ -248,9 +247,9 @@ ip6_ipsec_output(struct mbuf **m, struct * sp == NULL, error == -EINVAL discard packet w/o error * sp == NULL, error != 0 discard packet, report error */ - if (*sp != NULL) { + if (sp != NULL) { /* Loop detection, check if ipsec processing already done */ - KASSERT((*sp)->req != NULL, ("ip_output: no ipsec request")); + KASSERT(sp->req != NULL, ("ip_output: no ipsec request")); for (mtag = m_tag_first(*m); mtag != NULL; mtag = m_tag_next(*m, mtag)) { if (mtag->m_tag_cookie != MTAG_ABI_COMPAT) @@ -264,12 +263,12 @@ ip6_ipsec_output(struct mbuf **m, struct * an SA; e.g. on first reference. If it occurs, * then we let ipsec4_process_packet do its thing. */ - if ((*sp)->req->sav == NULL) + if (sp->req->sav == NULL) break; tdbi = (struct tdb_ident *)(mtag + 1); - if (tdbi->spi == (*sp)->req->sav->spi && - tdbi->proto == (*sp)->req->sav->sah->saidx.proto && - bcmp(&tdbi->dst, &(*sp)->req->sav->sah->saidx.dst, + if (tdbi->spi == sp->req->sav->spi && + tdbi->proto == sp->req->sav->sah->saidx.proto && + bcmp(&tdbi->dst, &sp->req->sav->sah->saidx.dst, sizeof (union sockaddr_union)) == 0) { /* * No IPsec processing is needed, free @@ -278,7 +277,7 @@ ip6_ipsec_output(struct mbuf **m, struct * NB: null pointer to avoid free at * done: below. */ - KEY_FREESP(sp), *sp = NULL; + KEY_FREESP(&sp), sp = NULL; goto done; } } @@ -286,16 +285,37 @@ ip6_ipsec_output(struct mbuf **m, struct /* * Do delayed checksums now because we send before * this is done in the normal processing path. - * For IPv6 we do delayed checksums in ip6_output.c. */ #ifdef INET if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { - ipseclog((LOG_DEBUG, - "%s: we do not support IPv4 over IPv6", __func__)); in_delayed_cksum(*m); (*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } #endif + if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { + in6_delayed_cksum(*m, (*m)->m_pkthdr.len - sizeof(struct ip6_hdr), + sizeof(struct ip6_hdr)); + (*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; + } +#ifdef SCTP + if ((*m)->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) { + sctp_delayed_cksum(*m, sizeof(struct ip6_hdr)); + (*m)->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6; + } +#endif + + /* NB: callee frees mbuf */ + *error = ipsec6_process_packet(*m, sp->req); + + if (*error == EJUSTRETURN) { + /* + * We had a SP with a level of 'use' and no SA. We + * will just continue to process the packet without + * IPsec processing. + */ + *error = 0; + goto done; + } /* * Preserve KAME behaviour: ENOENT can be returned @@ -306,7 +326,7 @@ ip6_ipsec_output(struct mbuf **m, struct */ if (*error == ENOENT) *error = 0; - goto do_ipsec; + goto reinjected; } else { /* sp == NULL */ if (*error != 0) { /* @@ -323,10 +343,16 @@ ip6_ipsec_output(struct mbuf **m, struct } } done: + if (sp != NULL) + KEY_FREESP(&sp); return 0; -do_ipsec: +reinjected: + if (sp != NULL) + KEY_FREESP(&sp); return -1; bad: + if (sp != NULL) + KEY_FREESP(&sp); return 1; #endif /* IPSEC */ return 0; Modified: head/sys/netinet6/ip6_ipsec.h ============================================================================== --- head/sys/netinet6/ip6_ipsec.h Wed May 28 12:32:07 2014 (r266799) +++ head/sys/netinet6/ip6_ipsec.h Wed May 28 12:45:27 2014 (r266800) @@ -36,7 +36,7 @@ int ip6_ipsec_filtertunnel(struct mbuf * int ip6_ipsec_fwd(struct mbuf *); int ip6_ipsec_input(struct mbuf *, int); int ip6_ipsec_output(struct mbuf **, struct inpcb *, int *, int *, - struct ifnet **, struct secpolicy **sp); + struct ifnet **); #if 0 int ip6_ipsec_mtu(struct mbuf *); #endif Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Wed May 28 12:32:07 2014 (r266799) +++ head/sys/netinet6/ip6_output.c Wed May 28 12:45:27 2014 (r266800) @@ -185,7 +185,7 @@ static int copypktopts(struct ip6_pktopt }\ } while (/*CONSTCOND*/ 0) -static void +void in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset) { u_short csum; @@ -249,15 +249,7 @@ ip6_output(struct mbuf *m0, struct ip6_p u_int32_t zone; struct route_in6 *ro_pmtu = NULL; int hdrsplit = 0; - int needipsec = 0; int sw_csum, tso; -#ifdef IPSEC - struct ipsec_output_state state; - struct ip6_rthdr *rh = NULL; - int needipsectun = 0; - int segleft_org = 0; - struct secpolicy *sp = NULL; -#endif /* IPSEC */ struct m_tag *fwd_tag = NULL; ip6 = mtod(m, struct ip6_hdr *); @@ -299,26 +291,12 @@ ip6_output(struct mbuf *m0, struct ip6_p * IPSec checking which handles several cases. * FAST IPSEC: We re-injected the packet. */ - switch(ip6_ipsec_output(&m, inp, &flags, &error, &ifp, &sp)) + switch(ip6_ipsec_output(&m, inp, &flags, &error, &ifp)) { case 1: /* Bad packet */ goto freehdrs; - case -1: /* Do IPSec */ - needipsec = 1; - /* - * Do delayed checksums now, as we may send before returning. - */ - if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { - plen = m->m_pkthdr.len - sizeof(*ip6); - in6_delayed_cksum(m, plen, sizeof(struct ip6_hdr)); - m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; - } -#ifdef SCTP - if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) { - sctp_delayed_cksum(m, sizeof(struct ip6_hdr)); - m->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6; - } -#endif + case -1: /* IPSec done */ + goto done; case 0: /* No IPSec */ default: break; @@ -338,15 +316,15 @@ ip6_output(struct mbuf *m0, struct ip6_p optlen += exthdrs.ip6e_rthdr->m_len; unfragpartlen = optlen + sizeof(struct ip6_hdr); - /* NOTE: we don't add AH/ESP length here. do that later. */ + /* NOTE: we don't add AH/ESP length here (done in ip6_ipsec_output) */ if (exthdrs.ip6e_dest2) optlen += exthdrs.ip6e_dest2->m_len; /* - * If we need IPsec, or there is at least one extension header, + * If there is at least one extension header, * separate IP6 header from the payload. */ - if ((needipsec || optlen) && !hdrsplit) { + if (optlen && !hdrsplit) { if ((error = ip6_splithdr(m, &exthdrs)) != 0) { m = NULL; goto freehdrs; @@ -421,72 +399,6 @@ ip6_output(struct mbuf *m0, struct ip6_p MAKE_CHAIN(exthdrs.ip6e_rthdr, mprev, nexthdrp, IPPROTO_ROUTING); -#ifdef IPSEC - if (!needipsec) - goto skip_ipsec2; - - /* - * pointers after IPsec headers are not valid any more. - * other pointers need a great care too. - * (IPsec routines should not mangle mbufs prior to AH/ESP) - */ - exthdrs.ip6e_dest2 = NULL; - - if (exthdrs.ip6e_rthdr) { - rh = mtod(exthdrs.ip6e_rthdr, struct ip6_rthdr *); - segleft_org = rh->ip6r_segleft; - rh->ip6r_segleft = 0; - } - - bzero(&state, sizeof(state)); - state.m = m; - error = ipsec6_output_trans(&state, nexthdrp, mprev, sp, flags, - &needipsectun); - m = state.m; - if (error == EJUSTRETURN) { - /* - * We had a SP with a level of 'use' and no SA. We - * will just continue to process the packet without - * IPsec processing. - */ - ; - } else if (error) { - /* mbuf is already reclaimed in ipsec6_output_trans. */ - m = NULL; - switch (error) { - case EHOSTUNREACH: - case ENETUNREACH: - case EMSGSIZE: - case ENOBUFS: - case ENOMEM: - break; - default: - printf("[%s:%d] (ipsec): error code %d\n", - __func__, __LINE__, error); - /* FALLTHROUGH */ - case ENOENT: - /* don't show these error codes to the user */ - error = 0; - break; - } - goto bad; - } else if (!needipsectun) { - /* - * In the FAST IPSec case we have already - * re-injected the packet and it has been freed - * by the ipsec_done() function. So, just clean - * up after ourselves. - */ - m = NULL; - goto done; - } - if (exthdrs.ip6e_rthdr) { - /* ah6_output doesn't modify mbuf chain */ - rh->ip6r_segleft = segleft_org; - } -skip_ipsec2:; -#endif /* IPSEC */ - /* * If there is a routing header, discard the packet. */ @@ -552,77 +464,6 @@ again: ip6->ip6_hlim = V_ip6_defmcasthlim; } -#ifdef IPSEC - /* - * We may re-inject packets into the stack here. - */ - if (needipsec && needipsectun) { - struct ipsec_output_state state; - - /* - * All the extension headers will become inaccessible - * (since they can be encrypted). - * Don't panic, we need no more updates to extension headers - * on inner IPv6 packet (since they are now encapsulated). - * - * IPv6 [ESP|AH] IPv6 [extension headers] payload - */ - bzero(&exthdrs, sizeof(exthdrs)); - exthdrs.ip6e_ip6 = m; - - bzero(&state, sizeof(state)); - state.m = m; - state.ro = (struct route *)ro; - state.dst = (struct sockaddr *)dst; - - error = ipsec6_output_tunnel(&state, sp, flags); - - m = state.m; - ro = (struct route_in6 *)state.ro; - dst = (struct sockaddr_in6 *)state.dst; - if (error == EJUSTRETURN) { - /* - * We had a SP with a level of 'use' and no SA. We - * will just continue to process the packet without - * IPsec processing. - */ - ; - } else if (error) { - /* mbuf is already reclaimed in ipsec6_output_tunnel. */ - m0 = m = NULL; - m = NULL; - switch (error) { - case EHOSTUNREACH: - case ENETUNREACH: - case EMSGSIZE: - case ENOBUFS: - case ENOMEM: - break; - default: - printf("[%s:%d] (ipsec): error code %d\n", - __func__, __LINE__, error); - /* FALLTHROUGH */ - case ENOENT: - /* don't show these error codes to the user */ - error = 0; - break; - } - goto bad; - } else { - /* - * In the FAST IPSec case we have already - * re-injected the packet and it has been freed - * by the ipsec_done() function. So, just clean - * up after ourselves. - */ - m = NULL; - goto done; - } - - exthdrs.ip6e_ip6 = m; - } -#endif /* IPSEC */ - /* adjust pointer */ ip6 = mtod(m, struct ip6_hdr *); @@ -1185,11 +1026,6 @@ done: RO_RTFREE(ro); if (ro_pmtu == &ip6route) RO_RTFREE(ro_pmtu); -#ifdef IPSEC - if (sp != NULL) - KEY_FREESP(&sp); -#endif - return (error); freehdrs: Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Wed May 28 12:32:07 2014 (r266799) +++ head/sys/netinet6/ip6_var.h Wed May 28 12:45:27 2014 (r266800) @@ -456,6 +456,7 @@ int in6_selectroute_fib(struct sockaddr_ struct rtentry **, u_int); u_int32_t ip6_randomid(void); u_int32_t ip6_randomflowlabel(void); +void in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset); #endif /* _KERNEL */ #endif /* !_NETINET6_IP6_VAR_H_ */ Modified: head/sys/netipsec/ipsec6.h ============================================================================== --- head/sys/netipsec/ipsec6.h Wed May 28 12:32:07 2014 (r266799) +++ head/sys/netipsec/ipsec6.h Wed May 28 12:45:27 2014 (r266800) @@ -76,6 +76,7 @@ extern int ipsec6_output_trans __P((stru struct mbuf *, struct secpolicy *, int, int *)); extern int ipsec6_output_tunnel __P((struct ipsec_output_state *, struct secpolicy *, int)); +extern int ipsec6_process_packet(struct mbuf *, struct ipsecrequest *); #endif /*_KERNEL*/ #endif /*_NETIPSEC_IPSEC6_H_*/ Modified: head/sys/netipsec/ipsec_input.c ============================================================================== --- head/sys/netipsec/ipsec_input.c Wed May 28 12:32:07 2014 (r266799) +++ head/sys/netipsec/ipsec_input.c Wed May 28 12:45:27 2014 (r266800) @@ -296,7 +296,7 @@ int ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip, int protoff, struct m_tag *mt) { - int prot, af, sproto; + int prot, af, sproto, isr_prot; struct ip *ip; struct m_tag *mtag; struct tdb_ident *tdbi; @@ -350,20 +350,33 @@ ipsec4_common_input_cb(struct mbuf *m, s } prot = ip->ip_p; -#ifdef notyet +#ifdef DEV_ENC + encif->if_ipackets++; + encif->if_ibytes += m->m_pkthdr.len; + + /* + * Pass the mbuf to enc0 for bpf and pfil. We will filter the IPIP + * packet later after it has been decapsulated. + */ + ipsec_bpf(m, sav, AF_INET, ENC_IN|ENC_BEFORE); + + if (prot != IPPROTO_IPIP) + if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) + return (error); +#endif /* DEV_ENC */ + /* IP-in-IP encapsulation */ if (prot == IPPROTO_IPIP) { - struct ip ipn; if (m->m_pkthdr.len - skip < sizeof(struct ip)) { IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } - /* ipn will now contain the inner IPv4 header */ - m_copydata(m, ip->ip_hl << 2, sizeof(struct ip), - (caddr_t) &ipn); + /* enc0: strip outer IPv4 header */ + m_striphdr(m, 0, ip->ip_hl << 2); +#ifdef notyet /* XXX PROXY address isn't recorded in SAH */ /* * Check that the inner source address is the same as @@ -389,21 +402,20 @@ ipsec4_common_input_cb(struct mbuf *m, s error = EACCES; goto bad; } +#endif /* notyet */ } #ifdef INET6 /* IPv6-in-IP encapsulation. */ if (prot == IPPROTO_IPV6) { - struct ip6_hdr ip6n; if (m->m_pkthdr.len - skip < sizeof(struct ip6_hdr)) { IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } - /* ip6n will now contain the inner IPv6 header. */ - m_copydata(m, ip->ip_hl << 2, sizeof(struct ip6_hdr), - (caddr_t) &ip6n); - + /* enc0: strip IPv4 header, keep IPv6 header only */ + m_striphdr(m, 0, ip->ip_hl << 2); +#ifdef notyet /* * Check that the inner source address is the same as * the proxy address, if available. @@ -427,9 +439,9 @@ ipsec4_common_input_cb(struct mbuf *m, s error = EACCES; goto bad; } +#endif /* notyet */ } #endif /* INET6 */ -#endif /*XXX*/ /* * Record what we've done to the packet (under what SA it was @@ -466,24 +478,43 @@ ipsec4_common_input_cb(struct mbuf *m, s key_sa_recordxfer(sav, m); /* record data transfer */ #ifdef DEV_ENC - encif->if_ipackets++; - encif->if_ibytes += m->m_pkthdr.len; - /* - * Pass the mbuf to enc0 for bpf and pfil. We will filter the IPIP - * packet later after it has been decapsulated. + * Pass the mbuf to enc0 for bpf and pfil. */ - ipsec_bpf(m, sav, AF_INET, ENC_IN|ENC_BEFORE); - - if (prot != IPPROTO_IPIP) - if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) - return (error); + if (prot == IPPROTO_IPIP) + ipsec_bpf(m, sav, AF_INET, ENC_IN|ENC_AFTER); +#ifdef INET6 + if (prot == IPPROTO_IPV6) + ipsec_bpf(m, sav, AF_INET6, ENC_IN|ENC_AFTER); #endif + if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_AFTER)) != 0) + return (error); +#endif /* DEV_ENC */ + /* * Re-dispatch via software interrupt. */ - if ((error = netisr_queue_src(NETISR_IP, (uintptr_t)sav->spi, m))) { + + switch (prot) { + case IPPROTO_IPIP: + isr_prot = NETISR_IP; + break; +#ifdef INET6 + case IPPROTO_IPV6: + isr_prot = NETISR_IPV6; + break; +#endif + default: + DPRINTF(("%s: cannot handle inner ip proto %d\n", + __func__, prot)); + IPSEC_ISTAT(sproto, nopf); + error = EPFNOSUPPORT; + goto bad; + } + + error = netisr_queue_src(isr_prot, (uintptr_t)sav->spi, m); + if (error) { IPSEC_ISTAT(sproto, qfull); DPRINTF(("%s: queue full; proto %u packet dropped\n", __func__, sproto)); @@ -606,20 +637,34 @@ ipsec6_common_input_cb(struct mbuf *m, s prot = 0; m_copydata(m, protoff, 1, (unsigned char *) &prot); -#ifdef notyet +#ifdef DEV_ENC + encif->if_ipackets++; + encif->if_ibytes += m->m_pkthdr.len; + + /* + * Pass the mbuf to enc0 for bpf and pfil. We will filter the IPIP + * packet later after it has been decapsulated. + */ + ipsec_bpf(m, sav, AF_INET6, ENC_IN|ENC_BEFORE); + + /* XXX-BZ does not make sense. */ + if (prot != IPPROTO_IPIP) + if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) + return (error); +#endif /* DEV_ENC */ + #ifdef INET /* IP-in-IP encapsulation */ if (prot == IPPROTO_IPIP) { - struct ip ipn; - if (m->m_pkthdr.len - skip < sizeof(struct ip)) { IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } /* ipn will now contain the inner IPv4 header */ - m_copydata(m, skip, sizeof(struct ip), (caddr_t) &ipn); - + m_striphdr(m, 0, skip); + skip = 0; +#ifdef notyet /* * Check that the inner source address is the same as * the proxy address, if available. @@ -642,22 +687,20 @@ ipsec6_common_input_cb(struct mbuf *m, s error = EACCES; goto bad; } +#endif /* notyet */ } #endif /* INET */ - /* IPv6-in-IP encapsulation */ if (prot == IPPROTO_IPV6) { - struct ip6_hdr ip6n; - if (m->m_pkthdr.len - skip < sizeof(struct ip6_hdr)) { IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } /* ip6n will now contain the inner IPv6 header. */ - m_copydata(m, skip, sizeof(struct ip6_hdr), - (caddr_t) &ip6n); - + m_striphdr(m, 0, skip); + skip = 0; +#ifdef notyet /* * Check that the inner source address is the same as * the proxy address, if available. @@ -681,8 +724,8 @@ ipsec6_common_input_cb(struct mbuf *m, s error = EACCES; goto bad; } +#endif /* notyet */ } -#endif /*XXX*/ /* * Record what we've done to the packet (under what SA it was @@ -720,23 +763,22 @@ ipsec6_common_input_cb(struct mbuf *m, s key_sa_recordxfer(sav, m); #ifdef DEV_ENC - encif->if_ipackets++; - encif->if_ibytes += m->m_pkthdr.len; - /* - * Pass the mbuf to enc0 for bpf and pfil. We will filter the IPIP - * packet later after it has been decapsulated. + * Pass the mbuf to enc0 for bpf and pfil. */ - ipsec_bpf(m, sav, AF_INET6, ENC_IN|ENC_BEFORE); - - /* XXX-BZ does not make sense. */ - if (prot != IPPROTO_IPIP) - if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) - return (error); +#ifdef INET + if (prot == IPPROTO_IPIP) + ipsec_bpf(m, sav, AF_INET, ENC_IN|ENC_AFTER); #endif + if (prot == IPPROTO_IPV6) + ipsec_bpf(m, sav, AF_INET6, ENC_IN|ENC_AFTER); + if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_AFTER)) != 0) + return (error); +#endif /* DEV_ENC */ /* Retrieve new protocol */ - m_copydata(m, protoff, sizeof(u_int8_t), (caddr_t) &nxt8); + /* We have stripped the IP6 header from the mbuf, we have to use the backuped proto value instead */ + nxt8 = prot; /* * See the end of ip6_input for this logic. Modified: head/sys/netipsec/ipsec_output.c ============================================================================== --- head/sys/netipsec/ipsec_output.c Wed May 28 12:32:07 2014 (r266799) +++ head/sys/netipsec/ipsec_output.c Wed May 28 12:45:27 2014 (r266800) @@ -177,8 +177,7 @@ ipsec_process_done(struct mbuf *m, struc #ifdef INET6 case AF_INET6: /* XXX */ - ipsec6_output_trans() - ipsec6_output_tunnel() + return ipsec6_process_packet(m, isr->next); /* NOTREACHED */ #endif /* INET6 */ #endif @@ -543,7 +542,7 @@ ipsec4_process_packet( #ifdef DEV_ENC /* pass the mbuf to enc0 for bpf processing */ - ipsec_bpf(m, sav, AF_INET, ENC_OUT|ENC_AFTER); + ipsec_bpf(m, sav, sav->sah->saidx.dst.sa.sa_family, ENC_OUT|ENC_AFTER); /* pass the mbuf to enc0 for packet filtering */ if ((error = ipsec_filter(&m, PFIL_OUT, ENC_OUT|ENC_AFTER)) != 0) goto bad; @@ -560,9 +559,26 @@ ipsec4_process_packet( * for reclaiming their resources. */ if (sav->tdb_xform->xf_type != XF_IP4) { - ip = mtod(m, struct ip *); - i = ip->ip_hl << 2; - off = offsetof(struct ip, ip_p); + union sockaddr_union *dst = &sav->sah->saidx.dst; + switch(dst->sa.sa_family) { + case AF_INET: + ip = mtod(m, struct ip *); + i = ip->ip_hl << 2; + off = offsetof(struct ip, ip_p); + break; +#ifdef INET6 + case AF_INET6: + i = sizeof(struct ip6_hdr); + off = offsetof(struct ip6_hdr, ip6_nxt); + break; +#endif /* INET6 */ + default: + DPRINTF(("%s: unsupported protocol family %u\n", + __func__, dst->sa.sa_family)); + error = EPFNOSUPPORT; + IPSEC6STAT_INC(ips_out_inval); + goto bad; + } error = (*sav->tdb_xform->xf_output)(m, isr, NULL, i, off); } else { error = ipsec_process_done(m, isr); @@ -578,224 +594,50 @@ bad: } #endif -#ifdef INET6 -/* - * Chop IP6 header from the payload. - */ -static struct mbuf * -ipsec6_splithdr(struct mbuf *m) -{ - struct mbuf *mh; - struct ip6_hdr *ip6; - int hlen; - - IPSEC_ASSERT(m->m_len >= sizeof (struct ip6_hdr), - ("first mbuf too short, len %u", m->m_len)); - ip6 = mtod(m, struct ip6_hdr *); - hlen = sizeof(struct ip6_hdr); - if (m->m_len > hlen) { - MGETHDR(mh, M_NOWAIT, MT_DATA); - if (!mh) { - m_freem(m); - return NULL; - } - M_MOVE_PKTHDR(mh, m); - MH_ALIGN(mh, hlen); - m->m_len -= hlen; - m->m_data += hlen; - mh->m_next = m; - m = mh; - m->m_len = hlen; - bcopy((caddr_t)ip6, mtod(m, caddr_t), hlen); - } else if (m->m_len < hlen) { - m = m_pullup(m, hlen); - if (!m) - return NULL; - } - return m; -} - -/* - * IPsec output logic for IPv6, transport mode. - */ -int -ipsec6_output_trans( - struct ipsec_output_state *state, - u_char *nexthdrp, - struct mbuf *mprev, - struct secpolicy *sp, - int flags, - int *tun) -{ - struct ipsecrequest *isr; - struct secasindex saidx; - int error = 0; - struct mbuf *m; - - IPSEC_ASSERT(state != NULL, ("null state")); - IPSEC_ASSERT(state->m != NULL, ("null m")); - IPSEC_ASSERT(nexthdrp != NULL, ("null nexthdrp")); - IPSEC_ASSERT(mprev != NULL, ("null mprev")); - IPSEC_ASSERT(sp != NULL, ("null sp")); - IPSEC_ASSERT(tun != NULL, ("null tun")); - - KEYDEBUG(KEYDEBUG_IPSEC_DATA, - printf("%s: applied SP\n", __func__); - kdebug_secpolicy(sp)); - - isr = sp->req; - if (isr->saidx.mode == IPSEC_MODE_TUNNEL) { - /* the rest will be handled by ipsec6_output_tunnel() */ - *tun = 1; /* need tunnel-mode processing */ - return 0; - } - - *tun = 0; - m = state->m; - - IPSECREQUEST_LOCK(isr); /* insure SA contents don't change */ - isr = ipsec_nextisr(m, isr, AF_INET6, &saidx, &error); - if (isr == NULL) { - if (error != 0) { -#ifdef notdef - /* XXX should notification be done for all errors ? */ - /* - * Notify the fact that the packet is discarded - * to ourselves. I believe this is better than - * just silently discarding. (jinmei@kame.net) - * XXX: should we restrict the error to TCP packets? - * XXX: should we directly notify sockets via - * pfctlinputs? - */ - icmp6_error(m, ICMP6_DST_UNREACH, - ICMP6_DST_UNREACH_ADMIN, 0); - m = NULL; /* NB: icmp6_error frees mbuf */ -#endif - goto bad; - } - return EJUSTRETURN; - } - - error = (*isr->sav->tdb_xform->xf_output)(m, isr, NULL, - sizeof (struct ip6_hdr), - offsetof(struct ip6_hdr, - ip6_nxt)); - IPSECREQUEST_UNLOCK(isr); - return error; -bad: - if (isr) - IPSECREQUEST_UNLOCK(isr); - if (m) - m_freem(m); - state->m = NULL; - return error; -} +#ifdef INET6 static int -ipsec6_encapsulate(struct mbuf *m, struct secasvar *sav) +in6_sa_equal_addrwithscope(const struct sockaddr_in6 *sa, const struct in6_addr *ia) { - struct ip6_hdr *oip6; - struct ip6_hdr *ip6; - size_t plen; - - /* can't tunnel between different AFs */ - if (sav->sah->saidx.src.sa.sa_family != AF_INET6 || - sav->sah->saidx.dst.sa.sa_family != AF_INET6) { - m_freem(m); - return EINVAL; - } - IPSEC_ASSERT(m->m_len == sizeof (struct ip6_hdr), - ("mbuf wrong size; len %u", m->m_len)); - - - /* - * grow the mbuf to accomodate the new IPv6 header. - */ - plen = m->m_pkthdr.len; - if (M_LEADINGSPACE(m->m_next) < sizeof(struct ip6_hdr)) { - struct mbuf *n; - MGET(n, M_NOWAIT, MT_DATA); - if (!n) { - m_freem(m); - return ENOBUFS; - } - n->m_len = sizeof(struct ip6_hdr); - n->m_next = m->m_next; - m->m_next = n; - m->m_pkthdr.len += sizeof(struct ip6_hdr); - oip6 = mtod(n, struct ip6_hdr *); - } else { - m->m_next->m_len += sizeof(struct ip6_hdr); - m->m_next->m_data -= sizeof(struct ip6_hdr); - m->m_pkthdr.len += sizeof(struct ip6_hdr); - oip6 = mtod(m->m_next, struct ip6_hdr *); - } - ip6 = mtod(m, struct ip6_hdr *); - bcopy((caddr_t)ip6, (caddr_t)oip6, sizeof(struct ip6_hdr)); - - /* Fake link-local scope-class addresses */ - if (IN6_IS_SCOPE_LINKLOCAL(&oip6->ip6_src)) - oip6->ip6_src.s6_addr16[1] = 0; - if (IN6_IS_SCOPE_LINKLOCAL(&oip6->ip6_dst)) - oip6->ip6_dst.s6_addr16[1] = 0; - - /* construct new IPv6 header. see RFC 2401 5.1.2.2 */ - /* ECN consideration. */ - ip6_ecn_ingress(V_ip6_ipsec_ecn, &ip6->ip6_flow, &oip6->ip6_flow); - if (plen < IPV6_MAXPACKET - sizeof(struct ip6_hdr)) - ip6->ip6_plen = htons(plen); - else { - /* ip6->ip6_plen will be updated in ip6_output() */ - } - ip6->ip6_nxt = IPPROTO_IPV6; - ip6->ip6_src = sav->sah->saidx.src.sin6.sin6_addr; - ip6->ip6_dst = sav->sah->saidx.dst.sin6.sin6_addr; - ip6->ip6_hlim = IPV6_DEFHLIM; + struct in6_addr ia2; - /* XXX Should ip6_src be updated later ? */ + memcpy(&ia2, &sa->sin6_addr, sizeof(ia2)); + if (IN6_IS_SCOPE_LINKLOCAL(&sa->sin6_addr)) + ia2.s6_addr16[1] = htons(sa->sin6_scope_id); - return 0; + return IN6_ARE_ADDR_EQUAL(ia, &ia2); } /* - * IPsec output logic for IPv6, tunnel mode. + * IPsec output logic for IPv6. */ int -ipsec6_output_tunnel(struct ipsec_output_state *state, struct secpolicy *sp, int flags) +ipsec6_process_packet( + struct mbuf *m, + struct ipsecrequest *isr *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed May 28 12:49:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5EA69E3; Wed, 28 May 2014 12:49:15 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DCF4322FD; Wed, 28 May 2014 12:49:13 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s4SCn4OU083097 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 28 May 2014 16:49:04 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s4SCn4or083096; Wed, 28 May 2014 16:49:04 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 28 May 2014 16:49:04 +0400 From: Gleb Smirnoff To: Hans Petter Selasky Subject: Re: svn commit: r266798 - head/usr.sbin/usbdump Message-ID: <20140528124904.GI50679@FreeBSD.org> References: <201405281227.s4SCRgKs038491@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201405281227.s4SCRgKs038491@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 12:49:15 -0000 On Wed, May 28, 2014 at 12:27:42PM +0000, Hans Petter Selasky wrote: H> Author: hselasky H> Date: Wed May 28 12:27:41 2014 H> New Revision: 266798 H> URL: http://svnweb.freebsd.org/changeset/base/266798 H> H> Log: H> Fix for big endian architectures. The "up_address" field is 8-bit and H> does not need byte swapping. H> H> MFC after: 1 week Do we need the assignment then? I'm surprised that compiler doesn't fail on that. H> Modified: H> head/usr.sbin/usbdump/usbdump.c H> H> Modified: head/usr.sbin/usbdump/usbdump.c H> ============================================================================== H> --- head/usr.sbin/usbdump/usbdump.c Wed May 28 11:30:37 2014 (r266797) H> +++ head/usr.sbin/usbdump/usbdump.c Wed May 28 12:27:41 2014 (r266798) H> @@ -473,7 +473,7 @@ print_apacket(const struct header_32 *hd H> */ H> up->up_totlen = le32toh(up->up_totlen); H> up->up_busunit = le32toh(up->up_busunit); H> - up->up_address = le32toh(up->up_address); H> + up->up_address = up->up_address; H> up->up_flags = le32toh(up->up_flags); H> up->up_status = le32toh(up->up_status); H> up->up_error = le32toh(up->up_error); -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed May 28 12:58:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9706951C; Wed, 28 May 2014 12:58:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83C6E240A; Wed, 28 May 2014 12:58:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4SCwbk3052082; Wed, 28 May 2014 12:58:37 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4SCwbEt052081; Wed, 28 May 2014 12:58:37 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405281258.s4SCwbEt052081@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 28 May 2014 12:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266803 - head/usr.sbin/usbdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 12:58:37 -0000 Author: hselasky Date: Wed May 28 12:58:37 2014 New Revision: 266803 URL: http://svnweb.freebsd.org/changeset/base/266803 Log: Remove nop. MFC after: 1 week Modified: head/usr.sbin/usbdump/usbdump.c Modified: head/usr.sbin/usbdump/usbdump.c ============================================================================== --- head/usr.sbin/usbdump/usbdump.c Wed May 28 12:52:11 2014 (r266802) +++ head/usr.sbin/usbdump/usbdump.c Wed May 28 12:58:37 2014 (r266803) @@ -473,7 +473,6 @@ print_apacket(const struct header_32 *hd */ up->up_totlen = le32toh(up->up_totlen); up->up_busunit = le32toh(up->up_busunit); - up->up_address = up->up_address; up->up_flags = le32toh(up->up_flags); up->up_status = le32toh(up->up_status); up->up_error = le32toh(up->up_error); From owner-svn-src-head@FreeBSD.ORG Wed May 28 12:59:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15C8065A; Wed, 28 May 2014 12:59:10 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C81B52411; Wed, 28 May 2014 12:59:09 +0000 (UTC) Received: from laptop015.home.selasky.org (c123.sec.cl.cam.ac.uk [128.232.18.123]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 433DE248009; Wed, 28 May 2014 14:59:02 +0200 (CEST) Message-ID: <5385DDBF.4000007@selasky.org> Date: Wed, 28 May 2014 14:59:43 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r266798 - head/usr.sbin/usbdump References: <201405281227.s4SCRgKs038491@svn.freebsd.org> <20140528124904.GI50679@FreeBSD.org> In-Reply-To: <20140528124904.GI50679@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 12:59:10 -0000 On 05/28/14 14:49, Gleb Smirnoff wrote: > On Wed, May 28, 2014 at 12:27:42PM +0000, Hans Petter Selasky wrote: > H> Author: hselasky > H> Date: Wed May 28 12:27:41 2014 > H> New Revision: 266798 > H> URL: http://svnweb.freebsd.org/changeset/base/266798 > H> > H> Log: > H> Fix for big endian architectures. The "up_address" field is 8-bit and > H> does not need byte swapping. > H> > H> MFC after: 1 week > > Do we need the assignment then? I'm surprised that compiler doesn't fail on that. > Right, fixed. --HPS From owner-svn-src-head@FreeBSD.ORG Wed May 28 13:15:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E74D6AF3; Wed, 28 May 2014 13:15:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D434E25A4; Wed, 28 May 2014 13:15:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4SDFEUH061177; Wed, 28 May 2014 13:15:14 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4SDFEvc061176; Wed, 28 May 2014 13:15:14 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201405281315.s4SDFEvc061176@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 28 May 2014 13:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266806 - head/sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 13:15:15 -0000 Author: glebius Date: Wed May 28 13:15:14 2014 New Revision: 266806 URL: http://svnweb.freebsd.org/changeset/base/266806 Log: Use M_WAITOK for the NGM_PIPE_SET_CFG control message. We expect it to arrive from userland only. Submitted by: Dmitry Luhtionov Modified: head/sys/netgraph/ng_pipe.c Modified: head/sys/netgraph/ng_pipe.c ============================================================================== --- head/sys/netgraph/ng_pipe.c Wed May 28 13:06:53 2014 (r266805) +++ head/sys/netgraph/ng_pipe.c Wed May 28 13:15:14 2014 (r266806) @@ -471,7 +471,7 @@ parse_cfg(struct ng_pipe_hookcfg *curren if (hinfo->ber_p == NULL) hinfo->ber_p = malloc((MAX_FSIZE + MAX_OHSIZE) * sizeof(uint64_t), - M_NG_PIPE, M_NOWAIT); + M_NG_PIPE, M_WAITOK); current->ber = new->ber; /* From owner-svn-src-head@FreeBSD.ORG Wed May 28 14:12:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38B3FE09; Wed, 28 May 2014 14:12:48 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AD942B5B; Wed, 28 May 2014 14:12:47 +0000 (UTC) Received: from jre-mbp.elischer.org (ppp121-45-232-70.lns20.per1.internode.on.net [121.45.232.70]) (authenticated bits=0) by vps1.elischer.org (8.14.8/8.14.8) with ESMTP id s4SECbaa091341 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 28 May 2014 07:12:40 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <5385EED0.1010506@freebsd.org> Date: Wed, 28 May 2014 22:12:32 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, dmitryluhtionov@gmail.com Subject: Re: svn commit: r266806 - head/sys/netgraph References: <201405281315.s4SDFEvc061176@svn.freebsd.org> In-Reply-To: <201405281315.s4SDFEvc061176@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 14:12:48 -0000 On 5/28/14, 9:15 PM, Gleb Smirnoff wrote: > Author: glebius > Date: Wed May 28 13:15:14 2014 > New Revision: 266806 > URL: http://svnweb.freebsd.org/changeset/base/266806 > > Log: > Use M_WAITOK for the NGM_PIPE_SET_CFG control message. We expect it to > arrive from userland only. > > Submitted by: Dmitry Luhtionov what's to stop another node from generating it and sending it on? generally a message may come from anywhere. Just becasue YOU don't have module that sends messages to ng_pipe, doesn't mean there never will be.. also there are cases when the locking may force a message to be delivered asynchronously. > > Modified: > head/sys/netgraph/ng_pipe.c > > Modified: head/sys/netgraph/ng_pipe.c > ============================================================================== > --- head/sys/netgraph/ng_pipe.c Wed May 28 13:06:53 2014 (r266805) > +++ head/sys/netgraph/ng_pipe.c Wed May 28 13:15:14 2014 (r266806) > @@ -471,7 +471,7 @@ parse_cfg(struct ng_pipe_hookcfg *curren > if (hinfo->ber_p == NULL) > hinfo->ber_p = > malloc((MAX_FSIZE + MAX_OHSIZE) * sizeof(uint64_t), > - M_NG_PIPE, M_NOWAIT); > + M_NG_PIPE, M_WAITOK); > current->ber = new->ber; > > /* > > From owner-svn-src-head@FreeBSD.ORG Wed May 28 14:26:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7BE05DC; Wed, 28 May 2014 14:26:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A50652C88; Wed, 28 May 2014 14:26:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4SEQkpd092448; Wed, 28 May 2014 14:26:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4SEQk39092447; Wed, 28 May 2014 14:26:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201405281426.s4SEQk39092447@svn.freebsd.org> From: Marius Strobl Date: Wed, 28 May 2014 14:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266808 - head/sys/dev/sound/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 14:26:46 -0000 Author: marius Date: Wed May 28 14:26:46 2014 New Revision: 266808 URL: http://svnweb.freebsd.org/changeset/base/266808 Log: Actually, just merge r233362 and do away with the unnecessary uint8_t pointer casting altogether. Modified: head/sys/dev/sound/pci/emu10k1.c Modified: head/sys/dev/sound/pci/emu10k1.c ============================================================================== --- head/sys/dev/sound/pci/emu10k1.c Wed May 28 13:27:14 2014 (r266807) +++ head/sys/dev/sound/pci/emu10k1.c Wed May 28 14:26:46 2014 (r266808) @@ -1378,7 +1378,7 @@ emu_memalloc(struct sc_info *sc, u_int32 ofs = 0; for (idx = start; idx < start + blksz; idx++) { mem->bmap[idx >> 3] |= 1 << (idx & 7); - tmp = (uintptr_t)((u_int8_t *)(uintptr_t)blk->buf_addr + ofs); + tmp = (uint32_t)(blk->buf_addr + ofs); #ifdef EMUDEBUG printf("pte[%d] -> %x phys, %x virt\n", idx, tmp, ((u_int32_t)buf) + ofs); From owner-svn-src-head@FreeBSD.ORG Wed May 28 14:26:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A2AF5DB for ; Wed, 28 May 2014 14:26:45 +0000 (UTC) Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD8AA2C87 for ; Wed, 28 May 2014 14:26:44 +0000 (UTC) Received: by mail-pa0-f51.google.com with SMTP id kq14so11175147pab.10 for ; Wed, 28 May 2014 07:26:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=/XCq8SMKnIJMm5QwWfCDnKx2wzBLA30DJPJ74/oL3hA=; b=L8992gE7ahd1ezQZftd2HD+8mPADZM+xtUBazX522Ki3ulGkOK29n7KMQ47yq2pV8L Fw+2vMTcawnPY5FfC4MHp0s6CSKQkRWSH6MWPm73Zwx/+Rc1gR36MIc+hrmvx2R02+KO mOy7xc5Ib2QciJnf1kzACXAvsJAxyZjfU8z5ssyv6LduwO4gvj8maE8fQa4rT8+eMeCG /1gGHhW5cyBABNT+d4uoHXVDzdrTdnWw9LnhyHl597VpYndGs4A64w9oxJHv4OYxD0BA IXss9jIrg6mjQ9De24RSLYFBQHG3MmGD1p+ZS6wK9A/sV9qMmKgkmTsEZfthH7yTgIqE 8MVw== X-Gm-Message-State: ALoCoQkuyhZe3oS+uhoJYqiPwASPqljWq4J25J2J5vcq7gIEAu+FBaml+Ul16Fj7rBgLOdU2tiJY X-Received: by 10.68.164.67 with SMTP id yo3mr46671156pbb.104.1401287203328; Wed, 28 May 2014 07:26:43 -0700 (PDT) Received: from lgmac-rtangirala.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id bq4sm28707335pbb.60.2014.05.28.07.26.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 May 2014 07:26:42 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_00A58E78-DF71-466C-86E8-77A748FE57EB"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266553 - head/release/scripts From: Warner Losh In-Reply-To: <20140528125027.6d0cc4fb@kalimero.tijl.coosemans.org> Date: Wed, 28 May 2014 08:26:58 -0600 Message-Id: <5E038619-5921-4B7A-A4EE-D1E83614934B@bsdimp.com> References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> <5380EBA8.1030200@freebsd.org> <20140525011307.142b41ab@kalimero.tijl.coosemans.org> <3CCAFAD3-FABE-40EF-ABF9-815FE5826349@bsdimp.com> <9FE34CE4-C71F-4806-9EF6-30CB1051C62F@bsdimp.com> <20140526113502.239db74d@kalimero.tijl.coosemans.org> <5383522F.30108@freebsd.org> <20140527001811.3e9d3e8d@kalimero.tijl.coosemans.org> <05D1A11D-5985-42EA-84AD-209A8B51D391@bsdimp.com> <20140527093633.0a922e13@kalimero.tijl.coosemans.org> <85FABD2B-81BB-4E1A-B61E-4216A144A9DB@bsdimp.com> <20140527214038.17d00369@kalimero.tijl.coosemans.org> <13EB325C-3882-46AA-9B17-3BF19997C978@bsdimp.com> <20140528125027.6d0cc4fb@kalimero.tijl.coosemans.org> To: Tijl Coosemans X-Mailer: Apple Mail (2.1878.2) Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , Nathan Whitehorn , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 14:26:45 -0000 --Apple-Mail=_00A58E78-DF71-466C-86E8-77A748FE57EB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On May 28, 2014, at 4:50 AM, Tijl Coosemans wrote: > On Tue, 27 May 2014 14:31:44 -0600 Warner Losh wrote: >> On May 27, 2014, at 1:40 PM, Tijl Coosemans wrote: >>> On Tue, 27 May 2014 07:18:06 -0600 Warner Losh wrote: >>>> On May 27, 2014, at 1:36 AM, Tijl Coosemans = wrote: >>>>> On Mon, 26 May 2014 16:31:21 -0600 Warner Losh wrote: >>>> So I?m still waiting for a use case that requires the new names. = One has >>>> not been articulated, and I don?t think one actually exists. >>>=20 >>> Imagine you've built a system with MACHINE_ARCH amd64 and one with >>> MACHINE_ARCH mips64. Now you want to populate these systems with a = list >>> of packages for which you wrote a script. These systems each = support 2 >>> ABIs: a native 64-bit one (amd64 and mips64) and a native 32-bit one = (x32 >>> and mipsn32). Both are native in the sense that they make full use = of the >>> instruction set. This is not like i386 on amd64 or mips o32 on = mips64 >>> because those are more like compat shims that operate under special >>> (crippled) cpu modes that nobody uses unless they're stuck with old = code. >>> Both our ABIs on the other hand are native and equally valid and = which one >>> to use for a particular package depends entirely on the use case. = If your >>> use case requires more than 4G of address space you'll have to use = the >>> 64-bit package, otherwise you can use the 32-bit package which, = depending >>> on how pointer heavy the code is, may give a performance benefit. = You >>> make this choice for each of the packages in your list and add that >>> information to your script. >>=20 >> Long hypothetical, but so what? In such a case, you=92d pick one of = two >> different MACHINE_ARCH values depending on the package. This this is = a >> fairly atypical use case, it would not be unreasonable for the person >> wanting to do this to know the proper companion ABI. In both cases, = you >> have the choice of two other values to use. Which one you use will = depend >> on a variety of factors, and what might be right for one application = may >> be wrong for others. >>=20 >> And in both cases, there=92s actually two choices: for amd64, you=92d = have >> i386 and x32. Both of these are fine choices, and it would depend on = the >> workload which one is better (i386 has better toolchain support and >> maturity, x32 offers some interesting theoretical wins, but doesn=92t = have >> the same maturity). Same with mips64, you=92d have two choices as = well. In >> both cases, you can=92t just take uname/MACHINE_ARCH and slap :32 on = the end. >=20 > As far as I can see nobody uses i386 on amd64 except in cases where = you > know you're dealing with i386 like an i386 jail, or you need to run an = old > i386 binary that you're stuck with, or with compat shims like Wine. = The > choice of i386 is not comparable with the generic choice between ILP32 = or > LP64 on a 64-bit instruction set, which is why I'm ok with changing = the > "x86" in the pkg scheme to either "i386" or "amd64" like you are = proposing. > If pkg would keep using instruction set families like "x86" or "mips" = then > you could distinguish between old 32-bit, new 32-bit and new 64-bit = using > 3 generic suffixes to avoid lookup tables. The pattern of an old = 32-bit > instruction set that got extended to 64-bit on which you can define a = new > 32-bit ABI is common to many instruction set families, but I'm ok with > old 32-bit and new 64-bit having separate MACHINE_ARCH values. OK. So we use MACHINE_ARCH for the pkg scheme. I=92m glad we agree on = this point. That will make adding support for pkg repos and multiple = machine builds to nanobsd much easier. >>> Now let's work with Nathan's patch which uses the following string = to >>> identify the pkg repository to fetch packages from: >>> `uname -s`:`uname -r | cut -f 1 -d .`:`uname -p` >>>=20 >>> On our two systems that would be FreeBSD:11:amd64 and = FreeBSD:11:mips64. >>> Now if your script has to install the 32-bit version of a package = how >>> can it go from those two strings to FreeBSD:11:x32 or = FreeBSD:11:mipsn32 >>> without a lookup table? >>=20 >> You couldn=92t. Which is the whole reason I want to have them have a >> standard name so you don=92t need the lookup table for the common = case. >> This is an =93off in the weeds=94 case, and optimizing for it doesn=92t= make >> sense. Especially because in each case, you have two different 32-bit >> ABIs to choose from. You=92d have to have some kind of table in = either >> case. Also, the proper name for n32, in your current system, is >> mips:32:n32, which (a) is wrong and (b) isn=92t regular. >=20 > Well, it may not make sense to you and be off in the weeds, but it = does > to me. Very few processes actually need more than 4G of virtual = address > space. I cannot immediately find anything in /bin or /usr/bin for > instance (maybe clang when compiling a very large C++ file?). >=20 > I'm not sure where you're getting mips:32:n32 from. We're talking in = the > context of Nathan's patch here. In the context of Nathan=92s patch, mips:32:n32 is the =93old=94 name = that is an alias for mipsn32. There=92s no =93mips64:32=94 defined at = all, so that pattern breaks. That was my specific point. >>> I say, you can more easily indicate whether you >>> want the 32-bit or 64-bit package by appending :32 or :64 to the = original >>> strings, so FreeBSD:11:amd64:32 and FreeBSD:11:mips64:32. >>=20 >> Except there=92s no such thing as mips64:32 in the current system. = There=92s >> two different ABIs that could mean. It could be o32 or n32, with the = same >> sort of trade offs. There=92d need to be a person in the loop to = know, so >> there=92s already a need to have special knowledge. You can=92t get = there by >> just adding :32 to the existing thing... >=20 > Yes, I am assuming that o32 on mips64 is like i386 on amd64, i.e. only = used > in cases where you know you're dealing with mips o32, and that = normally n32 > is the 32-bit ABI of choice on mips64 because it provides better = performance. That=92s not a good assumption. In fact, it is a terrible assumption = given the relative maturity of the o32 and n32 implementations on = FreeBSD mips. o32 is extremely well tested and works fairly well. n32 = works, mostly, but has many edge cases that seem a little off that = haven=92t been fully shaken out. >>> Like I said in a reply to Nathan's patch, pkg could default to :32 = or :64 >>> for every arch so it can be left out in many cases. FreeBSD:11:i386 >>> would then be equivalent to FreeBSD:11:i386:32, FreeBSD:11:amd64 to >>> FreeBSD:11:amd64:64, etc. >>=20 >> I don=92t see what value that adds to have the extra :32 or :64. = Nathan=92s >> patches make it possible to have an automated build system with the >> typical use case (I want to build all my binaries, packages, etc the >> same). But adding a :32 isn=92t going to even work for your = hypothetical >> example because people actually building such systems will need to >> specify which 32-bit ABI they want to use anyway. And the degenerate = case >> of :32 just doesn=92t work with mips=85 >>=20 >> Consider too that we=92re planning a new i386 ABI, which is identical = to >> the current i386 ABI, except time_t is 64 bit. We=92ve penciled in = the >> name i386t64 for this ABI/MACHINE_ARCH. This will be much less = painful, >> it is thought, than finding all the current places that take time_t = as >> an arg and shimming=85 So if we were to do that, then your current = scheme >> wouldn=92t be able to encompass that eventuality and we=92d be back = to this >> argument... >=20 > Nobody will use this new ABI on amd64 when x32 is supported. X32 has = more > registers available and a far better calling convention. "Tools not policy=94 has been the mantra of the project. You are making = assumptions here that may not be correct today, and may change over time = and baking that into the tools. This seems unwise. >>> This also does not preclude the existence of a mipsn32 MACHINE_ARCH = in >>> case you want to build a pure mipsn32 system (including the kernel), = but >>> I wonder how many people would use that if it is possible to have a >>> mips64 system run n32 binaries. I don't think many people would run = a >>> pure x32 system (with x32 kernel) so I don't see the need to have an >>> "x32" value for MACHINE_ARCH (or TARGET_ARCH). >>=20 >> Actually, you absolutely must have a x32 MACHINE_ARCH if you want to = be >> able to run x32 binaries. Otherwise, how are you going to build the >> libraries that use that API? Our build system simply isn=92t setup to >> build them any other way. Although the usr/lib32 stuff could grow = extra >> goo for that, you are still building them the same way you=92d build. = We >> have a stylized way to create a sys root, which is needed for the >> compilers to work. We=92d likely have to grow better multi lib = support >> than we have now as well. You=92d need some way to identify these = binaries, >> segregate their ld.so, etc. Even if no kernel ever is linked this = way, >> it is still an absolute requirement. >=20 > I'm kind of hoping we can close this discussion now and agree to = disagree > on the points that we still disagree, so I don't really want to = discuss > our build system. We'd be off for another week. I understand why we > build compat32 libraries the way we do now. It was the only way at = the > time. In my opinion the choice between 32-bit or 64-bit should be = like > choosing between static or shared, pic or non-pic, or with or without > profiling. It's just a compiler flag while our current build system > treats it almost like a full blown cross compilation problem. Then we disagree on this point. However, the disagreement here is kinda = foundational: to build a set of libraries or sys root, you have to have = a MACHINE_ARCH to make it work. Even in our current system, we set = MACHINE_ARCH to i386 or powerpc when building the 32-bit binaries (note: = we don=92t do this for mips). This means that if we do grow x32 support, = we=92ll need to grow a MACHINE_ARCH for it. That=92s my point: all ABIs = have MACHINE_ARCH associated with them, and those are the names users = are used to specifying, and are the ones that are the most natural for = script writers to use. With nathan=92s patches, we=92re to the point = where those are used, though there=92s also the option of using the = non-standard names if you want (e.g. amd64:32 instead of x32). Believe me, I don=92t want to talk about the build system, but it is = relevant for this discussion because of the integration into the base = system. It can=92t just be ignored. Warner --Apple-Mail=_00A58E78-DF71-466C-86E8-77A748FE57EB Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJThfIyAAoJEGwc0Sh9sBEA0qYP/0oxa0vJSGzr9llmgCVKa4HB E3QsS+81NIKEcgXP0Ii0Jp5Jbl2JyfRQ1JW6LLg1+1S/qrTdLos/y9FCYTohIo9P VhQtGanOozBSrIDDLVsapKcZExfNH01UBXJL8dQD5Hm0mcMjez1wFR6Pg5NyHFYv m/4W2Cb8Rr6H6DENkazwrEmGZRwMj0ltOejcLc37xgBukYFltpFTVvY0GKATs6HB meWrR8koKG/KHNPqhYRkZqx2+yyLAspnKme2odkVt9ikw8cjDdqEgr2PEe19xIaq WOfIVr8wN+hTUWDoCm228y7ZxByBdawbaHHzZEYCyyHp1Wu3FbtqbmOAgo6jC/Hc 5pAtOM8zukYL9MQMCdTYlLh9NUYmfBFm3k6PjRyIP3qtTxVRDfZJVjvmMmMBTc9c LXiFdeq0/c/K/FGgoaA684zsdVA4U4h9CDiEpcYRzPyd7QKfCbOpw8VgWYRXrq3P Kpf0qkM/DxmBQwAr/3UoptcyBNjfEMK+Hq/bCCaROkO8ve0CQklzsgKkkMjHQCZl 8/HXBWfke02qXh6sFDFbgXIvMDkkRvA/9WFpeGm0RAabuoe0Xdtat+f+vuX4usUy WBqitIfqcFKiZSgDxut4pXPSIihLUN8ZAc+t5t9AX6N1XZs2LIXdwDdr00n++xv9 AFNSc9hA1e+MeUUyT5zg =Ih3d -----END PGP SIGNATURE----- --Apple-Mail=_00A58E78-DF71-466C-86E8-77A748FE57EB-- From owner-svn-src-head@FreeBSD.ORG Wed May 28 14:56:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C341E10F; Wed, 28 May 2014 14:56:24 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 308E32FB0; Wed, 28 May 2014 14:56:23 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s4SEuJ7p083952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 28 May 2014 18:56:19 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s4SEuJPS083951; Wed, 28 May 2014 18:56:19 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 28 May 2014 18:56:19 +0400 From: Gleb Smirnoff To: Julian Elischer Subject: Re: svn commit: r266806 - head/sys/netgraph Message-ID: <20140528145619.GM50679@FreeBSD.org> References: <201405281315.s4SDFEvc061176@svn.freebsd.org> <5385EED0.1010506@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5385EED0.1010506@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, dmitryluhtionov@gmail.com X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 14:56:24 -0000 On Wed, May 28, 2014 at 10:12:32PM +0800, Julian Elischer wrote: J> On 5/28/14, 9:15 PM, Gleb Smirnoff wrote: J> > Author: glebius J> > Date: Wed May 28 13:15:14 2014 J> > New Revision: 266806 J> > URL: http://svnweb.freebsd.org/changeset/base/266806 J> > J> > Log: J> > Use M_WAITOK for the NGM_PIPE_SET_CFG control message. We expect it to J> > arrive from userland only. J> > J> > Submitted by: Dmitry Luhtionov J> what's to stop another node from generating it and sending it on? J> generally a message may come from anywhere. J> Just becasue YOU don't have module that J> sends messages to ng_pipe, doesn't mean there never will be.. J> also there are cases when the locking may force a message to be J> delivered asynchronously. I know that. After resolving many issues with netgraph, I feel that our policy should be towards putting some invariants on what events SHOULD come from userland only and which events SHOULD be serviced without memory failures. Current paradigma that messages are fully symmetrical and can come from anywhere are quite a curious thought experiment. I liked that for a long time. But in practice if we want to build a robust software we should make more strict rules of using it. You could disagree, but if you try to fix this particular one liner in the paradigma of "messages come from anywhere", then you will end up with smth like 20 lines of code to this particular module. Next comes the need to fix any software or script that sends NGM_PIPE_SET_CFG, it now should be taught of dealing with ENOMEM. So, instead of one liner you will bury yourself under tons of work. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed May 28 15:28:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A7C3259; Wed, 28 May 2014 15:28:26 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2F0D22E5; Wed, 28 May 2014 15:28:25 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s4SFSLab010884; Wed, 28 May 2014 18:28:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s4SFSLab010884 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.8/Submit) id s4SFSKkB010883; Wed, 28 May 2014 18:28:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 28 May 2014 18:28:20 +0300 From: Konstantin Belousov To: Warner Losh Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140528152820.GA3991@kib.kiev.ua> References: <5383522F.30108@freebsd.org> <20140527001811.3e9d3e8d@kalimero.tijl.coosemans.org> <05D1A11D-5985-42EA-84AD-209A8B51D391@bsdimp.com> <20140527093633.0a922e13@kalimero.tijl.coosemans.org> <85FABD2B-81BB-4E1A-B61E-4216A144A9DB@bsdimp.com> <20140527214038.17d00369@kalimero.tijl.coosemans.org> <13EB325C-3882-46AA-9B17-3BF19997C978@bsdimp.com> <20140528125027.6d0cc4fb@kalimero.tijl.coosemans.org> <5E038619-5921-4B7A-A4EE-D1E83614934B@bsdimp.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wac7ysb48OaltWcw" Content-Disposition: inline In-Reply-To: <5E038619-5921-4B7A-A4EE-D1E83614934B@bsdimp.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , Nathan Whitehorn , svn-src-head@freebsd.org, Tijl Coosemans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 15:28:26 -0000 --wac7ysb48OaltWcw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 28, 2014 at 08:26:58AM -0600, Warner Losh wrote: >=20 > Then we disagree on this point. However, the disagreement here is > kinda foundational: to build a set of libraries or sys root, you have > to have a MACHINE_ARCH to make it work. Even in our current system, we > set MACHINE_ARCH to i386 or powerpc when building the 32-bit binaries > (note: we don?t do this for mips). This means that if we do grow x32 > support, we?ll need to grow a MACHINE_ARCH for it. That?s my point: > all ABIs have MACHINE_ARCH associated with them, and those are the > names users are used to specifying, and are the ones that are the most > natural for script writers to use. With nathan?s patches, we?re to the > point where those are used, though there?s also the option of using > the non-standard names if you want (e.g. amd64:32 instead of x32). > I am not sure if this comment would add anything to the discussion, but other build systems do not require MACHINE_ARCH. In our terms, other build systems are happy to build: i386 binary when MACHINE is amd64 and CFLAGS contains -m32; x32 binary when MACHINE is amd64 and CFLAGS contains -mx32. For HEAD and stable/10 we finally reached the point where -m32 works, on amd64; it worked on powerpc64 from inception, AFAIU Nathan. At least this is true for dependencies limited to the base system, and not to the ports (the later is since ports do not know about multiarch). It is limitation of our build that we require MACHINE_ARCH to build other natively supported ABI binary on the host. Ideally, the hacks that treat lib32 build as the cross-compilation would go away eventually. --wac7ysb48OaltWcw Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJThgCUAAoJEJDCuSvBvK1B3/kQAJHMLD3bSzQPkNZ60/oge4Ot muZWe0NwKV48xhAM4ZfQjQiIuqwjuacOd8uhrkNGZ4kLpJ431y7Tx0WZ8TNfvZCV mgZDbW8jKreNmFEvvfdUKYah1OrbMwESdIrxtrmRKhqq1QaHJnjswKamFphyPIu/ L4Pl20OgA5YVS4hOuWNlVgXY/7ewjCSQKxcf3krwZnnPsU0CACizegfOZVCWYAeB TaqPgehCUNt2d3sWjPoDhjRdzO2ASir6wVaN4ReJUQUpTECg4nbk59ck97KBKpbz 8mqYK9rFhXUjvufbiBoTe9nCebB3ILbBWjtFSN6ykEiVMOg29PjAkrRL1JKNhGl8 OMw5S0kRUVLcDrvwl0WsZPrKzFLHHfNaX4bbGdW1vnbMY8NneJR/biyWnh5PO7wk FoV7fEfGZ9vMcCSJDbJdzHDaraljP21CAvYADAWYhQv7CNGUbU+Zi3gC2RlGsnJW y0+W0rH59IYhdVpFxcPOOQZtw49Gtjb13XZ/voUME4YZlzhmMH8RCBfeZd7n4tRd H6TbEMVp4SJj/EuKSGbpQ+TuOyqRaqsQI4cZTe9g6JVfB7Zxf0N0vPDJs7u+dz++ Nvx9N2FZ/I4+3ozYeaBjFiZlbvn2MDsxH7vUfhH5x1rdJkamQ1Ndjwj8IAk4NKU7 /+gYAi7vnVCEhQPIPsew =26aB -----END PGP SIGNATURE----- --wac7ysb48OaltWcw-- From owner-svn-src-head@FreeBSD.ORG Wed May 28 15:35:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5AD463B for ; Wed, 28 May 2014 15:35:13 +0000 (UTC) Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD07023B1 for ; Wed, 28 May 2014 15:35:13 +0000 (UTC) Received: by mail-pa0-f42.google.com with SMTP id rd3so11212202pab.15 for ; Wed, 28 May 2014 08:35:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=ZsCKNoUtWnXUQ20VUsCZE+RWmOFM+LAlst+VAsFRk7Y=; b=bETRzKMfsSHChC0y+9rjdCRLty2fX4GSx7EgCOyqI6jgN/km7eUz/iaaY1d2Nn+u4C B9PMUkFUTCarGSzmQFyFQqRFHED0bZtX9dfl78tvVM9ZWeIkLKdYiLNqwgdKRrkuBk7s Au/xgJq86LwUaWJBTblcqfaLyIAydr2Gjgp3AQIo1TZDKiCxbVFeApYQGumKPqTV7gYn BU9feIt5lEei3O6E2fX/Uo5kaUc4oRDiio0miNH/ejE3W+mP8uFcBl/W6BsLKQl758mK vG+4Luuw8yJpss6d42Cdz0J5cCf+7tYuelTojdu75PzjXyouWkeJ1Jmjoff6D0OThDVG 5DUQ== X-Gm-Message-State: ALoCoQmolulFsZavKkd4830fErwxq1/hhEdpCIvXJ8DonWxAimBqRE3i8PpWi01CPxRUcZLH0twe X-Received: by 10.66.139.201 with SMTP id ra9mr524791pab.84.1401291312598; Wed, 28 May 2014 08:35:12 -0700 (PDT) Received: from lgmac-rtangirala.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id ek2sm28983823pbd.30.2014.05.28.08.35.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 May 2014 08:35:11 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_C7E55FE0-458E-45FA-A182-D0D8CAD07857"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266553 - head/release/scripts From: Warner Losh In-Reply-To: <20140528152820.GA3991@kib.kiev.ua> Date: Wed, 28 May 2014 09:35:27 -0600 Message-Id: References: <5383522F.30108@freebsd.org> <20140527001811.3e9d3e8d@kalimero.tijl.coosemans.org> <05D1A11D-5985-42EA-84AD-209A8B51D391@bsdimp.com> <20140527093633.0a922e13@kalimero.tijl.coosemans.org> <85FABD2B-81BB-4E1A-B61E-4216A144A9DB@bsdimp.com> <20140527214038.17d00369@kalimero.tijl.coosemans.org> <13EB325C-3882-46AA-9B17-3BF19997C978@bsdimp.com> <20140528125027.6d0cc4fb@kalimero.tijl.coosemans.org> <5E038619-5921-4B7A-A4EE-D1E83614934B@bsdimp.com> <20140528152820.GA3991@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1878.2) Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , Nathan Whitehorn , svn-src-head@freebsd.org, Tijl Coosemans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 15:35:14 -0000 --Apple-Mail=_C7E55FE0-458E-45FA-A182-D0D8CAD07857 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On May 28, 2014, at 9:28 AM, Konstantin Belousov wrote: > On Wed, May 28, 2014 at 08:26:58AM -0600, Warner Losh wrote: >> >> Then we disagree on this point. However, the disagreement here is >> kinda foundational: to build a set of libraries or sys root, you have >> to have a MACHINE_ARCH to make it work. Even in our current system, we >> set MACHINE_ARCH to i386 or powerpc when building the 32-bit binaries >> (note: we don?t do this for mips). This means that if we do grow x32 >> support, we?ll need to grow a MACHINE_ARCH for it. That?s my point: >> all ABIs have MACHINE_ARCH associated with them, and those are the >> names users are used to specifying, and are the ones that are the most >> natural for script writers to use. With nathan?s patches, we?re to the >> point where those are used, though there?s also the option of using >> the non-standard names if you want (e.g. amd64:32 instead of x32). >> > > I am not sure if this comment would add anything to the discussion, > but other build systems do not require MACHINE_ARCH. In our terms, > other build systems are happy to build: > i386 binary when MACHINE is amd64 and CFLAGS contains -m32; > x32 binary when MACHINE is amd64 and CFLAGS contains -mx32. > > For HEAD and stable/10 we finally reached the point where -m32 works, > on amd64; it worked on powerpc64 from inception, AFAIU Nathan. At least > this is true for dependencies limited to the base system, and not to the > ports (the later is since ports do not know about multiarch). > > It is limitation of our build that we require MACHINE_ARCH to build > other natively supported ABI binary on the host. Ideally, the hacks that > treat lib32 build as the cross-compilation would go away eventually. I doubt it. The MACHINE_ARCH is used to select which files to build. Warner --Apple-Mail=_C7E55FE0-458E-45FA-A182-D0D8CAD07857 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJThgJAAAoJEGwc0Sh9sBEATWIQAL2aH326GOmkVtr9IQoZwBjL IQwJrOHSIvKMouWtwA0HSLBDSmV1MMgc/r9xTzUcP6Kk0Dpj7wgiDoD1Oz63CFI9 t8mQ6zWDIrKOUPrUt8ziWXRLzI3Ok/DK9E3UhlnAVtjFFPH97LYwY5xut5aeC3zE +Fxoibnmwc9UrI6muPRYLZ/RcbGqMqHRFqacYyKSSiBXMWHN9lxYpvi+8XA4ehQ+ Pb3/e3/CotHzdU+6DrjmWlmYurzyNO7UO6iO8E1oHkNTA2CB3QVaCoAPjWsHWrLY snJY+patpa/FCwv4ScxcNijF+4ekOaldz7Hyx1MrQI5UAaitnoYatUBvjqGZB6QO HbQKwh77pswXyJyNHZK0GgpDbWs6cFbNhMBUZkFlFJBzJF0HmUlPGhPITA52aw43 IGo0PWhAMWrYrvyc+ZvFvVzVZ4uL/lihiOuMTTlG8gpNmjC1Xc0q2PpsoNtF+Rba yARNO9guMljxErDe8OKfwGGrBZYq9hBygS8Yr3kas1J1vAoJg8F0/zJlKK7Q+uCc qw9cUVgn66gv2qC1XZ7CkA+g74630aTX8dhRZwGgU6RHoCNCpKhLMszp3Pzj3bes j8gIk9THiBvBe37bFtE8dbruWnYQ85xvtQ46NtIbt7KctDni0Abyt0P2UqeC4zw5 EYmAx6CZoznRQ3IRHgBI =dBaE -----END PGP SIGNATURE----- --Apple-Mail=_C7E55FE0-458E-45FA-A182-D0D8CAD07857-- From owner-svn-src-head@FreeBSD.ORG Wed May 28 15:41:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22A1E8A1; Wed, 28 May 2014 15:41:35 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CF4C32422; Wed, 28 May 2014 15:41:34 +0000 (UTC) Received: from jre-mbp.elischer.org (ppp121-45-232-70.lns20.per1.internode.on.net [121.45.232.70]) (authenticated bits=0) by vps1.elischer.org (8.14.8/8.14.8) with ESMTP id s4SFfS85091647 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 28 May 2014 08:41:31 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <538603A3.7080303@freebsd.org> Date: Wed, 28 May 2014 23:41:23 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r266806 - head/sys/netgraph References: <201405281315.s4SDFEvc061176@svn.freebsd.org> <5385EED0.1010506@freebsd.org> <20140528145619.GM50679@FreeBSD.org> In-Reply-To: <20140528145619.GM50679@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, dmitryluhtionov@gmail.com X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 15:41:35 -0000 On 5/28/14, 10:56 PM, Gleb Smirnoff wrote: > On Wed, May 28, 2014 at 10:12:32PM +0800, Julian Elischer wrote: > J> On 5/28/14, 9:15 PM, Gleb Smirnoff wrote: > J> > Author: glebius > J> > Date: Wed May 28 13:15:14 2014 > J> > New Revision: 266806 > J> > URL: http://svnweb.freebsd.org/changeset/base/266806 > J> > > J> > Log: > J> > Use M_WAITOK for the NGM_PIPE_SET_CFG control message. We expect it to > J> > arrive from userland only. > J> > > J> > Submitted by: Dmitry Luhtionov > J> what's to stop another node from generating it and sending it on? > J> generally a message may come from anywhere. > J> Just becasue YOU don't have module that > J> sends messages to ng_pipe, doesn't mean there never will be.. > J> also there are cases when the locking may force a message to be > J> delivered asynchronously. > > I know that. After resolving many issues with netgraph, I feel that > our policy should be towards putting some invariants on what events > SHOULD come from userland only and which events SHOULD be serviced > without memory failures. > > Current paradigma that messages are fully symmetrical and can come > from anywhere are quite a curious thought experiment. I liked that > for a long time. But in practice if we want to build a robust software > we should make more strict rules of using it. > > You could disagree, but if you try to fix this particular one liner > in the paradigma of "messages come from anywhere", then you will end > up with smth like 20 lines of code to this particular module. Next > comes the need to fix any software or script that sends NGM_PIPE_SET_CFG, > it now should be taught of dealing with ENOMEM. So, instead of one > liner you will bury yourself under tons of work. > > Then I suggest that we increment the protocol, and add support to messages to say whether they come from user space. and some providers only accept such messages. I have lost track of the code so I don't know if my comment about messages getting queued instead of delivered is still true. However if it is, then a message could be delivered by a kernel agent even if it is initiated by a userspace program. From owner-svn-src-head@FreeBSD.ORG Wed May 28 15:47:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52146AFC; Wed, 28 May 2014 15:47:33 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBCE224D9; Wed, 28 May 2014 15:47:32 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s4SFlSLW016504; Wed, 28 May 2014 18:47:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s4SFlSLW016504 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.8/Submit) id s4SFlSq5016503; Wed, 28 May 2014 18:47:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 28 May 2014 18:47:28 +0300 From: Konstantin Belousov To: Warner Losh Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140528154728.GB3991@kib.kiev.ua> References: <20140527001811.3e9d3e8d@kalimero.tijl.coosemans.org> <05D1A11D-5985-42EA-84AD-209A8B51D391@bsdimp.com> <20140527093633.0a922e13@kalimero.tijl.coosemans.org> <85FABD2B-81BB-4E1A-B61E-4216A144A9DB@bsdimp.com> <20140527214038.17d00369@kalimero.tijl.coosemans.org> <13EB325C-3882-46AA-9B17-3BF19997C978@bsdimp.com> <20140528125027.6d0cc4fb@kalimero.tijl.coosemans.org> <5E038619-5921-4B7A-A4EE-D1E83614934B@bsdimp.com> <20140528152820.GA3991@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Fba/0zbH8Xs+Fj9o" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , Nathan Whitehorn , svn-src-head@freebsd.org, Tijl Coosemans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 15:47:33 -0000 --Fba/0zbH8Xs+Fj9o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 28, 2014 at 09:35:27AM -0600, Warner Losh wrote: >=20 > On May 28, 2014, at 9:28 AM, Konstantin Belousov wr= ote: >=20 > > On Wed, May 28, 2014 at 08:26:58AM -0600, Warner Losh wrote: > >>=20 > >> Then we disagree on this point. However, the disagreement here is > >> kinda foundational: to build a set of libraries or sys root, you have > >> to have a MACHINE_ARCH to make it work. Even in our current system, we > >> set MACHINE_ARCH to i386 or powerpc when building the 32-bit binaries > >> (note: we don?t do this for mips). This means that if we do grow x32 > >> support, we?ll need to grow a MACHINE_ARCH for it. That?s my point: > >> all ABIs have MACHINE_ARCH associated with them, and those are the > >> names users are used to specifying, and are the ones that are the most > >> natural for script writers to use. With nathan?s patches, we?re to the > >> point where those are used, though there?s also the option of using > >> the non-standard names if you want (e.g. amd64:32 instead of x32). > >>=20 > >=20 > > I am not sure if this comment would add anything to the discussion, > > but other build systems do not require MACHINE_ARCH. In our terms, > > other build systems are happy to build: > > i386 binary when MACHINE is amd64 and CFLAGS contains -m32; > > x32 binary when MACHINE is amd64 and CFLAGS contains -mx32. > >=20 > > For HEAD and stable/10 we finally reached the point where -m32 works, > > on amd64; it worked on powerpc64 from inception, AFAIU Nathan. At least > > this is true for dependencies limited to the base system, and not to the > > ports (the later is since ports do not know about multiarch). > >=20 > > It is limitation of our build that we require MACHINE_ARCH to build > > other natively supported ABI binary on the host. Ideally, the hacks that > > treat lib32 build as the cross-compilation would go away eventually. >=20 > I doubt it. The MACHINE_ARCH is used to select which files to build. Do I understand you right that the comment references e.g. a selection of arch-specific subdir in lib/libc or libexec/rtld-elf for inclusion into the build ? If yes, I cannot disagree with the statement. My note was about our build system which currently requires full-fledged cross-build to even create i386 binary on amd64 vs. other builds which consider this as a (often minor) variations of the host target. Sure, some variances must be allowed, e.g. to select proper .S file for the ABI, but we do not need cross-build to get i386 on amd64. --Fba/0zbH8Xs+Fj9o Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJThgUPAAoJEJDCuSvBvK1Bbe4QAJDH1hKh9V4H/9aU4CyfR9YE bOiZ1ZkoCTs2zvkPyJyQ53GWXnAPZLDTo0pcljeY86riSguTCOVG7aKDFJf4TkrB eeK5e31BCbTK38Hz/M8I+fYv86FqcT41bn0uTAIWCdAltdghh/9pWYG55kNIg94P INp4fa3hauBqW8ZpIHBUjq7ECpORpeF7I1Jf0B7Xxk7aKN7ClqyRkXidsJ3R4MBf MvZxVzIauGzyRC3uLGoTuKWMv29fRoZVPTktpecXSZVrP+LQU8tlyfHpNbeh1c1Z mEQLy4L8/VIr6ThwFXQIflYeiDrGIYdmdUO1y5LUjcSVuhOTVHbiMnZ9xurAM/T+ k1JKw/NOohI0KrzGtqLnAQ+ujfr1oHssNv0wdbsyJeogcwkoN2uPSPTzmznjBQ2i D/NNWF8GGlRiAzQYOWdDoXUwjauh9TxFrNhXmxVGWQaG2WqvwQZkPzyYy46b8VTg Xeg2toBnzW218ClZir9pNCNjtPqcn+EXvKCq/iiBscQQPmjYlW8im2WYpTCHR12H NGIGPAz7Ja/3CeIwyn3IRV3v7DyOWAYU/HhANoMrdchJu5vm9z7TG6jVu7skWg0T GORMGasuwMpyKwNRWMKedb4EAa7SGEnKtIb/tKDxSY4mOjwU5LPZoq/At21O1OoU JHgJ2a+NR/m+ADvxYnlW =GH1I -----END PGP SIGNATURE----- --Fba/0zbH8Xs+Fj9o-- From owner-svn-src-head@FreeBSD.ORG Wed May 28 16:28:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 836BE95C; Wed, 28 May 2014 16:28:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 64D9C294B; Wed, 28 May 2014 16:28:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4SGSNDV046502; Wed, 28 May 2014 16:28:23 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4SGSMsH046497; Wed, 28 May 2014 16:28:22 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405281628.s4SGSMsH046497@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 28 May 2014 16:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266812 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 16:28:23 -0000 Author: hselasky Date: Wed May 28 16:28:22 2014 New Revision: 266812 URL: http://svnweb.freebsd.org/changeset/base/266812 Log: Fixes for ISP/SAF1761 host mode: - Make the USB hardware skip PTDs which are not allocated. - Peek host memory twice. Sometimes the PTD status is incorrectly returned as zero. - Ensure the host channel is always freed when software TD is completing. - Add correct configuration of interrupt polarity and type. - Set CERR to 2 for asynchronous traffic to avoid having to reactivate the PTD when a NAK token is received. - Fix detection of STALL PID. Sponsored by: DARPA, AFRL Modified: head/sys/dev/usb/controller/saf1761_otg.c head/sys/dev/usb/controller/saf1761_otg_fdt.c head/sys/dev/usb/controller/saf1761_otg_reg.h Modified: head/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.c Wed May 28 15:24:30 2014 (r266811) +++ head/sys/dev/usb/controller/saf1761_otg.c Wed May 28 16:28:22 2014 (r266812) @@ -252,25 +252,24 @@ saf1761_host_channel_free(struct saf1761 if (td->channel >= SOTG_HOST_CHANNEL_MAX) return; - /* disable channel */ - SAF1761_WRITE_LE_4(sc, SOTG_PTD(td->channel) + SOTG_PTD_DW3, 0); - SAF1761_WRITE_LE_4(sc, SOTG_PTD(td->channel) + SOTG_PTD_DW0, 0); - switch (td->ep_type) { case UE_INTERRUPT: x = td->channel - 32; - sc->sc_host_intr_map &= ~(1 << x); td->channel = SOTG_HOST_CHANNEL_MAX; + sc->sc_host_intr_map &= ~(1 << x); + SAF1761_WRITE_LE_4(sc, SOTG_INT_PTD_SKIP_PTD, ~sc->sc_host_intr_map); break; case UE_ISOCHRONOUS: x = td->channel; - sc->sc_host_isoc_map &= ~(1 << x); td->channel = SOTG_HOST_CHANNEL_MAX; + sc->sc_host_isoc_map &= ~(1 << x); + SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_SKIP_PTD, ~sc->sc_host_isoc_map); break; default: x = td->channel - 64; - sc->sc_host_async_map &= ~(1 << x); td->channel = SOTG_HOST_CHANNEL_MAX; + sc->sc_host_async_map &= ~(1 << x); + SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, ~sc->sc_host_async_map); break; } } @@ -401,19 +400,16 @@ saf1761_host_setup_tx(struct saf1761_otg pdt_addr = SOTG_PTD(td->channel); status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + if (status == 0) + status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + DPRINTFN(5, "STATUS=0x%08x\n", status); if (status & SOTG_PTD_DW3_ACTIVE) { goto busy; } else if (status & SOTG_PTD_DW3_HALTED) { - td->error_stall = 1; - td->error_any = 1; - } else if (status & SOTG_PTD_DW3_ERRORS) { td->error_any = 1; } - count = (status & SOTG_PTD_DW3_XFER_COUNT); - - saf1761_host_channel_free(sc, td); goto complete; } if (saf1761_host_channel_alloc(sc, td)) @@ -435,7 +431,7 @@ saf1761_host_setup_tx(struct saf1761_otg SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW5, 0); SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW4, 0); - temp = SOTG_PTD_DW3_ACTIVE | (td->toggle << 25) | SOTG_PTD_DW3_CERR; + temp = SOTG_PTD_DW3_ACTIVE | (td->toggle << 25) | SOTG_PTD_DW3_CERR_3; SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW3, temp); temp = SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8; @@ -450,10 +446,14 @@ saf1761_host_setup_tx(struct saf1761_otg SOTG_PTD_DW0_VALID; SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW0, temp); + /* activate PTD */ + SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, ~sc->sc_host_async_map); + td->toggle = 1; busy: return (1); /* busy */ complete: + saf1761_host_channel_free(sc, td); return (0); /* complete */ } @@ -471,15 +471,16 @@ saf1761_host_bulk_data_rx(struct saf1761 pdt_addr = SOTG_PTD(td->channel); status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + if (status == 0) + status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + DPRINTFN(5, "STATUS=0x%08x\n", status); if (status & SOTG_PTD_DW3_ACTIVE) { goto busy; } else if (status & SOTG_PTD_DW3_HALTED) { - td->error_stall = 1; - td->error_any = 1; - goto complete; - } else if (status & SOTG_PTD_DW3_ERRORS) { + if (!(status & SOTG_PTD_DW3_ERRORS)) + td->error_stall = 1; td->error_any = 1; goto complete; } @@ -509,14 +510,13 @@ saf1761_host_bulk_data_rx(struct saf1761 saf1761_read_host_memory(sc, td, count); - saf1761_host_channel_free(sc, td); - /* check if we are complete */ if ((td->remainder == 0) || got_short) { if (td->short_pkt) goto complete; /* else need to receive a zero length packet */ } + saf1761_host_channel_free(sc, td); } if (saf1761_host_channel_alloc(sc, td)) goto busy; @@ -536,10 +536,11 @@ saf1761_host_bulk_data_rx(struct saf1761 SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW5, 0); SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW4, 0); - temp = SOTG_PTD_DW3_ACTIVE | (td->toggle << 25) | SOTG_PTD_DW3_CERR; + temp = SOTG_PTD_DW3_ACTIVE | (td->toggle << 25) | + SOTG_PTD_DW3_CERR_2; SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW3, temp); - temp = SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8; + temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8); SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW2, temp); temp = td->dw1_value | (1 << 10) /* IN-PID */ | (td->ep_index >> 1); @@ -550,9 +551,13 @@ saf1761_host_bulk_data_rx(struct saf1761 (td->max_packet_size << 3) /* transfer count */ | SOTG_PTD_DW0_VALID; SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW0, temp); + + /* activate PTD */ + SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, ~sc->sc_host_async_map); busy: return (1); /* busy */ complete: + saf1761_host_channel_free(sc, td); return (0); /* complete */ } @@ -569,25 +574,26 @@ saf1761_host_bulk_data_tx(struct saf1761 pdt_addr = SOTG_PTD(td->channel); status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + if (status == 0) + status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + DPRINTFN(5, "STATUS=0x%08x\n", status); if (status & SOTG_PTD_DW3_ACTIVE) { goto busy; } else if (status & SOTG_PTD_DW3_HALTED) { - td->error_stall = 1; - td->error_any = 1; - } else if (status & SOTG_PTD_DW3_ERRORS) { + if (!(status & SOTG_PTD_DW3_ERRORS)) + td->error_stall = 1; td->error_any = 1; + goto complete; } - - saf1761_host_channel_free(sc, td); - /* check remainder */ if (td->remainder == 0) { if (td->short_pkt) goto complete; /* else we need to transmit a short packet */ } + saf1761_host_channel_free(sc, td); } if (saf1761_host_channel_alloc(sc, td)) goto busy; @@ -616,10 +622,11 @@ saf1761_host_bulk_data_tx(struct saf1761 SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW5, 0); SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW4, 0); - temp = SOTG_PTD_DW3_ACTIVE | (td->toggle << 25) | SOTG_PTD_DW3_CERR; + temp = SOTG_PTD_DW3_ACTIVE | (td->toggle << 25) | + SOTG_PTD_DW3_CERR_2; SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW3, temp); - temp = SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8; + temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8); SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW2, temp); temp = td->dw1_value | (0 << 10) /* OUT-PID */ | (td->ep_index >> 1); @@ -631,10 +638,14 @@ saf1761_host_bulk_data_tx(struct saf1761 SOTG_PTD_DW0_VALID; SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW0, temp); + /* activate PTD */ + SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, ~sc->sc_host_async_map); + td->toggle ^= 1; busy: return (1); /* busy */ complete: + saf1761_host_channel_free(sc, td); return (0); /* complete */ } @@ -652,16 +663,19 @@ saf1761_host_intr_data_rx(struct saf1761 pdt_addr = SOTG_PTD(td->channel); status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + if (status == 0) + status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + DPRINTFN(5, "STATUS=0x%08x\n", status); if (status & SOTG_PTD_DW3_ACTIVE) { goto busy; } else if (status & SOTG_PTD_DW3_HALTED) { - td->error_stall = 1; + if (!(status & SOTG_PTD_DW3_ERRORS)) + td->error_stall = 1; td->error_any = 1; goto complete; } - count = (status & SOTG_PTD_DW3_XFER_COUNT); got_short = 0; @@ -688,14 +702,13 @@ saf1761_host_intr_data_rx(struct saf1761 saf1761_read_host_memory(sc, td, count); - saf1761_host_channel_free(sc, td); - /* check if we are complete */ if ((td->remainder == 0) || got_short) { if (td->short_pkt) goto complete; /* else need to receive a zero length packet */ } + saf1761_host_channel_free(sc, td); } if (saf1761_host_channel_alloc(sc, td)) goto busy; @@ -719,7 +732,7 @@ saf1761_host_intr_data_rx(struct saf1761 temp = (1U << td->uframe); /* start split */ SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW4, temp); - temp = SOTG_PTD_DW3_ACTIVE | (td->toggle << 25) | SOTG_PTD_DW3_CERR; + temp = SOTG_PTD_DW3_ACTIVE | (td->toggle << 25) | SOTG_PTD_DW3_CERR_3; SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW3, temp); temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8) | (td->interval & 0xF8); @@ -733,9 +746,13 @@ saf1761_host_intr_data_rx(struct saf1761 (td->max_packet_size << 3) /* transfer count */ | SOTG_PTD_DW0_VALID; SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW0, temp); + + /* activate PTD */ + SAF1761_WRITE_LE_4(sc, SOTG_INT_PTD_SKIP_PTD, ~sc->sc_host_intr_map); busy: return (1); /* busy */ complete: + saf1761_host_channel_free(sc, td); return (0); /* complete */ } @@ -752,23 +769,27 @@ saf1761_host_intr_data_tx(struct saf1761 pdt_addr = SOTG_PTD(td->channel); status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + if (status == 0) + status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + DPRINTFN(5, "STATUS=0x%08x\n", status); if (status & SOTG_PTD_DW3_ACTIVE) { goto busy; } else if (status & SOTG_PTD_DW3_HALTED) { - td->error_stall = 1; + if (!(status & SOTG_PTD_DW3_ERRORS)) + td->error_stall = 1; td->error_any = 1; + goto complete; } - saf1761_host_channel_free(sc, td); - /* check remainder */ if (td->remainder == 0) { if (td->short_pkt) goto complete; /* else we need to transmit a short packet */ } + saf1761_host_channel_free(sc, td); } if (saf1761_host_channel_alloc(sc, td)) goto busy; @@ -801,7 +822,7 @@ saf1761_host_intr_data_tx(struct saf1761 temp = (1U << td->uframe); /* start split */ SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW4, temp); - temp = SOTG_PTD_DW3_ACTIVE | (td->toggle << 25) | SOTG_PTD_DW3_CERR; + temp = SOTG_PTD_DW3_ACTIVE | (td->toggle << 25) | SOTG_PTD_DW3_CERR_3; SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW3, temp); temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8) | (td->interval & 0xF8); @@ -816,22 +837,32 @@ saf1761_host_intr_data_tx(struct saf1761 SOTG_PTD_DW0_VALID; SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW0, temp); + /* activate PTD */ + SAF1761_WRITE_LE_4(sc, SOTG_INT_PTD_SKIP_PTD, ~sc->sc_host_intr_map); + td->toggle ^= 1; busy: return (1); /* busy */ complete: + saf1761_host_channel_free(sc, td); return (0); /* complete */ } static uint8_t saf1761_host_isoc_data_rx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { + /* activate PTD */ + SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_SKIP_PTD, ~sc->sc_host_isoc_map); + return (1); /* busy */ } static uint8_t saf1761_host_isoc_data_tx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { + /* activate PTD */ + SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_SKIP_PTD, ~sc->sc_host_isoc_map); + return (1); /* busy */ } @@ -1319,10 +1350,13 @@ saf1761_otg_interrupt(struct saf1761_otg SAF1761_READ_LE_4(sc, SOTG_FRAME_NUM), SAF1761_READ_LE_4(sc, SOTG_FRINDEX)); + (void) SAF1761_READ_LE_4(sc, SOTG_ATL_PTD_DONE_PTD); + (void) SAF1761_READ_LE_4(sc, SOTG_INT_PTD_DONE_PTD); + (void) SAF1761_READ_LE_4(sc, SOTG_ISO_PTD_DONE_PTD); + /* update VBUS and ID bits, if any */ - if (status & SOTG_DCINTERRUPT_IEVBUS) { + if (status & SOTG_DCINTERRUPT_IEVBUS) saf1761_otg_update_vbus(sc); - } if (status & SOTG_DCINTERRUPT_IEBRST) { /* unlock device */ @@ -1431,7 +1465,8 @@ saf1761_otg_setup_standard_chain(struct temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; - temp.setup_alt_next = xfer->flags_int.short_frames_ok; + temp.setup_alt_next = xfer->flags_int.short_frames_ok || + xfer->flags_int.isochronous_xfr; temp.did_stall = !xfer->flags_int.control_stall; is_host = (xfer->xroot->udev->flags.usb_mode == USB_MODE_HOST); @@ -1732,7 +1767,8 @@ saf1761_otg_standard_done_sub(struct usb } /* Check for short transfer */ if (len > 0) { - if (xfer->flags_int.short_frames_ok) { + if (xfer->flags_int.short_frames_ok || + xfer->flags_int.isochronous_xfr) { /* follow alt next */ if (td->alt_next) { td = td->obj_next; @@ -2048,12 +2084,13 @@ saf1761_otg_init(struct saf1761_otg_soft SAF1761_WRITE_LE_4(sc, SOTG_MODE, SOTG_MODE_GLINTENA | SOTG_MODE_CLKAON | SOTG_MODE_WKUPCS); + sc->sc_interrupt_cfg |= + SOTG_INTERRUPT_CFG_CDBGMOD | + SOTG_INTERRUPT_CFG_DDBGMODIN | + SOTG_INTERRUPT_CFG_DDBGMODOUT; + /* set default values */ - SAF1761_WRITE_LE_4(sc, SOTG_INTERRUPT_CFG, - SOTG_INTERRUPT_CFG_CDBGMOD | - SOTG_INTERRUPT_CFG_DDBGMODIN | - SOTG_INTERRUPT_CFG_DDBGMODOUT | - sc->sc_interrupt_cfg); + SAF1761_WRITE_LE_4(sc, SOTG_INTERRUPT_CFG, sc->sc_interrupt_cfg); /* enable VBUS and ID interrupt */ SAF1761_WRITE_LE_4(sc, SOTG_IRQ_ENABLE_SET_CLR, @@ -2099,15 +2136,15 @@ saf1761_otg_init(struct saf1761_otg_soft DPRINTF("USBCMD=0x%08x\n", SAF1761_READ_LE_4(sc, SOTG_USBCMD)); - /* activate all PTDs */ + /* make HC scan all PTDs */ SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_LAST_PTD, (1 << 31)); SAF1761_WRITE_LE_4(sc, SOTG_INT_PTD_LAST_PTD, (1 << 31)); SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_LAST_PTD, (1 << 31)); - /* skip no PTDs */ - SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, 0); - SAF1761_WRITE_LE_4(sc, SOTG_INT_PTD_SKIP_PTD, 0); - SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_SKIP_PTD, 0); + /* skip all PTDs by default */ + SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, -1U); + SAF1761_WRITE_LE_4(sc, SOTG_INT_PTD_SKIP_PTD, -1U); + SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_SKIP_PTD, -1U); /* activate all PTD types */ SAF1761_WRITE_LE_4(sc, SOTG_HCBUFFERSTATUS, @@ -2115,6 +2152,16 @@ saf1761_otg_init(struct saf1761_otg_soft SOTG_HCBUFFERSTATUS_INT_BUF_FILL | SOTG_HCBUFFERSTATUS_ATL_BUF_FILL); + /* we don't use the AND mask */ + SAF1761_WRITE_LE_4(sc, SOTG_ISO_IRQ_MASK_AND, 0); + SAF1761_WRITE_LE_4(sc, SOTG_INT_IRQ_MASK_AND, 0); + SAF1761_WRITE_LE_4(sc, SOTG_ATL_IRQ_MASK_AND, 0); + + /* enable all PTD OR interrupts by default */ + SAF1761_WRITE_LE_4(sc, SOTG_ISO_IRQ_MASK_OR, -1U); + SAF1761_WRITE_LE_4(sc, SOTG_INT_IRQ_MASK_OR, -1U); + SAF1761_WRITE_LE_4(sc, SOTG_ATL_IRQ_MASK_OR, -1U); + /* enable HC interrupts */ SAF1761_WRITE_LE_4(sc, SOTG_HCINTERRUPT_ENABLE, SOTG_HCINTERRUPT_OTG_IRQ | Modified: head/sys/dev/usb/controller/saf1761_otg_fdt.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg_fdt.c Wed May 28 15:24:30 2014 (r266811) +++ head/sys/dev/usb/controller/saf1761_otg_fdt.c Wed May 28 16:28:22 2014 (r266812) @@ -160,12 +160,14 @@ saf1761_otg_fdt_attach(device_t dev) if (OF_getprop(ofw_bus_get_node(dev), "int-polarity", ¶m, sizeof(param)) > 0) { sc->sc_interrupt_cfg |= SOTG_INTERRUPT_CFG_INTPOL; + sc->sc_hw_mode |= SOTG_HW_MODE_CTRL_INTR_POL; } /* get IRQ level triggering */ if (OF_getprop(ofw_bus_get_node(dev), "int-level", ¶m, sizeof(param)) > 0) { sc->sc_interrupt_cfg |= SOTG_INTERRUPT_CFG_INTLVL; + sc->sc_hw_mode |= SOTG_HW_MODE_CTRL_INTR_LEVEL; } /* initialise some bus fields */ @@ -182,23 +184,30 @@ saf1761_otg_fdt_attach(device_t dev) sc->sc_io_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); - if (!sc->sc_io_res) { + if (sc->sc_io_res == NULL) goto error; - } + sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); sc->sc_io_size = rman_get_size(sc->sc_io_res); - rid = 0; + /* try to allocate the HC interrupt first */ + rid = 1; sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->sc_irq_res == NULL) { - goto error; + /* try to allocate a common IRQ second */ + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); + if (sc->sc_irq_res == NULL) + goto error; } + sc->sc_bus.bdev = device_add_child(dev, "usbus", -1); - if (!(sc->sc_bus.bdev)) { + if (sc->sc_bus.bdev == NULL) goto error; - } + device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, Modified: head/sys/dev/usb/controller/saf1761_otg_reg.h ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg_reg.h Wed May 28 15:24:30 2014 (r266811) +++ head/sys/dev/usb/controller/saf1761_otg_reg.h Wed May 28 16:28:22 2014 (r266812) @@ -84,7 +84,7 @@ #define SOTG_TIMER_HIGH_SET_CLR 0x38C #define SOTG_TIMER_HIGH_SET(x) ((x) & 0xFFFF) #define SOTG_TIMER_HIGH_CLR(x) (((x) << 16) & 0xFFFF0000) -#define SOTG_TIMER_START_TMR (1U << 15) +#define SOTG_TIMER_HIGH_START (1U << 15) #define SOTG_MEMORY_REG 0x33c /* Peripheral controller specific registers */ @@ -102,9 +102,9 @@ #define SOTG_MODE_WKUPCS (1 << 2) #define SOTG_INTERRUPT_CFG 0x210 #define SOTG_INTERRUPT_CFG_DEBUG_SET (1 << 16) -#define SOTG_INTERRUPT_CFG_CDBGMOD (3 << 6) -#define SOTG_INTERRUPT_CFG_DDBGMODIN (3 << 4) -#define SOTG_INTERRUPT_CFG_DDBGMODOUT (3 << 2) +#define SOTG_INTERRUPT_CFG_CDBGMOD (1 << 6) /* ACK only */ +#define SOTG_INTERRUPT_CFG_DDBGMODIN (1 << 4) /* ACK only */ +#define SOTG_INTERRUPT_CFG_DDBGMODOUT (1 << 2) /* ACK and NYET only */ #define SOTG_INTERRUPT_CFG_INTLVL (1 << 1) #define SOTG_INTERRUPT_CFG_INTPOL (1 << 0) #define SOTG_DCINTERRUPT_EN 0x214 @@ -201,11 +201,15 @@ #define SOTG_PTD_DW1 4 #define SOTG_PTD_DW1_ENABLE_SPLIT (1 << 14) #define SOTG_PTD_DW2 8 +#define SOTG_PTD_DW2_RL (0xf << 25) #define SOTG_PTD_DW3 12 +#define SOTG_PTD_DW3_NRL (0xf << 19) #define SOTG_PTD_DW3_ACTIVE (1U << 31) #define SOTG_PTD_DW3_HALTED (1U << 30) #define SOTG_PTD_DW3_ERRORS (3U << 28) -#define SOTG_PTD_DW3_CERR (3U << 23) +#define SOTG_PTD_DW3_CERR_3 (3U << 23) +#define SOTG_PTD_DW3_CERR_2 (2U << 23) /* infinite NAKs */ +#define SOTG_PTD_DW3_CERR_1 (1U << 23) #define SOTG_PTD_DW3_XFER_COUNT 0x7FFF #define SOTG_PTD_DW4 16 #define SOTG_PTD_DW5 20 @@ -245,15 +249,24 @@ #define SOTG_HCINTERRUPT_DMAEOTINT (1 << 3) #define SOTG_HCINTERRUPT_SOFITLINT (1 << 1) #define SOTG_HCINTERRUPT_ENABLE 0x314 +#define SOTG_ATL_PTD_DONE_PTD 0x150 #define SOTG_ATL_PTD_SKIP_PTD 0x154 #define SOTG_ATL_PTD_LAST_PTD 0x158 +#define SOTG_INT_PTD_DONE_PTD 0x140 #define SOTG_INT_PTD_SKIP_PTD 0x144 #define SOTG_INT_PTD_LAST_PTD 0x148 +#define SOTG_ISO_PTD_DONE_PTD 0x130 #define SOTG_ISO_PTD_SKIP_PTD 0x134 #define SOTG_ISO_PTD_LAST_PTD 0x138 #define SOTG_HCBUFFERSTATUS 0x334 #define SOTG_HCBUFFERSTATUS_ISO_BUF_FILL (1 << 2) #define SOTG_HCBUFFERSTATUS_INT_BUF_FILL (1 << 1) #define SOTG_HCBUFFERSTATUS_ATL_BUF_FILL (1 << 0) +#define SOTG_ISO_IRQ_MASK_OR 0x318 +#define SOTG_INT_IRQ_MASK_OR 0x31C +#define SOTG_ATL_IRQ_MASK_OR 0x320 +#define SOTG_ISO_IRQ_MASK_AND 0x324 +#define SOTG_INT_IRQ_MASK_AND 0x328 +#define SOTG_ATL_IRQ_MASK_AND 0x32C #endif /* _SAF1761_OTG_REG_H_ */ From owner-svn-src-head@FreeBSD.ORG Wed May 28 16:46:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 400F8FB4; Wed, 28 May 2014 16:46:11 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id B18662B24; Wed, 28 May 2014 16:46:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 10EDD3804C; Wed, 28 May 2014 11:46:04 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id X0lon_D8Wm5C; Wed, 28 May 2014 11:46:04 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id F0D0838046; Wed, 28 May 2014 11:46:02 -0500 (CDT) Message-ID: <538612C9.4090508@freebsd.org> Date: Wed, 28 May 2014 09:46:01 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Konstantin Belousov , Warner Losh Subject: Re: svn commit: r266553 - head/release/scripts References: <20140527001811.3e9d3e8d@kalimero.tijl.coosemans.org> <05D1A11D-5985-42EA-84AD-209A8B51D391@bsdimp.com> <20140527093633.0a922e13@kalimero.tijl.coosemans.org> <85FABD2B-81BB-4E1A-B61E-4216A144A9DB@bsdimp.com> <20140527214038.17d00369@kalimero.tijl.coosemans.org> <13EB325C-3882-46AA-9B17-3BF19997C978@bsdimp.com> <20140528125027.6d0cc4fb@kalimero.tijl.coosemans.org> <5E038619-5921-4B7A-A4EE-D1E83614934B@bsdimp.com> <20140528152820.GA3991@kib.kiev.ua> <20140528154728.GB3991@kib.kiev.ua> In-Reply-To: <20140528154728.GB3991@kib.kiev.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , svn-src-head@freebsd.org, Tijl Coosemans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 16:46:11 -0000 On 05/28/14 08:47, Konstantin Belousov wrote: > On Wed, May 28, 2014 at 09:35:27AM -0600, Warner Losh wrote: >> On May 28, 2014, at 9:28 AM, Konstantin Belousov wrote: >> >>> On Wed, May 28, 2014 at 08:26:58AM -0600, Warner Losh wrote: >>>> Then we disagree on this point. However, the disagreement here is >>>> kinda foundational: to build a set of libraries or sys root, you have >>>> to have a MACHINE_ARCH to make it work. Even in our current system, we >>>> set MACHINE_ARCH to i386 or powerpc when building the 32-bit binaries >>>> (note: we don?t do this for mips). This means that if we do grow x32 >>>> support, we?ll need to grow a MACHINE_ARCH for it. That?s my point: >>>> all ABIs have MACHINE_ARCH associated with them, and those are the >>>> names users are used to specifying, and are the ones that are the most >>>> natural for script writers to use. With nathan?s patches, we?re to the >>>> point where those are used, though there?s also the option of using >>>> the non-standard names if you want (e.g. amd64:32 instead of x32). >>>> >>> I am not sure if this comment would add anything to the discussion, >>> but other build systems do not require MACHINE_ARCH. In our terms, >>> other build systems are happy to build: >>> i386 binary when MACHINE is amd64 and CFLAGS contains -m32; >>> x32 binary when MACHINE is amd64 and CFLAGS contains -mx32. >>> >>> For HEAD and stable/10 we finally reached the point where -m32 works, >>> on amd64; it worked on powerpc64 from inception, AFAIU Nathan. At least >>> this is true for dependencies limited to the base system, and not to the >>> ports (the later is since ports do not know about multiarch). >>> >>> It is limitation of our build that we require MACHINE_ARCH to build >>> other natively supported ABI binary on the host. Ideally, the hacks that >>> treat lib32 build as the cross-compilation would go away eventually. >> I doubt it. The MACHINE_ARCH is used to select which files to build. > Do I understand you right that the comment references e.g. a selection > of arch-specific subdir in lib/libc or libexec/rtld-elf for inclusion > into the build ? If yes, I cannot disagree with the statement. > > My note was about our build system which currently requires > full-fledged cross-build to even create i386 binary on amd64 vs. other > builds which consider this as a (often minor) variations of the host > target. Sure, some variances must be allowed, e.g. to select proper .S > file for the ABI, but we do not need cross-build to get i386 on amd64. Does it actually do that? "Full cross-build" implies it builds a new compiler, at least to me, but it just builds with -m32 and changes MACHINE_ARCH. In any case, I think we have gotten lots of issues crossed here. I'll try to separate them out: 1. We will not ever have mixed-and-matched x32 and amd64 packages on one system without a massive overhaul of ports, since you can't link x32 binaries against amd64 libraries and vice versa. Handling that requires more dependency tracking and, at a minimum, something like /usr/local/lib-$MACHINE_ARCH. Maybe that's worth doing -- I don't know -- but it is very different from -fPIC and is an orthogonal discussion. 2. PowerPC is, as you note, arguably the most integrated 32/64-bit port we have, since it was originally specified as a 64-bit instruction set. 32-bit PowerPC is much more analogous to something like x32 than to i386. And it still has a different MACHINE_ARCH, needs a different C library and RTLD (and not through #ifdef!), etc. 3. The whole discussion was originally about what we call packages. Do we use the same arbitray names that the base system and ports use, or do we use different arbitrary names? That I think has been resolved. I suspect the actual patches got lost in this very long thread, so I'll forward them to freebsd-ports@ shortly. -Nathan From owner-svn-src-head@FreeBSD.ORG Wed May 28 16:50:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A5172B2; Wed, 28 May 2014 16:50:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48C982B57; Wed, 28 May 2014 16:50:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4SGoJYq055743; Wed, 28 May 2014 16:50:19 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4SGoJiB055742; Wed, 28 May 2014 16:50:19 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201405281650.s4SGoJiB055742@svn.freebsd.org> From: Hajimu UMEMOTO Date: Wed, 28 May 2014 16:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266813 - head/lib/libcrypt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 16:50:19 -0000 Author: ume Date: Wed May 28 16:50:18 2014 New Revision: 266813 URL: http://svnweb.freebsd.org/changeset/base/266813 Log: Don't break the legacy applications which set just 2 bytes to salt. MFC after: 1 week Modified: head/lib/libcrypt/crypt.c Modified: head/lib/libcrypt/crypt.c ============================================================================== --- head/lib/libcrypt/crypt.c Wed May 28 16:28:22 2014 (r266812) +++ head/lib/libcrypt/crypt.c Wed May 28 16:50:18 2014 (r266813) @@ -104,12 +104,16 @@ char * crypt(const char *passwd, const char *salt) { const struct crypt_format *cf; +#ifdef HAS_DES + int len; +#endif for (cf = crypt_formats; cf->name != NULL; ++cf) if (cf->magic != NULL && strstr(salt, cf->magic) == salt) return (cf->func(passwd, salt)); #ifdef HAS_DES - if (strlen(salt) == 13 && strspn(salt, DES_SALT_ALPHABET) == 13) + len = strlen(salt); + if ((len == 13 || len == 2) && strspn(salt, DES_SALT_ALPHABET) == len) return (crypt_des(passwd, salt)); #endif return (crypt_format->func(passwd, salt)); From owner-svn-src-head@FreeBSD.ORG Wed May 28 16:57:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9E29544; Wed, 28 May 2014 16:57:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C79652C2E; Wed, 28 May 2014 16:57:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4SGvHfb059642; Wed, 28 May 2014 16:57:17 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4SGvHDo059641; Wed, 28 May 2014 16:57:17 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201405281657.s4SGvHDo059641@svn.freebsd.org> From: Don Lewis Date: Wed, 28 May 2014 16:57:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266814 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 16:57:17 -0000 Author: truckman Date: Wed May 28 16:57:17 2014 New Revision: 266814 URL: http://svnweb.freebsd.org/changeset/base/266814 Log: Initialize r_flags the same way in all cases using a sanitized copy of flags that has several bits cleared. The RF_WANTED and RF_FIRSTSHARE bits are invalid in this context, and we want to defer setting RF_ACTIVE in r_flags until later. This should make rman_get_flags() return the correct answer in all cases. Add a KASSERT() to catch callers which incorrectly pass the RF_WANTED or RF_FIRSTSHARE flags. Do a strict equality check on the share type bits of flags. In particular, do an equality check on RF_PREFETCHABLE. The previous code would allow one type of mismatch of RF_PREFETCHABLE but disallow the other type of mismatch. Also, ignore the the RF_ALIGNMENT_MASK bits since alignment validity should be handled by the amask check. This field contains an integer value, but previous code did a strange bitwise comparison on it. Leave the original value of flags unmolested as a minor debug aid. Change the start+amask overflow check to a KASSERT() since it is just meant to catch a highly unlikely programming error in the caller. Reviewed by: jhb MFC after: 1 month Modified: head/sys/kern/subr_rman.c Modified: head/sys/kern/subr_rman.c ============================================================================== --- head/sys/kern/subr_rman.c Wed May 28 16:50:18 2014 (r266813) +++ head/sys/kern/subr_rman.c Wed May 28 16:57:17 2014 (r266814) @@ -435,12 +435,14 @@ rman_adjust_resource(struct resource *rr return (0); } +#define SHARE_TYPE(f) (f & (RF_SHAREABLE | RF_TIMESHARE | RF_PREFETCHABLE)) + struct resource * rman_reserve_resource_bound(struct rman *rm, u_long start, u_long end, u_long count, u_long bound, u_int flags, struct device *dev) { - u_int want_activate; + u_int new_rflags; struct resource_i *r, *s, *rv; u_long rstart, rend, amask, bmask; @@ -450,8 +452,10 @@ rman_reserve_resource_bound(struct rman "length %#lx, flags %u, device %s\n", rm->rm_descr, start, end, count, flags, dev == NULL ? "" : device_get_nameunit(dev))); - want_activate = (flags & RF_ACTIVE); - flags &= ~RF_ACTIVE; + KASSERT((flags & (RF_WANTED | RF_FIRSTSHARE)) == 0, + ("invalid flags %#x", flags)); + new_rflags = (flags & ~(RF_ACTIVE | RF_WANTED | RF_FIRSTSHARE)) | + RF_ALLOCATED; mtx_lock(rm->rm_mtx); @@ -466,10 +470,8 @@ rman_reserve_resource_bound(struct rman } amask = (1ul << RF_ALIGNMENT(flags)) - 1; - if (start > ULONG_MAX - amask) { - DPRINTF(("start+amask would wrap around\n")); - goto out; - } + KASSERT(start <= ULONG_MAX - amask, + ("start (%#lx) + amask (%#lx) would wrap around", start, amask)); /* If bound is 0, bmask will also be 0 */ bmask = ~(bound - 1); @@ -522,7 +524,7 @@ rman_reserve_resource_bound(struct rman if ((s->r_end - s->r_start + 1) == count) { DPRINTF(("candidate region is entire chunk\n")); rv = s; - rv->r_flags |= RF_ALLOCATED | flags; + rv->r_flags = new_rflags; rv->r_dev = dev; goto out; } @@ -542,7 +544,7 @@ rman_reserve_resource_bound(struct rman goto out; rv->r_start = rstart; rv->r_end = rstart + count - 1; - rv->r_flags = flags | RF_ALLOCATED; + rv->r_flags = new_rflags; rv->r_dev = dev; rv->r_rm = rm; @@ -603,7 +605,7 @@ rman_reserve_resource_bound(struct rman goto out; for (s = r; s && s->r_end <= end; s = TAILQ_NEXT(s, r_link)) { - if ((s->r_flags & flags) == flags && + if (SHARE_TYPE(s->r_flags) == SHARE_TYPE(flags) && s->r_start >= start && (s->r_end - s->r_start + 1) == count && (s->r_start & amask) == 0 && @@ -613,8 +615,7 @@ rman_reserve_resource_bound(struct rman goto out; rv->r_start = s->r_start; rv->r_end = s->r_end; - rv->r_flags = s->r_flags & - (RF_ALLOCATED | RF_SHAREABLE | RF_TIMESHARE); + rv->r_flags = new_rflags; rv->r_dev = dev; rv->r_rm = rm; if (s->r_sharehead == NULL) { @@ -641,13 +642,12 @@ rman_reserve_resource_bound(struct rman */ out: /* - * If the user specified RF_ACTIVE in the initial flags, - * which is reflected in `want_activate', we attempt to atomically + * If the user specified RF_ACTIVE in flags, we attempt to atomically * activate the resource. If this fails, we release the resource * and indicate overall failure. (This behavior probably doesn't * make sense for RF_TIMESHARE-type resources.) */ - if (rv && want_activate) { + if (rv && (flags & RF_ACTIVE) != 0) { struct resource_i *whohas; if (int_rman_activate_resource(rm, rv, &whohas)) { int_rman_release_resource(rm, rv); From owner-svn-src-head@FreeBSD.ORG Wed May 28 19:52:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6841D33A; Wed, 28 May 2014 19:52:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55FAB2F03; Wed, 28 May 2014 19:52:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4SJq2c0037874; Wed, 28 May 2014 19:52:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4SJq2Ha037873; Wed, 28 May 2014 19:52:02 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405281952.s4SJq2Ha037873@svn.freebsd.org> From: John Baldwin Date: Wed, 28 May 2014 19:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266819 - head/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 19:52:02 -0000 Author: jhb Date: Wed May 28 19:52:01 2014 New Revision: 266819 URL: http://svnweb.freebsd.org/changeset/base/266819 Log: Add a temporary hack to change the various non-build related special targets like 'cscope' and 'glimpse' to not depend on src.opts.mk or bsd.*.mk. Reviewed by: imp Modified: head/sys/Makefile Modified: head/sys/Makefile ============================================================================== --- head/sys/Makefile Wed May 28 19:05:46 2014 (r266818) +++ head/sys/Makefile Wed May 28 19:52:01 2014 (r266819) @@ -1,11 +1,14 @@ # $FreeBSD$ +.if !(make(cscope) || make(cscope-clean) || make(cscope-hook) || make(TAGS) || \ + make(glimpse) || make(glimpse-clean)) .include # The boot loader .if ${MK_BOOT} != "no" SUBDIR= boot .endif +.endif # Directories to include in cscope name file and TAGS. CSCOPEDIRS= boot bsm cam cddl compat conf contrib crypto ddb dev fs gdb \ From owner-svn-src-head@FreeBSD.ORG Wed May 28 19:53:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3541E4B4 for ; Wed, 28 May 2014 19:53:13 +0000 (UTC) Received: from mail-pb0-f41.google.com (mail-pb0-f41.google.com [209.85.160.41]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF9542F27 for ; Wed, 28 May 2014 19:53:12 +0000 (UTC) Received: by mail-pb0-f41.google.com with SMTP id uo5so11800770pbc.0 for ; Wed, 28 May 2014 12:53:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=Wi5hCiniQVTVw/MB4VwE3Ry5L6Ltyb4BoBkURxL10SQ=; b=c8D2AzDOF+ocSVxnyZ9MzkLn5Hkxn+ou3rS9gU+BZvS4REvpbU8qrcRqKk0WK/V/F8 gfhGtfR1f7pW1d8H+PHoj/OL1XM1OguAy2bfS3Mn/QUkCgY834o+rivPh1UIiJ/clh5q Fu098/63/fQJb05nYq7htOgqux08XcHHqJY1/naIm/Kw8pq4nwr6pb1+VmA8d0poHK9Q eh/xMs7liNRgPEHyyE+i7M1rheF2AT3jhl4K2fV5XIwS8m2XWRy6opGx9mnyNauru/MG N8bKdlBzx3g848jN8F7js2XVw3SKZUFv3N0Ns1byGyGhrTZ5VKPfqXNOzf11Ehidi8IT pp9A== X-Gm-Message-State: ALoCoQnjngogMdAOv0REI6Q01Z/DrbajsfxItSO+QUZP29ZlsKkycVkheeQj1ar1KY8qlrkWVjZ6 X-Received: by 10.66.136.103 with SMTP id pz7mr2420994pab.140.1401306792519; Wed, 28 May 2014 12:53:12 -0700 (PDT) Received: from lgmac-rtangirala.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id pu5sm9668346pbb.4.2014.05.28.12.53.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 May 2014 12:53:11 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_1E75C19A-0256-4135-A188-9FA601093413"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266553 - head/release/scripts From: Warner Losh In-Reply-To: <20140528154728.GB3991@kib.kiev.ua> Date: Wed, 28 May 2014 13:53:28 -0600 Message-Id: References: <20140527001811.3e9d3e8d@kalimero.tijl.coosemans.org> <05D1A11D-5985-42EA-84AD-209A8B51D391@bsdimp.com> <20140527093633.0a922e13@kalimero.tijl.coosemans.org> <85FABD2B-81BB-4E1A-B61E-4216A144A9DB@bsdimp.com> <20140527214038.17d00369@kalimero.tijl.coosemans.org> <13EB325C-3882-46AA-9B17-3BF19997C978@bsdimp.com> <20140528125027.6d0cc4fb@kalimero.tijl.coosemans.org> <5E038619-5921-4B7A-A4EE-D1E83614934B@bsdimp.com> <20140528152820.GA3991@kib.kiev.ua> <20140528154728.GB3991@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1878.2) Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , Nathan Whitehorn , svn-src-head@freebsd.org, Tijl Coosemans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 19:53:13 -0000 --Apple-Mail=_1E75C19A-0256-4135-A188-9FA601093413 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On May 28, 2014, at 9:47 AM, Konstantin Belousov = wrote: > On Wed, May 28, 2014 at 09:35:27AM -0600, Warner Losh wrote: >>=20 >> On May 28, 2014, at 9:28 AM, Konstantin Belousov = wrote: >>=20 >>> On Wed, May 28, 2014 at 08:26:58AM -0600, Warner Losh wrote: >>>>=20 >>>> Then we disagree on this point. However, the disagreement here is >>>> kinda foundational: to build a set of libraries or sys root, you = have >>>> to have a MACHINE_ARCH to make it work. Even in our current system, = we >>>> set MACHINE_ARCH to i386 or powerpc when building the 32-bit = binaries >>>> (note: we don?t do this for mips). This means that if we do grow = x32 >>>> support, we?ll need to grow a MACHINE_ARCH for it. That?s my point: >>>> all ABIs have MACHINE_ARCH associated with them, and those are the >>>> names users are used to specifying, and are the ones that are the = most >>>> natural for script writers to use. With nathan?s patches, we?re to = the >>>> point where those are used, though there?s also the option of using >>>> the non-standard names if you want (e.g. amd64:32 instead of x32). >>>>=20 >>>=20 >>> I am not sure if this comment would add anything to the discussion, >>> but other build systems do not require MACHINE_ARCH. In our terms, >>> other build systems are happy to build: >>> i386 binary when MACHINE is amd64 and CFLAGS contains -m32; >>> x32 binary when MACHINE is amd64 and CFLAGS contains -mx32. >>>=20 >>> For HEAD and stable/10 we finally reached the point where -m32 = works, >>> on amd64; it worked on powerpc64 from inception, AFAIU Nathan. At = least >>> this is true for dependencies limited to the base system, and not to = the >>> ports (the later is since ports do not know about multiarch). >>>=20 >>> It is limitation of our build that we require MACHINE_ARCH to build >>> other natively supported ABI binary on the host. Ideally, the hacks = that >>> treat lib32 build as the cross-compilation would go away eventually. >>=20 >> I doubt it. The MACHINE_ARCH is used to select which files to build. > Do I understand you right that the comment references e.g. a selection > of arch-specific subdir in lib/libc or libexec/rtld-elf for inclusion > into the build ? If yes, I cannot disagree with the statement. As far as I can tell, that=92s the only reason we=92re doing it.. But = it is a critically important reason... > My note was about our build system which currently requires > full-fledged cross-build to even create i386 binary on amd64 vs. other > builds which consider this as a (often minor) variations of the host > target. Sure, some variances must be allowed, e.g. to select proper .S > file for the ABI, but we do not need cross-build to get i386 on amd64. lib32 uses -m32 and some other flags to achieve its ends. So it doesn=92t = create a full i386 compiler, etc. It just uses the amd64 one with = special flags/args. So I don=92t think it requires a full-fledged = cross-build environment, or I misunderstand what you mean by that = phrase. But none of this changes the fact that we have a unique MACHINE_ARCH = value per ABI. Warner --Apple-Mail=_1E75C19A-0256-4135-A188-9FA601093413 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJThj64AAoJEGwc0Sh9sBEApb0P/1+mgH0iiabCS0q0cB0BD+2z 6h4loQ5ag61mpykbnPDQU7eHJ37Po4uQ2ZNTV5vuQxTK0bMWftPv5JJyt9Y38Otv LNwM7zm71paooQwB+GK0+1gMX3bruOaRQjdlefmBS1/cYa9dlxaiW7Sr0ILFoOBk QA5dBgafpppQb+6La5W5BU1mLFoZR4NeAJ19RJQTo0PE7vbIMT3h7r5vCVpLUFm1 JUdMmEhf696lgrulMz6XkYX0PamMsQgDuMNuJphKrw3iyMgMgvugcJfUi1Z/6tKg ffUyqBa0eiea909pBGHv4bUAeU2Px/YntDOxGa46S9vvoiyWXWkGXNOFaiQaUC8C gVnB/XU5VI1rc1DB7c8mUloILOJrydVQbLgn5CBMlE5Fsc1yY9T6hwoKg+cKH/lO F92caf7HO84SlllB71cL2iNi/k1Hj7ZH0a7IkbqmCOVKx4liAuTb/GMzH2H2Rsiy VK4Y/NImGhZMp7AH++lafvjdu/IB5bc0wlHxpELI3811YICPbZjiufYzvcg+khOx xY4zvXCKikR52IbZXNKpVSkMwwccUZobozC5paoa/QZQbpvjLjZeOohkwmTTI0T9 9GD+qwe1bWGUu64K8G3Q2fDFbXo6n4JMrKoTajn87FhYt8AfreFTA+k54NGE5Aat 3+9QZs1NkD3ALrIYF6IN =6z+u -----END PGP SIGNATURE----- --Apple-Mail=_1E75C19A-0256-4135-A188-9FA601093413-- From owner-svn-src-head@FreeBSD.ORG Wed May 28 19:58:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45E127E8; Wed, 28 May 2014 19:58:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 335CE2F7A; Wed, 28 May 2014 19:58:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4SJw1S6038787; Wed, 28 May 2014 19:58:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4SJw1FX038786; Wed, 28 May 2014 19:58:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201405281958.s4SJw1FX038786@svn.freebsd.org> From: Marius Strobl Date: Wed, 28 May 2014 19:58:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266820 - head/sys/i386/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 19:58:01 -0000 Author: marius Date: Wed May 28 19:58:00 2014 New Revision: 266820 URL: http://svnweb.freebsd.org/changeset/base/266820 Log: - Shrink the list of excluded modules to what actually still doesn't build as of r266799. - Some style cleanups. MFC after: 1 week Modified: head/sys/i386/conf/XEN Modified: head/sys/i386/conf/XEN ============================================================================== --- head/sys/i386/conf/XEN Wed May 28 19:52:01 2014 (r266819) +++ head/sys/i386/conf/XEN Wed May 28 19:58:00 2014 (r266820) @@ -7,11 +7,12 @@ cpu I686_CPU ident XEN makeoptions DEBUG=-g -makeoptions WITHOUT_MODULES="aha ahb amd ctl cxgb dpt drm drm2 hptnr hptmv ida malo mpr mps mwl rdma sound sym trm xfs" + +# The following modules don't build with PAE and XEN enabled. +makeoptions WITHOUT_MODULES="ctl dpt drm drm2 hptmv ida malo mwl" options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption -#options SCHED_4BSD options INET # InterNETworking options INET6 # IPv6 communications protocols @@ -65,7 +66,6 @@ options MCLSHIFT=12 options SMP # Symmetric MultiProcessor Kernel device apic # I/O APIC - #device atkbdc # AT keyboard controller #device atkbd # AT keyboard device psm # PS/2 mouse @@ -90,4 +90,3 @@ options AH_SUPPORT_AR5416 # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. device bpf # Berkeley packet filter - From owner-svn-src-head@FreeBSD.ORG Wed May 28 19:59:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1117B96B; Wed, 28 May 2014 19:59:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F29772F98; Wed, 28 May 2014 19:59:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4SJxRgc039009; Wed, 28 May 2014 19:59:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4SJxRZb039008; Wed, 28 May 2014 19:59:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201405281959.s4SJxRZb039008@svn.freebsd.org> From: Marius Strobl Date: Wed, 28 May 2014 19:59:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266821 - head/sys/i386/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 19:59:28 -0000 Author: marius Date: Wed May 28 19:59:27 2014 New Revision: 266821 URL: http://svnweb.freebsd.org/changeset/base/266821 Log: - Actually, modules are built correctly when compiled along the kernel as they then pick up an opt_global.h from KERNBUILDDIR having PAE defined. Thus, build all modules by default except those which still really are defective as of r266799. - Minor style cleanup. MFC after: 1 week Modified: head/sys/i386/conf/PAE Modified: head/sys/i386/conf/PAE ============================================================================== --- head/sys/i386/conf/PAE Wed May 28 19:58:00 2014 (r266820) +++ head/sys/i386/conf/PAE Wed May 28 19:59:27 2014 (r266821) @@ -10,12 +10,8 @@ ident PAE-GENERIC # To make a PAE kernel, the next option is needed options PAE # Physical Address Extensions Kernel -# Don't build modules with this kernel config, since they are not built with -# the correct options headers. -makeoptions NO_MODULES=yes - -# force isp firmware to fully loaded -device ispfw +# The following modules don't build with PAE enabled. +makeoptions WITHOUT_MODULES="ctl dpt hptmv ida malo mwl" # What follows is a list of drivers that are normally in GENERIC, but either # don't work or are untested with PAE. Be very careful before enabling any @@ -23,7 +19,6 @@ device ispfw # address properly may cause data corruption when used in a machine with more # than 4 gigabytes of memory. - nodevice ahb nodevice sym nodevice trm From owner-svn-src-head@FreeBSD.ORG Wed May 28 23:01:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB418BBE; Wed, 28 May 2014 23:01:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A76832F6D; Wed, 28 May 2014 23:01:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4SN1KJ6020804; Wed, 28 May 2014 23:01:20 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4SN1Kcv020803; Wed, 28 May 2014 23:01:20 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201405282301.s4SN1Kcv020803@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 28 May 2014 23:01:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266822 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 23:01:20 -0000 Author: bz Date: Wed May 28 23:01:20 2014 New Revision: 266822 URL: http://svnweb.freebsd.org/changeset/base/266822 Log: Use IPv4 statistics in ipsec4_process_packet() rather than the IPv6 version. This also unbreaks the NOINET6 builds after r266800. Modified: head/sys/netipsec/ipsec_output.c Modified: head/sys/netipsec/ipsec_output.c ============================================================================== --- head/sys/netipsec/ipsec_output.c Wed May 28 19:59:27 2014 (r266821) +++ head/sys/netipsec/ipsec_output.c Wed May 28 23:01:20 2014 (r266822) @@ -576,7 +576,7 @@ ipsec4_process_packet( DPRINTF(("%s: unsupported protocol family %u\n", __func__, dst->sa.sa_family)); error = EPFNOSUPPORT; - IPSEC6STAT_INC(ips_out_inval); + IPSECSTAT_INC(ips_out_inval); goto bad; } error = (*sav->tdb_xform->xf_output)(m, isr, NULL, i, off); @@ -739,4 +739,4 @@ bad: m_freem(m); return error; } -#endif /*INET6*/ \ No newline at end of file +#endif /*INET6*/ From owner-svn-src-head@FreeBSD.ORG Thu May 29 01:41:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02A6B51F; Thu, 29 May 2014 01:41:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E47412B35; Thu, 29 May 2014 01:41:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4T1fJRh091370; Thu, 29 May 2014 01:41:19 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4T1fJfQ091369; Thu, 29 May 2014 01:41:19 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405290141.s4T1fJfQ091369@svn.freebsd.org> From: Mark Johnston Date: Thu, 29 May 2014 01:41:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266826 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 01:41:20 -0000 Author: markj Date: Thu May 29 01:41:19 2014 New Revision: 266826 URL: http://svnweb.freebsd.org/changeset/base/266826 Log: Move some duplicated hook definitions from machine-dependent files to kern_dtrace.c. Reviewed by: rpaulo MFC after: 1 week Modified: head/sys/sys/dtrace_bsd.h Modified: head/sys/sys/dtrace_bsd.h ============================================================================== --- head/sys/sys/dtrace_bsd.h Thu May 29 01:01:54 2014 (r266825) +++ head/sys/sys/dtrace_bsd.h Thu May 29 01:41:19 2014 (r266826) @@ -59,10 +59,12 @@ int dtrace_trap(struct trapframe *, u_in extern dtrace_trap_func_t dtrace_trap_func; -/* Used by the machine dependent trap() code. */ +/* + * A hook which removes active FBT probes before executing the double fault + * handler. We want to ensure that DTrace doesn't trigger another trap, which + * would result in a reset. + */ typedef void (*dtrace_doubletrap_func_t)(void); - -/* Global variables in trap.c */ extern dtrace_doubletrap_func_t dtrace_doubletrap_func; /* Pid provider hooks */ From owner-svn-src-head@FreeBSD.ORG Thu May 29 01:42:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A742669; Thu, 29 May 2014 01:42:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B27B2B3E; Thu, 29 May 2014 01:42:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4T1gNlk091920; Thu, 29 May 2014 01:42:23 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4T1gNID091914; Thu, 29 May 2014 01:42:23 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201405290142.s4T1gNID091914@svn.freebsd.org> From: Mark Johnston Date: Thu, 29 May 2014 01:42:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266827 - in head/sys: amd64/amd64 i386/i386 kern mips/mips powerpc/aim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 01:42:24 -0000 Author: markj Date: Thu May 29 01:42:22 2014 New Revision: 266827 URL: http://svnweb.freebsd.org/changeset/base/266827 Log: Commit the rest of the changes that were intended to be part of r266826. X-MFC-with: r266826 Modified: head/sys/amd64/amd64/trap.c head/sys/i386/i386/trap.c head/sys/kern/kern_dtrace.c head/sys/mips/mips/trap.c head/sys/powerpc/aim/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Thu May 29 01:41:19 2014 (r266826) +++ head/sys/amd64/amd64/trap.c Thu May 29 01:42:22 2014 (r266827) @@ -95,28 +95,6 @@ PMC_SOFT_DEFINE( , , page_fault, write); #ifdef KDTRACE_HOOKS #include - -/* - * This is a hook which is initialised by the dtrace module - * to handle traps which might occur during DTrace probe - * execution. - */ -dtrace_trap_func_t dtrace_trap_func; - -dtrace_doubletrap_func_t dtrace_doubletrap_func; - -/* - * This is a hook which is initialised by the systrace module - * when it is loaded. This keeps the DTrace syscall provider - * implementation opaque. - */ -systrace_probe_func_t systrace_probe_func; - -/* - * These hooks are necessary for the pid and usdt providers. - */ -dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; -dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif extern void trap(struct trapframe *frame); Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Thu May 29 01:41:19 2014 (r266826) +++ head/sys/i386/i386/trap.c Thu May 29 01:42:22 2014 (r266827) @@ -104,28 +104,6 @@ PMC_SOFT_DEFINE( , , page_fault, write); #ifdef KDTRACE_HOOKS #include - -/* - * This is a hook which is initialised by the dtrace module - * to handle traps which might occur during DTrace probe - * execution. - */ -dtrace_trap_func_t dtrace_trap_func; - -dtrace_doubletrap_func_t dtrace_doubletrap_func; - -/* - * This is a hook which is initialised by the systrace module - * when it is loaded. This keeps the DTrace syscall provider - * implementation opaque. - */ -systrace_probe_func_t systrace_probe_func; - -/* - * These hooks are necessary for the pid and usdt providers. - */ -dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; -dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif extern void trap(struct trapframe *frame); Modified: head/sys/kern/kern_dtrace.c ============================================================================== --- head/sys/kern/kern_dtrace.c Thu May 29 01:41:19 2014 (r266826) +++ head/sys/kern/kern_dtrace.c Thu May 29 01:42:22 2014 (r266827) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define KDTRACE_PROC_SIZE 64 #define KDTRACE_THREAD_SIZE 256 @@ -47,6 +48,14 @@ FEATURE(kdtrace_hooks, static MALLOC_DEFINE(M_KDTRACE, "kdtrace", "DTrace hooks"); +/* Hooks used in the machine-dependent trap handlers. */ +dtrace_trap_func_t dtrace_trap_func; +dtrace_doubletrap_func_t dtrace_doubletrap_func; +dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; +dtrace_return_probe_ptr_t dtrace_return_probe_ptr; + +systrace_probe_func_t systrace_probe_func; + /* Return the DTrace process data size compiled in the kernel hooks. */ size_t kdtrace_proc_size() Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Thu May 29 01:41:19 2014 (r266826) +++ head/sys/mips/mips/trap.c Thu May 29 01:42:22 2014 (r266827) @@ -93,28 +93,6 @@ __FBSDID("$FreeBSD$"); #ifdef KDTRACE_HOOKS #include - -/* - * This is a hook which is initialised by the dtrace module - * to handle traps which might occur during DTrace probe - * execution. - */ -dtrace_trap_func_t dtrace_trap_func; - -dtrace_doubletrap_func_t dtrace_doubletrap_func; - -/* - * This is a hook which is initialised by the systrace module - * when it is loaded. This keeps the DTrace syscall provider - * implementation opaque. - */ -systrace_probe_func_t systrace_probe_func; - -/* - * These hooks are necessary for the pid and usdt providers. - */ -dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; -dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif #ifdef TRAP_DEBUG Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Thu May 29 01:41:19 2014 (r266826) +++ head/sys/powerpc/aim/trap.c Thu May 29 01:42:22 2014 (r266827) @@ -95,27 +95,6 @@ struct powerpc_exception { #ifdef KDTRACE_HOOKS #include -/* - * This is a hook which is initialised by the dtrace module - * to handle traps which might occur during DTrace probe - * execution. - */ -dtrace_trap_func_t dtrace_trap_func; - -dtrace_doubletrap_func_t dtrace_doubletrap_func; - -/* - * This is a hook which is initialised by the systrace module - * when it is loaded. This keeps the DTrace syscall provider - * implementation opaque. - */ -systrace_probe_func_t systrace_probe_func; - -/* - * These hooks are necessary for the pid and usdt providers. - */ -dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; -dtrace_return_probe_ptr_t dtrace_return_probe_ptr; int (*dtrace_invop_jump_addr)(struct trapframe *); #endif From owner-svn-src-head@FreeBSD.ORG Thu May 29 01:53:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E8809F1; Thu, 29 May 2014 01:53:36 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D3AF2C13; Thu, 29 May 2014 01:53:36 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s4T1rVcA046705; Thu, 29 May 2014 04:53:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s4T1rVcA046705 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.8/Submit) id s4T1rU1X046704; Thu, 29 May 2014 04:53:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 29 May 2014 04:53:30 +0300 From: Konstantin Belousov To: Warner Losh Subject: Re: svn commit: r266553 - head/release/scripts Message-ID: <20140529015330.GG3991@kib.kiev.ua> References: <20140527093633.0a922e13@kalimero.tijl.coosemans.org> <85FABD2B-81BB-4E1A-B61E-4216A144A9DB@bsdimp.com> <20140527214038.17d00369@kalimero.tijl.coosemans.org> <13EB325C-3882-46AA-9B17-3BF19997C978@bsdimp.com> <20140528125027.6d0cc4fb@kalimero.tijl.coosemans.org> <5E038619-5921-4B7A-A4EE-D1E83614934B@bsdimp.com> <20140528152820.GA3991@kib.kiev.ua> <20140528154728.GB3991@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PpAOPzA3dXsRhoo+" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , Nathan Whitehorn , svn-src-head@freebsd.org, Tijl Coosemans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 01:53:36 -0000 --PpAOPzA3dXsRhoo+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 28, 2014 at 01:53:28PM -0600, Warner Losh wrote: >=20 > On May 28, 2014, at 9:47 AM, Konstantin Belousov wr= ote: >=20 > > On Wed, May 28, 2014 at 09:35:27AM -0600, Warner Losh wrote: > >>=20 > >> On May 28, 2014, at 9:28 AM, Konstantin Belousov = wrote: > >>=20 > >>> On Wed, May 28, 2014 at 08:26:58AM -0600, Warner Losh wrote: > >>>>=20 > >>>> Then we disagree on this point. However, the disagreement here is > >>>> kinda foundational: to build a set of libraries or sys root, you have > >>>> to have a MACHINE_ARCH to make it work. Even in our current system, = we > >>>> set MACHINE_ARCH to i386 or powerpc when building the 32-bit binaries > >>>> (note: we don?t do this for mips). This means that if we do grow x32 > >>>> support, we?ll need to grow a MACHINE_ARCH for it. That?s my point: > >>>> all ABIs have MACHINE_ARCH associated with them, and those are the > >>>> names users are used to specifying, and are the ones that are the mo= st > >>>> natural for script writers to use. With nathan?s patches, we?re to t= he > >>>> point where those are used, though there?s also the option of using > >>>> the non-standard names if you want (e.g. amd64:32 instead of x32). > >>>>=20 > >>>=20 > >>> I am not sure if this comment would add anything to the discussion, > >>> but other build systems do not require MACHINE_ARCH. In our terms, > >>> other build systems are happy to build: > >>> i386 binary when MACHINE is amd64 and CFLAGS contains -m32; > >>> x32 binary when MACHINE is amd64 and CFLAGS contains -mx32. > >>>=20 > >>> For HEAD and stable/10 we finally reached the point where -m32 works, > >>> on amd64; it worked on powerpc64 from inception, AFAIU Nathan. At lea= st > >>> this is true for dependencies limited to the base system, and not to = the > >>> ports (the later is since ports do not know about multiarch). > >>>=20 > >>> It is limitation of our build that we require MACHINE_ARCH to build > >>> other natively supported ABI binary on the host. Ideally, the hacks t= hat > >>> treat lib32 build as the cross-compilation would go away eventually. > >>=20 > >> I doubt it. The MACHINE_ARCH is used to select which files to build. > > Do I understand you right that the comment references e.g. a selection > > of arch-specific subdir in lib/libc or libexec/rtld-elf for inclusion > > into the build ? If yes, I cannot disagree with the statement. >=20 > As far as I can tell, that?s the only reason we?re doing it.. But it is = a critically important reason... >=20 > > My note was about our build system which currently requires > > full-fledged cross-build to even create i386 binary on amd64 vs. other > > builds which consider this as a (often minor) variations of the host > > target. Sure, some variances must be allowed, e.g. to select proper .S > > file for the ABI, but we do not need cross-build to get i386 on amd64. >=20 > lib32 uses -m32 and some other flags to achieve its ends. So it doesn?t c= reate a full i386 compiler, etc. It just uses the amd64 one with special fl= ags/args. So I don?t think it requires a full-fledged cross-build environme= nt, or I misunderstand what you mean by that phrase. We install the headers for the MACHINE_ARCH into the compat32 build tree, and use them instead of the target MACHINE headers. The fact that -m32 works as the cross-compiler just saves the build time. >=20 > But none of this changes the fact that we have a unique MACHINE_ARCH valu= e per ABI. >=20 > Warner --PpAOPzA3dXsRhoo+ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJThpMaAAoJEJDCuSvBvK1Bi+4P/jdQaU0MKqPlnvqsw4gIo7Cl 3t7UAhdstmhdXCVmxExkAC3jt/4bxo/DJgf9LTTB3KIuOvTk3oas5SmfKGPcObl2 230+zoTAsAtAFFDLDwcOkpHMS7CGf13t7QuqWNbp6G6OdxGrdWdcFEYSycVlIGJ8 YWg/icRyGVnG6YBFjrb5oam+sOJICfV77jN6HxO+3DztZi7DRhctRqy4rzPQq3ma bL2SlBVwaB+cR3apoN5LYF7Z3NgI7H2S6ro/0SmHwSTcaS59uiaMpsTLXUDPRcwP J7QAwMm8z1P1j4+Zdqdr8fMoJrM1fsc7cfPUQ8JA0DEWn+pns1Sq0vkxOgWMV5Do ulaHUZVJktx5S8Hv8xA//V8drTwTrvn7R9Sb5hKPhEQfwy4GYiRf+HBnzCYugXMY zWwqzQxqAnBmB86Uivq1G1Al/CJo48YfCH2aoJVvdmrCr61ArHqE98Yn4pVGeRv3 gE3HOeNC4rGfZw1/p0lHbmjwG7+ZU8xP/hgb9TNmoybjTbMqYcFLiGP3oTSZ/gmJ 20OcMhF0LZlOFC0+/dMIPwYNDOrWY6XdRRZRUQRO2gMVLpQ6m6jIA2owQ5koSEbM XQNACblvF0Pem8bNEBERe4PGLiezSathDAt2rQTTGVykIsOw177VjJr3I2M7SDvb nkgfavv1ODH4xGBeyOyZ =TWjf -----END PGP SIGNATURE----- --PpAOPzA3dXsRhoo+-- From owner-svn-src-head@FreeBSD.ORG Thu May 29 02:26:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B072DCF; Thu, 29 May 2014 02:26:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 589952E56; Thu, 29 May 2014 02:26:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4T2QDbC010052; Thu, 29 May 2014 02:26:13 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4T2QD8E010051; Thu, 29 May 2014 02:26:13 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201405290226.s4T2QD8E010051@svn.freebsd.org> From: Warren Block Date: Thu, 29 May 2014 02:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266828 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 02:26:13 -0000 Author: wblock (doc committer) Date: Thu May 29 02:26:12 2014 New Revision: 266828 URL: http://svnweb.freebsd.org/changeset/base/266828 Log: Correct the description of characters allowed. Based on pw_checkname in usr.sbin/pw/pw_user.c. Modified version of patch submitted by venture37. PR: docs/47594 Submitted by: Fernando Schapachnik , venture37 Reviewed by: allanjude, bcr, brueffer (on phabricator) MFC after: 1 week Modified: head/share/man/man5/passwd.5 Modified: head/share/man/man5/passwd.5 ============================================================================== --- head/share/man/man5/passwd.5 Thu May 29 01:42:22 2014 (r266827) +++ head/share/man/man5/passwd.5 Thu May 29 02:26:12 2014 (r266828) @@ -125,19 +125,29 @@ Routines that manipulate these files will often return only one of the multiple entries, and that one by random selection. .Pp -The login name must never begin with a hyphen -.Pq Ql - ; -also, it is strongly -suggested that neither upper-case characters or dots -.Pq Ql \&. -be part -of the name, as this tends to confuse mailers. +The login name must not begin with a hyphen +.Pq Ql \&- , +and cannot contain 8-bit characters, tabs or spaces, or any of these +symbols: +.Ql \&,:+&#%^\&(\&)!@~*?<>=|\e\\&/" . +The dollar symbol +.Pq Ql \&$ +is allowed only as the last character for use with Samba. No field may contain a colon .Pq Ql \&: as this has been used historically to separate the fields in the user database. .Pp +Case is significant. +Login names +.Ql Lrrr +and +.Ql lrrr +represent different users. +Be aware of this when interoperating with systems that do not have +case-sensitive login names. +.Pp In the .Nm master.passwd file, From owner-svn-src-head@FreeBSD.ORG Thu May 29 03:42:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ADE45DC8; Thu, 29 May 2014 03:42:48 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 301EE24DE; Thu, 29 May 2014 03:42:47 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s4T3ghGa087522 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 29 May 2014 07:42:43 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s4T3ghVL087521; Thu, 29 May 2014 07:42:43 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 29 May 2014 07:42:43 +0400 From: Gleb Smirnoff To: Julian Elischer Subject: Re: svn commit: r266806 - head/sys/netgraph Message-ID: <20140529034243.GR50679@FreeBSD.org> References: <201405281315.s4SDFEvc061176@svn.freebsd.org> <5385EED0.1010506@freebsd.org> <20140528145619.GM50679@FreeBSD.org> <538603A3.7080303@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <538603A3.7080303@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, dmitryluhtionov@gmail.com X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 03:42:48 -0000 On Wed, May 28, 2014 at 11:41:23PM +0800, Julian Elischer wrote: J> On 5/28/14, 10:56 PM, Gleb Smirnoff wrote: J> > On Wed, May 28, 2014 at 10:12:32PM +0800, Julian Elischer wrote: J> > J> On 5/28/14, 9:15 PM, Gleb Smirnoff wrote: J> > J> > Author: glebius J> > J> > Date: Wed May 28 13:15:14 2014 J> > J> > New Revision: 266806 J> > J> > URL: http://svnweb.freebsd.org/changeset/base/266806 J> > J> > J> > J> > Log: J> > J> > Use M_WAITOK for the NGM_PIPE_SET_CFG control message. We expect it to J> > J> > arrive from userland only. J> > J> > J> > J> > Submitted by: Dmitry Luhtionov J> > J> what's to stop another node from generating it and sending it on? J> > J> generally a message may come from anywhere. J> > J> Just becasue YOU don't have module that J> > J> sends messages to ng_pipe, doesn't mean there never will be.. J> > J> also there are cases when the locking may force a message to be J> > J> delivered asynchronously. J> > J> > I know that. After resolving many issues with netgraph, I feel that J> > our policy should be towards putting some invariants on what events J> > SHOULD come from userland only and which events SHOULD be serviced J> > without memory failures. J> > J> > Current paradigma that messages are fully symmetrical and can come J> > from anywhere are quite a curious thought experiment. I liked that J> > for a long time. But in practice if we want to build a robust software J> > we should make more strict rules of using it. J> > J> > You could disagree, but if you try to fix this particular one liner J> > in the paradigma of "messages come from anywhere", then you will end J> > up with smth like 20 lines of code to this particular module. Next J> > comes the need to fix any software or script that sends NGM_PIPE_SET_CFG, J> > it now should be taught of dealing with ENOMEM. So, instead of one J> > liner you will bury yourself under tons of work. J> > J> > J> Then I suggest that we increment the protocol, and add support to messages J> to say whether they come from user space. J> and some providers only accept such messages. J> J> I have lost track of the code so I don't know if my comment about J> messages getting queued instead of delivered is still true. J> However if it is, then a message could be delivered by a kernel agent J> even J> if it is initiated by a userspace program. I don't think we need to increment protocol. Does it change? Right now we have a de facto standard, that some messages are expected from userland only. It is not enforced, it is just a habit. We should just keep this direction. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu May 29 03:44:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E1FDF32; Thu, 29 May 2014 03:44:46 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BC1E224F1; Thu, 29 May 2014 03:44:44 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s4T3igbb087555 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 29 May 2014 07:44:42 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s4T3iguL087554; Thu, 29 May 2014 07:44:42 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 29 May 2014 07:44:42 +0400 From: Gleb Smirnoff To: "Bjoern A. Zeeb" Subject: Re: svn commit: r266822 - head/sys/netipsec Message-ID: <20140529034442.GS50679@FreeBSD.org> References: <201405282301.s4SN1Kcv020803@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201405282301.s4SN1Kcv020803@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 03:44:46 -0000 On Wed, May 28, 2014 at 11:01:20PM +0000, Bjoern A. Zeeb wrote: B> Author: bz B> Date: Wed May 28 23:01:20 2014 B> New Revision: 266822 B> URL: http://svnweb.freebsd.org/changeset/base/266822 B> B> Log: B> Use IPv4 statistics in ipsec4_process_packet() rather than the IPv6 B> version. This also unbreaks the NOINET6 builds after r266800. B> B> Modified: B> head/sys/netipsec/ipsec_output.c B> B> Modified: head/sys/netipsec/ipsec_output.c B> ============================================================================== B> --- head/sys/netipsec/ipsec_output.c Wed May 28 19:59:27 2014 (r266821) B> +++ head/sys/netipsec/ipsec_output.c Wed May 28 23:01:20 2014 (r266822) B> @@ -576,7 +576,7 @@ ipsec4_process_packet( B> DPRINTF(("%s: unsupported protocol family %u\n", B> __func__, dst->sa.sa_family)); B> error = EPFNOSUPPORT; B> - IPSEC6STAT_INC(ips_out_inval); B> + IPSECSTAT_INC(ips_out_inval); B> goto bad; B> } B> error = (*sav->tdb_xform->xf_output)(m, isr, NULL, i, off); B> @@ -739,4 +739,4 @@ bad: B> m_freem(m); B> return error; B> } B> -#endif /*INET6*/ B> \ No newline at end of file B> +#endif /*INET6*/ Is there any reason to keep the line '\ No newline at end of file' when it is no longer at the end of the file? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu May 29 05:15:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16205904; Thu, 29 May 2014 05:15:58 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 5451B2C6E; Thu, 29 May 2014 05:15:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 2085638066; Thu, 29 May 2014 00:15:56 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id ONi226jvq_SA; Thu, 29 May 2014 00:15:56 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id F07B438054; Thu, 29 May 2014 00:15:54 -0500 (CDT) Message-ID: <5386C289.5030007@freebsd.org> Date: Wed, 28 May 2014 22:15:53 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Konstantin Belousov , Warner Losh Subject: Re: svn commit: r266553 - head/release/scripts References: <20140527093633.0a922e13@kalimero.tijl.coosemans.org> <85FABD2B-81BB-4E1A-B61E-4216A144A9DB@bsdimp.com> <20140527214038.17d00369@kalimero.tijl.coosemans.org> <13EB325C-3882-46AA-9B17-3BF19997C978@bsdimp.com> <20140528125027.6d0cc4fb@kalimero.tijl.coosemans.org> <5E038619-5921-4B7A-A4EE-D1E83614934B@bsdimp.com> <20140528152820.GA3991@kib.kiev.ua> <20140528154728.GB3991@kib.kiev.ua> <20140529015330.GG3991@kib.kiev.ua> In-Reply-To: <20140529015330.GG3991@kib.kiev.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , svn-src-head@freebsd.org, Tijl Coosemans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 05:15:58 -0000 On 05/28/14 18:53, Konstantin Belousov wrote: > On Wed, May 28, 2014 at 01:53:28PM -0600, Warner Losh wrote: >> On May 28, 2014, at 9:47 AM, Konstantin Belousov wrote: >> >>> On Wed, May 28, 2014 at 09:35:27AM -0600, Warner Losh wrote: >>>> On May 28, 2014, at 9:28 AM, Konstantin Belousov wrote: >>>> >>>>> On Wed, May 28, 2014 at 08:26:58AM -0600, Warner Losh wrote: >>>>>> Then we disagree on this point. However, the disagreement here is >>>>>> kinda foundational: to build a set of libraries or sys root, you have >>>>>> to have a MACHINE_ARCH to make it work. Even in our current system, we >>>>>> set MACHINE_ARCH to i386 or powerpc when building the 32-bit binaries >>>>>> (note: we don?t do this for mips). This means that if we do grow x32 >>>>>> support, we?ll need to grow a MACHINE_ARCH for it. That?s my point: >>>>>> all ABIs have MACHINE_ARCH associated with them, and those are the >>>>>> names users are used to specifying, and are the ones that are the most >>>>>> natural for script writers to use. With nathan?s patches, we?re to the >>>>>> point where those are used, though there?s also the option of using >>>>>> the non-standard names if you want (e.g. amd64:32 instead of x32). >>>>>> >>>>> I am not sure if this comment would add anything to the discussion, >>>>> but other build systems do not require MACHINE_ARCH. In our terms, >>>>> other build systems are happy to build: >>>>> i386 binary when MACHINE is amd64 and CFLAGS contains -m32; >>>>> x32 binary when MACHINE is amd64 and CFLAGS contains -mx32. >>>>> >>>>> For HEAD and stable/10 we finally reached the point where -m32 works, >>>>> on amd64; it worked on powerpc64 from inception, AFAIU Nathan. At least >>>>> this is true for dependencies limited to the base system, and not to the >>>>> ports (the later is since ports do not know about multiarch). >>>>> >>>>> It is limitation of our build that we require MACHINE_ARCH to build >>>>> other natively supported ABI binary on the host. Ideally, the hacks that >>>>> treat lib32 build as the cross-compilation would go away eventually. >>>> I doubt it. The MACHINE_ARCH is used to select which files to build. >>> Do I understand you right that the comment references e.g. a selection >>> of arch-specific subdir in lib/libc or libexec/rtld-elf for inclusion >>> into the build ? If yes, I cannot disagree with the statement. >> As far as I can tell, that?s the only reason we?re doing it.. But it is a critically important reason... >> >>> My note was about our build system which currently requires >>> full-fledged cross-build to even create i386 binary on amd64 vs. other >>> builds which consider this as a (often minor) variations of the host >>> target. Sure, some variances must be allowed, e.g. to select proper .S >>> file for the ABI, but we do not need cross-build to get i386 on amd64. >> lib32 uses -m32 and some other flags to achieve its ends. So it doesn?t create a full i386 compiler, etc. It just uses the amd64 one with special flags/args. So I don?t think it requires a full-fledged cross-build environment, or I misunderstand what you mean by that phrase. > We install the headers for the MACHINE_ARCH into the compat32 build tree, > and use them instead of the target MACHINE headers. The fact that > -m32 works as the cross-compiler just saves the build > time. Ah, OK. That's probably pointless most of the time now. It was always pointless on PowerPC and MIPS, since they share the same headers anyway, and is probably also now unnecessary on x86 now that regular -m32 works. I don't think ia64 builds lib32 (which would require a real cross-compiler). -Nathan From owner-svn-src-head@FreeBSD.ORG Thu May 29 05:18:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D694CC7 for ; Thu, 29 May 2014 05:18:08 +0000 (UTC) Received: from mail-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62D222CA5 for ; Thu, 29 May 2014 05:18:08 +0000 (UTC) Received: by mail-pb0-f48.google.com with SMTP id rr13so12341851pbb.7 for ; Wed, 28 May 2014 22:18:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=y0bUQ3thDqAOIYnnyWSeJAwQy2nqj7YbnGgo2VdFmbE=; b=BIGrkYuAeGX+2yoRbA5SOll4uqROJ4nWWr7cEoGi4agbbG6fbBugPoa/a+XBRE2KmM xjxRgjPlsXMn4UBXgOmhyubI9AntqMFB7VuOKQ3YN3gm+patmxqw5XjCSFS/44ciB+mo 08ckKLOG5YEMNgARp2ixq0+HSQSbwQKkvg5TZGF6PoXwo9j71c1JRByxGIHVbKshVMb7 s+PnH6aVymyR7wAvVk3XB5ECORRoA/tET0GPeurDBumbjYifbuETEtqhPT2AX8nBscPg wmF5sM+91lySBwIfKoiuATQ3PWbx5T2CUqzlEL2gyW8TPPCY3uiy0n0BJVXNd1oP8pCt Czzg== X-Gm-Message-State: ALoCoQn48WT1jS6T+VnDc+O1UH/yBhIfQYpI0lzG17NyufBa23ne43//MFOgP/36x4JmtkuFyjKg X-Received: by 10.68.191.39 with SMTP id gv7mr5716528pbc.90.1401340681557; Wed, 28 May 2014 22:18:01 -0700 (PDT) Received: from lgmac-rtangirala.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id au4sm31256950pbc.10.2014.05.28.22.17.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 May 2014 22:18:00 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_754AA036-3FBC-4A8A-8520-DE04FB774F76"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266553 - head/release/scripts From: Warner Losh In-Reply-To: <5386C289.5030007@freebsd.org> Date: Wed, 28 May 2014 23:18:18 -0600 Message-Id: <5ADEEFAD-6374-4E1B-BF11-EED8BA882BC8@bsdimp.com> References: <20140527093633.0a922e13@kalimero.tijl.coosemans.org> <85FABD2B-81BB-4E1A-B61E-4216A144A9DB@bsdimp.com> <20140527214038.17d00369@kalimero.tijl.coosemans.org> <13EB325C-3882-46AA-9B17-3BF19997C978@bsdimp.com> <20140528125027.6d0cc4fb@kalimero.tijl.coosemans.org> <5E038619-5921-4B7A-A4EE-D1E83614934B@bsdimp.com> <20140528152820.GA3991@kib.kiev.ua> <20140528154728.GB3991@kib.kiev.ua> <20140529015330.GG3991@kib.kiev.ua> <5386C289.5030007@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1878.2) Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , Glen Barber , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Konstantin Belousov , Tijl Coosemans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 05:18:08 -0000 --Apple-Mail=_754AA036-3FBC-4A8A-8520-DE04FB774F76 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 On May 28, 2014, at 11:15 PM, Nathan Whitehorn = wrote: > On 05/28/14 18:53, Konstantin Belousov wrote: >> On Wed, May 28, 2014 at 01:53:28PM -0600, Warner Losh wrote: >>> On May 28, 2014, at 9:47 AM, Konstantin Belousov = wrote: >>>=20 >>>> On Wed, May 28, 2014 at 09:35:27AM -0600, Warner Losh wrote: >>>>> On May 28, 2014, at 9:28 AM, Konstantin Belousov = wrote: >>>>>=20 >>>>>> On Wed, May 28, 2014 at 08:26:58AM -0600, Warner Losh wrote: >>>>>>> Then we disagree on this point. However, the disagreement here = is >>>>>>> kinda foundational: to build a set of libraries or sys root, you = have >>>>>>> to have a MACHINE_ARCH to make it work. Even in our current = system, we >>>>>>> set MACHINE_ARCH to i386 or powerpc when building the 32-bit = binaries >>>>>>> (note: we don?t do this for mips). This means that if we do grow = x32 >>>>>>> support, we?ll need to grow a MACHINE_ARCH for it. That?s my = point: >>>>>>> all ABIs have MACHINE_ARCH associated with them, and those are = the >>>>>>> names users are used to specifying, and are the ones that are = the most >>>>>>> natural for script writers to use. With nathan?s patches, we?re = to the >>>>>>> point where those are used, though there?s also the option of = using >>>>>>> the non-standard names if you want (e.g. amd64:32 instead of = x32). >>>>>>>=20 >>>>>> I am not sure if this comment would add anything to the = discussion, >>>>>> but other build systems do not require MACHINE_ARCH. In our = terms, >>>>>> other build systems are happy to build: >>>>>> i386 binary when MACHINE is amd64 and CFLAGS contains -m32; >>>>>> x32 binary when MACHINE is amd64 and CFLAGS contains -mx32. >>>>>>=20 >>>>>> For HEAD and stable/10 we finally reached the point where -m32 = works, >>>>>> on amd64; it worked on powerpc64 from inception, AFAIU Nathan. At = least >>>>>> this is true for dependencies limited to the base system, and not = to the >>>>>> ports (the later is since ports do not know about multiarch). >>>>>>=20 >>>>>> It is limitation of our build that we require MACHINE_ARCH to = build >>>>>> other natively supported ABI binary on the host. Ideally, the = hacks that >>>>>> treat lib32 build as the cross-compilation would go away = eventually. >>>>> I doubt it. The MACHINE_ARCH is used to select which files to = build. >>>> Do I understand you right that the comment references e.g. a = selection >>>> of arch-specific subdir in lib/libc or libexec/rtld-elf for = inclusion >>>> into the build ? If yes, I cannot disagree with the statement. >>> As far as I can tell, that?s the only reason we?re doing it.. But = it is a critically important reason... >>>=20 >>>> My note was about our build system which currently requires >>>> full-fledged cross-build to even create i386 binary on amd64 vs. = other >>>> builds which consider this as a (often minor) variations of the = host >>>> target. Sure, some variances must be allowed, e.g. to select proper = .S >>>> file for the ABI, but we do not need cross-build to get i386 on = amd64. >>> lib32 uses -m32 and some other flags to achieve its ends. So it = doesn?t create a full i386 compiler, etc. It just uses the amd64 one = with special flags/args. So I don?t think it requires a full-fledged = cross-build environment, or I misunderstand what you mean by that = phrase. >> We install the headers for the MACHINE_ARCH into the compat32 build = tree, >> and use them instead of the target MACHINE headers. The fact that >> -m32 works as the cross-compiler just saves the build >> time. >=20 > Ah, OK. That's probably pointless most of the time now. It was always = pointless on PowerPC and MIPS, since they share the same headers anyway, = and is probably also now unnecessary on x86 now that regular -m32 works. = I don't think ia64 builds lib32 (which would require a real = cross-compiler). Yea, this is an area that can likely be cleaned up from the original = gross hacks that were necessary before -m32 actually worked. Warner --Apple-Mail=_754AA036-3FBC-4A8A-8520-DE04FB774F76 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJThsMaAAoJEGwc0Sh9sBEAeWcQAKS4rkvEXWmO1xnprW8TLGRd x95CU5yTjae5HzUx45GHdbEzA8vDe8C+zh0yaiJCES4IQgbo5I0PWyADBPtyMokc IhyDSVIQs3azPIMclGiC94/aO+aD2/M4KHEfBV7gHaRlwkOhJ1Ui91bSc0YjKVRI B8DVhpHm91wy/X0PaohiYxF1PtbzNyRwvD268LzxrvbIatxTRNMMuCcquHdG7RaA Vw4WidLwod+BKsqO58oP0/Zuu5z3YSYwzHtbxoxAf7WM6mf3x7LTBnG0cEeF470Z 8e7Y7bXBvQPeqc5pOdiYTV9lutbXOMwdAblq9s2xxXYIJjBiIdIciTo69PBIiQqm sWSNtcGvDGd7umSg393EKpBPlCw+65zUGeJ+8+Q/VYZEIzqLl0VCvUpjVVjnU73D 8dIG13XHcufXeHrgk/M1jumciNhwTCH6B6p4VJrxR7ie38T21LtbITfiGY/J6ttP oy5/9jaatHgRfdEIbKAdmfBhznRML6+VsH54nvMfkVF4zFi4saMMciyl5SWidaEl 8qALWwAWb7o5MtGGN7DH5A0CZI3n1fvm1pMcZ4xkvqwe9b5e365nn0VQ75ee+09y eQMDwoMDLmjDXc0EoKTcGnSX7vLfFvsVACjm5vo/vdOr3ooIQqIR0BoL4Hdp5qic TGMbKX51iB8kLpWrfAcJ =J+lU -----END PGP SIGNATURE----- --Apple-Mail=_754AA036-3FBC-4A8A-8520-DE04FB774F76-- From owner-svn-src-head@FreeBSD.ORG Thu May 29 10:06:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82D23D72; Thu, 29 May 2014 10:06:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EF6D269B; Thu, 29 May 2014 10:06:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TA6JAt013609; Thu, 29 May 2014 10:06:19 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TA6IBj013604; Thu, 29 May 2014 10:06:18 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405291006.s4TA6IBj013604@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 29 May 2014 10:06:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266831 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 10:06:19 -0000 Author: hselasky Date: Thu May 29 10:06:18 2014 New Revision: 266831 URL: http://svnweb.freebsd.org/changeset/base/266831 Log: Optimise the ISP/SAF1761 driver: - Use an interrupt filter for handling the data path interrupts. This increases the throughput significantly. - Implement support for USB suspend and resume in USB host mode. Sponsored by: DARPA, AFRL Modified: head/sys/dev/usb/controller/saf1761_otg.c head/sys/dev/usb/controller/saf1761_otg.h head/sys/dev/usb/controller/saf1761_otg_fdt.c Modified: head/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.c Thu May 29 07:45:45 2014 (r266830) +++ head/sys/dev/usb/controller/saf1761_otg.c Thu May 29 10:06:18 2014 (r266831) @@ -84,6 +84,13 @@ ((struct saf1761_otg_softc *)(((uint8_t *)(bus)) - \ ((uint8_t *)&(((struct saf1761_otg_softc *)0)->sc_bus)))) +#define SAF1761_OTG_PC2UDEV(pc) \ + (USB_DMATAG_TO_XROOT((pc)->tag_parent)->udev) + +#define SAF1761_DCINTERRUPT_THREAD_IRQ \ + (SOTG_DCINTERRUPT_IEVBUS | SOTG_DCINTERRUPT_IEBRST | \ + SOTG_DCINTERRUPT_IERESM | SOTG_DCINTERRUPT_IESUSP) + #ifdef USB_DEBUG static int saf1761_otg_debug = 0; static int saf1761_otg_forcefs = 0; @@ -201,7 +208,6 @@ saf1761_otg_wakeup_peer(struct saf1761_o /* Wait 8ms for remote wakeup to complete. */ usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); - } static uint8_t @@ -212,6 +218,10 @@ saf1761_host_channel_alloc(struct saf176 if (td->channel < SOTG_HOST_CHANNEL_MAX) return (0); + /* check if device is suspended */ + if (SAF1761_OTG_PC2UDEV(td->pc)->flags.self_suspended != 0) + return (1); /* busy - cannot transfer data */ + switch (td->ep_type) { case UE_INTERRUPT: for (x = 0; x != 32; x++) { @@ -257,19 +267,25 @@ saf1761_host_channel_free(struct saf1761 x = td->channel - 32; td->channel = SOTG_HOST_CHANNEL_MAX; sc->sc_host_intr_map &= ~(1 << x); - SAF1761_WRITE_LE_4(sc, SOTG_INT_PTD_SKIP_PTD, ~sc->sc_host_intr_map); + sc->sc_host_intr_suspend_map &= ~(1 << x); + SAF1761_WRITE_LE_4(sc, SOTG_INT_PTD_SKIP_PTD, + (~sc->sc_host_intr_map) | sc->sc_host_intr_suspend_map); break; case UE_ISOCHRONOUS: x = td->channel; td->channel = SOTG_HOST_CHANNEL_MAX; sc->sc_host_isoc_map &= ~(1 << x); - SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_SKIP_PTD, ~sc->sc_host_isoc_map); + sc->sc_host_isoc_suspend_map &= ~(1 << x); + SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_SKIP_PTD, + (~sc->sc_host_isoc_map) | sc->sc_host_isoc_suspend_map); break; default: x = td->channel - 64; td->channel = SOTG_HOST_CHANNEL_MAX; sc->sc_host_async_map &= ~(1 << x); - SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, ~sc->sc_host_async_map); + sc->sc_host_async_suspend_map &= ~(1 << x); + SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, + (~sc->sc_host_async_map) | sc->sc_host_async_suspend_map); break; } } @@ -447,7 +463,8 @@ saf1761_host_setup_tx(struct saf1761_otg SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW0, temp); /* activate PTD */ - SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, ~sc->sc_host_async_map); + SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, + (~sc->sc_host_async_map) | sc->sc_host_async_suspend_map); td->toggle = 1; busy: @@ -553,7 +570,8 @@ saf1761_host_bulk_data_rx(struct saf1761 SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW0, temp); /* activate PTD */ - SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, ~sc->sc_host_async_map); + SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, + (~sc->sc_host_async_map) | sc->sc_host_async_suspend_map); busy: return (1); /* busy */ complete: @@ -639,7 +657,8 @@ saf1761_host_bulk_data_tx(struct saf1761 SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW0, temp); /* activate PTD */ - SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, ~sc->sc_host_async_map); + SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, + (~sc->sc_host_async_map) | sc->sc_host_async_suspend_map); td->toggle ^= 1; busy: @@ -748,7 +767,8 @@ saf1761_host_intr_data_rx(struct saf1761 SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW0, temp); /* activate PTD */ - SAF1761_WRITE_LE_4(sc, SOTG_INT_PTD_SKIP_PTD, ~sc->sc_host_intr_map); + SAF1761_WRITE_LE_4(sc, SOTG_INT_PTD_SKIP_PTD, + (~sc->sc_host_intr_map) | sc->sc_host_intr_suspend_map); busy: return (1); /* busy */ complete: @@ -838,7 +858,8 @@ saf1761_host_intr_data_tx(struct saf1761 SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW0, temp); /* activate PTD */ - SAF1761_WRITE_LE_4(sc, SOTG_INT_PTD_SKIP_PTD, ~sc->sc_host_intr_map); + SAF1761_WRITE_LE_4(sc, SOTG_INT_PTD_SKIP_PTD, + (~sc->sc_host_intr_map) | sc->sc_host_intr_suspend_map); td->toggle ^= 1; busy: @@ -852,7 +873,8 @@ static uint8_t saf1761_host_isoc_data_rx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { /* activate PTD */ - SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_SKIP_PTD, ~sc->sc_host_isoc_map); + SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_SKIP_PTD, + (~sc->sc_host_isoc_map) | sc->sc_host_isoc_suspend_map); return (1); /* busy */ } @@ -861,7 +883,8 @@ static uint8_t saf1761_host_isoc_data_tx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { /* activate PTD */ - SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_SKIP_PTD, ~sc->sc_host_isoc_map); + SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_SKIP_PTD, + (~sc->sc_host_isoc_map) | sc->sc_host_isoc_suspend_map); return (1); /* busy */ } @@ -1222,7 +1245,7 @@ saf1761_device_data_tx_sync(struct saf17 return (0); /* complete */ } -static uint8_t +static void saf1761_otg_xfer_do_fifo(struct saf1761_otg_softc *sc, struct usb_xfer *xfer) { struct saf1761_otg_td *td; @@ -1231,6 +1254,9 @@ saf1761_otg_xfer_do_fifo(struct saf1761_ DPRINTFN(9, "\n"); td = xfer->td_transfer_cache; + if (td == NULL) + return; + while (1) { if ((td->func) (sc, td)) { /* operation in progress */ @@ -1258,28 +1284,37 @@ saf1761_otg_xfer_do_fifo(struct saf1761_ td->toggle = toggle; xfer->td_transfer_cache = td; } - return (1); /* not complete */ + return; done: /* compute all actual lengths */ + xfer->td_transfer_cache = NULL; + sc->sc_xfer_complete = 1; +} + +static uint8_t +saf1761_otg_xfer_do_complete(struct saf1761_otg_softc *sc, struct usb_xfer *xfer) +{ + struct saf1761_otg_td *td; - saf1761_otg_standard_done(xfer); + DPRINTFN(9, "\n"); - return (0); /* complete */ + td = xfer->td_transfer_cache; + if (td == NULL) { + /* compute all actual lengths */ + saf1761_otg_standard_done(xfer); + return (1); + } + return (0); } static void -saf1761_otg_interrupt_poll(struct saf1761_otg_softc *sc) +saf1761_otg_interrupt_poll_locked(struct saf1761_otg_softc *sc) { struct usb_xfer *xfer; -repeat: - TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { - if (!saf1761_otg_xfer_do_fifo(sc, xfer)) { - /* queue has been modified */ - goto repeat; - } - } + TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) + saf1761_otg_xfer_do_fifo(sc, xfer); } static void @@ -1329,13 +1364,27 @@ saf1761_otg_update_vbus(struct saf1761_o } } -void -saf1761_otg_interrupt(struct saf1761_otg_softc *sc) +static void +saf1761_otg_interrupt_complete_locked(struct saf1761_otg_softc *sc) { - uint32_t status; + struct usb_xfer *xfer; +repeat: + /* scan for completion events */ + TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { + if (saf1761_otg_xfer_do_complete(sc, xfer)) + goto repeat; + } +} + +int +saf1761_otg_filter_interrupt(void *arg) +{ + struct saf1761_otg_softc *sc = arg; + int retval = FILTER_HANDLED; uint32_t hcstat; + uint32_t status; - USB_BUS_LOCK(&sc->sc_bus); + USB_BUS_SPIN_LOCK(&sc->sc_bus); hcstat = SAF1761_READ_LE_4(sc, SOTG_HCINTERRUPT); /* acknowledge all host controller interrupts */ @@ -1343,17 +1392,47 @@ saf1761_otg_interrupt(struct saf1761_otg status = SAF1761_READ_LE_4(sc, SOTG_DCINTERRUPT); /* acknowledge all device controller interrupts */ - SAF1761_WRITE_LE_4(sc, SOTG_DCINTERRUPT, status); - - DPRINTF("DCINTERRUPT=0x%08x HCINTERRUPT=0x%08x SOF=0x%08x " - "FRINDEX=0x%08x\n", status, hcstat, - SAF1761_READ_LE_4(sc, SOTG_FRAME_NUM), - SAF1761_READ_LE_4(sc, SOTG_FRINDEX)); + SAF1761_WRITE_LE_4(sc, SOTG_DCINTERRUPT, + status & ~SAF1761_DCINTERRUPT_THREAD_IRQ); (void) SAF1761_READ_LE_4(sc, SOTG_ATL_PTD_DONE_PTD); (void) SAF1761_READ_LE_4(sc, SOTG_INT_PTD_DONE_PTD); (void) SAF1761_READ_LE_4(sc, SOTG_ISO_PTD_DONE_PTD); + if (status & SAF1761_DCINTERRUPT_THREAD_IRQ) + retval = FILTER_SCHEDULE_THREAD; + + /* poll FIFOs, if any */ + saf1761_otg_interrupt_poll_locked(sc); + + if (sc->sc_xfer_complete != 0) + retval = FILTER_SCHEDULE_THREAD; + + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); + + return (retval); +} + +void +saf1761_otg_interrupt(void *arg) +{ + struct saf1761_otg_softc *sc = arg; + uint32_t status; + + USB_BUS_LOCK(&sc->sc_bus); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + + status = SAF1761_READ_LE_4(sc, SOTG_DCINTERRUPT) & + SAF1761_DCINTERRUPT_THREAD_IRQ; + + /* acknowledge all device controller interrupts */ + SAF1761_WRITE_LE_4(sc, SOTG_DCINTERRUPT, status); + + DPRINTF("DCINTERRUPT=0x%08x SOF=0x%08x " + "FRINDEX=0x%08x\n", status, + SAF1761_READ_LE_4(sc, SOTG_FRAME_NUM), + SAF1761_READ_LE_4(sc, SOTG_FRINDEX)); + /* update VBUS and ID bits, if any */ if (status & SOTG_DCINTERRUPT_IEVBUS) saf1761_otg_update_vbus(sc); @@ -1405,9 +1484,14 @@ saf1761_otg_interrupt(struct saf1761_otg saf1761_otg_root_intr(sc); } } - /* poll all active transfers */ - saf1761_otg_interrupt_poll(sc); + if (sc->sc_xfer_complete != 0) { + sc->sc_xfer_complete = 0; + + /* complete FIFOs, if any */ + saf1761_otg_interrupt_complete_locked(sc); + } + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); USB_BUS_UNLOCK(&sc->sc_bus); } @@ -1694,9 +1778,12 @@ saf1761_otg_start_standard_chain(struct DPRINTFN(9, "\n"); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + /* poll one time */ - if (saf1761_otg_xfer_do_fifo(sc, xfer)) { + saf1761_otg_xfer_do_fifo(sc, xfer); + if (xfer->td_transfer_cache != NULL) { /* * Only enable the endpoint interrupt when we are * actually waiting for data, hence we are dealing @@ -1712,7 +1799,11 @@ saf1761_otg_start_standard_chain(struct usbd_transfer_timeout_ms(xfer, &saf1761_otg_timeout, xfer->timeout); } + } else { + /* catch completion, if any */ + saf1761_otg_interrupt_complete_locked(sc); } + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void @@ -1856,6 +1947,8 @@ saf1761_otg_device_done(struct usb_xfer DPRINTFN(2, "xfer=%p, endpoint=%p, error=%d\n", xfer, xfer->endpoint, error); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) { saf1761_otg_intr_set(xfer, 0); } else { @@ -1869,6 +1962,8 @@ saf1761_otg_device_done(struct usb_xfer /* dequeue transfer and start next transfer */ usbd_transfer_done(xfer, error); + + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void @@ -1896,8 +1991,9 @@ saf1761_otg_set_stall(struct usb_device DPRINTFN(5, "endpoint=%p\n", ep); - /* set FORCESTALL */ + /* set STALL bit */ sc = SAF1761_OTG_BUS2SC(udev->bus); + ep_no = (ep->edesc->bEndpointAddress & UE_ADDR); ep_dir = (ep->edesc->bEndpointAddress & (UE_DIR_IN | UE_DIR_OUT)); ep_type = (ep->edesc->bmAttributes & UE_XFERTYPE); @@ -1906,6 +2002,8 @@ saf1761_otg_set_stall(struct usb_device /* should not happen */ return; } + USB_BUS_SPIN_LOCK(&sc->sc_bus); + /* select the correct endpoint */ SAF1761_WRITE_LE_4(sc, SOTG_EP_INDEX, (ep_no << SOTG_EP_INDEX_ENDP_INDEX_SHIFT) | @@ -1914,10 +2012,12 @@ saf1761_otg_set_stall(struct usb_device /* set stall */ SAF1761_WRITE_LE_4(sc, SOTG_CTRL_FUNC, SOTG_CTRL_FUNC_STALL); + + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void -saf1761_otg_clear_stall_sub(struct saf1761_otg_softc *sc, +saf1761_otg_clear_stall_sub_locked(struct saf1761_otg_softc *sc, uint8_t ep_no, uint8_t ep_type, uint8_t ep_dir) { if (ep_type == UE_CONTROL) { @@ -1959,14 +2059,18 @@ saf1761_otg_clear_stall(struct usb_devic /* get softc */ sc = SAF1761_OTG_BUS2SC(udev->bus); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + /* get endpoint descriptor */ ed = ep->edesc; /* reset endpoint */ - saf1761_otg_clear_stall_sub(sc, + saf1761_otg_clear_stall_sub_locked(sc, (ed->bEndpointAddress & UE_ADDR), (ed->bmAttributes & UE_XFERTYPE), (ed->bEndpointAddress & (UE_DIR_IN | UE_DIR_OUT))); + + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } usb_error_t @@ -2218,7 +2322,10 @@ saf1761_otg_do_poll(struct usb_bus *bus) struct saf1761_otg_softc *sc = SAF1761_OTG_BUS2SC(bus); USB_BUS_LOCK(&sc->sc_bus); - saf1761_otg_interrupt_poll(sc); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + saf1761_otg_interrupt_poll_locked(sc); + saf1761_otg_interrupt_complete_locked(sc); + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); USB_BUS_UNLOCK(&sc->sc_bus); } @@ -3150,6 +3257,115 @@ saf1761_otg_set_hw_power_sleep(struct us } } +static void +saf1761_otg_device_resume(struct usb_device *udev) +{ + struct saf1761_otg_softc *sc; + struct saf1761_otg_td *td; + struct usb_xfer *xfer; + uint8_t x; + + DPRINTF("\n"); + + if (udev->flags.usb_mode != USB_MODE_HOST) + return; + + sc = SAF1761_OTG_BUS2SC(udev->bus); + + USB_BUS_LOCK(&sc->sc_bus); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + + TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { + + if (xfer->xroot->udev != udev) + continue; + + td = xfer->td_transfer_cache; + if (td == NULL || td->channel >= SOTG_HOST_CHANNEL_MAX) + continue; + + switch (td->ep_type) { + case UE_INTERRUPT: + x = td->channel - 32; + sc->sc_host_intr_suspend_map &= ~(1 << x); + SAF1761_WRITE_LE_4(sc, SOTG_INT_PTD_SKIP_PTD, + (~sc->sc_host_intr_map) | sc->sc_host_intr_suspend_map); + break; + case UE_ISOCHRONOUS: + x = td->channel; + sc->sc_host_isoc_suspend_map &= ~(1 << x); + SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_SKIP_PTD, + (~sc->sc_host_isoc_map) | sc->sc_host_isoc_suspend_map); + break; + default: + x = td->channel - 64; + sc->sc_host_async_suspend_map &= ~(1 << x); + SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, + (~sc->sc_host_async_map) | sc->sc_host_async_suspend_map); + break; + } + } + + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); + USB_BUS_UNLOCK(&sc->sc_bus); + + /* poll all transfers again to restart resumed ones */ + saf1761_otg_do_poll(&sc->sc_bus); +} + +static void +saf1761_otg_device_suspend(struct usb_device *udev) +{ + struct saf1761_otg_softc *sc; + struct saf1761_otg_td *td; + struct usb_xfer *xfer; + uint8_t x; + + DPRINTF("\n"); + + if (udev->flags.usb_mode != USB_MODE_HOST) + return; + + sc = SAF1761_OTG_BUS2SC(udev->bus); + + USB_BUS_LOCK(&sc->sc_bus); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + + TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { + + if (xfer->xroot->udev != udev) + continue; + + td = xfer->td_transfer_cache; + if (td == NULL || td->channel >= SOTG_HOST_CHANNEL_MAX) + continue; + + switch (td->ep_type) { + case UE_INTERRUPT: + x = td->channel - 32; + sc->sc_host_intr_suspend_map |= (1 << x); + SAF1761_WRITE_LE_4(sc, SOTG_INT_PTD_SKIP_PTD, + (~sc->sc_host_intr_map) | sc->sc_host_intr_suspend_map); + break; + case UE_ISOCHRONOUS: + x = td->channel; + sc->sc_host_isoc_suspend_map |= (1 << x); + SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_SKIP_PTD, + (~sc->sc_host_isoc_map) | sc->sc_host_isoc_suspend_map); + break; + default: + x = td->channel - 64; + sc->sc_host_async_suspend_map |= (1 << x); + SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, + (~sc->sc_host_async_map) | sc->sc_host_async_suspend_map); + break; + } + } + + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); + USB_BUS_UNLOCK(&sc->sc_bus); +} + static const struct usb_bus_methods saf1761_otg_bus_methods = { .endpoint_init = &saf1761_otg_ep_init, @@ -3162,4 +3378,6 @@ static const struct usb_bus_methods saf1 .roothub_exec = &saf1761_otg_roothub_exec, .xfer_poll = &saf1761_otg_do_poll, .set_hw_power_sleep = saf1761_otg_set_hw_power_sleep, + .device_resume = &saf1761_otg_device_resume, + .device_suspend = &saf1761_otg_device_suspend, }; Modified: head/sys/dev/usb/controller/saf1761_otg.h ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.h Thu May 29 07:45:45 2014 (r266830) +++ head/sys/dev/usb/controller/saf1761_otg.h Thu May 29 10:06:18 2014 (r266831) @@ -140,11 +140,15 @@ struct saf1761_otg_softc { bus_space_handle_t sc_io_hdl; uint32_t sc_host_async_map; + uint32_t sc_host_async_suspend_map; uint32_t sc_host_intr_map; + uint32_t sc_host_intr_suspend_map; uint32_t sc_host_isoc_map; + uint32_t sc_host_isoc_suspend_map; uint32_t sc_intr_enable; /* enabled interrupts */ uint32_t sc_hw_mode; /* hardware mode */ uint32_t sc_interrupt_cfg; /* interrupt configuration */ + uint32_t sc_xfer_complete; uint32_t sc_bounce_buffer[1024 / 4]; @@ -162,6 +166,7 @@ struct saf1761_otg_softc { usb_error_t saf1761_otg_init(struct saf1761_otg_softc *sc); void saf1761_otg_uninit(struct saf1761_otg_softc *sc); -void saf1761_otg_interrupt(struct saf1761_otg_softc *sc); +driver_filter_t saf1761_otg_filter_interrupt; +driver_intr_t saf1761_otg_interrupt; #endif /* _SAF1761_OTG_H_ */ Modified: head/sys/dev/usb/controller/saf1761_otg_fdt.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg_fdt.c Thu May 29 07:45:45 2014 (r266830) +++ head/sys/dev/usb/controller/saf1761_otg_fdt.c Thu May 29 10:06:18 2014 (r266831) @@ -210,8 +210,8 @@ saf1761_otg_fdt_attach(device_t dev) device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); - err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)saf1761_otg_interrupt, sc, &sc->sc_intr_hdl); + err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_TTY | INTR_MPSAFE, + &saf1761_otg_filter_interrupt, &saf1761_otg_interrupt, sc, &sc->sc_intr_hdl); if (err) { sc->sc_intr_hdl = NULL; goto error; From owner-svn-src-head@FreeBSD.ORG Thu May 29 10:46:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17EB2D72; Thu, 29 May 2014 10:46:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC71E2B34; Thu, 29 May 2014 10:46:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TAkAB8031461; Thu, 29 May 2014 10:46:10 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TAk9XK031447; Thu, 29 May 2014 10:46:09 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405291046.s4TAk9XK031447@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 29 May 2014 10:46:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266832 - in head/sys: boot/fdt/dts/mips conf dev/usb/controller mips/conf modules/usb modules/usb/saf1761 modules/usb/saf1761otg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 10:46:11 -0000 Author: hselasky Date: Thu May 29 10:46:09 2014 New Revision: 266832 URL: http://svnweb.freebsd.org/changeset/base/266832 Log: Hook the ISP/SAF1761 driver into MIPS kernel builds. - Update FDT file for BERI DE4 boards. - Add needed kernel configuration keywords. - Rename module to saf1761otg so that the device unit number does not interfere with the hardware ID in dmesg. Sponsored by: DARPA, AFRL Added: head/sys/modules/usb/saf1761otg/ - copied from r266244, head/sys/modules/usb/saf1761/ Deleted: head/sys/modules/usb/saf1761/ Modified: head/sys/boot/fdt/dts/mips/beripad-de4.dts head/sys/conf/files head/sys/dev/usb/controller/saf1761_otg_fdt.c head/sys/dev/usb/controller/usb_controller.c head/sys/mips/conf/BERI_DE4_BASE head/sys/modules/usb/Makefile head/sys/modules/usb/saf1761otg/Makefile Modified: head/sys/boot/fdt/dts/mips/beripad-de4.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beripad-de4.dts Thu May 29 10:06:18 2014 (r266831) +++ head/sys/boot/fdt/dts/mips/beripad-de4.dts Thu May 29 10:46:09 2014 (r266832) @@ -222,7 +222,7 @@ }; usb@0x7f100000 { - compatible = "philips,isp1761"; + compatible = "nxp,usb-isp1761"; reg = <0x7f100000 0x40000 0x7f140000 0x4>; // IRQ 4 is DC, IRQ 5 is HC. @@ -253,14 +253,5 @@ sri-cambridge,fileio = "rw"; sri-cambridge,devname = "de4tempfan"; }; - - avgen@0x7f100000 { - compatible = "sri-cambridge,avgen"; - reg = <0x7f100000 0x40000>; - sri-cambridge,width = <4>; - sri-cambridge,fileio = "r"; - sri-cambridge,devname = "usbmem"; - }; - }; }; Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu May 29 10:06:18 2014 (r266831) +++ head/sys/conf/files Thu May 29 10:46:09 2014 (r266832) @@ -2314,6 +2314,8 @@ dev/usb/controller/uhci.c optional uhci dev/usb/controller/uhci_pci.c optional uhci pci dev/usb/controller/xhci.c optional xhci dev/usb/controller/xhci_pci.c optional xhci pci +dev/usb/controller/saf1761_otg.c optional saf1761otg +dev/usb/controller/saf1761_otg_fdt.c optional saf1761otg fdt dev/usb/controller/uss820dci.c optional uss820dci dev/usb/controller/uss820dci_atmelarm.c optional uss820dci at91rm9200 dev/usb/controller/usb_controller.c optional usb Modified: head/sys/dev/usb/controller/saf1761_otg_fdt.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg_fdt.c Thu May 29 10:06:18 2014 (r266831) +++ head/sys/dev/usb/controller/saf1761_otg_fdt.c Thu May 29 10:46:09 2014 (r266832) @@ -93,15 +93,15 @@ static device_method_t saf1761_otg_metho }; static driver_t saf1761_otg_driver = { - .name = "saf1761", + .name = "saf1761otg", .methods = saf1761_otg_methods, .size = sizeof(struct saf1761_otg_softc), }; static devclass_t saf1761_otg_devclass; -DRIVER_MODULE(saf1761, simplebus, saf1761_otg_driver, saf1761_otg_devclass, 0, 0); -MODULE_DEPEND(saf1761, usb, 1, 1, 1); +DRIVER_MODULE(saf1761otg, simplebus, saf1761_otg_driver, saf1761_otg_devclass, 0, 0); +MODULE_DEPEND(saf1761otg, usb, 1, 1, 1); static int saf1761_otg_fdt_probe(device_t dev) Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Thu May 29 10:06:18 2014 (r266831) +++ head/sys/dev/usb/controller/usb_controller.c Thu May 29 10:46:09 2014 (r266832) @@ -138,7 +138,7 @@ DRIVER_MODULE(usbus, octusb, usb_driver, /* Dual Mode Drivers */ DRIVER_MODULE(usbus, dwcotg, usb_driver, usb_devclass, 0, 0); -DRIVER_MODULE(usbus, saf1761, usb_driver, usb_devclass, 0, 0); +DRIVER_MODULE(usbus, saf1761otg, usb_driver, usb_devclass, 0, 0); /*------------------------------------------------------------------------* * usb_probe Modified: head/sys/mips/conf/BERI_DE4_BASE ============================================================================== --- head/sys/mips/conf/BERI_DE4_BASE Thu May 29 10:06:18 2014 (r266831) +++ head/sys/mips/conf/BERI_DE4_BASE Thu May 29 10:46:09 2014 (r266832) @@ -40,3 +40,12 @@ device uart device miibus options DEVICE_POLLING +# +# USB support +# +#options USB_DEBUG +#options USB_REQ_DEBUG +#options USB_VERBOSE +device usb +device saf1761otg + Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Thu May 29 10:06:18 2014 (r266831) +++ head/sys/modules/usb/Makefile Thu May 29 10:46:09 2014 (r266832) @@ -44,7 +44,7 @@ MAKE+=" DEBUG_FLAGS+=-DUSB_REQ_DEBUG" SUBDIR = usb SUBDIR += ${_dwc_otg} ehci ${_musb} ohci uhci xhci ${_uss820dci} ${_at91dci} \ - ${_atmegadci} ${_avr32dci} ${_rsu} ${_rsufw} + ${_atmegadci} ${_avr32dci} ${_rsu} ${_rsufw} ${_saf1761otg} SUBDIR += ${_rum} ${_run} ${_runfw} ${_uath} upgt usie ural ${_zyd} ${_urtw} SUBDIR += ${_urtwn} ${_urtwnfw} SUBDIR += atp uhid ukbd ums udbp ufm uep wsp @@ -96,4 +96,8 @@ _urtw= urtw _avr32dci= avr32dci .endif +.if ${MACHINE_CPUARCH} == "mips" +_saf1761otg= saf1761otg +.endif + .include Modified: head/sys/modules/usb/saf1761otg/Makefile ============================================================================== --- head/sys/modules/usb/saf1761/Makefile Fri May 16 15:50:21 2014 (r266244) +++ head/sys/modules/usb/saf1761otg/Makefile Thu May 29 10:46:09 2014 (r266832) @@ -33,7 +33,7 @@ S= ${.CURDIR}/../../.. .PATH: $S/dev/usb/controller -KMOD= saf1761 +KMOD= saf1761otg SRCS= bus_if.h device_if.h usb_if.h \ opt_bus.h opt_usb.h ofw_bus_if.h \ saf1761_otg.c saf1761_otg_fdt.c \ From owner-svn-src-head@FreeBSD.ORG Thu May 29 11:05:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9CEAD3B4; Thu, 29 May 2014 11:05:15 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E8FE2CED; Thu, 29 May 2014 11:05:15 +0000 (UTC) Received: from laptop015.home.selasky.org (c113.sec.cl.cam.ac.uk [128.232.18.113]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id CD00B1FE026; Thu, 29 May 2014 13:05:14 +0200 (CEST) Message-ID: <53871493.2010502@selasky.org> Date: Thu, 29 May 2014 13:05:55 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Mark R V Murray Subject: Re: svn commit: r266083 - in head/sys/arm: arm include References: <201405141911.s4EJBFZZ097826@svn.freebsd.org> <537D0952.2040001@selasky.org> <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org> In-Reply-To: <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 11:05:15 -0000 On 05/22/14 09:09, Mark R V Murray wrote: > > On 21 May 2014, at 21:15, Hans Petter Selasky wrote: > >> On 05/14/14 21:11, Mark Murray wrote: >>> Author: markm >>> Date: Wed May 14 19:11:15 2014 >>> New Revision: 266083 >>> URL: http://svnweb.freebsd.org/changeset/base/266083 >>> >>> Log: >>> Give suitably-endowed ARMs a register similar to the x86 TSC register. >>> >> >> Hi, >> >> Regression issue: >> This commit prevents RPI-B from booting. > > Thanks, I’ll look at it ASAP. > > M > Any news on this issue? --HPS From owner-svn-src-head@FreeBSD.ORG Thu May 29 11:11:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA9316F5; Thu, 29 May 2014 11:11:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A77EE2DAF; Thu, 29 May 2014 11:11:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TBBJOh043739; Thu, 29 May 2014 11:11:19 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TBBJL5043738; Thu, 29 May 2014 11:11:19 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405291111.s4TBBJL5043738@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 29 May 2014 11:11:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266833 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 11:11:19 -0000 Author: hselasky Date: Thu May 29 11:11:19 2014 New Revision: 266833 URL: http://svnweb.freebsd.org/changeset/base/266833 Log: Add some more spinlocks to protect the state of the USB transfer queue. Rename some functions to indicate locking requirements. MFC after: 1 week Modified: head/sys/dev/usb/controller/dwc_otg.c Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Thu May 29 10:46:09 2014 (r266832) +++ head/sys/dev/usb/controller/dwc_otg.c Thu May 29 11:11:19 2014 (r266833) @@ -142,7 +142,7 @@ static void dwc_otg_device_done(struct u static void dwc_otg_do_poll(struct usb_bus *); static void dwc_otg_standard_done(struct usb_xfer *); static void dwc_otg_root_intr(struct dwc_otg_softc *); -static void dwc_otg_interrupt_poll(struct dwc_otg_softc *); +static void dwc_otg_interrupt_poll_locked(struct dwc_otg_softc *); static void dwc_otg_host_channel_disable(struct dwc_otg_softc *, uint8_t); /* @@ -2245,7 +2245,7 @@ done: } static uint8_t -dwc_otg_xfer_do_complete(struct dwc_otg_softc *sc, struct usb_xfer *xfer) +dwc_otg_xfer_do_complete_locked(struct dwc_otg_softc *sc, struct usb_xfer *xfer) { struct dwc_otg_td *td; @@ -2349,7 +2349,7 @@ dwc_otg_host_channel_disable(struct dwc_ } static uint8_t -dwc_otg_update_host_transfer_schedule(struct dwc_otg_softc *sc) +dwc_otg_update_host_transfer_schedule_locked(struct dwc_otg_softc *sc) { TAILQ_HEAD(, usb_xfer) head; struct usb_xfer *xfer; @@ -2519,7 +2519,7 @@ dwc_otg_update_host_transfer_schedule(st } static void -dwc_otg_interrupt_poll(struct dwc_otg_softc *sc) +dwc_otg_interrupt_poll_locked(struct dwc_otg_softc *sc) { struct usb_xfer *xfer; uint32_t temp; @@ -2620,19 +2620,19 @@ repeat: if (sc->sc_flags.status_device_mode == 0 && sc->sc_xfer_complete == 0) { /* update host transfer schedule, so that new transfers can be issued */ - if (dwc_otg_update_host_transfer_schedule(sc)) + if (dwc_otg_update_host_transfer_schedule_locked(sc)) goto repeat; } } static void -dwc_otg_interrupt_complete(struct dwc_otg_softc *sc) +dwc_otg_interrupt_complete_locked(struct dwc_otg_softc *sc) { struct usb_xfer *xfer; repeat: /* scan for completion events */ TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) { - if (dwc_otg_xfer_do_complete(sc, xfer)) + if (dwc_otg_xfer_do_complete_locked(sc, xfer)) goto repeat; } } @@ -2677,6 +2677,8 @@ dwc_otg_filter_interrupt(void *arg) int retval = FILTER_HANDLED; uint32_t status; + USB_BUS_SPIN_LOCK(&sc->sc_bus); + /* read and clear interrupt status */ status = DWC_OTG_READ_4(sc, DOTG_GINTSTS); @@ -2701,10 +2703,8 @@ dwc_otg_filter_interrupt(void *arg) } } - USB_BUS_SPIN_LOCK(&sc->sc_bus); - /* poll FIFOs, if any */ - dwc_otg_interrupt_poll(sc); + dwc_otg_interrupt_poll_locked(sc); if (sc->sc_xfer_complete != 0) retval = FILTER_SCHEDULE_THREAD; @@ -2901,15 +2901,14 @@ dwc_otg_interrupt(void *arg) sc->sc_xfer_complete = 0; /* complete FIFOs, if any */ - dwc_otg_interrupt_complete(sc); + dwc_otg_interrupt_complete_locked(sc); if (sc->sc_flags.status_device_mode == 0) { /* update host transfer schedule, so that new transfers can be issued */ - if (dwc_otg_update_host_transfer_schedule(sc)) - dwc_otg_interrupt_poll(sc); + if (dwc_otg_update_host_transfer_schedule_locked(sc)) + dwc_otg_interrupt_poll_locked(sc); } } - USB_BUS_SPIN_UNLOCK(&sc->sc_bus); USB_BUS_UNLOCK(&sc->sc_bus); } @@ -3274,12 +3273,13 @@ dwc_otg_start_standard_chain(struct usb_ * endpoint interrupts. Else wait for SOF interrupt in host * mode. */ + USB_BUS_SPIN_LOCK(&sc->sc_bus); + if (sc->sc_flags.status_device_mode != 0) { dwc_otg_xfer_do_fifo(sc, xfer); - if (dwc_otg_xfer_do_complete(sc, xfer)) - return; + if (dwc_otg_xfer_do_complete_locked(sc, xfer)) + goto done; } - USB_BUS_SPIN_LOCK(&sc->sc_bus); /* put transfer on interrupt queue */ usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer); @@ -3456,6 +3456,8 @@ dwc_otg_device_done(struct usb_xfer *xfe DPRINTFN(9, "xfer=%p, endpoint=%p, error=%d\n", xfer, xfer->endpoint, error); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + if (xfer->flags_int.usb_mode == USB_MODE_DEVICE) { /* Interrupts are cleared by the interrupt handler */ } else { @@ -3470,6 +3472,8 @@ dwc_otg_device_done(struct usb_xfer *xfe } /* dequeue transfer and start next transfer */ usbd_transfer_done(xfer, error); + + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void @@ -3497,6 +3501,8 @@ dwc_otg_set_stall(struct usb_device *ude sc = DWC_OTG_BUS2SC(udev->bus); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + /* get endpoint address */ ep_no = ep->edesc->bEndpointAddress; @@ -3525,14 +3531,15 @@ dwc_otg_set_stall(struct usb_device *ude /* dump data */ dwc_otg_common_rx_ack(sc); /* poll interrupt */ - dwc_otg_interrupt_poll(sc); - dwc_otg_interrupt_complete(sc); + dwc_otg_interrupt_poll_locked(sc); + dwc_otg_interrupt_complete_locked(sc); } } + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void -dwc_otg_clear_stall_sub(struct dwc_otg_softc *sc, uint32_t mps, +dwc_otg_clear_stall_sub_locked(struct dwc_otg_softc *sc, uint32_t mps, uint8_t ep_no, uint8_t ep_type, uint8_t ep_dir) { uint32_t reg; @@ -3590,8 +3597,8 @@ dwc_otg_clear_stall_sub(struct dwc_otg_s } /* poll interrupt */ - dwc_otg_interrupt_poll(sc); - dwc_otg_interrupt_complete(sc); + dwc_otg_interrupt_poll_locked(sc); + dwc_otg_interrupt_complete_locked(sc); } static void @@ -3612,15 +3619,19 @@ dwc_otg_clear_stall(struct usb_device *u /* get softc */ sc = DWC_OTG_BUS2SC(udev->bus); + USB_BUS_SPIN_LOCK(&sc->sc_bus); + /* get endpoint descriptor */ ed = ep->edesc; /* reset endpoint */ - dwc_otg_clear_stall_sub(sc, + dwc_otg_clear_stall_sub_locked(sc, UGETW(ed->wMaxPacketSize), (ed->bEndpointAddress & UE_ADDR), (ed->bmAttributes & UE_XFERTYPE), (ed->bEndpointAddress & (UE_DIR_IN | UE_DIR_OUT))); + + USB_BUS_SPIN_UNLOCK(&sc->sc_bus); } static void @@ -3891,12 +3902,12 @@ dwc_otg_do_poll(struct usb_bus *bus) USB_BUS_LOCK(&sc->sc_bus); USB_BUS_SPIN_LOCK(&sc->sc_bus); - dwc_otg_interrupt_poll(sc); - dwc_otg_interrupt_complete(sc); + dwc_otg_interrupt_poll_locked(sc); + dwc_otg_interrupt_complete_locked(sc); if (sc->sc_flags.status_device_mode == 0) { /* update host transfer schedule, so that new transfers can be issued */ - if (dwc_otg_update_host_transfer_schedule(sc)) - dwc_otg_interrupt_poll(sc); + if (dwc_otg_update_host_transfer_schedule_locked(sc)) + dwc_otg_interrupt_poll_locked(sc); } USB_BUS_SPIN_UNLOCK(&sc->sc_bus); USB_BUS_UNLOCK(&sc->sc_bus); From owner-svn-src-head@FreeBSD.ORG Thu May 29 11:13:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D9038B0; Thu, 29 May 2014 11:13:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4C872DCB; Thu, 29 May 2014 11:13:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TBDe3k045866; Thu, 29 May 2014 11:13:40 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TBDe37045861; Thu, 29 May 2014 11:13:40 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405291113.s4TBDe37045861@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 29 May 2014 11:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266834 - in head/sys: arm/broadcom/bcm2835 arm/rockchip conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 11:13:41 -0000 Author: hselasky Date: Thu May 29 11:13:40 2014 New Revision: 266834 URL: http://svnweb.freebsd.org/changeset/base/266834 Log: Factor out kernel configuration for DWC OTG FDT attach code. Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 head/sys/arm/rockchip/files.rk30xx head/sys/conf/files Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm2835 Thu May 29 11:11:19 2014 (r266833) +++ head/sys/arm/broadcom/bcm2835/files.bcm2835 Thu May 29 11:13:40 2014 (r266834) @@ -13,7 +13,6 @@ arm/broadcom/bcm2835/bcm2835_sdhci.c op arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi arm/broadcom/bcm2835/bcm2835_systimer.c standard arm/broadcom/bcm2835/bcm2835_wdog.c standard -dev/usb/controller/dwc_otg_fdt.c optional dwcotg arm/arm/bus_space-v6.c standard arm/arm/bus_space_generic.c standard Modified: head/sys/arm/rockchip/files.rk30xx ============================================================================== --- head/sys/arm/rockchip/files.rk30xx Thu May 29 11:11:19 2014 (r266833) +++ head/sys/arm/rockchip/files.rk30xx Thu May 29 11:13:40 2014 (r266834) @@ -18,5 +18,4 @@ arm/rockchip/rk30xx_pmu.c standard arm/rockchip/rk30xx_grf.c standard arm/rockchip/rk30xx_wdog.c standard arm/rockchip/rk30xx_gpio.c optional gpio -dev/usb/controller/dwc_otg_fdt.c optional dwcotg arm/rockchip/rk30xx_mp.c optional smp Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu May 29 11:11:19 2014 (r266833) +++ head/sys/conf/files Thu May 29 11:13:40 2014 (r266834) @@ -2305,6 +2305,7 @@ dev/usb/controller/at91dci_atmelarm.c op dev/usb/controller/musb_otg.c optional musb dev/usb/controller/musb_otg_atmelarm.c optional musb at91rm9200 dev/usb/controller/dwc_otg.c optional dwcotg +dev/usb/controller/dwc_otg_fdt.c optional dwcotg fdt dev/usb/controller/ehci.c optional ehci dev/usb/controller/ehci_pci.c optional ehci pci dev/usb/controller/ohci.c optional ohci From owner-svn-src-head@FreeBSD.ORG Thu May 29 12:29:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D13B7269; Thu, 29 May 2014 12:29:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5179243E; Thu, 29 May 2014 12:29:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TCTwGR080226; Thu, 29 May 2014 12:29:58 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TCTwHJ080225; Thu, 29 May 2014 12:29:58 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405291229.s4TCTwHJ080225@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 29 May 2014 12:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266835 - head/sys/dev/vt/hw/xboxfb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 12:29:58 -0000 Author: ray Date: Thu May 29 12:29:58 2014 New Revision: 266835 URL: http://svnweb.freebsd.org/changeset/base/266835 Log: Remove driver as unused. MFC after: 7 days Sponsored by: The FreeBSD Foundation Deleted: head/sys/dev/vt/hw/xboxfb/ From owner-svn-src-head@FreeBSD.ORG Thu May 29 13:09:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EBDE3D2E; Thu, 29 May 2014 13:09:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C85CD27D5; Thu, 29 May 2014 13:09:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TD9mQ5098011; Thu, 29 May 2014 13:09:48 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TD9me7098008; Thu, 29 May 2014 13:09:48 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405291309.s4TD9me7098008@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 29 May 2014 13:09:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266836 - head/usr.sbin/vidcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 13:09:49 -0000 Author: ray Date: Thu May 29 13:09:48 2014 New Revision: 266836 URL: http://svnweb.freebsd.org/changeset/base/266836 Log: o Teach vidcontrol(1) how to load vt(4) font. o Teach vidcontrol(1) to distinct which virtual terminal system is running now. o Load vt(4) fonts from different location. o Add $FreeBSD$ tag for path.h. Tested by: Claude Buisson MFC after: 7 days Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/vidcontrol/path.h head/usr.sbin/vidcontrol/vidcontrol.c Modified: head/usr.sbin/vidcontrol/path.h ============================================================================== --- head/usr.sbin/vidcontrol/path.h Thu May 29 12:29:58 2014 (r266835) +++ head/usr.sbin/vidcontrol/path.h Thu May 29 13:09:48 2014 (r266836) @@ -1,4 +1,8 @@ +/* $FreeBSD$ */ + #define KEYMAP_PATH "/usr/share/syscons/keymaps/" #define FONT_PATH "/usr/share/syscons/fonts/" #define SCRNMAP_PATH "/usr/share/syscons/scrnmaps/" +#define VT_KEYMAP_PATH "/usr/share/vt/keymaps/" +#define VT_FONT_PATH "/usr/share/vt/fonts/" Modified: head/usr.sbin/vidcontrol/vidcontrol.c ============================================================================== --- head/usr.sbin/vidcontrol/vidcontrol.c Thu May 29 12:29:58 2014 (r266835) +++ head/usr.sbin/vidcontrol/vidcontrol.c Thu May 29 13:09:48 2014 (r266836) @@ -45,9 +45,12 @@ static const char rcsid[] = #include #include #include +#include #include +#include #include #include +#include #include "path.h" #include "decode.h" @@ -78,6 +81,15 @@ static struct { struct video_info video_mode_info; } cur_info; +struct vt4font_header { + uint8_t magic[8]; + uint8_t width; + uint8_t height; + uint16_t pad; + uint32_t glyph_count; + uint32_t map_count[4]; +} __packed; + static int hex = 0; static int vesa_cols; static int vesa_rows; @@ -86,6 +98,7 @@ static int colors_changed; static int video_mode_changed; static int normal_fore_color, normal_back_color; static int revers_fore_color, revers_back_color; +static int vt4_mode = 0; static struct vid_info info; static struct video_info new_mode_info; @@ -115,7 +128,9 @@ init(void) if (ioctl(0, CONS_GETINFO, &cur_info.console_info) == -1) errc(1, errno, "getting console information"); - if (ioctl(0, GIO_SCRNMAP, &cur_info.screen_map) == -1) + /* vt(4) use unicode, so no screen mapping required. */ + if (vt4_mode == 0 && + ioctl(0, GIO_SCRNMAP, &cur_info.screen_map) == -1) errc(1, errno, "getting screen map"); if (ioctl(0, CONS_GET, &cur_info.video_mode_number) == -1) @@ -153,7 +168,8 @@ revert(void) fprintf(stderr, "\033[=%dH", cur_info.console_info.mv_rev.fore); fprintf(stderr, "\033[=%dI", cur_info.console_info.mv_rev.back); - ioctl(0, PIO_SCRNMAP, &cur_info.screen_map); + if (vt4_mode == 0) + ioctl(0, PIO_SCRNMAP, &cur_info.screen_map); if (cur_info.video_mode_number >= M_VESA_BASE) ioctl(0, _IO('V', cur_info.video_mode_number - M_VESA_BASE), @@ -179,7 +195,15 @@ revert(void) static void usage(void) { - fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", + if (vt4_mode) + fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", +"usage: vidcontrol [-CHPpx] [-b color] [-c appearance] [-f [size] file]", +" [-g geometry] [-h size] [-i adapter | mode]", +" [-M char] [-m on | off] [-r foreground background]", +" [-S on | off] [-s number] [-T xterm | cons25] [-t N | off]", +" [mode] [foreground [background]] [show]"); + else + fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", "usage: vidcontrol [-CdHLPpx] [-b color] [-c appearance] [-f [size] file]", " [-g geometry] [-h size] [-i adapter | mode] [-l screen_map]", " [-M char] [-m on | off] [-r foreground background]", @@ -188,6 +212,16 @@ usage(void) exit(1); } +/* Detect presence of vt(4). */ +static int +is_vt4(void) +{ + + if (sysctlbyname("kern.vt.deadtimer", NULL, NULL, NULL, 0) == 0) + return (1); + + return (0); +} /* * Retrieve the next argument from the command line (for options that require @@ -349,6 +383,72 @@ fsize(FILE *file) return -1; } +static vfnt_map_t * +load_vt4mappingtable(unsigned int nmappings, FILE *f) +{ + vfnt_map_t *t; + unsigned int i; + + if (nmappings == 0) + return (NULL); + + t = malloc(sizeof *t * nmappings); + + if (fread(t, sizeof *t * nmappings, 1, f) != 1) { + perror("mappings"); + exit(1); + } + + for (i = 0; i < nmappings; i++) { + t[i].src = be32toh(t[i].src); + t[i].dst = be16toh(t[i].dst); + t[i].len = be16toh(t[i].len); + } + + return (t); +} + +static int +load_vt4font(FILE *f) +{ + struct vt4font_header fh; + static vfnt_t vfnt; + size_t glyphsize; + unsigned int i; + + if (fread(&fh, sizeof fh, 1, f) != 1) { + perror("file_header"); + return (1); + } + + if (memcmp(fh.magic, "VFNT0002", 8) != 0) { + fprintf(stderr, "Bad magic\n"); + return (1); + } + + for (i = 0; i < VFNT_MAPS; i++) + vfnt.map_count[i] = be32toh(fh.map_count[i]); + vfnt.glyph_count = be32toh(fh.glyph_count); + vfnt.width = fh.width; + vfnt.height = fh.height; + + glyphsize = howmany(vfnt.width, 8) * vfnt.height * vfnt.glyph_count; + vfnt.glyphs = malloc(glyphsize); + + if (fread(vfnt.glyphs, glyphsize, 1, f) != 1) { + perror("glyphs"); + return (1); + } + + for (i = 0; i < VFNT_MAPS; i++) + vfnt.map[i] = load_vt4mappingtable(vfnt.map_count[i], f); + + if (ioctl(STDIN_FILENO, PIO_VFONT, &vfnt) == -1) { + perror("PIO_VFONT"); + return (1); + } + return (0); +} /* * Load a font from file and set it. @@ -362,6 +462,7 @@ load_font(const char *type, const char * unsigned long io = 0; /* silence stupid gcc(1) in the Wall mode */ char *name, *fontmap, size_sufx[6]; const char *a[] = {"", FONT_PATH, NULL}; + const char *vt4a[] = {"", VT_FONT_PATH, NULL}; const char *b[] = {filename, NULL}; const char *c[] = {"", size_sufx, NULL}; const char *d[] = {"", ".fnt", NULL}; @@ -376,21 +477,32 @@ load_font(const char *type, const char * {8, 8, PIO_FONT8x8}, {0, 0, 0}}; - _info.size = sizeof(_info); - if (ioctl(0, CONS_GETINFO, &_info) == -1) { - revert(); - warn("failed to obtain current video mode parameters"); - return; - } + if (vt4_mode) { + size_sufx[0] = '\0'; + } else { + _info.size = sizeof(_info); + if (ioctl(0, CONS_GETINFO, &_info) == -1) { + revert(); + warn("failed to obtain current video mode parameters"); + return; + } - snprintf(size_sufx, sizeof(size_sufx), "-8x%d", _info.font_size); - fd = openguess(a, b, c, d, &name); + snprintf(size_sufx, sizeof(size_sufx), "-8x%d", _info.font_size); + } + fd = openguess((vt4_mode == 0) ? a : vt4a, b, c, d, &name); if (fd == NULL) { revert(); errx(1, "%s: can't load font file", filename); } + if (vt4_mode) { + if(load_vt4font(fd)) + warn("failed to load font \"%s\"", filename); + fclose(fd); + return; + } + if (type != NULL) { size = 0; if (sscanf(type, "%dx%d", &w, &h) == 2) { @@ -1199,9 +1311,12 @@ int main(int argc, char **argv) { char *font, *type, *termmode; + const char *opts; int dumpmod, dumpopt, opt; int reterr; + vt4_mode = is_vt4(); + init(); info.size = sizeof(info); @@ -1211,8 +1326,12 @@ main(int argc, char **argv) dumpmod = 0; dumpopt = DUMP_FBF; termmode = NULL; - while ((opt = getopt(argc, argv, - "b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:T:t:x")) != -1) + if (vt4_mode) + opts = "b:Cc:f:g:h:Hi:M:m:pPr:S:s:T:t:x"; + else + opts = "b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:T:t:x"; + + while ((opt = getopt(argc, argv, opts)) != -1) switch(opt) { case 'b': set_border_color(optarg); @@ -1224,6 +1343,8 @@ main(int argc, char **argv) set_cursor_type(optarg); break; case 'd': + if (vt4_mode) + break; print_scrnmap(); break; case 'f': @@ -1255,9 +1376,13 @@ main(int argc, char **argv) show_info(optarg); break; case 'l': + if (vt4_mode) + break; load_scrnmap(optarg); break; case 'L': + if (vt4_mode) + break; load_default_scrnmap(); break; case 'M': From owner-svn-src-head@FreeBSD.ORG Thu May 29 13:35:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C890798; Thu, 29 May 2014 13:35:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 506C02A4C; Thu, 29 May 2014 13:35:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TDZEEd011068; Thu, 29 May 2014 13:35:14 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TDZEKw011067; Thu, 29 May 2014 13:35:14 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201405291335.s4TDZEKw011067@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 29 May 2014 13:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266837 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 13:35:14 -0000 Author: pluknet Date: Thu May 29 13:35:13 2014 New Revision: 266837 URL: http://svnweb.freebsd.org/changeset/base/266837 Log: mdoc: add missing paragraph macro. Modified: head/lib/libc/gen/sem_wait.3 Modified: head/lib/libc/gen/sem_wait.3 ============================================================================== --- head/lib/libc/gen/sem_wait.3 Thu May 29 13:09:48 2014 (r266836) +++ head/lib/libc/gen/sem_wait.3 Thu May 29 13:35:13 2014 (r266837) @@ -81,6 +81,7 @@ will fail if: .It Bq Er EINTR A signal interrupted this function. .El +.Pp Additionally, .Fn sem_trywait will fail if: From owner-svn-src-head@FreeBSD.ORG Thu May 29 13:41:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9A13BCB; Thu, 29 May 2014 13:41:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6A7F2B1F; Thu, 29 May 2014 13:41:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TDf89L014918; Thu, 29 May 2014 13:41:08 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TDf8Rt014915; Thu, 29 May 2014 13:41:08 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405291341.s4TDf8Rt014915@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 29 May 2014 13:41:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266838 - in head/share/vt: . fonts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 13:41:08 -0000 Author: ray Date: Thu May 29 13:41:07 2014 New Revision: 266838 URL: http://svnweb.freebsd.org/changeset/base/266838 Log: Add gallant vt(4) font as an example of font loading for vt(4). MFC after: 7 days Sponsored by: The FreeBSD Foundation Added: head/share/vt/ head/share/vt/Makefile (contents, props changed) head/share/vt/fonts/ head/share/vt/fonts/Makefile (contents, props changed) head/share/vt/fonts/gallant.fnt (contents, props changed) Added: head/share/vt/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/Makefile Thu May 29 13:41:07 2014 (r266838) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR= fonts + +.include Added: head/share/vt/fonts/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/fonts/Makefile Thu May 29 13:41:07 2014 (r266838) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +FILES= gallant.fnt + +FILESDIR= ${SHAREDIR}/vt/fonts + +NO_OBJ= + +.include Added: head/share/vt/fonts/gallant.fnt ============================================================================== Binary file. No diff available. From owner-svn-src-head@FreeBSD.ORG Thu May 29 14:39:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F30BE5E9; Thu, 29 May 2014 14:39:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C723920FC; Thu, 29 May 2014 14:39:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TEdPrZ039252; Thu, 29 May 2014 14:39:25 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TEdPa5039250; Thu, 29 May 2014 14:39:25 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405291439.s4TEdPa5039250@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 29 May 2014 14:39:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266839 - head/usr.sbin/kbdcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 14:39:26 -0000 Author: ray Date: Thu May 29 14:39:25 2014 New Revision: 266839 URL: http://svnweb.freebsd.org/changeset/base/266839 Log: Enable kbdcontrol(1) to use maps from vt(4) keymaps dir /usr/share/vt/keymaps if vt(4) is present. MFC after: 7 days Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/kbdcontrol/kbdcontrol.c head/usr.sbin/kbdcontrol/path.h Modified: head/usr.sbin/kbdcontrol/kbdcontrol.c ============================================================================== --- head/usr.sbin/kbdcontrol/kbdcontrol.c Thu May 29 13:41:07 2014 (r266838) +++ head/usr.sbin/kbdcontrol/kbdcontrol.c Thu May 29 14:39:25 2014 (r266839) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "path.h" #include "lex.h" @@ -141,6 +142,17 @@ static void set_keyrates(char *opt); static void show_kbd_info(void); static void usage(void) __dead2; +/* Detect presence of vt(4). */ +static int +is_vt4(void) +{ + + if (sysctlbyname("kern.vt.deadtimer", NULL, NULL, NULL, 0) == 0) + return (1); + + return (0); +} + static char * nextarg(int ac, char **av, int *indp, int oc) { @@ -785,10 +797,13 @@ load_keymap(char *opt, int dumponly) FILE *fd; int i, j; char *name, *cp; - char blank[] = "", keymap_path[] = KEYMAP_PATH, dotkbd[] = ".kbd"; + char blank[] = "", keymap_path[] = KEYMAP_PATH; + char vt_keymap_path[] = VT_KEYMAP_PATH, dotkbd[] = ".kbd"; char *prefix[] = {blank, blank, keymap_path, NULL}; char *postfix[] = {blank, dotkbd, NULL}; + if (is_vt4()) + prefix[2] = vt_keymap_path; cp = getenv("KEYMAP_PATH"); if (cp != NULL) asprintf(&(prefix[0]), "%s/", cp); Modified: head/usr.sbin/kbdcontrol/path.h ============================================================================== --- head/usr.sbin/kbdcontrol/path.h Thu May 29 13:41:07 2014 (r266838) +++ head/usr.sbin/kbdcontrol/path.h Thu May 29 14:39:25 2014 (r266839) @@ -1,4 +1,8 @@ +/* $FreeBSD$ */ + #define KEYMAP_PATH "/usr/share/syscons/keymaps/" #define FONT_PATH "/usr/share/syscons/fonts/" #define SCRNMAP_PATH "/usr/share/syscons/scrnmaps/" +#define VT_KEYMAP_PATH "/usr/share/vt/keymaps/" +#define VT_FONT_PATH "/usr/share/vt/fonts/" From owner-svn-src-head@FreeBSD.ORG Thu May 29 14:42:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D59ABB6; Thu, 29 May 2014 14:42:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1348521BE; Thu, 29 May 2014 14:42:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TEgQwU042766; Thu, 29 May 2014 14:42:26 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TEgQ5E042765; Thu, 29 May 2014 14:42:26 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405291442.s4TEgQ5E042765@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 29 May 2014 14:42:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266840 - head/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 14:42:27 -0000 Author: ray Date: Thu May 29 14:42:26 2014 New Revision: 266840 URL: http://svnweb.freebsd.org/changeset/base/266840 Log: Revert r266838 to not store fonts as binary file. Sponsored by: The FreeBSD Foundation Modified: Directory Properties: head/share/ (props changed) From owner-svn-src-head@FreeBSD.ORG Thu May 29 14:51:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 070D7E37; Thu, 29 May 2014 14:51:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E86C4228B; Thu, 29 May 2014 14:51:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TEpqBw047103; Thu, 29 May 2014 14:51:52 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TEpqwG047101; Thu, 29 May 2014 14:51:52 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201405291451.s4TEpqwG047101@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 29 May 2014 14:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266841 - head/share/vt/fonts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 14:51:53 -0000 Author: ray Date: Thu May 29 14:51:52 2014 New Revision: 266841 URL: http://svnweb.freebsd.org/changeset/base/266841 Log: Add gallant vt(4) font as an example of font loading for vt(4). MFC after: 7 days Sponsored by: The FreeBSD Foundation Added: head/share/vt/fonts/gallant.fnt.uu (contents, props changed) Deleted: head/share/vt/fonts/gallant.fnt Modified: head/share/vt/fonts/Makefile Modified: head/share/vt/fonts/Makefile ============================================================================== --- head/share/vt/fonts/Makefile Thu May 29 14:42:26 2014 (r266840) +++ head/share/vt/fonts/Makefile Thu May 29 14:51:52 2014 (r266841) @@ -2,8 +2,12 @@ FILES= gallant.fnt -FILESDIR= ${SHAREDIR}/vt/fonts +CLEANFILES+= ${FILES} -NO_OBJ= +.SUFFIXES: .uu +.uu: + uudecode < ${.IMPSRC} + +FILESDIR= ${SHAREDIR}/vt/fonts .include Added: head/share/vt/fonts/gallant.fnt.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/fonts/gallant.fnt.uu Thu May 29 14:51:52 2014 (r266841) @@ -0,0 +1,192 @@ +# $FreeBSD$ +begin 644 gallant.fnt +M5D9.5#`P,#(,%@``````OP````(````````````````````````````````` +M```````````````````````````````````````````````&``8`!@`&``8` +M!@`&``8`!@`&``8```````8`!@```````````````````!F`&8`9@!F`&8`9 +M@````````````````````````````````````````````S`#,`,P!F`?\!_P +M#,`,P!F`&8!_P'_`,P!F`&8````````````````````&`!^`/\!FX&9@9@`^ +M`!^`!\`&8`9@9F!_P#^`!@```````````````````#A@1,!$P$6`.8`#``,` +M!@`,``P`&<`:(#(@,B!AP```````````````````!P`/@!C`&,`8P`^`'@`^ +M`'<`8V!AX&'`88`_X!Y@```````````````````,`!X`'@`&``8`#``8`!`` +M``````````````````````````````````````#``8`#@`,`!P`&``8`!@`& +M``8`!P`#``.``8``P```````````````````,``8`!P`#``.``8`!@`&``8` +M!@`.``P`'``8`#````````````````````````````````\`!@!F8';@&8`` +M`!F`=N!F8`8`#P`````````````````````````````````&``8`!@`&`'_@ +M?^`&``8`!@`&```````````````````````````````````````````````` +M````#``>`!X`!@`&``P`&``0``````````````````````````````!_X'_@ +M```````````````````````````````````````````````````````````, +M`!X`'@`,`````````````````````&``P`#``8`!@`,``P`&``P`#``8`!@` +M,``P`&`````````````````````'``^`$8`0P##`,,`PP##`,,`PP##`,(`8 +M@!\`#@````````````````````(`!@`.`!X`-@`&``8`!@`&``8`!@`&``8` +M!@`_P```````````````````'P`_@&'`0,``P`#``,`!@`,`!@`,`!@`,"!_ +MX'_@```````````````````/@!_`(.!`8`!@`.`'P`_``.``8`!@0&!@0#^` +M'P````````````````````&``X`#@`6`!8`)@`F`$8`1@"&`/^!_X`&``8`! +M@```````````````````#\`/P!``$``@`#^`,<``X`!@`&``8$!@8&`PP!^` +M```````````````````'``P`&``P`#``8`!G@&_`<.!@8&!@8&!P0#^`'P`` +M`````````````````!_@/^!@0`!``,``@`"``8`!``$``P`"``(`!@`$```` +M````````````````#P`1@##`,,`PP!B`#0`&``L`$8`PP##`,,`8@`\````` +M```````````````/@!'`(.!@8&!@8&!PX#]@'F``8`#``,`!@`<`/``````` +M```````````````````````````,`!X`'@`,```````,`!X`'@`,```````` +M````````````````````````````#``>`!X`#```````#``>`!X`!@`&``P` +M&``0`````````````````````&`!P`<`'@!X`'@`'@`'``'``&`````````` +M````````````````````````````?\!_P`````!_P'_````````````````` +M`````````````````````&``.``>``>``>`!X`>`'@`X`&`````````````` +M```````/`!^`.<`@P`#``,`!@`,`!@`,``P```````P`#``````````````` +M``````````````^`/\`P8&!@9R!OH&R@;*!GX&``,``_X`_@```````````` +M```````&``8`"P`+``D`$8`1@!"`/\`@P"!`0&!`8.#P```````````````` +M`````/\`8(!@P&#`8,!A@'^`8,!@8&!@8&!@8&#`_X`````````````````` +M````#\`08"`@(`!@`&``8`!@`&``8``@`#`@&$`/@``````````````````` +M``#_`&'`8,!@8&!@8&!@8&!@8&!@8&!@8$!A@/X````````````````````` +M`'_`,$`P0#``,``P@#^`,(`P`#``,``P(#`@?^`````````````````````` +M?\`P0#!`,``P`#"`/X`P@#``,``P`#``,`!X```````````````````````/ +MP!!@("`@`&``8`!@`&``8?!@8"!@,&`88`^``````````````````````/#P +M8&!@8&!@8&!@8'_@8&!@8&!@8&!@8&!@\/``````````````````````'X`& +M``8`!@`&``8`!@`&``8`!@`&``8`!@`?@``````````````````````?@`8` +M!@`&``8`!@`&``8`!@`&``8`!@`&``8`!@`&``0`.``P`````````/#@88!C +M`&8`;`!X`'@`?`!N`&<`8X!AP&#@\'``````````````````````>``P`#`` +M,``P`#``,``P`#``,``P`#`@,"!_X`````````````````````#@<&#@<.!P +MX'#@66!98%E@36!.8$Y@1&!$8.3P`````````````````````,!P8"!P('@@ +M6"!,($8@1R!#($&@0.!`X$!@X#``````````````````````#P`1P"#`(&!@ +M8&!@8&!@8&!@8&`@0#!`&(`/``````````````````````!_@##`,&`P8#!@ +M,,`W@#``,``P`#``,``P`'@```````````````````````\`$<`@P"!@8&!@ +M8&!@8&!@8&!@,$`X0!^`#@`?`".0`>``````````````_P!A@&#`8,!@P&"` +M?P!\`&X`9P!C@&'`8.#P<``````````````````````?X#!@8"!@('``/``> +M``>``<``X$!@0&!@P'^``````````````````````'_@1B`&``8`!@`&``8` +M!@`&``8`!@`&``8`'X``````````````````````\'!@(&`@8"!@(&`@8"!@ +M(&`@8"!@('!`/\`?@`````````````````````#@X&!`,(`P@#"`&0`9`!D` +M#``.``X`!``$``0``````````````````````/[P9B!F(&8@=B!W0#-`-T`[ +MP#N`&8`9@!F`&8``````````````````````\'!@(#!`.(`8@`T`!@`&``L` +M$8`1P"#`0&#@\`````````````````````#P<&`@,$`8@!B`#0`&``8`!@`& +M``8`!@`&``\``````````````````````#_@(,``P`&``8`#``,`!@`&``P` +M#``8`!@@/^````````````````````?`!\`&``8`!@`&``8`!@`&``8`!@`& +M``8`!\`'P```````````````````8`!@`#``,``8`!@`#``,``8``P`#``&` +M`8``P`#```````````````````!\`'P`#``,``P`#``,``P`#``,``P`#``, +M`'P`?`````````````````````0`#@`;`#&`8,`````````````````````` +M```````````````````````````````````````````````````````````` +M``````#_X/_@```````````!``,`!@`&``>`!X`#```````````````````` +M```````````````````````````````````/@!C`$,`#P!S`,,`PP##`.<`> +MX```````````````````(`!@`.``8`!@`&>`;\!PX&!@8&!@8&!@<&!XP$^` +M````````````````````````````````'X`QP"#`8`!@`&``8`!P0##`'X`` +M``````````````````!@`.``8`!@`&`/8#'@(.!@8&!@8&!@8'#@.6`><``` +M``````````````````````````````\`,,!@8&!@?^!@`&``,``88`^````` +M```````````````#@`3`!,`,``P`#``,`!^`#``,``P`#``,``P`'@`````` +M```````````````````````````?(#'@8,!@P&#`,8`_`&``?\`_X"!@0"!` +M('_`/X``````$``P`'``,``P`#>`.<`PP##`,,`PP##`,,`PP'G@```````` +M``````````````8`!@``````'@`&``8`!@`&``8`!@`&``8`'X`````````` +M`````````````,``P``````#P`#``,``P`#``,``P`#``,``P"#`,,`X@!\` +M#@``````8`#@`&``8`!@`&'`8P!F`'P`>`!\`&X`9P!C@/'@```````````` +M```````>``8`!@`&``8`!@`&``8`!@`&``8`!@`&``8`'X`````````````` +M``````````````````#=P&[@9F!F8&9@9F!F8&9@9F#O<``````````````` +M`````````````````">`><`PP##`,,`PP##`,,`PP'G@```````````````` +M````````````````#X`1P"#@8&!@8&!@8&!P0#B`'P`````````````````` +M``````````````#O@''`8.!@8&!@8&!@8&!`<(!_`&``8`!@`&``\``````` +M``````````````\@$>`@X&!@8&!@8&!@<&`XX!_@`&``8`!@`&``\``````` +M``````````````````````````````````` +M```````````?P##`,$`X`!X`!X`!P"#`,,`_@``````````````````````` +M``0`!``,`'_`#``,``P`#``,``P`#"`.0`>````````````````````````` +M````````>>`PP##`,,`PP##`,,`PP#G`'F`````````````````````````` +M``````#P<&`@,$`P0!B`&(`-``T`!@`&```````````````````````````` +M`````/]P9B!F(&8@-T`[0#M`&8`9@!F````````````````````````````` +M````^/!P0#B`'0`.``<`"X`1P"#@\?`````````````````````````````` +M``#P\&`@,$`P0!B`&(`-``T`!@`&``0`#``(`'@`<``````````````````` +M`'_@8.!!P`.`!P`.`!P`."!P8'_@```````````````````!P`,``P`!@`&` +M`8`#``<``P`!@`&``8`#``,``<````````````````````8`!@`&``8`!@`& +M``8`!@`&``8`!@`&``8`!@`&``8`!@`&``8`!@``````.``,``P`&``8`!@` +M#``.``P`&``8`!@`#``,`#@````````````````````````````````````` +M````'"`^8#;`9\!#@```````````````````JJ!54*J@55"JH%50JJ!54*J@ +M55"JH%50JJ!54*J@55"JH%50JJ!54*J@55`````````&``8```````8`!@`& +M``8`!@`&``8`!@`&``8`!@````````````````````$``0`#``(`'P`W@"6` +M9`!L`&@`>(`Y@!\`$``P`"``(``````````&``P`$``0`#``,``P`#X`?``8 +M`!@`&``8`#\@/^`QP```````````````````````````8"!W0#N`$<`PP##` +M.(`=P"[@0&```````````````````````````/!P8"`P0!B`&(`-``8`/\`& +M`#_`!@`&``8`#P````````````````````8`!@`&``8`!@`&``8`!@`&```` +M```&``8`!@`&``8`!@`&``8`!@``````#^`88#`@."`>`!^`,`0P`;`!L`&P`;`!L`&P`;````````` +M````````````````````````````````!@`/``\`!@`````````````````` +M``````````````````````````````````````````````````(``P`!@`F` +M!P`````````&``X`#@`&``8`!@`&``8`#P`````````````````````````` +M``````````<`"X`1P##`,,`X@!T`#@``````/^!_P``````````````````` +M`````````````````````&8`,P`9@`S`"(`1`"(`1``````````````````` +M`!@`.``X`!@`&"`88!C`&8`_0`;`#<`9P#+`9,!'X`#``,`````````````` +M&``X`#@`&``8(!A@&,`9@#_`!^`/8!I@,,!A@$,``^`#X``````````````X +M`'P`3``,`!@@#&!,P'V`.T`&P`W`&<`RP&3`1^``P`#````````````````` +M```#``,```````,``P`&``P`&``P`#``,$`YP!^`#P```````````!P`#P`# +M@`8`!@`+``L`"0`1@!&`$(`_P"#`($!`8$!@X/```````````````X`/`!P` +M!@`&``L`"P`)`!&`$8`0@#_`(,`@0$!@0&#@\``````````````&``\`&8`& +M``8`"P`+``D`$8`1@!"`/\`@P"!`0&!`8.#P``````````````S`'X`S``8` +M!@`+``L`"0`1@!&`$(`_P"#`($!`8$!@X/``````````````&8`9@```!@`& +M``L`"P`)`!&`$8`0@#_`(,`@0$!@0&#@\``````````````&``\`&8`/``8` +M"P`+``D`$8`1@!"`/\`@P"!`0&!`8.#P``````````````````````_@#B`6 +M(!8`%@`60"?`)D`^`"8`1@!&$$80Y_``````````````````````#\`08"`@ +M(`!@`&``8`!@`&``8``@`#`@&$`/@`(``P`!@`F`!P`<``\``X!_P#!`,$`P +M`#``,(`_@#"`,``P`#``,"`P('_@``````````````.`#P`<`'_`,$`P0#`` +M,``P@#^`,(`P`#``,``P(#`@?^``````````````!@`/`!F`?\`P0#!`,``P +M`#"`/X`P@#``,``P`#`@,"!_X``````````````9@!F```!_P#!`,$`P`#`` +M,(`_@#"`,``P`#``,"`P('_@`````````````!P`#P`#@!^`!@`&``8`!@`& +M``8`!@`&``8`!@`&``8`'X```````````````X`/`!P`'X`&``8`!@`&``8` +M!@`&``8`!@`&``8`!@`?@``````````````&``\`&8`?@`8`!@`&``8`!@`& +M``8`!@`&``8`!@`&`!^``````````````!F`&8```!^`!@`&``8`!@`&``8` +M!@`&``8`!@`&``8`'X``````````````````````_P!AP&#`8&!@8&!@^&#X +M8&!@8&!@8&!`88#^```````````````,P!^`,P#`<&`@<"!X(%@@3"!&($<@ +M0R!!H$#@0.!`8.`P`````````````!P`#P`#@`\`$<`@P"!@8&!@8&!@8&!@ +M8&!@($`P0!B`#P```````````````X`/`!P`#P`1P"#`(&!@8&!@8&!@8&!@ +M8&`@0#!`&(`/```````````````&``\`&8`/`!'`(,`@8&!@8&!@8&!@8&!@ +M8"!`,$`8@`\```````````````S`'X`S``\`$<`@P"!@8&!@8&!@8&!@8&!@ +M($`P0!B`#P``````````````&8`9@```#P`1P"#`(&!@8&!@8&!@8&!@8&`@ +M0#!`&(`/`````````````````````````````````&!@,,`9@`\`!@`/`!F` +M,,!@8```````````````````````8`_`$<`AP"'@8V!C8&9@;&!L8'A@.$`P +M0#B`;P``````````````'``/``.`\'!@(&`@8"!@(&`@8"!@(&`@8"!@('!` +M/\`?@``````````````#@`\`'`#P<&`@8"!@(&`@8"!@(&`@8"!@(&`@<$`_ +MP!^```````````````8`#P`9@/!P8"!@(&`@8"!@(&`@8"!@(&`@8"!P0#_` +M'X``````````````&8`9@```\'!@(&`@8"!@(&`@8"!@(&`@8"!@('!`/\`? +M@``````````````#@`\`'`#P<&`@,$`8@!B`#0`&``8`!@`&``8`!@`&``\` +M`````````````````````'@`,``P`#^`,,`P8#!@,&`P8##`/X`P`#``>``` +M``````````````````\`&8`9@#&`,8`S@#8`-@`V`#.`,<`PX#1@-F!WP``` +M```````````````````<``\``X````^`&,`0P`/`',`PP##`,,`YP![@```` +M``````````````````.`#P`<````#X`8P!#``\`X``````` +M```````````````,P!^`,P````^`&,`0P`/`',`PP##`,,`YP![@```````` +M`````````````!F`&8``````#X`8P!#``\`X``````````` +M`````````````````````!^`-D`F8`Y@/^!F`&8`9@!G8#_````````````` +M````````````````````'X`QP"#`8`!@`&``8`!P0##`'X`"``,``8`)@`<` +M````````'``/``.````/`##`8&!@8'_@8`!@`#``&&`/@``````````````` +M```````#@`\`'`````\`,,!@8&!@?^!@`&``,``88`^````````````````` +M``````8`#P`9@```#P`PP&!@8&!_X&``8``P`!A@#X`````````````````` +M````&8`9@``````/`##`8&!@8'_@8`!@`#``&&`/@``````````````````` +M```<``\``X```!X`!@`&``8`!@`&``8`!@`&`!^````````````````````` +M``.`#P`<````'@`&``8`!@`&``8`!@`&``8`'X`````````````````````` +M!@`/`!F````>``8`!@`&``8`!@`&``8`!@`?@``````````````````````9 +M@!F``````!X`!@`&``8`!@`&``8`!@`&`!^````````````````````PP!^` +M!@`?`#&``<`/P!#@(.!@8&!@8&!P0#B`'P``````````````````````#,`? +M@#,````G@'G`,,`PP##`,,`PP##`,,!YX``````````````````````<``\` +M`X````^`$<`@X&!@8&!@8&!@<$`X@!\```````````````````````.`#P`< +M````#X`1P"#@8&!@8&!@8&!P0#B`'P``````````````````````!@`/`!F` +M```/@!'`(.!@8&!@8&!@8'!`.(`?```````````````````````,P!^`,P`` +M``^`$<`@X&!@8&!@8&!@<$`X@!\``````````````````````!F`&8`````` +M#X`1P"#@8&!@8&!@8&!P0#B`'P`````````````````````````````````& +M``8``````'_@?^``````!@`&``````````````````````````````````_@ +M$<`AX&-@9F!F8&Q@>$`X@'\``````````````````````!P`#P`#@```>>`P +MP##`,,`PP##`,,`PP#G`'F```````````````````````X`/`!P```!YX##` +M,,`PP##`,,`PP##`.<`>8``````````````````````&``\`&8```'G@,,`P +MP##`,,`PP##`,,`YP!Y@`````````````````````!F`&8``````>>`PP##` +M,,`PP##`,,`PP#G`'F```````````````````````X`/`!P```#P\&`@,$`P +M0!B`&(`-``T`!@`&``0`#``(`'@`<```````X`!@`&``8`!@`&^`< Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32FC9C43; Thu, 29 May 2014 15:23:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20BC62577; Thu, 29 May 2014 15:23:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TFNbro061962; Thu, 29 May 2014 15:23:37 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TFNbO8061961; Thu, 29 May 2014 15:23:37 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201405291523.s4TFNbO8061961@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 29 May 2014 15:23:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266842 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 15:23:38 -0000 Author: jilles Date: Thu May 29 15:23:37 2014 New Revision: 266842 URL: http://svnweb.freebsd.org/changeset/base/266842 Log: netinet/in.h: Expose htonl(), htons(), ntohl() and ntohs() in strict POSIX mode. Put the htonl(), htons(), ntohl() and ntohs() declarations under __POSIX_VISIBLE >= 200112. POSIX.1-2001 and newer require these to be exposed from (as well as ). Note that it may be unnecessary to check __POSIX_VISIBLE >= 200112 because older versions of POSIX and the C standard do not define this header. However, other places in the same file already perform the check. PR: 188316 Submitted by: Christian Neukirchen Modified: head/sys/netinet/in.h Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Thu May 29 14:51:52 2014 (r266841) +++ head/sys/netinet/in.h Thu May 29 15:23:37 2014 (r266842) @@ -100,7 +100,7 @@ struct sockaddr_in { char sin_zero[8]; }; -#if !defined(_KERNEL) && __BSD_VISIBLE +#if !defined(_KERNEL) && __POSIX_VISIBLE >= 200112 #ifndef _BYTEORDER_PROTOTYPED #define _BYTEORDER_PROTOTYPED @@ -120,7 +120,7 @@ __END_DECLS #define ntohs(x) __ntohs(x) #endif -#endif /* !_KERNEL && __BSD_VISIBLE */ +#endif /* !_KERNEL && __POSIX_VISIBLE >= 200112 */ #if __POSIX_VISIBLE >= 200112 #define IPPROTO_IPV6 41 /* IP6 header */ From owner-svn-src-head@FreeBSD.ORG Thu May 29 15:43:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FD203E4; Thu, 29 May 2014 15:43:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DD18274D; Thu, 29 May 2014 15:43:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TFhqMU070777; Thu, 29 May 2014 15:43:52 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TFhq4G070776; Thu, 29 May 2014 15:43:52 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201405291543.s4TFhq4G070776@svn.freebsd.org> From: Glen Barber Date: Thu, 29 May 2014 15:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266843 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 15:43:52 -0000 Author: gjb Date: Thu May 29 15:43:51 2014 New Revision: 266843 URL: http://svnweb.freebsd.org/changeset/base/266843 Log: Fix a typo. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 29 15:23:37 2014 (r266842) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 29 15:43:51 2014 (r266843) @@ -312,7 +312,7 @@ &man.ps.1; change in r265229. The Blowfish &man.crypt.3; default format - has been changed tox + has been changed to $2b$. The &man.pmcstat.8; utility has been From owner-svn-src-head@FreeBSD.ORG Thu May 29 16:03:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41DE4A92; Thu, 29 May 2014 16:03:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 307A9291B; Thu, 29 May 2014 16:03:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TG39t7079732; Thu, 29 May 2014 16:03:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TG39BJ079731; Thu, 29 May 2014 16:03:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405291603.s4TG39BJ079731@svn.freebsd.org> From: John Baldwin Date: Thu, 29 May 2014 16:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266845 - head/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 16:03:09 -0000 Author: jhb Date: Thu May 29 16:03:08 2014 New Revision: 266845 URL: http://svnweb.freebsd.org/changeset/base/266845 Log: Reorganize this Makefile so that all the bsd.*.mk bits are in one section at the bottom. Reviewed by: imp Modified: head/sys/Makefile Modified: head/sys/Makefile ============================================================================== --- head/sys/Makefile Thu May 29 15:46:57 2014 (r266844) +++ head/sys/Makefile Thu May 29 16:03:08 2014 (r266845) @@ -1,15 +1,5 @@ # $FreeBSD$ -.if !(make(cscope) || make(cscope-clean) || make(cscope-hook) || make(TAGS) || \ - make(glimpse) || make(glimpse-clean)) -.include - -# The boot loader -.if ${MK_BOOT} != "no" -SUBDIR= boot -.endif -.endif - # Directories to include in cscope name file and TAGS. CSCOPEDIRS= boot bsm cam cddl compat conf contrib crypto ddb dev fs gdb \ geom gnu isa kern libkern modules net net80211 \ @@ -30,12 +20,6 @@ CSCOPE_ARCHDIR += x86 .endif .endif -# Loadable kernel modules - -.if defined(MODULES_WITH_WORLD) -SUBDIR+=modules -.endif - HTAGSFLAGS+= -at `awk -F= '/^RELEASE *=/{release=$2}; END {print "FreeBSD", release, "kernel"}' < conf/newvers.sh` # You need the devel/cscope port for this. @@ -85,4 +69,20 @@ glimpse: glimpse-clean: cd ${.CURDIR}; rm -f .glimpse_* +.if !(make(cscope) || make(cscope-clean) || make(cscope-hook) || make(TAGS) || \ + make(glimpse) || make(glimpse-clean)) +.include + +# The boot loader +.if ${MK_BOOT} != "no" +SUBDIR= boot +.endif + +# Loadable kernel modules + +.if defined(MODULES_WITH_WORLD) +SUBDIR+=modules +.endif + .include +.endif From owner-svn-src-head@FreeBSD.ORG Thu May 29 16:18:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E53F039C; Thu, 29 May 2014 16:18:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D38C42AA2; Thu, 29 May 2014 16:18:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TGIVtc085168; Thu, 29 May 2014 16:18:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TGIV0R085167; Thu, 29 May 2014 16:18:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405291618.s4TGIV0R085167@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 29 May 2014 16:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266846 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 16:18:32 -0000 Author: kib Date: Thu May 29 16:18:31 2014 New Revision: 266846 URL: http://svnweb.freebsd.org/changeset/base/266846 Log: When usermode loaded non-default segment selector into the %gs, correctly prepare KGSBASE msr to restore the user descriptor base on the last swapgs during return to usermode. Reported and tested by: peterj Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/exception.S Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Thu May 29 16:03:08 2014 (r266845) +++ head/sys/amd64/amd64/exception.S Thu May 29 16:18:31 2014 (r266846) @@ -721,21 +721,38 @@ ld_fsbase: pushfq cli movl $MSR_GSBASE,%ecx + /* Save current kernel %gs base into %r12d:%r13d */ rdmsr + movl %eax,%r12d + movl %edx,%r13d .globl ld_gs ld_gs: movw %si,%gs + /* Save user %gs base into %r14d:%r15d */ + rdmsr + movl %eax,%r14d + movl %edx,%r15d + /* Restore kernel %gs base */ + movl %r12d,%eax + movl %r13d,%edx wrmsr popfq + /* + * Restore user %gs base, either from PCB if used for TLS, or + * from the previously saved msr read. + */ + movl $MSR_KGSBASE,%ecx cmpw $KUG32SEL,%si jne 1f - movl $MSR_KGSBASE,%ecx movl PCB_GSBASE(%r8),%eax movl PCB_GSBASE+4(%r8),%edx + jmp ld_gsbase +1: + movl %r14d,%eax + movl %r15d,%edx .globl ld_gsbase ld_gsbase: - wrmsr -1: + wrmsr /* May trap if non-canonical, but only for TLS. */ .globl ld_es ld_es: movw TF_ES(%rsp),%es From owner-svn-src-head@FreeBSD.ORG Thu May 29 16:18:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9ECD44E1; Thu, 29 May 2014 16:18:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CF322AA7; Thu, 29 May 2014 16:18:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TGIki0085241; Thu, 29 May 2014 16:18:46 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TGIkdD085240; Thu, 29 May 2014 16:18:46 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201405291618.s4TGIkdD085240@svn.freebsd.org> From: Ed Maste Date: Thu, 29 May 2014 16:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266847 - head/tools/tools/vt/mkkfont X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 16:18:46 -0000 Author: emaste Date: Thu May 29 16:18:46 2014 New Revision: 266847 URL: http://svnweb.freebsd.org/changeset/base/266847 Log: Add missing , in converted font output Submitted by: Claude Buisson Modified: head/tools/tools/vt/mkkfont/mkkfont.c Modified: head/tools/tools/vt/mkkfont/mkkfont.c ============================================================================== --- head/tools/tools/vt/mkkfont/mkkfont.c Thu May 29 16:18:31 2014 (r266846) +++ head/tools/tools/vt/mkkfont/mkkfont.c Thu May 29 16:18:46 2014 (r266847) @@ -139,7 +139,7 @@ print_info(struct file_header *fh) else printf("\t\t\t\t NULL,\n"); } - printf("\t\t\t\t }\n"); + printf("\t\t\t\t },\n"); printf("\t.vf_map_count\t\t= { %u, %u, %u, %u },\n", be32toh(fh->map_count[0]), be32toh(fh->map_count[1]), From owner-svn-src-head@FreeBSD.ORG Thu May 29 16:20:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CD1E648; Thu, 29 May 2014 16:20:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EA9E2B23; Thu, 29 May 2014 16:20:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TGKZhI086176; Thu, 29 May 2014 16:20:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TGKYhp086168; Thu, 29 May 2014 16:20:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405291620.s4TGKYhp086168@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 29 May 2014 16:20:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266848 - head/sys/dev/mfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 16:20:35 -0000 Author: kib Date: Thu May 29 16:20:34 2014 New Revision: 266848 URL: http://svnweb.freebsd.org/changeset/base/266848 Log: Add support for the unmapped i/o to mfi(4). Tested by: Nicholas Esborn Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/mfi/mfi.c head/sys/dev/mfi/mfi_cam.c head/sys/dev/mfi/mfi_disk.c head/sys/dev/mfi/mfi_syspd.c head/sys/dev/mfi/mfivar.h Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Thu May 29 16:18:46 2014 (r266847) +++ head/sys/dev/mfi/mfi.c Thu May 29 16:20:34 2014 (r266848) @@ -2122,6 +2122,8 @@ mfi_build_cdb(int readop, uint8_t byte2, return cdb_len; } +extern char *unmapped_buf; + static struct mfi_command * mfi_build_syspdio(struct mfi_softc *sc, struct bio *bio) { @@ -2145,11 +2147,11 @@ mfi_build_syspdio(struct mfi_softc *sc, pass->header.cmd = MFI_CMD_PD_SCSI_IO; switch (bio->bio_cmd & 0x03) { case BIO_READ: - flags = MFI_CMD_DATAIN; + flags = MFI_CMD_DATAIN | MFI_CMD_BIO; readop = 1; break; case BIO_WRITE: - flags = MFI_CMD_DATAOUT; + flags = MFI_CMD_DATAOUT | MFI_CMD_BIO; readop = 0; break; default: @@ -2174,7 +2176,7 @@ mfi_build_syspdio(struct mfi_softc *sc, pass->sense_addr_hi = (uint32_t)((uint64_t)cm->cm_sense_busaddr >> 32); cm->cm_complete = mfi_bio_complete; cm->cm_private = bio; - cm->cm_data = bio->bio_data; + cm->cm_data = unmapped_buf; cm->cm_len = bio->bio_bcount; cm->cm_sg = &pass->sgl; cm->cm_total_frame_size = MFI_PASS_FRAME_SIZE; @@ -2205,11 +2207,11 @@ mfi_build_ldio(struct mfi_softc *sc, str switch (bio->bio_cmd & 0x03) { case BIO_READ: io->header.cmd = MFI_CMD_LD_READ; - flags = MFI_CMD_DATAIN; + flags = MFI_CMD_DATAIN | MFI_CMD_BIO; break; case BIO_WRITE: io->header.cmd = MFI_CMD_LD_WRITE; - flags = MFI_CMD_DATAOUT; + flags = MFI_CMD_DATAOUT | MFI_CMD_BIO; break; default: /* TODO: what about BIO_DELETE??? */ @@ -2230,7 +2232,7 @@ mfi_build_ldio(struct mfi_softc *sc, str io->lba_lo = bio->bio_pblkno & 0xffffffff; cm->cm_complete = mfi_bio_complete; cm->cm_private = bio; - cm->cm_data = bio->bio_data; + cm->cm_data = unmapped_buf; cm->cm_len = bio->bio_bcount; cm->cm_sg = &io->sgl; cm->cm_total_frame_size = MFI_IO_FRAME_SIZE; @@ -2316,6 +2318,10 @@ mfi_mapcmd(struct mfi_softc *sc, struct error = bus_dmamap_load_ccb(sc->mfi_buffer_dmat, cm->cm_dmamap, cm->cm_data, mfi_data_cb, cm, polled); + else if (cm->cm_flags & MFI_CMD_BIO) + error = bus_dmamap_load_bio(sc->mfi_buffer_dmat, + cm->cm_dmamap, cm->cm_private, mfi_data_cb, cm, + polled); else error = bus_dmamap_load(sc->mfi_buffer_dmat, cm->cm_dmamap, cm->cm_data, cm->cm_len, Modified: head/sys/dev/mfi/mfi_cam.c ============================================================================== --- head/sys/dev/mfi/mfi_cam.c Thu May 29 16:18:46 2014 (r266847) +++ head/sys/dev/mfi/mfi_cam.c Thu May 29 16:20:34 2014 (r266848) @@ -218,7 +218,7 @@ mfip_cam_action(struct cam_sim *sim, uni cpi->version_num = 1; cpi->hba_inquiry = PI_TAG_ABLE; cpi->target_sprt = 0; - cpi->hba_misc = PIM_NOBUSRESET|PIM_SEQSCAN; + cpi->hba_misc = PIM_NOBUSRESET | PIM_SEQSCAN | PIM_UNMAPPED; cpi->hba_eng_cnt = 0; cpi->max_target = MFI_SCSI_MAX_TARGETS; cpi->max_lun = MFI_SCSI_MAX_LUNS; Modified: head/sys/dev/mfi/mfi_disk.c ============================================================================== --- head/sys/dev/mfi/mfi_disk.c Thu May 29 16:18:46 2014 (r266847) +++ head/sys/dev/mfi/mfi_disk.c Thu May 29 16:20:34 2014 (r266848) @@ -169,6 +169,7 @@ mfi_disk_attach(device_t dev) sc->ld_disk->d_fwheads = 64; sc->ld_disk->d_fwsectors = 32; } + sc->ld_disk->d_flags = DISKFLAG_UNMAPPED_BIO; disk_create(sc->ld_disk, DISK_VERSION); return (0); Modified: head/sys/dev/mfi/mfi_syspd.c ============================================================================== --- head/sys/dev/mfi/mfi_syspd.c Thu May 29 16:18:46 2014 (r266847) +++ head/sys/dev/mfi/mfi_syspd.c Thu May 29 16:20:34 2014 (r266848) @@ -143,6 +143,7 @@ mfi_syspd_attach(device_t dev) sc->pd_disk->d_fwheads = 64; sc->pd_disk->d_fwsectors = 32; } + sc->pd_disk->d_flags = DISKFLAG_UNMAPPED_BIO; disk_create(sc->pd_disk, DISK_VERSION); device_printf(dev, " SYSPD volume attached\n"); Modified: head/sys/dev/mfi/mfivar.h ============================================================================== --- head/sys/dev/mfi/mfivar.h Thu May 29 16:18:46 2014 (r266847) +++ head/sys/dev/mfi/mfivar.h Thu May 29 16:20:34 2014 (r266848) @@ -104,10 +104,11 @@ struct mfi_command { #define MFI_CMD_POLLED (1<<4) #define MFI_CMD_SCSI (1<<5) #define MFI_CMD_CCB (1<<6) -#define MFI_CMD_TBOLT (1<<7) -#define MFI_ON_MFIQ_FREE (1<<8) -#define MFI_ON_MFIQ_READY (1<<9) -#define MFI_ON_MFIQ_BUSY (1<<10) +#define MFI_CMD_BIO (1<<7) +#define MFI_CMD_TBOLT (1<<8) +#define MFI_ON_MFIQ_FREE (1<<9) +#define MFI_ON_MFIQ_READY (1<<10) +#define MFI_ON_MFIQ_BUSY (1<<11) #define MFI_ON_MFIQ_MASK (MFI_ON_MFIQ_FREE | MFI_ON_MFIQ_READY| \ MFI_ON_MFIQ_BUSY) #define MFI_CMD_FLAGS_FMT "\20" \ @@ -117,10 +118,11 @@ struct mfi_command { "\4COMPLETED" \ "\5POLLED" \ "\6SCSI" \ - "\7TBOLT" \ - "\10Q_FREE" \ - "\11Q_READY" \ - "\12Q_BUSY" + "\7BIO" \ + "\10TBOLT" \ + "\11Q_FREE" \ + "\12Q_READY" \ + "\13Q_BUSY" uint8_t retry_for_fw_reset; void (* cm_complete)(struct mfi_command *cm); void *cm_private; From owner-svn-src-head@FreeBSD.ORG Thu May 29 16:54:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92A4F3FD; Thu, 29 May 2014 16:54:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 804F82E52; Thu, 29 May 2014 16:54:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TGsFq9002386; Thu, 29 May 2014 16:54:15 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TGsF3Z002385; Thu, 29 May 2014 16:54:15 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201405291654.s4TGsF3Z002385@svn.freebsd.org> From: Olivier Houchard Date: Thu, 29 May 2014 16:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266849 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 16:54:15 -0000 Author: cognet Date: Thu May 29 16:54:15 2014 New Revision: 266849 URL: http://svnweb.freebsd.org/changeset/base/266849 Log: For old CPUs, map the 64 first MB of RAM as it used to be. Some ports (XScale mainly) expects the memory located before the kernel to be mapped, and use it to allocate the page tables, the various stacks, etc. A better fix would probably be to rewrite the various bla_machdep.c to stop using that RAM, but I'm not so inclined to do it, especially since I don't have hardware for all of them. Modified: head/sys/arm/arm/locore.S Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Thu May 29 16:20:34 2014 (r266848) +++ head/sys/arm/arm/locore.S Thu May 29 16:54:15 2014 (r266849) @@ -166,9 +166,32 @@ Lunmapped: ldr r1, [r0, #4] sub r0, r1, r2 +#ifndef _ARM_ARCH_6 /* - * Map PA == VA + * Some of the older ports (the various XScale, mostly) assume + * that the memory before the kernel is mapped, and use it for + * the various stacks, page tables, etc. For those CPUs, map the + * 64 first MB of RAM, as it used to be. */ + /* + * Map PA == VA + */ + ldr r5, =PHYSADDR + mov r1, r5 + mov r2, r5 + /* Map 64MiB, preserved over calls to build_pagetables */ + mov r3, #64 + bl build_pagetables + + /* Create the kernel map to jump to */ + mov r1, r5 + ldr r2, =(KERNBASE) + bl build_pagetables + ldr r5, =(KERNPHYSADDR) +#else + /* + * Map PA == VA + */ /* Find the start kernels load address */ adr r5, _start ldr r2, =(L1_S_OFFSET) @@ -183,6 +206,7 @@ Lunmapped: mov r1, r5 ldr r2, =(KERNVIRTADDR) bl build_pagetables +#endif #if defined(SOCDEV_PA) && defined(SOCDEV_VA) /* Create the custom map */ From owner-svn-src-head@FreeBSD.ORG Thu May 29 16:56:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A560B72E; Thu, 29 May 2014 16:56:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 929EF2E92; Thu, 29 May 2014 16:56:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TGuehu002875; Thu, 29 May 2014 16:56:40 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TGudoD002868; Thu, 29 May 2014 16:56:39 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201405291656.s4TGudoD002868@svn.freebsd.org> From: Olivier Houchard Date: Thu, 29 May 2014 16:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266850 - in head/sys/arm/xscale: i80321 i8134x ixp425 pxa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 16:56:40 -0000 Author: cognet Date: Thu May 29 16:56:39 2014 New Revision: 266850 URL: http://svnweb.freebsd.org/changeset/base/266850 Log: Do not hand the VM the memory used for stacks/page tables/etc. Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c head/sys/arm/xscale/i80321/iq31244_machdep.c head/sys/arm/xscale/i8134x/crb_machdep.c head/sys/arm/xscale/ixp425/avila_machdep.c head/sys/arm/xscale/pxa/pxa_machdep.c Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/ep80219_machdep.c Thu May 29 16:54:15 2014 (r266849) +++ head/sys/arm/xscale/i80321/ep80219_machdep.c Thu May 29 16:56:39 2014 (r266850) @@ -341,6 +341,10 @@ initarm(struct arm_boot_params *abp) * Prepare the list of physical memory available to the vm subsystem. */ arm_physmem_hardware_region(IQ80321_SDRAM_START, memsize); + arm_physmem_exclude_region(freemem_pt, KERNPHYSADDR - + freemem_pt, EXFLAG_NOALLOC); + arm_physmem_exclude_region(freemempos, KERNPHYSADDR - 0x100000 - + freemempos, EXFLAG_NOALLOC); arm_physmem_exclude_region(abp->abp_physaddr, virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC); arm_physmem_init_kernel_globals(); Modified: head/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/iq31244_machdep.c Thu May 29 16:54:15 2014 (r266849) +++ head/sys/arm/xscale/i80321/iq31244_machdep.c Thu May 29 16:56:39 2014 (r266850) @@ -343,6 +343,10 @@ initarm(struct arm_boot_params *abp) * Prepare the list of physical memory available to the vm subsystem. */ arm_physmem_hardware_region(SDRAM_START, memsize); + arm_physmem_exclude_region(freemem_pt, KERNPHYSADDR - + freemem_pt, EXFLAG_NOALLOC); + arm_physmem_exclude_region(freemempos, KERNPHYSADDR - 0x100000 - + freemempos, EXFLAG_NOALLOC); arm_physmem_exclude_region(abp->abp_physaddr, virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC); arm_physmem_init_kernel_globals(); Modified: head/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- head/sys/arm/xscale/i8134x/crb_machdep.c Thu May 29 16:54:15 2014 (r266849) +++ head/sys/arm/xscale/i8134x/crb_machdep.c Thu May 29 16:56:39 2014 (r266850) @@ -323,6 +323,10 @@ initarm(struct arm_boot_params *abp) * Prepare the list of physical memory available to the vm subsystem. */ arm_physmem_hardware_region(SDRAM_START, memsize); + arm_physmem_exclude_region(freemem_pt, KERNPHYSADDR - + freemem_pt, EXFLAG_NOALLOC); + arm_physmem_exclude_region(freemempos, KERNPHYSADDR - 0x100000 - + freemempos, EXFLAG_NOALLOC); arm_physmem_exclude_region(abp->abp_physaddr, virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC); arm_physmem_init_kernel_globals(); Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Thu May 29 16:54:15 2014 (r266849) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Thu May 29 16:56:39 2014 (r266850) @@ -413,6 +413,10 @@ initarm(struct arm_boot_params *abp) * Prepare the list of physical memory available to the vm subsystem. */ arm_physmem_hardware_region(PHYSADDR, memsize); + arm_physmem_exclude_region(freemem_pt, KERNPHYSADDR - + freemem_pt, EXFLAG_NOALLOC); + arm_physmem_exclude_region(freemempos, KERNPHYSADDR - 0x100000 - + freemempos, EXFLAG_NOALLOC); arm_physmem_exclude_region(abp->abp_physaddr, virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC); arm_physmem_init_kernel_globals(); Modified: head/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_machdep.c Thu May 29 16:54:15 2014 (r266849) +++ head/sys/arm/xscale/pxa/pxa_machdep.c Thu May 29 16:56:39 2014 (r266850) @@ -335,6 +335,10 @@ initarm(struct arm_boot_params *abp) if (memsize[j] > 0) arm_physmem_hardware_region(memstart[j], memsize[j]); } + arm_physmem_exclude_region(freemem_pt, KERNPHYSADDR - + freemem_pt, EXFLAG_NOALLOC); + arm_physmem_exclude_region(freemempos, KERNPHYSADDR - 0x100000 - + freemempos, EXFLAG_NOALLOC); arm_physmem_exclude_region(abp->abp_physaddr, virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC); arm_physmem_init_kernel_globals(); From owner-svn-src-head@FreeBSD.ORG Thu May 29 17:41:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 632744BA; Thu, 29 May 2014 17:41:34 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BDF622A2; Thu, 29 May 2014 17:41:34 +0000 (UTC) Received: from [2001:470:9174:1:15cb:b075:b4d8:4c48] by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1Wq4KV-00097w-60; Thu, 29 May 2014 18:41:31 +0100 Subject: Re: svn commit: r266083 - in head/sys/arm: arm include Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Content-Type: text/plain; charset=windows-1252 From: Mark R V Murray In-Reply-To: <53871493.2010502@selasky.org> Date: Thu, 29 May 2014 18:41:52 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405141911.s4EJBFZZ097826@svn.freebsd.org> <537D0952.2040001@selasky.org> <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org> <53871493.2010502@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1878.2) X-SA-Score: -1.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 17:41:34 -0000 On 29 May 2014, at 12:05, Hans Petter Selasky wrote: > On 05/22/14 09:09, Mark R V Murray wrote: >>=20 >> On 21 May 2014, at 21:15, Hans Petter Selasky = wrote: >>=20 >>> On 05/14/14 21:11, Mark Murray wrote: >>>> Author: markm >>>> Date: Wed May 14 19:11:15 2014 >>>> New Revision: 266083 >>>> URL: http://svnweb.freebsd.org/changeset/base/266083 >>>>=20 >>>> Log: >>>> Give suitably-endowed ARMs a register similar to the x86 TSC = register. >>>>=20 >>>=20 >>> Hi, >>>=20 >>> Regression issue: >>> This commit prevents RPI-B from booting. >>=20 >> Thanks, I=92ll look at it ASAP. >>=20 >> M >>=20 >=20 > Any news on this issue? Hi Yes, thanks! I can make it work on RPI, but trying to find what else it will/won=92t = work on is more problematic. I=92m considering disabling this on RPI, and then spending a bit of time = writing a full driver for this counter, then the annoying details of the = problem can be solved in FDT code. M --=20 Mark R V Murray From owner-svn-src-head@FreeBSD.ORG Thu May 29 18:05:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59E0AD0F; Thu, 29 May 2014 18:05:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44E9624BD; Thu, 29 May 2014 18:05:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TI54gN034487; Thu, 29 May 2014 18:05:04 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TI53Vl034482; Thu, 29 May 2014 18:05:03 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201405291805.s4TI53Vl034482@svn.freebsd.org> From: Ed Maste Date: Thu, 29 May 2014 18:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266851 - head/share/vt/fonts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 18:05:04 -0000 Author: emaste Date: Thu May 29 18:05:03 2014 New Revision: 266851 URL: http://svnweb.freebsd.org/changeset/base/266851 Log: Add VGAROM 8x8, 8x14 and 8x16 fonts for vt(4) These are converted from syscons(4) cp437 fonts. Added: head/share/vt/fonts/vgarom-8x14.fnt.uu (contents, props changed) head/share/vt/fonts/vgarom-8x16.fnt.uu (contents, props changed) head/share/vt/fonts/vgarom-8x8.fnt.uu (contents, props changed) Modified: head/share/vt/fonts/Makefile Modified: head/share/vt/fonts/Makefile ============================================================================== --- head/share/vt/fonts/Makefile Thu May 29 16:56:39 2014 (r266850) +++ head/share/vt/fonts/Makefile Thu May 29 18:05:03 2014 (r266851) @@ -1,6 +1,9 @@ # $FreeBSD$ -FILES= gallant.fnt +FILES= gallant.fnt \ + vgarom-8x8.fnt \ + vgarom-8x14.fnt \ + vgarom-8x16.fnt CLEANFILES+= ${FILES} Added: head/share/vt/fonts/vgarom-8x14.fnt.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/fonts/vgarom-8x14.fnt.uu Thu May 29 18:05:03 2014 (r266851) @@ -0,0 +1,98 @@ +# $FreeBSD$ +begin 644 vgarom-8x14.fnt +M5D9.5#`P,#((#@``````_@```%`````````````````````````````````` +M````&#P\/!@8`!@8`````&9F9B0``````````````&QL_FQL;/YL;````!@8 +M?,;"P'P&AL9\&!@``````,+&#!@P9L8``````#AL;#AVW,S,=@`````P,#!@ +M```````````````,&#`P,#`P&`P``````#`8#`P,#`P8,`````````!F//\\ +M9@```````````!@8?A@8`````````````````!@8&#```````````/X````` +M````````````````&!@```````(&#!@P8,"`````````?,;.WO;FQL9\```` +M```8.'@8&!@8&'X``````'S&!@P8,&#&_@``````?,8&!CP&!L9\```````, +M'#QLS/X,#!X``````/[`P,#\!@;&?```````.&#`P/S&QL9\``````#^Q@8, +M&#`P,#```````'S&QL9\QL;&?```````?,;&QGX&!@QX````````&!@````8 +M&``````````8&````!@8,```````!@P8,&`P&`P&``````````!^``!^```` +M`````&`P&`P&#!@P8```````?,;&#!@8`!@8``````!\QL;>WM[&A@8/```````#QFPL#` +MWL9F.@``````QL;&QO[&QL;&```````\&!@8&!@8&#P``````!X,#`P,#,S, +M>```````YF9L;'AL;&;F``````#P8&!@8&!B9OX``````,;N_O[6QL;&Q@`` +M````QN;V_M[.QL;&```````X;,;&QL;&;#@``````/QF9F9\8&!@\``````` +M?,;&QL;6WGP,#@````#\9F9F?&QF9N8``````'S&QF`X#,;&?```````?GY: +M&!@8&!@\``````#&QL;&QL;&QGP``````,;&QL;&QFPX$```````QL;&QM;6 +M_GQL``````#&QFPX.#ALQL8``````&9F9F8\&!@8/```````_L:,&#!@PL;^ +M```````\,#`P,#`P,#P``````(#`X'`X'`X&`@``````/`P,#`P,#`P\```` +M$#ALQ@````````````````````````````#_`#`P&``````````````````` +M``!X#'S,S'8``````.!@8'AL9F9F?```````````?,;`P,9\```````<#`P\ +M;,S,S'8``````````'S&_L#&?```````.&QD8/!@8&#P``````````!VS,S, +M?`S,>````.!@8&QV9F9FY@``````&!@`.!@8&!@\```````&!@`.!@8&!F9F +M/````.!@8&9L>&QFY@``````.!@8&!@8&!@\``````````#L_M;6UL8````` +M`````-QF9F9F9@``````````?,;&QL9\``````````#<9F9F?&!@\``````` +M`';,S,Q\#`P>````````W'9F8&#P``````````!\QG`QL;&QL`````````````&``````````X;&PX`'P````````````` +M`-AL-FS8````````P,#&S-@P9LZ>/@8&``#`P,;,V#!@W(8,&#X````P,``P +M,&#&QGP`````QL80.&S&QO[&Q@```#AL.``X;,;&_L;&```````^;,S,_LS, +MS,X``````#QFPL#`PF8\#`9\`!@P8`#^9F!\8&;^````=MP`QN;V_M[.QL8` +M````QL8X;,;&QL9L.`````#&Q@#&QL;&QL9\`````````'S&_,;&_,#`0``` +M8#`8`'@,?,S,=@`````8,&``>`Q\S,QV`````!`X;`!X#'S,S'8``````,S, +M`'@,?,S,=@`````X;#@`>`Q\S,QV`````````,QV-G[8V&X`````````/&9@ +M9CP,!CP```!@,!@`?,;^P,9\``````P8,`!\QO[`QGP`````$#AL`'S&_L#& +M?```````S,P`?,;^P,9\`````&`P&``X&!@8&#P`````#!@P`#@8&!@8/``` +M```8/&8`.!@8&!@\``````!F9@`X&!@8&#P``````';<`-QF9F9F9@````!@ +M,!@`?,;&QL9\`````!@P8`!\QL;&QGP`````$#AL`'S&QL;&?```````QL8` +M?,;&QL9\````````&!@`?@`8&```````8#`8`,S,S,S,=@`````8,&``S,S, +MS,QV`````#!XS`#,S,S,S'8``````,S,`,S,S,S,=@``````QL8`QL;&QGX& +M#'@```X;&!@8?A@8&!C8<````/[&QL#`P,#`P```````.&S&QO[&QFPX```` +M``#^QF`P&#!@QOX``````'X8/&9F9CP8?@``````.&S&QL9L;&SN```````` +M``!VW-C8W'8``````!XP&`P^9F9F/```````'#!@8'Q@8#`<`````````/YL +M;&QL;&P``````````'[8V-C8<`````````!VW!@8&!@8```````#!G[;V_-^ +M8,```````````!@\/!@`````````9F9F9F9F`&9F`````-AL;&QL;``````` +M````^,S,^,3,WLS,Q@`````````P8/Y@,``````````8/'X8&!@8&!@````` +M````&`S^#!@`````````&!@8&!@8?CP8`````````"AL_FPH`````````!@\ +M?A@8&'X\&```````&#Q^&!@8?CP8?@``````````&!@`````````#PP,#`P, +M[&P\'```````````?MO;?@````````````#`P,#^``````````!\QL;&QL;& +MQ@````````!VW`!VW```````````_@``_@``_@````````P8,&`P&`P`?@`` +M````,!@,!@P8,`!^`````````!`X;,;&_@````````````#^P,#````````` +M#AL;&!@8&!@8&!@8&!@8&!@8&!C8V'``````````````_P```````!@8&!@8 +M&!@8&!@8&!@8`````````!\8&!@8&!@`````````^!@8&!@8&!@8&!@8&!@? +M````````&!@8&!@8&/@````````8&!@8&!@8'Q@8&!@8&!@8&!@8&!CX&!@8 +M&!@8`````````/\8&!@8&!@8&!@8&!@8_P```````!@8&!@8&!C_&!@8&!@8 +M``````#_`/\````````V-C8V-C8V-C8V-C8V-@``````'Q@?&!@8&!@8```` +M`````#\V-C8V-C8``````#\P-S8V-C8V-@``````^!CX&!@8&!@8```````` +M`/XV-C8V-C8``````/X&]C8V-C8V-A@8&!@8'Q@?````````-C8V-C8V-C\` +M```````V-C8V-C

0``````WP!Z``,```#D`'X`"P```/$`B@`#```` +M]@".``$```#Y`)```P```/\`E``````!D@"5``````.3`)8``````Y@`EP`` +M```#HP"8``````.F`)D``````ZD`F@`````#L0";``````.T`)P``0```\`` +MG@`````#PP"?``$```/&`*$`````("(`H@`````@/`"C`````"!_`*0````` +M(*<`I0`````AD`"F``4``"&H`*P`````(AD`K0`!```B'@"O``$``"(I`+$` +M````(D@`L@`````B80"S`````")D`+0``0``(P(`M@`````C$`"W`````",@ +M`+@``0``)0``N@`````E`@"[`````"4,`+P`````)1``O0`````E%`"^```` +M`"48`+\`````)1P`P``````E)`#!`````"4L`,(`````)30`PP`````E/`#$ +M`````"50`,4`'```)8``X@`````EA`#C`````"6(`.0`````)8P`Y0`````E +MD`#F``,``"6@`.H`````):P`ZP`````EL@#L`````"6Z`.T`````);P`[@`` +M```EQ`#O`````"7+`/``````)=@`\0`!```F.@#S``(``"9``/8`````)D(` +K]P`````F8`#X`````"9C`/D`````)F4`^@`!```F:@#\`````"9L`/T````` +` +end Added: head/share/vt/fonts/vgarom-8x16.fnt.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/fonts/vgarom-8x16.fnt.uu Thu May 29 18:05:03 2014 (r266851) @@ -0,0 +1,110 @@ +# $FreeBSD$ +begin 644 vgarom-8x16.fnt +M5D9.5#`P,#(($```````_@```%`````````````````````````````````` +M```````8/#P\&!@8`!@8``````!F9F8D``````````````````!L;/YL;&S^ +M;&P`````&!A\QL+`?`8&AL9\&!@```````#"Q@P8,&#&A@```````#AL;#AV +MW,S,S'8``````#`P,&``````````````````#!@P,#`P,#`8#````````#`8 +M#`P,#`P,&#````````````!F//\\9@``````````````&!A^&!@````````` +M```````````8&!@P`````````````/X````````````````````````8&``` +M`````````@8,&#!@P(`````````X;,;&UM;&QFPX````````&#AX&!@8&!@8 +M?@```````'S&!@P8,&#`QOX```````!\Q@8&/`8&!L9\````````#!P\;,S^ +M#`P,'@```````/[`P,#\!@8&QGP````````X8,#`_,;&QL9\````````_L8& +M!@P8,#`P,````````'S&QL9\QL;&QGP```````!\QL;&?@8&!@QX```````` +M```8&````!@8````````````&!@````8&#``````````!@P8,&`P&`P&```` +M````````?@``?@````````````!@,!@,!@P8,&````````!\QL8,&!@8`!@8 +M`````````'S&QM[>WMS`?````````!`X;,;&_L;&QL8```````#\9F9F?&9F +M9F;\````````/&;"P,#`P,)F/````````/AL9F9F9F9F;/@```````#^9F)H +M>&A@8F;^````````_F9B:'AH8&!@\````````#QFPL#`WL;&9CH```````#& +MQL;&_L;&QL;&````````/!@8&!@8&!@8/````````!X,#`P,#,S,S'@````` +M``#F9F9L>'AL9F;F````````\&!@8&!@8&)F_@```````,;N_O[6QL;&QL8` +M``````#&YO;^WL[&QL;&````````?,;&QL;&QL;&?````````/QF9F9\8&!@ +M8/````````!\QL;&QL;&UMY\#`X`````_&9F9GQL9F9FY@```````'S&QF`X +M#`;&QGP```````!^?EH8&!@8&!@\````````QL;&QL;&QL;&?````````,;& +MQL;&QL9L.!````````#&QL;&UM;6_NYL````````QL9L?#@X?&S&Q@`````` +M`&9F9F8\&!@8&#P```````#^QH8,&#!@PL;^````````/#`P,#`P,#`P/``` +M``````"`P.!P.!P.!@(````````\#`P,#`P,#`P\`````!`X;,8````````` +M````````````````````````_P``,#`8````````````````````````>`Q\ +MS,S,=@```````.!@8'AL9F9F9GP```````````!\QL#`P,9\````````'`P, +M/&S,S,S,=@```````````'S&_L#`QGP````````X;&1@\&!@8&#P```````` +M````=LS,S,S,?`S,>````.!@8&QV9F9F9N8````````8&``X&!@8&!@\```` +M````!@8`#@8&!@8&!F9F/````.!@8&9L>'AL9N8````````X&!@8&!@8&!@\ +M````````````[/[6UM;6Q@```````````-QF9F9F9F8```````````!\QL;& +MQL9\````````````W&9F9F9F?&!@\````````';,S,S,S'P,#!X```````#< +M=F9@8&#P````````````?,9@.`S&?````````!`P,/PP,#`P-AP````````` +M``#,S,S,S,QV````````````9F9F9F8\&````````````,;&UM;6_FP````` +M``````#&;#@X.&S&````````````QL;&QL;&?@8,^````````/[,&#!@QOX` +M```````.&!@8SL;&Q@``````Q@!\QL;&QL;&QGP``````,8`QL;&QL;&QL9\ +M````````>,S,S-C,QL;&S```````8#`8`'@,?,S,S'8``````!@P8`!X#'S, +MS,QV```````0.&P`>`Q\S,S,=@```````,P``'@,?,S,S'8``````#AL.`!X +M#'S,S,QV````````````S'8V?MC8;@``````````/&9@8&8\#`8\`````&`P +M&`!\QO[`P,9\```````,&#``?,;^P,#&?```````$#AL`'S&_L#`QGP````` +M``#&``!\QO[`P,9\``````!@,!@`.!@8&!@8/```````#!@P`#@8&!@8&#P` +M`````!@\9@`X&!@8&!@\````````9@``.!@8&!@8/````````';<`-QF9F9F +M9F8``````&`P&`!\QL;&QL9\```````8,&``?,;&QL;&?```````$#AL`'S& +MQL;&QGP```````#&``!\QL;&QL9\```````````8&`!^`!@8````````8#`8 +M`,S,S,S,S'8``````!@P8`#,S,S,S,QV```````P>,P`S,S,S,S,=@`````` +M`,P``,S,S,S,S'8```````#&``#&QL;&QL9^!@QX```.&Q@8&'X8&!@8&-AP +M`````/[&QL#`P,#`P,``````````.&S&QO[&QFPX`````````/[&8#`8,&#& +M_@````````!^&#QF9F8\&'X````````X;,;&QFQL;&SN````````````=MS8 +MV-C<=@```````!XP&`P^9F9F9CP````````<,&!@?&!@8#`<``````````#^ +M;&QL;&QL;````````````'[8V-C8V'```````````';<&!@8&!@8```````` +M``,&?MO;\WY@P``````````````8/#P8``````````!F9F9F9F9F`&9F```` +M``#8;&QL;&P`````````````^,S,^,3,WLS,S,8````````````P8/Y@,``` +M````````&#Q^&!@8&!@8&````````````!@,_@P8```````````8&!@8&!@8 +M?CP8````````````*&S^;"@``````````!@\?A@8&'X\&``````````8/'X8 +M&!A^/!A^```````````````8&```````````#PP,#`P,[&QL/!P````````` +M``!^V]O;?@```````````````,#`P/X```````````!\QL;&QL;&QL8````` +M``````!VW`!VW`````````````#^``#^``#^```````````,&#!@,!@,`'X` +M````````,!@,!@P8,`!^```````````0.&S&QL;^``````````````#^P,#` +MP``````````.&QL8&!@8&!@8&!@8&!@8&!@8&!@8V-C8<``````````````` +M_P``````````&!@8&!@8&!@8&!@8&!@8&``````````?&!@8&!@8&!@````` +M````^!@8&!@8&!@8&!@8&!@8&!\``````````!@8&!@8&!CX```````````8 +M&!@8&!@8'Q@8&!@8&!@8&!@8&!@8&/@8&!@8&!@8&`````````#_&!@8&!@8 +M&!@8&!@8&!@8_P``````````&!@8&!@8&/\8&!@8&!@8&```````_P#_```` +M```````V-C8V-C8V-C8V-C8V-C8V```````?&!\8&!@8&!@8&``````````_ +M-C8V-C8V-C8``````#\P-S8V-C8V-C8V``````#X&/@8&!@8&!@8&``````` +M``#^-C8V-C8V-C8``````/X&]C8V-C8V-C8V&!@8&!@?&!\``````````#8V +M-C8V-C8_```````````V-C8V-C

/OX^'@X&`@`` +M`````````#QF0D)F/```````________Y\/#Y_______________PYF]O9G# +M______\``'Z!I8&!O9F!@7X```````!^_]O__\/G__]^`````````!@8VSSG +M/-L8&````````#QF9F9F/!A^&!@````````>#AHR>,S,S,QX`````````!@\ +M?O__?A@8/``````````8/#SGY^<8&#P``````````&S^_O[^?#@0```````` +M```0.'S^?#@0`````````#\S/S`P,#!P\.````````!_8W]C8V-C9^?FP``` +M`````"````!>````H`````````"A`%\``@```*4`8@``````IP!C``````"J +M`&0``@```+``9P`"````M0!J``(```"Z`&T``P```+\`<0``````Q`!R``,` +M``#)`'8``````-$`=P``````U@!X``````#<`'D``````-\`>@`#````Y`!^ +M``L```#Q`(H``P```/8`C@`!````^0"0``,```#_`)0``````9(`E0`````# +MDP"6``````.8`)<``````Z,`F``````#I@"9``````.I`)H``````[$`FP`` +M```#M`"<``$```/``)X``````\,`GP`!```#Q@"A`````"`B`*(`````(#P` +MHP`````@?P"D`````""G`*4`````(9``I@`%```AJ`"L`````"(9`*T``0`` +M(AX`KP`!```B*0"Q`````")(`+(`````(F$`LP`````B9`"T``$``","`+8` +M````(Q``MP`````C(`"X``$``"4``+H`````)0(`NP`````E#`"\`````"40 +M`+T`````)10`O@`````E&`"_`````"4<`,``````)20`P0`````E+`#"```` +M`"4T`,,`````)3P`Q``````E4`#%`!P``"6``.(`````)80`XP`````EB`#D +M`````"6,`.4`````)9``Y@`#```EH`#J`````"6L`.L`````);(`[``````E +MN@#M`````"6\`.X`````)<0`[P`````ERP#P`````"78`/$``0``)CH`\P`" +M```F0`#V`````"9"`/<`````)F``^``````F8P#Y`````"9E`/H``0``)FH` ++_``````F;`#]```` +` +end Added: head/share/vt/fonts/vgarom-8x8.fnt.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/fonts/vgarom-8x8.fnt.uu Thu May 29 18:05:03 2014 (r266851) @@ -0,0 +1,65 @@ +# $FreeBSD$ +begin 644 vgarom-8x8.fnt +M5D9.5#`P,#(("```````_@```%```````````````````````````#!X>#`P +M`#``;&QL``````!L;/YL_FQL`#!\P'@,^#```,;,&#!FQ@`X;#AVW,QV`&!@ +MP```````&#!@8&`P&`!@,!@8&#!@``!F//\\9@```#`P_#`P`````````#`P +M8````/P````````````P,``&#!@P8,"``'S&SM[VYGP`,'`P,#`P_`!XS`PX +M8,S\`'C,##@,S'@`'#QLS/X,'@#\P/@,#,QX`#A@P/C,S'@`_,P,&#`P,`!X +MS,QXS,QX`'C,S'P,&'```#`P```P,```,#```#`P8!@P8,!@,!@```#\``#\ +M``!@,!@,&#!@`'C,#!@P`#``?,;>WM[`>``P>,S,_,S,`/QF9GQF9OP`/&;` +MP,!F/`#X;&9F9FSX`/YB:'AH8OX`_F)H>&A@\``\9L#`SF8^`,S,S/S,S,P` +M>#`P,#`P>``>#`P,S,QX`.9F;'AL9N8`\&!@8&)F_@#&[O[^UL;&`,;F]M[. +MQL8`.&S&QL9L.`#\9F9\8&#P`'C,S,S<>!P`_&9F?&QFY@!XS.!P',QX`/RT +M,#`P,'@`S,S,S,S,_`#,S,S,S'@P`,;&QM;^[L8`QL9L.#ALQ@#,S,QX,#!X +M`/[&C!@R9OX`>&!@8&!@>`#`8#`8#`8"`'@8&!@8&'@`$#ALQ@`````````` +M````_S`P&`````````!X#'S,=@#@8&!\9F;<````>,S`S'@`'`P,?,S,=@`` +M`'C,_,!X`#AL8/!@8/````!VS,Q\#/C@8&QV9F;F`#``<#`P,'@`#``,#`S, +MS'C@8&9L>&SF`'`P,#`P,'@```#,_O[6Q@```/C,S,S,````>,S,S'@```#< +M9F9\8/```';,S'P,'@``W'9F8/````!\P'@,^``0,'PP,#08````S,S,S'8` +M``#,S,QX,````,;6_OYL````QFPX;,8```#,S,Q\#/@``/R8,&3\`!PP,.`P +M,!P`&!@8`!@8&`#@,#`<,##@`';<````````&!@`&!@8&``8&'[`P'X8&#AL +M9/!@YOP`S,QX_##\,#`^8SAL;#C,>#QL;#X`?@```#-FS&8S``````#\#`P` +M`#AL;#@`````,##\,#``_`!P&#!@>`````!F9F9F?&#`?]O;>QL;&P`````` +M&````#AL;#@`?````,QF,V;,``##QLS;-V_/`\/&S-XS9LP/,``P8,#,>`#& +M.&S&_L;&`#`P`'C,_,P`/FS,_LS,S@!XS,#,>!@,>!P`_&!X8/P`_`#,[/S< +MS`##&#QF9CP8`,P`S,S,S'@``'C,^,SXP,#@`'@,?,Q^`!P`>`Q\S'X`?L,\ +M!CYF/P#,`'@,?,Q^`#`P>`Q\S'X```!_#'_,?P```'C`P'@,..``>,S\P'@` +M'`!XS/S`>`!^PSQF?F`\`,P`>,S\P'@`X`!P,#`P>``X`'`P,#!X`'S&.!@8 +M&#P`S`!P,#`P>```^`#XS,S,``#@`'C,S'@``!P`>,S,>`!XS`!XS,QX``#, +M`'C,S'@`,#``_``P,```X`#,S,Q^```<`,S,S'X`>,P`S,S,?@``S`#,S,Q^ +M``#,`,S,?`SX#AL8/!@8V'``_,S`P,#``#ALQO[&;#@`_,Q@,&#,_`#\,'C, +MS'@P_#ALQL9L;.X```!VW,C<=@`<,!A\S,QX`#A@P/C`8#@``/YL;&QL;``` +M`'[8V-AP``!VW!@8&!@`!@Q^V]M^8,```!@\/!@``&9F9F9F`&8`>&QL;&P` +M``#XS,SZQL_&QP`P8/Y@,```&#Q^&!@8&```&`S^#!@``!@8&!A^/!@``"1F +M_V8D```8/'X8&'X\&!@\?AA^/!C_````&!@````/#`P,[&P\'```?MO;?@`` +M``#`P,#^``!XS,S,S,S,``!VW`!VW````/P`_`#\```8,&`P&`#\`&`P&#!@ +M`/P``!`X;,;&_@````#\P,````X;&Q@8&!@8&!@8&!C8V'``````_P```!@8 +M&!@8&!@8`````!\8&!@`````^!@8&!@8&!@?````&!@8&/@````8&!@8'Q@8 +M&!@8&!CX&!@8`````/\8&!@8&!@8_P```!@8&!C_&!@8``#_`/\````V-C8V +M-C8V-@``'Q@?&!@8`````#\V-C8``#\P-S8V-@``^!CX&!@8`````/XV-C8` +M`/X&]C8V-A@8'Q@?````-C8V-C\````V-C

-# This file is in the public domain, so clarified as of
-# 2009-05-17 by Arthur David Olson.
-
 # Allowance for leapseconds added to each timezone file.
 
+# This file is in the public domain.
+
+# This file is generated automatically from the data in the public-domain
+# leap-seconds.list file available from most NIST time servers.
+# If the URL  does not work,
+# you should be able to pick up leap-seconds.list from a secondary NIST server.
+# For more about leap-seconds.list, please see
+# The NTP Timescale and Leap Seconds
+# .
+
 # The International Earth Rotation Service periodically uses leap seconds
 # to keep UTC to within 0.9 s of UT1
 # (which measures the true angular orientation of the earth in space); see
 # Terry J Quinn, The BIPM and the accurate measure of time,
-# Proc IEEE 79, 7 (July 1991), 894-905.
+# Proc IEEE 79, 7 (July 1991), 894-905 .
 # There were no leap seconds before 1972, because the official mechanism
 # accounting for the discrepancy between atomic time and the earth's rotation
 # did not exist until the early 1970s.
@@ -19,8 +25,8 @@
 # or
 #	Leap	YEAR	MON	DAY	23:59:59	-	R/S
 
-# If the leapsecond is Rolling (R) the given time is local time
-# If the leapsecond is Stationary (S) the given time is UTC
+# If the leapsecond is Rolling (R) the given time is local time.
+# If the leapsecond is Stationary (S) the given time is UTC.
 
 # Leap	YEAR	MONTH	DAY	HH:MM:SS	CORR	R/S
 Leap	1972	Jun	30	23:59:60	+	S
@@ -48,53 +54,3 @@ Leap	1998	Dec	31	23:59:60	+	S
 Leap	2005	Dec	31	23:59:60	+	S
 Leap	2008	Dec	31	23:59:60	+	S
 Leap	2012	Jun	30	23:59:60	+	S
-
-# INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS)
-#
-# SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE REFERENCE
-#
-#
-# SERVICE DE LA ROTATION TERRESTRE
-# OBSERVATOIRE DE PARIS
-# 61, Av. de l'Observatoire 75014 PARIS (France)
-# Tel.      : 33 (0) 1 40 51 22 26
-# FAX       : 33 (0) 1 40 51 22 91
-# e-mail    : (E-Mail Removed)
-# http://hpiers.obspm.fr/eop-pc
-#
-# Paris, 5 January 2012
-#
-#
-# Bulletin C 43
-#
-# To authorities responsible
-# for the measurement and
-# distribution of time
-#
-#
-# UTC TIME STEP
-# on the 1st of July 2012
-#
-#
-# A positive leap second will be introduced at the end of June 2012.
-# The sequence of dates of the UTC second markers will be:
-#
-#                          2012 June 30,     23h 59m 59s
-#                          2012 June 30,     23h 59m 60s
-#                          2012 July  1,      0h  0m  0s
-#
-# The difference between UTC and the International Atomic Time TAI is:
-#
-# from 2009 January 1, 0h UTC, to 2012 July 1  0h UTC  : UTC-TAI = - 34s
-# from 2012 July 1,    0h UTC, until further notice    : UTC-TAI = - 35s
-#
-# Leap seconds can be introduced in UTC at the end of the months of December
-# or June, depending on the evolution of UT1-TAI. Bulletin C is mailed every
-# six months, either to announce a time step in UTC or to confirm that there
-# will be no time step at the next possible date.
-#
-#
-# Daniel GAMBIS
-# Head
-# Earth Orientation Center of IERS
-# Observatoire de Paris, France

Modified: head/contrib/tzdata/northamerica
==============================================================================
--- head/contrib/tzdata/northamerica	Fri Jun 13 22:33:41 2014	(r267451)
+++ head/contrib/tzdata/northamerica	Fri Jun 13 23:56:47 2014	(r267452)
@@ -1019,9 +1019,9 @@ Zone America/Menominee	-5:50:27 -	LMT	18
 #	Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated),
 #	which I found in the UCLA library.
 #
-#	
 #	William Willett, The Waste of Daylight, 19th edition
-#	 (1914-03)
+#	
+#	[PDF] (1914-03)
 #
 #	Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
 #	.

Modified: head/contrib/tzdata/zone.tab
==============================================================================
--- head/contrib/tzdata/zone.tab	Fri Jun 13 22:33:41 2014	(r267451)
+++ head/contrib/tzdata/zone.tab	Fri Jun 13 23:56:47 2014	(r267452)
@@ -10,8 +10,7 @@
 # zone where civil clocks have agreed since 1970.  The columns of the
 # table are as follows:
 #
-# 1.  ISO 3166 2-character country code.
-#     See the file '/usr/share/misc/iso3166.tab'.
+# 1.  ISO 3166 2-character country code.  See the file 'iso3166.tab'.
 # 2.  Latitude and longitude of the area's principal location
 #     in ISO 6709 sign-degrees-minutes-seconds format,
 #     either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 14 00:10:11 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 52CD2E88;
 Sat, 14 Jun 2014 00:10:11 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 408BD250C;
 Sat, 14 Jun 2014 00:10:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5E0ABS2007640;
 Sat, 14 Jun 2014 00:10:11 GMT (envelope-from shurd@svn.freebsd.org)
Received: (from shurd@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5E0ABM0007639;
 Sat, 14 Jun 2014 00:10:11 GMT (envelope-from shurd@svn.freebsd.org)
Message-Id: <201406140010.s5E0ABM0007639@svn.freebsd.org>
From: Stephen Hurd 
Date: Sat, 14 Jun 2014 00:10:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267454 - head/usr.bin/calendar/calendars
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 14 Jun 2014 00:10:11 -0000

Author: shurd (ports committer)
Date: Sat Jun 14 00:10:10 2014
New Revision: 267454
URL: http://svnweb.freebsd.org/changeset/base/267454

Log:
  Added:
  
  - my birthday
  
  Approved by:	db, skreuzer (mentors)

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==============================================================================
--- head/usr.bin/calendar/calendars/calendar.freebsd	Sat Jun 14 00:00:03 2014	(r267453)
+++ head/usr.bin/calendar/calendars/calendar.freebsd	Sat Jun 14 00:10:10 2014	(r267454)
@@ -365,6 +365,7 @@
 12/18	Chris Timmons  born in Ellensburg, Washington, United States, 1964
 12/18	Dag-Erling Smorgrav  born in Brussels, Belgium, 1977
 12/18	Semen Ustimenko  born in Novosibirsk, Russian Federation, 1979
+12/19	Stephen Hurd  born in Estevan, Saskatchewan, Canada, 1975
 12/21	Rong-En Fan  born in Taipei, Taiwan, Republic of China, 1982
 12/22	Maxim Sobolev  born in Dnepropetrovsk, Ukraine, 1976
 12/23	Sean Chittenden  born in Seattle, Washington, United States, 1979

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 14 00:16:50 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B9C8D1C3;
 Sat, 14 Jun 2014 00:16:50 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8F9AB25CD;
 Sat, 14 Jun 2014 00:16:50 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5E0GoX3011783;
 Sat, 14 Jun 2014 00:16:50 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5E0Gotn011782;
 Sat, 14 Jun 2014 00:16:50 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201406140016.s5E0Gotn011782@svn.freebsd.org>
From: Edwin Groothuis 
Date: Sat, 14 Jun 2014 00:16:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267455 - head/contrib/tzdata
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 14 Jun 2014 00:16:50 -0000

Author: edwin
Date: Sat Jun 14 00:16:50 2014
New Revision: 267455
URL: http://svnweb.freebsd.org/changeset/base/267455

Log:
  MFV of tzdata2014e
  
  Fix historical data for Egypt.
  Better prediction for future Egypt / Morocco changes.
  Update to Cocos / Cook islands.
  Fix historical data for Russia.

Modified:
Directory Properties:
  head/contrib/tzdata/   (props changed)

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 14 01:03:24 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id CBC28D99;
 Sat, 14 Jun 2014 01:03:24 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A12E62943;
 Sat, 14 Jun 2014 01:03:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5E13O9f034359;
 Sat, 14 Jun 2014 01:03:24 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5E13OAE034358;
 Sat, 14 Jun 2014 01:03:24 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201406140103.s5E13OAE034358@svn.freebsd.org>
From: Glen Barber 
Date: Sat, 14 Jun 2014 01:03:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267459 - head/release
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 14 Jun 2014 01:03:24 -0000

Author: gjb
Date: Sat Jun 14 01:03:24 2014
New Revision: 267459
URL: http://svnweb.freebsd.org/changeset/base/267459

Log:
  Switch release/Makefile knobs from WITHOUT_FOO=1 to MK_FOO=no.
  
  This allows greater granular control over the release
  build, and avoids WITH_FOO=1 and WITHOUT_FOO=1 collision.
  
  This change was verified to produce correct results
  compared to an earlier build by diffing find(1) output
  of the resulting bootonly/, dvd/, and release/ directories.
  
  Tested on:	head@r267449
  MFC after:	1 month
  X-MFC-Note:	Requires commits not yet MFC'd, so likely
  		longer than 1 month.
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/release/Makefile

Modified: head/release/Makefile
==============================================================================
--- head/release/Makefile	Sat Jun 14 00:54:57 2014	(r267458)
+++ head/release/Makefile	Sat Jun 14 01:03:24 2014	(r267459)
@@ -154,8 +154,8 @@ system: packagesystem
 # Install system
 	mkdir -p release
 	cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \
-		DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \
-		WITHOUT_PROFILE=1 WITHOUT_SENDMAIL=1 MK_TESTS=no WITHOUT_LIB32=1
+		DESTDIR=${.OBJDIR}/release MK_RESCUE=no MK_KERNEL_SYMBOLS=no \
+		MK_PROFILE=no MK_SENDMAIL=no MK_TESTS=no MK_LIB32=no
 # Copy distfiles
 	mkdir -p release/usr/freebsd-dist
 	cp *.txz MANIFEST release/usr/freebsd-dist
@@ -175,12 +175,12 @@ bootonly: packagesystem
 # Install system
 	mkdir -p bootonly
 	cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \
-	    DESTDIR=${.OBJDIR}/bootonly WITHOUT_AMD=1 WITHOUT_AT=1 \
-	    WITHOUT_GAMES=1 WITHOUT_GROFF=1 \
-	    WITHOUT_INSTALLLIB=1 WITHOUT_LIB32=1 WITHOUT_MAIL=1 \
-	    WITHOUT_NCP=1 WITHOUT_TOOLCHAIN=1 WITHOUT_PROFILE=1 \
-	    WITHOUT_INSTALLIB=1 WITHOUT_RESCUE=1 WITHOUT_DICT=1 \
-	    WITHOUT_KERNEL_SYMBOLS=1 MK_TESTS=no
+	    DESTDIR=${.OBJDIR}/bootonly MK_AMD=no MK_AT=no \
+	    MK_GAMES=no MK_GROFF=no \
+	    MK_INSTALLLIB=no MK_LIB32=no MK_MAIL=no \
+	    MK_NCP=no MK_TOOLCHAIN=no MK_PROFILE=no \
+	    MK_INSTALLIB=no MK_RESCUE=no MK_DICT=no \
+	    MK_KERNEL_SYMBOLS=no MK_TESTS=no
 # Copy manifest only (no distfiles) to get checksums
 	mkdir -p bootonly/usr/freebsd-dist
 	cp MANIFEST bootonly/usr/freebsd-dist
@@ -199,7 +199,7 @@ dvd:
 # Install system
 	mkdir -p ${.TARGET}
 	cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \
-		DESTDIR=${.OBJDIR}/${.TARGET} WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \
+		DESTDIR=${.OBJDIR}/${.TARGET} MK_RESCUE=no MK_KERNEL_SYMBOLS=no \
 		MK_TESTS=no
 # Copy distfiles
 	mkdir -p ${.TARGET}/usr/freebsd-dist

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 14 01:18:04 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 126741B5;
 Sat, 14 Jun 2014 01:18:04 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id F2F8C2A2D;
 Sat, 14 Jun 2014 01:18:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5E1I3mw039881;
 Sat, 14 Jun 2014 01:18:03 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5E1I2Mn039870;
 Sat, 14 Jun 2014 01:18:02 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201406140118.s5E1I2Mn039870@svn.freebsd.org>
From: Edwin Groothuis 
Date: Sat, 14 Jun 2014 01:18:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267460 - head/contrib/tzdata
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 14 Jun 2014 01:18:04 -0000

Author: edwin
Date: Sat Jun 14 01:18:02 2014
New Revision: 267460
URL: http://svnweb.freebsd.org/changeset/base/267460

Log:
  Undo commit r267455, which was done in the wrong directory.

Modified:
  head/contrib/tzdata/africa
  head/contrib/tzdata/australasia
  head/contrib/tzdata/etcetera
  head/contrib/tzdata/europe
  head/contrib/tzdata/factory
  head/contrib/tzdata/leapseconds
  head/contrib/tzdata/northamerica
  head/contrib/tzdata/zone.tab

Modified: head/contrib/tzdata/africa
==============================================================================
--- head/contrib/tzdata/africa	Sat Jun 14 01:03:24 2014	(r267459)
+++ head/contrib/tzdata/africa	Sat Jun 14 01:18:02 2014	(r267460)
@@ -239,13 +239,13 @@ Rule	Egypt	1990	1994	-	May	 1	1:00	1:00	
 # http://www.worldtimezone.com/dst_news/dst_news_egypt04.html
 # 
 Rule	Egypt	1995	2010	-	Apr	lastFri	 0:00s	1:00	S
-Rule	Egypt	1995	2005	-	Sep	lastThu	24:00	0	-
+Rule	Egypt	1995	2005	-	Sep	lastThu	23:00s	0	-
 # From Steffen Thorsen (2006-09-19):
 # The Egyptian Gazette, issue 41,090 (2006-09-18), page 1, reports:
 # Egypt will turn back clocks by one hour at the midnight of Thursday
 # after observing the daylight saving time since May.
 # http://news.gom.com.eg/gazette/pdf/2006/09/18/01.pdf
-Rule	Egypt	2006	only	-	Sep	21	24:00	0	-
+Rule	Egypt	2006	only	-	Sep	21	23:00s	0	-
 # From Dirk Losch (2007-08-14):
 # I received a mail from an airline which says that the daylight
 # saving time in Egypt will end in the night of 2007-09-06 to 2007-09-07.
@@ -254,7 +254,7 @@ Rule	Egypt	2006	only	-	Sep	21	24:00	0	-
 # http://www.timeanddate.com/worldclock/city.html?n=53
 # From Steffen Thorsen (2007-09-04): The official information...:
 # http://www.sis.gov.eg/En/EgyptOnline/Miscellaneous/000002/0207000000000000001580.htm
-Rule	Egypt	2007	only	-	Sep	Thu>=1	24:00	0	-
+Rule	Egypt	2007	only	-	Sep	Thu>=1	23:00s	0	-
 # From Abdelrahman Hassan (2007-09-06):
 # Due to the Hijri (lunar Islamic calendar) year being 11 days shorter
 # than the year of the Gregorian calendar, Ramadan shifts earlier each
@@ -342,77 +342,46 @@ Rule	Egypt	2007	only	-	Sep	Thu>=1	24:00	
 # From Gunther Vermier (2015-05-13):
 # our Egypt office confirms that the change will be at 15 May "midnight" (24:00)
 
-# From Imed Chihi (2014-06-04):
-# We have finally "located" a precise official reference about the DST changes
-# in Egypt.  The Ministers Cabinet decision is explained at
-# http://www.cabinet.gov.eg/Media/CabinetMeetingsDetails.aspx?id=347 ...
-# [T]his (Arabic) site is not accessible outside Egypt, but the page ...
-# translates into: "With regard to daylight saving time, it is scheduled to
-# take effect at exactly twelve o'clock this evening, Thursday, 15 MAY 2014,
-# to be suspended by twelve o'clock on the evening of Thursday, 26 JUN 2014,
-# and re-established again at the end of the month of Ramadan, at twelve
-# o'clock on the evening of Thursday, 31 JUL 2014."  This statement has been
-# reproduced by other (more accessible) sites[, e.g.,]...
-# http://elgornal.net/news/news.aspx?id=4699258
-
-# From Paul Eggert (2014-06-04):
+# From Paul Eggert (2014-05-13):
 # Sarah El Deeb and Lee Keath of AP report that the Egyptian government says
 # the change is because of blackouts in Cairo, even though Ahram Online (cited
-# above) says DST had no affect on electricity consumption.  There is
-# no information about when DST will end this fall.  See:
+# above) says DST had no affect on electricity consumption.  The AP story says
+# DST will not be observed during Ramadan.  There is no information about when
+# DST will end.  See:
 # http://abcnews.go.com/International/wireStory/el-sissi-pushes-egyptians-line-23614833
 #
-# For now, guess that later spring and fall transitions will use
-# 2010's rules, and guess that Egypt will switch to standard time at
-# 24:00 the last Thursday before Ramadan, and back to DST at 00:00 the
-# first Friday after Ramadan.  To implement this,
-# transition dates for 2015 through 2037 were determined by running
-# the following program under GNU Emacs 24.3, with the results integrated
-# by hand into the table below.  Ramadan again intrudes on the guessed
-# DST starting in 2038, but that's beyond our somewhat-arbitrary cutoff.
-# (let ((islamic-year 1436))
-#   (while (< islamic-year 1460)
-#     (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year)))
-#           (b (calendar-islamic-to-absolute (list 10 1 islamic-year)))
-#           (friday 5))
-#       (while (/= friday (mod a 7))
-#         (setq a (1- a)))
-#       (while (/= friday (mod b 7))
-#         (setq b (1+ b)))
-#       (setq a (1- a))
-#       (setq b (1- b))
-#       (setq a (calendar-gregorian-from-absolute a))
-#       (setq b (calendar-gregorian-from-absolute b))
-#       (insert
-#        (format
-#         (concat "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t0\t-\n"
-#                 "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t1:00\tS\n")
-#         (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
-#         (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
-#     (setq islamic-year (+ 1 islamic-year))))
-Rule	Egypt	2008	only	-	Aug	lastThu	24:00	0	-
-Rule	Egypt	2009	only	-	Aug	20	24:00	0	-
-Rule	Egypt	2010	only	-	Aug	10	24:00	0	-
-Rule	Egypt	2010	only	-	Sep	 9	24:00	1:00	S
-Rule	Egypt	2010	only	-	Sep	lastThu	24:00	0	-
+# For now, guess that later transitions will use 2010's rules, and that
+# Egypt will agree with Morocco (see below) about the date Ramadan starts and
+# ends, though (unlike Morocco) it will switch at 00:00 standard time.  In
+# Egypt the spring-forward transitions are removed for 2020-2022, when the
+# guessed spring-forward date falls during the estimated Ramadan, and all
+# transitions removed for 2023-2038, where the estimated Ramadan falls entirely
+# outside the guessed daylight-saving time.  Ramadan intrudes on the guessed
+# DST starting in 2039, but that's beyond our somewhat-arbitrary cutoff.
+
+Rule	Egypt	2008	only	-	Aug	lastThu	23:00s	0	-
+Rule	Egypt	2009	only	-	Aug	20	23:00s	0	-
+Rule	Egypt	2010	only	-	Aug	11	0:00	0	-
+Rule	Egypt	2010	only	-	Sep	10	0:00	1:00	S
+Rule	Egypt	2010	only	-	Sep	lastThu	23:00s	0	-
 Rule	Egypt	2014	only	-	May	15	24:00	1:00	S
-Rule	Egypt	2014	only	-	Jun	26	24:00	0	-
-Rule	Egypt	2014	only	-	Jul	31	24:00	1:00	S
-Rule	Egypt	2014	max	-	Sep	lastThu	24:00	0	-
+Rule	Egypt	2014	only	-	Jun	29	 0:00s	0	-
+Rule	Egypt	2014	only	-	Jul	29	 0:00s	1:00	S
+Rule	Egypt	2014	max	-	Sep	lastThu	23:00s	0	-
 Rule	Egypt	2015	2019	-	Apr	lastFri	 0:00s	1:00	S
-Rule	Egypt	2015	only	-	Jun	11	24:00	0	-
-Rule	Egypt	2015	only	-	Jul	23	24:00	1:00	S
-Rule	Egypt	2016	only	-	Jun	 2	24:00	0	-
-Rule	Egypt	2016	only	-	Jul	 7	24:00	1:00	S
-Rule	Egypt	2017	only	-	May	25	24:00	0	-
-Rule	Egypt	2017	only	-	Jun	29	24:00	1:00	S
-Rule	Egypt	2018	only	-	May	10	24:00	0	-
-Rule	Egypt	2018	only	-	Jun	14	24:00	1:00	S
-Rule	Egypt	2019	only	-	May	 2	24:00	0	-
-Rule	Egypt	2019	only	-	Jun	 6	24:00	1:00	S
-Rule	Egypt	2020	only	-	May	28	24:00	1:00	S
-Rule	Egypt	2021	only	-	May	13	24:00	1:00	S
-Rule	Egypt	2022	only	-	May	 5	24:00	1:00	S
+Rule	Egypt	2015	only	-	Jun	18	 0:00s	0	-
+Rule	Egypt	2015	only	-	Jul	18	 0:00s	1:00	S
+Rule	Egypt	2016	only	-	Jun	 7	 0:00s	0	-
+Rule	Egypt	2016	only	-	Jul	 7	 0:00s	1:00	S
+Rule	Egypt	2017	only	-	May	27	 0:00s	0	-
+Rule	Egypt	2017	only	-	Jun	26	 0:00s	1:00	S
+Rule	Egypt	2018	only	-	May	16	 0:00s	0	-
+Rule	Egypt	2018	only	-	Jun	15	 0:00s	1:00	S
+Rule	Egypt	2019	only	-	May	 6	 0:00s	0	-
+Rule	Egypt	2019	only	-	Jun	 5	 0:00s	1:00	S
+Rule	Egypt	2020	only	-	May	24	 0:00s	1:00	S
+Rule	Egypt	2021	only	-	May	13	 0:00s	1:00	S
+Rule	Egypt	2022	only	-	May	 3	 0:00s	1:00	S
 Rule	Egypt	2023	max	-	Apr	lastFri	 0:00s	1:00	S
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -945,36 +914,39 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # From Sebastien Willemijns (2014-03-18):
 # http://www.afriquinfos.com/articles/2014/3/18/maroc-heure-dete-avancez-tous-horloges-247891.asp
 
-# From Milamber Space Network (2014-06-05):
-# The Moroccan government has recently announced that the country will return
-# to standard time at 03:00 on Saturday, June 28, 2014 local time....  DST
-# will resume again at 02:00 on Saturday, August 2, 2014....
-# http://www.mmsp.gov.ma/fr/actualites.aspx?id=586
-
-# From Paul Eggert (2014-06-05):
-# For now, guess that later spring and fall transitions will use 2014's rules,
-# and guess that Morocco will switch to standard time at 03:00 the last
-# Saturday before Ramadan, and back to DST at 02:00 the first Saturday after
-# Ramadan.  To implement this, transition dates for 2015 through 2037 were
-# determined by running the following program under GNU Emacs 24.3, with the
-# results integrated by hand into the table below.
-# (let ((islamic-year 1436))
-#   (while (< islamic-year 1460)
-#     (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year)))
-#           (b (calendar-islamic-to-absolute (list 10 1 islamic-year)))
-#           (saturday 6))
-#       (while (/= saturday (mod (setq a (1- a)) 7)))
-#       (while (/= saturday (mod b 7))
-#         (setq b (1+ b)))
-#       (setq a (calendar-gregorian-from-absolute a))
-#       (setq b (calendar-gregorian-from-absolute b))
-#       (insert
-#        (format
-#         (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 3:00\t0\t-\n"
-#                 "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 2:00\t1:00\tS\n")
-#         (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
-#         (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
+# From Paul Eggert (2014-03-19):
+# To estimate what the Moroccan government will do in future years,
+# transition dates for 2014 through 2038 were determined by running
+# the following program under GNU Emacs 24.3:
+#
+# (let ((islamic-year 1435))
+#   (while (< islamic-year 1461)
+#     (let ((a
+#	     (calendar-gregorian-from-absolute
+#	      (calendar-islamic-to-absolute (list 9 1 islamic-year))))
+#	    (b
+#	     (calendar-gregorian-from-absolute
+#	      (calendar-islamic-to-absolute (list 10 1 islamic-year)))))
+#	(insert
+#	 (format
+#	  (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 3:00\t0\t-\n"
+#		  "Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 2:00\t1:00\tS\n")
+#	  (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
+#	  (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
 #     (setq islamic-year (+ 1 islamic-year))))
+#
+# with spring-forward transitions removed for 2023-2025, when the
+# normal spring-forward date falls during the estimated Ramadan; with
+# all transitions removed for 2026-2035, where the estimated Ramadan
+# falls entirely outside daylight-saving time; and with fall-back
+# transitions removed for 2036-2037, where the normal fall-back
+# date falls during the estimated Ramadan.  Normally, the table would
+# stop after 2037 because 32-bit time_t values roll around early in 2038,
+# but that would imply a prediction of perpetual DST after March 2038
+# due to the year-2037 glitches.  So, this table instead stops after
+# 2038, the first non-glitchy year after the 32-bit rollover.
+# An advantage of stopping after 2038 is that it lets zic guess
+# TZ='WET0WEST,M3.5.0,M10.5.0/3' for time stamps far in the future.
 
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 
@@ -996,44 +968,46 @@ Rule	Morocco	1978	only	-	Aug	 4	 0:00	0	
 Rule	Morocco	2008	only	-	Jun	 1	 0:00	1:00	S
 Rule	Morocco	2008	only	-	Sep	 1	 0:00	0	-
 Rule	Morocco	2009	only	-	Jun	 1	 0:00	1:00	S
-Rule	Morocco	2009	only	-	Aug	21	 0:00	0	-
+Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
 Rule	Morocco	2010	only	-	May	 2	 0:00	1:00	S
 Rule	Morocco	2010	only	-	Aug	 8	 0:00	0	-
 Rule	Morocco	2011	only	-	Apr	 3	 0:00	1:00	S
-Rule	Morocco	2011	only	-	Jul	31	 0	0	-
-Rule	Morocco	2012	2013	-	Apr	lastSun	 2:00	1:00	S
-Rule	Morocco	2012	only	-	Sep	30	 3:00	0	-
-Rule	Morocco	2012	only	-	Jul	20	 3:00	0	-
-Rule	Morocco	2012	only	-	Aug	20	 2:00	1:00	S
-Rule	Morocco	2013	only	-	Jul	 7	 3:00	0	-
-Rule	Morocco	2013	only	-	Aug	10	 2:00	1:00	S
-Rule	Morocco	2013	max	-	Oct	lastSun	 3:00	0	-
-Rule	Morocco	2014	2022	-	Mar	lastSun	 2:00	1:00	S
-Rule	Morocco	2014	only	-	Jun	28	 3:00	0	-
-Rule	Morocco	2014	only	-	Aug	 2	 2:00	1:00	S
-Rule	Morocco	2015	only	-	Jun	13	 3:00	0	-
-Rule	Morocco	2015	only	-	Jul	18	 2:00	1:00	S
-Rule	Morocco	2016	only	-	Jun	 4	 3:00	0	-
-Rule	Morocco	2016	only	-	Jul	 9	 2:00	1:00	S
-Rule	Morocco	2017	only	-	May	20	 3:00	0	-
-Rule	Morocco	2017	only	-	Jul	 1	 2:00	1:00	S
-Rule	Morocco	2018	only	-	May	12	 3:00	0	-
-Rule	Morocco	2018	only	-	Jun	16	 2:00	1:00	S
-Rule	Morocco	2019	only	-	May	 4	 3:00	0	-
-Rule	Morocco	2019	only	-	Jun	 8	 2:00	1:00	S
-Rule	Morocco	2020	only	-	Apr	18	 3:00	0	-
-Rule	Morocco	2020	only	-	May	30	 2:00	1:00	S
-Rule	Morocco	2021	only	-	Apr	10	 3:00	0	-
-Rule	Morocco	2021	only	-	May	15	 2:00	1:00	S
-Rule	Morocco	2022	only	-	Apr	 2	 3:00	0	-
-Rule	Morocco	2022	only	-	May	 7	 2:00	1:00	S
-Rule	Morocco	2023	only	-	Apr	22	 2:00	1:00	S
-Rule	Morocco	2024	only	-	Apr	13	 2:00	1:00	S
-Rule	Morocco	2025	only	-	Apr	 5	 2:00	1:00	S
-Rule	Morocco	2026	max	-	Mar	lastSun	 2:00	1:00	S
-Rule	Morocco	2035	only	-	Oct	27	 3:00	0	-
-Rule	Morocco	2036	only	-	Oct	18	 3:00	0	-
-Rule	Morocco	2037	only	-	Oct	10	 3:00	0	-
+Rule	Morocco	2011	only	-	Jul	 31	 0	0	-
+Rule	Morocco	2012	2013	-	Apr	 lastSun 2:00	1:00	S
+Rule	Morocco	2012	only	-	Sep	 30	 3:00	0	-
+Rule	Morocco	2012	only	-	Jul	 20	 3:00	0	-
+Rule	Morocco	2012	only	-	Aug	 20	 2:00	1:00	S
+Rule	Morocco	2013	only	-	Jul	  7	 3:00	0	-
+Rule	Morocco	2013	only	-	Aug	 10	 2:00	1:00	S
+Rule	Morocco	2013	2035	-	Oct	 lastSun 3:00	0	-
+Rule	Morocco	2014	2022	-	Mar	 lastSun 2:00	1:00	S
+Rule	Morocco	2014	only	-	Jun	 29	 3:00	0	-
+Rule	Morocco	2014	only	-	Jul	 29	 2:00	1:00	S
+Rule	Morocco	2015	only	-	Jun	 18	 3:00	0	-
+Rule	Morocco	2015	only	-	Jul	 18	 2:00	1:00	S
+Rule	Morocco	2016	only	-	Jun	  7	 3:00	0	-
+Rule	Morocco	2016	only	-	Jul	  7	 2:00	1:00	S
+Rule	Morocco	2017	only	-	May	 27	 3:00	0	-
+Rule	Morocco	2017	only	-	Jun	 26	 2:00	1:00	S
+Rule	Morocco	2018	only	-	May	 16	 3:00	0	-
+Rule	Morocco	2018	only	-	Jun	 15	 2:00	1:00	S
+Rule	Morocco	2019	only	-	May	  6	 3:00	0	-
+Rule	Morocco	2019	only	-	Jun	  5	 2:00	1:00	S
+Rule	Morocco	2020	only	-	Apr	 24	 3:00	0	-
+Rule	Morocco	2020	only	-	May	 24	 2:00	1:00	S
+Rule	Morocco	2021	only	-	Apr	 13	 3:00	0	-
+Rule	Morocco	2021	only	-	May	 13	 2:00	1:00	S
+Rule	Morocco	2022	only	-	Apr	  3	 3:00	0	-
+Rule	Morocco	2022	only	-	May	  3	 2:00	1:00	S
+Rule	Morocco	2023	only	-	Apr	 22	 2:00	1:00	S
+Rule	Morocco	2024	only	-	Apr	 10	 2:00	1:00	S
+Rule	Morocco	2025	only	-	Mar	 31	 2:00	1:00	S
+Rule	Morocco	2026	max	-	Mar	 lastSun 2:00	1:00	S
+Rule	Morocco	2036	only	-	Oct	 21	 3:00	0	-
+Rule	Morocco	2037	only	-	Oct	 11	 3:00	0	-
+Rule	Morocco	2038	only	-	Sep	 30	 3:00	0	-
+Rule	Morocco	2038	only	-	Oct	 30	 2:00	1:00	S
+Rule	Morocco	2038	max	-	Oct	 lastSun 3:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26

Modified: head/contrib/tzdata/australasia
==============================================================================
--- head/contrib/tzdata/australasia	Sat Jun 14 01:03:24 2014	(r267459)
+++ head/contrib/tzdata/australasia	Sat Jun 14 01:18:02 2014	(r267460)
@@ -250,14 +250,24 @@ Zone Antarctica/Macquarie 0	-	zzz	1899 N
 Zone Indian/Christmas	7:02:52 -	LMT	1895 Feb
 			7:00	-	CXT	# Christmas Island Time
 
-# Cocos (Keeling) Is
+# Cook Is
+# From Shanks & Pottenger:
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Cook	1978	only	-	Nov	12	0:00	0:30	HS
+Rule	Cook	1979	1991	-	Mar	Sun>=1	0:00	0	-
+Rule	Cook	1979	1990	-	Oct	lastSun	0:00	0:30	HS
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Pacific/Rarotonga	-10:39:04 -	LMT	1901		# Avarua
+			-10:30	-	CKT	1978 Nov 12	# Cook Is Time
+			-10:00	Cook	CK%sT
+
+# Cocos
 # These islands were ruled by the Ross family from about 1830 to 1978.
 # We don't know when standard time was introduced; for now, we guess 1900.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Indian/Cocos	6:27:40	-	LMT	1900
 			6:30	-	CCT	# Cocos Islands Time
 
-
 # Fiji
 
 # Milne gives 11:55:44 for Suva.
@@ -463,8 +473,7 @@ Rule	NZ	1934	1940	-	Apr	lastSun	2:00	0	M
 Rule	NZ	1934	1940	-	Sep	lastSun	2:00	0:30	S
 Rule	NZ	1946	only	-	Jan	 1	0:00	0	S
 # Since 1957 Chatham has been 45 minutes ahead of NZ, but there's no
-# convenient single notation for the date and time of this transition
-# so we must duplicate the Rule lines.
+# convenient notation for this so we must duplicate the Rule lines.
 Rule	NZ	1974	only	-	Nov	Sun>=1	2:00s	1:00	D
 Rule	Chatham	1974	only	-	Nov	Sun>=1	2:45s	1:00	D
 Rule	NZ	1975	only	-	Feb	lastSun	2:00s	0	S
@@ -502,17 +511,6 @@ Link Pacific/Auckland Antarctica/McMurdo
 # previously whalers, sealers, pastoralists, and scientific personnel wintered
 # was probably like Pacific/Auckland
 
-# Cook Is
-# From Shanks & Pottenger:
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Cook	1978	only	-	Nov	12	0:00	0:30	HS
-Rule	Cook	1979	1991	-	Mar	Sun>=1	0:00	0	-
-Rule	Cook	1979	1990	-	Oct	lastSun	0:00	0:30	HS
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Pacific/Rarotonga	-10:39:04 -	LMT	1901		# Avarua
-			-10:30	-	CKT	1978 Nov 12	# Cook Is Time
-			-10:00	Cook	CK%sT
-
 ###############################################################################
 
 

Modified: head/contrib/tzdata/etcetera
==============================================================================
--- head/contrib/tzdata/etcetera	Sat Jun 14 01:03:24 2014	(r267459)
+++ head/contrib/tzdata/etcetera	Sat Jun 14 01:18:02 2014	(r267460)
@@ -15,9 +15,9 @@ Zone	Etc/UCT		0	-	UCT
 
 # The following link uses older naming conventions,
 # but it belongs here, not in the file `backward',
-# as functions like gmtime load the "GMT" file to handle leap seconds properly.
+# as functions like gmtime load the "UTC" file to handle leap seconds properly.
 # We want this to work even on installations that omit the other older names.
-Link	Etc/GMT				GMT
+Link	Etc/UTC				UTC
 
 Link	Etc/UTC				Etc/Universal
 Link	Etc/UTC				Etc/Zulu

Modified: head/contrib/tzdata/europe
==============================================================================
--- head/contrib/tzdata/europe	Sat Jun 14 01:03:24 2014	(r267459)
+++ head/contrib/tzdata/europe	Sat Jun 14 01:18:02 2014	(r267460)
@@ -6,7 +6,7 @@
 # go ahead and edit the file (and please send any changes to
 # tz@iana.org for general use in the future).
 
-# From Paul Eggert (2014-05-31):
+# From Paul Eggert (2006-03-22):
 # A good source for time zone historical data outside the U.S. is
 # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
 # San Diego: ACS Publications, Inc. (2003).
@@ -17,9 +17,6 @@
 # published semiannually.  Law sent in several helpful summaries
 # of the IATA's data after 1990.
 #
-# A reliable and entertaining source about time zones is
-# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
-#
 # Except where otherwise noted, Shanks & Pottenger is the source for
 # entries through 1991, and IATA SSIM is the source for entries afterwards.
 #
@@ -29,9 +26,9 @@
 #	Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated),
 #	which I found in the UCLA library.
 #
+#	
 #	William Willett, The Waste of Daylight, 19th edition
-#	
-#	[PDF] (1914-03)
+#	 (1914-03)
 #
 #	Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
 #	.  He writes:
@@ -61,7 +58,10 @@
 #        1:00       CET CEST CEMT Central Europe
 #        1:00:14    SET           Swedish (1879-1899)*
 #        2:00       EET EEST      Eastern Europe
-#        3:00       MSK MSD  MSM* Moscow
+#        3:00       MSK MSD       Moscow
+#
+# A reliable and entertaining source about time zones, especially in Britain,
+# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
 
 # From Peter Ilieve (1994-12-04),
 # The original six [EU members]: Belgium, France, (West) Germany, Italy,
@@ -558,11 +558,11 @@ Rule	Russia	1917	only	-	Dec	28	 0:00	0	M
 Rule	Russia	1918	only	-	May	31	22:00	2:00	MDST	# Moscow Double Summer Time
 Rule	Russia	1918	only	-	Sep	16	 1:00	1:00	MST
 Rule	Russia	1919	only	-	May	31	23:00	2:00	MDST
-Rule	Russia	1919	only	-	Jul	 1	 2:00	1:00	MSD
-Rule	Russia	1919	only	-	Aug	16	 0:00	0	MSK
-Rule	Russia	1921	only	-	Feb	14	23:00	1:00	MSD
-Rule	Russia	1921	only	-	Mar	20	23:00	2:00	MSM # Midsummer
-Rule	Russia	1921	only	-	Sep	 1	 0:00	1:00	MSD
+Rule	Russia	1919	only	-	Jul	 1	 2:00	1:00	S
+Rule	Russia	1919	only	-	Aug	16	 0:00	0	-
+Rule	Russia	1921	only	-	Feb	14	23:00	1:00	S
+Rule	Russia	1921	only	-	Mar	20	23:00	2:00	M # Midsummer
+Rule	Russia	1921	only	-	Sep	 1	 0:00	1:00	S
 Rule	Russia	1921	only	-	Oct	 1	 0:00	0	-
 # Act No.925 of the Council of Ministers of the USSR (1980-10-24):
 Rule	Russia	1981	1984	-	Apr	 1	 0:00	1:00	S
@@ -2217,7 +2217,6 @@ Zone Europe/Kaliningrad	 1:22:00 -	LMT	1
 Zone Europe/Moscow	 2:30:20 -	LMT	1880
 			 2:30	-	MMT	1916 Jul  3 # Moscow Mean Time
 			 2:30:48 Russia	%s	1919 Jul  1 2:00
-			 3:00	Russia	%s	1921 Oct
 			 3:00	Russia	MSK/MSD	1922 Oct
 			 2:00	-	EET	1930 Jun 21
 			 3:00	Russia	MSK/MSD	1991 Mar 31 2:00s
@@ -2376,7 +2375,7 @@ Zone Asia/Yakutsk	 8:38:40 -	LMT	1919 De
 Zone Asia/Vladivostok	 8:47:44 -	LMT	1922 Nov 15
 			 9:00	-	VLAT	1930 Jun 21 # Vladivostok Time
 			10:00	Russia	VLA%sT	1991 Mar 31 2:00s
-			 9:00	Russia	VLA%sT	1992 Jan 19 2:00s
+			 9:00	Russia	VLA%sST	1992 Jan 19 2:00s
 			10:00	Russia	VLA%sT	2011 Mar 27 2:00s
 			11:00	-	VLAT
 

Modified: head/contrib/tzdata/factory
==============================================================================
--- head/contrib/tzdata/factory	Sat Jun 14 01:03:24 2014	(r267459)
+++ head/contrib/tzdata/factory	Sat Jun 14 01:18:02 2014	(r267460)
@@ -7,4 +7,4 @@
 # Also useful for the "comp.sources" version.
 
 # Zone	NAME	GMTOFF	RULES	FORMAT
-Zone	Factory	0	- "Local time zone must be set--see zic manual page"
+Zone	Factory	0	- "Local time zone must be set--use tzsetup"

Modified: head/contrib/tzdata/leapseconds
==============================================================================
--- head/contrib/tzdata/leapseconds	Sat Jun 14 01:03:24 2014	(r267459)
+++ head/contrib/tzdata/leapseconds	Sat Jun 14 01:18:02 2014	(r267460)
@@ -1,20 +1,14 @@
-# Allowance for leapseconds added to each timezone file.
-
-# This file is in the public domain.
+# 
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
 
-# This file is generated automatically from the data in the public-domain
-# leap-seconds.list file available from most NIST time servers.
-# If the URL  does not work,
-# you should be able to pick up leap-seconds.list from a secondary NIST server.
-# For more about leap-seconds.list, please see
-# The NTP Timescale and Leap Seconds
-# .
+# Allowance for leapseconds added to each timezone file.
 
 # The International Earth Rotation Service periodically uses leap seconds
 # to keep UTC to within 0.9 s of UT1
 # (which measures the true angular orientation of the earth in space); see
 # Terry J Quinn, The BIPM and the accurate measure of time,
-# Proc IEEE 79, 7 (July 1991), 894-905 .
+# Proc IEEE 79, 7 (July 1991), 894-905.
 # There were no leap seconds before 1972, because the official mechanism
 # accounting for the discrepancy between atomic time and the earth's rotation
 # did not exist until the early 1970s.
@@ -25,8 +19,8 @@
 # or
 #	Leap	YEAR	MON	DAY	23:59:59	-	R/S
 
-# If the leapsecond is Rolling (R) the given time is local time.
-# If the leapsecond is Stationary (S) the given time is UTC.
+# If the leapsecond is Rolling (R) the given time is local time
+# If the leapsecond is Stationary (S) the given time is UTC
 
 # Leap	YEAR	MONTH	DAY	HH:MM:SS	CORR	R/S
 Leap	1972	Jun	30	23:59:60	+	S
@@ -54,3 +48,53 @@ Leap	1998	Dec	31	23:59:60	+	S
 Leap	2005	Dec	31	23:59:60	+	S
 Leap	2008	Dec	31	23:59:60	+	S
 Leap	2012	Jun	30	23:59:60	+	S
+
+# INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS)
+#
+# SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE REFERENCE
+#
+#
+# SERVICE DE LA ROTATION TERRESTRE
+# OBSERVATOIRE DE PARIS
+# 61, Av. de l'Observatoire 75014 PARIS (France)
+# Tel.      : 33 (0) 1 40 51 22 26
+# FAX       : 33 (0) 1 40 51 22 91
+# e-mail    : (E-Mail Removed)
+# http://hpiers.obspm.fr/eop-pc
+#
+# Paris, 5 January 2012
+#
+#
+# Bulletin C 43
+#
+# To authorities responsible
+# for the measurement and
+# distribution of time
+#
+#
+# UTC TIME STEP
+# on the 1st of July 2012
+#
+#
+# A positive leap second will be introduced at the end of June 2012.
+# The sequence of dates of the UTC second markers will be:
+#
+#                          2012 June 30,     23h 59m 59s
+#                          2012 June 30,     23h 59m 60s
+#                          2012 July  1,      0h  0m  0s
+#
+# The difference between UTC and the International Atomic Time TAI is:
+#
+# from 2009 January 1, 0h UTC, to 2012 July 1  0h UTC  : UTC-TAI = - 34s
+# from 2012 July 1,    0h UTC, until further notice    : UTC-TAI = - 35s
+#
+# Leap seconds can be introduced in UTC at the end of the months of December
+# or June, depending on the evolution of UT1-TAI. Bulletin C is mailed every
+# six months, either to announce a time step in UTC or to confirm that there
+# will be no time step at the next possible date.
+#
+#
+# Daniel GAMBIS
+# Head
+# Earth Orientation Center of IERS
+# Observatoire de Paris, France

Modified: head/contrib/tzdata/northamerica
==============================================================================
--- head/contrib/tzdata/northamerica	Sat Jun 14 01:03:24 2014	(r267459)
+++ head/contrib/tzdata/northamerica	Sat Jun 14 01:18:02 2014	(r267460)
@@ -1019,9 +1019,9 @@ Zone America/Menominee	-5:50:27 -	LMT	18
 #	Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated),
 #	which I found in the UCLA library.
 #
+#	
 #	William Willett, The Waste of Daylight, 19th edition
-#	
-#	[PDF] (1914-03)
+#	 (1914-03)
 #
 #	Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
 #	.

Modified: head/contrib/tzdata/zone.tab
==============================================================================
--- head/contrib/tzdata/zone.tab	Sat Jun 14 01:03:24 2014	(r267459)
+++ head/contrib/tzdata/zone.tab	Sat Jun 14 01:18:02 2014	(r267460)
@@ -10,7 +10,8 @@
 # zone where civil clocks have agreed since 1970.  The columns of the
 # table are as follows:
 #
-# 1.  ISO 3166 2-character country code.  See the file 'iso3166.tab'.
+# 1.  ISO 3166 2-character country code.
+#     See the file '/usr/share/misc/iso3166.tab'.
 # 2.  Latitude and longitude of the area's principal location
 #     in ISO 6709 sign-degrees-minutes-seconds format,
 #     either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 14 01:58:34 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8A142A00;
 Sat, 14 Jun 2014 01:58:34 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 776AC2D04;
 Sat, 14 Jun 2014 01:58:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5E1wXH2057831;
 Sat, 14 Jun 2014 01:58:33 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5E1wXYx057830;
 Sat, 14 Jun 2014 01:58:33 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201406140158.s5E1wXYx057830@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Sat, 14 Jun 2014 01:58:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267464 - head/usr.bin/patch
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 14 Jun 2014 01:58:34 -0000

Author: pfg
Date: Sat Jun 14 01:58:33 2014
New Revision: 267464
URL: http://svnweb.freebsd.org/changeset/base/267464

Log:
  patch: cleanup some unnecessary cruft.
  
  - Drop some bogus casts to size_t.
  - The new_p_foo variables are not needed after r267426.
  
  Pointed out by:		bde
  MFC after:		1 week

Modified:
  head/usr.bin/patch/pch.c

Modified: head/usr.bin/patch/pch.c
==============================================================================
--- head/usr.bin/patch/pch.c	Sat Jun 14 01:32:48 2014	(r267463)
+++ head/usr.bin/patch/pch.c	Sat Jun 14 01:58:33 2014	(r267464)
@@ -132,11 +132,11 @@ void
 set_hunkmax(void)
 {
 	if (p_line == NULL)
-		p_line = malloc((size_t) hunkmax * sizeof(char *));
+		p_line = malloc(hunkmax * sizeof(char *));
 	if (p_len == NULL)
-		p_len = malloc((size_t) hunkmax * sizeof(short));
+		p_len = malloc(hunkmax * sizeof(short));
 	if (p_char == NULL)
-		p_char = malloc((size_t) hunkmax * sizeof(char));
+		p_char = malloc(hunkmax * sizeof(char));
 }
 
 /*
@@ -145,23 +145,14 @@ set_hunkmax(void)
 static void
 grow_hunkmax(void)
 {
-	int		new_hunkmax;
-	char		**new_p_line;
-	short		*new_p_len;
-	char		*new_p_char;
-
-	new_hunkmax = hunkmax * 2;
+	int new_hunkmax = hunkmax * 2;
 
 	if (p_line == NULL || p_len == NULL || p_char == NULL)
 		fatal("Internal memory allocation error\n");
 
-	new_p_line = reallocf(p_line, new_hunkmax * sizeof(char *));
-	new_p_len = reallocf(p_len, new_hunkmax * sizeof(short));
-	new_p_char = reallocf(p_char, new_hunkmax * sizeof(char));
-
-	p_char = new_p_char;
-	p_len = new_p_len;
-	p_line = new_p_line;
+	p_line = reallocf(p_line, new_hunkmax * sizeof(char *));
+	p_len = reallocf(p_len, new_hunkmax * sizeof(short));
+	p_char = reallocf(p_char, new_hunkmax * sizeof(char));
 
 	if (p_line != NULL && p_len != NULL && p_char != NULL) {
 		hunkmax = new_hunkmax;

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 14 06:54:03 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 98C9537F;
 Sat, 14 Jun 2014 06:54:03 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 86AA4238E;
 Sat, 14 Jun 2014 06:54:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5E6s3LA096685;
 Sat, 14 Jun 2014 06:54:03 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5E6s3oE096684;
 Sat, 14 Jun 2014 06:54:03 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201406140654.s5E6s3oE096684@svn.freebsd.org>
From: Adrian Chadd 
Date: Sat, 14 Jun 2014 06:54:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267466 - head/sys/dev/iwn
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 14 Jun 2014 06:54:03 -0000

Author: adrian
Date: Sat Jun 14 06:54:03 2014
New Revision: 267466
URL: http://svnweb.freebsd.org/changeset/base/267466

Log:
  Shadow RAM support is apparently not at all working on the Intel 5300 Wifi.
  
  Tested:
  
  * Intel 5300 3x3 wifi
  * Intel 5100

Modified:
  head/sys/dev/iwn/if_iwn_chip_cfg.h

Modified: head/sys/dev/iwn/if_iwn_chip_cfg.h
==============================================================================
--- head/sys/dev/iwn/if_iwn_chip_cfg.h	Sat Jun 14 02:57:40 2014	(r267465)
+++ head/sys/dev/iwn/if_iwn_chip_cfg.h	Sat Jun 14 06:54:03 2014	(r267466)
@@ -116,7 +116,7 @@ struct iwn_base_params {
 static const struct iwn_base_params iwn5000_base_params = {
 	.pll_cfg_val = IWN_ANA_PLL_INIT,	/* pll_cfg_val; */
 	.max_ll_items = IWN_OTP_MAX_LL_ITEMS_6x00,	/* max_ll_items */
-	.shadow_ram_support = true,	/* shadow_ram_support */
+	.shadow_ram_support = false,	/* shadow_ram_support */
 	.shadow_reg_enable = false,	/* shadow_reg_enable */
 	.bt_session_2 = false,	/* bt_session_2 */
 	.bt_sco_disable = true,	/* bt_sco_disable */

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 14 11:34:40 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id BC324B55;
 Sat, 14 Jun 2014 11:34:40 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A7DF9283A;
 Sat, 14 Jun 2014 11:34:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5EBYeK7026905;
 Sat, 14 Jun 2014 11:34:40 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5EBYdif026901;
 Sat, 14 Jun 2014 11:34:39 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201406141134.s5EBYdif026901@svn.freebsd.org>
From: Edwin Groothuis 
Date: Sat, 14 Jun 2014 11:34:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267473 - head/contrib/tzdata
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 14 Jun 2014 11:34:40 -0000

Author: edwin
Date: Sat Jun 14 11:34:39 2014
New Revision: 267473
URL: http://svnweb.freebsd.org/changeset/base/267473

Log:
  MFV of 267471, tzdata2014e
  
  Fix historical data for Egypt.
  Better prediction for future Egypt / Morocco changes.
  Update to Cocos / Cook islands.
  Fix historical data for Russia.

Modified:
  head/contrib/tzdata/africa
  head/contrib/tzdata/australasia
  head/contrib/tzdata/europe
  head/contrib/tzdata/northamerica
Directory Properties:
  head/contrib/tzdata/   (props changed)

Modified: head/contrib/tzdata/africa
==============================================================================
--- head/contrib/tzdata/africa	Sat Jun 14 11:31:31 2014	(r267472)
+++ head/contrib/tzdata/africa	Sat Jun 14 11:34:39 2014	(r267473)
@@ -239,13 +239,13 @@ Rule	Egypt	1990	1994	-	May	 1	1:00	1:00	
 # http://www.worldtimezone.com/dst_news/dst_news_egypt04.html
 # 
 Rule	Egypt	1995	2010	-	Apr	lastFri	 0:00s	1:00	S
-Rule	Egypt	1995	2005	-	Sep	lastThu	23:00s	0	-
+Rule	Egypt	1995	2005	-	Sep	lastThu	24:00	0	-
 # From Steffen Thorsen (2006-09-19):
 # The Egyptian Gazette, issue 41,090 (2006-09-18), page 1, reports:
 # Egypt will turn back clocks by one hour at the midnight of Thursday
 # after observing the daylight saving time since May.
 # http://news.gom.com.eg/gazette/pdf/2006/09/18/01.pdf
-Rule	Egypt	2006	only	-	Sep	21	23:00s	0	-
+Rule	Egypt	2006	only	-	Sep	21	24:00	0	-
 # From Dirk Losch (2007-08-14):
 # I received a mail from an airline which says that the daylight
 # saving time in Egypt will end in the night of 2007-09-06 to 2007-09-07.
@@ -254,7 +254,7 @@ Rule	Egypt	2006	only	-	Sep	21	23:00s	0	-
 # http://www.timeanddate.com/worldclock/city.html?n=53
 # From Steffen Thorsen (2007-09-04): The official information...:
 # http://www.sis.gov.eg/En/EgyptOnline/Miscellaneous/000002/0207000000000000001580.htm
-Rule	Egypt	2007	only	-	Sep	Thu>=1	23:00s	0	-
+Rule	Egypt	2007	only	-	Sep	Thu>=1	24:00	0	-
 # From Abdelrahman Hassan (2007-09-06):
 # Due to the Hijri (lunar Islamic calendar) year being 11 days shorter
 # than the year of the Gregorian calendar, Ramadan shifts earlier each
@@ -342,46 +342,77 @@ Rule	Egypt	2007	only	-	Sep	Thu>=1	23:00s
 # From Gunther Vermier (2015-05-13):
 # our Egypt office confirms that the change will be at 15 May "midnight" (24:00)
 
-# From Paul Eggert (2014-05-13):
+# From Imed Chihi (2014-06-04):
+# We have finally "located" a precise official reference about the DST changes
+# in Egypt.  The Ministers Cabinet decision is explained at
+# http://www.cabinet.gov.eg/Media/CabinetMeetingsDetails.aspx?id=347 ...
+# [T]his (Arabic) site is not accessible outside Egypt, but the page ...
+# translates into: "With regard to daylight saving time, it is scheduled to
+# take effect at exactly twelve o'clock this evening, Thursday, 15 MAY 2014,
+# to be suspended by twelve o'clock on the evening of Thursday, 26 JUN 2014,
+# and re-established again at the end of the month of Ramadan, at twelve
+# o'clock on the evening of Thursday, 31 JUL 2014."  This statement has been
+# reproduced by other (more accessible) sites[, e.g.,]...
+# http://elgornal.net/news/news.aspx?id=4699258
+
+# From Paul Eggert (2014-06-04):
 # Sarah El Deeb and Lee Keath of AP report that the Egyptian government says
 # the change is because of blackouts in Cairo, even though Ahram Online (cited
-# above) says DST had no affect on electricity consumption.  The AP story says
-# DST will not be observed during Ramadan.  There is no information about when
-# DST will end.  See:
+# above) says DST had no affect on electricity consumption.  There is
+# no information about when DST will end this fall.  See:
 # http://abcnews.go.com/International/wireStory/el-sissi-pushes-egyptians-line-23614833
 #
-# For now, guess that later transitions will use 2010's rules, and that
-# Egypt will agree with Morocco (see below) about the date Ramadan starts and
-# ends, though (unlike Morocco) it will switch at 00:00 standard time.  In
-# Egypt the spring-forward transitions are removed for 2020-2022, when the
-# guessed spring-forward date falls during the estimated Ramadan, and all
-# transitions removed for 2023-2038, where the estimated Ramadan falls entirely
-# outside the guessed daylight-saving time.  Ramadan intrudes on the guessed
-# DST starting in 2039, but that's beyond our somewhat-arbitrary cutoff.
-
-Rule	Egypt	2008	only	-	Aug	lastThu	23:00s	0	-
-Rule	Egypt	2009	only	-	Aug	20	23:00s	0	-
-Rule	Egypt	2010	only	-	Aug	11	0:00	0	-
-Rule	Egypt	2010	only	-	Sep	10	0:00	1:00	S
-Rule	Egypt	2010	only	-	Sep	lastThu	23:00s	0	-
+# For now, guess that later spring and fall transitions will use
+# 2010's rules, and guess that Egypt will switch to standard time at
+# 24:00 the last Thursday before Ramadan, and back to DST at 00:00 the
+# first Friday after Ramadan.  To implement this,
+# transition dates for 2015 through 2037 were determined by running
+# the following program under GNU Emacs 24.3, with the results integrated
+# by hand into the table below.  Ramadan again intrudes on the guessed
+# DST starting in 2038, but that's beyond our somewhat-arbitrary cutoff.
+# (let ((islamic-year 1436))
+#   (while (< islamic-year 1460)
+#     (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year)))
+#           (b (calendar-islamic-to-absolute (list 10 1 islamic-year)))
+#           (friday 5))
+#       (while (/= friday (mod a 7))
+#         (setq a (1- a)))
+#       (while (/= friday (mod b 7))
+#         (setq b (1+ b)))
+#       (setq a (1- a))
+#       (setq b (1- b))
+#       (setq a (calendar-gregorian-from-absolute a))
+#       (setq b (calendar-gregorian-from-absolute b))
+#       (insert
+#        (format
+#         (concat "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t0\t-\n"
+#                 "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t1:00\tS\n")
+#         (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
+#         (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
+#     (setq islamic-year (+ 1 islamic-year))))
+Rule	Egypt	2008	only	-	Aug	lastThu	24:00	0	-
+Rule	Egypt	2009	only	-	Aug	20	24:00	0	-
+Rule	Egypt	2010	only	-	Aug	10	24:00	0	-
+Rule	Egypt	2010	only	-	Sep	 9	24:00	1:00	S
+Rule	Egypt	2010	only	-	Sep	lastThu	24:00	0	-
 Rule	Egypt	2014	only	-	May	15	24:00	1:00	S
-Rule	Egypt	2014	only	-	Jun	29	 0:00s	0	-
-Rule	Egypt	2014	only	-	Jul	29	 0:00s	1:00	S
-Rule	Egypt	2014	max	-	Sep	lastThu	23:00s	0	-
+Rule	Egypt	2014	only	-	Jun	26	24:00	0	-
+Rule	Egypt	2014	only	-	Jul	31	24:00	1:00	S
+Rule	Egypt	2014	max	-	Sep	lastThu	24:00	0	-
 Rule	Egypt	2015	2019	-	Apr	lastFri	 0:00s	1:00	S
-Rule	Egypt	2015	only	-	Jun	18	 0:00s	0	-
-Rule	Egypt	2015	only	-	Jul	18	 0:00s	1:00	S
-Rule	Egypt	2016	only	-	Jun	 7	 0:00s	0	-
-Rule	Egypt	2016	only	-	Jul	 7	 0:00s	1:00	S
-Rule	Egypt	2017	only	-	May	27	 0:00s	0	-
-Rule	Egypt	2017	only	-	Jun	26	 0:00s	1:00	S
-Rule	Egypt	2018	only	-	May	16	 0:00s	0	-
-Rule	Egypt	2018	only	-	Jun	15	 0:00s	1:00	S
-Rule	Egypt	2019	only	-	May	 6	 0:00s	0	-
-Rule	Egypt	2019	only	-	Jun	 5	 0:00s	1:00	S
-Rule	Egypt	2020	only	-	May	24	 0:00s	1:00	S
-Rule	Egypt	2021	only	-	May	13	 0:00s	1:00	S
-Rule	Egypt	2022	only	-	May	 3	 0:00s	1:00	S
+Rule	Egypt	2015	only	-	Jun	11	24:00	0	-
+Rule	Egypt	2015	only	-	Jul	23	24:00	1:00	S
+Rule	Egypt	2016	only	-	Jun	 2	24:00	0	-
+Rule	Egypt	2016	only	-	Jul	 7	24:00	1:00	S
+Rule	Egypt	2017	only	-	May	25	24:00	0	-
+Rule	Egypt	2017	only	-	Jun	29	24:00	1:00	S
+Rule	Egypt	2018	only	-	May	10	24:00	0	-
+Rule	Egypt	2018	only	-	Jun	14	24:00	1:00	S
+Rule	Egypt	2019	only	-	May	 2	24:00	0	-
+Rule	Egypt	2019	only	-	Jun	 6	24:00	1:00	S
+Rule	Egypt	2020	only	-	May	28	24:00	1:00	S
+Rule	Egypt	2021	only	-	May	13	24:00	1:00	S
+Rule	Egypt	2022	only	-	May	 5	24:00	1:00	S
 Rule	Egypt	2023	max	-	Apr	lastFri	 0:00s	1:00	S
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -914,39 +945,36 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # From Sebastien Willemijns (2014-03-18):
 # http://www.afriquinfos.com/articles/2014/3/18/maroc-heure-dete-avancez-tous-horloges-247891.asp
 
-# From Paul Eggert (2014-03-19):
-# To estimate what the Moroccan government will do in future years,
-# transition dates for 2014 through 2038 were determined by running
-# the following program under GNU Emacs 24.3:
-#
-# (let ((islamic-year 1435))
-#   (while (< islamic-year 1461)
-#     (let ((a
-#	     (calendar-gregorian-from-absolute
-#	      (calendar-islamic-to-absolute (list 9 1 islamic-year))))
-#	    (b
-#	     (calendar-gregorian-from-absolute
-#	      (calendar-islamic-to-absolute (list 10 1 islamic-year)))))
-#	(insert
-#	 (format
-#	  (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 3:00\t0\t-\n"
-#		  "Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 2:00\t1:00\tS\n")
-#	  (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
-#	  (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
+# From Milamber Space Network (2014-06-05):
+# The Moroccan government has recently announced that the country will return
+# to standard time at 03:00 on Saturday, June 28, 2014 local time....  DST
+# will resume again at 02:00 on Saturday, August 2, 2014....
+# http://www.mmsp.gov.ma/fr/actualites.aspx?id=586
+
+# From Paul Eggert (2014-06-05):
+# For now, guess that later spring and fall transitions will use 2014's rules,
+# and guess that Morocco will switch to standard time at 03:00 the last
+# Saturday before Ramadan, and back to DST at 02:00 the first Saturday after
+# Ramadan.  To implement this, transition dates for 2015 through 2037 were
+# determined by running the following program under GNU Emacs 24.3, with the
+# results integrated by hand into the table below.
+# (let ((islamic-year 1436))
+#   (while (< islamic-year 1460)
+#     (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year)))
+#           (b (calendar-islamic-to-absolute (list 10 1 islamic-year)))
+#           (saturday 6))
+#       (while (/= saturday (mod (setq a (1- a)) 7)))
+#       (while (/= saturday (mod b 7))
+#         (setq b (1+ b)))
+#       (setq a (calendar-gregorian-from-absolute a))
+#       (setq b (calendar-gregorian-from-absolute b))
+#       (insert
+#        (format
+#         (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 3:00\t0\t-\n"
+#                 "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 2:00\t1:00\tS\n")
+#         (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
+#         (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
 #     (setq islamic-year (+ 1 islamic-year))))
-#
-# with spring-forward transitions removed for 2023-2025, when the
-# normal spring-forward date falls during the estimated Ramadan; with
-# all transitions removed for 2026-2035, where the estimated Ramadan
-# falls entirely outside daylight-saving time; and with fall-back
-# transitions removed for 2036-2037, where the normal fall-back
-# date falls during the estimated Ramadan.  Normally, the table would
-# stop after 2037 because 32-bit time_t values roll around early in 2038,
-# but that would imply a prediction of perpetual DST after March 2038
-# due to the year-2037 glitches.  So, this table instead stops after
-# 2038, the first non-glitchy year after the 32-bit rollover.
-# An advantage of stopping after 2038 is that it lets zic guess
-# TZ='WET0WEST,M3.5.0,M10.5.0/3' for time stamps far in the future.
 
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 
@@ -968,46 +996,44 @@ Rule	Morocco	1978	only	-	Aug	 4	 0:00	0	
 Rule	Morocco	2008	only	-	Jun	 1	 0:00	1:00	S
 Rule	Morocco	2008	only	-	Sep	 1	 0:00	0	-
 Rule	Morocco	2009	only	-	Jun	 1	 0:00	1:00	S
-Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
+Rule	Morocco	2009	only	-	Aug	21	 0:00	0	-
 Rule	Morocco	2010	only	-	May	 2	 0:00	1:00	S
 Rule	Morocco	2010	only	-	Aug	 8	 0:00	0	-
 Rule	Morocco	2011	only	-	Apr	 3	 0:00	1:00	S
-Rule	Morocco	2011	only	-	Jul	 31	 0	0	-
-Rule	Morocco	2012	2013	-	Apr	 lastSun 2:00	1:00	S
-Rule	Morocco	2012	only	-	Sep	 30	 3:00	0	-
-Rule	Morocco	2012	only	-	Jul	 20	 3:00	0	-
-Rule	Morocco	2012	only	-	Aug	 20	 2:00	1:00	S
-Rule	Morocco	2013	only	-	Jul	  7	 3:00	0	-
-Rule	Morocco	2013	only	-	Aug	 10	 2:00	1:00	S
-Rule	Morocco	2013	2035	-	Oct	 lastSun 3:00	0	-
-Rule	Morocco	2014	2022	-	Mar	 lastSun 2:00	1:00	S
-Rule	Morocco	2014	only	-	Jun	 29	 3:00	0	-
-Rule	Morocco	2014	only	-	Jul	 29	 2:00	1:00	S
-Rule	Morocco	2015	only	-	Jun	 18	 3:00	0	-
-Rule	Morocco	2015	only	-	Jul	 18	 2:00	1:00	S
-Rule	Morocco	2016	only	-	Jun	  7	 3:00	0	-
-Rule	Morocco	2016	only	-	Jul	  7	 2:00	1:00	S
-Rule	Morocco	2017	only	-	May	 27	 3:00	0	-
-Rule	Morocco	2017	only	-	Jun	 26	 2:00	1:00	S
-Rule	Morocco	2018	only	-	May	 16	 3:00	0	-
-Rule	Morocco	2018	only	-	Jun	 15	 2:00	1:00	S
-Rule	Morocco	2019	only	-	May	  6	 3:00	0	-
-Rule	Morocco	2019	only	-	Jun	  5	 2:00	1:00	S
-Rule	Morocco	2020	only	-	Apr	 24	 3:00	0	-
-Rule	Morocco	2020	only	-	May	 24	 2:00	1:00	S
-Rule	Morocco	2021	only	-	Apr	 13	 3:00	0	-
-Rule	Morocco	2021	only	-	May	 13	 2:00	1:00	S
-Rule	Morocco	2022	only	-	Apr	  3	 3:00	0	-
-Rule	Morocco	2022	only	-	May	  3	 2:00	1:00	S
-Rule	Morocco	2023	only	-	Apr	 22	 2:00	1:00	S
-Rule	Morocco	2024	only	-	Apr	 10	 2:00	1:00	S
-Rule	Morocco	2025	only	-	Mar	 31	 2:00	1:00	S
-Rule	Morocco	2026	max	-	Mar	 lastSun 2:00	1:00	S
-Rule	Morocco	2036	only	-	Oct	 21	 3:00	0	-
-Rule	Morocco	2037	only	-	Oct	 11	 3:00	0	-
-Rule	Morocco	2038	only	-	Sep	 30	 3:00	0	-
-Rule	Morocco	2038	only	-	Oct	 30	 2:00	1:00	S
-Rule	Morocco	2038	max	-	Oct	 lastSun 3:00	0	-
+Rule	Morocco	2011	only	-	Jul	31	 0	0	-
+Rule	Morocco	2012	2013	-	Apr	lastSun	 2:00	1:00	S
+Rule	Morocco	2012	only	-	Sep	30	 3:00	0	-
+Rule	Morocco	2012	only	-	Jul	20	 3:00	0	-
+Rule	Morocco	2012	only	-	Aug	20	 2:00	1:00	S
+Rule	Morocco	2013	only	-	Jul	 7	 3:00	0	-
+Rule	Morocco	2013	only	-	Aug	10	 2:00	1:00	S
+Rule	Morocco	2013	max	-	Oct	lastSun	 3:00	0	-
+Rule	Morocco	2014	2022	-	Mar	lastSun	 2:00	1:00	S
+Rule	Morocco	2014	only	-	Jun	28	 3:00	0	-
+Rule	Morocco	2014	only	-	Aug	 2	 2:00	1:00	S
+Rule	Morocco	2015	only	-	Jun	13	 3:00	0	-
+Rule	Morocco	2015	only	-	Jul	18	 2:00	1:00	S
+Rule	Morocco	2016	only	-	Jun	 4	 3:00	0	-
+Rule	Morocco	2016	only	-	Jul	 9	 2:00	1:00	S
+Rule	Morocco	2017	only	-	May	20	 3:00	0	-
+Rule	Morocco	2017	only	-	Jul	 1	 2:00	1:00	S
+Rule	Morocco	2018	only	-	May	12	 3:00	0	-
+Rule	Morocco	2018	only	-	Jun	16	 2:00	1:00	S
+Rule	Morocco	2019	only	-	May	 4	 3:00	0	-
+Rule	Morocco	2019	only	-	Jun	 8	 2:00	1:00	S
+Rule	Morocco	2020	only	-	Apr	18	 3:00	0	-
+Rule	Morocco	2020	only	-	May	30	 2:00	1:00	S
+Rule	Morocco	2021	only	-	Apr	10	 3:00	0	-
+Rule	Morocco	2021	only	-	May	15	 2:00	1:00	S
+Rule	Morocco	2022	only	-	Apr	 2	 3:00	0	-
+Rule	Morocco	2022	only	-	May	 7	 2:00	1:00	S
+Rule	Morocco	2023	only	-	Apr	22	 2:00	1:00	S
+Rule	Morocco	2024	only	-	Apr	13	 2:00	1:00	S
+Rule	Morocco	2025	only	-	Apr	 5	 2:00	1:00	S
+Rule	Morocco	2026	max	-	Mar	lastSun	 2:00	1:00	S
+Rule	Morocco	2035	only	-	Oct	27	 3:00	0	-
+Rule	Morocco	2036	only	-	Oct	18	 3:00	0	-
+Rule	Morocco	2037	only	-	Oct	10	 3:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26

Modified: head/contrib/tzdata/australasia
==============================================================================
--- head/contrib/tzdata/australasia	Sat Jun 14 11:31:31 2014	(r267472)
+++ head/contrib/tzdata/australasia	Sat Jun 14 11:34:39 2014	(r267473)
@@ -250,24 +250,14 @@ Zone Antarctica/Macquarie 0	-	zzz	1899 N
 Zone Indian/Christmas	7:02:52 -	LMT	1895 Feb
 			7:00	-	CXT	# Christmas Island Time
 
-# Cook Is
-# From Shanks & Pottenger:
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Cook	1978	only	-	Nov	12	0:00	0:30	HS
-Rule	Cook	1979	1991	-	Mar	Sun>=1	0:00	0	-
-Rule	Cook	1979	1990	-	Oct	lastSun	0:00	0:30	HS
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Pacific/Rarotonga	-10:39:04 -	LMT	1901		# Avarua
-			-10:30	-	CKT	1978 Nov 12	# Cook Is Time
-			-10:00	Cook	CK%sT
-
-# Cocos
+# Cocos (Keeling) Is
 # These islands were ruled by the Ross family from about 1830 to 1978.
 # We don't know when standard time was introduced; for now, we guess 1900.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Indian/Cocos	6:27:40	-	LMT	1900
 			6:30	-	CCT	# Cocos Islands Time
 
+
 # Fiji
 
 # Milne gives 11:55:44 for Suva.
@@ -473,7 +463,8 @@ Rule	NZ	1934	1940	-	Apr	lastSun	2:00	0	M
 Rule	NZ	1934	1940	-	Sep	lastSun	2:00	0:30	S
 Rule	NZ	1946	only	-	Jan	 1	0:00	0	S
 # Since 1957 Chatham has been 45 minutes ahead of NZ, but there's no
-# convenient notation for this so we must duplicate the Rule lines.
+# convenient single notation for the date and time of this transition
+# so we must duplicate the Rule lines.
 Rule	NZ	1974	only	-	Nov	Sun>=1	2:00s	1:00	D
 Rule	Chatham	1974	only	-	Nov	Sun>=1	2:45s	1:00	D
 Rule	NZ	1975	only	-	Feb	lastSun	2:00s	0	S
@@ -511,6 +502,17 @@ Link Pacific/Auckland Antarctica/McMurdo
 # previously whalers, sealers, pastoralists, and scientific personnel wintered
 # was probably like Pacific/Auckland
 
+# Cook Is
+# From Shanks & Pottenger:
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Cook	1978	only	-	Nov	12	0:00	0:30	HS
+Rule	Cook	1979	1991	-	Mar	Sun>=1	0:00	0	-
+Rule	Cook	1979	1990	-	Oct	lastSun	0:00	0:30	HS
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Pacific/Rarotonga	-10:39:04 -	LMT	1901		# Avarua
+			-10:30	-	CKT	1978 Nov 12	# Cook Is Time
+			-10:00	Cook	CK%sT
+
 ###############################################################################
 
 

Modified: head/contrib/tzdata/europe
==============================================================================
--- head/contrib/tzdata/europe	Sat Jun 14 11:31:31 2014	(r267472)
+++ head/contrib/tzdata/europe	Sat Jun 14 11:34:39 2014	(r267473)
@@ -6,7 +6,7 @@
 # go ahead and edit the file (and please send any changes to
 # tz@iana.org for general use in the future).
 
-# From Paul Eggert (2006-03-22):
+# From Paul Eggert (2014-05-31):
 # A good source for time zone historical data outside the U.S. is
 # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
 # San Diego: ACS Publications, Inc. (2003).
@@ -17,6 +17,9 @@
 # published semiannually.  Law sent in several helpful summaries
 # of the IATA's data after 1990.
 #
+# A reliable and entertaining source about time zones is
+# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
+#
 # Except where otherwise noted, Shanks & Pottenger is the source for
 # entries through 1991, and IATA SSIM is the source for entries afterwards.
 #
@@ -26,9 +29,9 @@
 #	Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated),
 #	which I found in the UCLA library.
 #
-#	
 #	William Willett, The Waste of Daylight, 19th edition
-#	 (1914-03)
+#	
+#	[PDF] (1914-03)
 #
 #	Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
 #	.  He writes:
@@ -58,10 +61,7 @@
 #        1:00       CET CEST CEMT Central Europe
 #        1:00:14    SET           Swedish (1879-1899)*
 #        2:00       EET EEST      Eastern Europe
-#        3:00       MSK MSD       Moscow
-#
-# A reliable and entertaining source about time zones, especially in Britain,
-# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
+#        3:00       MSK MSD  MSM* Moscow
 
 # From Peter Ilieve (1994-12-04),
 # The original six [EU members]: Belgium, France, (West) Germany, Italy,
@@ -558,11 +558,11 @@ Rule	Russia	1917	only	-	Dec	28	 0:00	0	M
 Rule	Russia	1918	only	-	May	31	22:00	2:00	MDST	# Moscow Double Summer Time
 Rule	Russia	1918	only	-	Sep	16	 1:00	1:00	MST
 Rule	Russia	1919	only	-	May	31	23:00	2:00	MDST
-Rule	Russia	1919	only	-	Jul	 1	 2:00	1:00	S
-Rule	Russia	1919	only	-	Aug	16	 0:00	0	-
-Rule	Russia	1921	only	-	Feb	14	23:00	1:00	S
-Rule	Russia	1921	only	-	Mar	20	23:00	2:00	M # Midsummer
-Rule	Russia	1921	only	-	Sep	 1	 0:00	1:00	S
+Rule	Russia	1919	only	-	Jul	 1	 2:00	1:00	MSD
+Rule	Russia	1919	only	-	Aug	16	 0:00	0	MSK
+Rule	Russia	1921	only	-	Feb	14	23:00	1:00	MSD
+Rule	Russia	1921	only	-	Mar	20	23:00	2:00	MSM # Midsummer
+Rule	Russia	1921	only	-	Sep	 1	 0:00	1:00	MSD
 Rule	Russia	1921	only	-	Oct	 1	 0:00	0	-
 # Act No.925 of the Council of Ministers of the USSR (1980-10-24):
 Rule	Russia	1981	1984	-	Apr	 1	 0:00	1:00	S
@@ -2217,6 +2217,7 @@ Zone Europe/Kaliningrad	 1:22:00 -	LMT	1
 Zone Europe/Moscow	 2:30:20 -	LMT	1880
 			 2:30	-	MMT	1916 Jul  3 # Moscow Mean Time
 			 2:30:48 Russia	%s	1919 Jul  1 2:00
+			 3:00	Russia	%s	1921 Oct
 			 3:00	Russia	MSK/MSD	1922 Oct
 			 2:00	-	EET	1930 Jun 21
 			 3:00	Russia	MSK/MSD	1991 Mar 31 2:00s
@@ -2375,7 +2376,7 @@ Zone Asia/Yakutsk	 8:38:40 -	LMT	1919 De
 Zone Asia/Vladivostok	 8:47:44 -	LMT	1922 Nov 15
 			 9:00	-	VLAT	1930 Jun 21 # Vladivostok Time
 			10:00	Russia	VLA%sT	1991 Mar 31 2:00s
-			 9:00	Russia	VLA%sST	1992 Jan 19 2:00s
+			 9:00	Russia	VLA%sT	1992 Jan 19 2:00s
 			10:00	Russia	VLA%sT	2011 Mar 27 2:00s
 			11:00	-	VLAT
 

Modified: head/contrib/tzdata/northamerica
==============================================================================
--- head/contrib/tzdata/northamerica	Sat Jun 14 11:31:31 2014	(r267472)
+++ head/contrib/tzdata/northamerica	Sat Jun 14 11:34:39 2014	(r267473)
@@ -1019,9 +1019,9 @@ Zone America/Menominee	-5:50:27 -	LMT	18
 #	Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated),
 #	which I found in the UCLA library.
 #
-#	
 #	William Willett, The Waste of Daylight, 19th edition
-#	 (1914-03)
+#	
+#	[PDF] (1914-03)
 #
 #	Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
 #	.

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 14 12:17:45 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8B8BEAF6;
 Sat, 14 Jun 2014 12:17:45 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 782C02B47;
 Sat, 14 Jun 2014 12:17:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5ECHjU3046080;
 Sat, 14 Jun 2014 12:17:45 GMT
 (envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5ECHjCl046079;
 Sat, 14 Jun 2014 12:17:45 GMT
 (envelope-from brueffer@svn.freebsd.org)
Message-Id: <201406141217.s5ECHjCl046079@svn.freebsd.org>
From: Christian Brueffer 
Date: Sat, 14 Jun 2014 12:17:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267478 - head/contrib/openbsm/libbsm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 14 Jun 2014 12:17:45 -0000

Author: brueffer
Date: Sat Jun 14 12:17:45 2014
New Revision: 267478
URL: http://svnweb.freebsd.org/changeset/base/267478

Log:
  MFp4: change 1191346
  
  In print_header32_tok(), correct printing in the XML case.  This lead to
  invalid XML files before.
  
  PR:		176259
  Submitted by:	zi
  MFC after:	3 days

Modified:
  head/contrib/openbsm/libbsm/bsm_io.c

Modified: head/contrib/openbsm/libbsm/bsm_io.c
==============================================================================
--- head/contrib/openbsm/libbsm/bsm_io.c	Sat Jun 14 11:46:22 2014	(r267477)
+++ head/contrib/openbsm/libbsm/bsm_io.c	Sat Jun 14 12:17:45 2014	(r267478)
@@ -949,7 +949,7 @@ print_header32_tok(FILE *fp, tokenstr_t 
 {
 
 	print_tok_type(fp, tok->id, "header", oflags);
-	if (oflags & AU_OFLAG_RAW) {
+	if (oflags & AU_OFLAG_XML) {
 		open_attr(fp, "version");
 		print_1_byte(fp, tok->tt.hdr32.version, "%u");
 		close_attr(fp);

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 14 12:26:12 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id DE757D27;
 Sat, 14 Jun 2014 12:26:12 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B13BB2BF7;
 Sat, 14 Jun 2014 12:26:12 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5ECQCqv050380;
 Sat, 14 Jun 2014 12:26:12 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5ECQCUo050378;
 Sat, 14 Jun 2014 12:26:12 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406141226.s5ECQCUo050378@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 14 Jun 2014 12:26:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267479 - head/sys/nfs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 14 Jun 2014 12:26:13 -0000

Author: mav
Date: Sat Jun 14 12:26:12 2014
New Revision: 267479
URL: http://svnweb.freebsd.org/changeset/base/267479

Log:
  Fix/improve fhe_stats sysctl output.
  
  MFC after:	2 weeks

Modified:
  head/sys/nfs/nfs_fha.c

Modified: head/sys/nfs/nfs_fha.c
==============================================================================
--- head/sys/nfs/nfs_fha.c	Sat Jun 14 12:17:45 2014	(r267478)
+++ head/sys/nfs/nfs_fha.c	Sat Jun 14 12:26:12 2014	(r267479)
@@ -468,14 +468,14 @@ fha_nd_complete(SVCTHREAD *thread, struc
 int
 fhe_stats_sysctl(SYSCTL_HANDLER_ARGS, struct fha_params *softc)
 {
-	int error, count, i;
+	int error, i;
 	struct sbuf sb;
 	struct fha_hash_entry *fhe;
-	bool_t first = TRUE;
+	bool_t first, hfirst;
 	SVCTHREAD *thread;
 	SVCPOOL *pool;
 
-	sbuf_new(&sb, NULL, 4096, SBUF_FIXEDLEN);
+	sbuf_new(&sb, NULL, 65536, SBUF_FIXEDLEN);
 
 	pool = NULL;
 
@@ -485,42 +485,44 @@ fhe_stats_sysctl(SYSCTL_HANDLER_ARGS, st
 	}
 	pool = *softc->pool;
 
-	count = 0;
 	for (i = 0; i < FHA_HASH_SIZE; i++)
 		if (!LIST_EMPTY(&softc->fha_hash[i].list))
-			count++;
+			break;
 
-	if (count == 0) {
+	if (i == FHA_HASH_SIZE) {
 		sbuf_printf(&sb, "No file handle entries.\n");
 		goto out;
 	}
 
-	for (i = 0; i < FHA_HASH_SIZE; i++) {
+	hfirst = TRUE;
+	for (; i < FHA_HASH_SIZE; i++) {
 		mtx_lock(&softc->fha_hash[i].mtx);
+		if (LIST_EMPTY(&softc->fha_hash[i].list)) {
+			mtx_unlock(&softc->fha_hash[i].mtx);
+			continue;
+		}
+		sbuf_printf(&sb, "%shash %d: {\n", hfirst ? "" : ", ", i);
+		first = TRUE;
 		LIST_FOREACH(fhe, &softc->fha_hash[i].list, link) {
-			sbuf_printf(&sb, "%sfhe %p: {\n", first ? "" : ", ", fhe);
+			sbuf_printf(&sb, "%sfhe %p: {\n", first ? "  " : ", ", fhe);
 
 			sbuf_printf(&sb, "    fh: %ju\n", (uintmax_t) fhe->fh);
-			sbuf_printf(&sb, "    num_rw: %d\n", fhe->num_rw);
-			sbuf_printf(&sb, "    num_exclusive: %d\n", fhe->num_exclusive);
+			sbuf_printf(&sb, "    num_rw/exclusive: %d/%d\n",
+			    fhe->num_rw, fhe->num_exclusive);
 			sbuf_printf(&sb, "    num_threads: %d\n", fhe->num_threads);
 
 			LIST_FOREACH(thread, &fhe->threads, st_alink) {
-				sbuf_printf(&sb, "    thread %p offset %ju "
-				    "(count %d)\n", thread,
+				sbuf_printf(&sb, "      thread %p offset %ju "
+				    "reqs %d\n", thread,
 				    thread->st_p3, thread->st_p2);
 			}
 
-			sbuf_printf(&sb, "}");
+			sbuf_printf(&sb, "  }");
 			first = FALSE;
-
-			/* Limit the output. */
-			if (++count > 128) {
-				sbuf_printf(&sb, "...");
-				break;
-			}
 		}
+		sbuf_printf(&sb, "\n}");
 		mtx_unlock(&softc->fha_hash[i].mtx);
+		hfirst = FALSE;
 	}
 
  out:

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 14 12:30:44 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 92006E8B;
 Sat, 14 Jun 2014 12:30:44 +0000 (UTC)
Received: from mailrelay001.isp.belgacom.be (mailrelay001.isp.belgacom.be
 [195.238.6.51]) by mx1.freebsd.org (Postfix) with ESMTP id CEB6A2C0F;
 Sat, 14 Jun 2014 12:30:43 +0000 (UTC)
X-Belgacom-Dynamic: yes
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AlYGAGo/nFNR8m3d/2dsb2JhbABagw1Sw20BgQIXdYQDAQEFOhwjEAsOBgQJJQ8qHgYTiEYBCM9bF45fB4RBAQOaPIFEkhWDQDs
Received: from 221.109-242-81.adsl-dyn.isp.belgacom.be (HELO
 kalimero.tijl.coosemans.org) ([81.242.109.221])
 by relay.skynet.be with ESMTP; 14 Jun 2014 14:29:32 +0200
Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org
 [127.0.0.1])
 by kalimero.tijl.coosemans.org (8.14.9/8.14.9) with ESMTP id s5ECTVl7001724;
 Sat, 14 Jun 2014 14:29:31 +0200 (CEST)
 (envelope-from tijl@FreeBSD.org)
Date: Sat, 14 Jun 2014 14:29:31 +0200
From: Tijl Coosemans 
To: Benjamin Kaduk 
Subject: Re: svn commit: r267441 - in head: include tools/build/mk
Message-ID: <20140614142931.4033afa1@kalimero.tijl.coosemans.org>
In-Reply-To: 
References: <201406131008.s5DA8IgS016938@svn.freebsd.org>
 
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 14 Jun 2014 12:30:44 -0000

On Fri, 13 Jun 2014 10:43:28 -0400 Benjamin Kaduk wrote:
> On Fri, Jun 13, 2014 at 6:08 AM, Tijl Coosemans  wrote:
>> Author: tijl
>> Date: Fri Jun 13 10:08:18 2014
>> New Revision: 267441
>> URL: http://svnweb.freebsd.org/changeset/base/267441
>>
>> Log:
>>   Don't install GSS-API headers when the GSSAPI option has been disabled.
>>   Some ports assume GSS-API is supported when they find the headers.
> 
> I am somewhat surprised that MK_GSSAPI=no does not disable the installation
> of gssapi_krb5.h as well, which currently is controlled by MK_KERBEROS.
>  Does the infrastructure require that we pick one or the other, or could we
> make it such that disabling either one disables the gssapi_krb5
> functionality?

The GSSAPI option controls the compilation of lib/libgssapi and
gssapi_krb5.h belongs to a different library under kerberos/.

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 14 17:47:46 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 679DB760;
 Sat, 14 Jun 2014 17:47:46 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 53D85217E;
 Sat, 14 Jun 2014 17:47:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5EHlj0P096359;
 Sat, 14 Jun 2014 17:47:45 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5EHliZL096351;
 Sat, 14 Jun 2014 17:47:44 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406141747.s5EHliZL096351@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 14 Jun 2014 17:47:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267481 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 14 Jun 2014 17:47:46 -0000

Author: mav
Date: Sat Jun 14 17:47:44 2014
New Revision: 267481
URL: http://svnweb.freebsd.org/changeset/base/267481

Log:
  Implement small KPI to access LUN options instead doing it by hands.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/ctl/ctl_backend.c
  head/sys/cam/ctl/ctl_backend.h
  head/sys/cam/ctl/ctl_backend_block.c
  head/sys/cam/ctl/ctl_backend_ramdisk.c
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl_backend.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend.c	Sat Jun 14 12:56:07 2014	(r267480)
+++ head/sys/cam/ctl/ctl_backend.c	Sat Jun 14 17:47:44 2014	(r267481)
@@ -173,6 +173,45 @@ ctl_backend_find(char *backend_name)
 	return (NULL);
 }
 
-/*
- * vim: ts=8
- */
+void
+ctl_init_opts(struct ctl_be_lun *be_lun, struct ctl_lun_req *req)
+{
+	struct ctl_be_lun_option *opt;
+	int i;
+
+	STAILQ_INIT(&be_lun->options);
+	for (i = 0; i < req->num_be_args; i++) {
+		opt = malloc(sizeof(*opt), M_CTL, M_WAITOK);
+		opt->name = malloc(strlen(req->kern_be_args[i].kname) + 1, M_CTL, M_WAITOK);
+		strcpy(opt->name, req->kern_be_args[i].kname);
+		opt->value = malloc(strlen(req->kern_be_args[i].kvalue) + 1, M_CTL, M_WAITOK);
+		strcpy(opt->value, req->kern_be_args[i].kvalue);
+		STAILQ_INSERT_TAIL(&be_lun->options, opt, links);
+	}
+}
+
+void
+ctl_free_opts(struct ctl_be_lun *be_lun)
+{
+	struct ctl_be_lun_option *opt;
+
+	while ((opt = STAILQ_FIRST(&be_lun->options)) != NULL) {
+		STAILQ_REMOVE_HEAD(&be_lun->options, links);
+		free(opt->name, M_CTL);
+		free(opt->value, M_CTL);
+		free(opt, M_CTL);
+	}
+}
+
+char *
+ctl_get_opt(struct ctl_be_lun *be_lun, const char *name)
+{
+	struct ctl_be_lun_option *opt;
+
+	STAILQ_FOREACH(opt, &be_lun->options, links) {
+		if (strcmp(opt->name, name) == 0) {
+			return (opt->value);
+		}
+	}
+	return (NULL);
+}

Modified: head/sys/cam/ctl/ctl_backend.h
==============================================================================
--- head/sys/cam/ctl/ctl_backend.h	Sat Jun 14 12:56:07 2014	(r267480)
+++ head/sys/cam/ctl/ctl_backend.h	Sat Jun 14 17:47:44 2014	(r267481)
@@ -301,6 +301,14 @@ int ctl_lun_online(struct ctl_be_lun *be
  */
 void ctl_lun_capacity_changed(struct ctl_be_lun *be_lun);
 
+/*
+ * KPI to manipulate LUN options
+ */
+struct ctl_lun_req;
+void ctl_init_opts(struct ctl_be_lun *be_lun, struct ctl_lun_req *req);
+void ctl_free_opts(struct ctl_be_lun *be_lun);
+char * ctl_get_opt(struct ctl_be_lun *be_lun, const char *name);
+
 #endif /* _KERNEL */
 #endif /* _CTL_BACKEND_H_ */
 

Modified: head/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_block.c	Sat Jun 14 12:56:07 2014	(r267480)
+++ head/sys/cam/ctl/ctl_backend_block.c	Sat Jun 14 17:47:44 2014	(r267481)
@@ -1822,9 +1822,12 @@ ctl_be_block_create(struct ctl_be_block_
 	struct ctl_be_block_lun *be_lun;
 	struct ctl_lun_create_params *params;
 	struct ctl_be_arg *file_arg;
+	char num_thread_str[16];
 	char tmpstr[32];
+	char *value;
 	int retval, num_threads, unmap;
 	int i;
+	int tmp_num_threads;
 
 	params = &req->reqdata.create;
 	retval = 0;
@@ -1839,9 +1842,9 @@ ctl_be_block_create(struct ctl_be_block_
 	STAILQ_INIT(&be_lun->input_queue);
 	STAILQ_INIT(&be_lun->config_write_queue);
 	STAILQ_INIT(&be_lun->datamove_queue);
-	STAILQ_INIT(&be_lun->ctl_be_lun.options);
 	sprintf(be_lun->lunname, "cblk%d", softc->num_luns);
 	mtx_init(&be_lun->lock, be_lun->lunname, NULL, MTX_DEF);
+	ctl_init_opts(&be_lun->ctl_be_lun, req);
 
 	be_lun->lun_zone = uma_zcreate(be_lun->lunname, CTLBLK_MAX_SEG,
 	    NULL, NULL, NULL, NULL, /*align*/ 0, /*flags*/0);
@@ -1914,50 +1917,27 @@ ctl_be_block_create(struct ctl_be_block_
 	 * XXX This searching loop might be refactored to be combined with
 	 * the loop above,
 	 */
-	unmap = 0;
-	for (i = 0; i < req->num_be_args; i++) {
-		if (strcmp(req->kern_be_args[i].kname, "num_threads") == 0) {
-			struct ctl_be_arg *thread_arg;
-			char num_thread_str[16];
-			int tmp_num_threads;
-
-
-			thread_arg = &req->kern_be_args[i];
-
-			strlcpy(num_thread_str, (char *)thread_arg->kvalue,
-				min(thread_arg->vallen,
-				sizeof(num_thread_str)));
-
-			tmp_num_threads = strtol(num_thread_str, NULL, 0);
-
-			/*
-			 * We don't let the user specify less than one
-			 * thread, but hope he's clueful enough not to
-			 * specify 1000 threads.
-			 */
-			if (tmp_num_threads < 1) {
-				snprintf(req->error_str, sizeof(req->error_str),
-					 "%s: invalid number of threads %s",
-				         __func__, num_thread_str);
-				goto bailout_error;
-			}
+	value = ctl_get_opt(&be_lun->ctl_be_lun, "num_threads");
+	if (value != NULL) {
+		tmp_num_threads = strtol(value, NULL, 0);
 
-			num_threads = tmp_num_threads;
-		} else if (strcmp(req->kern_be_args[i].kname, "unmap") == 0 &&
-		    strcmp(req->kern_be_args[i].kvalue, "on") == 0) {
-			unmap = 1;
-		} else if (strcmp(req->kern_be_args[i].kname, "file") != 0 &&
-		    strcmp(req->kern_be_args[i].kname, "dev") != 0) {
-			struct ctl_be_lun_option *opt;
-
-			opt = malloc(sizeof(*opt), M_CTLBLK, M_WAITOK);
-			opt->name = malloc(strlen(req->kern_be_args[i].kname) + 1, M_CTLBLK, M_WAITOK);
-			strcpy(opt->name, req->kern_be_args[i].kname);
-			opt->value = malloc(strlen(req->kern_be_args[i].kvalue) + 1, M_CTLBLK, M_WAITOK);
-			strcpy(opt->value, req->kern_be_args[i].kvalue);
-			STAILQ_INSERT_TAIL(&be_lun->ctl_be_lun.options, opt, links);
+		/*
+		 * We don't let the user specify less than one
+		 * thread, but hope he's clueful enough not to
+		 * specify 1000 threads.
+		 */
+		if (tmp_num_threads < 1) {
+			snprintf(req->error_str, sizeof(req->error_str),
+				 "%s: invalid number of threads %s",
+			         __func__, num_thread_str);
+			goto bailout_error;
 		}
+		num_threads = tmp_num_threads;
 	}
+	unmap = 0;
+	value = ctl_get_opt(&be_lun->ctl_be_lun, "unmap");
+	if (value != NULL && strcmp(value, "on") == 0)
+		unmap = 1;
 
 	be_lun->flags = CTL_BE_BLOCK_LUN_UNCONFIGURED;
 	be_lun->ctl_be_lun.flags = CTL_LUN_FLAG_PRIMARY;
@@ -2120,6 +2100,7 @@ bailout_error:
 		free(be_lun->dev_path, M_CTLBLK);
 	if (be_lun->lun_zone != NULL)
 		uma_zdestroy(be_lun->lun_zone);
+	ctl_free_opts(&be_lun->ctl_be_lun);
 	mtx_destroy(&be_lun->lock);
 	free(be_lun, M_CTLBLK);
 
@@ -2206,6 +2187,7 @@ ctl_be_block_rm(struct ctl_be_block_soft
 
 	uma_zdestroy(be_lun->lun_zone);
 
+	ctl_free_opts(&be_lun->ctl_be_lun);
 	free(be_lun->dev_path, M_CTLBLK);
 
 	free(be_lun, M_CTLBLK);

Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_ramdisk.c	Sat Jun 14 12:56:07 2014	(r267480)
+++ head/sys/cam/ctl/ctl_backend_ramdisk.c	Sat Jun 14 17:47:44 2014	(r267481)
@@ -502,6 +502,7 @@ ctl_backend_ramdisk_rm(struct ctl_be_ram
 	if (retval == 0) {
 		taskqueue_drain(be_lun->io_taskqueue, &be_lun->io_task);
 		taskqueue_free(be_lun->io_taskqueue);
+		ctl_free_opts(&be_lun->ctl_be_lun);
 		mtx_destroy(&be_lun->lock);
 		free(be_lun, M_RAMDISK);
 	}
@@ -523,8 +524,9 @@ ctl_backend_ramdisk_create(struct ctl_be
 	struct ctl_be_ramdisk_lun *be_lun;
 	struct ctl_lun_create_params *params;
 	uint32_t blocksize;
+	char *value;
 	char tmpstr[32];
-	int i, retval, unmap;
+	int retval, unmap;
 
 	retval = 0;
 	params = &req->reqdata.create;
@@ -543,7 +545,7 @@ ctl_backend_ramdisk_create(struct ctl_be
 		goto bailout_error;
 	}
 	sprintf(be_lun->lunname, "cram%d", softc->num_luns);
-	STAILQ_INIT(&be_lun->ctl_be_lun.options);
+	ctl_init_opts(&be_lun->ctl_be_lun, req);
 
 	if (params->flags & CTL_LUN_FLAG_DEV_TYPE)
 		be_lun->ctl_be_lun.lun_type = params->device_type;
@@ -581,21 +583,9 @@ ctl_backend_ramdisk_create(struct ctl_be
 	be_lun->softc = softc;
 
 	unmap = 0;
-	for (i = 0; i < req->num_be_args; i++) {
-		if (strcmp(req->kern_be_args[i].kname, "unmap") == 0 &&
-		    strcmp(req->kern_be_args[i].kvalue, "on") == 0) {
-			unmap = 1;
-		} else {
-			struct ctl_be_lun_option *opt;
-
-			opt = malloc(sizeof(*opt), M_RAMDISK, M_WAITOK);
-			opt->name = malloc(strlen(req->kern_be_args[i].kname) + 1, M_RAMDISK, M_WAITOK);
-			strcpy(opt->name, req->kern_be_args[i].kname);
-			opt->value = malloc(strlen(req->kern_be_args[i].kvalue) + 1, M_RAMDISK, M_WAITOK);
-			strcpy(opt->value, req->kern_be_args[i].kvalue);
-			STAILQ_INSERT_TAIL(&be_lun->ctl_be_lun.options, opt, links);
-		}
-	}
+	value = ctl_get_opt(&be_lun->ctl_be_lun, "unmap");
+	if (value != NULL && strcmp(value, "on") == 0)
+		unmap = 1;
 
 	be_lun->flags = CTL_BE_RAMDISK_LUN_UNCONFIGURED;
 	be_lun->ctl_be_lun.flags = CTL_LUN_FLAG_PRIMARY;
@@ -728,6 +718,7 @@ bailout_error:
 		if (be_lun->io_taskqueue != NULL) {
 			taskqueue_free(be_lun->io_taskqueue);
 		}
+		ctl_free_opts(&be_lun->ctl_be_lun);
 		mtx_destroy(&be_lun->lock);
 		free(be_lun, M_RAMDISK);
 	}

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Sat Jun 14 12:56:07 2014	(r267480)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Sat Jun 14 17:47:44 2014	(r267481)
@@ -2312,22 +2312,18 @@ cfiscsi_lun_enable(void *arg, struct ctl
 {
 	struct cfiscsi_softc *softc;
 	struct cfiscsi_target *ct;
-	struct ctl_be_lun_option *opt;
 	const char *target = NULL, *target_alias = NULL;
 	const char *lun = NULL;
 	unsigned long tmp;
 
 	softc = (struct cfiscsi_softc *)arg;
 
-	STAILQ_FOREACH(opt,
-	    &control_softc->ctl_luns[lun_id]->be_lun->options, links) {
-		if (strcmp(opt->name, "cfiscsi_target") == 0)
-			target = opt->value;
-		else if (strcmp(opt->name, "cfiscsi_target_alias") == 0)
-			target_alias = opt->value;
-		else if (strcmp(opt->name, "cfiscsi_lun") == 0)
-			lun = opt->value;
-	}
+	target = ctl_get_opt(control_softc->ctl_luns[lun_id]->be_lun,
+	    "cfiscsi_target");
+	target_alias = ctl_get_opt(control_softc->ctl_luns[lun_id]->be_lun,
+	    "cfiscsi_target)alias");
+	lun = ctl_get_opt(control_softc->ctl_luns[lun_id]->be_lun,
+	    "cfiscsi_lun");
 
 	if (target == NULL && lun == NULL)
 		return (0);

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 14 18:43:49 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id EF1094C3;
 Sat, 14 Jun 2014 18:43:49 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C1D0D2596;
 Sat, 14 Jun 2014 18:43:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5EIhnLp023228;
 Sat, 14 Jun 2014 18:43:49 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5EIhnnl023223;
 Sat, 14 Jun 2014 18:43:49 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201406141843.s5EIhnnl023223@svn.freebsd.org>
From: Gavin Atkinson 
Date: Sat, 14 Jun 2014 18:43:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267482 - in head: share/man/man7 share/termcap
 sys/modules/svr4
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 14 Jun 2014 18:43:50 -0000

Author: gavin
Date: Sat Jun 14 18:43:48 2014
New Revision: 267482
URL: http://svnweb.freebsd.org/changeset/base/267482

Log:
  Stop telling people to use send-pr; instead point them towards Bugzilla.
  
  Hat:		bugmeister@
  MFC after:	3 days

Modified:
  head/share/man/man7/tests.7
  head/share/termcap/termcap.src
  head/sys/modules/svr4/README

Modified: head/share/man/man7/tests.7
==============================================================================
--- head/share/man/man7/tests.7	Sat Jun 14 17:47:44 2014	(r267481)
+++ head/share/man/man7/tests.7	Sat Jun 14 18:43:48 2014	(r267482)
@@ -195,7 +195,7 @@ For more details please refer to:
 .It
 .Lk http://lists.freebsd.org/ "FreeBSD Mailing Lists"
 .It
-.Lk http://www.freebsd.org/send-pr.html "Submit a FreeBSD Problem Report"
+.Lk http://www.freebsd.org/support.html "Problem Reporting"
 .El
 .Sh FILES
 .Bl -tag -compact -width usrXlocalXetcXkyuaXkyuaXconfXX

Modified: head/share/termcap/termcap.src
==============================================================================
--- head/share/termcap/termcap.src	Sat Jun 14 17:47:44 2014	(r267481)
+++ head/share/termcap/termcap.src	Sat Jun 14 18:43:48 2014	(r267482)
@@ -36,7 +36,7 @@
 #	John Kunze, Berkeley
 #	Craig Leres, Berkeley
 #
-# Please submit changes with send-pr(1).
+# Please submit changes via https://bugs.freebsd.org/submit/
 #
 # << EOH - after reordering, above header lines survive and this line dies >>
 #

Modified: head/sys/modules/svr4/README
==============================================================================
--- head/sys/modules/svr4/README	Sat Jun 14 17:47:44 2014	(r267481)
+++ head/sys/modules/svr4/README	Sat Jun 14 18:43:48 2014	(r267482)
@@ -30,7 +30,7 @@ To use it:
 It's early days yet, folks -- You'll probably have trouble getting 100%
 functionality out of most things (specifically, poll() on a socket doesn't
 look like it works at the moment, so Netscape doesn't work (among other
-things)).  Patches will be appreciated (use send-pr).
+things)).  Patches will be appreciated.
 
    - Mark Newton
      newton@atdot.dotat.org

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 14 18:45:41 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id ACCFF619;
 Sat, 14 Jun 2014 18:45:41 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 998DF25A4;
 Sat, 14 Jun 2014 18:45:41 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5EIjf9L023607;
 Sat, 14 Jun 2014 18:45:41 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5EIjfjw023603;
 Sat, 14 Jun 2014 18:45:41 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201406141845.s5EIjfjw023603@svn.freebsd.org>
From: Gavin Atkinson 
Date: Sat, 14 Jun 2014 18:45:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267483 - in head: contrib/gcc gnu/usr.bin/binutils/libbfd
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 14 Jun 2014 18:45:41 -0000

Author: gavin
Date: Sat Jun 14 18:45:40 2014
New Revision: 267483
URL: http://svnweb.freebsd.org/changeset/base/267483

Log:
  With the move away from GNATS, point end users to a better web page
  detailing how to report bugs.
  
  Hat:		bugmeister
  MFC after:	3 days

Modified:
  head/contrib/gcc/version.c
  head/gnu/usr.bin/binutils/libbfd/Makefile

Modified: head/contrib/gcc/version.c
==============================================================================
--- head/contrib/gcc/version.c	Sat Jun 14 18:43:48 2014	(r267482)
+++ head/contrib/gcc/version.c	Sat Jun 14 18:45:40 2014	(r267483)
@@ -18,7 +18,7 @@
    forward us bugs reported to you, if you determine that they are
    not bugs in your modifications.)  */
 
-const char bug_report_url[] = "";
+const char bug_report_url[] = "";
 
 /* The complete version string, assembled from several pieces.
    BASEVER, DATESTAMP, and DEVPHASE are defined by the Makefile.  */

Modified: head/gnu/usr.bin/binutils/libbfd/Makefile
==============================================================================
--- head/gnu/usr.bin/binutils/libbfd/Makefile	Sat Jun 14 18:43:48 2014	(r267482)
+++ head/gnu/usr.bin/binutils/libbfd/Makefile	Sat Jun 14 18:45:40 2014	(r267483)
@@ -84,7 +84,7 @@ bfdver.h: Makefile
 	echo '#define BFD_VERSION	217500000'	> ${.TARGET}
 	echo '#define BFD_VERSION_DATE	20070703'	>> ${.TARGET}
 	echo '#define BFD_VERSION_STRING ${VERSION}'	>> ${.TARGET}
-	echo '#define REPORT_BUGS_TO ""' >> ${.TARGET}
+	echo '#define REPORT_BUGS_TO ""' >> ${.TARGET}
 
 targmatch.h: targmatch.sed config.bfd
 	sed -f ${.ALLSRC:M*.sed} ${.ALLSRC:M*.bfd} > ${.TARGET}

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 14 20:25:15 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1CEE1E18;
 Sat, 14 Jun 2014 20:25:15 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E4B7A2CBB;
 Sat, 14 Jun 2014 20:25:14 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5EKPEe5072529;
 Sat, 14 Jun 2014 20:25:14 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5EKPE3q072527;
 Sat, 14 Jun 2014 20:25:14 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406142025.s5EKPE3q072527@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 14 Jun 2014 20:25:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267485 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 14 Jun 2014 20:25:15 -0000

Author: mav
Date: Sat Jun 14 20:25:14 2014
New Revision: 267485
URL: http://svnweb.freebsd.org/changeset/base/267485

Log:
  Remove non-functional remnants of control LUN -- 18MB of RAM for nothing.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_private.h

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sat Jun 14 18:48:12 2014	(r267484)
+++ head/sys/cam/ctl/ctl.c	Sat Jun 14 20:25:14 2014	(r267485)
@@ -961,7 +961,6 @@ ctl_init(void)
 	struct ctl_softc *softc;
 	struct ctl_io_pool *internal_pool, *emergency_pool, *other_pool;
 	struct ctl_frontend *fe;
-	struct ctl_lun *lun;
         uint8_t sc_id =0;
 	int i, error, retval;
 	//int isc_retval;
@@ -1049,8 +1048,6 @@ ctl_init(void)
 	STAILQ_INIT(&softc->be_list);
 	STAILQ_INIT(&softc->io_pools);
 
-	lun = &softc->lun;
-
 	/*
 	 * We don't bother calling these with ctl_lock held here, because,
 	 * in theory, no one else can try to do anything while we're in our
@@ -1085,16 +1082,6 @@ ctl_init(void)
 	softc->emergency_pool = emergency_pool;
 	softc->othersc_pool = other_pool;
 
-	/*
-	 * We used to allocate a processor LUN here.  The new scheme is to
-	 * just let the user allocate LUNs as he sees fit.
-	 */
-#if 0
-	mtx_lock(&softc->ctl_lock);
-	ctl_alloc_lun(softc, lun, /*be_lun*/NULL, /*target*/softc->target);
-	mtx_unlock(&softc->ctl_lock);
-#endif
-
 	if (worker_threads > MAXCPU || worker_threads == 0) {
 		printf("invalid kern.cam.ctl.worker_threads value; "
 		    "setting to 1");
@@ -1116,9 +1103,6 @@ ctl_init(void)
 		    &softc->work_thread, NULL, 0, 0, "ctl", "work%d", i);
 		if (error != 0) {
 			printf("error creating CTL work thread!\n");
-			mtx_lock(&softc->ctl_lock);
-			ctl_free_lun(lun);
-			mtx_unlock(&softc->ctl_lock);
 			ctl_pool_free(internal_pool);
 			ctl_pool_free(emergency_pool);
 			ctl_pool_free(other_pool);

Modified: head/sys/cam/ctl/ctl_private.h
==============================================================================
--- head/sys/cam/ctl/ctl_private.h	Sat Jun 14 18:48:12 2014	(r267484)
+++ head/sys/cam/ctl/ctl_private.h	Sat Jun 14 20:25:14 2014	(r267485)
@@ -426,7 +426,6 @@ struct ctl_softc {
 	struct sysctl_ctx_list sysctl_ctx;
 	struct sysctl_oid *sysctl_tree;
 	struct ctl_ioctl_info ioctl_info;
-	struct ctl_lun lun;
 	struct ctl_io_pool *internal_pool;
 	struct ctl_io_pool *emergency_pool;
 	struct ctl_io_pool *othersc_pool;

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 14 20:36:34 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4FB7CFBF;
 Sat, 14 Jun 2014 20:36:34 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 309DD2D5C;
 Sat, 14 Jun 2014 20:36:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5EKaYfV077161;
 Sat, 14 Jun 2014 20:36:34 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5EKaX0V077155;
 Sat, 14 Jun 2014 20:36:33 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201406142036.s5EKaX0V077155@svn.freebsd.org>
From: Gavin Atkinson 
Date: Sat, 14 Jun 2014 20:36:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267486 - in head: . etc gnu/usr.bin gnu/usr.bin/send-pr
 share/man/man7
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 14 Jun 2014 20:36:34 -0000

Author: gavin
Date: Sat Jun 14 20:36:32 2014
New Revision: 267486
URL: http://svnweb.freebsd.org/changeset/base/267486

Log:
  Remove send-pr, the supported interface to submit bugs is now via
  https://bugs.freebsd.org/submit/
  
  Removing send-pr also removes one more piece of non-BSD-licensed software.
  
  Hat:		bugmeister
  MFC after:	3 days

Deleted:
  head/gnu/usr.bin/send-pr/
Modified:
  head/MAINTAINERS
  head/ObsoleteFiles.inc
  head/etc/Makefile
  head/gnu/usr.bin/Makefile
  head/share/man/man7/hier.7

Modified: head/MAINTAINERS
==============================================================================
--- head/MAINTAINERS	Sat Jun 14 20:25:14 2014	(r267485)
+++ head/MAINTAINERS	Sat Jun 14 20:36:32 2014	(r267486)
@@ -108,7 +108,6 @@ lib/libbluetooth	emax	Pre-commit review 
 lib/libsdp		emax	Pre-commit review preferred.
 usr.bin/bluetooth	emax	Pre-commit review preferred.
 usr.sbin/bluetooth	emax	Pre-commit review preferred.
-gnu/usr.bin/send-pr	bugmaster	Pre-commit review requested.
 *env(3)		secteam	Due to the problematic security history of this
 			code, please have patches reviewed by secteam.
 share/zoneinfo		edwin	Heads-up appreciated, since our data is coming

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Sat Jun 14 20:25:14 2014	(r267485)
+++ head/ObsoleteFiles.inc	Sat Jun 14 20:36:32 2014	(r267486)
@@ -38,6 +38,11 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20140614: send-pr removal
+OLD_FILES+=usr/bin/send-pr
+OLD_FILES+=usr/share/man/man1/send-pr.1.gz
+OLD_FILES+=etc/gnats/freefall
+OLD_DIRS+=etc/gnats
 # 20140512: new clang import which bumps version from 3.4 to 3.4.1.
 OLD_FILES+=usr/include/clang/3.4/__wmmintrin_aes.h
 OLD_FILES+=usr/include/clang/3.4/__wmmintrin_pclmul.h

Modified: head/etc/Makefile
==============================================================================
--- head/etc/Makefile	Sat Jun 14 20:25:14 2014	(r267485)
+++ head/etc/Makefile	Sat Jun 14 20:36:32 2014	(r267486)
@@ -240,7 +240,6 @@ distribution:
 	${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
 	${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
 	${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
-	${_+_}cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
 	${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
 	${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
 	${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install

Modified: head/gnu/usr.bin/Makefile
==============================================================================
--- head/gnu/usr.bin/Makefile	Sat Jun 14 20:25:14 2014	(r267485)
+++ head/gnu/usr.bin/Makefile	Sat Jun 14 20:36:32 2014	(r267486)
@@ -14,7 +14,6 @@ SUBDIR= ${_binutils} \
 	${_groff} \
 	${_rcs} \
 	sdiff \
-	send-pr \
 	${_tests} \
 	${_texinfo}
 

Modified: head/share/man/man7/hier.7
==============================================================================
--- head/share/man/man7/hier.7	Sat Jun 14 20:25:14 2014	(r267485)
+++ head/share/man/man7/hier.7	Sat Jun 14 20:36:32 2014	(r267486)
@@ -86,10 +86,6 @@ see
 .Xr rc 8
 .It Pa bluetooth/
 bluetooth configuration files
-.It Pa gnats/
-gnats configuration files;
-see
-.Xr send-pr 1
 .It Pa localtime
 local timezone information;
 see

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 14 20:48:30 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4A2C3243;
 Sat, 14 Jun 2014 20:48:30 +0000 (UTC)
Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu
 [128.95.76.21])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "troutmask.apl.washington.edu",
 Issuer "troutmask.apl.washington.edu" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 26D962E1B;
 Sat, 14 Jun 2014 20:48:30 +0000 (UTC)
Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu
 [127.0.0.1])
 by troutmask.apl.washington.edu (8.14.9/8.14.9) with ESMTP id s5EKmTDY065965
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Sat, 14 Jun 2014 13:48:29 -0700 (PDT)
 (envelope-from sgk@troutmask.apl.washington.edu)
Received: (from sgk@localhost)
 by troutmask.apl.washington.edu (8.14.9/8.14.9/Submit) id s5EKmT1R065964;
 Sat, 14 Jun 2014 13:48:29 -0700 (PDT) (envelope-from sgk)
Date: Sat, 14 Jun 2014 13:48:29 -0700
From: Steve Kargl 
To: Gavin Atkinson 
Subject: Re: svn commit: r267486 - in head: . etc gnu/usr.bin
 gnu/usr.bin/send-pr share/man/man7
Message-ID: <20140614204829.GA65906@troutmask.apl.washington.edu>
References: <201406142036.s5EKaX0V077155@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201406142036.s5EKaX0V077155@svn.freebsd.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 14 Jun 2014 20:48:30 -0000

On Sat, Jun 14, 2014 at 08:36:33PM +0000, Gavin Atkinson wrote:
> Author: gavin
> Date: Sat Jun 14 20:36:32 2014
> New Revision: 267486
> URL: http://svnweb.freebsd.org/changeset/base/267486
> 
> Log:
>   Remove send-pr, the supported interface to submit bugs is now via
>   https://bugs.freebsd.org/submit/
>   
>   Removing send-pr also removes one more piece of non-BSD-licensed software.
>   
>   Hat:		bugmeister
>   MFC after:	3 days
> 
> Deleted:
>   head/gnu/usr.bin/send-pr/

Given that send-pr(1) may be ingrained into peoples brains
and referenced in 3rd documentation or articles on the web,
perhaps, we should have a script point to bugzilla.

$ cat send-pr 
#! /bin/sh
echo 'send-pr(1) has been replaced by bugzilla.'
echo 'See http://bugs.freebsd.org/'


From owner-svn-src-head@FreeBSD.ORG  Sat Jun 14 21:02:30 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E5C83728;
 Sat, 14 Jun 2014 21:02:30 +0000 (UTC)
Received: from mail-gw14.york.ac.uk (mail-gw14.york.ac.uk [144.32.129.164])
 (using TLSv1 with cipher AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A7EB42F38;
 Sat, 14 Jun 2014 21:02:30 +0000 (UTC)
Received: from ury.york.ac.uk ([144.32.64.162]:10777)
 by mail-gw14.york.ac.uk with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.76) (envelope-from )
 id 1Wvuz9-0002cs-IP; Sat, 14 Jun 2014 21:55:35 +0100
Date: Sat, 14 Jun 2014 21:55:35 +0100 (BST)
From: Gavin Atkinson 
X-X-Sender: gavin@ury.york.ac.uk
To: Steve Kargl 
Subject: Re: svn commit: r267486 - in head: . etc gnu/usr.bin
 gnu/usr.bin/send-pr share/man/man7
In-Reply-To: <20140614204829.GA65906@troutmask.apl.washington.edu>
Message-ID: 
References: <201406142036.s5EKaX0V077155@svn.freebsd.org>
 <20140614204829.GA65906@troutmask.apl.washington.edu>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 14 Jun 2014 21:02:31 -0000

On Sat, 14 Jun 2014, Steve Kargl wrote:
> On Sat, Jun 14, 2014 at 08:36:33PM +0000, Gavin Atkinson wrote:
> > Author: gavin
> > Date: Sat Jun 14 20:36:32 2014
> > New Revision: 267486
> > URL: http://svnweb.freebsd.org/changeset/base/267486
> > 
> > Log:
> >   Remove send-pr, the supported interface to submit bugs is now via
> >   https://bugs.freebsd.org/submit/
> >   
> >   Removing send-pr also removes one more piece of non-BSD-licensed software.
> >   
> >   Hat:		bugmeister
> >   MFC after:	3 days
> > 
> > Deleted:
> >   head/gnu/usr.bin/send-pr/
> 
> Given that send-pr(1) may be ingrained into peoples brains
> and referenced in 3rd documentation or articles on the web,
> perhaps, we should have a script point to bugzilla.
> 
> $ cat send-pr 
> #! /bin/sh
> echo 'send-pr(1) has been replaced by bugzilla.'
> echo 'See http://bugs.freebsd.org/'

This is likely a good idea, and one we have discussed already.  I meant to 
mention it in the commit log actually - I will likely commit such a script 
tomorrow, and it will be in place in time for the MFC.

Gavin

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 14 23:36:18 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3A33F56A;
 Sat, 14 Jun 2014 23:36:18 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 26CAA297D;
 Sat, 14 Jun 2014 23:36:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5ENaI5U057844;
 Sat, 14 Jun 2014 23:36:18 GMT (envelope-from bryanv@svn.freebsd.org)
Received: (from bryanv@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5ENaI0h057843;
 Sat, 14 Jun 2014 23:36:18 GMT (envelope-from bryanv@svn.freebsd.org)
Message-Id: <201406142336.s5ENaI0h057843@svn.freebsd.org>
From: Bryan Venteicher 
Date: Sat, 14 Jun 2014 23:36:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267488 - head/sys/dev/vmware/vmxnet3
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 14 Jun 2014 23:36:18 -0000

Author: bryanv
Date: Sat Jun 14 23:36:17 2014
New Revision: 267488
URL: http://svnweb.freebsd.org/changeset/base/267488

Log:
  Don't check the dma map address for a static DMA mapping against NULL
  to determine if the mapping is valid.
  
  Submitted by:	jhb

Modified:
  head/sys/dev/vmware/vmxnet3/if_vmx.c

Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c
==============================================================================
--- head/sys/dev/vmware/vmxnet3/if_vmx.c	Sat Jun 14 22:47:25 2014	(r267487)
+++ head/sys/dev/vmware/vmxnet3/if_vmx.c	Sat Jun 14 23:36:17 2014	(r267488)
@@ -3886,7 +3886,7 @@ vmxnet3_dma_free(struct vmxnet3_softc *s
 {
 
 	if (dma->dma_tag != NULL) {
-		if (dma->dma_map != NULL) {
+		if (dma->dma_paddr != 0) {
 			bus_dmamap_sync(dma->dma_tag, dma->dma_map,
 			    BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 			bus_dmamap_unload(dma->dma_tag, dma->dma_map);

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 03:54:24 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id BC5BE808;
 Sun, 15 Jun 2014 03:54:24 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A9FCD2BC1;
 Sun, 15 Jun 2014 03:54:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5F3sOlR077021;
 Sun, 15 Jun 2014 03:54:24 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5F3sOeL077016;
 Sun, 15 Jun 2014 03:54:24 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201406150354.s5F3sOeL077016@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Sun, 15 Jun 2014 03:54:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267490 - head/usr.bin/patch
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 03:54:24 -0000

Author: pfg
Date: Sun Jun 15 03:54:23 2014
New Revision: 267490
URL: http://svnweb.freebsd.org/changeset/base/267490

Log:
  patch: unsign the line length to avoid overflows.
  
  Patch(1) uses a short int for the line length, which is usually
  sufficient for regular diffs, but makes no effort to signal
  when there is an overflow.
  
  Change the line length to an unsigned short int to better use
  the fact that a length is never negative.  The change is loosely
  inspired on a related change in DragonFly, but we avoid spending
  more memory than necessary.
  
  While here adjust the messages to be clearer on what is happening.
  
  MFC after:	1 week

Modified:
  head/usr.bin/patch/patch.c
  head/usr.bin/patch/pch.c
  head/usr.bin/patch/pch.h

Modified: head/usr.bin/patch/patch.c
==============================================================================
--- head/usr.bin/patch/patch.c	Sun Jun 15 00:53:24 2014	(r267489)
+++ head/usr.bin/patch/patch.c	Sun Jun 15 03:54:23 2014	(r267490)
@@ -742,14 +742,18 @@ abort_context_hunk(void)
 static void
 rej_line(int ch, LINENUM i)
 {
-	size_t len;
+	unsigned short len;
 	const char *line = pfetch(i);
 
-	len = strlen(line);
+	len = strnlen(line, USHRT_MAX);
 
 	fprintf(rejfp, "%c%s", ch, line);
-	if (len == 0 || line[len-1] != '\n')
-		fprintf(rejfp, "\n\\ No newline at end of file\n");
+	if (len == 0 || line[len-1] != '\n') {
+		if (len >= USHRT_MAX)
+			fprintf(rejfp, "\n\\ Line too long\n");
+		else
+			fprintf(rejfp, "\n\\ No newline at end of line\n");
+	}
 }
 
 static void
@@ -1016,7 +1020,7 @@ patch_match(LINENUM base, LINENUM offset
 	LINENUM		pat_lines = pch_ptrn_lines() - fuzz;
 	const char	*ilineptr;
 	const char	*plineptr;
-	short		plinelen;
+	unsigned short	plinelen;
 
 	for (iline = base + offset + fuzz; pline <= pat_lines; pline++, iline++) {
 		ilineptr = ifetch(iline, offset >= 0);

Modified: head/usr.bin/patch/pch.c
==============================================================================
--- head/usr.bin/patch/pch.c	Sun Jun 15 00:53:24 2014	(r267489)
+++ head/usr.bin/patch/pch.c	Sun Jun 15 03:54:23 2014	(r267490)
@@ -56,7 +56,7 @@ static LINENUM	p_max;		/* max allowed va
 static LINENUM	p_context = 3;	/* # of context lines */
 static LINENUM	p_input_line = 0;	/* current line # from patch file */
 static char	**p_line = NULL;/* the text of the hunk */
-static short	*p_len = NULL;	/* length of each line */
+static unsigned short	*p_len = NULL; /* length of each line */
 static char	*p_char = NULL;	/* +, -, and ! */
 static int	hunkmax = INITHUNKMAX;	/* size of above arrays to begin with */
 static int	p_indent;	/* indent to patch */
@@ -134,7 +134,7 @@ set_hunkmax(void)
 	if (p_line == NULL)
 		p_line = malloc(hunkmax * sizeof(char *));
 	if (p_len == NULL)
-		p_len = malloc(hunkmax * sizeof(short));
+		p_len = malloc(hunkmax * sizeof(unsigned short));
 	if (p_char == NULL)
 		p_char = malloc(hunkmax * sizeof(char));
 }
@@ -151,7 +151,7 @@ grow_hunkmax(void)
 		fatal("Internal memory allocation error\n");
 
 	p_line = reallocf(p_line, new_hunkmax * sizeof(char *));
-	p_len = reallocf(p_len, new_hunkmax * sizeof(short));
+	p_len = reallocf(p_len, new_hunkmax * sizeof(unsigned short));
 	p_char = reallocf(p_char, new_hunkmax * sizeof(char));
 
 	if (p_line != NULL && p_len != NULL && p_char != NULL) {
@@ -1201,7 +1201,7 @@ bool
 pch_swap(void)
 {
 	char	**tp_line;	/* the text of the hunk */
-	short	*tp_len;	/* length of each line */
+	unsigned short	*tp_len;/* length of each line */
 	char	*tp_char;	/* +, -, and ! */
 	LINENUM	i;
 	LINENUM	n;
@@ -1358,7 +1358,7 @@ pch_context(void)
 /*
  * Return the length of a particular patch line.
  */
-short
+unsigned short
 pch_line_len(LINENUM line)
 {
 	return p_len[line];

Modified: head/usr.bin/patch/pch.h
==============================================================================
--- head/usr.bin/patch/pch.h	Sun Jun 15 00:53:24 2014	(r267489)
+++ head/usr.bin/patch/pch.h	Sun Jun 15 03:54:23 2014	(r267490)
@@ -44,7 +44,7 @@ bool		there_is_another_patch(void);
 bool		another_hunk(void);
 bool		pch_swap(void);
 char		*pfetch(LINENUM);
-short		pch_line_len(LINENUM);
+unsigned short	pch_line_len(LINENUM);
 LINENUM		pch_first(void);
 LINENUM		pch_ptrn_lines(void);
 LINENUM		pch_newfirst(void);

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 04:51:54 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 20E7E850;
 Sun, 15 Jun 2014 04:51:54 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 01DA6205C;
 Sun, 15 Jun 2014 04:51:54 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5F4prlS004285;
 Sun, 15 Jun 2014 04:51:53 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5F4prkW004284;
 Sun, 15 Jun 2014 04:51:53 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201406150451.s5F4prkW004284@svn.freebsd.org>
From: Konstantin Belousov 
Date: Sun, 15 Jun 2014 04:51:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267491 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 04:51:54 -0000

Author: kib
Date: Sun Jun 15 04:51:53 2014
New Revision: 267491
URL: http://svnweb.freebsd.org/changeset/base/267491

Log:
  Use vn_io_fault for the writes from core dumping code.  Recursing into
  VM due to copyin(9) faulting while VFS locks are held is
  deadlock-prone there in the same way as for the write(2) syscall.
  
  Reported and tested by:	pho
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks

Modified:
  head/sys/kern/vfs_vnops.c

Modified: head/sys/kern/vfs_vnops.c
==============================================================================
--- head/sys/kern/vfs_vnops.c	Sun Jun 15 03:54:23 2014	(r267490)
+++ head/sys/kern/vfs_vnops.c	Sun Jun 15 04:51:53 2014	(r267491)
@@ -8,7 +8,7 @@
  * the permission of UNIX System Laboratories, Inc.
  *
  * Copyright (c) 2012 Konstantin Belousov 
- * Copyright (c) 2013 The FreeBSD Foundation
+ * Copyright (c) 2013, 2014 The FreeBSD Foundation
  *
  * Portions of this software were developed by Konstantin Belousov
  * under sponsorship from the FreeBSD Foundation.
@@ -106,6 +106,53 @@ struct 	fileops vnops = {
 	.fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE
 };
 
+static const int io_hold_cnt = 16;
+static int vn_io_fault_enable = 1;
+SYSCTL_INT(_debug, OID_AUTO, vn_io_fault_enable, CTLFLAG_RW,
+    &vn_io_fault_enable, 0, "Enable vn_io_fault lock avoidance");
+static u_long vn_io_faults_cnt;
+SYSCTL_ULONG(_debug, OID_AUTO, vn_io_faults, CTLFLAG_RD,
+    &vn_io_faults_cnt, 0, "Count of vn_io_fault lock avoidance triggers");
+
+/*
+ * Returns true if vn_io_fault mode of handling the i/o request should
+ * be used.
+ */
+static bool
+do_vn_io_fault(struct vnode *vp, struct uio *uio)
+{
+	struct mount *mp;
+
+	return (uio->uio_segflg == UIO_USERSPACE && vp->v_type == VREG &&
+	    (mp = vp->v_mount) != NULL &&
+	    (mp->mnt_kern_flag & MNTK_NO_IOPF) != 0 && vn_io_fault_enable);
+}
+
+/*
+ * Structure used to pass arguments to vn_io_fault1(), to do either
+ * file- or vnode-based I/O calls.
+ */
+struct vn_io_fault_args {
+	enum {
+		VN_IO_FAULT_FOP,
+		VN_IO_FAULT_VOP
+	} kind;
+	struct ucred *cred;
+	int flags;
+	union {
+		struct fop_args_tag {
+			struct file *fp;
+			fo_rdwr_t *doio;
+		} fop_args;
+		struct vop_args_tag {
+			struct vnode *vp;
+		} vop_args;
+	} args;
+};
+
+static int vn_io_fault1(struct vnode *vp, struct uio *uio,
+    struct vn_io_fault_args *args, struct thread *td);
+
 int
 vn_open(ndp, flagp, cmode, fp)
 	struct nameidata *ndp;
@@ -439,6 +486,7 @@ vn_rdwr(enum uio_rw rw, struct vnode *vp
 	struct mount *mp;
 	struct ucred *cred;
 	void *rl_cookie;
+	struct vn_io_fault_args args;
 	int error, lock_flags;
 
 	auio.uio_iov = &aiov;
@@ -493,10 +541,17 @@ vn_rdwr(enum uio_rw rw, struct vnode *vp
 			cred = file_cred;
 		else
 			cred = active_cred;
-		if (rw == UIO_READ)
+		if (do_vn_io_fault(vp, &auio)) {
+			args.kind = VN_IO_FAULT_VOP;
+			args.cred = cred;
+			args.flags = ioflg;
+			args.args.vop_args.vp = vp;
+			error = vn_io_fault1(vp, &auio, &args, td);
+		} else if (rw == UIO_READ) {
 			error = VOP_READ(vp, &auio, ioflg, cred);
-		else
+		} else /* if (rw == UIO_WRITE) */ {
 			error = VOP_WRITE(vp, &auio, ioflg, cred);
+		}
 	}
 	if (aresid)
 		*aresid = auio.uio_resid;
@@ -883,14 +938,6 @@ unlock:
 	return (error);
 }
 
-static const int io_hold_cnt = 16;
-static int vn_io_fault_enable = 1;
-SYSCTL_INT(_debug, OID_AUTO, vn_io_fault_enable, CTLFLAG_RW,
-    &vn_io_fault_enable, 0, "Enable vn_io_fault lock avoidance");
-static u_long vn_io_faults_cnt;
-SYSCTL_ULONG(_debug, OID_AUTO, vn_io_faults, CTLFLAG_RD,
-    &vn_io_faults_cnt, 0, "Count of vn_io_fault lock avoidance triggers");
-
 /*
  * The vn_io_fault() is a wrapper around vn_read() and vn_write() to
  * prevent the following deadlock:
@@ -924,38 +971,55 @@ SYSCTL_ULONG(_debug, OID_AUTO, vn_io_fau
  * make the current i/o request atomic with respect to other i/os and
  * truncations.
  */
+
+/*
+ * Decode vn_io_fault_args and perform the corresponding i/o.
+ */
 static int
-vn_io_fault(struct file *fp, struct uio *uio, struct ucred *active_cred,
-    int flags, struct thread *td)
+vn_io_fault_doio(struct vn_io_fault_args *args, struct uio *uio,
+    struct thread *td)
+{
+
+	switch (args->kind) {
+	case VN_IO_FAULT_FOP:
+		return ((args->args.fop_args.doio)(args->args.fop_args.fp,
+		    uio, args->cred, args->flags, td));
+	case VN_IO_FAULT_VOP:
+		if (uio->uio_rw == UIO_READ) {
+			return (VOP_READ(args->args.vop_args.vp, uio,
+			    args->flags, args->cred));
+		} else if (uio->uio_rw == UIO_WRITE) {
+			return (VOP_WRITE(args->args.vop_args.vp, uio,
+			    args->flags, args->cred));
+		}
+		break;
+	}
+	panic("vn_io_fault_doio: unknown kind of io %d %d", args->kind,
+	    uio->uio_rw);
+}
+
+/*
+ * Common code for vn_io_fault(), agnostic to the kind of i/o request.
+ * Uses vn_io_fault_doio() to make the call to an actual i/o function.
+ * Used from vn_rdwr() and vn_io_fault(), which encode the i/o request
+ * into args and call vn_io_fault1() to handle faults during the user
+ * mode buffer accesses.
+ */
+static int
+vn_io_fault1(struct vnode *vp, struct uio *uio, struct vn_io_fault_args *args,
+    struct thread *td)
 {
 	vm_page_t ma[io_hold_cnt + 2];
 	struct uio *uio_clone, short_uio;
 	struct iovec short_iovec[1];
-	fo_rdwr_t *doio;
-	struct vnode *vp;
-	void *rl_cookie;
-	struct mount *mp;
 	vm_page_t *prev_td_ma;
-	int error, cnt, save, saveheld, prev_td_ma_cnt;
-	vm_offset_t addr, end;
 	vm_prot_t prot;
+	vm_offset_t addr, end;
 	size_t len, resid;
 	ssize_t adv;
+	int error, cnt, save, saveheld, prev_td_ma_cnt;
 
-	if (uio->uio_rw == UIO_READ)
-		doio = vn_read;
-	else
-		doio = vn_write;
-	vp = fp->f_vnode;
-	foffset_lock_uio(fp, uio, flags);
-
-	if (uio->uio_segflg != UIO_USERSPACE || vp->v_type != VREG ||
-	    ((mp = vp->v_mount) != NULL &&
-	    (mp->mnt_kern_flag & MNTK_NO_IOPF) == 0) ||
-	    !vn_io_fault_enable) {
-		error = doio(fp, uio, active_cred, flags | FOF_OFFSET, td);
-		goto out_last;
-	}
+	prot = uio->uio_rw == UIO_READ ? VM_PROT_WRITE : VM_PROT_READ;
 
 	/*
 	 * The UFS follows IO_UNIT directive and replays back both
@@ -973,22 +1037,8 @@ vn_io_fault(struct file *fp, struct uio 
 	short_uio.uio_rw = uio->uio_rw;
 	short_uio.uio_td = uio->uio_td;
 
-	if (uio->uio_rw == UIO_READ) {
-		prot = VM_PROT_WRITE;
-		rl_cookie = vn_rangelock_rlock(vp, uio->uio_offset,
-		    uio->uio_offset + uio->uio_resid);
-	} else {
-		prot = VM_PROT_READ;
-		if ((fp->f_flag & O_APPEND) != 0 || (flags & FOF_OFFSET) == 0)
-			/* For appenders, punt and lock the whole range. */
-			rl_cookie = vn_rangelock_wlock(vp, 0, OFF_MAX);
-		else
-			rl_cookie = vn_rangelock_wlock(vp, uio->uio_offset,
-			    uio->uio_offset + uio->uio_resid);
-	}
-
 	save = vm_fault_disable_pagefaults();
-	error = doio(fp, uio, active_cred, flags | FOF_OFFSET, td);
+	error = vn_io_fault_doio(args, uio, td);
 	if (error != EFAULT)
 		goto out;
 
@@ -1038,8 +1088,7 @@ vn_io_fault(struct file *fp, struct uio 
 		td->td_ma = ma;
 		td->td_ma_cnt = cnt;
 
-		error = doio(fp, &short_uio, active_cred, flags | FOF_OFFSET,
-		    td);
+		error = vn_io_fault_doio(args, &short_uio, td);
 		vm_page_unhold_pages(ma, cnt);
 		adv = len - short_uio.uio_resid;
 
@@ -1060,9 +1109,45 @@ vn_io_fault(struct file *fp, struct uio 
 	curthread_pflags_restore(saveheld);
 out:
 	vm_fault_enable_pagefaults(save);
-	vn_rangelock_unlock(vp, rl_cookie);
 	free(uio_clone, M_IOV);
-out_last:
+	return (error);
+}
+
+static int
+vn_io_fault(struct file *fp, struct uio *uio, struct ucred *active_cred,
+    int flags, struct thread *td)
+{
+	fo_rdwr_t *doio;
+	struct vnode *vp;
+	void *rl_cookie;
+	struct vn_io_fault_args args;
+	int error;
+
+	doio = uio->uio_rw == UIO_READ ? vn_read : vn_write;
+	vp = fp->f_vnode;
+	foffset_lock_uio(fp, uio, flags);
+	if (do_vn_io_fault(vp, uio)) {
+		args.kind = VN_IO_FAULT_FOP;
+		args.args.fop_args.fp = fp;
+		args.args.fop_args.doio = doio;
+		args.cred = active_cred;
+		args.flags = flags | FOF_OFFSET;
+		if (uio->uio_rw == UIO_READ) {
+			rl_cookie = vn_rangelock_rlock(vp, uio->uio_offset,
+			    uio->uio_offset + uio->uio_resid);
+		} else if ((fp->f_flag & O_APPEND) != 0 ||
+		    (flags & FOF_OFFSET) == 0) {
+			/* For appenders, punt and lock the whole range. */
+			rl_cookie = vn_rangelock_wlock(vp, 0, OFF_MAX);
+		} else {
+			rl_cookie = vn_rangelock_wlock(vp, uio->uio_offset,
+			    uio->uio_offset + uio->uio_resid);
+		}
+		error = vn_io_fault1(vp, uio, &args, td);
+		vn_rangelock_unlock(vp, rl_cookie);
+	} else {
+		error = doio(fp, uio, active_cred, flags | FOF_OFFSET, td);
+	}
 	foffset_unlock_uio(fp, uio, flags);
 	return (error);
 }

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 05:01:36 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B4B92BB7;
 Sun, 15 Jun 2014 05:01:36 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 880592139;
 Sun, 15 Jun 2014 05:01:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5F51aVd008520;
 Sun, 15 Jun 2014 05:01:36 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5F51aqC008519;
 Sun, 15 Jun 2014 05:01:36 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201406150501.s5F51aqC008519@svn.freebsd.org>
From: Konstantin Belousov 
Date: Sun, 15 Jun 2014 05:01:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267492 - head/sys/i386/i386
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 05:01:36 -0000

Author: kib
Date: Sun Jun 15 05:01:35 2014
New Revision: 267492
URL: http://svnweb.freebsd.org/changeset/base/267492

Log:
  Fix some cosmetic issues with the use of kmem_malloc() in the i386 LDT
  sysarch(2) code.
  
  Use M_ZERO instead of explicit bzero(9).  Do not check for failed
  allocation when M_WAITOK is specified (which is specified always).
  Use malloc(9) when allocating memory for the intermediate copy of the
  user-supplied buffer.
  
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/i386/i386/sys_machdep.c

Modified: head/sys/i386/i386/sys_machdep.c
==============================================================================
--- head/sys/i386/i386/sys_machdep.c	Sun Jun 15 04:51:53 2014	(r267491)
+++ head/sys/i386/i386/sys_machdep.c	Sun Jun 15 05:01:35 2014	(r267492)
@@ -164,19 +164,14 @@ sysarch(td, uap)
 		break;
 	case I386_SET_LDT:
 		if (kargs.largs.descs != NULL) {
-			lp = (union descriptor *)kmem_malloc(kernel_arena,
+			lp = (union descriptor *)malloc(
 			    kargs.largs.num * sizeof(union descriptor),
-			    M_WAITOK);
-			if (lp == NULL) {
-				error = ENOMEM;
-				break;
-			}
+			    M_TEMP, M_WAITOK);
 			error = copyin(kargs.largs.descs, lp,
 			    kargs.largs.num * sizeof(union descriptor));
 			if (error == 0)
 				error = i386_set_ldt(td, &kargs.largs, lp);
-			kmem_free(kernel_arena, (vm_offset_t)lp,
-			    kargs.largs.num * sizeof(union descriptor));
+			free(lp, M_TEMP);
 		} else {
 			error = i386_set_ldt(td, &kargs.largs, NULL);
 		}
@@ -300,10 +295,7 @@ i386_extend_pcb(struct thread *td)
 	};
 
 	ext = (struct pcb_ext *)kmem_malloc(kernel_arena, ctob(IOPAGES+1),
-	    M_WAITOK);
-	if (ext == 0)
-		return (ENOMEM);
-	bzero(ext, sizeof(struct pcb_ext)); 
+	    M_WAITOK | M_ZERO);
 	/* -16 is so we can convert a trapframe into vm86trapframe inplace */
 	ext->ext_tss.tss_esp0 = td->td_kstack + ctob(KSTACK_PAGES) -
 	    sizeof(struct pcb) - 16;
@@ -474,12 +466,7 @@ user_ldt_alloc(struct mdproc *mdp, int l
  
         new_ldt->ldt_len = len = NEW_MAX_LD(len); 
         new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_arena, 
-                round_page(len * sizeof(union descriptor)), M_WAITOK);
-        if (new_ldt->ldt_base == NULL) { 
-                free(new_ldt, M_SUBPROC);
-		mtx_lock_spin(&dt_lock);
-                return (NULL);
-        } 
+	    round_page(len * sizeof(union descriptor)), M_WAITOK);
         new_ldt->ldt_refcnt = 1; 
         new_ldt->ldt_active = 0; 
  
@@ -514,12 +501,7 @@ user_ldt_alloc(struct mdproc *mdp, int l
 
 	new_ldt->ldt_len = len = NEW_MAX_LD(len);
 	new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_arena,
-		len * sizeof(union descriptor), M_WAITOK);
-	if (new_ldt->ldt_base == NULL) {
-		free(new_ldt, M_SUBPROC);
-		mtx_lock_spin(&dt_lock);
-		return (NULL);
-	}
+	    len * sizeof(union descriptor), M_WAITOK);
 	new_ldt->ldt_refcnt = 1;
 	new_ldt->ldt_active = 0;
 

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 05:07:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 98F66DE0;
 Sun, 15 Jun 2014 05:07:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8706B2169;
 Sun, 15 Jun 2014 05:07:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5F571jt009857;
 Sun, 15 Jun 2014 05:07:01 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5F571Fc009856;
 Sun, 15 Jun 2014 05:07:01 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201406150507.s5F571Fc009856@svn.freebsd.org>
From: Xin LI 
Date: Sun, 15 Jun 2014 05:07:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267493 - head/usr.sbin/service
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 05:07:01 -0000

Author: delphij
Date: Sun Jun 15 05:07:01 2014
New Revision: 267493
URL: http://svnweb.freebsd.org/changeset/base/267493

Log:
  Fix two issues:
  
   - Check for rc.d directory's existence before traversing
     it;
   - Don't output * when rc.d directory is empty.
  
  PR:		conf/190665
  Submitted by:	Oleg Ginzburg  (with changes)
  MFC after:	2 weeks

Modified:
  head/usr.sbin/service/service.sh

Modified: head/usr.sbin/service/service.sh
==============================================================================
--- head/usr.sbin/service/service.sh	Sun Jun 15 05:01:35 2014	(r267492)
+++ head/usr.sbin/service/service.sh	Sun Jun 15 05:07:01 2014	(r267493)
@@ -109,7 +109,7 @@ fi
 if [ -n "$LIST" ]; then
 	for dir in /etc/rc.d $local_startup; do
 		[ -n "$VERBOSE" ] && echo "From ${dir}:"
-		cd $dir && for file in *; do echo $file; done
+		[ -d ${dir} ] && /bin/ls -1 ${dir}
 	done
 	exit 0
 fi

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 06:56:11 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3804A9DA;
 Sun, 15 Jun 2014 06:56:11 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0B7CA281F;
 Sun, 15 Jun 2014 06:56:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5F6uAhm059615;
 Sun, 15 Jun 2014 06:56:10 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5F6uAiJ059614;
 Sun, 15 Jun 2014 06:56:10 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406150656.s5F6uAiJ059614@svn.freebsd.org>
From: Alexander Motin 
Date: Sun, 15 Jun 2014 06:56:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267496 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 06:56:11 -0000

Author: mav
Date: Sun Jun 15 06:56:10 2014
New Revision: 267496
URL: http://svnweb.freebsd.org/changeset/base/267496

Log:
  Add "vendor", "product" and "revision" options to control inquiry data.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/ctl/ctl.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sun Jun 15 05:17:40 2014	(r267495)
+++ head/sys/cam/ctl/ctl.c	Sun Jun 15 06:56:10 2014	(r267496)
@@ -9634,6 +9634,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio
 	struct scsi_inquiry *cdb;
 	struct ctl_softc *ctl_softc;
 	struct ctl_lun *lun;
+	char *val;
 	uint32_t alloc_len;
 	int is_fc;
 
@@ -9778,10 +9779,16 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio
 	 * We have 8 bytes for the vendor name, and 16 bytes for the device
 	 * name and 4 bytes for the revision.
 	 */
-	strncpy(inq_ptr->vendor, CTL_VENDOR, sizeof(inq_ptr->vendor));
+	if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) {
+		strcpy(inq_ptr->vendor, CTL_VENDOR);
+	} else {
+		memset(inq_ptr->vendor, ' ', sizeof(inq_ptr->vendor));
+		strncpy(inq_ptr->vendor, val,
+		    min(sizeof(inq_ptr->vendor), strlen(val)));
+	}
 	if (lun == NULL) {
 		strcpy(inq_ptr->product, CTL_DIRECT_PRODUCT);
-	} else {
+	} else if ((val = ctl_get_opt(lun->be_lun, "product")) == NULL) {
 		switch (lun->be_lun->lun_type) {
 		case T_DIRECT:
 			strcpy(inq_ptr->product, CTL_DIRECT_PRODUCT);
@@ -9793,13 +9800,23 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio
 			strcpy(inq_ptr->product, CTL_UNKNOWN_PRODUCT);
 			break;
 		}
+	} else {
+		memset(inq_ptr->product, ' ', sizeof(inq_ptr->product));
+		strncpy(inq_ptr->product, val,
+		    min(sizeof(inq_ptr->product), strlen(val)));
 	}
 
 	/*
 	 * XXX make this a macro somewhere so it automatically gets
 	 * incremented when we make changes.
 	 */
-	strncpy(inq_ptr->revision, "0001", sizeof(inq_ptr->revision));
+	if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "revision")) == NULL) {
+		strncpy(inq_ptr->revision, "0001", sizeof(inq_ptr->revision));
+	} else {
+		memset(inq_ptr->revision, ' ', sizeof(inq_ptr->revision));
+		strncpy(inq_ptr->revision, val,
+		    min(sizeof(inq_ptr->revision), strlen(val)));
+	}
 
 	/*
 	 * For parallel SCSI, we support double transition and single

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 07:53:00 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 75BA025F;
 Sun, 15 Jun 2014 07:53:00 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 635982BCB;
 Sun, 15 Jun 2014 07:53:00 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5F7r0A2086610;
 Sun, 15 Jun 2014 07:53:00 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5F7r0Jl086609;
 Sun, 15 Jun 2014 07:53:00 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201406150753.s5F7r0Jl086609@svn.freebsd.org>
From: Alan Cox 
Date: Sun, 15 Jun 2014 07:53:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267497 - head/sys/vm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 07:53:00 -0000

Author: alc
Date: Sun Jun 15 07:52:59 2014
New Revision: 267497
URL: http://svnweb.freebsd.org/changeset/base/267497

Log:
  One of the intentions behind r267254 was that the global variable "sgrowsiz"
  would be read once and cached in a local variable so that the resource limit
  check and map entry insertion would be guaranteed to use the same value.
  However, the value being passed to vm_map_insert() is still from "sgrowsiz"
  and not the local variable.  Correct this oversight.
  
  Reviewed by:	kib

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Sun Jun 15 06:56:10 2014	(r267496)
+++ head/sys/vm/vm_map.c	Sun Jun 15 07:52:59 2014	(r267497)
@@ -3388,7 +3388,7 @@ vm_map_stack(vm_map_t map, vm_offset_t a
 		rv = KERN_NO_SPACE;
 		goto out;
 	}
-	rv = vm_map_stack_locked(map, addrbos, max_ssize, sgrowsiz, prot,
+	rv = vm_map_stack_locked(map, addrbos, max_ssize, growsize, prot,
 	    max, cow);
 out:
 	vm_map_unlock(map);

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 08:43:53 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 09C8A719;
 Sun, 15 Jun 2014 08:43:53 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D0DD82F8C;
 Sun, 15 Jun 2014 08:43:52 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5F8hqhn011405;
 Sun, 15 Jun 2014 08:43:52 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5F8hqeU011403;
 Sun, 15 Jun 2014 08:43:52 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406150843.s5F8hqeU011403@svn.freebsd.org>
From: Alexander Motin 
Date: Sun, 15 Jun 2014 08:43:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267498 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 08:43:53 -0000

Author: mav
Date: Sun Jun 15 08:43:52 2014
New Revision: 267498
URL: http://svnweb.freebsd.org/changeset/base/267498

Log:
  Respect "vendor" option in all places.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sun Jun 15 07:52:59 2014	(r267497)
+++ head/sys/cam/ctl/ctl.c	Sun Jun 15 08:43:52 2014	(r267498)
@@ -9303,6 +9303,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
 	struct ctl_softc *ctl_softc;
 	struct ctl_lun *lun;
 	struct ctl_frontend *fe;
+	char *val;
 #ifndef CTL_USE_BACKEND_SN
 	char tmpstr[32];
 #endif /* CTL_USE_BACKEND_SN */
@@ -9396,7 +9397,13 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
 	 */
 	desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10;
 	desc->length = sizeof(*t10id) + CTL_DEVID_LEN;
-	strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor));
+	if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) {
+		strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor));
+	} else {
+		memset(t10id->vendor, ' ', sizeof(t10id->vendor));
+		strncpy(t10id->vendor, val,
+		    min(sizeof(t10id->vendor), strlen(val)));
+	}
 
 	/*
 	 * desc1 is for the WWPN which is a port asscociation.

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Sun Jun 15 07:52:59 2014	(r267497)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Sun Jun 15 08:43:52 2014	(r267498)
@@ -2038,6 +2038,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 	struct scsi_vpd_id_t10 *t10id;
 	struct ctl_lun *lun;
 	const struct icl_pdu *request;
+	char *val;
 	size_t devid_len, wwpn_len;
 
 	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
@@ -2102,7 +2103,13 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 	desc->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_ASCII;
 	desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10;
 	desc->length = sizeof(*t10id) + CTL_DEVID_LEN;
-	strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor));
+	if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) {
+		strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor));
+	} else {
+		memset(t10id->vendor, ' ', sizeof(t10id->vendor));
+		strncpy(t10id->vendor, val,
+		    min(sizeof(t10id->vendor), strlen(val)));
+	}
 
 	/*
 	 * If we've actually got a backend, copy the device id from the

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 09:37:07 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 84BCD8E3;
 Sun, 15 Jun 2014 09:37:07 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 58421235C;
 Sun, 15 Jun 2014 09:37:07 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5F9b7KK035774;
 Sun, 15 Jun 2014 09:37:07 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5F9b7HQ035773;
 Sun, 15 Jun 2014 09:37:07 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406150937.s5F9b7HQ035773@svn.freebsd.org>
From: Alexander Motin 
Date: Sun, 15 Jun 2014 09:37:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267499 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 09:37:07 -0000

Author: mav
Date: Sun Jun 15 09:37:06 2014
New Revision: 267499
URL: http://svnweb.freebsd.org/changeset/base/267499

Log:
  Remove custom processing for "file" option.

Modified:
  head/sys/cam/ctl/ctl_backend_block.c

Modified: head/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_block.c	Sun Jun 15 08:43:52 2014	(r267498)
+++ head/sys/cam/ctl/ctl_backend_block.c	Sun Jun 15 09:37:06 2014	(r267499)
@@ -1821,12 +1821,10 @@ ctl_be_block_create(struct ctl_be_block_
 {
 	struct ctl_be_block_lun *be_lun;
 	struct ctl_lun_create_params *params;
-	struct ctl_be_arg *file_arg;
 	char num_thread_str[16];
 	char tmpstr[32];
 	char *value;
 	int retval, num_threads, unmap;
-	int i;
 	int tmp_num_threads;
 
 	params = &req->reqdata.create;
@@ -1834,8 +1832,6 @@ ctl_be_block_create(struct ctl_be_block_
 
 	num_threads = cbb_num_threads;
 
-	file_arg = NULL;
-
 	be_lun = malloc(sizeof(*be_lun), M_CTLBLK, M_ZERO | M_WAITOK);
 
 	be_lun->softc = softc;
@@ -1861,24 +1857,13 @@ ctl_be_block_create(struct ctl_be_block_
 		be_lun->ctl_be_lun.lun_type = T_DIRECT;
 
 	if (be_lun->ctl_be_lun.lun_type == T_DIRECT) {
-		for (i = 0; i < req->num_be_args; i++) {
-			if (strcmp(req->kern_be_args[i].kname, "file") == 0) {
-				file_arg = &req->kern_be_args[i];
-				break;
-			}
-		}
-
-		if (file_arg == NULL) {
+		value = ctl_get_opt(&be_lun->ctl_be_lun, "file");
+		if (value == NULL) {
 			snprintf(req->error_str, sizeof(req->error_str),
 				 "%s: no file argument specified", __func__);
 			goto bailout_error;
 		}
-
-		be_lun->dev_path = malloc(file_arg->vallen, M_CTLBLK,
-					  M_WAITOK | M_ZERO);
-
-		strlcpy(be_lun->dev_path, (char *)file_arg->kvalue,
-			file_arg->vallen);
+		be_lun->dev_path = strdup(value, M_CTLBLK);
 
 		retval = ctl_be_block_open(softc, be_lun, req);
 		if (retval != 0) {
@@ -2516,25 +2501,6 @@ ctl_be_block_lun_info(void *be_lun, stru
 
 	retval = sbuf_printf(sb, "");
 
-	/*
-	 * For processor devices, we don't have a path variable.
-	 */
-	if ((retval != 0)
-	 || (lun->dev_path == NULL))
-		goto bailout;
-
-	retval = sbuf_printf(sb, "");
-
-	if (retval != 0)
-		goto bailout;
-
-	retval = ctl_sbuf_printf_esc(sb, lun->dev_path);
-
-	if (retval != 0)
-		goto bailout;
-
-	retval = sbuf_printf(sb, "\n");
-
 bailout:
 
 	return (retval);

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 10:04:45 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 179141A2;
 Sun, 15 Jun 2014 10:04:45 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 051C1256F;
 Sun, 15 Jun 2014 10:04:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5FA4iM7049339;
 Sun, 15 Jun 2014 10:04:44 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5FA4iD7049338;
 Sun, 15 Jun 2014 10:04:44 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406151004.s5FA4iD7049338@svn.freebsd.org>
From: Alexander Motin 
Date: Sun, 15 Jun 2014 10:04:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267500 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 10:04:45 -0000

Author: mav
Date: Sun Jun 15 10:04:44 2014
New Revision: 267500
URL: http://svnweb.freebsd.org/changeset/base/267500

Log:
  Format Portal Group Tag same as istgt does -- %4.4x instead of %x.
  
  SPC-4 spec tells it should be "two or more hexadecimal digits".
  RFC3720 tells it is 16-bit value.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Sun Jun 15 09:37:06 2014	(r267499)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Sun Jun 15 10:04:44 2014	(r267500)
@@ -2046,7 +2046,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 	cs = PDU_SESSION(request);
 
 	wwpn_len = strlen(cs->cs_target->ct_name);
-	wwpn_len += strlen(",t,0x01");
+	wwpn_len += strlen(",t,0x0001");
 	wwpn_len += 1; /* '\0' */
 	if ((wwpn_len % 4) != 0)
 		wwpn_len += (4 - (wwpn_len % 4));
@@ -2135,7 +2135,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 	desc1->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
 	    SVPD_ID_TYPE_SCSI_NAME;
 	desc1->length = wwpn_len;
-	snprintf(desc1->identifier, wwpn_len, "%s,t,0x%x",
+	snprintf(desc1->identifier, wwpn_len, "%s,t,0x%4.4x",
 	    cs->cs_target->ct_name, cs->cs_portal_group_tag);
 
 	/*

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 10:18:58 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3169156A;
 Sun, 15 Jun 2014 10:18:58 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 059292689;
 Sun, 15 Jun 2014 10:18:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5FAIvIM054853;
 Sun, 15 Jun 2014 10:18:57 GMT (envelope-from joel@svn.freebsd.org)
Received: (from joel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5FAIve8054852;
 Sun, 15 Jun 2014 10:18:57 GMT (envelope-from joel@svn.freebsd.org)
Message-Id: <201406151018.s5FAIve8054852@svn.freebsd.org>
From: Joel Dahl 
Date: Sun, 15 Jun 2014 10:18:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267501 - head/usr.bin/ssh-copy-id
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 10:18:58 -0000

Author: joel (doc committer)
Date: Sun Jun 15 10:18:57 2014
New Revision: 267501
URL: http://svnweb.freebsd.org/changeset/base/267501

Log:
  Fix date.

Modified:
  head/usr.bin/ssh-copy-id/ssh-copy-id.1

Modified: head/usr.bin/ssh-copy-id/ssh-copy-id.1
==============================================================================
--- head/usr.bin/ssh-copy-id/ssh-copy-id.1	Sun Jun 15 10:04:44 2014	(r267500)
+++ head/usr.bin/ssh-copy-id/ssh-copy-id.1	Sun Jun 15 10:18:57 2014	(r267501)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd Feburary 28, 2014
+.Dd February 28, 2014
 .Dt SSH-COPY-ID 1
 .Os
 .Sh NAME

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 10:31:51 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 78A8FB48;
 Sun, 15 Jun 2014 10:31:51 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 65FB128BE;
 Sun, 15 Jun 2014 10:31:51 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5FAVpTm062970;
 Sun, 15 Jun 2014 10:31:51 GMT (envelope-from joel@svn.freebsd.org)
Received: (from joel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5FAVpHL062969;
 Sun, 15 Jun 2014 10:31:51 GMT (envelope-from joel@svn.freebsd.org)
Message-Id: <201406151031.s5FAVpHL062969@svn.freebsd.org>
From: Joel Dahl 
Date: Sun, 15 Jun 2014 10:31:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267502 - head/usr.sbin/binmiscctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 10:31:51 -0000

Author: joel (doc committer)
Date: Sun Jun 15 10:31:50 2014
New Revision: 267502
URL: http://svnweb.freebsd.org/changeset/base/267502

Log:
  mdoc: use display block in the beginning of the EXAMPLES section.

Modified:
  head/usr.sbin/binmiscctl/binmiscctl.8

Modified: head/usr.sbin/binmiscctl/binmiscctl.8
==============================================================================
--- head/usr.sbin/binmiscctl/binmiscctl.8	Sun Jun 15 10:18:57 2014	(r267501)
+++ head/usr.sbin/binmiscctl/binmiscctl.8	Sun Jun 15 10:31:50 2014	(r267502)
@@ -146,10 +146,10 @@ Look up and print out the activator entr
 Take a snapshot and print all the activator entries currently configured.
 .El
 .Sh EXAMPLES
-.Bl
-# binmiscctl add llvmbc --interpreter ''/usr/bin/lli --fake-argv0=#a'' \\
-  --magic ''BC\\xc0\\xde'' --size 4 --set-enabled
-.El
+.Bd -ragged -offset indent
+# binmiscctl add llvmbc --interpreter ''/usr/bin/lli --fake-argv0=#a''
+--magic ''BC\\xc0\\xde'' --size 4 --set-enabled
+.Ed
 .Pp
 Add an image activator to run the LLVM interpreter (lli) on bitcode
 compiled files.

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 10:34:36 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id AD465CA0;
 Sun, 15 Jun 2014 10:34:36 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 821C5290B;
 Sun, 15 Jun 2014 10:34:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5FAYaNQ063408;
 Sun, 15 Jun 2014 10:34:36 GMT (envelope-from joel@svn.freebsd.org)
Received: (from joel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5FAYaqG063406;
 Sun, 15 Jun 2014 10:34:36 GMT (envelope-from joel@svn.freebsd.org)
Message-Id: <201406151034.s5FAYaqG063406@svn.freebsd.org>
From: Joel Dahl 
Date: Sun, 15 Jun 2014 10:34:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267503 - head/share/man/man5
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 10:34:36 -0000

Author: joel (doc committer)
Date: Sun Jun 15 10:34:35 2014
New Revision: 267503
URL: http://svnweb.freebsd.org/changeset/base/267503

Log:
  mdoc: remove superfluous paragraph macros.

Modified:
  head/share/man/man5/pf.conf.5
  head/share/man/man5/rc.conf.5

Modified: head/share/man/man5/pf.conf.5
==============================================================================
--- head/share/man/man5/pf.conf.5	Sun Jun 15 10:31:50 2014	(r267502)
+++ head/share/man/man5/pf.conf.5	Sun Jun 15 10:34:35 2014	(r267503)
@@ -342,7 +342,6 @@ set limit states 10000
 .Pp
 With 9000 state table entries, the timeout values are scaled to 50%
 (tcp.first 60, tcp.established 43200).
-.Pp
 .It Ar set loginterface
 Enable collection of packet and byte count statistics for the given
 interface or interface group.
@@ -362,7 +361,6 @@ One can disable the loginterface using:
 .Bd -literal -offset indent
 set loginterface none
 .Ed
-.Pp
 .It Ar set limit
 Sets hard limits on the memory pools used by the packet filter.
 See
@@ -415,7 +413,6 @@ Various limits can be combined on a sing
 .Bd -literal -offset indent
 set limit { states 20000, frags 20000, src-nodes 2000 }
 .Ed
-.Pp
 .It Ar set ruleset-optimization
 .Bl -tag -width xxxxxxxx -compact
 .It Ar none
@@ -481,7 +478,6 @@ For example:
 .Bd -literal -offset indent
 set optimization aggressive
 .Ed
-.Pp
 .It Ar set block-policy
 The
 .Ar block-policy
@@ -573,7 +569,6 @@ ruleset finishes loading.
 For example:
 .Pp
 .Dl set fingerprints \&"/etc/pf.os.devel\&"
-.Pp
 .It Ar set skip on Aq Ar ifspec
 List interfaces for which packets should not be filtered.
 Packets passing in or out on such interfaces are passed as if pf was
@@ -583,7 +578,6 @@ packet filtering is not desired and can 
 For example:
 .Pp
 .Dl set skip on lo0
-.Pp
 .It Ar set debug
 Set the debug
 .Ar level
@@ -693,7 +687,6 @@ are received.
 The
 .Ar fragment crop
 reassembly mechanism does not yet work with NAT.
-.Pp
 .It Ar fragment drop-ovl
 This option is similar to the
 .Ar fragment crop

Modified: head/share/man/man5/rc.conf.5
==============================================================================
--- head/share/man/man5/rc.conf.5	Sun Jun 15 10:31:50 2014	(r267502)
+++ head/share/man/man5/rc.conf.5	Sun Jun 15 10:34:35 2014	(r267503)
@@ -1498,7 +1498,6 @@ interface as described in RFC 4941.
 This is the IPv6 equivalent of
 .Va network_interfaces .
 Normally manual configuration of this variable is not needed.
-.Pp
 .It Va ipv6_cpe_wanif
 .Pq Vt str
 If the variable is set to an interface name,

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 10:40:55 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 561F8E19;
 Sun, 15 Jun 2014 10:40:55 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 43C6E29B2;
 Sun, 15 Jun 2014 10:40:55 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5FAetDF064831;
 Sun, 15 Jun 2014 10:40:55 GMT (envelope-from joel@svn.freebsd.org)
Received: (from joel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5FAetTb064830;
 Sun, 15 Jun 2014 10:40:55 GMT (envelope-from joel@svn.freebsd.org)
Message-Id: <201406151040.s5FAetTb064830@svn.freebsd.org>
From: Joel Dahl 
Date: Sun, 15 Jun 2014 10:40:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267504 - head/share/man/man4
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 10:40:55 -0000

Author: joel (doc committer)
Date: Sun Jun 15 10:40:54 2014
New Revision: 267504
URL: http://svnweb.freebsd.org/changeset/base/267504

Log:
  mdoc: add missing width argument to Bl -tag.

Modified:
  head/share/man/man4/mrsas.4

Modified: head/share/man/man4/mrsas.4
==============================================================================
--- head/share/man/man4/mrsas.4	Sun Jun 15 10:34:35 2014	(r267503)
+++ head/share/man/man4/mrsas.4	Sun Jun 15 10:40:54 2014	(r267504)
@@ -207,7 +207,7 @@ variable, where X is the adapter number,
 or via
 .Xr sysctl 8 .
 The following bits have the described effects:
-.Bl -tag -offset indent
+.Bl -tag -width indent -offset indent
 .It 0x01
 Enable informational prints.
 .It 0x02

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 10:43:12 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D66B9F67;
 Sun, 15 Jun 2014 10:43:12 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C3FBE2A52;
 Sun, 15 Jun 2014 10:43:12 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5FAhCoR067683;
 Sun, 15 Jun 2014 10:43:12 GMT (envelope-from joel@svn.freebsd.org)
Received: (from joel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5FAhC5P067681;
 Sun, 15 Jun 2014 10:43:12 GMT (envelope-from joel@svn.freebsd.org)
Message-Id: <201406151043.s5FAhC5P067681@svn.freebsd.org>
From: Joel Dahl 
Date: Sun, 15 Jun 2014 10:43:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267505 - in head/bin: chio rm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 10:43:12 -0000

Author: joel (doc committer)
Date: Sun Jun 15 10:43:12 2014
New Revision: 267505
URL: http://svnweb.freebsd.org/changeset/base/267505

Log:
  mdoc: remove superfluous paragraph macros.

Modified:
  head/bin/chio/chio.1
  head/bin/rm/rm.1

Modified: head/bin/chio/chio.1
==============================================================================
--- head/bin/chio/chio.1	Sun Jun 15 10:40:54 2014	(r267504)
+++ head/bin/chio/chio.1	Sun Jun 15 10:43:12 2014	(r267505)
@@ -151,7 +151,6 @@ This command will query the status of th
 will move it to the element specified in its source attribute.
 This is a convenient way to return media from a drive or portal
 to its previous element in the changer.
-.Pp
 .It Ic position Xo
 .Ar  
 .Op Cm inv
@@ -173,7 +172,6 @@ Report which picker unit the changer is 
 .Xc
 Configure the changer to use picker
 .Ar  .
-.Pp
 .It Ic ielem Xo
 .Op Ar 
 .Xc

Modified: head/bin/rm/rm.1
==============================================================================
--- head/bin/rm/rm.1	Sun Jun 15 10:40:54 2014	(r267504)
+++ head/bin/rm/rm.1	Sun Jun 15 10:43:12 2014	(r267505)
@@ -121,7 +121,6 @@ each directory's contents are processed 
 is made to remove the directory).
 If the user does not respond affirmatively, the file hierarchy rooted in
 that directory is skipped.
-.Pp
 .It Fl r
 Equivalent to
 .Fl R .

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 11:21:45 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8DCDF4FB;
 Sun, 15 Jun 2014 11:21:45 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7B1E02ED4;
 Sun, 15 Jun 2014 11:21:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5FBLjAw083962;
 Sun, 15 Jun 2014 11:21:45 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5FBLjol083961;
 Sun, 15 Jun 2014 11:21:45 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406151121.s5FBLjol083961@svn.freebsd.org>
From: Alexander Motin 
Date: Sun, 15 Jun 2014 11:21:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267506 - head/usr.sbin/ctladm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 11:21:45 -0000

Author: mav
Date: Sun Jun 15 11:21:44 2014
New Revision: 267506
URL: http://svnweb.freebsd.org/changeset/base/267506

Log:
  Document additional LUN/backend options.

Modified:
  head/usr.sbin/ctladm/ctladm.8

Modified: head/usr.sbin/ctladm/ctladm.8
==============================================================================
--- head/usr.sbin/ctladm/ctladm.8	Sun Jun 15 10:43:12 2014	(r267505)
+++ head/usr.sbin/ctladm/ctladm.8	Sun Jun 15 11:21:44 2014	(r267506)
@@ -34,7 +34,7 @@
 .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $
 .\" $FreeBSD$
 .\"
-.Dd October 30, 2013
+.Dd June 15, 2014
 .Dt CTLADM 8
 .Os
 .Sh NAME
@@ -933,6 +933,29 @@ Display
 .Nm
 usage information.
 .El
+.Sh OPTIONS
+Number of additional configuration options may be specified for LUNs.
+Some options are global, others are backend-specific.
+.Pp
+Global options:
+.Bl -tag
+.It Va vendor
+Specifies LUN vendor string up to 8 chars.
+.It Va product
+Specifies LUN product string up to 16 chars.
+.It Va revision
+Specifies LUN revision string up to 4 chars.
+.It Va unmap
+Set to "on", enables UNMAP support for the LUN.
+.El
+.Pp
+Options specific for block backend:
+.Bl -tag
+.It Va file
+Specifies file or device name to use for backing store.
+.It Va num_threads
+Specifies number of backend threads to use for this LUN.
+.El
 .Sh EXAMPLES
 .Dl ctladm tur 0:1
 .Pp

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 12:08:34 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 936412A8;
 Sun, 15 Jun 2014 12:08:34 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 75A672384;
 Sun, 15 Jun 2014 12:08:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5FC8Y3d004974;
 Sun, 15 Jun 2014 12:08:34 GMT (envelope-from br@svn.freebsd.org)
Received: (from br@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5FC8Xqt004971;
 Sun, 15 Jun 2014 12:08:33 GMT (envelope-from br@svn.freebsd.org)
Message-Id: <201406151208.s5FC8Xqt004971@svn.freebsd.org>
From: Ruslan Bukin 
Date: Sun, 15 Jun 2014 12:08:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267507 - head/sys/arm/freescale/vybrid
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 12:08:34 -0000

Author: br
Date: Sun Jun 15 12:08:33 2014
New Revision: 267507
URL: http://svnweb.freebsd.org/changeset/base/267507

Log:
  Add very basic driver for 12-bit Analog to Digital Converter (ADC).

Added:
  head/sys/arm/freescale/vybrid/vf_adc.c   (contents, props changed)
  head/sys/arm/freescale/vybrid/vf_adc.h   (contents, props changed)
Modified:
  head/sys/arm/freescale/vybrid/files.vybrid

Modified: head/sys/arm/freescale/vybrid/files.vybrid
==============================================================================
--- head/sys/arm/freescale/vybrid/files.vybrid	Sun Jun 15 11:21:44 2014	(r267506)
+++ head/sys/arm/freescale/vybrid/files.vybrid	Sun Jun 15 12:08:33 2014	(r267507)
@@ -23,6 +23,7 @@ arm/freescale/vybrid/vf_src.c			standard
 arm/freescale/vybrid/vf_edma.c			standard
 arm/freescale/vybrid/vf_dmamux.c		standard
 arm/freescale/vybrid/vf_port.c			standard
+arm/freescale/vybrid/vf_adc.c			standard
 arm/freescale/vybrid/vf_i2c.c			optional	iicbus
 arm/freescale/vybrid/vf_tcon.c			optional	vt
 arm/freescale/vybrid/vf_dcu4.c			optional	vt

Added: head/sys/arm/freescale/vybrid/vf_adc.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/arm/freescale/vybrid/vf_adc.c	Sun Jun 15 12:08:33 2014	(r267507)
@@ -0,0 +1,245 @@
+/*-
+ * Copyright (c) 2014 Ruslan Bukin 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Vybrid Family 12-bit Analog to Digital Converter (ADC)
+ * Chapter 37, Vybrid Reference Manual, Rev. 5, 07/2013
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#define	ADC_HC0		0x00		/* Ctrl reg for hardware triggers */
+#define	ADC_HC1		0x04		/* Ctrl reg for hardware triggers */
+#define	 HC_AIEN	(1 << 7)	/* Conversion Complete Int Control */
+#define	 HC_ADCH_M	0x1f		/* Input Channel Select Mask */
+#define	 HC_ADCH_S	0		/* Input Channel Select Shift */
+#define	ADC_HS		0x08		/* Status register for HW triggers */
+#define	 HS_COCO0	(1 << 0)	/* Conversion Complete Flag */
+#define	 HS_COCO1	(1 << 1)	/* Conversion Complete Flag */
+#define	ADC_R0		0x0C		/* Data result reg for HW triggers */
+#define	ADC_R1		0x10		/* Data result reg for HW triggers */
+#define	ADC_CFG		0x14		/* Configuration register */
+#define	 CFG_OVWREN	(1 << 16)	/* Data Overwrite Enable */
+#define	 CFG_AVGS_M	0x3		/* Hardware Average select Mask */
+#define	 CFG_AVGS_S	14		/* Hardware Average select Shift */
+#define	 CFG_ADTRG	(1 << 13)	/* Conversion Trigger Select */
+#define	 CFG_REFSEL_M	0x3		/* Voltage Reference Select Mask */
+#define	 CFG_REFSEL_S	11		/* Voltage Reference Select Shift */
+#define	 CFG_ADHSC	(1 << 10)	/* High Speed Configuration */
+#define	 CFG_ADSTS_M	0x3		/* Defines the sample time duration */
+#define	 CFG_ADSTS_S	8		/* Defines the sample time duration */
+#define	 CFG_ADLPC	(1 << 7)	/* Low-Power Configuration */
+#define	 CFG_ADIV_M	0x3		/* Clock Divide Select */
+#define	 CFG_ADIV_S	5		/* Clock Divide Select */
+#define	 CFG_ADLSMP	(1 << 4)	/* Long Sample Time Configuration */
+#define	 CFG_MODE_M	0x3		/* Conversion Mode Selection Mask */
+#define	 CFG_MODE_S	2		/* Conversion Mode Selection Shift */
+#define	 CFG_MODE_12	0x2		/* 12-bit mode */
+#define	 CFG_ADICLK_M	0x3		/* Input Clock Select Mask */
+#define	 CFG_ADICLK_S	0		/* Input Clock Select Shift */
+#define	ADC_GC		0x18		/* General control register */
+#define	 GC_CAL		(1 << 7)	/* Calibration */
+#define	 GC_ADCO	(1 << 6)	/* Continuous Conversion Enable */
+#define	 GC_AVGE	(1 << 5)	/* Hardware average enable */
+#define	 GC_ACFE	(1 << 4)	/* Compare Function Enable */
+#define	 GC_ACFGT	(1 << 3)	/* Compare Function Greater Than En */
+#define	 GC_ACREN	(1 << 2)	/* Compare Function Range En */
+#define	 GC_DMAEN	(1 << 1)	/* DMA Enable */
+#define	 GC_ADACKEN	(1 << 0)	/* Asynchronous clock output enable */
+#define	ADC_GS		0x1C		/* General status register */
+#define	 GS_AWKST	(1 << 2)	/* Asynchronous wakeup int status */
+#define	 GS_CALF	(1 << 1)	/* Calibration Failed Flag */
+#define	 GS_ADACT	(1 << 0)	/* Conversion Active */
+#define	ADC_CV		0x20		/* Compare value register */
+#define	 CV_CV2_M	0xfff		/* Compare Value 2 Mask */
+#define	 CV_CV2_S	16		/* Compare Value 2 Shift */
+#define	 CV_CV1_M	0xfff		/* Compare Value 1 Mask */
+#define	 CV_CV1_S	0		/* Compare Value 1 Shift */
+#define	ADC_OFS		0x24		/* Offset correction value register */
+#define	 OFS_SIGN	12		/* Sign bit */
+#define	 OFS_M		0xfff		/* Offset value Mask */
+#define	 OFS_S		0		/* Offset value Shift */
+#define	ADC_CAL		0x28		/* Calibration value register */
+#define	 CAL_CODE_M	0xf		/* Calibration Result Value Mask */
+#define	 CAL_CODE_S	0		/* Calibration Result Value Shift */
+#define	ADC_PCTL	0x30		/* Pin control register */
+
+struct adc_softc {
+	struct resource		*res[2];
+	bus_space_tag_t		bst;
+	bus_space_handle_t	bsh;
+	void			*ih;
+};
+
+struct adc_softc *adc_sc;
+
+static struct resource_spec adc_spec[] = {
+	{ SYS_RES_MEMORY,	0,	RF_ACTIVE },
+	{ SYS_RES_IRQ,		0,	RF_ACTIVE },
+	{ -1, 0 }
+};
+
+static int
+adc_probe(device_t dev)
+{
+
+	if (!ofw_bus_status_okay(dev))
+		return (ENXIO);
+
+	if (!ofw_bus_is_compatible(dev, "fsl,mvf600-adc"))
+		return (ENXIO);
+
+	device_set_desc(dev, "Vybrid Family "
+	    "12-bit Analog to Digital Converter");
+	return (BUS_PROBE_DEFAULT);
+}
+
+static void
+adc_intr(void *arg)
+{
+	struct adc_softc *sc;
+
+	sc = arg;
+
+	/* Conversation complete */
+}
+
+uint32_t
+adc_read(void)
+{
+	struct adc_softc *sc;
+
+	sc = adc_sc;
+	if (sc == NULL)
+		return (0);
+
+	return (READ4(sc, ADC_R0));
+}
+
+uint32_t
+adc_enable(int channel)
+{
+	struct adc_softc *sc;
+	int reg;
+
+	sc = adc_sc;
+	if (sc == NULL)
+		return (1);
+
+	reg = READ4(sc, ADC_HC0);
+	reg &= ~(HC_ADCH_M << HC_ADCH_S);
+	reg |= (channel << HC_ADCH_S);
+	WRITE4(sc, ADC_HC0, reg);
+
+	return (0);
+}
+
+static int
+adc_attach(device_t dev)
+{
+	struct adc_softc *sc;
+	int err;
+	int reg;
+
+	sc = device_get_softc(dev);
+
+	if (bus_alloc_resources(dev, adc_spec, sc->res)) {
+		device_printf(dev, "could not allocate resources\n");
+		return (ENXIO);
+	}
+
+	/* Memory interface */
+	sc->bst = rman_get_bustag(sc->res[0]);
+	sc->bsh = rman_get_bushandle(sc->res[0]);
+
+	adc_sc = sc;
+
+	/* Setup interrupt handler */
+	err = bus_setup_intr(dev, sc->res[1], INTR_TYPE_BIO | INTR_MPSAFE,
+	    NULL, adc_intr, sc, &sc->ih);
+	if (err) {
+		device_printf(dev, "Unable to alloc interrupt resource.\n");
+		return (ENXIO);
+	}
+
+	/* Configure 12-bit mode */
+	reg = READ4(sc, ADC_CFG);
+	reg &= ~(CFG_MODE_M << CFG_MODE_S);
+	reg |= (CFG_MODE_12 << CFG_MODE_S); /* 12bit */
+	WRITE4(sc, ADC_CFG, reg);
+
+	/* Configure for continuous conversion */
+	reg = READ4(sc, ADC_GC);
+	reg |= (GC_ADCO | GC_AVGE);
+	WRITE4(sc, ADC_GC, reg);
+
+	/* Disable interrupts */
+	reg = READ4(sc, ADC_HC0);
+	reg &= HC_AIEN;
+	WRITE4(sc, ADC_HC0, reg);
+
+	return (0);
+}
+
+static device_method_t adc_methods[] = {
+	DEVMETHOD(device_probe,		adc_probe),
+	DEVMETHOD(device_attach,	adc_attach),
+	{ 0, 0 }
+};
+
+static driver_t adc_driver = {
+	"adc",
+	adc_methods,
+	sizeof(struct adc_softc),
+};
+
+static devclass_t adc_devclass;
+
+DRIVER_MODULE(adc, simplebus, adc_driver, adc_devclass, 0, 0);

Added: head/sys/arm/freescale/vybrid/vf_adc.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/arm/freescale/vybrid/vf_adc.h	Sun Jun 15 12:08:33 2014	(r267507)
@@ -0,0 +1,30 @@
+/*-
+ * Copyright (c) 2014 Ruslan Bukin 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+uint32_t adc_read(void);
+uint32_t adc_enable(int);

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 13:45:38 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 48570E73;
 Sun, 15 Jun 2014 13:45:38 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 355A82C04;
 Sun, 15 Jun 2014 13:45:38 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5FDjcse052139;
 Sun, 15 Jun 2014 13:45:38 GMT (envelope-from ian@svn.freebsd.org)
Received: (from ian@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5FDjbaM052137;
 Sun, 15 Jun 2014 13:45:37 GMT (envelope-from ian@svn.freebsd.org)
Message-Id: <201406151345.s5FDjbaM052137@svn.freebsd.org>
From: Ian Lepore 
Date: Sun, 15 Jun 2014 13:45:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267511 - in head: lib share/mk
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 13:45:38 -0000

Author: ian
Date: Sun Jun 15 13:45:37 2014
New Revision: 267511
URL: http://svnweb.freebsd.org/changeset/base/267511

Log:
  Create a mechanism for providing fine-grained build order dependencies
  during SUBDIR_PARALLEL builds.  This augments the coarse .WAIT mechanism,
  which is still useful if you've got a situation such as "almost everything
  depends on A and B".
  
  Because the parallel subdir mechanism uses non-obvious mangling of
  target names, which should probably remain a private detail of the
  implementation, it's not easy to do things like "libfoo: libbar", so
  instead the new mechanism lets you set a variable that lists dependencies:
  
    SUBDIR_DEPEND_libfoo= libgroodah libpouet
  
  Note that while I'm using libraries as an example here, it really has
  nothing to do with the generated library files.  This is really saying
  "build in directory libfoo after building in the libgroodah and libpouet
  directories."
  
  This updates lib/Makefile with dependency information based on the old
  almost-accurate comment block and by combing through lib/* makefiles
  looking for LDADD dependencies to other libraries within lib/*.
  
  Reviewed by:	Jia-Shiun Li 

Modified:
  head/lib/Makefile
  head/share/mk/bsd.subdir.mk

Modified: head/lib/Makefile
==============================================================================
--- head/lib/Makefile	Sun Jun 15 13:43:44 2014	(r267510)
+++ head/lib/Makefile	Sun Jun 15 13:45:37 2014	(r267511)
@@ -3,82 +3,43 @@
 
 .include 
 
-# To satisfy shared library or ELF linkage when only the libraries being
-# built are visible:
-#
-# csu must be built before all shared libaries for ELF.
-# libc must be built before all other shared libraries.
-# libbsm must be built before libauditd.
-# libcom_err must be built before libpam.
-# libcrypt must be built before libpam.
-# libkvm must be built before libdevstat.
-# libldns must be built before libunbound.
-# msun must be built before libg++ and libstdc++.
-# libmd must be built before libatm, libopie, libradius, and libtacplus.
-# ncurses must be built before libdialog, libedit and libreadline.
-# libnetgraph must be built before libbsnmp/modules/snmp_netgraph.
-# libopie must be built before libpam.
-# libradius must be built before libpam.
-# librpcsvc must be built before libpam.
-# libsbuf must be built before libcam.
-# libtacplus must be built before libpam.
-# libutil must be built before libpam.
-# libypclnt must be built before libpam.
-# libgssapi must be built before librpcsec_gss
-#
-# Otherwise, the SUBDIR list should be in alphabetical order.
-#
-# Except it appears bind needs to be compiled last
+# The SUBDIR_ORDERED list is a small set of libraries which are used by many
+# of the other libraries.  These are built first with a .WAIT between them
+# and the main list to avoid needing a SUBDIR_DEPEND line on every library
+# naming just these few items.
 
 SUBDIR_ORDERED=	${_csu} \
 	.WAIT \
 	libc \
 	libc_nonshared \
-	.WAIT \
-	msun \
-	.WAIT \
-	libbsm \
-	libauditd \
-	libutil \
-	libpjdlog \
-	libnv \
-	${_libcapsicum} \
 	libcompiler_rt \
-	libcrypt \
-	libelf \
-	${_libiconv_modules} \
-	libkvm \
-	${_libldns} \
-	libmd \
-	ncurses \
-	${_libnetgraph} \
-	libradius \
-	librpcsvc \
-	libsbuf \
-	libtacplus \
-	${_libypclnt} \
+	${_libcplusplus} \
 	${_libcxxrt} \
-	${_libcplusplus}
+	libelf \
+	msun
 
-.if ${MK_KERBEROS_SUPPORT} != "no"
-SUBDIR_ORDERED+=	libcom_err
-.endif
+# The main list; please keep these sorted alphabetically.
 
 SUBDIR=	${SUBDIR_ORDERED} \
 	.WAIT \
 	libalias \
 	libarchive \
 	${_libatm} \
+	libauditd \
 	libbegemot \
 	libblocksruntime \
 	${_libbluetooth} \
 	${_libbsnmp} \
 	libbsdstat \
+	libbsm \
 	libbz2 \
 	libcalendar \
 	libcam \
+	${_libcapsicum} \
 	${_libcasper} \
+	${_libcom_err} \
 	libcompat \
+	libcrypt \
 	libdevinfo \
 	libdevstat \
 	libdwarf \
@@ -91,26 +52,36 @@ SUBDIR=	${SUBDIR_ORDERED} \
 	${_libgpib} \
 	${_libgssapi} \
 	${_librpcsec_gss} \
+	${_libiconv_modules} \
 	libipsec \
 	libjail \
 	libkiconv \
+	libkvm \
+	${_libldns} \
 	liblzma \
 	libmagic \
 	libmandoc \
 	libmemstat \
+	libmd \
 	${_libmilter} \
 	${_libmp} \
 	${_libnandfs} \
 	libnetbsd \
+	${_libnetgraph} \
 	${_libngatm} \
+	libnv \
 	libopie \
 	libpam \
 	libpcap \
+	libpjdlog \
 	${_libpmc} \
 	${_libproc} \
 	libprocstat \
+	libradius \
+	librpcsvc \
 	librt \
 	${_librtld_db} \
+	libsbuf \
 	${_libsdp} \
 	${_libsm} \
 	${_libsmb} \
@@ -119,6 +90,7 @@ SUBDIR=	${SUBDIR_ORDERED} \
 	libstand \
 	libstdbuf \
 	libstdthreads \
+	libtacplus \
 	${_libtelnet} \
 	${_libthr} \
 	libthread_db \
@@ -129,16 +101,51 @@ SUBDIR=	${SUBDIR_ORDERED} \
 	${_libunbound} \
 	${_libusbhid} \
 	${_libusb} \
+	libutil \
 	${_libvgl} \
 	${_libvmmapi} \
 	libwrap \
 	liby \
+	${_libypclnt} \
 	libz \
+	ncurses \
 	${_atf} \
 	${_clang} \
 	${_cuse} \
 	${_tests}
 
+# Inter-library dependencies.  When the makefile for a library contains LDADD
+# libraries, those libraries should be listed as build order dependencies here.
+
+SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd
+SUBDIR_DEPEND_libatm= libmd
+SUBDIR_DEPEND_libauditdm= libbsm
+SUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
+SUBDIR_DEPEND_libc++= libcxxrt
+SUBDIR_DEPEND_libc= libcompiler_rt
+SUBDIR_DEPEND_libcam= libsbuf
+SUBDIR_DEPEND_libcapsicum= libnv
+SUBDIR_DEPEND_libcasper= libcapsicum libnv libpjdlog
+SUBDIR_DEPEND_libdevstat= libkvm
+SUBDIR_DEPEND_libdiaglog= ncurses
+SUBDIR_DEPEND_libedit= ncurses
+SUBDIR_DEPEND_libg++= msun
+SUBDIR_DEPEND_libgeom= libexpat libsbuf
+SUBDIR_DEPEND_liblibrpcsec_gss= libgssapi
+SUBDIR_DEPEND_libmagic= libz
+SUBDIR_DEPEND_libmemstat= libkvm
+SUBDIR_DEPEND_libopie= libmd
+SUBDIR_DEPEND_libpam= libcrypt libopie libradius librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err} 
+SUBDIR_DEPEND_libpjdlog= libutil
+SUBDIR_DEPEND_libprocstat= libkvm libutil
+SUBDIR_DEPEND_libradius= libmd
+SUBDIR_DEPEND_libreadline= ncurses
+SUBDIR_DEPEND_libsmb= libkiconv
+SUBDIR_DEPEND_libstdc++= msun
+SUBDIR_DEPEND_libtacplus= libmd
+SUBDIR_DEPEND_libulog= libmd
+SUBDIR_DEPEND_libunbound= ${_libldns}
+
 .if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf)
 _csu=csu/${MACHINE_ARCH}-elf
 .elif exists(${.CURDIR}/csu/${MACHINE_ARCH})
@@ -190,6 +197,10 @@ _librpcsec_gss=	librpcsec_gss
 _libiconv_modules=	libiconv_modules
 .endif
 
+.if ${MK_KERBEROS_SUPPORT} != "no"
+_libcom_err= libcom_err
+.endif
+
 .if ${MK_LDNS} != "no"
 _libldns=	libldns
 .endif

Modified: head/share/mk/bsd.subdir.mk
==============================================================================
--- head/share/mk/bsd.subdir.mk	Sun Jun 15 13:43:44 2014	(r267510)
+++ head/share/mk/bsd.subdir.mk	Sun Jun 15 13:45:37 2014	(r267511)
@@ -80,7 +80,11 @@ __subdir_targets=
 __subdir_targets+= .WAIT
 .else
 __subdir_targets+= ${__target}_subdir_${__dir}
-${__target}_subdir_${__dir}: .MAKE
+__deps=
+.for __dep in ${SUBDIR_DEPEND_${__dir}}
+__deps+= ${__target}_subdir_${__dep}
+.endfor
+${__target}_subdir_${__dir}: .MAKE ${__deps}
 .if !defined(NO_SUBDIR)
 	@${_+_}set -e; \
 		if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 15:12:11 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B489961E;
 Sun, 15 Jun 2014 15:12:11 +0000 (UTC)
Received: from gromit.grondar.org (grandfather.grondar.org
 [IPv6:2a01:348:0:15:5d59:5c20:0:2])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7460222B5;
 Sun, 15 Jun 2014 15:12:11 +0000 (UTC)
Received: from [2001:470:9174:1:29c2:f380:e45f:e04a]
 by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128)
 (Exim 4.80.1 (FreeBSD)) (envelope-from )
 id 1WwC6D-000HJO-U8; Sun, 15 Jun 2014 16:12:07 +0100
Subject: Re: svn commit: r266083 - in head/sys/arm: arm include
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Content-Type: text/plain; charset=windows-1252
From: Mark R V Murray 
In-Reply-To: <9B438991-C970-46A7-8116-A490E02D7139@fh-muenster.de>
Date: Sun, 15 Jun 2014 16:13:08 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <3841D090-5973-40B0-B61C-F15E8C1978C9@FreeBSD.org>
References: <201405141911.s4EJBFZZ097826@svn.freebsd.org>
 <537D0952.2040001@selasky.org>
 <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org>
 <53871493.2010502@selasky.org>
 
 <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de>
 
 
 
 <9B438991-C970-46A7-8116-A490E02D7139@fh-muenster.de>
To: Michael Tuexen 
X-Mailer: Apple Mail (2.1878.2)
X-SA-Score: -1.0
Cc: Hans Petter Selasky , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 15:12:11 -0000


On 30 May 2014, at 09:42, Michael Tuexen  wrote:

> On 29 May 2014, at 21:21, Mark R V Murray  wrote:
>=20
>>=20
>> On 29 May 2014, at 19:27, Michael Tuexen  =
wrote:
>>=20
>>> On 29 May 2014, at 20:15, Mark R V Murray  wrote:
>>>=20
>>>>=20
>>>> On 29 May 2014, at 19:13, Michael Tuexen  =
wrote:
>>>>=20
>>>>>> I can make it work on RPI, but trying to find what else it =
will/won=92t work on is more problematic.
>>>>> Wouldn't it require to use different registers on the RPI? This =
would mean you
>>>>> would need more #ifdefs=85
>>>>=20
>>>> Thats the problem; too many #ifdefs.
>>> So you could just keep the code for now, but reduce the #ifdefs to =
the ones you
>>> know that work. Later on, you can replace it by the driver stuff=85
>>=20
>> That=92s what I was thinking, yes.
> Great. Let me know if you need testing support on the RPI=85

I=92ve come to the conclusion that my RPI-B is hosed. It doesn=92t even =
boot Raspian properly. Sorry about how long this has taken.

Please could someone with a working RPI please check that the following =
patch works (may need to apply by hand due to cut/paste).

Thanks, with repeated apologies.

M
--=20
Mark R V Murray

--- include/cpu.h	(revision 267507)
+++ include/cpu.h	(working copy)
@@ -25,7 +25,16 @@
 	 * Read PMCCNTR. Curses! Its only 32 bits.
 	 * TODO: Fix this by catching overflow with interrupt?
 	 */
+/* The ARMv6 vs ARMv7 divide is going to need a better way of
+ * distinguishing between them.
+ */
+#if defined(CPU_ARM1136) || defined(CPU_ARM1176)
+	/* ARMv6 - Earlier model SCCs */
+	__asm __volatile("mrc p15, 0, %0, c15, c12, 1": "=3Dr" (ccnt));
+#else
+	/* ARMv7 - Later model SCCs */
 	__asm __volatile("mrc p15, 0, %0, c9, c13, 0": "=3Dr" (ccnt));
+#endif
 	ccnt64 =3D (uint64_t)ccnt;
 	return (ccnt64);
 #else /* No performance counters, so use binuptime(9). This is slooooow =
*/


From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 15:25:47 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 24203B84;
 Sun, 15 Jun 2014 15:25:47 +0000 (UTC)
Received: from mail-n.franken.de (drew.ipv6.franken.de
 [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id CBFD7239F;
 Sun, 15 Jun 2014 15:25:46 +0000 (UTC)
Received: from [192.168.1.200] (p54818065.dip0.t-ipconnect.de [84.129.128.101])
 (Authenticated sender: macmic)
 by mail-n.franken.de (Postfix) with ESMTP id 77E6A1C0B3F78;
 Sun, 15 Jun 2014 17:25:42 +0200 (CEST)
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r266083 - in head/sys/arm: arm include
From: Michael Tuexen 
In-Reply-To: <3841D090-5973-40B0-B61C-F15E8C1978C9@FreeBSD.org>
Date: Sun, 15 Jun 2014 17:25:41 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201405141911.s4EJBFZZ097826@svn.freebsd.org>
 <537D0952.2040001@selasky.org>
 <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org>
 <53871493.2010502@selasky.org>
 
 <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de>
 
 
 
 <9B438991-C970-46A7-8116-A490E02D7139@fh-muenster.de>
 <3841D090-5973-40B0-B61C-F15E8C1978C9@FreeBSD.org>
To: Mark R V Murray 
X-Mailer: Apple Mail (2.1878.2)
Cc: Hans Petter Selasky , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 15:25:47 -0000


On 15 Jun 2014, at 17:13, Mark R V Murray  wrote:

>=20
> On 30 May 2014, at 09:42, Michael Tuexen  =
wrote:
>=20
>> On 29 May 2014, at 21:21, Mark R V Murray  wrote:
>>=20
>>>=20
>>> On 29 May 2014, at 19:27, Michael Tuexen  =
wrote:
>>>=20
>>>> On 29 May 2014, at 20:15, Mark R V Murray  =
wrote:
>>>>=20
>>>>>=20
>>>>> On 29 May 2014, at 19:13, Michael Tuexen  =
wrote:
>>>>>=20
>>>>>>> I can make it work on RPI, but trying to find what else it =
will/won=92t work on is more problematic.
>>>>>> Wouldn't it require to use different registers on the RPI? This =
would mean you
>>>>>> would need more #ifdefs=85
>>>>>=20
>>>>> Thats the problem; too many #ifdefs.
>>>> So you could just keep the code for now, but reduce the #ifdefs to =
the ones you
>>>> know that work. Later on, you can replace it by the driver stuff=85
>>>=20
>>> That=92s what I was thinking, yes.
>> Great. Let me know if you need testing support on the RPI=85
>=20
> I=92ve come to the conclusion that my RPI-B is hosed. It doesn=92t =
even boot Raspian properly. Sorry about how long this has taken.
>=20
> Please could someone with a working RPI please check that the =
following patch works (may need to apply by hand due to cut/paste).
>=20
> Thanks, with repeated apologies.
I can test it and report if it works. It might take until tomorrow...
Thanks for working on a fix!


Best regards
Michael
>=20
> M
> --=20
> Mark R V Murray
>=20
> --- include/cpu.h	(revision 267507)
> +++ include/cpu.h	(working copy)
> @@ -25,7 +25,16 @@
> 	 * Read PMCCNTR. Curses! Its only 32 bits.
> 	 * TODO: Fix this by catching overflow with interrupt?
> 	 */
> +/* The ARMv6 vs ARMv7 divide is going to need a better way of
> + * distinguishing between them.
> + */
> +#if defined(CPU_ARM1136) || defined(CPU_ARM1176)
> +	/* ARMv6 - Earlier model SCCs */
> +	__asm __volatile("mrc p15, 0, %0, c15, c12, 1": "=3Dr" (ccnt));
> +#else
> +	/* ARMv7 - Later model SCCs */
> 	__asm __volatile("mrc p15, 0, %0, c9, c13, 0": "=3Dr" (ccnt));
> +#endif
> 	ccnt64 =3D (uint64_t)ccnt;
> 	return (ccnt64);
> #else /* No performance counters, so use binuptime(9). This is =
slooooow */
>=20
>=20


From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 16:38:18 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 591A3F9E;
 Sun, 15 Jun 2014 16:38:18 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4656C28FC;
 Sun, 15 Jun 2014 16:38:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5FGcIYH031498;
 Sun, 15 Jun 2014 16:38:18 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5FGcHpG031496;
 Sun, 15 Jun 2014 16:38:17 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201406151638.s5FGcHpG031496@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Sun, 15 Jun 2014 16:38:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267512 - head/usr.bin/patch
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 16:38:18 -0000

Author: pfg
Date: Sun Jun 15 16:38:17 2014
New Revision: 267512
URL: http://svnweb.freebsd.org/changeset/base/267512

Log:
  patch: add dry-run alias for compatibility with other implementations.
  
  Other implementations of patch(1), including GNU patch and "svn patch"
  have a --dry-run option which does the same as our -C or --check
  option.
  
  Add a new alias to make our implementation more compatible.
  
  MFC after:	1 week

Modified:
  head/usr.bin/patch/patch.1
  head/usr.bin/patch/patch.c

Modified: head/usr.bin/patch/patch.1
==============================================================================
--- head/usr.bin/patch/patch.1	Sun Jun 15 13:45:37 2014	(r267511)
+++ head/usr.bin/patch/patch.1	Sun Jun 15 16:38:17 2014	(r267512)
@@ -21,7 +21,7 @@
 .\"
 .\" $OpenBSD: patch.1,v 1.27 2014/04/15 06:26:54 jmc Exp $
 .\" $FreeBSD$
-.Dd June 12, 2014
+.Dd June 15, 2014
 .Dt PATCH 1
 .Os
 .Sh NAME
@@ -107,7 +107,7 @@ This is equivalent to specifying
 This option is currently the default, unless
 .Fl -posix
 is specified.
-.It Fl C , Fl Fl check
+.It Fl C , Fl Fl check , Fl Fl dry-run
 Checks that the patch would apply cleanly, but does not modify anything.
 .It Fl c , Fl Fl context
 Forces

Modified: head/usr.bin/patch/patch.c
==============================================================================
--- head/usr.bin/patch/patch.c	Sun Jun 15 13:45:37 2014	(r267511)
+++ head/usr.bin/patch/patch.c	Sun Jun 15 16:38:17 2014	(r267512)
@@ -469,6 +469,7 @@ get_some_switches(void)
 		{"context",		no_argument,		0,	'c'},
 		{"debug",		required_argument,	0,	'x'},
 		{"directory",		required_argument,	0,	'd'},
+		{"dry-run",		no_argument,		0,	'C'},
 		{"ed",			no_argument,		0,	'e'},
 		{"force",		no_argument,		0,	'f'},
 		{"forward",		no_argument,		0,	'N'},

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 16:54:27 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3C51E5F3;
 Sun, 15 Jun 2014 16:54:27 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 27FD02A56;
 Sun, 15 Jun 2014 16:54:27 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5FGsRMn040006;
 Sun, 15 Jun 2014 16:54:27 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5FGsQQ2040003;
 Sun, 15 Jun 2014 16:54:26 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201406151654.s5FGsQQ2040003@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Sun, 15 Jun 2014 16:54:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267513 -
 head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 16:54:27 -0000

Author: pfg
Date: Sun Jun 15 16:54:26 2014
New Revision: 267513
URL: http://svnweb.freebsd.org/changeset/base/267513

Log:
  MFV	r266988:
  
  Merge from r258379 missed the tests.
  
  4248 dtrace(1M) should never create DOF with empty probes section
  4249 Only probes from the first DTrace object file will be included
  
  Illumos Revision:	54a20ab41aadcb81c53e72fc65886e964e9add59
  
  MFC after:	5 days

Added:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh
     - copied unchanged from r266988, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh.out
     - copied unchanged from r266988, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh
     - copied unchanged from r266988, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh

Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh (from r266988, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh	Sun Jun 15 16:54:26 2014	(r267513, copy of r266988, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh)
@@ -0,0 +1,106 @@
+#
+# CDDL HEADER START
+#
+# 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]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2013, Joyent, Inc. All rights reserved.
+#
+
+if [ $# != 1 ]; then
+	echo expected one argument: '<'dtrace-path'>'
+	exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+echo '#pragma D option quiet' > test.d
+echo '#pragma D option aggsortkey' >> test.d
+
+cat > test.c <
+
+void
+main()
+{
+EOF
+
+objs=
+
+for oogle in doogle bagnoogle; do
+	cat > $oogle.c <
+
+void
+$oogle()
+{
+	DTRACE_PROBE($oogle, knows);
+}
+EOF
+
+	cat > $oogle.d <> test.c
+	echo $oogle'$target:::{@[probefunc] = count()}' >> test.d
+done
+
+echo "}" >> test.c
+
+echo 'END{printa("%-10s %@d\\n", @)}' >> test.d
+
+cc -o test test.c $objs
+
+if [ $? -ne 0 ]; then
+	print -u2 "failed to compile test.c"
+	exit 1
+fi
+
+$dtrace -s ./test.d -Zc ./test
+
+if [ $? -ne 0 ]; then
+	print -u2 "failed to execute test"
+	exit 1
+fi
+
+cd /
+/usr/bin/rm -rf $DIR
+exit 0

Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh.out (from r266988, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh.out)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh.out	Sun Jun 15 16:54:26 2014	(r267513, copy of r266988, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh.out)
@@ -0,0 +1,3 @@
+bagnoogle  1
+doogle     1
+

Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh (from r266988, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh	Sun Jun 15 16:54:26 2014	(r267513, copy of r266988, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh)
@@ -0,0 +1,59 @@
+#
+# CDDL HEADER START
+#
+# 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]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2013, Joyent, Inc. All rights reserved.
+#
+
+if [ $# != 1 ]; then
+	echo expected one argument: '<'dtrace-path'>'
+	exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > test.c < doogle.d <
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3D386923;
 Sun, 15 Jun 2014 17:14:53 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2A00D2BFD;
 Sun, 15 Jun 2014 17:14:53 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5FHEr3U049542;
 Sun, 15 Jun 2014 17:14:53 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5FHEqvD049539;
 Sun, 15 Jun 2014 17:14:52 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406151714.s5FHEqvD049539@svn.freebsd.org>
From: Alexander Motin 
Date: Sun, 15 Jun 2014 17:14:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267514 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 17:14:53 -0000

Author: mav
Date: Sun Jun 15 17:14:52 2014
New Revision: 267514
URL: http://svnweb.freebsd.org/changeset/base/267514

Log:
  Move kern_total_len setting from backend to core code.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_backend_block.c
  head/sys/cam/ctl/ctl_backend_ramdisk.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sun Jun 15 16:54:26 2014	(r267513)
+++ head/sys/cam/ctl/ctl.c	Sun Jun 15 17:14:52 2014	(r267514)
@@ -8800,6 +8800,9 @@ ctl_read_write(struct ctl_scsiio *ctsio)
 	memcpy(ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, &lbalen,
 	       sizeof(lbalen));
 
+	ctsio->kern_total_len = num_blocks * lun->be_lun->blocksize;
+	ctsio->kern_rel_offset = 0;
+
 	CTL_DEBUG_PRINT(("ctl_read_write: calling data_submit()\n"));
 
 	retval = lun->backend->data_submit((union ctl_io *)ctsio);

Modified: head/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_block.c	Sun Jun 15 16:54:26 2014	(r267513)
+++ head/sys/cam/ctl/ctl_backend_block.c	Sun Jun 15 17:14:52 2014	(r267514)
@@ -1383,15 +1383,11 @@ ctl_be_block_worker(void *context, int p
 static int
 ctl_be_block_submit(union ctl_io *io)
 {
-	struct ctl_lba_len lbalen;
 	struct ctl_be_block_lun *be_lun;
 	struct ctl_be_lun *ctl_be_lun;
-	int retval;
 
 	DPRINTF("entered\n");
 
-	retval = CTL_RETVAL_COMPLETE;
-
 	ctl_be_lun = (struct ctl_be_lun *)io->io_hdr.ctl_private[
 		CTL_PRIV_BACKEND_LUN].ptr;
 	be_lun = (struct ctl_be_block_lun *)ctl_be_lun->be_lun;
@@ -1402,11 +1398,6 @@ ctl_be_block_submit(union ctl_io *io)
 	KASSERT(io->io_hdr.io_type == CTL_IO_SCSI, ("Non-SCSI I/O (type "
 		"%#x) encountered", io->io_hdr.io_type));
 
-	memcpy(&lbalen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes,
-	       sizeof(lbalen));
-	io->scsiio.kern_total_len = lbalen.len * be_lun->blocksize;
-	io->scsiio.kern_rel_offset = 0;
-
 	mtx_lock(&be_lun->lock);
 	/*
 	 * XXX KDM make sure that links is okay to use at this point.
@@ -1415,10 +1406,9 @@ ctl_be_block_submit(union ctl_io *io)
 	 */
 	STAILQ_INSERT_TAIL(&be_lun->input_queue, &io->io_hdr, links);
 	mtx_unlock(&be_lun->lock);
-
 	taskqueue_enqueue(be_lun->io_taskqueue, &be_lun->io_task);
 
-	return (retval);
+	return (CTL_RETVAL_COMPLETE);
 }
 
 static int

Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_ramdisk.c	Sun Jun 15 16:54:26 2014	(r267513)
+++ head/sys/cam/ctl/ctl_backend_ramdisk.c	Sun Jun 15 17:14:52 2014	(r267514)
@@ -274,20 +274,8 @@ ctl_backend_ramdisk_move_done(union ctl_
 static int
 ctl_backend_ramdisk_submit(union ctl_io *io)
 {
-	struct ctl_lba_len lbalen;
-	struct ctl_be_lun *ctl_be_lun;
 
-	ctl_be_lun = (struct ctl_be_lun *)io->io_hdr.ctl_private[
-		CTL_PRIV_BACKEND_LUN].ptr;
-
-	memcpy(&lbalen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes,
-	       sizeof(lbalen));
-	io->scsiio.be_move_done = ctl_backend_ramdisk_move_done;
-	io->scsiio.kern_total_len = lbalen.len * ctl_be_lun->blocksize;
-	io->scsiio.kern_rel_offset = 0;
-	io->scsiio.kern_data_resid = 0;
 	ctl_backend_ramdisk_continue(io);
-
 	return (CTL_RETVAL_COMPLETE);
 }
 
@@ -328,6 +316,8 @@ ctl_backend_ramdisk_continue(union ctl_i
 	io->scsiio.kern_data_ptr = softc->ramdisk_buffer;
 #endif /* CTL_RAMDISK_PAGES */
 
+	io->scsiio.be_move_done = ctl_backend_ramdisk_move_done;
+	io->scsiio.kern_data_resid = 0;
 	io->scsiio.kern_data_len = len_filled;
 	io->scsiio.kern_sg_entries = sg_filled;
 	io->io_hdr.flags |= CTL_FLAG_ALLOCATED;

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 18:16:52 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 87A46F82;
 Sun, 15 Jun 2014 18:16:52 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7397123EE;
 Sun, 15 Jun 2014 18:16:52 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5FIGqXB077874;
 Sun, 15 Jun 2014 18:16:52 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5FIGqnc077872;
 Sun, 15 Jun 2014 18:16:52 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406151816.s5FIGqnc077872@svn.freebsd.org>
From: Alexander Motin 
Date: Sun, 15 Jun 2014 18:16:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267515 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 18:16:52 -0000

Author: mav
Date: Sun Jun 15 18:16:51 2014
New Revision: 267515
URL: http://svnweb.freebsd.org/changeset/base/267515

Log:
  Remove memcpy() from ctl_private[] accesses.
  
  That union is aligned enough to access data directly.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_backend_block.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sun Jun 15 17:14:52 2014	(r267514)
+++ head/sys/cam/ctl/ctl.c	Sun Jun 15 18:16:51 2014	(r267515)
@@ -5779,7 +5779,7 @@ int
 ctl_write_same(struct ctl_scsiio *ctsio)
 {
 	struct ctl_lun *lun;
-	struct ctl_lba_len_flags lbalen;
+	struct ctl_lba_len_flags *lbalen;
 	uint64_t lba;
 	uint32_t num_blocks;
 	int len, retval;
@@ -5872,11 +5872,10 @@ ctl_write_same(struct ctl_scsiio *ctsio)
 		return (CTL_RETVAL_COMPLETE);
 	}
 
-	lbalen.lba = lba;
-	lbalen.len = num_blocks;
-	lbalen.flags = byte2;
-	memcpy(ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, &lbalen,
-	       sizeof(lbalen));
+	lbalen = (struct ctl_lba_len_flags *)&ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
+	lbalen->lba = lba;
+	lbalen->len = num_blocks;
+	lbalen->flags = byte2;
 	retval = lun->backend->config_write((union ctl_io *)ctsio);
 
 	return (retval);
@@ -5887,7 +5886,7 @@ ctl_unmap(struct ctl_scsiio *ctsio)
 {
 	struct ctl_lun *lun;
 	struct scsi_unmap *cdb;
-	struct ctl_ptr_len_flags ptrlen;
+	struct ctl_ptr_len_flags *ptrlen;
 	struct scsi_unmap_header *hdr;
 	struct scsi_unmap_desc *buf, *end;
 	uint64_t lba;
@@ -5942,11 +5941,10 @@ ctl_unmap(struct ctl_scsiio *ctsio)
 	buf = (struct scsi_unmap_desc *)(hdr + 1);
 	end = buf + len / sizeof(*buf);
 
-	ptrlen.ptr = (void *)buf;
-	ptrlen.len = len;
-	ptrlen.flags = byte2;
-	memcpy(ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, &ptrlen,
-	       sizeof(ptrlen));
+	ptrlen = (struct ctl_ptr_len_flags *)&ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
+	ptrlen->ptr = (void *)buf;
+	ptrlen->len = len;
+	ptrlen->flags = byte2;
 
 	for (; buf < end; buf++) {
 		lba = scsi_8btou64(buf->lba);
@@ -12755,7 +12753,7 @@ ctl_process_done(union ctl_io *io, int h
 		switch (io->io_hdr.io_type) {
 		case CTL_IO_SCSI: {
 			int isread;
-			struct ctl_lba_len lbalen;
+			struct ctl_lba_len *lbalen;
 
 			isread = 0;
 			switch (io->scsiio.cdb[0]) {
@@ -12772,12 +12770,12 @@ ctl_process_done(union ctl_io *io, int h
 			case WRITE_VERIFY_10:
 			case WRITE_VERIFY_12:
 			case WRITE_VERIFY_16:
-				memcpy(&lbalen, io->io_hdr.ctl_private[
-				       CTL_PRIV_LBA_LEN].bytes, sizeof(lbalen));
+				lbalen = (struct ctl_lba_len *)
+				    &io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
 
 				if (isread) {
 					lun->stats.ports[targ_port].bytes[CTL_STATS_READ] +=
-						lbalen.len * blocksize;
+					    lbalen->len * blocksize;
 					lun->stats.ports[targ_port].operations[CTL_STATS_READ]++;
 
 #ifdef CTL_TIME_IO
@@ -12807,7 +12805,7 @@ ctl_process_done(union ctl_io *io, int h
 #endif /* CTL_TIME_IO */
 				} else {
 					lun->stats.ports[targ_port].bytes[CTL_STATS_WRITE] +=
-						lbalen.len * blocksize;
+					    lbalen->len * blocksize;
 					lun->stats.ports[targ_port].operations[
 						CTL_STATS_WRITE]++;
 

Modified: head/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_block.c	Sun Jun 15 17:14:52 2014	(r267514)
+++ head/sys/cam/ctl/ctl_backend_block.c	Sun Jun 15 18:16:51 2014	(r267515)
@@ -786,7 +786,7 @@ ctl_be_block_unmap_dev(struct ctl_be_blo
 {
 	union ctl_io *io;
 	struct ctl_be_block_devdata *dev_data;
-	struct ctl_ptr_len_flags ptrlen;
+	struct ctl_ptr_len_flags *ptrlen;
 	struct scsi_unmap_desc *buf, *end;
 	uint64_t len;
 
@@ -800,10 +800,9 @@ ctl_be_block_unmap_dev(struct ctl_be_blo
 
 	if (beio->io_offset == -1) {
 		beio->io_len = 0;
-		memcpy(&ptrlen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes,
-		       sizeof(ptrlen));
-		buf = (struct scsi_unmap_desc *)ptrlen.ptr;
-		end = buf + ptrlen.len / sizeof(*buf);
+		ptrlen = (struct ctl_ptr_len_flags *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
+		buf = (struct scsi_unmap_desc *)ptrlen->ptr;
+		end = buf + ptrlen->len / sizeof(*buf);
 		for (; buf < end; buf++) {
 			len = (uint64_t)scsi_4btoul(buf->length) *
 			    be_lun->blocksize;
@@ -926,7 +925,7 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b
 {
 	struct ctl_be_block_io *beio;
 	struct ctl_be_block_softc *softc;
-	struct ctl_lba_len_flags lbalen;
+	struct ctl_lba_len_flags *lbalen;
 	uint64_t len_left, lba;
 	int i, seglen;
 	uint8_t *buf, *end;
@@ -935,11 +934,10 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b
 
 	beio = io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr;
 	softc = be_lun->softc;
-	memcpy(&lbalen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes,
-	       sizeof(lbalen));
+	lbalen = (struct ctl_lba_len_flags *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
 
-	if (lbalen.flags & ~(SWS_LBDATA | SWS_UNMAP) ||
-	    (lbalen.flags & SWS_UNMAP && be_lun->unmap == NULL)) {
+	if (lbalen->flags & ~(SWS_LBDATA | SWS_UNMAP) ||
+	    (lbalen->flags & SWS_UNMAP && be_lun->unmap == NULL)) {
 		ctl_free_beio(beio);
 		ctl_set_invalid_field(&io->scsiio,
 				      /*sks_valid*/ 1,
@@ -975,9 +973,9 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b
 		break;
 	}
 
-	if (lbalen.flags & SWS_UNMAP) {
-		beio->io_offset = lbalen.lba * be_lun->blocksize;
-		beio->io_len = (uint64_t)lbalen.len * be_lun->blocksize;
+	if (lbalen->flags & SWS_UNMAP) {
+		beio->io_offset = lbalen->lba * be_lun->blocksize;
+		beio->io_len = (uint64_t)lbalen->len * be_lun->blocksize;
 		beio->bio_cmd = BIO_DELETE;
 		beio->ds_trans_type = DEVSTAT_FREE;
 
@@ -989,9 +987,9 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b
 	beio->ds_trans_type = DEVSTAT_WRITE;
 
 	DPRINTF("WRITE SAME at LBA %jx len %u\n",
-	       (uintmax_t)lbalen.lba, lbalen.len);
+	       (uintmax_t)lbalen->lba, lbalen->len);
 
-	len_left = (uint64_t)lbalen.len * be_lun->blocksize;
+	len_left = (uint64_t)lbalen->len * be_lun->blocksize;
 	for (i = 0, lba = 0; i < CTLBLK_MAX_SEGS && len_left > 0; i++) {
 
 		/*
@@ -1012,21 +1010,19 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b
 		end = buf + seglen;
 		for (; buf < end; buf += be_lun->blocksize) {
 			memcpy(buf, io->scsiio.kern_data_ptr, be_lun->blocksize);
-			if (lbalen.flags & SWS_LBDATA)
-				scsi_ulto4b(lbalen.lba + lba, buf);
+			if (lbalen->flags & SWS_LBDATA)
+				scsi_ulto4b(lbalen->lba + lba, buf);
 			lba++;
 		}
 	}
 
-	beio->io_offset = lbalen.lba * be_lun->blocksize;
+	beio->io_offset = lbalen->lba * be_lun->blocksize;
 	beio->io_len = lba * be_lun->blocksize;
 
 	/* We can not do all in one run. Correct and schedule rerun. */
 	if (len_left > 0) {
-		lbalen.lba += lba;
-		lbalen.len -= lba;
-		memcpy(io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, &lbalen,
-		       sizeof(lbalen));
+		lbalen->lba += lba;
+		lbalen->len -= lba;
 		beio->beio_cont = ctl_be_block_cw_done_ws;
 	}
 
@@ -1039,16 +1035,15 @@ ctl_be_block_cw_dispatch_unmap(struct ct
 {
 	struct ctl_be_block_io *beio;
 	struct ctl_be_block_softc *softc;
-	struct ctl_ptr_len_flags ptrlen;
+	struct ctl_ptr_len_flags *ptrlen;
 
 	DPRINTF("entered\n");
 
 	beio = io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr;
 	softc = be_lun->softc;
-	memcpy(&ptrlen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes,
-	       sizeof(ptrlen));
+	ptrlen = (struct ctl_ptr_len_flags *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
 
-	if (ptrlen.flags != 0 || be_lun->unmap == NULL) {
+	if (ptrlen->flags != 0 || be_lun->unmap == NULL) {
 		ctl_free_beio(beio);
 		ctl_set_invalid_field(&io->scsiio,
 				      /*sks_valid*/ 0,
@@ -1090,8 +1085,7 @@ ctl_be_block_cw_dispatch_unmap(struct ct
 	beio->bio_cmd = BIO_DELETE;
 	beio->ds_trans_type = DEVSTAT_FREE;
 
-	DPRINTF("WRITE SAME at LBA %jx len %u\n",
-	       (uintmax_t)lbalen.lba, lbalen.len);
+	DPRINTF("UNMAP\n");
 
 	be_lun->unmap(be_lun, beio);
 }
@@ -1186,7 +1180,7 @@ ctl_be_block_dispatch(struct ctl_be_bloc
 {
 	struct ctl_be_block_io *beio;
 	struct ctl_be_block_softc *softc;
-	struct ctl_lba_len lbalen;
+	struct ctl_lba_len *lbalen;
 	uint64_t len_left, lbaoff;
 	int i;
 
@@ -1246,14 +1240,13 @@ ctl_be_block_dispatch(struct ctl_be_bloc
 		beio->ds_trans_type = DEVSTAT_WRITE;
 	}
 
-	memcpy(&lbalen, io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes,
-	       sizeof(lbalen));
+	lbalen = (struct ctl_lba_len *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
 	DPRINTF("%s at LBA %jx len %u @%ju\n",
 	       (beio->bio_cmd == BIO_READ) ? "READ" : "WRITE",
-	       (uintmax_t)lbalen.lba, lbalen.len, lbaoff);
+	       (uintmax_t)lbalen->lba, lbalen->len, lbaoff);
 	lbaoff = io->scsiio.kern_rel_offset / be_lun->blocksize;
-	beio->io_offset = (lbalen.lba + lbaoff) * be_lun->blocksize;
-	beio->io_len = MIN((lbalen.len - lbaoff) * be_lun->blocksize,
+	beio->io_offset = (lbalen->lba + lbaoff) * be_lun->blocksize;
+	beio->io_len = MIN((lbalen->len - lbaoff) * be_lun->blocksize,
 	    CTLBLK_MAX_IO_SIZE);
 	beio->io_len -= beio->io_len % be_lun->blocksize;
 

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 18:30:27 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 025096D3;
 Sun, 15 Jun 2014 18:30:27 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E3D9C251A;
 Sun, 15 Jun 2014 18:30:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5FIUQwn083467;
 Sun, 15 Jun 2014 18:30:26 GMT (envelope-from joel@svn.freebsd.org)
Received: (from joel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5FIUQgV083466;
 Sun, 15 Jun 2014 18:30:26 GMT (envelope-from joel@svn.freebsd.org)
Message-Id: <201406151830.s5FIUQgV083466@svn.freebsd.org>
From: Joel Dahl 
Date: Sun, 15 Jun 2014 18:30:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267516 - head/usr.sbin/ctladm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 18:30:27 -0000

Author: joel (doc committer)
Date: Sun Jun 15 18:30:26 2014
New Revision: 267516
URL: http://svnweb.freebsd.org/changeset/base/267516

Log:
  mdoc: add missing width to Bl -tag.

Modified:
  head/usr.sbin/ctladm/ctladm.8

Modified: head/usr.sbin/ctladm/ctladm.8
==============================================================================
--- head/usr.sbin/ctladm/ctladm.8	Sun Jun 15 18:16:51 2014	(r267515)
+++ head/usr.sbin/ctladm/ctladm.8	Sun Jun 15 18:30:26 2014	(r267516)
@@ -938,7 +938,7 @@ Number of additional configuration optio
 Some options are global, others are backend-specific.
 .Pp
 Global options:
-.Bl -tag
+.Bl -tag -width 12n
 .It Va vendor
 Specifies LUN vendor string up to 8 chars.
 .It Va product
@@ -950,7 +950,7 @@ Set to "on", enables UNMAP support for t
 .El
 .Pp
 Options specific for block backend:
-.Bl -tag
+.Bl -tag -width 12n
 .It Va file
 Specifies file or device name to use for backing store.
 .It Va num_threads

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 18:39:10 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D5C29AC9;
 Sun, 15 Jun 2014 18:39:10 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C2F2D25DC;
 Sun, 15 Jun 2014 18:39:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5FIdAYI087833;
 Sun, 15 Jun 2014 18:39:10 GMT (envelope-from joel@svn.freebsd.org)
Received: (from joel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5FIdAFJ087832;
 Sun, 15 Jun 2014 18:39:10 GMT (envelope-from joel@svn.freebsd.org)
Message-Id: <201406151839.s5FIdAFJ087832@svn.freebsd.org>
From: Joel Dahl 
Date: Sun, 15 Jun 2014 18:39:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267518 - head/share/man/man4
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 18:39:10 -0000

Author: joel (doc committer)
Date: Sun Jun 15 18:39:10 2014
New Revision: 267518
URL: http://svnweb.freebsd.org/changeset/base/267518

Log:
  Minor mdoc improvements.

Modified:
  head/share/man/man4/proto.4

Modified: head/share/man/man4/proto.4
==============================================================================
--- head/share/man/man4/proto.4	Sun Jun 15 18:32:02 2014	(r267517)
+++ head/share/man/man4/proto.4	Sun Jun 15 18:39:10 2014	(r267518)
@@ -76,6 +76,7 @@ with
 .Pa pci:::
 representing the location of the PCI device in the PCI hierarchy.
 A location includes:
+.Pp
 .Bl -tag -width XXXXXX -compact
 .It 
 The PCI domain number
@@ -101,11 +102,17 @@ representing I/O port or memory mapped I
 .Sh EXAMPLES
 A single function PCI device in domain 0, on bus 1, in slot 2 and having a
 single memory mapped I/O region will have the following device special files:
-.Bl -tag -compact
+.Pp
+.Bl -tag -width XXXXXX -compact
 .It Pa /dev/proto/pci0:1:2:0/10.mem
 .It Pa /dev/proto/pci0:1:2:0/pcicfg
 .El
-.\" 
+.\"
+.Sh AUTHORS
+The
+.Nm
+device driver and this manual page were written by
+.An Marcel Moolenaar Aq marcel@xcllnt.net .
 .Sh SECURITY CONSIDERATIONS
 Because programs have direct access to the hardware, the
 .Nm
@@ -126,9 +133,3 @@ The details of how a program can set up 
 initiate DMA still need to be fleshed out.
 .Pp
 Support for non-PCI devices has not been implemented yet.
-.\"
-.Sh AUTHORS
-The
-.Nm
-device driver and this manual page were written by
-.An Marcel Moolenaar Aq marcel@xcllnt.net .

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 15 20:14:12 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 79A80A99;
 Sun, 15 Jun 2014 20:14:12 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6680B2DB4;
 Sun, 15 Jun 2014 20:14:12 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5FKEC0A033029;
 Sun, 15 Jun 2014 20:14:12 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5FKEC3j033027;
 Sun, 15 Jun 2014 20:14:12 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406152014.s5FKEC3j033027@svn.freebsd.org>
From: Alexander Motin 
Date: Sun, 15 Jun 2014 20:14:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267519 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 15 Jun 2014 20:14:12 -0000

Author: mav
Date: Sun Jun 15 20:14:11 2014
New Revision: 267519
URL: http://svnweb.freebsd.org/changeset/base/267519

Log:
  Make backends track completion by processed number of sectors instead of
  total transfer size.
  
  Commands such as VERIFY or COMPARE AND WRITE may have transfer size not
  matching directly to number of sectors.

Modified:
  head/sys/cam/ctl/ctl_backend_block.c
  head/sys/cam/ctl/ctl_backend_ramdisk.c

Modified: head/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_block.c	Sun Jun 15 18:39:10 2014	(r267518)
+++ head/sys/cam/ctl/ctl_backend_block.c	Sun Jun 15 20:14:11 2014	(r267519)
@@ -103,6 +103,9 @@ __FBSDID("$FreeBSD$");
 #define DPRINTF(fmt, args...) do {} while(0)
 #endif
 
+#define PRIV(io)	\
+    ((struct ctl_ptr_len_flags *)&(io)->io_hdr.ctl_private[CTL_PRIV_BACKEND])
+
 SDT_PROVIDER_DEFINE(cbb);
 
 typedef enum {
@@ -356,9 +359,7 @@ ctl_be_block_move_done(union ctl_io *io)
 	struct bintime cur_bt;
 #endif  
 
-	beio = (struct ctl_be_block_io *)
-		io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr;
-
+	beio = (struct ctl_be_block_io *)PRIV(io)->ptr;
 	be_lun = beio->lun;
 
 	DPRINTF("entered\n");
@@ -932,7 +933,7 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b
 
 	DPRINTF("entered\n");
 
-	beio = io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr;
+	beio = (struct ctl_be_block_io *)PRIV(io)->ptr;
 	softc = be_lun->softc;
 	lbalen = (struct ctl_lba_len_flags *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
 
@@ -1039,7 +1040,7 @@ ctl_be_block_cw_dispatch_unmap(struct ct
 
 	DPRINTF("entered\n");
 
-	beio = io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr;
+	beio = (struct ctl_be_block_io *)PRIV(io)->ptr;
 	softc = be_lun->softc;
 	ptrlen = (struct ctl_ptr_len_flags *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
 
@@ -1114,7 +1115,7 @@ ctl_be_block_cw_dispatch(struct ctl_be_b
 	beio->io = io;
 	beio->lun = be_lun;
 	beio->beio_cont = ctl_be_block_cw_done;
-	io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr = beio;
+	PRIV(io)->ptr = (void *)beio;
 
 	switch (io->scsiio.cdb[0]) {
 	case SYNCHRONIZE_CACHE:
@@ -1181,7 +1182,8 @@ ctl_be_block_dispatch(struct ctl_be_bloc
 	struct ctl_be_block_io *beio;
 	struct ctl_be_block_softc *softc;
 	struct ctl_lba_len *lbalen;
-	uint64_t len_left, lbaoff;
+	struct ctl_ptr_len_flags *bptrlen;
+	uint64_t len_left, lbas;
 	int i;
 
 	softc = be_lun->softc;
@@ -1197,7 +1199,8 @@ ctl_be_block_dispatch(struct ctl_be_bloc
 	beio = ctl_alloc_beio(softc);
 	beio->io = io;
 	beio->lun = be_lun;
-	io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr = beio;
+	bptrlen = PRIV(io);
+	bptrlen->ptr = (void *)beio;
 
 	/*
 	 * If the I/O came down with an ordered or head of queue tag, set
@@ -1243,12 +1246,12 @@ ctl_be_block_dispatch(struct ctl_be_bloc
 	lbalen = (struct ctl_lba_len *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
 	DPRINTF("%s at LBA %jx len %u @%ju\n",
 	       (beio->bio_cmd == BIO_READ) ? "READ" : "WRITE",
-	       (uintmax_t)lbalen->lba, lbalen->len, lbaoff);
-	lbaoff = io->scsiio.kern_rel_offset / be_lun->blocksize;
-	beio->io_offset = (lbalen->lba + lbaoff) * be_lun->blocksize;
-	beio->io_len = MIN((lbalen->len - lbaoff) * be_lun->blocksize,
-	    CTLBLK_MAX_IO_SIZE);
-	beio->io_len -= beio->io_len % be_lun->blocksize;
+	       (uintmax_t)lbalen->lba, lbalen->len, bptrlen->len);
+	lbas = MIN(lbalen->len - bptrlen->len,
+	    CTLBLK_MAX_IO_SIZE / be_lun->blocksize);
+	beio->io_offset = (lbalen->lba + bptrlen->len) * be_lun->blocksize;
+	beio->io_len = lbas * be_lun->blocksize;
+	bptrlen->len += lbas;
 
 	for (i = 0, len_left = beio->io_len; len_left > 0; i++) {
 		KASSERT(i < CTLBLK_MAX_SEGS, ("Too many segs (%d >= %d)",
@@ -1266,8 +1269,7 @@ ctl_be_block_dispatch(struct ctl_be_bloc
 		beio->num_segs++;
 		len_left -= beio->sg_segs[i].len;
 	}
-	if (io->scsiio.kern_rel_offset + beio->io_len <
-	    io->scsiio.kern_total_len)
+	if (bptrlen->len < lbalen->len)
 		beio->beio_cont = ctl_be_block_next;
 	io->scsiio.be_move_done = ctl_be_block_move_done;
 	io->scsiio.kern_data_ptr = (uint8_t *)beio->sg_segs;
@@ -1318,8 +1320,7 @@ ctl_be_block_worker(void *context, int p
 
 			mtx_unlock(&be_lun->lock);
 
-			beio = (struct ctl_be_block_io *)
-			    io->io_hdr.ctl_private[CTL_PRIV_BACKEND].ptr;
+			beio = (struct ctl_be_block_io *)PRIV(io)->ptr;
 
 			be_lun->dispatch(be_lun, beio);
 
@@ -1391,6 +1392,8 @@ ctl_be_block_submit(union ctl_io *io)
 	KASSERT(io->io_hdr.io_type == CTL_IO_SCSI, ("Non-SCSI I/O (type "
 		"%#x) encountered", io->io_hdr.io_type));
 
+	PRIV(io)->len = 0;
+
 	mtx_lock(&be_lun->lock);
 	/*
 	 * XXX KDM make sure that links is okay to use at this point.

Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_ramdisk.c	Sun Jun 15 18:39:10 2014	(r267518)
+++ head/sys/cam/ctl/ctl_backend_ramdisk.c	Sun Jun 15 20:14:11 2014	(r267519)
@@ -241,7 +241,7 @@ ctl_backend_ramdisk_move_done(union ctl_
 	if ((io->io_hdr.port_status == 0)
 	 && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0)
 	 && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) {
-		if (io->scsiio.kern_rel_offset < io->scsiio.kern_total_len) {
+		if (io->io_hdr.ctl_private[CTL_PRIV_BACKEND].integer > 0) {
 			mtx_lock(&be_lun->lock);
 			STAILQ_INSERT_TAIL(&be_lun->cont_queue,
 			    &io->io_hdr, links);
@@ -274,7 +274,14 @@ ctl_backend_ramdisk_move_done(union ctl_
 static int
 ctl_backend_ramdisk_submit(union ctl_io *io)
 {
+	struct ctl_be_lun *ctl_be_lun;
+	struct ctl_lba_len *lbalen;
 
+	ctl_be_lun = (struct ctl_be_lun *)io->io_hdr.ctl_private[
+		CTL_PRIV_BACKEND_LUN].ptr;
+	lbalen = (struct ctl_lba_len *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
+	io->io_hdr.ctl_private[CTL_PRIV_BACKEND].integer =
+	    lbalen->len * ctl_be_lun->blocksize;
 	ctl_backend_ramdisk_continue(io);
 	return (CTL_RETVAL_COMPLETE);
 }
@@ -290,7 +297,7 @@ ctl_backend_ramdisk_continue(union ctl_i
 #endif
 
 	softc = &rd_softc;
-	len = io->scsiio.kern_total_len - io->scsiio.kern_rel_offset;
+	len = io->io_hdr.ctl_private[CTL_PRIV_BACKEND].integer;
 #ifdef CTL_RAMDISK_PAGES
 	sg_filled = min(btoc(len), softc->num_pages);
 	if (sg_filled > 1) {
@@ -321,6 +328,7 @@ ctl_backend_ramdisk_continue(union ctl_i
 	io->scsiio.kern_data_len = len_filled;
 	io->scsiio.kern_sg_entries = sg_filled;
 	io->io_hdr.flags |= CTL_FLAG_ALLOCATED;
+	io->io_hdr.ctl_private[CTL_PRIV_BACKEND].integer -= len_filled;
 #ifdef CTL_TIME_IO
 	getbintime(&io->io_hdr.dma_start_bt);
 #endif

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 04:12:33 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id DFFEEFFA;
 Mon, 16 Jun 2014 04:12:33 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CDD6B219E;
 Mon, 16 Jun 2014 04:12:33 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5G4CXcc051089;
 Mon, 16 Jun 2014 04:12:33 GMT (envelope-from bryanv@svn.freebsd.org)
Received: (from bryanv@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5G4CXLp051086;
 Mon, 16 Jun 2014 04:12:33 GMT (envelope-from bryanv@svn.freebsd.org)
Message-Id: <201406160412.s5G4CXLp051086@svn.freebsd.org>
From: Bryan Venteicher 
Date: Mon, 16 Jun 2014 04:12:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267520 - head/sys/dev/virtio/network
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 04:12:34 -0000

Author: bryanv
Date: Mon Jun 16 04:12:33 2014
New Revision: 267520
URL: http://svnweb.freebsd.org/changeset/base/267520

Log:
    - Remove two write-only local variables
    - Remove unused element in the vtnet_rxq structure
  
  MFC after:	1 week

Modified:
  head/sys/dev/virtio/network/if_vtnet.c
  head/sys/dev/virtio/network/if_vtnetvar.h

Modified: head/sys/dev/virtio/network/if_vtnet.c
==============================================================================
--- head/sys/dev/virtio/network/if_vtnet.c	Sun Jun 15 20:14:11 2014	(r267519)
+++ head/sys/dev/virtio/network/if_vtnet.c	Mon Jun 16 04:12:33 2014	(r267520)
@@ -2113,13 +2113,11 @@ fail:
 static int
 vtnet_txq_encap(struct vtnet_txq *txq, struct mbuf **m_head)
 {
-	struct vtnet_softc *sc;
 	struct vtnet_tx_header *txhdr;
 	struct virtio_net_hdr *hdr;
 	struct mbuf *m;
 	int error;
 
-	sc = txq->vtntx_sc;
 	m = *m_head;
 	M_ASSERTPKTHDR(m);
 
@@ -2946,11 +2944,9 @@ vtnet_set_active_vq_pairs(struct vtnet_s
 static int
 vtnet_reinit(struct vtnet_softc *sc)
 {
-	device_t dev;
 	struct ifnet *ifp;
 	int error;
 
-	dev = sc->vtnet_dev;
 	ifp = sc->vtnet_ifp;
 
 	/* Use the current MAC address. */

Modified: head/sys/dev/virtio/network/if_vtnetvar.h
==============================================================================
--- head/sys/dev/virtio/network/if_vtnetvar.h	Sun Jun 15 20:14:11 2014	(r267519)
+++ head/sys/dev/virtio/network/if_vtnetvar.h	Mon Jun 16 04:12:33 2014	(r267520)
@@ -74,7 +74,6 @@ struct vtnet_rxq {
 	struct virtqueue	*vtnrx_vq;
 	struct sglist		*vtnrx_sg;
 	int			 vtnrx_id;
-	int			 vtnrx_process_limit;
 	struct vtnet_rxq_stats	 vtnrx_stats;
 	struct taskqueue	*vtnrx_tq;
 	struct task		 vtnrx_intrtask;

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 04:16:31 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D72781EC;
 Mon, 16 Jun 2014 04:16:31 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C4A8B21B8;
 Mon, 16 Jun 2014 04:16:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5G4GVGT051667;
 Mon, 16 Jun 2014 04:16:31 GMT (envelope-from bryanv@svn.freebsd.org)
Received: (from bryanv@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5G4GV0n051664;
 Mon, 16 Jun 2014 04:16:31 GMT (envelope-from bryanv@svn.freebsd.org)
Message-Id: <201406160416.s5G4GV0n051664@svn.freebsd.org>
From: Bryan Venteicher 
Date: Mon, 16 Jun 2014 04:16:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267521 - head/sys/dev/virtio/pci
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 04:16:31 -0000

Author: bryanv
Date: Mon Jun 16 04:16:31 2014
New Revision: 267521
URL: http://svnweb.freebsd.org/changeset/base/267521

Log:
  Remove kernel specific macro out of the VirtIO PCI header file
  
  The eventual goal is to share this file with userland, so
  remove the macro that is only specific for virtio_pci(4).
  Instead, add the VIRTIO_PCI_CONFIG_OFF macro from Linux to
  get the config size whether MSIX is enabled or not.
  
  MFC after:	1 week

Modified:
  head/sys/dev/virtio/pci/virtio_pci.c
  head/sys/dev/virtio/pci/virtio_pci.h

Modified: head/sys/dev/virtio/pci/virtio_pci.c
==============================================================================
--- head/sys/dev/virtio/pci/virtio_pci.c	Mon Jun 16 04:12:33 2014	(r267520)
+++ head/sys/dev/virtio/pci/virtio_pci.c	Mon Jun 16 04:16:31 2014	(r267521)
@@ -170,6 +170,9 @@ static void	vtpci_config_intr(void *);
 
 #define vtpci_setup_msi_interrupt vtpci_setup_legacy_interrupt
 
+#define VIRTIO_PCI_CONFIG(_sc) \
+    VIRTIO_PCI_CONFIG_OFF((((_sc)->vtpci_flags & VTPCI_FLAG_MSIX)) != 0)
+
 /*
  * I/O port read/write wrappers.
  */

Modified: head/sys/dev/virtio/pci/virtio_pci.h
==============================================================================
--- head/sys/dev/virtio/pci/virtio_pci.h	Mon Jun 16 04:12:33 2014	(r267520)
+++ head/sys/dev/virtio/pci/virtio_pci.h	Mon Jun 16 04:16:31 2014	(r267521)
@@ -72,8 +72,7 @@
  * The remaining space is defined by each driver as the per-driver
  * configuration space.
  */
-#define VIRTIO_PCI_CONFIG(sc) \
-    (((sc)->vtpci_flags & VTPCI_FLAG_MSIX) ? 24 : 20)
+#define VIRTIO_PCI_CONFIG_OFF(msix_enabled)     ((msix_enabled) ? 24 : 20)
 
 /*
  * How many bits to shift physical queue address written to QUEUE_PFN.

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 04:25:06 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5B8BE37A;
 Mon, 16 Jun 2014 04:25:06 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 48E362257;
 Mon, 16 Jun 2014 04:25:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5G4P6Ko055886;
 Mon, 16 Jun 2014 04:25:06 GMT (envelope-from bryanv@svn.freebsd.org)
Received: (from bryanv@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5G4P5nR055880;
 Mon, 16 Jun 2014 04:25:05 GMT (envelope-from bryanv@svn.freebsd.org)
Message-Id: <201406160425.s5G4P5nR055880@svn.freebsd.org>
From: Bryan Venteicher 
Date: Mon, 16 Jun 2014 04:25:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267522 - in head/sys/dev/virtio: . pci
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 04:25:06 -0000

Author: bryanv
Date: Mon Jun 16 04:25:04 2014
New Revision: 267522
URL: http://svnweb.freebsd.org/changeset/base/267522

Log:
  Move the VIRTIO_RING_F_* defines out of virtqueue.h into virtio_config.h
  
  These defines are applicable to userland too, but virtqueue.h contains
  the kernel virtqueue interface, and is therefore not usable in userland.
  
  Note that Linux places these defines in virtio_ring.h, but I don't want
  the drivers including this header file to keep the VirtIO ring opaque to
  everything but the virtqueue.
  
  MFC after:	1 week

Modified:
  head/sys/dev/virtio/pci/virtio_pci.c
  head/sys/dev/virtio/virtio.h
  head/sys/dev/virtio/virtio_config.h
  head/sys/dev/virtio/virtqueue.c
  head/sys/dev/virtio/virtqueue.h

Modified: head/sys/dev/virtio/pci/virtio_pci.c
==============================================================================
--- head/sys/dev/virtio/pci/virtio_pci.c	Mon Jun 16 04:16:31 2014	(r267521)
+++ head/sys/dev/virtio/pci/virtio_pci.c	Mon Jun 16 04:25:04 2014	(r267522)
@@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
 #include 
 #include 
 

Modified: head/sys/dev/virtio/virtio.h
==============================================================================
--- head/sys/dev/virtio/virtio.h	Mon Jun 16 04:16:31 2014	(r267521)
+++ head/sys/dev/virtio/virtio.h	Mon Jun 16 04:25:04 2014	(r267522)
@@ -30,6 +30,7 @@
 #define _VIRTIO_H_
 
 #include 
+#include 
 
 struct vq_alloc_info;
 

Modified: head/sys/dev/virtio/virtio_config.h
==============================================================================
--- head/sys/dev/virtio/virtio_config.h	Mon Jun 16 04:16:31 2014	(r267521)
+++ head/sys/dev/virtio/virtio_config.h	Mon Jun 16 04:25:04 2014	(r267522)
@@ -44,6 +44,12 @@
  */
 #define VIRTIO_F_NOTIFY_ON_EMPTY (1 << 24)
 
+/* Support for indirect buffer descriptors. */
+#define VIRTIO_RING_F_INDIRECT_DESC	(1 << 28)
+
+/* Support to suppress interrupt until specific index is reached. */
+#define VIRTIO_RING_F_EVENT_IDX		(1 << 29)
+
 /*
  * The guest should never negotiate this feature; it
  * is used to detect faulty drivers.

Modified: head/sys/dev/virtio/virtqueue.c
==============================================================================
--- head/sys/dev/virtio/virtqueue.c	Mon Jun 16 04:16:31 2014	(r267521)
+++ head/sys/dev/virtio/virtqueue.c	Mon Jun 16 04:25:04 2014	(r267522)
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
 #include 
 #include 
 

Modified: head/sys/dev/virtio/virtqueue.h
==============================================================================
--- head/sys/dev/virtio/virtqueue.h	Mon Jun 16 04:16:31 2014	(r267521)
+++ head/sys/dev/virtio/virtqueue.h	Mon Jun 16 04:25:04 2014	(r267522)
@@ -32,12 +32,6 @@
 struct virtqueue;
 struct sglist;
 
-/* Support for indirect buffer descriptors. */
-#define VIRTIO_RING_F_INDIRECT_DESC	(1 << 28)
-
-/* Support to suppress interrupt until specific index is reached. */
-#define VIRTIO_RING_F_EVENT_IDX		(1 << 29)
-
 /* Device callback for a virtqueue interrupt. */
 typedef void virtqueue_intr_t(void *);
 

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 04:29:28 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E9ABB4F1;
 Mon, 16 Jun 2014 04:29:28 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BD1712289;
 Mon, 16 Jun 2014 04:29:28 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5G4TScm056432;
 Mon, 16 Jun 2014 04:29:28 GMT (envelope-from bryanv@svn.freebsd.org)
Received: (from bryanv@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5G4TSJj056431;
 Mon, 16 Jun 2014 04:29:28 GMT (envelope-from bryanv@svn.freebsd.org)
Message-Id: <201406160429.s5G4TSJj056431@svn.freebsd.org>
From: Bryan Venteicher 
Date: Mon, 16 Jun 2014 04:29:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267523 - head/sys/dev/virtio/network
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 04:29:29 -0000

Author: bryanv
Date: Mon Jun 16 04:29:28 2014
New Revision: 267523
URL: http://svnweb.freebsd.org/changeset/base/267523

Log:
  Make the feature negotiation code easier to follow
  
  MFC after:	1 week

Modified:
  head/sys/dev/virtio/network/if_vtnet.c

Modified: head/sys/dev/virtio/network/if_vtnet.c
==============================================================================
--- head/sys/dev/virtio/network/if_vtnet.c	Mon Jun 16 04:25:04 2014	(r267522)
+++ head/sys/dev/virtio/network/if_vtnet.c	Mon Jun 16 04:29:28 2014	(r267523)
@@ -552,37 +552,38 @@ vtnet_negotiate_features(struct vtnet_so
 		mask |= VTNET_TSO_FEATURES;
 	if (vtnet_tunable_int(sc, "lro_disable", vtnet_lro_disable))
 		mask |= VTNET_LRO_FEATURES;
+#ifndef VTNET_LEGACY_TX
 	if (vtnet_tunable_int(sc, "mq_disable", vtnet_mq_disable))
 		mask |= VIRTIO_NET_F_MQ;
-#ifdef VTNET_LEGACY_TX
+#else
 	mask |= VIRTIO_NET_F_MQ;
 #endif
 
 	features = VTNET_FEATURES & ~mask;
 	sc->vtnet_features = virtio_negotiate_features(dev, features);
 
-	if (virtio_with_feature(dev, VTNET_LRO_FEATURES) == 0)
-		return;
-	if (virtio_with_feature(dev, VIRTIO_NET_F_MRG_RXBUF))
-		return;
-
-	/*
-	 * LRO without mergeable buffers requires special care. This is not
-	 * ideal because every receive buffer must be large enough to hold
-	 * the maximum TCP packet, the Ethernet header, and the header. This
-	 * requires up to 34 descriptors with MCLBYTES clusters. If we do
-	 * not have indirect descriptors, LRO is disabled since the virtqueue
-	 * will not contain very many receive buffers.
-	 */
-	if (virtio_with_feature(dev, VIRTIO_RING_F_INDIRECT_DESC) == 0) {
-		device_printf(dev,
-		    "LRO disabled due to both mergeable buffers and indirect "
-		    "descriptors not negotiated\n");
+	if (virtio_with_feature(dev, VTNET_LRO_FEATURES) &&
+	    virtio_with_feature(dev, VIRTIO_NET_F_MRG_RXBUF) == 0) {
+		/*
+		 * LRO without mergeable buffers requires special care. This
+		 * is not ideal because every receive buffer must be large
+		 * enough to hold the maximum TCP packet, the Ethernet header,
+		 * and the header. This requires up to 34 descriptors with
+		 * MCLBYTES clusters. If we do not have indirect descriptors,
+		 * LRO is disabled since the virtqueue will not contain very
+		 * many receive buffers.
+		 */
+		if (!virtio_with_feature(dev, VIRTIO_RING_F_INDIRECT_DESC)) {
+			device_printf(dev,
+			    "LRO disabled due to both mergeable buffers and "
+			    "indirect descriptors not negotiated\n");
 
-		features &= ~VTNET_LRO_FEATURES;
-		sc->vtnet_features = virtio_negotiate_features(dev, features);
-	} else
-		sc->vtnet_flags |= VTNET_FLAG_LRO_NOMRG;
+			features &= ~VTNET_LRO_FEATURES;
+			sc->vtnet_features =
+			    virtio_negotiate_features(dev, features);
+		} else
+			sc->vtnet_flags |= VTNET_FLAG_LRO_NOMRG;
+	}
 }
 
 static void

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 04:32:28 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3FC52665;
 Mon, 16 Jun 2014 04:32:28 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1361B231F;
 Mon, 16 Jun 2014 04:32:28 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5G4WR0H059997;
 Mon, 16 Jun 2014 04:32:27 GMT (envelope-from bryanv@svn.freebsd.org)
Received: (from bryanv@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5G4WRkR059996;
 Mon, 16 Jun 2014 04:32:27 GMT (envelope-from bryanv@svn.freebsd.org)
Message-Id: <201406160432.s5G4WRkR059996@svn.freebsd.org>
From: Bryan Venteicher 
Date: Mon, 16 Jun 2014 04:32:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267524 - head/sys/dev/virtio/network
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 04:32:28 -0000

Author: bryanv
Date: Mon Jun 16 04:32:27 2014
New Revision: 267524
URL: http://svnweb.freebsd.org/changeset/base/267524

Log:
  Force two byte alignment for all control message headers
  
  The header structure consists of two 1-byte elements, but it must always
  be describable by a single SG entry. Note for consistency, specify the
  alignment everywhere, even if the structure has the appropriate natural
  alignment since it contains a uint16_t.
  
  Obtained from:	DragonFlyBSD
  MFC after:	1 week

Modified:
  head/sys/dev/virtio/network/if_vtnet.c

Modified: head/sys/dev/virtio/network/if_vtnet.c
==============================================================================
--- head/sys/dev/virtio/network/if_vtnet.c	Mon Jun 16 04:29:28 2014	(r267523)
+++ head/sys/dev/virtio/network/if_vtnet.c	Mon Jun 16 04:32:27 2014	(r267524)
@@ -3068,7 +3068,7 @@ vtnet_exec_ctrl_cmd(struct vtnet_softc *
 static int
 vtnet_ctrl_mac_cmd(struct vtnet_softc *sc, uint8_t *hwaddr)
 {
-	struct virtio_net_ctrl_hdr hdr;
+	struct virtio_net_ctrl_hdr hdr __aligned(2);
 	struct sglist_seg segs[3];
 	struct sglist sg;
 	uint8_t ack;
@@ -3102,7 +3102,7 @@ vtnet_ctrl_mq_cmd(struct vtnet_softc *sc
 		struct virtio_net_ctrl_mq mq;
 		uint8_t pad2;
 		uint8_t ack;
-	} s;
+	} s __aligned(2);
 	int error;
 
 	s.hdr.class = VIRTIO_NET_CTRL_MQ;
@@ -3134,7 +3134,7 @@ vtnet_ctrl_rx_cmd(struct vtnet_softc *sc
 		uint8_t onoff;
 		uint8_t pad2;
 		uint8_t ack;
-	} s;
+	} s __aligned(2);
 	int error;
 
 	KASSERT(sc->vtnet_flags & VTNET_FLAG_CTRL_RX,
@@ -3217,7 +3217,7 @@ vtnet_rx_filter(struct vtnet_softc *sc)
 static void
 vtnet_rx_filter_mac(struct vtnet_softc *sc)
 {
-	struct virtio_net_ctrl_hdr hdr;
+	struct virtio_net_ctrl_hdr hdr __aligned(2);
 	struct vtnet_mac_filter *filter;
 	struct sglist_seg segs[4];
 	struct sglist sg;
@@ -3330,7 +3330,7 @@ vtnet_exec_vlan_filter(struct vtnet_soft
 		uint16_t tag;
 		uint8_t pad2;
 		uint8_t ack;
-	} s;
+	} s __aligned(2);
 	int error;
 
 	s.hdr.class = VIRTIO_NET_CTRL_VLAN;

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 07:28:57 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2B0CE698;
 Mon, 16 Jun 2014 07:28:57 +0000 (UTC)
Received: from mail-n.franken.de (drew.ipv6.franken.de
 [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id A94EE2039;
 Mon, 16 Jun 2014 07:28:56 +0000 (UTC)
Received: from [10.225.7.42] (unknown [194.95.73.101])
 (Authenticated sender: macmic)
 by mail-n.franken.de (Postfix) with ESMTP id 388B81C104E82;
 Mon, 16 Jun 2014 09:28:54 +0200 (CEST)
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r266083 - in head/sys/arm: arm include
From: Michael Tuexen 
In-Reply-To: <3841D090-5973-40B0-B61C-F15E8C1978C9@FreeBSD.org>
Date: Mon, 16 Jun 2014 09:28:53 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <3664DBD3-7CEA-43E8-9757-E835BB21FE9E@freebsd.org>
References: <201405141911.s4EJBFZZ097826@svn.freebsd.org>
 <537D0952.2040001@selasky.org>
 <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org>
 <53871493.2010502@selasky.org>
 
 <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de>
 
 
 
 <9B438991-C970-46A7-8116-A490E02D7139@fh-muenster.de>
 <3841D090-5973-40B0-B61C-F15E8C1978C9@FreeBSD.org>
To: Mark R V Murray 
X-Mailer: Apple Mail (2.1878.2)
Cc: Hans Petter Selasky , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 07:28:57 -0000

On 15 Jun 2014, at 17:13, Mark R V Murray  wrote:

>=20
> On 30 May 2014, at 09:42, Michael Tuexen  =
wrote:
>=20
>> On 29 May 2014, at 21:21, Mark R V Murray  wrote:
>>=20
>>>=20
>>> On 29 May 2014, at 19:27, Michael Tuexen  =
wrote:
>>>=20
>>>> On 29 May 2014, at 20:15, Mark R V Murray  =
wrote:
>>>>=20
>>>>>=20
>>>>> On 29 May 2014, at 19:13, Michael Tuexen  =
wrote:
>>>>>=20
>>>>>>> I can make it work on RPI, but trying to find what else it =
will/won=92t work on is more problematic.
>>>>>> Wouldn't it require to use different registers on the RPI? This =
would mean you
>>>>>> would need more #ifdefs=85
>>>>>=20
>>>>> Thats the problem; too many #ifdefs.
>>>> So you could just keep the code for now, but reduce the #ifdefs to =
the ones you
>>>> know that work. Later on, you can replace it by the driver stuff=85
>>>=20
>>> That=92s what I was thinking, yes.
>> Great. Let me know if you need testing support on the RPI=85
>=20
> I=92ve come to the conclusion that my RPI-B is hosed. It doesn=92t =
even boot Raspian properly. Sorry about how long this has taken.
>=20
> Please could someone with a working RPI please check that the =
following patch works (may need to apply by hand due to cut/paste).
Hi Mark,

your patch for accessing the value is correct. However, the =
initialisation code also
needs to be adopted to the platform. So in addition to your patch, you =
also need:

Index: arm/cpufunc.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- arm/cpufunc.c	(revision 267519)
+++ arm/cpufunc.c	(working copy)
@@ -1415,6 +1415,12 @@
 			:
 			: "r"(0x00000001));
 #endif
+#if defined(CPU_ARM1136) || defined(CPU_ARM1176)
+	/* Set PMCR[2,0] to enable counters and reset CCNT */
+	__asm volatile ("mcr	p15, 0, %0, c15, c12, 0\n\t"
+			:
+			: "r"(0x00000005));
+#else
         /* Set up the PMCCNTR register as a cyclecounter:
 	 * Set PMINTENCLR to 0xFFFFFFFF to block interrupts
 	 * Set PMCR[2,0] to enable counters and reset CCNT
@@ -1426,6 +1432,7 @@
 			: "r"(0xFFFFFFFF),
 			  "r"(0x00000005),
 			  "r"(0x80000000));
+#endif
 }
 #endif
=20
With both patches, the RPI boots up fine with r267519

Is there an easy test to see if the code actually works as expected and =
not that it just
allows the system to boot?
Regarding the 32-bit limitation: Do we want to increment the register =
only every
64 clock cycle?

Best regards
Michael
>=20
> Thanks, with repeated apologies.
>=20
> M
> --=20
> Mark R V Murray
>=20
> --- include/cpu.h	(revision 267507)
> +++ include/cpu.h	(working copy)
> @@ -25,7 +25,16 @@
> 	 * Read PMCCNTR. Curses! Its only 32 bits.
> 	 * TODO: Fix this by catching overflow with interrupt?
> 	 */
> +/* The ARMv6 vs ARMv7 divide is going to need a better way of
> + * distinguishing between them.
> + */
> +#if defined(CPU_ARM1136) || defined(CPU_ARM1176)
> +	/* ARMv6 - Earlier model SCCs */
> +	__asm __volatile("mrc p15, 0, %0, c15, c12, 1": "=3Dr" (ccnt));
> +#else
> +	/* ARMv7 - Later model SCCs */
> 	__asm __volatile("mrc p15, 0, %0, c9, c13, 0": "=3Dr" (ccnt));
> +#endif
> 	ccnt64 =3D (uint64_t)ccnt;
> 	return (ccnt64);
> #else /* No performance counters, so use binuptime(9). This is =
slooooow */
>=20
>=20


From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 08:41:58 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 470FFC93;
 Mon, 16 Jun 2014 08:41:58 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 19CF62722;
 Mon, 16 Jun 2014 08:41:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5G8fvdt073693;
 Mon, 16 Jun 2014 08:41:57 GMT (envelope-from royger@svn.freebsd.org)
Received: (from royger@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5G8fv7G073692;
 Mon, 16 Jun 2014 08:41:57 GMT (envelope-from royger@svn.freebsd.org)
Message-Id: <201406160841.s5G8fv7G073692@svn.freebsd.org>
From: Roger Pau Monné 
Date: Mon, 16 Jun 2014 08:41:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267525 - head/sys/x86/xen
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 08:41:58 -0000

Author: royger
Date: Mon Jun 16 08:41:57 2014
New Revision: 267525
URL: http://svnweb.freebsd.org/changeset/base/267525

Log:
  xen: fix style in pv.c
  
  Fix the lenght of some comments, and also add proper indentation to
  xen_init_ops
  
  Sponsored by: Citrix Systems R&D
  Approved by: gibbs

Modified:
  head/sys/x86/xen/pv.c

Modified: head/sys/x86/xen/pv.c
==============================================================================
--- head/sys/x86/xen/pv.c	Mon Jun 16 04:32:27 2014	(r267524)
+++ head/sys/x86/xen/pv.c	Mon Jun 16 08:41:57 2014	(r267525)
@@ -93,12 +93,12 @@ extern char *bootSTK;
 /*-------------------------------- Global Data -------------------------------*/
 /* Xen init_ops implementation. */
 struct init_ops xen_init_ops = {
-	.parse_preload_data =	xen_pv_parse_preload_data,
-	.early_clock_source_init =	xen_clock_init,
-	.early_delay =			xen_delay,
-	.parse_memmap =			xen_pv_parse_memmap,
+	.parse_preload_data		= xen_pv_parse_preload_data,
+	.early_clock_source_init	= xen_clock_init,
+	.early_delay			= xen_delay,
+	.parse_memmap			= xen_pv_parse_memmap,
 #ifdef SMP
-	.start_all_aps =		xen_pv_start_all_aps,
+	.start_all_aps			= xen_pv_start_all_aps,
 #endif
 };
 
@@ -155,15 +155,24 @@ hammer_time_xen(start_info_t *si, uint64
 	 * by the boot trampoline).
 	 */
 	for (i = 0; i < (PAGE_SIZE / sizeof(uint64_t)); i++) {
-		/* Each slot of the level 4 pages points to the same level 3 page */
+		/*
+		 * Each slot of the level 4 pages points
+		 * to the same level 3 page
+		 */
 		PT4[i] = ((uint64_t)&PT3[0]) - KERNBASE;
 		PT4[i] |= PG_V | PG_RW | PG_U;
 
-		/* Each slot of the level 3 pages points to the same level 2 page */
+		/*
+		 * Each slot of the level 3 pages points
+		 * to the same level 2 page
+		 */
 		PT3[i] = ((uint64_t)&PT2[0]) - KERNBASE;
 		PT3[i] |= PG_V | PG_RW | PG_U;
 
-		/* The level 2 page slots are mapped with 2MB pages for 1GB. */
+		/*
+		 * The level 2 page slots are mapped with
+		 * 2MB pages for 1GB.
+		 */
 		PT2[i] = i * (2 * 1024 * 1024);
 		PT2[i] |= PG_V | PG_RW | PG_PS | PG_U;
 	}

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 08:43:04 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id DE0B8DE4;
 Mon, 16 Jun 2014 08:43:04 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C85A12729;
 Mon, 16 Jun 2014 08:43:04 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5G8h4nq073942;
 Mon, 16 Jun 2014 08:43:04 GMT (envelope-from royger@svn.freebsd.org)
Received: (from royger@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5G8h3mk073933;
 Mon, 16 Jun 2014 08:43:03 GMT (envelope-from royger@svn.freebsd.org)
Message-Id: <201406160843.s5G8h3mk073933@svn.freebsd.org>
From: Roger Pau Monné 
Date: Mon, 16 Jun 2014 08:43:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267526 - in head/sys: amd64/amd64 amd64/include
 i386/i386 i386/include x86/include x86/x86 x86/xen
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 08:43:05 -0000

Author: royger
Date: Mon Jun 16 08:43:03 2014
New Revision: 267526
URL: http://svnweb.freebsd.org/changeset/base/267526

Log:
  amd64/i386: introduce APIC hooks for different APIC implementations.
  
  This is needed for Xen PV(H) guests, since there's no hardware lapic
  available on this kind of domains. This commit should not change
  functionality.
  
  Sponsored by: Citrix Systems R&D
  Reviewed by: jhb
  Approved by: gibbs
  
  amd64/include/cpu.h:
  amd64/amd64/mp_machdep.c:
  i386/include/cpu.h:
  i386/i386/mp_machdep.c:
   - Remove lapic_ipi_vectored hook from cpu_ops, since it's now
     implemented in the lapic hooks.
  
  amd64/amd64/mp_machdep.c:
  i386/i386/mp_machdep.c:
   - Use lapic_ipi_vectored directly, since it's now an inline function
     that will call the appropiate hook.
  
  x86/x86/local_apic.c:
   - Prefix bare metal public lapic functions with native_ and mark them
     as static.
   - Define default implementation of apic_ops.
  
  x86/include/apicvar.h:
   - Declare the apic_ops structure and create inline functions to
     access the hooks, so the change is transparent to existing users of
     the lapic_ functions.
  
  x86/xen/hvm.c:
   - Switch to use the new apic_ops.

Modified:
  head/sys/amd64/amd64/mp_machdep.c
  head/sys/amd64/include/cpu.h
  head/sys/i386/i386/mp_machdep.c
  head/sys/i386/include/cpu.h
  head/sys/x86/include/apicvar.h
  head/sys/x86/x86/local_apic.c
  head/sys/x86/xen/hvm.c

Modified: head/sys/amd64/amd64/mp_machdep.c
==============================================================================
--- head/sys/amd64/amd64/mp_machdep.c	Mon Jun 16 08:41:57 2014	(r267525)
+++ head/sys/amd64/amd64/mp_machdep.c	Mon Jun 16 08:43:03 2014	(r267526)
@@ -125,9 +125,7 @@ static u_long *ipi_hardclock_counts[MAXC
 #endif
 
 /* Default cpu_ops implementation. */
-struct cpu_ops cpu_ops = {
-	.ipi_vectored = lapic_ipi_vectored
-};
+struct cpu_ops cpu_ops;
 
 extern inthand_t IDTVEC(fast_syscall), IDTVEC(fast_syscall32);
 
@@ -1125,7 +1123,7 @@ ipi_send_cpu(int cpu, u_int ipi)
 		if (old_pending)
 			return;
 	}
-	cpu_ops.ipi_vectored(ipi, cpu_apic_ids[cpu]);
+	lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]);
 }
 
 /*
@@ -1395,7 +1393,7 @@ ipi_all_but_self(u_int ipi)
 		CPU_OR_ATOMIC(&ipi_nmi_pending, &other_cpus);
 
 	CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi);
-	cpu_ops.ipi_vectored(ipi, APIC_IPI_DEST_OTHERS);
+	lapic_ipi_vectored(ipi, APIC_IPI_DEST_OTHERS);
 }
 
 int

Modified: head/sys/amd64/include/cpu.h
==============================================================================
--- head/sys/amd64/include/cpu.h	Mon Jun 16 08:41:57 2014	(r267525)
+++ head/sys/amd64/include/cpu.h	Mon Jun 16 08:43:03 2014	(r267526)
@@ -63,7 +63,6 @@
 struct cpu_ops {
 	void (*cpu_init)(void);
 	void (*cpu_resume)(void);
-	void (*ipi_vectored)(u_int, int);
 };
 
 extern struct	cpu_ops cpu_ops;

Modified: head/sys/i386/i386/mp_machdep.c
==============================================================================
--- head/sys/i386/i386/mp_machdep.c	Mon Jun 16 08:41:57 2014	(r267525)
+++ head/sys/i386/i386/mp_machdep.c	Mon Jun 16 08:43:03 2014	(r267526)
@@ -168,9 +168,7 @@ static u_long *ipi_hardclock_counts[MAXC
 #endif
 
 /* Default cpu_ops implementation. */
-struct cpu_ops cpu_ops = {
-	.ipi_vectored = lapic_ipi_vectored
-};
+struct cpu_ops cpu_ops;
 
 /*
  * Local data and functions.
@@ -1208,7 +1206,7 @@ ipi_send_cpu(int cpu, u_int ipi)
 		if (old_pending)
 			return;
 	}
-	cpu_ops.ipi_vectored(ipi, cpu_apic_ids[cpu]);
+	lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]);
 }
 
 /*
@@ -1459,7 +1457,7 @@ ipi_all_but_self(u_int ipi)
 		CPU_OR_ATOMIC(&ipi_nmi_pending, &other_cpus);
 
 	CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi);
-	cpu_ops.ipi_vectored(ipi, APIC_IPI_DEST_OTHERS);
+	lapic_ipi_vectored(ipi, APIC_IPI_DEST_OTHERS);
 }
 
 int

Modified: head/sys/i386/include/cpu.h
==============================================================================
--- head/sys/i386/include/cpu.h	Mon Jun 16 08:41:57 2014	(r267525)
+++ head/sys/i386/include/cpu.h	Mon Jun 16 08:43:03 2014	(r267526)
@@ -63,7 +63,6 @@
 struct cpu_ops {
 	void (*cpu_init)(void);
 	void (*cpu_resume)(void);
-	void (*ipi_vectored)(u_int, int);
 };
 
 extern struct	cpu_ops cpu_ops;

Modified: head/sys/x86/include/apicvar.h
==============================================================================
--- head/sys/x86/include/apicvar.h	Mon Jun 16 08:41:57 2014	(r267525)
+++ head/sys/x86/include/apicvar.h	Mon Jun 16 08:43:03 2014	(r267526)
@@ -168,15 +168,7 @@ inthand_t
 extern vm_paddr_t lapic_paddr;
 extern int apic_cpuids[];
 
-u_int	apic_alloc_vector(u_int apic_id, u_int irq);
-u_int	apic_alloc_vectors(u_int apic_id, u_int *irqs, u_int count,
-	    u_int align);
-void	apic_disable_vector(u_int apic_id, u_int vector);
-void	apic_enable_vector(u_int apic_id, u_int vector);
-void	apic_free_vector(u_int apic_id, u_int vector, u_int irq);
-u_int	apic_idt_to_irq(u_int apic_id, u_int vector);
 void	apic_register_enumerator(struct apic_enumerator *enumerator);
-u_int	apic_cpuid(u_int apic_id);
 void	*ioapic_create(vm_paddr_t addr, int32_t apic_id, int intbase);
 int	ioapic_disable_pin(void *cookie, u_int pin);
 int	ioapic_get_vector(void *cookie, u_int pin);
@@ -189,33 +181,240 @@ int	ioapic_set_polarity(void *cookie, u_
 int	ioapic_set_triggermode(void *cookie, u_int pin,
 	    enum intr_trigger trigger);
 int	ioapic_set_smi(void *cookie, u_int pin);
-void	lapic_create(u_int apic_id, int boot_cpu);
-void	lapic_disable(void);
-void	lapic_disable_pmc(void);
-void	lapic_dump(const char *str);
-void	lapic_enable_cmc(void);
-int	lapic_enable_pmc(void);
-void	lapic_eoi(void);
-int	lapic_id(void);
-void	lapic_init(vm_paddr_t addr);
-int	lapic_intr_pending(u_int vector);
-void	lapic_ipi_raw(register_t icrlo, u_int dest);
-void	lapic_ipi_vectored(u_int vector, int dest);
-int	lapic_ipi_wait(int delay);
+
+/*
+ * Struct containing pointers to APIC functions whose
+ * implementation is run time selectable.
+ */
+struct apic_ops {
+	void	(*create)(u_int, int);
+	void	(*init)(vm_paddr_t);
+	void	(*setup)(int);
+	void	(*dump)(const char *);
+	void	(*disable)(void);
+	void	(*eoi)(void);
+	int	(*id)(void);
+	int	(*intr_pending)(u_int);
+	void	(*set_logical_id)(u_int, u_int, u_int);
+	u_int	(*cpuid)(u_int);
+
+	/* Vectors */
+	u_int	(*alloc_vector)(u_int, u_int);
+	u_int	(*alloc_vectors)(u_int, u_int *, u_int, u_int);
+	void	(*enable_vector)(u_int, u_int);
+	void	(*disable_vector)(u_int, u_int);
+	void	(*free_vector)(u_int, u_int, u_int);
+
+
+	/* PMC */
+	int	(*enable_pmc)(void);
+	void	(*disable_pmc)(void);
+	void	(*reenable_pmc)(void);
+
+	/* CMC */
+	void	(*enable_cmc)(void);
+
+	/* IPI */
+	void	(*ipi_raw)(register_t, u_int);
+	void	(*ipi_vectored)(u_int, int);
+	int	(*ipi_wait)(int);
+
+	/* LVT */
+	int	(*set_lvt_mask)(u_int, u_int, u_char);
+	int	(*set_lvt_mode)(u_int, u_int, u_int32_t);
+	int	(*set_lvt_polarity)(u_int, u_int, enum intr_polarity);
+	int	(*set_lvt_triggermode)(u_int, u_int, enum intr_trigger);
+};
+
+extern struct apic_ops apic_ops;
+
+static inline void
+lapic_create(u_int apic_id, int boot_cpu)
+{
+
+	apic_ops.create(apic_id, boot_cpu);
+}
+
+static inline void
+lapic_init(vm_paddr_t addr)
+{
+
+	apic_ops.init(addr);
+}
+
+static inline void
+lapic_setup(int boot)
+{
+
+	apic_ops.setup(boot);
+}
+
+static inline void
+lapic_dump(const char *str)
+{
+
+	apic_ops.dump(str);
+}
+
+static inline void
+lapic_disable(void)
+{
+
+	apic_ops.disable();
+}
+
+static inline void
+lapic_eoi(void)
+{
+
+	apic_ops.eoi();
+}
+
+static inline int
+lapic_id(void)
+{
+
+	return (apic_ops.id());
+}
+
+static inline int
+lapic_intr_pending(u_int vector)
+{
+
+	return (apic_ops.intr_pending(vector));
+}
+
+/* XXX: UNUSED */
+static inline void
+lapic_set_logical_id(u_int apic_id, u_int cluster, u_int cluster_id)
+{
+
+	apic_ops.set_logical_id(apic_id, cluster, cluster_id);
+}
+
+static inline u_int
+apic_cpuid(u_int apic_id)
+{
+
+	return (apic_ops.cpuid(apic_id));
+}
+
+static inline u_int
+apic_alloc_vector(u_int apic_id, u_int irq)
+{
+
+	return (apic_ops.alloc_vector(apic_id, irq));
+}
+
+static inline u_int
+apic_alloc_vectors(u_int apic_id, u_int *irqs, u_int count, u_int align)
+{
+
+	return (apic_ops.alloc_vectors(apic_id, irqs, count, align));
+}
+
+static inline void
+apic_enable_vector(u_int apic_id, u_int vector)
+{
+
+	apic_ops.enable_vector(apic_id, vector);
+}
+
+static inline void
+apic_disable_vector(u_int apic_id, u_int vector)
+{
+
+	apic_ops.disable_vector(apic_id, vector);
+}
+
+static inline void
+apic_free_vector(u_int apic_id, u_int vector, u_int irq)
+{
+
+	apic_ops.free_vector(apic_id, vector, irq);
+}
+
+static inline int
+lapic_enable_pmc(void)
+{
+
+	return (apic_ops.enable_pmc());
+}
+
+static inline void
+lapic_disable_pmc(void)
+{
+
+	apic_ops.disable_pmc();
+}
+
+static inline void
+lapic_reenable_pmc(void)
+{
+
+	apic_ops.reenable_pmc();
+}
+
+static inline void
+lapic_enable_cmc(void)
+{
+
+	apic_ops.enable_cmc();
+}
+
+static inline void
+lapic_ipi_raw(register_t icrlo, u_int dest)
+{
+
+	apic_ops.ipi_raw(icrlo, dest);
+}
+
+static inline void
+lapic_ipi_vectored(u_int vector, int dest)
+{
+
+	apic_ops.ipi_vectored(vector, dest);
+}
+
+static inline int
+lapic_ipi_wait(int delay)
+{
+
+	return (apic_ops.ipi_wait(delay));
+}
+
+static inline int
+lapic_set_lvt_mask(u_int apic_id, u_int lvt, u_char masked)
+{
+
+	return (apic_ops.set_lvt_mask(apic_id, lvt, masked));
+}
+
+static inline int
+lapic_set_lvt_mode(u_int apic_id, u_int lvt, u_int32_t mode)
+{
+
+	return (apic_ops.set_lvt_mode(apic_id, lvt, mode));
+}
+
+static inline int
+lapic_set_lvt_polarity(u_int apic_id, u_int lvt, enum intr_polarity pol)
+{
+
+	return (apic_ops.set_lvt_polarity(apic_id, lvt, pol));
+}
+
+static inline int
+lapic_set_lvt_triggermode(u_int apic_id, u_int lvt, enum intr_trigger trigger)
+{
+
+	return (apic_ops.set_lvt_triggermode(apic_id, lvt, trigger));
+}
+
 void	lapic_handle_cmc(void);
 void	lapic_handle_error(void);
 void	lapic_handle_intr(int vector, struct trapframe *frame);
 void	lapic_handle_timer(struct trapframe *frame);
-void	lapic_reenable_pmc(void);
-void	lapic_set_logical_id(u_int apic_id, u_int cluster, u_int cluster_id);
-int	lapic_set_lvt_mask(u_int apic_id, u_int lvt, u_char masked);
-int	lapic_set_lvt_mode(u_int apic_id, u_int lvt, u_int32_t mode);
-int	lapic_set_lvt_polarity(u_int apic_id, u_int lvt,
-	    enum intr_polarity pol);
-int	lapic_set_lvt_triggermode(u_int apic_id, u_int lvt,
-	    enum intr_trigger trigger);
-void	lapic_set_tpr(u_int vector);
-void	lapic_setup(int boot);
 void	xen_intr_handle_upcall(struct trapframe *frame);
 
 #endif /* !LOCORE */

Modified: head/sys/x86/x86/local_apic.c
==============================================================================
--- head/sys/x86/x86/local_apic.c	Mon Jun 16 08:41:57 2014	(r267525)
+++ head/sys/x86/x86/local_apic.c	Mon Jun 16 08:43:03 2014	(r267526)
@@ -169,11 +169,76 @@ static void	lapic_timer_stop(struct lapi
 static void	lapic_timer_set_divisor(u_int divisor);
 static uint32_t	lvt_mode(struct lapic *la, u_int pin, uint32_t value);
 static int	lapic_et_start(struct eventtimer *et,
-    sbintime_t first, sbintime_t period);
+		    sbintime_t first, sbintime_t period);
 static int	lapic_et_stop(struct eventtimer *et);
+static u_int	apic_idt_to_irq(u_int apic_id, u_int vector);
+static void	lapic_set_tpr(u_int vector);
 
 struct pic lapic_pic = { .pic_resume = lapic_resume };
 
+/* Forward declarations for apic_ops */
+static void	native_lapic_create(u_int apic_id, int boot_cpu);
+static void	native_lapic_init(vm_paddr_t addr);
+static void	native_lapic_setup(int boot);
+static void	native_lapic_dump(const char *str);
+static void	native_lapic_disable(void);
+static void	native_lapic_eoi(void);
+static int	native_lapic_id(void);
+static int	native_lapic_intr_pending(u_int vector);
+static u_int	native_apic_cpuid(u_int apic_id);
+static u_int	native_apic_alloc_vector(u_int apic_id, u_int irq);
+static u_int	native_apic_alloc_vectors(u_int apic_id, u_int *irqs,
+		    u_int count, u_int align);
+static void 	native_apic_disable_vector(u_int apic_id, u_int vector);
+static void 	native_apic_enable_vector(u_int apic_id, u_int vector);
+static void 	native_apic_free_vector(u_int apic_id, u_int vector, u_int irq);
+static void 	native_lapic_set_logical_id(u_int apic_id, u_int cluster,
+		    u_int cluster_id);
+static int 	native_lapic_enable_pmc(void);
+static void 	native_lapic_disable_pmc(void);
+static void 	native_lapic_reenable_pmc(void);
+static void 	native_lapic_enable_cmc(void);
+static void 	native_lapic_ipi_raw(register_t icrlo, u_int dest);
+static void 	native_lapic_ipi_vectored(u_int vector, int dest);
+static int 	native_lapic_ipi_wait(int delay);
+static int 	native_lapic_set_lvt_mask(u_int apic_id, u_int lvt,
+		    u_char masked);
+static int 	native_lapic_set_lvt_mode(u_int apic_id, u_int lvt,
+		    uint32_t mode);
+static int 	native_lapic_set_lvt_polarity(u_int apic_id, u_int lvt,
+		    enum intr_polarity pol);
+static int 	native_lapic_set_lvt_triggermode(u_int apic_id, u_int lvt,
+		    enum intr_trigger trigger);
+
+struct apic_ops apic_ops = {
+	.create			= native_lapic_create,
+	.init			= native_lapic_init,
+	.setup			= native_lapic_setup,
+	.dump			= native_lapic_dump,
+	.disable		= native_lapic_disable,
+	.eoi			= native_lapic_eoi,
+	.id			= native_lapic_id,
+	.intr_pending		= native_lapic_intr_pending,
+	.set_logical_id		= native_lapic_set_logical_id,
+	.cpuid			= native_apic_cpuid,
+	.alloc_vector		= native_apic_alloc_vector,
+	.alloc_vectors		= native_apic_alloc_vectors,
+	.enable_vector		= native_apic_enable_vector,
+	.disable_vector		= native_apic_disable_vector,
+	.free_vector		= native_apic_free_vector,
+	.enable_pmc		= native_lapic_enable_pmc,
+	.disable_pmc		= native_lapic_disable_pmc,
+	.reenable_pmc		= native_lapic_reenable_pmc,
+	.enable_cmc		= native_lapic_enable_cmc,
+	.ipi_raw		= native_lapic_ipi_raw,
+	.ipi_vectored		= native_lapic_ipi_vectored,
+	.ipi_wait		= native_lapic_ipi_wait,
+	.set_lvt_mask		= native_lapic_set_lvt_mask,
+	.set_lvt_mode		= native_lapic_set_lvt_mode,
+	.set_lvt_polarity	= native_lapic_set_lvt_polarity,
+	.set_lvt_triggermode	= native_lapic_set_lvt_triggermode,
+};
+
 static uint32_t
 lvt_mode(struct lapic *la, u_int pin, uint32_t value)
 {
@@ -218,8 +283,8 @@ lvt_mode(struct lapic *la, u_int pin, ui
 /*
  * Map the local APIC and setup necessary interrupt vectors.
  */
-void
-lapic_init(vm_paddr_t addr)
+static void
+native_lapic_init(vm_paddr_t addr)
 {
 	u_int regs[4];
 	int i, arat;
@@ -280,8 +345,8 @@ lapic_init(vm_paddr_t addr)
 /*
  * Create a local APIC instance.
  */
-void
-lapic_create(u_int apic_id, int boot_cpu)
+static void
+native_lapic_create(u_int apic_id, int boot_cpu)
 {
 	int i;
 
@@ -326,8 +391,8 @@ lapic_create(u_int apic_id, int boot_cpu
 /*
  * Dump contents of local APIC registers
  */
-void
-lapic_dump(const char* str)
+static void
+native_lapic_dump(const char* str)
 {
 	uint32_t maxlvt;
 
@@ -346,8 +411,8 @@ lapic_dump(const char* str)
 		printf("   cmci: 0x%08x\n", lapic->lvt_cmci);
 }
 
-void
-lapic_setup(int boot)
+static void
+native_lapic_setup(int boot)
 {
 	struct lapic *la;
 	u_int32_t maxlvt;
@@ -405,8 +470,8 @@ lapic_setup(int boot)
 	intr_restore(saveintr);
 }
 
-void
-lapic_reenable_pmc(void)
+static void
+native_lapic_reenable_pmc(void)
 {
 #ifdef HWPMC_HOOKS
 	uint32_t value;
@@ -428,8 +493,8 @@ lapic_update_pmc(void *dummy)
 }
 #endif
 
-int
-lapic_enable_pmc(void)
+static int
+native_lapic_enable_pmc(void)
 {
 #ifdef HWPMC_HOOKS
 	u_int32_t maxlvt;
@@ -462,8 +527,8 @@ lapic_enable_pmc(void)
 #endif
 }
 
-void
-lapic_disable_pmc(void)
+static void
+native_lapic_disable_pmc(void)
 {
 #ifdef HWPMC_HOOKS
 	u_int32_t maxlvt;
@@ -540,8 +605,8 @@ lapic_et_stop(struct eventtimer *et)
 	return (0);
 }
 
-void
-lapic_disable(void)
+static void
+native_lapic_disable(void)
 {
 	uint32_t value;
 
@@ -571,16 +636,16 @@ lapic_resume(struct pic *pic, bool suspe
 	lapic_setup(0);
 }
 
-int
-lapic_id(void)
+static int
+native_lapic_id(void)
 {
 
 	KASSERT(lapic != NULL, ("local APIC is not mapped"));
 	return (lapic->id >> APIC_ID_SHIFT);
 }
 
-int
-lapic_intr_pending(u_int vector)
+static int
+native_lapic_intr_pending(u_int vector)
 {
 	volatile u_int32_t *irr;
 
@@ -597,8 +662,8 @@ lapic_intr_pending(u_int vector)
 	return (irr[(vector / 32) * 4] & 1 << (vector % 32));
 }
 
-void
-lapic_set_logical_id(u_int apic_id, u_int cluster, u_int cluster_id)
+static void
+native_lapic_set_logical_id(u_int apic_id, u_int cluster, u_int cluster_id)
 {
 	struct lapic *la;
 
@@ -613,8 +678,8 @@ lapic_set_logical_id(u_int apic_id, u_in
 	la->la_cluster_id = cluster_id;
 }
 
-int
-lapic_set_lvt_mask(u_int apic_id, u_int pin, u_char masked)
+static int
+native_lapic_set_lvt_mask(u_int apic_id, u_int pin, u_char masked)
 {
 
 	if (pin > APIC_LVT_MAX)
@@ -636,8 +701,8 @@ lapic_set_lvt_mask(u_int apic_id, u_int 
 	return (0);
 }
 
-int
-lapic_set_lvt_mode(u_int apic_id, u_int pin, u_int32_t mode)
+static int
+native_lapic_set_lvt_mode(u_int apic_id, u_int pin, u_int32_t mode)
 {
 	struct lvt *lvt;
 
@@ -692,8 +757,8 @@ lapic_set_lvt_mode(u_int apic_id, u_int 
 	return (0);
 }
 
-int
-lapic_set_lvt_polarity(u_int apic_id, u_int pin, enum intr_polarity pol)
+static int
+native_lapic_set_lvt_polarity(u_int apic_id, u_int pin, enum intr_polarity pol)
 {
 
 	if (pin > APIC_LVT_MAX || pol == INTR_POLARITY_CONFORM)
@@ -717,8 +782,9 @@ lapic_set_lvt_polarity(u_int apic_id, u_
 	return (0);
 }
 
-int
-lapic_set_lvt_triggermode(u_int apic_id, u_int pin, enum intr_trigger trigger)
+static int
+native_lapic_set_lvt_triggermode(u_int apic_id, u_int pin,
+     enum intr_trigger trigger)
 {
 
 	if (pin > APIC_LVT_MAX || trigger == INTR_TRIGGER_CONFORM)
@@ -746,7 +812,7 @@ lapic_set_lvt_triggermode(u_int apic_id,
  * Adjust the TPR of the current CPU so that it blocks all interrupts below
  * the passed in vector.
  */
-void
+static void
 lapic_set_tpr(u_int vector)
 {
 #ifdef CHEAP_TPR
@@ -760,8 +826,8 @@ lapic_set_tpr(u_int vector)
 #endif
 }
 
-void
-lapic_eoi(void)
+static void
+native_lapic_eoi(void)
 {
 
 	lapic->eoi = 0;
@@ -882,8 +948,8 @@ lapic_handle_cmc(void)
  * is called prior to lapic_setup() during boot, this just needs to unmask
  * this CPU's LVT_CMCI entry.
  */
-void
-lapic_enable_cmc(void)
+static void
+native_lapic_enable_cmc(void)
 {
 	u_int apic_id;
 
@@ -918,8 +984,8 @@ lapic_handle_error(void)
 	lapic_eoi();
 }
 
-u_int
-apic_cpuid(u_int apic_id)
+static u_int
+native_apic_cpuid(u_int apic_id)
 {
 #ifdef SMP
 	return apic_cpuids[apic_id];
@@ -929,8 +995,8 @@ apic_cpuid(u_int apic_id)
 }
 
 /* Request a free IDT vector to be used by the specified IRQ. */
-u_int
-apic_alloc_vector(u_int apic_id, u_int irq)
+static u_int
+native_apic_alloc_vector(u_int apic_id, u_int irq)
 {
 	u_int vector;
 
@@ -958,8 +1024,8 @@ apic_alloc_vector(u_int apic_id, u_int i
  * aligned on a boundary of 'align'.  If the request cannot be
  * satisfied, 0 is returned.
  */
-u_int
-apic_alloc_vectors(u_int apic_id, u_int *irqs, u_int count, u_int align)
+static u_int
+native_apic_alloc_vectors(u_int apic_id, u_int *irqs, u_int count, u_int align)
 {
 	u_int first, run, vector;
 
@@ -1018,8 +1084,8 @@ apic_alloc_vectors(u_int apic_id, u_int 
  * which do not have the vector configured would report spurious interrupts
  * should it fire.
  */
-void
-apic_enable_vector(u_int apic_id, u_int vector)
+static void
+native_apic_enable_vector(u_int apic_id, u_int vector)
 {
 
 	KASSERT(vector != IDT_SYSCALL, ("Attempt to overwrite syscall entry"));
@@ -1033,8 +1099,8 @@ apic_enable_vector(u_int apic_id, u_int 
 	    GSEL_APIC);
 }
 
-void
-apic_disable_vector(u_int apic_id, u_int vector)
+static void
+native_apic_disable_vector(u_int apic_id, u_int vector)
 {
 
 	KASSERT(vector != IDT_SYSCALL, ("Attempt to overwrite syscall entry"));
@@ -1054,8 +1120,8 @@ apic_disable_vector(u_int apic_id, u_int
 }
 
 /* Release an APIC vector when it's no longer in use. */
-void
-apic_free_vector(u_int apic_id, u_int vector, u_int irq)
+static void
+native_apic_free_vector(u_int apic_id, u_int vector, u_int irq)
 {
 	struct thread *td;
 
@@ -1093,7 +1159,7 @@ apic_free_vector(u_int apic_id, u_int ve
 }
 
 /* Map an IDT vector (APIC) to an IRQ (interrupt source). */
-u_int
+static u_int
 apic_idt_to_irq(u_int apic_id, u_int vector)
 {
 	int irq;
@@ -1389,8 +1455,8 @@ SYSINIT(apic_setup_io, SI_SUB_INTR, SI_O
  * private to the MD code.  The public interface for the rest of the
  * kernel is defined in mp_machdep.c.
  */
-int
-lapic_ipi_wait(int delay)
+static int
+native_lapic_ipi_wait(int delay)
 {
 	int x, incr;
 
@@ -1412,8 +1478,8 @@ lapic_ipi_wait(int delay)
 	return (0);
 }
 
-void
-lapic_ipi_raw(register_t icrlo, u_int dest)
+static void
+native_lapic_ipi_raw(register_t icrlo, u_int dest)
 {
 	register_t value, saveintr;
 
@@ -1446,8 +1512,8 @@ lapic_ipi_raw(register_t icrlo, u_int de
 #define	AFTER_SPIN	1000
 #endif
 
-void
-lapic_ipi_vectored(u_int vector, int dest)
+static void
+native_lapic_ipi_vectored(u_int vector, int dest)
 {
 	register_t icrlo, destfield;
 

Modified: head/sys/x86/xen/hvm.c
==============================================================================
--- head/sys/x86/xen/hvm.c	Mon Jun 16 08:41:57 2014	(r267525)
+++ head/sys/x86/xen/hvm.c	Mon Jun 16 08:43:03 2014	(r267526)
@@ -108,7 +108,6 @@ enum xen_domain_type xen_domain_type = X
 
 #ifdef SMP
 struct cpu_ops xen_hvm_cpu_ops = {
-	.ipi_vectored	= lapic_ipi_vectored,
 	.cpu_init	= xen_hvm_cpu_init,
 	.cpu_resume	= xen_hvm_cpu_resume
 };
@@ -365,7 +364,7 @@ xen_setup_cpus(void)
 		xen_cpu_ipi_init(i);
 
 	/* Set the xen pv ipi ops to replace the native ones */
-	cpu_ops.ipi_vectored = xen_ipi_vectored;
+	apic_ops.ipi_vectored = xen_ipi_vectored;
 }
 #endif
 

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 08:43:47 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3C1CCF35;
 Mon, 16 Jun 2014 08:43:47 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1C6612730;
 Mon, 16 Jun 2014 08:43:47 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5G8hkAq074069;
 Mon, 16 Jun 2014 08:43:46 GMT (envelope-from royger@svn.freebsd.org)
Received: (from royger@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5G8hkDl074065;
 Mon, 16 Jun 2014 08:43:46 GMT (envelope-from royger@svn.freebsd.org)
Message-Id: <201406160843.s5G8hkDl074065@svn.freebsd.org>
From: Roger Pau Monné 
Date: Mon, 16 Jun 2014 08:43:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267527 - in head/sys: conf x86/xen
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 08:43:47 -0000

Author: royger
Date: Mon Jun 16 08:43:45 2014
New Revision: 267527
URL: http://svnweb.freebsd.org/changeset/base/267527

Log:
  xen: add hooks for Xen PV APIC
  
  Create the necessary hooks in order to provide a Xen PV APIC
  implementation that can be used on PVH. Most of the lapic ops
  shouldn't be called on Xen, since we trap those operations at a higher
  layer.
  
  Sponsored by: Citrix Systems R&D
  Approved by: gibbs
  
  x86/xen/hvm.c:
  x86/xen/xen_apic.c:
   - Move IPI related code to xen_apic.c
  
  x86/xen/xen_apic.c:
   - Introduce Xen PV APIC implementation, most of the functions of the
     lapic interface should never be called when running as PV(H) guest,
     so make sure FreeBSD panics when trying to use one of those.
   - Define the Xen APIC implementation in xen_apic_ops.
  
  xen/xen_pv.h:
   - Extern declaration of the xen_apic struct.
  
  x86/xen/pv.c:
   - Use xen_apic_ops as apic_ops when running as PVH guest.
  
  conf/files.amd64:
  conf/files.i386:
   - Include the xen_apic.c file in the build of i386/amd64 kernels
     using XENHVM.

Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/x86/xen/hvm.c
  head/sys/x86/xen/pv.c

Modified: head/sys/conf/files.amd64
==============================================================================
--- head/sys/conf/files.amd64	Mon Jun 16 08:43:03 2014	(r267526)
+++ head/sys/conf/files.amd64	Mon Jun 16 08:43:45 2014	(r267527)
@@ -557,3 +557,4 @@ x86/xen/hvm.c			optional	xenhvm
 x86/xen/xen_intr.c		optional	xen | xenhvm
 x86/xen/pv.c			optional	xenhvm
 x86/xen/pvcpu_enum.c		optional	xenhvm
+x86/xen/xen_apic.c		optional	xenhvm

Modified: head/sys/conf/files.i386
==============================================================================
--- head/sys/conf/files.i386	Mon Jun 16 08:43:03 2014	(r267526)
+++ head/sys/conf/files.i386	Mon Jun 16 08:43:45 2014	(r267527)
@@ -594,3 +594,4 @@ x86/x86/tsc.c			standard
 x86/x86/delay.c			standard
 x86/xen/hvm.c			optional xenhvm
 x86/xen/xen_intr.c		optional xen | xenhvm
+x86/xen/xen_apic.c		optional xenhvm

Modified: head/sys/x86/xen/hvm.c
==============================================================================
--- head/sys/x86/xen/hvm.c	Mon Jun 16 08:43:03 2014	(r267526)
+++ head/sys/x86/xen/hvm.c	Mon Jun 16 08:43:45 2014	(r267527)
@@ -59,37 +59,14 @@ __FBSDID("$FreeBSD$");
 
 /*--------------------------- Forward Declarations ---------------------------*/
 #ifdef SMP
-static driver_filter_t xen_smp_rendezvous_action;
-static driver_filter_t xen_invltlb;
-static driver_filter_t xen_invlpg;
-static driver_filter_t xen_invlrng;
-static driver_filter_t xen_invlcache;
-#ifdef __i386__
-static driver_filter_t xen_lazypmap;
-#endif
-static driver_filter_t xen_ipi_bitmap_handler;
-static driver_filter_t xen_cpustop_handler;
-static driver_filter_t xen_cpususpend_handler;
-static driver_filter_t xen_cpustophard_handler;
-static void xen_ipi_vectored(u_int vector, int dest);
 static void xen_hvm_cpu_resume(void);
 #endif
 static void xen_hvm_cpu_init(void);
 
 /*---------------------------- Extern Declarations ---------------------------*/
-#ifdef __i386__
-extern void pmap_lazyfix_action(void);
-#endif
-#ifdef __amd64__
-extern int pmap_pcid_enabled;
-#endif
-
 /* Variables used by mp_machdep to perform the bitmap IPI */
 extern volatile u_int cpu_ipi_pending[MAXCPU];
 
-/*---------------------------------- Macros ----------------------------------*/
-#define	IPI_TO_IDX(ipi) ((ipi) - APIC_IPI_INTS)
-
 /*-------------------------------- Local Types -------------------------------*/
 enum xen_hvm_init_type {
 	XEN_HVM_INIT_COLD,
@@ -97,12 +74,6 @@ enum xen_hvm_init_type {
 	XEN_HVM_INIT_RESUME
 };
 
-struct xen_ipi_handler
-{
-	driver_filter_t	*filter;
-	const char	*description;
-};
-
 /*-------------------------------- Global Data -------------------------------*/
 enum xen_domain_type xen_domain_type = XEN_NATIVE;
 
@@ -115,24 +86,6 @@ struct cpu_ops xen_hvm_cpu_ops = {
 
 static MALLOC_DEFINE(M_XENHVM, "xen_hvm", "Xen HVM PV Support");
 
-#ifdef SMP
-static struct xen_ipi_handler xen_ipis[] = 
-{
-	[IPI_TO_IDX(IPI_RENDEZVOUS)]	= { xen_smp_rendezvous_action,	"r"   },
-	[IPI_TO_IDX(IPI_INVLTLB)]	= { xen_invltlb,		"itlb"},
-	[IPI_TO_IDX(IPI_INVLPG)]	= { xen_invlpg,			"ipg" },
-	[IPI_TO_IDX(IPI_INVLRNG)]	= { xen_invlrng,		"irg" },
-	[IPI_TO_IDX(IPI_INVLCACHE)]	= { xen_invlcache,		"ic"  },
-#ifdef __i386__
-	[IPI_TO_IDX(IPI_LAZYPMAP)]	= { xen_lazypmap,		"lp"  },
-#endif
-	[IPI_TO_IDX(IPI_BITMAP_VECTOR)] = { xen_ipi_bitmap_handler,	"b"   },
-	[IPI_TO_IDX(IPI_STOP)]		= { xen_cpustop_handler,	"st"  },
-	[IPI_TO_IDX(IPI_SUSPEND)]	= { xen_cpususpend_handler,	"sp"  },
-	[IPI_TO_IDX(IPI_STOP_HARD)]	= { xen_cpustophard_handler,	"sth" },
-};
-#endif
-
 /**
  * If non-zero, the hypervisor has been configured to use a direct
  * IDT event callback for interrupt injection.
@@ -142,9 +95,6 @@ int xen_vector_callback_enabled;
 /*------------------------------- Per-CPU Data -------------------------------*/
 DPCPU_DEFINE(struct vcpu_info, vcpu_local_info);
 DPCPU_DEFINE(struct vcpu_info *, vcpu_info);
-#ifdef SMP
-DPCPU_DEFINE(xen_intr_handle_t, ipi_handle[nitems(xen_ipis)]);
-#endif
 
 /*------------------ Hypervisor Access Shared Memory Regions -----------------*/
 /** Hypercall table accessed via HYPERVISOR_*_op() methods. */
@@ -153,156 +103,6 @@ shared_info_t *HYPERVISOR_shared_info;
 start_info_t *HYPERVISOR_start_info;
 
 #ifdef SMP
-/*---------------------------- XEN PV IPI Handlers ---------------------------*/
-/*
- * This are C clones of the ASM functions found in apic_vector.s
- */
-static int
-xen_ipi_bitmap_handler(void *arg)
-{
-	struct trapframe *frame;
-
-	frame = arg;
-	ipi_bitmap_handler(*frame);
-	return (FILTER_HANDLED);
-}
-
-static int
-xen_smp_rendezvous_action(void *arg)
-{
-#ifdef COUNT_IPIS
-	(*ipi_rendezvous_counts[PCPU_GET(cpuid)])++;
-#endif /* COUNT_IPIS */
-
-	smp_rendezvous_action();
-	return (FILTER_HANDLED);
-}
-
-static int
-xen_invltlb(void *arg)
-{
-
-	invltlb_handler();
-	return (FILTER_HANDLED);
-}
-
-#ifdef __amd64__
-static int
-xen_invltlb_pcid(void *arg)
-{
-
-	invltlb_pcid_handler();
-	return (FILTER_HANDLED);
-}
-#endif
-
-static int
-xen_invlpg(void *arg)
-{
-
-	invlpg_handler();
-	return (FILTER_HANDLED);
-}
-
-#ifdef __amd64__
-static int
-xen_invlpg_pcid(void *arg)
-{
-
-	invlpg_pcid_handler();
-	return (FILTER_HANDLED);
-}
-#endif
-
-static int
-xen_invlrng(void *arg)
-{
-
-	invlrng_handler();
-	return (FILTER_HANDLED);
-}
-
-static int
-xen_invlcache(void *arg)
-{
-
-	invlcache_handler();
-	return (FILTER_HANDLED);
-}
-
-#ifdef __i386__
-static int
-xen_lazypmap(void *arg)
-{
-
-	pmap_lazyfix_action();
-	return (FILTER_HANDLED);
-}
-#endif
-
-static int
-xen_cpustop_handler(void *arg)
-{
-
-	cpustop_handler();
-	return (FILTER_HANDLED);
-}
-
-static int
-xen_cpususpend_handler(void *arg)
-{
-
-	cpususpend_handler();
-	return (FILTER_HANDLED);
-}
-
-static int
-xen_cpustophard_handler(void *arg)
-{
-
-	ipi_nmi_handler();
-	return (FILTER_HANDLED);
-}
-
-/* Xen PV IPI sender */
-static void
-xen_ipi_vectored(u_int vector, int dest)
-{
-	xen_intr_handle_t *ipi_handle;
-	int ipi_idx, to_cpu, self;
-
-	ipi_idx = IPI_TO_IDX(vector);
-	if (ipi_idx > nitems(xen_ipis))
-		panic("IPI out of range");
-
-	switch(dest) {
-	case APIC_IPI_DEST_SELF:
-		ipi_handle = DPCPU_GET(ipi_handle);
-		xen_intr_signal(ipi_handle[ipi_idx]);
-		break;
-	case APIC_IPI_DEST_ALL:
-		CPU_FOREACH(to_cpu) {
-			ipi_handle = DPCPU_ID_GET(to_cpu, ipi_handle);
-			xen_intr_signal(ipi_handle[ipi_idx]);
-		}
-		break;
-	case APIC_IPI_DEST_OTHERS:
-		self = PCPU_GET(cpuid);
-		CPU_FOREACH(to_cpu) {
-			if (to_cpu != self) {
-				ipi_handle = DPCPU_ID_GET(to_cpu, ipi_handle);
-				xen_intr_signal(ipi_handle[ipi_idx]);
-			}
-		}
-		break;
-	default:
-		to_cpu = apic_cpuid(dest);
-		ipi_handle = DPCPU_ID_GET(to_cpu, ipi_handle);
-		xen_intr_signal(ipi_handle[ipi_idx]);
-		break;
-	}
-}
-
 /* XEN diverged cpu operations */
 static void
 xen_hvm_cpu_resume(void)
@@ -318,56 +118,7 @@ xen_hvm_cpu_resume(void)
 	/* register vcpu_info area */
 	xen_hvm_cpu_init();
 }
-
-static void
-xen_cpu_ipi_init(int cpu)
-{
-	xen_intr_handle_t *ipi_handle;
-	const struct xen_ipi_handler *ipi;
-	device_t dev;
-	int idx, rc;
-
-	ipi_handle = DPCPU_ID_GET(cpu, ipi_handle);
-	dev = pcpu_find(cpu)->pc_device;
-	KASSERT((dev != NULL), ("NULL pcpu device_t"));
-
-	for (ipi = xen_ipis, idx = 0; idx < nitems(xen_ipis); ipi++, idx++) {
-
-		if (ipi->filter == NULL) {
-			ipi_handle[idx] = NULL;
-			continue;
-		}
-
-		rc = xen_intr_alloc_and_bind_ipi(dev, cpu, ipi->filter,
-		    INTR_TYPE_TTY, &ipi_handle[idx]);
-		if (rc != 0)
-			panic("Unable to allocate a XEN IPI port");
-		xen_intr_describe(ipi_handle[idx], "%s", ipi->description);
-	}
-}
-
-static void
-xen_setup_cpus(void)
-{
-	int i;
-
-	if (!xen_vector_callback_enabled)
-		return;
-
-#ifdef __amd64__
-	if (pmap_pcid_enabled) {
-		xen_ipis[IPI_TO_IDX(IPI_INVLTLB)].filter = xen_invltlb_pcid;
-		xen_ipis[IPI_TO_IDX(IPI_INVLPG)].filter = xen_invlpg_pcid;
-	}
-#endif
-	CPU_FOREACH(i)
-		xen_cpu_ipi_init(i);
-
-	/* Set the xen pv ipi ops to replace the native ones */
-	apic_ops.ipi_vectored = xen_ipi_vectored;
-}
 #endif
-
 /*---------------------- XEN Hypervisor Probe and Setup ----------------------*/
 static uint32_t
 xen_hvm_cpuid_base(void)
@@ -654,9 +405,5 @@ xen_hvm_cpu_init(void)
 }
 
 SYSINIT(xen_hvm_init, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, xen_hvm_sysinit, NULL);
-#ifdef SMP
-/* We need to setup IPIs before APs are started */
-SYSINIT(xen_setup_cpus, SI_SUB_SMP-1, SI_ORDER_FIRST, xen_setup_cpus, NULL);
-#endif
 SYSINIT(xen_hvm_cpu_init, SI_SUB_INTR, SI_ORDER_FIRST, xen_hvm_cpu_init, NULL);
 SYSINIT(xen_set_vcpu_id, SI_SUB_CPU, SI_ORDER_ANY, xen_set_vcpu_id, NULL);

Modified: head/sys/x86/xen/pv.c
==============================================================================
--- head/sys/x86/xen/pv.c	Mon Jun 16 08:43:03 2014	(r267526)
+++ head/sys/x86/xen/pv.c	Mon Jun 16 08:43:45 2014	(r267527)
@@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -180,6 +181,7 @@ hammer_time_xen(start_info_t *si, uint64
 
 	/* Set the hooks for early functions that diverge from bare metal */
 	init_ops = xen_init_ops;
+	apic_ops = xen_apic_ops;
 
 	/* Now we can jump into the native init function */
 	return (hammer_time(0, physfree));

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 08:44:34 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B94B410A;
 Mon, 16 Jun 2014 08:44:34 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A4C2C273B;
 Mon, 16 Jun 2014 08:44:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5G8iYmg074289;
 Mon, 16 Jun 2014 08:44:34 GMT (envelope-from royger@svn.freebsd.org)
Received: (from royger@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5G8iXiu074281;
 Mon, 16 Jun 2014 08:44:33 GMT (envelope-from royger@svn.freebsd.org)
Message-Id: <201406160844.s5G8iXiu074281@svn.freebsd.org>
From: Roger Pau Monné 
Date: Mon, 16 Jun 2014 08:44:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267528 - in head/sys: conf dev/xen/console dev/xen/timer
 dev/xen/xenpci xen/xenstore
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 08:44:34 -0000

Author: royger
Date: Mon Jun 16 08:44:33 2014
New Revision: 267528
URL: http://svnweb.freebsd.org/changeset/base/267528

Log:
  xen: introduce xenpv bus
  
  Create a dummy bus so top level Xen devices can attach to it (instead
  of attaching directly to the nexus). This allows to have all the Xen
  related devices grouped under a single bus.
  
  Sponsored by: Citrix Systems R&D
  Approved by: gibbs
  
  x86/xen/xenpv.c:
   - Attach the xenpv bus when running as a Xen guest.
   - Attach the ISA bus if needed, in order to attach syscons.
  
  conf/files.amd6:
  conf/files.i386:
   - Include the xenpv.c file in the build of i386/amd64 kernels using
     XENHVM.
  
  dev/xen/console/console.c:
  dev/xen/timer/timer.c:
  xen/xenstore/xenstore.c:
   - Attach to the xenpv bus instead of the Nexus.
  
  dev/xen/xenpci/xenpci.c:
   - Xen specific devices on PVHVM guests are no longer attached to the
     xenpci device, they are instead attached to the xenpv bus, remove
     the now unused methods.

Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/dev/xen/console/console.c
  head/sys/dev/xen/timer/timer.c
  head/sys/dev/xen/xenpci/xenpci.c
  head/sys/xen/xenstore/xenstore.c

Modified: head/sys/conf/files.amd64
==============================================================================
--- head/sys/conf/files.amd64	Mon Jun 16 08:43:45 2014	(r267527)
+++ head/sys/conf/files.amd64	Mon Jun 16 08:44:33 2014	(r267528)
@@ -558,3 +558,4 @@ x86/xen/xen_intr.c		optional	xen | xenhv
 x86/xen/pv.c			optional	xenhvm
 x86/xen/pvcpu_enum.c		optional	xenhvm
 x86/xen/xen_apic.c		optional	xenhvm
+x86/xen/xenpv.c			optional	xenhvm

Modified: head/sys/conf/files.i386
==============================================================================
--- head/sys/conf/files.i386	Mon Jun 16 08:43:45 2014	(r267527)
+++ head/sys/conf/files.i386	Mon Jun 16 08:44:33 2014	(r267528)
@@ -595,3 +595,4 @@ x86/x86/delay.c			standard
 x86/xen/hvm.c			optional xenhvm
 x86/xen/xen_intr.c		optional xen | xenhvm
 x86/xen/xen_apic.c		optional xenhvm
+x86/xen/xenpv.c			optional xen | xenhvm

Modified: head/sys/dev/xen/console/console.c
==============================================================================
--- head/sys/dev/xen/console/console.c	Mon Jun 16 08:43:45 2014	(r267527)
+++ head/sys/dev/xen/console/console.c	Mon Jun 16 08:44:33 2014	(r267528)
@@ -509,4 +509,4 @@ xcons_force_flush(void)
 	}
 }
 
-DRIVER_MODULE(xc, nexus, xc_driver, xc_devclass, 0, 0);
+DRIVER_MODULE(xc, xenpv, xc_driver, xc_devclass, 0, 0);

Modified: head/sys/dev/xen/timer/timer.c
==============================================================================
--- head/sys/dev/xen/timer/timer.c	Mon Jun 16 08:43:45 2014	(r267527)
+++ head/sys/dev/xen/timer/timer.c	Mon Jun 16 08:44:33 2014	(r267528)
@@ -645,5 +645,5 @@ static driver_t xentimer_driver = {
 	sizeof(struct xentimer_softc),
 };
 
-DRIVER_MODULE(xentimer, nexus, xentimer_driver, xentimer_devclass, 0, 0);
-MODULE_DEPEND(xentimer, nexus, 1, 1, 1);
+DRIVER_MODULE(xentimer, xenpv, xentimer_driver, xentimer_devclass, 0, 0);
+MODULE_DEPEND(xentimer, xenpv, 1, 1, 1);

Modified: head/sys/dev/xen/xenpci/xenpci.c
==============================================================================
--- head/sys/dev/xen/xenpci/xenpci.c	Mon Jun 16 08:43:45 2014	(r267527)
+++ head/sys/dev/xen/xenpci/xenpci.c	Mon Jun 16 08:44:33 2014	(r267528)
@@ -51,8 +51,6 @@ __FBSDID("$FreeBSD$");
 
 extern void xen_intr_handle_upcall(struct trapframe *trap_frame);
 
-static device_t nexus;
-
 /*
  * This is used to find our platform device instance.
  */
@@ -188,36 +186,6 @@ xenpci_alloc_space(size_t sz, vm_paddr_t
 	}
 }
 
-static struct resource *
-xenpci_alloc_resource(device_t dev, device_t child, int type, int *rid,
-    u_long start, u_long end, u_long count, u_int flags)
-{
-	return (BUS_ALLOC_RESOURCE(nexus, child, type, rid, start,
-	    end, count, flags));
-}
-
-
-static int
-xenpci_release_resource(device_t dev, device_t child, int type, int rid,
-    struct resource *r)
-{
-	return (BUS_RELEASE_RESOURCE(nexus, child, type, rid, r));
-}
-
-static int
-xenpci_activate_resource(device_t dev, device_t child, int type, int rid,
-    struct resource *r)
-{
-	return (BUS_ACTIVATE_RESOURCE(nexus, child, type, rid, r));
-}
-
-static int
-xenpci_deactivate_resource(device_t dev, device_t child, int type,
-    int rid, struct resource *r)
-{
-	return (BUS_DEACTIVATE_RESOURCE(nexus, child, type, rid, r));
-}
-
 /*
  * Probe - just check device ID.
  */
@@ -229,7 +197,7 @@ xenpci_probe(device_t dev)
 		return (ENXIO);
 
 	device_set_desc(dev, "Xen Platform Device");
-	return (bus_generic_probe(dev));
+	return (BUS_PROBE_DEFAULT);
 }
 
 /*
@@ -239,20 +207,8 @@ static int
 xenpci_attach(device_t dev)
 {
 	struct xenpci_softc *scp = device_get_softc(dev);
-	devclass_t dc;
 	int error;
 
-	/*
-	 * Find and record nexus0.  Since we are not really on the
-	 * PCI bus, all resource operations are directed to nexus
-	 * instead of through our parent.
-	 */
-	if ((dc = devclass_find("nexus"))  == 0
-	 || (nexus = devclass_get_device(dc, 0)) == 0) {
-		device_printf(dev, "unable to find nexus.");
-		return (ENOENT);
-	}
-
 	error = xenpci_allocate_resources(dev);
 	if (error) {
 		device_printf(dev, "xenpci_allocate_resources failed(%d).\n",
@@ -270,7 +226,7 @@ xenpci_attach(device_t dev)
 		goto errexit;
 	}
 
-	return (bus_generic_attach(dev));
+	return (0);
 
 errexit:
 	/*
@@ -309,16 +265,10 @@ xenpci_detach(device_t dev)
 }
 
 static int
-xenpci_suspend(device_t dev)
-{
-	return (bus_generic_suspend(dev));
-}
-
-static int
 xenpci_resume(device_t dev)
 {
 	xen_hvm_set_callback(dev);
-	return (bus_generic_resume(dev));
+	return (0);
 }
 
 static device_method_t xenpci_methods[] = {
@@ -326,16 +276,8 @@ static device_method_t xenpci_methods[] 
 	DEVMETHOD(device_probe,		xenpci_probe),
 	DEVMETHOD(device_attach,	xenpci_attach),
 	DEVMETHOD(device_detach,	xenpci_detach),
-	DEVMETHOD(device_suspend,	xenpci_suspend),
 	DEVMETHOD(device_resume,	xenpci_resume),
 
-	/* Bus interface */
-	DEVMETHOD(bus_add_child,	bus_generic_add_child),
-	DEVMETHOD(bus_alloc_resource,   xenpci_alloc_resource),
-	DEVMETHOD(bus_release_resource, xenpci_release_resource),
-	DEVMETHOD(bus_activate_resource, xenpci_activate_resource),
-	DEVMETHOD(bus_deactivate_resource, xenpci_deactivate_resource),
-
 	{ 0, 0 }
 };
 

Modified: head/sys/xen/xenstore/xenstore.c
==============================================================================
--- head/sys/xen/xenstore/xenstore.c	Mon Jun 16 08:43:45 2014	(r267527)
+++ head/sys/xen/xenstore/xenstore.c	Mon Jun 16 08:44:33 2014	(r267528)
@@ -1261,11 +1261,7 @@ static device_method_t xenstore_methods[
 DEFINE_CLASS_0(xenstore, xenstore_driver, xenstore_methods, 0);
 static devclass_t xenstore_devclass; 
  
-#ifdef XENHVM
-DRIVER_MODULE(xenstore, xenpci, xenstore_driver, xenstore_devclass, 0, 0);
-#else
-DRIVER_MODULE(xenstore, nexus, xenstore_driver, xenstore_devclass, 0, 0);
-#endif
+DRIVER_MODULE(xenstore, xenpv, xenstore_driver, xenstore_devclass, 0, 0);
 
 /*------------------------------- Sysctl Data --------------------------------*/
 /* XXX Shouldn't the node be somewhere else? */

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 08:45:12 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id BEDC2362;
 Mon, 16 Jun 2014 08:45:12 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id AB651274E;
 Mon, 16 Jun 2014 08:45:12 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5G8jCMG074471;
 Mon, 16 Jun 2014 08:45:12 GMT (envelope-from royger@svn.freebsd.org)
Received: (from royger@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5G8jCEU074470;
 Mon, 16 Jun 2014 08:45:12 GMT (envelope-from royger@svn.freebsd.org)
Message-Id: <201406160845.s5G8jCEU074470@svn.freebsd.org>
From: Roger Pau Monné 
Date: Mon, 16 Jun 2014 08:45:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267529 - head/sys/conf
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 08:45:12 -0000

Author: royger
Date: Mon Jun 16 08:45:12 2014
New Revision: 267529
URL: http://svnweb.freebsd.org/changeset/base/267529

Log:
  xen: create a PV CPU device for PVH guests
  
  Since there's no ACPI on PVH guests, we need to create a dummy CPU
  device in order to fill the pcpu->pc_device field.
  
  Sponsored by: Citrix Systems R&D
  Approved by: gibbs
  
  dev/xen/pvcpu/pvcpu.c:
   - Create a dummy CPU device for PVH guests in order to fill the
     per-cpu pc_device field.
  
  conf/files:
   - Add the pvcpu device to kernels using XEN or XENHVM options.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Mon Jun 16 08:44:33 2014	(r267528)
+++ head/sys/conf/files	Mon Jun 16 08:45:12 2014	(r267529)
@@ -2589,6 +2589,7 @@ dev/xen/netback/netback.c	optional xen |
 dev/xen/netfront/netfront.c	optional xen | xenhvm
 dev/xen/xenpci/xenpci.c		optional xenpci
 dev/xen/timer/timer.c		optional xen | xenhvm
+dev/xen/pvcpu/pvcpu.c		optional xen | xenhvm
 dev/xl/if_xl.c			optional xl pci
 dev/xl/xlphy.c			optional xl pci
 fs/deadfs/dead_vnops.c		standard

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 08:45:52 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 40D4F4BA;
 Mon, 16 Jun 2014 08:45:52 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2D7E2275F;
 Mon, 16 Jun 2014 08:45:52 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5G8jqPo074587;
 Mon, 16 Jun 2014 08:45:52 GMT (envelope-from royger@svn.freebsd.org)
Received: (from royger@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5G8jpt6074585;
 Mon, 16 Jun 2014 08:45:51 GMT (envelope-from royger@svn.freebsd.org)
Message-Id: <201406160845.s5G8jpt6074585@svn.freebsd.org>
From: Roger Pau Monné 
Date: Mon, 16 Jun 2014 08:45:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267530 - head/sys/conf
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 08:45:52 -0000

Author: royger
Date: Mon Jun 16 08:45:51 2014
New Revision: 267530
URL: http://svnweb.freebsd.org/changeset/base/267530

Log:
  xen: create a Xen nexus to use in PV/PVH
  
  Introduce a Xen specific nexus that is going to be used by Xen PV/PVH
  guests.
  
  Sponsored by: Citrix Systems R&D
  Approved by: gibbs
  
  x86/xen/xen_nexus.c:
   - Introduce a Nexus to use on Xen PV(H) guests, this prevents PV(H)
     guests from using the legacy Nexus.
  
  conf/files.amd64:
  conf/files.i386:
   - Add the xen nexus to the build.

Modified:
  head/sys/conf/files.amd64
  head/sys/conf/files.i386

Modified: head/sys/conf/files.amd64
==============================================================================
--- head/sys/conf/files.amd64	Mon Jun 16 08:45:12 2014	(r267529)
+++ head/sys/conf/files.amd64	Mon Jun 16 08:45:51 2014	(r267530)
@@ -559,3 +559,4 @@ x86/xen/pv.c			optional	xenhvm
 x86/xen/pvcpu_enum.c		optional	xenhvm
 x86/xen/xen_apic.c		optional	xenhvm
 x86/xen/xenpv.c			optional	xenhvm
+x86/xen/xen_nexus.c		optional	xenhvm

Modified: head/sys/conf/files.i386
==============================================================================
--- head/sys/conf/files.i386	Mon Jun 16 08:45:12 2014	(r267529)
+++ head/sys/conf/files.i386	Mon Jun 16 08:45:51 2014	(r267530)
@@ -596,3 +596,4 @@ x86/xen/hvm.c			optional xenhvm
 x86/xen/xen_intr.c		optional xen | xenhvm
 x86/xen/xen_apic.c		optional xenhvm
 x86/xen/xenpv.c			optional xen | xenhvm
+x86/xen/xen_nexus.c		optional xen | xenhvm

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 08:46:32 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 375F8601;
 Mon, 16 Jun 2014 08:46:32 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0A6BD276D;
 Mon, 16 Jun 2014 08:46:32 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5G8kVgA074739;
 Mon, 16 Jun 2014 08:46:31 GMT (envelope-from royger@svn.freebsd.org)
Received: (from royger@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5G8kVfB074738;
 Mon, 16 Jun 2014 08:46:31 GMT (envelope-from royger@svn.freebsd.org)
Message-Id: <201406160846.s5G8kVfB074738@svn.freebsd.org>
From: Roger Pau Monné 
Date: Mon, 16 Jun 2014 08:46:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267531 - head/sys/dev/xen/control
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 08:46:32 -0000

Author: royger
Date: Mon Jun 16 08:46:31 2014
New Revision: 267531
URL: http://svnweb.freebsd.org/changeset/base/267531

Log:
  xen: add shutdown hook for PVH
  
  Add the PV shutdown hook to PVH.
  
  Sponsored by: Citrix Systems R&D
  Approved by: gibbs
  
  dev/xen/control/control.c:
   - Make xen_pv_shutdown_final available on XENHVM builds.
   - Register the Xen PV shutdown hook for PVH guests.

Modified:
  head/sys/dev/xen/control/control.c

Modified: head/sys/dev/xen/control/control.c
==============================================================================
--- head/sys/dev/xen/control/control.c	Mon Jun 16 08:45:51 2014	(r267530)
+++ head/sys/dev/xen/control/control.c	Mon Jun 16 08:46:31 2014	(r267531)
@@ -316,21 +316,6 @@ xctrl_suspend()
 	EVENTHANDLER_INVOKE(power_resume);
 }
 
-static void
-xen_pv_shutdown_final(void *arg, int howto)
-{
-	/*
-	 * Inform the hypervisor that shutdown is complete.
-	 * This is not necessary in HVM domains since Xen
-	 * emulates ACPI in that mode and FreeBSD's ACPI
-	 * support will request this transition.
-	 */
-	if (howto & (RB_HALT | RB_POWEROFF))
-		HYPERVISOR_shutdown(SHUTDOWN_poweroff);
-	else
-		HYPERVISOR_shutdown(SHUTDOWN_reboot);
-}
-
 #else
 
 /* HVM mode suspension. */
@@ -440,6 +425,21 @@ xctrl_crash()
 	panic("Xen directed crash");
 }
 
+static void
+xen_pv_shutdown_final(void *arg, int howto)
+{
+	/*
+	 * Inform the hypervisor that shutdown is complete.
+	 * This is not necessary in HVM domains since Xen
+	 * emulates ACPI in that mode and FreeBSD's ACPI
+	 * support will request this transition.
+	 */
+	if (howto & (RB_HALT | RB_POWEROFF))
+		HYPERVISOR_shutdown(SHUTDOWN_poweroff);
+	else
+		HYPERVISOR_shutdown(SHUTDOWN_reboot);
+}
+
 /*------------------------------ Event Reception -----------------------------*/
 static void
 xctrl_on_watch_event(struct xs_watch *watch, const char **vec, unsigned int len)
@@ -522,10 +522,9 @@ xctrl_attach(device_t dev)
 	xctrl->xctrl_watch.callback_data = (uintptr_t)xctrl;
 	xs_register_watch(&xctrl->xctrl_watch);
 
-#ifndef XENHVM
-	EVENTHANDLER_REGISTER(shutdown_final, xen_pv_shutdown_final, NULL,
-			      SHUTDOWN_PRI_LAST);
-#endif
+	if (xen_pv_domain())
+		EVENTHANDLER_REGISTER(shutdown_final, xen_pv_shutdown_final, NULL,
+		                      SHUTDOWN_PRI_LAST);
 
 	return (0);
 }

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 08:47:15 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 97804759;
 Mon, 16 Jun 2014 08:47:15 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 844BF2776;
 Mon, 16 Jun 2014 08:47:15 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5G8lFk7074911;
 Mon, 16 Jun 2014 08:47:15 GMT (envelope-from royger@svn.freebsd.org)
Received: (from royger@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5G8lFx2074910;
 Mon, 16 Jun 2014 08:47:15 GMT (envelope-from royger@svn.freebsd.org)
Message-Id: <201406160847.s5G8lFx2074910@svn.freebsd.org>
From: Roger Pau Monné 
Date: Mon, 16 Jun 2014 08:47:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267532 - head/sys/xen/xenstore
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 08:47:15 -0000

Author: royger
Date: Mon Jun 16 08:47:15 2014
New Revision: 267532
URL: http://svnweb.freebsd.org/changeset/base/267532

Log:
  xen: xenstore changes to support PVH
  
  For PVH guests the xenstore parameters are fetched from the start_info
  struct, just like on PV.
  
  Sponsored by: Citrix Systems R&D
  Approved by: gibbs
  
  xen/xenstore/xenstore.c:
   - Fetch xenstore event channel port from start_info.

Modified:
  head/sys/xen/xenstore/xenstore.c

Modified: head/sys/xen/xenstore/xenstore.c
==============================================================================
--- head/sys/xen/xenstore/xenstore.c	Mon Jun 16 08:46:31 2014	(r267531)
+++ head/sys/xen/xenstore/xenstore.c	Mon Jun 16 08:47:15 2014	(r267532)
@@ -229,13 +229,11 @@ struct xs_softc {
 	 */
 	struct sx xenwatch_mutex;
 
-#ifdef XENHVM
 	/**
 	 * The HVM guest pseudo-physical frame number.  This is Xen's mapping
 	 * of the true machine frame number into our "physical address space".
 	 */
 	unsigned long gpfn;
-#endif
 
 	/**
 	 * The event channel for communicating with the
@@ -1147,13 +1145,15 @@ xs_attach(device_t dev)
 	/* Initialize the interface to xenstore. */
 	struct proc *p;
 
-#ifdef XENHVM
-	xs.evtchn = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN);
-	xs.gpfn = hvm_get_parameter(HVM_PARAM_STORE_PFN);
-	xen_store = pmap_mapdev(xs.gpfn * PAGE_SIZE, PAGE_SIZE);
-#else
-	xs.evtchn = xen_start_info->store_evtchn;
-#endif
+	if (xen_hvm_domain()) {
+		xs.evtchn = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN);
+		xs.gpfn = hvm_get_parameter(HVM_PARAM_STORE_PFN);
+		xen_store = pmap_mapdev(xs.gpfn * PAGE_SIZE, PAGE_SIZE);
+	} else if (xen_pv_domain()) {
+		xs.evtchn = HYPERVISOR_start_info->store_evtchn;
+	} else {
+		panic("Unknown domain type, cannot initialize xenstore.");
+	}
 
 	TAILQ_INIT(&xs.reply_list);
 	TAILQ_INIT(&xs.watch_events);

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 08:48:07 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 351D589D;
 Mon, 16 Jun 2014 08:48:07 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 22474277E;
 Mon, 16 Jun 2014 08:48:07 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5G8m7F6075085;
 Mon, 16 Jun 2014 08:48:07 GMT (envelope-from royger@svn.freebsd.org)
Received: (from royger@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5G8m6Ec075084;
 Mon, 16 Jun 2014 08:48:06 GMT (envelope-from royger@svn.freebsd.org)
Message-Id: <201406160848.s5G8m6Ec075084@svn.freebsd.org>
From: Roger Pau Monné 
Date: Mon, 16 Jun 2014 08:48:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267533 - head/sys/xen/xenstore
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 08:48:07 -0000

Author: royger
Date: Mon Jun 16 08:48:06 2014
New Revision: 267533
URL: http://svnweb.freebsd.org/changeset/base/267533

Log:
  xen: init gnttab from xenpv
  
  Currently the grant table is initialized from xenstore, but a better
  place to do this would be xenpv, so move grant table initialization
  there.
  
  Sponsored by: Citrix Systems R&D
  Approved by: gibbs
  
  x86/xen/xenpv.c:
   - Add gnttab initialization.
  
  xen/xenstore/xenstore.c:
   - Remove gnttab initialization.

Modified:
  head/sys/xen/xenstore/xenstore.c

Modified: head/sys/xen/xenstore/xenstore.c
==============================================================================
--- head/sys/xen/xenstore/xenstore.c	Mon Jun 16 08:47:15 2014	(r267532)
+++ head/sys/xen/xenstore/xenstore.c	Mon Jun 16 08:48:06 2014	(r267533)
@@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
 #include 
 #include 
 
@@ -1128,20 +1127,6 @@ xs_attach(device_t dev)
 	xs.xs_dev = dev;
 	device_set_softc(dev, &xs);
 
-	/*
-	 * This seems to be a layering violation.  The XenStore is just
-	 * one of many clients of the Grant Table facility.  It happens
-	 * to be the first and a gating consumer to all other devices,
-	 * so this does work.  A better place would be in the PV support
-	 * code for fully PV kernels and the xenpci driver for HVM kernels.
-	 */
-	error = gnttab_init();
-	if (error != 0) {
-		log(LOG_WARNING,
-		    "XENSTORE: Error initializing grant tables: %d\n", error);
-		return (ENXIO);
-	}
-
 	/* Initialize the interface to xenstore. */
 	struct proc *p;
 

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 08:48:44 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1C97D9DF;
 Mon, 16 Jun 2014 08:48:44 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id F13622783;
 Mon, 16 Jun 2014 08:48:43 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5G8mhn7075243;
 Mon, 16 Jun 2014 08:48:43 GMT (envelope-from royger@svn.freebsd.org)
Received: (from royger@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5G8mhj1075238;
 Mon, 16 Jun 2014 08:48:43 GMT (envelope-from royger@svn.freebsd.org)
Message-Id: <201406160848.s5G8mhj1075238@svn.freebsd.org>
From: Roger Pau Monné 
Date: Mon, 16 Jun 2014 08:48:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267534 - in head/sys: dev/xen/control dev/xen/xenpci xen
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 08:48:44 -0000

Author: royger
Date: Mon Jun 16 08:48:42 2014
New Revision: 267534
URL: http://svnweb.freebsd.org/changeset/base/267534

Log:
  xen: unify gnttab initialization for PVHVM and PVH
  
  Switch the initialization of gnttab to use an unused physical memory
  range for both PVHVM and PVH.
  
  In the past PVHVM was using the xenpci BAR, but there's no reason to
  do that, and in fact FreeBSD was probably doing it because it was the
  way it was done in Windows, were drivers cannot probably request for
  unused physical memory ranges, but it was never enforced in the
  hypervisor.
  
  Sponsored by: Citrix Systems R&D
  Approved by: gibbs
  
  xen/gnttab.c:
   - Allocate contiguous physical memory for grant table frames for both
     PVHVM and PVH.
   - Since gnttab is not a device, use the xenpv device in order to
     request for this allocation.
  
  dev/xen/xenpci/xenpcivar.h:
  dev/xen/xenpci/xenpci.c:
   - Remove the now unused xenpci_alloc_space and xenpci_alloc_space_int
     functions.
  
  xen/gnttab.h:
   - Change the prototype of gnttab_init and gnttab_resume, that now
     takes a device_t parameter.
  
  dev/xen/control/control.c:
  x86/xen/xenpv.c:
   - Changes to accomodate the new prototype of gnttab_init and
     gnttab_resume.

Modified:
  head/sys/dev/xen/control/control.c
  head/sys/dev/xen/xenpci/xenpci.c
  head/sys/dev/xen/xenpci/xenpcivar.h
  head/sys/xen/gnttab.c
  head/sys/xen/gnttab.h

Modified: head/sys/dev/xen/control/control.c
==============================================================================
--- head/sys/dev/xen/control/control.c	Mon Jun 16 08:48:06 2014	(r267533)
+++ head/sys/dev/xen/control/control.c	Mon Jun 16 08:48:42 2014	(r267534)
@@ -287,7 +287,7 @@ xctrl_suspend()
 	}
 	HYPERVISOR_shared_info->arch.max_pfn = max_pfn;
 
-	gnttab_resume();
+	gnttab_resume(NULL);
 	intr_resume(suspend_cancelled != 0);
 	local_irq_enable();
 	xencons_resume();
@@ -385,7 +385,7 @@ xctrl_suspend()
 	/*
 	 * Reset grant table info.
 	 */
-	gnttab_resume();
+	gnttab_resume(NULL);
 
 #ifdef SMP
 	if (smp_started && !CPU_EMPTY(&cpu_suspend_map)) {

Modified: head/sys/dev/xen/xenpci/xenpci.c
==============================================================================
--- head/sys/dev/xen/xenpci/xenpci.c	Mon Jun 16 08:48:06 2014	(r267533)
+++ head/sys/dev/xen/xenpci/xenpci.c	Mon Jun 16 08:48:42 2014	(r267534)
@@ -108,13 +108,6 @@ xenpci_deallocate_resources(device_t dev
 			scp->rid_irq, scp->res_irq);
 		scp->res_irq = 0;
 	}
-	if (scp->res_memory != 0) {
-		bus_deactivate_resource(dev, SYS_RES_MEMORY,
-			scp->rid_memory, scp->res_memory);
-		bus_release_resource(dev, SYS_RES_MEMORY,
-			scp->rid_memory, scp->res_memory);
-		scp->res_memory = 0;
-	}
 
 	return (0);
 }
@@ -134,16 +127,6 @@ xenpci_allocate_resources(device_t dev)
 		goto errexit;
 	}
 
-	scp->rid_memory = PCIR_BAR(1);
-	scp->res_memory = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
-			&scp->rid_memory, RF_ACTIVE);
-	if (scp->res_memory == NULL) {
-		printf("xenpci Could not allocate memory bar.\n");
-		goto errexit;
-	}
-
-	scp->phys_next = rman_get_start(scp->res_memory);
-
 	return (0);
 
 errexit:
@@ -153,40 +136,6 @@ errexit:
 }
 
 /*
- * Allocate a physical address range from our mmio region.
- */
-static int
-xenpci_alloc_space_int(struct xenpci_softc *scp, size_t sz,
-    vm_paddr_t *pa)
-{
-
-	if (scp->phys_next + sz > rman_get_end(scp->res_memory)) {
-		return (ENOMEM);
-	}
-
-	*pa = scp->phys_next;
-	scp->phys_next += sz;
-
-	return (0);
-}
-
-/*
- * Allocate a physical address range from our mmio region.
- */
-int
-xenpci_alloc_space(size_t sz, vm_paddr_t *pa)
-{
-	device_t dev = devclass_get_device(xenpci_devclass, 0);
-
-	if (dev) {
-		return (xenpci_alloc_space_int(device_get_softc(dev),
-			sz, pa));
-	} else {
-		return (ENOMEM);
-	}
-}
-
-/*
  * Probe - just check device ID.
  */
 static int

Modified: head/sys/dev/xen/xenpci/xenpcivar.h
==============================================================================
--- head/sys/dev/xen/xenpci/xenpcivar.h	Mon Jun 16 08:48:06 2014	(r267533)
+++ head/sys/dev/xen/xenpci/xenpcivar.h	Mon Jun 16 08:48:42 2014	(r267534)
@@ -31,13 +31,7 @@
  */
 struct xenpci_softc {
 	int rid_ioport;
-	int rid_memory;
 	int rid_irq;
-	struct resource* res_memory;	/* Resource for mem range. */
 	struct resource* res_irq;	/* Resource for irq range. */
 	void	*intr_cookie;
-
-	vm_paddr_t phys_next;		/* next page from mem range */
 };
-
-extern int xenpci_alloc_space(size_t sz, vm_paddr_t *pa);

Modified: head/sys/xen/gnttab.c
==============================================================================
--- head/sys/xen/gnttab.c	Mon Jun 16 08:48:06 2014	(r267533)
+++ head/sys/xen/gnttab.c	Mon Jun 16 08:48:42 2014	(r267534)
@@ -25,6 +25,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -51,6 +54,17 @@ static int gnttab_free_count;
 static grant_ref_t gnttab_free_head;
 static struct mtx gnttab_list_lock;
 
+#ifdef XENHVM
+/*
+ * Resource representing allocated physical address space
+ * for the grant table metainfo
+ */
+static struct resource *gnttab_pseudo_phys_res;
+
+/* Resource id for allocated physical address space. */
+static int gnttab_pseudo_phys_res_id;
+#endif
+
 static grant_entry_t *shared;
 
 static struct gnttab_free_callback *gnttab_free_callback_list = NULL;
@@ -542,7 +556,7 @@ gnttab_map(unsigned int start_idx, unsig
 }
 
 int
-gnttab_resume(void)
+gnttab_resume(device_t dev)
 {
 
 	if (max_nr_grant_frames() < nr_grant_frames)
@@ -563,8 +577,6 @@ gnttab_suspend(void)
 
 #else /* XENHVM */
 
-#include 
-
 static vm_paddr_t resume_frames;
 
 static int
@@ -603,9 +615,8 @@ gnttab_map(unsigned int start_idx, unsig
 }
 
 int
-gnttab_resume(void)
+gnttab_resume(device_t dev)
 {
-	int error;
 	unsigned int max_nr_gframes, nr_gframes;
 
 	nr_gframes = nr_grant_frames;
@@ -614,12 +625,15 @@ gnttab_resume(void)
 		return (ENOSYS);
 
 	if (!resume_frames) {
-		error = xenpci_alloc_space(PAGE_SIZE * max_nr_gframes,
-		    &resume_frames);
-		if (error) {
-			printf("error mapping gnttab share frames\n");
-			return (error);
-		}
+		KASSERT(dev != NULL,
+		    ("No resume frames and no device provided"));
+
+		gnttab_pseudo_phys_res = bus_alloc_resource(dev,
+		    SYS_RES_MEMORY, &gnttab_pseudo_phys_res_id, 0, ~0,
+		    PAGE_SIZE * max_nr_gframes, RF_ACTIVE);
+		if (gnttab_pseudo_phys_res == NULL)
+			panic("Unable to reserve physical memory for gnttab");
+		resume_frames = rman_get_start(gnttab_pseudo_phys_res);
 	}
 
 	return (gnttab_map(0, nr_gframes - 1));
@@ -647,7 +661,7 @@ gnttab_expand(unsigned int req_entries)
 }
 
 int 
-gnttab_init()
+gnttab_init(device_t dev)
 {
 	int i;
 	unsigned int max_nr_glist_frames;
@@ -679,7 +693,7 @@ gnttab_init()
 			goto ini_nomem;
 	}
 
-	if (gnttab_resume())
+	if (gnttab_resume(dev))
 		return (ENODEV);
 
 	nr_init_grefs = nr_grant_frames * GREFS_PER_GRANT_FRAME;

Modified: head/sys/xen/gnttab.h
==============================================================================
--- head/sys/xen/gnttab.h	Mon Jun 16 08:48:06 2014	(r267533)
+++ head/sys/xen/gnttab.h	Mon Jun 16 08:48:42 2014	(r267534)
@@ -51,7 +51,7 @@ struct gnttab_free_callback {
 	uint16_t count;
 };
 
-int gnttab_init(void);
+int gnttab_init(device_t);
 
 /*
  * Allocate a grant table reference and return it in *result. Returns
@@ -116,7 +116,7 @@ void gnttab_grant_foreign_transfer_ref(g
 				       unsigned long pfn);
 
 int gnttab_suspend(void);
-int gnttab_resume(void);
+int gnttab_resume(device_t);
 
 #if 0
 

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 08:49:16 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B8EC0B34;
 Mon, 16 Jun 2014 08:49:16 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A5B16278D;
 Mon, 16 Jun 2014 08:49:16 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5G8nGO7075369;
 Mon, 16 Jun 2014 08:49:16 GMT (envelope-from royger@svn.freebsd.org)
Received: (from royger@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5G8nGQ1075368;
 Mon, 16 Jun 2014 08:49:16 GMT (envelope-from royger@svn.freebsd.org)
Message-Id: <201406160849.s5G8nGQ1075368@svn.freebsd.org>
From: Roger Pau Monné 
Date: Mon, 16 Jun 2014 08:49:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267535 - head/sys/x86/isa
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 08:49:16 -0000

Author: royger
Date: Mon Jun 16 08:49:16 2014
New Revision: 267535
URL: http://svnweb.freebsd.org/changeset/base/267535

Log:
  isa: allow ISA bus to attach to xenpv bus
  
  This is needed because syscons depends on ISA.
  
  Sponsored by: Citrix Systems R&D
  Approved by: gibbs
  
  x86/isa/isa.c:
   - Allow the ISA bus to attach to xenpv.

Modified:
  head/sys/x86/isa/isa.c

Modified: head/sys/x86/isa/isa.c
==============================================================================
--- head/sys/x86/isa/isa.c	Mon Jun 16 08:48:42 2014	(r267534)
+++ head/sys/x86/isa/isa.c	Mon Jun 16 08:49:16 2014	(r267535)
@@ -241,3 +241,8 @@ isa_release_resource(device_t bus, devic
  * On this platform, isa can also attach to the legacy bus.
  */
 DRIVER_MODULE(isa, legacy, isa_driver, isa_devclass, 0, 0);
+
+/*
+ * Attach the ISA bus to the xenpv bus in order to get syscons.
+ */
+DRIVER_MODULE(isa, xenpv, isa_driver, isa_devclass, 0, 0);

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 08:54:06 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2E307D41;
 Mon, 16 Jun 2014 08:54:06 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 197EE283D;
 Mon, 16 Jun 2014 08:54:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5G8s6ri079117;
 Mon, 16 Jun 2014 08:54:06 GMT (envelope-from royger@svn.freebsd.org)
Received: (from royger@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5G8s5fI079109;
 Mon, 16 Jun 2014 08:54:05 GMT (envelope-from royger@svn.freebsd.org)
Message-Id: <201406160854.s5G8s5fI079109@svn.freebsd.org>
From: Roger Pau Monné 
Date: Mon, 16 Jun 2014 08:54:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267536 - in head/sys: dev/xen/pvcpu x86/xen xen
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 08:54:06 -0000

Author: royger
Date: Mon Jun 16 08:54:04 2014
New Revision: 267536
URL: http://svnweb.freebsd.org/changeset/base/267536

Log:
  xen: add missing files
  
  Commit missing files that actually belong to previous commits.
  
  Sponsored by: Citrix Systems R&D
  Approved by: gibbs

Added:
  head/sys/dev/xen/pvcpu/
  head/sys/dev/xen/pvcpu/pvcpu.c   (contents, props changed)
  head/sys/x86/xen/xen_apic.c   (contents, props changed)
  head/sys/x86/xen/xen_nexus.c   (contents, props changed)
  head/sys/x86/xen/xenpv.c   (contents, props changed)
  head/sys/xen/xen_pv.h   (contents, props changed)

Added: head/sys/dev/xen/pvcpu/pvcpu.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/xen/pvcpu/pvcpu.c	Mon Jun 16 08:54:04 2014	(r267536)
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2013 Roger Pau Monné 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+/*
+ * Dummy Xen cpu device
+ *
+ * Since there's no ACPI on PVH guests, we need to create a dummy
+ * CPU device in order to fill the pcpu->pc_device field.
+ */
+
+static void
+xenpvcpu_identify(driver_t *driver, device_t parent)
+{
+	int i;
+
+	/* Only attach to PV guests, HVM guests use the ACPI CPU devices */
+	if (!xen_pv_domain())
+		return;
+
+	CPU_FOREACH(i) {
+		if (BUS_ADD_CHILD(parent, 0, "pvcpu", i) == NULL)
+			panic("Unable to add Xen PV CPU device.");
+	}
+}
+
+static int
+xenpvcpu_probe(device_t dev)
+{
+
+	device_set_desc(dev, "Xen PV CPU");
+	return (BUS_PROBE_NOWILDCARD);
+}
+
+static int
+xenpvcpu_attach(device_t dev)
+{
+	struct pcpu *pc;
+	int cpu;
+
+	cpu = device_get_unit(dev);
+	pc = pcpu_find(cpu);
+	pc->pc_device = dev;
+	return (0);
+}
+
+static device_method_t xenpvcpu_methods[] = {
+	DEVMETHOD(device_identify, xenpvcpu_identify),
+	DEVMETHOD(device_probe, xenpvcpu_probe),
+	DEVMETHOD(device_attach, xenpvcpu_attach),
+
+	DEVMETHOD_END
+};
+
+static driver_t xenpvcpu_driver = {
+	"pvcpu",
+	xenpvcpu_methods,
+	0,
+};
+
+devclass_t xenpvcpu_devclass;
+
+DRIVER_MODULE(xenpvcpu, xenpv, xenpvcpu_driver, xenpvcpu_devclass, 0, 0);
+MODULE_DEPEND(xenpvcpu, xenpv, 1, 1, 1);

Added: head/sys/x86/xen/xen_apic.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/x86/xen/xen_apic.c	Mon Jun 16 08:54:04 2014	(r267536)
@@ -0,0 +1,546 @@
+/*
+ * Copyright (c) 2014 Roger Pau Monné 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+/*--------------------------------- Macros -----------------------------------*/
+
+#define XEN_APIC_UNSUPPORTED \
+	panic("%s: not available in Xen PV port.", __func__)
+
+
+/*--------------------------- Forward Declarations ---------------------------*/
+#ifdef SMP
+static driver_filter_t xen_smp_rendezvous_action;
+static driver_filter_t xen_invltlb;
+static driver_filter_t xen_invlpg;
+static driver_filter_t xen_invlrng;
+static driver_filter_t xen_invlcache;
+#ifdef __i386__
+static driver_filter_t xen_lazypmap;
+#endif
+static driver_filter_t xen_ipi_bitmap_handler;
+static driver_filter_t xen_cpustop_handler;
+static driver_filter_t xen_cpususpend_handler;
+static driver_filter_t xen_cpustophard_handler;
+#endif
+
+/*---------------------------- Extern Declarations ---------------------------*/
+/* Variables used by mp_machdep to perform the MMU related IPIs */
+#ifdef __i386__
+extern void pmap_lazyfix_action(void);
+#endif
+#ifdef __amd64__
+extern int pmap_pcid_enabled;
+#endif
+
+extern int xen_vector_callback_enabled;
+
+/*---------------------------------- Macros ----------------------------------*/
+#define	IPI_TO_IDX(ipi) ((ipi) - APIC_IPI_INTS)
+
+/*--------------------------------- Xen IPIs ---------------------------------*/
+#ifdef SMP
+struct xen_ipi_handler
+{
+	driver_filter_t	*filter;
+	const char	*description;
+};
+
+static struct xen_ipi_handler xen_ipis[] = 
+{
+	[IPI_TO_IDX(IPI_RENDEZVOUS)]	= { xen_smp_rendezvous_action,	"r"   },
+	[IPI_TO_IDX(IPI_INVLTLB)]	= { xen_invltlb,		"itlb"},
+	[IPI_TO_IDX(IPI_INVLPG)]	= { xen_invlpg,			"ipg" },
+	[IPI_TO_IDX(IPI_INVLRNG)]	= { xen_invlrng,		"irg" },
+	[IPI_TO_IDX(IPI_INVLCACHE)]	= { xen_invlcache,		"ic"  },
+#ifdef __i386__
+	[IPI_TO_IDX(IPI_LAZYPMAP)]	= { xen_lazypmap,		"lp"  },
+#endif
+	[IPI_TO_IDX(IPI_BITMAP_VECTOR)] = { xen_ipi_bitmap_handler,	"b"   },
+	[IPI_TO_IDX(IPI_STOP)]		= { xen_cpustop_handler,	"st"  },
+	[IPI_TO_IDX(IPI_SUSPEND)]	= { xen_cpususpend_handler,	"sp"  },
+	[IPI_TO_IDX(IPI_STOP_HARD)]	= { xen_cpustophard_handler,	"sth" },
+};
+#endif
+
+/*------------------------------- Per-CPU Data -------------------------------*/
+#ifdef SMP
+DPCPU_DEFINE(xen_intr_handle_t, ipi_handle[nitems(xen_ipis)]);
+#endif
+
+/*------------------------------- Xen PV APIC --------------------------------*/
+
+static void
+xen_pv_lapic_create(u_int apic_id, int boot_cpu)
+{
+#ifdef SMP
+	cpu_add(apic_id, boot_cpu);
+#endif
+}
+
+static void
+xen_pv_lapic_init(vm_paddr_t addr)
+{
+
+}
+
+static void
+xen_pv_lapic_setup(int boot)
+{
+
+}
+
+static void
+xen_pv_lapic_dump(const char *str)
+{
+
+	printf("cpu%d %s XEN PV LAPIC\n", PCPU_GET(cpuid), str);
+}
+
+static void
+xen_pv_lapic_disable(void)
+{
+
+}
+
+static void
+xen_pv_lapic_eoi(void)
+{
+
+	XEN_APIC_UNSUPPORTED;
+}
+
+static int
+xen_pv_lapic_id(void)
+{
+
+	return (PCPU_GET(apic_id));
+}
+
+static int
+xen_pv_lapic_intr_pending(u_int vector)
+{
+
+	XEN_APIC_UNSUPPORTED;
+	return (0);
+}
+
+static u_int
+xen_pv_apic_cpuid(u_int apic_id)
+{
+#ifdef SMP
+	return (apic_cpuids[apic_id]);
+#else
+	return (0);
+#endif
+}
+
+static u_int
+xen_pv_apic_alloc_vector(u_int apic_id, u_int irq)
+{
+
+	XEN_APIC_UNSUPPORTED;
+	return (0);
+}
+
+static u_int
+xen_pv_apic_alloc_vectors(u_int apic_id, u_int *irqs, u_int count, u_int align)
+{
+
+	XEN_APIC_UNSUPPORTED;
+	return (0);
+}
+
+static void
+xen_pv_apic_disable_vector(u_int apic_id, u_int vector)
+{
+
+	XEN_APIC_UNSUPPORTED;
+}
+
+static void
+xen_pv_apic_enable_vector(u_int apic_id, u_int vector)
+{
+
+	XEN_APIC_UNSUPPORTED;
+}
+
+static void
+xen_pv_apic_free_vector(u_int apic_id, u_int vector, u_int irq)
+{
+
+	XEN_APIC_UNSUPPORTED;
+}
+
+static void
+xen_pv_lapic_set_logical_id(u_int apic_id, u_int cluster, u_int cluster_id)
+{
+
+	XEN_APIC_UNSUPPORTED;
+}
+
+static int
+xen_pv_lapic_enable_pmc(void)
+{
+
+	XEN_APIC_UNSUPPORTED;
+	return (0);
+}
+
+static void
+xen_pv_lapic_disable_pmc(void)
+{
+
+	XEN_APIC_UNSUPPORTED;
+}
+
+static void
+xen_pv_lapic_reenable_pmc(void)
+{
+
+	XEN_APIC_UNSUPPORTED;
+}
+
+static void
+xen_pv_lapic_enable_cmc(void)
+{
+
+}
+
+static void
+xen_pv_lapic_ipi_raw(register_t icrlo, u_int dest)
+{
+
+	XEN_APIC_UNSUPPORTED;
+}
+
+static void
+xen_pv_lapic_ipi_vectored(u_int vector, int dest)
+{
+	xen_intr_handle_t *ipi_handle;
+	int ipi_idx, to_cpu, self;
+
+	ipi_idx = IPI_TO_IDX(vector);
+	if (ipi_idx > nitems(xen_ipis))
+		panic("IPI out of range");
+
+	switch(dest) {
+	case APIC_IPI_DEST_SELF:
+		ipi_handle = DPCPU_GET(ipi_handle);
+		xen_intr_signal(ipi_handle[ipi_idx]);
+		break;
+	case APIC_IPI_DEST_ALL:
+		CPU_FOREACH(to_cpu) {
+			ipi_handle = DPCPU_ID_GET(to_cpu, ipi_handle);
+			xen_intr_signal(ipi_handle[ipi_idx]);
+		}
+		break;
+	case APIC_IPI_DEST_OTHERS:
+		self = PCPU_GET(cpuid);
+		CPU_FOREACH(to_cpu) {
+			if (to_cpu != self) {
+				ipi_handle = DPCPU_ID_GET(to_cpu, ipi_handle);
+				xen_intr_signal(ipi_handle[ipi_idx]);
+			}
+		}
+		break;
+	default:
+		to_cpu = apic_cpuid(dest);
+		ipi_handle = DPCPU_ID_GET(to_cpu, ipi_handle);
+		xen_intr_signal(ipi_handle[ipi_idx]);
+		break;
+	}
+}
+
+static int
+xen_pv_lapic_ipi_wait(int delay)
+{
+
+	XEN_APIC_UNSUPPORTED;
+	return (0);
+}
+
+static int
+xen_pv_lapic_set_lvt_mask(u_int apic_id, u_int lvt, u_char masked)
+{
+
+	XEN_APIC_UNSUPPORTED;
+	return (0);
+}
+
+static int
+xen_pv_lapic_set_lvt_mode(u_int apic_id, u_int lvt, uint32_t mode)
+{
+
+	XEN_APIC_UNSUPPORTED;
+	return (0);
+}
+
+static int
+xen_pv_lapic_set_lvt_polarity(u_int apic_id, u_int lvt, enum intr_polarity pol)
+{
+
+	XEN_APIC_UNSUPPORTED;
+	return (0);
+}
+
+static int
+xen_pv_lapic_set_lvt_triggermode(u_int apic_id, u_int lvt,
+    enum intr_trigger trigger)
+{
+
+	XEN_APIC_UNSUPPORTED;
+	return (0);
+}
+
+/* Xen apic_ops implementation */
+struct apic_ops xen_apic_ops = {
+	.create			= xen_pv_lapic_create,
+	.init			= xen_pv_lapic_init,
+	.setup			= xen_pv_lapic_setup,
+	.dump			= xen_pv_lapic_dump,
+	.disable		= xen_pv_lapic_disable,
+	.eoi			= xen_pv_lapic_eoi,
+	.id			= xen_pv_lapic_id,
+	.intr_pending		= xen_pv_lapic_intr_pending,
+	.set_logical_id		= xen_pv_lapic_set_logical_id,
+	.cpuid			= xen_pv_apic_cpuid,
+	.alloc_vector		= xen_pv_apic_alloc_vector,
+	.alloc_vectors		= xen_pv_apic_alloc_vectors,
+	.enable_vector		= xen_pv_apic_enable_vector,
+	.disable_vector		= xen_pv_apic_disable_vector,
+	.free_vector		= xen_pv_apic_free_vector,
+	.enable_pmc		= xen_pv_lapic_enable_pmc,
+	.disable_pmc		= xen_pv_lapic_disable_pmc,
+	.reenable_pmc		= xen_pv_lapic_reenable_pmc,
+	.enable_cmc		= xen_pv_lapic_enable_cmc,
+	.ipi_raw		= xen_pv_lapic_ipi_raw,
+	.ipi_vectored		= xen_pv_lapic_ipi_vectored,
+	.ipi_wait		= xen_pv_lapic_ipi_wait,
+	.set_lvt_mask		= xen_pv_lapic_set_lvt_mask,
+	.set_lvt_mode		= xen_pv_lapic_set_lvt_mode,
+	.set_lvt_polarity	= xen_pv_lapic_set_lvt_polarity,
+	.set_lvt_triggermode	= xen_pv_lapic_set_lvt_triggermode,
+};
+
+#ifdef SMP
+/*---------------------------- XEN PV IPI Handlers ---------------------------*/
+/*
+ * These are C clones of the ASM functions found in apic_vector.
+ */
+static int
+xen_ipi_bitmap_handler(void *arg)
+{
+	struct trapframe *frame;
+
+	frame = arg;
+	ipi_bitmap_handler(*frame);
+	return (FILTER_HANDLED);
+}
+
+static int
+xen_smp_rendezvous_action(void *arg)
+{
+#ifdef COUNT_IPIS
+	(*ipi_rendezvous_counts[PCPU_GET(cpuid)])++;
+#endif /* COUNT_IPIS */
+
+	smp_rendezvous_action();
+	return (FILTER_HANDLED);
+}
+
+static int
+xen_invltlb(void *arg)
+{
+
+	invltlb_handler();
+	return (FILTER_HANDLED);
+}
+
+#ifdef __amd64__
+static int
+xen_invltlb_pcid(void *arg)
+{
+
+	invltlb_pcid_handler();
+	return (FILTER_HANDLED);
+}
+#endif
+
+static int
+xen_invlpg(void *arg)
+{
+
+	invlpg_handler();
+	return (FILTER_HANDLED);
+}
+
+#ifdef __amd64__
+static int
+xen_invlpg_pcid(void *arg)
+{
+
+	invlpg_pcid_handler();
+	return (FILTER_HANDLED);
+}
+#endif
+
+static int
+xen_invlrng(void *arg)
+{
+
+	invlrng_handler();
+	return (FILTER_HANDLED);
+}
+
+static int
+xen_invlcache(void *arg)
+{
+
+	invlcache_handler();
+	return (FILTER_HANDLED);
+}
+
+#ifdef __i386__
+static int
+xen_lazypmap(void *arg)
+{
+
+	pmap_lazyfix_action();
+	return (FILTER_HANDLED);
+}
+#endif
+
+static int
+xen_cpustop_handler(void *arg)
+{
+
+	cpustop_handler();
+	return (FILTER_HANDLED);
+}
+
+static int
+xen_cpususpend_handler(void *arg)
+{
+
+	cpususpend_handler();
+	return (FILTER_HANDLED);
+}
+
+static int
+xen_cpustophard_handler(void *arg)
+{
+
+	ipi_nmi_handler();
+	return (FILTER_HANDLED);
+}
+
+/*----------------------------- XEN PV IPI setup -----------------------------*/
+/*
+ * Those functions are provided outside of the Xen PV APIC implementation
+ * so PVHVM guests can also use PV IPIs without having an actual Xen PV APIC,
+ * because on PVHVM there's an emulated LAPIC provided by Xen.
+ */
+static void
+xen_cpu_ipi_init(int cpu)
+{
+	xen_intr_handle_t *ipi_handle;
+	const struct xen_ipi_handler *ipi;
+	device_t dev;
+	int idx, rc;
+
+	ipi_handle = DPCPU_ID_GET(cpu, ipi_handle);
+	dev = pcpu_find(cpu)->pc_device;
+	KASSERT((dev != NULL), ("NULL pcpu device_t"));
+
+	for (ipi = xen_ipis, idx = 0; idx < nitems(xen_ipis); ipi++, idx++) {
+
+		if (ipi->filter == NULL) {
+			ipi_handle[idx] = NULL;
+			continue;
+		}
+
+		rc = xen_intr_alloc_and_bind_ipi(dev, cpu, ipi->filter,
+		    INTR_TYPE_TTY, &ipi_handle[idx]);
+		if (rc != 0)
+			panic("Unable to allocate a XEN IPI port");
+		xen_intr_describe(ipi_handle[idx], "%s", ipi->description);
+	}
+}
+
+static void
+xen_setup_cpus(void)
+{
+	int i;
+
+	if (!xen_vector_callback_enabled)
+		return;
+
+#ifdef __amd64__
+	if (pmap_pcid_enabled) {
+		xen_ipis[IPI_TO_IDX(IPI_INVLTLB)].filter = xen_invltlb_pcid;
+		xen_ipis[IPI_TO_IDX(IPI_INVLPG)].filter = xen_invlpg_pcid;
+	}
+#endif
+	CPU_FOREACH(i)
+		xen_cpu_ipi_init(i);
+
+	/* Set the xen pv ipi ops to replace the native ones */
+	if (xen_hvm_domain())
+		apic_ops.ipi_vectored = xen_pv_lapic_ipi_vectored;
+}
+
+/* We need to setup IPIs before APs are started */
+SYSINIT(xen_setup_cpus, SI_SUB_SMP-1, SI_ORDER_FIRST, xen_setup_cpus, NULL);
+#endif /* SMP */

Added: head/sys/x86/xen/xen_nexus.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/x86/xen/xen_nexus.c	Mon Jun 16 08:54:04 2014	(r267536)
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2013 Roger Pau Monné 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+/*
+ * Xen nexus(4) driver.
+ */
+static int
+nexus_xen_probe(device_t dev)
+{
+
+	if (!xen_pv_domain())
+		return (ENXIO);
+
+	return (BUS_PROBE_DEFAULT);
+}
+
+static int
+nexus_xen_attach(device_t dev)
+{
+
+	nexus_init_resources();
+	bus_generic_probe(dev);
+	bus_generic_attach(dev);
+
+	return (0);
+}
+
+static device_method_t nexus_xen_methods[] = {
+	/* Device interface */
+	DEVMETHOD(device_probe,		nexus_xen_probe),
+	DEVMETHOD(device_attach,	nexus_xen_attach),
+
+	{ 0, 0 }
+};
+
+DEFINE_CLASS_1(nexus, nexus_xen_driver, nexus_xen_methods, 1, nexus_driver);
+static devclass_t nexus_devclass;
+
+DRIVER_MODULE(nexus_xen, root, nexus_xen_driver, nexus_devclass, 0, 0);

Added: head/sys/x86/xen/xenpv.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/x86/xen/xenpv.c	Mon Jun 16 08:54:04 2014	(r267536)
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2014 Roger Pau Monné 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+static devclass_t xenpv_devclass;
+
+static void
+xenpv_identify(driver_t *driver, device_t parent)
+{
+	if (!xen_domain())
+		return;
+
+	/* Make sure there's only one xenpv device. */
+	if (devclass_get_device(xenpv_devclass, 0))
+		return;
+
+	if (BUS_ADD_CHILD(parent, 0, "xenpv", 0) == NULL)
+		panic("Unable to attach xenpv bus.");
+}
+
+static int
+xenpv_probe(device_t dev)
+{
+
+	device_set_desc(dev, "Xen PV bus");
+	return (BUS_PROBE_NOWILDCARD);
+}
+
+static int
+xenpv_attach(device_t dev)
+{
+	device_t child;
+	int error;
+
+	/* Initialize grant table before any Xen specific device is attached */
+	error = gnttab_init(dev);
+	if (error != 0) {
+		device_printf(dev, "error initializing grant table: %d\n",
+		    error);
+		return (error);
+	}
+
+	/*
+	 * Let our child drivers identify any child devices that they
+	 * can find.  Once that is done attach any devices that we
+	 * found.
+	 */
+	bus_generic_probe(dev);
+	bus_generic_attach(dev);
+
+	if (!devclass_get_device(devclass_find("isa"), 0)) {
+		child = BUS_ADD_CHILD(dev, 0, "isa", 0);
+		if (child == NULL)
+			panic("Failed to attach ISA bus.");
+		device_probe_and_attach(child);
+	}
+
+	return (0);
+}
+
+static device_method_t xenpv_methods[] = {
+	/* Device interface */
+	DEVMETHOD(device_identify,		xenpv_identify),
+	DEVMETHOD(device_probe,			xenpv_probe),
+	DEVMETHOD(device_attach,		xenpv_attach),
+	DEVMETHOD(device_suspend,		bus_generic_suspend),
+	DEVMETHOD(device_resume,		bus_generic_resume),
+
+	/* Bus interface */
+	DEVMETHOD(bus_add_child,		bus_generic_add_child),
+	DEVMETHOD(bus_alloc_resource,		bus_generic_alloc_resource),
+	DEVMETHOD(bus_release_resource,		bus_generic_release_resource),
+	DEVMETHOD(bus_activate_resource,	bus_generic_activate_resource),
+	DEVMETHOD(bus_deactivate_resource,	bus_generic_deactivate_resource),
+
+	DEVMETHOD_END
+};
+
+static driver_t xenpv_driver = {
+	"xenpv",
+	xenpv_methods,
+	0,
+};
+
+DRIVER_MODULE(xenpv, nexus, xenpv_driver, xenpv_devclass, 0, 0);

Added: head/sys/xen/xen_pv.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/xen/xen_pv.h	Mon Jun 16 08:54:04 2014	(r267536)
@@ -0,0 +1,34 @@
+/*-
+ * Copyright (c) 2014 Roger Pau Monné 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef __XEN_PV_H__
+#define __XEN_PV_H__
+
+extern struct apic_ops xen_apic_ops;
+
+#endif

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 11:00:17 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1E150A04;
 Mon, 16 Jun 2014 11:00:17 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 09FEE233C;
 Mon, 16 Jun 2014 11:00:17 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5GB0HsZ035159;
 Mon, 16 Jun 2014 11:00:17 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5GB0FxY035141;
 Mon, 16 Jun 2014 11:00:15 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406161100.s5GB0FxY035141@svn.freebsd.org>
From: Alexander Motin 
Date: Mon, 16 Jun 2014 11:00:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267537 - in head/sys/cam: ctl scsi
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 11:00:17 -0000

Author: mav
Date: Mon Jun 16 11:00:14 2014
New Revision: 267537
URL: http://svnweb.freebsd.org/changeset/base/267537

Log:
  Add support for VERIFY(10/12/16) and COMPARE AND WRITE SCSI commands.
  
  Make data_submit backends method support not only read and write requests,
  but also two new ones: verify and compare.  Verify just checks readability
  of the data in specified location without transferring them outside.
  Compare reads the specified data and compares them to received data,
  returning error if they are different.
  
  VERIFY(10/12/16) commands request either verify or compare from backend,
  depending on BYTCHK CDB field.  COMPARE AND WRITE command executed in two
  stages: first it requests compare, and then, if succeesed, requests write.
  Atomicity of operation is guarantied by CTL request ordering code.
  
  MFC after:	2 weeks
  Sponsored by:	iXsystems, Inc.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl.h
  head/sys/cam/ctl/ctl_backend_block.c
  head/sys/cam/ctl/ctl_backend_ramdisk.c
  head/sys/cam/ctl/ctl_cmd_table.c
  head/sys/cam/ctl/ctl_io.h
  head/sys/cam/ctl/ctl_private.h
  head/sys/cam/scsi/scsi_all.c
  head/sys/cam/scsi/scsi_all.h
  head/sys/cam/scsi/scsi_da.h

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Mon Jun 16 08:54:04 2014	(r267536)
+++ head/sys/cam/ctl/ctl.c	Mon Jun 16 11:00:14 2014	(r267537)
@@ -4996,6 +4996,30 @@ bailout:
 
 /*
  * This gets called by a backend driver when it is done with a
+ * data_submit method.
+ */
+void
+ctl_data_submit_done(union ctl_io *io)
+{
+	/*
+	 * If the IO_CONT flag is set, we need to call the supplied
+	 * function to continue processing the I/O, instead of completing
+	 * the I/O just yet.
+	 *
+	 * If there is an error, though, we don't want to keep processing.
+	 * Instead, just send status back to the initiator.
+	 */
+	if ((io->io_hdr.flags & CTL_FLAG_IO_CONT)
+	 && (((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)
+	  || ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS))) {
+		io->scsiio.io_cont(io);
+		return;
+	}
+	ctl_done(io);
+}
+
+/*
+ * This gets called by a backend driver when it is done with a
  * configuration write.
  */
 void
@@ -8582,7 +8606,7 @@ int
 ctl_read_write(struct ctl_scsiio *ctsio)
 {
 	struct ctl_lun *lun;
-	struct ctl_lba_len lbalen;
+	struct ctl_lba_len_flags *lbalen;
 	uint64_t lba;
 	uint32_t num_blocks;
 	int reladdr, fua, dpo, ebp;
@@ -8793,10 +8817,11 @@ ctl_read_write(struct ctl_scsiio *ctsio)
 		return (CTL_RETVAL_COMPLETE);
 	}
 
-	lbalen.lba = lba;
-	lbalen.len = num_blocks;
-	memcpy(ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, &lbalen,
-	       sizeof(lbalen));
+	lbalen = (struct ctl_lba_len_flags *)
+	    &ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
+	lbalen->lba = lba;
+	lbalen->len = num_blocks;
+	lbalen->flags = isread ? CTL_LLF_READ : CTL_LLF_WRITE;
 
 	ctsio->kern_total_len = num_blocks * lun->be_lun->blocksize;
 	ctsio->kern_rel_offset = 0;
@@ -8808,6 +8833,228 @@ ctl_read_write(struct ctl_scsiio *ctsio)
 	return (retval);
 }
 
+static int
+ctl_cnw_cont(union ctl_io *io)
+{
+	struct ctl_scsiio *ctsio;
+	struct ctl_lun *lun;
+	struct ctl_lba_len_flags *lbalen;
+	int retval;
+
+	ctsio = &io->scsiio;
+	ctsio->io_hdr.status = CTL_STATUS_NONE;
+	ctsio->io_hdr.flags &= ~CTL_FLAG_IO_CONT;
+	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
+	lbalen = (struct ctl_lba_len_flags *)
+	    &ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
+	lbalen->flags = CTL_LLF_WRITE;
+
+	CTL_DEBUG_PRINT(("ctl_cnw_cont: calling data_submit()\n"));
+	retval = lun->backend->data_submit((union ctl_io *)ctsio);
+	return (retval);
+}
+
+int
+ctl_cnw(struct ctl_scsiio *ctsio)
+{
+	struct ctl_lun *lun;
+	struct ctl_lba_len_flags *lbalen;
+	uint64_t lba;
+	uint32_t num_blocks;
+	int fua, dpo;
+	int retval;
+
+	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
+
+	CTL_DEBUG_PRINT(("ctl_cnw: command: %#x\n", ctsio->cdb[0]));
+
+	fua = 0;
+	dpo = 0;
+
+	retval = CTL_RETVAL_COMPLETE;
+
+	switch (ctsio->cdb[0]) {
+	case COMPARE_AND_WRITE: {
+		struct scsi_compare_and_write *cdb;
+
+		cdb = (struct scsi_compare_and_write *)ctsio->cdb;
+
+		if (cdb->byte2 & SRW10_FUA)
+			fua = 1;
+		if (cdb->byte2 & SRW10_DPO)
+			dpo = 1;
+		lba = scsi_8btou64(cdb->addr);
+		num_blocks = cdb->length;
+		break;
+	}
+	default:
+		/*
+		 * We got a command we don't support.  This shouldn't
+		 * happen, commands should be filtered out above us.
+		 */
+		ctl_set_invalid_opcode(ctsio);
+		ctl_done((union ctl_io *)ctsio);
+
+		return (CTL_RETVAL_COMPLETE);
+		break; /* NOTREACHED */
+	}
+
+	/*
+	 * XXX KDM what do we do with the DPO and FUA bits?  FUA might be
+	 * interesting for us, but if RAIDCore is in write-back mode,
+	 * getting it to do write-through for a particular transaction may
+	 * not be possible.
+	 */
+
+	/*
+	 * The first check is to make sure we're in bounds, the second
+	 * check is to catch wrap-around problems.  If the lba + num blocks
+	 * is less than the lba, then we've wrapped around and the block
+	 * range is invalid anyway.
+	 */
+	if (((lba + num_blocks) > (lun->be_lun->maxlba + 1))
+	 || ((lba + num_blocks) < lba)) {
+		ctl_set_lba_out_of_range(ctsio);
+		ctl_done((union ctl_io *)ctsio);
+		return (CTL_RETVAL_COMPLETE);
+	}
+
+	/*
+	 * According to SBC-3, a transfer length of 0 is not an error.
+	 */
+	if (num_blocks == 0) {
+		ctl_set_success(ctsio);
+		ctl_done((union ctl_io *)ctsio);
+		return (CTL_RETVAL_COMPLETE);
+	}
+
+	ctsio->kern_total_len = 2 * num_blocks * lun->be_lun->blocksize;
+	ctsio->kern_rel_offset = 0;
+
+	/*
+	 * Set the IO_CONT flag, so that if this I/O gets passed to
+	 * ctl_data_submit_done(), it'll get passed back to
+	 * ctl_ctl_cnw_cont() for further processing.
+	 */
+	ctsio->io_hdr.flags |= CTL_FLAG_IO_CONT;
+	ctsio->io_cont = ctl_cnw_cont;
+
+	lbalen = (struct ctl_lba_len_flags *)
+	    &ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
+	lbalen->lba = lba;
+	lbalen->len = num_blocks;
+	lbalen->flags = CTL_LLF_COMPARE;
+
+	CTL_DEBUG_PRINT(("ctl_cnw: calling data_submit()\n"));
+	retval = lun->backend->data_submit((union ctl_io *)ctsio);
+	return (retval);
+}
+
+int
+ctl_verify(struct ctl_scsiio *ctsio)
+{
+	struct ctl_lun *lun;
+	struct ctl_lba_len_flags *lbalen;
+	uint64_t lba;
+	uint32_t num_blocks;
+	int bytchk, dpo;
+	int retval;
+
+	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
+
+	CTL_DEBUG_PRINT(("ctl_verify: command: %#x\n", ctsio->cdb[0]));
+
+	bytchk = 0;
+	dpo = 0;
+	retval = CTL_RETVAL_COMPLETE;
+
+	switch (ctsio->cdb[0]) {
+	case VERIFY_10: {
+		struct scsi_verify_10 *cdb;
+
+		cdb = (struct scsi_verify_10 *)ctsio->cdb;
+		if (cdb->byte2 & SVFY_BYTCHK)
+			bytchk = 1;
+		if (cdb->byte2 & SVFY_DPO)
+			dpo = 1;
+		lba = scsi_4btoul(cdb->addr);
+		num_blocks = scsi_2btoul(cdb->length);
+		break;
+	}
+	case VERIFY_12: {
+		struct scsi_verify_12 *cdb;
+
+		cdb = (struct scsi_verify_12 *)ctsio->cdb;
+		if (cdb->byte2 & SVFY_BYTCHK)
+			bytchk = 1;
+		if (cdb->byte2 & SVFY_DPO)
+			dpo = 1;
+		lba = scsi_4btoul(cdb->addr);
+		num_blocks = scsi_4btoul(cdb->length);
+		break;
+	}
+	case VERIFY_16: {
+		struct scsi_rw_16 *cdb;
+
+		cdb = (struct scsi_rw_16 *)ctsio->cdb;
+		if (cdb->byte2 & SVFY_BYTCHK)
+			bytchk = 1;
+		if (cdb->byte2 & SVFY_DPO)
+			dpo = 1;
+		lba = scsi_8btou64(cdb->addr);
+		num_blocks = scsi_4btoul(cdb->length);
+		break;
+	}
+	default:
+		/*
+		 * We got a command we don't support.  This shouldn't
+		 * happen, commands should be filtered out above us.
+		 */
+		ctl_set_invalid_opcode(ctsio);
+		ctl_done((union ctl_io *)ctsio);
+		return (CTL_RETVAL_COMPLETE);
+	}
+
+	/*
+	 * The first check is to make sure we're in bounds, the second
+	 * check is to catch wrap-around problems.  If the lba + num blocks
+	 * is less than the lba, then we've wrapped around and the block
+	 * range is invalid anyway.
+	 */
+	if (((lba + num_blocks) > (lun->be_lun->maxlba + 1))
+	 || ((lba + num_blocks) < lba)) {
+		ctl_set_lba_out_of_range(ctsio);
+		ctl_done((union ctl_io *)ctsio);
+		return (CTL_RETVAL_COMPLETE);
+	}
+
+	/*
+	 * According to SBC-3, a transfer length of 0 is not an error.
+	 */
+	if (num_blocks == 0) {
+		ctl_set_success(ctsio);
+		ctl_done((union ctl_io *)ctsio);
+		return (CTL_RETVAL_COMPLETE);
+	}
+
+	lbalen = (struct ctl_lba_len_flags *)
+	    &ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
+	lbalen->lba = lba;
+	lbalen->len = num_blocks;
+	if (bytchk) {
+		lbalen->flags = CTL_LLF_COMPARE;
+		ctsio->kern_total_len = num_blocks * lun->be_lun->blocksize;
+	} else {
+		lbalen->flags = CTL_LLF_VERIFY;
+		ctsio->kern_total_len = 0;
+	}
+	ctsio->kern_rel_offset = 0;
+
+	CTL_DEBUG_PRINT(("ctl_verify: calling data_submit()\n"));
+	retval = lun->backend->data_submit((union ctl_io *)ctsio);
+	return (retval);
+}
+
 int
 ctl_report_luns(struct ctl_scsiio *ctsio)
 {
@@ -9526,6 +9773,7 @@ ctl_inquiry_evpd_block_limits(struct ctl
 
 	bl_ptr->page_code = SVPD_BLOCK_LIMITS;
 	scsi_ulto2b(sizeof(*bl_ptr), bl_ptr->page_length);
+	bl_ptr->max_cmp_write_len = 0xff;
 	scsi_ulto4b(0xffffffff, bl_ptr->max_txfer_len);
 	scsi_ulto4b(MAXPHYS / bs, bl_ptr->opt_txfer_len);
 	if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) {
@@ -9937,6 +10185,15 @@ ctl_get_lba_len(union ctl_io *io, uint64
 		return (1);
 
 	switch (io->scsiio.cdb[0]) {
+	case COMPARE_AND_WRITE: {
+		struct scsi_compare_and_write *cdb;
+
+		cdb = (struct scsi_compare_and_write *)io->scsiio.cdb;
+
+		*lba = scsi_8btou64(cdb->addr);
+		*len = cdb->length;
+		break;
+	}
 	case READ_6:
 	case WRITE_6: {
 		struct scsi_rw_6 *cdb;
@@ -10025,6 +10282,33 @@ ctl_get_lba_len(union ctl_io *io, uint64
 		*len = scsi_4btoul(cdb->length);
 		break;
 	}
+	case VERIFY_10: {
+		struct scsi_verify_10 *cdb;
+
+		cdb = (struct scsi_verify_10 *)io->scsiio.cdb;
+
+		*lba = scsi_4btoul(cdb->addr);
+		*len = scsi_2btoul(cdb->length);
+		break;
+	}
+	case VERIFY_12: {
+		struct scsi_verify_12 *cdb;
+
+		cdb = (struct scsi_verify_12 *)io->scsiio.cdb;
+
+		*lba = scsi_4btoul(cdb->addr);
+		*len = scsi_4btoul(cdb->length);
+		break;
+	}
+	case VERIFY_16: {
+		struct scsi_verify_16 *cdb;
+
+		cdb = (struct scsi_verify_16 *)io->scsiio.cdb;
+
+		*lba = scsi_8btou64(cdb->addr);
+		*len = scsi_4btoul(cdb->length);
+		break;
+	}
 	default:
 		return (1);
 		break; /* NOTREACHED */
@@ -12753,7 +13037,7 @@ ctl_process_done(union ctl_io *io, int h
 		switch (io->io_hdr.io_type) {
 		case CTL_IO_SCSI: {
 			int isread;
-			struct ctl_lba_len *lbalen;
+			struct ctl_lba_len_flags *lbalen;
 
 			isread = 0;
 			switch (io->scsiio.cdb[0]) {
@@ -12770,7 +13054,7 @@ ctl_process_done(union ctl_io *io, int h
 			case WRITE_VERIFY_10:
 			case WRITE_VERIFY_12:
 			case WRITE_VERIFY_16:
-				lbalen = (struct ctl_lba_len *)
+				lbalen = (struct ctl_lba_len_flags *)
 				    &io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
 
 				if (isread) {

Modified: head/sys/cam/ctl/ctl.h
==============================================================================
--- head/sys/cam/ctl/ctl.h	Mon Jun 16 08:54:04 2014	(r267536)
+++ head/sys/cam/ctl/ctl.h	Mon Jun 16 11:00:14 2014	(r267537)
@@ -195,6 +195,7 @@ int ctl_debugconf_sp_select_handler(stru
 int ctl_config_move_done(union ctl_io *io);
 void ctl_datamove(union ctl_io *io);
 void ctl_done(union ctl_io *io);
+void ctl_data_submit_done(union ctl_io *io);
 void ctl_config_write_done(union ctl_io *io);
 #if 0
 int ctl_thread(void *arg);

Modified: head/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_block.c	Mon Jun 16 08:54:04 2014	(r267536)
+++ head/sys/cam/ctl/ctl_backend_block.c	Mon Jun 16 11:00:14 2014	(r267537)
@@ -92,9 +92,11 @@ __FBSDID("$FreeBSD$");
  * The idea here is that we'll allocate enough S/G space to hold a 1MB
  * I/O.  If we get an I/O larger than that, we'll split it.
  */
-#define	CTLBLK_MAX_IO_SIZE	(1024 * 1024)
+#define	CTLBLK_HALF_IO_SIZE	(512 * 1024)
+#define	CTLBLK_MAX_IO_SIZE	(CTLBLK_HALF_IO_SIZE * 2)
 #define	CTLBLK_MAX_SEG		MAXPHYS
-#define	CTLBLK_MAX_SEGS		MAX(CTLBLK_MAX_IO_SIZE / CTLBLK_MAX_SEG, 1)
+#define	CTLBLK_HALF_SEGS	MAX(CTLBLK_HALF_IO_SIZE / CTLBLK_MAX_SEG, 1)
+#define	CTLBLK_MAX_SEGS		(CTLBLK_HALF_SEGS * 2)
 
 #ifdef CTLBLK_DEBUG
 #define DPRINTF(fmt, args...) \
@@ -105,6 +107,8 @@ __FBSDID("$FreeBSD$");
 
 #define PRIV(io)	\
     ((struct ctl_ptr_len_flags *)&(io)->io_hdr.ctl_private[CTL_PRIV_BACKEND])
+#define ARGS(io)	\
+    ((struct ctl_lba_len_flags *)&(io)->io_hdr.ctl_private[CTL_PRIV_LBA_LEN])
 
 SDT_PROVIDER_DEFINE(cbb);
 
@@ -312,6 +316,13 @@ ctl_free_beio(struct ctl_be_block_io *be
 
 		uma_zfree(beio->lun->lun_zone, beio->sg_segs[i].addr);
 		beio->sg_segs[i].addr = NULL;
+
+		/* For compare we had two equal S/G lists. */
+		if (ARGS(beio->io)->flags & CTL_LLF_COMPARE) {
+			uma_zfree(beio->lun->lun_zone,
+			    beio->sg_segs[i + CTLBLK_HALF_SEGS].addr);
+			beio->sg_segs[i + CTLBLK_HALF_SEGS].addr = NULL;
+		}
 	}
 
 	if (duplicate_free > 0) {
@@ -346,7 +357,7 @@ ctl_complete_beio(struct ctl_be_block_io
 		beio->beio_cont(beio);
 	} else {
 		ctl_free_beio(beio);
-		ctl_done(io);
+		ctl_data_submit_done(io);
 	}
 }
 
@@ -355,9 +366,11 @@ ctl_be_block_move_done(union ctl_io *io)
 {
 	struct ctl_be_block_io *beio;
 	struct ctl_be_block_lun *be_lun;
+	struct ctl_lba_len_flags *lbalen;
 #ifdef CTL_TIME_IO
 	struct bintime cur_bt;
-#endif  
+#endif
+	int i;
 
 	beio = (struct ctl_be_block_io *)PRIV(io)->ptr;
 	be_lun = beio->lun;
@@ -370,16 +383,37 @@ ctl_be_block_move_done(union ctl_io *io)
 	bintime_add(&io->io_hdr.dma_bt, &cur_bt);
 	io->io_hdr.num_dmas++;
 #endif  
+	io->scsiio.kern_rel_offset += io->scsiio.kern_data_len;
 
 	/*
 	 * We set status at this point for read commands, and write
 	 * commands with errors.
 	 */
-	if ((beio->bio_cmd == BIO_READ)
-	 && (io->io_hdr.port_status == 0)
-	 && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0)
-	 && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE))
-		ctl_set_success(&io->scsiio);
+	if ((io->io_hdr.port_status == 0) &&
+	    ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0) &&
+	    ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) {
+		lbalen = ARGS(beio->io);
+		if (lbalen->flags & CTL_LLF_READ) {
+			ctl_set_success(&io->scsiio);
+		} else if (lbalen->flags & CTL_LLF_COMPARE) {
+			/* We have two data blocks ready for comparison. */
+			for (i = 0; i < beio->num_segs; i++) {
+				if (memcmp(beio->sg_segs[i].addr,
+				    beio->sg_segs[i + CTLBLK_HALF_SEGS].addr,
+				    beio->sg_segs[i].len) != 0)
+					break;
+			}
+			if (i < beio->num_segs)
+				ctl_set_sense(&io->scsiio,
+				    /*current_error*/ 1,
+				    /*sense_key*/ SSD_KEY_MISCOMPARE,
+				    /*asc*/ 0x1D,
+				    /*ascq*/ 0x00,
+				    SSD_ELEM_NONE);
+			else
+				ctl_set_success(&io->scsiio);
+		}
+	}
 	else if ((io->io_hdr.port_status != 0)
 	      && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0)
 	      && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) {
@@ -491,12 +525,13 @@ ctl_be_block_biodone(struct bio *bio)
 	}
 
 	/*
-	 * If this is a write, a flush or a delete, we're all done.
+	 * If this is a write, a flush, a delete or verify, we're all done.
 	 * If this is a read, we can now send the data to the user.
 	 */
 	if ((beio->bio_cmd == BIO_WRITE)
 	 || (beio->bio_cmd == BIO_FLUSH)
-	 || (beio->bio_cmd == BIO_DELETE)) {
+	 || (beio->bio_cmd == BIO_DELETE)
+	 || (ARGS(io)->flags & CTL_LLF_VERIFY)) {
 		ctl_set_success(&io->scsiio);
 		ctl_complete_beio(beio);
 	} else {
@@ -572,18 +607,14 @@ ctl_be_block_dispatch_file(struct ctl_be
 	io = beio->io;
 	flags = beio->bio_flags;
 
+	bzero(&xuio, sizeof(xuio));
 	if (beio->bio_cmd == BIO_READ) {
 		SDT_PROBE(cbb, kernel, read, file_start, 0, 0, 0, 0, 0);
+		xuio.uio_rw = UIO_READ;
 	} else {
 		SDT_PROBE(cbb, kernel, write, file_start, 0, 0, 0, 0, 0);
-	}
-
-	bzero(&xuio, sizeof(xuio));
-	if (beio->bio_cmd == BIO_READ)
-		xuio.uio_rw = UIO_READ;
-	else
 		xuio.uio_rw = UIO_WRITE;
-
+	}
 	xuio.uio_offset = beio->io_offset;
 	xuio.uio_resid = beio->io_len;
 	xuio.uio_segflg = UIO_SYSSPACE;
@@ -626,6 +657,7 @@ ctl_be_block_dispatch_file(struct ctl_be
 				 (IO_DIRECT|IO_SYNC) : 0, file_data->cred);
 
 		VOP_UNLOCK(be_lun->vn, 0);
+		SDT_PROBE(cbb, kernel, read, file_done, 0, 0, 0, 0, 0);
 	} else {
 		struct mount *mountpoint;
 		int lock_flags;
@@ -667,6 +699,7 @@ ctl_be_block_dispatch_file(struct ctl_be
 		VOP_UNLOCK(be_lun->vn, 0);
 
 		vn_finished_write(mountpoint);
+		SDT_PROBE(cbb, kernel, write, file_done, 0, 0, 0, 0, 0);
         }
 
 	/*
@@ -693,12 +726,10 @@ ctl_be_block_dispatch_file(struct ctl_be
 	 * If this is a write, we're all done.
 	 * If this is a read, we can now send the data to the user.
 	 */
-	if (beio->bio_cmd == BIO_WRITE) {
+	if (ARGS(io)->flags & (CTL_LLF_WRITE | CTL_LLF_VERIFY)) {
 		ctl_set_success(&io->scsiio);
-		SDT_PROBE(cbb, kernel, write, file_done, 0, 0, 0, 0, 0);
 		ctl_complete_beio(beio);
 	} else {
-		SDT_PROBE(cbb, kernel, read, file_done, 0, 0, 0, 0, 0);
 #ifdef CTL_TIME_IO
         	getbintime(&io->io_hdr.dma_start_bt);
 #endif  
@@ -935,7 +966,7 @@ ctl_be_block_cw_dispatch_ws(struct ctl_b
 
 	beio = (struct ctl_be_block_io *)PRIV(io)->ptr;
 	softc = be_lun->softc;
-	lbalen = (struct ctl_lba_len_flags *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
+	lbalen = ARGS(beio->io);
 
 	if (lbalen->flags & ~(SWS_LBDATA | SWS_UNMAP) ||
 	    (lbalen->flags & SWS_UNMAP && be_lun->unmap == NULL)) {
@@ -1155,11 +1186,10 @@ ctl_be_block_next(struct ctl_be_block_io
 	ctl_free_beio(beio);
 	if (((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE)
 	  && ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)) {
-		ctl_done(io);
+		ctl_data_submit_done(io);
 		return;
 	}
 
-	io->scsiio.kern_rel_offset += io->scsiio.kern_data_len;
 	io->io_hdr.status &= ~CTL_STATUS_MASK;
 	io->io_hdr.status |= CTL_STATUS_NONE;
 
@@ -1181,7 +1211,7 @@ ctl_be_block_dispatch(struct ctl_be_bloc
 {
 	struct ctl_be_block_io *beio;
 	struct ctl_be_block_softc *softc;
-	struct ctl_lba_len *lbalen;
+	struct ctl_lba_len_flags *lbalen;
 	struct ctl_ptr_len_flags *bptrlen;
 	uint64_t len_left, lbas;
 	int i;
@@ -1190,10 +1220,11 @@ ctl_be_block_dispatch(struct ctl_be_bloc
 
 	DPRINTF("entered\n");
 
-	if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN) {
-		SDT_PROBE(cbb, kernel, read, start, 0, 0, 0, 0, 0);
-	} else {
+	lbalen = ARGS(io);
+	if (lbalen->flags & CTL_LLF_WRITE) {
 		SDT_PROBE(cbb, kernel, write, start, 0, 0, 0, 0, 0);
+	} else {
+		SDT_PROBE(cbb, kernel, read, start, 0, 0, 0, 0, 0);
 	}
 
 	beio = ctl_alloc_beio(softc);
@@ -1231,24 +1262,22 @@ ctl_be_block_dispatch(struct ctl_be_bloc
 		break;
 	}
 
-	/*
-	 * This path handles read and write only.  The config write path
-	 * handles flush operations.
-	 */
-	if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN) {
-		beio->bio_cmd = BIO_READ;
-		beio->ds_trans_type = DEVSTAT_READ;
-	} else {
+	if (lbalen->flags & CTL_LLF_WRITE) {
 		beio->bio_cmd = BIO_WRITE;
 		beio->ds_trans_type = DEVSTAT_WRITE;
+	} else {
+		beio->bio_cmd = BIO_READ;
+		beio->ds_trans_type = DEVSTAT_READ;
 	}
 
-	lbalen = (struct ctl_lba_len *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
 	DPRINTF("%s at LBA %jx len %u @%ju\n",
 	       (beio->bio_cmd == BIO_READ) ? "READ" : "WRITE",
 	       (uintmax_t)lbalen->lba, lbalen->len, bptrlen->len);
-	lbas = MIN(lbalen->len - bptrlen->len,
-	    CTLBLK_MAX_IO_SIZE / be_lun->blocksize);
+	if (lbalen->flags & CTL_LLF_COMPARE)
+		lbas = CTLBLK_HALF_IO_SIZE;
+	else
+		lbas = CTLBLK_MAX_IO_SIZE;
+	lbas = MIN(lbalen->len - bptrlen->len, lbas / be_lun->blocksize);
 	beio->io_offset = (lbalen->lba + bptrlen->len) * be_lun->blocksize;
 	beio->io_len = lbas * be_lun->blocksize;
 	bptrlen->len += lbas;
@@ -1266,13 +1295,25 @@ ctl_be_block_dispatch(struct ctl_be_bloc
 		DPRINTF("segment %d addr %p len %zd\n", i,
 			beio->sg_segs[i].addr, beio->sg_segs[i].len);
 
+		/* Set up second segment for compare operation. */
+		if (lbalen->flags & CTL_LLF_COMPARE) {
+			beio->sg_segs[i + CTLBLK_HALF_SEGS].len =
+			    beio->sg_segs[i].len;
+			beio->sg_segs[i + CTLBLK_HALF_SEGS].addr =
+			    uma_zalloc(be_lun->lun_zone, M_WAITOK);
+		}
+
 		beio->num_segs++;
 		len_left -= beio->sg_segs[i].len;
 	}
 	if (bptrlen->len < lbalen->len)
 		beio->beio_cont = ctl_be_block_next;
 	io->scsiio.be_move_done = ctl_be_block_move_done;
-	io->scsiio.kern_data_ptr = (uint8_t *)beio->sg_segs;
+	/* For compare we have separate S/G lists for read and datamove. */
+	if (lbalen->flags & CTL_LLF_COMPARE)
+		io->scsiio.kern_data_ptr = (uint8_t *)&beio->sg_segs[CTLBLK_HALF_SEGS];
+	else
+		io->scsiio.kern_data_ptr = (uint8_t *)beio->sg_segs;
 	io->scsiio.kern_data_len = beio->io_len;
 	io->scsiio.kern_data_resid = 0;
 	io->scsiio.kern_sg_entries = beio->num_segs;

Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_ramdisk.c	Mon Jun 16 08:54:04 2014	(r267536)
+++ head/sys/cam/ctl/ctl_backend_ramdisk.c	Mon Jun 16 11:00:14 2014	(r267537)
@@ -267,7 +267,7 @@ ctl_backend_ramdisk_move_done(union ctl_
 					 /*retry_count*/
 					 io->io_hdr.port_status);
 	}
-	ctl_done(io);
+	ctl_data_submit_done(io);
 	return(0);
 }
 
@@ -275,11 +275,16 @@ static int
 ctl_backend_ramdisk_submit(union ctl_io *io)
 {
 	struct ctl_be_lun *ctl_be_lun;
-	struct ctl_lba_len *lbalen;
+	struct ctl_lba_len_flags *lbalen;
 
 	ctl_be_lun = (struct ctl_be_lun *)io->io_hdr.ctl_private[
 		CTL_PRIV_BACKEND_LUN].ptr;
-	lbalen = (struct ctl_lba_len *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
+	lbalen = (struct ctl_lba_len_flags *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
+	if (lbalen->flags & CTL_LLF_VERIFY) {
+		ctl_set_success(&io->scsiio);
+		ctl_data_submit_done(io);
+		return (CTL_RETVAL_COMPLETE);
+	}
 	io->io_hdr.ctl_private[CTL_PRIV_BACKEND].integer =
 	    lbalen->len * ctl_be_lun->blocksize;
 	ctl_backend_ramdisk_continue(io);

Modified: head/sys/cam/ctl/ctl_cmd_table.c
==============================================================================
--- head/sys/cam/ctl/ctl_cmd_table.c	Mon Jun 16 08:54:04 2014	(r267536)
+++ head/sys/cam/ctl/ctl_cmd_table.c	Mon Jun 16 11:00:14 2014	(r267537)
@@ -273,7 +273,10 @@ struct ctl_cmd_entry ctl_cmd_table[] =
  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE},
 
 /* 2F VERIFY(10) */
-{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
+{ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN |
+			      CTL_FLAG_DATA_OUT |
+			      CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
+ CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE},
 
 /* 30 SEARCH DATA HIGH(10) */
 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
@@ -591,8 +594,9 @@ struct ctl_cmd_entry ctl_cmd_table[] =
                                   CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
  CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE},
 
-/* 89 */
-{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
+/* 89 COMPARE AND WRITE */
+{ctl_cnw, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN| CTL_FLAG_DATA_OUT,
+ CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE},
 
 /* 8A WRITE(16) */
 {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN| CTL_FLAG_DATA_OUT,
@@ -612,7 +616,10 @@ struct ctl_cmd_entry ctl_cmd_table[] =
  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE},
 
 /* 8F VERIFY(16) */
-{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
+{ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN |
+			      CTL_FLAG_DATA_OUT |
+			      CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
+ CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE},
 
 /* 90 PRE-FETCH(16) */
 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
@@ -737,7 +744,10 @@ struct ctl_cmd_entry ctl_cmd_table[] =
  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE},
 
 /* AF VERIFY(12) */
-{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
+{ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN |
+			      CTL_FLAG_DATA_OUT |
+			      CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
+ CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE},
 
 /* B0 SEARCH DATA HIGH(12) */
 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},

Modified: head/sys/cam/ctl/ctl_io.h
==============================================================================
--- head/sys/cam/ctl/ctl_io.h	Mon Jun 16 08:54:04 2014	(r267536)
+++ head/sys/cam/ctl/ctl_io.h	Mon Jun 16 11:00:14 2014	(r267537)
@@ -138,6 +138,10 @@ struct ctl_lba_len_flags {
 	uint64_t lba;
 	uint32_t len;
 	uint32_t flags;
+#define CTL_LLF_READ	0x10000000
+#define CTL_LLF_WRITE	0x20000000
+#define CTL_LLF_VERIFY	0x40000000
+#define CTL_LLF_COMPARE	0x80000000
 };
 
 struct ctl_ptr_len_flags {

Modified: head/sys/cam/ctl/ctl_private.h
==============================================================================
--- head/sys/cam/ctl/ctl_private.h	Mon Jun 16 08:54:04 2014	(r267536)
+++ head/sys/cam/ctl/ctl_private.h	Mon Jun 16 11:00:14 2014	(r267537)
@@ -477,9 +477,11 @@ int ctl_mode_sense(struct ctl_scsiio *ct
 int ctl_read_capacity(struct ctl_scsiio *ctsio);
 int ctl_service_action_in(struct ctl_scsiio *ctsio);
 int ctl_read_write(struct ctl_scsiio *ctsio);
+int ctl_cnw(struct ctl_scsiio *ctsio);
 int ctl_report_luns(struct ctl_scsiio *ctsio);
 int ctl_request_sense(struct ctl_scsiio *ctsio);
 int ctl_tur(struct ctl_scsiio *ctsio);
+int ctl_verify(struct ctl_scsiio *ctsio);
 int ctl_inquiry(struct ctl_scsiio *ctsio);
 int ctl_persistent_reserve_in(struct ctl_scsiio *ctsio);
 int ctl_persistent_reserve_out(struct ctl_scsiio *ctsio);

Modified: head/sys/cam/scsi/scsi_all.c
==============================================================================
--- head/sys/cam/scsi/scsi_all.c	Mon Jun 16 08:54:04 2014	(r267536)
+++ head/sys/cam/scsi/scsi_all.c	Mon Jun 16 11:00:14 2014	(r267537)
@@ -471,7 +471,8 @@ static struct op_table_entry scsi_op_cod
 	 */
 	/* 88  MM  O O   O     READ(16) */
 	{ 0x88,	D | T | W | O | B, "READ(16)" },
-	/* 89 */
+	/* 89  O               COMPARE AND WRITE*/
+	{ 0x89,	D, "COMPARE AND WRITE" },
 	/* 8A  OM  O O   O     WRITE(16) */
 	{ 0x8A,	D | T | W | O | B, "WRITE(16)" },
 	/* 8B  O               ORWRITE */

Modified: head/sys/cam/scsi/scsi_all.h
==============================================================================
--- head/sys/cam/scsi/scsi_all.h	Mon Jun 16 08:54:04 2014	(r267536)
+++ head/sys/cam/scsi/scsi_all.h	Mon Jun 16 11:00:14 2014	(r267537)
@@ -1041,8 +1041,10 @@ struct ata_pass_16 {
 #define	PERSISTENT_RES_OUT	0x5F
 #define	ATA_PASS_16		0x85
 #define	READ_16			0x88
+#define	COMPARE_AND_WRITE	0x89
 #define	WRITE_16		0x8A
 #define	WRITE_VERIFY_16		0x8E
+#define	VERIFY_16		0x8F
 #define	SYNCHRONIZE_CACHE_16	0x91
 #define	WRITE_SAME_16		0x93
 #define	SERVICE_ACTION_IN	0x9E
@@ -1054,6 +1056,7 @@ struct ata_pass_16 {
 #define	READ_12			0xA8
 #define	WRITE_12		0xAA
 #define	WRITE_VERIFY_12		0xAE
+#define	VERIFY_12		0xAF
 #define	READ_ELEMENT_STATUS	0xB8
 #define	READ_CD			0xBE
 

Modified: head/sys/cam/scsi/scsi_da.h
==============================================================================
--- head/sys/cam/scsi/scsi_da.h	Mon Jun 16 08:54:04 2014	(r267536)
+++ head/sys/cam/scsi/scsi_da.h	Mon Jun 16 11:00:14 2014	(r267537)
@@ -222,18 +222,49 @@ struct scsi_read_format_capacities
 	uint8_t	reserved1[3];
 };
 
-struct scsi_verify
+struct scsi_verify_10
 {
-	uint8_t	opcode;		/* VERIFY */
+	uint8_t	opcode;		/* VERIFY(10) */
 	uint8_t	byte2;
 #define	SVFY_LUN_MASK	0xE0
 #define	SVFY_RELADR	0x01
-#define	SVFY_BYTECHK	0x02
+#define	SVFY_BYTCHK	0x02
 #define	SVFY_DPO	0x10
 	uint8_t	addr[4];	/* LBA to begin verification at */
-	uint8_t	reserved0[1];
-	uint8_t	len[2];		/* number of blocks to verify */
-	uint8_t	reserved1[3];
+	uint8_t	group;
+	uint8_t	length[2];		/* number of blocks to verify */
+	uint8_t	control;
+};
+
+struct scsi_verify_12
+{
+	uint8_t	opcode;		/* VERIFY(12) */
+	uint8_t	byte2;
+	uint8_t	addr[4];	/* LBA to begin verification at */
+	uint8_t	length[4];		/* number of blocks to verify */
+	uint8_t	group;
+	uint8_t	control;
+};
+
+struct scsi_verify_16
+{
+	uint8_t	opcode;		/* VERIFY(16) */
+	uint8_t	byte2;
+	uint8_t	addr[8];	/* LBA to begin verification at */
+	uint8_t	length[4];		/* number of blocks to verify */
+	uint8_t	group;
+	uint8_t	control;
+};
+
+struct scsi_compare_and_write
+{
+	uint8_t	opcode;		/* COMPARE AND WRITE */
+	uint8_t	byte2;
+	uint8_t	addr[8];	/* LBA to begin verification at */
+	uint8_t	reserved[3];
+	uint8_t	length;		/* number of blocks */
+	uint8_t	group;
+	uint8_t	control;
 };
 
 struct scsi_write_and_verify

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 12:21:13 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id EBCC8A42;
 Mon, 16 Jun 2014 12:21:13 +0000 (UTC)
Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 70D4B2AD0;
 Mon, 16 Jun 2014 12:21:13 +0000 (UTC)
Received: from cell.glebius.int.ru (localhost [127.0.0.1])
 by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s5GCLBAP000110
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Mon, 16 Jun 2014 16:21:11 +0400 (MSK)
 (envelope-from glebius@FreeBSD.org)
Received: (from glebius@localhost)
 by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s5GCLBDP000109;
 Mon, 16 Jun 2014 16:21:11 +0400 (MSK)
 (envelope-from glebius@FreeBSD.org)
X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to
 glebius@FreeBSD.org using -f
Date: Mon, 16 Jun 2014 16:21:11 +0400
From: Gleb Smirnoff 
To: "Andrey V. Elsukov" 
Subject: Re: svn commit: r267357 - head/sys/geom/part
Message-ID: <20140616122111.GE28199@FreeBSD.org>
References: <201406111019.s5BAJBjW085880@svn.freebsd.org>
 
 <53995119.5040609@FreeBSD.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <53995119.5040609@FreeBSD.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Dmitry Morozovsky 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 12:21:14 -0000

On Thu, Jun 12, 2014 at 11:04:57AM +0400, Andrey V. Elsukov wrote:
A> On 11.06.2014 17:48, Dmitry Morozovsky wrote:
A> > On Wed, 11 Jun 2014, Andrey V. Elsukov wrote:
A> > 
A> >> Author: ae
A> >> Date: Wed Jun 11 10:19:11 2014
A> >> New Revision: 267357
A> >> URL: http://svnweb.freebsd.org/changeset/base/267357
A> >>
A> >> Log:
A> >>   Add aliases for DragonFlyBSD's partition types.
A> > 
A> > These should be documented in sbin/geom/class/part/gpart.8 also.
A> 
A> I don't think we should document partition types for all foreign
A> systems. gpart(8) exists only in FreeBSD and it's purpose manage
A> partitions in FreeBSD. We already have a lot of NetBSD's and Apple's
A> aliases that aren't documented, but nobody complained about that.

I did! :)

-- 
Totus tuus, Glebius.

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 12:32:00 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4719E9F;
 Mon, 16 Jun 2014 12:32:00 +0000 (UTC)
Received: from mail-wg0-x22b.google.com (mail-wg0-x22b.google.com
 [IPv6:2a00:1450:400c:c00::22b])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 3F6652C43;
 Mon, 16 Jun 2014 12:31:59 +0000 (UTC)
Received: by mail-wg0-f43.google.com with SMTP id b13so5381321wgh.26
 for ; Mon, 16 Jun 2014 05:31:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=N4t3PorTo121S0mxr/PteqAokiiyMr6biUjXv7fSPd0=;
 b=0ueM+azgX08gWqGhB7Tf/98th6ipzQz4/5NnvoOyT0sstgCA1BG1hAACN1bsGipVKL
 nvl39xzSpE0mlHiyinKMfz+GOl9l71oArmAPSduh2gGkagqcEjWXE2aLT2K221488cqD
 8Mr4eZY3kQkww7oZe00C+DTNG5XqtVXpBxNf8eS/v711vhldlMVZbvyKr2AkagHglGwv
 /pcGqHOkGfrWpMawXWt5qS7LCYaiP4LkHIv28DnWg1Dj3NIG/s3xFVfw892yU7tE4Adu
 a4Tew2U4/T5HX5iJ/dpCeuctUhJefOkG79UDY0Y46Dlac5MKUZwY3iC8tLKQvUhuO292
 3fGQ==
X-Received: by 10.180.84.132 with SMTP id z4mr27520347wiy.14.1402921917015;
 Mon, 16 Jun 2014 05:31:57 -0700 (PDT)
Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1])
 by mx.google.com with ESMTPSA id wj4sm18553517wjc.23.2014.06.16.05.31.55
 for 
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 16 Jun 2014 05:31:56 -0700 (PDT)
Sender: Baptiste Daroussin 
Date: Mon, 16 Jun 2014 14:31:54 +0200
From: Baptiste Daroussin 
To: Gleb Smirnoff 
Subject: Re: svn commit: r267357 - head/sys/geom/part
Message-ID: <20140616123153.GM4747@ivaldir.etoilebsd.net>
References: <201406111019.s5BAJBjW085880@svn.freebsd.org>
 
 <53995119.5040609@FreeBSD.org> <20140616122111.GE28199@FreeBSD.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="vdqwC0msT4ilQ2it"
Content-Disposition: inline
In-Reply-To: <20140616122111.GE28199@FreeBSD.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: svn-src-head@freebsd.org, "Andrey V. Elsukov" ,
 svn-src-all@freebsd.org, src-committers@freebsd.org,
 Dmitry Morozovsky 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 12:32:00 -0000


--vdqwC0msT4ilQ2it
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Jun 16, 2014 at 04:21:11PM +0400, Gleb Smirnoff wrote:
> On Thu, Jun 12, 2014 at 11:04:57AM +0400, Andrey V. Elsukov wrote:
> A> On 11.06.2014 17:48, Dmitry Morozovsky wrote:
> A> > On Wed, 11 Jun 2014, Andrey V. Elsukov wrote:
> A> >=20
> A> >> Author: ae
> A> >> Date: Wed Jun 11 10:19:11 2014
> A> >> New Revision: 267357
> A> >> URL: http://svnweb.freebsd.org/changeset/base/267357
> A> >>
> A> >> Log:
> A> >>   Add aliases for DragonFlyBSD's partition types.
> A> >=20
> A> > These should be documented in sbin/geom/class/part/gpart.8 also.
> A>=20
> A> I don't think we should document partition types for all foreign
> A> systems. gpart(8) exists only in FreeBSD and it's purpose manage
> A> partitions in FreeBSD. We already have a lot of NetBSD's and Apple's
> A> aliases that aren't documented, but nobody complained about that.
>=20
> I did! :)
>=20
I also did in the past, it would be really nice to get all of those documen=
ted,
each I'm looking for the information I forgot where I can find it because i=
t is
not in the manpage.

regards,
Bapt

--vdqwC0msT4ilQ2it
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (FreeBSD)

iEYEARECAAYFAlOe47kACgkQ8kTtMUmk6Ewt+QCgn00i6Ys+rQ2wJ8T4ALdvaOir
OngAnioTUfvX72Wv5wUQ7yWjif25suMV
=7RA5
-----END PGP SIGNATURE-----

--vdqwC0msT4ilQ2it--

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 14:02:14 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id AB463EDF;
 Mon, 16 Jun 2014 14:02:14 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 985A02479;
 Mon, 16 Jun 2014 14:02:14 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5GE2EW1023484;
 Mon, 16 Jun 2014 14:02:14 GMT
 (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5GE2EJa023483;
 Mon, 16 Jun 2014 14:02:14 GMT
 (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201406161402.s5GE2EJa023483@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Mon, 16 Jun 2014 14:02:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267543 - head/lib/libcuse
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 14:02:14 -0000

Author: hselasky
Date: Mon Jun 16 14:02:14 2014
New Revision: 267543
URL: http://svnweb.freebsd.org/changeset/base/267543

Log:
  Fix destruction of character devices by passing correct pointer to
  kernel in IOCTL request.
  
  Submitted by:	Andrey Zholos 

Modified:
  head/lib/libcuse/cuse_lib.c

Modified: head/lib/libcuse/cuse_lib.c
==============================================================================
--- head/lib/libcuse/cuse_lib.c	Mon Jun 16 13:05:07 2014	(r267542)
+++ head/lib/libcuse/cuse_lib.c	Mon Jun 16 14:02:14 2014	(r267543)
@@ -425,7 +425,7 @@ cuse_dev_destroy(struct cuse_dev *cdev)
 	TAILQ_REMOVE(&h_cuse, cdev, entry);
 	cuse_unlock();
 
-	error = ioctl(f_cuse, CUSE_IOCTL_DESTROY_DEV, cdev);
+	error = ioctl(f_cuse, CUSE_IOCTL_DESTROY_DEV, &cdev);
 	if (error)
 		return;
 

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 14:55:10 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9423BCF9;
 Mon, 16 Jun 2014 14:55:10 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 75CFD2992;
 Mon, 16 Jun 2014 14:55:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5GEtADp048362;
 Mon, 16 Jun 2014 14:55:10 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5GEtAUr048361;
 Mon, 16 Jun 2014 14:55:10 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201406161455.s5GEtAUr048361@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Mon, 16 Jun 2014 14:55:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267544 - head/lib/libc/stdtime
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 14:55:10 -0000

Author: pfg
Date: Mon Jun 16 14:55:09 2014
New Revision: 267544
URL: http://svnweb.freebsd.org/changeset/base/267544

Log:
  Update license to strptime(3) implementation.
  
  Our strptime(3) implementation was the base for the illumos
  implementation and after contacting the author, Kevin Rudy
  stated the code is under a 2-Clause BSD License [1]
  
  After reviewing our local changes to the file in question,
  the FreeBSD Foundation has agreed that their contributions
  to this file are not required to carry clause 3 or 4 so
  the file can be relicensed as in Illumos [2].
  
  References:
  
  [1] https://www.illumos.org/issues/357
  [2] Illumos Revision:		13222:02526851ba75
  
  Approved:	core (jhb)
  Approved:	FreeBSD Foundation (emaste)
  MFC after:	4 days

Modified:
  head/lib/libc/stdtime/strptime.c

Modified: head/lib/libc/stdtime/strptime.c
==============================================================================
--- head/lib/libc/stdtime/strptime.c	Mon Jun 16 14:02:14 2014	(r267543)
+++ head/lib/libc/stdtime/strptime.c	Mon Jun 16 14:55:09 2014	(r267544)
@@ -1,25 +1,4 @@
-/*
- * Powerdog Industries kindly requests feedback from anyone modifying
- * this function:
- *
- * Date: Thu, 05 Jun 1997 23:17:17 -0400  
- * From: Kevin Ruddy 
- * To: James FitzGibbon 
- * Subject: Re: Use of your strptime(3) code (fwd)
- * 
- * The reason for the "no mod" clause was so that modifications would
- * come back and we could integrate them and reissue so that a wider 
- * audience could use it (thereby spreading the wealth).  This has   
- * made it possible to get strptime to work on many operating systems.
- * I'm not sure why that's "plain unacceptable" to the FreeBSD team.
- * 
- * Anyway, you can change it to "with or without modification" as
- * you see fit.  Enjoy.                                          
- * 
- * Kevin Ruddy
- * Powerdog Industries, Inc.
- */
-/*
+/*-
  * Copyright (c) 1994 Powerdog Industries.  All rights reserved.
  *
  * Copyright (c) 2011 The FreeBSD Foundation
@@ -36,12 +15,6 @@
  *    notice, this list of conditions and the following disclaimer
  *    in the documentation and/or other materials provided with the
  *    distribution.
- * 3. All advertising materials mentioning features or use of this
- *    software must display the following acknowledgement:
- *      This product includes software developed by Powerdog Industries.
- * 4. The name of Powerdog Industries may not be used to endorse or
- *    promote products derived from this software without specific prior
- *    written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY POWERDOG INDUSTRIES ``AS IS'' AND ANY
  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -54,6 +27,10 @@
  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation
+ * are those of the authors and should not be interpreted as representing
+ * official policies, either expressed or implied, of Powerdog Industries.
  */
 
 #include 

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 15:39:22 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 60EE53B8;
 Mon, 16 Jun 2014 15:39:22 +0000 (UTC)
Received: from mail-vc0-x238.google.com (mail-vc0-x238.google.com
 [IPv6:2607:f8b0:400c:c03::238])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id DB0042DDB;
 Mon, 16 Jun 2014 15:39:21 +0000 (UTC)
Received: by mail-vc0-f184.google.com with SMTP id hy4so1289788vcb.21
 for ; Mon, 16 Jun 2014 08:39:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:message-id:in-reply-to:references:subject
 :mime-version:content-type;
 bh=FEpjflTSFRAi2MnP9U29S9L/e0HEDyqFmn7SJocd5ew=;
 b=KYW/I+k6xc+R1/gsiuP9lWdgTWw225Es3BWbs8ks0/wvlmMqa25Xx3jGR5EQm/9U18
 Fl/4nSKDJ7dHtIgVtZP6nuio3p6+fsOEiPiyX0ReH+oeRDTGfhA+YG5eUXe5zveqfExO
 8Q/OSGI+BSo/sYHAqe4/9Fj3TYm8yZ/NR8LMl0jhZEK+94K3/Tlq3gBzfjt3hmoI1CNa
 2UVNPfElNEY/9VRH69SvND9Dey0qnHqfqvSSAsNhIaViSaX3wH7NIYn1QtO7TXiOPwvp
 EyXtx93pkM/oC2luTRZ5+zv2o0EC9z0iGzWffa2nkpacOgMNIuqZZfhEhLxZz8nGYkhH
 q/Hg==
X-Received: by 10.140.95.176 with SMTP id i45mr50647qge.10.1402933161008;
 Mon, 16 Jun 2014 08:39:21 -0700 (PDT)
X-Google-Doc-Id: c73ff993798c6b67
X-Google-Web-Client: true
Date: Mon, 16 Jun 2014 08:39:19 -0700 (PDT)
From: Kris Smith 
To: bsdmailinglist@googlegroups.com
Message-Id: 
In-Reply-To: <20140601170733.GA1150@machdep.com>
References: <201406010815.s518FYaj023520@svn.freebsd.org>
 <20140601175742.069d2301@bender.Home>
 <20140601170733.GA1150@machdep.com>
Subject: Re: svn commit: r266943 - in head/sys: arm/conf arm/samsung/exynos
 boot/fdt/dts/arm
MIME-Version: 1.0
X-Google-IP: 35.2.254.166
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Content-Filtered-By: Mailman/MimeDel 2.1.18
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, andrew@fubar.geek.nz, br@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 15:39:22 -0000

Would the above commits allow me to see all 8 cores on the the arndale octa 
5420 board carrying the Samsung Exynos 5420? At the moment, the only 
available cores are the A15s on Linaro Ubuntu.

On Sunday, June 1, 2014 1:44:59 PM UTC-4, Ruslan Bukin wrote:
>
> On Sun, Jun 01, 2014 at 05:57:42PM +0100, Andrew Turner wrote: 
> > The EXYNOS5250 and EXYNOS5420 configs are missing an ident value. This 
> > causes universe to break. The following patch fixes it. 
>
> Thanks. 
>
> _______________________________________________ 
> svn-s...@freebsd.org  mailing list 
> http://lists.freebsd.org/mailman/listinfo/svn-src-all 
> To unsubscribe, send any mail to "svn-src-all...@freebsd.org " 
>
>

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 16:27:17 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 36E733BF;
 Mon, 16 Jun 2014 16:27:17 +0000 (UTC)
Received: from mail.machdep.com (mail.machdep.com [195.91.211.41])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DF48A232D;
 Mon, 16 Jun 2014 16:27:16 +0000 (UTC)
Received: from localhost ([127.0.0.1] helo=machdep.com)
 by mail.machdep.com with smtp (Exim 4.82 (FreeBSD))
 (envelope-from )
 id 1WwZiO-000NhM-TZ; Mon, 16 Jun 2014 20:25:01 +0400
Received: by machdep.com (nbSMTP-1.00) for uid 1001
 br@machdep.com; Mon, 16 Jun 2014 20:25:00 +0400 (MSK)
Date: Mon, 16 Jun 2014 20:25:00 +0400
From: Ruslan Bukin 
To: Kris Smith 
Subject: Re: svn commit: r266943 - in head/sys: arm/conf arm/samsung/exynos
 boot/fdt/dts/arm
Message-ID: <20140616162500.GA91030@machdep.com>
References: <201406010815.s518FYaj023520@svn.freebsd.org>
 <20140601175742.069d2301@bender.Home>
 <20140601170733.GA1150@machdep.com>
 
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: 
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: src-committers@freebsd.org, bsdmailinglist@googlegroups.com,
 svn-src-all@freebsd.org, andrew@fubar.geek.nz, svn-src-head@freebsd.org,
 br@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 16:27:17 -0000

On Mon, Jun 16, 2014 at 08:39:19AM -0700, Kris Smith wrote:
>    Would the above commits allow me to see all 8 cores on the the arndale
>    octa 5420 board carrying the Samsung Exynos 5420? At the moment, the only
>    available cores are the A15s on Linaro Ubuntu.

No. This support is for A15 cores only, due to lack of information for now.

Ruslan


From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 16:37:42 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 86E7C73E;
 Mon, 16 Jun 2014 16:37:42 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5B53E2417;
 Mon, 16 Jun 2014 16:37:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5GGbgne095670;
 Mon, 16 Jun 2014 16:37:42 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5GGbgVF095669;
 Mon, 16 Jun 2014 16:37:42 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201406161637.s5GGbgVF095669@svn.freebsd.org>
From: Alan Cox 
Date: Mon, 16 Jun 2014 16:37:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267546 - head/sys/vm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 16:37:42 -0000

Author: alc
Date: Mon Jun 16 16:37:41 2014
New Revision: 267546
URL: http://svnweb.freebsd.org/changeset/base/267546

Log:
  Tidy up the early parts of vm_map_insert(), in particular, simplify one
  of the assertions and eliminate a comment that has grown stale.
  
  Reviewed by:	kib
  MFC after:	1 week

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Mon Jun 16 16:21:05 2014	(r267545)
+++ head/sys/vm/vm_map.c	Mon Jun 16 16:37:41 2014	(r267546)
@@ -1112,18 +1112,20 @@ vm_map_lookup_entry(
  */
 int
 vm_map_insert(vm_map_t map, vm_object_t object, vm_ooffset_t offset,
-	      vm_offset_t start, vm_offset_t end, vm_prot_t prot, vm_prot_t max,
-	      int cow)
+    vm_offset_t start, vm_offset_t end, vm_prot_t prot, vm_prot_t max, int cow)
 {
-	vm_map_entry_t new_entry;
-	vm_map_entry_t prev_entry;
-	vm_map_entry_t temp_entry;
+	vm_map_entry_t new_entry, prev_entry, temp_entry;
 	vm_eflags_t protoeflags;
 	struct ucred *cred;
 	vm_inherit_t inheritance;
 	boolean_t charge_prev_obj;
 
 	VM_MAP_ASSERT_LOCKED(map);
+	KASSERT((object != kmem_object && object != kernel_object) ||
+	    (cow & MAP_COPY_ON_WRITE) == 0,
+	    ("vm_map_insert: kmem or kernel object and COW"));
+	KASSERT(object == NULL || (cow & MAP_NOFAULT) == 0,
+	    ("vm_map_insert: paradoxical MAP_NOFAULT request"));
 
 	/*
 	 * Check that the start and end points are not bogus.
@@ -1149,17 +1151,10 @@ vm_map_insert(vm_map_t map, vm_object_t 
 		return (KERN_NO_SPACE);
 
 	protoeflags = 0;
-	charge_prev_obj = FALSE;
-
 	if (cow & MAP_COPY_ON_WRITE)
-		protoeflags |= MAP_ENTRY_COW|MAP_ENTRY_NEEDS_COPY;
-
-	if (cow & MAP_NOFAULT) {
+		protoeflags |= MAP_ENTRY_COW | MAP_ENTRY_NEEDS_COPY;
+	if (cow & MAP_NOFAULT)
 		protoeflags |= MAP_ENTRY_NOFAULT;
-
-		KASSERT(object == NULL,
-			("vm_map_insert: paradoxical MAP_NOFAULT request"));
-	}
 	if (cow & MAP_DISABLE_SYNCER)
 		protoeflags |= MAP_ENTRY_NOSYNC;
 	if (cow & MAP_DISABLE_COREDUMP)
@@ -1172,10 +1167,7 @@ vm_map_insert(vm_map_t map, vm_object_t 
 		inheritance = VM_INHERIT_DEFAULT;
 
 	cred = NULL;
-	KASSERT((object != kmem_object && object != kernel_object) ||
-	    ((object == kmem_object || object == kernel_object) &&
-		!(protoeflags & MAP_ENTRY_NEEDS_COPY)),
-	    ("kmem or kernel object and cow"));
+	charge_prev_obj = FALSE;
 	if (cow & (MAP_ACC_NO_CHARGE | MAP_NOFAULT))
 		goto charged;
 	if ((cow & MAP_ACC_CHARGED) || ((prot & VM_PROT_WRITE) &&
@@ -1256,12 +1248,6 @@ charged:
 	}
 
 	/*
-	 * NOTE: if conditionals fail, object can be NULL here.  This occurs
-	 * in things like the buffer map where we manage kva but do not manage
-	 * backing objects.
-	 */
-
-	/*
 	 * Create a new entry
 	 */
 	new_entry = vm_map_entry_create(map);

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 17:35:06 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B988163D;
 Mon, 16 Jun 2014 17:35:06 +0000 (UTC)
Received: from gromit.grondar.org (grandfather.grondar.org
 [IPv6:2a01:348:0:15:5d59:5c20:0:2])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 796FF29BC;
 Mon, 16 Jun 2014 17:35:06 +0000 (UTC)
Received: from graveyard.grondar.org ([88.96.155.33]
 helo=gronkulator.grondar.org)
 by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128)
 (Exim 4.80.1 (FreeBSD)) (envelope-from )
 id 1Wwao3-000JAv-7S; Mon, 16 Jun 2014 18:35:03 +0100
Subject: Re: svn commit: r266083 - in head/sys/arm: arm include
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Content-Type: text/plain; charset=windows-1252
From: Mark R V Murray 
In-Reply-To: <3664DBD3-7CEA-43E8-9757-E835BB21FE9E@freebsd.org>
Date: Mon, 16 Jun 2014 18:36:06 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <5F36DFA5-C5B1-4E5D-88EE-9D60240B40FD@FreeBSD.org>
References: <201405141911.s4EJBFZZ097826@svn.freebsd.org>
 <537D0952.2040001@selasky.org>
 <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org>
 <53871493.2010502@selasky.org>
 
 <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de>
 
 
 
 <9B438991-C970-46A7-8116-A490E02D7139@fh-muenster.de>
 <3841D090-5973-40B0-B61C-F15E8C1978C9@FreeBSD.org>
 <3664DBD3-7CEA-43E8-9757-E835BB21FE9E@freebsd.org>
To: Michael Tuexen 
X-Mailer: Apple Mail (2.1878.2)
X-SA-Score: -1.0
Cc: Hans Petter Selasky , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 17:35:06 -0000


On 16 Jun 2014, at 08:28, Michael Tuexen  wrote:
> your patch for accessing the value is correct. However, the =
initialisation code also
> needs to be adopted to the platform. So in addition to your patch, you =
also need:

Thanks!

> Is there an easy test to see if the code actually works as expected =
and not that it just
> allows the system to boot?

Yes. :-)

#include 

#include 

static __inline uint64_t
get_cyclecount(void)
{
	uint32_t ccnt;
	uint64_t tsc;

	/* Read CCNT.  */
	__asm __volatile("mrc p15, 0, %0, c15, c12, 1": "=3Dr" (ccnt));

	tsc =3D (uint64_t)ccnt;

	return (tsc);
}

#define N 100000

int
main(int argc, char *argv[])
{
	int i;
	uint64_t ccnt[N];

	for (i =3D 0; i < N; i++)
		ccnt[i] =3D get_cyclecount();

	for (i =3D 1; i < N; i++)
		printf("%6d %016llX %16llu\n", i, ccnt[i], ccnt[i] - =
ccnt[i - 1]);


	return (0);
}

Should print a whole lotta numbers, incrementing, unless you hit the =
wraparound.

> Regarding the 32-bit limitation: Do we want to increment the register =
only every
> 64 clock cycle?

Definitely not! The value is in the low bits; wrap is of little =
consequence.

M
--=20
Mark R V Murray


From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 18:14:06 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 374AC1DF;
 Mon, 16 Jun 2014 18:14:06 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 194232D3F;
 Mon, 16 Jun 2014 18:14:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5GIE5xL042598;
 Mon, 16 Jun 2014 18:14:05 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5GIE5Bk042597;
 Mon, 16 Jun 2014 18:14:05 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201406161814.s5GIE5Bk042597@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Mon, 16 Jun 2014 18:14:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267547 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 18:14:06 -0000

Author: trasz
Date: Mon Jun 16 18:14:05 2014
New Revision: 267547
URL: http://svnweb.freebsd.org/changeset/base/267547

Log:
  Add LUN-associated name to VPD, to make Hyper-V Failover Cluster happy.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Mon Jun 16 16:37:41 2014	(r267546)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Mon Jun 16 18:14:05 2014	(r267547)
@@ -2033,13 +2033,13 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 {
 	struct cfiscsi_session *cs;
 	struct scsi_vpd_device_id *devid_ptr;
-	struct scsi_vpd_id_descriptor *desc, *desc1;
-	struct scsi_vpd_id_descriptor *desc2, *desc3; /* for types 4h and 5h */
+	struct scsi_vpd_id_descriptor *desc, *desc1, *desc2, *desc3, *desc4;
 	struct scsi_vpd_id_t10 *t10id;
 	struct ctl_lun *lun;
 	const struct icl_pdu *request;
+	int i, ret;
 	char *val;
-	size_t devid_len, wwpn_len;
+	size_t devid_len, wwpn_len, lun_name_len;
 
 	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
 	request = ctsio->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr;
@@ -2051,9 +2051,20 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 	if ((wwpn_len % 4) != 0)
 		wwpn_len += (4 - (wwpn_len % 4));
 
+	if (lun == NULL) {
+		lun_name_len = 0;
+	} else {
+		lun_name_len = strlen(cs->cs_target->ct_name);
+		lun_name_len += strlen(",lun,XXXXXXXX");
+		lun_name_len += 1; /* '\0' */
+		if ((lun_name_len % 4) != 0)
+			lun_name_len += (4 - (lun_name_len % 4));
+	}
+
 	devid_len = sizeof(struct scsi_vpd_device_id) +
 		sizeof(struct scsi_vpd_id_descriptor) +
 		sizeof(struct scsi_vpd_id_t10) + CTL_DEVID_LEN +
+		sizeof(struct scsi_vpd_id_descriptor) + lun_name_len +
 		sizeof(struct scsi_vpd_id_descriptor) + wwpn_len +
 		sizeof(struct scsi_vpd_id_descriptor) +
 		sizeof(struct scsi_vpd_id_rel_trgt_port_id) +
@@ -2082,8 +2093,10 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 	desc1 = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] +
 	    sizeof(struct scsi_vpd_id_t10) + CTL_DEVID_LEN);
 	desc2 = (struct scsi_vpd_id_descriptor *)(&desc1->identifier[0] +
-	    wwpn_len);
+	    lun_name_len);
 	desc3 = (struct scsi_vpd_id_descriptor *)(&desc2->identifier[0] +
+	    wwpn_len);
+	desc4 = (struct scsi_vpd_id_descriptor *)(&desc3->identifier[0] +
 	    sizeof(struct scsi_vpd_id_rel_trgt_port_id));
 
 	if (lun != NULL)
@@ -2129,33 +2142,57 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 	}
 
 	/*
-	 * desc1 is for the WWPN which is a port asscociation.
+	 * desc1 is for the unique LUN name.
 	 */
-       	desc1->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8;
-	desc1->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
-	    SVPD_ID_TYPE_SCSI_NAME;
-	desc1->length = wwpn_len;
-	snprintf(desc1->identifier, wwpn_len, "%s,t,0x%4.4x",
-	    cs->cs_target->ct_name, cs->cs_portal_group_tag);
+	desc1->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8;
+	desc1->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN |
+		SVPD_ID_TYPE_SCSI_NAME;
+	desc1->length = lun_name_len;
+	if (lun != NULL) {
+		/*
+		 * Find the per-target LUN number.
+		 */
+		for (i = 0; i < CTL_MAX_LUNS; i++) {
+			if (cs->cs_target->ct_luns[i] == lun->lun)
+				break;
+		}
+		KASSERT(i < CTL_MAX_LUNS,
+		    ("lun %jd not found", (uintmax_t)lun->lun));
+		ret = snprintf(desc1->identifier, lun_name_len, "%s,lun,%d",
+		    cs->cs_target->ct_name, i);
+		KASSERT(ret > 0 && ret <= lun_name_len, ("bad snprintf"));
+	} else {
+		KASSERT(lun_name_len == 0, ("no lun, but lun_name_len != 0"));
+	}
 
 	/*
-	 * desc2 is for the Relative Target Port(type 4h) identifier
+	 * desc2 is for the WWPN which is a port asscociation.
 	 */
-       	desc2->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_BINARY;
+       	desc2->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8;
 	desc2->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
-	    SVPD_ID_TYPE_RELTARG;
-	desc2->length = 4;
-	desc2->identifier[3] = 1;
+	    SVPD_ID_TYPE_SCSI_NAME;
+	desc2->length = wwpn_len;
+	snprintf(desc2->identifier, wwpn_len, "%s,t,0x%4.4x",
+	    cs->cs_target->ct_name, cs->cs_portal_group_tag);
 
 	/*
-	 * desc3 is for the Target Port Group(type 5h) identifier
+	 * desc3 is for the Relative Target Port(type 4h) identifier
 	 */
        	desc3->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_BINARY;
 	desc3->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
-	    SVPD_ID_TYPE_TPORTGRP;
+	    SVPD_ID_TYPE_RELTARG;
 	desc3->length = 4;
 	desc3->identifier[3] = 1;
 
+	/*
+	 * desc4 is for the Target Port Group(type 5h) identifier
+	 */
+       	desc4->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_BINARY;
+	desc4->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
+	    SVPD_ID_TYPE_TPORTGRP;
+	desc4->length = 4;
+	desc4->identifier[3] = 1;
+
 	ctsio->scsi_status = SCSI_STATUS_OK;
 
 	ctsio->be_move_done = ctl_config_move_done;

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 18:15:32 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id DFC8F424;
 Mon, 16 Jun 2014 18:15:32 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C9A262D54;
 Mon, 16 Jun 2014 18:15:32 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5GIFWEU043139;
 Mon, 16 Jun 2014 18:15:32 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5GIFR2k043096;
 Mon, 16 Jun 2014 18:15:27 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201406161815.s5GIFR2k043096@svn.freebsd.org>
From: Attilio Rao 
Date: Mon, 16 Jun 2014 18:15:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267548 - in head/sys: amd64/amd64 arm/arm dev/agp
 dev/cxgbe/tom dev/drm dev/drm2/i915 dev/drm2/ttm dev/ti dev/virtio/balloon
 dev/xen/balloon i386/i386 i386/xen ia64/ia64 kern mips/mips...
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 18:15:33 -0000

Author: attilio
Date: Mon Jun 16 18:15:27 2014
New Revision: 267548
URL: http://svnweb.freebsd.org/changeset/base/267548

Log:
  - Modify vm_page_unwire() and vm_page_enqueue() to directly accept
    the queue where to enqueue pages that are going to be unwired.
  - Add stronger checks to the enqueue/dequeue for the pagequeues when
    adding and removing pages to them.
  
  Of course, for unmanaged pages the queue parameter of vm_page_unwire() will
  be ignored, just as the active parameter today.
  This makes adding new pagequeues quicker.
  
  This change effectively modifies the KPI.  __FreeBSD_version will be,
  however, bumped just when the full cache of free pages will be
  evicted.
  
  Sponsored by:	EMC / Isilon storage division
  Reviewed by:	alc
  Tested by:	pho

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/arm/arm/pmap-v6.c
  head/sys/dev/agp/agp.c
  head/sys/dev/agp/agp_i810.c
  head/sys/dev/cxgbe/tom/t4_ddp.c
  head/sys/dev/drm/via_dmablit.c
  head/sys/dev/drm2/i915/i915_gem.c
  head/sys/dev/drm2/i915/i915_gem_gtt.c
  head/sys/dev/drm2/ttm/ttm_page_alloc.c
  head/sys/dev/ti/if_ti.c
  head/sys/dev/virtio/balloon/virtio_balloon.c
  head/sys/dev/xen/balloon/balloon.c
  head/sys/i386/i386/pmap.c
  head/sys/i386/xen/pmap.c
  head/sys/ia64/ia64/pmap.c
  head/sys/kern/uipc_syscalls.c
  head/sys/kern/vfs_bio.c
  head/sys/mips/mips/pmap.c
  head/sys/net/bpf_zerocopy.c
  head/sys/vm/uma_core.c
  head/sys/vm/vm_fault.c
  head/sys/vm/vm_glue.c
  head/sys/vm/vm_kern.c
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/amd64/amd64/pmap.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -2868,7 +2868,7 @@ free_pv_chunk(struct pv_chunk *pc)
 	/* entire chunk is free, return it */
 	m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc));
 	dump_drop_page(m->phys_addr);
-	vm_page_unwire(m, 0);
+	vm_page_unwire(m, PQ_INACTIVE);
 	vm_page_free(m);
 }
 

Modified: head/sys/arm/arm/pmap-v6.c
==============================================================================
--- head/sys/arm/arm/pmap-v6.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/arm/arm/pmap-v6.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -4222,7 +4222,7 @@ pmap_free_pv_chunk(struct pv_chunk *pc)
 	/* entire chunk is free, return it */
 	m = PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)pc));
 	pmap_qremove((vm_offset_t)pc, 1);
-	vm_page_unwire(m, 0);
+	vm_page_unwire(m, PQ_INACTIVE);
 	vm_page_free(m);
 	pmap_ptelist_free(&pv_vafree, (vm_offset_t)pc);
 

Modified: head/sys/dev/agp/agp.c
==============================================================================
--- head/sys/dev/agp/agp.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/dev/agp/agp.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -629,7 +629,7 @@ bad:
 		if (k >= i)
 			vm_page_xunbusy(m);
 		vm_page_lock(m);
-		vm_page_unwire(m, 0);
+		vm_page_unwire(m, PQ_INACTIVE);
 		vm_page_unlock(m);
 	}
 	VM_OBJECT_WUNLOCK(mem->am_obj);
@@ -663,7 +663,7 @@ agp_generic_unbind_memory(device_t dev, 
 	for (i = 0; i < mem->am_size; i += PAGE_SIZE) {
 		m = vm_page_lookup(mem->am_obj, atop(i));
 		vm_page_lock(m);
-		vm_page_unwire(m, 0);
+		vm_page_unwire(m, PQ_INACTIVE);
 		vm_page_unlock(m);
 	}
 	VM_OBJECT_WUNLOCK(mem->am_obj);

Modified: head/sys/dev/agp/agp_i810.c
==============================================================================
--- head/sys/dev/agp/agp_i810.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/dev/agp/agp_i810.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -2009,7 +2009,7 @@ agp_i810_free_memory(device_t dev, struc
 			VM_OBJECT_WLOCK(mem->am_obj);
 			m = vm_page_lookup(mem->am_obj, 0);
 			vm_page_lock(m);
-			vm_page_unwire(m, 0);
+			vm_page_unwire(m, PQ_INACTIVE);
 			vm_page_unlock(m);
 			VM_OBJECT_WUNLOCK(mem->am_obj);
 		} else {

Modified: head/sys/dev/cxgbe/tom/t4_ddp.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_ddp.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/dev/cxgbe/tom/t4_ddp.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -869,7 +869,7 @@ unwire_ddp_buffer(struct ddp_buffer *db)
 	for (i = 0; i < db->npages; i++) {
 		p = db->pages[i];
 		vm_page_lock(p);
-		vm_page_unwire(p, 0);
+		vm_page_unwire(p, PQ_INACTIVE);
 		vm_page_unlock(p);
 	}
 }

Modified: head/sys/dev/drm/via_dmablit.c
==============================================================================
--- head/sys/dev/drm/via_dmablit.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/dev/drm/via_dmablit.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -179,7 +179,7 @@ via_free_sg_info(drm_via_sg_info_t *vsg)
 		for (i=0; i < vsg->num_pages; ++i) {
 			page = vsg->pages[i];
 			vm_page_lock(page);
-			vm_page_unwire(page, 0);
+			vm_page_unwire(page, PQ_INACTIVE);
 			vm_page_unlock(page);
 		}
 	case dr_via_pages_alloc:

Modified: head/sys/dev/drm2/i915/i915_gem.c
==============================================================================
--- head/sys/dev/drm2/i915/i915_gem.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/dev/drm2/i915/i915_gem.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -1039,7 +1039,7 @@ i915_gem_swap_io(struct drm_device *dev,
 			vm_page_dirty(m);
 		vm_page_reference(m);
 		vm_page_lock(m);
-		vm_page_unwire(m, 1);
+		vm_page_unwire(m, PQ_ACTIVE);
 		vm_page_unlock(m);
 		atomic_add_long(&i915_gem_wired_pages_cnt, -1);
 
@@ -2247,7 +2247,7 @@ failed:
 	for (j = 0; j < i; j++) {
 		m = obj->pages[j];
 		vm_page_lock(m);
-		vm_page_unwire(m, 0);
+		vm_page_unwire(m, PQ_INACTIVE);
 		vm_page_unlock(m);
 		atomic_add_long(&i915_gem_wired_pages_cnt, -1);
 	}
@@ -2308,7 +2308,7 @@ i915_gem_object_put_pages_gtt(struct drm
 		if (obj->madv == I915_MADV_WILLNEED)
 			vm_page_reference(m);
 		vm_page_lock(m);
-		vm_page_unwire(obj->pages[i], 1);
+		vm_page_unwire(obj->pages[i], PQ_ACTIVE);
 		vm_page_unlock(m);
 		atomic_add_long(&i915_gem_wired_pages_cnt, -1);
 	}
@@ -3611,7 +3611,7 @@ i915_gem_detach_phys_object(struct drm_d
 		vm_page_reference(m);
 		vm_page_lock(m);
 		vm_page_dirty(m);
-		vm_page_unwire(m, 0);
+		vm_page_unwire(m, PQ_INACTIVE);
 		vm_page_unlock(m);
 		atomic_add_long(&i915_gem_wired_pages_cnt, -1);
 	}
@@ -3676,7 +3676,7 @@ i915_gem_attach_phys_object(struct drm_d
 
 		vm_page_reference(m);
 		vm_page_lock(m);
-		vm_page_unwire(m, 0);
+		vm_page_unwire(m, PQ_INACTIVE);
 		vm_page_unlock(m);
 		atomic_add_long(&i915_gem_wired_pages_cnt, -1);
 	}

Modified: head/sys/dev/drm2/i915/i915_gem_gtt.c
==============================================================================
--- head/sys/dev/drm2/i915/i915_gem_gtt.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/dev/drm2/i915/i915_gem_gtt.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -206,7 +206,7 @@ i915_gem_cleanup_aliasing_ppgtt(struct d
 	for (i = 0; i < ppgtt->num_pd_entries; i++) {
 		m = ppgtt->pt_pages[i];
 		if (m != NULL) {
-			vm_page_unwire(m, 0);
+			vm_page_unwire(m, PQ_INACTIVE);
 			vm_page_free(m);
 		}
 	}

Modified: head/sys/dev/drm2/ttm/ttm_page_alloc.c
==============================================================================
--- head/sys/dev/drm2/ttm/ttm_page_alloc.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/dev/drm2/ttm/ttm_page_alloc.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -139,7 +139,7 @@ ttm_vm_page_free(vm_page_t m)
 	KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("ttm got unmanaged %p", m));
 	m->flags &= ~PG_FICTITIOUS;
 	m->oflags |= VPO_UNMANAGED;
-	vm_page_unwire(m, 0);
+	vm_page_unwire(m, PQ_INACTIVE);
 	vm_page_free(m);
 }
 

Modified: head/sys/dev/ti/if_ti.c
==============================================================================
--- head/sys/dev/ti/if_ti.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/dev/ti/if_ti.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -1616,7 +1616,7 @@ ti_newbuf_jumbo(struct ti_softc *sc, int
 			}
 			sf[i] = sf_buf_alloc(frame, SFB_NOWAIT);
 			if (sf[i] == NULL) {
-				vm_page_unwire(frame, 0);
+				vm_page_unwire(frame, PQ_INACTIVE);
 				vm_page_free(frame);
 				device_printf(sc->ti_dev, "buffer allocation "
 				    "failed -- packet dropped!\n");

Modified: head/sys/dev/virtio/balloon/virtio_balloon.c
==============================================================================
--- head/sys/dev/virtio/balloon/virtio_balloon.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/dev/virtio/balloon/virtio_balloon.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -450,7 +450,7 @@ static void
 vtballoon_free_page(struct vtballoon_softc *sc, vm_page_t m)
 {
 
-	vm_page_unwire(m, 0);
+	vm_page_unwire(m, PQ_INACTIVE);
 	vm_page_free(m);
 	sc->vtballoon_current_npages--;
 }

Modified: head/sys/dev/xen/balloon/balloon.c
==============================================================================
--- head/sys/dev/xen/balloon/balloon.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/dev/xen/balloon/balloon.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -255,7 +255,7 @@ increase_reservation(unsigned long nr_pa
 
 		set_phys_to_machine(pfn, frame_list[i]);
 
-		vm_page_unwire(page, 0);
+		vm_page_unwire(page, PQ_INACTIVE);
 		vm_page_free(page);
 	}
 
@@ -297,7 +297,7 @@ decrease_reservation(unsigned long nr_pa
 
 		set_phys_to_machine(pfn, INVALID_P2M_ENTRY);
 		if (balloon_append(page) != 0) {
-			vm_page_unwire(page, 0);
+			vm_page_unwire(page, PQ_INACTIVE);
 			vm_page_free(page);
 
 			nr_pages = i;

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/i386/i386/pmap.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -2368,7 +2368,7 @@ free_pv_chunk(struct pv_chunk *pc)
 	/* entire chunk is free, return it */
 	m = PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)pc));
 	pmap_qremove((vm_offset_t)pc, 1);
-	vm_page_unwire(m, 0);
+	vm_page_unwire(m, PQ_INACTIVE);
 	vm_page_free(m);
 	pmap_ptelist_free(&pv_vafree, (vm_offset_t)pc);
 }

Modified: head/sys/i386/xen/pmap.c
==============================================================================
--- head/sys/i386/xen/pmap.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/i386/xen/pmap.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -2144,7 +2144,7 @@ free_pv_chunk(struct pv_chunk *pc)
 	/* entire chunk is free, return it */
 	m = PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)pc));
 	pmap_qremove((vm_offset_t)pc, 1);
-	vm_page_unwire(m, 0);
+	vm_page_unwire(m, PQ_INACTIVE);
 	vm_page_free(m);
 	pmap_ptelist_free(&pv_vafree, (vm_offset_t)pc);
 }

Modified: head/sys/ia64/ia64/pmap.c
==============================================================================
--- head/sys/ia64/ia64/pmap.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/ia64/ia64/pmap.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -932,7 +932,7 @@ free_pv_chunk(struct pv_chunk *pc)
 	PV_STAT(pc_chunk_frees++);
 	/* entire chunk is free, return it */
 	m = PHYS_TO_VM_PAGE(IA64_RR_MASK((vm_offset_t)pc));
-	vm_page_unwire(m, 0);
+	vm_page_unwire(m, PQ_INACTIVE);
 	vm_page_free(m);
 }
 

Modified: head/sys/kern/uipc_syscalls.c
==============================================================================
--- head/sys/kern/uipc_syscalls.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/kern/uipc_syscalls.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -1996,7 +1996,7 @@ sf_buf_mext(struct mbuf *mb, void *addr,
 	m = sf_buf_page(args);
 	sf_buf_free(args);
 	vm_page_lock(m);
-	vm_page_unwire(m, 0);
+	vm_page_unwire(m, PQ_INACTIVE);
 	/*
 	 * Check for the object going away on us. This can
 	 * happen since we don't hold a reference to it.
@@ -2692,7 +2692,7 @@ sendfile_readpage(vm_object_t obj, struc
 	} else if (m != NULL) {
 free_page:
 		vm_page_lock(m);
-		vm_page_unwire(m, 0);
+		vm_page_unwire(m, PQ_INACTIVE);
 
 		/*
 		 * See if anyone else might know about this page.  If
@@ -3050,7 +3050,7 @@ retry_space:
 			if (sf == NULL) {
 				SFSTAT_INC(sf_allocfail);
 				vm_page_lock(pg);
-				vm_page_unwire(pg, 0);
+				vm_page_unwire(pg, PQ_INACTIVE);
 				KASSERT(pg->object != NULL,
 				    ("%s: object disappeared", __func__));
 				vm_page_unlock(pg);

Modified: head/sys/kern/vfs_bio.c
==============================================================================
--- head/sys/kern/vfs_bio.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/kern/vfs_bio.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -1896,7 +1896,7 @@ vfs_vmio_release(struct buf *bp)
 		 * everything on the inactive queue.
 		 */
 		vm_page_lock(m);
-		vm_page_unwire(m, 0);
+		vm_page_unwire(m, PQ_INACTIVE);
 
 		/*
 		 * Might as well free the page if we can and it has
@@ -3483,7 +3483,7 @@ allocbuf(struct buf *bp, int size)
 
 					bp->b_pages[i] = NULL;
 					vm_page_lock(m);
-					vm_page_unwire(m, 0);
+					vm_page_unwire(m, PQ_INACTIVE);
 					vm_page_unlock(m);
 				}
 				VM_OBJECT_WUNLOCK(bp->b_bufobj->bo_object);

Modified: head/sys/mips/mips/pmap.c
==============================================================================
--- head/sys/mips/mips/pmap.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/mips/mips/pmap.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -1535,7 +1535,7 @@ free_pv_chunk(struct pv_chunk *pc)
 	PV_STAT(pc_chunk_frees++);
 	/* entire chunk is free, return it */
 	m = PHYS_TO_VM_PAGE(MIPS_DIRECT_TO_PHYS((vm_offset_t)pc));
-	vm_page_unwire(m, 0);
+	vm_page_unwire(m, PQ_INACTIVE);
 	vm_page_free(m);
 }
 

Modified: head/sys/net/bpf_zerocopy.c
==============================================================================
--- head/sys/net/bpf_zerocopy.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/net/bpf_zerocopy.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -114,7 +114,7 @@ zbuf_page_free(vm_page_t pp)
 {
 
 	vm_page_lock(pp);
-	vm_page_unwire(pp, 0);
+	vm_page_unwire(pp, PQ_INACTIVE);
 	if (pp->wire_count == 0 && pp->object == NULL)
 		vm_page_free(pp);
 	vm_page_unlock(pp);

Modified: head/sys/vm/uma_core.c
==============================================================================
--- head/sys/vm/uma_core.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/vm/uma_core.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -1154,7 +1154,7 @@ noobj_alloc(uma_zone_t zone, int bytes, 
 		 * exit.
 		 */
 		TAILQ_FOREACH_SAFE(p, &alloctail, listq, p_next) {
-			vm_page_unwire(p, 0);
+			vm_page_unwire(p, PQ_INACTIVE);
 			vm_page_free(p); 
 		}
 		return (NULL);

Modified: head/sys/vm/vm_fault.c
==============================================================================
--- head/sys/vm/vm_fault.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/vm/vm_fault.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -755,7 +755,7 @@ vnode_locked:
 					vm_page_unlock(fs.first_m);
 					
 					vm_page_lock(fs.m);
-					vm_page_unwire(fs.m, FALSE);
+					vm_page_unwire(fs.m, PQ_INACTIVE);
 					vm_page_unlock(fs.m);
 				}
 				/*
@@ -917,7 +917,7 @@ vnode_locked:
 		if (wired)
 			vm_page_wire(fs.m);
 		else
-			vm_page_unwire(fs.m, 1);
+			vm_page_unwire(fs.m, PQ_ACTIVE);
 	} else
 		vm_page_activate(fs.m);
 	if (m_hold != NULL) {
@@ -1208,7 +1208,7 @@ vm_fault_unwire(vm_map_t map, vm_offset_
 			if (!fictitious) {
 				m = PHYS_TO_VM_PAGE(pa);
 				vm_page_lock(m);
-				vm_page_unwire(m, TRUE);
+				vm_page_unwire(m, PQ_ACTIVE);
 				vm_page_unlock(m);
 			}
 		}
@@ -1390,7 +1390,7 @@ again:
 		if (upgrade) {
 			if (src_m != dst_m) {
 				vm_page_lock(src_m);
-				vm_page_unwire(src_m, 0);
+				vm_page_unwire(src_m, PQ_INACTIVE);
 				vm_page_unlock(src_m);
 				vm_page_lock(dst_m);
 				vm_page_wire(dst_m);

Modified: head/sys/vm/vm_glue.c
==============================================================================
--- head/sys/vm/vm_glue.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/vm/vm_glue.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -418,7 +418,7 @@ vm_thread_stack_dispose(vm_object_t ksob
 		if (m == NULL)
 			panic("vm_thread_dispose: kstack already missing?");
 		vm_page_lock(m);
-		vm_page_unwire(m, 0);
+		vm_page_unwire(m, PQ_INACTIVE);
 		vm_page_free(m);
 		vm_page_unlock(m);
 	}
@@ -507,7 +507,7 @@ vm_thread_swapout(struct thread *td)
 			panic("vm_thread_swapout: kstack already missing?");
 		vm_page_dirty(m);
 		vm_page_lock(m);
-		vm_page_unwire(m, 0);
+		vm_page_unwire(m, PQ_INACTIVE);
 		vm_page_unlock(m);
 	}
 	VM_OBJECT_WUNLOCK(ksobj);

Modified: head/sys/vm/vm_kern.c
==============================================================================
--- head/sys/vm/vm_kern.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/vm/vm_kern.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -193,7 +193,7 @@ retry:
 				i -= PAGE_SIZE;
 				m = vm_page_lookup(object,
 				    OFF_TO_IDX(offset + i));
-				vm_page_unwire(m, 0);
+				vm_page_unwire(m, PQ_INACTIVE);
 				vm_page_free(m);
 			}
 			vmem_free(vmem, addr, size);
@@ -367,7 +367,7 @@ retry:
 				i -= PAGE_SIZE;
 				m = vm_page_lookup(object,
 						   OFF_TO_IDX(offset + i));
-				vm_page_unwire(m, 0);
+				vm_page_unwire(m, PQ_INACTIVE);
 				vm_page_free(m);
 			}
 			VM_OBJECT_WUNLOCK(object);
@@ -401,7 +401,7 @@ kmem_unback(vm_object_t object, vm_offse
 	VM_OBJECT_WLOCK(object);
 	for (i = 0; i < size; i += PAGE_SIZE) {
 		m = vm_page_lookup(object, OFF_TO_IDX(offset + i));
-		vm_page_unwire(m, 0);
+		vm_page_unwire(m, PQ_INACTIVE);
 		vm_page_free(m);
 	}
 	VM_OBJECT_WUNLOCK(object);

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/vm/vm_page.c	Mon Jun 16 18:15:27 2014	(r267548)
@@ -147,7 +147,7 @@ static uma_zone_t fakepg_zone;
 static struct vnode *vm_page_alloc_init(vm_page_t m);
 static void vm_page_cache_turn_free(vm_page_t m);
 static void vm_page_clear_dirty_mask(vm_page_t m, vm_page_bits_t pagebits);
-static void vm_page_enqueue(int queue, vm_page_t m);
+static void vm_page_enqueue(uint8_t queue, vm_page_t m);
 static void vm_page_init_fakepg(void *dummy);
 static int vm_page_insert_after(vm_page_t m, vm_object_t object,
     vm_pindex_t pindex, vm_page_t mpred);
@@ -2029,8 +2029,8 @@ vm_page_dequeue(vm_page_t m)
 	struct vm_pagequeue *pq;
 
 	vm_page_assert_locked(m);
-	KASSERT(m->queue == PQ_ACTIVE || m->queue == PQ_INACTIVE,
-	    ("vm_page_dequeue: page %p is not queued", m));
+	KASSERT(m->queue < PQ_COUNT, ("vm_page_dequeue: page %p is not queued",
+	    m));
 	pq = vm_page_pagequeue(m);
 	vm_pagequeue_lock(pq);
 	m->queue = PQ_NONE;
@@ -2067,11 +2067,14 @@ vm_page_dequeue_locked(vm_page_t m)
  *	The page must be locked.
  */
 static void
-vm_page_enqueue(int queue, vm_page_t m)
+vm_page_enqueue(uint8_t queue, vm_page_t m)
 {
 	struct vm_pagequeue *pq;
 
 	vm_page_lock_assert(m, MA_OWNED);
+	KASSERT(queue < PQ_COUNT,
+	    ("vm_page_enqueue: invalid queue %u request for page %p",
+	    queue, m));
 	pq = &vm_phys_domain(m)->vmd_pagequeues[queue];
 	vm_pagequeue_lock(pq);
 	m->queue = queue;
@@ -2330,9 +2333,7 @@ vm_page_wire(vm_page_t m)
  *
  * Release one wiring of the specified page, potentially enabling it to be
  * paged again.  If paging is enabled, then the value of the parameter
- * "activate" determines to which queue the page is added.  If "activate" is
- * non-zero, then the page is added to the active queue.  Otherwise, it is
- * added to the inactive queue.
+ * "queue" determines the queue to which the page is added.
  *
  * However, unless the page belongs to an object, it is not enqueued because
  * it cannot be paged out.
@@ -2342,9 +2343,12 @@ vm_page_wire(vm_page_t m)
  * A managed page must be locked.
  */
 void
-vm_page_unwire(vm_page_t m, int activate)
+vm_page_unwire(vm_page_t m, uint8_t queue)
 {
 
+	KASSERT(queue < PQ_COUNT,
+	    ("vm_page_unwire: invalid queue %u request for page %p",
+	    queue, m));
 	if ((m->oflags & VPO_UNMANAGED) == 0)
 		vm_page_lock_assert(m, MA_OWNED);
 	if ((m->flags & PG_FICTITIOUS) != 0) {
@@ -2359,9 +2363,9 @@ vm_page_unwire(vm_page_t m, int activate
 			if ((m->oflags & VPO_UNMANAGED) != 0 ||
 			    m->object == NULL)
 				return;
-			if (!activate)
+			if (queue == PQ_INACTIVE)
 				m->flags &= ~PG_WINATCFLS;
-			vm_page_enqueue(activate ? PQ_ACTIVE : PQ_INACTIVE, m);
+			vm_page_enqueue(queue, m);
 		}
 	} else
 		panic("vm_page_unwire: page %p's wire count is zero", m);

Modified: head/sys/vm/vm_page.h
==============================================================================
--- head/sys/vm/vm_page.h	Mon Jun 16 18:14:05 2014	(r267547)
+++ head/sys/vm/vm_page.h	Mon Jun 16 18:15:27 2014	(r267548)
@@ -465,7 +465,7 @@ vm_offset_t vm_page_startup(vm_offset_t 
 void vm_page_sunbusy(vm_page_t m);
 int vm_page_trysbusy(vm_page_t m);
 void vm_page_unhold_pages(vm_page_t *ma, int count);
-void vm_page_unwire (vm_page_t, int);
+void vm_page_unwire (vm_page_t m, uint8_t queue);
 void vm_page_updatefake(vm_page_t m, vm_paddr_t paddr, vm_memattr_t memattr);
 void vm_page_wire (vm_page_t);
 void vm_page_xunbusy_hard(vm_page_t m);

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 19:05:52 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 114C8342;
 Mon, 16 Jun 2014 19:05:52 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id F2B9E237C;
 Mon, 16 Jun 2014 19:05:51 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5GJ5p1n071602;
 Mon, 16 Jun 2014 19:05:51 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5GJ5pkS071601;
 Mon, 16 Jun 2014 19:05:51 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201406161905.s5GJ5pkS071601@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Mon, 16 Jun 2014 19:05:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267551 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 19:05:52 -0000

Author: trasz
Date: Mon Jun 16 19:05:51 2014
New Revision: 267551
URL: http://svnweb.freebsd.org/changeset/base/267551

Log:
  Add comment explaining a potential problem with just added LUN ID.
  
  Reminded by:	mav@
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Mon Jun 16 18:33:32 2014	(r267550)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Mon Jun 16 19:05:51 2014	(r267551)
@@ -2143,6 +2143,10 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 
 	/*
 	 * desc1 is for the unique LUN name.
+	 *
+	 * XXX: According to SPC-3, LUN must report the same ID through
+	 *      all the ports.  The code below, however, reports the
+	 *      ID only via iSCSI.
 	 */
 	desc1->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8;
 	desc1->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN |

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 19:25:43 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4E6D991C;
 Mon, 16 Jun 2014 19:25:43 +0000 (UTC)
Received: from mail-n.franken.de (drew.ipv6.franken.de
 [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 05173251F;
 Mon, 16 Jun 2014 19:25:43 +0000 (UTC)
Received: from [192.168.1.200] (p508F05E4.dip0.t-ipconnect.de [80.143.5.228])
 (Authenticated sender: macmic)
 by mail-n.franken.de (Postfix) with ESMTP id 25D4D1C0E97AF;
 Mon, 16 Jun 2014 21:25:37 +0200 (CEST)
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r266083 - in head/sys/arm: arm include
From: Michael Tuexen 
In-Reply-To: <5F36DFA5-C5B1-4E5D-88EE-9D60240B40FD@FreeBSD.org>
Date: Mon, 16 Jun 2014 21:25:37 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <494BE7DA-26BC-43A7-8BC0-ECAE8A75E1EF@freebsd.org>
References: <201405141911.s4EJBFZZ097826@svn.freebsd.org>
 <537D0952.2040001@selasky.org>
 <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org>
 <53871493.2010502@selasky.org>
 
 <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de>
 
 
 
 <9B438991-C970-46A7-8116-A490E02D7139@fh-muenster.de>
 <3841D090-5973-40B0-B61C-F15E8C1978C9@FreeBSD.org>
 <3664DBD3-7CEA-43E8-9757-E835BB21FE9E@freebsd.org>
 <5F36DFA5-C5B1-4E5D-88EE-9D60240B40FD@FreeBSD.org>
To: Mark R V Murray 
X-Mailer: Apple Mail (2.1878.2)
Cc: Hans Petter Selasky , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 19:25:43 -0000


On 16 Jun 2014, at 19:36, Mark R V Murray  wrote:

>=20
> On 16 Jun 2014, at 08:28, Michael Tuexen  wrote:
>> your patch for accessing the value is correct. However, the =
initialisation code also
>> needs to be adopted to the platform. So in addition to your patch, =
you also need:
>=20
> Thanks!
>=20
>> Is there an easy test to see if the code actually works as expected =
and not that it just
>> allows the system to boot?
>=20
> Yes. :-)
>=20
> #include 
>=20
> #include 
>=20
> static __inline uint64_t
> get_cyclecount(void)
> {
> 	uint32_t ccnt;
> 	uint64_t tsc;
>=20
> 	/* Read CCNT.  */
> 	__asm __volatile("mrc p15, 0, %0, c15, c12, 1": "=3Dr" (ccnt));
>=20
> 	tsc =3D (uint64_t)ccnt;
>=20
> 	return (tsc);
> }
>=20
> #define N 100000
>=20
> int
> main(int argc, char *argv[])
> {
> 	int i;
> 	uint64_t ccnt[N];
>=20
> 	for (i =3D 0; i < N; i++)
> 		ccnt[i] =3D get_cyclecount();
>=20
> 	for (i =3D 1; i < N; i++)
> 		printf("%6d %016llX %16llu\n", i, ccnt[i], ccnt[i] - =
ccnt[i - 1]);
>=20
>=20
> 	return (0);
> }
>=20
> Should print a whole lotta numbers, incrementing, unless you hit the =
wraparound.
Don't I need to compile a kernel with _PMC_USER_READ_WRITE_ being =
defined, since
without it a user process can't access the register. When running it on =
a kernel
not defining _PMC_USER_READ_WRITE_, I get a core with Illegal =
instruction.

Let me build a kernel with the above define and retest.
>=20
>> Regarding the 32-bit limitation: Do we want to increment the register =
only every
>> 64 clock cycle?
>=20
> Definitely not! The value is in the low bits; wrap is of little =
consequence.
OK.

Best regards
Michael
>=20
> M
> --=20
> Mark R V Murray
>=20
>=20


From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 19:28:32 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 183A0A89;
 Mon, 16 Jun 2014 19:28:32 +0000 (UTC)
Received: from gromit.grondar.org (grandfather.grondar.org
 [IPv6:2a01:348:0:15:5d59:5c20:0:2])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CA66F2537;
 Mon, 16 Jun 2014 19:28:31 +0000 (UTC)
Received: from graveyard.grondar.org ([88.96.155.33]
 helo=gronkulator.grondar.org)
 by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128)
 (Exim 4.80.1 (FreeBSD)) (envelope-from )
 id 1WwcZp-000JHV-Cs; Mon, 16 Jun 2014 20:28:29 +0100
Subject: Re: svn commit: r266083 - in head/sys/arm: arm include
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Content-Type: text/plain; charset=windows-1252
From: Mark R V Murray 
In-Reply-To: <494BE7DA-26BC-43A7-8BC0-ECAE8A75E1EF@freebsd.org>
Date: Mon, 16 Jun 2014 20:29:32 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <6268E444-F6C7-4B8B-86B7-244A2BB3C4DE@FreeBSD.org>
References: <201405141911.s4EJBFZZ097826@svn.freebsd.org>
 <537D0952.2040001@selasky.org>
 <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org>
 <53871493.2010502@selasky.org>
 
 <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de>
 
 
 
 <9B438991-C970-46A7-8116-A490E02D7139@fh-muenster.de>
 <3841D090-5973-40B0-B61C-F15E8C1978C9@FreeBSD.org>
 <3664DBD3-7CEA-43E8-9757-E835BB21FE9E@freebsd.org>
 <5F36DFA5-C5B1-4E5D-88EE-9D60240B40FD@FreeBSD.org>
 <494BE7DA-26BC-43A7-8BC0-ECAE8A75E1EF@freebsd.org>
To: Michael Tuexen 
X-Mailer: Apple Mail (2.1878.2)
X-SA-Score: -1.0
Cc: Hans Petter Selasky , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 19:28:32 -0000


On 16 Jun 2014, at 20:25, Michael Tuexen  wrote:
>> Should print a whole lotta numbers, incrementing, unless you hit the =
wraparound.
> Don't I need to compile a kernel with _PMC_USER_READ_WRITE_ being =
defined, since
> without it a user process can't access the register. When running it =
on a kernel
> not defining _PMC_USER_READ_WRITE_, I get a core with Illegal =
instruction.

No. That only enables _write_ access. That=92s on ARMv7. What=92s in =
ARMv6 may also work.

> Let me build a kernel with the above define and retest.

Please try without it.

M
--=20
Mark R V Murray


From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 19:38:09 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8F18BFB9;
 Mon, 16 Jun 2014 19:38:09 +0000 (UTC)
Received: from mail-n.franken.de (drew.ipv6.franken.de
 [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 43CB12621;
 Mon, 16 Jun 2014 19:38:09 +0000 (UTC)
Received: from [192.168.1.200] (p508F05E4.dip0.t-ipconnect.de [80.143.5.228])
 (Authenticated sender: macmic)
 by mail-n.franken.de (Postfix) with ESMTP id 6EF411C104DB1;
 Mon, 16 Jun 2014 21:38:04 +0200 (CEST)
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r266083 - in head/sys/arm: arm include
From: Michael Tuexen 
In-Reply-To: <6268E444-F6C7-4B8B-86B7-244A2BB3C4DE@FreeBSD.org>
Date: Mon, 16 Jun 2014 21:38:03 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <44F7EEB4-46D1-49C7-A4CA-4EA5D41BDF31@freebsd.org>
References: <201405141911.s4EJBFZZ097826@svn.freebsd.org>
 <537D0952.2040001@selasky.org>
 <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org>
 <53871493.2010502@selasky.org>
 
 <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de>
 
 
 
 <9B438991-C970-46A7-8116-A490E02D7139@fh-muenster.de>
 <3841D090-5973-40B0-B61C-F15E8C1978C9@FreeBSD.org>
 <3664DBD3-7CEA-43E8-9757-E835BB21FE9E@freebsd.org>
 <5F36DFA5-C5B1-4E5D-88EE-9D60240B40FD@FreeBSD.org>
 <494BE7DA-26BC-43A7-8BC0-ECAE8A75E1EF@freebsd.org>
 <6268E444-F6C7-4B8B-86B7-244A2BB3C4DE@FreeBSD.org>
To: Mark R V Murray 
X-Mailer: Apple Mail (2.1878.2)
Cc: Hans Petter Selasky , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 19:38:09 -0000


On 16 Jun 2014, at 21:29, Mark R V Murray  wrote:

>=20
> On 16 Jun 2014, at 20:25, Michael Tuexen  wrote:
>>> Should print a whole lotta numbers, incrementing, unless you hit the =
wraparound.
>> Don't I need to compile a kernel with _PMC_USER_READ_WRITE_ being =
defined, since
>> without it a user process can't access the register. When running it =
on a kernel
>> not defining _PMC_USER_READ_WRITE_, I get a core with Illegal =
instruction.
>=20
> No. That only enables _write_ access. That=92s on ARMv7. What=92s in =
ARMv6 may also work.
Hmm, the documentation reads
Access to the Cycle Counter Register in User mode depends on the V bit, =
see c15, Secure User and Non-secure Access Validation Control Register. =
The Cycle Counter Register is always accessible in Privileged modes. =
Table 3.139 lists the results of attempted access for each mode.

and the table shows read/write access for Secure Privileged and =
Non-secure Privileged,
but for User you need the V-bit. So in which modes are the user programs =
running?

One the normal kernel I get the Illegal Instruction error when I run the =
program.

Best regards
Michael
>=20
>> Let me build a kernel with the above define and retest.
>=20
> Please try without it.
>=20
> M
> --=20
> Mark R V Murray
>=20
>=20


From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 20:12:32 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id DBAE58A0;
 Mon, 16 Jun 2014 20:12:32 +0000 (UTC)
Received: from gromit.grondar.org (grandfather.grondar.org
 [IPv6:2a01:348:0:15:5d59:5c20:0:2])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9939D298F;
 Mon, 16 Jun 2014 20:12:32 +0000 (UTC)
Received: from [2001:470:9174:1:1dcb:44f:fecb:6b86]
 by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128)
 (Exim 4.80.1 (FreeBSD)) (envelope-from )
 id 1WwdGQ-000JJx-Ms; Mon, 16 Jun 2014 21:12:31 +0100
Subject: Re: svn commit: r266083 - in head/sys/arm: arm include
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Content-Type: text/plain; charset=windows-1252
From: Mark R V Murray 
In-Reply-To: <44F7EEB4-46D1-49C7-A4CA-4EA5D41BDF31@freebsd.org>
Date: Mon, 16 Jun 2014 21:13:33 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201405141911.s4EJBFZZ097826@svn.freebsd.org>
 <537D0952.2040001@selasky.org>
 <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org>
 <53871493.2010502@selasky.org>
 
 <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de>
 
 
 
 <9B438991-C970-46A7-8116-A490E02D7139@fh-muenster.de>
 <3841D090-5973-40B0-B61C-F15E8C1978C9@FreeBSD.org>
 <3664DBD3-7CEA-43E8-9757-E835BB21FE9E@freebsd.org>
 <5F36DFA5-C5B1-4E5D-88EE-9D60240B40FD@FreeBSD.org>
 <494BE7DA-26BC-43A7-8BC0-ECAE8A75E1EF@freebsd.org>
 <6268E444-F6C7-4B8B-86B7-244A2BB3C4DE@FreeBSD.org>
 <44F7EEB4-46D1-49C7-A4CA-4EA5D41BDF31@freebsd.org>
To: Michael Tuexen 
X-Mailer: Apple Mail (2.1878.2)
X-SA-Score: -1.0
Cc: Hans Petter Selasky , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 20:12:33 -0000


On 16 Jun 2014, at 20:38, Michael Tuexen  wrote:
> Hmm, the documentation reads

Which docs are you using?

I=92m using DDI0360F. (And that could easily be a wrong choice).

M
--=20
Mark R V Murray


From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 20:20:54 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B32A9CC9;
 Mon, 16 Jun 2014 20:20:54 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A0A0829FE;
 Mon, 16 Jun 2014 20:20:54 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5GKKsYs005766;
 Mon, 16 Jun 2014 20:20:54 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5GKKsQG005765;
 Mon, 16 Jun 2014 20:20:54 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201406162020.s5GKKsQG005765@svn.freebsd.org>
From: Glen Barber 
Date: Mon, 16 Jun 2014 20:20:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267553 - head/release/doc/en_US.ISO8859-1/relnotes
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 20:20:54 -0000

Author: gjb
Date: Mon Jun 16 20:20:54 2014
New Revision: 267553
URL: http://svnweb.freebsd.org/changeset/base/267553

Log:
  Document r267536, Xen PVH DomU support for amd64.
  
  Submitted by:	royger
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==============================================================================
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Jun 16 19:16:13 2014	(r267552)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Mon Jun 16 20:20:54 2014	(r267553)
@@ -187,6 +187,15 @@
 
       The &man.virtio_random.4; driver has
 	been added to harvest entropy from the host system.
+
+      Support for running a &os;/&arch.amd64;
+	Xen guest instance as
+	PVH guest has been added.
+	PVH mode, short for Para-Virtualized
+	  Hardware, uses para-virtualized drivers for boot
+	and I/O, and uses hardware virtualization extensions for all
+	other tasks, without the need for emulation.
     
 
     

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 20:21:15 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D94A0E01;
 Mon, 16 Jun 2014 20:21:15 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C6AA92A00;
 Mon, 16 Jun 2014 20:21:15 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5GKLFNB006415;
 Mon, 16 Jun 2014 20:21:15 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5GKLFZY006414;
 Mon, 16 Jun 2014 20:21:15 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201406162021.s5GKLFZY006414@svn.freebsd.org>
From: Glen Barber 
Date: Mon, 16 Jun 2014 20:21:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267554 - head/release/doc/share/xml
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 20:21:15 -0000

Author: gjb
Date: Mon Jun 16 20:21:15 2014
New Revision: 267554
URL: http://svnweb.freebsd.org/changeset/base/267554

Log:
  Add &citrix; and &citrix.rd; macros.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/release/doc/share/xml/sponsor.ent

Modified: head/release/doc/share/xml/sponsor.ent
==============================================================================
--- head/release/doc/share/xml/sponsor.ent	Mon Jun 16 20:20:54 2014	(r267553)
+++ head/release/doc/share/xml/sponsor.ent	Mon Jun 16 20:21:15 2014	(r267554)
@@ -10,6 +10,9 @@
 
 
 
+
+
+
 
 
 

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 20:42:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 30C21330;
 Mon, 16 Jun 2014 20:42:01 +0000 (UTC)
Received: from mail-n.franken.de (drew.ipv6.franken.de
 [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id D2FDF2C16;
 Mon, 16 Jun 2014 20:42:00 +0000 (UTC)
Received: from [192.168.1.200] (p508F2AAE.dip0.t-ipconnect.de [80.143.42.174])
 (Authenticated sender: macmic)
 by mail-n.franken.de (Postfix) with ESMTP id 80A751C0E97AF;
 Mon, 16 Jun 2014 22:41:57 +0200 (CEST)
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r266083 - in head/sys/arm: arm include
From: Michael Tuexen 
In-Reply-To: 
Date: Mon, 16 Jun 2014 22:41:56 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <06BB0F4F-44D8-4529-9717-474A137CB60A@freebsd.org>
References: <201405141911.s4EJBFZZ097826@svn.freebsd.org>
 <537D0952.2040001@selasky.org>
 <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org>
 <53871493.2010502@selasky.org>
 
 <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de>
 
 
 
 <9B438991-C970-46A7-8116-A490E02D7139@fh-muenster.de>
 <3841D090-5973-40B0-B61C-F15E8C1978C9@FreeBSD.org>
 <3664DBD3-7CEA-43E8-9757-E835BB21FE9E@freebsd.org>
 <5F36DFA5-C5B1-4E5D-88EE-9D60240B40FD@FreeBSD.org>
 <494BE7DA-26BC-43A7-8BC0-ECAE8A75E1EF@freebsd.org>
 <6268E444-F6C7-4B8B-86B7-244A2BB3C4DE@FreeBSD.org>
 <44F7EEB4-46D1-49C7-A4CA-4EA5D41BDF31@freebsd.org>
 
To: Mark R V Murray 
X-Mailer: Apple Mail (2.1878.2)
Cc: Hans Petter Selasky , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 20:42:01 -0000


On 16 Jun 2014, at 22:13, Mark R V Murray  wrote:

>=20
> On 16 Jun 2014, at 20:38, Michael Tuexen  wrote:
>> Hmm, the documentation reads
>=20
> Which docs are you using?
>=20
> I=92m using DDI0360F. (And that could easily be a wrong choice).
That is what I'm also looking at. Selecting ARM1176...

The code regarding _PMC_USER_READ_WRITE_ also needs to be adopted.
I need to test it... I'll come back in a couple of hours...

Best regards
Michael=20
>=20
> M
> --=20
> Mark R V Murray
>=20
>=20


From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 22:59:19 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 08619653;
 Mon, 16 Jun 2014 22:59:19 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E9AFB27D6;
 Mon, 16 Jun 2014 22:59:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5GMxIO0079309;
 Mon, 16 Jun 2014 22:59:18 GMT (envelope-from tychon@svn.freebsd.org)
Received: (from tychon@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5GMxIoq079308;
 Mon, 16 Jun 2014 22:59:18 GMT (envelope-from tychon@svn.freebsd.org)
Message-Id: <201406162259.s5GMxIoq079308@svn.freebsd.org>
From: Tycho Nightingale 
Date: Mon, 16 Jun 2014 22:59:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267558 - head/sys/amd64/vmm/intel
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 22:59:19 -0000

Author: tychon
Date: Mon Jun 16 22:59:18 2014
New Revision: 267558
URL: http://svnweb.freebsd.org/changeset/base/267558

Log:
  Bring an overly enthusiastic KASSERT inline with the Intel SDM.
  
  Reviewed by:	neel

Modified:
  head/sys/amd64/vmm/intel/vmx.c

Modified: head/sys/amd64/vmm/intel/vmx.c
==============================================================================
--- head/sys/amd64/vmm/intel/vmx.c	Mon Jun 16 21:37:16 2014	(r267557)
+++ head/sys/amd64/vmm/intel/vmx.c	Mon Jun 16 22:59:18 2014	(r267558)
@@ -1258,12 +1258,28 @@ vmx_inject_interrupts(struct vmx *vmx, i
 		/* Ask the local apic for a vector to inject */
 		if (!vlapic_pending_intr(vlapic, &vector))
 			return;
+
+		/*
+		 * From the Intel SDM, Volume 3, Section "Maskable
+		 * Hardware Interrupts":
+		 * - maskable interrupt vectors [16,255] can be delivered
+		 *   through the local APIC.
+		*/
+		KASSERT(vector >= 16 && vector <= 255,
+		    ("invalid vector %d from local APIC", vector));
 	} else {
 		/* Ask the legacy pic for a vector to inject */
 		vatpic_pending_intr(vmx->vm, &vector);
-	}
 
-	KASSERT(vector >= 32 && vector <= 255, ("invalid vector %d", vector));
+		/*
+		 * From the Intel SDM, Volume 3, Section "Maskable
+		 * Hardware Interrupts":
+		 * - maskable interrupt vectors [0,255] can be delivered
+		 *   through the INTR pin.
+		 */
+		KASSERT(vector >= 0 && vector <= 255,
+		    ("invalid vector %d from INTR", vector));
+	}
 
 	/* Check RFLAGS.IF and the interruptibility state of the guest */
 	rflags = vmcs_read(VMCS_GUEST_RFLAGS);

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 16 23:09:38 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 610F192E;
 Mon, 16 Jun 2014 23:09:38 +0000 (UTC)
Received: from mail-n.franken.de (drew.ipv6.franken.de
 [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 193C628D3;
 Mon, 16 Jun 2014 23:09:38 +0000 (UTC)
Received: from [192.168.1.200] (p508F2AAE.dip0.t-ipconnect.de [80.143.42.174])
 (Authenticated sender: macmic)
 by mail-n.franken.de (Postfix) with ESMTP id A968F1C104939;
 Tue, 17 Jun 2014 01:09:33 +0200 (CEST)
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r266083 - in head/sys/arm: arm include
From: Michael Tuexen 
In-Reply-To: <06BB0F4F-44D8-4529-9717-474A137CB60A@freebsd.org>
Date: Tue, 17 Jun 2014 01:09:32 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201405141911.s4EJBFZZ097826@svn.freebsd.org>
 <537D0952.2040001@selasky.org>
 <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org>
 <53871493.2010502@selasky.org>
 
 <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de>
 
 
 
 <9B438991-C970-46A7-8116-A490E02D7139@fh-muenster.de>
 <3841D090-5973-40B0-B61C-F15E8C1978C9@FreeBSD.org>
 <3664DBD3-7CEA-43E8-9757-E835BB21FE9E@freebsd.org>
 <5F36DFA5-C5B1-4E5D-88EE-9D60240B40FD@FreeBSD.org>
 <494BE7DA-26BC-43A7-8BC0-ECAE8A75E1EF@freebsd.org>
 <6268E444-F6C7-4B8B-86B7-244A2BB3C4DE@FreeBSD.org>
 <44F7EEB4-46D1-49C7-A4CA-4EA5D41BDF31@freebsd.org>
 
 <06BB0F4F-44D8-4529-9717-474A137CB60A@freebsd.org>
To: Mark R V Murray 
X-Mailer: Apple Mail (2.1878.2)
Cc: Hans Petter Selasky , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 16 Jun 2014 23:09:38 -0000

On 16 Jun 2014, at 22:41, Michael Tuexen  wrote:

>=20
> On 16 Jun 2014, at 22:13, Mark R V Murray  wrote:
>=20
>>=20
>> On 16 Jun 2014, at 20:38, Michael Tuexen  wrote:
>>> Hmm, the documentation reads
>>=20
>> Which docs are you using?
>>=20
>> I=92m using DDI0360F. (And that could easily be a wrong choice).
> That is what I'm also looking at. Selecting ARM1176...
>=20
> The code regarding _PMC_USER_READ_WRITE_ also needs to be adopted.
> I need to test it... I'll come back in a couple of hours...
Using the following updated patch in addition to your patch:

Index: cpufunc.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- cpufunc.c	(revision 267555)
+++ cpufunc.c	(working copy)
@@ -1409,7 +1409,20 @@
  * BEWARE! This gives write access also, which may not be what
  * you want!
  */
+#if defined(CPU_ARM1136) || defined(CPU_ARM1176)
 #ifdef _PMC_USER_READ_WRITE_
+	/* Use Secure User and Non-secure Access Validation Control =
Register
+	   to allow userland access */
+	__asm volatile ("mcr	p15, 0, %0, c15, c9, 0\n\t"
+			:
+			: "r"(0x00000001));
+#endif
+	/* Set PMCR[2,0] to enable counters and reset CCNT */
+	__asm volatile ("mcr	p15, 0, %0, c15, c12, 0\n\t"
+			:
+			: "r"(0x00000005));
+#else
+#ifdef _PMC_USER_READ_WRITE_
 	/* Set PMUSERENR[0] to allow userland access */
 	__asm volatile ("mcr	p15, 0, %0, c9, c14, 0\n\t"
 			:
@@ -1426,6 +1439,7 @@
 			: "r"(0xFFFFFFFF),
 			  "r"(0x00000005),
 			  "r"(0x80000000));
+#endif
 }
 #endif

allows your test program to run successfully without root privileges, if =
I compile the
kernel with _PMC_USER_READ_WRITE_ defined.

Best regards
Michael
>=20
> Best regards
> Michael=20
>>=20
>> M
>> --=20
>> Mark R V Murray
>>=20
>>=20
>=20
>=20
>=20


From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 00:53:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 407D29A6;
 Tue, 17 Jun 2014 00:53:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2D0E02104;
 Tue, 17 Jun 2014 00:53:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5H0r1Kn033490;
 Tue, 17 Jun 2014 00:53:01 GMT (envelope-from alfred@svn.freebsd.org)
Received: (from alfred@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5H0r1GB033489;
 Tue, 17 Jun 2014 00:53:01 GMT (envelope-from alfred@svn.freebsd.org)
Message-Id: <201406170053.s5H0r1GB033489@svn.freebsd.org>
From: Alfred Perlstein 
Date: Tue, 17 Jun 2014 00:53:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267559 - head/share/examples/bhyve
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 00:53:01 -0000

Author: alfred
Date: Tue Jun 17 00:53:00 2014
New Revision: 267559
URL: http://svnweb.freebsd.org/changeset/base/267559

Log:
  Support for multiple disks and tap devices.
  
  This allows you to give a bhyve instance multiple network devices
  and disk devices easily by specifying additional "-d " and "-t "
  options.
  
  Reviewed by: neel
  Sponsored by: Norse

Modified:
  head/share/examples/bhyve/vmrun.sh

Modified: head/share/examples/bhyve/vmrun.sh
==============================================================================
--- head/share/examples/bhyve/vmrun.sh	Mon Jun 16 22:59:18 2014	(r267558)
+++ head/share/examples/bhyve/vmrun.sh	Tue Jun 17 00:53:00 2014	(r267559)
@@ -78,8 +78,8 @@ isofile=${DEFAULT_ISOFILE}
 memsize=${DEFAULT_MEMSIZE}
 console=${DEFAULT_CONSOLE}
 cpus=${DEFAULT_CPUS}
-virtio_diskdev=${DEFAULT_VIRTIO_DISK}
-tapdev=${DEFAULT_TAPDEV}
+tap_total=0
+disk_total=0
 apic_opt=""
 gdbport=0
 loader_opt=""
@@ -96,7 +96,8 @@ while getopts ac:C:d:e:g:hH:iI:m:t: c ; 
 		console=${OPTARG}
 		;;
 	d)
-		virtio_diskdev=${OPTARG}
+		eval "disk_dev${disk_total}=\"${OPTARG}\""
+		disk_total=$(($disk_total + 1))
 		;;
 	e)
 		loader_opt="${loader_opt} -e ${OPTARG}"
@@ -117,7 +118,8 @@ while getopts ac:C:d:e:g:hH:iI:m:t: c ; 
 		memsize=${OPTARG}
 		;;
 	t)
-		tapdev=${OPTARG}
+		eval "tap_dev${tap_total}=\"${OPTARG}\""
+		tap_total=$(($tap_total + 1))
 		;;
 	*)
 		usage
@@ -125,6 +127,16 @@ while getopts ac:C:d:e:g:hH:iI:m:t: c ; 
 	esac
 done
 
+if [ $tap_total -eq 0 ] ; then
+    tap_total=1
+    tap_dev0="${DEFAULT_TAPDEV}"
+fi
+if [ $disk_total -eq 0 ] ; then
+    disk_total=1
+    disk_dev0="${DEFAULT_VIRTIO_DISK}"
+
+fi
+
 shift $((${OPTIND} - 1))
 
 if [ $# -ne 1 ]; then
@@ -136,25 +148,31 @@ if [ -n "${host_base}" ]; then
 	loader_opt="${loader_opt} -h ${host_base}"
 fi
 
-# Create the virtio diskdev file if needed
-if [ ! -f ${virtio_diskdev} ]; then
-	echo "virtio disk device file \"${virtio_diskdev}\" does not exist."
-	echo "Creating it ..."
-	truncate -s 8G ${virtio_diskdev} > /dev/null
-fi
-
-if [ ! -r ${virtio_diskdev} ]; then
-	echo "virtio disk device file \"${virtio_diskdev}\" is not readable"
-	exit 1
-fi
-
-if [ ! -w ${virtio_diskdev} ]; then
-	echo "virtio disk device file \"${virtio_diskdev}\" is not writable"
-	exit 1
-fi
+make_and_check_diskdev()
+{
+    local virtio_diskdev="$1"
+    # Create the virtio diskdev file if needed
+    if [ ! -f ${virtio_diskdev} ]; then
+	    echo "virtio disk device file \"${virtio_diskdev}\" does not exist."
+	    echo "Creating it ..."
+	    truncate -s 8G ${virtio_diskdev} > /dev/null
+    fi
+
+    if [ ! -r ${virtio_diskdev} ]; then
+	    echo "virtio disk device file \"${virtio_diskdev}\" is not readable"
+	    exit 1
+    fi
+
+    if [ ! -w ${virtio_diskdev} ]; then
+	    echo "virtio disk device file \"${virtio_diskdev}\" is not writable"
+	    exit 1
+    fi
+}
 
 echo "Launching virtual machine \"$vmname\" ..."
 
+virtio_diskdev="$disk_dev0"
+
 while [ 1 ]; do
 	${BHYVECTL} --vm=${vmname} --destroy > /dev/null 2>&1
 
@@ -189,12 +207,33 @@ while [ 1 ]; do
 		break
 	fi
 
+	#
+	# Build up args for additional tap and disk devices now.
+	#
+	nextslot=2  # slot 0 is hostbridge, slot 1 is lpc
+	devargs=""  # accumulate disk/tap args here
+	i=0
+	while [ $i -lt $tap_total ] ; do
+	    eval "tapname=\$tap_dev${i}"
+	    devargs="$devargs -s $nextslot:0,virtio-net,${tapname} "
+	    nextslot=$(($nextslot + 1))
+	    i=$(($i + 1))
+	done
+
+	i=0
+	while [ $i -lt $disk_total ] ; do
+	    eval "disk=\$disk_dev${i}"
+	    make_and_check_diskdev "${disk}"
+	    devargs="$devargs -s $nextslot:0,virtio-blk,${disk} "
+	    nextslot=$(($nextslot + 1))
+	    i=$(($i + 1))
+	done
+
 	${FBSDRUN} -c ${cpus} -m ${memsize} ${apic_opt} -A -H -P	\
 		-g ${gdbport}						\
 		-s 0:0,hostbridge					\
 		-s 1:0,lpc						\
-		-s 2:0,virtio-net,${tapdev}				\
-		-s 3:0,virtio-blk,${virtio_diskdev}			\
+		${devargs}						\
 		-l com1,${console}					\
 		${installer_opt}					\
 		${vmname}

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 01:46:07 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D612D246;
 Tue, 17 Jun 2014 01:46:07 +0000 (UTC)
Received: from mail.feld.me (mail.feld.me [66.170.3.6])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mail.feld.me", Issuer "Gandi Standard SSL CA" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 3A3FB24CB;
 Tue, 17 Jun 2014 01:46:07 +0000 (UTC)
Received: from mail.feld.me (mail.feld.me [66.170.3.6]);
 by mail.feld.me (OpenSMTPD) with ESMTP id 52f9b1d9;
 Mon, 16 Jun 2014 20:46:02 -0500 (CDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=feld.me; h=content-type
 :mime-version:subject:from:in-reply-to:date:cc
 :content-transfer-encoding:message-id:references:to:sender; s=
 blargle2; bh=jQ5nqrjO8TaWqONb+Ni2LRAPcyo=; b=TRs+JtLxjF7B202DFo0
 r0KHONnSh5lvUACQrH/UPB9qv8d25p6BCmbJQJXhBn7o/63RYRkG6iMjFIuRiB5s
 lD7f9yTi15cG2B/ieXHzeemwfFBL77L1LEjt7OMGswb+J5n0qcqDVw2/76EYdzvy
 6FOnLX6RyId2C7Skp5CNL3T+bXL8lNyM9OpfCaK8/hO6R95y3ZN6vkPlxlV2075T
 2FU1O40T6tbFfVRibAM1uGzte9oPWiMbxQXJEY3I5xiWzhQnHe5xO0keuxu0s+/O
 Q6+tk47tzJh7tJhViFUhKRvm365W/jf5mUgcthQqZfUtZdhmP3ZCiz6PRePEBzai
 NHw==
DomainKey-Signature: a=rsa-sha1; c=nofws; d=feld.me; h=content-type
 :mime-version:subject:from:in-reply-to:date:cc
 :content-transfer-encoding:message-id:references:to:sender; q=
 dns; s=blargle2; b=Ga2ibPbvaRfCg550hC3+tnZSorXC7Wv3vL43dSfK2yJ0j
 DLKel68WRxPuCV5KRpdws0hmd4dxss8PHT59WCYKIRyDJrRbnKYNS/OC7pm9n1qd
 UXw0+oLHAqIUGRNimIG7dRyUf5wMOXFb4r96k1KrP168fbtgKUMuxU2Li8SRY0pg
 IQ5F/L1EHOQW/HAql3zf9NQpnCmGuCHdNFyAPNYlguPrpxsVRvLpluaU2efu3IkL
 ids6NgiY3xrrKDt3LSsXFyqLXDllk/GOyB6rkQj2fOXEoYjf90JCfesWTr2Si1MO
 3A/MkTtDU+WUvFrFxjUDG4bVNWLQrPYvqPN4akKZw==
Received: from mail.feld.me (mail.feld.me [66.170.3.6]);
 by mail.feld.me (OpenSMTPD) with ESMTP id be047709;
 Mon, 16 Jun 2014 20:46:02 -0500 (CDT)
Received: from feld@feld.me by mail.feld.me (Archiveopteryx 3.2.0) with
 esmtpa id 1402969561-26377-26375/5/6; Tue, 17 Jun 2014 01:46:01 +0000
Content-Type: text/plain
Mime-Version: 1.0
Subject: Re: svn commit: r267357 - head/sys/geom/part
From: Mark Felder 
In-Reply-To: <53995119.5040609@FreeBSD.org>
Date: Mon, 16 Jun 2014 20:45:59 -0500
Content-Transfer-Encoding: quoted-printable
Message-Id: <0F8CDDB4-6A5D-41BB-BFE7-96F431E4224A@FreeBSD.org>
References: <201406111019.s5BAJBjW085880@svn.freebsd.org>
 
 <53995119.5040609@FreeBSD.org>
To: "Andrey V. Elsukov" 
X-Mailer: Apple Mail (2.1878.2)
Sender: feld@feld.me
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Dmitry Morozovsky 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 01:46:07 -0000


On Jun 12, 2014, at 2:04, Andrey V. Elsukov  wrote:

> On 11.06.2014 17:48, Dmitry Morozovsky wrote:
>> On Wed, 11 Jun 2014, Andrey V. Elsukov wrote:
>>=20
>>> Author: ae
>>> Date: Wed Jun 11 10:19:11 2014
>>> New Revision: 267357
>>> URL: http://svnweb.freebsd.org/changeset/base/267357
>>>=20
>>> Log:
>>>  Add aliases for DragonFlyBSD's partition types.
>>=20
>> These should be documented in sbin/geom/class/part/gpart.8 also.
>=20
> I don't think we should document partition types for all foreign
> systems. gpart(8) exists only in FreeBSD and it's purpose manage
> partitions in FreeBSD. We already have a lot of NetBSD's and Apple's
> aliases that aren't documented, but nobody complained about that.
>=20
> In this case it is mostly cosmetic change. It allows to see aliases in
> the `gpart show` output. Having a lot of partition types documented can
> confuse users. IMHO. :)
>=20

I use freebsd as a desktop and I regularly plug in a device and attempt =
to initialize or read disks meant for many different systems. The more =
aliases included the better.


From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 02:10:41 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 03B40A2A;
 Tue, 17 Jun 2014 02:10:41 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E4E9C26DB;
 Tue, 17 Jun 2014 02:10:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5H2AelW066631;
 Tue, 17 Jun 2014 02:10:40 GMT (envelope-from kevlo@svn.freebsd.org)
Received: (from kevlo@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5H2Aei8066630;
 Tue, 17 Jun 2014 02:10:40 GMT (envelope-from kevlo@svn.freebsd.org)
Message-Id: <201406170210.s5H2Aei8066630@svn.freebsd.org>
From: Kevin Lo 
Date: Tue, 17 Jun 2014 02:10:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267560 - head/share/man/man3
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 02:10:41 -0000

Author: kevlo
Date: Tue Jun 17 02:10:40 2014
New Revision: 267560
URL: http://svnweb.freebsd.org/changeset/base/267560

Log:
  Add MLINKS for macros decribed in queue.3 manpage.

Modified:
  head/share/man/man3/Makefile

Modified: head/share/man/man3/Makefile
==============================================================================
--- head/share/man/man3/Makefile	Tue Jun 17 00:53:00 2014	(r267559)
+++ head/share/man/man3/Makefile	Tue Jun 17 02:10:40 2014	(r267560)
@@ -68,7 +68,9 @@ MLINKS+=	queue.3 LIST_EMPTY.3 \
 		queue.3 LIST_ENTRY.3 \
 		queue.3 LIST_FIRST.3 \
 		queue.3 LIST_FOREACH.3 \
+		queue.3 LIST_FOREACH_FROM.3 \
 		queue.3 LIST_FOREACH_SAFE.3 \
+		queue.3 LIST_FOREACH_FROM_SAFE.3 \
 		queue.3 LIST_HEAD.3 \
 		queue.3 LIST_HEAD_INITIALIZER.3 \
 		queue.3 LIST_INIT.3 \
@@ -83,7 +85,9 @@ MLINKS+=	queue.3 LIST_EMPTY.3 \
 		queue.3 SLIST_ENTRY.3 \
 		queue.3 SLIST_FIRST.3 \
 		queue.3 SLIST_FOREACH.3 \
+		queue.3 SLIST_FOREACH_FROM.3 \
 		queue.3 SLIST_FOREACH_SAFE.3 \
+		queue.3 SLIST_FOREACH_FROM_SAFE.3 \
 		queue.3 SLIST_HEAD.3 \
 		queue.3 SLIST_HEAD_INITIALIZER.3 \
 		queue.3 SLIST_INIT.3 \
@@ -99,7 +103,9 @@ MLINKS+=	queue.3 LIST_EMPTY.3 \
 		queue.3 STAILQ_ENTRY.3 \
 		queue.3 STAILQ_FIRST.3 \
 		queue.3 STAILQ_FOREACH.3 \
+		queue.3 STAILQ_FOREACH_FROM.3 \
 		queue.3 STAILQ_FOREACH_SAFE.3 \
+		queue.3 STAILQ_FOREACH_FROM_SAFE.3 \
 		queue.3 STAILQ_HEAD.3 \
 		queue.3 STAILQ_HEAD_INITIALIZER.3 \
 		queue.3 STAILQ_INIT.3 \
@@ -117,9 +123,13 @@ MLINKS+=	queue.3 LIST_EMPTY.3 \
 		queue.3 TAILQ_ENTRY.3 \
 		queue.3 TAILQ_FIRST.3 \
 		queue.3 TAILQ_FOREACH.3 \
+		queue.3 TAILQ_FOREACH_FROM.3 \
 		queue.3 TAILQ_FOREACH_REVERSE.3 \
+		queue.3 TAILQ_FOREACH_REVERSE_FROM.3 \
 		queue.3 TAILQ_FOREACH_REVERSE_SAFE.3 \
+		queue.3 TAILQ_FOREACH_REVERSE_FROM_SAFE.3 \
 		queue.3 TAILQ_FOREACH_SAFE.3 \
+		queue.3 TAILQ_FOREACH_FROM_SAFE.3 \
 		queue.3 TAILQ_HEAD.3 \
 		queue.3 TAILQ_HEAD_INITIALIZER.3 \
 		queue.3 TAILQ_INIT.3 \

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 05:29:19 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 832239C;
 Tue, 17 Jun 2014 05:29:19 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 70B732531;
 Tue, 17 Jun 2014 05:29:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5H5TJ0a058450;
 Tue, 17 Jun 2014 05:29:19 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5H5TITT058443;
 Tue, 17 Jun 2014 05:29:18 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201406170529.s5H5TITT058443@svn.freebsd.org>
From: Dmitry Chagin 
Date: Tue, 17 Jun 2014 05:29:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267563 - in head/sys: amd64/linux32 i386/linux kern sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 05:29:19 -0000

Author: dchagin
Date: Tue Jun 17 05:29:18 2014
New Revision: 267563
URL: http://svnweb.freebsd.org/changeset/base/267563

Log:
  Revert r266925 as it can lead to instant panic at fexecve():
  
  To allow to run the interpreter itself add a new ELF branding type.
  
  Pointed out by:	kib, mjg

Modified:
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/i386/linux/linux_sysvec.c
  head/sys/kern/imgact_elf.c
  head/sys/sys/imgact_elf.h

Modified: head/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- head/sys/amd64/linux32/linux32_sysvec.c	Tue Jun 17 05:24:45 2014	(r267562)
+++ head/sys/amd64/linux32/linux32_sysvec.c	Tue Jun 17 05:29:18 2014	(r267563)
@@ -1083,7 +1083,7 @@ static Elf32_Brandinfo linux_brand = {
 	.sysvec		= &elf_linux_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &linux32_brandnote,
-	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE | BI_CAN_EXEC_INTERP
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 static Elf32_Brandinfo linux_glibc2brand = {
@@ -1095,7 +1095,7 @@ static Elf32_Brandinfo linux_glibc2brand
 	.sysvec		= &elf_linux_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &linux32_brandnote,
-	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE | BI_CAN_EXEC_INTERP
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 Elf32_Brandinfo *linux_brandlist[] = {

Modified: head/sys/i386/linux/linux_sysvec.c
==============================================================================
--- head/sys/i386/linux/linux_sysvec.c	Tue Jun 17 05:24:45 2014	(r267562)
+++ head/sys/i386/linux/linux_sysvec.c	Tue Jun 17 05:29:18 2014	(r267563)
@@ -1058,7 +1058,7 @@ static Elf32_Brandinfo linux_brand = {
 	.sysvec		= &elf_linux_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &linux_brandnote,
-	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE | BI_CAN_EXEC_INTERP 
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 static Elf32_Brandinfo linux_glibc2brand = {
@@ -1070,7 +1070,7 @@ static Elf32_Brandinfo linux_glibc2brand
 	.sysvec		= &elf_linux_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &linux_brandnote,
-	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE | BI_CAN_EXEC_INTERP 
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 Elf32_Brandinfo *linux_brandlist[] = {

Modified: head/sys/kern/imgact_elf.c
==============================================================================
--- head/sys/kern/imgact_elf.c	Tue Jun 17 05:24:45 2014	(r267562)
+++ head/sys/kern/imgact_elf.c	Tue Jun 17 05:29:18 2014	(r267563)
@@ -261,8 +261,6 @@ __elfN(get_brandinfo)(struct image_param
 {
 	const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header;
 	Elf_Brandinfo *bi;
-	const char *fname_name, *interp_brand_name;
-	int fname_len, interp_len;
 	boolean_t ret;
 	int i;
 
@@ -313,33 +311,6 @@ __elfN(get_brandinfo)(struct image_param
 		}
 	}
 
-	/* Some ABI allows to run the interpreter itself. */
-	for (i = 0; i < MAX_BRANDS; i++) {
-		bi = elf_brand_list[i];
-		if (bi == NULL || bi->flags & BI_BRAND_NOTE_MANDATORY)
-			continue;
-		if (hdr->e_machine != bi->machine ||
-		    (bi->flags & BI_CAN_EXEC_INTERP) == 0)
-			continue;
-		/*
-		 * Compare the interpreter name not the path to allow run it
-		 * from everywhere.
-		 */
-		interp_brand_name = strrchr(bi->interp_path, '/');
-		if (interp_brand_name == NULL)
-			interp_brand_name = bi->interp_path;
-		interp_len = strlen(interp_brand_name);
-		fname_name = strrchr(imgp->args->fname, '/');
-		if (fname_name == NULL)
-			fname_name = imgp->args->fname;
-		fname_len = strlen(fname_name);
-		if (fname_len < interp_len)
-			continue;
-		ret = strncmp(fname_name, interp_brand_name, interp_len);
-		if (ret == 0)
-			return (bi);
-	}
-
 	/* Lacking a recognized interpreter, try the default brand */
 	for (i = 0; i < MAX_BRANDS; i++) {
 		bi = elf_brand_list[i];

Modified: head/sys/sys/imgact_elf.h
==============================================================================
--- head/sys/sys/imgact_elf.h	Tue Jun 17 05:24:45 2014	(r267562)
+++ head/sys/sys/imgact_elf.h	Tue Jun 17 05:29:18 2014	(r267563)
@@ -77,7 +77,6 @@ typedef struct {
 #define	BI_CAN_EXEC_DYN		0x0001
 #define	BI_BRAND_NOTE		0x0002	/* May have note.ABI-tag section. */
 #define	BI_BRAND_NOTE_MANDATORY	0x0004	/* Must have note.ABI-tag section. */
-#define	BI_CAN_EXEC_INTERP	0x0008	/* Allow to run interpreter itself. */
 } __ElfN(Brandinfo);
 
 __ElfType(Auxargs);

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 06:46:52 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2958A89C;
 Tue, 17 Jun 2014 06:46:52 +0000 (UTC)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BCBBA2AAC;
 Tue, 17 Jun 2014 06:46:51 +0000 (UTC)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s5H6kkwQ078633;
 Tue, 17 Jun 2014 09:46:46 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s5H6kkwQ078633
Received: (from kostik@localhost)
 by tom.home (8.14.9/8.14.8/Submit) id s5H6kkSV078632;
 Tue, 17 Jun 2014 09:46:46 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Tue, 17 Jun 2014 09:46:46 +0300
From: Konstantin Belousov 
To: Roger Pau =?koi8-r?B?TW9ubsOp?= 
Subject: Re: svn commit: r267526 - in head/sys: amd64/amd64 amd64/include
 i386/i386 i386/include x86/include x86/x86 x86/xen
Message-ID: <20140617064646.GI3991@kib.kiev.ua>
References: <201406160843.s5G8h3mk073933@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="D8796BilH3OdfdWD"
Content-Disposition: inline
In-Reply-To: <201406160843.s5G8h3mk073933@svn.freebsd.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 autolearn_force=no version=3.4.0
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 06:46:52 -0000


--D8796BilH3OdfdWD
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Jun 16, 2014 at 08:43:03AM +0000, Roger Pau Monn=C3=A9 wrote:
> Author: royger
> Date: Mon Jun 16 08:43:03 2014
> New Revision: 267526
> URL: http://svnweb.freebsd.org/changeset/base/267526
>=20
> Log:
>   amd64/i386: introduce APIC hooks for different APIC implementations.
>  =20
>   This is needed for Xen PV(H) guests, since there's no hardware lapic
>   available on this kind of domains. This commit should not change
>   functionality.
>  =20
>   Sponsored by: Citrix Systems R&D
>   Reviewed by: jhb
>   Approved by: gibbs
>  =20
>   amd64/include/cpu.h:
>   amd64/amd64/mp_machdep.c:
>   i386/include/cpu.h:
>   i386/i386/mp_machdep.c:
>    - Remove lapic_ipi_vectored hook from cpu_ops, since it's now
>      implemented in the lapic hooks.
>  =20
>   amd64/amd64/mp_machdep.c:
>   i386/i386/mp_machdep.c:
>    - Use lapic_ipi_vectored directly, since it's now an inline function
>      that will call the appropiate hook.
>  =20
>   x86/x86/local_apic.c:
>    - Prefix bare metal public lapic functions with native_ and mark them
>      as static.
>    - Define default implementation of apic_ops.
>  =20
>   x86/include/apicvar.h:
>    - Declare the apic_ops structure and create inline functions to
>      access the hooks, so the change is transparent to existing users of
>      the lapic_ functions.
>  =20
>   x86/xen/hvm.c:
>    - Switch to use the new apic_ops.
>=20
> Modified:
>   head/sys/amd64/amd64/mp_machdep.c
>   head/sys/amd64/include/cpu.h
>   head/sys/i386/i386/mp_machdep.c
>   head/sys/i386/include/cpu.h
>   head/sys/x86/include/apicvar.h
>   head/sys/x86/x86/local_apic.c
>   head/sys/x86/xen/hvm.c
>=20
> Modified: head/sys/x86/x86/local_apic.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/x86/x86/local_apic.c	Mon Jun 16 08:41:57 2014	(r267525)
> +++ head/sys/x86/x86/local_apic.c	Mon Jun 16 08:43:03 2014	(r267526)
> @@ -169,11 +169,76 @@ static void	lapic_timer_stop(struct lapi

> +struct apic_ops apic_ops =3D {
> +	.create			=3D native_lapic_create,
> +	.init			=3D native_lapic_init,
> +	.setup			=3D native_lapic_setup,
> +	.dump			=3D native_lapic_dump,
> +	.disable		=3D native_lapic_disable,
> +	.eoi			=3D native_lapic_eoi,
> +	.id			=3D native_lapic_id,
> +	.intr_pending		=3D native_lapic_intr_pending,
> +	.set_logical_id		=3D native_lapic_set_logical_id,
> +	.cpuid			=3D native_apic_cpuid,
> +	.alloc_vector		=3D native_apic_alloc_vector,
> +	.alloc_vectors		=3D native_apic_alloc_vectors,
> +	.enable_vector		=3D native_apic_enable_vector,
> +	.disable_vector		=3D native_apic_disable_vector,
> +	.free_vector		=3D native_apic_free_vector,
> +	.enable_pmc		=3D native_lapic_enable_pmc,
> +	.disable_pmc		=3D native_lapic_disable_pmc,
> +	.reenable_pmc		=3D native_lapic_reenable_pmc,
> +	.enable_cmc		=3D native_lapic_enable_cmc,
> +	.ipi_raw		=3D native_lapic_ipi_raw,
> +	.ipi_vectored		=3D native_lapic_ipi_vectored,
> +	.ipi_wait		=3D native_lapic_ipi_wait,
> +	.set_lvt_mask		=3D native_lapic_set_lvt_mask,
> +	.set_lvt_mode		=3D native_lapic_set_lvt_mode,
> +	.set_lvt_polarity	=3D native_lapic_set_lvt_polarity,
> +	.set_lvt_triggermode	=3D native_lapic_set_lvt_triggermode,
> +};
> +
>  static uint32_t
>  lvt_mode(struct lapic *la, u_int pin, uint32_t value)
>  {

This breaks UP compilation, since native_lapic_ipi_* methods are
conditionalized on SMP. The patch below worked for me. I think that this
way is better than removing #ifdef SMP braces around native_lapic_ipi_*
functions definitons, because it catches attempts to call IPIs on the UP
machine, if such error ever made.

Do you agree with the fix ?

diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c
index 802168e..b15a02c 100644
--- a/sys/x86/x86/local_apic.c
+++ b/sys/x86/x86/local_apic.c
@@ -230,9 +230,11 @@ struct apic_ops apic_ops =3D {
 	.disable_pmc		=3D native_lapic_disable_pmc,
 	.reenable_pmc		=3D native_lapic_reenable_pmc,
 	.enable_cmc		=3D native_lapic_enable_cmc,
+#ifdef SMP
 	.ipi_raw		=3D native_lapic_ipi_raw,
 	.ipi_vectored		=3D native_lapic_ipi_vectored,
 	.ipi_wait		=3D native_lapic_ipi_wait,
+#endif
 	.set_lvt_mask		=3D native_lapic_set_lvt_mask,
 	.set_lvt_mode		=3D native_lapic_set_lvt_mode,
 	.set_lvt_polarity	=3D native_lapic_set_lvt_polarity,

--D8796BilH3OdfdWD
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJTn+RVAAoJEJDCuSvBvK1BapMP/A2LIdpvlwWk7FyjOVcEDrvl
RfbqLjMmV4/2gb7CaHyAwJtXQhN3X39/L7jm8I2cazdHqE+MqMNH+paXqSd88Ll2
j3qbqXO0YJ0ypv5YrMQ09shcVmbmb3B1k8RTGFtF9J6ezGzQxVCLrE9tBUpHykiC
Ii96A9JbgB63w4jYTrsi75972ccSJWBX39yDfnxf1C7xQZhz/Wt+/+KTj+jbRpjB
2KAoPTgQkbC3C7Cw6bnBVpRcgUkSUZglj0v1AhD73vgL5EJs9I7BgcIYOf29rbab
Ioedtiy1SgGiarorqe/eKv3niOnv3D4go1uJYtd3KRujb/RPigiE40b0lpw1WPNd
JP+pqjmCeNdl3xDJ36Qy3HSP1g+huKrCha+IrPGoWUz2QI19iCTqxltKPbzcYRkJ
YzdtMFDs2FojE/TKbdmj1h4Zsfmp+8RIPf7COyq/y16tJB02VhSQTo/0nYYdSN8F
OdkgSQmjCHJ+/k+kmfPT01X+ak8Mf3RwFRo7FuI/Z1u7v5qhTWzPIcGfQfBnp8CW
oHutDIT2h6e1/6TYfNtEjTcl8XBATKPs0zDYN73JOyJ1+7ieQ1bs3Qw6lMvMJU6y
qvKmty61tipIGb4f64QSR4k1nNeliCui5ZVcqqTE0COf4Tw9a7ktZ998JpEA0BIl
lyEanGxg4l2QLn/+W+Mt
=rzI5
-----END PGP SIGNATURE-----

--D8796BilH3OdfdWD--

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 07:11:03 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 13F44D14;
 Tue, 17 Jun 2014 07:11:03 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id F407F2C3E;
 Tue, 17 Jun 2014 07:11:02 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5H7B2M8006095;
 Tue, 17 Jun 2014 07:11:02 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5H7B1G2006079;
 Tue, 17 Jun 2014 07:11:01 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201406170711.s5H7B1G2006079@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 17 Jun 2014 07:11:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267564 - in head/sys: fs/devfs fs/msdosfs fs/tmpfs kern
 sys ufs/ufs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 07:11:03 -0000

Author: kib
Date: Tue Jun 17 07:11:00 2014
New Revision: 267564
URL: http://svnweb.freebsd.org/changeset/base/267564

Log:
  In msdosfs_setattr(), add a check for result of the utimes(2)
  permissions test, forgotten in r164033.
  
  Refactor the permission checks for utimes(2) into vnode helper
  function vn_utimes_perm(9), and simplify its code comparing with the
  UFS origin, by writing the call to VOP_ACCESSX only once.  Use the
  helper for UFS(5), tmpfs(5), devfs(5) and msdosfs(5).
  
  Reported by:	bde
  Reviewed by:	bde, trasz
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/fs/devfs/devfs_vnops.c
  head/sys/fs/msdosfs/msdosfs_vnops.c
  head/sys/fs/tmpfs/tmpfs.h
  head/sys/fs/tmpfs/tmpfs_subr.c
  head/sys/fs/tmpfs/tmpfs_vnops.c
  head/sys/kern/vfs_vnops.c
  head/sys/sys/vnode.h
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- head/sys/fs/devfs/devfs_vnops.c	Tue Jun 17 05:29:18 2014	(r267563)
+++ head/sys/fs/devfs/devfs_vnops.c	Tue Jun 17 07:11:00 2014	(r267564)
@@ -1533,10 +1533,8 @@ devfs_setattr(struct vop_setattr_args *a
 	}
 
 	if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) {
-		/* See the comment in ufs_vnops::ufs_setattr(). */
-		if ((error = VOP_ACCESS(vp, VADMIN, ap->a_cred, td)) &&
-		    ((vap->va_vaflags & VA_UTIMES_NULL) == 0 ||
-		    (error = VOP_ACCESS(vp, VWRITE, ap->a_cred, td))))
+		error = vn_utimes_perm(vp, vap, ap->a_cred, td);
+		if (error != 0)
 			return (error);
 		if (vap->va_atime.tv_sec != VNOVAL) {
 			if (vp->v_type == VCHR)

Modified: head/sys/fs/msdosfs/msdosfs_vnops.c
==============================================================================
--- head/sys/fs/msdosfs/msdosfs_vnops.c	Tue Jun 17 05:29:18 2014	(r267563)
+++ head/sys/fs/msdosfs/msdosfs_vnops.c	Tue Jun 17 07:11:00 2014	(r267564)
@@ -501,12 +501,9 @@ msdosfs_setattr(ap)
 	if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) {
 		if (vp->v_mount->mnt_flag & MNT_RDONLY)
 			return (EROFS);
-		if (vap->va_vaflags & VA_UTIMES_NULL) {
-			error = VOP_ACCESS(vp, VADMIN, cred, td); 
-			if (error)
-				error = VOP_ACCESS(vp, VWRITE, cred, td);
-		} else
-			error = VOP_ACCESS(vp, VADMIN, cred, td);
+		error = vn_utimes_perm(vp, vap, cred, td);
+		if (error != 0)
+			return (error);
 		if ((pmp->pm_flags & MSDOSFSMNT_NOWIN95) == 0 &&
 		    vap->va_atime.tv_sec != VNOVAL) {
 			dep->de_flag &= ~DE_ACCESS;

Modified: head/sys/fs/tmpfs/tmpfs.h
==============================================================================
--- head/sys/fs/tmpfs/tmpfs.h	Tue Jun 17 05:29:18 2014	(r267563)
+++ head/sys/fs/tmpfs/tmpfs.h	Tue Jun 17 07:11:00 2014	(r267564)
@@ -425,8 +425,8 @@ int	tmpfs_chmod(struct vnode *, mode_t, 
 int	tmpfs_chown(struct vnode *, uid_t, gid_t, struct ucred *,
 	    struct thread *);
 int	tmpfs_chsize(struct vnode *, u_quad_t, struct ucred *, struct thread *);
-int	tmpfs_chtimes(struct vnode *, struct timespec *, struct timespec *,
-	    struct timespec *, int, struct ucred *, struct thread *);
+int	tmpfs_chtimes(struct vnode *, struct vattr *, struct ucred *cred,
+	    struct thread *);
 void	tmpfs_itimes(struct vnode *, const struct timespec *,
 	    const struct timespec *);
 

Modified: head/sys/fs/tmpfs/tmpfs_subr.c
==============================================================================
--- head/sys/fs/tmpfs/tmpfs_subr.c	Tue Jun 17 05:29:18 2014	(r267563)
+++ head/sys/fs/tmpfs/tmpfs_subr.c	Tue Jun 17 07:11:00 2014	(r267564)
@@ -1677,8 +1677,8 @@ tmpfs_chsize(struct vnode *vp, u_quad_t 
  * The vnode must be locked on entry and remain locked on exit.
  */
 int
-tmpfs_chtimes(struct vnode *vp, struct timespec *atime, struct timespec *mtime,
-	struct timespec *birthtime, int vaflags, struct ucred *cred, struct thread *l)
+tmpfs_chtimes(struct vnode *vp, struct vattr *vap,
+    struct ucred *cred, struct thread *l)
 {
 	int error;
 	struct tmpfs_node *node;
@@ -1695,29 +1695,25 @@ tmpfs_chtimes(struct vnode *vp, struct t
 	if (node->tn_flags & (IMMUTABLE | APPEND))
 		return EPERM;
 
-	/* Determine if the user have proper privilege to update time. */
-	if (vaflags & VA_UTIMES_NULL) {
-		error = VOP_ACCESS(vp, VADMIN, cred, l);
-		if (error)
-			error = VOP_ACCESS(vp, VWRITE, cred, l);
-	} else
-		error = VOP_ACCESS(vp, VADMIN, cred, l);
-	if (error)
+	error = vn_utimes_perm(vp, vap, cred, l);
+	if (error != 0)
 		return (error);
 
-	if (atime->tv_sec != VNOVAL && atime->tv_nsec != VNOVAL)
+	if (vap->va_atime.tv_sec != VNOVAL && vap->va_atime.tv_nsec != VNOVAL)
 		node->tn_status |= TMPFS_NODE_ACCESSED;
 
-	if (mtime->tv_sec != VNOVAL && mtime->tv_nsec != VNOVAL)
+	if (vap->va_mtime.tv_sec != VNOVAL && vap->va_mtime.tv_nsec != VNOVAL)
 		node->tn_status |= TMPFS_NODE_MODIFIED;
 
-	if (birthtime->tv_nsec != VNOVAL && birthtime->tv_nsec != VNOVAL)
+	if (vap->va_birthtime.tv_nsec != VNOVAL &&
+	    vap->va_birthtime.tv_nsec != VNOVAL)
 		node->tn_status |= TMPFS_NODE_MODIFIED;
 
-	tmpfs_itimes(vp, atime, mtime);
+	tmpfs_itimes(vp, &vap->va_atime, &vap->va_mtime);
 
-	if (birthtime->tv_nsec != VNOVAL && birthtime->tv_nsec != VNOVAL)
-		node->tn_birthtime = *birthtime;
+	if (vap->va_birthtime.tv_nsec != VNOVAL &&
+	    vap->va_birthtime.tv_nsec != VNOVAL)
+		node->tn_birthtime = vap->va_birthtime;
 	MPASS(VOP_ISLOCKED(vp));
 
 	return 0;

Modified: head/sys/fs/tmpfs/tmpfs_vnops.c
==============================================================================
--- head/sys/fs/tmpfs/tmpfs_vnops.c	Tue Jun 17 05:29:18 2014	(r267563)
+++ head/sys/fs/tmpfs/tmpfs_vnops.c	Tue Jun 17 07:11:00 2014	(r267564)
@@ -378,10 +378,6 @@ tmpfs_getattr(struct vop_getattr_args *v
 	return 0;
 }
 
-/* --------------------------------------------------------------------- */
-
-/* XXX Should this operation be atomic?  I think it should, but code in
- * XXX other places (e.g., ufs) doesn't seem to be... */
 int
 tmpfs_setattr(struct vop_setattr_args *v)
 {
@@ -425,8 +421,7 @@ tmpfs_setattr(struct vop_setattr_args *v
 	    vap->va_mtime.tv_nsec != VNOVAL) ||
 	    (vap->va_birthtime.tv_sec != VNOVAL &&
 	    vap->va_birthtime.tv_nsec != VNOVAL)))
-		error = tmpfs_chtimes(vp, &vap->va_atime, &vap->va_mtime,
-			&vap->va_birthtime, vap->va_vaflags, cred, td);
+		error = tmpfs_chtimes(vp, vap, cred, td);
 
 	/* Update the node times.  We give preference to the error codes
 	 * generated by this function rather than the ones that may arise

Modified: head/sys/kern/vfs_vnops.c
==============================================================================
--- head/sys/kern/vfs_vnops.c	Tue Jun 17 05:29:18 2014	(r267563)
+++ head/sys/kern/vfs_vnops.c	Tue Jun 17 07:11:00 2014	(r267564)
@@ -2170,3 +2170,27 @@ drop:
 	foffset_unlock(fp, offset, error != 0 ? FOF_NOUPDATE : 0);
 	return (error);
 }
+
+int
+vn_utimes_perm(struct vnode *vp, struct vattr *vap, struct ucred *cred,
+    struct thread *td)
+{
+	int error;
+
+	error = VOP_ACCESSX(vp, VWRITE_ATTRIBUTES, cred, td);
+
+	/*
+	 * From utimes(2):
+	 * Grant permission if the caller is the owner of the file or
+	 * the super-user.  If the time pointer is null, then write
+	 * permission on the file is also sufficient.
+	 *
+	 * From NFSv4.1, draft 21, 6.2.1.3.1, Discussion of Mask Attributes:
+	 * A user having ACL_WRITE_DATA or ACL_WRITE_ATTRIBUTES
+	 * will be allowed to set the times [..] to the current
+	 * server time.
+	 */
+	if (error != 0 && (vap->va_vaflags & VA_UTIMES_NULL) != 0)
+		error = VOP_ACCESS(vp, VWRITE, cred, td);
+	return (error);
+}

Modified: head/sys/sys/vnode.h
==============================================================================
--- head/sys/sys/vnode.h	Tue Jun 17 05:29:18 2014	(r267563)
+++ head/sys/sys/vnode.h	Tue Jun 17 07:11:00 2014	(r267564)
@@ -696,6 +696,8 @@ int	vn_extattr_rm(struct vnode *vp, int 
 	    const char *attrname, struct thread *td);
 int	vn_vget_ino(struct vnode *vp, ino_t ino, int lkflags,
 	    struct vnode **rvp);
+int	vn_utimes_perm(struct vnode *vp, struct vattr *vap,
+	    struct ucred *cred, struct thread *td);
 
 int	vn_io_fault_uiomove(char *data, int xfersize, struct uio *uio);
 int	vn_io_fault_pgmove(vm_page_t ma[], vm_offset_t offset, int xfersize,

Modified: head/sys/ufs/ufs/ufs_vnops.c
==============================================================================
--- head/sys/ufs/ufs/ufs_vnops.c	Tue Jun 17 05:29:18 2014	(r267563)
+++ head/sys/ufs/ufs/ufs_vnops.c	Tue Jun 17 07:11:00 2014	(r267564)
@@ -635,35 +635,8 @@ ufs_setattr(ap)
 			return (EROFS);
 		if ((ip->i_flags & SF_SNAPSHOT) != 0)
 			return (EPERM);
-		/*
-		 * From utimes(2):
-		 * If times is NULL, ... The caller must be the owner of
-		 * the file, have permission to write the file, or be the
-		 * super-user.
-		 * If times is non-NULL, ... The caller must be the owner of
-		 * the file or be the super-user.
-		 *
-		 * Possibly for historical reasons, try to use VADMIN in
-		 * preference to VWRITE for a NULL timestamp.  This means we
-		 * will return EACCES in preference to EPERM if neither
-		 * check succeeds.
-		 */
-		if (vap->va_vaflags & VA_UTIMES_NULL) {
-			/*
-			 * NFSv4.1, draft 21, 6.2.1.3.1, Discussion of Mask Attributes
-			 *
-			 * "A user having ACL_WRITE_DATA or ACL_WRITE_ATTRIBUTES
-			 * will be allowed to set the times [..] to the current
-			 * server time."
-			 *
-			 * XXX: Calling it four times seems a little excessive.
-			 */
-			error = VOP_ACCESSX(vp, VWRITE_ATTRIBUTES, cred, td);
-			if (error)
-				error = VOP_ACCESS(vp, VWRITE, cred, td);
-		} else
-			error = VOP_ACCESSX(vp, VWRITE_ATTRIBUTES, cred, td);
-		if (error)
+		error = vn_utimes_perm(vp, vap, cred, td);
+		if (error != 0)
 			return (error);
 		if (vap->va_atime.tv_sec != VNOVAL)
 			ip->i_flag |= IN_ACCESS;

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 08:11:45 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C772E69E;
 Tue, 17 Jun 2014 08:11:45 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B494E21C7;
 Tue, 17 Jun 2014 08:11:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5H8BjNi034957;
 Tue, 17 Jun 2014 08:11:45 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5H8Bjca034956;
 Tue, 17 Jun 2014 08:11:45 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201406170811.s5H8Bjca034956@svn.freebsd.org>
From: Xin LI 
Date: Tue, 17 Jun 2014 08:11:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267572 - head/cddl/contrib/opensolaris/cmd/zdb
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 08:11:46 -0000

Author: delphij
Date: Tue Jun 17 08:11:45 2014
New Revision: 267572
URL: http://svnweb.freebsd.org/changeset/base/267572

Log:
  MFV r249332 (illumos-gate 14005:55fc53126003)
  
  Illumos ZFS issues:
    3654 zdb should print number of ganged blocks
  
  MFC after:	2 weeks

Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Tue Jun 17 08:09:40 2014	(r267571)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Tue Jun 17 08:11:45 2014	(r267572)
@@ -2108,6 +2108,8 @@ typedef struct zdb_blkstats {
 	uint64_t zb_lsize;
 	uint64_t zb_psize;
 	uint64_t zb_count;
+	uint64_t zb_gangs;
+	uint64_t zb_ditto_samevdev;
 	uint64_t zb_psize_histogram[PSIZE_HISTO_SIZE];
 } zdb_blkstats_t;
 
@@ -2155,6 +2157,7 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t *
 	for (int i = 0; i < 4; i++) {
 		int l = (i < 2) ? BP_GET_LEVEL(bp) : ZB_TOTAL;
 		int t = (i & 1) ? type : ZDB_OT_TOTAL;
+		int equal;
 		zdb_blkstats_t *zb = &zcb->zcb_type[l][t];
 
 		zb->zb_asize += BP_GET_ASIZE(bp);
@@ -2162,6 +2165,27 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t *
 		zb->zb_psize += BP_GET_PSIZE(bp);
 		zb->zb_count++;
 		zb->zb_psize_histogram[BP_GET_PSIZE(bp) >> SPA_MINBLOCKSHIFT]++;
+
+		zb->zb_gangs += BP_COUNT_GANG(bp);
+
+		switch (BP_GET_NDVAS(bp)) {
+		case 2:
+			if (DVA_GET_VDEV(&bp->blk_dva[0]) ==
+			    DVA_GET_VDEV(&bp->blk_dva[1]))
+				zb->zb_ditto_samevdev++;
+			break;
+		case 3:
+			equal = (DVA_GET_VDEV(&bp->blk_dva[0]) ==
+			    DVA_GET_VDEV(&bp->blk_dva[1])) +
+			    (DVA_GET_VDEV(&bp->blk_dva[0]) ==
+			    DVA_GET_VDEV(&bp->blk_dva[2])) +
+			    (DVA_GET_VDEV(&bp->blk_dva[1]) ==
+			    DVA_GET_VDEV(&bp->blk_dva[2]));
+			if (equal != 0)
+				zb->zb_ditto_samevdev++;
+			break;
+		}
+
 	}
 
 	if (dump_opt['L'])
@@ -2552,6 +2576,8 @@ dump_block_stats(spa_t *spa)
 	(void) printf("\n");
 	(void) printf("\tbp count:      %10llu\n",
 	    (u_longlong_t)tzb->zb_count);
+	(void) printf("\tganged count:  %10llu\n",
+	    (longlong_t)tzb->zb_gangs);
 	(void) printf("\tbp logical:    %10llu      avg: %6llu\n",
 	    (u_longlong_t)tzb->zb_lsize,
 	    (u_longlong_t)(tzb->zb_lsize / tzb->zb_count));
@@ -2573,6 +2599,11 @@ dump_block_stats(spa_t *spa)
 	(void) printf("\tSPA allocated: %10llu     used: %5.2f%%\n",
 	    (u_longlong_t)norm_alloc, 100.0 * norm_alloc / norm_space);
 
+	if (tzb->zb_ditto_samevdev != 0) {
+		(void) printf("\tDittoed blocks on same vdev: %llu\n",
+		    (longlong_t)tzb->zb_ditto_samevdev);
+	}
+
 	if (dump_opt['b'] >= 2) {
 		int l, t, level;
 		(void) printf("\nBlocks\tLSIZE\tPSIZE\tASIZE"
@@ -2580,7 +2611,7 @@ dump_block_stats(spa_t *spa)
 
 		for (t = 0; t <= ZDB_OT_TOTAL; t++) {
 			char csize[32], lsize[32], psize[32], asize[32];
-			char avg[32];
+			char avg[32], gang[32];
 			char *typename;
 
 			if (t < DMU_OT_NUMTYPES)
@@ -2621,6 +2652,7 @@ dump_block_stats(spa_t *spa)
 				zdb_nicenum(zb->zb_psize, psize);
 				zdb_nicenum(zb->zb_asize, asize);
 				zdb_nicenum(zb->zb_asize / zb->zb_count, avg);
+				zdb_nicenum(zb->zb_gangs, gang);
 
 				(void) printf("%6s\t%5s\t%5s\t%5s\t%5s"
 				    "\t%5.2f\t%6.2f\t",
@@ -2634,6 +2666,11 @@ dump_block_stats(spa_t *spa)
 					(void) printf("    L%d %s\n",
 					    level, typename);
 
+				if (dump_opt['b'] >= 3 && zb->zb_gangs > 0) {
+					(void) printf("\t number of ganged "
+					    "blocks: %s\n", gang);
+				}
+
 				if (dump_opt['b'] >= 4) {
 					(void) printf("psize "
 					    "(in 512-byte sectors): "

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 08:16:59 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0A87BACE;
 Tue, 17 Jun 2014 08:16:59 +0000 (UTC)
Received: from mail-we0-x233.google.com (mail-we0-x233.google.com
 [IPv6:2a00:1450:400c:c03::233])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 45B662206;
 Tue, 17 Jun 2014 08:16:58 +0000 (UTC)
Received: by mail-we0-f179.google.com with SMTP id w62so6952738wes.10
 for ; Tue, 17 Jun 2014 01:16:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
 :references:in-reply-to:content-type:content-transfer-encoding;
 bh=hcKCtZg+YQJboZ65FjM8ro76P6tSdIfqvtAKUE27Q6s=;
 b=kUWuMMV36Hp0ct+9Ptt4jkUPv93L97R7Oil7SdaJr7INzzR6DEVRwSd5qVtCk3VbYd
 5fNjZNSXOX+cXVHvKZM9ZmWmX9DwH01+jPb2E+9VcPQBk0guOz2kras+L+NYsrLwfSNB
 0NaueFSCkGc1tSMArvARyWWj7dOzB0IQi9aToBRHAQTaCZseMxNCINZaxdmXNaeR9cjc
 Cy6ICgpjiXAbt+OdvBKqEaoxKKUz7h/mTX5/nbH6wc3MVpemVAlOm25c+9mU5FrIUzNu
 vwpw+iSkcamBPknzHoOsyLVE1Am33qs/h665ghpAH9YAoMac3RAALTBEhm+w1Re95Yuu
 53Ug==
X-Received: by 10.181.8.67 with SMTP id di3mr33987094wid.8.1402993016535;
 Tue, 17 Jun 2014 01:16:56 -0700 (PDT)
Received: from [172.16.1.30] (39.Red-2-136-52.dynamicIP.rima-tde.net.
 [2.136.52.39])
 by mx.google.com with ESMTPSA id i6sm18800110wiy.17.2014.06.17.01.16.55
 for 
 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Tue, 17 Jun 2014 01:16:55 -0700 (PDT)
Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= 
Message-ID: <539FF970.2040504@FreeBSD.org>
Date: Tue, 17 Jun 2014 10:16:48 +0200
From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= 
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Konstantin Belousov 
Subject: Re: svn commit: r267526 - in head/sys: amd64/amd64 amd64/include
 i386/i386 i386/include x86/include x86/x86 x86/xen
References: <201406160843.s5G8h3mk073933@svn.freebsd.org>
 <20140617064646.GI3991@kib.kiev.ua>
In-Reply-To: <20140617064646.GI3991@kib.kiev.ua>
X-Enigmail-Version: 1.6
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 08:16:59 -0000

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 17/06/14 08:46, Konstantin Belousov wrote:
> On Mon, Jun 16, 2014 at 08:43:03AM +0000, Roger Pau Monnц╘ wrote:
>> Author: royger Date: Mon Jun 16 08:43:03 2014 New Revision: 
>> 267526 URL: http://svnweb.freebsd.org/changeset/base/267526
>> 
>> Log: amd64/i386: introduce APIC hooks for different APIC 
>> implementations.
>> 
>> This is needed for Xen PV(H) guests, since there's no hardware 
>> lapic available on this kind of domains. This commit should not 
>> change functionality.
>> 
>> Sponsored by: Citrix Systems R&D Reviewed by: jhb Approved by: 
>> gibbs
>> 
>> amd64/include/cpu.h: amd64/amd64/mp_machdep.c: 
>> i386/include/cpu.h: i386/i386/mp_machdep.c: - Remove 
>> lapic_ipi_vectored hook from cpu_ops, since it's now implemented
>>  in the lapic hooks.
>> 
>> amd64/amd64/mp_machdep.c: i386/i386/mp_machdep.c: - Use 
>> lapic_ipi_vectored directly, since it's now an inline function 
>> that will call the appropiate hook.
>> 
>> x86/x86/local_apic.c: - Prefix bare metal public lapic functions
>>  with native_ and mark them as static. - Define default 
>> implementation of apic_ops.
>> 
>> x86/include/apicvar.h: - Declare the apic_ops structure and 
>> create inline functions to access the hooks, so the change is 
>> transparent to existing users of the lapic_ functions.
>> 
>> x86/xen/hvm.c: - Switch to use the new apic_ops.
>> 
>> Modified: head/sys/amd64/amd64/mp_machdep.c 
>> head/sys/amd64/include/cpu.h head/sys/i386/i386/mp_machdep.c 
>> head/sys/i386/include/cpu.h head/sys/x86/include/apicvar.h 
>> head/sys/x86/x86/local_apic.c head/sys/x86/xen/hvm.c
>> 
>> Modified: head/sys/x86/x86/local_apic.c 
>> ==============================================================================
>>
>>
>>
>>
>>
>> 
- --- head/sys/x86/x86/local_apic.c	Mon Jun 16 08:41:57 2014	(r267525)
>> +++ head/sys/x86/x86/local_apic.c	Mon Jun 16 08:43:03 2014 
>> (r267526) @@ -169,11 +169,76 @@ static void 
>> lapic_timer_stop(struct lapi
> 
>> +struct apic_ops apic_ops = { +	.create			= native_lapic_create, 
>> +	.init			= native_lapic_init, +	.setup			= native_lapic_setup, +
>> .dump			= native_lapic_dump, +	.disable		= native_lapic_disable,
>> +	.eoi			= native_lapic_eoi, +	.id			= native_lapic_id, +
>> .intr_pending		= native_lapic_intr_pending, + .set_logical_id		=
>> native_lapic_set_logical_id, +	.cpuid			= native_apic_cpuid, +
>> .alloc_vector		= native_apic_alloc_vector, + .alloc_vectors		=
>> native_apic_alloc_vectors, +	.enable_vector		= 
>> native_apic_enable_vector, +	.disable_vector		= 
>> native_apic_disable_vector, +	.free_vector		= 
>> native_apic_free_vector, +	.enable_pmc		= 
>> native_lapic_enable_pmc, +	.disable_pmc		= 
>> native_lapic_disable_pmc, +	.reenable_pmc		= 
>> native_lapic_reenable_pmc, +	.enable_cmc		= 
>> native_lapic_enable_cmc, +	.ipi_raw		= native_lapic_ipi_raw, + 
>> .ipi_vectored		= native_lapic_ipi_vectored, +	.ipi_wait		= 
>> native_lapic_ipi_wait, +	.set_lvt_mask		= 
>> native_lapic_set_lvt_mask, +	.set_lvt_mode		= 
>> native_lapic_set_lvt_mode, +	.set_lvt_polarity	= 
>> native_lapic_set_lvt_polarity, +	.set_lvt_triggermode	= 
>> native_lapic_set_lvt_triggermode, +}; + static uint32_t 
>> lvt_mode(struct lapic *la, u_int pin, uint32_t value) {
> 
> This breaks UP compilation, since native_lapic_ipi_* methods are 
> conditionalized on SMP. The patch below worked for me. I think that
> this way is better than removing #ifdef SMP braces around 
> native_lapic_ipi_* functions definitons, because it catches 
> attempts to call IPIs on the UP machine, if such error ever made.
> 
> Do you agree with the fix ?

Yes, I think it would also be good to gate the lapic_ipi_* inline
functions in x86/include/apicvar.h on SMP being defined, so that we
get a build error instead of a run time dereference if someone tries
to use them on !SMP:

diff --git a/sys/x86/include/apicvar.h b/sys/x86/include/apicvar.h
index 35603e8..44cfae1 100644
- --- a/sys/x86/include/apicvar.h
+++ b/sys/x86/include/apicvar.h
@@ -362,6 +362,7 @@ lapic_enable_cmc(void)
 	apic_ops.enable_cmc();
 }

+#ifdef SMP
 static inline void
 lapic_ipi_raw(register_t icrlo, u_int dest)
 {
@@ -382,6 +383,7 @@ lapic_ipi_wait(int delay)

 	return (apic_ops.ipi_wait(delay));
 }
+#endif

 static inline int
 lapic_set_lvt_mask(u_int apic_id, u_int lvt, u_char masked)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (Darwin)

iQEcBAEBAgAGBQJTn/lwAAoJEKXZdqUyumTAHs0H/Au9u9tJoFuyf3ALVMDvuR4f
3KuA9hRehVicRUptI8ZElHMNZF3Ey/RClz44CGp11Tdr6Aqn3jY2Q3pZC297opfe
m6+4Lk3EZHwVQ9tjYMxiOCBW8aWnazw5gqM/JLfxTYullKQyPddc4Vnighmffd72
KAt3TqruzynBdXc4JZlAj/jqKNiPPsAj5gel5roGVMWTYtpeeH5qpJicqrPdb6aQ
fNwbFhJ37LFvQ5nC0gJiHnPb5G4Koz/4VFeh0ZFeMA+PfH6r5T9/TV0eB3tPzlUm
Q6adtzGGHs2XkSyZKlBlkDTDwusQwrB6TQz/Ej6tPt3wVd+Q7JhHR1vcXAUiUJQ=
=ug7Z
-----END PGP SIGNATURE-----

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 09:02:11 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3BEEC5D8;
 Tue, 17 Jun 2014 09:02:11 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 291DC2648;
 Tue, 17 Jun 2014 09:02:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5H92Aut058018;
 Tue, 17 Jun 2014 09:02:10 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5H92AMm058016;
 Tue, 17 Jun 2014 09:02:10 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201406170902.s5H92AMm058016@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Tue, 17 Jun 2014 09:02:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267574 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 09:02:11 -0000

Author: trasz
Date: Tue Jun 17 09:02:10 2014
New Revision: 267574
URL: http://svnweb.freebsd.org/changeset/base/267574

Log:
  Make cs_terminating a bool; no functional changes.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/cam/ctl/ctl_frontend_iscsi.h

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Tue Jun 17 08:56:16 2014	(r267573)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Tue Jun 17 09:02:10 2014	(r267574)
@@ -1130,8 +1130,6 @@ cfiscsi_maintenance_thread(void *arg)
 			icl_conn_shutdown(cs->cs_conn);
 			icl_conn_close(cs->cs_conn);
 
-			cs->cs_terminating++;
-
 			/*
 			 * XXX: We used to wait up to 30 seconds to deliver queued PDUs
 			 * 	to the initiator.  We also tried hard to deliver SCSI Responses
@@ -1151,9 +1149,9 @@ static void
 cfiscsi_session_terminate(struct cfiscsi_session *cs)
 {
 
-	if (cs->cs_terminating != 0)
+	if (cs->cs_terminating)
 		return;
-	cs->cs_terminating = 1;
+	cs->cs_terminating = true;
 	cv_signal(&cs->cs_maintenance_cv);
 #ifdef ICL_KERNEL_PROXY
 	cv_signal(&cs->cs_login_cv);

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.h
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.h	Tue Jun 17 08:56:16 2014	(r267573)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.h	Tue Jun 17 09:02:10 2014	(r267574)
@@ -72,7 +72,7 @@ struct cfiscsi_session {
 	int				cs_timeout;
 	int				cs_portal_group_tag;
 	struct cv			cs_maintenance_cv;
-	int				cs_terminating;
+	bool				cs_terminating;
 	size_t				cs_max_data_segment_length;
 	size_t				cs_max_burst_length;
 	bool				cs_immediate_data;

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 09:33:23 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 39ADED16;
 Tue, 17 Jun 2014 09:33:23 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 26FAC2922;
 Tue, 17 Jun 2014 09:33:23 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5H9XNOJ072272;
 Tue, 17 Jun 2014 09:33:23 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5H9XNGG072271;
 Tue, 17 Jun 2014 09:33:23 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201406170933.s5H9XNGG072271@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 17 Jun 2014 09:33:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267575 - head/sys/x86/x86
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 09:33:23 -0000

Author: kib
Date: Tue Jun 17 09:33:22 2014
New Revision: 267575
URL: http://svnweb.freebsd.org/changeset/base/267575

Log:
  Do not reference native_lapic_ipi_*() functions in the UP build.
  The functions' definitions are protected by #ifdef SMP.
  Keeping apic_ops.ipi_*() methods NULL would allow to catch the use
  on UP machines.
  
  Reviewed by:	royger
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/x86/x86/local_apic.c

Modified: head/sys/x86/x86/local_apic.c
==============================================================================
--- head/sys/x86/x86/local_apic.c	Tue Jun 17 09:02:10 2014	(r267574)
+++ head/sys/x86/x86/local_apic.c	Tue Jun 17 09:33:22 2014	(r267575)
@@ -230,9 +230,11 @@ struct apic_ops apic_ops = {
 	.disable_pmc		= native_lapic_disable_pmc,
 	.reenable_pmc		= native_lapic_reenable_pmc,
 	.enable_cmc		= native_lapic_enable_cmc,
+#ifdef SMP
 	.ipi_raw		= native_lapic_ipi_raw,
 	.ipi_vectored		= native_lapic_ipi_vectored,
 	.ipi_wait		= native_lapic_ipi_wait,
+#endif
 	.set_lvt_mask		= native_lapic_set_lvt_mask,
 	.set_lvt_mode		= native_lapic_set_lvt_mode,
 	.set_lvt_polarity	= native_lapic_set_lvt_polarity,

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 09:51:15 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0B0BF4A0
 for ; Tue, 17 Jun 2014 09:51:15 +0000 (UTC)
Received: from mail-ve0-x248.google.com (mail-ve0-x248.google.com
 [IPv6:2607:f8b0:400c:c01::248])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id C29292A8F
 for ; Tue, 17 Jun 2014 09:51:14 +0000 (UTC)
Received: by mail-ve0-f200.google.com with SMTP id i13so19790399veh.11
 for ; Tue, 17 Jun 2014 02:51:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:message-id:date:subject:from:to:content-type;
 bh=ec0TA8wTMhH2IFxh2xFxU31vrTwmR/3sUleS2uTCa6o=;
 b=Tm9sNTpSfp04Q4oIvQBkjvy9mvd78gL9gS6JhEu3sSZ2cUEJlfSTpjqnDAXO/aIBAm
 yJdDvjm0D7gawJ5fhcHluq7YPE3O+NYCYO2YX3M1bI5oaYoYyzuq4qc1IsmV0W8k/rkx
 2bARk9Z1kNsu9fm0Pyf5c1vOZLO6dP1RrWKKIJDbsZqbkvk31Xi+SVb0Cgm+dO6m63ZP
 DyYGAT/fO+weF6/gb/W1dARY3sBSu4BXF8KwDPa5PYlRKhqnx5nLdEQz68J0CQIhJseF
 aeLlDwbWRb0jydoRS1DV0+NEnGUHp8qJS8OTkEnIxOc/VwYtz9N/jSRJA3p/kJqwGPGk
 OjJQ==
MIME-Version: 1.0
X-Received: by 10.236.222.162 with SMTP id t32mr33577yhp.47.1402998673890;
 Tue, 17 Jun 2014 02:51:13 -0700 (PDT)
Message-ID: <001a11c1dbbc93dfb204fc051515@google.com>
Date: Tue, 17 Jun 2014 09:51:13 +0000
Subject: www.freebsd.org
From: Georgia 
To: svn-src-head@freebsd.org
Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes
X-Content-Filtered-By: Mailman/MimeDel 2.1.18
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 09:51:15 -0000


     Hi,

I found your contact over the web and wanted to send you a quick note.

With Search Engine Optimization and Web Development, I can help your
business achieve better ranking on prominent search engines like Google,
Bing & others to generate more leads/sales.

This may look like one of those spurious foreign emails you get in your
inbox every day that promise big but delivers nothing. Just to be upfront
we are happy to discuss your requirements.

So, let me know if you are interested in receiving further
information/quote with no strings attached from our team of SEO & Web
experts.

Best regards,
Georgia
Web Expert / Specialist

  *HubScope* SEO LLC
Melbourne | Sydney | Perth | Brisbane | Adelaide & Hobart
Disclaimer: We respect your privacy and want to make sure you are aware of
a few things. By replying to this email, you authorize our affiliates that
can help with your project to call you at the number you provided, and you
understand that they may use automated phone technology to call you. At no
time are you required to make a purchase.


From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 09:52:48 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0D549602;
 Tue, 17 Jun 2014 09:52:48 +0000 (UTC)
Received: from mail-n.franken.de (drew.ipv6.franken.de
 [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 921B72B11;
 Tue, 17 Jun 2014 09:52:47 +0000 (UTC)
Received: from [192.168.1.200] (p508F2AAE.dip0.t-ipconnect.de [80.143.42.174])
 (Authenticated sender: macmic)
 by mail-n.franken.de (Postfix) with ESMTP id 4A8DC1C104DA9;
 Tue, 17 Jun 2014 11:52:43 +0200 (CEST)
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r266083 - in head/sys/arm: arm include
From: Michael Tuexen 
In-Reply-To: 
Date: Tue, 17 Jun 2014 11:52:42 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <1F3FE585-4C04-499E-86CE-BA4DC3F05D97@freebsd.org>
References: <201405141911.s4EJBFZZ097826@svn.freebsd.org>
 <537D0952.2040001@selasky.org>
 <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org>
 <53871493.2010502@selasky.org>
 
 <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de>
 
 
 
 <9B438991-C970-46A7-8116-A490E02D7139@fh-muenster.de>
 <3841D090-5973-40B0-B61C-F15E8C1978C9@FreeBSD.org>
 <3664DBD3-7CEA-43E8-9757-E835BB21FE9E@freebsd.org>
 <5F36DFA5-C5B1-4E5D-88EE-9D60240B40FD@FreeBSD.org>
 <494BE7DA-26BC-43A7-8BC0-ECAE8A75E1EF@freebsd.org>
 <6268E444-F6C7-4B8B-86B7-244A2BB3C4DE@FreeBSD.org>
 <44F7EEB4-46D1-49C7-A4CA-4EA5D41BDF31@freebsd.org>
 
To: Mark R V Murray 
X-Mailer: Apple Mail (2.1878.2)
Cc: Hans Petter Selasky , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 09:52:48 -0000

On 16 Jun 2014, at 22:13, Mark R V Murray  wrote:
Hi Mark,

I just adopted the comments to the code change. So here is the improved =
patch:

Index: cpufunc.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- cpufunc.c	(revision 267575)
+++ cpufunc.c	(working copy)
@@ -1404,18 +1404,36 @@
 static __inline void
 cpu_scc_setup_ccnt(void)
 {
-/* This is how you give userland access to the CCNT and PMCn
- * registers.
- * BEWARE! This gives write access also, which may not be what
- * you want!
- */
+#if defined(CPU_ARM1136) || defined(CPU_ARM1176)
 #ifdef _PMC_USER_READ_WRITE_
-	/* Set PMUSERENR[0] to allow userland access */
+	/* This is how you give userland access to the CCNT and PMCn
+	 * registers.
+	 * BEWARE! This gives write access also, which may not be what
+	 * you want!
+	 * Use the Secure User and Non-secure Access Validation Control =
Register
+	 * to allow userland access=20
+	 */
+	__asm volatile ("mcr	p15, 0, %0, c15, c9, 0\n\t"
+			:
+			: "r"(0x00000001));
+#endif
+	/* Set PMCR[2,0] to enable counters and reset CCNT */
+	__asm volatile ("mcr	p15, 0, %0, c15, c12, 0\n\t"
+			:
+			: "r"(0x00000005));
+#else
+#ifdef _PMC_USER_READ_WRITE_
+	/* This is how you give userland access to the CCNT and PMCn
+	 * registers.
+	 * BEWARE! This gives write access also, which may not be what
+	 * you want!
+	 * Set PMUSERENR[0] to allow userland access
+	 */
 	__asm volatile ("mcr	p15, 0, %0, c9, c14, 0\n\t"
 			:
 			: "r"(0x00000001));
 #endif
-        /* Set up the PMCCNTR register as a cyclecounter:
+	/* Set up the PMCCNTR register as a cyclecounter:
 	 * Set PMINTENCLR to 0xFFFFFFFF to block interrupts
 	 * Set PMCR[2,0] to enable counters and reset CCNT
 	 * Set PMCNTENSET to 0x80000000 to enable CCNT */
@@ -1426,6 +1444,7 @@
 			: "r"(0xFFFFFFFF),
 			  "r"(0x00000005),
 			  "r"(0x80000000));
+#endif
 }
 #endif

Let me know if I can help.

Best regards
Michael
>=20
> On 16 Jun 2014, at 20:38, Michael Tuexen  wrote:
>> Hmm, the documentation reads
>=20
> Which docs are you using?
>=20
> I=92m using DDI0360F. (And that could easily be a wrong choice).
>=20
> M
> --=20
> Mark R V Murray
>=20
>=20


From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 12:59:05 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 05D7C804;
 Tue, 17 Jun 2014 12:59:05 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CCB922C79;
 Tue, 17 Jun 2014 12:59:04 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5HCx4tI066637;
 Tue, 17 Jun 2014 12:59:04 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5HCx4aS066633;
 Tue, 17 Jun 2014 12:59:04 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201406171259.s5HCx4aS066633@svn.freebsd.org>
From: Gavin Atkinson 
Date: Tue, 17 Jun 2014 12:59:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267577 - in head: . usr.bin usr.bin/send-pr
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 12:59:05 -0000

Author: gavin
Date: Tue Jun 17 12:59:03 2014
New Revision: 267577
URL: http://svnweb.freebsd.org/changeset/base/267577

Log:
  Add a stub send-pr that simply points people towards the online support
  pages, to give people used to send-pr a bit of guidance.
  
  MFC after:	3 days

Added:
  head/usr.bin/send-pr/
  head/usr.bin/send-pr/Makefile   (contents, props changed)
  head/usr.bin/send-pr/send-pr.sh   (contents, props changed)
Modified:
  head/ObsoleteFiles.inc
  head/usr.bin/Makefile

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Tue Jun 17 11:58:37 2014	(r267576)
+++ head/ObsoleteFiles.inc	Tue Jun 17 12:59:03 2014	(r267577)
@@ -39,7 +39,6 @@
 # done
 
 # 20140614: send-pr removal
-OLD_FILES+=usr/bin/send-pr
 OLD_FILES+=usr/share/man/man1/send-pr.1.gz
 OLD_FILES+=etc/gnats/freefall
 OLD_DIRS+=etc/gnats

Modified: head/usr.bin/Makefile
==============================================================================
--- head/usr.bin/Makefile	Tue Jun 17 11:58:37 2014	(r267576)
+++ head/usr.bin/Makefile	Tue Jun 17 12:59:03 2014	(r267577)
@@ -143,6 +143,7 @@ SUBDIR=	alias \
 	rwall \
 	script \
 	sed \
+	send-pr \
 	seq \
 	shar \
 	showmount \

Added: head/usr.bin/send-pr/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/usr.bin/send-pr/Makefile	Tue Jun 17 12:59:03 2014	(r267577)
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+SCRIPTS= send-pr.sh
+
+.include 

Added: head/usr.bin/send-pr/send-pr.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/usr.bin/send-pr/send-pr.sh	Tue Jun 17 12:59:03 2014	(r267577)
@@ -0,0 +1,11 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+echo
+echo "FreeBSD has migrated away from GNATS for tracking bugs, and so send-pr"
+echo "is no longer used for submitting bug reports."
+echo "Please see https://www.freebsd.org/support.html for more information."
+echo
+exit 1

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 13:12:31 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2161ED68;
 Tue, 17 Jun 2014 13:12:31 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0E09A2E1D;
 Tue, 17 Jun 2014 13:12:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5HDCVdm075137;
 Tue, 17 Jun 2014 13:12:31 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5HDCUUQ075131;
 Tue, 17 Jun 2014 13:12:30 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201406171312.s5HDCUUQ075131@svn.freebsd.org>
From: Ed Maste 
Date: Tue, 17 Jun 2014 13:12:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267578 - head/share/vt/fonts
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 13:12:31 -0000

Author: emaste
Date: Tue Jun 17 13:12:30 2014
New Revision: 267578
URL: http://svnweb.freebsd.org/changeset/base/267578

Log:
  Add glyphs from converted syscons iso* fonts
  
  This consists of the unique glyphs from the following font files in
  /usr/share/syscons/fonts:
  
  iso*.fnt     ISO-8859-1 West European
  iso02*.fnt   ISO-8859-2 Central European
  iso04*.fnt   ISO-8859-4 Baltic
  iso05*.fnt   ISO-8859-5 Cyrillic
  iso07*.fnt   ISO-8859-7 Greek
  iso08*.fnt   ISO-8859-8 Hebrew
  iso09*.fnt   ISO-8859-9 Turkish
  iso15*.fnt   ISO-8859-15 West European
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/share/vt/fonts/vgarom-8x14.hex
  head/share/vt/fonts/vgarom-8x16.hex
  head/share/vt/fonts/vgarom-8x8.hex
  head/share/vt/fonts/vgarom-thin-8x16.hex

Modified: head/share/vt/fonts/vgarom-8x14.hex
==============================================================================
--- head/share/vt/fonts/vgarom-8x14.hex	Tue Jun 17 12:59:03 2014	(r267577)
+++ head/share/vt/fonts/vgarom-8x14.hex	Tue Jun 17 13:12:30 2014	(r267578)
@@ -101,34 +101,70 @@
 00A1:000018180018183C3C3C18000000
 00A2:0018183C666060663C1818000000
 00A3:00386C6460F0606060E6FC000000
+00A4:000000423C6666663C4200000000
 00A5:000066663C187E187E1818000000
+00A6:0000181818180018181818000000
 00A7:007CC660386CC6C66C380CC67C00
+00A8:0063630000000000000000000000
+00A9:0000003E415D51515D413E000000
 00AA:003C6C6C3E007E00000000000000
 00AB:00000000366CD86C360000000000
 00AC:000000000000FE06060600000000
+00AD:0000000000007F00000000000000
+00AE:0000003E415D555955413E000000
+00AF:007E000000000000000000000000
 00B0:00386C6C38000000000000000000
 00B1:00000018187E18180000FF000000
 00B2:0070D83060C8F800000000000000
+00B3:007C0C380C6C3800000000000000
+00B4:00060C1800000000000000000000
 00B5:00000000666666667C6060C00000
 00B6:00007FDBDBDB7B1B1B1B1B000000
 00B7:0000000000000018000000000000
+00B8:000000000000000000000C0C061C
+00B9:0030703030307800000000000000
 00BA:00386C6C38007C00000000000000
 00BB:00000000D86C366CD80000000000
 00BC:00C0C0C6CCD83066CE9E3E060600
 00BD:00C0C0C6CCD83060DC860C183E00
+00BE:00F03063F66C183367CF1F030300
 00BF:0000303000303060C6C67C000000
+00C0:603018001C3663637F6363000000
+00C1:03060C001C3663637F6363000000
+00C2:081C36001C3663637F6363000000
+00C3:3B6E00081C3663637F6363000000
 00C4:00C6C610386CC6C6FEC6C6000000
 00C5:386C3800386CC6C6FEC6C6000000
 00C6:00003E6CCCCCFECCCCCCCE000000
 00C7:00003C66C2C0C0C2663C0C067C00
+00C8:603018007F33303E30337F000000
 00C9:18306000FE66607C6066FE000000
+00CA:081C36007F33303E30337F000000
+00CB:006363007F33303E30337F000000
+00CC:603018003C18181818183C000000
+00CD:060C18003C18181818183C000000
+00CE:183C66003C18181818183C000000
+00CF:006666003C18181818183C000000
+00D0:00003C3633337B3333363C000000
 00D1:76DC00C6E6F6FEDECEC6C6000000
+00D2:603018001C36636363361C000000
+00D3:03060C001C36636363361C000000
+00D4:081C36001C36636363361C000000
+00D5:003B6E001C36636363361C000000
 00D6:00C6C6386CC6C6C6C66C38000000
+00D7:00000063361C081C366300000000
+00D8:00031E36676F6B7B73363C600000
+00D9:603018006363636363633E000000
+00DA:03060C006363636363633E000000
+00DB:081C36006363636363633E000000
 00DC:00C6C600C6C6C6C6C6C67C000000
+00DD:060C18006666663C18183C000000
+00DE:0078303E33333E30303078000000
 00DF:000000007CC6FCC6C6FCC0C04000
 00E0:0060301800780C7CCCCC76000000
 00E1:0018306000780C7CCCCC76000000
 00E2:0010386C00780C7CCCCC76000000
+00E3:00003B6E003C063E66663B000000
 00E4:0000CCCC00780C7CCCCC76000000
 00E5:00386C3800780C7CCCCC76000000
 00E6:00000000CC76367ED8D86E000000
@@ -141,34 +177,322 @@
 00ED:000C18300038181818183C000000
 00EE:00183C660038181818183C000000
 00EF:000066660038181818183C000000
+00F0:0000361C36063E6666663C000000
 00F1:000076DC00DC6666666666000000
 00F2:00603018007CC6C6C6C67C000000
 00F3:00183060007CC6C6C6C67C000000
 00F4:0010386C007CC6C6C6C67C000000
+00F5:00003B6E003E636363633E000000
 00F6:0000C6C6007CC6C6C6C67C000000
 00F7:0000001818007E00181800000000
+00F8:00000000033E676F7B733E600000
 00F9:0060301800CCCCCCCCCC76000000
 00FA:0018306000CCCCCCCCCC76000000
 00FB:003078CC00CCCCCCCCCC76000000
 00FC:0000CCCC00CCCCCCCCCC76000000
+00FD:00060C1800636666663E06663C00
+00FE:00000078303E333333333E307800
 00FF:0000C6C600C6C6C6C67E060C7800
+0100:7C00387CC6C6C6FEC6C6C6C60000
+0101:0000007C00780C7CCCCCCC760000
+0102:C67C0010386CC6FEC6C6C6000000
+0103:0000C67C00780C7CCCCC76000000
+0104:000010386CC6C6FEC6C6CE180E00
+0105:0000000000780C7CCCCC76301C00
+0106:0C18003C66C2C0C0C2663C000000
+0107:000C1830007CC6C0C0C67C000000
+010C:6C38003C66C2C0C0C2663C000000
+010D:00006C38007CC6C0C0C67C000000
+010E:6C3800F86C666666666CF8000000
+010F:6C38001C0C0C3C6CCCCC76000000
+0110:0000F86C6666F666666CF8000000
+0111:00000C0C7E0C3C6CCCCC76000000
+0112:7C00FE6660607C60606066FE0000
+0113:0000007C007CC6C6FEC0C67C0000
+0116:1818FE6660607C60606066FE0000
+0117:00001818007CC6C6FEC0C67C0000
+0118:0000FE66626878686266FE301C00
+0119:00000000007CC6FEC0C67C301C00
+011A:6C3800FE666278686266FE000000
+011B:00006C38007CC6FEC0C67C000000
+0122:00007CC6C6C0C0CEC6C6C67C0C78
+0123:3C60380076CEC6C6C6CE7606FC00
+0128:76DC003C181818181818183C0000
+0129:000076DC003818181818183C0000
+012A:7E003C18181818181818183C0000
+012B:0000007C003818181818183C0000
+012E:00003C18181818181818183C301E
+012F:00001818003818181818183C301E
+0136:0000C6C6CCD8F0F0D8CCC6C60C78
+0137:0000E0606066666C786C66E60C78
+0138:0000000000E66C78786C66E60000
+0139:0000F66C606060606266FE000000
+013A:0000E66C606060606060F0000000
+013B:0000F06060606060606266FE0C78
+013C:00003818181818181818183C18F0
+013D:001BEE60606060606266FE000000
+013E:001BEE60606060606060F0000000
+0141:0000F0646C7870E0E266FE000000
+0142:0000381A1E1C183878583C000000
+0143:0C1800C6E6F6FEDECEC6C6000000
+0144:000C183000DC6666666666000000
+0145:0000C6C6E6E6F6DECECEC6C60C78
+0146:0000000000DC6666666666660C78
+0147:6C3800C6E6F6FEDECEC6C6000000
+0148:00006C3800DC6666666666000000
+014A:0000DCFEF6E6C6C6C6C6C6DC0000
+014B:00000000DCFEF6E6C6C6061C0000
+014C:7C007CC6C6C6C6C6C6C6C67C0000
+014D:0000007C007CC6C6C6C6C67C0000
+0150:366C007CC6C6C6C6C6C67C000000
+0151:0000366C007CC6C6C6C67C000000
+0152:001F366666676666361F00000000
+0153:00000000366B6B6E683700000000
+0154:0C1800FC66667C6C6666E6000000
+0155:000C183000DC76666060F0000000
+0156:0000FC6666667C786C6666E60C78
+0157:0000000000DC7666606060F030E0
+0158:6C3800FC66667C6C6666E6000000
+0159:00006C3800DC76666060F0000000
+015A:0C18007CC6C6701CC6C67C000000
+015B:000C1830007CC6701CC67C000000
+015E:00007CC6C660380CC6C67C187000
+015F:00000000007CC6701CC67C187000
+0160:6C38007CC6C6701CC6C67C000000
+0161:00006C38007CC6701CC67C000000
+0162:00007E7E5A18181818183C0C3800
+0163:0000103030FC303030361C0C3800
+0164:361C007E7E5A181818183C000000
+0165:6C3800103030FC3030361C000000
+0166:0000FFDB99181E3C7818183C0000
+0167:0000303030FC303C78F0361C0000
+0168:76DC00C6C6C6C6C6C6C6C67C0000
+0169:000076DC00CCCCCCCCCCCC760000
+016A:7C00C6C6C6C6C6C6C6C6C67C0000
+016B:000000FC00CCCCCCCCCCCC760000
+016E:386C38C6C6C6C6C6C6C67C000000
+016F:00386C3800CCCCCCCCCC76000000
+0170:366C00C6C6C6C6C6C6C67C000000
+0171:00006CD800CCCCCCCCCC76000000
+0172:0000C6C6C6C6C6C6C6C6C67C301C
+0173:0000000000CCCCCCCCCCCC76301E
+0178:6600666666663C18183C00000000
+0179:0C1800FEC68C183062C6FE000000
+017A:000C183000FECC183066FE000000
+017B:181800FEC68C183062C6FE000000
+017C:0000181800FECC183066FE000000
+017D:6C3800FEC68C183062C6FE000000
+017E:00006C3800FECC183066FE000000
 0192:000E1B1818187E18181818D87000
+02C7:006C380000000000000000000000
+02D8:00C67C0000000000000000000000
+02D9:0018180000000000000000000000
+02DB:0000000000000000000030301C00
+02DD:00366CD800000000000000000000
+037A:0000000000000000000000000000
+0384:060C180000000000000000000000
+0385:060C18C300000000000000000000
+0386:0000C090B86CC6C6FEC6C6C60000
+0388:000000BFB130303E3031313F0000
+0389:000000B3B333333F333333330000
+038A:000000BC981818181818183C0000
+038C:0000009EB33333333333331E0000
+038E:000000B3B333331E0C0C0C1E0000
+038F:0000009EB3212121213312330000
+0390:000C0800660018181818180E0000
+0391:00000010386CC6C6FEC6C6C60000
+0392:000000FC6666667C666666FC0000
 0393:0000FEC6C6C0C0C0C0C0C0000000
+0394:00000010386CC6C6C6C6C6FE0000
+0395:000000FE66626878686266FE0000
+0396:000000FEC6860C183062C6FE0000
+0397:000000C6C6C6C6FEC6C6C6C60000
 0398:0000386CC6C6FEC6C66C38000000
+0399:0000003C181818181818183C0000
+039A:000000E666666C786C6666E60000
+039B:00000010386CC6C6C6C6C6C60000
+039C:000000C6EEFEFED6C6C6C6C60000
+039D:000000C6E6F6FEDECEC6C6C60000
+039E:000000FE8200007C000082FE0000
+039F:0000007CC6C6C6C6C6C6C67C0000
+03A0:000000FEC6C6C6C6C6C6C6C60000
+03A1:000000FC6666667C606060F00000
 03A3:0000FEC66030183060C6FE000000
+03A4:0000007E7E5A18181818183C0000
+03A5:000000666666663C1818183C0000
 03A6:00007E183C6666663C187E000000
+03A7:000000C6C66C7C387C6CC6C60000
+03A8:00000018DBDBDBDB7E18183C0000
 03A9:0000386CC6C6C66C6C6CEE000000
+03AA:0000C31818181818181818180000
+03AB:00C300666666663C1818183C0000
+03AC:0000003810007BCECCCCCC7B0000
+03AD:00003810007CC6C078C0C67C0000
+03AE:000000381000DC66666666660606
+03AF:00000038100018181818180E0000
+03B0:000018C30000E7666666663C0000
 03B1:000000000076DCD8D8DC76000000
+03B2:0000007CC6C6C6FCC6C6C6FCC0C0
+03B3:0000000000C3663C183C6642663C
 03B4:00001E30180C3E6666663C000000
 03B5:00001C3060607C6060301C000000
+03B6:00FC0C183060C0C0C0C0780C0C78
+03B7:000000000000DC66666666660606
+03B8:0000003E6363637F6363633E0000
+03B9:00000000000018181818180E0000
+03BA:000000000000E66C786C66E60000
+03BB:000000386C0C0C0C366666660000
+03BC:00000000000066666666667F6060
+03BD:00000000000082C6C66C6C380000
+03BE:00FC60C0783060C0C0C07C06067C
+03BF:0000000000007CC6C6C6C67C0000
 03C0:00000000FE6C6C6C6C6C6C000000
+03C1:0000000000003C666666667C6060
+03C2:0000000000003E63C060380CC67C
 03C3:00000000007ED8D8D8D870000000
 03C4:0000000076DC1818181818000000
+03C5:000000000000E7666666663C0000
 03C6:000003067EDBDBF37E60C0000000
+03C7:000000000000C66C38386CC60000
+03C8:000000000000D6D6D6D6D67C1010
+03C9:00000000000066C3C3DBFF660000
+03CA:000000C3000018181818180E0000
+03CB:000000C30000E7666666663C0000
+03CC:0000003810007CC6C6C6C67C0000
+03CD:000000381000E7666666663C0000
+03CE:00000038100066C3C3DBFF660000
+0401:6C6C00FEC6C0F0C0C0C6FE000000
+0402:0000F86060607C6666666C000000
+0403:1830007E60606060606060000000
+0404:00007CC6C0C0F8C0C0C67C000000
+0405:00007CC6C660380CC6C67C000000
+0406:0018003C1818181818183C000000
+0407:0066003C1818181818183C000000
+0408:00001E0C0C0C0C0CCCCC78000000
+0409:0000183878D8DEDBDBDBDE000000
+040A:0000D8D8D8D8FEDBDBDBDE000000
+040B:0000FC3030303C36363636000000
+040C:183000CCD8F0F0D8CCCCCC000000
+040E:281000C6C6C6C67E06C67C000000
+040F:0000C6C6C6C6C6C6FE3838000000
+0410:00003E66C6C6C6FEC6C6C6000000
+0411:0000FEC0C0FCC6C6C6C6FC000000
+0412:0000FCC6C6C6FCC6C6C6FC000000
+0413:0000FEC6C0C0C0C0C0C0C0000000
+0414:00003C6C6C6C6C6C6C6CFEC68200
+0415:0000FEC6C0C0F0C0C0C6FE000000
+0416:0000D6D6D6547CD6D6D6D6000000
+0417:00007CC6061C0606C6C67C000000
+0418:0000C6C6C6CEDEF6E6C6C6000000
+0419:000CDAC6C6CEDEF6E6C6C6000000
+041A:0000C6CCD8F0F0D8CCC6C6000000
+041B:00001E3666C6C6C6C6C6C6000000
+041C:000082C6C6EEEEFED6C6C6000000
+041D:0000C6C6C6C6FEC6C6C6C6000000
+041E:00007EC6C6C6C6C6C6C6FC000000
+041F:0000FEC6C6C6C6C6C6C6C6000000
+0420:0000FCC6C6C6C6FCC0C0C0000000
+0421:00007CC6C6C0C0C0C6C67C000000
+0422:00007E7E5A181818181818000000
+0423:0000C6C6C6C6C67E06C67C000000
+0424:00007CD6D6D6D6D67C1038000000
+0425:0000C6C66C38386CC6C6C6000000
+0426:0000CCCCCCCCCCCCCCCCFE020600
+0427:0000C6C6C6C6C67E060606000000
+0428:00D6D6D6D6D6D6D6D6D6FE000000
+0429:00D6D6D6D6D6D6D6D6D6FE020600
+042A:0000E0E0607C666666667C000000
+042B:0000C6C6C6E6B6B6B6B6E6000000
+042C:0000C0C0C0FCC6C6C6C6FC000000
+042D:00007CC6061E0606C6C67C000000
+042E:00009CB6B6B6F6B6B6B69C000000
+042F:00007EC6C6C6C67E3666C6000000
+0430:00000000007CC6C6FEC6C6000000
+0431:0000000000FEC0FCC6C6FC000000
+0432:0000000000FCC6FCC6C6FC000000
+0433:0000000000FEC2C0C0C0C0000000
+0434:00000000003C6C6C6C6CFEC68200
+0435:00000000007CC6FCC0C67C000000
+0436:0000000000D6D67CD6D6D6000000
+0437:00000000007CC61C06C67C000000
+0438:0000000000C6CEDEF6E6C6000000
+0439:0000000C18C6CEDEF6E6C6000000
+043A:0000000000C6CCF8D8CCC6000000
+043B:00000000003E66666666C6000000
+043C:0000000000C6EEFED6C6C6000000
+043D:0000000000C6C6C6FEC6C6000000
+043E:00000000007EC6C6C6C6FC000000
+043F:0000000000FEC6C6C6C6C6000000
+0440:0000000000FCC6C6C6C6FCC0C000
+0441:00000000007CC6C0C0C67C000000
+0442:00000000007E5A18181818000000
+0443:0000000000C6C6C6C6C67E067C00
+0444:00000000107CD6D6D6D67C103800
+0445:0000000000C66C38386CC6000000
+0446:0000000000CCCCCCCCCCFE060C00
+0447:0000000000C6C6C67E0606000000
+0448:0000000000D6D6D6D6D6FE000000
+0449:0000000000D6D6D6D6D6FE020600
+044A:0000000000E0607C66667C000000
+044B:0000000000C6C6E6B6B6E6000000
+044C:0000000000C0C0FCC6C6FC000000
+044D:00000000007CC61E06C67C000000
+044E:00000000009CB6B6F6B69C000000
+044F:00000000007EC67E3666C6000000
+0451:00006C6C007CC6FCC0C67C000000
+0452:00006060F8607C666666660C0000
+0453:00001830007C6060606060000000
+0454:00000000007CC6F0C0C67C000000
+0455:00000000007CC6701CC67C000000
+0456:000010100038181818183C000000
+0457:000028280038181818183C000000
+0458:00000404000E0606060666663C00
+0459:00000000003878DEDBDBDE000000
+045A:0000000000D8D8FEDBDBDE000000
+045B:00003030FC303C36363636000000
+045C:0000183000CCD8F0D8CCCC000000
+045E:0000281000C6C6C6C6C67E067C00
+045F:0000000000C6C6C6FE3838000000
+05D0:0000006363333B6E666363000000
+05D1:0000007C0606060606067F000000
+05D2:0000001C060606061E3663000000
+05D3:0000007F06060606060606000000
+05D4:0000007E03030363636363000000
+05D5:000000380C0C0C0C0C0C0C000000
+05D6:0000007E1818180C0C1830000000
+05D7:0000007E33636363636363000000
+05D8:000000666B6B636363663C000000
+05D9:0000003C0606060C000000000000
+05DA:0000007E03030606060606060700
+05DB:0000007E0303030303067C000000
+05DC:0060607E030303060C1818000000
+05DD:0000007E6363636363637F000000
+05DE:0000006E7B33636363636F000000
+05DF:0000001C06060C0C0C0C0C0C0E00
+05E0:0000001C0606060606063E000000
+05E1:0000007E3363636363663C000000
+05E2:00000033333333331B0E7C000000
+05E3:0000007C26667606060606060700
+05E4:0000007E2363730303037F000000
+05E5:000000666666666C786060607000
+05E6:0000006363331E0C06037F000000
+05E7:0000007E03033336363730303000
+05E8:0000007E03030303030303000000
+05E9:0000006B6B6B6B6B7B633E000000
+05EA:0000007E33333333333373000000
+200E:0000000000000000000000000000
+200F:0000000000000000000000000000
+2015:00000000000000FF000000000000
+2017:00000000000000000000FF00FF00
+2018:0030606030000000000000000000
+2019:000C06060C000000000000000000
 2022:0000000000183C3C180000000000
 203C:0000666666666666006666000000
 207F:00D86C6C6C6C6C00000000000000
 20A7:00F8CCCCF8C4CCDECCCCC6000000
+20AC:0000000000000000000000000000
+20AF:0000000000000000000000000000
+2116:0000888ACDEAB8988B888B000000
 2190:000000003060FE60300000000000
 2191:0000183C7E181818181818000000
 2192:00000000180CFE0C180000000000

Modified: head/share/vt/fonts/vgarom-8x16.hex
==============================================================================
--- head/share/vt/fonts/vgarom-8x16.hex	Tue Jun 17 12:59:03 2014	(r267577)
+++ head/share/vt/fonts/vgarom-8x16.hex	Tue Jun 17 13:12:30 2014	(r267578)
@@ -101,34 +101,70 @@
 00A1:00001818001818183C3C3C1800000000
 00A2:0018183C66606060663C181800000000
 00A3:00386C6460F060606060E6FC00000000
+00A4:00000082C67CC6C6C6C67CC682000000
 00A5:000066663C187E187E18181800000000
+00A6:00001818181800181818181800000000
 00A7:007CC660386CC6C66C380CC67C000000
+00A8:00C60000000000000000000000000000
+00A9:00007CC682BAA2A2BA82C67C00000000
 00AA:003C6C6C3E007E000000000000000000
 00AB:0000000000366CD86C36000000000000
 00AC:000000000000FE060606060000000000
+00AD:000000000000007C0000000000000000
+00AE:00007CC682BAAAB2AA82C67C00000000
+00AF:00FE0000000000000000000000000000
 00B0:00386C6C380000000000000000000000
 00B1:0000000018187E18180000FF00000000
 00B2:0070D83060C8F8000000000000000000
+00B3:00F8183018D870000000000000000000
+00B4:18306000000000000000000000000000
 00B5:0000000066666666667C6060C0000000
 00B6:00007FDBDBDB7B1B1B1B1B1B00000000
 00B7:00000000000000001800000000000000
+00B8:00000000000000000000180C063C0000
+00B9:0060E0606060F0000000000000000000
 00BA:00386C6C38007C000000000000000000
 00BB:0000000000D86C366CD8000000000000
 00BC:00C0C0C2C6CC183066CE9E3E06060000
 00BD:00C0C0C2C6CC183060DC860C183E0000
+00BE:00F0307236EC183066CE963E06060000
 00BF:0000303000303060C0C6C67C00000000
+00C0:60301800386CC6C6FEC6C6C600000000
+00C1:0C183000386CC6C6FEC6C6C600000000
+00C2:10386C00386CC6C6FEC6C6C600000000
+00C3:0076DC00386CC6C6FEC6C6C600000000
 00C4:00C60010386CC6C6FEC6C6C600000000
 00C5:386C3800386CC6C6FEC6C6C600000000
 00C6:00003E6CCCCCFECCCCCCCCCE00000000
 00C7:00003C66C2C0C0C0C2663C0C067C0000
+00C8:30180C00FE66607C606066FE00000000
 00C9:18306000FE66607C606066FE00000000
+00CA:10386C00FE66607C606066FE00000000
+00CB:00C600FE6660607C606066FE00000000
+00CC:30180C003C1818181818183C00000000
+00CD:0C1830003C1818181818183C00000000
+00CE:183C66003C1818181818183C00000000
+00CF:0066003C181818181818183C00000000
+00D0:0000786C666666F666666C7800000000
 00D1:76DC00C6E6F6FEDECEC6C6C600000000
+00D2:603018007CC6C6C6C6C6C67C00000000
+00D3:0C1830007CC6C6C6C6C6C67C00000000
+00D4:10386C007CC6C6C6C6C6C67C00000000
+00D5:76DC007CC6C6C6C6C6C6C67C00000000
 00D6:00C6007CC6C6C6C6C6C6C67C00000000
+00D7:00000000C66C3810386CC60000000000
+00D8:02067CCECEDED6D6F6E6E67CC0800000
+00D9:60301800C6C6C6C6C6C6C67C00000000
+00DA:0C183000C6C6C6C6C6C6C67C00000000
+00DB:10386C00C6C6C6C6C6C6C67C00000000
 00DC:00C600C6C6C6C6C6C6C6C67C00000000
+00DD:0C183000C3C3663C1818183C00000000
+00DE:F0607C6666667C60606060F000000000
 00DF:000078CCCCCCD8CCC6C6C6CC00000000
 00E0:0060301800780C7CCCCCCC7600000000
 00E1:0018306000780C7CCCCCCC7600000000
 00E2:0010386C00780C7CCCCCCC7600000000
+00E3:000076DC00780C7CCCCCCC7600000000
 00E4:0000CC0000780C7CCCCCCC7600000000
 00E5:00386C3800780C7CCCCCCC7600000000
 00E6:0000000000CC76367ED8D86E00000000
@@ -141,34 +177,326 @@
 00ED:000C1830003818181818183C00000000
 00EE:00183C66003818181818183C00000000
 00EF:00006600003818181818183C00000000
+00F0:006C38386C0C3C6CCCCCCC7800000000
 00F1:000076DC00DC66666666666600000000
 00F2:00603018007CC6C6C6C6C67C00000000
 00F3:00183060007CC6C6C6C6C67C00000000
 00F4:0010386C007CC6C6C6C6C67C00000000
+00F5:000076DC007CC6C6C6C6C67C00000000
 00F6:0000C600007CC6C6C6C6C67C00000000
 00F7:000000001818007E0018180000000000
+00F8:00000002067CCEDED6F6E67CC0800000
 00F9:0060301800CCCCCCCCCCCC7600000000
 00FA:0018306000CCCCCCCCCCCC7600000000
 00FB:003078CC00CCCCCCCCCCCC7600000000
 00FC:0000CC0000CCCCCCCCCCCC7600000000
+00FD:0018306000C6C6C6C6C6C67E060CF800
+00FE:000000F0607C66666666667C6060F000
 00FF:0000C60000C6C6C6C6C6C67E060C7800
+0100:007C00386CC6C6C6FEC6C6C6C6000000
+0101:000000007C00780C7CCCCCCC76000000
+0102:C67C0010386CC6C6FEC6C6C600000000
+0103:0000C67C00780C7CCCCCCC7600000000
+0104:000010386CC6C6FEC6C6C6C618301E00
+0105:0000000000780C7CCCCCCC7618301E00
+0106:0C18003C66C2C0C0C0C2663C00000000
+0107:000C1830007CC6C0C0C0C67C00000000
+010C:6C38003C66C2C0C0C0C2663C00000000
+010D:00006C38007CC6C0C0C0C67C00000000
+010E:6C3800F86C66666666666CF800000000
+010F:6C38001C0C0C3C6CCCCCCC7600000000
+0110:0000F86C6666F66666666CF800000000
+0111:00000C0C7E0C3C6CCCCCCC7600000000
+0112:7C0000FE6660607C60606066FE000000
+0113:000000007C007CC6C6FEC0C67C000000
+0116:181800FE6660607860606066FE000000
+0117:0000103810007CC6C6FEC0C67C000000
+0118:0000FE6662687868606266FE18301E00
+0119:00000000007CC6FEC0C0C67C30603C00
+011A:6C3800FE66626878686266FE00000000
+011B:00006C38007CC6FEC0C0C67C00000000
+011E:423C003C66C2C0DEC6C6663A00000000
+011F:000044380076CCCCCCCCCC7C0CCC7800
+0122:0000007CC6C6C0C0CECEC6C67C0C7800
+0123:00003C60300076CEC6C6C6CE7606FC00
+0128:76DC003C18181818181818183C000000
+0129:00000076DC003818181818183C000000
+012A:003C003C18181818181818183C000000
+012B:000000007C003818181818183C000000
+012E:0000003C18181818181818183C301E00
+012F:0000001818003818181818183C301C00
+0130:000018003C1818181818183C00000000
+0131:00000000003818181818183C00000000
+0136:000000C6C6CCD8F0F0D8CCC6C60C7800
+0137:000000E0606066666C786C66E618F000
+0138:000000000000E66C78786C66E6000000
+0139:0000F66C60606060606266FE00000000
+013A:0000E66C60606060606060F000000000
+013B:000000F06060606060606266FE0C7800
+013C:0000003818181818181818183C0C7800
+013D:001BEE6060606060606266FE00000000
+013E:001BEE6060606060606060F000000000
+0141:0000F0646C7870E0E06266FE00000000
+0142:0000381A1E1C18387858183C00000000
+0143:0C1800C6E6F6FEDECEC6C6C600000000
+0144:000C183000DC66666666666600000000
+0145:000000C6C6E6F6FEDECEC6C6C60C7800
+0146:000000000000DC6666666666660C7800
+0147:6C3800C6E6F6FEDECEC6C6C600000000
+0148:00006C3800DC66666666666600000000
+014A:000000DCFEE6C6C6C6C6C6C6DC000000
+014B:0000000000DCFEE6C6C6C6061C000000
+014C:007C007CC6C6C6C6C6C6C6C67C000000
+014D:000000007C007CC6C6C6C6C67C000000
+0150:366C007CC6C6C6C6C6C6C67C00000000
+0151:0000366C007CC6C6C6C6C67C00000000
+0152:00007ECCCCCCCECCCCCCCC7E00000000
+0153:00000000006EDBDBDED8DC6700000000
+0154:0C1800FC6666667C6C6666E600000000
+0155:000C183000DC7666606060F000000000
+0156:000000FC6666667C786C6666F618F000
+0157:000000000000DC6660606060F018F000
+0158:6C3800FC6666667C6C6666E600000000
+0159:00006C3800DC7666606060F000000000
+015A:0C18007CC6C660380CC6C67C00000000
+015B:000C1830007CC660380CC67C00000000
+015E:00007CC6C660380C06C6C67C180C7800
+015F:00000000007CC660380CC67C180C7800
+0160:6C38007CC6C660380CC6C67C00000000
+0161:00006C38007CC660380CC67C00000000
+0162:00007E7E5A1818181818183C180C7800
+0163:0000103030FC30303030361C180C7800
+0164:361C007E7E5A18181818183C00000000
+0165:6C3800103030FC303030361C00000000
+0166:000000FFDB99181E3C7818183C000000
+0167:000000303030FC303C78F0361C000000
+0168:76DC00C6C6C6C6C6C6C6C6C67C000000
+0169:00000076DC00CCCCCCCCCCCC76000000
+016A:007C00C6C6C6C6C6C6C6C6C67C000000
+016B:00000000FC00CCCCCCCCCCCC76000000
+016E:386C38C6C6C6C6C6C6C6C67C00000000
+016F:00386C3800CCCCCCCCCCCC7600000000
+0170:366C00C6C6C6C6C6C6C6C67C00000000
+0171:0000366C00CCCCCCCCCCCC7600000000
+0172:000000C6C6C6C6C6C6C6C6C67C603C00
+0173:000000000000CCCCCCCCCCCC76603C00
+0178:00C300C3C3663C181818183C00000000
+0179:0C1800FEC68C183060C2C6FE00000000
+017A:000C183000FECC183060C6FE00000000
+017B:181800FEC68C183060C2C6FE00000000
+017C:0000181800FECC183060C6FE00000000
+017D:6C3800FEC68C183060C2C6FE00000000
+017E:00006C3800FECC183060C6FE00000000
 0192:000E1B1818187E1818181818D8700000
+02C7:006C3800000000000000000000000000
+02D8:00C67C00000000000000000000000000
+02D9:00181800000000000000000000000000
+02DB:00000000000000000000000030603C00
+02DD:00366CD8000000000000000000000000
+037A:00000000000000000000000000000000
+0384:060C1800000000000000000000000000
+0385:060C18C3000000000000000000000000
+0386:00C090B86CC6C6FEC6C6C6C600000000
+0388:0000BFB130303E303031313F00000000
+0389:0000B3B333333F333333330000000000
+038A:0000BC98181818181818183C00000000
+038C:00009EB33333333333331E0000000000
+038E:0000B3B333331E0C0C0C0C1E00000000
+038F:00009EB3212121212133123300000000
+0390:0C080066001818181818180E00000000
+0391:000010386CC6C6FEC6C6C6C600000000
+0392:0000FC6666667C66666666FC00000000
 0393:0000FEC6C6C0C0C0C0C0C0C000000000
+0394:000010386CC6C6C6C6C6C6FE00000000
+0395:0000FE6662687868606266FE00000000
+0396:0000FEC6860C183060C2C6FE00000000
+0397:0000C6C6C6C6FEC6C6C6C6C600000000
 0398:000000386CC6C6FEC6C66C3800000000
+0399:00003C18181818181818183C00000000
+039A:0000E666666C78786C6666E600000000
+039B:000010386CC6C6C6C6C6C6C600000000
+039C:0000C6EEFEFED6C6C6C6C6C600000000
+039D:0000C6E6F6FEDECEC6C6C6C600000000
+039E:0000FE8200007C00000082FE00000000
+039F:00007CC6C6C6C6C6C6C6C67C00000000
+03A0:0000FEC6C6C6C6C6C6C6C6C600000000
+03A1:0000FC6666667C60606060F000000000
 03A3:000000FEC66030183060C6FE00000000
+03A4:00007E7E5A1818181818183C00000000
+03A5:0000666666663C181818183C00000000
 03A6:0000007E183C6666663C187E00000000
+03A7:0000C6C66C7C38387C6CC6C600000000
+03A8:000018DBDBDBDBDB7E18183C00000000
 03A9:0000386CC6C6C66C6C6C6CEE00000000
+03AA:00C31818181818181818181800000000
+03AB:C300666666663C181818183C00000000
+03AC:00003810007BCECCCCCCCC7B00000000
+03AD:00003810007CC6C078C0C67C00000000
+03AE:0000381000DC66666666666606060600
+03AF:00003810001818181818180E00000000
+03B0:0018C30000E766666666663C00000000
 03B1:000000000076DCD8D8D8DC7600000000
+03B2:00007CC6C6C6C6FCC6C6C6FCC0C0C000
+03B3:0000000000C3663C183C6642663C0000
 03B4:00001E30180C3E666666663C00000000
 03B5:00001C3060607C606060301C00000000
+03B6:0000FC0C183060C0C0C0C0780C0C7800
+03B7:0000000000DC66666666666606060600
+03B8:00003E6363637F636363633E00000000
+03B9:00000000001818181818180E00000000
+03BA:0000000000E66C78786C66E600000000
+03BB:0000386C0C0C0C366666666600000000
+03BC:00000000006666666666667F60606000
+03BD:000000000082C6C66C6C383800000000
+03BE:0000FC60C0783060C0C0C07C06063C00
+03BF:00000000007CC6C6C6C6C67C00000000
 03C0:00000000FE6C6C6C6C6C6C6C00000000
+03C1:00000000003C66666666667C60606000
+03C2:00000000003E63C0C060380CC67C0000
 03C3:00000000007ED8D8D8D8D87000000000
 03C4:0000000076DC18181818181800000000
+03C5:0000000000E766666666663C00000000
 03C6:00000003067EDBDBF37E60C000000000
+03C7:0000000000C66C3838386CC600000000
+03C8:0000000000D6D6D6D6D6D67C10101000
+03C9:000000000066C3C3C3DBFF6600000000
+03CA:0000C300001818181818180E00000000
+03CB:0000C30000E766666666663C00000000
+03CC:00003810007CC6C6C6C6C67C00000000
+03CD:0000381000E766666666663C00000000
+03CE:000038100066C3C3C3DBFF6600000000
+0401:666600FEC6C0C0F0C0C0C6FE00000000
+0402:0000F86060607C666666666C00000000
+0403:1830007E606060606060606000000000
+0404:00003C66C0C0F8C0C0C0663C00000000
+0405:00007CC6C660380C06C6C67C00000000
+0406:0018003C181818181818183C00000000
+0407:0066003C181818181818183C00000000
+0408:00001E0C0C0C0C0CCCCCCC7800000000
+0409:0000183878D8D8DEDBDBDBDE00000000
+040A:0000D8D8D8D8D8FEDBDBDBDE00000000
+040B:0000FC3030303C363636363600000000
+040C:183000C6CCD8F0F8CCC6C6C600000000
+040E:281000C6C6C6C67E0606C67C00000000
+040F:0000C6C6C6C6C6C6C6FE383800000000
+0410:00003E66C6C6C6FEC6C6C6C600000000
+0411:0000FEC0C0C0FCC6C6C6C6FC00000000
+0412:0000FCC6C6C6FCC6C6C6C6FC00000000
+0413:0000FEC6C0C0C0C0C0C0C0C000000000
+0414:00003C6C6C6C6C6C6C6C6CFEC6820000
+0415:0000FEC6C0C0F0C0C0C0C6FE00000000
+0416:0000D6D6D6547CD6D6D6D6D600000000
+0417:00007CC606061C0606C6C67C00000000
+0418:0000C6C6C6C6CEDEF6E6C6C600000000
+0419:000CDAC6C6C6CEDEF6E6C6C600000000
+041A:0000C6CCD8F0F0D8CCC6C6C600000000
+041B:00001E3666C6C6C6C6C6C6C600000000
+041C:0000C6C6EEEEFEFED6D6C6C600000000
+041D:0000C6C6C6C6FEC6C6C6C6C600000000
+041E:00007EC6C6C6C6C6C6C6C6FC00000000
+041F:0000FEC6C6C6C6C6C6C6C6C600000000
+0420:0000FCC6C6C6C6C6FCC0C0C000000000
+0421:00007CC6C6C0C0C0C0C6C67C00000000
+0422:00007E7E5A1818181818181800000000
+0423:0000C6C6C6C6C6C67E06C67C00000000
+0424:00007CD6D6D6D6D6D67C103800000000
+0425:0000C6C66C38386CC6C6C6C600000000
+0426:0000CCCCCCCCCCCCCCCCCCFE02060400
+0427:0000C6C6C6C6C67E0606060600000000
+0428:0000D6D6D6D6D6D6D6D6D6FE00000000
+0429:0000D6D6D6D6D6D6D6D6D6FE02060400
+042A:0000E0E060607C666666667C00000000
+042B:0000C6C6C6C6E6B6B6B6B6E600000000
+042C:0000C0C0C0C0FCC6C6C6C6FC00000000
+042D:000078CC06061E1E0606CC7800000000
+042E:00009CB6B6B6F6B6B6B6B69C00000000
+042F:00007EC6C6C6C67E3666C6C600000000
+0430:00000000007CC6C6C6FEC6C600000000
+0431:0000000000FEC0FCC6C6C6FC00000000
+0432:0000000000FCC6C6FCC6C6FC00000000
+0433:0000000000FEC6C2C0C0C0C000000000
+0434:00000000003C6C6C6C6C6CFEC6820000
+0435:00000000007CC6C6FCC0C67C00000000
+0436:0000000000D6D6D67CD6D6D600000000
+0437:00000000007CC6061C06C67C00000000
+0438:0000000000C6C6CEDEF6E6C600000000
+0439:0000000C18C6C6CEDEF6E6C600000000
+043A:0000000000C6CCD8F8D8CCC600000000
+043B:00000000003E6666666666C600000000
+043C:0000000000C6EEFED6C6C6C600000000
+043D:0000000000C6C6C6FEC6C6C600000000
+043E:00000000007EC6C6C6C6C6FC00000000
+043F:0000000000FEC6C6C6C6C6C600000000
+0440:0000000000FCC6C6C6C6C6FCC0C0C000
+0441:00000000007CC6C0C0C2C67C00000000
+0442:00000000007E5A181818181800000000
+0443:0000000000C6C6C6C6C6C67E06C67C00
+0444:00000000107CD6D6D6D6D67C10380000
+0445:0000000000C66C38386CC6C600000000
+0446:0000000000CCCCCCCCCCCCFE060C0000
+0447:0000000000C6C6C6C67E060600000000
+0448:0000000000D6D6D6D6D6D6FE00000000
+0449:0000000000D6D6D6D6D6D6FE02060400
+044A:0000000000E0607C6666667C00000000
+044B:0000000000C6C6E6B6B6B6E600000000
+044C:0000000000C0C0FCC6C6C6FC00000000
+044D:00000000007CC6061E06C67C00000000
+044E:00000000009CB6B6F6B6B69C00000000
+044F:00000000007EC6C67E3666C600000000
+0451:00006C6C007CC6C6FCC0C67C00000000
+0452:0000606060F8607C666666660C000000
+0453:00001830007C60606060606000000000
+0454:00000000007CC6C0F0C0C67C00000000
+0455:00000000007CC660380CC67C00000000
+0456:00001010003818181818183C00000000
+0457:00002828003818181818183C00000000
+0458:00000404000E06060606060666663C00
+0459:0000000000183878DEDBDBDE00000000
+045A:0000000000D8D8D8FEDBDBDE00000000
+045B:0000303030FC303C3636363600000000
+045C:0000183000C4CCD8F0D8CCCC00000000
+045E:0000281000C6C6C6C6C6C67E06C67C00
+045F:0000000000C6C6C6C6FE383800000000
+05D0:00000000C6C66676DCCCC6C600000000
+05D1:00000000F80C0C0C0C0C0CFE00000000
+05D2:00000000380C0C0C0C1C36E600000000
+05D3:00000000FE0C0C0C0C0C0C0C00000000
+05D4:00000000FC060606C6C6C6C600000000
+05D5:00000000701818181818181800000000
+05D6:00000000FC3030301818306000000000
+05D7:00000000FC66C6C6C6C6C6C600000000
+05D8:00000000CCD6D6C6C6C6C67C00000000
+05D9:00000000701818183000000000000000
+05DA:00000000FC0606060C0C0C0C0C0C0E00
+05DB:00000000FC060606060606FC00000000
+05DC:0000C0C0FC060606060C181800000000
+05DD:00000000FC66C6C6C6C6C6FE00000000
+05DE:00000000DC7666C6C6C6C6DE00000000
+05DF:00000000380C0C181818181818181C00
+05E0:00000000380C0C0C0C0C0C7C00000000
+05E1:00000000FC66C6C6C6C6CC7800000000
+05E2:00000000EE66666666662CF800000000
+05E3:00000000F84CCCCCEC0C0C0C0C0C0E00
+05E4:00000000FC46C6C6E60606FE00000000
+05E5:00000000EE66666C7860606060607000
+05E6:00000000EE666634180C06FE00000000
+05E7:00000000FC060666646C6E6060606000
+05E8:00000000FC0606060606060600000000
+05E9:00000000D6D6D6D6D6F6C67C00000000
+05EA:00000000FC6666666666E6E600000000
+200E:00000000000000000000000000000000
+200F:00000000000000000000000000000000
+2015:00000000000000FF0000000000000000
+2017:000000000000000000000000FF00FF00
+2018:00306060300000000000000000000000
+2019:000C06060C0000000000000000000000
 2022:000000000000183C3C18000000000000
 203C:00006666666666666600666600000000
 207F:00D86C6C6C6C6C000000000000000000
 20A7:00F8CCCCF8C4CCDECCCCCCC600000000
+20AC:00000000000000000000000000000000
+20AF:00000000000000000000000000000000
+2116:0000888ACDEAB8988B888B8800000000
 2190:00000000003060FE6030000000000000
 2191:0000183C7E1818181818181800000000
 2192:0000000000180CFE0C18000000000000

Modified: head/share/vt/fonts/vgarom-8x8.hex
==============================================================================
--- head/share/vt/fonts/vgarom-8x8.hex	Tue Jun 17 12:59:03 2014	(r267577)
+++ head/share/vt/fonts/vgarom-8x8.hex	Tue Jun 17 13:12:30 2014	(r267578)
@@ -100,34 +100,70 @@
 00A1:1818001818181800
 00A2:18187EC0C07E1818
 00A3:386C64F060E6FC00
+00A4:00C33C66663CC300
 00A5:CCCC78FC30FC3030
+00A6:1818180018181800
 00A7:3E63386C6C38CC78
+00A8:C600000000000000
+00A9:7C82BAA2BA827C00
 00AA:3C6C6C3E007E0000
 00AB:003366CC66330000
 00AC:000000FC0C0C0000
+00AD:0000000000000000
+00AE:7C82BAB2AA827C00
+00AF:FE00000000000000
 00B0:386C6C3800000000
 00B1:3030FC303000FC00
 00B2:7018306078000000
+00B3:1E020E021E000000
+00B4:1830000000000000
 00B5:00666666667C60C0
 00B6:7FDBDB7B1B1B1B00
 00B7:0000000018000000
+00B8:0000000000001830
+00B9:060E060606000000
 00BA:386C6C38007C0000
 00BB:00CC663366CC0000
 00BC:C3C6CCDB376FCF03
 00BD:C3C6CCDE3366CC0F
+00BE:F020966C33670F03
 00BF:30003060C0CC7800
+00C0:180C3078CCFCCC00
+00C1:60C03078CCFCCC00
+00C2:78843078CCFCCC00
+00C3:66983078CCFCCC00
 00C4:C6386CC6FEC6C600
 00C5:30300078CCFCCC00
 00C6:3E6CCCFECCCCCE00
 00C7:78CCC0CC78180C78
+00C8:3018FE627862FE00
 00C9:1C00FC607860FC00
+00CA:3844FE627862FE00
+00CB:6600FE627862FE00
+00CC:6030783030307800
+00CD:1830783030307800
+00CE:7884783030307800
+00CF:CC00783030307800
+00D0:786C66F6666C7800
 00D1:FC00CCECFCDCCC00
+00D2:30187CC6C6C67C00
+00D3:18307CC6C6C67C00
+00D4:38447CC6C6C67C00
+00D5:66987CC6C6C67C00
 00D6:C3183C66663C1800
+00D7:00C66C38386CC600
+00D8:067CCE9AB2E678C0
+00D9:6030CCCCCCCCFC00
+00DA:1830CCCCCCCCFC00
+00DB:7884CCCCCCCCFC00
 00DC:CC00CCCCCCCC7800
+00DD:1830CCCC78307800
+00DE:60786C7860606000
 00DF:0078CCF8CCF8C0C0
 00E0:E000780C7CCC7E00
 00E1:1C00780C7CCC7E00
 00E2:7EC33C063E663F00
+00E3:6698780C7CCC7600
 00E4:CC00780C7CCC7E00
 00E5:3030780C7CCC7E00
 00E6:00007F0C7FCC7F00
@@ -140,34 +176,322 @@
 00ED:3800703030307800
 00EE:7CC6381818183C00
 00EF:CC00703030307800
+00F0:6C386C0C6CCC7800
 00F1:00F800F8CCCCCC00
 00F2:00E00078CCCC7800
 00F3:001C0078CCCC7800
 00F4:78CC0078CCCC7800
+00F5:6698007CC6C67C00
 00F6:00CC0078CCCC7800
 00F7:303000FC00303000
+00F8:0000067CDEF67CC0
 00F9:00E000CCCCCC7E00
 00FA:001C00CCCCCC7E00
 00FB:78CC00CCCCCC7E00
 00FC:00CC00CCCCCC7E00
+00FD:1830CCCCCC7C0CF8
+00FE:E0786C666C78E000
 00FF:00CC00CCCC7C0CF8
+0100:7C007CC6C6FEC6C6
+0101:007C00780C7CCC76
+0102:663C3C667E666600
+0103:C67C780C7CCC7600
+0104:183C667E666E180E
+0105:0000780C7CCC761C
+0106:0C187CC6C0C67C00
+0107:0C18003C60603C00
+010C:6C387CC6C0C67C00
+010D:361C003C60603C00
+010E:6C38FC666666FC00
+010F:6C380C0C7CCC7600
+0110:F86C66F6666CF800
+0111:0C3E0C7CCCCC7600
+0112:7C00FE607C6066FE
+0113:007C007CC6FEC07C
+0116:18FE66607C6066FE
+0117:0038007CC6FEC07C
+0118:FE6268786862FE1C
+0119:00003C667E603C1C
+011A:6C38FE607860FE00
+011B:361C3C667E603C00
+0122:3C66C0CE663E1870
+0123:3860307ECC7C0CF8
+0128:76DC38181818183C
+0129:0076DC003818183C
+012A:3C003C181818183C
+012B:003C00381818183C
+012E:783030303078301C
+012F:18003818183C180E
+0136:C6CCF8D8CCC60C38
+0137:00E0666C786CE61C
+0138:000000E66C786CE6
+0139:E66C60606266FE00
+013A:7336303030307800
+013B:F060606266FE1870
+013C:38181818183C1870
+013D:FB6E60606266FE00
+013E:FB6E60606060F000
+0141:F06878F0E266FE00
+0142:381A1E3C78183C00
+0143:0C18E6F6DECEC600
+0144:0C187C6666666600
+0145:C6E6F6DECEC60C38
+0146:0000DCE6C6C61870
+0147:6C38E6F6DECEC600
+0148:6C387C6666666600
+014A:00DCFEF6C6C6C6DC
+014B:0000DCFEF6C6061C
+014C:7C007CC6C6C6C67C
+014D:007C007CC6C6C67C
+0150:366C7CC6C6C67C00
+0151:366C003C66663C00
+0152:58D8DCD8583E0000
+0153:006CD2DED06E0000
+0154:0C18FCC6FCCCC600
+0155:0C18DC766660F000
+0156:FC667E6C66E61870
+0157:0000DC7666F030E0
+0158:6C38FCC6FCCCC600
+0159:6C38DC766660F000
+015A:0C187CC238867C00
+015B:0C183C4038047800
+015E:3C6630180C663C38
+015F:00003E603C067C38
+0160:6C387CC238867C00
+0161:6C383C4038047800
+0162:7E5A181818183C0E
+0163:10307C303034180E
+0164:361C7E5A18183C00
+0165:6C38307C30341800
+0166:00FF991E3C78183C
+0167:003030FC3038761C
+0168:76DC00C6C6C6C67C
+0169:76DC00CCCCCCCC76
+016A:7C00C6C6C6C6C67C
+016B:007800CCCCCCCC76
+016E:386CF6C6C6C67C00
+016F:30CC30CCCCCC7600
+0170:366CC6C6C6C67C00
+0171:6CD800CCCCCC7600
+0172:C6C6C6C6C67C301E
+0173:0000CCCCCC7E301C
+0178:00CCCC7830780000
+0179:0C18FE861862FE00
+017A:0C18007C18307C00
+017B:1800FE861862FE00
+017C:0018007C18307C00
+017D:6C38FE861862FE00
+017E:6C38007C18307C00
 0192:0E1B183C1818D870
+02C7:6C38000000000000
+02D8:C67C000000000000
+02D9:1800000000000000
+02DB:000000000000301C
+02DD:366C000000000000
+037A:0000000000000000
+0384:0810000000000000
+0385:08D3000000000000
+0386:5CB6637F63636300
+0388:5F90101E10101F00
+0389:B3B3333F33333300
+038A:5E8C0C0C0C0C1E00
+038C:5CB6636363361C00
+038E:B3B3331E0C0C1E00
+038F:5CB6636336147700
+0390:08D3003030303C00
+0391:386CC6FEC6C6C600
+0392:FC66667C6666FC00
 0393:00FCCCC0C0C0C000
+0394:10386CC6C6C6FE00

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 14:47:50 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id BF40146E;
 Tue, 17 Jun 2014 14:47:50 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 91E41273F;
 Tue, 17 Jun 2014 14:47:50 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5HEloTw019083;
 Tue, 17 Jun 2014 14:47:50 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5HElnZE019075;
 Tue, 17 Jun 2014 14:47:49 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201406171447.s5HElnZE019075@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 17 Jun 2014 14:47:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267580 - in head/sys/dev: cadence et oce ti txp wpi
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 14:47:50 -0000

Author: jhb
Date: Tue Jun 17 14:47:49 2014
New Revision: 267580
URL: http://svnweb.freebsd.org/changeset/base/267580

Log:
  Fix teardown of static DMA allocations in various NIC drivers:
  - Add missing calls to bus_dmamap_unload() in et(4).
  - Check the bus address against 0 to decide when to call
    bus_dmamap_unload() instead of comparing the bus_dma map against NULL.
  - Check the virtual address against NULL to decide when to call
    bus_dmamem_free() instead of comparing the bus_dma map against NULL.
  - Don't clear bus_dma map pointers to NULL for static allocations.
    Instead, treat the value as completely opaque.
  - Pass the correct virtual address to bus_dmamem_free() in wpi(4) instead
    of trying to free a pointer to the virtual address.
  
  Reviewed by:	yongari

Modified:
  head/sys/dev/cadence/if_cgem.c
  head/sys/dev/et/if_et.c
  head/sys/dev/oce/oce_util.c
  head/sys/dev/ti/if_ti.c
  head/sys/dev/txp/if_txp.c
  head/sys/dev/wpi/if_wpi.c

Modified: head/sys/dev/cadence/if_cgem.c
==============================================================================
--- head/sys/dev/cadence/if_cgem.c	Tue Jun 17 13:14:31 2014	(r267579)
+++ head/sys/dev/cadence/if_cgem.c	Tue Jun 17 14:47:49 2014	(r267580)
@@ -1314,10 +1314,14 @@ cgem_detach(device_t dev)
 	}
 
 	/* Release DMA resources. */
-	if (sc->rxring_dma_map != NULL) {
+	if (sc->rxring != NULL) {
+		if (sc->rxring_physaddr != 0) {
+			bus_dmamap_unload(sc->desc_dma_tag, sc->rxring_dma_map);
+			sc->rxring_physaddr = 0;
+		}
 		bus_dmamem_free(sc->desc_dma_tag, sc->rxring,
 				sc->rxring_dma_map);
-		sc->rxring_dma_map = NULL;
+		sc->rxring = NULL;
 		for (i = 0; i < CGEM_NUM_RX_DESCS; i++)
 			if (sc->rxring_m_dmamap[i] != NULL) {
 				bus_dmamap_destroy(sc->mbuf_dma_tag,
@@ -1325,10 +1329,14 @@ cgem_detach(device_t dev)
 				sc->rxring_m_dmamap[i] = NULL;
 			}
 	}
-	if (sc->txring_dma_map != NULL) {
+	if (sc->txring != NULL) {
+		if (sc->txring_physaddr != 0) {
+			bus_dmamap_unload(sc->desc_dma_tag, sc->txring_dma_map);
+			sc->txring_physaddr = 0;
+		}
 		bus_dmamem_free(sc->desc_dma_tag, sc->txring,
 				sc->txring_dma_map);
-		sc->txring_dma_map = NULL;
+		sc->txring = NULL;
 		for (i = 0; i < CGEM_NUM_TX_DESCS; i++)
 			if (sc->txring_m_dmamap[i] != NULL) {
 				bus_dmamap_destroy(sc->mbuf_dma_tag,

Modified: head/sys/dev/et/if_et.c
==============================================================================
--- head/sys/dev/et/if_et.c	Tue Jun 17 13:14:31 2014	(r267579)
+++ head/sys/dev/et/if_et.c	Tue Jun 17 14:47:49 2014	(r267580)
@@ -120,7 +120,7 @@ static int	et_dma_ring_alloc(struct et_s
 		    bus_dma_tag_t *, uint8_t **, bus_dmamap_t *, bus_addr_t *,
 		    const char *);
 static void	et_dma_ring_free(struct et_softc *, bus_dma_tag_t *, uint8_t **,
-		    bus_dmamap_t *);
+		    bus_dmamap_t, bus_addr_t *);
 static void	et_init_tx_ring(struct et_softc *);
 static int	et_init_rx_ring(struct et_softc *);
 static void	et_free_tx_ring(struct et_softc *);
@@ -841,15 +841,16 @@ et_dma_ring_alloc(struct et_softc *sc, b
 
 static void
 et_dma_ring_free(struct et_softc *sc, bus_dma_tag_t *tag, uint8_t **ring,
-    bus_dmamap_t *map)
+    bus_dmamap_t map, bus_addr_t *paddr)
 {
 
-	if (*map != NULL)
-		bus_dmamap_unload(*tag, *map);
-	if (*map != NULL && *ring != NULL) {
-		bus_dmamem_free(*tag, *ring, *map);
+	if (*paddr != 0) {
+		bus_dmamap_unload(*tag, map);
+		*paddr = 0;
+	}
+	if (*ring != NULL) {
+		bus_dmamem_free(*tag, *ring, map);
 		*ring = NULL;
-		*map = NULL;
 	}
 	if (*tag) {
 		bus_dma_tag_destroy(*tag);
@@ -1101,27 +1102,27 @@ et_dma_free(struct et_softc *sc)
 	/* Destroy mini RX ring, ring 0. */
 	rx_ring = &sc->sc_rx_ring[0];
 	et_dma_ring_free(sc, &rx_ring->rr_dtag, (void *)&rx_ring->rr_desc,
-	    &rx_ring->rr_dmap);
+	    rx_ring->rr_dmap, &rx_ring->rr_paddr);
 	/* Destroy standard RX ring, ring 1. */
 	rx_ring = &sc->sc_rx_ring[1];
 	et_dma_ring_free(sc, &rx_ring->rr_dtag, (void *)&rx_ring->rr_desc,
-	    &rx_ring->rr_dmap);
+	    rx_ring->rr_dmap, &rx_ring->rr_paddr);
 	/* Destroy RX stat ring. */
 	rxst_ring = &sc->sc_rxstat_ring;
 	et_dma_ring_free(sc, &rxst_ring->rsr_dtag, (void *)&rxst_ring->rsr_stat,
-	    &rxst_ring->rsr_dmap);
+	    rxst_ring->rsr_dmap, &rxst_ring->rsr_paddr);
 	/* Destroy RX status block. */
 	rxsd = &sc->sc_rx_status;
 	et_dma_ring_free(sc, &rxst_ring->rsr_dtag, (void *)&rxst_ring->rsr_stat,
-	    &rxst_ring->rsr_dmap);
+	    rxst_ring->rsr_dmap, &rxst_ring->rsr_paddr);
 	/* Destroy TX ring. */
 	tx_ring = &sc->sc_tx_ring;
 	et_dma_ring_free(sc, &tx_ring->tr_dtag, (void *)&tx_ring->tr_desc,
-	    &tx_ring->tr_dmap);
+	    tx_ring->tr_dmap, &tx_ring->tr_paddr);
 	/* Destroy TX status block. */
 	txsd = &sc->sc_tx_status;
 	et_dma_ring_free(sc, &txsd->txsd_dtag, (void *)&txsd->txsd_status,
-	    &txsd->txsd_dmap);
+	    txsd->txsd_dmap, &txsd->txsd_paddr);
 
 	/* Destroy the parent tag. */
 	if (sc->sc_dtag) {

Modified: head/sys/dev/oce/oce_util.c
==============================================================================
--- head/sys/dev/oce/oce_util.c	Tue Jun 17 13:14:31 2014	(r267579)
+++ head/sys/dev/oce/oce_util.c	Tue Jun 17 14:47:49 2014	(r267580)
@@ -105,15 +105,15 @@ oce_dma_free(POCE_SOFTC sc, POCE_DMA_MEM
 	if (dma->tag == NULL)
 		return;
 
-	if (dma->map != NULL) {
+	if (dma->paddr != 0) {
 		bus_dmamap_sync(dma->tag, dma->map,
 				BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 		bus_dmamap_unload(dma->tag, dma->map);
+		dma->paddr = 0;
 	}
 
 	if (dma->ptr != NULL) {
 		bus_dmamem_free(dma->tag, dma->ptr, dma->map);
-		dma->map = NULL;
 		dma->ptr = NULL;
 	}
 

Modified: head/sys/dev/ti/if_ti.c
==============================================================================
--- head/sys/dev/ti/if_ti.c	Tue Jun 17 13:14:31 2014	(r267579)
+++ head/sys/dev/ti/if_ti.c	Tue Jun 17 14:47:49 2014	(r267580)
@@ -227,7 +227,7 @@ static void ti_dma_free(struct ti_softc 
 static int ti_dma_ring_alloc(struct ti_softc *, bus_size_t, bus_size_t,
     bus_dma_tag_t *, uint8_t **, bus_dmamap_t *, bus_addr_t *, const char *);
 static void ti_dma_ring_free(struct ti_softc *, bus_dma_tag_t *, uint8_t **,
-    bus_dmamap_t *);
+    bus_dmamap_t, bus_addr_t *);
 static int ti_newbuf_std(struct ti_softc *, int);
 static int ti_newbuf_mini(struct ti_softc *, int);
 static int ti_newbuf_jumbo(struct ti_softc *, int, struct mbuf *);
@@ -1035,15 +1035,16 @@ ti_dma_ring_alloc(struct ti_softc *sc, b
 
 static void
 ti_dma_ring_free(struct ti_softc *sc, bus_dma_tag_t *tag, uint8_t **ring,
-    bus_dmamap_t *map)
+    bus_dmamap_t map, bus_addr_t *paddr)
 {
 
-	if (*map != NULL)
-		bus_dmamap_unload(*tag, *map);
-	if (*map != NULL && *ring != NULL) {
-		bus_dmamem_free(*tag, *ring, *map);
+	if (*paddr != 0) {
+		bus_dmamap_unload(*tag, map);
+		*paddr = 0;
+	}
+	if (*ring != NULL) {
+		bus_dmamem_free(*tag, *ring, map);
 		*ring = NULL;
-		*map = NULL;
 	}
 	if (*tag) {
 		bus_dma_tag_destroy(*tag);
@@ -1336,32 +1337,39 @@ ti_dma_free(struct ti_softc *sc)
 	/* Destroy standard RX ring. */
 	ti_dma_ring_free(sc, &sc->ti_cdata.ti_rx_std_ring_tag,
 	    (void *)&sc->ti_rdata.ti_rx_std_ring,
-	    &sc->ti_cdata.ti_rx_std_ring_map);
+	    sc->ti_cdata.ti_rx_std_ring_map,
+	    &sc->ti_rdata.ti_rx_std_ring_paddr);
 	/* Destroy jumbo RX ring. */
 	ti_dma_ring_free(sc, &sc->ti_cdata.ti_rx_jumbo_ring_tag,
 	    (void *)&sc->ti_rdata.ti_rx_jumbo_ring,
-	    &sc->ti_cdata.ti_rx_jumbo_ring_map);
+	    sc->ti_cdata.ti_rx_jumbo_ring_map,
+	    &sc->ti_rdata.ti_rx_jumbo_ring_paddr);
 	/* Destroy mini RX ring. */
 	ti_dma_ring_free(sc, &sc->ti_cdata.ti_rx_mini_ring_tag,
 	    (void *)&sc->ti_rdata.ti_rx_mini_ring,
-	    &sc->ti_cdata.ti_rx_mini_ring_map);
+	    sc->ti_cdata.ti_rx_mini_ring_map,
+	    &sc->ti_rdata.ti_rx_mini_ring_paddr);
 	/* Destroy RX return ring. */
 	ti_dma_ring_free(sc, &sc->ti_cdata.ti_rx_return_ring_tag,
 	    (void *)&sc->ti_rdata.ti_rx_return_ring,
-	    &sc->ti_cdata.ti_rx_return_ring_map);
+	    sc->ti_cdata.ti_rx_return_ring_map,
+	    &sc->ti_rdata.ti_rx_return_ring_paddr);
 	/* Destroy TX ring. */
 	ti_dma_ring_free(sc, &sc->ti_cdata.ti_tx_ring_tag,
-	    (void *)&sc->ti_rdata.ti_tx_ring, &sc->ti_cdata.ti_tx_ring_map);
+	    (void *)&sc->ti_rdata.ti_tx_ring, sc->ti_cdata.ti_tx_ring_map,
+	    &sc->ti_rdata.ti_tx_ring_paddr);
 	/* Destroy status block. */
 	ti_dma_ring_free(sc, &sc->ti_cdata.ti_status_tag,
-	    (void *)&sc->ti_rdata.ti_status, &sc->ti_cdata.ti_status_map);
+	    (void *)&sc->ti_rdata.ti_status, sc->ti_cdata.ti_status_map,
+	    &sc->ti_rdata.ti_status_paddr);
 	/* Destroy event ring. */
 	ti_dma_ring_free(sc, &sc->ti_cdata.ti_event_ring_tag,
 	    (void *)&sc->ti_rdata.ti_event_ring,
-	    &sc->ti_cdata.ti_event_ring_map);
+	    sc->ti_cdata.ti_event_ring_map, &sc->ti_rdata.ti_event_ring_paddr);
 	/* Destroy GIB */
 	ti_dma_ring_free(sc, &sc->ti_cdata.ti_gib_tag,
-	    (void *)&sc->ti_rdata.ti_info, &sc->ti_cdata.ti_gib_map);
+	    (void *)&sc->ti_rdata.ti_info, sc->ti_cdata.ti_gib_map,
+	    &sc->ti_rdata.ti_info_paddr);
 
 	/* Destroy the parent tag. */
 	if (sc->ti_cdata.ti_parent_tag) {

Modified: head/sys/dev/txp/if_txp.c
==============================================================================
--- head/sys/dev/txp/if_txp.c	Tue Jun 17 13:14:31 2014	(r267579)
+++ head/sys/dev/txp/if_txp.c	Tue Jun 17 14:47:49 2014	(r267580)
@@ -169,8 +169,8 @@ static int txp_alloc_rings(struct txp_so
 static void txp_init_rings(struct txp_softc *);
 static int txp_dma_alloc(struct txp_softc *, char *, bus_dma_tag_t *,
     bus_size_t, bus_size_t, bus_dmamap_t *, void **, bus_size_t, bus_addr_t *);
-static void txp_dma_free(struct txp_softc *, bus_dma_tag_t *, bus_dmamap_t *,
-    void **);
+static void txp_dma_free(struct txp_softc *, bus_dma_tag_t *, bus_dmamap_t,
+    void **, bus_addr_t *);
 static void txp_free_rings(struct txp_softc *);
 static int txp_rxring_fill(struct txp_softc *);
 static void txp_rxring_empty(struct txp_softc *);
@@ -787,7 +787,7 @@ txp_download_fw_section(struct txp_softc
 
 	bus_dmamap_sync(sec_tag, sec_map, BUS_DMASYNC_POSTWRITE);
 bail:
-	txp_dma_free(sc, &sec_tag, &sec_map, (void **)&sec_buf);
+	txp_dma_free(sc, &sec_tag, sec_map, (void **)&sec_buf, &sec_paddr);
 	return (err);
 }
 
@@ -1265,17 +1265,17 @@ txp_dma_alloc(struct txp_softc *sc, char
 }
 
 static void
-txp_dma_free(struct txp_softc *sc, bus_dma_tag_t *tag, bus_dmamap_t *map,
-    void **buf)
+txp_dma_free(struct txp_softc *sc, bus_dma_tag_t *tag, bus_dmamap_t map,
+    void **buf, bus_addr_t *paddr)
 {
 
 	if (*tag != NULL) {
-		if (*map != NULL)
-			bus_dmamap_unload(*tag, *map);
-		if (*map != NULL && buf != NULL)
-			bus_dmamem_free(*tag, *(uint8_t **)buf, *map);
+		if (*paddr != 0)
+			bus_dmamap_unload(*tag, map);
+		if (buf != NULL)
+			bus_dmamem_free(*tag, *(uint8_t **)buf, map);
 		*(uint8_t **)buf = NULL;
-		*map = NULL;
+		*paddr = 0;
 		bus_dma_tag_destroy(*tag);
 		*tag = NULL;
 	}
@@ -1649,38 +1649,48 @@ txp_free_rings(struct txp_softc *sc)
 
 	/* Hi priority Tx ring. */
 	txp_dma_free(sc, &sc->sc_cdata.txp_txhiring_tag,
-	    &sc->sc_cdata.txp_txhiring_map,
-	    (void **)&sc->sc_ldata.txp_txhiring);
+	    sc->sc_cdata.txp_txhiring_map,
+	    (void **)&sc->sc_ldata.txp_txhiring,
+	    &sc->sc_ldata.txp_txhiring_paddr);
 	/* Low priority Tx ring. */
 	txp_dma_free(sc, &sc->sc_cdata.txp_txloring_tag,
-	    &sc->sc_cdata.txp_txloring_map,
-	    (void **)&sc->sc_ldata.txp_txloring);
+	    sc->sc_cdata.txp_txloring_map,
+	    (void **)&sc->sc_ldata.txp_txloring,
+	    &sc->sc_ldata.txp_txloring_paddr);
 	/* Hi priority Rx ring. */
 	txp_dma_free(sc, &sc->sc_cdata.txp_rxhiring_tag,
-	    &sc->sc_cdata.txp_rxhiring_map,
-	    (void **)&sc->sc_ldata.txp_rxhiring);
+	    sc->sc_cdata.txp_rxhiring_map,
+	    (void **)&sc->sc_ldata.txp_rxhiring,
+	    &sc->sc_ldata.txp_rxhiring_paddr);
 	/* Low priority Rx ring. */
 	txp_dma_free(sc, &sc->sc_cdata.txp_rxloring_tag,
-	    &sc->sc_cdata.txp_rxloring_map,
-	    (void **)&sc->sc_ldata.txp_rxloring);
+	    sc->sc_cdata.txp_rxloring_map,
+	    (void **)&sc->sc_ldata.txp_rxloring,
+	    &sc->sc_ldata.txp_rxloring_paddr);
 	/* Receive buffer ring. */
 	txp_dma_free(sc, &sc->sc_cdata.txp_rxbufs_tag,
-	    &sc->sc_cdata.txp_rxbufs_map, (void **)&sc->sc_ldata.txp_rxbufs);
+	    sc->sc_cdata.txp_rxbufs_map, (void **)&sc->sc_ldata.txp_rxbufs,
+	    &sc->sc_ldata.txp_rxbufs_paddr);
 	/* Command ring. */
 	txp_dma_free(sc, &sc->sc_cdata.txp_cmdring_tag,
-	    &sc->sc_cdata.txp_cmdring_map, (void **)&sc->sc_ldata.txp_cmdring);
+	    sc->sc_cdata.txp_cmdring_map, (void **)&sc->sc_ldata.txp_cmdring,
+	    &sc->sc_ldata.txp_cmdring_paddr);
 	/* Response ring. */
 	txp_dma_free(sc, &sc->sc_cdata.txp_rspring_tag,
-	    &sc->sc_cdata.txp_rspring_map, (void **)&sc->sc_ldata.txp_rspring);
+	    sc->sc_cdata.txp_rspring_map, (void **)&sc->sc_ldata.txp_rspring,
+	    &sc->sc_ldata.txp_rspring_paddr);
 	/* Zero ring. */
 	txp_dma_free(sc, &sc->sc_cdata.txp_zero_tag,
-	    &sc->sc_cdata.txp_zero_map, (void **)&sc->sc_ldata.txp_zero);
+	    sc->sc_cdata.txp_zero_map, (void **)&sc->sc_ldata.txp_zero,
+	    &sc->sc_ldata.txp_zero_paddr);
 	/* Host variables. */
 	txp_dma_free(sc, &sc->sc_cdata.txp_hostvar_tag,
-	    &sc->sc_cdata.txp_hostvar_map, (void **)&sc->sc_ldata.txp_hostvar);
+	    sc->sc_cdata.txp_hostvar_map, (void **)&sc->sc_ldata.txp_hostvar,
+	    &sc->sc_ldata.txp_hostvar_paddr);
 	/* Boot record. */
 	txp_dma_free(sc, &sc->sc_cdata.txp_boot_tag,
-	    &sc->sc_cdata.txp_boot_map, (void **)&sc->sc_ldata.txp_boot);
+	    sc->sc_cdata.txp_boot_map, (void **)&sc->sc_ldata.txp_boot,
+	    &sc->sc_ldata.txp_boot_paddr);
 
 	if (sc->sc_cdata.txp_parent_tag != NULL) {
 		bus_dma_tag_destroy(sc->sc_cdata.txp_parent_tag);

Modified: head/sys/dev/wpi/if_wpi.c
==============================================================================
--- head/sys/dev/wpi/if_wpi.c	Tue Jun 17 13:14:31 2014	(r267579)
+++ head/sys/dev/wpi/if_wpi.c	Tue Jun 17 14:47:49 2014	(r267580)
@@ -901,13 +901,13 @@ static void
 wpi_dma_contig_free(struct wpi_dma_info *dma)
 {
 	if (dma->tag) {
-		if (dma->map != NULL) {
+		if (dma->vaddr_start != NULL) {
 			if (dma->paddr_start != 0) {
 				bus_dmamap_sync(dma->tag, dma->map,
 				    BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 				bus_dmamap_unload(dma->tag, dma->map);
 			}
-			bus_dmamem_free(dma->tag, &dma->vaddr_start, dma->map);
+			bus_dmamem_free(dma->tag, dma->vaddr_start, dma->map);
 		}
 		bus_dma_tag_destroy(dma->tag);
 	}

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 16:07:59 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id CFFF36A4;
 Tue, 17 Jun 2014 16:07:59 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BBA762EFC;
 Tue, 17 Jun 2014 16:07:59 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5HG7x1Z058467;
 Tue, 17 Jun 2014 16:07:59 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5HG7vJd058451;
 Tue, 17 Jun 2014 16:07:57 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201406171607.s5HG7vJd058451@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 17 Jun 2014 16:07:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267581 - in head/sys/dev/sound: pci pci/hda pcm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 16:07:59 -0000

Author: jhb
Date: Tue Jun 17 16:07:57 2014
New Revision: 267581
URL: http://svnweb.freebsd.org/changeset/base/267581

Log:
  Fix various bugs with freeing static DMA allocations in sound drivers:
  - Don't compare the DMA map to NULL to determine if bus_dmamap_unload()
    should be called when releasing a static allocation.  Instead, compare
    the bus address against 0.
  - Don't assume that the DMA map for static allocations is NULL.  Instead,
    save the value set by bus_dmamem_alloc() so it can later be passed to
    bus_dmamem_free().  Also, add missing calls to bus_dmamap_unload() in
    these cases before freeing the buffer.
  - Use the bus address from the bus_dma callback instead of calling
    vtophys() on the address allocated by bus_dmamem_alloc().
  
  Reviewed by:	kan

Modified:
  head/sys/dev/sound/pci/atiixp.c
  head/sys/dev/sound/pci/emu10k1.c
  head/sys/dev/sound/pci/emu10kx.c
  head/sys/dev/sound/pci/envy24.c
  head/sys/dev/sound/pci/envy24ht.c
  head/sys/dev/sound/pci/hda/hdac.c
  head/sys/dev/sound/pci/hdspe.c
  head/sys/dev/sound/pci/maestro.c
  head/sys/dev/sound/pci/via8233.c
  head/sys/dev/sound/pci/via82c686.c
  head/sys/dev/sound/pcm/buffer.c

Modified: head/sys/dev/sound/pci/atiixp.c
==============================================================================
--- head/sys/dev/sound/pci/atiixp.c	Tue Jun 17 14:47:49 2014	(r267580)
+++ head/sys/dev/sound/pci/atiixp.c	Tue Jun 17 16:07:57 2014	(r267581)
@@ -1146,13 +1146,14 @@ atiixp_release_resource(struct atiixp_in
 		bus_dma_tag_destroy(sc->parent_dmat);
 		sc->parent_dmat = NULL;
 	}
-	if (sc->sgd_dmamap)
+	if (sc->sgd_addr) {
 		bus_dmamap_unload(sc->sgd_dmat, sc->sgd_dmamap);
+		sc->sgd_addr = 0;
+	}
 	if (sc->sgd_table) {
 		bus_dmamem_free(sc->sgd_dmat, sc->sgd_table, sc->sgd_dmamap);
 		sc->sgd_table = NULL;
 	}
-	sc->sgd_dmamap = NULL;
 	if (sc->sgd_dmat) {
 		bus_dma_tag_destroy(sc->sgd_dmat);
 		sc->sgd_dmat = NULL;

Modified: head/sys/dev/sound/pci/emu10k1.c
==============================================================================
--- head/sys/dev/sound/pci/emu10k1.c	Tue Jun 17 14:47:49 2014	(r267580)
+++ head/sys/dev/sound/pci/emu10k1.c	Tue Jun 17 16:07:57 2014	(r267581)
@@ -160,6 +160,7 @@ struct emu_memblk {
 	void *buf;
 	bus_addr_t buf_addr;
 	u_int32_t pte_start, pte_size;
+	bus_dmamap_t buf_map;
 };
 
 struct emu_mem {
@@ -168,6 +169,8 @@ struct emu_mem {
 	void *silent_page;
 	bus_addr_t silent_page_addr;
 	bus_addr_t ptb_pages_addr;
+	bus_dmamap_t ptb_map;
+	bus_dmamap_t silent_map;
 	SLIST_HEAD(, emu_memblk) blocks;
 };
 
@@ -239,7 +242,7 @@ struct sc_info {
 /* stuff */
 static int emu_init(struct sc_info *);
 static void emu_intr(void *);
-static void *emu_malloc(struct sc_info *sc, u_int32_t sz, bus_addr_t *addr);
+static void *emu_malloc(struct sc_info *sc, u_int32_t sz, bus_addr_t *addr, bus_dmamap_t *map);
 static void *emu_memalloc(struct sc_info *sc, u_int32_t sz, bus_addr_t *addr);
 static int emu_memfree(struct sc_info *sc, void *buf);
 static int emu_memstart(struct sc_info *sc, void *buf);
@@ -1315,24 +1318,27 @@ emu_setmap(void *arg, bus_dma_segment_t 
 }
 
 static void *
-emu_malloc(struct sc_info *sc, u_int32_t sz, bus_addr_t *addr)
+emu_malloc(struct sc_info *sc, u_int32_t sz, bus_addr_t *addr,
+    bus_dmamap_t *map)
 {
 	void *buf;
-	bus_dmamap_t map;
 
 	*addr = 0;
-	if (bus_dmamem_alloc(sc->parent_dmat, &buf, BUS_DMA_NOWAIT, &map))
+	if (bus_dmamem_alloc(sc->parent_dmat, &buf, BUS_DMA_NOWAIT, map))
 		return NULL;
-	if (bus_dmamap_load(sc->parent_dmat, map, buf, sz, emu_setmap, addr, 0)
-	    || !*addr)
+	if (bus_dmamap_load(sc->parent_dmat, *map, buf, sz, emu_setmap, addr, 0)
+	    || !*addr) {
+		bus_dmamem_free(sc->parent_dmat, buf, *map);
 		return NULL;
+	}
 	return buf;
 }
 
 static void
-emu_free(struct sc_info *sc, void *buf)
+emu_free(struct sc_info *sc, void *buf, bus_dmamap_t map)
 {
-	bus_dmamem_free(sc->parent_dmat, buf, NULL);
+	bus_dmamap_unload(sc->parent_dmat, map);
+	bus_dmamem_free(sc->parent_dmat, buf, map);
 }
 
 static void *
@@ -1362,7 +1368,7 @@ emu_memalloc(struct sc_info *sc, u_int32
 	blk = malloc(sizeof(*blk), M_DEVBUF, M_NOWAIT);
 	if (blk == NULL)
 		return NULL;
-	buf = emu_malloc(sc, sz, &blk->buf_addr);
+	buf = emu_malloc(sc, sz, &blk->buf_addr, &blk->buf_map);
 	*addr = blk->buf_addr;
 	if (buf == NULL) {
 		free(blk, M_DEVBUF);
@@ -1405,7 +1411,7 @@ emu_memfree(struct sc_info *sc, void *bu
 	if (blk == NULL)
 		return EINVAL;
 	SLIST_REMOVE(&mem->blocks, blk, emu_memblk, link);
-	emu_free(sc, buf);
+	emu_free(sc, buf, blk->buf_map);
 	tmp = (u_int32_t)(sc->mem.silent_page_addr) << 1;
 	for (idx = blk->pte_start; idx < blk->pte_start + blk->pte_size; idx++) {
 		mem->bmap[idx >> 3] &= ~(1 << (idx & 7));
@@ -1882,14 +1888,14 @@ emu_init(struct sc_info *sc)
 
 	SLIST_INIT(&sc->mem.blocks);
 	sc->mem.ptb_pages = emu_malloc(sc, EMUMAXPAGES * sizeof(u_int32_t),
-	    &sc->mem.ptb_pages_addr);
+	    &sc->mem.ptb_pages_addr, &sc->mem.ptb_map);
 	if (sc->mem.ptb_pages == NULL)
 		return -1;
 
 	sc->mem.silent_page = emu_malloc(sc, EMUPAGESIZE,
-	    &sc->mem.silent_page_addr);
+	    &sc->mem.silent_page_addr, &sc->mem.silent_map);
 	if (sc->mem.silent_page == NULL) {
-		emu_free(sc, sc->mem.ptb_pages);
+		emu_free(sc, sc->mem.ptb_pages, sc->mem.ptb_map);
 		return -1;
 	}
 	/* Clear page with silence & setup all pointers to this page */
@@ -2025,8 +2031,8 @@ emu_uninit(struct sc_info *sc)
 	/* init envelope engine */
 	if (!SLIST_EMPTY(&sc->mem.blocks))
 		device_printf(sc->dev, "warning: memblock list not empty\n");
-	emu_free(sc, sc->mem.ptb_pages);
-	emu_free(sc, sc->mem.silent_page);
+	emu_free(sc, sc->mem.ptb_pages, sc->mem.ptb_map);
+	emu_free(sc, sc->mem.silent_page, sc->mem.silent_map);
 
 	if(sc->mpu)
 	    mpu401_uninit(sc->mpu);

Modified: head/sys/dev/sound/pci/emu10kx.c
==============================================================================
--- head/sys/dev/sound/pci/emu10kx.c	Tue Jun 17 14:47:49 2014	(r267580)
+++ head/sys/dev/sound/pci/emu10kx.c	Tue Jun 17 16:07:57 2014	(r267581)
@@ -273,14 +273,17 @@ struct emu_memblk {
 	char		owner[16];
 	bus_addr_t	buf_addr;
 	uint32_t	pte_start, pte_size;
+	bus_dmamap_t	buf_map;
 };
 
 struct emu_mem {
 	uint8_t		bmap[EMU_MAXPAGES / 8];
 	uint32_t	*ptb_pages;
 	void		*silent_page;
-	bus_addr_t	silent_page_addr;
 	bus_addr_t	ptb_pages_addr;
+	bus_addr_t	silent_page_addr;
+	bus_dmamap_t	ptb_map;
+	bus_dmamap_t	silent_map;
 	bus_dma_tag_t	dmat;
 	struct emu_sc_info *card;
 	SLIST_HEAD(, emu_memblk) blocks;
@@ -377,8 +380,8 @@ struct emu_sc_info {
 };
 
 static void	emu_setmap(void *arg, bus_dma_segment_t * segs, int nseg, int error);
-static void*	emu_malloc(struct emu_mem *mem, uint32_t sz, bus_addr_t * addr);
-static void	emu_free(struct emu_mem *mem, void *dmabuf);
+static void*	emu_malloc(struct emu_mem *mem, uint32_t sz, bus_addr_t * addr, bus_dmamap_t *map);
+static void	emu_free(struct emu_mem *mem, void *dmabuf, bus_dmamap_t map);
 static void*	emu_memalloc(struct emu_mem *mem, uint32_t sz, bus_addr_t * addr, const char * owner);
 static int	emu_memfree(struct emu_mem *mem, void *membuf);
 static int	emu_memstart(struct emu_mem *mem, void *membuf);
@@ -1057,30 +1060,32 @@ emu_setmap(void *arg, bus_dma_segment_t 
 }
 
 static void *
-emu_malloc(struct emu_mem *mem, uint32_t sz, bus_addr_t * addr)
+emu_malloc(struct emu_mem *mem, uint32_t sz, bus_addr_t * addr,
+    bus_dmamap_t *map)
 {
 	void *dmabuf;
-	bus_dmamap_t map;
 	int error;
 
 	*addr = 0;
-	if ((error = bus_dmamem_alloc(mem->dmat, &dmabuf, BUS_DMA_NOWAIT, &map))) {
+	if ((error = bus_dmamem_alloc(mem->dmat, &dmabuf, BUS_DMA_NOWAIT, map))) {
 		if (mem->card->dbg_level > 2)
 			device_printf(mem->card->dev, "emu_malloc: failed to alloc DMA map: %d\n", error);
 		return (NULL);
 		}
-	if ((error = bus_dmamap_load(mem->dmat, map, dmabuf, sz, emu_setmap, addr, 0)) || !*addr) {
+	if ((error = bus_dmamap_load(mem->dmat, *map, dmabuf, sz, emu_setmap, addr, 0)) || !*addr) {
 		if (mem->card->dbg_level > 2)
 			device_printf(mem->card->dev, "emu_malloc: failed to load DMA memory: %d\n", error);
+		bus_dmamem_free(mem->dmat, dmabuf, *map);
 		return (NULL);
 		}
 	return (dmabuf);
 }
 
 static void
-emu_free(struct emu_mem *mem, void *dmabuf)
+emu_free(struct emu_mem *mem, void *dmabuf, bus_dmamap_t map)
 {
-	bus_dmamem_free(mem->dmat, dmabuf, NULL);
+	bus_dmamap_unload(mem->dmat, map);
+	bus_dmamem_free(mem->dmat, dmabuf, map);
 }
 
 static void *
@@ -1121,7 +1126,7 @@ emu_memalloc(struct emu_mem *mem, uint32
 		return (NULL);
 		}
 	bzero(blk, sizeof(*blk));
-	membuf = emu_malloc(mem, sz, &blk->buf_addr);
+	membuf = emu_malloc(mem, sz, &blk->buf_addr, &blk->buf_map);
 	*addr = blk->buf_addr;
 	if (membuf == NULL) {
 		if (mem->card->dbg_level > 2)
@@ -1159,7 +1164,7 @@ emu_memfree(struct emu_mem *mem, void *m
 	if (blk == NULL)
 		return (EINVAL);
 	SLIST_REMOVE(&mem->blocks, blk, emu_memblk, link);
-	emu_free(mem, membuf);
+	emu_free(mem, membuf, blk->buf_map);
 	tmp = (uint32_t) (mem->silent_page_addr) << 1;
 	for (idx = blk->pte_start; idx < blk->pte_start + blk->pte_size; idx++) {
 		mem->bmap[idx >> 3] &= ~(1 << (idx & 7));
@@ -2724,13 +2729,13 @@ emu_init(struct emu_sc_info *sc)
 
 	sc->mem.card = sc;
 	SLIST_INIT(&sc->mem.blocks);
-	sc->mem.ptb_pages = emu_malloc(&sc->mem, EMU_MAXPAGES * sizeof(uint32_t), &sc->mem.ptb_pages_addr);
+	sc->mem.ptb_pages = emu_malloc(&sc->mem, EMU_MAXPAGES * sizeof(uint32_t), &sc->mem.ptb_pages_addr, &sc->mem.ptb_map);
 	if (sc->mem.ptb_pages == NULL)
 		return (ENOMEM);
 
-	sc->mem.silent_page = emu_malloc(&sc->mem, EMUPAGESIZE, &sc->mem.silent_page_addr);
+	sc->mem.silent_page = emu_malloc(&sc->mem, EMUPAGESIZE, &sc->mem.silent_page_addr, &sc->mem.silent_map);
 	if (sc->mem.silent_page == NULL) {
-		emu_free(&sc->mem, sc->mem.ptb_pages);
+		emu_free(&sc->mem, sc->mem.ptb_pages, sc->mem.ptb_map);
 		return (ENOMEM);
 	}
 	/* Clear page with silence & setup all pointers to this page */
@@ -2946,8 +2951,8 @@ emu_uninit(struct emu_sc_info *sc)
 		if (blk != NULL)
 		device_printf(sc->dev, "lost %d for %s\n", blk->pte_size, blk->owner);
 
-	emu_free(&sc->mem, sc->mem.ptb_pages);
-	emu_free(&sc->mem, sc->mem.silent_page);
+	emu_free(&sc->mem, sc->mem.ptb_pages, sc->mem.ptb_map);
+	emu_free(&sc->mem, sc->mem.silent_page, sc->mem.silent_map);
 
 	return (0);
 }

Modified: head/sys/dev/sound/pci/envy24.c
==============================================================================
--- head/sys/dev/sound/pci/envy24.c	Tue Jun 17 14:47:49 2014	(r267580)
+++ head/sys/dev/sound/pci/envy24.c	Tue Jun 17 16:07:57 2014	(r267581)
@@ -163,6 +163,7 @@ struct sc_info {
 	u_int32_t	psize, rsize; /* DMA buffer size(byte) */
 	u_int16_t	blk[2]; /* transfer check blocksize(dword) */
 	bus_dmamap_t	pmap, rmap;
+	bus_addr_t	paddr, raddr;
 
 	/* current status */
 	u_int32_t	speed;
@@ -2166,15 +2167,16 @@ envy24_pci_probe(device_t dev)
 static void
 envy24_dmapsetmap(void *arg, bus_dma_segment_t *segs, int nseg, int error)
 {
-	/* struct sc_info *sc = (struct sc_info *)arg; */
+	struct sc_info *sc = (struct sc_info *)arg;
 
+	sc->paddr = segs->ds_addr;
 #if(0)
 	device_printf(sc->dev, "envy24_dmapsetmap()\n");
 	if (bootverbose) {
 		printf("envy24(play): setmap %lx, %lx; ",
 		    (unsigned long)segs->ds_addr,
 		    (unsigned long)segs->ds_len);
-		printf("%p -> %lx\n", sc->pmap, (unsigned long)vtophys(sc->pmap));
+		printf("%p -> %lx\n", sc->pmap, sc->paddr);
 	}
 #endif
 }
@@ -2182,15 +2184,16 @@ envy24_dmapsetmap(void *arg, bus_dma_seg
 static void
 envy24_dmarsetmap(void *arg, bus_dma_segment_t *segs, int nseg, int error)
 {
-	/* struct sc_info *sc = (struct sc_info *)arg; */
+	struct sc_info *sc = (struct sc_info *)arg;
 
+	sc->raddr = segs->ds_addr;
 #if(0)
 	device_printf(sc->dev, "envy24_dmarsetmap()\n");
 	if (bootverbose) {
 		printf("envy24(record): setmap %lx, %lx; ",
 		    (unsigned long)segs->ds_addr,
 		    (unsigned long)segs->ds_len);
-		printf("%p -> %lx\n", sc->rmap, (unsigned long)vtophys(sc->pmap));
+		printf("%p -> %lx\n", sc->rmap, sc->raddr);
 	}
 #endif
 }
@@ -2200,19 +2203,17 @@ envy24_dmafree(struct sc_info *sc)
 {
 #if(0)
 	device_printf(sc->dev, "envy24_dmafree():");
-	if (sc->rmap) printf(" sc->rmap(0x%08x)", (u_int32_t)sc->rmap);
-	else printf(" sc->rmap(null)");
-	if (sc->pmap) printf(" sc->pmap(0x%08x)", (u_int32_t)sc->pmap);
-	else printf(" sc->pmap(null)");
+	printf(" sc->raddr(0x%08x)", (u_int32_t)sc->raddr);
+	printf(" sc->paddr(0x%08x)", (u_int32_t)sc->paddr);
 	if (sc->rbuf) printf(" sc->rbuf(0x%08x)", (u_int32_t)sc->rbuf);
 	else printf(" sc->rbuf(null)");
 	if (sc->pbuf) printf(" sc->pbuf(0x%08x)\n", (u_int32_t)sc->pbuf);
 	else printf(" sc->pbuf(null)\n");
 #endif
 #if(0)
-	if (sc->rmap)
+	if (sc->raddr)
 		bus_dmamap_unload(sc->dmat, sc->rmap);
-	if (sc->pmap)
+	if (sc->paddr)
 		bus_dmamap_unload(sc->dmat, sc->pmap);
 	if (sc->rbuf)
 		bus_dmamem_free(sc->dmat, sc->rbuf, sc->rmap);
@@ -2225,7 +2226,7 @@ envy24_dmafree(struct sc_info *sc)
 	bus_dmamem_free(sc->dmat, sc->pbuf, sc->pmap);
 #endif
 
-	sc->rmap = sc->pmap = NULL;
+	sc->raddr = sc->paddr = 0;
 	sc->pbuf = NULL;
 	sc->rbuf = NULL;
 
@@ -2235,7 +2236,6 @@ envy24_dmafree(struct sc_info *sc)
 static int
 envy24_dmainit(struct sc_info *sc)
 {
-	u_int32_t addr;
 
 #if(0)
 	device_printf(sc->dev, "envy24_dmainit()\n");
@@ -2245,7 +2245,7 @@ envy24_dmainit(struct sc_info *sc)
 	sc->rsize = ENVY24_REC_BUFUNIT * ENVY24_SAMPLE_NUM;
 	sc->pbuf = NULL;
 	sc->rbuf = NULL;
-	sc->pmap = sc->rmap = NULL;
+	sc->paddr = sc->raddr = 0;
 	sc->blk[0] = sc->blk[1] = 0;
 
 	/* allocate DMA buffer */
@@ -2273,11 +2273,10 @@ envy24_dmainit(struct sc_info *sc)
 	bzero(sc->rbuf, sc->rsize);
 
 	/* set values to register */
-	addr = vtophys(sc->pbuf);
 #if(0)
-	device_printf(sc->dev, "pbuf(0x%08x)\n", addr);
+	device_printf(sc->dev, "paddr(0x%08x)\n", sc->paddr);
 #endif
-	envy24_wrmt(sc, ENVY24_MT_PADDR, addr, 4);
+	envy24_wrmt(sc, ENVY24_MT_PADDR, sc->paddr, 4);
 #if(0)
 	device_printf(sc->dev, "PADDR-->(0x%08x)\n", envy24_rdmt(sc, ENVY24_MT_PADDR, 4));
 	device_printf(sc->dev, "psize(%ld)\n", sc->psize / 4 - 1);
@@ -2286,8 +2285,7 @@ envy24_dmainit(struct sc_info *sc)
 #if(0)
 	device_printf(sc->dev, "PCNT-->(%ld)\n", envy24_rdmt(sc, ENVY24_MT_PCNT, 2));
 #endif
-	addr = vtophys(sc->rbuf);
-	envy24_wrmt(sc, ENVY24_MT_RADDR, addr, 4);
+	envy24_wrmt(sc, ENVY24_MT_RADDR, sc->raddr, 4);
 	envy24_wrmt(sc, ENVY24_MT_RCNT, sc->rsize / 4 - 1, 2);
 
 	return 0;

Modified: head/sys/dev/sound/pci/envy24ht.c
==============================================================================
--- head/sys/dev/sound/pci/envy24ht.c	Tue Jun 17 14:47:49 2014	(r267580)
+++ head/sys/dev/sound/pci/envy24ht.c	Tue Jun 17 16:07:57 2014	(r267581)
@@ -162,6 +162,7 @@ struct sc_info {
 	u_int32_t	psize, rsize; /* DMA buffer size(byte) */
 	u_int16_t	blk[2]; /* transfer check blocksize(dword) */
 	bus_dmamap_t	pmap, rmap;
+	bus_addr_t	paddr, raddr;
 
 	/* current status */
 	u_int32_t	speed;
@@ -2082,6 +2083,7 @@ envy24ht_dmapsetmap(void *arg, bus_dma_s
 {
 	struct sc_info *sc = arg;
 
+	sc->paddr = segs->ds_addr;
 #if(0)
 	device_printf(sc->dev, "envy24ht_dmapsetmap()\n");
 	if (bootverbose) {
@@ -2099,6 +2101,7 @@ envy24ht_dmarsetmap(void *arg, bus_dma_s
 {
 	struct sc_info *sc = arg;
 
+	sc->raddr = segs->ds_addr;
 #if(0)
 	device_printf(sc->dev, "envy24ht_dmarsetmap()\n");
 	if (bootverbose) {
@@ -2116,19 +2119,17 @@ envy24ht_dmafree(struct sc_info *sc)
 {
 #if(0)
 	device_printf(sc->dev, "envy24ht_dmafree():");
-	if (sc->rmap) printf(" sc->rmap(0x%08x)", (u_int32_t)sc->rmap);
-	else printf(" sc->rmap(null)");
-	if (sc->pmap) printf(" sc->pmap(0x%08x)", (u_int32_t)sc->pmap);
-	else printf(" sc->pmap(null)");
+	printf(" sc->raddr(0x%08x)", (u_int32_t)sc->raddr);
+	printf(" sc->paddr(0x%08x)", (u_int32_t)sc->paddr);
 	if (sc->rbuf) printf(" sc->rbuf(0x%08x)", (u_int32_t)sc->rbuf);
 	else printf(" sc->rbuf(null)");
 	if (sc->pbuf) printf(" sc->pbuf(0x%08x)\n", (u_int32_t)sc->pbuf);
 	else printf(" sc->pbuf(null)\n");
 #endif
 #if(0)
-	if (sc->rmap)
+	if (sc->raddr)
 		bus_dmamap_unload(sc->dmat, sc->rmap);
-	if (sc->pmap)
+	if (sc->paddr)
 		bus_dmamap_unload(sc->dmat, sc->pmap);
 	if (sc->rbuf)
 		bus_dmamem_free(sc->dmat, sc->rbuf, sc->rmap);
@@ -2141,7 +2142,7 @@ envy24ht_dmafree(struct sc_info *sc)
 	bus_dmamem_free(sc->dmat, sc->pbuf, sc->pmap);
 #endif
 
-	sc->rmap = sc->pmap = NULL;
+	sc->raddr = sc->paddr = 0;
 	sc->pbuf = NULL;
 	sc->rbuf = NULL;
 
@@ -2160,7 +2161,7 @@ envy24ht_dmainit(struct sc_info *sc)
 	sc->rsize = ENVY24HT_REC_BUFUNIT * ENVY24HT_SAMPLE_NUM;
 	sc->pbuf = NULL;
 	sc->rbuf = NULL;
-	sc->pmap = sc->rmap = NULL;
+	sc->paddr = sc->raddr = 0;
 	sc->blk[0] = sc->blk[1] = 0;
 
 	/* allocate DMA buffer */

Modified: head/sys/dev/sound/pci/hda/hdac.c
==============================================================================
--- head/sys/dev/sound/pci/hda/hdac.c	Tue Jun 17 14:47:49 2014	(r267580)
+++ head/sys/dev/sound/pci/hda/hdac.c	Tue Jun 17 16:07:57 2014	(r267581)
@@ -611,19 +611,19 @@ hdac_dma_alloc_fail:
 static void
 hdac_dma_free(struct hdac_softc *sc, struct hdac_dma *dma)
 {
-	if (dma->dma_map != NULL) {
+	if (dma->dma_paddr != 0) {
 #if 0
 		/* Flush caches */
 		bus_dmamap_sync(dma->dma_tag, dma->dma_map,
 		    BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 #endif
 		bus_dmamap_unload(dma->dma_tag, dma->dma_map);
+		dma->dma_paddr = 0;
 	}
 	if (dma->dma_vaddr != NULL) {
 		bus_dmamem_free(dma->dma_tag, dma->dma_vaddr, dma->dma_map);
 		dma->dma_vaddr = NULL;
 	}
-	dma->dma_map = NULL;
 	if (dma->dma_tag != NULL) {
 		bus_dma_tag_destroy(dma->dma_tag);
 		dma->dma_tag = NULL;

Modified: head/sys/dev/sound/pci/hdspe.c
==============================================================================
--- head/sys/dev/sound/pci/hdspe.c	Tue Jun 17 14:47:49 2014	(r267580)
+++ head/sys/dev/sound/pci/hdspe.c	Tue Jun 17 16:07:57 2014	(r267581)
@@ -344,7 +344,6 @@ hdspe_dmafree(struct sc_info *sc)
 	bus_dmamap_unload(sc->dmat, sc->pmap);
 	bus_dmamem_free(sc->dmat, sc->rbuf, sc->rmap);
 	bus_dmamem_free(sc->dmat, sc->pbuf, sc->pmap);
-	sc->rmap = sc->pmap = NULL;
 	sc->rbuf = sc->pbuf = NULL;
 }
 

Modified: head/sys/dev/sound/pci/maestro.c
==============================================================================
--- head/sys/dev/sound/pci/maestro.c	Tue Jun 17 14:47:49 2014	(r267580)
+++ head/sys/dev/sound/pci/maestro.c	Tue Jun 17 16:07:57 2014	(r267581)
@@ -110,6 +110,7 @@ struct agg_chinfo {
 	struct snd_dbuf		*buffer;
 
 	/* OS independent */
+	bus_dmamap_t		map;
 	bus_addr_t		phys;	/* channel buffer physical address */
 	bus_addr_t		base;	/* channel buffer segment base */
 	u_int32_t		blklen;	/* DMA block length in WORDs */
@@ -130,6 +131,7 @@ struct agg_rchinfo {
 	struct snd_dbuf		*buffer;
 
 	/* OS independent */
+	bus_dmamap_t		map;
 	bus_addr_t		phys;	/* channel buffer physical address */
 	bus_addr_t		base;	/* channel buffer segment base */
 	u_int32_t		blklen;	/* DMA block length in WORDs */
@@ -166,6 +168,7 @@ struct agg_info {
 	struct ac97_info	*codec;
 
 	/* OS independent */
+	bus_dmamap_t		stat_map;
 	u_int8_t		*stat;	/* status buffer pointer */
 	bus_addr_t		phys;	/* status buffer physical address */
 	unsigned int		bufsz;	/* channel buffer size in bytes */
@@ -262,8 +265,9 @@ static int	agg_suspend(device_t);
 static int	agg_resume(device_t);
 static int	agg_shutdown(device_t);
 
-static void	*dma_malloc(bus_dma_tag_t, u_int32_t, bus_addr_t*);
-static void	dma_free(bus_dma_tag_t, void *);
+static void	*dma_malloc(bus_dma_tag_t, u_int32_t, bus_addr_t*,
+		    bus_dmamap_t *);
+static void	dma_free(bus_dma_tag_t, void *, bus_dmamap_t);
 
 
 /* -----------------------------
@@ -1297,7 +1301,7 @@ aggpch_init(kobj_t obj, void *devinfo, s
 	ch->buffer = b;
 	ch->num = ess->playchns;
 
-	p = dma_malloc(ess->buf_dmat, ess->bufsz, &physaddr);
+	p = dma_malloc(ess->buf_dmat, ess->bufsz, &physaddr, &ch->map);
 	if (p == NULL)
 		return NULL;
 	ch->phys = physaddr;
@@ -1360,7 +1364,7 @@ aggpch_free(kobj_t obj, void *data)
 	struct agg_info *ess = ch->parent;
 
 	/* free up buffer - called after channel stopped */
-	dma_free(ess->buf_dmat, sndbuf_getbuf(ch->buffer));
+	dma_free(ess->buf_dmat, sndbuf_getbuf(ch->buffer), ch->map);
 
 	/* return 0 if ok */
 	return 0;
@@ -1722,25 +1726,26 @@ setmap(void *arg, bus_dma_segment_t *seg
 }
 
 static void *
-dma_malloc(bus_dma_tag_t dmat, u_int32_t sz, bus_addr_t *phys)
+dma_malloc(bus_dma_tag_t dmat, u_int32_t sz, bus_addr_t *phys,
+    bus_dmamap_t *map)
 {
 	void *buf;
-	bus_dmamap_t map;
 
-	if (bus_dmamem_alloc(dmat, &buf, BUS_DMA_NOWAIT, &map))
+	if (bus_dmamem_alloc(dmat, &buf, BUS_DMA_NOWAIT, map))
 		return NULL;
-	if (bus_dmamap_load(dmat, map, buf, sz, setmap, phys, 0)
-	    || !*phys || map) {
-		bus_dmamem_free(dmat, buf, map);
+	if (bus_dmamap_load(dmat, *map, buf, sz, setmap, phys, 0) != 0 ||
+	    *phys == 0) {
+		bus_dmamem_free(dmat, buf, *map);
 		return NULL;
 	}
 	return buf;
 }
 
 static void
-dma_free(bus_dma_tag_t dmat, void *buf)
+dma_free(bus_dma_tag_t dmat, void *buf, bus_dmamap_t map)
 {
-	bus_dmamem_free(dmat, buf, NULL);
+	bus_dmamap_unload(dmat, map);
+	bus_dmamem_free(dmat, buf, map);
 }
 
 static int
@@ -1836,7 +1841,8 @@ agg_attach(device_t dev)
 	}
 
 	/* Allocate the room for brain-damaging status buffer. */
-	ess->stat = dma_malloc(ess->stat_dmat, 3*ess->bufsz, &ess->phys);
+	ess->stat = dma_malloc(ess->stat_dmat, 3*ess->bufsz, &ess->phys,
+	    &ess->stat_map);
 	if (ess->stat == NULL) {
 		device_printf(dev, "cannot allocate status buffer\n");
 		ret = ENOMEM;
@@ -1939,7 +1945,7 @@ agg_attach(device_t dev)
 		bus_release_resource(dev, SYS_RES_IOPORT, regid, reg);
 	if (ess != NULL) {
 		if (ess->stat != NULL)
-			dma_free(ess->stat_dmat, ess->stat);
+			dma_free(ess->stat_dmat, ess->stat, ess->stat_map);
 		if (ess->stat_dmat != NULL)
 			bus_dma_tag_destroy(ess->stat_dmat);
 		if (ess->buf_dmat != NULL)
@@ -1983,7 +1989,7 @@ agg_detach(device_t dev)
 	bus_teardown_intr(dev, ess->irq, ess->ih);
 	bus_release_resource(dev, SYS_RES_IRQ, ess->irqid, ess->irq);
 	bus_release_resource(dev, SYS_RES_IOPORT, ess->regid, ess->reg);
-	dma_free(ess->stat_dmat, ess->stat);
+	dma_free(ess->stat_dmat, ess->stat, ess->stat_map);
 	bus_dma_tag_destroy(ess->stat_dmat);
 	bus_dma_tag_destroy(ess->buf_dmat);
 	mtx_destroy(&ess->lock);

Modified: head/sys/dev/sound/pci/via8233.c
==============================================================================
--- head/sys/dev/sound/pci/via8233.c	Tue Jun 17 14:47:49 2014	(r267580)
+++ head/sys/dev/sound/pci/via8233.c	Tue Jun 17 16:07:57 2014	(r267581)
@@ -1381,7 +1381,7 @@ bad:
 		bus_release_resource(dev, SYS_RES_IRQ, via->irqid, via->irq);
 	if (via->parent_dmat)
 		bus_dma_tag_destroy(via->parent_dmat);
-	if (via->sgd_dmamap)
+	if (via->sgd_addr)
 		bus_dmamap_unload(via->sgd_dmat, via->sgd_dmamap);
 	if (via->sgd_table)
 		bus_dmamem_free(via->sgd_dmat, via->sgd_table, via->sgd_dmamap);

Modified: head/sys/dev/sound/pci/via82c686.c
==============================================================================
--- head/sys/dev/sound/pci/via82c686.c	Tue Jun 17 14:47:49 2014	(r267580)
+++ head/sys/dev/sound/pci/via82c686.c	Tue Jun 17 16:07:57 2014	(r267581)
@@ -606,7 +606,7 @@ bad:
 	if (via->ih) bus_teardown_intr(dev, via->irq, via->ih);
 	if (via->irq) bus_release_resource(dev, SYS_RES_IRQ, via->irqid, via->irq);
 	if (via->parent_dmat) bus_dma_tag_destroy(via->parent_dmat);
-	if (via->sgd_dmamap) bus_dmamap_unload(via->sgd_dmat, via->sgd_dmamap);
+	if (via->sgd_addr) bus_dmamap_unload(via->sgd_dmat, via->sgd_dmamap);
 	if (via->sgd_table) bus_dmamem_free(via->sgd_dmat, via->sgd_table, via->sgd_dmamap);
 	if (via->sgd_dmat) bus_dma_tag_destroy(via->sgd_dmat);
 	if (via->lock) snd_mtxfree(via->lock);

Modified: head/sys/dev/sound/pcm/buffer.c
==============================================================================
--- head/sys/dev/sound/pcm/buffer.c	Tue Jun 17 14:47:49 2014	(r267580)
+++ head/sys/dev/sound/pcm/buffer.c	Tue Jun 17 16:07:57 2014	(r267581)
@@ -139,10 +139,9 @@ sndbuf_free(struct snd_dbuf *b)
 
 	if (b->buf) {
 		if (b->flags & SNDBUF_F_MANAGED) {
-			if (b->dmamap)
+			if (b->buf_addr)
 				bus_dmamap_unload(b->dmatag, b->dmamap);
-			if (b->dmatag)
-				bus_dmamem_free(b->dmatag, b->buf, b->dmamap);
+			bus_dmamem_free(b->dmatag, b->buf, b->dmamap);
 		} else
 			free(b->buf, M_DEVBUF);
 	}

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 16:21:50 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id EA5A0D18;
 Tue, 17 Jun 2014 16:21:50 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D7D5B20C8;
 Tue, 17 Jun 2014 16:21:50 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5HGLoK0064878;
 Tue, 17 Jun 2014 16:21:50 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5HGLoIM064877;
 Tue, 17 Jun 2014 16:21:50 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201406171621.s5HGLoIM064877@svn.freebsd.org>
From: Ed Maste 
Date: Tue, 17 Jun 2014 16:21:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267582 - head/tools/build/options
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 16:21:51 -0000

Author: emaste
Date: Tue Jun 17 16:21:50 2014
New Revision: 267582
URL: http://svnweb.freebsd.org/changeset/base/267582

Log:
  share/vt now also includes keymaps

Modified:
  head/tools/build/options/WITHOUT_VT_SUPPORT

Modified: head/tools/build/options/WITHOUT_VT_SUPPORT
==============================================================================
--- head/tools/build/options/WITHOUT_VT_SUPPORT	Tue Jun 17 16:07:57 2014	(r267581)
+++ head/tools/build/options/WITHOUT_VT_SUPPORT	Tue Jun 17 16:21:50 2014	(r267582)
@@ -1,4 +1,4 @@
 .\" $FreeBSD$
 Set to not build
 .Xr vt 4
-support files (fonts).
+support files (fonts and keymaps).

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 16:25:50 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id DE11CF1D;
 Tue, 17 Jun 2014 16:25:50 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CB621211A;
 Tue, 17 Jun 2014 16:25:50 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5HGPoC0067647;
 Tue, 17 Jun 2014 16:25:50 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5HGPooc067646;
 Tue, 17 Jun 2014 16:25:50 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201406171625.s5HGPooc067646@svn.freebsd.org>
From: Ed Maste 
Date: Tue, 17 Jun 2014 16:25:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267583 - head/share/man/man5
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 16:25:51 -0000

Author: emaste
Date: Tue Jun 17 16:25:50 2014
New Revision: 267583
URL: http://svnweb.freebsd.org/changeset/base/267583

Log:
  Update src.conf.5 after r267582

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==============================================================================
--- head/share/man/man5/src.conf.5	Tue Jun 17 16:21:50 2014	(r267582)
+++ head/share/man/man5/src.conf.5	Tue Jun 17 16:25:50 2014	(r267583)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
 .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des
 .\" $FreeBSD$
-.Dd June 8, 2014
+.Dd June 17, 2014
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -1089,10 +1089,10 @@ and
 .\" from FreeBSD: head/tools/build/options/WITHOUT_VI 264903 2014-04-24 23:17:40Z imp
 Set to not build and install vi, view, ex and related programs.
 .It Va WITHOUT_VT_SUPPORT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_VT_SUPPORT 267124 2014-06-05 18:53:56Z emaste
+.\" from FreeBSD: head/tools/build/options/WITHOUT_VT_SUPPORT 267582 2014-06-17 16:21:50Z emaste
 Set to not build
 .Xr vt 4
-support files (fonts).
+support files (fonts and keymaps).
 .It Va WITHOUT_WARNS
 .\" from FreeBSD: head/tools/build/options/WITHOUT_WARNS 265830 2014-05-10 16:37:53Z imp
 Set this to not add warning flags to the compiler invocations.

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 18:10:09 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E34B97C2;
 Tue, 17 Jun 2014 18:10:08 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C42362B2A;
 Tue, 17 Jun 2014 18:10:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5HIA8NC015357;
 Tue, 17 Jun 2014 18:10:08 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5HIA7Op015345;
 Tue, 17 Jun 2014 18:10:07 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201406171810.s5HIA7Op015345@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 17 Jun 2014 18:10:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267589 - in head/sys: arm/at91 dev/ahci dev/ata dev/de
 dev/mvs dev/nfe dev/nxge dev/vxge
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 18:10:09 -0000

Author: jhb
Date: Tue Jun 17 18:10:06 2014
New Revision: 267589
URL: http://svnweb.freebsd.org/changeset/base/267589

Log:
  Don't bother clearing maps for static DMA allocations to NULL.  Instead,
  leave them as purely opaque values that are only set by bus_dmamem_alloc().

Modified:
  head/sys/arm/at91/if_ate.c
  head/sys/dev/ahci/ahci.c
  head/sys/dev/ata/ata-dma.c
  head/sys/dev/de/if_de.c
  head/sys/dev/mvs/mvs.c
  head/sys/dev/nfe/if_nfe.c
  head/sys/dev/nxge/xge-osdep.h
  head/sys/dev/vxge/vxge-osdep.h

Modified: head/sys/arm/at91/if_ate.c
==============================================================================
--- head/sys/arm/at91/if_ate.c	Tue Jun 17 18:03:59 2014	(r267588)
+++ head/sys/arm/at91/if_ate.c	Tue Jun 17 18:10:06 2014	(r267589)
@@ -671,7 +671,6 @@ ate_deactivate(struct ate_softc *sc)
 			bus_dmamem_free(sc->rx_tag, sc->rx_buf[i],
 			    sc->rx_map[i]);
 			sc->rx_buf[i] = NULL;
-			sc->rx_map[i] = NULL;
 		}
 		bus_dma_tag_destroy(sc->rx_tag);
 	}

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c	Tue Jun 17 18:03:59 2014	(r267588)
+++ head/sys/dev/ahci/ahci.c	Tue Jun 17 18:10:06 2014	(r267589)
@@ -1394,14 +1394,12 @@ ahci_dmafini(device_t dev)
 		bus_dmamap_unload(ch->dma.rfis_tag, ch->dma.rfis_map);
 		bus_dmamem_free(ch->dma.rfis_tag, ch->dma.rfis, ch->dma.rfis_map);
 		ch->dma.rfis_bus = 0;
-		ch->dma.rfis_map = NULL;
 		ch->dma.rfis = NULL;
 	}
 	if (ch->dma.work_bus) {
 		bus_dmamap_unload(ch->dma.work_tag, ch->dma.work_map);
 		bus_dmamem_free(ch->dma.work_tag, ch->dma.work, ch->dma.work_map);
 		ch->dma.work_bus = 0;
-		ch->dma.work_map = NULL;
 		ch->dma.work = NULL;
 	}
 	if (ch->dma.work_tag) {

Modified: head/sys/dev/ata/ata-dma.c
==============================================================================
--- head/sys/dev/ata/ata-dma.c	Tue Jun 17 18:03:59 2014	(r267588)
+++ head/sys/dev/ata/ata-dma.c	Tue Jun 17 18:10:06 2014	(r267589)
@@ -132,7 +132,6 @@ ata_dmafini(device_t dev)
 	bus_dmamap_unload(ch->dma.work_tag, ch->dma.work_map);
 	bus_dmamem_free(ch->dma.work_tag, ch->dma.work, ch->dma.work_map);
 	ch->dma.work_bus = 0;
-	ch->dma.work_map = NULL;
 	ch->dma.work = NULL;
     }
     if (ch->dma.work_tag) {

Modified: head/sys/dev/de/if_de.c
==============================================================================
--- head/sys/dev/de/if_de.c	Tue Jun 17 18:03:59 2014	(r267588)
+++ head/sys/dev/de/if_de.c	Tue Jun 17 18:10:06 2014	(r267589)
@@ -4473,7 +4473,6 @@ tulip_busdma_freering(tulip_ringinfo_t *
     }
     if (ri->ri_descs != NULL) {
 	bus_dmamem_free(ri->ri_ring_tag, ri->ri_descs, ri->ri_ring_map);
-	ri->ri_ring_map = NULL;
 	ri->ri_descs = NULL;
     }
     if (ri->ri_ring_tag != NULL) {
@@ -4558,7 +4557,6 @@ tulip_busdma_cleanup(tulip_softc_t * con
     if (sc->tulip_setupbuf != NULL) {
 	bus_dmamem_free(sc->tulip_setup_tag, sc->tulip_setupbuf,
 	    sc->tulip_setup_map);
-	sc->tulip_setup_map = NULL;
 	sc->tulip_setupbuf = NULL;
     }
     if (sc->tulip_setup_tag != NULL) {

Modified: head/sys/dev/mvs/mvs.c
==============================================================================
--- head/sys/dev/mvs/mvs.c	Tue Jun 17 18:03:59 2014	(r267588)
+++ head/sys/dev/mvs/mvs.c	Tue Jun 17 18:10:06 2014	(r267589)
@@ -402,7 +402,6 @@ mvs_dmafini(device_t dev)
 		bus_dmamem_free(ch->dma.workrp_tag,
 		    ch->dma.workrp, ch->dma.workrp_map);
 		ch->dma.workrp_bus = 0;
-		ch->dma.workrp_map = NULL;
 		ch->dma.workrp = NULL;
 	}
 	if (ch->dma.workrp_tag) {
@@ -414,7 +413,6 @@ mvs_dmafini(device_t dev)
 		bus_dmamem_free(ch->dma.workrq_tag,
 		    ch->dma.workrq, ch->dma.workrq_map);
 		ch->dma.workrq_bus = 0;
-		ch->dma.workrq_map = NULL;
 		ch->dma.workrq = NULL;
 	}
 	if (ch->dma.workrq_tag) {

Modified: head/sys/dev/nfe/if_nfe.c
==============================================================================
--- head/sys/dev/nfe/if_nfe.c	Tue Jun 17 18:03:59 2014	(r267588)
+++ head/sys/dev/nfe/if_nfe.c	Tue Jun 17 18:10:06 2014	(r267589)
@@ -1410,7 +1410,6 @@ nfe_free_rx_ring(struct nfe_softc *sc, s
 		bus_dmamem_free(ring->rx_desc_tag, desc, ring->rx_desc_map);
 		ring->desc64 = NULL;
 		ring->desc32 = NULL;
-		ring->rx_desc_map = NULL;
 	}
 	if (ring->rx_desc_tag != NULL) {
 		bus_dma_tag_destroy(ring->rx_desc_tag);
@@ -1464,7 +1463,6 @@ nfe_free_jrx_ring(struct nfe_softc *sc, 
 		bus_dmamem_free(ring->jrx_desc_tag, desc, ring->jrx_desc_map);
 		ring->jdesc64 = NULL;
 		ring->jdesc32 = NULL;
-		ring->jrx_desc_map = NULL;
 	}
 
 	if (ring->jrx_desc_tag != NULL) {
@@ -1626,7 +1624,6 @@ nfe_free_tx_ring(struct nfe_softc *sc, s
 		bus_dmamem_free(ring->tx_desc_tag, desc, ring->tx_desc_map);
 		ring->desc64 = NULL;
 		ring->desc32 = NULL;
-		ring->tx_desc_map = NULL;
 		bus_dma_tag_destroy(ring->tx_desc_tag);
 		ring->tx_desc_tag = NULL;
 	}

Modified: head/sys/dev/nxge/xge-osdep.h
==============================================================================
--- head/sys/dev/nxge/xge-osdep.h	Tue Jun 17 18:03:59 2014	(r267588)
+++ head/sys/dev/nxge/xge-osdep.h	Tue Jun 17 18:10:06 2014	(r267589)
@@ -406,7 +406,6 @@ xge_os_dma_free(pci_dev_h pdev, const vo
 	XGE_OS_MEMORY_CHECK_FREE(p_dmah->dma_viraddr, size);
 	bus_dmamem_free(p_dmah->dma_tag, p_dmah->dma_viraddr, p_dmah->dma_map);
 	bus_dma_tag_destroy(p_dmah->dma_tag);
-	p_dmah->dma_map = NULL;
 	p_dmah->dma_tag = NULL;
 	p_dmah->dma_viraddr = NULL;
 	return;

Modified: head/sys/dev/vxge/vxge-osdep.h
==============================================================================
--- head/sys/dev/vxge/vxge-osdep.h	Tue Jun 17 18:03:59 2014	(r267588)
+++ head/sys/dev/vxge/vxge-osdep.h	Tue Jun 17 18:10:06 2014	(r267589)
@@ -615,7 +615,6 @@ vxge_dma_free(pci_dev_h pdev, const void
 	bus_dmamem_free(p_dmah->dma_tag, p_dmah->dma_vaddr, p_dmah->dma_map);
 	bus_dma_tag_destroy(p_dmah->dma_tag);
 
-	p_dmah->dma_map = NULL;
 	p_dmah->dma_tag = NULL;
 	p_dmah->dma_vaddr = NULL;
 }

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 18:32:35 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 51AE610E;
 Tue, 17 Jun 2014 18:32:35 +0000 (UTC)
Received: from gromit.grondar.org (grandfather.grondar.org
 [IPv6:2a01:348:0:15:5d59:5c20:0:2])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0FF0E2D80;
 Tue, 17 Jun 2014 18:32:35 +0000 (UTC)
Received: from [2001:470:9174:1:6420:552d:97a0:2395]
 by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128)
 (Exim 4.80.1 (FreeBSD)) (envelope-from )
 id 1WwyBD-000L7H-KI; Tue, 17 Jun 2014 19:32:32 +0100
Subject: Re: svn commit: r266083 - in head/sys/arm: arm include
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Content-Type: text/plain; charset=windows-1252
From: Mark R V Murray 
In-Reply-To: <1F3FE585-4C04-499E-86CE-BA4DC3F05D97@freebsd.org>
Date: Tue, 17 Jun 2014 19:33:36 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <7124948D-6F58-4E01-AA61-E381AC223F39@FreeBSD.org>
References: <201405141911.s4EJBFZZ097826@svn.freebsd.org>
 <537D0952.2040001@selasky.org>
 <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org>
 <53871493.2010502@selasky.org>
 
 <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de>
 
 
 
 <9B438991-C970-46A7-8116-A490E02D7139@fh-muenster.de>
 <3841D090-5973-40B0-B61C-F15E8C1978C9@FreeBSD.org>
 <3664DBD3-7CEA-43E8-9757-E835BB21FE9E@freebsd.org>
 <5F36DFA5-C5B1-4E5D-88EE-9D60240B40FD@FreeBSD.org>
 <494BE7DA-26BC-43A7-8BC0-ECAE8A75E1EF@freebsd.org>
 <6268E444-F6C7-4B8B-86B7-244A2BB3C4DE@FreeBSD.org>
 <44F7EEB4-46D1-49C7-A4CA-4EA5D41BDF31@freebsd.org>
 
 <1F3FE585-4C04-499E-86CE-BA4DC3F05D97@freebsd.org>
To: Michael Tuexen 
X-Mailer: Apple Mail (2.1878.2)
X-SA-Score: -1.0
Cc: Hans Petter Selasky , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 18:32:35 -0000

Hi Michael,

If that works, then Brilliant! :-) :-)

Could you please fix this so the _PMC_USER_READ_WRITE_ is all in one =
place (it=92s too dangerous to split up), and put an =
architecture-specific #ifdef around just the MCR instruction we care =
about.

With that, its good to commit, I=92d say. I=92ll likely follow up and =
exclude the architectures that are unproven.

M

On 17 Jun 2014, at 10:52, Michael Tuexen  wrote:

> On 16 Jun 2014, at 22:13, Mark R V Murray  wrote:
> Hi Mark,
>=20
> I just adopted the comments to the code change. So here is the =
improved patch:
>=20
> Index: cpufunc.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- cpufunc.c	(revision 267575)
> +++ cpufunc.c	(working copy)
> @@ -1404,18 +1404,36 @@
> static __inline void
> cpu_scc_setup_ccnt(void)
> {
> -/* This is how you give userland access to the CCNT and PMCn
> - * registers.
> - * BEWARE! This gives write access also, which may not be what
> - * you want!
> - */
> +#if defined(CPU_ARM1136) || defined(CPU_ARM1176)
> #ifdef _PMC_USER_READ_WRITE_
> -	/* Set PMUSERENR[0] to allow userland access */
> +	/* This is how you give userland access to the CCNT and PMCn
> +	 * registers.
> +	 * BEWARE! This gives write access also, which may not be what
> +	 * you want!
> +	 * Use the Secure User and Non-secure Access Validation Control =
Register
> +	 * to allow userland access=20
> +	 */
> +	__asm volatile ("mcr	p15, 0, %0, c15, c9, 0\n\t"
> +			:
> +			: "r"(0x00000001));
> +#endif
> +	/* Set PMCR[2,0] to enable counters and reset CCNT */
> +	__asm volatile ("mcr	p15, 0, %0, c15, c12, 0\n\t"
> +			:
> +			: "r"(0x00000005));
> +#else
> +#ifdef _PMC_USER_READ_WRITE_
> +	/* This is how you give userland access to the CCNT and PMCn
> +	 * registers.
> +	 * BEWARE! This gives write access also, which may not be what
> +	 * you want!
> +	 * Set PMUSERENR[0] to allow userland access
> +	 */
> 	__asm volatile ("mcr	p15, 0, %0, c9, c14, 0\n\t"
> 			:
> 			: "r"(0x00000001));
> #endif
> -        /* Set up the PMCCNTR register as a cyclecounter:
> +	/* Set up the PMCCNTR register as a cyclecounter:
> 	 * Set PMINTENCLR to 0xFFFFFFFF to block interrupts
> 	 * Set PMCR[2,0] to enable counters and reset CCNT
> 	 * Set PMCNTENSET to 0x80000000 to enable CCNT */
> @@ -1426,6 +1444,7 @@
> 			: "r"(0xFFFFFFFF),
> 			  "r"(0x00000005),
> 			  "r"(0x80000000));
> +#endif
> }
> #endif
>=20
> Let me know if I can help.
>=20
> Best regards
> Michael
>>=20
>> On 16 Jun 2014, at 20:38, Michael Tuexen  wrote:
>>> Hmm, the documentation reads
>>=20
>> Which docs are you using?
>>=20
>> I=92m using DDI0360F. (And that could easily be a wrong choice).
>>=20
>> M
>> --=20
>> Mark R V Murray
>>=20
>>=20
>=20

--=20
Mark R V Murray


From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 18:51:04 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 13B8C883;
 Tue, 17 Jun 2014 18:51:04 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 00E0F2167;
 Tue, 17 Jun 2014 18:51:04 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5HIp3cj035237;
 Tue, 17 Jun 2014 18:51:03 GMT (envelope-from grehan@svn.freebsd.org)
Received: (from grehan@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5HIp3R5035235;
 Tue, 17 Jun 2014 18:51:03 GMT (envelope-from grehan@svn.freebsd.org)
Message-Id: <201406171851.s5HIp3R5035235@svn.freebsd.org>
From: Peter Grehan 
Date: Tue, 17 Jun 2014 18:51:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267591 - in head/etc: etc.amd64 etc.i386
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 18:51:04 -0000

Author: grehan
Date: Tue Jun 17 18:51:03 2014
New Revision: 267591
URL: http://svnweb.freebsd.org/changeset/base/267591

Log:
  Convert the potential console port over to using 3wire, for i386/amd64.
  
  (This change was already in place for other arches via r262957)
  
  Reviewed by:	nwhitehorn
  MFC after:	1 week

Modified:
  head/etc/etc.amd64/ttys
  head/etc/etc.i386/ttys

Modified: head/etc/etc.amd64/ttys
==============================================================================
--- head/etc/etc.amd64/ttys	Tue Jun 17 18:12:58 2014	(r267590)
+++ head/etc/etc.amd64/ttys	Tue Jun 17 18:51:03 2014	(r267591)
@@ -41,7 +41,7 @@ ttyv7	"/usr/libexec/getty Pc"		xterm	on 
 ttyv8	"/usr/local/bin/xdm -nodaemon"	xterm	off secure
 # Serial terminals
 # The 'dialup' keyword identifies dialin lines to login, fingerd etc.
-ttyu0	"/usr/libexec/getty std.9600"	vt100	onifconsole secure
+ttyu0	"/usr/libexec/getty 3wire"	vt100	onifconsole secure
 ttyu1	"/usr/libexec/getty std.9600"	dialup	off secure
 ttyu2	"/usr/libexec/getty std.9600"	dialup	off secure
 ttyu3	"/usr/libexec/getty std.9600"	dialup	off secure

Modified: head/etc/etc.i386/ttys
==============================================================================
--- head/etc/etc.i386/ttys	Tue Jun 17 18:12:58 2014	(r267590)
+++ head/etc/etc.i386/ttys	Tue Jun 17 18:51:03 2014	(r267591)
@@ -41,7 +41,7 @@ ttyv7	"/usr/libexec/getty Pc"		xterm	on 
 ttyv8	"/usr/local/bin/xdm -nodaemon"	xterm	off secure
 # Serial terminals
 # The 'dialup' keyword identifies dialin lines to login, fingerd etc.
-ttyu0	"/usr/libexec/getty std.9600"	vt100	onifconsole secure
+ttyu0	"/usr/libexec/getty 3wire"	vt100	onifconsole secure
 ttyu1	"/usr/libexec/getty std.9600"	dialup	off secure
 ttyu2	"/usr/libexec/getty std.9600"	dialup	off secure
 ttyu3	"/usr/libexec/getty std.9600"	dialup	off secure

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 18:58:33 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id CE41DA44;
 Tue, 17 Jun 2014 18:58:33 +0000 (UTC)
Received: from mail-n.franken.de (drew.ipv6.franken.de
 [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 5A12C21B8;
 Tue, 17 Jun 2014 18:58:33 +0000 (UTC)
Received: from [192.168.1.200] (p508F2AAE.dip0.t-ipconnect.de [80.143.42.174])
 (Authenticated sender: macmic)
 by mail-n.franken.de (Postfix) with ESMTP id C21021C104DB9;
 Tue, 17 Jun 2014 20:58:28 +0200 (CEST)
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r266083 - in head/sys/arm: arm include
From: Michael Tuexen 
In-Reply-To: <7124948D-6F58-4E01-AA61-E381AC223F39@FreeBSD.org>
Date: Tue, 17 Jun 2014 20:58:27 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201405141911.s4EJBFZZ097826@svn.freebsd.org>
 <537D0952.2040001@selasky.org>
 <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org>
 <53871493.2010502@selasky.org>
 
 <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de>
 
 
 
 <9B438991-C970-46A7-8116-A490E02D7139@fh-muenster.de>
 <3841D090-5973-40B0-B61C-F15E8C1978C9@FreeBSD.org>
 <3664DBD3-7CEA-43E8-9757-E835BB21FE9E@freebsd.org>
 <5F36DFA5-C5B1-4E5D-88EE-9D60240B40FD@FreeBSD.org>
 <494BE7DA-26BC-43A7-8BC0-ECAE8A75E1EF@freebsd.org>
 <6268E444-F6C7-4B8B-86B7-244A2BB3C4DE@FreeBSD.org>
 <44F7EEB4-46D1-49C7-A4CA-4EA5D41BDF31@freebsd.org>
 
 <1F3FE585-4C04-499E-86CE-BA4DC3F05D97@freebsd.org>
 <7124948D-6F58-4E01-AA61-E381AC223F39@FreeBSD.org>
To: Mark R V Murray 
X-Mailer: Apple Mail (2.1878.2)
Cc: Hans Petter Selasky , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 18:58:33 -0000

On 17 Jun 2014, at 20:33, Mark R V Murray  wrote:

> Hi Michael,
>=20
> If that works, then Brilliant! :-) :-)
>=20
> Could you please fix this so the _PMC_USER_READ_WRITE_ is all in one =
place (it=92s too dangerous to split up), and put an =
architecture-specific #ifdef around just the MCR instruction we care =
about.
So you want something like:

Index: cpufunc.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- cpufunc.c	(revision 267575)
+++ cpufunc.c	(working copy)
@@ -1410,12 +1410,27 @@
  * you want!
  */
 #ifdef _PMC_USER_READ_WRITE_
+#if defined(CPU_ARM1136) || defined(CPU_ARM1176)
+	/* Use the Secure User and Non-secure Access Validation Control =
Register
+	 * to allow userland access
+	 */
+	__asm volatile ("mcr	p15, 0, %0, c15, c9, 0\n\t"
+			:
+			: "r"(0x00000001));
+#else
 	/* Set PMUSERENR[0] to allow userland access */
 	__asm volatile ("mcr	p15, 0, %0, c9, c14, 0\n\t"
 			:
 			: "r"(0x00000001));
 #endif
-        /* Set up the PMCCNTR register as a cyclecounter:
+#endif
+#if defined(CPU_ARM1136) || defined(CPU_ARM1176)
+	/* Set PMCR[2,0] to enable counters and reset CCNT */
+	__asm volatile ("mcr	p15, 0, %0, c15, c12, 0\n\t"
+			:
+			: "r"(0x00000005));
+#else
+	/* Set up the PMCCNTR register as a cyclecounter:
 	 * Set PMINTENCLR to 0xFFFFFFFF to block interrupts
 	 * Set PMCR[2,0] to enable counters and reset CCNT
 	 * Set PMCNTENSET to 0x80000000 to enable CCNT */
@@ -1426,6 +1441,7 @@
 			: "r"(0xFFFFFFFF),
 			  "r"(0x00000005),
 			  "r"(0x80000000));
+#endif
 }
 #endif



>=20
> With that, its good to commit, I=92d say. I=92ll likely follow up and =
exclude the architectures that are unproven.
You can commit this and your patch to include/cpu.h. I think it would be =
good to
have both fixes in one commit...

Best regards
Michael
>=20
> M
>=20
> On 17 Jun 2014, at 10:52, Michael Tuexen  wrote:
>=20
>> On 16 Jun 2014, at 22:13, Mark R V Murray  wrote:
>> Hi Mark,
>>=20
>> I just adopted the comments to the code change. So here is the =
improved patch:
>>=20
>> Index: cpufunc.c
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> --- cpufunc.c	(revision 267575)
>> +++ cpufunc.c	(working copy)
>> @@ -1404,18 +1404,36 @@
>> static __inline void
>> cpu_scc_setup_ccnt(void)
>> {
>> -/* This is how you give userland access to the CCNT and PMCn
>> - * registers.
>> - * BEWARE! This gives write access also, which may not be what
>> - * you want!
>> - */
>> +#if defined(CPU_ARM1136) || defined(CPU_ARM1176)
>> #ifdef _PMC_USER_READ_WRITE_
>> -	/* Set PMUSERENR[0] to allow userland access */
>> +	/* This is how you give userland access to the CCNT and PMCn
>> +	 * registers.
>> +	 * BEWARE! This gives write access also, which may not be what
>> +	 * you want!
>> +	 * Use the Secure User and Non-secure Access Validation Control =
Register
>> +	 * to allow userland access=20
>> +	 */
>> +	__asm volatile ("mcr	p15, 0, %0, c15, c9, 0\n\t"
>> +			:
>> +			: "r"(0x00000001));
>> +#endif
>> +	/* Set PMCR[2,0] to enable counters and reset CCNT */
>> +	__asm volatile ("mcr	p15, 0, %0, c15, c12, 0\n\t"
>> +			:
>> +			: "r"(0x00000005));
>> +#else
>> +#ifdef _PMC_USER_READ_WRITE_
>> +	/* This is how you give userland access to the CCNT and PMCn
>> +	 * registers.
>> +	 * BEWARE! This gives write access also, which may not be what
>> +	 * you want!
>> +	 * Set PMUSERENR[0] to allow userland access
>> +	 */
>> 	__asm volatile ("mcr	p15, 0, %0, c9, c14, 0\n\t"
>> 			:
>> 			: "r"(0x00000001));
>> #endif
>> -        /* Set up the PMCCNTR register as a cyclecounter:
>> +	/* Set up the PMCCNTR register as a cyclecounter:
>> 	 * Set PMINTENCLR to 0xFFFFFFFF to block interrupts
>> 	 * Set PMCR[2,0] to enable counters and reset CCNT
>> 	 * Set PMCNTENSET to 0x80000000 to enable CCNT */
>> @@ -1426,6 +1444,7 @@
>> 			: "r"(0xFFFFFFFF),
>> 			  "r"(0x00000005),
>> 			  "r"(0x80000000));
>> +#endif
>> }
>> #endif
>>=20
>> Let me know if I can help.
>>=20
>> Best regards
>> Michael
>>>=20
>>> On 16 Jun 2014, at 20:38, Michael Tuexen  wrote:
>>>> Hmm, the documentation reads
>>>=20
>>> Which docs are you using?
>>>=20
>>> I=92m using DDI0360F. (And that could easily be a wrong choice).
>>>=20
>>> M
>>> --=20
>>> Mark R V Murray
>>>=20
>>>=20
>>=20
>=20
> --=20
> Mark R V Murray
>=20
>=20


From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 19:04:26 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7EB7FBD2;
 Tue, 17 Jun 2014 19:04:26 +0000 (UTC)
Received: from gromit.grondar.org (grandfather.grondar.org
 [IPv6:2a01:348:0:15:5d59:5c20:0:2])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3C0E32254;
 Tue, 17 Jun 2014 19:04:26 +0000 (UTC)
Received: from [2001:470:9174:1:6420:552d:97a0:2395]
 by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128)
 (Exim 4.80.1 (FreeBSD)) (envelope-from )
 id 1Wwyg3-000L9Q-ET; Tue, 17 Jun 2014 20:04:24 +0100
Subject: Re: svn commit: r266083 - in head/sys/arm: arm include
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Content-Type: text/plain; charset=windows-1252
From: Mark R V Murray 
In-Reply-To: 
Date: Tue, 17 Jun 2014 20:05:28 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <040770E7-F5AB-4C59-B26C-7074C342DD85@FreeBSD.org>
References: <201405141911.s4EJBFZZ097826@svn.freebsd.org>
 <537D0952.2040001@selasky.org>
 <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org>
 <53871493.2010502@selasky.org>
 
 <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de>
 
 
 
 <9B438991-C970-46A7-8116-A490E02D7139@fh-muenster.de>
 <3841D090-5973-40B0-B61C-F15E8C1978C9@FreeBSD.org>
 <3664DBD3-7CEA-43E8-9757-E835BB21FE9E@freebsd.org>
 <5F36DFA5-C5B1-4E5D-88EE-9D60240B40FD@FreeBSD.org>
 <494BE7DA-26BC-43A7-8BC0-ECAE8A75E1EF@freebsd.org>
 <6268E444-F6C7-4B8B-86B7-244A2BB3C4DE@FreeBSD.org>
 <44F7EEB4-46D1-49C7-A4CA-4EA5D41BDF31@freebsd.org>
 
 <1F3FE585-4C04-499E-86CE-BA4DC3F05D97@freebsd.org>
 <7124948D-6F58-4E01-AA61-E381AC223F39@FreeBSD.org>
 
To: Michael Tuexen 
X-Mailer: Apple Mail (2.1878.2)
X-SA-Score: -1.0
Cc: Hans Petter Selasky , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 19:04:26 -0000


On 17 Jun 2014, at 19:58, Michael Tuexen  wrote:
> So you want something like:

Yup! Looks good! :-)

If you want to blame me for reviewing this, thats fine, but I=92ve not =
run it (I=92m waiting for a replacement RPI, still).

Please don=92t be offended if a follow-up commit of mine rearranges this =
slightly! (It won=92t be for a week or two).

M
--=20
Mark R V Murray


From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 19:44:06 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id CF8FDCD2;
 Tue, 17 Jun 2014 19:44:06 +0000 (UTC)
Received: from mail-n.franken.de (drew.ipv6.franken.de
 [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 8522325C1;
 Tue, 17 Jun 2014 19:44:06 +0000 (UTC)
Received: from [192.168.1.200] (p508F2AAE.dip0.t-ipconnect.de [80.143.42.174])
 (Authenticated sender: macmic)
 by mail-n.franken.de (Postfix) with ESMTP id 8321C1C1047F2;
 Tue, 17 Jun 2014 21:44:03 +0200 (CEST)
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r266083 - in head/sys/arm: arm include
From: Michael Tuexen 
In-Reply-To: <040770E7-F5AB-4C59-B26C-7074C342DD85@FreeBSD.org>
Date: Tue, 17 Jun 2014 21:44:02 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <50ECF7B4-64E9-470C-BDAE-44A80C5281CA@freebsd.org>
References: <201405141911.s4EJBFZZ097826@svn.freebsd.org>
 <537D0952.2040001@selasky.org>
 <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org>
 <53871493.2010502@selasky.org>
 
 <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de>
 
 
 
 <9B438991-C970-46A7-8116-A490E02D7139@fh-muenster.de>
 <3841D090-5973-40B0-B61C-F15E8C1978C9@FreeBSD.org>
 <3664DBD3-7CEA-43E8-9757-E835BB21FE9E@freebsd.org>
 <5F36DFA5-C5B1-4E5D-88EE-9D60240B40FD@FreeBSD.org>
 <494BE7DA-26BC-43A7-8BC0-ECAE8A75E1EF@freebsd.org>
 <6268E444-F6C7-4B8B-86B7-244A2BB3C4DE@FreeBSD.org>
 <44F7EEB4-46D1-49C7-A4CA-4EA5D41BDF31@freebsd.org>
 
 <1F3FE585-4C04-499E-86CE-BA4DC3F05D97@freebsd.org>
 <7124948D-6F58-4E01-AA61-E381AC223F39@FreeBSD.org>
  <
 040770E7-F5AB-4C59-B26C-7074C342DD85@FreeBSD.org>
To: Mark R V Murray 
X-Mailer: Apple Mail (2.1878.2)
Cc: Hans Petter Selasky , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 19:44:06 -0000

On 17 Jun 2014, at 21:05, Mark R V Murray  wrote:

>=20
> On 17 Jun 2014, at 19:58, Michael Tuexen  wrote:
>> So you want something like:
>=20
> Yup! Looks good! :-)
>=20
> If you want to blame me for reviewing this, thats fine, but I=92ve not =
run it (I=92m waiting for a replacement RPI, still).
OK, I'll commit it. How do you want to deal with your change in cpu.h? =
Will you commit
it?
>=20
> Please don=92t be offended if a follow-up commit of mine rearranges =
this slightly! (It won=92t be for a week or two).
Not at all...

Best regards
Michael
>=20
> M
> --=20
> Mark R V Murray
>=20
>=20


From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 21:08:50 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6ADF6101;
 Tue, 17 Jun 2014 21:08:50 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 586FC2D3C;
 Tue, 17 Jun 2014 21:08:50 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5HL8ol4002149;
 Tue, 17 Jun 2014 21:08:50 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5HL8ojY002148;
 Tue, 17 Jun 2014 21:08:50 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201406172108.s5HL8ojY002148@svn.freebsd.org>
From: Glen Barber 
Date: Tue, 17 Jun 2014 21:08:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267595 - head/release/doc/share/xml
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 21:08:50 -0000

Author: gjb
Date: Tue Jun 17 21:08:49 2014
New Revision: 267595
URL: http://svnweb.freebsd.org/changeset/base/267595

Log:
  Drop 'Inc.' for consistency.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/release/doc/share/xml/sponsor.ent

Modified: head/release/doc/share/xml/sponsor.ent
==============================================================================
--- head/release/doc/share/xml/sponsor.ent	Tue Jun 17 21:07:34 2014	(r267594)
+++ head/release/doc/share/xml/sponsor.ent	Tue Jun 17 21:08:49 2014	(r267595)
@@ -19,7 +19,7 @@
 
 
 
-
+
 
 
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 21:48:05 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B287A18E;
 Tue, 17 Jun 2014 21:48:05 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 857FF20E4;
 Tue, 17 Jun 2014 21:48:05 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5HLm5Pl020699;
 Tue, 17 Jun 2014 21:48:05 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5HLm5mZ020696;
 Tue, 17 Jun 2014 21:48:05 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201406172148.s5HLm5mZ020696@svn.freebsd.org>
From: Michael Tuexen 
Date: Tue, 17 Jun 2014 21:48:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267597 - in head/sys/arm: arm include
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 21:48:05 -0000

Author: tuexen
Date: Tue Jun 17 21:48:04 2014
New Revision: 267597
URL: http://svnweb.freebsd.org/changeset/base/267597

Log:
  Different versions of the ARM processor use different registers.
  Fix the code used on a Raspberry Pi.
  
  Reviewed by: markm@

Modified:
  head/sys/arm/arm/cpufunc.c
  head/sys/arm/include/cpu.h

Modified: head/sys/arm/arm/cpufunc.c
==============================================================================
--- head/sys/arm/arm/cpufunc.c	Tue Jun 17 21:09:03 2014	(r267596)
+++ head/sys/arm/arm/cpufunc.c	Tue Jun 17 21:48:04 2014	(r267597)
@@ -1410,12 +1410,27 @@ cpu_scc_setup_ccnt(void)
  * you want!
  */
 #ifdef _PMC_USER_READ_WRITE_
+#if defined(CPU_ARM1136) || defined(CPU_ARM1176)
+	/* Use the Secure User and Non-secure Access Validation Control Register
+	 * to allow userland access
+	 */
+	__asm volatile ("mcr	p15, 0, %0, c15, c9, 0\n\t"
+			:
+			: "r"(0x00000001));
+#else
 	/* Set PMUSERENR[0] to allow userland access */
 	__asm volatile ("mcr	p15, 0, %0, c9, c14, 0\n\t"
 			:
 			: "r"(0x00000001));
 #endif
-        /* Set up the PMCCNTR register as a cyclecounter:
+#endif
+#if defined(CPU_ARM1136) || defined(CPU_ARM1176)
+	/* Set PMCR[2,0] to enable counters and reset CCNT */
+	__asm volatile ("mcr	p15, 0, %0, c15, c12, 0\n\t"
+			:
+			: "r"(0x00000005));
+#else
+	/* Set up the PMCCNTR register as a cyclecounter:
 	 * Set PMINTENCLR to 0xFFFFFFFF to block interrupts
 	 * Set PMCR[2,0] to enable counters and reset CCNT
 	 * Set PMCNTENSET to 0x80000000 to enable CCNT */
@@ -1426,6 +1441,7 @@ cpu_scc_setup_ccnt(void)
 			: "r"(0xFFFFFFFF),
 			  "r"(0x00000005),
 			  "r"(0x80000000));
+#endif
 }
 #endif
 

Modified: head/sys/arm/include/cpu.h
==============================================================================
--- head/sys/arm/include/cpu.h	Tue Jun 17 21:09:03 2014	(r267596)
+++ head/sys/arm/include/cpu.h	Tue Jun 17 21:48:04 2014	(r267597)
@@ -25,7 +25,16 @@ get_cyclecount(void)
 	 * Read PMCCNTR. Curses! Its only 32 bits.
 	 * TODO: Fix this by catching overflow with interrupt?
 	 */
+/* The ARMv6 vs ARMv7 divide is going to need a better way of
+ * distinguishing between them.
+ */
+#if defined(CPU_ARM1136) || defined(CPU_ARM1176)
+	/* ARMv6 - Earlier model SCCs */
+	__asm __volatile("mrc p15, 0, %0, c15, c12, 1": "=r" (ccnt));
+#else
+	/* ARMv7 - Later model SCCs */
 	__asm __volatile("mrc p15, 0, %0, c9, c13, 0": "=r" (ccnt));
+#endif
 	ccnt64 = (uint64_t)ccnt;
 	return (ccnt64);
 #else /* No performance counters, so use binuptime(9). This is slooooow */

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 17 22:23:37 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 14E076C5;
 Tue, 17 Jun 2014 22:23:37 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DD54B2547;
 Tue, 17 Jun 2014 22:23:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5HMNarb039096;
 Tue, 17 Jun 2014 22:23:36 GMT
 (envelope-from bdrewery@svn.freebsd.org)
Received: (from bdrewery@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5HMNao4039094;
 Tue, 17 Jun 2014 22:23:36 GMT
 (envelope-from bdrewery@svn.freebsd.org)
Message-Id: <201406172223.s5HMNao4039094@svn.freebsd.org>
From: Bryan Drewery 
Date: Tue, 17 Jun 2014 22:23:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267599 - in head: . share/man/man7
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 17 Jun 2014 22:23:37 -0000

Author: bdrewery
Date: Tue Jun 17 22:23:36 2014
New Revision: 267599
URL: http://svnweb.freebsd.org/changeset/base/267599

Log:
  - Add a LOCAL_ITOOLS to allow adding additional tools required for the
    installworld and distributeworld targets
  
  PR:		179562
  Submitted by:	Garrett Cooper 
  MFC after:	1 week

Modified:
  head/Makefile.inc1
  head/share/man/man7/build.7

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Tue Jun 17 21:49:03 2014	(r267598)
+++ head/Makefile.inc1	Tue Jun 17 22:23:36 2014	(r267599)
@@ -17,6 +17,7 @@
 #	-DNO_DOCUPDATE do not update doc in ${MAKE} update
 #	-DWITHOUT_CTF do not run the DTrace CTF conversion tools on built objects
 #	LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
+#	LOCAL_ITOOLS="list of tools" to add additional tools to the ITOOLS list
 #	LOCAL_LIB_DIRS="list of dirs" to add additional dirs to libraries target
 #	LOCAL_MTREE="list of mtree files" to process to allow local directories
 #	    to be created before files are installed
@@ -756,7 +757,8 @@ _zoneinfo=	zic tzsetup
 ITOOLS=	[ awk cap_mkdb cat chflags chmod chown \
 	date echo egrep find grep id install ${_install-info} \
 	ln lockf make mkdir mtree mv pwd_mkdb \
-	rm sed services_mkdb sh sysctl test true uname wc ${_zoneinfo}
+	rm sed services_mkdb sh sysctl test true uname wc ${_zoneinfo} \
+	${LOCAL_ITOOLS}
 
 #
 # distributeworld

Modified: head/share/man/man7/build.7
==============================================================================
--- head/share/man/man7/build.7	Tue Jun 17 21:49:03 2014	(r267598)
+++ head/share/man/man7/build.7	Tue Jun 17 22:23:36 2014	(r267599)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 27, 2014
+.Dd June 17, 2014
 .Dt BUILD 7
 .Os
 .Sh NAME
@@ -415,6 +415,12 @@ If set, this variable supplies a list of
 the root of the source tree to build as part of the
 .Cm everything
 target.
+.It Va LOCAL_ITOOLS
+If set, this variable supplies a list of additional tools that are used by the
+.Cm installworld
+and
+.Cm distributeworld
+targets.
 .It Va LOCAL_LIB_DIRS
 If set, this variable supplies a list of additional directories relative to
 the root of the source tree to build as part of the

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 00:16:36 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id EFD2E183;
 Wed, 18 Jun 2014 00:16:35 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DCAEB2EBC;
 Wed, 18 Jun 2014 00:16:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5I0GZxZ090426;
 Wed, 18 Jun 2014 00:16:35 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5I0GZsv090424;
 Wed, 18 Jun 2014 00:16:35 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201406180016.s5I0GZsv090424@svn.freebsd.org>
From: Navdeep Parhar 
Date: Wed, 18 Jun 2014 00:16:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267600 - head/sys/dev/cxgbe
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 00:16:36 -0000

Author: np
Date: Wed Jun 18 00:16:35 2014
New Revision: 267600
URL: http://svnweb.freebsd.org/changeset/base/267600

Log:
  cxgbe(4):  Fix bug in the fast rx buffer recycle path.  In some cases rx
  buffers were getting recycled when they should have been left alone.
  
  MFC after:	3 days

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/adapter.h
==============================================================================
--- head/sys/dev/cxgbe/adapter.h	Tue Jun 17 22:23:36 2014	(r267599)
+++ head/sys/dev/cxgbe/adapter.h	Wed Jun 18 00:16:35 2014	(r267600)
@@ -290,7 +290,8 @@ struct cluster_metadata {
 
 struct fl_sdesc {
 	caddr_t cl;
-	uint8_t nmbuf;
+	uint8_t nimbuf;		/* # of inline mbufs with ref on the cluster */
+	uint8_t nembuf;		/* # of allocated mbufs with ref */
 	struct cluster_layout cll;
 };
 

Modified: head/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- head/sys/dev/cxgbe/t4_sge.c	Tue Jun 17 22:23:36 2014	(r267599)
+++ head/sys/dev/cxgbe/t4_sge.c	Wed Jun 18 00:16:35 2014	(r267600)
@@ -1561,22 +1561,22 @@ get_scatter_segment(struct adapter *sc, 
 		/* copy data to mbuf */
 		bcopy(payload, mtod(m, caddr_t), len);
 
-	} else if (sd->nmbuf * MSIZE < cll->region1) {
+	} else if (sd->nimbuf * MSIZE < cll->region1) {
 
 		/*
 		 * There's spare room in the cluster for an mbuf.  Create one
-		 * and associate it with the payload that's in the cluster too.
+		 * and associate it with the payload that's in the cluster.
 		 */
 
 		MPASS(clm != NULL);
-		m = (struct mbuf *)(sd->cl + sd->nmbuf * MSIZE);
+		m = (struct mbuf *)(sd->cl + sd->nimbuf * MSIZE);
 		/* No bzero required */
 		if (m_init(m, NULL, 0, M_NOWAIT, MT_DATA, flags | M_NOFREE))
 			return (NULL);
 		fl->mbuf_inlined++;
 		m_extaddref(m, payload, padded_len, &clm->refcount, rxb_free,
 		    swz->zone, sd->cl);
-		sd->nmbuf++;
+		sd->nimbuf++;
 
 	} else {
 
@@ -1590,10 +1590,11 @@ get_scatter_segment(struct adapter *sc, 
 		if (m == NULL)
 			return (NULL);
 		fl->mbuf_allocated++;
-		if (clm != NULL)
+		if (clm != NULL) {
 			m_extaddref(m, payload, padded_len, &clm->refcount,
 			    rxb_free, swz->zone, sd->cl);
-		else {
+			sd->nembuf++;
+		} else {
 			m_cljset(m, sd->cl, swz->type);
 			sd->cl = NULL;	/* consumed, not a recycle candidate */
 		}
@@ -3253,7 +3254,7 @@ refill_fl(struct adapter *sc, struct sge
 
 		if (sd->cl != NULL) {
 
-			if (sd->nmbuf == 0) {
+			if (sd->nimbuf + sd->nembuf == 0) {
 				/*
 				 * Fast recycle without involving any atomics on
 				 * the cluster's metadata (if the cluster has
@@ -3262,6 +3263,11 @@ refill_fl(struct adapter *sc, struct sge
 				 * fit within a single mbuf each.
 				 */
 				fl->cl_fast_recycled++;
+#ifdef INVARIANTS
+				clm = cl_metadata(sc, fl, &sd->cll, sd->cl);
+				if (clm != NULL)
+					MPASS(clm->refcount == 1);
+#endif
 				goto recycled_fast;
 			}
 
@@ -3307,7 +3313,8 @@ recycled:
 #endif
 			clm->refcount = 1;
 		}
-		sd->nmbuf = 0;
+		sd->nimbuf = 0;
+		sd->nembuf = 0;
 recycled_fast:
 		fl->pending++;
 		fl->needed--;
@@ -3376,7 +3383,7 @@ free_fl_sdesc(struct adapter *sc, struct
 
 		cll = &sd->cll;
 		clm = cl_metadata(sc, fl, cll, sd->cl);
-		if (sd->nmbuf == 0 ||
+		if (sd->nimbuf + sd->nembuf == 0 ||
 		    (clm && atomic_fetchadd_int(&clm->refcount, -1) == 1)) {
 			uma_zfree(sc->sge.sw_zone_info[cll->zidx].zone, sd->cl);
 		}

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 02:36:22 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6254D47D;
 Wed, 18 Jun 2014 02:36:22 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4E25A28C6;
 Wed, 18 Jun 2014 02:36:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5I2aMck054569;
 Wed, 18 Jun 2014 02:36:22 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5I2aLaU054560;
 Wed, 18 Jun 2014 02:36:21 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201406180236.s5I2aLaU054560@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Wed, 18 Jun 2014 02:36:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267601 - head/lib/libc/stdtime
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 02:36:22 -0000

Author: pfg
Date: Wed Jun 18 02:36:21 2014
New Revision: 267601
URL: http://svnweb.freebsd.org/changeset/base/267601

Log:
  stdtime: style(9) fixes.
  
  Obtained from:	illumos
  MFC after:	5 days

Modified:
  head/lib/libc/stdtime/strftime.c
  head/lib/libc/stdtime/strptime.c
  head/lib/libc/stdtime/timelocal.c

Modified: head/lib/libc/stdtime/strftime.c
==============================================================================
--- head/lib/libc/stdtime/strftime.c	Wed Jun 18 00:16:35 2014	(r267600)
+++ head/lib/libc/stdtime/strftime.c	Wed Jun 18 02:36:21 2014	(r267601)
@@ -24,9 +24,9 @@
 #ifndef NOID
 static const char	elsieid[] = "@(#)strftime.3	8.3";
 /*
-** Based on the UCB version with the ID appearing below.
-** This is ANSIish only when "multibyte character == plain character".
-*/
+ * Based on the UCB version with the ID appearing below.
+ * This is ANSIish only when "multibyte character == plain character".
+ */
 #endif /* !defined NOID */
 #endif /* !defined lint */
 
@@ -57,32 +57,32 @@ extern char *	tzname[];
 #define YEAR_2000_NAME	"CHECK_STRFTIME_FORMATS_FOR_TWO_DIGIT_YEARS"
 #endif /* !defined YEAR_2000_NAME */
 
-#define IN_NONE	0
-#define IN_SOME	1
-#define IN_THIS	2
-#define IN_ALL	3
-
-#define PAD_DEFAULT	0
-#define PAD_LESS	1
-#define PAD_SPACE	2
-#define PAD_ZERO	3
+#define	IN_NONE	0
+#define	IN_SOME	1
+#define	IN_THIS	2
+#define	IN_ALL	3
+
+#define	PAD_DEFAULT	0
+#define	PAD_LESS	1
+#define	PAD_SPACE	2
+#define	PAD_ZERO	3
 
 static const char fmt_padding[][4][5] = {
 	/* DEFAULT,	LESS,	SPACE,	ZERO */
-#define PAD_FMT_MONTHDAY	0
-#define PAD_FMT_HMS		0
-#define PAD_FMT_CENTURY		0
-#define PAD_FMT_SHORTYEAR	0
-#define PAD_FMT_MONTH		0
-#define PAD_FMT_WEEKOFYEAR	0
-#define PAD_FMT_DAYOFMONTH	0
+#define	PAD_FMT_MONTHDAY	0
+#define	PAD_FMT_HMS		0
+#define	PAD_FMT_CENTURY		0
+#define	PAD_FMT_SHORTYEAR	0
+#define	PAD_FMT_MONTH		0
+#define	PAD_FMT_WEEKOFYEAR	0
+#define	PAD_FMT_DAYOFMONTH	0
 	{ "%02d",	"%d",	"%2d",	"%02d" },
-#define PAD_FMT_SDAYOFMONTH	1
-#define PAD_FMT_SHMS		1
+#define	PAD_FMT_SDAYOFMONTH	1
+#define	PAD_FMT_SHMS		1
 	{ "%2d",	"%d",	"%2d",	"%02d" },
 #define	PAD_FMT_DAYOFYEAR	2
 	{ "%03d",	"%d",	"%3d",	"%03d" },
-#define PAD_FMT_YEAR		3
+#define	PAD_FMT_YEAR		3
 	{ "%04d",	"%d",	"%4d",	"%04d" }
 };
 
@@ -114,7 +114,7 @@ strftime_l(char * __restrict s, size_t m
 	}
 #endif /* !defined NO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU */
 	if (p == s + maxsize)
-		return 0;
+		return (0);
 	*p = '\0';
 	return p - s;
 }
@@ -176,12 +176,12 @@ label:
 				continue;
 			case 'C':
 				/*
-				** %C used to do a...
-				**	_fmt("%a %b %e %X %Y", t);
-				** ...whereas now POSIX 1003.2 calls for
-				** something completely different.
-				** (ado, 1993-05-24)
-				*/
+				 * %C used to do a...
+				 *	_fmt("%a %b %e %X %Y", t);
+				 * ...whereas now POSIX 1003.2 calls for
+				 * something completely different.
+				 * (ado, 1993-05-24)
+				 */
 				pt = _yconv(t->tm_year, TM_YEAR_BASE, 1, 0,
 					pt, ptlim);
 				continue;
@@ -210,17 +210,17 @@ label:
 				goto label;
 			case 'O':
 				/*
-				** C99 locale modifiers.
-				** The sequences
-				**	%Ec %EC %Ex %EX %Ey %EY
-				**	%Od %oe %OH %OI %Om %OM
-				**	%OS %Ou %OU %OV %Ow %OW %Oy
-				** are supposed to provide alternate
-				** representations.
-				**
-				** FreeBSD extension
-				**      %OB
-				*/
+				 * C99 locale modifiers.
+				 * The sequences
+				 *	%Ec %EC %Ex %EX %Ey %EY
+				 *	%Od %oe %OH %OI %Om %OM
+				 *	%OS %Ou %OU %OV %Ow %OW %Oy
+				 * are supposed to provide alternate
+				 * representations.
+				 *
+				 * FreeBSD extension
+				 *      %OB
+				 */
 				if (Ealternative || Oalternative)
 					break;
 				Oalternative++;
@@ -239,7 +239,8 @@ label:
 			case 'I':
 				pt = _conv((t->tm_hour % 12) ?
 					(t->tm_hour % 12) : 12,
-					fmt_padding[PAD_FMT_HMS][PadIndex], pt, ptlim);
+					fmt_padding[PAD_FMT_HMS][PadIndex],
+					pt, ptlim);
 				continue;
 			case 'j':
 				pt = _conv(t->tm_yday + 1,
@@ -247,15 +248,15 @@ label:
 				continue;
 			case 'k':
 				/*
-				** This used to be...
-				**	_conv(t->tm_hour % 12 ?
-				**		t->tm_hour % 12 : 12, 2, ' ');
-				** ...and has been changed to the below to
-				** match SunOS 4.1.1 and Arnold Robbins'
-				** strftime version 3.0. That is, "%k" and
-				** "%l" have been swapped.
-				** (ado, 1993-05-24)
-				*/
+				 * This used to be...
+				 *	_conv(t->tm_hour % 12 ?
+				 *		t->tm_hour % 12 : 12, 2, ' ');
+				 * ...and has been changed to the below to
+				 * match SunOS 4.1.1 and Arnold Robbins'
+				 * strftime version 3.0. That is, "%k" and
+				 * "%l" have been swapped.
+				 * (ado, 1993-05-24)
+				 */
 				pt = _conv(t->tm_hour, fmt_padding[PAD_FMT_SHMS][PadIndex],
 					pt, ptlim);
 				continue;
@@ -269,17 +270,18 @@ label:
 #endif /* defined KITCHEN_SINK */
 			case 'l':
 				/*
-				** This used to be...
-				**	_conv(t->tm_hour, 2, ' ');
-				** ...and has been changed to the below to
-				** match SunOS 4.1.1 and Arnold Robbin's
-				** strftime version 3.0. That is, "%k" and
-				** "%l" have been swapped.
-				** (ado, 1993-05-24)
-				*/
+				 * This used to be...
+				 *	_conv(t->tm_hour, 2, ' ');
+				 * ...and has been changed to the below to
+				 * match SunOS 4.1.1 and Arnold Robbin's
+				 * strftime version 3.0. That is, "%k" and
+				 * "%l" have been swapped.
+				 * (ado, 1993-05-24)
+				 */
 				pt = _conv((t->tm_hour % 12) ?
 					(t->tm_hour % 12) : 12,
-					fmt_padding[PAD_FMT_SHMS][PadIndex], pt, ptlim);
+					fmt_padding[PAD_FMT_SHMS][PadIndex],
+					pt, ptlim);
 				continue;
 			case 'M':
 				pt = _conv(t->tm_min, fmt_padding[PAD_FMT_HMS][PadIndex],
@@ -287,15 +289,15 @@ label:
 				continue;
 			case 'm':
 				pt = _conv(t->tm_mon + 1,
-					fmt_padding[PAD_FMT_MONTH][PadIndex], pt, ptlim);
+					fmt_padding[PAD_FMT_MONTH][PadIndex],
+					pt, ptlim);
 				continue;
 			case 'n':
 				pt = _add("\n", pt, ptlim);
 				continue;
 			case 'p':
 				pt = _add((t->tm_hour >= (HOURSPERDAY / 2)) ?
-					tptr->pm :
-					tptr->am,
+					tptr->pm : tptr->am,
 					pt, ptlim);
 				continue;
 			case 'R':
@@ -339,11 +341,11 @@ label:
 				continue;
 			case 'u':
 				/*
-				** From Arnold Robbins' strftime version 3.0:
-				** "ISO 8601: Weekday as a decimal number
-				** [1 (Monday) - 7]"
-				** (ado, 1993-05-24)
-				*/
+				 * From Arnold Robbins' strftime version 3.0:
+				 * "ISO 8601: Weekday as a decimal number
+				 * [1 (Monday) - 7]"
+				 * (ado, 1993-05-24)
+				 */
 				pt = _conv((t->tm_wday == 0) ?
 					DAYSPERWEEK : t->tm_wday,
 					"%d", pt, ptlim);
@@ -352,23 +354,23 @@ label:
 			case 'G':	/* ISO 8601 year (four digits) */
 			case 'g':	/* ISO 8601 year (two digits) */
 /*
-** From Arnold Robbins' strftime version 3.0: "the week number of the
-** year (the first Monday as the first day of week 1) as a decimal number
-** (01-53)."
-** (ado, 1993-05-24)
-**
-** From "http://www.ft.uni-erlangen.de/~mskuhn/iso-time.html" by Markus Kuhn:
-** "Week 01 of a year is per definition the first week which has the
-** Thursday in this year, which is equivalent to the week which contains
-** the fourth day of January. In other words, the first week of a new year
-** is the week which has the majority of its days in the new year. Week 01
-** might also contain days from the previous year and the week before week
-** 01 of a year is the last week (52 or 53) of the previous year even if
-** it contains days from the new year. A week starts with Monday (day 1)
-** and ends with Sunday (day 7). For example, the first week of the year
-** 1997 lasts from 1996-12-30 to 1997-01-05..."
-** (ado, 1996-01-02)
-*/
+ * From Arnold Robbins' strftime version 3.0: "the week number of the
+ * year (the first Monday as the first day of week 1) as a decimal number
+ * (01-53)."
+ * (ado, 1993-05-24)
+ *
+ * From "http://www.ft.uni-erlangen.de/~mskuhn/iso-time.html" by Markus Kuhn:
+ * "Week 01 of a year is per definition the first week which has the
+ * Thursday in this year, which is equivalent to the week which contains
+ * the fourth day of January. In other words, the first week of a new year
+ * is the week which has the majority of its days in the new year. Week 01
+ * might also contain days from the previous year and the week before week
+ * 01 of a year is the last week (52 or 53) of the previous year even if
+ * it contains days from the new year. A week starts with Monday (day 1)
+ * and ends with Sunday (day 7). For example, the first week of the year
+ * 1997 lasts from 1996-12-30 to 1997-01-05..."
+ * (ado, 1996-01-02)
+ */
 				{
 					int	year;
 					int	base;
@@ -389,15 +391,15 @@ label:
 							DAYSPERLYEAR :
 							DAYSPERNYEAR;
 						/*
-						** What yday (-3 ... 3) does
-						** the ISO year begin on?
-						*/
+						 * What yday (-3 ... 3) does
+						 * the ISO year begin on?
+						 */
 						bot = ((yday + 11 - wday) %
 							DAYSPERWEEK) - 3;
 						/*
-						** What yday does the NEXT
-						** ISO year begin on?
-						*/
+						 * What yday does the NEXT
+						 * ISO year begin on?
+						 */
 						top = bot -
 							(len % DAYSPERWEEK);
 						if (top < -3)
@@ -438,10 +440,10 @@ label:
 				continue;
 			case 'v':
 				/*
-				** From Arnold Robbins' strftime version 3.0:
-				** "date as dd-bbb-YYYY"
-				** (ado, 1993-05-24)
-				*/
+				 * From Arnold Robbins' strftime version 3.0:
+				 * "date as dd-bbb-YYYY"
+				 * (ado, 1993-05-24)
+				 */
 				pt = _fmt("%e-%b-%Y", t, pt, ptlim, warnp, loc);
 				continue;
 			case 'W':
@@ -487,10 +489,10 @@ label:
 					pt = _add(tzname[t->tm_isdst != 0],
 						pt, ptlim);
 				/*
-				** C99 says that %Z must be replaced by the
-				** empty string if the time zone is not
-				** determinable.
-				*/
+				 * C99 says that %Z must be replaced by the
+				 * empty string if the time zone is not
+				 * determinable.
+				 */
 				continue;
 			case 'z':
 				{
@@ -503,24 +505,24 @@ label:
 				diff = t->TM_GMTOFF;
 #else /* !defined TM_GMTOFF */
 				/*
-				** C99 says that the UTC offset must
-				** be computed by looking only at
-				** tm_isdst. This requirement is
-				** incorrect, since it means the code
-				** must rely on magic (in this case
-				** altzone and timezone), and the
-				** magic might not have the correct
-				** offset. Doing things correctly is
-				** tricky and requires disobeying C99;
-				** see GNU C strftime for details.
-				** For now, punt and conform to the
-				** standard, even though it's incorrect.
-				**
-				** C99 says that %z must be replaced by the
-				** empty string if the time zone is not
-				** determinable, so output nothing if the
-				** appropriate variables are not available.
-				*/
+				 * C99 says that the UTC offset must
+				 * be computed by looking only at
+				 * tm_isdst. This requirement is
+				 * incorrect, since it means the code
+				 * must rely on magic (in this case
+				 * altzone and timezone), and the
+				 * magic might not have the correct
+				 * offset. Doing things correctly is
+				 * tricky and requires disobeying C99;
+				 * see GNU C strftime for details.
+				 * For now, punt and conform to the
+				 * standard, even though it's incorrect.
+				 *
+				 * C99 says that %z must be replaced by the
+				 * empty string if the time zone is not
+				 * determinable, so output nothing if the
+				 * appropriate variables are not available.
+				 */
 				if (t->tm_isdst == 0)
 #ifdef USG_COMPAT
 					diff = -timezone;
@@ -537,7 +539,8 @@ label:
 				if (diff < 0) {
 					sign = "-";
 					diff = -diff;
-				} else	sign = "+";
+				} else
+					sign = "+";
 				pt = _add(sign, pt, ptlim);
 				diff /= SECSPERMIN;
 				diff = (diff / MINSPERHOUR) * 100 +
@@ -567,10 +570,10 @@ label:
 				goto label;
 			case '%':
 			/*
-			** X311J/88-090 (4.12.3.5): if conversion char is
-			** undefined, behavior is undefined. Print out the
-			** character itself as printf(3) also does.
-			*/
+			 * X311J/88-090 (4.12.3.5): if conversion char is
+			 * undefined, behavior is undefined. Print out the
+			 * character itself as printf(3) also does.
+			 */
 			default:
 				break;
 			}
@@ -579,7 +582,7 @@ label:
 			break;
 		*pt++ = *format;
 	}
-	return pt;
+	return (pt);
 }
 
 static char *
@@ -603,16 +606,16 @@ const char * const	ptlim;
 {
 	while (pt < ptlim && (*pt = *str++) != '\0')
 		++pt;
-	return pt;
+	return (pt);
 }
 
 /*
-** POSIX and the C Standard are unclear or inconsistent about
-** what %C and %y do if the year is negative or exceeds 9999.
-** Use the convention that %C concatenated with %y yields the
-** same output as %Y, and that %Y contains at least 4 bytes,
-** with more only if necessary.
-*/
+ * POSIX and the C Standard are unclear or inconsistent about
+ * what %C and %y do if the year is negative or exceeds 9999.
+ * Use the convention that %C concatenated with %y yields the
+ * same output as %Y, and that %Y contains at least 4 bytes,
+ * with more only if necessary.
+ */
 
 static char *
 _yconv(a, b, convert_top, convert_yy, pt, ptlim)
@@ -626,7 +629,7 @@ const char * const	ptlim;
 	register int	lead;
 	register int	trail;
 
-#define DIVISOR	100
+#define	DIVISOR	100
 	trail = a % DIVISOR + b % DIVISOR;
 	lead = a / DIVISOR + b / DIVISOR + trail / DIVISOR;
 	trail %= DIVISOR;
@@ -644,5 +647,5 @@ const char * const	ptlim;
 	}
 	if (convert_yy)
 		pt = _conv(((trail < 0) ? -trail : trail), "%02d", pt, ptlim);
-	return pt;
+	return (pt);
 }

Modified: head/lib/libc/stdtime/strptime.c
==============================================================================
--- head/lib/libc/stdtime/strptime.c	Wed Jun 18 00:16:35 2014	(r267600)
+++ head/lib/libc/stdtime/strptime.c	Wed Jun 18 02:36:21 2014	(r267601)
@@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$");
 
 static char * _strptime(const char *, const char *, struct tm *, int *, locale_t);
 
-#define asizeof(a)	(sizeof (a) / sizeof ((a)[0]))
+#define	asizeof(a)	(sizeof (a) / sizeof ((a)[0]))
 
 static char *
 _strptime(const char *buf, const char *fmt, struct tm *tm, int *GMTp,
@@ -64,8 +64,7 @@ _strptime(const char *buf, const char *f
 {
 	char	c;
 	const char *ptr;
-	int	i,
-		len;
+	int	i, len;
 	int Ealternative, Oalternative;
 	struct lc_time_T *tptr = __get_current_time_locale(locale);
 
@@ -82,7 +81,7 @@ _strptime(const char *buf, const char *f
 				       isspace_l((unsigned char)*buf, locale))
 					buf++;
 			else if (c != *buf++)
-				return 0;
+				return (NULL);
 			continue;
 		}
 
@@ -94,18 +93,18 @@ label:
 		case 0:
 		case '%':
 			if (*buf++ != '%')
-				return 0;
+				return (NULL);
 			break;
 
 		case '+':
 			buf = _strptime(buf, tptr->date_fmt, tm, GMTp, locale);
-			if (buf == 0)
-				return 0;
+			if (buf == NULL)
+				return (NULL);
 			break;
 
 		case 'C':
 			if (!isdigit_l((unsigned char)*buf, locale))
-				return 0;
+				return (NULL);
 
 			/* XXX This will break for 3-digit centuries. */
 			len = 2;
@@ -116,21 +115,21 @@ label:
 				len--;
 			}
 			if (i < 19)
-				return 0;
+				return (NULL);
 
 			tm->tm_year = i * 100 - 1900;
 			break;
 
 		case 'c':
 			buf = _strptime(buf, tptr->c_fmt, tm, GMTp, locale);
-			if (buf == 0)
-				return 0;
+			if (buf == NULL)
+				return (NULL);
 			break;
 
 		case 'D':
 			buf = _strptime(buf, "%m/%d/%y", tm, GMTp, locale);
-			if (buf == 0)
-				return 0;
+			if (buf == NULL)
+				return (NULL);
 			break;
 
 		case 'E':
@@ -147,43 +146,43 @@ label:
 
 		case 'F':
 			buf = _strptime(buf, "%Y-%m-%d", tm, GMTp, locale);
-			if (buf == 0)
-				return 0;
+			if (buf == NULL)
+				return (NULL);
 			break;
 
 		case 'R':
 			buf = _strptime(buf, "%H:%M", tm, GMTp, locale);
-			if (buf == 0)
-				return 0;
+			if (buf == NULL)
+				return (NULL);
 			break;
 
 		case 'r':
 			buf = _strptime(buf, tptr->ampm_fmt, tm, GMTp, locale);
-			if (buf == 0)
-				return 0;
+			if (buf == NULL)
+				return (NULL);
 			break;
 
 		case 'T':
 			buf = _strptime(buf, "%H:%M:%S", tm, GMTp, locale);
-			if (buf == 0)
-				return 0;
+			if (buf == NULL)
+				return (NULL);
 			break;
 
 		case 'X':
 			buf = _strptime(buf, tptr->X_fmt, tm, GMTp, locale);
-			if (buf == 0)
-				return 0;
+			if (buf == NULL)
+				return (NULL);
 			break;
 
 		case 'x':
 			buf = _strptime(buf, tptr->x_fmt, tm, GMTp, locale);
-			if (buf == 0)
-				return 0;
+			if (buf == NULL)
+				return (NULL);
 			break;
 
 		case 'j':
 			if (!isdigit_l((unsigned char)*buf, locale))
-				return 0;
+				return (NULL);
 
 			len = 3;
 			for (i = 0; len && *buf != 0 &&
@@ -193,7 +192,7 @@ label:
 				len--;
 			}
 			if (i < 1 || i > 366)
-				return 0;
+				return (NULL);
 
 			tm->tm_yday = i - 1;
 			break;
@@ -205,7 +204,7 @@ label:
 				break;
 
 			if (!isdigit_l((unsigned char)*buf, locale))
-				return 0;
+				return (NULL);
 
 			len = 2;
 			for (i = 0; len && *buf != 0 &&
@@ -217,11 +216,11 @@ label:
 
 			if (c == 'M') {
 				if (i > 59)
-					return 0;
+					return (NULL);
 				tm->tm_min = i;
 			} else {
 				if (i > 60)
-					return 0;
+					return (NULL);
 				tm->tm_sec = i;
 			}
 
@@ -245,7 +244,7 @@ label:
 			 * digits if used incorrectly.
 			 */
 			if (!isdigit_l((unsigned char)*buf, locale))
-				return 0;
+				return (NULL);
 
 			len = 2;
 			for (i = 0; len && *buf != 0 &&
@@ -256,9 +255,9 @@ label:
 			}
 			if (c == 'H' || c == 'k') {
 				if (i > 23)
-					return 0;
+					return (NULL);
 			} else if (i > 12)
-				return 0;
+				return (NULL);
 
 			tm->tm_hour = i;
 
@@ -277,7 +276,7 @@ label:
 			len = strlen(tptr->am);
 			if (strncasecmp_l(buf, tptr->am, len, locale) == 0) {
 				if (tm->tm_hour > 12)
-					return 0;
+					return (NULL);
 				if (tm->tm_hour == 12)
 					tm->tm_hour = 0;
 				buf += len;
@@ -287,14 +286,14 @@ label:
 			len = strlen(tptr->pm);
 			if (strncasecmp_l(buf, tptr->pm, len, locale) == 0) {
 				if (tm->tm_hour > 12)
-					return 0;
+					return (NULL);
 				if (tm->tm_hour != 12)
 					tm->tm_hour += 12;
 				buf += len;
 				break;
 			}
 
-			return 0;
+			return (NULL);
 
 		case 'A':
 		case 'a':
@@ -309,7 +308,7 @@ label:
 					break;
 			}
 			if (i == asizeof(tptr->weekday))
-				return 0;
+				return (NULL);
 
 			tm->tm_wday = i;
 			buf += len;
@@ -324,7 +323,7 @@ label:
 			 * range for now.
 			 */
 			if (!isdigit_l((unsigned char)*buf, locale))
-				return 0;
+				return (NULL);
 
 			len = 2;
 			for (i = 0; len && *buf != 0 &&
@@ -334,7 +333,7 @@ label:
 				len--;
 			}
 			if (i > 53)
-				return 0;
+				return (NULL);
 
 			if (*buf != 0 &&
 			    isspace_l((unsigned char)*buf, locale))
@@ -345,11 +344,11 @@ label:
 
 		case 'w':
 			if (!isdigit_l((unsigned char)*buf, locale))
-				return 0;
+				return (NULL);
 
 			i = *buf - '0';
 			if (i > 6)
-				return 0;
+				return (NULL);
 
 			tm->tm_wday = i;
 
@@ -371,7 +370,7 @@ label:
 			 * digits if used incorrectly.
 			 */
 			if (!isdigit_l((unsigned char)*buf, locale))
-				return 0;
+				return (NULL);
 
 			len = 2;
 			for (i = 0; len && *buf != 0 &&
@@ -381,7 +380,7 @@ label:
 				len--;
 			}
 			if (i > 31)
-				return 0;
+				return (NULL);
 
 			tm->tm_mday = i;
 
@@ -424,7 +423,7 @@ label:
 				}
 			}
 			if (i == asizeof(tptr->month))
-				return 0;
+				return (NULL);
 
 			tm->tm_mon = i;
 			buf += len;
@@ -432,7 +431,7 @@ label:
 
 		case 'm':
 			if (!isdigit_l((unsigned char)*buf, locale))
-				return 0;
+				return (NULL);
 
 			len = 2;
 			for (i = 0; len && *buf != 0 &&
@@ -442,7 +441,7 @@ label:
 				len--;
 			}
 			if (i < 1 || i > 12)
-				return 0;
+				return (NULL);
 
 			tm->tm_mon = i - 1;
 
@@ -465,7 +464,7 @@ label:
 			n = strtol_l(buf, &cp, 10, locale);
 			if (errno == ERANGE || (long)(t = n) != n) {
 				errno = sverrno;
-				return 0;
+				return (NULL);
 			}
 			errno = sverrno;
 			buf = cp;
@@ -481,7 +480,7 @@ label:
 				break;
 
 			if (!isdigit_l((unsigned char)*buf, locale))
-				return 0;
+				return (NULL);
 
 			len = (c == 'Y') ? 4 : 2;
 			for (i = 0; len && *buf != 0 &&
@@ -495,7 +494,7 @@ label:
 			if (c == 'y' && i < 69)
 				i += 100;
 			if (i < 0)
-				return 0;
+				return (NULL);
 
 			tm->tm_year = i;
 
@@ -526,7 +525,7 @@ label:
 				} else if (0 == strcmp(zonestr, tzname[1])) {
 				    tm->tm_isdst = 1;
 				} else {
-				    return 0;
+				    return (NULL);
 				}
 				buf += cp - buf;
 			}
@@ -541,7 +540,7 @@ label:
 				if (*buf == '-')
 					sign = -1;
 				else
-					return 0;
+					return (NULL);
 			}
 
 			buf++;
@@ -552,7 +551,7 @@ label:
 					i += *buf - '0';
 					buf++;
 				} else
-					return 0;
+					return (NULL);
 			}
 
 			tm->tm_hour -= sign * (i / 100);
@@ -562,7 +561,7 @@ label:
 			break;
 		}
 	}
-	return (char *)buf;
+	return ((char *)buf);
 }
 
 

Modified: head/lib/libc/stdtime/timelocal.c
==============================================================================
--- head/lib/libc/stdtime/timelocal.c	Wed Jun 18 00:16:35 2014	(r267600)
+++ head/lib/libc/stdtime/timelocal.c	Wed Jun 18 02:36:21 2014	(r267601)
@@ -46,7 +46,7 @@ struct xlocale_time {
 
 struct xlocale_time __xlocale_global_time;
 
-#define LCTIME_SIZE (sizeof(struct lc_time_T) / sizeof(char *))
+#define	LCTIME_SIZE (sizeof(struct lc_time_T) / sizeof(char *))
 
 static const struct lc_time_T	_C_time_locale = {
 	{

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 07:23:05 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8441B1EA;
 Wed, 18 Jun 2014 07:23:05 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 65CB32096;
 Wed, 18 Jun 2014 07:23:05 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5I7N5d9087981;
 Wed, 18 Jun 2014 07:23:05 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5I7N5dY087979;
 Wed, 18 Jun 2014 07:23:05 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201406180723.s5I7N5dY087979@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Wed, 18 Jun 2014 07:23:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267603 - head/share/vt/keymaps
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 07:23:05 -0000

Author: trasz
Date: Wed Jun 18 07:23:04 2014
New Revision: 267603
URL: http://svnweb.freebsd.org/changeset/base/267603

Log:
  Add polish vt(4) keymap.
  
  Sponsored by:	The FreeBSD Foundation

Added:
  head/share/vt/keymaps/pl.kbd   (contents, props changed)
Modified:
  head/share/vt/keymaps/Makefile

Modified: head/share/vt/keymaps/Makefile
==============================================================================
--- head/share/vt/keymaps/Makefile	Wed Jun 18 05:35:09 2014	(r267602)
+++ head/share/vt/keymaps/Makefile	Wed Jun 18 07:23:04 2014	(r267603)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-FILES=	ua.kbd ua.shift.alt.kbd
+FILES=	pl.kbd ua.kbd ua.shift.alt.kbd
 
 FILESDIR= ${SHAREDIR}/vt/keymaps
 

Added: head/share/vt/keymaps/pl.kbd
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/vt/keymaps/pl.kbd	Wed Jun 18 07:23:04 2014	(r267603)
@@ -0,0 +1,116 @@
+# Polish ISO-8859-2 keymap by Krzysztof Mlynarski (17:46 27-04-1996 MET DST)
+#                             (krzysio@hydra.mimuw.edu.pl)
+# $FreeBSD$
+#                                                         alt
+# scan                       cntrl          alt    alt   cntrl lock
+# code  base   shift  cntrl  shift  alt    shift  cntrl  shift state
+# ------------------------------------------------------------------
+  000   nop    nop    nop    nop    nop    nop    nop    nop     O
+  001   esc    esc    esc    esc    esc    esc    debug  esc     O
+  002   '1'    '!'    nop    nop    '1'    '!'    nop    nop     O
+  003   '2'    '@'    nul    nul    '2'    '@'    nul    nul     O
+  004   '3'    '#'    nop    nop    '3'    '#'    nop    nop     O
+  005   '4'    '$'    nop    nop    '4'    '$'    nop    nop     O
+  006   '5'    '%'    nop    nop    '5'    '%'    nop    nop     O
+  007   '6'    '^'    rs     rs     '6'    '^'    rs     rs      O
+  008   '7'    '&'    nop    nop    '7'    '&'    nop    nop     O
+  009   '8'    '*'    nop    nop    '8'    '*'    nop    nop     O
+  010   '9'    '('    nop    nop    '9'    '('    nop    nop     O
+  011   '0'    ')'    nop    nop    '0'    ')'    nop    nop     O
+  012   '-'    '_'    us     us     '-'    '_'    us     us      O
+  013   '='    '+'    nop    nop    '='    '+'    nop    nop     O
+  014   bs     bs     del    del    bs     bs     del    del     O
+  015   ht     btab   nop    nop    ht     btab   nop    nop     O
+  016   'q'    'Q'    dc1    dc1    'q'    'Q'    dc1    dc1     C
+  017   'w'    'W'    etb    etb    'w'    'W'    etb    etb     C
+  018   'e'    'E'    enq    enq    281    280    enq    enq     C
+  019   'r'    'R'    dc2    dc2    'r'    'R'    dc2    dc2     C
+  020   't'    'T'    dc4    dc4    't'    'T'    dc4    dc4     C
+  021   'y'    'Y'    em     em     'y'    'Y'    em     em      C
+  022   'u'    'U'    nak    nak    'u'    'U'    nak    nak     C
+  023   'i'    'I'    ht     ht     'i'    'I'    ht     ht      C
+  024   'o'    'O'    si     si     243    211    si     si      C
+  025   'p'    'P'    dle    dle    'p'    'P'    dle    dle     C
+  026   '['    '{'    esc    esc    '['    '{'    esc    esc     O
+  027   ']'    '}'    gs     gs     ']'    '}'    gs     gs      O
+  028   cr     cr     nl     nl     cr     cr     nl     nl      O
+  029   lctrl  lctrl  lctrl  lctrl  lctrl  lctrl  lctrl  lctrl   O
+  030   'a'    'A'    soh    soh    261    260    soh    soh     C
+  031   's'    'S'    dc3    dc3    347    346    dc3    dc3     C
+  032   'd'    'D'    eot    eot    'd'    'D'    eot    eot     C
+  033   'f'    'F'    ack    ack    'f'    'F'    ack    ack     C
+  034   'g'    'G'    bel    bel    'g'    'G'    bel    bel     C
+  035   'h'    'H'    bs     bs     'h'    'H'    bs     bs      C
+  036   'j'    'J'    nl     nl     'j'    'J'    nl     nl      C
+  037   'k'    'K'    vt     vt     'k'    'K'    vt     vt      C
+  038   'l'    'L'    ff     ff     322    321    ff     ff      C
+  039   ';'    ':'    nop    nop    ';'    ':'    nop    nop     O
+  040   '''    '"'    nop    nop    '''    '"'    nop    nop     O
+  041   '`'    '~'    nop    nop    '`'    '~'    nop    nop     O
+  042   lshift lshift lshift lshift lshift lshift lshift lshift  O
+  043   '\'    '|'    fs     fs     '\'    '|'    fs     fs      O
+  044   'z'    'Z'    sub    sub    380    379    sub    sub     C
+  045   'x'    'X'    can    can    378    377    can    can     C
+  046   'c'    'C'    etx    etx    263    262    etx    etx     C
+  047   'v'    'V'    syn    syn    'v'    'V'    syn    syn     C
+  048   'b'    'B'    stx    stx    'b'    'B'    stx    stx     C
+  049   'n'    'N'    so     so     324    323    so     so      C
+  050   'm'    'M'    cr     cr     'm'    'M'    cr     cr      C
+  051   ','    '<'    nop    nop    ','    '<'    nop    nop     O
+  052   '.'    '>'    nop    nop    '.'    '>'    nop    nop     O
+  053   '/'    '?'    nop    nop    '/'    '?'    nop    nop     O
+  054   rshift rshift rshift rshift rshift rshift rshift rshift  O
+  055   '*'    '*'    '*'    '*'    '*'    '*'    '*'    '*'     O
+  056   lalt   lalt   lalt   lalt   lalt   lalt   lalt   lalt    O
+  057   ' '    ' '    nul    ' '    ' '    ' '    susp   ' '     O
+  058   clock  clock  clock  clock  clock  clock  clock  clock   O
+  059   fkey01 fkey13 fkey25 fkey37 scr01  scr11  scr01  scr11   O
+  060   fkey02 fkey14 fkey26 fkey38 scr02  scr12  scr02  scr12   O
+  061   fkey03 fkey15 fkey27 fkey39 scr03  scr13  scr03  scr13   O
+  062   fkey04 fkey16 fkey28 fkey40 scr04  scr14  scr04  scr14   O
+  063   fkey05 fkey17 fkey29 fkey41 scr05  scr15  scr05  scr15   O
+  064   fkey06 fkey18 fkey30 fkey42 scr06  scr16  scr06  scr16   O
+  065   fkey07 fkey19 fkey31 fkey43 scr07  scr07  scr07  scr07   O
+  066   fkey08 fkey20 fkey32 fkey44 scr08  scr08  scr08  scr08   O
+  067   fkey09 fkey21 fkey33 fkey45 scr09  scr09  scr09  scr09   O
+  068   fkey10 fkey22 fkey34 fkey46 scr10  scr10  scr10  scr10   O
+  069   nlock  nlock  nlock  nlock  nlock  nlock  nlock  nlock   O
+  070   slock  slock  slock  slock  slock  slock  slock  slock   O
+  071   fkey49 '7'    '7'    '7'    '7'    '7'    '7'    '7'     N
+  072   fkey50 '8'    '8'    '8'    '8'    '8'    '8'    '8'     N
+  073   fkey51 '9'    '9'    '9'    '9'    '9'    '9'    '9'     N
+  074   fkey52 '-'    '-'    '-'    '-'    '-'    '-'    '-'     N
+  075   fkey53 '4'    '4'    '4'    '4'    '4'    '4'    '4'     N
+  076   fkey54 '5'    '5'    '5'    '5'    '5'    '5'    '5'     N
+  077   fkey55 '6'    '6'    '6'    '6'    '6'    '6'    '6'     N
+  078   fkey56 '+'    '+'    '+'    '+'    '+'    '+'    '+'     N
+  079   fkey57 '1'    '1'    '1'    '1'    '1'    '1'    '1'     N
+  080   fkey58 '2'    '2'    '2'    '2'    '2'    '2'    '2'     N
+  081   fkey59 '3'    '3'    '3'    '3'    '3'    '3'    '3'     N
+  082   fkey60 '0'    '0'    '0'    '0'    '0'    '0'    '0'     N
+  083   del    '.'    '.'    '.'    '.'    '.'    boot   boot    N
+  084   nop    nop    nop    nop    nop    nop    nop    nop     O
+  085   nop    nop    nop    nop    nop    nop    nop    nop     O
+  086   nop    nop    nop    nop    nop    nop    nop    nop     O
+  087   fkey11 fkey23 fkey35 fkey47 scr11  scr11  scr11  scr11   O
+  088   fkey12 fkey24 fkey36 fkey48 scr12  scr12  scr12  scr12   O
+  089   cr     cr     cr     cr     cr     cr     cr     cr      O
+  090   rctrl  rctrl  rctrl  rctrl  rctrl  rctrl  rctrl  rctrl   O
+  091   '/'    '/'    '/'    '/'    '/'    '/'    '/'    '/'     O
+  092   nscr   pscr   debug  debug  nop    nop    nop    nop     O
+  093   ralt   ralt   ralt   ralt   ralt   ralt   ralt   ralt    O
+  094   fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49  O
+  095   fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50  O
+  096   fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51  O
+  097   fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53  O
+  098   fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55  O
+  099   fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57  O
+  100   fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58  O
+  101   fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59  O
+  102   fkey60 paste  fkey60 fkey60 fkey60 fkey60 fkey60 fkey60  O
+  103   fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot   fkey61  O
+  104   slock  saver  slock  saver  susp   nop    susp   nop     O
+  105   fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62  O
+  106   fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63  O
+  107   fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64  O
+  108   nop    nop    nop    nop    nop    nop    nop    nop     O

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 12:26:03 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A89AD522;
 Wed, 18 Jun 2014 12:26:03 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 78C682BC2;
 Wed, 18 Jun 2014 12:26:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5ICQ32A029740;
 Wed, 18 Jun 2014 12:26:03 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5ICQ3PQ029739;
 Wed, 18 Jun 2014 12:26:03 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406181226.s5ICQ3PQ029739@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 18 Jun 2014 12:26:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267606 - head/usr.sbin/ctld
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 12:26:03 -0000

Author: mav
Date: Wed Jun 18 12:26:02 2014
New Revision: 267606
URL: http://svnweb.freebsd.org/changeset/base/267606

Log:
  On discovery stage add set of TargetAddress keys to reply, reporting to
  the client all the portal groups addresses and ports.
  
  Reviewed by:	trasz@
  MFC after:	2 weeks
  Sponsored by:	iXsystems, Inc.

Modified:
  head/usr.sbin/ctld/discovery.c

Modified: head/usr.sbin/ctld/discovery.c
==============================================================================
--- head/usr.sbin/ctld/discovery.c	Wed Jun 18 10:56:59 2014	(r267605)
+++ head/usr.sbin/ctld/discovery.c	Wed Jun 18 12:26:02 2014	(r267606)
@@ -35,6 +35,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include "ctld.h"
 #include "iscsi_proto.h"
@@ -155,6 +157,48 @@ logout_new_response(struct pdu *request)
 	return (response);
 }
 
+static void
+discovery_add_target(struct keys *response_keys, struct target *targ)
+{
+	struct portal *portal;
+	char *buf;
+	char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];
+	struct addrinfo *ai;
+	int ret;
+
+	keys_add(response_keys, "TargetName", targ->t_name);
+	TAILQ_FOREACH(portal, &targ->t_portal_group->pg_portals, p_next) {
+		ai = portal->p_ai;
+		ret = getnameinfo(ai->ai_addr, ai->ai_addrlen,
+		    hbuf, sizeof(hbuf), sbuf, sizeof(sbuf),
+		    NI_NUMERICHOST | NI_NUMERICSERV);
+		if (ret != 0) {
+			log_warnx("getnameinfo: %s", gai_strerror(ret));
+			continue;
+		}
+		switch (ai->ai_addr->sa_family) {
+		case AF_INET:
+			if (strcmp(hbuf, "0.0.0.0") == 0)
+				continue;
+			ret = asprintf(&buf, "%s:%s,%d", hbuf, sbuf,
+			    targ->t_portal_group->pg_tag);
+			break;
+		case AF_INET6:
+			if (strcmp(hbuf, "::") == 0)
+				continue;
+			ret = asprintf(&buf, "[%s]:%s,%d", hbuf, sbuf,
+			    targ->t_portal_group->pg_tag);
+			break;
+		default:
+			continue;
+		}
+		if (ret <= 0)
+		    log_err(1, "asprintf");
+		keys_add(response_keys, "TargetAddress", buf);
+		free(buf);
+	}
+}
+
 void
 discovery(struct connection *conn)
 {
@@ -186,7 +230,7 @@ discovery(struct connection *conn)
 				    targ->t_name);
 				continue;
 			}
-			keys_add(response_keys, "TargetName", targ->t_name);
+			discovery_add_target(response_keys, targ);
 		}
 	} else {
 		targ = target_find(conn->conn_portal->p_portal_group->pg_conf,
@@ -194,9 +238,8 @@ discovery(struct connection *conn)
 		if (targ == NULL) {
 			log_debugx("initiator requested information on unknown "
 			    "target \"%s\"; returning nothing", send_targets);
-		} else {
-			keys_add(response_keys, "TargetName", targ->t_name);
-		}
+		} else
+			discovery_add_target(response_keys, targ);
 	}
 	keys_save(response_keys, response);
 

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 13:41:20 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A8B314AF;
 Wed, 18 Jun 2014 13:41:20 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 959EF242D;
 Wed, 18 Jun 2014 13:41:20 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5IDfKNT065440;
 Wed, 18 Jun 2014 13:41:20 GMT (envelope-from royger@svn.freebsd.org)
Received: (from royger@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5IDfKwG065439;
 Wed, 18 Jun 2014 13:41:20 GMT (envelope-from royger@svn.freebsd.org)
Message-Id: <201406181341.s5IDfKwG065439@svn.freebsd.org>
From: Roger Pau Monné 
Date: Wed, 18 Jun 2014 13:41:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267607 - head/sys/x86/xen
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 13:41:20 -0000

Author: royger
Date: Wed Jun 18 13:41:20 2014
New Revision: 267607
URL: http://svnweb.freebsd.org/changeset/base/267607

Log:
  xen: fix out-of-bounds access to ipi_handle
  
  Fix the gate in xen_pv_lapic_ipi_vectored to prevent access to element
  at position nitems(xen_ipis).
  
  Sponsored by: Citrix Systems R&D
  Coverity ID: 1223203
  Approved by: gibbs

Modified:
  head/sys/x86/xen/xen_apic.c

Modified: head/sys/x86/xen/xen_apic.c
==============================================================================
--- head/sys/x86/xen/xen_apic.c	Wed Jun 18 12:26:02 2014	(r267606)
+++ head/sys/x86/xen/xen_apic.c	Wed Jun 18 13:41:20 2014	(r267607)
@@ -272,7 +272,7 @@ xen_pv_lapic_ipi_vectored(u_int vector, 
 	int ipi_idx, to_cpu, self;
 
 	ipi_idx = IPI_TO_IDX(vector);
-	if (ipi_idx > nitems(xen_ipis))
+	if (ipi_idx >= nitems(xen_ipis))
 		panic("IPI out of range");
 
 	switch(dest) {

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 17:00:41 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B7070D36;
 Wed, 18 Jun 2014 17:00:41 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A37E829AA;
 Wed, 18 Jun 2014 17:00:41 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5IH0fT2052843;
 Wed, 18 Jun 2014 17:00:41 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5IH0f08052842;
 Wed, 18 Jun 2014 17:00:41 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201406181700.s5IH0f08052842@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Wed, 18 Jun 2014 17:00:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267608 - head/usr.sbin/iscsid
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 17:00:41 -0000

Author: trasz
Date: Wed Jun 18 17:00:41 2014
New Revision: 267608
URL: http://svnweb.freebsd.org/changeset/base/267608

Log:
  Use proper term in debug messages.
  
  MFC after:	1 month
  Sponsored by:	FreeBSD Foundation

Modified:
  head/usr.sbin/iscsid/login.c

Modified: head/usr.sbin/iscsid/login.c
==============================================================================
--- head/usr.sbin/iscsid/login.c	Wed Jun 18 13:41:20 2014	(r267607)
+++ head/usr.sbin/iscsid/login.c	Wed Jun 18 17:00:41 2014	(r267608)
@@ -495,7 +495,7 @@ login_negotiate(struct connection *conn)
 	struct iscsi_bhs_login_response *bhslr;
 	int i;
 
-	log_debugx("beginning parameter negotiation");
+	log_debugx("beginning operational parameter negotiation");
 	request = login_new_request(conn);
 	login_set_csg(request, BHSLR_STAGE_OPERATIONAL_NEGOTIATION);
 	login_set_nsg(request, BHSLR_STAGE_FULL_FEATURE_PHASE);
@@ -557,7 +557,7 @@ login_negotiate(struct connection *conn)
 		log_warnx("received final login response with wrong NSG 0x%x",
 		    login_nsg(response));
 
-	log_debugx("parameter negotiation done; "
+	log_debugx("operational parameter negotiation done; "
 	    "transitioning to Full Feature phase");
 
 	keys_delete(response_keys);
@@ -848,12 +848,12 @@ login(struct connection *conn)
 	    login_nsg(response) == BHSLR_STAGE_OPERATIONAL_NEGOTIATION) {
 		if (conn->conn_conf.isc_mutual_user[0] != '\0') {
 			log_errx(1, "target requested transition "
-			    "to operational negotiation, but we require "
-			    "mutual CHAP");
+			    "to operational parameter negotiation, "
+			    "but we require mutual CHAP");
 		}
 
 		log_debugx("target requested transition "
-		    "to operational negotiation");
+		    "to operational parameter negotiation");
 		keys_delete(response_keys);
 		pdu_delete(response);
 		login_negotiate(conn);

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 17:04:26 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 87B82FF1;
 Wed, 18 Jun 2014 17:04:26 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6875C29F9;
 Wed, 18 Jun 2014 17:04:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5IH4Qsj055268;
 Wed, 18 Jun 2014 17:04:26 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5IH4QDp055266;
 Wed, 18 Jun 2014 17:04:26 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201406181704.s5IH4QDp055266@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Wed, 18 Jun 2014 17:04:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267609 - head/usr.sbin/iscsid
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 17:04:26 -0000

Author: trasz
Date: Wed Jun 18 17:04:25 2014
New Revision: 267609
URL: http://svnweb.freebsd.org/changeset/base/267609

Log:
  Improve code a little; no functional changes.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/usr.sbin/iscsid/login.c

Modified: head/usr.sbin/iscsid/login.c
==============================================================================
--- head/usr.sbin/iscsid/login.c	Wed Jun 18 17:00:41 2014	(r267608)
+++ head/usr.sbin/iscsid/login.c	Wed Jun 18 17:04:25 2014	(r267609)
@@ -205,18 +205,32 @@ login_receive(struct connection *conn, b
 }
 
 static struct pdu *
-login_new_request(struct connection *conn)
+login_new_request(struct connection *conn, int csg)
 {
 	struct pdu *request;
 	struct iscsi_bhs_login_request *bhslr;
+	int nsg;
 
 	request = pdu_new(conn);
 	bhslr = (struct iscsi_bhs_login_request *)request->pdu_bhs;
 	bhslr->bhslr_opcode = ISCSI_BHS_OPCODE_LOGIN_REQUEST |
 	    ISCSI_BHS_OPCODE_IMMEDIATE;
+
 	bhslr->bhslr_flags = BHSLR_FLAGS_TRANSIT;
-	login_set_csg(request, BHSLR_STAGE_SECURITY_NEGOTIATION);
-	login_set_nsg(request, BHSLR_STAGE_OPERATIONAL_NEGOTIATION);
+	switch (csg) {
+	case BHSLR_STAGE_SECURITY_NEGOTIATION:
+		nsg = BHSLR_STAGE_OPERATIONAL_NEGOTIATION;
+		break;
+	case BHSLR_STAGE_OPERATIONAL_NEGOTIATION:
+		nsg = BHSLR_STAGE_FULL_FEATURE_PHASE;
+		break;
+	default:
+		assert(!"invalid csg");
+		log_errx(1, "invalid csg %d", csg);
+	}
+	login_set_csg(request, csg);
+	login_set_nsg(request, nsg);
+
 	memcpy(bhslr->bhslr_isid, &conn->conn_isid, sizeof(bhslr->bhslr_isid));
 	bhslr->bhslr_initiator_task_tag = 0;
 	bhslr->bhslr_cmdsn = 0;
@@ -496,9 +510,7 @@ login_negotiate(struct connection *conn)
 	int i;
 
 	log_debugx("beginning operational parameter negotiation");
-	request = login_new_request(conn);
-	login_set_csg(request, BHSLR_STAGE_OPERATIONAL_NEGOTIATION);
-	login_set_nsg(request, BHSLR_STAGE_FULL_FEATURE_PHASE);
+	request = login_new_request(conn, BHSLR_STAGE_OPERATIONAL_NEGOTIATION);
 	request_keys = keys_new();
 
 	/*
@@ -570,7 +582,7 @@ login_send_chap_a(struct connection *con
 	struct pdu *request;
 	struct keys *request_keys;
 
-	request = login_new_request(conn);
+	request = login_new_request(conn, BHSLR_STAGE_SECURITY_NEGOTIATION);
 	request_keys = keys_new();
 	keys_add(request_keys, "CHAP_A", "5");
 	keys_save(request_keys, request);
@@ -632,7 +644,7 @@ login_send_chap_r(struct pdu *response)
 
 	keys_delete(response_keys);
 
-	request = login_new_request(conn);
+	request = login_new_request(conn, BHSLR_STAGE_SECURITY_NEGOTIATION);
 	request_keys = keys_new();
 	keys_add(request_keys, "CHAP_N", conn->conn_conf.isc_user);
 	keys_add(request_keys, "CHAP_R", chap_r);
@@ -779,7 +791,7 @@ login(struct connection *conn)
 	login_create_isid(conn);
 
 	log_debugx("beginning Login phase; sending Login PDU");
-	request = login_new_request(conn);
+	request = login_new_request(conn, BHSLR_STAGE_SECURITY_NEGOTIATION);
 	request_keys = keys_new();
 	if (conn->conn_conf.isc_mutual_user[0] != '\0') {
 		keys_add(request_keys, "AuthMethod", "CHAP");

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 17:13:19 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2F5D6808;
 Wed, 18 Jun 2014 17:13:19 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1013C2B03;
 Wed, 18 Jun 2014 17:13:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5IHDIUO060299;
 Wed, 18 Jun 2014 17:13:18 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5IHDIYw060298;
 Wed, 18 Jun 2014 17:13:18 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201406181713.s5IHDIYw060298@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Wed, 18 Jun 2014 17:13:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267610 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 17:13:19 -0000

Author: trasz
Date: Wed Jun 18 17:13:18 2014
New Revision: 267610
URL: http://svnweb.freebsd.org/changeset/base/267610

Log:
  Rework session termination in iSCSI target to actually wait
  for any outstanding commands to be properly aborted by CTL.
  Without it, in some cases (such as files backing the LUNs
  stored on failing disk drives), terminating a busy session
  would result in panic.
  
  Reviewed by:	mav@ (earlier version)
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Wed Jun 18 17:04:25 2014	(r267609)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Wed Jun 18 17:13:18 2014	(r267610)
@@ -1045,7 +1045,7 @@ cfiscsi_session_terminate_tasks(struct c
 {
 	struct cfiscsi_data_wait *cdw, *tmpcdw;
 	union ctl_io *io;
-	int error;
+	int error, last;
 
 #ifdef notyet
 	io = ctl_alloc_io(cs->cs_target->ct_softc->fe.ctl_pool_ref);
@@ -1102,12 +1102,31 @@ cfiscsi_session_terminate_tasks(struct c
 		CFISCSI_SESSION_DEBUG(cs, "removing csw for initiator task tag "
 		    "0x%x", cdw->cdw_initiator_task_tag);
 #endif
+		/*
+		 * Set nonzero port status; this prevents backends from
+		 * assuming that the data transfer actually succeeded
+		 * and writing uninitialized data to disk.
+		 */
+		cdw->cdw_ctl_io->scsiio.io_hdr.port_status = 42;
 		cdw->cdw_ctl_io->scsiio.be_move_done(cdw->cdw_ctl_io);
 		TAILQ_REMOVE(&cs->cs_waiting_for_data_out, cdw, cdw_next);
 		uma_zfree(cfiscsi_data_wait_zone, cdw);
 	}
 	CFISCSI_SESSION_UNLOCK(cs);
 #endif
+
+	/*
+	 * Wait for CTL to terminate all the tasks.
+	 */
+	for (;;) {
+		refcount_acquire(&cs->cs_outstanding_ctl_pdus);
+		last = refcount_release(&cs->cs_outstanding_ctl_pdus);
+		if (last != 0)
+			break;
+		CFISCSI_SESSION_WARN(cs, "waiting for CTL to terminate tasks, "
+		    "%d remaining", cs->cs_outstanding_ctl_pdus);
+		pause("cfiscsi_terminate", 1);
+	}
 }
 
 static void
@@ -1124,19 +1143,22 @@ cfiscsi_maintenance_thread(void *arg)
 		CFISCSI_SESSION_UNLOCK(cs);
 
 		if (cs->cs_terminating) {
-			cfiscsi_session_terminate_tasks(cs);
-			callout_drain(&cs->cs_callout);
 
+			/*
+			 * We used to wait up to 30 seconds to deliver queued
+			 * PDUs to the initiator.  We also tried hard to deliver
+			 * SCSI Responses for the aborted PDUs.  We don't do
+			 * that anymore.  We might need to revisit that.
+			 */
+			callout_drain(&cs->cs_callout);
 			icl_conn_shutdown(cs->cs_conn);
 			icl_conn_close(cs->cs_conn);
 
 			/*
-			 * XXX: We used to wait up to 30 seconds to deliver queued PDUs
-			 * 	to the initiator.  We also tried hard to deliver SCSI Responses
-			 * 	for the aborted PDUs.  We don't do that anymore.  We might need
-			 * 	to revisit that.
+			 * At this point ICL receive thread is no longer
+			 * running; no new tasks can be queued.
 			 */
-
+			cfiscsi_session_terminate_tasks(cs);
 			cfiscsi_session_delete(cs);
 			kthread_exit();
 			return;

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 17:20:03 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1F60D9BB;
 Wed, 18 Jun 2014 17:20:03 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0CBE22B3D;
 Wed, 18 Jun 2014 17:20:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5IHK27v061358;
 Wed, 18 Jun 2014 17:20:02 GMT (envelope-from neel@svn.freebsd.org)
Received: (from neel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5IHK2Cd061357;
 Wed, 18 Jun 2014 17:20:02 GMT (envelope-from neel@svn.freebsd.org)
Message-Id: <201406181720.s5IHK2Cd061357@svn.freebsd.org>
From: Neel Natu 
Date: Wed, 18 Jun 2014 17:20:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267611 - head/usr.sbin/bhyve
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 17:20:03 -0000

Author: neel
Date: Wed Jun 18 17:20:02 2014
New Revision: 267611
URL: http://svnweb.freebsd.org/changeset/base/267611

Log:
  Fix typo and rename macro KDB_SYS_FLAG to KBD_SYS_FLAG.
  
  Reviewed by:	tychon

Modified:
  head/usr.sbin/bhyve/atkbdc.c

Modified: head/usr.sbin/bhyve/atkbdc.c
==============================================================================
--- head/usr.sbin/bhyve/atkbdc.c	Wed Jun 18 17:13:18 2014	(r267610)
+++ head/usr.sbin/bhyve/atkbdc.c	Wed Jun 18 17:20:02 2014	(r267611)
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
 #define	KBD_DATA_PORT		0x60
 
 #define	KBD_STS_CTL_PORT	0x64
-#define	 KDB_SYS_FLAG		0x4
+#define	 KBD_SYS_FLAG		0x4
 
 #define	KBDC_RESET		0xfe
 
@@ -66,7 +66,7 @@ atkbdc_sts_ctl_handler(struct vmctx *ctx
 
 	retval = INOUT_OK;
 	if (in) {
-		*eax = KDB_SYS_FLAG;	/* system passed POST */
+		*eax = KBD_SYS_FLAG;	/* system passed POST */
 	} else {
 		switch (*eax) {
 		case KBDC_RESET:	/* Pulse "reset" line. */

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 17:21:39 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 82E8AB21;
 Wed, 18 Jun 2014 17:21:39 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 561E72BBF;
 Wed, 18 Jun 2014 17:21:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5IHLdvU062866;
 Wed, 18 Jun 2014 17:21:39 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5IHLdUo062865;
 Wed, 18 Jun 2014 17:21:39 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201406181721.s5IHLdUo062865@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Wed, 18 Jun 2014 17:21:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267612 - head/usr.sbin/iscsid
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 17:21:39 -0000

Author: trasz
Date: Wed Jun 18 17:21:38 2014
New Revision: 267612
URL: http://svnweb.freebsd.org/changeset/base/267612

Log:
  Get rid of unneccessary argument.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/usr.sbin/iscsid/login.c

Modified: head/usr.sbin/iscsid/login.c
==============================================================================
--- head/usr.sbin/iscsid/login.c	Wed Jun 18 17:20:02 2014	(r267611)
+++ head/usr.sbin/iscsid/login.c	Wed Jun 18 17:21:38 2014	(r267612)
@@ -159,11 +159,12 @@ login_target_error_str(int class, int de
 }
 
 static struct pdu *
-login_receive(struct connection *conn, bool initial)
+login_receive(struct connection *conn)
 {
 	struct pdu *response;
 	struct iscsi_bhs_login_response *bhslr;
 	const char *errorstr;
+	static bool initial = true;
 
 	response = pdu_new(conn);
 	pdu_receive(response);
@@ -201,6 +202,8 @@ login_receive(struct connection *conn, b
 	}
 	conn->conn_statsn = ntohl(bhslr->bhslr_statsn);
 
+	initial = false;
+
 	return (response);
 }
 
@@ -550,7 +553,7 @@ login_negotiate(struct connection *conn)
 	pdu_delete(request);
 	request = NULL;
 
-	response = login_receive(conn, false);
+	response = login_receive(conn);
 	response_keys = keys_new();
 	keys_load(response_keys, response);
 	for (i = 0; i < KEYS_MAX; i++) {
@@ -742,7 +745,7 @@ login_chap(struct connection *conn)
 	login_send_chap_a(conn);
 
 	log_debugx("waiting for CHAP_A/CHAP_C/CHAP_I");
-	response = login_receive(conn, false);
+	response = login_receive(conn);
 
 	log_debugx("sending CHAP_N/CHAP_R");
 	login_send_chap_r(response);
@@ -753,7 +756,7 @@ login_chap(struct connection *conn)
 	 */
 
 	log_debugx("waiting for CHAP result");
-	response = login_receive(conn, false);
+	response = login_receive(conn);
 	if (conn->conn_conf.isc_mutual_user[0] != '\0')
 		login_verify_mutual(response);
 	pdu_delete(response);
@@ -831,7 +834,7 @@ login(struct connection *conn)
 	pdu_send(request);
 	pdu_delete(request);
 
-	response = login_receive(conn, true);
+	response = login_receive(conn);
 
 	response_keys = keys_new();
 	keys_load(response_keys, response);

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 17:35:41 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7AD0FE15;
 Wed, 18 Jun 2014 17:35:41 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5B9CC2CD0;
 Wed, 18 Jun 2014 17:35:41 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5IHZfl1069475;
 Wed, 18 Jun 2014 17:35:41 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5IHZeOg069471;
 Wed, 18 Jun 2014 17:35:40 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201406181735.s5IHZeOg069471@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Wed, 18 Jun 2014 17:35:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267613 - in head: sys/dev/iscsi usr.sbin/iscsid
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 17:35:41 -0000

Author: trasz
Date: Wed Jun 18 17:35:40 2014
New Revision: 267613
URL: http://svnweb.freebsd.org/changeset/base/267613

Log:
  Implement redirection handling in initiator.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/dev/iscsi/iscsi.c
  head/sys/dev/iscsi/iscsi_ioctl.h
  head/usr.sbin/iscsid/iscsid.c
  head/usr.sbin/iscsid/login.c

Modified: head/sys/dev/iscsi/iscsi.c
==============================================================================
--- head/sys/dev/iscsi/iscsi.c	Wed Jun 18 17:21:38 2014	(r267612)
+++ head/sys/dev/iscsi/iscsi.c	Wed Jun 18 17:35:40 2014	(r267613)
@@ -1589,6 +1589,33 @@ iscsi_sanitize_session_conf(struct iscsi
 	isc->isc_mutual_secret[ISCSI_SECRET_LEN - 1] = '\0';
 }
 
+static bool
+iscsi_valid_session_conf(const struct iscsi_session_conf *isc)
+{
+
+	if (isc->isc_initiator[0] == '\0') {
+		ISCSI_DEBUG("empty isc_initiator");
+		return (false);
+	}
+
+	if (isc->isc_target_addr[0] == '\0') {
+		ISCSI_DEBUG("empty isc_target_addr");
+		return (false);
+	}
+
+	if (isc->isc_discovery != 0 && isc->isc_target[0] != 0) {
+		ISCSI_DEBUG("non-empty isc_target for discovery session");
+		return (false);
+	}
+
+	if (isc->isc_discovery == 0 && isc->isc_target[0] == 0) {
+		ISCSI_DEBUG("empty isc_target for non-discovery session");
+		return (false);
+	}
+
+	return (true);
+}
+
 static int
 iscsi_ioctl_session_add(struct iscsi_softc *sc, struct iscsi_session_add *isa)
 {
@@ -1597,22 +1624,12 @@ iscsi_ioctl_session_add(struct iscsi_sof
 	int error;
 
 	iscsi_sanitize_session_conf(&isa->isa_conf);
+	if (iscsi_valid_session_conf(&isa->isa_conf) == false)
+		return (EINVAL);
 
 	is = malloc(sizeof(*is), M_ISCSI, M_ZERO | M_WAITOK);
 	memcpy(&is->is_conf, &isa->isa_conf, sizeof(is->is_conf));
 
-	if (is->is_conf.isc_initiator[0] == '\0' ||
-	    is->is_conf.isc_target_addr[0] == '\0') {
-		free(is, M_ISCSI);
-		return (EINVAL);
-	}
-
-	if ((is->is_conf.isc_discovery != 0 && is->is_conf.isc_target[0] != 0) ||
-	    (is->is_conf.isc_discovery == 0 && is->is_conf.isc_target[0] == 0)) {
-		free(is, M_ISCSI);
-		return (EINVAL);
-	}
-
 	sx_xlock(&sc->sc_lock);
 
 	/*
@@ -1769,7 +1786,38 @@ iscsi_ioctl_session_list(struct iscsi_so
 
 	return (0);
 }
-	
+
+static int
+iscsi_ioctl_session_modify(struct iscsi_softc *sc,
+    struct iscsi_session_modify *ism)
+{
+	struct iscsi_session *is;
+
+	iscsi_sanitize_session_conf(&ism->ism_conf);
+	if (iscsi_valid_session_conf(&ism->ism_conf) == false)
+		return (EINVAL);
+
+	sx_xlock(&sc->sc_lock);
+	TAILQ_FOREACH(is, &sc->sc_sessions, is_next) {
+		ISCSI_SESSION_LOCK(is);
+		if (is->is_id == ism->ism_session_id)
+			break;
+		ISCSI_SESSION_UNLOCK(is);
+	}
+	if (is == NULL) {
+		sx_xunlock(&sc->sc_lock);
+		return (ESRCH);
+	}
+	sx_xunlock(&sc->sc_lock);
+
+	memcpy(&is->is_conf, &ism->ism_conf, sizeof(is->is_conf));
+	ISCSI_SESSION_UNLOCK(is);
+
+	iscsi_session_reconnect(is);
+
+	return (0);
+}
+
 static int
 iscsi_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int mode,
     struct thread *td)
@@ -1808,6 +1856,9 @@ iscsi_ioctl(struct cdev *dev, u_long cmd
 	case ISCSISLIST:
 		return (iscsi_ioctl_session_list(sc,
 		    (struct iscsi_session_list *)arg));
+	case ISCSISMODIFY:
+		return (iscsi_ioctl_session_modify(sc,
+		    (struct iscsi_session_modify *)arg));
 	default:
 		return (EINVAL);
 	}

Modified: head/sys/dev/iscsi/iscsi_ioctl.h
==============================================================================
--- head/sys/dev/iscsi/iscsi_ioctl.h	Wed Jun 18 17:21:38 2014	(r267612)
+++ head/sys/dev/iscsi/iscsi_ioctl.h	Wed Jun 18 17:35:40 2014	(r267613)
@@ -202,8 +202,15 @@ struct iscsi_session_list {
 	int				isl_spare[4];
 };
 
+struct iscsi_session_modify {
+	unsigned int			ism_session_id;
+	struct iscsi_session_conf	ism_conf;
+	int				ism_spare[4];
+};
+
 #define	ISCSISADD	_IOW('I', 0x11, struct iscsi_session_add)
 #define	ISCSISREMOVE	_IOW('I', 0x12, struct iscsi_session_remove)
 #define	ISCSISLIST	_IOWR('I', 0x13, struct iscsi_session_list)
+#define	ISCSISMODIFY	_IOWR('I', 0x14, struct iscsi_session_modify)
 
 #endif /* !ISCSI_IOCTL_H */

Modified: head/usr.sbin/iscsid/iscsid.c
==============================================================================
--- head/usr.sbin/iscsid/iscsid.c	Wed Jun 18 17:21:38 2014	(r267612)
+++ head/usr.sbin/iscsid/iscsid.c	Wed Jun 18 17:35:40 2014	(r267613)
@@ -304,10 +304,10 @@ capsicate(struct connection *conn)
 	cap_rights_t rights;
 #ifdef ICL_KERNEL_PROXY
 	const unsigned long cmds[] = { ISCSIDCONNECT, ISCSIDSEND, ISCSIDRECEIVE,
-	    ISCSIDHANDOFF, ISCSIDFAIL, ISCSISADD, ISCSISREMOVE };
+	    ISCSIDHANDOFF, ISCSIDFAIL, ISCSISADD, ISCSISREMOVE, ISCSISMODIFY };
 #else
 	const unsigned long cmds[] = { ISCSIDHANDOFF, ISCSIDFAIL, ISCSISADD,
-	    ISCSISREMOVE };
+	    ISCSISREMOVE, ISCSISMODIFY };
 #endif
 
 	cap_rights_init(&rights, CAP_IOCTL);

Modified: head/usr.sbin/iscsid/login.c
==============================================================================
--- head/usr.sbin/iscsid/login.c	Wed Jun 18 17:21:38 2014	(r267612)
+++ head/usr.sbin/iscsid/login.c	Wed Jun 18 17:35:40 2014	(r267613)
@@ -30,6 +30,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -158,6 +159,60 @@ login_target_error_str(int class, int de
 	}
 }
 
+static void
+kernel_modify(const struct connection *conn, const char *target_address)
+{
+	struct iscsi_session_modify ism;
+	int error;
+
+	memset(&ism, 0, sizeof(ism));
+	ism.ism_session_id = conn->conn_session_id;
+	memcpy(&ism.ism_conf, &conn->conn_conf, sizeof(ism.ism_conf));
+	strlcpy(ism.ism_conf.isc_target_addr, target_address,
+	    sizeof(ism.ism_conf.isc_target));
+	error = ioctl(conn->conn_iscsi_fd, ISCSISMODIFY, &ism);
+	if (error != 0) {
+		log_err(1, "failed to redirect to %s: ISCSISMODIFY",
+		    target_address);
+	}
+}
+
+/*
+ * XXX:	The way it works is suboptimal; what should happen is described
+ *	in draft-gilligan-iscsi-fault-tolerance-00.  That, however, would
+ *	be much more complicated: we would need to keep "dependencies"
+ *	for sessions, so that, in case described in draft and using draft
+ *	terminology, we would have three sessions: one for discovery,
+ *	one for initial target portal, and one for redirect portal.  
+ *	This would allow us to "backtrack" on connection failure,
+ *	as described in draft.
+ */
+static void
+login_handle_redirection(struct connection *conn, struct pdu *response)
+{
+	struct iscsi_bhs_login_response *bhslr;
+	struct keys *response_keys;
+	const char *target_address;
+
+	bhslr = (struct iscsi_bhs_login_response *)response->pdu_bhs;
+	assert (bhslr->bhslr_status_class == 1);
+
+	response_keys = keys_new();
+	keys_load(response_keys, response);
+
+	target_address = keys_find(response_keys, "TargetAddress");
+	if (target_address == NULL)
+		log_errx(1, "received redirection without TargetAddress");
+	if (target_address[0] == '\0')
+		log_errx(1, "received redirection with empty TargetAddress");
+	if (strlen(target_address) >=
+	    sizeof(conn->conn_conf.isc_target_addr) - 1)
+		log_errx(1, "received TargetAddress is too long");
+
+	log_debugx("received redirection to \"%s\"", target_address);
+	kernel_modify(conn, target_address);
+}
+
 static struct pdu *
 login_receive(struct connection *conn)
 {
@@ -184,6 +239,11 @@ login_receive(struct connection *conn)
 	if (bhslr->bhslr_version_active != 0x00)
 		log_errx(1, "received Login PDU with unsupported "
 		    "Version-active 0x%x", bhslr->bhslr_version_active);
+	if (bhslr->bhslr_status_class == 1) {
+		login_handle_redirection(conn, response);
+		log_debugx("redirection handled; exiting");
+		exit(0);
+	}
 	if (bhslr->bhslr_status_class != 0) {
 		errorstr = login_target_error_str(bhslr->bhslr_status_class,
 		    bhslr->bhslr_status_detail);

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 17:46:35 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A7F49130;
 Wed, 18 Jun 2014 17:46:35 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9412D2DCD;
 Wed, 18 Jun 2014 17:46:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5IHkZMD073840;
 Wed, 18 Jun 2014 17:46:35 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5IHkZL4073838;
 Wed, 18 Jun 2014 17:46:35 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201406181746.s5IHkZL4073838@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Wed, 18 Jun 2014 17:46:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267614 - head/usr.bin/iscsictl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 17:46:35 -0000

Author: trasz
Date: Wed Jun 18 17:46:34 2014
New Revision: 267614
URL: http://svnweb.freebsd.org/changeset/base/267614

Log:
  Add "iscsictl -M", which allows one to change session parameters
  without removing it and adding back.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/usr.bin/iscsictl/iscsictl.8
  head/usr.bin/iscsictl/iscsictl.c

Modified: head/usr.bin/iscsictl/iscsictl.8
==============================================================================
--- head/usr.bin/iscsictl/iscsictl.8	Wed Jun 18 17:35:40 2014	(r267613)
+++ head/usr.bin/iscsictl/iscsictl.8	Wed Jun 18 17:46:34 2014	(r267614)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 24, 2014
+.Dd June 18, 2014
 .Dt ISCSICTL 8
 .Os
 .Sh NAME
@@ -47,6 +47,17 @@
 .Fl A
 .Fl n Ar nickname Op Fl c Ar path
 .Nm
+.Fl M
+.Fl i Ar session-id
+.Op Fl p Ar portal
+.Op Fl t Ar target
+.Op Fl u Ar user
+.Op Fl s Ar secret
+.Nm
+.Fl M
+.Fl i Ar session-id
+.Op Fl n Ar nickname Op Fl c Ar path
+.Nm
 .Fl R
 .Op Fl p Ar portal
 .Op Fl t Ar target
@@ -68,6 +79,8 @@ The following options are available:
 .Bl -tag -width ".Fl A"
 .It Fl A
 Add session.
+.It Fl M
+Modify session.
 .It Fl R
 Remove session.
 .It Fl L
@@ -84,6 +97,10 @@ Target host name or address used for Sen
 When used, it will add a temporary discovery session.
 After discovery is done, sessions will be added for each discovered target,
 and the temporary discovery sesion will be removed.
+.It Fl i
+Session ID, as displayed by
+.Nm
+.Fl v .
 .It Fl n
 The "nickname" of session defined in the configuration file.
 .It Fl p

Modified: head/usr.bin/iscsictl/iscsictl.c
==============================================================================
--- head/usr.bin/iscsictl/iscsictl.c	Wed Jun 18 17:35:40 2014	(r267613)
+++ head/usr.bin/iscsictl/iscsictl.c	Wed Jun 18 17:46:34 2014	(r267614)
@@ -350,6 +350,82 @@ kernel_add(int iscsi_fd, const struct ta
 }
 
 static int
+kernel_modify(int iscsi_fd, unsigned int session_id, const struct target *targ)
+{
+	struct iscsi_session_modify ism;
+	int error;
+
+	memset(&ism, 0, sizeof(ism));
+	ism.ism_session_id = session_id;
+	conf_from_target(&ism.ism_conf, targ);
+	error = ioctl(iscsi_fd, ISCSISMODIFY, &ism);
+	if (error != 0)
+		warn("ISCSISMODIFY");
+	return (error);
+}
+
+static void
+kernel_modify_some(int iscsi_fd, unsigned int session_id, const char *target,
+  const char *target_addr, const char *user, const char *secret)
+{
+	struct iscsi_session_state *states = NULL;
+	struct iscsi_session_state *state;
+	struct iscsi_session_conf *conf;
+	struct iscsi_session_list isl;
+	struct iscsi_session_modify ism;
+	unsigned int i, nentries = 1;
+	int error;
+
+	for (;;) {
+		states = realloc(states,
+		    nentries * sizeof(struct iscsi_session_state));
+		if (states == NULL)
+			err(1, "realloc");
+
+		memset(&isl, 0, sizeof(isl));
+		isl.isl_nentries = nentries;
+		isl.isl_pstates = states;
+
+		error = ioctl(iscsi_fd, ISCSISLIST, &isl);
+		if (error != 0 && errno == EMSGSIZE) {
+			nentries *= 4;
+			continue;
+		}
+		break;
+	}
+	if (error != 0)
+		errx(1, "ISCSISLIST");
+
+	for (i = 0; i < isl.isl_nentries; i++) {
+		state = &states[i];
+
+		if (state->iss_id == session_id)
+			break;
+	}
+	if (i == isl.isl_nentries)
+		errx(1, "session-id %u not found", session_id);
+
+	conf = &state->iss_conf;
+
+	if (target != NULL)
+		strlcpy(conf->isc_target, target, sizeof(conf->isc_target));
+	if (target_addr != NULL)
+		strlcpy(conf->isc_target_addr, target_addr,
+		    sizeof(conf->isc_target_addr));
+	if (user != NULL)
+		strlcpy(conf->isc_user, user, sizeof(conf->isc_user));
+	if (secret != NULL)
+		strlcpy(conf->isc_secret, secret, sizeof(conf->isc_secret));
+
+	memset(&ism, 0, sizeof(ism));
+	ism.ism_session_id = session_id;
+	memcpy(&ism.ism_conf, conf, sizeof(ism.ism_conf));
+	error = ioctl(iscsi_fd, ISCSISMODIFY, &ism);
+	if (error != 0)
+		warn("ISCSISMODIFY");
+}
+
+static int
 kernel_remove(int iscsi_fd, const struct target *targ)
 {
 	struct iscsi_session_remove isr;
@@ -404,7 +480,7 @@ kernel_list(int iscsi_fd, const struct t
 			state = &states[i];
 			conf = &state->iss_conf;
 
-			printf("Session ID:       %d\n", state->iss_id);
+			printf("Session ID:       %u\n", state->iss_id);
 			printf("Initiator name:   %s\n", conf->isc_initiator);
 			printf("Initiator portal: %s\n",
 			    conf->isc_initiator_addr);
@@ -482,6 +558,10 @@ usage(void)
 	    "[-u user -s secret]\n");
 	fprintf(stderr, "       iscsictl -A -a [-c path]\n");
 	fprintf(stderr, "       iscsictl -A -n nickname [-c path]\n");
+	fprintf(stderr, "       iscsictl -M -i session-id [-p portal] "
+	    "[-t target] [-u user] [-s secret]\n");
+	fprintf(stderr, "       iscsictl -M -i session-id -n nickname "
+	    "[-c path]\n");
 	fprintf(stderr, "       iscsictl -R [-p portal] [-t target]\n");
 	fprintf(stderr, "       iscsictl -R -a\n");
 	fprintf(stderr, "       iscsictl -R -n nickname [-c path]\n");
@@ -503,20 +583,25 @@ checked_strdup(const char *s)
 int
 main(int argc, char **argv)
 {
-	int Aflag = 0, Rflag = 0, Lflag = 0, aflag = 0, vflag = 0;
+	int Aflag = 0, Mflag = 0, Rflag = 0, Lflag = 0, aflag = 0, vflag = 0;
 	const char *conf_path = DEFAULT_CONFIG_PATH;
 	char *nickname = NULL, *discovery_host = NULL, *host = NULL,
 	     *target = NULL, *user = NULL, *secret = NULL;
+	long long session_id = -1;
+	char *end;
 	int ch, error, iscsi_fd, retval, saved_errno;
 	int failed = 0;
 	struct conf *conf;
 	struct target *targ;
 
-	while ((ch = getopt(argc, argv, "ARLac:d:n:p:t:u:s:v")) != -1) {
+	while ((ch = getopt(argc, argv, "AMRLac:d:i:n:p:t:u:s:v")) != -1) {
 		switch (ch) {
 		case 'A':
 			Aflag = 1;
 			break;
+		case 'M':
+			Mflag = 1;
+			break;
 		case 'R':
 			Rflag = 1;
 			break;
@@ -532,6 +617,16 @@ main(int argc, char **argv)
 		case 'd':
 			discovery_host = optarg;
 			break;
+		case 'i':
+			session_id = strtol(optarg, &end, 10);
+			if ((size_t)(end - optarg) != strlen(optarg))
+				errx(1, "trailing characters after session-id");
+			if (session_id < 0)
+				errx(1, "session-id cannot be negative");
+			if (session_id > UINT_MAX)
+				errx(1, "session-id cannot be greater than %u",
+				    UINT_MAX);
+			break;
 		case 'n':
 			nickname = optarg;
 			break;
@@ -559,10 +654,10 @@ main(int argc, char **argv)
 	if (argc != 0)
 		usage();
 
-	if (Aflag + Rflag + Lflag == 0)
+	if (Aflag + Mflag + Rflag + Lflag == 0)
 		Lflag = 1;
-	if (Aflag + Rflag + Lflag > 1)
-		errx(1, "at most one of -A, -R, or -L may be specified");
+	if (Aflag + Mflag + Rflag + Lflag > 1)
+		errx(1, "at most one of -A, -M, -R, or -L may be specified");
 
 	/*
 	 * Note that we ignore unneccessary/inapplicable "-c" flag; so that
@@ -614,9 +709,33 @@ main(int argc, char **argv)
 		if (secret != NULL && user == NULL)
 			errx(1, "-s must always be used with -u");
 
+		if (session_id != -1)
+			errx(1, "-i cannot be used with -A");
 		if (vflag != 0)
 			errx(1, "-v cannot be used with -A");
 
+	} else if (Mflag != 0) {
+		if (session_id == -1)
+			errx(1, "-M requires -i");
+
+		if (discovery_host != NULL)
+			errx(1, "-M and -d are mutually exclusive");
+		if (aflag != 0)
+			errx(1, "-M and -a are mutually exclusive");
+		if (nickname != NULL) {
+			if (host != NULL)
+				errx(1, "-n and -p and mutually exclusive");
+			if (target != NULL)
+				errx(1, "-n and -t and mutually exclusive");
+			if (user != NULL)
+				errx(1, "-n and -u and mutually exclusive");
+			if (secret != NULL)
+				errx(1, "-n and -s and mutually exclusive");
+		}
+
+		if (vflag != 0)
+			errx(1, "-v cannot be used with -M");
+
 	} else if (Rflag != 0) {
 		if (user != NULL)
 			errx(1, "-R and -u are mutually exclusive");
@@ -646,6 +765,8 @@ main(int argc, char **argv)
 		} else
 			errx(1, "must specify either -a, -n, -t, or -p");
 
+		if (session_id != -1)
+			errx(1, "-i cannot be used with -R");
 		if (vflag != 0)
 			errx(1, "-v cannot be used with -R");
 
@@ -664,6 +785,9 @@ main(int argc, char **argv)
 			errx(1, "-L and -n and mutually exclusive");
 		if (discovery_host != NULL)
 			errx(1, "-L and -d and mutually exclusive");
+
+		if (session_id != -1)
+			errx(1, "-i cannot be used with -L");
 	}
 
 	iscsi_fd = open(ISCSI_PATH, O_RDWR);
@@ -687,15 +811,20 @@ main(int argc, char **argv)
 		conf = conf_new_from_file(conf_path);
 		targ = target_find(conf, nickname);
 		if (targ == NULL)
-			errx(1, "target %s not found in the configuration file",
-			    nickname);
+			errx(1, "target %s not found in %s",
+			    nickname, conf_path);
 
 		if (Aflag != 0)
 			failed += kernel_add(iscsi_fd, targ);
+		else if (Mflag != 0)
+			failed += kernel_modify(iscsi_fd, session_id, targ);
 		else if (Rflag != 0)
 			failed += kernel_remove(iscsi_fd, targ);
 		else
 			failed += kernel_list(iscsi_fd, targ, vflag);
+	} else if (Mflag != 0) {
+		kernel_modify_some(iscsi_fd, session_id, target, host,
+		    user, secret);
 	} else {
 		if (Aflag != 0 && target != NULL) {
 			if (valid_iscsi_name(target) == false)

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 17:48:30 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D21912C8;
 Wed, 18 Jun 2014 17:48:30 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BF0A42DEF;
 Wed, 18 Jun 2014 17:48:30 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5IHmUqO074125;
 Wed, 18 Jun 2014 17:48:30 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5IHmU2a074124;
 Wed, 18 Jun 2014 17:48:30 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201406181748.s5IHmU2a074124@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Wed, 18 Jun 2014 17:48:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267615 - head/usr.bin/iscsictl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 17:48:30 -0000

Author: trasz
Date: Wed Jun 18 17:48:30 2014
New Revision: 267615
URL: http://svnweb.freebsd.org/changeset/base/267615

Log:
  Rename a variable; no functional changes.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/usr.bin/iscsictl/iscsictl.c

Modified: head/usr.bin/iscsictl/iscsictl.c
==============================================================================
--- head/usr.bin/iscsictl/iscsictl.c	Wed Jun 18 17:46:34 2014	(r267614)
+++ head/usr.bin/iscsictl/iscsictl.c	Wed Jun 18 17:48:30 2014	(r267615)
@@ -585,7 +585,7 @@ main(int argc, char **argv)
 {
 	int Aflag = 0, Mflag = 0, Rflag = 0, Lflag = 0, aflag = 0, vflag = 0;
 	const char *conf_path = DEFAULT_CONFIG_PATH;
-	char *nickname = NULL, *discovery_host = NULL, *host = NULL,
+	char *nickname = NULL, *discovery_host = NULL, *portal = NULL,
 	     *target = NULL, *user = NULL, *secret = NULL;
 	long long session_id = -1;
 	char *end;
@@ -631,7 +631,7 @@ main(int argc, char **argv)
 			nickname = optarg;
 			break;
 		case 'p':
-			host = optarg;
+			portal = optarg;
 			break;
 		case 't':
 			target = optarg;
@@ -666,7 +666,7 @@ main(int argc, char **argv)
 	 */
 	if (Aflag != 0) {
 		if (aflag != 0) {
-			if (host != NULL)
+			if (portal != NULL)
 				errx(1, "-a and -p and mutually exclusive");
 			if (target != NULL)
 				errx(1, "-a and -t and mutually exclusive");
@@ -679,7 +679,7 @@ main(int argc, char **argv)
 			if (discovery_host != NULL)
 				errx(1, "-a and -d and mutually exclusive");
 		} else if (nickname != NULL) {
-			if (host != NULL)
+			if (portal != NULL)
 				errx(1, "-n and -p and mutually exclusive");
 			if (target != NULL)
 				errx(1, "-n and -t and mutually exclusive");
@@ -690,17 +690,17 @@ main(int argc, char **argv)
 			if (discovery_host != NULL)
 				errx(1, "-n and -d and mutually exclusive");
 		} else if (discovery_host != NULL) {
-			if (host != NULL)
+			if (portal != NULL)
 				errx(1, "-d and -p and mutually exclusive");
 			if (target != NULL)
 				errx(1, "-d and -t and mutually exclusive");
 		} else {
-			if (target == NULL && host == NULL)
+			if (target == NULL && portal == NULL)
 				errx(1, "must specify -a, -n or -t/-p");
 
-			if (target != NULL && host == NULL)
+			if (target != NULL && portal == NULL)
 				errx(1, "-t must always be used with -p");
-			if (host != NULL && target == NULL)
+			if (portal != NULL && target == NULL)
 				errx(1, "-p must always be used with -t");
 		}
 
@@ -723,7 +723,7 @@ main(int argc, char **argv)
 		if (aflag != 0)
 			errx(1, "-M and -a are mutually exclusive");
 		if (nickname != NULL) {
-			if (host != NULL)
+			if (portal != NULL)
 				errx(1, "-n and -p and mutually exclusive");
 			if (target != NULL)
 				errx(1, "-n and -t and mutually exclusive");
@@ -745,22 +745,22 @@ main(int argc, char **argv)
 			errx(1, "-R and -d are mutually exclusive");
 
 		if (aflag != 0) {
-			if (host != NULL)
+			if (portal != NULL)
 				errx(1, "-a and -p and mutually exclusive");
 			if (target != NULL)
 				errx(1, "-a and -t and mutually exclusive");
 			if (nickname != NULL)
 				errx(1, "-a and -n and mutually exclusive");
 		} else if (nickname != NULL) {
-			if (host != NULL)
+			if (portal != NULL)
 				errx(1, "-n and -p and mutually exclusive");
 			if (target != NULL)
 				errx(1, "-n and -t and mutually exclusive");
-		} else if (host != NULL) {
+		} else if (portal != NULL) {
 			if (target != NULL)
 				errx(1, "-p and -t and mutually exclusive");
 		} else if (target != NULL) {
-			if (host != NULL)
+			if (portal != NULL)
 				errx(1, "-t and -p and mutually exclusive");
 		} else
 			errx(1, "must specify either -a, -n, -t, or -p");
@@ -773,7 +773,7 @@ main(int argc, char **argv)
 	} else {
 		assert(Lflag != 0);
 
-		if (host != NULL)
+		if (portal != NULL)
 			errx(1, "-L and -p and mutually exclusive");
 		if (target != NULL)
 			errx(1, "-L and -t and mutually exclusive");
@@ -823,7 +823,7 @@ main(int argc, char **argv)
 		else
 			failed += kernel_list(iscsi_fd, targ, vflag);
 	} else if (Mflag != 0) {
-		kernel_modify_some(iscsi_fd, session_id, target, host,
+		kernel_modify_some(iscsi_fd, session_id, target, portal,
 		    user, secret);
 	} else {
 		if (Aflag != 0 && target != NULL) {
@@ -841,7 +841,7 @@ main(int argc, char **argv)
 			targ->t_address = discovery_host;
 		} else {
 			targ->t_session_type = SESSION_TYPE_NORMAL;
-			targ->t_address = host;
+			targ->t_address = portal;
 		}
 		targ->t_user = user;
 		targ->t_secret = secret;

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 18:07:20 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 059A9835;
 Wed, 18 Jun 2014 18:07:20 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E5DE82FC5;
 Wed, 18 Jun 2014 18:07:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5II7Ju4083440;
 Wed, 18 Jun 2014 18:07:19 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5II7Jde083439;
 Wed, 18 Jun 2014 18:07:19 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201406181807.s5II7Jde083439@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Wed, 18 Jun 2014 18:07:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267616 - head/lib/libc/net
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 18:07:20 -0000

Author: ume
Date: Wed Jun 18 18:07:19 2014
New Revision: 267616
URL: http://svnweb.freebsd.org/changeset/base/267616

Log:
  Retooling addrconfig() to exclude addresses on loopback interfaces
  when looking for configured addresses.
  This change is based upon the code from the submitter, and made
  following changes:
  - Exclude addresses assigned on interfaces which are down, like NetBSD
    does.
  - Exclude addresses assigned on interfaces which are ifdisabled.
  
  PR:		190824
  Submitted by:	Justin McOmie
  MFC after:	1 week

Modified:
  head/lib/libc/net/getaddrinfo.c

Modified: head/lib/libc/net/getaddrinfo.c
==============================================================================
--- head/lib/libc/net/getaddrinfo.c	Wed Jun 18 17:48:30 2014	(r267615)
+++ head/lib/libc/net/getaddrinfo.c	Wed Jun 18 18:07:19 2014	(r267616)
@@ -62,12 +62,15 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #ifdef INET6
 #include 
 #include 
 #include 
-#include 	/* XXX */
+#include 
+#include 
 #endif
 #include 
 #include 
@@ -245,6 +248,9 @@ static int get_portmatch(const struct ad
 static int get_port(struct addrinfo *, const char *, int);
 static const struct afd *find_afd(int);
 static int addrconfig(struct addrinfo *);
+#ifdef INET6
+static int is_ifdisabled(char *);
+#endif
 static void set_source(struct ai_order *, struct policyhead *);
 static int comp_dst(const void *, const void *);
 #ifdef INET6
@@ -1525,10 +1531,11 @@ find_afd(int af)
 }
 
 /*
- * post-2553: AI_ADDRCONFIG check.  if we use getipnodeby* as backend, backend
- * will take care of it.
- * the semantics of AI_ADDRCONFIG is not defined well.  we are not sure
- * if the code is right or not.
+ * post-2553: AI_ADDRCONFIG check.  Determines which address families are
+ * configured on the local system and correlates with pai->ai_family value.
+ * If an address family is not configured on the system, it will not be
+ * queried for.  For this purpose, loopback addresses are not considered
+ * configured addresses.
  *
  * XXX PF_UNSPEC -> PF_INET6 + PF_INET mapping needs to be in sync with
  * _dns_getaddrinfo.
@@ -1536,38 +1543,64 @@ find_afd(int af)
 static int
 addrconfig(struct addrinfo *pai)
 {
-	int s, af;
+	struct ifaddrs *ifaddrs, *ifa;
+	int seen_inet = 0, seen_inet6 = 0;
 
-	/*
-	 * TODO:
-	 * Note that implementation dependent test for address
-	 * configuration should be done everytime called
-	 * (or apropriate interval),
-	 * because addresses will be dynamically assigned or deleted.
-	 */
-	af = pai->ai_family;
-	if (af == AF_UNSPEC) {
-		if ((s = _socket(AF_INET6, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0)
-			af = AF_INET;
-		else {
-			_close(s);
-			if ((s = _socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC,
-			    0)) < 0)
-				af = AF_INET6;
-			else
-				_close(s);
+	if (getifaddrs(&ifaddrs) != 0)
+		return 0;
+
+	for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) {
+		if (ifa->ifa_addr == NULL || (ifa->ifa_flags & IFF_UP) == 0)
+			continue;
+		if ((ifa->ifa_flags & IFT_LOOP) != 0)
+			continue;
+		switch (ifa->ifa_addr->sa_family) {
+		case AF_INET:
+			seen_inet = 1;
+			break;
+#ifdef INET6
+		case AF_INET6:
+			if (!seen_inet6 && !is_ifdisabled(ifa->ifa_name))
+				seen_inet6 = 1;
+			break;
+#endif
 		}
 	}
-	if (af != AF_UNSPEC) {
-		if ((s = _socket(af, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0)
-			return 0;
-		_close(s);
+	freeifaddrs(ifaddrs);
+
+	switch(pai->ai_family) {
+	case AF_INET6:
+		return seen_inet6;
+	case AF_INET:
+		return seen_inet;
+	case AF_UNSPEC:
+		if (seen_inet == seen_inet6)
+			return seen_inet;
+		pai->ai_family = seen_inet ? AF_INET : AF_INET6;
+		return 1;
 	}
-	pai->ai_family = af;
 	return 1;
 }
 
 #ifdef INET6
+static int
+is_ifdisabled(char *name)
+{
+	struct in6_ndireq nd;
+	int fd;
+
+	if ((fd = _socket(AF_INET6, SOCK_DGRAM, 0)) < 0)
+		return -1;
+	memset(&nd, 0, sizeof(nd));
+	strlcpy(nd.ifname, name, sizeof(nd.ifname));
+	if (_ioctl(fd, SIOCGIFINFO_IN6, &nd) < 0) {
+		_close(fd);
+		return -1;
+	}
+	_close(fd);
+	return ((nd.ndi.flags & ND6_IFF_IFDISABLED) != 0);
+}
+
 /* convert a string to a scope identifier. XXX: IPv6 specific */
 static int
 ip6_str2scopeid(char *scope, struct sockaddr_in6 *sin6, u_int32_t *scopeid)

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 18:27:17 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 93985FC7;
 Wed, 18 Jun 2014 18:27:17 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 671572210;
 Wed, 18 Jun 2014 18:27:17 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5IIRHGR093002;
 Wed, 18 Jun 2014 18:27:17 GMT (envelope-from wblock@svn.freebsd.org)
Received: (from wblock@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5IIRHMM093001;
 Wed, 18 Jun 2014 18:27:17 GMT (envelope-from wblock@svn.freebsd.org)
Message-Id: <201406181827.s5IIRHMM093001@svn.freebsd.org>
From: Warren Block 
Date: Wed, 18 Jun 2014 18:27:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267617 - head/sbin/geom/class/eli
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 18:27:17 -0000

Author: wblock (doc committer)
Date: Wed Jun 18 18:27:16 2014
New Revision: 267617
URL: http://svnweb.freebsd.org/changeset/base/267617

Log:
  Fix spelling, typos, missing articles, contractions.  Expanded version
  of patch supplied with PR.
  
  PR:		191001
  Submitted by:	olgeni
  MFC after:	1 week

Modified:
  head/sbin/geom/class/eli/geli.8

Modified: head/sbin/geom/class/eli/geli.8
==============================================================================
--- head/sbin/geom/class/eli/geli.8	Wed Jun 18 18:07:19 2014	(r267616)
+++ head/sbin/geom/class/eli/geli.8	Wed Jun 18 18:27:16 2014	(r267617)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 1, 2013
+.Dd June 18, 2014
 .Dt GELI 8
 .Os
 .Sh NAME
@@ -331,7 +331,7 @@ key length.
 .It Nm AES-XTS
 .Em 128 ,
 256
-.It Nm AES-CBC , Nm Camilla-CBC
+.It Nm AES-CBC , Nm Camellia-CBC
 .Em 128 ,
 192,
 256
@@ -353,13 +353,14 @@ because encryption/decryption which requ
 is done per sector; fewer sectors means less computational work.
 .It Fl V Ar version
 Metadata version to use.
-This option is helpful when creating provider that may be used by older
+This option is helpful when creating a provider that may be used by older
 .Nm FreeBSD/GELI
 versions.
 Consult the
 .Sx HISTORY
 section to find which metadata version is supported by which FreeBSD version.
-Note that using older metadata version may limit numer of features available.
+Note that using an older version of metadata may limit the number of
+features available.
 .El
 .It Cm attach
 Attach the given provider.
@@ -619,7 +620,7 @@ devices.
 .El
 .It Cm resume
 Resume previously suspended device.
-The caller must ensure that executing this subcommand doesn't access the
+The caller must ensure that executing this subcommand does not access the
 suspended device, leading to a deadlock.
 For example suspending a device which contains the file system where the
 .Nm
@@ -823,7 +824,7 @@ Enter passphrase:
 .Pp
 Create an encrypted provider, but use two User Keys:
 one for your employee and one for you as the company's security officer
-(so it's not a tragedy if the employee
+(so it is not a tragedy if the employee
 .Qq accidentally
 forgets his passphrase):
 .Bd -literal -offset indent

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 18:31:35 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 947CA29C;
 Wed, 18 Jun 2014 18:31:35 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 823FD22D0;
 Wed, 18 Jun 2014 18:31:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5IIVZFL096356;
 Wed, 18 Jun 2014 18:31:35 GMT (envelope-from wblock@svn.freebsd.org)
Received: (from wblock@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5IIVZkj096355;
 Wed, 18 Jun 2014 18:31:35 GMT (envelope-from wblock@svn.freebsd.org)
Message-Id: <201406181831.s5IIVZkj096355@svn.freebsd.org>
From: Warren Block 
Date: Wed, 18 Jun 2014 18:31:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267618 - head/lib/libc/stdtime
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 18:31:35 -0000

Author: wblock (doc committer)
Date: Wed Jun 18 18:31:35 2014
New Revision: 267618
URL: http://svnweb.freebsd.org/changeset/base/267618

Log:
  Fix syntax error.
  
  PR:		191131
  Submitted by:	dan.mcgregor@usask.ca
  MFC after:	1 week

Modified:
  head/lib/libc/stdtime/strftime.3

Modified: head/lib/libc/stdtime/strftime.3
==============================================================================
--- head/lib/libc/stdtime/strftime.3	Wed Jun 18 18:27:16 2014	(r267617)
+++ head/lib/libc/stdtime/strftime.3	Wed Jun 18 18:31:35 2014	(r267618)
@@ -248,7 +248,7 @@ function
 conforms to
 .St -isoC
 with a lot of extensions including
-.Ql %C ,
+.Ql \&%C ,
 .Ql \&%D ,
 .Ql %E* ,
 .Ql %e ,

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 22:10:11 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 576709AE;
 Wed, 18 Jun 2014 22:10:11 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 43FCA2619;
 Wed, 18 Jun 2014 22:10:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5IMAB3R097640;
 Wed, 18 Jun 2014 22:10:11 GMT (envelope-from ray@svn.freebsd.org)
Received: (from ray@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5IMAAGe097632;
 Wed, 18 Jun 2014 22:10:10 GMT (envelope-from ray@svn.freebsd.org)
Message-Id: <201406182210.s5IMAAGe097632@svn.freebsd.org>
From: Aleksandr Rybalko 
Date: Wed, 18 Jun 2014 22:10:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267622 - in head/sys: conf dev/vt/hw/vga
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 22:10:11 -0000

Author: ray
Date: Wed Jun 18 22:10:10 2014
New Revision: 267622
URL: http://svnweb.freebsd.org/changeset/base/267622

Log:
  Rename vt(4) vga module to dismiss interference with syscons(4) vga module.
  
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Added:
  head/sys/dev/vt/hw/vga/vt_vga.c
     - copied, changed from r267541, head/sys/dev/vt/hw/vga/vga.c
  head/sys/dev/vt/hw/vga/vt_vga_reg.h
     - copied unchanged from r267541, head/sys/dev/vt/hw/vga/vga_reg.h
Deleted:
  head/sys/dev/vt/hw/vga/vga.c
  head/sys/dev/vt/hw/vga/vga_reg.h
Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Jun 18 22:09:33 2014	(r267621)
+++ head/sys/conf/files	Wed Jun 18 22:10:10 2014	(r267622)
@@ -2526,7 +2526,7 @@ dev/vt/font/vt_font_default.c	optional v
 dev/vt/font/vt_mouse_cursor.c	optional vt
 dev/vt/hw/efifb/efifb.c		optional vt_efifb
 dev/vt/hw/fb/vt_fb.c		optional vt
-dev/vt/hw/vga/vga.c		optional vt vt_vga
+dev/vt/hw/vga/vt_vga.c		optional vt vt_vga
 dev/vt/logo/logo_freebsd.c	optional vt splash
 dev/vt/vt_buf.c			optional vt
 dev/vt/vt_consolectl.c		optional vt

Copied and modified: head/sys/dev/vt/hw/vga/vt_vga.c (from r267541, head/sys/dev/vt/hw/vga/vga.c)
==============================================================================
--- head/sys/dev/vt/hw/vga/vga.c	Mon Jun 16 12:37:10 2014	(r267541, copy source)
+++ head/sys/dev/vt/hw/vga/vt_vga.c	Wed Jun 18 22:10:10 2014	(r267622)
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
+#include 
 
 #include 
 

Copied: head/sys/dev/vt/hw/vga/vt_vga_reg.h (from r267541, head/sys/dev/vt/hw/vga/vga_reg.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/vt/hw/vga/vt_vga_reg.h	Wed Jun 18 22:10:10 2014	(r267622, copy of r267541, head/sys/dev/vt/hw/vga/vga_reg.h)
@@ -0,0 +1,220 @@
+/*-
+ * Copyright (c) 2005 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _DEV_VT_HW_VGA_VGA_REG_H_
+#define	_DEV_VT_HW_VGA_VGA_REG_H_
+
+/*
+ * The VGA adapter uses two I/O port blocks. One of these blocks, the CRT
+ * controller registers, can be located either at 0x3B0 or at 0x3D0 in I/O
+ * port space. This allows compatibility with the monochrome adapter, which
+ * has the CRT controller registers at 0x3B0.
+ *
+ * It is assumed that compatibility with the monochrome adapter is not of
+ * interest anymore. As such, the CRT controller can be located at 0x3D0 in
+ * I/O port space unconditionally. This means that the 2 I/O blocks are
+ * always adjacent and can therefore be treated as a single logical I/O port
+ * range. In practical terms: there only has to be a single tag and handle
+ * to access all registers.
+ *
+ * The following definitions are taken from or inspired by:
+ *   Programmer's Guide to the EGA, VGA, and Super VGA Cards -- 3rd ed.,
+ *     Richard F. Ferraro, Addison-Wesley, ISBN 0-201-62490-7
+ */
+
+#define	VGA_MEM_BASE	0xA0000
+#define	VGA_MEM_SIZE	0x10000
+#define	VGA_REG_BASE	0x3c0
+#define	VGA_REG_SIZE	0x10+0x0c
+
+/* Attribute controller registers. */
+#define	VGA_AC_WRITE		0x00
+#define	VGA_AC_READ		0x01
+#define	VGA_AC_PALETTE(x)		(x)	/* 0 <= x <= 15 */
+#define		VGA_AC_PAL_SR		0x20	/* Secondary red */
+#define		VGA_AC_PAL_SG		0x10	/* Secondary green */
+#define		VGA_AC_PAL_SB		0x08	/* Secondary blue */
+#define		VGA_AC_PAL_R		0x04	/* Red */
+#define		VGA_AC_PAL_G		0x02	/* Green */
+#define		VGA_AC_PAL_B		0x01	/* Blue */
+#define	VGA_AC_MODE_CONTROL		(32+16)
+#define		VGA_AC_MC_IPS		0x80	/* Internal palette size */
+#define		VGA_AC_MC_PCS		0x40	/* Pixel clock select */
+#define		VGA_AC_MC_PPC		0x20	/* Pixel panning compat. */
+#define		VGA_AC_MC_BI		0x08	/* Blink/intensity */
+#define		VGA_AC_MC_ELG		0x04	/* Enable line graphics cc. */
+#define		VGA_AC_MC_DT		0x02	/* Display type */
+#define		VGA_AC_MC_GA		0x01	/* Graphics/alphanumeric */
+#define	VGA_AC_OVERSCAN_COLOR		(32+17)
+#define	VGA_AC_COLOR_PLANE_ENABLE	(32+18)
+#define	VGA_AC_HORIZ_PIXEL_PANNING	(32+19)
+#define	VGA_AC_COLOR_SELECT		(32+20)
+#define		VGA_AC_CS_C67		0x0C	/* Color reg. addr. bits 6+7 */
+#define		VGA_AC_CS_C45		0x03	/* Color reg. addr. bits 4+5 */
+
+/* General registers. */
+#define	VGA_GEN_MISC_OUTPUT_W	0x02		/* Write only. */
+#define	VGA_GEN_MISC_OUTPUT_R	0x0c		/* Read only. */
+#define		VGA_GEN_MO_VSP		0x80	/* Vertical sync. polarity */
+#define		VGA_GEN_MO_HSP		0x40	/* Horiz. sync. polarity */
+#define		VGA_GEN_MO_PB		0x20	/* Page bit for odd/even */
+#define		VGA_GEN_MO_CS		0x0C	/* Clock select */
+#define		VGA_GEN_MO_ER		0x02	/* Enable RAM */
+#define		VGA_GEN_MO_IOA		0x01	/* Input/output address */
+#define	VGA_GEN_INPUT_STAT_0	0x02		/* Read only. */
+#define	VGA_GEN_FEATURE_CTRL_W	0x1a		/* Write only. */
+#define	VGA_GEN_FEATURE_CTRL_R	0x0a		/* Read only. */
+#define	VGA_GEN_INPUT_STAT_1	0x1a		/* Read only. */
+#define		VGA_GEN_IS1_VR		0x08	/* Vertical retrace */
+#define		VGA_GEN_IS1_DE		0x01	/* Display enable not */
+
+/* Sequencer registers. */
+#define	VGA_SEQ_ADDRESS		0x04
+#define	VGA_SEQ_RESET			0
+#define		VGA_SEQ_RST_SR		0x02	/* Synchronous reset */
+#define		VGA_SEQ_RST_NAR		0x01	/* No async. reset */
+#define	VGA_SEQ_CLOCKING_MODE		1
+#define		VGA_SEQ_CM_SO		0x20	/* Screen off */
+#define		VGA_SEQ_CM_S4		0x10	/* Shift four */
+#define		VGA_SEQ_CM_DC		0x08	/* Dot clock */
+#define		VGA_SEQ_CM_SL		0x04	/* Shift load */
+#define		VGA_SEQ_CM_89		0x01	/* 8/9 Dot clocks */
+#define	VGA_SEQ_MAP_MASK		2
+#define		VGA_SEQ_MM_EM3		0x08	/* Enable memory plane 3 */
+#define		VGA_SEQ_MM_EM2		0x04	/* Enable memory plane 2 */
+#define		VGA_SEQ_MM_EM1		0x02	/* Enable memory plane 1 */
+#define		VGA_SEQ_MM_EM0		0x01	/* Enable memory plane 0 */
+#define	VGA_SEQ_CHAR_MAP_SELECT		3
+#define		VGA_SEQ_CMS_SAH		0x20	/* Char. A (bit 2) */
+#define		VGA_SEQ_CMS_SBH		0x10	/* Char. B (bit 2) */
+#define		VGA_SEQ_CMS_SA		0x0C	/* Char. A (bit 0+1) */
+#define		VGA_SEQ_CMS_SB		0x03	/* Char. B (bit 0+1) */
+#define	VGA_SEQ_MEMORY_MODE		4
+#define		VGA_SEQ_MM_C4		0x08	/* Chain four */
+#define		VGA_SEQ_MM_OE		0x04	/* Odd/even */
+#define		VGA_SEQ_MM_EM		0x02	/* Extended memory */
+#define	VGA_SEQ_DATA		0x05
+
+/* Color registers. */
+#define	VGA_PEL_MASK		0x06
+#define	VGA_PEL_ADDR_RD_MODE	0x07		/* Write only. */
+#define	VGA_DAC_STATE		0x07		/* Read only. */
+#define	VGA_PEL_ADDR_WR_MODE	0x08
+#define	VGA_PEL_DATA		0x09
+
+/* Graphics controller registers. */
+#define	VGA_GC_ADDRESS		0x0e
+#define	VGA_GC_SET_RESET		0
+#define	VGA_GC_ENABLE_SET_RESET		1
+#define	VGA_GC_COLOR_COMPARE		2
+#define	VGA_GC_DATA_ROTATE		3
+#define		VGA_GC_DR_FS_XOR	0x18	/* Function select - XOR */
+#define		VGA_GC_DR_FS_OR		0x10	/* Function select - OR */
+#define		VGA_GC_DR_FS_AND	0x08	/* Function select - AND */
+#define		VGA_GC_DR_RC		0x07	/* Rotate count */
+#define	VGA_GC_READ_MAP_SELECT		4
+#define	VGA_GC_MODE			5
+#define		VGA_GC_MODE_SR		0x60	/* Shift register */
+#define		VGA_GC_MODE_OE		0x10	/* Odd/even */
+#define		VGA_GC_MODE_RM		0x08	/* Read mode */
+#define		VGA_GC_MODE_WM		0x03	/* Write mode */
+#define	VGA_GC_MISCELLANEOUS		6
+#define		VGA_GC_MISC_MM		0x0C	/* memory map */
+#define		VGA_GC_MISC_COE		0x02	/* Chain odd/even */
+#define		VGA_GC_MISC_GA		0x01	/* Graphics/text mode */
+#define	VGA_GC_COLOR_DONT_CARE		7
+#define	VGA_GC_BIT_MASK			8
+#define	VGA_GC_DATA		0x0f
+
+/* CRT controller registers. */
+#define	VGA_CRTC_ADDRESS	0x14
+#define	VGA_CRTC_HORIZ_TOTAL		0
+#define	VGA_CRTC_HORIZ_DISP_END		1
+#define	VGA_CRTC_START_HORIZ_BLANK	2
+#define	VGA_CRTC_END_HORIZ_BLANK	3
+#define		VGA_CRTC_EHB_CR		0x80	/* Compatible read */
+#define		VGA_CRTC_EHB_DES	0x60	/* Display enable skew */
+#define		VGA_CRTC_EHB_EHB	0x1F	/* End horizontal blank */
+#define	VGA_CRTC_START_HORIZ_RETRACE	4
+#define	VGA_CRTC_END_HORIZ_RETRACE	5
+#define		VGA_CRTC_EHR_EHB	0x80	/* End horizontal blanking */
+#define		VGA_CRTC_EHR_HRD	0x60	/* Horizontal retrace delay */
+#define		VGA_CRTC_EHR_EHR	0x1F	/* End horizontal retrace */
+#define	VGA_CRTC_VERT_TOTAL		6
+#define	VGA_CRTC_OVERFLOW		7
+#define		VGA_CRTC_OF_VRS9	0x80	/* Vertical retrace start */
+#define		VGA_CRTC_OF_VDE9	0x40	/* Vertical disp. enable end */
+#define		VGA_CRTC_OF_VT9		0x20	/* Vertical total (bit 9) */
+#define		VGA_CRTC_OF_LC8		0x10	/* Line compare */
+#define		VGA_CRTC_OF_VBS8	0x08	/* Start vertical blanking */
+#define		VGA_CRTC_OF_VRS8	0x04	/* Vertical retrace start */
+#define		VGA_CRTC_OF_VDE8	0x02	/* Vertical disp. enable end */
+#define		VGA_CRTC_OF_VT8		0x01	/* Vertical total (bit 8) */
+#define	VGA_CRTC_PRESET_ROW_SCAN	8
+#define		VGA_CRTC_PRS_BP		0x60	/* Byte panning */
+#define		VGA_CRTC_PRS_PRS	0x1F	/* Preset row scan */
+#define	VGA_CRTC_MAX_SCAN_LINE		9
+#define		VGA_CRTC_MSL_2T4	0x80	/* 200-to-400 line conversion */
+#define		VGA_CRTC_MSL_LC9	0x40	/* Line compare (bit 9) */
+#define		VGA_CRTC_MSL_VBS9	0x20	/* Start vertical blanking */
+#define		VGA_CRTC_MSL_MSL	0x1F	/* Maximum scan line */
+#define	VGA_CRTC_CURSOR_START		10
+#define		VGA_CRTC_CS_COO		0x20	/* Cursor on/off */
+#define		VGA_CRTC_CS_CS		0x1F	/* Cursor start */
+#define	VGA_CRTC_CURSOR_END		11
+#define		VGA_CRTC_CE_CSK		0x60	/* Cursor skew */
+#define		VGA_CRTC_CE_CE		0x1F	/* Cursor end */
+#define	VGA_CRTC_START_ADDR_HIGH	12
+#define	VGA_CRTC_START_ADDR_LOW		13
+#define	VGA_CRTC_CURSOR_LOC_HIGH	14
+#define	VGA_CRTC_CURSOR_LOC_LOW		15
+#define	VGA_CRTC_VERT_RETRACE_START	16
+#define	VGA_CRTC_VERT_RETRACE_END	17
+#define		VGA_CRTC_VRE_PR		0x80	/* Protect register 0-7 */
+#define		VGA_CRTC_VRE_BW		0x40	/* Bandwidth */
+#define		VGA_CRTC_VRE_VRE	0x1F	/* Vertical retrace end */
+#define	VGA_CRTC_VERT_DISPLAY_END	18
+#define	VGA_CRTC_OFFSET			19
+#define	VGA_CRTC_UNDERLINE_LOC		20
+#define		VGA_CRTC_UL_DW		0x40	/* Double word mode */
+#define		VGA_CRTC_UL_CB4		0x20	/* Count by four */
+#define		VGA_CRTC_UL_UL		0x1F	/* Underline location */
+#define	VGA_CRTC_START_VERT_BLANK	21
+#define	VGA_CRTC_END_VERT_BLANK		22
+#define	VGA_CRTC_MODE_CONTROL		23
+#define		VGA_CRTC_MC_HR		0x80	/* hardware reset */
+#define		VGA_CRTC_MC_WB		0x40	/* Word/byte mode */
+#define		VGA_CRTC_MC_AW		0x20	/* Address wrap */
+#define		VGA_CRTC_MC_CBT		0x08	/* Count by two */
+#define		VGA_CRTC_MC_HRS		0x04	/* Horizontal retrace select */
+#define		VGA_CRTC_MC_SRS		0x02	/* Select row scan counter */
+#define		VGA_CRTC_MC_CMS		0x01	/* Compatibility mode support */
+#define	VGA_CRTC_LINE_COMPARE		24
+#define	VGA_CRTC_DATA		0x15
+
+#endif /* !_DEV_VT_HW_VGA_VGA_REG_H_ */

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 22:16:45 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1565FC84;
 Wed, 18 Jun 2014 22:16:45 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 03A7F266D;
 Wed, 18 Jun 2014 22:16:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5IMGiFm001711;
 Wed, 18 Jun 2014 22:16:44 GMT (envelope-from ray@svn.freebsd.org)
Received: (from ray@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5IMGitl001710;
 Wed, 18 Jun 2014 22:16:44 GMT (envelope-from ray@svn.freebsd.org)
Message-Id: <201406182216.s5IMGitl001710@svn.freebsd.org>
From: Aleksandr Rybalko 
Date: Wed, 18 Jun 2014 22:16:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267623 - head/sys/conf
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 22:16:45 -0000

Author: ray
Date: Wed Jun 18 22:16:44 2014
New Revision: 267623
URL: http://svnweb.freebsd.org/changeset/base/267623

Log:
  Remove stale link to deleted vt(4) xboxfb driver.
  
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/conf/files.i386

Modified: head/sys/conf/files.i386
==============================================================================
--- head/sys/conf/files.i386	Wed Jun 18 22:10:10 2014	(r267622)
+++ head/sys/conf/files.i386	Wed Jun 18 22:16:44 2014	(r267623)
@@ -279,7 +279,6 @@ dev/viawd/viawd.c		optional viawd
 dev/vmware/vmxnet3/if_vmx.c	optional vmx
 dev/acpica/acpi_if.m		standard
 dev/acpi_support/acpi_wmi_if.m	standard
-dev/vt/hw/xboxfb/xboxfb.c	optional vt_xboxfb
 dev/wbwd/wbwd.c			optional wbwd
 dev/wpi/if_wpi.c		optional wpi
 dev/isci/isci.c							optional isci

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 22:18:59 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id F208EF95;
 Wed, 18 Jun 2014 22:18:58 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E01EA2714;
 Wed, 18 Jun 2014 22:18:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5IMIw38002043;
 Wed, 18 Jun 2014 22:18:58 GMT (envelope-from ray@svn.freebsd.org)
Received: (from ray@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5IMIwtV002042;
 Wed, 18 Jun 2014 22:18:58 GMT (envelope-from ray@svn.freebsd.org)
Message-Id: <201406182218.s5IMIwtV002042@svn.freebsd.org>
From: Aleksandr Rybalko 
Date: Wed, 18 Jun 2014 22:18:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267624 - head/sys/dev/vt
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 22:18:59 -0000

Author: ray
Date: Wed Jun 18 22:18:58 2014
New Revision: 267624
URL: http://svnweb.freebsd.org/changeset/base/267624

Log:
  syscons(4) and vt(4) can be built together now.
  
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/dev/vt/vt.h

Modified: head/sys/dev/vt/vt.h
==============================================================================
--- head/sys/dev/vt/vt.h	Wed Jun 18 22:16:44 2014	(r267623)
+++ head/sys/dev/vt/vt.h	Wed Jun 18 22:18:58 2014	(r267624)
@@ -50,11 +50,6 @@
 #include "opt_syscons.h"
 #include "opt_splash.h"
 
-#ifdef DEV_SC
-#error "Build with both syscons and vt is not supported. Please enable only \
-one 'device sc' or 'device vt'"
-#endif
-
 #ifndef	VT_MAXWINDOWS
 #ifdef	MAXCONS
 #define	VT_MAXWINDOWS	MAXCONS

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 22:23:10 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E69811FF;
 Wed, 18 Jun 2014 22:23:10 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D496E27C1;
 Wed, 18 Jun 2014 22:23:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5IMNA57005731;
 Wed, 18 Jun 2014 22:23:10 GMT (envelope-from ray@svn.freebsd.org)
Received: (from ray@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5IMNAb1005729;
 Wed, 18 Jun 2014 22:23:10 GMT (envelope-from ray@svn.freebsd.org)
Message-Id: <201406182223.s5IMNAb1005729@svn.freebsd.org>
From: Aleksandr Rybalko 
Date: Wed, 18 Jun 2014 22:23:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267625 - head/sys/dev/syscons
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 22:23:11 -0000

Author: ray
Date: Wed Jun 18 22:23:10 2014
New Revision: 267625
URL: http://svnweb.freebsd.org/changeset/base/267625

Log:
  Allow to disable syscons(4) if "hw.syscons.disable" kenv is set.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/dev/syscons/syscons.c
  head/sys/dev/syscons/sysmouse.c

Modified: head/sys/dev/syscons/syscons.c
==============================================================================
--- head/sys/dev/syscons/syscons.c	Wed Jun 18 22:18:58 2014	(r267624)
+++ head/sys/dev/syscons/syscons.c	Wed Jun 18 22:23:10 2014	(r267625)
@@ -1589,6 +1589,11 @@ sc_cnprobe(struct consdev *cp)
     int unit;
     int flags;
 
+    if (getenv("hw.syscons.disable")) {
+	cp->cn_pri = CN_DEAD;
+	return;
+    }
+
     cp->cn_pri = sc_get_cons_priority(&unit, &flags);
 
     /* a video card is always required */

Modified: head/sys/dev/syscons/sysmouse.c
==============================================================================
--- head/sys/dev/syscons/sysmouse.c	Wed Jun 18 22:18:58 2014	(r267624)
+++ head/sys/dev/syscons/sysmouse.c	Wed Jun 18 22:23:10 2014	(r267625)
@@ -165,6 +165,8 @@ static struct ttydevsw smdev_ttydevsw = 
 static void
 sm_attach_mouse(void *unused)
 {
+	if (getenv("hw.syscons.disable"))
+		return;
 	sysmouse_tty = tty_alloc(&smdev_ttydevsw, NULL);
 	tty_makedev(sysmouse_tty, NULL, "sysmouse");
 }

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 22:30:23 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 298A649A;
 Wed, 18 Jun 2014 22:30:23 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id F1A8827FF;
 Wed, 18 Jun 2014 22:30:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5IMUMJj006951;
 Wed, 18 Jun 2014 22:30:22 GMT (envelope-from ray@svn.freebsd.org)
Received: (from ray@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5IMUMYp006946;
 Wed, 18 Jun 2014 22:30:22 GMT (envelope-from ray@svn.freebsd.org)
Message-Id: <201406182230.s5IMUMYp006946@svn.freebsd.org>
From: Aleksandr Rybalko 
Date: Wed, 18 Jun 2014 22:30:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267626 - head/sys/dev/vt
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 22:30:23 -0000

Author: ray
Date: Wed Jun 18 22:30:22 2014
New Revision: 267626
URL: http://svnweb.freebsd.org/changeset/base/267626

Log:
  Suspend vt(4) initialization if "kern.vt.disable" kenv is set.
  
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/dev/vt/vt_consolectl.c
  head/sys/dev/vt/vt_core.c
  head/sys/dev/vt/vt_sysmouse.c

Modified: head/sys/dev/vt/vt_consolectl.c
==============================================================================
--- head/sys/dev/vt/vt_consolectl.c	Wed Jun 18 22:23:10 2014	(r267625)
+++ head/sys/dev/vt/vt_consolectl.c	Wed Jun 18 22:30:22 2014	(r267626)
@@ -73,6 +73,8 @@ static void
 consolectl_drvinit(void *unused)
 {
 
+	if (getenv("kern.vt.disable"))
+		return;
 	make_dev(&consolectl_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600,
 	    "consolectl");
 }

Modified: head/sys/dev/vt/vt_core.c
==============================================================================
--- head/sys/dev/vt/vt_core.c	Wed Jun 18 22:23:10 2014	(r267625)
+++ head/sys/dev/vt/vt_core.c	Wed Jun 18 22:30:22 2014	(r267626)
@@ -215,6 +215,8 @@ static void
 vt_update_static(void *dummy)
 {
 
+	if (getenv("kern.vt.disable"))
+		return;
 	if (main_vd->vd_driver != NULL)
 		printf("VT: running with driver \"%s\".\n",
 		    main_vd->vd_driver->vd_name);
@@ -957,6 +959,9 @@ vtterm_cnprobe(struct terminal *tm, stru
 	struct vt_device *vd = vw->vw_device;
 	struct winsize wsz;
 
+	if (getenv("kern.vt.disable"))
+		return;
+
 	if (vd->vd_flags & VDF_INITIALIZED)
 		/* Initialization already done. */
 		return;
@@ -1991,6 +1996,9 @@ vt_upgrade(struct vt_device *vd)
 	struct vt_window *vw;
 	unsigned int i;
 
+	if (getenv("kern.vt.disable"))
+		return;
+
 	for (i = 0; i < VT_MAXWINDOWS; i++) {
 		vw = vd->vd_windows[i];
 		if (vw == NULL) {
@@ -2056,6 +2064,9 @@ vt_allocate(struct vt_driver *drv, void 
 	struct vt_device *vd;
 	struct winsize wsz;
 
+	if (getenv("kern.vt.disable"))
+		return;
+
 	if (main_vd->vd_driver == NULL) {
 		main_vd->vd_driver = drv;
 		printf("VT: initialize with new VT driver \"%s\".\n",

Modified: head/sys/dev/vt/vt_sysmouse.c
==============================================================================
--- head/sys/dev/vt/vt_sysmouse.c	Wed Jun 18 22:23:10 2014	(r267625)
+++ head/sys/dev/vt/vt_sysmouse.c	Wed Jun 18 22:30:22 2014	(r267626)
@@ -405,6 +405,8 @@ static void
 sysmouse_drvinit(void *unused)
 {
 
+	if (getenv("kern.vt.disable"))
+		return;
 	mtx_init(&sysmouse_lock, "sysmouse", NULL, MTX_DEF);
 	cv_init(&sysmouse_sleep, "sysmrd");
 	make_dev(&sysmouse_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600,

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 18 23:34:49 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 58D7B406;
 Wed, 18 Jun 2014 23:34:49 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 460882D9C;
 Wed, 18 Jun 2014 23:34:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5INYncO039487;
 Wed, 18 Jun 2014 23:34:49 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5INYnjo039486;
 Wed, 18 Jun 2014 23:34:49 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201406182334.s5INYnjo039486@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Wed, 18 Jun 2014 23:34:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267627 - head/lib/libc/stdtime
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 18 Jun 2014 23:34:49 -0000

Author: pfg
Date: Wed Jun 18 23:34:48 2014
New Revision: 267627
URL: http://svnweb.freebsd.org/changeset/base/267627

Log:
  strptime: add support for %t and %n
  
  Posix strptime() requires support for %t and %n, which were added
  to the illumos port.  Curiously we were skipping white spaces by
  default in most other cases making %t meaningless.
  
  We now skip spaces in the case of the %e specifier as strftime(3)
  explicitly adds a space for the single digit case.
  
  Reference:
  http://pubs.opengroup.org/onlinepubs/009695399/functions/strptime.html
  
  Obtained from:	Illumos (Rev. a11c1571b6942161b0186d0588609448066892c2)
  MFC after:	3 weeks

Modified:
  head/lib/libc/stdtime/strptime.c

Modified: head/lib/libc/stdtime/strptime.c
==============================================================================
--- head/lib/libc/stdtime/strptime.c	Wed Jun 18 22:30:22 2014	(r267626)
+++ head/lib/libc/stdtime/strptime.c	Wed Jun 18 23:34:48 2014	(r267627)
@@ -1,4 +1,6 @@
 /*-
+ * Copyright (c) 2014 Gary Mills
+ * Copyright 2011, Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 1994 Powerdog Industries.  All rights reserved.
  *
  * Copyright (c) 2011 The FreeBSD Foundation
@@ -224,11 +226,6 @@ label:
 				tm->tm_sec = i;
 			}
 
-			if (*buf != 0 &&
-				isspace_l((unsigned char)*buf, locale))
-				while (*ptr != 0 &&
-				       !isspace_l((unsigned char)*ptr, locale))
-					ptr++;
 			break;
 
 		case 'H':
@@ -261,11 +258,6 @@ label:
 
 			tm->tm_hour = i;
 
-			if (*buf != 0 &&
-			    isspace_l((unsigned char)*buf, locale))
-				while (*ptr != 0 &&
-				       !isspace_l((unsigned char)*ptr, locale))
-					ptr++;
 			break;
 
 		case 'p':
@@ -335,11 +327,6 @@ label:
 			if (i > 53)
 				return (NULL);
 
-			if (*buf != 0 &&
-			    isspace_l((unsigned char)*buf, locale))
-				while (*ptr != 0 &&
-				       !isspace_l((unsigned char)*ptr, locale))
-					ptr++;
 			break;
 
 		case 'w':
@@ -352,18 +339,22 @@ label:
 
 			tm->tm_wday = i;
 
-			if (*buf != 0 &&
-			    isspace_l((unsigned char)*buf, locale))
-				while (*ptr != 0 &&
-				       !isspace_l((unsigned char)*ptr, locale))
-					ptr++;
 			break;
 
-		case 'd':
 		case 'e':
 			/*
-			 * The %e specifier is explicitly documented as not
-			 * being zero-padded but there is no harm in allowing
+			 * With %e format, our strftime(3) adds a blank space
+			 * before single digits.
+			 */
+			if (*buf != 0 &&
+			    isspace_l((unsigned char)*buf, locale))
+			       buf++;
+			/* FALLTHROUGH */
+		case 'd':
+			/*
+			 * The %e specifier was once explicitly documented as
+			 * not being zero-padded but was later changed to
+			 * equivalent to %d.  There is no harm in allowing
 			 * such padding.
 			 *
 			 * XXX The %e specifier may gobble one too many
@@ -384,11 +375,6 @@ label:
 
 			tm->tm_mday = i;
 
-			if (*buf != 0 &&
-			    isspace_l((unsigned char)*buf, locale))
-				while (*ptr != 0 &&
-				       !isspace_l((unsigned char)*ptr, locale))
-					ptr++;
 			break;
 
 		case 'B':
@@ -445,11 +431,6 @@ label:
 
 			tm->tm_mon = i - 1;
 
-			if (*buf != 0 &&
-			    isspace_l((unsigned char)*buf, locale))
-				while (*ptr != 0 &&
-				       !isspace_l((unsigned char)*ptr, locale))
-					ptr++;
 			break;
 
 		case 's':
@@ -498,11 +479,6 @@ label:
 
 			tm->tm_year = i;
 
-			if (*buf != 0 &&
-			    isspace_l((unsigned char)*buf, locale))
-				while (*ptr != 0 &&
-				       !isspace_l((unsigned char)*ptr, locale))
-					ptr++;
 			break;
 
 		case 'Z':
@@ -559,6 +535,12 @@ label:
 			*GMTp = 1;
 			}
 			break;
+
+		case 'n':
+		case 't':
+			while (isspace_l((unsigned char)*buf, locale))
+				buf++;
+			break;
 		}
 	}
 	return ((char *)buf);

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 04:55:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 52DCB1DC;
 Thu, 19 Jun 2014 04:55:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4003C254E;
 Thu, 19 Jun 2014 04:55:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5J4t1nj085424;
 Thu, 19 Jun 2014 04:55:01 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5J4t1f7085422;
 Thu, 19 Jun 2014 04:55:01 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201406190455.s5J4t1f7085422@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 19 Jun 2014 04:55:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267629 - head/lib/libc/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 04:55:01 -0000

Author: kib
Date: Thu Jun 19 04:55:00 2014
New Revision: 267629
URL: http://svnweb.freebsd.org/changeset/base/267629

Log:
  The time come to remove the wrapper, most likely, but tidy up it code
  instead for now.  Remove spurious blank line, use C89 definition, wrap
  long line.
  
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/lib/libc/sys/mmap.c

Modified: head/lib/libc/sys/mmap.c
==============================================================================
--- head/lib/libc/sys/mmap.c	Thu Jun 19 03:59:52 2014	(r267628)
+++ head/lib/libc/sys/mmap.c	Thu Jun 19 04:55:00 2014	(r267629)
@@ -44,18 +44,13 @@ __FBSDID("$FreeBSD$");
  * is not supplied by GCC 1.X but is supplied by GCC 2.X.
  */
 void *
-mmap(addr, len, prot, flags, fd, offset)
-	void *	addr;
-	size_t	len;
-	int	prot;
-	int	flags;
-	int	fd;
-	off_t	offset;
+mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset)
 {
 
-	if (__getosreldate() >= 700051)
+	if (__getosreldate() >= 700051) {
 		return (__sys_mmap(addr, len, prot, flags, fd, offset));
-	else
-
-		return (__sys_freebsd6_mmap(addr, len, prot, flags, fd, 0, offset));
+	} else {
+		return (__sys_freebsd6_mmap(addr, len, prot, flags, fd, 0,
+		    offset));
+	}
 }

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 05:00:40 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9DCCB41B;
 Thu, 19 Jun 2014 05:00:40 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7E40B2580;
 Thu, 19 Jun 2014 05:00:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5J50efT087109;
 Thu, 19 Jun 2014 05:00:40 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5J50de7087102;
 Thu, 19 Jun 2014 05:00:39 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201406190500.s5J50de7087102@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 19 Jun 2014 05:00:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267630 - in head: lib/libc/sys sys/sys sys/vm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 05:00:40 -0000

Author: kib
Date: Thu Jun 19 05:00:39 2014
New Revision: 267630
URL: http://svnweb.freebsd.org/changeset/base/267630

Log:
  Add MAP_EXCL flag for mmap(2).  It should be combined with MAP_FIXED,
  and prevents the request from deleting existing mappings in the
  region, failing instead.
  
  Reviewed by:	alc
  Discussed with:	jhb
  Tested by:	markj, pho (previous version, as part of the bigger patch)
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/lib/libc/sys/mmap.2
  head/sys/sys/mman.h
  head/sys/vm/vm_map.c
  head/sys/vm/vm_map.h
  head/sys/vm/vm_mmap.c

Modified: head/lib/libc/sys/mmap.2
==============================================================================
--- head/lib/libc/sys/mmap.2	Thu Jun 19 04:55:00 2014	(r267629)
+++ head/lib/libc/sys/mmap.2	Thu Jun 19 05:00:39 2014	(r267630)
@@ -28,7 +28,7 @@
 .\"	@(#)mmap.2	8.4 (Berkeley) 5/11/95
 .\" $FreeBSD$
 .\"
-.Dd September 9, 2013
+.Dd June 19, 2014
 .Dt MMAP 2
 .Os
 .Sh NAME
@@ -141,6 +141,12 @@ argument must be 0.
 This flag is identical to
 .Dv MAP_ANON
 and is provided for compatibility.
+.It Dv MAP_EXCL
+This flag can only be used in combination with
+.Dv MAP_FIXED .
+Please see the definition of
+.Dv MAP_FIXED
+for the description of its effect.
 .It Dv MAP_FIXED
 Do not permit the system to select a different address than the one
 specified.
@@ -152,17 +158,21 @@ If
 is specified,
 .Fa addr
 must be a multiple of the pagesize.
-If a
+If
+.Dv MAP_EXCL
+is not specified, a successfull
 .Dv MAP_FIXED
-request is successful, the mapping established by
-.Fn mmap
-replaces any previous mappings for the process' pages in the range from
+request replaces any previous mappings for the process'
+pages in the range from
 .Fa addr
 to
 .Fa addr
 +
 .Fa len .
-Use of this option is discouraged.
+In contrast, if
+.Dv MAP_EXCL
+is specified, the request will fail if a mapping
+already exists within the range.
 .It Dv MAP_HASSEMAPHORE
 Notify the kernel that the region may contain semaphores and that special
 handling may be necessary.
@@ -393,6 +403,17 @@ argument was not -1.
 was specified and the
 .Fa offset
 argument was not 0.
+.It Bq Er EINVAL
+Both
+.Dv MAP_FIXED
+and
+.Dv MAP_EXCL
+were specified, but the requested region is already used by a mapping.
+.It Bq Er EINVAL
+.Dv MAP_EXCL
+was specified, but
+.Dv MAP_FIXED
+was not.
 .It Bq Er ENODEV
 .Dv MAP_ANON
 has not been specified and

Modified: head/sys/sys/mman.h
==============================================================================
--- head/sys/sys/mman.h	Thu Jun 19 04:55:00 2014	(r267629)
+++ head/sys/sys/mman.h	Thu Jun 19 05:00:39 2014	(r267630)
@@ -89,6 +89,7 @@
 /*
  * Extended flags
  */
+#define	MAP_EXCL	 0x00004000 /* for MAP_FIXED, fail if address is used */
 #define	MAP_NOCORE	 0x00020000 /* dont include these pages in a coredump */
 #define	MAP_PREFAULT_READ 0x00040000 /* prefault mapping for reading */
 #ifdef __LP64__

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Thu Jun 19 04:55:00 2014	(r267629)
+++ head/sys/vm/vm_map.c	Thu Jun 19 05:00:39 2014	(r267630)
@@ -1393,7 +1393,8 @@ vm_map_fixed(vm_map_t map, vm_object_t o
 	    ("vm_map_fixed: non-NULL backing object for stack"));
 	vm_map_lock(map);
 	VM_MAP_RANGE_CHECK(map, start, end);
-	(void) vm_map_delete(map, start, end);
+	if ((cow & MAP_CHECK_EXCL) == 0)
+		vm_map_delete(map, start, end);
 	if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) != 0) {
 		result = vm_map_stack_locked(map, start, length, sgrowsiz,
 		    prot, max, cow);

Modified: head/sys/vm/vm_map.h
==============================================================================
--- head/sys/vm/vm_map.h	Thu Jun 19 04:55:00 2014	(r267629)
+++ head/sys/vm/vm_map.h	Thu Jun 19 05:00:39 2014	(r267630)
@@ -315,6 +315,7 @@ long vmspace_resident_count(struct vmspa
 #define MAP_PREFAULT		0x0008
 #define MAP_PREFAULT_PARTIAL	0x0010
 #define MAP_DISABLE_SYNCER	0x0020
+#define	MAP_CHECK_EXCL		0x0040
 #define MAP_DISABLE_COREDUMP	0x0100
 #define MAP_PREFAULT_MADVISE	0x0200	/* from (user) madvise request */
 #define	MAP_VN_WRITECOUNT	0x0400

Modified: head/sys/vm/vm_mmap.c
==============================================================================
--- head/sys/vm/vm_mmap.c	Thu Jun 19 04:55:00 2014	(r267629)
+++ head/sys/vm/vm_mmap.c	Thu Jun 19 05:00:39 2014	(r267630)
@@ -245,6 +245,8 @@ sys_mmap(td, uap)
 		flags |= MAP_ANON;
 		pos = 0;
 	}
+	if ((flags & (MAP_EXCL | MAP_FIXED)) == MAP_EXCL)
+		return (EINVAL);
 
 	/*
 	 * Align the file position to a page boundary,
@@ -1626,6 +1628,8 @@ vm_mmap(vm_map_t map, vm_offset_t *addr,
 			return (EINVAL);
 		docow |= MAP_STACK_GROWS_DOWN;
 	}
+	if ((flags & MAP_EXCL) != 0)
+		docow |= MAP_CHECK_EXCL;
 
 	if (fitit) {
 		if ((flags & MAP_ALIGNMENT_MASK) == MAP_ALIGNED_SUPER)

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 05:06:24 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B1CC158D;
 Thu, 19 Jun 2014 05:06:24 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9F80D260D;
 Thu, 19 Jun 2014 05:06:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5J56Ok9090408;
 Thu, 19 Jun 2014 05:06:24 GMT
 (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5J56O7Y090407;
 Thu, 19 Jun 2014 05:06:24 GMT
 (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201406190506.s5J56O7Y090407@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Thu, 19 Jun 2014 05:06:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267631 - head/sys/x86/xen
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 05:06:24 -0000

Author: hselasky
Date: Thu Jun 19 05:06:24 2014
New Revision: 267631
URL: http://svnweb.freebsd.org/changeset/base/267631

Log:
  Fix compile warning: Remove duplicate external declaration.

Modified:
  head/sys/x86/xen/xen_apic.c

Modified: head/sys/x86/xen/xen_apic.c
==============================================================================
--- head/sys/x86/xen/xen_apic.c	Thu Jun 19 05:00:39 2014	(r267630)
+++ head/sys/x86/xen/xen_apic.c	Thu Jun 19 05:06:24 2014	(r267631)
@@ -84,8 +84,6 @@ extern void pmap_lazyfix_action(void);
 extern int pmap_pcid_enabled;
 #endif
 
-extern int xen_vector_callback_enabled;
-
 /*---------------------------------- Macros ----------------------------------*/
 #define	IPI_TO_IDX(ipi) ((ipi) - APIC_IPI_INTS)
 

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 05:10:03 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B57AC70B;
 Thu, 19 Jun 2014 05:10:03 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A295E2638;
 Thu, 19 Jun 2014 05:10:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5J5A3Dc091152;
 Thu, 19 Jun 2014 05:10:03 GMT
 (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5J5A3GH091151;
 Thu, 19 Jun 2014 05:10:03 GMT
 (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201406190510.s5J5A3GH091151@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Thu, 19 Jun 2014 05:10:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267632 - head/sys/dev/vmware/vmxnet3
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 05:10:03 -0000

Author: hselasky
Date: Thu Jun 19 05:10:03 2014
New Revision: 267632
URL: http://svnweb.freebsd.org/changeset/base/267632

Log:
  Fix GCC compile warning: Variable(s) can be used uninitialized.

Modified:
  head/sys/dev/vmware/vmxnet3/if_vmx.c

Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c
==============================================================================
--- head/sys/dev/vmware/vmxnet3/if_vmx.c	Thu Jun 19 05:06:24 2014	(r267631)
+++ head/sys/dev/vmware/vmxnet3/if_vmx.c	Thu Jun 19 05:10:03 2014	(r267632)
@@ -2607,10 +2607,12 @@ vmxnet3_txq_offload_ctx(struct vmxnet3_t
 	struct ether_vlan_header *evh;
 	int offset;
 #if defined(INET)
-	struct ip *ip, iphdr;
+	struct ip *ip = NULL;
+	struct ip iphdr;
 #endif
 #if defined(INET6)
-	struct ip6_hdr *ip6, ip6hdr;
+	struct ip6_hdr *ip6 = NULL;
+	struct ip6_hdr ip6hdr;
 #endif
 
 	evh = mtod(m, struct ether_vlan_header *);

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 05:28:43 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2A2C1C91;
 Thu, 19 Jun 2014 05:28:43 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 17A7A27A1;
 Thu, 19 Jun 2014 05:28:43 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5J5Sgk5099793;
 Thu, 19 Jun 2014 05:28:42 GMT
 (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5J5Sg8m099792;
 Thu, 19 Jun 2014 05:28:42 GMT
 (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201406190528.s5J5Sg8m099792@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Thu, 19 Jun 2014 05:28:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267633 - head/sys/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 05:28:43 -0000

Author: hselasky
Date: Thu Jun 19 05:28:42 2014
New Revision: 267633
URL: http://svnweb.freebsd.org/changeset/base/267633

Log:
  Initialize sysctl OID structure by record.
  
  MFC after:	2 weeks

Modified:
  head/sys/sys/sysctl.h

Modified: head/sys/sys/sysctl.h
==============================================================================
--- head/sys/sys/sysctl.h	Thu Jun 19 05:10:03 2014	(r267632)
+++ head/sys/sys/sysctl.h	Thu Jun 19 05:28:42 2014	(r267633)
@@ -278,19 +278,16 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a
 /* This constructs a "raw" MIB oid. */
 #define	SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr)\
 	static struct sysctl_oid sysctl__##parent##_##name = {		\
-		&sysctl_##parent##_children,				\
-		{ NULL },						\
-		nbr,							\
-		kind,							\
-		a1,							\
-		a2,							\
-		#name,							\
-		handler,						\
-		fmt,							\
-		0,							\
-		0,							\
-		__DESCR(descr)						\
-		};							\
+		.oid_parent = &sysctl_##parent##_children,		\
+		.oid_number = (nbr),					\
+		.oid_kind = (kind),					\
+		.oid_arg1 = (a1),					\
+		.oid_arg2 = (a2),					\
+		.oid_name = #name,					\
+		.oid_handler = (handler),				\
+		.oid_fmt = (fmt),					\
+		.oid_descr = __DESCR(descr)				\
+	};								\
 	DATA_SET(sysctl_set, sysctl__##parent##_##name)
 
 #define	SYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr) \

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 05:45:18 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0BB9C2AC;
 Thu, 19 Jun 2014 05:45:18 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id ED9CC2901;
 Thu, 19 Jun 2014 05:45:17 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5J5jHv1008545;
 Thu, 19 Jun 2014 05:45:17 GMT (envelope-from cy@svn.freebsd.org)
Received: (from cy@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5J5jHrG008544;
 Thu, 19 Jun 2014 05:45:17 GMT (envelope-from cy@svn.freebsd.org)
Message-Id: <201406190545.s5J5jHrG008544@svn.freebsd.org>
From: Cy Schubert 
Date: Thu, 19 Jun 2014 05:45:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267634 - head/sys/contrib/ipfilter/netinet
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 05:45:18 -0000

Author: cy
Date: Thu Jun 19 05:45:17 2014
New Revision: 267634
URL: http://svnweb.freebsd.org/changeset/base/267634

Log:
  Fix case where fastroute or "to interface" is used with incorrect FIB.
  
  PR:		183065
  Submitted by:	p-freebsd-bugs@ziemba.us
  Approved by:	glebius
  MFC after:	1 week

Modified:
  head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c

Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
==============================================================================
--- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c	Thu Jun 19 05:28:42 2014	(r267633)
+++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c	Thu Jun 19 05:45:17 2014	(r267634)
@@ -787,7 +787,7 @@ ipf_fastroute(m0, mpp, fin, fdp)
 		dst->sin_addr = fdp->fd_ip;
 
 	dst->sin_len = sizeof(*dst);
-	in_rtalloc(ro, 0);
+	in_rtalloc(ro, M_GETFIB(m0));
 
 	if ((ifp == NULL) && (ro->ro_rt != NULL))
 		ifp = ro->ro_rt->rt_ifp;

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 06:31:28 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 71DAD29D;
 Thu, 19 Jun 2014 06:31:28 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5F78D2C05;
 Thu, 19 Jun 2014 06:31:28 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5J6VSu4031850;
 Thu, 19 Jun 2014 06:31:28 GMT (envelope-from robak@svn.freebsd.org)
Received: (from robak@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5J6VSc1031849;
 Thu, 19 Jun 2014 06:31:28 GMT (envelope-from robak@svn.freebsd.org)
Message-Id: <201406190631.s5J6VSc1031849@svn.freebsd.org>
From: Bartek Rutkowski 
Date: Thu, 19 Jun 2014 06:31:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267635 - head/share/misc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 06:31:28 -0000

Author: robak (ports committer)
Date: Thu Jun 19 06:31:27 2014
New Revision: 267635
URL: http://svnweb.freebsd.org/changeset/base/267635

Log:
  Add Bartek Rutkowski (myself) to committers-ports.dot file with swills and marino as mentors.
  
  Approved by:	swills (mentor)

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==============================================================================
--- head/share/misc/committers-ports.dot	Thu Jun 19 05:45:17 2014	(r267634)
+++ head/share/misc/committers-ports.dot	Thu Jun 19 06:31:27 2014	(r267635)
@@ -183,6 +183,7 @@ rene [label="Rene Ladan\nrene@FreeBSD.or
 riggs [label="Thomas Zander\nriggs@FreeBSD.org\n2014/01/09"]
 rm [label="Ruslan Makhmatkhanov\nrm@FreeBSD.org\n2011/11/06"]
 rnoland [label="Robert Noland\nrnoland@FreeBSD.org\n2008/07/21"]
+robak [label="Bartek Rutkowski\robak@FreeBSD.org\n2014/06/10"]
 rodrigo [label="Rodrigo Osorio\nrodrigo@FreeBSD.org\n2014/01/15"]
 romain [label="Romain Tartiere\nromain@FreeBSD.org\n2010/01/24"]
 sahil [label="Sahil Tandon\nsahil@FreeBSD.org\n2010/04/11"]
@@ -416,6 +417,8 @@ marcus -> bland
 marcus -> eik
 marcus -> jmallett
 
+marino -> robak
+
 makc -> bf
 makc -> jhale
 makc -> rakuco
@@ -524,6 +527,7 @@ steve -> netchild
 swills -> feld
 swills -> milki
 swills -> pclin
+swills -> robak
 swills -> xmj
 
 tabthorpe -> ashish

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 07:39:29 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 49D421FC;
 Thu, 19 Jun 2014 07:39:29 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 37F662126;
 Thu, 19 Jun 2014 07:39:29 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5J7dTdo062509;
 Thu, 19 Jun 2014 07:39:29 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5J7dT79062508;
 Thu, 19 Jun 2014 07:39:29 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201406190739.s5J7dT79062508@svn.freebsd.org>
From: Hiroki Sato 
Date: Thu, 19 Jun 2014 07:39:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267636 - head/etc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 07:39:29 -0000

Author: hrs
Date: Thu Jun 19 07:39:28 2014
New Revision: 267636
URL: http://svnweb.freebsd.org/changeset/base/267636

Log:
  Fix address matching rule.
  
  Reported by:	jase

Modified:
  head/etc/network.subr

Modified: head/etc/network.subr
==============================================================================
--- head/etc/network.subr	Thu Jun 19 06:31:27 2014	(r267635)
+++ head/etc/network.subr	Thu Jun 19 07:39:28 2014	(r267636)
@@ -1058,7 +1058,7 @@ ifalias_af_common_handler()
 	# Process the last component if any.
 	if [ -n "$_tmpargs}" ]; then
 		case $_tmpargs in
-		${_af}\ *[0-9][a-f][A-F]-*)
+		${_af}\ *[0-9a-fA-F]-*)
 			ifalias_af_common_handler $_if $_af $_action \
 			`ifalias_expand_addr $_af $_action ${_tmpargs#${_af}\ }`
 		;;

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 08:13:54 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 27E7E7D2;
 Thu, 19 Jun 2014 08:13:54 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 15B2D2403;
 Thu, 19 Jun 2014 08:13:54 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5J8DrAh084781;
 Thu, 19 Jun 2014 08:13:53 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5J8DrDS084778;
 Thu, 19 Jun 2014 08:13:53 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406190813.s5J8DrDS084778@svn.freebsd.org>
From: Alexander Motin 
Date: Thu, 19 Jun 2014 08:13:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267637 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 08:13:54 -0000

Author: mav
Date: Thu Jun 19 08:13:53 2014
New Revision: 267637
URL: http://svnweb.freebsd.org/changeset/base/267637

Log:
  Add iSCSI Target Name ID descriptor to VPD 83h.
  
  It shall/should be there according to SPC-4, and istgt also provides it.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Thu Jun 19 07:39:28 2014	(r267636)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Thu Jun 19 08:13:53 2014	(r267637)
@@ -2054,12 +2054,13 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 	struct cfiscsi_session *cs;
 	struct scsi_vpd_device_id *devid_ptr;
 	struct scsi_vpd_id_descriptor *desc, *desc1, *desc2, *desc3, *desc4;
+	struct scsi_vpd_id_descriptor *desc5;
 	struct scsi_vpd_id_t10 *t10id;
 	struct ctl_lun *lun;
 	const struct icl_pdu *request;
 	int i, ret;
 	char *val;
-	size_t devid_len, wwpn_len, lun_name_len;
+	size_t devid_len, wwnn_len, wwpn_len, lun_name_len;
 
 	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
 	request = ctsio->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr;
@@ -2071,6 +2072,11 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 	if ((wwpn_len % 4) != 0)
 		wwpn_len += (4 - (wwpn_len % 4));
 
+	wwnn_len = strlen(cs->cs_target->ct_name);
+	wwnn_len += 1; /* '\0' */
+	if ((wwnn_len % 4) != 0)
+		wwnn_len += (4 - (wwnn_len % 4));
+
 	if (lun == NULL) {
 		lun_name_len = 0;
 	} else {
@@ -2085,6 +2091,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 		sizeof(struct scsi_vpd_id_descriptor) +
 		sizeof(struct scsi_vpd_id_t10) + CTL_DEVID_LEN +
 		sizeof(struct scsi_vpd_id_descriptor) + lun_name_len +
+		sizeof(struct scsi_vpd_id_descriptor) + wwnn_len +
 		sizeof(struct scsi_vpd_id_descriptor) + wwpn_len +
 		sizeof(struct scsi_vpd_id_descriptor) +
 		sizeof(struct scsi_vpd_id_rel_trgt_port_id) +
@@ -2115,8 +2122,10 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 	desc2 = (struct scsi_vpd_id_descriptor *)(&desc1->identifier[0] +
 	    lun_name_len);
 	desc3 = (struct scsi_vpd_id_descriptor *)(&desc2->identifier[0] +
-	    wwpn_len);
+	    wwnn_len);
 	desc4 = (struct scsi_vpd_id_descriptor *)(&desc3->identifier[0] +
+	    wwpn_len);
+	desc5 = (struct scsi_vpd_id_descriptor *)(&desc4->identifier[0] +
 	    sizeof(struct scsi_vpd_id_rel_trgt_port_id));
 
 	if (lun != NULL)
@@ -2190,32 +2199,41 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 	}
 
 	/*
-	 * desc2 is for the WWPN which is a port asscociation.
+	 * desc2 is for the Target Name.
+	 */
+	desc2->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8;
+	desc2->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_TARGET |
+	    SVPD_ID_TYPE_SCSI_NAME;
+	desc2->length = wwnn_len;
+	snprintf(desc2->identifier, wwnn_len, "%s", cs->cs_target->ct_name);
+
+	/*
+	 * desc3 is for the WWPN which is a port asscociation.
 	 */
-       	desc2->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8;
-	desc2->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
+	desc3->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8;
+	desc3->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
 	    SVPD_ID_TYPE_SCSI_NAME;
-	desc2->length = wwpn_len;
-	snprintf(desc2->identifier, wwpn_len, "%s,t,0x%4.4x",
+	desc3->length = wwpn_len;
+	snprintf(desc3->identifier, wwpn_len, "%s,t,0x%4.4x",
 	    cs->cs_target->ct_name, cs->cs_portal_group_tag);
 
 	/*
 	 * desc3 is for the Relative Target Port(type 4h) identifier
 	 */
-       	desc3->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_BINARY;
-	desc3->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
+	desc4->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_BINARY;
+	desc4->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
 	    SVPD_ID_TYPE_RELTARG;
-	desc3->length = 4;
-	desc3->identifier[3] = 1;
+	desc4->length = 4;
+	desc4->identifier[3] = 1;
 
 	/*
 	 * desc4 is for the Target Port Group(type 5h) identifier
 	 */
-       	desc4->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_BINARY;
-	desc4->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
+	desc5->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_BINARY;
+	desc5->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
 	    SVPD_ID_TYPE_TPORTGRP;
-	desc4->length = 4;
-	desc4->identifier[3] = 1;
+	desc5->length = 4;
+	desc5->identifier[3] = 1;
 
 	ctsio->scsi_status = SCSI_STATUS_OK;
 

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 08:49:43 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A1559341;
 Thu, 19 Jun 2014 08:49:43 +0000 (UTC)
Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 3879126DD;
 Thu, 19 Jun 2014 08:49:43 +0000 (UTC)
Received: from alchemy.franken.de (localhost [127.0.0.1])
 by alchemy.franken.de (8.14.8/8.14.8/ALCHEMY.FRANKEN.DE) with ESMTP id
 s5J8nYMI012432
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Thu, 19 Jun 2014 10:49:34 +0200 (CEST)
 (envelope-from marius@alchemy.franken.de)
Received: (from marius@localhost)
 by alchemy.franken.de (8.14.8/8.14.8/Submit) id s5J8nYtK012431;
 Thu, 19 Jun 2014 10:49:34 +0200 (CEST) (envelope-from marius)
Date: Thu, 19 Jun 2014 10:49:34 +0200
From: Marius Strobl 
To: Brad Davis 
Subject: Re: svn commit: r267145 - head/sys/geom/eli
Message-ID: <20140619084934.GA7615@alchemy.franken.de>
References: <201406060317.s563HbcP059214@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201406060317.s563HbcP059214@svn.freebsd.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3
 (alchemy.franken.de [0.0.0.0]); Thu, 19 Jun 2014 10:49:34 +0200 (CEST)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 08:49:43 -0000

On Fri, Jun 06, 2014 at 03:17:37AM +0000, Brad Davis wrote:
> Author: brd (doc committer)
> Date: Fri Jun  6 03:17:37 2014
> New Revision: 267145
> URL: http://svnweb.freebsd.org/changeset/base/267145
> 
> Log:
>   - Fix the keyfile being cleared prematurely after r259428
>   
>   PR:		185084
>   Submitted by:	fk@fabiankeil.de
>   Reviewed by:	pjd@
> 

Hi,

could you please MFC this change down to stable/9?

Marius


From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 09:08:21 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6CEDDA10;
 Thu, 19 Jun 2014 09:08:21 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5AE172871;
 Thu, 19 Jun 2014 09:08:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5J98LiU013700;
 Thu, 19 Jun 2014 09:08:21 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5J98Lwq013699;
 Thu, 19 Jun 2014 09:08:21 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201406190908.s5J98Lwq013699@svn.freebsd.org>
From: Marius Strobl 
Date: Thu, 19 Jun 2014 09:08:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267638 - head/sys/cam
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 09:08:21 -0000

Author: marius
Date: Thu Jun 19 09:08:20 2014
New Revision: 267638
URL: http://svnweb.freebsd.org/changeset/base/267638

Log:
  Don't denounce peripherals on system shutdown. Together with r267321,
  we're now back to the pre-r228483 level of default verbosity. This in
  turn again typically allows for reading information that userland might
  have printed on the screen before initiating a halt, but still permits
  to debug potential device shutdown problems on system shutdown via
  CAM_DEBUG etc.
  
  Reviewed by:	mav
  MFC after:	3 days
  Sponsored by:	Bally Wulff Games & Entertainment GmbH

Modified:
  head/sys/cam/cam_periph.c

Modified: head/sys/cam/cam_periph.c
==============================================================================
--- head/sys/cam/cam_periph.c	Thu Jun 19 08:13:53 2014	(r267637)
+++ head/sys/cam/cam_periph.c	Thu Jun 19 09:08:20 2014	(r267638)
@@ -597,7 +597,7 @@ cam_periph_invalidate(struct cam_periph 
 		return;
 
 	CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph invalidated\n"));
-	if (periph->flags & CAM_PERIPH_ANNOUNCED)
+	if ((periph->flags & CAM_PERIPH_ANNOUNCED) && !rebooting)
 		xpt_denounce_periph(periph);
 	periph->flags |= CAM_PERIPH_INVALID;
 	periph->flags &= ~CAM_PERIPH_NEW_DEV_FOUND;
@@ -663,9 +663,9 @@ camperiphfree(struct cam_periph *periph)
 	xpt_remove_periph(periph);
 
 	xpt_unlock_buses();
-	if (periph->flags & CAM_PERIPH_ANNOUNCED) {
+	if ((periph->flags & CAM_PERIPH_ANNOUNCED) && !rebooting)
 		xpt_print(periph->path, "Periph destroyed\n");
-	} else
+	else
 		CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph destroyed\n"));
 
 	if (periph->flags & CAM_PERIPH_NEW_DEV_FOUND) {

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 09:46:44 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5B3F15F9;
 Thu, 19 Jun 2014 09:46:44 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3DA592C9B;
 Thu, 19 Jun 2014 09:46:44 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5J9kiIY031614;
 Thu, 19 Jun 2014 09:46:44 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5J9khBe031610;
 Thu, 19 Jun 2014 09:46:43 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406190946.s5J9khBe031610@svn.freebsd.org>
From: Alexander Motin 
Date: Thu, 19 Jun 2014 09:46:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267639 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 09:46:44 -0000

Author: mav
Date: Thu Jun 19 09:46:43 2014
New Revision: 267639
URL: http://svnweb.freebsd.org/changeset/base/267639

Log:
  Increase CTL_DEVID_LEN from 16 to 64 bytes.
  
  SPC-4 recommends T10 vendor ID based LUN ID was created by concatenating
  product name and serial number (and istgt follows that).  But product name
  is 16 bytes long by itself, so 16 bytes total length is clearly not enough
  to fit both.
  
  To keep compatibility with existing configurations, pad short device IDs
  to old length of 16, same as before.
  
  This change probably breaks CTL user-level ABI, so control tools should
  be rebuilt after this change.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl.h
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Thu Jun 19 09:08:20 2014	(r267638)
+++ head/sys/cam/ctl/ctl.c	Thu Jun 19 09:46:43 2014	(r267639)
@@ -91,12 +91,6 @@ struct ctl_softc *control_softc = NULL;
 #define CTL_DONE_THREAD
 
 /*
- * Use the serial number and device ID provided by the backend, rather than
- * making up our own.
- */
-#define CTL_USE_BACKEND_SN
-
-/*
  * Size and alignment macros needed for Copan-specific HA hardware.  These
  * can go away when the HA code is re-written, and uses busdma for any
  * hardware.
@@ -9477,9 +9471,6 @@ ctl_inquiry_evpd_serial(struct ctl_scsii
 {
 	struct scsi_vpd_unit_serial_number *sn_ptr;
 	struct ctl_lun *lun;
-#ifndef CTL_USE_BACKEND_SN
-	char tmpstr[32];
-#endif
 
 	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
 
@@ -9513,7 +9504,6 @@ ctl_inquiry_evpd_serial(struct ctl_scsii
 
 	sn_ptr->page_code = SVPD_UNIT_SERIAL_NUMBER;
 	sn_ptr->length = ctl_min(sizeof(*sn_ptr) - 4, CTL_SN_LEN);
-#ifdef CTL_USE_BACKEND_SN
 	/*
 	 * If we don't have a LUN, we just leave the serial number as
 	 * all spaces.
@@ -9523,15 +9513,6 @@ ctl_inquiry_evpd_serial(struct ctl_scsii
 		strncpy((char *)sn_ptr->serial_num,
 			(char *)lun->be_lun->serial_num, CTL_SN_LEN);
 	}
-#else
-	/*
-	 * Note that we're using a non-unique serial number here,
-	 */
-	snprintf(tmpstr, sizeof(tmpstr), "MYSERIALNUMIS000");
-	memset(sn_ptr->serial_num, 0x20, sizeof(sn_ptr->serial_num));
-	strncpy(sn_ptr->serial_num, tmpstr, ctl_min(CTL_SN_LEN,
-		ctl_min(sizeof(tmpstr), sizeof(*sn_ptr) - 4)));
-#endif
 	ctsio->scsi_status = SCSI_STATUS_OK;
 
 	ctsio->be_move_done = ctl_config_move_done;
@@ -9552,10 +9533,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
 	struct ctl_lun *lun;
 	struct ctl_frontend *fe;
 	char *val;
-#ifndef CTL_USE_BACKEND_SN
-	char tmpstr[32];
-#endif /* CTL_USE_BACKEND_SN */
-	int devid_len;
+	int data_len, devid_len;
 
 	ctl_softc = control_softc;
 
@@ -9568,23 +9546,30 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
 
 	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
 
-	devid_len = sizeof(struct scsi_vpd_device_id) +
+	if (lun == NULL) {
+		devid_len = CTL_DEVID_MIN_LEN;
+	} else {
+		devid_len = max(CTL_DEVID_MIN_LEN,
+		    strnlen(lun->be_lun->device_id, CTL_DEVID_LEN));
+	}
+
+	data_len = sizeof(struct scsi_vpd_device_id) +
 		sizeof(struct scsi_vpd_id_descriptor) +
-		sizeof(struct scsi_vpd_id_t10) + CTL_DEVID_LEN +
+		sizeof(struct scsi_vpd_id_t10) + devid_len +
 		sizeof(struct scsi_vpd_id_descriptor) + CTL_WWPN_LEN +
 		sizeof(struct scsi_vpd_id_descriptor) +
 		sizeof(struct scsi_vpd_id_rel_trgt_port_id) +
 		sizeof(struct scsi_vpd_id_descriptor) +
 		sizeof(struct scsi_vpd_id_trgt_port_grp_id);
 
-	ctsio->kern_data_ptr = malloc(devid_len, M_CTL, M_WAITOK | M_ZERO);
+	ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
 	devid_ptr = (struct scsi_vpd_device_id *)ctsio->kern_data_ptr;
 	ctsio->kern_sg_entries = 0;
 
-	if (devid_len < alloc_len) {
-		ctsio->residual = alloc_len - devid_len;
-		ctsio->kern_data_len = devid_len;
-		ctsio->kern_total_len = devid_len;
+	if (data_len < alloc_len) {
+		ctsio->residual = alloc_len - data_len;
+		ctsio->kern_data_len = data_len;
+		ctsio->kern_total_len = data_len;
 	} else {
 		ctsio->residual = 0;
 		ctsio->kern_data_len = alloc_len;
@@ -9597,7 +9582,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
 	desc = (struct scsi_vpd_id_descriptor *)devid_ptr->desc_list;
 	t10id = (struct scsi_vpd_id_t10 *)&desc->identifier[0];
 	desc1 = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] +
-		sizeof(struct scsi_vpd_id_t10) + CTL_DEVID_LEN);
+		sizeof(struct scsi_vpd_id_t10) + devid_len);
 	desc2 = (struct scsi_vpd_id_descriptor *)(&desc1->identifier[0] +
 	          CTL_WWPN_LEN);
 	desc3 = (struct scsi_vpd_id_descriptor *)(&desc2->identifier[0] +
@@ -9615,7 +9600,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
 
 	devid_ptr->page_code = SVPD_DEVICE_ID;
 
-	scsi_ulto2b(devid_len - 4, devid_ptr->length);
+	scsi_ulto2b(data_len - 4, devid_ptr->length);
 
 	mtx_lock(&ctl_softc->ctl_lock);
 
@@ -9644,7 +9629,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
 	 * per-LUN identifier.
 	 */
 	desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10;
-	desc->length = sizeof(*t10id) + CTL_DEVID_LEN;
+	desc->length = sizeof(*t10id) + devid_len;
 	if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) {
 		strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor));
 	} else {
@@ -9701,7 +9686,6 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
 	else
 		desc3->identifier[3] = 2;
 
-#ifdef CTL_USE_BACKEND_SN
 	/*
 	 * If we've actually got a backend, copy the device id from the
 	 * per-LUN data.  Otherwise, set it to all spaces.
@@ -9711,19 +9695,13 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
 		 * Copy the backend's LUN ID.
 		 */
 		strncpy((char *)t10id->vendor_spec_id,
-			(char *)lun->be_lun->device_id, CTL_DEVID_LEN);
+			(char *)lun->be_lun->device_id, devid_len);
 	} else {
 		/*
 		 * No backend, set this to spaces.
 		 */
-		memset(t10id->vendor_spec_id, 0x20, CTL_DEVID_LEN);
+		memset(t10id->vendor_spec_id, 0x20, devid_len);
 	}
-#else
-	snprintf(tmpstr, sizeof(tmpstr), "MYDEVICEIDIS%4d",
-		 (lun != NULL) ?  (int)lun->lun : 0);
-	strncpy(t10id->vendor_spec_id, tmpstr, ctl_min(CTL_DEVID_LEN,
-		sizeof(tmpstr)));
-#endif
 
 	ctsio->scsi_status = SCSI_STATUS_OK;
 

Modified: head/sys/cam/ctl/ctl.h
==============================================================================
--- head/sys/cam/ctl/ctl.h	Thu Jun 19 09:08:20 2014	(r267638)
+++ head/sys/cam/ctl/ctl.h	Thu Jun 19 09:46:43 2014	(r267639)
@@ -96,7 +96,8 @@ union ctl_modepage_info {
 /*
  * Device ID length, for VPD page 0x83.
  */
-#define	CTL_DEVID_LEN	16
+#define	CTL_DEVID_LEN	64
+#define	CTL_DEVID_MIN_LEN	16
 /*
  * WWPN length, for VPD page 0x83.
  */

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Thu Jun 19 09:08:20 2014	(r267638)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Thu Jun 19 09:46:43 2014	(r267639)
@@ -2060,7 +2060,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 	const struct icl_pdu *request;
 	int i, ret;
 	char *val;
-	size_t devid_len, wwnn_len, wwpn_len, lun_name_len;
+	size_t data_len, devid_len, wwnn_len, wwpn_len, lun_name_len;
 
 	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
 	request = ctsio->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr;
@@ -2078,8 +2078,11 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 		wwnn_len += (4 - (wwnn_len % 4));
 
 	if (lun == NULL) {
+		devid_len = CTL_DEVID_MIN_LEN;
 		lun_name_len = 0;
 	} else {
+		devid_len = max(CTL_DEVID_MIN_LEN,
+		    strnlen(lun->be_lun->device_id, CTL_DEVID_LEN));
 		lun_name_len = strlen(cs->cs_target->ct_name);
 		lun_name_len += strlen(",lun,XXXXXXXX");
 		lun_name_len += 1; /* '\0' */
@@ -2087,9 +2090,9 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 			lun_name_len += (4 - (lun_name_len % 4));
 	}
 
-	devid_len = sizeof(struct scsi_vpd_device_id) +
+	data_len = sizeof(struct scsi_vpd_device_id) +
 		sizeof(struct scsi_vpd_id_descriptor) +
-		sizeof(struct scsi_vpd_id_t10) + CTL_DEVID_LEN +
+		sizeof(struct scsi_vpd_id_t10) + devid_len +
 		sizeof(struct scsi_vpd_id_descriptor) + lun_name_len +
 		sizeof(struct scsi_vpd_id_descriptor) + wwnn_len +
 		sizeof(struct scsi_vpd_id_descriptor) + wwpn_len +
@@ -2098,14 +2101,14 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 		sizeof(struct scsi_vpd_id_descriptor) +
 		sizeof(struct scsi_vpd_id_trgt_port_grp_id);
 
-	ctsio->kern_data_ptr = malloc(devid_len, M_CTL, M_WAITOK | M_ZERO);
+	ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
 	devid_ptr = (struct scsi_vpd_device_id *)ctsio->kern_data_ptr;
 	ctsio->kern_sg_entries = 0;
 
-	if (devid_len < alloc_len) {
-		ctsio->residual = alloc_len - devid_len;
-		ctsio->kern_data_len = devid_len;
-		ctsio->kern_total_len = devid_len;
+	if (data_len < alloc_len) {
+		ctsio->residual = alloc_len - data_len;
+		ctsio->kern_data_len = data_len;
+		ctsio->kern_total_len = data_len;
 	} else {
 		ctsio->residual = 0;
 		ctsio->kern_data_len = alloc_len;
@@ -2118,7 +2121,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 	desc = (struct scsi_vpd_id_descriptor *)devid_ptr->desc_list;
 	t10id = (struct scsi_vpd_id_t10 *)&desc->identifier[0];
 	desc1 = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] +
-	    sizeof(struct scsi_vpd_id_t10) + CTL_DEVID_LEN);
+	    sizeof(struct scsi_vpd_id_t10) + devid_len);
 	desc2 = (struct scsi_vpd_id_descriptor *)(&desc1->identifier[0] +
 	    lun_name_len);
 	desc3 = (struct scsi_vpd_id_descriptor *)(&desc2->identifier[0] +
@@ -2136,7 +2139,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 
 	devid_ptr->page_code = SVPD_DEVICE_ID;
 
-	scsi_ulto2b(devid_len - 4, devid_ptr->length);
+	scsi_ulto2b(data_len - 4, devid_ptr->length);
 
 	/*
 	 * We're using a LUN association here.  i.e., this device ID is a
@@ -2144,7 +2147,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 	 */
 	desc->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_ASCII;
 	desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10;
-	desc->length = sizeof(*t10id) + CTL_DEVID_LEN;
+	desc->length = sizeof(*t10id) + devid_len;
 	if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) {
 		strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor));
 	} else {
@@ -2162,12 +2165,12 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 		 * Copy the backend's LUN ID.
 		 */
 		strncpy((char *)t10id->vendor_spec_id,
-		    (char *)lun->be_lun->device_id, CTL_DEVID_LEN);
+		    (char *)lun->be_lun->device_id, devid_len);
 	} else {
 		/*
 		 * No backend, set this to spaces.
 		 */
-		memset(t10id->vendor_spec_id, 0x20, CTL_DEVID_LEN);
+		memset(t10id->vendor_spec_id, 0x20, devid_len);
 	}
 
 	/*

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 11:49:37 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 391857E0;
 Thu, 19 Jun 2014 11:49:37 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 263D926AA;
 Thu, 19 Jun 2014 11:49:37 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5JBnaAO087245;
 Thu, 19 Jun 2014 11:49:36 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5JBna1a087244;
 Thu, 19 Jun 2014 11:49:36 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201406191149.s5JBna1a087244@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Thu, 19 Jun 2014 11:49:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267640 - head/lib/libc/net
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 11:49:37 -0000

Author: ume
Date: Thu Jun 19 11:49:36 2014
New Revision: 267640
URL: http://svnweb.freebsd.org/changeset/base/267640

Log:
  Use SOCK_CLOEXEC.
  
  MFC after:	1 week

Modified:
  head/lib/libc/net/getaddrinfo.c

Modified: head/lib/libc/net/getaddrinfo.c
==============================================================================
--- head/lib/libc/net/getaddrinfo.c	Thu Jun 19 09:46:43 2014	(r267639)
+++ head/lib/libc/net/getaddrinfo.c	Thu Jun 19 11:49:36 2014	(r267640)
@@ -1589,7 +1589,7 @@ is_ifdisabled(char *name)
 	struct in6_ndireq nd;
 	int fd;
 
-	if ((fd = _socket(AF_INET6, SOCK_DGRAM, 0)) < 0)
+	if ((fd = _socket(AF_INET6, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0)
 		return -1;
 	memset(&nd, 0, sizeof(nd));
 	strlcpy(nd.ifname, name, sizeof(nd.ifname));

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 12:43:42 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3A750F3;
 Thu, 19 Jun 2014 12:43:42 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0D4832BE3;
 Thu, 19 Jun 2014 12:43:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5JChfjx014975;
 Thu, 19 Jun 2014 12:43:41 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5JChfmg014973;
 Thu, 19 Jun 2014 12:43:41 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406191243.s5JChfmg014973@svn.freebsd.org>
From: Alexander Motin 
Date: Thu, 19 Jun 2014 12:43:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267641 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 12:43:42 -0000

Author: mav
Date: Thu Jun 19 12:43:41 2014
New Revision: 267641
URL: http://svnweb.freebsd.org/changeset/base/267641

Log:
  Add some more CTL_FLAG_ABORT check points.
  
  This should allow to abort commands doing mostly disk I/O, such as VERIFY
  or WRITE SAME.  Before this change CTL_FLAG_ABORT was only checked around
  data moves, which for these commands may not happen for a very long time.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_backend_block.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Thu Jun 19 11:49:36 2014	(r267640)
+++ head/sys/cam/ctl/ctl.c	Thu Jun 19 12:43:41 2014	(r267641)
@@ -5003,9 +5003,10 @@ ctl_data_submit_done(union ctl_io *io)
 	 * If there is an error, though, we don't want to keep processing.
 	 * Instead, just send status back to the initiator.
 	 */
-	if ((io->io_hdr.flags & CTL_FLAG_IO_CONT)
-	 && (((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)
-	  || ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS))) {
+	if ((io->io_hdr.flags & CTL_FLAG_IO_CONT) &&
+	    (io->io_hdr.flags & CTL_FLAG_ABORT) == 0 &&
+	    ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE ||
+	     (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) {
 		io->scsiio.io_cont(io);
 		return;
 	}

Modified: head/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_block.c	Thu Jun 19 11:49:36 2014	(r267640)
+++ head/sys/cam/ctl/ctl_backend_block.c	Thu Jun 19 12:43:41 2014	(r267641)
@@ -942,8 +942,9 @@ ctl_be_block_cw_done_ws(struct ctl_be_bl
 
 	io = beio->io;
 	ctl_free_beio(beio);
-	if (((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE)
-	  && ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)) {
+	if ((io->io_hdr.flags & CTL_FLAG_ABORT) ||
+	    ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE &&
+	     (io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)) {
 		ctl_config_write_done(io);
 		return;
 	}
@@ -1184,8 +1185,9 @@ ctl_be_block_next(struct ctl_be_block_io
 	io = beio->io;
 	be_lun = beio->lun;
 	ctl_free_beio(beio);
-	if (((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE)
-	  && ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)) {
+	if ((io->io_hdr.flags & CTL_FLAG_ABORT) ||
+	    ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE &&
+	     (io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)) {
 		ctl_data_submit_done(io);
 		return;
 	}

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 13:18:24 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1ED57BB1;
 Thu, 19 Jun 2014 13:18:24 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0B74E2F39;
 Thu, 19 Jun 2014 13:18:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5JDINtn031790;
 Thu, 19 Jun 2014 13:18:23 GMT
 (envelope-from skreuzer@svn.freebsd.org)
Received: (from skreuzer@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5JDINv6031788;
 Thu, 19 Jun 2014 13:18:23 GMT
 (envelope-from skreuzer@svn.freebsd.org)
Message-Id: <201406191318.s5JDINv6031788@svn.freebsd.org>
From: Steven Kreuzer 
Date: Thu, 19 Jun 2014 13:18:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267642 - in head/usr.sbin: service zzz
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 13:18:24 -0000

Author: skreuzer (doc,ports committer)
Date: Thu Jun 19 13:18:23 2014
New Revision: 267642
URL: http://svnweb.freebsd.org/changeset/base/267642

Log:
  Use Mt macro to properly format mailto links
  
  Approved by:	hrs (mentor)

Modified:
  head/usr.sbin/service/service.8
  head/usr.sbin/zzz/zzz.8

Modified: head/usr.sbin/service/service.8
==============================================================================
--- head/usr.sbin/service/service.8	Thu Jun 19 12:43:41 2014	(r267641)
+++ head/usr.sbin/service/service.8	Thu Jun 19 13:18:23 2014	(r267642)
@@ -132,4 +132,4 @@ utility first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Douglas Barton  .
+.An Douglas Barton Aq Mt dougb@FreeBSD.org .

Modified: head/usr.sbin/zzz/zzz.8
==============================================================================
--- head/usr.sbin/zzz/zzz.8	Thu Jun 19 12:43:41 2014	(r267641)
+++ head/usr.sbin/zzz/zzz.8	Thu Jun 19 13:18:23 2014	(r267642)
@@ -62,4 +62,4 @@ will be issued.
 .Xr apm 8
 .Sh AUTHORS
 This manual page was written by
-.An Nate Lawson Aq njl@FreeBSD.org .
+.An Nate Lawson Aq Mt njl@FreeBSD.org .

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 13:19:36 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5DB6BE4E;
 Thu, 19 Jun 2014 13:19:36 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 318F02F55;
 Thu, 19 Jun 2014 13:19:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5JDJaRw032129;
 Thu, 19 Jun 2014 13:19:36 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5JDJZZ9032127;
 Thu, 19 Jun 2014 13:19:35 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406191319.s5JDJZZ9032127@svn.freebsd.org>
From: Alexander Motin 
Date: Thu, 19 Jun 2014 13:19:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267643 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 13:19:36 -0000

Author: mav
Date: Thu Jun 19 13:19:35 2014
New Revision: 267643
URL: http://svnweb.freebsd.org/changeset/base/267643

Log:
  Execute task management request directly in ctl_queue() context.
  
  From one side it allows to remove CTL_FLAG_TASK_PENDING flag, handling of
  which significantly complicates fine-grained locking.  From the other side
  it reduces task management requests latency even below then that flag could.
  As downside, it denies task management code to sleep, but that is not needed
  any way now.
  
  Discussed with:	ken

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_private.h

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Thu Jun 19 13:18:23 2014	(r267642)
+++ head/sys/cam/ctl/ctl.c	Thu Jun 19 13:19:35 2014	(r267643)
@@ -414,7 +414,7 @@ static int ctl_target_reset(struct ctl_s
 static int ctl_lun_reset(struct ctl_lun *lun, union ctl_io *io,
 			 ctl_ua_type ua_type);
 static int ctl_abort_task(union ctl_io *io);
-static void ctl_run_task_queue(struct ctl_softc *ctl_softc);
+static void ctl_run_task(union ctl_io *io);
 #ifdef CTL_IO_DELAY
 static void ctl_datamove_timer_wakeup(void *arg);
 static void ctl_done_timer_wakeup(void *arg);
@@ -866,10 +866,7 @@ ctl_isc_event_handler(ctl_ha_channel cha
 			cs_prof_gettime(&taskio->io_hdr.start_ticks);
 #endif
 #endif /* CTL_TIME_IO */
-		        STAILQ_INSERT_TAIL(&ctl_softc->task_queue,
-					   &taskio->io_hdr, links);
-			ctl_softc->flags |= CTL_FLAG_TASK_PENDING;
-			ctl_wakeup_thread();
+			ctl_run_task((union ctl_io *)taskio);
 			break;
 		}
 		/* Persistent Reserve action which needs attention */
@@ -1033,7 +1030,6 @@ ctl_init(void)
 	softc->target.wwid[1] = 0x87654321;
 	STAILQ_INIT(&softc->lun_list);
 	STAILQ_INIT(&softc->pending_lun_queue);
-	STAILQ_INIT(&softc->task_queue);
 	STAILQ_INIT(&softc->incoming_queue);
 	STAILQ_INIT(&softc->rtr_queue);
 	STAILQ_INIT(&softc->done_queue);
@@ -3604,49 +3600,9 @@ ctl_free_io(union ctl_io *io)
 	 */
 	if (io->io_hdr.pool != NULL) {
 		struct ctl_io_pool *pool;
-#if 0
-		struct ctl_softc *ctl_softc;
-		union ctl_io *tmp_io;
-		unsigned long xflags;
-		int i;
-
-		ctl_softc = control_softc;
-#endif
 
 		pool = (struct ctl_io_pool *)io->io_hdr.pool;
-
 		mtx_lock(&pool->ctl_softc->pool_lock);
-#if 0
-		save_flags(xflags);
-
-		for (i = 0, tmp_io = (union ctl_io *)STAILQ_FIRST(
-		     &ctl_softc->task_queue); tmp_io != NULL; i++,
-		     tmp_io = (union ctl_io *)STAILQ_NEXT(&tmp_io->io_hdr,
-		     links)) {
-			if (tmp_io == io) {
-				printf("%s: %p is still on the task queue!\n",
-				       __func__, tmp_io);
-				printf("%s: (%d): type %d "
-				       "msg %d cdb %x iptl: "
-				       "%d:%d:%d:%d tag 0x%04x "
-				       "flg %#lx\n",
-					__func__, i,
-					tmp_io->io_hdr.io_type,
-					tmp_io->io_hdr.msg_type,
-					tmp_io->scsiio.cdb[0],
-					tmp_io->io_hdr.nexus.initid.id,
-					tmp_io->io_hdr.nexus.targ_port,
-					tmp_io->io_hdr.nexus.targ_target.id,
-					tmp_io->io_hdr.nexus.targ_lun,
-					(tmp_io->io_hdr.io_type ==
-					CTL_IO_TASK) ?
-					tmp_io->taskio.tag_num :
-					tmp_io->scsiio.tag_num,
-					xflags);
-				panic("I/O still on the task queue!");
-			}
-		}
-#endif
 		io->io_hdr.io_type = 0xff;
 		STAILQ_INSERT_TAIL(&pool->free_queue, &io->io_hdr, links);
 		pool->total_freed++;
@@ -11570,156 +11526,125 @@ bailout:
  * handler as well as from the work thread.
  */
 static void
-ctl_run_task_queue(struct ctl_softc *ctl_softc)
+ctl_run_task(union ctl_io *io)
 {
-	union ctl_io *io, *next_io;
-
-	mtx_assert(&ctl_softc->ctl_lock, MA_OWNED);
-
-	CTL_DEBUG_PRINT(("ctl_run_task_queue\n"));
+	struct ctl_softc *ctl_softc;
+	int retval;
+	const char *task_desc;
 
-	for (io = (union ctl_io *)STAILQ_FIRST(&ctl_softc->task_queue);
-	     io != NULL; io = next_io) {
-		int retval;
-		const char *task_desc;
+	CTL_DEBUG_PRINT(("ctl_run_task\n"));
 
-		next_io = (union ctl_io *)STAILQ_NEXT(&io->io_hdr, links);
+	ctl_softc = control_softc;
+	retval = 0;
 
-		retval = 0;
+	KASSERT(io->io_hdr.io_type == CTL_IO_TASK,
+	    ("ctl_run_task: Unextected io_type %d\n",
+	     io->io_hdr.io_type));
 
-		switch (io->io_hdr.io_type) {
-		case CTL_IO_TASK: {
-			task_desc = ctl_scsi_task_string(&io->taskio);
-			if (task_desc != NULL) {
+	task_desc = ctl_scsi_task_string(&io->taskio);
+	if (task_desc != NULL) {
 #ifdef NEEDTOPORT
-				csevent_log(CSC_CTL | CSC_SHELF_SW |
-					    CTL_TASK_REPORT,
-					    csevent_LogType_Trace,
-					    csevent_Severity_Information,
-					    csevent_AlertLevel_Green,
-					    csevent_FRU_Firmware,
-					    csevent_FRU_Unknown,
-					    "CTL: received task: %s",task_desc);
+		csevent_log(CSC_CTL | CSC_SHELF_SW |
+			    CTL_TASK_REPORT,
+			    csevent_LogType_Trace,
+			    csevent_Severity_Information,
+			    csevent_AlertLevel_Green,
+			    csevent_FRU_Firmware,
+			    csevent_FRU_Unknown,
+			    "CTL: received task: %s",task_desc);
 #endif
-			} else {
+	} else {
 #ifdef NEEDTOPORT
-				csevent_log(CSC_CTL | CSC_SHELF_SW |
-					    CTL_TASK_REPORT,
-					    csevent_LogType_Trace,
-					    csevent_Severity_Information,
-					    csevent_AlertLevel_Green,
-					    csevent_FRU_Firmware,
-					    csevent_FRU_Unknown,
-					    "CTL: received unknown task "
-					    "type: %d (%#x)",
-					    io->taskio.task_action,
-					    io->taskio.task_action);
-#endif
-			}
-			switch (io->taskio.task_action) {
-			case CTL_TASK_ABORT_TASK:
-				retval = ctl_abort_task(io);
-				break;
-			case CTL_TASK_ABORT_TASK_SET:
-				break;
-			case CTL_TASK_CLEAR_ACA:
-				break;
-			case CTL_TASK_CLEAR_TASK_SET:
-				break;
-			case CTL_TASK_LUN_RESET: {
-				struct ctl_lun *lun;
-				uint32_t targ_lun;
-				int retval;
-
-				targ_lun = io->io_hdr.nexus.targ_lun;
-				if (io->io_hdr.nexus.lun_map_fn != NULL)
-					targ_lun = io->io_hdr.nexus.lun_map_fn(io->io_hdr.nexus.lun_map_arg, targ_lun);
-
-				if ((targ_lun < CTL_MAX_LUNS)
-				 && (ctl_softc->ctl_luns[targ_lun] != NULL))
-					lun = ctl_softc->ctl_luns[targ_lun];
-				else {
-					retval = 1;
-					break;
-				}
-
-				if (!(io->io_hdr.flags &
-				    CTL_FLAG_FROM_OTHER_SC)) {
-					union ctl_ha_msg msg_info;
-
-					io->io_hdr.flags |=
-						CTL_FLAG_SENT_2OTHER_SC;
-					msg_info.hdr.msg_type =
-						CTL_MSG_MANAGE_TASKS;
-					msg_info.hdr.nexus = io->io_hdr.nexus;
-					msg_info.task.task_action =
-						CTL_TASK_LUN_RESET;
-					msg_info.hdr.original_sc = NULL;
-					msg_info.hdr.serializing_sc = NULL;
-					if (CTL_HA_STATUS_SUCCESS !=
-					    ctl_ha_msg_send(CTL_HA_CHAN_CTL,
-					    (void *)&msg_info,
-					    sizeof(msg_info), 0)) {
-					}
-				}
+		csevent_log(CSC_CTL | CSC_SHELF_SW |
+			    CTL_TASK_REPORT,
+			    csevent_LogType_Trace,
+			    csevent_Severity_Information,
+			    csevent_AlertLevel_Green,
+			    csevent_FRU_Firmware,
+			    csevent_FRU_Unknown,
+			    "CTL: received unknown task "
+			    "type: %d (%#x)",
+			    io->taskio.task_action,
+			    io->taskio.task_action);
+#endif
+	}
+	switch (io->taskio.task_action) {
+	case CTL_TASK_ABORT_TASK:
+		retval = ctl_abort_task(io);
+		break;
+	case CTL_TASK_ABORT_TASK_SET:
+		break;
+	case CTL_TASK_CLEAR_ACA:
+		break;
+	case CTL_TASK_CLEAR_TASK_SET:
+		break;
+	case CTL_TASK_LUN_RESET: {
+		struct ctl_lun *lun;
+		uint32_t targ_lun;
+		int retval;
 
-				retval = ctl_lun_reset(lun, io,
-						       CTL_UA_LUN_RESET);
-				break;
-			}
-			case CTL_TASK_TARGET_RESET:
-				retval = ctl_target_reset(ctl_softc, io,
-							  CTL_UA_TARG_RESET);
-				break;
-			case CTL_TASK_BUS_RESET:
-				retval = ctl_bus_reset(ctl_softc, io);
-				break;
-			case CTL_TASK_PORT_LOGIN:
-				break;
-			case CTL_TASK_PORT_LOGOUT:
-				break;
-			default:
-				printf("ctl_run_task_queue: got unknown task "
-				       "management event %d\n",
-				       io->taskio.task_action);
-				break;
-			}
-			if (retval == 0)
-				io->io_hdr.status = CTL_SUCCESS;
-			else
-				io->io_hdr.status = CTL_ERROR;
+		targ_lun = io->io_hdr.nexus.targ_lun;
+		if (io->io_hdr.nexus.lun_map_fn != NULL)
+			targ_lun = io->io_hdr.nexus.lun_map_fn(io->io_hdr.nexus.lun_map_arg, targ_lun);
 
-			STAILQ_REMOVE(&ctl_softc->task_queue, &io->io_hdr,
-				      ctl_io_hdr, links);
-			/*
-			 * This will queue this I/O to the done queue, but the
-			 * work thread won't be able to process it until we
-			 * return and the lock is released.
-			 */
-			ctl_done_lock(io, /*have_lock*/ 1);
+		if ((targ_lun < CTL_MAX_LUNS)
+		 && (ctl_softc->ctl_luns[targ_lun] != NULL))
+			lun = ctl_softc->ctl_luns[targ_lun];
+		else {
+			retval = 1;
 			break;
 		}
-		default: {
 
-			printf("%s: invalid I/O type %d msg %d cdb %x"
-			       " iptl: %ju:%d:%ju:%d tag 0x%04x\n",
-			       __func__, io->io_hdr.io_type,
-			       io->io_hdr.msg_type, io->scsiio.cdb[0],
-			       (uintmax_t)io->io_hdr.nexus.initid.id,
-			       io->io_hdr.nexus.targ_port,
-			       (uintmax_t)io->io_hdr.nexus.targ_target.id,
-			       io->io_hdr.nexus.targ_lun /* XXX */,
-			       (io->io_hdr.io_type == CTL_IO_TASK) ?
-			       io->taskio.tag_num : io->scsiio.tag_num);
-			STAILQ_REMOVE(&ctl_softc->task_queue, &io->io_hdr,
-				      ctl_io_hdr, links);
-			ctl_free_io(io);
-			break;
-		}
+		if (!(io->io_hdr.flags &
+		    CTL_FLAG_FROM_OTHER_SC)) {
+			union ctl_ha_msg msg_info;
+
+			io->io_hdr.flags |=
+				CTL_FLAG_SENT_2OTHER_SC;
+			msg_info.hdr.msg_type =
+				CTL_MSG_MANAGE_TASKS;
+			msg_info.hdr.nexus = io->io_hdr.nexus;
+			msg_info.task.task_action =
+				CTL_TASK_LUN_RESET;
+			msg_info.hdr.original_sc = NULL;
+			msg_info.hdr.serializing_sc = NULL;
+			if (CTL_HA_STATUS_SUCCESS !=
+			    ctl_ha_msg_send(CTL_HA_CHAN_CTL,
+			    (void *)&msg_info,
+			    sizeof(msg_info), 0)) {
+			}
 		}
+
+		retval = ctl_lun_reset(lun, io,
+				       CTL_UA_LUN_RESET);
+		break;
 	}
+	case CTL_TASK_TARGET_RESET:
+		retval = ctl_target_reset(ctl_softc, io, CTL_UA_TARG_RESET);
+		break;
+	case CTL_TASK_BUS_RESET:
+		retval = ctl_bus_reset(ctl_softc, io);
+		break;
+	case CTL_TASK_PORT_LOGIN:
+		break;
+	case CTL_TASK_PORT_LOGOUT:
+		break;
+	default:
+		printf("ctl_run_task: got unknown task management event %d\n",
+		       io->taskio.task_action);
+		break;
+	}
+	if (retval == 0)
+		io->io_hdr.status = CTL_SUCCESS;
+	else
+		io->io_hdr.status = CTL_ERROR;
 
-	ctl_softc->flags &= ~CTL_FLAG_TASK_PENDING;
+	/*
+	 * This will queue this I/O to the done queue, but the
+	 * work thread won't be able to process it until we
+	 * return and the lock is released.
+	 */
+	ctl_done_lock(io, /*have_lock*/ 1);
 }
 
 /*
@@ -11778,8 +11703,6 @@ ctl_handle_isc(union ctl_io *io)
 			mtx_lock(&ctl_softc->ctl_lock);
 			TAILQ_REMOVE(&lun->ooa_queue, &io->io_hdr,
 				     ooa_links);
-			STAILQ_REMOVE(&ctl_softc->task_queue,
-				      &io->io_hdr, ctl_io_hdr, links);
 			ctl_check_blocked(lun);
 			mtx_unlock(&ctl_softc->ctl_lock);
 		}
@@ -12034,26 +11957,6 @@ ctl_datamove(union ctl_io *io)
 		}
 	}
 #endif
-	/*
-	 * If we have any pending task management commands, process them
-	 * first.  This is necessary to eliminate a race condition with the
-	 * FETD:
-	 *
-	 * - FETD submits a task management command, like an abort.
-	 * - Back end calls fe_datamove() to move the data for the aborted
-	 *   command.  The FETD can't really accept it, but if it did, it
-	 *   would end up transmitting data for a command that the initiator
-	 *   told us to abort.
-	 *
-	 * We close the race by processing all pending task management
-	 * commands here (we can't block!), and then check this I/O to see
-	 * if it has been aborted.  If so, return it to the back end with
-	 * bad status, so the back end can say return an error to the back end
-	 * and then when the back end returns an error, we can return the
-	 * aborted command to the FETD, so it can clean up its resources.
-	 */
-	if (control_softc->flags & CTL_FLAG_TASK_PENDING)
-		ctl_run_task_queue(control_softc);
 
 	/*
 	 * This command has been aborted.  Set the port status, so we fail
@@ -13365,42 +13268,23 @@ ctl_queue(union ctl_io *io)
 	getbintime(&io->io_hdr.start_bt);
 #endif /* CTL_TIME_IO */
 
-	mtx_lock(&ctl_softc->ctl_lock);
-
 	switch (io->io_hdr.io_type) {
 	case CTL_IO_SCSI:
+		mtx_lock(&ctl_softc->ctl_lock);
 		STAILQ_INSERT_TAIL(&ctl_softc->incoming_queue, &io->io_hdr,
 				   links);
+		mtx_unlock(&ctl_softc->ctl_lock);
+		ctl_wakeup_thread();
 		break;
 	case CTL_IO_TASK:
-		STAILQ_INSERT_TAIL(&ctl_softc->task_queue, &io->io_hdr, links);
-		/*
-		 * Set the task pending flag.  This is necessary to close a
-		 * race condition with the FETD:
-		 *
-		 * - FETD submits a task management command, like an abort.
-		 * - Back end calls fe_datamove() to move the data for the
-		 *   aborted command.  The FETD can't really accept it, but
-		 *   if it did, it would end up transmitting data for a
-		 *   command that the initiator told us to abort.
-		 *
-		 * We close the race condition by setting the flag here,
-		 * and checking it in ctl_datamove(), before calling the
-		 * FETD's fe_datamove routine.  If we've got a task
-		 * pending, we run the task queue and then check to see
-		 * whether our particular I/O has been aborted.
-		 */
-		ctl_softc->flags |= CTL_FLAG_TASK_PENDING;
+		mtx_lock(&ctl_softc->ctl_lock);
+		ctl_run_task(io);
+		mtx_unlock(&ctl_softc->ctl_lock);
 		break;
 	default:
-		mtx_unlock(&ctl_softc->ctl_lock);
 		printf("ctl_queue: unknown I/O type %d\n", io->io_hdr.io_type);
 		return (-EINVAL);
-		break; /* NOTREACHED */
 	}
-	mtx_unlock(&ctl_softc->ctl_lock);
-
-	ctl_wakeup_thread();
 
 	return (CTL_RETVAL_COMPLETE);
 }
@@ -13580,7 +13464,6 @@ ctl_work_thread(void *arg)
 
 		/*
 		 * We handle the queues in this order:
-		 * - task management
 		 * - ISC
 		 * - done queue (to free up resources, unblock other commands)
 		 * - RtR queue
@@ -13589,11 +13472,6 @@ ctl_work_thread(void *arg)
 		 * If those queues are empty, we break out of the loop and
 		 * go to sleep.
 		 */
-		io = (union ctl_io *)STAILQ_FIRST(&softc->task_queue);
-		if (io != NULL) {
-			ctl_run_task_queue(softc);
-			continue;
-		}
 		io = (union ctl_io *)STAILQ_FIRST(&softc->isc_queue);
 		if (io != NULL) {
 			STAILQ_REMOVE_HEAD(&softc->isc_queue, links);

Modified: head/sys/cam/ctl/ctl_private.h
==============================================================================
--- head/sys/cam/ctl/ctl_private.h	Thu Jun 19 13:18:23 2014	(r267642)
+++ head/sys/cam/ctl/ctl_private.h	Thu Jun 19 13:19:35 2014	(r267643)
@@ -401,7 +401,6 @@ struct ctl_lun {
 };
 
 typedef enum {
-	CTL_FLAG_TASK_PENDING	= 0x01,
 	CTL_FLAG_REAL_SYNC	= 0x02,
 	CTL_FLAG_MASTER_SHELF	= 0x04
 } ctl_gen_flags;
@@ -438,7 +437,6 @@ struct ctl_softc {
 	uint64_t aps_locked_lun;
 	STAILQ_HEAD(, ctl_lun) lun_list;
 	STAILQ_HEAD(, ctl_be_lun) pending_lun_queue;
-	STAILQ_HEAD(, ctl_io_hdr) task_queue;
 	STAILQ_HEAD(, ctl_io_hdr) incoming_queue;
 	STAILQ_HEAD(, ctl_io_hdr) rtr_queue;
 	STAILQ_HEAD(, ctl_io_hdr) done_queue;

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 13:35:06 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C4AA85D5;
 Thu, 19 Jun 2014 13:35:06 +0000 (UTC)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9D2E8211D;
 Thu, 19 Jun 2014 13:35:06 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 8096CB9D2;
 Thu, 19 Jun 2014 09:35:05 -0400 (EDT)
From: John Baldwin 
To: Aleksandr Rybalko 
Subject: Re: svn commit: r267626 - head/sys/dev/vt
Date: Thu, 19 Jun 2014 09:24:01 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; )
References: <201406182230.s5IMUMYp006946@svn.freebsd.org>
In-Reply-To: <201406182230.s5IMUMYp006946@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201406190924.01792.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Thu, 19 Jun 2014 09:35:05 -0400 (EDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 13:35:06 -0000

On Wednesday, June 18, 2014 6:30:22 pm Aleksandr Rybalko wrote:
> Author: ray
> Date: Wed Jun 18 22:30:22 2014
> New Revision: 267626
> URL: http://svnweb.freebsd.org/changeset/base/267626
> 
> Log:
>   Suspend vt(4) initialization if "kern.vt.disable" kenv is set.
>   
>   MFC after:	1 week
>   Sponsored by:	The FreeBSD Foundation

So what happens by default if both vt and syscons are in a kernel if the user 
doesn't set one of the 'disable' tunables?  If that doesn't work, then I think 
we would rather have a 'kern.vidconsole' tunable that can be set to either
'sc' or 'vt' (possibly 'syscons' instead of 'sc') so that it is clearer for
users how to switch between them.

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 13:49:07 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1F407D3C;
 Thu, 19 Jun 2014 13:49:07 +0000 (UTC)
Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35])
 by mx1.freebsd.org (Postfix) with ESMTP id AE2BC224F;
 Thu, 19 Jun 2014 13:49:06 +0000 (UTC)
Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534)
 id 6D5B420E7088B; Thu, 19 Jun 2014 13:48:59 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
 smtp1.multiplay.co.uk
X-Spam-Level: **
X-Spam-Status: No, score=2.2 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX,
 FSL_HELO_NON_FQDN_1,HELO_NO_DOMAIN,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no
 version=3.3.1
Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170])
 by smtp1.multiplay.co.uk (Postfix) with ESMTPS id 0509D20E70885;
 Thu, 19 Jun 2014 13:48:53 +0000 (UTC)
Message-ID: <11AED2470A6E45B1A3BB2B9549C78B62@multiplay.co.uk>
From: "Steven Hartland" 
To: "Aleksandr Rybalko" , ,
 , 
References: <201406182230.s5IMUMYp006946@svn.freebsd.org>
Subject: Re: svn commit: r267626 - head/sys/dev/vt
Date: Thu, 19 Jun 2014 14:48:50 +0100
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 13:49:07 -0000

As per man 9 sysctl negative logic should be avoided so we should
use enable instead ot disable here:
kern.vt.enable with a default of 1

With the user setting kern.vt.enable=0 to disable.

    Regards
    Steve

----- Original Message ----- 
From: "Aleksandr Rybalko" 
To: ; ; 
Sent: Wednesday, June 18, 2014 11:30 PM
Subject: svn commit: r267626 - head/sys/dev/vt


> Author: ray
> Date: Wed Jun 18 22:30:22 2014
> New Revision: 267626
> URL: http://svnweb.freebsd.org/changeset/base/267626
> 
> Log:
>  Suspend vt(4) initialization if "kern.vt.disable" kenv is set.
>  
>  MFC after: 1 week
>  Sponsored by: The FreeBSD Foundation
> 
> Modified:
>  head/sys/dev/vt/vt_consolectl.c
>  head/sys/dev/vt/vt_core.c
>  head/sys/dev/vt/vt_sysmouse.c
> 
> Modified: head/sys/dev/vt/vt_consolectl.c
> ==============================================================================
> --- head/sys/dev/vt/vt_consolectl.c Wed Jun 18 22:23:10 2014 (r267625)
> +++ head/sys/dev/vt/vt_consolectl.c Wed Jun 18 22:30:22 2014 (r267626)
> @@ -73,6 +73,8 @@ static void
> consolectl_drvinit(void *unused)
> {
> 
> + if (getenv("kern.vt.disable"))
> + return;
>  make_dev(&consolectl_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600,
>      "consolectl");
> }
> 
> Modified: head/sys/dev/vt/vt_core.c
> ==============================================================================
> --- head/sys/dev/vt/vt_core.c Wed Jun 18 22:23:10 2014 (r267625)
> +++ head/sys/dev/vt/vt_core.c Wed Jun 18 22:30:22 2014 (r267626)
> @@ -215,6 +215,8 @@ static void
> vt_update_static(void *dummy)
> {
> 
> + if (getenv("kern.vt.disable"))
> + return;
>  if (main_vd->vd_driver != NULL)
>  printf("VT: running with driver \"%s\".\n",
>      main_vd->vd_driver->vd_name);
> @@ -957,6 +959,9 @@ vtterm_cnprobe(struct terminal *tm, stru
>  struct vt_device *vd = vw->vw_device;
>  struct winsize wsz;
> 
> + if (getenv("kern.vt.disable"))
> + return;
> +
>  if (vd->vd_flags & VDF_INITIALIZED)
>  /* Initialization already done. */
>  return;
> @@ -1991,6 +1996,9 @@ vt_upgrade(struct vt_device *vd)
>  struct vt_window *vw;
>  unsigned int i;
> 
> + if (getenv("kern.vt.disable"))
> + return;
> +
>  for (i = 0; i < VT_MAXWINDOWS; i++) {
>  vw = vd->vd_windows[i];
>  if (vw == NULL) {
> @@ -2056,6 +2064,9 @@ vt_allocate(struct vt_driver *drv, void 
>  struct vt_device *vd;
>  struct winsize wsz;
> 
> + if (getenv("kern.vt.disable"))
> + return;
> +
>  if (main_vd->vd_driver == NULL) {
>  main_vd->vd_driver = drv;
>  printf("VT: initialize with new VT driver \"%s\".\n",
> 
> Modified: head/sys/dev/vt/vt_sysmouse.c
> ==============================================================================
> --- head/sys/dev/vt/vt_sysmouse.c Wed Jun 18 22:23:10 2014 (r267625)
> +++ head/sys/dev/vt/vt_sysmouse.c Wed Jun 18 22:30:22 2014 (r267626)
> @@ -405,6 +405,8 @@ static void
> sysmouse_drvinit(void *unused)
> {
> 
> + if (getenv("kern.vt.disable"))
> + return;
>  mtx_init(&sysmouse_lock, "sysmouse", NULL, MTX_DEF);
>  cv_init(&sysmouse_sleep, "sysmrd");
>  make_dev(&sysmouse_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600,
> 
>

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 14:04:16 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 41709568;
 Thu, 19 Jun 2014 14:04:16 +0000 (UTC)
Received: from mail-qa0-x233.google.com (mail-qa0-x233.google.com
 [IPv6:2607:f8b0:400d:c00::233])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id C43EB2425;
 Thu, 19 Jun 2014 14:04:15 +0000 (UTC)
Received: by mail-qa0-f51.google.com with SMTP id j7so2008482qaq.10
 for ; Thu, 19 Jun 2014 07:04:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date:message-id:subject
 :from:to:cc:content-type;
 bh=wCpCWBT6ACyhnHw6KaxHdOvgBMPlZNOkVHtf4Cv4L/E=;
 b=IkVmeWVVzSQPM2fCvAo2WGD8KrYxXs6V2bkzo8UhFYR0QEmFJTtJyTQQ4Hzd8UhmwZ
 beVkYfVjQVlCh+2k/lQ+Qp3RCz7xnKJnElCJ+eirMPGgB2ml42Yz27d6ZuQWQs3qWUwN
 rLgR0IvCMDDoKRoaZeXhPV9wKLaMOlhyQuRCabbntR1J6F6I1GlCT1JfTca/jcAwp6gt
 WzTlqSnc1/CFQEdP2RRlXLoiqqmGup4EKwz2yZUro3yvn8YXndUI+psZ01B1IfdUreA9
 mXkxj/AZPNJizdjINel1H3kDoBhgMuTeg3wt8KiLQZJTenP7hyPrMp1NLiv9oCIlGbvQ
 7nug==
MIME-Version: 1.0
X-Received: by 10.224.16.139 with SMTP id o11mr7551378qaa.80.1403186654843;
 Thu, 19 Jun 2014 07:04:14 -0700 (PDT)
Sender: carpeddiem@gmail.com
Received: by 10.140.49.239 with HTTP; Thu, 19 Jun 2014 07:04:14 -0700 (PDT)
In-Reply-To: <11AED2470A6E45B1A3BB2B9549C78B62@multiplay.co.uk>
References: <201406182230.s5IMUMYp006946@svn.freebsd.org>
 <11AED2470A6E45B1A3BB2B9549C78B62@multiplay.co.uk>
Date: Thu, 19 Jun 2014 10:04:14 -0400
X-Google-Sender-Auth: 2FHvJ9X-9Fmf_Z1wbExKn2-VIQE
Message-ID: 
Subject: Re: svn commit: r267626 - head/sys/dev/vt
From: Ed Maste 
To: Steven Hartland 
Content-Type: text/plain; charset=UTF-8
Cc: "svn-src-head@freebsd.org" ,
 Aleksandr Rybalko ,
 "src-committers@freebsd.org" ,
 "svn-src-all@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 14:04:16 -0000

On 19 June 2014 09:48, Steven Hartland  wrote:
> As per man 9 sysctl negative logic should be avoided so we should
> use enable instead ot disable here:
> kern.vt.enable with a default of 1
>
> With the user setting kern.vt.enable=0 to disable.

I prefer John's suggestion of kern.vidconsole={sc,vt}.  Making it
available as a read-only sysctl gives us a canonical way to determine
which vidconsole is in use (rather than checking for the existence of
the kern.vt.deadtimer sysctl, which some tools currently do).

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 14:07:30 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id BF98E77C;
 Thu, 19 Jun 2014 14:07:30 +0000 (UTC)
Received: from mail-qg0-x22b.google.com (mail-qg0-x22b.google.com
 [IPv6:2607:f8b0:400d:c04::22b])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 4EF4F245E;
 Thu, 19 Jun 2014 14:07:30 +0000 (UTC)
Received: by mail-qg0-f43.google.com with SMTP id z60so2152646qgd.16
 for ; Thu, 19 Jun 2014 07:07:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date:message-id:subject
 :from:to:cc:content-type;
 bh=lqMqB7tvZQ2yyEhx97O0VWHOCjRB6ALCw7xUh70p/HA=;
 b=lgMsrTgsm7om2FoquEo+wNn7X1AjwwKSmpp18FpPYToik51soXR7Tpkzocga3v/t5T
 PMha0wyGhpbkcN2q1hNd4CxMER/iuJSgjcCvlNUyG7gCDhf/wI5DG4VA2TTVanwgFQDv
 M7BukfDlzqLI28JNXQUqamsuwYFSemjXJ3xcrWbIt4/SHIMS6JC/fLguJZnBPAnF5pqA
 d2oxXc2CQcwCnDABh693/RnO7fTUrzn5HqPWDVmHGYKZDuvn6FWpZ+KPeQJMvA2fhOoz
 f+JH2sdjStxNFoVhyb27ANcH1W+mwA4ApScZ3+NhFv4n+Q/awuUK7C9cIiIkPE5iwegU
 UwqQ==
MIME-Version: 1.0
X-Received: by 10.140.82.180 with SMTP id h49mr7136013qgd.84.1403186849079;
 Thu, 19 Jun 2014 07:07:29 -0700 (PDT)
Sender: mdf356@gmail.com
Received: by 10.229.170.195 with HTTP; Thu, 19 Jun 2014 07:07:29 -0700 (PDT)
In-Reply-To: <201406190528.s5J5Sg8m099792@svn.freebsd.org>
References: <201406190528.s5J5Sg8m099792@svn.freebsd.org>
Date: Thu, 19 Jun 2014 07:07:29 -0700
X-Google-Sender-Auth: 3rlofmZsZvk7wj_sn4pWc_lIMtQ
Message-ID: 
Subject: Re: svn commit: r267633 - head/sys/sys
From: Matthew Fleming 
To: Hans Petter Selasky 
Content-Type: text/plain; charset=UTF-8
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 14:07:30 -0000

On Wed, Jun 18, 2014 at 10:28 PM, Hans Petter Selasky
 wrote:
> Author: hselasky
> Date: Thu Jun 19 05:28:42 2014
> New Revision: 267633
> URL: http://svnweb.freebsd.org/changeset/base/267633
>
> Log:
>   Initialize sysctl OID structure by record.
>
>   MFC after:    2 weeks
>
> Modified:
>   head/sys/sys/sysctl.h
>
> Modified: head/sys/sys/sysctl.h
> ==============================================================================
> --- head/sys/sys/sysctl.h       Thu Jun 19 05:10:03 2014        (r267632)
> +++ head/sys/sys/sysctl.h       Thu Jun 19 05:28:42 2014        (r267633)
> @@ -278,19 +278,16 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a
>  /* This constructs a "raw" MIB oid. */
>  #define        SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr)\
>         static struct sysctl_oid sysctl__##parent##_##name = {          \
> -               &sysctl_##parent##_children,                            \
> -               { NULL },                                               \
> -               nbr,                                                    \
> -               kind,                                                   \
> -               a1,                                                     \
> -               a2,                                                     \
> -               #name,                                                  \
> -               handler,                                                \
> -               fmt,                                                    \
> -               0,                                                      \
> -               0,                                                      \
> -               __DESCR(descr)                                          \
> -               };                                                      \
> +               .oid_parent = &sysctl_##parent##_children,              \
> +               .oid_number = (nbr),                                    \
> +               .oid_kind = (kind),                                     \
> +               .oid_arg1 = (a1),                                       \
> +               .oid_arg2 = (a2),                                       \
> +               .oid_name = #name,                                      \
> +               .oid_handler = (handler),                               \
> +               .oid_fmt = (fmt),                                       \
> +               .oid_descr = __DESCR(descr)                             \
> +       };                                                              \
>         DATA_SET(sysctl_set, sysctl__##parent##_##name)
>
>  #define        SYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
>

C++ kernel modules break with this change, as C++ doesn't have the
same syntax for named initializers.

Thanks,
matthew

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 16:26:16 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id CB72AF03;
 Thu, 19 Jun 2014 16:26:16 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id AC6CF2175;
 Thu, 19 Jun 2014 16:26:16 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5JGQGWa020052;
 Thu, 19 Jun 2014 16:26:16 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5JGQG7a020051;
 Thu, 19 Jun 2014 16:26:16 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201406191626.s5JGQG7a020051@svn.freebsd.org>
From: Alan Cox 
Date: Thu, 19 Jun 2014 16:26:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267645 - head/sys/vm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 16:26:17 -0000

Author: alc
Date: Thu Jun 19 16:26:16 2014
New Revision: 267645
URL: http://svnweb.freebsd.org/changeset/base/267645

Log:
  When MAP_STACK_GROWS_{DOWN,UP} are passed to vm_map_insert() set the
  corresponding flag(s) in the new map entry.  Previously, the caller was
  responsible for setting them after vm_map_insert() returned.
  
  Pass MAP_STACK_GROWS_DOWN to vm_map_insert() from vm_map_growstack() when
  extending the stack in the downward direction.
  
  Together these changes slightly simplify the caller's task when creating a
  downward growing stack.  In particular, the caller no longer needs to clip
  the previous entry, because the new stack entry can't possibly coalesce
  with the previous entry.
  
  Reviewed by:	kib
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Thu Jun 19 15:52:46 2014	(r267644)
+++ head/sys/vm/vm_map.c	Thu Jun 19 16:26:16 2014	(r267645)
@@ -1159,6 +1159,10 @@ vm_map_insert(vm_map_t map, vm_object_t 
 		protoeflags |= MAP_ENTRY_NOSYNC;
 	if (cow & MAP_DISABLE_COREDUMP)
 		protoeflags |= MAP_ENTRY_NOCOREDUMP;
+	if (cow & MAP_STACK_GROWS_DOWN)
+		protoeflags |= MAP_ENTRY_GROWS_DOWN;
+	if (cow & MAP_STACK_GROWS_UP)
+		protoeflags |= MAP_ENTRY_GROWS_UP;
 	if (cow & MAP_VN_WRITECOUNT)
 		protoeflags |= MAP_ENTRY_VN_WRITECNT;
 	if (cow & MAP_INHERIT_SHARE)
@@ -3445,17 +3449,17 @@ vm_map_stack_locked(vm_map_t map, vm_off
 
 	/* Now set the avail_ssize amount. */
 	if (rv == KERN_SUCCESS) {
-		if (prev_entry != &map->header)
-			vm_map_clip_end(map, prev_entry, bot);
 		new_entry = prev_entry->next;
 		if (new_entry->end != top || new_entry->start != bot)
 			panic("Bad entry start/end for new stack entry");
 
 		new_entry->avail_ssize = max_ssize - init_ssize;
-		if (orient & MAP_STACK_GROWS_DOWN)
-			new_entry->eflags |= MAP_ENTRY_GROWS_DOWN;
-		if (orient & MAP_STACK_GROWS_UP)
-			new_entry->eflags |= MAP_ENTRY_GROWS_UP;
+		KASSERT((orient & MAP_STACK_GROWS_DOWN) == 0 ||
+		    (new_entry->eflags & MAP_ENTRY_GROWS_DOWN) != 0,
+		    ("new entry lacks MAP_ENTRY_GROWS_DOWN"));
+		KASSERT((orient & MAP_STACK_GROWS_UP) == 0 ||
+		    (new_entry->eflags & MAP_ENTRY_GROWS_UP) != 0,
+		    ("new entry lacks MAP_ENTRY_GROWS_UP"));
 	}
 
 	return (rv);
@@ -3675,21 +3679,21 @@ Retry:
 		}
 
 		rv = vm_map_insert(map, NULL, 0, addr, stack_entry->start,
-		    next_entry->protection, next_entry->max_protection, 0);
+		    next_entry->protection, next_entry->max_protection,
+		    MAP_STACK_GROWS_DOWN);
 
 		/* Adjust the available stack space by the amount we grew. */
 		if (rv == KERN_SUCCESS) {
-			if (prev_entry != &map->header)
-				vm_map_clip_end(map, prev_entry, addr);
 			new_entry = prev_entry->next;
 			KASSERT(new_entry == stack_entry->prev, ("foo"));
 			KASSERT(new_entry->end == stack_entry->start, ("foo"));
 			KASSERT(new_entry->start == addr, ("foo"));
+			KASSERT((new_entry->eflags & MAP_ENTRY_GROWS_DOWN) !=
+			    0, ("new entry lacks MAP_ENTRY_GROWS_DOWN"));
 			grow_amount = new_entry->end - new_entry->start;
 			new_entry->avail_ssize = stack_entry->avail_ssize -
 			    grow_amount;
 			stack_entry->eflags &= ~MAP_ENTRY_GROWS_DOWN;
-			new_entry->eflags |= MAP_ENTRY_GROWS_DOWN;
 		}
 	} else {
 		/*

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 16:57:27 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 165B66EA;
 Thu, 19 Jun 2014 16:57:27 +0000 (UTC)
Received: from mail-qg0-x22b.google.com (mail-qg0-x22b.google.com
 [IPv6:2607:f8b0:400d:c04::22b])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 99E502451;
 Thu, 19 Jun 2014 16:57:26 +0000 (UTC)
Received: by mail-qg0-f43.google.com with SMTP id z60so2401291qgd.30
 for ; Thu, 19 Jun 2014 09:57:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date:message-id:subject
 :from:to:cc:content-type;
 bh=dFCIQ2n0RxMlFmlJJzSto4+xpcCLKDAcqc/Ls4xjhZY=;
 b=CBjXrD0BhEUytDd+hD9QrPgrY2XcFBPjuw17VCmG0kNh5ZJZbUe8wyQ3Y9zOVuuwqn
 QPbIMIgU/4xc1QMMV4o1Y9BopYsVceCci6EO5TOYGkUFdp2wUiWUL8W28aaMj4AOSWgf
 49GA5NKvscFVo+X7Bd6+GIyLLjIitxmYNWan4yZn7YNNZ6Ye5tVjgS83GRur0AxMvsKC
 XK29A4rbVZV2jWQxREwscvg/zks3NVcToeAku403DGlHX5/sakfOq6zrd4W68vxM7c7w
 JrTHVPFt507K7WXPIstRYQSS5h27WoPrXkMln/HUgTRoHBi2e/TV3vZSidPtpV3tJEsz
 Y+Ng==
MIME-Version: 1.0
X-Received: by 10.224.130.136 with SMTP id t8mr9277727qas.49.1403197045785;
 Thu, 19 Jun 2014 09:57:25 -0700 (PDT)
Sender: adrian.chadd@gmail.com
Received: by 10.224.43.134 with HTTP; Thu, 19 Jun 2014 09:57:25 -0700 (PDT)
In-Reply-To: <201406190946.s5J9khBe031610@svn.freebsd.org>
References: <201406190946.s5J9khBe031610@svn.freebsd.org>
Date: Thu, 19 Jun 2014 09:57:25 -0700
X-Google-Sender-Auth: Fx7nV1gNJme4bOFmNKJchPbGM_E
Message-ID: 
Subject: Re: svn commit: r267639 - head/sys/cam/ctl
From: Adrian Chadd 
To: Alexander Motin 
Content-Type: text/plain; charset=UTF-8
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 16:57:27 -0000

FreeBSD_version?


-a


On 19 June 2014 02:46, Alexander Motin  wrote:
> Author: mav
> Date: Thu Jun 19 09:46:43 2014
> New Revision: 267639
> URL: http://svnweb.freebsd.org/changeset/base/267639
>
> Log:
>   Increase CTL_DEVID_LEN from 16 to 64 bytes.
>
>   SPC-4 recommends T10 vendor ID based LUN ID was created by concatenating
>   product name and serial number (and istgt follows that).  But product name
>   is 16 bytes long by itself, so 16 bytes total length is clearly not enough
>   to fit both.
>
>   To keep compatibility with existing configurations, pad short device IDs
>   to old length of 16, same as before.
>
>   This change probably breaks CTL user-level ABI, so control tools should
>   be rebuilt after this change.
>
>   MFC after:    2 weeks
>
> Modified:
>   head/sys/cam/ctl/ctl.c
>   head/sys/cam/ctl/ctl.h
>   head/sys/cam/ctl/ctl_frontend_iscsi.c
>
> Modified: head/sys/cam/ctl/ctl.c
> ==============================================================================
> --- head/sys/cam/ctl/ctl.c      Thu Jun 19 09:08:20 2014        (r267638)
> +++ head/sys/cam/ctl/ctl.c      Thu Jun 19 09:46:43 2014        (r267639)
> @@ -91,12 +91,6 @@ struct ctl_softc *control_softc = NULL;
>  #define CTL_DONE_THREAD
>
>  /*
> - * Use the serial number and device ID provided by the backend, rather than
> - * making up our own.
> - */
> -#define CTL_USE_BACKEND_SN
> -
> -/*
>   * Size and alignment macros needed for Copan-specific HA hardware.  These
>   * can go away when the HA code is re-written, and uses busdma for any
>   * hardware.
> @@ -9477,9 +9471,6 @@ ctl_inquiry_evpd_serial(struct ctl_scsii
>  {
>         struct scsi_vpd_unit_serial_number *sn_ptr;
>         struct ctl_lun *lun;
> -#ifndef CTL_USE_BACKEND_SN
> -       char tmpstr[32];
> -#endif
>
>         lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
>
> @@ -9513,7 +9504,6 @@ ctl_inquiry_evpd_serial(struct ctl_scsii
>
>         sn_ptr->page_code = SVPD_UNIT_SERIAL_NUMBER;
>         sn_ptr->length = ctl_min(sizeof(*sn_ptr) - 4, CTL_SN_LEN);
> -#ifdef CTL_USE_BACKEND_SN
>         /*
>          * If we don't have a LUN, we just leave the serial number as
>          * all spaces.
> @@ -9523,15 +9513,6 @@ ctl_inquiry_evpd_serial(struct ctl_scsii
>                 strncpy((char *)sn_ptr->serial_num,
>                         (char *)lun->be_lun->serial_num, CTL_SN_LEN);
>         }
> -#else
> -       /*
> -        * Note that we're using a non-unique serial number here,
> -        */
> -       snprintf(tmpstr, sizeof(tmpstr), "MYSERIALNUMIS000");
> -       memset(sn_ptr->serial_num, 0x20, sizeof(sn_ptr->serial_num));
> -       strncpy(sn_ptr->serial_num, tmpstr, ctl_min(CTL_SN_LEN,
> -               ctl_min(sizeof(tmpstr), sizeof(*sn_ptr) - 4)));
> -#endif
>         ctsio->scsi_status = SCSI_STATUS_OK;
>
>         ctsio->be_move_done = ctl_config_move_done;
> @@ -9552,10 +9533,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
>         struct ctl_lun *lun;
>         struct ctl_frontend *fe;
>         char *val;
> -#ifndef CTL_USE_BACKEND_SN
> -       char tmpstr[32];
> -#endif /* CTL_USE_BACKEND_SN */
> -       int devid_len;
> +       int data_len, devid_len;
>
>         ctl_softc = control_softc;
>
> @@ -9568,23 +9546,30 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
>
>         lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
>
> -       devid_len = sizeof(struct scsi_vpd_device_id) +
> +       if (lun == NULL) {
> +               devid_len = CTL_DEVID_MIN_LEN;
> +       } else {
> +               devid_len = max(CTL_DEVID_MIN_LEN,
> +                   strnlen(lun->be_lun->device_id, CTL_DEVID_LEN));
> +       }
> +
> +       data_len = sizeof(struct scsi_vpd_device_id) +
>                 sizeof(struct scsi_vpd_id_descriptor) +
> -               sizeof(struct scsi_vpd_id_t10) + CTL_DEVID_LEN +
> +               sizeof(struct scsi_vpd_id_t10) + devid_len +
>                 sizeof(struct scsi_vpd_id_descriptor) + CTL_WWPN_LEN +
>                 sizeof(struct scsi_vpd_id_descriptor) +
>                 sizeof(struct scsi_vpd_id_rel_trgt_port_id) +
>                 sizeof(struct scsi_vpd_id_descriptor) +
>                 sizeof(struct scsi_vpd_id_trgt_port_grp_id);
>
> -       ctsio->kern_data_ptr = malloc(devid_len, M_CTL, M_WAITOK | M_ZERO);
> +       ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
>         devid_ptr = (struct scsi_vpd_device_id *)ctsio->kern_data_ptr;
>         ctsio->kern_sg_entries = 0;
>
> -       if (devid_len < alloc_len) {
> -               ctsio->residual = alloc_len - devid_len;
> -               ctsio->kern_data_len = devid_len;
> -               ctsio->kern_total_len = devid_len;
> +       if (data_len < alloc_len) {
> +               ctsio->residual = alloc_len - data_len;
> +               ctsio->kern_data_len = data_len;
> +               ctsio->kern_total_len = data_len;
>         } else {
>                 ctsio->residual = 0;
>                 ctsio->kern_data_len = alloc_len;
> @@ -9597,7 +9582,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
>         desc = (struct scsi_vpd_id_descriptor *)devid_ptr->desc_list;
>         t10id = (struct scsi_vpd_id_t10 *)&desc->identifier[0];
>         desc1 = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] +
> -               sizeof(struct scsi_vpd_id_t10) + CTL_DEVID_LEN);
> +               sizeof(struct scsi_vpd_id_t10) + devid_len);
>         desc2 = (struct scsi_vpd_id_descriptor *)(&desc1->identifier[0] +
>                   CTL_WWPN_LEN);
>         desc3 = (struct scsi_vpd_id_descriptor *)(&desc2->identifier[0] +
> @@ -9615,7 +9600,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
>
>         devid_ptr->page_code = SVPD_DEVICE_ID;
>
> -       scsi_ulto2b(devid_len - 4, devid_ptr->length);
> +       scsi_ulto2b(data_len - 4, devid_ptr->length);
>
>         mtx_lock(&ctl_softc->ctl_lock);
>
> @@ -9644,7 +9629,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
>          * per-LUN identifier.
>          */
>         desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10;
> -       desc->length = sizeof(*t10id) + CTL_DEVID_LEN;
> +       desc->length = sizeof(*t10id) + devid_len;
>         if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) {
>                 strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor));
>         } else {
> @@ -9701,7 +9686,6 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
>         else
>                 desc3->identifier[3] = 2;
>
> -#ifdef CTL_USE_BACKEND_SN
>         /*
>          * If we've actually got a backend, copy the device id from the
>          * per-LUN data.  Otherwise, set it to all spaces.
> @@ -9711,19 +9695,13 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
>                  * Copy the backend's LUN ID.
>                  */
>                 strncpy((char *)t10id->vendor_spec_id,
> -                       (char *)lun->be_lun->device_id, CTL_DEVID_LEN);
> +                       (char *)lun->be_lun->device_id, devid_len);
>         } else {
>                 /*
>                  * No backend, set this to spaces.
>                  */
> -               memset(t10id->vendor_spec_id, 0x20, CTL_DEVID_LEN);
> +               memset(t10id->vendor_spec_id, 0x20, devid_len);
>         }
> -#else
> -       snprintf(tmpstr, sizeof(tmpstr), "MYDEVICEIDIS%4d",
> -                (lun != NULL) ?  (int)lun->lun : 0);
> -       strncpy(t10id->vendor_spec_id, tmpstr, ctl_min(CTL_DEVID_LEN,
> -               sizeof(tmpstr)));
> -#endif
>
>         ctsio->scsi_status = SCSI_STATUS_OK;
>
>
> Modified: head/sys/cam/ctl/ctl.h
> ==============================================================================
> --- head/sys/cam/ctl/ctl.h      Thu Jun 19 09:08:20 2014        (r267638)
> +++ head/sys/cam/ctl/ctl.h      Thu Jun 19 09:46:43 2014        (r267639)
> @@ -96,7 +96,8 @@ union ctl_modepage_info {
>  /*
>   * Device ID length, for VPD page 0x83.
>   */
> -#define        CTL_DEVID_LEN   16
> +#define        CTL_DEVID_LEN   64
> +#define        CTL_DEVID_MIN_LEN       16
>  /*
>   * WWPN length, for VPD page 0x83.
>   */
>
> Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
> ==============================================================================
> --- head/sys/cam/ctl/ctl_frontend_iscsi.c       Thu Jun 19 09:08:20 2014        (r267638)
> +++ head/sys/cam/ctl/ctl_frontend_iscsi.c       Thu Jun 19 09:46:43 2014        (r267639)
> @@ -2060,7 +2060,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio,
>         const struct icl_pdu *request;
>         int i, ret;
>         char *val;
> -       size_t devid_len, wwnn_len, wwpn_len, lun_name_len;
> +       size_t data_len, devid_len, wwnn_len, wwpn_len, lun_name_len;
>
>         lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
>         request = ctsio->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr;
> @@ -2078,8 +2078,11 @@ cfiscsi_devid(struct ctl_scsiio *ctsio,
>                 wwnn_len += (4 - (wwnn_len % 4));
>
>         if (lun == NULL) {
> +               devid_len = CTL_DEVID_MIN_LEN;
>                 lun_name_len = 0;
>         } else {
> +               devid_len = max(CTL_DEVID_MIN_LEN,
> +                   strnlen(lun->be_lun->device_id, CTL_DEVID_LEN));
>                 lun_name_len = strlen(cs->cs_target->ct_name);
>                 lun_name_len += strlen(",lun,XXXXXXXX");
>                 lun_name_len += 1; /* '\0' */
> @@ -2087,9 +2090,9 @@ cfiscsi_devid(struct ctl_scsiio *ctsio,
>                         lun_name_len += (4 - (lun_name_len % 4));
>         }
>
> -       devid_len = sizeof(struct scsi_vpd_device_id) +
> +       data_len = sizeof(struct scsi_vpd_device_id) +
>                 sizeof(struct scsi_vpd_id_descriptor) +
> -               sizeof(struct scsi_vpd_id_t10) + CTL_DEVID_LEN +
> +               sizeof(struct scsi_vpd_id_t10) + devid_len +
>                 sizeof(struct scsi_vpd_id_descriptor) + lun_name_len +
>                 sizeof(struct scsi_vpd_id_descriptor) + wwnn_len +
>                 sizeof(struct scsi_vpd_id_descriptor) + wwpn_len +
> @@ -2098,14 +2101,14 @@ cfiscsi_devid(struct ctl_scsiio *ctsio,
>                 sizeof(struct scsi_vpd_id_descriptor) +
>                 sizeof(struct scsi_vpd_id_trgt_port_grp_id);
>
> -       ctsio->kern_data_ptr = malloc(devid_len, M_CTL, M_WAITOK | M_ZERO);
> +       ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
>         devid_ptr = (struct scsi_vpd_device_id *)ctsio->kern_data_ptr;
>         ctsio->kern_sg_entries = 0;
>
> -       if (devid_len < alloc_len) {
> -               ctsio->residual = alloc_len - devid_len;
> -               ctsio->kern_data_len = devid_len;
> -               ctsio->kern_total_len = devid_len;
> +       if (data_len < alloc_len) {
> +               ctsio->residual = alloc_len - data_len;
> +               ctsio->kern_data_len = data_len;
> +               ctsio->kern_total_len = data_len;
>         } else {
>                 ctsio->residual = 0;
>                 ctsio->kern_data_len = alloc_len;
> @@ -2118,7 +2121,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio,
>         desc = (struct scsi_vpd_id_descriptor *)devid_ptr->desc_list;
>         t10id = (struct scsi_vpd_id_t10 *)&desc->identifier[0];
>         desc1 = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] +
> -           sizeof(struct scsi_vpd_id_t10) + CTL_DEVID_LEN);
> +           sizeof(struct scsi_vpd_id_t10) + devid_len);
>         desc2 = (struct scsi_vpd_id_descriptor *)(&desc1->identifier[0] +
>             lun_name_len);
>         desc3 = (struct scsi_vpd_id_descriptor *)(&desc2->identifier[0] +
> @@ -2136,7 +2139,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio,
>
>         devid_ptr->page_code = SVPD_DEVICE_ID;
>
> -       scsi_ulto2b(devid_len - 4, devid_ptr->length);
> +       scsi_ulto2b(data_len - 4, devid_ptr->length);
>
>         /*
>          * We're using a LUN association here.  i.e., this device ID is a
> @@ -2144,7 +2147,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio,
>          */
>         desc->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_ASCII;
>         desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10;
> -       desc->length = sizeof(*t10id) + CTL_DEVID_LEN;
> +       desc->length = sizeof(*t10id) + devid_len;
>         if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) {
>                 strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor));
>         } else {
> @@ -2162,12 +2165,12 @@ cfiscsi_devid(struct ctl_scsiio *ctsio,
>                  * Copy the backend's LUN ID.
>                  */
>                 strncpy((char *)t10id->vendor_spec_id,
> -                   (char *)lun->be_lun->device_id, CTL_DEVID_LEN);
> +                   (char *)lun->be_lun->device_id, devid_len);
>         } else {
>                 /*
>                  * No backend, set this to spaces.
>                  */
> -               memset(t10id->vendor_spec_id, 0x20, CTL_DEVID_LEN);
> +               memset(t10id->vendor_spec_id, 0x20, devid_len);
>         }
>
>         /*
>

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 18:35:14 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C4208E4;
 Thu, 19 Jun 2014 18:35:14 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B1B7C2D67;
 Thu, 19 Jun 2014 18:35:14 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5JIZEQp080195;
 Thu, 19 Jun 2014 18:35:14 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5JIZE5w080194;
 Thu, 19 Jun 2014 18:35:14 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201406191835.s5JIZE5w080194@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 19 Jun 2014 18:35:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267647 - head/sys/dev/acpica
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 18:35:15 -0000

Author: jhb
Date: Thu Jun 19 18:35:14 2014
New Revision: 267647
URL: http://svnweb.freebsd.org/changeset/base/267647

Log:
  Trust the state of a power resource that get from a working _STA method
  instead of trying to cache it.
  
  Previously, we only trusted the state if we did not have a cached state.
  However, once a state was cached, the _STA method was always ignored.
  Specifically, once a power resource had been turned on once (e.g.
  during resume), the driver assumed it was always on even if _STA said it
  was off and never turned it back on.  This prevented the power resource
  from being turned back on if a laptop was resumed twice, for example.
  
  To fix, just remove the cached state entirely and always use the results
  of _STA.  The loops already skip any resources where _STA fails.
  
  Submitted by:	trasz (initial patch to invoke _ON)
  MFC after:	1 week

Modified:
  head/sys/dev/acpica/acpi_powerres.c

Modified: head/sys/dev/acpica/acpi_powerres.c
==============================================================================
--- head/sys/dev/acpica/acpi_powerres.c	Thu Jun 19 16:28:42 2014	(r267646)
+++ head/sys/dev/acpica/acpi_powerres.c	Thu Jun 19 18:35:14 2014	(r267647)
@@ -64,7 +64,6 @@ ACPI_MODULE_NAME("POWERRES")
 /* Return values from _STA on a power resource */
 #define ACPI_PWR_OFF	0
 #define ACPI_PWR_ON	1
-#define ACPI_PWR_UNK	(-1)
 
 /* A relationship between a power resource and a consumer. */
 struct acpi_powerreference {
@@ -90,7 +89,6 @@ struct acpi_powerresource {
     ACPI_HANDLE				ap_resource;
     UINT64				ap_systemlevel;
     UINT64				ap_order;
-    int					ap_state;
 };
 
 static TAILQ_HEAD(acpi_powerresource_list, acpi_powerresource)
@@ -173,7 +171,6 @@ acpi_pwr_register_resource(ACPI_HANDLE r
     }
     rp->ap_systemlevel = obj->PowerResource.SystemLevel;
     rp->ap_order = obj->PowerResource.ResourceOrder;
-    rp->ap_state = ACPI_PWR_UNK;
     
     /* Sort the resource into the list */
     status = AE_OK;
@@ -638,22 +635,20 @@ acpi_pwr_switch_power(void)
 	    continue;
 	}
 
-	/* We could cache this if we trusted it not to change under us */
 	status = acpi_GetInteger(rp->ap_resource, "_STA", &cur);
 	if (ACPI_FAILURE(status)) {
 	    ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "can't get status of %s - %d\n",
 			      acpi_name(rp->ap_resource), status));
 	    /* XXX is this correct?  Always switch if in doubt? */
 	    continue;
-	} else if (rp->ap_state == ACPI_PWR_UNK)
-	    rp->ap_state = cur;
+	}
 
 	/*
 	 * Switch if required.  Note that we ignore the result of the switch
 	 * effort; we don't know what to do if it fails, so checking wouldn't
 	 * help much.
 	 */
-	if (rp->ap_state != ACPI_PWR_ON) {
+	if (cur != ACPI_PWR_ON) {
 	    status = AcpiEvaluateObject(rp->ap_resource, "_ON", NULL, NULL);
 	    if (ACPI_FAILURE(status)) {
 		ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS,
@@ -661,7 +656,6 @@ acpi_pwr_switch_power(void)
 				 acpi_name(rp->ap_resource),
 				 AcpiFormatException(status)));
 	    } else {
-		rp->ap_state = ACPI_PWR_ON;
 		ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "switched %s on\n",
 				 acpi_name(rp->ap_resource)));
 	    }
@@ -682,22 +676,20 @@ acpi_pwr_switch_power(void)
 	    continue;
 	}
 
-	/* We could cache this if we trusted it not to change under us */
 	status = acpi_GetInteger(rp->ap_resource, "_STA", &cur);
 	if (ACPI_FAILURE(status)) {
 	    ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "can't get status of %s - %d\n",
 			      acpi_name(rp->ap_resource), status));
 	    /* XXX is this correct?  Always switch if in doubt? */
 	    continue;
-	} else if (rp->ap_state == ACPI_PWR_UNK)
-	    rp->ap_state = cur;
+	}
 
 	/*
 	 * Switch if required.  Note that we ignore the result of the switch
 	 * effort; we don't know what to do if it fails, so checking wouldn't
 	 * help much.
 	 */
-	if (rp->ap_state != ACPI_PWR_OFF) {
+	if (cur != ACPI_PWR_OFF) {
 	    status = AcpiEvaluateObject(rp->ap_resource, "_OFF", NULL, NULL);
 	    if (ACPI_FAILURE(status)) {
 		ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS,
@@ -705,7 +697,6 @@ acpi_pwr_switch_power(void)
 				 acpi_name(rp->ap_resource),
 				 AcpiFormatException(status)));
 	    } else {
-		rp->ap_state = ACPI_PWR_OFF;
 		ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "switched %s off\n",
 				 acpi_name(rp->ap_resource)));
 	    }

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 19:28:35 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A538A300;
 Thu, 19 Jun 2014 19:28:35 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 92B352227;
 Thu, 19 Jun 2014 19:28:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5JJSZco004624;
 Thu, 19 Jun 2014 19:28:35 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5JJSZcw004623;
 Thu, 19 Jun 2014 19:28:35 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406191928.s5JJSZcw004623@svn.freebsd.org>
From: Alexander Motin 
Date: Thu, 19 Jun 2014 19:28:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267648 - head/usr.sbin/ctld
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 19:28:35 -0000

Author: mav
Date: Thu Jun 19 19:28:35 2014
New Revision: 267648
URL: http://svnweb.freebsd.org/changeset/base/267648

Log:
  serial_num and device_id fields are not necessarily null-terminated.
  
  Before this it was impossible to use all 16 bytes of serial number, and
  client always got serial number NULL-terminated, that is not required.
  
  MFC after:	2 weeks

Modified:
  head/usr.sbin/ctld/kernel.c

Modified: head/usr.sbin/ctld/kernel.c
==============================================================================
--- head/usr.sbin/ctld/kernel.c	Thu Jun 19 18:35:14 2014	(r267647)
+++ head/usr.sbin/ctld/kernel.c	Thu Jun 19 19:28:35 2014	(r267648)
@@ -413,13 +413,13 @@ kernel_lun_add(struct lun *lun)
 	req.reqdata.create.device_type = T_DIRECT;
 
 	if (lun->l_serial != NULL) {
-		strlcpy(req.reqdata.create.serial_num, lun->l_serial,
+		strncpy(req.reqdata.create.serial_num, lun->l_serial,
 			sizeof(req.reqdata.create.serial_num));
 		req.reqdata.create.flags |= CTL_LUN_FLAG_SERIAL_NUM;
 	}
 
 	if (lun->l_device_id != NULL) {
-		strlcpy(req.reqdata.create.device_id, lun->l_device_id,
+		strncpy(req.reqdata.create.device_id, lun->l_device_id,
 			sizeof(req.reqdata.create.device_id));
 		req.reqdata.create.flags |= CTL_LUN_FLAG_DEVID;
 	}

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 20:05:32 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E4A96E43;
 Thu, 19 Jun 2014 20:05:31 +0000 (UTC)
Received: from mail.turbocat.net (mail.turbocat.net
 [IPv6:2a01:4f8:d16:4514::2])
 (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7605F25CC;
 Thu, 19 Jun 2014 20:05:31 +0000 (UTC)
Received: from laptop015.home.selasky.org
 (cm-176.74.213.204.customer.telag.net [176.74.213.204])
 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits))
 (No client certificate requested)
 by mail.turbocat.net (Postfix) with ESMTPSA id C74C31FE026;
 Thu, 19 Jun 2014 22:05:24 +0200 (CEST)
Message-ID: <53A34293.7090906@selasky.org>
Date: Thu, 19 Jun 2014 22:05:39 +0200
From: Hans Petter Selasky 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:24.0) Gecko/20100101 Thunderbird/24.1.0
MIME-Version: 1.0
To: Matthew Fleming 
Subject: Re: svn commit: r267633 - head/sys/sys
References: <201406190528.s5J5Sg8m099792@svn.freebsd.org>
 
In-Reply-To: 
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 20:05:32 -0000

On 06/19/14 16:07, Matthew Fleming wrote:
> On Wed, Jun 18, 2014 at 10:28 PM, Hans Petter Selasky
>  wrote:
>> Author: hselasky
>> Date: Thu Jun 19 05:28:42 2014
>> New Revision: 267633
>> URL: http://svnweb.freebsd.org/changeset/base/267633
>>
>> Log:
>>    Initialize sysctl OID structure by record.
>>
>>    MFC after:    2 weeks
>>
>> Modified:
>>    head/sys/sys/sysctl.h
>>
>> Modified: head/sys/sys/sysctl.h
>> ==============================================================================
>> --- head/sys/sys/sysctl.h       Thu Jun 19 05:10:03 2014        (r267632)
>> +++ head/sys/sys/sysctl.h       Thu Jun 19 05:28:42 2014        (r267633)
>> @@ -278,19 +278,16 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a
>>   /* This constructs a "raw" MIB oid. */
>>   #define        SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr)\
>>          static struct sysctl_oid sysctl__##parent##_##name = {          \
>> -               &sysctl_##parent##_children,                            \
>> -               { NULL },                                               \
>> -               nbr,                                                    \
>> -               kind,                                                   \
>> -               a1,                                                     \
>> -               a2,                                                     \
>> -               #name,                                                  \
>> -               handler,                                                \
>> -               fmt,                                                    \
>> -               0,                                                      \
>> -               0,                                                      \
>> -               __DESCR(descr)                                          \
>> -               };                                                      \
>> +               .oid_parent = &sysctl_##parent##_children,              \
>> +               .oid_number = (nbr),                                    \
>> +               .oid_kind = (kind),                                     \
>> +               .oid_arg1 = (a1),                                       \
>> +               .oid_arg2 = (a2),                                       \
>> +               .oid_name = #name,                                      \
>> +               .oid_handler = (handler),                               \
>> +               .oid_fmt = (fmt),                                       \
>> +               .oid_descr = __DESCR(descr)                             \
>> +       };                                                              \
>>          DATA_SET(sysctl_set, sysctl__##parent##_##name)
>>
>>   #define        SYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
>>
>
> C++ kernel modules break with this change, as C++ doesn't have the
> same syntax for named initializers.
>


Hi,

Are there any existing C++ kernel modules, or in ports? Even though, C++ 
kernel modules can be compiled with C files aswell, containing the sysctls.

--HPS


From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 20:12:29 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6FA9915B;
 Thu, 19 Jun 2014 20:12:29 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 430DA2693;
 Thu, 19 Jun 2014 20:12:29 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5JKCT7t026922;
 Thu, 19 Jun 2014 20:12:29 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5JKCTsU026921;
 Thu, 19 Jun 2014 20:12:29 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201406192012.s5JKCTsU026921@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Thu, 19 Jun 2014 20:12:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267649 - head/usr.bin/elfdump
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 20:12:29 -0000

Author: marcel
Date: Thu Jun 19 20:12:28 2014
New Revision: 267649
URL: http://svnweb.freebsd.org/changeset/base/267649

Log:
  Don't dump core when the ELF file has no section headers. The ELF
  core files created by gcore are among those.

Modified:
  head/usr.bin/elfdump/elfdump.c

Modified: head/usr.bin/elfdump/elfdump.c
==============================================================================
--- head/usr.bin/elfdump/elfdump.c	Thu Jun 19 19:28:35 2014	(r267648)
+++ head/usr.bin/elfdump/elfdump.c	Thu Jun 19 20:12:28 2014	(r267649)
@@ -495,11 +495,19 @@ main(int ac, char **av)
 	phnum = elf_get_quarter(e, e, E_PHNUM);
 	shentsize = elf_get_quarter(e, e, E_SHENTSIZE);
 	p = (char *)e + phoff;
-	sh = (char *)e + shoff;
-	shnum = elf_get_shnum(e, sh);
-	shstrndx = elf_get_shstrndx(e, sh);
-	offset = elf_get_off(e, (char *)sh + shstrndx * shentsize, SH_OFFSET);
-	shstrtab = (char *)e + offset;
+	if (shoff > 0) {
+		sh = (char *)e + shoff;
+		shnum = elf_get_shnum(e, sh);
+		shstrndx = elf_get_shstrndx(e, sh);
+		offset = elf_get_off(e, (char *)sh + shstrndx * shentsize,
+		    SH_OFFSET);
+		shstrtab = (char *)e + offset;
+	} else {
+		sh = NULL;
+		shnum = 0;
+		shstrndx = 0;
+		shstrtab = NULL;
+	}
 	for (i = 0; (u_int64_t)i < shnum; i++) {
 		name = elf_get_word(e, (char *)sh + i * shentsize, SH_NAME);
 		offset = elf_get_off(e, (char *)sh + i * shentsize, SH_OFFSET);
@@ -616,8 +624,6 @@ elf_print_ehdr(Elf32_Ehdr *e, void *sh)
 	phentsize = elf_get_quarter(e, e, E_PHENTSIZE);
 	phnum = elf_get_quarter(e, e, E_PHNUM);
 	shentsize = elf_get_quarter(e, e, E_SHENTSIZE);
-	shnum = elf_get_shnum(e, sh);
-	shstrndx = elf_get_shstrndx(e, sh);
 	fprintf(out, "\nelf header:\n");
 	fprintf(out, "\n");
 	fprintf(out, "\te_ident: %s %s %s\n", ei_classes[class], ei_data[data],
@@ -633,8 +639,12 @@ elf_print_ehdr(Elf32_Ehdr *e, void *sh)
 	fprintf(out, "\te_phentsize: %jd\n", (intmax_t)phentsize);
 	fprintf(out, "\te_phnum: %jd\n", (intmax_t)phnum);
 	fprintf(out, "\te_shentsize: %jd\n", (intmax_t)shentsize);
-	fprintf(out, "\te_shnum: %jd\n", (intmax_t)shnum);
-	fprintf(out, "\te_shstrndx: %jd\n", (intmax_t)shstrndx);
+	if (sh != NULL) {
+		shnum = elf_get_shnum(e, sh);
+		shstrndx = elf_get_shstrndx(e, sh);
+		fprintf(out, "\te_shnum: %jd\n", (intmax_t)shnum);
+		fprintf(out, "\te_shstrndx: %jd\n", (intmax_t)shstrndx);
+	}
 }
 
 static void
@@ -697,6 +707,11 @@ elf_print_shdr(Elf32_Ehdr *e, void *sh)
 	void *v;
 	int i;
 
+	if (sh == NULL) {
+		fprintf(out, "\nNo section headers\n");
+		return;
+	}
+
 	shentsize = elf_get_quarter(e, e, E_SHENTSIZE);
 	shnum = elf_get_shnum(e, sh);
 	fprintf(out, "\nsection header:\n");

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 20:40:09 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 58E61758;
 Thu, 19 Jun 2014 20:40:09 +0000 (UTC)
Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com
 [66.111.4.25])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2155B287B;
 Thu, 19 Jun 2014 20:40:08 +0000 (UTC)
Received: from compute4.internal (compute4.nyi.mail.srv.osa [10.202.2.44])
 by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id DABB6219F6;
 Thu, 19 Jun 2014 16:39:47 -0400 (EDT)
Received: from frontend2 ([10.202.2.161])
 by compute4.internal (MEProxy); Thu, 19 Jun 2014 16:39:48 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=
 message-id:date:from:mime-version:to:cc:subject:references
 :in-reply-to:content-type:content-transfer-encoding; s=mesmtp;
 bh=ktsNBiIyTlre9LHWG2zGUHzkgRY=; b=QiFtW0twtDwCItlD1sCTuNJVZ82h
 a/xhiwcveEJ5+p22DffMIKw1W/p0q10bH4l9gI/DUFFdLDuuPYMLcX+FwVSfN17y
 xr5ct/VvdWNTbEtF1weETIS6dpZMW+24aqUogvkWnlMPKb2Vk4Jt2cEv3mwcCDs4
 nk2u3htxqm/5dUE=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
 messagingengine.com; h=message-id:date:from:mime-version:to:cc
 :subject:references:in-reply-to:content-type
 :content-transfer-encoding; s=smtpout; bh=ktsNBiIyTlre9LHWG2zGUH
 zkgRY=; b=MX4IJUMV08SSMW1CAC9S0p5mVv01RxnTYaiYih2MoxeZcCXTgsZJqu
 dVov6rpwVtzeNmLxH6GilG3XVt9gHAipW1teqUPnWfiQ78qWY5yEx+MUfdl2nWFK
 CgBLfNLjCYXxtfVClztcKncHWEra7SWa05gvIhOvLFK3+rOI3WrdY=
X-Sasl-enc: 9djSPu8iTRO2D6TsQedasQLmqIdNKYBIIQ21DpHMW2cy 1403210387
Received: from [192.168.1.65] (unknown [31.51.32.90])
 by mail.messagingengine.com (Postfix) with ESMTPA id CAB5D680114;
 Thu, 19 Jun 2014 16:39:46 -0400 (EDT)
Message-ID: <53A34A91.6090401@fastmail.net>
Date: Thu, 19 Jun 2014 21:39:45 +0100
From: Bruce Simpson 
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Hans Petter Selasky , Matthew Fleming 
Subject: Re: svn commit: r267633 - head/sys/sys
References: <201406190528.s5J5Sg8m099792@svn.freebsd.org>
 
 <53A34293.7090906@selasky.org>
In-Reply-To: <53A34293.7090906@selasky.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 20:40:09 -0000

On 19/06/2014 21:05, Hans Petter Selasky wrote:
>
> Are there any existing C++ kernel modules, or in ports? Even though, 
> C++ kernel modules can be compiled with C files aswell, containing the 
> sysctls.

The Click Modular Router is implemented in C++, I have occasionally 
pitched in with keeping it up to date and building on FreeBSD (although 
not for a few years now).

Putting myself in the shoes of a third party developer, I can see that 
C++ compatibility would be important, so I hope a solution can be found 
here.

Bruce

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 21:05:08 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 43BB5D7C;
 Thu, 19 Jun 2014 21:05:08 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 31A032AD4;
 Thu, 19 Jun 2014 21:05:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5JL58SS050686;
 Thu, 19 Jun 2014 21:05:08 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5JL58N0050685;
 Thu, 19 Jun 2014 21:05:08 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201406192105.s5JL58N0050685@svn.freebsd.org>
From: Alan Cox 
Date: Thu, 19 Jun 2014 21:05:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267650 - head/sys/vm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 21:05:08 -0000

Author: alc
Date: Thu Jun 19 21:05:07 2014
New Revision: 267650
URL: http://svnweb.freebsd.org/changeset/base/267650

Log:
  Eliminate a pointless call to vm_map_clip_start() from vm_map_growstack().
  For this call to do anything at all we would have to have two overlapping
  map entries.
  
  Submitted by:	kib

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Thu Jun 19 20:12:28 2014	(r267649)
+++ head/sys/vm/vm_map.c	Thu Jun 19 21:05:07 2014	(r267650)
@@ -3730,9 +3730,6 @@ Retry:
 			stack_entry->avail_ssize -= grow_amount;
 			vm_map_entry_resize_free(map, stack_entry);
 			rv = KERN_SUCCESS;
-
-			if (next_entry != &map->header)
-				vm_map_clip_start(map, next_entry, addr);
 		} else
 			rv = KERN_FAILURE;
 	}

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 19 21:54:42 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id AD7249ED;
 Thu, 19 Jun 2014 21:54:42 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8E4022EED;
 Thu, 19 Jun 2014 21:54:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5JLsgSQ074313;
 Thu, 19 Jun 2014 21:54:42 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5JLsfed074305;
 Thu, 19 Jun 2014 21:54:41 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201406192154.s5JLsfed074305@svn.freebsd.org>
From: Attilio Rao 
Date: Thu, 19 Jun 2014 21:54:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267651 - in head: share/man/man4 sys/dev/cpuctl sys/sys
 usr.sbin/cpucontrol
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 19 Jun 2014 21:54:42 -0000

Author: attilio
Date: Thu Jun 19 21:54:41 2014
New Revision: 267651
URL: http://svnweb.freebsd.org/changeset/base/267651

Log:
  Following comments in r242565 add the possibility to specify ecx when
  performing cpuid calls.
  Add also a new way to specify the level type to cpucontrol(8) as
  reported in the manpage.
  
  Sponsored by:	EMC / Isilon storage division
  Reviewed by:	bdrewery, gcooper
  Testerd by:	bdrewery

Modified:
  head/share/man/man4/cpuctl.4
  head/sys/dev/cpuctl/cpuctl.c
  head/sys/sys/cpuctl.h
  head/usr.sbin/cpucontrol/cpucontrol.8
  head/usr.sbin/cpucontrol/cpucontrol.c

Modified: head/share/man/man4/cpuctl.4
==============================================================================
--- head/share/man/man4/cpuctl.4	Thu Jun 19 21:05:07 2014	(r267650)
+++ head/share/man/man4/cpuctl.4	Thu Jun 19 21:54:41 2014	(r267651)
@@ -86,19 +86,27 @@ Set/clear MSR bits according to the mask
 .Va data
 field.
 .It Dv CPUCTL_CPUID Fa cpuctl_cpuid_args_t *args
+.It Dv CPUCTL_CPUID_COUNT Fa cpuctl_cpuid_args_t *args
 Retrieve CPUID information.
 Arguments are supplied in
 the following struct:
 .Bd -literal
 typedef struct {
-	int		level;	/* CPUID level */
+	int		level;		/* CPUID level */
+	int		level_type;	/* CPUID level type */
 	uint32_t	data[4];
 } cpuctl_cpuid_args_t;
 .Ed
 .Pp
 The
 .Va level
-field indicates the CPUID level to retrieve information for, while the
+field indicates the CPUID level to retrieve.
+The
+.Va level_type
+field indicates the CPUID level type to retrieve.
+It is overriden to 0 for
+.Va CPUCTL_CPUID .
+Finally, the
 .Va data
 field is used to store the received CPUID data.
 .It Dv CPUCTL_UPDATE cpuctl_update_args_t *args

Modified: head/sys/dev/cpuctl/cpuctl.c
==============================================================================
--- head/sys/dev/cpuctl/cpuctl.c	Thu Jun 19 21:05:07 2014	(r267650)
+++ head/sys/dev/cpuctl/cpuctl.c	Thu Jun 19 21:54:41 2014	(r267651)
@@ -69,6 +69,8 @@ static int cpuctl_do_msr(int cpu, cpuctl
     struct thread *td);
 static int cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data,
     struct thread *td);
+static int cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_args_t *data,
+    struct thread *td);
 static int cpuctl_do_update(int cpu, cpuctl_update_args_t *data,
     struct thread *td);
 static int update_intel(int cpu, cpuctl_update_args_t *args,
@@ -177,6 +179,10 @@ cpuctl_ioctl(struct cdev *dev, u_long cm
 			goto fail;
 		ret = cpuctl_do_update(cpu, (cpuctl_update_args_t *)data, td);
 		break;
+	case CPUCTL_CPUID_COUNT:
+		ret = cpuctl_do_cpuid_count(cpu, (cpuctl_cpuid_args_t *)data,
+		    td);
+		break;
 	default:
 		ret = EINVAL;
 		break;
@@ -189,7 +195,7 @@ fail:
  * Actually perform cpuid operation.
  */
 static int
-cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data, struct thread *td)
+cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_args_t *data, struct thread *td)
 {
 	int is_bound = 0;
 	int oldcpu;
@@ -199,16 +205,25 @@ cpuctl_do_cpuid(int cpu, cpuctl_cpuid_ar
 
 	/* Explicitly clear cpuid data to avoid returning stale info. */
 	bzero(data->data, sizeof(data->data));
-	DPRINTF("[cpuctl,%d]: retriving cpuid level %#0x for %d cpu\n",
-	    __LINE__, data->level, cpu);
+	DPRINTF("[cpuctl,%d]: retrieving cpuid lev %#0x type %#0x for %d cpu\n",
+	    __LINE__, data->level, data->level_type, cpu);
 	oldcpu = td->td_oncpu;
 	is_bound = cpu_sched_is_bound(td);
 	set_cpu(cpu, td);
-	cpuid_count(data->level, 0, data->data);
+	cpuid_count(data->level, data->level_type, data->data);
 	restore_cpu(oldcpu, is_bound, td);
 	return (0);
 }
 
+static int
+cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data, struct thread *td)
+{
+
+	/* Override the level type. */
+	data->level_type = 0;
+	return (cpuctl_do_cpuid_count(cpu, data, td));
+}
+
 /*
  * Actually perform MSR operations.
  */

Modified: head/sys/sys/cpuctl.h
==============================================================================
--- head/sys/sys/cpuctl.h	Thu Jun 19 21:05:07 2014	(r267650)
+++ head/sys/sys/cpuctl.h	Thu Jun 19 21:54:41 2014	(r267651)
@@ -35,7 +35,8 @@ typedef struct {
 } cpuctl_msr_args_t;
 
 typedef struct {
-	int		level;	/* CPUID level */
+	int		level;		/* CPUID level */
+	int		level_type;	/* CPUID level type */
 	uint32_t	data[4];
 } cpuctl_cpuid_args_t;
 
@@ -50,5 +51,6 @@ typedef struct {
 #define	CPUCTL_UPDATE	_IOWR('c', 4, cpuctl_update_args_t)
 #define	CPUCTL_MSRSBIT	_IOWR('c', 5, cpuctl_msr_args_t)
 #define	CPUCTL_MSRCBIT	_IOWR('c', 6, cpuctl_msr_args_t)
+#define	CPUCTL_CPUID_COUNT _IOWR('c', 7, cpuctl_cpuid_args_t)
 
 #endif /* _CPUCTL_H_ */

Modified: head/usr.sbin/cpucontrol/cpucontrol.8
==============================================================================
--- head/usr.sbin/cpucontrol/cpucontrol.8	Thu Jun 19 21:05:07 2014	(r267650)
+++ head/usr.sbin/cpucontrol/cpucontrol.8	Thu Jun 19 21:54:41 2014	(r267651)
@@ -65,6 +65,12 @@ device
 .Ek
 .Nm
 .Op Fl vh
+.Fl i Ar level,level_type
+.Bk
+.Ar device
+.Ek
+.Nm
+.Op Fl vh
 .Op Fl d Ar datadir
 .Fl u
 .Bk
@@ -114,6 +120,9 @@ In this case the inverted value of mask 
 .It Fl i Ar level
 Retrieve CPUID info.
 Level should be given as a hex number.
+.It Fl i Ar level,level_type
+Retrieve CPUID info.
+Level and level_type should be given as hex numbers.
 .It Fl u
 Apply CPU firmware updates.
 The

Modified: head/usr.sbin/cpucontrol/cpucontrol.c
==============================================================================
--- head/usr.sbin/cpucontrol/cpucontrol.c	Thu Jun 19 21:05:07 2014	(r267650)
+++ head/usr.sbin/cpucontrol/cpucontrol.c	Thu Jun 19 21:54:41 2014	(r267651)
@@ -99,6 +99,7 @@ static struct ucode_handler {
 static void	usage(void);
 static int	isdir(const char *path);
 static int	do_cpuid(const char *cmdarg, const char *dev);
+static int	do_cpuid_count(const char *cmdarg, const char *dev);
 static int	do_msr(const char *cmdarg, const char *dev);
 static int	do_update(const char *dev);
 static void	datadir_add(const char *path);
@@ -112,7 +113,7 @@ usage(void)
 	if (name == NULL)
 		name = "cpuctl";
 	fprintf(stderr, "Usage: %s [-vh] [-d datadir] [-m msr[=value] | "
-	    "-i level | -u] device\n", name);
+	    "-i level | -i level,level_type | -u] device\n", name);
 	exit(EX_USAGE);
 }
 
@@ -170,6 +171,57 @@ do_cpuid(const char *cmdarg, const char 
 }
 
 static int
+do_cpuid_count(const char *cmdarg, const char *dev)
+{
+	char *cmdarg1, *endptr, *endptr1;
+	unsigned int level, level_type;
+	cpuctl_cpuid_args_t args;
+	int fd, error;
+
+	assert(cmdarg != NULL);
+	assert(dev != NULL);
+
+	level = strtoul(cmdarg, &endptr, 16);
+	if (*cmdarg == '\0' || *endptr == '\0') {
+		WARNX(0, "incorrect or missing operand: %s", cmdarg);
+		usage();
+		/* NOTREACHED */
+	}
+	/* Locate the comma... */
+	cmdarg1 = strstr(endptr, ",");
+	/* ... and skip past it */
+	cmdarg1 += 1;
+	level_type = strtoul(cmdarg1, &endptr1, 16);
+	if (*cmdarg1 == '\0' || *endptr1 != '\0') {
+		WARNX(0, "incorrect or missing operand: %s", cmdarg);
+		usage();
+		/* NOTREACHED */
+	}
+
+	/*
+	 * Fill ioctl argument structure.
+	 */
+	args.level = level;
+	args.level_type = level_type;
+	fd = open(dev, O_RDONLY);
+	if (fd < 0) {
+		WARN(0, "error opening %s for reading", dev);
+		return (1);
+	}
+	error = ioctl(fd, CPUCTL_CPUID_COUNT, &args);
+	if (error < 0) {
+		WARN(0, "ioctl(%s, CPUCTL_CPUID_COUNT)", dev);
+		close(fd);
+		return (error);
+	}
+	fprintf(stdout, "cpuid level 0x%x, level_type 0x%x: 0x%.8x 0x%.8x "
+	    "0x%.8x 0x%.8x\n", level, level_type, args.data[0], args.data[1],
+	    args.data[2], args.data[3]);
+	close(fd);
+	return (0);
+}
+
+static int
 do_msr(const char *cmdarg, const char *dev)
 {
 	unsigned int msr;
@@ -414,7 +466,10 @@ main(int argc, char *argv[])
 	c = flags & (FLAG_I | FLAG_M | FLAG_U);
 	switch (c) {
 		case FLAG_I:
-			error = do_cpuid(cmdarg, dev);
+			if (strstr(cmdarg, ",") != NULL)
+				error = do_cpuid_count(cmdarg, dev);
+			else
+				error = do_cpuid(cmdarg, dev);
 			break;
 		case FLAG_M:
 			error = do_msr(cmdarg, dev);

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 01:45:03 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 94A76523;
 Fri, 20 Jun 2014 01:45:03 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8146D212F;
 Fri, 20 Jun 2014 01:45:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5K1j399083306;
 Fri, 20 Jun 2014 01:45:03 GMT (envelope-from kan@svn.freebsd.org)
Received: (from kan@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5K1j3TC083304;
 Fri, 20 Jun 2014 01:45:03 GMT (envelope-from kan@svn.freebsd.org)
Message-Id: <201406200145.s5K1j3TC083304@svn.freebsd.org>
From: Alexander Kabaev 
Date: Fri, 20 Jun 2014 01:45:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267660 - head/sys/dev/firewire
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 01:45:03 -0000

Author: kan
Date: Fri Jun 20 01:45:03 2014
New Revision: 267660
URL: http://svnweb.freebsd.org/changeset/base/267660

Log:
  Set target->sbp field to valid value when sbp device is created.
  
  The sbp_cam_detach_target can be called from sbp_post_explore function
  on the first target that is not really attached and it was written with
  the corresponding safety check in place to tolerate that. Unfortunately
  the recent locking cleanup did add a locking assertion that tries to
  dereference the target->sbp pointer unconditionally, which causes less
  than desirable outcome. Since the assertion is useful, just initialize
  the target sbp pointer once when sbp device is being initialized instead
  of when the target is being attached. This makes assertion work in all
  cases and fixes the crash on boot.

Modified:
  head/sys/dev/firewire/sbp.c

Modified: head/sys/dev/firewire/sbp.c
==============================================================================
--- head/sys/dev/firewire/sbp.c	Fri Jun 20 00:43:52 2014	(r267659)
+++ head/sys/dev/firewire/sbp.c	Fri Jun 20 01:45:03 2014	(r267660)
@@ -622,7 +622,6 @@ END_DEBUG
 	}
 	/* new target */
 	target = &sbp->targets[i];
-	target->sbp = sbp;
 	target->fwdev = fwdev;
 	target->target_id = i;
 	/* XXX we may want to reload mgm port after each bus reset */
@@ -1976,6 +1975,7 @@ END_DEBUG
 	for( i = 0 ; i < SBP_NUM_TARGETS ; i++){
 		sbp->targets[i].fwdev = NULL;
 		sbp->targets[i].luns = NULL;
+		sbp->targets[i].sbp = sbp;
 	}
 
 	sbp->sim = cam_sim_alloc(sbp_action, sbp_poll, "sbp", sbp,

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 01:50:25 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C3B618C6;
 Fri, 20 Jun 2014 01:50:25 +0000 (UTC)
Received: from mail-yk0-x235.google.com (mail-yk0-x235.google.com
 [IPv6:2607:f8b0:4002:c07::235])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 58755216F;
 Fri, 20 Jun 2014 01:50:25 +0000 (UTC)
Received: by mail-yk0-f181.google.com with SMTP id 9so2219456ykp.12
 for ; Thu, 19 Jun 2014 18:50:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:in-reply-to:references
 :mime-version:content-type:content-transfer-encoding;
 bh=MEEPqQ+2UH5MXxl4n9lzn+cc4d1lnK6gGqiWMAHgMbE=;
 b=fy/begtJxcjY7iytptOGH046NUeJwNrzJ4gAtEKA0SgoKIknqy5ZoprIS3N7tkaC5e
 EpnIurZSorTFRHJyMkmaXqO0pwX+z76WRd0XCcVOK1TX8BDCAUrUCNZO+TFsZ26S79FY
 JJ+nYt/Wt8/H12s5r1N+QzaafeXoxO5vwUw5EZmn3NqkGEhZtQcuVJ016jbKo/wLJYbM
 HIcggsmCD6ty4eIdFbGo2OEbos6NLFf/cAyTNpgddRD3k4w0+tYEfdO3ziLAuLSr0+1p
 T2L9yys9VgdXZu2Dc79pdvMhAAMsSweiYar78SP8XYSemLe7ewVzBPuPPgdT4nnMcoYm
 HreA==
X-Received: by 10.236.101.198 with SMTP id b46mr459242yhg.68.1403229024608;
 Thu, 19 Jun 2014 18:50:24 -0700 (PDT)
Received: from zhabar.att.net (107-222-186-3.lightspeed.sntcca.sbcglobal.net.
 [107.222.186.3])
 by mx.google.com with ESMTPSA id d46sm12006928yha.10.2014.06.19.18.50.23
 for 
 (version=SSLv3 cipher=RC4-SHA bits=128/128);
 Thu, 19 Jun 2014 18:50:24 -0700 (PDT)
Date: Thu, 19 Jun 2014 18:50:20 -0700
From: Justin Hibbits 
To: Alexander Kabaev 
Subject: Re: svn commit: r267660 - head/sys/dev/firewire
Message-ID: <20140619185020.428a102d@zhabar.att.net>
In-Reply-To: <201406200145.s5K1j3TC083304@svn.freebsd.org>
References: <201406200145.s5K1j3TC083304@svn.freebsd.org>
X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.22; powerpc64-portbld-freebsd11.0)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 01:50:25 -0000

On Fri, 20 Jun 2014 01:45:03 +0000 (UTC)
Alexander Kabaev  wrote:

> Author: kan
> Date: Fri Jun 20 01:45:03 2014
> New Revision: 267660
> URL: http://svnweb.freebsd.org/changeset/base/267660
> 
> Log:
>   Set target->sbp field to valid value when sbp device is created.
>   
>   The sbp_cam_detach_target can be called from sbp_post_explore
> function on the first target that is not really attached and it was
> written with the corresponding safety check in place to tolerate
> that. Unfortunately the recent locking cleanup did add a locking
> assertion that tries to dereference the target->sbp pointer
> unconditionally, which causes less than desirable outcome. Since the
> assertion is useful, just initialize the target sbp pointer once when
> sbp device is being initialized instead of when the target is being
> attached. This makes assertion work in all cases and fixes the crash
> on boot.

Thanks for fixing this!  I was hitting it on my latest kernel rebuilds,
and kept rolling back until I could find the time to fix it.  You beat
me to it.

- Justin

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 02:31:53 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5D063A27;
 Fri, 20 Jun 2014 02:31:53 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 499AC262E;
 Fri, 20 Jun 2014 02:31:53 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5K2VrtQ006561;
 Fri, 20 Jun 2014 02:31:53 GMT (envelope-from bryanv@svn.freebsd.org)
Received: (from bryanv@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5K2VrrH006560;
 Fri, 20 Jun 2014 02:31:53 GMT (envelope-from bryanv@svn.freebsd.org)
Message-Id: <201406200231.s5K2VrrH006560@svn.freebsd.org>
From: Bryan Venteicher 
Date: Fri, 20 Jun 2014 02:31:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267661 - head/sys/dev/vmware/vmxnet3
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 02:31:53 -0000

Author: bryanv
Date: Fri Jun 20 02:31:52 2014
New Revision: 267661
URL: http://svnweb.freebsd.org/changeset/base/267661

Log:
  Remove an unnecessary kick of the host at the end of transmitting
  
  MFC after:	1 week

Modified:
  head/sys/dev/vmware/vmxnet3/if_vmx.c

Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c
==============================================================================
--- head/sys/dev/vmware/vmxnet3/if_vmx.c	Fri Jun 20 01:45:03 2014	(r267660)
+++ head/sys/dev/vmware/vmxnet3/if_vmx.c	Fri Jun 20 02:31:52 2014	(r267661)
@@ -168,7 +168,6 @@ static int	vmxnet3_txq_load_mbuf(struct 
 		    bus_dmamap_t, bus_dma_segment_t [], int *);
 static void	vmxnet3_txq_unload_mbuf(struct vmxnet3_txqueue *, bus_dmamap_t);
 static int	vmxnet3_txq_encap(struct vmxnet3_txqueue *, struct mbuf **);
-static void	vmxnet3_txq_update_pending(struct vmxnet3_txqueue *);
 #ifdef VMXNET3_LEGACY_TX
 static void	vmxnet3_start_locked(struct ifnet *);
 static void	vmxnet3_start(struct ifnet *);
@@ -2852,20 +2851,6 @@ vmxnet3_txq_encap(struct vmxnet3_txqueue
 	return (0);
 }
 
-static void
-vmxnet3_txq_update_pending(struct vmxnet3_txqueue *txq)
-{
-	struct vmxnet3_txring *txr;
-
-	txr = &txq->vxtxq_cmd_ring;
-
-	if (txq->vxtxq_ts->npending > 0) {
-		txq->vxtxq_ts->npending = 0;
-		vmxnet3_write_bar0(txq->vxtxq_sc,
-		    VMXNET3_BAR0_TXH(txq->vxtxq_id), txr->vxtxr_head);
-	}
-}
-
 #ifdef VMXNET3_LEGACY_TX
 
 static void
@@ -2912,10 +2897,8 @@ vmxnet3_start_locked(struct ifnet *ifp)
 		ETHER_BPF_MTAP(ifp, m_head);
 	}
 
-	if (tx > 0) {
-		vmxnet3_txq_update_pending(txq);
+	if (tx > 0)
 		txq->vxtxq_watchdog = VMXNET3_WATCHDOG_TIMEOUT;
-	}
 }
 
 static void
@@ -2990,10 +2973,8 @@ vmxnet3_txq_mq_start_locked(struct vmxne
 		ETHER_BPF_MTAP(ifp, m);
 	}
 
-	if (tx > 0) {
-		vmxnet3_txq_update_pending(txq);
+	if (tx > 0)
 		txq->vxtxq_watchdog = VMXNET3_WATCHDOG_TIMEOUT;
-	}
 
 	return (0);
 }

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 02:49:04 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2A464E45;
 Fri, 20 Jun 2014 02:49:04 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id F0C102736;
 Fri, 20 Jun 2014 02:49:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5K2n33v012029;
 Fri, 20 Jun 2014 02:49:03 GMT (envelope-from bryanv@svn.freebsd.org)
Received: (from bryanv@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5K2n31p012027;
 Fri, 20 Jun 2014 02:49:03 GMT (envelope-from bryanv@svn.freebsd.org)
Message-Id: <201406200249.s5K2n31p012027@svn.freebsd.org>
From: Bryan Venteicher 
Date: Fri, 20 Jun 2014 02:49:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267662 - head/sys/dev/vmware/vmxnet3
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 02:49:04 -0000

Author: bryanv
Date: Fri Jun 20 02:49:03 2014
New Revision: 267662
URL: http://svnweb.freebsd.org/changeset/base/267662

Log:
  Handle multiple calls to rxq_eof for single packet completion
  
  This requires the VMware vmxnet3 device to flip the start of packet
  descriptor's generation before the rest of the packet's descriptors
  have been loaded into the Rx ring. I've never observed this behavior,
  and it seems to make the most sense not to do it this way. But it is
  not a lot of work for the driver to handle this situation just in case.
  
  MFC after:	1 week

Modified:
  head/sys/dev/vmware/vmxnet3/if_vmx.c
  head/sys/dev/vmware/vmxnet3/if_vmxvar.h

Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c
==============================================================================
--- head/sys/dev/vmware/vmxnet3/if_vmx.c	Fri Jun 20 02:31:52 2014	(r267661)
+++ head/sys/dev/vmware/vmxnet3/if_vmx.c	Fri Jun 20 02:49:03 2014	(r267662)
@@ -2087,17 +2087,25 @@ vmxnet3_rxq_eof(struct vmxnet3_rxqueue *
 	sc = rxq->vxrxq_sc;
 	ifp = sc->vmx_ifp;
 	rxc = &rxq->vxrxq_comp_ring;
-	m_head = m_tail = NULL;
 
 	VMXNET3_RXQ_LOCK_ASSERT(rxq);
 
 	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
 		return;
 
+	m_head = rxq->vxrxq_mhead;
+	rxq->vxrxq_mhead = NULL;
+	m_tail = rxq->vxrxq_mtail;
+	rxq->vxrxq_mtail = NULL;
+	MPASS(m_head == NULL || m_tail != NULL);
+
 	for (;;) {
 		rxcd = &rxc->vxcr_u.rxcd[rxc->vxcr_next];
-		if (rxcd->gen != rxc->vxcr_gen)
+		if (rxcd->gen != rxc->vxcr_gen) {
+			rxq->vxrxq_mhead = m_head;
+			rxq->vxrxq_mtail = m_tail;
 			break;
+		}
 		vmxnet3_barrier(sc, VMXNET3_BARRIER_RD);
 
 		if (++rxc->vxcr_next == rxc->vxcr_ndesc) {
@@ -2329,6 +2337,12 @@ vmxnet3_rxstop(struct vmxnet3_softc *sc,
 	struct vmxnet3_rxbuf *rxb;
 	int i, j;
 
+	if (rxq->vxrxq_mhead != NULL) {
+		m_freem(rxq->vxrxq_mhead);
+		rxq->vxrxq_mhead = NULL;
+		rxq->vxrxq_mtail = NULL;
+	}
+
 	for (i = 0; i < VMXNET3_RXRINGS_PERQ; i++) {
 		rxr = &rxq->vxrxq_cmd_ring[i];
 

Modified: head/sys/dev/vmware/vmxnet3/if_vmxvar.h
==============================================================================
--- head/sys/dev/vmware/vmxnet3/if_vmxvar.h	Fri Jun 20 02:31:52 2014	(r267661)
+++ head/sys/dev/vmware/vmxnet3/if_vmxvar.h	Fri Jun 20 02:49:03 2014	(r267662)
@@ -168,6 +168,8 @@ struct vmxnet3_rxqueue {
 	struct vmxnet3_softc		*vxrxq_sc;
 	int				 vxrxq_id;
 	int				 vxrxq_intr_idx;
+	struct mbuf			*vxrxq_mhead;
+	struct mbuf			*vxrxq_mtail;
 	struct vmxnet3_rxring		 vxrxq_cmd_ring[VMXNET3_RXRINGS_PERQ];
 	struct vmxnet3_comp_ring	 vxrxq_comp_ring;
 	struct vmxnet3_rxq_stats	 vxrxq_stats;

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 02:54:04 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id AC2DDF0;
 Fri, 20 Jun 2014 02:54:04 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 990B027D9;
 Fri, 20 Jun 2014 02:54:04 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5K2s4Fn015755;
 Fri, 20 Jun 2014 02:54:04 GMT (envelope-from bryanv@svn.freebsd.org)
Received: (from bryanv@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5K2s4ej015754;
 Fri, 20 Jun 2014 02:54:04 GMT (envelope-from bryanv@svn.freebsd.org)
Message-Id: <201406200254.s5K2s4ej015754@svn.freebsd.org>
From: Bryan Venteicher 
Date: Fri, 20 Jun 2014 02:54:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267663 - head/sys/dev/vmware/vmxnet3
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 02:54:04 -0000

Author: bryanv
Date: Fri Jun 20 02:54:04 2014
New Revision: 267663
URL: http://svnweb.freebsd.org/changeset/base/267663

Log:
  Increment the pending packets more aggressively for TSO
  
  Assume the number of description used is reasonable value to
  increment this otherwise opaque field by.
  
  While here, reduce a minor difference between the legacy and
  multiqueue transmit paths.
  
  MFC after:	1 week

Modified:
  head/sys/dev/vmware/vmxnet3/if_vmx.c

Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c
==============================================================================
--- head/sys/dev/vmware/vmxnet3/if_vmx.c	Fri Jun 20 02:49:03 2014	(r267662)
+++ head/sys/dev/vmware/vmxnet3/if_vmx.c	Fri Jun 20 02:54:04 2014	(r267663)
@@ -2856,7 +2856,8 @@ vmxnet3_txq_encap(struct vmxnet3_txqueue
 	vmxnet3_barrier(sc, VMXNET3_BARRIER_WR);
 	sop->gen ^= 1;
 
-	if (++txq->vxtxq_ts->npending >= txq->vxtxq_ts->intr_threshold) {
+	txq->vxtxq_ts->npending += nsegs;
+	if (txq->vxtxq_ts->npending >= txq->vxtxq_ts->intr_threshold) {
 		txq->vxtxq_ts->npending = 0;
 		vmxnet3_write_bar0(sc, VMXNET3_BAR0_TXH(txq->vxtxq_id),
 		    txr->vxtxr_head);
@@ -2973,8 +2974,7 @@ vmxnet3_txq_mq_start_locked(struct vmxne
 			break;
 		}
 
-		error = vmxnet3_txq_encap(txq, &m);
-		if (error) {
+		if (vmxnet3_txq_encap(txq, &m) != 0) {
 			if (m != NULL)
 				drbr_putback(ifp, br, m);
 			else

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 04:08:07 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id AD50D522;
 Fri, 20 Jun 2014 04:08:07 +0000 (UTC)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2D4802E91;
 Fri, 20 Jun 2014 04:08:06 +0000 (UTC)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s5K481YB099219;
 Fri, 20 Jun 2014 07:08:01 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s5K481YB099219
Received: (from kostik@localhost)
 by tom.home (8.14.9/8.14.8/Submit) id s5K481rp099218;
 Fri, 20 Jun 2014 07:08:01 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Fri, 20 Jun 2014 07:08:01 +0300
From: Konstantin Belousov 
To: Attilio Rao 
Subject: Re: svn commit: r267651 - in head: share/man/man4 sys/dev/cpuctl
 sys/sys usr.sbin/cpucontrol
Message-ID: <20140620040801.GA3991@kib.kiev.ua>
References: <201406192154.s5JLsfed074305@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="Bdv4BQVKRoKl8WEC"
Content-Disposition: inline
In-Reply-To: <201406192154.s5JLsfed074305@svn.freebsd.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 autolearn_force=no version=3.4.0
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 04:08:07 -0000


--Bdv4BQVKRoKl8WEC
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jun 19, 2014 at 09:54:41PM +0000, Attilio Rao wrote:
> Author: attilio
> Date: Thu Jun 19 21:54:41 2014
> New Revision: 267651
> URL: http://svnweb.freebsd.org/changeset/base/267651
>=20
> Log:
>   Following comments in r242565 add the possibility to specify ecx when
>   performing cpuid calls.
>   Add also a new way to specify the level type to cpucontrol(8) as
>   reported in the manpage.
>  =20
>   Sponsored by:	EMC / Isilon storage division
>   Reviewed by:	bdrewery, gcooper
>   Testerd by:	bdrewery
> Modified: head/sys/sys/cpuctl.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/sys/cpuctl.h	Thu Jun 19 21:05:07 2014	(r267650)
> +++ head/sys/sys/cpuctl.h	Thu Jun 19 21:54:41 2014	(r267651)
> @@ -35,7 +35,8 @@ typedef struct {
>  } cpuctl_msr_args_t;
> =20
>  typedef struct {
> -	int		level;	/* CPUID level */
> +	int		level;		/* CPUID level */
> +	int		level_type;	/* CPUID level type */
>  	uint32_t	data[4];
>  } cpuctl_cpuid_args_t;
> =20
> @@ -50,5 +51,6 @@ typedef struct {
>  #define	CPUCTL_UPDATE	_IOWR('c', 4, cpuctl_update_args_t)
>  #define	CPUCTL_MSRSBIT	_IOWR('c', 5, cpuctl_msr_args_t)
>  #define	CPUCTL_MSRCBIT	_IOWR('c', 6, cpuctl_msr_args_t)
> +#define	CPUCTL_CPUID_COUNT _IOWR('c', 7, cpuctl_cpuid_args_t)
> =20
>  #endif /* _CPUCTL_H_ */

The cpuctl(4) is used by third-party code, and this change breaks its
ABI. The numeric value for CPUCTL_CPUID is changed, which means that
old binaries call non-existing ioctl now. This is at least a visible
breakage, since the argument for the ioctl changed the layout as well.

The following patch restored the CPUCTL_CPUID for me.  I considered
naming its argument differently, instead of renaming the argument
of CPUCTL_CPUID_COUNT (which you tried to do ?), but decided not,
to preserve the API as well.

Do you agree with the change ?

diff --git a/sys/dev/cpuctl/cpuctl.c b/sys/dev/cpuctl/cpuctl.c
index 63187bd..9832933 100644
--- a/sys/dev/cpuctl/cpuctl.c
+++ b/sys/dev/cpuctl/cpuctl.c
@@ -69,7 +69,7 @@ static int cpuctl_do_msr(int cpu, cpuctl_msr_args_t *data=
, u_long cmd,
     struct thread *td);
 static int cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data,
     struct thread *td);
-static int cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_args_t *data,
+static int cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data,
     struct thread *td);
 static int cpuctl_do_update(int cpu, cpuctl_update_args_t *data,
     struct thread *td);
@@ -180,8 +180,8 @@ cpuctl_ioctl(struct cdev *dev, u_long cmd, caddr_t data,
 		ret =3D cpuctl_do_update(cpu, (cpuctl_update_args_t *)data, td);
 		break;
 	case CPUCTL_CPUID_COUNT:
-		ret =3D cpuctl_do_cpuid_count(cpu, (cpuctl_cpuid_args_t *)data,
-		    td);
+		ret =3D cpuctl_do_cpuid_count(cpu,
+		    (cpuctl_cpuid_count_args_t *)data, td);
 		break;
 	default:
 		ret =3D EINVAL;
@@ -195,7 +195,8 @@ fail:
  * Actually perform cpuid operation.
  */
 static int
-cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_args_t *data, struct thread *t=
d)
+cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data,
+    struct thread *td)
 {
 	int is_bound =3D 0;
 	int oldcpu;
@@ -218,10 +219,15 @@ cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_args_t *d=
ata, struct thread *td)
 static int
 cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data, struct thread *td)
 {
+	cpuctl_cpuid_count_args_t cdata;
+	int error;
=20
+	cdata.level =3D data->level;
 	/* Override the level type. */
-	data->level_type =3D 0;
-	return (cpuctl_do_cpuid_count(cpu, data, td));
+	cdata.level_type =3D 0;
+	error =3D cpuctl_do_cpuid_count(cpu, &cdata, td);
+	bcopy(cdata.data, data->data, sizeof(data->data)); /* Ignore error */
+	return (error);
 }
=20
 /*
diff --git a/sys/sys/cpuctl.h b/sys/sys/cpuctl.h
index 4220dee..30af524 100644
--- a/sys/sys/cpuctl.h
+++ b/sys/sys/cpuctl.h
@@ -36,11 +36,16 @@ typedef struct {
=20
 typedef struct {
 	int		level;		/* CPUID level */
-	int		level_type;	/* CPUID level type */
 	uint32_t	data[4];
 } cpuctl_cpuid_args_t;
=20
 typedef struct {
+	int		level;		/* CPUID level */
+	int		level_type;	/* CPUID level type */
+	uint32_t	data[4];
+} cpuctl_cpuid_count_args_t;
+
+typedef struct {
 	void	*data;
 	size_t	size;
 } cpuctl_update_args_t;
@@ -51,6 +56,6 @@ typedef struct {
 #define	CPUCTL_UPDATE	_IOWR('c', 4, cpuctl_update_args_t)
 #define	CPUCTL_MSRSBIT	_IOWR('c', 5, cpuctl_msr_args_t)
 #define	CPUCTL_MSRCBIT	_IOWR('c', 6, cpuctl_msr_args_t)
-#define	CPUCTL_CPUID_COUNT _IOWR('c', 7, cpuctl_cpuid_args_t)
+#define	CPUCTL_CPUID_COUNT _IOWR('c', 7, cpuctl_cpuid_count_args_t)
=20
 #endif /* _CPUCTL_H_ */

--Bdv4BQVKRoKl8WEC
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJTo7OhAAoJEJDCuSvBvK1BTQcP/0aW5LRHF7bbeuhvmbFi021k
BAr6TP8njxSAQGkyROODEgJP1VBC+WTmAPwFTGYeC1GwQ65mX6HgBFbJbXtI98Tn
dpqgtshD+Fb36fHi2IJld/FPp53cH+VzS78p1e1ldYyeSmkR/xoRu+r8a9HMy/2M
6dyVhDXE8Sj7pGg/5gvRQURm9CW4goHeeUkXLTkGHuwgVi6hm9fTzNcVsNdZYqer
YYsXWOMk55DyEtj7Id0UW8T0OyE1pd0T3J9TC25JjBljjy5R5QOgeVg6lo2Skv5J
ACzaaq6UbFvu6oOWYHrtvuAOfY8f0DaaVwmLhjHDEWkY6JszW4ZVC9xEcE4e6ZbT
aoHJhOhPK+sNscMq5doUtOHQVnLNCkM8ISo4Gw0pZrcRDl1tqTRjEiSG8G0OKVA9
k4NZfwyWcYCIO3OZyinubNqmyOH0MIj7boVNSn4w3YlW7QZt6702HQyN17lvTk1X
dwyyitucMOAji59Xn0AbTchd1pucJ7e3mP6wKgo4BQpUMX64dTixUPe+ZhWzXV3z
s0ts3OIJ0oQ9NdjvN/ZwHl57oSk5RcPUutLLig1E+3xsgOg73W6FRYlCpK51xqaI
9INLb53Cd7Ua7V+TR6iI2+Mtj6Us1fhwQmjx10QeH9fEFpk6GMJHfDxUItGxZWlC
Xec/hv+vu/sfKKkZlpwy
=lxoC
-----END PGP SIGNATURE-----

--Bdv4BQVKRoKl8WEC--

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 06:13:02 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8B8B1266;
 Fri, 20 Jun 2014 06:13:02 +0000 (UTC)
Received: from mail-we0-x232.google.com (mail-we0-x232.google.com
 [IPv6:2a00:1450:400c:c03::232])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id D2524291C;
 Fri, 20 Jun 2014 06:13:01 +0000 (UTC)
Received: by mail-we0-f178.google.com with SMTP id x48so3313776wes.9
 for ; Thu, 19 Jun 2014 23:13:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:reply-to:sender:in-reply-to:references:date:message-id
 :subject:from:to:cc:content-type;
 bh=0l2YYqCnFGTjuKn06/bFeqsusMFta0GbaM9RDtPe8Wk=;
 b=LesdiTsjrNhqNr6L/nNC2QaWSRm4yDqCq9J0p+R3ct0lHee+z68tEQrxbmYDAZy9ph
 ok9r++Ab4c+MynjjaJ/VTJdnjVw4bOzMiZIbZ6WMsPdRfADw3CQENZy5jGOKR+pc3tXw
 5nALttDQBRm2uRDj4/NWljDekEqVA8QPa5WQhHjNmkFWuT1ogKEyWf7O+Tkk1h+cEzgR
 kafdXuaodz0ElTje6udwPsnhDsMKDf+tFyjXEYJdp87Y7VvQ65ootazhbc2m+EhRD6aU
 k5E0BBT1MiExU1wmlxqEO4mJcfTnxrWyI0IQGajEW4j4Z05okn1JGkWhSesZ8538il2s
 edrA==
MIME-Version: 1.0
X-Received: by 10.180.19.233 with SMTP id i9mr1533967wie.38.1403244780040;
 Thu, 19 Jun 2014 23:13:00 -0700 (PDT)
Reply-To: attilio@FreeBSD.org
Sender: asmrookie@gmail.com
Received: by 10.217.46.129 with HTTP; Thu, 19 Jun 2014 23:12:59 -0700 (PDT)
In-Reply-To: <20140620040801.GA3991@kib.kiev.ua>
References: <201406192154.s5JLsfed074305@svn.freebsd.org>
 <20140620040801.GA3991@kib.kiev.ua>
Date: Fri, 20 Jun 2014 08:12:59 +0200
X-Google-Sender-Auth: ZuXPqrg04knIaQGZDoL-aeCa580
Message-ID: 
Subject: Re: svn commit: r267651 - in head: share/man/man4 sys/dev/cpuctl
 sys/sys usr.sbin/cpucontrol
From: Attilio Rao 
To: Konstantin Belousov 
Content-Type: text/plain; charset=UTF-8
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 06:13:02 -0000

On Fri, Jun 20, 2014 at 6:08 AM, Konstantin Belousov
 wrote:
> On Thu, Jun 19, 2014 at 09:54:41PM +0000, Attilio Rao wrote:
>> Author: attilio
>> Date: Thu Jun 19 21:54:41 2014
>> New Revision: 267651
>> URL: http://svnweb.freebsd.org/changeset/base/267651
>>
>> Log:
>>   Following comments in r242565 add the possibility to specify ecx when
>>   performing cpuid calls.
>>   Add also a new way to specify the level type to cpucontrol(8) as
>>   reported in the manpage.
>>
>>   Sponsored by:       EMC / Isilon storage division
>>   Reviewed by:        bdrewery, gcooper
>>   Testerd by: bdrewery
>> Modified: head/sys/sys/cpuctl.h
>> ==============================================================================
>> --- head/sys/sys/cpuctl.h     Thu Jun 19 21:05:07 2014        (r267650)
>> +++ head/sys/sys/cpuctl.h     Thu Jun 19 21:54:41 2014        (r267651)
>> @@ -35,7 +35,8 @@ typedef struct {
>>  } cpuctl_msr_args_t;
>>
>>  typedef struct {
>> -     int             level;  /* CPUID level */
>> +     int             level;          /* CPUID level */
>> +     int             level_type;     /* CPUID level type */
>>       uint32_t        data[4];
>>  } cpuctl_cpuid_args_t;
>>
>> @@ -50,5 +51,6 @@ typedef struct {
>>  #define      CPUCTL_UPDATE   _IOWR('c', 4, cpuctl_update_args_t)
>>  #define      CPUCTL_MSRSBIT  _IOWR('c', 5, cpuctl_msr_args_t)
>>  #define      CPUCTL_MSRCBIT  _IOWR('c', 6, cpuctl_msr_args_t)
>> +#define      CPUCTL_CPUID_COUNT _IOWR('c', 7, cpuctl_cpuid_args_t)
>>
>>  #endif /* _CPUCTL_H_ */
>
> The cpuctl(4) is used by third-party code, and this change breaks its
> ABI. The numeric value for CPUCTL_CPUID is changed, which means that
> old binaries call non-existing ioctl now. This is at least a visible
> breakage, since the argument for the ioctl changed the layout as well.
>
> The following patch restored the CPUCTL_CPUID for me.  I considered
> naming its argument differently, instead of renaming the argument
> of CPUCTL_CPUID_COUNT (which you tried to do ?), but decided not,
> to preserve the API as well.

No, breaking the ABI is fine for -CURRENT so I don't see why we need the bloat.
I don't plan on MFC this patch. If I need to (or any user requests
that) I will do with the appropriate ABI-compliant way (ie. adding a
new argument like this one).

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 07:01:53 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id EDE2EE93;
 Fri, 20 Jun 2014 07:01:53 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DC26D2C6D;
 Fri, 20 Jun 2014 07:01:53 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5K71rcK031521;
 Fri, 20 Jun 2014 07:01:53 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5K71rHC031520;
 Fri, 20 Jun 2014 07:01:53 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201406200701.s5K71rHC031520@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 20 Jun 2014 07:01:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267664 - head/sys/vm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 07:01:54 -0000

Author: kib
Date: Fri Jun 20 07:01:53 2014
New Revision: 267664
URL: http://svnweb.freebsd.org/changeset/base/267664

Log:
  Assert that the new entry is inserted into the right location in the
  map entries list, and that it does not overlap with the previous and
  next entries.
  
  Reviewed by:	alc
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Fri Jun 20 02:54:04 2014	(r267663)
+++ head/sys/vm/vm_map.c	Fri Jun 20 07:01:53 2014	(r267664)
@@ -940,6 +940,15 @@ vm_map_entry_link(vm_map_t map,
 	    "vm_map_entry_link: map %p, nentries %d, entry %p, after %p", map,
 	    map->nentries, entry, after_where);
 	VM_MAP_ASSERT_LOCKED(map);
+	KASSERT(after_where == &map->header ||
+	    after_where->end <= entry->start,
+	    ("vm_map_entry_link: prev end %jx new start %jx overlap",
+	    (uintmax_t)after_where->end, (uintmax_t)entry->start));
+	KASSERT(after_where->next == &map->header ||
+	    entry->end <= after_where->next->start,
+	    ("vm_map_entry_link: new end %jx next start %jx overlap",
+	    (uintmax_t)entry->end, (uintmax_t)after_where->next->start));
+
 	map->nentries++;
 	entry->prev = after_where;
 	entry->next = after_where->next;

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 07:49:45 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5E24C374;
 Fri, 20 Jun 2014 07:49:45 +0000 (UTC)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D95EA20AE;
 Fri, 20 Jun 2014 07:49:44 +0000 (UTC)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s5K7ndV8049578;
 Fri, 20 Jun 2014 10:49:39 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s5K7ndV8049578
Received: (from kostik@localhost)
 by tom.home (8.14.9/8.14.8/Submit) id s5K7nd7Z049577;
 Fri, 20 Jun 2014 10:49:39 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Fri, 20 Jun 2014 10:49:39 +0300
From: Konstantin Belousov 
To: Attilio Rao 
Subject: Re: svn commit: r267651 - in head: share/man/man4 sys/dev/cpuctl
 sys/sys usr.sbin/cpucontrol
Message-ID: <20140620074939.GE3991@kib.kiev.ua>
References: <201406192154.s5JLsfed074305@svn.freebsd.org>
 <20140620040801.GA3991@kib.kiev.ua>
 
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="/RqEFHMuhBp2bkqw"
Content-Disposition: inline
In-Reply-To: 
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 autolearn_force=no version=3.4.0
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 07:49:45 -0000


--/RqEFHMuhBp2bkqw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Jun 20, 2014 at 08:12:59AM +0200, Attilio Rao wrote:
> On Fri, Jun 20, 2014 at 6:08 AM, Konstantin Belousov
>  wrote:
> > On Thu, Jun 19, 2014 at 09:54:41PM +0000, Attilio Rao wrote:
> >> Author: attilio
> >> Date: Thu Jun 19 21:54:41 2014
> >> New Revision: 267651
> >> URL: http://svnweb.freebsd.org/changeset/base/267651
> >>
> >> Log:
> >>   Following comments in r242565 add the possibility to specify ecx when
> >>   performing cpuid calls.
> >>   Add also a new way to specify the level type to cpucontrol(8) as
> >>   reported in the manpage.
> >>
> >>   Sponsored by:       EMC / Isilon storage division
> >>   Reviewed by:        bdrewery, gcooper
> >>   Testerd by: bdrewery
> >> Modified: head/sys/sys/cpuctl.h
> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
> >> --- head/sys/sys/cpuctl.h     Thu Jun 19 21:05:07 2014        (r267650)
> >> +++ head/sys/sys/cpuctl.h     Thu Jun 19 21:54:41 2014        (r267651)
> >> @@ -35,7 +35,8 @@ typedef struct {
> >>  } cpuctl_msr_args_t;
> >>
> >>  typedef struct {
> >> -     int             level;  /* CPUID level */
> >> +     int             level;          /* CPUID level */
> >> +     int             level_type;     /* CPUID level type */
> >>       uint32_t        data[4];
> >>  } cpuctl_cpuid_args_t;
> >>
> >> @@ -50,5 +51,6 @@ typedef struct {
> >>  #define      CPUCTL_UPDATE   _IOWR('c', 4, cpuctl_update_args_t)
> >>  #define      CPUCTL_MSRSBIT  _IOWR('c', 5, cpuctl_msr_args_t)
> >>  #define      CPUCTL_MSRCBIT  _IOWR('c', 6, cpuctl_msr_args_t)
> >> +#define      CPUCTL_CPUID_COUNT _IOWR('c', 7, cpuctl_cpuid_args_t)
> >>
> >>  #endif /* _CPUCTL_H_ */
> >
> > The cpuctl(4) is used by third-party code, and this change breaks its
> > ABI. The numeric value for CPUCTL_CPUID is changed, which means that
> > old binaries call non-existing ioctl now. This is at least a visible
> > breakage, since the argument for the ioctl changed the layout as well.
> >
> > The following patch restored the CPUCTL_CPUID for me.  I considered
> > naming its argument differently, instead of renaming the argument
> > of CPUCTL_CPUID_COUNT (which you tried to do ?), but decided not,
> > to preserve the API as well.
>=20
> No, breaking the ABI is fine for -CURRENT so I don't see why we need the =
bloat.

No, breaking ABI is not fine at all, be it CURRENT or not. We try to
keep the ABI stable, doing costly measures like symbol versioning, where
applicable. Since this is a change to ABI for kernel interface, it
cannot be covered by symver tricks and must be done in kernel.

> I don't plan on MFC this patch. If I need to (or any user requests
> that) I will do with the appropriate ABI-compliant way (ie. adding a
> new argument like this one).

Besides the same-world ABI issue, people run jails with lower world
version on higher-versioned kernels.

--/RqEFHMuhBp2bkqw
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJTo+eSAAoJEJDCuSvBvK1BhtkP/3wjtCIEw8Z6uRnqTO2UWw13
i2BcuxRhWbAReZd9SS9I2y6hyu+T0vVKqxvNR4qwUTqBpfMF+kMs0IBt0XfORpph
Jg76/gaCqupSFUK5+uhqHRw7oeX/IZyUSUCq9f6Ktmqm7wNs6Q2OuFdpK54ZoVgF
/3MredFAbjhsed19lnyKUConGsHSIys34hYQm2S3JWco7jrNXT/tFBwU/qcA238k
TaXiRLCFqCjCuYQNECiDlH7cFKuWSLi+Hfsqf3cTLKxe5XmX0ed5TYt77PoNUVNl
o4sWNILiH6JJsZoRznnDEGyrwmPFrtPmbsfhLlmVr9Zn2cocpz//PR0K5Z68uEPf
k/ehOWu1ROh2KhEQAPN0gvirkUeJt6w4Fy/27ctf1wopUnw6w+7TUCTWG1ZqEvZp
kpJ8ooMi1kJQeOSXekG4JbOsAmff4laKOgRJ4kH7yGQkU2O3uyQMfXkx/hD09B8W
uYiWj/w0IGjlqgj8TFrh/T7K8yR/UFTghjgWhDqBj3F/JsDnu/dBq/CMEGFmG8QU
lJfJ0uJxYLBlDLy6ELSew98jbU8OdCDOCYAoh+g/cM0KuCob5BdbMvTOI3ipzM7Q
GSreOpzF1pmUWNiHp8bfyuIgU2t5Yv6vTSjMIPOkkZGutb3ukQCyFB7d7HrqpJ02
wbJGZhpjRyKQ+YJR64Cq
=MXxi
-----END PGP SIGNATURE-----

--/RqEFHMuhBp2bkqw--

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 08:19:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id AEB57ACA;
 Fri, 20 Jun 2014 08:19:01 +0000 (UTC)
Received: from mail-we0-x234.google.com (mail-we0-x234.google.com
 [IPv6:2a00:1450:400c:c03::234])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id E85EC2330;
 Fri, 20 Jun 2014 08:19:00 +0000 (UTC)
Received: by mail-we0-f180.google.com with SMTP id x48so3449998wes.11
 for ; Fri, 20 Jun 2014 01:18:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:reply-to:sender:in-reply-to:references:date:message-id
 :subject:from:to:cc:content-type;
 bh=mO4cIQW9H4AnvLcR6VOZ9UvVT0NwQhMOX47m6rLL3XE=;
 b=C2PZ6ynz2MfCXiBUexMe7pr6EkEvnREIdvOR+dZ73hPnjUoKNg5wCVi8EKOufmCMpa
 fAEYgCy03ErxI7xNEilS5griaaphzeUANSKHuxVq9ES8IDiozp3HKoel8OLRxjJhNvVh
 xniqJeTsS+/Iskv3Aysqoic1co/dBesgYapixG6OefS3JvnU3dbTCP+ndOQgABuNr31p
 oNcLtqEuiGzC2N+1rIXMhnSIuiXCEgjxYpqzhdQECyW/17pBOr3uUW858oXF4Jlb5fr2
 x86lD9ylM4K4orAmKAJuFOkgJNdL7kXGd/xMbnjIhYicpQPyTmp9PF+gdKI3a3lEAKSp
 DFyw==
MIME-Version: 1.0
X-Received: by 10.180.36.241 with SMTP id t17mr2308285wij.38.1403252338990;
 Fri, 20 Jun 2014 01:18:58 -0700 (PDT)
Reply-To: attilio@FreeBSD.org
Sender: asmrookie@gmail.com
Received: by 10.217.46.129 with HTTP; Fri, 20 Jun 2014 01:18:58 -0700 (PDT)
Received: by 10.217.46.129 with HTTP; Fri, 20 Jun 2014 01:18:58 -0700 (PDT)
In-Reply-To: <20140620074939.GE3991@kib.kiev.ua>
References: <201406192154.s5JLsfed074305@svn.freebsd.org>
 <20140620040801.GA3991@kib.kiev.ua>
 
 <20140620074939.GE3991@kib.kiev.ua>
Date: Fri, 20 Jun 2014 10:18:58 +0200
X-Google-Sender-Auth: jsfejOjwLRB0mnevnh9Li2dnf_4
Message-ID: 
Subject: Re: svn commit: r267651 - in head: share/man/man4 sys/dev/cpuctl
 sys/sys usr.sbin/cpucontrol
From: Attilio Rao 
To: Konstantin Belousov 
Content-Type: text/plain; charset=UTF-8
X-Content-Filtered-By: Mailman/MimeDel 2.1.18
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 08:19:01 -0000

On Jun 20, 2014 9:49 AM, "Konstantin Belousov"  wrote:
>
> On Fri, Jun 20, 2014 at 08:12:59AM +0200, Attilio Rao wrote:
> > On Fri, Jun 20, 2014 at 6:08 AM, Konstantin Belousov
> >  wrote:
> > > On Thu, Jun 19, 2014 at 09:54:41PM +0000, Attilio Rao wrote:
> > >> Author: attilio
> > >> Date: Thu Jun 19 21:54:41 2014
> > >> New Revision: 267651
> > >> URL: http://svnweb.freebsd.org/changeset/base/267651
> > >>
> > >> Log:
> > >>   Following comments in r242565 add the possibility to specify ecx
when
> > >>   performing cpuid calls.
> > >>   Add also a new way to specify the level type to cpucontrol(8) as
> > >>   reported in the manpage.
> > >>
> > >>   Sponsored by:       EMC / Isilon storage division
> > >>   Reviewed by:        bdrewery, gcooper
> > >>   Testerd by: bdrewery
> > >> Modified: head/sys/sys/cpuctl.h
> > >>
==============================================================================
> > >> --- head/sys/sys/cpuctl.h     Thu Jun 19 21:05:07 2014
 (r267650)
> > >> +++ head/sys/sys/cpuctl.h     Thu Jun 19 21:54:41 2014
 (r267651)
> > >> @@ -35,7 +35,8 @@ typedef struct {
> > >>  } cpuctl_msr_args_t;
> > >>
> > >>  typedef struct {
> > >> -     int             level;  /* CPUID level */
> > >> +     int             level;          /* CPUID level */
> > >> +     int             level_type;     /* CPUID level type */
> > >>       uint32_t        data[4];
> > >>  } cpuctl_cpuid_args_t;
> > >>
> > >> @@ -50,5 +51,6 @@ typedef struct {
> > >>  #define      CPUCTL_UPDATE   _IOWR('c', 4, cpuctl_update_args_t)
> > >>  #define      CPUCTL_MSRSBIT  _IOWR('c', 5, cpuctl_msr_args_t)
> > >>  #define      CPUCTL_MSRCBIT  _IOWR('c', 6, cpuctl_msr_args_t)
> > >> +#define      CPUCTL_CPUID_COUNT _IOWR('c', 7, cpuctl_cpuid_args_t)
> > >>
> > >>  #endif /* _CPUCTL_H_ */
> > >
> > > The cpuctl(4) is used by third-party code, and this change breaks its
> > > ABI. The numeric value for CPUCTL_CPUID is changed, which means that
> > > old binaries call non-existing ioctl now. This is at least a visible
> > > breakage, since the argument for the ioctl changed the layout as well.
> > >
> > > The following patch restored the CPUCTL_CPUID for me.  I considered
> > > naming its argument differently, instead of renaming the argument
> > > of CPUCTL_CPUID_COUNT (which you tried to do ?), but decided not,
> > > to preserve the API as well.
> >
> > No, breaking the ABI is fine for -CURRENT so I don't see why we need
the bloat.
>
> No, breaking ABI is not fine at all, be it CURRENT or not. We try to
> keep the ABI stable, doing costly measures like symbol versioning, where
> applicable. Since this is a change to ABI for kernel interface, it
> cannot be covered by symver tricks and must be done in kernel.
>
> > I don't plan on MFC this patch. If I need to (or any user requests
> > that) I will do with the appropriate ABI-compliant way (ie. adding a
> > new argument like this one).
>
> Besides the same-world ABI issue, people run jails with lower world
> version on higher-versioned kernels.

I think you have a point,I forgot we have different requirements for ABI
and KBI/KPI in -CURRENT per jail. I will make a patch for it when I get
back home in few hours.

Attilio

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 09:40:59 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 80CAD110;
 Fri, 20 Jun 2014 09:40:59 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 68F9529CC;
 Fri, 20 Jun 2014 09:40:59 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5K9exOc004379;
 Fri, 20 Jun 2014 09:40:59 GMT (envelope-from bapt@svn.freebsd.org)
Received: (from bapt@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5K9ehrm003692;
 Fri, 20 Jun 2014 09:40:43 GMT (envelope-from bapt@svn.freebsd.org)
Message-Id: <201406200940.s5K9ehrm003692@svn.freebsd.org>
From: Baptiste Daroussin 
Date: Fri, 20 Jun 2014 09:40:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267667 - in head: bin/chio bin/freebsd-version bin/pkill
 bin/setfacl games/morse games/random sbin/adjkerntz sbin/atm/atmconfig
 sbin/camcontrol sbin/casperd sbin/dhclient sbin/ffsinfo ...
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 09:40:59 -0000

Author: bapt
Date: Fri Jun 20 09:40:43 2014
New Revision: 267667
URL: http://svnweb.freebsd.org/changeset/base/267667

Log:
  use .Mt to mark up email addresses consistently (part1)
  
  PR:		191174
  Submitted by:	Franco Fichtner  

Modified:
  head/bin/chio/chio.1
  head/bin/freebsd-version/freebsd-version.1
  head/bin/pkill/pkill.1
  head/bin/setfacl/setfacl.1
  head/games/morse/morse.6
  head/games/random/random.6
  head/sbin/adjkerntz/adjkerntz.8
  head/sbin/atm/atmconfig/atmconfig.8
  head/sbin/camcontrol/camcontrol.8
  head/sbin/casperd/casperd.8
  head/sbin/dhclient/dhclient-script.8
  head/sbin/dhclient/dhclient.8
  head/sbin/dhclient/dhclient.conf.5
  head/sbin/dhclient/dhclient.leases.5
  head/sbin/dhclient/dhcp-options.5
  head/sbin/ffsinfo/ffsinfo.8
  head/sbin/fsirand/fsirand.8
  head/sbin/gbde/gbde.8
  head/sbin/geom/class/cache/gcache.8
  head/sbin/geom/class/concat/gconcat.8
  head/sbin/geom/class/eli/geli.8
  head/sbin/geom/class/journal/gjournal.8
  head/sbin/geom/class/label/glabel.8
  head/sbin/geom/class/mirror/gmirror.8
  head/sbin/geom/class/mountver/gmountver.8
  head/sbin/geom/class/multipath/gmultipath.8
  head/sbin/geom/class/nop/gnop.8
  head/sbin/geom/class/part/gpart.8
  head/sbin/geom/class/raid/graid.8
  head/sbin/geom/class/raid3/graid3.8
  head/sbin/geom/class/sched/gsched.8
  head/sbin/geom/class/shsec/gshsec.8
  head/sbin/geom/class/stripe/gstripe.8
  head/sbin/geom/class/virstor/gvirstor.8
  head/sbin/geom/core/geom.8
  head/sbin/ggate/ggatec/ggatec.8
  head/sbin/ggate/ggated/ggated.8
  head/sbin/ggate/ggatel/ggatel.8
  head/sbin/growfs/growfs.8
  head/sbin/gvinum/gvinum.8
  head/sbin/hastctl/hastctl.8
  head/sbin/hastd/hast.conf.5
  head/sbin/hastd/hastd.8
  head/sbin/ipfw/ipfw.8
  head/sbin/kldconfig/kldconfig.8
  head/sbin/kldload/kldload.8
  head/sbin/kldstat/kldstat.8
  head/sbin/kldunload/kldunload.8
  head/sbin/md5/md5.1
  head/sbin/mdconfig/mdconfig.8
  head/sbin/mount/mount.conf.8
  head/sbin/mount_cd9660/mount_cd9660.8
  head/sbin/mount_msdosfs/mount_msdosfs.8
  head/sbin/mount_unionfs/mount_unionfs.8
  head/sbin/natd/natd.8
  head/sbin/newfs_msdos/newfs_msdos.8
  head/sbin/newfs_nandfs/newfs_nandfs.8
  head/sbin/nos-tun/nos-tun.8
  head/sbin/nvmecontrol/nvmecontrol.8
  head/sbin/rcorder/rcorder.8
  head/sbin/reboot/nextboot.8
  head/sbin/recoverdisk/recoverdisk.1
  head/sbin/sconfig/sconfig.8
  head/share/examples/mdoc/example.1
  head/share/examples/mdoc/example.3
  head/share/examples/mdoc/example.4
  head/share/examples/mdoc/example.9
  head/share/examples/scsi_target/scsi_target.8
  head/tools/tools/ether_reflect/ether_reflect.1
  head/tools/tools/fixwhite/fixwhite.1
  head/tools/tools/mcgrab/mcgrab.1
  head/tools/tools/mctest/mctest.1
  head/tools/tools/sysdoc/sysdoc.sh
  head/tools/tools/vimage/vimage.8

Modified: head/bin/chio/chio.1
==============================================================================
--- head/bin/chio/chio.1	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/bin/chio/chio.1	Fri Jun 20 09:40:43 2014	(r267667)
@@ -290,13 +290,11 @@ Configure the changer to use picker 2 (t
 The
 .Nm
 program and SCSI changer driver were written by
-.An Jason R. Thorpe Aq thorpej@and.com
+.An Jason R. Thorpe Aq Mt thorpej@and.com
 for And Communications,
 .Pa http://www.and.com/ .
 .Pp
 Additional work by
-.An Hans Huebner
-.Aq hans@artcom.de
+.An Hans Huebner Aq Mt hans@artcom.de
 and
-.An Steve Gunn
-.Aq csg@waterspout.com .
+.An Steve Gunn Aq Mt csg@waterspout.com .

Modified: head/bin/freebsd-version/freebsd-version.1
==============================================================================
--- head/bin/freebsd-version/freebsd-version.1	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/bin/freebsd-version/freebsd-version.1	Fri Jun 20 09:40:43 2014	(r267667)
@@ -121,4 +121,4 @@ command appeared in
 The
 .Nm
 utility and this manual page were written by
-.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org .
+.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .

Modified: head/bin/pkill/pkill.1
==============================================================================
--- head/bin/pkill/pkill.1	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/bin/pkill/pkill.1	Fri Jun 20 09:40:43 2014	(r267667)
@@ -291,5 +291,4 @@ Solaris 7.
 They made their first appearance in
 .Fx 5.3 .
 .Sh AUTHORS
-.An Andrew Doran
-.Aq ad@NetBSD.org
+.An Andrew Doran Aq Mt ad@NetBSD.org

Modified: head/bin/setfacl/setfacl.1
==============================================================================
--- head/bin/setfacl/setfacl.1	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/bin/setfacl/setfacl.1	Fri Jun 20 09:40:43 2014	(r267667)
@@ -485,6 +485,6 @@ NFSv4 ACL support was introduced in
 The
 .Nm
 utility was written by
-.An Chris D. Faulhaber Aq jedgar@fxp.org .
+.An Chris D. Faulhaber Aq Mt jedgar@fxp.org .
 NFSv4 ACL support was implemented by
-.An Edward Tomasz Napierala Aq trasz@FreeBSD.org .
+.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org .

Modified: head/games/morse/morse.6
==============================================================================
--- head/games/morse/morse.6	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/games/morse/morse.6	Fri Jun 20 09:40:43 2014	(r267667)
@@ -177,7 +177,7 @@ device file
 Sound support for
 .Nm
 added by
-.An Lyndon Nerenberg (VE6BBM) Aq lyndon@orthanc.ca .
+.An Lyndon Nerenberg (VE6BBM) Aq Mt lyndon@orthanc.ca .
 .Pp
 Ability to key an external device added by
 .An J\(:org Wunsch

Modified: head/games/random/random.6
==============================================================================
--- head/games/random/random.6	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/games/random/random.6	Fri Jun 20 09:40:43 2014	(r267667)
@@ -117,7 +117,7 @@ instead of newlines.
 .Sh HISTORY
 The
 functionality to randomizing lines and words was added in 2003 by
-.An "Sean Chittenden" Aq seanc@FreeBSD.org .
+.An Sean Chittenden Aq Mt seanc@FreeBSD.org .
 .Sh BUGS
 No index is used when printing out tokens from the list which
 makes it rather slow for large files (10MB+).

Modified: head/sbin/adjkerntz/adjkerntz.8
==============================================================================
--- head/sbin/adjkerntz/adjkerntz.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/adjkerntz/adjkerntz.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -190,4 +190,4 @@ The
 utility appeared in
 .Fx 1.0 .
 .Sh AUTHORS
-.An Andrey A. Chernov Aq ache@astral.msk.su
+.An Andrey A. Chernov Aq Mt ache@astral.msk.su

Modified: head/sbin/atm/atmconfig/atmconfig.8
==============================================================================
--- head/sbin/atm/atmconfig/atmconfig.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/atm/atmconfig/atmconfig.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -316,4 +316,4 @@ List all NATM routes.
 .Xr natmip 4 ,
 .Xr atm 8
 .Sh AUTHORS
-.An Hartmut Brandt Aq harti@FreeBSD.org
+.An Hartmut Brandt Aq Mt harti@FreeBSD.org

Modified: head/sbin/camcontrol/camcontrol.8
==============================================================================
--- head/sbin/camcontrol/camcontrol.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/camcontrol/camcontrol.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -1666,7 +1666,7 @@ and first appeared in
 in
 .Fx 2.0.5 .
 .Sh AUTHORS
-.An Kenneth Merry Aq ken@FreeBSD.org
+.An Kenneth Merry Aq Mt ken@FreeBSD.org
 .Sh BUGS
 The code that parses the generic command line arguments does not know that
 some of the subcommands take multiple arguments.

Modified: head/sbin/casperd/casperd.8
==============================================================================
--- head/sbin/casperd/casperd.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/casperd/casperd.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -122,5 +122,5 @@ daemon exits 0 on success, and >0 if an 
 The
 .Nm
 was implemented by
-.An Pawel Jakub Dawidek Aq pawel@dawidek.net
+.An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net
 under sponsorship from the FreeBSD Foundation.

Modified: head/sbin/dhclient/dhclient-script.8
==============================================================================
--- head/sbin/dhclient/dhclient-script.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/dhclient/dhclient-script.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -273,7 +273,7 @@ but current scripts do not do this.
 The original version of
 .Nm
 was written for the Internet Software Consortium by
-.An Ted Lemon Aq mellon@fugue.com
+.An Ted Lemon Aq Mt mellon@fugue.com
 in cooperation with Vixie Enterprises.
 .Pp
 The
@@ -281,7 +281,7 @@ The
 implementation of
 .Nm
 was written by
-.An Kenneth R. Westerback Aq krw@openbsd.org .
+.An Kenneth R. Westerback Aq Mt krw@openbsd.org .
 .Sh BUGS
 If more than one interface is being used, there is no obvious way to
 avoid clashes between server-supplied configuration parameters - for

Modified: head/sbin/dhclient/dhclient.8
==============================================================================
--- head/sbin/dhclient/dhclient.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/dhclient/dhclient.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -188,9 +188,9 @@ The
 .Nm
 utility
 was written by
-.An Ted Lemon Aq mellon@fugue.com
+.An Ted Lemon Aq Mt mellon@fugue.com
 and
-.An Elliot Poger Aq elliot@poger.com .
+.An Elliot Poger Aq Mt elliot@poger.com .
 .Pp
 The current implementation was reworked by
-.An Henning Brauer Aq henning@openbsd.org .
+.An Henning Brauer Aq Mt henning@openbsd.org .

Modified: head/sbin/dhclient/dhclient.conf.5
==============================================================================
--- head/sbin/dhclient/dhclient.conf.5	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/dhclient/dhclient.conf.5	Fri Jun 20 09:40:43 2014	(r267667)
@@ -537,8 +537,8 @@ The
 .Xr dhclient 8
 utility
 was written by
-.An Ted Lemon Aq mellon@vix.com
+.An Ted Lemon Aq Mt mellon@vix.com
 under a contract with Vixie Labs.
 .Pp
 The current implementation was reworked by
-.An Henning Brauer Aq henning@openbsd.org .
+.An Henning Brauer Aq Mt henning@openbsd.org .

Modified: head/sbin/dhclient/dhclient.leases.5
==============================================================================
--- head/sbin/dhclient/dhclient.leases.5	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/dhclient/dhclient.leases.5	Fri Jun 20 09:40:43 2014	(r267667)
@@ -88,8 +88,8 @@ The
 .Xr dhclient 8
 utility
 was written by
-.An Ted Lemon Aq mellon@vix.com
+.An Ted Lemon Aq Mt mellon@vix.com
 under a contract with Vixie Labs.
 .Pp
 The current implementation was reworked by
-.An Henning Brauer Aq henning@openbsd.org .
+.An Henning Brauer Aq Mt henning@openbsd.org .

Modified: head/sbin/dhclient/dhcp-options.5
==============================================================================
--- head/sbin/dhclient/dhcp-options.5	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/dhclient/dhcp-options.5	Fri Jun 20 09:40:43 2014	(r267667)
@@ -603,8 +603,8 @@ The
 .Xr dhcpd 8
 utility
 was written by
-.An Ted Lemon Aq mellon@vix.com
+.An Ted Lemon Aq Mt mellon@vix.com
 under a contract with Vixie Labs.
 .Pp
 The current implementation was reworked by
-.An Henning Brauer Aq henning@openbsd.org .
+.An Henning Brauer Aq Mt henning@openbsd.org .

Modified: head/sbin/ffsinfo/ffsinfo.8
==============================================================================
--- head/sbin/ffsinfo/ffsinfo.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/ffsinfo/ffsinfo.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -134,9 +134,9 @@ The
 utility first appeared in
 .Fx 4.4 .
 .Sh AUTHORS
-.An Christoph Herrmann Aq chm@FreeBSD.org
-.An Thomas-Henning von Kamptz Aq tomsoft@FreeBSD.org
-.An The GROWFS team Aq growfs@Tomsoft.COM
+.An Christoph Herrmann Aq Mt chm@FreeBSD.org
+.An Thomas-Henning von Kamptz Aq Mt tomsoft@FreeBSD.org
+.An The GROWFS team Aq Mt growfs@Tomsoft.COM
 .Sh BUGS
 Snapshots are handled like plain files.
 They should get their own level to provide for independent control of the

Modified: head/sbin/fsirand/fsirand.8
==============================================================================
--- head/sbin/fsirand/fsirand.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/fsirand/fsirand.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -107,7 +107,7 @@ A
 version first appeared in
 .Fx 2.2.5 .
 .Sh AUTHORS
-.An Todd C. Miller Aq Todd.Miller@courtesan.com
+.An Todd C. Miller Aq Mt Todd.Miller@courtesan.com
 .Sh CAVEATS
 Since
 .Nm

Modified: head/sbin/gbde/gbde.8
==============================================================================
--- head/sbin/gbde/gbde.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/gbde/gbde.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -243,14 +243,14 @@ To destroy all copies of the masterkey:
 This software was developed for the
 .Fx
 Project by
-.An "Poul-Henning Kamp"
+.An Poul-Henning Kamp
 and NAI Labs, the Security Research Division of Network Associates, Inc.\&
 under DARPA/SPAWAR contract N66001-01-C-8035
 .Pq Dq CBOSS ,
 as part of the
 DARPA CHATS research program.
 .Sh AUTHORS
-.An "Poul-Henning Kamp" Aq phk@FreeBSD.org
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org
 .Sh BUGS
 The cryptographic algorithms and the overall design have not been
 attacked mercilessly for over 10 years by a gang of cryptoanalysts.

Modified: head/sbin/geom/class/cache/gcache.8
==============================================================================
--- head/sbin/geom/class/cache/gcache.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/geom/class/cache/gcache.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -189,4 +189,4 @@ The
 utility appeared in
 .Fx 7.0 .
 .Sh AUTHORS
-.An Ruslan Ermilov Aq ru@FreeBSD.org
+.An Ruslan Ermilov Aq Mt ru@FreeBSD.org

Modified: head/sbin/geom/class/concat/gconcat.8
==============================================================================
--- head/sbin/geom/class/concat/gconcat.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/geom/class/concat/gconcat.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -194,4 +194,4 @@ The
 utility appeared in
 .Fx 5.3 .
 .Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org

Modified: head/sbin/geom/class/eli/geli.8
==============================================================================
--- head/sbin/geom/class/eli/geli.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/geom/class/eli/geli.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -1057,4 +1057,4 @@ metadata version supported by the given 
 .It Li 10.0 Ta 7
 .El
 .Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org

Modified: head/sbin/geom/class/journal/gjournal.8
==============================================================================
--- head/sbin/geom/class/journal/gjournal.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/geom/class/journal/gjournal.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -343,4 +343,4 @@ The
 utility appeared in
 .Fx 7.0 .
 .Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org

Modified: head/sbin/geom/class/label/glabel.8
==============================================================================
--- head/sbin/geom/class/label/glabel.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/geom/class/label/glabel.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -272,4 +272,4 @@ The
 utility appeared in
 .Fx 5.3 .
 .Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org

Modified: head/sbin/geom/class/mirror/gmirror.8
==============================================================================
--- head/sbin/geom/class/mirror/gmirror.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/geom/class/mirror/gmirror.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -376,7 +376,7 @@ The
 utility appeared in
 .Fx 5.3 .
 .Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
 .Sh BUGS
 There should be a way to change a component's priority inside a running mirror.
 .Pp

Modified: head/sbin/geom/class/mountver/gmountver.8
==============================================================================
--- head/sbin/geom/class/mountver/gmountver.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/geom/class/mountver/gmountver.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -127,4 +127,4 @@ The
 utility appeared in
 .Fx 9.0 .
 .Sh AUTHORS
-.An Edward Tomasz Napierala Aq trasz@FreeBSD.org
+.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org

Modified: head/sbin/geom/class/multipath/gmultipath.8
==============================================================================
--- head/sbin/geom/class/multipath/gmultipath.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/geom/class/multipath/gmultipath.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -360,6 +360,6 @@ GEOM_MULTIPATH: da2 added to FRED
 .Xr mount 8 ,
 .Xr newfs 8 ,
 .Xr sysctl 8
-.Sh AUTHOR
-.An Matthew Jacob Aq mjacob@FreeBSD.org
-.An Alexander Motin Aq mav@FreeBSD.org
+.Sh AUTHORS
+.An Matthew Jacob Aq Mt mjacob@FreeBSD.org
+.An Alexander Motin Aq Mt mav@FreeBSD.org

Modified: head/sbin/geom/class/nop/gnop.8
==============================================================================
--- head/sbin/geom/class/nop/gnop.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/geom/class/nop/gnop.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -176,4 +176,4 @@ The
 utility appeared in
 .Fx 5.3 .
 .Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org

Modified: head/sbin/geom/class/part/gpart.8
==============================================================================
--- head/sbin/geom/class/part/gpart.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/geom/class/part/gpart.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -1127,4 +1127,4 @@ The
 utility appeared in
 .Fx 7.0 .
 .Sh AUTHORS
-.An Marcel Moolenaar Aq marcel@FreeBSD.org
+.An Marcel Moolenaar Aq Mt marcel@FreeBSD.org

Modified: head/sbin/geom/class/raid/graid.8
==============================================================================
--- head/sbin/geom/class/raid/graid.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/geom/class/raid/graid.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -320,5 +320,5 @@ The
 utility appeared in
 .Fx 9.0 .
 .Sh AUTHORS
-.An Alexander Motin Aq mav@FreeBSD.org
-.An M. Warner Losh Aq imp@FreeBSD.org
+.An Alexander Motin Aq Mt mav@FreeBSD.org
+.An M. Warner Losh Aq Mt imp@FreeBSD.org

Modified: head/sbin/geom/class/raid3/graid3.8
==============================================================================
--- head/sbin/geom/class/raid3/graid3.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/geom/class/raid3/graid3.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -248,7 +248,7 @@ The
 utility appeared in
 .Fx 5.3 .
 .Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
 .Sh BUGS
 There should be a section with an implementation description.
 .Pp

Modified: head/sbin/geom/class/sched/gsched.8
==============================================================================
--- head/sbin/geom/class/sched/gsched.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/geom/class/sched/gsched.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -158,5 +158,5 @@ The
 utility first appeared in
 .Fx 8.1 .
 .Sh AUTHORS
-.An Fabio Checconi Aq fabio@FreeBSD.org
-.An Luigi Rizzo Aq luigi@FreeBSD.org
+.An Fabio Checconi Aq Mt fabio@FreeBSD.org
+.An Luigi Rizzo Aq Mt luigi@FreeBSD.org

Modified: head/sbin/geom/class/shsec/gshsec.8
==============================================================================
--- head/sbin/geom/class/shsec/gshsec.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/geom/class/shsec/gshsec.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -127,4 +127,4 @@ The
 utility appeared in
 .Fx 5.4 .
 .Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org

Modified: head/sbin/geom/class/stripe/gstripe.8
==============================================================================
--- head/sbin/geom/class/stripe/gstripe.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/geom/class/stripe/gstripe.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -240,4 +240,4 @@ The
 utility appeared in
 .Fx 5.3 .
 .Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org

Modified: head/sbin/geom/class/virstor/gvirstor.8
==============================================================================
--- head/sbin/geom/class/virstor/gvirstor.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/geom/class/virstor/gvirstor.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -293,7 +293,7 @@ and all their structures will be physica
 of the first virstor component.
 This could have a significant impact on file system performance
 .Pq which can in some rare cases be even positive .
-.Sh AUTHOR
-.An Ivan Voras Aq ivoras@FreeBSD.org
+.Sh AUTHORS
+.An Ivan Voras Aq Mt ivoras@FreeBSD.org
 .Pp
 Sponsored by Google Summer of Code 2006.

Modified: head/sbin/geom/core/geom.8
==============================================================================
--- head/sbin/geom/core/geom.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/geom/core/geom.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -203,4 +203,4 @@ The
 utility appeared in
 .Fx 5.3 .
 .Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org

Modified: head/sbin/ggate/ggatec/ggatec.8
==============================================================================
--- head/sbin/ggate/ggatec/ggatec.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/ggate/ggatec/ggatec.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -178,4 +178,4 @@ client# mount_cd9660 /dev/ggate0 /cdrom
 The
 .Nm
 utility as well as this manual page was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org .
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .

Modified: head/sbin/ggate/ggated/ggated.8
==============================================================================
--- head/sbin/ggate/ggated/ggated.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/ggate/ggated/ggated.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -108,4 +108,4 @@ Export CD-ROM device and a file:
 The
 .Nm
 utility as well as this manual page was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org .
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .

Modified: head/sbin/ggate/ggatel/ggatel.8
==============================================================================
--- head/sbin/ggate/ggatel/ggatel.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/ggate/ggatel/ggatel.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -152,4 +152,4 @@ ggatel destroy -u 5
 The
 .Nm
 utility as well as this manual page was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org .
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .

Modified: head/sbin/growfs/growfs.8
==============================================================================
--- head/sbin/growfs/growfs.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/growfs/growfs.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -118,10 +118,10 @@ utility first appeared in
 The ability to resize mounted filesystems was added in
 .Fx 10.0 .
 .Sh AUTHORS
-.An Christoph Herrmann Aq chm@FreeBSD.org
-.An Thomas-Henning von Kamptz Aq tomsoft@FreeBSD.org
-.An The GROWFS team Aq growfs@Tomsoft.COM
-.An Edward Tomasz Napierala Aq trasz@FreeBSD.org
+.An Christoph Herrmann Aq Mt chm@FreeBSD.org
+.An Thomas-Henning von Kamptz Aq Mt tomsoft@FreeBSD.org
+.An The GROWFS team Aq Mt growfs@Tomsoft.COM
+.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
 .Sh CAVEATS
 When expanding a file system mounted read-write, any writes to that file system
 will be temporarily suspended until the expansion is finished.

Modified: head/sbin/gvinum/gvinum.8
==============================================================================
--- head/sbin/gvinum/gvinum.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/gvinum/gvinum.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -395,9 +395,9 @@ and
 through the 2007 Google Summer of Code program.
 The documentation have been updated to reflect the new functionality.
 .Sh AUTHORS
-.An Lukas Ertl Aq le@FreeBSD.org
-.An Chris Jones Aq soc-cjones@FreeBSD.org
-.An Ulf Lilleengen Aq lulf@FreeBSD.org
+.An Lukas Ertl Aq Mt le@FreeBSD.org
+.An Chris Jones Aq Mt soc-cjones@FreeBSD.org
+.An Ulf Lilleengen Aq Mt lulf@FreeBSD.org
 .Sh BUGS
 Currently,
 .Nm

Modified: head/sbin/hastctl/hastctl.8
==============================================================================
--- head/sbin/hastctl/hastctl.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/hastctl/hastctl.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -224,5 +224,5 @@ nodeB# application_start
 The
 .Nm
 was developed by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
 under sponsorship of the FreeBSD Foundation.

Modified: head/sbin/hastd/hast.conf.5
==============================================================================
--- head/sbin/hastd/hast.conf.5	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/hastd/hast.conf.5	Fri Jun 20 09:40:43 2014	(r267667)
@@ -445,5 +445,5 @@ resource tank {
 The
 .Nm
 was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
 under sponsorship of the FreeBSD Foundation.

Modified: head/sbin/hastd/hastd.8
==============================================================================
--- head/sbin/hastd/hastd.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/hastd/hastd.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -228,5 +228,5 @@ nodeA# mount -o noatime /dev/hast/shared
 The
 .Nm
 was developed by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
 under sponsorship of the FreeBSD Foundation.

Modified: head/sbin/ipfw/ipfw.8
==============================================================================
--- head/sbin/ipfw/ipfw.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/ipfw/ipfw.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -3386,7 +3386,7 @@ options have been added by various devel
 .Pp
 .An -nosplit
 In-kernel NAT support written by
-.An Paolo Pisati Aq piso@FreeBSD.org
+.An Paolo Pisati Aq Mt piso@FreeBSD.org
 as part of a Summer of Code 2005 project.
 .Pp
 SCTP

Modified: head/sbin/kldconfig/kldconfig.8
==============================================================================
--- head/sbin/kldconfig/kldconfig.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/kldconfig/kldconfig.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -105,4 +105,4 @@ The
 utility first appeared in
 .Fx 4.4 .
 .Sh AUTHORS
-.An Peter Pentchev Aq roam@FreeBSD.org
+.An Peter Pentchev Aq Mt roam@FreeBSD.org

Modified: head/sbin/kldload/kldload.8
==============================================================================
--- head/sbin/kldload/kldload.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/kldload/kldload.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -126,4 +126,4 @@ replacing the
 .Nm lkm
 interface.
 .Sh AUTHORS
-.An Doug Rabson Aq dfr@FreeBSD.org
+.An Doug Rabson Aq Mt dfr@FreeBSD.org

Modified: head/sbin/kldstat/kldstat.8
==============================================================================
--- head/sbin/kldstat/kldstat.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/kldstat/kldstat.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -74,4 +74,4 @@ replacing the
 .Nm lkm
 interface.
 .Sh AUTHORS
-.An Doug Rabson Aq dfr@FreeBSD.org
+.An Doug Rabson Aq Mt dfr@FreeBSD.org

Modified: head/sbin/kldunload/kldunload.8
==============================================================================
--- head/sbin/kldunload/kldunload.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/kldunload/kldunload.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -78,4 +78,4 @@ replacing the
 .Nm lkm
 interface.
 .Sh AUTHORS
-.An Doug Rabson Aq dfr@FreeBSD.org
+.An Doug Rabson Aq Mt dfr@FreeBSD.org

Modified: head/sbin/md5/md5.1
==============================================================================
--- head/sbin/md5/md5.1	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/md5/md5.1	Fri Jun 20 09:40:43 2014	(r267667)
@@ -154,4 +154,4 @@ This program is placed in the public dom
 RSA Data Security.
 .Pp
 Support for SHA-1 and RIPEMD-160 has been added by
-.An Oliver Eikemeier Aq eik@FreeBSD.org .
+.An Oliver Eikemeier Aq Mt eik@FreeBSD.org .

Modified: head/sbin/mdconfig/mdconfig.8
==============================================================================
--- head/sbin/mdconfig/mdconfig.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/mdconfig/mdconfig.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -319,5 +319,4 @@ combo.
 The
 .Nm
 utility was written by
-.An Poul-Henning Kamp
-.Aq phk@FreeBSD.org .
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org .

Modified: head/sbin/mount/mount.conf.8
==============================================================================
--- head/sbin/mount/mount.conf.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/mount/mount.conf.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -247,6 +247,6 @@ The root mount logic in the
 kernel which parses
 .Pa /.mount.conf
 was written by
-.An Marcel Moolenaar Aq marcel@FreeBSD.org .
+.An Marcel Moolenaar Aq Mt marcel@FreeBSD.org .
 This man page was written by
-.An Craig Rodrigues Aq rodrigc@FreeBSD.org .
+.An Craig Rodrigues Aq Mt rodrigc@FreeBSD.org .

Modified: head/sbin/mount_cd9660/mount_cd9660.8
==============================================================================
--- head/sbin/mount_cd9660/mount_cd9660.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/mount_cd9660/mount_cd9660.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -147,7 +147,7 @@ utility first appeared in
 .Bx 4.4 .
 .Pp
 The Unicode conversion routine was added by
-.An Ryuichiro Imura Aq imura@ryu16.org
+.An Ryuichiro Imura Aq Mt imura@ryu16.org
 in 2003.
 .Sh BUGS
 POSIX device node mapping is currently not supported.

Modified: head/sbin/mount_msdosfs/mount_msdosfs.8
==============================================================================
--- head/sbin/mount_msdosfs/mount_msdosfs.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/mount_msdosfs/mount_msdosfs.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -213,8 +213,8 @@ of the more aptly-named
 .Nm .
 .Pp
 The character code conversion routine was added by
-.An Ryuichiro Imura Aq imura@ryu16.org
-at 2003.
+.An Ryuichiro Imura Aq Mt imura@ryu16.org
+in 2003.
 .Sh CAVEATS
 The use of the
 .Fl 9

Modified: head/sbin/mount_unionfs/mount_unionfs.8
==============================================================================
--- head/sbin/mount_unionfs/mount_unionfs.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/mount_unionfs/mount_unionfs.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -342,9 +342,9 @@ because this is identical to using
 .An -nosplit
 In
 .Fx 7.0 ,
-.An Masanori OZAWA Aq ozawa@ongs.co.jp
+.An Masanori OZAWA Aq Mt ozawa@ongs.co.jp
 reimplemented handling of locking, whiteout, and file mode bits, and
-.An Hiroki Sato Aq hrs@FreeBSD.org
+.An Hiroki Sato Aq Mt hrs@FreeBSD.org
 wrote about the changes in this manual page.
 .Sh BUGS
 THIS FILE SYSTEM TYPE IS NOT YET FULLY SUPPORTED (READ: IT DOESN'T WORK)
@@ -357,7 +357,7 @@ BATTERIES NOT INCLUDED.
 .Pp
 This code also needs an owner in order to be less dangerous - serious
 hackers can apply by sending mail to
-.Aq freebsd-fs@FreeBSD.org
+.Aq Mt freebsd-fs@FreeBSD.org
 and announcing
 their intent to take it over.
 .Pp

Modified: head/sbin/natd/natd.8
==============================================================================
--- head/sbin/natd/natd.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/natd/natd.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -813,19 +813,19 @@ are forwarded to the appropriate router 
 This program is the result of the efforts of many people at different
 times:
 .Pp
-.An Archie Cobbs Aq archie@FreeBSD.org
+.An Archie Cobbs Aq Mt archie@FreeBSD.org
 (divert sockets)
-.An Charles Mott Aq cm@linktel.net
+.An Charles Mott Aq Mt cm@linktel.net
 (packet aliasing)
-.An Eivind Eklund Aq perhaps@yes.no
+.An Eivind Eklund Aq Mt perhaps@yes.no
 (IRC support & misc additions)
-.An Ari Suutari Aq suutari@iki.fi
+.An Ari Suutari Aq Mt suutari@iki.fi
 (natd)
-.An Dru Nelson Aq dnelson@redwoodsoft.com
+.An Dru Nelson Aq Mt dnelson@redwoodsoft.com
 (early PPTP support)
-.An Brian Somers Aq brian@awfulhak.org
+.An Brian Somers Aq Mt brian@awfulhak.org
 (glue)
-.An Ruslan Ermilov Aq ru@FreeBSD.org
+.An Ruslan Ermilov Aq Mt ru@FreeBSD.org
 (natd, packet aliasing, glue)
-.An Poul-Henning Kamp Aq phk@FreeBSD.org
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org
 (multiple instances)

Modified: head/sbin/newfs_msdos/newfs_msdos.8
==============================================================================
--- head/sbin/newfs_msdos/newfs_msdos.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/newfs_msdos/newfs_msdos.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -238,4 +238,4 @@ The
 utility first appeared in
 .Fx 3.0 .
 .Sh AUTHORS
-.An Robert Nordier Aq rnordier@FreeBSD.org .
+.An Robert Nordier Aq Mt rnordier@FreeBSD.org

Modified: head/sbin/newfs_nandfs/newfs_nandfs.8
==============================================================================
--- head/sbin/newfs_nandfs/newfs_nandfs.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/newfs_nandfs/newfs_nandfs.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -72,5 +72,5 @@ The
 .Nm
 utility first appeared in
 .Fx 10.0 .
-.Sh AUTHOR
+.Sh AUTHORS
 .An Grzegorz Bernacki

Modified: head/sbin/nos-tun/nos-tun.8
==============================================================================
--- head/sbin/nos-tun/nos-tun.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/nos-tun/nos-tun.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -82,11 +82,11 @@ tunnel source 192.168.56.45
 .Ed
 .Sh AUTHORS
 .An -nosplit
-.An Nickolay N. Dudorov Aq nnd@itfs.nsk.su
+.An Nickolay N. Dudorov Aq Mt nnd@itfs.nsk.su
 wrote the program,
-.An Poul-Henning Kamp Aq phk@FreeBSD.org
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org
 wrote the man-page.
-.An Isao SEKI Aq iseki@gongon.com
+.An Isao SEKI Aq Mt iseki@gongon.com
 added a new flag, IP protocol number.
 .Sh BUGS
 We do not allow for setting our source address for multihomed machines.

Modified: head/sbin/nvmecontrol/nvmecontrol.8
==============================================================================
--- head/sbin/nvmecontrol/nvmecontrol.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/nvmecontrol/nvmecontrol.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -124,7 +124,7 @@ nvme0 controller and activate it on the 
 .An -nosplit
 .Nm
 was developed by Intel and originally written by
-.An Jim Harris Aq jimharris@FreeBSD.org .
+.An Jim Harris Aq Mt jimharris@FreeBSD.org .
 .Pp
 This man page was written by
-.An Jim Harris Aq jimharris@FreeBSD.org .
+.An Jim Harris Aq Mt jimharris@FreeBSD.org .

Modified: head/sbin/rcorder/rcorder.8
==============================================================================
--- head/sbin/rcorder/rcorder.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/rcorder/rcorder.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -165,9 +165,9 @@ utility first appeared in
 .Sh AUTHORS
 .An -nosplit
 Written by
-.An Perry E. Metzger Aq perry@piermont.com
+.An Perry E. Metzger Aq Mt perry@piermont.com
 and
-.An Matthew R. Green Aq mrg@eterna.com.au .
+.An Matthew R. Green Aq Mt mrg@eterna.com.au .
 .Sh BUGS
 The
 .Dq Li REQUIRE

Modified: head/sbin/reboot/nextboot.8
==============================================================================
--- head/sbin/reboot/nextboot.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/reboot/nextboot.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -118,7 +118,7 @@ appeared in
 .Fx 5.0 .
 .Sh AUTHORS
 This manual page was written by
-.An Gordon Tetlow Aq gordon@FreeBSD.org .
+.An Gordon Tetlow Aq Mt gordon@FreeBSD.org .
 .Sh BUGS
 The
 .Nm

Modified: head/sbin/recoverdisk/recoverdisk.1
==============================================================================
--- head/sbin/recoverdisk/recoverdisk.1	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/recoverdisk/recoverdisk.1	Fri Jun 20 09:40:43 2014	(r267667)
@@ -137,9 +137,9 @@ utility first appeared in
 .Sh AUTHORS
 .An -nosplit
 The original implementation was done by
-.An Poul-Henning Kamp Aq phk@FreeBSD.org
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org
 with minor improvements from
-.An Ulrich Sp\(:orlein Aq uqs@FreeBSD.org .
+.An Ulrich Sp\(:orlein Aq Mt uqs@FreeBSD.org .
 .Pp
 This manual page was written by
 .An Ulrich Sp\(:orlein .

Modified: head/sbin/sconfig/sconfig.8
==============================================================================
--- head/sbin/sconfig/sconfig.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/sbin/sconfig/sconfig.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -595,7 +595,7 @@ versions of the
 utility are not fully compatible.
 .\"--------------------------------------------------------------
 .Sh AUTHORS
-.An Cronyx Engineering Aq info@cronyx.ru
+.An Cronyx Engineering Aq Mt info@cronyx.ru
 .Pp
 .Pa http://www.cronyx.ru
 .\"--------------------------------------------------------------

Modified: head/share/examples/mdoc/example.1
==============================================================================
--- head/share/examples/mdoc/example.1	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/share/examples/mdoc/example.1	Fri Jun 20 09:40:43 2014	(r267667)
@@ -150,6 +150,6 @@ manual page example first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Mike Pritchard Aq mpp@FreeBSD.org .
+.An Mike Pritchard Aq Mt mpp@FreeBSD.org .
 .Sh BUGS
 The actual code for this command is vaporware.

Modified: head/share/examples/mdoc/example.3
==============================================================================
--- head/share/examples/mdoc/example.3	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/share/examples/mdoc/example.3	Fri Jun 20 09:40:43 2014	(r267667)
@@ -330,6 +330,6 @@ manual page example first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Mike Pritchard Aq mpp@FreeBSD.org .
+.An Mike Pritchard Aq Mt mpp@FreeBSD.org .
 .Sh BUGS
 The actual code for this function is vaporware.

Modified: head/share/examples/mdoc/example.4
==============================================================================
--- head/share/examples/mdoc/example.4	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/share/examples/mdoc/example.4	Fri Jun 20 09:40:43 2014	(r267667)
@@ -120,6 +120,6 @@ manual page example first appeared in
 .At v6 .
 .Sh AUTHORS
 This manual page was written by
-.An Mike Pritchard Aq mpp@FreeBSD.org .
+.An Mike Pritchard Aq Mt mpp@FreeBSD.org .
 .Sh BUGS
 The actual code for this device driver is vaporware.

Modified: head/share/examples/mdoc/example.9
==============================================================================
--- head/share/examples/mdoc/example.9	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/share/examples/mdoc/example.9	Fri Jun 20 09:40:43 2014	(r267667)
@@ -338,6 +338,6 @@ manual page example first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Giorgos Keramidas Aq keramida@FreeBSD.org .
+.An Giorgos Keramidas Aq Mt keramida@FreeBSD.org .
 .Sh BUGS
 The actual code for this function is vaporware.

Modified: head/share/examples/scsi_target/scsi_target.8
==============================================================================
--- head/share/examples/scsi_target/scsi_target.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/share/examples/scsi_target/scsi_target.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -155,4 +155,4 @@ and was written by
 It was rewritten for
 .Fx 5.0
 by
-.An Nate Lawson Aq nate@root.org .
+.An Nate Lawson Aq Mt nate@root.org .

Modified: head/tools/tools/ether_reflect/ether_reflect.1
==============================================================================
--- head/tools/tools/ether_reflect/ether_reflect.1	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/tools/tools/ether_reflect/ether_reflect.1	Fri Jun 20 09:40:43 2014	(r267667)
@@ -103,6 +103,7 @@ program first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An George V. Neville-Neil Aq gnn@FreeBSD.org .
+.An George V. Neville-Neil Aq Mt gnn@FreeBSD.org .
 .Sh BUGS
-Should be reported to the author or to net@FreeBSD.org.
+Should be reported to the author or to
+.Aq Mt net@FreeBSD.org .

Modified: head/tools/tools/fixwhite/fixwhite.1
==============================================================================
--- head/tools/tools/fixwhite/fixwhite.1	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/tools/tools/fixwhite/fixwhite.1	Fri Jun 20 09:40:43 2014	(r267667)
@@ -45,4 +45,4 @@ If the whitespace at the beginning of a 
 of eight spaces, the whitespace is replaced by tabs.
 Also, spaces preceeding tabs will be merged into the tab character.
 .Sh AUTHORS
-.An Ed Schouten Aq ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org

Modified: head/tools/tools/mcgrab/mcgrab.1
==============================================================================
--- head/tools/tools/mcgrab/mcgrab.1	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/tools/tools/mcgrab/mcgrab.1	Fri Jun 20 09:40:43 2014	(r267667)
@@ -77,7 +77,7 @@ program first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An George V. Neville-Neil Aq gnn@FreeBSD.org .
+.An George V. Neville-Neil Aq Mt gnn@FreeBSD.org .
 .Sh BUGS
 Should be reported to the author or to
-.Aq net@FreeBSD.org .
+.Aq Mt net@FreeBSD.org .

Modified: head/tools/tools/mctest/mctest.1
==============================================================================
--- head/tools/tools/mctest/mctest.1	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/tools/tools/mctest/mctest.1	Fri Jun 20 09:40:43 2014	(r267667)
@@ -115,7 +115,7 @@ program first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An George V. Neville-Neil Aq gnn@FreeBSD.org .
+.An George V. Neville-Neil Aq Mt gnn@FreeBSD.org .
 .Sh BUGS
 Should be reported to the author or to
-.Aq net@FreeBSD.org .
+.Aq Mt net@FreeBSD.org .

Modified: head/tools/tools/sysdoc/sysdoc.sh
==============================================================================
--- head/tools/tools/sysdoc/sysdoc.sh	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/tools/tools/sysdoc/sysdoc.sh	Fri Jun 20 09:40:43 2014	(r267667)
@@ -59,12 +59,12 @@ implementation, see the respecting manua
 This manual page is automatically generated
 by a set of scripts written by
 .An -nosplit
-.An Tom Rhodes Aq trhodes@FreeBSD.org ,
+.An Tom Rhodes Aq Mt trhodes@FreeBSD.org ,
 with significant contributions from
-.An Giorgos Keramidas Aq keramida@FreeBSD.org ,
-.An Ruslan Ermilov Aq ru@FreeBSD.org ,
+.An Giorgos Keramidas Aq Mt keramida@FreeBSD.org ,
+.An Ruslan Ermilov Aq Mt ru@FreeBSD.org ,
 and
-.An Marc Silver Aq marcs@draenor.org .
+.An Marc Silver Aq Mt marcs@draenor.org .
 .Sh BUGS
 Sometimes
 .Fx

Modified: head/tools/tools/vimage/vimage.8
==============================================================================
--- head/tools/tools/vimage/vimage.8	Fri Jun 20 07:35:55 2014	(r267666)
+++ head/tools/tools/vimage/vimage.8	Fri Jun 20 09:40:43 2014	(r267667)
@@ -188,8 +188,8 @@ of the main FreeBSD tree.
 As a result of a project sponsored by the FreeBSD Foundation and
 Stiching NLNet, integrated virtualized network stack first appeared
 in FreeBSD 8.0.
+.Sh AUTHORS
+.An Marko Zec Aq Mt zec@fer.hr
 .Sh BUGS
 Deletion of vimages / vnets is known to leak kernel memory and fail at
 stopping various timers, hence may lead to system crashes.
-.Sh AUTHOR
-.An "Marko Zec" Aq zec@fer.hr

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 09:57:46 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5C58582D;
 Fri, 20 Jun 2014 09:57:46 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4457E2B6C;
 Fri, 20 Jun 2014 09:57:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5K9vk77012743;
 Fri, 20 Jun 2014 09:57:46 GMT (envelope-from bapt@svn.freebsd.org)
Received: (from bapt@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5K9vSLh012495;
 Fri, 20 Jun 2014 09:57:28 GMT (envelope-from bapt@svn.freebsd.org)
Message-Id: <201406200957.s5K9vSLh012495@svn.freebsd.org>
From: Baptiste Daroussin 
Date: Fri, 20 Jun 2014 09:57:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267668 - in head: libexec/bootpd
 libexec/bootpd/tools/bootptest libexec/mknetid libexec/pppoed
 libexec/revnetgroup libexec/ypxfr usr.sbin/acpi/acpiconf usr.sbin/acpi/acpidb
 usr.sbin/ac...
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 09:57:46 -0000

Author: bapt
Date: Fri Jun 20 09:57:27 2014
New Revision: 267668
URL: http://svnweb.freebsd.org/changeset/base/267668

Log:
  use .Mt to mark up email addresses consistently (part2)
  
  PR:		191174
  Submitted by:	Franco Fichtner  

Modified:
  head/libexec/bootpd/bootpd.8
  head/libexec/bootpd/tools/bootptest/bootptest.8
  head/libexec/mknetid/mknetid.8
  head/libexec/mknetid/netid.5
  head/libexec/pppoed/pppoed.8
  head/libexec/revnetgroup/revnetgroup.8
  head/libexec/ypxfr/ypxfr.8
  head/usr.sbin/acpi/acpiconf/acpiconf.8
  head/usr.sbin/acpi/acpidb/acpidb.8
  head/usr.sbin/acpi/acpidump/acpidump.8
  head/usr.sbin/adduser/adduser.8
  head/usr.sbin/adduser/adduser.conf.5
  head/usr.sbin/ancontrol/ancontrol.8
  head/usr.sbin/apm/apm.8
  head/usr.sbin/apmd/apmd.8
  head/usr.sbin/asf/asf.8
  head/usr.sbin/bhyve/bhyve.8
  head/usr.sbin/bhyveload/bhyveload.8
  head/usr.sbin/bluetooth/ath3kfw/ath3kfw.8
  head/usr.sbin/bluetooth/bcmfw/bcmfw.8
  head/usr.sbin/bluetooth/bt3cfw/bt3cfw.8
  head/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.8
  head/usr.sbin/bluetooth/bthidd/bthidd.8
  head/usr.sbin/bluetooth/hccontrol/hccontrol.8
  head/usr.sbin/bluetooth/hcsecd/hcsecd.8
  head/usr.sbin/bluetooth/hcsecd/hcsecd.conf.5
  head/usr.sbin/bluetooth/hcseriald/hcseriald.8
  head/usr.sbin/bluetooth/l2control/l2control.8
  head/usr.sbin/bluetooth/l2ping/l2ping.8
  head/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.8
  head/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8
  head/usr.sbin/bluetooth/sdpd/sdpd.8
  head/usr.sbin/boot0cfg/boot0cfg.8
  head/usr.sbin/bootparamd/bootparamd/bootparamd.8
  head/usr.sbin/bsdconfig/bsdconfig.8
  head/usr.sbin/bsdinstall/bsdinstall.8
  head/usr.sbin/bsdinstall/partedit/sade.8
  head/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3
  head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3
  head/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3
  head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.3
  head/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.3
  head/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3
  head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1
  head/usr.sbin/btxld/btxld.8
  head/usr.sbin/chkgrp/chkgrp.8
  head/usr.sbin/cpucontrol/cpucontrol.8
  head/usr.sbin/cron/cron/cron.8
  head/usr.sbin/cron/crontab/crontab.1
  head/usr.sbin/cron/crontab/crontab.5
  head/usr.sbin/crunch/crunchgen/crunchgen.1
  head/usr.sbin/crunch/crunchide/crunchide.1
  head/usr.sbin/ctladm/ctladm.8
  head/usr.sbin/ctld/ctl.conf.5
  head/usr.sbin/ctld/ctld.8
  head/usr.sbin/ctm/ctm/ctm.1
  head/usr.sbin/ctm/ctm/ctm.5
  head/usr.sbin/ctm/ctm_rmail/ctm_rmail.1
  head/usr.sbin/dconschat/dconschat.8
  head/usr.sbin/devinfo/devinfo.8
  head/usr.sbin/dumpcis/dumpcis.8
  head/usr.sbin/eeprom/eeprom.8
  head/usr.sbin/etcupdate/etcupdate.8
  head/usr.sbin/fdwrite/fdwrite.1
  head/usr.sbin/flowctl/flowctl.8
  head/usr.sbin/freebsd-update/freebsd-update.8
  head/usr.sbin/fwcontrol/fwcontrol.8
  head/usr.sbin/gpioctl/gpioctl.8
  head/usr.sbin/gssd/gssd.8
  head/usr.sbin/i2c/i2c.8
  head/usr.sbin/iostat/iostat.8
  head/usr.sbin/ipfwpcap/ipfwpcap.8
  head/usr.sbin/iscsid/iscsid.8
  head/usr.sbin/kbdcontrol/kbdcontrol.1
  head/usr.sbin/kbdmap/kbdmap.1
  head/usr.sbin/kgzip/kgzip.8
  head/usr.sbin/kldxref/kldxref.8
  head/usr.sbin/lmcconfig/lmcconfig.8
  head/usr.sbin/lpr/chkprintcap/chkprintcap.8
  head/usr.sbin/mailwrapper/mailwrapper.8
  head/usr.sbin/makefs/makefs.8
  head/usr.sbin/mergemaster/mergemaster.8
  head/usr.sbin/mixer/mixer.8
  head/usr.sbin/mlxcontrol/mlxcontrol.8
  head/usr.sbin/moused/moused.8
  head/usr.sbin/mptable/mptable.1
  head/usr.sbin/nandsim/nandsim.8
  head/usr.sbin/ndiscvt/ndiscvt.8
  head/usr.sbin/ndiscvt/ndisgen.8
  head/usr.sbin/ngctl/ngctl.8
  head/usr.sbin/nghook/nghook.8
  head/usr.sbin/nscd/nscd.8
  head/usr.sbin/nscd/nscd.conf.5
  head/usr.sbin/nvram/nvram.8
  head/usr.sbin/ofwdump/ofwdump.8
  head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8
  head/usr.sbin/periodic/periodic.8
  head/usr.sbin/pmcannotate/pmcannotate.8
  head/usr.sbin/pmccontrol/pmccontrol.8
  head/usr.sbin/pmcstat/pmcstat.8
  head/usr.sbin/portsnap/portsnap/portsnap.8
  head/usr.sbin/ppp/ppp.8
  head/usr.sbin/rarpd/rarpd.8
  head/usr.sbin/rpc.umntall/rpc.umntall.8
  head/usr.sbin/rpc.yppasswdd/rpc.yppasswdd.8
  head/usr.sbin/rpc.ypxfrd/rpc.ypxfrd.8
  head/usr.sbin/rtadvctl/rtadvctl.8
  head/usr.sbin/rtprio/rtprio.1
  head/usr.sbin/sa/sa.8
  head/usr.sbin/sicontrol/sicontrol.8
  head/usr.sbin/snapinfo/snapinfo.8
  head/usr.sbin/sysrc/sysrc.8
  head/usr.sbin/tcpdrop/tcpdrop.8
  head/usr.sbin/usbdump/usbdump.8
  head/usr.sbin/utx/utx.8
  head/usr.sbin/vidcontrol/vidcontrol.1
  head/usr.sbin/wake/wake.8
  head/usr.sbin/watch/watch.8
  head/usr.sbin/watchdogd/watchdog.8
  head/usr.sbin/watchdogd/watchdogd.8
  head/usr.sbin/wpa/hostapd/hostapd.8
  head/usr.sbin/wpa/hostapd/hostapd.conf.5
  head/usr.sbin/wpa/hostapd_cli/hostapd_cli.8
  head/usr.sbin/wpa/ndis_events/ndis_events.8
  head/usr.sbin/wpa/wpa_cli/wpa_cli.8
  head/usr.sbin/wpa/wpa_passphrase/wpa_passphrase.8
  head/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.8
  head/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.conf.5
  head/usr.sbin/yp_mkdb/yp_mkdb.8
  head/usr.sbin/ypbind/ypbind.8
  head/usr.sbin/yppush/yppush.8
  head/usr.sbin/ypserv/ypinit.8
  head/usr.sbin/ypserv/ypserv.8

Modified: head/libexec/bootpd/bootpd.8
==============================================================================
--- head/libexec/bootpd/bootpd.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/libexec/bootpd/bootpd.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -279,7 +279,7 @@ DHCP Options and BOOTP Vendor Extensions
 .El
 .Sh AUTHORS
 This distribution is currently maintained by
-.An Walter L. Wimer Aq walt+@cmu.edu .
+.An Walter L. Wimer Aq Mt walt+@cmu.edu .
 .Pp
 The original BOOTP server was created by
 .An Bill Croft
@@ -299,12 +299,12 @@ Enhancements and bug-fixes have been con
 (in alphabetical order)
 .Pp
 .An -split
-.An Danny Backx Aq db@sunbim.be
-.An John Brezak Aq brezak@ch.hp.com
-.An Frank da Cruz Aq fdc@cc.columbia.edu
-.An David R. Linn Aq drl@vuse.vanderbilt.edu
-.An Jim McKim Aq mckim@lerc.nasa.gov
-.An Gordon W. Ross Aq gwr@mc.com
-.An Jason Zions Aq jazz@hal.com .
+.An Danny Backx Aq Mt db@sunbim.be
+.An John Brezak Aq Mt brezak@ch.hp.com
+.An Frank da Cruz Aq Mt fdc@cc.columbia.edu
+.An David R. Linn Aq Mt drl@vuse.vanderbilt.edu
+.An Jim McKim Aq Mt mckim@lerc.nasa.gov
+.An Gordon W. Ross Aq Mt gwr@mc.com
+.An Jason Zions Aq Mt jazz@hal.com .
 .Sh BUGS
 Individual host entries must not exceed 1024 characters.

Modified: head/libexec/bootpd/tools/bootptest/bootptest.8
==============================================================================
--- head/libexec/bootpd/tools/bootptest/bootptest.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/libexec/bootpd/tools/bootptest/bootptest.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -62,7 +62,7 @@ utility is a combination of original and
 The main program module
 .Pq Pa bootptest.c
 is original work by
-.An "Gordon W. Ross" Aq gwr@mc.com .
+.An Gordon W. Ross Aq Mt gwr@mc.com .
 The packet printing module
 .Pq Pa print\-bootp.c
 is a slightly modified

Modified: head/libexec/mknetid/mknetid.8
==============================================================================
--- head/libexec/mknetid/mknetid.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/libexec/mknetid/mknetid.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -149,4 +149,4 @@ the default netid database file
 .Xr yp 8 ,
 .Xr yp_mkdb 8
 .Sh AUTHORS
-.An Bill Paul Aq wpaul@ctr.columbia.edu
+.An Bill Paul Aq Mt wpaul@ctr.columbia.edu

Modified: head/libexec/mknetid/netid.5
==============================================================================
--- head/libexec/mknetid/netid.5	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/libexec/mknetid/netid.5	Fri Jun 20 09:57:27 2014	(r267668)
@@ -88,4 +88,4 @@ unix.jodie@kaka 0:jodie
 .Xr mknetid 8 ,
 .Xr yp 8
 .Sh AUTHORS
-.An Mats O Jansson Aq moj@stacken.kth.se
+.An Mats O Jansson Aq Mt moj@stacken.kth.se

Modified: head/libexec/pppoed/pppoed.8
==============================================================================
--- head/libexec/pppoed/pppoed.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/libexec/pppoed/pppoed.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -206,7 +206,7 @@ and the following to
 The
 .Nm
 utility was written by
-.An Brian Somers Aq brian@Awfulhak.org
+.An Brian Somers Aq Mt brian@Awfulhak.org
 and first appeared in
 .Fx 3.4 .
 .Sh BUGS

Modified: head/libexec/revnetgroup/revnetgroup.8
==============================================================================
--- head/libexec/revnetgroup/revnetgroup.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/libexec/revnetgroup/revnetgroup.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -156,4 +156,4 @@ master server
 .Xr yp 8 ,
 .Xr yp_mkdb 8
 .Sh AUTHORS
-.An Bill Paul Aq wpaul@ctr.columbia.edu
+.An Bill Paul Aq Mt wpaul@ctr.columbia.edu

Modified: head/libexec/ypxfr/ypxfr.8
==============================================================================
--- head/libexec/ypxfr/ypxfr.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/libexec/ypxfr/ypxfr.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -305,4 +305,4 @@ domain.
 .Xr yppush 8 ,
 .Xr ypserv 8
 .Sh AUTHORS
-.An Bill Paul Aq wpaul@ctr.columbia.edu
+.An Bill Paul Aq Mt wpaul@ctr.columbia.edu

Modified: head/usr.sbin/acpi/acpiconf/acpiconf.8
==============================================================================
--- head/usr.sbin/acpi/acpiconf/acpiconf.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/acpi/acpiconf/acpiconf.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -91,6 +91,6 @@ utility appeared in
 The
 .Nm
 utility was written by
-.An Mitsuru Iwasaki Aq iwasaki@FreeBSD.org .
+.An Mitsuru Iwasaki Aq Mt iwasaki@FreeBSD.org .
 This manual page was written by
-.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org .
+.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .

Modified: head/usr.sbin/acpi/acpidb/acpidb.8
==============================================================================
--- head/usr.sbin/acpi/acpidb/acpidb.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/acpi/acpidb/acpidb.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -161,7 +161,7 @@ It was imported for
 The
 .Nm
 utility was written by
-.An Mitsuru Iwasaki Aq iwasaki@FreeBSD.org
+.An Mitsuru Iwasaki Aq Mt iwasaki@FreeBSD.org
 and uses Intel ACPI-CA for the backend.
 This manual page was written by
 .An Nate Lawson .

Modified: head/usr.sbin/acpi/acpidump/acpidump.8
==============================================================================
--- head/usr.sbin/acpi/acpidump/acpidump.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/acpi/acpidump/acpidump.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -181,20 +181,20 @@ and was rewritten to use
 for
 .Fx 5.2 .
 .Sh AUTHORS
-.An Doug Rabson Aq dfr@FreeBSD.org
-.An Mitsuru IWASAKI Aq iwasaki@FreeBSD.org
-.An Yasuo YOKOYAMA Aq yokoyama@jp.FreeBSD.org
-.An Nate Lawson Aq njl@FreeBSD.org
+.An Doug Rabson Aq Mt dfr@FreeBSD.org
+.An Mitsuru IWASAKI Aq Mt iwasaki@FreeBSD.org
+.An Yasuo YOKOYAMA Aq Mt yokoyama@jp.FreeBSD.org
+.An Nate Lawson Aq Mt njl@FreeBSD.org
 .Pp
 .An -nosplit
 Some contributions made by
-.An Chitoshi Ohsawa Aq ohsawa@catv1.ccn-net.ne.jp ,
-.An Takayasu IWANASHI Aq takayasu@wendy.a.perfect-liberty.or.jp ,
-.An Yoshihiko SARUMARU Aq mistral@imasy.or.jp ,
-.An Hiroki Sato Aq hrs@FreeBSD.org ,
-.An Michael Lucas Aq mwlucas@blackhelicopters.org
+.An Chitoshi Ohsawa Aq Mt ohsawa@catv1.ccn-net.ne.jp ,
+.An Takayasu IWANASHI Aq Mt takayasu@wendy.a.perfect-liberty.or.jp ,
+.An Yoshihiko SARUMARU Aq Mt mistral@imasy.or.jp ,
+.An Hiroki Sato Aq Mt hrs@FreeBSD.org ,
+.An Michael Lucas Aq Mt mwlucas@blackhelicopters.org
 and
-.An Michael Smith Aq msmith@FreeBSD.org .
+.An Michael Smith Aq Mt msmith@FreeBSD.org .
 .Sh BUGS
 The current implementation does not dump the BOOT structure or
 other miscellaneous tables.

Modified: head/usr.sbin/adduser/adduser.8
==============================================================================
--- head/usr.sbin/adduser/adduser.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/adduser/adduser.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -450,11 +450,11 @@ command appeared in
 .Sh AUTHORS
 .An -nosplit
 This manual page and the original script, in Perl, was written by
-.An Wolfram Schneider Aq wosch@FreeBSD.org .
+.An Wolfram Schneider Aq Mt wosch@FreeBSD.org .
 The replacement script, written as a Bourne
 shell script with some enhancements, and the man page modification that
 came with it were done by
-.An Mike Makonnen Aq mtm@identd.net .
+.An Mike Makonnen Aq Mt mtm@identd.net .
 .Sh BUGS
 In order for
 .Nm

Modified: head/usr.sbin/adduser/adduser.conf.5
==============================================================================
--- head/usr.sbin/adduser/adduser.conf.5	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/adduser/adduser.conf.5	Fri Jun 20 09:57:27 2014	(r267668)
@@ -210,7 +210,7 @@ manual page first appeared in
 .Fx 5.3 .
 .Sh AUTHORS
 This manual page was written by
-.An Tom Rhodes Aq trhodes@FreeBSD.org .
+.An Tom Rhodes Aq Mt trhodes@FreeBSD.org .
 .Sh BUGS
 The internal variables documented here may change without notice.
 Do not rely on them.

Modified: head/usr.sbin/ancontrol/ancontrol.8
==============================================================================
--- head/usr.sbin/ancontrol/ancontrol.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/ancontrol/ancontrol.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -540,7 +540,7 @@ utility first appeared in
 The
 .Nm
 utility was written by
-.An Bill Paul Aq wpaul@ee.columbia.edu .
+.An Bill Paul Aq Mt wpaul@ee.columbia.edu .
 .Sh BUGS
 The statistics counters do not seem to show the amount of transmit
 and received frames as increasing.

Modified: head/usr.sbin/apm/apm.8
==============================================================================
--- head/usr.sbin/apm/apm.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/apm/apm.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -133,7 +133,7 @@ replaces all of its functionality.
 .Xr apm 4 ,
 .Xr zzz 8
 .Sh AUTHORS
-.An Tatsumi Hosokawa Aq hosokawa@jp.FreeBSD.org
+.An Tatsumi Hosokawa Aq Mt hosokawa@jp.FreeBSD.org
 .Sh BUGS
 Some APM implementations do not support parameters needed by
 .Nm .

Modified: head/usr.sbin/apmd/apmd.8
==============================================================================
--- head/usr.sbin/apmd/apmd.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/apmd/apmd.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -308,15 +308,15 @@ The
 utility appeared in
 .Fx 3.3 .
 .Sh AUTHORS
-.An Mitsuru IWASAKI Aq iwasaki@FreeBSD.org
-.An KOIE Hidetaka Aq koie@suri.co.jp
+.An Mitsuru IWASAKI Aq Mt iwasaki@FreeBSD.org
+.An KOIE Hidetaka Aq Mt koie@suri.co.jp
 .Pp
 .An -nosplit
 Some contributions made by
-.An Warner Losh Aq imp@FreeBSD.org ,
-.An Hiroshi Yamashita Aq bluemoon@msj.biglobe.ne.jp ,
-.An Yoshihiko SARUMARU Aq mistral@imasy.or.jp ,
-.An Norihiro Kumagai Aq kuma@nk.rim.or.jp ,
-.An NAKAGAWA Yoshihisa Aq nakagawa@jp.FreeBSD.org ,
+.An Warner Losh Aq Mt imp@FreeBSD.org ,
+.An Hiroshi Yamashita Aq Mt bluemoon@msj.biglobe.ne.jp ,
+.An Yoshihiko SARUMARU Aq Mt mistral@imasy.or.jp ,
+.An Norihiro Kumagai Aq Mt kuma@nk.rim.or.jp ,
+.An NAKAGAWA Yoshihisa Aq Mt nakagawa@jp.FreeBSD.org ,
 and
-.An Nick Hilliard Aq nick@foobar.org .
+.An Nick Hilliard Aq Mt nick@foobar.org .

Modified: head/usr.sbin/asf/asf.8
==============================================================================
--- head/usr.sbin/asf/asf.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/asf/asf.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -170,7 +170,7 @@ The
 utility first appeared in
 .Fx 5.2 .
 .Sh AUTHORS
-.An Greg Lehey Aq grog@FreeBSD.org
+.An Greg Lehey Aq Mt grog@FreeBSD.org
 .Sh BUGS
 Module paths are guessed in a rather naive way by default.
 It is likely to lag behind the changes to the build tree layout.

Modified: head/usr.sbin/bhyve/bhyve.8
==============================================================================
--- head/usr.sbin/bhyve/bhyve.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bhyve/bhyve.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -303,5 +303,5 @@ bhyve -c 4 \e\
 first appeared in
 .Fx 10.0 .
 .Sh AUTHORS
-.An Neel Natu Aq neel@freebsd.org
-.An Peter Grehan Aq grehan@freebsd.org
+.An Neel Natu Aq Mt neel@freebsd.org
+.An Peter Grehan Aq Mt grehan@freebsd.org

Modified: head/usr.sbin/bhyveload/bhyveload.8
==============================================================================
--- head/usr.sbin/bhyveload/bhyveload.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bhyveload/bhyveload.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -147,9 +147,9 @@ and was developed at NetApp Inc.
 .Nm
 was developed by
 .An -nosplit
-.An "Neel Natu" Aq neel@FreeBSD.org
+.An Neel Natu Aq Mt neel@FreeBSD.org
 at NetApp Inc with a lot of help from
-.An Doug Rabson Aq dfr@FreeBSD.org
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .
 .Sh BUGS
 .Nm
 can only load

Modified: head/usr.sbin/bluetooth/ath3kfw/ath3kfw.8
==============================================================================
--- head/usr.sbin/bluetooth/ath3kfw/ath3kfw.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bluetooth/ath3kfw/ath3kfw.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -72,7 +72,7 @@ Display usage message and exit.
 .Xr ugen 4 ,
 .Xr devd 8
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
 .Sh BUGS
 Most likely.
 Please report if found.

Modified: head/usr.sbin/bluetooth/bcmfw/bcmfw.8
==============================================================================
--- head/usr.sbin/bluetooth/bcmfw/bcmfw.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bluetooth/bcmfw/bcmfw.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -99,7 +99,7 @@ device:
 .Xr ubtbcmfw 4 ,
 .Xr ugen 4
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
 .Sh BUGS
 Most likely.
 Please report if found.

Modified: head/usr.sbin/bluetooth/bt3cfw/bt3cfw.8
==============================================================================
--- head/usr.sbin/bluetooth/bt3cfw/bt3cfw.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bluetooth/bt3cfw/bt3cfw.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -68,6 +68,6 @@ Connect to the specified Netgraph driver
 .Sh SEE ALSO
 .Xr ng_bt3c 4
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
 .Sh BUGS
 Please report if found.

Modified: head/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.8
==============================================================================
--- head/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -99,4 +99,4 @@ are:
 .Sh SEE ALSO
 .Xr bthidd 8
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com

Modified: head/usr.sbin/bluetooth/bthidd/bthidd.8
==============================================================================
--- head/usr.sbin/bluetooth/bthidd/bthidd.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bluetooth/bthidd/bthidd.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -107,7 +107,7 @@ configuration file is needed as well.
 .Xr vkbd 4 ,
 .Xr bthidcontrol 8
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
 .Sh CAVEATS
 Any Bluetooth HID device that has
 .Dv HUP_KEYBOARD

Modified: head/usr.sbin/bluetooth/hccontrol/hccontrol.8
==============================================================================
--- head/usr.sbin/bluetooth/hccontrol/hccontrol.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bluetooth/hccontrol/hccontrol.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -178,7 +178,7 @@ are:
 .Xr ng_hci 4 ,
 .Xr hcseriald 8
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
 .Sh BUGS
 Most likely.
 Please report if found.

Modified: head/usr.sbin/bluetooth/hcsecd/hcsecd.8
==============================================================================
--- head/usr.sbin/bluetooth/hcsecd/hcsecd.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bluetooth/hcsecd/hcsecd.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -120,7 +120,7 @@ Display usage message and exit.
 .Xr hccontrol 8 ,
 .Xr hcseriald 8
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
 .Sh BUGS
 Currently there is no way to select the link key or the PIN code based on
 which local device received the request.

Modified: head/usr.sbin/bluetooth/hcsecd/hcsecd.conf.5
==============================================================================
--- head/usr.sbin/bluetooth/hcsecd/hcsecd.conf.5	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bluetooth/hcsecd/hcsecd.conf.5	Fri Jun 20 09:57:27 2014	(r267668)
@@ -128,4 +128,4 @@ device {
 .Sh SEE ALSO
 .Xr hcsecd 8
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com

Modified: head/usr.sbin/bluetooth/hcseriald/hcseriald.8
==============================================================================
--- head/usr.sbin/bluetooth/hcseriald/hcseriald.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bluetooth/hcseriald/hcseriald.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -83,4 +83,4 @@ is an H4 Netgraph node name.
 .Xr tty 4 ,
 .Xr hccontrol 8
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com

Modified: head/usr.sbin/bluetooth/l2control/l2control.8
==============================================================================
--- head/usr.sbin/bluetooth/l2control/l2control.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bluetooth/l2control/l2control.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -94,4 +94,4 @@ are:
 .Xr ng_l2cap 4 ,
 .Xr l2ping 8
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq emax@FreeBSD.org
+.An Maksim Yevmenkin Aq Mt emax@FreeBSD.org

Modified: head/usr.sbin/bluetooth/l2ping/l2ping.8
==============================================================================
--- head/usr.sbin/bluetooth/l2ping/l2ping.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bluetooth/l2ping/l2ping.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -108,7 +108,7 @@ Some implementations may not like large 
 .Xr ng_l2cap 4 ,
 .Xr l2control 8
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq emax@FreeBSD.org
+.An Maksim Yevmenkin Aq Mt emax@FreeBSD.org
 .Sh BUGS
 Could collect more statistic.
 Could check for duplicated, corrupted and lost packets.

Modified: head/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.8
==============================================================================
--- head/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -343,7 +343,7 @@ label.
 .Xr sdpcontrol 8 ,
 .Xr sdpd 8
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
 .Sh CAVEATS
 The
 .Nm

Modified: head/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8
==============================================================================
--- head/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -96,7 +96,7 @@ are:
 .Xr bluetooth 3 ,
 .Xr sdp 3
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
 .Sh CAVEATS
 The
 .Nm

Modified: head/usr.sbin/bluetooth/sdpd/sdpd.8
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/sdpd.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bluetooth/sdpd/sdpd.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -134,7 +134,7 @@ as RFCOMM channels etc., before register
 .Xr sdp 3 ,
 .Xr sdpcontrol 8
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
 .Sh BUGS
 Most likely.
 Please report if found.

Modified: head/usr.sbin/boot0cfg/boot0cfg.8
==============================================================================
--- head/usr.sbin/boot0cfg/boot0cfg.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/boot0cfg/boot0cfg.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -190,7 +190,7 @@ to install the default MBR:
 .Xr fdisk 8 ,
 .Xr gpart 8
 .Sh AUTHORS
-.An Robert Nordier Aq rnordier@FreeBSD.org .
+.An Robert Nordier Aq Mt rnordier@FreeBSD.org
 .Sh BUGS
 Use of the
 .Sq packet

Modified: head/usr.sbin/bootparamd/bootparamd/bootparamd.8
==============================================================================
--- head/usr.sbin/bootparamd/bootparamd/bootparamd.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bootparamd/bootparamd/bootparamd.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -69,7 +69,7 @@ The alias address must of course be free
 .Xr diskless 8
 .Sh AUTHORS
 Written by
-.An Klas Heggemann Aq klas@nada.kth.se .
+.An Klas Heggemann Aq Mt klas@nada.kth.se .
 .Sh BUGS
 You may find the
 .Xr syslog 3

Modified: head/usr.sbin/bsdconfig/bsdconfig.8
==============================================================================
--- head/usr.sbin/bsdconfig/bsdconfig.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bsdconfig/bsdconfig.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -236,7 +236,7 @@ first appeared in
 .Fx 9.2 .
 .Sh AUTHORS
 .An Ron McDowell
-.An Devin Teske Aq dteske@FreeBSD.org
+.An Devin Teske Aq Mt dteske@FreeBSD.org
 .Sh BUGS
 The docsinstall and diskmgmt modules call bsdinstall.
 Bugs found in these modules should be considered those of bsdinstall, not

Modified: head/usr.sbin/bsdinstall/bsdinstall.8
==============================================================================
--- head/usr.sbin/bsdinstall/bsdinstall.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bsdinstall/bsdinstall.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -367,5 +367,4 @@ This version of
 first appeared in
 .Fx 9.0 .
 .Sh AUTHORS
-.An -nosplit
-.An Nathan Whitehorn Aq nwhitehorn@FreeBSD.org
+.An Nathan Whitehorn Aq Mt nwhitehorn@FreeBSD.org

Modified: head/usr.sbin/bsdinstall/partedit/sade.8
==============================================================================
--- head/usr.sbin/bsdinstall/partedit/sade.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bsdinstall/partedit/sade.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -64,12 +64,11 @@ installer. It was replaced in
 with the equivalent part of
 .Xr bsdinstall 8 .
 .Sh AUTHORS
-.An Nathan Whitehorn Aq nwhitehorn@FreeBSD.org
+.An Nathan Whitehorn Aq Mt nwhitehorn@FreeBSD.org
 .Sh BUGS
 The utility misses a lot of nice features, such as tools for
 manipulating
 .Xr gmirror 8
 or
-.Xr zfs 8
-.
+.Xr zfs 8 .
 These will be added later.

Modified: head/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3
==============================================================================
--- head/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3	Fri Jun 20 09:57:27 2014	(r267668)
@@ -116,4 +116,4 @@ This is the private BEGEMOT-BRIDGE-MIB t
 .Xr ifconfig 8 ,
 .Xr snmpmod 3
 .Sh AUTHORS
-.An Shteryana Shopova Aq syrinx@FreeBSD.org
+.An Shteryana Shopova Aq Mt syrinx@FreeBSD.org

Modified: head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3
==============================================================================
--- head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3	Fri Jun 20 09:57:27 2014	(r267668)
@@ -67,4 +67,4 @@ configuration file.
 .Xr hastctl 8 ,
 .Xr hastd 8
 .Sh AUTHORS
-.An Mikolaj Golub Aq trociny@FreeBSD.org
+.An Mikolaj Golub Aq Mt trociny@FreeBSD.org

Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3
==============================================================================
--- head/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3	Fri Jun 20 09:57:27 2014	(r267668)
@@ -85,4 +85,4 @@ This is the MIB that is implemented by t
 .Xr gensnmptree 1 ,
 .Xr snmpmod 3
 .Sh AUTHORS
-.An Victor Cruceru Aq soc-victor@FreeBSD.org
+.An Victor Cruceru Aq Mt soc-victor@FreeBSD.org

Modified: head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.3
==============================================================================
--- head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.3	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.3	Fri Jun 20 09:57:27 2014	(r267668)
@@ -57,4 +57,4 @@ The private BEGEMOT-LM75-MIB that is imp
 .Xr snmpmod 3 ,
 .Xr lm75 4
 .Sh AUTHORS
-.An Luiz Otavio O Souza Aq loos@FreeBSD.org .
+.An Luiz Otavio O Souza Aq Mt loos@FreeBSD.org

Modified: head/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.3
==============================================================================
--- head/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.3	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.3	Fri Jun 20 09:57:27 2014	(r267668)
@@ -433,4 +433,4 @@ This is the MIB that is implemented by t
 .Xr gensnmptree 1 ,
 .Xr snmpmod 3
 .Sh AUTHORS
-.An Hartmut Brandt Aq harti@FreeBSD.org
+.An Hartmut Brandt Aq Mt harti@FreeBSD.org

Modified: head/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3
==============================================================================
--- head/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3	Fri Jun 20 09:57:27 2014	(r267668)
@@ -157,4 +157,4 @@ The private BEGEMOT-WIRELESS-MIB that is
 .Xr ifconfig 8 ,
 .Xr snmpmod 3
 .Sh AUTHORS
-.An Shteryana Shopova Aq syrinx@FreeBSD.org
+.An Shteryana Shopova Aq Mt syrinx@FreeBSD.org

Modified: head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1
==============================================================================
--- head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1	Fri Jun 20 09:57:27 2014	(r267668)
@@ -430,4 +430,4 @@ SNMPv3 is the default version to use for
 .Sh SEE ALSO
 .Xr gensnmpdef 1
 .Sh AUTHORS
-.An Shteryana Shopova Aq syrinx@FreeBSD.org
+.An Shteryana Shopova Aq Mt syrinx@FreeBSD.org

Modified: head/usr.sbin/btxld/btxld.8
==============================================================================
--- head/usr.sbin/btxld/btxld.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/btxld/btxld.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -95,4 +95,4 @@ combined .text and .data segments of the
 .Xr ld 1 ,
 .Xr boot 8
 .Sh AUTHORS
-.An Robert Nordier Aq rnordier@FreeBSD.org .
+.An Robert Nordier Aq Mt rnordier@FreeBSD.org

Modified: head/usr.sbin/chkgrp/chkgrp.8
==============================================================================
--- head/usr.sbin/chkgrp/chkgrp.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/chkgrp/chkgrp.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -86,8 +86,8 @@ utility appeared in
 The
 .Nm
 utility and this manual page were written by
-.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org .
+.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .
 Further functionality was added by
-.An Liam J. Foy Aq liamfoy@dragonflybsd.org .
+.An Liam J. Foy Aq Mt liamfoy@dragonflybsd.org .
 .Sh BUGS
 Should check the range of the group ID.

Modified: head/usr.sbin/cpucontrol/cpucontrol.8
==============================================================================
--- head/usr.sbin/cpucontrol/cpucontrol.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/cpucontrol/cpucontrol.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -177,6 +177,6 @@ utility first appeared in
 The
 .Nm
 utility and this manual page was written by
-.An Stanislav Sedov Aq stas@FreeBSD.org .
+.An Stanislav Sedov Aq Mt stas@FreeBSD.org .
 .Sh BUGS
 Yes, probably, report if any.

Modified: head/usr.sbin/cron/cron/cron.8
==============================================================================
--- head/usr.sbin/cron/cron/cron.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/cron/cron/cron.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -218,4 +218,4 @@ Directory for personal crontab files
 .Xr crontab 5 ,
 .Xr pam.conf 5
 .Sh AUTHORS
-.An Paul Vixie Aq paul@vix.com
+.An Paul Vixie Aq Mt paul@vix.com

Modified: head/usr.sbin/cron/crontab/crontab.1
==============================================================================
--- head/usr.sbin/cron/crontab/crontab.1	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/cron/crontab/crontab.1	Fri Jun 20 09:57:27 2014	(r267668)
@@ -142,4 +142,4 @@ The new command syntax
 differs from previous versions of Vixie Cron, as well as from the classic
 SVR3 syntax.
 .Sh AUTHORS
-.An Paul Vixie Aq paul@vix.com
+.An Paul Vixie Aq Mt paul@vix.com

Modified: head/usr.sbin/cron/crontab/crontab.5
==============================================================================
--- head/usr.sbin/cron/crontab/crontab.5	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/cron/crontab/crontab.5	Fri Jun 20 09:57:27 2014	(r267668)
@@ -295,7 +295,7 @@ All of the
 commands that can appear in place of the first five fields
 are extensions.
 .Sh AUTHORS
-.An Paul Vixie Aq paul@vix.com
+.An Paul Vixie Aq Mt paul@vix.com
 .Sh BUGS
 If you are in one of the 70-odd countries that observe Daylight
 Savings Time, jobs scheduled during the rollback or advance may be

Modified: head/usr.sbin/crunch/crunchgen/crunchgen.1
==============================================================================
--- head/usr.sbin/crunch/crunchgen/crunchgen.1	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/crunch/crunchgen/crunchgen.1	Fri Jun 20 09:57:27 2014	(r267668)
@@ -444,7 +444,7 @@ would also need to be copied to the inst
 The
 .Nm
 utility was written by
-.An James da Silva Aq jds@cs.umd.edu .
+.An James da Silva Aq Mt jds@cs.umd.edu .
 .Pp
 Copyright (c) 1994 University of Maryland.
 All Rights Reserved.
@@ -452,9 +452,9 @@ All Rights Reserved.
 The
 .Ic libs_so
 keyword was added in 2005 by
-.An Adrian Steinmann Aq ast@marabu.ch
+.An Adrian Steinmann Aq Mt ast@marabu.ch
 and
-.An Ceri Davies Aq ceri@FreeBSD.org .
+.An Ceri Davies Aq Mt ceri@FreeBSD.org .
 .Sh CAVEATS
 While
 .Nm

Modified: head/usr.sbin/crunch/crunchide/crunchide.1
==============================================================================
--- head/usr.sbin/crunch/crunchide/crunchide.1	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/crunch/crunchide/crunchide.1	Fri Jun 20 09:57:27 2014	(r267668)
@@ -76,12 +76,12 @@ multiple component programs.
 The
 .Nm crunch
 utility was written by
-.An James da Silva Aq jds@cs.umd.edu .
+.An James da Silva Aq Mt jds@cs.umd.edu .
 .Pp
 Copyright (c) 1994 University of Maryland.
 All Rights Reserved.
 .Pp
-.An Chris Demetriou Aq cgd@netbsd.org
+.An Chris Demetriou Aq Mt cgd@netbsd.org
 reorganized
 .Nm
 so that it supported multiple object formats, and added

Modified: head/usr.sbin/ctladm/ctladm.8
==============================================================================
--- head/usr.sbin/ctladm/ctladm.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/ctladm/ctladm.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -1053,4 +1053,4 @@ The
 utility was originally written during the Winter/Spring of 2003 as an
 interface to CTL.
 .Sh AUTHORS
-.An Ken Merry Aq ken@FreeBSD.org
+.An Ken Merry Aq Mt ken@FreeBSD.org

Modified: head/usr.sbin/ctld/ctl.conf.5
==============================================================================
--- head/usr.sbin/ctld/ctl.conf.5	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/ctld/ctl.conf.5	Fri Jun 20 09:57:27 2014	(r267668)
@@ -283,5 +283,5 @@ The
 configuration file functionality for
 .Xr ctld 8
 was developed by
-.An Edward Tomasz Napierala Aq trasz@FreeBSD.org
+.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
 under sponsorship from the FreeBSD Foundation.

Modified: head/usr.sbin/ctld/ctld.8
==============================================================================
--- head/usr.sbin/ctld/ctld.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/ctld/ctld.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -109,5 +109,5 @@ utility exits 0 on success, and >0 if an
 The
 .Nm
 was developed by
-.An Edward Tomasz Napierala Aq trasz@FreeBSD.org
+.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
 under sponsorship from the FreeBSD Foundation.

Modified: head/usr.sbin/ctm/ctm/ctm.1
==============================================================================
--- head/usr.sbin/ctm/ctm/ctm.1	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/ctm/ctm/ctm.1	Fri Jun 20 09:57:27 2014	(r267668)
@@ -316,10 +316,9 @@ The
 command appeared in
 .Fx 2.1 .
 .Sh AUTHORS
+.An -nosplit
 The CTM system has been designed and implemented by
-.An Poul-Henning Kamp
-.Aq phk@FreeBSD.org .
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org .
 .Pp
-.An Joerg Wunsch
-.Aq joerg@FreeBSD.org
+.An Joerg Wunsch Aq Mt joerg@FreeBSD.org
 wrote this man-page.

Modified: head/usr.sbin/ctm/ctm/ctm.5
==============================================================================
--- head/usr.sbin/ctm/ctm/ctm.5	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/ctm/ctm/ctm.5	Fri Jun 20 09:57:27 2014	(r267668)
@@ -174,10 +174,9 @@ methods were hashed out.
 The CTM system has been made publicly available in
 .Fx 2.1 .
 .Sh AUTHORS
+.An -nosplit
 The CTM system has been designed and implemented by
-.An Poul-Henning Kamp
-.Aq phk@FreeBSD.org .
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org .
 .Pp
-.An Joerg Wunsch
-.Aq joerg@FreeBSD.org
+.An Joerg Wunsch Aq Mt joerg@FreeBSD.org
 wrote this man-page.

Modified: head/usr.sbin/ctm/ctm_rmail/ctm_rmail.1
==============================================================================
--- head/usr.sbin/ctm/ctm_rmail/ctm_rmail.1	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/ctm/ctm_rmail/ctm_rmail.1	Fri Jun 20 09:57:27 2014	(r267668)
@@ -507,4 +507,4 @@ Error messages should be self explanator
 .Xr ctm 5
 .\" .Sh HISTORY
 .Sh AUTHORS
-.An Stephen McKay Aq mckay@FreeBSD.org
+.An Stephen McKay Aq Mt mckay@FreeBSD.org

Modified: head/usr.sbin/dconschat/dconschat.8
==============================================================================
--- head/usr.sbin/dconschat/dconschat.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/dconschat/dconschat.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -323,7 +323,7 @@ console remote {
 .Xr eui64 5 ,
 .Xr fwcontrol 8
 .Sh AUTHORS
-.An Hidetoshi Shimokawa Aq simokawa@FreeBSD.org
+.An Hidetoshi Shimokawa Aq Mt simokawa@FreeBSD.org
 .Sh BUGS
 This utility is
 .Ud

Modified: head/usr.sbin/devinfo/devinfo.8
==============================================================================
--- head/usr.sbin/devinfo/devinfo.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/devinfo/devinfo.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -73,4 +73,4 @@ Without this flag, only those devices th
 .Xr devclass 9 ,
 .Xr device 9
 .Sh AUTHORS
-.An Mike Smith Aq msmith@FreeBSD.org
+.An Mike Smith Aq Mt msmith@FreeBSD.org

Modified: head/usr.sbin/dumpcis/dumpcis.8
==============================================================================
--- head/usr.sbin/dumpcis/dumpcis.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/dumpcis/dumpcis.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -44,6 +44,5 @@ utility translates a raw CIS stream into
 .Xr cbb 4 ,
 .Xr pccard 4
 .Sh AUTHORS
-.An -nosplit
 The original version was written by
-.An Warner Losh Aq imp@FreeBSD.org .
+.An Warner Losh Aq Mt imp@FreeBSD.org .

Modified: head/usr.sbin/eeprom/eeprom.8
==============================================================================
--- head/usr.sbin/eeprom/eeprom.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/eeprom/eeprom.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -684,15 +684,15 @@ The
 utility uses base code from the
 .Nx
 version written by
-.An "Jason R. Thorpe" .
+.An Jason R. Thorpe .
 The handlers for the Open Firmware
 .Pa /options
 node were written by
-.An "Marius Strobl" Aq marius@FreeBSD.org .
+.An Marius Strobl Aq Mt marius@FreeBSD.org .
 The code for accessing the Open Firmware device tree is shared with the
 .Xr ofwdump 8
 utility written by
-.An "Thomas Moestl" Aq tmm@FreeBSD.org .
+.An Thomas Moestl Aq Mt tmm@FreeBSD.org .
 .Sh BUGS
 Currently,
 .Nm

Modified: head/usr.sbin/etcupdate/etcupdate.8
==============================================================================
--- head/usr.sbin/etcupdate/etcupdate.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/etcupdate/etcupdate.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -801,7 +801,7 @@ utility first appeared in
 The
 .Nm
 utility was written by
-.An John Baldwin Aq jhb@FreeBSD.org .
+.An John Baldwin Aq Mt jhb@FreeBSD.org .
 .Sh BUGS
 Rerunning a merge does not automatically delete conflicts left over from a
 previous merge.

Modified: head/usr.sbin/fdwrite/fdwrite.1
==============================================================================
--- head/usr.sbin/fdwrite/fdwrite.1	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/fdwrite/fdwrite.1	Fri Jun 20 09:57:27 2014	(r267668)
@@ -104,7 +104,7 @@ Some of the code was taken from
 .Xr fdformat 1 .
 .Sh AUTHORS
 The program has been contributed by
-.An Poul-Henning Kamp Aq phk@FreeBSD.org .
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org .
 .Sh BUGS
 Diagnostics are less than complete at present.
 .Pp

Modified: head/usr.sbin/flowctl/flowctl.8
==============================================================================
--- head/usr.sbin/flowctl/flowctl.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/flowctl/flowctl.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -83,8 +83,8 @@ parameter can be specify to show selecte
 The
 .Nm
 utility was written by
-.An Gleb Smirnoff Aq glebius@FreeBSD.org ,
+.An Gleb Smirnoff Aq Mt glebius@FreeBSD.org ,
 based on
 .Nm ipacctctl
 written by
-.An Roman V. Palagin Aq romanp@unshadow.net .
+.An Roman V. Palagin Aq Mt romanp@unshadow.net .

Modified: head/usr.sbin/freebsd-update/freebsd-update.8
==============================================================================
--- head/usr.sbin/freebsd-update/freebsd-update.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/freebsd-update/freebsd-update.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -174,4 +174,4 @@ stores temporary files and downloaded up
 .Sh SEE ALSO
 .Xr freebsd-update.conf 5
 .Sh AUTHORS
-.An Colin Percival Aq cperciva@FreeBSD.org
+.An Colin Percival Aq Mt cperciva@FreeBSD.org

Modified: head/usr.sbin/fwcontrol/fwcontrol.8
==============================================================================
--- head/usr.sbin/fwcontrol/fwcontrol.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/fwcontrol/fwcontrol.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -211,9 +211,9 @@ The
 utility first appeared in
 .Fx 5.0 .
 .Sh AUTHORS
-.An Hidetoshi Shimokawa Aq simokawa@FreeBSD.org
-.An Petr Holub Aq hopet@ics.muni.cz
-- MPEG TS mode.
+.An Hidetoshi Shimokawa Aq Mt simokawa@FreeBSD.org
+.An Petr Holub Aq Mt hopet@ics.muni.cz
+(MPEG TS mode)
 .Sh BUGS
 This utility is still under development and provided for debugging purposes.
 Especially MPEG TS reception support is very rudimental and supports only

Modified: head/usr.sbin/gpioctl/gpioctl.8
==============================================================================
--- head/usr.sbin/gpioctl/gpioctl.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/gpioctl/gpioctl.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -121,5 +121,4 @@ utility appeared in
 The
 .Nm
 utility and this manual page were written by
-.An Oleksandr Tymoshenko
-.Aq gonzo@freebsd.org
+.An Oleksandr Tymoshenko Aq Mt gonzo@freebsd.org .

Modified: head/usr.sbin/gssd/gssd.8
==============================================================================
--- head/usr.sbin/gssd/gssd.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/gssd/gssd.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -116,4 +116,4 @@ manual page first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/usr.sbin/i2c/i2c.8
==============================================================================
--- head/usr.sbin/i2c/i2c.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/i2c/i2c.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -159,8 +159,6 @@ utility appeared in
 The
 .Nm
 utility and this manual page were written by
-.An Bartlomiej Sieka
-.Aq tur@semihalf.com
+.An Bartlomiej Sieka Aq Mt tur@semihalf.com
 and
-.An Michal Hajduk
-.Aq mih@semihalf.com .
+.An Michal Hajduk Aq Mt mih@semihalf.com .

Modified: head/usr.sbin/iostat/iostat.8
==============================================================================
--- head/usr.sbin/iostat/iostat.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/iostat/iostat.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -506,7 +506,7 @@ This version of
 first appeared in
 .Fx 3.0 .
 .Sh AUTHORS
-.An Kenneth Merry Aq ken@FreeBSD.org
+.An Kenneth Merry Aq Mt ken@FreeBSD.org
 .Sh BUGS
 The use of
 .Nm

Modified: head/usr.sbin/ipfwpcap/ipfwpcap.8
==============================================================================
--- head/usr.sbin/ipfwpcap/ipfwpcap.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/ipfwpcap/ipfwpcap.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -127,6 +127,6 @@ utility first appeared in
 .An -nosplit
 .Nm
 was written by
-.An P. Kern Aq pkern@cns.utoronto.ca .
+.An P. Kern Aq Mt pkern@cns.utoronto.ca .
 This manual page was written by
-.An Niclas Zeising Aq zeising@FreeBSD.org .
+.An Niclas Zeising Aq Mt zeising@FreeBSD.org .

Modified: head/usr.sbin/iscsid/iscsid.8
==============================================================================
--- head/usr.sbin/iscsid/iscsid.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/iscsid/iscsid.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -109,5 +109,5 @@ command appeared in
 The
 .Nm
 was developed by
-.An Edward Tomasz Napierala Aq trasz@FreeBSD.org
+.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
 under sponsorship from the FreeBSD Foundation.

Modified: head/usr.sbin/kbdcontrol/kbdcontrol.1
==============================================================================
--- head/usr.sbin/kbdcontrol/kbdcontrol.1	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/kbdcontrol/kbdcontrol.1	Fri Jun 20 09:57:27 2014	(r267668)
@@ -271,6 +271,6 @@ kbdcontrol -k /dev/kbdmux0 < /dev/consol
 .Xr kbdmap 5 ,
 .Xr rc.conf 5
 .Sh AUTHORS
-.An S\(/oren Schmidt Aq sos@FreeBSD.org
+.An S\(/oren Schmidt Aq Mt sos@FreeBSD.org
 .Sh BUGS
 Report when found.

Modified: head/usr.sbin/kbdmap/kbdmap.1
==============================================================================
--- head/usr.sbin/kbdmap/kbdmap.1	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/kbdmap/kbdmap.1	Fri Jun 20 09:57:27 2014	(r267668)
@@ -131,12 +131,10 @@ commands appeared in
 .Fx 2.1 .
 .Sh AUTHORS
 .An -nosplit
-.An Wolfram Schneider
-.Aq wosch@FreeBSD.org
+.An Wolfram Schneider Aq Mt wosch@FreeBSD.org
 wrote the original Perl version.
 The current version was rewritten in C by
-.An Jonathan Belson
-.Aq jon@witchspace.com
+.An Jonathan Belson Aq Mt jon@witchspace.com
 for
 .Fx 5.0 .
 .Sh BUGS

Modified: head/usr.sbin/kgzip/kgzip.8
==============================================================================
--- head/usr.sbin/kgzip/kgzip.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/kgzip/kgzip.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -132,7 +132,7 @@ The default loader
 .Xr boot 8 ,
 .Xr loader 8
 .Sh AUTHORS
-.An Robert Nordier Aq rnordier@FreeBSD.org .
+.An Robert Nordier Aq Mt rnordier@FreeBSD.org
 .Sh BUGS
 As symbols are lost, the usefulness of this utility for compressing
 kernels is limited to situations where

Modified: head/usr.sbin/kldxref/kldxref.8
==============================================================================
--- head/usr.sbin/kldxref/kldxref.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/kldxref/kldxref.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -88,8 +88,8 @@ utility first appeared in
 The
 .Nm
 utility was implemented by
-.An Boris Popov Aq bp@FreeBSD.org .
+.An Boris Popov Aq Mt bp@FreeBSD.org .
 This manual page was written by
-.An Boris Popov Aq bp@FreeBSD.org
+.An Boris Popov Aq Mt bp@FreeBSD.org
 and
-.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org .
+.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .

Modified: head/usr.sbin/lmcconfig/lmcconfig.8
==============================================================================
--- head/usr.sbin/lmcconfig/lmcconfig.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/lmcconfig/lmcconfig.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -718,6 +718,6 @@ the user is not privileged and tried to 
 This is a total rewrite of the program
 .Nm lmcctl
 by
-.An "Andrew Stanley-Jones" .
+.An Andrew Stanley-Jones .
 .Sh AUTHORS
-.An "David Boggs" Aq boggs@boggs.palo-alto.ca.us
+.An David Boggs Aq Mt boggs@boggs.palo-alto.ca.us

Modified: head/usr.sbin/lpr/chkprintcap/chkprintcap.8
==============================================================================
--- head/usr.sbin/lpr/chkprintcap/chkprintcap.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/lpr/chkprintcap/chkprintcap.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -88,7 +88,7 @@ capability in the database (default 1, w
 The
 .Nm
 utility was written by
-.An Garrett A. Wollman Aq wollman@lcs.mit.edu .
+.An Garrett A. Wollman Aq Mt wollman@lcs.mit.edu .
 .Sh BUGS
 Not enough sanity-checking is done.
 At a minimum, the ownership and

Modified: head/usr.sbin/mailwrapper/mailwrapper.8
==============================================================================
--- head/usr.sbin/mailwrapper/mailwrapper.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/mailwrapper/mailwrapper.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -153,7 +153,7 @@ utility first appeared in
 and then
 .Fx 4.0 .
 .Sh AUTHORS
-.An Perry E. Metzger Aq perry@piermont.com
+.An Perry E. Metzger Aq Mt perry@piermont.com
 .Sh BUGS
 The entire reason this program exists is a crock.
 Instead, a command

Modified: head/usr.sbin/makefs/makefs.8
==============================================================================
--- head/usr.sbin/makefs/makefs.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/makefs/makefs.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -363,12 +363,11 @@ The
 utility appeared in
 .Nx 1.6 .
 .Sh AUTHORS
-.An Luke Mewburn
-.Aq lukem@NetBSD.org
+.An Luke Mewburn Aq Mt lukem@NetBSD.org
 (original program)
-.An Daniel Watt ,
-.An Walter Deignan ,
-.An Ryan Gabrys ,
-.An Alan Perez-Rathke ,
+.An Daniel Watt
+.An Walter Deignan
+.An Ryan Gabrys
+.An Alan Perez-Rathke
 .An Ram Vedam
 (cd9660 support)

Modified: head/usr.sbin/mergemaster/mergemaster.8
==============================================================================
--- head/usr.sbin/mergemaster/mergemaster.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/mergemaster/mergemaster.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -473,4 +473,4 @@ temporary root environment comes from Ni
 make world tutorial which is referenced above.
 .Sh AUTHORS
 This manual page and the script itself were written by
-.An Douglas Barton Aq dougb@FreeBSD.org .
+.An Douglas Barton Aq Mt dougb@FreeBSD.org .

Modified: head/usr.sbin/mixer/mixer.8
==============================================================================
--- head/usr.sbin/mixer/mixer.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/mixer/mixer.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -171,11 +171,11 @@ utility first appeared in
 .Sh AUTHORS
 .An -nosplit
 Original source by
-.An Craig Metz Aq cmetz@thor.tjhsst.edu
+.An Craig Metz Aq Mt cmetz@thor.tjhsst.edu
 and
 .An Hannu Savolainen .
 Mostly rewritten by
-.An John-Mark Gurney Aq jmg@FreeBSD.org .
+.An John-Mark Gurney Aq Mt jmg@FreeBSD.org .
 This
 manual page was written by
-.An Mike Pritchard Aq mpp@FreeBSD.org .
+.An Mike Pritchard Aq Mt mpp@FreeBSD.org .

Modified: head/usr.sbin/mlxcontrol/mlxcontrol.8
==============================================================================
--- head/usr.sbin/mlxcontrol/mlxcontrol.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/mlxcontrol/mlxcontrol.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -136,9 +136,10 @@ Print usage information for
 .Ar command .
 .El
 .Sh AUTHORS
-The mlxcontrol utility was written by
-.An Michael Smith
-.Aq msmith@FreeBSD.org .
+The
+.Nm
+utility was written by
+.An Michael Smith Aq Mt msmith@FreeBSD.org .
 .Sh BUGS
 The
 .Ar config

Modified: head/usr.sbin/moused/moused.8
==============================================================================
--- head/usr.sbin/moused/moused.8	Fri Jun 20 09:40:43 2014	(r267667)
+++ head/usr.sbin/moused/moused.8	Fri Jun 20 09:57:27 2014	(r267668)
@@ -819,11 +819,11 @@ utility first appeared in
 The
 .Nm
 utility was written by
-.An Michael Smith Aq msmith@FreeBSD.org .
+.An Michael Smith Aq Mt msmith@FreeBSD.org .
 This manual page was written by
-.An Mike Pritchard Aq mpp@FreeBSD.org .
+.An Mike Pritchard Aq Mt mpp@FreeBSD.org .
 The command and manual page have since been updated by
-.An Kazutaka Yokota Aq yokota@FreeBSD.org .
+.An Kazutaka Yokota Aq Mt yokota@FreeBSD.org .
 .Sh CAVEATS

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 10:34:33 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5D25670E;
 Fri, 20 Jun 2014 10:34:33 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 49E702F40;
 Fri, 20 Jun 2014 10:34:33 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KAYXjQ031008;
 Fri, 20 Jun 2014 10:34:33 GMT (envelope-from bapt@svn.freebsd.org)
Received: (from bapt@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KAYXnc031007;
 Fri, 20 Jun 2014 10:34:33 GMT (envelope-from bapt@svn.freebsd.org)
Message-Id: <201406201034.s5KAYXnc031007@svn.freebsd.org>
From: Baptiste Daroussin 
Date: Fri, 20 Jun 2014 10:34:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267669 - head/usr.sbin/pw
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 10:34:33 -0000

Author: bapt
Date: Fri Jun 20 10:34:32 2014
New Revision: 267669
URL: http://svnweb.freebsd.org/changeset/base/267669

Log:
  Removed compatibility with pre FreeBSD 2.2 pw_mkdb command
  Fix some broken indentattion
  
  PR:		189173
  Submitted by:	fullermd@over-yonder.net
  MFC after:	1 week

Modified:
  head/usr.sbin/pw/pwupd.c

Modified: head/usr.sbin/pw/pwupd.c
==============================================================================
--- head/usr.sbin/pw/pwupd.c	Fri Jun 20 09:57:27 2014	(r267668)
+++ head/usr.sbin/pw/pwupd.c	Fri Jun 20 10:34:32 2014	(r267669)
@@ -45,9 +45,6 @@ static const char rcsid[] =
 
 #include "pwupd.h"
 
-#define HAVE_PWDB_C	1
-#define	HAVE_PWDB_U	1
-
 static char pathpwd[] = _PATH_PWD;
 static char * pwpath = pathpwd;
  
@@ -112,22 +109,14 @@ pw_update(struct passwd * pwd, char cons
 {
 	int             rc = 0;
 
-	/*
-	 * First, let's check the see if the database is alright
-	 * Note: -C is only available in FreeBSD 2.2 and above
-	 */
-#ifdef HAVE_PWDB_C
 	rc = pwdb("-C", (char *)NULL);	/* Check only */
 	if (rc == 0) {
-#else
-	{				/* No -C */
-#endif
 		int pfd, tfd;
 		struct passwd *pw = NULL;
 		struct passwd *old_pw = NULL;
 
-	       	if (pwd != NULL)
-		       pw = pw_dup(pwd);
+		if (pwd != NULL)
+			pw = pw_dup(pwd);
 
 		if (user != NULL)
 			old_pw = GETPWNAM(user);

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 10:38:09 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5C4DD8BF;
 Fri, 20 Jun 2014 10:38:09 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 486792FA0;
 Fri, 20 Jun 2014 10:38:09 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KAc9of031530;
 Fri, 20 Jun 2014 10:38:09 GMT (envelope-from bapt@svn.freebsd.org)
Received: (from bapt@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KAc9T3031529;
 Fri, 20 Jun 2014 10:38:09 GMT (envelope-from bapt@svn.freebsd.org)
Message-Id: <201406201038.s5KAc9T3031529@svn.freebsd.org>
From: Baptiste Daroussin 
Date: Fri, 20 Jun 2014 10:38:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267670 - head/usr.sbin/pw
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 10:38:09 -0000

Author: bapt
Date: Fri Jun 20 10:38:08 2014
New Revision: 267670
URL: http://svnweb.freebsd.org/changeset/base/267670

Log:
  Fix changing the username
  
  PR:		189172
  Submitted by:	fullermd@over-yonder.net
  MFC after:	1 week

Modified:
  head/usr.sbin/pw/pwupd.c

Modified: head/usr.sbin/pw/pwupd.c
==============================================================================
--- head/usr.sbin/pw/pwupd.c	Fri Jun 20 10:34:32 2014	(r267669)
+++ head/usr.sbin/pw/pwupd.c	Fri Jun 20 10:38:08 2014	(r267670)
@@ -139,7 +139,7 @@ pw_update(struct passwd * pwd, char cons
 		 * in case of deletion of a user, the whole database
 		 * needs to be regenerated
 		 */
-		if (pw_mkdb(pw != NULL ? user : NULL) == -1) {
+		if (pw_mkdb(pw != NULL ? pw->pw_name : NULL) == -1) {
 			pw_fini();
 			err(1, "pw_mkdb()");
 		}

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 11:46:43 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4E6304B7;
 Fri, 20 Jun 2014 11:46:43 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2173E274F;
 Fri, 20 Jun 2014 11:46:43 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KBkhSG064789;
 Fri, 20 Jun 2014 11:46:43 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KBkgm3064788;
 Fri, 20 Jun 2014 11:46:42 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201406201146.s5KBkgm3064788@svn.freebsd.org>
From: Gavin Atkinson 
Date: Fri, 20 Jun 2014 11:46:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267671 - head/etc/mtree
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 11:46:43 -0000

Author: gavin
Date: Fri Jun 20 11:46:42 2014
New Revision: 267671
URL: http://svnweb.freebsd.org/changeset/base/267671

Log:
  Stop creating /etc/gnats

Modified:
  head/etc/mtree/BSD.root.dist

Modified: head/etc/mtree/BSD.root.dist
==============================================================================
--- head/etc/mtree/BSD.root.dist	Fri Jun 20 10:38:08 2014	(r267670)
+++ head/etc/mtree/BSD.root.dist	Fri Jun 20 11:46:42 2014	(r267671)
@@ -34,8 +34,6 @@
         ..
         dma
         ..
-        gnats
-        ..
         gss
         ..
         mail

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 11:47:50 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3B955637;
 Fri, 20 Jun 2014 11:47:50 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 28B0E2768;
 Fri, 20 Jun 2014 11:47:50 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KBlomj064969;
 Fri, 20 Jun 2014 11:47:50 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KBloiJ064968;
 Fri, 20 Jun 2014 11:47:50 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201406201147.s5KBloiJ064968@svn.freebsd.org>
From: Gavin Atkinson 
Date: Fri, 20 Jun 2014 11:47:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267672 - head/sys/mips/rmi
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 11:47:50 -0000

Author: gavin
Date: Fri Jun 20 11:47:49 2014
New Revision: 267672
URL: http://svnweb.freebsd.org/changeset/base/267672

Log:
  Remove /etc/gnats from here, too.

Modified:
  head/sys/mips/rmi/rootfs_list.txt

Modified: head/sys/mips/rmi/rootfs_list.txt
==============================================================================
--- head/sys/mips/rmi/rootfs_list.txt	Fri Jun 20 11:46:42 2014	(r267671)
+++ head/sys/mips/rmi/rootfs_list.txt	Fri Jun 20 11:47:49 2014	(r267672)
@@ -64,8 +64,6 @@
 ./etc/defaults/rc.conf
 ./etc/devd
 ./etc/devd/asus.conf
-./etc/gnats
-./etc/gnats/freefall
 ./etc/gss
 ./etc/gss/mech
 ./etc/gss/qop

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 13:13:39 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A7107340;
 Fri, 20 Jun 2014 13:13:39 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 92B6B2042;
 Fri, 20 Jun 2014 13:13:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KDDdji006663;
 Fri, 20 Jun 2014 13:13:39 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KDDc0Q006659;
 Fri, 20 Jun 2014 13:13:38 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201406201313.s5KDDc0Q006659@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 20 Jun 2014 13:13:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267673 - in head: share/man/man4 sys/dev/cpuctl sys/sys
 usr.sbin/cpucontrol
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 13:13:39 -0000

Author: kib
Date: Fri Jun 20 13:13:38 2014
New Revision: 267673
URL: http://svnweb.freebsd.org/changeset/base/267673

Log:
  Restore the ABI of the cpuctl(4) ioctl request CPUCTL_CPUID, use
  separate argument structure with added level_type field for
  CPUID_CPUID_COUNT request.
  
  Reviewed by:	attilio (previous version)
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks

Modified:
  head/share/man/man4/cpuctl.4
  head/sys/dev/cpuctl/cpuctl.c
  head/sys/sys/cpuctl.h
  head/usr.sbin/cpucontrol/cpucontrol.c

Modified: head/share/man/man4/cpuctl.4
==============================================================================
--- head/share/man/man4/cpuctl.4	Fri Jun 20 11:47:49 2014	(r267672)
+++ head/share/man/man4/cpuctl.4	Fri Jun 20 13:13:38 2014	(r267673)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 30, 2009
+.Dd June 20, 2014
 .Dt CPUCTL 4
 .Os
 .Sh NAME
@@ -65,7 +65,7 @@ All of the supported operations are invo
 .Xr ioctl 2
 system call.
 Currently, the following ioctls are defined:
-.Bl -tag -width CPUCTL_UPDATE
+.Bl -tag -width CPUCTL_CPUID_COUNT
 .It Dv CPUCTL_RDMSR Fa cpuctl_msr_args_t *args
 .It Dv CPUCTL_WRMSR Fa cpuctl_msr_args_t *args
 Read/write CPU machine specific register.
@@ -86,29 +86,60 @@ Set/clear MSR bits according to the mask
 .Va data
 field.
 .It Dv CPUCTL_CPUID Fa cpuctl_cpuid_args_t *args
-.It Dv CPUCTL_CPUID_COUNT Fa cpuctl_cpuid_args_t *args
 Retrieve CPUID information.
-Arguments are supplied in
-the following struct:
+Arguments are supplied in the following structure:
 .Bd -literal
 typedef struct {
 	int		level;		/* CPUID level */
-	int		level_type;	/* CPUID level type */
 	uint32_t	data[4];
 } cpuctl_cpuid_args_t;
 .Ed
-.Pp
+It is equivalent to the
+.Dv CPUCTL_CPUID_COUNT
+request with
+.Va level_type
+set to 0.
+.It Dv CPUCTL_CPUID_COUNT Fa cpuctl_cpuid_count_args_t *args
+Retrieve CPUID information.
+Arguments are supplied in the following structure:
+.Bd -literal
+typedef struct {
+	int		level;		/* CPUID level */
+	int		level_type;	/* CPUID level type */
+	uint32_t	data[4];
+} cpuctl_cpuid_count_args_t;
+.Ed
 The
 .Va level
-field indicates the CPUID level to retrieve.
+field indicates the CPUID level to retrieve,
+it is loaded into the
+.Va %eax
+register before the CPUID instruction is executed,
 The
 .Va level_type
-field indicates the CPUID level type to retrieve.
-It is overriden to 0 for
-.Va CPUCTL_CPUID .
-Finally, the
+field indicates the CPUID level type to retrieve,
+it is loaded into the
+.Va %ecx
+register.
+.Pp
+The
 .Va data
 field is used to store the received CPUID data.
+That is,
+.Va data[0]
+contains the value of
+.Va %eax
+register after the CPUID instruction is executed,
+.Va data[1]
+is for
+.Va %ebx ,
+.Va data[2]
+for
+.Va %ecx ,
+and
+.Va data[3]
+for
+.Va %edx .
 .It Dv CPUCTL_UPDATE cpuctl_update_args_t *args
 Update CPU firmware (microcode).
 The structure is defined in

Modified: head/sys/dev/cpuctl/cpuctl.c
==============================================================================
--- head/sys/dev/cpuctl/cpuctl.c	Fri Jun 20 11:47:49 2014	(r267672)
+++ head/sys/dev/cpuctl/cpuctl.c	Fri Jun 20 13:13:38 2014	(r267673)
@@ -69,7 +69,7 @@ static int cpuctl_do_msr(int cpu, cpuctl
     struct thread *td);
 static int cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data,
     struct thread *td);
-static int cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_args_t *data,
+static int cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data,
     struct thread *td);
 static int cpuctl_do_update(int cpu, cpuctl_update_args_t *data,
     struct thread *td);
@@ -180,8 +180,8 @@ cpuctl_ioctl(struct cdev *dev, u_long cm
 		ret = cpuctl_do_update(cpu, (cpuctl_update_args_t *)data, td);
 		break;
 	case CPUCTL_CPUID_COUNT:
-		ret = cpuctl_do_cpuid_count(cpu, (cpuctl_cpuid_args_t *)data,
-		    td);
+		ret = cpuctl_do_cpuid_count(cpu,
+		    (cpuctl_cpuid_count_args_t *)data, td);
 		break;
 	default:
 		ret = EINVAL;
@@ -195,7 +195,8 @@ fail:
  * Actually perform cpuid operation.
  */
 static int
-cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_args_t *data, struct thread *td)
+cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data,
+    struct thread *td)
 {
 	int is_bound = 0;
 	int oldcpu;
@@ -218,10 +219,15 @@ cpuctl_do_cpuid_count(int cpu, cpuctl_cp
 static int
 cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data, struct thread *td)
 {
+	cpuctl_cpuid_count_args_t cdata;
+	int error;
 
+	cdata.level = data->level;
 	/* Override the level type. */
-	data->level_type = 0;
-	return (cpuctl_do_cpuid_count(cpu, data, td));
+	cdata.level_type = 0;
+	error = cpuctl_do_cpuid_count(cpu, &cdata, td);
+	bcopy(cdata.data, data->data, sizeof(data->data)); /* Ignore error */
+	return (error);
 }
 
 /*

Modified: head/sys/sys/cpuctl.h
==============================================================================
--- head/sys/sys/cpuctl.h	Fri Jun 20 11:47:49 2014	(r267672)
+++ head/sys/sys/cpuctl.h	Fri Jun 20 13:13:38 2014	(r267673)
@@ -36,11 +36,16 @@ typedef struct {
 
 typedef struct {
 	int		level;		/* CPUID level */
-	int		level_type;	/* CPUID level type */
 	uint32_t	data[4];
 } cpuctl_cpuid_args_t;
 
 typedef struct {
+	int		level;		/* CPUID level */
+	int		level_type;	/* CPUID level type */
+	uint32_t	data[4];
+} cpuctl_cpuid_count_args_t;
+
+typedef struct {
 	void	*data;
 	size_t	size;
 } cpuctl_update_args_t;
@@ -51,6 +56,6 @@ typedef struct {
 #define	CPUCTL_UPDATE	_IOWR('c', 4, cpuctl_update_args_t)
 #define	CPUCTL_MSRSBIT	_IOWR('c', 5, cpuctl_msr_args_t)
 #define	CPUCTL_MSRCBIT	_IOWR('c', 6, cpuctl_msr_args_t)
-#define	CPUCTL_CPUID_COUNT _IOWR('c', 7, cpuctl_cpuid_args_t)
+#define	CPUCTL_CPUID_COUNT _IOWR('c', 7, cpuctl_cpuid_count_args_t)
 
 #endif /* _CPUCTL_H_ */

Modified: head/usr.sbin/cpucontrol/cpucontrol.c
==============================================================================
--- head/usr.sbin/cpucontrol/cpucontrol.c	Fri Jun 20 11:47:49 2014	(r267672)
+++ head/usr.sbin/cpucontrol/cpucontrol.c	Fri Jun 20 13:13:38 2014	(r267673)
@@ -175,7 +175,7 @@ do_cpuid_count(const char *cmdarg, const
 {
 	char *cmdarg1, *endptr, *endptr1;
 	unsigned int level, level_type;
-	cpuctl_cpuid_args_t args;
+	cpuctl_cpuid_count_args_t args;
 	int fd, error;
 
 	assert(cmdarg != NULL);

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 13:26:51 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5D4FC856;
 Fri, 20 Jun 2014 13:26:51 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 48E9D2150;
 Fri, 20 Jun 2014 13:26:51 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KDQpPY011806;
 Fri, 20 Jun 2014 13:26:51 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KDQorR011800;
 Fri, 20 Jun 2014 13:26:50 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201406201326.s5KDQorR011800@svn.freebsd.org>
From: Michael Tuexen 
Date: Fri, 20 Jun 2014 13:26:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267674 - head/sys/netinet
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 13:26:51 -0000

Author: tuexen
Date: Fri Jun 20 13:26:49 2014
New Revision: 267674
URL: http://svnweb.freebsd.org/changeset/base/267674

Log:
  Honor jails for unbound SCTP sockets when selecting source addresses,
  reporting IP-addresses to the peer during the handshake, adding
  addresses to the host, reporting the addresses via the sysctl
  interface (used by netstat, for example) and reporting the
  addresses to the application via socket options.
  This issue was reported by Bernd Walter.
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_asconf.c
  head/sys/netinet/sctp_output.c
  head/sys/netinet/sctp_pcb.c
  head/sys/netinet/sctp_sysctl.c
  head/sys/netinet/sctp_usrreq.c
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctp_asconf.c
==============================================================================
--- head/sys/netinet/sctp_asconf.c	Fri Jun 20 13:13:38 2014	(r267673)
+++ head/sys/netinet/sctp_asconf.c	Fri Jun 20 13:26:49 2014	(r267674)
@@ -1889,14 +1889,22 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb *
 	 * this is boundall or subset bound w/ASCONF allowed
 	 */
 
-	/* first, make sure it's a good address family */
+	/* first, make sure that the address is IPv4 or IPv6 and not jailed */
 	switch (ifa->address.sa.sa_family) {
 #ifdef INET6
 	case AF_INET6:
+		if (prison_check_ip6(inp->ip_inp.inp.inp_cred,
+		    &ifa->address.sin6.sin6_addr) != 0) {
+			return;
+		}
 		break;
 #endif
 #ifdef INET
 	case AF_INET:
+		if (prison_check_ip4(inp->ip_inp.inp.inp_cred,
+		    &ifa->address.sin.sin_addr) != 0) {
+			return;
+		}
 		break;
 #endif
 	default:
@@ -2122,6 +2130,10 @@ sctp_asconf_iterator_stcb(struct sctp_in
 					/* we skip unspecifed addresses */
 					continue;
 				}
+				if (prison_check_ip6(inp->ip_inp.inp.inp_cred,
+				    &sin6->sin6_addr) != 0) {
+					continue;
+				}
 				if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
 					if (stcb->asoc.scope.local_scope == 0) {
 						continue;
@@ -2152,6 +2164,10 @@ sctp_asconf_iterator_stcb(struct sctp_in
 					/* we skip unspecifed addresses */
 					continue;
 				}
+				if (prison_check_ip4(inp->ip_inp.inp.inp_cred,
+				    &sin->sin_addr) != 0) {
+					continue;
+				}
 				if (stcb->asoc.scope.ipv4_local_scope == 0 &&
 				    IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) {
 					continue;
@@ -2465,6 +2481,10 @@ sctp_find_valid_localaddr(struct sctp_tc
 						/* skip unspecifed addresses */
 						continue;
 					}
+					if (prison_check_ip4(stcb->sctp_ep->ip_inp.inp.inp_cred,
+					    &sin->sin_addr) != 0) {
+						continue;
+					}
 					if (stcb->asoc.scope.ipv4_local_scope == 0 &&
 					    IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))
 						continue;
@@ -2498,6 +2518,10 @@ sctp_find_valid_localaddr(struct sctp_tc
 						 */
 						continue;
 					}
+					if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred,
+					    &sin6->sin6_addr) != 0) {
+						continue;
+					}
 					if (stcb->asoc.scope.local_scope == 0 &&
 					    IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))
 						continue;
@@ -3112,6 +3136,10 @@ sctp_check_address_list_all(struct sctp_
 #ifdef INET
 			case AF_INET:
 				sin = (struct sockaddr_in *)&sctp_ifa->address.sin;
+				if (prison_check_ip4(stcb->sctp_ep->ip_inp.inp.inp_cred,
+				    &sin->sin_addr) != 0) {
+					continue;
+				}
 				if ((ipv4_scope == 0) &&
 				    (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))) {
 					/* private address not in scope */
@@ -3122,6 +3150,10 @@ sctp_check_address_list_all(struct sctp_
 #ifdef INET6
 			case AF_INET6:
 				sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sin6;
+				if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred,
+				    &sin6->sin6_addr) != 0) {
+					continue;
+				}
 				if ((local_scope == 0) &&
 				    (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))) {
 					continue;
@@ -3407,6 +3439,10 @@ sctp_asconf_send_nat_state_update(struct
 #ifdef INET
 				case AF_INET:
 					to = &sctp_ifap->address.sin;
+					if (prison_check_ip4(stcb->sctp_ep->ip_inp.inp.inp_cred,
+					    &to->sin_addr) != 0) {
+						continue;
+					}
 					if (IN4_ISPRIVATE_ADDRESS(&to->sin_addr)) {
 						continue;
 					}
@@ -3418,6 +3454,10 @@ sctp_asconf_send_nat_state_update(struct
 #ifdef INET6
 				case AF_INET6:
 					to6 = &sctp_ifap->address.sin6;
+					if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred,
+					    &to6->sin6_addr) != 0) {
+						continue;
+					}
 					if (IN6_IS_ADDR_LOOPBACK(&to6->sin6_addr)) {
 						continue;
 					}

Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c	Fri Jun 20 13:13:38 2014	(r267673)
+++ head/sys/netinet/sctp_output.c	Fri Jun 20 13:26:49 2014	(r267674)
@@ -2060,6 +2060,20 @@ sctp_add_addresses_to_i_ia(struct sctp_i
 				continue;
 			}
 			LIST_FOREACH(sctp_ifap, &sctp_ifnp->ifalist, next_ifa) {
+#ifdef INET
+				if ((sctp_ifap->address.sa.sa_family == AF_INET) &&
+				    (prison_check_ip4(inp->ip_inp.inp.inp_cred,
+				    &sctp_ifap->address.sin.sin_addr) != 0)) {
+					continue;
+				}
+#endif
+#ifdef INET6
+				if ((sctp_ifap->address.sa.sa_family == AF_INET6) &&
+				    (prison_check_ip6(inp->ip_inp.inp.inp_cred,
+				    &sctp_ifap->address.sin6.sin6_addr) != 0)) {
+					continue;
+				}
+#endif
 				if (sctp_is_addr_restricted(stcb, sctp_ifap)) {
 					continue;
 				}
@@ -2089,6 +2103,20 @@ skip_count:
 					continue;
 				}
 				LIST_FOREACH(sctp_ifap, &sctp_ifnp->ifalist, next_ifa) {
+#ifdef INET
+					if ((sctp_ifap->address.sa.sa_family == AF_INET) &&
+					    (prison_check_ip4(inp->ip_inp.inp.inp_cred,
+					    &sctp_ifap->address.sin.sin_addr) != 0)) {
+						continue;
+					}
+#endif
+#ifdef INET6
+					if ((sctp_ifap->address.sa.sa_family == AF_INET6) &&
+					    (prison_check_ip6(inp->ip_inp.inp.inp_cred,
+					    &sctp_ifap->address.sin6.sin6_addr) != 0)) {
+						continue;
+					}
+#endif
 					if (sctp_is_addr_restricted(stcb, sctp_ifap)) {
 						continue;
 					}
@@ -2453,6 +2481,20 @@ sctp_choose_boundspecific_inp(struct sct
 	if (sctp_ifn) {
 		/* is a preferred one on the interface we route out? */
 		LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) {
+#ifdef INET
+			if ((sctp_ifa->address.sa.sa_family == AF_INET) &&
+			    (prison_check_ip4(inp->ip_inp.inp.inp_cred,
+			    &sctp_ifa->address.sin.sin_addr) != 0)) {
+				continue;
+			}
+#endif
+#ifdef INET6
+			if ((sctp_ifa->address.sa.sa_family == AF_INET6) &&
+			    (prison_check_ip6(inp->ip_inp.inp.inp_cred,
+			    &sctp_ifa->address.sin6.sin6_addr) != 0)) {
+				continue;
+			}
+#endif
 			if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) &&
 			    (non_asoc_addr_ok == 0))
 				continue;
@@ -2576,6 +2618,20 @@ sctp_choose_boundspecific_stcb(struct sc
 	if (sctp_ifn) {
 		/* first try for a preferred address on the ep */
 		LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) {
+#ifdef INET
+			if ((sctp_ifa->address.sa.sa_family == AF_INET) &&
+			    (prison_check_ip4(inp->ip_inp.inp.inp_cred,
+			    &sctp_ifa->address.sin.sin_addr) != 0)) {
+				continue;
+			}
+#endif
+#ifdef INET6
+			if ((sctp_ifa->address.sa.sa_family == AF_INET6) &&
+			    (prison_check_ip6(inp->ip_inp.inp.inp_cred,
+			    &sctp_ifa->address.sin6.sin6_addr) != 0)) {
+				continue;
+			}
+#endif
 			if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && (non_asoc_addr_ok == 0))
 				continue;
 			if (sctp_is_addr_in_ep(inp, sctp_ifa)) {
@@ -2596,6 +2652,20 @@ sctp_choose_boundspecific_stcb(struct sc
 		}
 		/* next try for an acceptable address on the ep */
 		LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) {
+#ifdef INET
+			if ((sctp_ifa->address.sa.sa_family == AF_INET) &&
+			    (prison_check_ip4(inp->ip_inp.inp.inp_cred,
+			    &sctp_ifa->address.sin.sin_addr) != 0)) {
+				continue;
+			}
+#endif
+#ifdef INET6
+			if ((sctp_ifa->address.sa.sa_family == AF_INET6) &&
+			    (prison_check_ip6(inp->ip_inp.inp.inp_cred,
+			    &sctp_ifa->address.sin6.sin6_addr) != 0)) {
+				continue;
+			}
+#endif
 			if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && (non_asoc_addr_ok == 0))
 				continue;
 			if (sctp_is_addr_in_ep(inp, sctp_ifa)) {
@@ -2700,6 +2770,7 @@ sctp_from_the_top2:
 
 static struct sctp_ifa *
 sctp_select_nth_preferred_addr_from_ifn_boundall(struct sctp_ifn *ifn,
+    struct sctp_inpcb *inp,
     struct sctp_tcb *stcb,
     int non_asoc_addr_ok,
     uint8_t dest_is_loop,
@@ -2721,6 +2792,20 @@ sctp_select_nth_preferred_addr_from_ifn_
 	}
 #endif				/* INET6 */
 	LIST_FOREACH(ifa, &ifn->ifalist, next_ifa) {
+#ifdef INET
+		if ((ifa->address.sa.sa_family == AF_INET) &&
+		    (prison_check_ip4(inp->ip_inp.inp.inp_cred,
+		    &ifa->address.sin.sin_addr) != 0)) {
+			continue;
+		}
+#endif
+#ifdef INET6
+		if ((ifa->address.sa.sa_family == AF_INET6) &&
+		    (prison_check_ip6(inp->ip_inp.inp.inp_cred,
+		    &ifa->address.sin6.sin6_addr) != 0)) {
+			continue;
+		}
+#endif
 		if ((ifa->localifa_flags & SCTP_ADDR_DEFER_USE) &&
 		    (non_asoc_addr_ok == 0))
 			continue;
@@ -2806,6 +2891,7 @@ sctp_select_nth_preferred_addr_from_ifn_
 
 static int
 sctp_count_num_preferred_boundall(struct sctp_ifn *ifn,
+    struct sctp_inpcb *inp,
     struct sctp_tcb *stcb,
     int non_asoc_addr_ok,
     uint8_t dest_is_loop,
@@ -2816,6 +2902,21 @@ sctp_count_num_preferred_boundall(struct
 	int num_eligible_addr = 0;
 
 	LIST_FOREACH(ifa, &ifn->ifalist, next_ifa) {
+#ifdef INET
+		if ((ifa->address.sa.sa_family == AF_INET) &&
+		    (prison_check_ip4(inp->ip_inp.inp.inp_cred,
+		    &ifa->address.sin.sin_addr) != 0)) {
+			continue;
+		}
+#endif
+#ifdef INET6
+		if ((ifa->address.sa.sa_family == AF_INET6) &&
+		    (stcb != NULL) &&
+		    (prison_check_ip6(inp->ip_inp.inp.inp_cred,
+		    &ifa->address.sin6.sin6_addr) != 0)) {
+			continue;
+		}
+#endif
 		if ((ifa->localifa_flags & SCTP_ADDR_DEFER_USE) &&
 		    (non_asoc_addr_ok == 0)) {
 			continue;
@@ -2847,7 +2948,8 @@ sctp_count_num_preferred_boundall(struct
 }
 
 static struct sctp_ifa *
-sctp_choose_boundall(struct sctp_tcb *stcb,
+sctp_choose_boundall(struct sctp_inpcb *inp,
+    struct sctp_tcb *stcb,
     struct sctp_nets *net,
     sctp_route_t * ro,
     uint32_t vrf_id,
@@ -2902,7 +3004,7 @@ sctp_choose_boundall(struct sctp_tcb *st
 		cur_addr_num = net->indx_of_eligible_next_to_use;
 	}
 	num_preferred = sctp_count_num_preferred_boundall(sctp_ifn,
-	    stcb,
+	    inp, stcb,
 	    non_asoc_addr_ok,
 	    dest_is_loop,
 	    dest_is_priv, fam);
@@ -2929,7 +3031,7 @@ sctp_choose_boundall(struct sctp_tcb *st
 	 */
 	SCTPDBG(SCTP_DEBUG_OUTPUT2, "cur_addr_num:%d\n", cur_addr_num);
 
-	sctp_ifa = sctp_select_nth_preferred_addr_from_ifn_boundall(sctp_ifn, stcb, non_asoc_addr_ok, dest_is_loop,
+	sctp_ifa = sctp_select_nth_preferred_addr_from_ifn_boundall(sctp_ifn, inp, stcb, non_asoc_addr_ok, dest_is_loop,
 	    dest_is_priv, cur_addr_num, fam, ro);
 
 	/* if sctp_ifa is NULL something changed??, fall to plan b. */
@@ -2960,7 +3062,7 @@ bound_all_plan_b:
 			SCTPDBG(SCTP_DEBUG_OUTPUT2, "already seen\n");
 			continue;
 		}
-		num_preferred = sctp_count_num_preferred_boundall(sctp_ifn, stcb, non_asoc_addr_ok,
+		num_preferred = sctp_count_num_preferred_boundall(sctp_ifn, inp, stcb, non_asoc_addr_ok,
 		    dest_is_loop, dest_is_priv, fam);
 		SCTPDBG(SCTP_DEBUG_OUTPUT2,
 		    "Found ifn:%p %d preferred source addresses\n",
@@ -2982,7 +3084,7 @@ bound_all_plan_b:
 		if (cur_addr_num >= num_preferred) {
 			cur_addr_num = 0;
 		}
-		sifa = sctp_select_nth_preferred_addr_from_ifn_boundall(sctp_ifn, stcb, non_asoc_addr_ok, dest_is_loop,
+		sifa = sctp_select_nth_preferred_addr_from_ifn_boundall(sctp_ifn, inp, stcb, non_asoc_addr_ok, dest_is_loop,
 		    dest_is_priv, cur_addr_num, fam, ro);
 		if (sifa == NULL)
 			continue;
@@ -3010,6 +3112,22 @@ again_with_private_addresses_allowed:
 	}
 	LIST_FOREACH(sctp_ifa, &emit_ifn->ifalist, next_ifa) {
 		SCTPDBG(SCTP_DEBUG_OUTPUT2, "ifa:%p\n", (void *)sctp_ifa);
+#ifdef INET
+		if ((sctp_ifa->address.sa.sa_family == AF_INET) &&
+		    (prison_check_ip4(inp->ip_inp.inp.inp_cred,
+		    &sctp_ifa->address.sin.sin_addr) != 0)) {
+			SCTPDBG(SCTP_DEBUG_OUTPUT2, "Jailed\n");
+			continue;
+		}
+#endif
+#ifdef INET6
+		if ((sctp_ifa->address.sa.sa_family == AF_INET6) &&
+		    (prison_check_ip6(inp->ip_inp.inp.inp_cred,
+		    &sctp_ifa->address.sin6.sin6_addr) != 0)) {
+			SCTPDBG(SCTP_DEBUG_OUTPUT2, "Jailed\n");
+			continue;
+		}
+#endif
 		if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) &&
 		    (non_asoc_addr_ok == 0)) {
 			SCTPDBG(SCTP_DEBUG_OUTPUT2, "Defer\n");
@@ -3060,6 +3178,20 @@ plan_d:
 			continue;
 		}
 		LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) {
+#ifdef INET
+			if ((sctp_ifa->address.sa.sa_family == AF_INET) &&
+			    (prison_check_ip4(inp->ip_inp.inp.inp_cred,
+			    &sctp_ifa->address.sin.sin_addr) != 0)) {
+				continue;
+			}
+#endif
+#ifdef INET6
+			if ((sctp_ifa->address.sa.sa_family == AF_INET6) &&
+			    (prison_check_ip6(inp->ip_inp.inp.inp_cred,
+			    &sctp_ifa->address.sin6.sin6_addr) != 0)) {
+				continue;
+			}
+#endif
 			if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) &&
 			    (non_asoc_addr_ok == 0))
 				continue;
@@ -3110,6 +3242,20 @@ out:
 				LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) {
 					struct sctp_ifa *tmp_sifa;
 
+#ifdef INET
+					if ((sctp_ifa->address.sa.sa_family == AF_INET) &&
+					    (prison_check_ip4(inp->ip_inp.inp.inp_cred,
+					    &sctp_ifa->address.sin.sin_addr) != 0)) {
+						continue;
+					}
+#endif
+#ifdef INET6
+					if ((sctp_ifa->address.sa.sa_family == AF_INET6) &&
+					    (prison_check_ip6(inp->ip_inp.inp.inp_cred,
+					    &sctp_ifa->address.sin6.sin6_addr) != 0)) {
+						continue;
+					}
+#endif
 					if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) &&
 					    (non_asoc_addr_ok == 0))
 						continue;
@@ -3295,7 +3441,7 @@ sctp_source_address_selection(struct sct
 		/*
 		 * Bound all case
 		 */
-		answer = sctp_choose_boundall(stcb, net, ro, vrf_id,
+		answer = sctp_choose_boundall(inp, stcb, net, ro, vrf_id,
 		    dest_is_priv, dest_is_loop,
 		    non_asoc_addr_ok, fam);
 		SCTP_IPI_ADDR_RUNLOCK();

Modified: head/sys/netinet/sctp_pcb.c
==============================================================================
--- head/sys/netinet/sctp_pcb.c	Fri Jun 20 13:13:38 2014	(r267673)
+++ head/sys/netinet/sctp_pcb.c	Fri Jun 20 13:26:49 2014	(r267674)
@@ -898,6 +898,10 @@ sctp_does_stcb_own_this_addr(struct sctp
 						    IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) {
 							continue;
 						}
+						if (prison_check_ip4(stcb->sctp_ep->ip_inp.inp.inp_cred,
+						    &sin->sin_addr) != 0) {
+							continue;
+						}
 						if (sin->sin_addr.s_addr == rsin->sin_addr.s_addr) {
 							SCTP_IPI_ADDR_RUNLOCK();
 							return (1);
@@ -913,6 +917,10 @@ sctp_does_stcb_own_this_addr(struct sctp
 
 						sin6 = &sctp_ifa->address.sin6;
 						rsin6 = (struct sockaddr_in6 *)to;
+						if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred,
+						    &sin6->sin6_addr) != 0) {
+							continue;
+						}
 						if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
 							if (local_scope == 0)
 								continue;
@@ -1060,6 +1068,39 @@ sctp_tcb_special_locate(struct sctp_inpc
 			SCTP_INP_RUNLOCK(inp);
 			continue;
 		}
+		switch (to->sa_family) {
+#ifdef INET
+		case AF_INET:
+			{
+				struct sockaddr_in *sin;
+
+				sin = (struct sockaddr_in *)to;
+				if (prison_check_ip4(inp->ip_inp.inp.inp_cred,
+				    &sin->sin_addr) != 0) {
+					SCTP_INP_RUNLOCK(inp);
+					continue;
+				}
+				break;
+			}
+#endif
+#ifdef INET6
+		case AF_INET6:
+			{
+				struct sockaddr_in6 *sin6;
+
+				sin6 = (struct sockaddr_in6 *)to;
+				if (prison_check_ip6(inp->ip_inp.inp.inp_cred,
+				    &sin6->sin6_addr) != 0) {
+					SCTP_INP_RUNLOCK(inp);
+					continue;
+				}
+				break;
+			}
+#endif
+		default:
+			SCTP_INP_RUNLOCK(inp);
+			continue;
+		}
 		if (inp->def_vrf_id != vrf_id) {
 			SCTP_INP_RUNLOCK(inp);
 			continue;
@@ -1628,23 +1669,45 @@ sctp_endpoint_probe(struct sockaddr *nam
 		if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) &&
 		    (inp->sctp_lport == lport)) {
 			/* got it */
+			switch (nam->sa_family) {
 #ifdef INET
-			if ((nam->sa_family == AF_INET) &&
-			    (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) &&
-			    SCTP_IPV6_V6ONLY(inp)) {
-				/* IPv4 on a IPv6 socket with ONLY IPv6 set */
-				SCTP_INP_RUNLOCK(inp);
-				continue;
-			}
+			case AF_INET:
+				if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) &&
+				    SCTP_IPV6_V6ONLY(inp)) {
+					/*
+					 * IPv4 on a IPv6 socket with ONLY
+					 * IPv6 set
+					 */
+					SCTP_INP_RUNLOCK(inp);
+					continue;
+				}
+				if (prison_check_ip4(inp->ip_inp.inp.inp_cred,
+				    &sin->sin_addr) != 0) {
+					SCTP_INP_RUNLOCK(inp);
+					continue;
+				}
+				break;
 #endif
 #ifdef INET6
-			/* A V6 address and the endpoint is NOT bound V6 */
-			if (nam->sa_family == AF_INET6 &&
-			    (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) {
-				SCTP_INP_RUNLOCK(inp);
-				continue;
-			}
+			case AF_INET6:
+				/*
+				 * A V6 address and the endpoint is NOT
+				 * bound V6
+				 */
+				if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) {
+					SCTP_INP_RUNLOCK(inp);
+					continue;
+				}
+				if (prison_check_ip6(inp->ip_inp.inp.inp_cred,
+				    &sin6->sin6_addr) != 0) {
+					SCTP_INP_RUNLOCK(inp);
+					continue;
+				}
+				break;
 #endif
+			default:
+				break;
+			}
 			/* does a VRF id match? */
 			fnd = 0;
 			if (inp->def_vrf_id == vrf_id)
@@ -2403,6 +2466,7 @@ sctp_inpcb_alloc(struct socket *so, uint
 	/* setup socket pointers */
 	inp->sctp_socket = so;
 	inp->ip_inp.inp.inp_socket = so;
+	inp->ip_inp.inp.inp_cred = crhold(so->so_cred);
 #ifdef INET6
 	if (INP_SOCKAF(so) == AF_INET6) {
 		if (MODULE_GLOBAL(ip6_auto_flowlabel)) {
@@ -2421,6 +2485,7 @@ sctp_inpcb_alloc(struct socket *so, uint
 	/* init the small hash table we use to track asocid <-> tcb */
 	inp->sctp_asocidhash = SCTP_HASH_INIT(SCTP_STACK_VTAG_HASH_SIZE, &inp->hashasocidmark);
 	if (inp->sctp_asocidhash == NULL) {
+		crfree(inp->ip_inp.inp.inp_cred);
 		SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp);
 		SCTP_INP_INFO_WUNLOCK();
 		return (ENOBUFS);
@@ -2435,6 +2500,7 @@ sctp_inpcb_alloc(struct socket *so, uint
 		((struct in6pcb *)(&inp->ip_inp.inp))->in6p_sp = pcb_sp;
 	}
 	if (error != 0) {
+		crfree(inp->ip_inp.inp.inp_cred);
 		SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp);
 		SCTP_INP_INFO_WUNLOCK();
 		return error;
@@ -2465,6 +2531,7 @@ sctp_inpcb_alloc(struct socket *so, uint
 		 */
 		SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EOPNOTSUPP);
 		so->so_pcb = NULL;
+		crfree(inp->ip_inp.inp.inp_cred);
 		SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp);
 		return (EOPNOTSUPP);
 	}
@@ -2484,6 +2551,7 @@ sctp_inpcb_alloc(struct socket *so, uint
 		SCTP_PRINTF("Out of SCTP-INPCB->hashinit - no resources\n");
 		SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, ENOBUFS);
 		so->so_pcb = NULL;
+		crfree(inp->ip_inp.inp.inp_cred);
 		SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp);
 		return (ENOBUFS);
 	}
@@ -3630,6 +3698,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, 
 		inp->sctp_tcbhash = NULL;
 	}
 	/* Now we must put the ep memory back into the zone pool */
+	crfree(inp->ip_inp.inp.inp_cred);
 	INP_LOCK_DESTROY(&inp->ip_inp.inp);
 	SCTP_INP_LOCK_DESTROY(inp);
 	SCTP_INP_READ_DESTROY(inp);

Modified: head/sys/netinet/sctp_sysctl.c
==============================================================================
--- head/sys/netinet/sctp_sysctl.c	Fri Jun 20 13:13:38 2014	(r267673)
+++ head/sys/netinet/sctp_sysctl.c	Fri Jun 20 13:26:49 2014	(r267674)
@@ -252,6 +252,10 @@ copy_out_local_addresses(struct sctp_inp
 						sin = (struct sockaddr_in *)&sctp_ifa->address.sa;
 						if (sin->sin_addr.s_addr == 0)
 							continue;
+						if (prison_check_ip4(inp->ip_inp.inp.inp_cred,
+						    &sin->sin_addr) != 0) {
+							continue;
+						}
 						if ((ipv4_local_scope == 0) && (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)))
 							continue;
 					} else {
@@ -267,6 +271,10 @@ copy_out_local_addresses(struct sctp_inp
 						sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sa;
 						if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr))
 							continue;
+						if (prison_check_ip6(inp->ip_inp.inp.inp_cred,
+						    &sin6->sin6_addr) != 0) {
+							continue;
+						}
 						if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
 							if (local_scope == 0)
 								continue;

Modified: head/sys/netinet/sctp_usrreq.c
==============================================================================
--- head/sys/netinet/sctp_usrreq.c	Fri Jun 20 13:13:38 2014	(r267673)
+++ head/sys/netinet/sctp_usrreq.c	Fri Jun 20 13:26:49 2014	(r267674)
@@ -1197,6 +1197,10 @@ sctp_fill_up_addresses_vrf(struct sctp_i
 							 */
 							continue;
 						}
+						if (prison_check_ip4(inp->ip_inp.inp.inp_cred,
+						    &sin->sin_addr) != 0) {
+							continue;
+						}
 						if ((ipv4_local_scope == 0) &&
 						    (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))) {
 							continue;
@@ -1238,6 +1242,10 @@ sctp_fill_up_addresses_vrf(struct sctp_i
 							 */
 							continue;
 						}
+						if (prison_check_ip6(inp->ip_inp.inp.inp_cred,
+						    &sin6->sin6_addr) != 0) {
+							continue;
+						}
 						if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
 							if (local_scope == 0)
 								continue;
@@ -5239,6 +5247,43 @@ sctp_setopt(struct socket *so, int optna
 						error = EINVAL;
 						goto out_of_it;
 					}
+				} else {
+					switch (sspp->sspp_addr.ss_family) {
+#ifdef INET
+					case AF_INET:
+						{
+							struct sockaddr_in *sin;
+
+							sin = (struct sockaddr_in *)&sspp->sspp_addr;
+							if (prison_check_ip4(inp->ip_inp.inp.inp_cred,
+							    &sin->sin_addr) != 0) {
+								SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+								error = EINVAL;
+								goto out_of_it;
+							}
+							break;
+						}
+#endif
+#ifdef INET6
+					case AF_INET6:
+						{
+							struct sockaddr_in6 *sin6;
+
+							sin6 = (struct sockaddr_in6 *)&sspp->sspp_addr;
+							if (prison_check_ip6(inp->ip_inp.inp.inp_cred,
+							    &sin6->sin6_addr) != 0) {
+								SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+								error = EINVAL;
+								goto out_of_it;
+							}
+							break;
+						}
+#endif
+					default:
+						SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+						error = EINVAL;
+						goto out_of_it;
+					}
 				}
 				if (sctp_set_primary_ip_address_sa(stcb,
 				    (struct sockaddr *)&sspp->sspp_addr) != 0) {

Modified: head/sys/netinet/sctputil.c
==============================================================================
--- head/sys/netinet/sctputil.c	Fri Jun 20 13:13:38 2014	(r267673)
+++ head/sys/netinet/sctputil.c	Fri Jun 20 13:26:49 2014	(r267674)
@@ -6693,6 +6693,10 @@ sctp_local_addr_count(struct sctp_tcb *s
 							 */
 							continue;
 						}
+						if (prison_check_ip4(stcb->sctp_ep->ip_inp.inp.inp_cred,
+						    &sin->sin_addr) != 0) {
+							continue;
+						}
 						if ((ipv4_local_scope == 0) &&
 						    (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))) {
 							continue;
@@ -6713,6 +6717,10 @@ sctp_local_addr_count(struct sctp_tcb *s
 						if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
 							continue;
 						}
+						if (prison_check_ip6(stcb->sctp_ep->ip_inp.inp.inp_cred,
+						    &sin6->sin6_addr) != 0) {
+							continue;
+						}
 						if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
 							if (local_scope == 0)
 								continue;

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 14:41:32 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E64DA815;
 Fri, 20 Jun 2014 14:41:31 +0000 (UTC)
Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "vps1.elischer.org",
 Issuer "CA Cert Signing Authority" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id AF10B285E;
 Fri, 20 Jun 2014 14:41:31 +0000 (UTC)
Received: from Julian-MBP3.local (etroy.elischer.org [121.45.232.70])
 (authenticated bits=0)
 by vps1.elischer.org (8.14.8/8.14.8) with ESMTP id s5KEfNvL079686
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO);
 Fri, 20 Jun 2014 07:41:27 -0700 (PDT)
 (envelope-from julian@freebsd.org)
Message-ID: <53A4480D.2040803@freebsd.org>
Date: Fri, 20 Jun 2014 22:41:17 +0800
From: Julian Elischer 
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: attilio@FreeBSD.org, Konstantin Belousov 
Subject: Re: svn commit: r267651 - in head: share/man/man4 sys/dev/cpuctl
 sys/sys usr.sbin/cpucontrol
References: <201406192154.s5JLsfed074305@svn.freebsd.org>	<20140620040801.GA3991@kib.kiev.ua>
 
In-Reply-To: 
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 14:41:32 -0000

On 6/20/14, 2:12 PM, Attilio Rao wrote:
> On Fri, Jun 20, 2014 at 6:08 AM, Konstantin Belousov
>  wrote:
>> On Thu, Jun 19, 2014 at 09:54:41PM +0000, Attilio Rao wrote:
>>> Author: attilio
>>> Date: Thu Jun 19 21:54:41 2014
>>> New Revision: 267651
>>> URL: http://svnweb.freebsd.org/changeset/base/267651
>>>
>>> Log:
>>>    Following comments in r242565 add the possibility to specify ecx when
>>>    performing cpuid calls.
>>>    Add also a new way to specify the level type to cpucontrol(8) as
>>>    reported in the manpage.
>>>
>>>    Sponsored by:       EMC / Isilon storage division
>>>    Reviewed by:        bdrewery, gcooper
>>>    Testerd by: bdrewery
>>> Modified: head/sys/sys/cpuctl.h
>>> ==============================================================================
>>> --- head/sys/sys/cpuctl.h     Thu Jun 19 21:05:07 2014        (r267650)
>>> +++ head/sys/sys/cpuctl.h     Thu Jun 19 21:54:41 2014        (r267651)
>>> @@ -35,7 +35,8 @@ typedef struct {
>>>   } cpuctl_msr_args_t;
>>>
>>>   typedef struct {
>>> -     int             level;  /* CPUID level */
>>> +     int             level;          /* CPUID level */
>>> +     int             level_type;     /* CPUID level type */
>>>        uint32_t        data[4];
>>>   } cpuctl_cpuid_args_t;
>>>
>>> @@ -50,5 +51,6 @@ typedef struct {
>>>   #define      CPUCTL_UPDATE   _IOWR('c', 4, cpuctl_update_args_t)
>>>   #define      CPUCTL_MSRSBIT  _IOWR('c', 5, cpuctl_msr_args_t)
>>>   #define      CPUCTL_MSRCBIT  _IOWR('c', 6, cpuctl_msr_args_t)
>>> +#define      CPUCTL_CPUID_COUNT _IOWR('c', 7, cpuctl_cpuid_args_t)
>>>
>>>   #endif /* _CPUCTL_H_ */
>> The cpuctl(4) is used by third-party code, and this change breaks its
>> ABI. The numeric value for CPUCTL_CPUID is changed, which means that
>> old binaries call non-existing ioctl now. This is at least a visible
>> breakage, since the argument for the ioctl changed the layout as well.
>>
>> The following patch restored the CPUCTL_CPUID for me.  I considered
>> naming its argument differently, instead of renaming the argument
>> of CPUCTL_CPUID_COUNT (which you tried to do ?), but decided not,
>> to preserve the API as well.
> No, breaking the ABI is fine for -CURRENT so I don't see why we need the bloat.
> I don't plan on MFC this patch. If I need to (or any user requests
> that) I will do with the appropriate ABI-compliant way (ie. adding a
> new argument like this one).
breaking the ABI is not  fine.
we have backwards compatibility. If you break a user facing ABI you 
need to have a compatibility plan.  A newer kernel should always do 
its best to run old binaries.


>
> Attilio
>
>


From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 14:45:47 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5EF95984;
 Fri, 20 Jun 2014 14:45:47 +0000 (UTC)
Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "vps1.elischer.org",
 Issuer "CA Cert Signing Authority" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 381DE2878;
 Fri, 20 Jun 2014 14:45:46 +0000 (UTC)
Received: from Julian-MBP3.local (etroy.elischer.org [121.45.232.70])
 (authenticated bits=0)
 by vps1.elischer.org (8.14.8/8.14.8) with ESMTP id s5KEjdaU079707
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO);
 Fri, 20 Jun 2014 07:45:44 -0700 (PDT)
 (envelope-from julian@freebsd.org)
Message-ID: <53A4490E.6070107@freebsd.org>
Date: Fri, 20 Jun 2014 22:45:34 +0800
From: Julian Elischer 
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Konstantin Belousov ,
 Attilio Rao 
Subject: Re: svn commit: r267651 - in head: share/man/man4 sys/dev/cpuctl
 sys/sys usr.sbin/cpucontrol
References: <201406192154.s5JLsfed074305@svn.freebsd.org>
 <20140620040801.GA3991@kib.kiev.ua>
 
 <20140620074939.GE3991@kib.kiev.ua>
In-Reply-To: <20140620074939.GE3991@kib.kiev.ua>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 14:45:47 -0000

On 6/20/14, 3:49 PM, Konstantin Belousov wrote:
> On Fri, Jun 20, 2014 at 08:12:59AM +0200, Attilio Rao wrote:
>> On Fri, Jun 20, 2014 at 6:08 AM, Konstantin Belousov
>>  wrote:
>>> On Thu, Jun 19, 2014 at 09:54:41PM +0000, Attilio Rao wrote:
>>>> Author: attilio
>>>> Date: Thu Jun 19 21:54:41 2014
>>>> New Revision: 267651
>>>> URL: http://svnweb.freebsd.org/changeset/base/267651
>>>>
>>>> Log:
>>>>    Following comments in r242565 add the possibility to specify ecx when
>>>>    performing cpuid calls.
>>>>    Add also a new way to specify the level type to cpucontrol(8) as
>>>>    reported in the manpage.
>>>>
>>>>    Sponsored by:       EMC / Isilon storage division
>>>>    Reviewed by:        bdrewery, gcooper
>>>>    Testerd by: bdrewery
>>>> Modified: head/sys/sys/cpuctl.h
>>>> ==============================================================================
>>>> --- head/sys/sys/cpuctl.h     Thu Jun 19 21:05:07 2014        (r267650)
>>>> +++ head/sys/sys/cpuctl.h     Thu Jun 19 21:54:41 2014        (r267651)
>>>> @@ -35,7 +35,8 @@ typedef struct {
>>>>   } cpuctl_msr_args_t;
>>>>
>>>>   typedef struct {
>>>> -     int             level;  /* CPUID level */
>>>> +     int             level;          /* CPUID level */
>>>> +     int             level_type;     /* CPUID level type */
>>>>        uint32_t        data[4];
>>>>   } cpuctl_cpuid_args_t;
>>>>
>>>> @@ -50,5 +51,6 @@ typedef struct {
>>>>   #define      CPUCTL_UPDATE   _IOWR('c', 4, cpuctl_update_args_t)
>>>>   #define      CPUCTL_MSRSBIT  _IOWR('c', 5, cpuctl_msr_args_t)
>>>>   #define      CPUCTL_MSRCBIT  _IOWR('c', 6, cpuctl_msr_args_t)
>>>> +#define      CPUCTL_CPUID_COUNT _IOWR('c', 7, cpuctl_cpuid_args_t)
>>>>
>>>>   #endif /* _CPUCTL_H_ */
>>> The cpuctl(4) is used by third-party code, and this change breaks its
>>> ABI. The numeric value for CPUCTL_CPUID is changed, which means that
>>> old binaries call non-existing ioctl now. This is at least a visible
>>> breakage, since the argument for the ioctl changed the layout as well.
>>>
>>> The following patch restored the CPUCTL_CPUID for me.  I considered
>>> naming its argument differently, instead of renaming the argument
>>> of CPUCTL_CPUID_COUNT (which you tried to do ?), but decided not,
>>> to preserve the API as well.
>> No, breaking the ABI is fine for -CURRENT so I don't see why we need the bloat.
> No, breaking ABI is not fine at all, be it CURRENT or not. We try to
> keep the ABI stable, doing costly measures like symbol versioning, where
> applicable. Since this is a change to ABI for kernel interface, it
> cannot be covered by symver tricks and must be done in kernel.
>
>> I don't plan on MFC this patch. If I need to (or any user requests
>> that) I will do with the appropriate ABI-compliant way (ie. adding a
>> new argument like this one).
> Besides the same-world ABI issue, people run jails with lower world
> version on higher-versioned kernels.
exactly.. breaking this would be a big departure from our normal 
procedure.
The basic question to ask yourself is
can I run a FreeBSD 4.4 jail with this?
For kmods it's probably a little less strict..
I'd like it to be "Can I still load a FreeBSD 7 kernel module" but I 
doubt we've been that careful.




From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 15:29:10 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6F3B01FC;
 Fri, 20 Jun 2014 15:29:10 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 427C22C9A;
 Fri, 20 Jun 2014 15:29:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KFTAq0068039;
 Fri, 20 Jun 2014 15:29:10 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KFTAEB068038;
 Fri, 20 Jun 2014 15:29:10 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201406201529.s5KFTAEB068038@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Fri, 20 Jun 2014 15:29:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267675 - head/lib/libc/regex
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 15:29:10 -0000

Author: pfg
Date: Fri Jun 20 15:29:09 2014
New Revision: 267675
URL: http://svnweb.freebsd.org/changeset/base/267675

Log:
  regex: Make use of reallocf().
  
  Use of reallocf is useful in libraries as we are not certain the
  application will exit after NULL.
  
  This somewhat reduces portability but if since you are building
  this as part of libc it is likely you have our non-standard
  reallocf(3) already.
  
  Reviewed by:	ache
  MFC after:	5 days

Modified:
  head/lib/libc/regex/regcomp.c

Modified: head/lib/libc/regex/regcomp.c
==============================================================================
--- head/lib/libc/regex/regcomp.c	Fri Jun 20 13:26:49 2014	(r267674)
+++ head/lib/libc/regex/regcomp.c	Fri Jun 20 15:29:09 2014	(r267675)
@@ -1111,7 +1111,7 @@ allocset(struct parse *p)
 {
 	cset *cs, *ncs;
 
-	ncs = realloc(p->g->sets, (p->g->ncsets + 1) * sizeof(*ncs));
+	ncs = reallocf(p->g->sets, (p->g->ncsets + 1) * sizeof(*ncs));
 	if (ncs == NULL) {
 		SETERROR(REG_ESPACE);
 		return (NULL);
@@ -1174,7 +1174,7 @@ CHadd(struct parse *p, cset *cs, wint_t 
 	if (ch < NC)
 		cs->bmp[ch >> 3] |= 1 << (ch & 7);
 	else {
-		newwides = realloc(cs->wides, (cs->nwides + 1) *
+		newwides = reallocf(cs->wides, (cs->nwides + 1) *
 		    sizeof(*cs->wides));
 		if (newwides == NULL) {
 			SETERROR(REG_ESPACE);
@@ -1203,7 +1203,7 @@ CHaddrange(struct parse *p, cset *cs, wi
 		CHadd(p, cs, min);
 	if (min >= max)
 		return;
-	newranges = realloc(cs->ranges, (cs->nranges + 1) *
+	newranges = reallocf(cs->ranges, (cs->nranges + 1) *
 	    sizeof(*cs->ranges));
 	if (newranges == NULL) {
 		SETERROR(REG_ESPACE);
@@ -1227,7 +1227,7 @@ CHaddtype(struct parse *p, cset *cs, wct
 	for (i = 0; i < NC; i++)
 		if (iswctype(i, wct))
 			CHadd(p, cs, i);
-	newtypes = realloc(cs->types, (cs->ntypes + 1) *
+	newtypes = reallocf(cs->types, (cs->ntypes + 1) *
 	    sizeof(*cs->types));
 	if (newtypes == NULL) {
 		SETERROR(REG_ESPACE);
@@ -1350,7 +1350,7 @@ enlarge(struct parse *p, sopno size)
 	if (p->ssize >= size)
 		return 1;
 
-	sp = (sop *)realloc(p->strip, size*sizeof(sop));
+	sp = (sop *)reallocf(p->strip, size*sizeof(sop));
 	if (sp == NULL) {
 		SETERROR(REG_ESPACE);
 		return 0;
@@ -1368,7 +1368,7 @@ static void
 stripsnug(struct parse *p, struct re_guts *g)
 {
 	g->nstates = p->slen;
-	g->strip = (sop *)realloc((char *)p->strip, p->slen * sizeof(sop));
+	g->strip = (sop *)reallocf((char *)p->strip, p->slen * sizeof(sop));
 	if (g->strip == NULL) {
 		SETERROR(REG_ESPACE);
 		g->strip = p->strip;

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 17:08:33 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6EFC0E60;
 Fri, 20 Jun 2014 17:08:33 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5A97925D5;
 Fri, 20 Jun 2014 17:08:33 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KH8XlO017034;
 Fri, 20 Jun 2014 17:08:33 GMT
 (envelope-from jonathan@svn.freebsd.org)
Received: (from jonathan@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KH8WVP017030;
 Fri, 20 Jun 2014 17:08:32 GMT
 (envelope-from jonathan@svn.freebsd.org)
Message-Id: <201406201708.s5KH8WVP017030@svn.freebsd.org>
From: Jonathan Anderson 
Date: Fri, 20 Jun 2014 17:08:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267678 - head/libexec/rtld-elf
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 17:08:33 -0000

Author: jonathan
Date: Fri Jun 20 17:08:32 2014
New Revision: 267678
URL: http://svnweb.freebsd.org/changeset/base/267678

Log:
  Add the LD_LIBRARY_PATH_FDS environmental variable.
  
  This variable allows the loading of shared libraries via directory descriptors
  rather than via library paths.  If LD_LIBRARY_PATH_FDS=3:4:12, the directories
  represented by file descriptors 3, 4 and 12 will searched for shared libraries
  before the normal path-based mechanisms are used.  This allows us to execute
  unprivileged binaries from within a Capsicum sandbox even if they require
  shared libraries.
  
  Approved by:	rwatson (mentor)
  Reviewed by:	kib
  MFC after:	3 weeks
  Sponsored by:	DARPA/AFRL

Modified:
  head/libexec/rtld-elf/rtld.1
  head/libexec/rtld-elf/rtld.c
  head/libexec/rtld-elf/rtld_printf.c
  head/libexec/rtld-elf/rtld_printf.h

Modified: head/libexec/rtld-elf/rtld.1
==============================================================================
--- head/libexec/rtld-elf/rtld.1	Fri Jun 20 15:43:58 2014	(r267677)
+++ head/libexec/rtld-elf/rtld.1	Fri Jun 20 17:08:32 2014	(r267678)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 28, 2012
+.Dd June 20, 2014
 .Dt RTLD 1
 .Os
 .Sh NAME
@@ -192,6 +192,13 @@ the directories specified by
 will be searched first
 followed by the set of built-in standard directories.
 This variable is unset for set-user-ID and set-group-ID programs.
+.Ev LD_LIBRARY_PATH_FDS
+A colon separated list of file descriptor numbers for library directories.
+This is intended for use within
+.Xr capsicum 4
+sandboxes, when global namespaces such as the filesystem are unavailable.
+It is consulted just after LD_LIBRARY_PATH.
+This variable is unset for set-user-ID and set-group-ID programs.
 .It Ev LD_BIND_NOW
 When set to a nonempty string, causes
 .Nm
@@ -283,6 +290,7 @@ The libmap configuration file for 32-bit
 .Sh SEE ALSO
 .Xr ld 1 ,
 .Xr ldd 1 ,
+.Xr capsicum 4 ,
 .Xr elf 5 ,
 .Xr libmap.conf 5 ,
 .Xr ldconfig 8

Modified: head/libexec/rtld-elf/rtld.c
==============================================================================
--- head/libexec/rtld-elf/rtld.c	Fri Jun 20 15:43:58 2014	(r267677)
+++ head/libexec/rtld-elf/rtld.c	Fri Jun 20 17:08:32 2014	(r267678)
@@ -94,7 +94,7 @@ static bool donelist_check(DoneList *, c
 static void errmsg_restore(char *);
 static char *errmsg_save(void);
 static void *fill_search_info(const char *, size_t, void *);
-static char *find_library(const char *, const Obj_Entry *);
+static char *find_library(const char *, const Obj_Entry *, int *);
 static const char *gethints(bool);
 static void init_dag(Obj_Entry *);
 static void init_pagesizes(Elf_Auxinfo **aux_info);
@@ -119,6 +119,7 @@ static void objlist_push_head(Objlist *,
 static void objlist_push_tail(Objlist *, Obj_Entry *);
 static void objlist_put_after(Objlist *, Obj_Entry *, Obj_Entry *);
 static void objlist_remove(Objlist *, Obj_Entry *);
+static int parse_libdir(const char *);
 static void *path_enumerate(const char *, path_enum_proc, void *);
 static int relocate_object_dag(Obj_Entry *root, bool bind_now,
     Obj_Entry *rtldobj, int flags, RtldLockState *lockstate);
@@ -133,6 +134,7 @@ static int rtld_dirname_abs(const char *
 static void *rtld_dlopen(const char *name, int fd, int mode);
 static void rtld_exit(void);
 static char *search_library_path(const char *, const char *);
+static char *search_library_pathfds(const char *, const char *, int *);
 static const void **get_program_var_addr(const char *, RtldLockState *);
 static void set_program_var(const char *, const void *);
 static int symlook_default(SymLook *, const Obj_Entry *refobj);
@@ -178,6 +180,7 @@ static bool dangerous_ld_env;	/* True if
 static char *ld_bind_now;	/* Environment variable for immediate binding */
 static char *ld_debug;		/* Environment variable for debugging */
 static char *ld_library_path;	/* Environment variable for search path */
+static char *ld_library_dirs;	/* Environment variable for library descriptors */
 static char *ld_preload;	/* Environment variable for libraries to
 				   load first */
 static char *ld_elf_hints_path;	/* Environment variable for alternative hints path */
@@ -401,7 +404,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_
      */
     if (!trust) {
         if (unsetenv(LD_ "PRELOAD") || unsetenv(LD_ "LIBMAP") ||
-	    unsetenv(LD_ "LIBRARY_PATH") || unsetenv(LD_ "LIBMAP_DISABLE") ||
+	    unsetenv(LD_ "LIBRARY_PATH") || unsetenv(LD_ "LIBRARY_PATH_FDS") ||
+	    unsetenv(LD_ "LIBMAP_DISABLE") ||
 	    unsetenv(LD_ "DEBUG") || unsetenv(LD_ "ELF_HINTS_PATH") ||
 	    unsetenv(LD_ "LOADFLTR") || unsetenv(LD_ "LIBRARY_PATH_RPATH")) {
 		_rtld_error("environment corrupt; aborting");
@@ -412,6 +416,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_
     libmap_disable = getenv(LD_ "LIBMAP_DISABLE") != NULL;
     libmap_override = getenv(LD_ "LIBMAP");
     ld_library_path = getenv(LD_ "LIBRARY_PATH");
+    ld_library_dirs = getenv(LD_ "LIBRARY_PATH_FDS");
     ld_preload = getenv(LD_ "PRELOAD");
     ld_elf_hints_path = getenv(LD_ "ELF_HINTS_PATH");
     ld_loadfltr = getenv(LD_ "LOADFLTR") != NULL;
@@ -1417,6 +1422,7 @@ gnu_hash(const char *s)
 	return (h & 0xffffffff);
 }
 
+
 /*
  * Find the library with the given name, and return its full pathname.
  * The returned string is dynamically allocated.  Generates an error
@@ -1425,6 +1431,10 @@ gnu_hash(const char *s)
  * If the second argument is non-NULL, then it refers to an already-
  * loaded shared object, whose library search path will be searched.
  *
+ * If a library is successfully located via LD_LIBRARY_PATH_FDS, its
+ * descriptor (which is close-on-exec) will be passed out via the third
+ * argument.
+ *
  * The search order is:
  *   DT_RPATH in the referencing file _unless_ DT_RUNPATH is present (1)
  *   DT_RPATH of the main object if DSO without defined DT_RUNPATH (1)
@@ -1437,7 +1447,7 @@ gnu_hash(const char *s)
  * (1) Handled in digest_dynamic2 - rpath left NULL if runpath defined.
  */
 static char *
-find_library(const char *xname, const Obj_Entry *refobj)
+find_library(const char *xname, const Obj_Entry *refobj, int *fdp)
 {
     char *pathname;
     char *name;
@@ -1474,6 +1484,7 @@ find_library(const char *xname, const Ob
 	if ((pathname = search_library_path(name, ld_library_path)) != NULL ||
 	  (refobj != NULL &&
 	  (pathname = search_library_path(name, refobj->rpath)) != NULL) ||
+	  (pathname = search_library_pathfds(name, ld_library_dirs, fdp)) != NULL ||
           (pathname = search_library_path(name, gethints(false))) != NULL ||
 	  (pathname = search_library_path(name, STANDARD_LIBRARY_PATH)) != NULL)
 	    return (pathname);
@@ -1486,6 +1497,7 @@ find_library(const char *xname, const Ob
 	  (pathname = search_library_path(name, ld_library_path)) != NULL ||
 	  (objgiven &&
 	  (pathname = search_library_path(name, refobj->runpath)) != NULL) ||
+	  (pathname = search_library_pathfds(name, ld_library_dirs, fdp)) != NULL ||
 	  (pathname = search_library_path(name, gethints(nodeflib))) != NULL ||
 	  (objgiven && !nodeflib &&
 	  (pathname = search_library_path(name, STANDARD_LIBRARY_PATH)) != NULL))
@@ -2085,29 +2097,34 @@ load_object(const char *name, int fd_u, 
     struct stat sb;
     char *path;
 
+    fd = -1;
     if (name != NULL) {
 	for (obj = obj_list->next;  obj != NULL;  obj = obj->next) {
 	    if (object_match_name(obj, name))
 		return (obj);
 	}
 
-	path = find_library(name, refobj);
+	path = find_library(name, refobj, &fd);
 	if (path == NULL)
 	    return (NULL);
     } else
 	path = NULL;
 
-    /*
-     * If we didn't find a match by pathname, or the name is not
-     * supplied, open the file and check again by device and inode.
-     * This avoids false mismatches caused by multiple links or ".."
-     * in pathnames.
-     *
-     * To avoid a race, we open the file and use fstat() rather than
-     * using stat().
-     */
-    fd = -1;
-    if (fd_u == -1) {
+    if (fd >= 0) {
+	/*
+	 * search_library_pathfds() opens a fresh file descriptor for the
+	 * library, so there is no need to dup().
+	 */
+    } else if (fd_u == -1) {
+	/*
+	 * If we didn't find a match by pathname, or the name is not
+	 * supplied, open the file and check again by device and inode.
+	 * This avoids false mismatches caused by multiple links or ".."
+	 * in pathnames.
+	 *
+	 * To avoid a race, we open the file and use fstat() rather than
+	 * using stat().
+	 */
 	if ((fd = open(path, O_RDONLY | O_CLOEXEC)) == -1) {
 	    _rtld_error("Cannot open \"%s\"", path);
 	    free(path);
@@ -2745,6 +2762,69 @@ search_library_path(const char *name, co
     return (p);
 }
 
+
+/*
+ * Finds the library with the given name using the directory descriptors
+ * listed in the LD_LIBRARY_PATH_FDS environment variable.
+ *
+ * Returns a freshly-opened close-on-exec file descriptor for the library,
+ * or -1 if the library cannot be found.
+ */
+static char *
+search_library_pathfds(const char *name, const char *path, int *fdp)
+{
+	char *envcopy, *fdstr, *found, *last_token;
+	size_t len;
+	int dirfd, fd;
+
+	dbg("%s('%s', '%s', fdp)\n", __func__, name, path);
+
+	/* Don't load from user-specified libdirs into setuid binaries. */
+	if (!trust)
+		return (NULL);
+
+	/* We can't do anything if LD_LIBRARY_PATH_FDS isn't set. */
+	if (path == NULL)
+		return (NULL);
+
+	/* LD_LIBRARY_PATH_FDS only works with relative paths. */
+	if (name[0] == '/') {
+		dbg("Absolute path (%s) passed to %s", name, __func__);
+		return (NULL);
+	}
+
+	/*
+	 * Use strtok_r() to walk the FD:FD:FD list.  This requires a local
+	 * copy of the path, as strtok_r rewrites separator tokens
+	 * with '\0'.
+	 */
+	found = NULL;
+	envcopy = xstrdup(path);
+	for (fdstr = strtok_r(envcopy, ":", &last_token); fdstr != NULL;
+	    fdstr = strtok_r(NULL, ":", &last_token)) {
+		dirfd = parse_libdir(fdstr);
+		if (dirfd < 0)
+			break;
+		fd = openat(dirfd, name, O_RDONLY | O_CLOEXEC);
+		if (fd >= 0) {
+			*fdp = fd;
+			len = strlen(fdstr) + strlen(name) + 3;
+			found = xmalloc(len);
+			if (rtld_snprintf(found, len, "#%d/%s", dirfd, name) < 0) {
+				_rtld_error("error generating '%d/%s'",
+				    dirfd, name);
+				die();
+			}
+			dbg("open('%s') => %d", found, fd);
+			break;
+		}
+	}
+	free(envcopy);
+
+	return (found);
+}
+
+
 int
 dlclose(void *handle)
 {
@@ -4835,6 +4915,36 @@ symlook_init_from_req(SymLook *dst, cons
 	dst->lockstate = src->lockstate;
 }
 
+
+/*
+ * Parse a file descriptor number without pulling in more of libc (e.g. atoi).
+ */
+static int
+parse_libdir(const char *str)
+{
+	static const int RADIX = 10;  /* XXXJA: possibly support hex? */
+	const char *orig;
+	int fd;
+	char c;
+
+	orig = str;
+	fd = 0;
+	for (c = *str; c != '\0'; c = *++str) {
+		if (c < '0' || c > '9')
+			return (-1);
+
+		fd *= RADIX;
+		fd += c - '0';
+	}
+
+	/* Make sure we actually parsed something. */
+	if (str == orig) {
+		_rtld_error("failed to parse directory FD from '%s'", str);
+		return (-1);
+	}
+	return (fd);
+}
+
 /*
  * Overrides for libc_pic-provided functions.
  */

Modified: head/libexec/rtld-elf/rtld_printf.c
==============================================================================
--- head/libexec/rtld-elf/rtld_printf.c	Fri Jun 20 15:43:58 2014	(r267677)
+++ head/libexec/rtld-elf/rtld_printf.c	Fri Jun 20 17:08:32 2014	(r267678)
@@ -429,6 +429,18 @@ number:
 }
 
 int
+rtld_snprintf(char *buf, size_t bufsize, const char *fmt, ...)
+{
+	va_list ap;
+	int retval;
+
+	va_start(ap, fmt);
+	retval = rtld_vsnprintf(buf, bufsize, fmt, ap);
+	va_end(ap);
+	return (retval);
+}
+
+int
 rtld_vsnprintf(char *buf, size_t bufsize, const char *fmt, va_list ap)
 {
 	struct snprintf_arg info;

Modified: head/libexec/rtld-elf/rtld_printf.h
==============================================================================
--- head/libexec/rtld-elf/rtld_printf.h	Fri Jun 20 15:43:58 2014	(r267677)
+++ head/libexec/rtld-elf/rtld_printf.h	Fri Jun 20 17:08:32 2014	(r267678)
@@ -31,6 +31,8 @@
 #include 
 #include 
 
+int rtld_snprintf(char *buf, size_t bufsize, const char *fmt, ...)
+    __printflike(3, 4);
 int rtld_vsnprintf(char *buf, size_t bufsize, const char *fmt, va_list ap);
 int rtld_vfdprintf(int fd, const char *fmt, va_list ap);
 int rtld_fdprintf(int fd, const char *fmt, ...) __printflike(2, 3);

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 17:15:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B7455152;
 Fri, 20 Jun 2014 17:15:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A0BA4268B;
 Fri, 20 Jun 2014 17:15:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KHF1lt021346;
 Fri, 20 Jun 2014 17:15:01 GMT
 (envelope-from jonathan@svn.freebsd.org)
Received: (from jonathan@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KHEx1g021285;
 Fri, 20 Jun 2014 17:14:59 GMT
 (envelope-from jonathan@svn.freebsd.org)
Message-Id: <201406201714.s5KHEx1g021285@svn.freebsd.org>
From: Jonathan Anderson 
Date: Fri, 20 Jun 2014 17:14:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267679 - in head: etc/mtree libexec/rtld-elf
 libexec/rtld-elf/tests libexec/rtld-elf/tests/libpythagoras
 libexec/rtld-elf/tests/target
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 17:15:01 -0000

Author: jonathan
Date: Fri Jun 20 17:14:59 2014
New Revision: 267679
URL: http://svnweb.freebsd.org/changeset/base/267679

Log:
  Test RTLD's new LD_LIBRARY_PATH_FDS variable.
  
  Test LD_LIBRARY_PATH_FDS by linking a binary that requires a shared
  library that isn't in any of the usual search paths.  Ensure this fails
  when we don't supply LD_LIBRARY_PATH_FDS or we pass invalid information
  in it.  Ensure it works when we pass the correct directory in various
  places in the variable.
  
  Approved by:	rwatson (mentor)
  MFC after:	3 weeks
  Sponsored by:	DARPA/AFRL

Added:
  head/libexec/rtld-elf/tests/
  head/libexec/rtld-elf/tests/Makefile   (contents, props changed)
  head/libexec/rtld-elf/tests/ld_library_pathfds.c   (contents, props changed)
  head/libexec/rtld-elf/tests/libpythagoras/
  head/libexec/rtld-elf/tests/libpythagoras/Makefile   (contents, props changed)
  head/libexec/rtld-elf/tests/libpythagoras/pythagoras.c   (contents, props changed)
  head/libexec/rtld-elf/tests/libpythagoras/pythagoras.h   (contents, props changed)
  head/libexec/rtld-elf/tests/target/
  head/libexec/rtld-elf/tests/target/Makefile   (contents, props changed)
  head/libexec/rtld-elf/tests/target/target.c   (contents, props changed)
Modified:
  head/etc/mtree/BSD.tests.dist
  head/libexec/rtld-elf/Makefile

Modified: head/etc/mtree/BSD.tests.dist
==============================================================================
--- head/etc/mtree/BSD.tests.dist	Fri Jun 20 17:08:32 2014	(r267678)
+++ head/etc/mtree/BSD.tests.dist	Fri Jun 20 17:14:59 2014	(r267679)
@@ -90,6 +90,7 @@
                 ..
                 atf-sh
                 ..
+            rtld-elf
             ..
         ..
         sbin

Modified: head/libexec/rtld-elf/Makefile
==============================================================================
--- head/libexec/rtld-elf/Makefile	Fri Jun 20 17:08:32 2014	(r267678)
+++ head/libexec/rtld-elf/Makefile	Fri Jun 20 17:14:59 2014	(r267679)
@@ -80,5 +80,9 @@ beforeinstall:
 
 NO_PIE=	yes
 
+.if ${MK_TESTS} != "no"
+SUBDIR+=	tests
+.endif
+
 .include 
 .include 

Added: head/libexec/rtld-elf/tests/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/libexec/rtld-elf/tests/Makefile	Fri Jun 20 17:14:59 2014	(r267679)
@@ -0,0 +1,14 @@
+# $FreeBSD$
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/libexec/rtld-elf
+SUBDIR+=	libpythagoras target
+
+.PATH:		${.CURDIR:H:H:H:H}/tests
+
+ATF_TESTS_C=	ld_library_pathfds
+
+CFLAGS+=	 -DTESTSDIR="\"${TESTSDIR}\""
+
+.include 

Added: head/libexec/rtld-elf/tests/ld_library_pathfds.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/libexec/rtld-elf/tests/ld_library_pathfds.c	Fri Jun 20 17:14:59 2014	(r267679)
@@ -0,0 +1,220 @@
+/*-
+ * Copyright 2014 Jonathan Anderson.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include 
+#include 
+#include 
+
+
+struct descriptors {
+	int	binary;
+	int	testdir;
+	int	root;
+	int	etc;
+	int	usr;
+};
+
+static void	setup(struct descriptors *);
+static void	expect_success(int binary, char *pathfds);
+static void	expect_missing_library(int binary, char *pathfds);
+
+static void	try_to_run(int binary, int expected_exit_status,
+    char * const *env, const char *expected_out, const char *expected_err);
+static int	opendir(const char *name);
+static int	opendirat(int parent, const char *name);
+
+
+ATF_TC_WITHOUT_HEAD(missing_library);
+ATF_TC_BODY(missing_library, tc)
+{
+	struct descriptors files;
+
+	setup(&files);
+	expect_missing_library(files.binary, NULL);
+}
+
+
+ATF_TC_WITHOUT_HEAD(wrong_library_directories);
+ATF_TC_BODY(wrong_library_directories, tc)
+{
+	struct descriptors files;
+	char *pathfds;
+
+	setup(&files);
+	ATF_REQUIRE(
+		asprintf(&pathfds, "LD_LIBRARY_PATH_FDS=%d", files.etc) > 0);
+
+	expect_missing_library(files.binary, pathfds);
+}
+
+
+ATF_TC_WITHOUT_HEAD(bad_library_directories);
+ATF_TC_BODY(bad_library_directories, tc)
+{
+	struct descriptors files;
+	char *pathfds;
+
+	setup(&files);
+	ATF_REQUIRE(asprintf(&pathfds, "::", files.etc) > 0);
+
+	expect_missing_library(files.binary, pathfds);
+}
+
+
+ATF_TC_WITHOUT_HEAD(single_library_directory);
+ATF_TC_BODY(single_library_directory, tc)
+{
+	struct descriptors files;
+	char *pathfds;
+
+	setup(&files);
+	ATF_REQUIRE(
+	    asprintf(&pathfds, "LD_LIBRARY_PATH_FDS=%d", files.testdir) > 0);
+
+	expect_success(files.binary, pathfds);
+}
+
+
+ATF_TC_WITHOUT_HEAD(first_library_directory);
+ATF_TC_BODY(first_library_directory, tc)
+{
+	struct descriptors files;
+	char *pathfds;
+
+	setup(&files);
+	ATF_REQUIRE(
+	    asprintf(&pathfds, "LD_LIBRARY_PATH_FDS=%d:%d",
+		files.testdir, files.etc) > 0);
+
+	expect_success(files.binary, pathfds);
+}
+
+
+ATF_TC_WITHOUT_HEAD(middle_library_directory);
+ATF_TC_BODY(middle_library_directory, tc)
+{
+	struct descriptors files;
+	char *pathfds;
+
+	setup(&files);
+	ATF_REQUIRE(
+	    asprintf(&pathfds, "LD_LIBRARY_PATH_FDS=%d:%d:%d",
+		files.root, files.testdir, files.usr) > 0);
+
+	expect_success(files.binary, pathfds);
+}
+
+
+ATF_TC_WITHOUT_HEAD(last_library_directory);
+ATF_TC_BODY(last_library_directory, tc)
+{
+	struct descriptors files;
+	char *pathfds;
+
+	setup(&files);
+	ATF_REQUIRE(
+	    asprintf(&pathfds, "LD_LIBRARY_PATH_FDS=%d:%d",
+		files.root, files.testdir) > 0);
+
+	expect_success(files.binary, pathfds);
+}
+
+
+
+/* Register test cases with ATF. */
+ATF_TP_ADD_TCS(tp)
+{
+	ATF_TP_ADD_TC(tp, missing_library);
+	ATF_TP_ADD_TC(tp, wrong_library_directories);
+	ATF_TP_ADD_TC(tp, bad_library_directories);
+	ATF_TP_ADD_TC(tp, single_library_directory);
+	ATF_TP_ADD_TC(tp, first_library_directory);
+	ATF_TP_ADD_TC(tp, middle_library_directory);
+	ATF_TP_ADD_TC(tp, last_library_directory);
+
+	return atf_no_error();
+}
+
+
+static void
+setup(struct descriptors *dp)
+{
+
+	ATF_REQUIRE((dp->testdir = opendir(TESTSDIR)) >= 0);
+	ATF_REQUIRE(
+	    (dp->binary = openat(dp->testdir, "target", O_RDONLY)) >= 0);
+
+	ATF_REQUIRE((dp->root = opendir("/")) >= 0);
+	ATF_REQUIRE((dp->etc = opendirat(dp->root, "etc")) >= 0);
+	ATF_REQUIRE((dp->usr = opendirat(dp->root, "usr")) >= 0);
+}
+
+static void
+expect_success(int binary, char *pathfds)
+{
+	char * const env[] = { pathfds, NULL };
+	try_to_run(binary, 0, env, "the hypotenuse of 3 and 4 is 5\n", "");
+}
+
+static void
+expect_missing_library(int binary, char *pathfds)
+{
+	char * const env[] = { pathfds, NULL };
+	try_to_run(binary, 1, env, "",
+	   "Shared object \"libpythagoras.so.0\" not found,"
+	    " required by \"target\"\n");
+}
+
+
+static void
+try_to_run(int binary, int exit_status, char * const *env,
+        const char *expected_out, const char *expected_err)
+{
+	pid_t child = atf_utils_fork();
+
+	if (child == 0) {
+		char * const args[] = { "target", NULL };
+
+		fexecve(binary, args, env);
+		atf_tc_fail("fexecve() failed");
+	}
+
+	atf_utils_wait(child, exit_status, expected_out, expected_err);
+}
+
+
+static int
+opendir(const char *name)
+{
+	return open(name, O_RDONLY | O_DIRECTORY);
+}
+
+static int
+opendirat(int parent, const char *name)
+{
+	return openat(parent, name, O_RDONLY | O_DIRECTORY);
+}

Added: head/libexec/rtld-elf/tests/libpythagoras/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/libexec/rtld-elf/tests/libpythagoras/Makefile	Fri Jun 20 17:14:59 2014	(r267679)
@@ -0,0 +1,13 @@
+# $FreeBSD$
+
+.include 
+
+LIB=		pythagoras
+SHLIB_MAJOR=	0
+
+LIBDIR=		${TESTSBASE}${TESTSDIR}/libexec/rtld-elf
+SHLIBDIR=	${TESTSBASE}${TESTSDIR}/libexec/rtld-elf
+
+SRCS=		pythagoras.c
+
+.include 

Added: head/libexec/rtld-elf/tests/libpythagoras/pythagoras.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/libexec/rtld-elf/tests/libpythagoras/pythagoras.c	Fri Jun 20 17:14:59 2014	(r267679)
@@ -0,0 +1,42 @@
+/*-
+ * Copyright 2014 Jonathan Anderson.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include 
+#include 
+
+#include "pythagoras.h"
+
+double
+pythagorean_theorem(double a, double b)
+{
+
+	if (a <= 0 || b <= 0) {
+		errno = ERANGE;
+		return (-1.0);
+	}
+	return (sqrt(pow(a, 2) + pow(b, 2)));
+}

Added: head/libexec/rtld-elf/tests/libpythagoras/pythagoras.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/libexec/rtld-elf/tests/libpythagoras/pythagoras.h	Fri Jun 20 17:14:59 2014	(r267679)
@@ -0,0 +1,28 @@
+/*-
+ * Copyright 2014 Jonathan Anderson.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+double	pythagorean_theorem(double, double);

Added: head/libexec/rtld-elf/tests/target/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/libexec/rtld-elf/tests/target/Makefile	Fri Jun 20 17:14:59 2014	(r267679)
@@ -0,0 +1,13 @@
+# $FreeBSD$
+
+.include 
+
+PROG=		target
+BINDIR=		${TESTSBASE}${TESTSDIR}/libexec/rtld-elf
+
+CFLAGS+=	-I${.CURDIR}/../libpythagoras
+LDADD=		-L${.OBJDIR}/../libpythagoras -lpythagoras
+
+MAN=
+
+.include 

Added: head/libexec/rtld-elf/tests/target/target.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/libexec/rtld-elf/tests/target/target.c	Fri Jun 20 17:14:59 2014	(r267679)
@@ -0,0 +1,39 @@
+/*-
+ * Copyright 2014 Jonathan Anderson.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include "pythagoras.h"
+
+#include 
+
+int
+main(int argc, char *argv[])
+{
+	float hypotenuse = pythagorean_theorem(3, 4);
+	printf("the hypotenuse of 3 and 4 is %d\n", (int) hypotenuse);
+
+	return 0;
+}

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 17:35:21 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 03FEE749;
 Fri, 20 Jun 2014 17:35:21 +0000 (UTC)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D0328283B;
 Fri, 20 Jun 2014 17:35:20 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 568A6B923;
 Fri, 20 Jun 2014 13:35:19 -0400 (EDT)
From: John Baldwin 
To: Alexander Kabaev 
Subject: Re: svn commit: r267660 - head/sys/dev/firewire
Date: Fri, 20 Jun 2014 11:33:38 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; )
References: <201406200145.s5K1j3TC083304@svn.freebsd.org>
In-Reply-To: <201406200145.s5K1j3TC083304@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201406201133.38671.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Fri, 20 Jun 2014 13:35:19 -0400 (EDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 17:35:21 -0000

On Thursday, June 19, 2014 9:45:03 pm Alexander Kabaev wrote:
> Author: kan
> Date: Fri Jun 20 01:45:03 2014
> New Revision: 267660
> URL: http://svnweb.freebsd.org/changeset/base/267660
> 
> Log:
>   Set target->sbp field to valid value when sbp device is created.
>   
>   The sbp_cam_detach_target can be called from sbp_post_explore function
>   on the first target that is not really attached and it was written with
>   the corresponding safety check in place to tolerate that. Unfortunately
>   the recent locking cleanup did add a locking assertion that tries to
>   dereference the target->sbp pointer unconditionally, which causes less
>   than desirable outcome. Since the assertion is useful, just initialize
>   the target sbp pointer once when sbp device is being initialized instead
>   of when the target is being attached. This makes assertion work in all
>   cases and fixes the crash on boot.

Thanks.

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 17:40:39 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6B2B9933;
 Fri, 20 Jun 2014 17:40:39 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 57A10286C;
 Fri, 20 Jun 2014 17:40:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KHedDU032508;
 Fri, 20 Jun 2014 17:40:39 GMT (envelope-from dteske@svn.freebsd.org)
Received: (from dteske@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KHedGs032505;
 Fri, 20 Jun 2014 17:40:39 GMT (envelope-from dteske@svn.freebsd.org)
Message-Id: <201406201740.s5KHedGs032505@svn.freebsd.org>
From: Devin Teske 
Date: Fri, 20 Jun 2014 17:40:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267680 - head/usr.sbin/bsdconfig/share/packages
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 17:40:39 -0000

Author: dteske
Date: Fri Jun 20 17:40:38 2014
New Revision: 267680
URL: http://svnweb.freebsd.org/changeset/base/267680

Log:
  Fix a code typo that prevented mkdir from firing (unnoticed
  usually because another part of the code succeeded in making
  the same directory).
  
  MFC after:      3 days

Modified:
  head/usr.sbin/bsdconfig/share/packages/index.subr

Modified: head/usr.sbin/bsdconfig/share/packages/index.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/packages/index.subr	Fri Jun 20 17:14:59 2014	(r267679)
+++ head/usr.sbin/bsdconfig/share/packages/index.subr	Fri Jun 20 17:40:38 2014	(r267680)
@@ -258,7 +258,7 @@ f_index_initialize()
 
 		# Finally, move the temporary file into place
 		case "$PACKAGES_INDEX_CACHEFILE" in
-		*/*) f_eval_catch -d $funcname mkdir \
+		*/*) f_eval_catch -d $__funcname mkdir \
 			'mkdir -p "%s"' "${PACKAGES_INDEX_CACHEFILE%/*}"
 		esac
 		f_eval_catch -d $__funcname mv 'mv -f "%s" "%s"' \

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 17:45:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4B2FFBFE;
 Fri, 20 Jun 2014 17:45:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 381052900;
 Fri, 20 Jun 2014 17:45:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KHj1TA035380;
 Fri, 20 Jun 2014 17:45:01 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KHj1Nc035379;
 Fri, 20 Jun 2014 17:45:01 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201406201745.s5KHj1Nc035379@svn.freebsd.org>
From: Michael Tuexen 
Date: Fri, 20 Jun 2014 17:45:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267682 - head/sys/netinet
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 17:45:01 -0000

Author: tuexen
Date: Fri Jun 20 17:45:00 2014
New Revision: 267682
URL: http://svnweb.freebsd.org/changeset/base/267682

Log:
  Fix a bug in the setsockopt()-handling of the SCTP
  specific option SCTP_PEER_ADDR_THLDS: Use the
  provided address as intended.
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_usrreq.c

Modified: head/sys/netinet/sctp_usrreq.c
==============================================================================
--- head/sys/netinet/sctp_usrreq.c	Fri Jun 20 17:44:30 2014	(r267681)
+++ head/sys/netinet/sctp_usrreq.c	Fri Jun 20 17:45:00 2014	(r267682)
@@ -5642,7 +5642,7 @@ sctp_setopt(struct socket *so, int optna
 			SCTP_FIND_STCB(inp, stcb, thlds->spt_assoc_id);
 			net = NULL;
 			if (stcb) {
-				net = sctp_findnet(stcb, (struct sockaddr *)&thlds->spt_assoc_id);
+				net = sctp_findnet(stcb, (struct sockaddr *)&thlds->spt_address);
 			} else {
 				/*
 				 * We increment here since
@@ -5653,7 +5653,7 @@ sctp_setopt(struct socket *so, int optna
 				 */
 				SCTP_INP_INCR_REF(inp);
 				stcb = sctp_findassociation_ep_addr(&inp,
-				    (struct sockaddr *)&thlds->spt_assoc_id,
+				    (struct sockaddr *)&thlds->spt_address,
 				    &net, NULL, NULL);
 				if (stcb == NULL) {
 					SCTP_INP_DECR_REF(inp);
@@ -5662,7 +5662,7 @@ sctp_setopt(struct socket *so, int optna
 			if (stcb && (net == NULL)) {
 				struct sockaddr *sa;
 
-				sa = (struct sockaddr *)&thlds->spt_assoc_id;
+				sa = (struct sockaddr *)&thlds->spt_address;
 #ifdef INET
 				if (sa->sa_family == AF_INET) {
 

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 18:04:19 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E042762E;
 Fri, 20 Jun 2014 18:04:19 +0000 (UTC)
Received: from tensor.andric.com (tensor.andric.com
 [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client CN "tensor.andric.com", Issuer "CAcert Class 3 Root" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 9B7042B0B;
 Fri, 20 Jun 2014 18:04:19 +0000 (UTC)
Received: from [IPv6:2001:7b8:3a7::35d6:be0d:a311:f3bd] (unknown
 [IPv6:2001:7b8:3a7:0:35d6:be0d:a311:f3bd])
 (using TLSv1 with cipher AES128-SHA (128/128 bits))
 (No client certificate requested)
 by tensor.andric.com (Postfix) with ESMTPSA id 553DD5C37;
 Fri, 20 Jun 2014 20:04:14 +0200 (CEST)
Content-Type: multipart/signed;
 boundary="Apple-Mail=_47A9754F-B1C4-4D12-BC36-96236B50007F";
 protocol="application/pgp-signature"; micalg=pgp-sha1
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r267678 - head/libexec/rtld-elf
From: Dimitry Andric 
In-Reply-To: <201406201708.s5KH8WVP017030@svn.freebsd.org>
Date: Fri, 20 Jun 2014 20:03:56 +0200
Message-Id: <613FB32F-6862-4A7E-81C2-227577849FC5@FreeBSD.org>
References: <201406201708.s5KH8WVP017030@svn.freebsd.org>
To: Jonathan Anderson 
X-Mailer: Apple Mail (2.1878.2)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 18:04:20 -0000


--Apple-Mail=_47A9754F-B1C4-4D12-BC36-96236B50007F
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

On 20 Jun 2014, at 19:08, Jonathan Anderson  =
wrote:
> Author: jonathan
> Date: Fri Jun 20 17:08:32 2014
> New Revision: 267678
> URL: http://svnweb.freebsd.org/changeset/base/267678
>=20
> Log:
>  Add the LD_LIBRARY_PATH_FDS environmental variable.
>=20
>  This variable allows the loading of shared libraries via directory =
descriptors
>  rather than via library paths.  If LD_LIBRARY_PATH_FDS=3D3:4:12, the =
directories
>  represented by file descriptors 3, 4 and 12 will searched for shared =
libraries
>  before the normal path-based mechanisms are used.  This allows us to =
execute
>  unprivileged binaries from within a Capsicum sandbox even if they =
require
>  shared libraries.
...
> Modified: head/libexec/rtld-elf/rtld.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/libexec/rtld-elf/rtld.c	Fri Jun 20 15:43:58 2014	=
(r267677)
> +++ head/libexec/rtld-elf/rtld.c	Fri Jun 20 17:08:32 2014	=
(r267678)
...
> +static int
> +parse_libdir(const char *str)
> +{
> +	static const int RADIX =3D 10;  /* XXXJA: possibly support hex? =
*/
> +	const char *orig;
> +	int fd;
> +	char c;
> +
> +	orig =3D str;
> +	fd =3D 0;
> +	for (c =3D *str; c !=3D '\0'; c =3D *++str) {
> +		if (c < '0' || c > '9')
> +			return (-1);
> +
> +		fd *=3D RADIX;
> +		fd +=3D c - '0';
> +	}
> +
> +	/* Make sure we actually parsed something. */
> +	if (str =3D=3D orig) {
> +		_rtld_error("failed to parse directory FD from '%s'", =
str);
> +		return (-1);
> +	}
> +	return (fd);
> +}

Shouldn't the first "return (-1)" also be preceded by a call =
_rtld_error()?

-Dimitry


--Apple-Mail=_47A9754F-B1C4-4D12-BC36-96236B50007F
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)

iEYEARECAAYFAlOkd5oACgkQsF6jCi4glqPm9QCdG1+03/fOycT/Cz79lQgkbfvV
PncAnRrevVuORUBJUrlkIIQOT/5DGTN1
=RdnM
-----END PGP SIGNATURE-----

--Apple-Mail=_47A9754F-B1C4-4D12-BC36-96236B50007F--

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 18:23:24 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id BFBB9EDC;
 Fri, 20 Jun 2014 18:23:24 +0000 (UTC)
Received: from fep33.mx.upcmail.net (fep33.mx.upcmail.net [62.179.121.51])
 by mx1.freebsd.org (Postfix) with ESMTP id 81BD62CF6;
 Fri, 20 Jun 2014 18:23:22 +0000 (UTC)
Received: from edge04.upcmail.net ([192.168.13.239]) by viefep33-int.chello.at
 (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP
 id <20140620182315.HLRZ1788.viefep33-int.chello.at@edge04.upcmail.net>;
 Fri, 20 Jun 2014 20:23:15 +0200
Received: from mole.fafoe.narf.at ([80.109.55.137])
 by edge04.upcmail.net with edge
 id GiPF1o00J2xdvHc03iPFHL; Fri, 20 Jun 2014 20:23:15 +0200
X-SourceIP: 80.109.55.137
Received: by mole.fafoe.narf.at (Postfix, from userid 1001)
 id E35906D47C; Fri, 20 Jun 2014 20:23:11 +0200 (CEST)
Date: Fri, 20 Jun 2014 20:23:11 +0200
From: Stefan Farfeleder 
To: "Pedro F. Giffuni" 
Subject: Re: svn commit: r267675 - head/lib/libc/regex
Message-ID: <20140620182311.GA1214@mole.fafoe.narf.at>
References: <201406201529.s5KFTAEB068038@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201406201529.s5KFTAEB068038@svn.freebsd.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 18:23:24 -0000

On Fri, Jun 20, 2014 at 03:29:10PM +0000, Pedro F. Giffuni wrote:
> Author: pfg
> Date: Fri Jun 20 15:29:09 2014
> New Revision: 267675
> URL: http://svnweb.freebsd.org/changeset/base/267675
> 
> Log:
>   regex: Make use of reallocf().
>   
>   Use of reallocf is useful in libraries as we are not certain the
>   application will exit after NULL.
>   
>   This somewhat reduces portability but if since you are building
>   this as part of libc it is likely you have our non-standard
>   reallocf(3) already.
>   
>   Reviewed by:	ache
>   MFC after:	5 days
> 
> Modified:
>   head/lib/libc/regex/regcomp.c
> 
> Modified: head/lib/libc/regex/regcomp.c
> ==============================================================================
> --- head/lib/libc/regex/regcomp.c	Fri Jun 20 13:26:49 2014	(r267674)
> +++ head/lib/libc/regex/regcomp.c	Fri Jun 20 15:29:09 2014	(r267675)
> @@ -1111,7 +1111,7 @@ allocset(struct parse *p)
>  {
>  	cset *cs, *ncs;
>  
> -	ncs = realloc(p->g->sets, (p->g->ncsets + 1) * sizeof(*ncs));
> +	ncs = reallocf(p->g->sets, (p->g->ncsets + 1) * sizeof(*ncs));
>  	if (ncs == NULL) {
>  		SETERROR(REG_ESPACE);
>  		return (NULL);
> @@ -1174,7 +1174,7 @@ CHadd(struct parse *p, cset *cs, wint_t 
>  	if (ch < NC)
>  		cs->bmp[ch >> 3] |= 1 << (ch & 7);
>  	else {
> -		newwides = realloc(cs->wides, (cs->nwides + 1) *
> +		newwides = reallocf(cs->wides, (cs->nwides + 1) *
>  		    sizeof(*cs->wides));
>  		if (newwides == NULL) {
>  			SETERROR(REG_ESPACE);

Hi Pedro,

I don't think these changes are OK. If reallocf() fails here, the
cs->wides pointer will be freed and later freeset() will call
free(cs->wides), probably crashing. The other cases are most probably
similar though I haven't examined them closely.

BR,
Stefan

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 19:03:35 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 85137CDC
 for ; Fri, 20 Jun 2014 19:03:35 +0000 (UTC)
Received: from nm19-vm0.bullet.mail.bf1.yahoo.com
 (nm19-vm0.bullet.mail.bf1.yahoo.com [98.139.213.162])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 252F82086
 for ; Fri, 20 Jun 2014 19:03:35 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1403290633; bh=vSP9ldnywmgXDnZoPq1qcQTYi5SuenHiAPyVpcM9TUQ=;
 h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:Organization:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding;
 b=EZx3q8dCsy2XIl26BphcDfIJFGW3E3NKbeHoZFSBcb62G7N8Vbq3+sqmpLWGvqxaVX40GvpjYtmSfqUo/z7dwWbyoLQ5eLDcr54OyMzkXXqYIcoy8TXubGs0B0GqQZsZ1nXNWCAxF25D+JcoNfsta0soQy4TwJLOlGAocCED/Vlufz7dSh9B4CRHTPOHLXwuT0fIbsAx5Oft5fQQXx6BXHUmURKVTwuYnGR5fXDjxkwAWMUQtGWjtMclsG0By7p155HQXlMNkgTHBKENMz2A3fx/K9N1FYi/TMKqIMIWJbnfDgobU90RcsscUkJBL5u6trTxhQmVp5vEQ81bsyNj9g==
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com;
 b=uYkXha45/RkSjO2Pm8rK73mMLEkngr6hqz0ingCho1YEsEs0sHxCaQl//KkvJ4jL0DjUMvRObcjF70Tndj5ovC+vZlWrK2L/0U8vChQzkqMtpQjuAIDVmKYS5Xn8wyf8tqgv/8vtMPGI01rSRi0tdUnVK6cjHH14l1S6xCLpSoSQpn4MqL2MESoyQppJ9u8oHkTGMF5FyBMeUNSM+ybBNJ326TGhQRHMllu1JzNLRuXAbDZGDTocjNOgE5/gORbOJaa0r9/Y2QnKugl8uDrZZj6f/v19LfemqR5AcwDiX4x6Sfpf6VZpkfu90dsQQ4w6k0gtQL/nyLGRA2eX8UcUYQ==;
Received: from [66.196.81.170] by nm19.bullet.mail.bf1.yahoo.com with NNFMP;
 20 Jun 2014 18:57:13 -0000
Received: from [98.139.211.205] by tm16.bullet.mail.bf1.yahoo.com with NNFMP;
 20 Jun 2014 18:57:13 -0000
Received: from [127.0.0.1] by smtp214.mail.bf1.yahoo.com with NNFMP;
 20 Jun 2014 18:57:13 -0000
X-Yahoo-Newman-Id: 19013.92704.bm@smtp214.mail.bf1.yahoo.com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: jrkjuFsVM1kCuY8knyFwoE2.lNxzcWN8m3Gmogcpkl3atOr
 qSbfYCld8gYRSzQaxOhcthMq2zLjzyg2h6BK2qzGKwkXHn.aUg59eBz2efnw
 fjH8LbTNehPOwubEOvOsQxITeN9Fa3D_4V.ClXWJOP8_BKmdHgqTfApwNu_E
 1wBdecC.49BfewkIJT5WnOXQz9bz.wcu9Iw4wpt6AQ_sPcTwrcstZfG2X984
 knd_G4G53Xo.EAPOHs8_CkglTIxmWqolkqfqvmEsPiJ1Z5ma6c0QFZRNyRX1
 1i6wn7fGifFFd.2V.j5kiJ.tNcQ.mx4RmfgVL9mnAQqu1cbvA8NmwfW2FmwP
 TTS2GMDUxh1n3jilSJgb9HYMEprvpUduo183YArXBF2LaRICoL0pSA8ebTc5
 sUzGylXjLqm607nBjMBjrr5Jcj5CY8ah0iEaxwfNietavAEktC7tJhd4PXOj
 PVwlZ5Hhc35ZbGRhY1qIeRNtj.tOy4pSEb5amzG54XQ_HZcJq.F2kiTvOpe4
 ddLonnbzZlro.3bujQo7aje95M48G80mNPhRz9tasWSPkBja8eQOAQGZkApQ
 UjtztfLdrD7RT8.ObYMmvgq42oPux_2zAeHl.toCuG7HUnbWsop1tXFSMm.A
 KDDuzQbk-
X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf
X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain
 [98.138.105.21])
 by smtp214.mail.bf1.yahoo.com with SMTP; 20 Jun 2014 11:57:12 -0700 PDT
Message-ID: <53A4840F.8030903@FreeBSD.org>
Date: Fri, 20 Jun 2014 13:57:19 -0500
From: Pedro Giffuni 
Organization: FreeBSD
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Stefan Farfeleder 
Subject: Re: svn commit: r267675 - head/lib/libc/regex
References: <201406201529.s5KFTAEB068038@svn.freebsd.org>
 <20140620182311.GA1214@mole.fafoe.narf.at>
In-Reply-To: <20140620182311.GA1214@mole.fafoe.narf.at>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 19:03:35 -0000

El 6/20/2014 1:23 PM, Stefan Farfeleder escribió:
> On Fri, Jun 20, 2014 at 03:29:10PM +0000, Pedro F. Giffuni wrote:
>> Author: pfg
>> Date: Fri Jun 20 15:29:09 2014
>> New Revision: 267675
>> URL: http://svnweb.freebsd.org/changeset/base/267675
>>
>> Log:
>>    regex: Make use of reallocf().
>>
>>    Use of reallocf is useful in libraries as we are not certain the
>>    application will exit after NULL.
>>
>>    This somewhat reduces portability but if since you are building
>>    this as part of libc it is likely you have our non-standard
>>    reallocf(3) already.
>>
>>    Reviewed by:	ache
>>    MFC after:	5 days
>>
>> Modified:
>>    head/lib/libc/regex/regcomp.c
>>
>> Modified: head/lib/libc/regex/regcomp.c
>> ==============================================================================
>> --- head/lib/libc/regex/regcomp.c	Fri Jun 20 13:26:49 2014	(r267674)
>> +++ head/lib/libc/regex/regcomp.c	Fri Jun 20 15:29:09 2014	(r267675)
>> @@ -1111,7 +1111,7 @@ allocset(struct parse *p)
>>   {
>>   	cset *cs, *ncs;
>>
>> -	ncs = realloc(p->g->sets, (p->g->ncsets + 1) * sizeof(*ncs));
>> +	ncs = reallocf(p->g->sets, (p->g->ncsets + 1) * sizeof(*ncs));
>>   	if (ncs == NULL) {
>>   		SETERROR(REG_ESPACE);
>>   		return (NULL);
>> @@ -1174,7 +1174,7 @@ CHadd(struct parse *p, cset *cs, wint_t
>>   	if (ch < NC)
>>   		cs->bmp[ch >> 3] |= 1 << (ch & 7);
>>   	else {
>> -		newwides = realloc(cs->wides, (cs->nwides + 1) *
>> +		newwides = reallocf(cs->wides, (cs->nwides + 1) *
>>   		    sizeof(*cs->wides));
>>   		if (newwides == NULL) {
>>   			SETERROR(REG_ESPACE);
>
> Hi Pedro,
>
> I don't think these changes are OK. If reallocf() fails here, the
> cs->wides pointer will be freed and later freeset() will call
> free(cs->wides), probably crashing. The other cases are most probably
> similar though I haven't examined them closely.
>

Ugh .. I think you are right. Let me check and I will revert as necessary.

Pedro.



From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 19:42:33 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0F6C585A
 for ; Fri, 20 Jun 2014 19:42:33 +0000 (UTC)
Received: from nm42-vm4.bullet.mail.bf1.yahoo.com
 (nm42-vm4.bullet.mail.bf1.yahoo.com [216.109.114.191])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A34532419
 for ; Fri, 20 Jun 2014 19:42:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1403293018; bh=WkZtGNeb+Xkr2RKyBvt/84T2i+TNtYg5Kbq7hqBq+7E=;
 h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:Organization:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding;
 b=ISJ6KLY4kitn+YKJcU0d8bof9PzRjQodsm9cX05Z53dOMn8QrBA7V+FaNqZrT1ug/exzTas+G2B+1oOoxBz6Mod5evHLJa4fHTX/wFVg3LYyr7JVyJLPm5Uv6vZGNX1yP3gRqFAEeFPHovuyYVAteOzoRdkZgjdLUBzaWi8fAIjLL5O4TsG5H/jG9vi4vvD0FsVpmqB0Fn5dLPnK0Wet4AA2/Q6JQN24KZyryy724swDa3LpxSsTPiJbP3hMGmOo0iT+6gEWb9hE6fg4Kj0txVoSugLka+Q7tEO1VrPf80X5YlW87Ty51pGaF3L+qdQThwHE5o4/1jgQjzUHrrCKpA==
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com;
 b=V/2VkcAY/owj4D9rojCID/33yUrxfJoQmeP11UPVxvAvpDNYyVQXavq2z3OorlRjNqykTgN/j3C4xAphYt28SmSPesc8yW3c4spS4hW0suVEUTVTkvhEYBtqdkzhfSMwCEz3BdGGiKkESbtD5dTLfVrX02h5c0k2xJt+vT/x5l/f4It7dslv8tsCOO9aVYhcI3kjR5WQG6mTb/KvTJKk6tvWV/7Og8JaB2XeX/bEKtAUodQ3wbEhVV6OOJwZNK7vMsmV9wUsswZdNW5GU1iE0eHPXcjksccnBS3RqUGjLNu3KIwXn62I9QVf1kmp4T0yYmO3HRl67niSpIlPuHAsfA==;
Received: from [98.139.215.140] by nm42.bullet.mail.bf1.yahoo.com with NNFMP;
 20 Jun 2014 19:36:58 -0000
Received: from [98.139.211.206] by tm11.bullet.mail.bf1.yahoo.com with NNFMP;
 20 Jun 2014 19:36:58 -0000
Received: from [127.0.0.1] by smtp215.mail.bf1.yahoo.com with NNFMP;
 20 Jun 2014 19:36:58 -0000
X-Yahoo-Newman-Id: 598441.31858.bm@smtp215.mail.bf1.yahoo.com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: nb_D6UgVM1k0kYxrQlcjmnhXdguUZ4UeWFPozBXDjFOv7Lv
 PtXNFPLxDpC7lBm5Twmzzhu8sA1SbgR6C5zXl1wKDJcr4opU60n.wW_zcgSn
 iT7RWRBjx5A9ms_Qcs6ELTMG2b9qnthNa4bxeRJQk4PhL7NJykv0Lo6vKaXK
 BZAt54xm3XnCdG7gxWaEJkk6FFL1T3GebFn2dzo2XBCpje1ZtdA7.0ekg7Fz
 qa2hV.1tLZQgvAIgdbNOrp__iHIFGj_BD8dzpl9t_1p25lNgUVZjY6EH1jOf
 1VL21t4gw7rdQ8R4mQJJ8IzhytDEl01t8cj_TcCNMH5iVPEUsF25k.YteZFU
 6PCM_XApbraHTcLVBan6hs6D3qpys4EZvgJk.m_obE_0Mm_5iM1obQIUuPwl
 bw5en8WQ5gTdhNI5fic.ieDkR_ygAFCC6WqdsKzmVBrG7WrnBoRNqHx6jAp0
 pTuSssyTYcPV04dC.EBzB9BD2VRVtcwn3tX81kMUYkoOvyyegBP.OBkwmNDU
 faV4LJnBYkBXc2Wqh2MejIYyzC0PsGFc3lVtF4yaW_jY1mQa46Z.5mkd9EFY
 Vm10bGAYRtVo7OPoAu9tNSb4Fs9yqARoc.Ic44IhJJL1IzS8r3UcZzyEmeR3
 7gvRFKp4-
X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf
X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain
 [98.138.105.21])
 by smtp215.mail.bf1.yahoo.com with SMTP; 20 Jun 2014 12:36:58 -0700 PDT
Message-ID: <53A48D62.4060801@FreeBSD.org>
Date: Fri, 20 Jun 2014 14:37:06 -0500
From: Pedro Giffuni 
Organization: FreeBSD
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Stefan Farfeleder 
Subject: Re: svn commit: r267675 - head/lib/libc/regex
References: <201406201529.s5KFTAEB068038@svn.freebsd.org>
 <20140620182311.GA1214@mole.fafoe.narf.at>
In-Reply-To: <20140620182311.GA1214@mole.fafoe.narf.at>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 19:42:33 -0000

El 6/20/2014 1:23 PM, Stefan Farfeleder escribió:
> On Fri, Jun 20, 2014 at 03:29:10PM +0000, Pedro F. Giffuni wrote:
>> Author: pfg
>> Date: Fri Jun 20 15:29:09 2014
>> New Revision: 267675
>> URL: http://svnweb.freebsd.org/changeset/base/267675
>>
>> Log:
>>    regex: Make use of reallocf().
>>
>>    Use of reallocf is useful in libraries as we are not certain the
>>    application will exit after NULL.
>>
>>    This somewhat reduces portability but if since you are building
>>    this as part of libc it is likely you have our non-standard
>>    reallocf(3) already.
>>
>>    Reviewed by:	ache
>>    MFC after:	5 days
>>
>> Modified:
>>    head/lib/libc/regex/regcomp.c
>>
>> Modified: head/lib/libc/regex/regcomp.c
>> ==============================================================================
>> --- head/lib/libc/regex/regcomp.c	Fri Jun 20 13:26:49 2014	(r267674)
>> +++ head/lib/libc/regex/regcomp.c	Fri Jun 20 15:29:09 2014	(r267675)
>> @@ -1111,7 +1111,7 @@ allocset(struct parse *p)
>>   {
>>   	cset *cs, *ncs;
>>
>> -	ncs = realloc(p->g->sets, (p->g->ncsets + 1) * sizeof(*ncs));
>> +	ncs = reallocf(p->g->sets, (p->g->ncsets + 1) * sizeof(*ncs));
>>   	if (ncs == NULL) {
>>   		SETERROR(REG_ESPACE);
>>   		return (NULL);
>> @@ -1174,7 +1174,7 @@ CHadd(struct parse *p, cset *cs, wint_t
>>   	if (ch < NC)
>>   		cs->bmp[ch >> 3] |= 1 << (ch & 7);
>>   	else {
>> -		newwides = realloc(cs->wides, (cs->nwides + 1) *
>> +		newwides = reallocf(cs->wides, (cs->nwides + 1) *
>>   		    sizeof(*cs->wides));
>>   		if (newwides == NULL) {
>>   			SETERROR(REG_ESPACE);
>
> Hi Pedro,
>
> I don't think these changes are OK. If reallocf() fails here, the
> cs->wides pointer will be freed and later freeset() will call
> free(cs->wides), probably crashing. The other cases are most probably
> similar though I haven't examined them closely.
>

OK ...

I don't think there is any problem:

If reallocf fails, newwides will be set to NULL and if free() is called 
it doesn't do anything when the argument is NULL.

Also freeset() is meant to be called to "free a now-unused set" and it 
is not called within the library. I would think using a value when the 
allocation has failed is a much more serious issue than attempting to 
fail to free it after trying to use it. ;-).

Pedro.


From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 19:54:24 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 65B7FBC0;
 Fri, 20 Jun 2014 19:54:24 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 52C1024F3;
 Fri, 20 Jun 2014 19:54:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KJsOiv096157;
 Fri, 20 Jun 2014 19:54:24 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KJsOa7096156;
 Fri, 20 Jun 2014 19:54:24 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201406201954.s5KJsOa7096156@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 20 Jun 2014 19:54:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267685 - head/usr.bin/top
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 19:54:24 -0000

Author: jhb
Date: Fri Jun 20 19:54:23 2014
New Revision: 267685
URL: http://svnweb.freebsd.org/changeset/base/267685

Log:
  Cap the percent CPU of individual threads at 100% to fix some of the
  more obvious imprecision in the previous top changes.
  
  Specifically, top uses a delta of clock_gettime() calls right after
  invoking the kern.proc sysctl to fetch the process/thread list to
  compute the time delta between the fetches.  However, the kern.proc
  sysctl handler does not run in constant time.  It can spin on locks,
  be preempted by an interrupt handler, etc.  As a result, the time
  between the gathering of stats for individual processes or threads
  between subsequent kern.proc handlers can vary.  If a "slow" kern.proc
  run is followed by a "fast" kern.proc run, then the threads/processes
  at the start of the "slow" run will have a longer time delta than the
  threads/processes at the end.  If the clock_gettime() time delta is
  not itself skewed by preemption, then the delta may be too short for
  a given thread/process resulting in a higher percent CPU than actual.
  However, there is no good way to calculate the exact amount of overage,
  nor to know which threads to subtract the overage from.  Instead, just
  punt and fix the definitely-wrong case of an individual thread having
  more than 100% CPU.
  
  Discussed with:	zonk

Modified:
  head/usr.bin/top/machine.c

Modified: head/usr.bin/top/machine.c
==============================================================================
--- head/usr.bin/top/machine.c	Fri Jun 20 18:07:04 2014	(r267684)
+++ head/usr.bin/top/machine.c	Fri Jun 20 19:54:23 2014	(r267685)
@@ -850,6 +850,8 @@ get_process_info(struct system_info *si,
 			continue;
 
 		PCTCPU(pp) = proc_calc_pctcpu(pp);
+		if (sel->thread && PCTCPU(pp) > 1.0)
+			PCTCPU(pp) = 1.0;
 		if (displaymode == DISP_CPU && !show_idle &&
 		    (!proc_used_cpu(pp) ||
 		     pp->ki_stat == SSTOP || pp->ki_stat == SIDL))

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 20:17:39 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C1071589;
 Fri, 20 Jun 2014 20:17:39 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A2BE62709;
 Fri, 20 Jun 2014 20:17:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KKHd3o006849;
 Fri, 20 Jun 2014 20:17:39 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KKHdgF006848;
 Fri, 20 Jun 2014 20:17:39 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201406202017.s5KKHdgF006848@svn.freebsd.org>
From: Michael Tuexen 
Date: Fri, 20 Jun 2014 20:17:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267688 - head/sys/netinet
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 20:17:39 -0000

Author: tuexen
Date: Fri Jun 20 20:17:39 2014
New Revision: 267688
URL: http://svnweb.freebsd.org/changeset/base/267688

Log:
  Fix a bug which incorrectly allowed two listening SCTP sockets on
  the same port bound to the wildcard address.
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_usrreq.c

Modified: head/sys/netinet/sctp_usrreq.c
==============================================================================
--- head/sys/netinet/sctp_usrreq.c	Fri Jun 20 20:17:03 2014	(r267687)
+++ head/sys/netinet/sctp_usrreq.c	Fri Jun 20 20:17:39 2014	(r267688)
@@ -6098,30 +6098,29 @@ sctp_listen(struct socket *so, int backl
 	if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE)) {
 		/* See if we have a listener */
 		struct sctp_inpcb *tinp;
-		union sctp_sockstore store, *sp;
+		union sctp_sockstore store;
 
-		sp = &store;
 		if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0) {
 			/* not bound all */
 			struct sctp_laddr *laddr;
 
 			LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) {
 				memcpy(&store, &laddr->ifa->address, sizeof(store));
-				switch (sp->sa.sa_family) {
+				switch (store.sa.sa_family) {
 #ifdef INET
 				case AF_INET:
-					sp->sin.sin_port = inp->sctp_lport;
+					store.sin.sin_port = inp->sctp_lport;
 					break;
 #endif
 #ifdef INET6
 				case AF_INET6:
-					sp->sin6.sin6_port = inp->sctp_lport;
+					store.sin6.sin6_port = inp->sctp_lport;
 					break;
 #endif
 				default:
 					break;
 				}
-				tinp = sctp_pcb_findep(&sp->sa, 0, 0, inp->def_vrf_id);
+				tinp = sctp_pcb_findep(&store.sa, 0, 0, inp->def_vrf_id);
 				if (tinp && (tinp != inp) &&
 				    ((tinp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) == 0) &&
 				    ((tinp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) &&
@@ -6139,20 +6138,6 @@ sctp_listen(struct socket *so, int backl
 		} else {
 			/* Setup a local addr bound all */
 			memset(&store, 0, sizeof(store));
-			switch (sp->sa.sa_family) {
-#ifdef INET
-			case AF_INET:
-				store.sin.sin_port = inp->sctp_lport;
-				break;
-#endif
-#ifdef INET6
-			case AF_INET6:
-				sp->sin6.sin6_port = inp->sctp_lport;
-				break;
-#endif
-			default:
-				break;
-			}
 #ifdef INET6
 			if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
 				store.sa.sa_family = AF_INET6;
@@ -6165,7 +6150,21 @@ sctp_listen(struct socket *so, int backl
 				store.sa.sa_len = sizeof(struct sockaddr_in);
 			}
 #endif
-			tinp = sctp_pcb_findep(&sp->sa, 0, 0, inp->def_vrf_id);
+			switch (store.sa.sa_family) {
+#ifdef INET
+			case AF_INET:
+				store.sin.sin_port = inp->sctp_lport;
+				break;
+#endif
+#ifdef INET6
+			case AF_INET6:
+				store.sin6.sin6_port = inp->sctp_lport;
+				break;
+#endif
+			default:
+				break;
+			}
+			tinp = sctp_pcb_findep(&store.sa, 0, 0, inp->def_vrf_id);
 			if (tinp && (tinp != inp) &&
 			    ((tinp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) == 0) &&
 			    ((tinp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) &&

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 20:28:47 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 700C1882;
 Fri, 20 Jun 2014 20:28:47 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5D76027E2;
 Fri, 20 Jun 2014 20:28:47 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KKSlEV011633;
 Fri, 20 Jun 2014 20:28:47 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KKSlHW011632;
 Fri, 20 Jun 2014 20:28:47 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201406202028.s5KKSlHW011632@svn.freebsd.org>
From: Navdeep Parhar 
Date: Fri, 20 Jun 2014 20:28:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267689 - head/sys/dev/cxgbe
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 20:28:47 -0000

Author: np
Date: Fri Jun 20 20:28:46 2014
New Revision: 267689
URL: http://svnweb.freebsd.org/changeset/base/267689

Log:
  Consider the total number of descriptors available (and not just those
  that are ready to be reclaimed) when deciding whether to resume tx after
  a stall.
  
  MFC after:	3 days

Modified:
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- head/sys/dev/cxgbe/t4_sge.c	Fri Jun 20 20:17:39 2014	(r267688)
+++ head/sys/dev/cxgbe/t4_sge.c	Fri Jun 20 20:28:46 2014	(r267689)
@@ -1771,7 +1771,7 @@ t4_wrq_tx_locked(struct adapter *sc, str
 
 	can_reclaim = reclaimable(eq);
 	if (__predict_false(eq->flags & EQ_STALLED)) {
-		if (can_reclaim < tx_resume_threshold(eq))
+		if (eq->avail + can_reclaim < tx_resume_threshold(eq))
 			return;
 		eq->flags &= ~EQ_STALLED;
 		eq->unstalled++;
@@ -1892,7 +1892,7 @@ t4_eth_tx(struct ifnet *ifp, struct sge_
 
 	can_reclaim = reclaimable(eq);
 	if (__predict_false(eq->flags & EQ_STALLED)) {
-		if (can_reclaim < tx_resume_threshold(eq)) {
+		if (eq->avail + can_reclaim < tx_resume_threshold(eq)) {
 			txq->m = m;
 			return (0);
 		}
@@ -2066,7 +2066,8 @@ t4_update_fl_bufsize(struct ifnet *ifp)
 int
 can_resume_tx(struct sge_eq *eq)
 {
-	return (reclaimable(eq) >= tx_resume_threshold(eq));
+
+	return (eq->avail + reclaimable(eq) >= tx_resume_threshold(eq));
 }
 
 static inline void

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 21:18:36 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2A3BF825;
 Fri, 20 Jun 2014 21:18:36 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1748B2C29;
 Fri, 20 Jun 2014 21:18:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KLIZvj035295;
 Fri, 20 Jun 2014 21:18:35 GMT (envelope-from hiren@svn.freebsd.org)
Received: (from hiren@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KLIZTx035294;
 Fri, 20 Jun 2014 21:18:35 GMT (envelope-from hiren@svn.freebsd.org)
Message-Id: <201406202118.s5KLIZTx035294@svn.freebsd.org>
From: Hiren Panchasara 
Date: Fri, 20 Jun 2014 21:18:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267690 - head/sys/dev/mpt
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 21:18:36 -0000

Author: hiren
Date: Fri Jun 20 21:18:35 2014
New Revision: 267690
URL: http://svnweb.freebsd.org/changeset/base/267690

Log:
  Hide a harmless "QUEUE FULL EVENT" message behind bootverbose.
  
  Requested by: A bunch of users on mailing-lists
  Suggested by: scottl
  MFC after:	1 week
  Sponsored by:	Yahoo! inc.

Modified:
  head/sys/dev/mpt/mpt_cam.c

Modified: head/sys/dev/mpt/mpt_cam.c
==============================================================================
--- head/sys/dev/mpt/mpt_cam.c	Fri Jun 20 20:28:46 2014	(r267689)
+++ head/sys/dev/mpt/mpt_cam.c	Fri Jun 20 21:18:35 2014	(r267690)
@@ -2449,8 +2449,11 @@ mpt_cam_event(struct mpt_softc *mpt, req
 
 		pqf = (PTR_EVENT_DATA_QUEUE_FULL)msg->Data;
 		pqf->CurrentDepth = le16toh(pqf->CurrentDepth);
-		mpt_prt(mpt, "QUEUE FULL EVENT: Bus 0x%02x Target 0x%02x Depth "
-		    "%d\n", pqf->Bus, pqf->TargetID, pqf->CurrentDepth);
+		if (bootverbose) {
+		    mpt_prt(mpt, "QUEUE FULL EVENT: Bus 0x%02x Target 0x%02x "
+			"Depth %d\n",
+			pqf->Bus, pqf->TargetID, pqf->CurrentDepth);
+		}
 		if (mpt->phydisk_sim && mpt_is_raid_member(mpt,
 		    pqf->TargetID) != 0) {
 			sim = mpt->phydisk_sim;

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 21:41:31 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1C527D56;
 Fri, 20 Jun 2014 21:41:31 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E498A2DF0;
 Fri, 20 Jun 2014 21:41:30 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KLfUC0047435;
 Fri, 20 Jun 2014 21:41:30 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KLfU2J047433;
 Fri, 20 Jun 2014 21:41:30 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201406202141.s5KLfU2J047433@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Fri, 20 Jun 2014 21:41:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267692 - head/usr.bin/sed
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 21:41:31 -0000

Author: pfg
Date: Fri Jun 20 21:41:30 2014
New Revision: 267692
URL: http://svnweb.freebsd.org/changeset/base/267692

Log:
  Add -u (unbuffered output) after GNU sed.
  
  Obtained from:	NetBSD
  MFC after:	1 week

Modified:
  head/usr.bin/sed/main.c
  head/usr.bin/sed/sed.1

Modified: head/usr.bin/sed/main.c
==============================================================================
--- head/usr.bin/sed/main.c	Fri Jun 20 21:35:39 2014	(r267691)
+++ head/usr.bin/sed/main.c	Fri Jun 20 21:41:30 2014	(r267692)
@@ -132,7 +132,7 @@ main(int argc, char *argv[])
 	fflag = 0;
 	inplace = NULL;
 
-	while ((c = getopt(argc, argv, "EI:ae:f:i:lnr")) != -1)
+	while ((c = getopt(argc, argv, "EI:ae:f:i:lnru")) != -1)
 		switch (c) {
 		case 'r':		/* Gnu sed compat */
 		case 'E':
@@ -168,6 +168,16 @@ main(int argc, char *argv[])
 		case 'n':
 			nflag = 1;
 			break;
+		case 'u':
+#ifdef _IONBF
+			c = setvbuf(stdout, NULL, _IONBF, 0);
+#else
+			c = -1;
+			errno = EOPNOTSUPP;
+#endif
+			if (c)
+				warnx("setting unbuffered output failed");
+			break;
 		default:
 		case '?':
 			usage();
@@ -199,9 +209,10 @@ main(int argc, char *argv[])
 static void
 usage(void)
 {
-	(void)fprintf(stderr, "%s\n%s\n",
-		"usage: sed script [-Ealn] [-i extension] [file ...]",
-		"       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]");
+	(void)fprintf(stderr,
+	    "usage: %s script [-Ealnru] [-i[]] [file ...]\n"
+	    "\t%s [-Ealnu] [-i[]] [-e script] ... [-f script_file]"
+	    " ... [file ...]\n", getprogname(), getprogname());
 	exit(1);
 }
 

Modified: head/usr.bin/sed/sed.1
==============================================================================
--- head/usr.bin/sed/sed.1	Fri Jun 20 21:35:39 2014	(r267691)
+++ head/usr.bin/sed/sed.1	Fri Jun 20 21:41:30 2014	(r267692)
@@ -31,7 +31,7 @@
 .\"	@(#)sed.1	8.2 (Berkeley) 12/30/93
 .\" $FreeBSD$
 .\"
-.Dd December 9, 2013
+.Dd June 20, 2014
 .Dt SED 1
 .Os
 .Sh NAME
@@ -39,7 +39,7 @@
 .Nd stream editor
 .Sh SYNOPSIS
 .Nm
-.Op Fl Ealnr
+.Op Fl Ealnru
 .Ar command
 .Op Ar
 .Nm
@@ -148,6 +148,8 @@ option suppresses this behavior.
 Same as
 .Fl E
 for compatibility with GNU sed.
+.It Fl u
+Make output unbuffered.
 .El
 .Pp
 The form of a

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 21:53:51 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7C9FB181;
 Fri, 20 Jun 2014 21:53:51 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6A8032F3C;
 Fri, 20 Jun 2014 21:53:51 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KLrpuR052772;
 Fri, 20 Jun 2014 21:53:51 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KLrpbu052771;
 Fri, 20 Jun 2014 21:53:51 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201406202153.s5KLrpbu052771@svn.freebsd.org>
From: Glen Barber 
Date: Fri, 20 Jun 2014 21:53:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267693 - head/usr.bin/grep
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 21:53:51 -0000

Author: gjb
Date: Fri Jun 20 21:53:50 2014
New Revision: 267693
URL: http://svnweb.freebsd.org/changeset/base/267693

Log:
  Fix a bug in bsdgrep(1) where patterns are not correctly
  detected.
  
  Certain criteria must be met for this bug to show up:
  
   * the -w flag is specified, and
   * neither -o or --color are specified, and
   * the pattern is part of another word in the line, and
   * the other word that contains the pattern occurs first
  
  PR:		181973
  MFC after:	3 days
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/usr.bin/grep/util.c

Modified: head/usr.bin/grep/util.c
==============================================================================
--- head/usr.bin/grep/util.c	Fri Jun 20 21:41:30 2014	(r267692)
+++ head/usr.bin/grep/util.c	Fri Jun 20 21:53:50 2014	(r267693)
@@ -336,7 +336,7 @@ procline(struct str *l, int nottext)
 		}
 
 		/* One pass if we are not recording matches */
-		if ((color == NULL && !oflag) || qflag || lflag)
+		if (!wflag && ((color == NULL && !oflag) || qflag || lflag))
 			break;
 
 		if (st == (size_t)pmatch.rm_so)

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 20 22:23:40 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 546F8D05;
 Fri, 20 Jun 2014 22:23:40 +0000 (UTC)
Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au
 [211.29.132.249])
 by mx1.freebsd.org (Postfix) with ESMTP id F232221C2;
 Fri, 20 Jun 2014 22:23:39 +0000 (UTC)
Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au
 (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133])
 by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id A000A104232B;
 Sat, 21 Jun 2014 07:59:43 +1000 (EST)
Date: Sat, 21 Jun 2014 07:59:41 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Pedro Giffuni 
Subject: Re: svn commit: r267675 - head/lib/libc/regex
In-Reply-To: <53A48D62.4060801@FreeBSD.org>
Message-ID: <20140621072634.I921@besplex.bde.org>
References: <201406201529.s5KFTAEB068038@svn.freebsd.org>
 <20140620182311.GA1214@mole.fafoe.narf.at> <53A48D62.4060801@FreeBSD.org>
MIME-Version: 1.0
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.1 cv=QIpRGG7L c=1 sm=1 tr=0
 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=N3HDhDx7WQ8A:10
 a=JzwRw_2MAAAA:8 a=nlC_4_pT8q9DhB4Ho9EA:9 a=cz2ZRIgtxKwA:10
 a=wJWlkF7cXJYA:10 a=AwX6RgfRnUsypwwKpHcA:9 a=45ClL6m2LaAA:10
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE
X-Content-Filtered-By: Mailman/MimeDel 2.1.18
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 Stefan Farfeleder , src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 20 Jun 2014 22:23:40 -0000


> El 6/20/2014 1:23 PM, Stefan Farfeleder escribi=F3:
>> On Fri, Jun 20, 2014 at 03:29:10PM +0000, Pedro F. Giffuni wrote:
>>> ...
>>> Log:
>>>    regex: Make use of reallocf().
>>>=20
>>>    Use of reallocf is useful in libraries as we are not certain the
>>>    application will exit after NULL.
>>> ...
>>>    This somewhat reduces portability but if since you are building
>>>    this as part of libc it is likely you have our non-standard
>>>    reallocf(3) already.

It also somewhat increases namespace pollution.

>>> Modified: head/lib/libc/regex/regcomp.c
>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>> --- head/lib/libc/regex/regcomp.c=09Fri Jun 20 13:26:49 2014=20
>>> (r267674)
>>> +++ head/lib/libc/regex/regcomp.c=09Fri Jun 20 15:29:09 2014=20
>>> (r267675)
>>> @@ -1111,7 +1111,7 @@ allocset(struct parse *p)
>>>   {
>>>   =09cset *cs, *ncs;
>>>=20
>>> -=09ncs =3D realloc(p->g->sets, (p->g->ncsets + 1) * sizeof(*ncs));
>>> +=09ncs =3D reallocf(p->g->sets, (p->g->ncsets + 1) * sizeof(*ncs));
>>>   =09if (ncs =3D=3D NULL) {
>>>   =09=09SETERROR(REG_ESPACE);
>>>   =09=09return (NULL);
>>> @@ -1174,7 +1174,7 @@ CHadd(struct parse *p, cset *cs, wint_t
>>>   =09if (ch < NC)
>>>   =09=09cs->bmp[ch >> 3] |=3D 1 << (ch & 7);
>>>   =09else {
>>> -=09=09newwides =3D realloc(cs->wides, (cs->nwides + 1) *
>>> +=09=09newwides =3D reallocf(cs->wides, (cs->nwides + 1) *
>>>   =09=09    sizeof(*cs->wides));
>>>   =09=09if (newwides =3D=3D NULL) {
>>>   =09=09=09SETERROR(REG_ESPACE);
>>=20
>> I don't think these changes are OK. If reallocf() fails here, the
>> cs->wides pointer will be freed and later freeset() will call
>> free(cs->wides), probably crashing. The other cases are most probably
>> similar though I haven't examined them closely.
>>=20
>
> OK ...
>
> I don't think there is any problem:
>
> If reallocf fails, newwides will be set to NULL and if free() is called i=
t=20
> doesn't do anything when the argument is NULL.
>
> Also freeset() is meant to be called to "free a now-unused set" and it is=
 not=20
> called within the library. I would think using a value when the allocatio=
n=20
> has failed is a much more serious issue than attempting to fail to free i=
t=20
> after trying to use it. ;-).

It doesn't look OK to me.  It turns the careful use of newwides, etc.,
into garbage, and leaves a garbage pointer in cs->wides, etc., to cause
problems later.  It might work without this careful use of a temporary
variable, but even that is not clear.  Consider:

- start with a consistent data structure with some pointers to malloced
   storage in it; foo->p say
- simple reallocf() allocation strategy:
     foo->p =3D reallocf(foo->p, size)
     if (foo->p =3D=3D NULL)
       return (ERROR);
   This leaves the data structure consistent if and only if the only thing
   in it relevant to p is p itself, with foo->p serving as a flag for
   validity.
- more complicated reallocf() allocation strategy:
     foo->p =3D reallocf(foo->p, size)
     if (foo->p =3D=3D NULL) {
       foo->psize =3D 0;
       foo->pvalid =3D 0;
       foo->foovalid =3D 0;
       ...
       return (ERROR);
     }
   This still can't do things like cleaning up what foo->p points to, since
   reallocf() clobbered that.
This shows that reallocf() is only useful in simple cases.  In general, you
must keep the pointer valid to clean things up:
     newp =3D reallocf(foo->p, size)
     if (newp =3D=3D NULL) {
       for (i =3D 0; i < foo->psize; i++)
 =09free(foo->p[i]);
       foo->p =3D NULL;
       foo->psize =3D 0;
       foo->pvalid =3D 0;
       foo->foovalid =3D 0;
       ...
       return (ERROR);
     }

Of course, malloc never fails so all this error checking is more a source
of complexity and bugs than useful.

Re-quoting/recovering some context:

@ Modified: head/lib/libc/regex/regcomp.c
@ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
@ --- head/lib/libc/regex/regcomp.c=09Fri Jun 20 13:26:49 2014=09(r267674)
@ +++ head/lib/libc/regex/regcomp.c=09Fri Jun 20 15:29:09 2014=09(r267675)
@ @@ -1111,7 +1111,7 @@ allocset(struct parse *p)
@  {
@  =09cset *cs, *ncs;
@=20
@ -=09ncs =3D realloc(p->g->sets, (p->g->ncsets + 1) * sizeof(*ncs));
@ +=09ncs =3D reallocf(p->g->sets, (p->g->ncsets + 1) * sizeof(*ncs));
@  =09if (ncs =3D=3D NULL) {
@  =09=09SETERROR(REG_ESPACE);
@  =09=09return (NULL);

This code shows that even Henry didn't know how to program memory allocatio=
n
in 1988.  The code was much worse in 4.4BSD-Lite2:

old@ =09=09if (p->g->sets =3D=3D NULL)
old@ =09=09=09p->g->sets =3D (cset *)malloc(nc * sizeof(cset));
old@ =09=09else
old@ =09=09=09p->g->sets =3D (cset *)realloc((char *)p->g->sets,
old@ =09=09=09=09=09=09=09nc * sizeof(cset));

This just leaked memory.  It was improved by assigning to ncs and by
removing the pre-C90 and C++ casts.  Now it is unimproved by turning the
careful use of ncs into garbage and leaving garbage in *p.

old@ =09=09if (p->g->setbits =3D=3D NULL)
old@ =09=09=09p->g->setbits =3D (uch *)malloc(nbytes);
old@ =09=09else {
old@ =09=09=09p->g->setbits =3D (uch *)realloc((char *)p->g->setbits,
old@ =09=09=09=09=09=09=09=09nbytes);
old@ =09=09=09/* xxx this isn't right if setbits is now NULL */
old@ =09=09=09for (i =3D 0; i < no; i++)
old@ =09=09=09=09p->g->sets[i].ptr =3D p->g->setbits + css*(i/CHAR_BIT);
old@ =09=09}

Honest memory mismanagement.  It just assumes that malloc() and realloc()
can't fail.  In -current, the function is much simpler and doesn't have
this code.  I think part of the simplication is to use realloc() of NULL
instead of malloc() to start up.

@ @@ -1174,7 +1174,7 @@ CHadd(struct parse *p, cset *cs, wint_t=20
@  =09if (ch < NC)
@  =09=09cs->bmp[ch >> 3] |=3D 1 << (ch & 7);
@  =09else {
@ -=09=09newwides =3D realloc(cs->wides, (cs->nwides + 1) *
@ +=09=09newwides =3D reallocf(cs->wides, (cs->nwides + 1) *
@  =09=09    sizeof(*cs->wides));
@  =09=09if (newwides =3D=3D NULL) {
@  =09=09=09SETERROR(REG_ESPACE);
@ @@ -1203,7 +1203,7 @@ CHaddrange(struct parse *p, cset *cs, wi
@  =09=09CHadd(p, cs, min);
@  =09if (min >=3D max)
@  =09=09return;
@ -=09newranges =3D realloc(cs->ranges, (cs->nranges + 1) *
@ +=09newranges =3D reallocf(cs->ranges, (cs->nranges + 1) *
@  =09    sizeof(*cs->ranges));
@  =09if (newranges =3D=3D NULL) {
@  =09=09SETERROR(REG_ESPACE);
@ @@ -1227,7 +1227,7 @@ CHaddtype(struct parse *p, cset *cs, wct
@  =09for (i =3D 0; i < NC; i++)
@  =09=09if (iswctype(i, wct))
@  =09=09=09CHadd(p, cs, i);
@ -=09newtypes =3D realloc(cs->types, (cs->ntypes + 1) *
@ +=09newtypes =3D reallocf(cs->types, (cs->ntypes + 1) *
@  =09    sizeof(*cs->types));
@  =09if (newtypes =3D=3D NULL) {
@  =09=09SETERROR(REG_ESPACE);
@ @@ -1350,7 +1350,7 @@ enlarge(struct parse *p, sopno size)
@  =09if (p->ssize >=3D size)
@  =09=09return 1;
@=20
@ -=09sp =3D (sop *)realloc(p->strip, size*sizeof(sop));
@ +=09sp =3D (sop *)reallocf(p->strip, size*sizeof(sop));
@  =09if (sp =3D=3D NULL) {
@  =09=09SETERROR(REG_ESPACE);
@  =09=09return 0;

Similarly in 4 more cases, except most of them weren't in old versions.

@ @@ -1368,7 +1368,7 @@ static void
@  stripsnug(struct parse *p, struct re_guts *g)
@  {
@  =09g->nstates =3D p->slen;
@ -=09g->strip =3D (sop *)realloc((char *)p->strip, p->slen * sizeof(sop));
@ +=09g->strip =3D (sop *)reallocf((char *)p->strip, p->slen * sizeof(sop))=
;
@  =09if (g->strip =3D=3D NULL) {
@  =09=09SETERROR(REG_ESPACE);
@  =09=09g->strip =3D p->strip;

This was the only realloc() that had not been cleaned up, so using
reallocf() has a chance of improving it.  It still has the pre-C90 and
C++ casts.  But there is an obvious new bug visible without reading more
than the patch context:
- the local variable might not be needed now, since the variable assigned
   to, g->strip, is different from the variable realloced, p->strip
- on realloc failure, p->strip becomes invalid
- the error handling is completely broken.  It points g->strip at the old
   (now deallocated) storage.  This is immediate use of the garbage pointer
   created by using reallocf().

Clearly, only realloc() code of the form "p =3D realloc(p, size);", where t=
he
pointer assigned to is the same as the pointer realloced, can be improved
by blindly converting it to use reallocf().

The last function is most interesting.  It seems to be to reduce the size.
So an allocation failure is even less likely than usually, except lots of
small allocations and reallocations are more likely to waste space than
save it.  But if failure occurs it is almost harmless, and the error
handling of keeping using the previous allocation was good.  Maybe Henry
knew how to program memory allocation after all.  (The last function
survived previously-unchanged from 4.4BSDLite-2 except for removing K&R
support and 'register'.)

Bruce
From owner-svn-src-head@FreeBSD.ORG  Sat Jun 21 00:53:57 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8C422155;
 Sat, 21 Jun 2014 00:53:57 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5E8FA2CC7;
 Sat, 21 Jun 2014 00:53:57 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5L0rvKk038938;
 Sat, 21 Jun 2014 00:53:57 GMT
 (envelope-from jhibbits@svn.freebsd.org)
Received: (from jhibbits@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5L0rvH7038936;
 Sat, 21 Jun 2014 00:53:57 GMT
 (envelope-from jhibbits@svn.freebsd.org)
Message-Id: <201406210053.s5L0rvH7038936@svn.freebsd.org>
From: Justin Hibbits 
Date: Sat, 21 Jun 2014 00:53:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267697 - head/sys/dev/adb
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 21 Jun 2014 00:53:57 -0000

Author: jhibbits
Date: Sat Jun 21 00:53:56 2014
New Revision: 267697
URL: http://svnweb.freebsd.org/changeset/base/267697

Log:
  No need to check if devd is running before posting an event.

Modified:
  head/sys/dev/adb/adb_buttons.c
  head/sys/dev/adb/adb_kbd.c

Modified: head/sys/dev/adb/adb_buttons.c
==============================================================================
--- head/sys/dev/adb/adb_buttons.c	Sat Jun 21 00:45:44 2014	(r267696)
+++ head/sys/dev/adb/adb_buttons.c	Sat Jun 21 00:53:56 2014	(r267697)
@@ -118,37 +118,32 @@ abtn_receive_packet(device_t dev, u_char
 
 	switch (cmd) {
 	case 0x0a:	/* decrease brightness */
-		if (devctl_process_running())
-			devctl_notify("PMU", "keys", "brightness",
-			    "notify=down");
+		devctl_notify("PMU", "keys", "brightness",
+		    "notify=down");
 		break;
 
 	case 0x09:	/* increase brightness */
-		if (devctl_process_running())
-			devctl_notify("PMU", "keys", "brightness", "notify=up");
+		devctl_notify("PMU", "keys", "brightness", "notify=up");
 		break;
 
 	case 0x08:	/* mute */
 	case 0x01:	/* mute, AV hardware */
-		if (devctl_process_running())
-			devctl_notify("PMU", "keys", "mute", NULL);
+		devctl_notify("PMU", "keys", "mute", NULL);
 		break;
 	case 0x07:	/* decrease volume */
 	case 0x02:	/* decrease volume, AV hardware */
-		if (devctl_process_running())
-			devctl_notify("PMU", "keys", "volume", "notify=down");
+		devctl_notify("PMU", "keys", "volume", "notify=down");
 		break;
 	case 0x06:	/* increase volume */
 	case 0x03:	/* increase volume, AV hardware */
-		if (devctl_process_running())
-			devctl_notify("PMU", "keys", "volume", "notify=up");
+		devctl_notify("PMU", "keys", "volume", "notify=up");
 		break;
 	case 0x0c:	/* mirror display key */
 		/* Need callback to do something with this */
 		break;
 	case 0x0b:	/* eject tray */
-		if (devctl_process_running())
-			devctl_notify("PMU", "keys", "eject", NULL);
+		devctl_notify("PMU", "keys", "eject", NULL);
+		break;
 	case 0x7f:	/* numlock */
 		/* Need callback to do something with this */
 		break;

Modified: head/sys/dev/adb/adb_kbd.c
==============================================================================
--- head/sys/dev/adb/adb_kbd.c	Sat Jun 21 00:45:44 2014	(r267696)
+++ head/sys/dev/adb/adb_kbd.c	Sat Jun 21 00:53:56 2014	(r267697)
@@ -424,7 +424,7 @@ adb_kbd_receive_packet(device_t dev, u_c
 
 	mtx_lock(&sc->sc_mutex);
 		/* 0x7f is always the power button */
-		if (data[0] == 0x7f && devctl_process_running()) {
+		if (data[0] == 0x7f) {
 			devctl_notify("PMU", "Button", "pressed", NULL);
 			mtx_unlock(&sc->sc_mutex);
 			return (0);

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 21 01:16:16 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5B1F18E5
 for ; Sat, 21 Jun 2014 01:16:16 +0000 (UTC)
Received: from nm26-vm0.bullet.mail.bf1.yahoo.com
 (nm26-vm0.bullet.mail.bf1.yahoo.com [98.139.213.74])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 094012E5D
 for ; Sat, 21 Jun 2014 01:16:15 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1403313014; bh=0IEd4U0iLcATHZkXGPs9Y9VGyj60crFlhlywllZ/MnM=;
 h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer;
 b=VKJY8DrkcYz3Oe/SDLNdWCuOaYGkD2rphb/HGbtGVPesQlKE/s2h4gUZslArACz/Z+OXasHZD562r8x6iVe32seuIzpyevoSZIHmhxCMr2hK/TJrpPr15iradQ09+hhidIC2EkdpsQKft/HwXZOVECStec/yNGRL01hJ7soyy+pkNDZQfOLZ6wyJ1R5nE+kpEfr6Q3d9Hqe0F8Bom9FagxIp2VszbLJry8tNDfltzJvMl5aVVlrX2pukpJN5yvPwI+ASsV8JS+bIiKKhO/riJcEny/uiCNM6t72HOCFn4bCU+jJ2eHTIFj8TurOc4osSxDP6dnw50iyiBEz2+6Cf/w==
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com;
 b=lZvWuZyEh7JF+vJVVYCi8gpwzb/ki4cKMa0oCfFZ1wNsTPp6VMOiScU/8rosuaEmJ28BmiD2YG4jowf9HOb0T/abaMCp+jSb3m2Q2Ur4hsgd7VPeU7Ix1lcyR2JFT+af1Rm2+3eZByJd6CRClbInZbgYyoLmI6eQ5TxjR0NWgJ+z60Se02IKmV4o6L6TvGNaxH2CUcqbOmOHD2eh2xovW8p/R/y2q2Ry9ie0/x9fgevkGQ+b1EZfhU9NgcR7M3yhN160dyzQ9ET/t9DxfJPeb0WGoIv+Z5EO9293GhzFcRiGB2jjlVgq2g9R5KCjRVmwdZ4u735V6i6Xj5PFf+5z5Q==;
Received: from [66.196.81.174] by nm26.bullet.mail.bf1.yahoo.com with NNFMP;
 21 Jun 2014 01:10:14 -0000
Received: from [98.139.211.160] by tm20.bullet.mail.bf1.yahoo.com with NNFMP;
 21 Jun 2014 01:10:14 -0000
Received: from [127.0.0.1] by smtp217.mail.bf1.yahoo.com with NNFMP;
 21 Jun 2014 01:10:14 -0000
X-Yahoo-Newman-Id: 48125.62604.bm@smtp217.mail.bf1.yahoo.com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: _ciFXCcVM1mX080aTWe0oxHA5U1NFuBCdRgJPQR.57UOn.8
 R7ivk38I6Sug36XsJmIEqqK7ze5G1Y3Oa9s8M0mQY_t8Pkyw0Fw.YUmIQvek
 5hJh9mGdg7TxZRW4.rrPfy1H3lrqkfpPJtqDnZcuDRTfKi8iK8JL0jwuiEYx
 QquONScyefuBvbgtj4T8KSOr7yxYNTKS_lzpcOvgYZRqIlFSoqhmQ6GErdJS
 EbndRvKTYvvjD4IioBeYgjsfCeB7GmY7I9q8wl_Stkc6nyR6aq_gTuEjONDF
 3Fecjop8KkqFPoab.ZTP1Y4tVDjIHj2mLVnZ5XaclabRmAjk.nyba_C4WpmD
 aqlGKvl0MfXFLqjH9Y0eDEq8dgUaCVh6wywHxy7SZia2qFTzrmPqaz3IPQ4W
 zyKOeqXdP4AtyythMRvTio4eOwwWXYHE45XssmJAk.gAfWh0tOzb2j3IgJb.
 .6Hk4w3hyy3bD_DFoOfQxbfp8e3qc.R3nFsGcHL9T_Gp2b6f22XNQYvB9Pcu
 RH9c8PzBivKHgRMjjiY0-
X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf
X-Rocket-Received: from [192.168.0.101] (pfg@190.157.126.109 with plain
 [98.139.211.125])
 by smtp217.mail.bf1.yahoo.com with SMTP; 20 Jun 2014 18:10:13 -0700 PDT
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r267675 - head/lib/libc/regex
From: Pedro Giffuni 
In-Reply-To: <20140621072634.I921@besplex.bde.org>
Date: Fri, 20 Jun 2014 20:10:11 -0500
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201406201529.s5KFTAEB068038@svn.freebsd.org>
 <20140620182311.GA1214@mole.fafoe.narf.at> <53A48D62.4060801@FreeBSD.org>
 <20140621072634.I921@besplex.bde.org>
To: Bruce Evans 
X-Mailer: Apple Mail (2.1878.2)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 Stefan Farfeleder , src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 21 Jun 2014 01:16:16 -0000


Il giorno 20/giu/2014, alle ore 16:59, Bruce Evans =
 ha scritto:

>=20
>> El 6/20/2014 1:23 PM, Stefan Farfeleder escribi=F3:
>>> On Fri, Jun 20, 2014 at 03:29:10PM +0000, Pedro F. Giffuni wrote:
>>>> ...
>>>> Log:
>>>>   regex: Make use of reallocf().
>>>>   Use of reallocf is useful in libraries as we are not certain the
>>>>   application will exit after NULL.
>>>> ...
>>>>   This somewhat reduces portability but if since you are building
>>>>   this as part of libc it is likely you have our non-standard
>>>>   reallocf(3) already.
>=20
> It also somewhat increases namespace pollution.
>=20
>>>> Modified: head/lib/libc/regex/regcomp.c
>>>> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
>>>> --- head/lib/libc/regex/regcomp.c	Fri Jun 20 13:26:49 2014 =
(r267674)
>>>> +++ head/lib/libc/regex/regcomp.c	Fri Jun 20 15:29:09 2014 =
(r267675)
>>>> @@ -1111,7 +1111,7 @@ allocset(struct parse *p)
>>>>  {
>>>>  	cset *cs, *ncs;
>>>> -	ncs =3D realloc(p->g->sets, (p->g->ncsets + 1) * sizeof(*ncs));
>>>> +	ncs =3D reallocf(p->g->sets, (p->g->ncsets + 1) * sizeof(*ncs));
>>>>  	if (ncs =3D=3D NULL) {
>>>>  		SETERROR(REG_ESPACE);
>>>>  		return (NULL);
>>>> @@ -1174,7 +1174,7 @@ CHadd(struct parse *p, cset *cs, wint_t
>>>>  	if (ch < NC)
>>>>  		cs->bmp[ch >> 3] |=3D 1 << (ch & 7);
>>>>  	else {
>>>> -		newwides =3D realloc(cs->wides, (cs->nwides + 1) *
>>>> +		newwides =3D reallocf(cs->wides, (cs->nwides + 1) *
>>>>  		    sizeof(*cs->wides));
>>>>  		if (newwides =3D=3D NULL) {
>>>>  			SETERROR(REG_ESPACE);
>>> I don't think these changes are OK. If reallocf() fails here, the
>>> cs->wides pointer will be freed and later freeset() will call
>>> free(cs->wides), probably crashing. The other cases are most =
probably
>>> similar though I haven't examined them closely.
>>=20
>> OK ...
>>=20
>> I don't think there is any problem:
>>=20
>> If reallocf fails, newwides will be set to NULL and if free() is =
called it doesn't do anything when the argument is NULL.
>>=20
>> Also freeset() is meant to be called to "free a now-unused set" and =
it is not called within the library. I would think using a value when =
the allocation has failed is a much more serious issue than attempting =
to fail to free it after trying to use it. ;-).
>=20
> It doesn't look OK to me.  It turns the careful use of newwides, etc.,
> into garbage, and leaves a garbage pointer in cs->wides, etc., to =
cause
> problems later.  It might work without this careful use of a temporary
> variable, but even that is not clear.  Consider:
>=20
> - start with a consistent data structure with some pointers to =
malloced
>  storage in it; foo->p say
> - simple reallocf() allocation strategy:
>    foo->p =3D reallocf(foo->p, size)
>    if (foo->p =3D=3D NULL)
>      return (ERROR);
>  This leaves the data structure consistent if and only if the only =
thing
>  in it relevant to p is p itself, with foo->p serving as a flag for
>  validity.
> - more complicated reallocf() allocation strategy:
>    foo->p =3D reallocf(foo->p, size)
>    if (foo->p =3D=3D NULL) {
>      foo->psize =3D 0;
>      foo->pvalid =3D 0;
>      foo->foovalid =3D 0;
>      ...
>      return (ERROR);
>    }
>  This still can't do things like cleaning up what foo->p points to, =
since
>  reallocf() clobbered that.
> This shows that reallocf() is only useful in simple cases.  In =
general, you
> must keep the pointer valid to clean things up:
>    newp =3D reallocf(foo->p, size)
>    if (newp =3D=3D NULL) {
>      for (i =3D 0; i < foo->psize; i++)
> 	free(foo->p[i]);
>      foo->p =3D NULL;
>      foo->psize =3D 0;
>      foo->pvalid =3D 0;
>      foo->foovalid =3D 0;
>      ...
>      return (ERROR);
>    }
>=20
> Of course, malloc never fails so all this error checking is more a =
source
> of complexity and bugs than useful.
>=20

This is interesting, however I have problems understanding that a =
library would let you ignore an error condition and pass you garbage as =
part of it=92s normal behavior. Plus being a standard library I am not =
sure if you can count on other implementations doing the same ...


> Re-quoting/recovering some context:
>=20
> @ Modified: head/lib/libc/regex/regcomp.c
> @ =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> @ --- head/lib/libc/regex/regcomp.c	Fri Jun 20 13:26:49 2014	=
(r267674)
> @ +++ head/lib/libc/regex/regcomp.c	Fri Jun 20 15:29:09 2014	=
(r267675)
> @ @@ -1111,7 +1111,7 @@ allocset(struct parse *p)
> @  {
> @  	cset *cs, *ncs;
> @ @ -	ncs =3D realloc(p->g->sets, (p->g->ncsets + 1) * sizeof(*ncs));
> @ +	ncs =3D reallocf(p->g->sets, (p->g->ncsets + 1) * sizeof(*ncs));
> @  	if (ncs =3D=3D NULL) {
> @  		SETERROR(REG_ESPACE);
> @  		return (NULL);
>=20
> This code shows that even Henry didn't know how to program memory =
allocation
> in 1988.  The code was much worse in 4.4BSD-Lite2:
>=20
> old@ 		if (p->g->sets =3D=3D NULL)
> old@ 			p->g->sets =3D (cset *)malloc(nc * =
sizeof(cset));
> old@ 		else
> old@ 			p->g->sets =3D (cset *)realloc((char =
*)p->g->sets,
> old@ 							nc * =
sizeof(cset));
>=20
> This just leaked memory.  It was improved by assigning to ncs and by
> removing the pre-C90 and C++ casts.  Now it is unimproved by turning =
the
> careful use of ncs into garbage and leaving garbage in *p.
>=20
> old@ 		if (p->g->setbits =3D=3D NULL)
> old@ 			p->g->setbits =3D (uch *)malloc(nbytes);
> old@ 		else {
> old@ 			p->g->setbits =3D (uch *)realloc((char =
*)p->g->setbits,
> old@ 								nbytes);
> old@ 			/* xxx this isn't right if setbits is now NULL =
*/
> old@ 			for (i =3D 0; i < no; i++)
> old@ 				p->g->sets[i].ptr =3D p->g->setbits + =
css*(i/CHAR_BIT);
> old@ 		}
>=20
> Honest memory mismanagement.  It just assumes that malloc() and =
realloc()
> can't fail.  In -current, the function is much simpler and doesn't =
have
> this code.  I think part of the simplication is to use realloc() of =
NULL
> instead of malloc() to start up.
>=20
> @ @@ -1174,7 +1174,7 @@ CHadd(struct parse *p, cset *cs, wint_t @  	=
if (ch < NC)
> @  		cs->bmp[ch >> 3] |=3D 1 << (ch & 7);
> @  	else {
> @ -		newwides =3D realloc(cs->wides, (cs->nwides + 1) *
> @ +		newwides =3D reallocf(cs->wides, (cs->nwides + 1) *
> @  		    sizeof(*cs->wides));
> @  		if (newwides =3D=3D NULL) {
> @  			SETERROR(REG_ESPACE);
> @ @@ -1203,7 +1203,7 @@ CHaddrange(struct parse *p, cset *cs, wi
> @  		CHadd(p, cs, min);
> @  	if (min >=3D max)
> @  		return;
> @ -	newranges =3D realloc(cs->ranges, (cs->nranges + 1) *
> @ +	newranges =3D reallocf(cs->ranges, (cs->nranges + 1) *
> @  	    sizeof(*cs->ranges));
> @  	if (newranges =3D=3D NULL) {
> @  		SETERROR(REG_ESPACE);
> @ @@ -1227,7 +1227,7 @@ CHaddtype(struct parse *p, cset *cs, wct
> @  	for (i =3D 0; i < NC; i++)
> @  		if (iswctype(i, wct))
> @  			CHadd(p, cs, i);
> @ -	newtypes =3D realloc(cs->types, (cs->ntypes + 1) *
> @ +	newtypes =3D reallocf(cs->types, (cs->ntypes + 1) *
> @  	    sizeof(*cs->types));
> @  	if (newtypes =3D=3D NULL) {
> @  		SETERROR(REG_ESPACE);
> @ @@ -1350,7 +1350,7 @@ enlarge(struct parse *p, sopno size)
> @  	if (p->ssize >=3D size)
> @  		return 1;
> @ @ -	sp =3D (sop *)realloc(p->strip, size*sizeof(sop));
> @ +	sp =3D (sop *)reallocf(p->strip, size*sizeof(sop));
> @  	if (sp =3D=3D NULL) {
> @  		SETERROR(REG_ESPACE);
> @  		return 0;
>=20
> Similarly in 4 more cases, except most of them weren't in old =
versions.
>=20
> @ @@ -1368,7 +1368,7 @@ static void
> @  stripsnug(struct parse *p, struct re_guts *g)
> @  {
> @  	g->nstates =3D p->slen;
> @ -	g->strip =3D (sop *)realloc((char *)p->strip, p->slen * =
sizeof(sop));
> @ +	g->strip =3D (sop *)reallocf((char *)p->strip, p->slen * =
sizeof(sop));
> @  	if (g->strip =3D=3D NULL) {
> @  		SETERROR(REG_ESPACE);
> @  		g->strip =3D p->strip;
>=20
> This was the only realloc() that had not been cleaned up, so using
> reallocf() has a chance of improving it.  It still has the pre-C90 and
> C++ casts.  But there is an obvious new bug visible without reading =
more
> than the patch context:
> - the local variable might not be needed now, since the variable =
assigned
>  to, g->strip, is different from the variable realloced, p->strip
> - on realloc failure, p->strip becomes invalid
> - the error handling is completely broken.  It points g->strip at the =
old
>  (now deallocated) storage.  This is immediate use of the garbage =
pointer
>  created by using reallocf().
>=20
> Clearly, only realloc() code of the form "p =3D realloc(p, size);", =
where the
> pointer assigned to is the same as the pointer realloced, can be =
improved
> by blindly converting it to use reallocf().
>=20

Ah yes, my fault there.

> The last function is most interesting.  It seems to be to reduce the =
size.
> So an allocation failure is even less likely than usually, except lots =
of
> small allocations and reallocations are more likely to waste space =
than
> save it.  But if failure occurs it is almost harmless, and the error
> handling of keeping using the previous allocation was good.  Maybe =
Henry
> knew how to program memory allocation after all.  (The last function
> survived previously-unchanged from 4.4BSDLite-2 except for removing =
K&R
> support and 'register=92.

OK, it=92s pretty tricky, but I agree that reallocf() simply won=92t do =
anything here. I will revert.

Thanks!

Pedro.


From owner-svn-src-head@FreeBSD.ORG  Sat Jun 21 01:43:57 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2A9E01B2;
 Sat, 21 Jun 2014 01:43:57 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id F11CF208C;
 Sat, 21 Jun 2014 01:43:56 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5L1huWQ062216;
 Sat, 21 Jun 2014 01:43:56 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5L1huvg062215;
 Sat, 21 Jun 2014 01:43:56 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201406210143.s5L1huvg062215@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Sat, 21 Jun 2014 01:43:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267700 - head/lib/libc/regex
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 21 Jun 2014 01:43:57 -0000

Author: pfg
Date: Sat Jun 21 01:43:56 2014
New Revision: 267700
URL: http://svnweb.freebsd.org/changeset/base/267700

Log:
  Revert r267675:
  
  The code doesn't really benefit of using reallocf() in this case.
  Also, the realloc() results being assigned temporary variable which
  makes blind replacement with reallocf() mostly useless.
  
  Pointed out by:		stefanf, bde

Modified:
  head/lib/libc/regex/regcomp.c

Modified: head/lib/libc/regex/regcomp.c
==============================================================================
--- head/lib/libc/regex/regcomp.c	Sat Jun 21 01:11:59 2014	(r267699)
+++ head/lib/libc/regex/regcomp.c	Sat Jun 21 01:43:56 2014	(r267700)
@@ -1111,7 +1111,7 @@ allocset(struct parse *p)
 {
 	cset *cs, *ncs;
 
-	ncs = reallocf(p->g->sets, (p->g->ncsets + 1) * sizeof(*ncs));
+	ncs = realloc(p->g->sets, (p->g->ncsets + 1) * sizeof(*ncs));
 	if (ncs == NULL) {
 		SETERROR(REG_ESPACE);
 		return (NULL);
@@ -1174,7 +1174,7 @@ CHadd(struct parse *p, cset *cs, wint_t 
 	if (ch < NC)
 		cs->bmp[ch >> 3] |= 1 << (ch & 7);
 	else {
-		newwides = reallocf(cs->wides, (cs->nwides + 1) *
+		newwides = realloc(cs->wides, (cs->nwides + 1) *
 		    sizeof(*cs->wides));
 		if (newwides == NULL) {
 			SETERROR(REG_ESPACE);
@@ -1203,7 +1203,7 @@ CHaddrange(struct parse *p, cset *cs, wi
 		CHadd(p, cs, min);
 	if (min >= max)
 		return;
-	newranges = reallocf(cs->ranges, (cs->nranges + 1) *
+	newranges = realloc(cs->ranges, (cs->nranges + 1) *
 	    sizeof(*cs->ranges));
 	if (newranges == NULL) {
 		SETERROR(REG_ESPACE);
@@ -1227,7 +1227,7 @@ CHaddtype(struct parse *p, cset *cs, wct
 	for (i = 0; i < NC; i++)
 		if (iswctype(i, wct))
 			CHadd(p, cs, i);
-	newtypes = reallocf(cs->types, (cs->ntypes + 1) *
+	newtypes = realloc(cs->types, (cs->ntypes + 1) *
 	    sizeof(*cs->types));
 	if (newtypes == NULL) {
 		SETERROR(REG_ESPACE);
@@ -1350,7 +1350,7 @@ enlarge(struct parse *p, sopno size)
 	if (p->ssize >= size)
 		return 1;
 
-	sp = (sop *)reallocf(p->strip, size*sizeof(sop));
+	sp = (sop *)realloc(p->strip, size*sizeof(sop));
 	if (sp == NULL) {
 		SETERROR(REG_ESPACE);
 		return 0;
@@ -1368,7 +1368,7 @@ static void
 stripsnug(struct parse *p, struct re_guts *g)
 {
 	g->nstates = p->slen;
-	g->strip = (sop *)reallocf((char *)p->strip, p->slen * sizeof(sop));
+	g->strip = (sop *)realloc((char *)p->strip, p->slen * sizeof(sop));
 	if (g->strip == NULL) {
 		SETERROR(REG_ESPACE);
 		g->strip = p->strip;

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 21 05:47:57 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id F2AD73EA;
 Sat, 21 Jun 2014 05:47:56 +0000 (UTC)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 932182246;
 Sat, 21 Jun 2014 05:47:56 +0000 (UTC)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s5L5liWh076558;
 Sat, 21 Jun 2014 08:47:44 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s5L5liWh076558
Received: (from kostik@localhost)
 by tom.home (8.14.9/8.14.8/Submit) id s5L5liWQ076557;
 Sat, 21 Jun 2014 08:47:44 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Sat, 21 Jun 2014 08:47:44 +0300
From: Konstantin Belousov 
To: "Pedro F. Giffuni" 
Subject: Re: svn commit: r267692 - head/usr.bin/sed
Message-ID: <20140621054744.GN3991@kib.kiev.ua>
References: <201406202141.s5KLfU2J047433@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="Qf+2chOW7Mplyx0V"
Content-Disposition: inline
In-Reply-To: <201406202141.s5KLfU2J047433@svn.freebsd.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 autolearn_force=no version=3.4.0
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 21 Jun 2014 05:47:57 -0000


--Qf+2chOW7Mplyx0V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Jun 20, 2014 at 09:41:30PM +0000, Pedro F. Giffuni wrote:
> Author: pfg
> Date: Fri Jun 20 21:41:30 2014
> New Revision: 267692
> URL: http://svnweb.freebsd.org/changeset/base/267692
>=20
> Log:
>   Add -u (unbuffered output) after GNU sed.
>  =20
>   Obtained from:	NetBSD
>   MFC after:	1 week
>=20
> Modified:
>   head/usr.bin/sed/main.c
>   head/usr.bin/sed/sed.1
>=20
> Modified: head/usr.bin/sed/main.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/usr.bin/sed/main.c	Fri Jun 20 21:35:39 2014	(r267691)
> +++ head/usr.bin/sed/main.c	Fri Jun 20 21:41:30 2014	(r267692)
> @@ -132,7 +132,7 @@ main(int argc, char *argv[])
>  	fflag =3D 0;
>  	inplace =3D NULL;
> =20
> -	while ((c =3D getopt(argc, argv, "EI:ae:f:i:lnr")) !=3D -1)
> +	while ((c =3D getopt(argc, argv, "EI:ae:f:i:lnru")) !=3D -1)
>  		switch (c) {
>  		case 'r':		/* Gnu sed compat */
>  		case 'E':
> @@ -168,6 +168,16 @@ main(int argc, char *argv[])
>  		case 'n':
>  			nflag =3D 1;
>  			break;
> +		case 'u':
> +#ifdef _IONBF
> +			c =3D setvbuf(stdout, NULL, _IONBF, 0);
> +#else
> +			c =3D -1;
> +			errno =3D EOPNOTSUPP;
> +#endif
> +			if (c)

Why doing it that way ? IMO the conditional is useless and even wrong.
FreeBSD provides the _IONBF, _IONBF is required by C99.

If some other system lacks _IONBF, it should get compiler error instead
of silently accepting non-working code.

--Qf+2chOW7Mplyx0V
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJTpRyAAAoJEJDCuSvBvK1BxWUP/2P8sJecoOoysvFOIfuk+tem
19X0b+4607/qNrLaLMBMxlW+LEMBPsUSGPGb6OKf5Z75iZLevAs3fl35DpYSUX8c
RqUDHq0ORz+AXFldCZlRFcD0rTpe76vjGFgE5qE16fUuXuweZ9AmVIBU5jn0CrsC
+KmD1lULMypw05m15OGttUfJCBvUo9ybOSsUFM65Vy/9RQHEVCrgeKw1i/fO5PqV
DB8t3TsnTcohqLa51CH7cG6ceAlBi4tZD0oScgEMr5+HHsRYG95cSjVf4TapV2T+
LwFvDZAMvYnjb3M3TILzwzjLZg0jqwFhASimt/AaJ7GREU4eEnPWJsPRr0MFS53K
bK7oHxYuL5BmS+K/g3rkwu1TyJREZtYfqgfZ28fSH9JKaXrbqAS1ZrmSbR1+eMlw
nizT6GcI7azw1NnvhfmyTNIByxAczeootcNSI1FHYAYjZWqIxYlZ75omW7LILsvz
CjoZjNS+mLvjiG0y3ZJoYmrs3u1GpbR/zuhAemk5UeIeNdX6o/JffbLyULIRAhGl
BANT34ip8je1UJdDB1tXmyJMo+LLT2hLvz2Kcd+6rcd9vY45qzMrf/saWkX+OoWU
pNOIMX1myQovyjw/7UBO17gCFqqGkYYf2J6HPUNZllZ1kEiUYWeGiOJrdAMnn2/l
PBH4g6M3hVVPesPOUig2
=HRIf
-----END PGP SIGNATURE-----

--Qf+2chOW7Mplyx0V--

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 21 06:06:15 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4F2C266A
 for ; Sat, 21 Jun 2014 06:06:15 +0000 (UTC)
Received: from nm21.bullet.mail.bf1.yahoo.com (nm21.bullet.mail.bf1.yahoo.com
 [98.139.212.180])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id F18102390
 for ; Sat, 21 Jun 2014 06:06:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1403330767; bh=ORJl3h+5mUSwo4vyJrMXvRKqMWLh9763nD6jbvPuK6g=;
 h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Message-Id:References:To:X-Mailer;
 b=FOeuer13n4WoMOS4xu6QPuFRc8AlIjAGgtM8L5bIg4T0iplmRsspC08TSB2v2FiZ7/HiEgKilWuYvNoqZ2sb81aE2HvjkhMRYwt97NC38Dkg13xF/JtpMcXvUZvlxMaXyW+Q9sy0bRtc88s5IgCow9R+EDdggDF9c/XkwxWK7XkkfGUmnovovgVYsPO1nlrvI9dTVlfgtNbWHi/7rQmXrVU4hvryzdRWJ75oe3iy8UTJ1j3wgaltyOHancWhQHpsY87K4NqFGKPtZkA4+v7XvT4Zzf7twipOopM664xTmI6S5ypDzsEsu6eFfYc/VVEtbjzO9oiCJCnfV9bH56m2LQ==
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com;
 b=jDbQEanpMRmg2VG4qOPo4USm4BL3O7GtdFKTfGJ6GeRqPIvGO8M1ojOxBEBdCZsTSetICq1kYD8ESpamAd4xHNT4SOUL6sXqZ+1xRfxZ2hrV5Wy9vDhNsfM8b8VgWTRuMBEQyf86zh1XNrxkKSgsGYZPCSDclncmiS9jZ4dnFM3yfZEbmJKaAaJBe1EjxbqMt7wNgrHJW/ZFViBN71imDzYP2HSC9dXaVKHU6o83OzPxu/zZqlNH/2+rFxQPZ35L8cmVhzV8nKMdaL6o0mgofWS9PSXAyIT/0vRFPzmMl8/RKr8YZ4h0Ff9lw5ltZGvRwt5v+6oxc0N1XAd8AAnRHg==;
Received: from [98.139.215.142] by nm21.bullet.mail.bf1.yahoo.com with NNFMP;
 21 Jun 2014 06:06:07 -0000
Received: from [98.139.211.196] by tm13.bullet.mail.bf1.yahoo.com with NNFMP;
 21 Jun 2014 06:06:07 -0000
Received: from [127.0.0.1] by smtp205.mail.bf1.yahoo.com with NNFMP;
 21 Jun 2014 06:06:07 -0000
X-Yahoo-Newman-Id: 373701.91850.bm@smtp205.mail.bf1.yahoo.com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: liHOSqoVM1mNjNTZqvQeUWkXFsdH7gYsVC4QimmpYNzT7uL
 _REAicS2iIielH2fBRo79N52CmjqwaGaB60Z1gZAA7vWmhULw.bPmRDdNACx
 ZYOJwLBuzWy63TNx8glQumbK.x83snih1D3bfyp2.oIKAVzE6Wx.ah6IUeCa
 BGpNVLWp0KzNj_nO99Psdhisax4.ZUstMbk0KPwlaj66gWbZJ5Us0pHxGkTP
 czQtMlpLGhmwS271Cms27SRJ7a4Y81VQUozXXjM7NJYvyDaUcFkbLFig5Csc
 UJQX4dMMBWYhaKM2hkBjS2PGeSa6g5OpowuGmOS4NeAnwZ0lWZeD7znkJ1cP
 RCsa4dAZ1wbGT1m8kTdLI6JXW0kDo9e13PYdFTSShNDU6ue3j6IJlpXb4M1m
 Hw55yil1aHKxeX2R71JsvSYys1Uj1ZDxIXPi9HFBU4VJzxAcMYzGOsCDyjbr
 yKDPpFnR2GpNgYjGBc5VGzVBbWaBLSn0YskG3g6k.Mv7k0QSjK4VPBN3m7Yk
 vCY.o1dyOr65bYqbL39SSi2Fm6QjeM1UoFQfCKO8PmbvpVmQULU0nQMWeIoH
 Iu07JVGR0c.0eyJa.AVfdR6Z6mhXgWKuwNdBMii8lGDAbBJ1avUsX7gPPsfR wM5Mi
X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf
X-Rocket-Received: from [192.168.0.101] (pfg@190.157.126.109 with plain
 [63.250.193.228])
 by smtp205.mail.bf1.yahoo.com with SMTP; 20 Jun 2014 23:06:07 -0700 PDT
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r267692 - head/usr.bin/sed
From: Pedro Giffuni 
In-Reply-To: <20140621054744.GN3991@kib.kiev.ua>
Date: Sat, 21 Jun 2014 01:06:02 -0500
Message-Id: 
References: <201406202141.s5KLfU2J047433@svn.freebsd.org>
 <20140621054744.GN3991@kib.kiev.ua>
To: Konstantin Belousov 
X-Mailer: Apple Mail (2.1878.2)
Content-Type: text/plain;
	charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-Content-Filtered-By: Mailman/MimeDel 2.1.18
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 21 Jun 2014 06:06:15 -0000


Il giorno 21/giu/2014, alle ore 00:47, Konstantin Belousov =
 ha scritto:

> On Fri, Jun 20, 2014 at 09:41:30PM +0000, Pedro F. Giffuni wrote:
>> Author: pfg
>> Date: Fri Jun 20 21:41:30 2014
>> New Revision: 267692
>> URL: http://svnweb.freebsd.org/changeset/base/267692
>>=20
>> Log:
>>  Add -u (unbuffered output) after GNU sed.
>>=20
>>  Obtained from:	NetBSD
>>  MFC after:	1 week
>>=20
>> Modified:
>>  head/usr.bin/sed/main.c
>>  head/usr.bin/sed/sed.1
>>=20
>> Modified: head/usr.bin/sed/main.c
>> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
>> --- head/usr.bin/sed/main.c	Fri Jun 20 21:35:39 2014	=
(r267691)
>> +++ head/usr.bin/sed/main.c	Fri Jun 20 21:41:30 2014	=
(r267692)
>> @@ -132,7 +132,7 @@ main(int argc, char *argv[])
>> 	fflag =3D 0;
>> 	inplace =3D NULL;
>>=20
>> -	while ((c =3D getopt(argc, argv, "EI:ae:f:i:lnr")) !=3D -1)
>> +	while ((c =3D getopt(argc, argv, "EI:ae:f:i:lnru")) !=3D -1)
>> 		switch (c) {
>> 		case 'r':		/* Gnu sed compat */
>> 		case 'E':
>> @@ -168,6 +168,16 @@ main(int argc, char *argv[])
>> 		case 'n':
>> 			nflag =3D 1;
>> 			break;
>> +		case 'u':
>> +#ifdef _IONBF
>> +			c =3D setvbuf(stdout, NULL, _IONBF, 0);
>> +#else
>> +			c =3D -1;
>> +			errno =3D EOPNOTSUPP;
>> +#endif
>> +			if (c)
>=20
> Why doing it that way ? IMO the conditional is useless and even wrong.
> FreeBSD provides the _IONBF, _IONBF is required by C99.
>=20
> If some other system lacks _IONBF, it should get compiler error =
instead
> of silently accepting non-working code.

I was just trying to keep the code somewhat in sync with NetBSD: as of =
lately their emphasis is portability and for them it=92s important to be =
build all their system in weird platforms.

I agree it=92s ugly though, so unless someone thinks we should care I =
will clean it up :).

Pedro.=

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 21 08:48:31 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 57455795;
 Sat, 21 Jun 2014 08:48:31 +0000 (UTC)
Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au
 [211.29.132.59])
 by mx1.freebsd.org (Postfix) with ESMTP id 1763F2E90;
 Sat, 21 Jun 2014 08:48:30 +0000 (UTC)
Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au
 (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133])
 by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id E9B3E1A4618;
 Sat, 21 Jun 2014 18:48:21 +1000 (EST)
Date: Sat, 21 Jun 2014 18:48:18 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Pedro Giffuni 
Subject: Re: svn commit: r267692 - head/usr.bin/sed
In-Reply-To: 
Message-ID: <20140621183648.M5055@besplex.bde.org>
References: <201406202141.s5KLfU2J047433@svn.freebsd.org>
 <20140621054744.GN3991@kib.kiev.ua>
 
MIME-Version: 1.0
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.1 cv=eojmkOZX c=1 sm=1 tr=0
 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=PIuYOccYB40A:10
 a=JzwRw_2MAAAA:8 a=nlC_4_pT8q9DhB4Ho9EA:9 a=cz2ZRIgtxKwA:10
 a=wJWlkF7cXJYA:10 a=pGLkceISAAAA:8 a=ieaRINkLfCv41KScPV0A:9
 a=45ClL6m2LaAA:10 a=MSl-tDqOz04A:10
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE
X-Content-Filtered-By: Mailman/MimeDel 2.1.18
Cc: Konstantin Belousov , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 21 Jun 2014 08:48:31 -0000

On Sat, 21 Jun 2014, Pedro Giffuni wrote:

> Il giorno 21/giu/2014, alle ore 00:47, Konstantin Belousov  ha scritto:
>
>> On Fri, Jun 20, 2014 at 09:41:30PM +0000, Pedro F. Giffuni wrote:
>>> Modified: head/usr.bin/sed/main.c
>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>> --- head/usr.bin/sed/main.c=09Fri Jun 20 21:35:39 2014=09(r267691)
>>> +++ head/usr.bin/sed/main.c=09Fri Jun 20 21:41:30 2014=09(r267692)
>>> ...
>>> @@ -168,6 +168,16 @@ main(int argc, char *argv[])
>>> =09=09case 'n':
>>> =09=09=09nflag =3D 1;
>>> =09=09=09break;
>>> +=09=09case 'u':
>>> +#ifdef _IONBF
>>> +=09=09=09c =3D setvbuf(stdout, NULL, _IONBF, 0);
>>> +#else
>>> +=09=09=09c =3D -1;
>>> +=09=09=09errno =3D EOPNOTSUPP;
>>> +#endif
>>> +=09=09=09if (c)
>>
>> Why doing it that way ? IMO the conditional is useless and even wrong.
>> FreeBSD provides the _IONBF, _IONBF is required by C99.
>>
>> If some other system lacks _IONBF, it should get compiler error instead
>> of silently accepting non-working code.
>
> I was just trying to keep the code somewhat in sync with NetBSD: as of la=
tely their emphasis is portability and for them it=92s important to be buil=
d all their system in weird platforms.
>
> I agree it=92s ugly though, so unless someone thinks we should care I wil=
l clean it up :).

The ifdef is nonsense.  _IONBUF and setvbuf() are far more portable than
EOPNOTSUPP, since they are in C90 while EOPNOTSUPP wasn't even in POSIX
until 2001.  (POSIX spelled it ENOTSUP, but other OSes spelled it EOPNOTSUP=
P,
so now everyone except C has both.)

Before C90, setvbuf() was unportable and there were ifdef messes to use
it if available, else use setbuf(), but setbuf() can't do much.

The 'c' variable is abused.

Bruce
From owner-svn-src-head@FreeBSD.ORG  Sat Jun 21 14:07:35 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 104193AA;
 Sat, 21 Jun 2014 14:07:35 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EC97C25B6;
 Sat, 21 Jun 2014 14:07:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5LE7Y6i002184;
 Sat, 21 Jun 2014 14:07:34 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5LE7Yqv002183;
 Sat, 21 Jun 2014 14:07:34 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201406211407.s5LE7Yqv002183@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Sat, 21 Jun 2014 14:07:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267703 - head/usr.bin/sed
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 21 Jun 2014 14:07:35 -0000

Author: pfg
Date: Sat Jun 21 14:07:33 2014
New Revision: 267703
URL: http://svnweb.freebsd.org/changeset/base/267703

Log:
  Drop ifdef nonsense: just use setvbuf(3).
  
  Pointed out by:		kib, bde

Modified:
  head/usr.bin/sed/main.c

Modified: head/usr.bin/sed/main.c
==============================================================================
--- head/usr.bin/sed/main.c	Sat Jun 21 02:24:35 2014	(r267702)
+++ head/usr.bin/sed/main.c	Sat Jun 21 14:07:33 2014	(r267703)
@@ -162,20 +162,14 @@ main(int argc, char *argv[])
 			ispan = 0;	/* don't span across input files */
 			break;
 		case 'l':
-			if(setlinebuf(stdout) != 0)
-				warnx("setlinebuf() failed");
+			if(setvbuf(stdout, NULL, _IOLBF, 0) != 0)
+				warnx("setting line buffered output failed");
 			break;
 		case 'n':
 			nflag = 1;
 			break;
 		case 'u':
-#ifdef _IONBF
-			c = setvbuf(stdout, NULL, _IONBF, 0);
-#else
-			c = -1;
-			errno = EOPNOTSUPP;
-#endif
-			if (c)
+			if(setvbuf(stdout, NULL, _IONBF, 0) != 0)
 				warnx("setting unbuffered output failed");
 			break;
 		default:

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 21 18:22:24 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A787FB47;
 Sat, 21 Jun 2014 18:22:24 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 948222811;
 Sat, 21 Jun 2014 18:22:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5LIMOPa023301;
 Sat, 21 Jun 2014 18:22:24 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5LIMOAe023298;
 Sat, 21 Jun 2014 18:22:24 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201406211822.s5LIMOAe023298@svn.freebsd.org>
From: Dimitry Andric 
Date: Sat, 21 Jun 2014 18:22:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267704 - head/contrib/llvm/lib/CodeGen/SelectionDAG
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 21 Jun 2014 18:22:24 -0000

Author: dim
Date: Sat Jun 21 18:22:23 2014
New Revision: 267704
URL: http://svnweb.freebsd.org/changeset/base/267704

Log:
  Pull in r211435 from upstream llvm trunk (by Benjamin Kramer):
  
    Legalizer: Add support for splitting insert_subvectors.
  
    We handle this by spilling the whole thing to the stack and doing the
    insertion as a store.
  
    PR19492. This happens in real code because the vectorizer creates
    v2i128 when AVX is enabled.
  
  This fixes a "fatal error: error in backend: Do not know how to split
  the result of this operator!" message encountered during compilation of
  the net-p2p/libtorrent-rasterbar port.
  
  Reported by:	Evgeniy 
  MFC after:	3 days

Modified:
  head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
  head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp

Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
==============================================================================
--- head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h	Sat Jun 21 14:07:33 2014	(r267703)
+++ head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h	Sat Jun 21 18:22:23 2014	(r267704)
@@ -569,6 +569,7 @@ private:
   void SplitVecRes_BUILD_VECTOR(SDNode *N, SDValue &Lo, SDValue &Hi);
   void SplitVecRes_CONCAT_VECTORS(SDNode *N, SDValue &Lo, SDValue &Hi);
   void SplitVecRes_EXTRACT_SUBVECTOR(SDNode *N, SDValue &Lo, SDValue &Hi);
+  void SplitVecRes_INSERT_SUBVECTOR(SDNode *N, SDValue &Lo, SDValue &Hi);
   void SplitVecRes_FPOWI(SDNode *N, SDValue &Lo, SDValue &Hi);
   void SplitVecRes_INSERT_VECTOR_ELT(SDNode *N, SDValue &Lo, SDValue &Hi);
   void SplitVecRes_LOAD(LoadSDNode *N, SDValue &Lo, SDValue &Hi);

Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
==============================================================================
--- head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp	Sat Jun 21 14:07:33 2014	(r267703)
+++ head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp	Sat Jun 21 18:22:23 2014	(r267704)
@@ -506,6 +506,7 @@ void DAGTypeLegalizer::SplitVectorResult
   case ISD::BUILD_VECTOR:      SplitVecRes_BUILD_VECTOR(N, Lo, Hi); break;
   case ISD::CONCAT_VECTORS:    SplitVecRes_CONCAT_VECTORS(N, Lo, Hi); break;
   case ISD::EXTRACT_SUBVECTOR: SplitVecRes_EXTRACT_SUBVECTOR(N, Lo, Hi); break;
+  case ISD::INSERT_SUBVECTOR:  SplitVecRes_INSERT_SUBVECTOR(N, Lo, Hi); break;
   case ISD::FP_ROUND_INREG:    SplitVecRes_InregOp(N, Lo, Hi); break;
   case ISD::FPOWI:             SplitVecRes_FPOWI(N, Lo, Hi); break;
   case ISD::INSERT_VECTOR_ELT: SplitVecRes_INSERT_VECTOR_ELT(N, Lo, Hi); break;
@@ -725,6 +726,43 @@ void DAGTypeLegalizer::SplitVecRes_EXTRA
                                    TLI.getVectorIdxTy()));
 }
 
+void DAGTypeLegalizer::SplitVecRes_INSERT_SUBVECTOR(SDNode *N, SDValue &Lo,
+                                                    SDValue &Hi) {
+  SDValue Vec = N->getOperand(0);
+  SDValue SubVec = N->getOperand(1);
+  SDValue Idx = N->getOperand(2);
+  SDLoc dl(N);
+  GetSplitVector(Vec, Lo, Hi);
+
+  // Spill the vector to the stack.
+  EVT VecVT = Vec.getValueType();
+  EVT SubVecVT = VecVT.getVectorElementType();
+  SDValue StackPtr = DAG.CreateStackTemporary(VecVT);
+  SDValue Store = DAG.getStore(DAG.getEntryNode(), dl, Vec, StackPtr,
+                               MachinePointerInfo(), false, false, 0);
+
+  // Store the new subvector into the specified index.
+  SDValue SubVecPtr = GetVectorElementPointer(StackPtr, SubVecVT, Idx);
+  Type *VecType = VecVT.getTypeForEVT(*DAG.getContext());
+  unsigned Alignment = TLI.getDataLayout()->getPrefTypeAlignment(VecType);
+  Store = DAG.getStore(Store, dl, SubVec, SubVecPtr, MachinePointerInfo(),
+                       false, false, 0);
+
+  // Load the Lo part from the stack slot.
+  Lo = DAG.getLoad(Lo.getValueType(), dl, Store, StackPtr, MachinePointerInfo(),
+                   false, false, false, 0);
+
+  // Increment the pointer to the other part.
+  unsigned IncrementSize = Lo.getValueType().getSizeInBits() / 8;
+  StackPtr =
+      DAG.getNode(ISD::ADD, dl, StackPtr.getValueType(), StackPtr,
+                  DAG.getConstant(IncrementSize, StackPtr.getValueType()));
+
+  // Load the Hi part from the stack slot.
+  Hi = DAG.getLoad(Hi.getValueType(), dl, Store, StackPtr, MachinePointerInfo(),
+                   false, false, false, MinAlign(Alignment, IncrementSize));
+}
+
 void DAGTypeLegalizer::SplitVecRes_FPOWI(SDNode *N, SDValue &Lo,
                                          SDValue &Hi) {
   SDLoc dl(N);

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 21 18:47:30 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9E3798F4;
 Sat, 21 Jun 2014 18:47:30 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7F3FB29A8;
 Sat, 21 Jun 2014 18:47:30 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5LIlUcH033356;
 Sat, 21 Jun 2014 18:47:30 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5LIlUhp033355;
 Sat, 21 Jun 2014 18:47:30 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201406211847.s5LIlUhp033355@svn.freebsd.org>
From: Dimitry Andric 
Date: Sat, 21 Jun 2014 18:47:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267705 - head/contrib/llvm/patches
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 21 Jun 2014 18:47:30 -0000

Author: dim
Date: Sat Jun 21 18:47:30 2014
New Revision: 267705
URL: http://svnweb.freebsd.org/changeset/base/267705

Log:
  Add the llvm patch for r267704.

Added:
  head/contrib/llvm/patches/patch-r267704-llvm-r211435-fix-avx-backend.diff

Added: head/contrib/llvm/patches/patch-r267704-llvm-r211435-fix-avx-backend.diff
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/llvm/patches/patch-r267704-llvm-r211435-fix-avx-backend.diff	Sat Jun 21 18:47:30 2014	(r267705)
@@ -0,0 +1,125 @@
+Pull in r211435 from upstream llvm trunk (by Benjamin Kramer):
+
+  Legalizer: Add support for splitting insert_subvectors.
+
+  We handle this by spilling the whole thing to the stack and doing the
+  insertion as a store.
+
+  PR19492. This happens in real code because the vectorizer creates
+  v2i128 when AVX is enabled.
+
+This fixes a "fatal error: error in backend: Do not know how to split
+the result of this operator!" message encountered during compilation of
+the net-p2p/libtorrent-rasterbar port.
+
+Introduced here: http://svnweb.freebsd.org/changeset/base/267704
+
+Index: lib/CodeGen/SelectionDAG/LegalizeTypes.h
+===================================================================
+--- lib/CodeGen/SelectionDAG/LegalizeTypes.h
++++ lib/CodeGen/SelectionDAG/LegalizeTypes.h
+@@ -569,6 +569,7 @@ class LLVM_LIBRARY_VISIBILITY DAGTypeLegalizer {
+   void SplitVecRes_BUILD_VECTOR(SDNode *N, SDValue &Lo, SDValue &Hi);
+   void SplitVecRes_CONCAT_VECTORS(SDNode *N, SDValue &Lo, SDValue &Hi);
+   void SplitVecRes_EXTRACT_SUBVECTOR(SDNode *N, SDValue &Lo, SDValue &Hi);
++  void SplitVecRes_INSERT_SUBVECTOR(SDNode *N, SDValue &Lo, SDValue &Hi);
+   void SplitVecRes_FPOWI(SDNode *N, SDValue &Lo, SDValue &Hi);
+   void SplitVecRes_INSERT_VECTOR_ELT(SDNode *N, SDValue &Lo, SDValue &Hi);
+   void SplitVecRes_LOAD(LoadSDNode *N, SDValue &Lo, SDValue &Hi);
+Index: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+===================================================================
+--- lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
++++ lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+@@ -506,6 +506,7 @@ void DAGTypeLegalizer::SplitVectorResult(SDNode *N
+   case ISD::BUILD_VECTOR:      SplitVecRes_BUILD_VECTOR(N, Lo, Hi); break;
+   case ISD::CONCAT_VECTORS:    SplitVecRes_CONCAT_VECTORS(N, Lo, Hi); break;
+   case ISD::EXTRACT_SUBVECTOR: SplitVecRes_EXTRACT_SUBVECTOR(N, Lo, Hi); break;
++  case ISD::INSERT_SUBVECTOR:  SplitVecRes_INSERT_SUBVECTOR(N, Lo, Hi); break;
+   case ISD::FP_ROUND_INREG:    SplitVecRes_InregOp(N, Lo, Hi); break;
+   case ISD::FPOWI:             SplitVecRes_FPOWI(N, Lo, Hi); break;
+   case ISD::INSERT_VECTOR_ELT: SplitVecRes_INSERT_VECTOR_ELT(N, Lo, Hi); break;
+@@ -725,6 +726,43 @@ void DAGTypeLegalizer::SplitVecRes_EXTRACT_SUBVECT
+                                    TLI.getVectorIdxTy()));
+ }
+ 
++void DAGTypeLegalizer::SplitVecRes_INSERT_SUBVECTOR(SDNode *N, SDValue &Lo,
++                                                    SDValue &Hi) {
++  SDValue Vec = N->getOperand(0);
++  SDValue SubVec = N->getOperand(1);
++  SDValue Idx = N->getOperand(2);
++  SDLoc dl(N);
++  GetSplitVector(Vec, Lo, Hi);
++
++  // Spill the vector to the stack.
++  EVT VecVT = Vec.getValueType();
++  EVT SubVecVT = VecVT.getVectorElementType();
++  SDValue StackPtr = DAG.CreateStackTemporary(VecVT);
++  SDValue Store = DAG.getStore(DAG.getEntryNode(), dl, Vec, StackPtr,
++                               MachinePointerInfo(), false, false, 0);
++
++  // Store the new subvector into the specified index.
++  SDValue SubVecPtr = GetVectorElementPointer(StackPtr, SubVecVT, Idx);
++  Type *VecType = VecVT.getTypeForEVT(*DAG.getContext());
++  unsigned Alignment = TLI.getDataLayout()->getPrefTypeAlignment(VecType);
++  Store = DAG.getStore(Store, dl, SubVec, SubVecPtr, MachinePointerInfo(),
++                       false, false, 0);
++
++  // Load the Lo part from the stack slot.
++  Lo = DAG.getLoad(Lo.getValueType(), dl, Store, StackPtr, MachinePointerInfo(),
++                   false, false, false, 0);
++
++  // Increment the pointer to the other part.
++  unsigned IncrementSize = Lo.getValueType().getSizeInBits() / 8;
++  StackPtr =
++      DAG.getNode(ISD::ADD, dl, StackPtr.getValueType(), StackPtr,
++                  DAG.getConstant(IncrementSize, StackPtr.getValueType()));
++
++  // Load the Hi part from the stack slot.
++  Hi = DAG.getLoad(Hi.getValueType(), dl, Store, StackPtr, MachinePointerInfo(),
++                   false, false, false, MinAlign(Alignment, IncrementSize));
++}
++
+ void DAGTypeLegalizer::SplitVecRes_FPOWI(SDNode *N, SDValue &Lo,
+                                          SDValue &Hi) {
+   SDLoc dl(N);
+Index: test/CodeGen/X86/vec_split.ll
+===================================================================
+--- test/CodeGen/X86/vec_split.ll
++++ test/CodeGen/X86/vec_split.ll
+@@ -40,3 +40,36 @@ define <32 x i16> @split32(<32 x i16> %a, <32 x i1
+   %2 = select <32 x i1> %1, <32 x i16> %a, <32 x i16> %b
+   ret <32 x i16> %2
+ }
++
++; PR19492
++define i128 @split128(<2 x i128> %a, <2 x i128> %b) {
++; SSE4-LABEL: split128:
++; SSE4: addq
++; SSE4: adcq
++; SSE4: addq
++; SSE4: adcq
++; SSE4: addq
++; SSE4: adcq
++; SSE4: ret
++; AVX1-LABEL: split128:
++; AVX1: addq
++; AVX1: adcq
++; AVX1: addq
++; AVX1: adcq
++; AVX1: addq
++; AVX1: adcq
++; AVX1: ret
++; AVX2-LABEL: split128:
++; AVX2: addq
++; AVX2: adcq
++; AVX2: addq
++; AVX2: adcq
++; AVX2: addq
++; AVX2: adcq
++; AVX2: ret
++  %add = add nsw <2 x i128> %a, %b
++  %rdx.shuf = shufflevector <2 x i128> %add, <2 x i128> undef, <2 x i32> 
++  %bin.rdx = add <2 x i128> %add, %rdx.shuf
++  %e = extractelement <2 x i128> %bin.rdx, i32 1
++  ret i128 %e
++}

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 21 19:29:41 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 44898509;
 Sat, 21 Jun 2014 19:29:41 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 188632C7C;
 Sat, 21 Jun 2014 19:29:41 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5LJTevo052584;
 Sat, 21 Jun 2014 19:29:40 GMT (envelope-from markj@svn.freebsd.org)
Received: (from markj@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5LJTeBH052583;
 Sat, 21 Jun 2014 19:29:40 GMT (envelope-from markj@svn.freebsd.org)
Message-Id: <201406211929.s5LJTeBH052583@svn.freebsd.org>
From: Mark Johnston 
Date: Sat, 21 Jun 2014 19:29:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267706 - head/sys/cddl/dev/sdt
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 21 Jun 2014 19:29:41 -0000

Author: markj
Date: Sat Jun 21 19:29:40 2014
New Revision: 267706
URL: http://svnweb.freebsd.org/changeset/base/267706

Log:
  Allow creation of SDT probes from a module in which no providers are
  defined. This ensures that the sdt:zfs:: probes appear despite the fact
  the sdt provider is defined in the kernel rather than in zfs.ko.
  
  Reported by:	hiren
  Tested by:	hiren
  MFC after:	2 weeks

Modified:
  head/sys/cddl/dev/sdt/sdt.c

Modified: head/sys/cddl/dev/sdt/sdt.c
==============================================================================
--- head/sys/cddl/dev/sdt/sdt.c	Sat Jun 21 18:47:30 2014	(r267705)
+++ head/sys/cddl/dev/sdt/sdt.c	Sat Jun 21 19:29:40 2014	(r267706)
@@ -257,27 +257,28 @@ sdt_kld_load(void *arg __unused, struct 
 	struct sdt_probe **probe, **p_begin, **p_end;
 	struct sdt_argtype **argtype, **a_begin, **a_end;
 
-	if (linker_file_lookup_set(lf, "sdt_providers_set", &begin, &end, NULL))
-		return;
-	for (prov = begin; prov < end; prov++)
-		sdt_create_provider(*prov);
+	if (linker_file_lookup_set(lf, "sdt_providers_set", &begin, &end,
+	    NULL) == 0) {
+		for (prov = begin; prov < end; prov++)
+			sdt_create_provider(*prov);
+	}
 
 	if (linker_file_lookup_set(lf, "sdt_probes_set", &p_begin, &p_end,
-	    NULL))
-		return;
-	for (probe = p_begin; probe < p_end; probe++) {
-		(*probe)->sdtp_lf = lf;
-		sdt_create_probe(*probe);
-		TAILQ_INIT(&(*probe)->argtype_list);
+	    NULL) == 0) {
+		for (probe = p_begin; probe < p_end; probe++) {
+			(*probe)->sdtp_lf = lf;
+			sdt_create_probe(*probe);
+			TAILQ_INIT(&(*probe)->argtype_list);
+		}
 	}
 
 	if (linker_file_lookup_set(lf, "sdt_argtypes_set", &a_begin, &a_end,
-	    NULL))
-		return;
-	for (argtype = a_begin; argtype < a_end; argtype++) {
-		(*argtype)->probe->n_args++;
-		TAILQ_INSERT_TAIL(&(*argtype)->probe->argtype_list, *argtype,
-		    argtype_entry);
+	    NULL) == 0) {
+		for (argtype = a_begin; argtype < a_end; argtype++) {
+			(*argtype)->probe->n_args++;
+			TAILQ_INSERT_TAIL(&(*argtype)->probe->argtype_list,
+			    *argtype, argtype_entry);
+		}
 	}
 }
 

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 22 00:53:34 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4ADA4474;
 Sun, 22 Jun 2014 00:53:34 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3837523E4;
 Sun, 22 Jun 2014 00:53:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5M0rYEV003399;
 Sun, 22 Jun 2014 00:53:34 GMT (envelope-from mjg@svn.freebsd.org)
Received: (from mjg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5M0rXd7003397;
 Sun, 22 Jun 2014 00:53:33 GMT (envelope-from mjg@svn.freebsd.org)
Message-Id: <201406220053.s5M0rXd7003397@svn.freebsd.org>
From: Mateusz Guzik 
Date: Sun, 22 Jun 2014 00:53:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267708 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 22 Jun 2014 00:53:34 -0000

Author: mjg
Date: Sun Jun 22 00:53:33 2014
New Revision: 267708
URL: http://svnweb.freebsd.org/changeset/base/267708

Log:
  do_dup: plug redundant adjustment of fd_lastfile
  
  By that time it was already set by fdalloc, or was there in the first place
  if fd is replaced.
  
  MFC after:	1 week

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Sat Jun 21 23:35:11 2014	(r267707)
+++ head/sys/kern/kern_descrip.c	Sun Jun 22 00:53:33 2014	(r267708)
@@ -885,8 +885,6 @@ do_dup(struct thread *td, int flags, int
 		newfde->fde_flags = oldfde->fde_flags | UF_EXCLOSE;
 	else
 		newfde->fde_flags = oldfde->fde_flags & ~UF_EXCLOSE;
-	if (new > fdp->fd_lastfile)
-		fdp->fd_lastfile = new;
 	*retval = new;
 
 	if (delfp != NULL) {

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 22 01:31:56 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7C305981;
 Sun, 22 Jun 2014 01:31:56 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6928E2678;
 Sun, 22 Jun 2014 01:31:56 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5M1Vu41021662;
 Sun, 22 Jun 2014 01:31:56 GMT (envelope-from mjg@svn.freebsd.org)
Received: (from mjg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5M1VtbX021657;
 Sun, 22 Jun 2014 01:31:55 GMT (envelope-from mjg@svn.freebsd.org)
Message-Id: <201406220131.s5M1VtbX021657@svn.freebsd.org>
From: Mateusz Guzik 
Date: Sun, 22 Jun 2014 01:31:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267710 - in head/sys: kern sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 22 Jun 2014 01:31:56 -0000

Author: mjg
Date: Sun Jun 22 01:31:55 2014
New Revision: 267710
URL: http://svnweb.freebsd.org/changeset/base/267710

Log:
  fd: replace fd_nfiles with fd_lastfile where appropriate
  
  fd_lastfile is guaranteed to be the biggest open fd, so when the intent
  is to iterate over active fds or lookup one, there is no point in looking
  beyond that limit.
  
  Few places are left unpatched for now.
  
  MFC after:	1 week

Modified:
  head/sys/kern/kern_descrip.c
  head/sys/kern/sys_generic.c
  head/sys/kern/vfs_syscalls.c
  head/sys/sys/filedesc.h

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Sun Jun 22 01:19:52 2014	(r267709)
+++ head/sys/kern/kern_descrip.c	Sun Jun 22 01:31:55 2014	(r267710)
@@ -1234,7 +1234,7 @@ sys_closefrom(struct thread *td, struct 
 	if (uap->lowfd < 0)
 		uap->lowfd = 0;
 	FILEDESC_SLOCK(fdp);
-	for (fd = uap->lowfd; fd < fdp->fd_nfiles; fd++) {
+	for (fd = uap->lowfd; fd <= fdp->fd_lastfile; fd++) {
 		if (fdp->fd_ofiles[fd].fde_file != NULL) {
 			FILEDESC_SUNLOCK(fdp);
 			(void)kern_close(td, fd);
@@ -2916,7 +2916,7 @@ sysctl_kern_file(SYSCTL_HANDLER_ARGS)
 		if (fdp == NULL)
 			continue;
 		FILEDESC_SLOCK(fdp);
-		for (n = 0; fdp->fd_refcnt > 0 && n < fdp->fd_nfiles; ++n) {
+		for (n = 0; fdp->fd_refcnt > 0 && n <= fdp->fd_lastfile; ++n) {
 			if ((fp = fdp->fd_ofiles[n].fde_file) == NULL)
 				continue;
 			xf.xf_fd = n;
@@ -3026,7 +3026,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE
 	if (fdp->fd_jdir != NULL)
 		export_vnode_for_osysctl(fdp->fd_jdir, KF_FD_TYPE_JAIL, kif,
 				fdp, req);
-	for (i = 0; fdp->fd_refcnt > 0 && i < fdp->fd_nfiles; i++) {
+	for (i = 0; fdp->fd_refcnt > 0 && i <= fdp->fd_lastfile; i++) {
 		if ((fp = fdp->fd_ofiles[i].fde_file) == NULL)
 			continue;
 		bzero(kif, sizeof(*kif));
@@ -3395,7 +3395,7 @@ kern_proc_filedesc_out(struct proc *p,  
 		export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_JAIL,
 		    FREAD, -1, -1, NULL, efbuf);
 	}
-	for (i = 0; fdp->fd_refcnt > 0 && i < fdp->fd_nfiles; i++) {
+	for (i = 0; fdp->fd_refcnt > 0 && i <= fdp->fd_lastfile; i++) {
 		if ((fp = fdp->fd_ofiles[i].fde_file) == NULL)
 			continue;
 		data = NULL;
@@ -3766,7 +3766,7 @@ file_to_first_proc(struct file *fp)
 		fdp = p->p_fd;
 		if (fdp == NULL)
 			continue;
-		for (n = 0; n < fdp->fd_nfiles; n++) {
+		for (n = 0; n <= fdp->fd_lastfile; n++) {
 			if (fp == fdp->fd_ofiles[n].fde_file)
 				return (p);
 		}
@@ -3816,7 +3816,7 @@ DB_SHOW_COMMAND(files, db_show_files)
 			continue;
 		if ((fdp = p->p_fd) == NULL)
 			continue;
-		for (n = 0; n < fdp->fd_nfiles; ++n) {
+		for (n = 0; n <= fdp->fd_lastfile; ++n) {
 			if ((fp = fdp->fd_ofiles[n].fde_file) == NULL)
 				continue;
 			db_print_file(fp, header);

Modified: head/sys/kern/sys_generic.c
==============================================================================
--- head/sys/kern/sys_generic.c	Sun Jun 22 01:19:52 2014	(r267709)
+++ head/sys/kern/sys_generic.c	Sun Jun 22 01:31:55 2014	(r267710)
@@ -1458,7 +1458,7 @@ pollscan(td, fds, nfd)
 
 	FILEDESC_SLOCK(fdp);
 	for (i = 0; i < nfd; i++, fds++) {
-		if (fds->fd >= fdp->fd_nfiles) {
+		if (fds->fd > fdp->fd_lastfile) {
 			fds->revents = POLLNVAL;
 			n++;
 		} else if (fds->fd < 0) {

Modified: head/sys/kern/vfs_syscalls.c
==============================================================================
--- head/sys/kern/vfs_syscalls.c	Sun Jun 22 01:19:52 2014	(r267709)
+++ head/sys/kern/vfs_syscalls.c	Sun Jun 22 01:31:55 2014	(r267710)
@@ -828,7 +828,7 @@ chroot_refuse_vdir_fds(fdp)
 
 	FILEDESC_LOCK_ASSERT(fdp);
 
-	for (fd = 0; fd < fdp->fd_nfiles ; fd++) {
+	for (fd = 0; fd <= fdp->fd_lastfile; fd++) {
 		fp = fget_locked(fdp, fd);
 		if (fp == NULL)
 			continue;

Modified: head/sys/sys/filedesc.h
==============================================================================
--- head/sys/sys/filedesc.h	Sun Jun 22 01:19:52 2014	(r267709)
+++ head/sys/sys/filedesc.h	Sun Jun 22 01:31:55 2014	(r267710)
@@ -175,7 +175,7 @@ fget_locked(struct filedesc *fdp, int fd
 
 	FILEDESC_LOCK_ASSERT(fdp);
 
-	if (fd < 0 || fd >= fdp->fd_nfiles)
+	if (fd < 0 || fd > fdp->fd_lastfile)
 		return (NULL);
 
 	return (fdp->fd_ofiles[fd].fde_file);

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 22 01:41:08 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D11FCBD5;
 Sun, 22 Jun 2014 01:41:08 +0000 (UTC)
Received: from mail-we0-x230.google.com (mail-we0-x230.google.com
 [IPv6:2a00:1450:400c:c03::230])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id F19E926A8;
 Sun, 22 Jun 2014 01:41:07 +0000 (UTC)
Received: by mail-we0-f176.google.com with SMTP id u56so5233029wes.7
 for ; Sat, 21 Jun 2014 18:41:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=MnEf57FaAHPlpos7++YI3g/XaMwnztZ2waa2wmhL37A=;
 b=p1J1xpzEzLrA87OwS66SNvHrznEzMnCIXnixBR46jpXJ9FGGVwG069agoTxxH3flN3
 OuH7L8CcY6BFqYmk8V71ZRBqgewCa9RF+ft2IqFYbsZz0sRBDbwughF719YyXQVKYywS
 uJG+3cL2ZzBme2VH+AxjcuILUImXF1Lyl0YLedJNHWU8p5ZglgMVKlWiH5WBQTjAtaHK
 OGBkxN71qI6ukSId6bWF3WSjbAfWV8KoO2EL0jPI1EHJg3i6PcrddpJ+j1bBounVYL/Q
 KQ2oSZPYuN5ACrkDhy7pfooOZ2YEZoP7dQqzbZ5I2uypStp9VmGlw3ubsQA3RVL7XAwV
 Ke+Q==
X-Received: by 10.194.189.230 with SMTP id gl6mr6516318wjc.118.1403401265950; 
 Sat, 21 Jun 2014 18:41:05 -0700 (PDT)
Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net.
 [2001:470:1f08:1f7::2])
 by mx.google.com with ESMTPSA id r5sm25878590wjq.26.2014.06.21.18.41.04
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Sat, 21 Jun 2014 18:41:05 -0700 (PDT)
Date: Sun, 22 Jun 2014 03:41:02 +0200
From: Mateusz Guzik 
To: Jonathan Anderson 
Subject: Re: svn commit: r267678 - head/libexec/rtld-elf
Message-ID: <20140622014102.GA26841@dft-labs.eu>
References: <201406201708.s5KH8WVP017030@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <201406201708.s5KH8WVP017030@svn.freebsd.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 22 Jun 2014 01:41:08 -0000

On Fri, Jun 20, 2014 at 05:08:32PM +0000, Jonathan Anderson wrote:
> Author: jonathan
> Date: Fri Jun 20 17:08:32 2014
> New Revision: 267678
> URL: http://svnweb.freebsd.org/changeset/base/267678
> 
> Log:
>   Add the LD_LIBRARY_PATH_FDS environmental variable.
>   
>   This variable allows the loading of shared libraries via directory descriptors
>   rather than via library paths.  If LD_LIBRARY_PATH_FDS=3:4:12, the directories
>   represented by file descriptors 3, 4 and 12 will searched for shared libraries
>   before the normal path-based mechanisms are used.  This allows us to execute
>   unprivileged binaries from within a Capsicum sandbox even if they require
>   shared libraries.
>   

This is not a request, but a mere suggestion.

Now there are 2 places where rtld opens requested libraries which is
somewhat unfortunate.

If find_library was changed to return directory fd to lookup the library
in and the path, open could be done in load_object with openat.

Old functions would return AT_FDCWD.

As a side note load_object would really use an assert that only one of
fd_u and name is set.

Cheers,
-- 
Mateusz Guzik 

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 22 02:48:28 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3529B353;
 Sun, 22 Jun 2014 02:48:28 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 225E12AD2;
 Sun, 22 Jun 2014 02:48:28 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5M2mSCp054310;
 Sun, 22 Jun 2014 02:48:28 GMT (envelope-from iwasaki@svn.freebsd.org)
Received: (from iwasaki@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5M2mRkt054309;
 Sun, 22 Jun 2014 02:48:28 GMT (envelope-from iwasaki@svn.freebsd.org)
Message-Id: <201406220248.s5M2mRkt054309@svn.freebsd.org>
From: Mitsuru IWASAKI 
Date: Sun, 22 Jun 2014 02:48:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267711 - head/share/man/man4
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 22 Jun 2014 02:48:28 -0000

Author: iwasaki
Date: Sun Jun 22 02:48:27 2014
New Revision: 267711
URL: http://svnweb.freebsd.org/changeset/base/267711

Log:
  Add note on SYSCTL VARIABLES.

Modified:
  head/share/man/man4/acpi.4

Modified: head/share/man/man4/acpi.4
==============================================================================
--- head/share/man/man4/acpi.4	Sun Jun 22 01:31:55 2014	(r267710)
+++ head/share/man/man4/acpi.4	Sun Jun 22 02:48:27 2014	(r267711)
@@ -61,6 +61,8 @@ If the default settings are not optimal,
 used to modify or monitor
 .Nm
 behavior.
+Note that some variables will be available only if given hardware supports
+them (such as hw.acpi.acline).
 .Bl -tag -width indent
 .It Va debug.acpi.enable_debug_objects
 Enable dumping Debug objects without

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 22 06:54:37 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 24BCE701;
 Sun, 22 Jun 2014 06:54:37 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 11D602AF5;
 Sun, 22 Jun 2014 06:54:37 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5M6saF7066768;
 Sun, 22 Jun 2014 06:54:36 GMT (envelope-from jmg@svn.freebsd.org)
Received: (from jmg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5M6saB3066767;
 Sun, 22 Jun 2014 06:54:36 GMT (envelope-from jmg@svn.freebsd.org)
Message-Id: <201406220654.s5M6saB3066767@svn.freebsd.org>
From: John-Mark Gurney 
Date: Sun, 22 Jun 2014 06:54:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267712 - head/sys/dev/uart
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 22 Jun 2014 06:54:37 -0000

Author: jmg
Date: Sun Jun 22 06:54:36 2014
New Revision: 267712
URL: http://svnweb.freebsd.org/changeset/base/267712

Log:
  add support for MosChip MCS9922...  This is found on an ExpressCard..
  
  tested to work w/ cu talking to itself (the two ports connected via
  null modem cable)...

Modified:
  head/sys/dev/uart/uart_bus_pci.c

Modified: head/sys/dev/uart/uart_bus_pci.c
==============================================================================
--- head/sys/dev/uart/uart_bus_pci.c	Sun Jun 22 02:48:27 2014	(r267711)
+++ head/sys/dev/uart/uart_bus_pci.c	Sun Jun 22 06:54:36 2014	(r267712)
@@ -136,6 +136,8 @@ static const struct pci_id pci_ns8250_id
 	"MosChip MCS9901 PCIe to Peripheral Controller", 0x10 },
 { 0x9710, 0x9904, 0xa000, 0x1000,
 	"MosChip MCS9904 PCIe to Peripheral Controller", 0x10 },
+{ 0x9710, 0x9922, 0xffff, 0,
+	"MosChip MCS9922 Multi I/O Controller", 0x10 },
 { 0xdeaf, 0x9051, 0xffff, 0, "Middle Digital PC Weasel Serial Port", 0x10 },
 { 0xffff, 0, 0xffff, 0, NULL, 0, 0}
 };

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 22 10:00:34 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E714824D;
 Sun, 22 Jun 2014 10:00:34 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C94FA2704;
 Sun, 22 Jun 2014 10:00:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5MA0YnO051306;
 Sun, 22 Jun 2014 10:00:34 GMT (envelope-from jmg@svn.freebsd.org)
Received: (from jmg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MA0XwQ051295;
 Sun, 22 Jun 2014 10:00:33 GMT (envelope-from jmg@svn.freebsd.org)
Message-Id: <201406221000.s5MA0XwQ051295@svn.freebsd.org>
From: John-Mark Gurney 
Date: Sun, 22 Jun 2014 10:00:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267715 - in head: contrib/wpa/src/utils
 usr.sbin/wpa/hostapd usr.sbin/wpa/hostapd_cli usr.sbin/wpa/wpa_cli
 usr.sbin/wpa/wpa_passphrase usr.sbin/wpa/wpa_supplicant
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 22 Jun 2014 10:00:35 -0000

Author: jmg
Date: Sun Jun 22 10:00:33 2014
New Revision: 267715
URL: http://svnweb.freebsd.org/changeset/base/267715

Log:
  convert to using pidfile...  This prevents multiple wpa_supplicants
  running at the same time causing problems w/ wifi not working..
  
  the patch will be submitted upstream...  The next step if someone wants
  to push it upstream is to break os_unix.c up so that all these other
  utilities don't need libutil..
  
  Reviewed by:	rpaulo

Modified:
  head/contrib/wpa/src/utils/os_unix.c
  head/usr.sbin/wpa/hostapd/Makefile
  head/usr.sbin/wpa/hostapd_cli/Makefile
  head/usr.sbin/wpa/wpa_cli/Makefile
  head/usr.sbin/wpa/wpa_passphrase/Makefile
  head/usr.sbin/wpa/wpa_supplicant/Makefile

Modified: head/contrib/wpa/src/utils/os_unix.c
==============================================================================
--- head/contrib/wpa/src/utils/os_unix.c	Sun Jun 22 08:32:31 2014	(r267714)
+++ head/contrib/wpa/src/utils/os_unix.c	Sun Jun 22 10:00:33 2014	(r267715)
@@ -153,16 +153,40 @@ static int os_daemon(int nochdir, int no
 #endif /* __APPLE__ */
 
 
+#ifdef __FreeBSD__
+#include 
+#include 
+#include 
+#endif /* __FreeBSD__ */
+
 int os_daemonize(const char *pid_file)
 {
 #if defined(__uClinux__) || defined(__sun__)
 	return -1;
 #else /* defined(__uClinux__) || defined(__sun__) */
+#ifdef __FreeBSD__
+	pid_t otherpid;
+	struct pidfh *pfh;
+
+	pfh = pidfile_open(pid_file, 0600, &otherpid);
+	if (pfh == NULL) {
+		if (errno == EEXIST) {
+			errx(1, "Daemon already running, pid: %jd.",
+			    (intmax_t)otherpid);
+		}
+		warn("Cannot open or create pidfile.");
+	}
+#endif /* __FreeBSD__ */
+
 	if (os_daemon(0, 0)) {
 		perror("daemon");
+#ifdef __FreeBSD__
+		pidfile_remove(pfh);
+#endif /* __FreeBSD__ */
 		return -1;
 	}
 
+#ifndef __FreeBSD__
 	if (pid_file) {
 		FILE *f = fopen(pid_file, "w");
 		if (f) {
@@ -170,6 +194,9 @@ int os_daemonize(const char *pid_file)
 			fclose(f);
 		}
 	}
+#else /* __FreeBSD__ */
+	pidfile_write(pfh);
+#endif /* __FreeBSD__ */
 
 	return -0;
 #endif /* defined(__uClinux__) || defined(__sun__) */

Modified: head/usr.sbin/wpa/hostapd/Makefile
==============================================================================
--- head/usr.sbin/wpa/hostapd/Makefile	Sun Jun 22 08:32:31 2014	(r267714)
+++ head/usr.sbin/wpa/hostapd/Makefile	Sun Jun 22 10:00:33 2014	(r267715)
@@ -46,8 +46,8 @@ CFLAGS+=-DCONFIG_DRIVER_BSD \
 CFLAGS+= -DCONFIG_IPV6
 .endif
 #CFLAGS+= -g
-DPADD+=	${LIBPCAP}
-LDADD+=	-lpcap
+DPADD+=	${LIBPCAP} ${LIBUTIL}
+LDADD+=	-lpcap -lutil
 
 # User customizations for wpa_supplicant/hostapd build environment
 CFLAGS+=${HOSTAPD_CFLAGS}

Modified: head/usr.sbin/wpa/hostapd_cli/Makefile
==============================================================================
--- head/usr.sbin/wpa/hostapd_cli/Makefile	Sun Jun 22 08:32:31 2014	(r267714)
+++ head/usr.sbin/wpa/hostapd_cli/Makefile	Sun Jun 22 10:00:33 2014	(r267715)
@@ -10,6 +10,9 @@ SRCS=	common.c edit.c eloop.c hostapd_cl
 CFLAGS+= -DCONFIG_CTRL_IFACE
 CFLAGS+= -DCONFIG_CTRL_IFACE_UNIX
 
+DPADD+=	${LIBUTIL}
+LDADD+=	-lutil
+
 MAN=	hostapd_cli.8
 
 .include 

Modified: head/usr.sbin/wpa/wpa_cli/Makefile
==============================================================================
--- head/usr.sbin/wpa/wpa_cli/Makefile	Sun Jun 22 08:32:31 2014	(r267714)
+++ head/usr.sbin/wpa/wpa_cli/Makefile	Sun Jun 22 10:00:33 2014	(r267715)
@@ -15,7 +15,7 @@ CFLAGS+= -DCONFIG_CTRL_IFACE_UNIX
 CFLAGS+= -D_DIRENT_HAVE_D_TYPE
 
 CFLAGS+= -DCONFIG_READLINE -I${DESTDIR}/${INCLUDEDIR}/edit
-LDADD+= -ledit -ltermcap
-DPADD+= ${LIBEDIT} ${LIBTERMCAP}
+LDADD+= -ledit -ltermcap -lutil
+DPADD+= ${LIBEDIT} ${LIBTERMCAP} ${LIBUTIL}
 
 .include 

Modified: head/usr.sbin/wpa/wpa_passphrase/Makefile
==============================================================================
--- head/usr.sbin/wpa/wpa_passphrase/Makefile	Sun Jun 22 08:32:31 2014	(r267714)
+++ head/usr.sbin/wpa/wpa_passphrase/Makefile	Sun Jun 22 10:00:33 2014	(r267715)
@@ -11,6 +11,9 @@ SRCS=	common.c md5-internal.c md5.c os_u
 CFLAGS+= -DINTERNAL_SHA1
 CFLAGS+= -DINTERNAL_MD5
 
+DPADD+=	${LIBUTIL}
+LDADD+=	-lutil
+
 MAN=	wpa_passphrase.8
 
 .include 

Modified: head/usr.sbin/wpa/wpa_supplicant/Makefile
==============================================================================
--- head/usr.sbin/wpa/wpa_supplicant/Makefile	Sun Jun 22 08:32:31 2014	(r267714)
+++ head/usr.sbin/wpa/wpa_supplicant/Makefile	Sun Jun 22 10:00:33 2014	(r267715)
@@ -49,8 +49,8 @@ CFLAGS+=-DCONFIG_BACKEND_FILE \
 	-DCONFIG_GAS \
 	-DPKCS12_FUNCS
 #CFLAGS+= -g
-DPADD+=	${LIBPCAP}
-LDADD+=	-lpcap
+DPADD+=	${LIBPCAP} ${LIBUTIL}
+LDADD+=	-lpcap -lutil
 
 # User customizations to the wpa_supplicant build environment
 CFLAGS+=${WPA_SUPPLICANT_CFLAGS}

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 22 11:32:24 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5248B5D7;
 Sun, 22 Jun 2014 11:32:24 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 312A82DA4;
 Sun, 22 Jun 2014 11:32:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5MBWOJw097087;
 Sun, 22 Jun 2014 11:32:24 GMT
 (envelope-from melifaro@svn.freebsd.org)
Received: (from melifaro@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MBWNWj097084;
 Sun, 22 Jun 2014 11:32:23 GMT
 (envelope-from melifaro@svn.freebsd.org)
Message-Id: <201406221132.s5MBWNWj097084@svn.freebsd.org>
From: "Alexander V. Chernikov" 
Date: Sun, 22 Jun 2014 11:32:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267716 - in head/sys: kern sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 22 Jun 2014 11:32:24 -0000

Author: melifaro
Date: Sun Jun 22 11:32:23 2014
New Revision: 267716
URL: http://svnweb.freebsd.org/changeset/base/267716

Log:
  Permit changing cpu mask for cpu set 1 in presence of drivers
  binding their threads to particular CPU.
  
  Changing ithread cpu mask is now performed by special cpuset_setithread().
  It creates additional cpuset root group on first bind invocation.
  
  No objection:	jhb
  Tested by:	hiren
  MFC after:	2 weeks
  Sponsored by:	Yandex LLC

Modified:
  head/sys/kern/kern_cpuset.c
  head/sys/kern/kern_intr.c
  head/sys/sys/cpuset.h

Modified: head/sys/kern/kern_cpuset.c
==============================================================================
--- head/sys/kern/kern_cpuset.c	Sun Jun 22 10:00:33 2014	(r267715)
+++ head/sys/kern/kern_cpuset.c	Sun Jun 22 11:32:23 2014	(r267716)
@@ -106,7 +106,7 @@ static uma_zone_t cpuset_zone;
 static struct mtx cpuset_lock;
 static struct setlist cpuset_ids;
 static struct unrhdr *cpuset_unr;
-static struct cpuset *cpuset_zero;
+static struct cpuset *cpuset_zero, *cpuset_default;
 
 /* Return the size of cpuset_t at the kernel level */
 SYSCTL_INT(_kern_sched, OID_AUTO, cpusetsize, CTLFLAG_RD,
@@ -716,6 +716,89 @@ out:
 }
 
 /*
+ * Apply new cpumask to the ithread.
+ */
+int
+cpuset_setithread(lwpid_t id, u_char cpu)
+{
+	struct cpuset *nset, *rset;
+	struct cpuset *parent, *old_set;
+	struct thread *td;
+	struct proc *p;
+	cpusetid_t cs_id;
+	cpuset_t mask;
+	int error;
+
+	nset = uma_zalloc(cpuset_zone, M_WAITOK);
+	rset = uma_zalloc(cpuset_zone, M_WAITOK);
+
+	CPU_ZERO(&mask);
+	if (cpu == NOCPU)
+		CPU_COPY(cpuset_root, &mask);
+	else
+		CPU_SET(cpu, &mask);
+
+	error = cpuset_which(CPU_WHICH_TID, id, &p, &td, &old_set);
+	if (((cs_id = alloc_unr(cpuset_unr)) == CPUSET_INVALID) || error != 0)
+		goto out;
+
+	thread_lock(td);
+	old_set = td->td_cpuset;
+
+	if (cpu == NOCPU) {
+		/*
+		 * roll back to default set. We're not using cpuset_shadow()
+		 * here because we can fail CPU_SUBSET() check. This can happen
+		 * if default set does not contain all CPUs.
+		 */
+		error = _cpuset_create(nset, cpuset_default, &mask,
+		    CPUSET_INVALID);
+
+		goto applyset;
+	}
+
+	if (old_set->cs_id == 1 || (old_set->cs_id == CPUSET_INVALID &&
+	    old_set->cs_parent->cs_id == 1)) {
+		/* Default mask, we need to use new root set */
+		error = _cpuset_create(rset, cpuset_zero,
+		    &cpuset_zero->cs_mask, cs_id);
+		if (error != 0) {
+			PROC_UNLOCK(p);
+			goto out;
+		}
+		rset->cs_flags |= CPU_SET_ROOT;
+		parent = rset;
+		rset = NULL;
+		cs_id = CPUSET_INVALID;
+	} else {
+		/* Assume existing set was already allocated by previous call */
+		parent = td->td_cpuset;
+		old_set = NULL;
+	}
+
+	error = cpuset_shadow(parent, nset, &mask);
+applyset:
+	if (error == 0) {
+		td->td_cpuset = nset;
+		sched_affinity(td);
+		nset = NULL;
+	}
+	thread_unlock(td);
+	PROC_UNLOCK(p);
+	if (old_set != NULL)
+		cpuset_rel(old_set);
+out:
+	if (nset != NULL)
+		uma_zfree(cpuset_zone, nset);
+	if (rset != NULL)
+		uma_zfree(cpuset_zone, rset);
+	if (cs_id != CPUSET_INVALID)
+		free_unr(cpuset_unr, cs_id);
+	return (error);
+}
+
+
+/*
  * Creates the cpuset for thread0.  We make two sets:
  * 
  * 0 - The root set which should represent all valid processors in the
@@ -735,6 +818,7 @@ cpuset_thread0(void)
 	cpuset_zone = uma_zcreate("cpuset", sizeof(struct cpuset), NULL, NULL,
 	    NULL, NULL, UMA_ALIGN_PTR, 0);
 	mtx_init(&cpuset_lock, "cpuset", NULL, MTX_SPIN | MTX_RECURSE);
+
 	/*
 	 * Create the root system set for the whole machine.  Doesn't use
 	 * cpuset_create() due to NULL parent.
@@ -747,12 +831,15 @@ cpuset_thread0(void)
 	set->cs_flags = CPU_SET_ROOT;
 	cpuset_zero = set;
 	cpuset_root = &set->cs_mask;
+
 	/*
 	 * Now derive a default, modifiable set from that to give out.
 	 */
 	set = uma_zalloc(cpuset_zone, M_WAITOK);
 	error = _cpuset_create(set, cpuset_zero, &cpuset_zero->cs_mask, 1);
 	KASSERT(error == 0, ("Error creating default set: %d\n", error));
+	cpuset_default = set;
+
 	/*
 	 * Initialize the unit allocator. 0 and 1 are allocated above.
 	 */

Modified: head/sys/kern/kern_intr.c
==============================================================================
--- head/sys/kern/kern_intr.c	Sun Jun 22 10:00:33 2014	(r267715)
+++ head/sys/kern/kern_intr.c	Sun Jun 22 11:32:23 2014	(r267716)
@@ -295,7 +295,6 @@ intr_event_create(struct intr_event **ev
 int
 intr_event_bind(struct intr_event *ie, u_char cpu)
 {
-	cpuset_t mask;
 	lwpid_t id;
 	int error;
 
@@ -316,14 +315,9 @@ intr_event_bind(struct intr_event *ie, u
 	 */
 	mtx_lock(&ie->ie_lock);
 	if (ie->ie_thread != NULL) {
-		CPU_ZERO(&mask);
-		if (cpu == NOCPU)
-			CPU_COPY(cpuset_root, &mask);
-		else
-			CPU_SET(cpu, &mask);
 		id = ie->ie_thread->it_thread->td_tid;
 		mtx_unlock(&ie->ie_lock);
-		error = cpuset_setthread(id, &mask);
+		error = cpuset_setithread(id, cpu);
 		if (error)
 			return (error);
 	} else
@@ -332,14 +326,10 @@ intr_event_bind(struct intr_event *ie, u
 	if (error) {
 		mtx_lock(&ie->ie_lock);
 		if (ie->ie_thread != NULL) {
-			CPU_ZERO(&mask);
-			if (ie->ie_cpu == NOCPU)
-				CPU_COPY(cpuset_root, &mask);
-			else
-				CPU_SET(ie->ie_cpu, &mask);
+			cpu = ie->ie_cpu;
 			id = ie->ie_thread->it_thread->td_tid;
 			mtx_unlock(&ie->ie_lock);
-			(void)cpuset_setthread(id, &mask);
+			(void)cpuset_setithread(id, cpu);
 		} else
 			mtx_unlock(&ie->ie_lock);
 		return (error);

Modified: head/sys/sys/cpuset.h
==============================================================================
--- head/sys/sys/cpuset.h	Sun Jun 22 10:00:33 2014	(r267715)
+++ head/sys/sys/cpuset.h	Sun Jun 22 11:32:23 2014	(r267716)
@@ -118,6 +118,7 @@ struct cpuset *cpuset_thread0(void);
 struct cpuset *cpuset_ref(struct cpuset *);
 void	cpuset_rel(struct cpuset *);
 int	cpuset_setthread(lwpid_t id, cpuset_t *);
+int	cpuset_setithread(lwpid_t id, u_char cpu);
 int	cpuset_create_root(struct prison *, struct cpuset **);
 int	cpuset_setproc_update_set(struct proc *, struct cpuset *);
 char	*cpusetobj_strprint(char *, const cpuset_t *);

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 22 15:15:53 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8271AFAE;
 Sun, 22 Jun 2014 15:15:53 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5798E2D8A;
 Sun, 22 Jun 2014 15:15:53 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5MFFr7I003202;
 Sun, 22 Jun 2014 15:15:53 GMT (envelope-from andrew@svn.freebsd.org)
Received: (from andrew@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MFFrPd003201;
 Sun, 22 Jun 2014 15:15:53 GMT (envelope-from andrew@svn.freebsd.org)
Message-Id: <201406221515.s5MFFrPd003201@svn.freebsd.org>
From: Andrew Turner 
Date: Sun, 22 Jun 2014 15:15:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267719 - in head/sys/arm: conf tegra
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 22 Jun 2014 15:15:53 -0000

Author: andrew
Date: Sun Jun 22 15:15:52 2014
New Revision: 267719
URL: http://svnweb.freebsd.org/changeset/base/267719

Log:
  Remove the incomplete Tegra 2 code, nobody was maintaining it. The AC100
  never booted to single user mode.
  
  It can be brought back if someone is willing to get it into a stable state
  and maintain it.

Deleted:
  head/sys/arm/conf/AC100
  head/sys/arm/tegra/

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 22 16:35:03 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D1B191B9;
 Sun, 22 Jun 2014 16:35:03 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BF5F722E8;
 Sun, 22 Jun 2014 16:35:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5MGZ3rL039706;
 Sun, 22 Jun 2014 16:35:03 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MGZ3wY039705;
 Sun, 22 Jun 2014 16:35:03 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201406221635.s5MGZ3wY039705@svn.freebsd.org>
From: Gavin Atkinson 
Date: Sun, 22 Jun 2014 16:35:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267727 - in head/tools/tools: . prstats
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 22 Jun 2014 16:35:03 -0000

Author: gavin
Date: Sun Jun 22 16:35:03 2014
New Revision: 267727
URL: http://svnweb.freebsd.org/changeset/base/267727

Log:
  With the migration from GNATS to Bugzilla, we no longer need a tool to
  graph GNATS PR statistics.  It would be nice to have a similar tool for
  the new bug database, but that would likely be a from-scratch rewrite.

Deleted:
  head/tools/tools/prstats/
Modified:
  head/tools/tools/README

Modified: head/tools/tools/README
==============================================================================
--- head/tools/tools/README	Sun Jun 22 16:34:27 2014	(r267726)
+++ head/tools/tools/README	Sun Jun 22 16:35:03 2014	(r267727)
@@ -55,7 +55,6 @@ pciid		Generate src/share/misc/pci_vendo
 pciroms		A tool for dumping PCI ROM images. WARNING: alpha quality.
 pirtool		A tool for dumping the $PIR table on i386 machines at runtime.
 portsinfo 	Generate list of new ports for last two weeks.
-prstats		Generate statistics about the PR database.
 recoverdisk	Copy as much data as possible from a defective disk.
 scsi-defects	Get at the primary or grown defect list of a SCSI disk.
 sysdoc		Build a manual page with available sysctls for a specific

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 22 20:13:58 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id AFB5F126;
 Sun, 22 Jun 2014 20:13:58 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 90A9A2283;
 Sun, 22 Jun 2014 20:13:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5MKDwah045381;
 Sun, 22 Jun 2014 20:13:58 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MKDwHw045376;
 Sun, 22 Jun 2014 20:13:58 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201406222013.s5MKDwHw045376@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Sun, 22 Jun 2014 20:13:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267745 - head/lib/libc/stdlib
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 22 Jun 2014 20:13:58 -0000

Author: pfg
Date: Sun Jun 22 20:13:57 2014
New Revision: 267745
URL: http://svnweb.freebsd.org/changeset/base/267745

Log:
  getopt(3): recognize option:: as GNU extension for "optional options".
  
  Also ANSIfy a function declaration.
  
  While here update the OpenBSD patch level in getopt_long.c as we
  already have the corresponding change.
  
  Obtained from:	NetBSD
  MFC after:	2 weeks

Modified:
  head/lib/libc/stdlib/getopt.3
  head/lib/libc/stdlib/getopt.c
  head/lib/libc/stdlib/getopt_long.c

Modified: head/lib/libc/stdlib/getopt.3
==============================================================================
--- head/lib/libc/stdlib/getopt.3	Sun Jun 22 19:10:55 2014	(r267744)
+++ head/lib/libc/stdlib/getopt.3	Sun Jun 22 20:13:57 2014	(r267745)
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getopt.3,v 1.31 2003/09/23 10:26:54 wiz Exp $
+.\"	$NetBSD: getopt.3,v 1.34 2014/06/05 22:09:50 wiz Exp $
 .\"
 .\" Copyright (c) 1988, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -30,7 +30,7 @@
 .\"     @(#)getopt.3	8.5 (Berkeley) 4/27/95
 .\" $FreeBSD$
 .\"
-.Dd April 27, 1995
+.Dd June 5, 2014
 .Dt GETOPT 3
 .Os
 .Sh NAME
@@ -65,6 +65,17 @@ The option string
 may contain the following elements: individual characters, and
 characters followed by a colon to indicate an option argument
 is to follow.
+If an individual character is followed by two colons, then the
+option argument is optional;
+.Va optarg
+is set to the rest of the current
+.Va argv
+word, or
+.Dv NULL
+if there were no more characters in the current word.
+This is a
+.Nx
+extension.
 For example, an option string
 .Li \&"x"
 recognizes an option

Modified: head/lib/libc/stdlib/getopt.c
==============================================================================
--- head/lib/libc/stdlib/getopt.c	Sun Jun 22 19:10:55 2014	(r267744)
+++ head/lib/libc/stdlib/getopt.c	Sun Jun 22 20:13:57 2014	(r267745)
@@ -1,4 +1,4 @@
-/*	$NetBSD: getopt.c,v 1.26 2003/08/07 16:43:40 agc Exp $	*/
+/*	$NetBSD: getopt.c,v 1.29 2014/06/05 22:00:22 christos Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993, 1994
@@ -59,10 +59,7 @@ char	*optarg;		/* argument associated wi
  *	Parse argc/argv argument vector.
  */
 int
-getopt(nargc, nargv, ostr)
-	int nargc;
-	char * const nargv[];
-	const char *ostr;
+getopt(int nargc, char * const nargv[], const char *ostr)
 {
 	static char *place = EMSG;		/* option letter processing */
 	char *oli;				/* option letter list index */
@@ -115,6 +112,12 @@ getopt(nargc, nargv, ostr)
 		   entire next argument. */
 		if (*place)
 			optarg = place;
+		else if (oli[2] == ':')
+			/*
+			 * GNU Extension, for optional arguments if the rest of
+			 * the argument is empty, we return NULL
+			 */
+			optarg = NULL;
 		else if (nargc > ++optind)
 			optarg = nargv[optind];
 		else {

Modified: head/lib/libc/stdlib/getopt_long.c
==============================================================================
--- head/lib/libc/stdlib/getopt_long.c	Sun Jun 22 19:10:55 2014	(r267744)
+++ head/lib/libc/stdlib/getopt_long.c	Sun Jun 22 20:13:57 2014	(r267745)
@@ -1,4 +1,4 @@
-/*	$OpenBSD: getopt_long.c,v 1.22 2006/10/04 21:29:04 jmc Exp $	*/
+/*	$OpenBSD: getopt_long.c,v 1.23 2007/10/31 12:34:57 chl Exp $	*/
 /*	$NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $	*/
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 22 21:37:28 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4C98CD05;
 Sun, 22 Jun 2014 21:37:28 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3A11A2831;
 Sun, 22 Jun 2014 21:37:28 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5MLbSfP084528;
 Sun, 22 Jun 2014 21:37:28 GMT (envelope-from mjg@svn.freebsd.org)
Received: (from mjg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MLbSHx084527;
 Sun, 22 Jun 2014 21:37:28 GMT (envelope-from mjg@svn.freebsd.org)
Message-Id: <201406222137.s5MLbSHx084527@svn.freebsd.org>
From: Mateusz Guzik 
Date: Sun, 22 Jun 2014 21:37:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267755 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 22 Jun 2014 21:37:28 -0000

Author: mjg
Date: Sun Jun 22 21:37:27 2014
New Revision: 267755
URL: http://svnweb.freebsd.org/changeset/base/267755

Log:
  Don't take filedesc lock in fdunshare().
  
  We can read refcnt safely and only care if it is equal to 1.
  
  If it could suddenly change from 1 to something bigger the code would be
  buggy even in the previous form and transitions from > 1 to 1 are equally racy
  and harmless (we copy even though there is no need).
  
  MFC after:	1 week

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Sun Jun 22 21:28:05 2014	(r267754)
+++ head/sys/kern/kern_descrip.c	Sun Jun 22 21:37:27 2014	(r267755)
@@ -1852,17 +1852,14 @@ fdshare(struct filedesc *fdp)
 void
 fdunshare(struct proc *p, struct thread *td)
 {
+	struct filedesc *tmp;
 
-	FILEDESC_XLOCK(p->p_fd);
-	if (p->p_fd->fd_refcnt > 1) {
-		struct filedesc *tmp;
-
-		FILEDESC_XUNLOCK(p->p_fd);
-		tmp = fdcopy(p->p_fd);
-		fdescfree(td);
-		p->p_fd = tmp;
-	} else
-		FILEDESC_XUNLOCK(p->p_fd);
+	if (p->p_fd->fd_refcnt == 1)
+		return;
+
+	tmp = fdcopy(p->p_fd);
+	fdescfree(td);
+	p->p_fd = tmp;
 }
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 22 21:54:57 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id ABADA226;
 Sun, 22 Jun 2014 21:54:57 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7EE62297C;
 Sun, 22 Jun 2014 21:54:57 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5MLsvEm093219;
 Sun, 22 Jun 2014 21:54:57 GMT (envelope-from ache@svn.freebsd.org)
Received: (from ache@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MLsvkt093218;
 Sun, 22 Jun 2014 21:54:57 GMT (envelope-from ache@svn.freebsd.org)
Message-Id: <201406222154.s5MLsvkt093218@svn.freebsd.org>
From: "Andrey A. Chernov" 
Date: Sun, 22 Jun 2014 21:54:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267756 - head/lib/libc/stdlib
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 22 Jun 2014 21:54:57 -0000

Author: ache
Date: Sun Jun 22 21:54:57 2014
New Revision: 267756
URL: http://svnweb.freebsd.org/changeset/base/267756

Log:
  Merge intermediate OpenBSD v1.25 changes (almost identical to ours)
  to reduce diff and bump OpenBSD patch level to v1.26.
  
  MFC after:      2 weeks

Modified:
  head/lib/libc/stdlib/getopt_long.c

Modified: head/lib/libc/stdlib/getopt_long.c
==============================================================================
--- head/lib/libc/stdlib/getopt_long.c	Sun Jun 22 21:37:27 2014	(r267755)
+++ head/lib/libc/stdlib/getopt_long.c	Sun Jun 22 21:54:57 2014	(r267756)
@@ -1,4 +1,4 @@
-/*	$OpenBSD: getopt_long.c,v 1.23 2007/10/31 12:34:57 chl Exp $	*/
+/*	$OpenBSD: getopt_long.c,v 1.26 2013/06/08 22:47:56 millert Exp $	*/
 /*	$NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $	*/
 
 /*
@@ -248,7 +248,7 @@ parse_long_options(char * const *nargv, 
 		if (short_too && current_argv_len == 1)
 			continue;
 
-		if (match == -1)        /* first partial match */
+		if (match == -1)	/* first partial match */
 			match = i;
 		else if ((flags & FLAG_LONGONLY) ||
 			 long_options[i].has_arg !=
@@ -359,37 +359,31 @@ getopt_internal(int nargc, char * const 
 {
 	char *oli;				/* option letter list index */
 	int optchar, short_too;
-	int posixly_correct;	/* no static, can be changed on the fly */
+	static int posixly_correct = -1;
 
 	if (options == NULL)
 		return (-1);
 
 	/*
+	 * XXX Some GNU programs (like cvs) set optind to 0 instead of
+	 * XXX using optreset.  Work around this braindamage.
+	 */
+	if (optind == 0)
+		optind = optreset = 1;
+
+	/*
 	 * Disable GNU extensions if POSIXLY_CORRECT is set or options
 	 * string begins with a '+'.
 	 */
-	posixly_correct = (getenv("POSIXLY_CORRECT") != NULL);
-#ifdef GNU_COMPATIBLE
+	if (posixly_correct == -1 || optreset)
+		posixly_correct = (getenv("POSIXLY_CORRECT") != NULL);
 	if (*options == '-')
 		flags |= FLAG_ALLARGS;
 	else if (posixly_correct || *options == '+')
 		flags &= ~FLAG_PERMUTE;
-#else
-	if (posixly_correct || *options == '+')
-		flags &= ~FLAG_PERMUTE;
-	else if (*options == '-')
-		flags |= FLAG_ALLARGS;
-#endif
 	if (*options == '+' || *options == '-')
 		options++;
 
-	/*
-	 * XXX Some GNU programs (like cvs) set optind to 0 instead of
-	 * XXX using optreset.  Work around this braindamage.
-	 */
-	if (optind == 0)
-		optind = optreset = 1;
-
 	optarg = NULL;
 	if (optreset)
 		nonopt_start = nonopt_end = -1;

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 22 23:40:21 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3902F4C9;
 Sun, 22 Jun 2014 23:40:21 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2465E2116;
 Sun, 22 Jun 2014 23:40:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5MNeLZl045267;
 Sun, 22 Jun 2014 23:40:21 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5MNeKZF045264;
 Sun, 22 Jun 2014 23:40:20 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201406222340.s5MNeKZF045264@svn.freebsd.org>
From: Navdeep Parhar 
Date: Sun, 22 Jun 2014 23:40:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267757 - in head/sys: conf dev/cxgbe dev/cxgbe/firmware
 modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 22 Jun 2014 23:40:21 -0000

Author: np
Date: Sun Jun 22 23:40:20 2014
New Revision: 267757
URL: http://svnweb.freebsd.org/changeset/base/267757

Log:
  cxgbe(4): Update the bundled T4 and T5 firmwares to versions 1.11.27.0.
  
  Obtained from:	Chelsio
  MFC after:	3 days

Added:
  head/sys/dev/cxgbe/firmware/t4fw-1.11.27.0.bin.uu   (contents, props changed)
  head/sys/dev/cxgbe/firmware/t5fw-1.11.27.0.bin.uu   (contents, props changed)
Deleted:
  head/sys/dev/cxgbe/firmware/t4fw-1.9.12.0.bin.uu
  head/sys/dev/cxgbe/firmware/t5fw-1.9.12.0.bin.uu
Modified:
  head/sys/conf/files
  head/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt
  head/sys/dev/cxgbe/firmware/t4fw_interface.h
  head/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt
  head/sys/dev/cxgbe/t4_netmap.c
  head/sys/dev/cxgbe/t4_sge.c
  head/sys/modules/cxgbe/t4_firmware/Makefile
  head/sys/modules/cxgbe/t5_firmware/Makefile

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Sun Jun 22 21:54:57 2014	(r267756)
+++ head/sys/conf/files	Sun Jun 22 23:40:20 2014	(r267757)
@@ -1167,7 +1167,7 @@ t4fw.fwo		optional cxgbe					\
 	no-implicit-rule						\
 	clean		"t4fw.fwo"
 t4fw.fw			optional cxgbe					\
-	dependency	"$S/dev/cxgbe/firmware/t4fw-1.9.12.0.bin.uu"	\
+	dependency	"$S/dev/cxgbe/firmware/t4fw-1.11.27.0.bin.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"t4fw.fw"
@@ -1191,7 +1191,7 @@ t5fw.fwo		optional cxgbe					\
 	no-implicit-rule						\
 	clean		"t5fw.fwo"
 t5fw.fw			optional cxgbe					\
-	dependency	"$S/dev/cxgbe/firmware/t5fw-1.9.12.0.bin.uu"	\
+	dependency	"$S/dev/cxgbe/firmware/t5fw-1.11.27.0.bin.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"t5fw.fw"

Added: head/sys/dev/cxgbe/firmware/t4fw-1.11.27.0.bin.uu
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/cxgbe/firmware/t4fw-1.11.27.0.bin.uu	Sun Jun 22 23:40:20 2014	(r267757)
@@ -0,0 +1,9019 @@
+/*-
+ * Copyright (c) 2014 Chelsio Communications, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+begin-base64 644 t4fw
+AAAD6QELGwAAAQkEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAA8wD2wPjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAENoZWxzaW8gRlcgUlVOTUVNIERFQlVHPTAgKEJ1aWx0IFdlZCBKdW4gMTggMTc6
+MTk6MzMgUERUIDIwMTQgb24gY2xlb3BhdHJhLmFzaWNkZXNpZ25lcnMuY29tOi9ob21lL2Zpcm13
+YXJlL2N2cy9mdy1yZWxlYXNlKSwgVmVyc2lvbiBUNHh4IDAxLjBiLjFiLjAwAAAAAAAAAG/bT/dg
+AMgA4QB78AAQAADhADC4eP///x/84UCAAAAB4QB7cAAAEAAf//zc4QGUcCAAAADhAZwE4QB5AAAC
+AEDhAHmAAAYAQAACAAoABgAK4QB5BAAMAACAAAEC4QB7POEAe0ThAHvk4gAAAAABAADhAHuQIAAA
+AAAAgADhAHsAAABAAeEAe5wAAEAAREREQuAAAADjAARzREREQOMACAAgAAJcAAAAAB//khAAAAAA
+H/+SFAAAAAAf/5IYAAAAAB//khwf/8AAAAAAAAAAAADAABL/zRP/zZMgEv/NE//NhCAEMwGTIBH/
+zBL/zJIQEf/MEv/MkhAR/8wB9DER/8siCv+SEADkMQAFMQECABL/yALnMQIWABH/x4EQAQFfwCEC
+EQHJERH/xBL/xJIQEf/EEv/EkhBgAA8R/78S/8OSEBH/vxL/wpIQgRAR/8HAIJIREv/AkhLAIJIT
+Ev+/khCCEALyUGUv9xH/vccvkhAR/7ySEBL/vBP/vJMgwDKTIRP/u5MigiIS/7oT/7qTICMiIRT/
+uQQzAck4E/+4gzADgxQIMxEU/7akM5MhE/+qkyJgAAjCMJMhE/+nkyIS/7GQIJAhkCKQI5AkkCWQ
+JpAnkCiQKZAqkCuQLJAtkC6QLyAmECAmEYIiEv+kwDAtNzAtNzQtNzgtNzwjPQFyM+0AAgAS/6HA
+MC83AC83EC83IC83MCM9AXIz7QACABL/l8AwKDcwKDc0KDc4KDc8Iz0BcjPtEv+VwDAnNwAnNxAn
+NyAnNzAjPQFyM+0S/5AV/5AW/5HAMNcgBWYBYAAZAAAAAAAAAAQ2BQACANMP0w8FMwxuOxQHRxQH
+BEN2MeYENgUFMwxvO+0AAgAS/4MV/4EjCgACJwIHBEMEPgUFMwwHRxRvO/ADAgAS/33JLoMghCGF
+IrwidDsOhlC0VZYwtDN0M/Rj/+YAZT/iZV/fEv9xwDIDLgUDAgAS/2jAMCg3QCg3RCg3SCg3TCM9
+AXIz7QACABL/ay0nAMARAUkxAEgxAQIAwAAU/2gE0jEV/2eUUBT/ZwTTMRX/ZpRQFP9mBNQxFf9m
+lFAU/2UE1TEV/2WUUBD/ZQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/AAA
+H/wAAOMACfgf/AAAH/wAAOMACfgf/AAAH/wAAOMACfgf/4AAH/+KMOMACfgf/4owH/+KMOMAFCgf
+/4owH/+KMOMAFCgf/4owH/+LuOMAFCgf/4u4H/+SCOMAFbAf/5IQH/+xHOMAHAgf/7EcH/+xHOMA
+OxQf/8AAH//9yeMAOxQgAAAAIAABauMAeOAgAAF4IAABfOMAekwgAAF8IAABheMAelAgAAGYIAAB
+nOMAelwgAAGcIAABpeMAemAgAAG4IAABvOMAemwgAAG8IAABxeMAenAgAAHYIAAB2OMAenwgAAHc
+IAAB4uMAenwgAAH4IAAB+OMAeoQgAAH8IAAB/OMAeoQgAAIYIAACGOMAeoQgAAIcIAACHOMAeoQg
+AAI4IAACOOMAeoQgAAI8IAACPOMAeoQgAAJYIAACWOMAeoQgAAJcIAACYuMAeoQgAAJ4IAACeOMA
+eowgAAJ8IAACguMAeowgAAKYIAHZmeMAepQgAwAAIAMT/OMCUZggAxP8IAMT/OMCZZQgAxQAIAaQ
+XOMCZZggBpBgIAaWEOMF4fggCAAAIAgOMOMF56ggCA4wIAkeUOMF9dggCR5QIAkfHOMHBfggCwAA
+IAsAAOMHBsQgCwAAIAsAAOMHBsQgCwAAIAuPr+MHBsQAAAAAAAAAAAAAAAAgABGWIAARiCAAFXog
+ABGIIAAU9SAAEYggABI9IAAUjSAAFBIgABGIIAATvSAAE3QgABMJIAARdSAAErQgABGIIAARiCAA
+EYggABJcAAAAAP///////w/8///w////APwgAKejIACo4yAAqRMgAKjZIAComSAAqI8gAKhUIACo
+SiAAqEAgAKfwIACpESAAp+YgAKfMAAAAAAAAAAAAAAAAAAAACgAAAAoAAAAUAAAACgAAAAoAAAAK
+AAAACgAAAAoAAAAKAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAIAAwAEAAUABgAHAAgA
+CQAKAA4AEQAVABkAHgAjAC0APABQAGQAyAEsAZAB9AAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAgAC
+AAMAAwADAAMABAAEAAQABAAEAAUABQAFAAUABQAFAAYABgAHAAcAAAACAAAABgAAAAoAAAAOAAAA
+FAAAABwAAAAoAAAAOAAAAFAAAABwAAAAoAAAAOAAAAFAAAABwAAAAoAAAAOAAAAFAQAABwAAAAoA
+AAAOAAAAFAAAABwAAAAoAAAAOAAAAFAAAABwAAAAoAAAAOAAAAFAAAABwAAAAoAAAAOAAP8AAQIC
+AAAAAAAAAAAAAAAQIEAAAAAAAAAAAAAAAAAABAACAAEAAIAAQAAgABAACCBAgAAAAAAAAAAAAAAA
+AAAgCJ5CIAieQiAIngEgCJ3RIAidmiAInYAgCJ2AIAie9iAInvYgCJ2AIAie9iAInvYgCJ2AIAie
+9iAInUwgCJ72IAie9iAInvYgCJ72IAie9iAInvYgCJ72IAie9iAInvYgCJ72IAie9iAInvYgCJ72
+IAie9iAInvYgCJ72IAidYSADCawAAAAAIAMJsAAAAAEgAwm4AAAAAgAAAAAAAAAAIAMJlAAAAAEg
+AwmYAAAAAiADDbgAAAD/IAMHrAAAAP8gAwesAAAAACADDbgAAAAAIAMIvAAAAAEgAwjEAAAABCAD
+CMwAAAAIIAMI2AAAACAgAwjoAAAAQCADCPAAAACAIAMI+AAAAQAgAwkAAAACACADCRQAAAQAIAMJ
+KAAACAAgAwlAAAAQACADCVQAACAAIAMJZAAAQAAgAwlwAACAACADCYQAAQAAAAAAAAAAAAAgAwio
+AAAAECADCLAAAAARIAMIkAAAAAAgAwiUAAAAASADCJgAAAACIAMIoAAAAAMAAAAAAAD//wAAAAAA
+AP//IAMIEAAAAQAgAwgcAAAAgCADCCwAAABAIAMIPAAAACAgAwhMAAAAECADCFwAAAAIIAMIaAAA
+AAQgAwh0AAAAAiADCIAAAAABAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAA
+AQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAABwAAAAcAAAAGAAAABgAMNQAAEEaq
+ABRYVQAYagAAACtoAAAjgwAAGGoAAA0GAAALKgAAAAAAAAAAAAAAAAAAaCsAAGgrAABsggAAb5wA
+AEpoAABKaAAATSkAAEpoAABO6gAATJgAAFI9AABPuAABhqAAAYagAAII1gACCNYAAgjVAAII1QAC
+iwsAAosLAAII1QACtnIAArZyAAMNQAAEBgcAAAAAAAAAAAAAAAAgCRYVIAkWFSAJFgogCRX/IAkV
+8SAJFekgCRXpIAkWGCAJFhggCRXpIAkWGCAJFhggCRXpIAkWGCAJFekgCRYYIAkWGCAJFhggCRYY
+IAkWGCAJFhggCRYYIAkWGCAJFhggCRYYIAkWGCAJFhggCRYYIAkWGCAJFhggCRYYIAkWGAACAgUF
+CAgLCw4OEREUFBcXGhodHSAgIyMmJikpLCwvLzIyNTU4ODs7AAAAAAAAAAEDEREICBAJAwEAAAAA
+AAAgBLdgIAGTPCAANnggAWi8IAGPhCABiXwgAUegIAPaHB//6jQgAJRkIACppB//3RAgAGG8IABT
+IAAAAAAAAAAAIAFqcCAAgbAAAAAAAAAAAB//1fQf/8V8H//ClB//wDAgAE4gIABGRCAAQoAgAKBk
+H//j6CAGZ7gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAGbACABergg
+ALNIIACyfB//8Ggf/9CgH//MOCAAfyggBRkwIAEoGCABB6QgAPCgIADkqCAA2CwgAMqkIAC2ICAE
+uxggA/YcIAEcmCAEFzQgAccsIABhfAAAAAAgALOkIAWDDCAApyAgAXK4IAACmCAAmiQAAAAAAAAA
+AB//87AgALNkIAP4zAAAAAAAAAAAIANWRCAAJtQgAB0MIAAlwAAAAAAgADFwIAAuyCAAK8gAAAAA
+IAA2OCABIFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgADPIIAS3AAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAA1eCADXdAgADSAAAAAAAAAAAAAAAAAAAAAAAAA
+AAQAAAAEAAAACAsAAAAgAxFQCAAAACADEVwIAAAAIAMRaAoAAAAgAxF0DAAAACADEYASAAAAIAMR
+kA0AAAAgAxGkDgAAACADEbQTAAAAIAMRxAoAAAAgAxHYDgAAACADEeQYAAAAIAMR9A0AAAAgAxIQ
+DgAAACADEiAQAAAAIAMSMBIAAAAgAxJEDgAAACADElgQAAAAIAMSaBEAAAAgAxJ8CgAAACADEpAL
+AAAAIAMSnA0AAAAgAxKoFAAAACADErgKAAAAIAMS0A8AAAAgAxLcBgAAACADEuwGAAAAIAMS9AYA
+AAAgAxL8BgAAACADEwQGAAAAIAMTDAkAAAAgAxMUBgAAACADEyAEAAAAIAMTKAYAAAAgAxMwCwAA
+ACADEzgLAAAAIAMTRAQAAAAgAxMoBAAAACADE1AJAAAAIAMTWAkAAAAgAxNkAAAAAAAAAAANAAAA
+IAMTcAoAAAAgAxOABgAAACADE4wCAAAAIAMTlAMAAAAgAw2MAQAAACADE5gAAAAAAAAAANdqpHjo
+x7dWJCBw28G9zu71fA+vR4fGKqgwRhP9RpUBaYCY2ItE96///1uxiVzXvmuQESL9mHGTpnlDjkm0
+CCH2HiViwECzQCZeWlHptseq1i8QXQJEFFPYoeaB59P7yCHhzebDNwfW9NUNh0VaFO2p4+kF/O+j
++GdvAtmNKkyK//o5Qodx9oFtnWEi/eU4DKS+6kRL3s+p9rtLYL6/vHAom37G6qEn+tTvMIUEiB0F
+2dTQOebbmeUfonz4xKxWZfQpIkRDKv+Xq5Qjp/yToDllW1nDjwzMkv/v9H2FhF3Rb6h+T/4s5uCj
+AUMUTggRofdTfoK9OvI1KtfSu+uG05EHDBEWBwwRFgcMERYHDBEWBQkOFAUJDhQFCQ4UBQkOFAQL
+EBcECxAXBAsQFwQLEBcGCg8VBgoPFQYKDxUGCg8VH//AAAAEACAgBpYQIAaZwB/83gAf/53UIAaW
+QB//nuQf/6IwA4AAAIEAAAAf/6IgAP/4AAEAAAAAEAAAgQQBAIEEAAABBAAAAQQBAIAAAAAABf//
+H/+FYAYAAAAqAAAAH//P+CAEMngCAAAAgBAAAEFAAABBQAEAgwAAAf//v/+/////H/+XcAQAAAgg
+AwuggYAAAAwAAAAf/5Jg//8AAP//AP8AAQAAAAD//x//raAf/5q0D////x//n+gf/OIAH/+kHB//
+oOQf/6OQH/+kFB/84ODg//4A4QGSAB//l+QA////H/+fnB//m/QEQQAIBAEACKUAAADAAAAAwAQA
+ADAAAAAf/6AgAAAPoAAA/4AgBpBgIAtUYOEALgAf/6AUH/+b/B//oPAf/5xgH/+gQOAAAKDhADC4
+AACAAOEAYBAAAEAA4QIQAOECMADhAlAA4QJwAOEAEAgf/OFA4QB7cB//sNwf/7DUH/zgCB//sNgf
+/7D0H/+w7B//sPAf/7EMH/+xBB//sQgf/53UH/+toCAGlkAf/N4AH/+e5AEAAAAf/6BgH/+fbB//
+nAQf/6DsAAD/gAAAEIAf/5JgH/+g+B//oPQf/6FYBAAACAUAAACD/wAAgQAAAAAQAAAqAAAAIAAH
+7CADCsgf/4lwH/+FYB//ojBnRSMB782riZi63P4QMlR2H/+AAAAAPyggAw2Mz////yALBhAQAAAA
+P////wIAAABAAAAA//9//yALBzAf/6IgIAAhsCALB9AIAAAAAP///yALCEAgCwdg9////yALCjAg
+AB5Y//7//yALFCAAIAAAAABAAAwAAAAAAP//AACAAA0AAAAgACRg//v//w/2gAAAA///AAAn/yAL
+GFAgCxiAAAEAAAAEAAAfgAA/H/+feCAAMXAgADOEIAAuyCALGRAgCxmwIAAryCALGgAgCxqQBAEA
+COAAAAAf/5+EUwAAAFIAAABRAAAAIAHRpB//nFggCx0wIAsdkCALHWAgCyAQH/+fnCALIGAf/5v8
+H/+fUCALIgAUAAAAgAAAAIAAAAJ4AAAAgAAABoAAsAAAAAoAAOMwkv//8ACAALEA4QGaAAACAAAg
+CyHAH/+ZmAAAfkAf/5+IAP/AAB//n4wf/5LkKAAAACYAAAAgCyIwH/+TIAYAAAAFgAAAIAtoEB//
+m8ArAAAAIABJCB//nVA1AAAAA4AAAAMAAAAH////AD///4BAAAAID///H////yAAAAAAAMAAPQAA
+AB//mBAHAAAAgQQBAIEEAAAf/52wAAA6mMMAAAAAAA//AEMAAAAACAAEAAAAIAtocB//sFAf/63A
+H/+XcAAGAADhAHoAH/+X4B//n3AgoAAAH/+cCB//newf/534IAtooAADB4AgC2kQH/+Z4ABAAAAA
+AAkAAAAwAv/8+H/AAAAAo/+7AKP/ugDgAwAAg/+2AA////8P//gA/wAAACALaVAgCyQwIAskYCAL
+aeAADwAAAAoAAP//AA8f/590A//AAIP/wAAgC2pgIAtq0B//oAQf/OIAH/+kHB//rjD/YPAAH/+u
+EB//pCAf/5IgBIAACB//gFAARAAA/x///wDAAAAAAIEA8AAAAIGAAAD/f///H/zgdB//mrT/v///
+//8AAACAAAAAAIbdH/+TEB/84gzuAAAADwAAAB//n5Qf/6QYAAAPSB/84ggf/5gMH/+AYCAGkkAA
+ADAAAAAnEB//3IAgC3LwH/+g5B//oEQAAP/+H/+b8N6tvu8gAwYQNAAAAD8AAAAAAIkGAJkAAB//
+rXgQAAcCAcCAAB//rEiZAAAAH/+uNACIAAiCgAABH/+tyB//rNQDFQAAAxEAAAAPA/8gCyjQIAsp
+MCALKYAgCyngIAspACAA30QgCyuAIAsrsCALLAAgCyxgIADk8CkAAAAgAOtsIAtzQCALc6AgC3QQ
+8PDw8P8A/wCqqqqqzMzMzB//sEAAAB3gH/+uSCAA/EggC3SgIAt1EAAPQkAgBB3QH/+fzB//oDAA
+CQAAAABIAIIAAAAgASBYIAt1kCALdgAACQAIH/+tPDAAAAAf/62IAAAIBgAAiMwAAIkUfwAAACAL
+enAgC3sAAADgACALeLAgC3rQH/+ZnAAEA/8KAAAAH/+sZB//n0Af/5tgg/+3AIP/tiAgCzSw4QAA
+ADMAAAAf/6xUH/+uhAP/4AAAP/aQAAAdKB//rZAD//AAIAtlYCALZSAgC2WAH/+vkCALNPAaAAAA
+H/+b+CALNUAgAWAwH/+tjB//ncQAD///AADerR//rUAgC3uQH/+cICADB2Af/5wQH/+eBCAAZeAf
+/5zsIAAFzB//mSwf/5esIAt8oB//nGwf/6L0H/+jgCALfPDABAAAH/+eECADDFAgAGbA4AEAACAL
+fjAgCzhAIACkrCAAojAgC32wIAt+ACAGkGAf/5m8IAs5sOD//gAgC1iAH/+kLCALQfAf/5RIIAtM
+wCALTVAgC1AAIAtQMEgAAAAgAaMgH/+dYCABpSQf/5hgH/+a9B//neQf/5tMAAAK4AAACOwf/54c
+IAaWNB//m9Qf/5fk4QAuAB//nijhAF4A4QIOAP//v//hAA4A4QGOAP//vv8f/5v0IAGqQCABtmjg
+BQAAA/8AAB//m5QgAwugPAAAAAAF//+DAAAAH/+a/CABy+wf/6BUIAtXoAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAgYAAAAAAAAD/////////////////////H//70B//+9Af//uYH//7mB//+5gf//uY
+H//1KB//+FAf//asH//2rB//9qwgBmmoAAAAAAAAAAAAAAAAAAAAACAGbSggBm0oAAAAAAAAAAAA
+AAAAAAAAACAGaaggBmmoH//5RB//+UQf//lEH//5RB//+UQf//lEAAAAACABq1gAAAAAAAAAAAAA
+AAAAAAAAAgEAAAAAAAAAAAAAAAAAAAQAAAAAAAAAgYAAAAAAABAFAAAAAAAABAAAAAAAAAAAAAAA
+AAAAAACBAAAAAAAAGAUAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAACAKABHyixPyi9MPA+YxAQIAFvKJF/KKd2sGkGC0Zndj+FQPBVWz
+4A8UAGP/+QAAAGwQCCggBScgBykxBfgghhXgGUUA+QAOhWF3AQCKIhbyfP3k+gXgDJUA8Ve8DeAP
+pQDq8ngbxwKAAKaIK4KeCnkKKZK//WANg6IAnQAogp0JiAHoFgUkDVGAACjSCPcADaiSAJ0AK2Ku
+7PJtFYq5gAAqYq0swn/sqwEEc/0AAP1ACh4iAJ0ALtYI/UAKHiIAnQAvIBSk/w8PRy8kFPXgDF3S
+AJ0AGfJfLiIWLCEpiBUf8l2uzJ+A6iIeLmfCgAD9AGYVoA0lAP0ARhXgC2UA7fJWHVYCgAALqgKL
+FJqB6QAVBEBBAACJFQgAiig8EP0gxhXgTAUA/SDmFaAMRQDsuzYEyIEAAG25BQgAhgkCYe7yRxWg
+h4AAiBXuAAUNzwKAAKmI6IwgJaQ1AAALyQxtmQIIAmEtISnTD+ohKCboBQAADQ1PLSUp/UAHdGIA
+nQD/5HAF4AwVAPogqBXgHuUA6iIeLs1CgAD4ICYV4AgFAPggBhWgDQUA6BYCJdmBAABYfoL+4AAX
+N8UBAPfAAEcwDZUA7eadKAQKgAD5gAVZUgCdAMAg0Q8AAADqJAAJ2ASAAOxEAAroBIAAWIBp0qDR
+DwAAAADAsA+JNOnWCC32LgAA+kBoHaAbxQD8AAIdoA0VAFiDnmP/wQAA6iQACtgEgABYgerSoNEP
+AP/5WA2gCAUA6iQAA9hhAAD8AAIdoA2VAFiDkmP/kcCgWa5sHfH/iNj5H/IIkA+lAGP/pNogWAti
+Y/5wAAAAAAD8AAId4AoFAPpFJB2v/CoAiifrRAAKaASAAPtEABWgDAUAWHn90qDRDwAAAGwQBi4i
+EJQR5SEaKtAEgAAmIAf2QSgV4B/FAOoWACrHwoAA/wJSDeFmAQAHCULxIHAN4oUBAGSB8tTwKSAF
+/EBIFaAbhQD+ngANsBpFAPsgD5UiAJ0A5/HWHgvWAADl8dMbTwKAAPTADBISAJ0ApZktkp4Hagoq
+or/3oBG7UgCdACmSnQqZAe6UAASOSYAAjCmLKgwHPgy7DPdgCQPiAJ0AKiBOLSBMsaj7oA3sIAsV
+ACgkTiowASkiGPNADfaSAJ0AKyAHLSEk+GAkFaAMVQD9QAQFMLsRAOCqEQ3agoAAC6oCG/G7CogC
+KiEHLCEJC90C+wYADHqqAQDr8bYdUwKAAArMAiohIpjgiCCc453kC6oCmuL9AAAUMAplAAqIApjh
+LSIQneUsIDgb8av4ACIdoE0VAPnBJhWgzBkADNg5HfGnlOgMvTn5pgAOsAsFAJvnGPGanebt8ZsU
+4AUAACwmGJvrmeroABUHSMEAAAkAiu3mDiHIQQAA7+YPJ3kBAAAJIIYPAmMJAIYPAmEMbhGl7urm
+nSOAsYAAiCkvIDiniCgmCfPgCBeSAJ0AiRAJCUf5IAcBUgCdAMAg0Q+eEuokAAvYBIAAWILMjhL/
+TRAN4B/FAOwSASlQBIAA7RIAKdgEgABYf8XSoNEPAB7xcoro90AGOJIAnQAMaRGlmSuSnvdgBotS
+AJ0AKZKdB2sKK7K/C5kBZJC/sKyc6O6UAAzzfgAAYAAsAAAAAADz3/BIUgCdAAlUDPSdABWv+AIA
+AAAAAADrEgApUASAAFiBOtKg0Q8A6iQAA1hhAAD8ACIdoA1lAFiC5GP/aY0iwOQO3QL8QEYV7/1+
+AAAAAPhDqBWk2QEAANEEALwaDIgC+EOmFa/4xgCKJ40RwMDqrCAu2ASAAFh5UtKg0Q/aIFh/W2P+
++QAA//c8DaAJBQDAoFmtqh7xPIro+V/5eJAfxQD//SgNoAkFAMCQwLoLqzT7wQYV7/zuAAAAAGwQ
+DpUcKCIQLiIJJyE1KSAHIxYOKjIC/mCIFeANFQD8YGgdp7UBAOMhGiXb+QAAC9s5+iGmFeGZAQDn
+/zYJt8KAAP7CUg3jqgEADg5C8cBwDeLTAQBk1GMmIAXB6Pn+AA8wF0UA9sAkHWIAnQCHIose9OX8
+DeAOhQArsAGfEfNgIScSAJ0AmRCZGpoUGPEO7fEOEjANAADmFgssrwKAAOhVCAzfgoAArbvrFgki
+cAUAAIkanhiNG/UgBqoSAJ0AK1Kehhn9YAoj4gCdAC9SnSZivwb/AWT0ORnw/YmY9yAJmJIAnQAq
+gq5koVIa8Pkjgq0qon8d8PYKOwHrFgUk2/0AAPpgCeYiAJ0Am9j6YB9mIgCdAIcphioMAz4HZgzy
+wAmr4gCdACkaAPMiMg3g+vUAKyAWnBP7YAn9IgCdAIsRhsMqIDj34OYVoAYFAPfhJhWgRwUA++EG
+FeCqGQAKdjkX8OeWFi0iFxbw5J36LSIbnfuJxAp2OZYX+WARSuIAnQCGHZ4f7BYDIw3ZgABgAQgZ
+8M+JmGqRLosbKlKejxl7o0stUp0v8r8P3QGdFYYV6/DHFNP9AADvZAADAemAAJq4Zf8TYANKnh/8
+IGYVoAoFAFmtKxnwvomYGPC6jBPuEg8kjtsAAP//XA2gDwUAwKD6IKYVr/7mAB3wtcC6C5s0+6EG
+Fe/+9gAAAAAA//sUDaAPBQCeHy8WEPwgZhWgCgUAWa0XGfCqjBMvEhCJmI4fGPCl+T/1cJIAnQBg
+Ar3AoJoVixUW8KLA2g2dNO1mCC32JgAAYAKknh8vFhCcE+okAAnYBIAAWIHqjBMvEhDuEg8ldaGA
+AGACWp4fLxYQ+kDwFaAMBQBYgcCMEy8SEO4SDy11ZgAAYAPHjheLE4gUjBH2IMgVr4oFACokOwyZ
+DAhmApm0rNgG7gItIhDoJhspUASAAFiAZI4fjBMY8H76s6YVoQkFAHObDSsgFioK//tgBE0iAJ0A
+iikrIDgPAgCjquomCSgECoAA82AEP5IAnQAmITUvwgQrIRopIhDm/zYN78KAAH/bCwoKQmSgBQsN
+QmTQc/4gJhXgHYUA+f4ADvAKFQD6IaYVoAY1APYhhhWv9cYAiicvFhCLHuqsICpgBIAAWH0OLxIQ
+mhMtIhv5QIgV7/zeAAAAAAAAAOogByngBIAAWIFvGPBTjBP+IegVr/2eANogWH5rGPBOjBOOH/pB
+KBWv/bYAcZ6ICr8M//0AFe/+CgCLFIoWLSIQGfBUC6oCG/BUCmgChh0a8EsJiALp8EobCz4AACMW
+ESUWEiYgB4XAIyEH9kEkFeBmEQDrVQELMoKAAPamAAq6MwEA5iEiKZsCgAADdwIKVQIjISQJZgKV
+8IUgl/OW8v3gphXjmAEA6PYGLMoCgAAJOQLjEhEiU/kAAOn2BCquAoAA5eUCBkCBAADl9gEnyMEA
+AOUSEiIUNQAAbakFCACGCQJhJiAUpGYGBkcmJBT0wAg10gCdAIgY+LOmFaEHBQDy4fIN4Pn1ACsg
+FvlgCM1iAJ0AKiIXsarqJhchgKmAAIwpKyA4o8ycKfNgB5+SAJ0AjR1l0M/AINEPLyBOZPvZDngC
++EBGFaAAhgAAAAAAAPMf3MBSAJ0ADj8M//0AFe/uNgAAAAAAAOsSDilQBIAA7RIMKmAEgABYfkvS
+oNEPAOsSDClQBIAAWH/W0qDRDwD6QGgdoBvFAPwAIh2gDRUAWIGAY//BixD6QGgdoAwVAO0SCyXY
+YQAAWIF6Y/+pAAAmIDtkYHHqJAAOWASAAPwgKBWviQUA6SQ7LHAEgABYf8P6IQYVoAsFACsmG/pH
+Zh3v+84AAAAAAOsSBSlQBIAAWAk/Y/7viifrRAAKaASAAPtEABWgDAUAWHff0qDRDwDaIFh96WP/
+COogByngBIAAWIDlY/7cAAAnIQklFhIjFhEkFhMmIAeEwCMhJPRA5BXgZhEA60QBCzKCgAAGRAIK
+RAL2REQVqrUBAOsiBy3TAoAACncCCWYCKrEVmhKU8IUgl/OW8v3gphXjSAEA6PYGKiICgAAEMwLj
+9gQl2IEAAPQiaBWvwwUAA7sBIxIR66kICq4CgAAF5QLl9gEmYIEAAOUSEiTJAQAA6ctDfkAEgAAt
+TP4M1hGmhuaTO3fgwQAA9J/v8RIAnQBt2QUIAIYMAmFj/e2LEPpAaB2gDBUA+2JAFeANBQBYgSdj
+/loAAAD7jwAMP/72AAidDA1JFG2ZBQgghgwCY+/aCAXBAQAA6UwMBUjBAAD1n+1BEgCdACvM/m25
+BQhAhgkCZWP9lAAAbBAGKCAFHO+C997+BeAaRQD7AAqdIgCdACsgTonIsLsrJE73IAjIkgCdAC5y
+ru3veRcRcYAAK3KtLdJ/DbsB5rQABZEpgACwnu7GCCWIOYAALyAUs/8PD0cvJBT14BDF0gCdAC4g
+c/hDqBXv+vUA+8AEANALFQDguBoHaAUAAPsXAA003QEALSRzCYgBCLg5CpkB6SYdLAcOAACKInyn
+BCggTsmPfacIKyBMKSBOe5MUzGwsIBTtIgIuWBwAAGTRycAg0Q8AjifH8w+vAe8mAidQwQAAWG6V
+4+9dFQE5gAAooADTD9MPA4gKKIIQ7KAHLVgEgAD6QGgdoA1FAAuAAGWv3Ikn0w9kn6YqmRTKp4qZ
+ZK+cKKAAA4gKKIIQ7KAHLVgEgAD6QGgdoA01AAuAAGWv4GP/egAA//9UDaAKBQDAoFmroBzvMonI
++T/26JIAnQDAYCkgFLOZ+EKGHe/8HgAAAAAAAAAA6iQACtgEgABYfwjSoNEPACogBSsgB8HU/UAO
+ZWG7AQAFBUf4oA55UgCdAJMQjTadEu3vHB2YBIAA9WAJihIAnQAMuhGnqi6invfADZzSAJ0AKqKd
+DbwKLMK/DKoBZKE9+kAIFeAMFQBYILcd7xEpIQkY7xErISIvIAce7xssIST5ZgANsP8RAOgSAi/6
+goAAD8wCDswCLKYAjiCbovlAphWgDyUA6aYDL3YCgAAP7gL/QCYVoAkFAO0AFQVQYQAAsZnqgx4M
+j+gAAAw5EfcgAETwCKUAKJad9L/yuRIAnQCKJ+tEAApoBIAA+0QAFaAMBQBYdvtj/jr/92wNoAsF
+AMC6C5s068YIK28GAABj/tvqJAALWASAAFgIS/3dxgWv93YAiifAsPtEABWgDBUAWH+KGe7umaD+
+QAgVoBvFAPnd2AWgDBUA+UBGFaANFQD9wAAXMAgVAOjuAg14BIAA7vYBKVAEgABYgGHAINEPicj3
+IASgkgCdAAw6EaeqLqKe98AFVNIAnQAqop0NPgou4r8OqgFkoJiwn5/IZa7BiCLrFgEkBOGAAPi/
+7DlSAJ0AiicrCgD7RAAVoAwVAFh7aosQHu7KnqCMIB3uyp2i/YAAFjANFQANzAKcoYu2+0BmFe/1
+SgAAAADrVAAJUASAAFh+jmP9PI8z/iBGFe/41gD/+WQNoAoFAPogJhXgCgUAWasSHO6liciLER3u
+ovk/+riSAJ0A//3IDaAKBQAAwKDAigiYNPmBBhWv/YoAAAAA6iQABdhhAAD8ACIdoA2lAFiAJmP/
+UQAAbBAEKCAU74seahgEgACKJ/pgaB3gDAUA6qwgKegEgABYdpnSoNEPAIsic75LFO6IikhqoUcb
+7oQssq7Kxx3uhSyyrS3Sfw3LAX3AG7Cunkh9wCEvIBTvJBQv2tAAANogWAfjY/+nwLDAigioNOhG
+CC3/FgAAiSLJlcAg0Q/AoFmq4YpIa6GtY//qAAAAAAAA+kBoHaAbxQD8ACIdoA0VAFh//MAg0Q8A
+bBAILCIPLyAHKCE0JzIH/kNEFafVAQD5v8AV4AsVAOm5OQmwBIAA6yIJKlAEgAD4IIYV4AQVAOh3
+Ng9PwoAA9yJSDeH/AQALCULxIHAN4o4BAGSCcsG07HsfDpR0AAAsIE/pIE0mYAUAAAwMRywkT/0g
+FKOiAJ0ALCAF+4AS/WIAnQCNIvogBhWv+zUA/WAOWOIAnQAoIhmOMvnAFNUiAJ0AiTgY7kMc7j/k
+kmJv34KAAJoQmBGsu+juOhVIDQAAmRPrFgIvpwKAAKhE9eANIhIAnQCLEypCnvtAGxviAJ0AihIp
+Qp3TDyqivwqZAe6UAASScYAAjCmLKgwFPtMPDLsM9WAJ2+IAnQAtGgD1ofIN4Pj1ACsgFvlgGXUi
+AJ0ALCEiGe41KCEHKiEkKyEJ/EDwFeqIAQDpqgIMQwKAAAi7AhnuLhjuHw0tQOnMAg7qgoAACN0C
+neCJIJzimuT7wGYV4ApVAOvuJhzOAoAACpkCmeGIL5jlLCA498EGFeANBQD9wOYV4AolAP3cPAXg
+SSUA+MCIFaDMGQAMmjmY6QzbOY1lneod7hj8wMgVoAkFAOzmCyOH4YAACpwQDcwCnOyMEYlol++Z
+7ohpKOYQjWot5hHsABUHSSEAAAkAiohn+OALo6IAnQAf7f0KvQIP3QKd5sDF/JOmFaEJBQD1IfIN
+4Pj1ACsgFvlgE6UiAJ0ALCIZiikrIE8pIDjlqggGYAUAAOwmGSXb/QAAKyRPminzIA+PkgCdAIsU
+ZbHvwCDRD58VnxaeF+okAArYBIAAWH8njhfvEgUldZGAAIwUZc/biifbMOwSACVQwQAAWHpEwCDR
+DxrtzYqo90AQiJIAnQCMEytCnv1gEUOiAJ0AixIpQp0rsr8d7cQLmQHkkhRlY/0AAJzY7pQADPJm
+AABgAI4oIDnxH/gOEgCdAP/75A2gCRUAAAAAAPOf7EhSAJ0ACecM9v2AFe/1+gAAAADBs3vJFCkg
+OpoQ/iDGFeAM9QD9IBD9IgCdAOokAArYBIAAWH2K0qDRDwDwABgNoBrVAMChjDcrIQmNOI4y668R
+Dd0CgAAPuwLkuwIJUASAAFh9bsAg0Q8AAAD//1gNoBqFAOokAAfYYQAA/CBoFeAMFQBYfyZj/wUA
+AAq4ApjmwNX8k6YV4QwFAHXLDSsgFikK//lgDjViAJ0AihRkoV2LaoxnimmrewfMDJxn92DSDeAO
+BQCxqoxlm2qLZppprOqre3e7AbGqjimbZpplLSA4pe6eKfOgCjeSAJ0AiScomRTKgouZyb4Z7Yco
+sACfFZ8WCYgKKIIQLLAH+kBoHaANNQALgACPFYsix6P7X/KA4gCdACghNIdnLiEaii+LKeh3Ng9n
+woAAd8sKCwlCyJQOC0JksLTB1Pr+AA6wDBUA/CCGFa/yrgDaIFh7emP+Coon6qwwK1gEgABYZwXS
+oNEPAAD/8qgNoAkFAAAAnxWfFp4X+kDwFaAMBQBYfoKOF+8SBS1l/gAA6iQAB9hJAAD8ACIdoA0F
+AFh+3WP94AAAAAAA6iAHKuAEgABYfmFj/YGfFf4gxhXgCgUAWamwGu1DiqiPFflf7tiSAJ0A//fg
+DaAJBQDAkBztPcC6C6s0+4EGFe/3mgAAAAAA81/6OFIAnQAJ5wz2/YAV7/zyAIonnxXvFgYp2ASA
+AOwSACVQwQAAWHmk1qD+IKgV7/oWAJ8V7xYGKVAEgABYe0L+IKgV7/q2AAAAwVP6QGgdoAsFAPwA
+Ah2gDTUAWHPXKyAFjxaKEPV/2oViAJ0AY/0hnxWfFuogByrgBIAAWH4y/iCoFe/4rgAAAABsEA6T
+HJUaiC+KKS4hGichNC8yBPhA8BXntQEA+3/AFeANFQAL2znrFgsp4ASAAPfhAA/xmQEA5yAFLzfC
+gAD+wfIN4qoBAPFAcA3ibgEAZGRBwaQI+o364CNNIgCdAI4iixz1xFwN4AqFACuwAZ8S82AgVxIA
+nQCZEZkYGOz06+z0EmgNAADtFgksrwKAAOhVCAzXgoAAq6rqFgcicAUAAIYYnhaLGfTABeoSAJ0A
+KlKehhf7QAlj4gCdAC9SnSZivwb/AWT0IRns44mY9yAI4JIAnQAqgq5koTka7N8jgq0qon8d7NwK
+OwHrFgMk2/0AAPpgCR4iAJ0Am9j6YB6mIgCdAIcphioMAz4HZgzywAjj4gCdACkaAPMiMg3g+vUA
+KyAWnBD7YAklIgCdABvs4CkgOPvZvAWgBgUA9+DmFaBHBQD9gIgV4JkZAAl2OQm6OYsSmhSWFf1g
+EdLiAJ0AhhtkYdNgAQMZ7LuJmGqRLosZKlKejxd7o0stUp0v8r8P3QGdE4YT6+yzFNP9AADvZAAD
+AemAAJq4Zf8rYANKnh38IAYVoAoFAFmpFxnsqomYjBAY7KbuEg0kjtsAAP//XA2gDwUAwKD6IGYV
+r/7mAB3socC6C5s0+6EGFe/+9gAAAAAA//t0DaAPBQAAnh2fHvwgBhWgCgUAWakDGeyWjBCPHomY
+jh0Y7JH5P/Y4kgCdAGACvsCgmhOLExbsjsDaDZ007WYILfbuAABgAqWeHZ8enBDqJAAJ2ASAAFh9
+1owQjx7uEg0ldnmAAGACXZ4dnx76QPAVoAwFAFh9rYwQjx7uEg0tdk4AAGADxJwQ/iGmFa+JBQDp
+JDsmOEEAAAcAhucSAiewgQAABgJhjceX+IrEicatfQeqDJrEd9sJnh3sFgAkyAUAAIwSixCGFY4U
+mbadtwbuAu0iDylQBIAAWHxIjh0Y7GKMEPqzphWhBwUAc3sIKyAWKQr/ebl+iikrIDijquomCSgE
+CoAA82AEJ5IAnQAmITSPxCshGokv5v82De/CgAB/2woKCkLIpAsNQmTQc/4gRhXgHUUA+f4ADvAK
+FQD6IWYVoAY1APYhRhWv9cYAAAAAAACeHYonnx6LHOqsICpgBIAAWHjy7xIOLWAEgAD+IagVr/xS
+AOogByngBIAAWH1VjBAY7Dj+IagVr/22ANogWHpRjBAY7DSOHfpBKBWv/cIAcZ6ICr8M//2AFe/+
+CgAX7DYb7DYd7DsGqQKGGxrsOu2ZAgZAQQAA5WFUZ+iBAAAlFhCTHyUgB4PABSVA6jMBCqqCgAAF
+MwIHMwInIQcqISImIQn0QegV6ncBAOuqAgu7AoAAB2YCJyEkk/CDIJbzmfaa8vXgphXjqQEA5RIQ
+LVICgAAKdwLn9gQpngKAAAPjAuP2ASJT/QAA4xIPIgw1AABtqQUIAIYNAmEmIBSkZgYGRyYkFPTA
+CB3SAJ0AiBb4s6YVoQcFAPLh8g3g+fUAKyAW+WAItWIAnQDIP4spKiA4o7ubKfNAB9+SAJ0AjBtl
+wNfAINEPLSBOZNvzCugC+EBGFaAAhgAAAAAAAPMf3dBSAJ0ACu8M//2AFe/uvgAAAAAAAOsSDClQ
+BIAA7RIKKmAEgABYejfSoNEPAOsSCilQBIAAWHvC0qDRDwD6QGgdoBvFAPwAIh2gDRUAWH1sY//B
+ixH6QGgdoAwVAO0SCSXYYQAAWH1mY/+pAAAAAAAmIDtkYHcr+oArJDvsEgIuWASAAAgghg0CY+z2
+CCzwBIAA7SIPKVAEgABYe6v6IMYVoAwFAPxHZh2v+8oA6xIDKVAEgABYBSlj/vKKJ+tEAApoBIAA
++0QAFaAMBQBYc8nSoNEPANogWHnTY/8A6iAHKeAEgABYfM9j/t8AAAAnIQckFhEmIAeEwJMf8kRE
+FeBmEQDqRAELMoKAAAZEAhbrsiwhJIonBkQCJiEJ+mYACfp3AQDroRUruwKAAAdmAocvlPCEIJf1
+k/L34GYVozkBAOn2BimaAoAAA8wC4xIPKiYCgAAE5ALs9gQlUIEAAPXgJhWvzAUADKoBqrzkEhEm
+YQEAAOyLPXxIBIAAsEgMhhGmlnbDNvSf8IiSAJ0AbYkFCUCGDQJlY/4AixH6QGgdoAwVAPtiQBXg
+DQUAWH0VY/5iAAAA+w8ADP//DgAJzAwMSBRtiQUJYIYNAmfvzQgFSQEAAOhMDAbAgQAA9Z/t2JIA
+nQCwzm3pBQmAhggCaWP9qAAAAGwQBiggBSMgByQKA/0PQERRMwEAKCAiZIBvAioCWHGQ/UzAgNAN
+FQAsICEY62UPAgDsMxEGfVaAAKgzKTKeDwIAbpNFKzKdZLA/+kAIFaD+5QAOzgH9xgAO8A8FAPxE
+Jh3gCQUA+CAGFeAMBQD4ICYV4A6VAPggRhXgDQUAWHeu9HOmFaACBQDRD8Ag0Q8AAGwQCiogBfhA
+8BXgDBUA+GBoHae1AQDoFgAl2/kAAOvLOQoYBIAA6xYFLCAEgAD9QcAEUZkBAMHD/UAf5SIAnQCN
+Iu/rPB6b3gAA6+s5EbARAADmFgQs94KAAK/u7hYDLNcCgACrquoWByzABIAAhxf1AAQiEgCdAIoU
+J3KehhOPF/rgB1uiAJ0AJmK/L/KdBv8B7xYGJ5nRgAAlIRuKQocphioFpTb1TwAOcQsFAHyzAdWg
+mBoHZgz0wAXj4gCdACoaAPVCMg3g/PUAKyAWmBr9YAX9IgCdAIpC+qAOeqIAnQCMFRvrLodDmBrr
+dwEGCPmAAGAAtgAAGusQiqjoFgolDN+AAIsXjBSGEyuyno8XJmK/fLNDL/KdHOsHBv8B5PA5ZVv9
+AACbyO8WBi/7bgAAYAKbAAAAAPghZhXgCgUAWadqGur9iqiJG+gSCiUO3wAA//9MDaAPBQDA8Bzq
+98C6C6s0+4EGFe//BgAAAAAA//x4DaAPBQCZG+okAArYBIAAWHw+iRvoEgoleamAAGACLgCZG/pA
+8BWgDAUAWHwViRvoEgoteZYAAGADEvDgBIhSAJ0ALSEajCmXGPghRhWi7QEA6RYLLwQWAACXGPgh
+RhWi7AEA6RYLJwOBgACYGukWCy7/woAAdfteDtUM+dXYBaC36QDmQgMt3IKAAAt5ApkYCGYB9oBm
+FaABAgCKJ5kbKxIA6qwgKeAEgABYd3aJG/ghSBWgCyUA66QCLSAEgADqogIoBAqAAPL/+7hSAJ0A
+jCmXGJgamRuOGI8W5a0MClgEgADlzAgJUASAAO1GAiroBIAA7CYJKeAEgABYd5GIGokbjxf786YV
+oQ4FAHXrCCsgFiYK/3a5DMCh+iCmFa/3dgAAAADqIAcq4ASAAFh7v4kb+CFIFa//igCPKRjqvYkW
+pf+fKYxDi0CNFefEAATIgQAA/A4ABTfrAQDuFgEuiKYAACcgBwcHQQh3Cidyn+6tEA1TwoAA7aoC
+AkBBAADqdwEB0/0AAOfHAgGMPQAAbakFCACGCQJhi0DAgJgSGeqoGuqnLyEahhYe6qQkIQcY6qH8
+ICgVodcxAP+gAEa6RAEA7dCAKicCgADszA8mcEEAAPiGAAo0zB0A5GYAJmAFAAAMPAwU6nwNXQyI
+IJ9ml2eeY51lDKQ5CYkC6WYELEYCgADkZgIh0AUAAAioAphhJiAU42YIDSAEgADmJBQoBAqAAPNg
+BAqSAJ0AiBf1E6YVoQcFAPTh8g3g+fUAKyAW+WAFDWIAnQCIEtKA0Q+KFWSgosAg0Q8AAAAAAADq
+JAAE2GEAAPwgiBXgDBUAWHvmY//aiif8ISYVp9tBAOqsICgECoAA9aAEYdIAnQCMFisKAezMICno
+BIAAWHJYmhL6gAgV7/vuAACLFuxNEQlQBIAA/WAARfAMFQBYcDr0gGAVr/2qAGW8BPlf4AjSAJ0A
+LyAg8f/ft5IAnQBj/3QAAAAAAAAA6iAHKuAEgABYe0+IEtKA0Q+KJ9ww6xIAJVCBAABYduDAsvtA
+Rh3gAgUA0Q8AAAAA6zQADjgEgAD8YGgd4AwFAFhyNdtA7DQACugEgADqFgIr8ASAAO8SBilQBIAA
+WHb/+oAIFe/7HgDqJAAE2EkAAPwAIh2gDQUAWHuqY/7qAABsEAiSFJMVGeoliED4IEYVr8sFAOsq
+AQJwIQAA+iBmFaeIQQDkgcBiUBEAAI8TLSEFqYwswACv3wTMC+/8QC5YBIAA/4ANiuIAnQD6ICYV
+oGgBAP4AIh3gDQUABv04C98L690KB9ghAACCFZ4Q+QAARXAMJQDyQQAV4A8FAPJAgBWgAg4AjRQO
+VQz/4CAVoAMFAO/kAARABQAA8Q5gDeB+AQCGEyKgAC3RBQQiC+bWCAlYBIAA4hYGIzEBAAD2QAZ6
+ogCdAAgGQPIAIh2gDQUABi04C9IL690KAVghAAD3IBAVoAIVAAcjOIcVB2YLF+n8pzcncKAGMgoG
+MwvsfAgBmCEAAI7QCwCJBe42LiYAAwCLItIA6qwBJMgFAAD0X/sj4gCdAAUpDA4qDPugBhWgBxUA
+9WAoFeAGBQAJdjgIaAgisgAF5QgltgF+WwIiLAHitgAmfRKAABbp44sSHuni5rYBB5AFAAAGIgKG
+Fe67AQxuAoAADbsCkmD6gAYV4SwdANEPixD8ICgV7/1SAAAA/E8ADf/8xgCFFRnpswXFC/gAChXg
+AgUAsSLlgx4JD+gAAB3pzIYSGunM7W0BB9gFAAANuwKNFepmAQxOAoAACWYC69YAJhAFAAD2gAYV
+oSIdANEPAAAAAOoWAS1oBIAA+8BoHe/51gD9jwAN//k+AGwQDPhASBWgCgUA6yAHKcgEgADygGgd
+58UBAP2fwBWgBBUA7Ew5DLgEgAD8ISYVobsBAPMbXA3gDAUAmhacFZkTmxSbGy4gFhXphB3phB/p
+p+8WCC3HgoAA7YgIDacCgAClRB3poygWCvnS+gWg//UAf+ETAioCWCvgGOl5Hemc6hYIJSn5gABg
+ABcAAGZjy/jAHyiQ+vUAKSAW+yAZTSIAnQCJiPcgBhCSAJ0AK1KuHOltZLDRLMJ/K1KtDLsBZLDH
+sJmZiBzpi2SzSyzAgCzMN/4haBWkzB0ArDzrFgImYB0AAPXABYISAJ0ALkKe/cAIK6IAnQCMGitC
+nSzCvwy7AesWACWZUYAAKnEMiXeZEf1ADpxiAJ0ALHAQ63IDJglBgAD5n/so0gCdAC5yA2Tg0I8W
+ZfGuhhGPGI0U7hIAKVAEgADm/zYL2ASAAO8WASngBIAAWClqGOlCHell568ubTAEgABgAvIAAMCg
+WaWpGOk8iYgd6V75P/mIkgCdAP/9CA2gCwUAwLDAqgqZNPkBBhXv/M4AAGqRJCtCnnyzQYwaK0Kd
+LMK/DLsB5LA1ZPP9AAD/AQYVr/0qAAAAAAD8IaYVoAoFAFmlkhjpJYmIHelI7BINJI8TAAD//IwN
+oAsFAMCwwPoPnzT/AQYV7/xSAAAAAAAAAP/8GA2gCwUAAAAAihjAsZsW+V/5KuIAnQDA4J4W+V/4
+yuIAnQDrdAAJUASAAO0SCSngBIAAWCmm/gAiHeAHFQDnFgktOASAAP9AZhXv+7oAZLBJjxX+ACId
+oAwFAA/sOGTAiogRhhjqJAAL2ASAAO0SBCngBIAA6GY2CPAEgADmFgEg+BEAAFgqMujo9x0wBIAA
+/dIyBe/3/gAAAACLGA8CAPlhVg3gDAUAeaMCLAoB+AAiHeAOBQAMnjjsFgUnfKGAAOt0AAlQBIAA
+7RIJKeAEgABYKtH3QGgd4AsVAPohJhXgChUA+uBmFa/9pgCLEBXo/CohB4lwHOj4/9G+BeqqAQD/
+QAAVOJkBAOyqAgTAPQAA/CEoFaSIHQDqtgAkQAkAAAg4DI4gmbPoXzkBs/0AAO+2Ai92AoAA7m4C
+BahBAADutgEuDtYAACgSA+iMICGUVQAA6jz+KsgEgABtqQUIAIYJAmErPP4MuxGrW5sQKCAULCAE
+o4j1gAihEgCdAAgJRykkFPUgCjZSAJ0AiHIoJhwpcgHoFgctqASAAPMgCjBSAJ0A8TYYDeAHBQCn
+ZiZGnSogFisK/3uhCusSASlQBIAAWC32jBllwOPAINEP6xIBKVAEgABYLfEuIBYY6KL90YoF4P/1
+AP/f5RxiAJ0AY/yHiBllj9IqcBDbcPxgaB2gCRUA+1/gFaANBQDqnTgJUASAAFgoXcAg0Q8AAAD6
+QGgdoBvFAPwAIh2gDRUAWHoeY/+9AAAd6LEt0IDrEgQm6N0AAPpAaB2k3R0A/GAARvAMFQDt3Acl
+2GEAAFh6E2P/jy4gFi8K///f+vRiAJ0A6xIBKVAEgABYLcnAINEPixAMbBGsu/ogBhXv+5IAKCQU
+jXDxv/i6kgCdAPpAaB2gDAUAWG5o9sBgFa/8EgCKJ+s0AAnoBIAA+0QAFaAMBQBYcHfSoNEPAAAA
+AAAAAOsSAilQBIAAWAHL+iAIFe/6vgAAAAAAAOokAAxgBIAAWANOiBcpcgEqFgznpAANXwKAAOtV
+CAT1PYAA21DqJAAMYASAAFgDFPdAAEP/+koAiif8oGgdoAslAOqsICnoBIAAWChPK3AQ+X/xUNIA
+nQApcBUJCEVkjhwrcQkc6GsqcQwvcBGOJwyqDKv/D4gJ/cKkFa/NBQDu7CAkeIkAAO3uAQRASQAA
+Cvg5qH2uzu7sQCbogQAA7tteftAEgAAO6jAb6FstoQH9QAQVofkxAAv/CisiF+/yny5kAoAADN0C
+C+4MD+4srt2oXv3AJB3v3YEA/cAEHe/2ggAAixT6QGgdoAwVAPtiQBXgDQUAWHmzY/4QAAAAAAD9
+rwANP/6KAGwQBCMgACQK7XQxBiIhA7wi0Q+EIYYg8kBoFaAIJQD3ZAACsJRxAPkPAAxzNgEA9GAA
+QfNmgQDl6DccAQqAAABmGvZgAQG9RAEA5SIBAag5AADlIgwBmGkAAAQkLAQzKKMi0Q9sEAiKIicg
+B4kwlRX4QtAVoXcBAPFdTA3omQEA+CAmFeD89QB8gR0FC0f7f8AV4AkVAOubOQlQBIAAWC1a81Mw
+DeD89QAa5/OIqBbn8PcADZiSAJ0ALmKuGefwZOHbKZJ/JWKtCVUBZFHRKIz/KKYI6VQAAo2BgAAb
+6AwlsIDt5+QSqN0AAPggBhXkVR0A5UUIC88CgADmmQgCqA0AAPTgCJISAJ0AKJKe9QATO+IAnQAl
+kp0NeAoogr8IVQFkUYgpIBb9IyYNoOvVACowEPtAElRiAJ0AKzELvLvaIFgtGyggFCwgBKSI9YAM
+QReYAQApJBT1IA4uUgCdAIoVHufjjREoIQcc58cZ59//oeAV6ogBAP8AABQ0/x0A6YgCB/gFAAAP
+TwyYUIsgD+w5/KBmFeeqAQDsVgIt3gKAAOtLAgLIQQAA61YBIcBBAAD5QAlxUgCdAOhBDWJT/QAA
+bakFCACGCQJhwICYFOkgBCJb/QAADLsRq1v1IAkJEgCdAIgyKCYc6TIBJdhBAACbEygWAvMgCbhQ
+BQUAZpFQpUyIFAx9Eabd7NadLBAEgADRDwAAAAAA9wAOkJIAnQAMeRGmmS6SnvXADvviAJ0AJZKd
+DXsKK7K/C1UBZFHNsI2dqGVe3WAAYwAAAAAAAADqJAAJ2ASAAO0SBSpgBIAAWHXX0qDRDwDAoFmj
+8Brngoio+R/yGJD89QD/+VgNoAUFAAAAAAAAAPpAaB2gG8UA/AAiHaANFQBYeQhj/7HAUMDqDog0
++UEGFa/4rgAd55ct0IAt3Df64wAV5N0dAO1NCAlQBIAA/aBgFeAMFQBYePtj/3sAAAAA+EKGHa/6
+DgAAAACKJ/0gaB2gCxUA6qwgKmgEgABYb276IIYVr/tKAIsw82AIopIAnQDiEgQr5wKAAKbMJMad
+0Q8AAAAAAAAA6xIAKVAEgABYALtj/jAAAOokAAxgBIAAWAJAiTGLE4gS7KwRDSgEgADsuwgE9Z2A
+AOokAAxgBIAAWAIHiBSlpaVMDH0Rpt3s1p0sEASAANEPAAAAAAAAAP/2lA2gBQUAjTWMNB7nZPpg
+6BXgCSUA/HAAB7CtcQD7LwAMu4whAPsgBADTzAEA6MwID/gKgAD/gAEGfd0BAO67AQZwOQAA7rsM
+BmBpAAANvSwNzCj9YABFv/W6AAAAAOokAAPYSQAA/AAiHaANBQBYeLRj/mHAoFmjjhrnIYioHecf
++R/xCJD89QD/+PANoAUFAMBQwLoLizT7QQYV7/i2ALBLDLsR61sICVAEgAD7YgAV4AwFAFhtCrNM
+4hIEK+8CgACm3SzWndEPAGwQBgIqAlgtAyQwFvnOVAWipgUABqYohTeoaARECghEC+RNESlQBIAA
+5EwwIqghAABYLPiIQB3nJyswFvUMHg2gBxUALNJsLdJpqt0J3RGtzBjnIh7nIaho6YJ9LW8CgADu
+3QgNgQqAAO/SASvwCoAADpkCHucRDv8BLoJ/D+4CH+b6KYZ9Dv44DpkCmdIogn/Ii4bHJmwQ2mBY
+BddooRuIMupCASkBCoAAAHkaCYgClaCaUZRQlUGYMtEP2mBYBesW5wcLqBGoZuYWASUCeYAAFucA
+DOowixErsoWLsLCqmhAMuwhZqBuMECpilgDBBAB7GguqAipmllmoUY0y70IBKQEKgAAAfhoO3QKV
+8JRQn1GVQZ0y0Q8AAAAA+gDiHaALFQBYcbiIMitifytmg+pCASkBCoAAAHkaCYgClaCUUJpRlUGY
+MtEPAAAAbBAI2iBYLLDUoBvm5fnNxgXipgUABkQoFebU6UkICVcCgACrqoqgKZJ/GObbpUX7IAQE
+sGMFAPggBhXgBxUA4QAFATO5AAD4gABCMADCAAAAAAM8CuXMCwtoBIAA6MKQKVAEgADszQIqWASA
+AO48oCZgwQAAC4AAAQGHAzdg4QEHCfdAAADRD2wQBCYhCfhCkBXv+AUAJyAV6JgBCzYCgADomQwL
+uQKAAAdmAvhChh3gBwUAJzQA+GBmHaAEFQAEZgKWMRXmhyRWrdEPAAAAAGwQBBbmtBXmkdMPpiIF
+NQIlJoAkIoBnQAttCAUoIoBngAJj//PRDwBsEAQT5qsiNopj//wAAAAAbBAEKCAFJSAH+mCoFa/0
+1QD6QEgV4AMlAP0BIBHRVQEAwCDRDwCIKZorDwIA+wAIPCIAnQAa5psKWgnpofwlUAsAACqhAPsg
+BLOiAJ0A82AEcBIAnQACKgJYbHgrIgIPAgADugFkr7iKJwS7AesmAiVQwQAAWGWh4+ZpFQE5gAAo
+oADTD9MPA4gKKIIQ7KAHLVgEgAD6QGgdoA1FAAuAAGWv3Ikn0w9kn3YqmRTKp4qZZK9sKKAAA4gK
+KIIQ7KAHLVgEgAD6QGgdoA01AAuAAGWv4GP/SgAA//9UDaAKBQDaIFhsZSsgIuq7DAlQBIAAWG2v
+2lD6ACId4AwFAFhvXosiA7oB83/65mIAnQAvIAfaIPwAIh2gDQUA9WAEBzG/AQDuJgIl2H0AAFh3
+vsAg0Q8AAAAAAAAA6yAiKVAEgABYbZsqIAXBg3ihDGioKYsi82AEBX/8RgApIDrAv3uZ6vpAaB2g
+CwUA/AACHaANJQBYbNJj/9cAAPpAaB2gCwUA/AACHaANJQBYbEtj/78AAGwQCogrHeY5LiAhizf8
+YMgVoP/lAA/uAS4kIQ3MAQy7DOuJCHjIBIAAwCDRDwMAhgkCYZsVKCAFJSAH+CEGFe/01QD8QEgV
+4AMlAP0bQEHRVQEAiikc5i+bK/tACBRiAJ0ADFwJ68H8JmALAAAswQD9YASjogCdAPOgBGASAJ0A
+2iBYbAqLIgO6AWSvm4onBLsB6yYCJVDBAABYZTQKqwLj5fsVASmAACiwANMPA4gKKIIQLLAH+kBo
+HaANRQALgADrpAANfx4AAIknZJ9aKpkUK5IJyqhkv08osAADiAooghAssAf6QGgdoA01AAuAAOuk
+AA1/LgAAY/8tAAAAAAD//0gNoAsFANogWGv3KyAi6rsMCVAEgABYbUHaUPoAIh3gDAUAWG7wiyID
+ugHzf/rOYgCdAC8gB9og/AAiHaANBQD1YAQHMb8BAO4mAiXYfQAAWHdQwCDRDwAAAAAAAADrICIp
+UASAAFhtLSogBcGDeKEMaKgpiyLzYAQFf/w6ACkgOsC/e5nq+kBoHaALBQD8AAIdoA0lAFhsZGP/
+1wAA+kBoHaALBQD8AAIdoA0lAFhr3WP/vwAAbBAEHOXXizQpMBb9YAQFtZkdAPUgCAiSAJ0A7uXS
+FIiJgAD7y6IFr/3lAOTlqhSkuQAAaZUiLKF+7LMMdlARAAD7YAibogCdACsgBrC7CwtH6yQGJYLJ
+gADAINEPLKF+0w/sswx2eBEAAP9gB9PiAJ0AKCAGsIgICEfoJAYsft4AAIkniyIqmRQNuwGbIouZ
+ZKC0KLAABIgKKIIQ2iD9YPAVoA01AAuAAMAg0Q8AiyKKJw8CAA27AesmAiVQwQAAWGS8ya0ooAAE
+iAooghDsoActWASAAPpAaB2gDUUAC4AAZa/giSdkn28qmRRkoGCKmWSvZCigAASICiiCEOygBy1Y
+BIAA+kBoHaANNQALgABlr+Bj/0IAAOokAAnYBIAA7EQACugEgABYbOXAINEPAOokAAnYBIAA7EQA
+CugEgABb/0HAINEPAP/9HA2gCwUA//50DaAKBQCINyLifwmIEfhAAEE/+5YAiDci4n8JiBH4QABB
+P/v6AGwQBBrlZyiis2SACwnqMCuitAuZDGeQAdEPWG8G0Q8AbBAEHOV0JiAHG+VzH+V1/kEEFaDW
+EQANyzmbMIcg+8p4BaAJJQD6YEYVoBgFAOg2Ayu+AoAA+OYADHFmAQD4YCYVoAwFAOUgeSs0AoAA
+98YADrArBQD/pgAO8Ao1AOjlXxKCAYAAnDWcN5szGeVeCnUClTGZNiUhCZ00LyAHnDmUO/imAAkx
+/wEA4jYKL/wCgAAP7gII7gLuNggtEASAANEPJyEIKiEJnDWUNwZ3AgiqApo2CHcC5zYELJAEgADR
+DwAAAGwQBBjlSB3lQisgBxzlQiohCPoCAAdxuwEA7tw5DdwCgAALqgKcMOPlKhmwBIAACKoCHOUG
+IzCA+kAIFeANBQCdZexmAiG43QAA+sCGFaR3HQDpfP8t3gKAAOt7AgzPAoAA62YBJMvhAACZYwIE
+iZNnKGYGBiCLGOT2JSEJ9MFmFaQzHQDlZgorkASAAOgABQMowQAAbTkCBQJh0Q8AAABsEAYd5SEL
+KxGtsyoyfxnlHxflAoigwED44ABE8AYVAOm5CAQBqYAALDJ4LzJ7+YAFfGIAnQBl8RQsNnwrMnkr
+NnvdQA3kFgECAJSgDeQWwMn8QAXcIgCdAC8ye8HA7eUMF4ORgAAiMnwqIQSOIPPh/g2mugEAJDZ8
+9G9mFaAAHgAuNnztrwEFw/0AAAj/Au8lBCWMWQAAIjJ8sMzvMnshAPGAAMnGY/+/2iBYbyFloMIq
+IQT/QQAMFpoBAMiX0Q/aIFhvFNEP2iBYbtbRDwAAAAAAAPpAaB2gCwUAWG+k0Q8uLPjq0ogvAQqA
+APzAAQXf/PUADLsDC6oBKtaIWaYqJDZ8JDZ7+m/oFa/84gAAABXkoy9QaWTwalmcolhujShys9MP
+yIFYbmIpUGlknylYblzIrhXk2CxSeLDM7FZ4JgLJgABYbeNj/w4AAAAAHOTS/m+IFaAKVQD8b0gV
+4AtFAO0WACFr5QAAWaRb+m/oFa/7MgAuMnviNnwveh4AACI2e9EPH+TGL/KucfaL9q0mHa/+IgAA
+AAAAWZxs+q8GFa/+kgBsEAQU5L4Z5Ljo5JsZXsKAAKS0I0J/qYjouAgBgiGAACoyAHipAipCexzk
+sCsxBCpGfwy6Aeo1BCnQBIAAWG7TzqkpMQT/IQAMFtkBAMjX0Q/aMFhux9EP2jBYbonRDwD6QGgd
+oAsFAFhvWNEPI0Z/0Q8AAGwQBPBg4A3v+fUAiCIJOQMJiAGYIoonKqwwWGOh4+RoFQEZgAAooAAD
+iAooghDsoActWASAAPpAaB2gDUUAC4AAZa/giSfLkiqZFMqlipnJrSigAAOICiiCEOygBy1YBIAA
++kBoHaANNQALgABlr+DRDwAA//9cDaAKBQDRDwAAbBAIHeRgG+SCFOQ898kABaAYxQDjLOgl04EA
+APhADcwnMwEADDURpFXoUp4pZsKAAKbEKUB/+QAQU+IAnQAoUp1kgf+bEeoLHg1IBIAAmRAKIIYL
+AmULAmMNAIcJAmEJAmHtxwgJAQqAAP/I1AXgDhUA4+QzH3AKgACeE6/P/iCGFe//9QD/1wAPcAZF
+AP4gRhWgAMIAAAAAipnJrSigAAOICiiCEOygBy1YBIAA+kBoHaANNQALgABlr+ApQiBkkO8tQHws
+QH0e5FQN2wkHuwru3ggF2CsAAIqyLuCAZKE4/cf+DaAIFQAvCgANjzgP/wkH/wov/Qov/Jwv8hss
+CgEM3APx4SAN58wBAAzLCQe7CuxEfCXYKwAAwND8j6Yd4AwFAI2w71KeJvP/AAAu4P//4AR7ogCd
+AC9Snfbf4BWg+PUA8efADedmAQB4YXTqEgQmQAUAAOhEfSbj4QAAWG5YiRPSoOsSAiSAYYAAiqIL
+qgEqJgKKJyqsMFhjKcmtKKAAA4gKKIIQ7KAHLVgEgAD6QGgdoA1FAAuAAGWv4IknZJ8XKpkUZa7u
+//u0DaAKBQCMEYsQDICGDGCGCwJpCwJn0Q+PEY0QLkR/D8CGD6CGDQJtDQJr0Q+bEeoHHg1ABIAA
+mBAKAIYLAmMLAmEN4IcIAm/o7AAJ0ASAAFmbzGSvr+3j4BmvAoAA5FUICWbCgAD3gABCP/kyAMCx
++7cADfAMBQD8j6Ydp7sBACtEfAu7CfdgAQXwDAUA+2FAJe/7mgAAAAtghgtAhgoCZwoCZdEPAABs
+EAQY46kCA0cMMxGoMysyhBnjtiiwAIqxCYgKCiGMAgo+KIIQAwI+/EBoHaANJQALgAAiNoTRD2wQ
+BBTjmwIDRwwzEQQzCCQyhCpCASZAAChACPqYaB2gqSUAAgU+AwI+eYEjGOOiCGgKKIIQ6lQAClgE
+gAD8QGgdoA0lAAuAACI2hNEPAAAA6yQAClAEgABYbh/zQGgdr/82AAAAAAAAbBAEWZ8cEuOAE+Oh
+DAIAKSKCCRqOA6gKiIQLgABj/+sS48ID6DAE7jAFsTCTIJQhlSIS474T44OEIAQzApMgEuO8wDAo
+N0AoN0QoN0goN0wjPQFyM+0S47fAMJMgxy8T47YDIwMS47WEIAQ0AZQgEuO0hCAENAGUIBLjsoQg
+BDQBlCAS47GEIAQ0AZQgxy/AMQMjAxLjroQgBDQBlCBj//wAAAAS46uDIAMTFA8zEZMgEuOowDAj
+JgBX/9kQ46eRAJIBkwKUAxHjpYIQAeowohEB8DHAQATkFgACABHjoYIQIxoAAyICkhAR457AIZIQ
+BOQxhAODAoIBgQAA0jABIwAAAAAQ45mRAJIBkwKUAxHjl4IQAeowohEB8THAQATkFgACABHjj4IQ
+IyoAAyICkhAR44/AIZIQBOQxhAODAoIBgQAA0zABMwAAAAAQ44qRAJIBkwKUAxHjiIIQAeowohEB
+8jHAQATkFgACABHjfYIQI0oAAyICkhAR44DAIZIQBOQxhAODAoIBgQAA1DABQwAAAAAAXJQBXZQC
+XpQDX5QAQwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AFyQAV2QAl6QA1+QAFMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAACclAAdkAGdlAKelAOflAQIlAUJlAYKlAcLlABDAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAnJABnZACnpAHHZADn5AEeJAFeZAGepAHe5AAUwAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAANyUAB2QAd2UAt6UA9+UBASUBQWUBgaUBweUCAiUCQmUCgqU
+CwuUAEMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADckAHdkALekAsdkAPfkAS0kAW1kAa2kAe3kAi4
+kAm5kAq6kAu7kABTAAAAH//89ADSMRD//goAAAAAAB///TwA0zEQ//4KAAAAAAAf//2EANQxEP/+
+CgAAAAAAAPQwCgAAAAAA9DAKAAAAAAD0MAoAAAAAbBAIiCInIAcpIhmZFfEVfA3hdwEAHeJDZJEl
+FuJELdCA6+I/G9cCgADmqggG6N0AAP1TyBWk3R0ArU3p4jsW6AkAAP2ACwvgCKUAKqKdC3wKLMK/
+DKoB6hYGJQqpgACKmPdACwiSAJ0ALmKu7eIxFwiJgAAsYq0t0n/tywEFc/0AAP2AB+5iAJ0Anpj9
+gAf2YgCdAC8gFKT/Dw9HLyQU9eAJxlIAnQArMgn4IMgV54UBAPkACWlWux0A6DwQIgxBAAAqTP9t
+qQUIAIYJAmHAUIkVGuIYDwIAiZDoEgYia/0AAOqZAgzmAoAADNwC/QAmFaAKBQBtuQfphgYkQQEA
+AIgWjDKcFCwmHOsyAS7PAoAAqYiYE/NgCrhSAJ0A6hYALYuCAACLEOtLCAvnAoAA5swIBdv9AADr
+xp0qkASAANEPBQxHaMIYiif6gGgd4AwFAOqsICpoBIAAWGmj0qDRD8Ag0Q8AAAAA6iQACdgEgADs
+RAAK6ASAAFhv39Kg0Q8AAMCwCKw07JYILfhWAACNImXf1Nog/EBoHaAbxQBYbHNj/8QAAAAAAP/6
+rA2gCgUAjiJl77IrfBjqJAAJYASAAFhsamP/ocCgWZ3mGeHXipj5X/SokAilAGP/stogW/rcY/7D
+jyefEYX5+eKCFa/JBQDs8RUn6IEAAAnZAZkS6ckIClcCgADqiAwCqEEAAJX5CIgy6PUUJMkBAAD4
+oAfS4gCdAGirQaWsLMzw/SAEY6IAnQDvEgYiDIUAALBObekFBQCGDwJhjNEPAgAPAgCsrOjZBCZj
+wQAA+YAGRGIAnQDs1gEuKASAAGWOZGAAlAAA6iQADFgEgABb/D6LMYgTjBTqFgAtbwKAAO2ICAX0
+xYAA6iQADFgEgABb/AWOEO6uCAqQBIAA7k4IC/8CgADm/wgHc/0AAC72ndEPBZkM/CDIFaT5HQBt
++QUFIIYMAmOMEg9FDC8SBizMQOn/CAKMQQAAKFz/bYkFDECGDwJlhRIs2QQJqAyoVSVcMOXWAS5u
+jgAAiRLAUOXVBCTJAQAAmdH5oAYV7/buAAxVDPXhJhXv/A4AhRIlXED1oCYV7/zuAAAAAGwQBB3h
+gBrhgRzhfy3SNiqhfizCi6Pd6joMDu5CgAD9gABGcAsFACvEBCvEBVkMbPpAaB2gCwUAW/yv0Q8A
+AABsEASFI4MgFOFy+ECEFaFVAQDq4XAarsKAAORUCAGAuYAA+wAEBDaYOQAJiAIoJQQiQn/RDx3h
+ZxPhaB/haCZCfishBC5Cf5JgliGj//1gBAX2yzkADLsCr1/vJgAnKAUAACVGfyJGfuslBCqQBIAA
+0Q8AAGwQBIIjAgJB0Q8AAGwQBIogZaBQHeFW6iIDKfbCgACu3f2v6BXgDBUA/IBABjGqAQAGqgIN
+yCwI3SgnJQXtzAwEWAUAAP1tAAw/+8UA66oBDE5CgAAJWQIDqgKaIwmIAiglBNEPjyMb4UIPD0EL
+/hGr6y2yfxnhPCyyfnLZGdnA8yPeDaAMBQDAwCy2fyy2fvpACBWgAEYA2MDzDEYNoAwFAHLRHI0h
+mtCOICmyfZ3hnCDsJgEky/0AAPlvphXv/VoAGeEoGOEoqYio6HihIOq2fy+BLgAAza0qsn1qohgt
+snv9b+YV4ABKAAAAAAAAAOy2fyf/KYAA+kAIFa/+pgAc4RmIIayZqen5DwAM8AwFAAnIOPlvxhWv
+/ioAbBAE9cIqBeAGFQD0QGgdoAI1APaAQAMwAB4AALAiKFJ/6GP3cquBAADRDwBsEAT0QggVpCNB
+APJaAAk/U4EABCIKhCaCIQVEKApEEaQi0Q9sEAQpIhIjIAfUUPg+AARwBTUA9QAIcJEzAQAX4Oz3
+wdwFoYnhAPUACFCSAJ0A9GAGIhIAnQAMORGmmSqSngc7Ciuyv/dACGHSAJ0AKpKdC6oB8U7ADedE
+AQAoIQcZ4Ov/wdgFqogBAOvg6xxHAoAACYgCmKAY4Oj8QAgV4DwFAJyn+0CmFeAZhQCZo/lARhWg
+CAUAmKbu3QIO/gKAAJ2kBf8Cn6EvIhIPj0Hopggv/wKAAJ+p7eDZGfcCgACm7iXmnSwiEioiEA3M
+AuwmEilYBIAAWNCAaEIYiif6ACId4AwFAPtEABWgDRUAWGhq0qDRD8Ag0Q8c4LeLyGqxXQw5EaaZ
+LZKebtNoKpKdBz0KLdK/DaoB5KBbZfP9AAD/gQYVr/zGAC8aAA+ZAvhCRhXv+7IAACgqAAiYAvhC
+RhWv+8IAiSLLnGhCUMAg0Q8AAAAAAAAA//voDaAKBQDAoFmcrBzgnIvIa7GU//uUDaAKBQAAwKDA
+2g29NP2BBhXv+1YAAAAA6iQAAdhhAAD8AAIdoA01AFhxwmlCrownL8kUisn/hAAVr8gFAOjuAQf4
+QQAA78UUJVPBAADqxgkncQEAAH6rKinBFR3glqqamsmdoIwg+8EoBeANFQDrpgIuZgKAAA3MAv1A
+JhWgAgUA0Q8d4IydoIwg+8EWBeANFQDrpgIuZgKAAA3MAv1AJhWgAgUA0Q8AbBAYkhCOIBXgg4kj
+iyGKIioWIisWJPgkZhXgBBUA9CDmFaAIBQD4IKYVoAxFAPwhRhWgDTUALRYJ9CDGFeAPJQAvFgj1
+wOoF4A+lAP4iBhXgDbUA/CImFeAMxQD8IkYVoAiFAPghxhWgBJUA9CHmFaAJdQD4IaYV4AtVAPoh
+ZhXgCmUA+iGGFaAL1QD6ImYV4ArlACoWFPXAwgWgCfUA+CKmFeAIRQCYFIYWKxIkiRUnYX4sEiIi
+YX8HmSgvUIAJKQj4nIgVo5kBAAOZCu6SAC9QBIAAJmI+LRIjCO4IC2AAjhcsEiQtEiIH7igvUIGu
+LvicqBWj7gEAA+4KjuAqFhbqEiMtWASAAKjuC2AAjhgsEhYtEiQH7igvUIKuLvicyBWj7gEAA+4K
+juAqFhfqEiItWASAAAjuCAtgAI4ZLBIXLRIWB+4oL1CDri74nOgVo+4BAAPuCo7gKhYY6hIkLVgE
+gACo7gtgAI4aLBIYLRIXB+4oL1CEri74nQgVo+4BAAPuCo7gKhYZ6hIWLVgEgACo7gtgAI4bLBIZ
+LRIYB+4oL1CFri74nSgVo+4BAAPuCo7gKhYa6hIXLVgEgAAI7ggLYACOHCwSGi0SGQfuKC9Qhq4u
++J1IFaPuAQAD7gqO4CoWG+oSGC1YBIAAqO4LYACOHSwSGy0SGgfuKC9Qh64u+J1oFaPuAQAD7gqO
+4CoWHOoSGS1YBIAAqO4LYACOHiwSHC0SGwfuKC9QiA4uCPidiBWj7gEAA+4KLuIAKhYd6hIaLVgE
+gAAI7ggLYACOHywSHS0SHAfuKC9Qia4u+J2oFaPuAQAD7gou4gAqFh7qEhstWASAAAjuCAtgAC4S
+ECwSHi0SHQfuKC9Qiq4u+J3IFaPuAQAD7gqO4CoWH+oSHC1YBIAACO4IC2AALhIRLBIfLRIeB+4o
+L1CLri74negVo+4BAAPuCo7gKhYg6hIdLVgEgACo7gtgAC4SEiwSIC0SHwfuKC9QjK4u+J4IFaPu
+AQAD7gqO4CoWIeoSHi1YBIAAqO4LYAAsEiEuEhMtEiAvUI0H7igoQvGuLvogZhWj7gEAA+4KjuDq
+Eh8tWASAAJsRqO4LYACMES4SFC0SIS9QjgfuKChC8q4u+iBGFaPuAQAD7gqO4OoSIC1YBIAAKxYj
+qO4LYAAuEhUsEiONEwfuKC9Qj64u+J5oFaPuAQAD7gqO4OoSIS04BIAAJxYi6O4IC9gEgAALYACO
+ESoWJCkSEi0SFY8VKxITLBIU6BIRJ/hBAADvFgUl2EEAAOsWEyZgQQAA7BYUJEBBAADoFhEm6EEA
+AO0WFSTIQQAAKRYSjR+JHIgbjB6LHe8SECRAQQAA6BYLJmBBAADsFg4l2EEAAOsWDSf4QQAA7xYQ
+JMhBAADpFgwm6EEAAJ0fiRaNGY8a6xIHIiEBAADsEggm6EEAAO0WCSf4QQAA7xYKIqhBAADvEgQm
+YEEAAOwWCCXYQQAA6xYHJMghAADpFgYn+/0AAO8WBC/iFgAAiRCPE4sSjpCIk4ySjZGriKfMqt2v
+7p6QnZGckpiT0Q8AbBAEKSIV+KAABPA4dQDpjAwBIEEAAPMgAEU/iwUA66QQJVBFAAD5AAXTYgCd
+ACsKAFmYgSwiFSsiFO3NEQlABIAA/EJGFe6APQD9awANsAk1APpCZhXgCiUAbaoMjoQODo7uhgQk
+QBEAAA8CANMP0w9tmiHpggQkQEEAAIqBi4KMgwkJjgoKjgsLjgwMjpmAmoGbgpyD60QACVAEgABb
+/rWKIIgiiSGPIwgIjgkJjg8PjgoKjpognyMpJgHoJgIpQASAABnfNAIAhgMCYfgAChXgCbUAbZoC
+CACK0Q8AAAAAAAAA/YEAFaALBQBZmFL4QGgdoAlFANMPbZoh6YIEJEBBAACKgYuCjIMJCY4KCo4L
+C44MDI6ZgJqBm4Kcg+okAApYBIAAW/6T2kD/+/wNoDyFAABsEAYpIhX4QogVoEYFANMP+IAARXWZ
+AQAJZgx0qwGxiComFQYqDOgmFCVRQQAA9oAHs6IAnQDrNAALYASAAFmYJfhAaB2gCUUA0w/TD22a
+IemCBCRAQQAAioGLgoyDCQmOCgqOCwuODAyOmYCagZuCnIMlLBDqJAAK2ASAAFv+cAZHDPbgBY7S
+AJ0A5jQICtAEgAD24GgdoAMFAOQWACpABIAA+MhoHaAJRQAKAmcIQIYKAmUIIIYKAmMIAIbqDAAJ
+QASAAG2aIemCBCRAQQAAioGLgoyDCQmOCgqOCwuODAyOmYCagZuCnIPqJAAK2ASAAFv+U+pUAAGY
+BQAA5mzAIiEBAADvbZpqQASAAIsQCjwRC8sI7HwMCtAEgABZl+3RDwAAAAAAAOs0AApgBIAAWZfo
+0Q8AAAD2YABGMAMFAPwgBhWv/yYAbBAEGN7IGd7GGt7EE97HkyOYIpkh+kAGFaALBQArJhUrJhTR
+DwAAAGwQBt4g5OIQKmAEgADnQgcr0ASAAPu9agXgGDUA40IVKZAEgADncg4i++kAAHj7JxjetQj4
+CoiAmhOcEu4WASwAIoAAAJMQKrKV7FQACVgEgABZmZlkpc/ygqYV4AIFANEPAAAAACviEgubUu4W
+ASX/QYAAGt6e4xYAKVgEgADqorcq4ASAAFmZjGSlghrel9sg6qK5KuAEgABZmYdkpuAa3pPbIOqi
+uyrgBIAAWZmC90jgDeN2xQAa3o3bIOqivSrgBIAAWZl8ZKbhGt6I2yDqor8q4ASAAFmZdyN9A+8C
+AAGaAQAA+0BDcBIAnQArMNnBWPVgLAhiAJ0AabchJTTZixD6gqYV4AIFANEPkxAqso3sVAAJWASA
+AFmZZ2SnH4sQ+oKmFeACBQDRD5MQKrKb7FQACVgEgABZmV9lrxj6IGgdoAu1AFjMifoAIh3gAwUA
+6rM4BQDhgADqEgIrWASAAFmX8sipHN5ojREMrDYs1hdlMyuNEPyCphXgAgUA0Q8AAAAuQG5k7s2T
+ECqysexUAAlYBIAAWZlIZa66+iBoHaAbZQBYzHH6ACId4AIFAOqyOAUAqYAA6hICK1gEgABZl9os
+fQMqxShlItSNEPyCphXgAgUA0Q8AkxAqsqPsVAAJWASAAFmZNGSiuxreQNsg6qKPKuAEgABZmS9l
+rlj6IGgdoAtVAFjMWfoAIh3gAgUA6rI4BSgZgADqEgIrWASAAFmXwixAb/GAJ27SAJ0AZKTlihP6
+AKId4AzVAFjMNdKg0Q+TECqyqexUAAlYBIAAWZkZZa7I+iBoHaAbJQBYzENkojsrQG7TD2S3kuoS
+AitYBIAAWZetLEIWCsw2LEYWixD6gqYV4AIFANEPkxAqsqfsVAAJWASAAFmZB2SiNxreEwIrAg8C
+AOqioSrgBIAAWZkBZa5o+iBoHaAL5QBYzCtkodvqEgIrWASAAFmXlyt9Aiq1FIsQ+oKmFeACBQDR
+D5MQKrKZ7FQACVgEgABZmPJkoioa3f3bIOqipSrgBIAAWZjtZKOHGt352yDTD+qikyrgBIAAWZjo
+Za4C+iBoHaALdQBYzBFkoXUrQG5ktwIa3e6LEuqi3ytgBIAAWZjeZaZkK0BvwMgMuwIrRG+LEPqC
+phXgAgUA0Q8AAJMQKrKv7FQACVgEgABZmNNkoe8a3d/bINMP6qKRKuAEgABZmM5lrZr6IGgdoAtl
+AFjL92ShDStAbmS2iRrd1IsS6qLfK2AEgABZmMRkppgrQG8sCv0MuwErRG+LEPqCphXgAgUA0Q8A
+kxAqspfsVAAJWASAAFmYuWShtxrdxdsg0w/qoosq4ASAAFmYtGSi2hrdv9sg6qKrKuAEgABZmK9k
+rFca3bvbIOqisyrgBIAAWZiqZaxEGt22ixLqos0rYASAAFmYpWWkaosRK7ISC5lSyJlokgf5IA9h
+0gCdAIwRK8YS8oKmFeACBQDRD5MQKrKH7FQACVgEgABZmJhkoXoa3aPbIOqiiSrgBIAAWZiTZayv
++iBoHaALJQBYy7zKohrdm4sS6qLfK2AEgABZmItlrI+KE/oAQh3gDNUAWMue0qDRD8Ag0Q8AAAD6
+IGgdoAv1AFjLrmSv6uoSAitYBIAAWZcb6xIAI+ALAAAqxRX6gqYV4AIFANEPAAD6IGgdoBsVAFjL
+omSvui1AbmTVJClAb/E/4W+SAJ0A8T/hL9IAnQDqEgIrWASAAFmXCS5CFwruNi5GF4sQ+oKmFeAC
+BQDRDwD6IGgdoAulAFjLkGSvci9AbtMPZPSV6hICK1gEgABZlvsoQTT7AA8CogCdAIoT+gFCHeAM
+1QBYy2/SoNEPAAAA+iBoHaAbVQBYy4BkrzLqEgEqWASAAOwSAitoBIAAWMsIixD6gqYV4AIFANEP
+AAAA+iBoHaALlQBYy3RkrwIpQG5klDga3VKLEuqi3ytgBIAAWZhBZaJzK0BvjRD8gqYV4AwVAAy7
+AvqN5h3gAgUA0Q8AAAAAAAAA+iBoHaALFQBYy2Jkrroa3UGLEtMP6qLfK2AEgABZmDBlqySKE/oA
+Ih3gDNUAWMtD0qDRDwAAAADqEgIrWASAAFmWxPVAFrKSAJ0Axy/RDwD6IGgdoAuFAFjLTvoAIh3g
+AgUA6rI4BQFJgAAsQG4PAgBkw6Ea3TDrEgIrYASAAFmYGGWihi1Ab8DoDt0CLURvZS41jxD+gqYV
+4AIFANEPAOoSASpYBIAAWMtDZa+cKzDZY/puAAAAAPogaB2gGwUAWMs0ZK4CKEBu0w9kgxTqEgIr
+WASAAFmWnylCGIsQK0YVCpk2+IMGFeACBQDRDwAA+iBoHaALNQBYyyZkrcoa3QWLEtMP6qLFK2AE
+gABZl/Tj3QodB+YAAIsRK7ISC8lRyJlokgf5P/kR0gCdAI4RjBADvQEt5hL8gqYVoAIFANEPZS2E
+jxD+gqYV4AIFANEP6hICK1gEgABZln4qRTSCEPKCphWgAgUA0Q8jfQPyb4AV4AsFAPpgaB2gjAUA
+WZYP6hICKdgEgABYy10jfQMjPIArMNnAxAy7Avp/Zh2nuwEA+nsmHe/l0gAjfQMjPIAoMNn6IEgV
+oAklAAmIAug02StYBIAAWZZjKzDZ+nsGHa/lKgAAAIoSWYxqKH0DKID8eKkaihJZjGbspAAD2BMA
+AOoSAiXb9QAAWZe5ZKG5wKL9uZ4FoDsFAFmcHMcv0Q8AGtzBixLqoscrYASAAFmXsGWuJ4sRK7IS
+C8lRaJEKaJIH+T/wsdIAnQAe3MEDvQEO3QKOEYwQLeYS/IKmFaACBQDRD4oT+gEiHeAM1QBYyrfS
+oNEPAAAAAPogaB2gC0UAWMrIZKxSGtynixLTD+qixStgBIAAWZeW49yvHQVmAACLESuyEgvpUciZ
+aJIH+T/tUdIAnQCOEYwQA70BLeYS/IKmFaACBQDRDxrclosS6qLPK2AEgABZl4ZlrX6LESuyEguZ
+UmiRCmiSB/k/62nSAJ0AH9yZghHvvwID6A8AAO8mEibqAQAALNDZwOEOzAIs1NnygqYV4AIFANEP
+ihP6AQId4AzVAFjKidKg0Q8jfQMjPIArMNnAwQy7AgsLR/p7Jh3v354AAAAa3HeLEuqixytgBIAA
+WZdmZaz/ixErshIL6VFokQpokgf5P+dx0gCdAB3cegO8AQ3MAo0RLNYSixD6gqYV4AIFANEPAAAA
+AAD24ABCsAsFAPqgaB2gjAUAWZWKwWDqEgIq2ASAAFjK2Csw2Qa7Avp/Zh2nuwEA+nsmHe/dngAA
+ACN9AyM8gCsw2cDIDLsCCwtH+nsmHe/dMgCKE/oA4h3gDNUAWMpY0qDRDwCKE/oCAh3gDMUAWMpT
+0qDRD4oT+gFCHeAMxQBYyk/SoNEPihP6ASId4AzFAFjKS9Kg0Q+KE/oBAh3gDMUAWMpG0qDRDwCK
+E/oCQh3gDMUAWMpC0qDRD4oT+gIiHeAMxQBYyj7SoNEPAIoT+gDCHeAMxQBYyjnSoNEPihP6AOId
+4AzFAFjKNdKg0Q+KE/oAwh3gDNUAWMox0qDRDwAAbBAEJCIQZEBsKTAQKjARLDAa6zASLM4CgAAK
+mQLqMBMszgKAAAuZAuswGSzOAoAACpkC6jAYJIURAAAIqhELqgLrMBstVgKAAAyqAgiqEQuqArGq
+6iYWJISNAAApIhLr3BwUwCiAAAubASsmEixABS0KlX3BScAg0Q8ALjAULzAV6DAWL3YCgAAP7gLv
+MBcvdgKAAAjuAgjuEQ/uAv3XYABQjQUALyISePckwKX9uBIFoDsFAFmbUcAg0Q8AAAAA+oBoHaAL
+ZQBY5KDAINEPAIwnKckUi8n5hAAVr8oFAOqIAQTJAQAA6cUUJdsBAADrxgkkQQEAAHi7Bi7BFavr
+m8kY2/XZsPgACB2gD0UAbfoCCQJhHNvcnLCKIP1AABUwDEUADKoCmrEpMBQqMBUe2+vvMBYszgKA
+AAqZAuowFyzOAoAAD5kC7rYCLM4CgAAKmQLptgQhwCEAAOgGAAX4YQAADwCKKiISiSINqgLqJhIs
+9+YAAPpAaB2gDTUAC+AAY/7pAGwQBiQiEC9AbvXgBtiQnFUAHNvSjSCONi8xC/hj8BWgClUA+CAG
+FaA7BQBZmxMa28wkIhgsMQuILIlKhUf9AABEMAsFAPhBhhWgDQUA5VIOJJBWgAAtRhcKngL+gUYV
+oAAqAAAAACtCF+taCAHYgQAAWZTFL0IXLjELjUCv7i5GFypQBCxQBRjbt+tQBi1WAoAADKoC6VAH
+LVYCgAALqgLs27IdLgKAAAlVAghVAfSgYBXv+MUA+KAEArA7BQD+oGgd4ApVAFma7CoiEykxCytC
+F6qZ6SYTIsDBAAB4sUHAINEPAAAAAAArQAV8sfAc25/8QAgV4AolAP6ACBWgOwUAWZrd+oBoHaAN
+JQD8TIYd4AsVAFjkLMAg0Q8AAAAAAAAf25OOSg/uAe5GCilQBIAAWOFo+kBoHaALBQD8AAIdoA0l
+AFgBg8Ag0Q8AbBAGHNuJLSIALjIF9EDoFadVAQD+v8AV4AgVAA+POfSCghWgClUA9CAGFaA7BQBZ
+mr+JImWQmCYgBxfbTAYGQeoyBStHAoAAp4grgp4krB/5togF5EQdAHSzfCiCnQlrCiuyvwuIAe2E
+AAQDqYAAHNtmDACHbUkCCAJhiDQe20ie0IkgHNtK6tYDJthBAADs1gIszgKAAOlJAgHggQAA6dYB
+KVAEgAALgAAMbxGn/+T2nSKUdQAAiif6AUId4AwFAPtEABWgDaUAWGLX0qDRD8Ag0Q8AAAAA//4s
+DaAIBQDqJAAKaASAAPrDABXgDAUAWGxQwCDRDwBsEASHJyp5FB/bQvjipBXvzQUA6HIIJVAHAADs
+cgslUoEAAOqTd3PYgQAADbsBq5nowXR0yQEAAC6NAep1FCdSgQAA6pNxfDAEgAB5oX2aeO8ABQs4
+BIAABwJhBwJhBwJhBwJhBwJhBwJhBwJhBwJhBwJhBwJhF9sRl2CFIJNllGTztlgFoAelAOJmAiqu
+AoAAB1UC5WYBKxAEgADRD8Ag0Q8AAAAAAAD3gGgdoAgFAPjhZhWv/nIACJoMCroMKq0BKqzg+uEG
+Fa/+IgAsvED84QYVr/32AABsEATHjwhYAwg4AghIA6ho6CIIC4EKgAACIhiiMtEPAGwQBAQ4AwhY
+A6ho6CIIC4EKgAACIhiiMtEPAABsEAQEOAMIWAEISAOoaOgiCAuBCoAAAiIYojLRDwAAAGwQBAVI
+Awg4AQhYA6ho6CIIC4EKgAACIhiiMtEPAAAAbBAEIyIQKDAF+EJIFeCUJQB0iUj/KKADEI0FAHif
+PXCfGera8BS9WIAACpoB+kJGFaACBQDRDwAAAAAA/bXWBaAKVQD8YAgV4DsFAFmaJCswbtMPabEF
+LDAFdMEGwCDRDwAAAPpgaB2gDSUA/EyGHeALFQBY427AINEPAIwnL8kUi8n/hAAVr8gFAOjuAQf5
+AQAA78UUJdsBAADrxgkncQEAAH67BinBFaubm8kc2sPZsPwACB2gCkUAbaoCCQJhHNqqnLCJIB7a
+vvv/4h2gDEUA6rYELM4CgAAMmQKZsSgiEo8inrINiALoJhIv+4YAAPpAaB2gDTUAC+AAwCDRD2wQ
+BBPaugMiAtEPAGwQBCcgB4giHNqD9kIIFaF3AQDlgmNrzwKAAAyZCCiSnhraefcAEsLSAJ0AJJKd
+CngKKIK/CEQB6NqNEhIhgAAlIhIqIgn4QUgV4FVBAAhVCiVSgOqZDAKowQAA9SAOw+IAnQArIBYt
+Cv99sRX6QPAVoAwFAFhrNxzaZ/NBkA3g/fUAG9qYLyEHGtqXGNpv/7TiBar/AQDpIRov/wKAAAj/
+Ap9A+EAIFaBPBQCfQ55C+wYADTAOVQDqRgQsRgKAAA6IAphBKCIS+IDGFeA6BQCaRfgIAAUyiFEA
+5ogRDVaCgAAIqgILqgKaR4opKSIVG9pwpaqlmfhCphXv6AUA6iYJIkiBAAD4gAuEIgCdAPoACB3v
+iAUACQJhCQJhCQJhL0Qg+IQmHaAPBQAvRCQvRCcvRCYvRCUpYhH4h2Yd6JkdAPiHRh3omR0A+Icm
+HeiZHQApRDgoIhb4h+YdqIgdAPiHxh2oiB0A+IemHaiIHQAoRDyKNCg8GPVABpgQ+fUACACI6Npa
+ElChAAAKAIoa2kwpRDD4hiYdr/n1AClEMypEMoo0L0Qj+obmHaiPHQD4hEYdqJodAPiGxh3omR0A
++IamHeiZHQApRDTrAAUCQQEAAAgCYSkgBwkJQQyZEayZLpadKyAWfbEK+kDwFaA8BQBYasOJNGiQ
+J4on+gCCHeAMBQD7RAAVoA1FAFhhsSsiEiz6fwy7AfpCRhXgAgUA0Q8e2jQtIhIO3QL8QkYV7/8u
+AAAAAAAAAADqJAAK2ASAAFhq5uzZ9BVw6YAAYAAriW4Y2iSxmZluCJkC+IZmHeiJHQD4hkYdqIgd
+APiGJh2oiB0A+IYGHa/8tgDAINEPAADrfBgpUASAAPwAIh2gDVUAWGsSwCDRDwDrfBIpUASAAPwA
+Ih2gDQUAWGsMwCDRDwBsEAQqIhQpIhMc2db9s6YF5zUBAOqZDAGUHQAAZJCAKiAHCgpBDKsRrLsu
+sp5u4ngrsp0Nrgou4r8f2esY2dr/YAQFsBQFAO7Z1BWC8YAALSEHDQ1K758CDu8CgAAO3QIe2fmd
+sI0gn7WYspSzGNnU/6YADzAEJQDutgQu7gKAAATdAp2x6AAVBdhhAAALAIoMrxGs/yT2nS4iFKnu
+LiYUaTIQwCDRDwAAiCLKgWgyNcAg0Q+KJ/oAIh3gDAUA+0QAFaANFQBYYVbSoNEPAAAA+0MAFeAM
+FQD6QGgdoA0lAFhq0mkyyYwnLckUisn7hAAV784FAO67AQboQQAA7cUUJVPBAADqxgkl2QEAAHur
+Ki/BFRnZpqr6msmZoIgg87OUBaAJFQDipgIsRgKAAAmIAvlAJhWgAgUA0Q8Z2ZyZoIgg87OCBaAJ
+FQDipgIsRgKAAAmIAvlAJhWgAgUA0Q8AbBAGLyIYL/BYKAqOePF5KCAF6dm3FAOZgAAY2bQkIhII
+RAEkJhKNOSsxCy4iEX2YfikiE6uZKSYT8oAFHlIAnQBk4MYq4gx9pz4o4gv7wGgdoAsFAPwAAh2g
+DSUAC4AAKyIUKiITGdmjC6oM7NmjFVkDAAB7kxj7grYNoAkFAOkmESyQBIAA0Q/AINEPAAAA+kBo
+HaALBQD8AAIdoA0lAFv/f8CQ6SYRLJAEgADRDwD9syYFoAolAP5ACBWgOwUAWZjAKiIQLaAFLgqV
+ftG5wPL+TIYd4AsVAFjiDsAg0Q8c2YiN4P/AsBWgClUA9CAGFaA7BQBZmLMoIhIp+r8JiAH4QkYV
+r/1uAAAA2iBY30Rj/0wAbBAILSIYK9BYKAqOeLENKSAFGNl37Nl3HIBGAADAINEPJCISKSIRCEQC
+5CYSIjT6gACPLIk2JTAgJjEK/hFiHa/4xQD/KMYN5aUBACoiECugBSwKlXyxxMDS/EyGHeALFQBY
+4efAINEPAAAA5JKCYdCBAACJl4me+SYAFeALZQDAIG25BQoAhgkCYdEPAAYGTiZs2whmAf9gE4wg
+NxUApvj8hgAKMCslAPhBhhWgLFUA9EJGFaAmFQD3QkYNoA8FAHyhCnehB/tAILViAJ0ALzAwKDAx
+GdlI7jAyL/4CgAAI/wLoMDMv/gKAAA7/AuvZQx/+AoAACP8C+eAcPmiPuQD9EAAUNe8BAAjuAhjY
+/CiCPSuyiK6OCe4Rrrvt0Fgl2gEAACsmEf9gsBWgibUA+aAZDWIAnQApCpr5wBi0YJi1APnAGHQg
+mWUA+cAYNGIAnQAtCpn9wBmdYARFAPdABjQiAJ0A/UAF9CIAnQApMEEuMEAvMDwtMD3oMD4vdgKA
+AOnuAg/+AoAADf8CKTA/7TBCL/4CgAAI/wLoMEMvdgKAAO3uAg/+AoAA6f8CD3YCgAAI7gIP6Azt
+IhAkBJuAACXSEn9RCAX4DGaAAi/WEi/SE9MP0w9+8QgP6QxmkAIu1hONvATdAp28fKFQ90AK5GIA
+nQD3QBEEIgCdAMLi/0AVVCIAnQAvEBBk/hCKtyk8IPtByBWgCDUAbYoFCSCGCgJjwCDRDwAtMCPA
+4Q3tOS20QS0UEP1f+aUiAJ0ALzAhf/eoLzBBLDBALTA8KDA97jA+LmYCgADvzAIO7gKAAAjdAi8w
+P+gwQi7uAoAADt0C7jBDLmYCgADozAIO7gKAAO/dAg5mAoAADswCDcgM6iIQJASLgAAuohJ94QgO
+3wxm8AItphItohN80QgNyAxmgAIsphMsMDgtMDmKvO4wOi5mAoAADcwC7TA7LmYCgAAOzALp2Mse
+ZgKAAA3MAuSqAgZgBQAALCYWmrz5YWYV7/xiAInXKzELiZ6/uwtLS+W9fmTIwQAAY/0TAAAA+gBi
+HeOE4QD5f+w+IgCdACswJCgwJekwJi3eAoAACLsC6DAnLd4CgAAJuwIIuxHouwIDSBEAAPstAAt/
+9WIAACwwIfGADM4SAJ0ALTAkLjAl7zAmLu4CgAAO3QLuMCcu7gKAAA/dAgjdEQ7dAmXRbywwTC0w
+Te4wTi5mAoAADcwC7TBPLmYCgAAOzALqIhAuZgKAAA3MAmTMqC2iGP2/5ROiAJ0ALLYSLzBIKTBJ
+6jBKL/4CgAAJ/wLpMEsv/gKAAAr/AujYjR/+AoAACf8CL7YUKTA2LjA0LTA1/mbwFeAKBQDqthUv
+dgKAAA3uAuq2Ey92AoAACe4C6LYLL3YCgAAP7gL/YaYVr/fKACkwOCowOewwOizOAoAACpkC6jA7
+LM4CgAAMmQIImREKmQLo2HMUyAUAACkmFvlhZhWv9vYAAAAAAAAAAOzYbh74BIAA/WAIFeAKVQD0
+IAYVoDsFAFmXkCoiEsSwC6oC+kJGFaACBQDRDwAAAP/yEA2v7qUA7NhhH2gEgAD/YAgVoAolAPQg
+BhXgOwUAWZeCY/uhAAAtMDguMDnvMDou7gKAAA7dAu4wOy7uAoAAD90CCN0RDt0C7NhRFugFAAAt
+Jhb9YWYVr/S+AC8mEfugaB3v9JIAKiIQY/tcAABsEAgrIgcmIAcPAgAouRQFDUf1YcgVoWYBAOOy
+CSQREYAA+aATEVIAnQAc2D6IIP9gSBWgClUA/b/AFeAJFQDtnTkJeASAAPggBhWgOwUAWZdbHNg1
+/GAQFeAKVQD+ShAVoDsFAFmXVRXX4uvX5BtQBIAA9MAOihIAnQAMaRGrmSySnveAEgpSAJ0AKZKd
+BWwKLMK/DJkBZJH7LiEHLCBAJiAH96/MBeruAQDv2CAfdwKAAPWADkiRVgEA9YALyRIAnQD1oAuK
+kgCdAMDQ+bAwBaBmEQDsIQgrMoKAAAbuAu/uAgqsAoAABcwCCMwCnpCPIPcgRhXgNgUA9yBmFaAF
+BQCVlZWX/SCGFaAORQDolgYv/gKAAP/mAA+wCCUA75YBLv4CgADo/wIE4IEAAAMghgwCYwMAhgwC
+YZ+Z5BMeBMkBAAAJAmkEYIYJAmcEQIYJAmXpIhItZwKAAOvMCAE5IQAA/5OmFa+aZQD3IAYUb2tF
+APev4AWvmXUAJCISq0QvQigpRIEoQieY8CNCJy5CK58xJUYnJUYoI2KL6kSBJ3ysgAArQjEuMiQL
+ikT7WgANMAwFAP9AAQUwDRUA+0AIFa+7gQBYXsUlRjEoQiYrQh8lRiv/BAAV78kFAAn/AeWFFCf5
+AQAAn4mfiC5idPpiKBWgDAUA/28ADbANFQBYXrf+QkgV75l1APxiSBXvmmUA/gAiHa9rRQD37wAP
+8AwFAO/sOAbr/QAA7TYSJnpxgADAINEPAAAA/IBQFe/6RgD/93gNoAMFABfXbIx45hYEJg3/gAAM
+qRGrmSiSnvcABIJSAJ0AKZKdBa0KLdK/DZkBZJB+sM6eeGWeHmAAFwAA/BBCHe/5JgAvIEAI/xD+
+YAYV7/ZiAIgiZY+VjTDrbBgpUASAAPmvSAXn3cEA/EgGHeAMFQD4YAYV4A1FAFhogcAg0Q8AAAAA
+//csDaAJBQDAoFmTWIx4ihTr10gYBAqAAPmf+4CSAJ0A//4sDaAJBQDAkMDqDs40/uEGFa/98gBs
+EAaJJyMgByiZFAMDQeeSCSQLsYAABQhH+QANcVIAnQAqIEEV1zP2AIIdoAQFAPFabA3gDAUAG9cx
+DDoR9GAKehIAnQCrqi2invegENOiAJ0AKaKdBT0KLdK/DZkB6pQABI2hgAAuIEHsFgAvDp4AABjX
+Mh/Xbi4hByUgBxnXbPxBBBXq7gEA9CAAAnBVEQDqVRAPdwKAAOXuAgokAoAABN0CCd0CD+4CnqCP
+IJ2k+UBGFaAEBQCUpZSn+UDGFeA1BQCVo/3gABewBUUA5f8CDnYCgADl11cVSIEAAP9AJhXgDyUA
+ByCGCQJjBwCGCQJhD+4CnqkMPRGr3SbWnf5BiBXvmXUAKSQF8rFoFe+YZQDoJAUn/KyAACsiEi4y
+JAuKRPtaAA0wDAUA/0ABBTANFQD7QAgVr7uBAFheKCQmEogniyCULP8EABXvyQUACf8B5IUUJ/kB
+AACfiZ+ILlJ0+mIoFaAMBQD/bwANsA0VAFheGioyErCq+mJGFaACBQDRDwAAAAAAAP/6KA2gBwUA
+Htbajej3oAa4kgCdAAw6EauqL6Ke9+AHa6IAnQAqop0FPwov8r8PqgHkoNtmw/0AAJjo+UBoHe/6
+XgAqIEAIqhD64AYVr/kyAIieJIAEK4AFFtbx6oAGKiYCgAALRALogAcqJgKAAApEAghEEQhEAgZE
+ASZMZ/aOAAswjJUA9sCAFa/4lgCJcO1kAAlQBIAA+a4OBaeZwQDpJEAh2GEAAPjgBhWgDBUAWGfi
+wCDRDwDtRAACYSEAAOtMZylwBIAA/uBoHeS7HQBZlfMb1qj8IAgVr/g+AAAA//fIDaAJBQD8IAYV
+oAoFAFmSrh7Wn43oG9afjBD5v/igkgCdAP/8yA2gCgUAAMCgwPoP3zT/wQYV7/yKAAAAAGwQBCki
+ByMgByiZFAMDQeeSCSQK6YAAFNaM960cBaeFAQD5AAwRUgCdAPRgClISAJ0ADDkRBpkIKpKe90AN
+SlIAnQApkp0EOgoqor8KmQFkkWMqIAcoIQcf1o8b1sr5QAAEMMoRAOrMEAxHAoAADIgCC4gCmJCM
+IP8gRhXgPgUA/yBmFaANRQDu1sAeZgKAAA3MApyRKyBB/EEEFaAEBQD/IMYVofoBAOSWBS/8AoAA
+78wCBNCBAADuzAINiSYAAMCwlJf9IIYVoAUlAAcghgoCYwcAhgoCYQi/EQX/AhXWq5+ZDD4Rpu4t
+5p34QYgVr5x1ACwkBfKxaBXvmmUA6iQFJHysgAArIhIuMiQLikT7WgANMAwFAP9AAQUwDRUA+0AI
+Fa+7gQBYXYMkJhKIJ4sglCz/BAAV78kFAAn/AeSFFCf5AQAAn4mfiC5SdPpiKBWgDAUA/28ADbAN
+FQBYXXUqMhKwqvpiRhWgAgUA0Q8A//qMDaAHBQAV1jaKWGqhbww5EaaZK5KebrR2KZKdBDsKK7K/
+C5kB5JBpZWP9AACcWGWerWAADgAtIEAI3RD84AYV7/niAI9w6zwYKVAEgAD/rOwFp//BAP5IBh3g
+DBUA/uAGFaANRQBYZ1DAINEPAPoRIh3v+3oA//mMDaAJBQDAoFmSJopYa6GF//6MDaAJBQDAkMCK
+CKg0+KEGFa/+UgAAAABsEASKKo6vGNZg6CYLIUiBAADp5gAleOEAAO8mCClYBIAA/kEmFaAMBQD5
+QeYV75iFAPhAph2gDSUAWGd5wCDRDwAAAGwQBBvWUSoxDCuyfxzWMvhiEBXgFGUA+0PWDeAFBQB8
+oRbqJAAK2ASAAOw0AApoBIAAWN4QwCDRD2iRSGiSKGiUCsBA//9oDaAFBQAAfKHRe6vO2jBY3j3V
+oP//EA2gBAUAAAAAAAAA/UDmDaAUZQB7owJgAAHAQNowWN5T//6EDaAFBQDaMFjeZuWkAAUBEYAA
+/axcBaAKVQD8YCgV4DsFAFmVRv/95A2gBAUAAAAA//24DaAExQBsEAQpMBPxJrAN4PWFAGiRBMAg
+0Q8AhCeEThzWH+0wESJIDwAA/T+GHeAKVQDuMBIiQBMAAP8bph2gOwUAWZUx6zwYIlATAADsMBEl
+U/UAAFjedeU7CAJQFwAA7DASJVN5AABY3nHqJAAKWASAAFjf8sAg0Q+EJw8CAIROHNYILTARLUQC
+/mJQFaAKVQD+gGYdoDsFAFmVG+s8GCJQCwAA7DARJVMhAABY3l/lOwgCUA8AAOwwEiVSoQAAWN5b
+wCDRDwAAbBAE9EBgJeizHQAjVFf6qsYd4EQ1APSqph2gCHUA+KqGHaAJBQD4qmYd4EoFACpUUtEP
+AGwQBI84/avQBaAKVQD8YhAV4DsFAP/gaB2h//EAWZT7KTAQ6tXiFIyRAABokllplBKINiKifwmI
+EagiKCAFKQqVeYFewCDRDwAAANowWOB8/18ADeAJdQCLp4u+LLKODJ1W/SNAHejsuQDA037QEPtg
+QCXgDAUAWOBGwCDRDwAAWN+vwCDRDwCLNiqifwm7EftAAEVwCwUAWN8uwCDRDwAAAADApf2rhAWg
+OwUAWZTX+kBoHaALJQBY3ijAINEPAGwQBIguIyw4c4kFwCDRDwAAiy6Is+xEAAroBIAA67zgKVAE
+gAALgACMIu0gBS5+7gAAZN/Vji5z6dZj/80AAABsEBYlFheHNSYxDysgB4g04xYaKkgEgACZHP4j
+SBXgChUAmh/7q0gFoMhZAPwjZhWhuwEA+iLGFeP+9QD7T8QVoLZ5APoiZhXgd/kA+eOwFexIHQD6
+jwANMDhRAPggBh3vqgEA6hYUJFRWgAAGDEn8IcYVoAAyAAAAAAAAAJ4eLhIXKPE9KBYSL/If/iIG
+FefuAQAuFhX1wDwhEgCdAIoi+0BBoJIAnQDw5WAN4A0FAO0WESOASYAA2kBY6Hf0AAId4AYFAC8S
+G9pw/gBiHaAMJQDv7DkJ2ASAAFjoX/dAAEMwCPUAdoBV9CFmFaSWHQDjFgokyAUAAPgjBhXgAT4A
+AAAqEhJkp2MrEhqLtX22n/oiSBXgDBUA7BYRKlAEgADsEhAo6ASAAFjojGankfwAYh3gBQUACtU6
+ZFd7w2CUG/IhRhXk5h0ALhYYKBIWHtT8HNT949T+HCAEgAD1AAkyEgCdAOoSGCw3AoAAo2YpYp4O
+iAoogr/7IEDrogCdACZinQhmAdtg5rQABb15gACPyJsV9+A94JIAnQApMq7q1UYUu3mAAC4yrS2i
+ZO3rAQfT/QAA/cA63mIAnQCayP3AOvZiAJ0AjRwsIBTTD63MDAxHLCQU9YA8flIAnQAuEhspEhTx
+wMAN4Ag1APkAPYjiAJ0AZFDOihoPAgDIoWRQY+tkAAlQBIAA/ABiHaAdhQBY6ITuEg4teASAAOYS
+CyKvmYAAHNUmLRIT+amsBeAKBQCa8przmvSa9elpAg9EAoAA6fYALuiCgADo3QIK9sKAAP+mAA6w
+G8UA/eAmFeAKVQBZlCorEhX5YDgpUgCdAMAg7BIYKm8CgACj3SzWndEPAAAAAAAAj8j34DjgkgCd
+AOkSGCo3AoAAo2YoYp75ADk74gCdACtinQ5NCi3Svw27Aea0AAW42YAAsP6eyPrAaB3v+xoALxIR
+0w9k8HfrEgUpUASAAPwAYh2gHYUAWOhRGdT4FtT1jhsoEAAmYpsJ7gIZ1PQIHxTmhgsP+wKAAOn/
+AgR8oIAALBIQ7RISI1v/AAAosj8rsX2eoJ+hnaKco5uk+UCmFaAAcgAALBIQLRISK2EFiGOeoJ+h
+m6KYo52knKUmrBgtEhOMHgLdEO0WBy5kAoAA7BYIK6b+AAAa1In4IWgVoA8FAP4gxhXgDyUAnx0K
+iAIoFgnrZAAJUASAAPwAYh2gHYUAWOgmjRkvEhqJFisSGo/18TXQDeP+9QAc1MqLtP9ARhWgj5kA
+/UAGFeBviQD9QCYVoN+hAPDQABMwz5EA7tTCHulCgADupgMsQQKAAP0GAAx5uwEA66YELmDCgAAM
+ZgIIZgImpgUsEg3pnAElMGEAAOkWBiZj/QAA7BYNLnumAADrZAAJUASAAPwAYh2gHYUAWOgCFtSt
+iRePGPohKBXgDQUAnRGdEp0TnRSdpP1AphXv/vUAnqKeo5ugLhIa6f8CCsbCgADo/wIA4DEAAOb/
+AgDYIQAA7RwQJTBhAADvpgEg0BEAAFjmzvlAaB3gDBUA6sk5DSgEgADpFh4lIAmAACQWH/4AIh2g
+DQUACe045RYgJurhgAAT1I2IGIwXGtSMKxIbhBsV1IXxeAAUsA4VAOvrOQongoAA9IYACnYPBQAL
+rzn9JgAMsA01APkmAAwwDCUAC9w5LBYdCfkCKRYZ+eYAD7AFBQD+I4YV4AMKAAAPVlD+GAAF8M/J
+APwhKBXgj7EA/UAGFeDveQDs7hEMRAKAAOvMEA3agoAA7LsCCzPCgAD4xgALMM+BAP2IABYxj2kA
+7O4CDEUCgAAI7gIc1F+coSgQAAbuAvvGAA9wb7kA9MgAEzu/AQD3xgAPMAYlAObuAg3dAoAA7qYE
+LEICgAALiAKYpRvUV5uiGNRX+UBmFa/5jgCZoZSgnqKeo56knqWdpp2nnaidqS8SHeVcASUwoQAA
+/qARnGIAnQDrZAAJUASAAPwAgh2gLYUAWOeX5FBRas7CgAD0oApgkgCdACsSHMfv+yYADPANBQDj
+mQIL/S4AAI0TLBIajhKPEYvMLMIQmaGbqfVABhWgCAUAmKKYpp+jnqSdp5yljBT9QQYVr/4mAC0S
+GywSGRvUMAyZAuuZAgaEGYAA8OJADe/+9QCZoZSgnqKeo56k/0CmFaANBQCdpp2nnaj9QSYV7/02
+AC8SGiIWISvyFibxOCLxOizyFejxOSs0AoAABiICJvE7LfIb7vIaLEQCgAAIZgIo8hcv8hmfop6j
+naScppunmKiWpZmhlKCSqfIkKBWv+/YAAAAAAAAAAPDiQA3v+/UAmaGUoJuim6ObpPtAphXgCAUA
+mKaYp5io+UEmFa/7OgAsEhqNEi/BOybBOSjBOC7BOuvCGCs0AoAA5v8CDEQCgAAI7gImwhSIzCzC
+EJukmKeWqJmhnaKUoJyjn6WeqYwU/UDGFa/6GgArEhvsEhklg1GAABvT7sfv/SYADLANBQDrmQID
+gPGAAJmhlKCeop6jnqSepZ2mnaedqP1BJhXv+TIALhIaIhYhLeISLOITK+IYiO2G7i/iFILvLuIR
+nqKdo5ykm6WYppann6mZoZSgkqjyJCgVr/hWACsSHMff+yYADPAMBQDjmQIDgPGAAJmhlKCdop2j
+naSdpZymnKecqP1BJhWv95oAmaGUoI4T/iAoFeAIBQCYopijmKSYppinmKifpf9BJhWv9woAKhIa
+GdPAiqUT01glEiDkEh8lTDCAAOPTVBODuYAAHNO6ixsMuwL7P0YV7+eiAIUfwNL3rQAK/+gmAMCl
+/adoBaAbxQDuThEKaASAAFmStmP4ZwAA+iKIFaAOBQCeEZ4SnhOeFFjl0iQWH+UWICViYYAA+iKI
+FaALBQBY5cUkFh/0JAYV7/DaAC8SEGX4lWP4OhrTdYgbCogC+T9GFa/l1gDAoFlQ+sinG9OaK7CA
+ZLBaKhIUWOW+6RIeLV9OAAD6IogVoAsVAFjlsvgjyBXv71oAAAD/4CQNoDYFAOsSEipQBIAA7BIQ
+KOgEgABY5oFj+FcAACsSGowc7RIXKVAEgABYYQzSoNEPAAAAAPunBAWhSxUAWX9GLBoADKwC+6b6
+BaFLFQBZf0Zj/4UAAMCwwNoN/TTtxggtxVYAAPpAaB2gG8UA/AACHaANFQBYZDhj/6EAAAAAKxIW
++kBoHaAMBQDtEhgl2GEAAFhkMWP/hMCgWY8LHNL8j8j5/8HQkgCdAGP/t9ogW+wBY/hsiieNHMDA
+6qwgLtgEgABYWqLSoOsSGCpnAoAAo8wrxp3RDwAAAAAAAP/fpA2gBgUA/+FIDaAFRQDAoFmO9hzS
+5o/IHtLj+f/GuJIAnQD/4/ANoAYFAAAAAP/jlA2gCwUAwNoN/TT9gQYV7+OSAAAAAGwQBBTTRoIg
+JEJ/E9NFBCIMAyIC0Q8AAGwQDBjTQxrS1hnTQCiAfSqiRimSgwmqEeqZCAR8RIAAJJ0B9JAAFaAA
+MgAAACSdAyRMgBnS/ihBK/kACAxiAJ0AGtLr6gAFCMgEgAAJAmEJAmEJAmEJAmEZ0y8Y0wsf0r+O
+IJ8S+CDGFaAKRQDpFgAvdgKAAArqApoRKUAHL0Er/aZMBaGZAQDj7gIMzAKAAAn/Agj/Ap8UKyA5
+/iFmFaANJQCdGQy7AusWCCgECoAA9GAEsZIAnQCJRyqZFOSgf2TggQAAjZmLwP/4Ah2gJYUA7s4B
+BoIZgABtCC59sTgv0AAp0Ad18S8vwQXu+AgMzwKAAOndCARBAQAA6NsRftAEgADtpAAFAImAAGP/
+ygAA/68ADX//vgD9bwANcAkFAAqdOObUAA6BpgAA6kQACNgEgAD8AIIdoA0lAFhWVdEP//4MDaAN
+BQAAACocOvpHQBXgDGUAWYuzY/9cwnaOaPoAoh2gOwUA7NLtG2gEgAD+RzAV4+4BAFmR54poCo9X
+d/FtikcuoRX7RAAVr8sFAAurAavr62pwc2kBAADvogAmgYGAAH3xKCzQANMPDwIAdcEdKdAHDJkR
+6d0IBcEBAADo2yR+0ASAAO2kAA1+xgAA/e8ADfAKBQALrTjm1AAG+mGAAGP/dgAA/68ADT//cgAs
+IDkKDUN9yYiOIAjuEQ4+Ap5r0Q8AAAD/rwAOv/5CAGwQBiggBSwgB8GUDwIA+QAQdWHMAQApIgJl
+kcMtMAEb0kbm0kgeOASAAP+hQAbQD6UALiBOZeJX7tJCHk8CgAD1gArSEgCdAKaZKJKenBALywr3
+ABGU0gCdACuyvyqSnQurAesWASWOSYAAiuj3QA64kgCdAChiru3SNBQL+YAALGKtLdJ/7csBBUP9
+AAD9gAteYgCdAJjo/YALZmIAnQApIBSkmQkJRykkFPUgDXXSAJ0AHtIyG9IsjCD4ICgV4AoFACq2
+Mu7MAg5uAoAA/WcGFaAORQAO3QIttjEb0o3ckOsPHg3QBIAADAJnC0CGDAJlCyCGDAJjCwCG7AwA
+BNkBAAAK4IYLAm8KwIYLAm0KoIYLAmsKgIYLAmkuMQEoIQktIAcsMAEb0nsqIST8IAAGMN0RAOrd
+EA5kAoAADcwCDKoCHdJ1LCEiC6oCKpYgDcwCiyAd0hMoliMuliQsliL9YAAVsAwlAAy7AiuWIYoz
+6pYlJMgHAADtABUEymEAAAkAigx4EaaI/xOmFeflAQD5wAa5UgCdAMAg0Q8AAIro90AH4JIAnQAM
+eRGmmS2Sngt7Ciuyv/egCGTSAJ0ALZKdC9sBZLEAsK2d6OsWAS305gAA/CAGFaABZgAAAAAAAOok
+AAnYBIAA7EQACugEgABYX8fSoNEPAAAAAMCwD6k06eYILfTmAAD6QGgdoBvFAPwAIh2gDRUAWGL8
+Y//BAADqJAAK2ASAAFhhSNKg0Q8AixD6QGgdoAwVAPtjABXgDaUAWGLyY/+XwKBZjcwe0byK6Plf
+8PiQD6UAY/+q2iBb6sL/+TQNoA+lAACKJ+tEAApoBIAA+0QAFaAMBQBYWWDSoNEPAAAAAP/3XA2g
+CwUAwLgLmwL6QEYV7/0eAAAAAPwgBhWgCgUAWY20HtGliuiMEBvRoflf93iQD6UA//woDaALBQAA
+wLAPrTT9wQYV7/vyAABsEAYS0ZsX0hD1o0QFoBOVAPhQyBWgpiUAKiKCf6cgKyKCf7cYKiKELKAI
+JaAHdsE3iETAoAuAAAUzDGU/2tEPLSKEKSKHKiKH+WAABPuqgQB6mS8K6jArQkHDwgy7KKuq+paG
+Fa/+6gAuoQsu7PgODkPu7Pwi6/0AAP+iAAq//s4AAAAMAgAvIoJ//8Yl0AduW8DccPoAoh2gCwUA
+/qAAFzD/BQBZkOIlXPHKWygKcZgRwKFZhk/6ICgV4An1AAlZNpkQCbsM+iAmFeAKBQBZbQKKEApV
+DGVf18ChWYZF+g4iHeAKBQBZbPxj/2YAAABsEAYoIAUmIAfnNAAK2ASAAPgCgh3gBTUA+QAPnWFm
+AQALCEdoghSKIhjRUhfRVeRkAAUDyYAAwCDRDwArIh1lseGIJ4OI+wKkFe/MBQDpggskcIEAAAzs
+Aey7CAp/AoAA7BYAJdkBAADzIA38YgCdAC2JFKP6r90thRT7YA3rogCdAMl1yUPZMG1JBQcAhgkC
+YYrgDwIADwIAr6r7QBCsYgCdAPvABhWv/f4A7GoRAyTxAAAHqggrop4PAgD3YArZ0gCdACqinQhr
+CiuyvwuqAWWgT+tsGClQBIAA/AAiHaANNQBYYljAINEPABvRJIm49yAMoJIAnQAMShEHqggsop73
+gA0B0gCdACqinQhMCizCvwyqAeShjmTr/QAALbYIZK+vGdE6maCIIP+jGAXgCxUA66YCLEYCgAAF
+iAKYoYgzL/J//6JKBaiIHQCo/5+j7gAVBUhBAAD/ojIF4AgFALGI6YMeDA/oAACfphnRfPlBBhXg
+GAUAmKeOIAjuEQXuAp6pDE0Rp90l1p2OIiwgBoknC+4C69FzFmAFAADsJAYkyIEAAIiR/SCCFe/M
+BQAMnAHuJgIkQ0EAAOiWASbowQAA7ZUEJmEBAAB8iyIqkQUd0P2oqJiRnYCMIOuGAi5mAoAABcwC
+/QAmFaACBQDRDx3Q9Z2AjCAb0VvrhgIuZgKAAAXMAv0AJhWgAgUA0Q/aIFhgXdKg0Q8AAAD/+sQN
+oAoFAFv/OmP+FwAA8yBoHeAOBQD/AWYVr/e+AOO6DAOBuYAACksU7LwIK8AEgADsTDYJyASAANMP
+bckFCACGCQJhiRCqeOtNDATJAQAAbdkFCCCGCQJjixAK/Aysuyu8QPvABhXv9ooAwKBZjMsb0LuJ
+uBjQuPk/8viSAJ0A//n8DaAKBQDAoMDaDZ00/WEGFe/5wgCPEC/8QP/ABhXv9aYAAABsEAyIJ/hA
+SBXvygUA64EVKmcCgADsPAgEQIEAAAqIAai46IxALngEgAD5gCQSogCdAC3wBysgBxbQoezc/i+o
+BIAA+6BgFeH7AQDkkAlvxwKAAMAg0Q8A5o0IBsgZAAAo0p4e0JXrFgEv0ASAAPkAIjPiAJ0AG9CO
+KdKdC/sKK7K/C5kB55QABKG5gAAt4ggqFgz3oCJIkgCdAC9iruvRARee4YAALmKtL7LkD+gB6BYJ
+Jsv9AAD/wB4+YgCdABjQfpmI/8AeZmIAnQAtIBQpUAetmfohhhWnmQEAKSQU9SAg7dIAnQAZ0MEf
+0O/qIgAtbwKAAIg0HtCB5t0IDVYCgADxAAUCUgCdACggByshJPygJBWgFIUAlHP+4EYVoAQ1AASj
+AvuhGAWgiBEA43YBLEKCgAD5BgAMcAMFAPjgBhWgCCUA6gAFA9BBAABtigIKAmEuIQkpIAfy4KYV
+4DilAOx2CS91AoAA+cYADzHJAQDudgYuZAKAAAy8Ag/MApx0KyEJ2iD+oCQVoAwFAOTWnS3dAoAA
++WYADbANBQBYX7jAINEPAIYnKGEV6BYDIzCBAAD2IMYVr8kFAAlmAaaI71wgJEEBAAB48wSIEwj/
+DOnyACZABQAACKgCmBf4+AAE8IgVAHiZHB/QsYgX6HYBJkv9AAD+4AYV4ZkdAPjgRhXgAFIAiRcY
+0KqYcJlxifEJWRSZco8WiTYb0KaWEPngpBWimR0AC5kBG9CemBSmiCuyHe/yASRBAQAAKBYKCbsI
+63YDIkgJAADr0JYczwKAAAn/CCkWCAxJCOYSCCTICQAA6PMKfM8CgAAoEgQI/wzmmQwDwEEAAOSQ
+TG43AoAAmBWIGg9pCPkADuriAJ0AKRIFD4oM+iBGFaSqHQBtqQUPAIYJAmGIEikSAArPDAeICOmc
+QCRQQQAAbfkFCSCGCgJjKiIACKoRGNB59uAARLAPFQD/IMYV4AxFAAyqApqVmJSIUy+yGxbQdP2g
+FgWoiB0AqP+fl/wAChWgCgUA7NBwFNiBAACxquuDHg0P6AAA/yFGFaAoBQCYm480iFOKNQb/ARbQ
+ZuyqAQxCQoAACP8CBv8Cn5woUAkrUAsvUAomUAjs0GAd2QKAAOb/EAxDAoAA+wYADDCmMQDr/wIN
+UcKAAAr/Agj/Aoo2GM//n53+YUgV5bYdAOyqAQ3YQoAAC6oC+yHGFaRmAQDo/wELMgKAAAb/AohV
+mJ+GViaWEIxXL5YSLJYRi1QrlhMqUAEvUQHr0A4YBAqAAPFABDfSAJ0AKiAHCipA7CEkLVKCgAAL
+qgIqlhSIIPoDAh3gCjUA65YXLEYCgAAKiAIaz9v/IsYVoAsFAPkiphWgCCUA6gAFBNGBAABtigIK
+AmEoIQkuIAf7AAAUMBqlAAqIAiiWGvmgRAWh7gEAAO4RDs4CCO4CiBErlhkvlh3ulhgkQA0AACgW
+AY4RLtadLVAHiif1oABGsAwFAOvUAAVQgQAAWFdG0qDRDwAAAADpEgUmcuGAANMPbckFD0CGCQJl
+Y/5DwPCfGYgZH8+NwJoJ2TTp9ggsYeYAAPpAaB2gG8UA/AAiHaANFQBYYLfAINEPAAAAAAD7jwAP
+/+36AP/vJA2gCQUAjRHr/BgpUASAAP2gYBXgDBUAWGCswCDRDwAAAAAAAAD8IWYVoAoFAFmLgh7P
+c43oihyMG/m/3RiSAJ0AY/+UAJwb6xIJKVAEgABb6HWKHPwhaBWv71IAAGwQBikgBSYgB9gw9gBi
+HeAaRQD7IA/NIWYBAAUJR/0jAAFfxQUAiyIZz1wTz17kZAAFg7GAAMAg0Q+IJ4uILoEV6YILJHiB
+AAAF+gHq7ggKbwKAAOoWACdxAQAA+yAORGIAnQAsiRSdEavarcwshRT7wA4jogCdAMk0yULZsG1J
+BQMAhgkCYSwSASryAAyqCP9AESQiAJ0AmvDTsPhgaB2v/hoAAAAAAOxqEQMk/QAAA6oILaKeCWsK
+K7K/96ALAdIAnQAqop0PAgALqgFloE/rbBgpUASAAPwAIh2gDTUAWGBiwCDRDwAAAAAdzy2L2JgS
+92AMkJIAnQAMShGjqiyinveADRHSAJ0AKqKdCUwKLMK/DKoBZKGQsL6e2GSvrx7PRJ6gjSD9nywF
+oAsVAOumAi7uAoAAB90CnaGJgyjCf/+eXgXomR0AqYiYo+8AFQVIQQAA/55GBeAIBQCxiOmDHgwP
+6AAAn6YZz4b5QQYV4BgFAJinjiAI7hEH7gKeqekiBypvAoAAo90n1p0sIAbtIgIkyIEAAOWfAQZg
+BQAALCQGiJEsmQQL3QLtJgIkQ0EAAOiWASZgwQAA7JUEJ/kBAAD/BTIN4AwFACqRBR3PB6iomJGd
+gIsg7IYCLd4CgAAHuwL7ACYV4AIFANEPAAAdzv+dgIsgwMDshgIt3gKAAAe7AvsAJhXgAgUA0Q8A
+AOokAArYBIAAWF5k0qDRDwD/+qQNoAoFAPMgaB3gDgUA/wFmFa/5ogDr6gwBgbmAAApNFOzcCCnA
+BIAA7Ew2DcgEgADTD23JBQgAhgkCYYkQqjjtTgwEyQEAAG3pBQgghgkCY40RjBAK3QytzCzMQP3g
+BhWv+F4AAMCgWYrUHc7Ei9iIEhnOwfl/8viSAJ0A//noDaAKBQAAwKDA6g6+NP+hBhWv+aoAAIgQ
+KIxA+eAGFa/3ZgAAAABsEAQVzsQWzr7wiAATsAlFAOTPJRnGAoAACYgCKGYxBTUC52YyKhgEgADl
+ZjgpMASAAANghgYCZwNAhgYCZQMghgYCYwMAhuYMAAEZAQAAIi0B5B8eARIBAAADAm8EwIYDAm0E
+oIYDAmsEgIYDAmnRDwAAAGwQBiMgBxTOmAMDQerOlBnPAoAApJkokp76YAEGMAU1AOzCvywZHAAA
+K5KdDLsBy7kfzxAdzxD6QAgVoA4FAJ4QnhL8ICYV4AwFAPwAoh3gHuUAWFqCDD8RpP/186YV4AIF
+ANEPAAAAAAAAAOs8GClQBIAA/AAiHaANNQBYX6zHJNEPAGwQBiggcPWc7gXgBkUA6s5yFHXkgAAj
+IAcDA0EMOREFmQgrkp4kIgAKOgrqor8toYQAACiSndMPCooBZKBR20BY+IvAwfwAAh3gDhUA+Z3S
+BaAJBQD4ICYV4A8FAOkWAi1YBIAA6BYAKlAEgABYWloMPBGlzCbGnSogcCsK+wuqAfpOBh2gAgUA
+0Q/AINEPAOs8GClQBIAA/AAiHaANRQBYX4LHJNEPAGwQBCMgBxTOURXOTPuckgWhMwEA5EJ/Kc8C
+gAClmSiSngo6Ciqiv+NECAwRVAAAKJKdDwIACooBZKBE20D8AAIdoA0lAP4AQh2gHwUAWYv7/52A
+BaAIFQDupgAqfgKAAAj/Ap+hjSCdogw8EfWAAEZwCyUA+5OmFeACBQDRDwAA6zwYKVAEgAD8ACId
+oA0lAFhfXMck0Q8AbBAULzAQ95xOBeAKdQDz5PAN4AYFAPXgRXCSAJ0AaPIDwCDRDysgB/ogphWn
+lQEA+CNmFeG7AQDrFhwslGgAACwgBfeAYIxSAJ0ALSBy86BgN5IAnQDaIFhcXftAQoiSAJ0AjiL7
+wEI4kgCdACoiECwhGog1iynoFg0uf8KAAHj7DwsJQsiZDAtC+2BaEBIAnQCOHfwjiBWgH4UA7BYZ
+J2hdAAD73gAPtN0dAO0WCCboDQAAnRqdGfWAT4ISAJ0ADMsRp7sosp63SfkAYpPiAJ0AHc3xK7Kd
+DcwKLMK/DLsB+2Bf6BIAnQCMKY4qDA8+LxYXDO4Mf+t3KiAiKSAjCpkM+yBh2BIAnQAoIAcazmv9
+WgAV4YgBAA2ICS6B/gnvNg/uDC6F/i0gIq/dDQ1HLSQi+6BhKBIAnQAoon/uIgsmy/0AAPsABADQ
+CBUA4JkaDEAKgADp7ggEQ/0AAAjuAi4mCigSFwzpDPkgX8OiAJ0AiRoezlMsIAcoIQcdzcz+QSQV
+4MwRAPWQABY6iAEA7cwCDEMCgAAI/wItISScsIogiB0czdHu3QINVgKAAAqZApmxKiEinbSfswyq
+AhzOQZqyKSIQihWZtRnOP/xHEBXgDyUAn7mWt/lhBhWgDhUAnrr8AwAG8E51AA3qOQ3JOQqZAooY
+5rYLIcBBAADptgYlyMEAAG2pBQgAhgkCYR7NtZ68jTDzoELSkgCdACoSGekSCS1XAoAAp6oppp0o
+IBQvEhekiOgkFCeAwYAALRIXjCkrIDitzJwp82BWP5IAnQAuEhv5wFUZUgCdAMAg0Q8ALiAHLyAF
+LTARDg5BLhYc+eAxZFDdOQCPItzg/8AAFbAZxQDnuwgIBAqAAPvgTICSAJ0ALRYWKLKeKhYFLBYZ
++QBN4+IAnQAazXwpsp0PAgAK6goqor8KmQEpFg7pFhooBAqAAPsgTQgSAJ0A+kBoHaALRQBZiZL7
+QE1gUAsVABzNcIzI94BNqJIAnQAtcq4ezffTD/egSf1SAJ0AKnKtLeLMGc1n0w8NrwHvFhUmQ/0A
+AP1ATa5iAJ0AmJj9QEkOYgCdACkwFCkkOCgwFSgkOSYkO484jjaNOYw6iTyKOyolJSwlJC0lIy4l
+Ii8lCSkkTIg9KCRNLzIQLjIRLiYVJiRxJiRyJiRwKyRzJiYdKyYZKyYYKyYXJiYbJiRPJiROKyUp
+LyUoLTARKhIFLiEaDQ1DLSQ6/0Av8KIAnQAtIDgq+vz7wAQFMA8lAA/cAe/QHXVTsQAA/wAAB7AJ
+FQD/LQAP+Y4dAAj/CA7/EQ+qDP+bgAWgCRUA/S0ADjAIRQAI2AEK7ywImDkK7i4OnjkZzYvv7ggL
+eASAAAifORjNTd1gDI05D90CKCAUDq8c7yU0JUvxAAAOnhykjO4lNSzMAoAA6dkCDXQCgAAO3QIu
+EhYpJhAsJBTtJg8nLSmAABrNZS8gB40pnSyOPp4f/iHIFaCfEQDoIQgsyoKAAAqZApng+Zs4BeH/
+AQDqIgAv/AKAAA+IAvkGAAxwDzUA6akCDVYCgAAPqgKa4f+aLAXgKgUAmuPv5gIuUgKAAAuqAo8r
+luUo5gQp5gYq5gcv5gnt5ggneMEAAP4jRhXgHUUA/CCGFeAKBQD6IgYVoBmFACkWGCYkFCsSGvph
+6BWgDBUA+iImFaANBQD6QAgVoAkFAPggBhXgDgUA+CBGFeAIFQD4ICYVoA8VAFhY4ywgOPrAaB3g
+HwUA8iPmFeANJQD9gAQB8OwRAO7bOQtIBIAA8+0ADPDsGQD7xgAPcMwBAPLAaB3gKwUADLM5KyA5
+6GQAC3gEgAD4ZgAJ8EkFAP1gBAbwuwEA+yIAD/CMBQDtyDgNWASAAPpACBWgDQUAnREczVacEAj/
+AgP/AvIj6BXgDQUA/8YAD3AMFQD/wAAXMA9FAP/GAA9wDwUA/iBGFaAOBQBYWLnAwe/NSR1YBIAA
++kAIFaQJBQD4IAYV4A0FAPggRhXgCAUA+CAmFaAOFQBYWK4oEhHpEg8tWASAAPpACBWv/vUAnhD8
+RKQV7//1APxEhBWomQEA+zgAFLiIAQDpiAIO7AKAAP2GAA5wHqUA+CBGFaANBQD8ICYVoAwVAFhY
+mgqrAvpACBWv/fUA/CAGFeAMBQAsFgEpISIoIQkuChz5IAAUv//1APkGAAxwDBUA+CBGFaANBQBY
+WIsqFhIqIShZivntzRYdYASAAPpACBWv/vUAnhAuEhAt0CwbzRXu3QIGY/0AAOLpEA7oQoAA7ZkC
+DmZCgAAMmQILmQKZESgiFRnNDP//4h3gHuUA+iJIFeaIHQD5BgAMcA0FAPggRhWgDBUAWFhw+0Bo
+HeAMFQD6QAgVoAgFAPggBhWgDQUA+CAmFaAOBQD4IEYVoA8VAFhYZYkw8yAVepIAnQAuEhkbzGgs
+IQftEhgvdwKAAKfuLeadKCANK7I4HczojyCOICkgDCrS+g67CO4gFS3eQoAAC6oIKhYTKyAHK6QH
+KaQMLKUHKKQNLDIJLKUJLqQVLjIR+GIIFa/MAQAsFhQopSgspSP9oIgV4AkVAPlFJB3gG0UAK6QF
+/0PGFebuHQD6IqgV4P/1AP+gAEawDgUA/ULGFeANFQBY9m4rEhMvEhYoEhQpsBX3YoYdoCsFAOuk
+AyxGAoAA5qQALMkCgAD5BgAMcAkVAAmIAuimASeUIYAALCA6wN/9gBP8YgCdAC8wV8TgD+4MnhvA
+0f4f4h3gDgUA7CEJJVhBAADsFgwpUASAAFj2U4kcixsmJBQoIBUmpAArpAPomREMQQKAAPkGAAxw
+CRUACYgC+UAmFaALxQCKJxzMP4quiRQMAIcKAmEKAmEKAmEKAmEKAmEKAmEKAmEKAmEtEhYrdq34
+QKYd4A4VAO4kFyaBWYAALyA6wI948R4ZzB4oMFAJiAooghDsMFch2UEAAPpAaB2gDSUAC4AABQpH

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 22 23:49:00 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B745E820;
 Sun, 22 Jun 2014 23:49:00 +0000 (UTC)
Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com
 [IPv6:2a00:1450:400c:c05::232])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id D56DF222E;
 Sun, 22 Jun 2014 23:48:59 +0000 (UTC)
Received: by mail-wi0-f178.google.com with SMTP id n15so3214732wiw.11
 for ; Sun, 22 Jun 2014 16:48:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=hQAr8kzWNb1V2HUrD771CWoBpl4omN28Ku1TfmvFpKE=;
 b=mVKwmU4jQomb92/f4Rt1hDaYutSeZxdrK157IQuNhoWTleORSVoV0KbP/ja9FjKpxt
 Kt1BDwlG4Lh8Ag19WCHdmG28nxmoxMuh3jG9JrwptIn+K15gKbbNmr/Tb/5XHayim178
 uCFr8wNPrdwVQfXHRyiF4q0bNuBwzaGxC7CY6aai4Vv4Hgio3+8Pa2wbz1nXg7bBhHzk
 l0kTNod7cZTvw7pDSh7PLBGwt1uQFFTS97tUBm/tu3r5/Cf3bjlRKB9DU8iuiTrW69dy
 9zzoHcvK+ZY9SkHHdxcI6AmqVgII7VjsZ/R7YffNZEIyIz9exrfr0qx/8vIqKuONNbvO
 mXNQ==
X-Received: by 10.180.198.116 with SMTP id jb20mr21371848wic.59.1403480938208; 
 Sun, 22 Jun 2014 16:48:58 -0700 (PDT)
Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1])
 by mx.google.com with ESMTPSA id i6sm27866841wiy.17.2014.06.22.16.48.56
 for 
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 22 Jun 2014 16:48:57 -0700 (PDT)
Sender: Baptiste Daroussin 
Date: Mon, 23 Jun 2014 01:48:55 +0200
From: Baptiste Daroussin 
To: "Pedro F. Giffuni" 
Subject: Re: svn commit: r267745 - head/lib/libc/stdlib
Message-ID: <20140622234855.GM23976@ivaldir.etoilebsd.net>
References: <201406222013.s5MKDwHw045376@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="c8UbHMnQwI7BF+TB"
Content-Disposition: inline
In-Reply-To: <201406222013.s5MKDwHw045376@svn.freebsd.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 22 Jun 2014 23:49:00 -0000


--c8UbHMnQwI7BF+TB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Jun 22, 2014 at 08:13:58PM +0000, Pedro F. Giffuni wrote:
> Author: pfg
> Date: Sun Jun 22 20:13:57 2014
> New Revision: 267745
> URL: http://svnweb.freebsd.org/changeset/base/267745
>=20
> Log:
>   getopt(3): recognize option:: as GNU extension for "optional options".
>  =20

Will that allow to have sed -i acting like sed -i '' ?
If yes that will help a lot with GNU compatibility, porters will like it :)

regards,
Bapt

--c8UbHMnQwI7BF+TB
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlOna2cACgkQ8kTtMUmk6EycLwCdEGKAN56QYZoPMQ+HHeTIGGIY
fx0An1r7s9OvfxLgjfwYK643yst9dnNx
=Zn1j
-----END PGP SIGNATURE-----

--c8UbHMnQwI7BF+TB--

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 00:54:56 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B8CA2CC2;
 Mon, 23 Jun 2014 00:54:56 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A63E429C8;
 Mon, 23 Jun 2014 00:54:56 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5N0sutM081735;
 Mon, 23 Jun 2014 00:54:56 GMT (envelope-from ache@svn.freebsd.org)
Received: (from ache@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N0suIA081734;
 Mon, 23 Jun 2014 00:54:56 GMT (envelope-from ache@svn.freebsd.org)
Message-Id: <201406230054.s5N0suIA081734@svn.freebsd.org>
From: "Andrey A. Chernov" 
Date: Mon, 23 Jun 2014 00:54:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267758 - head
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 00:54:56 -0000

Author: ache
Date: Mon Jun 23 00:54:56 2014
New Revision: 267758
URL: http://svnweb.freebsd.org/changeset/base/267758

Log:
  Change suggestion how to set MAKESYSPATH as broken incremental build
  workaround. Magic ".../share/mk" (search directories up to /)
  does not work for f.e. /usr/src/gnu/lib/libgcc because the path
  inside is starting from /usr/obj hierarchy and ends up in
  /usr/share/mk, not in the /usr/src/share/mk where src.opts.mk is.
  IMHO proper fixing of incremental build is needed urgently.

Modified:
  head/UPDATING

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Sun Jun 22 23:40:20 2014	(r267757)
+++ head/UPDATING	Mon Jun 23 00:54:56 2014	(r267758)
@@ -67,7 +67,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
 	behavior back, you can .include /etc/src.conf from /etc/make.conf
 	(which is still global and isn't changed). This also changes the
 	behavior of incremental builds inside the tree of individual
-	directories. Set MAKESYSPATH to ".../share/mk" to do that.
+	directories. Set MAKESYSPATH to "/usr/src/share/mk" to do that.
 	Although this has survived make universe and some upgrade scenarios,
 	other upgrade scenarios may have broken. At least one form of
 	temporary breakage was fixed with MAKESYSPATH settings for buildworld

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 00:55:07 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4EC34DFF
 for ; Mon, 23 Jun 2014 00:55:07 +0000 (UTC)
Received: from nm3-vm0.bullet.mail.bf1.yahoo.com
 (nm3-vm0.bullet.mail.bf1.yahoo.com [98.139.212.154])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C993229CE
 for ; Mon, 23 Jun 2014 00:55:06 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1403484897; bh=8k+oTu8qg5mfYu+CiWVpdbHunbzxGLQZKe+Q8OtFq/Q=;
 h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer;
 b=KUFUKnmpdTxIjaAtayBW0oyWDmBAfnGxsgbVUoYWRzy4gbUf2zGCq3F7YK90rKc9YezYTf3t1F/c3yjE+4nt3UeA/52Qr4UHiP/knV2TamfSDtj2iZb//pjaKvYbPncxzgfH6BlmyVKqiGrCa7b5d1/8EDVsW5Krifd1JV51HkBLrgsn6G25FkBd7X9herX3Su1qXC77d8chTpLQCygoHwFA2TI0yevPoMrvsruw8Pg+xa+AUKhNQUWMIzgyFKPDTAs5wQYBcFYmsgjNnBVpxhS45QrLOIlPoBy5+0pAeb6ghLf57hh7hyyV/UnZR3BhdF7yYIMzROI1dvI7tOdOaA==
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com;
 b=cLH2Mr1ANri9kWT17OobzCtmkUqB+v9yWjMmXfKFKjpu+wbWpRUv+UD3dCO9CWlzimiFMDGnS+vNC+Me0rLic0oh3a6ZHDGCiHVdzMnkxV6qrtv1RsJbUtl5mJ0xIE0d5jwt10x7oxQAppVB7j7RQ1zQEVqLibZ3KNp+NieWvN1Hn4G1oEAWzuZz++W1d2nS3BNzaWXaKTrfu938MCqs8kx5E1brmetIE2mBX+yJCvbm7bh5AjLgpv8m47zdBbzTa9BDgVdmxqJYu2vsi++T/aEDzIQZ+0nT56Y7Nt8xb6erelqkoUpwyb3Gv3uri9juSbIsPuuXEpSRxt5E5rLdVg==;
Received: from [66.196.81.174] by nm3.bullet.mail.bf1.yahoo.com with NNFMP;
 23 Jun 2014 00:54:57 -0000
Received: from [68.142.230.65] by tm20.bullet.mail.bf1.yahoo.com with NNFMP;
 23 Jun 2014 00:54:57 -0000
Received: from [127.0.0.1] by smtp222.mail.bf1.yahoo.com with NNFMP;
 23 Jun 2014 00:54:57 -0000
X-Yahoo-Newman-Id: 818940.58463.bm@smtp222.mail.bf1.yahoo.com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: 5XL0lB0VM1lpGJUh74kX5NrOhINxb3UIau27gjEwUzGnX9b
 t8dD_WL5FG0y0fzfcJnrfLwGy78w4fjlGxluFEMLR4htLJ7uEy_DCMFKLvlr
 cF9.gzkLitJXXV50zq_VH7WyrhtRBAQLCu.Rhh9TDzBxYr3EZf4j7Db2aDsg
 Qrb1JLHaSARlmjm1QFjrfdpQ5IZLzk.KrW4kPpl8Ov4BOpG7PdbvxJf0o7_4
 lk8OLfNAmuEniCpRvTgyEzuOnGncR957xSpQgTBQ6IhIEJyiBSpL6X4yd05n
 ZluTS4iJl1aqfP9XhO5tJtQgME_oyM0NuRyQl8Bpqmgpzl4YN1qOaQfuZLEr
 .YGpe1o3C5RqCvwot1hoQ83I29XlyNjVX.hlhaYFUupsJSnkmM2pSmr3i3bg
 qmGvPMGBklri5LSrsMZW0VwyQhrRrfe.fLSeAQGYRUnWQIKXvWs7SzIc5fMM
 8ir2fQ5BFnBUWSOUakB5zPMayRepK1t_KrnA3BtyZWSRmcLbYPkR.w5cwfOk
 3kYp0nFwSj.hbcmjjYXCil0JRXCN9dDYSfsQ8hNdcqliCsF_rgvOnmvmTTYj
 qkUWMw.nYvflMam6H8ThuFDqYjE2Vz_JfKCYPa5cgrjQ-
X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf
X-Rocket-Received: from [192.168.0.101] (pfg@190.157.126.109 with plain
 [98.139.211.125])
 by smtp222.mail.bf1.yahoo.com with SMTP; 23 Jun 2014 00:54:57 +0000 UTC
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r267745 - head/lib/libc/stdlib
From: Pedro Giffuni 
In-Reply-To: <20140622234855.GM23976@ivaldir.etoilebsd.net>
Date: Sun, 22 Jun 2014 19:53:50 -0500
Content-Transfer-Encoding: quoted-printable
Message-Id: <4D4D1F62-4482-4CB5-8352-E888DA617789@freebsd.org>
References: <201406222013.s5MKDwHw045376@svn.freebsd.org>
 <20140622234855.GM23976@ivaldir.etoilebsd.net>
To: Baptiste Daroussin 
X-Mailer: Apple Mail (2.1878.2)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 00:55:07 -0000


Il giorno 22/giu/2014, alle ore 18:48, Baptiste Daroussin =
 ha scritto:

> On Sun, Jun 22, 2014 at 08:13:58PM +0000, Pedro F. Giffuni wrote:
>> Author: pfg
>> Date: Sun Jun 22 20:13:57 2014
>> New Revision: 267745
>> URL: http://svnweb.freebsd.org/changeset/base/267745
>>=20
>> Log:
>>  getopt(3): recognize option:: as GNU extension for "optional =
options".
>>=20
>=20
> Will that allow to have sed -i acting like sed -i '=92 ?

Hmm .. yes.

> If yes that will help a lot with GNU compatibility, porters will like =
it :)
>=20


The illumos guys did it long ago on their fork of our BSD sed:

https://www.illumos.org/issues/586

so a patch is available[1].

There was also a discussion/bikeshed about how ugly and non-unixish such =
an extension is.

Pedro.


[1]
=
http://src.illumos.org/source/diff/illumos-gate/usr/src/cmd/sed/main.c?r1=3D=
/illumos-gate/usr/src/cmd/sed/main.c@d15978eab6c23a98f0a5474466d5fe9b1be3c=
a9b&r2=3D/illumos-gate/usr/src/cmd/sed/main.c@e50226eccc6dfcba3cc6f0df3843=
8900e3df225c&format=3Du&full=3D0



From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 01:10:57 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 026AA42E;
 Mon, 23 Jun 2014 01:10:57 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C9CDE2B2C;
 Mon, 23 Jun 2014 01:10:56 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5N1Auqq090290;
 Mon, 23 Jun 2014 01:10:56 GMT (envelope-from markj@svn.freebsd.org)
Received: (from markj@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N1Auem090289;
 Mon, 23 Jun 2014 01:10:56 GMT (envelope-from markj@svn.freebsd.org)
Message-Id: <201406230110.s5N1Auem090289@svn.freebsd.org>
From: Mark Johnston 
Date: Mon, 23 Jun 2014 01:10:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267759 - head/sys/cddl/dev/dtrace/amd64
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 01:10:57 -0000

Author: markj
Date: Mon Jun 23 01:10:56 2014
New Revision: 267759
URL: http://svnweb.freebsd.org/changeset/base/267759

Log:
  Fix a couple of bugs on amd64 when fetching probe arguments beyond the
  first five for probes entered through a UD fault (i.e. FBT probes).
  
  Specifically, handle the fact that dtrace_invop_callsite must be
  16 byte-aligned and thus may not immediately follow the call to
  dtrace_invop() in dtrace_invop_start(). Also fetch register arguments and
  the stack pointer through a struct trapframe instead of a struct reg.
  
  PR:		191260
  Submitted by:	luke.tw@gmail.com
  MFC after:	3 weeks

Modified:
  head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c

Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c
==============================================================================
--- head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c	Mon Jun 23 00:54:56 2014	(r267758)
+++ head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c	Mon Jun 23 01:10:56 2014	(r267759)
@@ -349,7 +349,8 @@ dtrace_getarg(int arg, int aframes)
 	for (i = 1; i <= aframes; i++) {
 		fp = fp->f_frame;
 
-		if (fp->f_retaddr == (long)dtrace_invop_callsite) {
+		if (P2ROUNDUP(fp->f_retaddr, 16) ==
+		    (long)dtrace_invop_callsite) {
 			/*
 			 * In the case of amd64, we will use the pointer to the
 			 * regs structure that was pushed when we took the
@@ -363,33 +364,33 @@ dtrace_getarg(int arg, int aframes)
 			 * we're seeking is passed in regsiters, we can just
 			 * load it directly.
 			 */
-			struct reg *rp = (struct reg *)((uintptr_t)&fp[1] +
-			    sizeof (uintptr_t));
+			struct trapframe *tf =
+			    (struct trapframe *)((uintptr_t)&fp[1]);
 
 			if (arg <= inreg) {
 				switch (arg) {
 				case 0:
-					stack = (uintptr_t *)&rp->r_rdi;
+					stack = (uintptr_t *)&tf->tf_rdi;
 					break;
 				case 1:
-					stack = (uintptr_t *)&rp->r_rsi;
+					stack = (uintptr_t *)&tf->tf_rsi;
 					break;
 				case 2:
-					stack = (uintptr_t *)&rp->r_rdx;
+					stack = (uintptr_t *)&tf->tf_rdx;
 					break;
 				case 3:
-					stack = (uintptr_t *)&rp->r_rcx;
+					stack = (uintptr_t *)&tf->tf_rcx;
 					break;
 				case 4:
-					stack = (uintptr_t *)&rp->r_r8;
+					stack = (uintptr_t *)&tf->tf_r8;
 					break;
 				case 5:
-					stack = (uintptr_t *)&rp->r_r9;
+					stack = (uintptr_t *)&tf->tf_r9;
 					break;
 				}
 				arg = 0;
 			} else {
-				stack = (uintptr_t *)(rp->r_rsp);
+				stack = (uintptr_t *)(tf->tf_rsp);
 				arg -= inreg;
 			}
 			goto load;

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 01:28:18 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D3F4B81C;
 Mon, 23 Jun 2014 01:28:18 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A53D72C0E;
 Mon, 23 Jun 2014 01:28:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5N1SIPL097225;
 Mon, 23 Jun 2014 01:28:18 GMT (envelope-from mjg@svn.freebsd.org)
Received: (from mjg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N1SIYK097224;
 Mon, 23 Jun 2014 01:28:18 GMT (envelope-from mjg@svn.freebsd.org)
Message-Id: <201406230128.s5N1SIYK097224@svn.freebsd.org>
From: Mateusz Guzik 
Date: Mon, 23 Jun 2014 01:28:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267760 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 01:28:18 -0000

Author: mjg
Date: Mon Jun 23 01:28:18 2014
New Revision: 267760
URL: http://svnweb.freebsd.org/changeset/base/267760

Log:
  Tidy up fd-related functions called by do_execve
  
  o assert in each one that fdp is not shared
  o remove unnecessary NULL checks - all userspace processes have fdtables
  and kernel processes cannot execve
  o remove comments about the danger of fd_ofiles getting reallocated - fdtable
  is not shared and fd_ofiles could be only reallocated if new fd was about to be
  added, but if that was possible the code would already be buggy as setugidsafety
  work could be undone
  
  MFC after:	1 week

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Mon Jun 23 01:10:56 2014	(r267759)
+++ head/sys/kern/kern_descrip.c	Mon Jun 23 01:28:18 2014	(r267760)
@@ -2081,15 +2081,8 @@ setugidsafety(struct thread *td)
 	struct file *fp;
 	int i;
 
-	/* Certain daemons might not have file descriptors. */
 	fdp = td->td_proc->p_fd;
-	if (fdp == NULL)
-		return;
-
-	/*
-	 * Note: fdp->fd_ofiles may be reallocated out from under us while
-	 * we are blocked in a close.  Be careful!
-	 */
+	KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared"));
 	FILEDESC_XLOCK(fdp);
 	for (i = 0; i <= fdp->fd_lastfile; i++) {
 		if (i > 2)
@@ -2141,15 +2134,8 @@ fdcloseexec(struct thread *td)
 	struct file *fp;
 	int i;
 
-	/* Certain daemons might not have file descriptors. */
 	fdp = td->td_proc->p_fd;
-	if (fdp == NULL)
-		return;
-
-	/*
-	 * We cannot cache fd_ofiles since operations
-	 * may block and rip them out from under us.
-	 */
+	KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared"));
 	FILEDESC_XLOCK(fdp);
 	for (i = 0; i <= fdp->fd_lastfile; i++) {
 		fde = &fdp->fd_ofiles[i];
@@ -2180,8 +2166,6 @@ fdcheckstd(struct thread *td)
 	int i, error, devnull;
 
 	fdp = td->td_proc->p_fd;
-	if (fdp == NULL)
-		return (0);
 	KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared"));
 	devnull = -1;
 	error = 0;

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 02:00:16 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0A88BEC6;
 Mon, 23 Jun 2014 02:00:16 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DFBF72E43;
 Mon, 23 Jun 2014 02:00:15 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5N20F89011468;
 Mon, 23 Jun 2014 02:00:15 GMT (envelope-from markj@svn.freebsd.org)
Received: (from markj@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N20Fwt011463;
 Mon, 23 Jun 2014 02:00:15 GMT (envelope-from markj@svn.freebsd.org)
Message-Id: <201406230200.s5N20Fwt011463@svn.freebsd.org>
From: Mark Johnston 
Date: Mon, 23 Jun 2014 02:00:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267761 - in head/sys/cddl:
 contrib/opensolaris/uts/common/sys dev/dtrace/i386
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 02:00:16 -0000

Author: markj
Date: Mon Jun 23 02:00:14 2014
New Revision: 267761
URL: http://svnweb.freebsd.org/changeset/base/267761

Log:
  Fix some bugs when fetching probe arguments in i386. Firstly ensure that
  the 4 byte-aligned dtrace_invop_callsite can be found and that it
  immediately follows the call to dtrace_invop(). Secondly, fix some pointer
  arithmetic to account for differences between struct i386_frame and illumos'
  struct frame. Finally, ensure that dtrace_getarg() isn't inlined. It works
  by following a fixed number of frame pointers to the probe site, so inlining
  breaks it.
  
  MFC after:	3 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h
  head/sys/cddl/dev/dtrace/i386/dtrace_asm.S
  head/sys/cddl/dev/dtrace/i386/dtrace_isa.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h	Mon Jun 23 01:28:18 2014	(r267760)
+++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h	Mon Jun 23 02:00:14 2014	(r267761)
@@ -1268,7 +1268,11 @@ typedef struct dtrace_toxrange {
 	uintptr_t	dtt_limit;		/* limit of toxic range */
 } dtrace_toxrange_t;
 
+#if defined(sun)
 extern uint64_t dtrace_getarg(int, int);
+#else
+extern uint64_t __noinline dtrace_getarg(int, int);
+#endif
 extern greg_t dtrace_getfp(void);
 extern int dtrace_getipl(void);
 extern uintptr_t dtrace_caller(int);

Modified: head/sys/cddl/dev/dtrace/i386/dtrace_asm.S
==============================================================================
--- head/sys/cddl/dev/dtrace/i386/dtrace_asm.S	Mon Jun 23 01:28:18 2014	(r267760)
+++ head/sys/cddl/dev/dtrace/i386/dtrace_asm.S	Mon Jun 23 02:00:14 2014	(r267761)
@@ -49,14 +49,8 @@
 	 * dtrace_invop wants us to do.
 	 */
 	call	dtrace_invop
-
-	/*
-	 * We pushed 3 times for the arguments to dtrace_invop,
-	 * so we need to increment the stack pointer to get rid of
-	 * those values.
-	 */
-	addl	$12, %esp
 	ALTENTRY(dtrace_invop_callsite)
+	addl	$12, %esp
 	cmpl	$DTRACE_INVOP_PUSHL_EBP, %eax
 	je	invop_push
 	cmpl	$DTRACE_INVOP_POPL_EBP, %eax

Modified: head/sys/cddl/dev/dtrace/i386/dtrace_isa.c
==============================================================================
--- head/sys/cddl/dev/dtrace/i386/dtrace_isa.c	Mon Jun 23 01:28:18 2014	(r267760)
+++ head/sys/cddl/dev/dtrace/i386/dtrace_isa.c	Mon Jun 23 02:00:14 2014	(r267761)
@@ -413,7 +413,8 @@ dtrace_getarg(int arg, int aframes)
 	for (i = 1; i <= aframes; i++) {
 		fp = fp->f_frame;
 
-		if (fp->f_retaddr == (long)dtrace_invop_callsite) {
+		if (P2ROUNDUP(fp->f_retaddr, 4) ==
+		    (long)dtrace_invop_callsite) {
 			/*
 			 * If we pass through the invalid op handler, we will
 			 * use the pointer that it passed to the stack as the
@@ -422,7 +423,7 @@ dtrace_getarg(int arg, int aframes)
 			 * beyond the EIP/RIP that was pushed when the trap was
 			 * taken -- hence the "+ 1" below.
 			 */
-			stack = ((uintptr_t **)&fp[1])[1] + 1;
+			stack = ((uintptr_t **)&fp[1])[0] + 1;
 			goto load;
 		}
 
@@ -438,7 +439,7 @@ dtrace_getarg(int arg, int aframes)
 	 */
 	arg++;
 
-	stack = (uintptr_t *)&fp[1];
+	stack = (uintptr_t *)fp + 2;
 
 load:
 	DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 03:13:49 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0BF9E76D;
 Mon, 23 Jun 2014 03:13:49 +0000 (UTC)
Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214])
 (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7FC1D24B1;
 Mon, 23 Jun 2014 03:13:48 +0000 (UTC)
Received: from laptop015.home.selasky.org
 (cm-176.74.213.204.customer.telag.net [176.74.213.204])
 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits))
 (No client certificate requested)
 by mail.turbocat.net (Postfix) with ESMTPSA id 8661F1FE045;
 Mon, 23 Jun 2014 05:13:39 +0200 (CEST)
Message-ID: <53A79B7C.60500@selasky.org>
Date: Mon, 23 Jun 2014 05:14:04 +0200
From: Hans Petter Selasky 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:24.0) Gecko/20100101 Thunderbird/24.1.0
MIME-Version: 1.0
To: John Baldwin , src-committers@freebsd.org, 
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject: Re: svn commit: r267581 - in head/sys/dev/sound: pci pci/hda pcm
References: <201406171607.s5HG7vJd058451@svn.freebsd.org>
In-Reply-To: <201406171607.s5HG7vJd058451@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 03:13:49 -0000

Hi,

Looks like this patch cause instant panic at USB audio detach:

> usbconfig -d 0.4 reset
> uaudio0: at uhub1, port 2, addr 4 (disconnected)
>
> vm_fault(0xc0661400, 0, 1, 0) -> 1
> Fatal kernel mode data abort: 'Translation Fault (P)'
> trapframe: 0xd28b8b58
> FSR=00000017, FAR=0000002c, spsr=60000113
> r0 =00000000, r1 =c1b35000, r2 =00000000, r3 =00000000
> r4 =c1a24000, r5 =00000000, r6 =c1b3338c, r7 =c172e150
> r8 =c1b35000, r9 =00000000, r10=c162a400, r11=d28b8bd0
> r12=c1bc9ad4, ssp=d28b8ba8, slr=c1b9855c, pc =c048fa3c
>
> [ thread pid 14 tid 100037 ]
> Stopped at      bus_dmamem_free+0x10:   ldr     r0, [r9, #0x02c]
> db> bt

> Tracing pid 14 tid 100037 td 0xc1712960
> db_trace_self() at db_trace_self
>          pc = 0xc0492958  lr = 0xc0130f38 (db_stack_trace+0xf4)
>          sp = 0xd28b8860  fp = 0xd28b8878
>         r10 = 0xc0660180
> db_stack_trace() at db_stack_trace+0xf4
>          pc = 0xc0130f38  lr = 0xc01308a8 (db_command+0x270)
>          sp = 0xd28b8880  fp = 0xd28b8920
>          r4 = 0x00000000  r5 = 0x00000000
>          r6 = 0x00000000
> db_command() at db_command+0x270
>          pc = 0xc01308a8  lr = 0xc013060c (db_command_loop+0x60)
>          sp = 0xd28b8928  fp = 0xd28b8938
>          r4 = 0xc04d2192  r5 = 0xc04ec76c
>          r6 = 0xc066016c  r7 = 0xc058b540
>          r8 = 0xc0656294  r9 = 0xc0656290
>         r10 = 0x00000001
> db_command_loop() at db_command_loop+0x60
>          pc = 0xc013060c  lr = 0xc0132fd4 (db_trap+0xd8)
>          sp = 0xd28b8940  fp = 0xd28b8a60
>          r4 = 0x00000000  r5 = 0xc0660178
>          r6 = 0xc06562c0
> db_trap() at db_trap+0xd8
>          pc = 0xc0132fd4  lr = 0xc028efbc (kdb_trap+0xbc)
>          sp = 0xd28b8a68  fp = 0xd28b8a88
>          r4 = 0x00000000  r5 = 0x00000017
>          r6 = 0xc06562c0  r7 = 0xc058b540
> kdb_trap() at kdb_trap+0xbc
>          pc = 0xc028efbc  lr = 0xc04a5194 (dab_fatal+0x174)
>          sp = 0xd28b8a90  fp = 0xd28b8aa8
>          r4 = 0xd28b8b58  r5 = 0x00000017
>          r6 = 0x600001d3  r7 = 0x0000002c
>          r8 = 0xd28b8b58  r9 = 0x00000013
>         r10 = 0x00000001
> dab_fatal() at dab_fatal+0x174
>          pc = 0xc04a5194  lr = 0xc04a4f4c (data_abort_handler+0x3e8)
>          sp = 0xd28b8ab0  fp = 0xd28b8b50
>          r4 = 0xc16be3cc  r5 = 0xc1712960
>          r6 = 0xd28b8eb0  r7 = 0x00000000
> data_abort_handler() at data_abort_handler+0x3e8
>          pc = 0xc04a4f4c  lr = 0xc04944d4 (exception_exit)
>          sp = 0xd28b8b58  fp = 0xd28b8bd0
>          r4 = 0xc1a24000  r5 = 0x00000000
>          r6 = 0xc1b3338c  r7 = 0xc172e150
>          r8 = 0xc1b35000  r9 = 0x00000000
>         r10 = 0xc162a400
> exception_exit() at exception_exit
>          pc = 0xc04944d4  lr = 0xc1b9855c (sndbuf_free+0x80)
>          sp = 0xd28b8ba8  fp = 0xd28b8bd0
>          r0 = 0x00000000  r1 = 0xc1b35000
>          r2 = 0x00000000  r3 = 0x00000000
>          r4 = 0xc1a24000  r5 = 0x00000000
>          r6 = 0xc1b3338c  r7 = 0xc172e150
>          r8 = 0xc1b35000  r9 = 0x00000000
>         r10 = 0xc162a400 r12 = 0xc1bc9ad4
> bus_dmamem_free() at bus_dmamem_free+0x10
>          pc = 0xc048fa3c  lr = 0xc1b984c4 (sndbuf_destroy+0x14)
>          sp = 0xd28b8bd8  fp = 0xd28b8be0
>          r4 = 0xc162ae00  r5 = 0xc1a24000
>          r6 = 0xd28b8bd0  r7 = 0xc1b9855c
>          r8 = 0x00000000  r9 = 0xc1a24000
> Unknown entry: 0
> sndbuf_destroy() at sndbuf_destroy+0x14
>          pc = 0xc1b984c4  lr = 0xc1b984c4 (sndbuf_destroy+0x14)
>          sp = 0xd28b8bd8  fp = 0xd28b8be0
 > Unable to unwind into user mode

--HPS

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 03:45:40 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 59682EEC;
 Mon, 23 Jun 2014 03:45:40 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4714A2713;
 Mon, 23 Jun 2014 03:45:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5N3jedS063254;
 Mon, 23 Jun 2014 03:45:40 GMT (envelope-from kan@svn.freebsd.org)
Received: (from kan@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N3jeiU063253;
 Mon, 23 Jun 2014 03:45:40 GMT (envelope-from kan@svn.freebsd.org)
Message-Id: <201406230345.s5N3jeiU063253@svn.freebsd.org>
From: Alexander Kabaev 
Date: Mon, 23 Jun 2014 03:45:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267762 - head/sys/dev/sound/pcm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 03:45:40 -0000

Author: kan
Date: Mon Jun 23 03:45:39 2014
New Revision: 267762
URL: http://svnweb.freebsd.org/changeset/base/267762

Log:
  Restore the check for non-NULL dmatag in sndbuf_free.
  
  The sound drivers that use own buffer management can use sndbuf_setup
  and not do any busdma allocation, so the driver will end up with the
  managed buffer but no valid dma map and tag for it. Avoid calling
  bus_dmamem_free in such cases.
  
  Reported by: ache
  Missed in review by: kan

Modified:
  head/sys/dev/sound/pcm/buffer.c

Modified: head/sys/dev/sound/pcm/buffer.c
==============================================================================
--- head/sys/dev/sound/pcm/buffer.c	Mon Jun 23 02:00:14 2014	(r267761)
+++ head/sys/dev/sound/pcm/buffer.c	Mon Jun 23 03:45:39 2014	(r267762)
@@ -141,7 +141,8 @@ sndbuf_free(struct snd_dbuf *b)
 		if (b->flags & SNDBUF_F_MANAGED) {
 			if (b->buf_addr)
 				bus_dmamap_unload(b->dmatag, b->dmamap);
-			bus_dmamem_free(b->dmatag, b->buf, b->dmamap);
+			if (b->dmatag)
+				bus_dmamem_free(b->dmatag, b->buf, b->dmamap);
 		} else
 			free(b->buf, M_DEVBUF);
 	}

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 05:17:40 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7CB53E56;
 Mon, 23 Jun 2014 05:17:40 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6A6932D4C;
 Mon, 23 Jun 2014 05:17:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5N5HdTg004604;
 Mon, 23 Jun 2014 05:17:39 GMT (envelope-from kevlo@svn.freebsd.org)
Received: (from kevlo@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N5HdKX004602;
 Mon, 23 Jun 2014 05:17:39 GMT (envelope-from kevlo@svn.freebsd.org)
Message-Id: <201406230517.s5N5HdKX004602@svn.freebsd.org>
From: Kevin Lo 
Date: Mon, 23 Jun 2014 05:17:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267763 - in head: share/man/man9 sys/netinet6
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 05:17:40 -0000

Author: kevlo
Date: Mon Jun 23 05:17:39 2014
New Revision: 267763
URL: http://svnweb.freebsd.org/changeset/base/267763

Log:
  Catch up with r186809, correct comments.

Modified:
  head/share/man/man9/domain.9
  head/sys/netinet6/ip6protosw.h

Modified: head/share/man/man9/domain.9
==============================================================================
--- head/share/man/man9/domain.9	Mon Jun 23 03:45:39 2014	(r267762)
+++ head/share/man/man9/domain.9	Mon Jun 23 05:17:39 2014	(r267763)
@@ -111,7 +111,7 @@ struct protosw {
 	pr_slowtimo_t *pr_slowtimo;	/* slow timeout (500ms) */
 	pr_drain_t *pr_drain;		/* flush any excess space possible */
 
-	struct	pr_usrreqs *pr_usrreqs;	/* supersedes pr_usrreq() */
+	struct	pr_usrreqs *pr_usrreqs;	/* user-protocol hook */
 };
 .Ed
 .Pp

Modified: head/sys/netinet6/ip6protosw.h
==============================================================================
--- head/sys/netinet6/ip6protosw.h	Mon Jun 23 03:45:39 2014	(r267762)
+++ head/sys/netinet6/ip6protosw.h	Mon Jun 23 05:17:39 2014	(r267763)
@@ -138,7 +138,7 @@ struct ip6protosw {
 			(void);
 	void	(*pr_drain)		/* flush any excess space possible */
 			(void);
-	struct	pr_usrreqs *pr_usrreqs;	/* supersedes pr_usrreq() */
+	struct	pr_usrreqs *pr_usrreqs;	/* user-protocol hook */
 };
 
 #ifdef _KERNEL

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 06:40:54 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D925DD55;
 Mon, 23 Jun 2014 06:40:54 +0000 (UTC)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4A6CE236D;
 Mon, 23 Jun 2014 06:40:54 +0000 (UTC)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s5N6eiHi057333;
 Mon, 23 Jun 2014 09:40:44 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s5N6eiHi057333
Received: (from kostik@localhost)
 by tom.home (8.14.9/8.14.8/Submit) id s5N6eix4057332;
 Mon, 23 Jun 2014 09:40:44 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Mon, 23 Jun 2014 09:40:44 +0300
From: Konstantin Belousov 
To: Mateusz Guzik 
Subject: Re: svn commit: r267760 - head/sys/kern
Message-ID: <20140623064044.GD93733@kib.kiev.ua>
References: <201406230128.s5N1SIYK097224@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="jCrbxBqMcLqd4mOl"
Content-Disposition: inline
In-Reply-To: <201406230128.s5N1SIYK097224@svn.freebsd.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 autolearn_force=no version=3.4.0
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 06:40:54 -0000


--jCrbxBqMcLqd4mOl
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Mon, Jun 23, 2014 at 01:28:18AM +0000, Mateusz Guzik wrote:
> +	KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared"));
>  	FILEDESC_XLOCK(fdp);
This  is at least weird.  Not incorrect, but the code now looks strange.
The fd_refcnt == 1 assert just states the circumstances of the code which
currently calls the functions.  Would the functions become incorrect or
destructive if there are other references to the filedescriptor table ?

In case you argument is that refcnt == 1 must hold to prevent the parallel
modifications of the descriptor table, which would invalidate the checks
and actions of the functions, then XLOCK is not needed (similar to your
earlier commit).

Note that kern_execve() is executed with the process single-threaded,
which, together with statement fd_refcnt == 1 must prevent the parallel
modifications.

--jCrbxBqMcLqd4mOl
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJTp8vsAAoJEJDCuSvBvK1B6FoP/jSelVk3Pa1UD1KQClW2/E5w
96CuK3lI3e3/IynWobqiB/dAiirNFbra4HaXHmvXV0d2Grt00uzUXsN75BEa912d
lbCdMq61B5hkdoknSE1oAxSZ6EEquDO01EZAQ3iuWP9uSai4mNDOskGgN1SXJy7f
ndKfc+ff9vxSo6o+eIg/j2xvSXGt7PJbDGDumMraIUtufsEEsKHOFolIUXf93o6F
mfajZw42krB7Sk9Hq/TkoaGUWP24BBUxXIpmYtJ7DfWa2sM5Yl91nkP7hPoqSokO
wAI+fRh7A4WVOM7A/y0FH/JEZ6EOpBoDDj+GT9Yk2U0I/UaFGvrjRWHjv1HIbpFR
l+tgbntRmjvhdQjYKaybETvtZVsOXsTAmbzgjC16JfxGa0TUcVe5QcWpEOGWN26l
l3o6P2PgkflJQv+V8rvaul8gp8oEEoBNGt7+LOWW/ZWYU3GdgOgsB4O+t6khg9tw
kXDJl2zT5qimrsOBvm6RjUTgiDWR7tWHmXUkrUEoKAYZyHaqigF2Liy8yNBJOJ6A
DYXLiAkD3UX/xTIZIXpRN4v40TObLuC79uqCzaLaa8AHf2BSs05bx/nchgUkZLW3
LU8UxVrhsNFRCtcluXdqUCNyd37FQbEOS7E4R8cDRYlH3ywtmm/j3fVwXnZnvgPG
6uGZgSZ9vC1odsw3qMLH
=Byur
-----END PGP SIGNATURE-----

--jCrbxBqMcLqd4mOl--

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 07:03:48 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 765B8197;
 Mon, 23 Jun 2014 07:03:48 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 640EC24FC;
 Mon, 23 Jun 2014 07:03:48 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5N73mRS053199;
 Mon, 23 Jun 2014 07:03:48 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N73mrU053198;
 Mon, 23 Jun 2014 07:03:48 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201406230703.s5N73mrU053198@svn.freebsd.org>
From: Konstantin Belousov 
Date: Mon, 23 Jun 2014 07:03:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267766 - head/sys/vm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 07:03:48 -0000

Author: kib
Date: Mon Jun 23 07:03:47 2014
New Revision: 267766
URL: http://svnweb.freebsd.org/changeset/base/267766

Log:
  Use correct names for the flags.  MAP_ENTRY_GROWS_* have the same
  numerical values as MAP_STACK_GROWS_*, but the former is for entries'
  eflags, while the later for the cow argument of vm_map_insert().
  
  Submitted by:	alc

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Mon Jun 23 05:42:52 2014	(r267765)
+++ head/sys/vm/vm_map.c	Mon Jun 23 07:03:47 2014	(r267766)
@@ -1215,7 +1215,7 @@ charged:
 	}
 	else if ((prev_entry != &map->header) &&
 		 (prev_entry->eflags == protoeflags) &&
-		 (cow & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP)) == 0 &&
+		 (cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 &&
 		 (prev_entry->end == start) &&
 		 (prev_entry->wired_count == 0) &&
 		 (prev_entry->cred == cred ||

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 07:06:58 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 156B32F6;
 Mon, 23 Jun 2014 07:06:58 +0000 (UTC)
Received: from mail-we0-x231.google.com (mail-we0-x231.google.com
 [IPv6:2a00:1450:400c:c03::231])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 31C0A2516;
 Mon, 23 Jun 2014 07:06:57 +0000 (UTC)
Received: by mail-we0-f177.google.com with SMTP id u56so6148337wes.8
 for ; Mon, 23 Jun 2014 00:06:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=Hoig7q5oNjYfejDDpPUuykzR91f+XsfjD+DjBgMM1pQ=;
 b=Kz9+drmP7Dz905vcuJiEknewqz0Y4nRHPqqb/7WXReddebvtVMrc3H9saUw33STL4Z
 YDl2nNPnkhF4KPfm8v4+KjKDyz0JJSwF4LZQj6rVndM0DajsB+5jnTaCk6cQqhQh8ilE
 PhweR7oumTMnu0S1urEj6jY3HKBo90fSeAjeTiQQxtSzCfETxjNeXB4+stTsjElVZEs5
 x0fqnVFKjzSiT91gZaVKSQk56Yi59QE0/phfBtff4kjyLtUrtL8iO6YGFnj6bVvE/k4f
 /6WT6/OjmgUjcdmHR05Kl/fwv1hAiBw3v2Aki3J5XH6DQtk1LNrpbii237mFfGEeA7jB
 KD/Q==
X-Received: by 10.180.20.206 with SMTP id p14mr23403728wie.26.1403507215443;
 Mon, 23 Jun 2014 00:06:55 -0700 (PDT)
Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net.
 [2001:470:1f08:1f7::2])
 by mx.google.com with ESMTPSA id na4sm30582176wic.21.2014.06.23.00.06.54
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Mon, 23 Jun 2014 00:06:54 -0700 (PDT)
Date: Mon, 23 Jun 2014 09:06:52 +0200
From: Mateusz Guzik 
To: Konstantin Belousov 
Subject: Re: svn commit: r267760 - head/sys/kern
Message-ID: <20140623070652.GA27040@dft-labs.eu>
References: <201406230128.s5N1SIYK097224@svn.freebsd.org>
 <20140623064044.GD93733@kib.kiev.ua>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20140623064044.GD93733@kib.kiev.ua>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Mateusz Guzik 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 07:06:58 -0000

On Mon, Jun 23, 2014 at 09:40:44AM +0300, Konstantin Belousov wrote:
> On Mon, Jun 23, 2014 at 01:28:18AM +0000, Mateusz Guzik wrote:
> > +	KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared"));
> >  	FILEDESC_XLOCK(fdp);
> This  is at least weird.  Not incorrect, but the code now looks strange.
> The fd_refcnt == 1 assert just states the circumstances of the code which
> currently calls the functions.  Would the functions become incorrect or
> destructive if there are other references to the filedescriptor table ?
> 
> In case you argument is that refcnt == 1 must hold to prevent the parallel
> modifications of the descriptor table, which would invalidate the checks
> and actions of the functions, then XLOCK is not needed (similar to your
> earlier commit).
> 
> Note that kern_execve() is executed with the process single-threaded,
> which, together with statement fd_refcnt == 1 must prevent the parallel
> modifications.

The table is modified in these functions and is reachable from the rest
of the kernel (can be found by e.g. sysctl_kern_proc_filedesc), thus
XLOCK is needed to ensure consistency for readers. It can also be
altered by mountcheckdirs, although not in a way which disrupts any of
these functions.

For now I do agree that both the assertion and XLOCK look weird as it is
and as such deserve a comment.

Actually we can take the lock only if we are going to modify something.

How about the following then (untested):

diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 25c3a1e..31f4881 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -2082,13 +2082,18 @@ setugidsafety(struct thread *td)
        int i;
 
        fdp = td->td_proc->p_fd;
+       /*
+        * While no other thread can alter filedescriptors in this table,
+        * there may be code trying to read it, thus the lock is required
+        * to provide consistent view if we are going to change it.
+        */
        KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared"));
-       FILEDESC_XLOCK(fdp);
        for (i = 0; i <= fdp->fd_lastfile; i++) {
                if (i > 2)
                        break;
                fp = fdp->fd_ofiles[i].fde_file;
                if (fp != NULL && is_unsafe(fp)) {
+                       FILEDESC_XLOCK(fdp);
                        knote_fdclose(td, i);
                        /*
                         * NULL-out descriptor prior to close to avoid
@@ -2097,7 +2102,6 @@ setugidsafety(struct thread *td)
                        fdfree(fdp, i);
                        FILEDESC_XUNLOCK(fdp);
                        (void) closef(fp, td);
-                       FILEDESC_XLOCK(fdp);
                }
        }
        FILEDESC_XUNLOCK(fdp);
@@ -2136,16 +2140,16 @@ fdcloseexec(struct thread *td)
 
        fdp = td->td_proc->p_fd;
        KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared"));
-       FILEDESC_XLOCK(fdp);
        for (i = 0; i <= fdp->fd_lastfile; i++) {
                fde = &fdp->fd_ofiles[i];
                fp = fde->fde_file;
                if (fp != NULL && (fp->f_type == DTYPE_MQUEUE ||
                    (fde->fde_flags & UF_EXCLOSE))) {
+                       /* See the comment in setugidsafety */
+                       FILEDESC_XLOCK(fdp);
                        fdfree(fdp, i);
                        (void) closefp(fdp, i, fp, td, 0);
                        /* closefp() drops the FILEDESC lock. */
-                       FILEDESC_XLOCK(fdp);
                }
        }
        FILEDESC_XUNLOCK(fdp);


-- 
Mateusz Guzik 

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 07:25:25 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 80430844;
 Mon, 23 Jun 2014 07:25:25 +0000 (UTC)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1F7CD2697;
 Mon, 23 Jun 2014 07:25:24 +0000 (UTC)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s5N7PJoi067255;
 Mon, 23 Jun 2014 10:25:19 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s5N7PJoi067255
Received: (from kostik@localhost)
 by tom.home (8.14.9/8.14.8/Submit) id s5N7PJ0S067254;
 Mon, 23 Jun 2014 10:25:19 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Mon, 23 Jun 2014 10:25:19 +0300
From: Konstantin Belousov 
To: Mateusz Guzik 
Subject: Re: svn commit: r267760 - head/sys/kern
Message-ID: <20140623072519.GE93733@kib.kiev.ua>
References: <201406230128.s5N1SIYK097224@svn.freebsd.org>
 <20140623064044.GD93733@kib.kiev.ua>
 <20140623070652.GA27040@dft-labs.eu>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="ytoMbUMiTKPMT3hY"
Content-Disposition: inline
In-Reply-To: <20140623070652.GA27040@dft-labs.eu>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 autolearn_force=no version=3.4.0
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Mateusz Guzik 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 07:25:25 -0000


--ytoMbUMiTKPMT3hY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Jun 23, 2014 at 09:06:52AM +0200, Mateusz Guzik wrote:
> On Mon, Jun 23, 2014 at 09:40:44AM +0300, Konstantin Belousov wrote:
> > On Mon, Jun 23, 2014 at 01:28:18AM +0000, Mateusz Guzik wrote:
> > > +	KASSERT(fdp->fd_refcnt =3D=3D 1, ("the fdtable should not be shared=
"));
> > >  	FILEDESC_XLOCK(fdp);
> > This  is at least weird.  Not incorrect, but the code now looks strange.
> > The fd_refcnt =3D=3D 1 assert just states the circumstances of the code=
 which
> > currently calls the functions.  Would the functions become incorrect or
> > destructive if there are other references to the filedescriptor table ?
> >=20
> > In case you argument is that refcnt =3D=3D 1 must hold to prevent the p=
arallel
> > modifications of the descriptor table, which would invalidate the checks
> > and actions of the functions, then XLOCK is not needed (similar to your
> > earlier commit).
> >=20
> > Note that kern_execve() is executed with the process single-threaded,
> > which, together with statement fd_refcnt =3D=3D 1 must prevent the para=
llel
> > modifications.
>=20
> The table is modified in these functions and is reachable from the rest
> of the kernel (can be found by e.g. sysctl_kern_proc_filedesc), thus
> XLOCK is needed to ensure consistency for readers. It can also be
> altered by mountcheckdirs, although not in a way which disrupts any of
> these functions.
I would think that such cases should be avoided by testing for P_INEXEC,
but I do not insist on this.

>=20
> For now I do agree that both the assertion and XLOCK look weird as it is
> and as such deserve a comment.
>=20
> Actually we can take the lock only if we are going to modify something.
>=20
> How about the following then (untested):
See below, but I would be completely satisfied even by only
comment addition.

>=20
> diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
> index 25c3a1e..31f4881 100644
> --- a/sys/kern/kern_descrip.c
> +++ b/sys/kern/kern_descrip.c
> @@ -2082,13 +2082,18 @@ setugidsafety(struct thread *td)
>         int i;
> =20
>         fdp =3D td->td_proc->p_fd;
> +       /*
> +        * While no other thread can alter filedescriptors in this table,
> +        * there may be code trying to read it, thus the lock is required
> +        * to provide consistent view if we are going to change it.
> +        */
>         KASSERT(fdp->fd_refcnt =3D=3D 1, ("the fdtable should not be shar=
ed"));
> -       FILEDESC_XLOCK(fdp);
>         for (i =3D 0; i <=3D fdp->fd_lastfile; i++) {
>                 if (i > 2)
>                         break;
>                 fp =3D fdp->fd_ofiles[i].fde_file;
>                 if (fp !=3D NULL && is_unsafe(fp)) {
> +                       FILEDESC_XLOCK(fdp);
>                         knote_fdclose(td, i);
>                         /*
>                          * NULL-out descriptor prior to close to avoid
> @@ -2097,7 +2102,6 @@ setugidsafety(struct thread *td)
>                         fdfree(fdp, i);
>                         FILEDESC_XUNLOCK(fdp);
>                         (void) closef(fp, td);
> -                       FILEDESC_XLOCK(fdp);
>                 }
>         }
>         FILEDESC_XUNLOCK(fdp);
This unlock should be removed ?

> @@ -2136,16 +2140,16 @@ fdcloseexec(struct thread *td)
> =20
>         fdp =3D td->td_proc->p_fd;
>         KASSERT(fdp->fd_refcnt =3D=3D 1, ("the fdtable should not be shar=
ed"));
> -       FILEDESC_XLOCK(fdp);
>         for (i =3D 0; i <=3D fdp->fd_lastfile; i++) {
>                 fde =3D &fdp->fd_ofiles[i];
>                 fp =3D fde->fde_file;
>                 if (fp !=3D NULL && (fp->f_type =3D=3D DTYPE_MQUEUE ||
>                     (fde->fde_flags & UF_EXCLOSE))) {
> +                       /* See the comment in setugidsafety */
> +                       FILEDESC_XLOCK(fdp);
>                         fdfree(fdp, i);
>                         (void) closefp(fdp, i, fp, td, 0);
>                         /* closefp() drops the FILEDESC lock. */
> -                       FILEDESC_XLOCK(fdp);
This should be XUNLOCK ?
>                 }
>         }
>         FILEDESC_XUNLOCK(fdp);
And this unlock removed ?
>=20
>=20
> --=20
> Mateusz Guzik 

--ytoMbUMiTKPMT3hY
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJTp9ZeAAoJEJDCuSvBvK1BAcAP/jB9jwxozqXmgeQjWzGyFKjK
TnVv3ueKPh/vsWVnQZa/kaRmVyyTU5e9BlhmRKCgbvklU06KLkO729khGIESp15A
jeNjR+LBxq6Zq5HjV/1Kdy6VMP/apqnYWc53vwxPdy2sjBgdOrYjBtnuQqfblcfK
QtAjIJ7b8aF4iJ/2Ijs2Xq0dDNzS2naoNBGGOlA8fayrw0BPs4h9oTVZUvnq+c8z
/FgMNk7D+0M7ghOhsAlAiNyp1ElG6piVKfVNKaqVwDs8ZGQtYyXaw7XGIkNcRMVx
3uNCCtYSG7+DPQUP8yo4sRusDHZnzUti8EOvhHTS76FUcprjUEe1OsIoyVkM4axD
wKipFm3viuCEe+RFmo97tG8uHiVlMeNN7G1i3AwKRL0wyEGm0A3mrOO8lRbZNeOu
oKtmgZHdgGM8gTAG69bPTpD7wQUgDr5gpSkTYO/9E82LnXmWfHCl68hioAyAC0RD
yzmnpuQ/S4gRQjSBImp3TqQsEmHnZqBWqq+g6q+fC6fCKbe5k+KRptOWERpAWRxG
V8Q/zbxEa/gUcVXphPR4GL6rq5L5KWvNi9B3p7aSoTS4OYPWhy6b3BkM51p8Qqbm
i1OK++xdmJ4/e9fTXkB62BLQV7jwAPn4pk+ziW3qBbRTFZGLfE4KloiQk8U7nGEV
QN9uXb728IYlj9yePGvT
=5RZm
-----END PGP SIGNATURE-----

--ytoMbUMiTKPMT3hY--

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 07:37:56 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 14BA4C19;
 Mon, 23 Jun 2014 07:37:56 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 00883276F;
 Mon, 23 Jun 2014 07:37:56 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5N7btXa067420;
 Mon, 23 Jun 2014 07:37:55 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N7bsNU067408;
 Mon, 23 Jun 2014 07:37:54 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201406230737.s5N7bsNU067408@svn.freebsd.org>
From: Konstantin Belousov 
Date: Mon, 23 Jun 2014 07:37:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267767 - in head/sys: amd64/amd64 amd64/include
 crypto/aesni crypto/via i386/include i386/isa
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 07:37:56 -0000

Author: kib
Date: Mon Jun 23 07:37:54 2014
New Revision: 267767
URL: http://svnweb.freebsd.org/changeset/base/267767

Log:
  Add FPU_KERN_KTHR flag to fpu_kern_enter(9), which avoids saving FPU
  context into memory for the kernel threads which called
  fpu_kern_thread(9).  This allows the fpu_kern_enter() callers to not
  check for is_fpu_kern_thread() to get the optimization.
  
  Apply the flag to padlock(4) and aesni(4).  In aesni_cipher_process(),
  do not leak FPU context state on error.
  
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/amd64/amd64/fpu.c
  head/sys/amd64/include/fpu.h
  head/sys/crypto/aesni/aesni_wrap.c
  head/sys/crypto/via/padlock.c
  head/sys/crypto/via/padlock_cipher.c
  head/sys/crypto/via/padlock_hash.c
  head/sys/i386/include/npx.h
  head/sys/i386/isa/npx.c

Modified: head/sys/amd64/amd64/fpu.c
==============================================================================
--- head/sys/amd64/amd64/fpu.c	Mon Jun 23 07:03:47 2014	(r267766)
+++ head/sys/amd64/amd64/fpu.c	Mon Jun 23 07:37:54 2014	(r267767)
@@ -890,6 +890,7 @@ static MALLOC_DEFINE(M_FPUKERN_CTX, "fpu
     "Kernel contexts for FPU state");
 
 #define	FPU_KERN_CTX_FPUINITDONE 0x01
+#define	FPU_KERN_CTX_DUMMY	 0x02	/* avoided save for the kern thread */
 
 struct fpu_kern_ctx {
 	struct savefpu *prev;
@@ -933,6 +934,10 @@ fpu_kern_enter(struct thread *td, struct
 {
 	struct pcb *pcb;
 
+	if ((flags & FPU_KERN_KTHR) != 0 && is_fpu_kern_thread(0)) {
+		ctx->flags = FPU_KERN_CTX_DUMMY;
+		return (0);
+	}
 	pcb = td->td_pcb;
 	KASSERT(!PCB_USER_FPU(pcb) || pcb->pcb_save ==
 	    get_pcb_user_save_pcb(pcb), ("mangled pcb_save"));
@@ -952,6 +957,9 @@ fpu_kern_leave(struct thread *td, struct
 {
 	struct pcb *pcb;
 
+	if (is_fpu_kern_thread(0) && (ctx->flags & FPU_KERN_CTX_DUMMY) != 0)
+		return (0);
+	KASSERT((ctx->flags & FPU_KERN_CTX_DUMMY) == 0, ("dummy ctx"));
 	pcb = td->td_pcb;
 	critical_enter();
 	if (curthread == PCPU_GET(fpcurthread))

Modified: head/sys/amd64/include/fpu.h
==============================================================================
--- head/sys/amd64/include/fpu.h	Mon Jun 23 07:03:47 2014	(r267766)
+++ head/sys/amd64/include/fpu.h	Mon Jun 23 07:37:54 2014	(r267767)
@@ -84,6 +84,7 @@ void	fpu_save_area_reset(struct savefpu 
  */
 #define	FPU_KERN_NORMAL	0x0000
 #define	FPU_KERN_NOWAIT	0x0001
+#define	FPU_KERN_KTHR	0x0002
 
 #endif
 

Modified: head/sys/crypto/aesni/aesni_wrap.c
==============================================================================
--- head/sys/crypto/aesni/aesni_wrap.c	Mon Jun 23 07:03:47 2014	(r267766)
+++ head/sys/crypto/aesni/aesni_wrap.c	Mon Jun 23 07:37:54 2014	(r267767)
@@ -382,22 +382,16 @@ int
 aesni_cipher_setup(struct aesni_session *ses, struct cryptoini *encini)
 {
 	struct thread *td;
-	int error, saved_ctx;
+	int error;
 
 	td = curthread;
-	if (!is_fpu_kern_thread(0)) {
-		error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL);
-		saved_ctx = 1;
-	} else {
-		error = 0;
-		saved_ctx = 0;
-	}
-	if (error == 0) {
-		error = aesni_cipher_setup_common(ses, encini->cri_key,
-		    encini->cri_klen);
-		if (saved_ctx)
-			fpu_kern_leave(td, ses->fpu_ctx);
-	}
+	error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL |
+	    FPU_KERN_KTHR);
+	if (error != 0)
+		return (error);
+	error = aesni_cipher_setup_common(ses, encini->cri_key,
+	    encini->cri_klen);
+	fpu_kern_leave(td, ses->fpu_ctx);
 	return (error);
 }
 
@@ -407,22 +401,17 @@ aesni_cipher_process(struct aesni_sessio
 {
 	struct thread *td;
 	uint8_t *buf;
-	int error, allocated, saved_ctx;
+	int error, allocated;
 
 	buf = aesni_cipher_alloc(enccrd, crp, &allocated);
 	if (buf == NULL)
 		return (ENOMEM);
 
 	td = curthread;
-	if (!is_fpu_kern_thread(0)) {
-		error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL);
-		if (error != 0)
-			goto out;
-		saved_ctx = 1;
-	} else {
-		saved_ctx = 0;
-		error = 0;
-	}
+	error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL |
+	    FPU_KERN_KTHR);
+	if (error != 0)
+		goto out1;
 
 	if ((enccrd->crd_flags & CRD_F_KEY_EXPLICIT) != 0) {
 		error = aesni_cipher_setup_common(ses, enccrd->crd_key,
@@ -460,8 +449,6 @@ aesni_cipher_process(struct aesni_sessio
 			    ses->iv);
 		}
 	}
-	if (saved_ctx)
-		fpu_kern_leave(td, ses->fpu_ctx);
 	if (allocated)
 		crypto_copyback(crp->crp_flags, crp->crp_buf, enccrd->crd_skip,
 		    enccrd->crd_len, buf);
@@ -469,7 +456,9 @@ aesni_cipher_process(struct aesni_sessio
 		crypto_copydata(crp->crp_flags, crp->crp_buf,
 		    enccrd->crd_skip + enccrd->crd_len - AES_BLOCK_LEN,
 		    AES_BLOCK_LEN, ses->iv);
- out:
+out:
+	fpu_kern_leave(td, ses->fpu_ctx);
+out1:
 	if (allocated) {
 		bzero(buf, enccrd->crd_len);
 		free(buf, M_AESNI);

Modified: head/sys/crypto/via/padlock.c
==============================================================================
--- head/sys/crypto/via/padlock.c	Mon Jun 23 07:03:47 2014	(r267766)
+++ head/sys/crypto/via/padlock.c	Mon Jun 23 07:37:54 2014	(r267767)
@@ -171,7 +171,7 @@ padlock_newsession(device_t dev, uint32_
 	struct padlock_session *ses = NULL;
 	struct cryptoini *encini, *macini;
 	struct thread *td;
-	int error, saved_ctx;
+	int error;
 
 	if (sidp == NULL || cri == NULL)
 		return (EINVAL);
@@ -246,18 +246,11 @@ padlock_newsession(device_t dev, uint32_
 
 	if (macini != NULL) {
 		td = curthread;
-		if (!is_fpu_kern_thread(0)) {
-			error = fpu_kern_enter(td, ses->ses_fpu_ctx,
-			    FPU_KERN_NORMAL);
-			saved_ctx = 1;
-		} else {
-			error = 0;
-			saved_ctx = 0;
-		}
+		error = fpu_kern_enter(td, ses->ses_fpu_ctx, FPU_KERN_NORMAL |
+		    FPU_KERN_KTHR);
 		if (error == 0) {
 			error = padlock_hash_setup(ses, macini);
-			if (saved_ctx)
-				fpu_kern_leave(td, ses->ses_fpu_ctx);
+			fpu_kern_leave(td, ses->ses_fpu_ctx);
 		}
 		if (error != 0) {
 			padlock_freesession_one(sc, ses, 0);

Modified: head/sys/crypto/via/padlock_cipher.c
==============================================================================
--- head/sys/crypto/via/padlock_cipher.c	Mon Jun 23 07:03:47 2014	(r267766)
+++ head/sys/crypto/via/padlock_cipher.c	Mon Jun 23 07:37:54 2014	(r267767)
@@ -205,7 +205,7 @@ padlock_cipher_process(struct padlock_se
 	struct thread *td;
 	u_char *buf, *abuf;
 	uint32_t *key;
-	int allocated, error, saved_ctx;
+	int allocated, error;
 
 	buf = padlock_cipher_alloc(enccrd, crp, &allocated);
 	if (buf == NULL)
@@ -250,21 +250,13 @@ padlock_cipher_process(struct padlock_se
 	}
 
 	td = curthread;
-	if (!is_fpu_kern_thread(0)) {
-		error = fpu_kern_enter(td, ses->ses_fpu_ctx, FPU_KERN_NORMAL);
-		saved_ctx = 1;
-	} else {
-		error = 0;
-		saved_ctx = 0;
-	}
+	error = fpu_kern_enter(td, ses->ses_fpu_ctx, FPU_KERN_NORMAL |
+	    FPU_KERN_KTHR);
 	if (error != 0)
 		goto out;
-
 	padlock_cbc(abuf, abuf, enccrd->crd_len / AES_BLOCK_LEN, key, cw,
 	    ses->ses_iv);
-
-	if (saved_ctx)
-		fpu_kern_leave(td, ses->ses_fpu_ctx);
+	fpu_kern_leave(td, ses->ses_fpu_ctx);
 
 	if (allocated) {
 		crypto_copyback(crp->crp_flags, crp->crp_buf, enccrd->crd_skip,

Modified: head/sys/crypto/via/padlock_hash.c
==============================================================================
--- head/sys/crypto/via/padlock_hash.c	Mon Jun 23 07:03:47 2014	(r267766)
+++ head/sys/crypto/via/padlock_hash.c	Mon Jun 23 07:37:54 2014	(r267767)
@@ -366,24 +366,18 @@ padlock_hash_process(struct padlock_sess
     struct cryptop *crp)
 {
 	struct thread *td;
-	int error, saved_ctx;
+	int error;
 
 	td = curthread;
-	if (!is_fpu_kern_thread(0)) {
-		error = fpu_kern_enter(td, ses->ses_fpu_ctx, FPU_KERN_NORMAL);
-		saved_ctx = 1;
-	} else {
-		error = 0;
-		saved_ctx = 0;
-	}
+	error = fpu_kern_enter(td, ses->ses_fpu_ctx, FPU_KERN_NORMAL |
+	    FPU_KERN_KTHR);
 	if (error != 0)
 		return (error);
 	if ((maccrd->crd_flags & CRD_F_KEY_EXPLICIT) != 0)
 		padlock_hash_key_setup(ses, maccrd->crd_key, maccrd->crd_klen);
 
 	error = padlock_authcompute(ses, maccrd, crp->crp_buf, crp->crp_flags);
-	if (saved_ctx)
-		fpu_kern_leave(td, ses->ses_fpu_ctx);
+	fpu_kern_leave(td, ses->ses_fpu_ctx);
 	return (error);
 }
 

Modified: head/sys/i386/include/npx.h
==============================================================================
--- head/sys/i386/include/npx.h	Mon Jun 23 07:03:47 2014	(r267766)
+++ head/sys/i386/include/npx.h	Mon Jun 23 07:37:54 2014	(r267767)
@@ -71,6 +71,7 @@ int	is_fpu_kern_thread(u_int flags);
  */
 #define	FPU_KERN_NORMAL	0x0000
 #define	FPU_KERN_NOWAIT	0x0001
+#define	FPU_KERN_KTHR	0x0002
 
 #endif
 

Modified: head/sys/i386/isa/npx.c
==============================================================================
--- head/sys/i386/isa/npx.c	Mon Jun 23 07:03:47 2014	(r267766)
+++ head/sys/i386/isa/npx.c	Mon Jun 23 07:37:54 2014	(r267767)
@@ -1008,6 +1008,7 @@ static MALLOC_DEFINE(M_FPUKERN_CTX, "fpu
 #define	XSAVE_AREA_ALIGN	64
 
 #define	FPU_KERN_CTX_NPXINITDONE 0x01
+#define	FPU_KERN_CTX_DUMMY	 0x02
 
 struct fpu_kern_ctx {
 	union savefpu *prev;
@@ -1051,6 +1052,10 @@ fpu_kern_enter(struct thread *td, struct
 {
 	struct pcb *pcb;
 
+	if ((flags & FPU_KERN_KTHR) != 0 && is_fpu_kern_thread(0)) {
+		ctx->flags = FPU_KERN_CTX_DUMMY;
+		return (0);
+	}
 	pcb = td->td_pcb;
 	KASSERT(!PCB_USER_FPU(pcb) || pcb->pcb_save == &pcb->pcb_user_save,
 	    ("mangled pcb_save"));
@@ -1070,6 +1075,8 @@ fpu_kern_leave(struct thread *td, struct
 {
 	struct pcb *pcb;
 
+	if (is_fpu_kern_thread(0) && (ctx->flags & FPU_KERN_CTX_DUMMY) != 0)
+		return (0);
 	pcb = td->td_pcb;
 	critical_enter();
 	if (curthread == PCPU_GET(fpcurthread))

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 07:45:45 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0B993F6B;
 Mon, 23 Jun 2014 07:45:45 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EC3572819;
 Mon, 23 Jun 2014 07:45:44 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5N7ji6x071586;
 Mon, 23 Jun 2014 07:45:44 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N7jix4071585;
 Mon, 23 Jun 2014 07:45:44 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201406230745.s5N7jix4071585@svn.freebsd.org>
From: Konstantin Belousov 
Date: Mon, 23 Jun 2014 07:45:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267768 - head/share/man/man9
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 07:45:45 -0000

Author: kib
Date: Mon Jun 23 07:45:44 2014
New Revision: 267768
URL: http://svnweb.freebsd.org/changeset/base/267768

Log:
  Add documentation for the fpu_kern(9) interfaces.
  
  Many thanks to jmg for reviewing the (previous version) of the text
  and providing grammar and content fixes.
  
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Added:
  head/share/man/man9/fpu_kern.9   (contents, props changed)

Added: head/share/man/man9/fpu_kern.9
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/man/man9/fpu_kern.9	Mon Jun 23 07:45:44 2014	(r267768)
@@ -0,0 +1,193 @@
+.\" Copyright (c) 2014
+.\"	Konstantin Belousov .  All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd June 21, 2014
+.Dt KERN_FPU 9
+.Os
+.Sh NAME
+.Nm fpu_kern
+.Nd "facility to use the FPU in the kernel"
+.Sh SYNOPSIS
+.Ft struct fpu_kern_ctx *
+.Fn fpu_kern_alloc_ctx "u_int flags"
+.Ft void
+.Fn fpu_kern_free_ctx "struct fpu_kern_ctx *ctx"
+.Ft int
+.Fn fpu_kern_enter "struct thread *td" "struct fpu_kern_ctx *ctx" "u_int flags"
+.Ft int
+.Fn fpu_kern_leave "struct thread *td" "struct fpu_kern_ctx *ctx"
+.Ft int
+.Fn fpu_kern_thread "u_int flags"
+.Ft int
+.Fn is_fpu_kern_thread "u_int flags"
+.Sh DESCRIPTION
+The
+.Nm
+family of functions allows the use of FPU hardware in kernel code.
+Modern FPUs are not limited to providing hardware implementation for
+floating point arithmetic, they offer advanced accelerators for cryptography
+and other computational-intensive algorithms.
+These facilities share registers with the FPU hardware.
+.Pp
+Typical kernel code does not need to access to the FPU.
+Saving a large register file on each entry to the kernel would waste
+time.
+When kernel code uses the FPU, the current FPU state must be saved to
+avoid corrupting the user-mode state, and vice versa.
+.Pp
+The management of the save and restore is automatic.
+The processor catches accesses to the FPU registers
+when the non-current context tries to access them.
+Explicit calls are required for the allocation of the save area and
+the notification of the start and end of the code using the FPU.
+.Pp
+The
+.Fn fpu_kern_alloc_ctx
+function allocates the memory used by
+.Nm
+to track the use of the FPU hardware state and the related software state.
+The
+.Fn fpu_kern_alloc_ctx
+function requires the
+.Fa flags
+argument, which currently accepts the following flags:
+.Bl -tag -width ".Dv FPU_KERN_NOWAIT" -offset indent
+.It Dv FPU_KERN_NOWAIT
+Do not wait for the available memory if the request could not be satisfied
+without sleep.
+.It 0
+No special handling is required.
+.El
+The function returns the allocated context area, or
+.Va NULL
+if the allocation failed.
+.Pp
+The
+.Fn fpu_kern_free_ctx
+function frees the context previously allocated by
+.Fn fpu_kern_alloc_ctx .
+.Pp
+The
+.Fn fpu_kern_enter
+function designates the start of the region of kernel code where the
+use of the FPU is allowed.
+Its arguments are:
+.Bl -tag -width ".Fa ctx" -offset indent
+.It Fa td
+Currently must be
+.Va curthread .
+.It Fa ctx
+The context save area previously allocated by
+.Fn fpu_kern_alloc_ctx
+and not currently in use by another call to
+.Fn fpu_kern_enter .
+.It Fa flags
+This argument currently accepts the following flags:
+.Bl -tag -width ".Dv FPU_KERN_NORMAL" -offset indent
+.It Dv FPU_KERN_NORMAL
+Indicates that the caller intends to access the full FPU state.
+Must be specified currently.
+.It Dv FPU_KERN_KTHR
+Indicates that no saving of the current FPU state should be performed,
+if the thread called
+.Xr fpu_kern_thread 9
+function.
+This is intended to minimize code duplication in callers which
+could be used from both kernel thread and syscall contexts.
+The
+.Fn fpu_kern_leave
+function correctly handles such contexts.
+.El
+.El
+The function does not sleep or block.
+It could cause the
+.Nm Device Not Available
+exception during execution, and on the first FPU access after the
+function returns, as well as after each context switch
+(see Intel Software Developer Manual for the reference).
+Currently, no errors are defined which can be returned by
+.Fn fpu_kern_enter
+to the caller.
+.Pp
+The
+.Fn fpu_kern_leave
+function ends the region started by
+.Fn fpu_kern_enter .
+The uses of FPU in the kernel after the call to
+.Fn fpu_kern_leave
+are erronous until the next call to
+.Fn fpu_kern_enter
+is performed.
+The function takes the
+.Fa td
+thread argument, which currently must be
+.Va curthread ,
+and the
+.Fa ctx
+context pointer, previously passed to
+.Fn fpu_kern_enter .
+After the function returns, the context may be freed or reused
+by other invocation of
+.Fn fpu_kern_enter .
+There are no errors defined for the function, it always returns 0.
+.Pp
+The
+.Fn fpu_kern_thread
+function provides an optimization for threads which never leave to
+the usermode.
+Such thread can reuse the usermode save area for the FPU state,
+which is allowed by the function call.
+There is no flags defined for the function, and no error states
+that the function returns.
+.Pp
+The
+.Fn is_fpu_kern_thread
+function returns the boolean indicating whether the current thread
+entered the mode enabled by
+.Fn fpu_kern_thread .
+There is currently no flags defined for the function, the return
+value is true if the current thread have the permanent FPU save area,
+and false otherwise.
+.Sh NOTES
+The
+.Nm
+is currently implemented only for i386 and amd64 architectures.
+.Pp
+There is no way to handle floating point exceptions raised from
+kernel mode.
+.Pp
+The unused
+.Fa flags
+arguments
+to the
+.Nm
+functions are to be extended to allow specification of the
+set of the FPU hardware state used by the code region.
+This would allow optimizations of saving and restoring the state.
+.Sh AUTHORS
+The
+.Nm
+facitily and this manual page were written by
+.An Konstantin Belousov Aq Mt kib@FreeBSD.org .

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 08:05:08 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8C67CB51;
 Mon, 23 Jun 2014 08:05:08 +0000 (UTC)
Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com
 [IPv6:2a00:1450:400c:c05::232])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id AB88D2A2F;
 Mon, 23 Jun 2014 08:05:07 +0000 (UTC)
Received: by mail-wi0-f178.google.com with SMTP id n15so3577934wiw.5
 for ; Mon, 23 Jun 2014 01:05:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=RA6HS5e355yjKFsr5lc/Pdu+sHCKzwt6jid2hJ8KTVM=;
 b=pZDo7+XKkNaurF9j7Gm72NgdLTn5M+uy28wPAsHXlKGElfJRpATiA/KdnFYz9uLpuR
 GcsRH4YWer/2hzPpgJnYpvsQkzVpUfYytKl0Pnyi+Jio6hiULdsrrHQJ/mJF5eswijSD
 //FlvdkFALkdwMTrs/tVnfkHqn+3NywnVvmaDOw4l9fcwleSNGyKDjhkmF2AmJXoQvuL
 uHOY1Oni7jSL6qclxx2+W58kzBYiY655iXUZJ5eHiB9TXWg7HUMLfL2KwRxcuxncitd0
 JQqvs05oH8a8XneG3wWzwTe7qiFgLbbJBOsjoNTZYQLD1McM5pbcdIwYJ88eM0B5QW6L
 1rhw==
X-Received: by 10.194.94.226 with SMTP id df2mr1519966wjb.113.1403510703985;
 Mon, 23 Jun 2014 01:05:03 -0700 (PDT)
Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net.
 [2001:470:1f08:1f7::2])
 by mx.google.com with ESMTPSA id i6sm31031433wiy.17.2014.06.23.01.05.02
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Mon, 23 Jun 2014 01:05:03 -0700 (PDT)
Date: Mon, 23 Jun 2014 10:05:01 +0200
From: Mateusz Guzik 
To: Konstantin Belousov 
Subject: Re: svn commit: r267760 - head/sys/kern
Message-ID: <20140623080501.GB27040@dft-labs.eu>
References: <201406230128.s5N1SIYK097224@svn.freebsd.org>
 <20140623064044.GD93733@kib.kiev.ua>
 <20140623070652.GA27040@dft-labs.eu>
 <20140623072519.GE93733@kib.kiev.ua>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20140623072519.GE93733@kib.kiev.ua>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Mateusz Guzik 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 08:05:08 -0000

On Mon, Jun 23, 2014 at 10:25:19AM +0300, Konstantin Belousov wrote:
> On Mon, Jun 23, 2014 at 09:06:52AM +0200, Mateusz Guzik wrote:
> > The table is modified in these functions and is reachable from the rest
> > of the kernel (can be found by e.g. sysctl_kern_proc_filedesc), thus
> > XLOCK is needed to ensure consistency for readers. It can also be
> > altered by mountcheckdirs, although not in a way which disrupts any of
> > these functions.
> I would think that such cases should be avoided by testing for P_INEXEC,
> but I do not insist on this.
> 

proc lock has to be dropped before filedesc lock is taken and I don't
see any way to prevent the proc from transitioning to P_INEXEC afterwards.
Since sysctl_kern_proc_filedesc et al can take a long time it does not
seem feasible to pursue this.

This also makes me realize I screwed up r265247 "Request a non-exiting
process in sysctl_kern_proc_{o,}filedesc". As it is the code has to hold
the process and release it later to really close the race and not only
affect the window. I'll poke around this later, maybe it is better to
nullify some stuff in exit1 with PROC_LOCK held and access it in a
similar manner.

> > @@ -2097,7 +2102,6 @@ setugidsafety(struct thread *td)
> >                         fdfree(fdp, i);
> >                         FILEDESC_XUNLOCK(fdp);
> >                         (void) closef(fp, td);
> > -                       FILEDESC_XLOCK(fdp);
> >                 }
> >         }
> >         FILEDESC_XUNLOCK(fdp);
> This unlock should be removed ?
> 

Ugh, yes.

> > +                       /* See the comment in setugidsafety */
> > +                       FILEDESC_XLOCK(fdp);
> >                         fdfree(fdp, i);
> >                         (void) closefp(fdp, i, fp, td, 0);
> >                         /* closefp() drops the FILEDESC lock. */
> > -                       FILEDESC_XLOCK(fdp);
> This should be XUNLOCK ?

This one is fine as closefp drops the lock.

> >                 }
> >         }
> >         FILEDESC_XUNLOCK(fdp);
> And this unlock removed ?

Yes.

I tested this patch and it works fine:

diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 25c3a1e..a900464 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -2082,13 +2082,18 @@ setugidsafety(struct thread *td)
 	int i;
 
 	fdp = td->td_proc->p_fd;
+	/*
+	 * While no other thread can alter filedescriptors in this table,
+	 * there may be code trying to read it, thus the lock is required
+	 * to provide consistent view if we are going to change it.
+	 */
 	KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared"));
-	FILEDESC_XLOCK(fdp);
 	for (i = 0; i <= fdp->fd_lastfile; i++) {
 		if (i > 2)
 			break;
 		fp = fdp->fd_ofiles[i].fde_file;
 		if (fp != NULL && is_unsafe(fp)) {
+			FILEDESC_XLOCK(fdp);
 			knote_fdclose(td, i);
 			/*
 			 * NULL-out descriptor prior to close to avoid
@@ -2097,10 +2102,8 @@ setugidsafety(struct thread *td)
 			fdfree(fdp, i);
 			FILEDESC_XUNLOCK(fdp);
 			(void) closef(fp, td);
-			FILEDESC_XLOCK(fdp);
 		}
 	}
-	FILEDESC_XUNLOCK(fdp);
 }
 
 /*
@@ -2136,19 +2139,18 @@ fdcloseexec(struct thread *td)
 
 	fdp = td->td_proc->p_fd;
 	KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared"));
-	FILEDESC_XLOCK(fdp);
 	for (i = 0; i <= fdp->fd_lastfile; i++) {
 		fde = &fdp->fd_ofiles[i];
 		fp = fde->fde_file;
 		if (fp != NULL && (fp->f_type == DTYPE_MQUEUE ||
 		    (fde->fde_flags & UF_EXCLOSE))) {
+			/* See the comment in setugidsafety */
+			FILEDESC_XLOCK(fdp);
 			fdfree(fdp, i);
 			(void) closefp(fdp, i, fp, td, 0);
 			/* closefp() drops the FILEDESC lock. */
-			FILEDESC_XLOCK(fdp);
 		}
 	}
-	FILEDESC_XUNLOCK(fdp);
 }
 
 /*
-- 
Mateusz Guzik 

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 08:18:33 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4F7A4E9B;
 Mon, 23 Jun 2014 08:18:33 +0000 (UTC)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E29C62B1B;
 Mon, 23 Jun 2014 08:18:32 +0000 (UTC)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s5N8INpP079714;
 Mon, 23 Jun 2014 11:18:23 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s5N8INpP079714
Received: (from kostik@localhost)
 by tom.home (8.14.9/8.14.8/Submit) id s5N8IN6w079713;
 Mon, 23 Jun 2014 11:18:23 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Mon, 23 Jun 2014 11:18:23 +0300
From: Konstantin Belousov 
To: Mateusz Guzik 
Subject: Re: svn commit: r267760 - head/sys/kern
Message-ID: <20140623081823.GG93733@kib.kiev.ua>
References: <201406230128.s5N1SIYK097224@svn.freebsd.org>
 <20140623064044.GD93733@kib.kiev.ua>
 <20140623070652.GA27040@dft-labs.eu>
 <20140623072519.GE93733@kib.kiev.ua>
 <20140623080501.GB27040@dft-labs.eu>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="2NLGdgz3UMHa/lqP"
Content-Disposition: inline
In-Reply-To: <20140623080501.GB27040@dft-labs.eu>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 autolearn_force=no version=3.4.0
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Mateusz Guzik 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 08:18:33 -0000


--2NLGdgz3UMHa/lqP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Jun 23, 2014 at 10:05:01AM +0200, Mateusz Guzik wrote:
> On Mon, Jun 23, 2014 at 10:25:19AM +0300, Konstantin Belousov wrote:
> > On Mon, Jun 23, 2014 at 09:06:52AM +0200, Mateusz Guzik wrote:
> > > The table is modified in these functions and is reachable from the re=
st
> > > of the kernel (can be found by e.g. sysctl_kern_proc_filedesc), thus
> > > XLOCK is needed to ensure consistency for readers. It can also be
> > > altered by mountcheckdirs, although not in a way which disrupts any of
> > > these functions.
> > I would think that such cases should be avoided by testing for P_INEXEC,
> > but I do not insist on this.
> >=20
>=20
> proc lock has to be dropped before filedesc lock is taken and I don't
> see any way to prevent the proc from transitioning to P_INEXEC afterwards.
> Since sysctl_kern_proc_filedesc et al can take a long time it does not
> seem feasible to pursue this.
>=20
> This also makes me realize I screwed up r265247 "Request a non-exiting
> process in sysctl_kern_proc_{o,}filedesc". As it is the code has to hold
> the process and release it later to really close the race and not only
> affect the window. I'll poke around this later, maybe it is better to
> nullify some stuff in exit1 with PROC_LOCK held and access it in a
> similar manner.
>=20
> > > @@ -2097,7 +2102,6 @@ setugidsafety(struct thread *td)
> > >                         fdfree(fdp, i);
> > >                         FILEDESC_XUNLOCK(fdp);
> > >                         (void) closef(fp, td);
> > > -                       FILEDESC_XLOCK(fdp);
> > >                 }
> > >         }
> > >         FILEDESC_XUNLOCK(fdp);
> > This unlock should be removed ?
> >=20
>=20
> Ugh, yes.
>=20
> > > +                       /* See the comment in setugidsafety */
> > > +                       FILEDESC_XLOCK(fdp);
> > >                         fdfree(fdp, i);
> > >                         (void) closefp(fdp, i, fp, td, 0);
> > >                         /* closefp() drops the FILEDESC lock. */
> > > -                       FILEDESC_XLOCK(fdp);
> > This should be XUNLOCK ?
>=20
> This one is fine as closefp drops the lock.
>=20
> > >                 }
> > >         }
> > >         FILEDESC_XUNLOCK(fdp);
> > And this unlock removed ?
>=20
> Yes.
>=20
> I tested this patch and it works fine:
>=20
> diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
> index 25c3a1e..a900464 100644
> --- a/sys/kern/kern_descrip.c
> +++ b/sys/kern/kern_descrip.c
> @@ -2082,13 +2082,18 @@ setugidsafety(struct thread *td)
>  	int i;
> =20
>  	fdp =3D td->td_proc->p_fd;
> +	/*
> +	 * While no other thread can alter filedescriptors in this table,
> +	 * there may be code trying to read it, thus the lock is required
> +	 * to provide consistent view if we are going to change it.
> +	 */
>  	KASSERT(fdp->fd_refcnt =3D=3D 1, ("the fdtable should not be shared"));
> -	FILEDESC_XLOCK(fdp);
>  	for (i =3D 0; i <=3D fdp->fd_lastfile; i++) {
>  		if (i > 2)
>  			break;
>  		fp =3D fdp->fd_ofiles[i].fde_file;
>  		if (fp !=3D NULL && is_unsafe(fp)) {
> +			FILEDESC_XLOCK(fdp);
>  			knote_fdclose(td, i);
>  			/*
>  			 * NULL-out descriptor prior to close to avoid
> @@ -2097,10 +2102,8 @@ setugidsafety(struct thread *td)
>  			fdfree(fdp, i);
>  			FILEDESC_XUNLOCK(fdp);
>  			(void) closef(fp, td);
> -			FILEDESC_XLOCK(fdp);
>  		}
>  	}
> -	FILEDESC_XUNLOCK(fdp);
>  }
> =20
>  /*
> @@ -2136,19 +2139,18 @@ fdcloseexec(struct thread *td)
> =20
>  	fdp =3D td->td_proc->p_fd;
>  	KASSERT(fdp->fd_refcnt =3D=3D 1, ("the fdtable should not be shared"));
> -	FILEDESC_XLOCK(fdp);
>  	for (i =3D 0; i <=3D fdp->fd_lastfile; i++) {
>  		fde =3D &fdp->fd_ofiles[i];
>  		fp =3D fde->fde_file;
>  		if (fp !=3D NULL && (fp->f_type =3D=3D DTYPE_MQUEUE ||
>  		    (fde->fde_flags & UF_EXCLOSE))) {
> +			/* See the comment in setugidsafety */
> +			FILEDESC_XLOCK(fdp);
>  			fdfree(fdp, i);
>  			(void) closefp(fdp, i, fp, td, 0);
>  			/* closefp() drops the FILEDESC lock. */
> -			FILEDESC_XLOCK(fdp);
>  		}
>  	}
> -	FILEDESC_XUNLOCK(fdp);
>  }
> =20
>  /*

This looks fine, but please e.g. add a reference to the comment in
etugidsafety(), to fdcloseexec().  Or duplicate it.

--2NLGdgz3UMHa/lqP
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJTp+LOAAoJEJDCuSvBvK1BLEkQAJ3ujP7+owotKSoZ2ncGvCRD
qKBmQGOSRMPWurCd6aXmk9nUx3RqbUTpWRdKmT2ctA2MeXU87x7rQWnCdXkLhaJQ
TF+QssLu/b+fHGyjF9xbQnpNuq+DQoNDPyx9+LxfANLd4REDi/qS6pVaJEsXjUiO
WRJcZoR4CeJ41Zzw2TnYmiYwkP3AJ4YIYYEVwVk+DJ2HzvG9pRg/0QZdrC2aC+8g
OzBntJV9fxhaK1qOLbt6TZiyIU7GIYLGoL3TPnsKLCyZ5iFEpR+SQOuqe0PIP/yQ
eUlvjEbIsJVHzXh/kYx9gMkvO5GzeOGxUuug7hXOXGX9DldETukSjXqFFPbd8q1G
sGH+g/heGPfwcjTCqj6Vtcp7iw0M5Teeq5JT/1gBJAGNjWAXRP601MeqnydjiI8j
MZw9npwLreQvpTWguhu0rb5Xz/wlHEquX6KQOhQHzfDSMmdtljUSaFm4Z+n7/bIG
DkBMOqWLHO7qVb4B0Y678OYOsqQobbctGpBAZJc493mT/0zZ9Navx4ID+MXFYZbB
1/ziXemoX3l8fByJf9o5UGIZW0P6G4m/IapPqNKkHjn/DKGYT/r0Y61/eNJ5ylWe
V49iaPkn6YRWIg6YQXElqyaz675ZyoKuHYSmmNCE5VJSxtOVTyietJXXZMY78ra+
B04wTy/24occDr3EITMT
=LqI4
-----END PGP SIGNATURE-----

--2NLGdgz3UMHa/lqP--

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 08:23:25 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 23F4616D;
 Mon, 23 Jun 2014 08:23:25 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0D8772BB3;
 Mon, 23 Jun 2014 08:23:25 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5N8NOW2090479;
 Mon, 23 Jun 2014 08:23:24 GMT (envelope-from bapt@svn.freebsd.org)
Received: (from bapt@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N8N5OG090251;
 Mon, 23 Jun 2014 08:23:05 GMT (envelope-from bapt@svn.freebsd.org)
Message-Id: <201406230823.s5N8N5OG090251@svn.freebsd.org>
From: Baptiste Daroussin 
Date: Mon, 23 Jun 2014 08:23:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267773 - in head: lib/libbluetooth lib/libcalendar
 lib/libcam lib/libcapsicum lib/libcrypt lib/libdevinfo lib/libdevstat
 lib/libefi lib/libexpat lib/libgeom lib/libgssapi lib/libmd lib...
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 08:23:25 -0000

Author: bapt
Date: Mon Jun 23 08:23:05 2014
New Revision: 267773
URL: http://svnweb.freebsd.org/changeset/base/267773

Log:
  use .Mt to mark up email addresses consistently (part3)
  
  PR:		191174
  Submitted by:	Franco Fichtner  

Modified:
  head/lib/libbluetooth/bluetooth.3
  head/lib/libcalendar/calendar.3
  head/lib/libcam/cam.3
  head/lib/libcapsicum/libcapsicum.3
  head/lib/libcrypt/crypt.3
  head/lib/libdevinfo/devinfo.3
  head/lib/libdevstat/devstat.3
  head/lib/libefi/libefi.3
  head/lib/libexpat/libbsdxml.3
  head/lib/libgeom/libgeom.3
  head/lib/libgssapi/mech.5
  head/lib/libmd/mdX.3
  head/lib/libmemstat/libmemstat.3
  head/lib/libnetgraph/netgraph.3
  head/lib/libnv/nv.3
  head/lib/libpam/modules/pam_passwdqc/pam_passwdqc.8
  head/lib/libpam/modules/pam_radius/pam_radius.8
  head/lib/libpam/modules/pam_ssh/pam_ssh.8
  head/lib/libpam/modules/pam_tacplus/pam_tacplus.8
  head/lib/libpmc/pmc.3
  head/lib/libpmc/pmc.atom.3
  head/lib/libpmc/pmc.atomsilvermont.3
  head/lib/libpmc/pmc.core.3
  head/lib/libpmc/pmc.core2.3
  head/lib/libpmc/pmc.corei7.3
  head/lib/libpmc/pmc.corei7uc.3
  head/lib/libpmc/pmc.haswell.3
  head/lib/libpmc/pmc.haswelluc.3
  head/lib/libpmc/pmc.iaf.3
  head/lib/libpmc/pmc.ivybridge.3
  head/lib/libpmc/pmc.ivybridgexeon.3
  head/lib/libpmc/pmc.k7.3
  head/lib/libpmc/pmc.k8.3
  head/lib/libpmc/pmc.mips24k.3
  head/lib/libpmc/pmc.octeon.3
  head/lib/libpmc/pmc.p4.3
  head/lib/libpmc/pmc.p5.3
  head/lib/libpmc/pmc.p6.3
  head/lib/libpmc/pmc.sandybridge.3
  head/lib/libpmc/pmc.sandybridgeuc.3
  head/lib/libpmc/pmc.sandybridgexeon.3
  head/lib/libpmc/pmc.soft.3
  head/lib/libpmc/pmc.tsc.3
  head/lib/libpmc/pmc.ucf.3
  head/lib/libpmc/pmc.westmere.3
  head/lib/libpmc/pmc.westmereuc.3
  head/lib/libpmc/pmc.xscale.3
  head/lib/libprocstat/libprocstat.3
  head/lib/librpcsec_gss/rpc_gss_get_error.3
  head/lib/librpcsec_gss/rpc_gss_get_mech_info.3
  head/lib/librpcsec_gss/rpc_gss_get_mechanisms.3
  head/lib/librpcsec_gss/rpc_gss_get_principal_name.3
  head/lib/librpcsec_gss/rpc_gss_get_versions.3
  head/lib/librpcsec_gss/rpc_gss_getcred.3
  head/lib/librpcsec_gss/rpc_gss_is_installed.3
  head/lib/librpcsec_gss/rpc_gss_max_data_length.3
  head/lib/librpcsec_gss/rpc_gss_mech_to_oid.3
  head/lib/librpcsec_gss/rpc_gss_oid_to_mech.3
  head/lib/librpcsec_gss/rpc_gss_qop_to_num.3
  head/lib/librpcsec_gss/rpc_gss_seccreate.3
  head/lib/librpcsec_gss/rpc_gss_set_callback.3
  head/lib/librpcsec_gss/rpc_gss_set_defaults.3
  head/lib/librpcsec_gss/rpc_gss_set_svc_name.3
  head/lib/librpcsec_gss/rpc_gss_svc_max_data_length.3
  head/lib/librpcsec_gss/rpcsec_gss.3
  head/lib/librtld_db/librtld_db.3
  head/lib/libsdp/sdp.3
  head/lib/libstand/libstand.3
  head/lib/libstdthreads/thrd_create.3
  head/lib/libthr/libthr.3
  head/lib/libufs/bread.3
  head/lib/libufs/cgread.3
  head/lib/libufs/libufs.3
  head/lib/libufs/sbread.3
  head/lib/libufs/ufs_disk_close.3
  head/lib/libutil/flopen.3
  head/lib/libutil/kld.3
  head/lib/libutil/pidfile.3
  head/lib/libutil/pw_util.3
  head/lib/libutil/quotafile.3
  head/lib/libvgl/vgl.3
  head/usr.bin/ar/ar.1
  head/usr.bin/at/at.man
  head/usr.bin/bluetooth/bthost/bthost.1
  head/usr.bin/bluetooth/btsockstat/btsockstat.1
  head/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.1
  head/usr.bin/brandelf/brandelf.1
  head/usr.bin/bsdiff/bsdiff/bsdiff.1
  head/usr.bin/bsdiff/bspatch/bspatch.1
  head/usr.bin/cpuset/cpuset.1
  head/usr.bin/csup/cpasswd.1
  head/usr.bin/csup/csup.1
  head/usr.bin/ctlstat/ctlstat.8
  head/usr.bin/elf2aout/elf2aout.1
  head/usr.bin/elfdump/elfdump.1
  head/usr.bin/fetch/fetch.1
  head/usr.bin/fstat/fuser.1
  head/usr.bin/getconf/getconf.1
  head/usr.bin/gzip/gzip.1
  head/usr.bin/ipcs/ipcs.1
  head/usr.bin/iscsictl/iscsictl.8
  head/usr.bin/ktrdump/ktrdump.8
  head/usr.bin/ldd/ldd.1
  head/usr.bin/lockf/lockf.1
  head/usr.bin/logins/logins.1
  head/usr.bin/m4/m4.1
  head/usr.bin/mkcsmapper/mkcsmapper.1
  head/usr.bin/mkesdb/mkesdb.1
  head/usr.bin/mkulzma/mkulzma.8
  head/usr.bin/mkuzip/mkuzip.8
  head/usr.bin/ncal/ncal.1
  head/usr.bin/rctl/rctl.8
  head/usr.bin/revoke/revoke.1
  head/usr.bin/sed/sed.1
  head/usr.bin/sockstat/sockstat.1
  head/usr.bin/ssh-copy-id/ssh-copy-id.1
  head/usr.bin/stat/stat.1
  head/usr.bin/truncate/truncate.1
  head/usr.bin/unifdef/unifdef.1
  head/usr.bin/units/units.1
  head/usr.bin/unzip/unzip.1
  head/usr.bin/which/which.1
  head/usr.bin/ypcat/ypcat.1
  head/usr.bin/ypmatch/ypmatch.1

Modified: head/lib/libbluetooth/bluetooth.3
==============================================================================
--- head/lib/libbluetooth/bluetooth.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libbluetooth/bluetooth.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -720,7 +720,7 @@ The function guarantees that the socket,
 passed to the callback function,
 will be bound and connected to the Bluetooth device being enumerated.
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
 .Sh BUGS
 Some of those functions use static data storage;
 if the data is needed for future use, it should be

Modified: head/lib/libcalendar/calendar.3
==============================================================================
--- head/lib/libcalendar/calendar.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libcalendar/calendar.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -198,6 +198,6 @@ library first appeared in
 .Fx 3.0 .
 .Sh AUTHORS
 This manual page and the library was written by
-.An Wolfgang Helbig Aq helbig@FreeBSD.org .
+.An Wolfgang Helbig Aq Mt helbig@FreeBSD.org .
 .Sh BUGS
 The library was coded with great care so there are no bugs left.

Modified: head/lib/libcam/cam.3
==============================================================================
--- head/lib/libcam/cam.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libcam/cam.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -406,7 +406,7 @@ characters long.
 The CAM library first appeared in
 .Fx 3.0 .
 .Sh AUTHORS
-.An Kenneth Merry Aq ken@FreeBSD.org
+.An Kenneth Merry Aq Mt ken@FreeBSD.org
 .Sh BUGS
 .Fn cam_open_device
 does not check to see if the

Modified: head/lib/libcapsicum/libcapsicum.3
==============================================================================
--- head/lib/libcapsicum/libcapsicum.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libcapsicum/libcapsicum.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -284,5 +284,5 @@ printf("Name associated with %s is %s.\\
 The
 .Nm libcapsicum
 library was implemented by
-.An Pawel Jakub Dawidek Aq pawel@dawidek.net
+.An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net
 under sponsorship from the FreeBSD Foundation.

Modified: head/lib/libcrypt/crypt.3
==============================================================================
--- head/lib/libcrypt/crypt.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libcrypt/crypt.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -283,7 +283,7 @@ libcrypt encryption library.
 .Sh AUTHORS
 .An -nosplit
 Originally written by
-.An David Burren Aq davidb@werj.com.au ,
+.An David Burren Aq Mt davidb@werj.com.au ,
 later additions and changes by
 .An Poul-Henning Kamp ,
 .An Mark R V Murray ,

Modified: head/lib/libdevinfo/devinfo.3
==============================================================================
--- head/lib/libdevinfo/devinfo.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libdevinfo/devinfo.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -238,7 +238,7 @@ The
 library first appeared in
 .Fx 5.0 .
 .Sh AUTHORS
-.An Michael Smith Aq msmith@FreeBSD.org
+.An Michael Smith Aq Mt msmith@FreeBSD.org
 .Sh BUGS
 This is the first implementation of the library,
 and the interface is still subject to refinement.

Modified: head/lib/libdevstat/devstat.3
==============================================================================
--- head/lib/libdevstat/devstat.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libdevstat/devstat.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -797,7 +797,7 @@ The new interface (the functions prefixe
 first appeared in
 .Fx 5.0 .
 .Sh AUTHORS
-.An Kenneth Merry Aq ken@FreeBSD.org
+.An Kenneth Merry Aq Mt ken@FreeBSD.org
 .Sh BUGS
 There should probably be an interface to de-allocate memory allocated by
 .Fn devstat_getdevs ,

Modified: head/lib/libefi/libefi.3
==============================================================================
--- head/lib/libefi/libefi.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libefi/libefi.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -140,4 +140,4 @@ for the ia64 architecture.
 The
 .Nm libefi
 library and this manual page were written by
-.An Marcel Moolenaar Aq marcel@FreeBSD.org .
+.An Marcel Moolenaar Aq Mt marcel@FreeBSD.org .

Modified: head/lib/libexpat/libbsdxml.3
==============================================================================
--- head/lib/libexpat/libbsdxml.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libexpat/libbsdxml.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -59,11 +59,11 @@ For full documentation, please see the e
 .Sh AUTHORS
 .An -nosplit
 The original eXpat was written by
-.An James Clark Aq jjc@jclark.com .
+.An James Clark Aq Mt jjc@jclark.com .
 .Pp
 Subsequently eXpat maintenance and development been taken up by a group
 of people under the leadership of
-.An Fred Drake Aq fdrake@acm.com ,
+.An Fred Drake Aq Mt fdrake@acm.com ,
 .An Paul Prescod ,
 and
 .An Clark Cooper .

Modified: head/lib/libgeom/libgeom.3
==============================================================================
--- head/lib/libgeom/libgeom.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libgeom/libgeom.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -388,6 +388,6 @@ The
 library appeared in
 .Fx 5.1 .
 .Sh AUTHORS
-.An Poul-Henning Kamp Aq phk@FreeBSD.org
-.An Lukas Ertl Aq le@FreeBSD.org
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org
+.An Lukas Ertl Aq Mt le@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org

Modified: head/lib/libgssapi/mech.5
==============================================================================
--- head/lib/libgssapi/mech.5	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libgssapi/mech.5	Mon Jun 23 08:23:05 2014	(r267773)
@@ -98,4 +98,4 @@ manual page first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/lib/libmd/mdX.3
==============================================================================
--- head/lib/libmd/mdX.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libmd/mdX.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -178,7 +178,7 @@ The original MDX routines were developed
 .Tn RSA
 Data Security, Inc., and published in the above references.
 This code is derived directly from these implementations by
-.An Poul-Henning Kamp Aq phk@FreeBSD.org
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org .
 .Pp
 Phk ristede runen.
 .Sh BUGS

Modified: head/lib/libmemstat/libmemstat.3
==============================================================================
--- head/lib/libmemstat/libmemstat.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libmemstat/libmemstat.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -484,7 +484,7 @@ library appeared in
 .Sh AUTHORS
 The kernel memory allocator changes necessary to support a general purpose
 monitoring library, along with the library, were written by
-.An Robert Watson Aq rwatson@FreeBSD.org .
+.An Robert Watson Aq Mt rwatson@FreeBSD.org .
 .Sh BUGS
 There are memory allocators in the kernel, such as the VM page allocator
 and

Modified: head/lib/libnetgraph/netgraph.3
==============================================================================
--- head/lib/libnetgraph/netgraph.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libnetgraph/netgraph.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -395,4 +395,4 @@ a version of
 .Fx 2.2
 customized for the Whistle InterJet.
 .Sh AUTHORS
-.An "Archie Cobbs" Aq archie@FreeBSD.org
+.An Archie Cobbs Aq Mt archie@FreeBSD.org

Modified: head/lib/libnv/nv.3
==============================================================================
--- head/lib/libnv/nv.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libnv/nv.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -600,5 +600,5 @@ library appeared in
 The
 .Nm libnv
 library was implemented by
-.An Pawel Jakub Dawidek Aq pawel@dawidek.net
+.An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net
 under sponsorship from the FreeBSD Foundation.

Modified: head/lib/libpam/modules/pam_passwdqc/pam_passwdqc.8
==============================================================================
--- head/lib/libpam/modules/pam_passwdqc/pam_passwdqc.8	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpam/modules/pam_passwdqc/pam_passwdqc.8	Mon Jun 23 08:23:05 2014	(r267773)
@@ -257,7 +257,7 @@ is that the former is incompatible with
 The
 .Nm
 module was written by
-.An Solar Designer Aq solar@openwall.com .
+.An Solar Designer Aq Mt solar@openwall.com .
 This manual page, derived from the author's documentation, was written
 for the
 .Fx

Modified: head/lib/libpam/modules/pam_radius/pam_radius.8
==============================================================================
--- head/lib/libpam/modules/pam_radius/pam_radius.8	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpam/modules/pam_radius/pam_radius.8	Mon Jun 23 08:23:05 2014	(r267773)
@@ -126,9 +126,9 @@ manual page first appeared in
 The
 .Nm
 manual page was written by
-.An Andrzej Bialecki Aq abial@FreeBSD.org .
+.An Andrzej Bialecki Aq Mt abial@FreeBSD.org .
 .Pp
 The
 .Nm
 module was written by
-.An John D. Polstra Aq jdp@FreeBSD.org .
+.An John D. Polstra Aq Mt jdp@FreeBSD.org .

Modified: head/lib/libpam/modules/pam_ssh/pam_ssh.8
==============================================================================
--- head/lib/libpam/modules/pam_ssh/pam_ssh.8	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpam/modules/pam_ssh/pam_ssh.8	Mon Jun 23 08:23:05 2014	(r267773)
@@ -147,7 +147,7 @@ The
 .Nm
 module was originally written by
 .An -nosplit
-.An "Andrew J. Korty" Aq ajk@iu.edu .
+.An Andrew J. Korty Aq Mt ajk@iu.edu .
 The current implementation was developed for the
 .Fx
 Project by
@@ -156,4 +156,4 @@ Associates, Inc.\& under DARPA/SPAWAR co
 .Pq Dq CBOSS ,
 as part of the DARPA CHATS research program.
 This manual page was written by
-.An "Mark R V Murray" Aq markm@FreeBSD.org .
+.An Mark R V Murray Aq Mt markm@FreeBSD.org .

Modified: head/lib/libpam/modules/pam_tacplus/pam_tacplus.8
==============================================================================
--- head/lib/libpam/modules/pam_tacplus/pam_tacplus.8	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpam/modules/pam_tacplus/pam_tacplus.8	Mon Jun 23 08:23:05 2014	(r267773)
@@ -116,11 +116,11 @@ module first appeared in
 The
 .Nm
 manual page was written by
-.An Andrzej Bialecki Aq abial@FreeBSD.org
+.An Andrzej Bialecki Aq Mt abial@FreeBSD.org
 and adapted to TACACS+ from RADIUS by
-.An Mark R V Murray Aq markm@FreeBSD.org .
+.An Mark R V Murray Aq Mt markm@FreeBSD.org .
 .Pp
 The
 .Nm
 module was written by
-.An John D. Polstra Aq jdp@FreeBSD.org .
+.An John D. Polstra Aq Mt jdp@FreeBSD.org .

Modified: head/lib/libpmc/pmc.3
==============================================================================
--- head/lib/libpmc/pmc.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -546,5 +546,4 @@ library first appeared in
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .

Modified: head/lib/libpmc/pmc.atom.3
==============================================================================
--- head/lib/libpmc/pmc.atom.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.atom.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -1191,5 +1191,4 @@ library first appeared in
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .

Modified: head/lib/libpmc/pmc.atomsilvermont.3
==============================================================================
--- head/lib/libpmc/pmc.atomsilvermont.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.atomsilvermont.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -524,12 +524,11 @@ The
 library first appeared in
 .Fx 6.0 .
 .Sh AUTHORS
+.An -nosplit
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .
 The support for the Atom Silvermont
 microarchitecture was written by
-.An "Hiren Panchasara"
-.Aq hiren@FreeBSD.org .
+.An Hiren Panchasara Aq Mt hiren@FreeBSD.org .

Modified: head/lib/libpmc/pmc.core.3
==============================================================================
--- head/lib/libpmc/pmc.core.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.core.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -805,5 +805,4 @@ library first appeared in
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .

Modified: head/lib/libpmc/pmc.core2.3
==============================================================================
--- head/lib/libpmc/pmc.core2.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.core2.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -1121,5 +1121,4 @@ library first appeared in
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .

Modified: head/lib/libpmc/pmc.corei7.3
==============================================================================
--- head/lib/libpmc/pmc.corei7.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.corei7.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -1573,5 +1573,4 @@ library first appeared in
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .

Modified: head/lib/libpmc/pmc.corei7uc.3
==============================================================================
--- head/lib/libpmc/pmc.corei7uc.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.corei7uc.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -877,5 +877,4 @@ library first appeared in
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .

Modified: head/lib/libpmc/pmc.haswell.3
==============================================================================
--- head/lib/libpmc/pmc.haswell.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.haswell.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -964,12 +964,11 @@ The
 library first appeared in
 .Fx 6.0 .
 .Sh AUTHORS
+.An -nosplit
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .
 The support for the Haswell
 microarchitecture was written by
-.An "Hiren Panchasara"
-.Aq hiren.panchasara@gmail.com .
+.An Hiren Panchasara Aq Mt hiren.panchasara@gmail.com .

Modified: head/lib/libpmc/pmc.haswelluc.3
==============================================================================
--- head/lib/libpmc/pmc.haswelluc.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.haswelluc.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -226,12 +226,11 @@ The
 library first appeared in
 .Fx 6.0 .
 .Sh AUTHORS
+.An -nosplit
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .
 The support for the Haswell
 microarchitecture was added by
-.An "Hiren Panchasara"
-.Aq hiren.panchasara@gmail.com .
+.An Hiren Panchasara Aq Mt hiren.panchasara@gmail.com .

Modified: head/lib/libpmc/pmc.iaf.3
==============================================================================
--- head/lib/libpmc/pmc.iaf.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.iaf.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -146,5 +146,4 @@ library first appeared in
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .

Modified: head/lib/libpmc/pmc.ivybridge.3
==============================================================================
--- head/lib/libpmc/pmc.ivybridge.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.ivybridge.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -870,12 +870,11 @@ The
 library first appeared in
 .Fx 6.0 .
 .Sh AUTHORS
+.An -nosplit
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .
 The support for the Ivy Bridge
 microarchitecture was written by
-.An "Fabien Thomas"
-.Aq fabient@FreeBSD.org .
+.An Fabien Thomas Aq Mt fabient@FreeBSD.org .

Modified: head/lib/libpmc/pmc.ivybridgexeon.3
==============================================================================
--- head/lib/libpmc/pmc.ivybridgexeon.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.ivybridgexeon.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -900,12 +900,11 @@ The
 library first appeared in
 .Fx 6.0 .
 .Sh AUTHORS
+.An -nosplit
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .
 The support for the Ivy Bridge Xeon
 microarchitecture was written by
-.An "Hiren Panchasara"
-.Aq hiren.panchasara@gmail.com .
+.An Hiren Panchasara Aq Mt hiren.panchasara@gmail.com .

Modified: head/lib/libpmc/pmc.k7.3
==============================================================================
--- head/lib/libpmc/pmc.k7.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.k7.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -262,5 +262,4 @@ library first appeared in
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .

Modified: head/lib/libpmc/pmc.k8.3
==============================================================================
--- head/lib/libpmc/pmc.k8.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.k8.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -796,5 +796,4 @@ library first appeared in
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .

Modified: head/lib/libpmc/pmc.mips24k.3
==============================================================================
--- head/lib/libpmc/pmc.mips24k.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.mips24k.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -403,11 +403,10 @@ The
 library first appeared in
 .Fx 6.0 .
 .Sh AUTHORS
+.An -nosplit
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .
 MIPS support was added by
-.An "George Neville-Neil"
-.Aq gnn@FreeBSD.org .
+.An George Neville-Neil Aq Mt gnn@FreeBSD.org .

Modified: head/lib/libpmc/pmc.octeon.3
==============================================================================
--- head/lib/libpmc/pmc.octeon.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.octeon.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -243,11 +243,10 @@ The
 library first appeared in
 .Fx 6.0 .
 .Sh AUTHORS
+.An -nosplit
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .
 MIPS support was added by
-.An "George Neville-Neil"
-.Aq gnn@FreeBSD.org .
+.An George Neville-Neil Aq Mt gnn@FreeBSD.org .

Modified: head/lib/libpmc/pmc.p4.3
==============================================================================
--- head/lib/libpmc/pmc.p4.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.p4.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -1221,5 +1221,4 @@ library first appeared in
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .

Modified: head/lib/libpmc/pmc.p5.3
==============================================================================
--- head/lib/libpmc/pmc.p5.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.p5.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -457,5 +457,4 @@ library first appeared in
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .

Modified: head/lib/libpmc/pmc.p6.3
==============================================================================
--- head/lib/libpmc/pmc.p6.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.p6.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -1023,5 +1023,4 @@ library first appeared in
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .

Modified: head/lib/libpmc/pmc.sandybridge.3
==============================================================================
--- head/lib/libpmc/pmc.sandybridge.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.sandybridge.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -949,12 +949,11 @@ The
 library first appeared in
 .Fx 6.0 .
 .Sh AUTHORS
+.An -nosplit
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org.
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .
 The support for the Sandy Bridge
 microarchitecture was written by
-.An "Davide Italiano"
-.Aq davide@FreeBSD.org .
+.An Davide Italiano Aq Mt davide@FreeBSD.org .

Modified: head/lib/libpmc/pmc.sandybridgeuc.3
==============================================================================
--- head/lib/libpmc/pmc.sandybridgeuc.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.sandybridgeuc.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -223,12 +223,11 @@ The
 library first appeared in
 .Fx 6.0 .
 .Sh AUTHORS
+.An -nosplit
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .
 The support for the Sandy Bridge
 microarchitecture was added by
-.An "Davide Italiano"
-.Aq davide@FreeBSD.org .
+.An Davide Italiano Aq Mt davide@FreeBSD.org .

Modified: head/lib/libpmc/pmc.sandybridgexeon.3
==============================================================================
--- head/lib/libpmc/pmc.sandybridgexeon.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.sandybridgexeon.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -1013,12 +1013,11 @@ The
 library first appeared in
 .Fx 6.0 .
 .Sh AUTHORS
+.An -nosplit
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .
 The support for the Sandy Bridge Xeon
 microarchitecture was written by
-.An "Hiren Panchasara"
-.Aq hiren.panchasara@gmail.com .
+.An Hiren Panchasara Aq Mt hiren.panchasara@gmail.com .

Modified: head/lib/libpmc/pmc.soft.3
==============================================================================
--- head/lib/libpmc/pmc.soft.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.soft.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -96,11 +96,10 @@ The
 library first appeared in
 .Fx 6.0 .
 .Sh AUTHORS
+.An -nosplit
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .
 Software PMC was written by
-.An "Fabien Thomas"
-.Aq fabient@FreeBSD.org .
+.An Fabien Thomas Aq Mt fabient@FreeBSD.org .

Modified: head/lib/libpmc/pmc.tsc.3
==============================================================================
--- head/lib/libpmc/pmc.tsc.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.tsc.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -80,5 +80,4 @@ library first appeared in
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .

Modified: head/lib/libpmc/pmc.ucf.3
==============================================================================
--- head/lib/libpmc/pmc.ucf.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.ucf.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -110,5 +110,4 @@ library first appeared in
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .

Modified: head/lib/libpmc/pmc.westmere.3
==============================================================================
--- head/lib/libpmc/pmc.westmere.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.westmere.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -1395,5 +1395,4 @@ library first appeared in
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .

Modified: head/lib/libpmc/pmc.westmereuc.3
==============================================================================
--- head/lib/libpmc/pmc.westmereuc.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.westmereuc.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -1080,5 +1080,4 @@ library first appeared in
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .

Modified: head/lib/libpmc/pmc.xscale.3
==============================================================================
--- head/lib/libpmc/pmc.xscale.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libpmc/pmc.xscale.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -144,14 +144,13 @@ library first appeared in
 Intel XScale support first appeared in
 .Fx 9.0 .
 .Sh AUTHORS
+.An -nosplit
 The
 .Lb libpmc
 library was written by
-.An "Joseph Koshy"
-.Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .
 .Pp
 Intel XScale support was added by
-.An "Rui Paulo"
-.Aq rpaulo@FreeBSD.org .
+.An Rui Paulo Aq Mt rpaulo@FreeBSD.org .
 .Sh CAVEATS
 The Intel XScale code does not yet support sampling.

Modified: head/lib/libprocstat/libprocstat.3
==============================================================================
--- head/lib/libprocstat/libprocstat.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libprocstat/libprocstat.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -543,7 +543,7 @@ library appeared in
 The
 .Nm libprocstat
 library was written by
-.An Stanislav Sedov Aq stas@FreeBSD.org .
+.An Stanislav Sedov Aq Mt stas@FreeBSD.org .
 .Pp
 This manual page was written by
-.An Sergey Kandaurov Aq pluknet@FreeBSD.org .
+.An Sergey Kandaurov Aq Mt pluknet@FreeBSD.org .

Modified: head/lib/librpcsec_gss/rpc_gss_get_error.3
==============================================================================
--- head/lib/librpcsec_gss/rpc_gss_get_error.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/librpcsec_gss/rpc_gss_get_error.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -55,4 +55,4 @@ function first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/lib/librpcsec_gss/rpc_gss_get_mech_info.3
==============================================================================
--- head/lib/librpcsec_gss/rpc_gss_get_mech_info.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/librpcsec_gss/rpc_gss_get_mech_info.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -65,4 +65,4 @@ function first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/lib/librpcsec_gss/rpc_gss_get_mechanisms.3
==============================================================================
--- head/lib/librpcsec_gss/rpc_gss_get_mechanisms.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/librpcsec_gss/rpc_gss_get_mechanisms.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -52,4 +52,4 @@ function first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/lib/librpcsec_gss/rpc_gss_get_principal_name.3
==============================================================================
--- head/lib/librpcsec_gss/rpc_gss_get_principal_name.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/librpcsec_gss/rpc_gss_get_principal_name.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -79,4 +79,4 @@ function first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/lib/librpcsec_gss/rpc_gss_get_versions.3
==============================================================================
--- head/lib/librpcsec_gss/rpc_gss_get_versions.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/librpcsec_gss/rpc_gss_get_versions.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -61,4 +61,4 @@ function first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/lib/librpcsec_gss/rpc_gss_getcred.3
==============================================================================
--- head/lib/librpcsec_gss/rpc_gss_getcred.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/librpcsec_gss/rpc_gss_getcred.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -82,4 +82,4 @@ function first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/lib/librpcsec_gss/rpc_gss_is_installed.3
==============================================================================
--- head/lib/librpcsec_gss/rpc_gss_is_installed.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/librpcsec_gss/rpc_gss_is_installed.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -62,4 +62,4 @@ function first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/lib/librpcsec_gss/rpc_gss_max_data_length.3
==============================================================================
--- head/lib/librpcsec_gss/rpc_gss_max_data_length.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/librpcsec_gss/rpc_gss_max_data_length.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -61,4 +61,4 @@ function first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/lib/librpcsec_gss/rpc_gss_mech_to_oid.3
==============================================================================
--- head/lib/librpcsec_gss/rpc_gss_mech_to_oid.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/librpcsec_gss/rpc_gss_mech_to_oid.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -65,4 +65,4 @@ function first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/lib/librpcsec_gss/rpc_gss_oid_to_mech.3
==============================================================================
--- head/lib/librpcsec_gss/rpc_gss_oid_to_mech.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/librpcsec_gss/rpc_gss_oid_to_mech.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -65,4 +65,4 @@ function first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/lib/librpcsec_gss/rpc_gss_qop_to_num.3
==============================================================================
--- head/lib/librpcsec_gss/rpc_gss_qop_to_num.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/librpcsec_gss/rpc_gss_qop_to_num.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -67,4 +67,4 @@ function first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/lib/librpcsec_gss/rpc_gss_seccreate.3
==============================================================================
--- head/lib/librpcsec_gss/rpc_gss_seccreate.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/librpcsec_gss/rpc_gss_seccreate.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -109,4 +109,4 @@ function first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/lib/librpcsec_gss/rpc_gss_set_callback.3
==============================================================================
--- head/lib/librpcsec_gss/rpc_gss_set_callback.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/librpcsec_gss/rpc_gss_set_callback.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -105,7 +105,7 @@ function first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .
 .Sh BUGS
 There is no mechanism for informing a server when a security context
 has been deleted.

Modified: head/lib/librpcsec_gss/rpc_gss_set_defaults.3
==============================================================================
--- head/lib/librpcsec_gss/rpc_gss_set_defaults.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/librpcsec_gss/rpc_gss_set_defaults.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -67,4 +67,4 @@ function first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/lib/librpcsec_gss/rpc_gss_set_svc_name.3
==============================================================================
--- head/lib/librpcsec_gss/rpc_gss_set_svc_name.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/librpcsec_gss/rpc_gss_set_svc_name.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -84,4 +84,4 @@ function first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/lib/librpcsec_gss/rpc_gss_svc_max_data_length.3
==============================================================================
--- head/lib/librpcsec_gss/rpc_gss_svc_max_data_length.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/librpcsec_gss/rpc_gss_svc_max_data_length.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -61,4 +61,4 @@ function first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/lib/librpcsec_gss/rpcsec_gss.3
==============================================================================
--- head/lib/librpcsec_gss/rpcsec_gss.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/librpcsec_gss/rpcsec_gss.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -228,4 +228,4 @@ library first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/lib/librtld_db/librtld_db.3
==============================================================================
--- head/lib/librtld_db/librtld_db.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/librtld_db/librtld_db.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -179,7 +179,7 @@ and was modeled after the same library p
 The
 .Nm librtld_db
 library and this manual page were written by
-.An Rui Paulo Aq rpaulo@FreeBSD.org
+.An Rui Paulo Aq Mt rpaulo@FreeBSD.org
 under sponsorship from the FreeBSD Foundation.
 .Sh CAVEATS
 The functions

Modified: head/lib/libsdp/sdp.3
==============================================================================
--- head/lib/libsdp/sdp.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libsdp/sdp.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -409,7 +409,7 @@ to find out more about error.
 .Xr sdpcontrol 8 ,
 .Xr sdpd 8
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
 .Sh BUGS
 Most likely.
 Please report bugs if found.

Modified: head/lib/libstand/libstand.3
==============================================================================
--- head/lib/libstand/libstand.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libstand/libstand.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -665,12 +665,12 @@ from
 .It
 .Nm zalloc
 from
-.An Matthew Dillon Aq dillon@backplane.com
+.An Matthew Dillon Aq Mt dillon@backplane.com
 .El
 .Pp
 The reorganisation and port to
 .Fx 3.0 ,
 the environment functions and this manpage were written by
-.An Mike Smith Aq msmith@FreeBSD.org .
+.An Mike Smith Aq Mt msmith@FreeBSD.org .
 .Sh BUGS
 The lack of detailed memory usage data is unhelpful.

Modified: head/lib/libstdthreads/thrd_create.3
==============================================================================
--- head/lib/libstdthreads/thrd_create.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libstdthreads/thrd_create.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -257,4 +257,4 @@ These functions are expected to conform 
 These functions appeared in
 .Fx 10.0 .
 .Sh AUTHORS
-.An Ed Schouten Aq ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org

Modified: head/lib/libthr/libthr.3
==============================================================================
--- head/lib/libthr/libthr.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libthr/libthr.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -53,10 +53,10 @@ The
 .Nm
 library
 was originally created by
-.An "Jeff Roberson" Aq jeff@FreeBSD.org ,
+.An Jeff Roberson Aq Mt jeff@FreeBSD.org ,
 and enhanced by
-.An "Jonathan Mini" Aq mini@FreeBSD.org
+.An Jonathan Mini Aq Mt mini@FreeBSD.org
 and
-.An "Mike Makonnen" Aq mtm@FreeBSD.org .
+.An Mike Makonnen Aq Mt mtm@FreeBSD.org .
 It has been substantially rewritten and optimized by
-.An "David Xu" Aq davidxu@FreeBSD.org .
+.An David Xu Aq Mt davidxu@FreeBSD.org .

Modified: head/lib/libufs/bread.3
==============================================================================
--- head/lib/libufs/bread.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libufs/bread.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -96,4 +96,4 @@ These functions first appeared as part o
 in
 .Fx 5.0 .
 .Sh AUTHORS
-.An Juli Mallett Aq jmallett@FreeBSD.org
+.An Juli Mallett Aq Mt jmallett@FreeBSD.org

Modified: head/lib/libufs/cgread.3
==============================================================================
--- head/lib/libufs/cgread.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libufs/cgread.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -103,4 +103,4 @@ These functions first appeared as part o
 in
 .Fx 5.1 .
 .Sh AUTHORS
-.An Juli Mallett Aq jmallett@FreeBSD.org
+.An Juli Mallett Aq Mt jmallett@FreeBSD.org

Modified: head/lib/libufs/libufs.3
==============================================================================
--- head/lib/libufs/libufs.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libufs/libufs.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -71,8 +71,8 @@ The
 library first appeared in
 .Fx 5.0 .
 .Sh AUTHORS
-.An Juli Mallett Aq jmallett@FreeBSD.org
+.An Juli Mallett Aq Mt jmallett@FreeBSD.org
 .Pp
 .An -nosplit
 Additional design, feedback, and ideas were provided by
-.An Poul-Henning Kamp Aq phk@FreeBSD.org .
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org .

Modified: head/lib/libufs/sbread.3
==============================================================================
--- head/lib/libufs/sbread.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libufs/sbread.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -78,4 +78,4 @@ These functions first appeared as part o
 in
 .Fx 5.0 .
 .Sh AUTHORS
-.An Juli Mallett Aq jmallett@FreeBSD.org
+.An Juli Mallett Aq Mt jmallett@FreeBSD.org

Modified: head/lib/libufs/ufs_disk_close.3
==============================================================================
--- head/lib/libufs/ufs_disk_close.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libufs/ufs_disk_close.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -109,4 +109,4 @@ These functions first appeared as part o
 in
 .Fx 5.0 .
 .Sh AUTHORS
-.An Juli Mallett Aq jmallett@FreeBSD.org
+.An Juli Mallett Aq Mt jmallett@FreeBSD.org

Modified: head/lib/libutil/flopen.3
==============================================================================
--- head/lib/libutil/flopen.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libutil/flopen.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -98,4 +98,4 @@ and
 The
 .Nm
 function and this manual page were written by
-.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org .
+.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .

Modified: head/lib/libutil/kld.3
==============================================================================
--- head/lib/libutil/kld.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libutil/kld.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -90,4 +90,4 @@ The
 and
 .Fn kld_load
 functions and this manual page were written by
-.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org .
+.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .

Modified: head/lib/libutil/pidfile.3
==============================================================================
--- head/lib/libutil/pidfile.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libutil/pidfile.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -291,7 +291,7 @@ Probably called not from the process whi
 The
 .Nm pidfile
 functionality is based on ideas from
-.An John-Mark Gurney Aq jmg@FreeBSD.org .
+.An John-Mark Gurney Aq Mt jmg@FreeBSD.org .
 .Pp
 The code and manual page was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org .
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .

Modified: head/lib/libutil/pw_util.3
==============================================================================
--- head/lib/libutil/pw_util.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libutil/pw_util.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -283,4 +283,4 @@ DARPA/SPAWAR contract N66001-01-C-8035
 as part of the DARPA CHATS research program.
 .Pp
 This manual page was written by
-.An Baptiste Daroussin Aq bapt@FreeBSD.org .
+.An Baptiste Daroussin Aq Mt bapt@FreeBSD.org .

Modified: head/lib/libutil/quotafile.3
==============================================================================
--- head/lib/libutil/quotafile.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libutil/quotafile.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -285,6 +285,6 @@ functions first appeared in
 The
 .Nm quotafile
 functions and this manual page were written by
-.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org
+.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org
 and
-.An Marshall Kirk McKusick Aq mckusick@mckusick.com .
+.An Marshall Kirk McKusick Aq Mt mckusick@mckusick.com .

Modified: head/lib/libvgl/vgl.3
==============================================================================
--- head/lib/libvgl/vgl.3	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/lib/libvgl/vgl.3	Mon Jun 23 08:23:05 2014	(r267773)
@@ -468,4 +468,4 @@ The
 library appeared in
 .Fx 3.0 .
 .Sh AUTHORS
-.An S\(/oren Schmidt Aq sos@FreeBSD.org
+.An S\(/oren Schmidt Aq Mt sos@FreeBSD.org

Modified: head/usr.bin/ar/ar.1
==============================================================================
--- head/usr.bin/ar/ar.1	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/usr.bin/ar/ar.1	Mon Jun 23 08:23:05 2014	(r267773)
@@ -570,7 +570,7 @@ An
 command first appeared in AT&T UNIX Version 1.
 In
 .Fx 8.0 ,
-.An "Kai Wang" Aq kaiw@FreeBSD.org
+.An Kai Wang Aq Mt kaiw@FreeBSD.org
 reimplemented
 .Nm
 and

Modified: head/usr.bin/at/at.man
==============================================================================
--- head/usr.bin/at/at.man	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/usr.bin/at/at.man	Mon Jun 23 08:23:05 2014	(r267773)
@@ -330,12 +330,13 @@ job-creation lock file
 .Xr cron 8 ,
 .Xr sendmail 8
 .Sh AUTHORS
+.An -nosplit
 At was mostly written by
-.An Thomas Koenig Aq ig25@rz.uni-karlsruhe.de .
+.An Thomas Koenig Aq Mt ig25@rz.uni-karlsruhe.de .
 The time parsing routines are by
-.An David Parsons Aq orc@pell.chi.il.us ,
+.An David Parsons Aq Mt orc@pell.chi.il.us ,
 with minor enhancements by
-.An Joe Halpin Aq joe.halpin@attbi.com .
+.An Joe Halpin Aq Mt joe.halpin@attbi.com .
 .Sh BUGS
 If the file
 .Pa /var/run/utx.active

Modified: head/usr.bin/bluetooth/bthost/bthost.1
==============================================================================
--- head/usr.bin/bluetooth/bthost/bthost.1	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/usr.bin/bluetooth/bthost/bthost.1	Mon Jun 23 08:23:05 2014	(r267773)
@@ -112,4 +112,4 @@ foo: Unknown Protocol/Service Multiplexo
 .Xr bluetooth.hosts 5 ,
 .Xr bluetooth.protocols 5
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com

Modified: head/usr.bin/bluetooth/btsockstat/btsockstat.1
==============================================================================
--- head/usr.bin/bluetooth/btsockstat/btsockstat.1	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/usr.bin/bluetooth/btsockstat/btsockstat.1	Mon Jun 23 08:23:05 2014	(r267773)
@@ -77,7 +77,7 @@ Display a list of active routing entries
 .Sh SEE ALSO
 .Xr ng_btsocket 4
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
 .Sh BUGS
 Most likely.
 Please report if found.

Modified: head/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.1
==============================================================================
--- head/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.1	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.1	Mon Jun 23 08:23:05 2014	(r267773)
@@ -181,6 +181,6 @@ can be used to talk to the remote serial
 .Xr rfcomm_pppd 8 ,
 .Xr sdpd 8
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com
 .Sh BUGS
 Please report if found.

Modified: head/usr.bin/brandelf/brandelf.1
==============================================================================
--- head/usr.bin/brandelf/brandelf.1	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/usr.bin/brandelf/brandelf.1	Mon Jun 23 08:23:05 2014	(r267773)
@@ -101,4 +101,4 @@ manual page first appeared in
 .Fx 2.2 .
 .Sh AUTHORS
 This manual page was written by
-.An John-Mark Gurney Aq jmg@FreeBSD.org .
+.An John-Mark Gurney Aq Mt jmg@FreeBSD.org .

Modified: head/usr.bin/bsdiff/bsdiff/bsdiff.1
==============================================================================
--- head/usr.bin/bsdiff/bsdiff/bsdiff.1	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/usr.bin/bsdiff/bsdiff/bsdiff.1	Mon Jun 23 08:23:05 2014	(r267773)
@@ -66,7 +66,7 @@ an absolute minimum working set size of 
 .Sh SEE ALSO
 .Xr bspatch 1
 .Sh AUTHORS
-.An Colin Percival Aq cperciva@FreeBSD.org
+.An Colin Percival Aq Mt cperciva@FreeBSD.org
 .Sh BUGS
 The
 .Nm

Modified: head/usr.bin/bsdiff/bspatch/bspatch.1
==============================================================================
--- head/usr.bin/bsdiff/bspatch/bspatch.1	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/usr.bin/bsdiff/bspatch/bspatch.1	Mon Jun 23 08:23:05 2014	(r267773)
@@ -62,7 +62,7 @@ of performance.
 .Sh SEE ALSO
 .Xr bsdiff 1
 .Sh AUTHORS
-.An Colin Percival Aq cperciva@FreeBSD.org
+.An Colin Percival Aq Mt cperciva@FreeBSD.org
 .Sh BUGS
 The
 .Nm

Modified: head/usr.bin/cpuset/cpuset.1
==============================================================================
--- head/usr.bin/cpuset/cpuset.1	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/usr.bin/cpuset/cpuset.1	Mon Jun 23 08:23:05 2014	(r267773)
@@ -191,4 +191,4 @@ The
 command first appeared in
 .Fx 7.1 .
 .Sh AUTHORS
-.An Jeffrey Roberson Aq jeff@FreeBSD.org
+.An Jeffrey Roberson Aq Mt jeff@FreeBSD.org

Modified: head/usr.bin/csup/cpasswd.1
==============================================================================
--- head/usr.bin/csup/cpasswd.1	Mon Jun 23 08:08:22 2014	(r267772)
+++ head/usr.bin/csup/cpasswd.1	Mon Jun 23 08:23:05 2014	(r267773)
@@ -107,12 +107,12 @@ http://www.cvsup.org/
 .Ed
 .Sh AUTHORS
 .An -nosplit
-.An Petar Zhivkov Petrov Aq pesho.petrov@gmail.com
+.An Petar Zhivkov Petrov Aq Mt pesho.petrov@gmail.com
 is the author of
 .Nm ,
 the rewrite of
 .Nm cvpasswd .
-.An John Polstra Aq jdp@polstra.com

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 08:25:22 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 658D12D2;
 Mon, 23 Jun 2014 08:25:22 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5027A2BC3;
 Mon, 23 Jun 2014 08:25:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5N8PMxe090898;
 Mon, 23 Jun 2014 08:25:22 GMT (envelope-from bapt@svn.freebsd.org)
Received: (from bapt@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N8P4SN090769;
 Mon, 23 Jun 2014 08:25:04 GMT (envelope-from bapt@svn.freebsd.org)
Message-Id: <201406230825.s5N8P4SN090769@svn.freebsd.org>
From: Baptiste Daroussin 
Date: Mon, 23 Jun 2014 08:25:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267774 - in head/lib/libc: capability gen iconv net
 posix1e stdio stdlib string sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 08:25:22 -0000

Author: bapt
Date: Mon Jun 23 08:25:03 2014
New Revision: 267774
URL: http://svnweb.freebsd.org/changeset/base/267774

Log:
  use .Mt to mark up email addresses consistently (part4)
  
  PR:		191174
  Submitted by:	Franco Fichtner  

Modified:
  head/lib/libc/capability/cap_rights_init.3
  head/lib/libc/gen/cap_rights_get.3
  head/lib/libc/gen/cap_sandboxed.3
  head/lib/libc/gen/check_utility_compat.3
  head/lib/libc/gen/clock_getcpuclockid.3
  head/lib/libc/gen/dlinfo.3
  head/lib/libc/gen/ftok.3
  head/lib/libc/gen/getpagesizes.3
  head/lib/libc/gen/getutxent.3
  head/lib/libc/gen/posix_spawn.3
  head/lib/libc/gen/posix_spawn_file_actions_addopen.3
  head/lib/libc/gen/posix_spawn_file_actions_init.3
  head/lib/libc/gen/posix_spawnattr_getflags.3
  head/lib/libc/gen/posix_spawnattr_getpgroup.3
  head/lib/libc/gen/posix_spawnattr_getschedparam.3
  head/lib/libc/gen/posix_spawnattr_getschedpolicy.3
  head/lib/libc/gen/posix_spawnattr_getsigdefault.3
  head/lib/libc/gen/posix_spawnattr_getsigmask.3
  head/lib/libc/gen/posix_spawnattr_init.3
  head/lib/libc/gen/setproctitle.3
  head/lib/libc/gen/statvfs.3
  head/lib/libc/iconv/__iconv_get_list.3
  head/lib/libc/iconv/iconv_canonicalize.3
  head/lib/libc/iconv/iconvctl.3
  head/lib/libc/iconv/iconvlist.3
  head/lib/libc/net/nsdispatch.3
  head/lib/libc/net/sourcefilter.3
  head/lib/libc/posix1e/acl_add_flag_np.3
  head/lib/libc/posix1e/acl_add_perm.3
  head/lib/libc/posix1e/acl_calc_mask.3
  head/lib/libc/posix1e/acl_clear_flags_np.3
  head/lib/libc/posix1e/acl_clear_perms.3
  head/lib/libc/posix1e/acl_copy_entry.3
  head/lib/libc/posix1e/acl_create_entry.3
  head/lib/libc/posix1e/acl_delete_entry.3
  head/lib/libc/posix1e/acl_delete_flag_np.3
  head/lib/libc/posix1e/acl_delete_perm.3
  head/lib/libc/posix1e/acl_get_brand_np.3
  head/lib/libc/posix1e/acl_get_entry.3
  head/lib/libc/posix1e/acl_get_entry_type_np.3
  head/lib/libc/posix1e/acl_get_flag_np.3
  head/lib/libc/posix1e/acl_get_flagset_np.3
  head/lib/libc/posix1e/acl_get_perm_np.3
  head/lib/libc/posix1e/acl_get_permset.3
  head/lib/libc/posix1e/acl_get_qualifier.3
  head/lib/libc/posix1e/acl_get_tag_type.3
  head/lib/libc/posix1e/acl_is_trivial_np.3
  head/lib/libc/posix1e/acl_set_entry_type_np.3
  head/lib/libc/posix1e/acl_set_flagset_np.3
  head/lib/libc/posix1e/acl_set_permset.3
  head/lib/libc/posix1e/acl_set_qualifier.3
  head/lib/libc/posix1e/acl_set_tag_type.3
  head/lib/libc/posix1e/acl_strip_np.3
  head/lib/libc/stdio/printf.3
  head/lib/libc/stdlib/a64l.3
  head/lib/libc/stdlib/strfmon.3
  head/lib/libc/string/memmem.3
  head/lib/libc/string/strerror.3
  head/lib/libc/string/strtok.3
  head/lib/libc/sys/abort2.2
  head/lib/libc/sys/aio_cancel.2
  head/lib/libc/sys/aio_error.2
  head/lib/libc/sys/aio_mlock.2
  head/lib/libc/sys/aio_read.2
  head/lib/libc/sys/aio_return.2
  head/lib/libc/sys/aio_suspend.2
  head/lib/libc/sys/aio_waitcomplete.2
  head/lib/libc/sys/aio_write.2
  head/lib/libc/sys/bindat.2
  head/lib/libc/sys/cap_fcntls_limit.2
  head/lib/libc/sys/cap_ioctls_limit.2
  head/lib/libc/sys/cap_rights_limit.2
  head/lib/libc/sys/connectat.2
  head/lib/libc/sys/cpuset.2
  head/lib/libc/sys/cpuset_getaffinity.2
  head/lib/libc/sys/ffclock.2
  head/lib/libc/sys/kenv.2
  head/lib/libc/sys/kqueue.2
  head/lib/libc/sys/kse.2
  head/lib/libc/sys/pdfork.2
  head/lib/libc/sys/posix_fallocate.2
  head/lib/libc/sys/posix_openpt.2
  head/lib/libc/sys/pselect.2
  head/lib/libc/sys/rtprio.2
  head/lib/libc/sys/sendfile.2
  head/lib/libc/sys/shm_open.2
  head/lib/libc/sys/shutdown.2

Modified: head/lib/libc/capability/cap_rights_init.3
==============================================================================
--- head/lib/libc/capability/cap_rights_init.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/capability/cap_rights_init.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -237,5 +237,5 @@ Support for capabilities and capabilitie
 Project.
 .Sh AUTHORS
 This family of functions was created by
-.An Pawel Jakub Dawidek Aq pawel@dawidek.net
+.An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net
 under sponsorship from the FreeBSD Foundation.

Modified: head/lib/libc/gen/cap_rights_get.3
==============================================================================
--- head/lib/libc/gen/cap_rights_get.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/cap_rights_get.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -115,5 +115,5 @@ Support for capabilities and capabilitie
 Project.
 .Sh AUTHORS
 This function was created by
-.An Pawel Jakub Dawidek Aq pawel@dawidek.net
+.An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net
 under sponsorship of the FreeBSD Foundation.

Modified: head/lib/libc/gen/cap_sandboxed.3
==============================================================================
--- head/lib/libc/gen/cap_sandboxed.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/cap_sandboxed.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -67,5 +67,5 @@ or
 .Xr capsicum 4
 .Sh AUTHORS
 This function was implemented and manual page was written by
-.An Pawel Jakub Dawidek Aq pawel@dawidek.net
+.An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net
 under sponsorship of the FreeBSD Foundation.

Modified: head/lib/libc/gen/check_utility_compat.3
==============================================================================
--- head/lib/libc/gen/check_utility_compat.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/check_utility_compat.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -86,4 +86,4 @@ function first appeared in
 .Fx 5.0 .
 .Sh AUTHORS
 This manual page was written by
-.An Garrett Wollman Aq wollman@FreeBSD.org .
+.An Garrett Wollman Aq Mt wollman@FreeBSD.org .

Modified: head/lib/libc/gen/clock_getcpuclockid.3
==============================================================================
--- head/lib/libc/gen/clock_getcpuclockid.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/clock_getcpuclockid.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -92,4 +92,4 @@ The
 function first appeared in
 .Fx 10.0 .
 .Sh AUTHORS
-.An David Xu Aq davidxu@FreeBSD.org
+.An David Xu Aq Mt davidxu@FreeBSD.org

Modified: head/lib/libc/gen/dlinfo.3
==============================================================================
--- head/lib/libc/gen/dlinfo.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/dlinfo.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -271,12 +271,9 @@ The
 implementation of the
 .Fn dlinfo
 function was originally written by
-.An Alexey Zelkin
-.Aq phantom@FreeBSD.org
+.An Alexey Zelkin Aq Mt phantom@FreeBSD.org
 and later extended and improved by
-.An Alexander Kabaev
-.Aq kan@FreeBSD.org .
+.An Alexander Kabaev Aq Mt kan@FreeBSD.org .
 .Pp
 The manual page for this function was written by
-.An Alexey Zelkin
-.Aq phantom@FreeBSD.org .
+.An Alexey Zelkin Aq Mt phantom@FreeBSD.org .

Modified: head/lib/libc/gen/ftok.3
==============================================================================
--- head/lib/libc/gen/ftok.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/ftok.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -73,7 +73,7 @@ The
 function originates with System V and is typically used by programs
 that use the System V IPC routines.
 .Sh AUTHORS
-.An Thorsten Lockert Aq tholo@sigmasoft.com
+.An Thorsten Lockert Aq Mt tholo@sigmasoft.com
 .Sh BUGS
 The returned key is computed based on the device minor number and inode of the
 specified

Modified: head/lib/libc/gen/getpagesizes.3
==============================================================================
--- head/lib/libc/gen/getpagesizes.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/getpagesizes.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -96,4 +96,4 @@ implementation that was first released i
 .Fx 7.3 .
 .Sh AUTHORS
 This manual page was written by
-.An Alan L. Cox Aq alc@cs.rice.edu .
+.An Alan L. Cox Aq Mt alc@cs.rice.edu .

Modified: head/lib/libc/gen/getutxent.3
==============================================================================
--- head/lib/libc/gen/getutxent.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/getutxent.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -475,4 +475,4 @@ They replaced the
 .In utmp.h
 interface.
 .Sh AUTHORS
-.An Ed Schouten Aq ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org

Modified: head/lib/libc/gen/posix_spawn.3
==============================================================================
--- head/lib/libc/gen/posix_spawn.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/posix_spawn.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -457,4 +457,4 @@ and
 functions first appeared in
 .Fx 8.0 .
 .Sh AUTHORS
-.An Ed Schouten Aq ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org

Modified: head/lib/libc/gen/posix_spawn_file_actions_addopen.3
==============================================================================
--- head/lib/libc/gen/posix_spawn_file_actions_addopen.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/posix_spawn_file_actions_addopen.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -200,4 +200,4 @@ and
 functions first appeared in
 .Fx 8.0 .
 .Sh AUTHORS
-.An Ed Schouten Aq ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org

Modified: head/lib/libc/gen/posix_spawn_file_actions_init.3
==============================================================================
--- head/lib/libc/gen/posix_spawn_file_actions_init.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/posix_spawn_file_actions_init.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -101,4 +101,4 @@ and
 functions first appeared in
 .Fx 8.0 .
 .Sh AUTHORS
-.An Ed Schouten Aq ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org

Modified: head/lib/libc/gen/posix_spawnattr_getflags.3
==============================================================================
--- head/lib/libc/gen/posix_spawnattr_getflags.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/posix_spawnattr_getflags.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -108,4 +108,4 @@ and
 functions first appeared in
 .Fx 8.0 .
 .Sh AUTHORS
-.An Ed Schouten Aq ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org

Modified: head/lib/libc/gen/posix_spawnattr_getpgroup.3
==============================================================================
--- head/lib/libc/gen/posix_spawnattr_getpgroup.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/posix_spawnattr_getpgroup.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -93,4 +93,4 @@ and
 functions first appeared in
 .Fx 8.0 .
 .Sh AUTHORS
-.An Ed Schouten Aq ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org

Modified: head/lib/libc/gen/posix_spawnattr_getschedparam.3
==============================================================================
--- head/lib/libc/gen/posix_spawnattr_getschedparam.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/posix_spawnattr_getschedparam.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -97,4 +97,4 @@ and
 functions first appeared in
 .Fx 8.0 .
 .Sh AUTHORS
-.An Ed Schouten Aq ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org

Modified: head/lib/libc/gen/posix_spawnattr_getschedpolicy.3
==============================================================================
--- head/lib/libc/gen/posix_spawnattr_getschedpolicy.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/posix_spawnattr_getschedpolicy.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -95,4 +95,4 @@ and
 functions first appeared in
 .Fx 8.0 .
 .Sh AUTHORS
-.An Ed Schouten Aq ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org

Modified: head/lib/libc/gen/posix_spawnattr_getsigdefault.3
==============================================================================
--- head/lib/libc/gen/posix_spawnattr_getsigdefault.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/posix_spawnattr_getsigdefault.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -95,4 +95,4 @@ and
 functions first appeared in
 .Fx 8.0 .
 .Sh AUTHORS
-.An Ed Schouten Aq ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org

Modified: head/lib/libc/gen/posix_spawnattr_getsigmask.3
==============================================================================
--- head/lib/libc/gen/posix_spawnattr_getsigmask.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/posix_spawnattr_getsigmask.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -95,4 +95,4 @@ and
 functions first appeared in
 .Fx 8.0 .
 .Sh AUTHORS
-.An Ed Schouten Aq ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org

Modified: head/lib/libc/gen/posix_spawnattr_init.3
==============================================================================
--- head/lib/libc/gen/posix_spawnattr_init.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/posix_spawnattr_init.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -120,4 +120,4 @@ and
 functions first appeared in
 .Fx 8.0 .
 .Sh AUTHORS
-.An Ed Schouten Aq ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org

Modified: head/lib/libc/gen/setproctitle.3
==============================================================================
--- head/lib/libc/gen/setproctitle.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/setproctitle.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -100,11 +100,11 @@ Other operating systems have
 similar functions.
 .Sh AUTHORS
 .An -nosplit
-.An Peter Wemm Aq peter@FreeBSD.org
+.An Peter Wemm Aq Mt peter@FreeBSD.org
 stole the idea from the
 .Sy "Sendmail 8.7.3"
 source code by
-.An Eric Allman Aq eric@sendmail.org .
+.An Eric Allman Aq Mt eric@sendmail.org .
 .Sh BUGS
 Never pass a string with user-supplied data as a format without using
 .Ql %s .

Modified: head/lib/libc/gen/statvfs.3
==============================================================================
--- head/lib/libc/gen/statvfs.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/gen/statvfs.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -184,4 +184,4 @@ The
 and
 .Fn fstatvfs
 functions and this manual page were written by
-.An Garrett Wollman Aq wollman@FreeBSD.org .
+.An Garrett Wollman Aq Mt wollman@FreeBSD.org .

Modified: head/lib/libc/iconv/__iconv_get_list.3
==============================================================================
--- head/lib/libc/iconv/__iconv_get_list.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/iconv/__iconv_get_list.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -92,4 +92,4 @@ The iconv implementation of the Citrus P
 .Fx 9.0 .
 .Sh AUTHORS
 This manual page was written by
-.An Gabor Kovesdan Aq gabor@FreeBSD.org .
+.An Gabor Kovesdan Aq Mt gabor@FreeBSD.org .

Modified: head/lib/libc/iconv/iconv_canonicalize.3
==============================================================================
--- head/lib/libc/iconv/iconv_canonicalize.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/iconv/iconv_canonicalize.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -71,4 +71,4 @@ the GNU implementation and was adopted i
 for compatibility's sake.
 .Sh AUTHORS
 This manual page was written by
-.An Gabor Kovesdan Aq gabor@FreeBSD.org .
+.An Gabor Kovesdan Aq Mt gabor@FreeBSD.org .

Modified: head/lib/libc/iconv/iconvctl.3
==============================================================================
--- head/lib/libc/iconv/iconvctl.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/iconv/iconvctl.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -179,7 +179,7 @@ the GNU implementation and was adopted i
 for compatibility's sake.
 .Sh AUTHORS
 This manual page was written by
-.An Gabor Kovesdan Aq gabor@FreeBSD.org .
+.An Gabor Kovesdan Aq Mt gabor@FreeBSD.org .
 .Sh BUGS
 Transliteration is enabled in this implementation by default, so it
 is impossible by design to turn it off.

Modified: head/lib/libc/iconv/iconvlist.3
==============================================================================
--- head/lib/libc/iconv/iconvlist.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/iconv/iconvlist.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -90,4 +90,4 @@ the GNU implementation and was adopted i
 for compatibility's sake.
 .Sh AUTHORS
 This manual page was written by
-.An Gabor Kovesdan Aq gabor@FreeBSD.org .
+.An Gabor Kovesdan Aq Mt gabor@FreeBSD.org .

Modified: head/lib/libc/net/nsdispatch.3
==============================================================================
--- head/lib/libc/net/nsdispatch.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/net/nsdispatch.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -239,8 +239,7 @@ where it appeared first in
 Support for NSS modules first appeared in
 .Fx 5.1 .
 .Sh AUTHORS
-Luke Mewburn
-.Aq lukem@netbsd.org
+.An Luke Mewburn Aq Mt lukem@netbsd.org
 wrote this freely-distributable name-service switch implementation,
 using ideas from the
 .Tn ULTRIX

Modified: head/lib/libc/net/sourcefilter.3
==============================================================================
--- head/lib/libc/net/sourcefilter.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/net/sourcefilter.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -236,5 +236,4 @@ The
 functions first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
-Bruce M. Simpson
-.Aq bms@FreeBSD.org
+.An Bruce M. Simpson Aq Mt bms@FreeBSD.org

Modified: head/lib/libc/posix1e/acl_add_flag_np.3
==============================================================================
--- head/lib/libc/posix1e/acl_add_flag_np.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_add_flag_np.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -94,4 +94,4 @@ function was added in
 The
 .Fn acl_add_flag_np
 function was written by
-.An Edward Tomasz Napierala Aq trasz@FreeBSD.org .
+.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org .

Modified: head/lib/libc/posix1e/acl_add_perm.3
==============================================================================
--- head/lib/libc/posix1e/acl_add_perm.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_add_perm.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -126,4 +126,4 @@ function was added in
 The
 .Fn acl_add_perm
 function was written by
-.An Chris D. Faulhaber Aq jedgar@fxp.org .
+.An Chris D. Faulhaber Aq Mt jedgar@fxp.org .

Modified: head/lib/libc/posix1e/acl_calc_mask.3
==============================================================================
--- head/lib/libc/posix1e/acl_calc_mask.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_calc_mask.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -95,4 +95,4 @@ function was added in
 The
 .Fn acl_calc_mask
 function was written by
-.An Chris D. Faulhaber Aq jedgar@fxp.org .
+.An Chris D. Faulhaber Aq Mt jedgar@fxp.org .

Modified: head/lib/libc/posix1e/acl_clear_flags_np.3
==============================================================================
--- head/lib/libc/posix1e/acl_clear_flags_np.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_clear_flags_np.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -76,4 +76,4 @@ function was added in
 The
 .Fn acl_clear_flags_np
 function was written by
-.An Edward Tomasz Napierala Aq trasz@FreeBSD.org .
+.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org .

Modified: head/lib/libc/posix1e/acl_clear_perms.3
==============================================================================
--- head/lib/libc/posix1e/acl_clear_perms.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_clear_perms.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -76,4 +76,4 @@ function was added in
 The
 .Fn acl_clear_perms
 function was written by
-.An Chris D. Faulhaber Aq jedgar@fxp.org .
+.An Chris D. Faulhaber Aq Mt jedgar@fxp.org .

Modified: head/lib/libc/posix1e/acl_copy_entry.3
==============================================================================
--- head/lib/libc/posix1e/acl_copy_entry.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_copy_entry.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -82,4 +82,4 @@ function was added in
 The
 .Fn acl_copy_entry
 function was written by
-.An Chris D. Faulhaber Aq jedgar@fxp.org .
+.An Chris D. Faulhaber Aq Mt jedgar@fxp.org .

Modified: head/lib/libc/posix1e/acl_create_entry.3
==============================================================================
--- head/lib/libc/posix1e/acl_create_entry.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_create_entry.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -95,4 +95,4 @@ function was added in
 The
 .Fn acl_create_entry
 function was written by
-.An Chris D. Faulhaber Aq jedgar@fxp.org .
+.An Chris D. Faulhaber Aq Mt jedgar@fxp.org .

Modified: head/lib/libc/posix1e/acl_delete_entry.3
==============================================================================
--- head/lib/libc/posix1e/acl_delete_entry.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_delete_entry.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -98,4 +98,4 @@ function was added in
 The
 .Fn acl_delete_entry
 function was written by
-.An Chris D. Faulhaber Aq jedgar@fxp.org .
+.An Chris D. Faulhaber Aq Mt jedgar@fxp.org .

Modified: head/lib/libc/posix1e/acl_delete_flag_np.3
==============================================================================
--- head/lib/libc/posix1e/acl_delete_flag_np.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_delete_flag_np.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -81,4 +81,4 @@ function was added in
 The
 .Fn acl_delete_flag_np
 function was written by
-.An Edward Tomasz Napierala Aq trasz@FreeBSD.org .
+.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org .

Modified: head/lib/libc/posix1e/acl_delete_perm.3
==============================================================================
--- head/lib/libc/posix1e/acl_delete_perm.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_delete_perm.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -81,4 +81,4 @@ function was added in
 The
 .Fn acl_delete_perm
 function was written by
-.An Chris D. Faulhaber Aq jedgar@fxp.org .
+.An Chris D. Faulhaber Aq Mt jedgar@fxp.org .

Modified: head/lib/libc/posix1e/acl_get_brand_np.3
==============================================================================
--- head/lib/libc/posix1e/acl_get_brand_np.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_get_brand_np.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -83,4 +83,4 @@ function was added in
 The
 .Fn acl_get_brand_np
 function was written by
-.An Edward Tomasz Napierala Aq trasz@FreeBSD.org .
+.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org .

Modified: head/lib/libc/posix1e/acl_get_entry.3
==============================================================================
--- head/lib/libc/posix1e/acl_get_entry.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_get_entry.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -142,4 +142,4 @@ function was added in
 The
 .Fn acl_get_entry
 function was written by
-.An Chris D. Faulhaber Aq jedgar@fxp.org .
+.An Chris D. Faulhaber Aq Mt jedgar@fxp.org .

Modified: head/lib/libc/posix1e/acl_get_entry_type_np.3
==============================================================================
--- head/lib/libc/posix1e/acl_get_entry_type_np.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_get_entry_type_np.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -77,4 +77,4 @@ function was added in
 The
 .Fn acl_get_entry_type_np
 function was written by
-.An Edward Tomasz Napierala Aq trasz@FreeBSD.org .
+.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org .

Modified: head/lib/libc/posix1e/acl_get_flag_np.3
==============================================================================
--- head/lib/libc/posix1e/acl_get_flag_np.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_get_flag_np.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -91,4 +91,4 @@ function was added in
 The
 .Fn acl_get_flag_np
 function was written by
-.An Edward Tomasz Napierala Aq trasz@FreeBSD.org .
+.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org .

Modified: head/lib/libc/posix1e/acl_get_flagset_np.3
==============================================================================
--- head/lib/libc/posix1e/acl_get_flagset_np.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_get_flagset_np.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -80,4 +80,4 @@ function was added in
 The
 .Fn acl_get_flagset_np
 function was written by
-.An Edward Tomasz Napierala Aq trasz@FreeBSD.org .
+.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org .

Modified: head/lib/libc/posix1e/acl_get_perm_np.3
==============================================================================
--- head/lib/libc/posix1e/acl_get_perm_np.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_get_perm_np.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -91,4 +91,4 @@ function was added in
 The
 .Fn acl_get_perm_np
 function was written by
-.An Chris D. Faulhaber Aq jedgar@fxp.org .
+.An Chris D. Faulhaber Aq Mt jedgar@fxp.org .

Modified: head/lib/libc/posix1e/acl_get_permset.3
==============================================================================
--- head/lib/libc/posix1e/acl_get_permset.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_get_permset.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -80,4 +80,4 @@ function was added in
 The
 .Fn acl_get_permset
 function was written by
-.An Chris D. Faulhaber Aq jedgar@fxp.org .
+.An Chris D. Faulhaber Aq Mt jedgar@fxp.org .

Modified: head/lib/libc/posix1e/acl_get_qualifier.3
==============================================================================
--- head/lib/libc/posix1e/acl_get_qualifier.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_get_qualifier.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -137,4 +137,4 @@ function was added in
 The
 .Fn acl_get_qualifier
 function was written by
-.An Chris D. Faulhaber Aq jedgar@fxp.org .
+.An Chris D. Faulhaber Aq Mt jedgar@fxp.org .

Modified: head/lib/libc/posix1e/acl_get_tag_type.3
==============================================================================
--- head/lib/libc/posix1e/acl_get_tag_type.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_get_tag_type.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -82,4 +82,4 @@ function was added in
 The
 .Fn acl_get_tag_type
 function was written by
-.An Chris D. Faulhaber Aq jedgar@fxp.org .
+.An Chris D. Faulhaber Aq Mt jedgar@fxp.org .

Modified: head/lib/libc/posix1e/acl_is_trivial_np.3
==============================================================================
--- head/lib/libc/posix1e/acl_is_trivial_np.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_is_trivial_np.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -82,4 +82,4 @@ The
 function was added in
 .Fx 8.0 .
 .Sh AUTHORS
-.An Edward Tomasz Napierala Aq trasz@FreeBSD.org .
+.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org

Modified: head/lib/libc/posix1e/acl_set_entry_type_np.3
==============================================================================
--- head/lib/libc/posix1e/acl_set_entry_type_np.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_set_entry_type_np.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -91,4 +91,4 @@ function was added in
 The
 .Fn acl_get_entry_type_np
 function was written by
-.An Edward Tomasz Napierala Aq trasz@FreeBSD.org .
+.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org .

Modified: head/lib/libc/posix1e/acl_set_flagset_np.3
==============================================================================
--- head/lib/libc/posix1e/acl_set_flagset_np.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_set_flagset_np.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -82,4 +82,4 @@ function was added in
 The
 .Fn acl_set_flagset_np
 function was written by
-.An Edward Tomasz Napierala Aq trasz@FreeBSD.org .
+.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org .

Modified: head/lib/libc/posix1e/acl_set_permset.3
==============================================================================
--- head/lib/libc/posix1e/acl_set_permset.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_set_permset.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -78,4 +78,4 @@ function was added in
 The
 .Fn acl_set_permset
 function was written by
-.An Chris D. Faulhaber Aq jedgar@fxp.org .
+.An Chris D. Faulhaber Aq Mt jedgar@fxp.org .

Modified: head/lib/libc/posix1e/acl_set_qualifier.3
==============================================================================
--- head/lib/libc/posix1e/acl_set_qualifier.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_set_qualifier.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -88,4 +88,4 @@ function was added in
 The
 .Fn acl_get_qualifier
 function was written by
-.An Chris D. Faulhaber Aq jedgar@fxp.org .
+.An Chris D. Faulhaber Aq Mt jedgar@fxp.org .

Modified: head/lib/libc/posix1e/acl_set_tag_type.3
==============================================================================
--- head/lib/libc/posix1e/acl_set_tag_type.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_set_tag_type.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -99,4 +99,4 @@ function was added in
 The
 .Fn acl_set_tag_type
 function was written by
-.An Chris D. Faulhaber Aq jedgar@fxp.org .
+.An Chris D. Faulhaber Aq Mt jedgar@fxp.org .

Modified: head/lib/libc/posix1e/acl_strip_np.3
==============================================================================
--- head/lib/libc/posix1e/acl_strip_np.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/posix1e/acl_strip_np.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -106,4 +106,4 @@ The
 function was added in
 .Fx 8.0 .
 .Sh AUTHORS
-.An Edward Tomasz Napierala Aq trasz@FreeBSD.org .
+.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org

Modified: head/lib/libc/stdio/printf.3
==============================================================================
--- head/lib/libc/stdio/printf.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/stdio/printf.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -827,14 +827,14 @@ first appeared in the
 .Tn GNU C
 library.
 These were implemented by
-.An Peter Wemm Aq peter@FreeBSD.org
+.An Peter Wemm Aq Mt peter@FreeBSD.org
 in
 .Fx 2.2 ,
 but were later replaced with a different implementation
 from
 .Ox 2.3
 by
-.An Todd C. Miller Aq Todd.Miller@courtesan.com .
+.An Todd C. Miller Aq Mt Todd.Miller@courtesan.com .
 The
 .Fn dprintf
 and

Modified: head/lib/libc/stdlib/a64l.3
==============================================================================
--- head/lib/libc/stdlib/a64l.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/stdlib/a64l.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -181,7 +181,7 @@ functions
 were added to
 .Fx
 by
-.An Tom Rhodes Aq trhodes@FreeBSD.org .
+.An Tom Rhodes Aq Mt trhodes@FreeBSD.org .
 Almost all of this manual page came from the
 .Tn POSIX
 standard.

Modified: head/lib/libc/stdlib/strfmon.3
==============================================================================
--- head/lib/libc/stdlib/strfmon.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/stdlib/strfmon.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -171,10 +171,10 @@ function conforms to
 The
 .Fn strfmon
 function was implemented by
-.An Alexey Zelkin Aq phantom@FreeBSD.org .
+.An Alexey Zelkin Aq Mt phantom@FreeBSD.org .
 .Pp
 This manual page was written by
-.An Jeroen Ruigrok van der Werven Aq asmodai@FreeBSD.org
+.An Jeroen Ruigrok van der Werven Aq Mt asmodai@FreeBSD.org
 based on the standards' text.
 .Sh BUGS
 The

Modified: head/lib/libc/string/memmem.3
==============================================================================
--- head/lib/libc/string/memmem.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/string/memmem.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -80,7 +80,7 @@ The
 function first appeared in
 .Fx 6.0 .
 .Sh AUTHORS
-.An Pascal Gloor Aq pascal.gloor@spale.com
+.An Pascal Gloor Aq Mt pascal.gloor@spale.com
 .Sh BUGS
 This function was broken in Linux libc up to and including version 5.0.9
 and in GNU libc prior to version 2.1.

Modified: head/lib/libc/string/strerror.3
==============================================================================
--- head/lib/libc/string/strerror.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/string/strerror.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -172,7 +172,7 @@ The
 function was implemented in
 .Fx 4.4
 by
-.An Wes Peters Aq wes@FreeBSD.org .
+.An Wes Peters Aq Mt wes@FreeBSD.org .
 .Sh BUGS
 The
 .Fn strerror

Modified: head/lib/libc/string/strtok.3
==============================================================================
--- head/lib/libc/string/strtok.3	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/string/strtok.3	Mon Jun 23 08:25:03 2014	(r267774)
@@ -150,9 +150,8 @@ function
 conforms to
 .St -isoC .
 .Sh AUTHORS
-.An Wes Peters ,
-Softweyr LLC:
-.Aq wes@softweyr.com
+.An Wes Peters Aq Mt wes@softweyr.com ,
+Softweyr LLC
 .Pp
 Based on the
 .Fx 3.0

Modified: head/lib/libc/sys/abort2.2
==============================================================================
--- head/lib/libc/sys/abort2.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/abort2.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -108,6 +108,6 @@ system call first appeared in
 The
 .Fn abort2
 system call was designed by
-.An "Poul-Henning Kamp" Aq phk@FreeBSD.org .
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org .
 It was implemented by
-.An "Wojciech A. Koszek" Aq dunstan@freebsd.czest.pl .
+.An Wojciech A. Koszek Aq Mt dunstan@freebsd.czest.pl .

Modified: head/lib/libc/sys/aio_cancel.2
==============================================================================
--- head/lib/libc/sys/aio_cancel.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/aio_cancel.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -109,8 +109,8 @@ appeared in
 .An -nosplit
 This
 manual page was originally written by
-.An Wes Peters Aq wes@softweyr.com .
-.An Christopher M Sedore Aq cmsedore@maxwell.syr.edu
+.An Wes Peters Aq Mt wes@softweyr.com .
+.An Christopher M Sedore Aq Mt cmsedore@maxwell.syr.edu
 updated it when
 .Fn aio_cancel
 was implemented for

Modified: head/lib/libc/sys/aio_error.2
==============================================================================
--- head/lib/libc/sys/aio_error.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/aio_error.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -98,4 +98,4 @@ system call first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Wes Peters Aq wes@softweyr.com .
+.An Wes Peters Aq Mt wes@softweyr.com .

Modified: head/lib/libc/sys/aio_mlock.2
==============================================================================
--- head/lib/libc/sys/aio_mlock.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/aio_mlock.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -130,4 +130,4 @@ system call first appeared in
 .Fx 10.0 .
 .Sh AUTHORS
 The system call was introduced by
-.An Gleb Smirnoff Aq glebius@FreeBSD.org .
+.An Gleb Smirnoff Aq Mt glebius@FreeBSD.org .

Modified: head/lib/libc/sys/aio_read.2
==============================================================================
--- head/lib/libc/sys/aio_read.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/aio_read.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -207,7 +207,7 @@ system call first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Terry Lambert Aq terry@whistle.com .
+.An Terry Lambert Aq Mt terry@whistle.com .
 .Sh BUGS
 Invalid information in
 .Fa iocb->_aiocb_private

Modified: head/lib/libc/sys/aio_return.2
==============================================================================
--- head/lib/libc/sys/aio_return.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/aio_return.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -99,4 +99,4 @@ system call first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Wes Peters Aq wes@softweyr.com .
+.An Wes Peters Aq Mt wes@softweyr.com .

Modified: head/lib/libc/sys/aio_suspend.2
==============================================================================
--- head/lib/libc/sys/aio_suspend.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/aio_suspend.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -114,4 +114,4 @@ system call first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Wes Peters Aq wes@softweyr.com .
+.An Wes Peters Aq Mt wes@softweyr.com .

Modified: head/lib/libc/sys/aio_waitcomplete.2
==============================================================================
--- head/lib/libc/sys/aio_waitcomplete.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/aio_waitcomplete.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -134,4 +134,4 @@ system call first appeared in
 The
 .Fn aio_waitcomplete
 system call and this manual page were written by
-.An Christopher M Sedore Aq cmsedore@maxwell.syr.edu .
+.An Christopher M Sedore Aq Mt cmsedore@maxwell.syr.edu .

Modified: head/lib/libc/sys/aio_write.2
==============================================================================
--- head/lib/libc/sys/aio_write.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/aio_write.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -202,7 +202,7 @@ system call first appeared in
 .Fx 3.0 .
 .Sh AUTHORS
 This manual page was written by
-.An Wes Peters Aq wes@softweyr.com .
+.An Wes Peters Aq Mt wes@softweyr.com .
 .Sh BUGS
 Invalid information in
 .Fa iocb->_aiocb_private

Modified: head/lib/libc/sys/bindat.2
==============================================================================
--- head/lib/libc/sys/bindat.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/bindat.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -105,5 +105,5 @@ nor a file descriptor associated with a 
 The
 .Nm
 was developed by
-.An Pawel Jakub Dawidek Aq pawel@dawidek.net
+.An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net
 under sponsorship from the FreeBSD Foundation.

Modified: head/lib/libc/sys/cap_fcntls_limit.2
==============================================================================
--- head/lib/libc/sys/cap_fcntls_limit.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/cap_fcntls_limit.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -122,5 +122,5 @@ Support for capabilities and capabilitie
 Project.
 .Sh AUTHORS
 This function was created by
-.An Pawel Jakub Dawidek Aq pawel@dawidek.net
+.An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net
 under sponsorship of the FreeBSD Foundation.

Modified: head/lib/libc/sys/cap_ioctls_limit.2
==============================================================================
--- head/lib/libc/sys/cap_ioctls_limit.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/cap_ioctls_limit.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -153,5 +153,5 @@ Support for capabilities and capabilitie
 Project.
 .Sh AUTHORS
 This function was created by
-.An Pawel Jakub Dawidek Aq pawel@dawidek.net
+.An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net
 under sponsorship of the FreeBSD Foundation.

Modified: head/lib/libc/sys/cap_rights_limit.2
==============================================================================
--- head/lib/libc/sys/cap_rights_limit.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/cap_rights_limit.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -153,5 +153,5 @@ Support for capabilities and capabilitie
 Project.
 .Sh AUTHORS
 This function was created by
-.An Pawel Jakub Dawidek Aq pawel@dawidek.net
+.An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net
 under sponsorship of the FreeBSD Foundation.

Modified: head/lib/libc/sys/connectat.2
==============================================================================
--- head/lib/libc/sys/connectat.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/connectat.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -105,5 +105,5 @@ nor a file descriptor associated with a 
 The
 .Nm
 was developed by
-.An Pawel Jakub Dawidek Aq pawel@dawidek.net
+.An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net
 under sponsorship from the FreeBSD Foundation.

Modified: head/lib/libc/sys/cpuset.2
==============================================================================
--- head/lib/libc/sys/cpuset.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/cpuset.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -224,5 +224,5 @@ The
 .Nm
 family of system calls first appeared in
 .Fx 7.1 .
-.Sh AUTHOR
-.An Jeffrey Roberson Aq jeff@FreeBSD.org
+.Sh AUTHORS
+.An Jeffrey Roberson Aq Mt jeff@FreeBSD.org

Modified: head/lib/libc/sys/cpuset_getaffinity.2
==============================================================================
--- head/lib/libc/sys/cpuset_getaffinity.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/cpuset_getaffinity.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -159,5 +159,5 @@ The
 .Nm
 family of system calls first appeared in
 .Fx 7.1 .
-.Sh AUTHOR
-.An Jeffrey Roberson Aq jeff@FreeBSD.org
+.Sh AUTHORS
+.An Jeffrey Roberson Aq Mt jeff@FreeBSD.org

Modified: head/lib/libc/sys/ffclock.2
==============================================================================
--- head/lib/libc/sys/ffclock.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/ffclock.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -171,7 +171,7 @@ Feed-forward clock support first appeare
 .Sh AUTHORS
 .An -nosplit
 The feed-forward clock support was written by
-.An Julien Ridoux Aq jridoux@unimelb.edu.au
+.An Julien Ridoux Aq Mt jridoux@unimelb.edu.au
 in collaboration with
-.An Darryl Veitch Aq dveitch@unimelb.edu.au
+.An Darryl Veitch Aq Mt dveitch@unimelb.edu.au
 at the University of Melbourne under sponsorship from the FreeBSD Foundation.

Modified: head/lib/libc/sys/kenv.2
==============================================================================
--- head/lib/libc/sys/kenv.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/kenv.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -171,9 +171,9 @@ or the value of a variable is longer tha
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Chad David Aq davidc@FreeBSD.org .
+.An Chad David Aq Mt davidc@FreeBSD.org .
 .Pp
 The
 .Fn kenv
 system call was written by
-.An Maxime Henrion Aq mux@FreeBSD.org .
+.An Maxime Henrion Aq Mt mux@FreeBSD.org .

Modified: head/lib/libc/sys/kqueue.2
==============================================================================
--- head/lib/libc/sys/kqueue.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/kqueue.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -613,7 +613,7 @@ system calls first appeared in
 The
 .Fn kqueue
 system and this manual page were written by
-.An Jonathan Lemon Aq jlemon@FreeBSD.org .
+.An Jonathan Lemon Aq Mt jlemon@FreeBSD.org .
 .Sh BUGS
 The
 .Fa timeout

Modified: head/lib/libc/sys/kse.2
==============================================================================
--- head/lib/libc/sys/kse.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/kse.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -665,15 +665,15 @@ The KSE system calls first appeared in
 .Sh AUTHORS
 KSE was originally implemented by
 .An -nosplit
-.An "Julian Elischer" Aq julian@FreeBSD.org ,
+.An Julian Elischer Aq Mt julian@FreeBSD.org ,
 with additional contributions by
-.An "Jonathan Mini" Aq mini@FreeBSD.org ,
-.An "Daniel Eischen" Aq deischen@FreeBSD.org ,
+.An Jonathan Mini Aq Mt mini@FreeBSD.org ,
+.An Daniel Eischen Aq Mt deischen@FreeBSD.org ,
 and
-.An "David Xu" Aq davidxu@FreeBSD.org .
+.An David Xu Aq Mt davidxu@FreeBSD.org .
 .Pp
 This manual page was written by
-.An "Archie Cobbs" Aq archie@FreeBSD.org .
+.An Archie Cobbs Aq Mt archie@FreeBSD.org .
 .Sh BUGS
 The KSE code is
 .Ud

Modified: head/lib/libc/sys/pdfork.2
==============================================================================
--- head/lib/libc/sys/pdfork.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/pdfork.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -188,9 +188,9 @@ Project.
 .Sh AUTHORS
 .An -nosplit
 These functions and the capability facility were created by
-.An "Robert N. M. Watson" Aq rwatson@FreeBSD.org
+.An Robert N. M. Watson Aq Mt rwatson@FreeBSD.org
 and
-.An "Jonathan Anderson" Aq jonathan@FreeBSD.org
+.An Jonathan Anderson Aq Mt jonathan@FreeBSD.org
 at the University of Cambridge Computer Laboratory with support from a grant
 from Google, Inc.
 .Sh BUGS

Modified: head/lib/libc/sys/posix_fallocate.2
==============================================================================
--- head/lib/libc/sys/posix_fallocate.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/posix_fallocate.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -141,4 +141,4 @@ function appeared in
 .Sh AUTHORS
 .Fn posix_fallocate
 and this manual page were initially written by
-.An Matthew Fleming Aq mdf@FreeBSD.org .
+.An Matthew Fleming Aq Mt mdf@FreeBSD.org .

Modified: head/lib/libc/sys/posix_openpt.2
==============================================================================
--- head/lib/libc/sys/posix_openpt.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/posix_openpt.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -137,4 +137,4 @@ is included for compatibility; in
 opening a terminal does not cause it to become a process's controlling
 terminal.
 .Sh AUTHORS
-.An Ed Schouten Aq ed@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org

Modified: head/lib/libc/sys/pselect.2
==============================================================================
--- head/lib/libc/sys/pselect.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/pselect.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -120,4 +120,4 @@ function first appeared in
 The first implementation of
 .Fn pselect
 function and this manual page were written by
-.An Garrett Wollman Aq wollman@FreeBSD.org .
+.An Garrett Wollman Aq Mt wollman@FreeBSD.org .

Modified: head/lib/libc/sys/rtprio.2
==============================================================================
--- head/lib/libc/sys/rtprio.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/rtprio.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -188,7 +188,7 @@ The specified process or thread was not 
 .Sh AUTHORS
 .An -nosplit
 The original author was
-.An Henrik Vestergaard Draboel Aq hvd@terry.ping.dk .
+.An Henrik Vestergaard Draboel Aq Mt hvd@terry.ping.dk .
 This implementation in
 .Fx
 was substantially rewritten by

Modified: head/lib/libc/sys/sendfile.2
==============================================================================
--- head/lib/libc/sys/sendfile.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/sendfile.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -315,4 +315,4 @@ The
 .Fn sendfile
 system call
 and this manual page were written by
-.An David G. Lawrence Aq dg@dglawrence.com .
+.An David G. Lawrence Aq Mt dg@dglawrence.com .

Modified: head/lib/libc/sys/shm_open.2
==============================================================================
--- head/lib/libc/sys/shm_open.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/shm_open.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -275,8 +275,8 @@ The functions were reimplemented as syst
 directly rather than files in
 .Fx 8.0 .
 .Sh AUTHORS
-.An Garrett A. Wollman Aq wollman@FreeBSD.org
+.An Garrett A. Wollman Aq Mt wollman@FreeBSD.org
 (C library support and this manual page)
 .Pp
-.An Matthew Dillon Aq dillon@FreeBSD.org
+.An Matthew Dillon Aq Mt dillon@FreeBSD.org
 .Pq Dv MAP_NOSYNC

Modified: head/lib/libc/sys/shutdown.2
==============================================================================
--- head/lib/libc/sys/shutdown.2	Mon Jun 23 08:23:05 2014	(r267773)
+++ head/lib/libc/sys/shutdown.2	Mon Jun 23 08:25:03 2014	(r267774)
@@ -171,7 +171,7 @@ constants appeared in
 .Sh AUTHORS
 .An -nosplit
 This manual page was updated by
-.An Bruce M. Simpson Aq bms@FreeBSD.org
+.An Bruce M. Simpson Aq Mt bms@FreeBSD.org
 to reflect how
 .Fn shutdown
 behaves with

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 08:27:39 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4862657A;
 Mon, 23 Jun 2014 08:27:39 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3301B2BE5;
 Mon, 23 Jun 2014 08:27:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5N8Rdrw091348;
 Mon, 23 Jun 2014 08:27:39 GMT (envelope-from bapt@svn.freebsd.org)
Received: (from bapt@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5N8RR7u091248;
 Mon, 23 Jun 2014 08:27:27 GMT (envelope-from bapt@svn.freebsd.org)
Message-Id: <201406230827.s5N8RR7u091248@svn.freebsd.org>
From: Baptiste Daroussin 
Date: Mon, 23 Jun 2014 08:27:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267776 - in head/share/man: man1 man3 man5 man7 man8
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 08:27:39 -0000

Author: bapt
Date: Mon Jun 23 08:27:27 2014
New Revision: 267776
URL: http://svnweb.freebsd.org/changeset/base/267776

Log:
  use .Mt to mark up email addresses consistently (part6)
  
  PR:		191174
  Submitted by:	Franco Fichtner 

Modified:
  head/share/man/man1/builtin.1
  head/share/man/man3/ATOMIC_VAR_INIT.3
  head/share/man/man3/pthread_affinity_np.3
  head/share/man/man3/pthread_atfork.3
  head/share/man/man3/pthread_attr_affinity_np.3
  head/share/man/man3/pthread_attr_get_np.3
  head/share/man/man3/pthread_attr_setcreatesuspend_np.3
  head/share/man/man3/pthread_cancel.3
  head/share/man/man3/pthread_getcpuclockid.3
  head/share/man/man3/pthread_getthreadid_np.3
  head/share/man/man3/pthread_main_np.3
  head/share/man/man3/pthread_multi_np.3
  head/share/man/man3/pthread_resume_all_np.3
  head/share/man/man3/pthread_resume_np.3
  head/share/man/man3/pthread_set_name_np.3
  head/share/man/man3/pthread_suspend_all_np.3
  head/share/man/man3/pthread_suspend_np.3
  head/share/man/man3/pthread_switch_add_np.3
  head/share/man/man3/pthread_testcancel.3
  head/share/man/man3/siginfo.3
  head/share/man/man5/bluetooth.device.conf.5
  head/share/man/man5/bluetooth.hosts.5
  head/share/man/man5/bluetooth.protocols.5
  head/share/man/man5/boot.config.5
  head/share/man/man5/devfs.5
  head/share/man/man5/devfs.conf.5
  head/share/man/man5/devfs.rules.5
  head/share/man/man5/elf.5
  head/share/man/man5/ext2fs.5
  head/share/man/man5/fdescfs.5
  head/share/man/man5/freebsd-update.conf.5
  head/share/man/man5/libmap.conf.5
  head/share/man/man5/mailer.conf.5
  head/share/man/man5/make.conf.5
  head/share/man/man5/mqueuefs.5
  head/share/man/man5/msdosfs.5
  head/share/man/man5/nandfs.5
  head/share/man/man5/nsmb.conf.5
  head/share/man/man5/nsswitch.conf.5
  head/share/man/man5/nullfs.5
  head/share/man/man5/periodic.conf.5
  head/share/man/man5/portindex.5
  head/share/man/man5/portsnap.conf.5
  head/share/man/man5/reiserfs.5
  head/share/man/man5/tmpfs.5
  head/share/man/man7/build.7
  head/share/man/man7/c99.7
  head/share/man/man7/development.7
  head/share/man/man7/release.7
  head/share/man/man7/sdoc.7
  head/share/man/man7/sprog.7
  head/share/man/man7/tuning.7
  head/share/man/man8/hv_kvp_daemon.8
  head/share/man/man8/nanobsd.8
  head/share/man/man8/picobsd.8
  head/share/man/man8/rescue.8

Modified: head/share/man/man1/builtin.1
==============================================================================
--- head/share/man/man1/builtin.1	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man1/builtin.1	Mon Jun 23 08:27:27 2014	(r267776)
@@ -329,4 +329,4 @@ manual page first appeared in
 .Fx 3.4 .
 .Sh AUTHORS
 This manual page was written by
-.An Sheldon Hearn Aq sheldonh@FreeBSD.org .
+.An Sheldon Hearn Aq Mt sheldonh@FreeBSD.org .

Modified: head/share/man/man3/ATOMIC_VAR_INIT.3
==============================================================================
--- head/share/man/man3/ATOMIC_VAR_INIT.3	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man3/ATOMIC_VAR_INIT.3	Mon Jun 23 08:27:27 2014	(r267776)
@@ -297,5 +297,5 @@ These macros attempt to conform to
 These macros appeared in
 .Fx 10.0 .
 .Sh AUTHORS
-.An Ed Schouten Aq ed@FreeBSD.org ,
-.An David Chisnall Aq theraven@FreeBSD.org
+.An Ed Schouten Aq Mt ed@FreeBSD.org
+.An David Chisnall Aq Mt theraven@FreeBSD.org

Modified: head/share/man/man3/pthread_affinity_np.3
==============================================================================
--- head/share/man/man3/pthread_affinity_np.3	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man3/pthread_affinity_np.3	Mon Jun 23 08:27:27 2014	(r267776)
@@ -148,8 +148,6 @@ The
 and
 .Nm pthread_setaffinity_np
 functions were written by
-.An David Xu
-.Aq davidxu@FreeBSD.org ,
+.An David Xu Aq Mt davidxu@FreeBSD.org ,
 and this manpage was written by
-.An Xin LI
-.Aq delphij@FreeBSD.org .
+.An Xin LI Aq Mt delphij@FreeBSD.org .

Modified: head/share/man/man3/pthread_atfork.3
==============================================================================
--- head/share/man/man3/pthread_atfork.3	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man3/pthread_atfork.3	Mon Jun 23 08:27:27 2014	(r267776)
@@ -113,5 +113,4 @@ function is expected to conform to
 .St -p1003.1 .
 .Sh AUTHORS
 This manpage was written by
-.An Alex Vasylenko
-.Aq lxv@omut.org .
+.An Alex Vasylenko Aq Mt lxv@omut.org .

Modified: head/share/man/man3/pthread_attr_affinity_np.3
==============================================================================
--- head/share/man/man3/pthread_attr_affinity_np.3	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man3/pthread_attr_affinity_np.3	Mon Jun 23 08:27:27 2014	(r267776)
@@ -156,6 +156,6 @@ The
 and
 .Nm pthread_attr_setaffinity_np
 functions were written by
-.An David Xu Aq davidxu@FreeBSD.org ,
+.An David Xu Aq Mt davidxu@FreeBSD.org ,
 and this manpage was written by
-.An Xin LI Aq delphij@FreeBSD.org .
+.An Xin LI Aq Mt delphij@FreeBSD.org .

Modified: head/share/man/man3/pthread_attr_get_np.3
==============================================================================
--- head/share/man/man3/pthread_attr_get_np.3	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man3/pthread_attr_get_np.3	Mon Jun 23 08:27:27 2014	(r267776)
@@ -112,5 +112,4 @@ thread ID.
 The
 .Fn pthread_attr_get_np
 function and this manual page were written by
-.An Alexey Zelkin
-.Aq phantom@FreeBSD.org .
+.An Alexey Zelkin Aq Mt phantom@FreeBSD.org .

Modified: head/share/man/man3/pthread_attr_setcreatesuspend_np.3
==============================================================================
--- head/share/man/man3/pthread_attr_setcreatesuspend_np.3	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man3/pthread_attr_setcreatesuspend_np.3	Mon Jun 23 08:27:27 2014	(r267776)
@@ -69,4 +69,4 @@ is invalid.
 .Xr pthread_resume_np 3
 .Sh AUTHORS
 This manual page was written by
-.An Alexey Zelkin Aq phantom@FreeBSD.org .
+.An Alexey Zelkin Aq Mt phantom@FreeBSD.org .

Modified: head/share/man/man3/pthread_cancel.3
==============================================================================
--- head/share/man/man3/pthread_cancel.3	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man3/pthread_cancel.3	Mon Jun 23 08:27:27 2014	(r267776)
@@ -74,7 +74,7 @@ function conforms to
 .St -p1003.1-96 .
 .Sh AUTHORS
 This manual page was written by
-.An David Leonard Aq d@openbsd.org
+.An David Leonard Aq Mt d@openbsd.org
 for the
 .Ox
 implementation of

Modified: head/share/man/man3/pthread_getcpuclockid.3
==============================================================================
--- head/share/man/man3/pthread_getcpuclockid.3	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man3/pthread_getcpuclockid.3	Mon Jun 23 08:27:27 2014	(r267776)
@@ -81,4 +81,4 @@ The
 function first appeared in
 .Fx 10.0 .
 .Sh AUTHORS
-.An David Xu Aq davidxu@FreeBSD.org
+.An David Xu Aq Mt davidxu@FreeBSD.org

Modified: head/share/man/man3/pthread_getthreadid_np.3
==============================================================================
--- head/share/man/man3/pthread_getthreadid_np.3	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man3/pthread_getthreadid_np.3	Mon Jun 23 08:27:27 2014	(r267776)
@@ -53,4 +53,4 @@ None.
 .Xr pthread_self 3
 .Sh AUTHORS
 This manual page was written by
-.An Jung-uk Kim Aq jkim@FreeBSD.org .
+.An Jung-uk Kim Aq Mt jkim@FreeBSD.org .

Modified: head/share/man/man3/pthread_main_np.3
==============================================================================
--- head/share/man/man3/pthread_main_np.3	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man3/pthread_main_np.3	Mon Jun 23 08:27:27 2014	(r267776)
@@ -57,4 +57,4 @@ and \-1 if the thread's initialization h
 .Xr pthread_self 3
 .Sh AUTHORS
 This manual page was written by
-.An Alexey Zelkin Aq phantom@FreeBSD.org .
+.An Alexey Zelkin Aq Mt phantom@FreeBSD.org .

Modified: head/share/man/man3/pthread_multi_np.3
==============================================================================
--- head/share/man/man3/pthread_multi_np.3	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man3/pthread_multi_np.3	Mon Jun 23 08:27:27 2014	(r267776)
@@ -63,4 +63,4 @@ functions always return 0.
 .Xr pthread_suspend_all_np 3
 .Sh AUTHORS
 This manual page was written by
-.An Alexey Zelkin Aq phantom@FreeBSD.org .
+.An Alexey Zelkin Aq Mt phantom@FreeBSD.org .

Modified: head/share/man/man3/pthread_resume_all_np.3
==============================================================================
--- head/share/man/man3/pthread_resume_all_np.3	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man3/pthread_resume_all_np.3	Mon Jun 23 08:27:27 2014	(r267776)
@@ -48,4 +48,4 @@ and resumes those which were previously 
 .Xr pthread_suspend_np 3
 .Sh AUTHORS
 This manual page was written by
-.An Alexey Zelkin Aq phantom@FreeBSD.org .
+.An Alexey Zelkin Aq Mt phantom@FreeBSD.org .

Modified: head/share/man/man3/pthread_resume_np.3
==============================================================================
--- head/share/man/man3/pthread_resume_np.3	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man3/pthread_resume_np.3	Mon Jun 23 08:27:27 2014	(r267776)
@@ -69,4 +69,4 @@ argument.
 .Xr pthread_suspend_np 3
 .Sh AUTHORS
 This manual page was written by
-.An Alexey Zelkin Aq phantom@FreeBSD.org .
+.An Alexey Zelkin Aq Mt phantom@FreeBSD.org .

Modified: head/share/man/man3/pthread_set_name_np.3
==============================================================================
--- head/share/man/man3/pthread_set_name_np.3	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man3/pthread_set_name_np.3	Mon Jun 23 08:27:27 2014	(r267776)
@@ -49,4 +49,4 @@ Because of the debugging nature of this 
 appear inside are silently ignored.
 .Sh AUTHORS
 This manual page was written by
-.An Alexey Zelkin Aq phantom@FreeBSD.org .
+.An Alexey Zelkin Aq Mt phantom@FreeBSD.org .

Modified: head/share/man/man3/pthread_suspend_all_np.3
==============================================================================
--- head/share/man/man3/pthread_suspend_all_np.3	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man3/pthread_suspend_all_np.3	Mon Jun 23 08:27:27 2014	(r267776)
@@ -50,4 +50,4 @@ function.
 .Xr pthread_suspend_np 3
 .Sh AUTHORS
 This manual page was written by
-.An Alexey Zelkin Aq phantom@FreeBSD.org .
+.An Alexey Zelkin Aq Mt phantom@FreeBSD.org .

Modified: head/share/man/man3/pthread_suspend_np.3
==============================================================================
--- head/share/man/man3/pthread_suspend_np.3	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man3/pthread_suspend_np.3	Mon Jun 23 08:27:27 2014	(r267776)
@@ -67,4 +67,4 @@ argument.
 .Xr pthread_suspend_all_np 3
 .Sh AUTHORS
 This manual page was written by
-.An Alexey Zelkin Aq phantom@FreeBSD.org .
+.An Alexey Zelkin Aq Mt phantom@FreeBSD.org .

Modified: head/share/man/man3/pthread_switch_add_np.3
==============================================================================
--- head/share/man/man3/pthread_switch_add_np.3	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man3/pthread_switch_add_np.3	Mon Jun 23 08:27:27 2014	(r267776)
@@ -84,4 +84,4 @@ function.
 .Xr pthread_create 3
 .Sh AUTHORS
 This manual page was written by
-.An Alexey Zelkin Aq phantom@FreeBSD.org .
+.An Alexey Zelkin Aq Mt phantom@FreeBSD.org .

Modified: head/share/man/man3/pthread_testcancel.3
==============================================================================
--- head/share/man/man3/pthread_testcancel.3	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man3/pthread_testcancel.3	Mon Jun 23 08:27:27 2014	(r267776)
@@ -236,7 +236,7 @@ The standard allows implementations to m
 cancellation points.
 .Sh AUTHORS
 This manual page was written by
-.An David Leonard Aq d@openbsd.org
+.An David Leonard Aq Mt d@openbsd.org
 for the
 .Ox
 implementation of

Modified: head/share/man/man3/siginfo.3
==============================================================================
--- head/share/man/man3/siginfo.3	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man3/siginfo.3	Mon Jun 23 08:27:27 2014	(r267776)
@@ -337,4 +337,4 @@ can be generated as of
 .Fx 9.0 .
 .Sh AUTHORS
 This manual page was written by
-.An "David Xu" Aq davidxu@FreeBSD.org .
+.An David Xu Aq Mt davidxu@FreeBSD.org .

Modified: head/share/man/man5/bluetooth.device.conf.5
==============================================================================
--- head/share/man/man5/bluetooth.device.conf.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/bluetooth.device.conf.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -183,4 +183,4 @@ second USB Bluetooth device.
 .Xr hcsecd 8 ,
 .Xr l2control 8
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com

Modified: head/share/man/man5/bluetooth.hosts.5
==============================================================================
--- head/share/man/man5/bluetooth.hosts.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/bluetooth.hosts.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -60,4 +60,4 @@ delimiter, newline, or comment character
 .Sh SEE ALSO
 .Xr bluetooth 3
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com

Modified: head/share/man/man5/bluetooth.protocols.5
==============================================================================
--- head/share/man/man5/bluetooth.protocols.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/bluetooth.protocols.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -59,4 +59,4 @@ character other than a field delimiter, 
 .Sh SEE ALSO
 .Xr bluetooth 3
 .Sh AUTHORS
-.An Maksim Yevmenkin Aq m_evmenkin@yahoo.com
+.An Maksim Yevmenkin Aq Mt m_evmenkin@yahoo.com

Modified: head/share/man/man5/boot.config.5
==============================================================================
--- head/share/man/man5/boot.config.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/boot.config.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -100,4 +100,4 @@ will do both of the above.
 .Xr loader 8
 .Sh AUTHORS
 This manual page was written by
-.An Daniel Gerzo Aq danger@FreeBSD.org .
+.An Daniel Gerzo Aq Mt danger@FreeBSD.org .

Modified: head/share/man/man5/devfs.5
==============================================================================
--- head/share/man/man5/devfs.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/devfs.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -145,4 +145,4 @@ manual page first appeared in
 The
 .Nm
 manual page was written by
-.An Mike Pritchard Aq mpp@FreeBSD.org .
+.An Mike Pritchard Aq Mt mpp@FreeBSD.org .

Modified: head/share/man/man5/devfs.conf.5
==============================================================================
--- head/share/man/man5/devfs.conf.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/devfs.conf.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -135,4 +135,4 @@ perm	cd0	0660
 .Xr chown 8
 .Sh AUTHORS
 This manual page was written by
-.An "Roland Smith" Aq rsmith@xs4all.nl .
+.An Roland Smith Aq Mt rsmith@xs4all.nl .

Modified: head/share/man/man5/devfs.rules.5
==============================================================================
--- head/share/man/man5/devfs.rules.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/devfs.rules.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -124,4 +124,4 @@ group, a similar rule may be used:
 .Xr devfs 8
 .Sh AUTHORS
 This manual page was written by
-.An "Roland Smith" Aq rsmith@xs4all.nl .
+.An Roland Smith Aq Mt rsmith@xs4all.nl .

Modified: head/share/man/man5/elf.5
==============================================================================
--- head/share/man/man5/elf.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/elf.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -1305,8 +1305,7 @@ ELF in itself first appeared in
 The ELF format is an adopted standard.
 .Sh AUTHORS
 This manual page was written by
-.An Jeroen Ruigrok van der Werven
-.Aq asmodai@FreeBSD.org
+.An Jeroen Ruigrok van der Werven Aq Mt asmodai@FreeBSD.org
 with inspiration from BSDi's
 .Bsx
 .Xr elf 5

Modified: head/share/man/man5/ext2fs.5
==============================================================================
--- head/share/man/man5/ext2fs.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/ext2fs.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -80,4 +80,4 @@ and others in the
 Project made modifications.
 .Pp
 This manual page was written by
-.An Craig Rodrigues Aq rodrigc@FreeBSD.org .
+.An Craig Rodrigues Aq Mt rodrigc@FreeBSD.org .

Modified: head/share/man/man5/fdescfs.5
==============================================================================
--- head/share/man/man5/fdescfs.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/fdescfs.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -120,7 +120,7 @@ manual page first appeared in
 The
 .Nm
 manual page was written by
-.An Mike Pritchard Aq mpp@FreeBSD.org ,
+.An Mike Pritchard Aq Mt mpp@FreeBSD.org ,
 and was based on the
 manual page written by
 .An Jan-Simon Pendry .

Modified: head/share/man/man5/freebsd-update.conf.5
==============================================================================
--- head/share/man/man5/freebsd-update.conf.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/freebsd-update.conf.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -230,4 +230,4 @@ configuration file.
 .Xr sha256 1 ,
 .Xr freebsd-update 8
 .Sh AUTHORS
-.An Colin Percival Aq cperciva@FreeBSD.org
+.An Colin Percival Aq Mt cperciva@FreeBSD.org

Modified: head/share/man/man5/libmap.conf.5
==============================================================================
--- head/share/man/man5/libmap.conf.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/libmap.conf.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -174,7 +174,8 @@ The
 mechanism first appeared in
 .Fx 5.1 .
 .Sh AUTHORS
+.An -nosplit
 This manual page was written by
-.An Matthew N. Dodd Aq winter@jurai.net
+.An Matthew N. Dodd Aq Mt winter@jurai.net
 and extensively rewritten by
-.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org .
+.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .

Modified: head/share/man/man5/mailer.conf.5
==============================================================================
--- head/share/man/man5/mailer.conf.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/mailer.conf.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -153,7 +153,7 @@ send-mail	/usr/local/bin/mini_sendmail -
 appeared in
 .Nx 1.4 .
 .Sh AUTHORS
-.An Perry E. Metzger Aq perry@piermont.com
+.An Perry E. Metzger Aq Mt perry@piermont.com
 .Sh BUGS
 The entire reason this program exists is a crock.
 Instead, a command

Modified: head/share/man/man5/make.conf.5
==============================================================================
--- head/share/man/man5/make.conf.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/make.conf.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -145,7 +145,7 @@ are not supported.
 is provided as a set of
 .Xr cc 1
 settings suggested by
-.An "Bruce Evans" Aq bde@FreeBSD.org
+.An Bruce Evans Aq Mt bde@FreeBSD.org
 for developing and testing changes.
 They can be used, if set, by:
 .Bd -literal -offset indent
@@ -692,7 +692,7 @@ file appeared sometime before
 .Sh AUTHORS
 This
 manual page was written by
-.An Mike W. Meyer Aq mwm@mired.org .
+.An Mike W. Meyer Aq Mt mwm@mired.org .
 .Sh CAVEATS
 Note, that
 .Ev MAKEOBJDIRPREFIX

Modified: head/share/man/man5/mqueuefs.5
==============================================================================
--- head/share/man/man5/mqueuefs.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/mqueuefs.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -121,4 +121,4 @@ To see the queue's attributes, just read
 .Xr umount 8
 .Sh AUTHORS
 This manual page was written by
-.An "David Xu" Aq davidxu@FreeBSD.org .
+.An David Xu Aq Mt davidxu@FreeBSD.org .

Modified: head/share/man/man5/msdosfs.5
==============================================================================
--- head/share/man/man5/msdosfs.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/msdosfs.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -66,4 +66,4 @@ directory layout.
 .Xr umount 8
 .Sh AUTHORS
 This manual page was written by
-.An Tom Rhodes Aq trhodes@FreeBSD.org .
+.An Tom Rhodes Aq Mt trhodes@FreeBSD.org .

Modified: head/share/man/man5/nandfs.5
==============================================================================
--- head/share/man/man5/nandfs.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/nandfs.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -114,15 +114,18 @@ code diverged significantly and is by no
 .Pp
 The NAND Flash file system first appeared in
 .Fx 10.0 .
-.Sh AUTHOR
+.Sh AUTHORS
+.An -nosplit
 The NAND FS was written by
-.An Grzegorz Bernacki with the help of
+.An Grzegorz Bernacki
+with the help of
 .An Mateusz Guzik ,
 based on the NetBSD code created by
 .An Reinoud Zandijk .
 Additional help and support by
 .An Lukasz Plachno ,
-.An Jan Sieka and
+.An Jan Sieka
+and
 .An Lukasz Wojcik .
 This manual page was written by
 .An Rafal Jaworowski .

Modified: head/share/man/man5/nsmb.conf.5
==============================================================================
--- head/share/man/man5/nsmb.conf.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/nsmb.conf.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -147,6 +147,6 @@ smbutil crypt
 .Sh AUTHORS
 This manual page was written by
 .An -nosplit
-.An Sergey Osokin Aq osa@FreeBSD.org
+.An Sergey Osokin Aq Mt osa@FreeBSD.org
 and
-.An Tom Rhodes Aq trhodes@FreeBSD.org .
+.An Tom Rhodes Aq Mt trhodes@FreeBSD.org .

Modified: head/share/man/man5/nsswitch.conf.5
==============================================================================
--- head/share/man/man5/nsswitch.conf.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/nsswitch.conf.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -373,8 +373,7 @@ It was imported from the
 Project, where it appeared first in
 .Nx 1.4 .
 .Sh AUTHORS
-Luke Mewburn
-.Aq lukem@netbsd.org
+.An Luke Mewburn Aq Mt lukem@netbsd.org
 wrote this freely distributable name-service switch implementation,
 using ideas from the
 .Tn ULTRIX

Modified: head/share/man/man5/nullfs.5
==============================================================================
--- head/share/man/man5/nullfs.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/nullfs.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -72,4 +72,4 @@ kernel implementation was written by
 .An John Heideman .
 .Pp
 This manual page was written by
-.An Daniel Gerzo Aq danger@FreeBSD.org .
+.An Daniel Gerzo Aq Mt danger@FreeBSD.org .

Modified: head/share/man/man5/periodic.conf.5
==============================================================================
--- head/share/man/man5/periodic.conf.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/periodic.conf.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -973,4 +973,4 @@ The
 file appeared in
 .Fx 4.1 .
 .Sh AUTHORS
-.An Brian Somers Aq brian@Awfulhak.org
+.An Brian Somers Aq Mt brian@Awfulhak.org

Modified: head/share/man/man5/portindex.5
==============================================================================
--- head/share/man/man5/portindex.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/portindex.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -97,4 +97,4 @@ vim-6.3.15|/usr/ports/editors/vim|/usr/l
 This manual page was written by
 .An Paul Armstrong
 and
-.An Thomas Abthorpe Aq tabthorpe@FreeBSD.org .
+.An Thomas Abthorpe Aq Mt tabthorpe@FreeBSD.org .

Modified: head/share/man/man5/portsnap.conf.5
==============================================================================
--- head/share/man/man5/portsnap.conf.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/portsnap.conf.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -144,4 +144,4 @@ Default location of the portsnap configu
 .Xr portsnap 8 ,
 .Xr sha256 8
 .Sh AUTHORS
-.An Colin Percival Aq cperciva@FreeBSD.org
+.An Colin Percival Aq Mt cperciva@FreeBSD.org

Modified: head/share/man/man5/reiserfs.5
==============================================================================
--- head/share/man/man5/reiserfs.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/reiserfs.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -74,10 +74,10 @@ The ReiserFS kernel implementation was w
 and ported to
 .Fx
 by
-.An Jean-S\['e]bastien P\['e]dron Aq dumbbell@FreeBSD.org .
+.An Jean-S\['e]bastien P\['e]dron Aq Mt dumbbell@FreeBSD.org .
 .Pp
 This manual page was written by
-.An Craig Rodrigues Aq rodrigc@FreeBSD.org .
+.An Craig Rodrigues Aq Mt rodrigc@FreeBSD.org .
 .Sh CAVEATS
 Currently, only read-only access is supported for ReiserFS volumes,
 writing to a volume is not supported.

Modified: head/share/man/man5/tmpfs.5
==============================================================================
--- head/share/man/man5/tmpfs.5	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man5/tmpfs.5	Mon Jun 23 08:27:27 2014	(r267776)
@@ -129,7 +129,7 @@ driver first appeared in
 The
 .Nm
 kernel implementation was written by
-.An Julio M. Merino Vidal Aq jmmv@NetBSD.org
+.An Julio M. Merino Vidal Aq Mt jmmv@NetBSD.org
 as a Google SoC project.
 .Pp
 .An Rohit Jalan
@@ -139,6 +139,6 @@ to
 .Fx .
 .Pp
 This manual page was written by
-.An Xin LI Aq delphij@FreeBSD.org .
+.An Xin LI Aq Mt delphij@FreeBSD.org .
 .Sh BUGS
 Some file system mount time options may not be well-supported.

Modified: head/share/man/man7/build.7
==============================================================================
--- head/share/man/man7/build.7	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man7/build.7	Mon Jun 23 08:27:27 2014	(r267776)
@@ -630,4 +630,4 @@ make TARGET=sparc64 DESTDIR=/clients/spa
 .Xr reboot 8 ,
 .Xr shutdown 8
 .Sh AUTHORS
-.An Mike W. Meyer Aq mwm@mired.org .
+.An Mike W. Meyer Aq Mt mwm@mired.org

Modified: head/share/man/man7/c99.7
==============================================================================
--- head/share/man/man7/c99.7	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man7/c99.7	Mon Jun 23 08:27:27 2014	(r267776)
@@ -180,4 +180,4 @@ This manual page first appeared in
 .Fx 9.0 .
 .Sh AUTHORS
 This manual page was originally written by
-.An Gabor Kovesdan Aq gabor@FreeBSD.org .
+.An Gabor Kovesdan Aq Mt gabor@FreeBSD.org .

Modified: head/share/man/man7/development.7
==============================================================================
--- head/share/man/man7/development.7	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man7/development.7	Mon Jun 23 08:27:27 2014	(r267776)
@@ -467,14 +467,14 @@ operations you do will be done as
 The
 .Nm
 manual page was originally written by
-.An Matthew Dillon Aq dillon@FreeBSD.org
+.An Matthew Dillon Aq Mt dillon@FreeBSD.org
 and first appeared
 in
 .Fx 5.0 ,
 December 2002.
 It was since extensively modified by
-.An Eitan Adler Aq eadler@FreeBSD.org
+.An Eitan Adler Aq Mt eadler@FreeBSD.org
 to reflect the repository conversion from
-.Xr cvs
+.Xr cvs 1
 to
-.Xr svn .
+.Xr svn 1 .

Modified: head/share/man/man7/release.7
==============================================================================
--- head/share/man/man7/release.7	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man7/release.7	Mon Jun 23 08:27:27 2014	(r267776)
@@ -636,10 +636,10 @@ and
 .An Poul-Henning Kamp .
 .Pp
 This manual page was originally written by
-.An Murray Stokely Aq murray@FreeBSD.org .
+.An Murray Stokely Aq Mt murray@FreeBSD.org .
 .Pp
 It was updated by
-.An Nathan Whitehorn Aq nwhitehorn@FreeBSD.org
+.An Nathan Whitehorn Aq Mt nwhitehorn@FreeBSD.org
 to include the
 .Fa generate-release.sh
 script used for the
@@ -647,7 +647,7 @@ script used for the
 release cycle.
 .Pp
 It was later updated by
-.An Glen Barber Aq gjb@FreeBSD.org
+.An Glen Barber Aq Mt gjb@FreeBSD.org
 to include the
 .Fa release.sh
 script used for the

Modified: head/share/man/man7/sdoc.7
==============================================================================
--- head/share/man/man7/sdoc.7	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man7/sdoc.7	Mon Jun 23 08:27:27 2014	(r267776)
@@ -237,5 +237,7 @@ The
 manual page first appeared in
 .Fx 5.0 .
 .Sh AUTHORS
-.An "Tim Fraser, NAI Labs CBOSS project." Aq tfraser@tislabs.com
-.An "Brian Feldman, NAI Labs CBOSS project." Aq bfeldman@tislabs.com
+.An Tim Fraser Aq Mt tfraser@tislabs.com ,
+NAI Labs CBOSS project
+.An Brian Feldman Aq Mt bfeldman@tislabs.com ,
+NAI Labs CBOSS project

Modified: head/share/man/man7/sprog.7
==============================================================================
--- head/share/man/man7/sprog.7	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man7/sprog.7	Mon Jun 23 08:27:27 2014	(r267776)
@@ -173,8 +173,8 @@ properly beforehand.
 .Xr strlcpy 3
 .Sh AUTHORS
 .An -nosplit
-.An Eric Melville Aq eric@FreeBSD.org
+.An Eric Melville Aq Mt eric@FreeBSD.org
 originally wrote this document based on a chapter of the
 .%B "FreeBSD Developer's Handbook"
 written by
-.An Murray Stokely Aq murray@FreeBSD.org .
+.An Murray Stokely Aq Mt murray@FreeBSD.org .

Modified: head/share/man/man7/tuning.7
==============================================================================
--- head/share/man/man7/tuning.7	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man7/tuning.7	Mon Jun 23 08:27:27 2014	(r267776)
@@ -778,4 +778,4 @@ in
 .Fx 4.3 ,
 May 2001.
 The manual page was greatly modified by
-.An Eitan Adler Aq eadler@FreeBSD.org
+.An Eitan Adler Aq Mt eadler@FreeBSD.org .

Modified: head/share/man/man8/hv_kvp_daemon.8
==============================================================================
--- head/share/man/man8/hv_kvp_daemon.8	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man8/hv_kvp_daemon.8	Mon Jun 23 08:27:27 2014	(r267776)
@@ -93,4 +93,4 @@ Microsoft Corporation, and Network Appli
 support for
 .Nm
 was first added by
-.An Microsoft BSD Integration Services Team Aq bsdic@microsoft.com .
+.An Microsoft BSD Integration Services Team Aq Mt bsdic@microsoft.com .

Modified: head/share/man/man8/nanobsd.8
==============================================================================
--- head/share/man/man8/nanobsd.8	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man8/nanobsd.8	Mon Jun 23 08:27:27 2014	(r267776)
@@ -332,6 +332,6 @@ utility first appeared in
 .An -nosplit
 .Nm NanoBSD
 was developed by
-.An Poul-Henning Kamp Aq phk@FreeBSD.org .
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org .
 This manual page was written by
-.An Daniel Gerzo Aq danger@FreeBSD.org .
+.An Daniel Gerzo Aq Mt danger@FreeBSD.org .

Modified: head/share/man/man8/picobsd.8
==============================================================================
--- head/share/man/man8/picobsd.8	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man8/picobsd.8	Mon Jun 23 08:27:27 2014	(r267776)
@@ -650,13 +650,13 @@ already exists on disk (e.g.\& as a resu
 .Xr swapon 8
 .Sh AUTHORS
 .An -nosplit
-.An Andrzej Bialecki Aq abial@FreeBSD.org ,
+.An Andrzej Bialecki Aq Mt abial@FreeBSD.org ,
 with subsequent work on the scripts by
-.An Luigi Rizzo Aq luigi@iet.unipi.it
+.An Luigi Rizzo Aq Mt luigi@iet.unipi.it
 and others.
 Man page and
 .Pa Makefiles
 created by
-.An Greg Lehey Aq grog@lemis.com .
+.An Greg Lehey Aq Mt grog@lemis.com .
 .Sh BUGS
 Documentation is still incomplete.

Modified: head/share/man/man8/rescue.8
==============================================================================
--- head/share/man/man8/rescue.8	Mon Jun 23 08:27:15 2014	(r267775)
+++ head/share/man/man8/rescue.8	Mon Jun 23 08:27:27 2014	(r267776)
@@ -145,13 +145,13 @@ utilities first appeared in
 The
 .Nm
 system was written by
-.An Tim Kientzle Aq kientzle@FreeBSD.org ,
+.An Tim Kientzle Aq Mt kientzle@FreeBSD.org ,
 based on ideas taken from
 .Nx .
 This manual page was written by
-.An Simon L. Nielsen Aq simon@FreeBSD.org ,
+.An Simon L. Nielsen Aq Mt simon@FreeBSD.org ,
 based on text by
-.An Tim Kientzle Aq kientzle@FreeBSD.org .
+.An Tim Kientzle Aq Mt kientzle@FreeBSD.org .
 .Sh BUGS
 Most of the
 .Nm

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 10:33:07 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id DA8E155A
 for ; Mon, 23 Jun 2014 10:33:07 +0000 (UTC)
Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com
 [66.111.4.25])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A581D27D2
 for ; Mon, 23 Jun 2014 10:33:07 +0000 (UTC)
Received: from compute4.internal (compute4.nyi.mail.srv.osa [10.202.2.44])
 by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id EEC9C20F19
 for ; Mon, 23 Jun 2014 06:32:52 -0400 (EDT)
Received: from frontend1 ([10.202.2.160])
 by compute4.internal (MEProxy); Mon, 23 Jun 2014 06:32:52 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=
 message-id:date:from:mime-version:to:subject:references
 :in-reply-to:content-type:content-transfer-encoding; s=mesmtp;
 bh=z/MUz4hDoiQeEyEszqjwaeaLaHA=; b=UUShz2H8BtXnMBcFvpYRPjLrFQyB
 uiZTJGlI5XAvO3UjKXEOrdW6S08RpIjKKrCruojbw7lGSwoQOuH6mqc7Vp7Emju6
 xw0jjTw8zmy/OrrUHOBhF1RTLNJqLpmGUbcAAG/gu7QwJuQF60FjGxVkkQBIIQDa
 Q0f3k8XYruuoyS4=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
 messagingengine.com; h=message-id:date:from:mime-version:to
 :subject:references:in-reply-to:content-type
 :content-transfer-encoding; s=smtpout; bh=z/MUz4hDoiQeEyEszqjwae
 aLaHA=; b=pwmr3Caj+4raDAGvMsWAiRukCPINS0lAliSUTqtgPbSH94ouYdCP/Y
 gSQQlQopENmnx6ZIjN/jcjUZLTi8OOJqGzoSLDhROzedqFR3NOOmmAjqQvclS3ba
 /vH+UA+yKsmPEhbt3s/TAnTbu1wJGvagdLG82BK81Bp03d+Yxzw+A=
X-Sasl-enc: awZWU+phfK0/MDu4Xuate57CgEyoI0mYwQUCTp8hgdBM 1403519571
Received: from [192.168.1.66] (unknown [109.150.73.115])
 by mail.messagingengine.com (Postfix) with ESMTPA id 5A7EDC0000C;
 Mon, 23 Jun 2014 06:32:51 -0400 (EDT)
Message-ID: <53A80251.4020909@fastmail.net>
Date: Mon, 23 Jun 2014 11:32:49 +0100
From: Bruce Simpson 
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Hans Petter Selasky , 
 src-committers@freebsd.org, svn-src-all@freebsd.org, 
 svn-src-head@freebsd.org
Subject: Re: svn commit: r267633 - head/sys/sys
References: <201406190528.s5J5Sg8m099792@svn.freebsd.org>
In-Reply-To: <201406190528.s5J5Sg8m099792@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 10:33:07 -0000

On 19/06/2014 06:28, Hans Petter Selasky wrote:
> Author: hselasky
> Date: Thu Jun 19 05:28:42 2014
> New Revision: 267633
> URL: http://svnweb.freebsd.org/changeset/base/267633
>
> Log:
>    Initialize sysctl OID structure by record.

So, has there been any traction on rethinking / backing out this change 
(which breaks the compilation of C++ kernel modules) ?

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 10:33:39 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 69AA769B;
 Mon, 23 Jun 2014 10:33:39 +0000 (UTC)
Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "funkthat.com", Issuer "funkthat.com" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 4857527D6;
 Mon, 23 Jun 2014 10:33:38 +0000 (UTC)
Received: from h2.funkthat.com (localhost [127.0.0.1])
 by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s5NAXbvP033737
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Mon, 23 Jun 2014 03:33:38 -0700 (PDT)
 (envelope-from jmg@h2.funkthat.com)
Received: (from jmg@localhost)
 by h2.funkthat.com (8.14.3/8.14.3/Submit) id s5NAXbEm033736;
 Mon, 23 Jun 2014 03:33:37 -0700 (PDT) (envelope-from jmg)
Date: Mon, 23 Jun 2014 03:33:37 -0700
From: John-Mark Gurney 
To: Konstantin Belousov 
Subject: Re: svn commit: r267768 - head/share/man/man9
Message-ID: <20140623103337.GB31367@funkthat.com>
References: <201406230745.s5N7jix4071585@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201406230745.s5N7jix4071585@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
X-Operating-System: FreeBSD 7.2-RELEASE i386
X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88  9322 9CB1 8F74 6D3F A396
X-Files: The truth is out there
X-URL: http://resnet.uoregon.edu/~gurney_j/
X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html
X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE
X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger?
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2
 (h2.funkthat.com [127.0.0.1]); Mon, 23 Jun 2014 03:33:38 -0700 (PDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 10:33:39 -0000

Konstantin Belousov wrote this message on Mon, Jun 23, 2014 at 07:45 +0000:
> Author: kib
> Date: Mon Jun 23 07:45:44 2014
> New Revision: 267768
> URL: http://svnweb.freebsd.org/changeset/base/267768
> 
> Log:
>   Add documentation for the fpu_kern(9) interfaces.
>   
>   Many thanks to jmg for reviewing the (previous version) of the text
>   and providing grammar and content fixes.

And thanks to kib for writing it in the first place...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 12:43:31 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 81EC7CA5;
 Mon, 23 Jun 2014 12:43:31 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6EF002393;
 Mon, 23 Jun 2014 12:43:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5NChV61012309;
 Mon, 23 Jun 2014 12:43:31 GMT
 (envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5NChVPA012308;
 Mon, 23 Jun 2014 12:43:31 GMT
 (envelope-from brueffer@svn.freebsd.org)
Message-Id: <201406231243.s5NChVPA012308@svn.freebsd.org>
From: Christian Brueffer 
Date: Mon, 23 Jun 2014 12:43:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267785 - head/share/man/man9
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 12:43:31 -0000

Author: brueffer
Date: Mon Jun 23 12:43:30 2014
New Revision: 267785
URL: http://svnweb.freebsd.org/changeset/base/267785

Log:
  Several small fixes (typos, grammar, mdoc).

Modified:
  head/share/man/man9/fpu_kern.9

Modified: head/share/man/man9/fpu_kern.9
==============================================================================
--- head/share/man/man9/fpu_kern.9	Mon Jun 23 09:47:52 2014	(r267784)
+++ head/share/man/man9/fpu_kern.9	Mon Jun 23 12:43:30 2014	(r267785)
@@ -23,8 +23,8 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 21, 2014
-.Dt KERN_FPU 9
+.Dd June 23, 2014
+.Dt FPU_KERN 9
 .Os
 .Sh NAME
 .Nm fpu_kern
@@ -47,11 +47,11 @@ The
 .Nm
 family of functions allows the use of FPU hardware in kernel code.
 Modern FPUs are not limited to providing hardware implementation for
-floating point arithmetic, they offer advanced accelerators for cryptography
+floating point arithmetic; they offer advanced accelerators for cryptography
 and other computational-intensive algorithms.
 These facilities share registers with the FPU hardware.
 .Pp
-Typical kernel code does not need to access to the FPU.
+Typical kernel code does not need access to the FPU.
 Saving a large register file on each entry to the kernel would waste
 time.
 When kernel code uses the FPU, the current FPU state must be saved to
@@ -80,6 +80,7 @@ without sleep.
 .It 0
 No special handling is required.
 .El
+.Pp
 The function returns the allocated context area, or
 .Va NULL
 if the allocation failed.
@@ -121,6 +122,7 @@ The
 function correctly handles such contexts.
 .El
 .El
+.Pp
 The function does not sleep or block.
 It could cause the
 .Nm Device Not Available
@@ -173,7 +175,7 @@ and false otherwise.
 .Sh NOTES
 The
 .Nm
-is currently implemented only for i386 and amd64 architectures.
+is currently implemented only for the i386 and amd64 architectures.
 .Pp
 There is no way to handle floating point exceptions raised from
 kernel mode.

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 13:16:52 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id AA71A27F;
 Mon, 23 Jun 2014 13:16:52 +0000 (UTC)
Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 418FC26B0;
 Mon, 23 Jun 2014 13:16:52 +0000 (UTC)
Received: from alchemy.franken.de (localhost [127.0.0.1])
 by alchemy.franken.de (8.14.8/8.14.8/ALCHEMY.FRANKEN.DE) with ESMTP id
 s5NDGhmB015989
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Mon, 23 Jun 2014 15:16:44 +0200 (CEST)
 (envelope-from marius@alchemy.franken.de)
Received: (from marius@localhost)
 by alchemy.franken.de (8.14.8/8.14.8/Submit) id s5NDGhJI015988;
 Mon, 23 Jun 2014 15:16:43 +0200 (CEST) (envelope-from marius)
Date: Mon, 23 Jun 2014 15:16:43 +0200
From: Marius Strobl 
To: John-Mark Gurney 
Subject: Re: svn commit: r267712 - head/sys/dev/uart
Message-ID: <20140623131643.GB7615@alchemy.franken.de>
References: <201406220654.s5M6saB3066767@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201406220654.s5M6saB3066767@svn.freebsd.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3
 (alchemy.franken.de [0.0.0.0]); Mon, 23 Jun 2014 15:16:44 +0200 (CEST)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 13:16:52 -0000

On Sun, Jun 22, 2014 at 06:54:36AM +0000, John-Mark Gurney wrote:
> Author: jmg
> Date: Sun Jun 22 06:54:36 2014
> New Revision: 267712
> URL: http://svnweb.freebsd.org/changeset/base/267712
> 
> Log:
>   add support for MosChip MCS9922...  This is found on an ExpressCard..
>   
>   tested to work w/ cu talking to itself (the two ports connected via
>   null modem cable)...
> 

FYI, this is PR 186891.

Marius


From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 13:17:04 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C11C144E;
 Mon, 23 Jun 2014 13:17:04 +0000 (UTC)
Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com
 [IPv6:2a00:1450:400c:c05::231])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id D08D526B6;
 Mon, 23 Jun 2014 13:17:03 +0000 (UTC)
Received: by mail-wi0-f177.google.com with SMTP id r20so4237168wiv.16
 for ; Mon, 23 Jun 2014 06:16:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=P0sQ58MLt9wWZyAzPzBqoE+wfvV472Y4WOCt2kjuYyk=;
 b=dug2gRw9XkBFnftPiUhmPCSRFOZEGtZrCQ/SHP6z6voov/nd6elQqj988IpKbf1sBu
 aUsKnlQJLdVyQrrWKYpPxJEYJIaXdaJLstQRU5eVLM7nSQwEbytohMnX5qV5E049ScT2
 tGST23ENnZ5wzJtS433LLC4ADi2rm7m6E0gI/OlvzKTxEJETT4Un7GUo5W+evpD0ZVqE
 imbyxewMEL66kVs5n0LDERpzGrXCVEM3gbNcq2dvNLsBXZ2QhThrZOYugMr9ANqi7VSL
 ULG3wMuLYX8TG3yGtmRq8D5IEjiu8pd9rjBq564WH2sUvo4P6l8SH2l2Dxt/g5jGRQ80
 ZsFw==
X-Received: by 10.180.12.33 with SMTP id v1mr26478749wib.0.1403529418311;
 Mon, 23 Jun 2014 06:16:58 -0700 (PDT)
Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net.
 [2001:470:1f08:1f7::2])
 by mx.google.com with ESMTPSA id f6sm33336476wiy.19.2014.06.23.06.16.57
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Mon, 23 Jun 2014 06:16:57 -0700 (PDT)
Date: Mon, 23 Jun 2014 15:16:53 +0200
From: Mateusz Guzik 
To: Konstantin Belousov 
Subject: Re: svn commit: r267760 - head/sys/kern
Message-ID: <20140623131653.GC27040@dft-labs.eu>
References: <201406230128.s5N1SIYK097224@svn.freebsd.org>
 <20140623064044.GD93733@kib.kiev.ua>
 <20140623070652.GA27040@dft-labs.eu>
 <20140623072519.GE93733@kib.kiev.ua>
 <20140623080501.GB27040@dft-labs.eu>
 <20140623081823.GG93733@kib.kiev.ua>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20140623081823.GG93733@kib.kiev.ua>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Mateusz Guzik 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 13:17:04 -0000

On Mon, Jun 23, 2014 at 11:18:23AM +0300, Konstantin Belousov wrote:
> On Mon, Jun 23, 2014 at 10:05:01AM +0200, Mateusz Guzik wrote:
> > On Mon, Jun 23, 2014 at 10:25:19AM +0300, Konstantin Belousov wrote:
> > > On Mon, Jun 23, 2014 at 09:06:52AM +0200, Mateusz Guzik wrote:
> > > > The table is modified in these functions and is reachable from the rest
> > > > of the kernel (can be found by e.g. sysctl_kern_proc_filedesc), thus
> > > > XLOCK is needed to ensure consistency for readers. It can also be
> > > > altered by mountcheckdirs, although not in a way which disrupts any of
> > > > these functions.
> > > I would think that such cases should be avoided by testing for P_INEXEC,
> > > but I do not insist on this.
> > > 
> > 
> > proc lock has to be dropped before filedesc lock is taken and I don't
> > see any way to prevent the proc from transitioning to P_INEXEC afterwards.
> > Since sysctl_kern_proc_filedesc et al can take a long time it does not
> > seem feasible to pursue this.
> > 

After a second look this problem has to be dealt with.

If traversal while transition to P_INEXEC is allowed, execve dealing
with a setuid binary is problematic. This is more of hypothetical nature,
but with sufficienly long delay it could finish the syscall and start
opening some files, which paths would now be visible for an unprivileged
reader.

That said, I propose adding a counter to struct proc which would which
would block execve. It would be quite similar to p_lock.

iow execve would:

        PROC_LOCK(p);
	p->p_flag |= P_INEXEC; 
        while (p->p_execlock > 0)
                msleep(&p->p_execlock, &p->p_mtx, PWAIT, "execlock", 0);
	PROC_UNLOCK(p);

And it would be mandatory for external fdp consumers to grab the counter.

I'm tempted to add P_GETPIN which would both increase p_lock and p_execlock,
that way the process is guaranteed not to exit and not to execve even
after proc lock is dropped.

There is a separate question if p_execlock should be renamed and
extended to also block any kind of credential changes.

Then the guarantee is even stronger since we know that credentials we
checked against are not going to change for the duration of our
operations, but it is unclear if we need this.

-- 
Mateusz Guzik 

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 13:24:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 46478E1C;
 Mon, 23 Jun 2014 13:24:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 03157278D;
 Mon, 23 Jun 2014 13:24:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5NDO09Z032761;
 Mon, 23 Jun 2014 13:24:00 GMT
 (envelope-from brueffer@svn.freebsd.org)
Received: (from brueffer@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5NDO08Y032760;
 Mon, 23 Jun 2014 13:24:00 GMT
 (envelope-from brueffer@svn.freebsd.org)
Message-Id: <201406231324.s5NDO08Y032760@svn.freebsd.org>
From: Christian Brueffer 
Date: Mon, 23 Jun 2014 13:24:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267795 - head/share/man/man4
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 13:24:01 -0000

Author: brueffer
Date: Mon Jun 23 13:24:00 2014
New Revision: 267795
URL: http://svnweb.freebsd.org/changeset/base/267795

Log:
  Fix markup and grammar.

Modified:
  head/share/man/man4/acpi.4

Modified: head/share/man/man4/acpi.4
==============================================================================
--- head/share/man/man4/acpi.4	Mon Jun 23 13:23:51 2014	(r267794)
+++ head/share/man/man4/acpi.4	Mon Jun 23 13:24:00 2014	(r267795)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 16, 2012
+.Dd June 23, 2014
 .Dt ACPI 4
 .Os
 .Sh NAME
@@ -61,8 +61,9 @@ If the default settings are not optimal,
 used to modify or monitor
 .Nm
 behavior.
-Note that some variables will be available only if given hardware supports
-them (such as hw.acpi.acline).
+Note that some variables will be available only if the given hardware supports
+them (such as
+.Va hw.acpi.acline ) .
 .Bl -tag -width indent
 .It Va debug.acpi.enable_debug_objects
 Enable dumping Debug objects without
@@ -86,8 +87,7 @@ To enable ACPI CPU idling control,
 should be set to
 .Li acpi
 if it is listed in
-.Va machdep.idle_available
-.
+.Va machdep.idle_available .
 .It Va hw.acpi.cpu.cx_supported
 List of supported CPU idle states and their transition latency
 in microseconds.

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 13:48:01 2014
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 764F1186;
 Mon, 23 Jun 2014 13:48:01 +0000 (UTC)
Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "funkthat.com", Issuer "funkthat.com" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 13EA62A3B;
 Mon, 23 Jun 2014 13:48:00 +0000 (UTC)
Received: from h2.funkthat.com (localhost [127.0.0.1])
 by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s5NDlM0n036515
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Mon, 23 Jun 2014 06:47:23 -0700 (PDT)
 (envelope-from jmg@h2.funkthat.com)
Received: (from jmg@localhost)
 by h2.funkthat.com (8.14.3/8.14.3/Submit) id s5NDlMWO036514;
 Mon, 23 Jun 2014 06:47:22 -0700 (PDT) (envelope-from jmg)
Date: Mon, 23 Jun 2014 06:47:22 -0700
From: John-Mark Gurney 
To: Marius Strobl 
Subject: Re: svn commit: r267712 - head/sys/dev/uart
Message-ID: <20140623134722.GE31367@funkthat.com>
References: <201406220654.s5M6saB3066767@svn.freebsd.org>
 <20140623131643.GB7615@alchemy.franken.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20140623131643.GB7615@alchemy.franken.de>
User-Agent: Mutt/1.4.2.3i
X-Operating-System: FreeBSD 7.2-RELEASE i386
X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88  9322 9CB1 8F74 6D3F A396
X-Files: The truth is out there
X-URL: http://resnet.uoregon.edu/~gurney_j/
X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html
X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE
X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger?
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2
 (h2.funkthat.com [127.0.0.1]); Mon, 23 Jun 2014 06:47:23 -0700 (PDT)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
 src-committers@FreeBSD.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 13:48:01 -0000

Marius Strobl wrote this message on Mon, Jun 23, 2014 at 15:16 +0200:
> On Sun, Jun 22, 2014 at 06:54:36AM +0000, John-Mark Gurney wrote:
> > Author: jmg
> > Date: Sun Jun 22 06:54:36 2014
> > New Revision: 267712
> > URL: http://svnweb.freebsd.org/changeset/base/267712
> > 
> > Log:
> >   add support for MosChip MCS9922...  This is found on an ExpressCard..
> >   
> >   tested to work w/ cu talking to itself (the two ports connected via
> >   null modem cable)...
> > 
> 
> FYI, this is PR 186891.

Oh, feel free to clean this up as neccessary.. It worked on my card..

Thanks.

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 15:43:28 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0161E416;
 Mon, 23 Jun 2014 15:43:28 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E2DF02548;
 Mon, 23 Jun 2014 15:43:27 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5NFhRi0000584;
 Mon, 23 Jun 2014 15:43:27 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5NFhRa7000583;
 Mon, 23 Jun 2014 15:43:27 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201406231543.s5NFhRa7000583@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Mon, 23 Jun 2014 15:43:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267800 - head/lib/libc/net
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 15:43:28 -0000

Author: ume
Date: Mon Jun 23 15:43:27 2014
New Revision: 267800
URL: http://svnweb.freebsd.org/changeset/base/267800

Log:
  Exclude IPv4 address from doing longest match.
  It prevented DNS based load balancing.
  
  MFC after:	1 week

Modified:
  head/lib/libc/net/getaddrinfo.c

Modified: head/lib/libc/net/getaddrinfo.c
==============================================================================
--- head/lib/libc/net/getaddrinfo.c	Mon Jun 23 15:04:32 2014	(r267799)
+++ head/lib/libc/net/getaddrinfo.c	Mon Jun 23 15:43:27 2014	(r267800)
@@ -1009,7 +1009,8 @@ comp_dst(const void *arg1, const void *a
 	 * We compare the match length in a same AF only.
 	 */
 	if (dst1->aio_ai->ai_addr->sa_family ==
-	    dst2->aio_ai->ai_addr->sa_family) {
+	    dst2->aio_ai->ai_addr->sa_family &&
+	    dst1->aio_ai->ai_addr->sa_family != AF_INET) {
 		if (dst1->aio_matchlen > dst2->aio_matchlen) {
 			return(-1);
 		}

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 15:52:14 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D65409C5;
 Mon, 23 Jun 2014 15:52:14 +0000 (UTC)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id AFBE5263F;
 Mon, 23 Jun 2014 15:52:14 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id B48C6B99A;
 Mon, 23 Jun 2014 11:52:13 -0400 (EDT)
From: John Baldwin 
To: "Alexander V. Chernikov" 
Subject: Re: svn commit: r267716 - in head/sys: kern sys
Date: Mon, 23 Jun 2014 09:58:54 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; )
References: <201406221132.s5MBWNWj097084@svn.freebsd.org>
In-Reply-To: <201406221132.s5MBWNWj097084@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201406230958.54800.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Mon, 23 Jun 2014 11:52:13 -0400 (EDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 15:52:14 -0000

On Sunday, June 22, 2014 7:32:23 am Alexander V. Chernikov wrote:
> Author: melifaro
> Date: Sun Jun 22 11:32:23 2014
> New Revision: 267716
> URL: http://svnweb.freebsd.org/changeset/base/267716
> 
> Log:
>   Permit changing cpu mask for cpu set 1 in presence of drivers
>   binding their threads to particular CPU.
>   
>   Changing ithread cpu mask is now performed by special cpuset_setithread().
>   It creates additional cpuset root group on first bind invocation.
>   
>   No objection:	jhb
>   Tested by:	hiren
>   MFC after:	2 weeks
>   Sponsored by:	Yandex LLC

Thanks for fixing this!

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 15:52:18 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 589ACAC1;
 Mon, 23 Jun 2014 15:52:18 +0000 (UTC)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 332252642;
 Mon, 23 Jun 2014 15:52:18 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id D3D9DB9BD;
 Mon, 23 Jun 2014 11:52:16 -0400 (EDT)
From: John Baldwin 
To: Alexander Kabaev 
Subject: Re: svn commit: r267762 - head/sys/dev/sound/pcm
Date: Mon, 23 Jun 2014 10:15:59 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; )
References: <201406230345.s5N3jeiU063253@svn.freebsd.org>
In-Reply-To: <201406230345.s5N3jeiU063253@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201406231015.59401.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Mon, 23 Jun 2014 11:52:16 -0400 (EDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 15:52:18 -0000

On Sunday, June 22, 2014 11:45:40 pm Alexander Kabaev wrote:
> Author: kan
> Date: Mon Jun 23 03:45:39 2014
> New Revision: 267762
> URL: http://svnweb.freebsd.org/changeset/base/267762
> 
> Log:
>   Restore the check for non-NULL dmatag in sndbuf_free.
>   
>   The sound drivers that use own buffer management can use sndbuf_setup
>   and not do any busdma allocation, so the driver will end up with the
>   managed buffer but no valid dma map and tag for it. Avoid calling
>   bus_dmamem_free in such cases.
>   
>   Reported by: ache
>   Missed in review by: kan

Thanks for fixing this.

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 16:27:30 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7600D9C6;
 Mon, 23 Jun 2014 16:27:30 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 63F1E2986;
 Mon, 23 Jun 2014 16:27:30 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5NGRU0Q020180;
 Mon, 23 Jun 2014 16:27:30 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5NGRUEG020179;
 Mon, 23 Jun 2014 16:27:30 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201406231627.s5NGRUEG020179@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Mon, 23 Jun 2014 16:27:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267801 - head/sys/netinet6
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 16:27:30 -0000

Author: ume
Date: Mon Jun 23 16:27:29 2014
New Revision: 267801
URL: http://svnweb.freebsd.org/changeset/base/267801

Log:
  Make nd6_gctimer tunable.
  
  MFC after:	1 week

Modified:
  head/sys/netinet6/nd6.c

Modified: head/sys/netinet6/nd6.c
==============================================================================
--- head/sys/netinet6/nd6.c	Mon Jun 23 15:43:27 2014	(r267800)
+++ head/sys/netinet6/nd6.c	Mon Jun 23 16:27:29 2014	(r267801)
@@ -2369,6 +2369,8 @@ SYSCTL_NODE(_net_inet6_icmp6, ICMPV6CTL_
 	CTLFLAG_RD, nd6_sysctl_prlist, "");
 SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MAXQLEN, nd6_maxqueuelen,
 	CTLFLAG_RW, &VNET_NAME(nd6_maxqueuelen), 1, "");
+SYSCTL_VNET_INT(_net_inet6_icmp6, OID_AUTO, nd6_gctimer,
+	CTLFLAG_RW, &VNET_NAME(nd6_gctimer), (60 * 60 * 24), "");
 
 static int
 nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS)

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 16:35:31 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id ACD26C9C;
 Mon, 23 Jun 2014 16:35:31 +0000 (UTC)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 333DA2A49;
 Mon, 23 Jun 2014 16:35:31 +0000 (UTC)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s5NGZNHP060814;
 Mon, 23 Jun 2014 19:35:23 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s5NGZNHP060814
Received: (from kostik@localhost)
 by tom.home (8.14.9/8.14.8/Submit) id s5NGZNQv060813;
 Mon, 23 Jun 2014 19:35:23 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Mon, 23 Jun 2014 19:35:23 +0300
From: Konstantin Belousov 
To: Mateusz Guzik 
Subject: Re: svn commit: r267760 - head/sys/kern
Message-ID: <20140623163523.GK93733@kib.kiev.ua>
References: <201406230128.s5N1SIYK097224@svn.freebsd.org>
 <20140623064044.GD93733@kib.kiev.ua>
 <20140623070652.GA27040@dft-labs.eu>
 <20140623072519.GE93733@kib.kiev.ua>
 <20140623080501.GB27040@dft-labs.eu>
 <20140623081823.GG93733@kib.kiev.ua>
 <20140623131653.GC27040@dft-labs.eu>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="d6iqOn7HZPWKXx18"
Content-Disposition: inline
In-Reply-To: <20140623131653.GC27040@dft-labs.eu>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 autolearn_force=no version=3.4.0
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Mateusz Guzik 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 16:35:31 -0000


--d6iqOn7HZPWKXx18
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Jun 23, 2014 at 03:16:53PM +0200, Mateusz Guzik wrote:
> On Mon, Jun 23, 2014 at 11:18:23AM +0300, Konstantin Belousov wrote:
> > On Mon, Jun 23, 2014 at 10:05:01AM +0200, Mateusz Guzik wrote:
> > > On Mon, Jun 23, 2014 at 10:25:19AM +0300, Konstantin Belousov wrote:
> > > > On Mon, Jun 23, 2014 at 09:06:52AM +0200, Mateusz Guzik wrote:
> > > > > The table is modified in these functions and is reachable from th=
e rest
> > > > > of the kernel (can be found by e.g. sysctl_kern_proc_filedesc), t=
hus
> > > > > XLOCK is needed to ensure consistency for readers. It can also be
> > > > > altered by mountcheckdirs, although not in a way which disrupts a=
ny of
> > > > > these functions.
> > > > I would think that such cases should be avoided by testing for P_IN=
EXEC,
> > > > but I do not insist on this.
> > > >=20
> > >=20
> > > proc lock has to be dropped before filedesc lock is taken and I don't
> > > see any way to prevent the proc from transitioning to P_INEXEC afterw=
ards.
> > > Since sysctl_kern_proc_filedesc et al can take a long time it does not
> > > seem feasible to pursue this.
> > >=20
>=20
> After a second look this problem has to be dealt with.
>=20
> If traversal while transition to P_INEXEC is allowed, execve dealing
> with a setuid binary is problematic. This is more of hypothetical nature,
> but with sufficienly long delay it could finish the syscall and start
> opening some files, which paths would now be visible for an unprivileged
> reader.
>=20
> That said, I propose adding a counter to struct proc which would which
> would block execve. It would be quite similar to p_lock.
I thought about this too.  In fact, I considered using PHOLD for this.

>=20
> iow execve would:
>=20
>         PROC_LOCK(p);
> 	p->p_flag |=3D P_INEXEC;=20
>         while (p->p_execlock > 0)
>                 msleep(&p->p_execlock, &p->p_mtx, PWAIT, "execlock", 0);
> 	PROC_UNLOCK(p);
>=20
> And it would be mandatory for external fdp consumers to grab the counter.
>=20
> I'm tempted to add P_GETPIN which would both increase p_lock and p_execlo=
ck,
> that way the process is guaranteed not to exit and not to execve even
> after proc lock is dropped.
See above about PHOLD.

>=20
> There is a separate question if p_execlock should be renamed and
> extended to also block any kind of credential changes.
>=20
> Then the guarantee is even stronger since we know that credentials we
> checked against are not going to change for the duration of our
> operations, but it is unclear if we need this.

If doing separate execlock/p_lock, I think that it could be possible
to use per-process sx lock instead of hand-rolling the counter.  The
accessors would lock sx shared, while kern_execve would take it in
exclusive mode.

--d6iqOn7HZPWKXx18
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJTqFdKAAoJEJDCuSvBvK1ByesP/3O3VMR+fSO9C4laRxens4do
NOBAA1n7HiR6RlLNcynFk9POCcXycDJGTXezIRkDbEOmLa/OJSV0xU584s6QsJgO
IcpbNf+kXTo5MPh5nuHHpaqc1OOGUATb0VvYg4+bOF/Oa/KfLgFe/oNW4oE+/FtQ
pltr1NeFqRUcnx0M78vpVb1QraMZ/Rm2YxaRvTb/ZRn4es2pcARqa4rN3QHvgCjf
zzkuyV1xYNqrBifD4j9K+zvjzy4q6x6NXWLHaqzjNGCYqmde1STvlhUwchToP2bl
dx6VvY2awJpYZ1sMdhAmDAlOfd8LxWJGCygUfeQj8iLopAVaBZObDOKvtTl8jv9a
PmYqzkI2/Z7Wo31z1TTEqSVMu9X940lBiX8J14YeNHIaF8mVG/xHDbqGaR8L3kr2
e5E2Xvk9Xx3s1Y8lCEkuurLip2cav2MN4jPEokEXyNASvz2HLlTm1OlBRf/Z0Alg
AEssNhUkr8aZ6nKQr/cNSiptIAnMYxRWOM+mkiSrgXKVK1G5o4HRPHhgMSHe4fU3
KZ0LLa9WTx+m334/WdR0cDS7v4Dx8LMFuB2wumCwDoFmBU/md/c25nTXL2jgRZ5e
7VQgSkdb2ngmzmuakaSqYRQBDHMNbJVt/8p54KNMY/ooKLByx0ICE+6ttM2fQDCg
Ro1HyH80rKXWB+7UtRrB
=QEZ4
-----END PGP SIGNATURE-----

--d6iqOn7HZPWKXx18--

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 18:13:43 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1A68D904;
 Mon, 23 Jun 2014 18:13:43 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E23022455;
 Mon, 23 Jun 2014 18:13:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5NIDgXq071680;
 Mon, 23 Jun 2014 18:13:42 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5NIDgGD071679;
 Mon, 23 Jun 2014 18:13:42 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201406231813.s5NIDgGD071679@svn.freebsd.org>
From: Gavin Atkinson 
Date: Mon, 23 Jun 2014 18:13:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267802 - head/usr.sbin/ctm/mkCTM
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 18:13:43 -0000

Author: gavin
Date: Mon Jun 23 18:13:42 2014
New Revision: 267802
URL: http://svnweb.freebsd.org/changeset/base/267802

Log:
  With the move away from GNATS, drop the CTM config file for downloading
  the GNATS database, it will be going away soon.

Deleted:
  head/usr.sbin/ctm/mkCTM/ctm_conf.gnats

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 23 18:40:26 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C23B1305;
 Mon, 23 Jun 2014 18:40:26 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id AA67E268D;
 Mon, 23 Jun 2014 18:40:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5NIeQs5082570;
 Mon, 23 Jun 2014 18:40:26 GMT (envelope-from joel@svn.freebsd.org)
Received: (from joel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5NIeMYO082538;
 Mon, 23 Jun 2014 18:40:22 GMT (envelope-from joel@svn.freebsd.org)
Message-Id: <201406231840.s5NIeMYO082538@svn.freebsd.org>
From: Joel Dahl 
Date: Mon, 23 Jun 2014 18:40:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267803 - in head: cddl/contrib/opensolaris/cmd/zpool
 lib/libc/sys lib/libcuse lib/libpam/modules/pam_passwdqc lib/libpmc
 lib/libutil libexec/rtld-elf sbin/ifconfig sbin/ipfw sbin/mount...
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 23 Jun 2014 18:40:27 -0000

Author: joel (doc committer)
Date: Mon Jun 23 18:40:21 2014
New Revision: 267803
URL: http://svnweb.freebsd.org/changeset/base/267803

Log:
  mdoc: remove superfluous paragraph macros.

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
  head/lib/libc/sys/intro.2
  head/lib/libcuse/cuse.3
  head/lib/libpam/modules/pam_passwdqc/pam_passwdqc.8
  head/lib/libpmc/pmc.k8.3
  head/lib/libpmc/pmc.p4.3
  head/lib/libutil/fparseln.3
  head/lib/libutil/login_class.3
  head/libexec/rtld-elf/rtld.1
  head/sbin/ifconfig/ifconfig.8
  head/sbin/ipfw/ipfw.8
  head/sbin/mount_fusefs/mount_fusefs.8
  head/sbin/natd/natd.8
  head/sbin/pfctl/pfctl.8
  head/share/man/man4/est.4
  head/share/man/man4/mxge.4
  head/share/man/man4/ng_async.4
  head/share/man/man4/ng_ccatm.4
  head/share/man/man4/sysmouse.4
  head/share/man/man4/tty.4
  head/share/man/man4/vale.4
  head/share/man/man9/ifnet.9

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8	Mon Jun 23 18:40:21 2014	(r267803)
@@ -1041,7 +1041,6 @@ the following fields:
 See the
 .Qq Sx Properties
 section for more information on the available pool properties.
-.Pp
 .It Fl H
 Scripted mode. Do not display headers, and separate fields by a single tab
 instead of arbitrary space.

Modified: head/lib/libc/sys/intro.2
==============================================================================
--- head/lib/libc/sys/intro.2	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/lib/libc/sys/intro.2	Mon Jun 23 18:40:21 2014	(r267803)
@@ -133,7 +133,6 @@ executable file.
 A file descriptor argument was out of range, referred to no open file,
 or a read (write) request was made to a file that was only open for
 writing (reading).
-.Pp
 .It Er 10 ECHILD Em "\&No child processes" .
 A
 .Xr wait 2
@@ -302,7 +301,6 @@ addresses with
 Internet protocols.
 .It Er 48 EADDRINUSE Em "Address already in use" .
 Only one usage of each address is normally permitted.
-.Pp
 .It Er 49 EADDRNOTAVAIL Em "Can't assign requested address" .
 Normally results from an attempt to create a socket with an
 address not on this machine.

Modified: head/lib/libcuse/cuse.3
==============================================================================
--- head/lib/libcuse/cuse.3	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/lib/libcuse/cuse.3	Mon Jun 23 18:40:21 2014	(r267803)
@@ -262,7 +262,6 @@ is returned.
 .Ft "void"
 .Fn "cuse_poll_wakeup" "void"
 This function will wake up any file pollers.
-.Pp
 .Sh LIBRARY LIMITATIONS
 Transfer lengths for
 .Fn read ,
@@ -374,7 +373,6 @@ values in case of failure and success.
 The events argument is also a mask of
 .Dv CUSE_POLL_XXX
 values.
-.Pp
 .Bd -literal -offset indent
 struct cuse_methods {
   cuse_open_t *cm_open;

Modified: head/lib/libpam/modules/pam_passwdqc/pam_passwdqc.8
==============================================================================
--- head/lib/libpam/modules/pam_passwdqc/pam_passwdqc.8	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/lib/libpam/modules/pam_passwdqc/pam_passwdqc.8	Mon Jun 23 18:40:21 2014	(r267803)
@@ -123,7 +123,6 @@ password are not counted.
 In addition to being sufficiently long, passwords are required to
 contain enough different characters for the character classes and
 the minimum length they have been checked against.
-.Pp
 .It Cm max Ns = Ns Ar N
 .Pq Cm max Ns = Ns 40
 The maximum allowed password length.

Modified: head/lib/libpmc/pmc.k8.3
==============================================================================
--- head/lib/libpmc/pmc.k8.3	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/lib/libpmc/pmc.k8.3	Mon Jun 23 18:40:21 2014	(r267803)
@@ -672,7 +672,6 @@ Count memory controller high priority by
 .It Li memory-controller-lo-pri-bypass
 Count memory controller low priority bypasses.
 .El
-.Pp
 .It Li k8-nb-memory-controller-dram-slots-missed
 .Pq Event E2H
 Count memory controller DRAM command slots missed (in MemClks).

Modified: head/lib/libpmc/pmc.p4.3
==============================================================================
--- head/lib/libpmc/pmc.p4.3	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/lib/libpmc/pmc.p4.3	Mon Jun 23 18:40:21 2014	(r267803)
@@ -541,7 +541,6 @@ can take the following value (which is a
 .It Li running
 Count cycles when the processor is active.
 .El
-.Pp
 .It Li p4-instr-retired Op Li ,mask= Ns Ar flags
 .Pq "TS event"
 Count instructions retired during a clock cycle.

Modified: head/lib/libutil/fparseln.3
==============================================================================
--- head/lib/libutil/fparseln.3	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/lib/libutil/fparseln.3	Mon Jun 23 18:40:21 2014	(r267803)
@@ -122,7 +122,6 @@ Remove escape preceding any other charac
 .It Dv FPARSELN_UNESCALL
 All of the above.
 .El
-.Pp
 .El
 .Sh RETURN VALUES
 Upon successful completion a pointer to the parsed line is returned;

Modified: head/lib/libutil/login_class.3
==============================================================================
--- head/lib/libutil/login_class.3	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/lib/libutil/login_class.3	Mon Jun 23 18:40:21 2014	(r267803)
@@ -160,7 +160,6 @@ capability "setenv=var1 val1,var2 val2..
 .It LOGIN_SETMAC
 Set the MAC label for the current process to the label specified
 in system login class database.
-.Pp
 .It LOGIN_SETCPUMASK
 Create a new
 .Xr cpuset 2

Modified: head/libexec/rtld-elf/rtld.1
==============================================================================
--- head/libexec/rtld-elf/rtld.1	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/libexec/rtld-elf/rtld.1	Mon Jun 23 18:40:21 2014	(r267803)
@@ -267,7 +267,6 @@ If set,
 .Nm
 will log events such as the loading and unloading of shared objects via
 .Xr utrace 2 .
-.Pp
 .It Ev LD_LOADFLTR
 If set,
 .Nm

Modified: head/sbin/ifconfig/ifconfig.8
==============================================================================
--- head/sbin/ifconfig/ifconfig.8	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/sbin/ifconfig/ifconfig.8	Mon Jun 23 18:40:21 2014	(r267803)
@@ -2333,7 +2333,6 @@ src/dst address for IPv4 or IPv6.
 .It Cm l4
 src/dst port for TCP/UDP/SCTP.
 .El
-.Pp
 .El
 .Pp
 The following parameters are specific to IP tunnel interfaces,

Modified: head/sbin/ipfw/ipfw.8
==============================================================================
--- head/sbin/ipfw/ipfw.8	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/sbin/ipfw/ipfw.8	Mon Jun 23 18:40:21 2014	(r267803)
@@ -1583,7 +1583,6 @@ followed by the number of significant bi
 For example, an address with 33 significant bits could be specified as:
 .Pp
 .Dl "MAC 10:20:30:40:50:60/33 any"
-.Pp
 .It
 An ampersand
 .Pq &

Modified: head/sbin/mount_fusefs/mount_fusefs.8
==============================================================================
--- head/sbin/mount_fusefs/mount_fusefs.8	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/sbin/mount_fusefs/mount_fusefs.8	Mon Jun 23 18:40:21 2014	(r267803)
@@ -151,7 +151,6 @@ Do not refuse unmounting if there are se
 .It Cm push_symlinks_in
 Prefix absolute symlinks with the mountpoint
 .El
-.Pp
 .El
 .Pp
 Besides the above mount options, there is a set of pseudo-mount options which

Modified: head/sbin/natd/natd.8
==============================================================================
--- head/sbin/natd/natd.8	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/sbin/natd/natd.8	Mon Jun 23 18:40:21 2014	(r267803)
@@ -585,7 +585,6 @@ in the
 file or using the command
 .Pp
 .Dl "sysctl net.inet.ip.forwarding=1"
-.Pp
 .It
 If you use the
 .Fl interface

Modified: head/sbin/pfctl/pfctl.8
==============================================================================
--- head/sbin/pfctl/pfctl.8	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/sbin/pfctl/pfctl.8	Mon Jun 23 18:40:21 2014	(r267803)
@@ -317,7 +317,6 @@ To kill a state with ID 4823e84500000018
 firewall with hostid 00000002 use:
 .Pp
 .Dl # pfctl -k id -k 4823e84500000018/2
-.Pp
 .It Fl m
 Merge in explicitly given options without resetting those
 which are omitted.

Modified: head/share/man/man4/est.4
==============================================================================
--- head/share/man/man4/est.4	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/share/man/man4/est.4	Mon Jun 23 18:40:21 2014	(r267803)
@@ -91,7 +91,6 @@ The valid frequencies that are allowed b
 .It dev.est.0.freq_settings: 2201/45000 2200/45000 2000/39581 1900/37387
 1800/34806 1700/32703 1600/30227 1500/28212 1400/25828 1300/23900 1200/21613
 1100/19775 1000/17582 900/15437 800/13723
-.Pp
 .El
 .Sh DIAGNOSTICS
 .Bl -diag

Modified: head/share/man/man4/mxge.4
==============================================================================
--- head/share/man/man4/mxge.4	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/share/man/man4/mxge.4	Mon Jun 23 18:40:21 2014	(r267803)
@@ -131,7 +131,6 @@ both be capable of MSI-X.
 Older Myri10GE NICs can be field upgraded to add
 MSI-X using the "10G NIC Tool Kit" for FreeBSD which is available from
 .Pa http://www.myri.com/scs/download-10g-tools.html .
-.Pp
 .It Va hw.mxge.rss_hashtype
 This value determines how incoming traffic is steered to different
 slices.

Modified: head/share/man/man4/ng_async.4
==============================================================================
--- head/share/man/man4/ng_async.4	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/share/man/man4/ng_async.4	Mon Jun 23 18:40:21 2014	(r267803)
@@ -143,7 +143,6 @@ This command returns a
 containing node statistics for packet, octet, and error counts.
 .It Dv NGM_ASYNC_CMD_CLR_STATS Pq Ic clrstats
 Clears the node statistics.
-.Pp
 .El
 .Sh SHUTDOWN
 This node shuts down upon receipt of a

Modified: head/share/man/man4/ng_ccatm.4
==============================================================================
--- head/share/man/man4/ng_ccatm.4	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/share/man/man4/ng_ccatm.4	Mon Jun 23 18:40:21 2014	(r267803)
@@ -206,7 +206,6 @@ struct ngm_ccatm_port {
 	uint32_t	port;
 };
 .Ed
-.Pp
 .It Dv NGM_CCATM_START Pq Ic start
 Start processing on the port.
 The argument is a

Modified: head/share/man/man4/sysmouse.4
==============================================================================
--- head/share/man/man4/sysmouse.4	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/share/man/man4/sysmouse.4	Mon Jun 23 18:40:21 2014	(r267803)
@@ -441,7 +441,6 @@ The
 field
 holds the click count: the number of times the user has clicked the button
 successively.
-.Pp
 .El
 .El
 .Sh FILES

Modified: head/share/man/man4/tty.4
==============================================================================
--- head/share/man/man4/tty.4	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/share/man/man4/tty.4	Mon Jun 23 18:40:21 2014	(r267803)
@@ -127,7 +127,6 @@ Before
 .Fx 8.0 ,
 it would change to the new line discipline pointed to by
 .Fa ldisc .
-.Pp
 .It Dv TIOCGETD Fa int *ldisc
 Return the current line discipline in the integer pointed to by
 .Fa ldisc .

Modified: head/share/man/man4/vale.4
==============================================================================
--- head/share/man/man4/vale.4	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/share/man/man4/vale.4	Mon Jun 23 18:40:21 2014	(r267803)
@@ -90,7 +90,6 @@ The maximum number of packets processed 
 in each iteration.
 Defaults to 1024, use lower values to trade latency
 with throughput.
-.Pp
 .It dev.netmap.verbose
 Set to non-zero values to enable in-kernel diagnostics.
 .El

Modified: head/share/man/man9/ifnet.9
==============================================================================
--- head/share/man/man9/ifnet.9	Mon Jun 23 18:13:42 2014	(r267802)
+++ head/share/man/man9/ifnet.9	Mon Jun 23 18:40:21 2014	(r267803)
@@ -1370,7 +1370,6 @@ function is called to perform the operat
 .It Dv SIOCDIFADDR
 The socket's protocol control routine is called to implement the
 requested action.
-.Pp
 .El
 .El
 .Pp

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 02:02:53 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 00C00B91;
 Tue, 24 Jun 2014 02:02:52 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D62962EAB;
 Tue, 24 Jun 2014 02:02:52 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5O22q1J092297;
 Tue, 24 Jun 2014 02:02:52 GMT (envelope-from neel@svn.freebsd.org)
Received: (from neel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5O22p8c092290;
 Tue, 24 Jun 2014 02:02:51 GMT (envelope-from neel@svn.freebsd.org)
Message-Id: <201406240202.s5O22p8c092290@svn.freebsd.org>
From: Neel Natu 
Date: Tue, 24 Jun 2014 02:02:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267811 - in head: lib/libvmmapi usr.sbin/bhyve
 usr.sbin/bhyveload
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 02:02:53 -0000

Author: neel
Date: Tue Jun 24 02:02:51 2014
New Revision: 267811
URL: http://svnweb.freebsd.org/changeset/base/267811

Log:
  Provide APIs to directly get 'lowmem' and 'highmem' size directly.
  
  Previously the sizes were inferred indirectly based on the size of the mappings
  at 0 and 4GB respectively. This works fine as long as size of the allocation is
  identical to the size of the mapping in the guest's address space. However, if
  the mapping is disjoint then this assumption falls apart (e.g., due to the
  legacy BIOS hole between 640KB and 1MB).

Modified:
  head/lib/libvmmapi/vmmapi.c
  head/lib/libvmmapi/vmmapi.h
  head/usr.sbin/bhyve/pci_emul.c
  head/usr.sbin/bhyve/rtc.c
  head/usr.sbin/bhyve/smbiostbl.c
  head/usr.sbin/bhyveload/bhyveload.c

Modified: head/lib/libvmmapi/vmmapi.c
==============================================================================
--- head/lib/libvmmapi/vmmapi.c	Mon Jun 23 22:40:33 2014	(r267810)
+++ head/lib/libvmmapi/vmmapi.c	Tue Jun 24 02:02:51 2014	(r267811)
@@ -274,6 +274,20 @@ vm_map_gpa(struct vmctx *ctx, vm_paddr_t
 	return (NULL);
 }
 
+size_t
+vm_get_lowmem_size(struct vmctx *ctx)
+{
+
+	return (ctx->lowmem);
+}
+
+size_t
+vm_get_highmem_size(struct vmctx *ctx)
+{
+
+	return (ctx->highmem);
+}
+
 int
 vm_set_desc(struct vmctx *ctx, int vcpu, int reg,
 	    uint64_t base, uint32_t limit, uint32_t access)

Modified: head/lib/libvmmapi/vmmapi.h
==============================================================================
--- head/lib/libvmmapi/vmmapi.h	Mon Jun 23 22:40:33 2014	(r267810)
+++ head/lib/libvmmapi/vmmapi.h	Tue Jun 24 02:02:51 2014	(r267811)
@@ -60,6 +60,8 @@ int	vm_get_gpa_pmap(struct vmctx *, uint
 uint32_t vm_get_lowmem_limit(struct vmctx *ctx);
 void	vm_set_lowmem_limit(struct vmctx *ctx, uint32_t limit);
 void	vm_set_memflags(struct vmctx *ctx, int flags);
+size_t	vm_get_lowmem_size(struct vmctx *ctx);
+size_t	vm_get_highmem_size(struct vmctx *ctx);
 int	vm_set_desc(struct vmctx *ctx, int vcpu, int reg,
 		    uint64_t base, uint32_t limit, uint32_t access);
 int	vm_get_desc(struct vmctx *ctx, int vcpu, int reg,

Modified: head/usr.sbin/bhyve/pci_emul.c
==============================================================================
--- head/usr.sbin/bhyve/pci_emul.c	Mon Jun 23 22:40:33 2014	(r267810)
+++ head/usr.sbin/bhyve/pci_emul.c	Tue Jun 24 02:02:51 2014	(r267811)
@@ -1118,8 +1118,7 @@ init_pci(struct vmctx *ctx)
 	 * Accesses to memory addresses that are not allocated to system
 	 * memory or PCI devices return 0xff's.
 	 */
-	error = vm_get_memory_seg(ctx, 0, &lowmem, NULL);
-	assert(error == 0);
+	lowmem = vm_get_lowmem_size(ctx);
 
 	memset(&pci_mem_hole, 0, sizeof(struct mem_range));
 	pci_mem_hole.name = "PCI hole";

Modified: head/usr.sbin/bhyve/rtc.c
==============================================================================
--- head/usr.sbin/bhyve/rtc.c	Mon Jun 23 22:40:33 2014	(r267810)
+++ head/usr.sbin/bhyve/rtc.c	Tue Jun 24 02:02:51 2014	(r267811)
@@ -343,19 +343,14 @@ rtc_init(struct vmctx *ctx)
 	 * 0x34/0x35 - 64KB chunks above 16MB, below 4GB
 	 * 0x5b/0x5c/0x5d - 64KB chunks above 4GB
 	 */
-	err = vm_get_memory_seg(ctx, 0, &lomem, NULL);
-	assert(err == 0);
-
-	lomem = (lomem - m_16MB) / m_64KB;
+	lomem = (vm_get_lowmem_size(ctx) - m_16MB) / m_64KB;
 	rtc_nvram[nvoff(RTC_LMEM_LSB)] = lomem;
 	rtc_nvram[nvoff(RTC_LMEM_MSB)] = lomem >> 8;
 
-	if (vm_get_memory_seg(ctx, m_4GB, &himem, NULL) == 0) {	  
-		himem /= m_64KB;
-		rtc_nvram[nvoff(RTC_HMEM_LSB)] = himem;
-		rtc_nvram[nvoff(RTC_HMEM_SB)]  = himem >> 8;
-		rtc_nvram[nvoff(RTC_HMEM_MSB)] = himem >> 16;
-	}
+	himem = vm_get_highmem_size(ctx) / m_64KB;
+	rtc_nvram[nvoff(RTC_HMEM_LSB)] = himem;
+	rtc_nvram[nvoff(RTC_HMEM_SB)]  = himem >> 8;
+	rtc_nvram[nvoff(RTC_HMEM_MSB)] = himem >> 16;
 }
 
 INOUT_PORT(rtc, IO_RTC, IOPORT_F_INOUT, rtc_addr_handler);

Modified: head/usr.sbin/bhyve/smbiostbl.c
==============================================================================
--- head/usr.sbin/bhyve/smbiostbl.c	Mon Jun 23 22:40:33 2014	(r267810)
+++ head/usr.sbin/bhyve/smbiostbl.c	Tue Jun 24 02:02:51 2014	(r267811)
@@ -779,13 +779,8 @@ smbios_build(struct vmctx *ctx)
 	int				i;
 	int				err;
 
-	err = vm_get_memory_seg(ctx, 0, &guest_lomem, NULL);
-	if (err != 0)
-		return (err);
-
-	err = vm_get_memory_seg(ctx, 4*GB, &guest_himem, NULL);
-	if (err != 0)
-		return (err);
+	guest_lomem = vm_get_lowmem_size(ctx);
+	guest_himem = vm_get_highmem_size(ctx);
 
 	startaddr = paddr_guest2host(ctx, SMBIOS_BASE, SMBIOS_MAX_LENGTH);
 	if (startaddr == NULL) {

Modified: head/usr.sbin/bhyveload/bhyveload.c
==============================================================================
--- head/usr.sbin/bhyveload/bhyveload.c	Mon Jun 23 22:40:33 2014	(r267810)
+++ head/usr.sbin/bhyveload/bhyveload.c	Tue Jun 24 02:02:51 2014	(r267811)
@@ -505,8 +505,8 @@ static void
 cb_getmem(void *arg, uint64_t *ret_lowmem, uint64_t *ret_highmem)
 {
 
-	vm_get_memory_seg(ctx, 0, ret_lowmem, NULL);
-	vm_get_memory_seg(ctx, 4 * GB, ret_highmem, NULL);
+	*ret_lowmem = vm_get_lowmem_size(ctx);
+	*ret_highmem = vm_get_highmem_size(ctx);
 }
 
 struct env {

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 04:29:13 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 19C16400;
 Tue, 24 Jun 2014 04:29:13 +0000 (UTC)
Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214])
 (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CA7EF2A22;
 Tue, 24 Jun 2014 04:29:11 +0000 (UTC)
Received: from laptop015.home.selasky.org
 (cm-176.74.213.204.customer.telag.net [176.74.213.204])
 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits))
 (No client certificate requested)
 by mail.turbocat.net (Postfix) with ESMTPSA id DD4351FE028;
 Tue, 24 Jun 2014 06:28:59 +0200 (CEST)
Message-ID: <53A8FEA3.4020804@selasky.org>
Date: Tue, 24 Jun 2014 06:29:23 +0200
From: Hans Petter Selasky 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:24.0) Gecko/20100101 Thunderbird/24.1.0
MIME-Version: 1.0
To: John Baldwin , Alexander Kabaev 
Subject: Re: svn commit: r267762 - head/sys/dev/sound/pcm
References: <201406230345.s5N3jeiU063253@svn.freebsd.org>
 <201406231015.59401.jhb@freebsd.org>
In-Reply-To: <201406231015.59401.jhb@freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 04:29:13 -0000

On 06/23/14 16:15, John Baldwin wrote:
> On Sunday, June 22, 2014 11:45:40 pm Alexander Kabaev wrote:
>> Author: kan
>> Date: Mon Jun 23 03:45:39 2014
>> New Revision: 267762
>> URL: http://svnweb.freebsd.org/changeset/base/267762
>>
>> Log:
>>    Restore the check for non-NULL dmatag in sndbuf_free.
>>
>>    The sound drivers that use own buffer management can use sndbuf_setup
>>    and not do any busdma allocation, so the driver will end up with the
>>    managed buffer but no valid dma map and tag for it. Avoid calling
>>    bus_dmamem_free in such cases.
>>
>>    Reported by: ache
>>    Missed in review by: kan
>
> Thanks for fixing this.
>

Excellent!

--HPS

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 04:37:37 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0646E681;
 Tue, 24 Jun 2014 04:37:37 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E8C192ACE;
 Tue, 24 Jun 2014 04:37:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5O4baBd064857;
 Tue, 24 Jun 2014 04:37:36 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5O4baoe064856;
 Tue, 24 Jun 2014 04:37:36 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201406240437.s5O4baoe064856@svn.freebsd.org>
From: Hiroki Sato 
Date: Tue, 24 Jun 2014 04:37:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267812 - head/etc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 04:37:37 -0000

Author: hrs
Date: Tue Jun 24 04:37:36 2014
New Revision: 267812
URL: http://svnweb.freebsd.org/changeset/base/267812

Log:
  Fix ifname normalization.  ifconfig_IF_alias{es,N} did not work if ifname has
  any of [.-/+].
  
  Spotted by:	jhay

Modified:
  head/etc/network.subr

Modified: head/etc/network.subr
==============================================================================
--- head/etc/network.subr	Tue Jun 24 02:02:51 2014	(r267811)
+++ head/etc/network.subr	Tue Jun 24 04:37:36 2014	(r267812)
@@ -1077,7 +1077,7 @@ ifalias_af_common_handler()
 ifalias_af_common()
 {
 	local _ret _if _af _action alias ifconfig_args _aliasn _c _tmpargs _iaf
-	local _punct=".-/+"
+	local _vif _punct=".-/+"
 
 	_ret=1
 	_aliasn=
@@ -1086,11 +1086,11 @@ ifalias_af_common()
 	_action=$3
 
 	# Normalize $_if before using it in a pattern to list_vars()
-	ltr "$_if" "$_punct" "_" _if
+	ltr "$_if" "$_punct" "_" _vif
 
 	# ifconfig_IF_aliasN which starts with $_af
-	for alias in `list_vars ifconfig_${_if}_alias[0-9]\* |
-		sort_lite -nk1.$((9+${#_if}+7))`
+	for alias in `list_vars ifconfig_${_vif}_alias[0-9]\* |
+		sort_lite -nk1.$((9+${#_vif}+7))`
 	do
 		eval ifconfig_args=\"\$$alias\"
 		_iaf=
@@ -1118,8 +1118,8 @@ ifalias_af_common()
 	# backward compatibility: ipv6_ifconfig_IF_aliasN.
 	case $_af in
 	inet6)
-		for alias in `list_vars ipv6_ifconfig_${_if}_alias[0-9]\* |
-			sort_lite -nk1.$((14+${#_if}+7))`
+		for alias in `list_vars ipv6_ifconfig_${_vif}_alias[0-9]\* |
+			sort_lite -nk1.$((14+${#_vif}+7))`
 		do
 			eval ifconfig_args=\"\$$alias\"
 			case ${_action}:"${ifconfig_args}" in
@@ -1129,7 +1129,7 @@ ifalias_af_common()
 			alias:*)
 				_aliasn="${_aliasn} inet6 ${ifconfig_args}"
 				warn "\$${alias} is obsolete. " \
-				    "Use ifconfig_$1_aliasN instead."
+				    "Use ifconfig_${_vif}_aliasN instead."
 			;;
 			esac
 		done

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 06:52:33 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 66E2BFFD;
 Tue, 24 Jun 2014 06:52:33 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 48A972551;
 Tue, 24 Jun 2014 06:52:33 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5O6qX0M034384;
 Tue, 24 Jun 2014 06:52:33 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5O6qXuV034383;
 Tue, 24 Jun 2014 06:52:33 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201406240652.s5O6qXuV034383@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 24 Jun 2014 06:52:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267814 - head/sys/dev/cpuctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 06:52:33 -0000

Author: kib
Date: Tue Jun 24 06:52:32 2014
New Revision: 267814
URL: http://svnweb.freebsd.org/changeset/base/267814

Log:
  Make cpuctl_do_cpuid() and cpuctl_do_cpuid_count() return void.
  There is no error to report.
  
  Requested by:	attilio
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/dev/cpuctl/cpuctl.c

Modified: head/sys/dev/cpuctl/cpuctl.c
==============================================================================
--- head/sys/dev/cpuctl/cpuctl.c	Tue Jun 24 06:12:11 2014	(r267813)
+++ head/sys/dev/cpuctl/cpuctl.c	Tue Jun 24 06:52:32 2014	(r267814)
@@ -67,9 +67,9 @@ static d_ioctl_t cpuctl_ioctl;
 
 static int cpuctl_do_msr(int cpu, cpuctl_msr_args_t *data, u_long cmd,
     struct thread *td);
-static int cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data,
+static void cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data,
     struct thread *td);
-static int cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data,
+static void cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data,
     struct thread *td);
 static int cpuctl_do_update(int cpu, cpuctl_update_args_t *data,
     struct thread *td);
@@ -171,7 +171,8 @@ cpuctl_ioctl(struct cdev *dev, u_long cm
 		ret = cpuctl_do_msr(cpu, (cpuctl_msr_args_t *)data, cmd, td);
 		break;
 	case CPUCTL_CPUID:
-		ret = cpuctl_do_cpuid(cpu, (cpuctl_cpuid_args_t *)data, td);
+		cpuctl_do_cpuid(cpu, (cpuctl_cpuid_args_t *)data, td);
+		ret = 0;
 		break;
 	case CPUCTL_UPDATE:
 		ret = priv_check(td, PRIV_CPUCTL_UPDATE);
@@ -180,8 +181,9 @@ cpuctl_ioctl(struct cdev *dev, u_long cm
 		ret = cpuctl_do_update(cpu, (cpuctl_update_args_t *)data, td);
 		break;
 	case CPUCTL_CPUID_COUNT:
-		ret = cpuctl_do_cpuid_count(cpu,
-		    (cpuctl_cpuid_count_args_t *)data, td);
+		cpuctl_do_cpuid_count(cpu, (cpuctl_cpuid_count_args_t *)data,
+		    td);
+		ret = 0;
 		break;
 	default:
 		ret = EINVAL;
@@ -194,7 +196,7 @@ fail:
 /*
  * Actually perform cpuid operation.
  */
-static int
+static void
 cpuctl_do_cpuid_count(int cpu, cpuctl_cpuid_count_args_t *data,
     struct thread *td)
 {
@@ -213,21 +215,18 @@ cpuctl_do_cpuid_count(int cpu, cpuctl_cp
 	set_cpu(cpu, td);
 	cpuid_count(data->level, data->level_type, data->data);
 	restore_cpu(oldcpu, is_bound, td);
-	return (0);
 }
 
-static int
+static void
 cpuctl_do_cpuid(int cpu, cpuctl_cpuid_args_t *data, struct thread *td)
 {
 	cpuctl_cpuid_count_args_t cdata;
-	int error;
 
 	cdata.level = data->level;
 	/* Override the level type. */
 	cdata.level_type = 0;
-	error = cpuctl_do_cpuid_count(cpu, &cdata, td);
+	cpuctl_do_cpuid_count(cpu, &cdata, td);
 	bcopy(cdata.data, data->data, sizeof(data->data)); /* Ignore error */
-	return (error);
 }
 
 /*
@@ -292,12 +291,7 @@ cpuctl_do_update(int cpu, cpuctl_update_
 	    ("[cpuctl,%d]: bad cpu number %d", __LINE__, cpu));
 	DPRINTF("[cpuctl,%d]: XXX %d", __LINE__, cpu);
 
-	ret = cpuctl_do_cpuid(cpu, &args, td);
-	if (ret != 0) {
-		DPRINTF("[cpuctl,%d]: cannot retrive cpuid info for cpu %d",
-		    __LINE__, cpu);
-		return (ENXIO);
-	}
+	cpuctl_do_cpuid(cpu, &args, td);
 	((uint32_t *)vendor)[0] = args.data[1];
 	((uint32_t *)vendor)[1] = args.data[3];
 	((uint32_t *)vendor)[2] = args.data[2];

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 06:55:50 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B8E6C1F6;
 Tue, 24 Jun 2014 06:55:50 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9A2E3256C;
 Tue, 24 Jun 2014 06:55:50 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5O6topH035070;
 Tue, 24 Jun 2014 06:55:50 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5O6toY9035067;
 Tue, 24 Jun 2014 06:55:50 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201406240655.s5O6toY9035067@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 24 Jun 2014 06:55:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267815 - head/sys/crypto/aesni
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 06:55:50 -0000

Author: kib
Date: Tue Jun 24 06:55:49 2014
New Revision: 267815
URL: http://svnweb.freebsd.org/changeset/base/267815

Log:
  Put the aesni_cipher_setup() and aesni_cipher_process() functions into
  the file which is compiled with SSE disabled.  The functions set up
  the FPU context for kernel, and compiler optimizations which could
  lead to use of XMM registers before the fpu_kern_enter(9) is called or
  after fpu_kern_leave(9), panic the machine.
  
  Discussed with:	jmg
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/crypto/aesni/aesni.c
  head/sys/crypto/aesni/aesni.h
  head/sys/crypto/aesni/aesni_wrap.c

Modified: head/sys/crypto/aesni/aesni.c
==============================================================================
--- head/sys/crypto/aesni/aesni.c	Tue Jun 24 06:52:32 2014	(r267814)
+++ head/sys/crypto/aesni/aesni.c	Tue Jun 24 06:55:49 2014	(r267815)
@@ -53,6 +53,10 @@ static int aesni_newsession(device_t, ui
 static int aesni_freesession(device_t, uint64_t tid);
 static void aesni_freesession_locked(struct aesni_softc *sc,
     struct aesni_session *ses);
+static int aesni_cipher_setup(struct aesni_session *ses,
+    struct cryptoini *encini);
+static int aesni_cipher_process(struct aesni_session *ses,
+    struct cryptodesc *enccrd, struct cryptop *crp);
 
 MALLOC_DEFINE(M_AESNI, "aesni_data", "AESNI Data");
 
@@ -354,3 +358,91 @@ static devclass_t aesni_devclass;
 DRIVER_MODULE(aesni, nexus, aesni_driver, aesni_devclass, 0, 0);
 MODULE_VERSION(aesni, 1);
 MODULE_DEPEND(aesni, crypto, 1, 1, 1);
+
+static int
+aesni_cipher_setup(struct aesni_session *ses, struct cryptoini *encini)
+{
+	struct thread *td;
+	int error;
+
+	td = curthread;
+	error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL |
+	    FPU_KERN_KTHR);
+	if (error != 0)
+		return (error);
+	error = aesni_cipher_setup_common(ses, encini->cri_key,
+	    encini->cri_klen);
+	fpu_kern_leave(td, ses->fpu_ctx);
+	return (error);
+}
+
+static int
+aesni_cipher_process(struct aesni_session *ses, struct cryptodesc *enccrd,
+    struct cryptop *crp)
+{
+	struct thread *td;
+	uint8_t *buf;
+	int error, allocated;
+
+	buf = aesni_cipher_alloc(enccrd, crp, &allocated);
+	if (buf == NULL)
+		return (ENOMEM);
+
+	td = curthread;
+	error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL |
+	    FPU_KERN_KTHR);
+	if (error != 0)
+		goto out1;
+
+	if ((enccrd->crd_flags & CRD_F_KEY_EXPLICIT) != 0) {
+		error = aesni_cipher_setup_common(ses, enccrd->crd_key,
+		    enccrd->crd_klen);
+		if (error != 0)
+			goto out;
+	}
+
+	if ((enccrd->crd_flags & CRD_F_ENCRYPT) != 0) {
+		if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT) != 0)
+			bcopy(enccrd->crd_iv, ses->iv, AES_BLOCK_LEN);
+		if ((enccrd->crd_flags & CRD_F_IV_PRESENT) == 0)
+			crypto_copyback(crp->crp_flags, crp->crp_buf,
+			    enccrd->crd_inject, AES_BLOCK_LEN, ses->iv);
+		if (ses->algo == CRYPTO_AES_CBC) {
+			aesni_encrypt_cbc(ses->rounds, ses->enc_schedule,
+			    enccrd->crd_len, buf, buf, ses->iv);
+		} else /* if (ses->algo == CRYPTO_AES_XTS) */ {
+			aesni_encrypt_xts(ses->rounds, ses->enc_schedule,
+			    ses->xts_schedule, enccrd->crd_len, buf, buf,
+			    ses->iv);
+		}
+	} else {
+		if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT) != 0)
+			bcopy(enccrd->crd_iv, ses->iv, AES_BLOCK_LEN);
+		else
+			crypto_copydata(crp->crp_flags, crp->crp_buf,
+			    enccrd->crd_inject, AES_BLOCK_LEN, ses->iv);
+		if (ses->algo == CRYPTO_AES_CBC) {
+			aesni_decrypt_cbc(ses->rounds, ses->dec_schedule,
+			    enccrd->crd_len, buf, ses->iv);
+		} else /* if (ses->algo == CRYPTO_AES_XTS) */ {
+			aesni_decrypt_xts(ses->rounds, ses->dec_schedule,
+			    ses->xts_schedule, enccrd->crd_len, buf, buf,
+			    ses->iv);
+		}
+	}
+	if (allocated)
+		crypto_copyback(crp->crp_flags, crp->crp_buf, enccrd->crd_skip,
+		    enccrd->crd_len, buf);
+	if ((enccrd->crd_flags & CRD_F_ENCRYPT) != 0)
+		crypto_copydata(crp->crp_flags, crp->crp_buf,
+		    enccrd->crd_skip + enccrd->crd_len - AES_BLOCK_LEN,
+		    AES_BLOCK_LEN, ses->iv);
+out:
+	fpu_kern_leave(td, ses->fpu_ctx);
+out1:
+	if (allocated) {
+		bzero(buf, enccrd->crd_len);
+		free(buf, M_AESNI);
+	}
+	return (error);
+}

Modified: head/sys/crypto/aesni/aesni.h
==============================================================================
--- head/sys/crypto/aesni/aesni.h	Tue Jun 24 06:52:32 2014	(r267814)
+++ head/sys/crypto/aesni/aesni.h	Tue Jun 24 06:55:49 2014	(r267815)
@@ -96,11 +96,8 @@ void aesni_decrypt_xts(int rounds, const
     const void *tweak_schedule /*__aligned(16)*/, size_t len,
     const uint8_t *from, uint8_t *to, const uint8_t iv[AES_BLOCK_LEN]);
 
-int aesni_cipher_setup(struct aesni_session *ses,
-    struct cryptoini *encini);
-int aesni_cipher_process(struct aesni_session *ses,
-    struct cryptodesc *enccrd, struct cryptop *crp);
-
+int aesni_cipher_setup_common(struct aesni_session *ses, const uint8_t *key,
+    int keylen);
 uint8_t *aesni_cipher_alloc(struct cryptodesc *enccrd, struct cryptop *crp,
     int *allocated);
 

Modified: head/sys/crypto/aesni/aesni_wrap.c
==============================================================================
--- head/sys/crypto/aesni/aesni_wrap.c	Tue Jun 24 06:52:32 2014	(r267814)
+++ head/sys/crypto/aesni/aesni_wrap.c	Tue Jun 24 06:55:49 2014	(r267815)
@@ -329,7 +329,7 @@ aesni_decrypt_xts(int rounds, const void
 	    iv, 0);
 }
 
-static int
+int
 aesni_cipher_setup_common(struct aesni_session *ses, const uint8_t *key,
     int keylen)
 {
@@ -377,91 +377,3 @@ aesni_cipher_setup_common(struct aesni_s
 
 	return (0);
 }
-
-int
-aesni_cipher_setup(struct aesni_session *ses, struct cryptoini *encini)
-{
-	struct thread *td;
-	int error;
-
-	td = curthread;
-	error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL |
-	    FPU_KERN_KTHR);
-	if (error != 0)
-		return (error);
-	error = aesni_cipher_setup_common(ses, encini->cri_key,
-	    encini->cri_klen);
-	fpu_kern_leave(td, ses->fpu_ctx);
-	return (error);
-}
-
-int
-aesni_cipher_process(struct aesni_session *ses, struct cryptodesc *enccrd,
-    struct cryptop *crp)
-{
-	struct thread *td;
-	uint8_t *buf;
-	int error, allocated;
-
-	buf = aesni_cipher_alloc(enccrd, crp, &allocated);
-	if (buf == NULL)
-		return (ENOMEM);
-
-	td = curthread;
-	error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL |
-	    FPU_KERN_KTHR);
-	if (error != 0)
-		goto out1;
-
-	if ((enccrd->crd_flags & CRD_F_KEY_EXPLICIT) != 0) {
-		error = aesni_cipher_setup_common(ses, enccrd->crd_key,
-		    enccrd->crd_klen);
-		if (error != 0)
-			goto out;
-	}
-
-	if ((enccrd->crd_flags & CRD_F_ENCRYPT) != 0) {
-		if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT) != 0)
-			bcopy(enccrd->crd_iv, ses->iv, AES_BLOCK_LEN);
-		if ((enccrd->crd_flags & CRD_F_IV_PRESENT) == 0)
-			crypto_copyback(crp->crp_flags, crp->crp_buf,
-			    enccrd->crd_inject, AES_BLOCK_LEN, ses->iv);
-		if (ses->algo == CRYPTO_AES_CBC) {
-			aesni_encrypt_cbc(ses->rounds, ses->enc_schedule,
-			    enccrd->crd_len, buf, buf, ses->iv);
-		} else /* if (ses->algo == CRYPTO_AES_XTS) */ {
-			aesni_encrypt_xts(ses->rounds, ses->enc_schedule,
-			    ses->xts_schedule, enccrd->crd_len, buf, buf,
-			    ses->iv);
-		}
-	} else {
-		if ((enccrd->crd_flags & CRD_F_IV_EXPLICIT) != 0)
-			bcopy(enccrd->crd_iv, ses->iv, AES_BLOCK_LEN);
-		else
-			crypto_copydata(crp->crp_flags, crp->crp_buf,
-			    enccrd->crd_inject, AES_BLOCK_LEN, ses->iv);
-		if (ses->algo == CRYPTO_AES_CBC) {
-			aesni_decrypt_cbc(ses->rounds, ses->dec_schedule,
-			    enccrd->crd_len, buf, ses->iv);
-		} else /* if (ses->algo == CRYPTO_AES_XTS) */ {
-			aesni_decrypt_xts(ses->rounds, ses->dec_schedule,
-			    ses->xts_schedule, enccrd->crd_len, buf, buf,
-			    ses->iv);
-		}
-	}
-	if (allocated)
-		crypto_copyback(crp->crp_flags, crp->crp_buf, enccrd->crd_skip,
-		    enccrd->crd_len, buf);
-	if ((enccrd->crd_flags & CRD_F_ENCRYPT) != 0)
-		crypto_copydata(crp->crp_flags, crp->crp_buf,
-		    enccrd->crd_skip + enccrd->crd_len - AES_BLOCK_LEN,
-		    AES_BLOCK_LEN, ses->iv);
-out:
-	fpu_kern_leave(td, ses->fpu_ctx);
-out1:
-	if (allocated) {
-		bzero(buf, enccrd->crd_len);
-		free(buf, M_AESNI);
-	}
-	return (error);
-}

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 07:50:49 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id AB4CAF1;
 Tue, 24 Jun 2014 07:50:49 +0000 (UTC)
Received: from zibbi.meraka.csir.co.za (zibbi.meraka.csir.co.za
 [IPv6:2001:4200:7000:2::1])
 by mx1.freebsd.org (Postfix) with ESMTP id 4F1EE2A45;
 Tue, 24 Jun 2014 07:50:49 +0000 (UTC)
Received: by zibbi.meraka.csir.co.za (Postfix, from userid 3973)
 id 136AEB84D; Tue, 24 Jun 2014 09:50:46 +0200 (SAST)
Date: Tue, 24 Jun 2014 09:50:46 +0200
From: John Hay 
To: Hiroki Sato 
Subject: Re: svn commit: r267812 - head/etc
Message-ID: <20140624075045.GA53292@zibbi.meraka.csir.co.za>
References: <201406240437.s5O4baoe064856@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201406240437.s5O4baoe064856@svn.freebsd.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 07:50:49 -0000

Hi Hiroki,

Thanks for committing it. Will you also be merging it to 10? That is where
I picked up the problem first.

I see there was a bug filed over the weekend that looks like it might be
the same problem:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191252

Regards

John
--
John Hay -- jhay@meraka.csir.co.za / jhay@meraka.org.za / jhay@FreeBSD.org

On Tue, Jun 24, 2014 at 04:37:36AM +0000, Hiroki Sato wrote:
> Author: hrs
> Date: Tue Jun 24 04:37:36 2014
> New Revision: 267812
> URL: http://svnweb.freebsd.org/changeset/base/267812
> 
> Log:
>   Fix ifname normalization.  ifconfig_IF_alias{es,N} did not work if ifname has
>   any of [.-/+].
>   
>   Spotted by:	jhay
> 
> Modified:
>   head/etc/network.subr
> 
> Modified: head/etc/network.subr
> ==============================================================================
> --- head/etc/network.subr	Tue Jun 24 02:02:51 2014	(r267811)
> +++ head/etc/network.subr	Tue Jun 24 04:37:36 2014	(r267812)
> @@ -1077,7 +1077,7 @@ ifalias_af_common_handler()
>  ifalias_af_common()
>  {
>  	local _ret _if _af _action alias ifconfig_args _aliasn _c _tmpargs _iaf
> -	local _punct=".-/+"
> +	local _vif _punct=".-/+"
>  
>  	_ret=1
>  	_aliasn=
> @@ -1086,11 +1086,11 @@ ifalias_af_common()
>  	_action=$3
>  
>  	# Normalize $_if before using it in a pattern to list_vars()
> -	ltr "$_if" "$_punct" "_" _if
> +	ltr "$_if" "$_punct" "_" _vif
>  
>  	# ifconfig_IF_aliasN which starts with $_af
> -	for alias in `list_vars ifconfig_${_if}_alias[0-9]\* |
> -		sort_lite -nk1.$((9+${#_if}+7))`
> +	for alias in `list_vars ifconfig_${_vif}_alias[0-9]\* |
> +		sort_lite -nk1.$((9+${#_vif}+7))`
>  	do
>  		eval ifconfig_args=\"\$$alias\"
>  		_iaf=
> @@ -1118,8 +1118,8 @@ ifalias_af_common()
>  	# backward compatibility: ipv6_ifconfig_IF_aliasN.
>  	case $_af in
>  	inet6)
> -		for alias in `list_vars ipv6_ifconfig_${_if}_alias[0-9]\* |
> -			sort_lite -nk1.$((14+${#_if}+7))`
> +		for alias in `list_vars ipv6_ifconfig_${_vif}_alias[0-9]\* |
> +			sort_lite -nk1.$((14+${#_vif}+7))`
>  		do
>  			eval ifconfig_args=\"\$$alias\"
>  			case ${_action}:"${ifconfig_args}" in
> @@ -1129,7 +1129,7 @@ ifalias_af_common()
>  			alias:*)
>  				_aliasn="${_aliasn} inet6 ${ifconfig_args}"
>  				warn "\$${alias} is obsolete. " \
> -				    "Use ifconfig_$1_aliasN instead."
> +				    "Use ifconfig_${_vif}_aliasN instead."
>  			;;
>  			esac
>  		done


From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 08:55:06 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6C20940C;
 Tue, 24 Jun 2014 08:55:06 +0000 (UTC)
Received: from mail.allbsd.org (gatekeeper.allbsd.org
 [IPv6:2001:2f0:104:e001::32])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "*.allbsd.org", Issuer "RapidSSL CA" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id E1E4E2F70;
 Tue, 24 Jun 2014 08:55:05 +0000 (UTC)
Received: from alph.d.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956])
 (authenticated bits=56)
 by mail.allbsd.org (8.14.8/8.14.8) with ESMTP id s5O8sjEE029800
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Tue, 24 Jun 2014 17:54:56 +0900 (JST) (envelope-from hrs@FreeBSD.org)
Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0)
 by alph.d.allbsd.org (8.14.8/8.14.8) with ESMTP id s5O8sgid035564;
 Tue, 24 Jun 2014 17:54:45 +0900 (JST) (envelope-from hrs@FreeBSD.org)
Date: Tue, 24 Jun 2014 17:54:15 +0900 (JST)
Message-Id: <20140624.175415.157028083436503988.hrs@allbsd.org>
To: jhay@meraka.org.za
Subject: Re: svn commit: r267812 - head/etc
From: Hiroki Sato 
In-Reply-To: <20140624075045.GA53292@zibbi.meraka.csir.co.za>
References: <201406240437.s5O4baoe064856@svn.freebsd.org>
 <20140624075045.GA53292@zibbi.meraka.csir.co.za>
X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530  FFD7 4F2C D3D8 2793 CF2D
X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Multipart/Signed; protocol="application/pgp-signature";
 micalg=pgp-sha1;
 boundary="--Security_Multipart(Tue_Jun_24_17_54_15_2014_492)--"
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org
X-Virus-Status: Clean
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7
 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]);
 Tue, 24 Jun 2014 17:54:58 +0900 (JST)
X-Spam-Status: No, score=-97.7 required=13.0 tests=CONTENT_TYPE_PRESENT,
 QENCPTR1,RDNS_NONE,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
 gatekeeper.allbsd.org
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 08:55:06 -0000

----Security_Multipart(Tue_Jun_24_17_54_15_2014_492)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

John Hay  wrote
  in <20140624075045.GA53292@zibbi.meraka.csir.co.za>:

jh> Hi Hiroki,
jh>
jh> Thanks for committing it. Will you also be merging it to 10? That is where
jh> I picked up the problem first.
jh>
jh> I see there was a bug filed over the weekend that looks like it might be
jh> the same problem:
jh>
jh> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191252

 Thank you for the reminder.  Yes, I will merge the change into 10,
 too.

-- Hiroki

----Security_Multipart(Tue_Jun_24_17_54_15_2014_492)--
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEABECAAYFAlOpPLcACgkQTyzT2CeTzy0ffQCglZ+rn99Uo5iXjSJ6N5UsspV9
JboAoLEN4y6SqnmN9YSSpHNfWjyTO/+d
=KxAy
-----END PGP SIGNATURE-----

----Security_Multipart(Tue_Jun_24_17_54_15_2014_492)----

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 12:57:49 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 49DA9B34;
 Tue, 24 Jun 2014 12:57:49 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 34A5725DB;
 Tue, 24 Jun 2014 12:57:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5OCvnff005558;
 Tue, 24 Jun 2014 12:57:49 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5OCvnf9005557;
 Tue, 24 Jun 2014 12:57:49 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201406241257.s5OCvnf9005557@svn.freebsd.org>
From: Gavin Atkinson 
Date: Tue, 24 Jun 2014 12:57:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267818 - head/share/misc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 12:57:49 -0000

Author: gavin
Date: Tue Jun 24 12:57:48 2014
New Revision: 267818
URL: http://svnweb.freebsd.org/changeset/base/267818

Log:
  Add missing linefeed.

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==============================================================================
--- head/share/misc/committers-ports.dot	Tue Jun 24 12:45:06 2014	(r267817)
+++ head/share/misc/committers-ports.dot	Tue Jun 24 12:57:48 2014	(r267818)
@@ -183,7 +183,7 @@ rene [label="Rene Ladan\nrene@FreeBSD.or
 riggs [label="Thomas Zander\nriggs@FreeBSD.org\n2014/01/09"]
 rm [label="Ruslan Makhmatkhanov\nrm@FreeBSD.org\n2011/11/06"]
 rnoland [label="Robert Noland\nrnoland@FreeBSD.org\n2008/07/21"]
-robak [label="Bartek Rutkowski\robak@FreeBSD.org\n2014/06/10"]
+robak [label="Bartek Rutkowski\nrobak@FreeBSD.org\n2014/06/10"]
 rodrigo [label="Rodrigo Osorio\nrodrigo@FreeBSD.org\n2014/01/15"]
 romain [label="Romain Tartiere\nromain@FreeBSD.org\n2010/01/24"]
 sahil [label="Sahil Tandon\nsahil@FreeBSD.org\n2010/04/11"]

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 15:16:55 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id EFBDA2F2;
 Tue, 24 Jun 2014 15:16:55 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C247F251A;
 Tue, 24 Jun 2014 15:16:55 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5OFGtCO072623;
 Tue, 24 Jun 2014 15:16:55 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5OFGt9J072622;
 Tue, 24 Jun 2014 15:16:55 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201406241516.s5OFGt9J072622@svn.freebsd.org>
From: Attilio Rao 
Date: Tue, 24 Jun 2014 15:16:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267820 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 15:16:56 -0000

Author: attilio
Date: Tue Jun 24 15:16:55 2014
New Revision: 267820
URL: http://svnweb.freebsd.org/changeset/base/267820

Log:
  sysctl subsystem uses sxlocks so avoid to setup dynamic sysctl nodes
  before sleepinit() has been fully executed in the SLEEPQUEUE_PROFILING
  case.
  
  Sponsored by:	EMC / Isilon storage division

Modified:
  head/sys/kern/subr_sleepqueue.c

Modified: head/sys/kern/subr_sleepqueue.c
==============================================================================
--- head/sys/kern/subr_sleepqueue.c	Tue Jun 24 15:03:00 2014	(r267819)
+++ head/sys/kern/subr_sleepqueue.c	Tue Jun 24 15:16:55 2014	(r267820)
@@ -166,24 +166,20 @@ SDT_PROBE_DECLARE(sched, , , sleep);
 SDT_PROBE_DECLARE(sched, , , wakeup);
 
 /*
- * Early initialization of sleep queues that is called from the sleepinit()
- * SYSINIT.
+ * Initialize SLEEPQUEUE_PROFILING specific sysctl nodes.
+ * Note that it must happen after sleepinit() has been fully executed, so
+ * it must happen after SI_SUB_KMEM SYSINIT() subsystem setup.
  */
-void
-init_sleepqueues(void)
-{
 #ifdef SLEEPQUEUE_PROFILING
-	struct sysctl_oid *chain_oid;
+static void
+init_sleepqueue_profiling(void)
+{
 	char chain_name[10];
-#endif
-	int i;
+	struct sysctl_oid *chain_oid;
+	u_int i;
 
 	for (i = 0; i < SC_TABLESIZE; i++) {
-		LIST_INIT(&sleepq_chains[i].sc_queues);
-		mtx_init(&sleepq_chains[i].sc_lock, "sleepq chain", NULL,
-		    MTX_SPIN | MTX_RECURSE);
-#ifdef SLEEPQUEUE_PROFILING
-		snprintf(chain_name, sizeof(chain_name), "%d", i);
+		snprintf(chain_name, sizeof(chain_name), "%u", i);
 		chain_oid = SYSCTL_ADD_NODE(NULL, 
 		    SYSCTL_STATIC_CHILDREN(_debug_sleepq_chains), OID_AUTO,
 		    chain_name, CTLFLAG_RD, NULL, "sleepq chain stats");
@@ -192,7 +188,26 @@ init_sleepqueues(void)
 		SYSCTL_ADD_UINT(NULL, SYSCTL_CHILDREN(chain_oid), OID_AUTO,
 		    "max_depth", CTLFLAG_RD, &sleepq_chains[i].sc_max_depth, 0,
 		    NULL);
+	}
+}
+
+SYSINIT(sleepqueue_profiling, SI_SUB_LOCK, SI_ORDER_ANY,
+    init_sleepqueue_profiling, NULL);
 #endif
+
+/*
+ * Early initialization of sleep queues that is called from the sleepinit()
+ * SYSINIT.
+ */
+void
+init_sleepqueues(void)
+{
+	int i;
+
+	for (i = 0; i < SC_TABLESIZE; i++) {
+		LIST_INIT(&sleepq_chains[i].sc_queues);
+		mtx_init(&sleepq_chains[i].sc_lock, "sleepq chain", NULL,
+		    MTX_SPIN | MTX_RECURSE);
 	}
 	sleepq_zone = uma_zcreate("SLEEPQUEUE", sizeof(struct sleepqueue),
 #ifdef INVARIANTS

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 16:08:16 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 55C92E9
 for ; Tue, 24 Jun 2014 16:08:16 +0000 (UTC)
Received: from mail-qc0-f172.google.com (mail-qc0-f172.google.com
 [209.85.216.172])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id E5EBC2B4E
 for ; Tue, 24 Jun 2014 16:08:15 +0000 (UTC)
Received: by mail-qc0-f172.google.com with SMTP id o8so486223qcw.17
 for ; Tue, 24 Jun 2014 09:08:09 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:sender:from:content-type:mime-version:subject
 :in-reply-to:date:cc:content-transfer-encoding:message-id:references
 :to; bh=hkPyI64dAFF7P/n325R2w/epzJIhebkGQWSnhH6f0C4=;
 b=T2YI5zkjEK7lLZF35Ur98mICl+6WLP2vimvv/WFwwsAwbDuOiD2KV2BWnSXzsUqJgM
 rufzzQCwU2LB8pA0WgCufOyhTSqUYFjVrzZ6YMl0deAFoMmoBOf/dK1Bh4iYtm74VHnM
 cXgxuy1btNEV/8oHxjtNHkN1owt3y7IT/7Wbw164EDbq+wfn3FYogxsuC0nXx7OsEqIX
 VPk4EbH70C4LDreu46W3LWKyULUFm/Cc50JCbg1OHp+GpQs/PyzdunpxjsHajeg8SQvY
 chjM6+JH3iJliXXGtZVDGMulZBAouVzGBmoDGrEM/xQveZXJK/AmMZPc1VEwxKOItIqb
 wo4g==
X-Gm-Message-State: ALoCoQnMn3KfYG6+KMQl+qUBSuhgACuk2ffU9lUKxUQYNzsZELnTZ4Ddvxy/6DwUijFFzltj7ubq
X-Received: by 10.224.38.4 with SMTP id z4mr3334707qad.94.1403626089540;
 Tue, 24 Jun 2014 09:08:09 -0700 (PDT)
Received: from [172.19.248.35] ([64.88.227.134])
 by mx.google.com with ESMTPSA id y10sm1065699qal.32.2014.06.24.09.08.04
 for 
 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Tue, 24 Jun 2014 09:08:09 -0700 (PDT)
Sender: Warner Losh 
From: Warner Losh 
X-Google-Original-From: Warner Losh 
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r267758 - head
In-Reply-To: <201406230054.s5N0suIA081734@svn.freebsd.org>
Date: Tue, 24 Jun 2014 10:07:55 -0600
Content-Transfer-Encoding: quoted-printable
Message-Id: <256E890F-9564-4741-A5D8-89543381CF2D@gmail.com>
References: <201406230054.s5N0suIA081734@svn.freebsd.org>
To: "Andrey A. Chernov" 
X-Mailer: Apple Mail (2.1878.2)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 16:08:16 -0000


On Jun 22, 2014, at 6:54 PM, Andrey A. Chernov  wrote:

> Author: ache
> Date: Mon Jun 23 00:54:56 2014
> New Revision: 267758
> URL: http://svnweb.freebsd.org/changeset/base/267758
>=20
> Log:
>  Change suggestion how to set MAKESYSPATH as broken incremental build
>  workaround. Magic ".../share/mk" (search directories up to /)
>  does not work for f.e. /usr/src/gnu/lib/libgcc because the path
>  inside is starting from /usr/obj hierarchy and ends up in
>  /usr/share/mk, not in the /usr/src/share/mk where src.opts.mk is.
>  IMHO proper fixing of incremental build is needed urgently.

I don=92t understand how this is even possible. This change is wrong =
because it has a bogus path the doesn=92t exist on all systems. I=92m =
going to fix that.

Agreed on incremental builds, but that is turning out to be harder than =
expected. It is broken, but adding broken advise is even worse.

Warner


> Modified:
>  head/UPDATING
>=20
> Modified: head/UPDATING
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/UPDATING	Sun Jun 22 23:40:20 2014	(r267757)
> +++ head/UPDATING	Mon Jun 23 00:54:56 2014	(r267758)
> @@ -67,7 +67,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
> 	behavior back, you can .include /etc/src.conf from =
/etc/make.conf
> 	(which is still global and isn't changed). This also changes the
> 	behavior of incremental builds inside the tree of individual
> -	directories. Set MAKESYSPATH to ".../share/mk" to do that.
> +	directories. Set MAKESYSPATH to "/usr/src/share/mk" to do that.
> 	Although this has survived make universe and some upgrade =
scenarios,
> 	other upgrade scenarios may have broken. At least one form of
> 	temporary breakage was fixed with MAKESYSPATH settings for =
buildworld
>=20


From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 16:10:49 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2E4452DD;
 Tue, 24 Jun 2014 16:10:49 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1BB1A2B90;
 Tue, 24 Jun 2014 16:10:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5OGAmrK098192;
 Tue, 24 Jun 2014 16:10:48 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5OGAmKL098191;
 Tue, 24 Jun 2014 16:10:48 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201406241610.s5OGAmKL098191@svn.freebsd.org>
From: Warner Losh 
Date: Tue, 24 Jun 2014 16:10:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267824 - head
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 16:10:49 -0000

Author: imp
Date: Tue Jun 24 16:10:48 2014
New Revision: 267824
URL: http://svnweb.freebsd.org/changeset/base/267824

Log:
  Remove fixed path as part of suggestion. Three dots are fine for most
  uses. Add a note about a correct workaround.

Modified:
  head/UPDATING

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Tue Jun 24 15:57:48 2014	(r267823)
+++ head/UPDATING	Tue Jun 24 16:10:48 2014	(r267824)
@@ -67,11 +67,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
 	behavior back, you can .include /etc/src.conf from /etc/make.conf
 	(which is still global and isn't changed). This also changes the
 	behavior of incremental builds inside the tree of individual
-	directories. Set MAKESYSPATH to "/usr/src/share/mk" to do that.
+	directories. Set MAKESYSPATH to ".../share/mk" to do that.
 	Although this has survived make universe and some upgrade scenarios,
 	other upgrade scenarios may have broken. At least one form of
 	temporary breakage was fixed with MAKESYSPATH settings for buildworld
-	as well...
+	as well... In cases where MAKESYSPATH isn't working with this
+	setting, you'll need to set it to the full path to your tree.
 
 	One side effect of all this cleaning up is that bsd.compiler.mk
 	is no longer implicitly included by bsd.own.mk. If you wish to

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 17:25:50 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9AAE26E6
 for ; Tue, 24 Jun 2014 17:25:50 +0000 (UTC)
Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com
 [209.85.217.174])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 1FE32239B
 for ; Tue, 24 Jun 2014 17:25:49 +0000 (UTC)
Received: by mail-lb0-f174.google.com with SMTP id u10so913707lbd.19
 for ; Tue, 24 Jun 2014 10:25:42 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to
 :cc:subject:references:in-reply-to:content-type
 :content-transfer-encoding;
 bh=Sz79KJqx7jtxk4lMBTXUK3bgbn8l1DhZVSrUWnq1PfQ=;
 b=KEjGa9LHL9fMY0UytMw9jYJTop90DDIsi3qCDuNUdHUEDToHL1UUQDf1mvw/6ieSHB
 +Fhpz6ab5GNKB3QGBEv9Dtw9cJNQVLK5imyAVnlxSrnl8Hocs5wxYtqaWRVJPw2PMvJH
 5GWggM8da9if33wZT/hRbIqyDCIlt70YqEVqFB5WDJjoE0YKloLCCJRzEoHHJQgZ+tZg
 iPeciMLBpVz1JLNHbV3jFACfUow1d6Mg/jaia0hpW2s7bPKyaSLR1yywLuOwQ2VqPfUr
 /8j5UhDNKJBCt+FgYl58rYMmCsSmroq7iy8LHnpJVkrqObyjE2MG7H1hSkxPSr68Dchq
 3OPA==
X-Gm-Message-State: ALoCoQkuetgKbdwTlCogClIqBy834V2jctc1Hk9Z/tYoUNIjR2ZXNd86wAceU/eqnjcULN4+leLg
X-Received: by 10.152.23.103 with SMTP id l7mr1564433laf.39.1403630742079;
 Tue, 24 Jun 2014 10:25:42 -0700 (PDT)
Received: from [192.168.1.2] ([89.169.173.68])
 by mx.google.com with ESMTPSA id f9sm372752lae.16.2014.06.24.10.25.41
 for 
 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Tue, 24 Jun 2014 10:25:41 -0700 (PDT)
Message-ID: <53A9B494.3020709@freebsd.org>
Date: Tue, 24 Jun 2014 21:25:40 +0400
From: Andrey Chernov 
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Warner Losh 
Subject: Re: svn commit: r267758 - head
References: <201406230054.s5N0suIA081734@svn.freebsd.org>
 <256E890F-9564-4741-A5D8-89543381CF2D@gmail.com>
In-Reply-To: <256E890F-9564-4741-A5D8-89543381CF2D@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 17:25:50 -0000

On 24.06.2014 20:07, Warner Losh wrote:
>> Log:
>>  Change suggestion how to set MAKESYSPATH as broken incremental build
>>  workaround. Magic ".../share/mk" (search directories up to /)
>>  does not work for f.e. /usr/src/gnu/lib/libgcc because the path
>>  inside is starting from /usr/obj hierarchy and ends up in
>>  /usr/share/mk, not in the /usr/src/share/mk where src.opts.mk is.
>>  IMHO proper fixing of incremental build is needed urgently.
> 
> I don’t understand how this is even possible. This change is wrong because it has a bogus path the doesn’t exist on all systems. I’m going to fix that.

How it is possible:
cd /usr/src/gnu/lib/libgcc
make

-- 
http://ache.vniz.net/

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 18:07:51 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0361848A
 for ; Tue, 24 Jun 2014 18:07:51 +0000 (UTC)
Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com
 [209.85.217.178])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 7CE6727B1
 for ; Tue, 24 Jun 2014 18:07:50 +0000 (UTC)
Received: by mail-lb0-f178.google.com with SMTP id 10so975246lbg.23
 for ; Tue, 24 Jun 2014 11:07:47 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to
 :cc:subject:references:in-reply-to:content-type
 :content-transfer-encoding;
 bh=SEuLzqHfTjDkbsWOTNVgN4rxpSvxpal74R3Fk2CvqV4=;
 b=daXhiGwPQ7RTT16mHqdWgDdX9/b6HBYbco1a2ghl6cWRd0jjVx6USfua2LEQBEbFCX
 /q7+cknyg52/VkE9yA1V7x0JXMX0laauPEJTQfqY7ZxGLUfJGn0usoEad1SLJgEmTNlJ
 ibYkYpkx0Bv0jShWDuX7bbXte6Et9A/kLQP401QDRh/IfdDFbWwnhiuRQyvpzBfsSps1
 wGm3KDUjg43x14fzw7vGbWP3IEB2pFwAY5rR/hG55Fm7Hn3AQgjPM1erX6ONLpbm8fcQ
 J5fnCHtuL6z/nVzxTZABy3fybaPj4vK2w2ksA9F1jReeikIgv47dpdrBP5KcMh4Hp14u
 VkyA==
X-Gm-Message-State: ALoCoQlvtuT3sTrOGpbCE2s6VslD6G6JUTptTkkAN7lmsn2ylA1wb5Liqf7xvKfntwj4EjdGSy7Z
X-Received: by 10.152.27.66 with SMTP id r2mr1677794lag.53.1403632839421;
 Tue, 24 Jun 2014 11:00:39 -0700 (PDT)
Received: from [192.168.1.2] ([89.169.173.68])
 by mx.google.com with ESMTPSA id q3sm407173lae.23.2014.06.24.11.00.38
 for 
 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Tue, 24 Jun 2014 11:00:38 -0700 (PDT)
Message-ID: <53A9BCC5.4030105@freebsd.org>
Date: Tue, 24 Jun 2014 22:00:37 +0400
From: Andrey Chernov 
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Warner Losh 
Subject: Re: svn commit: r267758 - head
References: <201406230054.s5N0suIA081734@svn.freebsd.org>
 <256E890F-9564-4741-A5D8-89543381CF2D@gmail.com>
 <53A9B494.3020709@freebsd.org>
In-Reply-To: <53A9B494.3020709@freebsd.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 18:07:51 -0000

On 24.06.2014 21:25, Andrey Chernov wrote:
> On 24.06.2014 20:07, Warner Losh wrote:
>>> Log:
>>>  Change suggestion how to set MAKESYSPATH as broken incremental build
>>>  workaround. Magic ".../share/mk" (search directories up to /)
>>>  does not work for f.e. /usr/src/gnu/lib/libgcc because the path
>>>  inside is starting from /usr/obj hierarchy and ends up in
>>>  /usr/share/mk, not in the /usr/src/share/mk where src.opts.mk is.
>>>  IMHO proper fixing of incremental build is needed urgently.
>>
>> I don’t understand how this is even possible. This change is wrong because it has a bogus path the doesn’t exist on all systems. I’m going to fix that.
> 
> How it is possible:
> cd /usr/src/gnu/lib/libgcc
> make
> 

P.S. I have to insert debugging printfs into bmake .../ traverse code to
discover that hierarchy down here starts with /usr/obj

-- 
http://ache.vniz.net/

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 18:25:43 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id CFC1D93E;
 Tue, 24 Jun 2014 18:25:43 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BC91A2984;
 Tue, 24 Jun 2014 18:25:43 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5OIPhFZ065500;
 Tue, 24 Jun 2014 18:25:43 GMT
 (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5OIPhi9065499;
 Tue, 24 Jun 2014 18:25:43 GMT
 (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201406241825.s5OIPhi9065499@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Tue, 24 Jun 2014 18:25:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267825 - head/sys/fs/cuse
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 18:25:43 -0000

Author: hselasky
Date: Tue Jun 24 18:25:43 2014
New Revision: 267825
URL: http://svnweb.freebsd.org/changeset/base/267825

Log:
  Use existing PHOLD() and PRELE() macros.
  
  Submitted by:	kib @

Modified:
  head/sys/fs/cuse/cuse.c

Modified: head/sys/fs/cuse/cuse.c
==============================================================================
--- head/sys/fs/cuse/cuse.c	Tue Jun 24 16:10:48 2014	(r267824)
+++ head/sys/fs/cuse/cuse.c	Tue Jun 24 18:25:43 2014	(r267825)
@@ -813,15 +813,9 @@ cuse_proc2proc_copy(struct proc *proc_s,
 			.uio_td = td,
 		};
 
-		PROC_LOCK(proc_s);
-		_PHOLD(proc_s);
-		PROC_UNLOCK(proc_s);
-
+		PHOLD(proc_s);
 		error = proc_rwmem(proc_s, &uio);
-
-		PROC_LOCK(proc_s);
-		_PRELE(proc_s);
-		PROC_UNLOCK(proc_s);
+		PRELE(proc_s);
 
 	} else if (proc_cur == proc_s) {
 		struct iovec iov = {
@@ -838,15 +832,9 @@ cuse_proc2proc_copy(struct proc *proc_s,
 			.uio_td = td,
 		};
 
-		PROC_LOCK(proc_d);
-		_PHOLD(proc_d);
-		PROC_UNLOCK(proc_d);
-
+		PHOLD(proc_d);
 		error = proc_rwmem(proc_d, &uio);
-
-		PROC_LOCK(proc_d);
-		_PRELE(proc_d);
-		PROC_UNLOCK(proc_d);
+		PRELE(proc_d);
 	} else {
 		error = EINVAL;
 	}

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 18:56:45 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 91BC22A6;
 Tue, 24 Jun 2014 18:56:45 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7F3D12C89;
 Tue, 24 Jun 2014 18:56:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5OIujhE083686;
 Tue, 24 Jun 2014 18:56:45 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5OIujFD083685;
 Tue, 24 Jun 2014 18:56:45 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406241856.s5OIujFD083685@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 24 Jun 2014 18:56:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267826 - head
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 18:56:45 -0000

Author: mav
Date: Tue Jun 24 18:56:45 2014
New Revision: 267826
URL: http://svnweb.freebsd.org/changeset/base/267826

Log:
  Document r267639 CTL ABI breakage.

Modified:
  head/UPDATING

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Tue Jun 24 18:25:43 2014	(r267825)
+++ head/UPDATING	Tue Jun 24 18:56:45 2014	(r267826)
@@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
 	disable the most expensive debugging functionality run
 	"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20140619:
+	Maximal length of the serial number in CTL was increased from 16 to
+	64 chars, that breaks ABI.  All CTL-related tools, such as ctladm
+	and ctld, need to be rebuilt to work with a new kernel.
+
 20140606:
 	The libatf-c and libatf-c++ major versions were downgraded to 0 and
 	1 respectively to match the upstream numbers.  They were out of

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 19:04:34 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 139985BA;
 Tue, 24 Jun 2014 19:04:34 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id F3C562D51;
 Tue, 24 Jun 2014 19:04:33 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5OJ4XDO089216;
 Tue, 24 Jun 2014 19:04:33 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5OJ4Wj6089207;
 Tue, 24 Jun 2014 19:04:33 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201406241904.s5OJ4Wj6089207@svn.freebsd.org>
From: Xin LI 
Date: Tue, 24 Jun 2014 19:04:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267827 - in head/contrib/file: . Magdir
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 19:04:34 -0000

Author: delphij
Date: Tue Jun 24 19:04:32 2014
New Revision: 267827
URL: http://svnweb.freebsd.org/changeset/base/267827

Log:
  Fix multiple vulnerabilities in file(1) and libmagic(3).
  
  Security:	FreeBSD-SA-14:16.file
  Approved by:	so

Modified:
  head/contrib/file/Magdir/commands
  head/contrib/file/ascmagic.c
  head/contrib/file/file.h
  head/contrib/file/funcs.c
  head/contrib/file/softmagic.c

Modified: head/contrib/file/Magdir/commands
==============================================================================
--- head/contrib/file/Magdir/commands	Tue Jun 24 18:56:45 2014	(r267826)
+++ head/contrib/file/Magdir/commands	Tue Jun 24 19:04:32 2014	(r267827)
@@ -49,7 +49,8 @@
 !:mime	text/x-awk
 0	string/wt	#!\ /usr/bin/awk	awk script text executable
 !:mime	text/x-awk
-0	regex		=^\\s*BEGIN\\s*[{]	awk script text
+0	regex		=^\\s{0,100}BEGIN\\s{0,100}[{]	awk script text
+!:strength - 12
 
 # AT&T Bell Labs' Plan 9 shell
 0	string/wt	#!\ /bin/rc	Plan 9 rc shell script text executable

Modified: head/contrib/file/ascmagic.c
==============================================================================
--- head/contrib/file/ascmagic.c	Tue Jun 24 18:56:45 2014	(r267826)
+++ head/contrib/file/ascmagic.c	Tue Jun 24 19:04:32 2014	(r267827)
@@ -147,7 +147,7 @@ file_ascmagic_with_encoding(struct magic
 		    == NULL)
 			goto done;
 		if ((rv = file_softmagic(ms, utf8_buf,
-		    (size_t)(utf8_end - utf8_buf), TEXTTEST, text)) == 0)
+		    (size_t)(utf8_end - utf8_buf), 0, TEXTTEST, text)) == 0)
 			rv = -1;
 	}
 

Modified: head/contrib/file/file.h
==============================================================================
--- head/contrib/file/file.h	Tue Jun 24 18:56:45 2014	(r267826)
+++ head/contrib/file/file.h	Tue Jun 24 19:04:32 2014	(r267827)
@@ -414,7 +414,7 @@ protected int file_encoding(struct magic
     unichar **, size_t *, const char **, const char **, const char **);
 protected int file_is_tar(struct magic_set *, const unsigned char *, size_t);
 protected int file_softmagic(struct magic_set *, const unsigned char *, size_t,
-    int, int);
+    size_t, int, int);
 protected struct mlist *file_apprentice(struct magic_set *, const char *, int);
 protected uint64_t file_signextend(struct magic_set *, struct magic *,
     uint64_t);

Modified: head/contrib/file/funcs.c
==============================================================================
--- head/contrib/file/funcs.c	Tue Jun 24 18:56:45 2014	(r267826)
+++ head/contrib/file/funcs.c	Tue Jun 24 19:04:32 2014	(r267827)
@@ -228,7 +228,7 @@ file_buffer(struct magic_set *ms, int fd
 
 	/* try soft magic tests */
 	if ((ms->flags & MAGIC_NO_CHECK_SOFT) == 0)
-		if ((m = file_softmagic(ms, ubuf, nb, BINTEST,
+		if ((m = file_softmagic(ms, ubuf, nb, 0, BINTEST,
 		    looks_text)) != 0) {
 			if ((ms->flags & MAGIC_DEBUG) != 0)
 				(void)fprintf(stderr, "softmagic %d\n", m);

Modified: head/contrib/file/softmagic.c
==============================================================================
--- head/contrib/file/softmagic.c	Tue Jun 24 18:56:45 2014	(r267826)
+++ head/contrib/file/softmagic.c	Tue Jun 24 19:04:32 2014	(r267827)
@@ -43,9 +43,9 @@ FILE_RCSID("@(#)$File: softmagic.c,v 1.1
 
 
 private int match(struct magic_set *, struct magic *, uint32_t,
-    const unsigned char *, size_t, int, int);
+    const unsigned char *, size_t, int, int, int);
 private int mget(struct magic_set *, const unsigned char *,
-    struct magic *, size_t, unsigned int, int);
+    struct magic *, size_t, unsigned int, int, int);
 private int magiccheck(struct magic_set *, struct magic *);
 private int32_t mprint(struct magic_set *, struct magic *);
 private int32_t moffset(struct magic_set *, struct magic *);
@@ -60,6 +60,7 @@ private void cvt_16(union VALUETYPE *, c
 private void cvt_32(union VALUETYPE *, const struct magic *);
 private void cvt_64(union VALUETYPE *, const struct magic *);
 
+#define OFFSET_OOB(n, o, i)	((n) < (o) || (i) > ((n) - (o)))
 /*
  * softmagic - lookup one file in parsed, in-memory copy of database
  * Passed the name and FILE * of one file to be typed.
@@ -67,13 +68,13 @@ private void cvt_64(union VALUETYPE *, c
 /*ARGSUSED1*/		/* nbytes passed for regularity, maybe need later */
 protected int
 file_softmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes,
-    int mode, int text)
+    size_t level, int mode, int text)
 {
 	struct mlist *ml;
 	int rv;
 	for (ml = ms->mlist->next; ml != ms->mlist; ml = ml->next)
 		if ((rv = match(ms, ml->magic, ml->nmagic, buf, nbytes, mode,
-		    text)) != 0)
+		    text, level)) != 0)
 			return rv;
 
 	return 0;
@@ -108,7 +109,8 @@ file_softmagic(struct magic_set *ms, con
  */
 private int
 match(struct magic_set *ms, struct magic *magic, uint32_t nmagic,
-    const unsigned char *s, size_t nbytes, int mode, int text)
+    const unsigned char *s, size_t nbytes, int mode, int text,
+    int recursion_level)
 {
 	uint32_t magindex = 0;
 	unsigned int cont_level = 0;
@@ -140,7 +142,7 @@ match(struct magic_set *ms, struct magic
 		ms->line = m->lineno;
 
 		/* if main entry matches, print it... */
-		switch (mget(ms, s, m, nbytes, cont_level, text)) {
+		switch (mget(ms, s, m, nbytes, cont_level, text, recursion_level + 1)) {
 		case -1:
 			return -1;
 		case 0:
@@ -223,7 +225,7 @@ match(struct magic_set *ms, struct magic
 					continue;
 			}
 #endif
-			switch (mget(ms, s, m, nbytes, cont_level, text)) {
+			switch (mget(ms, s, m, nbytes, cont_level, text, recursion_level + 1)) {
 			case -1:
 				return -1;
 			case 0:
@@ -1018,12 +1020,18 @@ mcopy(struct magic_set *ms, union VALUET
 
 private int
 mget(struct magic_set *ms, const unsigned char *s,
-    struct magic *m, size_t nbytes, unsigned int cont_level, int text)
+    struct magic *m, size_t nbytes, unsigned int cont_level, int text,
+    int recursion_level)
 {
 	uint32_t offset = ms->offset;
 	uint32_t count = m->str_range;
 	union VALUETYPE *p = &ms->ms_value;
 
+        if (recursion_level >= 20) {
+                file_error(ms, 0, "recursion nesting exceeded");
+                return -1;
+        }
+
 	if (mcopy(ms, p, m->type, m->flag & INDIR, s, offset, nbytes, count) == -1)
 		return -1;
 
@@ -1073,7 +1081,7 @@ mget(struct magic_set *ms, const unsigne
 		}
 		switch (m->in_type) {
 		case FILE_BYTE:
-			if (nbytes < (offset + 1))
+			if (OFFSET_OOB(nbytes, offset, 1))
 				return 0;
 			if (off) {
 				switch (m->in_op & FILE_OPS_MASK) {
@@ -1108,7 +1116,7 @@ mget(struct magic_set *ms, const unsigne
 				offset = ~offset;
 			break;
 		case FILE_BESHORT:
-			if (nbytes < (offset + 2))
+			if (OFFSET_OOB(nbytes, offset, 2))
 				return 0;
 			if (off) {
 				switch (m->in_op & FILE_OPS_MASK) {
@@ -1160,7 +1168,7 @@ mget(struct magic_set *ms, const unsigne
 				offset = ~offset;
 			break;
 		case FILE_LESHORT:
-			if (nbytes < (offset + 2))
+			if (OFFSET_OOB(nbytes, offset, 2))
 				return 0;
 			if (off) {
 				switch (m->in_op & FILE_OPS_MASK) {
@@ -1212,7 +1220,7 @@ mget(struct magic_set *ms, const unsigne
 				offset = ~offset;
 			break;
 		case FILE_SHORT:
-			if (nbytes < (offset + 2))
+			if (OFFSET_OOB(nbytes, offset, 2))
 				return 0;
 			if (off) {
 				switch (m->in_op & FILE_OPS_MASK) {
@@ -1249,7 +1257,7 @@ mget(struct magic_set *ms, const unsigne
 			break;
 		case FILE_BELONG:
 		case FILE_BEID3:
-			if (nbytes < (offset + 4))
+			if (OFFSET_OOB(nbytes, offset, 4))
 				return 0;
 			if (off) {
 				switch (m->in_op & FILE_OPS_MASK) {
@@ -1320,7 +1328,7 @@ mget(struct magic_set *ms, const unsigne
 			break;
 		case FILE_LELONG:
 		case FILE_LEID3:
-			if (nbytes < (offset + 4))
+			if (OFFSET_OOB(nbytes, offset, 4))
 				return 0;
 			if (off) {
 				switch (m->in_op & FILE_OPS_MASK) {
@@ -1390,7 +1398,7 @@ mget(struct magic_set *ms, const unsigne
 				offset = ~offset;
 			break;
 		case FILE_MELONG:
-			if (nbytes < (offset + 4))
+			if (OFFSET_OOB(nbytes, offset, 4))
 				return 0;
 			if (off) {
 				switch (m->in_op & FILE_OPS_MASK) {
@@ -1460,7 +1468,7 @@ mget(struct magic_set *ms, const unsigne
 				offset = ~offset;
 			break;
 		case FILE_LONG:
-			if (nbytes < (offset + 4))
+			if (OFFSET_OOB(nbytes, offset, 4))
 				return 0;
 			if (off) {
 				switch (m->in_op & FILE_OPS_MASK) {
@@ -1527,14 +1535,14 @@ mget(struct magic_set *ms, const unsigne
 	/* Verify we have enough data to match magic type */
 	switch (m->type) {
 	case FILE_BYTE:
-		if (nbytes < (offset + 1)) /* should alway be true */
+		if (OFFSET_OOB(nbytes, offset, 1))
 			return 0;
 		break;
 
 	case FILE_SHORT:
 	case FILE_BESHORT:
 	case FILE_LESHORT:
-		if (nbytes < (offset + 2))
+		if (OFFSET_OOB(nbytes, offset, 2))
 			return 0;
 		break;
 
@@ -1553,21 +1561,21 @@ mget(struct magic_set *ms, const unsigne
 	case FILE_FLOAT:
 	case FILE_BEFLOAT:
 	case FILE_LEFLOAT:
-		if (nbytes < (offset + 4))
+		if (OFFSET_OOB(nbytes, offset, 4))
 			return 0;
 		break;
 
 	case FILE_DOUBLE:
 	case FILE_BEDOUBLE:
 	case FILE_LEDOUBLE:
-		if (nbytes < (offset + 8))
+		if (OFFSET_OOB(nbytes, offset, 8))
 			return 0;
 		break;
 
 	case FILE_STRING:
 	case FILE_PSTRING:
 	case FILE_SEARCH:
-		if (nbytes < (offset + m->vallen))
+		if (OFFSET_OOB(nbytes, offset, m->vallen))
 			return 0;
 		break;
 
@@ -1577,13 +1585,15 @@ mget(struct magic_set *ms, const unsigne
 		break;
 
 	case FILE_INDIRECT:
+		if (offset == 0)
+			return 0;
 	  	if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
 		    file_printf(ms, "%s", m->desc) == -1)
 			return -1;
 		if (nbytes < offset)
 			return 0;
 		return file_softmagic(ms, s + offset, nbytes - offset,
-		    BINTEST, text);
+		    recursion_level, BINTEST, text);
 
 	case FILE_DEFAULT:	/* nothing to check */
 	default:

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 19:12:56 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B1F93FD;
 Tue, 24 Jun 2014 19:12:56 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9ED282E49;
 Tue, 24 Jun 2014 19:12:56 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5OJCuPq094975;
 Tue, 24 Jun 2014 19:12:56 GMT
 (envelope-from jpaetzel@svn.freebsd.org)
Received: (from jpaetzel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5OJCuGC094973;
 Tue, 24 Jun 2014 19:12:56 GMT
 (envelope-from jpaetzel@svn.freebsd.org)
Message-Id: <201406241912.s5OJCuGC094973@svn.freebsd.org>
From: Josh Paetzel 
Date: Tue, 24 Jun 2014 19:12:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267833 - head/usr.sbin/ctld
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 19:12:56 -0000

Author: jpaetzel
Date: Tue Jun 24 19:12:55 2014
New Revision: 267833
URL: http://svnweb.freebsd.org/changeset/base/267833

Log:
  Fix issues in config parser relating to lun serial numbers.
  
  Without this fix some serial numbers needed to be quoted
  to avoid the config parser bailing out.
  
  Submitted by:	delphij
  Sponsored by:	iXsystems

Modified:
  head/usr.sbin/ctld/parse.y
  head/usr.sbin/ctld/token.l

Modified: head/usr.sbin/ctld/parse.y
==============================================================================
--- head/usr.sbin/ctld/parse.y	Tue Jun 24 19:05:47 2014	(r267832)
+++ head/usr.sbin/ctld/parse.y	Tue Jun 24 19:12:55 2014	(r267833)
@@ -659,6 +659,19 @@ lun_serial:	SERIAL STR
 		}
 		lun_set_serial(lun, $2);
 		free($2);
+	} |	SERIAL NUM
+	{
+		char *str = NULL;
+
+		if (lun->l_serial != NULL) {
+			log_warnx("serial for lun %d, target \"%s\" "
+			    "specified more than once",
+			    lun->l_lun, target->t_name);
+			return (1);
+		}
+		asprintf(&str, "%ju", $2);
+		lun_set_serial(lun, str);
+		free(str);
 	}
 	;
 

Modified: head/usr.sbin/ctld/token.l
==============================================================================
--- head/usr.sbin/ctld/token.l	Tue Jun 24 19:05:47 2014	(r267832)
+++ head/usr.sbin/ctld/token.l	Tue Jun 24 19:12:55 2014	(r267833)
@@ -74,8 +74,9 @@ target			{ return TARGET; }
 timeout			{ return TIMEOUT; }
 [0-9]+[kKmMgGtTpPeE]?	{ if (expand_number(yytext, &yylval.num) == 0)
 				return NUM;
-			  else
-				return STR;
+			  else {
+				yylval.str = strdup(yytext); return STR;
+			  }
 			}
 \"[^"]+\"		{ yylval.str = strndup(yytext + 1,
 			    strlen(yytext) - 2); return STR; }

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 19:42:38 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0170C8AD;
 Tue, 24 Jun 2014 19:42:38 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C891C2472;
 Tue, 24 Jun 2014 19:42:37 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5OJgbTq008776;
 Tue, 24 Jun 2014 19:42:37 GMT (envelope-from loos@svn.freebsd.org)
Received: (from loos@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5OJgb5H008773;
 Tue, 24 Jun 2014 19:42:37 GMT (envelope-from loos@svn.freebsd.org)
Message-Id: <201406241942.s5OJgb5H008773@svn.freebsd.org>
From: Luiz Otavio O Souza 
Date: Tue, 24 Jun 2014 19:42:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267834 - head/share/man/man4
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 19:42:38 -0000

Author: loos
Date: Tue Jun 24 19:42:37 2014
New Revision: 267834
URL: http://svnweb.freebsd.org/changeset/base/267834

Log:
  Clarify the expected usage of I2C 7-bit slave addresses on ioctl(2)
  interface.
  
  While here add the cross reference to iic(4) on iicbus(4).
  
  CR:		D210
  Suggested by:	jmg
  MFC after:	1 week

Modified:
  head/share/man/man4/iic.4
  head/share/man/man4/iicbus.4

Modified: head/share/man/man4/iic.4
==============================================================================
--- head/share/man/man4/iic.4	Tue Jun 24 19:12:55 2014	(r267833)
+++ head/share/man/man4/iic.4	Tue Jun 24 19:42:37 2014	(r267834)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 6, 2006
+.Dd June 24, 2014
 .Dt IIC 4
 .Os
 .Sh NAME
@@ -51,12 +51,20 @@ following ioctls:
 Sends the start condition to the slave specified by the
 .Va slave
 element to the bus.
+The
+.Va slave
+element consists of a 7-bit address and a read/write bit
+(i.e., 7-bit address << 1 | r/w).
+If the read/write bit is set a read operation is initiated, if the read/write
+bit is cleared a write operation is initiated.
 All other elements are ignored.
 .It Dv I2CRPTSTART
 .Pq Vt "struct iiccmd"
 Sends the repeated start condition to the slave specified by the
 .Va slave
 element to the bus.
+The slave address should be specified as in
+.Dv I2CSTART .
 All other elements are ignored.
 .It Dv I2CSTOP
 No argument is passed.
@@ -115,10 +123,15 @@ is set in
 Otherwise the transfer is a write transfer.
 The
 .Va slave
-element specifies the 7-bit address for the transfer.
+element specifies the 7-bit address with the read/write bit for the transfer.
+The read/write bit will be handled by the iicbus stack based on the specified
+transfer operation.
 The
 .Va len
-element is the length of the data.
+element is the number of
+.Pq Vt "struct iic_msg"
+messages encoded on
+.Pq Vt "struct iic_rdwr_data" .
 The
 .Va buf
 element is a buffer for that data.

Modified: head/share/man/man4/iicbus.4
==============================================================================
--- head/share/man/man4/iicbus.4	Tue Jun 24 19:12:55 2014	(r267833)
+++ head/share/man/man4/iicbus.4	Tue Jun 24 19:42:37 2014	(r267834)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 6, 1998
+.Dd June 24, 2014
 .Dt IICBUS 4
 .Os
 .Sh NAME
@@ -105,6 +105,7 @@ Some I2C interfaces are available:
 .El
 .Sh SEE ALSO
 .Xr bktr 4 ,
+.Xr iic 4 ,
 .Xr iicbb 4 ,
 .Xr lpbb 4 ,
 .Xr pcf 4

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 20:09:03 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 191D9890;
 Tue, 24 Jun 2014 20:09:03 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0675527AE;
 Tue, 24 Jun 2014 20:09:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5OK92mF019737;
 Tue, 24 Jun 2014 20:09:02 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5OK92kd019736;
 Tue, 24 Jun 2014 20:09:02 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201406242009.s5OK92kd019736@svn.freebsd.org>
From: Xin LI 
Date: Tue, 24 Jun 2014 20:09:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267838 - head/sys/dev/mrsas
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 20:09:03 -0000

Author: delphij
Date: Tue Jun 24 20:09:02 2014
New Revision: 267838
URL: http://svnweb.freebsd.org/changeset/base/267838

Log:
  Correct memset size.
  
  Submitted by:	Sascha Wildner (swildner at dragonflybsd dot org)
  Reviewed by:	Kashyap Desai 
  MFC after:	2 weeks

Modified:
  head/sys/dev/mrsas/mrsas_fp.c

Modified: head/sys/dev/mrsas/mrsas_fp.c
==============================================================================
--- head/sys/dev/mrsas/mrsas_fp.c	Tue Jun 24 19:59:13 2014	(r267837)
+++ head/sys/dev/mrsas/mrsas_fp.c	Tue Jun 24 20:09:02 2014	(r267838)
@@ -1219,7 +1219,7 @@ void mrsas_set_pd_lba(MRSAS_RAID_SCSI_IO
 	    opcode = cdb[0] == READ_6 ? READ_10 : WRITE_10;
 	    control = cdb[5];
 		
-	    memset(cdb, 0, sizeof(cdb));
+	    memset(cdb, 0, sizeof(io_request->CDB.CDB32));
 	    cdb[0] = opcode;
 	    cdb[9] = control;
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 20:11:23 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 803B8CA7;
 Tue, 24 Jun 2014 20:11:23 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 60C052857;
 Tue, 24 Jun 2014 20:11:23 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5OKBNhL022569;
 Tue, 24 Jun 2014 20:11:23 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5OKBMFL022559;
 Tue, 24 Jun 2014 20:11:22 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201406242011.s5OKBMFL022559@svn.freebsd.org>
From: Xin LI 
Date: Tue, 24 Jun 2014 20:11:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267839 - head/sys/dev/oce
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 20:11:23 -0000

Author: delphij
Date: Tue Jun 24 20:11:22 2014
New Revision: 267839
URL: http://svnweb.freebsd.org/changeset/base/267839

Log:
  Apply vendor fixes for big endian support and 20GBps/25GBps link speeds.
  
  Many thanks to Emulex for their continued support of FreeBSD!
  
  Submitted by:	Venkata Duvvuru 
  MFC after:	3 days

Modified:
  head/sys/dev/oce/oce_hw.c
  head/sys/dev/oce/oce_hw.h
  head/sys/dev/oce/oce_if.c
  head/sys/dev/oce/oce_if.h
  head/sys/dev/oce/oce_mbox.c

Modified: head/sys/dev/oce/oce_hw.c
==============================================================================
--- head/sys/dev/oce/oce_hw.c	Tue Jun 24 20:09:02 2014	(r267838)
+++ head/sys/dev/oce/oce_hw.c	Tue Jun 24 20:11:22 2014	(r267839)
@@ -487,11 +487,7 @@ oce_hw_start(POCE_SOFTC sc)
 		if_link_state_change(sc->ifp, LINK_STATE_DOWN);
 	}
 
-	if (link.mac_speed > 0 && link.mac_speed < 5)
-		sc->link_speed = link.mac_speed;
-	else
-		sc->link_speed = 0;
-
+	sc->link_speed = link.phys_port_speed;
 	sc->qos_link_speed = (uint32_t )link.qos_link_speed * 10;
 
 	rc = oce_start_mq(sc->mq);

Modified: head/sys/dev/oce/oce_hw.h
==============================================================================
--- head/sys/dev/oce/oce_hw.h	Tue Jun 24 20:09:02 2014	(r267838)
+++ head/sys/dev/oce/oce_hw.h	Tue Jun 24 20:11:22 2014	(r267839)
@@ -1023,7 +1023,7 @@ struct mbx_hdr {
 #define	OCE_MBX_ADDL_STATUS(_MHDR) ((_MHDR)->u0.rsp.additional_status)
 #define	OCE_MBX_STATUS(_MHDR) ((_MHDR)->u0.rsp.status)
 
-/* [05] OPCODE_COMMON_QUERY_LINK_CONFIG */
+/* [05] OPCODE_COMMON_QUERY_LINK_CONFIG_V1 */
 struct mbx_query_common_link_config {
 	struct mbx_hdr hdr;
 	union {
@@ -1032,16 +1032,37 @@ struct mbx_query_common_link_config {
 		} req;
 
 		struct {
-			/* dw 0 */
-			uint8_t physical_port;
-			uint8_t mac_duplex;
-			uint8_t mac_speed;
-			uint8_t mac_fault;
-			/* dw 1 */
-			uint8_t mgmt_mac_duplex;
-			uint8_t mgmt_mac_speed;
+		#ifdef _BIG_ENDIAN
+			uint32_t physical_port_fault:8;
+			uint32_t physical_port_speed:8;
+			uint32_t link_duplex:8;
+			uint32_t pt:2;
+			uint32_t port_number:6;
+
 			uint16_t qos_link_speed;
-			uint32_t logical_link_status;
+			uint16_t rsvd0;
+
+			uint32_t rsvd1:21;
+			uint32_t phys_fcv:1;
+			uint32_t phys_rxf:1;
+			uint32_t phys_txf:1;
+			uint32_t logical_link_status:8;
+		#else
+			uint32_t port_number:6;
+			uint32_t pt:2;
+			uint32_t link_duplex:8;
+			uint32_t physical_port_speed:8;
+			uint32_t physical_port_fault:8;
+
+			uint16_t rsvd0;
+			uint16_t qos_link_speed;
+
+			uint32_t logical_link_status:8;
+			uint32_t phys_txf:1;
+			uint32_t phys_rxf:1;
+			uint32_t phys_fcv:1;
+			uint32_t rsvd1:21;
+		#endif
 		} rsp;
 	} params;
 };

Modified: head/sys/dev/oce/oce_if.c
==============================================================================
--- head/sys/dev/oce/oce_if.c	Tue Jun 24 20:09:02 2014	(r267838)
+++ head/sys/dev/oce/oce_if.c	Tue Jun 24 20:11:22 2014	(r267839)
@@ -829,10 +829,21 @@ oce_media_status(struct ifnet *ifp, stru
 		req->ifm_active |= IFM_10G_SR | IFM_FDX;
 		sc->speed = 10000;
 		break;
+	case 5: /* 20 Gbps */
+		req->ifm_active |= IFM_10G_SR | IFM_FDX;
+		sc->speed = 20000;
+		break;
+	case 6: /* 25 Gbps */
+		req->ifm_active |= IFM_10G_SR | IFM_FDX;
+		sc->speed = 25000;
+		break;
 	case 7: /* 40 Gbps */
 		req->ifm_active |= IFM_40G_SR4 | IFM_FDX;
 		sc->speed = 40000;
 		break;
+	default:
+		sc->speed = 0;
+		break;
 	}
 	
 	return;
@@ -2217,13 +2228,16 @@ setup_max_queues_want(POCE_SOFTC sc)
 	    (sc->function_mode & FNM_UMC_MODE)    ||
 	    (sc->function_mode & FNM_VNIC_MODE)	  ||
 	    (!is_rss_enabled(sc))		  ||
-	    (sc->flags & OCE_FLAGS_BE2)) {
+	    IS_BE2(sc)) {
 		sc->nrqs = 1;
 		sc->nwqs = 1;
 	} else {
 		sc->nrqs = MIN(OCE_NCPUS, sc->nrssqs) + 1;
 		sc->nwqs = MIN(OCE_NCPUS, sc->nrssqs);
 	}
+
+	if (IS_BE2(sc) && is_rss_enabled(sc))
+		sc->nrqs = MIN(OCE_NCPUS, sc->nrssqs) + 1;
 }
 
 
@@ -2237,6 +2251,9 @@ update_queues_got(POCE_SOFTC sc)
 		sc->nrqs = 1;
 		sc->nwqs = 1;
 	}
+
+	if (IS_BE2(sc))
+		sc->nwqs = 1;
 }
 
 static int 

Modified: head/sys/dev/oce/oce_if.h
==============================================================================
--- head/sys/dev/oce/oce_if.h	Tue Jun 24 20:09:02 2014	(r267838)
+++ head/sys/dev/oce/oce_if.h	Tue Jun 24 20:11:22 2014	(r267839)
@@ -761,14 +761,9 @@ struct oce_rq {
 };
 
 struct link_status {
-	uint8_t physical_port;
-	uint8_t mac_duplex;
-	uint8_t mac_speed;
-	uint8_t mac_fault;
-	uint8_t mgmt_mac_duplex;
-	uint8_t mgmt_mac_speed;
+	uint8_t phys_port_speed;
+	uint8_t logical_link_status;
 	uint16_t qos_link_speed;
-	uint32_t logical_link_status;
 };
 
 

Modified: head/sys/dev/oce/oce_mbox.c
==============================================================================
--- head/sys/dev/oce/oce_mbox.c	Tue Jun 24 20:09:02 2014	(r267838)
+++ head/sys/dev/oce/oce_mbox.c	Tue Jun 24 20:11:22 2014	(r267839)
@@ -961,9 +961,9 @@ oce_get_link_status(POCE_SOFTC sc, struc
 		goto error;
 	}
 	/* interpret response */
-	bcopy(&fwcmd->params.rsp, link, sizeof(struct link_status));
-	link->logical_link_status = HOST_32(link->logical_link_status);
-	link->qos_link_speed = HOST_16(link->qos_link_speed);
+	link->qos_link_speed = HOST_16(fwcmd->params.rsp.qos_link_speed);
+	link->phys_port_speed = fwcmd->params.rsp.physical_port_speed;
+	link->logical_link_status = fwcmd->params.rsp.logical_link_status;
 error:
 	return rc;
 }

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 20:23:19 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 482F315B;
 Tue, 24 Jun 2014 20:23:19 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 34F05297F;
 Tue, 24 Jun 2014 20:23:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5OKNJsG028447;
 Tue, 24 Jun 2014 20:23:19 GMT (envelope-from wollman@svn.freebsd.org)
Received: (from wollman@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5OKNJCi028446;
 Tue, 24 Jun 2014 20:23:19 GMT (envelope-from wollman@svn.freebsd.org)
Message-Id: <201406242023.s5OKNJCi028446@svn.freebsd.org>
From: Garrett Wollman 
Date: Tue, 24 Jun 2014 20:23:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267840 - head/lib/libc/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 20:23:19 -0000

Author: wollman
Date: Tue Jun 24 20:23:18 2014
New Revision: 267840
URL: http://svnweb.freebsd.org/changeset/base/267840

Log:
  Catch up with many years of changes:
  
  o Document PF_LOCAL as being an alias for PF_UNIX
  o Document POSIX standardization of this interface using AF_*
    constants rather than PF_* constants, and note the three particular
    families which POSIX standardizes.
  o Note anticipated POSIX standardization of SOCK_CLOEXEC.
  o Delete from listing protocol families that FreeBSD doesn't support
    (in some cases, like PF_PUP, has never supported).
  o Add to listing some current protocol families that have been
    introduced in the last decade or so.
  o Document the correspondence of PF_* and AF_* constants.
  
  We should probably change the documentation to make the AF_* constants
  primary, but this commit does not do so.
  
  Reviewed by:	kevlo@
  MFC after:	1 month

Modified:
  head/lib/libc/sys/socket.2

Modified: head/lib/libc/sys/socket.2
==============================================================================
--- head/lib/libc/sys/socket.2	Tue Jun 24 20:11:22 2014	(r267839)
+++ head/lib/libc/sys/socket.2	Tue Jun 24 20:23:18 2014	(r267840)
@@ -57,24 +57,30 @@ These families are defined in the includ
 The currently understood formats are:
 .Pp
 .Bd -literal -offset indent -compact
-PF_LOCAL	Host-internal protocols, formerly called PF_UNIX,
-PF_UNIX		Host-internal protocols, deprecated, use PF_LOCAL,
+PF_LOCAL	Host-internal protocols (alias for PF_UNIX),
+PF_UNIX		Host-internal protocols,
 PF_INET		Internet version 4 protocols,
-PF_PUP		PUP protocols, like BSP,
-PF_APPLETALK	AppleTalk protocols,
-PF_ROUTE	Internal Routing protocol,
+PF_INET6	Internet version 6 protocols,
+PF_ROUTE	Internal routing protocol,
 PF_LINK		Link layer interface,
-PF_IPX		Novell Internet Packet eXchange protocol,
-PF_RTIP		Help Identify RTIP packets,
-PF_PIP		Help Identify PIP packets,
-PF_ISDN		Integrated Services Digital Network,
 PF_KEY		Internal key-management function,
-PF_INET6	Internet version 6 protocols,
-PF_NATM		Native ATM access,
-PF_ATM		ATM,
-PF_NETGRAPH	Netgraph sockets
+PF_NATM		Asynchronous transfer mode protocols,
+PF_NETGRAPH	Netgraph sockets,
+PF_IEEE80211	IEEE 802.11 wireless link-layer protocols (WiFi),
+PF_BLUETOOTH	Bluetooth protocols,
+PF_INET_SDP	OFED socket direct protocol (IPv4),
+PF_INET6_SDP	OFED socket direct protocol (IPv6)
 .Ed
 .Pp
+Each protocol family is connected to an address family, which has the
+same name except that the prefix is
+.Dq Dv AF_
+in place of
+.Dq Dv PF_ .
+Other protocol families may be also defined, beginning with
+.Dq Dv PF_ ,
+with corresponding address families.
+.Pp
 The socket has the indicated
 .Fa type ,
 which specifies the semantics of communication.
@@ -307,6 +313,37 @@ The socket type is not supported by the 
 .%B PS1
 .%N 8
 .Re
+.Sh STANDARDS
+The
+.Fn socket
+function conforms to
+.St -p1003.1-2008 .
+The
+.Tn POSIX
+standard specifies only the
+.Dv AF_INET ,
+.Dv AF_INET6 ,
+and
+.Dv AF_UNIX
+constants for address families, and requires the use of
+.Dv AF_*
+constants for the
+.Fa domain
+argument of
+.Fn socket .
+The
+.Dv SOCK_CLOEXEC
+flag is expected to conform to the next revision of the
+.Tn POSIX
+standard.
+The
+.Dv SOCK_RDM
+.Fa type ,
+the
+.Dv PF_*
+constants, and other address families are
+.Fx
+extensions.
 .Sh HISTORY
 The
 .Fn socket

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 21:12:09 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9A09E1CB;
 Tue, 24 Jun 2014 21:12:09 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8717C2F35;
 Tue, 24 Jun 2014 21:12:09 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5OLC8Xv051861;
 Tue, 24 Jun 2014 21:12:08 GMT (envelope-from markj@svn.freebsd.org)
Received: (from markj@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5OLC8A9051860;
 Tue, 24 Jun 2014 21:12:08 GMT (envelope-from markj@svn.freebsd.org)
Message-Id: <201406242112.s5OLC8A9051860@svn.freebsd.org>
From: Mark Johnston 
Date: Tue, 24 Jun 2014 21:12:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267842 - head/etc/mtree
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 21:12:09 -0000

Author: markj
Date: Tue Jun 24 21:12:08 2014
New Revision: 267842
URL: http://svnweb.freebsd.org/changeset/base/267842

Log:
  Unbreak installation of the rtld tests.
  
  X-MFC-With:	r267679

Modified:
  head/etc/mtree/BSD.tests.dist

Modified: head/etc/mtree/BSD.tests.dist
==============================================================================
--- head/etc/mtree/BSD.tests.dist	Tue Jun 24 20:35:20 2014	(r267841)
+++ head/etc/mtree/BSD.tests.dist	Tue Jun 24 21:12:08 2014	(r267842)
@@ -90,6 +90,7 @@
                 ..
                 atf-sh
                 ..
+            ..
             rtld-elf
             ..
         ..

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 21:26:21 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C39086A3
 for ; Tue, 24 Jun 2014 21:26:21 +0000 (UTC)
Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com
 [209.85.220.42])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 91480209B
 for ; Tue, 24 Jun 2014 21:26:21 +0000 (UTC)
Received: by mail-pa0-f42.google.com with SMTP id lj1so769778pab.15
 for ; Tue, 24 Jun 2014 14:26:14 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:sender:content-type:mime-version:subject:from
 :in-reply-to:date:cc:message-id:references:to;
 bh=KTjkQyPsZAaOpxxuv0x7IsYuj3yGEN+9i83Of0ePniQ=;
 b=I0k61kAaf6UM/dBVITKC52OBL6NRP5R3a+++55SELBVQB27QtQ7js99lbMNlDTvW6+
 m0y+rvsqx+ejdE9kWHfPoq5S0wt2gZRfvaV/tBqx1TOzl93SKdFtlQphRQQRDQSRjtth
 CFg4bOq6Li1mu9OxPM6UwzwRFQkmjogLR63ptnVSmTQLw38bh39/RCUAZ6UTQC5JWkeE
 UxHDL8pEMCWiH6lIxoH1p7vDOKuDEje1YVTbrilNjpaDbpxXVutEojPk9HBVTzcfGJX9
 fS7xvE1kTkMwWWffMpQUIr8UmY1U1/E+UQH52Ku1yG66b1v1UXs7xszFkgGuPAqYJnvN
 RTAA==
X-Gm-Message-State: ALoCoQmFGnqiWHkd9wp6nHWaZqfR1gd0Y7hHuzfHN+hnBczfzsX75Kcd1OcgC3qgdWFkUraa5iRd
X-Received: by 10.68.181.165 with SMTP id dx5mr5450228pbc.38.1403645174838;
 Tue, 24 Jun 2014 14:26:14 -0700 (PDT)
Received: from [10.64.26.236] (dc1-prod.netflix.com. [69.53.236.251])
 by mx.google.com with ESMTPSA id fx5sm1884118pbb.62.2014.06.24.14.26.13
 for 
 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Tue, 24 Jun 2014 14:26:14 -0700 (PDT)
Sender: Warner Losh 
Content-Type: multipart/signed;
 boundary="Apple-Mail=_5C365497-EC09-47E1-9564-D2DAD5613BAE";
 protocol="application/pgp-signature"; micalg=pgp-sha512
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r267758 - head
From: Warner Losh 
In-Reply-To: <53A9B494.3020709@freebsd.org>
Date: Tue, 24 Jun 2014 14:26:12 -0700
Message-Id: 
References: <201406230054.s5N0suIA081734@svn.freebsd.org>
 <256E890F-9564-4741-A5D8-89543381CF2D@gmail.com>
 <53A9B494.3020709@freebsd.org>
To: Andrey Chernov 
X-Mailer: Apple Mail (2.1878.2)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 21:26:21 -0000


--Apple-Mail=_5C365497-EC09-47E1-9564-D2DAD5613BAE
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252


On Jun 24, 2014, at 10:25 AM, Andrey Chernov  wrote:

> On 24.06.2014 20:07, Warner Losh wrote:
>>> Log:
>>> Change suggestion how to set MAKESYSPATH as broken incremental build
>>> workaround. Magic ".../share/mk" (search directories up to /)
>>> does not work for f.e. /usr/src/gnu/lib/libgcc because the path
>>> inside is starting from /usr/obj hierarchy and ends up in
>>> /usr/share/mk, not in the /usr/src/share/mk where src.opts.mk is.
>>> IMHO proper fixing of incremental build is needed urgently.
>>=20
>> I don=92t understand how this is even possible. This change is wrong =
because it has a bogus path the doesn=92t exist on all systems. I=92m =
going to fix that.
>=20
> How it is possible:
> cd /usr/src/gnu/lib/libgcc
> make

This does a recursive make, with pwd in /usr/obj=85.  That=92s going to =
be utterly evil to fix...

Warner


--Apple-Mail=_5C365497-EC09-47E1-9564-D2DAD5613BAE
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJTqez0AAoJEGwc0Sh9sBEAKTsP/RxEA9Cy1IBYZgKp8B6TQh3x
0UmPljNIIqZ4d+/aPzhcZr7OWG7TD6HR1p73BRVOaG2mb1TB20QQwHrrsiWkbeWg
xeLIcplVrbqimtMt0erEDXltIuU3eJvC8fPBs3MXJ6Fwrxs/oSdAa7zk7ZSMRbCh
NGpDiwDR3cBNDk/WQ1bUP//Q8Qk4OvU5YrPnaRkSUAJEgXjvWMoRuNSiYHRqR1kW
TkXJ4f0JNndaPxpvDahLEPXvqRr1djzhX1btvWPf5ZCXzGImOegd01EDmkLa2bLe
w2t2rCHdBnNazys4TXiprRB1aEpQ1gsYzKPE2DaUu55iwGnzrwPc31Dk5nCCsO1/
MpaD+UzhsptLronM+JPqL41FVhXslqdDnkscyxFZpv6uuhufJowBr8Ea/yrMG4pm
03ZqTE8v/Od/bTGDHGAZQ+KE6+Rn53ctJunlY/TlcSgkhojzW2oXPJwxWh7od9AU
pGosR5UaRbbf9HNzfiuyuRCnFbOndLcBKEqkKKCOC7TCJp1YunpsE6xATeJ54Bw0
wi7ESOjsLavBQmj2tehvDB5Sv7sMcRy2YbouHamei0R6Jghd8njHVR7SJGbBqc4B
Ua3fLoOYdu4XXF4h73mkOVOcdCNWmu3X8wvxvuYvA0NaJv5lx6pXt9UpiSSFLNl6
zLW/cCnAE9b7MBzoqmR9
=wWbA
-----END PGP SIGNATURE-----

--Apple-Mail=_5C365497-EC09-47E1-9564-D2DAD5613BAE--

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 22:02:46 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4F7BBB85
 for ; Tue, 24 Jun 2014 22:02:46 +0000 (UTC)
Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com
 [209.85.220.42])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 1C3EB2456
 for ; Tue, 24 Jun 2014 22:02:45 +0000 (UTC)
Received: by mail-pa0-f42.google.com with SMTP id lj1so806783pab.29
 for ; Tue, 24 Jun 2014 15:02:45 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:sender:content-type:mime-version:subject:from
 :in-reply-to:date:cc:message-id:references:to;
 bh=yY6yTOWyirDx/mq07Nru6XPABSpTRZfQXeEP4Za19ng=;
 b=aH5TLg1xYAfJj5sErcrsJMezOknc7nA1FgxD0sItDMF/ejK/rzldi1pKDqSOX+XSze
 y69Qq/WQIbn5EyjB/FE9dkp0mDvXC7O4GF0QL1Wzc/xzc7YK6CTiT8Evr81EAU4VBUTK
 Bq1jvlRg33G1xVXr3rfamPPS54xs2QdwW/zg8W4TnvMJByJSitkT27beGVXB4EheUAIs
 hMKH3okL8gbJkkrzd6x/V31iCSPgXltsJGToSp+9HjLFTIiMm3w2FpfmEUddX4zREm0Q
 ufzayc5Sn7XQ/oaAEI7ANpYORx7rgtTNRwKqqk8zt9ymxMpZFmRDfe2wjpTwBdnur9sD
 3bCg==
X-Gm-Message-State: ALoCoQk0P1IHqHdzOT5uzHRxv/4sOZOUwjq8QBh5GmDbCSPkkd6rQhocRQji60suba4OdRfpiDwk
X-Received: by 10.66.65.225 with SMTP id a1mr5184565pat.139.1403645933127;
 Tue, 24 Jun 2014 14:38:53 -0700 (PDT)
Received: from [10.64.26.236] (dc1-prod.netflix.com. [69.53.236.251])
 by mx.google.com with ESMTPSA id pn4sm1949923pbb.7.2014.06.24.14.38.51
 for 
 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Tue, 24 Jun 2014 14:38:52 -0700 (PDT)
Sender: Warner Losh 
Content-Type: multipart/signed;
 boundary="Apple-Mail=_F3F8EE4E-FD13-444E-8AF4-3A9BD58EF9F5";
 protocol="application/pgp-signature"; micalg=pgp-sha512
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r267758 - head
From: Warner Losh 
In-Reply-To: 
Date: Tue, 24 Jun 2014 14:38:50 -0700
Message-Id: 
References: <201406230054.s5N0suIA081734@svn.freebsd.org>
 <256E890F-9564-4741-A5D8-89543381CF2D@gmail.com>
 <53A9B494.3020709@freebsd.org>
 
To: Andrey Chernov 
X-Mailer: Apple Mail (2.1878.2)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 22:02:46 -0000


--Apple-Mail=_F3F8EE4E-FD13-444E-8AF4-3A9BD58EF9F5
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252


On Jun 24, 2014, at 2:26 PM, Warner Losh  wrote:

>=20
> On Jun 24, 2014, at 10:25 AM, Andrey Chernov  wrote:
>=20
>> On 24.06.2014 20:07, Warner Losh wrote:
>>>> Log:
>>>> Change suggestion how to set MAKESYSPATH as broken incremental =
build
>>>> workaround. Magic ".../share/mk" (search directories up to /)
>>>> does not work for f.e. /usr/src/gnu/lib/libgcc because the path
>>>> inside is starting from /usr/obj hierarchy and ends up in
>>>> /usr/share/mk, not in the /usr/src/share/mk where src.opts.mk is.
>>>> IMHO proper fixing of incremental build is needed urgently.
>>>=20
>>> I don=92t understand how this is even possible. This change is wrong =
because it has a bogus path the doesn=92t exist on all systems. I=92m =
going to fix that.
>>=20
>> How it is possible:
>> cd /usr/src/gnu/lib/libgcc
>> make
>=20
> This does a recursive make, with pwd in /usr/obj=85.  That=92s going =
to be utterly evil to fix=85

Actually, adding a simple cd ${.CURDIR} before the make fixes this=85 We =
need to do it in 3 places.

# one could argue that we should just .include something to make =
unwind.h instead of this rube-goldberg reach over make=85
# and I=92d agree with them...

Warner


--Apple-Mail=_F3F8EE4E-FD13-444E-8AF4-3A9BD58EF9F5
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJTqe/qAAoJEGwc0Sh9sBEAEekP/iHxfh4e2UMLiFsYqqOtpjMs
tQCz1hiIYSf9ilDuvod8WrhqNO23QKWIkRgvmC+ctfADNIe/V51LZTuR858RHsiF
mBNJsmPOh9u2IOX1kSmCHMxNrJFWH6y4T9Xe4NFrtARC6qvSxlcuvkmgfqzEmdCe
CkVXurajIEnWvtXSCG1cwfj+BngSFezCUWoAT7+2cYqI8WSHfk9+SrrCdoTJ9ul3
c7bF4DzHMp/RUrm88UpxwbRo+t+dnRT0WdWJ4/uCR+mi9JewFHOd9JJbA9GAWgUv
IKFDtthvFAmkomPStdNsspOGCQcv8taBtBrIqy/QobXFslOG1H0CM32+9kJUQARR
7zefcGL4vFElWi5lQIxA4x6Hvacf6FA4p3ZtcZr2QgDxG08loxYuEkCZ7YxfI7bs
Ry0IeEV0A+MsYvkq4ynySHncRxAokB2QXABOARBUmHPEStnxn+YwUAgjGsk3uaW8
Psk93Jw3N3bsFEo0Nb8f500k8CSDYQhPW1TGYrxY4VphWUG22RoKdm3njWMVFvbm
qryKe5ifc09lj9n9l6rBQJ5e8VmGFaodtE2+Y0PPjuz8aCpBSgCDZjU4IfEHgiUK
bE3HoO4jPv80xe+uVeQMbml+jhtdnQccru8e/K7y3nR6PQM2FSmtvwjedzbLVfnW
jeI57hv24ANiXkRROVN9
=bHTb
-----END PGP SIGNATURE-----

--Apple-Mail=_F3F8EE4E-FD13-444E-8AF4-3A9BD58EF9F5--

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 22:15:28 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 22A1412C;
 Tue, 24 Jun 2014 22:15:28 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E9DBF2570;
 Tue, 24 Jun 2014 22:15:27 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5OMFRZS081947;
 Tue, 24 Jun 2014 22:15:27 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5OMFRJj081943;
 Tue, 24 Jun 2014 22:15:27 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201406242215.s5OMFRJj081943@svn.freebsd.org>
From: Warner Losh 
Date: Tue, 24 Jun 2014 22:15:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267845 - in head/gnu/lib: csu libgcc libgcov
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 22:15:28 -0000

Author: imp
Date: Tue Jun 24 22:15:27 2014
New Revision: 267845
URL: http://svnweb.freebsd.org/changeset/base/267845

Log:
  Make sure that the sub-makes for unwind.h start from the CURDIR
  (/usr/src) tree rather than the OBJDIR (/usr/obj) tree. This fixes
  broken incremental builds with the canonical MAKESYSPATH workaround
  of .../share/mk. This is a gross kludge.

Modified:
  head/gnu/lib/csu/Makefile
  head/gnu/lib/libgcc/Makefile
  head/gnu/lib/libgcov/Makefile

Modified: head/gnu/lib/csu/Makefile
==============================================================================
--- head/gnu/lib/csu/Makefile	Tue Jun 24 21:35:34 2014	(r267844)
+++ head/gnu/lib/csu/Makefile	Tue Jun 24 22:15:27 2014	(r267845)
@@ -73,7 +73,7 @@ crtendS.o:	${ENDSRC}
 
 CLEANFILES+=	tm.h tconfig.h options.h optionlist cs-tconfig.h cs-tm.h
 tm.h tconfig.h options.h: ${CCDIR}/cc_tools/Makefile
-	${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}
+	(cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET})
 
 realinstall:
 .for file in ${OBJS} ${SOBJS} ${TGTOBJS}

Modified: head/gnu/lib/libgcc/Makefile
==============================================================================
--- head/gnu/lib/libgcc/Makefile	Tue Jun 24 21:35:34 2014	(r267844)
+++ head/gnu/lib/libgcc/Makefile	Tue Jun 24 22:15:27 2014	(r267845)
@@ -317,7 +317,7 @@ ${_src:R:S/$/.So/}: ${_src} ${COMMONHDRS
 # Generated headers
 #
 ${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile
-	${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}
+	(cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET})
 
 CLEANFILES += ${COMMONHDRS}
 CLEANFILES += cs-*.h option*

Modified: head/gnu/lib/libgcov/Makefile
==============================================================================
--- head/gnu/lib/libgcov/Makefile	Tue Jun 24 21:35:34 2014	(r267844)
+++ head/gnu/lib/libgcov/Makefile	Tue Jun 24 22:15:27 2014	(r267845)
@@ -46,7 +46,7 @@ COMMONHDRS=	tm.h tconfig.h gcov-iov.h op
 CLEANFILES+=	${COMMONHDRS} cs-tm.h cs-tconfig.h options.h optionlist
 
 ${COMMONHDRS}: ${.CURDIR}/../../usr.bin/cc/cc_tools/Makefile
-	${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}
+	(cd ${.CURDIR}; ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET})
 
 ${OBJS} beforedepend: ${COMMONHDRS}
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jun 24 22:25:49 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A9D65726
 for ; Tue, 24 Jun 2014 22:25:49 +0000 (UTC)
Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com
 [209.85.220.45])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 761F52665
 for ; Tue, 24 Jun 2014 22:25:49 +0000 (UTC)
Received: by mail-pa0-f45.google.com with SMTP id rd3so822213pab.18
 for ; Tue, 24 Jun 2014 15:25:48 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:sender:content-type:mime-version:subject:from
 :in-reply-to:date:cc:message-id:references:to;
 bh=eLk2ecihgV1atsiLk2T0z0WJErHEcbi1gvvqHrub0YY=;
 b=jQhrPiqI2/xjX7K8W/rg80O9N8SJuUJfVfBjhv9W2pdlEFnaIJG963X3eX5MsvpefI
 DoL0GUczHhwlSMwBxGSOholXBWcUD60+CPSEd13lbKE8V3BJqZR0BqGI5tKkuzVDWoku
 FFJ3jzb4fe5EFV4q6B3vWVX3JgvY/RKPw+WfXAYN0ueIBHJ5USa0mXoDl/vdEiFTTTOM
 Gp+s6mkh70Sx1S4Kt+e8V9sLJnEm16gzbAMUG6k5PuTl0P4ctTkdYJ3JGwoYS0FzqiLQ
 pyeHLxyfvZi9vLUq4I4nronLVkC3yqce7cLR9E5V10Zw9Gn139EJVvbCVvswway3qtrJ
 LqRg==
X-Gm-Message-State: ALoCoQkgdJ+DZg3PeXVym2IEpbwO17usu2lQzyX+91qLltIOftgOCPyhW/EXHscbQB/dcz7Y/ody
X-Received: by 10.68.240.34 with SMTP id vx2mr5607579pbc.1.1403648748667;
 Tue, 24 Jun 2014 15:25:48 -0700 (PDT)
Received: from [10.64.26.236] (dc1-prod.netflix.com. [69.53.236.251])
 by mx.google.com with ESMTPSA id pw4sm2001155pbc.61.2014.06.24.15.25.47
 for 
 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Tue, 24 Jun 2014 15:25:48 -0700 (PDT)
Sender: Warner Losh 
Content-Type: multipart/signed;
 boundary="Apple-Mail=_A3A04A0D-E7CA-4C65-866A-1D337B89333F";
 protocol="application/pgp-signature"; micalg=pgp-sha512
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r267758 - head
From: Warner Losh 
In-Reply-To: 
Date: Tue, 24 Jun 2014 15:25:45 -0700
Message-Id: 
References: <201406230054.s5N0suIA081734@svn.freebsd.org>
 <256E890F-9564-4741-A5D8-89543381CF2D@gmail.com>
 <53A9B494.3020709@freebsd.org>
 
 
To: Andrey Chernov 
X-Mailer: Apple Mail (2.1878.2)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 24 Jun 2014 22:25:49 -0000


--Apple-Mail=_A3A04A0D-E7CA-4C65-866A-1D337B89333F
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252


On Jun 24, 2014, at 2:38 PM, Warner Losh  wrote:

>=20
> On Jun 24, 2014, at 2:26 PM, Warner Losh  wrote:
>=20
>>=20
>> On Jun 24, 2014, at 10:25 AM, Andrey Chernov  =
wrote:
>>=20
>>> On 24.06.2014 20:07, Warner Losh wrote:
>>>>> Log:
>>>>> Change suggestion how to set MAKESYSPATH as broken incremental =
build
>>>>> workaround. Magic ".../share/mk" (search directories up to /)
>>>>> does not work for f.e. /usr/src/gnu/lib/libgcc because the path
>>>>> inside is starting from /usr/obj hierarchy and ends up in
>>>>> /usr/share/mk, not in the /usr/src/share/mk where src.opts.mk is.
>>>>> IMHO proper fixing of incremental build is needed urgently.
>>>>=20
>>>> I don=92t understand how this is even possible. This change is =
wrong because it has a bogus path the doesn=92t exist on all systems. =
I=92m going to fix that.
>>>=20
>>> How it is possible:
>>> cd /usr/src/gnu/lib/libgcc
>>> make
>>=20
>> This does a recursive make, with pwd in /usr/obj=85.  That=92s going =
to be utterly evil to fix=85
>=20
> Actually, adding a simple cd ${.CURDIR} before the make fixes this=85 =
We need to do it in 3 places.
>=20
> # one could argue that we should just .include something to make =
unwind.h instead of this rube-goldberg reach over make=85
> # and I=92d agree with them=85

This has been =93fixed=94=85

that was a fun example=85  I have to go from =93fixed=94 to actually =
fixed now=85

Warner

--Apple-Mail=_A3A04A0D-E7CA-4C65-866A-1D337B89333F
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJTqfrpAAoJEGwc0Sh9sBEANy0P/3zADp5+22OnaVfYmIkDmIZS
9cXAlsjINSk6uvVxmKBpWwtRcjdzk7gtMLV1TewO5/slvagpiCjzm6TiK/UNwLkt
kkjNNuCd6x4TPf48S6sYLa2/g7xjVw/CFxuzGKOXZ0OrK4nw/ipLUFrM1oFbzuno
v6JyRBwlajfr51NPBmJpyd5/MAQ+TRpWWAjRqtAjtEaWz3hL0bJ9B1ctqueuy3zS
Hu47fQMiaXwsBEkQnEK5LHm4QzK3JD/bu9hm+AQveuyJ5jh6ImCVmdS+d8jIhlWZ
5Jw3/j5HksQRR29AqbuVVk8uVSmGc+zadQSoJLBzcrDLVKKO/NATGa9dzfQt6wH6
jbJDHnG0hGoepmLEBK7Ff8QEKaVt1nWodlxFVcHDK5XbM0j7n1KmOHN652Vgb3kX
WawN9QieLE1HK9UfJB4yUM09zIDnbg7u6qN5bXqU9+buwfQMlpv7wexEWOX5zfcc
F4fXOKIHGfINPEq66WfFl5DfZOtRW7mLtV7q3izSIsjya8D0yTGfCF43EebIJ6dg
NnnUzhicydMDqXZuytCT13oHDSD/zMmtgziPjsQewoNxB4L88ok9qYzC0B+Bftfj
AfCmLue6+ob1di3Ky6IR2hFhoLmVjPr2Xj1quTUm0C5nrVXBnERn+Dxp8+7F0Kc1
K/9JBDUwhrAqM0hvvgHY
=GvjV
-----END PGP SIGNATURE-----

--Apple-Mail=_A3A04A0D-E7CA-4C65-866A-1D337B89333F--

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 00:05:35 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 977A0E3E;
 Wed, 25 Jun 2014 00:05:35 +0000 (UTC)
Received: from na01-by2-obe.outbound.protection.outlook.com
 (mail-by2lp0236.outbound.protection.outlook.com [207.46.163.236])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "mail.protection.outlook.com",
 Issuer "MSIT Machine Auth CA 2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 89F9A2ECC;
 Wed, 25 Jun 2014 00:05:33 +0000 (UTC)
Received: from CO2PR05CA034.namprd05.prod.outlook.com (10.141.241.162) by
 BL2PR05MB098.namprd05.prod.outlook.com (10.255.232.15) with Microsoft SMTP
 Server (TLS) id 15.0.954.9; Wed, 25 Jun 2014 00:05:26 +0000
Received: from BN1AFFO11FD039.protection.gbl (2a01:111:f400:7c10::140) by
 CO2PR05CA034.outlook.office365.com (2a01:111:e400:1429::34) with Microsoft
 SMTP Server (TLS) id 15.0.969.15 via Frontend Transport; Wed, 25 Jun 2014
 00:05:26 +0000
Received: from P-EMF02-SAC.jnpr.net (66.129.239.16) by
 BN1AFFO11FD039.mail.protection.outlook.com (10.58.52.243) with Microsoft SMTP
 Server (TLS) id 15.0.969.12 via Frontend Transport; Wed, 25 Jun 2014 00:05:25
 +0000
Received: from magenta.juniper.net (172.17.27.123) by P-EMF02-SAC.jnpr.net
 (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.146.0; Tue, 24 Jun
 2014 17:03:59 -0700
Received: from chaos.localdomain (chaos.jnpr.net [172.21.16.28])	by
 magenta.juniper.net (8.11.3/8.11.3) with ESMTP id s5P03wn08450;	Tue, 24 Jun
 2014 17:03:58 -0700 (PDT)	(envelope-from sjg@juniper.net)
Received: from chaos (localhost [127.0.0.1])	by chaos.localdomain (Postfix)
 with ESMTP id 8769E580A2;	Tue, 24 Jun 2014 17:03:58 -0700 (PDT)
To: Warner Losh 
Subject: Re: svn commit: r267758 - head
In-Reply-To: 
References: <201406230054.s5N0suIA081734@svn.freebsd.org>
 <256E890F-9564-4741-A5D8-89543381CF2D@gmail.com>
 <53A9B494.3020709@freebsd.org>
 
 
 
Comments: In-reply-to: Warner Losh 
 message dated "Tue, 24 Jun 2014 15:25:45 -0700."
From: "Simon J. Gerraty" 
X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1
Date: Tue, 24 Jun 2014 17:03:58 -0700
Message-ID: <20140625000358.8769E580A2@chaos.localdomain>
MIME-Version: 1.0
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-Forefront-Antispam-Report: CIP:66.129.239.16; CTRY:US; IPV:NLI; IPV:NLI;
 EFV:NLI; SFV:NSPM;
 SFS:(6009001)(189002)(199002)(101356003)(33656002)(93886003)(102836001)(90896003)(93916002)(86362001)(93546004)(85852003)(83072002)(57986006)(21056001)(102176002)(76506005)(97736001)(88136002)(99396002)(70486001)(79102001)(64706001)(105596002)(95666004)(20776003)(47776003)(80022001)(92566001)(92726001)(89996001)(81156004)(69596002)(106466001)(68736004)(6806004)(50466002)(81542001)(62966002)(4396001)(83322001)(44976005)(84676001)(76482001)(19580395003)(50226001)(77982001)(87286001)(76176999)(85306003)(50986999)(87936001)(81342001)(74662001)(31966008)(74502001)(48376002)(46102001)(77156001)(104166001)(42262001);
 DIR:OUT; SFP:; SCL:1; SRVR:BL2PR05MB098; H:P-EMF02-SAC.jnpr.net; FPR:; MLV:sfv;
 PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; 
X-Microsoft-Antispam: BL:0; ACTION:Default; RISK:Low; SCL:0; SPMLVL:NotSpam;
 PCL:0; RULEID:
X-Forefront-PRVS: 02530BD3AA
Received-SPF: SoftFail (: domain of transitioning juniper.net discourages use
 of 66.129.239.16 as permitted sender)
Authentication-Results: spf=softfail (sender IP is 66.129.239.16)
 smtp.mailfrom=sjg@juniper.net; 
X-OriginatorOrg: juniper.net
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers , Andrey Chernov 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 00:05:35 -0000


On Tue, 24 Jun 2014 15:25:45 -0700, Warner Losh writes:
>>>>>> Change suggestion how to set MAKESYSPATH as broken incremental =
>build
>>>>>> workaround. Magic ".../share/mk" (search directories up to /)

If syspath is going to include .../ it isn't a bad idea for
sys.mk to resolve it.
Something like:

.if ${.MAKE.LEVEL} == 0
# just in case -m, MAKESYSPATH or our default has .../ 
# export a sanitised version...
# first any -m* from command line,
# then any MAKESYSPATH and finally ${.PARSEDIR}
_makesyspath:= ${.MAKEFLAGS:tW:S/ -m / -m/g:tw:M-m*:S,^-m,,} \
        ${MAKESYSPATH:U} \
        ${.PARSEDIR}
# replace .../.* with ${.PARSEDIR}, not perfect but pretty close
MAKESYSPATH:= ${_makesyspath:S,:, ,g:C,^\.\.\./.*,${.PARSEDIR},:u:ts:}
.export MAKESYSPATH
.endif

then if a sub-make is launched in a objdir outside of the tree, it will
still find the correct sys.mk etc.


From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 00:33:02 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7E6B25F2
 for ; Wed, 25 Jun 2014 00:33:02 +0000 (UTC)
Received: from mail-qc0-x230.google.com (mail-qc0-x230.google.com
 [IPv6:2607:f8b0:400d:c01::230])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 43C512134
 for ; Wed, 25 Jun 2014 00:33:02 +0000 (UTC)
Received: by mail-qc0-f176.google.com with SMTP id w7so1063278qcr.7
 for ; Tue, 24 Jun 2014 17:33:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:date:message-id:subject:from:to:content-type;
 bh=jnZCWsUrpuBuNzcuDdYJP/J5cNIA+3vxEeOZvJj7uG0=;
 b=0NemOkMZwAZwqUdl8r1jApieoE+vX+njAsiITlwXw9wqG0//DsnV8XLfO2EMfxNSx9
 CYzz8GBE0n2o3EY9heOcwMH3XCujiDCeo0CJiOay+Xwzwt2pUaEwssf/ijERiO/NSFSn
 ZxG/Dy6CULr+LcFbzJjYQQd0AundIVq+m1FGEFONCIpDVwSR8QX+NbrXDPaon0z9sSSv
 4HnVCtFi21PkJvKUk2G0Ldteh0NdFuZqxN7kk9bT/3Lfqpm26nBnU/jEXD4JSXaLrqZn
 atXyQtH5sxyWT4Pj82UvWJ1/FKYrmhjXoUKoot1/dt8dPNM9Qje41Ftm8eH0pThC5n2m
 o38g==
MIME-Version: 1.0
X-Received: by 10.224.16.200 with SMTP id p8mr7136772qaa.76.1403656381439;
 Tue, 24 Jun 2014 17:33:01 -0700 (PDT)
Received: by 10.140.102.241 with HTTP; Tue, 24 Jun 2014 17:33:01 -0700 (PDT)
Date: Wed, 25 Jun 2014 08:33:01 +0800
Message-ID: 
Subject: you a
From: M Kit 
To: svn-src-head@freebsd.org
Content-Type: text/plain; charset=ISO-8859-1
X-Content-Filtered-By: Mailman/MimeDel 2.1.18
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 00:33:02 -0000



From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 03:30:03 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id ED37AE8F;
 Wed, 25 Jun 2014 03:30:03 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DB06D20B0;
 Wed, 25 Jun 2014 03:30:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5P3U35f030622;
 Wed, 25 Jun 2014 03:30:03 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5P3U36V030621;
 Wed, 25 Jun 2014 03:30:03 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201406250330.s5P3U36V030621@svn.freebsd.org>
From: Alan Cox 
Date: Wed, 25 Jun 2014 03:30:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267850 - head/sys/vm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 03:30:04 -0000

Author: alc
Date: Wed Jun 25 03:30:03 2014
New Revision: 267850
URL: http://svnweb.freebsd.org/changeset/base/267850

Log:
  Now that vm_map_insert() sets MAP_ENTRY_GROWS_{DOWN,UP} on the stack entries
  that it creates (r267645), we can place the check that blocks map entry
  coalescing on stack entries in vm_map_simplify_entry() where it properly
  belongs.
  
  Reviewed by:	kib

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Wed Jun 25 02:14:55 2014	(r267849)
+++ head/sys/vm/vm_map.c	Wed Jun 25 03:30:03 2014	(r267850)
@@ -1292,12 +1292,12 @@ charged:
 	map->size += new_entry->end - new_entry->start;
 
 	/*
-	 * It may be possible to merge the new entry with the next and/or
-	 * previous entries.  However, due to MAP_STACK_* being a hack, a
-	 * panic can result from merging such entries.
+	 * Try to coalesce the new entry with both the previous and next
+	 * entries in the list.  Previously, we only attempted to coalesce
+	 * with the previous entry when object is NULL.  Here, we handle the
+	 * other cases, which are less common.
 	 */
-	if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0)
-		vm_map_simplify_entry(map, new_entry);
+	vm_map_simplify_entry(map, new_entry);
 
 	if (cow & (MAP_PREFAULT|MAP_PREFAULT_PARTIAL)) {
 		vm_map_pmap_enter(map, start, prot,
@@ -1512,7 +1512,8 @@ vm_map_simplify_entry(vm_map_t map, vm_m
 	vm_map_entry_t next, prev;
 	vm_size_t prevsize, esize;
 
-	if (entry->eflags & (MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_IS_SUB_MAP))
+	if ((entry->eflags & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP |
+	    MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_IS_SUB_MAP)) != 0)
 		return;
 
 	prev = entry->prev;

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 03:54:03 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 772FC4D2;
 Wed, 25 Jun 2014 03:54:03 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6382C22D6;
 Wed, 25 Jun 2014 03:54:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5P3s38F043325;
 Wed, 25 Jun 2014 03:54:03 GMT (envelope-from davide@svn.freebsd.org)
Received: (from davide@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5P3s22H043312;
 Wed, 25 Jun 2014 03:54:02 GMT (envelope-from davide@svn.freebsd.org)
Message-Id: <201406250354.s5P3s22H043312@svn.freebsd.org>
From: Davide Italiano 
Date: Wed, 25 Jun 2014 03:54:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267851 - in head/sys/cddl:
 contrib/opensolaris/uts/common/dtrace dev/dtrace
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 03:54:03 -0000

Author: davide
Date: Wed Jun 25 03:54:02 2014
New Revision: 267851
URL: http://svnweb.freebsd.org/changeset/base/267851

Log:
  Continue the crusade towards a dev_clone()-free kernel, removing its
  usage from dtrace. The dtrace code already uses cdevpriv(9) since FreeBSD
  8, so this change should be quite harmless.
  
  Reviewed by:	markj
  Approved by:	markj
  MFC after:	never

Deleted:
  head/sys/cddl/dev/dtrace/dtrace_clone.c
Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  head/sys/cddl/dev/dtrace/dtrace_ioctl.c
  head/sys/cddl/dev/dtrace/dtrace_load.c
  head/sys/cddl/dev/dtrace/dtrace_unload.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Wed Jun 25 03:30:03 2014	(r267850)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Wed Jun 25 03:54:02 2014	(r267851)
@@ -15716,10 +15716,8 @@ dtrace_attach(dev_info_t *devi, ddi_atta
 #endif
 
 #if !defined(sun)
-#if __FreeBSD_version >= 800039
 static void dtrace_dtr(void *);
 #endif
-#endif
 
 /*ARGSUSED*/
 static int
@@ -15745,27 +15743,7 @@ dtrace_open(struct cdev *dev, int oflags
 	ASSERT(getminor(*devp) == DTRACEMNRN_DTRACE);
 #else
 	cred_t *cred_p = NULL;
-
-#if __FreeBSD_version < 800039
-	/*
-	 * The first minor device is the one that is cloned so there is
-	 * nothing more to do here.
-	 */
-	if (dev2unit(dev) == 0)
-		return 0;
-
-	/*
-	 * Devices are cloned, so if the DTrace state has already
-	 * been allocated, that means this device belongs to a
-	 * different client. Each client should open '/dev/dtrace'
-	 * to get a cloned device.
-	 */
-	if (dev->si_drv1 != NULL)
-		return (EBUSY);
-#endif
-
 	cred_p = dev->si_cred;
-#endif
 
 	/*
 	 * If no DTRACE_PRIV_* bits are set in the credential, then the
@@ -15773,11 +15751,6 @@ dtrace_open(struct cdev *dev, int oflags
 	 */
 	dtrace_cred2priv(cred_p, &priv, &uid, &zoneid);
 	if (priv == DTRACE_PRIV_NONE) {
-#if !defined(sun)
-#if __FreeBSD_version < 800039
-		/* Destroy the cloned device. */
-                destroy_dev(dev);
-#endif
 #endif
 
 		return (EACCES);
@@ -15810,12 +15783,8 @@ dtrace_open(struct cdev *dev, int oflags
 	state = dtrace_state_create(devp, cred_p);
 #else
 	state = dtrace_state_create(dev);
-#if __FreeBSD_version < 800039
-	dev->si_drv1 = state;
-#else
 	devfs_set_cdevpriv(state, dtrace_dtr);
 #endif
-#endif
 
 	mutex_exit(&cpu_lock);
 
@@ -15827,12 +15796,6 @@ dtrace_open(struct cdev *dev, int oflags
 		--dtrace_opens;
 #endif
 		mutex_exit(&dtrace_lock);
-#if !defined(sun)
-#if __FreeBSD_version < 800039
-		/* Destroy the cloned device. */
-                destroy_dev(dev);
-#endif
-#endif
 		return (EAGAIN);
 	}
 
@@ -15845,9 +15808,6 @@ dtrace_open(struct cdev *dev, int oflags
 #if defined(sun)
 static int
 dtrace_close(dev_t dev, int flag, int otyp, cred_t *cred_p)
-#elif __FreeBSD_version < 800039
-static int
-dtrace_close(struct cdev *dev, int flags, int fmt __unused, struct thread *td)
 #else
 static void
 dtrace_dtr(void *data)
@@ -15862,18 +15822,9 @@ dtrace_dtr(void *data)
 
 	state = ddi_get_soft_state(dtrace_softstate, minor);
 #else
-#if __FreeBSD_version < 800039
-	dtrace_state_t *state = dev->si_drv1;
-
-	/* Check if this is not a cloned device. */
-	if (dev2unit(dev) == 0)
-		return (0);
-#else
 	dtrace_state_t *state = data;
 #endif
 
-#endif
-
 	mutex_enter(&cpu_lock);
 	mutex_enter(&dtrace_lock);
 
@@ -15890,9 +15841,6 @@ dtrace_dtr(void *data)
 
 #if !defined(sun)
 		kmem_free(state, 0);
-#if __FreeBSD_version < 800039
-		dev->si_drv1 = NULL;
-#endif
 #endif
 	}
 
@@ -15907,12 +15855,7 @@ dtrace_dtr(void *data)
 	mutex_exit(&dtrace_lock);
 	mutex_exit(&cpu_lock);
 
-#if __FreeBSD_version < 800039
-	/* Schedule this cloned device to be destroyed. */
-	destroy_dev_sched(dev);
-#endif
-
-#if defined(sun) || __FreeBSD_version < 800039
+#if defined(sun)
 	return (0);
 #endif
 }
@@ -16949,24 +16892,14 @@ static d_ioctl_t	dtrace_ioctl;
 static d_ioctl_t	dtrace_ioctl_helper;
 static void		dtrace_load(void *);
 static int		dtrace_unload(void);
-#if __FreeBSD_version < 800039
-static void		dtrace_clone(void *, struct ucred *, char *, int , struct cdev **);
-static struct clonedevs	*dtrace_clones;		/* Ptr to the array of cloned devices. */
-static eventhandler_tag	eh_tag;			/* Event handler tag. */
-#else
 static struct cdev	*dtrace_dev;
 static struct cdev	*helper_dev;
-#endif
 
 void dtrace_invop_init(void);
 void dtrace_invop_uninit(void);
 
 static struct cdevsw dtrace_cdevsw = {
 	.d_version	= D_VERSION,
-#if __FreeBSD_version < 800039
-	.d_flags	= D_TRACKCLOSE | D_NEEDMINOR,
-	.d_close	= dtrace_close,
-#endif
 	.d_ioctl	= dtrace_ioctl,
 	.d_open		= dtrace_open,
 	.d_name		= "dtrace",
@@ -16979,9 +16912,6 @@ static struct cdevsw helper_cdevsw = {
 };
 
 #include 
-#if __FreeBSD_version < 800039
-#include 
-#endif
 #include 
 #include 
 #include 

Modified: head/sys/cddl/dev/dtrace/dtrace_ioctl.c
==============================================================================
--- head/sys/cddl/dev/dtrace/dtrace_ioctl.c	Wed Jun 25 03:30:03 2014	(r267850)
+++ head/sys/cddl/dev/dtrace/dtrace_ioctl.c	Wed Jun 25 03:54:02 2014	(r267851)
@@ -78,12 +78,9 @@ static int
 dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr,
     int flags __unused, struct thread *td)
 {
-#if __FreeBSD_version < 800039
-	dtrace_state_t *state = dev->si_drv1;
-#else
 	dtrace_state_t *state;
 	devfs_get_cdevpriv((void **) &state);
-#endif
+
 	int error = 0;
 	if (state == NULL)
 		return (EINVAL);

Modified: head/sys/cddl/dev/dtrace/dtrace_load.c
==============================================================================
--- head/sys/cddl/dev/dtrace/dtrace_load.c	Wed Jun 25 03:30:03 2014	(r267850)
+++ head/sys/cddl/dev/dtrace/dtrace_load.c	Wed Jun 25 03:54:02 2014	(r267851)
@@ -158,18 +158,10 @@ dtrace_load(void *dummy)
 
 	mutex_exit(&cpu_lock);
 
-#if __FreeBSD_version < 800039
-	/* Enable device cloning. */
-	clone_setup(&dtrace_clones);
-
-	/* Setup device cloning events. */
-	eh_tag = EVENTHANDLER_REGISTER(dev_clone, dtrace_clone, 0, 1000);
-#else
 	dtrace_dev = make_dev(&dtrace_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600,
 	    "dtrace/dtrace");
 	helper_dev = make_dev(&helper_cdevsw, 0, UID_ROOT, GID_WHEEL, 0660,
 	    "dtrace/helper");
-#endif
 
 	return;
 }

Modified: head/sys/cddl/dev/dtrace/dtrace_unload.c
==============================================================================
--- head/sys/cddl/dev/dtrace/dtrace_unload.c	Wed Jun 25 03:30:03 2014	(r267850)
+++ head/sys/cddl/dev/dtrace/dtrace_unload.c	Wed Jun 25 03:54:02 2014	(r267851)
@@ -28,23 +28,8 @@ dtrace_unload()
 	dtrace_state_t *state;
 	int error = 0;
 
-#if __FreeBSD_version < 800039
-	/*
-	 * Check if there is still an event handler callback
-	 * registered.
-	 */
-	if (eh_tag != 0) {
-		/* De-register the device cloning event handler. */
-		EVENTHANDLER_DEREGISTER(dev_clone, eh_tag);
-		eh_tag = 0;
-
-		/* Stop device cloning. */
-		clone_cleanup(&dtrace_clones);
-	}
-#else
 	destroy_dev(dtrace_dev);
 	destroy_dev(helper_dev);
-#endif
 
 	mutex_enter(&dtrace_provider_lock);
 	mutex_enter(&dtrace_lock);

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 05:39:30 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id DECCC188;
 Wed, 25 Jun 2014 05:39:30 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B12862B33;
 Wed, 25 Jun 2014 05:39:30 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5P5dUOJ098209;
 Wed, 25 Jun 2014 05:39:30 GMT (envelope-from daichi@svn.freebsd.org)
Received: (from daichi@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5P5dUtL098208;
 Wed, 25 Jun 2014 05:39:30 GMT (envelope-from daichi@svn.freebsd.org)
Message-Id: <201406250539.s5P5dUtL098208@svn.freebsd.org>
From: Daichi GOTO 
Date: Wed, 25 Jun 2014 05:39:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267852 - head/sys/dev/glxiic
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 05:39:31 -0000

Author: daichi (ports committer)
Date: Wed Jun 25 05:39:30 2014
New Revision: 267852
URL: http://svnweb.freebsd.org/changeset/base/267852

Log:
  Fixed an IIC timing issue between the glxiic master and a slave of
  peripheral devices.  When transmitting (rx) from slave to master,
  sometimes nAKC delays. As a result, some slaves fails their
  transmission.
  
  Submitted by:	Masanori OZAWA 
  Reviewed by:	brix
  MFC after:	1 week

Modified:
  head/sys/dev/glxiic/glxiic.c

Modified: head/sys/dev/glxiic/glxiic.c
==============================================================================
--- head/sys/dev/glxiic/glxiic.c	Wed Jun 25 03:54:02 2014	(r267851)
+++ head/sys/dev/glxiic/glxiic.c	Wed Jun 25 05:39:30 2014	(r267852)
@@ -711,6 +711,7 @@ static int
 glxiic_state_master_addr_callback(struct glxiic_softc *sc, uint8_t status)
 {
 	uint8_t slave;
+	uint8_t ctrl1;
 
 	GLXIIC_ASSERT_LOCKED(sc);
 
@@ -746,6 +747,13 @@ glxiic_state_master_addr_callback(struct
 
 	bus_write_1(sc->smb_res, GLXIIC_SMB_SDA, slave);
 
+	if ((sc->msg->flags & IIC_M_RD) != 0 && sc->ndata == 1) {
+		/* Last byte from slave, set NACK. */
+		ctrl1 = bus_read_1(sc->smb_res, GLXIIC_SMB_CTRL1);
+		bus_write_1(sc->smb_res, GLXIIC_SMB_CTRL1,
+		    ctrl1 | GLXIIC_SMB_CTRL1_ACK_BIT);
+	}
+
 	return (IIC_NOERR);
 }
 
@@ -811,13 +819,6 @@ glxiic_state_master_rx_callback(struct g
 		return (IIC_ENOACK);
 	}
 
-	if (sc->ndata == 1) {
-		/* Last byte from slave, set NACK. */
-		ctrl1 = bus_read_1(sc->smb_res, GLXIIC_SMB_CTRL1);
-		bus_write_1(sc->smb_res, GLXIIC_SMB_CTRL1,
-		    ctrl1 | GLXIIC_SMB_CTRL1_ACK_BIT);
-	}
-
 	if ((status & GLXIIC_SMB_STS_STASTR_BIT) != 0) {
 		/* Bus is stalled, clear and wait for data. */
 		bus_write_1(sc->smb_res, GLXIIC_SMB_STS,
@@ -837,6 +838,13 @@ glxiic_state_master_rx_callback(struct g
 		return (glxiic_state_table[sc->state].callback(sc, status));
 	}
 
+	if (sc->ndata == 1) {
+		/* Last byte from slave, set NACK. */
+		ctrl1 = bus_read_1(sc->smb_res, GLXIIC_SMB_CTRL1);
+		bus_write_1(sc->smb_res, GLXIIC_SMB_CTRL1,
+		    ctrl1 | GLXIIC_SMB_CTRL1_ACK_BIT);
+	}
+
 	glxiic_start_timeout_locked(sc);
 
 	return (IIC_NOERR);

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 07:29:41 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1523F478;
 Wed, 25 Jun 2014 07:29:41 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 032B523E5;
 Wed, 25 Jun 2014 07:29:41 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5P7TeWU049257;
 Wed, 25 Jun 2014 07:29:40 GMT (envelope-from kevlo@svn.freebsd.org)
Received: (from kevlo@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5P7TeFG049256;
 Wed, 25 Jun 2014 07:29:40 GMT (envelope-from kevlo@svn.freebsd.org)
Message-Id: <201406250729.s5P7TeFG049256@svn.freebsd.org>
From: Kevin Lo 
Date: Wed, 25 Jun 2014 07:29:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267853 - head/share/man/man9
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 07:29:41 -0000

Author: kevlo
Date: Wed Jun 25 07:29:40 2014
New Revision: 267853
URL: http://svnweb.freebsd.org/changeset/base/267853

Log:
  Add m_pulldown and m_unshare to MLINKS.

Modified:
  head/share/man/man9/Makefile

Modified: head/share/man/man9/Makefile
==============================================================================
--- head/share/man/man9/Makefile	Wed Jun 25 05:39:30 2014	(r267852)
+++ head/share/man/man9/Makefile	Wed Jun 25 07:29:40 2014	(r267853)
@@ -918,10 +918,12 @@ MLINKS+=\
 	mbuf.9 m_move_pkthdr.9 \
 	mbuf.9 M_PREPEND.9 \
 	mbuf.9 m_prepend.9 \
+	mbuf.9 m_pulldown.9 \
 	mbuf.9 m_pullup.9 \
 	mbuf.9 m_split.9 \
 	mbuf.9 mtod.9 \
 	mbuf.9 M_TRAILINGSPACE.9 \
+	mbuf.9 m_unshare.9 \
 	mbuf.9 M_WRITABLE.9
 MLINKS+=\
 	mbuf_tags.9 m_tag_alloc.9 \

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 07:57:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9E041C6F;
 Wed, 25 Jun 2014 07:57:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8B9B1267A;
 Wed, 25 Jun 2014 07:57:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5P7v15O062418;
 Wed, 25 Jun 2014 07:57:01 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5P7v1Xl062417;
 Wed, 25 Jun 2014 07:57:01 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201406250757.s5P7v1Xl062417@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 25 Jun 2014 07:57:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267854 - head/share/man/man9
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 07:57:01 -0000

Author: kib
Date: Wed Jun 25 07:57:01 2014
New Revision: 267854
URL: http://svnweb.freebsd.org/changeset/base/267854

Log:
  Add fpu_kern.9 man page to the install.
  
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/share/man/man9/Makefile

Modified: head/share/man/man9/Makefile
==============================================================================
--- head/share/man/man9/Makefile	Wed Jun 25 07:29:40 2014	(r267853)
+++ head/share/man/man9/Makefile	Wed Jun 25 07:57:01 2014	(r267854)
@@ -112,6 +112,7 @@ MAN=	accept_filter.9 \
 	fail.9 \
 	fetch.9 \
 	firmware.9 \
+	fpu_kern.9 \
 	g_access.9 \
 	g_attach.9 \
 	g_bio.9 \
@@ -670,6 +671,12 @@ MLINKS+=fetch.9 fubyte.9 \
 	fetch.9 fuword16.9 \
 	fetch.9 fuword32.9 \
 	fetch.9 fuword64.9
+MLINKS+=fpu_kern.9 fpu_kern_alloc_ctx.9 \
+	fpu_kern.9 fpu_kern_free_ctx.9 \
+	fpu_kern.9 fpu_kern_enter.9 \
+	fpu_kern.9 fpu_kern_leave.9 \
+	fpu_kern.9 fpu_kern_thread.9 \
+	fpu_kern.9 is_fpu_kern_thread.9
 MLINKS+=g_attach.9 g_detach.9
 MLINKS+=g_bio.9 g_clone_bio.9 \
 	g_bio.9 g_destroy_bio.9 \

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 09:51:09 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4916995D;
 Wed, 25 Jun 2014 09:51:09 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 34B3521A4;
 Wed, 25 Jun 2014 09:51:09 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5P9p9NR017161;
 Wed, 25 Jun 2014 09:51:09 GMT (envelope-from royger@svn.freebsd.org)
Received: (from royger@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5P9p8YR017159;
 Wed, 25 Jun 2014 09:51:08 GMT (envelope-from royger@svn.freebsd.org)
Message-Id: <201406250951.s5P9p8YR017159@svn.freebsd.org>
From: Roger Pau Monné 
Date: Wed, 25 Jun 2014 09:51:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 09:51:09 -0000

Author: royger
Date: Wed Jun 25 09:51:08 2014
New Revision: 267858
URL: http://svnweb.freebsd.org/changeset/base/267858

Log:
  xen/virtio: fix balloon drivers to not mark pages as WIRED
  
  Prevent the Xen and VirtIO balloon drivers from marking pages as
  wired. This prevents them from increasing the system wired page count,
  which can lead to mlock failing because of hitting the limit in
  vm.max_wired.
  
  In the Xen case make sure pages are zeroed before giving them back to
  the hypervisor, or else we might be leaking data. Also remove the
  balloon_{append/retrieve} and link pages directly into the
  ballooned_pages queue using the plinks.q field in the page struct.
  
  Sponsored by: Citrix Systems R&D
  Reviewed by: kib, bryanv
  Approved by: gibbs
  
  dev/virtio/balloon/virtio_balloon.c:
   - Don't allocate pages with VM_ALLOC_WIRED.
  
  dev/xen/balloon/balloon.c:
   - Don't allocate pages with VM_ALLOC_WIRED.
   - Make sure pages are zeroed before giving them back to the
     hypervisor.
   - Remove the balloon_entry struct and the balloon_{append/retrieve}
     functions and use the page plinks.q entry to link the pages
     directly into the ballooned_pages queue.

Modified:
  head/sys/dev/virtio/balloon/virtio_balloon.c
  head/sys/dev/xen/balloon/balloon.c

Modified: head/sys/dev/virtio/balloon/virtio_balloon.c
==============================================================================
--- head/sys/dev/virtio/balloon/virtio_balloon.c	Wed Jun 25 08:55:20 2014	(r267857)
+++ head/sys/dev/virtio/balloon/virtio_balloon.c	Wed Jun 25 09:51:08 2014	(r267858)
@@ -438,8 +438,7 @@ vtballoon_alloc_page(struct vtballoon_so
 {
 	vm_page_t m;
 
-	m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_WIRED |
-	    VM_ALLOC_NOOBJ);
+	m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ);
 	if (m != NULL)
 		sc->vtballoon_current_npages++;
 
@@ -450,7 +449,6 @@ static void
 vtballoon_free_page(struct vtballoon_softc *sc, vm_page_t m)
 {
 
-	vm_page_unwire(m, PQ_INACTIVE);
 	vm_page_free(m);
 	sc->vtballoon_current_npages--;
 }

Modified: head/sys/dev/xen/balloon/balloon.c
==============================================================================
--- head/sys/dev/xen/balloon/balloon.c	Wed Jun 25 08:55:20 2014	(r267857)
+++ head/sys/dev/xen/balloon/balloon.c	Wed Jun 25 09:51:08 2014	(r267858)
@@ -94,13 +94,8 @@ SYSCTL_ULONG(_dev_xen_balloon, OID_AUTO,
 SYSCTL_ULONG(_dev_xen_balloon, OID_AUTO, high_mem, CTLFLAG_RD,
     &bs.balloon_high, 0, "High-mem balloon");
 
-struct balloon_entry {
-	vm_page_t page;
-	STAILQ_ENTRY(balloon_entry) list;
-};
-
 /* List of ballooned pages, threaded through the mem_map array. */
-static STAILQ_HEAD(,balloon_entry) ballooned_pages;
+static TAILQ_HEAD(,vm_page) ballooned_pages;
 
 /* Main work function, always executed in process context. */
 static void balloon_process(void *unused);
@@ -110,47 +105,6 @@ static void balloon_process(void *unused
 #define WPRINTK(fmt, args...) \
 	printk(KERN_WARNING "xen_mem: " fmt, ##args)
 
-/* balloon_append: add the given page to the balloon. */
-static int
-balloon_append(vm_page_t page)
-{
-	struct balloon_entry *entry;
-
-	mtx_assert(&balloon_mutex, MA_OWNED);
-
-	entry = malloc(sizeof(struct balloon_entry), M_BALLOON, M_NOWAIT);
-	if (!entry)
-		return (ENOMEM);
-	entry->page = page;
-	STAILQ_INSERT_HEAD(&ballooned_pages, entry, list);
-	bs.balloon_low++;
-
-	return (0);
-}
-
-/* balloon_retrieve: rescue a page from the balloon, if it is not empty. */
-static vm_page_t
-balloon_retrieve(void)
-{
-	vm_page_t page;
-	struct balloon_entry *entry;
-
-	mtx_assert(&balloon_mutex, MA_OWNED);
-
-	if (STAILQ_EMPTY(&ballooned_pages))
-		return (NULL);
-
-	entry = STAILQ_FIRST(&ballooned_pages);
-	STAILQ_REMOVE_HEAD(&ballooned_pages, list);
-
-	page = entry->page;
-	free(entry, M_BALLOON);
-	
-	bs.balloon_low--;
-
-	return (page);
-}
-
 static unsigned long 
 current_target(void)
 {
@@ -203,7 +157,6 @@ static int 
 increase_reservation(unsigned long nr_pages)
 {
 	unsigned long  pfn, i;
-	struct balloon_entry *entry;
 	vm_page_t      page;
 	long           rc;
 	struct xen_memory_reservation reservation = {
@@ -217,10 +170,9 @@ increase_reservation(unsigned long nr_pa
 	if (nr_pages > nitems(frame_list))
 		nr_pages = nitems(frame_list);
 
-	for (entry = STAILQ_FIRST(&ballooned_pages), i = 0;
-	     i < nr_pages; i++, entry = STAILQ_NEXT(entry, list)) {
-		KASSERT(entry, ("ballooned_pages list corrupt"));
-		page = entry->page;
+	for (page = TAILQ_FIRST(&ballooned_pages), i = 0;
+	    i < nr_pages; i++, page = TAILQ_NEXT(page, plinks.q)) {
+		KASSERT(page != NULL, ("ballooned_pages list corrupt"));
 		frame_list[i] = (VM_PAGE_TO_PHYS(page) >> PAGE_SHIFT);
 	}
 
@@ -245,8 +197,10 @@ increase_reservation(unsigned long nr_pa
 	}
 
 	for (i = 0; i < nr_pages; i++) {
-		page = balloon_retrieve();
-		KASSERT(page, ("balloon_retrieve failed"));
+		page = TAILQ_FIRST(&ballooned_pages);
+		KASSERT(page != NULL, ("Unable to get ballooned page"));
+		TAILQ_REMOVE(&ballooned_pages, page, plinks.q);
+		bs.balloon_low--;
 
 		pfn = (VM_PAGE_TO_PHYS(page) >> PAGE_SHIFT);
 		KASSERT((xen_feature(XENFEAT_auto_translated_physmap) ||
@@ -255,7 +209,6 @@ increase_reservation(unsigned long nr_pa
 
 		set_phys_to_machine(pfn, frame_list[i]);
 
-		vm_page_unwire(page, PQ_INACTIVE);
 		vm_page_free(page);
 	}
 
@@ -286,24 +239,29 @@ decrease_reservation(unsigned long nr_pa
 	for (i = 0; i < nr_pages; i++) {
 		if ((page = vm_page_alloc(NULL, 0, 
 			    VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | 
-			    VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) {
+			    VM_ALLOC_ZERO)) == NULL) {
 			nr_pages = i;
 			need_sleep = 1;
 			break;
 		}
 
+		if ((page->flags & PG_ZERO) == 0) {
+			/*
+			 * Zero the page, or else we might be leaking
+			 * important data to other domains on the same
+			 * host. Xen doesn't scrub ballooned out memory
+			 * pages, the guest is in charge of making
+			 * sure that no information is leaked.
+			 */
+			pmap_zero_page(page);
+		}
+
 		pfn = (VM_PAGE_TO_PHYS(page) >> PAGE_SHIFT);
 		frame_list[i] = PFNTOMFN(pfn);
 
 		set_phys_to_machine(pfn, INVALID_P2M_ENTRY);
-		if (balloon_append(page) != 0) {
-			vm_page_unwire(page, PQ_INACTIVE);
-			vm_page_free(page);
-
-			nr_pages = i;
-			need_sleep = 1;
-			break;
-		}
+		TAILQ_INSERT_HEAD(&ballooned_pages, page, plinks.q);
+		bs.balloon_low++;
 	}
 
 	set_xen_guest_handle(reservation.extent_start, frame_list);
@@ -438,7 +396,8 @@ balloon_init(void *arg)
 	/* Initialise the balloon with excess memory space. */
 	for (pfn = xen_start_info->nr_pages; pfn < max_pfn; pfn++) {
 		page = PHYS_TO_VM_PAGE(pfn << PAGE_SHIFT);
-		balloon_append(page);
+		TAILQ_INSERT_HEAD(&ballooned_pages, page, plinks.q);
+		bs.balloon_low++;
 	}
 #undef max_pfn
 #endif

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 10:01:03 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6F20DC9E;
 Wed, 25 Jun 2014 10:01:03 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5CA6C2321;
 Wed, 25 Jun 2014 10:01:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5PA13rR023961;
 Wed, 25 Jun 2014 10:01:03 GMT (envelope-from bapt@svn.freebsd.org)
Received: (from bapt@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PA13tQ023960;
 Wed, 25 Jun 2014 10:01:03 GMT (envelope-from bapt@svn.freebsd.org)
Message-Id: <201406251001.s5PA13tQ023960@svn.freebsd.org>
From: Baptiste Daroussin 
Date: Wed, 25 Jun 2014 10:01:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267859 - head
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 10:01:03 -0000

Author: bapt
Date: Wed Jun 25 10:01:02 2014
New Revision: 267859
URL: http://svnweb.freebsd.org/changeset/base/267859

Log:
  Mark send-pr info page as an obsolete file

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Wed Jun 25 09:51:08 2014	(r267858)
+++ head/ObsoleteFiles.inc	Wed Jun 25 10:01:02 2014	(r267859)
@@ -39,6 +39,7 @@
 # done
 
 # 20140614: send-pr removal
+OLD_FILES+=usr/share/info/send-pr.info.gz
 OLD_FILES+=usr/share/man/man1/send-pr.1.gz
 OLD_FILES+=etc/gnats/freefall
 OLD_DIRS+=etc/gnats

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 11:58:34 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 14CDCA77;
 Wed, 25 Jun 2014 11:58:34 +0000 (UTC)
Received: from mail-we0-x22f.google.com (mail-we0-x22f.google.com
 [IPv6:2a00:1450:400c:c03::22f])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 0EBEA2E40;
 Wed, 25 Jun 2014 11:58:32 +0000 (UTC)
Received: by mail-we0-f175.google.com with SMTP id k48so1919697wev.6
 for ; Wed, 25 Jun 2014 04:58:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:reply-to:sender:in-reply-to:references:date:message-id
 :subject:from:to:cc:content-type:content-transfer-encoding;
 bh=1U3PyW/5FI2J2wjb6a01UDsHkGMl950te4ZvSiBjRX0=;
 b=Z2ny+2kbIns55IVc3XmsRSDliVcSG1Yi0TjgNlFqmS+YgWvDVzjFKBTHlmugbVTgNP
 jz6luLSh14fZUyQJNppiQZppNQLtR1Y1lqpE12Yp9TukLPwK/tOTZTeSRAoy2uAHvHVz
 +TMhVfbcPP+uHz2t6vM5exAVXEs9j2Ctn4pUhjxSSg+dcNCzFTy4QfsCSPxRPkm3jCKe
 Q/PhUiI+MLSTxfv/2FMpJFMbpqS5juaYgCGocDPzESXmb/Xs0iLcuz/81nS6msHQO78W
 UHBI3GsfpgmwqCi94DYxEoklm4GsRtZLBMQVnbITKSYDWV24EDgUDpkcpzKlrrmzsZN1
 /tVQ==
MIME-Version: 1.0
X-Received: by 10.180.37.100 with SMTP id x4mr41764971wij.37.1403697509579;
 Wed, 25 Jun 2014 04:58:29 -0700 (PDT)
Reply-To: attilio@FreeBSD.org
Sender: asmrookie@gmail.com
Received: by 10.217.46.129 with HTTP; Wed, 25 Jun 2014 04:58:29 -0700 (PDT)
In-Reply-To: <201406250951.s5P9p8YR017159@svn.freebsd.org>
References: <201406250951.s5P9p8YR017159@svn.freebsd.org>
Date: Wed, 25 Jun 2014 13:58:29 +0200
X-Google-Sender-Auth: FeyI8rtqVOhwgtQLIEqw9yKRSNg
Message-ID: 
Subject: Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon
From: Attilio Rao 
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , 
 Alan Cox 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 11:58:34 -0000

On Wed, Jun 25, 2014 at 11:51 AM, Roger Pau Monn=C3=A9 =
 wrote:
> Author: royger
> Date: Wed Jun 25 09:51:08 2014
> New Revision: 267858
> URL: http://svnweb.freebsd.org/changeset/base/267858
>
> Log:
>   xen/virtio: fix balloon drivers to not mark pages as WIRED
>
>   Prevent the Xen and VirtIO balloon drivers from marking pages as
>   wired. This prevents them from increasing the system wired page count,
>   which can lead to mlock failing because of hitting the limit in
>   vm.max_wired.

This change is conceptually wrong.
The pages balloon is allocating are unmanaged and they should be wired
by definition. Alan and I are considering enforcing this (mandatory
wired pages for unmanaged pages allocation) directly in the KPI.
This in practice just seem an artifact to deal with scarce  wired
memory limit. I suggest that for the XEN case this limit gets bumped
rather relying on similar type of hacks.

Attilio


--=20
Peace can only be achieved by understanding - A. Einstein

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 12:06:46 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A266FA8;
 Wed, 25 Jun 2014 12:06:46 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8EA992F62;
 Wed, 25 Jun 2014 12:06:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5PC6kZl082858;
 Wed, 25 Jun 2014 12:06:46 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PC6kFF082854;
 Wed, 25 Jun 2014 12:06:46 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201406251206.s5PC6kFF082854@svn.freebsd.org>
From: Gavin Atkinson 
Date: Wed, 25 Jun 2014 12:06:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267863 - in head: . usr.bin usr.bin/csup
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 12:06:46 -0000

Author: gavin
Date: Wed Jun 25 12:06:45 2014
New Revision: 267863
URL: http://svnweb.freebsd.org/changeset/base/267863

Log:
  Remove csup(1) and its associated cpasswd(1) tool.
  
  With the move by the FreeBSD Project away from CVSup as a distribution
  mechanism, there is no longer a need to keep this in base.
  
  Approved by:	mux (around a year ago), silence on -hackers
  X-MFC-after:	never

Deleted:
  head/usr.bin/csup/
Modified:
  head/ObsoleteFiles.inc
  head/usr.bin/Makefile

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Wed Jun 25 10:27:17 2014	(r267862)
+++ head/ObsoleteFiles.inc	Wed Jun 25 12:06:45 2014	(r267863)
@@ -38,6 +38,11 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20140625: csup removal
+OLD_FILES+=usr/bin/csup
+OLD_FILES+=usr/bin/cpasswd
+OLD_FILES+=usr/share/man/man1/csup.1.gz
+OLD_FILES+=usr/share/man/man1/cpasswd.1.gz
 # 20140614: send-pr removal
 OLD_FILES+=usr/share/info/send-pr.info.gz
 OLD_FILES+=usr/share/man/man1/send-pr.1.gz

Modified: head/usr.bin/Makefile
==============================================================================
--- head/usr.bin/Makefile	Wed Jun 25 10:27:17 2014	(r267862)
+++ head/usr.bin/Makefile	Wed Jun 25 12:06:45 2014	(r267863)
@@ -266,10 +266,6 @@ SUBDIR+=	drill
 SUBDIR+=	host
 .endif
 
-.if ${MK_LIBTHR} != "no"
-SUBDIR+=	csup
-.endif
-
 .if ${MK_LOCATE} != "no"
 SUBDIR+=	locate
 .endif

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 12:09:37 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4F9D6328;
 Wed, 25 Jun 2014 12:09:37 +0000 (UTC)
Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id C4A062F9D;
 Wed, 25 Jun 2014 12:09:36 +0000 (UTC)
Received: from cell.glebius.int.ru (localhost [127.0.0.1])
 by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s5PC9XuU054240
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Wed, 25 Jun 2014 16:09:33 +0400 (MSK)
 (envelope-from glebius@FreeBSD.org)
Received: (from glebius@localhost)
 by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s5PC9XCw054239;
 Wed, 25 Jun 2014 16:09:33 +0400 (MSK)
 (envelope-from glebius@FreeBSD.org)
X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to
 glebius@FreeBSD.org using -f
Date: Wed, 25 Jun 2014 16:09:32 +0400
From: Gleb Smirnoff 
To: Attilio Rao 
Subject: Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon
Message-ID: <20140625120932.GM28199@FreeBSD.org>
References: <201406250951.s5P9p8YR017159@svn.freebsd.org>
 
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: 
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: Alan Cox ,
 "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 Roger Pau =?iso-8859-1?Q?Monn=E9?= ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 12:09:37 -0000

On Wed, Jun 25, 2014 at 01:58:29PM +0200, Attilio Rao wrote:
A> > Log:
A> >   xen/virtio: fix balloon drivers to not mark pages as WIRED
A> >
A> >   Prevent the Xen and VirtIO balloon drivers from marking pages as
A> >   wired. This prevents them from increasing the system wired page count,
A> >   which can lead to mlock failing because of hitting the limit in
A> >   vm.max_wired.
A> 
A> This change is conceptually wrong.
A> The pages balloon is allocating are unmanaged and they should be wired
A> by definition. Alan and I are considering enforcing this (mandatory
A> wired pages for unmanaged pages allocation) directly in the KPI.
A> This in practice just seem an artifact to deal with scarce  wired
A> memory limit. I suggest that for the XEN case this limit gets bumped
A> rather relying on similar type of hacks.

Proper limit would be to count pages wired by userland via mlock(2)
and enforce limit only on those pages. Pages wired by kernel should
be either unlimited or controled by a separate limit.

-- 
Totus tuus, Glebius.

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 12:17:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 53802610;
 Wed, 25 Jun 2014 12:17:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 405B92094;
 Wed, 25 Jun 2014 12:17:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5PCH1VR087983;
 Wed, 25 Jun 2014 12:17:01 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PCH16f087980;
 Wed, 25 Jun 2014 12:17:01 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201406251217.s5PCH16f087980@svn.freebsd.org>
From: Gavin Atkinson 
Date: Wed, 25 Jun 2014 12:17:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267864 - head/release/scripts
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 12:17:01 -0000

Author: gavin
Date: Wed Jun 25 12:17:00 2014
New Revision: 267864
URL: http://svnweb.freebsd.org/changeset/base/267864

Log:
  Remove an nunnecessary reference to csup.

Modified:
  head/release/scripts/mm-mtree.sh

Modified: head/release/scripts/mm-mtree.sh
==============================================================================
--- head/release/scripts/mm-mtree.sh	Wed Jun 25 12:06:45 2014	(r267863)
+++ head/release/scripts/mm-mtree.sh	Wed Jun 25 12:17:00 2014	(r267864)
@@ -5,7 +5,7 @@
 # This script is intended to be used as part of the release building
 # process to generate the /var/db/mergemaster.mtree file relevant to
 # the source tree used to create the release so that users can make
-# use of mergemaster's -U option to update their files after csup'ing
+# use of mergemaster's -U option to update their files after updating
 # to -stable.
 
 # Copyright 2009 Douglas Barton

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 12:23:17 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1981DA15;
 Wed, 25 Jun 2014 12:23:17 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 05E002165;
 Wed, 25 Jun 2014 12:23:17 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5PCNGZ3092195;
 Wed, 25 Jun 2014 12:23:16 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PCNG1e092194;
 Wed, 25 Jun 2014 12:23:16 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201406251223.s5PCNG1e092194@svn.freebsd.org>
From: Gavin Atkinson 
Date: Wed, 25 Jun 2014 12:23:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267865 - head/share/examples/etc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 12:23:17 -0000

Author: gavin
Date: Wed Jun 25 12:23:16 2014
New Revision: 267865
URL: http://svnweb.freebsd.org/changeset/base/267865

Log:
  Drop example variables for updating over csup.  These have not functioned
  since r251084.
  
  MFC after:	1 week

Modified:
  head/share/examples/etc/make.conf

Modified: head/share/examples/etc/make.conf
==============================================================================
--- head/share/examples/etc/make.conf	Wed Jun 25 12:17:00 2014	(r267864)
+++ head/share/examples/etc/make.conf	Wed Jun 25 12:23:16 2014	(r267865)
@@ -185,18 +185,6 @@
 #ENABLE_SUID_K5SU=
 #
 #
-# CVSup update flags.  Edit SUPFILE settings to reflect whichever distribution
-# file(s) you use on your site (see /usr/share/examples/cvsup/README for more
-# information on CVSup and these files).  To use, do "make update" in /usr/src.
-#
-#SUP_UPDATE=
-#
-#SUP=            /usr/bin/csup
-#SUPFLAGS=       -L 2
-#SUPHOST=        cvsup.uk.FreeBSD.org
-#SUPFILE=        /usr/share/examples/cvsup/standard-supfile
-#PORTSSUPFILE=   /usr/share/examples/cvsup/ports-supfile
-#
 # top(1) uses a hash table for the user names.  The size of this hash
 # can be tuned to match the number of local users.  The table size should
 # be a prime number approximately twice as large as the number of lines in

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 12:28:22 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id DEF8ACF3;
 Wed, 25 Jun 2014 12:28:22 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CBB1A21C7;
 Wed, 25 Jun 2014 12:28:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5PCSM4d092918;
 Wed, 25 Jun 2014 12:28:22 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PCSMWH092917;
 Wed, 25 Jun 2014 12:28:22 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201406251228.s5PCSMWH092917@svn.freebsd.org>
From: Gavin Atkinson 
Date: Wed, 25 Jun 2014 12:28:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267866 - head/share/man/man7
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 12:28:23 -0000

Author: gavin
Date: Wed Jun 25 12:28:22 2014
New Revision: 267866
URL: http://svnweb.freebsd.org/changeset/base/267866

Log:
  Drop references to updating over csup from build(7).
  
  MFC after:	1 week

Modified:
  head/share/man/man7/build.7

Modified: head/share/man/man7/build.7
==============================================================================
--- head/share/man/man7/build.7	Wed Jun 25 12:23:16 2014	(r267865)
+++ head/share/man/man7/build.7	Wed Jun 25 12:28:22 2014	(r267866)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 17, 2014
+.Dd June 25, 2014
 .Dt BUILD 7
 .Os
 .Sh NAME
@@ -40,8 +40,7 @@ normally
 and
 .Pa /usr/ports .
 These directories may be initially empty or non-existent until updated with
-.Xr csup 1 ,
-.Xr svn 1 ,
+.Xr svn 1
 or
 .Xr portsnap 8 .
 Directory
@@ -616,7 +615,6 @@ make TARGET=sparc64 DESTDIR=/clients/spa
 .Ed
 .Sh SEE ALSO
 .Xr cc 1 ,
-.Xr csup 1 ,
 .Xr install 1 ,
 .Xr make 1 ,
 .Xr svn 1 ,

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 12:32:42 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8DDD2EC6;
 Wed, 25 Jun 2014 12:32:42 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 60052227E;
 Wed, 25 Jun 2014 12:32:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5PCWgKn096619;
 Wed, 25 Jun 2014 12:32:42 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PCWfbH096615;
 Wed, 25 Jun 2014 12:32:41 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201406251232.s5PCWfbH096615@svn.freebsd.org>
From: Gavin Atkinson 
Date: Wed, 25 Jun 2014 12:32:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267867 - in head: . etc/mtree share/examples
 share/examples/cvsup
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 12:32:42 -0000

Author: gavin
Date: Wed Jun 25 12:32:41 2014
New Revision: 267867
URL: http://svnweb.freebsd.org/changeset/base/267867

Log:
  Remove example cvsup config files.
  
  MFC after:	1 week

Deleted:
  head/share/examples/cvsup/
Modified:
  head/ObsoleteFiles.inc
  head/etc/mtree/BSD.usr.dist
  head/share/examples/Makefile

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Wed Jun 25 12:28:22 2014	(r267866)
+++ head/ObsoleteFiles.inc	Wed Jun 25 12:32:41 2014	(r267867)
@@ -43,6 +43,11 @@ OLD_FILES+=usr/bin/csup
 OLD_FILES+=usr/bin/cpasswd
 OLD_FILES+=usr/share/man/man1/csup.1.gz
 OLD_FILES+=usr/share/man/man1/cpasswd.1.gz
+OLD_FILES+=usr/share/examples/cvsup/README
+OLD_FILES+=usr/share/examples/cvsup/cvs-supfile
+OLD_FILES+=usr/share/examples/cvsup/stable-supfile
+OLD_FILES+=usr/share/examples/cvsup/standard-supfile
+OLD_DIRS+=usr/share/examples/cvsup
 # 20140614: send-pr removal
 OLD_FILES+=usr/share/info/send-pr.info.gz
 OLD_FILES+=usr/share/man/man1/send-pr.1.gz

Modified: head/etc/mtree/BSD.usr.dist
==============================================================================
--- head/etc/mtree/BSD.usr.dist	Wed Jun 25 12:28:22 2014	(r267866)
+++ head/etc/mtree/BSD.usr.dist	Wed Jun 25 12:32:41 2014	(r267867)
@@ -301,8 +301,6 @@
             ..
             csh
             ..
-            cvsup
-            ..
             diskless
             ..
             dma

Modified: head/share/examples/Makefile
==============================================================================
--- head/share/examples/Makefile	Wed Jun 25 12:28:22 2014	(r267866)
+++ head/share/examples/Makefile	Wed Jun 25 12:32:41 2014	(r267867)
@@ -10,7 +10,6 @@ LDIRS=	BSD_daemon \
 	bhyve \
 	bootforth \
 	csh \
-	cvsup \
 	diskless \
 	drivers \
 	etc \
@@ -52,10 +51,6 @@ XFILES=	BSD_daemon/FreeBSD.pfa \
 	bootforth/menuconf.4th \
 	bootforth/screen.4th \
 	csh/dot.cshrc \
-	cvsup/README \
-	cvsup/cvs-supfile \
-	cvsup/stable-supfile \
-	cvsup/standard-supfile \
 	diskless/ME \
 	diskless/README.BOOTP \
 	diskless/README.TEMPLATING \

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 12:41:43 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B064C3A8;
 Wed, 25 Jun 2014 12:41:43 +0000 (UTC)
Received: from mail-wg0-x22b.google.com (mail-wg0-x22b.google.com
 [IPv6:2a00:1450:400c:c00::22b])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 87F90239C;
 Wed, 25 Jun 2014 12:41:42 +0000 (UTC)
Received: by mail-wg0-f43.google.com with SMTP id b13so1901864wgh.26
 for ; Wed, 25 Jun 2014 05:41:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:reply-to:sender:in-reply-to:references:date:message-id
 :subject:from:to:cc:content-type;
 bh=tdU91326w9U0TbyTletuGuNuL78Kb+G1oIFtYinbn3Y=;
 b=WyPMss6qWZdf2kBtEEJFo4jSyRHtDoRrQk9luRMHufGiHlGb/qP7uR0CZSSypq6Sou
 o4brkoqLvg7pz03qTtgEB//LnQkshwkRLuF6ZATpPp1arbX8gaibf1sw/9Zmk9VNo748
 sqCxk9jBIYqSHXh64ZFrhSzaiXqKkzhIczyXMto6hcik/Bn2t0SqhdmJqh5cqQXEMRwj
 kVP7Rtz9cnOD5zJ+kIhu8tMAmafSzEfLzViV+I7LZbd6KkBWpYEmgkUV+H8tuRjUx2oM
 UTmivK/5nkJCX8g28hb52qzhxhsaoiAFBkAyifcfJvMTUXmtS/IdSaVdpCd69zYyeNtt
 6B7A==
MIME-Version: 1.0
X-Received: by 10.180.198.197 with SMTP id je5mr1133396wic.48.1403700098081;
 Wed, 25 Jun 2014 05:41:38 -0700 (PDT)
Reply-To: attilio@FreeBSD.org
Sender: asmrookie@gmail.com
Received: by 10.217.46.129 with HTTP; Wed, 25 Jun 2014 05:41:38 -0700 (PDT)
In-Reply-To: <20140625120932.GM28199@FreeBSD.org>
References: <201406250951.s5P9p8YR017159@svn.freebsd.org>
 
 <20140625120932.GM28199@FreeBSD.org>
Date: Wed, 25 Jun 2014 14:41:38 +0200
X-Google-Sender-Auth: HZ0Hu44y8vXBRoUiXAvqbB0VtYU
Message-ID: 
Subject: Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon
From: Attilio Rao 
To: Gleb Smirnoff 
Content-Type: text/plain; charset=UTF-8
Cc: Alan Cox ,
 "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 12:41:43 -0000

On Wed, Jun 25, 2014 at 2:09 PM, Gleb Smirnoff  wrote:
> On Wed, Jun 25, 2014 at 01:58:29PM +0200, Attilio Rao wrote:
> A> > Log:
> A> >   xen/virtio: fix balloon drivers to not mark pages as WIRED
> A> >
> A> >   Prevent the Xen and VirtIO balloon drivers from marking pages as
> A> >   wired. This prevents them from increasing the system wired page count,
> A> >   which can lead to mlock failing because of hitting the limit in
> A> >   vm.max_wired.
> A>
> A> This change is conceptually wrong.
> A> The pages balloon is allocating are unmanaged and they should be wired
> A> by definition. Alan and I are considering enforcing this (mandatory
> A> wired pages for unmanaged pages allocation) directly in the KPI.
> A> This in practice just seem an artifact to deal with scarce  wired
> A> memory limit. I suggest that for the XEN case this limit gets bumped
> A> rather relying on similar type of hacks.
>
> Proper limit would be to count pages wired by userland via mlock(2)
> and enforce limit only on those pages. Pages wired by kernel should
> be either unlimited or controled by a separate limit.

FWIW, I mostly agree with this. I think that the kernel and userland
limits should be split apart. But for the time being, rising the limit
is better.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 13:29:36 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 33A8234C;
 Wed, 25 Jun 2014 13:29:36 +0000 (UTC)
Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com
 [IPv6:2a00:1450:400c:c00::234])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 2AFF927CD;
 Wed, 25 Jun 2014 13:29:35 +0000 (UTC)
Received: by mail-wg0-f52.google.com with SMTP id b13so2034611wgh.11
 for ; Wed, 25 Jun 2014 06:29:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
 :references:in-reply-to:content-type:content-transfer-encoding;
 bh=Xtq82Q8wlIsQ8GbRL1ma6/qu6Zktu3J8n1mhI3FzzWI=;
 b=jG8NeXXLxAZll+/hrtWA4D3Mo7EnO/loWiGx5K4pAePzbsaIIJiE6+k81hbFBFx6dR
 Q8cu5XOFPS3852Yps42ZoA5lY1Uz0w9IKpsUx2L9LkOycier52hBiRgi0iUSg+qHTN8C
 EYJrfpXsuIkuVykalewlU0//GUwxibn/gbTbNwtu1KHSv4BSqQinnObiKCFnBhK+nZEB
 92tWBEdsnSCw15BpBQY6ZqSPDhmN/X2EMB2GwO9klKYR/vjX8QuI8a+egFwbOLM7DR7M
 s/3ELV8ZBijWN6LvolHjjEFuNoBmGIdUN4fBhRlJ8T11aTn789XHFoPeBl91xYkda/Nm
 x2sA==
X-Received: by 10.180.107.99 with SMTP id hb3mr10533243wib.8.1403702969713;
 Wed, 25 Jun 2014 06:29:29 -0700 (PDT)
Received: from [172.16.1.30] (39.Red-2-136-52.dynamicIP.rima-tde.net.
 [2.136.52.39])
 by mx.google.com with ESMTPSA id r9sm53803276wia.17.2014.06.25.06.29.28
 for 
 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Wed, 25 Jun 2014 06:29:28 -0700 (PDT)
Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= 
Message-ID: <53AACEAB.3090702@FreeBSD.org>
Date: Wed, 25 Jun 2014 15:29:15 +0200
From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= 
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: attilio@FreeBSD.org, Alan Cox 
Subject: Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon
References: <201406250951.s5P9p8YR017159@svn.freebsd.org>
 
In-Reply-To: 
X-Enigmail-Version: 1.6
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 13:29:36 -0000

On 25/06/14 13:58, Attilio Rao wrote:
> On Wed, Jun 25, 2014 at 11:51 AM, Roger Pau Monné  wrote:
>> Author: royger
>> Date: Wed Jun 25 09:51:08 2014
>> New Revision: 267858
>> URL: http://svnweb.freebsd.org/changeset/base/267858
>>
>> Log:
>>   xen/virtio: fix balloon drivers to not mark pages as WIRED
>>
>>   Prevent the Xen and VirtIO balloon drivers from marking pages as
>>   wired. This prevents them from increasing the system wired page count,
>>   which can lead to mlock failing because of hitting the limit in
>>   vm.max_wired.
> 
> This change is conceptually wrong.
> The pages balloon is allocating are unmanaged and they should be wired
> by definition. Alan and I are considering enforcing this (mandatory
> wired pages for unmanaged pages allocation) directly in the KPI.
> This in practice just seem an artifact to deal with scarce  wired
> memory limit. I suggest that for the XEN case this limit gets bumped
> rather relying on similar type of hacks.

IMHO, marking them as wired seems wrong too, those pages are not wired,
they are simply not there any more. This was discussed in:

http://lists.freebsd.org/pipermail/freebsd-virtualization/2014-June/002643.html

If there's consensus I will revert the change, but I would say that
increasing vm.max_wired for VMs is also a gross hack.

Roger.

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 13:44:38 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A3DC8C72;
 Wed, 25 Jun 2014 13:44:38 +0000 (UTC)
Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com
 [IPv6:2a00:1450:400c:c00::22c])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 98E622997;
 Wed, 25 Jun 2014 13:44:37 +0000 (UTC)
Received: by mail-wg0-f44.google.com with SMTP id x13so2078629wgg.27
 for ; Wed, 25 Jun 2014 06:44:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:reply-to:sender:in-reply-to:references:date:message-id
 :subject:from:to:cc:content-type:content-transfer-encoding;
 bh=6gtxr1+gzdZPIw642th4Oa1C50rDDUWRY8a+45XwXZU=;
 b=u7ojd/C9cgqmbJY/6yIYQgs8ne+aTh1EuAuTgywpLMoEJXn+W6UDxmruZhHA/nLhyK
 EVkoYVo6fBbyrQISVQBYrLaBNWeBjZxqeS2ioabzLjz2ic8+uiOaeluuOUPJDQ3716Tr
 NezW9glSJB7j/PCDR/G6Y88WDAHd6ACVMzi+FRT0N19Lku9vF4zu38LDzyItq34bpcFV
 Zx7MaGTUQVkaD+xDfMW4aXwQ8wA52dW45cQ5JOKm+fnI3XcCe7qmxqU8buhaRcxbsKT+
 IECbwW+OmWfiwQVj0kCquiWLvEEYajY/EDZ4qMJkPLX2f+LMfDLzhKoisbVVcoQ8BhZn
 55pw==
MIME-Version: 1.0
X-Received: by 10.194.120.103 with SMTP id lb7mr9688428wjb.40.1403703875102;
 Wed, 25 Jun 2014 06:44:35 -0700 (PDT)
Reply-To: attilio@FreeBSD.org
Sender: asmrookie@gmail.com
Received: by 10.217.46.129 with HTTP; Wed, 25 Jun 2014 06:44:35 -0700 (PDT)
In-Reply-To: <53AACEAB.3090702@FreeBSD.org>
References: <201406250951.s5P9p8YR017159@svn.freebsd.org>
 
 <53AACEAB.3090702@FreeBSD.org>
Date: Wed, 25 Jun 2014 15:44:35 +0200
X-Google-Sender-Auth: VGLOkrKL4E6uXMqMhDifQTAlCJk
Message-ID: 
Subject: Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon
From: Attilio Rao 
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: Alan Cox ,
 "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 13:44:38 -0000

On Wed, Jun 25, 2014 at 3:29 PM, Roger Pau Monn=C3=A9  =
wrote:
> On 25/06/14 13:58, Attilio Rao wrote:
>> On Wed, Jun 25, 2014 at 11:51 AM, Roger Pau Monn=C3=A9  wrote:
>>> Author: royger
>>> Date: Wed Jun 25 09:51:08 2014
>>> New Revision: 267858
>>> URL: http://svnweb.freebsd.org/changeset/base/267858
>>>
>>> Log:
>>>   xen/virtio: fix balloon drivers to not mark pages as WIRED
>>>
>>>   Prevent the Xen and VirtIO balloon drivers from marking pages as
>>>   wired. This prevents them from increasing the system wired page count=
,
>>>   which can lead to mlock failing because of hitting the limit in
>>>   vm.max_wired.
>>
>> This change is conceptually wrong.
>> The pages balloon is allocating are unmanaged and they should be wired
>> by definition. Alan and I are considering enforcing this (mandatory
>> wired pages for unmanaged pages allocation) directly in the KPI.
>> This in practice just seem an artifact to deal with scarce  wired
>> memory limit. I suggest that for the XEN case this limit gets bumped
>> rather relying on similar type of hacks.
>
> IMHO, marking them as wired seems wrong too, those pages are not wired,
> they are simply not there any more. This was discussed in:

I'm not entirely sure what do you mean with "not there anymore", so
I'm just guessing and I assume that you mean "pages are not collected
in any vm object and then they are not referenced in any pagequeue".
By extension this also matches what "unmanaged page" means.

If the page is unmanaged it means that the pagedaemon won't see it, so
they won't be swapped out anyway. Wiring them it will enforce more
sanity checking on the page. The max_wired concern may be real,
however, please see below.

> http://lists.freebsd.org/pipermail/freebsd-virtualization/2014-June/00264=
3.html
>
> If there's consensus I will revert the change, but I would say that
> increasing vm.max_wired for VMs is also a gross hack.

Why? If VM needs more wired memory I assume that we can tune up the
default value of max_wired?

I think that however your case makes an interesting point: if we want
to make unmanaged pages as inherently wired, we likely need a little
bit higher max_wired value. When I completed a patch for this, pho@
couldn't reproduce any similar issue even with stress-testing (and
also, the places to allocate unmanaged pages and not requesting
VM_ALLOC_WIRED were very little, almost 0, with the exception of
vm_page_alloc_contig() calls) but I think it is a valid proposition.

However I would still like to have more control on kernel-specific
wired memory for processes. I'm for example thinking to ARC vs. buffer
cache, where I expect the wired memory consumption to be much bigger
for the former case.

Attilio


--=20
Peace can only be achieved by understanding - A. Einstein

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 13:50:10 2014
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 071962B5;
 Wed, 25 Jun 2014 13:50:10 +0000 (UTC)
Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140])
 by mx1.freebsd.org (Postfix) with ESMTP id 5417D2A53;
 Wed, 25 Jun 2014 13:50:07 +0000 (UTC)
Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua
 [212.40.38.100])
 by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA03346;
 Wed, 25 Jun 2014 16:49:59 +0300 (EEST)
 (envelope-from avg@FreeBSD.org)
Received: from localhost ([127.0.0.1])
 by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD))
 id 1WznaJ-000DfD-2x; Wed, 25 Jun 2014 16:49:59 +0300
Message-ID: <53AAD356.20202@FreeBSD.org>
Date: Wed, 25 Jun 2014 17:49:10 +0400
From: Andriy Gapon 
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: attilio@FreeBSD.org, =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?=
 
Subject: Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon
References: <201406250951.s5P9p8YR017159@svn.freebsd.org>		<53AACEAB.3090702@FreeBSD.org>
 
In-Reply-To: 
X-Enigmail-Version: 1.6
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Cc: Alan Cox ,
 "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 13:50:10 -0000

On 25/06/2014 17:44, Attilio Rao wrote:
> Why? If VM needs more wired memory I assume that we can tune up the
> default value of max_wired?
> 
> I think that however your case makes an interesting point: if we want
> to make unmanaged pages as inherently wired, we likely need a little
> bit higher max_wired value. When I completed a patch for this, pho@
> couldn't reproduce any similar issue even with stress-testing (and
> also, the places to allocate unmanaged pages and not requesting
> VM_ALLOC_WIRED were very little, almost 0, with the exception of
> vm_page_alloc_contig() calls) but I think it is a valid proposition.
> 
> However I would still like to have more control on kernel-specific
> wired memory for processes. I'm for example thinking to ARC vs. buffer
> cache, where I expect the wired memory consumption to be much bigger
> for the former case.

My humble opinion is that userland page wiring should be tuned via
resource limits and that vm.max_wired could be retired altogether.
Kernel wiring ignores the knob anyway.

-- 
Andriy Gapon

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 14:06:55 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 202BC94B;
 Wed, 25 Jun 2014 14:06:55 +0000 (UTC)
Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com
 [IPv6:2a00:1450:400c:c05::231])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 1757E2BE6;
 Wed, 25 Jun 2014 14:06:53 +0000 (UTC)
Received: by mail-wi0-f177.google.com with SMTP id r20so2586970wiv.16
 for ; Wed, 25 Jun 2014 07:06:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
 :references:in-reply-to:content-type:content-transfer-encoding;
 bh=v0qql7OJvRXkhzubpbqhCgUntaRZQ+75RS3/I8OWTTo=;
 b=ZKhr0z/dfh+gv10vdwUhp1ILTg5CkX0bsxQqX6epb9GXS9ok84n0Yi0hDn8r3JtOc9
 0zO9v2N/Ts7R/lw67o2JTNkoE+UWn1xJQGlhDYRuhSlLQNqSSwvvBPH6dCVQ/cjrSwIo
 hKqTkYmp3OFWZCMKg3A0WHplKmDP5p666eDkSUV2l17WWpsHgZoZzNu5S5Tktjf/tm94
 E4idw7ijv2EcSPsQ889FU9U5hPavY/Rh0cxo6EBA5YLxptIEAHesx/Hysn4CTn6Wen5/
 Q5rBhvCOcp2yX9dahk2y0xVMpHEIKMekptBH/r7XMjsHQTz4KvQucdeKH/EuX91EeFbI
 piDA==
X-Received: by 10.194.10.167 with SMTP id j7mr10378173wjb.100.1403705209794;
 Wed, 25 Jun 2014 07:06:49 -0700 (PDT)
Received: from [172.16.1.30] (39.Red-2-136-52.dynamicIP.rima-tde.net.
 [2.136.52.39])
 by mx.google.com with ESMTPSA id ez8sm12747071wib.12.2014.06.25.07.06.48
 for 
 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Wed, 25 Jun 2014 07:06:49 -0700 (PDT)
Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= 
Message-ID: <53AAD775.8070302@FreeBSD.org>
Date: Wed, 25 Jun 2014 16:06:45 +0200
From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= 
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: attilio@FreeBSD.org
Subject: Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon
References: <201406250951.s5P9p8YR017159@svn.freebsd.org>		<53AACEAB.3090702@FreeBSD.org>
 
In-Reply-To: 
X-Enigmail-Version: 1.6
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Alan Cox ,
 "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 14:06:55 -0000

On 25/06/14 15:44, Attilio Rao wrote:
> On Wed, Jun 25, 2014 at 3:29 PM, Roger Pau Monné  wrote:
>> On 25/06/14 13:58, Attilio Rao wrote:
>>> On Wed, Jun 25, 2014 at 11:51 AM, Roger Pau Monné  wrote:
>>>> Author: royger
>>>> Date: Wed Jun 25 09:51:08 2014
>>>> New Revision: 267858
>>>> URL: http://svnweb.freebsd.org/changeset/base/267858
>>>>
>>>> Log:
>>>>   xen/virtio: fix balloon drivers to not mark pages as WIRED
>>>>
>>>>   Prevent the Xen and VirtIO balloon drivers from marking pages as
>>>>   wired. This prevents them from increasing the system wired page count,
>>>>   which can lead to mlock failing because of hitting the limit in
>>>>   vm.max_wired.
>>>
>>> This change is conceptually wrong.
>>> The pages balloon is allocating are unmanaged and they should be wired
>>> by definition. Alan and I are considering enforcing this (mandatory
>>> wired pages for unmanaged pages allocation) directly in the KPI.
>>> This in practice just seem an artifact to deal with scarce  wired
>>> memory limit. I suggest that for the XEN case this limit gets bumped
>>> rather relying on similar type of hacks.
>>
>> IMHO, marking them as wired seems wrong too, those pages are not wired,
>> they are simply not there any more. This was discussed in:
> 
> I'm not entirely sure what do you mean with "not there anymore", so
> I'm just guessing and I assume that you mean "pages are not collected
> in any vm object and then they are not referenced in any pagequeue".
> By extension this also matches what "unmanaged page" means.
> 
> If the page is unmanaged it means that the pagedaemon won't see it, so
> they won't be swapped out anyway. Wiring them it will enforce more
> sanity checking on the page. The max_wired concern may be real,
> however, please see below.

What I meant by "not there" is that the physical addresses associated
with the pages are no longer valid (it's a hole in the physical memory
map). To me it seems conceptually wrong to account those pages as wired.

Thinking from a user point of view for example, if I'm inside of a VM
that has ballooned down, I will see a huge amount of memory marked as
wired on the top utility, which seems wrong, those pages are simply not
there anymore, and as so, they shouldn't show up in stats.

It also makes it really hard to know which memory is really wired and in
use by the system, as opposed to the wired memory used by the balloon
driver.

Roger.

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 14:23:31 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6C56E209;
 Wed, 25 Jun 2014 14:23:31 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4D0E02DC9;
 Wed, 25 Jun 2014 14:23:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5PENVbg049418;
 Wed, 25 Jun 2014 14:23:31 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PENU4e049416;
 Wed, 25 Jun 2014 14:23:30 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201406251423.s5PENU4e049416@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Wed, 25 Jun 2014 14:23:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267869 - in head/sys:
 cddl/contrib/opensolaris/uts/common/dtrace modules/dtrace/fasttrap
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 14:23:31 -0000

Author: pfg
Date: Wed Jun 25 14:23:30 2014
New Revision: 267869
URL: http://svnweb.freebsd.org/changeset/base/267869

Log:
  MFV	r260708
  
  4427 pid provider rejects probes with valid UTF-8 names
  
  This make use of Solaris' u8_validate() which we happen to
  use since r185029 for ZFS.
  
  Illumos Revision:	1444d846b126463eb1059a572ff114d51f7562e5
  
  Reference:
  https://www.illumos.org/issues/4427
  
  Obtained from:	Illumos
  MFC after:	2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
  head/sys/modules/dtrace/fasttrap/Makefile

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c	Wed Jun 25 13:33:31 2014	(r267868)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c	Wed Jun 25 14:23:30 2014	(r267869)
@@ -28,9 +28,9 @@
  * Use is subject to license terms.
  */
 
-#if defined(sun)
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-#endif
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
 
 #include 
 #include 
@@ -63,6 +63,7 @@
 #if !defined(sun)
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2256,8 +2257,7 @@ fasttrap_ioctl(struct cdev *dev, u_long 
 		fasttrap_probe_spec_t *probe;
 		uint64_t noffs;
 		size_t size;
-		int ret;
-		char *c;
+		int ret, err;
 
 		if (copyin(&uprobe->ftps_noffs, &noffs,
 		    sizeof (uprobe->ftps_noffs)))
@@ -2286,18 +2286,16 @@ fasttrap_ioctl(struct cdev *dev, u_long 
 		 * Verify that the function and module strings contain no
 		 * funny characters.
 		 */
-		for (c = &probe->ftps_func[0]; *c != '\0'; c++) {
-			if (*c < 0x20 || 0x7f <= *c) {
-				ret = EINVAL;
-				goto err;
-			}
+		if (u8_validate(probe->ftps_func, strlen(probe->ftps_func),
+		    NULL, U8_VALIDATE_ENTIRE, &err) < 0) {
+			ret = EINVAL;
+			goto err;
 		}
 
-		for (c = &probe->ftps_mod[0]; *c != '\0'; c++) {
-			if (*c < 0x20 || 0x7f <= *c) {
-				ret = EINVAL;
-				goto err;
-			}
+		if (u8_validate(probe->ftps_mod, strlen(probe->ftps_mod),
+		    NULL, U8_VALIDATE_ENTIRE, &err) < 0) {
+			ret = EINVAL;
+			goto err;
 		}
 
 #ifdef notyet

Modified: head/sys/modules/dtrace/fasttrap/Makefile
==============================================================================
--- head/sys/modules/dtrace/fasttrap/Makefile	Wed Jun 25 13:33:31 2014	(r267868)
+++ head/sys/modules/dtrace/fasttrap/Makefile	Wed Jun 25 14:23:30 2014	(r267869)
@@ -8,6 +8,9 @@ KMOD=		fasttrap
 SRCS=		fasttrap.c fasttrap_isa.c opt_compat.h
 SRCS+=		vnode_if.h
 
+.PATH:		${.CURDIR}/../../../cddl/contrib/opensolaris/common/unicode
+SRCS+=		u8_textprep.c
+
 CFLAGS+=	-I${SYSDIR}/cddl/compat/opensolaris \
 		-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
 		-I${SYSDIR}

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 15:03:33 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8C5B3EBC;
 Wed, 25 Jun 2014 15:03:33 +0000 (UTC)
Received: from mail-we0-x22b.google.com (mail-we0-x22b.google.com
 [IPv6:2a00:1450:400c:c03::22b])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 8413821C2;
 Wed, 25 Jun 2014 15:03:32 +0000 (UTC)
Received: by mail-we0-f171.google.com with SMTP id q58so2163359wes.16
 for ; Wed, 25 Jun 2014 08:03:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:reply-to:sender:in-reply-to:references:date:message-id
 :subject:from:to:cc:content-type:content-transfer-encoding;
 bh=z49IGDIPqqI3RUOMxKQateK2/pg3kCNVEQAyT3mbLcs=;
 b=sDz5MTC/kCXzxBMjEEtIBYrZmaJDfAof0XgYus/zFesv6dRuVIfnMSGh/1d+n3d8Jt
 OV9h24RuiYKoquaONlfTPzQqxeuBVP+xccqP2UdmaP4CaeOEY6PTnUJsELc/4+F3y9mM
 QE+ip/flVnfcVJqx0M5Nqgn/Q9iM/wbjSemGAT8rdCdBzlfLYOXVTgseA9lVFTeFiiFC
 j1bc3n3YvBPtu3cwZUU3CBsy2Ed8dmyotjdybwpwcl6EgwEzWCxaQNuaddxtQs+81bht
 oy89eMS5+7yZUEgn6OE92IwCmi0wi3ncrYYqmC09acKJSXmIwdXZ/b5428AY9FOvJTj9
 Ctyg==
MIME-Version: 1.0
X-Received: by 10.180.79.9 with SMTP id f9mr42190570wix.52.1403708607498; Wed,
 25 Jun 2014 08:03:27 -0700 (PDT)
Reply-To: attilio@FreeBSD.org
Sender: asmrookie@gmail.com
Received: by 10.217.46.129 with HTTP; Wed, 25 Jun 2014 08:03:27 -0700 (PDT)
In-Reply-To: <53AAD775.8070302@FreeBSD.org>
References: <201406250951.s5P9p8YR017159@svn.freebsd.org>
 
 <53AACEAB.3090702@FreeBSD.org>
 
 <53AAD775.8070302@FreeBSD.org>
Date: Wed, 25 Jun 2014 17:03:27 +0200
X-Google-Sender-Auth: lQu7pL3ahmlfHt-vyuEP67JpRnE
Message-ID: 
Subject: Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon
From: Attilio Rao 
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: Alan Cox ,
 "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 15:03:33 -0000

On Wed, Jun 25, 2014 at 4:06 PM, Roger Pau Monn=C3=A9  =
wrote:
> On 25/06/14 15:44, Attilio Rao wrote:
>> On Wed, Jun 25, 2014 at 3:29 PM, Roger Pau Monn=C3=A9  wrote:
>>> On 25/06/14 13:58, Attilio Rao wrote:
>>>> On Wed, Jun 25, 2014 at 11:51 AM, Roger Pau Monn=C3=A9  wrote:
>>>>> Author: royger
>>>>> Date: Wed Jun 25 09:51:08 2014
>>>>> New Revision: 267858
>>>>> URL: http://svnweb.freebsd.org/changeset/base/267858
>>>>>
>>>>> Log:
>>>>>   xen/virtio: fix balloon drivers to not mark pages as WIRED
>>>>>
>>>>>   Prevent the Xen and VirtIO balloon drivers from marking pages as
>>>>>   wired. This prevents them from increasing the system wired page cou=
nt,
>>>>>   which can lead to mlock failing because of hitting the limit in
>>>>>   vm.max_wired.
>>>>
>>>> This change is conceptually wrong.
>>>> The pages balloon is allocating are unmanaged and they should be wired
>>>> by definition. Alan and I are considering enforcing this (mandatory
>>>> wired pages for unmanaged pages allocation) directly in the KPI.
>>>> This in practice just seem an artifact to deal with scarce  wired
>>>> memory limit. I suggest that for the XEN case this limit gets bumped
>>>> rather relying on similar type of hacks.
>>>
>>> IMHO, marking them as wired seems wrong too, those pages are not wired,
>>> they are simply not there any more. This was discussed in:
>>
>> I'm not entirely sure what do you mean with "not there anymore", so
>> I'm just guessing and I assume that you mean "pages are not collected
>> in any vm object and then they are not referenced in any pagequeue".
>> By extension this also matches what "unmanaged page" means.
>>
>> If the page is unmanaged it means that the pagedaemon won't see it, so
>> they won't be swapped out anyway. Wiring them it will enforce more
>> sanity checking on the page. The max_wired concern may be real,
>> however, please see below.
>
> What I meant by "not there" is that the physical addresses associated
> with the pages are no longer valid (it's a hole in the physical memory
> map). To me it seems conceptually wrong to account those pages as wired.

They are not. They are at all effect wired (even if with a slightly
different semantic), meaning wired as also not-pageable. The fact that
you won't mark them wired will just weaken the accounting,
debuggability and tracing side.

> Thinking from a user point of view for example, if I'm inside of a VM
> that has ballooned down, I will see a huge amount of memory marked as
> wired on the top utility, which seems wrong, those pages are simply not
> there anymore, and as so, they shouldn't show up in stats.
>
> It also makes it really hard to know which memory is really wired and in
> use by the system, as opposed to the wired memory used by the balloon
> driver.

I think this is really the problem with your approach. Now memory will
not be reachable by the pagedaemon and yet you won't see it showing up
anywhere. Memory leaks could go unnoticed, to some extent. I don't
think that's really what you want.

Attilio


--=20
Peace can only be achieved by understanding - A. Einstein

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 15:16:32 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9ADAC4E2;
 Wed, 25 Jun 2014 15:16:32 +0000 (UTC)
Received: from elvis.mu.org (elvis.mu.org [192.203.228.196])
 by mx1.freebsd.org (Postfix) with ESMTP id 8175A22F8;
 Wed, 25 Jun 2014 15:16:32 +0000 (UTC)
Received: from Alfreds-MacBook-Pro-9.local (c-76-21-10-192.hsd1.ca.comcast.net
 [76.21.10.192])
 by elvis.mu.org (Postfix) with ESMTPSA id 2EE181A3C19;
 Wed, 25 Jun 2014 08:16:32 -0700 (PDT)
Message-ID: <53AAE7D0.2090508@freebsd.org>
Date: Wed, 25 Jun 2014 08:16:32 -0700
From: Alfred Perlstein 
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: attilio@FreeBSD.org, Gleb Smirnoff 
Subject: Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon
References: <201406250951.s5P9p8YR017159@svn.freebsd.org>		<20140625120932.GM28199@FreeBSD.org>
 
In-Reply-To: 
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: Alan Cox ,
 "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 15:16:32 -0000

On 6/25/14 5:41 AM, Attilio Rao wrote:
> On Wed, Jun 25, 2014 at 2:09 PM, Gleb Smirnoff  wrote:
>> On Wed, Jun 25, 2014 at 01:58:29PM +0200, Attilio Rao wrote:
>> A> > Log:
>> A> >   xen/virtio: fix balloon drivers to not mark pages as WIRED
>> A> >
>> A> >   Prevent the Xen and VirtIO balloon drivers from marking pages as
>> A> >   wired. This prevents them from increasing the system wired page count,
>> A> >   which can lead to mlock failing because of hitting the limit in
>> A> >   vm.max_wired.
>> A>
>> A> This change is conceptually wrong.
>> A> The pages balloon is allocating are unmanaged and they should be wired
>> A> by definition. Alan and I are considering enforcing this (mandatory
>> A> wired pages for unmanaged pages allocation) directly in the KPI.
>> A> This in practice just seem an artifact to deal with scarce  wired
>> A> memory limit. I suggest that for the XEN case this limit gets bumped
>> A> rather relying on similar type of hacks.
>>
>> Proper limit would be to count pages wired by userland via mlock(2)
>> and enforce limit only on those pages. Pages wired by kernel should
>> be either unlimited or controled by a separate limit.
> FWIW, I mostly agree with this. I think that the kernel and userland
> limits should be split apart. But for the time being, rising the limit
> is better.
>
> Attilio
>
>
Can you explain?  I would think that if you were designing some kind of 
embedded device you would want to know exactly how much locked pages 
there are overall, not just in userland.

Meaning you would not want to overcommit and have too many locked pages 
due to kernel+user.

Perhaps that needs an API as well?

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 15:19:01 2014
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 32916656;
 Wed, 25 Jun 2014 15:19:01 +0000 (UTC)
Received: from elvis.mu.org (elvis.mu.org [192.203.228.196])
 by mx1.freebsd.org (Postfix) with ESMTP id 19D582318;
 Wed, 25 Jun 2014 15:19:00 +0000 (UTC)
Received: from Alfreds-MacBook-Pro-9.local (c-76-21-10-192.hsd1.ca.comcast.net
 [76.21.10.192])
 by elvis.mu.org (Postfix) with ESMTPSA id 0E40E1A3C19;
 Wed, 25 Jun 2014 08:19:00 -0700 (PDT)
Message-ID: <53AAE864.7010001@freebsd.org>
Date: Wed, 25 Jun 2014 08:19:00 -0700
From: Alfred Perlstein 
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Andriy Gapon , attilio@FreeBSD.org, =?UTF-8?B?Um9nZXI=?=
 =?UTF-8?B?IFBhdSBNb25uw6k=?= 
Subject: Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon
References: <201406250951.s5P9p8YR017159@svn.freebsd.org>		<53AACEAB.3090702@FreeBSD.org>
 
 <53AAD356.20202@FreeBSD.org>
In-Reply-To: <53AAD356.20202@FreeBSD.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: Alan Cox ,
 "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 15:19:01 -0000

On 6/25/14 6:49 AM, Andriy Gapon wrote:
> On 25/06/2014 17:44, Attilio Rao wrote:
>> Why? If VM needs more wired memory I assume that we can tune up the
>> default value of max_wired?
>>
>> I think that however your case makes an interesting point: if we want
>> to make unmanaged pages as inherently wired, we likely need a little
>> bit higher max_wired value. When I completed a patch for this, pho@
>> couldn't reproduce any similar issue even with stress-testing (and
>> also, the places to allocate unmanaged pages and not requesting
>> VM_ALLOC_WIRED were very little, almost 0, with the exception of
>> vm_page_alloc_contig() calls) but I think it is a valid proposition.
>>
>> However I would still like to have more control on kernel-specific
>> wired memory for processes. I'm for example thinking to ARC vs. buffer
>> cache, where I expect the wired memory consumption to be much bigger
>> for the former case.
> My humble opinion is that userland page wiring should be tuned via
> resource limits and that vm.max_wired could be retired altogether.
> Kernel wiring ignores the knob anyway.
>
I think the goal of the limit as it stands would not to let the total 
amount of wired pages reach a bad point due to a userland program 
pushing it over the limit.

Basically userland wants to know how many pages the kernel has wired in 
order to avoid asking for too many pages and making the system implode.

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 15:22:15 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 214F0A9E;
 Wed, 25 Jun 2014 15:22:15 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 03C6F23D6;
 Wed, 25 Jun 2014 15:22:15 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5PFMEPg077658;
 Wed, 25 Jun 2014 15:22:14 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PFMEKx077657;
 Wed, 25 Jun 2014 15:22:14 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201406251522.s5PFMEKx077657@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Wed, 25 Jun 2014 15:22:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267870 - head/tools/ifnet
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 15:22:15 -0000

Author: marcel
Date: Wed Jun 25 15:22:14 2014
New Revision: 267870
URL: http://svnweb.freebsd.org/changeset/base/267870

Log:
  * Handle ++x as well as x++ while converting.
  * Add special case handling where normal conversion would not work
    (some APIs have special names)
  * Fix conversion for function calls involving ifnet
  
  Submitted by:	Sreekanth Rupavatharam 
  Obtained from:	Juniper Networks, Inc.

Modified:
  head/tools/ifnet/convert_drvapi.sh

Modified: head/tools/ifnet/convert_drvapi.sh
==============================================================================
--- head/tools/ifnet/convert_drvapi.sh	Wed Jun 25 14:23:30 2014	(r267869)
+++ head/tools/ifnet/convert_drvapi.sh	Wed Jun 25 15:22:14 2014	(r267870)
@@ -94,7 +94,7 @@ handle_set() {
 
 handle_inc() {
 	line=$1	
-	inc=`echo $line | grep "$__ifp__->.*++"`
+	inc=`echo $line | grep "$__ifp__->.*++\|++$__ifp__->.*"`
 	if [ ! -z "$inc" ]
 	then
 		word=`echo $line | awk -F"if_" '{ print $2 }'|awk -F"\+" '{ print $1}'`
@@ -161,6 +161,17 @@ handle_and() {
 
 }
 
+handle_toggle() {
+	line=$1
+	if [ ! -z `echo $line | grep "\^="` ]
+	then
+		line=`echo $line | sed -e 's/'"$__ifp__"'->if_\(.*\) ^=\(.*\);/if_toggle\1('"$__ifp__"',\2);/g'`
+		return 0;
+	fi
+	return 1
+
+}
+
 # XXX - this needs updating
 handle_misc() {
 	line=$1
@@ -179,6 +190,35 @@ handle_misc() {
 
 }
 
+replace_str ()
+{
+	line=$1
+	orig=$2
+	new=$3
+	line=`echo $line | sed -e 's/'"$orig"'\(.*\)/'"$new"'\1/g'`
+	return 0;
+}
+
+# Handle special cases which do not fall under regular patterns
+handle_special ()
+{
+	line=$1
+	replace_str $line "(\*$__ifp__->if_input)" "if_input"
+	replace_str $line "if_setinit" "if_setinitfn"
+	replace_str $line "if_setioctl" "if_setioctlfn"
+	replace_str $line "if_getdrv_flags" "if_getdrvflags"
+	replace_str $line "if_setdrv_flagsbit" "if_setdrvflagbits"
+	replace_str $line "if_setstart" "if_setstartfn"
+	replace_str $line "if_sethwassistbit" "if_sethwassistbits"
+	replace_str $line "ifmedia_init" "ifmedia_init_drv"
+	replace_str $line "IFQ_DRV_IS_EMPTY(&$__ifp__->if_snd)" "if_sendq_empty($__ifp__)"
+	replace_str $line "IFQ_DRV_PREPEND(&$__ifp__->if_snd" "if_sendq_prepend($__ifp__"
+	replace_str $line "IFQ_SET_READY(&ifp->if_snd)" "if_setsendqready($__ifp__)"
+	line=`echo $line | sed -e 's/IFQ_SET_MAXLEN(&'$__ifp__'->if_snd, \(.*\))/if_setsendqlen('$__ifp__', \1)/g'`
+	line=`echo $line | sed -e 's/IFQ_DRV_DEQUEUE(&'$__ifp__'->if_snd, \(.*\))/\1 = if_dequeue('$__ifp__')/g'`
+	return 0
+}
+
 if [ -e $file.tmp ]
 then
 	rm $file.tmp
@@ -201,9 +241,9 @@ do
 	fi
 
 	handle_set $line
-	
+
 	if [ $? != 0 ]
-		then 
+	then 
 		handle_inc $line
 	fi
 
@@ -223,19 +263,26 @@ do
 	fi
 
 	if [ $? != 0 ]
+	then
+		handle_toggle $line
+	fi
 
+	if [ $? != 0 ]
 	then
 		handle_misc $line
 	fi
 	
 	if [ $? != 0 ]
 	then
-		if [ ! -z `echo $line | grep "$__ifp__->"` ]
-		then
-			line=`echo $line | sed -e 's:$: \/* '${FAIL_PAT}' *\/:g'`
-		fi
+		handle_special $line
+	fi	
+
+	if [ ! -z `echo $line | grep "$__ifp__->"` ]
+	then
+		line=`echo $line | sed -e 's:$: \/* '${FAIL_PAT}' *\/:g'`
 	fi
 done
+	line=`echo "$line" | sed -e 's:VLAN_CAPABILITIES('$__ifp__'):if_vlancap('$__ifp__'):g'`
 	# Replace the ifnet * with if_t
 	if [ ! -z `echo $line | grep "struct ifnet"` ]
 	then

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 15:30:13 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id AC869290;
 Wed, 25 Jun 2014 15:30:13 +0000 (UTC)
Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com
 [IPv6:2a00:1450:400c:c00::22a])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 5FD1224A6;
 Wed, 25 Jun 2014 15:30:12 +0000 (UTC)
Received: by mail-wg0-f42.google.com with SMTP id z12so2201458wgg.13
 for ; Wed, 25 Jun 2014 08:30:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:reply-to:sender:in-reply-to:references:date:message-id
 :subject:from:to:cc:content-type;
 bh=u3H2Q6wcLJ7mTCQee1gcmwL620ncRrofkcWwMH0Ui6w=;
 b=QL8UMiYMS+VpI4Sy8i+81oJNkU0KdHijZhWrD2G3e213NG5i9mCp6jezYwrRbpE3l9
 XBxfl0Eh3q+agg2Kn2Cdy5hwgX3pxWd+cpyaAeL10M8at7C7gbVo9Mma9lRr/AHg32Mp
 Td9BRg+SkMz7PzJomEWoYaiMXrcWG7oO79ZP5wEEMKO/QB7jmvKGq0Sa1gu7OVFfvmuj
 rIlAE737nXXXAI8/VVnL7ZzcBfrSc0KANzqTmp16ZY3tlKaSTNQAii1sGy50S6T1vgZ2
 BZI6wA8THy+WC45d+dJEMtzqhglUtqPBih1b0W6O8urUY5pGnBRdtO9NvrOirgf5iGLD
 kMcg==
MIME-Version: 1.0
X-Received: by 10.194.157.68 with SMTP id wk4mr10837234wjb.42.1403710206393;
 Wed, 25 Jun 2014 08:30:06 -0700 (PDT)
Reply-To: attilio@FreeBSD.org
Sender: asmrookie@gmail.com
Received: by 10.217.46.129 with HTTP; Wed, 25 Jun 2014 08:30:06 -0700 (PDT)
In-Reply-To: <53AAE7D0.2090508@freebsd.org>
References: <201406250951.s5P9p8YR017159@svn.freebsd.org>
 
 <20140625120932.GM28199@FreeBSD.org>
 
 <53AAE7D0.2090508@freebsd.org>
Date: Wed, 25 Jun 2014 17:30:06 +0200
X-Google-Sender-Auth: lArvlZjfeDvbElFZhIf2Lsl-r90
Message-ID: 
Subject: Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon
From: Attilio Rao 
To: Alfred Perlstein 
Content-Type: text/plain; charset=UTF-8
Cc: "src-committers@freebsd.org" ,
 Alan Cox ,
 "svn-src-all@freebsd.org" ,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= ,
 Gleb Smirnoff ,
 "svn-src-head@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 15:30:13 -0000

On Wed, Jun 25, 2014 at 5:16 PM, Alfred Perlstein  wrote:
> On 6/25/14 5:41 AM, Attilio Rao wrote:
>>
>> On Wed, Jun 25, 2014 at 2:09 PM, Gleb Smirnoff 
>> wrote:
>>>
>>> On Wed, Jun 25, 2014 at 01:58:29PM +0200, Attilio Rao wrote:
>>> A> > Log:
>>> A> >   xen/virtio: fix balloon drivers to not mark pages as WIRED
>>> A> >
>>> A> >   Prevent the Xen and VirtIO balloon drivers from marking pages as
>>> A> >   wired. This prevents them from increasing the system wired page
>>> count,
>>> A> >   which can lead to mlock failing because of hitting the limit in
>>> A> >   vm.max_wired.
>>> A>
>>> A> This change is conceptually wrong.
>>> A> The pages balloon is allocating are unmanaged and they should be wired
>>> A> by definition. Alan and I are considering enforcing this (mandatory
>>> A> wired pages for unmanaged pages allocation) directly in the KPI.
>>> A> This in practice just seem an artifact to deal with scarce  wired
>>> A> memory limit. I suggest that for the XEN case this limit gets bumped
>>> A> rather relying on similar type of hacks.
>>>
>>> Proper limit would be to count pages wired by userland via mlock(2)
>>> and enforce limit only on those pages. Pages wired by kernel should
>>> be either unlimited or controled by a separate limit.
>>
>> FWIW, I mostly agree with this. I think that the kernel and userland
>> limits should be split apart. But for the time being, rising the limit
>> is better.
>>
>> Attilio
>>
>>
> Can you explain?  I would think that if you were designing some kind of
> embedded device you would want to know exactly how much locked pages there
> are overall, not just in userland.
>
> Meaning you would not want to overcommit and have too many locked pages due
> to kernel+user.

Well, assuming you trace them indipendently I don't think this is
going to be problematic to aggregate them, is it?

As far as I understand it, right now we have RMEM_LIMIT to someway
limit per-process amount of wired memory and finally max_wired as a
global accounted wired memory limit.

I think that the idea now is that RMEM_LIMIT is enough to correctly
control all the front-end check, coming from untrusted sources
(userland, non-privileged syscalls like mlock(), mmap(), etc.).
Possibly that's not always the case and I think that the hypervisor
can be a fair example of this.

Having "more granular" accountability, means that rather than having a
global limit (or, rather, along with it) we can grow a per-process
limit to control kernel-allocated wired memory.

> Perhaps that needs an API as well?

I don't have anything in my mind yet. My initial point was more trying
to get a better semantic on a paradigm that is at least dangerous.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 15:39:08 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B053D6A9;
 Wed, 25 Jun 2014 15:39:08 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9D74C25B2;
 Wed, 25 Jun 2014 15:39:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5PFd8qx083423;
 Wed, 25 Jun 2014 15:39:08 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PFd8Fm083422;
 Wed, 25 Jun 2014 15:39:08 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201406251539.s5PFd8Fm083422@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Wed, 25 Jun 2014 15:39:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267871 - head/usr.bin/whois
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 15:39:08 -0000

Author: ume
Date: Wed Jun 25 15:39:08 2014
New Revision: 267871
URL: http://svnweb.freebsd.org/changeset/base/267871

Log:
  Introduce $RA_SERVER to set default whois server.
  
  Requested by:	nork
  Reviewed by:	nork
  MFC after:	1 week

Modified:
  head/usr.bin/whois/whois.c

Modified: head/usr.bin/whois/whois.c
==============================================================================
--- head/usr.bin/whois/whois.c	Wed Jun 25 15:22:14 2014	(r267870)
+++ head/usr.bin/whois/whois.c	Wed Jun 25 15:39:08 2014	(r267871)
@@ -179,10 +179,12 @@ main(int argc, char *argv[])
 	 * back to NICHOST.
 	 */
 	if (host == NULL && country == NULL) {
-		use_qnichost = 1;
-		host = NICHOST;
-		if (!(flags & WHOIS_QUICK))
-			flags |= WHOIS_RECURSE;
+		if ((host = getenv("RA_SERVER")) == NULL) {
+			use_qnichost = 1;
+			host = NICHOST;
+			if (!(flags & WHOIS_QUICK))
+				flags |= WHOIS_RECURSE;
+		}
 	}
 	while (argc-- > 0) {
 		if (country != NULL) {

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 16:12:15 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 898044A2;
 Wed, 25 Jun 2014 16:12:15 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5C5282940;
 Wed, 25 Jun 2014 16:12:15 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5PGCFQW001426;
 Wed, 25 Jun 2014 16:12:15 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PGCFll001425;
 Wed, 25 Jun 2014 16:12:15 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406251612.s5PGCFll001425@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 25 Jun 2014 16:12:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267872 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 16:12:15 -0000

Author: mav
Date: Wed Jun 25 16:12:14 2014
New Revision: 267872
URL: http://svnweb.freebsd.org/changeset/base/267872

Log:
  Allow to use iSCSI immediate data by several ctl_datamove() calls.
  
  While for FreeBSD client that is only a minor optimization, VMWare client
  doesn't support additional data requests after all data being sent once as
  immediate.
  
  MFC after:	1 week
  Sponsored by:	iXsystems, Inc.

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Wed Jun 25 15:39:08 2014	(r267871)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Wed Jun 25 16:12:14 2014	(r267872)
@@ -737,12 +737,15 @@ cfiscsi_handle_data_segment(struct icl_p
 		buffer_offset = ntohl(bhsdo->bhsdo_buffer_offset);
 	else
 		buffer_offset = 0;
+	len = icl_pdu_data_segment_length(request);
 
 	/*
 	 * Make sure the offset, as sent by the initiator, matches the offset
 	 * we're supposed to be at in the scatter-gather list.
 	 */
-	if (buffer_offset !=
+	if (buffer_offset >
+	    io->scsiio.kern_rel_offset + io->scsiio.ext_data_filled ||
+	    buffer_offset + len <=
 	    io->scsiio.kern_rel_offset + io->scsiio.ext_data_filled) {
 		CFISCSI_SESSION_WARN(cs, "received bad buffer offset %zd, "
 		    "expected %zd; dropping connection", buffer_offset,
@@ -758,8 +761,8 @@ cfiscsi_handle_data_segment(struct icl_p
 	 * to buffer_offset, which is the offset within the task (SCSI
 	 * command).
 	 */
-	off = 0;
-	len = icl_pdu_data_segment_length(request);
+	off = io->scsiio.kern_rel_offset + io->scsiio.ext_data_filled -
+	    buffer_offset;
 
 	/*
 	 * Iterate over the scatter/gather segments, filling them with data
@@ -816,12 +819,8 @@ cfiscsi_handle_data_segment(struct icl_p
 		 * This obviously can only happen with SCSI Command PDU. 
 		 */
 		if ((request->ip_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) ==
-		    ISCSI_BHS_OPCODE_SCSI_COMMAND) {
-			CFISCSI_SESSION_DEBUG(cs, "received too much immediate "
-			    "data: got %zd bytes, expected %zd",
-			    icl_pdu_data_segment_length(request), off);
+		    ISCSI_BHS_OPCODE_SCSI_COMMAND)
 			return (true);
-		}
 
 		CFISCSI_SESSION_WARN(cs, "received too much data: got %zd bytes, "
 		    "expected %zd; dropping connection",
@@ -2708,8 +2707,8 @@ cfiscsi_datamove_out(union ctl_io *io)
 	cdw->cdw_target_transfer_tag = target_transfer_tag;
 	cdw->cdw_initiator_task_tag = bhssc->bhssc_initiator_task_tag;
 
-	if (cs->cs_immediate_data && io->scsiio.kern_rel_offset == 0 &&
-	    icl_pdu_data_segment_length(request) > 0) {
+	if (cs->cs_immediate_data && io->scsiio.kern_rel_offset <
+	    icl_pdu_data_segment_length(request)) {
 		done = cfiscsi_handle_data_segment(request, cdw);
 		if (done) {
 			uma_zfree(cfiscsi_data_wait_zone, cdw);

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 16:47:17 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7AD97287;
 Wed, 25 Jun 2014 16:47:17 +0000 (UTC)
Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3D7DF2C57;
 Wed, 25 Jun 2014 16:47:16 +0000 (UTC)
Received: from pps.filterd (pp2.rice.edu [127.0.0.1])
 by pp2.rice.edu (8.14.5/8.14.5) with SMTP id s5PGWocY004919;
 Wed, 25 Jun 2014 11:47:15 -0500
Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30])
 by pp2.rice.edu with ESMTP id 1mqurs071q-1;
 Wed, 25 Jun 2014 11:47:15 -0500
X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel
Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net
 (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201])
 (using TLSv1 with cipher RC4-MD5 (128/128 bits))
 (No client certificate requested) (Authenticated sender: alc)
 by mh11.mail.rice.edu (Postfix) with ESMTPSA id 05B2A4C02FE;
 Wed, 25 Jun 2014 11:47:14 -0500 (CDT)
Message-ID: <53AAFD12.5030308@rice.edu>
Date: Wed, 25 Jun 2014 11:47:14 -0500
From: Alan Cox 
User-Agent: Mozilla/5.0 (X11; FreeBSD i386;
 rv:24.0) Gecko/20100101 Thunderbird/24.2.0
MIME-Version: 1.0
To: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= ,
 attilio@FreeBSD.org, Alan Cox 
Subject: Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon
References: <201406250951.s5P9p8YR017159@svn.freebsd.org>
 
 <53AACEAB.3090702@FreeBSD.org>
In-Reply-To: <53AACEAB.3090702@FreeBSD.org>
X-Enigmail-Version: 1.6
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 kscore.is_bulkscore=0
 kscore.compositescore=0 circleOfTrustscore=0
 compositescore=0.605690798989426 urlsuspect_oldscore=0.00569079898942585
 suspectscore=4 recipient_domain_to_sender_totalscore=0 phishscore=0
 bulkscore=0 kscore.is_spamscore=1 recipient_to_sender_totalscore=0
 recipient_domain_to_sender_domain_totalscore=0 rbsscore=0.605690798989426
 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9
 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=7.0.1-1402240000 definitions=main-1406250170
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 16:47:17 -0000

On 06/25/2014 08:29, Roger Pau Monné wrote:
> On 25/06/14 13:58, Attilio Rao wrote:
>> On Wed, Jun 25, 2014 at 11:51 AM, Roger Pau Monné  wrote:
>>> Author: royger
>>> Date: Wed Jun 25 09:51:08 2014
>>> New Revision: 267858
>>> URL: http://svnweb.freebsd.org/changeset/base/267858
>>>
>>> Log:
>>>   xen/virtio: fix balloon drivers to not mark pages as WIRED
>>>
>>>   Prevent the Xen and VirtIO balloon drivers from marking pages as
>>>   wired. This prevents them from increasing the system wired page count,
>>>   which can lead to mlock failing because of hitting the limit in
>>>   vm.max_wired.
>> This change is conceptually wrong.
>> The pages balloon is allocating are unmanaged and they should be wired
>> by definition. Alan and I are considering enforcing this (mandatory
>> wired pages for unmanaged pages allocation) directly in the KPI.
>> This in practice just seem an artifact to deal with scarce  wired
>> memory limit. I suggest that for the XEN case this limit gets bumped
>> rather relying on similar type of hacks.
> IMHO, marking them as wired seems wrong too, those pages are not wired,
> they are simply not there any more. This was discussed in:
>
> http://lists.freebsd.org/pipermail/freebsd-virtualization/2014-June/002643.html
>
> If there's consensus I will revert the change, but I would say that
> increasing vm.max_wired for VMs is also a gross hack.

We wouldn't be changing it just for VMs.  Our current definition of
vm_max_wired dates back to r5455, or in human years 1995.  If the ZFS
ARC has taught us anything, we, or really the page daemon, can cope with
having more than 1/3 of a machine's pages wired.  :-)

I have a couple questions for you.  Exactly how much memory will Xen try
to steal from a domain via ballooning?  Clearly the domain can fail to
respond to the balloon request and Xen has to cope with that.  Can the
domain also explicitly say, "No, I'm not giving you any pages."


From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 17:02:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id BE402C3B;
 Wed, 25 Jun 2014 17:02:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9EE0C2E28;
 Wed, 25 Jun 2014 17:02:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5PH21uE024768;
 Wed, 25 Jun 2014 17:02:01 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PH212k024718;
 Wed, 25 Jun 2014 17:02:01 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406251702.s5PH212k024718@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 25 Jun 2014 17:02:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267873 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 17:02:01 -0000

Author: mav
Date: Wed Jun 25 17:02:01 2014
New Revision: 267873
URL: http://svnweb.freebsd.org/changeset/base/267873

Log:
  Introduce fine-grained CTL locking to improve SMP scalability.
  
  Split global ctl_lock, historically protecting most of CTL context:
   - remaining ctl_lock now protects lists of fronends and backends;
   - per-LUN lun_lock(s) protect LUN-specific information;
   - per-thread queue_lock(s) protect request queues.
  This allows to radically reduce congestion on ctl_lock.
  
  Create multiple worker threads, depending on number of CPUs, and assign
  each LUN to one of them.  This allows to spread load between multiple CPUs,
  still avoiging congestion on queues and LUNs locks.
  
  On 40-core server, exporting 5 LUNs, each backed by gstripe of SATA SSDs,
  accessed via 6 iSCSI connections, this change improves peak request rate
  from 250K to 680K IOPS.
  
  MFC after:	2 weeks
  Sponsored by:	iXsystems, Inc.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl.h
  head/sys/cam/ctl/ctl_io.h
  head/sys/cam/ctl/ctl_private.h

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Wed Jun 25 16:12:14 2014	(r267872)
+++ head/sys/cam/ctl/ctl.c	Wed Jun 25 17:02:01 2014	(r267873)
@@ -83,14 +83,6 @@ __FBSDID("$FreeBSD$");
 struct ctl_softc *control_softc = NULL;
 
 /*
- * The default is to run with CTL_DONE_THREAD turned on.  Completed
- * transactions are queued for processing by the CTL work thread.  When
- * CTL_DONE_THREAD is not defined, completed transactions are processed in
- * the caller's context.
- */
-#define CTL_DONE_THREAD
-
-/*
  * Size and alignment macros needed for Copan-specific HA hardware.  These
  * can go away when the HA code is re-written, and uses busdma for any
  * hardware.
@@ -315,7 +307,7 @@ static int     ctl_is_single = 1;
 static int     index_to_aps_page;
 
 SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer");
-static int worker_threads = 1;
+static int worker_threads = -1;
 TUNABLE_INT("kern.cam.ctl.worker_threads", &worker_threads);
 SYSCTL_INT(_kern_cam_ctl, OID_AUTO, worker_threads, CTLFLAG_RDTUN,
     &worker_threads, 1, "Number of worker threads");
@@ -344,7 +336,7 @@ static int ctl_ioctl_targ_disable(void *
 static int ctl_ioctl_lun_enable(void *arg, struct ctl_id targ_id, int lun_id);
 static int ctl_ioctl_lun_disable(void *arg, struct ctl_id targ_id, int lun_id);
 static int ctl_ioctl_do_datamove(struct ctl_scsiio *ctsio);
-static int ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio, int have_lock);
+static int ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio);
 static int ctl_ioctl_submit_wait(union ctl_io *io);
 static void ctl_ioctl_datamove(union ctl_io *io);
 static void ctl_ioctl_done(union ctl_io *io);
@@ -431,8 +423,13 @@ static int ctl_datamove_remote_xfer(unio
 				    ctl_ha_dt_cb callback);
 static void ctl_datamove_remote_read(union ctl_io *io);
 static void ctl_datamove_remote(union ctl_io *io);
-static int ctl_process_done(union ctl_io *io, int have_lock);
+static int ctl_process_done(union ctl_io *io);
+static void ctl_lun_thread(void *arg);
 static void ctl_work_thread(void *arg);
+static void ctl_enqueue_incoming(union ctl_io *io);
+static void ctl_enqueue_rtr(union ctl_io *io);
+static void ctl_enqueue_done(union ctl_io *io);
+static void ctl_enqueue_isc(union ctl_io *io);
 
 /*
  * Load the serialization table.  This isn't very pretty, but is probably
@@ -490,8 +487,7 @@ ctl_isc_handler_finish_xfer(struct ctl_s
 	       sizeof(ctsio->sense_data));
 	memcpy(&ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes,
 	       &msg_info->scsi.lbalen, sizeof(msg_info->scsi.lbalen));
-	STAILQ_INSERT_TAIL(&ctl_softc->isc_queue, &ctsio->io_hdr, links);
-	ctl_wakeup_thread();
+	ctl_enqueue_isc((union ctl_io *)ctsio);
 }
 
 static void
@@ -537,8 +533,7 @@ ctl_isc_handler_finish_ser_only(struct c
 	}
 #endif
 	ctsio->io_hdr.msg_type = CTL_MSG_FINISH_IO;
-	STAILQ_INSERT_TAIL(&ctl_softc->isc_queue, &ctsio->io_hdr, links);
-	ctl_wakeup_thread();
+	ctl_enqueue_isc((union ctl_io *)ctsio);
 }
 
 /*
@@ -573,7 +568,6 @@ ctl_isc_event_handler(ctl_ha_channel cha
 			       isc_status);
 			return;
 		}
-		mtx_lock(&ctl_softc->ctl_lock);
 
 		switch (msg_info.hdr.msg_type) {
 		case CTL_MSG_SERIALIZE:
@@ -586,7 +580,6 @@ ctl_isc_event_handler(ctl_ha_channel cha
 				       "ctl_io!\n");
 				/* Bad Juju */
 				/* Need to set busy and send msg back */
-				mtx_unlock(&ctl_softc->ctl_lock);
 				msg_info.hdr.msg_type = CTL_MSG_BAD_JUJU;
 				msg_info.hdr.status = CTL_SCSI_ERROR;
 				msg_info.scsi.scsi_status = SCSI_STATUS_BUSY;
@@ -637,9 +630,7 @@ ctl_isc_event_handler(ctl_ha_channel cha
 				io->io_hdr.flags |=
 					entry->flags & CTL_FLAG_DATA_MASK;
 			}
-			STAILQ_INSERT_TAIL(&ctl_softc->isc_queue,
-					   &io->io_hdr, links);
-			ctl_wakeup_thread();
+			ctl_enqueue_isc(io);
 			break;
 
 		/* Performed on the Originating SC, XFER mode only */
@@ -743,11 +734,8 @@ ctl_isc_event_handler(ctl_ha_channel cha
 			 * the full S/G list.  Queue processing in the thread.
 			 * Otherwise wait for the next piece.
 			 */
-			if (msg_info.dt.sg_last != 0) {
-				STAILQ_INSERT_TAIL(&ctl_softc->isc_queue,
-						   &io->io_hdr, links);
-				ctl_wakeup_thread();
-			}
+			if (msg_info.dt.sg_last != 0)
+				ctl_enqueue_isc(io);
 			break;
 		}
 		/* Performed on the Serializing (primary) SC, XFER mode only */
@@ -773,10 +761,7 @@ ctl_isc_event_handler(ctl_ha_channel cha
 			io->scsiio.residual = msg_info.scsi.residual;
 			memcpy(&io->scsiio.sense_data,&msg_info.scsi.sense_data,
 			       sizeof(io->scsiio.sense_data));
-
-			STAILQ_INSERT_TAIL(&ctl_softc->isc_queue,
-					   &io->io_hdr, links);
-			ctl_wakeup_thread();
+			ctl_enqueue_isc(io);
 			break;
 		}
 
@@ -785,7 +770,6 @@ ctl_isc_event_handler(ctl_ha_channel cha
 			io = msg_info.hdr.original_sc;
 			if (io == NULL) {
 				printf("%s: Major Bummer\n", __func__);
-				mtx_unlock(&ctl_softc->ctl_lock);
 				return;
 			} else {
 #if 0
@@ -794,9 +778,7 @@ ctl_isc_event_handler(ctl_ha_channel cha
 			}
 			io->io_hdr.msg_type = CTL_MSG_R2R;
 			io->io_hdr.serializing_sc = msg_info.hdr.serializing_sc;
-			STAILQ_INSERT_TAIL(&ctl_softc->isc_queue,
-					   &io->io_hdr, links);
-			ctl_wakeup_thread();
+			ctl_enqueue_isc(io);
 			break;
 
 		/*
@@ -833,9 +815,7 @@ ctl_isc_event_handler(ctl_ha_channel cha
 
 			/* io = msg_info.hdr.serializing_sc; */
 			io->io_hdr.msg_type = CTL_MSG_BAD_JUJU;
-		        STAILQ_INSERT_TAIL(&ctl_softc->isc_queue,
-					   &io->io_hdr, links);
-			ctl_wakeup_thread();
+			ctl_enqueue_isc(io);
 			break;
 
 		/* Handle resets sent from the other side */
@@ -849,7 +829,6 @@ ctl_isc_event_handler(ctl_ha_channel cha
 				/* Bad Juju */
 				/* should I just call the proper reset func
 				   here??? */
-				mtx_unlock(&ctl_softc->ctl_lock);
 				goto bailout;
 			}
 			ctl_zero_io((union ctl_io *)taskio);
@@ -878,15 +857,12 @@ ctl_isc_event_handler(ctl_ha_channel cha
 				       "ctl_io!\n");
 				/* Bad Juju */
 				/* Need to set busy and send msg back */
-				mtx_unlock(&ctl_softc->ctl_lock);
 				goto bailout;
 			}
 			ctl_zero_io((union ctl_io *)presio);
 			presio->io_hdr.msg_type = CTL_MSG_PERS_ACTION;
 			presio->pr_msg = msg_info.pr;
-		        STAILQ_INSERT_TAIL(&ctl_softc->isc_queue,
-					   &presio->io_hdr, links);
-			ctl_wakeup_thread();
+			ctl_enqueue_isc((union ctl_io *)presio);
 			break;
 		case CTL_MSG_SYNC_FE:
 			rcv_sync_msg = 1;
@@ -899,23 +875,21 @@ ctl_isc_event_handler(ctl_ha_channel cha
 			struct copan_aps_subpage *current_sp;
 			uint32_t targ_lun;
 
-			targ_lun = msg_info.hdr.nexus.targ_lun;
-			if (msg_info.hdr.nexus.lun_map_fn != NULL)
-				targ_lun = msg_info.hdr.nexus.lun_map_fn(msg_info.hdr.nexus.lun_map_arg, targ_lun);
-
+			targ_lun = msg_info.hdr.nexus.targ_mapped_lun;
 			lun = ctl_softc->ctl_luns[targ_lun];
+			mtx_lock(&lun->lun_lock);
 			page_index = &lun->mode_pages.index[index_to_aps_page];
 			current_sp = (struct copan_aps_subpage *)
 				     (page_index->page_data +
 				     (page_index->page_len * CTL_PAGE_CURRENT));
 
 			current_sp->lock_active = msg_info.aps.lock_flag;
+			mtx_unlock(&lun->lun_lock);
 		        break;
 		}
 		default:
 		        printf("How did I get here?\n");
 		}
-		mtx_unlock(&ctl_softc->ctl_lock);
 	} else if (event == CTL_HA_EVT_MSG_SENT) {
 		if (param != CTL_HA_STATUS_SUCCESS) {
 			printf("Bad status from ctl_ha_msg_send status %d\n",
@@ -1030,19 +1004,10 @@ ctl_init(void)
 	softc->target.wwid[1] = 0x87654321;
 	STAILQ_INIT(&softc->lun_list);
 	STAILQ_INIT(&softc->pending_lun_queue);
-	STAILQ_INIT(&softc->incoming_queue);
-	STAILQ_INIT(&softc->rtr_queue);
-	STAILQ_INIT(&softc->done_queue);
-	STAILQ_INIT(&softc->isc_queue);
 	STAILQ_INIT(&softc->fe_list);
 	STAILQ_INIT(&softc->be_list);
 	STAILQ_INIT(&softc->io_pools);
 
-	/*
-	 * We don't bother calling these with ctl_lock held here, because,
-	 * in theory, no one else can try to do anything while we're in our
-	 * module init routine.
-	 */
 	if (ctl_pool_create(softc, CTL_POOL_INTERNAL, CTL_POOL_ENTRIES_INTERNAL,
 			    &internal_pool)!= 0){
 		printf("ctl: can't allocate %d entry internal pool, "
@@ -1072,25 +1037,23 @@ ctl_init(void)
 	softc->emergency_pool = emergency_pool;
 	softc->othersc_pool = other_pool;
 
-	if (worker_threads > MAXCPU || worker_threads == 0) {
-		printf("invalid kern.cam.ctl.worker_threads value; "
-		    "setting to 1");
-		worker_threads = 1;
-	} else if (worker_threads < 0) {
-		if (mp_ncpus > 2) {
-			/*
-			 * Using more than two worker threads actually hurts
-			 * performance due to lock contention.
-			 */
-			worker_threads = 2;
-		} else {
-			worker_threads = 1;
-		}
-	}
+	if (worker_threads <= 0)
+		worker_threads = max(1, mp_ncpus / 4);
+	if (worker_threads > CTL_MAX_THREADS)
+		worker_threads = CTL_MAX_THREADS;
 
 	for (i = 0; i < worker_threads; i++) {
-		error = kproc_kthread_add(ctl_work_thread, softc,
-		    &softc->work_thread, NULL, 0, 0, "ctl", "work%d", i);
+		struct ctl_thread *thr = &softc->threads[i];
+
+		mtx_init(&thr->queue_lock, "CTL queue mutex", NULL, MTX_DEF);
+		thr->ctl_softc = softc;
+		STAILQ_INIT(&thr->incoming_queue);
+		STAILQ_INIT(&thr->rtr_queue);
+		STAILQ_INIT(&thr->done_queue);
+		STAILQ_INIT(&thr->isc_queue);
+
+		error = kproc_kthread_add(ctl_work_thread, thr,
+		    &softc->ctl_proc, &thr->thread, 0, 0, "ctl", "work%d", i);
 		if (error != 0) {
 			printf("error creating CTL work thread!\n");
 			ctl_pool_free(internal_pool);
@@ -1099,6 +1062,15 @@ ctl_init(void)
 			return (error);
 		}
 	}
+	error = kproc_kthread_add(ctl_lun_thread, softc,
+	    &softc->ctl_proc, NULL, 0, 0, "ctl", "lun");
+	if (error != 0) {
+		printf("error creating CTL lun thread!\n");
+		ctl_pool_free(internal_pool);
+		ctl_pool_free(emergency_pool);
+		ctl_pool_free(other_pool);
+		return (error);
+	}
 	if (bootverbose)
 		printf("ctl: CAM Target Layer loaded\n");
 
@@ -1182,6 +1154,7 @@ ctl_shutdown(void)
 
 #if 0
 	ctl_shutdown_thread(softc->work_thread);
+	mtx_destroy(&softc->queue_lock);
 #endif
 
 	mtx_destroy(&softc->pool_lock);
@@ -1673,7 +1646,7 @@ bailout:
  * (SER_ONLY mode).
  */
 static int
-ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio, int have_lock)
+ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio)
 {
 	struct ctl_softc *ctl_softc;
 	union ctl_ha_msg msg_info;
@@ -1682,12 +1655,8 @@ ctl_serialize_other_sc_cmd(struct ctl_sc
 	uint32_t targ_lun;
 
 	ctl_softc = control_softc;
-	if (have_lock == 0)
-		mtx_lock(&ctl_softc->ctl_lock);
 
-	targ_lun = ctsio->io_hdr.nexus.targ_lun;
-	if (ctsio->io_hdr.nexus.lun_map_fn != NULL)
-		targ_lun = ctsio->io_hdr.nexus.lun_map_fn(ctsio->io_hdr.nexus.lun_map_arg, targ_lun);
+	targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun;
 	lun = ctl_softc->ctl_luns[targ_lun];
 	if (lun==NULL)
 	{
@@ -1716,12 +1685,11 @@ ctl_serialize_other_sc_cmd(struct ctl_sc
 	        if (ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info,
 				sizeof(msg_info), 0 ) > CTL_HA_STATUS_SUCCESS) {
 		}
-		if (have_lock == 0)
-			mtx_unlock(&ctl_softc->ctl_lock);
 		return(1);
 
 	}
 
+	mtx_lock(&lun->lun_lock);
     	TAILQ_INSERT_TAIL(&lun->ooa_queue, &ctsio->io_hdr, ooa_links);
 
 	switch (ctl_check_ooa(lun, (union ctl_io *)ctsio,
@@ -1736,8 +1704,7 @@ ctl_serialize_other_sc_cmd(struct ctl_sc
 	case CTL_ACTION_SKIP:
 		if (ctl_softc->ha_mode == CTL_HA_MODE_XFER) {
 			ctsio->io_hdr.flags |= CTL_FLAG_IS_WAS_ON_RTR;
-			STAILQ_INSERT_TAIL(&ctl_softc->rtr_queue,
-					   &ctsio->io_hdr, links);
+			ctl_enqueue_rtr((union ctl_io *)ctsio);
 		} else {
 
 			/* send msg back to other side */
@@ -1832,8 +1799,7 @@ ctl_serialize_other_sc_cmd(struct ctl_sc
 		}
 		break;
 	}
-	if (have_lock == 0)
-		mtx_unlock(&ctl_softc->ctl_lock);
+	mtx_unlock(&lun->lun_lock);
 	return (retval);
 }
 
@@ -1992,8 +1958,7 @@ ctl_ioctl_fill_ooa(struct ctl_lun *lun, 
 
 	retval = 0;
 
-	mtx_assert(&control_softc->ctl_lock, MA_OWNED);
-
+	mtx_lock(&lun->lun_lock);
 	for (io = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); (io != NULL);
 	     (*cur_fill_num)++, io = (union ctl_io *)TAILQ_NEXT(&io->io_hdr,
 	     ooa_links)) {
@@ -2030,6 +1995,7 @@ ctl_ioctl_fill_ooa(struct ctl_lun *lun, 
 		if (io->io_hdr.flags & CTL_FLAG_DMA_QUEUED)
 			entry->cmd_flags |= CTL_OOACMD_FLAG_DMA_QUEUED;
 	}
+	mtx_unlock(&lun->lun_lock);
 
 	return (retval);
 }
@@ -2402,6 +2368,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 		mtx_lock(&softc->ctl_lock);
 		printf("Dumping OOA queues:\n");
 		STAILQ_FOREACH(lun, &softc->lun_list, links) {
+			mtx_lock(&lun->lun_lock);
 			for (io = (union ctl_io *)TAILQ_FIRST(
 			     &lun->ooa_queue); io != NULL;
 			     io = (union ctl_io *)TAILQ_NEXT(&io->io_hdr,
@@ -2423,6 +2390,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 				sbuf_finish(&sb);
 				printf("%s\n", sbuf_data(&sb));
 			}
+			mtx_unlock(&lun->lun_lock);
 		}
 		printf("OOA queues dump done\n");
 		mtx_unlock(&softc->ctl_lock);
@@ -2538,15 +2506,16 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 			ooa_info->status = CTL_OOA_INVALID_LUN;
 			break;
 		}
-
+		mtx_lock(&lun->lun_lock);
+		mtx_unlock(&softc->ctl_lock);
 		ooa_info->num_entries = 0;
 		for (io = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue);
 		     io != NULL; io = (union ctl_io *)TAILQ_NEXT(
 		     &io->io_hdr, ooa_links)) {
 			ooa_info->num_entries++;
 		}
+		mtx_unlock(&lun->lun_lock);
 
-		mtx_unlock(&softc->ctl_lock);
 		ooa_info->status = CTL_OOA_SUCCESS;
 
 		break;
@@ -2664,6 +2633,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 			delay_info->status = CTL_DELAY_STATUS_INVALID_LUN;
 		} else {
 			lun = softc->ctl_luns[delay_info->lun_id];
+			mtx_lock(&lun->lun_lock);
 
 			delay_info->status = CTL_DELAY_STATUS_OK;
 
@@ -2696,6 +2666,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 					CTL_DELAY_STATUS_INVALID_LOC;
 				break;
 			}
+			mtx_unlock(&lun->lun_lock);
 		}
 
 		mtx_unlock(&softc->ctl_lock);
@@ -2756,12 +2727,13 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 		 * in the set case, hopefully the user won't do something
 		 * silly.
 		 */
+		mtx_lock(&lun->lun_lock);
+		mtx_unlock(&softc->ctl_lock);
 		if (cmd == CTL_GETSYNC)
 			sync_info->sync_interval = lun->sync_interval;
 		else
 			lun->sync_interval = sync_info->sync_interval;
-
-		mtx_unlock(&softc->ctl_lock);
+		mtx_unlock(&lun->lun_lock);
 
 		sync_info->status = CTL_GS_SYNC_OK;
 
@@ -2822,6 +2794,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 			retval = EINVAL;
 			break;
 		}
+		mtx_lock(&lun->lun_lock);
+		mtx_unlock(&softc->ctl_lock);
 
 		/*
 		 * We could do some checking here to verify the validity
@@ -2844,7 +2818,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 		err_desc->serial = lun->error_serial;
 		lun->error_serial++;
 
-		mtx_unlock(&softc->ctl_lock);
+		mtx_unlock(&lun->lun_lock);
 		break;
 	}
 	case CTL_ERROR_INJECT_DELETE: {
@@ -2864,6 +2838,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 			retval = EINVAL;
 			break;
 		}
+		mtx_lock(&lun->lun_lock);
+		mtx_unlock(&softc->ctl_lock);
 		STAILQ_FOREACH_SAFE(desc, &lun->error_list, links, desc2) {
 			if (desc->serial != delete_desc->serial)
 				continue;
@@ -2873,7 +2849,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 			free(desc, M_CTL);
 			delete_done = 1;
 		}
-		mtx_unlock(&softc->ctl_lock);
+		mtx_unlock(&lun->lun_lock);
 		if (delete_done == 0) {
 			printf("%s: CTL_ERROR_INJECT_DELETE: can't find "
 			       "error serial %ju on LUN %u\n", __func__, 
@@ -3026,8 +3002,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 		sbuf_printf(sb, "\n");
 
 		mtx_lock(&softc->ctl_lock);
-
 		STAILQ_FOREACH(lun, &softc->lun_list, links) {
+			mtx_lock(&lun->lun_lock);
 			retval = sbuf_printf(sb, "\n",
 					     (uintmax_t)lun->lun);
 
@@ -3118,7 +3094,10 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 
 			if (retval != 0)
 				break;
+			mtx_unlock(&lun->lun_lock);
 		}
+		if (lun != NULL)
+			mtx_unlock(&lun->lun_lock);
 		mtx_unlock(&softc->ctl_lock);
 
 		if ((retval != 0)
@@ -4252,6 +4231,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft
 	}
 	ctl_set_mask(ctl_softc->ctl_lun_mask, lun_number);
 
+	mtx_init(&lun->lun_lock, "CTL LUN", NULL, MTX_DEF);
 	lun->target = target_id;
 	lun->lun = lun_number;
 	lun->be_lun = be_lun;
@@ -4371,7 +4351,6 @@ ctl_free_lun(struct ctl_lun *lun)
 	struct ctl_frontend *fe;
 #endif
 	struct ctl_lun *nlun;
-	union ctl_io *io, *next_io;
 	int i;
 
 	softc = lun->ctl_softc;
@@ -4384,49 +4363,8 @@ ctl_free_lun(struct ctl_lun *lun)
 
 	softc->ctl_luns[lun->lun] = NULL;
 
-	if (TAILQ_FIRST(&lun->ooa_queue) != NULL) {
-		printf("ctl_free_lun: aieee!! freeing a LUN with "
-		       "outstanding I/O!!\n");
-	}
-
-	/*
-	 * If we have anything pending on the RtR queue, remove it.
-	 */
-	for (io = (union ctl_io *)STAILQ_FIRST(&softc->rtr_queue); io != NULL;
-	     io = next_io) {
-		uint32_t targ_lun;
-
-		next_io = (union ctl_io *)STAILQ_NEXT(&io->io_hdr, links);
-		targ_lun = io->io_hdr.nexus.targ_lun;
-		if (io->io_hdr.nexus.lun_map_fn != NULL)
-			targ_lun = io->io_hdr.nexus.lun_map_fn(io->io_hdr.nexus.lun_map_arg, targ_lun);
-		if ((io->io_hdr.nexus.targ_target.id == lun->target.id)
-		 && (targ_lun == lun->lun))
-			STAILQ_REMOVE(&softc->rtr_queue, &io->io_hdr,
-				      ctl_io_hdr, links);
-	}
-
-	/*
-	 * Then remove everything from the blocked queue.
-	 */
-	for (io = (union ctl_io *)TAILQ_FIRST(&lun->blocked_queue); io != NULL;
-	     io = next_io) {
-		next_io = (union ctl_io *)TAILQ_NEXT(&io->io_hdr,blocked_links);
-		TAILQ_REMOVE(&lun->blocked_queue, &io->io_hdr, blocked_links);
-		io->io_hdr.flags &= ~CTL_FLAG_BLOCKED;
-	}
-
-	/*
-	 * Now clear out the OOA queue, and free all the I/O.
-	 * XXX KDM should we notify the FETD here?  We probably need to
-	 * quiesce the LUN before deleting it.
-	 */
-	for (io = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); io != NULL;
-	     io = next_io) {
-		next_io = (union ctl_io *)TAILQ_NEXT(&io->io_hdr, ooa_links);
-		TAILQ_REMOVE(&lun->ooa_queue, &io->io_hdr, ooa_links);
-		ctl_free_io(io);
-	}
+	if (!TAILQ_EMPTY(&lun->ooa_queue))
+		panic("Freeing a LUN %p with outstanding I/O!!\n", lun);
 
 	softc->num_luns--;
 
@@ -4488,6 +4426,7 @@ ctl_free_lun(struct ctl_lun *lun)
 	atomic_subtract_int(&lun->be_lun->be->num_luns, 1);
 	lun->be_lun->lun_shutdown(lun->be_lun->be_lun);
 
+	mtx_destroy(&lun->lun_lock);
 	if (lun->flags & CTL_LUN_MALLOCED)
 		free(lun, M_CTL);
 
@@ -4516,15 +4455,12 @@ ctl_create_lun(struct ctl_be_lun *be_lun
 int
 ctl_add_lun(struct ctl_be_lun *be_lun)
 {
-	struct ctl_softc *ctl_softc;
-
-	ctl_softc = control_softc;
+	struct ctl_softc *ctl_softc = control_softc;
 
 	mtx_lock(&ctl_softc->ctl_lock);
 	STAILQ_INSERT_TAIL(&ctl_softc->pending_lun_queue, be_lun, links);
 	mtx_unlock(&ctl_softc->ctl_lock);
-
-	ctl_wakeup_thread();
+	wakeup(&ctl_softc->pending_lun_queue);
 
 	return (0);
 }
@@ -4542,15 +4478,18 @@ ctl_enable_lun(struct ctl_be_lun *be_lun
 	lun = (struct ctl_lun *)be_lun->ctl_lun;
 
 	mtx_lock(&ctl_softc->ctl_lock);
+	mtx_lock(&lun->lun_lock);
 	if ((lun->flags & CTL_LUN_DISABLED) == 0) {
 		/*
 		 * eh?  Why did we get called if the LUN is already
 		 * enabled?
 		 */
+		mtx_unlock(&lun->lun_lock);
 		mtx_unlock(&ctl_softc->ctl_lock);
 		return (0);
 	}
 	lun->flags &= ~CTL_LUN_DISABLED;
+	mtx_unlock(&lun->lun_lock);
 
 	for (fe = STAILQ_FIRST(&ctl_softc->fe_list); fe != NULL; fe = nfe) {
 		nfe = STAILQ_NEXT(fe, links);
@@ -4595,12 +4534,14 @@ ctl_disable_lun(struct ctl_be_lun *be_lu
 	lun = (struct ctl_lun *)be_lun->ctl_lun;
 
 	mtx_lock(&ctl_softc->ctl_lock);
-
+	mtx_lock(&lun->lun_lock);
 	if (lun->flags & CTL_LUN_DISABLED) {
+		mtx_unlock(&lun->lun_lock);
 		mtx_unlock(&ctl_softc->ctl_lock);
 		return (0);
 	}
 	lun->flags |= CTL_LUN_DISABLED;
+	mtx_unlock(&lun->lun_lock);
 
 	STAILQ_FOREACH(fe, &ctl_softc->fe_list, links) {
 		mtx_unlock(&ctl_softc->ctl_lock);
@@ -4637,9 +4578,9 @@ ctl_start_lun(struct ctl_be_lun *be_lun)
 
 	lun = (struct ctl_lun *)be_lun->ctl_lun;
 
-	mtx_lock(&ctl_softc->ctl_lock);
+	mtx_lock(&lun->lun_lock);
 	lun->flags &= ~CTL_LUN_STOPPED;
-	mtx_unlock(&ctl_softc->ctl_lock);
+	mtx_unlock(&lun->lun_lock);
 
 	return (0);
 }
@@ -4654,9 +4595,9 @@ ctl_stop_lun(struct ctl_be_lun *be_lun)
 
 	lun = (struct ctl_lun *)be_lun->ctl_lun;
 
-	mtx_lock(&ctl_softc->ctl_lock);
+	mtx_lock(&lun->lun_lock);
 	lun->flags |= CTL_LUN_STOPPED;
-	mtx_unlock(&ctl_softc->ctl_lock);
+	mtx_unlock(&lun->lun_lock);
 
 	return (0);
 }
@@ -4671,9 +4612,9 @@ ctl_lun_offline(struct ctl_be_lun *be_lu
 
 	lun = (struct ctl_lun *)be_lun->ctl_lun;
 
-	mtx_lock(&ctl_softc->ctl_lock);
+	mtx_lock(&lun->lun_lock);
 	lun->flags |= CTL_LUN_OFFLINE;
-	mtx_unlock(&ctl_softc->ctl_lock);
+	mtx_unlock(&lun->lun_lock);
 
 	return (0);
 }
@@ -4688,9 +4629,9 @@ ctl_lun_online(struct ctl_be_lun *be_lun
 
 	lun = (struct ctl_lun *)be_lun->ctl_lun;
 
-	mtx_lock(&ctl_softc->ctl_lock);
+	mtx_lock(&lun->lun_lock);
 	lun->flags &= ~CTL_LUN_OFFLINE;
-	mtx_unlock(&ctl_softc->ctl_lock);
+	mtx_unlock(&lun->lun_lock);
 
 	return (0);
 }
@@ -4705,13 +4646,13 @@ ctl_invalidate_lun(struct ctl_be_lun *be
 
 	lun = (struct ctl_lun *)be_lun->ctl_lun;
 
-	mtx_lock(&ctl_softc->ctl_lock);
+	mtx_lock(&lun->lun_lock);
 
 	/*
 	 * The LUN needs to be disabled before it can be marked invalid.
 	 */
 	if ((lun->flags & CTL_LUN_DISABLED) == 0) {
-		mtx_unlock(&ctl_softc->ctl_lock);
+		mtx_unlock(&lun->lun_lock);
 		return (-1);
 	}
 	/*
@@ -4724,9 +4665,13 @@ ctl_invalidate_lun(struct ctl_be_lun *be
 	 * If we have something in the OOA queue, we'll free it when the
 	 * last I/O completes.
 	 */
-	if (TAILQ_FIRST(&lun->ooa_queue) == NULL)
+	if (TAILQ_EMPTY(&lun->ooa_queue)) {
+		mtx_unlock(&lun->lun_lock);
+		mtx_lock(&ctl_softc->ctl_lock);
 		ctl_free_lun(lun);
-	mtx_unlock(&ctl_softc->ctl_lock);
+		mtx_unlock(&ctl_softc->ctl_lock);
+	} else
+		mtx_unlock(&lun->lun_lock);
 
 	return (0);
 }
@@ -4740,9 +4685,9 @@ ctl_lun_inoperable(struct ctl_be_lun *be
 	ctl_softc = control_softc;
 	lun = (struct ctl_lun *)be_lun->ctl_lun;
 
-	mtx_lock(&ctl_softc->ctl_lock);
+	mtx_lock(&lun->lun_lock);
 	lun->flags |= CTL_LUN_INOPERABLE;
-	mtx_unlock(&ctl_softc->ctl_lock);
+	mtx_unlock(&lun->lun_lock);
 
 	return (0);
 }
@@ -4756,9 +4701,9 @@ ctl_lun_operable(struct ctl_be_lun *be_l
 	ctl_softc = control_softc;
 	lun = (struct ctl_lun *)be_lun->ctl_lun;
 
-	mtx_lock(&ctl_softc->ctl_lock);
+	mtx_lock(&lun->lun_lock);
 	lun->flags &= ~CTL_LUN_INOPERABLE;
-	mtx_unlock(&ctl_softc->ctl_lock);
+	mtx_unlock(&lun->lun_lock);
 
 	return (0);
 }
@@ -4778,6 +4723,7 @@ ctl_lun_power_lock(struct ctl_be_lun *be
 	mtx_lock(&softc->ctl_lock);
 
 	lun = (struct ctl_lun *)be_lun->ctl_lun;
+	mtx_lock(&lun->lun_lock);
 
 	page_index = NULL;
 	for (i = 0; i < CTL_NUM_MODE_PAGES; i++) {
@@ -4791,6 +4737,7 @@ ctl_lun_power_lock(struct ctl_be_lun *be
 	}
 
 	if (page_index == NULL) {
+		mtx_unlock(&lun->lun_lock);
 		mtx_unlock(&softc->ctl_lock);
 		printf("%s: APS subpage not found for lun %ju!\n", __func__,
 		       (uintmax_t)lun->lun);
@@ -4801,6 +4748,7 @@ ctl_lun_power_lock(struct ctl_be_lun *be
 	 && (softc->aps_locked_lun != lun->lun)) {
 		printf("%s: attempt to lock LUN %llu when %llu is already "
 		       "locked\n");
+		mtx_unlock(&lun->lun_lock);
 		mtx_unlock(&softc->ctl_lock);
 		return (1);
 	}
@@ -4837,11 +4785,13 @@ ctl_lun_power_lock(struct ctl_be_lun *be
 		if (isc_retval > CTL_HA_STATUS_SUCCESS) {
 			printf("%s: APS (lock=%d) error returned from "
 			       "ctl_ha_msg_send: %d\n", __func__, lock, isc_retval);
+			mtx_unlock(&lun->lun_lock);
 			mtx_unlock(&softc->ctl_lock);
 			return (1);
 		}
 	}
 
+	mtx_unlock(&lun->lun_lock);
 	mtx_unlock(&softc->ctl_lock);
 
 	return (0);
@@ -4856,14 +4806,14 @@ ctl_lun_capacity_changed(struct ctl_be_l
 
 	softc = control_softc;
 
-	mtx_lock(&softc->ctl_lock);
-
 	lun = (struct ctl_lun *)be_lun->ctl_lun;
 
+	mtx_lock(&lun->lun_lock);
+
 	for (i = 0; i < CTL_MAX_INITIATORS; i++) 
 		lun->pending_sense[i].ua_pending |= CTL_UA_CAPACITY_CHANGED;
 
-	mtx_unlock(&softc->ctl_lock);
+	mtx_unlock(&lun->lun_lock);
 }
 
 /*
@@ -5102,7 +5052,7 @@ ctl_scsi_release(struct ctl_scsiio *ctsi
 	if (length > 0)
 		thirdparty_id = scsi_8btou64(ctsio->kern_data_ptr);
 
-	mtx_lock(&ctl_softc->ctl_lock);
+	mtx_lock(&lun->lun_lock);
 
 	/*
 	 * According to SPC, it is not an error for an intiator to attempt
@@ -5120,6 +5070,8 @@ ctl_scsi_release(struct ctl_scsiio *ctsi
 		}
 	}
 
+	mtx_unlock(&lun->lun_lock);
+
 	ctsio->scsi_status = SCSI_STATUS_OK;
 	ctsio->io_hdr.status = CTL_SUCCESS;
 
@@ -5128,8 +5080,6 @@ ctl_scsi_release(struct ctl_scsiio *ctsi
 		ctsio->io_hdr.flags &= ~CTL_FLAG_ALLOCATED;
 	}
 
-	mtx_unlock(&ctl_softc->ctl_lock);
-
 	ctl_done((union ctl_io *)ctsio);
 	return (CTL_RETVAL_COMPLETE);
 }
@@ -5237,7 +5187,7 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi
 	if (length > 0)
 		thirdparty_id = scsi_8btou64(ctsio->kern_data_ptr);
 
-	mtx_lock(&ctl_softc->ctl_lock);
+	mtx_lock(&lun->lun_lock);
 	if (lun->flags & CTL_LUN_RESERVED) {
 		if ((ctsio->io_hdr.nexus.initid.id != lun->rsv_nexus.initid.id)
 		 || (ctsio->io_hdr.nexus.targ_port != lun->rsv_nexus.targ_port)
@@ -5256,13 +5206,13 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi
 	ctsio->io_hdr.status = CTL_SUCCESS;
 
 bailout:
+	mtx_unlock(&lun->lun_lock);
+
 	if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) {
 		free(ctsio->kern_data_ptr, M_CTL);
 		ctsio->io_hdr.flags &= ~CTL_FLAG_ALLOCATED;
 	}
 
-	mtx_unlock(&ctl_softc->ctl_lock);
-
 	ctl_done((union ctl_io *)ctsio);
 	return (CTL_RETVAL_COMPLETE);
 }
@@ -5371,7 +5321,7 @@ ctl_start_stop(struct ctl_scsiio *ctsio)
 	 * Figure out a reasonable way to port this?
 	 */
 #ifdef NEEDTOPORT
-	mtx_lock(&ctl_softc->ctl_lock);
+	mtx_lock(&lun->lun_lock);
 
 	if (((cdb->byte2 & SSS_ONOFFLINE) == 0)
 	 && (lun->flags & CTL_LUN_OFFLINE)) {
@@ -5379,11 +5329,11 @@ ctl_start_stop(struct ctl_scsiio *ctsio)
 		 * If the LUN is offline, and the on/offline bit isn't set,
 		 * reject the start or stop.  Otherwise, let it through.
 		 */
-		mtx_unlock(&ctl_softc->ctl_lock);
+		mtx_unlock(&lun->lun_lock);
 		ctl_set_lun_not_ready(ctsio);
 		ctl_done((union ctl_io *)ctsio);
 	} else {
-		mtx_unlock(&ctl_softc->ctl_lock);
+		mtx_unlock(&lun->lun_lock);
 #endif /* NEEDTOPORT */
 		/*
 		 * This could be a start or a stop when we're online,
@@ -5544,14 +5494,14 @@ ctl_sync_cache(struct ctl_scsiio *ctsio)
 	 * Check to see whether we're configured to send the SYNCHRONIZE
 	 * CACHE command directly to the back end.
 	 */
-	mtx_lock(&ctl_softc->ctl_lock);
+	mtx_lock(&lun->lun_lock);
 	if ((ctl_softc->flags & CTL_FLAG_REAL_SYNC)
 	 && (++(lun->sync_count) >= lun->sync_interval)) {
 		lun->sync_count = 0;
-		mtx_unlock(&ctl_softc->ctl_lock);
+		mtx_unlock(&lun->lun_lock);
 		retval = lun->backend->config_write((union ctl_io *)ctsio);
 	} else {
-		mtx_unlock(&ctl_softc->ctl_lock);
+		mtx_unlock(&lun->lun_lock);
 		ctl_set_success(ctsio);
 		ctl_done((union ctl_io *)ctsio);
 	}
@@ -5644,9 +5594,9 @@ ctl_format(struct ctl_scsiio *ctsio)
 	 * get them to issue a command that will basically make them think
 	 * they're blowing away the media.
 	 */
-	mtx_lock(&ctl_softc->ctl_lock);
+	mtx_lock(&lun->lun_lock);
 	lun->flags &= ~CTL_LUN_INOPERABLE;
-	mtx_unlock(&ctl_softc->ctl_lock);
+	mtx_unlock(&lun->lun_lock);
 
 	ctsio->scsi_status = SCSI_STATUS_OK;
 	ctsio->io_hdr.status = CTL_SUCCESS;
@@ -5974,7 +5924,7 @@ ctl_control_page_handler(struct ctl_scsi
 
 	softc = control_softc;
 
-	mtx_lock(&softc->ctl_lock);
+	mtx_lock(&lun->lun_lock);
 	if (((current_cp->rlec & SCP_DSENSE) == 0)
 	 && ((user_cp->rlec & SCP_DSENSE) != 0)) {
 		/*
@@ -6070,7 +6020,7 @@ ctl_control_page_handler(struct ctl_scsi
 				CTL_UA_MODE_CHANGE;
 		}
 	}
-	mtx_unlock(&softc->ctl_lock);
+	mtx_unlock(&lun->lun_lock);
 
 	return (0);
 }
@@ -7133,10 +7083,7 @@ ctl_maintenance_in(struct ctl_scsiio *ct
 		return(retval);
 	}
 
-	mtx_lock(&softc->ctl_lock);
 	single = ctl_is_single;
-	mtx_unlock(&softc->ctl_lock);
-
 	if (single)
         	num_target_port_groups = NUM_TARGET_PORT_GROUPS - 1;
 	else
@@ -7269,7 +7216,7 @@ ctl_persistent_reserve_in(struct ctl_scs
 	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
 
 retry:
-	mtx_lock(&softc->ctl_lock);
+	mtx_lock(&lun->lun_lock);
 	switch (cdb->action) {
 	case SPRI_RK: /* read keys */
 		total_len = sizeof(struct scsi_per_res_in_keys) +
@@ -7287,7 +7234,7 @@ retry:
 		break;
 	case SPRI_RS: /* read full status */
 	default:
-		mtx_unlock(&softc->ctl_lock);
+		mtx_unlock(&lun->lun_lock);
 		ctl_set_invalid_field(ctsio,
 				      /*sks_valid*/ 1,
 				      /*command*/ 1,
@@ -7298,7 +7245,7 @@ retry:
 		return (CTL_RETVAL_COMPLETE);
 		break; /* NOTREACHED */
 	}
-	mtx_unlock(&softc->ctl_lock);
+	mtx_unlock(&lun->lun_lock);
 
 	ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
 
@@ -7316,7 +7263,7 @@ retry:
 	ctsio->kern_rel_offset = 0;
 	ctsio->kern_sg_entries = 0;
 
-	mtx_lock(&softc->ctl_lock);
+	mtx_lock(&lun->lun_lock);
 	switch (cdb->action) {
 	case SPRI_RK: { // read keys
         struct scsi_per_res_in_keys *res_keys;
@@ -7334,7 +7281,7 @@ retry:
 		if (total_len != (sizeof(struct scsi_per_res_in_keys) +
 		    (lun->pr_key_count *
 		     sizeof(struct scsi_per_res_key)))){
-			mtx_unlock(&softc->ctl_lock);
+			mtx_unlock(&lun->lun_lock);
 			free(ctsio->kern_data_ptr, M_CTL);
 			printf("%s: reservation length changed, retrying\n",
 			       __func__);
@@ -7409,7 +7356,7 @@ retry:
 		 * command active right now.)
 		 */
 		if (tmp_len != total_len) {
-			mtx_unlock(&softc->ctl_lock);
+			mtx_unlock(&lun->lun_lock);
 			free(ctsio->kern_data_ptr, M_CTL);
 			printf("%s: reservation status changed, retrying\n",
 			       __func__);
@@ -7460,7 +7407,7 @@ retry:
 		panic("Invalid PR type %x", cdb->action);
 		break; /* NOTREACHED */
 	}
-	mtx_unlock(&softc->ctl_lock);
+	mtx_unlock(&lun->lun_lock);
 
 	ctsio->be_move_done = ctl_config_move_done;
 
@@ -7491,13 +7438,13 @@ ctl_pro_preempt(struct ctl_softc *softc,
 
 	retval = 0;
 
+	mtx_lock(&lun->lun_lock);
 	if (sa_res_key == 0) {
-		mtx_lock(&softc->ctl_lock);
 		if (lun->pr_res_idx == CTL_PR_ALL_REGISTRANTS) {
 			/* validate scope and type */
 			if ((cdb->scope_type & SPR_SCOPE_MASK) !=
 			     SPR_LU_SCOPE) {
-				mtx_unlock(&softc->ctl_lock);
+				mtx_unlock(&lun->lun_lock);
 				ctl_set_invalid_field(/*ctsio*/ ctsio,
 						      /*sks_valid*/ 1,
 						      /*command*/ 1,
@@ -7509,7 +7456,7 @@ ctl_pro_preempt(struct ctl_softc *softc,
 			}
 
 		        if (type>8 || type==2 || type==4 || type==0) {
-				mtx_unlock(&softc->ctl_lock);
+				mtx_unlock(&lun->lun_lock);
 				ctl_set_invalid_field(/*ctsio*/ ctsio,
        	           				      /*sks_valid*/ 1,
 						      /*command*/ 1,

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 17:12:48 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id ADD91BB;
 Wed, 25 Jun 2014 17:12:48 +0000 (UTC)
Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "vps1.elischer.org",
 Issuer "CA Cert Signing Authority" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 02A382F30;
 Wed, 25 Jun 2014 17:12:47 +0000 (UTC)
Received: from Julian-MBP3.local (etroy.elischer.org [121.45.232.70])
 (authenticated bits=0)
 by vps1.elischer.org (8.14.8/8.14.8) with ESMTP id s5PHCZEg003635
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO);
 Wed, 25 Jun 2014 10:12:38 -0700 (PDT)
 (envelope-from julian@freebsd.org)
Message-ID: <53AB02FD.20502@freebsd.org>
Date: Thu, 26 Jun 2014 01:12:29 +0800
From: Julian Elischer 
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Alfred Perlstein , attilio@FreeBSD.org,
 Gleb Smirnoff 
Subject: Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon
References: <201406250951.s5P9p8YR017159@svn.freebsd.org>		<20140625120932.GM28199@FreeBSD.org>
 
 <53AAE7D0.2090508@freebsd.org>
In-Reply-To: <53AAE7D0.2090508@freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: Alan Cox ,
 "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 17:12:48 -0000

On 6/25/14, 11:16 PM, Alfred Perlstein wrote:
> On 6/25/14 5:41 AM, Attilio Rao wrote:
>> On Wed, Jun 25, 2014 at 2:09 PM, Gleb Smirnoff 
>>  wrote:
>>> On Wed, Jun 25, 2014 at 01:58:29PM +0200, Attilio Rao wrote:
>>> A> > Log:
>>> A> >   xen/virtio: fix balloon drivers to not mark pages as WIRED
>>> A> >
>>> A> >   Prevent the Xen and VirtIO balloon drivers from marking 
>>> pages as
>>> A> >   wired. This prevents them from increasing the system wired 
>>> page count,
>>> A> >   which can lead to mlock failing because of hitting the 
>>> limit in
>>> A> >   vm.max_wired.
>>> A>
>>> A> This change is conceptually wrong.
>>> A> The pages balloon is allocating are unmanaged and they should 
>>> be wired
>>> A> by definition. Alan and I are considering enforcing this 
>>> (mandatory
>>> A> wired pages for unmanaged pages allocation) directly in the KPI.
>>> A> This in practice just seem an artifact to deal with scarce  wired
>>> A> memory limit. I suggest that for the XEN case this limit gets 
>>> bumped
>>> A> rather relying on similar type of hacks.
>>>
>>> Proper limit would be to count pages wired by userland via mlock(2)
>>> and enforce limit only on those pages. Pages wired by kernel should
>>> be either unlimited or controled by a separate limit.
>> FWIW, I mostly agree with this. I think that the kernel and userland
>> limits should be split apart. But for the time being, rising the limit
>> is better.
>>
>> Attilio
>>
>>
> Can you explain?  I would think that if you were designing some kind 
> of embedded device you would want to know exactly how much locked 
> pages there are overall, not just in userland.
>
> Meaning you would not want to overcommit and have too many locked 
> pages due to kernel+user.
>
> Perhaps that needs an API as well?

these pages are the VM equivalent of memory pages that were 'found to 
be flaky and taken out of service"
I think "wired" is a bad description for those.



From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 17:18:46 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 504572A7;
 Wed, 25 Jun 2014 17:18:46 +0000 (UTC)
Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0E83F2F77;
 Wed, 25 Jun 2014 17:18:45 +0000 (UTC)
Received: from pps.filterd (pp2.rice.edu [127.0.0.1])
 by pp2.rice.edu (8.14.5/8.14.5) with SMTP id s5PHGh0L024849;
 Wed, 25 Jun 2014 12:18:45 -0500
Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30])
 by pp2.rice.edu with ESMTP id 1mqurs07pk-1;
 Wed, 25 Jun 2014 12:18:44 -0500
X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel
Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net
 (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201])
 (using TLSv1 with cipher RC4-MD5 (128/128 bits))
 (No client certificate requested) (Authenticated sender: alc)
 by mh11.mail.rice.edu (Postfix) with ESMTPSA id D26BB4C01BA;
 Wed, 25 Jun 2014 12:18:43 -0500 (CDT)
Message-ID: <53AB0473.8080709@rice.edu>
Date: Wed, 25 Jun 2014 12:18:43 -0500
From: Alan Cox 
User-Agent: Mozilla/5.0 (X11; FreeBSD i386;
 rv:24.0) Gecko/20100101 Thunderbird/24.2.0
MIME-Version: 1.0
To: Julian Elischer ,
 Alfred Perlstein , attilio@FreeBSD.org,
 Gleb Smirnoff 
Subject: Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon
References: <201406250951.s5P9p8YR017159@svn.freebsd.org>		<20140625120932.GM28199@FreeBSD.org>
 
 <53AAE7D0.2090508@freebsd.org> <53AB02FD.20502@freebsd.org>
In-Reply-To: <53AB02FD.20502@freebsd.org>
X-Enigmail-Version: 1.6
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 kscore.is_bulkscore=0
 kscore.compositescore=0 circleOfTrustscore=0
 compositescore=0.605690798989426 urlsuspect_oldscore=0.00569079898942585
 suspectscore=3 recipient_domain_to_sender_totalscore=0 phishscore=0
 bulkscore=0 kscore.is_spamscore=1 recipient_to_sender_totalscore=0
 recipient_domain_to_sender_domain_totalscore=0 rbsscore=0.605690798989426
 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9
 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=7.0.1-1402240000 definitions=main-1406250177
Cc: Alan Cox ,
 "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 17:18:46 -0000

On 06/25/2014 12:12, Julian Elischer wrote:
> On 6/25/14, 11:16 PM, Alfred Perlstein wrote:
>> On 6/25/14 5:41 AM, Attilio Rao wrote:
>>> On Wed, Jun 25, 2014 at 2:09 PM, Gleb Smirnoff 
>>> wrote:
>>>> On Wed, Jun 25, 2014 at 01:58:29PM +0200, Attilio Rao wrote:
>>>> A> > Log:
>>>> A> >   xen/virtio: fix balloon drivers to not mark pages as WIRED
>>>> A> >
>>>> A> >   Prevent the Xen and VirtIO balloon drivers from marking
>>>> pages as
>>>> A> >   wired. This prevents them from increasing the system wired
>>>> page count,
>>>> A> >   which can lead to mlock failing because of hitting the limit in
>>>> A> >   vm.max_wired.
>>>> A>
>>>> A> This change is conceptually wrong.
>>>> A> The pages balloon is allocating are unmanaged and they should be
>>>> wired
>>>> A> by definition. Alan and I are considering enforcing this (mandatory
>>>> A> wired pages for unmanaged pages allocation) directly in the KPI.
>>>> A> This in practice just seem an artifact to deal with scarce  wired
>>>> A> memory limit. I suggest that for the XEN case this limit gets
>>>> bumped
>>>> A> rather relying on similar type of hacks.
>>>>
>>>> Proper limit would be to count pages wired by userland via mlock(2)
>>>> and enforce limit only on those pages. Pages wired by kernel should
>>>> be either unlimited or controled by a separate limit.
>>> FWIW, I mostly agree with this. I think that the kernel and userland
>>> limits should be split apart. But for the time being, rising the limit
>>> is better.
>>>
>>> Attilio
>>>
>>>
>> Can you explain?  I would think that if you were designing some kind
>> of embedded device you would want to know exactly how much locked
>> pages there are overall, not just in userland.
>>
>> Meaning you would not want to overcommit and have too many locked
>> pages due to kernel+user.
>>
>> Perhaps that needs an API as well?
>
> these pages are the VM equivalent of memory pages that were 'found to
> be flaky and taken out of service"
> I think "wired" is a bad description for those.
>
>
>

That doesn't matter.  To the rest of the VM system, and, in particular,
the page daemon, one category is indistinguishable from the other.


From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 17:27:15 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id CC218472;
 Wed, 25 Jun 2014 17:27:15 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B933E205C;
 Wed, 25 Jun 2014 17:27:15 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5PHRFh4035008;
 Wed, 25 Jun 2014 17:27:15 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PHRFOV035007;
 Wed, 25 Jun 2014 17:27:15 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201406251727.s5PHRFOV035007@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Wed, 25 Jun 2014 17:27:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267875 -
 head/cddl/contrib/opensolaris/lib/libdtrace/common
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 17:27:15 -0000

Author: pfg
Date: Wed Jun 25 17:27:15 2014
New Revision: 267875
URL: http://svnweb.freebsd.org/changeset/base/267875

Log:
  MFV	r258381:
  
  4251 libdtrace leaks open file handles
  
  Illumos commit:		93ed8d0d4b068b95d0bb50d57bb854df462a8485
  			(partial)
  Reference:
  https://www.illumos.org/issues/4251
  
  Discussed with:	Robert Mustacchi
  Obtained from:	Illumos
  MFC after:	1 week

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c	Wed Jun 25 17:10:26 2014	(r267874)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c	Wed Jun 25 17:27:15 2014	(r267875)
@@ -2268,12 +2268,15 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, cons
 			dt_dprintf("skipping library %s, already processed "
 			    "library with the same name: %s", dp->d_name,
 			    dld->dtld_library);
+			(void) fclose(fp);
 			continue;
 		}
 
 		dtp->dt_filetag = fname;
-		if (dt_lib_depend_add(dtp, &dtp->dt_lib_dep, fname) != 0)
+		if (dt_lib_depend_add(dtp, &dtp->dt_lib_dep, fname) != 0) {
+			(void) fclose(fp);
 			return (-1); /* preserve dt_errno */
+		}
 
 		rv = dt_compile(dtp, DT_CTX_DPROG,
 		    DTRACE_PROBESPEC_NAME, NULL,
@@ -2281,8 +2284,10 @@ dt_load_libs_dir(dtrace_hdl_t *dtp, cons
 
 		if (rv != NULL && dtp->dt_errno &&
 		    (dtp->dt_errno != EDT_COMPILER ||
-		    dtp->dt_errtag != dt_errtag(D_PRAGMA_DEPEND)))
+		    dtp->dt_errtag != dt_errtag(D_PRAGMA_DEPEND))) {
+			(void) fclose(fp);
 			return (-1); /* preserve dt_errno */
+		}
 
 		if (dtp->dt_errno)
 			dt_dprintf("error parsing library %s: %s\n",

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 17:43:09 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2E98E874;
 Wed, 25 Jun 2014 17:43:09 +0000 (UTC)
Received: from mail-we0-x22e.google.com (mail-we0-x22e.google.com
 [IPv6:2a00:1450:400c:c03::22e])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 2513A21E7;
 Wed, 25 Jun 2014 17:43:07 +0000 (UTC)
Received: by mail-we0-f174.google.com with SMTP id u57so2473375wes.19
 for ; Wed, 25 Jun 2014 10:43:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
 :references:in-reply-to:content-type:content-transfer-encoding;
 bh=iCFGJhmL1cEDIX5hfkyNrVKQgEdfrfNqbq8vVcVR4jw=;
 b=xy20UVgGG4jVL6qUuBKp+QFvUPTZtO9WRa311HU3YAAKqr+TPDUzfo4/C9jJPuy6XA
 5x1PV3zlTEE+ShdjxxJh7HsZwc0H3L45PsNP1QDbGyc4HeqiZrm2MPNWHo6jdqL/Ihu1
 l2BRriMN7RUQUmS5/YD4EiSXaai5ER/XbYWKmo+Vt8Z/26Oe4fByv7WEf6xDqPsyEtIR
 bVlYEtnIZQtj/IR/Pt3pl7cdwxoaIJKdwBW7v7zuGOFw1VS0bfrjzq0OO967XNUxp7E6
 X41TP6WlSOjYlddvKeTATurzBWPt9de92xBeoY+agV6zpPbp9II9/LiHgyGQrtz1Vp8/
 VJZA==
X-Received: by 10.194.178.7 with SMTP id cu7mr11319395wjc.54.1403718186441;
 Wed, 25 Jun 2014 10:43:06 -0700 (PDT)
Received: from [172.16.1.30] (39.Red-2-136-52.dynamicIP.rima-tde.net.
 [2.136.52.39])
 by mx.google.com with ESMTPSA id am10sm8774308wjc.45.2014.06.25.10.43.04
 for 
 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Wed, 25 Jun 2014 10:43:05 -0700 (PDT)
Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= 
Message-ID: <53AB0A23.6020605@FreeBSD.org>
Date: Wed, 25 Jun 2014 19:42:59 +0200
From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= 
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Alan Cox , attilio@FreeBSD.org, Alan Cox 
Subject: Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon
References: <201406250951.s5P9p8YR017159@svn.freebsd.org>
 
 <53AACEAB.3090702@FreeBSD.org> <53AAFD12.5030308@rice.edu>
In-Reply-To: <53AAFD12.5030308@rice.edu>
X-Enigmail-Version: 1.6
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 17:43:09 -0000

On 25/06/14 18:47, Alan Cox wrote:
> On 06/25/2014 08:29, Roger Pau Monné wrote:
>> On 25/06/14 13:58, Attilio Rao wrote:
>>> On Wed, Jun 25, 2014 at 11:51 AM, Roger Pau Monné  wrote:
>>>> Author: royger
>>>> Date: Wed Jun 25 09:51:08 2014
>>>> New Revision: 267858
>>>> URL: http://svnweb.freebsd.org/changeset/base/267858
>>>>
>>>> Log:
>>>>   xen/virtio: fix balloon drivers to not mark pages as WIRED
>>>>
>>>>   Prevent the Xen and VirtIO balloon drivers from marking pages as
>>>>   wired. This prevents them from increasing the system wired page count,
>>>>   which can lead to mlock failing because of hitting the limit in
>>>>   vm.max_wired.
>>> This change is conceptually wrong.
>>> The pages balloon is allocating are unmanaged and they should be wired
>>> by definition. Alan and I are considering enforcing this (mandatory
>>> wired pages for unmanaged pages allocation) directly in the KPI.
>>> This in practice just seem an artifact to deal with scarce  wired
>>> memory limit. I suggest that for the XEN case this limit gets bumped
>>> rather relying on similar type of hacks.
>> IMHO, marking them as wired seems wrong too, those pages are not wired,
>> they are simply not there any more. This was discussed in:
>>
>> http://lists.freebsd.org/pipermail/freebsd-virtualization/2014-June/002643.html
>>
>> If there's consensus I will revert the change, but I would say that
>> increasing vm.max_wired for VMs is also a gross hack.
> 
> We wouldn't be changing it just for VMs.  Our current definition of
> vm_max_wired dates back to r5455, or in human years 1995.  If the ZFS
> ARC has taught us anything, we, or really the page daemon, can cope with
> having more than 1/3 of a machine's pages wired.  :-)
> 
> I have a couple questions for you.  Exactly how much memory will Xen try
> to steal from a domain via ballooning?  Clearly the domain can fail to
> respond to the balloon request and Xen has to cope with that.  Can the
> domain also explicitly say, "No, I'm not giving you any pages."

Xen itself won't try to steal any memory from a VM, this is AFAIK
initiated by the host admin (or maybe some high-level orchestration
toolstack), which requests the domain to balloon down. The domain is
never forced to balloon down, is just a petition that the VM usually
tries to satisfy as much as it can (or completely ignore it).

As said before, I'm not sure what high-level toolstacks will do, maybe
some of them will just kill the domain if it doesn't balloon down as
expected, but I would be quite surprised if that's the case.

For example I've tried ballooning down a FreeBSD VM from 2GB to 256MB,
and only got it to ~300MB, but that's perfectly fine IMHO.

Roger.


From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 17:54:36 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id AA9B8CE9;
 Wed, 25 Jun 2014 17:54:36 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 96E762306;
 Wed, 25 Jun 2014 17:54:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5PHsaoA048101;
 Wed, 25 Jun 2014 17:54:36 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PHsa83048099;
 Wed, 25 Jun 2014 17:54:36 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406251754.s5PHsa83048099@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 25 Jun 2014 17:54:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267877 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 17:54:36 -0000

Author: mav
Date: Wed Jun 25 17:54:36 2014
New Revision: 267877
URL: http://svnweb.freebsd.org/changeset/base/267877

Log:
  Lock devstat updates in block backend to make it usable.  Polish lock names.
  
  MFC after:	2 weeks
  Sponsored by:	iXsystems, Inc.

Modified:
  head/sys/cam/ctl/ctl_backend_block.c
  head/sys/cam/ctl/ctl_backend_ramdisk.c

Modified: head/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_block.c	Wed Jun 25 17:34:04 2014	(r267876)
+++ head/sys/cam/ctl/ctl_backend_block.c	Wed Jun 25 17:54:36 2014	(r267877)
@@ -160,7 +160,6 @@ struct ctl_be_block_lun {
 	cbb_dispatch_t dispatch;
 	cbb_dispatch_t lun_flush;
 	cbb_dispatch_t unmap;
-	struct mtx lock;
 	uma_zone_t lun_zone;
 	uint64_t size_blocks;
 	uint64_t size_bytes;
@@ -179,6 +178,8 @@ struct ctl_be_block_lun {
 	STAILQ_HEAD(, ctl_io_hdr) input_queue;
 	STAILQ_HEAD(, ctl_io_hdr) config_write_queue;
 	STAILQ_HEAD(, ctl_io_hdr) datamove_queue;
+	struct mtx_padalign io_lock;
+	struct mtx_padalign queue_lock;
 };
 
 /*
@@ -336,22 +337,7 @@ ctl_free_beio(struct ctl_be_block_io *be
 static void
 ctl_complete_beio(struct ctl_be_block_io *beio)
 {
-	union ctl_io *io;
-	int io_len;
-
-	io = beio->io;
-
-	if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)
-		io_len = beio->io_len;
-	else
-		io_len = 0;
-
-	devstat_end_transaction(beio->lun->disk_stats,
-				/*bytes*/ io_len,
-				beio->ds_tag_type,
-				beio->ds_trans_type,
-				/*now*/ NULL,
-				/*then*/&beio->ds_t0);
+	union ctl_io *io = beio->io;
 
 	if (beio->beio_cont != NULL) {
 		beio->beio_cont(beio);
@@ -449,14 +435,14 @@ ctl_be_block_move_done(union ctl_io *io)
 	 * This move done routine is generally called in the SIM's
 	 * interrupt context, and therefore we cannot block.
 	 */
-	mtx_lock(&be_lun->lock);
+	mtx_lock(&be_lun->queue_lock);
 	/*
 	 * XXX KDM make sure that links is okay to use at this point.
 	 * Otherwise, we either need to add another field to ctl_io_hdr,
 	 * or deal with resource allocation here.
 	 */
 	STAILQ_INSERT_TAIL(&be_lun->datamove_queue, &io->io_hdr, links);
-	mtx_unlock(&be_lun->lock);
+	mtx_unlock(&be_lun->queue_lock);
 
 	taskqueue_enqueue(be_lun->io_taskqueue, &be_lun->io_task);
 
@@ -478,7 +464,7 @@ ctl_be_block_biodone(struct bio *bio)
 	DPRINTF("entered\n");
 
 	error = bio->bio_error;
-	mtx_lock(&be_lun->lock);
+	mtx_lock(&be_lun->io_lock);
 	if (error != 0)
 		beio->num_errors++;
 
@@ -496,7 +482,7 @@ ctl_be_block_biodone(struct bio *bio)
 	 */
 	if ((beio->send_complete == 0)
 	 || (beio->num_bios_done < beio->num_bios_sent)) {
-		mtx_unlock(&be_lun->lock);
+		mtx_unlock(&be_lun->io_lock);
 		return;
 	}
 
@@ -504,7 +490,10 @@ ctl_be_block_biodone(struct bio *bio)
 	 * At this point, we've verified that we are the last I/O to
 	 * complete, so it's safe to drop the lock.
 	 */
-	mtx_unlock(&be_lun->lock);
+	devstat_end_transaction(beio->lun->disk_stats, beio->io_len,
+	    beio->ds_tag_type, beio->ds_trans_type,
+	    /*now*/ NULL, /*then*/&beio->ds_t0);
+	mtx_unlock(&be_lun->io_lock);
 
 	/*
 	 * If there are any errors from the backing device, we fail the
@@ -546,15 +535,18 @@ static void
 ctl_be_block_flush_file(struct ctl_be_block_lun *be_lun,
 			struct ctl_be_block_io *beio)
 {
-	union ctl_io *io;
+	union ctl_io *io = beio->io;
 	struct mount *mountpoint;
 	int error, lock_flags;
 
 	DPRINTF("entered\n");
 
-	io = beio->io;
+	binuptime(&beio->ds_t0);
+	mtx_lock(&be_lun->io_lock);
+	devstat_start_transaction(beio->lun->disk_stats, &beio->ds_t0);
+	mtx_unlock(&be_lun->io_lock);
 
-       	(void) vn_start_write(be_lun->vn, &mountpoint, V_WAIT);
+	(void) vn_start_write(be_lun->vn, &mountpoint, V_WAIT);
 
 	if (MNT_SHARED_WRITES(mountpoint)
 	 || ((mountpoint == NULL)
@@ -565,14 +557,17 @@ ctl_be_block_flush_file(struct ctl_be_bl
 
 	vn_lock(be_lun->vn, lock_flags | LK_RETRY);
 
-	binuptime(&beio->ds_t0);
-	devstat_start_transaction(beio->lun->disk_stats, &beio->ds_t0);
-
 	error = VOP_FSYNC(be_lun->vn, MNT_WAIT, curthread);
 	VOP_UNLOCK(be_lun->vn, 0);
 
 	vn_finished_write(mountpoint);
 
+	mtx_lock(&be_lun->io_lock);
+	devstat_end_transaction(beio->lun->disk_stats, beio->io_len,
+	    beio->ds_tag_type, beio->ds_trans_type,
+	    /*now*/ NULL, /*then*/&beio->ds_t0);
+	mtx_unlock(&be_lun->io_lock);
+
 	if (error == 0)
 		ctl_set_success(&io->scsiio);
 	else {
@@ -627,12 +622,14 @@ ctl_be_block_dispatch_file(struct ctl_be
 		xiovec->iov_len = beio->sg_segs[i].len;
 	}
 
+	binuptime(&beio->ds_t0);
+	mtx_lock(&be_lun->io_lock);
+	devstat_start_transaction(beio->lun->disk_stats, &beio->ds_t0);
+	mtx_unlock(&be_lun->io_lock);
+
 	if (beio->bio_cmd == BIO_READ) {
 		vn_lock(be_lun->vn, LK_SHARED | LK_RETRY);
 
-		binuptime(&beio->ds_t0);
-		devstat_start_transaction(beio->lun->disk_stats, &beio->ds_t0);
-
 		/*
 		 * UFS pays attention to IO_DIRECT for reads.  If the
 		 * DIRECTIO option is configured into the kernel, it calls
@@ -673,9 +670,6 @@ ctl_be_block_dispatch_file(struct ctl_be
 
 		vn_lock(be_lun->vn, lock_flags | LK_RETRY);
 
-		binuptime(&beio->ds_t0);
-		devstat_start_transaction(beio->lun->disk_stats, &beio->ds_t0);
-
 		/*
 		 * UFS pays attention to IO_DIRECT for writes.  The write
 		 * is done asynchronously.  (Normally the write would just
@@ -702,6 +696,12 @@ ctl_be_block_dispatch_file(struct ctl_be
 		SDT_PROBE(cbb, kernel, write, file_done, 0, 0, 0, 0, 0);
         }
 
+	mtx_lock(&be_lun->io_lock);
+	devstat_end_transaction(beio->lun->disk_stats, beio->io_len,
+	    beio->ds_tag_type, beio->ds_trans_type,
+	    /*now*/ NULL, /*then*/&beio->ds_t0);
+	mtx_unlock(&be_lun->io_lock);
+
 	/*
 	 * If we got an error, set the sense data to "MEDIUM ERROR" and
 	 * return the I/O to the user.
@@ -771,7 +771,9 @@ ctl_be_block_flush_dev(struct ctl_be_blo
 	beio->send_complete = 1;
 
 	binuptime(&beio->ds_t0);
+	mtx_lock(&be_lun->io_lock);
 	devstat_start_transaction(be_lun->disk_stats, &beio->ds_t0);
+	mtx_unlock(&be_lun->io_lock);
 
 	(*dev_data->csw->d_strategy)(bio);
 }
@@ -802,11 +804,11 @@ ctl_be_block_unmap_dev_range(struct ctl_
 		off += bio->bio_length;
 		len -= bio->bio_length;
 
-		mtx_lock(&be_lun->lock);
+		mtx_lock(&be_lun->io_lock);
 		beio->num_bios_sent++;
 		if (last && len == 0)
 			beio->send_complete = 1;
-		mtx_unlock(&be_lun->lock);
+		mtx_unlock(&be_lun->io_lock);
 
 		(*dev_data->csw->d_strategy)(bio);
 	}
@@ -828,7 +830,9 @@ ctl_be_block_unmap_dev(struct ctl_be_blo
 	DPRINTF("entered\n");
 
 	binuptime(&beio->ds_t0);
+	mtx_lock(&be_lun->io_lock);
 	devstat_start_transaction(be_lun->disk_stats, &beio->ds_t0);
+	mtx_unlock(&be_lun->io_lock);
 
 	if (beio->io_offset == -1) {
 		beio->io_len = 0;
@@ -852,6 +856,7 @@ static void
 ctl_be_block_dispatch_dev(struct ctl_be_block_lun *be_lun,
 			  struct ctl_be_block_io *beio)
 {
+	TAILQ_HEAD(, bio) queue = TAILQ_HEAD_INITIALIZER(queue);
 	int i;
 	struct bio *bio;
 	struct ctl_be_block_devdata *dev_data;
@@ -872,14 +877,6 @@ ctl_be_block_dispatch_dev(struct ctl_be_
 		max_iosize = DFLTPHYS;
 
 	cur_offset = beio->io_offset;
-
-	/*
-	 * XXX KDM need to accurately reflect the number of I/Os outstanding
-	 * to a device.
-	 */
-	binuptime(&beio->ds_t0);
-	devstat_start_transaction(be_lun->disk_stats, &beio->ds_t0);
-
 	for (i = 0; i < beio->num_segs; i++) {
 		size_t cur_size;
 		uint8_t *cur_ptr;
@@ -907,32 +904,23 @@ ctl_be_block_dispatch_dev(struct ctl_be_
 			cur_ptr += bio->bio_length;
 			cur_size -= bio->bio_length;
 
-			/*
-			 * Make sure we set the complete bit just before we
-			 * issue the last bio so we don't wind up with a
-			 * race.
-			 *
-			 * Use the LUN mutex here instead of a combination
-			 * of atomic variables for simplicity.
-			 *
-			 * XXX KDM we could have a per-IO lock, but that
-			 * would cause additional per-IO setup and teardown
-			 * overhead.  Hopefully there won't be too much
-			 * contention on the LUN lock.
-			 */
-			mtx_lock(&be_lun->lock);
-
+			TAILQ_INSERT_TAIL(&queue, bio, bio_queue);
 			beio->num_bios_sent++;
-
-			if ((i == beio->num_segs - 1)
-			 && (cur_size == 0))
-				beio->send_complete = 1;
-
-			mtx_unlock(&be_lun->lock);
-
-			(*dev_data->csw->d_strategy)(bio);
 		}
 	}
+	binuptime(&beio->ds_t0);
+	mtx_lock(&be_lun->io_lock);
+	devstat_start_transaction(be_lun->disk_stats, &beio->ds_t0);
+	beio->send_complete = 1;
+	mtx_unlock(&be_lun->io_lock);
+
+	/*
+	 * Fire off all allocated requests!
+	 */
+	while ((bio = TAILQ_FIRST(&queue)) != NULL) {
+		TAILQ_REMOVE(&queue, bio, bio_queue);
+		(*dev_data->csw->d_strategy)(bio);
+	}
 }
 
 static void
@@ -1195,14 +1183,14 @@ ctl_be_block_next(struct ctl_be_block_io
 	io->io_hdr.status &= ~CTL_STATUS_MASK;
 	io->io_hdr.status |= CTL_STATUS_NONE;
 
-	mtx_lock(&be_lun->lock);
+	mtx_lock(&be_lun->queue_lock);
 	/*
 	 * XXX KDM make sure that links is okay to use at this point.
 	 * Otherwise, we either need to add another field to ctl_io_hdr,
 	 * or deal with resource allocation here.
 	 */
 	STAILQ_INSERT_TAIL(&be_lun->input_queue, &io->io_hdr, links);
-	mtx_unlock(&be_lun->lock);
+	mtx_unlock(&be_lun->queue_lock);
 
 	taskqueue_enqueue(be_lun->io_taskqueue, &be_lun->io_task);
 }
@@ -1350,7 +1338,7 @@ ctl_be_block_worker(void *context, int p
 
 	DPRINTF("entered\n");
 
-	mtx_lock(&be_lun->lock);
+	mtx_lock(&be_lun->queue_lock);
 	for (;;) {
 		io = (union ctl_io *)STAILQ_FIRST(&be_lun->datamove_queue);
 		if (io != NULL) {
@@ -1361,13 +1349,13 @@ ctl_be_block_worker(void *context, int p
 			STAILQ_REMOVE(&be_lun->datamove_queue, &io->io_hdr,
 				      ctl_io_hdr, links);
 
-			mtx_unlock(&be_lun->lock);
+			mtx_unlock(&be_lun->queue_lock);
 
 			beio = (struct ctl_be_block_io *)PRIV(io)->ptr;
 
 			be_lun->dispatch(be_lun, beio);
 
-			mtx_lock(&be_lun->lock);
+			mtx_lock(&be_lun->queue_lock);
 			continue;
 		}
 		io = (union ctl_io *)STAILQ_FIRST(&be_lun->config_write_queue);
@@ -1378,11 +1366,11 @@ ctl_be_block_worker(void *context, int p
 			STAILQ_REMOVE(&be_lun->config_write_queue, &io->io_hdr,
 				      ctl_io_hdr, links);
 
-			mtx_unlock(&be_lun->lock);
+			mtx_unlock(&be_lun->queue_lock);
 
 			ctl_be_block_cw_dispatch(be_lun, io);
 
-			mtx_lock(&be_lun->lock);
+			mtx_lock(&be_lun->queue_lock);
 			continue;
 		}
 		io = (union ctl_io *)STAILQ_FIRST(&be_lun->input_queue);
@@ -1391,7 +1379,7 @@ ctl_be_block_worker(void *context, int p
 
 			STAILQ_REMOVE(&be_lun->input_queue, &io->io_hdr,
 				      ctl_io_hdr, links);
-			mtx_unlock(&be_lun->lock);
+			mtx_unlock(&be_lun->queue_lock);
 
 			/*
 			 * We must drop the lock, since this routine and
@@ -1399,7 +1387,7 @@ ctl_be_block_worker(void *context, int p
 			 */
 			ctl_be_block_dispatch(be_lun, io);
 
-			mtx_lock(&be_lun->lock);
+			mtx_lock(&be_lun->queue_lock);
 			continue;
 		}
 
@@ -1409,7 +1397,7 @@ ctl_be_block_worker(void *context, int p
 		 */
 		break;
 	}
-	mtx_unlock(&be_lun->lock);
+	mtx_unlock(&be_lun->queue_lock);
 }
 
 /*
@@ -1437,14 +1425,14 @@ ctl_be_block_submit(union ctl_io *io)
 
 	PRIV(io)->len = 0;
 
-	mtx_lock(&be_lun->lock);
+	mtx_lock(&be_lun->queue_lock);
 	/*
 	 * XXX KDM make sure that links is okay to use at this point.
 	 * Otherwise, we either need to add another field to ctl_io_hdr,
 	 * or deal with resource allocation here.
 	 */
 	STAILQ_INSERT_TAIL(&be_lun->input_queue, &io->io_hdr, links);
-	mtx_unlock(&be_lun->lock);
+	mtx_unlock(&be_lun->queue_lock);
 	taskqueue_enqueue(be_lun->io_taskqueue, &be_lun->io_task);
 
 	return (CTL_RETVAL_COMPLETE);
@@ -1868,7 +1856,8 @@ ctl_be_block_create(struct ctl_be_block_
 	STAILQ_INIT(&be_lun->config_write_queue);
 	STAILQ_INIT(&be_lun->datamove_queue);
 	sprintf(be_lun->lunname, "cblk%d", softc->num_luns);
-	mtx_init(&be_lun->lock, be_lun->lunname, NULL, MTX_DEF);
+	mtx_init(&be_lun->io_lock, "cblk io lock", NULL, MTX_DEF);
+	mtx_init(&be_lun->queue_lock, "cblk queue lock", NULL, MTX_DEF);
 	ctl_init_opts(&be_lun->ctl_be_lun, req);
 
 	be_lun->lun_zone = uma_zcreate(be_lun->lunname, CTLBLK_MAX_SEG,
@@ -2115,7 +2104,8 @@ bailout_error:
 	if (be_lun->lun_zone != NULL)
 		uma_zdestroy(be_lun->lun_zone);
 	ctl_free_opts(&be_lun->ctl_be_lun);
-	mtx_destroy(&be_lun->lock);
+	mtx_destroy(&be_lun->queue_lock);
+	mtx_destroy(&be_lun->io_lock);
 	free(be_lun, M_CTLBLK);
 
 	return (retval);
@@ -2203,7 +2193,8 @@ ctl_be_block_rm(struct ctl_be_block_soft
 
 	ctl_free_opts(&be_lun->ctl_be_lun);
 	free(be_lun->dev_path, M_CTLBLK);
-
+	mtx_destroy(&be_lun->queue_lock);
+	mtx_destroy(&be_lun->io_lock);
 	free(be_lun, M_CTLBLK);
 
 	req->status = CTL_LUN_OK;
@@ -2450,10 +2441,10 @@ ctl_be_block_config_write(union ctl_io *
 		 * user asked to be synced out.  When they issue a sync
 		 * cache command, we'll sync out the whole thing.
 		 */
-		mtx_lock(&be_lun->lock);
+		mtx_lock(&be_lun->queue_lock);
 		STAILQ_INSERT_TAIL(&be_lun->config_write_queue, &io->io_hdr,
 				   links);
-		mtx_unlock(&be_lun->lock);
+		mtx_unlock(&be_lun->queue_lock);
 		taskqueue_enqueue(be_lun->io_taskqueue, &be_lun->io_task);
 		break;
 	case START_STOP_UNIT: {
@@ -2544,7 +2535,7 @@ ctl_be_block_init(void)
 	softc = &backend_block_softc;
 	retval = 0;
 
-	mtx_init(&softc->lock, "ctlblk", NULL, MTX_DEF);
+	mtx_init(&softc->lock, "ctlblock", NULL, MTX_DEF);
 	beio_zone = uma_zcreate("beio", sizeof(struct ctl_be_block_io),
 	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
 	STAILQ_INIT(&softc->disk_list);

Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_ramdisk.c	Wed Jun 25 17:34:04 2014	(r267876)
+++ head/sys/cam/ctl/ctl_backend_ramdisk.c	Wed Jun 25 17:54:36 2014	(r267877)
@@ -84,7 +84,7 @@ struct ctl_be_ramdisk_lun {
 	struct taskqueue *io_taskqueue;
 	struct task io_task;
 	STAILQ_HEAD(, ctl_io_hdr) cont_queue;
-	struct mtx lock;
+	struct mtx_padalign queue_lock;
 };
 
 struct ctl_be_ramdisk_softc {
@@ -150,7 +150,7 @@ ctl_backend_ramdisk_init(void)
 
 	memset(softc, 0, sizeof(*softc));
 
-	mtx_init(&softc->lock, "ramdisk", NULL, MTX_DEF);
+	mtx_init(&softc->lock, "ctlramdisk", NULL, MTX_DEF);
 
 	STAILQ_INIT(&softc->lun_list);
 	softc->rd_size = 1024 * 1024;
@@ -242,10 +242,10 @@ ctl_backend_ramdisk_move_done(union ctl_
 	 && ((io->io_hdr.flags & CTL_FLAG_ABORT) == 0)
 	 && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) {
 		if (io->io_hdr.ctl_private[CTL_PRIV_BACKEND].integer > 0) {
-			mtx_lock(&be_lun->lock);
+			mtx_lock(&be_lun->queue_lock);
 			STAILQ_INSERT_TAIL(&be_lun->cont_queue,
 			    &io->io_hdr, links);
-			mtx_unlock(&be_lun->lock);
+			mtx_unlock(&be_lun->queue_lock);
 			taskqueue_enqueue(be_lun->io_taskqueue,
 			    &be_lun->io_task);
 			return (0);
@@ -350,18 +350,18 @@ ctl_backend_ramdisk_worker(void *context
 	be_lun = (struct ctl_be_ramdisk_lun *)context;
 	softc = be_lun->softc;
 
-	mtx_lock(&be_lun->lock);
+	mtx_lock(&be_lun->queue_lock);
 	for (;;) {
 		io = (union ctl_io *)STAILQ_FIRST(&be_lun->cont_queue);
 		if (io != NULL) {
 			STAILQ_REMOVE(&be_lun->cont_queue, &io->io_hdr,
 				      ctl_io_hdr, links);
 
-			mtx_unlock(&be_lun->lock);
+			mtx_unlock(&be_lun->queue_lock);
 
 			ctl_backend_ramdisk_continue(io);
 
-			mtx_lock(&be_lun->lock);
+			mtx_lock(&be_lun->queue_lock);
 			continue;
 		}
 
@@ -371,7 +371,7 @@ ctl_backend_ramdisk_worker(void *context
 		 */
 		break;
 	}
-	mtx_unlock(&be_lun->lock);
+	mtx_unlock(&be_lun->queue_lock);
 }
 
 static int
@@ -506,7 +506,7 @@ ctl_backend_ramdisk_rm(struct ctl_be_ram
 		taskqueue_drain(be_lun->io_taskqueue, &be_lun->io_task);
 		taskqueue_free(be_lun->io_taskqueue);
 		ctl_free_opts(&be_lun->ctl_be_lun);
-		mtx_destroy(&be_lun->lock);
+		mtx_destroy(&be_lun->queue_lock);
 		free(be_lun, M_RAMDISK);
 	}
 
@@ -639,7 +639,7 @@ ctl_backend_ramdisk_create(struct ctl_be
 	}
 
 	STAILQ_INIT(&be_lun->cont_queue);
-	mtx_init(&be_lun->lock, "CTL ramdisk", NULL, MTX_DEF);
+	mtx_init(&be_lun->queue_lock, "cram queue lock", NULL, MTX_DEF);
 	TASK_INIT(&be_lun->io_task, /*priority*/0, ctl_backend_ramdisk_worker,
 	    be_lun);
 
@@ -722,7 +722,7 @@ bailout_error:
 			taskqueue_free(be_lun->io_taskqueue);
 		}
 		ctl_free_opts(&be_lun->ctl_be_lun);
-		mtx_destroy(&be_lun->lock);
+		mtx_destroy(&be_lun->queue_lock);
 		free(be_lun, M_RAMDISK);
 	}
 

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 20:30:48 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 28CE12AB;
 Wed, 25 Jun 2014 20:30:48 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 15A652213;
 Wed, 25 Jun 2014 20:30:48 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5PKUl6t023267;
 Wed, 25 Jun 2014 20:30:47 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PKUlT4023266;
 Wed, 25 Jun 2014 20:30:47 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201406252030.s5PKUlT4023266@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 25 Jun 2014 20:30:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267883 - head/sys/dev/acpica
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 20:30:48 -0000

Author: jhb
Date: Wed Jun 25 20:30:47 2014
New Revision: 267883
URL: http://svnweb.freebsd.org/changeset/base/267883

Log:
  Expand r261243 even further and ignore any I/O port resources assigned to
  PCI root bridges except for the one known-valid case on x86 where bridges
  claim the I/O port registers used for PCI config space access.
  
  Tested by:	Hilko Meyer 
  MFC after:	1 week

Modified:
  head/sys/dev/acpica/acpi.c

Modified: head/sys/dev/acpica/acpi.c
==============================================================================
--- head/sys/dev/acpica/acpi.c	Wed Jun 25 19:41:39 2014	(r267882)
+++ head/sys/dev/acpica/acpi.c	Wed Jun 25 20:30:47 2014	(r267883)
@@ -1196,15 +1196,24 @@ acpi_set_resource(device_t dev, device_t
 	return (0);
 
     /*
-     * Ignore memory resources for PCI root bridges.  Some BIOSes
+     * Ignore most resources for PCI root bridges.  Some BIOSes
      * incorrectly enumerate the memory ranges they decode as plain
-     * memory resources instead of as a ResourceProducer range.
+     * memory resources instead of as ResourceProducer ranges.  Other
+     * BIOSes incorrectly list system resource entries for I/O ranges
+     * under the PCI bridge.  Do allow the one known-correct case on
+     * x86 of a PCI bridge claiming the I/O ports used for PCI config
+     * access.
      */
-    if (type == SYS_RES_MEMORY) {
+    if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) {
 	if (ACPI_SUCCESS(AcpiGetObjectInfo(ad->ad_handle, &devinfo))) {
 	    if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) {
-		AcpiOsFree(devinfo);
-		return (0);
+#if defined(__i386__) || defined(__amd64__)
+		if (!(type == SYS_RES_IOPORT && start == CONF1_ADDR_PORT))
+#endif
+		{
+		    AcpiOsFree(devinfo);
+		    return (0);
+		}
 	    }
 	    AcpiOsFree(devinfo);
 	}

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 22:13:36 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 59B25F35;
 Wed, 25 Jun 2014 22:13:36 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3C6002B5F;
 Wed, 25 Jun 2014 22:13:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5PMDakp072982;
 Wed, 25 Jun 2014 22:13:36 GMT (envelope-from grehan@svn.freebsd.org)
Received: (from grehan@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PMDZtT072978;
 Wed, 25 Jun 2014 22:13:35 GMT (envelope-from grehan@svn.freebsd.org)
Message-Id: <201406252213.s5PMDZtT072978@svn.freebsd.org>
From: Peter Grehan 
Date: Wed, 25 Jun 2014 22:13:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267884 - head/sys/amd64/vmm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 22:13:36 -0000

Author: grehan
Date: Wed Jun 25 22:13:35 2014
New Revision: 267884
URL: http://svnweb.freebsd.org/changeset/base/267884

Log:
  Expose the amount of resident and wired memory from the guest's vmspace.
  
  This is different than the amount shown for the process e.g. by
  /usr/bin/top - that is the mappings faulted in by the mmap'd region
  of guest memory.
  
  The values can be fetched with bhyvectl
  
   # bhyvectl --get-stats --vm=myvm
   ...
   Resident memory                         	413749248
   Wired memory                            	0
   ...
  
  vmm_stat.[ch] -
   Modify the counter code in bhyve to allow direct setting of a counter
  as opposed to incrementing, and providing a callback to fetch a
  counter's value.
  
  Reviewed by:	neel

Modified:
  head/sys/amd64/vmm/vmm.c
  head/sys/amd64/vmm/vmm_stat.c
  head/sys/amd64/vmm/vmm_stat.h

Modified: head/sys/amd64/vmm/vmm.c
==============================================================================
--- head/sys/amd64/vmm/vmm.c	Wed Jun 25 20:30:47 2014	(r267883)
+++ head/sys/amd64/vmm/vmm.c	Wed Jun 25 22:13:35 2014	(r267884)
@@ -1992,3 +1992,34 @@ vm_segment_name(int seg)
 	    ("%s: invalid segment encoding %d", __func__, seg));
 	return (seg_names[seg]);
 }
+
+
+/*
+ * Return the amount of in-use and wired memory for the VM. Since
+ * these are global stats, only return the values with for vCPU 0
+ */
+VMM_STAT_DECLARE(VMM_MEM_RESIDENT);
+VMM_STAT_DECLARE(VMM_MEM_WIRED);
+
+static void
+vm_get_rescnt(struct vm *vm, int vcpu, struct vmm_stat_type *stat)
+{
+
+	if (vcpu == 0) {
+		vmm_stat_set(vm, vcpu, VMM_MEM_RESIDENT,
+	       	    PAGE_SIZE * vmspace_resident_count(vm->vmspace));
+	}	
+}
+
+static void
+vm_get_wiredcnt(struct vm *vm, int vcpu, struct vmm_stat_type *stat)
+{
+
+	if (vcpu == 0) {
+		vmm_stat_set(vm, vcpu, VMM_MEM_WIRED,
+	      	    PAGE_SIZE * pmap_wired_count(vmspace_pmap(vm->vmspace)));
+	}	
+}
+
+VMM_STAT_FUNC(VMM_MEM_RESIDENT, "Resident memory", vm_get_rescnt);
+VMM_STAT_FUNC(VMM_MEM_WIRED, "Wired memory", vm_get_wiredcnt);

Modified: head/sys/amd64/vmm/vmm_stat.c
==============================================================================
--- head/sys/amd64/vmm/vmm_stat.c	Wed Jun 25 20:30:47 2014	(r267883)
+++ head/sys/amd64/vmm/vmm_stat.c	Wed Jun 25 22:13:35 2014	(r267884)
@@ -83,12 +83,21 @@ vmm_stat_register(void *arg)
 int
 vmm_stat_copy(struct vm *vm, int vcpu, int *num_stats, uint64_t *buf)
 {
-	int i;
+	struct vmm_stat_type *vst;
 	uint64_t *stats;
+	int i;
 
 	if (vcpu < 0 || vcpu >= VM_MAXCPU)
 		return (EINVAL);
-		
+
+	/* Let stats functions update their counters */
+	for (i = 0; i < vst_num_types; i++) {
+		vst = vsttab[i];
+		if (vst->func != NULL)
+			(*vst->func)(vm, vcpu, vst);
+	}
+
+	/* Copy over the stats */
 	stats = vcpu_stats(vm, vcpu);
 	for (i = 0; i < vst_num_elems; i++)
 		buf[i] = stats[i];

Modified: head/sys/amd64/vmm/vmm_stat.h
==============================================================================
--- head/sys/amd64/vmm/vmm_stat.h	Wed Jun 25 20:30:47 2014	(r267883)
+++ head/sys/amd64/vmm/vmm_stat.h	Wed Jun 25 22:13:35 2014	(r267884)
@@ -42,21 +42,29 @@ enum vmm_stat_scope {
 	VMM_STAT_SCOPE_AMD,		/* AMD SVM specific statistic */
 };
 
+struct vmm_stat_type;
+typedef void (*vmm_stat_func_t)(struct vm *vm, int vcpu,
+    struct vmm_stat_type *stat);
+
 struct vmm_stat_type {
 	int	index;			/* position in the stats buffer */
 	int	nelems;			/* standalone or array */
 	const char *desc;		/* description of statistic */
+	vmm_stat_func_t func;
 	enum vmm_stat_scope scope;
 };
 
 void	vmm_stat_register(void *arg);
 
-#define	VMM_STAT_DEFINE(type, nelems, desc, scope)			\
+#define	VMM_STAT_FDEFINE(type, nelems, desc, func, scope)		\
 	struct vmm_stat_type type[1] = {				\
-		{ -1, nelems, desc, scope }				\
+		{ -1, nelems, desc, func, scope }			\
 	};								\
 	SYSINIT(type##_stat, SI_SUB_KLD, SI_ORDER_ANY, vmm_stat_register, type)
 
+#define VMM_STAT_DEFINE(type, nelems, desc, scope) 			\
+	VMM_STAT_FDEFINE(type, nelems, desc, NULL, scope)
+
 #define	VMM_STAT_DECLARE(type)						\
 	extern struct vmm_stat_type type[1]
 
@@ -67,6 +75,9 @@ void	vmm_stat_register(void *arg);
 #define	VMM_STAT_AMD(type, desc)	\
 	VMM_STAT_DEFINE(type, 1, desc, VMM_STAT_SCOPE_AMD)
 
+#define	VMM_STAT_FUNC(type, desc, func)	\
+	VMM_STAT_FDEFINE(type, 1, desc, func, VMM_STAT_SCOPE_ANY)
+
 #define	VMM_STAT_ARRAY(type, nelems, desc)	\
 	VMM_STAT_DEFINE(type, nelems, desc, VMM_STAT_SCOPE_ANY)
 
@@ -93,9 +104,22 @@ vmm_stat_array_incr(struct vm *vm, int v
 		stats[vst->index + statidx] += x;
 #endif
 }
-		   
 
 static void __inline
+vmm_stat_array_set(struct vm *vm, int vcpu, struct vmm_stat_type *vst,
+		   int statidx, uint64_t val)
+{
+#ifdef VMM_KEEP_STATS
+	uint64_t *stats;
+	
+	stats = vcpu_stats(vm, vcpu);
+
+	if (vst->index >= 0 && statidx < vst->nelems)
+		stats[vst->index + statidx] = val;
+#endif
+}
+		   
+static void __inline
 vmm_stat_incr(struct vm *vm, int vcpu, struct vmm_stat_type *vst, uint64_t x)
 {
 
@@ -104,6 +128,15 @@ vmm_stat_incr(struct vm *vm, int vcpu, s
 #endif
 }
 
+static void __inline
+vmm_stat_set(struct vm *vm, int vcpu, struct vmm_stat_type *vst, uint64_t val)
+{
+
+#ifdef VMM_KEEP_STATS
+	vmm_stat_array_set(vm, vcpu, vst, 0, val);
+#endif
+}
+
 VMM_STAT_DECLARE(VCPU_MIGRATIONS);
 VMM_STAT_DECLARE(VMEXIT_COUNT);
 VMM_STAT_DECLARE(VMEXIT_EXTINT);

From owner-svn-src-head@FreeBSD.ORG  Wed Jun 25 23:42:53 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C5F7F21F;
 Wed, 25 Jun 2014 23:42:53 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B2ECB22D9;
 Wed, 25 Jun 2014 23:42:53 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5PNgr1H014128;
 Wed, 25 Jun 2014 23:42:53 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5PNgrgg014127;
 Wed, 25 Jun 2014 23:42:53 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201406252342.s5PNgrgg014127@svn.freebsd.org>
From: Xin LI 
Date: Wed, 25 Jun 2014 23:42:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267886 - head/usr.bin/procstat
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 25 Jun 2014 23:42:53 -0000

Author: delphij
Date: Wed Jun 25 23:42:53 2014
New Revision: 267886
URL: http://svnweb.freebsd.org/changeset/base/267886

Log:
  Use correct length for buffer.
  
  Submitted by:	Sascha Wildner 
  MFC after:	2 weeks

Modified:
  head/usr.bin/procstat/procstat_files.c

Modified: head/usr.bin/procstat/procstat_files.c
==============================================================================
--- head/usr.bin/procstat/procstat_files.c	Wed Jun 25 22:59:12 2014	(r267885)
+++ head/usr.bin/procstat/procstat_files.c	Wed Jun 25 23:42:53 2014	(r267886)
@@ -114,7 +114,7 @@ addr_to_string(struct sockaddr_storage *
 			snprintf(buffer, buflen, "%s.%d", buffer2,
 			    ntohs(sin6->sin6_port));
 		else
-			strlcpy(buffer, "-", sizeof(buffer));
+			strlcpy(buffer, "-", buflen);
 		break;
 
 	default:

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 00:31:59 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 173A5752;
 Thu, 26 Jun 2014 00:31:59 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 042162692;
 Thu, 26 Jun 2014 00:31:59 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5Q0VwO6037610;
 Thu, 26 Jun 2014 00:31:58 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5Q0VwBn037609;
 Thu, 26 Jun 2014 00:31:58 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201406260031.s5Q0VwBn037609@svn.freebsd.org>
From: Xin LI 
Date: Thu, 26 Jun 2014 00:31:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267887 - head/usr.bin/gzip
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 00:31:59 -0000

Author: delphij
Date: Thu Jun 26 00:31:58 2014
New Revision: 267887
URL: http://svnweb.freebsd.org/changeset/base/267887

Log:
  Correct buffer size.
  
  Submitted by:	Sascha Wildner 
  MFC after:	2 weeks

Modified:
  head/usr.bin/gzip/zuncompress.c

Modified: head/usr.bin/gzip/zuncompress.c
==============================================================================
--- head/usr.bin/gzip/zuncompress.c	Wed Jun 25 23:42:53 2014	(r267886)
+++ head/usr.bin/gzip/zuncompress.c	Thu Jun 26 00:31:58 2014	(r267887)
@@ -145,7 +145,7 @@ zuncompress(FILE *in, FILE *out, char *p
 	else
 		compressed_pre = NULL;
 
-	while ((bin = fread(buf, 1, sizeof(buf), in)) != 0) {
+	while ((bin = fread(buf, 1, BUFSIZE, in)) != 0) {
 		if (tflag == 0 && (off_t)fwrite(buf, 1, bin, out) != bin) {
 			free(buf);
 			return -1;

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 02:49:52 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B55C58B1;
 Thu, 26 Jun 2014 02:49:52 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 88B872205;
 Thu, 26 Jun 2014 02:49:52 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5Q2nqcE097013;
 Thu, 26 Jun 2014 02:49:52 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5Q2nqMG097010;
 Thu, 26 Jun 2014 02:49:52 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201406260249.s5Q2nqMG097010@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 26 Jun 2014 02:49:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267891 - head/sys/netinet
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 02:49:52 -0000

Author: adrian
Date: Thu Jun 26 02:49:51 2014
New Revision: 267891
URL: http://svnweb.freebsd.org/changeset/base/267891

Log:
  Add another RSS method to query the indirection table entries.
  
  There's 128 indirection table entries which correspond to the
  low 7 bits of the 32 bit RSS hash.  Each value will correspond
  to an RSS bucket.  (Then each RSS bucket currently will map
  to a CPU.)
  
  This is a more explicit way of figuring out which RSS bucket
  is in each RSS indirection slot.  It can be inferred by the other
  methods but I'd rather drivers use something more simplified and
  explicit.

Modified:
  head/sys/netinet/in_rss.c
  head/sys/netinet/in_rss.h

Modified: head/sys/netinet/in_rss.c
==============================================================================
--- head/sys/netinet/in_rss.c	Thu Jun 26 02:39:17 2014	(r267890)
+++ head/sys/netinet/in_rss.c	Thu Jun 26 02:49:51 2014	(r267891)
@@ -400,6 +400,26 @@ rss_getbucket(u_int hash)
 }
 
 /*
+ * Query the RSS layer bucket associated with the given
+ * entry in the RSS hash space.
+ *
+ * The RSS indirection table is 0 .. rss_buckets-1,
+ * covering the low 'rss_bits' of the total 128 slot
+ * RSS indirection table.  So just mask off rss_bits and
+ * return that.
+ *
+ * NIC drivers can then iterate over the 128 slot RSS
+ * indirection table and fetch which RSS bucket to
+ * map it to.  This will typically be a CPU queue
+ */
+u_int
+rss_get_indirection_to_bucket(u_int index)
+{
+
+	return (index & rss_mask);
+}
+
+/*
  * Query the RSS CPU associated with an RSS bucket.
  */
 u_int

Modified: head/sys/netinet/in_rss.h
==============================================================================
--- head/sys/netinet/in_rss.h	Thu Jun 26 02:39:17 2014	(r267890)
+++ head/sys/netinet/in_rss.h	Thu Jun 26 02:49:51 2014	(r267891)
@@ -69,6 +69,7 @@
  */
 u_int	rss_getbits(void);
 u_int	rss_getbucket(u_int hash);
+u_int	rss_get_indirection_to_bucket(u_int index);
 u_int	rss_getcpu(u_int bucket);
 void	rss_getkey(uint8_t *key);
 u_int	rss_gethashalgo(void);

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 04:12:42 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 12FDD75E;
 Thu, 26 Jun 2014 04:12:42 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D949B293F;
 Thu, 26 Jun 2014 04:12:41 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5Q4CfEK038165;
 Thu, 26 Jun 2014 04:12:41 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5Q4CfXU038163;
 Thu, 26 Jun 2014 04:12:41 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201406260412.s5Q4CfXU038163@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 26 Jun 2014 04:12:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267895 - head/sys/netinet
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 04:12:42 -0000

Author: adrian
Date: Thu Jun 26 04:12:41 2014
New Revision: 267895
URL: http://svnweb.freebsd.org/changeset/base/267895

Log:
  Retire IP_RSSCPUID ; the right thing to do is query the RSS bucket;
  map the bucket to an RSS queue, then map the queue to a CPU ID.
  This way the bucket->queue and queue->CPU mapping can change
  over time.
  
  Introduce IP_RSSBUCKETID - which instead looks up the RSS bucket.
  User applications can then map the RSS bucket to a CPU.

Modified:
  head/sys/netinet/in.h
  head/sys/netinet/ip_output.c

Modified: head/sys/netinet/in.h
==============================================================================
--- head/sys/netinet/in.h	Thu Jun 26 04:04:53 2014	(r267894)
+++ head/sys/netinet/in.h	Thu Jun 26 04:12:41 2014	(r267895)
@@ -468,9 +468,10 @@ __END_DECLS
 #define	IP_MINTTL		66   /* minimum TTL for packet or drop */
 #define	IP_DONTFRAG		67   /* don't fragment packet */
 #define	IP_RECVTOS		68   /* bool; receive IP TOS w/dgram */
-#define	IP_FLOWID		69   /* flow id for the given socket/inp */
-#define	IP_FLOWTYPE		70   /* flow type (M_HASHTYPE) */
-#define	IP_RSSCPUID		71   /* RSS flowid -> CPU id mapping */
+#define	IP_FLOWID		69   /* get flow id for the given socket/inp */
+#define	IP_FLOWTYPE		70   /* get flow type (M_HASHTYPE) */
+/* 71 - XXX was IP_RSSCPUID - can recycle whenever */
+#define	IP_RSSBUCKETID		72   /* get RSS flowid -> bucket mapping */
 
 /* IPv4 Source Filter Multicast API [RFC3678] */
 #define	IP_ADD_SOURCE_MEMBERSHIP	70   /* join a source-specific group */

Modified: head/sys/netinet/ip_output.c
==============================================================================
--- head/sys/netinet/ip_output.c	Thu Jun 26 04:04:53 2014	(r267894)
+++ head/sys/netinet/ip_output.c	Thu Jun 26 04:12:41 2014	(r267895)
@@ -1244,9 +1244,14 @@ ip_ctloutput(struct socket *so, struct s
 				optval = inp->inp_flowtype;
 				break;
 #ifdef	RSS
-			case IP_RSSCPUID:
-				optval = rss_hash2cpuid(inp->inp_flowid,
-				    inp->inp_flowtype);
+			case IP_RSSBUCKETID:
+				retval = rss_hash2bucket(inp->inp_flowid,
+				    inp->inp_flowtype,
+				    &rss_bucket);
+				if (retval == 0)
+					optval = rss_bucket;
+				else
+					error = EINVAL;
 				break;
 #endif
 			}

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 05:23:49 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id ACF19CDA;
 Thu, 26 Jun 2014 05:23:49 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9A3A32E3B;
 Thu, 26 Jun 2014 05:23:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5Q5NnA8069181;
 Thu, 26 Jun 2014 05:23:49 GMT (envelope-from davide@svn.freebsd.org)
Received: (from davide@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5Q5NnuP069180;
 Thu, 26 Jun 2014 05:23:49 GMT (envelope-from davide@svn.freebsd.org)
Message-Id: <201406260523.s5Q5NnuP069180@svn.freebsd.org>
From: Davide Italiano 
Date: Thu, 26 Jun 2014 05:23:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267896 - head/sys/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 05:23:49 -0000

Author: davide
Date: Thu Jun 26 05:23:48 2014
New Revision: 267896
URL: http://svnweb.freebsd.org/changeset/base/267896

Log:
  Improve r264388 removing namespace pollution previously introduced in
  . INT64_MAX actually requires __INT64_C() hack to get the
  type right on exotic architectures (e.g. on ones with 63-bit ints or long
  0x7fffffffffffffff is unsigned int or long). The hardcoded LL suffix is
  good enough to avoid these problems for SBT_MAX (it makes the type always
  signed long long, without overflow since long long has at least 64 bits).
  Many thanks to Bruce Evans for the time spent me to explain this.
  
  Reported by:	bde
  Reviewed by:	bde

Modified:
  head/sys/sys/time.h

Modified: head/sys/sys/time.h
==============================================================================
--- head/sys/sys/time.h	Thu Jun 26 04:12:41 2014	(r267895)
+++ head/sys/sys/time.h	Thu Jun 26 05:23:48 2014	(r267896)
@@ -129,7 +129,7 @@ bintime_shift(struct bintime *_bt, int _
 #define	SBT_1MS	(SBT_1S / 1000)
 #define	SBT_1US	(SBT_1S / 1000000)
 #define	SBT_1NS	(SBT_1S / 1000000000)
-#define	SBT_MAX	INT64_MAX
+#define	SBT_MAX	0x7fffffffffffffffLL
 
 static __inline int
 sbintime_getsec(sbintime_t _sbt)

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 06:03:40 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9DF17335;
 Thu, 26 Jun 2014 06:03:40 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 873B5217B;
 Thu, 26 Jun 2014 06:03:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5Q63evs086788;
 Thu, 26 Jun 2014 06:03:40 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5Q63e0a086784;
 Thu, 26 Jun 2014 06:03:40 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201406260603.s5Q63e0a086784@svn.freebsd.org>
From: Xin LI 
Date: Thu, 26 Jun 2014 06:03:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267897 - in head: contrib/file contrib/file/Magdir
 contrib/file/doc contrib/file/m4 contrib/file/magic contrib/file/python
 contrib/file/src contrib/file/tests lib/libmagic usr.bin/file
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 06:03:40 -0000

Author: delphij
Date: Thu Jun 26 06:03:39 2014
New Revision: 267897
URL: http://svnweb.freebsd.org/changeset/base/267897

Log:
  MFV r267843: update file/libmagic to 5.19.
  
  MFC after:	2 weeks

Added:
  head/contrib/file/config.guess
     - copied unchanged from r267843, vendor/file/dist/config.guess
  head/contrib/file/config.sub
     - copied unchanged from r267843, vendor/file/dist/config.sub
  head/contrib/file/depcomp
     - copied unchanged from r267843, vendor/file/dist/depcomp
  head/contrib/file/doc/
     - copied from r267843, vendor/file/dist/doc/
  head/contrib/file/ltmain.sh
     - copied unchanged from r267843, vendor/file/dist/ltmain.sh
  head/contrib/file/m4/
     - copied from r267843, vendor/file/dist/m4/
  head/contrib/file/magic/
     - copied from r267843, vendor/file/dist/magic/
  head/contrib/file/missing
     - copied unchanged from r267843, vendor/file/dist/missing
  head/contrib/file/python/
     - copied from r267843, vendor/file/dist/python/
  head/contrib/file/src/
     - copied from r267843, vendor/file/dist/src/
  head/contrib/file/tests/escapevel.result
     - copied unchanged from r267843, vendor/file/dist/tests/escapevel.result
  head/contrib/file/tests/escapevel.testfile
     - copied unchanged from r267843, vendor/file/dist/tests/escapevel.testfile
  head/contrib/file/tests/issue311docx.result
     - copied unchanged from r267843, vendor/file/dist/tests/issue311docx.result
  head/contrib/file/tests/issue311docx.testfile
     - copied unchanged from r267843, vendor/file/dist/tests/issue311docx.testfile
Deleted:
  head/contrib/file/Header
  head/contrib/file/Localstuff
  head/contrib/file/Magdir/
  head/contrib/file/Makefile.am-src
  head/contrib/file/apprentice.c
  head/contrib/file/apptype.c
  head/contrib/file/ascmagic.c
  head/contrib/file/asprintf.c
  head/contrib/file/cdf.c
  head/contrib/file/cdf.h
  head/contrib/file/cdf_time.c
  head/contrib/file/compress.c
  head/contrib/file/elfclass.h
  head/contrib/file/encoding.c
  head/contrib/file/file.c
  head/contrib/file/file.h
  head/contrib/file/file.man
  head/contrib/file/file_opts.h
  head/contrib/file/fsmagic.c
  head/contrib/file/funcs.c
  head/contrib/file/getline.c
  head/contrib/file/getopt_long.c
  head/contrib/file/is_tar.c
  head/contrib/file/libmagic.man
  head/contrib/file/magic.c
  head/contrib/file/magic.h
  head/contrib/file/magic.man
  head/contrib/file/magic2mime
  head/contrib/file/mygetopt.h
  head/contrib/file/names.h
  head/contrib/file/print.c
  head/contrib/file/readcdf.c
  head/contrib/file/readelf.c
  head/contrib/file/readelf.h
  head/contrib/file/softmagic.c
  head/contrib/file/strlcat.c
  head/contrib/file/strlcpy.c
  head/contrib/file/tar.h
  head/contrib/file/tests/gedcom.magic
  head/contrib/file/vasprintf.c
Modified:
  head/contrib/file/ChangeLog
  head/contrib/file/Makefile.am
  head/contrib/file/Makefile.in
  head/contrib/file/README
  head/contrib/file/TODO
  head/contrib/file/aclocal.m4
  head/contrib/file/compile
  head/contrib/file/config.h.in
  head/contrib/file/configure
  head/contrib/file/configure.ac
  head/contrib/file/install-sh
  head/contrib/file/src/apprentice.c
  head/contrib/file/tests/Makefile.am
  head/contrib/file/tests/Makefile.in
  head/contrib/file/tests/README
  head/contrib/file/tests/gedcom.result
  head/lib/libmagic/Makefile
  head/lib/libmagic/config.h
  head/usr.bin/file/Makefile
Directory Properties:
  head/contrib/file/   (props changed)

Modified: head/contrib/file/ChangeLog
==============================================================================
--- head/contrib/file/ChangeLog	Thu Jun 26 05:23:48 2014	(r267896)
+++ head/contrib/file/ChangeLog	Thu Jun 26 06:03:39 2014	(r267897)
@@ -1,3 +1,245 @@
+2014-06-12  12:28  Christos Zoulas 
+
+	* release 5.19
+
+2014-06-09   9:04  Christos Zoulas 
+	
+	* Misc buffer overruns and missing buffer size tests in cdf parsing
+	  (Francisco Alonso, Jan Kaluza)
+
+2014-06-02  14:50  Christos Zoulas 
+
+	* Enforce limit of 8K on regex searches that have no limits
+	* Allow the l modifier for regex to mean line count. Default
+	  to byte count. If line count is specified, assume a max
+	  of 80 characters per line to limit the byte count.
+	* Don't allow conversions to be used for dates, allowing
+	  the mask field to be used as an offset.
+
+2014-05-30  12:51  Christos Zoulas 
+
+	* Make the range operator limit the length of the
+	  regex search.
+
+2014-05-14  19:23  Christos Zoulas 
+
+	* PR/347: Windows fixes
+	* PR/352: Hangul word processor recognition
+	* PR/354: Encoding irregularities in text files
+
+2014-05-06  6:12  Christos Zoulas 
+
+	* Fix uninitialized title in CDF files (Jan Kaluza)
+
+2014-05-04  14:55  Christos Zoulas 
+
+	* PR/351: Fix compilation of empty files 
+
+2014-04-30  17:39  Christos Zoulas 
+
+	* Fix integer formats: We don't specify 'l' or
+	  'h' and 'hh' specifiers anymore, only 'll' for
+	  quads and nothing for the rest. This is so that
+	  magic writing is simpler.
+
+2014-04-01  15:25  Christos Zoulas 
+
+	* PR/341: Jan Kaluza, fix memory leak
+	* PR/342: Jan Kaluza, fix out of bounds read
+
+2014-03-28  15:25  Christos Zoulas 
+
+	* Fix issue with long formats not matching fmtcheck
+
+2014-03-26  11:25  Christos Zoulas 
+
+	* release 5.18
+
+2014-03-15  17:45  Christos Zoulas 
+
+	* add fmtcheck(3) for those who don't have it
+
+2014-03-14  15:12  Christos Zoulas 
+
+	* prevent mime entries from being attached to magic
+	  entries with no descriptions
+
+	* adjust magic strength for regex type
+
+	* remove superfluous ascmagic with encoding test
+
+2014-03-06  12:01  Christos Zoulas 
+
+	* fix regression fix echo -ne "\012\013\014" | file -i -
+	  which printed "binary" instead of "application/octet-stream"
+
+	* add size_t overflow check for magic file size
+
+2014-02-27  16:01  Christos Zoulas 
+
+	* experimental support for matching with CFD CLSID
+
+2014-02-18  13:04  Kimmo Suominen (kimmo@suominen.com)
+
+	* Cache old LC_CTYPE locale before setting it to "C", so
+	  we can use it to restore LC_CTYPE instead of asking
+	  setlocale() to scan the environment variables.
+
+2014-02-12  18:21  Christos Zoulas 
+
+	* Count recursion levels through indirect magic
+
+2014-02-11  10:40  Christos Zoulas 
+
+	* Prevent infinite recursion on files with indirect offsets of 0
+
+2014-01-30  21:00  Christos Zoulas 
+
+	* Add -E flag that makes file print filesystem errors to stderr
+	  and exit.
+
+2014-01-08  17:20  Christos Zoulas 
+
+	* mime printing could print results from multiple magic entries
+	  if there were multiple matches.
+	* in some cases overflow was not detected when computing offsets
+	  in softmagic.
+
+2013-12-05  12:00  Christos Zoulas 
+
+	* use strcasestr() to for cdf strings
+	* reset to the "C" locale while doing regex operations, or case
+	  insensitive comparisons; this is provisional
+
+2013-11-19  20:10  Christos Zoulas 
+
+	* always leave magic file loaded, don't unload for magic_check, etc.
+	* fix default encoding to binary instead of unknown which broke recently
+	* handle empty and one byte files, less specially so that
+	  --mime-encoding does not break completely.
+		`
+2013-11-06  14:40  Christos Zoulas 
+
+	* fix erroneous non-zero exit code from non-existant file and message
+
+2013-10-29  14:25  Christos Zoulas 
+
+	* add CDF MSI file detection (Guy Helmer)
+
+2013-09-03  11:56  Christos Zoulas 
+
+	* Don't mix errors and regular output if there was an error
+	* in magic_descriptor() don't close the file and try to restore
+	  its position
+
+2013-05-30  17:25  Christos Zoulas 
+
+	* Don't treat magic as an error if offset was past EOF (Christoph Biedl)
+
+2013-05-28  17:25  Christos Zoulas 
+	
+	* Fix spacing issues in softmagic and elf (Jan Kaluza)
+
+2013-05-02  18:00  Christos Zoulas 
+
+	* Fix segmentation fault with multiple magic_load commands.
+
+2013-04-22  11:20  Christos Zoulas 
+
+	* The way "default" was implemented was not very useful
+	  because the "if something was printed at that level"
+	  was not easily controlled by the user, and the format
+	  was bound to a string which is too restrictive. Add
+	  a "clear" for that level keyword and make "default"
+	  void. This way one can do:
+
+		>>13	clear	x
+		>>13	lelong	1	foo
+		>>13	lelong	2	bar
+		>>13	default	x
+		>>>13	lelong	x	unknown %x
+
+2013-03-25  13:20  Christos Zoulas 
+
+	* disallow strength setting in "name" entries
+
+2013-03-06  21:24  Christos Zoulas 
+
+	* fix recursive magic separator printing
+
+2013-02-26  19:28  Christos Zoulas 
+
+	* limit recursion level for mget
+	* fix pread() related breakage in cdf
+	* handle offsets properly in recursive "use"
+
+2013-02-18  10:39  Christos Zoulas 
+
+	* add elf reading of debug info to determine if file is stripped
+	  (Jan Kaluza)
+	* use pread()
+
+2013-01-25  18:05  Christos Zoulas 
+
+	* change mime description size from 64 to 80 to accommodate OOXML.
+
+2013-01-11  14:50  Christos Zoulas 
+
+	* Warn about inconsistent continuation levels.
+	* Change fsmagic to add a space after it prints.
+
+2013-01-10  21:00  Christos Zoulas 
+
+	* Make getline public so that file can link against it.
+	  Perhaps it is better to rename it, or hide it differently.
+	  Fixes builds on platforms that do not provide it.
+	  
+2013-01-07  16:30  Christos Zoulas 
+
+	* Add SuS d{,1,2,4,8}, u{,1,2,4,8} and document
+	  what long, int, short, etc is (Guy Harris)
+
+2013-01-06  11:20  Christos Zoulas 
+
+	* add magic_version function and constant
+	* Redo memory allocation and de-allocation.
+	  (prevents double frees on non mmap platforms)
+	* Fix bug with name/use having to do with passing
+	  found state from the parent to the child and back.
+
+2012-12-19   8:47  Christos Zoulas 
+
+	* Only print elf capabilities for archs we know (Jan Kaluza)
+
+2012-10-30  19:14  Christos Zoulas 
+
+	* Add "name" and "use" file types in order to look
+	  inside mach-o files.
+
+2012-09-06  10:40  Christos Zoulas 
+
+	* make --version exit 0 (Matthew Schultz)
+	* add string/T (Jan Kaluza)
+
+2012-08-09  2:15  Christos Zoulas 
+
+	* add z and t modifiers for our own vasprintf
+	* search for $HOME/.magic.mgc if it is there first
+	* fix reads from a pipe, and preserve errno
+
+2012-05-15  13:12  Christos Zoulas 
+
+	* use ctime_r, asctime_r
+
+2012-04-06  17:18  Christos Zoulas 
+
+	* Fixes for indirect offsets to handle apple disk formats
+
+2012-04-03  18:26  Christos Zoulas 
+
+	* Add windows date field types
+	* More info for windows shortcuts (incomplete)
+
 2012-02-20  17:33  Christos Zoulas 
 
 	* Fix CDF parsing issues found by CERT's fuzzing tool (Will Dormann)
@@ -851,7 +1093,7 @@
 
 	* Identify gnu tar vs. posix tar
 
-	* When keep going, don't print spurious newlines (Radek Vokál)
+	* When keep going, don't print spurious newlines (Radek Vokal)
 
 2006-04-01 12:02 Christos Zoulas 
 
@@ -875,7 +1117,7 @@
 2005-10-31 8:54 Christos Zoulas 
 
 	* Fix regression where the core info was not completely processed
-	    (Radek Vokál)
+	    (Radek Vokal)
 
 2005-10-20 11:15 Christos Zoulas 
 
@@ -892,7 +1134,7 @@
 2005-09-20 13:33 Christos Zoulas 
 
 	* Don't print SVR4 Style in core files multiple times
-	    (Radek Vokál)
+	    (Radek Vokal)
 
 2005-08-27 04:09 Christos Zoulas 
 

Modified: head/contrib/file/Makefile.am
==============================================================================
--- head/contrib/file/Makefile.am	Thu Jun 26 05:23:48 2014	(r267896)
+++ head/contrib/file/Makefile.am	Thu Jun 26 06:03:39 2014	(r267897)
@@ -1,280 +1,5 @@
-#
-# $File: Makefile.am,v 1.78 2012/01/27 01:41:26 christos Exp $
-#
-MAGIC_FRAGMENT_BASE = Magdir
-MAGIC_DIR = $(top_srcdir)/magic
-MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE)
+ACLOCAL_AMFLAGS = -I m4
 
-pkgdata_DATA = magic.mgc
+EXTRA_DIST = MAINT
 
-EXTRA_DIST = \
-$(MAGIC_DIR)/Header \
-$(MAGIC_DIR)/Localstuff \
-$(MAGIC_FRAGMENT_DIR)/acorn \
-$(MAGIC_FRAGMENT_DIR)/adi \
-$(MAGIC_FRAGMENT_DIR)/adventure \
-$(MAGIC_FRAGMENT_DIR)/allegro \
-$(MAGIC_FRAGMENT_DIR)/alliant \
-$(MAGIC_FRAGMENT_DIR)/amanda \
-$(MAGIC_FRAGMENT_DIR)/amigaos \
-$(MAGIC_FRAGMENT_DIR)/animation \
-$(MAGIC_FRAGMENT_DIR)/apl \
-$(MAGIC_FRAGMENT_DIR)/apple \
-$(MAGIC_FRAGMENT_DIR)/applix \
-$(MAGIC_FRAGMENT_DIR)/archive \
-$(MAGIC_FRAGMENT_DIR)/assembler \
-$(MAGIC_FRAGMENT_DIR)/asterix \
-$(MAGIC_FRAGMENT_DIR)/att3b \
-$(MAGIC_FRAGMENT_DIR)/audio \
-$(MAGIC_FRAGMENT_DIR)/basis \
-$(MAGIC_FRAGMENT_DIR)/bflt \
-$(MAGIC_FRAGMENT_DIR)/blcr \
-$(MAGIC_FRAGMENT_DIR)/blender \
-$(MAGIC_FRAGMENT_DIR)/blit \
-$(MAGIC_FRAGMENT_DIR)/bout \
-$(MAGIC_FRAGMENT_DIR)/bsdi \
-$(MAGIC_FRAGMENT_DIR)/bsi \
-$(MAGIC_FRAGMENT_DIR)/btsnoop \
-$(MAGIC_FRAGMENT_DIR)/c-lang \
-$(MAGIC_FRAGMENT_DIR)/c64 \
-$(MAGIC_FRAGMENT_DIR)/cad \
-$(MAGIC_FRAGMENT_DIR)/cafebabe \
-$(MAGIC_FRAGMENT_DIR)/cddb \
-$(MAGIC_FRAGMENT_DIR)/chord \
-$(MAGIC_FRAGMENT_DIR)/cisco \
-$(MAGIC_FRAGMENT_DIR)/citrus \
-$(MAGIC_FRAGMENT_DIR)/clarion \
-$(MAGIC_FRAGMENT_DIR)/claris \
-$(MAGIC_FRAGMENT_DIR)/clipper \
-$(MAGIC_FRAGMENT_DIR)/commands \
-$(MAGIC_FRAGMENT_DIR)/communications \
-$(MAGIC_FRAGMENT_DIR)/compress \
-$(MAGIC_FRAGMENT_DIR)/console \
-$(MAGIC_FRAGMENT_DIR)/convex \
-$(MAGIC_FRAGMENT_DIR)/cracklib \
-$(MAGIC_FRAGMENT_DIR)/ctags \
-$(MAGIC_FRAGMENT_DIR)/cups \
-$(MAGIC_FRAGMENT_DIR)/dact \
-$(MAGIC_FRAGMENT_DIR)/database \
-$(MAGIC_FRAGMENT_DIR)/diamond \
-$(MAGIC_FRAGMENT_DIR)/diff \
-$(MAGIC_FRAGMENT_DIR)/digital \
-$(MAGIC_FRAGMENT_DIR)/dolby \
-$(MAGIC_FRAGMENT_DIR)/dump \
-$(MAGIC_FRAGMENT_DIR)/dyadic \
-$(MAGIC_FRAGMENT_DIR)/ebml \
-$(MAGIC_FRAGMENT_DIR)/editors \
-$(MAGIC_FRAGMENT_DIR)/efi \
-$(MAGIC_FRAGMENT_DIR)/elf \
-$(MAGIC_FRAGMENT_DIR)/encore \
-$(MAGIC_FRAGMENT_DIR)/epoc \
-$(MAGIC_FRAGMENT_DIR)/erlang \
-$(MAGIC_FRAGMENT_DIR)/esri \
-$(MAGIC_FRAGMENT_DIR)/fcs \
-$(MAGIC_FRAGMENT_DIR)/filesystems \
-$(MAGIC_FRAGMENT_DIR)/flash \
-$(MAGIC_FRAGMENT_DIR)/fonts \
-$(MAGIC_FRAGMENT_DIR)/fortran \
-$(MAGIC_FRAGMENT_DIR)/frame \
-$(MAGIC_FRAGMENT_DIR)/freebsd \
-$(MAGIC_FRAGMENT_DIR)/fsav \
-$(MAGIC_FRAGMENT_DIR)/fusecompress \
-$(MAGIC_FRAGMENT_DIR)/games \
-$(MAGIC_FRAGMENT_DIR)/gcc \
-$(MAGIC_FRAGMENT_DIR)/geo \
-$(MAGIC_FRAGMENT_DIR)/geos \
-$(MAGIC_FRAGMENT_DIR)/gimp \
-$(MAGIC_FRAGMENT_DIR)/gnome-keyring \
-$(MAGIC_FRAGMENT_DIR)/gnu \
-$(MAGIC_FRAGMENT_DIR)/gnumeric \
-$(MAGIC_FRAGMENT_DIR)/grace \
-$(MAGIC_FRAGMENT_DIR)/graphviz \
-$(MAGIC_FRAGMENT_DIR)/gringotts \
-$(MAGIC_FRAGMENT_DIR)/guile \
-$(MAGIC_FRAGMENT_DIR)/hitachi-sh \
-$(MAGIC_FRAGMENT_DIR)/hp \
-$(MAGIC_FRAGMENT_DIR)/human68k \
-$(MAGIC_FRAGMENT_DIR)/ibm370 \
-$(MAGIC_FRAGMENT_DIR)/ibm6000 \
-$(MAGIC_FRAGMENT_DIR)/iff \
-$(MAGIC_FRAGMENT_DIR)/images \
-$(MAGIC_FRAGMENT_DIR)/inform \
-$(MAGIC_FRAGMENT_DIR)/intel \
-$(MAGIC_FRAGMENT_DIR)/interleaf \
-$(MAGIC_FRAGMENT_DIR)/island \
-$(MAGIC_FRAGMENT_DIR)/ispell \
-$(MAGIC_FRAGMENT_DIR)/isz \
-$(MAGIC_FRAGMENT_DIR)/java \
-$(MAGIC_FRAGMENT_DIR)/jpeg \
-$(MAGIC_FRAGMENT_DIR)/karma \
-$(MAGIC_FRAGMENT_DIR)/kde \
-$(MAGIC_FRAGMENT_DIR)/kml \
-$(MAGIC_FRAGMENT_DIR)/lecter \
-$(MAGIC_FRAGMENT_DIR)/lex \
-$(MAGIC_FRAGMENT_DIR)/lif \
-$(MAGIC_FRAGMENT_DIR)/linux \
-$(MAGIC_FRAGMENT_DIR)/lisp \
-$(MAGIC_FRAGMENT_DIR)/llvm \
-$(MAGIC_FRAGMENT_DIR)/lua \
-$(MAGIC_FRAGMENT_DIR)/luks \
-$(MAGIC_FRAGMENT_DIR)/m4 \
-$(MAGIC_FRAGMENT_DIR)/mach \
-$(MAGIC_FRAGMENT_DIR)/macintosh \
-$(MAGIC_FRAGMENT_DIR)/magic \
-$(MAGIC_FRAGMENT_DIR)/mail.news \
-$(MAGIC_FRAGMENT_DIR)/make \
-$(MAGIC_FRAGMENT_DIR)/maple \
-$(MAGIC_FRAGMENT_DIR)/marc21 \
-$(MAGIC_FRAGMENT_DIR)/mathcad \
-$(MAGIC_FRAGMENT_DIR)/mathematica \
-$(MAGIC_FRAGMENT_DIR)/matroska \
-$(MAGIC_FRAGMENT_DIR)/mcrypt \
-$(MAGIC_FRAGMENT_DIR)/mercurial \
-$(MAGIC_FRAGMENT_DIR)/metastore \
-$(MAGIC_FRAGMENT_DIR)/mime \
-$(MAGIC_FRAGMENT_DIR)/mips \
-$(MAGIC_FRAGMENT_DIR)/mirage \
-$(MAGIC_FRAGMENT_DIR)/misctools \
-$(MAGIC_FRAGMENT_DIR)/mkid \
-$(MAGIC_FRAGMENT_DIR)/mlssa \
-$(MAGIC_FRAGMENT_DIR)/mmdf \
-$(MAGIC_FRAGMENT_DIR)/modem \
-$(MAGIC_FRAGMENT_DIR)/motorola \
-$(MAGIC_FRAGMENT_DIR)/mozilla \
-$(MAGIC_FRAGMENT_DIR)/msdos \
-$(MAGIC_FRAGMENT_DIR)/msooxml \
-$(MAGIC_FRAGMENT_DIR)/msvc \
-$(MAGIC_FRAGMENT_DIR)/mup \
-$(MAGIC_FRAGMENT_DIR)/music \
-$(MAGIC_FRAGMENT_DIR)/natinst \
-$(MAGIC_FRAGMENT_DIR)/ncr \
-$(MAGIC_FRAGMENT_DIR)/netbsd \
-$(MAGIC_FRAGMENT_DIR)/netscape \
-$(MAGIC_FRAGMENT_DIR)/netware \
-$(MAGIC_FRAGMENT_DIR)/news \
-$(MAGIC_FRAGMENT_DIR)/nitpicker \
-$(MAGIC_FRAGMENT_DIR)/oasis \
-$(MAGIC_FRAGMENT_DIR)/ocaml \
-$(MAGIC_FRAGMENT_DIR)/octave \
-$(MAGIC_FRAGMENT_DIR)/ole2compounddocs \
-$(MAGIC_FRAGMENT_DIR)/olf \
-$(MAGIC_FRAGMENT_DIR)/os2 \
-$(MAGIC_FRAGMENT_DIR)/os400 \
-$(MAGIC_FRAGMENT_DIR)/os9 \
-$(MAGIC_FRAGMENT_DIR)/osf1 \
-$(MAGIC_FRAGMENT_DIR)/palm \
-$(MAGIC_FRAGMENT_DIR)/parix \
-$(MAGIC_FRAGMENT_DIR)/parrot \
-$(MAGIC_FRAGMENT_DIR)/pascal \
-$(MAGIC_FRAGMENT_DIR)/pbm \
-$(MAGIC_FRAGMENT_DIR)/pdf \
-$(MAGIC_FRAGMENT_DIR)/pdp \
-$(MAGIC_FRAGMENT_DIR)/perl \
-$(MAGIC_FRAGMENT_DIR)/pgp \
-$(MAGIC_FRAGMENT_DIR)/pkgadd \
-$(MAGIC_FRAGMENT_DIR)/plan9 \
-$(MAGIC_FRAGMENT_DIR)/plus5 \
-$(MAGIC_FRAGMENT_DIR)/printer \
-$(MAGIC_FRAGMENT_DIR)/project \
-$(MAGIC_FRAGMENT_DIR)/psdbms \
-$(MAGIC_FRAGMENT_DIR)/pulsar \
-$(MAGIC_FRAGMENT_DIR)/pyramid \
-$(MAGIC_FRAGMENT_DIR)/python \
-$(MAGIC_FRAGMENT_DIR)/revision \
-$(MAGIC_FRAGMENT_DIR)/riff \
-$(MAGIC_FRAGMENT_DIR)/rinex \
-$(MAGIC_FRAGMENT_DIR)/rpm \
-$(MAGIC_FRAGMENT_DIR)/rtf \
-$(MAGIC_FRAGMENT_DIR)/ruby \
-$(MAGIC_FRAGMENT_DIR)/sc \
-$(MAGIC_FRAGMENT_DIR)/sccs \
-$(MAGIC_FRAGMENT_DIR)/scientific \
-$(MAGIC_FRAGMENT_DIR)/securitycerts \
-$(MAGIC_FRAGMENT_DIR)/selinux \
-$(MAGIC_FRAGMENT_DIR)/sendmail \
-$(MAGIC_FRAGMENT_DIR)/sequent \
-$(MAGIC_FRAGMENT_DIR)/sgi \
-$(MAGIC_FRAGMENT_DIR)/sgml \
-$(MAGIC_FRAGMENT_DIR)/sharc \
-$(MAGIC_FRAGMENT_DIR)/sinclair \
-$(MAGIC_FRAGMENT_DIR)/sisu \
-$(MAGIC_FRAGMENT_DIR)/sketch \
-$(MAGIC_FRAGMENT_DIR)/smalltalk \
-$(MAGIC_FRAGMENT_DIR)/smile \
-$(MAGIC_FRAGMENT_DIR)/sniffer \
-$(MAGIC_FRAGMENT_DIR)/softquad \
-$(MAGIC_FRAGMENT_DIR)/spec \
-$(MAGIC_FRAGMENT_DIR)/spectrum \
-$(MAGIC_FRAGMENT_DIR)/sql \
-$(MAGIC_FRAGMENT_DIR)/ssh \
-$(MAGIC_FRAGMENT_DIR)/ssl \
-$(MAGIC_FRAGMENT_DIR)/sun \
-$(MAGIC_FRAGMENT_DIR)/sysex \
-$(MAGIC_FRAGMENT_DIR)/tcl \
-$(MAGIC_FRAGMENT_DIR)/teapot \
-$(MAGIC_FRAGMENT_DIR)/terminfo \
-$(MAGIC_FRAGMENT_DIR)/tex \
-$(MAGIC_FRAGMENT_DIR)/tgif \
-$(MAGIC_FRAGMENT_DIR)/ti-8x \
-$(MAGIC_FRAGMENT_DIR)/timezone \
-$(MAGIC_FRAGMENT_DIR)/troff \
-$(MAGIC_FRAGMENT_DIR)/tuxedo \
-$(MAGIC_FRAGMENT_DIR)/typeset \
-$(MAGIC_FRAGMENT_DIR)/unicode \
-$(MAGIC_FRAGMENT_DIR)/unknown \
-$(MAGIC_FRAGMENT_DIR)/uuencode \
-$(MAGIC_FRAGMENT_DIR)/varied.out \
-$(MAGIC_FRAGMENT_DIR)/varied.script \
-$(MAGIC_FRAGMENT_DIR)/vax \
-$(MAGIC_FRAGMENT_DIR)/vicar \
-$(MAGIC_FRAGMENT_DIR)/virtual \
-$(MAGIC_FRAGMENT_DIR)/virtutech \
-$(MAGIC_FRAGMENT_DIR)/visx \
-$(MAGIC_FRAGMENT_DIR)/vms \
-$(MAGIC_FRAGMENT_DIR)/vmware \
-$(MAGIC_FRAGMENT_DIR)/vorbis \
-$(MAGIC_FRAGMENT_DIR)/vxl \
-$(MAGIC_FRAGMENT_DIR)/warc \
-$(MAGIC_FRAGMENT_DIR)/weak \
-$(MAGIC_FRAGMENT_DIR)/windows \
-$(MAGIC_FRAGMENT_DIR)/wireless \
-$(MAGIC_FRAGMENT_DIR)/wordprocessors \
-$(MAGIC_FRAGMENT_DIR)/wsdl \
-$(MAGIC_FRAGMENT_DIR)/xdelta \
-$(MAGIC_FRAGMENT_DIR)/xenix \
-$(MAGIC_FRAGMENT_DIR)/xilinx \
-$(MAGIC_FRAGMENT_DIR)/xo65 \
-$(MAGIC_FRAGMENT_DIR)/xwindows \
-$(MAGIC_FRAGMENT_DIR)/zfs \
-$(MAGIC_FRAGMENT_DIR)/zilog \
-$(MAGIC_FRAGMENT_DIR)/zyxel 
-
-MAGIC = magic.mgc
-CLEANFILES = ${MAGIC} $(MAGIC_FRAGMENT_DIR)/Localstuff
-
-# FIXME: Build file natively as well so that it can be used to compile
-# the target's magic file; for now we bail if the local version does not match
-if IS_CROSS_COMPILE
-FILE_COMPILE = file
-FILE_COMPILE_DEP =
-else
-FILE_COMPILE = $(top_builddir)/src/file
-FILE_COMPILE_DEP = $(FILE_COMPILE)
-endif
-
-${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP)
-	@rm -fr magic
-	@mkdir magic && cp -p $(EXTRA_DIST) magic
-	@(if expr "${FILE_COMPILE}" : '.*/.*' > /dev/null; then \
-	    echo "Using ${FILE_COMPILE} to generate ${MAGIC}" > /dev/null; \
-	  else \
-	    v=$$(file --version | sed -e s/file-// -e q); \
-	    if [ "$$v" != "${PACKAGE_VERSION}" ]; then \
-		echo "Cannot use the installed version of file ($$v) to"; \
-		echo "cross-compile file ${PACKAGE_VERSION}"; \
-		echo "Please install file ${PACKAGE_VERSION} locally first"; \
-		exit 1; \
-	    fi; \
-	  fi)
-	$(FILE_COMPILE) -C -m magic
-	@rm -fr magic
+SUBDIRS = src magic tests doc python

Modified: head/contrib/file/Makefile.in
==============================================================================
--- head/contrib/file/Makefile.in	Thu Jun 26 05:23:48 2014	(r267896)
+++ head/contrib/file/Makefile.in	Thu Jun 26 06:03:39 2014	(r267897)
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.14 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -14,8 +13,52 @@
 # PARTICULAR PURPOSE.
 
 @SET_MAKE@
-
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
 pkglibexecdir = $(libexecdir)/@PACKAGE@
@@ -33,8 +76,12 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-subdir = magic
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+subdir = .
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/configure $(am__configure_deps) \
+	$(srcdir)/config.h.in AUTHORS COPYING ChangeLog INSTALL NEWS \
+	README TODO compile config.guess config.sub depcomp install-sh \
+	missing ltmain.sh
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -42,42 +89,111 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/l
 	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_HEADER = config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
-am__v_GEN_0 = @echo "  GEN   " $@;
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
 am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkgdatadir)"
-DATA = $(pkgdata_DATA)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+	cscope distdir dist dist-all distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+	$(LISP)config.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+CSCOPE = cscope
+DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  if test -d "$(distdir)"; then \
+    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+      && rm -rf "$(distdir)" \
+      || { sleep 5 && rm -rf "$(distdir)"; }; \
+  else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
 pkgdatadir = @pkgdatadir@
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -90,11 +206,13 @@ AWK = @AWK@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -104,6 +222,7 @@ EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
 GREP = @GREP@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -118,6 +237,7 @@ LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MINGW = @MINGW@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
@@ -145,6 +265,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
@@ -178,7 +299,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -194,332 +314,181 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-
-#
-# $File: Makefile.am,v 1.78 2012/01/27 01:41:26 christos Exp $
-#
-MAGIC_FRAGMENT_BASE = Magdir
-MAGIC_DIR = $(top_srcdir)/magic
-MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE)
-pkgdata_DATA = magic.mgc
-EXTRA_DIST = \
-$(MAGIC_DIR)/Header \
-$(MAGIC_DIR)/Localstuff \
-$(MAGIC_FRAGMENT_DIR)/acorn \
-$(MAGIC_FRAGMENT_DIR)/adi \
-$(MAGIC_FRAGMENT_DIR)/adventure \
-$(MAGIC_FRAGMENT_DIR)/allegro \
-$(MAGIC_FRAGMENT_DIR)/alliant \
-$(MAGIC_FRAGMENT_DIR)/amanda \
-$(MAGIC_FRAGMENT_DIR)/amigaos \
-$(MAGIC_FRAGMENT_DIR)/animation \
-$(MAGIC_FRAGMENT_DIR)/apl \
-$(MAGIC_FRAGMENT_DIR)/apple \
-$(MAGIC_FRAGMENT_DIR)/applix \
-$(MAGIC_FRAGMENT_DIR)/archive \
-$(MAGIC_FRAGMENT_DIR)/assembler \
-$(MAGIC_FRAGMENT_DIR)/asterix \
-$(MAGIC_FRAGMENT_DIR)/att3b \
-$(MAGIC_FRAGMENT_DIR)/audio \
-$(MAGIC_FRAGMENT_DIR)/basis \
-$(MAGIC_FRAGMENT_DIR)/bflt \
-$(MAGIC_FRAGMENT_DIR)/blcr \
-$(MAGIC_FRAGMENT_DIR)/blender \
-$(MAGIC_FRAGMENT_DIR)/blit \
-$(MAGIC_FRAGMENT_DIR)/bout \
-$(MAGIC_FRAGMENT_DIR)/bsdi \
-$(MAGIC_FRAGMENT_DIR)/bsi \
-$(MAGIC_FRAGMENT_DIR)/btsnoop \
-$(MAGIC_FRAGMENT_DIR)/c-lang \
-$(MAGIC_FRAGMENT_DIR)/c64 \
-$(MAGIC_FRAGMENT_DIR)/cad \
-$(MAGIC_FRAGMENT_DIR)/cafebabe \
-$(MAGIC_FRAGMENT_DIR)/cddb \
-$(MAGIC_FRAGMENT_DIR)/chord \
-$(MAGIC_FRAGMENT_DIR)/cisco \
-$(MAGIC_FRAGMENT_DIR)/citrus \
-$(MAGIC_FRAGMENT_DIR)/clarion \
-$(MAGIC_FRAGMENT_DIR)/claris \
-$(MAGIC_FRAGMENT_DIR)/clipper \
-$(MAGIC_FRAGMENT_DIR)/commands \
-$(MAGIC_FRAGMENT_DIR)/communications \
-$(MAGIC_FRAGMENT_DIR)/compress \
-$(MAGIC_FRAGMENT_DIR)/console \
-$(MAGIC_FRAGMENT_DIR)/convex \
-$(MAGIC_FRAGMENT_DIR)/cracklib \
-$(MAGIC_FRAGMENT_DIR)/ctags \
-$(MAGIC_FRAGMENT_DIR)/cups \
-$(MAGIC_FRAGMENT_DIR)/dact \
-$(MAGIC_FRAGMENT_DIR)/database \
-$(MAGIC_FRAGMENT_DIR)/diamond \
-$(MAGIC_FRAGMENT_DIR)/diff \
-$(MAGIC_FRAGMENT_DIR)/digital \
-$(MAGIC_FRAGMENT_DIR)/dolby \
-$(MAGIC_FRAGMENT_DIR)/dump \
-$(MAGIC_FRAGMENT_DIR)/dyadic \
-$(MAGIC_FRAGMENT_DIR)/ebml \
-$(MAGIC_FRAGMENT_DIR)/editors \
-$(MAGIC_FRAGMENT_DIR)/efi \
-$(MAGIC_FRAGMENT_DIR)/elf \
-$(MAGIC_FRAGMENT_DIR)/encore \
-$(MAGIC_FRAGMENT_DIR)/epoc \
-$(MAGIC_FRAGMENT_DIR)/erlang \
-$(MAGIC_FRAGMENT_DIR)/esri \
-$(MAGIC_FRAGMENT_DIR)/fcs \
-$(MAGIC_FRAGMENT_DIR)/filesystems \
-$(MAGIC_FRAGMENT_DIR)/flash \
-$(MAGIC_FRAGMENT_DIR)/fonts \
-$(MAGIC_FRAGMENT_DIR)/fortran \
-$(MAGIC_FRAGMENT_DIR)/frame \
-$(MAGIC_FRAGMENT_DIR)/freebsd \
-$(MAGIC_FRAGMENT_DIR)/fsav \
-$(MAGIC_FRAGMENT_DIR)/fusecompress \
-$(MAGIC_FRAGMENT_DIR)/games \
-$(MAGIC_FRAGMENT_DIR)/gcc \
-$(MAGIC_FRAGMENT_DIR)/geo \
-$(MAGIC_FRAGMENT_DIR)/geos \
-$(MAGIC_FRAGMENT_DIR)/gimp \
-$(MAGIC_FRAGMENT_DIR)/gnome-keyring \
-$(MAGIC_FRAGMENT_DIR)/gnu \
-$(MAGIC_FRAGMENT_DIR)/gnumeric \
-$(MAGIC_FRAGMENT_DIR)/grace \
-$(MAGIC_FRAGMENT_DIR)/graphviz \
-$(MAGIC_FRAGMENT_DIR)/gringotts \
-$(MAGIC_FRAGMENT_DIR)/guile \
-$(MAGIC_FRAGMENT_DIR)/hitachi-sh \
-$(MAGIC_FRAGMENT_DIR)/hp \
-$(MAGIC_FRAGMENT_DIR)/human68k \
-$(MAGIC_FRAGMENT_DIR)/ibm370 \
-$(MAGIC_FRAGMENT_DIR)/ibm6000 \
-$(MAGIC_FRAGMENT_DIR)/iff \
-$(MAGIC_FRAGMENT_DIR)/images \
-$(MAGIC_FRAGMENT_DIR)/inform \
-$(MAGIC_FRAGMENT_DIR)/intel \
-$(MAGIC_FRAGMENT_DIR)/interleaf \
-$(MAGIC_FRAGMENT_DIR)/island \
-$(MAGIC_FRAGMENT_DIR)/ispell \
-$(MAGIC_FRAGMENT_DIR)/isz \
-$(MAGIC_FRAGMENT_DIR)/java \
-$(MAGIC_FRAGMENT_DIR)/jpeg \
-$(MAGIC_FRAGMENT_DIR)/karma \
-$(MAGIC_FRAGMENT_DIR)/kde \
-$(MAGIC_FRAGMENT_DIR)/kml \
-$(MAGIC_FRAGMENT_DIR)/lecter \
-$(MAGIC_FRAGMENT_DIR)/lex \
-$(MAGIC_FRAGMENT_DIR)/lif \
-$(MAGIC_FRAGMENT_DIR)/linux \
-$(MAGIC_FRAGMENT_DIR)/lisp \
-$(MAGIC_FRAGMENT_DIR)/llvm \
-$(MAGIC_FRAGMENT_DIR)/lua \
-$(MAGIC_FRAGMENT_DIR)/luks \
-$(MAGIC_FRAGMENT_DIR)/m4 \
-$(MAGIC_FRAGMENT_DIR)/mach \
-$(MAGIC_FRAGMENT_DIR)/macintosh \
-$(MAGIC_FRAGMENT_DIR)/magic \
-$(MAGIC_FRAGMENT_DIR)/mail.news \
-$(MAGIC_FRAGMENT_DIR)/make \
-$(MAGIC_FRAGMENT_DIR)/maple \
-$(MAGIC_FRAGMENT_DIR)/marc21 \
-$(MAGIC_FRAGMENT_DIR)/mathcad \
-$(MAGIC_FRAGMENT_DIR)/mathematica \
-$(MAGIC_FRAGMENT_DIR)/matroska \
-$(MAGIC_FRAGMENT_DIR)/mcrypt \
-$(MAGIC_FRAGMENT_DIR)/mercurial \
-$(MAGIC_FRAGMENT_DIR)/metastore \
-$(MAGIC_FRAGMENT_DIR)/mime \
-$(MAGIC_FRAGMENT_DIR)/mips \
-$(MAGIC_FRAGMENT_DIR)/mirage \
-$(MAGIC_FRAGMENT_DIR)/misctools \
-$(MAGIC_FRAGMENT_DIR)/mkid \
-$(MAGIC_FRAGMENT_DIR)/mlssa \
-$(MAGIC_FRAGMENT_DIR)/mmdf \
-$(MAGIC_FRAGMENT_DIR)/modem \
-$(MAGIC_FRAGMENT_DIR)/motorola \
-$(MAGIC_FRAGMENT_DIR)/mozilla \
-$(MAGIC_FRAGMENT_DIR)/msdos \
-$(MAGIC_FRAGMENT_DIR)/msooxml \
-$(MAGIC_FRAGMENT_DIR)/msvc \
-$(MAGIC_FRAGMENT_DIR)/mup \
-$(MAGIC_FRAGMENT_DIR)/music \
-$(MAGIC_FRAGMENT_DIR)/natinst \
-$(MAGIC_FRAGMENT_DIR)/ncr \
-$(MAGIC_FRAGMENT_DIR)/netbsd \
-$(MAGIC_FRAGMENT_DIR)/netscape \
-$(MAGIC_FRAGMENT_DIR)/netware \
-$(MAGIC_FRAGMENT_DIR)/news \
-$(MAGIC_FRAGMENT_DIR)/nitpicker \
-$(MAGIC_FRAGMENT_DIR)/oasis \
-$(MAGIC_FRAGMENT_DIR)/ocaml \
-$(MAGIC_FRAGMENT_DIR)/octave \
-$(MAGIC_FRAGMENT_DIR)/ole2compounddocs \
-$(MAGIC_FRAGMENT_DIR)/olf \
-$(MAGIC_FRAGMENT_DIR)/os2 \
-$(MAGIC_FRAGMENT_DIR)/os400 \
-$(MAGIC_FRAGMENT_DIR)/os9 \
-$(MAGIC_FRAGMENT_DIR)/osf1 \
-$(MAGIC_FRAGMENT_DIR)/palm \

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 07:06:46 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2391E9C9;
 Thu, 26 Jun 2014 07:06:46 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0D6AC2644;
 Thu, 26 Jun 2014 07:06:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5Q76jOm014236;
 Thu, 26 Jun 2014 07:06:45 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5Q76hYW014217;
 Thu, 26 Jun 2014 07:06:43 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201406260706.s5Q76hYW014217@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 26 Jun 2014 07:06:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267898 - in head:
 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs
 cddl/contrib/opensolaris/lib/libdtrace/common
 sys/cddl/contrib/opensolaris/uts/common/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 07:06:46 -0000

Author: rpaulo
Date: Thu Jun 26 07:06:43 2014
New Revision: 267898
URL: http://svnweb.freebsd.org/changeset/base/267898

Log:
  Bring the following change from the illumos-joyent repository:
  
  commit 78e24ab6803bbe11ba37642624e1498ede5b239d
  Author: Bryan Cantrill 
  Date:   Thu Oct 31 01:20:54 2013
  
      OS-1688 DTrace count() with histogram
      OS-2360 DTrace full width distribution histograms
      OS-2361 DTrace frequency trails
  
  MFC after:	2 weeks

Added:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out   (contents, props changed)
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out
Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,32 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc.  All rights reserved.
+ */
+
+#pragma D option quiet
+#pragma D option encoding=utf8
+#pragma D option aggzoom
+
+tick-1ms
+/i++ < 320/
+{
+	@ = lquantize(i, 0, 640, 1, i);
+	@ = lquantize(641 - i, 0, 640, 1, i);
+}
+
+tick-1ms
+/i == 320/
+{
+	printa(@);
+	exit(0);
+}

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out
==============================================================================
Binary file. No diff available.

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,46 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc.  All rights reserved.
+ */
+
+#pragma D option agghist
+#pragma D option quiet
+
+BEGIN
+{
+	@["demerit"] = sum(-10);
+	@["wtf"] = sum(10);
+	@["bot"] = sum(20);
+
+	@bagnoogle["SOAP/XML"] = sum(1);
+	@bagnoogle["XACML store"] = sum(5);
+	@bagnoogle["SAML token"] = sum(6);
+
+	@stalloogle["breakfast"] = sum(-5);
+	@stalloogle["non-diet pepsi"] = sum(-20);
+	@stalloogle["parrot"] = sum(-100);
+
+	printa(@);
+	printa(@bagnoogle);
+	printa(@stalloogle);
+
+	printf("\nzoomed:");
+
+	setopt("aggzoom");
+	printa(@);
+	printa(@bagnoogle);
+	printa(@stalloogle);
+
+	exit(0);
+}
+

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,38 @@
+
+
+              key  ------------- Distribution ------------- count    
+          demerit                @@@@@|                     -10      
+              wtf                     |@@@@@                10       
+              bot                     |@@@@@@@@@@           20       
+
+
+              key  ------------- Distribution ------------- count    
+         SOAP/XML |@@@                                      1        
+      XACML store |@@@@@@@@@@@@@@@@@                        5        
+       SAML token |@@@@@@@@@@@@@@@@@@@@                     6        
+
+
+              key  ------------- Distribution ------------- count    
+           parrot         @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -100     
+   non-diet pepsi                                   @@@@@@| -20      
+        breakfast                                       @@| -5       
+
+zoomed:
+
+              key  ------------- Distribution ------------- count    
+          demerit           @@@@@@@@@@|                     -10      
+              wtf                     |@@@@@@@@@@           10       
+              bot                     |@@@@@@@@@@@@@@@@@@@  20       
+
+
+              key  ------------- Distribution ------------- count    
+         SOAP/XML |@@@@@@@                                  1        
+      XACML store |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@        5        
+       SAML token |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6        
+
+
+              key  ------------- Distribution ------------- count    
+           parrot   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -100     
+   non-diet pepsi                                 @@@@@@@@| -20      
+        breakfast                                       @@| -5       
+

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,53 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc.  All rights reserved.
+ */
+
+#pragma D option aggpack
+#pragma D option encoding=ascii
+#pragma D option quiet
+
+BEGIN
+{
+	@x = quantize(1 << 32);
+	@y[1] = quantize(1);
+	@z["mumble"] = quantize(1);
+	@xx["foo", (char)1, (short)2, (long)3] = quantize(1);
+
+	@neg = lquantize(-10, -10, 20, 1, -1);
+	@neg = lquantize(-5, -10, 20, 1, 1);
+	@neg = lquantize(0, -10, 20, 1, 1);
+
+	i = 0;
+}
+
+tick-1ms
+{
+	@a[i] = quantize(0, i);
+	@a[i] = quantize(1, 100 - i);
+	i++;
+}
+
+tick-1ms
+/i > 100/
+{
+	exit(0);
+}
+
+END
+{
+	setopt("aggzoom", "true");
+	printa(@neg);
+	setopt("aggzoom", "false");
+	printa(@neg);
+}

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,124 @@
+
+
+     min .--------------------------------. max      | count
+   < -10 : V    X    X                    : >= 20    | 1
+
+
+     min .--------------------------------. max      | count
+   < -10 : v    x    x                    : >= 20    | 1
+
+
+        min .---. max        | count
+ 2147483648 : X : 8589934592 | 1
+
+      key  min .---. max  | count
+        1    0 : X : 2    | 1
+
+              key  min .---. max  | count
+           mumble    0 : X : 2    | 1
+
+                                         key  min .---. max  | count
+              foo   1     2                3    0 : X : 2    | 1
+
+      key  min .---. max  | count
+      100    0 :X  : 2    | 100
+       99    0 :X_ : 2    | 100
+       98    0 :X_ : 2    | 100
+       97    0 :X_ : 2    | 100
+       96    0 :X_ : 2    | 100
+       95    0 :X_ : 2    | 100
+       94    0 :X_ : 2    | 100
+       93    0 :X_ : 2    | 100
+       92    0 :X_ : 2    | 100
+       91    0 :X_ : 2    | 100
+       90    0 :X_ : 2    | 100
+       89    0 :X_ : 2    | 100
+       88    0 :X_ : 2    | 100
+       87    0 :X_ : 2    | 100
+       86    0 :X_ : 2    | 100
+       85    0 :X_ : 2    | 100
+       84    0 :X_ : 2    | 100
+       83    0 :X_ : 2    | 100
+       82    0 :X_ : 2    | 100
+       81    0 :X_ : 2    | 100
+       80    0 :X_ : 2    | 100
+       79    0 :X_ : 2    | 100
+       78    0 :xx : 2    | 100
+       77    0 :xx : 2    | 100
+       76    0 :xx : 2    | 100
+       75    0 :xx : 2    | 100
+       74    0 :xx : 2    | 100
+       73    0 :xx : 2    | 100
+       72    0 :xx : 2    | 100
+       71    0 :xx : 2    | 100
+       70    0 :xx : 2    | 100
+       69    0 :xx : 2    | 100
+       68    0 :xx : 2    | 100
+       67    0 :xx : 2    | 100
+       66    0 :xx : 2    | 100
+       65    0 :xx : 2    | 100
+       64    0 :xx : 2    | 100
+       63    0 :xx : 2    | 100
+       62    0 :xx : 2    | 100
+       61    0 :xx : 2    | 100
+       60    0 :xx : 2    | 100
+       59    0 :xx : 2    | 100
+       58    0 :xx : 2    | 100
+       57    0 :xx : 2    | 100
+       56    0 :xx : 2    | 100
+       55    0 :xx : 2    | 100
+       54    0 :xx : 2    | 100
+       53    0 :xx : 2    | 100
+       52    0 :xx : 2    | 100
+       51    0 :xx : 2    | 100
+       50    0 :xx : 2    | 100
+       49    0 :xx : 2    | 100
+       48    0 :xx : 2    | 100
+       47    0 :xx : 2    | 100
+       46    0 :xx : 2    | 100
+       45    0 :xx : 2    | 100
+       44    0 :xx : 2    | 100
+       43    0 :xx : 2    | 100
+       42    0 :xx : 2    | 100
+       41    0 :xx : 2    | 100
+       40    0 :xx : 2    | 100
+       39    0 :xx : 2    | 100
+       38    0 :xx : 2    | 100
+       37    0 :xx : 2    | 100
+       36    0 :xx : 2    | 100
+       35    0 :xx : 2    | 100
+       34    0 :xx : 2    | 100
+       33    0 :xx : 2    | 100
+       32    0 :xx : 2    | 100
+       31    0 :xx : 2    | 100
+       30    0 :xx : 2    | 100
+       29    0 :xx : 2    | 100
+       28    0 :xx : 2    | 100
+       27    0 :xx : 2    | 100
+       26    0 :xx : 2    | 100
+       25    0 :xx : 2    | 100
+       24    0 :xx : 2    | 100
+       23    0 :xx : 2    | 100
+       22    0 :xx : 2    | 100
+       21    0 :_X : 2    | 100
+       20    0 :_X : 2    | 100
+       19    0 :_X : 2    | 100
+       18    0 :_X : 2    | 100
+       17    0 :_X : 2    | 100
+       16    0 :_X : 2    | 100
+       15    0 :_X : 2    | 100
+       14    0 :_X : 2    | 100
+       13    0 :_X : 2    | 100
+       12    0 :_X : 2    | 100
+       11    0 :_X : 2    | 100
+       10    0 :_X : 2    | 100
+        9    0 :_X : 2    | 100
+        8    0 :_X : 2    | 100
+        7    0 :_X : 2    | 100
+        6    0 :_X : 2    | 100
+        5    0 :_X : 2    | 100
+        4    0 :_X : 2    | 100
+        3    0 :_X : 2    | 100
+        2    0 :_X : 2    | 100
+        1    0 :_X : 2    | 100
+        0    0 : X : 2    | 100

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,75 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source.  A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2013 Joyent, Inc.  All rights reserved.
+#
+
+let width=8
+
+function outputchar
+{
+	banner $3 | awk -v line=$1 -v pos=$2 -v width=$width '{ \
+		for (i = 1; i <= length($0); i++) { \
+			if (substr($0, i, 1) == " ") \
+				continue; \
+			printf("\t@letter%d[%d] = lquantize(%d, 0, 40, 1);\n", \
+			    line, NR, i + (pos * width));
+		} \
+	}'
+}
+
+function outputstr
+{
+	let pos=0;
+	let line=0
+
+	printf "#pragma D option aggpack\n#pragma D option aggsortkey\n"
+
+	printf "BEGIN\n{\n"
+	for c in `echo "$1" | awk '{ \
+		for (i = 1; i <= length($0); i++) { \
+			c = substr($0, i, 1); \
+			printf("%s\n", c == " " ? "space" : \
+			    c == "\n" ? "newline" : c); \
+		} \
+	}'`; do
+		if [[ "$c" == "space" ]]; then
+			let line=line+1
+			let pos=0
+			continue
+		fi
+
+		outputchar $line $pos $c
+		let pos=pos+1
+	done
+
+	let i=0
+
+	while [[ $i -le $line ]]; do
+		printf "\tprinta(@letter%d);\n" $i
+		let i=i+1
+	done
+	printf "\texit(0);\n}\n"
+}
+
+dtrace -qs /dev/stdin -x encoding=utf8 <= 40    | 6
+        3     < 0 :   â–‚    â–‚  â–‚    â–‚    â–‚ â–‚                  : >= 40    | 6
+        4     < 0 :   â–‚    â–‚  â–‚â–‚â–‚â–‚â–‚â–‚     â–‚                   : >= 40    | 9
+        5     < 0 :   â–‚ â–‚â–‚ â–‚  â–‚    â–‚     â–‚                   : >= 40    | 7
+        6     < 0 :   â–‚â–‚  â–‚â–‚  â–‚    â–‚     â–‚                   : >= 40    | 7
+        7     < 0 :   â–‚    â–‚  â–‚    â–‚     â–‚                   : >= 40    | 5
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :   â–‚    â–‚  â–‚    â–‚   â–‚â–‚â–‚â–‚    â–‚â–‚â–‚â–‚â–‚         : >= 40    | 13
+        3     < 0 :   â–‚â–‚  â–‚â–‚  â–‚    â–‚  â–‚          â–‚           : >= 40    | 8
+        4     < 0 :   â–‚ â–‚â–‚ â–‚  â–‚    â–‚   â–‚â–‚â–‚â–‚      â–‚           : >= 40    | 11
+        5     < 0 :   â–‚    â–‚  â–‚    â–‚       â–‚     â–‚           : >= 40    | 6
+        6     < 0 :   â–‚    â–‚  â–‚    â–‚  â–‚    â–‚     â–‚           : >= 40    | 7
+        7     < 0 :   â–‚    â–‚   â–‚â–‚â–‚â–‚    â–‚â–‚â–‚â–‚      â–‚           : >= 40    | 11
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :      â–ˆ                                   : >= 40    | 1
+        3     < 0 :      â–ˆ                                   : >= 40    | 1
+        4     < 0 :      â–ˆ                                   : >= 40    | 1
+        5     < 0 :      â–ˆ                                   : >= 40    | 1
+        6     < 0 :      â–ˆ                                   : >= 40    | 1
+        7     < 0 :      â–ˆ                                   : >= 40    | 1
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :   â–‚â–‚â–‚â–‚â–‚    â–‚â–‚â–‚â–‚                          : >= 40    | 9
+        3     < 0 :   â–ƒ    â–ƒ  â–ƒ    â–ƒ                         : >= 40    | 4
+        4     < 0 :   â–ƒ    â–ƒ  â–ƒ    â–ƒ                         : >= 40    | 4
+        5     < 0 :   â–ƒ    â–ƒ  â–ƒ    â–ƒ                         : >= 40    | 4
+        6     < 0 :   â–ƒ    â–ƒ  â–ƒ    â–ƒ                         : >= 40    | 4
+        7     < 0 :   â–‚â–‚â–‚â–‚â–‚    â–‚â–‚â–‚â–‚                          : >= 40    | 9
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :    â–‚â–‚â–‚â–‚â–‚  â–‚    â–‚     â–‚     â–‚â–‚â–‚â–‚          : >= 40    | 12
+        3     < 0 :      â–‚    â–‚    â–‚     â–‚    â–‚              : >= 40    | 5
+        4     < 0 :      â–‚    â–‚â–‚â–‚â–‚â–‚â–‚     â–‚     â–‚â–‚â–‚â–‚          : >= 40    | 12
+        5     < 0 :      â–‚    â–‚    â–‚     â–‚         â–‚         : >= 40    | 5
+        6     < 0 :      â–‚    â–‚    â–‚     â–‚    â–‚    â–‚         : >= 40    | 6
+        7     < 0 :      â–‚    â–‚    â–‚     â–‚     â–‚â–‚â–‚â–‚          : >= 40    | 8
+
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :      X                                   : >= 40    | 1
+        3     < 0 :      X                                   : >= 40    | 1
+        4     < 0 :      X                                   : >= 40    | 1
+        5     < 0 :      X                                   : >= 40    | 1
+        6     < 0 :      X                                   : >= 40    | 1
+        7     < 0 :      X                                   : >= 40    | 1
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :     XX    X    X                         : >= 40    | 4
+        3     < 0 :    X  X   XX  XX                         : >= 40    | 6
+        4     < 0 :   X    X  X XX X                         : >= 40    | 6
+        5     < 0 :   XXXXXX  X    X                         : >= 40    | 8
+        6     < 0 :   X    X  X    X                         : >= 40    | 4
+        7     < 0 :   X    X  X    X                         : >= 40    | 4
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :   X    X   XXXX    XXXXX                 : >= 40    | 11
+        3     < 0 :   XX   X  X    X     X                   : >= 40    | 6
+        4     < 0 :   X X  X  X    X     X                   : >= 40    | 6
+        5     < 0 :   X  X X  X    X     X                   : >= 40    | 6
+        6     < 0 :   X   XX  X    X     X                   : >= 40    | 6
+        7     < 0 :   X    X   XXXX      X                   : >= 40    | 7
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :   X    X  XXXXXX  X       X              : >= 40    | 10
+        3     < 0 :   X    X  X       X       X              : >= 40    | 5
+        4     < 0 :   X    X  XXXXX   X       X              : >= 40    | 9
+        5     < 0 :   X XX X  X       X       X              : >= 40    | 7
+        6     < 0 :   XX  XX  X       X       X              : >= 40    | 7
+        7     < 0 :   X    X  XXXXXX  XXXXXX  XXXXXX         : >= 40    | 20
+
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :    ████   ██████  █    █  █████          : >= 40    | 17
+        3     < 0 :   █       █       ██   █  █    █         : >= 40    | 7
+        4     < 0 :    ████   █████   █ █  █  █    █         : >= 40    | 14
+        5     < 0 :        â–ˆ  â–ˆ       â–ˆ  â–ˆ â–ˆ  â–ˆ    â–ˆ         : >= 40    | 7
+        6     < 0 :   █    █  █       █   ██  █    █         : >= 40    | 8
+        7     < 0 :    ████   ██████  █    █  █████          : >= 40    | 17
+
+
+      key     min .------------------------------------------. max      | count
+        2     < 0 :   █    █  ██████  █       █████          : >= 40    | 14
+        3     < 0 :   â–ˆ    â–ˆ  â–ˆ       â–ˆ       â–ˆ    â–ˆ         : >= 40    | 6
+        4     < 0 :   ██████  █████   █       █    █         : >= 40    | 14
+        5     < 0 :   █    █  █       █       █████          : >= 40    | 9
+        6     < 0 :   â–ˆ    â–ˆ  â–ˆ       â–ˆ       â–ˆ              : >= 40    | 5
+        7     < 0 :   █    █  ██████  ██████  █              : >= 40    | 15
+

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,42 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc.  All rights reserved.
+ */
+
+#pragma D option quiet
+
+tick-1ms
+/i++ < 30/
+{
+	@[1] = lquantize(i, 0, 40, 1, 1000);
+	@[2] = lquantize(i, 0, 40, 1, 1000);
+	@[3] = lquantize(i, 0, 40, 1, 1000);
+}
+
+tick-1ms
+/i == 40/
+{
+	@[1] = lquantize(0, 0, 40, 1, 1);
+	@[1] = lquantize(i, 0, 40, 1, 2000);
+	@[2] = lquantize(0, 0, 40, 1, 1);
+	@[2] = lquantize(i, 0, 40, 1, 2000);
+	@[3] = lquantize(0, 0, 40, 1, 1);
+	@[3] = lquantize(i, 0, 40, 1, 2000);
+
+	printa(@);
+	setopt("aggpack");
+	printa(@);
+	setopt("aggzoom");
+	printa(@);
+	exit(0);
+}

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,149 @@
+
+        1
+           value  ------------- Distribution ------------- count    
+             < 0 |                                         0        
+               0 |                                         1        
+               1 |@                                        1000     
+               2 |@                                        1000     
+               3 |@                                        1000     
+               4 |@                                        1000     
+               5 |@                                        1000     
+               6 |@                                        1000     
+               7 |@                                        1000     
+               8 |@                                        1000     
+               9 |@                                        1000     
+              10 |@                                        1000     
+              11 |@                                        1000     
+              12 |@                                        1000     
+              13 |@                                        1000     
+              14 |@                                        1000     
+              15 |@                                        1000     
+              16 |@                                        1000     
+              17 |@                                        1000     
+              18 |@                                        1000     
+              19 |@                                        1000     
+              20 |@                                        1000     
+              21 |@                                        1000     
+              22 |@                                        1000     
+              23 |@                                        1000     
+              24 |@                                        1000     
+              25 |@                                        1000     
+              26 |@                                        1000     
+              27 |@                                        1000     
+              28 |@                                        1000     
+              29 |@                                        1000     
+              30 |@                                        1000     
+              31 |                                         0        
+              32 |                                         0        
+              33 |                                         0        
+              34 |                                         0        
+              35 |                                         0        
+              36 |                                         0        
+              37 |                                         0        
+              38 |                                         0        
+              39 |                                         0        
+           >= 40 |@@                                       2000     
+
+        2
+           value  ------------- Distribution ------------- count    
+             < 0 |                                         0        
+               0 |                                         1        
+               1 |@                                        1000     
+               2 |@                                        1000     
+               3 |@                                        1000     
+               4 |@                                        1000     
+               5 |@                                        1000     
+               6 |@                                        1000     
+               7 |@                                        1000     
+               8 |@                                        1000     
+               9 |@                                        1000     
+              10 |@                                        1000     
+              11 |@                                        1000     
+              12 |@                                        1000     
+              13 |@                                        1000     
+              14 |@                                        1000     
+              15 |@                                        1000     
+              16 |@                                        1000     
+              17 |@                                        1000     
+              18 |@                                        1000     
+              19 |@                                        1000     
+              20 |@                                        1000     
+              21 |@                                        1000     
+              22 |@                                        1000     
+              23 |@                                        1000     
+              24 |@                                        1000     
+              25 |@                                        1000     
+              26 |@                                        1000     
+              27 |@                                        1000     
+              28 |@                                        1000     
+              29 |@                                        1000     
+              30 |@                                        1000     
+              31 |                                         0        
+              32 |                                         0        
+              33 |                                         0        
+              34 |                                         0        
+              35 |                                         0        
+              36 |                                         0        
+              37 |                                         0        
+              38 |                                         0        
+              39 |                                         0        
+           >= 40 |@@                                       2000     
+
+        3
+           value  ------------- Distribution ------------- count    
+             < 0 |                                         0        
+               0 |                                         1        
+               1 |@                                        1000     
+               2 |@                                        1000     
+               3 |@                                        1000     
+               4 |@                                        1000     
+               5 |@                                        1000     
+               6 |@                                        1000     
+               7 |@                                        1000     
+               8 |@                                        1000     
+               9 |@                                        1000     
+              10 |@                                        1000     
+              11 |@                                        1000     
+              12 |@                                        1000     
+              13 |@                                        1000     
+              14 |@                                        1000     
+              15 |@                                        1000     
+              16 |@                                        1000     
+              17 |@                                        1000     
+              18 |@                                        1000     
+              19 |@                                        1000     
+              20 |@                                        1000     
+              21 |@                                        1000     
+              22 |@                                        1000     
+              23 |@                                        1000     
+              24 |@                                        1000     
+              25 |@                                        1000     
+              26 |@                                        1000     
+              27 |@                                        1000     
+              28 |@                                        1000     
+              29 |@                                        1000     
+              30 |@                                        1000     
+              31 |                                         0        
+              32 |                                         0        
+              33 |                                         0        
+              34 |                                         0        
+              35 |                                         0        
+              36 |                                         0        
+              37 |                                         0        
+              38 |                                         0        
+              39 |                                         0        
+           >= 40 |@@                                       2000     
+
+
+
+      key     min .------------------------------------------. max      | count
+        1     < 0 : â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–         â–: >= 40    | 32001
+        2     < 0 : â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–         â–: >= 40    | 32001
+        3     < 0 : â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–         â–: >= 40    | 32001
+
+
+      key     min .------------------------------------------. max      | count
+        1     < 0 : â–â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„         â–ˆ: >= 40    | 32001
+        2     < 0 : â–â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„         â–ˆ: >= 40    | 32001
+        3     < 0 : â–â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„         â–ˆ: >= 40    | 32001
+

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,34 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc.  All rights reserved.
+ */
+
+#pragma D option quiet
+
+tick-1ms
+/i++ < 90/
+{
+	@ = lquantize(i, 0, 100, 1, 1000);
+}
+
+tick-1ms
+/i == 100/
+{
+	@ = lquantize(i++, 0, 100, 1, 2000);
+	@ = lquantize(i++, 0, 100, 1, 3000);
+
+	printa(@);
+	setopt("aggzoom");
+	printa(@);
+	exit(0);
+}

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out	Thu Jun 26 07:06:43 2014	(r267898)
@@ -0,0 +1,211 @@
+
+
+           value  ------------- Distribution ------------- count    
+               0 |                                         0        
+               1 |                                         1000     
+               2 |                                         1000     
+               3 |                                         1000     
+               4 |                                         1000     
+               5 |                                         1000     
+               6 |                                         1000     
+               7 |                                         1000     
+               8 |                                         1000     
+               9 |                                         1000     
+              10 |                                         1000     
+              11 |                                         1000     
+              12 |                                         1000     
+              13 |                                         1000     
+              14 |                                         1000     
+              15 |                                         1000     
+              16 |                                         1000     
+              17 |                                         1000     
+              18 |                                         1000     
+              19 |                                         1000     
+              20 |                                         1000     
+              21 |                                         1000     
+              22 |                                         1000     
+              23 |                                         1000     
+              24 |                                         1000     
+              25 |                                         1000     
+              26 |                                         1000     
+              27 |                                         1000     
+              28 |                                         1000     
+              29 |                                         1000     
+              30 |                                         1000     
+              31 |                                         1000     
+              32 |                                         1000     
+              33 |                                         1000     
+              34 |                                         1000     
+              35 |                                         1000     
+              36 |                                         1000     
+              37 |                                         1000     
+              38 |                                         1000     
+              39 |                                         1000     
+              40 |                                         1000     
+              41 |                                         1000     
+              42 |                                         1000     
+              43 |                                         1000     
+              44 |                                         1000     
+              45 |                                         1000     
+              46 |                                         1000     
+              47 |                                         1000     
+              48 |                                         1000     
+              49 |                                         1000     
+              50 |                                         1000     
+              51 |                                         1000     
+              52 |                                         1000     
+              53 |                                         1000     
+              54 |                                         1000     
+              55 |                                         1000     
+              56 |                                         1000     
+              57 |                                         1000     
+              58 |                                         1000     
+              59 |                                         1000     
+              60 |                                         1000     
+              61 |                                         1000     
+              62 |                                         1000     
+              63 |                                         1000     
+              64 |                                         1000     
+              65 |                                         1000     
+              66 |                                         1000     
+              67 |                                         1000     
+              68 |                                         1000     
+              69 |                                         1000     
+              70 |                                         1000     
+              71 |                                         1000     
+              72 |                                         1000     
+              73 |                                         1000     
+              74 |                                         1000     
+              75 |                                         1000     
+              76 |                                         1000     
+              77 |                                         1000     
+              78 |                                         1000     
+              79 |                                         1000     
+              80 |                                         1000     
+              81 |                                         1000     
+              82 |                                         1000     
+              83 |                                         1000     
+              84 |                                         1000     
+              85 |                                         1000     
+              86 |                                         1000     
+              87 |                                         1000     
+              88 |                                         1000     
+              89 |                                         1000     
+              90 |                                         1000     
+              91 |                                         0        
+              92 |                                         0        
+              93 |                                         0        
+              94 |                                         0        
+              95 |                                         0        
+              96 |                                         0        
+              97 |                                         0        
+              98 |                                         0        
+              99 |                                         0        
+          >= 100 |@@                                       5000     
+
+
+
+           value  ------------- Distribution ------------- count    
+               0 |                                         0        
+               1 |@@@@@@@@                                 1000     
+               2 |@@@@@@@@                                 1000     
+               3 |@@@@@@@@                                 1000     
+               4 |@@@@@@@@                                 1000     
+               5 |@@@@@@@@                                 1000     
+               6 |@@@@@@@@                                 1000     
+               7 |@@@@@@@@                                 1000     
+               8 |@@@@@@@@                                 1000     
+               9 |@@@@@@@@                                 1000     
+              10 |@@@@@@@@                                 1000     
+              11 |@@@@@@@@                                 1000     
+              12 |@@@@@@@@                                 1000     
+              13 |@@@@@@@@                                 1000     
+              14 |@@@@@@@@                                 1000     
+              15 |@@@@@@@@                                 1000     
+              16 |@@@@@@@@                                 1000     
+              17 |@@@@@@@@                                 1000     
+              18 |@@@@@@@@                                 1000     
+              19 |@@@@@@@@                                 1000     
+              20 |@@@@@@@@                                 1000     
+              21 |@@@@@@@@                                 1000     
+              22 |@@@@@@@@                                 1000     
+              23 |@@@@@@@@                                 1000     
+              24 |@@@@@@@@                                 1000     
+              25 |@@@@@@@@                                 1000     
+              26 |@@@@@@@@                                 1000     
+              27 |@@@@@@@@                                 1000     
+              28 |@@@@@@@@                                 1000     
+              29 |@@@@@@@@                                 1000     
+              30 |@@@@@@@@                                 1000     
+              31 |@@@@@@@@                                 1000     
+              32 |@@@@@@@@                                 1000     
+              33 |@@@@@@@@                                 1000     
+              34 |@@@@@@@@                                 1000     
+              35 |@@@@@@@@                                 1000     
+              36 |@@@@@@@@                                 1000     
+              37 |@@@@@@@@                                 1000     
+              38 |@@@@@@@@                                 1000     
+              39 |@@@@@@@@                                 1000     
+              40 |@@@@@@@@                                 1000     
+              41 |@@@@@@@@                                 1000     
+              42 |@@@@@@@@                                 1000     
+              43 |@@@@@@@@                                 1000     
+              44 |@@@@@@@@                                 1000     
+              45 |@@@@@@@@                                 1000     
+              46 |@@@@@@@@                                 1000     
+              47 |@@@@@@@@                                 1000     
+              48 |@@@@@@@@                                 1000     
+              49 |@@@@@@@@                                 1000     
+              50 |@@@@@@@@                                 1000     
+              51 |@@@@@@@@                                 1000     
+              52 |@@@@@@@@                                 1000     
+              53 |@@@@@@@@                                 1000     
+              54 |@@@@@@@@                                 1000     
+              55 |@@@@@@@@                                 1000     
+              56 |@@@@@@@@                                 1000     
+              57 |@@@@@@@@                                 1000     
+              58 |@@@@@@@@                                 1000     
+              59 |@@@@@@@@                                 1000     
+              60 |@@@@@@@@                                 1000     
+              61 |@@@@@@@@                                 1000     
+              62 |@@@@@@@@                                 1000     
+              63 |@@@@@@@@                                 1000     
+              64 |@@@@@@@@                                 1000     
+              65 |@@@@@@@@                                 1000     
+              66 |@@@@@@@@                                 1000     
+              67 |@@@@@@@@                                 1000     
+              68 |@@@@@@@@                                 1000     
+              69 |@@@@@@@@                                 1000     
+              70 |@@@@@@@@                                 1000     
+              71 |@@@@@@@@                                 1000     
+              72 |@@@@@@@@                                 1000     
+              73 |@@@@@@@@                                 1000     
+              74 |@@@@@@@@                                 1000     
+              75 |@@@@@@@@                                 1000     
+              76 |@@@@@@@@                                 1000     
+              77 |@@@@@@@@                                 1000     
+              78 |@@@@@@@@                                 1000     
+              79 |@@@@@@@@                                 1000     
+              80 |@@@@@@@@                                 1000     
+              81 |@@@@@@@@                                 1000     
+              82 |@@@@@@@@                                 1000     
+              83 |@@@@@@@@                                 1000     
+              84 |@@@@@@@@                                 1000     
+              85 |@@@@@@@@                                 1000     
+              86 |@@@@@@@@                                 1000     
+              87 |@@@@@@@@                                 1000     
+              88 |@@@@@@@@                                 1000     
+              89 |@@@@@@@@                                 1000     
+              90 |@@@@@@@@                                 1000     
+              91 |                                         0        
+              92 |                                         0        
+              93 |                                         0        
+              94 |                                         0        
+              95 |                                         0        
+              96 |                                         0        
+              97 |                                         0        
+              98 |                                         0        
+              99 |                                         0        
+          >= 100 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@   5000     
+
+

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c	Thu Jun 26 06:03:39 2014	(r267897)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c	Thu Jun 26 07:06:43 2014	(r267898)
@@ -25,7 +25,7 @@
  */
 
 /*
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  * Copyright (c) 2012 by Delphix. All rights reserved.
  */
 
@@ -1301,6 +1301,231 @@ dtrace_aggregate_walk(dtrace_hdl_t *dtp,
 }
 
 static int
+dt_aggregate_total(dtrace_hdl_t *dtp, boolean_t clear)
+{
+	dt_ahashent_t *h;
+	dtrace_aggdata_t **total;
+	dtrace_aggid_t max = DTRACE_AGGVARIDNONE, id;
+	dt_aggregate_t *agp = &dtp->dt_aggregate;
+	dt_ahash_t *hash = &agp->dtat_hash;
+	uint32_t tflags;
+
+	tflags = DTRACE_A_TOTAL | DTRACE_A_HASNEGATIVES | DTRACE_A_HASPOSITIVES;
+
+	/*
+	 * If we need to deliver per-aggregation totals, we're going to take
+	 * three passes over the aggregate:  one to clear everything out and
+	 * determine our maximum aggregation ID, one to actually total
+	 * everything up, and a final pass to assign the totals to the
+	 * individual elements.
+	 */
+	for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) {
+		dtrace_aggdata_t *aggdata = &h->dtahe_data;
+
+		if ((id = dt_aggregate_aggvarid(h)) > max)
+			max = id;
+
+		aggdata->dtada_total = 0;
+		aggdata->dtada_flags &= ~tflags;
+	}
+
+	if (clear || max == DTRACE_AGGVARIDNONE)
+		return (0);
+
+	total = dt_zalloc(dtp, (max + 1) * sizeof (dtrace_aggdata_t *));
+
+	if (total == NULL)
+		return (-1);
+
+	for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) {
+		dtrace_aggdata_t *aggdata = &h->dtahe_data;
+		dtrace_aggdesc_t *agg = aggdata->dtada_desc;
+		dtrace_recdesc_t *rec;
+		caddr_t data;
+		int64_t val, *addr;
+
+		rec = &agg->dtagd_rec[agg->dtagd_nrecs - 1];
+		data = aggdata->dtada_data;
+		addr = (int64_t *)(uintptr_t)(data + rec->dtrd_offset);

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 07:07:19 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 95C5DB3C;
 Thu, 26 Jun 2014 07:07:19 +0000 (UTC)
Received: from felyko.com (felyko.com [IPv6:2001:470:1:2d5:26:3:1337:ca7])
 by mx1.freebsd.org (Postfix) with ESMTP id 7A13B2661;
 Thu, 26 Jun 2014 07:07:19 +0000 (UTC)
Received: from [IPv6:2601:9:8280:426:ad15:6344:7a51:317b] (unknown
 [IPv6:2601:9:8280:426:ad15:6344:7a51:317b])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by felyko.com (Postfix) with ESMTPSA id 730AE34A9F4;
 Thu, 26 Jun 2014 00:07:18 -0700 (PDT)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r267898 - in head:
 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs
 cddl/contrib/opensolaris/lib/libdtrace/common
 sys/cddl/contrib/opensolaris/uts/common/sys
From: Rui Paulo 
In-Reply-To: <201406260706.s5Q76hYW014217@svn.freebsd.org>
Date: Thu, 26 Jun 2014 00:07:16 -0700
Content-Transfer-Encoding: 7bit
Message-Id: <70A9EC87-0D8F-44FE-82E4-8EE887C14E6F@FreeBSD.org>
References: <201406260706.s5Q76hYW014217@svn.freebsd.org>
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
X-Mailer: Apple Mail (2.1878.2)
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 07:07:19 -0000

On Jun 26, 2014, at 0:06, Rui Paulo  wrote:

> Log:
>  Bring the following change from the illumos-joyent repository:
> 
>  commit 78e24ab6803bbe11ba37642624e1498ede5b239d
>  Author: Bryan Cantrill 
>  Date:   Thu Oct 31 01:20:54 2013
> 
>      OS-1688 DTrace count() with histogram
>      OS-2360 DTrace full width distribution histograms
>      OS-2361 DTrace frequency trails

Examples here:

http://dtrace.org/blogs/bmc/2013/11/10/agghist-aggzoom-and-aggpack/

--
Rui Paulo




From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 07:07:33 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id CD096C7C;
 Thu, 26 Jun 2014 07:07:33 +0000 (UTC)
Received: from elvis.mu.org (elvis.mu.org [192.203.228.196])
 by mx1.freebsd.org (Postfix) with ESMTP id ACCAA2666;
 Thu, 26 Jun 2014 07:07:33 +0000 (UTC)
Received: from Alfreds-MacBook-Pro-9.local (c-76-21-10-192.hsd1.ca.comcast.net
 [76.21.10.192])
 by elvis.mu.org (Postfix) with ESMTPSA id DEA481A3C43;
 Thu, 26 Jun 2014 00:07:26 -0700 (PDT)
Message-ID: <53AAF4BE.2050706@freebsd.org>
Date: Wed, 25 Jun 2014 09:11:42 -0700
From: Alfred Perlstein 
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: attilio@FreeBSD.org
Subject: Re: svn commit: r267858 - in head/sys/dev: virtio/balloon xen/balloon
References: <201406250951.s5P9p8YR017159@svn.freebsd.org>		<20140625120932.GM28199@FreeBSD.org>		<53AAE7D0.2090508@freebsd.org>
 
In-Reply-To: 
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: "src-committers@freebsd.org" ,
 Alan Cox ,
 "svn-src-all@freebsd.org" ,
 =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= ,
 Gleb Smirnoff ,
 "svn-src-head@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 07:07:33 -0000

On 6/25/14 8:30 AM, Attilio Rao wrote:
> On Wed, Jun 25, 2014 at 5:16 PM, Alfred Perlstein  wrote:
>> On 6/25/14 5:41 AM, Attilio Rao wrote:
>>> On Wed, Jun 25, 2014 at 2:09 PM, Gleb Smirnoff 
>>> wrote:
>>>> On Wed, Jun 25, 2014 at 01:58:29PM +0200, Attilio Rao wrote:
>>>> A> > Log:
>>>> A> >   xen/virtio: fix balloon drivers to not mark pages as WIRED
>>>> A> >
>>>> A> >   Prevent the Xen and VirtIO balloon drivers from marking pages as
>>>> A> >   wired. This prevents them from increasing the system wired page
>>>> count,
>>>> A> >   which can lead to mlock failing because of hitting the limit in
>>>> A> >   vm.max_wired.
>>>> A>
>>>> A> This change is conceptually wrong.
>>>> A> The pages balloon is allocating are unmanaged and they should be wired
>>>> A> by definition. Alan and I are considering enforcing this (mandatory
>>>> A> wired pages for unmanaged pages allocation) directly in the KPI.
>>>> A> This in practice just seem an artifact to deal with scarce  wired
>>>> A> memory limit. I suggest that for the XEN case this limit gets bumped
>>>> A> rather relying on similar type of hacks.
>>>>
>>>> Proper limit would be to count pages wired by userland via mlock(2)
>>>> and enforce limit only on those pages. Pages wired by kernel should
>>>> be either unlimited or controled by a separate limit.
>>> FWIW, I mostly agree with this. I think that the kernel and userland
>>> limits should be split apart. But for the time being, rising the limit
>>> is better.
>>>
>>> Attilio
>>>
>>>
>> Can you explain?  I would think that if you were designing some kind of
>> embedded device you would want to know exactly how much locked pages there
>> are overall, not just in userland.
>>
>> Meaning you would not want to overcommit and have too many locked pages due
>> to kernel+user.
> Well, assuming you trace them indipendently I don't think this is
> going to be problematic to aggregate them, is it?
I am not sure as I am not as strong in this area as you are.
>
> As far as I understand it, right now we have RMEM_LIMIT to someway
> limit per-process amount of wired memory and finally max_wired as a
> global accounted wired memory limit.
>
> I think that the idea now is that RMEM_LIMIT is enough to correctly
> control all the front-end check, coming from untrusted sources
> (userland, non-privileged syscalls like mlock(), mmap(), etc.).
> Possibly that's not always the case and I think that the hypervisor
> can be a fair example of this.
>
> Having "more granular" accountability, means that rather than having a
> global limit (or, rather, along with it) we can grow a per-process
> limit to control kernel-allocated wired memory.
>
>> Perhaps that needs an API as well?
> I don't have anything in my mind yet. My initial point was more trying
> to get a better semantic on a paradigm that is at least dangerous.
>
> Attilio
>
>
My concern is a group of daemons working to provide system services 
playing nicely with each other and the system as a whole.

I think the point is that let's say you have a concert of userspace 
daemons "importantd(8)" and "imperatived(8)" running on a system.

Both importantd(8) and imperatived(8) need pages wired for dealing with 
important timing/throughput issues.  The kernel obviously needs such 
pages as well.

importantd(8) and imperatived(8) do not want to blow up the system by 
requesting more than a fixed amount otherwise supposed bad things will 
happen, or perhaps they deadlock against each other.

A global count seems (to me) to make sense at this point even if the 
kernel ignores it as a way for everything to act in concert.

Is there a way for kernel, importantd(8), and imperatived(8) to "play 
nice together", meaning they can take each other's wired count into 
account if we get rid of the global?  My feeling is "no", that they will 
then need another rendezvous to do global accounting, if we retire this 
facility.

I'm likely wrong, but wanted to bring this up as a concern.

-Alfred



From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 07:22:27 2014
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 06BD7FF8;
 Thu, 26 Jun 2014 07:22:27 +0000 (UTC)
Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140])
 by mx1.freebsd.org (Postfix) with ESMTP id BFBD127E4;
 Thu, 26 Jun 2014 07:22:25 +0000 (UTC)
Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua
 [212.40.38.100])
 by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA15252;
 Thu, 26 Jun 2014 10:22:22 +0300 (EEST)
 (envelope-from avg@FreeBSD.org)
Received: from localhost ([127.0.0.1])
 by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD))
 id 1X040k-000Hho-8T; Thu, 26 Jun 2014 10:22:22 +0300
Message-ID: <53ABC9FE.4000107@FreeBSD.org>
Date: Thu, 26 Jun 2014 11:21:34 +0400
From: Andriy Gapon 
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Rui Paulo , src-committers@FreeBSD.org,
 svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org
Subject: Re: svn commit: r267898 - in head:
 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs
 cddl/contrib/opensolaris/lib/libdtrace/common
 sys/cddl/contrib/opensolaris/uts/common/sys
References: <201406260706.s5Q76hYW014217@svn.freebsd.org>
In-Reply-To: <201406260706.s5Q76hYW014217@svn.freebsd.org>
X-Enigmail-Version: 1.6
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 07:22:27 -0000

On 26/06/2014 11:06, Rui Paulo wrote:
> Author: rpaulo
> Date: Thu Jun 26 07:06:43 2014
> New Revision: 267898
> URL: http://svnweb.freebsd.org/changeset/base/267898
> 
> Log:
>   Bring the following change from the illumos-joyent repository:
>   
>   commit 78e24ab6803bbe11ba37642624e1498ede5b239d
>   Author: Bryan Cantrill 
>   Date:   Thu Oct 31 01:20:54 2013
>   
>       OS-1688 DTrace count() with histogram
>       OS-2360 DTrace full width distribution histograms
>       OS-2361 DTrace frequency trails
>   
>   MFC after:	2 weeks

Seems like this change is in illumos already:

commit 33093f5bcdc51014933497dd39374080c1ac5705
Author: Bryan Cantrill 
Date:   Thu Oct 31 08:20:54 2013 +0000

    4471 DTrace count() with histogram
    4472 DTrace full width distribution histograms
    4473 DTrace frequency trails
    Reviewed by: Dan McDonald 
    Approved by: Gordon Ross 

As such it would have been preferable to use our standard workflow and
merge the change via the illumos vendor area.

-- 
Andriy Gapon

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 08:21:32 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8E52AA73
 for ; Thu, 26 Jun 2014 08:21:32 +0000 (UTC)
Received: from nm34-vm7.bullet.mail.bf1.yahoo.com
 (nm34-vm7.bullet.mail.bf1.yahoo.com [72.30.239.79])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3BD122C2E
 for ; Thu, 26 Jun 2014 08:21:32 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1403770570; bh=QK4XT7zVVczPbYg+gJ1QzlVQY6+bOXhGxo4llT7Xlis=;
 h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Message-Id:References:To:X-Mailer;
 b=Ep9xS4PP5dtiQhY61S0n33UJWCwtDZpiaiWt7rRazjWPPb8usDxJytqbIboYZXZ+/rl5gCk0/Jgp185NocIX2a7aooFyscg66eOvv/M7OIVBM1Fvj9LbpZbmVZlm1U2qJydVfJVg1f8Ahr05Bf1DSJIQclSxl/4YbDF5+OotxPG+EtE0WRWyP6TpKps4K0E4dQjXPinNjZlDpUDff2S9thP2Un+rHgwLy+HA4UPH7Lw087h2mU45ey2TLtM9sYeYSdwhFfNAkXPhT0sMqNHDbWrsMjDDDIBz6J1UQin+UwsKNfxKP4gr5ALk6q5IkHnIS4JbAoX5jknO93cuOBvdrA==
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com;
 b=VKWKI35Yww+zQVQF0BZOGoFZfn2BvAEprC7Xp8whFrHDDxpLUebtP8PZBqSLKjKEsngltbUvFexCMLv6YQSJbZV7sWUaboFBKzZPSXRz2sWXD2OrdH3bsv+lu6EXApdRI9wqhU89JmRjOovVUrBbAWN2n6Mcmn2nEhPzNDr3/ApuB86uwYpJbQeuJ6FgHLEHYMqw/8ftoM+GZb2ZbFwvQXnKgRDaouPO9I0U0noAd5igXXAk+LFwVKkEsUpLIXf6uTfX2dp2EkOZVgT8NKoDL/uzsoKHvlj0NkImYuDguuTa/iJnQxknflcqy9UMRA8+gu2KrlwSdJNbeEiRsnQT1w==;
Received: from [66.196.81.171] by nm34.bullet.mail.bf1.yahoo.com with NNFMP;
 26 Jun 2014 08:16:10 -0000
Received: from [98.139.213.9] by tm17.bullet.mail.bf1.yahoo.com with NNFMP;
 26 Jun 2014 08:16:10 -0000
Received: from [127.0.0.1] by smtp109.mail.bf1.yahoo.com with NNFMP;
 26 Jun 2014 08:16:10 -0000
X-Yahoo-Newman-Id: 85838.10776.bm@smtp109.mail.bf1.yahoo.com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: HD73J84VM1kPvwqUOiNwZ0a3kQRLNwSi68gcSsKy9au7ARv
 dPj_Ccp9cMh2ONFJzR3TXqN0d8d9w58eXqU3F1xSGFkVoolTADk8kHhd5E93
 V8_LKZjWkLhKZsg3heqdCxs6bCTQcXmE5aeGenmK1.JKVYay_9aPhUaF19eD
 OdMj5ECuy2bfq4.uOrWkOdOfTlP4IleOd_FHgSFakLIHu9I1ZIQVG_4JJRzh
 HjArng1aUCEhy4KFZY5hfHUWeaCn.g6dttFvrZQwtLgNZP3oXYjfoMQhQAzF
 lkhnLZj9CDUvWmJhD1zYqhIhvHf04RDwZp8rEb7g_dZR3kaTGOEs6Y7fVEMD
 RsZRj8Ses2DHs2oBjYQOgKs1uWKPSzQI9YyVPb76y4DyKtkp9ITGgYwvQlZp
 7vK712uL9QTXFz4XqM7sJGBLEpFX_w_8ZS5CM.vgSmspFCid3fAiVVUwFGzn
 k_tDoQ3BcBPSc5GEBazNuJGZhRmcRbvMSr0LfSzjj7haOCOfCMWwgccBdDn6
 18ovdwL9RX_l0B7T6ANFMxm96JmfY1JM-
X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf
X-Rocket-Received: from [192.168.0.101] (pfg@190.157.126.109 with plain
 [98.138.105.21])
 by smtp109.mail.bf1.yahoo.com with SMTP; 26 Jun 2014 01:16:10 -0700 PDT
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r267898 - in head:
 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs
 cddl/contrib/opensolaris/lib/libdtrace/common
 sys/cddl/contrib/opensolaris/uts/common/sys
From: Pedro Giffuni 
In-Reply-To: <53ABC9FE.4000107@FreeBSD.org>
Date: Thu, 26 Jun 2014 03:16:07 -0500
Message-Id: 
References: <201406260706.s5Q76hYW014217@svn.freebsd.org>
 <53ABC9FE.4000107@FreeBSD.org>
To: Rui Paulo 
X-Mailer: Apple Mail (2.1878.2)
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Content-Filtered-By: Mailman/MimeDel 2.1.18
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
 src-committers@FreeBSD.org, Andriy Gapon 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 08:21:32 -0000


Il giorno 26/giu/2014, alle ore 02:21, Andriy Gapon  ha =
scritto:

> On 26/06/2014 11:06, Rui Paulo wrote:
>> Author: rpaulo
>> Date: Thu Jun 26 07:06:43 2014
>> New Revision: 267898
>> URL: http://svnweb.freebsd.org/changeset/base/267898
>>=20
>> Log:
>>  Bring the following change from the illumos-joyent repository:
>>=20
>>  commit 78e24ab6803bbe11ba37642624e1498ede5b239d
>>  Author: Bryan Cantrill 
>>  Date:   Thu Oct 31 01:20:54 2013
>>=20
>>      OS-1688 DTrace count() with histogram
>>      OS-2360 DTrace full width distribution histograms
>>      OS-2361 DTrace frequency trails
>>=20
>>  MFC after:	2 weeks
>=20
> Seems like this change is in illumos already:
>=20
> commit 33093f5bcdc51014933497dd39374080c1ac5705
> Author: Bryan Cantrill 
> Date:   Thu Oct 31 08:20:54 2013 +0000
>=20
>    4471 DTrace count() with histogram
>    4472 DTrace full width distribution histograms
>    4473 DTrace frequency trails
>    Reviewed by: Dan McDonald 
>    Approved by: Gordon Ross 
>=20
> As such it would have been preferable to use our standard workflow and
> merge the change via the illumos vendor area.
>=20

Indeed, this change is in the vendor area:

http://svnweb.freebsd.org/base?view=3Drevision&revision=3D266992

However the commit is wrong because:

1) It added files instead of copying them from/through the vendor area.
2) It is not respecting the order in which upstream (Illumos AFAICT) =
adds features so it breaks the sense of DT_VERS_LATEST

I am aware that DTrace imports have not been respecting the regular =
merging procedure but we are trying to work on that. Please fix at least =
(1), (2) implies merging three commits that precede this one.=20

Pedro.=

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 08:56:38 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2DBD2CCD;
 Thu, 26 Jun 2014 08:56:38 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1A4C72F42;
 Thu, 26 Jun 2014 08:56:38 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5Q8ubDS065600;
 Thu, 26 Jun 2014 08:56:37 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5Q8uaSo065596;
 Thu, 26 Jun 2014 08:56:36 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406260856.s5Q8uaSo065596@svn.freebsd.org>
From: Alexander Motin 
Date: Thu, 26 Jun 2014 08:56:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267905 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 08:56:38 -0000

Author: mav
Date: Thu Jun 26 08:56:36 2014
New Revision: 267905
URL: http://svnweb.freebsd.org/changeset/base/267905

Log:
  Add READ BUFFER and improve WRITE BUFFER SCSI commands support.
  
  This gives some use to 512KB per-LUN buffers, allocated for Copan-specific
  processor code and not used.  It allows, for example, to test transport
  performance and/or correctness without accessing the media, as supported
  by Linux version of sg3_utils.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_cmd_table.c
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/cam/ctl/ctl_private.h

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Thu Jun 26 08:55:06 2014	(r267904)
+++ head/sys/cam/ctl/ctl.c	Thu Jun 26 08:56:36 2014	(r267905)
@@ -4854,7 +4854,8 @@ ctl_config_move_done(union ctl_io *io)
 					 /*sks_valid*/ 1,
 					 /*retry_count*/
 					 io->io_hdr.port_status);
-		free(io->scsiio.kern_data_ptr, M_CTL);
+		if (io->io_hdr.flags & CTL_FLAG_ALLOCATED)
+			free(io->scsiio.kern_data_ptr, M_CTL);
 		ctl_done(io);
 		goto bailout;
 	}
@@ -4867,7 +4868,8 @@ ctl_config_move_done(union ctl_io *io)
 		 * S/G list.  If we start using S/G lists for config data,
 		 * we'll need to know how to clean them up here as well.
 		 */
-		free(io->scsiio.kern_data_ptr, M_CTL);
+		if (io->io_hdr.flags & CTL_FLAG_ALLOCATED)
+			free(io->scsiio.kern_data_ptr, M_CTL);
 		/* Hopefully the user has already set the status... */
 		ctl_done(io);
 	} else {
@@ -5612,26 +5614,40 @@ bailout:
 }
 
 int
-ctl_write_buffer(struct ctl_scsiio *ctsio)
+ctl_read_buffer(struct ctl_scsiio *ctsio)
 {
-	struct scsi_write_buffer *cdb;
-	struct copan_page_header *header;
+	struct scsi_read_buffer *cdb;
 	struct ctl_lun *lun;
-	struct ctl_softc *ctl_softc;
 	int buffer_offset, len;
-	int retval;
+	static uint8_t descr[4];
+	static uint8_t echo_descr[4] = { 0 };
 
-	header = NULL;
+	CTL_DEBUG_PRINT(("ctl_read_buffer\n"));
 
-	retval = CTL_RETVAL_COMPLETE;
+	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
+	cdb = (struct scsi_read_buffer *)ctsio->cdb;
 
-	CTL_DEBUG_PRINT(("ctl_write_buffer\n"));
+	if (lun->flags & CTL_LUN_PR_RESERVED) {
+		uint32_t residx;
 
-	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
-	ctl_softc = control_softc;
-	cdb = (struct scsi_write_buffer *)ctsio->cdb;
+		/*
+		 * XXX KDM need a lock here.
+		 */
+		residx = ctl_get_resindex(&ctsio->io_hdr.nexus);
+		if ((lun->res_type == SPR_TYPE_EX_AC
+		  && residx != lun->pr_res_idx)
+		 || ((lun->res_type == SPR_TYPE_EX_AC_RO
+		   || lun->res_type == SPR_TYPE_EX_AC_AR)
+		  && !lun->per_res[residx].registered)) {
+			ctl_set_reservation_conflict(ctsio);
+			ctl_done((union ctl_io *)ctsio);
+			return (CTL_RETVAL_COMPLETE);
+	        }
+	}
 
-	if ((cdb->byte2 & RWB_MODE) != RWB_MODE_DATA) {
+	if ((cdb->byte2 & RWB_MODE) != RWB_MODE_DATA &&
+	    (cdb->byte2 & RWB_MODE) != RWB_MODE_ECHO_DESCR &&
+	    (cdb->byte2 & RWB_MODE) != RWB_MODE_DESCR) {
 		ctl_set_invalid_field(ctsio,
 				      /*sks_valid*/ 1,
 				      /*command*/ 1,
@@ -5655,7 +5671,7 @@ ctl_write_buffer(struct ctl_scsiio *ctsi
 	len = scsi_3btoul(cdb->length);
 	buffer_offset = scsi_3btoul(cdb->offset);
 
-	if (len > sizeof(lun->write_buffer)) {
+	if (buffer_offset + len > sizeof(lun->write_buffer)) {
 		ctl_set_invalid_field(ctsio,
 				      /*sks_valid*/ 1,
 				      /*command*/ 1,
@@ -5666,11 +5682,68 @@ ctl_write_buffer(struct ctl_scsiio *ctsi
 		return (CTL_RETVAL_COMPLETE);
 	}
 
-	if (buffer_offset != 0) {
+	if ((cdb->byte2 & RWB_MODE) == RWB_MODE_DESCR) {
+		descr[0] = 0;
+		scsi_ulto3b(sizeof(lun->write_buffer), &descr[1]);
+		ctsio->kern_data_ptr = descr;
+		len = min(len, sizeof(descr));
+	} else if ((cdb->byte2 & RWB_MODE) == RWB_MODE_ECHO_DESCR) {
+		ctsio->kern_data_ptr = echo_descr;
+		len = min(len, sizeof(echo_descr));
+	} else
+		ctsio->kern_data_ptr = lun->write_buffer + buffer_offset;
+	ctsio->kern_data_len = len;
+	ctsio->kern_total_len = len;
+	ctsio->kern_data_resid = 0;
+	ctsio->kern_rel_offset = 0;
+	ctsio->kern_sg_entries = 0;
+	ctsio->be_move_done = ctl_config_move_done;
+	ctl_datamove((union ctl_io *)ctsio);
+
+	return (CTL_RETVAL_COMPLETE);
+}
+
+int
+ctl_write_buffer(struct ctl_scsiio *ctsio)
+{
+	struct scsi_write_buffer *cdb;
+	struct ctl_lun *lun;
+	int buffer_offset, len;
+
+	CTL_DEBUG_PRINT(("ctl_write_buffer\n"));
+
+	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
+	cdb = (struct scsi_write_buffer *)ctsio->cdb;
+
+	if ((cdb->byte2 & RWB_MODE) != RWB_MODE_DATA) {
+		ctl_set_invalid_field(ctsio,
+				      /*sks_valid*/ 1,
+				      /*command*/ 1,
+				      /*field*/ 1,
+				      /*bit_valid*/ 1,
+				      /*bit*/ 4);
+		ctl_done((union ctl_io *)ctsio);
+		return (CTL_RETVAL_COMPLETE);
+	}
+	if (cdb->buffer_id != 0) {
+		ctl_set_invalid_field(ctsio,
+				      /*sks_valid*/ 1,
+				      /*command*/ 1,
+				      /*field*/ 2,
+				      /*bit_valid*/ 0,
+				      /*bit*/ 0);
+		ctl_done((union ctl_io *)ctsio);
+		return (CTL_RETVAL_COMPLETE);
+	}
+
+	len = scsi_3btoul(cdb->length);
+	buffer_offset = scsi_3btoul(cdb->offset);
+
+	if (buffer_offset + len > sizeof(lun->write_buffer)) {
 		ctl_set_invalid_field(ctsio,
 				      /*sks_valid*/ 1,
 				      /*command*/ 1,
-				      /*field*/ 3,
+				      /*field*/ 6,
 				      /*bit_valid*/ 0,
 				      /*bit*/ 0);
 		ctl_done((union ctl_io *)ctsio);
@@ -5682,7 +5755,7 @@ ctl_write_buffer(struct ctl_scsiio *ctsi
 	 * malloc it and tell the caller the data buffer is here.
 	 */
 	if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) {
-		ctsio->kern_data_ptr = lun->write_buffer;
+		ctsio->kern_data_ptr = lun->write_buffer + buffer_offset;
 		ctsio->kern_data_len = len;
 		ctsio->kern_total_len = len;
 		ctsio->kern_data_resid = 0;
@@ -6893,6 +6966,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio)
 
 	ctsio->scsi_status = SCSI_STATUS_OK;
 
+	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
 	ctsio->be_move_done = ctl_config_move_done;
 	ctl_datamove((union ctl_io *)ctsio);
 
@@ -6952,6 +7026,7 @@ ctl_read_capacity(struct ctl_scsiio *cts
 
 	ctsio->scsi_status = SCSI_STATUS_OK;
 
+	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
 	ctsio->be_move_done = ctl_config_move_done;
 	ctl_datamove((union ctl_io *)ctsio);
 
@@ -7014,6 +7089,7 @@ ctl_read_capacity_16(struct ctl_scsiio *
 
 	ctsio->scsi_status = SCSI_STATUS_OK;
 
+	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
 	ctsio->be_move_done = ctl_config_move_done;
 	ctl_datamove((union ctl_io *)ctsio);
 
@@ -7184,6 +7260,7 @@ ctl_maintenance_in(struct ctl_scsiio *ct
 		}
 	}
 
+	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
 	ctsio->be_move_done = ctl_config_move_done;
 
 	CTL_DEBUG_PRINT(("buf = %x %x %x %x %x %x %x %x\n",
@@ -7409,6 +7486,7 @@ retry:
 	}
 	mtx_unlock(&lun->lun_lock);
 
+	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
 	ctsio->be_move_done = ctl_config_move_done;
 
 	CTL_DEBUG_PRINT(("buf = %x %x %x %x %x %x %x %x\n",
@@ -9120,6 +9198,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio
 	 */
 	ctsio->scsi_status = SCSI_STATUS_OK;
 
+	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
 	ctsio->be_move_done = ctl_config_move_done;
 	ctl_datamove((union ctl_io *)ctsio);
 
@@ -9246,7 +9325,7 @@ ctl_request_sense(struct ctl_scsiio *cts
 		 * parameter data.
 		 */
 		ctsio->sense_len = 0;
-
+		ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
 		ctsio->be_move_done = ctl_config_move_done;
 		ctl_datamove((union ctl_io *)ctsio);
 
@@ -9275,6 +9354,7 @@ no_sense:
 	 * autosense in this case.  We're reporting sense as parameter data.
 	 */
 	ctsio->sense_len = 0;
+	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
 	ctsio->be_move_done = ctl_config_move_done;
 	ctl_datamove((union ctl_io *)ctsio);
 
@@ -9362,6 +9442,7 @@ ctl_inquiry_evpd_supported(struct ctl_sc
 
 	ctsio->scsi_status = SCSI_STATUS_OK;
 
+	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
 	ctsio->be_move_done = ctl_config_move_done;
 	ctl_datamove((union ctl_io *)ctsio);
 
@@ -9417,6 +9498,7 @@ ctl_inquiry_evpd_serial(struct ctl_scsii
 	}
 	ctsio->scsi_status = SCSI_STATUS_OK;
 
+	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
 	ctsio->be_move_done = ctl_config_move_done;
 	ctl_datamove((union ctl_io *)ctsio);
 
@@ -9602,6 +9684,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
 
 	ctsio->scsi_status = SCSI_STATUS_OK;
 
+	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
 	ctsio->be_move_done = ctl_config_move_done;
 	ctl_datamove((union ctl_io *)ctsio);
 
@@ -9658,6 +9741,7 @@ ctl_inquiry_evpd_block_limits(struct ctl
 	scsi_u64to8b(UINT64_MAX, bl_ptr->max_write_same_length);
 
 	ctsio->scsi_status = SCSI_STATUS_OK;
+	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
 	ctsio->be_move_done = ctl_config_move_done;
 	ctl_datamove((union ctl_io *)ctsio);
 
@@ -9707,6 +9791,7 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio *
 		lbp_ptr->flags = SVPD_LBP_UNMAP | SVPD_LBP_WS16 | SVPD_LBP_WS10;
 
 	ctsio->scsi_status = SCSI_STATUS_OK;
+	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
 	ctsio->be_move_done = ctl_config_move_done;
 	ctl_datamove((union ctl_io *)ctsio);
 
@@ -9989,6 +10074,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio
 
 	ctsio->scsi_status = SCSI_STATUS_OK;
 	if (ctsio->kern_data_len > 0) {
+		ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
 		ctsio->be_move_done = ctl_config_move_done;
 		ctl_datamove((union ctl_io *)ctsio);
 	} else {

Modified: head/sys/cam/ctl/ctl_cmd_table.c
==============================================================================
--- head/sys/cam/ctl/ctl_cmd_table.c	Thu Jun 26 08:55:06 2014	(r267904)
+++ head/sys/cam/ctl/ctl_cmd_table.c	Thu Jun 26 08:56:36 2014	(r267905)
@@ -314,12 +314,15 @@ struct ctl_cmd_entry ctl_cmd_table[] =
 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
 
 /* 3B WRITE BUFFER */
-{ctl_write_buffer, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_PROC |
-				     CTL_FLAG_DATA_OUT,
+{ctl_write_buffer, CTL_SERIDX_MD_SEL, CTL_CMD_FLAG_OK_ON_BOTH |
+				      CTL_FLAG_DATA_OUT,
  CTL_LUN_PAT_NONE},
 
 /* 3C READ BUFFER */
-{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
+{ctl_read_buffer, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_BOTH |
+				     CTL_FLAG_DATA_IN |
+				     CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
+ CTL_LUN_PAT_NONE},
 
 /* 3D UPDATE BLOCK */
 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Thu Jun 26 08:55:06 2014	(r267904)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Thu Jun 26 08:56:36 2014	(r267905)
@@ -2239,6 +2239,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 
 	ctsio->scsi_status = SCSI_STATUS_OK;
 
+	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
 	ctsio->be_move_done = ctl_config_move_done;
 	ctl_datamove((union ctl_io *)ctsio);
 

Modified: head/sys/cam/ctl/ctl_private.h
==============================================================================
--- head/sys/cam/ctl/ctl_private.h	Thu Jun 26 08:55:06 2014	(r267904)
+++ head/sys/cam/ctl/ctl_private.h	Thu Jun 26 08:56:36 2014	(r267905)
@@ -476,6 +476,7 @@ int ctl_scsi_reserve(struct ctl_scsiio *
 int ctl_start_stop(struct ctl_scsiio *ctsio);
 int ctl_sync_cache(struct ctl_scsiio *ctsio);
 int ctl_format(struct ctl_scsiio *ctsio);
+int ctl_read_buffer(struct ctl_scsiio *ctsio);
 int ctl_write_buffer(struct ctl_scsiio *ctsio);
 int ctl_write_same(struct ctl_scsiio *ctsio);
 int ctl_unmap(struct ctl_scsiio *ctsio);

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 09:42:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6B3ACBE1;
 Thu, 26 Jun 2014 09:42:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 589C123E9;
 Thu, 26 Jun 2014 09:42:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5Q9g1rl088374;
 Thu, 26 Jun 2014 09:42:01 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5Q9g0O3088364;
 Thu, 26 Jun 2014 09:42:00 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406260942.s5Q9g0O3088364@svn.freebsd.org>
From: Alexander Motin 
Date: Thu, 26 Jun 2014 09:42:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267906 - in head/sys/cam: ctl scsi
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 09:42:01 -0000

Author: mav
Date: Thu Jun 26 09:42:00 2014
New Revision: 267906
URL: http://svnweb.freebsd.org/changeset/base/267906

Log:
  Allow MODE SENSE commands through Write Exclusive persistent reservation,
  as required by SPC-4.
  
  Report that fact in persistent reservation capabilities.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_cmd_table.c
  head/sys/cam/scsi/scsi_all.h

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Thu Jun 26 08:56:36 2014	(r267905)
+++ head/sys/cam/ctl/ctl.c	Thu Jun 26 09:42:00 2014	(r267906)
@@ -6672,6 +6672,24 @@ ctl_mode_sense(struct ctl_scsiio *ctsio)
 	else
 		control_dev = 0;
 
+	if (lun->flags & CTL_LUN_PR_RESERVED) {
+		uint32_t residx;
+
+		/*
+		 * XXX KDM need a lock here.
+		 */
+		residx = ctl_get_resindex(&ctsio->io_hdr.nexus);
+		if ((lun->res_type == SPR_TYPE_EX_AC
+		  && residx != lun->pr_res_idx)
+		 || ((lun->res_type == SPR_TYPE_EX_AC_RO
+		   || lun->res_type == SPR_TYPE_EX_AC_AR)
+		  && !lun->per_res[residx].registered)) {
+			ctl_set_reservation_conflict(ctsio);
+			ctl_done((union ctl_io *)ctsio);
+			return (CTL_RETVAL_COMPLETE);
+		}
+	}
+
 	switch (ctsio->cdb[0]) {
 	case MODE_SENSE_6: {
 		struct scsi_mode_sense_6 *cdb;
@@ -7465,7 +7483,7 @@ retry:
 
 		res_cap = (struct scsi_per_res_cap *)ctsio->kern_data_ptr;
 		scsi_ulto2b(sizeof(*res_cap), res_cap->length);
-		res_cap->flags2 |= SPRI_TMV;
+		res_cap->flags2 |= SPRI_TMV | SPRI_ALLOW_3;
 		type_mask = SPRI_TM_WR_EX_AR |
 			    SPRI_TM_EX_AC_RO |
 			    SPRI_TM_WR_EX_RO |

Modified: head/sys/cam/ctl/ctl_cmd_table.c
==============================================================================
--- head/sys/cam/ctl/ctl_cmd_table.c	Thu Jun 26 08:56:36 2014	(r267905)
+++ head/sys/cam/ctl/ctl_cmd_table.c	Thu Jun 26 09:42:00 2014	(r267906)
@@ -192,7 +192,8 @@ struct ctl_cmd_entry ctl_cmd_table[] =
 				    CTL_CMD_FLAG_OK_ON_STOPPED |
 				    CTL_CMD_FLAG_OK_ON_INOPERABLE |
 				    CTL_CMD_FLAG_OK_ON_SECONDARY |
-				    CTL_FLAG_DATA_IN,
+				    CTL_FLAG_DATA_IN |
+				    CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
  CTL_LUN_PAT_NONE},
 
 /* 1B START STOP UNIT */
@@ -436,7 +437,8 @@ struct ctl_cmd_entry ctl_cmd_table[] =
 				    CTL_CMD_FLAG_OK_ON_STOPPED |
 				    CTL_CMD_FLAG_OK_ON_INOPERABLE |
 				    CTL_CMD_FLAG_OK_ON_SECONDARY |
-				    CTL_FLAG_DATA_IN,
+				    CTL_FLAG_DATA_IN |
+				    CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
  CTL_LUN_PAT_NONE},
 
 /* 5B CLOSE TRACK/SESSION */

Modified: head/sys/cam/scsi/scsi_all.h
==============================================================================
--- head/sys/cam/scsi/scsi_all.h	Thu Jun 26 08:56:36 2014	(r267905)
+++ head/sys/cam/scsi/scsi_all.h	Thu Jun 26 09:42:00 2014	(r267906)
@@ -308,6 +308,11 @@ struct scsi_per_res_cap
 #define	SPRI_PTPL_C	0x01
 	uint8_t flags2;
 #define	SPRI_TMV	0x80
+#define	SPRI_ALLOW_MASK	0x70
+#define	SPRI_ALLOW_0	0x00
+#define	SPRI_ALLOW_1	0x10
+#define	SPRI_ALLOW_2	0x20
+#define	SPRI_ALLOW_3	0x30
 #define	SPRI_PTPL_A	0x01
 	uint8_t type_mask[2];
 #define	SPRI_TM_WR_EX_AR	0x8000
@@ -746,12 +751,16 @@ struct scsi_read_buffer
 {
 	u_int8_t opcode;
 	u_int8_t byte2;
-#define	RWB_MODE		0x07
+#define	RWB_MODE		0x1F
 #define	RWB_MODE_HDR_DATA	0x00
 #define	RWB_MODE_VENDOR		0x01
 #define	RWB_MODE_DATA		0x02
+#define	RWB_MODE_DESCR		0x03
 #define	RWB_MODE_DOWNLOAD	0x04
 #define	RWB_MODE_DOWNLOAD_SAVE	0x05
+#define	RWB_MODE_ECHO		0x0A
+#define	RWB_MODE_ECHO_DESCR	0x0B
+#define	RWB_MODE_ERROR_HISTORY	0x1C
         u_int8_t buffer_id;
         u_int8_t offset[3];
         u_int8_t length[3];

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 10:21:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 20BE76C7;
 Thu, 26 Jun 2014 10:21:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0DD9027AB;
 Thu, 26 Jun 2014 10:21:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QAL0An004208;
 Thu, 26 Jun 2014 10:21:00 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QAL0dN004204;
 Thu, 26 Jun 2014 10:21:00 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201406261021.s5QAL0dN004204@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Thu, 26 Jun 2014 10:21:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267909 - head/lib/libc/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 10:21:01 -0000

Author: pluknet
Date: Thu Jun 26 10:21:00 2014
New Revision: 267909
URL: http://svnweb.freebsd.org/changeset/base/267909

Log:
  Document EINVAL as per POSIX.
  
  This also follows r124335-r124336, r225827.
  
  PR:		191382
  MFC after:	1 week
  Sponsored by:	Nginx, Inc.

Modified:
  head/lib/libc/sys/bind.2
  head/lib/libc/sys/connect.2

Modified: head/lib/libc/sys/bind.2
==============================================================================
--- head/lib/libc/sys/bind.2	Thu Jun 26 10:13:11 2014	(r267908)
+++ head/lib/libc/sys/bind.2	Thu Jun 26 10:21:00 2014	(r267909)
@@ -28,7 +28,7 @@
 .\"     @(#)bind.2	8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd June 4, 1993
+.Dd June 26, 2014
 .Dt BIND 2
 .Os
 .Sh NAME
@@ -85,6 +85,10 @@ is not a valid descriptor.
 .It Bq Er EINVAL
 The socket is already bound to an address, and the protocol does not support
 binding to a new address; or the socket has been shut down.
+.It Bq Er EINVAL
+The
+.Fa addrlen
+argument is not a valid length for the address family.
 .It Bq Er ENOTSOCK
 The
 .Fa s

Modified: head/lib/libc/sys/connect.2
==============================================================================
--- head/lib/libc/sys/connect.2	Thu Jun 26 10:13:11 2014	(r267908)
+++ head/lib/libc/sys/connect.2	Thu Jun 26 10:21:00 2014	(r267909)
@@ -28,7 +28,7 @@
 .\"     @(#)connect.2	8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd September 5, 2010
+.Dd June 26, 2014
 .Dt CONNECT 2
 .Os
 .Sh NAME
@@ -80,6 +80,10 @@ The
 .Fa s
 argument
 is not a valid descriptor.
+.It Bq Er EINVAL
+The
+.Fa namelen
+argument is not a valid length for the address family.
 .It Bq Er ENOTSOCK
 The
 .Fa s

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 10:48:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id DB2BFCB1;
 Thu, 26 Jun 2014 10:48:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C816E29DE;
 Thu, 26 Jun 2014 10:48:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QAm1P9016800;
 Thu, 26 Jun 2014 10:48:01 GMT
 (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QAm19R016799;
 Thu, 26 Jun 2014 10:48:01 GMT
 (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201406261048.s5QAm19R016799@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Thu, 26 Jun 2014 10:48:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267910 - head/sys/dev/acpica
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 10:48:01 -0000

Author: hselasky
Date: Thu Jun 26 10:48:01 2014
New Revision: 267910
URL: http://svnweb.freebsd.org/changeset/base/267910

Log:
  Remove not needed initialisation code.

Modified:
  head/sys/dev/acpica/acpi_powerres.c

Modified: head/sys/dev/acpica/acpi_powerres.c
==============================================================================
--- head/sys/dev/acpica/acpi_powerres.c	Thu Jun 26 10:21:00 2014	(r267909)
+++ head/sys/dev/acpica/acpi_powerres.c	Thu Jun 26 10:48:01 2014	(r267910)
@@ -92,9 +92,9 @@ struct acpi_powerresource {
 };
 
 static TAILQ_HEAD(acpi_powerresource_list, acpi_powerresource)
-	acpi_powerresources;
+    acpi_powerresources = TAILQ_HEAD_INITIALIZER(acpi_powerresources);
 static TAILQ_HEAD(acpi_powerconsumer_list, acpi_powerconsumer)
-	acpi_powerconsumers;
+    acpi_powerconsumers = TAILQ_HEAD_INITIALIZER(acpi_powerconsumers);
 ACPI_SERIAL_DECL(powerres, "ACPI power resources");
 
 static ACPI_STATUS	acpi_pwr_register_consumer(ACPI_HANDLE consumer);
@@ -115,15 +115,6 @@ static struct acpi_powerresource
 static struct acpi_powerconsumer
 			*acpi_pwr_find_consumer(ACPI_HANDLE consumer);
 
-/* Initialise our lists. */    
-static void
-acpi_pwr_init(void *junk)
-{
-    TAILQ_INIT(&acpi_powerresources);
-    TAILQ_INIT(&acpi_powerconsumers);
-}
-SYSINIT(acpi_powerresource, SI_SUB_TUNABLES, SI_ORDER_ANY, acpi_pwr_init, NULL);
-
 /*
  * Register a power resource.
  *

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 12:12:18 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9BA6DD50;
 Thu, 26 Jun 2014 12:12:18 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7C5BB222C;
 Thu, 26 Jun 2014 12:12:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QCCIef059332;
 Thu, 26 Jun 2014 12:12:18 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QCCIWE059331;
 Thu, 26 Jun 2014 12:12:18 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201406261212.s5QCCIWE059331@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Thu, 26 Jun 2014 12:12:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267912 - head/lib/libc/net
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 12:12:18 -0000

Author: ume
Date: Thu Jun 26 12:12:18 2014
New Revision: 267912
URL: http://svnweb.freebsd.org/changeset/base/267912

Log:
  - Exclude loopback address rather than loopback interface.
  - style(9)
  
  TODO: When AI_ADDRCONFIG is specified, getaddrinfo() can
  be quite slow for system with many interfaces.  We should
  have some kernel sysctls to report IPv4/IPv6 status.
  
  Spotted by:	melifaro
  MFC after:	1 week

Modified:
  head/lib/libc/net/getaddrinfo.c

Modified: head/lib/libc/net/getaddrinfo.c
==============================================================================
--- head/lib/libc/net/getaddrinfo.c	Thu Jun 26 11:02:51 2014	(r267911)
+++ head/lib/libc/net/getaddrinfo.c	Thu Jun 26 12:12:18 2014	(r267912)
@@ -1532,7 +1532,7 @@ find_afd(int af)
 }
 
 /*
- * post-2553: AI_ADDRCONFIG check.  Determines which address families are
+ * RFC 3493: AI_ADDRCONFIG check.  Determines which address families are
  * configured on the local system and correlates with pai->ai_family value.
  * If an address family is not configured on the system, it will not be
  * queried for.  For this purpose, loopback addresses are not considered
@@ -1545,24 +1545,38 @@ static int
 addrconfig(struct addrinfo *pai)
 {
 	struct ifaddrs *ifaddrs, *ifa;
+	struct sockaddr_in *sin;
+	struct sockaddr_in6 *sin6;
 	int seen_inet = 0, seen_inet6 = 0;
 
 	if (getifaddrs(&ifaddrs) != 0)
-		return 0;
+		return (0);
 
 	for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) {
 		if (ifa->ifa_addr == NULL || (ifa->ifa_flags & IFF_UP) == 0)
 			continue;
-		if ((ifa->ifa_flags & IFT_LOOP) != 0)
-			continue;
 		switch (ifa->ifa_addr->sa_family) {
 		case AF_INET:
+			if (seen_inet)
+				continue;
+			sin = (struct sockaddr_in *)(ifa->ifa_addr);
+			if (IN_LOOPBACK(htonl(sin->sin_addr.s_addr)))
+				continue;
 			seen_inet = 1;
 			break;
 #ifdef INET6
 		case AF_INET6:
-			if (!seen_inet6 && !is_ifdisabled(ifa->ifa_name))
-				seen_inet6 = 1;
+			if (seen_inet6)
+				continue;
+			sin6 = (struct sockaddr_in6 *)(ifa->ifa_addr);
+			if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr))
+				continue;
+			if ((ifa->ifa_flags & IFT_LOOP) != 0 &&
+			    IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))
+				continue;
+			if (is_ifdisabled(ifa->ifa_name))
+				continue;
+			seen_inet6 = 1;
 			break;
 #endif
 		}
@@ -1571,16 +1585,16 @@ addrconfig(struct addrinfo *pai)
 
 	switch(pai->ai_family) {
 	case AF_INET6:
-		return seen_inet6;
+		return (seen_inet6);
 	case AF_INET:
-		return seen_inet;
+		return (seen_inet);
 	case AF_UNSPEC:
 		if (seen_inet == seen_inet6)
-			return seen_inet;
+			return (seen_inet);
 		pai->ai_family = seen_inet ? AF_INET : AF_INET6;
-		return 1;
+		return (1);
 	}
-	return 1;
+	return (1);
 }
 
 #ifdef INET6
@@ -1591,12 +1605,12 @@ is_ifdisabled(char *name)
 	int fd;
 
 	if ((fd = _socket(AF_INET6, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0)
-		return -1;
+		return (-1);
 	memset(&nd, 0, sizeof(nd));
 	strlcpy(nd.ifname, name, sizeof(nd.ifname));
 	if (_ioctl(fd, SIOCGIFINFO_IN6, &nd) < 0) {
 		_close(fd);
-		return -1;
+		return (-1);
 	}
 	_close(fd);
 	return ((nd.ndi.flags & ND6_IFF_IFDISABLED) != 0);

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 13:57:45 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 55F5A757;
 Thu, 26 Jun 2014 13:57:45 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 294272B84;
 Thu, 26 Jun 2014 13:57:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QDvjfZ006316;
 Thu, 26 Jun 2014 13:57:45 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QDvi1L006310;
 Thu, 26 Jun 2014 13:57:44 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201406261357.s5QDvi1L006310@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Thu, 26 Jun 2014 13:57:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267914 - in head: sbin/dhclient sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 13:57:45 -0000

Author: pjd
Date: Thu Jun 26 13:57:44 2014
New Revision: 267914
URL: http://svnweb.freebsd.org/changeset/base/267914

Log:
  Remove duplicated includes.
  
  Submitted by:	Mariusz Zaborski 

Modified:
  head/sbin/dhclient/bpf.c
  head/sbin/dhclient/dhclient.c
  head/sys/kern/kern_exec.c
  head/sys/kern/subr_capability.c

Modified: head/sbin/dhclient/bpf.c
==============================================================================
--- head/sbin/dhclient/bpf.c	Thu Jun 26 13:02:21 2014	(r267913)
+++ head/sbin/dhclient/bpf.c	Thu Jun 26 13:57:44 2014	(r267914)
@@ -43,8 +43,6 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include 
-
 #include "dhcpd.h"
 #include "privsep.h"
 #include 

Modified: head/sbin/dhclient/dhclient.c
==============================================================================
--- head/sbin/dhclient/dhclient.c	Thu Jun 26 13:02:21 2014	(r267913)
+++ head/sbin/dhclient/dhclient.c	Thu Jun 26 13:57:44 2014	(r267914)
@@ -56,8 +56,6 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include 
-
 #include "dhcpd.h"
 #include "privsep.h"
 

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c	Thu Jun 26 13:02:21 2014	(r267913)
+++ head/sys/kern/kern_exec.c	Thu Jun 26 13:57:44 2014	(r267914)
@@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/kern/subr_capability.c
==============================================================================
--- head/sys/kern/subr_capability.c	Thu Jun 26 13:02:21 2014	(r267913)
+++ head/sys/kern/subr_capability.c	Thu Jun 26 13:57:44 2014	(r267914)
@@ -34,16 +34,14 @@ __FBSDID("$FreeBSD$");
  * Note that this file is compiled into the kernel and into libc.
  */
 
-#ifdef _KERNEL
 #include 
 #include 
+
+#ifdef _KERNEL
 #include 
 
 #include 
 #else	/* !_KERNEL */
-#include 
-#include 
-
 #include 
 #include 
 #include 

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 14:24:31 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D1838633;
 Thu, 26 Jun 2014 14:24:31 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BF1962E95;
 Thu, 26 Jun 2014 14:24:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QEOVag021001;
 Thu, 26 Jun 2014 14:24:31 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QEOVdO021000;
 Thu, 26 Jun 2014 14:24:31 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201406261424.s5QEOVdO021000@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Thu, 26 Jun 2014 14:24:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267915 - head/lib/libc/net
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 14:24:31 -0000

Author: ume
Date: Thu Jun 26 14:24:31 2014
New Revision: 267915
URL: http://svnweb.freebsd.org/changeset/base/267915

Log:
  Fix build with WITHOUT_INET6.
  
  Spotted by:	bf
  MFC after:	1 week

Modified:
  head/lib/libc/net/getaddrinfo.c

Modified: head/lib/libc/net/getaddrinfo.c
==============================================================================
--- head/lib/libc/net/getaddrinfo.c	Thu Jun 26 13:57:44 2014	(r267914)
+++ head/lib/libc/net/getaddrinfo.c	Thu Jun 26 14:24:31 2014	(r267915)
@@ -1546,7 +1546,9 @@ addrconfig(struct addrinfo *pai)
 {
 	struct ifaddrs *ifaddrs, *ifa;
 	struct sockaddr_in *sin;
+#ifdef INET6
 	struct sockaddr_in6 *sin6;
+#endif
 	int seen_inet = 0, seen_inet6 = 0;
 
 	if (getifaddrs(&ifaddrs) != 0)

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 15:59:48 2014
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C862DF74;
 Thu, 26 Jun 2014 15:59:48 +0000 (UTC)
Received: from felyko.com (felyko.com [IPv6:2001:470:1:2d5:26:3:1337:ca7])
 by mx1.freebsd.org (Postfix) with ESMTP id AA3D42A3D;
 Thu, 26 Jun 2014 15:59:48 +0000 (UTC)
Received: from [10.0.1.3] (c-24-6-115-18.hsd1.ca.comcast.net [24.6.115.18])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by felyko.com (Postfix) with ESMTPSA id 81D0434A9D8;
 Thu, 26 Jun 2014 08:59:47 -0700 (PDT)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r267898 - in head:
 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs
 cddl/contrib/opensolaris/lib/libdtrace/common
 sys/cddl/contrib/opensolaris/uts/common/sys
From: Rui Paulo 
In-Reply-To: 
Date: Thu, 26 Jun 2014 08:59:46 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <92E13997-8653-4A99-912A-F06540EA22C8@FreeBSD.org>
References: <201406260706.s5Q76hYW014217@svn.freebsd.org>
 <53ABC9FE.4000107@FreeBSD.org>
 
To: Pedro Giffuni 
X-Mailer: Apple Mail (2.1878.2)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
 src-committers@FreeBSD.org, Andriy Gapon 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 15:59:48 -0000

On Jun 26, 2014, at 1:16, Pedro Giffuni  wrote:

> 2) It is not respecting the order in which upstream (Illumos AFAICT) =
adds features so it breaks the sense of DT_VERS_LATEST

I disagree.  I specifically added a new version, 1.9.2, which is not =
present in Illumos to cope with this.  DT_VERS_LATEST points to our =
latest version, not Illumos latest version.  I don't think it's =
necessary to merge all the other versions when we can have our own =
version number.

--
Rui Paulo




From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 16:04:04 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8CA375DF;
 Thu, 26 Jun 2014 16:04:04 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 603AA2B5B;
 Thu, 26 Jun 2014 16:04:04 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QG44kM069093;
 Thu, 26 Jun 2014 16:04:04 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QG44OR069092;
 Thu, 26 Jun 2014 16:04:04 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201406261604.s5QG44OR069092@svn.freebsd.org>
From: Alan Cox 
Date: Thu, 26 Jun 2014 16:04:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267917 - head/sys/vm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 16:04:04 -0000

Author: alc
Date: Thu Jun 26 16:04:03 2014
New Revision: 267917
URL: http://svnweb.freebsd.org/changeset/base/267917

Log:
  Delay the call to crhold() in vm_map_insert() until we know that we won't
  have to undo it by calling crfree().  This reduces the total number of calls
  by vm_map_insert() to crhold() and crfree() by 45% in my tests.
  
  Eliminate an unnecessary variable from vm_map_insert().
  
  Reviewed by:	kib
  Tested by:	pho

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Thu Jun 26 15:25:42 2014	(r267916)
+++ head/sys/vm/vm_map.c	Thu Jun 26 16:04:03 2014	(r267917)
@@ -1127,7 +1127,6 @@ vm_map_insert(vm_map_t map, vm_object_t 
 	vm_eflags_t protoeflags;
 	struct ucred *cred;
 	vm_inherit_t inheritance;
-	boolean_t charge_prev_obj;
 
 	VM_MAP_ASSERT_LOCKED(map);
 	KASSERT((object != kmem_object && object != kernel_object) ||
@@ -1180,7 +1179,6 @@ vm_map_insert(vm_map_t map, vm_object_t 
 		inheritance = VM_INHERIT_DEFAULT;
 
 	cred = NULL;
-	charge_prev_obj = FALSE;
 	if (cow & (MAP_ACC_NO_CHARGE | MAP_NOFAULT))
 		goto charged;
 	if ((cow & MAP_ACC_CHARGED) || ((prot & VM_PROT_WRITE) &&
@@ -1191,9 +1189,6 @@ vm_map_insert(vm_map_t map, vm_object_t 
 		    object->cred == NULL,
 		    ("OVERCOMMIT: vm_map_insert o %p", object));
 		cred = curthread->td_ucred;
-		crhold(cred);
-		if (object == NULL && !(protoeflags & MAP_ENTRY_NEEDS_COPY))
-			charge_prev_obj = TRUE;
 	}
 
 charged:
@@ -1224,7 +1219,8 @@ charged:
 		   vm_object_coalesce(prev_entry->object.vm_object,
 		       prev_entry->offset,
 		       (vm_size_t)(prev_entry->end - prev_entry->start),
-		       (vm_size_t)(end - prev_entry->end), charge_prev_obj)) {
+		       (vm_size_t)(end - prev_entry->end), cred != NULL &&
+		       (protoeflags & MAP_ENTRY_NEEDS_COPY) == 0)) {
 		/*
 		 * We were able to extend the object.  Determine if we
 		 * can extend the previous map entry to include the
@@ -1237,8 +1233,6 @@ charged:
 			prev_entry->end = end;
 			vm_map_entry_resize_free(map, prev_entry);
 			vm_map_simplify_entry(map, prev_entry);
-			if (cred != NULL)
-				crfree(cred);
 			return (KERN_SUCCESS);
 		}
 
@@ -1255,10 +1249,11 @@ charged:
 		if (cred != NULL && object != NULL && object->cred != NULL &&
 		    !(prev_entry->eflags & MAP_ENTRY_NEEDS_COPY)) {
 			/* Object already accounts for this uid. */
-			crfree(cred);
 			cred = NULL;
 		}
 	}
+	if (cred != NULL)
+		crhold(cred);
 
 	/*
 	 * Create a new entry

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 16:49:45 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A86E89FB;
 Thu, 26 Jun 2014 16:49:45 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9485C2FD3;
 Thu, 26 Jun 2014 16:49:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QGnjPM089509;
 Thu, 26 Jun 2014 16:49:45 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QGnj2h089508;
 Thu, 26 Jun 2014 16:49:45 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201406261649.s5QGnj2h089508@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Thu, 26 Jun 2014 16:49:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267918 - head/sys/dev/netfpga10g/nf10bmac
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 16:49:45 -0000

Author: bz
Date: Thu Jun 26 16:49:45 2014
New Revision: 267918
URL: http://svnweb.freebsd.org/changeset/base/267918

Log:
  In preparation for 64bit mode remove all the _4 from the function and
  macro names, rename val4 to val, and m4 to md.
  
  No functional change.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c

Modified: head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c
==============================================================================
--- head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c	Thu Jun 26 16:04:03 2014	(r267917)
+++ head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c	Thu Jun 26 16:49:45 2014	(r267918)
@@ -121,15 +121,15 @@ static poll_handler_t nf10bmac_poll;
 
 
 static inline void
-nf10bmac_write_4(struct resource *res, uint32_t reg, uint32_t val4,
+nf10bmac_write(struct resource *res, uint32_t reg, uint32_t val,
     const char *f __unused, const int l __unused)
 {
 
-	bus_write_4(res, reg, htole32(val4));
+	bus_write_4(res, reg, htole32(val));
 }
 
 static inline uint32_t
-nf10bmac_read_4(struct resource *res, uint32_t reg,
+nf10bmac_read(struct resource *res, uint32_t reg,
     const char *f __unused, const int l __unused)
 {
 
@@ -137,50 +137,50 @@ nf10bmac_read_4(struct resource *res, ui
 }
 
 static inline void
-nf10bmac_write_4_be(struct resource *res, uint32_t reg, uint32_t val4,
+nf10bmac_write_be(struct resource *res, uint32_t reg, uint32_t val,
     const char *f __unused, const int l __unused)
 {
 
-	bus_write_4(res, reg, htobe32(val4));
+	bus_write_4(res, reg, htobe32(val));
 }
 
 
 static inline uint32_t
-nf10bmac_read_4_be(struct resource *res, uint32_t reg,
+nf10bmac_read_be(struct resource *res, uint32_t reg,
     const char *f __unused, const int l __unused)
 {
 
 	return (be32toh(bus_read_4(res, reg)));
 }
 
-#define	NF10BMAC_WRITE_CTRL_4(sc, reg, val)				\
-	nf10bmac_write_4((sc)->nf10bmac_ctrl_res, (reg), (val),		\
+#define	NF10BMAC_WRITE_CTRL(sc, reg, val)				\
+	nf10bmac_write((sc)->nf10bmac_ctrl_res, (reg), (val),		\
 	    __func__, __LINE__)
-#define	NF10BMAC_WRITE_4(sc, reg, val)					\
-	nf10bmac_write_4((sc)->nf10bmac_tx_mem_res, (reg), (val),	\
+#define	NF10BMAC_WRITE(sc, reg, val)					\
+	nf10bmac_write((sc)->nf10bmac_tx_mem_res, (reg), (val),		\
 	    __func__, __LINE__)
-#define	NF10BMAC_READ_4(sc, reg)					\
-	nf10bmac_read_4((sc)->nf10bmac_rx_mem_res, (reg),		\
+#define	NF10BMAC_READ(sc, reg)						\
+	nf10bmac_read((sc)->nf10bmac_rx_mem_res, (reg),			\
 	    __func__, __LINE__)
-#define	NF10BMAC_WRITE_4_BE(sc, reg, val)				\
-	nf10bmac_write_4_be((sc)->nf10bmac_tx_mem_res, (reg), (val),	\
+#define	NF10BMAC_WRITE_BE(sc, reg, val)					\
+	nf10bmac_write_be((sc)->nf10bmac_tx_mem_res, (reg), (val),	\
 	    __func__, __LINE__)
-#define	NF10BMAC_READ_4_BE(sc, reg)					\
-	nf10bmac_read_4_be((sc)->nf10bmac_rx_mem_res, (reg),		\
+#define	NF10BMAC_READ_BE(sc, reg)					\
+	nf10bmac_read_be((sc)->nf10bmac_rx_mem_res, (reg),		\
 	    __func__, __LINE__)
 
-#define	NF10BMAC_WRITE_INTR_4(sc, reg, val, _f, _l)			\
-	nf10bmac_write_4((sc)->nf10bmac_intr_res, (reg), (val),		\
+#define	NF10BMAC_WRITE_INTR(sc, reg, val, _f, _l)			\
+	nf10bmac_write((sc)->nf10bmac_intr_res, (reg), (val),		\
 	    (_f), (_l))
 
 #define	NF10BMAC_RX_INTR_CLEAR_DIS(sc)					\
-	NF10BMAC_WRITE_INTR_4((sc), NF10BMAC_INTR_CLEAR_DIS, 1,		\
+	NF10BMAC_WRITE_INTR((sc), NF10BMAC_INTR_CLEAR_DIS, 1,		\
 	__func__, __LINE__)
 #define	NF10BMAC_RX_INTR_ENABLE(sc)					\
-	NF10BMAC_WRITE_INTR_4((sc), NF10BMAC_INTR_CTRL, 1,		\
+	NF10BMAC_WRITE_INTR((sc), NF10BMAC_INTR_CTRL, 1,		\
 	__func__, __LINE__)
 #define	NF10BMAC_RX_INTR_DISABLE(sc)					\
-	NF10BMAC_WRITE_INTR_4((sc), NF10BMAC_INTR_CTRL, 0,		\
+	NF10BMAC_WRITE_INTR((sc), NF10BMAC_INTR_CTRL, 0,		\
 	__func__, __LINE__)
 
 
@@ -196,7 +196,7 @@ static int
 nf10bmac_tx_locked(struct nf10bmac_softc *sc, struct mbuf *m)
 {
 	int32_t len, l, ml;
-	uint32_t m4, val4;
+	uint32_t md, val;
 
 	NF10BMAC_LOCK_ASSERT(sc);
 
@@ -211,16 +211,16 @@ nf10bmac_tx_locked(struct nf10bmac_softc
 	len = m->m_pkthdr.len;
 
 	/* Write the length at start of packet. */
-	NF10BMAC_WRITE_4(sc, NF10BMAC_TX_LEN, len);
+	NF10BMAC_WRITE(sc, NF10BMAC_TX_LEN, len);
 
 	/* Write the meta data and data. */
-	ml = len / sizeof(val4);
-	len -= (ml * sizeof(val4));
+	ml = len / sizeof(val);
+	len -= (ml * sizeof(val));
 	for (l = 0; l <= ml; l++) {
 		int32_t cl;
 
-		cl = sizeof(val4);
-		m4 = (NF10BMAC_TUSER_CPU0 << NF10BMAC_DATA_SPORT_SHIFT);
+		cl = sizeof(val);
+		md = (NF10BMAC_TUSER_CPU0 << NF10BMAC_DATA_SPORT_SHIFT);
 		if (l == ml || (len == 0 && l == (ml - 1))) {
 			if (l == ml && len == 0) {
 				break;
@@ -234,15 +234,15 @@ nf10bmac_tx_locked(struct nf10bmac_softc
 
 				for (s = 0, sl = len; sl > 0; sl--)
 					s |= (1 << (sl - 1));
-				m4 |= (s & NF10BMAC_DATA_STRB);
-				m4 |= NF10BMAC_DATA_LAST;
+				md |= (s & NF10BMAC_DATA_STRB);
+				md |= NF10BMAC_DATA_LAST;
 			}
 		} else {
-			m4 |= NF10BMAC_DATA_STRB;
+			md |= NF10BMAC_DATA_STRB;
 		}
-		NF10BMAC_WRITE_4(sc, NF10BMAC_TX_META, m4);
-		bcopy(&sc->nf10bmac_tx_buf[l*sizeof(val4)], &val4, cl);
-		NF10BMAC_WRITE_4_BE(sc, NF10BMAC_TX_DATA, val4);	
+		NF10BMAC_WRITE(sc, NF10BMAC_TX_META, md);
+		bcopy(&sc->nf10bmac_tx_buf[l*sizeof(val)], &val, cl);
+		NF10BMAC_WRITE_BE(sc, NF10BMAC_TX_DATA, val);	
 	}
 
 	/* If anyone is interested give them a copy. */
@@ -311,14 +311,14 @@ nf10bmac_start(struct ifnet *ifp)
 static void
 nf10bmac_eat_packet_munch_munch(struct nf10bmac_softc *sc)
 {
-	uint32_t m4, val4;
+	uint32_t md, val;
 
 	do {
-		m4 = NF10BMAC_READ_4_BE(sc, NF10BMAC_RX_META);
-		if ((m4 & NF10BMAC_DATA_STRB) != 0)
-			val4 = NF10BMAC_READ_4_BE(sc, NF10BMAC_RX_DATA);
-	} while ((m4 & NF10BMAC_DATA_STRB) != 0 &&
-	    (m4 & NF10BMAC_DATA_LAST) == 0);
+		md = NF10BMAC_READ_BE(sc, NF10BMAC_RX_META);
+		if ((md & NF10BMAC_DATA_STRB) != 0)
+			val = NF10BMAC_READ_BE(sc, NF10BMAC_RX_DATA);
+	} while ((md & NF10BMAC_DATA_STRB) != 0 &&
+	    (md & NF10BMAC_DATA_LAST) == 0);
 }
 
 static int
@@ -326,7 +326,7 @@ nf10bmac_rx_locked(struct nf10bmac_softc
 {
 	struct ifnet *ifp;
 	struct mbuf *m;
-	uint32_t m4, val4;
+	uint32_t md, val;
 	int32_t len, l;
 
 	/*
@@ -336,21 +336,21 @@ nf10bmac_rx_locked(struct nf10bmac_softc
 	 * skip to tlast).
 	 */
 
-	len = NF10BMAC_READ_4(sc, NF10BMAC_RX_LEN) & NF10BMAC_DATA_LEN_MASK;
+	len = NF10BMAC_READ(sc, NF10BMAC_RX_LEN) & NF10BMAC_DATA_LEN_MASK;
 	if (len > (MCLBYTES - ETHER_ALIGN)) {
 		nf10bmac_eat_packet_munch_munch(sc);
 		return (0);
 	}
 
-	m4 = NF10BMAC_READ_4(sc, NF10BMAC_RX_META);
-	if (len == 0 && (m4 & NF10BMAC_DATA_STRB) == 0) {
+	md = NF10BMAC_READ(sc, NF10BMAC_RX_META);
+	if (len == 0 && (md & NF10BMAC_DATA_STRB) == 0) {
 		/* No packet data available. */
 		return (0);
-	} else if (len == 0 && (m4 & NF10BMAC_DATA_STRB) != 0) {
+	} else if (len == 0 && (md & NF10BMAC_DATA_STRB) != 0) {
 		/* We are in the middle of a packet. */
 		nf10bmac_eat_packet_munch_munch(sc);
 		return (0);
-	} else if ((m4 & NF10BMAC_DATA_STRB) == 0) {
+	} else if ((md & NF10BMAC_DATA_STRB) == 0) {
 		/* Invalid length "hint". */
 		device_printf(sc->nf10bmac_dev,
 		    "Unexpected length %d on zero strb\n", len);
@@ -377,13 +377,13 @@ nf10bmac_rx_locked(struct nf10bmac_softc
 	ifp = sc->nf10bmac_ifp;
 	l = 0;
 /*
-	while ((m4 & NF10BMAC_DATA_STRB) != 0 && l < len) {
+	while ((md & NF10BMAC_DATA_STRB) != 0 && l < len) {
 */
 	while (l < len) {
 		size_t cl;
 
-		if ((m4 & NF10BMAC_DATA_LAST) == 0 &&
-		    (len - l) < sizeof(val4)) {
+		if ((md & NF10BMAC_DATA_LAST) == 0 &&
+		    (len - l) < sizeof(val)) {
 			/*
 			 * Our length and LAST disagree. We have a valid STRB.
 			 * We could continue until we fill the mbuf and just
@@ -394,34 +394,34 @@ nf10bmac_rx_locked(struct nf10bmac_softc
 			ifp->if_ierrors++;
 			m_freem(m);
 			return (0);
-		} else if ((len - l) <= sizeof(val4)) {
+		} else if ((len - l) <= sizeof(val)) {
 			cl = len - l;
 		} else {
-			cl = sizeof(val4);
+			cl = sizeof(val);
 		}
 
 		/* Read the first bytes of data as well. */
-		val4 = NF10BMAC_READ_4_BE(sc, NF10BMAC_RX_DATA);
-		bcopy(&val4, (uint8_t *)(m->m_data + l), cl);
+		val = NF10BMAC_READ_BE(sc, NF10BMAC_RX_DATA);
+		bcopy(&val, (uint8_t *)(m->m_data + l), cl);
 		l += cl;
 
-		if ((m4 & NF10BMAC_DATA_LAST) != 0 || l >= len)
+		if ((md & NF10BMAC_DATA_LAST) != 0 || l >= len)
 			break;
 		else {
 			DELAY(50);
-			m4 = NF10BMAC_READ_4(sc, NF10BMAC_RX_META);
+			md = NF10BMAC_READ(sc, NF10BMAC_RX_META);
 		}
 
 		cl = 10;
-		while ((m4 & NF10BMAC_DATA_STRB) == 0 && cl-- > 0) {
+		while ((md & NF10BMAC_DATA_STRB) == 0 && cl-- > 0) {
 			DELAY(10);
-			m4 = NF10BMAC_READ_4(sc, NF10BMAC_RX_META);
+			md = NF10BMAC_READ(sc, NF10BMAC_RX_META);
 		}
 	}
 	/* We should get out of this loop with tlast and tsrb. */
-	if ((m4 & NF10BMAC_DATA_LAST) == 0 || (m4 & NF10BMAC_DATA_STRB) == 0) {
+	if ((md & NF10BMAC_DATA_LAST) == 0 || (md & NF10BMAC_DATA_STRB) == 0) {
 		device_printf(sc->nf10bmac_dev, "Unexpected rx loop end state: "
-		    "m4=0x%08x len=%d l=%d\n", m4, len, l);
+		    "md=0x%08x len=%d l=%d\n", md, len, l);
 		ifp->if_ierrors++;
 		m_freem(m);
 		return (0);

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 17:03:08 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E56514DF;
 Thu, 26 Jun 2014 17:03:08 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D28862219;
 Thu, 26 Jun 2014 17:03:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QH38g2098274;
 Thu, 26 Jun 2014 17:03:08 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QH387o098273;
 Thu, 26 Jun 2014 17:03:08 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201406261703.s5QH387o098273@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Thu, 26 Jun 2014 17:03:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267919 - head/sys/dev/netfpga10g/nf10bmac
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 17:03:09 -0000

Author: bz
Date: Thu Jun 26 17:03:08 2014
New Revision: 267919
URL: http://svnweb.freebsd.org/changeset/base/267919

Log:
  Rather than using a constant use sizeof(val) allowing for the length
  to automatically change as we switch between 32/64bit.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c

Modified: head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c
==============================================================================
--- head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c	Thu Jun 26 16:49:45 2014	(r267918)
+++ head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c	Thu Jun 26 17:03:08 2014	(r267919)
@@ -229,7 +229,7 @@ nf10bmac_tx_locked(struct nf10bmac_softc
 				int sl;
 
 				if (l == (ml - 1))
-					len = 4;
+					len = sizeof(val);
 				cl = len;
 
 				for (s = 0, sl = len; sl > 0; sl--)

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 17:10:08 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0204E737;
 Thu, 26 Jun 2014 17:10:08 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D6B9822B9;
 Thu, 26 Jun 2014 17:10:07 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QHA7PI099530;
 Thu, 26 Jun 2014 17:10:07 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QHA7t6099525;
 Thu, 26 Jun 2014 17:10:07 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201406261710.s5QHA7t6099525@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Thu, 26 Jun 2014 17:10:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267920 - head/sys/dev/netfpga10g/nf10bmac
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 17:10:08 -0000

Author: bz
Date: Thu Jun 26 17:10:07 2014
New Revision: 267920
URL: http://svnweb.freebsd.org/changeset/base/267920

Log:
  Allow switching between 32bit and 64bit bus width data access at compile
  time by setting NF10BMAC_64BIT and using a REGWTYPE #define to set correct
  variable and return value widths.
  
  Adjust comments to indicate the 32 or 64bit register widths.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c
  head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c

Modified: head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c
==============================================================================
--- head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c	Thu Jun 26 17:03:08 2014	(r267919)
+++ head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c	Thu Jun 26 17:10:07 2014	(r267920)
@@ -117,40 +117,62 @@ static poll_handler_t nf10bmac_poll;
 #define	NF10BMAC_DATA_SPORT_MASK	0x00ff0000
 #define	NF10BMAC_DATA_SPORT_SHIFT	16
 #define	NF10BMAC_DATA_LAST		0x00008000
+#ifdef NF10BMAC_64BIT
+#define	NF10BMAC_DATA_STRB		0x000000ff
+#define	REGWTYPE			uint64_t
+#else
 #define	NF10BMAC_DATA_STRB		0x0000000f
+#define	REGWTYPE			uint32_t
+#endif
 
 
 static inline void
-nf10bmac_write(struct resource *res, uint32_t reg, uint32_t val,
+nf10bmac_write(struct resource *res, REGWTYPE reg, REGWTYPE val,
     const char *f __unused, const int l __unused)
 {
 
+#ifdef NF10BMAC_64BIT
+	bus_write_8(res, reg, htole64(val));
+#else
 	bus_write_4(res, reg, htole32(val));
+#endif
 }
 
-static inline uint32_t
-nf10bmac_read(struct resource *res, uint32_t reg,
+static inline REGWTYPE
+nf10bmac_read(struct resource *res, REGWTYPE reg,
     const char *f __unused, const int l __unused)
 {
 
+#ifdef NF10BMAC_64BIT
+	return (le64toh(bus_read_8(res, reg)));
+#else
 	return (le32toh(bus_read_4(res, reg)));
+#endif
 }
 
 static inline void
-nf10bmac_write_be(struct resource *res, uint32_t reg, uint32_t val,
+nf10bmac_write_be(struct resource *res, REGWTYPE reg, REGWTYPE val,
     const char *f __unused, const int l __unused)
 {
 
+#ifdef NF10BMAC_64BIT
+	bus_write_8(res, reg, htobe64(val));
+#else
 	bus_write_4(res, reg, htobe32(val));
+#endif
 }
 
 
-static inline uint32_t
-nf10bmac_read_be(struct resource *res, uint32_t reg,
+static inline REGWTYPE
+nf10bmac_read_be(struct resource *res, REGWTYPE reg,
     const char *f __unused, const int l __unused)
 {
 
+#ifdef NF10BMAC_64BIT
+	return (be64toh(bus_read_8(res, reg)));
+#else
 	return (be32toh(bus_read_4(res, reg)));
+#endif
 }
 
 #define	NF10BMAC_WRITE_CTRL(sc, reg, val)				\
@@ -196,7 +218,7 @@ static int
 nf10bmac_tx_locked(struct nf10bmac_softc *sc, struct mbuf *m)
 {
 	int32_t len, l, ml;
-	uint32_t md, val;
+	REGWTYPE md, val;
 
 	NF10BMAC_LOCK_ASSERT(sc);
 
@@ -311,7 +333,7 @@ nf10bmac_start(struct ifnet *ifp)
 static void
 nf10bmac_eat_packet_munch_munch(struct nf10bmac_softc *sc)
 {
-	uint32_t md, val;
+	REGWTYPE md, val;
 
 	do {
 		md = NF10BMAC_READ_BE(sc, NF10BMAC_RX_META);
@@ -326,7 +348,7 @@ nf10bmac_rx_locked(struct nf10bmac_softc
 {
 	struct ifnet *ifp;
 	struct mbuf *m;
-	uint32_t md, val;
+	REGWTYPE md, val;
 	int32_t len, l;
 
 	/*
@@ -421,7 +443,7 @@ nf10bmac_rx_locked(struct nf10bmac_softc
 	/* We should get out of this loop with tlast and tsrb. */
 	if ((md & NF10BMAC_DATA_LAST) == 0 || (md & NF10BMAC_DATA_STRB) == 0) {
 		device_printf(sc->nf10bmac_dev, "Unexpected rx loop end state: "
-		    "md=0x%08x len=%d l=%d\n", md, len, l);
+		    "md=0x%08jx len=%d l=%d\n", (uintmax_t)md, len, l);
 		ifp->if_ierrors++;
 		m_freem(m);
 		return (0);

Modified: head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c
==============================================================================
--- head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c	Thu Jun 26 17:03:08 2014	(r267919)
+++ head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c	Thu Jun 26 17:10:07 2014	(r267920)
@@ -90,7 +90,7 @@ nf10bmac_attach_fdt(device_t dev)
 
 	/*
 	 * LOOP memory region (this could be a general control region).
-	 * 0x00: 32bit register to enable a Y-"lopback".
+	 * 0x00: 32/64bit register to enable a Y-"lopback".
 	 */
         sc->nf10bmac_ctrl_rid = 0;
         sc->nf10bmac_ctrl_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
@@ -108,9 +108,9 @@ nf10bmac_attach_fdt(device_t dev)
 
         /*
          * TX and TX metadata FIFO memory region.
-         * 0x00: 32bit FIFO data,
-	 * 0x08: 32bit FIFO metadata,
-         * 0x10: 32bit packet length.
+         * 0x00: 32/64bit FIFO data,
+	 * 0x08: 32/64bit FIFO metadata,
+         * 0x10: 32/64bit packet length.
          */
         sc->nf10bmac_tx_mem_rid = 1;
         sc->nf10bmac_tx_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
@@ -128,9 +128,9 @@ nf10bmac_attach_fdt(device_t dev)
 
         /*
          * RX and RXC metadata FIFO memory region.
-         * 0x00: 32bit FIFO data,
-	 * 0x08: 32bit FIFO metadata,
-         * 0x10: 32bit packet length.
+         * 0x00: 32/64bit FIFO data,
+	 * 0x08: 32/64bit FIFO metadata,
+         * 0x10: 32/64bit packet length.
          */
         sc->nf10bmac_rx_mem_rid = 2;
         sc->nf10bmac_rx_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
@@ -148,8 +148,8 @@ nf10bmac_attach_fdt(device_t dev)
 
 	/*
 	 * Interrupt handling registers.
-	 * 0x00: 32bit register to clear (and disable) the RX interrupt.
-	 * 0x08: 32bit register to enable or disable the RX interrupt.
+	 * 0x00: 32/64bit register to clear (and disable) the RX interrupt.
+	 * 0x08: 32/64bit register to enable or disable the RX interrupt.
 	 */
         sc->nf10bmac_intr_rid = 3;
         sc->nf10bmac_intr_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 17:15:42 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 77C89930;
 Thu, 26 Jun 2014 17:15:42 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 64AD22360;
 Thu, 26 Jun 2014 17:15:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QHFgrx003751;
 Thu, 26 Jun 2014 17:15:42 GMT (envelope-from tychon@svn.freebsd.org)
Received: (from tychon@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QHFgxE003750;
 Thu, 26 Jun 2014 17:15:42 GMT (envelope-from tychon@svn.freebsd.org)
Message-Id: <201406261715.s5QHFgxE003750@svn.freebsd.org>
From: Tycho Nightingale 
Date: Thu, 26 Jun 2014 17:15:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267921 - head/sys/amd64/vmm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 17:15:42 -0000

Author: tychon
Date: Thu Jun 26 17:15:41 2014
New Revision: 267921
URL: http://svnweb.freebsd.org/changeset/base/267921

Log:
  Add support for emulating the move instruction: "mov r/m8, imm8".
  
  Reviewed by:	neel

Modified:
  head/sys/amd64/vmm/vmm_instruction_emul.c

Modified: head/sys/amd64/vmm/vmm_instruction_emul.c
==============================================================================
--- head/sys/amd64/vmm/vmm_instruction_emul.c	Thu Jun 26 17:10:07 2014	(r267920)
+++ head/sys/amd64/vmm/vmm_instruction_emul.c	Thu Jun 26 17:15:41 2014	(r267921)
@@ -104,6 +104,12 @@ static const struct vie_op one_byte_opco
 		.op_byte = 0x8B,
 		.op_type = VIE_OP_TYPE_MOV,
 	},
+	[0xC6] = {
+		/* XXX Group 11 extended opcode - not just MOV */
+		.op_byte = 0xC6,
+		.op_type = VIE_OP_TYPE_MOV,
+		.op_flags = VIE_OP_F_IMM8,
+	},
 	[0xC7] = {
 		.op_byte = 0xC7,
 		.op_type = VIE_OP_TYPE_MOV,
@@ -310,6 +316,15 @@ emulate_mov(void *vm, int vcpuid, uint64
 			error = vie_update_register(vm, vcpuid, reg, val, size);
 		}
 		break;
+	case 0xC6:
+		/*
+		 * MOV from imm8 to mem (ModRM:r/m)
+		 * C6/0		mov r/m8, imm8
+		 * REX + C6/0	mov r/m8, imm8
+		 */
+		size = 1;
+		error = memwrite(vm, vcpuid, gpa, vie->immediate, size, arg);
+		break;
 	case 0xC7:
 		/*
 		 * MOV from imm32 to mem (ModRM:r/m)

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 17:20:47 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 50114D4E;
 Thu, 26 Jun 2014 17:20:47 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2281F23A2;
 Thu, 26 Jun 2014 17:20:47 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QHKkoW006500;
 Thu, 26 Jun 2014 17:20:46 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QHKkkG006496;
 Thu, 26 Jun 2014 17:20:46 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201406261720.s5QHKkkG006496@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Thu, 26 Jun 2014 17:20:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267922 - in head/sys: conf dev/netfpga10g/nf10bmac
 mips/conf modules/netfpga10g/nf10bmac
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 17:20:47 -0000

Author: bz
Date: Thu Jun 26 17:20:45 2014
New Revision: 267922
URL: http://svnweb.freebsd.org/changeset/base/267922

Log:
  Introduce opt_netfpga.h and allow setting NF10BMAC_64BIT from mips kernel
  configs.  Switch the BERI_NETFPGA_MDROOT to 64bit by default.
  
  Give we have working interrupts also cleanup the extra polling CFLAGS from
  the module Makefile.
  
  MFC after:	2 weeks

Modified:
  head/sys/conf/options.mips
  head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c
  head/sys/mips/conf/BERI_NETFPGA_MDROOT
  head/sys/modules/netfpga10g/nf10bmac/Makefile

Modified: head/sys/conf/options.mips
==============================================================================
--- head/sys/conf/options.mips	Thu Jun 26 17:15:41 2014	(r267921)
+++ head/sys/conf/options.mips	Thu Jun 26 17:20:45 2014	(r267922)
@@ -91,6 +91,11 @@ OCTEON_BOARD_CAPK_0100ND	opt_cvmx.h
 BERI_LARGE_TLB			opt_global.h
 
 #
+# Options that control the NetFPGA-10G Embedded CPU Ethernet Core.
+#
+NF10BMAC_64BIT			opt_netfpga.h
+
+#
 # Options that control the Atheros SoC peripherals
 #
 ARGE_DEBUG			opt_arge.h

Modified: head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c
==============================================================================
--- head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c	Thu Jun 26 17:15:41 2014	(r267921)
+++ head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c	Thu Jun 26 17:20:45 2014	(r267922)
@@ -40,6 +40,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_device_polling.h"
+#include "opt_netfpga.h"
 
 #include 
 #include 

Modified: head/sys/mips/conf/BERI_NETFPGA_MDROOT
==============================================================================
--- head/sys/mips/conf/BERI_NETFPGA_MDROOT	Thu Jun 26 17:15:41 2014	(r267921)
+++ head/sys/mips/conf/BERI_NETFPGA_MDROOT	Thu Jun 26 17:20:45 2014	(r267922)
@@ -23,6 +23,7 @@ device		bpf
 
 options 	DEVICE_POLLING
 device		netfpga10g_nf10bmac
+options 	NF10BMAC_64BIT
 
 #
 # This kernel configuration uses an embedded memory root file system.

Modified: head/sys/modules/netfpga10g/nf10bmac/Makefile
==============================================================================
--- head/sys/modules/netfpga10g/nf10bmac/Makefile	Thu Jun 26 17:15:41 2014	(r267921)
+++ head/sys/modules/netfpga10g/nf10bmac/Makefile	Thu Jun 26 17:20:45 2014	(r267922)
@@ -6,11 +6,10 @@ KMOD=	if_nf10bmac
 SRCS=	if_nf10bmac.c
 SRCS+=	device_if.h bus_if.h pci_if.h
 SRCS+=	opt_device_polling.h
+SRCS+=	opt_netfpga.h
 
 .if ${MACHINE_CPUARCH} == "mips"
 SRCS+=	if_nf10bmac_fdt.c ofw_bus_if.h
 .endif
 
-CFLAGS+=	-DDEVICE_POLLING
-
 .include 

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 17:26:34 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8A9E2FB7;
 Thu, 26 Jun 2014 17:26:34 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 776CB2468;
 Thu, 26 Jun 2014 17:26:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QHQYZY008592;
 Thu, 26 Jun 2014 17:26:34 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QHQYb0008591;
 Thu, 26 Jun 2014 17:26:34 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201406261726.s5QHQYb0008591@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Thu, 26 Jun 2014 17:26:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267923 - head/sys/dev/netfpga10g/nf10bmac
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 17:26:34 -0000

Author: bz
Date: Thu Jun 26 17:26:33 2014
New Revision: 267923
URL: http://svnweb.freebsd.org/changeset/base/267923

Log:
  Fix whitspace indentation from spaces to tabs.
  
  No functional changes.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c

Modified: head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c
==============================================================================
--- head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c	Thu Jun 26 17:20:45 2014	(r267922)
+++ head/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c	Thu Jun 26 17:26:33 2014	(r267923)
@@ -92,78 +92,78 @@ nf10bmac_attach_fdt(device_t dev)
 	 * LOOP memory region (this could be a general control region).
 	 * 0x00: 32/64bit register to enable a Y-"lopback".
 	 */
-        sc->nf10bmac_ctrl_rid = 0;
-        sc->nf10bmac_ctrl_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
-            &sc->nf10bmac_ctrl_rid, RF_ACTIVE);
-        if (sc->nf10bmac_ctrl_res == NULL) {
-                device_printf(dev, "failed to map memory for CTRL region\n");
-                error = ENXIO;
-                goto err;
-        } 
-        if (bootverbose)
-                device_printf(sc->nf10bmac_dev, "CTRL region at mem %p-%p\n",
-                    (void *)rman_get_start(sc->nf10bmac_ctrl_res),
-                    (void *)(rman_get_start(sc->nf10bmac_ctrl_res) + 
-                    rman_get_size(sc->nf10bmac_ctrl_res)));
-
-        /*
-         * TX and TX metadata FIFO memory region.
-         * 0x00: 32/64bit FIFO data,
+	sc->nf10bmac_ctrl_rid = 0;
+	sc->nf10bmac_ctrl_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+	    &sc->nf10bmac_ctrl_rid, RF_ACTIVE);
+	if (sc->nf10bmac_ctrl_res == NULL) {
+		device_printf(dev, "failed to map memory for CTRL region\n");
+		error = ENXIO;
+		goto err;
+	} 
+	if (bootverbose)
+		device_printf(sc->nf10bmac_dev, "CTRL region at mem %p-%p\n",
+		    (void *)rman_get_start(sc->nf10bmac_ctrl_res),
+		    (void *)(rman_get_start(sc->nf10bmac_ctrl_res) + 
+		    rman_get_size(sc->nf10bmac_ctrl_res)));
+
+	/*
+	 * TX and TX metadata FIFO memory region.
+	 * 0x00: 32/64bit FIFO data,
 	 * 0x08: 32/64bit FIFO metadata,
-         * 0x10: 32/64bit packet length.
-         */
-        sc->nf10bmac_tx_mem_rid = 1;
-        sc->nf10bmac_tx_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
-            &sc->nf10bmac_tx_mem_rid, RF_ACTIVE);
-        if (sc->nf10bmac_tx_mem_res == NULL) {
-                device_printf(dev, "failed to map memory for TX FIFO\n");
-                error = ENXIO;
-                goto err;
-        }
-        if (bootverbose)
-                device_printf(sc->nf10bmac_dev, "TX FIFO at mem %p-%p\n",
-                    (void *)rman_get_start(sc->nf10bmac_tx_mem_res),
-                    (void *)(rman_get_start(sc->nf10bmac_tx_mem_res) +
-                    rman_get_size(sc->nf10bmac_tx_mem_res)));
-
-        /*
-         * RX and RXC metadata FIFO memory region.
-         * 0x00: 32/64bit FIFO data,
+	 * 0x10: 32/64bit packet length.
+	 */
+	sc->nf10bmac_tx_mem_rid = 1;
+	sc->nf10bmac_tx_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+	    &sc->nf10bmac_tx_mem_rid, RF_ACTIVE);
+	if (sc->nf10bmac_tx_mem_res == NULL) {
+		device_printf(dev, "failed to map memory for TX FIFO\n");
+		error = ENXIO;
+		goto err;
+	}
+	if (bootverbose)
+		device_printf(sc->nf10bmac_dev, "TX FIFO at mem %p-%p\n",
+		    (void *)rman_get_start(sc->nf10bmac_tx_mem_res),
+		    (void *)(rman_get_start(sc->nf10bmac_tx_mem_res) +
+		    rman_get_size(sc->nf10bmac_tx_mem_res)));
+
+	/*
+	 * RX and RXC metadata FIFO memory region.
+	 * 0x00: 32/64bit FIFO data,
 	 * 0x08: 32/64bit FIFO metadata,
-         * 0x10: 32/64bit packet length.
-         */
-        sc->nf10bmac_rx_mem_rid = 2;
-        sc->nf10bmac_rx_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
-            &sc->nf10bmac_rx_mem_rid, RF_ACTIVE);
-        if (sc->nf10bmac_rx_mem_res == NULL) {
-                device_printf(dev, "failed to map memory for RX FIFO\n");
-                error = ENXIO;
-                goto err;
-        } 
-        if (bootverbose)
-                device_printf(sc->nf10bmac_dev, "RX FIFO at mem %p-%p\n",
-                    (void *)rman_get_start(sc->nf10bmac_rx_mem_res),
-                    (void *)(rman_get_start(sc->nf10bmac_rx_mem_res) + 
-                    rman_get_size(sc->nf10bmac_rx_mem_res)));
+	 * 0x10: 32/64bit packet length.
+	 */
+	sc->nf10bmac_rx_mem_rid = 2;
+	sc->nf10bmac_rx_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+	    &sc->nf10bmac_rx_mem_rid, RF_ACTIVE);
+	if (sc->nf10bmac_rx_mem_res == NULL) {
+		device_printf(dev, "failed to map memory for RX FIFO\n");
+		error = ENXIO;
+		goto err;
+	} 
+	if (bootverbose)
+		device_printf(sc->nf10bmac_dev, "RX FIFO at mem %p-%p\n",
+		    (void *)rman_get_start(sc->nf10bmac_rx_mem_res),
+		    (void *)(rman_get_start(sc->nf10bmac_rx_mem_res) + 
+		    rman_get_size(sc->nf10bmac_rx_mem_res)));
 
 	/*
 	 * Interrupt handling registers.
 	 * 0x00: 32/64bit register to clear (and disable) the RX interrupt.
 	 * 0x08: 32/64bit register to enable or disable the RX interrupt.
 	 */
-        sc->nf10bmac_intr_rid = 3;
-        sc->nf10bmac_intr_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
-            &sc->nf10bmac_intr_rid, RF_ACTIVE);
-        if (sc->nf10bmac_intr_res == NULL) {
-                device_printf(dev, "failed to map memory for INTR region\n");
-                error = ENXIO;
-                goto err;
-        } 
-        if (bootverbose)
-                device_printf(sc->nf10bmac_dev, "INTR region at mem %p-%p\n",
-                    (void *)rman_get_start(sc->nf10bmac_intr_res),
-                    (void *)(rman_get_start(sc->nf10bmac_intr_res) + 
-                    rman_get_size(sc->nf10bmac_intr_res)));
+	sc->nf10bmac_intr_rid = 3;
+	sc->nf10bmac_intr_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+	    &sc->nf10bmac_intr_rid, RF_ACTIVE);
+	if (sc->nf10bmac_intr_res == NULL) {
+		device_printf(dev, "failed to map memory for INTR region\n");
+		error = ENXIO;
+		goto err;
+	} 
+	if (bootverbose)
+		device_printf(sc->nf10bmac_dev, "INTR region at mem %p-%p\n",
+		    (void *)rman_get_start(sc->nf10bmac_intr_res),
+		    (void *)(rman_get_start(sc->nf10bmac_intr_res) + 
+		    rman_get_size(sc->nf10bmac_intr_res)));
 
 	/* (Optional) RX and TX IRQ. */
 	sc->nf10bmac_rx_irq_rid = 0;

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 17:27:37 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D13D1195;
 Thu, 26 Jun 2014 17:27:37 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BD4F92476;
 Thu, 26 Jun 2014 17:27:37 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QHRbi2008764;
 Thu, 26 Jun 2014 17:27:37 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QHRb9w008760;
 Thu, 26 Jun 2014 17:27:37 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201406261727.s5QHRb9w008760@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 26 Jun 2014 17:27:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267924 - head/share/dtrace
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 17:27:38 -0000

Author: rpaulo
Date: Thu Jun 26 17:27:36 2014
New Revision: 267924
URL: http://svnweb.freebsd.org/changeset/base/267924

Log:
  Use dtrace -s instead of /bin/sh for DTrace scripts.

Modified:
  head/share/dtrace/hotopen
  head/share/dtrace/nfsattrstats
  head/share/dtrace/nfsclienttime

Modified: head/share/dtrace/hotopen
==============================================================================
--- head/share/dtrace/hotopen	Thu Jun 26 17:26:33 2014	(r267923)
+++ head/share/dtrace/hotopen	Thu Jun 26 17:27:36 2014	(r267924)
@@ -1,40 +1,39 @@
-#!/bin/sh
-#
-# Copyright (c) 2012 George V. Neville-Neil
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# $FreeBSD$
-#
-# The hotopen D script periodically outputs  table of which UIDs
-# are opening files.   This is a very quick way to find out if
-# a paritcular user is thrashing a system with rapid calls to
-# open/close.
-#
-# Usage: hotopen
-#
+#!/usr/sbin/dtrace -s
+/*
+ * Copyright (c) 2012 George V. Neville-Neil
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ * The hotopen D script periodically outputs  table of which UIDs
+ * are opening files.   This is a very quick way to find out if
+ * a paritcular user is thrashing a system with rapid calls to
+ * open/close.
+ *
+ * Usage: hotopen
+ */
 
-/usr/sbin/dtrace -n '
 #pragma D option quiet
 BEGIN
 {
@@ -55,4 +54,3 @@ tick-1sec
 	trunc(@files);
 	output = 0;
 }
-'

Modified: head/share/dtrace/nfsattrstats
==============================================================================
--- head/share/dtrace/nfsattrstats	Thu Jun 26 17:26:33 2014	(r267923)
+++ head/share/dtrace/nfsattrstats	Thu Jun 26 17:27:36 2014	(r267924)
@@ -1,42 +1,42 @@
-#!/bin/sh
-#
-# Copyright (c) 2012 Robert N. M. Watson
-# All rights reserved.
-#
-# This software was developed at the University of Cambridge Computer
-# Laboratory with support from a grant from Google, Inc.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# $FreeBSD$
-#
-# This script creates a trace of NFS RPCs, NFS attribute cache
-# activity, and NFS access cache activity, along with the system call
-# that instigated the activity. Notice that NFS events may happen
-# outside of the context of a system call, most likely due to the VM
-# system paging from NFS, in which case the system call name is
-# reported as "-"
+#!/usr/sbin/dtrace -s
+/*
+ * Copyright (c) 2012 Robert N. M. Watson
+ * All rights reserved.
+ *
+ * This software was developed at the University of Cambridge Computer
+ * Laboratory with support from a grant from Google, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ * This script creates a trace of NFS RPCs, NFS attribute cache
+ * activity, and NFS access cache activity, along with the system call
+ * that instigated the activity. Notice that NFS events may happen
+ * outside of the context of a system call, most likely due to the VM
+ * system paging from NFS, in which case the system call name is
+ * reported as "-"
+ */
 
-/usr/sbin/dtrace -n '
 #pragma D option quiet
 
 dtrace:::BEGIN
@@ -71,4 +71,3 @@ nfsclient:::
     printf("%s\t%s\t%s\t%s\n", probemod, stringof(arg0), execname, 
 	    self->syscallname);
 }
-'

Modified: head/share/dtrace/nfsclienttime
==============================================================================
--- head/share/dtrace/nfsclienttime	Thu Jun 26 17:26:33 2014	(r267923)
+++ head/share/dtrace/nfsclienttime	Thu Jun 26 17:27:36 2014	(r267924)
@@ -1,46 +1,45 @@
-#!/bin/sh
-#
-# Copyright (c) 2012 Robert N. M. Watson
-# All rights reserved.
-#
-# This software was developed at the University of Cambridge Computer
-# Laboratory with support from a grant from Google, Inc.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# $FreeBSD$
-#
-# This script measures all time spent waiting on RPC replies for each
-# system call, and then generates a histogram of those times sorted by
-# system call name.
-#
-# Currently only supports NFSv3
-#
-# Usage: nfsclienttime
-#
-# Press Ctrl-C to exit and display statistics.
-#
+#!/usr/sbin/dtrace -s
+/*
+ * Copyright (c) 2012 Robert N. M. Watson
+ * All rights reserved.
+ *
+ * This software was developed at the University of Cambridge Computer
+ * Laboratory with support from a grant from Google, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ * This script measures all time spent waiting on RPC replies for each
+ * system call, and then generates a histogram of those times sorted by
+ * system call name.
+ *
+ * Currently only supports NFSv3
+ *
+ * Usage: nfsclienttime
+ *
+ * Press Ctrl-C to exit and display statistics.
+ */
 
-/usr/sbin/dtrace -n '
 #pragma D option quiet
 
 dtrace:::BEGIN
@@ -71,4 +70,3 @@ syscall:::return
 
         @syscalls[probefunc] = quantize(self->count);
 }
-'

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 17:34:43 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id BCE6943F;
 Thu, 26 Jun 2014 17:34:43 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9D489252B;
 Thu, 26 Jun 2014 17:34:43 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QHYhdE012984;
 Thu, 26 Jun 2014 17:34:43 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QHYgJP012979;
 Thu, 26 Jun 2014 17:34:42 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201406261734.s5QHYgJP012979@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 26 Jun 2014 17:34:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267925 - in head:
 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs
 cddl/contrib/opensolaris/lib/libdtrace/common
 sys/cddl/contrib/opensolaris/uts/common/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 17:34:43 -0000

Author: rpaulo
Date: Thu Jun 26 17:34:42 2014
New Revision: 267925
URL: http://svnweb.freebsd.org/changeset/base/267925

Log:
  Revert r267898.

Deleted:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out
Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c	Thu Jun 26 17:27:36 2014	(r267924)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c	Thu Jun 26 17:34:42 2014	(r267925)
@@ -25,7 +25,7 @@
  */
 
 /*
- * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
  * Copyright (c) 2012 by Delphix. All rights reserved.
  */
 
@@ -1301,231 +1301,6 @@ dtrace_aggregate_walk(dtrace_hdl_t *dtp,
 }
 
 static int
-dt_aggregate_total(dtrace_hdl_t *dtp, boolean_t clear)
-{
-	dt_ahashent_t *h;
-	dtrace_aggdata_t **total;
-	dtrace_aggid_t max = DTRACE_AGGVARIDNONE, id;
-	dt_aggregate_t *agp = &dtp->dt_aggregate;
-	dt_ahash_t *hash = &agp->dtat_hash;
-	uint32_t tflags;
-
-	tflags = DTRACE_A_TOTAL | DTRACE_A_HASNEGATIVES | DTRACE_A_HASPOSITIVES;
-
-	/*
-	 * If we need to deliver per-aggregation totals, we're going to take
-	 * three passes over the aggregate:  one to clear everything out and
-	 * determine our maximum aggregation ID, one to actually total
-	 * everything up, and a final pass to assign the totals to the
-	 * individual elements.
-	 */
-	for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) {
-		dtrace_aggdata_t *aggdata = &h->dtahe_data;
-
-		if ((id = dt_aggregate_aggvarid(h)) > max)
-			max = id;
-
-		aggdata->dtada_total = 0;
-		aggdata->dtada_flags &= ~tflags;
-	}
-
-	if (clear || max == DTRACE_AGGVARIDNONE)
-		return (0);
-
-	total = dt_zalloc(dtp, (max + 1) * sizeof (dtrace_aggdata_t *));
-
-	if (total == NULL)
-		return (-1);
-
-	for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) {
-		dtrace_aggdata_t *aggdata = &h->dtahe_data;
-		dtrace_aggdesc_t *agg = aggdata->dtada_desc;
-		dtrace_recdesc_t *rec;
-		caddr_t data;
-		int64_t val, *addr;
-
-		rec = &agg->dtagd_rec[agg->dtagd_nrecs - 1];
-		data = aggdata->dtada_data;
-		addr = (int64_t *)(uintptr_t)(data + rec->dtrd_offset);
-
-		switch (rec->dtrd_action) {
-		case DTRACEAGG_STDDEV:
-			val = dt_stddev((uint64_t *)addr, 1);
-			break;
-
-		case DTRACEAGG_SUM:
-		case DTRACEAGG_COUNT:
-			val = *addr;
-			break;
-
-		case DTRACEAGG_AVG:
-			val = addr[0] ? (addr[1] / addr[0]) : 0;
-			break;
-
-		default:
-			continue;
-		}
-
-		if (total[agg->dtagd_varid] == NULL) {
-			total[agg->dtagd_varid] = aggdata;
-			aggdata->dtada_flags |= DTRACE_A_TOTAL;
-		} else {
-			aggdata = total[agg->dtagd_varid];
-		}
-
-		if (val > 0)
-			aggdata->dtada_flags |= DTRACE_A_HASPOSITIVES;
-
-		if (val < 0) {
-			aggdata->dtada_flags |= DTRACE_A_HASNEGATIVES;
-			val = -val;
-		}
-
-		if (dtp->dt_options[DTRACEOPT_AGGZOOM] != DTRACEOPT_UNSET) {
-			val = (int64_t)((long double)val *
-			    (1 / DTRACE_AGGZOOM_MAX));
-
-			if (val > aggdata->dtada_total)
-				aggdata->dtada_total = val;
-		} else {
-			aggdata->dtada_total += val;
-		}
-	}
-
-	/*
-	 * And now one final pass to set everyone's total.
-	 */
-	for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) {
-		dtrace_aggdata_t *aggdata = &h->dtahe_data, *t;
-		dtrace_aggdesc_t *agg = aggdata->dtada_desc;
-
-		if ((t = total[agg->dtagd_varid]) == NULL || aggdata == t)
-			continue;
-
-		aggdata->dtada_total = t->dtada_total;
-		aggdata->dtada_flags |= (t->dtada_flags & tflags);
-	}
-
-	dt_free(dtp, total);
-
-	return (0);
-}
-
-static int
-dt_aggregate_minmaxbin(dtrace_hdl_t *dtp, boolean_t clear)
-{
-	dt_ahashent_t *h;
-	dtrace_aggdata_t **minmax;
-	dtrace_aggid_t max = DTRACE_AGGVARIDNONE, id;
-	dt_aggregate_t *agp = &dtp->dt_aggregate;
-	dt_ahash_t *hash = &agp->dtat_hash;
-
-	for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) {
-		dtrace_aggdata_t *aggdata = &h->dtahe_data;
-
-		if ((id = dt_aggregate_aggvarid(h)) > max)
-			max = id;
-
-		aggdata->dtada_minbin = 0;
-		aggdata->dtada_maxbin = 0;
-		aggdata->dtada_flags &= ~DTRACE_A_MINMAXBIN;
-	}
-
-	if (clear || max == DTRACE_AGGVARIDNONE)
-		return (0);
-
-	minmax = dt_zalloc(dtp, (max + 1) * sizeof (dtrace_aggdata_t *));
-
-	if (minmax == NULL)
-		return (-1);
-
-	for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) {
-		dtrace_aggdata_t *aggdata = &h->dtahe_data;
-		dtrace_aggdesc_t *agg = aggdata->dtada_desc;
-		dtrace_recdesc_t *rec;
-		caddr_t data;
-		int64_t *addr;
-		int minbin = -1, maxbin = -1, i;
-		int start = 0, size;
-
-		rec = &agg->dtagd_rec[agg->dtagd_nrecs - 1];
-		size = rec->dtrd_size / sizeof (int64_t);
-		data = aggdata->dtada_data;
-		addr = (int64_t *)(uintptr_t)(data + rec->dtrd_offset);
-
-		switch (rec->dtrd_action) {
-		case DTRACEAGG_LQUANTIZE:
-			/*
-			 * For lquantize(), we always display the entire range
-			 * of the aggregation when aggpack is set.
-			 */
-			start = 1;
-			minbin = start;
-			maxbin = size - 1 - start;
-			break;
-
-		case DTRACEAGG_QUANTIZE:
-			for (i = start; i < size; i++) {
-				if (!addr[i])
-					continue;
-
-				if (minbin == -1)
-					minbin = i - start;
-
-				maxbin = i - start;
-			}
-
-			if (minbin == -1) {
-				/*
-				 * If we have no data (e.g., due to a clear()
-				 * or negative increments), we'll use the
-				 * zero bucket as both our min and max.
-				 */
-				minbin = maxbin = DTRACE_QUANTIZE_ZEROBUCKET;
-			}
-
-			break;
-
-		default:
-			continue;
-		}
-
-		if (minmax[agg->dtagd_varid] == NULL) {
-			minmax[agg->dtagd_varid] = aggdata;
-			aggdata->dtada_flags |= DTRACE_A_MINMAXBIN;
-			aggdata->dtada_minbin = minbin;
-			aggdata->dtada_maxbin = maxbin;
-			continue;
-		}
-
-		if (minbin < minmax[agg->dtagd_varid]->dtada_minbin)
-			minmax[agg->dtagd_varid]->dtada_minbin = minbin;
-
-		if (maxbin > minmax[agg->dtagd_varid]->dtada_maxbin)
-			minmax[agg->dtagd_varid]->dtada_maxbin = maxbin;
-	}
-
-	/*
-	 * And now one final pass to set everyone's minbin and maxbin.
-	 */
-	for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall) {
-		dtrace_aggdata_t *aggdata = &h->dtahe_data, *mm;
-		dtrace_aggdesc_t *agg = aggdata->dtada_desc;
-
-		if ((mm = minmax[agg->dtagd_varid]) == NULL || aggdata == mm)
-			continue;
-
-		aggdata->dtada_minbin = mm->dtada_minbin;
-		aggdata->dtada_maxbin = mm->dtada_maxbin;
-		aggdata->dtada_flags |= DTRACE_A_MINMAXBIN;
-	}
-
-	dt_free(dtp, minmax);
-
-	return (0);
-}
-
-static int
 dt_aggregate_walk_sorted(dtrace_hdl_t *dtp,
     dtrace_aggregate_f *func, void *arg,
     int (*sfunc)(const void *, const void *))
@@ -1534,23 +1309,6 @@ dt_aggregate_walk_sorted(dtrace_hdl_t *d
 	dt_ahashent_t *h, **sorted;
 	dt_ahash_t *hash = &agp->dtat_hash;
 	size_t i, nentries = 0;
-	int rval = -1;
-
-	agp->dtat_flags &= ~(DTRACE_A_TOTAL | DTRACE_A_MINMAXBIN);
-
-	if (dtp->dt_options[DTRACEOPT_AGGHIST] != DTRACEOPT_UNSET) {
-		agp->dtat_flags |= DTRACE_A_TOTAL;
-
-		if (dt_aggregate_total(dtp, B_FALSE) != 0)
-			return (-1);
-	}
-
-	if (dtp->dt_options[DTRACEOPT_AGGPACK] != DTRACEOPT_UNSET) {
-		agp->dtat_flags |= DTRACE_A_MINMAXBIN;
-
-		if (dt_aggregate_minmaxbin(dtp, B_FALSE) != 0)
-			return (-1);
-	}
 
 	for (h = hash->dtah_all; h != NULL; h = h->dtahe_nextall)
 		nentries++;
@@ -1558,7 +1316,7 @@ dt_aggregate_walk_sorted(dtrace_hdl_t *d
 	sorted = dt_alloc(dtp, nentries * sizeof (dt_ahashent_t *));
 
 	if (sorted == NULL)
-		goto out;
+		return (-1);
 
 	for (h = hash->dtah_all, i = 0; h != NULL; h = h->dtahe_nextall)
 		sorted[i++] = h;
@@ -1582,20 +1340,14 @@ dt_aggregate_walk_sorted(dtrace_hdl_t *d
 	for (i = 0; i < nentries; i++) {
 		h = sorted[i];
 
-		if (dt_aggwalk_rval(dtp, h, func(&h->dtahe_data, arg)) == -1)
-			goto out;
+		if (dt_aggwalk_rval(dtp, h, func(&h->dtahe_data, arg)) == -1) {
+			dt_free(dtp, sorted);
+			return (-1);
+		}
 	}
 
-	rval = 0;
-out:
-	if (agp->dtat_flags & DTRACE_A_TOTAL)
-		(void) dt_aggregate_total(dtp, B_TRUE);
-
-	if (agp->dtat_flags & DTRACE_A_MINMAXBIN)
-		(void) dt_aggregate_minmaxbin(dtp, B_TRUE);
-
 	dt_free(dtp, sorted);
-	return (rval);
+	return (0);
 }
 
 int
@@ -2118,8 +1870,6 @@ dtrace_aggregate_print(dtrace_hdl_t *dtp
 {
 	dt_print_aggdata_t pd;
 
-	bzero(&pd, sizeof (pd));
-
 	pd.dtpa_dtp = dtp;
 	pd.dtpa_fp = fp;
 	pd.dtpa_allunprint = 1;

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c	Thu Jun 26 17:27:36 2014	(r267924)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c	Thu Jun 26 17:34:42 2014	(r267925)
@@ -24,7 +24,7 @@
  */
 
 /*
- * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
  * Copyright (c) 2012 by Delphix. All rights reserved.
  */
 
@@ -59,25 +59,6 @@ dt_fabsl(long double x)
 	return (x);
 }
 
-static int
-dt_ndigits(long long val)
-{
-	int rval = 1;
-	long long cmp = 10;
-
-	if (val < 0) {
-		val = val == INT64_MIN ? INT64_MAX : -val;
-		rval++;
-	}
-
-	while (val > cmp && cmp > 0) {
-		rval++;
-		cmp *= 10;
-	}
-
-	return (rval < 4 ? 4 : rval);
-}
-
 /*
  * 128-bit arithmetic functions needed to support the stddev() aggregating
  * action.
@@ -506,125 +487,7 @@ dt_nullrec()
 	return (DTRACE_CONSUME_NEXT);
 }
 
-static void
-dt_quantize_total(dtrace_hdl_t *dtp, int64_t datum, long double *total)
-{
-	long double val = dt_fabsl((long double)datum);
-
-	if (dtp->dt_options[DTRACEOPT_AGGZOOM] == DTRACEOPT_UNSET) {
-		*total += val;
-		return;
-	}
-
-	/*
-	 * If we're zooming in on an aggregation, we want the height of the
-	 * highest value to be approximately 95% of total bar height -- so we
-	 * adjust up by the reciprocal of DTRACE_AGGZOOM_MAX when comparing to
-	 * our highest value.
-	 */
-	val *= 1 / DTRACE_AGGZOOM_MAX;
-
-	if (*total < val)
-		*total = val;
-}
-
-static int
-dt_print_quanthdr(dtrace_hdl_t *dtp, FILE *fp, int width)
-{
-	return (dt_printf(dtp, fp, "\n%*s %41s %-9s\n",
-	    width ? width : 16, width ? "key" : "value",
-	    "------------- Distribution -------------", "count"));
-}
-
-static int
-dt_print_quanthdr_packed(dtrace_hdl_t *dtp, FILE *fp, int width,
-    const dtrace_aggdata_t *aggdata, dtrace_actkind_t action)
-{
-	int min = aggdata->dtada_minbin, max = aggdata->dtada_maxbin;
-	int minwidth, maxwidth, i;
-
-	assert(action == DTRACEAGG_QUANTIZE || action == DTRACEAGG_LQUANTIZE);
-
-	if (action == DTRACEAGG_QUANTIZE) {
-		if (min != 0 && min != DTRACE_QUANTIZE_ZEROBUCKET)
-			min--;
-
-		if (max < DTRACE_QUANTIZE_NBUCKETS - 1)
-			max++;
-
-		minwidth = dt_ndigits(DTRACE_QUANTIZE_BUCKETVAL(min));
-		maxwidth = dt_ndigits(DTRACE_QUANTIZE_BUCKETVAL(max));
-	} else {
-		maxwidth = 8;
-		minwidth = maxwidth - 1;
-		max++;
-	}
-
-	if (dt_printf(dtp, fp, "\n%*s %*s .",
-	    width, width > 0 ? "key" : "", minwidth, "min") < 0)
-		return (-1);
-
-	for (i = min; i <= max; i++) {
-		if (dt_printf(dtp, fp, "-") < 0)
-			return (-1);
-	}
-
-	return (dt_printf(dtp, fp, ". %*s | count\n", -maxwidth, "max"));
-}
-
-/*
- * We use a subset of the Unicode Block Elements (U+2588 through U+258F,
- * inclusive) to represent aggregations via UTF-8 -- which are expressed via
- * 3-byte UTF-8 sequences.
- */
-#define	DTRACE_AGGUTF8_FULL	0x2588
-#define	DTRACE_AGGUTF8_BASE	0x258f
-#define	DTRACE_AGGUTF8_LEVELS	8
-
-#define	DTRACE_AGGUTF8_BYTE0(val)	(0xe0 | ((val) >> 12))
-#define	DTRACE_AGGUTF8_BYTE1(val)	(0x80 | (((val) >> 6) & 0x3f))
-#define	DTRACE_AGGUTF8_BYTE2(val)	(0x80 | ((val) & 0x3f))
-
-static int
-dt_print_quantline_utf8(dtrace_hdl_t *dtp, FILE *fp, int64_t val,
-    uint64_t normal, long double total)
-{
-	uint_t len = 40, i, whole, partial;
-	long double f = (dt_fabsl((long double)val) * len) / total;
-	const char *spaces = "                                        ";
-
-	whole = (uint_t)f;
-	partial = (uint_t)((f - (long double)(uint_t)f) *
-	    (long double)DTRACE_AGGUTF8_LEVELS);
-
-	if (dt_printf(dtp, fp, "|") < 0)
-		return (-1);
-
-	for (i = 0; i < whole; i++) {
-		if (dt_printf(dtp, fp, "%c%c%c",
-		    DTRACE_AGGUTF8_BYTE0(DTRACE_AGGUTF8_FULL),
-		    DTRACE_AGGUTF8_BYTE1(DTRACE_AGGUTF8_FULL),
-		    DTRACE_AGGUTF8_BYTE2(DTRACE_AGGUTF8_FULL)) < 0)
-			return (-1);
-	}
-
-	if (partial != 0) {
-		partial = DTRACE_AGGUTF8_BASE - (partial - 1);
-
-		if (dt_printf(dtp, fp, "%c%c%c",
-		    DTRACE_AGGUTF8_BYTE0(partial),
-		    DTRACE_AGGUTF8_BYTE1(partial),
-		    DTRACE_AGGUTF8_BYTE2(partial)) < 0)
-			return (-1);
-
-		i++;
-	}
-
-	return (dt_printf(dtp, fp, "%s %-9lld\n", spaces + i,
-	    (long long)val / normal));
-}
-
-static int
+int
 dt_print_quantline(dtrace_hdl_t *dtp, FILE *fp, int64_t val,
     uint64_t normal, long double total, char positives, char negatives)
 {
@@ -642,11 +505,6 @@ dt_print_quantline(dtrace_hdl_t *dtp, FI
 
 	if (!negatives) {
 		if (positives) {
-			if (dtp->dt_encoding == DT_ENCODING_UTF8) {
-				return (dt_print_quantline_utf8(dtp, fp, val,
-				    normal, total));
-			}
-
 			f = (dt_fabsl((long double)val) * len) / total;
 			depth = (uint_t)(f + 0.5);
 		} else {
@@ -689,77 +547,6 @@ dt_print_quantline(dtrace_hdl_t *dtp, FI
 	}
 }
 
-/*
- * As with UTF-8 printing of aggregations, we use a subset of the Unicode
- * Block Elements (U+2581 through U+2588, inclusive) to represent our packed
- * aggregation.
- */
-#define	DTRACE_AGGPACK_BASE	0x2581
-#define	DTRACE_AGGPACK_LEVELS	8
-
-static int
-dt_print_packed(dtrace_hdl_t *dtp, FILE *fp,
-    long double datum, long double total)
-{
-	static boolean_t utf8_checked = 0;
-	static boolean_t utf8;
-	char *ascii = "__xxxxXX";
-	char *neg = "vvvvVV";
-	unsigned int len;
-	long double val;
-
-	while (!utf8_checked) {
-		char *term;
-
-		/*
-		 * We want to determine if we can reasonably emit UTF-8 for our
-		 * packed aggregation.  To do this, we will check for terminals
-		 * that are known to be primitive to emit UTF-8 on these.
-		 */
-		utf8_checked = B_TRUE;
-
-		if (dtp->dt_encoding == DT_ENCODING_ASCII)
-			break;
-
-		if (dtp->dt_encoding == DT_ENCODING_UTF8) {
-			utf8 = B_TRUE;
-			break;
-		}
-
-		if ((term = getenv("TERM")) != NULL &&
-		    (strcmp(term, "sun") == 0 ||
-		    strcmp(term, "sun-color") == 0) ||
-		    strcmp(term, "dumb") == 0) {
-			break;
-		}
-
-		utf8 = B_TRUE;
-	}
-
-	if (datum == 0)
-		return (dt_printf(dtp, fp, " "));
-
-	if (datum < 0) {
-		len = strlen(neg);
-		val = dt_fabsl(datum * (len - 1)) / total;
-		return (dt_printf(dtp, fp, "%c", neg[(uint_t)(val + 0.5)]));
-	}
-
-	if (utf8) {
-		int block = DTRACE_AGGPACK_BASE + (unsigned int)(((datum *
-		    (DTRACE_AGGPACK_LEVELS - 1)) / total) + 0.5);
-
-		return (dt_printf(dtp, fp, "%c%c%c",
-		    DTRACE_AGGUTF8_BYTE0(block),
-		    DTRACE_AGGUTF8_BYTE1(block),
-		    DTRACE_AGGUTF8_BYTE2(block)));
-	}
-
-	len = strlen(ascii);
-	val = (datum * (len - 1)) / total;
-	return (dt_printf(dtp, fp, "%c", ascii[(uint_t)(val + 0.5)]));
-}
-
 int
 dt_print_quantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr,
     size_t size, uint64_t normal)
@@ -777,9 +564,9 @@ dt_print_quantize(dtrace_hdl_t *dtp, FIL
 
 	if (first_bin == DTRACE_QUANTIZE_NBUCKETS - 1) {
 		/*
-		 * There isn't any data.  This is possible if the aggregation
-		 * has been clear()'d or if negative increment values have been
-		 * used.  Regardless, we'll print the buckets around 0.
+		 * There isn't any data.  This is possible if (and only if)
+		 * negative increment values have been used.  In this case,
+		 * we'll print the buckets around 0.
 		 */
 		first_bin = DTRACE_QUANTIZE_ZEROBUCKET - 1;
 		last_bin = DTRACE_QUANTIZE_ZEROBUCKET + 1;
@@ -797,10 +584,11 @@ dt_print_quantize(dtrace_hdl_t *dtp, FIL
 	for (i = first_bin; i <= last_bin; i++) {
 		positives |= (data[i] > 0);
 		negatives |= (data[i] < 0);
-		dt_quantize_total(dtp, data[i], &total);
+		total += dt_fabsl((long double)data[i]);
 	}
 
-	if (dt_print_quanthdr(dtp, fp, 0) < 0)
+	if (dt_printf(dtp, fp, "\n%16s %41s %-9s\n", "value",
+	    "------------- Distribution -------------", "count") < 0)
 		return (-1);
 
 	for (i = first_bin; i <= last_bin; i++) {
@@ -817,48 +605,6 @@ dt_print_quantize(dtrace_hdl_t *dtp, FIL
 }
 
 int
-dt_print_quantize_packed(dtrace_hdl_t *dtp, FILE *fp, const void *addr,
-    size_t size, const dtrace_aggdata_t *aggdata)
-{
-	const int64_t *data = addr;
-	long double total = 0, count = 0;
-	int min = aggdata->dtada_minbin, max = aggdata->dtada_maxbin, i;
-	int64_t minval, maxval;
-
-	if (size != DTRACE_QUANTIZE_NBUCKETS * sizeof (uint64_t))
-		return (dt_set_errno(dtp, EDT_DMISMATCH));
-
-	if (min != 0 && min != DTRACE_QUANTIZE_ZEROBUCKET)
-		min--;
-
-	if (max < DTRACE_QUANTIZE_NBUCKETS - 1)
-		max++;
-
-	minval = DTRACE_QUANTIZE_BUCKETVAL(min);
-	maxval = DTRACE_QUANTIZE_BUCKETVAL(max);
-
-	if (dt_printf(dtp, fp, " %*lld :", dt_ndigits(minval),
-	    (long long)minval) < 0)
-		return (-1);
-
-	for (i = min; i <= max; i++) {
-		dt_quantize_total(dtp, data[i], &total);
-		count += data[i];
-	}
-
-	for (i = min; i <= max; i++) {
-		if (dt_print_packed(dtp, fp, data[i], total) < 0)
-			return (-1);
-	}
-
-	if (dt_printf(dtp, fp, ": %*lld | %lld\n",
-	    -dt_ndigits(maxval), (long long)maxval, (long long)count) < 0)
-		return (-1);
-
-	return (0);
-}
-
-int
 dt_print_lquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr,
     size_t size, uint64_t normal)
 {
@@ -905,7 +651,7 @@ dt_print_lquantize(dtrace_hdl_t *dtp, FI
 	for (i = first_bin; i <= last_bin; i++) {
 		positives |= (data[i] > 0);
 		negatives |= (data[i] < 0);
-		dt_quantize_total(dtp, data[i], &total);
+		total += dt_fabsl((long double)data[i]);
 	}
 
 	if (dt_printf(dtp, fp, "\n%16s %41s %-9s\n", "value",
@@ -917,7 +663,8 @@ dt_print_lquantize(dtrace_hdl_t *dtp, FI
 		int err;
 
 		if (i == 0) {
-			(void) snprintf(c, sizeof (c), "< %d", base);
+			(void) snprintf(c, sizeof (c), "< %d",
+			    base / (uint32_t)normal);
 			err = dt_printf(dtp, fp, "%16s ", c);
 		} else if (i == levels + 1) {
 			(void) snprintf(c, sizeof (c), ">= %d",
@@ -936,59 +683,6 @@ dt_print_lquantize(dtrace_hdl_t *dtp, FI
 	return (0);
 }
 
-/*ARGSUSED*/
-int
-dt_print_lquantize_packed(dtrace_hdl_t *dtp, FILE *fp, const void *addr,
-    size_t size, const dtrace_aggdata_t *aggdata)
-{
-	const int64_t *data = addr;
-	long double total = 0, count = 0;
-	int min, max, base, err;
-	uint64_t arg;
-	uint16_t step, levels;
-	char c[32];
-	unsigned int i;
-
-	if (size < sizeof (uint64_t))
-		return (dt_set_errno(dtp, EDT_DMISMATCH));
-
-	arg = *data++;
-	size -= sizeof (uint64_t);
-
-	base = DTRACE_LQUANTIZE_BASE(arg);
-	step = DTRACE_LQUANTIZE_STEP(arg);
-	levels = DTRACE_LQUANTIZE_LEVELS(arg);
-
-	if (size != sizeof (uint64_t) * (levels + 2))
-		return (dt_set_errno(dtp, EDT_DMISMATCH));
-
-	min = 0;
-	max = levels + 1;
-
-	if (min == 0) {
-		(void) snprintf(c, sizeof (c), "< %d", base);
-		err = dt_printf(dtp, fp, "%8s :", c);
-	} else {
-		err = dt_printf(dtp, fp, "%8d :", base + (min - 1) * step);
-	}
-
-	if (err < 0)
-		return (-1);
-
-	for (i = min; i <= max; i++) {
-		dt_quantize_total(dtp, data[i], &total);
-		count += data[i];
-	}
-
-	for (i = min; i <= max; i++) {
-		if (dt_print_packed(dtp, fp, data[i], total) < 0)
-			return (-1);
-	}
-
-	(void) snprintf(c, sizeof (c), ">= %d", base + (levels * step));
-	return (dt_printf(dtp, fp, ": %-8s | %lld\n", c, (long long)count));
-}
-
 int
 dt_print_llquantize(dtrace_hdl_t *dtp, FILE *fp, const void *addr,
     size_t size, uint64_t normal)
@@ -1046,7 +740,7 @@ dt_print_llquantize(dtrace_hdl_t *dtp, F
 	for (i = first_bin; i <= last_bin; i++) {
 		positives |= (data[i] > 0);
 		negatives |= (data[i] < 0);
-		dt_quantize_total(dtp, data[i], &total);
+		total += dt_fabsl((long double)data[i]);
 	}
 
 	if (dt_printf(dtp, fp, "\n%16s %41s %-9s\n", "value",
@@ -1129,7 +823,7 @@ dt_print_stddev(dtrace_hdl_t *dtp, FILE 
 }
 
 /*ARGSUSED*/
-static int
+int
 dt_print_bytes(dtrace_hdl_t *dtp, FILE *fp, caddr_t addr,
     size_t nbytes, int width, int quiet, int forceraw)
 {
@@ -1182,12 +876,10 @@ dt_print_bytes(dtrace_hdl_t *dtp, FILE *
 			if (j != nbytes)
 				break;
 
-			if (quiet) {
+			if (quiet)
 				return (dt_printf(dtp, fp, "%s", c));
-			} else {
-				return (dt_printf(dtp, fp, " %s%*s",
-				    width < 0 ? " " : "", width, c));
-			}
+			else
+				return (dt_printf(dtp, fp, "  %-*s", width, c));
 		}
 
 		break;
@@ -2101,83 +1793,10 @@ dt_trunc(dtrace_hdl_t *dtp, caddr_t base
 
 static int
 dt_print_datum(dtrace_hdl_t *dtp, FILE *fp, dtrace_recdesc_t *rec,
-    caddr_t addr, size_t size, const dtrace_aggdata_t *aggdata,
-    uint64_t normal, dt_print_aggdata_t *pd)
+    caddr_t addr, size_t size, uint64_t normal)
 {
-	int err, width;
+	int err;
 	dtrace_actkind_t act = rec->dtrd_action;
-	boolean_t packed = pd->dtpa_agghist || pd->dtpa_aggpack;
-	dtrace_aggdesc_t *agg = aggdata->dtada_desc;
-
-	static struct {
-		size_t size;
-		int width;
-		int packedwidth;
-	} *fmt, fmttab[] = {
-		{ sizeof (uint8_t),	3,	3 },
-		{ sizeof (uint16_t),	5,	5 },
-		{ sizeof (uint32_t),	8,	8 },
-		{ sizeof (uint64_t),	16,	16 },
-		{ 0,			-50,	16 }
-	};
-
-	if (packed && pd->dtpa_agghisthdr != agg->dtagd_varid) {
-		dtrace_recdesc_t *r;
-
-		width = 0;
-
-		/*
-		 * To print our quantization header for either an agghist or
-		 * aggpack aggregation, we need to iterate through all of our
-		 * of our records to determine their width.
-		 */
-		for (r = rec; !DTRACEACT_ISAGG(r->dtrd_action); r++) {
-			for (fmt = fmttab; fmt->size &&
-			    fmt->size != r->dtrd_size; fmt++)
-				continue;
-
-			width += fmt->packedwidth + 1;
-		}
-
-		if (pd->dtpa_agghist) {
-			if (dt_print_quanthdr(dtp, fp, width) < 0)
-				return (-1);
-		} else {
-			if (dt_print_quanthdr_packed(dtp, fp,
-			    width, aggdata, r->dtrd_action) < 0)
-				return (-1);
-		}
-
-		pd->dtpa_agghisthdr = agg->dtagd_varid;
-	}
-
-	if (pd->dtpa_agghist && DTRACEACT_ISAGG(act)) {
-		char positives = aggdata->dtada_flags & DTRACE_A_HASPOSITIVES;
-		char negatives = aggdata->dtada_flags & DTRACE_A_HASNEGATIVES;
-		int64_t val;
-
-		assert(act == DTRACEAGG_SUM || act == DTRACEAGG_COUNT);
-		val = (long long)*((uint64_t *)addr);
-
-		if (dt_printf(dtp, fp, " ") < 0)
-			return (-1);
-
-		return (dt_print_quantline(dtp, fp, val, normal,
-		    aggdata->dtada_total, positives, negatives));
-	}
-
-	if (pd->dtpa_aggpack && DTRACEACT_ISAGG(act)) {
-		switch (act) {
-		case DTRACEAGG_QUANTIZE:
-			return (dt_print_quantize_packed(dtp,
-			    fp, addr, size, aggdata));
-		case DTRACEAGG_LQUANTIZE:
-			return (dt_print_lquantize_packed(dtp,
-			    fp, addr, size, aggdata));
-		default:
-			break;
-		}
-	}
 
 	switch (act) {
 	case DTRACEACT_STACK:
@@ -2220,33 +1839,28 @@ dt_print_datum(dtrace_hdl_t *dtp, FILE *
 		break;
 	}
 
-	for (fmt = fmttab; fmt->size && fmt->size != size; fmt++)
-		continue;
-
-	width = packed ? fmt->packedwidth : fmt->width;
-
 	switch (size) {
 	case sizeof (uint64_t):
-		err = dt_printf(dtp, fp, " %*lld", width,
+		err = dt_printf(dtp, fp, " %16lld",
 		    /* LINTED - alignment */
 		    (long long)*((uint64_t *)addr) / normal);
 		break;
 	case sizeof (uint32_t):
 		/* LINTED - alignment */
-		err = dt_printf(dtp, fp, " %*d", width, *((uint32_t *)addr) /
+		err = dt_printf(dtp, fp, " %8d", *((uint32_t *)addr) /
 		    (uint32_t)normal);
 		break;
 	case sizeof (uint16_t):
 		/* LINTED - alignment */
-		err = dt_printf(dtp, fp, " %*d", width, *((uint16_t *)addr) /
+		err = dt_printf(dtp, fp, " %5d", *((uint16_t *)addr) /
 		    (uint32_t)normal);
 		break;
 	case sizeof (uint8_t):
-		err = dt_printf(dtp, fp, " %*d", width, *((uint8_t *)addr) /
+		err = dt_printf(dtp, fp, " %3d", *((uint8_t *)addr) /
 		    (uint32_t)normal);
 		break;
 	default:
-		err = dt_print_bytes(dtp, fp, addr, size, width, 0, 0);
+		err = dt_print_bytes(dtp, fp, addr, size, 50, 0, 0);
 		break;
 	}
 
@@ -2267,9 +1881,6 @@ dt_print_aggs(const dtrace_aggdata_t **a
 	caddr_t addr;
 	size_t size;
 
-	pd->dtpa_agghist = (aggdata->dtada_flags & DTRACE_A_TOTAL);
-	pd->dtpa_aggpack = (aggdata->dtada_flags & DTRACE_A_MINMAXBIN);
-
 	/*
 	 * Iterate over each record description in the key, printing the traced
 	 * data, skipping the first datum (the tuple member created by the
@@ -2286,8 +1897,7 @@ dt_print_aggs(const dtrace_aggdata_t **a
 			break;
 		}
 
-		if (dt_print_datum(dtp, fp, rec, addr,
-		    size, aggdata, 1, pd) < 0)
+		if (dt_print_datum(dtp, fp, rec, addr, size, 1) < 0)
 			return (-1);
 
 		if (dt_buffered_flush(dtp, NULL, rec, aggdata,
@@ -2310,8 +1920,7 @@ dt_print_aggs(const dtrace_aggdata_t **a
 		assert(DTRACEACT_ISAGG(act));
 		normal = aggdata->dtada_normal;
 
-		if (dt_print_datum(dtp, fp, rec, addr,
-		    size, aggdata, normal, pd) < 0)
+		if (dt_print_datum(dtp, fp, rec, addr, size, normal) < 0)
 			return (-1);
 
 		if (dt_buffered_flush(dtp, NULL, rec, aggdata,
@@ -2322,10 +1931,8 @@ dt_print_aggs(const dtrace_aggdata_t **a
 			agg->dtagd_flags |= DTRACE_AGD_PRINTED;
 	}
 
-	if (!pd->dtpa_agghist && !pd->dtpa_aggpack) {
-		if (dt_printf(dtp, fp, "\n") < 0)
-			return (-1);
-	}
+	if (dt_printf(dtp, fp, "\n") < 0)
+		return (-1);
 
 	if (dt_buffered_flush(dtp, NULL, NULL, aggdata,
 	    DTRACE_BUFDATA_AGGFORMAT | DTRACE_BUFDATA_AGGLAST) < 0)
@@ -2794,7 +2401,7 @@ nofmt:
 				}
 
 				n = dt_print_bytes(dtp, fp, addr,
-				    tracememsize, -33, quiet, 1);
+				    tracememsize, 33, quiet, 1);
 
 				tracememsize = 0;
 
@@ -2827,7 +2434,7 @@ nofmt:
 				break;
 			default:
 				n = dt_print_bytes(dtp, fp, addr,
-				    rec->dtrd_size, -33, quiet, 0);
+				    rec->dtrd_size, 33, quiet, 0);
 				break;
 			}
 

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h	Thu Jun 26 17:27:36 2014	(r267924)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h	Thu Jun 26 17:34:42 2014	(r267925)
@@ -189,9 +189,6 @@ typedef struct dt_print_aggdata {
 	dtrace_aggvarid_t dtpa_id;	/* aggregation variable of interest */
 	FILE *dtpa_fp;			/* file pointer */
 	int dtpa_allunprint;		/* print only unprinted aggregations */
-	int dtpa_agghist;		/* print aggregation as histogram */
-	int dtpa_agghisthdr;		/* aggregation histogram hdr printed */
-	int dtpa_aggpack;		/* pack quantized aggregations */
 } dt_print_aggdata_t;
 
 typedef struct dt_dirpath {
@@ -286,7 +283,6 @@ struct dtrace_hdl {
 	uint_t dt_linktype;	/* dtrace link output file type (see below) */
 	uint_t dt_xlatemode;	/* dtrace translator linking mode (see below) */
 	uint_t dt_stdcmode;	/* dtrace stdc compatibility mode (see below) */
-	uint_t dt_encoding;	/* dtrace output encoding (see below) */
 	uint_t dt_treedump;	/* dtrace tree debug bitmap (see below) */
 	uint64_t dt_options[DTRACEOPT_MAX]; /* dtrace run-time options */
 	int dt_version;		/* library version requested by client */
@@ -378,14 +374,6 @@ struct dtrace_hdl {
 #define	DT_STDC_XT	3	/* ISO C + K&R C compat with ISO: __STDC__=0 */
 
 /*
- * Values for the dt_encoding property, which is used to force a particular
- * character encoding (overriding default behavior and/or automatic detection).
- */
-#define	DT_ENCODING_UNSET	0
-#define	DT_ENCODING_ASCII	1
-#define	DT_ENCODING_UTF8	2
-
-/*
  * Macro to test whether a given pass bit is set in the dt_treedump bit-vector.
  * If the bit for pass 'p' is set, the D compiler displays the parse tree for
  * the program by printing it to stderr at the end of compiler pass 'p'.

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c	Thu Jun 26 17:27:36 2014	(r267924)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c	Thu Jun 26 17:34:42 2014	(r267925)
@@ -122,14 +122,9 @@
 #define	DT_VERS_1_8_1	DT_VERSION_NUMBER(1, 8, 1)
 #define	DT_VERS_1_9	DT_VERSION_NUMBER(1, 9, 0)
 #define	DT_VERS_1_9_1	DT_VERSION_NUMBER(1, 9, 1)
-#define	DT_VERS_1_9_2	DT_VERSION_NUMBER(1, 9, 2) /* FreeBSD specific */
-#define	DT_VERS_1_10	DT_VERSION_NUMBER(1, 10, 0)
-#define	DT_VERS_1_11	DT_VERSION_NUMBER(1, 11, 0)
-#define	DT_VERS_1_12	DT_VERSION_NUMBER(1, 12, 0)
-#define	DT_VERS_1_12_1	DT_VERSION_NUMBER(1, 12, 1)
-#define	DT_VERS_LATEST	DT_VERS_1_9_2
-#define	DT_VERS_STRING	"Sun D 1.9.2"
- 
+#define	DT_VERS_LATEST	DT_VERS_1_9_1
+#define	DT_VERS_STRING	"Sun D 1.9.1"
+
 const dt_version_t _dtrace_versions[] = {
 	DT_VERS_1_0,	/* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */
 	DT_VERS_1_1,	/* D API 1.1.0 Solaris Express 6/05 */
@@ -150,11 +145,6 @@ const dt_version_t _dtrace_versions[] = 
 	DT_VERS_1_8_1,	/* D API 1.8.1 */
 	DT_VERS_1_9,	/* D API 1.9 */
 	DT_VERS_1_9_1,	/* D API 1.9.1 */
-	DT_VERS_1_9_2,	/* D API 1.9.1 */

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 18:38:23 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 44A6E3E3
 for ; Thu, 26 Jun 2014 18:38:23 +0000 (UTC)
Received: from nm2-vm1.bullet.mail.bf1.yahoo.com
 (nm2-vm1.bullet.mail.bf1.yahoo.com [98.139.213.158])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BC90A2A58
 for ; Thu, 26 Jun 2014 18:38:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1403807498; bh=NZgapiptylAs+vCVJ8ENw71p1mtxZEf4DbU3qAxsSzc=;
 h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding;
 b=MOeWAjqY+VtZUKzioYl6wiYtnd4SfVq3hWaZVt53C43SHRqxKkJagjWYvTBjToyjAdkdJvPwgKg5NvMtSOV5Wp469MCgj0zSx0cpamUiK0i0arT2Skm6lD4Otr9a9Pg4fpuixkJe0v9L8ExBP1oDjDyJXqsTW3lkFkgGMo7AlN59sY5Xw+hwoo5wYTgjutPuPVIwT1qPw0eUkQr0pnhAPRvjTrwoueCVjWMq39hW8zW6Np67YpPLpT6Cv78RbX9ZEF4UkVFWi8LfrtXllSrGMJ4sV5/6KvsroVR4Wma1ZYJ9RdleD7RjfM/ag2M+i5VDSCEu1oShLSUvVEPmFHPZVw==
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com;
 b=Q/ijNKxfctIUGkowQXm3ISMoLwaB6KEAtPCW3AvQI05TUCGrCVuU9ebdUNHFpXlEpamdlrCUaLv4bQElWzLOYl7yDBTPJcXC2Epvzci8/DjMCnqJtG8O1Fpry7nwOoCNo4tOBPxwXcG1DowQlY+QIa28CfajS2qJXgx3t5fNRTmHSERaTnyPt2VIwGS3lY+bIx50dV2QFdP0cPVbc5Rx2viBD9nxaqW76p0QHlZDdmI46mJ8dPUgqWqQpt5ECFwcvBlLlrh1blzm1i2wCRCTmw1IL7K72nm0wu02dXgDM25a0orqrHagbDoa5II05FPKK/9iGEMTh7Zo71+HsSoeWA==;
Received: from [66.196.81.171] by nm2.bullet.mail.bf1.yahoo.com with NNFMP;
 26 Jun 2014 18:31:38 -0000
Received: from [68.142.230.65] by tm17.bullet.mail.bf1.yahoo.com with NNFMP;
 26 Jun 2014 18:31:38 -0000
Received: from [127.0.0.1] by smtp222.mail.bf1.yahoo.com with NNFMP;
 26 Jun 2014 18:31:38 -0000
X-Yahoo-Newman-Id: 519615.52236.bm@smtp222.mail.bf1.yahoo.com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: hwd7UQIVM1n4zjaAhH5wEYOBJ7RRD.bshC8j2t8shfXuYHO
 5wJ6xXgBbb7srRphfulwp4iOZFBgakXn6aymLQvrrBUUOu4kLyztUH6HZ7Gu
 fc9dUhs.60t_aFXU7bTyq93k27PvnEC24x8zQiJuXGQfMEMT1QswmtpqTAtD
 Ffd37sclx8oBczqxowINNot6jnUPOK5cvaA0wOB7728Q1S0LwblVbRX8soPV
 VGDE08er9UTvIT7eEUKdYpIbvcsTiRnW0cI7mRG15cv4SFJscgruS0Kw27mn
 pKfJF3AmZHupyQOw3POnWzsQGWFbdX0.LVlaFkbmmKBxsoQw4OSWFpv2calp
 HLVMUxfx2kiUhkD7Tr28V2WW1DG7XE5SStuiE1nJKB_.0hkr1JKjoJFvcARY
 2dChoGSoSmqLSyk7EOzyErtfAMW4ZsPOBfCOqSaestIyDmCYhxoYCNgLja1J
 2MjWJoH_1ZOsUKgL6wj_UxT18Jgnb9PWIqbIWRcfs980CVsqVDfVTjqOfodj
 HFNqiUm8Eqr8fTpgojPGqaU3RI7w-
X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf
X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain
 [98.138.105.21])
 by smtp222.mail.bf1.yahoo.com with SMTP; 26 Jun 2014 18:31:38 +0000 UTC
Message-ID: <53AC6709.5040604@freebsd.org>
Date: Thu, 26 Jun 2014 13:31:37 -0500
From: Pedro Giffuni 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:24.0) Gecko/20100101 Thunderbird/24.5.0
MIME-Version: 1.0
To: Rui Paulo 
Subject: Re: svn commit: r267898 - in head:
 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs
 cddl/contrib/opensolaris/lib/libdtrace/common
 sys/cddl/contrib/opensolaris/uts/common/sys
References: <201406260706.s5Q76hYW014217@svn.freebsd.org>
 <53ABC9FE.4000107@FreeBSD.org>
 
 <92E13997-8653-4A99-912A-F06540EA22C8@FreeBSD.org>
In-Reply-To: <92E13997-8653-4A99-912A-F06540EA22C8@FreeBSD.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
 src-committers@FreeBSD.org, Andriy Gapon 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 18:38:23 -0000


On 06/26/14 10:59, Rui Paulo wrote:
> On Jun 26, 2014, at 1:16, Pedro Giffuni  wrote:
>
>> 2) It is not respecting the order in which upstream (Illumos AFAICT) adds features so it breaks the sense of DT_VERS_LATEST
> I disagree.  I specifically added a new version, 1.9.2, which is not present in Illumos to cope with this.  DT_VERS_LATEST points to our latest version, not Illumos latest version.  I don't think it's necessary to merge all the other versions when we can have our own version number.

We have been keeping the DT_VERS_* in sync with the Illumos guys.

There is an implicit agreement that they maintain the API so that people
that see that DT_VERS_LATEST >= 1.12.1 know they can use this feature.
If we are not going to respect it then we shouldn't bump it at all.

None of this is written though, so you have your right to disagree, but
that doesn't make upgrades consistent.

Pedro.


From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 19:03:10 2014
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D7783959;
 Thu, 26 Jun 2014 19:03:10 +0000 (UTC)
Received: from felyko.com (felyko.com [IPv6:2001:470:1:2d5:26:3:1337:ca7])
 by mx1.freebsd.org (Postfix) with ESMTP id A8AE32CB4;
 Thu, 26 Jun 2014 19:03:10 +0000 (UTC)
Received: from [10.47.9.81] (unknown [12.218.212.178])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by felyko.com (Postfix) with ESMTPSA id 727D534A9D5;
 Thu, 26 Jun 2014 12:02:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail;
 t=1403809380; bh=0RxFej1bISlfRYAd+0NEtihB7PuD4HuacQfj62gbW7c=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To;
 b=LsvTeI1SfJk5gcca/aFhV7/S223dKXtjyRpgfu1oDrJV5KTjI2/pza5A1Q0I47x0O
 8VYQLsSj+5UBQPDku+W0X1WvMuMNVrAnoS6dQCbGTvLmjR4jocBpGUwRexnsVALp2G
 IyeIE3aUqUgmG2/6qrh2znG50tr0GMmpu4oJ52CU=
Mime-Version: 1.0 (1.0)
Subject: Re: svn commit: r267898 - in head:
 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs
 cddl/contrib/opensolaris/lib/libdtrace/common
 sys/cddl/contrib/opensolaris/uts/common/sys
From: Rui Paulo 
X-Mailer: iPhone Mail (11D201)
In-Reply-To: 
Date: Thu, 26 Jun 2014 12:02:55 -0700
Message-Id: <1C66CDB4-CB33-4B58-A924-8D66C33724A3@felyko.com>
References: <201406260706.s5Q76hYW014217@svn.freebsd.org>
 <53ABC9FE.4000107@FreeBSD.org>
 
To: Pedro Giffuni 
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Content-Filtered-By: Mailman/MimeDel 2.1.18
Cc: "svn-src-head@FreeBSD.org" ,
 "svn-src-all@FreeBSD.org" ,
 "src-committers@FreeBSD.org" ,
 Rui Paulo , Andriy Gapon 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 19:03:10 -0000

I'll import the other versions for the sake of compatibility. Unfortunately o=
ne of them is really specific to Solaris zones and doesn't get us anything.=20=


--
Rui Paulo

> On 26 Jun 2014, at 01:16, Pedro Giffuni  wrote:
>=20
>=20
>> Il giorno 26/giu/2014, alle ore 02:21, Andriy Gapon  ha s=
critto:
>>=20
>>> On 26/06/2014 11:06, Rui Paulo wrote:
>>> Author: rpaulo
>>> Date: Thu Jun 26 07:06:43 2014
>>> New Revision: 267898
>>> URL: http://svnweb.freebsd.org/changeset/base/267898
>>>=20
>>> Log:
>>>  Bring the following change from the illumos-joyent repository:
>>>=20
>>>  commit 78e24ab6803bbe11ba37642624e1498ede5b239d
>>>  Author: Bryan Cantrill 
>>>  Date:   Thu Oct 31 01:20:54 2013
>>>=20
>>>      OS-1688 DTrace count() with histogram
>>>      OS-2360 DTrace full width distribution histograms
>>>      OS-2361 DTrace frequency trails
>>>=20
>>>  MFC after:	2 weeks
>>=20
>> Seems like this change is in illumos already:
>>=20
>> commit 33093f5bcdc51014933497dd39374080c1ac5705
>> Author: Bryan Cantrill 
>> Date:   Thu Oct 31 08:20:54 2013 +0000
>>=20
>>    4471 DTrace count() with histogram
>>    4472 DTrace full width distribution histograms
>>    4473 DTrace frequency trails
>>    Reviewed by: Dan McDonald 
>>    Approved by: Gordon Ross 
>>=20
>> As such it would have been preferable to use our standard workflow and
>> merge the change via the illumos vendor area.
>>=20
>=20
> Indeed, this change is in the vendor area:
>=20
> http://svnweb.freebsd.org/base?view=3Drevision&revision=3D266992
>=20
> However the commit is wrong because:
>=20
> 1) It added files instead of copying them from/through the vendor area.
> 2) It is not respecting the order in which upstream (Illumos AFAICT) adds f=
eatures so it breaks the sense of DT_VERS_LATEST
>=20
> I am aware that DTrace imports have not been respecting the regular mergin=
g procedure but we are trying to work on that. Please fix at least (1), (2) i=
mplies merging three commits that precede this one.=20
>=20
> Pedro.

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 19:38:18 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 36B37443;
 Thu, 26 Jun 2014 19:38:18 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1FF632FF7;
 Thu, 26 Jun 2014 19:38:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QJcId1074836;
 Thu, 26 Jun 2014 19:38:18 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QJcGFV074823;
 Thu, 26 Jun 2014 19:38:16 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201406261938.s5QJcGFV074823@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 26 Jun 2014 19:38:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267929 - in head:
 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs
 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs
 cddl/contrib/opensolaris/lib/libdtrace/common sys/c...
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 19:38:18 -0000

Author: rpaulo
Date: Thu Jun 26 19:38:16 2014
New Revision: 267929
URL: http://svnweb.freebsd.org/changeset/base/267929

Log:
  MFV illumos r266986:
  
  2915 DTrace in a zone should see "cpu", "curpsinfo", et al
  2916 DTrace in a zone should be able to access fds[]
  2917 DTrace in a zone should have limited provider access
  
  MFC after:	2 weeks

Added:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.fds.ksh
     - copied unchanged from r266986, vendor/illumos/dist/cmd/dtrace/test/tst/common/privs/tst.fds.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.getf.ksh
     - copied unchanged from r266986, vendor/illumos/dist/cmd/dtrace/test/tst/common/privs/tst.getf.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.procpriv.ksh
     - copied unchanged from r266986, vendor/illumos/dist/cmd/dtrace/test/tst/common/privs/tst.procpriv.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.providers.ksh
     - copied unchanged from r266986, vendor/illumos/dist/cmd/dtrace/test/tst/common/privs/tst.providers.ksh
Modified:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/sdt_subr.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h
  head/sys/cddl/dev/dtrace/dtrace_cddl.h
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d	Thu Jun 26 19:19:06 2014	(r267928)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d	Thu Jun 26 19:38:16 2014	(r267929)
@@ -97,6 +97,7 @@ INTFUNC(ntohll(0x1234567890abcdefL))
 STRFUNC(inet_ntoa((ipaddr_t *)alloca(sizeof (ipaddr_t))))
 STRFUNC(inet_ntoa6((in6_addr_t *)alloca(sizeof (in6_addr_t))))
 STRFUNC(inet_ntop(AF_INET, (void *)alloca(sizeof (ipaddr_t))))
+INTFUNC(getf(0))
 
 BEGIN
 /subr == DIF_SUBR_MAX + 1/

Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.fds.ksh (from r266986, vendor/illumos/dist/cmd/dtrace/test/tst/common/privs/tst.fds.ksh)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.fds.ksh	Thu Jun 26 19:38:16 2014	(r267929, copy of r266986, vendor/illumos/dist/cmd/dtrace/test/tst/common/privs/tst.fds.ksh)
@@ -0,0 +1,91 @@
+#
+# CDDL HEADER START
+#
+# 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]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
+#
+
+tmpin=/tmp/tst.fds.$$.d
+tmpout1=/tmp/tst.fds.$$.out1
+tmpout2=/tmp/tst.fds.$$.out2
+
+cat > $tmpin < $tmpout2
+mv $tmpout2 $tmpout1
+
+#
+# And now with only dtrace_proc and dtrace_user -- the output should be
+# identical.
+#
+ppriv -s A=basic,dtrace_proc,dtrace_user $$
+
+/usr/sbin/dtrace -q -Cs /dev/stdin < $tmpin > $tmpout2
+
+echo ">>> $tmpout1"
+cat $tmpout1
+
+echo ">>> $tmpout2"
+cat $tmpout2
+
+rval=0
+
+if ! cmp $tmpout1 $tmpout2 ; then
+	rval=1
+fi
+
+rm $tmpout1 $tmpout2 $tmpin
+exit $rval

Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.getf.ksh (from r266986, vendor/illumos/dist/cmd/dtrace/test/tst/common/privs/tst.getf.ksh)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.getf.ksh	Thu Jun 26 19:38:16 2014	(r267929, copy of r266986, vendor/illumos/dist/cmd/dtrace/test/tst/common/privs/tst.getf.ksh)
@@ -0,0 +1,98 @@
+#
+# CDDL HEADER START
+#
+# 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]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
+#
+
+ppriv -s A=basic,dtrace_proc,dtrace_user $$
+
+/usr/sbin/dtrace -q -Cs /dev/stdin <fp = getf(0); errmsg = "can't read field"; \
+	    printf("field: "); trace(this->fp->field); printf("\n"); }
+
+#define CANTREAD(field) \
+	BEGIN { errmsg = ""; this->fp = getf(0); trace(this->fp->field); \
+	    printf("\nable to successfully read field!"); exit(1); }
+
+CANREAD(f_flag)
+CANREAD(f_flag2)
+CANREAD(f_vnode)
+CANREAD(f_offset)
+CANREAD(f_cred)
+CANREAD(f_audit_data)
+CANREAD(f_count)
+
+/*
+ * We can potentially read parts of our cred, but we can't dereference
+ * through cr_zone.
+ */
+CANTREAD(f_cred->cr_zone->zone_id)
+
+CANREAD(f_vnode->v_path)
+CANREAD(f_vnode->v_op)
+CANREAD(f_vnode->v_op->vnop_name)
+
+CANTREAD(f_vnode->v_flag)
+CANTREAD(f_vnode->v_count)
+CANTREAD(f_vnode->v_pages)
+CANTREAD(f_vnode->v_type)
+CANTREAD(f_vnode->v_vfsmountedhere)
+CANTREAD(f_vnode->v_op->vop_open)
+
+BEGIN
+{
+	errmsg = "";
+	this->fp = getf(0);
+	this->fp2 = getf(1);
+
+	trace(this->fp->f_vnode);
+	printf("\nable to successfully read this->fp!");
+	exit(1);
+}
+
+BEGIN
+{
+	errmsg = "";
+	this->fp = getf(0);
+}
+
+BEGIN
+{
+	trace(this->fp->f_vnode);
+	printf("\nable to successfully read this->fp from prior clause!");
+}
+
+BEGIN
+{
+	exit(0);
+}
+
+ERROR
+/errmsg != ""/
+{
+	printf("fatal error: %s", errmsg);
+	exit(1);
+}
+	
+EOF

Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.procpriv.ksh (from r266986, vendor/illumos/dist/cmd/dtrace/test/tst/common/privs/tst.procpriv.ksh)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.procpriv.ksh	Thu Jun 26 19:38:16 2014	(r267929, copy of r266986, vendor/illumos/dist/cmd/dtrace/test/tst/common/privs/tst.procpriv.ksh)
@@ -0,0 +1,138 @@
+#
+# CDDL HEADER START
+#
+# 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]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
+#
+
+ppriv -s A=basic,dtrace_proc,dtrace_user $$
+
+#
+# When we have dtrace_proc (but lack dtrace_kernel), we expect to be able to
+# read certain curpsinfo/curlwpsinfo/curcpu fields even though they require
+# reading in-kernel state.  However, there are other fields in these translated
+# structures that we know we shouldn't be able to read, as they require reading
+# in-kernel state that we cannot read with only dtrace_proc.  Finally, there
+# are a few fields that we may or may not be able to read depending on the
+# specifics of context.  This test therefore asserts that we can read what we
+# think we should be able to, that we can't read what we think we shouldn't be
+# able to, and (for purposes of completeness) that we are indifferent about
+# what we cannot assert one way or the other.
+#
+/usr/sbin/dtrace -q -Cs /dev/stdin <field); printf("\n"); }
+
+#define CANTREAD(what, field) \
+    BEGIN { errmsg = ""; trace(what->field); \
+	printf("\nable to successfully read field from what!"); exit(1); }
+
+#define MIGHTREAD(what, field) \
+    BEGIN { errmsg = ""; printf("field: "); trace(what->field); printf("\n"); }
+
+#define CANREADVAR(vname) \
+    BEGIN { errmsg = "can't read vname"; printf("vname: "); \
+	trace(vname); printf("\n"); }
+
+#define CANTREADVAR(vname) \
+    BEGIN { errmsg = ""; trace(vname); \
+	printf("\nable to successfully read vname!"); exit(1); }
+
+#define MIGHTREADVAR(vname) \
+    BEGIN { errmsg = ""; printf("vname: "); trace(vname); printf("\n"); }
+
+CANREAD(curpsinfo, pr_pid)
+CANREAD(curpsinfo, pr_nlwp)
+CANREAD(curpsinfo, pr_ppid)
+CANREAD(curpsinfo, pr_uid)
+CANREAD(curpsinfo, pr_euid)
+CANREAD(curpsinfo, pr_gid)
+CANREAD(curpsinfo, pr_egid)
+CANREAD(curpsinfo, pr_addr)
+CANREAD(curpsinfo, pr_start)
+CANREAD(curpsinfo, pr_fname)
+CANREAD(curpsinfo, pr_psargs)
+CANREAD(curpsinfo, pr_argc)
+CANREAD(curpsinfo, pr_argv)
+CANREAD(curpsinfo, pr_envp)
+CANREAD(curpsinfo, pr_dmodel)
+
+/*
+ * If our p_pgidp points to the same pid structure as our p_pidp, we will
+ * be able to read pr_pgid -- but we won't if not.
+ */
+MIGHTREAD(curpsinfo, pr_pgid)
+
+CANTREAD(curpsinfo, pr_sid)
+CANTREAD(curpsinfo, pr_ttydev)
+CANTREAD(curpsinfo, pr_projid)
+CANTREAD(curpsinfo, pr_zoneid)
+CANTREAD(curpsinfo, pr_contract)
+
+CANREAD(curlwpsinfo, pr_flag)
+CANREAD(curlwpsinfo, pr_lwpid)
+CANREAD(curlwpsinfo, pr_addr)
+CANREAD(curlwpsinfo, pr_wchan)
+CANREAD(curlwpsinfo, pr_stype)
+CANREAD(curlwpsinfo, pr_state)
+CANREAD(curlwpsinfo, pr_sname)
+CANREAD(curlwpsinfo, pr_syscall)
+CANREAD(curlwpsinfo, pr_pri)
+CANREAD(curlwpsinfo, pr_onpro)
+CANREAD(curlwpsinfo, pr_bindpro)
+CANREAD(curlwpsinfo, pr_bindpset)
+
+CANTREAD(curlwpsinfo, pr_clname)
+CANTREAD(curlwpsinfo, pr_lgrp)
+
+CANREAD(curcpu, cpu_id)
+
+CANTREAD(curcpu, cpu_pset)
+CANTREAD(curcpu, cpu_chip)
+CANTREAD(curcpu, cpu_lgrp)
+CANTREAD(curcpu, cpu_info)
+
+/*
+ * We cannot assert one thing or another about the variable "root":  for those
+ * with only dtrace_proc, it will be readable in the global but not readable in
+ * the non-global.
+ */
+MIGHTREADVAR(root)
+
+CANREADVAR(cpu)
+CANTREADVAR(pset)
+CANTREADVAR(cwd)
+CANTREADVAR(chip)
+CANTREADVAR(lgrp)
+
+BEGIN
+{
+	exit(0);
+}
+
+ERROR
+/errmsg != ""/
+{
+	printf("fatal error: %s", errmsg);
+	exit(1);
+}

Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.providers.ksh (from r266986, vendor/illumos/dist/cmd/dtrace/test/tst/common/privs/tst.providers.ksh)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.providers.ksh	Thu Jun 26 19:38:16 2014	(r267929, copy of r266986, vendor/illumos/dist/cmd/dtrace/test/tst/common/privs/tst.providers.ksh)
@@ -0,0 +1,126 @@
+#
+# CDDL HEADER START
+#
+# 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]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
+#
+
+#
+# First, make sure that we can successfully enable the io provider
+#
+if ! dtrace -P io -n BEGIN'{exit(0)}' > /dev/null 2>&1 ; then
+	echo failed to enable io provider with full privs
+	exit 1
+fi
+
+ppriv -s A=basic,dtrace_proc,dtrace_user $$
+
+#
+# Now make sure that we cannot enable the io provider with reduced privs
+#
+if ! dtrace -x errtags -P io -n BEGIN'{exit(1)}' 2>&1 | \
+    grep D_PDESC_ZERO > /dev/null 2>&1 ; then
+	echo successfully enabled the io provider with reduced privs
+	exit 1
+fi
+
+#
+# Keeping our reduced privs, we want to assure that we can see every provider
+# that we think we should be able to see -- and that we can see curpsinfo
+# state but can't otherwise see arguments.
+#
+/usr/sbin/dtrace -wq -Cs /dev/stdin <ignore = stringof(curpsinfo->pr_psargs);			\
+	errstr = "";							\
+}									\
+									\
+END									\
+/err == 0 && !seen["provider"]/						\
+{									\
+	printf("no probes from provider\n");				\
+	exit(++err);							\
+}									\
+									\
+END									\
+/err == 0/								\
+{									\
+	printf("saw %d probes from provider\n", seen["provider"]);	\
+}
+
+CANENABLE(proc)
+CANENABLE(sched)
+CANENABLE(vminfo)
+CANENABLE(sysinfo)
+
+BEGIN
+{
+	/*
+	 * We'll kick off a system of a do-nothing command -- which should be
+	 * enough to kick proc, sched, vminfo and sysinfo probes.
+	 */
+	system("echo > /dev/null");
+}
+
+ERROR
+/err == 0 && errstr != ""/
+{
+	printf("fatal error: couldn't read curpsinfo->pr_psargs in ");
+	printf("%s-provided probe\n", errstr);
+	exit(++err);
+}
+
+proc:::exit
+/progenyof(\$pid)/
+{
+	exit(0);
+}
+
+tick-10ms
+/i++ > 500/
+{
+	printf("exit probe did not seem to fire\n");
+	exit(++err);
+}
+EOF

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c	Thu Jun 26 19:19:06 2014	(r267928)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c	Thu Jun 26 19:38:16 2014	(r267929)
@@ -21,7 +21,7 @@
 
 /*
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  * Copyright (c) 2012 by Delphix. All rights reserved.
  */
 
@@ -122,8 +122,9 @@
 #define	DT_VERS_1_8_1	DT_VERSION_NUMBER(1, 8, 1)
 #define	DT_VERS_1_9	DT_VERSION_NUMBER(1, 9, 0)
 #define	DT_VERS_1_9_1	DT_VERSION_NUMBER(1, 9, 1)
-#define	DT_VERS_LATEST	DT_VERS_1_9_1
-#define	DT_VERS_STRING	"Sun D 1.9.1"
+#define	DT_VERS_1_10	DT_VERSION_NUMBER(1, 10, 0)
+#define	DT_VERS_LATEST	DT_VERS_1_10
+#define	DT_VERS_STRING	"Sun D 1.10"
 
 const dt_version_t _dtrace_versions[] = {
 	DT_VERS_1_0,	/* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */
@@ -145,6 +146,7 @@ const dt_version_t _dtrace_versions[] = 
 	DT_VERS_1_8_1,	/* D API 1.8.1 */
 	DT_VERS_1_9,	/* D API 1.9 */
 	DT_VERS_1_9_1,	/* D API 1.9.1 */
+	DT_VERS_1_10,	/* D API 1.10 */
 	0
 };
 
@@ -275,6 +277,8 @@ static const dt_ident_t _dtrace_globals[
 	&dt_idops_func, "uint64_t(uint64_t)" },
 { "htons", DT_IDENT_FUNC, 0, DIF_SUBR_HTONS, DT_ATTR_EVOLCMN, DT_VERS_1_3,
 	&dt_idops_func, "uint16_t(uint16_t)" },
+{ "getf", DT_IDENT_FUNC, 0, DIF_SUBR_GETF, DT_ATTR_STABCMN, DT_VERS_1_10,
+	&dt_idops_func, "file_t *(int)" },
 { "gid", DT_IDENT_SCALAR, 0, DIF_VAR_GID, DT_ATTR_STABCMN, DT_VERS_1_0,
 	&dt_idops_type, "gid_t" },
 { "id", DT_IDENT_SCALAR, 0, DIF_VAR_ID, DT_ATTR_STABCMN, DT_VERS_1_0,

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Thu Jun 26 19:19:06 2014	(r267928)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Thu Jun 26 19:38:16 2014	(r267929)
@@ -219,6 +219,7 @@ static dtrace_provider_t *dtrace_provide
 static dtrace_meta_t	*dtrace_meta_pid;	/* user-land meta provider */
 static int		dtrace_opens;		/* number of opens */
 static int		dtrace_helpers;		/* number of helpers */
+static int		dtrace_getf;		/* number of unpriv getf()s */
 #if defined(sun)
 static void		*dtrace_softstate;	/* softstate pointer */
 #endif
@@ -468,8 +469,8 @@ static kmutex_t dtrace_errlock;
  * disallow all negative sizes.  Ranges of size 0 are allowed.
  */
 #define	DTRACE_INRANGE(testaddr, testsz, baseaddr, basesz) \
-	((testaddr) - (baseaddr) < (basesz) && \
-	(testaddr) + (testsz) - (baseaddr) <= (basesz) && \
+	((testaddr) - (uintptr_t)(baseaddr) < (basesz) && \
+	(testaddr) + (testsz) - (uintptr_t)(baseaddr) <= (basesz) && \
 	(testaddr) + (testsz) >= (testaddr))
 
 /*
@@ -578,6 +579,8 @@ void dtrace_dynvar_clean(dtrace_dstate_t
 dtrace_dynvar_t *dtrace_dynvar(dtrace_dstate_t *, uint_t, dtrace_key_t *,
     size_t, dtrace_dynvar_op_t, dtrace_mstate_t *, dtrace_vstate_t *);
 uintptr_t dtrace_dif_varstr(uintptr_t, dtrace_state_t *, dtrace_mstate_t *);
+static int dtrace_priv_proc(dtrace_state_t *);
+static void dtrace_getf_barrier(void);
 
 /*
  * DTrace Probe Context Functions
@@ -722,7 +725,7 @@ dtrace_canstore(uint64_t addr, size_t sz
 	 * up both thread-local variables and any global dynamically-allocated
 	 * variables.
 	 */
-	if (DTRACE_INRANGE(addr, sz, (uintptr_t)vstate->dtvs_dynvars.dtds_base,
+	if (DTRACE_INRANGE(addr, sz, vstate->dtvs_dynvars.dtds_base,
 	    vstate->dtvs_dynvars.dtds_size)) {
 		dtrace_dstate_t *dstate = &vstate->dtvs_dynvars;
 		uintptr_t base = (uintptr_t)dstate->dtds_base +
@@ -789,6 +792,7 @@ dtrace_canload(uint64_t addr, size_t sz,
     dtrace_vstate_t *vstate)
 {
 	volatile uintptr_t *illval = &cpu_core[curcpu].cpuc_dtrace_illval;
+	file_t *fp;
 
 	/*
 	 * If we hold the privilege to read from kernel memory, then
@@ -806,10 +810,104 @@ dtrace_canload(uint64_t addr, size_t sz,
 	/*
 	 * We're allowed to read from our own string table.
 	 */
-	if (DTRACE_INRANGE(addr, sz, (uintptr_t)mstate->dtms_difo->dtdo_strtab,
+	if (DTRACE_INRANGE(addr, sz, mstate->dtms_difo->dtdo_strtab,
 	    mstate->dtms_difo->dtdo_strlen))
 		return (1);
 
+	if (vstate->dtvs_state != NULL &&
+	    dtrace_priv_proc(vstate->dtvs_state)) {
+		proc_t *p;
+
+		/*
+		 * When we have privileges to the current process, there are
+		 * several context-related kernel structures that are safe to
+		 * read, even absent the privilege to read from kernel memory.
+		 * These reads are safe because these structures contain only
+		 * state that (1) we're permitted to read, (2) is harmless or
+		 * (3) contains pointers to additional kernel state that we're
+		 * not permitted to read (and as such, do not present an
+		 * opportunity for privilege escalation).  Finally (and
+		 * critically), because of the nature of their relation with
+		 * the current thread context, the memory associated with these
+		 * structures cannot change over the duration of probe context,
+		 * and it is therefore impossible for this memory to be
+		 * deallocated and reallocated as something else while it's
+		 * being operated upon.
+		 */
+		if (DTRACE_INRANGE(addr, sz, curthread, sizeof (kthread_t)))
+			return (1);
+
+		if ((p = curthread->t_procp) != NULL && DTRACE_INRANGE(addr,
+		    sz, curthread->t_procp, sizeof (proc_t))) {
+			return (1);
+		}
+
+		if (curthread->t_cred != NULL && DTRACE_INRANGE(addr, sz,
+		    curthread->t_cred, sizeof (cred_t))) {
+			return (1);
+		}
+
+#if defined(sun)
+		if (p != NULL && p->p_pidp != NULL && DTRACE_INRANGE(addr, sz,
+		    &(p->p_pidp->pid_id), sizeof (pid_t))) {
+			return (1);
+		}
+
+		if (curthread->t_cpu != NULL && DTRACE_INRANGE(addr, sz,
+		    curthread->t_cpu, offsetof(cpu_t, cpu_pause_thread))) {
+			return (1);
+		}
+#endif
+	}
+
+	if ((fp = mstate->dtms_getf) != NULL) {
+		uintptr_t psz = sizeof (void *);
+		vnode_t *vp;
+		vnodeops_t *op;
+
+		/*
+		 * When getf() returns a file_t, the enabling is implicitly
+		 * granted the (transient) right to read the returned file_t
+		 * as well as the v_path and v_op->vnop_name of the underlying
+		 * vnode.  These accesses are allowed after a successful
+		 * getf() because the members that they refer to cannot change
+		 * once set -- and the barrier logic in the kernel's closef()
+		 * path assures that the file_t and its referenced vode_t
+		 * cannot themselves be stale (that is, it impossible for
+		 * either dtms_getf itself or its f_vnode member to reference
+		 * freed memory).
+		 */
+		if (DTRACE_INRANGE(addr, sz, fp, sizeof (file_t)))
+			return (1);
+
+		if ((vp = fp->f_vnode) != NULL) {
+#if defined(sun)
+			if (DTRACE_INRANGE(addr, sz, &vp->v_path, psz))
+				return (1);
+			if (vp->v_path != NULL && DTRACE_INRANGE(addr, sz,
+			    vp->v_path, strlen(vp->v_path) + 1)) {
+				return (1);
+			}
+#endif
+
+			if (DTRACE_INRANGE(addr, sz, &vp->v_op, psz))
+				return (1);
+
+#if defined(sun)
+			if ((op = vp->v_op) != NULL &&
+			    DTRACE_INRANGE(addr, sz, &op->vnop_name, psz)) {
+				return (1);
+			}
+
+			if (op != NULL && op->vnop_name != NULL &&
+			    DTRACE_INRANGE(addr, sz, op->vnop_name,
+			    strlen(op->vnop_name) + 1)) {
+				return (1);
+			}
+#endif
+		}
+	}
+
 	DTRACE_CPUFLAG_SET(CPU_DTRACE_KPRIV);
 	*illval = addr;
 	return (0);
@@ -1189,8 +1287,7 @@ dtrace_priv_proc_common_zone(dtrace_stat
 	 */
 	ASSERT(s_cr != NULL);
 
-	if ((cr = CRED()) != NULL &&
-	    s_cr->cr_zone == cr->cr_zone)
+	if ((cr = CRED()) != NULL && s_cr->cr_zone == cr->cr_zone)
 		return (1);
 
 	return (0);
@@ -1290,6 +1387,115 @@ dtrace_priv_kernel_destructive(dtrace_st
 }
 
 /*
+ * Determine if the dte_cond of the specified ECB allows for processing of
+ * the current probe to continue.  Note that this routine may allow continued
+ * processing, but with access(es) stripped from the mstate's dtms_access
+ * field.
+ */
+static int
+dtrace_priv_probe(dtrace_state_t *state, dtrace_mstate_t *mstate,
+    dtrace_ecb_t *ecb)
+{
+	dtrace_probe_t *probe = ecb->dte_probe;
+	dtrace_provider_t *prov = probe->dtpr_provider;
+	dtrace_pops_t *pops = &prov->dtpv_pops;
+	int mode = DTRACE_MODE_NOPRIV_DROP;
+
+	ASSERT(ecb->dte_cond);
+
+#if defined(sun)
+	if (pops->dtps_mode != NULL) {
+		mode = pops->dtps_mode(prov->dtpv_arg,
+		    probe->dtpr_id, probe->dtpr_arg);
+
+		ASSERT((mode & DTRACE_MODE_USER) ||
+		    (mode & DTRACE_MODE_KERNEL));
+		ASSERT((mode & DTRACE_MODE_NOPRIV_RESTRICT) ||
+		    (mode & DTRACE_MODE_NOPRIV_DROP));
+	}
+
+	/*
+	 * If the dte_cond bits indicate that this consumer is only allowed to
+	 * see user-mode firings of this probe, call the provider's dtps_mode()
+	 * entry point to check that the probe was fired while in a user
+	 * context.  If that's not the case, use the policy specified by the
+	 * provider to determine if we drop the probe or merely restrict
+	 * operation.
+	 */
+	if (ecb->dte_cond & DTRACE_COND_USERMODE) {
+		ASSERT(mode != DTRACE_MODE_NOPRIV_DROP);
+
+		if (!(mode & DTRACE_MODE_USER)) {
+			if (mode & DTRACE_MODE_NOPRIV_DROP)
+				return (0);
+
+			mstate->dtms_access &= ~DTRACE_ACCESS_ARGS;
+		}
+	}
+#endif
+
+	/*
+	 * This is more subtle than it looks. We have to be absolutely certain
+	 * that CRED() isn't going to change out from under us so it's only
+	 * legit to examine that structure if we're in constrained situations.
+	 * Currently, the only times we'll this check is if a non-super-user
+	 * has enabled the profile or syscall providers -- providers that
+	 * allow visibility of all processes. For the profile case, the check
+	 * above will ensure that we're examining a user context.
+	 */
+	if (ecb->dte_cond & DTRACE_COND_OWNER) {
+		cred_t *cr;
+		cred_t *s_cr = state->dts_cred.dcr_cred;
+		proc_t *proc;
+
+		ASSERT(s_cr != NULL);
+
+		if ((cr = CRED()) == NULL ||
+		    s_cr->cr_uid != cr->cr_uid ||
+		    s_cr->cr_uid != cr->cr_ruid ||
+		    s_cr->cr_uid != cr->cr_suid ||
+		    s_cr->cr_gid != cr->cr_gid ||
+		    s_cr->cr_gid != cr->cr_rgid ||
+		    s_cr->cr_gid != cr->cr_sgid ||
+		    (proc = ttoproc(curthread)) == NULL ||
+		    (proc->p_flag & SNOCD)) {
+			if (mode & DTRACE_MODE_NOPRIV_DROP)
+				return (0);
+
+#if defined(sun)
+			mstate->dtms_access &= ~DTRACE_ACCESS_PROC;
+#endif
+		}
+	}
+
+#if defined(sun)
+	/*
+	 * If our dte_cond is set to DTRACE_COND_ZONEOWNER and we are not
+	 * in our zone, check to see if our mode policy is to restrict rather
+	 * than to drop; if to restrict, strip away both DTRACE_ACCESS_PROC
+	 * and DTRACE_ACCESS_ARGS
+	 */
+	if (ecb->dte_cond & DTRACE_COND_ZONEOWNER) {
+		cred_t *cr;
+		cred_t *s_cr = state->dts_cred.dcr_cred;
+
+		ASSERT(s_cr != NULL);
+
+		if ((cr = CRED()) == NULL ||
+		    s_cr->cr_zone->zone_id != cr->cr_zone->zone_id) {
+			if (mode & DTRACE_MODE_NOPRIV_DROP)
+				return (0);
+
+			mstate->dtms_access &=
+			    ~(DTRACE_ACCESS_PROC | DTRACE_ACCESS_ARGS);
+		}
+	}
+#endif
+
+	return (1);
+}
+
+/*
  * Note:  not called from probe context.  This function is called
  * asynchronously (and at a regular interval) from outside of probe context to
  * clean the dirty dynamic variable lists on all CPUs.  Dynamic variable
@@ -2907,7 +3113,7 @@ dtrace_dif_variable(dtrace_mstate_t *mst
 #endif
 
 	case DIF_VAR_CURTHREAD:
-		if (!dtrace_priv_kernel(state))
+		if (!dtrace_priv_proc(state))
 			return (0);
 		return ((uint64_t)(uintptr_t)curthread);
 
@@ -4577,11 +4783,32 @@ dtrace_dif_subr(uint_t subr, uint_t rd, 
 		break;
 	}
 
+	case DIF_SUBR_GETF: {
+		uintptr_t fd = tupregs[0].dttk_value;
+		struct filedesc *fdp;
+		file_t *fp;
+
+		if (!dtrace_priv_proc(state)) {
+			regs[rd] = 0;
+			break;
+		}
+		fdp = curproc->p_fd;
+		FILEDESC_SLOCK(fdp);
+		fp = fget_locked(fdp, fd);
+		mstate->dtms_getf = fp;
+		regs[rd] = (uintptr_t)fp;
+		FILEDESC_SUNLOCK(fdp);
+		break;
+	}
+
 	case DIF_SUBR_CLEANPATH: {
 		char *dest = (char *)mstate->dtms_scratch_ptr, c;
 		uint64_t size = state->dts_options[DTRACEOPT_STRSIZE];
 		uintptr_t src = tupregs[0].dttk_value;
 		int i = 0, j = 0;
+#if defined(sun)
+		zone_t *z;
+#endif
 
 		if (!dtrace_strcanload(src, size, mstate, vstate)) {
 			regs[rd] = 0;
@@ -4680,6 +4907,25 @@ next:
 		} while (c != '\0');
 
 		dest[j] = '\0';
+
+#if defined(sun)
+		if (mstate->dtms_getf != NULL &&
+		    !(mstate->dtms_access & DTRACE_ACCESS_KERNEL) &&
+		    (z = state->dts_cred.dcr_cred->cr_zone) != kcred->cr_zone) {
+			/*
+			 * If we've done a getf() as a part of this ECB and we
+			 * don't have kernel access (and we're not in the global
+			 * zone), check if the path we cleaned up begins with
+			 * the zone's root path, and trim it off if so.  Note
+			 * that this is an output cleanliness issue, not a
+			 * security issue: knowing one's zone root path does
+			 * not enable privilege escalation.
+			 */
+			if (strstr(dest, z->zone_rootpath) == dest)
+				dest += strlen(z->zone_rootpath) - 1;
+		}
+#endif
+
 		regs[rd] = (uintptr_t)dest;
 		mstate->dtms_scratch_ptr += size;
 		break;
@@ -5153,71 +5399,50 @@ dtrace_dif_emulate(dtrace_difo_t *difo, 
 				pc = DIF_INSTR_LABEL(instr);
 			break;
 		case DIF_OP_RLDSB:
-			if (!dtrace_canstore(regs[r1], 1, mstate, vstate)) {
-				*flags |= CPU_DTRACE_KPRIV;
-				*illval = regs[r1];
+			if (!dtrace_canload(regs[r1], 1, mstate, vstate))
 				break;
-			}
 			/*FALLTHROUGH*/
 		case DIF_OP_LDSB:
 			regs[rd] = (int8_t)dtrace_load8(regs[r1]);
 			break;
 		case DIF_OP_RLDSH:
-			if (!dtrace_canstore(regs[r1], 2, mstate, vstate)) {
-				*flags |= CPU_DTRACE_KPRIV;
-				*illval = regs[r1];
+			if (!dtrace_canload(regs[r1], 2, mstate, vstate))
 				break;
-			}
 			/*FALLTHROUGH*/
 		case DIF_OP_LDSH:
 			regs[rd] = (int16_t)dtrace_load16(regs[r1]);
 			break;
 		case DIF_OP_RLDSW:
-			if (!dtrace_canstore(regs[r1], 4, mstate, vstate)) {
-				*flags |= CPU_DTRACE_KPRIV;
-				*illval = regs[r1];
+			if (!dtrace_canload(regs[r1], 4, mstate, vstate))
 				break;
-			}
 			/*FALLTHROUGH*/
 		case DIF_OP_LDSW:
 			regs[rd] = (int32_t)dtrace_load32(regs[r1]);
 			break;
 		case DIF_OP_RLDUB:
-			if (!dtrace_canstore(regs[r1], 1, mstate, vstate)) {
-				*flags |= CPU_DTRACE_KPRIV;
-				*illval = regs[r1];
+			if (!dtrace_canload(regs[r1], 1, mstate, vstate))
 				break;
-			}
 			/*FALLTHROUGH*/
 		case DIF_OP_LDUB:
 			regs[rd] = dtrace_load8(regs[r1]);
 			break;
 		case DIF_OP_RLDUH:
-			if (!dtrace_canstore(regs[r1], 2, mstate, vstate)) {
-				*flags |= CPU_DTRACE_KPRIV;
-				*illval = regs[r1];
+			if (!dtrace_canload(regs[r1], 2, mstate, vstate))
 				break;
-			}
 			/*FALLTHROUGH*/
 		case DIF_OP_LDUH:
 			regs[rd] = dtrace_load16(regs[r1]);
 			break;
 		case DIF_OP_RLDUW:
-			if (!dtrace_canstore(regs[r1], 4, mstate, vstate)) {
-				*flags |= CPU_DTRACE_KPRIV;
-				*illval = regs[r1];
+			if (!dtrace_canload(regs[r1], 4, mstate, vstate))
 				break;
-			}
 			/*FALLTHROUGH*/
 		case DIF_OP_LDUW:
 			regs[rd] = dtrace_load32(regs[r1]);
 			break;
 		case DIF_OP_RLDX:
-			if (!dtrace_canstore(regs[r1], 8, mstate, vstate)) {
-				*flags |= CPU_DTRACE_KPRIV;
-				*illval = regs[r1];
+			if (!dtrace_canload(regs[r1], 8, mstate, vstate))
 				break;
-			}
 			/*FALLTHROUGH*/
 		case DIF_OP_LDX:
 			regs[rd] = dtrace_load64(regs[r1]);
@@ -6180,6 +6405,8 @@ dtrace_probe(dtrace_id_t id, uintptr_t a
 		uint64_t val = 0;
 
 		mstate.dtms_present = DTRACE_MSTATE_ARGS | DTRACE_MSTATE_PROBE;
+		mstate.dtms_getf = NULL;
+
 		*flags &= ~CPU_DTRACE_ERROR;
 
 		if (prov == dtrace_provider) {
@@ -8853,6 +9080,20 @@ dtrace_difo_validate(dtrace_difo_t *dp, 
 			    subr == DIF_SUBR_COPYOUTSTR) {
 				dp->dtdo_destructive = 1;
 			}
+
+			if (subr == DIF_SUBR_GETF) {
+				/*
+				 * If we have a getf() we need to record that
+				 * in our state.  Note that our state can be
+				 * NULL if this is a helper -- but in that
+				 * case, the call to getf() is itself illegal,
+				 * and will be caught (slightly later) when
+				 * the helper is validated.
+				 */
+				if (vstate->dtvs_state != NULL)
+					vstate->dtvs_state->dts_getf++;
+			}
+
 			break;
 		case DIF_OP_PUSHTR:
 			if (type != DIF_TYPE_STRING && type != DIF_TYPE_CTF)
@@ -13758,6 +13999,24 @@ dtrace_state_go(dtrace_state_t *state, p
 
 	state->dts_activity = DTRACE_ACTIVITY_WARMUP;
 
+#if defined(sun)
+	if (state->dts_getf != 0 &&
+	    !(state->dts_cred.dcr_visible & DTRACE_CRV_KERNEL)) {
+		/*
+		 * We don't have kernel privs but we have at least one call
+		 * to getf(); we need to bump our zone's count, and (if
+		 * this is the first enabling to have an unprivileged call
+		 * to getf()) we need to hook into closef().
+		 */
+		state->dts_cred.dcr_cred->cr_zone->zone_dtrace_getf++;
+
+		if (dtrace_getf++ == 0) {
+			ASSERT(dtrace_closef == NULL);
+			dtrace_closef = dtrace_getf_barrier;
+		}
+	}
+#endif
+
 	/*
 	 * Now it's time to actually fire the BEGIN probe.  We need to disable
 	 * interrupts here both to record the CPU on which we fired the BEGIN
@@ -13874,6 +14133,26 @@ dtrace_state_stop(dtrace_state_t *state,
 	state->dts_activity = DTRACE_ACTIVITY_STOPPED;
 	dtrace_sync();
 

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 20:06:37 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A3C1A342;
 Thu, 26 Jun 2014 20:06:37 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 844082321;
 Thu, 26 Jun 2014 20:06:37 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QK6bTJ088849;
 Thu, 26 Jun 2014 20:06:37 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QK6baF088848;
 Thu, 26 Jun 2014 20:06:37 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406262006.s5QK6baF088848@svn.freebsd.org>
From: Alexander Motin 
Date: Thu, 26 Jun 2014 20:06:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267933 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 20:06:37 -0000

Author: mav
Date: Thu Jun 26 20:06:37 2014
New Revision: 267933
URL: http://svnweb.freebsd.org/changeset/base/267933

Log:
  Simplify statistics calculation.
  
  Instead of trying to guess size of disk I/O operations (it just won't work
  that way for newly added commands, and is equal to data move size for old
  ones), account data move traffic.  If disk I/Os are that interesting, then
  backends have to account and provide that information.
  
  Block backend already exports the information about disk I/Os via devstat,
  so having it here too is excessive.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/ctl/ctl.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Thu Jun 26 20:02:29 2014	(r267932)
+++ head/sys/cam/ctl/ctl.c	Thu Jun 26 20:06:37 2014	(r267933)
@@ -12900,132 +12900,34 @@ ctl_process_done(union ctl_io *io)
 	 *
 	 * XXX KDM should we also track I/O latency?
 	 */
-	if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) {
-		uint32_t blocksize;
+	if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS &&
+	    io->io_hdr.io_type == CTL_IO_SCSI) {
 #ifdef CTL_TIME_IO
 		struct bintime cur_bt;
 #endif
+		int type;
 
-		if ((lun->be_lun != NULL)
-		 && (lun->be_lun->blocksize != 0))
-			blocksize = lun->be_lun->blocksize;
+		if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) ==
+		    CTL_FLAG_DATA_IN)
+			type = CTL_STATS_READ;
+		else if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) ==
+		    CTL_FLAG_DATA_OUT)
+			type = CTL_STATS_WRITE;
 		else
-			blocksize = 512;
-
-		switch (io->io_hdr.io_type) {
-		case CTL_IO_SCSI: {
-			int isread;
-			struct ctl_lba_len_flags *lbalen;
-
-			isread = 0;
-			switch (io->scsiio.cdb[0]) {
-			case READ_6:
-			case READ_10:
-			case READ_12:
-			case READ_16:
-				isread = 1;
-				/* FALLTHROUGH */
-			case WRITE_6:
-			case WRITE_10:
-			case WRITE_12:
-			case WRITE_16:
-			case WRITE_VERIFY_10:
-			case WRITE_VERIFY_12:
-			case WRITE_VERIFY_16:
-				lbalen = (struct ctl_lba_len_flags *)
-				    &io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
-
-				if (isread) {
-					lun->stats.ports[targ_port].bytes[CTL_STATS_READ] +=
-					    lbalen->len * blocksize;
-					lun->stats.ports[targ_port].operations[CTL_STATS_READ]++;
-
-#ifdef CTL_TIME_IO
-					bintime_add(
-					   &lun->stats.ports[targ_port].dma_time[CTL_STATS_READ],
-					   &io->io_hdr.dma_bt);
-					lun->stats.ports[targ_port].num_dmas[CTL_STATS_READ] +=
-						io->io_hdr.num_dmas;
-					getbintime(&cur_bt);
-					bintime_sub(&cur_bt,
-						    &io->io_hdr.start_bt);
-
-					bintime_add(
-					    &lun->stats.ports[targ_port].time[CTL_STATS_READ],
-					    &cur_bt);
-
-#if 0
-					cs_prof_gettime(&cur_ticks);
-					lun->stats.time[CTL_STATS_READ] +=
-						cur_ticks -
-						io->io_hdr.start_ticks;
-#endif
-#if 0
-					lun->stats.time[CTL_STATS_READ] +=
-						jiffies - io->io_hdr.start_time;
-#endif
-#endif /* CTL_TIME_IO */
-				} else {
-					lun->stats.ports[targ_port].bytes[CTL_STATS_WRITE] +=
-					    lbalen->len * blocksize;
-					lun->stats.ports[targ_port].operations[
-						CTL_STATS_WRITE]++;
-
-#ifdef CTL_TIME_IO
-					bintime_add(
-					  &lun->stats.ports[targ_port].dma_time[CTL_STATS_WRITE],
-					  &io->io_hdr.dma_bt);
-					lun->stats.ports[targ_port].num_dmas[CTL_STATS_WRITE] +=
-						io->io_hdr.num_dmas;
-					getbintime(&cur_bt);
-					bintime_sub(&cur_bt,
-						    &io->io_hdr.start_bt);
-
-					bintime_add(
-					    &lun->stats.ports[targ_port].time[CTL_STATS_WRITE],
-					    &cur_bt);
-#if 0
-					cs_prof_gettime(&cur_ticks);
-					lun->stats.ports[targ_port].time[CTL_STATS_WRITE] +=
-						cur_ticks -
-						io->io_hdr.start_ticks;
-					lun->stats.ports[targ_port].time[CTL_STATS_WRITE] +=
-						jiffies - io->io_hdr.start_time;
-#endif
-#endif /* CTL_TIME_IO */
-				}
-				break;
-			default:
-				lun->stats.ports[targ_port].operations[CTL_STATS_NO_IO]++;
+			type = CTL_STATS_NO_IO;
 
+		lun->stats.ports[targ_port].bytes[type] +=
+		    io->scsiio.kern_total_len;
+		lun->stats.ports[targ_port].operations[type]++;
 #ifdef CTL_TIME_IO
-				bintime_add(
-				  &lun->stats.ports[targ_port].dma_time[CTL_STATS_NO_IO],
-				  &io->io_hdr.dma_bt);
-				lun->stats.ports[targ_port].num_dmas[CTL_STATS_NO_IO] +=
-					io->io_hdr.num_dmas;
-				getbintime(&cur_bt);
-				bintime_sub(&cur_bt, &io->io_hdr.start_bt);
-
-				bintime_add(&lun->stats.ports[targ_port].time[CTL_STATS_NO_IO],
-					    &cur_bt);
-
-#if 0
-				cs_prof_gettime(&cur_ticks);
-				lun->stats.ports[targ_port].time[CTL_STATS_NO_IO] +=
-					cur_ticks -
-					io->io_hdr.start_ticks;
-				lun->stats.ports[targ_port].time[CTL_STATS_NO_IO] +=
-					jiffies - io->io_hdr.start_time;
+		bintime_add(&lun->stats.ports[targ_port].dma_time[type],
+		   &io->io_hdr.dma_bt);
+		lun->stats.ports[targ_port].num_dmas[type] +=
+		    io->io_hdr.num_dmas;
+		getbintime(&cur_bt);
+		bintime_sub(&cur_bt, &io->io_hdr.start_bt);
+		bintime_add(&lun->stats.ports[targ_port].time[type], &cur_bt);
 #endif
-#endif /* CTL_TIME_IO */
-				break;
-			}
-			break;
-		}
-		default:
-			break;
-		}
 	}
 
 	/*

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 20:12:39 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B2EB488C;
 Thu, 26 Jun 2014 20:12:39 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9572D2401;
 Thu, 26 Jun 2014 20:12:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QKCdBL093127;
 Thu, 26 Jun 2014 20:12:39 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QKCdAn093124;
 Thu, 26 Jun 2014 20:12:39 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201406262012.s5QKCdAn093124@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 26 Jun 2014 20:12:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267934 - head/usr.sbin/bhyve
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 20:12:39 -0000

Author: jhb
Date: Thu Jun 26 20:12:38 2014
New Revision: 267934
URL: http://svnweb.freebsd.org/changeset/base/267934

Log:
  - Document -b to enable the bvmcons console (but mark it as deprecated
    similar to -g.)
  - Document -U to set the SMBIOS UUID.
  - Add missing options to the usage output and to the manpage Synopsis.
  - Don't claim that bvmdebug is amd64-only (it is also a device, not an
    option).

Modified:
  head/usr.sbin/bhyve/bhyve.8
  head/usr.sbin/bhyve/bhyverun.c

Modified: head/usr.sbin/bhyve/bhyve.8
==============================================================================
--- head/usr.sbin/bhyve/bhyve.8	Thu Jun 26 20:06:37 2014	(r267933)
+++ head/usr.sbin/bhyve/bhyve.8	Thu Jun 26 20:12:38 2014	(r267934)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 2, 2014
+.Dd June 26, 2014
 .Dt BHYVE 8
 .Os
 .Sh NAME
@@ -32,12 +32,14 @@
 .Nd "run a guest operating system inside a virtual machine"
 .Sh SYNOPSIS
 .Nm
-.Op Fl aehwxACHPW
+.Op Fl abehwxACHPWY
 .Op Fl c Ar numcpus
 .Op Fl g Ar gdbport
+.Op Fl m Ar size Ns Op Ar K|k|M|m|G|g|T|t
 .Op Fl p Ar vcpu:hostcpu
 .Op Fl s Ar slot,emulation Ns Op , Ns Ar conf
 .Op Fl l Ar lpcdev Ns Op , Ns Ar conf
+.Op Fl U Ar uuid
 .Ar vmname
 .Sh DESCRIPTION
 .Nm
@@ -66,6 +68,11 @@ Generate ACPI tables.
 Required for
 .Fx Ns /amd64
 guests.
+.It Fl b
+Enable a low-level console device supported by
+.Fx kernels compiled with
+.Cd "device bvmconsole" .
+This option will be deprecated in a future version.
 .It Fl c Ar numcpus
 Number of guest virtual CPUs.
 The default is 1 and the maximum is 16.
@@ -76,8 +83,9 @@ Yield the virtual CPU thread when a HLT 
 If this option is not specified, virtual CPUs will use 100% of a host CPU.
 .It Fl g Ar gdbport
 For
-.Fx Ns /amd64 kernels compiled with
-.Cd "option bvmdebug" ,
+.Fx
+kernels compiled with
+.Cd "device bvmdebug" ,
 allow a remote kernel kgdb to be relayed to the guest kernel gdb stub
 via a local IPv4 address and this port.
 This option will be deprecated in a future version.
@@ -231,6 +239,12 @@ Force
 .Nm
 to exit when a guest issues an access to an I/O port that is not emulated.
 This is intended for debug purposes.
+.It Fl U Ar uuid
+Set the universally unique identifier
+.Pq UUID
+in the guest's System Management BIOS System Information structure.
+By default a UUID is generated from the host's hostname and
+.Ar vmname .
 .It Fl w
 Ignore accesses to unimplemented Model Specific Registers (MSRs). This is intended for debug purposes.
 .It Fl x

Modified: head/usr.sbin/bhyve/bhyverun.c
==============================================================================
--- head/usr.sbin/bhyve/bhyverun.c	Thu Jun 26 20:06:37 2014	(r267933)
+++ head/usr.sbin/bhyve/bhyverun.c	Thu Jun 26 20:12:38 2014	(r267934)
@@ -129,10 +129,10 @@ usage(int code)
 {
 
         fprintf(stderr,
-                "Usage: %s [-aehwAHIPW] [-g ] [-s ] [-c vcpus]\n"
-		"       %*s [-p vcpu:hostcpu] [-m mem] [-l ] \n"
+                "Usage: %s [-abehwxACHPWY] [-g ] [-s ] [-c vcpus]\n"
+		"       %*s [-p vcpu:hostcpu] [-m mem] [-l ] [-U uuid] \n"
 		"       -a: local apic is in xAPIC mode (deprecated)\n"
-		"       -A: create an ACPI table\n"
+		"       -A: create ACPI tables\n"
 		"       -g: gdb port\n"
 		"       -c: # cpus (default 1)\n"
 		"       -C: include guest memory in core file\n"

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 21:33:35 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 894E3C96;
 Thu, 26 Jun 2014 21:33:35 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7491A2AE0;
 Thu, 26 Jun 2014 21:33:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QLXZfj029823;
 Thu, 26 Jun 2014 21:33:35 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QLXXP8029811;
 Thu, 26 Jun 2014 21:33:33 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <201406262133.s5QLXXP8029811@svn.freebsd.org>
From: Jack F Vogel 
Date: Thu, 26 Jun 2014 21:33:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267935 - head/sys/dev/e1000
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 21:33:35 -0000

Author: jfv
Date: Thu Jun 26 21:33:32 2014
New Revision: 267935
URL: http://svnweb.freebsd.org/changeset/base/267935

Log:
  Sync the E1000 shared code with Intel internal, this adds fixes,
  and more importantly, new I218 adapter support to the em driver.
  
  MFC after: 1 week

Modified:
  head/sys/dev/e1000/e1000_82542.c
  head/sys/dev/e1000/e1000_82571.c
  head/sys/dev/e1000/e1000_82575.c
  head/sys/dev/e1000/e1000_82575.h
  head/sys/dev/e1000/e1000_api.c
  head/sys/dev/e1000/e1000_api.h
  head/sys/dev/e1000/e1000_defines.h
  head/sys/dev/e1000/e1000_hw.h
  head/sys/dev/e1000/e1000_i210.c
  head/sys/dev/e1000/e1000_i210.h
  head/sys/dev/e1000/e1000_ich8lan.c
  head/sys/dev/e1000/e1000_ich8lan.h
  head/sys/dev/e1000/e1000_mac.c
  head/sys/dev/e1000/e1000_mac.h
  head/sys/dev/e1000/e1000_manage.c
  head/sys/dev/e1000/e1000_mbx.c
  head/sys/dev/e1000/e1000_mbx.h
  head/sys/dev/e1000/e1000_nvm.c
  head/sys/dev/e1000/e1000_osdep.h
  head/sys/dev/e1000/e1000_phy.c
  head/sys/dev/e1000/e1000_phy.h
  head/sys/dev/e1000/e1000_regs.h
  head/sys/dev/e1000/e1000_vf.c
  head/sys/dev/e1000/e1000_vf.h
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/e1000_82542.c
==============================================================================
--- head/sys/dev/e1000/e1000_82542.c	Thu Jun 26 20:12:38 2014	(r267934)
+++ head/sys/dev/e1000/e1000_82542.c	Thu Jun 26 21:33:32 2014	(r267935)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2010, Intel Corporation 
+  Copyright (c) 2001-2014, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -47,7 +47,7 @@ static s32  e1000_init_hw_82542(struct e
 static s32  e1000_setup_link_82542(struct e1000_hw *hw);
 static s32  e1000_led_on_82542(struct e1000_hw *hw);
 static s32  e1000_led_off_82542(struct e1000_hw *hw);
-static void e1000_rar_set_82542(struct e1000_hw *hw, u8 *addr, u32 index);
+static int  e1000_rar_set_82542(struct e1000_hw *hw, u8 *addr, u32 index);
 static void e1000_clear_hw_cntrs_82542(struct e1000_hw *hw);
 static s32  e1000_read_mac_addr_82542(struct e1000_hw *hw);
 
@@ -409,7 +409,7 @@ static s32 e1000_led_off_82542(struct e1
  *  Sets the receive address array register at index to the address passed
  *  in by addr.
  **/
-static void e1000_rar_set_82542(struct e1000_hw *hw, u8 *addr, u32 index)
+static int e1000_rar_set_82542(struct e1000_hw *hw, u8 *addr, u32 index)
 {
 	u32 rar_low, rar_high;
 
@@ -431,6 +431,7 @@ static void e1000_rar_set_82542(struct e
 
 	E1000_WRITE_REG_ARRAY(hw, E1000_RA, (index << 1), rar_low);
 	E1000_WRITE_REG_ARRAY(hw, E1000_RA, ((index << 1) + 1), rar_high);
+	return E1000_SUCCESS;
 }
 
 /**

Modified: head/sys/dev/e1000/e1000_82571.c
==============================================================================
--- head/sys/dev/e1000/e1000_82571.c	Thu Jun 26 20:12:38 2014	(r267934)
+++ head/sys/dev/e1000/e1000_82571.c	Thu Jun 26 21:33:32 2014	(r267935)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2013, Intel Corporation 
+  Copyright (c) 2001-2014, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -1453,10 +1453,14 @@ static void e1000_clear_vfta_82571(struc
 static bool e1000_check_mng_mode_82574(struct e1000_hw *hw)
 {
 	u16 data;
+	s32 ret_val;
 
 	DEBUGFUNC("e1000_check_mng_mode_82574");
 
-	hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG, 1, &data);
+	ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG, 1, &data);
+	if (ret_val)
+		return FALSE;
+
 	return (data & E1000_NVM_INIT_CTRL2_MNGM) != 0;
 }
 

Modified: head/sys/dev/e1000/e1000_82575.c
==============================================================================
--- head/sys/dev/e1000/e1000_82575.c	Thu Jun 26 20:12:38 2014	(r267934)
+++ head/sys/dev/e1000/e1000_82575.c	Thu Jun 26 21:33:32 2014	(r267935)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2013, Intel Corporation 
+  Copyright (c) 2001-2014, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -56,7 +56,6 @@ static s32  e1000_check_for_link_media_s
 static s32  e1000_get_cfg_done_82575(struct e1000_hw *hw);
 static s32  e1000_get_link_up_info_82575(struct e1000_hw *hw, u16 *speed,
 					 u16 *duplex);
-static s32  e1000_init_hw_82575(struct e1000_hw *hw);
 static s32  e1000_phy_hw_reset_sgmii_82575(struct e1000_hw *hw);
 static s32  e1000_read_phy_reg_sgmii_82575(struct e1000_hw *hw, u32 offset,
 					   u16 *data);
@@ -120,7 +119,8 @@ static bool e1000_get_i2c_data(u32 *i2cc
 static const u16 e1000_82580_rxpbs_table[] = {
 	36, 72, 144, 1, 2, 4, 8, 16, 35, 70, 140 };
 #define E1000_82580_RXPBS_TABLE_SIZE \
-	(sizeof(e1000_82580_rxpbs_table)/sizeof(u16))
+	(sizeof(e1000_82580_rxpbs_table) / \
+	 sizeof(e1000_82580_rxpbs_table[0]))
 
 
 /**
@@ -273,6 +273,11 @@ static s32 e1000_init_phy_params_82575(s
 				hw->mac.ops.check_for_link =
 						e1000_check_for_link_media_swap;
 		}
+		if (phy->id == M88E1512_E_PHY_ID) {
+			ret_val = e1000_initialize_M88E1512_phy(hw);
+			if (ret_val)
+				goto out;
+		}
 		break;
 	case IGP03E1000_E_PHY_ID:
 	case IGP04E1000_E_PHY_ID:
@@ -450,6 +455,9 @@ static s32 e1000_init_mac_params_82575(s
 	else
 	mac->ops.reset_hw = e1000_reset_hw_82575;
 	/* hw initialization */
+	if ((mac->type == e1000_i210) || (mac->type == e1000_i211))
+		mac->ops.init_hw = e1000_init_hw_i210;
+	else
 	mac->ops.init_hw = e1000_init_hw_82575;
 	/* link setup */
 	mac->ops.setup_link = e1000_setup_link_generic;
@@ -750,6 +758,7 @@ out:
 static s32 e1000_phy_hw_reset_sgmii_82575(struct e1000_hw *hw)
 {
 	s32 ret_val = E1000_SUCCESS;
+	struct e1000_phy_info *phy = &hw->phy;
 
 	DEBUGFUNC("e1000_phy_hw_reset_sgmii_82575");
 
@@ -772,7 +781,11 @@ static s32 e1000_phy_hw_reset_sgmii_8257
 		goto out;
 
 	ret_val = hw->phy.ops.commit(hw);
+	if (ret_val)
+		goto out;
 
+	if (phy->id == M88E1512_E_PHY_ID)
+		ret_val = e1000_initialize_M88E1512_phy(hw);
 out:
 	return ret_val;
 }
@@ -879,7 +892,6 @@ out:
 static s32 e1000_set_d0_lplu_state_82580(struct e1000_hw *hw, bool active)
 {
 	struct e1000_phy_info *phy = &hw->phy;
-	s32 ret_val = E1000_SUCCESS;
 	u32 data;
 
 	DEBUGFUNC("e1000_set_d0_lplu_state_82580");
@@ -907,7 +919,7 @@ static s32 e1000_set_d0_lplu_state_82580
 	}
 
 	E1000_WRITE_REG(hw, E1000_82580_PHY_POWER_MGMT, data);
-	return ret_val;
+	return E1000_SUCCESS;
 }
 
 /**
@@ -927,7 +939,6 @@ static s32 e1000_set_d0_lplu_state_82580
 s32 e1000_set_d3_lplu_state_82580(struct e1000_hw *hw, bool active)
 {
 	struct e1000_phy_info *phy = &hw->phy;
-	s32 ret_val = E1000_SUCCESS;
 	u32 data;
 
 	DEBUGFUNC("e1000_set_d3_lplu_state_82580");
@@ -955,7 +966,7 @@ s32 e1000_set_d3_lplu_state_82580(struct
 	}
 
 	E1000_WRITE_REG(hw, E1000_82580_PHY_POWER_MGMT, data);
-	return ret_val;
+	return E1000_SUCCESS;
 }
 
 /**
@@ -969,7 +980,7 @@ s32 e1000_set_d3_lplu_state_82580(struct
  **/
 static s32 e1000_acquire_nvm_82575(struct e1000_hw *hw)
 {
-	s32 ret_val;
+	s32 ret_val = E1000_SUCCESS;
 
 	DEBUGFUNC("e1000_acquire_nvm_82575");
 
@@ -991,6 +1002,7 @@ static s32 e1000_acquire_nvm_82575(struc
 			DEBUGOUT("Nvm bit banging access error detected and cleared.\n");
 		}
 	}
+
 	if (hw->mac.type == e1000_82580) {
 		u32 eecd = E1000_READ_REG(hw, E1000_EECD);
 		if (eecd & E1000_EECD_BLOCKED) {
@@ -1001,7 +1013,6 @@ static s32 e1000_acquire_nvm_82575(struc
 		}
 	}
 
-
 	ret_val = e1000_acquire_nvm_generic(hw);
 	if (ret_val)
 		e1000_release_swfw_sync_82575(hw, E1000_SWFW_EEP_SM);
@@ -1115,7 +1126,6 @@ static void e1000_release_swfw_sync_8257
 static s32 e1000_get_cfg_done_82575(struct e1000_hw *hw)
 {
 	s32 timeout = PHY_CFG_TIMEOUT;
-	s32 ret_val = E1000_SUCCESS;
 	u32 mask = E1000_NVM_CFG_DONE_PORT_0;
 
 	DEBUGFUNC("e1000_get_cfg_done_82575");
@@ -1140,7 +1150,7 @@ static s32 e1000_get_cfg_done_82575(stru
 	    (hw->phy.type == e1000_phy_igp_3))
 		e1000_phy_init_script_igp3(hw);
 
-	return ret_val;
+	return E1000_SUCCESS;
 }
 
 /**
@@ -1466,7 +1476,7 @@ static s32 e1000_reset_hw_82575(struct e
  *
  *  This inits the hardware readying it for operation.
  **/
-static s32 e1000_init_hw_82575(struct e1000_hw *hw)
+s32 e1000_init_hw_82575(struct e1000_hw *hw)
 {
 	struct e1000_mac_info *mac = &hw->mac;
 	s32 ret_val;
@@ -1985,7 +1995,7 @@ static s32 e1000_reset_init_script_82575
  **/
 static s32 e1000_read_mac_addr_82575(struct e1000_hw *hw)
 {
-	s32 ret_val = E1000_SUCCESS;
+	s32 ret_val;
 
 	DEBUGFUNC("e1000_read_mac_addr_82575");
 
@@ -2478,11 +2488,17 @@ static s32 e1000_reset_hw_82580(struct e
 		ctrl |= E1000_CTRL_RST;
 
 	E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
-	E1000_WRITE_FLUSH(hw);
 
-	/* Add delay to insure DEV_RST has time to complete */
-	if (global_device_reset)
-		msec_delay(5);
+	switch (hw->device_id) {
+	case E1000_DEV_ID_DH89XXCC_SGMII:
+		break;
+	default:
+		E1000_WRITE_FLUSH(hw);
+		break;
+	}
+
+	/* Add delay to insure DEV_RST or RST has time to complete */
+	msec_delay(5);
 
 	ret_val = e1000_get_auto_rd_done_generic(hw);
 	if (ret_val) {
@@ -2617,7 +2633,7 @@ out:
  **/
 static s32 e1000_validate_nvm_checksum_82580(struct e1000_hw *hw)
 {
-	s32 ret_val = E1000_SUCCESS;
+	s32 ret_val;
 	u16 eeprom_regions_count = 1;
 	u16 j, nvm_data;
 	u16 nvm_offset;
@@ -2757,7 +2773,7 @@ out:
 static s32 __e1000_access_emi_reg(struct e1000_hw *hw, u16 address,
 				  u16 *data, bool read)
 {
-	s32 ret_val = E1000_SUCCESS;
+	s32 ret_val;
 
 	DEBUGFUNC("__e1000_access_emi_reg");
 
@@ -2787,6 +2803,95 @@ s32 e1000_read_emi_reg(struct e1000_hw *
 }
 
 /**
+ *  e1000_initialize_M88E1512_phy - Initialize M88E1512 PHY
+ *  @hw: pointer to the HW structure
+ *
+ *  Initialize Marverl 1512 to work correctly with Avoton.
+ **/
+s32 e1000_initialize_M88E1512_phy(struct e1000_hw *hw)
+{
+	struct e1000_phy_info *phy = &hw->phy;
+	s32 ret_val = E1000_SUCCESS;
+
+	DEBUGFUNC("e1000_initialize_M88E1512_phy");
+
+	/* Check if this is correct PHY. */
+	if (phy->id != M88E1512_E_PHY_ID)
+		goto out;
+
+	/* Switch to PHY page 0xFF. */
+	ret_val = phy->ops.write_reg(hw, E1000_M88E1543_PAGE_ADDR, 0x00FF);
+	if (ret_val)
+		goto out;
+
+	ret_val = phy->ops.write_reg(hw, E1000_M88E1512_CFG_REG_2, 0x214B);
+	if (ret_val)
+		goto out;
+
+	ret_val = phy->ops.write_reg(hw, E1000_M88E1512_CFG_REG_1, 0x2144);
+	if (ret_val)
+		goto out;
+
+	ret_val = phy->ops.write_reg(hw, E1000_M88E1512_CFG_REG_2, 0x0C28);
+	if (ret_val)
+		goto out;
+
+	ret_val = phy->ops.write_reg(hw, E1000_M88E1512_CFG_REG_1, 0x2146);
+	if (ret_val)
+		goto out;
+
+	ret_val = phy->ops.write_reg(hw, E1000_M88E1512_CFG_REG_2, 0xB233);
+	if (ret_val)
+		goto out;
+
+	ret_val = phy->ops.write_reg(hw, E1000_M88E1512_CFG_REG_1, 0x214D);
+	if (ret_val)
+		goto out;
+
+	ret_val = phy->ops.write_reg(hw, E1000_M88E1512_CFG_REG_2, 0xCC0C);
+	if (ret_val)
+		goto out;
+
+	ret_val = phy->ops.write_reg(hw, E1000_M88E1512_CFG_REG_1, 0x2159);
+	if (ret_val)
+		goto out;
+
+	/* Switch to PHY page 0xFB. */
+	ret_val = phy->ops.write_reg(hw, E1000_M88E1543_PAGE_ADDR, 0x00FB);
+	if (ret_val)
+		goto out;
+
+	ret_val = phy->ops.write_reg(hw, E1000_M88E1512_CFG_REG_3, 0x000D);
+	if (ret_val)
+		goto out;
+
+	/* Switch to PHY page 0x12. */
+	ret_val = phy->ops.write_reg(hw, E1000_M88E1543_PAGE_ADDR, 0x12);
+	if (ret_val)
+		goto out;
+
+	/* Change mode to SGMII-to-Copper */
+	ret_val = phy->ops.write_reg(hw, E1000_M88E1512_MODE, 0x8001);
+	if (ret_val)
+		goto out;
+
+	/* Return the PHY to page 0. */
+	ret_val = phy->ops.write_reg(hw, E1000_M88E1543_PAGE_ADDR, 0);
+	if (ret_val)
+		goto out;
+
+	ret_val = phy->ops.commit(hw);
+	if (ret_val) {
+		DEBUGOUT("Error committing the PHY changes\n");
+		return ret_val;
+	}
+
+	msec_delay(1000);
+out:
+	return ret_val;
+}
+
+/**
  *  e1000_set_eee_i350 - Enable/disable EEE support
  *  @hw: pointer to the HW structure
  *
@@ -2795,7 +2900,6 @@ s32 e1000_read_emi_reg(struct e1000_hw *
  **/
 s32 e1000_set_eee_i350(struct e1000_hw *hw)
 {
-	s32 ret_val = E1000_SUCCESS;
 	u32 ipcnfg, eeer;
 
 	DEBUGFUNC("e1000_set_eee_i350");
@@ -2828,7 +2932,7 @@ s32 e1000_set_eee_i350(struct e1000_hw *
 	E1000_READ_REG(hw, E1000_EEER);
 out:
 
-	return ret_val;
+	return E1000_SUCCESS;
 }
 
 /**

Modified: head/sys/dev/e1000/e1000_82575.h
==============================================================================
--- head/sys/dev/e1000/e1000_82575.h	Thu Jun 26 20:12:38 2014	(r267934)
+++ head/sys/dev/e1000/e1000_82575.h	Thu Jun 26 21:33:32 2014	(r267935)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2013, Intel Corporation 
+  Copyright (c) 2001-2014, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -384,7 +384,7 @@ struct e1000_adv_tx_context_desc {
 #define E1000_ETQF_FILTER_ENABLE	(1 << 26)
 #define E1000_ETQF_IMM_INT		(1 << 29)
 #define E1000_ETQF_1588			(1 << 30)
-#define E1000_ETQF_QUEUE_ENABLE		(1U << 31)
+#define E1000_ETQF_QUEUE_ENABLE		(1 << 31)
 /*
  * ETQF filter list: one static filter per filter consumer. This is
  *                   to avoid filter collisions later. Add new filters
@@ -411,7 +411,7 @@ struct e1000_adv_tx_context_desc {
 #define E1000_DTXSWC_LLE_MASK		0x00FF0000 /* Per VF Local LB enables */
 #define E1000_DTXSWC_VLAN_SPOOF_SHIFT	8
 #define E1000_DTXSWC_LLE_SHIFT		16
-#define E1000_DTXSWC_VMDQ_LOOPBACK_EN	(1U << 31)  /* global VF LB enable */
+#define E1000_DTXSWC_VMDQ_LOOPBACK_EN	(1 << 31)  /* global VF LB enable */
 
 /* Easy defines for setting default pool, would normally be left a zero */
 #define E1000_VT_CTL_DEFAULT_POOL_SHIFT	7
@@ -480,6 +480,7 @@ void e1000_vmdq_set_loopback_pf(struct e
 void e1000_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf);
 void e1000_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable);
 s32 e1000_init_nvm_params_82575(struct e1000_hw *hw);
+s32  e1000_init_hw_82575(struct e1000_hw *hw);
 
 enum e1000_promisc_type {
 	e1000_promisc_disabled = 0,   /* all promisc modes disabled */
@@ -497,6 +498,7 @@ s32 e1000_read_emi_reg(struct e1000_hw *
 s32 e1000_set_eee_i350(struct e1000_hw *);
 s32 e1000_set_eee_i354(struct e1000_hw *);
 s32 e1000_get_eee_status_i354(struct e1000_hw *, bool *);
+s32 e1000_initialize_M88E1512_phy(struct e1000_hw *hw);
 
 /* I2C SDA and SCL timing parameters for standard mode */
 #define E1000_I2C_T_HD_STA	4

Modified: head/sys/dev/e1000/e1000_api.c
==============================================================================
--- head/sys/dev/e1000/e1000_api.c	Thu Jun 26 20:12:38 2014	(r267934)
+++ head/sys/dev/e1000/e1000_api.c	Thu Jun 26 21:33:32 2014	(r267935)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2013, Intel Corporation 
+  Copyright (c) 2001-2014, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -293,6 +293,10 @@ s32 e1000_set_mac_type(struct e1000_hw *
 	case E1000_DEV_ID_PCH_LPT_I217_V:
 	case E1000_DEV_ID_PCH_LPTLP_I218_LM:
 	case E1000_DEV_ID_PCH_LPTLP_I218_V:
+	case E1000_DEV_ID_PCH_I218_LM2:
+	case E1000_DEV_ID_PCH_I218_V2:
+	case E1000_DEV_ID_PCH_I218_LM3:
+	case E1000_DEV_ID_PCH_I218_V3:
 		mac->type = e1000_pch_lpt;
 		break;
 	case E1000_DEV_ID_82575EB_COPPER:
@@ -828,10 +832,12 @@ void e1000_config_collision_dist(struct 
  *
  *  Sets a Receive Address Register (RAR) to the specified address.
  **/
-void e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index)
+int e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index)
 {
 	if (hw->mac.ops.rar_set)
-		hw->mac.ops.rar_set(hw, addr, index);
+		return hw->mac.ops.rar_set(hw, addr, index);
+
+	return E1000_SUCCESS;
 }
 
 /**

Modified: head/sys/dev/e1000/e1000_api.h
==============================================================================
--- head/sys/dev/e1000/e1000_api.h	Thu Jun 26 20:12:38 2014	(r267934)
+++ head/sys/dev/e1000/e1000_api.h	Thu Jun 26 21:33:32 2014	(r267935)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2013, Intel Corporation 
+  Copyright (c) 2001-2014, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -69,7 +69,7 @@ s32 e1000_setup_link(struct e1000_hw *hw
 s32 e1000_get_speed_and_duplex(struct e1000_hw *hw, u16 *speed, u16 *duplex);
 s32 e1000_disable_pcie_master(struct e1000_hw *hw);
 void e1000_config_collision_dist(struct e1000_hw *hw);
-void e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index);
+int e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index);
 u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr);
 void e1000_update_mc_addr_list(struct e1000_hw *hw, u8 *mc_addr_list,
 			       u32 mc_addr_count);

Modified: head/sys/dev/e1000/e1000_defines.h
==============================================================================
--- head/sys/dev/e1000/e1000_defines.h	Thu Jun 26 20:12:38 2014	(r267934)
+++ head/sys/dev/e1000/e1000_defines.h	Thu Jun 26 21:33:32 2014	(r267935)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2013, Intel Corporation 
+  Copyright (c) 2001-2014, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -77,6 +77,7 @@
 #define E1000_CTRL_EXT_EE_RST	0x00002000 /* Reinitialize from EEPROM */
 /* Physical Func Reset Done Indication */
 #define E1000_CTRL_EXT_PFRSTD	0x00004000
+#define E1000_CTRL_EXT_SDLPE	0X00040000  /* SerDes Low Power Enable */
 #define E1000_CTRL_EXT_SPD_BYPS	0x00008000 /* Speed Select Bypass */
 #define E1000_CTRL_EXT_RO_DIS	0x00020000 /* Relaxed Ordering disable */
 #define E1000_CTRL_EXT_DMA_DYN_CLK_EN	0x00080000 /* DMA Dynamic Clk Gating */
@@ -131,7 +132,7 @@
 #define E1000_RXD_ERR_RXE	0x80    /* Rx Data Error */
 #define E1000_RXD_SPC_VLAN_MASK	0x0FFF  /* VLAN ID is in lower 12 bits */
 
-#define E1000_RXDEXT_STATERR_TST	0x00010000 /* Time Stamp taken */
+#define E1000_RXDEXT_STATERR_TST	0x00000100 /* Time Stamp taken */
 #define E1000_RXDEXT_STATERR_LB		0x00040000
 #define E1000_RXDEXT_STATERR_CE		0x01000000
 #define E1000_RXDEXT_STATERR_SE		0x02000000
@@ -464,6 +465,7 @@
 
 #define ETHERNET_FCS_SIZE		4
 #define MAX_JUMBO_FRAME_SIZE		0x3F00
+#define E1000_TX_PTR_GAP		0x1F
 
 /* Extended Configuration Control and Size */
 #define E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP	0x00000020
@@ -853,6 +855,10 @@
 #define E1000_PCS_STATUS_ADDR_I354	1
 #define E1000_PCS_STATUS_RX_LPI_RCVD	0x0400
 #define E1000_PCS_STATUS_TX_LPI_RCVD	0x0800
+#define E1000_M88E1512_CFG_REG_1	0x0010
+#define E1000_M88E1512_CFG_REG_2	0x0011
+#define E1000_M88E1512_CFG_REG_3	0x0007
+#define E1000_M88E1512_MODE		0x0014
 #define E1000_EEE_SU_LPI_CLK_STP	0x00800000 /* EEE LPI Clock Stop */
 #define E1000_EEE_LP_ADV_DEV_I210	7          /* EEE LP Adv Device */
 #define E1000_EEE_LP_ADV_ADDR_I210	61         /* EEE LP Adv Register */
@@ -1429,6 +1435,9 @@
 #define E1000_RXPBS_CFG_TS_EN		0x80000000 /* Timestamp in Rx buffer */
 #define E1000_RXPBS_SIZE_I210_MASK	0x0000003F /* Rx packet buffer size */
 #define E1000_TXPB0S_SIZE_I210_MASK	0x0000003F /* Tx packet buffer 0 size */
+#define I210_RXPBSIZE_DEFAULT		0x000000A2 /* RXPBSIZE default */
+#define I210_TXPBSIZE_DEFAULT		0x04000014 /* TXPBSIZE default */
+
 #define E1000_DOBFFCTL_OBFFTHR_MASK	0x000000FF /* OBFF threshold */
 #define E1000_DOBFFCTL_EXIT_ACT_MASK	0x01000000 /* Exit active CB */
 
@@ -1455,5 +1464,7 @@
 #define E1000_STATUS_LAN_ID_OFFSET	2
 #define E1000_VFTA_ENTRIES		128
 #define E1000_UNUSEDARG
+#ifndef ERROR_REPORT
 #define ERROR_REPORT(fmt)	do { } while (0)
+#endif /* ERROR_REPORT */
 #endif /* _E1000_DEFINES_H_ */

Modified: head/sys/dev/e1000/e1000_hw.h
==============================================================================
--- head/sys/dev/e1000/e1000_hw.h	Thu Jun 26 20:12:38 2014	(r267934)
+++ head/sys/dev/e1000/e1000_hw.h	Thu Jun 26 21:33:32 2014	(r267935)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2013, Intel Corporation 
+  Copyright (c) 2001-2014, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -133,6 +133,10 @@ struct e1000_hw;
 #define E1000_DEV_ID_PCH_LPT_I217_V		0x153B
 #define E1000_DEV_ID_PCH_LPTLP_I218_LM		0x155A
 #define E1000_DEV_ID_PCH_LPTLP_I218_V		0x1559
+#define E1000_DEV_ID_PCH_I218_LM2		0x15A0
+#define E1000_DEV_ID_PCH_I218_V2		0x15A1
+#define E1000_DEV_ID_PCH_I218_LM3		0x15A2 /* Wildcat Point PCH */
+#define E1000_DEV_ID_PCH_I218_V3		0x15A3 /* Wildcat Point PCH */
 #define E1000_DEV_ID_82576			0x10C9
 #define E1000_DEV_ID_82576_FIBER		0x10E6
 #define E1000_DEV_ID_82576_SERDES		0x10E7
@@ -696,7 +700,7 @@ struct e1000_mac_operations {
 	s32  (*setup_led)(struct e1000_hw *);
 	void (*write_vfta)(struct e1000_hw *, u32, u32);
 	void (*config_collision_dist)(struct e1000_hw *);
-	void (*rar_set)(struct e1000_hw *, u8*, u32);
+	int  (*rar_set)(struct e1000_hw *, u8*, u32);
 	s32  (*read_mac_addr)(struct e1000_hw *);
 	s32  (*validate_mdi_setting)(struct e1000_hw *);
 	s32  (*set_obff_timer)(struct e1000_hw *, u32);
@@ -934,6 +938,13 @@ struct e1000_shadow_ram {
 
 #define E1000_SHADOW_RAM_WORDS		2048
 
+/* I218 PHY Ultra Low Power (ULP) states */
+enum e1000_ulp_state {
+	e1000_ulp_state_unknown,
+	e1000_ulp_state_off,
+	e1000_ulp_state_on,
+};
+
 struct e1000_dev_spec_ich8lan {
 	bool kmrn_lock_loss_workaround_enabled;
 	struct e1000_shadow_ram shadow_ram[E1000_SHADOW_RAM_WORDS];
@@ -942,6 +953,7 @@ struct e1000_dev_spec_ich8lan {
 	bool nvm_k1_enabled;
 	bool eee_disable;
 	u16 eee_lp_ability;
+	enum e1000_ulp_state ulp_state;
 };
 
 struct e1000_dev_spec_82575 {

Modified: head/sys/dev/e1000/e1000_i210.c
==============================================================================
--- head/sys/dev/e1000/e1000_i210.c	Thu Jun 26 20:12:38 2014	(r267934)
+++ head/sys/dev/e1000/e1000_i210.c	Thu Jun 26 21:33:32 2014	(r267935)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2013, Intel Corporation 
+  Copyright (c) 2001-2014, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -536,7 +536,7 @@ s32 e1000_validate_nvm_checksum_i210(str
  **/
 s32 e1000_update_nvm_checksum_i210(struct e1000_hw *hw)
 {
-	s32 ret_val = E1000_SUCCESS;
+	s32 ret_val;
 	u16 checksum = 0;
 	u16 i, nvm_data;
 
@@ -615,7 +615,7 @@ bool e1000_get_flash_presence_i210(struc
  **/
 s32 e1000_update_flash_i210(struct e1000_hw *hw)
 {
-	s32 ret_val = E1000_SUCCESS;
+	s32 ret_val;
 	u32 flup;
 
 	DEBUGFUNC("e1000_update_flash_i210");
@@ -671,7 +671,7 @@ s32 e1000_pool_flash_update_done_i210(st
  **/
 static s32 e1000_init_nvm_params_i210(struct e1000_hw *hw)
 {
-	s32 ret_val = E1000_SUCCESS;
+	s32 ret_val;
 	struct e1000_nvm_info *nvm = &hw->nvm;
 
 	DEBUGFUNC("e1000_init_nvm_params_i210");
@@ -756,7 +756,7 @@ out:
 static s32 __e1000_access_xmdio_reg(struct e1000_hw *hw, u16 address,
 				    u8 dev_addr, u16 *data, bool read)
 {
-	s32 ret_val = E1000_SUCCESS;
+	s32 ret_val;
 
 	DEBUGFUNC("__e1000_access_xmdio_reg");
 
@@ -815,3 +815,90 @@ s32 e1000_write_xmdio_reg(struct e1000_h
 
 	return __e1000_access_xmdio_reg(hw, addr, dev_addr, &data, FALSE);
 }
+
+/**
+ * e1000_pll_workaround_i210
+ * @hw: pointer to the HW structure
+ *
+ * Works around an errata in the PLL circuit where it occasionally
+ * provides the wrong clock frequency after power up.
+ **/
+static s32 e1000_pll_workaround_i210(struct e1000_hw *hw)
+{
+	s32 ret_val;
+	u32 wuc, mdicnfg, ctrl, ctrl_ext, reg_val;
+	u16 nvm_word, phy_word, pci_word, tmp_nvm;
+	int i;
+
+	/* Get and set needed register values */
+	wuc = E1000_READ_REG(hw, E1000_WUC);
+	mdicnfg = E1000_READ_REG(hw, E1000_MDICNFG);
+	reg_val = mdicnfg & ~E1000_MDICNFG_EXT_MDIO;
+	E1000_WRITE_REG(hw, E1000_MDICNFG, reg_val);
+
+	/* Get data from NVM, or set default */
+	ret_val = e1000_read_invm_word_i210(hw, E1000_INVM_AUTOLOAD,
+					    &nvm_word);
+	if (ret_val != E1000_SUCCESS)
+		nvm_word = E1000_INVM_DEFAULT_AL;
+	tmp_nvm = nvm_word | E1000_INVM_PLL_WO_VAL;
+	for (i = 0; i < E1000_MAX_PLL_TRIES; i++) {
+		/* check current state directly from internal PHY */
+		e1000_read_phy_reg_gs40g(hw, (E1000_PHY_PLL_FREQ_PAGE |
+					 E1000_PHY_PLL_FREQ_REG), &phy_word);
+		if ((phy_word & E1000_PHY_PLL_UNCONF)
+		    != E1000_PHY_PLL_UNCONF) {
+			ret_val = E1000_SUCCESS;
+			break;
+		} else {
+			ret_val = -E1000_ERR_PHY;
+		}
+		/* directly reset the internal PHY */
+		ctrl = E1000_READ_REG(hw, E1000_CTRL);
+		E1000_WRITE_REG(hw, E1000_CTRL, ctrl|E1000_CTRL_PHY_RST);
+
+		ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
+		ctrl_ext |= (E1000_CTRL_EXT_PHYPDEN | E1000_CTRL_EXT_SDLPE);
+		E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext);
+
+		E1000_WRITE_REG(hw, E1000_WUC, 0);
+		reg_val = (E1000_INVM_AUTOLOAD << 4) | (tmp_nvm << 16);
+		E1000_WRITE_REG(hw, E1000_EEARBC_I210, reg_val);
+
+		e1000_read_pci_cfg(hw, E1000_PCI_PMCSR, &pci_word);
+		pci_word |= E1000_PCI_PMCSR_D3;
+		e1000_write_pci_cfg(hw, E1000_PCI_PMCSR, &pci_word);
+		msec_delay(1);
+		pci_word &= ~E1000_PCI_PMCSR_D3;
+		e1000_write_pci_cfg(hw, E1000_PCI_PMCSR, &pci_word);
+		reg_val = (E1000_INVM_AUTOLOAD << 4) | (nvm_word << 16);
+		E1000_WRITE_REG(hw, E1000_EEARBC_I210, reg_val);
+
+		/* restore WUC register */
+		E1000_WRITE_REG(hw, E1000_WUC, wuc);
+	}
+	/* restore MDICNFG setting */
+	E1000_WRITE_REG(hw, E1000_MDICNFG, mdicnfg);
+	return ret_val;
+}
+
+/**
+ *  e1000_init_hw_i210 - Init hw for I210/I211
+ *  @hw: pointer to the HW structure
+ *
+ *  Called to initialize hw for i210 hw family.
+ **/
+s32 e1000_init_hw_i210(struct e1000_hw *hw)
+{
+	s32 ret_val;
+
+	DEBUGFUNC("e1000_init_hw_i210");
+	if ((hw->mac.type >= e1000_i210) &&
+	    !(e1000_get_flash_presence_i210(hw))) {
+		ret_val = e1000_pll_workaround_i210(hw);
+		if (ret_val != E1000_SUCCESS)
+			return ret_val;
+	}
+	ret_val = e1000_init_hw_82575(hw);
+	return ret_val;
+}

Modified: head/sys/dev/e1000/e1000_i210.h
==============================================================================
--- head/sys/dev/e1000/e1000_i210.h	Thu Jun 26 20:12:38 2014	(r267934)
+++ head/sys/dev/e1000/e1000_i210.h	Thu Jun 26 21:33:32 2014	(r267935)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2013, Intel Corporation 
+  Copyright (c) 2001-2014, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -49,6 +49,7 @@ s32 e1000_read_xmdio_reg(struct e1000_hw
 			 u16 *data);
 s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr,
 			  u16 data);
+s32 e1000_init_hw_i210(struct e1000_hw *hw);
 
 #define E1000_STM_OPCODE		0xDB00
 #define E1000_EEPROM_FLASH_SIZE_WORD	0x11
@@ -93,4 +94,16 @@ enum E1000_INVM_STRUCTURE_TYPE {
 #define NVM_INIT_CTRL_4_DEFAULT_I211	0x00C1
 #define NVM_LED_1_CFG_DEFAULT_I211	0x0184
 #define NVM_LED_0_2_CFG_DEFAULT_I211	0x200C
+
+/* PLL Defines */
+#define E1000_PCI_PMCSR			0x44
+#define E1000_PCI_PMCSR_D3		0x03
+#define E1000_MAX_PLL_TRIES		5
+#define E1000_PHY_PLL_UNCONF		0xFF
+#define E1000_PHY_PLL_FREQ_PAGE		0xFC0000
+#define E1000_PHY_PLL_FREQ_REG		0x000E
+#define E1000_INVM_DEFAULT_AL		0x202F
+#define E1000_INVM_AUTOLOAD		0x0A
+#define E1000_INVM_PLL_WO_VAL		0x0010
+
 #endif

Modified: head/sys/dev/e1000/e1000_ich8lan.c
==============================================================================
--- head/sys/dev/e1000/e1000_ich8lan.c	Thu Jun 26 20:12:38 2014	(r267934)
+++ head/sys/dev/e1000/e1000_ich8lan.c	Thu Jun 26 21:33:32 2014	(r267935)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2013, Intel Corporation 
+  Copyright (c) 2001-2014, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -63,6 +63,10 @@
  * Ethernet Connection I217-V
  * Ethernet Connection I218-V
  * Ethernet Connection I218-LM
+ * Ethernet Connection (2) I218-LM
+ * Ethernet Connection (2) I218-V
+ * Ethernet Connection (3) I218-LM
+ * Ethernet Connection (3) I218-V
  */
 
 #include "e1000_api.h"
@@ -73,8 +77,8 @@ static s32  e1000_acquire_nvm_ich8lan(st
 static void e1000_release_nvm_ich8lan(struct e1000_hw *hw);
 static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw);
 static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw);
-static void e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index);
-static void e1000_rar_set_pch_lpt(struct e1000_hw *hw, u8 *addr, u32 index);
+static int  e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index);
+static int  e1000_rar_set_pch_lpt(struct e1000_hw *hw, u8 *addr, u32 index);
 static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw);
 static void e1000_update_mc_addr_list_pch2lan(struct e1000_hw *hw,
 					      u8 *mc_addr_list,
@@ -250,7 +254,7 @@ out:
  *  Toggling the LANPHYPC pin value fully power-cycles the PHY and is
  *  used to reset the PHY to a quiescent state when necessary.
  **/
-void e1000_toggle_lanphypc_pch_lpt(struct e1000_hw *hw)
+static void e1000_toggle_lanphypc_pch_lpt(struct e1000_hw *hw)
 {
 	u32 mac_reg;
 
@@ -306,6 +310,12 @@ static s32 e1000_init_phy_workarounds_pc
 	 */
 	e1000_gate_hw_phy_config_ich8lan(hw, TRUE);
 
+	/* It is not possible to be certain of the current state of ULP
+	 * so forcibly disable it.
+	 */
+	hw->dev_spec.ich8lan.ulp_state = e1000_ulp_state_unknown;
+	e1000_disable_ulp_lpt_lp(hw, TRUE);
+
 	ret_val = hw->phy.ops.acquire(hw);
 	if (ret_val) {
 		DEBUGOUT("Failed to initialize PHY flow\n");
@@ -611,13 +621,12 @@ static s32 e1000_init_nvm_params_ich8lan
 	DEBUGFUNC("e1000_init_nvm_params_ich8lan");
 
 	/* Can't read flash registers if the register set isn't mapped. */
+	nvm->type = e1000_nvm_flash_sw;
 	if (!hw->flash_address) {
 		DEBUGOUT("ERROR: Flash registers not mapped\n");
 		return -E1000_ERR_CONFIG;
 	}
 
-	nvm->type = e1000_nvm_flash_sw;
-
 	gfpreg = E1000_READ_FLASH_REG(hw, ICH_FLASH_GFPREG);
 
 	/* sector_X_addr is a "sector"-aligned address (4096 bytes)
@@ -672,6 +681,9 @@ static s32 e1000_init_nvm_params_ich8lan
 static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw)
 {
 	struct e1000_mac_info *mac = &hw->mac;
+#if defined(QV_RELEASE) || !defined(NO_PCH_LPT_B0_SUPPORT)
+	u16 pci_cfg;
+#endif /* QV_RELEASE || !defined(NO_PCH_LPT_B0_SUPPORT) */
 
 	DEBUGFUNC("e1000_init_mac_params_ich8lan");
 
@@ -744,6 +756,11 @@ static s32 e1000_init_mac_params_ich8lan
 		mac->ops.update_mc_addr_list =
 			e1000_update_mc_addr_list_pch2lan;
 	case e1000_pchlan:
+#if defined(QV_RELEASE) || !defined(NO_PCH_LPT_B0_SUPPORT)
+		/* save PCH revision_id */
+		e1000_read_pci_cfg(hw, E1000_PCI_REVISION_ID_REG, &pci_cfg);
+		hw->revision_id = (u8)(pci_cfg &= 0x000F);
+#endif /* QV_RELEASE || !defined(NO_PCH_LPT_B0_SUPPORT) */
 		/* check management mode */
 		mac->ops.check_mng_mode = e1000_check_mng_mode_pchlan;
 		/* ID LED init */
@@ -915,6 +932,17 @@ s32 e1000_set_eee_pchlan(struct e1000_hw
 		}
 	}
 
+	if (hw->phy.type == e1000_phy_82579) {
+		ret_val = e1000_read_emi_reg_locked(hw, I82579_LPI_PLL_SHUT,
+						    &data);
+		if (ret_val)
+			goto release;
+
+		data &= ~I82579_LPI_100_PLL_SHUT;
+		ret_val = e1000_write_emi_reg_locked(hw, I82579_LPI_PLL_SHUT,
+						     data);
+	}
+
 	/* R/Clr IEEE MMD 3.1 bits 11:10 - Tx/Rx LPI Received */
 	ret_val = e1000_read_emi_reg_locked(hw, pcs_status, &data);
 	if (ret_val)
@@ -1179,6 +1207,256 @@ static s32 e1000_set_obff_timer_pch_lpt(
 }
 
 /**
+ *  e1000_enable_ulp_lpt_lp - configure Ultra Low Power mode for LynxPoint-LP
+ *  @hw: pointer to the HW structure
+ *  @to_sx: boolean indicating a system power state transition to Sx
+ *
+ *  When link is down, configure ULP mode to significantly reduce the power
+ *  to the PHY.  If on a Manageability Engine (ME) enabled system, tell the
+ *  ME firmware to start the ULP configuration.  If not on an ME enabled
+ *  system, configure the ULP mode by software.
+ */
+s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx)
+{
+	u32 mac_reg;
+	s32 ret_val = E1000_SUCCESS;
+	u16 phy_reg;
+
+	if ((hw->mac.type < e1000_pch_lpt) ||
+	    (hw->device_id == E1000_DEV_ID_PCH_LPT_I217_LM) ||
+	    (hw->device_id == E1000_DEV_ID_PCH_LPT_I217_V) ||
+	    (hw->device_id == E1000_DEV_ID_PCH_I218_LM2) ||
+	    (hw->device_id == E1000_DEV_ID_PCH_I218_V2) ||
+	    (hw->dev_spec.ich8lan.ulp_state == e1000_ulp_state_on))
+		return 0;
+
+	if (E1000_READ_REG(hw, E1000_FWSM) & E1000_ICH_FWSM_FW_VALID) {
+		/* Request ME configure ULP mode in the PHY */
+		mac_reg = E1000_READ_REG(hw, E1000_H2ME);
+		mac_reg |= E1000_H2ME_ULP | E1000_H2ME_ENFORCE_SETTINGS;
+		E1000_WRITE_REG(hw, E1000_H2ME, mac_reg);
+
+		goto out;
+	}
+
+	if (!to_sx) {
+		int i = 0;
+
+		/* Poll up to 5 seconds for Cable Disconnected indication */
+		while (!(E1000_READ_REG(hw, E1000_FEXT) &
+			 E1000_FEXT_PHY_CABLE_DISCONNECTED)) {
+			/* Bail if link is re-acquired */
+			if (E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU)
+				return -E1000_ERR_PHY;
+
+			if (i++ == 100)
+				break;
+
+			msec_delay(50);
+		}
+		DEBUGOUT2("CABLE_DISCONNECTED %s set after %dmsec\n",
+			 (E1000_READ_REG(hw, E1000_FEXT) &
+			  E1000_FEXT_PHY_CABLE_DISCONNECTED) ? "" : "not",
+			 i * 50);
+	}
+
+	ret_val = hw->phy.ops.acquire(hw);
+	if (ret_val)
+		goto out;
+
+	/* Force SMBus mode in PHY */
+	ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL, &phy_reg);
+	if (ret_val)
+		goto release;
+	phy_reg |= CV_SMB_CTRL_FORCE_SMBUS;
+	e1000_write_phy_reg_hv_locked(hw, CV_SMB_CTRL, phy_reg);
+
+	/* Force SMBus mode in MAC */
+	mac_reg = E1000_READ_REG(hw, E1000_CTRL_EXT);
+	mac_reg |= E1000_CTRL_EXT_FORCE_SMBUS;
+	E1000_WRITE_REG(hw, E1000_CTRL_EXT, mac_reg);
+
+	/* Set Inband ULP Exit, Reset to SMBus mode and
+	 * Disable SMBus Release on PERST# in PHY
+	 */
+	ret_val = e1000_read_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, &phy_reg);
+	if (ret_val)
+		goto release;
+	phy_reg |= (I218_ULP_CONFIG1_RESET_TO_SMBUS |
+		    I218_ULP_CONFIG1_DISABLE_SMB_PERST);
+	if (to_sx) {
+		if (E1000_READ_REG(hw, E1000_WUFC) & E1000_WUFC_LNKC)
+			phy_reg |= I218_ULP_CONFIG1_WOL_HOST;
+
+		phy_reg |= I218_ULP_CONFIG1_STICKY_ULP;
+	} else {
+		phy_reg |= I218_ULP_CONFIG1_INBAND_EXIT;
+	}
+	e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg);
+
+	/* Set Disable SMBus Release on PERST# in MAC */
+	mac_reg = E1000_READ_REG(hw, E1000_FEXTNVM7);
+	mac_reg |= E1000_FEXTNVM7_DISABLE_SMB_PERST;
+	E1000_WRITE_REG(hw, E1000_FEXTNVM7, mac_reg);
+
+	/* Commit ULP changes in PHY by starting auto ULP configuration */
+	phy_reg |= I218_ULP_CONFIG1_START;
+	e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg);
+release:
+	hw->phy.ops.release(hw);
+out:
+	if (ret_val)
+		DEBUGOUT1("Error in ULP enable flow: %d\n", ret_val);
+	else
+		hw->dev_spec.ich8lan.ulp_state = e1000_ulp_state_on;
+
+	return ret_val;
+}
+
+/**
+ *  e1000_disable_ulp_lpt_lp - unconfigure Ultra Low Power mode for LynxPoint-LP
+ *  @hw: pointer to the HW structure
+ *  @force: boolean indicating whether or not to force disabling ULP
+ *
+ *  Un-configure ULP mode when link is up, the system is transitioned from
+ *  Sx or the driver is unloaded.  If on a Manageability Engine (ME) enabled
+ *  system, poll for an indication from ME that ULP has been un-configured.
+ *  If not on an ME enabled system, un-configure the ULP mode by software.
+ *
+ *  During nominal operation, this function is called when link is acquired
+ *  to disable ULP mode (force=FALSE); otherwise, for example when unloading
+ *  the driver or during Sx->S0 transitions, this is called with force=TRUE
+ *  to forcibly disable ULP.
+ */

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 21:44:52 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E5C86AA;
 Thu, 26 Jun 2014 21:44:52 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D09032BDE;
 Thu, 26 Jun 2014 21:44:52 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QLiqPY034517;
 Thu, 26 Jun 2014 21:44:52 GMT (envelope-from bapt@svn.freebsd.org)
Received: (from bapt@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QLiUlc034366;
 Thu, 26 Jun 2014 21:44:30 GMT (envelope-from bapt@svn.freebsd.org)
Message-Id: <201406262144.s5QLiUlc034366@svn.freebsd.org>
From: Baptiste Daroussin 
Date: Thu, 26 Jun 2014 21:44:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267936 - head/share/man/man9
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 21:44:53 -0000

Author: bapt
Date: Thu Jun 26 21:44:30 2014
New Revision: 267936
URL: http://svnweb.freebsd.org/changeset/base/267936

Log:
  use .Mt to mark up email addresses consistently (part6)
  
  PR:		191174
  Submitted by:	Franco Fichtner 

Modified:
  head/share/man/man9/BUF_ISLOCKED.9
  head/share/man/man9/BUF_LOCK.9
  head/share/man/man9/BUF_LOCKFREE.9
  head/share/man/man9/BUF_LOCKINIT.9
  head/share/man/man9/BUF_RECURSED.9
  head/share/man/man9/BUF_TIMELOCK.9
  head/share/man/man9/BUF_UNLOCK.9
  head/share/man/man9/BUS_CONFIG_INTR.9
  head/share/man/man9/BUS_SETUP_INTR.9
  head/share/man/man9/CTASSERT.9
  head/share/man/man9/DB_COMMAND.9
  head/share/man/man9/DECLARE_GEOM_CLASS.9
  head/share/man/man9/DECLARE_MODULE.9
  head/share/man/man9/DEVICE_ATTACH.9
  head/share/man/man9/DEVICE_IDENTIFY.9
  head/share/man/man9/DEV_MODULE.9
  head/share/man/man9/DRIVER_MODULE.9
  head/share/man/man9/EVENTHANDLER.9
  head/share/man/man9/KASSERT.9
  head/share/man/man9/LOCK_PROFILING.9
  head/share/man/man9/MODULE_DEPEND.9
  head/share/man/man9/MODULE_VERSION.9
  head/share/man/man9/SDT.9
  head/share/man/man9/SYSCALL_MODULE.9
  head/share/man/man9/SYSINIT.9
  head/share/man/man9/VFS_SET.9
  head/share/man/man9/alq.9
  head/share/man/man9/bus_activate_resource.9
  head/share/man/man9/bus_alloc_resource.9
  head/share/man/man9/bus_child_present.9
  head/share/man/man9/bus_release_resource.9
  head/share/man/man9/bus_set_resource.9
  head/share/man/man9/cd.9
  head/share/man/man9/config_intrhook.9
  head/share/man/man9/crypto.9
  head/share/man/man9/devstat.9
  head/share/man/man9/domain.9
  head/share/man/man9/eventtimers.9
  head/share/man/man9/fail.9
  head/share/man/man9/firmware.9
  head/share/man/man9/g_access.9
  head/share/man/man9/g_attach.9
  head/share/man/man9/g_bio.9
  head/share/man/man9/g_consumer.9
  head/share/man/man9/g_data.9
  head/share/man/man9/g_event.9
  head/share/man/man9/g_geom.9
  head/share/man/man9/g_provider.9
  head/share/man/man9/g_provider_by_name.9
  head/share/man/man9/g_wither_geom.9
  head/share/man/man9/get_cyclecount.9
  head/share/man/man9/getnewvnode.9
  head/share/man/man9/groupmember.9
  head/share/man/man9/hhook.9
  head/share/man/man9/ieee80211_radiotap.9
  head/share/man/man9/insmntque.9
  head/share/man/man9/kernel_mount.9
  head/share/man/man9/khelp.9
  head/share/man/man9/kqueue.9
  head/share/man/man9/lock.9
  head/share/man/man9/mbchain.9
  head/share/man/man9/mbpool.9
  head/share/man/man9/mbuf_tags.9
  head/share/man/man9/mdchain.9
  head/share/man/man9/memguard.9
  head/share/man/man9/microtime.9
  head/share/man/man9/microuptime.9
  head/share/man/man9/mod_cc.9
  head/share/man/man9/module.9
  head/share/man/man9/namei.9
  head/share/man/man9/osd.9
  head/share/man/man9/pbuf.9
  head/share/man/man9/pci.9
  head/share/man/man9/pfind.9
  head/share/man/man9/pgfind.9
  head/share/man/man9/pmap.9
  head/share/man/man9/pmap_activate.9
  head/share/man/man9/pmap_change_wiring.9
  head/share/man/man9/pmap_clear_modify.9
  head/share/man/man9/pmap_copy.9
  head/share/man/man9/pmap_enter.9
  head/share/man/man9/pmap_extract.9
  head/share/man/man9/pmap_growkernel.9
  head/share/man/man9/pmap_init.9
  head/share/man/man9/pmap_is_modified.9
  head/share/man/man9/pmap_is_prefaultable.9
  head/share/man/man9/pmap_map.9
  head/share/man/man9/pmap_mincore.9
  head/share/man/man9/pmap_object_init_pt.9
  head/share/man/man9/pmap_page_exists_quick.9
  head/share/man/man9/pmap_page_init.9
  head/share/man/man9/pmap_page_protect.9
  head/share/man/man9/pmap_pinit.9
  head/share/man/man9/pmap_qenter.9
  head/share/man/man9/pmap_release.9
  head/share/man/man9/pmap_remove.9
  head/share/man/man9/pmap_resident_count.9
  head/share/man/man9/pmap_zero_page.9
  head/share/man/man9/pseudofs.9
  head/share/man/man9/redzone.9
  head/share/man/man9/resource_int_value.9
  head/share/man/man9/rman.9
  head/share/man/man9/sbuf.9
  head/share/man/man9/selrecord.9
  head/share/man/man9/signal.9
  head/share/man/man9/sleep.9
  head/share/man/man9/sysctl_add_oid.9
  head/share/man/man9/sysctl_ctx_init.9
  head/share/man/man9/tvtohz.9
  head/share/man/man9/ucred.9
  head/share/man/man9/uidinfo.9
  head/share/man/man9/usbdi.9
  head/share/man/man9/utopia.9
  head/share/man/man9/vaccess_acl_nfs4.9
  head/share/man/man9/vflush.9
  head/share/man/man9/vfs_busy.9
  head/share/man/man9/vfs_getnewfsid.9
  head/share/man/man9/vfs_getopt.9
  head/share/man/man9/vfs_getvfs.9
  head/share/man/man9/vfs_mountedfrom.9
  head/share/man/man9/vfs_rootmountalloc.9
  head/share/man/man9/vfs_timestamp.9
  head/share/man/man9/vfs_unbusy.9
  head/share/man/man9/vfsconf.9
  head/share/man/man9/vgone.9
  head/share/man/man9/vhold.9
  head/share/man/man9/vinvalbuf.9
  head/share/man/man9/vm_fault_prefault.9
  head/share/man/man9/vm_map.9
  head/share/man/man9/vm_map_check_protection.9
  head/share/man/man9/vm_map_create.9
  head/share/man/man9/vm_map_delete.9
  head/share/man/man9/vm_map_entry_resize_free.9
  head/share/man/man9/vm_map_find.9
  head/share/man/man9/vm_map_findspace.9
  head/share/man/man9/vm_map_inherit.9
  head/share/man/man9/vm_map_init.9
  head/share/man/man9/vm_map_insert.9
  head/share/man/man9/vm_map_lock.9
  head/share/man/man9/vm_map_lookup.9
  head/share/man/man9/vm_map_madvise.9
  head/share/man/man9/vm_map_max.9
  head/share/man/man9/vm_map_protect.9
  head/share/man/man9/vm_map_remove.9
  head/share/man/man9/vm_map_simplify_entry.9
  head/share/man/man9/vm_map_stack.9
  head/share/man/man9/vm_map_submap.9
  head/share/man/man9/vm_map_sync.9
  head/share/man/man9/vm_map_wire.9
  head/share/man/man9/vm_page_aflag.9
  head/share/man/man9/vm_page_alloc.9
  head/share/man/man9/vm_page_bits.9
  head/share/man/man9/vm_page_cache.9
  head/share/man/man9/vm_page_deactivate.9
  head/share/man/man9/vm_page_dontneed.9
  head/share/man/man9/vm_page_free.9
  head/share/man/man9/vm_page_grab.9
  head/share/man/man9/vm_page_hold.9
  head/share/man/man9/vm_page_insert.9
  head/share/man/man9/vm_page_lookup.9
  head/share/man/man9/vm_page_rename.9
  head/share/man/man9/vm_page_wire.9
  head/share/man/man9/vm_set_page_size.9
  head/share/man/man9/vn_fullpath.9
  head/share/man/man9/vn_isdisk.9
  head/share/man/man9/watchdog.9
  head/share/man/man9/zero_copy.9
  head/share/man/man9/zone.9

Modified: head/share/man/man9/BUF_ISLOCKED.9
==============================================================================
--- head/share/man/man9/BUF_ISLOCKED.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/BUF_ISLOCKED.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -66,4 +66,4 @@ The lock is not held by anyone.
 .Xr lockmgr 9
 .Sh AUTHORS
 This manual page was written by
-.An Attilio Rao Aq attilio@FreeBSD.org .
+.An Attilio Rao Aq Mt attilio@FreeBSD.org .

Modified: head/share/man/man9/BUF_LOCK.9
==============================================================================
--- head/share/man/man9/BUF_LOCK.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/BUF_LOCK.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -72,4 +72,4 @@ information on non-zero return values.
 .Xr lockmgr 9
 .Sh AUTHORS
 This manual page was written by
-.An Chad David Aq davidc@acns.ab.ca .
+.An Chad David Aq Mt davidc@acns.ab.ca .

Modified: head/share/man/man9/BUF_LOCKFREE.9
==============================================================================
--- head/share/man/man9/BUF_LOCKFREE.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/BUF_LOCKFREE.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -60,4 +60,4 @@ The buffer whose lock is to be destroyed
 .Xr lockdestroy 9
 .Sh AUTHORS
 This manual page was written by
-.An Chad David Aq davidc@acns.ab.ca .
+.An Chad David Aq Mt davidc@acns.ab.ca .

Modified: head/share/man/man9/BUF_LOCKINIT.9
==============================================================================
--- head/share/man/man9/BUF_LOCKINIT.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/BUF_LOCKINIT.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -59,4 +59,4 @@ The buffer whose lock it to be initializ
 .Xr lockmgr 9
 .Sh AUTHORS
 This manual page was written by
-.An Chad David Aq davidc@acns.ab.ca .
+.An Chad David Aq Mt davidc@acns.ab.ca .

Modified: head/share/man/man9/BUF_RECURSED.9
==============================================================================
--- head/share/man/man9/BUF_RECURSED.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/BUF_RECURSED.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -62,4 +62,4 @@ for details.
 .Xr lockmgr 9
 .Sh AUTHORS
 This manual page was written by
-.An Attilio Rao Aq attilio@FreeBSD.org .
+.An Attilio Rao Aq Mt attilio@FreeBSD.org .

Modified: head/share/man/man9/BUF_TIMELOCK.9
==============================================================================
--- head/share/man/man9/BUF_TIMELOCK.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/BUF_TIMELOCK.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -80,4 +80,4 @@ for details on non-zero return values.
 .Xr lockmgr 9
 .Sh AUTHORS
 This manual page was written by
-.An Chad David Aq davidc@acns.ab.ca .
+.An Chad David Aq Mt davidc@acns.ab.ca .

Modified: head/share/man/man9/BUF_UNLOCK.9
==============================================================================
--- head/share/man/man9/BUF_UNLOCK.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/BUF_UNLOCK.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -61,4 +61,4 @@ The buffer must already be locked.
 .Xr lockmgr 9
 .Sh AUTHORS
 This manual page was written by
-.An Chad David Aq davidc@acns.ab.ca .
+.An Chad David Aq Mt davidc@acns.ab.ca .

Modified: head/share/man/man9/BUS_CONFIG_INTR.9
==============================================================================
--- head/share/man/man9/BUS_CONFIG_INTR.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/BUS_CONFIG_INTR.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -102,5 +102,4 @@ method first appeared in
 .\"
 .Sh AUTHORS
 This manual page was written by
-.An Marcel Moolenaar
-.Aq marcel@xcllnt.net .
+.An Marcel Moolenaar Aq Mt marcel@xcllnt.net .

Modified: head/share/man/man9/BUS_SETUP_INTR.9
==============================================================================
--- head/share/man/man9/BUS_SETUP_INTR.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/BUS_SETUP_INTR.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -205,12 +205,10 @@ otherwise an appropriate error is return
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Jeroen Ruigrok van der Werven
-.Aq asmodai@FreeBSD.org
+.An Jeroen Ruigrok van der Werven Aq Mt asmodai@FreeBSD.org
 based on the manual pages for
 .Fn BUS_CREATE_INTR
 and
 .Fn BUS_CONNECT_INTR
 written by
-.An Doug Rabson
-.Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/share/man/man9/CTASSERT.9
==============================================================================
--- head/share/man/man9/CTASSERT.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/CTASSERT.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -66,5 +66,4 @@ structure is 16 bytes.
 .Xr KASSERT 9
 .Sh AUTHORS
 This manual page was written by
-.An Hiten M. Pandya
-.Aq hmp@FreeBSD.org .
+.An Hiten M. Pandya Aq Mt hmp@FreeBSD.org .

Modified: head/share/man/man9/DB_COMMAND.9
==============================================================================
--- head/share/man/man9/DB_COMMAND.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/DB_COMMAND.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -103,8 +103,8 @@ Calling my command with address 0x1000
 db>
 .Ef
 .Ed
-.Sh "SEE ALSO"
+.Sh SEE ALSO
 .Xr ddb 4
-.Sh AUTHOR
+.Sh AUTHORS
 This manual page was written by
-.An Guillaume Ballet Aq gballet@gmail.com .
+.An Guillaume Ballet Aq Mt gballet@gmail.com .

Modified: head/share/man/man9/DECLARE_GEOM_CLASS.9
==============================================================================
--- head/share/man/man9/DECLARE_GEOM_CLASS.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/DECLARE_GEOM_CLASS.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -176,4 +176,4 @@ DECLARE_GEOM_CLASS(example_class, g_exam
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org .
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .

Modified: head/share/man/man9/DECLARE_MODULE.9
==============================================================================
--- head/share/man/man9/DECLARE_MODULE.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/DECLARE_MODULE.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -107,6 +107,6 @@ enumeration
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Alexander Langer Aq alex@FreeBSD.org ,
+.An Alexander Langer Aq Mt alex@FreeBSD.org ,
 inspired by the KLD Facility Programming Tutorial by
-.An Andrew Reiter Aq arr@watson.org .
+.An Andrew Reiter Aq Mt arr@watson.org .

Modified: head/share/man/man9/DEVICE_ATTACH.9
==============================================================================
--- head/share/man/man9/DEVICE_ATTACH.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/DEVICE_ATTACH.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -68,4 +68,4 @@ Zero is returned on success, otherwise a
 .Xr DEVICE_SHUTDOWN 9
 .Sh AUTHORS
 This manual page was written by
-.An Doug Rabson Aq dfr@FreeBSD.org .
+.An Doug Rabson Aq Mt dfr@FreeBSD.org .

Modified: head/share/man/man9/DEVICE_IDENTIFY.9
==============================================================================
--- head/share/man/man9/DEVICE_IDENTIFY.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/DEVICE_IDENTIFY.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -91,4 +91,4 @@ foo_identify(driver_t *driver, device_t 
 .Xr DEVICE_SHUTDOWN 9
 .Sh AUTHORS
 This manual page was written by
-.An Alexander Langer Aq alex@FreeBSD.org .
+.An Alexander Langer Aq Mt alex@FreeBSD.org .

Modified: head/share/man/man9/DEV_MODULE.9
==============================================================================
--- head/share/man/man9/DEV_MODULE.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/DEV_MODULE.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -102,4 +102,4 @@ DEV_MODULE(foo, foo_load, NULL);
 .Xr module 9
 .Sh AUTHORS
 This manual page was written by
-.An Alexander Langer Aq alex@FreeBSD.org .
+.An Alexander Langer Aq Mt alex@FreeBSD.org .

Modified: head/share/man/man9/DRIVER_MODULE.9
==============================================================================
--- head/share/man/man9/DRIVER_MODULE.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/DRIVER_MODULE.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -147,4 +147,4 @@ for a specific pass level.
 .Xr SYSINIT 9
 .Sh AUTHORS
 This manual page was written by
-.An Alexander Langer Aq alex@FreeBSD.org .
+.An Alexander Langer Aq Mt alex@FreeBSD.org .

Modified: head/share/man/man9/EVENTHANDLER.9
==============================================================================
--- head/share/man/man9/EVENTHANDLER.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/EVENTHANDLER.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -334,4 +334,4 @@ facility first appeared in
 .Fx 4.0 .
 .Sh AUTHORS
 This manual page was written by
-.An Joseph Koshy Aq jkoshy@FreeBSD.org .
+.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .

Modified: head/share/man/man9/KASSERT.9
==============================================================================
--- head/share/man/man9/KASSERT.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/KASSERT.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -83,5 +83,4 @@ vput(vp)
 .Xr panic 9
 .Sh AUTHORS
 This manual page was written by
-.An Jonathan M. Bresler
-.Aq jmb@FreeBSD.org .
+.An Jonathan M. Bresler Aq Mt jmb@FreeBSD.org .

Modified: head/share/man/man9/LOCK_PROFILING.9
==============================================================================
--- head/share/man/man9/LOCK_PROFILING.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/LOCK_PROFILING.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -134,16 +134,16 @@ Generalized lock profiling support appea
 The
 .Nm MUTEX_PROFILING
 code was written by
-.An Eivind Eklund Aq eivind@FreeBSD.org ,
-.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org
+.An Eivind Eklund Aq Mt eivind@FreeBSD.org ,
+.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org
 and
-.An Robert Watson Aq rwatson@FreeBSD.org .
+.An Robert Watson Aq Mt rwatson@FreeBSD.org .
 The
 .Nm
 code was written by
-.An Kip Macy Aq kmacy@FreeBSD.org .
+.An Kip Macy Aq Mt kmacy@FreeBSD.org .
 This manual page was written by
-.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org .
+.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .
 .Sh NOTES
 The
 .Dv LOCK_PROFILING

Modified: head/share/man/man9/MODULE_DEPEND.9
==============================================================================
--- head/share/man/man9/MODULE_DEPEND.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/MODULE_DEPEND.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -77,4 +77,4 @@ MODULE_DEPEND(foo, bar, 1, 3, 4);
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Alexander Langer Aq alex@FreeBSD.org .
+.An Alexander Langer Aq Mt alex@FreeBSD.org .

Modified: head/share/man/man9/MODULE_VERSION.9
==============================================================================
--- head/share/man/man9/MODULE_VERSION.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/MODULE_VERSION.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -56,4 +56,4 @@ MODULE_VERSION(foo, 1);
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Alexander Langer Aq alex@FreeBSD.org .
+.An Alexander Langer Aq Mt alex@FreeBSD.org .

Modified: head/share/man/man9/SDT.9
==============================================================================
--- head/share/man/man9/SDT.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/SDT.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -278,9 +278,9 @@ SDT_PROBE_DEFINE1_XLATE(ip, , , receive,
 DTrace and the
 .Nm
 framework were originally ported to FreeBSD from Solaris by
-.An John Birrell Aq jb@FreeBSD.org .
+.An John Birrell Aq Mt jb@FreeBSD.org .
 This manual page was written by
-.An Mark Johnston Aq markj@FreeBSD.org .
+.An Mark Johnston Aq Mt markj@FreeBSD.org .
 .Sh BUGS
 The
 .Nm

Modified: head/share/man/man9/SYSCALL_MODULE.9
==============================================================================
--- head/share/man/man9/SYSCALL_MODULE.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/SYSCALL_MODULE.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -81,4 +81,4 @@ A minimal example for a syscall module c
 .Pa /usr/share/examples/kld/syscall/module/syscall.c
 .Sh AUTHORS
 This manual page was written by
-.An Alexander Langer Aq alex@FreeBSD.org .
+.An Alexander Langer Aq Mt alex@FreeBSD.org .

Modified: head/share/man/man9/SYSINIT.9
==============================================================================
--- head/share/man/man9/SYSINIT.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/SYSINIT.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -157,7 +157,7 @@ framework first appeared in
 The
 .Nm
 framework was written by
-.An Terrence Lambert Aq terry@FreeBSD.org .
+.An Terrence Lambert Aq Mt terry@FreeBSD.org .
 .Pp
 This manual page was written by
-.An Hiten Pandya Aq hmp@FreeBSD.org .
+.An Hiten Pandya Aq Mt hmp@FreeBSD.org .

Modified: head/share/man/man9/VFS_SET.9
==============================================================================
--- head/share/man/man9/VFS_SET.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/VFS_SET.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -108,4 +108,4 @@ VFS_SET(myfs_vfsops, myfs, 0);
 .Xr vfs_modevent 9
 .Sh AUTHORS
 This manual page was written by
-.An Chad David Aq davidc@acns.ab.ca .
+.An Chad David Aq Mt davidc@acns.ab.ca .

Modified: head/share/man/man9/alq.9
==============================================================================
--- head/share/man/man9/alq.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/alq.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -431,11 +431,11 @@ Asynchronous Logging Queues (ALQ) facili
 The
 .Nm
 facility was written by
-.An Jeffrey Roberson Aq jeff@FreeBSD.org
+.An Jeffrey Roberson Aq Mt jeff@FreeBSD.org
 and extended by
-.An Lawrence Stewart Aq lstewart@freebsd.org .
+.An Lawrence Stewart Aq Mt lstewart@freebsd.org .
 .Pp
 This manual page was written by
-.An Hiten Pandya Aq hmp@FreeBSD.org
+.An Hiten Pandya Aq Mt hmp@FreeBSD.org
 and revised by
-.An Lawrence Stewart Aq lstewart@freebsd.org .
+.An Lawrence Stewart Aq Mt lstewart@freebsd.org .

Modified: head/share/man/man9/bus_activate_resource.9
==============================================================================
--- head/share/man/man9/bus_activate_resource.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/bus_activate_resource.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -90,4 +90,4 @@ Zero is returned on success, otherwise a
 .Xr driver 9
 .Sh AUTHORS
 This manual page was written by
-.An Warner Losh Aq imp@FreeBSD.org .
+.An Warner Losh Aq Mt imp@FreeBSD.org .

Modified: head/share/man/man9/bus_alloc_resource.9
==============================================================================
--- head/share/man/man9/bus_alloc_resource.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/bus_alloc_resource.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -178,6 +178,6 @@ should be saved in the softc of the devi
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Alexander Langer Aq alex@big.endian.de
+.An Alexander Langer Aq Mt alex@big.endian.de
 with parts by
-.An Warner Losh Aq imp@FreeBSD.org .
+.An Warner Losh Aq Mt imp@FreeBSD.org .

Modified: head/share/man/man9/bus_child_present.9
==============================================================================
--- head/share/man/man9/bus_child_present.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/bus_child_present.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -84,4 +84,4 @@ if (bus_child_present(dev))
 .Xr driver 9
 .Sh AUTHORS
 This manual page was written by
-.An Warner Losh Aq imp@FreeBSD.org .
+.An Warner Losh Aq Mt imp@FreeBSD.org .

Modified: head/share/man/man9/bus_release_resource.9
==============================================================================
--- head/share/man/man9/bus_release_resource.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/bus_release_resource.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -103,4 +103,4 @@ The kernel will panic, if it cannot rele
 .Xr driver 9
 .Sh AUTHORS
 This manual page was written by
-.An Alexander Langer Aq alex@big.endian.de .
+.An Alexander Langer Aq Mt alex@big.endian.de .

Modified: head/share/man/man9/bus_set_resource.9
==============================================================================
--- head/share/man/man9/bus_set_resource.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/bus_set_resource.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -93,4 +93,4 @@ Zero is returned on success, otherwise a
 .Xr driver 9
 .Sh AUTHORS
 This manual page was written by
-.An Warner Losh Aq imp@FreeBSD.org .
+.An Warner Losh Aq Mt imp@FreeBSD.org .

Modified: head/share/man/man9/cd.9
==============================================================================
--- head/share/man/man9/cd.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/cd.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -116,8 +116,8 @@ manual page first appeared in
 .An -nosplit
 This
 manual page was written by
-.An John-Mark Gurney Aq jmg@FreeBSD.org .
+.An John-Mark Gurney Aq Mt jmg@FreeBSD.org .
 It was updated for CAM and
 .Fx 3.0
 by
-.An Kenneth Merry Aq ken@FreeBSD.org .
+.An Kenneth Merry Aq Mt ken@FreeBSD.org .

Modified: head/share/man/man9/config_intrhook.9
==============================================================================
--- head/share/man/man9/config_intrhook.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/config_intrhook.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -100,6 +100,6 @@ with the CAM subsystem, but are availabl
 .Sh AUTHORS
 .An -nosplit
 The functions were written by
-.An Justin Gibbs Aq gibbs@FreeBSD.org .
+.An Justin Gibbs Aq Mt gibbs@FreeBSD.org .
 This manual page was written by
-.An M. Warner Losh Aq imp@FreeBSD.org .
+.An M. Warner Losh Aq Mt imp@FreeBSD.org .

Modified: head/share/man/man9/crypto.9
==============================================================================
--- head/share/man/man9/crypto.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/crypto.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -648,7 +648,7 @@ most of the framework code
 The cryptographic framework first appeared in
 .Ox 2.7
 and was written by
-.An "Angelos D. Keromytis" Aq angelos@openbsd.org .
+.An Angelos D. Keromytis Aq Mt angelos@openbsd.org .
 .Sh BUGS
 The framework currently assumes that all the algorithms in a
 .Fn crypto_newsession

Modified: head/share/man/man9/devstat.9
==============================================================================
--- head/share/man/man9/devstat.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/devstat.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -431,7 +431,7 @@ The
 statistics system appeared in
 .Fx 3.0 .
 .Sh AUTHORS
-.An Kenneth Merry Aq ken@FreeBSD.org
+.An Kenneth Merry Aq Mt ken@FreeBSD.org
 .Sh BUGS
 There may be a need for
 .Fn spl

Modified: head/share/man/man9/domain.9
==============================================================================
--- head/share/man/man9/domain.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/domain.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -240,4 +240,4 @@ types if the domain has a default raw pr
 .Xr socket 2
 .Sh AUTHORS
 This manual page was written by
-.An Chad David Aq davidc@acns.ab.ca .
+.An Chad David Aq Mt davidc@acns.ab.ca .

Modified: head/share/man/man9/eventtimers.9
==============================================================================
--- head/share/man/man9/eventtimers.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/eventtimers.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -250,4 +250,4 @@ timer hardware access.
 .Sh SEE ALSO
 .Xr eventtimers 4
 .Sh AUTHORS
-.An Alexander Motin Aq mav@FreeBSD.org
+.An Alexander Motin Aq Mt mav@FreeBSD.org

Modified: head/share/man/man9/fail.9
==============================================================================
--- head/share/man/man9/fail.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/fail.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -191,7 +191,7 @@ Return 5 once, when pid 1234 executes th
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Zach Loafman Aq zml@FreeBSD.org .
+.An Zach Loafman Aq Mt zml@FreeBSD.org .
 .Sh CAVEATS
 It is easy to shoot yourself in the foot by setting fail points too
 aggressively or setting too many in combination.

Modified: head/share/man/man9/firmware.9
==============================================================================
--- head/share/man/man9/firmware.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/firmware.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -269,4 +269,4 @@ system was introduced in
 .Fx 6.1 .
 .Sh AUTHORS
 This manual page was written by
-.An Max Laier Aq mlaier@FreeBSD.org .
+.An Max Laier Aq Mt mlaier@FreeBSD.org .

Modified: head/share/man/man9/g_access.9
==============================================================================
--- head/share/man/man9/g_access.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/g_access.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -162,4 +162,4 @@ Any other error that can be returned by 
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org .
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .

Modified: head/share/man/man9/g_attach.9
==============================================================================
--- head/share/man/man9/g_attach.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/g_attach.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -138,4 +138,4 @@ The operation creates a topology loop.
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org .
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .

Modified: head/share/man/man9/g_bio.9
==============================================================================
--- head/share/man/man9/g_bio.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/g_bio.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -274,4 +274,4 @@ example_start(struct bio *bp)
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org .
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .

Modified: head/share/man/man9/g_consumer.9
==============================================================================
--- head/share/man/man9/g_consumer.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/g_consumer.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -134,4 +134,4 @@ some_function(struct g_geom *mygeom, str
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org .
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .

Modified: head/share/man/man9/g_data.9
==============================================================================
--- head/share/man/man9/g_data.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/g_data.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -119,4 +119,4 @@ An I/O error occurred while reading from
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org .
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .

Modified: head/share/man/man9/g_event.9
==============================================================================
--- head/share/man/man9/g_event.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/g_event.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -186,4 +186,4 @@ and there was insufficient memory.
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org .
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .

Modified: head/share/man/man9/g_geom.9
==============================================================================
--- head/share/man/man9/g_geom.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/g_geom.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -203,4 +203,4 @@ destroy_example_geom(struct g_geom *gp)
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org .
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .

Modified: head/share/man/man9/g_provider.9
==============================================================================
--- head/share/man/man9/g_provider.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/g_provider.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -142,4 +142,4 @@ create_example_provider(struct g_geom *g
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org .
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .

Modified: head/share/man/man9/g_provider_by_name.9
==============================================================================
--- head/share/man/man9/g_provider_by_name.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/g_provider_by_name.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -74,4 +74,4 @@ if there is no such provider.
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org .
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .

Modified: head/share/man/man9/g_wither_geom.9
==============================================================================
--- head/share/man/man9/g_wither_geom.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/g_wither_geom.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -83,4 +83,4 @@ The topology lock has to be held.
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org .
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .

Modified: head/share/man/man9/get_cyclecount.9
==============================================================================
--- head/share/man/man9/get_cyclecount.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/get_cyclecount.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -92,4 +92,4 @@ function first appeared in
 .Fx 5.0 .
 .Sh AUTHORS
 This manual page was written by
-.An Mark Murray Aq markm@FreeBSD.org .
+.An Mark Murray Aq Mt markm@FreeBSD.org .

Modified: head/share/man/man9/getnewvnode.9
==============================================================================
--- head/share/man/man9/getnewvnode.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/getnewvnode.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -66,4 +66,4 @@ returns 0 on success.
 There are currently no failure conditions - that do not result in a panic.
 .Sh AUTHORS
 This manual page was written by
-.An Chad David Aq davidc@acns.ab.ca .
+.An Chad David Aq Mt davidc@acns.ab.ca .

Modified: head/share/man/man9/groupmember.9
==============================================================================
--- head/share/man/man9/groupmember.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/groupmember.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -57,4 +57,4 @@ If the
 is found, 1 is returned; otherwise, 0 is returned.
 .Sh AUTHORS
 This manual page was written by
-.An Chad David Aq davidc@acns.ab.ca .
+.An Chad David Aq Mt davidc@acns.ab.ca .

Modified: head/share/man/man9/hhook.9
==============================================================================
--- head/share/man/man9/hhook.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/hhook.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -374,9 +374,9 @@ http://caia.swin.edu.au/urp/newtcp/
 The
 .Nm
 framework was written by
-.An Lawrence Stewart Aq lstewart@FreeBSD.org .
+.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org .
 .Pp
 This manual page was written by
-.An David Hayes Aq david.hayes@ieee.org
+.An David Hayes Aq Mt david.hayes@ieee.org
 and
-.An Lawrence Stewart Aq lstewart@FreeBSD.org .
+.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org .

Modified: head/share/man/man9/ieee80211_radiotap.9
==============================================================================
--- head/share/man/man9/ieee80211_radiotap.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/ieee80211_radiotap.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -297,6 +297,6 @@ definitions first appeared in
 .Sh AUTHORS
 .An -nosplit
 The original version of this manual page was written by
-.An Bruce M. Simpson Aq bms@FreeBSD.org
+.An Bruce M. Simpson Aq Mt bms@FreeBSD.org
 and
-.An Darron Broad Aq darron@kewl.org .
+.An Darron Broad Aq Mt darron@kewl.org .

Modified: head/share/man/man9/insmntque.9
==============================================================================
--- head/share/man/man9/insmntque.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/insmntque.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -92,4 +92,4 @@ even if the file system is being unmount
 .Xr vgone 9
 .Sh AUTHORS
 This manual page was written by
-.An Chad David Aq davidc@acns.ab.ca .
+.An Chad David Aq Mt davidc@acns.ab.ca .

Modified: head/share/man/man9/kernel_mount.9
==============================================================================
--- head/share/man/man9/kernel_mount.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/kernel_mount.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -206,6 +206,6 @@ appeared in
 The
 .Fn kernel_mount
 family of functions and API was developed by
-.An Poul-Henning Kamp Aq phk@FreeBSD.org .
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org .
 This manual page was written by
-.An Tom Rhodes Aq trhodes@FreeBSD.org .
+.An Tom Rhodes Aq Mt trhodes@FreeBSD.org .

Modified: head/share/man/man9/khelp.9
==============================================================================
--- head/share/man/man9/khelp.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/khelp.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -430,9 +430,9 @@ http://caia.swin.edu.au/urp/newtcp/
 The
 .Nm
 framework was written by
-.An Lawrence Stewart Aq lstewart@FreeBSD.org .
+.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org .
 .Pp
 This manual page was written by
-.An David Hayes Aq david.hayes@ieee.org
+.An David Hayes Aq Mt david.hayes@ieee.org
 and
-.An Lawrence Stewart Aq lstewart@FreeBSD.org .
+.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org .

Modified: head/share/man/man9/kqueue.9
==============================================================================
--- head/share/man/man9/kqueue.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/kqueue.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -463,4 +463,4 @@ by
 .Sh AUTHORS
 This
 manual page was written by
-.An John-Mark Gurney Aq jmg@FreeBSD.org .
+.An John-Mark Gurney Aq Mt jmg@FreeBSD.org .

Modified: head/share/man/man9/lock.9
==============================================================================
--- head/share/man/man9/lock.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/lock.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -397,4 +397,4 @@ will be the result of trying.
 .Xr VOP_PRINT 9
 .Sh AUTHORS
 This manual page was written by
-.An Chad David Aq davidc@acns.ab.ca .
+.An Chad David Aq Mt davidc@acns.ab.ca .

Modified: head/share/man/man9/mbchain.9
==============================================================================
--- head/share/man/man9/mbchain.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/mbchain.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -219,4 +219,4 @@ mb_done(mbp);
 .Xr mdchain 9
 .Sh AUTHORS
 This manual page was written by
-.An Boris Popov Aq bp@FreeBSD.org .
+.An Boris Popov Aq Mt bp@FreeBSD.org .

Modified: head/share/man/man9/mbpool.9
==============================================================================
--- head/share/man/man9/mbpool.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/mbpool.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -255,7 +255,7 @@ the number of buffers on the free list.
 .Sh SEE ALSO
 .Xr mbuf 9
 .Sh AUTHORS
-.An Harti Brandt Aq harti@FreeBSD.org
+.An Harti Brandt Aq Mt harti@FreeBSD.org
 .Sh CAVEATS
 The function
 .Fn mbp_sync

Modified: head/share/man/man9/mbuf_tags.9
==============================================================================
--- head/share/man/man9/mbuf_tags.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/mbuf_tags.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -283,4 +283,4 @@ Inlined functions are defined in
 The packet tags first appeared in
 .Ox 2.9
 and were written by
-.An Angelos D. Keromytis Aq angelos@openbsd.org .
+.An Angelos D. Keromytis Aq Mt angelos@openbsd.org .

Modified: head/share/man/man9/mdchain.9
==============================================================================
--- head/share/man/man9/mdchain.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/mdchain.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -208,4 +208,4 @@ mb_done(mdp);
 .Xr mbuf 9
 .Sh AUTHORS
 This manual page was written by
-.An Boris Popov Aq bp@FreeBSD.org .
+.An Boris Popov Aq Mt bp@FreeBSD.org .

Modified: head/share/man/man9/memguard.9
==============================================================================
--- head/share/man/man9/memguard.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/memguard.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -196,13 +196,13 @@ first appeared in
 .An -nosplit
 .Nm
 was originally written by
-.An Bosko Milekic Aq bmilekic@FreeBSD.org .
+.An Bosko Milekic Aq Mt bmilekic@FreeBSD.org .
 This manual page was originally written by
-.An Christian Brueffer Aq brueffer@FreeBSD.org .
+.An Christian Brueffer Aq Mt brueffer@FreeBSD.org .
 Additions have been made by
-.An Matthew Fleming Aq mdf@FreeBSD.org
+.An Matthew Fleming Aq Mt mdf@FreeBSD.org
 and
-.An Gleb Smirnoff Aq glebius@FreeBSD.org
+.An Gleb Smirnoff Aq Mt glebius@FreeBSD.org
 to both the implementation and the documentation.
 .Sh BUGS
 It is not possible to guard allocations that really expect themselves to be

Modified: head/share/man/man9/microtime.9
==============================================================================
--- head/share/man/man9/microtime.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/microtime.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -118,4 +118,4 @@ but have existed in other incarnations s
 .Bx 4.4 .
 .Sh AUTHORS
 This manual page was written by
-.An Kelly Yancey Aq kbyanc@posi.net .
+.An Kelly Yancey Aq Mt kbyanc@posi.net .

Modified: head/share/man/man9/microuptime.9
==============================================================================
--- head/share/man/man9/microuptime.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/microuptime.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -120,4 +120,4 @@ execution time.
 .Xr tvtohz 9
 .Sh AUTHORS
 This manual page was written by
-.An Kelly Yancey Aq kbyanc@posi.net .
+.An Kelly Yancey Aq Mt kbyanc@posi.net .

Modified: head/share/man/man9/mod_cc.9
==============================================================================
--- head/share/man/man9/mod_cc.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/mod_cc.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -322,12 +322,12 @@ http://caia.swin.edu.au/urp/newtcp/
 The
 .Nm
 framework was written by
-.An Lawrence Stewart Aq lstewart@FreeBSD.org ,
-.An James Healy Aq jimmy@deefa.com
+.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org ,
+.An James Healy Aq Mt jimmy@deefa.com
 and
-.An David Hayes Aq david.hayes@ieee.org .
+.An David Hayes Aq Mt david.hayes@ieee.org .
 .Pp
 This manual page was written by
-.An David Hayes Aq david.hayes@ieee.org
+.An David Hayes Aq Mt david.hayes@ieee.org
 and
-.An Lawrence Stewart Aq lstewart@FreeBSD.org .
+.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org .

Modified: head/share/man/man9/module.9
==============================================================================
--- head/share/man/man9/module.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/module.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -118,4 +118,4 @@ DECLARE_MODULE(foo, mod_data, SI_SUB_EXE
 .Pa /usr/share/examples/kld
 .Sh AUTHORS
 This manual page was written by
-.An Alexander Langer Aq alex@FreeBSD.org .
+.An Alexander Langer Aq Mt alex@FreeBSD.org .

Modified: head/share/man/man9/namei.9
==============================================================================
--- head/share/man/man9/namei.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/namei.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -347,9 +347,9 @@ An attempt is made to modify a file or d
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Eivind Eklund Aq eivind@FreeBSD.org
+.An Eivind Eklund Aq Mt eivind@FreeBSD.org
 and later significantly revised by
-.An Hiten M. Pandya Aq hmp@FreeBSD.org .
+.An Hiten M. Pandya Aq Mt hmp@FreeBSD.org .
 .Sh BUGS
 The
 .Dv LOCKPARENT

Modified: head/share/man/man9/osd.9
==============================================================================
--- head/share/man/man9/osd.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/osd.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -384,7 +384,7 @@ Object Specific Data (OSD) facility firs
 The
 .Nm
 facility was written by
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org .
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org .
 .Pp
 This manual page was written by
-.An Lawrence Stewart Aq lstewart@FreeBSD.org .
+.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org .

Modified: head/share/man/man9/pbuf.9
==============================================================================
--- head/share/man/man9/pbuf.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pbuf.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -129,4 +129,4 @@ In the case of
 can also be returned indicating that there are no buffers available.
 .Sh AUTHORS
 This manual page was written by
-.An Chad David Aq davidc@acns.ab.ca .
+.An Chad David Aq Mt davidc@acns.ab.ca .

Modified: head/share/man/man9/pci.9
==============================================================================
--- head/share/man/man9/pci.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pci.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -695,10 +695,11 @@ space on the target architecture.
 .%O ISBN 0-201-30974-2
 .Re
 .Sh AUTHORS
+.An -nosplit
 This manual page was written by
-.An Bruce M Simpson Aq bms@FreeBSD.org
+.An Bruce M Simpson Aq Mt bms@FreeBSD.org
 and
-.An John Baldwin Aq jhb@FreeBSD.org .
+.An John Baldwin Aq Mt jhb@FreeBSD.org .
 .Sh BUGS
 The kernel PCI code has a number of references to
 .Dq "slot numbers" .

Modified: head/share/man/man9/pfind.9
==============================================================================
--- head/share/man/man9/pfind.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pfind.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -85,4 +85,4 @@ on failure.
 .Xr pgfind 9
 .Sh AUTHORS
 This manual page was written by
-.An Evan Sarmiento Aq kaworu@sektor7.ath.cx .
+.An Evan Sarmiento Aq Mt kaworu@sektor7.ath.cx .

Modified: head/share/man/man9/pgfind.9
==============================================================================
--- head/share/man/man9/pgfind.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pgfind.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -62,4 +62,4 @@ structure on successful completion.
 .Xr pfind 9
 .Sh AUTHORS
 This manual page was written by
-.An Evan Sarmiento Aq kaworu@sektor7.ath.cx .
+.An Evan Sarmiento Aq Mt kaworu@sektor7.ath.cx .

Modified: head/share/man/man9/pmap.9
==============================================================================
--- head/share/man/man9/pmap.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -127,4 +127,4 @@ operation.
 .Xr vm_map 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_activate.9
==============================================================================
--- head/share/man/man9/pmap_activate.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_activate.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -48,4 +48,4 @@ accessed.
 .Xr pmap 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_change_wiring.9
==============================================================================
--- head/share/man/man9/pmap_change_wiring.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_change_wiring.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -65,4 +65,4 @@ function.
 .Xr pmap 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_clear_modify.9
==============================================================================
--- head/share/man/man9/pmap_clear_modify.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_clear_modify.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -60,4 +60,4 @@ bit on the physical page
 .Xr pmap_ts_referenced 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_copy.9
==============================================================================
--- head/share/man/man9/pmap_copy.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_copy.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -81,4 +81,4 @@ routine only operates upon a single page
 .Xr pmap 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_enter.9
==============================================================================
--- head/share/man/man9/pmap_enter.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_enter.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -65,4 +65,4 @@ specification to make the requested entr
 .Xr pmap 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_extract.9
==============================================================================
--- head/share/man/man9/pmap_extract.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_extract.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -90,6 +90,6 @@ be returned.
 The
 .Fn pmap_extract_and_hold
 function was implemented by
-.An Alan L. Cox Aq alc@imimic.com .
+.An Alan L. Cox Aq Mt alc@imimic.com .
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_growkernel.9
==============================================================================
--- head/share/man/man9/pmap_growkernel.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_growkernel.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -48,4 +48,4 @@ It will allocate more page entries if re
 .Xr pmap 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_init.9
==============================================================================
--- head/share/man/man9/pmap_init.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_init.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -62,4 +62,4 @@ excessive numbers of PV entries.
 .Xr pmap 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_is_modified.9
==============================================================================
--- head/share/man/man9/pmap_is_modified.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_is_modified.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -68,4 +68,4 @@ bits set on the page.
 .Xr pmap_clear_reference 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_is_prefaultable.9
==============================================================================
--- head/share/man/man9/pmap_is_prefaultable.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_is_prefaultable.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -54,4 +54,4 @@ This is a helper function which is calle
 .Xr vm_fault_prefault 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_map.9
==============================================================================
--- head/share/man/man9/pmap_map.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_map.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -77,4 +77,4 @@ is returned.
 .Xr pmap 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_mincore.9
==============================================================================
--- head/share/man/man9/pmap_mincore.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_mincore.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -71,4 +71,4 @@ return
 .Xr pmap 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_object_init_pt.9
==============================================================================
--- head/share/man/man9/pmap_object_init_pt.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_object_init_pt.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -70,4 +70,4 @@ startup, and immediately following a cal
 .Xr vm_map 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_page_exists_quick.9
==============================================================================
--- head/share/man/man9/pmap_page_exists_quick.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_page_exists_quick.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -63,4 +63,4 @@ is one of the first 16 PVs linked from t
 .Xr pmap 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_page_init.9
==============================================================================
--- head/share/man/man9/pmap_page_init.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_page_init.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -48,4 +48,4 @@ queue management lists.
 .Xr pmap_pinit 9
 .Sh AUTHORS
 This manual page was written by
-.An Hiten Pandya Aq hmp@FreeBSD.org .
+.An Hiten Pandya Aq Mt hmp@FreeBSD.org .

Modified: head/share/man/man9/pmap_page_protect.9
==============================================================================
--- head/share/man/man9/pmap_page_protect.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_page_protect.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -64,4 +64,4 @@ and
 .Xr pmap 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_pinit.9
==============================================================================
--- head/share/man/man9/pmap_pinit.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_pinit.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -64,4 +64,4 @@ until further notice.
 .Xr pmap_growkernel 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_qenter.9
==============================================================================
--- head/share/man/man9/pmap_qenter.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_qenter.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -76,4 +76,4 @@ function is intended to remove such temp
 .Xr pmap 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_release.9
==============================================================================
--- head/share/man/man9/pmap_release.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_release.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -55,4 +55,4 @@ no longer contains any valid mappings.
 .Xr pmap_pinit 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_remove.9
==============================================================================
--- head/share/man/man9/pmap_remove.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_remove.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -81,4 +81,4 @@ more quickly than would be the case for 
 .Fn pmap 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_resident_count.9
==============================================================================
--- head/share/man/man9/pmap_resident_count.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_resident_count.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -71,4 +71,4 @@ which are currently wired into in main m
 .Xr pmap 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pmap_zero_page.9
==============================================================================
--- head/share/man/man9/pmap_zero_page.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pmap_zero_page.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -69,4 +69,4 @@ This function is required to be implemen
 .Xr pmap 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/pseudofs.9
==============================================================================
--- head/share/man/man9/pseudofs.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/pseudofs.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -67,4 +67,4 @@ module appeared in
 The
 .Nm
 module and this manual page were written by
-.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org .
+.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .

Modified: head/share/man/man9/redzone.9
==============================================================================
--- head/share/man/man9/redzone.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/redzone.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -114,7 +114,7 @@ Free backtrace:
 first appeared in
 .Fx 7.0 .
 .Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
 .Sh BUGS
 Currently,
 .Nm

Modified: head/share/man/man9/resource_int_value.9
==============================================================================
--- head/share/man/man9/resource_int_value.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/resource_int_value.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -76,4 +76,4 @@ Inappropriate resource type.
 .Xr driver 9
 .Sh AUTHORS
 This manual page was written by
-.An Warner Losh Aq imp@FreeBSD.org .
+.An Warner Losh Aq Mt imp@FreeBSD.org .

Modified: head/share/man/man9/rman.9
==============================================================================
--- head/share/man/man9/rman.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/rman.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -469,4 +469,4 @@ function returns a pointer to the device
 .Xr mutex 9
 .Sh AUTHORS
 This manual page was written by
-.An Bruce M Simpson Aq bms@spc.org .
+.An Bruce M Simpson Aq Mt bms@spc.org .

Modified: head/share/man/man9/sbuf.9
==============================================================================
--- head/share/man/man9/sbuf.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/sbuf.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -551,15 +551,15 @@ family of functions first appeared in
 The
 .Nm
 family of functions was designed by
-.An Poul-Henning Kamp Aq phk@FreeBSD.org
+.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org
 and implemented by
-.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org .
+.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .
 Additional improvements were suggested by
-.An Justin T. Gibbs Aq gibbs@FreeBSD.org .
+.An Justin T. Gibbs Aq Mt gibbs@FreeBSD.org .
 Auto-extend support added by
-.An Kelly Yancey Aq kbyanc@FreeBSD.org .
+.An Kelly Yancey Aq Mt kbyanc@FreeBSD.org .
 Drain functionality added by
-.An Matthew Fleming Aq mdf@FreeBSD.org .
+.An Matthew Fleming Aq Mt mdf@FreeBSD.org .
 .Pp
 This manual page was written by
-.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org .
+.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .

Modified: head/share/man/man9/selrecord.9
==============================================================================
--- head/share/man/man9/selrecord.9	Thu Jun 26 21:33:32 2014	(r267935)
+++ head/share/man/man9/selrecord.9	Thu Jun 26 21:44:30 2014	(r267936)
@@ -121,6 +121,6 @@ but consumers should not generally rely 
 .Sh AUTHORS
 .An -nosplit
 This manual page was written by
-.An Chad David Aq davidc@FreeBSD.org
+.An Chad David Aq Mt davidc@FreeBSD.org
 and
-.An Alfred Perlstein Aq alfred@FreeBSD.org .
+.An Alfred Perlstein Aq Mt alfred@FreeBSD.org .

Modified: head/share/man/man9/signal.9
==============================================================================
--- head/share/man/man9/signal.9	Thu Jun 26 21:33:32 2014	(r267935)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 21:45:50 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D5D0B1FD;
 Thu, 26 Jun 2014 21:45:50 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BF3C02BE9;
 Thu, 26 Jun 2014 21:45:50 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QLjog9034769;
 Thu, 26 Jun 2014 21:45:50 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QLjnJH034761;
 Thu, 26 Jun 2014 21:45:49 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201406262145.s5QLjnJH034761@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 26 Jun 2014 21:45:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267937 - in head:
 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs
 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json
 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/...
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 21:45:51 -0000

Author: rpaulo
Date: Thu Jun 26 21:45:49 2014
New Revision: 267937
URL: http://svnweb.freebsd.org/changeset/base/267937

Log:
  MFV illumos
  
  4477 DTrace should speak JSON
  
  MFC after:	2 weeks

Added:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/
     - copied from r266987, vendor/illumos/dist/cmd/dtrace/test/tst/common/json/
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/strtoll/
     - copied from r266987, vendor/illumos/dist/cmd/dtrace/test/tst/common/strtoll/
  head/cddl/contrib/opensolaris/common/util/
     - copied from r267931, vendor/illumos/dist/common/util/
Modified:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh
  head/cddl/contrib/opensolaris/common/util/strtolctype.h
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
  head/sys/modules/dtrace/dtrace/Makefile
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d	Thu Jun 26 21:44:30 2014	(r267936)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d	Thu Jun 26 21:45:49 2014	(r267937)
@@ -22,6 +22,7 @@
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
+ * Copyright (c) 2012, Joyent, Inc.  All rights reserved.
  */
 
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -98,6 +99,8 @@ STRFUNC(inet_ntoa((ipaddr_t *)alloca(siz
 STRFUNC(inet_ntoa6((in6_addr_t *)alloca(sizeof (in6_addr_t))))
 STRFUNC(inet_ntop(AF_INET, (void *)alloca(sizeof (ipaddr_t))))
 INTFUNC(getf(0))
+INTFUNC(strtoll("0x12EE5D5", 16))
+STRFUNC(json("{\"systemtap\": false}", "systemtap"))
 
 BEGIN
 /subr == DIF_SUBR_MAX + 1/

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh	Thu Jun 26 21:44:30 2014	(r267936)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/privs/tst.func_access.ksh	Thu Jun 26 21:45:49 2014	(r267937)
@@ -22,8 +22,8 @@
 #
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
 
 ppriv -s A=basic,dtrace_proc,dtrace_user $$
 
@@ -31,7 +31,7 @@ ppriv -s A=basic,dtrace_proc,dtrace_user
 
 BEGIN {
 	errorcount = 0;
-	expected_errorcount = 23;
+	expected_errorcount = 27;
 }
 
 BEGIN { trace(mutex_owned(&`pidlock)); }
@@ -55,6 +55,8 @@ BEGIN { trace(strtok(`initname, "/")); }
 BEGIN { trace(strtok(NULL, "/")); }
 BEGIN { trace(strtok("foo/bar", `initname)); }
 BEGIN { trace(strtok(NULL, `initname)); }
+BEGIN { trace(strtoll(`initname)); }
+BEGIN { trace(strtoll(`initname, 10)); }
 BEGIN { trace(substr(`initname, 2, 3)); }
 
 BEGIN { trace(ddi_pathname(`top_devinfo, 1)); }
@@ -63,6 +65,9 @@ BEGIN { trace(strjoin("foo", `initname))
 BEGIN { trace(dirname(`initname)); }
 BEGIN { trace(cleanpath(`initname)); }
 
+BEGIN { j = "{\"/sbin/init\":\"uh oh\"}"; trace(json(j, `initname)); }
+BEGIN { trace(json(`initname, "x")); }
+
 ERROR {
 	errorcount++;
 }

Modified: head/cddl/contrib/opensolaris/common/util/strtolctype.h
==============================================================================
--- vendor/illumos/dist/common/util/strtolctype.h	Thu Jun 26 19:48:59 2014	(r267931)
+++ head/cddl/contrib/opensolaris/common/util/strtolctype.h	Thu Jun 26 21:45:49 2014	(r267937)
@@ -44,7 +44,7 @@ extern "C" {
  * safe in probe context.
  */
 
-#if	defined(_KERNEL) || defined(_BOOT)
+#if defined(sun) &&	(defined(_KERNEL) || defined(_BOOT))
 
 #define	isalnum(ch)	(isalpha(ch) || isdigit(ch))
 #define	isalpha(ch)	(isupper(ch) || islower(ch))

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c	Thu Jun 26 21:44:30 2014	(r267936)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c	Thu Jun 26 21:45:49 2014	(r267937)
@@ -123,8 +123,9 @@
 #define	DT_VERS_1_9	DT_VERSION_NUMBER(1, 9, 0)
 #define	DT_VERS_1_9_1	DT_VERSION_NUMBER(1, 9, 1)
 #define	DT_VERS_1_10	DT_VERSION_NUMBER(1, 10, 0)
-#define	DT_VERS_LATEST	DT_VERS_1_10
-#define	DT_VERS_STRING	"Sun D 1.10"
+#define	DT_VERS_1_11	DT_VERSION_NUMBER(1, 11, 0)
+#define	DT_VERS_LATEST	DT_VERS_1_11
+#define	DT_VERS_STRING	"Sun D 1.11"
 
 const dt_version_t _dtrace_versions[] = {
 	DT_VERS_1_0,	/* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */
@@ -147,6 +148,7 @@ const dt_version_t _dtrace_versions[] = 
 	DT_VERS_1_9,	/* D API 1.9 */
 	DT_VERS_1_9_1,	/* D API 1.9.1 */
 	DT_VERS_1_10,	/* D API 1.10 */
+	DT_VERS_1_11,	/* D API 1.11 */
 	0
 };
 
@@ -301,6 +303,8 @@ static const dt_ident_t _dtrace_globals[
 	DT_VERS_1_5, &dt_idops_func, "string(int, void *)" },
 { "ipl", DT_IDENT_SCALAR, 0, DIF_VAR_IPL, DT_ATTR_STABCMN, DT_VERS_1_0,
 	&dt_idops_type, "uint_t" },
+{ "json", DT_IDENT_FUNC, 0, DIF_SUBR_JSON, DT_ATTR_STABCMN, DT_VERS_1_11,
+	&dt_idops_func, "string(const char *, const char *)" },
 { "jstack", DT_IDENT_ACTFUNC, 0, DT_ACT_JSTACK, DT_ATTR_STABCMN, DT_VERS_1_0,
 	&dt_idops_func, "stack(...)" },
 { "lltostr", DT_IDENT_FUNC, 0, DIF_SUBR_LLTOSTR, DT_ATTR_STABCMN, DT_VERS_1_0,
@@ -452,6 +456,8 @@ static const dt_ident_t _dtrace_globals[
 	&dt_idops_func, "string(const char *, const char *)" },
 { "strtok", DT_IDENT_FUNC, 0, DIF_SUBR_STRTOK, DT_ATTR_STABCMN, DT_VERS_1_1,
 	&dt_idops_func, "string(const char *, const char *)" },
+{ "strtoll", DT_IDENT_FUNC, 0, DIF_SUBR_STRTOLL, DT_ATTR_STABCMN, DT_VERS_1_11,
+	&dt_idops_func, "int64_t(const char *, [int])" },
 { "substr", DT_IDENT_FUNC, 0, DIF_SUBR_SUBSTR, DT_ATTR_STABCMN, DT_VERS_1_1,
 	&dt_idops_func, "string(const char *, int, [int])" },
 { "sum", DT_IDENT_AGGFUNC, 0, DTRACEAGG_SUM, DT_ATTR_STABCMN, DT_VERS_1_0,

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Thu Jun 26 21:44:30 2014	(r267936)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Thu Jun 26 21:45:49 2014	(r267937)
@@ -111,6 +111,7 @@
 #include 
 #include 
 #include 
+#include "strtolctype.h"
 
 /* FreeBSD includes: */
 #if !defined(sun)
@@ -967,6 +968,58 @@ dtrace_vcanload(void *src, dtrace_diftyp
 }
 
 /*
+ * Convert a string to a signed integer using safe loads.
+ *
+ * NOTE: This function uses various macros from strtolctype.h to manipulate
+ * digit values, etc -- these have all been checked to ensure they make
+ * no additional function calls.
+ */
+static int64_t
+dtrace_strtoll(char *input, int base, size_t limit)
+{
+	uintptr_t pos = (uintptr_t)input;
+	int64_t val = 0;
+	int x;
+	boolean_t neg = B_FALSE;
+	char c, cc, ccc;
+	uintptr_t end = pos + limit;
+
+	/*
+	 * Consume any whitespace preceding digits.
+	 */
+	while ((c = dtrace_load8(pos)) == ' ' || c == '\t')
+		pos++;
+
+	/*
+	 * Handle an explicit sign if one is present.
+	 */
+	if (c == '-' || c == '+') {
+		if (c == '-')
+			neg = B_TRUE;
+		c = dtrace_load8(++pos);
+	}
+
+	/*
+	 * Check for an explicit hexadecimal prefix ("0x" or "0X") and skip it
+	 * if present.
+	 */
+	if (base == 16 && c == '0' && ((cc = dtrace_load8(pos + 1)) == 'x' ||
+	    cc == 'X') && isxdigit(ccc = dtrace_load8(pos + 2))) {
+		pos += 2;
+		c = ccc;
+	}
+
+	/*
+	 * Read in contiguous digits until the first non-digit character.
+	 */
+	for (; pos < end && c != '\0' && lisalnum(c) && (x = DIGIT(c)) < base;
+	    c = dtrace_load8(++pos))
+		val = val * base + x;
+
+	return (neg ? -val : val);
+}
+
+/*
  * Compare two strings using safe loads.
  */
 static int
@@ -3469,6 +3522,463 @@ dtrace_dif_variable(dtrace_mstate_t *mst
 	}
 }
 
+
+typedef enum dtrace_json_state {
+	DTRACE_JSON_REST = 1,
+	DTRACE_JSON_OBJECT,
+	DTRACE_JSON_STRING,
+	DTRACE_JSON_STRING_ESCAPE,
+	DTRACE_JSON_STRING_ESCAPE_UNICODE,
+	DTRACE_JSON_COLON,
+	DTRACE_JSON_COMMA,
+	DTRACE_JSON_VALUE,
+	DTRACE_JSON_IDENTIFIER,
+	DTRACE_JSON_NUMBER,
+	DTRACE_JSON_NUMBER_FRAC,
+	DTRACE_JSON_NUMBER_EXP,
+	DTRACE_JSON_COLLECT_OBJECT
+} dtrace_json_state_t;
+
+/*
+ * This function possesses just enough knowledge about JSON to extract a single
+ * value from a JSON string and store it in the scratch buffer.  It is able
+ * to extract nested object values, and members of arrays by index.
+ *
+ * elemlist is a list of JSON keys, stored as packed NUL-terminated strings, to
+ * be looked up as we descend into the object tree.  e.g.
+ *
+ *    foo[0].bar.baz[32] --> "foo" NUL "0" NUL "bar" NUL "baz" NUL "32" NUL
+ *       with nelems = 5.
+ *
+ * The run time of this function must be bounded above by strsize to limit the
+ * amount of work done in probe context.  As such, it is implemented as a
+ * simple state machine, reading one character at a time using safe loads
+ * until we find the requested element, hit a parsing error or run off the
+ * end of the object or string.
+ *
+ * As there is no way for a subroutine to return an error without interrupting
+ * clause execution, we simply return NULL in the event of a missing key or any
+ * other error condition.  Each NULL return in this function is commented with
+ * the error condition it represents -- parsing or otherwise.
+ *
+ * The set of states for the state machine closely matches the JSON
+ * specification (http://json.org/).  Briefly:
+ *
+ *   DTRACE_JSON_REST:
+ *     Skip whitespace until we find either a top-level Object, moving
+ *     to DTRACE_JSON_OBJECT; or an Array, moving to DTRACE_JSON_VALUE.
+ *
+ *   DTRACE_JSON_OBJECT:
+ *     Locate the next key String in an Object.  Sets a flag to denote
+ *     the next String as a key string and moves to DTRACE_JSON_STRING.
+ *
+ *   DTRACE_JSON_COLON:
+ *     Skip whitespace until we find the colon that separates key Strings
+ *     from their values.  Once found, move to DTRACE_JSON_VALUE.
+ *
+ *   DTRACE_JSON_VALUE:
+ *     Detects the type of the next value (String, Number, Identifier, Object
+ *     or Array) and routes to the states that process that type.  Here we also
+ *     deal with the element selector list if we are requested to traverse down
+ *     into the object tree.
+ *
+ *   DTRACE_JSON_COMMA:
+ *     Skip whitespace until we find the comma that separates key-value pairs
+ *     in Objects (returning to DTRACE_JSON_OBJECT) or values in Arrays
+ *     (similarly DTRACE_JSON_VALUE).  All following literal value processing
+ *     states return to this state at the end of their value, unless otherwise
+ *     noted.
+ *
+ *   DTRACE_JSON_NUMBER, DTRACE_JSON_NUMBER_FRAC, DTRACE_JSON_NUMBER_EXP:
+ *     Processes a Number literal from the JSON, including any exponent
+ *     component that may be present.  Numbers are returned as strings, which
+ *     may be passed to strtoll() if an integer is required.
+ *
+ *   DTRACE_JSON_IDENTIFIER:
+ *     Processes a "true", "false" or "null" literal in the JSON.
+ *
+ *   DTRACE_JSON_STRING, DTRACE_JSON_STRING_ESCAPE,
+ *   DTRACE_JSON_STRING_ESCAPE_UNICODE:
+ *     Processes a String literal from the JSON, whether the String denotes
+ *     a key, a value or part of a larger Object.  Handles all escape sequences
+ *     present in the specification, including four-digit unicode characters,
+ *     but merely includes the escape sequence without converting it to the
+ *     actual escaped character.  If the String is flagged as a key, we
+ *     move to DTRACE_JSON_COLON rather than DTRACE_JSON_COMMA.
+ *
+ *   DTRACE_JSON_COLLECT_OBJECT:
+ *     This state collects an entire Object (or Array), correctly handling
+ *     embedded strings.  If the full element selector list matches this nested
+ *     object, we return the Object in full as a string.  If not, we use this
+ *     state to skip to the next value at this level and continue processing.
+ *
+ * NOTE: This function uses various macros from strtolctype.h to manipulate
+ * digit values, etc -- these have all been checked to ensure they make
+ * no additional function calls.
+ */
+static char *
+dtrace_json(uint64_t size, uintptr_t json, char *elemlist, int nelems,
+    char *dest)
+{
+	dtrace_json_state_t state = DTRACE_JSON_REST;
+	int64_t array_elem = INT64_MIN;
+	int64_t array_pos = 0;
+	uint8_t escape_unicount = 0;
+	boolean_t string_is_key = B_FALSE;
+	boolean_t collect_object = B_FALSE;
+	boolean_t found_key = B_FALSE;
+	boolean_t in_array = B_FALSE;
+	uint32_t braces = 0, brackets = 0;
+	char *elem = elemlist;
+	char *dd = dest;
+	uintptr_t cur;
+
+	for (cur = json; cur < json + size; cur++) {
+		char cc = dtrace_load8(cur);
+		if (cc == '\0')
+			return (NULL);
+
+		switch (state) {
+		case DTRACE_JSON_REST:
+			if (isspace(cc))
+				break;
+
+			if (cc == '{') {
+				state = DTRACE_JSON_OBJECT;
+				break;
+			}
+
+			if (cc == '[') {
+				in_array = B_TRUE;
+				array_pos = 0;
+				array_elem = dtrace_strtoll(elem, 10, size);
+				found_key = array_elem == 0 ? B_TRUE : B_FALSE;
+				state = DTRACE_JSON_VALUE;
+				break;
+			}
+
+			/*
+			 * ERROR: expected to find a top-level object or array.
+			 */
+			return (NULL);
+		case DTRACE_JSON_OBJECT:
+			if (isspace(cc))
+				break;
+
+			if (cc == '"') {
+				state = DTRACE_JSON_STRING;
+				string_is_key = B_TRUE;
+				break;
+			}
+
+			/*
+			 * ERROR: either the object did not start with a key
+			 * string, or we've run off the end of the object
+			 * without finding the requested key.
+			 */
+			return (NULL);
+		case DTRACE_JSON_STRING:
+			if (cc == '\\') {
+				*dd++ = '\\';
+				state = DTRACE_JSON_STRING_ESCAPE;
+				break;
+			}
+
+			if (cc == '"') {
+				if (collect_object) {
+					/*
+					 * We don't reset the dest here, as
+					 * the string is part of a larger
+					 * object being collected.
+					 */
+					*dd++ = cc;
+					collect_object = B_FALSE;
+					state = DTRACE_JSON_COLLECT_OBJECT;
+					break;
+				}
+				*dd = '\0';
+				dd = dest; /* reset string buffer */
+				if (string_is_key) {
+					if (dtrace_strncmp(dest, elem,
+					    size) == 0)
+						found_key = B_TRUE;
+				} else if (found_key) {
+					if (nelems > 1) {
+						/*
+						 * We expected an object, not
+						 * this string.
+						 */
+						return (NULL);
+					}
+					return (dest);
+				}
+				state = string_is_key ? DTRACE_JSON_COLON :
+				    DTRACE_JSON_COMMA;
+				string_is_key = B_FALSE;
+				break;
+			}
+
+			*dd++ = cc;
+			break;
+		case DTRACE_JSON_STRING_ESCAPE:
+			*dd++ = cc;
+			if (cc == 'u') {
+				escape_unicount = 0;
+				state = DTRACE_JSON_STRING_ESCAPE_UNICODE;
+			} else {
+				state = DTRACE_JSON_STRING;
+			}
+			break;
+		case DTRACE_JSON_STRING_ESCAPE_UNICODE:
+			if (!isxdigit(cc)) {
+				/*
+				 * ERROR: invalid unicode escape, expected
+				 * four valid hexidecimal digits.
+				 */
+				return (NULL);
+			}
+
+			*dd++ = cc;
+			if (++escape_unicount == 4)
+				state = DTRACE_JSON_STRING;
+			break;
+		case DTRACE_JSON_COLON:
+			if (isspace(cc))
+				break;
+
+			if (cc == ':') {
+				state = DTRACE_JSON_VALUE;
+				break;
+			}
+
+			/*
+			 * ERROR: expected a colon.
+			 */
+			return (NULL);
+		case DTRACE_JSON_COMMA:
+			if (isspace(cc))
+				break;
+
+			if (cc == ',') {
+				if (in_array) {
+					state = DTRACE_JSON_VALUE;
+					if (++array_pos == array_elem)
+						found_key = B_TRUE;
+				} else {
+					state = DTRACE_JSON_OBJECT;
+				}
+				break;
+			}
+
+			/*
+			 * ERROR: either we hit an unexpected character, or
+			 * we reached the end of the object or array without
+			 * finding the requested key.
+			 */
+			return (NULL);
+		case DTRACE_JSON_IDENTIFIER:
+			if (islower(cc)) {
+				*dd++ = cc;
+				break;
+			}
+
+			*dd = '\0';
+			dd = dest; /* reset string buffer */
+
+			if (dtrace_strncmp(dest, "true", 5) == 0 ||
+			    dtrace_strncmp(dest, "false", 6) == 0 ||
+			    dtrace_strncmp(dest, "null", 5) == 0) {
+				if (found_key) {
+					if (nelems > 1) {
+						/*
+						 * ERROR: We expected an object,
+						 * not this identifier.
+						 */
+						return (NULL);
+					}
+					return (dest);
+				} else {
+					cur--;
+					state = DTRACE_JSON_COMMA;
+					break;
+				}
+			}
+
+			/*
+			 * ERROR: we did not recognise the identifier as one
+			 * of those in the JSON specification.
+			 */
+			return (NULL);
+		case DTRACE_JSON_NUMBER:
+			if (cc == '.') {
+				*dd++ = cc;
+				state = DTRACE_JSON_NUMBER_FRAC;
+				break;
+			}
+
+			if (cc == 'x' || cc == 'X') {
+				/*
+				 * ERROR: specification explicitly excludes
+				 * hexidecimal or octal numbers.
+				 */
+				return (NULL);
+			}
+
+			/* FALLTHRU */
+		case DTRACE_JSON_NUMBER_FRAC:
+			if (cc == 'e' || cc == 'E') {
+				*dd++ = cc;
+				state = DTRACE_JSON_NUMBER_EXP;
+				break;
+			}
+
+			if (cc == '+' || cc == '-') {
+				/*
+				 * ERROR: expect sign as part of exponent only.
+				 */
+				return (NULL);
+			}
+			/* FALLTHRU */
+		case DTRACE_JSON_NUMBER_EXP:
+			if (isdigit(cc) || cc == '+' || cc == '-') {
+				*dd++ = cc;
+				break;
+			}
+
+			*dd = '\0';
+			dd = dest; /* reset string buffer */
+			if (found_key) {
+				if (nelems > 1) {
+					/*
+					 * ERROR: We expected an object, not
+					 * this number.
+					 */
+					return (NULL);
+				}
+				return (dest);
+			}
+
+			cur--;
+			state = DTRACE_JSON_COMMA;
+			break;
+		case DTRACE_JSON_VALUE:
+			if (isspace(cc))
+				break;
+
+			if (cc == '{' || cc == '[') {
+				if (nelems > 1 && found_key) {
+					in_array = cc == '[' ? B_TRUE : B_FALSE;
+					/*
+					 * If our element selector directs us
+					 * to descend into this nested object,
+					 * then move to the next selector
+					 * element in the list and restart the
+					 * state machine.
+					 */
+					while (*elem != '\0')
+						elem++;
+					elem++; /* skip the inter-element NUL */
+					nelems--;
+					dd = dest;
+					if (in_array) {
+						state = DTRACE_JSON_VALUE;
+						array_pos = 0;
+						array_elem = dtrace_strtoll(
+						    elem, 10, size);
+						found_key = array_elem == 0 ?
+						    B_TRUE : B_FALSE;
+					} else {
+						found_key = B_FALSE;
+						state = DTRACE_JSON_OBJECT;
+					}
+					break;
+				}
+
+				/*
+				 * Otherwise, we wish to either skip this
+				 * nested object or return it in full.
+				 */
+				if (cc == '[')
+					brackets = 1;
+				else
+					braces = 1;
+				*dd++ = cc;
+				state = DTRACE_JSON_COLLECT_OBJECT;
+				break;
+			}
+
+			if (cc == '"') {
+				state = DTRACE_JSON_STRING;
+				break;
+			}
+
+			if (islower(cc)) {
+				/*
+				 * Here we deal with true, false and null.
+				 */
+				*dd++ = cc;
+				state = DTRACE_JSON_IDENTIFIER;
+				break;
+			}
+
+			if (cc == '-' || isdigit(cc)) {
+				*dd++ = cc;
+				state = DTRACE_JSON_NUMBER;
+				break;
+			}
+
+			/*
+			 * ERROR: unexpected character at start of value.
+			 */
+			return (NULL);
+		case DTRACE_JSON_COLLECT_OBJECT:
+			if (cc == '\0')
+				/*
+				 * ERROR: unexpected end of input.
+				 */
+				return (NULL);
+
+			*dd++ = cc;
+			if (cc == '"') {
+				collect_object = B_TRUE;
+				state = DTRACE_JSON_STRING;
+				break;
+			}
+
+			if (cc == ']') {
+				if (brackets-- == 0) {
+					/*
+					 * ERROR: unbalanced brackets.
+					 */
+					return (NULL);
+				}
+			} else if (cc == '}') {
+				if (braces-- == 0) {
+					/*
+					 * ERROR: unbalanced braces.
+					 */
+					return (NULL);
+				}
+			} else if (cc == '{') {
+				braces++;
+			} else if (cc == '[') {
+				brackets++;
+			}
+
+			if (brackets == 0 && braces == 0) {
+				if (found_key) {
+					*dd = '\0';
+					return (dest);
+				}
+				dd = dest; /* reset string buffer */
+				state = DTRACE_JSON_COMMA;
+			}
+			break;
+		}
+	}
+	return (NULL);
+}
+
 /*
  * Emulate the execution of DTrace ID subroutines invoked by the call opcode.
  * Notice that we don't bother validating the proper number of arguments or
@@ -4265,6 +4775,65 @@ dtrace_dif_subr(uint_t subr, uint_t rd, 
 		break;
 	}
 
+	case DIF_SUBR_JSON: {
+		uint64_t size = state->dts_options[DTRACEOPT_STRSIZE];
+		uintptr_t json = tupregs[0].dttk_value;
+		size_t jsonlen = dtrace_strlen((char *)json, size);
+		uintptr_t elem = tupregs[1].dttk_value;
+		size_t elemlen = dtrace_strlen((char *)elem, size);
+
+		char *dest = (char *)mstate->dtms_scratch_ptr;
+		char *elemlist = (char *)mstate->dtms_scratch_ptr + jsonlen + 1;
+		char *ee = elemlist;
+		int nelems = 1;
+		uintptr_t cur;
+
+		if (!dtrace_canload(json, jsonlen + 1, mstate, vstate) ||
+		    !dtrace_canload(elem, elemlen + 1, mstate, vstate)) {
+			regs[rd] = 0;
+			break;
+		}
+
+		if (!DTRACE_INSCRATCH(mstate, jsonlen + 1 + elemlen + 1)) {
+			DTRACE_CPUFLAG_SET(CPU_DTRACE_NOSCRATCH);
+			regs[rd] = 0;
+			break;
+		}
+
+		/*
+		 * Read the element selector and split it up into a packed list
+		 * of strings.
+		 */
+		for (cur = elem; cur < elem + elemlen; cur++) {
+			char cc = dtrace_load8(cur);
+
+			if (cur == elem && cc == '[') {
+				/*
+				 * If the first element selector key is
+				 * actually an array index then ignore the
+				 * bracket.
+				 */
+				continue;
+			}
+
+			if (cc == ']')
+				continue;
+
+			if (cc == '.' || cc == '[') {
+				nelems++;
+				cc = '\0';
+			}
+
+			*ee++ = cc;
+		}
+		*ee++ = '\0';
+
+		if ((regs[rd] = (uintptr_t)dtrace_json(size, json, elemlist,
+		    nelems, dest)) != 0)
+			mstate->dtms_scratch_ptr += jsonlen + 1;
+		break;
+	}
+
 	case DIF_SUBR_TOUPPER:
 	case DIF_SUBR_TOLOWER: {
 		uintptr_t s = tupregs[0].dttk_value;
@@ -4574,6 +5143,28 @@ dtrace_dif_subr(uint_t subr, uint_t rd, 
 		break;
 	}
 
+	case DIF_SUBR_STRTOLL: {
+		uintptr_t s = tupregs[0].dttk_value;
+		uint64_t size = state->dts_options[DTRACEOPT_STRSIZE];
+		int base = 10;
+
+		if (nargs > 1) {
+			if ((base = tupregs[1].dttk_value) <= 1 ||
+			    base > ('z' - 'a' + 1) + ('9' - '0' + 1)) {
+				*flags |= CPU_DTRACE_ILLOP;
+				break;
+			}
+		}
+
+		if (!dtrace_strcanload(s, size, mstate, vstate)) {
+			regs[rd] = INT64_MIN;
+			break;
+		}
+
+		regs[rd] = dtrace_strtoll((char *)s, base, size);
+		break;
+	}
+
 	case DIF_SUBR_LLTOSTR: {
 		int64_t i = (int64_t)tupregs[0].dttk_value;
 		uint64_t val, digit;
@@ -9373,7 +9964,9 @@ dtrace_difo_validate_helper(dtrace_difo_
 			    subr == DIF_SUBR_INET_NTOA ||
 			    subr == DIF_SUBR_INET_NTOA6 ||
 			    subr == DIF_SUBR_INET_NTOP ||
+			    subr == DIF_SUBR_JSON ||
 			    subr == DIF_SUBR_LLTOSTR ||
+			    subr == DIF_SUBR_STRTOLL ||
 			    subr == DIF_SUBR_RINDEX ||
 			    subr == DIF_SUBR_STRCHR ||
 			    subr == DIF_SUBR_STRJOIN ||

Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h	Thu Jun 26 21:44:30 2014	(r267936)
+++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h	Thu Jun 26 21:45:49 2014	(r267937)
@@ -313,7 +313,9 @@ typedef enum dtrace_probespec {
 #define	DIF_SUBR_SX_ISEXCLUSIVE		50
 #define	DIF_SUBR_MEMSTR			51
 #define	DIF_SUBR_GETF			52
-#define	DIF_SUBR_MAX			52	/* max subroutine value */
+#define	DIF_SUBR_JSON			53
+#define	DIF_SUBR_STRTOLL		54
+#define	DIF_SUBR_MAX			54	/* max subroutine value */
 
 typedef uint32_t dif_instr_t;
 

Modified: head/sys/modules/dtrace/dtrace/Makefile
==============================================================================
--- head/sys/modules/dtrace/dtrace/Makefile	Thu Jun 26 21:44:30 2014	(r267936)
+++ head/sys/modules/dtrace/dtrace/Makefile	Thu Jun 26 21:45:49 2014	(r267937)
@@ -4,6 +4,8 @@ SYSDIR?=	${.CURDIR}/../../..
 
 ARCHDIR=	${MACHINE_CPUARCH}
 
+SUNW=	${.CURDIR}/../../../../cddl/contrib/opensolaris
+
 .PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace
 .PATH: ${SYSDIR}/cddl/compat/opensolaris/kern
 .PATH: ${SYSDIR}/cddl/kern
@@ -20,7 +22,8 @@ SRCS=		dtrace.c \
 SRCS+=		dis_tables.c \
 		instr_size.c
 CFLAGS+=	-I${SYSDIR}/cddl/contrib/opensolaris/uts/intel \
-		-I${SYSDIR}/cddl/dev/dtrace/x86
+		-I${SYSDIR}/cddl/dev/dtrace/x86 \
+		-I${SUNW}/common/util
 .endif
 
 SRCS+=		bus_if.h device_if.h vnode_if.h

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 21:46:31 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 34D89351;
 Thu, 26 Jun 2014 21:46:31 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1ECAC2BF8;
 Thu, 26 Jun 2014 21:46:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QLkUoe035016;
 Thu, 26 Jun 2014 21:46:30 GMT (envelope-from bapt@svn.freebsd.org)
Received: (from bapt@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QLkE9U034905;
 Thu, 26 Jun 2014 21:46:14 GMT (envelope-from bapt@svn.freebsd.org)
Message-Id: <201406262146.s5QLkE9U034905@svn.freebsd.org>
From: Baptiste Daroussin 
Date: Thu, 26 Jun 2014 21:46:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267938 - in head/share/man/man4: . man4.arm man4.i386
 man4.powerpc man4.sparc64
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 21:46:31 -0000

Author: bapt
Date: Thu Jun 26 21:46:14 2014
New Revision: 267938
URL: http://svnweb.freebsd.org/changeset/base/267938

Log:
  use .Mt to mark up email addresses consistently (final part)
  
  PR:		191174
  Submitted by:	Franco Fichtner 

Modified:
  head/share/man/man4/aac.4
  head/share/man/man4/aacraid.4
  head/share/man/man4/acpi.4
  head/share/man/man4/acpi_asus.4
  head/share/man/man4/acpi_asus_wmi.4
  head/share/man/man4/acpi_dock.4
  head/share/man/man4/acpi_fujitsu.4
  head/share/man/man4/acpi_hp.4
  head/share/man/man4/acpi_ibm.4
  head/share/man/man4/acpi_panasonic.4
  head/share/man/man4/acpi_rapidstart.4
  head/share/man/man4/acpi_sony.4
  head/share/man/man4/acpi_toshiba.4
  head/share/man/man4/acpi_video.4
  head/share/man/man4/acpi_wmi.4
  head/share/man/man4/ada.4
  head/share/man/man4/ae.4
  head/share/man/man4/aesni.4
  head/share/man/man4/age.4
  head/share/man/man4/ahci.4
  head/share/man/man4/aibs.4
  head/share/man/man4/alc.4
  head/share/man/man4/ale.4
  head/share/man/man4/alpm.4
  head/share/man/man4/amdpm.4
  head/share/man/man4/amdsbwd.4
  head/share/man/man4/amdsmb.4
  head/share/man/man4/amdtemp.4
  head/share/man/man4/amr.4
  head/share/man/man4/an.4
  head/share/man/man4/aout.4
  head/share/man/man4/arcmsr.4
  head/share/man/man4/asmc.4
  head/share/man/man4/asr.4
  head/share/man/man4/ata.4
  head/share/man/man4/atkbd.4
  head/share/man/man4/atkbdc.4
  head/share/man/man4/atp.4
  head/share/man/man4/audit.4
  head/share/man/man4/auditpipe.4
  head/share/man/man4/aue.4
  head/share/man/man4/axe.4
  head/share/man/man4/axge.4
  head/share/man/man4/bce.4
  head/share/man/man4/bge.4
  head/share/man/man4/bhyve.4
  head/share/man/man4/bktr.4
  head/share/man/man4/bridge.4
  head/share/man/man4/bwn.4
  head/share/man/man4/bxe.4
  head/share/man/man4/capsicum.4
  head/share/man/man4/cas.4
  head/share/man/man4/cc_cdg.4
  head/share/man/man4/cc_chd.4
  head/share/man/man4/cc_cubic.4
  head/share/man/man4/cc_hd.4
  head/share/man/man4/cc_htcp.4
  head/share/man/man4/cc_newreno.4
  head/share/man/man4/cc_vegas.4
  head/share/man/man4/cdce.4
  head/share/man/man4/ch.4
  head/share/man/man4/ciss.4
  head/share/man/man4/cm.4
  head/share/man/man4/cmx.4
  head/share/man/man4/coretemp.4
  head/share/man/man4/cpuctl.4
  head/share/man/man4/ctl.4
  head/share/man/man4/cue.4
  head/share/man/man4/cxgb.4
  head/share/man/man4/cxgbe.4
  head/share/man/man4/dc.4
  head/share/man/man4/dcons.4
  head/share/man/man4/dcons_crom.4
  head/share/man/man4/divert.4
  head/share/man/man4/dummynet.4
  head/share/man/man4/em.4
  head/share/man/man4/esp.4
  head/share/man/man4/est.4
  head/share/man/man4/et.4
  head/share/man/man4/fatm.4
  head/share/man/man4/ffclock.4
  head/share/man/man4/full.4
  head/share/man/man4/gbde.4
  head/share/man/man4/gdb.4
  head/share/man/man4/gem.4
  head/share/man/man4/geom.4
  head/share/man/man4/geom_fox.4
  head/share/man/man4/geom_linux_lvm.4
  head/share/man/man4/geom_map.4
  head/share/man/man4/geom_uncompress.4
  head/share/man/man4/geom_uzip.4
  head/share/man/man4/gpio.4
  head/share/man/man4/gre.4
  head/share/man/man4/h_ertt.4
  head/share/man/man4/hatm.4
  head/share/man/man4/hme.4
  head/share/man/man4/hpt27xx.4
  head/share/man/man4/hptnr.4
  head/share/man/man4/hv_ata_pci_disengage.4
  head/share/man/man4/hv_kvp.4
  head/share/man/man4/hv_netvsc.4
  head/share/man/man4/hv_storvsc.4
  head/share/man/man4/hv_utils.4
  head/share/man/man4/hv_vmbus.4
  head/share/man/man4/hwpmc.4
  head/share/man/man4/ichsmb.4
  head/share/man/man4/ichwd.4
  head/share/man/man4/ida.4
  head/share/man/man4/igb.4
  head/share/man/man4/iir.4
  head/share/man/man4/intpm.4
  head/share/man/man4/ipmi.4
  head/share/man/man4/ips.4
  head/share/man/man4/ipw.4
  head/share/man/man4/isci.4
  head/share/man/man4/ismt.4
  head/share/man/man4/iwi.4
  head/share/man/man4/iwn.4
  head/share/man/man4/ixgb.4
  head/share/man/man4/ixgbe.4
  head/share/man/man4/jme.4
  head/share/man/man4/joy.4
  head/share/man/man4/kbdmux.4
  head/share/man/man4/keyboard.4
  head/share/man/man4/kld.4
  head/share/man/man4/ksyms.4
  head/share/man/man4/kue.4
  head/share/man/man4/lagg.4
  head/share/man/man4/le.4
  head/share/man/man4/led.4
  head/share/man/man4/lge.4
  head/share/man/man4/lm75.4
  head/share/man/man4/lmc.4
  head/share/man/man4/mac_bsdextended.4
  head/share/man/man4/man4.arm/ti_adc.4
  head/share/man/man4/man4.i386/CPU_ELAN.4
  head/share/man/man4/man4.i386/ct.4
  head/share/man/man4/man4.i386/fe.4
  head/share/man/man4/man4.i386/glxiic.4
  head/share/man/man4/man4.i386/glxsb.4
  head/share/man/man4/man4.i386/longrun.4
  head/share/man/man4/man4.i386/pae.4
  head/share/man/man4/man4.i386/pbio.4
  head/share/man/man4/man4.i386/smapi.4
  head/share/man/man4/man4.i386/snc.4
  head/share/man/man4/man4.i386/vpd.4
  head/share/man/man4/man4.i386/vx.4
  head/share/man/man4/man4.powerpc/adb.4
  head/share/man/man4/man4.powerpc/akbd.4
  head/share/man/man4/man4.powerpc/ams.4
  head/share/man/man4/man4.powerpc/bm.4
  head/share/man/man4/man4.powerpc/cuda.4
  head/share/man/man4/man4.powerpc/pmu.4
  head/share/man/man4/man4.powerpc/powermac_nvram.4
  head/share/man/man4/man4.powerpc/smu.4
  head/share/man/man4/man4.powerpc/snd_ai2s.4
  head/share/man/man4/man4.powerpc/snd_davbus.4
  head/share/man/man4/man4.sparc64/auxio.4
  head/share/man/man4/man4.sparc64/central.4
  head/share/man/man4/man4.sparc64/clkbrd.4
  head/share/man/man4/man4.sparc64/creator.4
  head/share/man/man4/man4.sparc64/ebus.4
  head/share/man/man4/man4.sparc64/eeprom.4
  head/share/man/man4/man4.sparc64/fhc.4
  head/share/man/man4/man4.sparc64/machfb.4
  head/share/man/man4/man4.sparc64/ofw_console.4
  head/share/man/man4/man4.sparc64/openfirm.4
  head/share/man/man4/man4.sparc64/openprom.4
  head/share/man/man4/man4.sparc64/rtc.4
  head/share/man/man4/man4.sparc64/sbus.4
  head/share/man/man4/man4.sparc64/snd_audiocs.4
  head/share/man/man4/md.4
  head/share/man/man4/meteor.4
  head/share/man/man4/mfi.4
  head/share/man/man4/miibus.4
  head/share/man/man4/mk48txx.4
  head/share/man/man4/mlx.4
  head/share/man/man4/mly.4
  head/share/man/man4/mn.4
  head/share/man/man4/mod_cc.4
  head/share/man/man4/mouse.4
  head/share/man/man4/mpr.4
  head/share/man/man4/mps.4
  head/share/man/man4/mpt.4
  head/share/man/man4/mrsas.4
  head/share/man/man4/msk.4
  head/share/man/man4/mvs.4
  head/share/man/man4/mxge.4
  head/share/man/man4/my.4
  head/share/man/man4/nand.4
  head/share/man/man4/nandsim.4
  head/share/man/man4/ncv.4
  head/share/man/man4/ndis.4
  head/share/man/man4/netgraph.4
  head/share/man/man4/nfe.4
  head/share/man/man4/nfsmb.4
  head/share/man/man4/ng_UI.4
  head/share/man/man4/ng_async.4
  head/share/man/man4/ng_atm.4
  head/share/man/man4/ng_atmllc.4
  head/share/man/man4/ng_bluetooth.4
  head/share/man/man4/ng_bpf.4
  head/share/man/man4/ng_bridge.4
  head/share/man/man4/ng_bt3c.4
  head/share/man/man4/ng_btsocket.4
  head/share/man/man4/ng_car.4
  head/share/man/man4/ng_ccatm.4
  head/share/man/man4/ng_cisco.4
  head/share/man/man4/ng_deflate.4
  head/share/man/man4/ng_device.4
  head/share/man/man4/ng_echo.4
  head/share/man/man4/ng_etf.4
  head/share/man/man4/ng_ether.4
  head/share/man/man4/ng_ether_echo.4
  head/share/man/man4/ng_frame_relay.4
  head/share/man/man4/ng_gif.4
  head/share/man/man4/ng_gif_demux.4
  head/share/man/man4/ng_h4.4
  head/share/man/man4/ng_hci.4
  head/share/man/man4/ng_hole.4
  head/share/man/man4/ng_hub.4
  head/share/man/man4/ng_iface.4
  head/share/man/man4/ng_ip_input.4
  head/share/man/man4/ng_ipfw.4
  head/share/man/man4/ng_ksocket.4
  head/share/man/man4/ng_l2cap.4
  head/share/man/man4/ng_l2tp.4
  head/share/man/man4/ng_lmi.4
  head/share/man/man4/ng_mppc.4
  head/share/man/man4/ng_nat.4
  head/share/man/man4/ng_netflow.4
  head/share/man/man4/ng_one2many.4
  head/share/man/man4/ng_patch.4
  head/share/man/man4/ng_ppp.4
  head/share/man/man4/ng_pppoe.4
  head/share/man/man4/ng_pptpgre.4
  head/share/man/man4/ng_pred1.4
  head/share/man/man4/ng_rfc1490.4
  head/share/man/man4/ng_socket.4
  head/share/man/man4/ng_split.4
  head/share/man/man4/ng_sppp.4
  head/share/man/man4/ng_sscfu.4
  head/share/man/man4/ng_sscop.4
  head/share/man/man4/ng_tag.4
  head/share/man/man4/ng_tcpmss.4
  head/share/man/man4/ng_tee.4
  head/share/man/man4/ng_tty.4
  head/share/man/man4/ng_ubt.4
  head/share/man/man4/ng_uni.4
  head/share/man/man4/ng_vjc.4
  head/share/man/man4/ng_vlan.4
  head/share/man/man4/ngatmbase.4
  head/share/man/man4/nge.4
  head/share/man/man4/nsp.4
  head/share/man/man4/ntb.4
  head/share/man/man4/nvd.4
  head/share/man/man4/nvme.4
  head/share/man/man4/nvram2env.4
  head/share/man/man4/nxge.4
  head/share/man/man4/ohci.4
  head/share/man/man4/orm.4
  head/share/man/man4/padlock.4
  head/share/man/man4/pass.4
  head/share/man/man4/patm.4
  head/share/man/man4/pci.4
  head/share/man/man4/pcm.4
  head/share/man/man4/pcn.4
  head/share/man/man4/polling.4
  head/share/man/man4/procdesc.4
  head/share/man/man4/proto.4
  head/share/man/man4/psm.4
  head/share/man/man4/pst.4
  head/share/man/man4/qlxgb.4
  head/share/man/man4/qlxgbe.4
  head/share/man/man4/qlxge.4
  head/share/man/man4/ral.4
  head/share/man/man4/rc.4
  head/share/man/man4/re.4
  head/share/man/man4/rights.4
  head/share/man/man4/rl.4
  head/share/man/man4/rp.4
  head/share/man/man4/rsu.4
  head/share/man/man4/rue.4
  head/share/man/man4/rum.4
  head/share/man/man4/run.4
  head/share/man/man4/scc.4
  head/share/man/man4/sched_ule.4
  head/share/man/man4/screen.4
  head/share/man/man4/scsi.4
  head/share/man/man4/sdhci.4
  head/share/man/man4/send.4
  head/share/man/man4/sf.4
  head/share/man/man4/sge.4
  head/share/man/man4/si.4
  head/share/man/man4/siba.4
  head/share/man/man4/siftr.4
  head/share/man/man4/siis.4
  head/share/man/man4/sis.4
  head/share/man/man4/sk.4
  head/share/man/man4/smp.4
  head/share/man/man4/snd_ad1816.4
  head/share/man/man4/snd_als4000.4
  head/share/man/man4/snd_atiixp.4
  head/share/man/man4/snd_cmi.4
  head/share/man/man4/snd_cs4281.4
  head/share/man/man4/snd_csa.4
  head/share/man/man4/snd_ds1.4
  head/share/man/man4/snd_emu10k1.4
  head/share/man/man4/snd_emu10kx.4
  head/share/man/man4/snd_envy24.4
  head/share/man/man4/snd_envy24ht.4
  head/share/man/man4/snd_es137x.4
  head/share/man/man4/snd_ess.4
  head/share/man/man4/snd_fm801.4
  head/share/man/man4/snd_gusc.4
  head/share/man/man4/snd_hda.4
  head/share/man/man4/snd_ich.4
  head/share/man/man4/snd_maestro.4
  head/share/man/man4/snd_maestro3.4
  head/share/man/man4/snd_mss.4
  head/share/man/man4/snd_neomagic.4
  head/share/man/man4/snd_sbc.4
  head/share/man/man4/snd_solo.4
  head/share/man/man4/snd_spicds.4
  head/share/man/man4/snd_t4dwave.4
  head/share/man/man4/snd_uaudio.4
  head/share/man/man4/snd_via8233.4
  head/share/man/man4/snd_via82c686.4
  head/share/man/man4/snd_vibes.4
  head/share/man/man4/snp.4
  head/share/man/man4/spic.4
  head/share/man/man4/spkr.4
  head/share/man/man4/splash.4
  head/share/man/man4/sppp.4
  head/share/man/man4/ste.4
  head/share/man/man4/stge.4
  head/share/man/man4/syncache.4
  head/share/man/man4/syscons.4
  head/share/man/man4/sysmouse.4
  head/share/man/man4/targ.4
  head/share/man/man4/tdfx.4
  head/share/man/man4/ti.4
  head/share/man/man4/tl.4
  head/share/man/man4/trm.4
  head/share/man/man4/twa.4
  head/share/man/man4/twe.4
  head/share/man/man4/tws.4
  head/share/man/man4/u3g.4
  head/share/man/man4/uark.4
  head/share/man/man4/uart.4
  head/share/man/man4/uath.4
  head/share/man/man4/ubsa.4
  head/share/man/man4/ubtbcmfw.4
  head/share/man/man4/ucom.4
  head/share/man/man4/ucycom.4
  head/share/man/man4/udav.4
  head/share/man/man4/udbp.4
  head/share/man/man4/uep.4
  head/share/man/man4/ufm.4
  head/share/man/man4/uhci.4
  head/share/man/man4/uhid.4
  head/share/man/man4/uhso.4
  head/share/man/man4/ukbd.4
  head/share/man/man4/ulpt.4
  head/share/man/man4/umass.4
  head/share/man/man4/umcs.4
  head/share/man/man4/umct.4
  head/share/man/man4/umodem.4
  head/share/man/man4/ums.4
  head/share/man/man4/upgt.4
  head/share/man/man4/uplcom.4
  head/share/man/man4/ural.4
  head/share/man/man4/urio.4
  head/share/man/man4/urtw.4
  head/share/man/man4/urtwn.4
  head/share/man/man4/usb.4
  head/share/man/man4/usb_quirk.4
  head/share/man/man4/usb_template.4
  head/share/man/man4/uslcom.4
  head/share/man/man4/utopia.4
  head/share/man/man4/uvisor.4
  head/share/man/man4/uvscom.4
  head/share/man/man4/vga.4
  head/share/man/man4/vge.4
  head/share/man/man4/viapm.4
  head/share/man/man4/viawd.4
  head/share/man/man4/virtio.4
  head/share/man/man4/virtio_balloon.4
  head/share/man/man4/virtio_blk.4
  head/share/man/man4/virtio_random.4
  head/share/man/man4/virtio_scsi.4
  head/share/man/man4/vkbd.4
  head/share/man/man4/vmx.4
  head/share/man/man4/vr.4
  head/share/man/man4/vt.4
  head/share/man/man4/vte.4
  head/share/man/man4/vtnet.4
  head/share/man/man4/vxge.4
  head/share/man/man4/watchdog.4
  head/share/man/man4/wb.4
  head/share/man/man4/wbwd.4
  head/share/man/man4/wi.4
  head/share/man/man4/wlan.4
  head/share/man/man4/wpi.4
  head/share/man/man4/wsp.4
  head/share/man/man4/xe.4
  head/share/man/man4/xen.4
  head/share/man/man4/xl.4
  head/share/man/man4/xnb.4
  head/share/man/man4/xpt.4
  head/share/man/man4/zyd.4

Modified: head/share/man/man4/aac.4
==============================================================================
--- head/share/man/man4/aac.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/aac.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -289,10 +289,8 @@ The
 driver first appeared in
 .Fx 4.3 .
 .Sh AUTHORS
-.An Mike Smith
-.Aq msmith@FreeBSD.org
-.An Scott Long
-.Aq scottl@FreeBSD.org
+.An Mike Smith Aq Mt msmith@FreeBSD.org
+.An Scott Long Aq Mt scottl@FreeBSD.org
 .Sh BUGS
 This driver is not compatible with Dell controllers that have version 1.x
 firmware.

Modified: head/share/man/man4/aacraid.4
==============================================================================
--- head/share/man/man4/aacraid.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/aacraid.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -128,11 +128,8 @@ and are also queued for retrieval by a m
 .Xr scsi 4 ,
 .Xr kldload 8
 .Sh AUTHORS
-.An Achim Leubner
-.Aq achim@FreeBSD.org
-.An Ed Maste
-.Aq emaste@FreeBSD.org
-.An Scott Long
-.Aq scottl@FreeBSD.org
+.An Achim Leubner Aq Mt achim@FreeBSD.org
+.An Ed Maste Aq Mt emaste@FreeBSD.org
+.An Scott Long Aq Mt scottl@FreeBSD.org
 .Sh BUGS
 The controller is not actually paused on suspend/resume.

Modified: head/share/man/man4/acpi.4
==============================================================================
--- head/share/man/man4/acpi.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/acpi.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -609,16 +609,16 @@ The following people made notable contri
 in
 .Fx :
 .An Michael Smith ,
-.An Takanori Watanabe Aq takawata@jp.FreeBSD.org ,
-.An Mitsuru IWASAKI Aq iwasaki@jp.FreeBSD.org ,
+.An Takanori Watanabe Aq Mt takawata@jp.FreeBSD.org ,
+.An Mitsuru IWASAKI Aq Mt iwasaki@jp.FreeBSD.org ,
 .An Munehiro Matsuda ,
 .An Nate Lawson ,
 the ACPI-jp mailing list at
-.Aq acpi-jp@jp.FreeBSD.org ,
+.Aq Mt acpi-jp@jp.FreeBSD.org ,
 and many other contributors.
 .Pp
 This manual page was written by
-.An Michael Smith Aq msmith@FreeBSD.org .
+.An Michael Smith Aq Mt msmith@FreeBSD.org .
 .Sh BUGS
 Many BIOS versions have serious bugs that may cause system instability,
 break suspend/resume, or prevent devices from operating properly due to

Modified: head/share/man/man4/acpi_asus.4
==============================================================================
--- head/share/man/man4/acpi_asus.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/acpi_asus.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -175,7 +175,7 @@ driver first appeared in
 The
 .Nm
 driver and this manual page were written by
-.An Philip Paeps Aq philip@FreeBSD.org .
+.An Philip Paeps Aq Mt philip@FreeBSD.org .
 .Pp
 Inspiration came from the
 .Em acpi4asus project

Modified: head/share/man/man4/acpi_asus_wmi.4
==============================================================================
--- head/share/man/man4/acpi_asus_wmi.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/acpi_asus_wmi.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -87,4 +87,4 @@ The
 driver first appeared in
 .Fx 10.0 .
 .Sh AUTHORS
-.An Alexander Motin Aq mav@FreeBSD.org .
+.An Alexander Motin Aq Mt mav@FreeBSD.org

Modified: head/share/man/man4/acpi_dock.4
==============================================================================
--- head/share/man/man4/acpi_dock.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/acpi_dock.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -59,4 +59,4 @@ device driver first appeared in
 The
 .Nm
 device driver was written by
-.An Mitsuru IWASAKI Aq iwasaki@FreeBSD.org .
+.An Mitsuru IWASAKI Aq Mt iwasaki@FreeBSD.org .

Modified: head/share/man/man4/acpi_fujitsu.4
==============================================================================
--- head/share/man/man4/acpi_fujitsu.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/acpi_fujitsu.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -166,10 +166,10 @@ driver first appeared in
 The
 .Nm
 driver was written by
-.An Sean Bullington Aq shegget@gmail.com ,
-.An Anish Mistry Aq mistry.7@osu.edu ,
+.An Sean Bullington Aq Mt shegget@gmail.com ,
+.An Anish Mistry Aq Mt mistry.7@osu.edu ,
 and
-.An Marc Santcroos Aq marks@ripe.net .
+.An Marc Santcroos Aq Mt marks@ripe.net .
 .Pp
 This manual page was written by
-.An Philip Paeps Aq philip@FreeBSD.org .
+.An Philip Paeps Aq Mt philip@FreeBSD.org .

Modified: head/share/man/man4/acpi_hp.4
==============================================================================
--- head/share/man/man4/acpi_hp.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/acpi_hp.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -261,7 +261,7 @@ device driver first appeared in
 The
 .Nm
 driver was written by
-.An Michael Gmelin Aq freebsd@grem.de .
+.An Michael Gmelin Aq Mt freebsd@grem.de .
 .Pp
 It has been inspired by hp-wmi driver, which implements a subset of these
 features (hotkeys) on Linux.
@@ -275,7 +275,7 @@ http://www.microsoft.com/whdc/system/pnp
 .El
 .Pp
 This manual page was written by
-.An Michael Gmelin Aq freebsd@grem.de .
+.An Michael Gmelin Aq Mt freebsd@grem.de .
 .Sh BUGS
 This driver is experimental and has only been tested on i386 on an
 HP Compaq 8510p which featured all supported wireless devices (WWAN/BT/WLAN).

Modified: head/share/man/man4/acpi_ibm.4
==============================================================================
--- head/share/man/man4/acpi_ibm.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/acpi_ibm.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -476,10 +476,10 @@ device driver first appeared in
 The
 .Nm
 driver was written by
-.An Takanori Watanabe Aq takawata@FreeBSD.org
+.An Takanori Watanabe Aq Mt takawata@FreeBSD.org
 and later mostly rewritten by
-.An Markus Brueffer Aq markus@FreeBSD.org .
+.An Markus Brueffer Aq Mt markus@FreeBSD.org .
 This manual page was written by
-.An Christian Brueffer Aq brueffer@FreeBSD.org
+.An Christian Brueffer Aq Mt brueffer@FreeBSD.org
 and
-.An Markus Brueffer Aq markus@FreeBSD.org .
+.An Markus Brueffer Aq Mt markus@FreeBSD.org .

Modified: head/share/man/man4/acpi_panasonic.4
==============================================================================
--- head/share/man/man4/acpi_panasonic.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/acpi_panasonic.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -173,6 +173,6 @@ driver first appeared in
 The
 .Nm
 driver and this manual page were written by
-.An OGAWA Takaya Aq t\-ogawa@triaez.kaisei.org
+.An OGAWA Takaya Aq Mt t-ogawa@triaez.kaisei.org
 and
-.An TAKAHASHI Yoshihiro Aq nyan@FreeBSD.org .
+.An TAKAHASHI Yoshihiro Aq Mt nyan@FreeBSD.org .

Modified: head/share/man/man4/acpi_rapidstart.4
==============================================================================
--- head/share/man/man4/acpi_rapidstart.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/acpi_rapidstart.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -81,4 +81,4 @@ driver first appeared in
 The
 .Nm
 driver was written by
-.An Takanori Watanabe Aq takawata@FreeBSD.org .
+.An Takanori Watanabe Aq Mt takawata@FreeBSD.org .

Modified: head/share/man/man4/acpi_sony.4
==============================================================================
--- head/share/man/man4/acpi_sony.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/acpi_sony.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -79,4 +79,4 @@ driver first appeared in
 The
 .Nm
 driver was written by
-.An Takanori Watanabe Aq takawata@FreeBSD.org .
+.An Takanori Watanabe Aq Mt takawata@FreeBSD.org .

Modified: head/share/man/man4/acpi_toshiba.4
==============================================================================
--- head/share/man/man4/acpi_toshiba.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/acpi_toshiba.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -123,6 +123,6 @@ driver first appeared in
 The
 .Nm
 driver was written by
-.An Hiroyuki Aizu Aq aizu@navi.org .
+.An Hiroyuki Aizu Aq Mt aizu@navi.org .
 This manual page was written by
-.An Philip Paeps Aq philip@FreeBSD.org .
+.An Philip Paeps Aq Mt philip@FreeBSD.org .

Modified: head/share/man/man4/acpi_video.4
==============================================================================
--- head/share/man/man4/acpi_video.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/acpi_video.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -78,9 +78,9 @@ driver first appeared in
 The
 .Nm
 driver was written by
-.An Taku YAMAMOTO Aq taku@cent.saitama-u.ac.jp .
+.An Taku YAMAMOTO Aq Mt taku@cent.saitama-u.ac.jp .
 This manual page was written by
-.An Mark Santcroos Aq marks@ripe.net .
+.An Mark Santcroos Aq Mt marks@ripe.net .
 .Sh BUGS
 Some systems only perform output switching via SMM even though they export
 the proper information via ACPI.

Modified: head/share/man/man4/acpi_wmi.4
==============================================================================
--- head/share/man/man4/acpi_wmi.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/acpi_wmi.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -85,7 +85,7 @@ device driver first appeared in
 The
 .Nm
 driver was written by
-.An Michael Gmelin Aq freebsd@grem.de .
+.An Michael Gmelin Aq Mt freebsd@grem.de .
 .Pp
 Work has been inspired by the Linux acpi-wmi driver written by Carlos Corbacho.
 .Pp
@@ -93,4 +93,4 @@ See http://www.microsoft.com/whdc/system
 the specification of ACPI-WMI.
 .Pp
 This manual page was written by
-.An Michael Gmelin Aq freebsd@grem.de .
+.An Michael Gmelin Aq Mt freebsd@grem.de .

Modified: head/share/man/man4/ada.4
==============================================================================
--- head/share/man/man4/ada.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/ada.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -154,4 +154,4 @@ The
 driver first appeared in
 .Fx 8.0 .
 .Sh AUTHORS
-.An Alexander Motin Aq mav@FreeBSD.org
+.An Alexander Motin Aq Mt mav@FreeBSD.org

Modified: head/share/man/man4/ae.4
==============================================================================
--- head/share/man/man4/ae.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/ae.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -137,8 +137,7 @@ instead.
 The
 .Nm
 driver and this manual page was written by
-.An Stanislav Sedov
-.Aq stas@FreeBSD.org .
+.An Stanislav Sedov Aq Mt stas@FreeBSD.org .
 It first appeared in
 .Fx 7.1 .
 .Sh BUGS

Modified: head/share/man/man4/aesni.4
==============================================================================
--- head/share/man/man4/aesni.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/aesni.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -87,7 +87,7 @@ driver first appeared in
 The
 .Nm
 driver was written by
-.An Konstantin Belousov Aq kib@FreeBSD.org .
+.An Konstantin Belousov Aq Mt kib@FreeBSD.org .
 The key schedule calculation code was adopted from the sample provided
 by Intel and used in the analogous
 .Ox

Modified: head/share/man/man4/age.4
==============================================================================
--- head/share/man/man4/age.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/age.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -181,7 +181,6 @@ Display lots of useful MAC counters main
 The
 .Nm
 driver was written by
-.An Pyun YongHyeon
-.Aq yongari@FreeBSD.org .
+.An Pyun YongHyeon Aq Mt yongari@FreeBSD.org .
 It first appeared in
 .Fx 7.1 .

Modified: head/share/man/man4/ahci.4
==============================================================================
--- head/share/man/man4/ahci.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/ahci.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -181,4 +181,4 @@ The
 driver first appeared in
 .Fx 8.0 .
 .Sh AUTHORS
-.An Alexander Motin Aq mav@FreeBSD.org .
+.An Alexander Motin Aq Mt mav@FreeBSD.org

Modified: head/share/man/man4/aibs.4
==============================================================================
--- head/share/man/man4/aibs.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/aibs.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -194,7 +194,7 @@ driver was written for
 and
 .Fx
 by
-.An Constantine A. Murenin Aq cnst@FreeBSD.org ,
+.An Constantine A. Murenin Aq Mt cnst@FreeBSD.org ,
 Raouf Boutaba Research Group,
 David R. Cheriton School of Computer Science,
 University of Waterloo.

Modified: head/share/man/man4/alc.4
==============================================================================
--- head/share/man/man4/alc.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/alc.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -162,7 +162,6 @@ a change takes effect.
 The
 .Nm
 driver was written by
-.An Pyun YongHyeon
-.Aq yongari@FreeBSD.org .
+.An Pyun YongHyeon Aq Mt yongari@FreeBSD.org .
 It first appeared in
 .Fx 8.0 .

Modified: head/share/man/man4/ale.4
==============================================================================
--- head/share/man/man4/ale.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/ale.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -156,7 +156,6 @@ a change takes effect.
 The
 .Nm
 driver was written by
-.An Pyun YongHyeon
-.Aq yongari@FreeBSD.org .
+.An Pyun YongHyeon Aq Mt yongari@FreeBSD.org .
 It first appeared in
 .Fx 7.1 .

Modified: head/share/man/man4/alpm.4
==============================================================================
--- head/share/man/man4/alpm.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/alpm.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -57,6 +57,6 @@ manual page first appeared in
 .Sh AUTHORS
 This
 manual page was written by
-.An Nicolas Souchu Aq nsouch@FreeBSD.org
+.An Nicolas Souchu Aq Mt nsouch@FreeBSD.org .
 .Sh BUGS
 Only polling mode is supported.

Modified: head/share/man/man4/amdpm.4
==============================================================================
--- head/share/man/man4/amdpm.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/amdpm.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -67,6 +67,6 @@ Based heavily on the
 driver by
 .An Nicolas Souchu .
 This manual page was written by
-.An Murray Stokely Aq murray@FreeBSD.org .
+.An Murray Stokely Aq Mt murray@FreeBSD.org .
 .Sh BUGS
 Only polling mode is supported.

Modified: head/share/man/man4/amdsbwd.4
==============================================================================
--- head/share/man/man4/amdsbwd.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/amdsbwd.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -69,6 +69,6 @@ and
 The
 .Nm
 driver was written by
-.An Andriy Gapon Aq avg@FreeBSD.org .
+.An Andriy Gapon Aq Mt avg@FreeBSD.org .
 This manual page was written by
-.An Andriy Gapon Aq avg@FreeBSD.org .
+.An Andriy Gapon Aq Mt avg@FreeBSD.org .

Modified: head/share/man/man4/amdsmb.4
==============================================================================
--- head/share/man/man4/amdsmb.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/amdsmb.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -51,4 +51,4 @@ driver first appeared in
 The
 .Nm
 driver was written by
-.An Ruslan Ermilov Aq ru@FreeBSD.org .
+.An Ruslan Ermilov Aq Mt ru@FreeBSD.org .

Modified: head/share/man/man4/amdtemp.4
==============================================================================
--- head/share/man/man4/amdtemp.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/amdtemp.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -91,9 +91,9 @@ The
 driver first appeared in
 .Fx 7.1 .
 .Sh AUTHORS
-.An Rui Paulo Aq rpaulo@FreeBSD.org
-.An Norikatsu Shigemura Aq nork@FreeBSD.org
-.An Jung-uk Kim Aq jkim@FreeBSD.org
+.An Rui Paulo Aq Mt rpaulo@FreeBSD.org
+.An Norikatsu Shigemura Aq Mt nork@FreeBSD.org
+.An Jung-uk Kim Aq Mt jkim@FreeBSD.org
 .Sh CAVEATS
 For Family 10h and later processors,
 .Do

Modified: head/share/man/man4/amr.4
==============================================================================
--- head/share/man/man4/amr.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/amr.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -233,9 +233,9 @@ An I/O error has occurred.
 The
 .Nm
 driver was written by
-.An Mike Smith Aq msmith@FreeBSD.org .
+.An Mike Smith Aq Mt msmith@FreeBSD.org .
 .Pp
 This manual page was written by
-.An Mike Smith Aq msmith@FreeBSD.org
+.An Mike Smith Aq Mt msmith@FreeBSD.org
 and
-.An Jeroen Ruigrok van der Werven Aq asmodai@FreeBSD.org .
+.An Jeroen Ruigrok van der Werven Aq Mt asmodai@FreeBSD.org .

Modified: head/share/man/man4/an.4
==============================================================================
--- head/share/man/man4/an.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/an.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -141,4 +141,4 @@ device driver first appeared in
 The
 .Nm
 driver was written by
-.An Bill Paul Aq wpaul@ee.columbia.edu .
+.An Bill Paul Aq Mt wpaul@ee.columbia.edu .

Modified: head/share/man/man4/aout.4
==============================================================================
--- head/share/man/man4/aout.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/aout.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -141,6 +141,6 @@ it was superseded by
 The
 .Nm
 manual page was written by
-.An Konstantin Belousov Aq kib@FreeBSD.org .
+.An Konstantin Belousov Aq Mt kib@FreeBSD.org .
 .Sh BUGS
 On 64bit architectures, not all wrappers for older syscalls are implemented.

Modified: head/share/man/man4/arcmsr.4
==============================================================================
--- head/share/man/man4/arcmsr.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/arcmsr.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -163,7 +163,7 @@ driver first appeared in
 .Fx 5.4 .
 .Sh AUTHORS
 The driver was written by
-.An Erich Chen Aq erich@areca.com.tw .
+.An Erich Chen Aq Mt erich@areca.com.tw .
 .Sh BUGS
 The driver has been tested on i386 and amd64.
 It likely requires additional

Modified: head/share/man/man4/asmc.4
==============================================================================
--- head/share/man/man4/asmc.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/asmc.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -155,9 +155,8 @@ The
 driver first appeared in
 .Fx 8.0 .
 .Sh AUTHORS
-.An -nosplit
-.An Rui Paulo Aq rpaulo@FreeBSD.org
-(Google Summer of Code project).
+.An Rui Paulo Aq Mt rpaulo@FreeBSD.org
+(Google Summer of Code project)
 .Sh BUGS
 Support for the latest models was never tested and is most likely not
 fully working.

Modified: head/share/man/man4/asr.4
==============================================================================
--- head/share/man/man4/asr.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/asr.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -108,8 +108,8 @@ The
 .Nm
 driver was kindly donated by Adaptec
 and is maintained by
-.An Mark Salyzyn Aq mark_salyzyn@adaptec.com .
+.An Mark Salyzyn Aq Mt mark_salyzyn@adaptec.com .
 This manual page was written by
 .An Mark Salyzyn
 and fixed up by
-.An Jeroen Ruigrok van der Werven Aq asmodai@FreeBSD.org .
+.An Jeroen Ruigrok van der Werven Aq Mt asmodai@FreeBSD.org .

Modified: head/share/man/man4/ata.4
==============================================================================
--- head/share/man/man4/ata.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/ata.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -267,7 +267,5 @@ It was turned into a
 interface module in
 .Fx 9.0 .
 .Sh AUTHORS
-.An Alexander Motin
-.Aq mav@FreeBSD.org ,
-.An S\(/oren Schmidt
-.Aq sos@FreeBSD.org
+.An Alexander Motin Aq Mt mav@FreeBSD.org
+.An S\(/oren Schmidt Aq Mt sos@FreeBSD.org

Modified: head/share/man/man4/atkbd.4
==============================================================================
--- head/share/man/man4/atkbd.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/atkbd.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -223,8 +223,8 @@ driver first appeared in
 The
 .Nm
 driver was written by
-.An S\(/oren Schmidt Aq sos@FreeBSD.org
+.An S\(/oren Schmidt Aq Mt sos@FreeBSD.org
 and
-.An Kazutaka Yokota Aq yokota@FreeBSD.org .
+.An Kazutaka Yokota Aq Mt yokota@FreeBSD.org .
 This manual page was written by
 .An Kazutaka Yokota .

Modified: head/share/man/man4/atkbdc.4
==============================================================================
--- head/share/man/man4/atkbdc.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/atkbdc.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -116,4 +116,4 @@ It is based on the kbdio module in
 The kbdio module, the
 .Nm
 driver and this manual page were written by
-.An Kazutaka Yokota Aq yokota@FreeBSD.org .
+.An Kazutaka Yokota Aq Mt yokota@FreeBSD.org .

Modified: head/share/man/man4/atp.4
==============================================================================
--- head/share/man/man4/atp.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/atp.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -154,4 +154,4 @@ types.
 The
 .Nm
 driver was written by
-.An Rohit Grover Aq rgrover1@gmail.com .
+.An Rohit Grover Aq Mt rgrover1@gmail.com .

Modified: head/share/man/man4/audit.4
==============================================================================
--- head/share/man/man4/audit.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/audit.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -123,7 +123,7 @@ The Basic Security Module (BSM) interfac
 stream format were defined by Sun Microsystems.
 .Pp
 This manual page was written by
-.An Robert Watson Aq rwatson@FreeBSD.org .
+.An Robert Watson Aq Mt rwatson@FreeBSD.org .
 .Sh BUGS
 The
 .Fx

Modified: head/share/man/man4/auditpipe.4
==============================================================================
--- head/share/man/man4/auditpipe.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/auditpipe.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -234,7 +234,7 @@ Support for kernel audit first appeared 
 .Fx 6.2 .
 .Sh AUTHORS
 The audit pipe facility was designed and implemented by
-.An Robert Watson Aq rwatson@FreeBSD.org .
+.An Robert Watson Aq Mt rwatson@FreeBSD.org .
 .Pp
 The Basic Security Module (BSM) interface to audit records and audit event
 stream format were defined by Sun Microsystems.

Modified: head/share/man/man4/aue.4
==============================================================================
--- head/share/man/man4/aue.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/aue.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -202,4 +202,4 @@ device driver first appeared in
 The
 .Nm
 driver was written by
-.An Bill Paul Aq wpaul@ee.columbia.edu .
+.An Bill Paul Aq Mt wpaul@ee.columbia.edu .

Modified: head/share/man/man4/axe.4
==============================================================================
--- head/share/man/man4/axe.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/axe.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -255,4 +255,4 @@ device driver first appeared in
 The
 .Nm
 driver was written by
-.An Bill Paul Aq wpaul@windriver.com .
+.An Bill Paul Aq Mt wpaul@windriver.com .

Modified: head/share/man/man4/axge.4
==============================================================================
--- head/share/man/man4/axge.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/axge.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -137,14 +137,15 @@ The
 device driver first appeared in
 .Fx 10.1 .
 .Sh AUTHORS
+.An -nosplit
 The
 .Nm
 driver was written by
-.An Kevin Lo Aq kevlo@FreeBSD.org
+.An Kevin Lo Aq Mt kevlo@FreeBSD.org
 and
-.An Li-Wen Hsu Aq lwhsu@FreeBSD.org .
+.An Li-Wen Hsu Aq Mt lwhsu@FreeBSD.org .
 This manual page was adapted by
-.An Mark Johnston Aq markj@FreeBSD.org
+.An Mark Johnston Aq Mt markj@FreeBSD.org
 from the
 .Xr axe 4
 manual page.

Modified: head/share/man/man4/bce.4
==============================================================================
--- head/share/man/man4/bce.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/bce.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -411,7 +411,7 @@ For support questions please contact you
 QLogic Technical Support at
 .Pa http://support.qlogic.com ,
 or by E-mail at
-.Aq support@qlogic.com .
+.Aq Mt support@qlogic.com .
 .Sh SEE ALSO
 .Xr altq 4 ,
 .Xr arp 4 ,
@@ -429,4 +429,4 @@ device driver first appeared in
 The
 .Nm
 driver was written by
-.An David Christensen Aq davidch@broadcom.com .
+.An David Christensen Aq Mt davidch@broadcom.com .

Modified: head/share/man/man4/bge.4
==============================================================================
--- head/share/man/man4/bge.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/bge.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -261,4 +261,4 @@ device driver first appeared in
 The
 .Nm
 driver was written by
-.An Bill Paul Aq wpaul@windriver.com .
+.An Bill Paul Aq Mt wpaul@windriver.com .

Modified: head/share/man/man4/bhyve.4
==============================================================================
--- head/share/man/man4/bhyve.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/bhyve.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -58,9 +58,9 @@ and was developed at NetApp Inc.
 .Nm
 was developed by
 .An -nosplit
-.An "Peter Grehan" Aq grehan@FreeBSD.org
+.An Peter Grehan Aq Mt grehan@FreeBSD.org
 and
-.An "Neel Natu" Aq neel@FreeBSD.org
+.An Neel Natu Aq Mt neel@FreeBSD.org
 at NetApp Inc.
 .Sh BUGS
 .Nm

Modified: head/share/man/man4/bktr.4
==============================================================================
--- head/share/man/man4/bktr.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/bktr.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -257,10 +257,10 @@ driver first appeared in
 .Sh AUTHORS
 .An -nosplit
 This driver is based on the work of
-.An Jim Lowe Aq james@miller.cs.uwm.edu ,
-.An Mark Tinguely Aq tinguely@plains.nodak.edu ,
-.An Amancio Hasty Aq hasty@star-gate.com ,
-.An Roger Hardiman Aq roger@FreeBSD.org
+.An Jim Lowe Aq Mt james@miller.cs.uwm.edu ,
+.An Mark Tinguely Aq Mt tinguely@plains.nodak.edu ,
+.An Amancio Hasty Aq Mt hasty@star-gate.com ,
+.An Roger Hardiman Aq Mt roger@FreeBSD.org
 and a bunch of other people.
 Support for Pinnacle PCTV Rave cards was added by
-.An Branko Lankester Aq branko@euro.net .
+.An Branko Lankester Aq Mt branko@euro.net .

Modified: head/share/man/man4/bridge.4
==============================================================================
--- head/share/man/man4/bridge.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/bridge.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -500,20 +500,17 @@ driver first appeared in
 The
 .Nm bridge
 driver was originally written by
-.An Jason L. Wright
-.Aq jason@thought.net
+.An Jason L. Wright Aq Mt jason@thought.net
 as part of an undergraduate independent study at the University of
 North Carolina at Greensboro.
 .Pp
 This version of the
 .Nm
 driver has been heavily modified from the original version by
-.An Jason R. Thorpe
-.Aq thorpej@wasabisystems.com .
+.An Jason R. Thorpe Aq Mt thorpej@wasabisystems.com .
 .Pp
 Rapid Spanning Tree Protocol (RSTP) support was added by
-.An Andrew Thompson
-.Aq thompsa@FreeBSD.org .
+.An Andrew Thompson Aq Mt thompsa@FreeBSD.org .
 .Sh BUGS
 The
 .Nm

Modified: head/share/man/man4/bwn.4
==============================================================================
--- head/share/man/man4/bwn.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/bwn.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -146,8 +146,7 @@ driver first appeared in
 The
 .Nm
 driver was written by
-.An Weongyo Jeong
-.Aq weongyo@FreeBSD.org .
+.An Weongyo Jeong Aq Mt weongyo@FreeBSD.org .
 .\".Sh BUGS
 .\"Some card based on the BCM4306 and BCM4309 chips do not work properly
 .\"on channel 1, 2 and 3.

Modified: head/share/man/man4/bxe.4
==============================================================================
--- head/share/man/man4/bxe.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/bxe.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -320,7 +320,7 @@ For support questions please contact you
 QLogic Technical Support at
 .Pa http://support.qlogic.com ,
 or by E-mail at
-.Aq support@qlogic.com .
+.Aq Mt support@qlogic.com .
 .Sh SEE ALSO
 .Xr netstat 1 ,
 .Xr altq 4 ,
@@ -338,7 +338,7 @@ device driver first appeared in
 The
 .Nm
 driver was written by
-.An Eric Davis Aq edavis@broadcom.com ,
-.An David Christensen Aq davidch@broadcom.com ,
+.An Eric Davis Aq Mt edavis@broadcom.com ,
+.An David Christensen Aq Mt davidch@broadcom.com ,
 and
-.An Gary Zambrano Aq zambrano@broadcom.com .
+.An Gary Zambrano Aq Mt zambrano@broadcom.com .

Modified: head/share/man/man4/capsicum.4
==============================================================================
--- head/share/man/man4/capsicum.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/capsicum.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -116,15 +116,15 @@ and was developed at the University of C
 .Nm
 was developed by
 .An -nosplit
-.An "Robert Watson" Aq rwatson@FreeBSD.org
+.An Robert Watson Aq Mt rwatson@FreeBSD.org
 and
-.An "Jonathan Anderson" Aq jonathan@FreeBSD.org
+.An Jonathan Anderson Aq Mt jonathan@FreeBSD.org
 at the University of Cambridge, and
-.An "Ben Laurie" Aq benl@FreeBSD.org
+.An Ben Laurie Aq Mt benl@FreeBSD.org
 and
-.An "Kris Kennaway" Aq kris@FreeBSD.org
+.An Kris Kennaway Aq Mt kris@FreeBSD.org
 at Google, Inc., and
-.An "Pawel Jakub Dawidek" Aq pawel@dawidek.net .
+.An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net .
 .Sh BUGS
 .Nm
 is considered experimental in

Modified: head/share/man/man4/cas.4
==============================================================================
--- head/share/man/man4/cas.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/cas.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -152,8 +152,7 @@ and supports the same set of controllers
 The
 .Nm
 driver was written by
-.An Marius Strobl
-.Aq marius@FreeBSD.org
+.An Marius Strobl Aq Mt marius@FreeBSD.org
 based on the
 .Xr gem 4
 driver.

Modified: head/share/man/man4/cc_cdg.4
==============================================================================
--- head/share/man/man4/cc_cdg.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/cc_cdg.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -145,11 +145,11 @@ http://caia.swin.edu.au/urp/newtcp/
 The
 .Nm
 congestion control module was written by
-.An David Hayes Aq david.hayes@ieee.org .
+.An David Hayes Aq Mt david.hayes@ieee.org .
 This manual page was written by
-.An Lawrence Stewart Aq lstewart@FreeBSD.org
+.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org
 and
-.An Grenville Armitage Aq garmitage@swin.edu.au .
+.An Grenville Armitage Aq Mt garmitage@swin.edu.au .
 .Sh BUGS
 The underlying algorithm and parameter values are still a work in progress and
 may not be optimal for some network scenarios.

Modified: head/share/man/man4/cc_chd.4
==============================================================================
--- head/share/man/man4/cc_chd.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/cc_chd.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -125,4 +125,4 @@ http://caia.swin.edu.au/urp/newtcp/
 The
 .Nm
 congestion control module and this manual page were written by
-.An David Hayes Aq david.hayes@ieee.org .
+.An David Hayes Aq Mt david.hayes@ieee.org .

Modified: head/share/man/man4/cc_cubic.4
==============================================================================
--- head/share/man/man4/cc_cubic.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/cc_cubic.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -109,6 +109,6 @@ http://caia.swin.edu.au/urp/newtcp/
 The
 .Nm
 congestion control module and this manual page were written by
-.An Lawrence Stewart Aq lstewart@FreeBSD.org
+.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org
 and
-.An David Hayes Aq david.hayes@ieee.org .
+.An David Hayes Aq Mt david.hayes@ieee.org .

Modified: head/share/man/man4/cc_hd.4
==============================================================================
--- head/share/man/man4/cc_hd.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/cc_hd.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -117,4 +117,4 @@ http://caia.swin.edu.au/urp/newtcp/
 The
 .Nm
 congestion control module and this manual page were written by
-.An David Hayes Aq david.hayes@ieee.org .
+.An David Hayes Aq Mt david.hayes@ieee.org .

Modified: head/share/man/man4/cc_htcp.4
==============================================================================
--- head/share/man/man4/cc_htcp.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/cc_htcp.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -126,11 +126,11 @@ http://caia.swin.edu.au/urp/newtcp/
 The
 .Nm
 congestion control module was written by
-.An James Healy Aq jimmy@deefa.com
+.An James Healy Aq Mt jimmy@deefa.com
 and
-.An Lawrence Stewart Aq lstewart@FreeBSD.org .
+.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org .
 .Pp
 This manual page was written by
-.An Lawrence Stewart Aq lstewart@FreeBSD.org
+.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org
 and
-.An David Hayes Aq david.hayes@ieee.org .
+.An David Hayes Aq Mt david.hayes@ieee.org .

Modified: head/share/man/man4/cc_newreno.4
==============================================================================
--- head/share/man/man4/cc_newreno.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/cc_newreno.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -73,10 +73,10 @@ http://caia.swin.edu.au/urp/newtcp/
 The
 .Nm
 congestion control module was written by
-.An James Healy Aq jimmy@deefa.com ,
-.An Lawrence Stewart Aq lstewart@FreeBSD.org
+.An James Healy Aq Mt jimmy@deefa.com ,
+.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org
 and
-.An David Hayes Aq david.hayes@ieee.org .
+.An David Hayes Aq Mt david.hayes@ieee.org .
 .Pp
 This manual page was written by
-.An Lawrence Stewart Aq lstewart@FreeBSD.org .
+.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org .

Modified: head/share/man/man4/cc_vegas.4
==============================================================================
--- head/share/man/man4/cc_vegas.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/cc_vegas.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -133,4 +133,4 @@ http://caia.swin.edu.au/urp/newtcp/
 The
 .Nm
 congestion control module and this manual page were written by
-.An David Hayes Aq david.hayes@ieee.org .
+.An David Hayes Aq Mt david.hayes@ieee.org .

Modified: head/share/man/man4/cdce.4
==============================================================================
--- head/share/man/man4/cdce.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/cdce.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -139,15 +139,15 @@ and
 The
 .Nm
 driver was written by
-.An Craig Boston Aq craig@tobuj.gank.org
+.An Craig Boston Aq Mt craig@tobuj.gank.org
 based on the
 .Xr aue 4
 driver written by
-.An Bill Paul Aq wpaul@windriver.com
+.An Bill Paul Aq Mt wpaul@windriver.com
 and ported to
 .Ox
 by
-.An Daniel Hartmeier Aq dhartmei@openbsd.org .
+.An Daniel Hartmeier Aq Mt dhartmei@openbsd.org .
 .Sh CAVEATS
 Many USB devices notoriously fail to report their class and interfaces
 correctly.

Modified: head/share/man/man4/ch.4
==============================================================================
--- head/share/man/man4/ch.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/ch.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -340,13 +340,13 @@ driver appeared in
 The
 .Nm
 driver was written by
-.An Jason R. Thorpe Aq thorpej@and.com
+.An Jason R. Thorpe Aq Mt thorpej@and.com
 for And Communications,
 .Pa http://www.and.com/ .
 It was added to the system by
-.An Stefan Grefen Aq grefen@goofy.zdv.uni-mainz.de
+.An Stefan Grefen Aq Mt grefen@goofy.zdv.uni-mainz.de
 who apparently had such a device.
 It was ported to CAM by
-.An Kenneth Merry Aq ken@FreeBSD.org .
+.An Kenneth Merry Aq Mt ken@FreeBSD.org .
 It was updated to support volume tags by
-.An Hans Huebner Aq hans@artcom.de .
+.An Hans Huebner Aq Mt hans@artcom.de .

Modified: head/share/man/man4/ciss.4
==============================================================================
--- head/share/man/man4/ciss.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/ciss.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -184,7 +184,7 @@ HP Modular Smart Array 500 (MSA500)
 The
 .Nm
 driver was written by
-.An Mike Smith Aq msmith@FreeBSD.org .
+.An Mike Smith Aq Mt msmith@FreeBSD.org .
 .Pp
 This manual page is based on his comments and was written by
-.An Tom Rhodes Aq trhodes@FreeBSD.org .
+.An Tom Rhodes Aq Mt trhodes@FreeBSD.org .

Modified: head/share/man/man4/cm.4
==============================================================================
--- head/share/man/man4/cm.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/cm.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -145,18 +145,18 @@ The
 device was ported from
 .Nx
 by
-.An Max Khon Aq fjoe@FreeBSD.org
+.An Max Khon Aq Mt fjoe@FreeBSD.org
 and first appeared in
 .Fx 4.6 .
 This manual page first appeared in
 .Fx 5.3 .
 .Sh AUTHORS
 This manual page was written by
-.An Tom Rhodes Aq trhodes@FreeBSD.org .
+.An Tom Rhodes Aq Mt trhodes@FreeBSD.org .
 The
 .Sx IMPLEMENTATION NOTES
 section was submitted by
-.An Max Khon Aq fjoe@FreeBSD.org
+.An Max Khon Aq Mt fjoe@FreeBSD.org
 and originated from
 .Nx .
 .Sh BUGS

Modified: head/share/man/man4/cmx.4
==============================================================================
--- head/share/man/man4/cmx.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/cmx.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -103,11 +103,11 @@ driver first appeared in
 The
 .Nm
 driver was written by
-.An Daniel Roethlisberger Aq daniel@roe.ch ,
+.An Daniel Roethlisberger Aq Mt daniel@roe.ch ,
 originally based on the Linux driver v1.1.0 by
-.An Omnikey GmbH Aq www.omnikey.com .
+.An Omnikey GmbH Lk www.omnikey.com .
 Early testing and bug fixes by
-.An Marcin Cieslak Aq saper@system.pl .
+.An Marcin Cieslak Aq Mt saper@system.pl .
 .Sh BUGS
 .An -nosplit
 The way the

Modified: head/share/man/man4/coretemp.4
==============================================================================
--- head/share/man/man4/coretemp.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/coretemp.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -68,7 +68,7 @@ driver first appeared in
 The
 .Nm
 driver was written by
-.An Rui Paulo Aq rpaulo@FreeBSD.org
+.An Rui Paulo Aq Mt rpaulo@FreeBSD.org
 as part of a Google Summer of Code project.
 This manual page was written by
-.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org .
+.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .

Modified: head/share/man/man4/cpuctl.4
==============================================================================
--- head/share/man/man4/cpuctl.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/cpuctl.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -188,6 +188,6 @@ driver first appeared in
 The
 .Nm
 module and this manual page were written by
-.An Stanislav Sedov Aq stas@FreeBSD.org .
+.An Stanislav Sedov Aq Mt stas@FreeBSD.org .
 .Sh BUGS
 Yes, probably, report if any.

Modified: head/share/man/man4/ctl.4
==============================================================================
--- head/share/man/man4/ctl.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/ctl.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -90,4 +90,4 @@ subsystem first appeared in
 The
 .Nm
 subsystem was written by
-.An Kenneth Merry Aq ken@FreeBSD.org .
+.An Kenneth Merry Aq Mt ken@FreeBSD.org .

Modified: head/share/man/man4/cue.4
==============================================================================
--- head/share/man/man4/cue.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/cue.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -110,4 +110,4 @@ device driver first appeared in
 The
 .Nm
 driver was written by
-.An Bill Paul Aq wpaul@ee.columbia.edu .
+.An Bill Paul Aq Mt wpaul@ee.columbia.edu .

Modified: head/share/man/man4/cxgb.4
==============================================================================
--- head/share/man/man4/cxgb.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/cxgb.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -110,7 +110,7 @@ go to the Chelsio support website at:
 If an issue is identified with the released source code on the supported kernel
 with a supported adapter, email the specific information related to the
 issue to
-.Aq support@chelsio.com .
+.Aq Mt support@chelsio.com .
 .Sh SEE ALSO
 .Xr altq 4 ,
 .Xr arp 4 ,
@@ -129,6 +129,6 @@ and
 The
 .Nm
 driver was written by
-.An Kip Macy Aq kmacy@FreeBSD.org
+.An Kip Macy Aq Mt kmacy@FreeBSD.org
 with substantial support from
-.An Scott Long Aq scottl@FreeBSD.org .
+.An Scott Long Aq Mt scottl@FreeBSD.org .

Modified: head/share/man/man4/cxgbe.4
==============================================================================
--- head/share/man/man4/cxgbe.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/cxgbe.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -292,7 +292,7 @@ go to the Chelsio support website at:
 .Pp
 If an issue is identified with this driver with a supported adapter,
 email all the specific information related to the issue to
-.Aq support@chelsio.com .
+.Aq Mt support@chelsio.com .
 .Sh SEE ALSO
 .Xr altq 4 ,
 .Xr arp 4 ,
@@ -314,4 +314,4 @@ and
 The
 .Nm
 driver was written by
-.An Navdeep Parhar Aq np@FreeBSD.org .
+.An Navdeep Parhar Aq Mt np@FreeBSD.org .

Modified: head/share/man/man4/dc.4
==============================================================================
--- head/share/man/man4/dc.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/dc.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -383,7 +383,7 @@ device driver first appeared in
 The
 .Nm
 driver was written by
-.An Bill Paul Aq wpaul@ee.columbia.edu .
+.An Bill Paul Aq Mt wpaul@ee.columbia.edu .
 .Sh BUGS
 The Macronix application notes claim that in order to put the
 chips in normal operation, the driver must write a certain magic

Modified: head/share/man/man4/dcons.4
==============================================================================
--- head/share/man/man4/dcons.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/dcons.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -119,7 +119,7 @@ dcons_gdb="1"
 .Xr dconschat 8 ,
 .Xr fwcontrol 8
 .Sh AUTHORS
-.An Hidetoshi Shimokawa Aq simokawa@FreeBSD.org
+.An Hidetoshi Shimokawa Aq Mt simokawa@FreeBSD.org
 .Sh BUGS
 This driver is
 .Ud

Modified: head/share/man/man4/dcons_crom.4
==============================================================================
--- head/share/man/man4/dcons_crom.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/dcons_crom.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -51,7 +51,7 @@ This address is supposed to be used by
 .Xr dconschat 8 ,
 .Xr fwcontrol 8
 .Sh AUTHORS
-.An Hidetoshi Shimokawa Aq simokawa@FreeBSD.org
+.An Hidetoshi Shimokawa Aq Mt simokawa@FreeBSD.org
 .Sh BUGS
 If you load
 .Pa dcons_crom.ko

Modified: head/share/man/man4/divert.4
==============================================================================
--- head/share/man/man4/divert.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/divert.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -175,7 +175,7 @@ that was not associated with any interfa
 .Xr ipfw 4 ,
 .Xr ipfw 8
 .Sh AUTHORS
-.An Archie Cobbs Aq archie@FreeBSD.org ,
+.An Archie Cobbs Aq Mt archie@FreeBSD.org ,
 Whistle Communications Corp.
 .Sh BUGS
 This is an attempt to provide a clean way for user mode processes

Modified: head/share/man/man4/dummynet.4
==============================================================================
--- head/share/man/man4/dummynet.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/dummynet.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -69,7 +69,7 @@ facility
 was initially implemented as a testing tool for
 .Tn TCP
 congestion control by
-.An Luigi Rizzo Aq luigi@iet.unipi.it ,
+.An Luigi Rizzo Aq Mt luigi@iet.unipi.it ,
 as described on ACM Computer Communication Review, Jan.97 issue.
 Later it has been modified to work at the
 .Tn IP

Modified: head/share/man/man4/em.4
==============================================================================
--- head/share/man/man4/em.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/em.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -260,7 +260,7 @@ go to the Intel support website at:
 If an issue is identified with the released source code on the supported kernel
 with a supported adapter, email the specific information related to the
 issue to
-.Aq freebsd@intel.com .
+.Aq Mt freebsd@intel.com .
 .Sh SEE ALSO
 .Xr altq 4 ,
 .Xr arp 4 ,
@@ -280,7 +280,7 @@ device driver first appeared in
 The
 .Nm
 driver was written by
-.An Intel Corporation Aq freebsd@intel.com .
+.An Intel Corporation Aq Mt freebsd@intel.com .
 .Sh BUGS
 Hardware-assisted VLAN processing is disabled by default.
 You can enable it on an

Modified: head/share/man/man4/esp.4
==============================================================================
--- head/share/man/man4/esp.4	Thu Jun 26 21:45:49 2014	(r267937)
+++ head/share/man/man4/esp.4	Thu Jun 26 21:46:14 2014	(r267938)
@@ -102,11 +102,9 @@ The
 driver was ported to

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 21:49:27 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C256367A;
 Thu, 26 Jun 2014 21:49:27 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 971422C31;
 Thu, 26 Jun 2014 21:49:27 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QLnRd6035555;
 Thu, 26 Jun 2014 21:49:27 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QLnRpp035554;
 Thu, 26 Jun 2014 21:49:27 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201406262149.s5QLnRpp035554@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 26 Jun 2014 21:49:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267939 - in head/cddl/contrib/opensolaris: .
 cmd/dtrace/test/tst/common/print cmd/zfs lib/libzfs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 21:49:27 -0000

Author: rpaulo
Date: Thu Jun 26 21:49:27 2014
New Revision: 267939
URL: http://svnweb.freebsd.org/changeset/base/267939

Log:
  Record MFV of r266988.
  
  MFC after:	2 weeks

Modified:
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/   (props changed)
  head/cddl/contrib/opensolaris/cmd/zfs/   (props changed)
  head/cddl/contrib/opensolaris/lib/libzfs/   (props changed)

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 22:38:07 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2477F2B0;
 Thu, 26 Jun 2014 22:38:07 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 121FA2072;
 Thu, 26 Jun 2014 22:38:07 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QMc6Dx058561;
 Thu, 26 Jun 2014 22:38:06 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QMc6DC058560;
 Thu, 26 Jun 2014 22:38:06 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201406262238.s5QMc6DC058560@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 26 Jun 2014 22:38:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267940 - head/cddl/lib/libdtrace
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 22:38:07 -0000

Author: rpaulo
Date: Thu Jun 26 22:38:06 2014
New Revision: 267940
URL: http://svnweb.freebsd.org/changeset/base/267940

Log:
  Add stubs for CTF functions which are not yet implemented.
  
  MFC after:	2 weeks

Modified:
  head/cddl/lib/libdtrace/libproc_compat.h

Modified: head/cddl/lib/libdtrace/libproc_compat.h
==============================================================================
--- head/cddl/lib/libdtrace/libproc_compat.h	Thu Jun 26 21:49:27 2014	(r267939)
+++ head/cddl/lib/libdtrace/libproc_compat.h	Thu Jun 26 22:38:06 2014	(r267940)
@@ -45,8 +45,10 @@
 #define	Pgrab_error strerror
 #define	Plmid_to_map(p, l, o) proc_obj2map((p), (o))
 #define	Plookup_by_addr proc_addr2sym
+#define	Pname_to_ctf(p, obj) NULL
 #define	Pname_to_map proc_name2map
 #define	Pobject_iter proc_iter_objs
+#define	Pobject_iter_resolved(p, f, arg) 1
 #define	Pobjname proc_objname
 #define	Pread proc_read
 #define	Prd_agent proc_rdagent

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 23:21:15 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 391C6915;
 Thu, 26 Jun 2014 23:21:15 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 224EB23CD;
 Thu, 26 Jun 2014 23:21:15 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QNLFKe079894;
 Thu, 26 Jun 2014 23:21:15 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QNLCEB079872;
 Thu, 26 Jun 2014 23:21:12 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201406262321.s5QNLCEB079872@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 26 Jun 2014 23:21:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267941 - in head: cddl/contrib/opensolaris/cmd/dtrace
 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf
 cddl/contrib/opensolaris/common/ctf cddl/contrib/opensolaris/lib/libdtrac...
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 23:21:15 -0000

Author: rpaulo
Date: Thu Jun 26 23:21:11 2014
New Revision: 267941
URL: http://svnweb.freebsd.org/changeset/base/267941

Log:
  MFV illumos
  
  4474 DTrace Userland CTF Support
  4475 DTrace userland Keyword
  4476 DTrace tests should be better citizens
  4479 pid provider types
  4480 dof emulation is missing checks
  
  MFC after:	2 weeks

Added:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/
     - copied from r266989, vendor/illumos/dist/cmd/dtrace/test/tst/common/uctf/
Modified:
  head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
  head/cddl/contrib/opensolaris/common/ctf/ctf_open.c
  head/cddl/contrib/opensolaris/common/ctf/ctf_types.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_as.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.h
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.h
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.h
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_xlator.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c	Thu Jun 26 22:38:06 2014	(r267940)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c	Thu Jun 26 23:21:11 2014	(r267941)
@@ -25,6 +25,7 @@
  */
 /*
  * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  */
 
 #include 
@@ -513,6 +514,7 @@ static void
 print_probe_info(const dtrace_probeinfo_t *p)
 {
 	char buf[BUFSIZ];
+	char *user;
 	int i;
 
 	oprintf("\n\tProbe Description Attributes\n");
@@ -536,10 +538,14 @@ print_probe_info(const dtrace_probeinfo_
 	oprintf("\n\tArgument Types\n");
 
 	for (i = 0; i < p->dtp_argc; i++) {
+		if (p->dtp_argv[i].dtt_flags & DTT_FL_USER)
+			user = "userland ";
+		else
+			user = "";
 		if (ctf_type_name(p->dtp_argv[i].dtt_ctfp,
 		    p->dtp_argv[i].dtt_type, buf, sizeof (buf)) == NULL)
 			(void) strlcpy(buf, "(unknown)", sizeof (buf));
-		oprintf("\t\targs[%d]: %s\n", i, buf);
+		oprintf("\t\targs[%d]: %s%s\n", i, user, buf);
 	}
 
 	if (p->dtp_argc == 0)

Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_open.c
==============================================================================
--- head/cddl/contrib/opensolaris/common/ctf/ctf_open.c	Thu Jun 26 22:38:06 2014	(r267940)
+++ head/cddl/contrib/opensolaris/common/ctf/ctf_open.c	Thu Jun 26 23:21:11 2014	(r267941)
@@ -25,7 +25,7 @@
  * Use is subject to license terms.
  */
 /*
- * Copyright (c) 2012, Joyent, Inc.  All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc.  All rights reserved.
  */
 
 #include 
@@ -788,6 +788,92 @@ bad:
 }
 
 /*
+ * Dupliate a ctf_file_t and its underlying section information into a new
+ * container. This works by copying the three ctf_sect_t's of the original
+ * container if they exist and passing those into ctf_bufopen. To copy those, we
+ * mmap anonymous memory with ctf_data_alloc and bcopy the data across. It's not
+ * the cheapest thing, but it's what we've got.
+ */
+ctf_file_t *
+ctf_dup(ctf_file_t *ofp)
+{
+	ctf_file_t *fp;
+	ctf_sect_t ctfsect, symsect, strsect;
+	ctf_sect_t *ctp, *symp, *strp;
+	void *cbuf, *symbuf, *strbuf;
+	int err;
+
+	cbuf = symbuf = strbuf = NULL;
+	/*
+	 * The ctfsect isn't allowed to not exist, but the symbol and string
+	 * section might not. We only need to copy the data of the section, not
+	 * the name, as ctf_bufopen will take care of that.
+	 */
+	bcopy(&ofp->ctf_data, &ctfsect, sizeof (ctf_sect_t));
+	cbuf = ctf_data_alloc(ctfsect.cts_size);
+	if (cbuf == NULL) {
+		(void) ctf_set_errno(ofp, ECTF_MMAP);
+		return (NULL);
+	}
+
+	bcopy(ctfsect.cts_data, cbuf, ctfsect.cts_size);
+	ctf_data_protect(cbuf, ctfsect.cts_size);
+	ctfsect.cts_data = cbuf;
+	ctfsect.cts_offset = 0;
+	ctp = &ctfsect;
+
+	if (ofp->ctf_symtab.cts_data != NULL) {
+		bcopy(&ofp->ctf_symtab, &symsect, sizeof (ctf_sect_t));
+		symbuf = ctf_data_alloc(symsect.cts_size);
+		if (symbuf == NULL) {
+			(void) ctf_set_errno(ofp, ECTF_MMAP);
+			goto err;
+		}
+		bcopy(symsect.cts_data, symbuf, symsect.cts_size);
+		ctf_data_protect(symbuf, symsect.cts_size);
+		symsect.cts_data = symbuf;
+		symsect.cts_offset = 0;
+		symp = &symsect;
+	} else {
+		symp = NULL;
+	}
+
+	if (ofp->ctf_strtab.cts_data != NULL) {
+		bcopy(&ofp->ctf_strtab, &strsect, sizeof (ctf_sect_t));
+		strbuf = ctf_data_alloc(strsect.cts_size);
+		if (strbuf == NULL) {
+			(void) ctf_set_errno(ofp, ECTF_MMAP);
+			goto err;
+		}
+		bcopy(strsect.cts_data, strbuf, strsect.cts_size);
+		ctf_data_protect(strbuf, strsect.cts_size);
+		strsect.cts_data = strbuf;
+		strsect.cts_offset = 0;
+		strp = &strsect;
+	} else {
+		strp = NULL;
+	}
+
+	fp = ctf_bufopen(ctp, symp, strp, &err);
+	if (fp == NULL) {
+		(void) ctf_set_errno(ofp, err);
+		goto err;
+	}
+
+	fp->ctf_flags |= LCTF_MMAP;
+
+	return (fp);
+
+err:
+	ctf_data_free(cbuf, ctfsect.cts_size);
+	if (symbuf != NULL)
+		ctf_data_free(symbuf, symsect.cts_size);
+	if (strbuf != NULL)
+		ctf_data_free(strbuf, strsect.cts_size);
+	return (NULL);
+}
+
+/*
  * Close the specified CTF container and free associated data structures.  Note
  * that ctf_close() is a reference counted operation: if the specified file is
  * the parent of other active containers, its reference count will be greater

Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_types.c
==============================================================================
--- head/cddl/contrib/opensolaris/common/ctf/ctf_types.c	Thu Jun 26 22:38:06 2014	(r267940)
+++ head/cddl/contrib/opensolaris/common/ctf/ctf_types.c	Thu Jun 26 23:21:11 2014	(r267941)
@@ -25,8 +25,6 @@
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include 
 
 ssize_t
@@ -199,8 +197,9 @@ ctf_type_resolve(ctf_file_t *fp, ctf_id_
  * Lookup the given type ID and print a string name for it into buf.  Return
  * the actual number of bytes (not including \0) needed to format the name.
  */
-ssize_t
-ctf_type_lname(ctf_file_t *fp, ctf_id_t type, char *buf, size_t len)
+static ssize_t
+ctf_type_qlname(ctf_file_t *fp, ctf_id_t type, char *buf, size_t len,
+    const char *qname)
 {
 	ctf_decl_t cd;
 	ctf_decl_node_t *cdp;
@@ -255,6 +254,8 @@ ctf_type_lname(ctf_file_t *fp, ctf_id_t 
 			case CTF_K_INTEGER:
 			case CTF_K_FLOAT:
 			case CTF_K_TYPEDEF:
+				if (qname != NULL)
+					ctf_decl_sprintf(&cd, "%s`", qname);
 				ctf_decl_sprintf(&cd, "%s", name);
 				break;
 			case CTF_K_POINTER:
@@ -268,13 +269,22 @@ ctf_type_lname(ctf_file_t *fp, ctf_id_t 
 				break;
 			case CTF_K_STRUCT:
 			case CTF_K_FORWARD:
-				ctf_decl_sprintf(&cd, "struct %s", name);
+				ctf_decl_sprintf(&cd, "struct ");
+				if (qname != NULL)
+					ctf_decl_sprintf(&cd, "%s`", qname);
+				ctf_decl_sprintf(&cd, "%s", name);
 				break;
 			case CTF_K_UNION:
-				ctf_decl_sprintf(&cd, "union %s", name);
+				ctf_decl_sprintf(&cd, "union ");
+				if (qname != NULL)
+					ctf_decl_sprintf(&cd, "%s`", qname);
+				ctf_decl_sprintf(&cd, "%s", name);
 				break;
 			case CTF_K_ENUM:
-				ctf_decl_sprintf(&cd, "enum %s", name);
+				ctf_decl_sprintf(&cd, "enum ");
+				if (qname != NULL)
+					ctf_decl_sprintf(&cd, "%s`", qname);
+				ctf_decl_sprintf(&cd, "%s", name);
 				break;
 			case CTF_K_VOLATILE:
 				ctf_decl_sprintf(&cd, "volatile");
@@ -301,6 +311,12 @@ ctf_type_lname(ctf_file_t *fp, ctf_id_t 
 	return (cd.cd_len);
 }
 
+ssize_t
+ctf_type_lname(ctf_file_t *fp, ctf_id_t type, char *buf, size_t len)
+{
+	return (ctf_type_qlname(fp, type, buf, len, NULL));
+}
+
 /*
  * Lookup the given type ID and print a string name for it into buf.  If buf
  * is too small, return NULL: the ECTF_NAMELEN error is set on 'fp' for us.
@@ -308,10 +324,19 @@ ctf_type_lname(ctf_file_t *fp, ctf_id_t 
 char *
 ctf_type_name(ctf_file_t *fp, ctf_id_t type, char *buf, size_t len)
 {
-	ssize_t rv = ctf_type_lname(fp, type, buf, len);
+	ssize_t rv = ctf_type_qlname(fp, type, buf, len, NULL);
+	return (rv >= 0 && rv < len ? buf : NULL);
+}
+
+char *
+ctf_type_qname(ctf_file_t *fp, ctf_id_t type, char *buf, size_t len,
+    const char *qname)
+{
+	ssize_t rv = ctf_type_qlname(fp, type, buf, len, qname);
 	return (rv >= 0 && rv < len ? buf : NULL);
 }
 
+
 /*
  * Resolve the type down to a base type node, and then return the size
  * of the type storage in bytes.

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_as.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_as.c	Thu Jun 26 22:38:06 2014	(r267940)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_as.c	Thu Jun 26 23:21:11 2014	(r267941)
@@ -23,8 +23,10 @@
  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+/*
+ * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ */
 
 #include 
 #include 
@@ -125,7 +127,7 @@ dt_copyvar(dt_idhash_t *dhp, dt_ident_t 
 		dvp->dtdv_flags |= DIFV_F_MOD;
 
 	bzero(&dn, sizeof (dn));
-	dt_node_type_assign(&dn, idp->di_ctfp, idp->di_type);
+	dt_node_type_assign(&dn, idp->di_ctfp, idp->di_type, B_FALSE);
 	dt_node_diftype(pcb->pcb_hdl, &dn, &dvp->dtdv_type);
 
 	idp->di_flags &= ~(DT_IDFLG_DIFR | DT_IDFLG_DIFW);

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c	Thu Jun 26 22:38:06 2014	(r267940)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c	Thu Jun 26 23:21:11 2014	(r267941)
@@ -21,7 +21,7 @@
 
 /*
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent Inc. All rights reserved.
+ * Copyright (c) 2013, Joyent Inc. All rights reserved.
  * Copyright (c) 2012 by Delphix. All rights reserved.
  */
 
@@ -663,6 +663,8 @@ dt_action_printflike(dtrace_hdl_t *dtp, 
 static void
 dt_action_trace(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp)
 {
+	int ctflib;
+
 	dtrace_actdesc_t *ap = dt_stmt_action(dtp, sdp);
 	boolean_t istrace = (dnp->dn_ident->di_id == DT_ACT_TRACE);
 	const char *act = istrace ?  "trace" : "print";
@@ -694,7 +696,10 @@ dt_action_trace(dtrace_hdl_t *dtp, dt_no
 	 * like arrays and function pointers that can't be resolved by
 	 * ctf_type_lookup().  This is later processed by dtrace_dof_create()
 	 * and turned into a reference into the string table so that we can
-	 * get the type information when we process the data after the fact.
+	 * get the type information when we process the data after the fact.  In
+	 * the case where we are referring to userland CTF data, we also need to
+	 * to identify which ctf container in question we care about and encode
+	 * that within the name.
 	 */
 	if (dnp->dn_ident->di_id == DT_ACT_PRINT) {
 		dt_node_t *dret;
@@ -705,11 +710,27 @@ dt_action_trace(dtrace_hdl_t *dtp, dt_no
 		dmp = dt_module_lookup_by_ctf(dtp, dret->dn_ctfp);
 
 		n = snprintf(NULL, 0, "%s`%ld", dmp->dm_name, dret->dn_type) + 1;
+		if (dmp->dm_pid != 0) {
+			ctflib = dt_module_getlibid(dtp, dmp, dret->dn_ctfp);
+			assert(ctflib >= 0);
+			n = snprintf(NULL, 0, "%s`%d`%ld", dmp->dm_name,
+			    ctflib, dret->dn_type) + 1;
+		} else {
+			n = snprintf(NULL, 0, "%s`%ld", dmp->dm_name,
+			    dret->dn_type) + 1;
+		}
 		sdp->dtsd_strdata = dt_alloc(dtp, n);
 		if (sdp->dtsd_strdata == NULL)
 			longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM);
 		(void) snprintf(sdp->dtsd_strdata, n, "%s`%ld", dmp->dm_name,
 		    dret->dn_type);
+		if (dmp->dm_pid != 0) {
+			(void) snprintf(sdp->dtsd_strdata, n, "%s`%d`%ld",
+			    dmp->dm_name, ctflib, dret->dn_type);
+		} else {
+			(void) snprintf(sdp->dtsd_strdata, n, "%s`%ld",
+			    dmp->dm_name, dret->dn_type);
+		}
 	}
 
 	ap->dtad_difo = dt_as(yypcb);

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c	Thu Jun 26 22:38:06 2014	(r267940)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c	Thu Jun 26 23:21:11 2014	(r267941)
@@ -21,7 +21,8 @@
  */
 /*
  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -779,7 +780,7 @@ dt_decl_enumerator(char *s, dt_node_t *d
 	yyintdecimal = 0;
 
 	dnp = dt_node_int(value);
-	dt_node_type_assign(dnp, dsp->ds_ctfp, dsp->ds_type);
+	dt_node_type_assign(dnp, dsp->ds_ctfp, dsp->ds_type, B_FALSE);
 
 	if ((inp = malloc(sizeof (dt_idnode_t))) == NULL)
 		longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM);
@@ -821,6 +822,8 @@ dt_decl_type(dt_decl_t *ddp, dtrace_type
 	char *name;
 	int rv;
 
+	tip->dtt_flags = 0;
+
 	/*
 	 * Based on our current #include depth and decl stack depth, determine
 	 * which dynamic CTF module and scope to use when adding any new types.
@@ -828,6 +831,9 @@ dt_decl_type(dt_decl_t *ddp, dtrace_type
 	dmp = yypcb->pcb_idepth ? dtp->dt_cdefs : dtp->dt_ddefs;
 	flag = yypcb->pcb_dstack.ds_next ? CTF_ADD_NONROOT : CTF_ADD_ROOT;
 
+	if (ddp->dd_attr & DT_DA_USER)
+		tip->dtt_flags = DTT_FL_USER;
+
 	/*
 	 * If we have already cached a CTF type for this decl, then we just
 	 * return the type information for the cached type.

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.h
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.h	Thu Jun 26 22:38:06 2014	(r267940)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.h	Thu Jun 26 23:21:11 2014	(r267941)
@@ -23,12 +23,14 @@
  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
+/*
+ * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
+ */
 
 #ifndef	_DT_DECL_H
 #define	_DT_DECL_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include 
 #include 
 #include 
@@ -59,6 +61,7 @@ typedef struct dt_decl {
 #define	DT_DA_RESTRICT	0x0040		/* qualify type as restrict */
 #define	DT_DA_VOLATILE	0x0080		/* qualify type as volatile */
 #define	DT_DA_PAREN	0x0100		/* parenthesis tag */
+#define	DT_DA_USER	0x0200		/* user-land type specifier */
 
 typedef enum dt_dclass {
 	DT_DC_DEFAULT,			/* no storage class specified */

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c	Thu Jun 26 22:38:06 2014	(r267940)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c	Thu Jun 26 23:21:11 2014	(r267941)
@@ -26,7 +26,8 @@
  */
 
 /*
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
  */
 
 #include 
@@ -312,9 +313,10 @@ dt_dis_typestr(const dtrace_diftype_t *t
 		(void) snprintf(ckind, sizeof (ckind), "0x%x", t->dtdt_ckind);
 	}
 
-	if (t->dtdt_flags & DIF_TF_BYREF) {
-		(void) snprintf(buf, len, "%s (%s) by ref (size %lu)",
-		    kind, ckind, (ulong_t)t->dtdt_size);
+	if (t->dtdt_flags & (DIF_TF_BYREF | DIF_TF_BYUREF)) {
+		(void) snprintf(buf, len, "%s (%s) by %sref (size %lu)",
+		    kind, ckind, (t->dtdt_flags & DIF_TF_BYUREF) ? "user " : "",
+		    (ulong_t)t->dtdt_size);
 	} else {
 		(void) snprintf(buf, len, "%s (%s) (size %lu)",
 		    kind, ckind, (ulong_t)t->dtdt_size);

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c	Thu Jun 26 22:38:06 2014	(r267940)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c	Thu Jun 26 23:21:11 2014	(r267941)
@@ -111,7 +111,8 @@ static const struct {
 	{ EDT_BADAGGVAR, "Invalid aggregation variable identifier" },
 	{ EDT_OVERSION,	"Client requested deprecated version of library" },
 	{ EDT_ENABLING_ERR, "Failed to enable probe" },
-	{ EDT_NOPROBES, "No probe sites found for declared provider" }
+	{ EDT_NOPROBES, "No probe sites found for declared provider" },
+	{ EDT_CANTLOAD, "Failed to load module" },
 };
 
 static const int _dt_nerr = sizeof (_dt_errlist) / sizeof (_dt_errlist[0]);

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y	Thu Jun 26 22:38:06 2014	(r267940)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y	Thu Jun 26 23:21:11 2014	(r267941)
@@ -23,8 +23,10 @@
  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+/*
+ * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
 
 #include 
 
@@ -102,6 +104,7 @@
 %token	DT_KEY_TYPEDEF
 %token	DT_KEY_UNION
 %token	DT_KEY_UNSIGNED
+%token	DT_KEY_USERLAND
 %token	DT_KEY_VOID
 %token	DT_KEY_VOLATILE
 %token	DT_KEY_WHILE
@@ -633,6 +636,7 @@ type_specifier:	DT_KEY_VOID { $$ = dt_de
 	|	DT_KEY_DOUBLE { $$ = dt_decl_spec(CTF_K_FLOAT, DUP("double")); }
 	|	DT_KEY_SIGNED { $$ = dt_decl_attr(DT_DA_SIGNED); }
 	|	DT_KEY_UNSIGNED { $$ = dt_decl_attr(DT_DA_UNSIGNED); }
+	|	DT_KEY_USERLAND { $$ = dt_decl_attr(DT_DA_USER); }
 	|	DT_KEY_STRING {
 			$$ = dt_decl_spec(CTF_K_TYPEDEF, DUP("string"));
 		}

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c	Thu Jun 26 22:38:06 2014	(r267940)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c	Thu Jun 26 23:21:11 2014	(r267941)
@@ -22,6 +22,8 @@
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013 Joyent, Inc. All rights reserved.
  */
 
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -104,7 +106,7 @@ dt_idcook_sign(dt_node_t *dnp, dt_ident_
 		}
 	}
 
-	dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type);
+	dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type, B_FALSE);
 }
 
 /*
@@ -163,7 +165,7 @@ dt_idcook_assc(dt_node_t *dnp, dt_ident_
 		if (argc != 0)
 			isp->dis_args[argc - 1].dn_list = NULL;
 
-		dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type);
+		dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type, B_FALSE);
 
 	} else {
 		dt_idcook_sign(dnp, idp, argc, args,
@@ -304,7 +306,7 @@ dt_idcook_func(dt_node_t *dnp, dt_ident_
 			}
 
 			dt_node_type_assign(&isp->dis_args[i],
-			    dtt.dtt_ctfp, dtt.dtt_type);
+			    dtt.dtt_ctfp, dtt.dtt_type, B_FALSE);
 		}
 	}
 
@@ -391,7 +393,9 @@ dt_idcook_args(dt_node_t *dnp, dt_ident_
 
 		dt_node_type_assign(dnp,
 		    prp->pr_argv[ap->dn_value].dtt_ctfp,
-		    prp->pr_argv[ap->dn_value].dtt_type);
+		    prp->pr_argv[ap->dn_value].dtt_type,
+		    prp->pr_argv[ap->dn_value].dtt_flags & DTT_FL_USER ?
+		    B_TRUE : B_FALSE);
 
 	} else if ((dxp = dt_xlator_lookup(dtp,
 	    nnp, xnp, DT_XLATE_FUZZY)) != NULL || (
@@ -419,7 +423,8 @@ dt_idcook_args(dt_node_t *dnp, dt_ident_
 		dnp->dn_ident->di_ctfp = xidp->di_ctfp;
 		dnp->dn_ident->di_type = xidp->di_type;
 
-		dt_node_type_assign(dnp, DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp));
+		dt_node_type_assign(dnp, DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp),
+		    B_FALSE);
 
 	} else {
 		xyerror(D_ARGS_XLATOR, "translator for %s[%lld] from %s to %s "
@@ -465,7 +470,7 @@ dt_idcook_regs(dt_node_t *dnp, dt_ident_
 	idp->di_ctfp = dtt.dtt_ctfp;
 	idp->di_type = dtt.dtt_type;
 
-	dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type);
+	dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type, B_FALSE);
 }
 
 /*ARGSUSED*/
@@ -487,7 +492,7 @@ dt_idcook_type(dt_node_t *dnp, dt_ident_
 		idp->di_type = dtt.dtt_type;
 	}
 
-	dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type);
+	dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type, B_FALSE);
 }
 
 /*ARGSUSED*/
@@ -495,7 +500,7 @@ static void
 dt_idcook_thaw(dt_node_t *dnp, dt_ident_t *idp, int argc, dt_node_t *args)
 {
 	if (idp->di_ctfp != NULL && idp->di_type != CTF_ERR)
-		dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type);
+		dt_node_type_assign(dnp, idp->di_ctfp, idp->di_type, B_FALSE);
 }
 
 static void

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h	Thu Jun 26 22:38:06 2014	(r267940)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h	Thu Jun 26 23:21:11 2014	(r267941)
@@ -146,6 +146,10 @@ typedef struct dt_module {
 	caddr_t dm_reloc_offset;	/* Symbol relocation offset. */
 	uintptr_t *dm_sec_offsets;
 #endif
+	pid_t dm_pid;		/* pid for this module */
+	uint_t dm_nctflibs;	/* number of ctf children libraries */
+	ctf_file_t **dm_libctfp; /* process library ctf pointers */
+	char **dm_libctfn;	/* names of process ctf containers */
 } dt_module_t;
 
 #define	DT_DM_LOADED	0x1	/* module symbol and type data is loaded */
@@ -536,7 +540,8 @@ enum {
 	EDT_BADAGGVAR,		/* invalid aggregation variable identifier */
 	EDT_OVERSION,		/* client is requesting deprecated version */
 	EDT_ENABLING_ERR,	/* failed to enable probe */
-	EDT_NOPROBES		/* no probes sites for declared provider */
+	EDT_NOPROBES,		/* no probes sites for declared provider */
+	EDT_CANTLOAD		/* failed to load a module */
 };
 
 /*

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l	Thu Jun 26 22:38:06 2014	(r267940)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l	Thu Jun 26 23:21:11 2014	(r267941)
@@ -23,6 +23,10 @@
 /*
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  */
+/*
+ * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
 
 #include 
 #include 
@@ -93,13 +97,17 @@ static void unput(int);
 %}
 
 %e 1500		/* maximum nodes */
-%p 3700		/* maximum positions */
+%p 4900		/* maximum positions */
 %n 600		/* maximum states */
+%a 3000		/* maximum transitions */
 
 %s S0 S1 S2 S3 S4
 
 RGX_AGG		"@"[a-zA-Z_][0-9a-zA-Z_]*
 RGX_PSPEC	[-$:a-zA-Z_.?*\\\[\]!][-$:0-9a-zA-Z_.`?*\\\[\]!]*
+RGX_ALTIDENT	[a-zA-Z_][0-9a-zA-Z_]*
+RGX_LMID	LM[0-9a-fA-F]+`
+RGX_MOD_IDENT	[a-zA-Z_`][0-9a-z.A-Z_`]*`
 RGX_IDENT	[a-zA-Z_`][0-9a-zA-Z_`]*
 RGX_INT		([0-9]+|0[xX][0-9A-Fa-f]+)[uU]?[lL]?[lL]?
 RGX_FP		([0-9]+("."?)[0-9]*|"."[0-9]+)((e|E)("+"|-)?[0-9]+)?[fFlL]?
@@ -169,6 +177,7 @@ if (yypcb->pcb_token != 0) {
 typedef	return (DT_KEY_TYPEDEF);
 union	return (DT_KEY_UNION);
 unsigned	return (DT_KEY_UNSIGNED);
+userland	return (DT_KEY_USERLAND);
 void	return (DT_KEY_VOID);
 volatile	return (DT_KEY_VOLATILE);
 while	return (DT_KEY_WHILE);
@@ -347,7 +356,9 @@ if (yypcb->pcb_token != 0) {
 			return (DT_TOK_INT);
 		}
 
-{RGX_IDENT}	{
+{RGX_IDENT} |
+{RGX_MOD_IDENT}{RGX_IDENT} |
+{RGX_MOD_IDENT} {
 			return (id_or_type(yytext));
 		}
 

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c	Thu Jun 26 22:38:06 2014	(r267940)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c	Thu Jun 26 23:21:11 2014	(r267941)
@@ -22,6 +22,9 @@
 /*
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  */
+/*
+ * Copyright (c) 2013, Joyent, Inc.  All rights reserved.
+ */
 
 #include 
 #if defined(sun)
@@ -50,6 +53,7 @@
 #include 
 #if !defined(sun)
 #include 
+#include 
 #endif
 
 #include 
@@ -462,6 +466,9 @@ static const dt_modops_t dt_modops_64 = 
 dt_module_t *
 dt_module_create(dtrace_hdl_t *dtp, const char *name)
 {
+	long pid;
+	char *eptr;
+	dt_ident_t *idp;
 	uint_t h = dt_strtab_hash(name, NULL) % dtp->dt_modbuckets;
 	dt_module_t *dmp;
 
@@ -485,6 +492,32 @@ dt_module_create(dtrace_hdl_t *dtp, cons
 	else
 		dmp->dm_ops = &dt_modops_32;
 
+	/*
+	 * Modules for userland processes are special. They always refer to a
+	 * specific process and have a copy of their CTF data from a specific
+	 * instant in time. Any dt_module_t that begins with 'pid' is a module
+	 * for a specific process, much like how any probe description that
+	 * begins with 'pid' is special. pid123 refers to process 123. A module
+	 * that is just 'pid' refers specifically to pid$target. This is
+	 * generally done as D does not currently allow for macros to be
+	 * evaluated when working with types.
+	 */
+	if (strncmp(dmp->dm_name, "pid", 3) == 0) {
+		errno = 0;
+		if (dmp->dm_name[3] == '\0') {
+			idp = dt_idhash_lookup(dtp->dt_macros, "target");
+			if (idp != NULL && idp->di_id != 0)
+				dmp->dm_pid = idp->di_id;
+		} else {
+			pid = strtol(dmp->dm_name + 3, &eptr, 10);
+			if (errno == 0 && *eptr == '\0')
+				dmp->dm_pid = (pid_t)pid;
+			else
+				dt_dprintf("encountered malformed pid "
+				    "module: %s\n", dmp->dm_name);
+		}
+	}
+
 	return (dmp);
 }
 
@@ -554,12 +587,169 @@ dt_module_load_sect(dtrace_hdl_t *dtp, d
 	return (0);
 }
 
+typedef struct dt_module_cb_arg {
+	struct ps_prochandle *dpa_proc;
+	dtrace_hdl_t *dpa_dtp;
+	dt_module_t *dpa_dmp;
+	uint_t dpa_count;
+} dt_module_cb_arg_t;
+
+/* ARGSUSED */
+static int
+dt_module_load_proc_count(void *arg, const prmap_t *prmap, const char *obj)
+{
+	ctf_file_t *fp;
+	dt_module_cb_arg_t *dcp = arg;
+
+	/* Try to grab a ctf container if it exists */
+	fp = Pname_to_ctf(dcp->dpa_proc, obj);
+	if (fp != NULL)
+		dcp->dpa_count++;
+	return (0);
+}
+
+/* ARGSUSED */
+static int
+dt_module_load_proc_build(void *arg, const prmap_t *prmap, const char *obj)
+{
+	ctf_file_t *fp;
+	char buf[MAXPATHLEN], *p;
+	dt_module_cb_arg_t *dcp = arg;
+	int count = dcp->dpa_count;
+	Lmid_t lmid;
+
+	fp = Pname_to_ctf(dcp->dpa_proc, obj);
+	if (fp == NULL)
+		return (0);
+	fp = ctf_dup(fp);
+	if (fp == NULL)
+		return (0);
+	dcp->dpa_dmp->dm_libctfp[count] = fp;
+	/*
+	 * While it'd be nice to simply use objname here, because of our prior
+	 * actions we'll always get a resolved object name to its on disk file.
+	 * Like the pid provider, we need to tell a bit of a lie here. The type
+	 * that the user thinks of is in terms of the libraries they requested,
+	 * eg. libc.so.1, they don't care about the fact that it's
+	 * libc_hwcap.so.1.
+	 */
+	(void) Pobjname(dcp->dpa_proc, prmap->pr_vaddr, buf, sizeof (buf));
+	if ((p = strrchr(buf, '/')) == NULL)
+		p = buf;
+	else
+		p++;
+
+	/*
+	 * If for some reason we can't find a link map id for this module, which
+	 * would be really quite weird. We instead just say the link map id is
+	 * zero.
+	 */
+	if (Plmid(dcp->dpa_proc, prmap->pr_vaddr, &lmid) != 0)
+		lmid = 0;
+
+	if (lmid == 0)
+		dcp->dpa_dmp->dm_libctfn[count] = strdup(p);
+	else
+		(void) asprintf(&dcp->dpa_dmp->dm_libctfn[count],
+		    "LM%x`%s", lmid, p);
+	if (dcp->dpa_dmp->dm_libctfn[count] == NULL)
+		return (1);
+	ctf_setspecific(fp, dcp->dpa_dmp);
+	dcp->dpa_count++;
+	return (0);
+}
+
+/*
+ * We've been asked to load data that belongs to another process. As such we're
+ * going to pgrab it at this instant, load everything that we might ever care
+ * about, and then drive on. The reason for this is that the process that we're
+ * interested in might be changing. As long as we have grabbed it, then this
+ * can't be a problem for us.
+ *
+ * For now, we're actually going to punt on most things and just try to get CTF
+ * data, nothing else. Basically this is only useful as a source of type
+ * information, we can't go and do the stacktrace lookups, etc.
+ */
+static int
+dt_module_load_proc(dtrace_hdl_t *dtp, dt_module_t *dmp)
+{
+	struct ps_prochandle *p;
+	dt_module_cb_arg_t arg;
+
+	/*
+	 * Note that on success we do not release this hold. We must hold this
+	 * for our life time.
+	 */
+	p = dt_proc_grab(dtp, dmp->dm_pid, 0, PGRAB_RDONLY | PGRAB_FORCE);
+	if (p == NULL) {
+		dt_dprintf("failed to grab pid: %d\n", (int)dmp->dm_pid);
+		return (dt_set_errno(dtp, EDT_CANTLOAD));
+	}
+	dt_proc_lock(dtp, p);
+
+	arg.dpa_proc = p;
+	arg.dpa_dtp = dtp;
+	arg.dpa_dmp = dmp;
+	arg.dpa_count = 0;
+	if (Pobject_iter_resolved(p, dt_module_load_proc_count, &arg) != 0) {
+		dt_dprintf("failed to iterate objects\n");
+		dt_proc_release(dtp, p);
+		return (dt_set_errno(dtp, EDT_CANTLOAD));
+	}
+
+	if (arg.dpa_count == 0) {
+		dt_dprintf("no ctf data present\n");
+		dt_proc_unlock(dtp, p);
+		dt_proc_release(dtp, p);
+		return (dt_set_errno(dtp, EDT_CANTLOAD));
+	}
+
+	dmp->dm_libctfp = malloc(sizeof (ctf_file_t *) * arg.dpa_count);
+	if (dmp->dm_libctfp == NULL) {
+		dt_proc_unlock(dtp, p);
+		dt_proc_release(dtp, p);
+		return (dt_set_errno(dtp, EDT_NOMEM));
+	}
+	bzero(dmp->dm_libctfp, sizeof (ctf_file_t *) * arg.dpa_count);
+
+	dmp->dm_libctfn = malloc(sizeof (char *) * arg.dpa_count);
+	if (dmp->dm_libctfn == NULL) {
+		free(dmp->dm_libctfp);
+		dt_proc_unlock(dtp, p);
+		dt_proc_release(dtp, p);
+		return (dt_set_errno(dtp, EDT_NOMEM));
+	}
+	bzero(dmp->dm_libctfn, sizeof (char *) * arg.dpa_count);
+
+	dmp->dm_nctflibs = arg.dpa_count;
+
+	arg.dpa_count = 0;
+	if (Pobject_iter_resolved(p, dt_module_load_proc_build, &arg) != 0) {
+		dt_proc_unlock(dtp, p);
+		dt_module_unload(dtp, dmp);
+		dt_proc_release(dtp, p);
+		return (dt_set_errno(dtp, EDT_CANTLOAD));
+	}
+	assert(arg.dpa_count == dmp->dm_nctflibs);
+	dt_dprintf("loaded %d ctf modules for pid %d\n", arg.dpa_count,
+	    (int)dmp->dm_pid);
+
+	dt_proc_unlock(dtp, p);
+	dt_proc_release(dtp, p);
+	dmp->dm_flags |= DT_DM_LOADED;
+
+	return (0);
+}
+
 int
 dt_module_load(dtrace_hdl_t *dtp, dt_module_t *dmp)
 {
 	if (dmp->dm_flags & DT_DM_LOADED)
 		return (0); /* module is already loaded */
 
+	if (dmp->dm_pid != 0)
+		return (dt_module_load_proc(dtp, dmp));
+
 	dmp->dm_ctdata.cts_name = ".SUNW_ctf";
 	dmp->dm_ctdata.cts_type = SHT_PROGBITS;
 	dmp->dm_ctdata.cts_flags = 0;
@@ -645,6 +835,14 @@ dt_module_load(dtrace_hdl_t *dtp, dt_mod
 	return (0);
 }
 
+int
+dt_module_hasctf(dtrace_hdl_t *dtp, dt_module_t *dmp)
+{
+	if (dmp->dm_pid != 0 && dmp->dm_nctflibs > 0)
+		return (1);
+	return (dt_module_getctf(dtp, dmp) != NULL);
+}
+
 ctf_file_t *
 dt_module_getctf(dtrace_hdl_t *dtp, dt_module_t *dmp)
 {
@@ -718,6 +916,8 @@ err:
 void
 dt_module_unload(dtrace_hdl_t *dtp, dt_module_t *dmp)
 {
+	int i;
+
 	ctf_close(dmp->dm_ctfp);
 	dmp->dm_ctfp = NULL;
 
@@ -733,6 +933,17 @@ dt_module_unload(dtrace_hdl_t *dtp, dt_m
 	}
 #endif
 
+	if (dmp->dm_libctfp != NULL) {
+		for (i = 0; i < dmp->dm_nctflibs; i++) {
+			ctf_close(dmp->dm_libctfp[i]);
+			free(dmp->dm_libctfn[i]);
+		}
+		free(dmp->dm_libctfp);
+		free(dmp->dm_libctfn);
+		dmp->dm_libctfp = NULL;
+		dmp->dm_nctflibs = 0;
+	}
+
 	bzero(&dmp->dm_ctdata, sizeof (ctf_sect_t));
 	bzero(&dmp->dm_symtab, sizeof (ctf_sect_t));
 	bzero(&dmp->dm_strtab, sizeof (ctf_sect_t));
@@ -778,6 +989,8 @@ dt_module_unload(dtrace_hdl_t *dtp, dt_m
 	(void) elf_end(dmp->dm_elf);
 	dmp->dm_elf = NULL;
 
+	dmp->dm_pid = 0;
+
 	dmp->dm_flags &= ~DT_DM_LOADED;
 }
 
@@ -866,6 +1079,34 @@ dt_module_modelname(dt_module_t *dmp)
 		return ("32-bit");
 }
 
+/* ARGSUSED */
+int
+dt_module_getlibid(dtrace_hdl_t *dtp, dt_module_t *dmp, const ctf_file_t *fp)
+{
+	int i;
+
+	for (i = 0; i < dmp->dm_nctflibs; i++) {
+		if (dmp->dm_libctfp[i] == fp)
+			return (i);
+	}
+
+	return (-1);
+}
+
+/* ARGSUSED */
+ctf_file_t *
+dt_module_getctflib(dtrace_hdl_t *dtp, dt_module_t *dmp, const char *name)
+{
+	int i;
+
+	for (i = 0; i < dmp->dm_nctflibs; i++) {
+		if (strcmp(dmp->dm_libctfn[i], name) == 0)
+			return (dmp->dm_libctfp[i]);
+	}
+
+	return (NULL);
+}
+
 /*
  * Update our module cache by adding an entry for the specified module 'name'.
  * We create the dt_module_t and populate it using /system/object//.
@@ -1294,8 +1535,10 @@ dtrace_lookup_by_type(dtrace_hdl_t *dtp,
 	dt_module_t *dmp;
 	int found = 0;
 	ctf_id_t id;
-	uint_t n;
+	uint_t n, i;
 	int justone;
+	ctf_file_t *fp;
+	char *buf, *p, *q;
 
 	uint_t mask = 0; /* mask of dt_module flags to match */
 	uint_t bits = 0; /* flag bits that must be present */
@@ -1310,7 +1553,6 @@ dtrace_lookup_by_type(dtrace_hdl_t *dtp,
 			return (-1); /* dt_errno is set for us */
 		n = 1;
 		justone = 1;
-
 	} else {
 		if (object == DTRACE_OBJ_KMODS)
 			mask = bits = DT_DM_KERNEL;
@@ -1334,7 +1576,7 @@ dtrace_lookup_by_type(dtrace_hdl_t *dtp,
 		 * module.  If our search was scoped to only one module then
 		 * return immediately leaving dt_errno unmodified.
 		 */
-		if (dt_module_getctf(dtp, dmp) == NULL) {
+		if (dt_module_hasctf(dtp, dmp) == 0) {
 			if (justone)
 				return (-1);
 			continue;
@@ -1346,13 +1588,38 @@ dtrace_lookup_by_type(dtrace_hdl_t *dtp,
 		 * 'tip' and keep going in the hope that we will locate the
 		 * underlying structure definition.  Otherwise just return.
 		 */
-		if ((id = ctf_lookup_by_name(dmp->dm_ctfp, name)) != CTF_ERR) {
+		if (dmp->dm_pid == 0) {
+			id = ctf_lookup_by_name(dmp->dm_ctfp, name);
+			fp = dmp->dm_ctfp;
+		} else {
+			if ((p = strchr(name, '`')) != NULL) {
+				buf = strdup(name);
+				if (buf == NULL)
+					return (dt_set_errno(dtp, EDT_NOMEM));
+				p = strchr(buf, '`');
+				if ((q = strchr(p + 1, '`')) != NULL)
+					p = q;
+				*p = '\0';
+				fp = dt_module_getctflib(dtp, dmp, buf);
+				if (fp == NULL || (id = ctf_lookup_by_name(fp,
+				    p + 1)) == CTF_ERR)
+					id = CTF_ERR;
+				free(buf);
+			} else {
+				for (i = 0; i < dmp->dm_nctflibs; i++) {
+					fp = dmp->dm_libctfp[i];
+					id = ctf_lookup_by_name(fp, name);
+					if (id != CTF_ERR)
+						break;
+				}
+			}
+		}
+		if (id != CTF_ERR) {
 			tip->dtt_object = dmp->dm_name;
-			tip->dtt_ctfp = dmp->dm_ctfp;
+			tip->dtt_ctfp = fp;
 			tip->dtt_type = id;
-
-			if (ctf_type_kind(dmp->dm_ctfp, ctf_type_resolve(
-			    dmp->dm_ctfp, id)) != CTF_K_FORWARD)
+			if (ctf_type_kind(fp, ctf_type_resolve(fp, id)) !=
+			    CTF_K_FORWARD)
 				return (0);

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Thu Jun 26 23:25:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 176FBAB0;
 Thu, 26 Jun 2014 23:25:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 014332468;
 Thu, 26 Jun 2014 23:25:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5QNP0PR080829;
 Thu, 26 Jun 2014 23:25:00 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5QNOxF0080791;
 Thu, 26 Jun 2014 23:24:59 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201406262324.s5QNOxF0080791@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 26 Jun 2014 23:24:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267942 - in head:
 cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs
 cddl/contrib/opensolaris/lib/libdtrace/common
 sys/cddl/contrib/opensolaris/uts/common/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 26 Jun 2014 23:25:01 -0000

Author: rpaulo
Date: Thu Jun 26 23:24:59 2014
New Revision: 267942
URL: http://svnweb.freebsd.org/changeset/base/267942

Log:
  MFV illumos
  
  4471 DTrace count() with histogram
  4472 DTrace full width distribution histograms
  4473 DTrace frequency trails
  
  MFC after:	2 weeks

Added:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d
     - copied unchanged from r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out
     - copied unchanged from r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d
     - copied unchanged from r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.agghist.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out
     - copied unchanged from r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d
     - copied unchanged from r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out
     - copied unchanged from r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh
     - copied unchanged from r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh.out
     - copied unchanged from r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d
     - copied unchanged from r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out
     - copied unchanged from r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggpackzoom.d.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d
     - copied unchanged from r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out
     - copied unchanged from r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggzoom.d.out
Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d (from r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d	Thu Jun 26 23:24:59 2014	(r267942, copy of r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d)
@@ -0,0 +1,32 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc.  All rights reserved.
+ */
+
+#pragma D option quiet
+#pragma D option encoding=utf8
+#pragma D option aggzoom
+
+tick-1ms
+/i++ < 320/
+{
+	@ = lquantize(i, 0, 640, 1, i);
+	@ = lquantize(641 - i, 0, 640, 1, i);
+}
+
+tick-1ms
+/i == 320/
+{
+	printa(@);
+	exit(0);
+}

Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out (from r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out	Thu Jun 26 23:24:59 2014	(r267942, copy of r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggencoding.d.out)
@@ -0,0 +1,646 @@
+
+
+           value  ------------- Distribution ------------- count    
+               0 |                                         0        
+               1 |                                         1        
+               2 |â–                                        2        
+               3 |â–Ž                                        3        
+               4 |â–                                        4        
+               5 |▌                                        5        
+               6 |â–‹                                        6        
+               7 |â–Š                                        7        
+               8 |â–‰                                        8        
+               9 |â–ˆ                                        9        
+              10 |█■                                      10       
+              11 |█▎                                       11       
+              12 |█■                                      12       
+              13 |█▌                                       13       
+              14 |█▋                                       14       
+              15 |█▊                                       15       
+              16 |█▉                                       16       
+              17 |██                                       17       
+              18 |██■                                     18       
+              19 |██▎                                      19       
+              20 |██■                                     20       
+              21 |██■                                     21       
+              22 |██▌                                      22       
+              23 |██▋                                      23       
+              24 |██▊                                      24       
+              25 |██▉                                      25       
+              26 |███                                      26       
+              27 |███■                                    27       
+              28 |███▎                                     28       
+              29 |███■                                    29       
+              30 |███▌                                     30       
+              31 |███▋                                     31       
+              32 |███▊                                     32       
+              33 |███▉                                     33       
+              34 |████                                     34       
+              35 |████■                                   35       
+              36 |████▎                                    36       
+              37 |████■                                   37       
+              38 |████▌                                    38       
+              39 |████▋                                    39       
+              40 |████▊                                    40       
+              41 |████▊                                    41       
+              42 |████▉                                    42       
+              43 |█████                                    43       
+              44 |█████■                                  44       
+              45 |█████▎                                   45       
+              46 |█████■                                  46       
+              47 |█████▌                                   47       
+              48 |█████▋                                   48       
+              49 |█████▊                                   49       
+              50 |█████▉                                   50       
+              51 |██████                                   51       
+              52 |██████■                                 52       
+              53 |██████▎                                  53       
+              54 |██████■                                 54       
+              55 |██████▌                                  55       
+              56 |██████▋                                  56       
+              57 |██████▊                                  57       
+              58 |██████▉                                  58       
+              59 |███████                                  59       
+              60 |███████■                                60       
+              61 |███████■                                61       
+              62 |███████▎                                 62       
+              63 |███████■                                63       
+              64 |███████▌                                 64       
+              65 |███████▋                                 65       
+              66 |███████▊                                 66       
+              67 |███████▉                                 67       
+              68 |████████                                 68       
+              69 |████████■                               69       
+              70 |████████▎                                70       
+              71 |████████■                               71       
+              72 |████████▌                                72       
+              73 |████████▋                                73       
+              74 |████████▊                                74       
+              75 |████████▉                                75       
+              76 |█████████                                76       
+              77 |█████████■                              77       
+              78 |█████████▎                               78       
+              79 |█████████■                              79       
+              80 |█████████▌                               80       
+              81 |█████████▌                               81       
+              82 |█████████▋                               82       
+              83 |█████████▊                               83       
+              84 |█████████▉                               84       
+              85 |██████████                               85       
+              86 |██████████■                             86       
+              87 |██████████▎                              87       
+              88 |██████████■                             88       
+              89 |██████████▌                              89       
+              90 |██████████▋                              90       
+              91 |██████████▊                              91       
+              92 |██████████▉                              92       
+              93 |███████████                              93       
+              94 |███████████■                            94       
+              95 |███████████▎                             95       
+              96 |███████████■                            96       
+              97 |███████████▌                             97       
+              98 |███████████▋                             98       
+              99 |███████████▊                             99       
+             100 |███████████▉                             100      
+             101 |███████████▉                             101      
+             102 |████████████                             102      
+             103 |████████████■                           103      
+             104 |████████████▎                            104      
+             105 |████████████■                           105      
+             106 |████████████▌                            106      
+             107 |████████████▋                            107      
+             108 |████████████▊                            108      
+             109 |████████████▉                            109      
+             110 |█████████████                            110      
+             111 |█████████████■                          111      
+             112 |█████████████▎                           112      
+             113 |█████████████■                          113      
+             114 |█████████████▌                           114      
+             115 |█████████████▋                           115      
+             116 |█████████████▊                           116      
+             117 |█████████████▉                           117      
+             118 |██████████████                           118      
+             119 |██████████████■                         119      
+             120 |██████████████▎                          120      
+             121 |██████████████▎                          121      
+             122 |██████████████■                         122      
+             123 |██████████████▌                          123      
+             124 |██████████████▋                          124      
+             125 |██████████████▊                          125      
+             126 |██████████████▉                          126      
+             127 |███████████████                          127      
+             128 |███████████████■                        128      
+             129 |███████████████▎                         129      
+             130 |███████████████■                        130      
+             131 |███████████████▌                         131      
+             132 |███████████████▋                         132      
+             133 |███████████████▊                         133      
+             134 |███████████████▉                         134      
+             135 |████████████████                         135      
+             136 |████████████████■                       136      
+             137 |████████████████▎                        137      
+             138 |████████████████■                       138      
+             139 |████████████████▌                        139      
+             140 |████████████████▋                        140      
+             141 |████████████████▋                        141      
+             142 |████████████████▊                        142      
+             143 |████████████████▉                        143      
+             144 |█████████████████                        144      
+             145 |█████████████████■                      145      
+             146 |█████████████████▎                       146      
+             147 |█████████████████■                      147      
+             148 |█████████████████▌                       148      
+             149 |█████████████████▋                       149      
+             150 |█████████████████▊                       150      
+             151 |█████████████████▉                       151      
+             152 |██████████████████                       152      
+             153 |██████████████████■                     153      
+             154 |██████████████████▎                      154      
+             155 |██████████████████■                     155      
+             156 |██████████████████▌                      156      
+             157 |██████████████████▋                      157      
+             158 |██████████████████▊                      158      
+             159 |██████████████████▉                      159      
+             160 |███████████████████                      160      
+             161 |███████████████████                      161      
+             162 |███████████████████■                    162      
+             163 |███████████████████▎                     163      
+             164 |███████████████████■                    164      
+             165 |███████████████████▌                     165      
+             166 |███████████████████▋                     166      
+             167 |███████████████████▊                     167      
+             168 |███████████████████▉                     168      
+             169 |████████████████████                     169      
+             170 |████████████████████■                   170      
+             171 |████████████████████▎                    171      
+             172 |████████████████████■                   172      
+             173 |████████████████████▌                    173      
+             174 |████████████████████▋                    174      
+             175 |████████████████████▊                    175      
+             176 |████████████████████▉                    176      
+             177 |█████████████████████                    177      
+             178 |█████████████████████■                  178      
+             179 |█████████████████████▎                   179      
+             180 |█████████████████████■                  180      
+             181 |█████████████████████■                  181      
+             182 |█████████████████████▌                   182      
+             183 |█████████████████████▋                   183      
+             184 |█████████████████████▊                   184      
+             185 |█████████████████████▉                   185      
+             186 |██████████████████████                   186      
+             187 |██████████████████████■                 187      
+             188 |██████████████████████▎                  188      
+             189 |██████████████████████■                 189      
+             190 |██████████████████████▌                  190      
+             191 |██████████████████████▋                  191      
+             192 |██████████████████████▊                  192      
+             193 |██████████████████████▉                  193      
+             194 |███████████████████████                  194      
+             195 |███████████████████████■                195      
+             196 |███████████████████████▎                 196      
+             197 |███████████████████████■                197      
+             198 |███████████████████████▌                 198      
+             199 |███████████████████████▋                 199      
+             200 |███████████████████████▊                 200      
+             201 |███████████████████████▊                 201      
+             202 |███████████████████████▉                 202      
+             203 |████████████████████████                 203      
+             204 |████████████████████████■               204      
+             205 |████████████████████████▎                205      
+             206 |████████████████████████■               206      
+             207 |████████████████████████▌                207      
+             208 |████████████████████████▋                208      
+             209 |████████████████████████▊                209      
+             210 |████████████████████████▉                210      
+             211 |█████████████████████████                211      
+             212 |█████████████████████████■              212      
+             213 |█████████████████████████▎               213      
+             214 |█████████████████████████■              214      
+             215 |█████████████████████████▌               215      
+             216 |█████████████████████████▋               216      
+             217 |█████████████████████████▊               217      
+             218 |█████████████████████████▉               218      
+             219 |██████████████████████████               219      
+             220 |██████████████████████████■             220      
+             221 |██████████████████████████■             221      
+             222 |██████████████████████████▎              222      
+             223 |██████████████████████████■             223      
+             224 |██████████████████████████▌              224      
+             225 |██████████████████████████▋              225      
+             226 |██████████████████████████▊              226      
+             227 |██████████████████████████▉              227      
+             228 |███████████████████████████              228      
+             229 |███████████████████████████■            229      
+             230 |███████████████████████████▎             230      
+             231 |███████████████████████████■            231      
+             232 |███████████████████████████▌             232      
+             233 |███████████████████████████▋             233      
+             234 |███████████████████████████▊             234      
+             235 |███████████████████████████▉             235      
+             236 |████████████████████████████             236      
+             237 |████████████████████████████■           237      
+             238 |████████████████████████████▎            238      
+             239 |████████████████████████████■           239      
+             240 |████████████████████████████▌            240      
+             241 |████████████████████████████▌            241      
+             242 |████████████████████████████▋            242      
+             243 |████████████████████████████▊            243      
+             244 |████████████████████████████▉            244      
+             245 |█████████████████████████████            245      
+             246 |█████████████████████████████■          246      
+             247 |█████████████████████████████▎           247      
+             248 |█████████████████████████████■          248      
+             249 |█████████████████████████████▌           249      
+             250 |█████████████████████████████▋           250      
+             251 |█████████████████████████████▊           251      
+             252 |█████████████████████████████▉           252      
+             253 |██████████████████████████████           253      
+             254 |██████████████████████████████■         254      
+             255 |██████████████████████████████▎          255      
+             256 |██████████████████████████████■         256      
+             257 |██████████████████████████████▌          257      
+             258 |██████████████████████████████▋          258      
+             259 |██████████████████████████████▊          259      
+             260 |██████████████████████████████▉          260      
+             261 |██████████████████████████████▉          261      
+             262 |███████████████████████████████          262      
+             263 |███████████████████████████████■        263      
+             264 |███████████████████████████████▎         264      
+             265 |███████████████████████████████■        265      
+             266 |███████████████████████████████▌         266      
+             267 |███████████████████████████████▋         267      
+             268 |███████████████████████████████▊         268      
+             269 |███████████████████████████████▉         269      
+             270 |████████████████████████████████         270      
+             271 |████████████████████████████████■       271      
+             272 |████████████████████████████████▎        272      
+             273 |████████████████████████████████■       273      
+             274 |████████████████████████████████▌        274      
+             275 |████████████████████████████████▋        275      
+             276 |████████████████████████████████▊        276      
+             277 |████████████████████████████████▉        277      
+             278 |█████████████████████████████████        278      
+             279 |█████████████████████████████████■      279      
+             280 |█████████████████████████████████▎       280      
+             281 |█████████████████████████████████▎       281      
+             282 |█████████████████████████████████■      282      
+             283 |█████████████████████████████████▌       283      
+             284 |█████████████████████████████████▋       284      
+             285 |█████████████████████████████████▊       285      
+             286 |█████████████████████████████████▉       286      
+             287 |██████████████████████████████████       287      
+             288 |██████████████████████████████████■     288      
+             289 |██████████████████████████████████▎      289      
+             290 |██████████████████████████████████■     290      
+             291 |██████████████████████████████████▌      291      
+             292 |██████████████████████████████████▋      292      
+             293 |██████████████████████████████████▊      293      
+             294 |██████████████████████████████████▉      294      
+             295 |███████████████████████████████████      295      
+             296 |███████████████████████████████████■    296      
+             297 |███████████████████████████████████▎     297      
+             298 |███████████████████████████████████■    298      
+             299 |███████████████████████████████████▌     299      
+             300 |███████████████████████████████████▋     300      
+             301 |███████████████████████████████████▋     301      
+             302 |███████████████████████████████████▊     302      
+             303 |███████████████████████████████████▉     303      
+             304 |████████████████████████████████████     304      
+             305 |████████████████████████████████████■   305      
+             306 |████████████████████████████████████▎    306      
+             307 |████████████████████████████████████■   307      
+             308 |████████████████████████████████████▌    308      
+             309 |████████████████████████████████████▋    309      
+             310 |████████████████████████████████████▊    310      
+             311 |████████████████████████████████████▉    311      
+             312 |█████████████████████████████████████    312      
+             313 |█████████████████████████████████████■  313      
+             314 |█████████████████████████████████████▎   314      
+             315 |█████████████████████████████████████■  315      
+             316 |█████████████████████████████████████▌   316      
+             317 |█████████████████████████████████████▋   317      
+             318 |█████████████████████████████████████▊   318      
+             319 |█████████████████████████████████████▉   319      
+             320 |██████████████████████████████████████   320      
+             321 |██████████████████████████████████████   320      
+             322 |█████████████████████████████████████▉   319      
+             323 |█████████████████████████████████████▊   318      
+             324 |█████████████████████████████████████▋   317      
+             325 |█████████████████████████████████████▌   316      
+             326 |█████████████████████████████████████■  315      
+             327 |█████████████████████████████████████▎   314      
+             328 |█████████████████████████████████████■  313      
+             329 |█████████████████████████████████████    312      
+             330 |████████████████████████████████████▉    311      
+             331 |████████████████████████████████████▊    310      
+             332 |████████████████████████████████████▋    309      
+             333 |████████████████████████████████████▌    308      
+             334 |████████████████████████████████████■   307      
+             335 |████████████████████████████████████▎    306      
+             336 |████████████████████████████████████■   305      
+             337 |████████████████████████████████████     304      
+             338 |███████████████████████████████████▉     303      
+             339 |███████████████████████████████████▊     302      
+             340 |███████████████████████████████████▋     301      
+             341 |███████████████████████████████████▋     300      
+             342 |███████████████████████████████████▌     299      
+             343 |███████████████████████████████████■    298      
+             344 |███████████████████████████████████▎     297      
+             345 |███████████████████████████████████■    296      
+             346 |███████████████████████████████████      295      
+             347 |██████████████████████████████████▉      294      
+             348 |██████████████████████████████████▊      293      
+             349 |██████████████████████████████████▋      292      
+             350 |██████████████████████████████████▌      291      
+             351 |██████████████████████████████████■     290      
+             352 |██████████████████████████████████▎      289      
+             353 |██████████████████████████████████■     288      
+             354 |██████████████████████████████████       287      
+             355 |█████████████████████████████████▉       286      
+             356 |█████████████████████████████████▊       285      
+             357 |█████████████████████████████████▋       284      
+             358 |█████████████████████████████████▌       283      
+             359 |█████████████████████████████████■      282      
+             360 |█████████████████████████████████▎       281      
+             361 |█████████████████████████████████▎       280      
+             362 |█████████████████████████████████■      279      
+             363 |█████████████████████████████████        278      
+             364 |████████████████████████████████▉        277      
+             365 |████████████████████████████████▊        276      
+             366 |████████████████████████████████▋        275      
+             367 |████████████████████████████████▌        274      
+             368 |████████████████████████████████■       273      
+             369 |████████████████████████████████▎        272      
+             370 |████████████████████████████████■       271      
+             371 |████████████████████████████████         270      
+             372 |███████████████████████████████▉         269      
+             373 |███████████████████████████████▊         268      
+             374 |███████████████████████████████▋         267      
+             375 |███████████████████████████████▌         266      
+             376 |███████████████████████████████■        265      
+             377 |███████████████████████████████▎         264      
+             378 |███████████████████████████████■        263      
+             379 |███████████████████████████████          262      
+             380 |██████████████████████████████▉          261      
+             381 |██████████████████████████████▉          260      
+             382 |██████████████████████████████▊          259      
+             383 |██████████████████████████████▋          258      
+             384 |██████████████████████████████▌          257      
+             385 |██████████████████████████████■         256      
+             386 |██████████████████████████████▎          255      
+             387 |██████████████████████████████■         254      
+             388 |██████████████████████████████           253      
+             389 |█████████████████████████████▉           252      
+             390 |█████████████████████████████▊           251      
+             391 |█████████████████████████████▋           250      
+             392 |█████████████████████████████▌           249      
+             393 |█████████████████████████████■          248      
+             394 |█████████████████████████████▎           247      
+             395 |█████████████████████████████■          246      
+             396 |█████████████████████████████            245      
+             397 |████████████████████████████▉            244      
+             398 |████████████████████████████▊            243      
+             399 |████████████████████████████▋            242      
+             400 |████████████████████████████▌            241      
+             401 |████████████████████████████▌            240      
+             402 |████████████████████████████■           239      
+             403 |████████████████████████████▎            238      
+             404 |████████████████████████████■           237      
+             405 |████████████████████████████             236      
+             406 |███████████████████████████▉             235      
+             407 |███████████████████████████▊             234      
+             408 |███████████████████████████▋             233      
+             409 |███████████████████████████▌             232      
+             410 |███████████████████████████■            231      
+             411 |███████████████████████████▎             230      
+             412 |███████████████████████████■            229      
+             413 |███████████████████████████              228      
+             414 |██████████████████████████▉              227      
+             415 |██████████████████████████▊              226      
+             416 |██████████████████████████▋              225      
+             417 |██████████████████████████▌              224      
+             418 |██████████████████████████■             223      
+             419 |██████████████████████████▎              222      
+             420 |██████████████████████████■             221      
+             421 |██████████████████████████■             220      
+             422 |██████████████████████████               219      
+             423 |█████████████████████████▉               218      
+             424 |█████████████████████████▊               217      
+             425 |█████████████████████████▋               216      
+             426 |█████████████████████████▌               215      
+             427 |█████████████████████████■              214      
+             428 |█████████████████████████▎               213      
+             429 |█████████████████████████■              212      
+             430 |█████████████████████████                211      
+             431 |████████████████████████▉                210      
+             432 |████████████████████████▊                209      
+             433 |████████████████████████▋                208      
+             434 |████████████████████████▌                207      
+             435 |████████████████████████■               206      
+             436 |████████████████████████▎                205      
+             437 |████████████████████████■               204      
+             438 |████████████████████████                 203      
+             439 |███████████████████████▉                 202      
+             440 |███████████████████████▊                 201      
+             441 |███████████████████████▊                 200      
+             442 |███████████████████████▋                 199      
+             443 |███████████████████████▌                 198      
+             444 |███████████████████████■                197      
+             445 |███████████████████████▎                 196      
+             446 |███████████████████████■                195      
+             447 |███████████████████████                  194      
+             448 |██████████████████████▉                  193      
+             449 |██████████████████████▊                  192      
+             450 |██████████████████████▋                  191      
+             451 |██████████████████████▌                  190      
+             452 |██████████████████████■                 189      
+             453 |██████████████████████▎                  188      
+             454 |██████████████████████■                 187      
+             455 |██████████████████████                   186      
+             456 |█████████████████████▉                   185      
+             457 |█████████████████████▊                   184      
+             458 |█████████████████████▋                   183      
+             459 |█████████████████████▌                   182      
+             460 |█████████████████████■                  181      
+             461 |█████████████████████■                  180      
+             462 |█████████████████████▎                   179      
+             463 |█████████████████████■                  178      
+             464 |█████████████████████                    177      
+             465 |████████████████████▉                    176      
+             466 |████████████████████▊                    175      
+             467 |████████████████████▋                    174      
+             468 |████████████████████▌                    173      
+             469 |████████████████████■                   172      
+             470 |████████████████████▎                    171      
+             471 |████████████████████■                   170      
+             472 |████████████████████                     169      
+             473 |███████████████████▉                     168      
+             474 |███████████████████▊                     167      
+             475 |███████████████████▋                     166      
+             476 |███████████████████▌                     165      
+             477 |███████████████████■                    164      
+             478 |███████████████████▎                     163      
+             479 |███████████████████■                    162      
+             480 |███████████████████                      161      
+             481 |███████████████████                      160      
+             482 |██████████████████▉                      159      
+             483 |██████████████████▊                      158      
+             484 |██████████████████▋                      157      
+             485 |██████████████████▌                      156      
+             486 |██████████████████■                     155      
+             487 |██████████████████▎                      154      
+             488 |██████████████████■                     153      
+             489 |██████████████████                       152      
+             490 |█████████████████▉                       151      
+             491 |█████████████████▊                       150      
+             492 |█████████████████▋                       149      
+             493 |█████████████████▌                       148      
+             494 |█████████████████■                      147      
+             495 |█████████████████▎                       146      
+             496 |█████████████████■                      145      
+             497 |█████████████████                        144      
+             498 |████████████████▉                        143      
+             499 |████████████████▊                        142      
+             500 |████████████████▋                        141      
+             501 |████████████████▋                        140      
+             502 |████████████████▌                        139      
+             503 |████████████████■                       138      
+             504 |████████████████▎                        137      
+             505 |████████████████■                       136      
+             506 |████████████████                         135      
+             507 |███████████████▉                         134      
+             508 |███████████████▊                         133      
+             509 |███████████████▋                         132      
+             510 |███████████████▌                         131      
+             511 |███████████████■                        130      
+             512 |███████████████▎                         129      
+             513 |███████████████■                        128      
+             514 |███████████████                          127      
+             515 |██████████████▉                          126      
+             516 |██████████████▊                          125      
+             517 |██████████████▋                          124      
+             518 |██████████████▌                          123      
+             519 |██████████████■                         122      
+             520 |██████████████▎                          121      
+             521 |██████████████▎                          120      
+             522 |██████████████■                         119      
+             523 |██████████████                           118      
+             524 |█████████████▉                           117      
+             525 |█████████████▊                           116      
+             526 |█████████████▋                           115      
+             527 |█████████████▌                           114      
+             528 |█████████████■                          113      
+             529 |█████████████▎                           112      
+             530 |█████████████■                          111      
+             531 |█████████████                            110      
+             532 |████████████▉                            109      
+             533 |████████████▊                            108      
+             534 |████████████▋                            107      
+             535 |████████████▌                            106      
+             536 |████████████■                           105      
+             537 |████████████▎                            104      
+             538 |████████████■                           103      
+             539 |████████████                             102      
+             540 |███████████▉                             101      
+             541 |███████████▉                             100      
+             542 |███████████▊                             99       
+             543 |███████████▋                             98       
+             544 |███████████▌                             97       
+             545 |███████████■                            96       
+             546 |███████████▎                             95       
+             547 |███████████■                            94       
+             548 |███████████                              93       
+             549 |██████████▉                              92       
+             550 |██████████▊                              91       
+             551 |██████████▋                              90       
+             552 |██████████▌                              89       
+             553 |██████████■                             88       
+             554 |██████████▎                              87       
+             555 |██████████■                             86       
+             556 |██████████                               85       
+             557 |█████████▉                               84       
+             558 |█████████▊                               83       
+             559 |█████████▋                               82       
+             560 |█████████▌                               81       
+             561 |█████████▌                               80       
+             562 |█████████■                              79       
+             563 |█████████▎                               78       
+             564 |█████████■                              77       
+             565 |█████████                                76       
+             566 |████████▉                                75       
+             567 |████████▊                                74       
+             568 |████████▋                                73       
+             569 |████████▌                                72       
+             570 |████████■                               71       
+             571 |████████▎                                70       
+             572 |████████■                               69       
+             573 |████████                                 68       
+             574 |███████▉                                 67       
+             575 |███████▊                                 66       
+             576 |███████▋                                 65       
+             577 |███████▌                                 64       
+             578 |███████■                                63       
+             579 |███████▎                                 62       
+             580 |███████■                                61       
+             581 |███████■                                60       
+             582 |███████                                  59       
+             583 |██████▉                                  58       
+             584 |██████▊                                  57       
+             585 |██████▋                                  56       
+             586 |██████▌                                  55       
+             587 |██████■                                 54       
+             588 |██████▎                                  53       
+             589 |██████■                                 52       
+             590 |██████                                   51       
+             591 |█████▉                                   50       
+             592 |█████▊                                   49       
+             593 |█████▋                                   48       
+             594 |█████▌                                   47       
+             595 |█████■                                  46       
+             596 |█████▎                                   45       
+             597 |█████■                                  44       
+             598 |█████                                    43       
+             599 |████▉                                    42       
+             600 |████▊                                    41       
+             601 |████▊                                    40       
+             602 |████▋                                    39       
+             603 |████▌                                    38       
+             604 |████■                                   37       
+             605 |████▎                                    36       
+             606 |████■                                   35       
+             607 |████                                     34       
+             608 |███▉                                     33       
+             609 |███▊                                     32       
+             610 |███▋                                     31       
+             611 |███▌                                     30       
+             612 |███■                                    29       
+             613 |███▎                                     28       
+             614 |███■                                    27       
+             615 |███                                      26       
+             616 |██▉                                      25       
+             617 |██▊                                      24       
+             618 |██▋                                      23       
+             619 |██▌                                      22       
+             620 |██■                                     21       
+             621 |██■                                     20       
+             622 |██▎                                      19       
+             623 |██■                                     18       
+             624 |██                                       17       
+             625 |█▉                                       16       
+             626 |█▊                                       15       
+             627 |█▋                                       14       
+             628 |█▌                                       13       
+             629 |█■                                      12       
+             630 |█▎                                       11       
+             631 |█■                                      10       
+             632 |â–ˆ                                        9        
+             633 |â–‰                                        8        
+             634 |â–Š                                        7        
+             635 |â–‹                                        6        
+             636 |▌                                        5        
+             637 |â–                                        4        
+             638 |â–Ž                                        3        
+             639 |â–                                        2        
+          >= 640 |                                         1        
+
+

Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d (from r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.agghist.d)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d	Thu Jun 26 23:24:59 2014	(r267942, copy of r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.agghist.d)
@@ -0,0 +1,46 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc.  All rights reserved.
+ */
+
+#pragma D option agghist
+#pragma D option quiet
+
+BEGIN
+{
+	@["demerit"] = sum(-10);
+	@["wtf"] = sum(10);
+	@["bot"] = sum(20);
+
+	@bagnoogle["SOAP/XML"] = sum(1);
+	@bagnoogle["XACML store"] = sum(5);
+	@bagnoogle["SAML token"] = sum(6);
+
+	@stalloogle["breakfast"] = sum(-5);
+	@stalloogle["non-diet pepsi"] = sum(-20);
+	@stalloogle["parrot"] = sum(-100);
+
+	printa(@);
+	printa(@bagnoogle);
+	printa(@stalloogle);
+
+	printf("\nzoomed:");
+
+	setopt("aggzoom");
+	printa(@);
+	printa(@bagnoogle);
+	printa(@stalloogle);
+
+	exit(0);
+}
+

Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out (from r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out	Thu Jun 26 23:24:59 2014	(r267942, copy of r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.agghist.d.out)
@@ -0,0 +1,38 @@
+
+
+              key  ------------- Distribution ------------- count    
+          demerit                @@@@@|                     -10      
+              wtf                     |@@@@@                10       
+              bot                     |@@@@@@@@@@           20       
+
+
+              key  ------------- Distribution ------------- count    
+         SOAP/XML |@@@                                      1        
+      XACML store |@@@@@@@@@@@@@@@@@                        5        
+       SAML token |@@@@@@@@@@@@@@@@@@@@                     6        
+
+
+              key  ------------- Distribution ------------- count    
+           parrot         @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -100     
+   non-diet pepsi                                   @@@@@@| -20      
+        breakfast                                       @@| -5       
+
+zoomed:
+
+              key  ------------- Distribution ------------- count    
+          demerit           @@@@@@@@@@|                     -10      
+              wtf                     |@@@@@@@@@@           10       
+              bot                     |@@@@@@@@@@@@@@@@@@@  20       
+
+
+              key  ------------- Distribution ------------- count    
+         SOAP/XML |@@@@@@@                                  1        
+      XACML store |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@        5        
+       SAML token |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6        
+
+
+              key  ------------- Distribution ------------- count    
+           parrot   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| -100     
+   non-diet pepsi                                 @@@@@@@@| -20      
+        breakfast                                       @@| -5       
+

Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d (from r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d	Thu Jun 26 23:24:59 2014	(r267942, copy of r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d)
@@ -0,0 +1,53 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2013 Joyent, Inc.  All rights reserved.
+ */
+
+#pragma D option aggpack
+#pragma D option encoding=ascii
+#pragma D option quiet
+
+BEGIN
+{
+	@x = quantize(1 << 32);
+	@y[1] = quantize(1);
+	@z["mumble"] = quantize(1);
+	@xx["foo", (char)1, (short)2, (long)3] = quantize(1);
+
+	@neg = lquantize(-10, -10, 20, 1, -1);
+	@neg = lquantize(-5, -10, 20, 1, 1);
+	@neg = lquantize(0, -10, 20, 1, 1);
+
+	i = 0;
+}
+
+tick-1ms
+{
+	@a[i] = quantize(0, i);
+	@a[i] = quantize(1, 100 - i);
+	i++;
+}
+
+tick-1ms
+/i > 100/
+{
+	exit(0);
+}
+
+END
+{
+	setopt("aggzoom", "true");
+	printa(@neg);
+	setopt("aggzoom", "false");
+	printa(@neg);
+}

Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out (from r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out	Thu Jun 26 23:24:59 2014	(r267942, copy of r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggpack.d.out)
@@ -0,0 +1,124 @@
+
+
+     min .--------------------------------. max      | count
+   < -10 : V    X    X                    : >= 20    | 1
+
+
+     min .--------------------------------. max      | count
+   < -10 : v    x    x                    : >= 20    | 1
+
+
+        min .---. max        | count
+ 2147483648 : X : 8589934592 | 1
+
+      key  min .---. max  | count
+        1    0 : X : 2    | 1
+
+              key  min .---. max  | count
+           mumble    0 : X : 2    | 1
+
+                                         key  min .---. max  | count
+              foo   1     2                3    0 : X : 2    | 1
+
+      key  min .---. max  | count
+      100    0 :X  : 2    | 100
+       99    0 :X_ : 2    | 100
+       98    0 :X_ : 2    | 100
+       97    0 :X_ : 2    | 100
+       96    0 :X_ : 2    | 100
+       95    0 :X_ : 2    | 100
+       94    0 :X_ : 2    | 100
+       93    0 :X_ : 2    | 100
+       92    0 :X_ : 2    | 100
+       91    0 :X_ : 2    | 100
+       90    0 :X_ : 2    | 100
+       89    0 :X_ : 2    | 100
+       88    0 :X_ : 2    | 100
+       87    0 :X_ : 2    | 100
+       86    0 :X_ : 2    | 100
+       85    0 :X_ : 2    | 100
+       84    0 :X_ : 2    | 100
+       83    0 :X_ : 2    | 100
+       82    0 :X_ : 2    | 100
+       81    0 :X_ : 2    | 100
+       80    0 :X_ : 2    | 100
+       79    0 :X_ : 2    | 100
+       78    0 :xx : 2    | 100
+       77    0 :xx : 2    | 100
+       76    0 :xx : 2    | 100
+       75    0 :xx : 2    | 100
+       74    0 :xx : 2    | 100
+       73    0 :xx : 2    | 100
+       72    0 :xx : 2    | 100
+       71    0 :xx : 2    | 100
+       70    0 :xx : 2    | 100
+       69    0 :xx : 2    | 100
+       68    0 :xx : 2    | 100
+       67    0 :xx : 2    | 100
+       66    0 :xx : 2    | 100
+       65    0 :xx : 2    | 100
+       64    0 :xx : 2    | 100
+       63    0 :xx : 2    | 100
+       62    0 :xx : 2    | 100
+       61    0 :xx : 2    | 100
+       60    0 :xx : 2    | 100
+       59    0 :xx : 2    | 100
+       58    0 :xx : 2    | 100
+       57    0 :xx : 2    | 100
+       56    0 :xx : 2    | 100
+       55    0 :xx : 2    | 100
+       54    0 :xx : 2    | 100
+       53    0 :xx : 2    | 100
+       52    0 :xx : 2    | 100
+       51    0 :xx : 2    | 100
+       50    0 :xx : 2    | 100
+       49    0 :xx : 2    | 100
+       48    0 :xx : 2    | 100
+       47    0 :xx : 2    | 100
+       46    0 :xx : 2    | 100
+       45    0 :xx : 2    | 100
+       44    0 :xx : 2    | 100
+       43    0 :xx : 2    | 100
+       42    0 :xx : 2    | 100
+       41    0 :xx : 2    | 100
+       40    0 :xx : 2    | 100
+       39    0 :xx : 2    | 100
+       38    0 :xx : 2    | 100
+       37    0 :xx : 2    | 100
+       36    0 :xx : 2    | 100
+       35    0 :xx : 2    | 100
+       34    0 :xx : 2    | 100
+       33    0 :xx : 2    | 100
+       32    0 :xx : 2    | 100
+       31    0 :xx : 2    | 100
+       30    0 :xx : 2    | 100
+       29    0 :xx : 2    | 100
+       28    0 :xx : 2    | 100
+       27    0 :xx : 2    | 100
+       26    0 :xx : 2    | 100
+       25    0 :xx : 2    | 100
+       24    0 :xx : 2    | 100
+       23    0 :xx : 2    | 100
+       22    0 :xx : 2    | 100
+       21    0 :_X : 2    | 100
+       20    0 :_X : 2    | 100
+       19    0 :_X : 2    | 100
+       18    0 :_X : 2    | 100
+       17    0 :_X : 2    | 100
+       16    0 :_X : 2    | 100
+       15    0 :_X : 2    | 100
+       14    0 :_X : 2    | 100
+       13    0 :_X : 2    | 100
+       12    0 :_X : 2    | 100
+       11    0 :_X : 2    | 100
+       10    0 :_X : 2    | 100
+        9    0 :_X : 2    | 100
+        8    0 :_X : 2    | 100
+        7    0 :_X : 2    | 100
+        6    0 :_X : 2    | 100
+        5    0 :_X : 2    | 100
+        4    0 :_X : 2    | 100
+        3    0 :_X : 2    | 100
+        2    0 :_X : 2    | 100
+        1    0 :_X : 2    | 100
+        0    0 : X : 2    | 100

Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh (from r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh	Thu Jun 26 23:24:59 2014	(r267942, copy of r266992, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.aggpackbanner.ksh)
@@ -0,0 +1,75 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source.  A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2013 Joyent, Inc.  All rights reserved.
+#
+
+let width=8
+
+function outputchar
+{
+	banner $3 | /bin/nawk -v line=$1 -v pos=$2 -v width=$width '{ \
+		for (i = 1; i <= length($0); i++) { \
+			if (substr($0, i, 1) == " ") \
+				continue; \
+			printf("\t@letter%d[%d] = lquantize(%d, 0, 40, 1);\n", \
+			    line, NR, i + (pos * width));
+		} \
+	}'
+}
+
+function outputstr
+{
+	let pos=0;
+	let line=0
+
+	printf "#pragma D option aggpack\n#pragma D option aggsortkey\n"
+
+	printf "BEGIN\n{\n"
+	for c in `echo "$1" | /bin/nawk '{ \
+		for (i = 1; i <= length($0); i++) { \
+			c = substr($0, i, 1); \

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 05:04:37 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2262CE5A;
 Fri, 27 Jun 2014 05:04:37 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0E1552FD1;
 Fri, 27 Jun 2014 05:04:37 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5R54a8l045693;
 Fri, 27 Jun 2014 05:04:36 GMT (envelope-from mjg@svn.freebsd.org)
Received: (from mjg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5R54aCa045692;
 Fri, 27 Jun 2014 05:04:36 GMT (envelope-from mjg@svn.freebsd.org)
Message-Id: <201406270504.s5R54aCa045692@svn.freebsd.org>
From: Mateusz Guzik 
Date: Fri, 27 Jun 2014 05:04:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267947 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 05:04:37 -0000

Author: mjg
Date: Fri Jun 27 05:04:36 2014
New Revision: 267947
URL: http://svnweb.freebsd.org/changeset/base/267947

Log:
  Check lower bound of cmsg_len.
  
  If passed cm->cmsg_len was below cmsghdr size the experssion:
  datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data;
  
  would give negative result. However, in practice it would not
  result in a crash because the kernel would try to obtain garbage fds
  for given process and would error out with EBADF.
  
  PR:		124908
  Submitted by:	campbell mumble.net (modified a little)
  MFC after:	1 week

Modified:
  head/sys/kern/uipc_usrreq.c

Modified: head/sys/kern/uipc_usrreq.c
==============================================================================
--- head/sys/kern/uipc_usrreq.c	Fri Jun 27 04:17:05 2014	(r267946)
+++ head/sys/kern/uipc_usrreq.c	Fri Jun 27 05:04:36 2014	(r267947)
@@ -1859,7 +1859,7 @@ unp_internalize(struct mbuf **controlp, 
 	*controlp = NULL;
 	while (cm != NULL) {
 		if (sizeof(*cm) > clen || cm->cmsg_level != SOL_SOCKET
-		    || cm->cmsg_len > clen) {
+		    || cm->cmsg_len > clen || cm->cmsg_len < sizeof(*cm)) {
 			error = EINVAL;
 			goto out;
 		}

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 05:27:38 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 38EAF4FD;
 Fri, 27 Jun 2014 05:27:38 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 26A6F2194;
 Fri, 27 Jun 2014 05:27:38 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5R5RcXe055481;
 Fri, 27 Jun 2014 05:27:38 GMT (envelope-from grehan@svn.freebsd.org)
Received: (from grehan@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5R5RcLg055480;
 Fri, 27 Jun 2014 05:27:38 GMT (envelope-from grehan@svn.freebsd.org)
Message-Id: <201406270527.s5R5RcLg055480@svn.freebsd.org>
From: Peter Grehan 
Date: Fri, 27 Jun 2014 05:27:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267949 - head/usr.sbin/bhyve
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 05:27:38 -0000

Author: grehan
Date: Fri Jun 27 05:27:37 2014
New Revision: 267949
URL: http://svnweb.freebsd.org/changeset/base/267949

Log:
  Set the version and date to fixed fields rather than using
  preprocessor macros that don't allow reproducible builds.
  As a side-effect, the date string is now spec-compliant.
  
  root@bhyve:~ # dmidecode
  # dmidecode 2.12
  SMBIOS 2.4 present.
  12 structures occupying 514 bytes.
  Table at 0x000F101F.
  
  Handle 0x0001, DMI type 0, 24 bytes
  BIOS Information
          Vendor: BHYVE
          Version: 1.0
          Release Date: 03/14/2014
  
  Submitted by:	des (original version)
  Reviewed by:	tychon
  MFC after:	1 week

Modified:
  head/usr.sbin/bhyve/smbiostbl.c

Modified: head/usr.sbin/bhyve/smbiostbl.c
==============================================================================
--- head/usr.sbin/bhyve/smbiostbl.c	Fri Jun 27 05:15:53 2014	(r267948)
+++ head/usr.sbin/bhyve/smbiostbl.c	Fri Jun 27 05:27:37 2014	(r267949)
@@ -321,8 +321,8 @@ struct smbios_table_type0 smbios_type0_t
 
 const char *smbios_type0_strings[] = {
 	"BHYVE",	/* vendor string */
-	__TIME__,	/* bios version string */
-	__DATE__,	/* bios release date string */
+	"1.00",		/* bios version string */
+	"03/14/2014",	/* bios release date string */
 	NULL
 };
 

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 06:52:38 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id F175D291;
 Fri, 27 Jun 2014 06:52:37 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DF834292F;
 Fri, 27 Jun 2014 06:52:37 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5R6qbQC097569;
 Fri, 27 Jun 2014 06:52:37 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5R6qbWD097568;
 Fri, 27 Jun 2014 06:52:37 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406270652.s5R6qbWD097568@svn.freebsd.org>
From: Alexander Motin 
Date: Fri, 27 Jun 2014 06:52:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267952 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 06:52:38 -0000

Author: mav
Date: Fri Jun 27 06:52:37 2014
New Revision: 267952
URL: http://svnweb.freebsd.org/changeset/base/267952

Log:
  Fix typo in r267481.
  
  MFC after:	3 days

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Fri Jun 27 05:50:55 2014	(r267951)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Fri Jun 27 06:52:37 2014	(r267952)
@@ -2410,7 +2410,7 @@ cfiscsi_lun_enable(void *arg, struct ctl
 	target = ctl_get_opt(control_softc->ctl_luns[lun_id]->be_lun,
 	    "cfiscsi_target");
 	target_alias = ctl_get_opt(control_softc->ctl_luns[lun_id]->be_lun,
-	    "cfiscsi_target)alias");
+	    "cfiscsi_target_alias");
 	lun = ctl_get_opt(control_softc->ctl_luns[lun_id]->be_lun,
 	    "cfiscsi_lun");
 

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 10:24:37 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 12AEC5FF;
 Fri, 27 Jun 2014 10:24:37 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D9CAA2C76;
 Fri, 27 Jun 2014 10:24:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RAOaLr096698;
 Fri, 27 Jun 2014 10:24:36 GMT
 (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RAOaCe096697;
 Fri, 27 Jun 2014 10:24:36 GMT
 (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201406271024.s5RAOaCe096697@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Fri, 27 Jun 2014 10:24:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267955 - head/sys/dev/usb/net
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 10:24:37 -0000

Author: hselasky
Date: Fri Jun 27 10:24:36 2014
New Revision: 267955
URL: http://svnweb.freebsd.org/changeset/base/267955

Log:
  Add proper rangechecks in "axge_rx_frame()" function and
  fix receive loop header parsing.
  
  MFC after:	3 days
  PR:		191432

Modified:
  head/sys/dev/usb/net/if_axge.c

Modified: head/sys/dev/usb/net/if_axge.c
==============================================================================
--- head/sys/dev/usb/net/if_axge.c	Fri Jun 27 10:07:00 2014	(r267954)
+++ head/sys/dev/usb/net/if_axge.c	Fri Jun 27 10:24:36 2014	(r267955)
@@ -929,14 +929,19 @@ axge_ioctl(struct ifnet *ifp, u_long cmd
 static int
 axge_rx_frame(struct usb_ether *ue, struct usb_page_cache *pc, int actlen)
 {
-	int error, pos;
+	int error;
+	int pos;
 	int pkt_cnt;
-	uint32_t rxhdr, pkt_hdr;
-	uint16_t hdr_off;
-	uint16_t len, pktlen; 
+	uint32_t rxhdr;
+	uint32_t pkt_hdr;
+	uint32_t hdr_off;
+	uint32_t pktlen; 
+
+	/* verify we have enough data */
+	if (actlen < (int)sizeof(rxhdr))
+		return (EINVAL);
 
 	pos = 0;
-	len = 0;
 	error = 0;
 
 	usbd_copy_out(pc, actlen - sizeof(rxhdr), &rxhdr, sizeof(rxhdr));
@@ -945,25 +950,29 @@ axge_rx_frame(struct usb_ether *ue, stru
 	pkt_cnt = (uint16_t)rxhdr;
 	hdr_off = (uint16_t)(rxhdr >> 16);
 
-	usbd_copy_out(pc, hdr_off, &pkt_hdr, sizeof(pkt_hdr));
-
 	while (pkt_cnt > 0) {
-		if ((int)(sizeof(pkt_hdr)) > actlen) {
+		/* verify the header offset */
+		if ((int)(hdr_off + sizeof(pkt_hdr)) > actlen) {
 			error = EINVAL;
 			break;
 		}
+		usbd_copy_out(pc, hdr_off, &pkt_hdr, sizeof(pkt_hdr));
+
 		pkt_hdr = le32toh(pkt_hdr);
 		pktlen = (pkt_hdr >> 16) & 0x1fff;
 		if ((pkt_hdr & AXGE_RXHDR_CRC_ERR) ||
 		    (pkt_hdr & AXGE_RXHDR_DROP_ERR))
 			ue->ue_ifp->if_ierrors++;
+		/* verify the data payload */
+		if (pktlen < 6 || (int)(pos + 2 + pktlen - 6) > actlen) {
+			error = EINVAL;
+			break;
+		}
 		axge_rxeof(ue, pc, pos + 2, pktlen - 6, pkt_hdr);
-		len = (pktlen + 7) & ~7;
-		pos += len;
-		pkt_hdr++;
+		pos += (pktlen + 7) & ~7;
+		hdr_off += sizeof(pkt_hdr);
 		pkt_cnt--;
 	}
-
 	if (error != 0)
 		ue->ue_ifp->if_ierrors++;
 	return (error);

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 10:27:20 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 81D447C8;
 Fri, 27 Jun 2014 10:27:20 +0000 (UTC)
Received: from mail.turbocat.net (mail.turbocat.net
 [IPv6:2a01:4f8:d16:4514::2])
 (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4643C2CAC;
 Fri, 27 Jun 2014 10:27:20 +0000 (UTC)
Received: from laptop015.home.selasky.org
 (cm-176.74.213.204.customer.telag.net [176.74.213.204])
 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits))
 (No client certificate requested)
 by mail.turbocat.net (Postfix) with ESMTPSA id B1E541FE02D;
 Fri, 27 Jun 2014 12:27:18 +0200 (CEST)
Message-ID: <53AD471B.5080408@selasky.org>
Date: Fri, 27 Jun 2014 12:27:39 +0200
From: Hans Petter Selasky 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:24.0) Gecko/20100101 Thunderbird/24.1.0
MIME-Version: 1.0
To: Kevin Lo , svn-src-head@freebsd.org
Subject: Re: svn commit: r266490 - head/sys/dev/usb/net
References: <201405210809.s4L89jXL075920@svn.freebsd.org>
In-Reply-To: <201405210809.s4L89jXL075920@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 10:27:20 -0000

Hi Kevin,

axge_rx_frame() looked a bit broken. I've tried to fix it:

http://svnweb.freebsd.org/changeset/base/267955

and

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191432

Please verify!

Thank you!

--HPS

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 15:20:35 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9F157B60;
 Fri, 27 Jun 2014 15:20:35 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 800B92AC8;
 Fri, 27 Jun 2014 15:20:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RFKZwq037098;
 Fri, 27 Jun 2014 15:20:35 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RFKYUt037094;
 Fri, 27 Jun 2014 15:20:34 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201406271520.s5RFKYUt037094@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 27 Jun 2014 15:20:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267959 - in head/usr.sbin: bhyve bhyveload
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 15:20:35 -0000

Author: jhb
Date: Fri Jun 27 15:20:34 2014
New Revision: 267959
URL: http://svnweb.freebsd.org/changeset/base/267959

Log:
  Sort command flags in usage output and the manpages.

Modified:
  head/usr.sbin/bhyve/bhyve.8
  head/usr.sbin/bhyve/bhyverun.c
  head/usr.sbin/bhyveload/bhyveload.8
  head/usr.sbin/bhyveload/bhyveload.c

Modified: head/usr.sbin/bhyve/bhyve.8
==============================================================================
--- head/usr.sbin/bhyve/bhyve.8	Fri Jun 27 14:42:13 2014	(r267958)
+++ head/usr.sbin/bhyve/bhyve.8	Fri Jun 27 15:20:34 2014	(r267959)
@@ -35,10 +35,10 @@
 .Op Fl abehwxACHPWY
 .Op Fl c Ar numcpus
 .Op Fl g Ar gdbport
+.Op Fl l Ar lpcdev Ns Op , Ns Ar conf
 .Op Fl m Ar size Ns Op Ar K|k|M|m|G|g|T|t
 .Op Fl p Ar vcpu:hostcpu
 .Op Fl s Ar slot,emulation Ns Op , Ns Ar conf
-.Op Fl l Ar lpcdev Ns Op , Ns Ar conf
 .Op Fl U Ar uuid
 .Ar vmname
 .Sh DESCRIPTION
@@ -78,9 +78,11 @@ Number of guest virtual CPUs.
 The default is 1 and the maximum is 16.
 .It Fl C
 Include guest memory in core file.
-.It Fl H
-Yield the virtual CPU thread when a HLT instruction is detected.
-If this option is not specified, virtual CPUs will use 100% of a host CPU.
+.It Fl e
+Force
+.Nm
+to exit when a guest issues an access to an I/O port that is not emulated.
+This is intended for debug purposes.
 .It Fl g Ar gdbport
 For
 .Fx
@@ -89,6 +91,26 @@ kernels compiled with
 allow a remote kernel kgdb to be relayed to the guest kernel gdb stub
 via a local IPv4 address and this port.
 This option will be deprecated in a future version.
+.It Fl h
+Print help message and exit.
+.It Fl H
+Yield the virtual CPU thread when a HLT instruction is detected.
+If this option is not specified, virtual CPUs will use 100% of a host CPU.
+.It Fl l Ar lpcdev Ns Op , Ns Ar conf
+Allow devices behind the LPC PCI-ISA bridge to be configured.
+The only supported devices are the TTY-class devices,
+.Li com1
+and
+.Li com2 .
+.It Fl m Ar size Ns Op Ar K|k|M|m|G|g|T|t
+Guest physical memory size in bytes.
+This must be the same size that was given to
+.Xr bhyveload 8 .
+.Pp
+The size argument may be suffixed with one of K, M, G or T (either upper
+or lower case) to indicate a multiple of kilobytes, megabytes, gigabytes,
+or terabytes.
+If no suffix is given, the value is assumed to be in megabytes.
 .It Fl p Ar vcpu:hostcpu
 Pin guest's virtual CPU
 .Em vcpu
@@ -96,9 +118,6 @@ to
 .Em hostcpu .
 .It Fl P
 Force the guest virtual CPU to exit when a PAUSE instruction is detected.
-.It Fl W
-Force virtio PCI device emulations to use MSI interrupts instead of MSI-X
-interrupts.
 .It Fl s Ar slot,emulation Ns Op , Ns Ar conf
 Configure a virtual PCI slot and function.
 .Pp
@@ -219,26 +238,6 @@ The host device must have been reserved 
 loader variable as described in
 .Xr vmm 4 .
 .El
-.It Fl l Ar lpcdev Ns Op , Ns Ar conf
-Allow devices behind the LPC PCI-ISA bridge to be configured.
-The only supported devices are the TTY-class devices,
-.Li com1
-and
-.Li com2 .
-.It Fl m Ar size Ns Op Ar K|k|M|m|G|g|T|t
-Guest physical memory size in bytes.
-This must be the same size that was given to
-.Xr bhyveload 8 .
-.Pp
-The size argument may be suffixed with one of K, M, G or T (either upper
-or lower case) to indicate a multiple of kilobytes, megabytes, gigabytes,
-or terabytes.
-If no suffix is given, the value is assumed to be in megabytes.
-.It Fl e
-Force
-.Nm
-to exit when a guest issues an access to an I/O port that is not emulated.
-This is intended for debug purposes.
 .It Fl U Ar uuid
 Set the universally unique identifier
 .Pq UUID
@@ -247,12 +246,13 @@ By default a UUID is generated from the 
 .Ar vmname .
 .It Fl w
 Ignore accesses to unimplemented Model Specific Registers (MSRs). This is intended for debug purposes.
+.It Fl W
+Force virtio PCI device emulations to use MSI interrupts instead of MSI-X
+interrupts.
 .It Fl x
 The guest's local APIC is configured in x2APIC mode.
 .It Fl Y
 Disable MPtable generation.
-.It Fl h
-Print help message and exit.
 .It Ar vmname
 Alphanumeric name of the guest.
 This should be the same as that created by

Modified: head/usr.sbin/bhyve/bhyverun.c
==============================================================================
--- head/usr.sbin/bhyve/bhyverun.c	Fri Jun 27 14:42:13 2014	(r267958)
+++ head/usr.sbin/bhyve/bhyverun.c	Fri Jun 27 15:20:34 2014	(r267959)
@@ -129,26 +129,26 @@ usage(int code)
 {
 
         fprintf(stderr,
-                "Usage: %s [-abehwxACHPWY] [-g ] [-s ] [-c vcpus]\n"
-		"       %*s [-p vcpu:hostcpu] [-m mem] [-l ] [-U uuid] \n"
+                "Usage: %s [-abehwxACHPWY] [-c vcpus] [-g ] [-l ]\n"
+		"       %*s [-m mem] [-p vcpu:hostcpu] [-s ] [-U uuid] \n"
 		"       -a: local apic is in xAPIC mode (deprecated)\n"
 		"       -A: create ACPI tables\n"
-		"       -g: gdb port\n"
 		"       -c: # cpus (default 1)\n"
 		"       -C: include guest memory in core file\n"
-		"       -p: pin 'vcpu' to 'hostcpu'\n"
-		"       -H: vmexit from the guest on hlt\n"
-		"       -P: vmexit from the guest on pause\n"
-		"       -W: force virtio to use single-vector MSI\n"
 		"       -e: exit on unhandled I/O access\n"
+		"       -g: gdb port\n"
 		"       -h: help\n"
-		"       -s:  PCI slot config\n"
+		"       -H: vmexit from the guest on hlt\n"
 		"       -l: LPC device configuration\n"
 		"       -m: memory size in MB\n"
+		"       -p: pin 'vcpu' to 'hostcpu'\n"
+		"       -P: vmexit from the guest on pause\n"
+		"       -s:  PCI slot config\n"
+		"       -U: uuid\n"
 		"       -w: ignore unimplemented MSRs\n"
+		"       -W: force virtio to use single-vector MSI\n"
 		"       -x: local apic is in x2APIC mode\n"
-		"       -Y: disable MPtable generation\n"
-		"       -U: uuid\n",
+		"       -Y: disable MPtable generation\n",
 		progname, (int)strlen(progname), "");
 
 	exit(code);

Modified: head/usr.sbin/bhyveload/bhyveload.8
==============================================================================
--- head/usr.sbin/bhyveload/bhyveload.8	Fri Jun 27 14:42:13 2014	(r267958)
+++ head/usr.sbin/bhyveload/bhyveload.8	Fri Jun 27 15:20:34 2014	(r267959)
@@ -35,11 +35,11 @@
 guest inside a bhyve virtual machine
 .Sh SYNOPSIS
 .Nm
-.Op Fl m Ar mem-size
+.Op Fl c Ar cons-dev
 .Op Fl d Ar disk-path
-.Op Fl h Ar host-path
 .Op Fl e Ar name=value
-.Op Fl c Ar cons-dev
+.Op Fl h Ar host-path
+.Op Fl m Ar mem-size
 .Ar vmname
 .Sh DESCRIPTION
 .Nm
@@ -62,6 +62,32 @@ and will be created if it does not alrea
 .Sh OPTIONS
 The following options are available:
 .Bl -tag -width indent
+.It Fl c Ar cons-dev
+.Ar cons-dev
+is a
+.Xr tty 4
+device to use for
+.Nm
+terminal I/O.
+.Pp
+The text string "stdio" is also accepted and selects the use of
+unbuffered standard I/O. This is the default value.
+.It Fl d Ar disk-path
+The
+.Ar disk-path
+is the pathname of the guest's boot disk image.
+.It Fl e Ar name=value
+Set the FreeBSD loader environment variable
+.Ar name
+to
+.Ar value .
+.Pp
+The option may be used more than once to set more than one environment
+variable.
+.It Fl h Ar host-path
+The
+.Ar host-path
+is the directory at the top of the guest's boot filesystem.
 .It Fl m Ar mem-size Xo
 .Sm off
 .Op Cm K | k | M | m | G | g | T | t
@@ -85,32 +111,6 @@ respectively.
 The default value of
 .Ar mem-size
 is 256M.
-.It Fl d Ar disk-path
-The
-.Ar disk-path
-is the pathname of the guest's boot disk image.
-.It Fl h Ar host-path
-The
-.Ar host-path
-is the directory at the top of the guest's boot filesystem.
-.It Fl e Ar name=value
-Set the FreeBSD loader environment variable
-.Ar name
-to
-.Ar value .
-.Pp
-The option may be used more than once to set more than one environment
-variable.
-.It Fl c Ar cons-dev
-.Ar cons-dev
-is a
-.Xr tty 4
-device to use for
-.Nm
-terminal I/O.
-.Pp
-The text string "stdio" is also accepted and selects the use of
-unbuffered standard I/O. This is the default value.
 .El
 .Sh EXAMPLES
 To create a virtual machine named

Modified: head/usr.sbin/bhyveload/bhyveload.c
==============================================================================
--- head/usr.sbin/bhyveload/bhyveload.c	Fri Jun 27 14:42:13 2014	(r267958)
+++ head/usr.sbin/bhyveload/bhyveload.c	Fri Jun 27 15:20:34 2014	(r267959)
@@ -629,8 +629,8 @@ usage(void)
 {
 
 	fprintf(stderr,
-	    "usage: %s [-m mem-size] [-d ] [-h ]\n"
-	    "       %*s [-e ] [-c ] \n",
+	    "usage: %s [-c ] [-d ] [-e ]\n"
+	    "       %*s [-h ] [-m mem-size] \n",
 	    progname,
 	    (int)strlen(progname), "");
 	exit(1);

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 15:23:12 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 90DE5D0A;
 Fri, 27 Jun 2014 15:23:12 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7DD892B06;
 Fri, 27 Jun 2014 15:23:12 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RFNC6w040030;
 Fri, 27 Jun 2014 15:23:12 GMT
 (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RFNCSY040029;
 Fri, 27 Jun 2014 15:23:12 GMT
 (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201406271523.s5RFNCSY040029@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Fri, 27 Jun 2014 15:23:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267960 - head/sbin/sysctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 15:23:12 -0000

Author: hselasky
Date: Fri Jun 27 15:23:12 2014
New Revision: 267960
URL: http://svnweb.freebsd.org/changeset/base/267960

Log:
  Don't hide zero-length strings when doing sysctl listings.
  
  MFC after:	1 week

Modified:
  head/sbin/sysctl/sysctl.c

Modified: head/sbin/sysctl/sysctl.c
==============================================================================
--- head/sbin/sysctl/sysctl.c	Fri Jun 27 15:20:34 2014	(r267959)
+++ head/sbin/sysctl/sysctl.c	Fri Jun 27 15:23:12 2014	(r267960)
@@ -710,9 +710,10 @@ show_var(int *oid, int nlen)
 		warnx("malloc failed");
 		return (1);
 	}
+	ctltype = (kind & CTLTYPE);
 	len = j;
 	i = sysctl(oid, nlen, val, &len, 0, 0);
-	if (i || !len) {
+	if (i != 0 || (len == 0 && ctltype != CTLTYPE_STRING)) {
 		free(oval);
 		return (1);
 	}
@@ -724,7 +725,6 @@ show_var(int *oid, int nlen)
 	}
 	val[len] = '\0';
 	p = val;
-	ctltype = (kind & CTLTYPE);
 	sign = ctl_sign[ctltype];
 	intlen = ctl_size[ctltype];
 

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 16:33:54 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5598A469;
 Fri, 27 Jun 2014 16:33:54 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3D84E2244;
 Fri, 27 Jun 2014 16:33:54 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RGXsIb076675;
 Fri, 27 Jun 2014 16:33:54 GMT
 (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RGXih6076565;
 Fri, 27 Jun 2014 16:33:44 GMT
 (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201406271633.s5RGXih6076565@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Fri, 27 Jun 2014 16:33:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267961 - in head/sys: amd64/acpica amd64/amd64 amd64/pci
 amd64/vmm arm/arm arm/freescale/imx arm/xscale/ixp425 cam cam/ata cam/ctl
 cam/scsi cddl/compat/opensolaris/kern cddl/contrib/op...
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 16:33:54 -0000

Author: hselasky
Date: Fri Jun 27 16:33:43 2014
New Revision: 267961
URL: http://svnweb.freebsd.org/changeset/base/267961

Log:
  Extend the meaning of the CTLFLAG_TUN flag to automatically check if
  there is an environment variable which shall initialize the SYSCTL
  during early boot. This works for all SYSCTL types both statically and
  dynamically created ones, except for the SYSCTL NODE type and SYSCTLs
  which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to
  be used in the case a tunable sysctl has a custom initialisation
  function allowing the sysctl to still be marked as a tunable. The
  kernel SYSCTL API is mostly the same, with a few exceptions for some
  special operations like iterating childrens of a static/extern SYSCTL
  node. This operation should probably be made into a factored out
  common macro, hence some device drivers use this. The reason for
  changing the SYSCTL API was the need for a SYSCTL parent OID pointer
  and not only the SYSCTL parent OID list pointer in order to quickly
  generate the sysctl path. The motivation behind this patch is to avoid
  parameter loading cludges inside the OFED driver subsystem. Instead of
  adding special code to the OFED driver subsystem to post-load tunables
  into dynamically created sysctls, we generalize this in the kernel.
  
  Other changes:
  - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask"
  to "hw.pcic.intr_mask".
  - Removed redundant TUNABLE statements throughout the kernel.
  - Some minor code rewrites in connection to removing not needed
  TUNABLE statements.
  - Added a missing SYSCTL_DECL().
  - Wrapped two very long lines.
  - Avoid malloc()/free() inside sysctl string handling, in case it is
  called to initialize a sysctl from a tunable, hence malloc()/free() is
  not ready when sysctls from the sysctl dataset are registered.
  - Bumped FreeBSD version to indicate SYSCTL API change.
  
  MFC after:	2 weeks
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/amd64/acpica/acpi_machdep.c
  head/sys/amd64/amd64/amd64_mem.c
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/amd64/mp_watchdog.c
  head/sys/amd64/amd64/pmap.c
  head/sys/amd64/amd64/sys_machdep.c
  head/sys/amd64/amd64/trap.c
  head/sys/amd64/pci/pci_cfgreg.c
  head/sys/amd64/vmm/vmm.c
  head/sys/arm/arm/busdma_machdep-v6.c
  head/sys/arm/arm/busdma_machdep.c
  head/sys/arm/arm/dump_machdep.c
  head/sys/arm/arm/platform.c
  head/sys/arm/arm/pmap-v6.c
  head/sys/arm/freescale/imx/imx6_anatop.c
  head/sys/arm/xscale/ixp425/if_npe.c
  head/sys/arm/xscale/ixp425/ixp425_npe.c
  head/sys/arm/xscale/ixp425/ixp425_qmgr.c
  head/sys/cam/ata/ata_da.c
  head/sys/cam/ata/ata_pmp.c
  head/sys/cam/cam.c
  head/sys/cam/cam_xpt.c
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_backend_block.c
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/cam/scsi/scsi_cd.c
  head/sys/cam/scsi/scsi_da.c
  head/sys/cam/scsi/scsi_enc_safte.c
  head/sys/cam/scsi/scsi_sa.c
  head/sys/cam/scsi/scsi_xpt.c
  head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
  head/sys/cddl/dev/dtrace/dtrace_sysctl.c
  head/sys/compat/ia32/ia32_sysvec.c
  head/sys/compat/x86bios/x86bios.c
  head/sys/dev/aac/aac_pci.c
  head/sys/dev/acpica/Osd/OsdSchedule.c
  head/sys/dev/acpica/acpi_cpu.c
  head/sys/dev/acpica/acpi_ec.c
  head/sys/dev/amr/amr_pci.c
  head/sys/dev/ata/ata-all.c
  head/sys/dev/ath/ah_osdep.c
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_debug.c
  head/sys/dev/bce/if_bce.c
  head/sys/dev/bge/if_bge.c
  head/sys/dev/bwn/if_bwn.c
  head/sys/dev/bxe/bxe.c
  head/sys/dev/cardbus/cardbus.c
  head/sys/dev/cs/if_cs.c
  head/sys/dev/cxgb/cxgb_include.h
  head/sys/dev/cxgb/cxgb_main.c
  head/sys/dev/cxgb/cxgb_sge.c
  head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c
  head/sys/dev/cxgbe/iw_cxgbe/cm.c
  head/sys/dev/drm/drm_drv.c
  head/sys/dev/drm/drm_sysctl.c
  head/sys/dev/drm2/drm_drv.c
  head/sys/dev/drm2/drm_sysctl.c
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/fb/vesa.c
  head/sys/dev/firewire/fwohci.c
  head/sys/dev/firewire/if_fwe.c
  head/sys/dev/firewire/if_fwip.c
  head/sys/dev/firewire/sbp.c
  head/sys/dev/glxiic/glxiic.c
  head/sys/dev/hptmv/hptproc.c
  head/sys/dev/hwpmc/hwpmc_logging.c
  head/sys/dev/hwpmc/hwpmc_mod.c
  head/sys/dev/iscsi/icl.c
  head/sys/dev/iscsi/iscsi.c
  head/sys/dev/iscsi_initiator/iscsi.c
  head/sys/dev/ixgbe/ixgbe.c
  head/sys/dev/malo/if_malo.c
  head/sys/dev/malo/if_malo_pci.c
  head/sys/dev/mfi/mfi.c
  head/sys/dev/mfi/mfi_cam.c
  head/sys/dev/mfi/mfi_pci.c
  head/sys/dev/mfi/mfi_tbolt.c
  head/sys/dev/mwl/if_mwl.c
  head/sys/dev/nand/nand.c
  head/sys/dev/pccard/pccard.c
  head/sys/dev/pccbb/pccbb.c
  head/sys/dev/pccbb/pccbb_isa.c
  head/sys/dev/pci/pci.c
  head/sys/dev/pci/pci_pci.c
  head/sys/dev/pci/vga_pci.c
  head/sys/dev/puc/puc_pci.c
  head/sys/dev/rt/if_rt.c
  head/sys/dev/sdhci/sdhci.c
  head/sys/dev/sdhci/sdhci_pci.c
  head/sys/dev/si/si.c
  head/sys/dev/sio/sio.c
  head/sys/dev/sis/if_sis.c
  head/sys/dev/sound/pcm/channel.c
  head/sys/dev/sound/pcm/feeder_chain.c
  head/sys/dev/sound/pcm/feeder_eq.c
  head/sys/dev/sound/pcm/feeder_rate.c
  head/sys/dev/sound/pcm/mixer.c
  head/sys/dev/sound/pcm/sound.c
  head/sys/dev/sound/usb/uaudio.c
  head/sys/dev/syscons/syscons.c
  head/sys/dev/uart/uart_dev_ns8250.c
  head/sys/dev/usb/controller/dwc_otg.c
  head/sys/dev/usb/controller/ehci.c
  head/sys/dev/usb/controller/ohci.c
  head/sys/dev/usb/controller/uhci.c
  head/sys/dev/usb/controller/usb_controller.c
  head/sys/dev/usb/controller/xhci.c
  head/sys/dev/usb/input/ukbd.c
  head/sys/dev/usb/serial/uftdi.c
  head/sys/dev/usb/serial/usb_serial.c
  head/sys/dev/usb/storage/umass.c
  head/sys/dev/usb/usb_debug.c
  head/sys/dev/usb/usb_dev.c
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usb_generic.c
  head/sys/dev/usb/usb_hub.c
  head/sys/dev/usb/usb_process.c
  head/sys/dev/usb/wlan/if_uath.c
  head/sys/dev/usb/wlan/if_upgt.c
  head/sys/dev/usb/wlan/if_urtw.c
  head/sys/dev/vt/vt.h
  head/sys/dev/wpi/if_wpi.c
  head/sys/gdb/gdb_cons.c
  head/sys/geom/concat/g_concat.c
  head/sys/geom/eli/g_eli.c
  head/sys/geom/eli/g_eli_key_cache.c
  head/sys/geom/gate/g_gate.c
  head/sys/geom/geom_disk.c
  head/sys/geom/geom_kern.c
  head/sys/geom/journal/g_journal.c
  head/sys/geom/label/g_label.c
  head/sys/geom/label/g_label.h
  head/sys/geom/linux_lvm/g_linux_lvm.c
  head/sys/geom/mirror/g_mirror.c
  head/sys/geom/part/g_part.c
  head/sys/geom/part/g_part_ldm.c
  head/sys/geom/raid/g_raid.c
  head/sys/geom/raid/g_raid.h
  head/sys/geom/raid/tr_raid1.c
  head/sys/geom/raid/tr_raid1e.c
  head/sys/geom/raid3/g_raid3.c
  head/sys/geom/shsec/g_shsec.c
  head/sys/geom/stripe/g_stripe.c
  head/sys/geom/vinum/geom_vinum.c
  head/sys/geom/virstor/g_virstor.c
  head/sys/i386/acpica/acpi_machdep.c
  head/sys/i386/bios/apm.c
  head/sys/i386/i386/i686_mem.c
  head/sys/i386/i386/machdep.c
  head/sys/i386/i386/mp_watchdog.c
  head/sys/i386/i386/pmap.c
  head/sys/i386/i386/trap.c
  head/sys/i386/pci/pci_cfgreg.c
  head/sys/i386/pci/pci_pir.c
  head/sys/ia64/ia64/dump_machdep.c
  head/sys/ia64/ia64/pmap.c
  head/sys/kern/imgact_elf.c
  head/sys/kern/kern_clocksource.c
  head/sys/kern/kern_cpu.c
  head/sys/kern/kern_exec.c
  head/sys/kern/kern_intr.c
  head/sys/kern/kern_ktr.c
  head/sys/kern/kern_ktrace.c
  head/sys/kern/kern_linker.c
  head/sys/kern/kern_malloc.c
  head/sys/kern/kern_mbuf.c
  head/sys/kern/kern_mib.c
  head/sys/kern/kern_ntptime.c
  head/sys/kern/kern_osd.c
  head/sys/kern/kern_pmc.c
  head/sys/kern/kern_priv.c
  head/sys/kern/kern_shutdown.c
  head/sys/kern/kern_sig.c
  head/sys/kern/kern_sysctl.c
  head/sys/kern/kern_tc.c
  head/sys/kern/kern_timeout.c
  head/sys/kern/subr_bus.c
  head/sys/kern/subr_kdb.c
  head/sys/kern/subr_msgbuf.c
  head/sys/kern/subr_param.c
  head/sys/kern/subr_prf.c
  head/sys/kern/subr_rman.c
  head/sys/kern/subr_smp.c
  head/sys/kern/subr_witness.c
  head/sys/kern/sys_pipe.c
  head/sys/kern/sysv_msg.c
  head/sys/kern/sysv_sem.c
  head/sys/kern/sysv_shm.c
  head/sys/kern/vfs_init.c
  head/sys/kern/vfs_lookup.c
  head/sys/mips/cavium/usb/octusb.c
  head/sys/mips/mips/dump_machdep.c
  head/sys/mips/rt305x/uart_dev_rt305x.c
  head/sys/net/ieee8023ad_lacp.c
  head/sys/net/if.c
  head/sys/net/if_bridge.c
  head/sys/net/if_lagg.c
  head/sys/net/if_stf.c
  head/sys/net/if_tap.c
  head/sys/net/if_tun.c
  head/sys/net/netisr.c
  head/sys/net/route.c
  head/sys/netgraph/ng_base.c
  head/sys/netgraph/ng_mppc.c
  head/sys/netinet/in_mcast.c
  head/sys/netinet/in_rss.c
  head/sys/netinet/tcp_subr.c
  head/sys/netinet6/in6_mcast.c
  head/sys/netinet6/mld6.c
  head/sys/netpfil/ipfw/ip_fw2.c
  head/sys/netpfil/pf/pf.c
  head/sys/pc98/cbus/sio.c
  head/sys/pc98/pc98/machdep.c
  head/sys/pc98/pc98/pc98_machdep.c
  head/sys/security/mac_biba/mac_biba.c
  head/sys/security/mac_bsdextended/mac_bsdextended.c
  head/sys/security/mac_ifoff/mac_ifoff.c
  head/sys/security/mac_lomac/mac_lomac.c
  head/sys/security/mac_mls/mac_mls.c
  head/sys/security/mac_portacl/mac_portacl.c
  head/sys/sparc64/pci/psycho.c
  head/sys/sys/malloc.h
  head/sys/sys/param.h
  head/sys/sys/sysctl.h
  head/sys/vm/memguard.c
  head/sys/vm/redzone.c
  head/sys/vm/uma_core.c
  head/sys/vm/vm_init.c
  head/sys/vm/vm_map.c
  head/sys/vm/vm_mmap.c
  head/sys/vm/vm_page.c
  head/sys/vm/vm_radix.c
  head/sys/vm/vm_zeroidle.c
  head/sys/x86/cpufreq/hwpstate.c
  head/sys/x86/iommu/intel_utils.c
  head/sys/x86/pci/pci_bus.c
  head/sys/x86/x86/dump_machdep.c
  head/sys/x86/x86/io_apic.c
  head/sys/x86/x86/mca.c
  head/sys/x86/x86/tsc.c

Modified: head/sys/amd64/acpica/acpi_machdep.c
==============================================================================
--- head/sys/amd64/acpica/acpi_machdep.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/amd64/acpica/acpi_machdep.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -45,9 +45,8 @@ __FBSDID("$FreeBSD$");
 #include 
 
 int acpi_resume_beep;
-TUNABLE_INT("debug.acpi.resume_beep", &acpi_resume_beep);
-SYSCTL_INT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RW, &acpi_resume_beep,
-    0, "Beep the PC speaker when resuming");
+SYSCTL_INT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RWTUN,
+    &acpi_resume_beep, 0, "Beep the PC speaker when resuming");
 
 int acpi_reset_video;
 TUNABLE_INT("hw.acpi.reset_video", &acpi_reset_video);

Modified: head/sys/amd64/amd64/amd64_mem.c
==============================================================================
--- head/sys/amd64/amd64/amd64_mem.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/amd64/amd64/amd64_mem.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -69,7 +69,6 @@ static char *mem_owner_bios = "BIOS";
 	(((curr) & ~MDF_ATTRMASK) | ((new) & MDF_ATTRMASK))
 
 static int mtrrs_disabled;
-TUNABLE_INT("machdep.disable_mtrrs", &mtrrs_disabled);
 SYSCTL_INT(_machdep, OID_AUTO, disable_mtrrs, CTLFLAG_RDTUN,
     &mtrrs_disabled, 0, "Disable amd64 MTRRs.");
 

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/amd64/amd64/machdep.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -675,8 +675,7 @@ cpu_halt(void)
 void (*cpu_idle_hook)(sbintime_t) = NULL;	/* ACPI idle hook. */
 static int	cpu_ident_amdc1e = 0;	/* AMD C1E supported. */
 static int	idle_mwait = 1;		/* Use MONITOR/MWAIT for short idle. */
-TUNABLE_INT("machdep.idle_mwait", &idle_mwait);
-SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RW, &idle_mwait,
+SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RWTUN, &idle_mwait,
     0, "Use MONITOR/MWAIT for short idle");
 
 #define	STATE_RUNNING	0x0

Modified: head/sys/amd64/amd64/mp_watchdog.c
==============================================================================
--- head/sys/amd64/amd64/mp_watchdog.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/amd64/amd64/mp_watchdog.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -68,8 +68,7 @@ static int	watchdog_dontfire = 1;
 static int	watchdog_timer = -1;
 static int	watchdog_nmi = 1;
 
-TUNABLE_INT("debug.watchdog", &watchdog_cpu);
-SYSCTL_INT(_debug, OID_AUTO, watchdog_nmi, CTLFLAG_RW, &watchdog_nmi, 0,
+SYSCTL_INT(_debug, OID_AUTO, watchdog_nmi, CTLFLAG_RWTUN, &watchdog_nmi, 0,
     "IPI the boot processor with an NMI to enter the debugger");
 
 static struct callout	watchdog_callout;

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/amd64/amd64/pmap.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -332,8 +332,8 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pat_works
     "Is page attribute table fully functional?");
 
 static int pg_ps_enabled = 1;
-SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN, &pg_ps_enabled, 0,
-    "Are large page mappings enabled?");
+SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH,
+    &pg_ps_enabled, 0, "Are large page mappings enabled?");
 
 #define	PAT_INDEX_SIZE	8
 static int pat_index[PAT_INDEX_SIZE];	/* cache mode to PAT index conversion */
@@ -368,8 +368,8 @@ static int pmap_flags = PMAP_PDE_SUPERPA
 static struct unrhdr pcid_unr;
 static struct mtx pcid_mtx;
 int pmap_pcid_enabled = 0;
-SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN, &pmap_pcid_enabled,
-    0, "Is TLB Context ID enabled ?");
+SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH,
+    &pmap_pcid_enabled, 0, "Is TLB Context ID enabled ?");
 int invpcid_works = 0;
 SYSCTL_INT(_vm_pmap, OID_AUTO, invpcid_works, CTLFLAG_RD, &invpcid_works, 0,
     "Is the invpcid instruction available ?");

Modified: head/sys/amd64/amd64/sys_machdep.c
==============================================================================
--- head/sys/amd64/amd64/sys_machdep.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/amd64/amd64/sys_machdep.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -73,7 +73,6 @@ static void
 max_ldt_segment_init(void *arg __unused)
 {
 
-	TUNABLE_INT_FETCH("machdep.max_ldt_segment", &max_ldt_segment);
 	if (max_ldt_segment <= 0)
 		max_ldt_segment = 1;
 	if (max_ldt_segment > MAX_LD)

Modified: head/sys/amd64/amd64/trap.c
==============================================================================
--- head/sys/amd64/amd64/trap.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/amd64/amd64/trap.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -143,20 +143,18 @@ static char *trap_msg[] = {
 
 #ifdef KDB
 static int kdb_on_nmi = 1;
-SYSCTL_INT(_machdep, OID_AUTO, kdb_on_nmi, CTLFLAG_RW,
+SYSCTL_INT(_machdep, OID_AUTO, kdb_on_nmi, CTLFLAG_RWTUN,
 	&kdb_on_nmi, 0, "Go to KDB on NMI");
-TUNABLE_INT("machdep.kdb_on_nmi", &kdb_on_nmi);
 #endif
 static int panic_on_nmi = 1;
-SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RW,
+SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RWTUN,
 	&panic_on_nmi, 0, "Panic on NMI");
-TUNABLE_INT("machdep.panic_on_nmi", &panic_on_nmi);
 static int prot_fault_translation;
-SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RW,
+SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RWTUN,
     &prot_fault_translation, 0,
     "Select signal to deliver on protection fault");
 static int uprintf_signal;
-SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RW,
+SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RWTUN,
     &uprintf_signal, 0,
     "Print debugging information on trap signal to ctty");
 

Modified: head/sys/amd64/pci/pci_cfgreg.c
==============================================================================
--- head/sys/amd64/pci/pci_cfgreg.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/amd64/pci/pci_cfgreg.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -65,7 +65,6 @@ static int pcie_minbus, pcie_maxbus;
 static uint32_t pcie_badslots;
 static struct mtx pcicfg_mtx;
 static int mcfg_enable = 1;
-TUNABLE_INT("hw.pci.mcfg", &mcfg_enable);
 SYSCTL_INT(_hw_pci, OID_AUTO, mcfg, CTLFLAG_RDTUN, &mcfg_enable, 0,
     "Enable support for PCI-e memory mapped config access");
 

Modified: head/sys/amd64/vmm/vmm.c
==============================================================================
--- head/sys/amd64/vmm/vmm.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/amd64/vmm/vmm.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -199,7 +199,6 @@ SYSCTL_NODE(_hw, OID_AUTO, vmm, CTLFLAG_
  * interrupts disabled.
  */
 static int halt_detection_enabled = 1;
-TUNABLE_INT("hw.vmm.halt_detection", &halt_detection_enabled);
 SYSCTL_INT(_hw_vmm, OID_AUTO, halt_detection, CTLFLAG_RDTUN,
     &halt_detection_enabled, 0,
     "Halt VM if all vcpus execute HLT with interrupts disabled");

Modified: head/sys/arm/arm/busdma_machdep-v6.c
==============================================================================
--- head/sys/arm/arm/busdma_machdep-v6.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/arm/arm/busdma_machdep-v6.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -224,10 +224,10 @@ busdma_init(void *dummy)
 /*
  * This init historically used SI_SUB_VM, but now the init code requires
  * malloc(9) using M_DEVBUF memory, which is set up later than SI_SUB_VM, by
- * SI_SUB_KMEM and SI_ORDER_SECOND, so we'll go right after that by using
- * SI_SUB_KMEM and SI_ORDER_THIRD.
+ * SI_SUB_KMEM and SI_ORDER_THIRD, so we'll go right after that by using
+ * SI_SUB_KMEM and SI_ORDER_FOURTH.
  */
-SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_THIRD, busdma_init, NULL);
+SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_FOURTH, busdma_init, NULL);
 
 static __inline int
 _bus_dma_can_bounce(vm_offset_t lowaddr, vm_offset_t highaddr)

Modified: head/sys/arm/arm/busdma_machdep.c
==============================================================================
--- head/sys/arm/arm/busdma_machdep.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/arm/arm/busdma_machdep.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -276,10 +276,10 @@ busdma_init(void *dummy)
 /*
  * This init historically used SI_SUB_VM, but now the init code requires
  * malloc(9) using M_DEVBUF memory, which is set up later than SI_SUB_VM, by
- * SI_SUB_KMEM and SI_ORDER_SECOND, so we'll go right after that by using
- * SI_SUB_KMEM and SI_ORDER_THIRD.
+ * SI_SUB_KMEM and SI_ORDER_THIRD, so we'll go right after that by using
+ * SI_SUB_KMEM and SI_ORDER_FOURTH.
  */
-SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_THIRD, busdma_init, NULL);
+SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_FOURTH, busdma_init, NULL);
 
 /*
  * End block of code useful to transplant to other implementations.

Modified: head/sys/arm/arm/dump_machdep.c
==============================================================================
--- head/sys/arm/arm/dump_machdep.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/arm/arm/dump_machdep.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -50,8 +50,7 @@ __FBSDID("$FreeBSD$");
 CTASSERT(sizeof(struct kerneldumpheader) == 512);
 
 int do_minidump = 1;
-TUNABLE_INT("debug.minidump", &do_minidump);
-SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RW, &do_minidump, 0,
+SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RWTUN, &do_minidump, 0,
     "Enable mini crash dumps");
 
 /*

Modified: head/sys/arm/arm/platform.c
==============================================================================
--- head/sys/arm/arm/platform.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/arm/arm/platform.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -65,8 +65,8 @@ static platform_t	plat_obj;
 static struct kobj_ops	plat_kernel_kops;
 static struct platform_kobj	plat_kernel_obj;
 
-static char plat_name[64] = "";
-SYSCTL_STRING(_hw, OID_AUTO, platform, CTLFLAG_RDTUN, plat_name, 0,
+static char plat_name[64];
+SYSCTL_STRING(_hw, OID_AUTO, platform, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, plat_name, 0,
     "Platform currently in use");
 
 /*

Modified: head/sys/arm/arm/pmap-v6.c
==============================================================================
--- head/sys/arm/arm/pmap-v6.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/arm/arm/pmap-v6.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -465,7 +465,7 @@ static SYSCTL_NODE(_vm, OID_AUTO, pmap, 
 
 /* Superpages utilization enabled = 1 / disabled = 0 */
 static int sp_enabled = 1;
-SYSCTL_INT(_vm_pmap, OID_AUTO, sp_enabled, CTLFLAG_RDTUN, &sp_enabled, 0,
+SYSCTL_INT(_vm_pmap, OID_AUTO, sp_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &sp_enabled, 0,
     "Are large page mappings enabled?");
 
 SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_count, CTLFLAG_RD, &pv_entry_count, 0,

Modified: head/sys/arm/freescale/imx/imx6_anatop.c
==============================================================================
--- head/sys/arm/freescale/imx/imx6_anatop.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/arm/freescale/imx/imx6_anatop.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -375,12 +375,12 @@ cpufreq_initialize(struct imx6_anatop_so
 	    "CPU frequency");
 
 	SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), 
-	    OID_AUTO, "cpu_minmhz", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0,
-	    cpufreq_sysctl_minmhz, "IU", "Minimum CPU frequency");
+	    OID_AUTO, "cpu_minmhz", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH,
+	    sc, 0, cpufreq_sysctl_minmhz, "IU", "Minimum CPU frequency");
 
 	SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
-	    OID_AUTO, "cpu_maxmhz", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0,
-	    cpufreq_sysctl_maxmhz, "IU", "Maximum CPU frequency");
+	    OID_AUTO, "cpu_maxmhz", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH,
+	    sc, 0, cpufreq_sysctl_maxmhz, "IU", "Maximum CPU frequency");
 
 	SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
 	    OID_AUTO, "cpu_maxmhz_hw", CTLFLAG_RD, &sc->cpu_maxmhz_hw, 0, 
@@ -413,9 +413,6 @@ cpufreq_initialize(struct imx6_anatop_so
 	sc->cpu_maxmhz_hw = imx6_ocotp_mhz_tab[cfg3speed];
 	sc->cpu_maxmhz = sc->cpu_maxmhz_hw;
 
-	TUNABLE_INT_FETCH("hw.imx6.cpu_overclock_enable",
-	    &sc->cpu_overclock_enable);
-
 	TUNABLE_INT_FETCH("hw.imx6.cpu_minmhz", &sc->cpu_minmhz);
 	op = cpufreq_nearest_oppt(sc, sc->cpu_minmhz);
 	sc->cpu_minmhz = op->mhz;

Modified: head/sys/arm/xscale/ixp425/if_npe.c
==============================================================================
--- head/sys/arm/xscale/ixp425/if_npe.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/arm/xscale/ixp425/if_npe.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -255,9 +255,8 @@ static SYSCTL_NODE(_hw, OID_AUTO, npe, C
     "IXP4XX NPE driver parameters");
 
 static int npe_debug = 0;
-SYSCTL_INT(_hw_npe, OID_AUTO, debug, CTLFLAG_RW, &npe_debug,
+SYSCTL_INT(_hw_npe, OID_AUTO, debug, CTLFLAG_RWTUN, &npe_debug,
 	   0, "IXP4XX NPE network interface debug msgs");
-TUNABLE_INT("hw.npe.debug", &npe_debug);
 #define	DPRINTF(sc, fmt, ...) do {					\
 	if (sc->sc_debug) device_printf(sc->sc_dev, fmt, __VA_ARGS__);	\
 } while (0)
@@ -265,18 +264,15 @@ TUNABLE_INT("hw.npe.debug", &npe_debug);
 	if (sc->sc_debug >= n) device_printf(sc->sc_dev, fmt, __VA_ARGS__);\
 } while (0)
 static int npe_tickinterval = 3;		/* npe_tick frequency (secs) */
-SYSCTL_INT(_hw_npe, OID_AUTO, tickinterval, CTLFLAG_RD, &npe_tickinterval,
+SYSCTL_INT(_hw_npe, OID_AUTO, tickinterval, CTLFLAG_RDTUN, &npe_tickinterval,
 	    0, "periodic work interval (secs)");
-TUNABLE_INT("hw.npe.tickinterval", &npe_tickinterval);
 
 static	int npe_rxbuf = 64;		/* # rx buffers to allocate */
-SYSCTL_INT(_hw_npe, OID_AUTO, rxbuf, CTLFLAG_RD, &npe_rxbuf,
+SYSCTL_INT(_hw_npe, OID_AUTO, rxbuf, CTLFLAG_RDTUN, &npe_rxbuf,
 	    0, "rx buffers allocated");
-TUNABLE_INT("hw.npe.rxbuf", &npe_rxbuf);
 static	int npe_txbuf = 128;		/* # tx buffers to allocate */
-SYSCTL_INT(_hw_npe, OID_AUTO, txbuf, CTLFLAG_RD, &npe_txbuf,
+SYSCTL_INT(_hw_npe, OID_AUTO, txbuf, CTLFLAG_RDTUN, &npe_txbuf,
 	    0, "tx buffers allocated");
-TUNABLE_INT("hw.npe.txbuf", &npe_txbuf);
 
 static int
 unit2npeid(int unit)

Modified: head/sys/arm/xscale/ixp425/ixp425_npe.c
==============================================================================
--- head/sys/arm/xscale/ixp425/ixp425_npe.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/arm/xscale/ixp425/ixp425_npe.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -181,9 +181,8 @@ typedef struct {
 } IxNpeDlNpeMgrStateInfoBlock;
 
 static int npe_debug = 0;
-SYSCTL_INT(_debug, OID_AUTO, ixp425npe, CTLFLAG_RW, &npe_debug,
+SYSCTL_INT(_debug, OID_AUTO, ixp425npe, CTLFLAG_RWTUN, &npe_debug,
 	   0, "IXP4XX NPE debug msgs");
-TUNABLE_INT("debug.ixp425npe", &npe_debug);
 #define	DPRINTF(dev, fmt, ...) do {					\
 	if (npe_debug) device_printf(dev, fmt, __VA_ARGS__);		\
 } while (0)

Modified: head/sys/arm/xscale/ixp425/ixp425_qmgr.c
==============================================================================
--- head/sys/arm/xscale/ixp425/ixp425_qmgr.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/arm/xscale/ixp425/ixp425_qmgr.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -159,10 +159,9 @@ struct ixpqmgr_softc {
 	uint32_t		aqmFreeSramAddress;	/* SRAM free space */
 };
 
-static int qmgr_debug = 0;
-SYSCTL_INT(_debug, OID_AUTO, qmgr, CTLFLAG_RW, &qmgr_debug,
+static int qmgr_debug;
+SYSCTL_INT(_debug, OID_AUTO, qmgr, CTLFLAG_RWTUN, &qmgr_debug,
 	   0, "IXP4XX Q-Manager debug msgs");
-TUNABLE_INT("debug.qmgr", &qmgr_debug);
 #define	DPRINTF(dev, fmt, ...) do {					\
 	if (qmgr_debug) printf(fmt, __VA_ARGS__);			\
 } while (0)

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cam/ata/ata_da.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -546,30 +546,22 @@ static int ada_write_cache = ADA_DEFAULT
 
 static SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0,
             "CAM Direct Access Disk driver");
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, legacy_aliases, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, legacy_aliases, CTLFLAG_RWTUN,
            &ada_legacy_aliases, 0, "Create legacy-like device aliases");
-TUNABLE_INT("kern.cam.ada.legacy_aliases", &ada_legacy_aliases);
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, retry_count, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, retry_count, CTLFLAG_RWTUN,
            &ada_retry_count, 0, "Normal I/O retry count");
-TUNABLE_INT("kern.cam.ada.retry_count", &ada_retry_count);
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, default_timeout, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, default_timeout, CTLFLAG_RWTUN,
            &ada_default_timeout, 0, "Normal I/O timeout (in seconds)");
-TUNABLE_INT("kern.cam.ada.default_timeout", &ada_default_timeout);
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, send_ordered, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, send_ordered, CTLFLAG_RWTUN,
            &ada_send_ordered, 0, "Send Ordered Tags");
-TUNABLE_INT("kern.cam.ada.send_ordered", &ada_send_ordered);
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_shutdown, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_shutdown, CTLFLAG_RWTUN,
            &ada_spindown_shutdown, 0, "Spin down upon shutdown");
-TUNABLE_INT("kern.cam.ada.spindown_shutdown", &ada_spindown_shutdown);
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_suspend, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_suspend, CTLFLAG_RWTUN,
            &ada_spindown_suspend, 0, "Spin down upon suspend");
-TUNABLE_INT("kern.cam.ada.spindown_suspend", &ada_spindown_suspend);
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, read_ahead, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, read_ahead, CTLFLAG_RWTUN,
            &ada_read_ahead, 0, "Enable disk read-ahead");
-TUNABLE_INT("kern.cam.ada.read_ahead", &ada_read_ahead);
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, write_cache, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, write_cache, CTLFLAG_RWTUN,
            &ada_write_cache, 0, "Enable disk write cache");
-TUNABLE_INT("kern.cam.ada.write_cache", &ada_write_cache);
 
 /*
  * ADA_ORDEREDTAG_INTERVAL determines how often, relative

Modified: head/sys/cam/ata/ata_pmp.c
==============================================================================
--- head/sys/cam/ata/ata_pmp.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cam/ata/ata_pmp.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -139,15 +139,12 @@ static int pmp_hide_special = PMP_DEFAUL
 
 static SYSCTL_NODE(_kern_cam, OID_AUTO, pmp, CTLFLAG_RD, 0,
             "CAM Direct Access Disk driver");
-SYSCTL_INT(_kern_cam_pmp, OID_AUTO, retry_count, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_pmp, OID_AUTO, retry_count, CTLFLAG_RWTUN,
            &pmp_retry_count, 0, "Normal I/O retry count");
-TUNABLE_INT("kern.cam.pmp.retry_count", &pmp_retry_count);
-SYSCTL_INT(_kern_cam_pmp, OID_AUTO, default_timeout, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_pmp, OID_AUTO, default_timeout, CTLFLAG_RWTUN,
            &pmp_default_timeout, 0, "Normal I/O timeout (in seconds)");
-TUNABLE_INT("kern.cam.pmp.default_timeout", &pmp_default_timeout);
-SYSCTL_INT(_kern_cam_pmp, OID_AUTO, hide_special, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_pmp, OID_AUTO, hide_special, CTLFLAG_RWTUN,
            &pmp_hide_special, 0, "Hide extra ports");
-TUNABLE_INT("kern.cam.pmp.hide_special", &pmp_hide_special);
 
 static struct periph_driver pmpdriver =
 {

Modified: head/sys/cam/cam.c
==============================================================================
--- head/sys/cam/cam.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cam/cam.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -116,7 +116,6 @@ SYSCTL_NODE(_kern, OID_AUTO, cam, CTLFLA
 #endif
 
 int cam_sort_io_queues = CAM_DEFAULT_SORT_IO_QUEUES;
-TUNABLE_INT("kern.cam.sort_io_queues", &cam_sort_io_queues);
 SYSCTL_INT(_kern_cam, OID_AUTO, sort_io_queues, CTLFLAG_RWTUN,
     &cam_sort_io_queues, 0, "Sort IO queues to try and optimise disk access patterns");
 #endif

Modified: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cam/cam_xpt.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -149,7 +149,6 @@ typedef int	xpt_pdrvfunc_t (struct perip
 /* Transport layer configuration information */
 static struct xpt_softc xsoftc;
 
-TUNABLE_INT("kern.cam.boot_delay", &xsoftc.boot_delay);
 SYSCTL_INT(_kern_cam, OID_AUTO, boot_delay, CTLFLAG_RDTUN,
            &xsoftc.boot_delay, 0, "Bus registration wait time");
 
@@ -163,7 +162,6 @@ static struct cam_doneq cam_doneqs[MAXCP
 static int cam_num_doneqs;
 static struct proc *cam_proc;
 
-TUNABLE_INT("kern.cam.num_doneqs", &cam_num_doneqs);
 SYSCTL_INT(_kern_cam, OID_AUTO, num_doneqs, CTLFLAG_RDTUN,
            &cam_num_doneqs, 0, "Number of completion queues/threads");
 
@@ -197,12 +195,10 @@ static struct cdevsw xpt_cdevsw = {
 /* Storage for debugging datastructures */
 struct cam_path *cam_dpath;
 u_int32_t cam_dflags = CAM_DEBUG_FLAGS;
-TUNABLE_INT("kern.cam.dflags", &cam_dflags);
-SYSCTL_UINT(_kern_cam, OID_AUTO, dflags, CTLFLAG_RW,
+SYSCTL_UINT(_kern_cam, OID_AUTO, dflags, CTLFLAG_RWTUN,
 	&cam_dflags, 0, "Enabled debug flags");
 u_int32_t cam_debug_delay = CAM_DEBUG_DELAY;
-TUNABLE_INT("kern.cam.debug_delay", &cam_debug_delay);
-SYSCTL_UINT(_kern_cam, OID_AUTO, debug_delay, CTLFLAG_RW,
+SYSCTL_UINT(_kern_cam, OID_AUTO, debug_delay, CTLFLAG_RWTUN,
 	&cam_debug_delay, 0, "Delay in us after each debug message");
 
 /* Our boot-time initialization hook */

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cam/ctl/ctl.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -308,11 +308,9 @@ static int     index_to_aps_page;
 
 SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer");
 static int worker_threads = -1;
-TUNABLE_INT("kern.cam.ctl.worker_threads", &worker_threads);
 SYSCTL_INT(_kern_cam_ctl, OID_AUTO, worker_threads, CTLFLAG_RDTUN,
     &worker_threads, 1, "Number of worker threads");
 static int verbose = 0;
-TUNABLE_INT("kern.cam.ctl.verbose", &verbose);
 SYSCTL_INT(_kern_cam_ctl, OID_AUTO, verbose, CTLFLAG_RWTUN,
     &verbose, 0, "Show SCSI errors returned to initiator");
 

Modified: head/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_block.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cam/ctl/ctl_backend_block.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -220,10 +220,9 @@ struct ctl_be_block_io {
 };
 
 static int cbb_num_threads = 14;
-TUNABLE_INT("kern.cam.ctl.block.num_threads", &cbb_num_threads);
 SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, block, CTLFLAG_RD, 0,
 	    "CAM Target Layer Block Backend");
-SYSCTL_INT(_kern_cam_ctl_block, OID_AUTO, num_threads, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_ctl_block, OID_AUTO, num_threads, CTLFLAG_RWTUN,
            &cbb_num_threads, 0, "Number of threads per backing file");
 
 static struct ctl_be_block_io *ctl_alloc_beio(struct ctl_be_block_softc *softc);

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -85,19 +85,15 @@ static uma_zone_t cfiscsi_data_wait_zone
 SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, iscsi, CTLFLAG_RD, 0,
     "CAM Target Layer iSCSI Frontend");
 static int debug = 3;
-TUNABLE_INT("kern.cam.ctl.iscsi.debug", &debug);
 SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, debug, CTLFLAG_RWTUN,
     &debug, 1, "Enable debug messages");
 static int ping_timeout = 5;
-TUNABLE_INT("kern.cam.ctl.iscsi.ping_timeout", &ping_timeout);
 SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, ping_timeout, CTLFLAG_RWTUN,
     &ping_timeout, 5, "Interval between ping (NOP-Out) requests, in seconds");
 static int login_timeout = 60;
-TUNABLE_INT("kern.cam.ctl.iscsi.login_timeout", &login_timeout);
 SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, login_timeout, CTLFLAG_RWTUN,
     &login_timeout, 60, "Time to wait for ctld(8) to finish Login Phase, in seconds");
 static int maxcmdsn_delta = 256;
-TUNABLE_INT("kern.cam.ctl.iscsi.maxcmdsn_delta", &maxcmdsn_delta);
 SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, maxcmdsn_delta, CTLFLAG_RWTUN,
     &maxcmdsn_delta, 256, "Number of commands the initiator can send "
     "without confirmation");

Modified: head/sys/cam/scsi/scsi_cd.c
==============================================================================
--- head/sys/cam/scsi/scsi_cd.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cam/scsi/scsi_cd.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -277,15 +277,12 @@ static int cd_retry_count = CD_DEFAULT_R
 static int cd_timeout = CD_DEFAULT_TIMEOUT;
 
 static SYSCTL_NODE(_kern_cam, OID_AUTO, cd, CTLFLAG_RD, 0, "CAM CDROM driver");
-SYSCTL_INT(_kern_cam_cd, OID_AUTO, poll_period, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_cd, OID_AUTO, poll_period, CTLFLAG_RWTUN,
            &cd_poll_period, 0, "Media polling period in seconds");
-TUNABLE_INT("kern.cam.cd.poll_period", &cd_poll_period);
-SYSCTL_INT(_kern_cam_cd, OID_AUTO, retry_count, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_cd, OID_AUTO, retry_count, CTLFLAG_RWTUN,
            &cd_retry_count, 0, "Normal I/O retry count");
-TUNABLE_INT("kern.cam.cd.retry_count", &cd_retry_count);
-SYSCTL_INT(_kern_cam_cd, OID_AUTO, timeout, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_cd, OID_AUTO, timeout, CTLFLAG_RWTUN,
 	   &cd_timeout, 0, "Timeout, in us, for read operations");
-TUNABLE_INT("kern.cam.cd.timeout", &cd_timeout);
 
 static MALLOC_DEFINE(M_SCSICD, "scsi_cd", "scsi_cd buffers");
 

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cam/scsi/scsi_da.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -1188,18 +1188,14 @@ static int da_send_ordered = DA_DEFAULT_
 
 static SYSCTL_NODE(_kern_cam, OID_AUTO, da, CTLFLAG_RD, 0,
             "CAM Direct Access Disk driver");
-SYSCTL_INT(_kern_cam_da, OID_AUTO, poll_period, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_da, OID_AUTO, poll_period, CTLFLAG_RWTUN,
            &da_poll_period, 0, "Media polling period in seconds");
-TUNABLE_INT("kern.cam.da.poll_period", &da_poll_period);
-SYSCTL_INT(_kern_cam_da, OID_AUTO, retry_count, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_da, OID_AUTO, retry_count, CTLFLAG_RWTUN,
            &da_retry_count, 0, "Normal I/O retry count");
-TUNABLE_INT("kern.cam.da.retry_count", &da_retry_count);
-SYSCTL_INT(_kern_cam_da, OID_AUTO, default_timeout, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_da, OID_AUTO, default_timeout, CTLFLAG_RWTUN,
            &da_default_timeout, 0, "Normal I/O timeout (in seconds)");
-TUNABLE_INT("kern.cam.da.default_timeout", &da_default_timeout);
-SYSCTL_INT(_kern_cam_da, OID_AUTO, send_ordered, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_da, OID_AUTO, send_ordered, CTLFLAG_RWTUN,
            &da_send_ordered, 0, "Send Ordered Tags");
-TUNABLE_INT("kern.cam.da.send_ordered", &da_send_ordered);
 
 /*
  * DA_ORDEREDTAG_INTERVAL determines how often, relative

Modified: head/sys/cam/scsi/scsi_enc_safte.c
==============================================================================
--- head/sys/cam/scsi/scsi_enc_safte.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cam/scsi/scsi_enc_safte.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -226,9 +226,8 @@ static char *safte_2little = "Too Little
 
 int emulate_array_devices = 1;
 SYSCTL_DECL(_kern_cam_enc);
-SYSCTL_INT(_kern_cam_enc, OID_AUTO, emulate_array_devices, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_enc, OID_AUTO, emulate_array_devices, CTLFLAG_RWTUN,
            &emulate_array_devices, 0, "Emulate Array Devices for SAF-TE");
-TUNABLE_INT("kern.cam.enc.emulate_array_devices", &emulate_array_devices);
 
 static int
 safte_fill_read_buf_io(enc_softc_t *enc, struct enc_fsm_state *state,

Modified: head/sys/cam/scsi/scsi_sa.c
==============================================================================
--- head/sys/cam/scsi/scsi_sa.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cam/scsi/scsi_sa.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -445,9 +445,10 @@ static int sa_allow_io_split = SA_DEFAUL
  * is bad behavior, because it hides the true tape block size from the
  * application.
  */
-TUNABLE_INT("kern.cam.sa.allow_io_split", &sa_allow_io_split);
 static SYSCTL_NODE(_kern_cam, OID_AUTO, sa, CTLFLAG_RD, 0,
 		  "CAM Sequential Access Tape Driver");
+SYSCTL_INT(_kern_cam_sa, OID_AUTO, allow_io_split, CTLFLAG_RDTUN,
+    &sa_allow_io_split, 0, "Default I/O split value");
 
 static struct periph_driver sadriver =
 {
@@ -1494,7 +1495,7 @@ sasysctlinit(void *context, int pending)
 		goto bailout;
 
 	SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree),
-	    OID_AUTO, "allow_io_split", CTLTYPE_INT | CTLFLAG_RDTUN, 
+	    OID_AUTO, "allow_io_split", CTLTYPE_INT | CTLFLAG_RDTUN | CTLFLAG_NOFETCH, 
 	    &softc->allow_io_split, 0, "Allow Splitting I/O");
 	SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree),
 	    OID_AUTO, "maxio", CTLTYPE_INT | CTLFLAG_RD, 

Modified: head/sys/cam/scsi/scsi_xpt.c
==============================================================================
--- head/sys/cam/scsi/scsi_xpt.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cam/scsi/scsi_xpt.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -78,9 +78,8 @@ struct scsi_quirk_entry {
 #define SCSI_QUIRK(dev)	((struct scsi_quirk_entry *)((dev)->quirk))
 
 static int cam_srch_hi = 0;
-TUNABLE_INT("kern.cam.cam_srch_hi", &cam_srch_hi);
 static int sysctl_cam_search_luns(SYSCTL_HANDLER_ARGS);
-SYSCTL_PROC(_kern_cam, OID_AUTO, cam_srch_hi, CTLTYPE_INT|CTLFLAG_RW, 0, 0,
+SYSCTL_PROC(_kern_cam, OID_AUTO, cam_srch_hi, CTLTYPE_INT | CTLFLAG_RWTUN, 0, 0,
     sysctl_cam_search_luns, "I",
     "allow search above LUN 7 for SCSI3 and greater devices");
 

Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c
==============================================================================
--- head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$");
 
 static MALLOC_DEFINE(M_KSTAT, "kstat_data", "Kernel statistics");
 
-SYSCTL_NODE(, OID_AUTO, kstat, CTLFLAG_RW, 0, "Kernel statistics");
+SYSCTL_ROOT_NODE(OID_AUTO, kstat, CTLFLAG_RW, 0, "Kernel statistics");
 
 kstat_t *
 kstat_create(char *module, int instance, char *name, char *class, uchar_t type,

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -204,8 +204,6 @@ int zfs_arc_shrink_shift = 0;
 int zfs_arc_p_min_shift = 0;
 int zfs_disable_dup_eviction = 0;
 
-TUNABLE_QUAD("vfs.zfs.arc_max", &zfs_arc_max);
-TUNABLE_QUAD("vfs.zfs.arc_min", &zfs_arc_min);
 TUNABLE_QUAD("vfs.zfs.arc_meta_limit", &zfs_arc_meta_limit);
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_max, CTLFLAG_RDTUN, &zfs_arc_max, 0,

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -44,8 +44,7 @@ int zfs_dedup_prefetch = 1;
 
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_NODE(_vfs_zfs, OID_AUTO, dedup, CTLFLAG_RW, 0, "ZFS DEDUP");
-TUNABLE_INT("vfs.zfs.dedup.prefetch", &zfs_dedup_prefetch);
-SYSCTL_INT(_vfs_zfs_dedup, OID_AUTO, prefetch, CTLFLAG_RW, &zfs_dedup_prefetch,
+SYSCTL_INT(_vfs_zfs_dedup, OID_AUTO, prefetch, CTLFLAG_RWTUN, &zfs_dedup_prefetch,
     0, "Enable/disable prefetching of dedup-ed blocks which are going to be freed");
 
 static const ddt_ops_t *ddt_ops[DDT_TYPES] = {

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -54,7 +54,6 @@
  */
 int zfs_nopwrite_enabled = 1;
 SYSCTL_DECL(_vfs_zfs);
-TUNABLE_INT("vfs.zfs.nopwrite_enabled", &zfs_nopwrite_enabled);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, nopwrite_enabled, CTLFLAG_RDTUN,
     &zfs_nopwrite_enabled, 0, "Enable nopwrite feature");
 
@@ -1626,8 +1625,7 @@ dmu_object_set_compress(objset_t *os, ui
 }
 
 int zfs_mdcomp_disable = 0;
-TUNABLE_INT("vfs.zfs.mdcomp_disable", &zfs_mdcomp_disable);
-SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_disable, CTLFLAG_RW,
+SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_disable, CTLFLAG_RWTUN,
     &zfs_mdcomp_disable, 0, "Disable metadata compression");
 
 /*

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -55,16 +55,12 @@ SYSCTL_DECL(_vfs_zfs);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_disable, CTLFLAG_RW,
     &zfs_prefetch_disable, 0, "Disable prefetch");
 SYSCTL_NODE(_vfs_zfs, OID_AUTO, zfetch, CTLFLAG_RW, 0, "ZFS ZFETCH");
-TUNABLE_INT("vfs.zfs.zfetch.max_streams", &zfetch_max_streams);
-SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RW,
+SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RWTUN,
     &zfetch_max_streams, 0, "Max # of streams per zfetch");
-TUNABLE_INT("vfs.zfs.zfetch.min_sec_reap", &zfetch_min_sec_reap);
 SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, min_sec_reap, CTLFLAG_RDTUN,
     &zfetch_min_sec_reap, 0, "Min time before stream reclaim");
-TUNABLE_INT("vfs.zfs.zfetch.block_cap", &zfetch_block_cap);
 SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, block_cap, CTLFLAG_RDTUN,
     &zfetch_block_cap, 0, "Max number of blocks to fetch at a time");
-TUNABLE_QUAD("vfs.zfs.zfetch.array_rd_sz", &zfetch_array_rd_sz);
 SYSCTL_UQUAD(_vfs_zfs_zfetch, OID_AUTO, array_rd_sz, CTLFLAG_RDTUN,
     &zfetch_array_rd_sz, 0,
     "Number of bytes in a array_read at which we stop prefetching");

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -141,23 +141,19 @@ extern int zfs_vdev_async_write_active_m
 
 SYSCTL_DECL(_vfs_zfs);
 
-TUNABLE_QUAD("vfs.zfs.dirty_data_max", &zfs_dirty_data_max);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_max, CTLFLAG_RWTUN,
     &zfs_dirty_data_max, 0,
     "The maximum amount of dirty data in bytes after which new writes are "
     "halted until space becomes available");
 
-TUNABLE_QUAD("vfs.zfs.dirty_data_max_max", &zfs_dirty_data_max_max);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_max_max, CTLFLAG_RDTUN,
     &zfs_dirty_data_max_max, 0,
     "The absolute cap on dirty_data_max when auto calculating");
 
-TUNABLE_INT("vfs.zfs.dirty_data_max_percent", &zfs_dirty_data_max_percent);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, dirty_data_max_percent, CTLFLAG_RDTUN,
     &zfs_dirty_data_max_percent, 0,
     "The percent of physical memory used to auto calculate dirty_data_max");
 
-TUNABLE_QUAD("vfs.zfs.dirty_data_sync", &zfs_dirty_data_sync);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_sync, CTLFLAG_RWTUN,
     &zfs_dirty_data_sync, 0,
     "Force a txg if the number of dirty buffer bytes exceed this value");

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -71,32 +71,23 @@ boolean_t zfs_no_scrub_io = B_FALSE; /* 
 boolean_t zfs_no_scrub_prefetch = B_FALSE; /* set to disable srub prefetching */
 
 SYSCTL_DECL(_vfs_zfs);
-TUNABLE_INT("vfs.zfs.top_maxinflight", &zfs_top_maxinflight);
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, top_maxinflight, CTLFLAG_RW,
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, top_maxinflight, CTLFLAG_RWTUN,
     &zfs_top_maxinflight, 0, "Maximum I/Os per top-level vdev");
-TUNABLE_INT("vfs.zfs.resilver_delay", &zfs_resilver_delay);
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, resilver_delay, CTLFLAG_RW,
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, resilver_delay, CTLFLAG_RWTUN,
     &zfs_resilver_delay, 0, "Number of ticks to delay resilver");
-TUNABLE_INT("vfs.zfs.scrub_delay", &zfs_scrub_delay);
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, scrub_delay, CTLFLAG_RW,
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, scrub_delay, CTLFLAG_RWTUN,
     &zfs_scrub_delay, 0, "Number of ticks to delay scrub");
-TUNABLE_INT("vfs.zfs.scan_idle", &zfs_scan_idle);
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, scan_idle, CTLFLAG_RW,
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, scan_idle, CTLFLAG_RWTUN,
     &zfs_scan_idle, 0, "Idle scan window in clock ticks");
-TUNABLE_INT("vfs.zfs.scan_min_time_ms", &zfs_scan_min_time_ms);
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, scan_min_time_ms, CTLFLAG_RW,
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, scan_min_time_ms, CTLFLAG_RWTUN,
     &zfs_scan_min_time_ms, 0, "Min millisecs to scrub per txg");
-TUNABLE_INT("vfs.zfs.free_min_time_ms", &zfs_free_min_time_ms);
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, free_min_time_ms, CTLFLAG_RW,
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, free_min_time_ms, CTLFLAG_RWTUN,
     &zfs_free_min_time_ms, 0, "Min millisecs to free per txg");
-TUNABLE_INT("vfs.zfs.resilver_min_time_ms", &zfs_resilver_min_time_ms);
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, resilver_min_time_ms, CTLFLAG_RW,
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, resilver_min_time_ms, CTLFLAG_RWTUN,
     &zfs_resilver_min_time_ms, 0, "Min millisecs to resilver per txg");
-TUNABLE_INT("vfs.zfs.no_scrub_io", &zfs_no_scrub_io);
-SYSCTL_INT(_vfs_zfs, OID_AUTO, no_scrub_io, CTLFLAG_RW,
+SYSCTL_INT(_vfs_zfs, OID_AUTO, no_scrub_io, CTLFLAG_RWTUN,
     &zfs_no_scrub_io, 0, "Disable scrub I/O");
-TUNABLE_INT("vfs.zfs.no_scrub_prefetch", &zfs_no_scrub_prefetch);
-SYSCTL_INT(_vfs_zfs, OID_AUTO, no_scrub_prefetch, CTLFLAG_RW,
+SYSCTL_INT(_vfs_zfs, OID_AUTO, no_scrub_prefetch, CTLFLAG_RWTUN,
     &zfs_no_scrub_prefetch, 0, "Disable scrub prefetching");
 
 enum ddt_class zfs_scrub_ddt_class_max = DDT_CLASS_DUPLICATE;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -55,7 +55,6 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab
 
 uint64_t metaslab_aliquot = 512ULL << 10;
 uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1;	/* force gang blocks */
-TUNABLE_QUAD("vfs.zfs.metaslab.gang_bang", &metaslab_gang_bang);
 SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, gang_bang, CTLFLAG_RWTUN,
     &metaslab_gang_bang, 0,
     "Force gang block allocation for blocks larger than or equal to this value");
@@ -67,7 +66,6 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO,
  * Values should be greater than or equal to 100.
  */
 int zfs_condense_pct = 200;
-TUNABLE_INT("vfs.zfs.condense_pct", &zfs_condense_pct);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, condense_pct, CTLFLAG_RWTUN,
     &zfs_condense_pct, 0,
     "Condense on-disk spacemap when it is more than this many percents"
@@ -87,7 +85,6 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, condense_
  * no metaslab group will be excluded based on this criterion.
  */
 int zfs_mg_noalloc_threshold = 0;
-TUNABLE_INT("vfs.zfs.mg_noalloc_threshold", &zfs_mg_noalloc_threshold);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_noalloc_threshold, CTLFLAG_RWTUN,
     &zfs_mg_noalloc_threshold, 0,
     "Percentage of metaslab group size that should be free"
@@ -97,7 +94,6 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_noallo
  * When set will load all metaslabs when pool is first opened.
  */
 int metaslab_debug_load = 0;
-TUNABLE_INT("vfs.zfs.metaslab.debug_load", &metaslab_debug_load);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_load, CTLFLAG_RWTUN,
     &metaslab_debug_load, 0,
     "Load all metaslabs when pool is first opened");
@@ -106,7 +102,6 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, 
  * When set will prevent metaslabs from being unloaded.
  */
 int metaslab_debug_unload = 0;
-TUNABLE_INT("vfs.zfs.metaslab.debug_unload", &metaslab_debug_unload);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_unload, CTLFLAG_RWTUN,
     &metaslab_debug_unload, 0,
     "Prevent metaslabs from being unloaded");
@@ -118,8 +113,6 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, 
  * aggressive strategy (i.e search by size rather than offset).
  */
 uint64_t metaslab_df_alloc_threshold = SPA_MAXBLOCKSIZE;
-TUNABLE_QUAD("vfs.zfs.metaslab.df_alloc_threshold",
-    &metaslab_df_alloc_threshold);
 SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, df_alloc_threshold, CTLFLAG_RWTUN,
     &metaslab_df_alloc_threshold, 0,
     "Minimum size which forces the dynamic allocator to change it's allocation strategy");
@@ -131,27 +124,25 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO,
  * switch to using best-fit allocations.
  */
 int metaslab_df_free_pct = 4;
-TUNABLE_INT("vfs.zfs.metaslab.df_free_pct", &metaslab_df_free_pct);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, df_free_pct, CTLFLAG_RWTUN,
     &metaslab_df_free_pct, 0,
-    "The minimum free space, in percent, which must be available in a space map to continue allocations in a first-fit fashion");
+    "The minimum free space, in percent, which must be available in a "
+    "space map to continue allocations in a first-fit fashion");
 
 /*
  * A metaslab is considered "free" if it contains a contiguous
  * segment which is greater than metaslab_min_alloc_size.
  */
 uint64_t metaslab_min_alloc_size = DMU_MAX_ACCESS;
-TUNABLE_QUAD("vfs.zfs.metaslab.min_alloc_size",
-    &metaslab_min_alloc_size);
 SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, min_alloc_size, CTLFLAG_RWTUN,
     &metaslab_min_alloc_size, 0,
-    "A metaslab is considered \"free\" if it contains a contiguous segment which is greater than vfs.zfs.metaslab.min_alloc_size");
+    "A metaslab is considered \"free\" if it contains a contiguous "
+    "segment which is greater than vfs.zfs.metaslab.min_alloc_size");
 
 /*
  * Percentage of all cpus that can be used by the metaslab taskq.
  */
 int metaslab_load_pct = 50;
-TUNABLE_INT("vfs.zfs.metaslab.load_pct", &metaslab_load_pct);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, load_pct, CTLFLAG_RWTUN,
     &metaslab_load_pct, 0,
     "Percentage of cpus that can be used by the metaslab taskq");
@@ -162,7 +153,6 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, 
  * keep it loaded.
  */
 int metaslab_unload_delay = TXG_SIZE * 2;
-TUNABLE_INT("vfs.zfs.metaslab.unload_delay", &metaslab_unload_delay);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, unload_delay, CTLFLAG_RWTUN,
     &metaslab_unload_delay, 0,
     "Number of TXGs that an unused metaslab can be kept in memory");
@@ -173,13 +163,11 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, 
 boolean_t zfs_write_to_degraded = B_FALSE;
 SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_degraded, CTLFLAG_RWTUN,
     &zfs_write_to_degraded, 0, "Allow writing data to degraded vdevs");
-TUNABLE_INT("vfs.zfs.write_to_degraded", &zfs_write_to_degraded);
 
 /*
  * Max number of metaslabs per group to preload.
  */
 int metaslab_preload_limit = SPA_DVAS_PER_BP;
-TUNABLE_INT("vfs.zfs.metaslab.preload_limit", &metaslab_preload_limit);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_limit, CTLFLAG_RWTUN,
     &metaslab_preload_limit, 0,
     "Max number of metaslabs per group to preload");
@@ -188,7 +176,6 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, 
  * Enable/disable preloading of metaslab.
  */
 boolean_t metaslab_preload_enabled = B_TRUE;
-TUNABLE_INT("vfs.zfs.metaslab.preload_enabled", &metaslab_preload_enabled);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_enabled, CTLFLAG_RWTUN,
     &metaslab_preload_enabled, 0,
     "Max number of metaslabs per group to preload");
@@ -197,8 +184,6 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, 
  * Enable/disable additional weight factor for each metaslab.
  */
 boolean_t metaslab_weight_factor_enable = B_FALSE;
-TUNABLE_INT("vfs.zfs.metaslab.weight_factor_enable",
-    &metaslab_weight_factor_enable);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, weight_factor_enable, CTLFLAG_RWTUN,
     &metaslab_weight_factor_enable, 0,
     "Enable additional weight factor for each metaslab");

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -84,8 +84,7 @@
 static int check_hostid = 1;
 
 SYSCTL_DECL(_vfs_zfs);
-TUNABLE_INT("vfs.zfs.check_hostid", &check_hostid);
-SYSCTL_INT(_vfs_zfs, OID_AUTO, check_hostid, CTLFLAG_RW, &check_hostid, 0,
+SYSCTL_INT(_vfs_zfs, OID_AUTO, check_hostid, CTLFLAG_RWTUN, &check_hostid, 0,
     "Check hostid on import?");
 
 /*

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -244,7 +244,6 @@ int zfs_flags = ~(ZFS_DEBUG_DPRINTF | ZF
 int zfs_flags = 0;
 #endif
 SYSCTL_DECL(_debug);
-TUNABLE_INT("debug.zfs_flags", &zfs_flags);
 SYSCTL_INT(_debug, OID_AUTO, zfs_flags, CTLFLAG_RWTUN, &zfs_flags, 0,
     "ZFS debug flags.");
 
@@ -257,7 +256,6 @@ SYSCTL_INT(_debug, OID_AUTO, zfs_flags, 
  */
 int zfs_recover = 0;
 SYSCTL_DECL(_vfs_zfs);
-TUNABLE_INT("vfs.zfs.recover", &zfs_recover);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RDTUN, &zfs_recover, 0,
     "Try to recover from otherwise-fatal errors.");
 
@@ -270,7 +268,6 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, 
  * in a system panic.
  */
 uint64_t zfs_deadman_synctime_ms = 1000000ULL;
-TUNABLE_QUAD("vfs.zfs.deadman_synctime_ms", &zfs_deadman_synctime_ms);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_synctime_ms, CTLFLAG_RDTUN,
     &zfs_deadman_synctime_ms, 0,
     "Stalled ZFS I/O expiration time in milliseconds");
@@ -280,7 +277,6 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman
  * for hung I/O.
  */
 uint64_t zfs_deadman_checktime_ms = 5000ULL;
-TUNABLE_QUAD("vfs.zfs.deadman_checktime_ms", &zfs_deadman_checktime_ms);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_checktime_ms, CTLFLAG_RDTUN,
     &zfs_deadman_checktime_ms, 0,
     "Period of checks for stalled ZFS I/O in milliseconds");
@@ -290,7 +286,6 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman
  * zfs_deadman_init()
  */
 int zfs_deadman_enabled = -1;
-TUNABLE_INT("vfs.zfs.deadman_enabled", &zfs_deadman_enabled);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_enabled, CTLFLAG_RDTUN,
     &zfs_deadman_enabled, 0, "Kernel panic on stalled ZFS I/O");
 
@@ -304,7 +299,6 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_e
  *     (VDEV_RAIDZ_MAXPARITY + 1) * SPA_DVAS_PER_BP * 2 == 24
  */
 int spa_asize_inflation = 24;
-TUNABLE_INT("vfs.zfs.spa_asize_inflation", &spa_asize_inflation);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_asize_inflation, CTLFLAG_RWTUN,
     &spa_asize_inflation, 0, "Worst case inflation factor for single sector writes");
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -85,31 +85,22 @@ static u_int trim_vdev_max_pending = 64;
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_NODE(_vfs_zfs, OID_AUTO, trim, CTLFLAG_RD, 0, "ZFS TRIM");
 
-TUNABLE_INT("vfs.zfs.trim.txg_delay", &trim_txg_delay);
 SYSCTL_UINT(_vfs_zfs_trim, OID_AUTO, txg_delay, CTLFLAG_RWTUN, &trim_txg_delay,
     0, "Delay TRIMs by up to this many TXGs");
-
-TUNABLE_INT("vfs.zfs.trim.timeout", &trim_timeout);
 SYSCTL_UINT(_vfs_zfs_trim, OID_AUTO, timeout, CTLFLAG_RWTUN, &trim_timeout, 0,
     "Delay TRIMs by up to this many seconds");
-
-TUNABLE_INT("vfs.zfs.trim.max_interval", &trim_max_interval);
 SYSCTL_UINT(_vfs_zfs_trim, OID_AUTO, max_interval, CTLFLAG_RWTUN,
     &trim_max_interval, 0,
     "Maximum interval between TRIM queue processing (seconds)");
 
 SYSCTL_DECL(_vfs_zfs_vdev);
-TUNABLE_QUAD("vfs.zfs.vdev.trim_max_bytes", &trim_vdev_max_bytes);
 SYSCTL_QUAD(_vfs_zfs_vdev, OID_AUTO, trim_max_bytes, CTLFLAG_RWTUN,
     &trim_vdev_max_bytes, 0,
     "Maximum pending TRIM bytes for a vdev");
-
-TUNABLE_INT("vfs.zfs.vdev.trim_max_pending", &trim_vdev_max_pending);
 SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, trim_max_pending, CTLFLAG_RWTUN,
     &trim_vdev_max_pending, 0,
     "Maximum pending TRIM segments for a vdev");
 
-
 static void trim_map_vdev_commit_done(spa_t *spa, vdev_t *vd);
 
 static int

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -112,8 +112,7 @@ int zfs_txg_timeout = 5;	/* max seconds 
 
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_NODE(_vfs_zfs, OID_AUTO, txg, CTLFLAG_RW, 0, "ZFS TXG");
-TUNABLE_INT("vfs.zfs.txg.timeout", &zfs_txg_timeout);
-SYSCTL_INT(_vfs_zfs_txg, OID_AUTO, timeout, CTLFLAG_RW, &zfs_txg_timeout, 0,
+SYSCTL_INT(_vfs_zfs_txg, OID_AUTO, timeout, CTLFLAG_RWTUN, &zfs_txg_timeout, 0,
     "Maximum seconds worth of delta per txg");
 
 /*

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -90,13 +90,10 @@ int zfs_vdev_cache_bshift = 16;
 
 SYSCTL_DECL(_vfs_zfs_vdev);
 SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, cache, CTLFLAG_RW, 0, "ZFS VDEV Cache");
-TUNABLE_INT("vfs.zfs.vdev.cache.max", &zfs_vdev_cache_max);
 SYSCTL_INT(_vfs_zfs_vdev_cache, OID_AUTO, max, CTLFLAG_RDTUN,
     &zfs_vdev_cache_max, 0, "Maximum I/O request size that increase read size");
-TUNABLE_INT("vfs.zfs.vdev.cache.size", &zfs_vdev_cache_size);
 SYSCTL_INT(_vfs_zfs_vdev_cache, OID_AUTO, size, CTLFLAG_RDTUN,
     &zfs_vdev_cache_size, 0, "Size of VDEV cache");
-TUNABLE_INT("vfs.zfs.vdev.cache.bshift", &zfs_vdev_cache_bshift);
 SYSCTL_INT(_vfs_zfs_vdev_cache, OID_AUTO, bshift, CTLFLAG_RDTUN,
     &zfs_vdev_cache_bshift, 0, "Turn too small requests into 1 << this value");
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -53,14 +53,12 @@ DECLARE_GEOM_CLASS(zfs_vdev_class, zfs_v
 
 SYSCTL_DECL(_vfs_zfs_vdev);
 /* Don't send BIO_FLUSH. */
-static int vdev_geom_bio_flush_disable = 0;
-TUNABLE_INT("vfs.zfs.vdev.bio_flush_disable", &vdev_geom_bio_flush_disable);
-SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_flush_disable, CTLFLAG_RW,
+static int vdev_geom_bio_flush_disable;
+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_flush_disable, CTLFLAG_RWTUN,
     &vdev_geom_bio_flush_disable, 0, "Disable BIO_FLUSH");
 /* Don't send BIO_DELETE. */
-static int vdev_geom_bio_delete_disable = 0;
-TUNABLE_INT("vfs.zfs.vdev.bio_delete_disable", &vdev_geom_bio_delete_disable);
-SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_delete_disable, CTLFLAG_RW,
+static int vdev_geom_bio_delete_disable;
+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_delete_disable, CTLFLAG_RWTUN,
     &vdev_geom_bio_delete_disable, 0, "Disable BIO_DELETE");
 
 static void

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -74,32 +74,26 @@ static SYSCTL_NODE(_vfs_zfs_vdev, OID_AU
 
 /* Rotating media load calculation configuration. */
 static int rotating_inc = 0;
-TUNABLE_INT("vfs.zfs.vdev.mirror.rotating_inc", &rotating_inc);
-SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_inc, CTLFLAG_RW,
+SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_inc, CTLFLAG_RWTUN,
     &rotating_inc, 0, "Rotating media load increment for non-seeking I/O's");
 
 static int rotating_seek_inc = 5;
-TUNABLE_INT("vfs.zfs.vdev.mirror.rotating_seek_inc", &rotating_seek_inc);
-SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_inc, CTLFLAG_RW,
+SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_inc, CTLFLAG_RWTUN,
     &rotating_seek_inc, 0, "Rotating media load increment for seeking I/O's");
 
 static int rotating_seek_offset = 1 * 1024 * 1024;
-TUNABLE_INT("vfs.zfs.vdev.mirror.rotating_seek_offset", &rotating_seek_offset);
-SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_offset, CTLFLAG_RW,
+SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_offset, CTLFLAG_RWTUN,
     &rotating_seek_offset, 0, "Offset in bytes from the last I/O which "
     "triggers a reduced rotating media seek increment");
 
 /* Non-rotating media load calculation configuration. */
 static int non_rotating_inc = 0;
-TUNABLE_INT("vfs.zfs.vdev.mirror.non_rotating_inc", &non_rotating_inc);
-SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_inc, CTLFLAG_RW,
+SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_inc, CTLFLAG_RWTUN,
     &non_rotating_inc, 0,
     "Non-rotating media load increment for non-seeking I/O's");
 
 static int non_rotating_seek_inc = 1;
-TUNABLE_INT("vfs.zfs.vdev.mirror.non_rotating_seek_inc",
-     &non_rotating_seek_inc);
-SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_seek_inc, CTLFLAG_RW,
+SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_seek_inc, CTLFLAG_RWTUN,
     &non_rotating_seek_inc, 0,
     "Non-rotating media load increment for seeking I/O's");
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c	Fri Jun 27 15:23:12 2014	(r267960)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c	Fri Jun 27 16:33:43 2014	(r267961)
@@ -176,23 +176,18 @@ int zfs_vdev_write_gap_limit = 4 << 10;
 
 #ifdef __FreeBSD__
 SYSCTL_DECL(_vfs_zfs_vdev);
-TUNABLE_INT("vfs.zfs.vdev.max_active", &zfs_vdev_max_active);
-SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, max_active, CTLFLAG_RW,
+SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, max_active, CTLFLAG_RWTUN,
     &zfs_vdev_max_active, 0,

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 17:18:54 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9573BB10;
 Fri, 27 Jun 2014 17:18:54 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 82C6A2680;
 Fri, 27 Jun 2014 17:18:54 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RHIsBa097166;
 Fri, 27 Jun 2014 17:18:54 GMT (envelope-from neel@svn.freebsd.org)
Received: (from neel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RHIsqB097165;
 Fri, 27 Jun 2014 17:18:54 GMT (envelope-from neel@svn.freebsd.org)
Message-Id: <201406271718.s5RHIsqB097165@svn.freebsd.org>
From: Neel Natu 
Date: Fri, 27 Jun 2014 17:18:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267963 - head/share/examples/bhyve
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 17:18:54 -0000

Author: neel
Date: Fri Jun 27 17:18:54 2014
New Revision: 267963
URL: http://svnweb.freebsd.org/changeset/base/267963

Log:
  After r267897 brought in a new version of file/libmagic, a filesystem image
  is identified as "DOS/MBR boot sector" as opposed to "x86 boot sector".
  
  This trips up vmrun.sh when using the new file(1) and makes it want to boot
  into the installer instead.
  
  Fix this by just looking for "boot sector" instead.

Modified:
  head/share/examples/bhyve/vmrun.sh

Modified: head/share/examples/bhyve/vmrun.sh
==============================================================================
--- head/share/examples/bhyve/vmrun.sh	Fri Jun 27 17:10:28 2014	(r267962)
+++ head/share/examples/bhyve/vmrun.sh	Fri Jun 27 17:18:54 2014	(r267963)
@@ -176,7 +176,7 @@ virtio_diskdev="$disk_dev0"
 while [ 1 ]; do
 	${BHYVECTL} --vm=${vmname} --destroy > /dev/null 2>&1
 
-	file ${virtio_diskdev} | grep ": x86 boot sector" > /dev/null
+	file ${virtio_diskdev} | grep "boot sector" > /dev/null
 	rc=$?
 	if [ $rc -ne 0 ]; then
 		file ${virtio_diskdev} | grep ": Unix Fast File sys" > /dev/null

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 17:50:35 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id ADB688E1;
 Fri, 27 Jun 2014 17:50:35 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8EFA229F4;
 Fri, 27 Jun 2014 17:50:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RHoZWv013380;
 Fri, 27 Jun 2014 17:50:35 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RHoXe7013363;
 Fri, 27 Jun 2014 17:50:33 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201406271750.s5RHoXe7013363@svn.freebsd.org>
From: Ed Maste 
Date: Fri, 27 Jun 2014 17:50:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267965 - in head: share/man/man4 sys/dev/syscons
 sys/dev/vt sys/kern sys/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 17:50:35 -0000

Author: emaste
Date: Fri Jun 27 17:50:33 2014
New Revision: 267965
URL: http://svnweb.freebsd.org/changeset/base/267965

Log:
  Use a common tunable to choose between vt(4)/sc(4)
  
  With this change and previous work from ray@ it will be possible to put
  both in GENERIC, and have one enabled by default, but allow the other to
  be selected via the loader.
  
  (The previous implementation had separate kern.vt.disable and
  hw.syscons.disable tunables, and would panic if both drivers were
  compiled in and neither was explicitly disabled.)
  
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/share/man/man4/vt.4
  head/sys/dev/syscons/syscons.c
  head/sys/dev/syscons/sysmouse.c
  head/sys/dev/vt/vt_consolectl.c
  head/sys/dev/vt/vt_core.c
  head/sys/dev/vt/vt_sysmouse.c
  head/sys/kern/kern_cons.c
  head/sys/sys/cons.h

Modified: head/share/man/man4/vt.4
==============================================================================
--- head/share/man/man4/vt.4	Fri Jun 27 17:22:18 2014	(r267964)
+++ head/share/man/man4/vt.4	Fri Jun 27 17:50:33 2014	(r267965)
@@ -43,6 +43,7 @@
 In
 .Xr loader.conf 5 :
 .Cd hw.vga.textmode=1
+.Cd kern.vty=vt
 .Sh DESCRIPTION
 The
 .Nm
@@ -171,6 +172,12 @@ prompt or in
 Set to 1 to use virtual terminals in text mode instead of graphics mode.
 Features that require graphics mode, like loadable fonts, will be
 disabled.
+.It Va kern.vty
+Set to vt to choose the
+.Nm
+driver for the system console, if the
+.Xr syscons 4
+driver is also compiled in and is the default.
 .El
 .Sh FILES
 .Bl -tag -width /usr/share/syscons/keymaps/* -compact

Modified: head/sys/dev/syscons/syscons.c
==============================================================================
--- head/sys/dev/syscons/syscons.c	Fri Jun 27 17:22:18 2014	(r267964)
+++ head/sys/dev/syscons/syscons.c	Fri Jun 27 17:50:33 2014	(r267965)
@@ -266,6 +266,8 @@ static struct cdevsw consolectl_devsw = 
 int
 sc_probe_unit(int unit, int flags)
 {
+    if (!vty_enabled(VTY_SC))
+        return ENXIO;
     if (!scvidprobe(unit, flags, FALSE)) {
 	if (bootverbose)
 	    printf("%s%d: no video adapter found.\n", SC_DRIVER_NAME, unit);
@@ -491,6 +493,9 @@ sc_attach_unit(int unit, int flags)
     struct cdev *dev;
     int vc;
 
+    if (!vty_enabled(VTY_SC))
+        return ENXIO;
+
     flags &= ~SC_KERNEL_CONSOLE;
 
     if (sc_console_unit == unit) {
@@ -575,6 +580,8 @@ sc_attach_unit(int unit, int flags)
 static void
 scmeminit(void *arg)
 {
+    if (!vty_enabled(VTY_SC))
+        return;
     if (sc_malloc)
 	return;
     sc_malloc = TRUE;
@@ -1588,7 +1595,7 @@ sc_cnprobe(struct consdev *cp)
     int unit;
     int flags;
 
-    if (getenv("hw.syscons.disable")) {
+    if (!vty_enabled(VTY_SC)) {
 	cp->cn_pri = CN_DEAD;
 	return;
     }

Modified: head/sys/dev/syscons/sysmouse.c
==============================================================================
--- head/sys/dev/syscons/sysmouse.c	Fri Jun 27 17:22:18 2014	(r267964)
+++ head/sys/dev/syscons/sysmouse.c	Fri Jun 27 17:50:33 2014	(r267965)
@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -165,7 +166,7 @@ static struct ttydevsw smdev_ttydevsw = 
 static void
 sm_attach_mouse(void *unused)
 {
-	if (getenv("hw.syscons.disable"))
+	if (!vty_enabled(VTY_SC))
 		return;
 	sysmouse_tty = tty_alloc(&smdev_ttydevsw, NULL);
 	tty_makedev(sysmouse_tty, NULL, "sysmouse");

Modified: head/sys/dev/vt/vt_consolectl.c
==============================================================================
--- head/sys/dev/vt/vt_consolectl.c	Fri Jun 27 17:22:18 2014	(r267964)
+++ head/sys/dev/vt/vt_consolectl.c	Fri Jun 27 17:50:33 2014	(r267965)
@@ -73,7 +73,7 @@ static void
 consolectl_drvinit(void *unused)
 {
 
-	if (getenv("kern.vt.disable"))
+	if (!vty_enabled(VTY_VT))
 		return;
 	make_dev(&consolectl_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600,
 	    "consolectl");

Modified: head/sys/dev/vt/vt_core.c
==============================================================================
--- head/sys/dev/vt/vt_core.c	Fri Jun 27 17:22:18 2014	(r267964)
+++ head/sys/dev/vt/vt_core.c	Fri Jun 27 17:50:33 2014	(r267965)
@@ -215,7 +215,7 @@ static void
 vt_update_static(void *dummy)
 {
 
-	if (getenv("kern.vt.disable"))
+	if (!vty_enabled(VTY_VT))
 		return;
 	if (main_vd->vd_driver != NULL)
 		printf("VT: running with driver \"%s\".\n",
@@ -959,7 +959,7 @@ vtterm_cnprobe(struct terminal *tm, stru
 	struct vt_device *vd = vw->vw_device;
 	struct winsize wsz;
 
-	if (getenv("kern.vt.disable"))
+	if (!vty_enabled(VTY_VT))
 		return;
 
 	if (vd->vd_flags & VDF_INITIALIZED)
@@ -1996,7 +1996,7 @@ vt_upgrade(struct vt_device *vd)
 	struct vt_window *vw;
 	unsigned int i;
 
-	if (getenv("kern.vt.disable"))
+	if (!vty_enabled(VTY_VT))
 		return;
 
 	for (i = 0; i < VT_MAXWINDOWS; i++) {
@@ -2064,7 +2064,7 @@ vt_allocate(struct vt_driver *drv, void 
 	struct vt_device *vd;
 	struct winsize wsz;
 
-	if (getenv("kern.vt.disable"))
+	if (!vty_enabled(VTY_VT))
 		return;
 
 	if (main_vd->vd_driver == NULL) {

Modified: head/sys/dev/vt/vt_sysmouse.c
==============================================================================
--- head/sys/dev/vt/vt_sysmouse.c	Fri Jun 27 17:22:18 2014	(r267964)
+++ head/sys/dev/vt/vt_sysmouse.c	Fri Jun 27 17:50:33 2014	(r267965)
@@ -405,7 +405,7 @@ static void
 sysmouse_drvinit(void *unused)
 {
 
-	if (getenv("kern.vt.disable"))
+	if (!vty_enabled(VTY_VT))
 		return;
 	mtx_init(&sysmouse_lock, "sysmouse", NULL, MTX_DEF);
 	cv_init(&sysmouse_sleep, "sysmrd");

Modified: head/sys/kern/kern_cons.c
==============================================================================
--- head/sys/kern/kern_cons.c	Fri Jun 27 17:22:18 2014	(r267964)
+++ head/sys/kern/kern_cons.c	Fri Jun 27 17:50:33 2014	(r267965)
@@ -41,6 +41,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_ddb.h"
+#include "opt_syscons.h"
 
 #include 
 #include 
@@ -648,3 +649,45 @@ sysbeep(int pitch __unused, int period _
 
 #endif
 
+/*
+ * Temporary support for sc(4) to vt(4) transition.
+ */
+static char vty_name[16] = "";
+SYSCTL_STRING(_kern, OID_AUTO, vty, CTLFLAG_RDTUN, vty_name, 0,
+    "Console vty driver");
+
+int
+vty_enabled(unsigned vty)
+{
+	static unsigned vty_selected = 0;
+
+	if (vty_selected == 0) {
+		TUNABLE_STR_FETCH("kern.vty", vty_name, sizeof(vty_name));
+		do {
+#if defined(DEV_SC)
+			if (strcmp(vty_name, "sc") == 0) {
+				vty_selected = VTY_SC;
+				break;
+			}
+#endif
+#if defined(DEV_VT)
+			if (strcmp(vty_name, "vt") == 0) {
+				vty_selected = VTY_VT;
+				break;
+			}
+#endif
+#if defined(DEV_SC)
+			vty_selected = VTY_SC;
+#elif defined(DEV_VT)
+			vty_selected = VTY_VT;
+#endif
+		} while (0);
+
+		if (vty_selected == VTY_VT)
+			strcpy(vty_name, "vt");
+		else if (vty_selected == VTY_SC)
+			strcpy(vty_name, "sc");
+	}
+	return ((vty_selected & vty) != 0);
+}
+

Modified: head/sys/sys/cons.h
==============================================================================
--- head/sys/sys/cons.h	Fri Jun 27 17:22:18 2014	(r267964)
+++ head/sys/sys/cons.h	Fri Jun 27 17:50:33 2014	(r267965)
@@ -133,6 +133,11 @@ int	cnunavailable(void);
 void	constty_set(struct tty *tp);
 void	constty_clear(void);
 
+/* sc(4) / vt(4) coexistence shim */
+#define	VTY_SC 0x01
+#define	VTY_VT 0x02
+int	vty_enabled(unsigned int);
+
 #endif /* _KERNEL */
 
 #endif /* !_MACHINE_CONS_H_ */

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 18:00:39 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7DF50DED;
 Fri, 27 Jun 2014 18:00:39 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6B33F2AED;
 Fri, 27 Jun 2014 18:00:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RI0d7f018024;
 Fri, 27 Jun 2014 18:00:39 GMT (envelope-from neel@svn.freebsd.org)
Received: (from neel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RI0dHr018023;
 Fri, 27 Jun 2014 18:00:39 GMT (envelope-from neel@svn.freebsd.org)
Message-Id: <201406271800.s5RI0dHr018023@svn.freebsd.org>
From: Neel Natu 
Date: Fri, 27 Jun 2014 18:00:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267966 - head/usr.sbin/bhyve
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 18:00:39 -0000

Author: neel
Date: Fri Jun 27 18:00:38 2014
New Revision: 267966
URL: http://svnweb.freebsd.org/changeset/base/267966

Log:
  Add post-mortem debugging for "EPT Misconfiguration" VM-exit. This error
  is hard to reproduce so try to collect all the breadcrumbs when it happens.
  
  Reviewed by:	grehan

Modified:
  head/usr.sbin/bhyve/bhyverun.c

Modified: head/usr.sbin/bhyve/bhyverun.c
==============================================================================
--- head/usr.sbin/bhyve/bhyverun.c	Fri Jun 27 17:50:33 2014	(r267965)
+++ head/usr.sbin/bhyve/bhyverun.c	Fri Jun 27 18:00:38 2014	(r267966)
@@ -399,6 +399,16 @@ vmexit_spinup_ap(struct vmctx *ctx, stru
 	return (retval);
 }
 
+#define	DEBUG_EPT_MISCONFIG
+#ifdef DEBUG_EPT_MISCONFIG
+#define	EXIT_REASON_EPT_MISCONFIG	49
+#define	VMCS_GUEST_PHYSICAL_ADDRESS	0x00002400
+#define	VMCS_IDENT(x)			((x) | 0x80000000)
+
+static uint64_t ept_misconfig_gpa, ept_misconfig_pte[4];
+static int ept_misconfig_ptenum;
+#endif
+
 static int
 vmexit_vmx(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu)
 {
@@ -413,7 +423,21 @@ vmexit_vmx(struct vmctx *ctx, struct vm_
 	    vmexit->u.vmx.exit_qualification);
 	fprintf(stderr, "\tinst_type\t\t%d\n", vmexit->u.vmx.inst_type);
 	fprintf(stderr, "\tinst_error\t\t%d\n", vmexit->u.vmx.inst_error);
-
+#ifdef DEBUG_EPT_MISCONFIG
+	if (vmexit->u.vmx.exit_reason == EXIT_REASON_EPT_MISCONFIG) {
+		vm_get_register(ctx, *pvcpu,
+		    VMCS_IDENT(VMCS_GUEST_PHYSICAL_ADDRESS),
+		    &ept_misconfig_gpa);
+		vm_get_gpa_pmap(ctx, ept_misconfig_gpa, ept_misconfig_pte,
+		    &ept_misconfig_ptenum);
+		fprintf(stderr, "\tEPT misconfiguration:\n");
+		fprintf(stderr, "\t\tGPA: %#lx\n", ept_misconfig_gpa);
+		fprintf(stderr, "\t\tPTE(%d): %#lx %#lx %#lx %#lx\n",
+		    ept_misconfig_ptenum, ept_misconfig_pte[0],
+		    ept_misconfig_pte[1], ept_misconfig_pte[2],
+		    ept_misconfig_pte[3]);
+	}
+#endif	/* DEBUG_EPT_MISCONFIG */
 	return (VMEXIT_ABORT);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 18:24:21 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8FF86494;
 Fri, 27 Jun 2014 18:24:21 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 638592CFC;
 Fri, 27 Jun 2014 18:24:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RIOLxq031170;
 Fri, 27 Jun 2014 18:24:21 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RIOLqN031169;
 Fri, 27 Jun 2014 18:24:21 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201406271824.s5RIOLqN031169@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 27 Jun 2014 18:24:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267967 - head/share/man/man4
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 18:24:21 -0000

Author: marius
Date: Fri Jun 27 18:24:20 2014
New Revision: 267967
URL: http://svnweb.freebsd.org/changeset/base/267967

Log:
  - SC_NO_SYSMOUSE isn't currently supported by vt(4), so nuke it from vt.4.
  - vt_vga(4) is a driver rather than a function so reference it accordingly.
  - Uncomment HISTORY section given that vt(4) will first appear in 9.3.
  
  Reviewed by:	emaste (modulo last part)
  MFC after:	3 days
  Sponsored by:	Bally Wulff Games & Entertainment GmbH

Modified:
  head/share/man/man4/vt.4

Modified: head/share/man/man4/vt.4
==============================================================================
--- head/share/man/man4/vt.4	Fri Jun 27 18:00:38 2014	(r267966)
+++ head/share/man/man4/vt.4	Fri Jun 27 18:24:20 2014	(r267967)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 9, 2014
+.Dd June 27, 2014
 .Dt "VIRTUAL TERMINALS" 4
 .Os
 .Sh NAME
@@ -37,7 +37,6 @@
 .Cd "options VT_FB_DEFAULT_WIDTH=X"
 .Cd "options VT_FB_DEFAULT_HEIGHT=Y"
 .Cd "options SC_NO_CUTPASTE"
-.Cd "options SC_NO_SYSMOUSE"
 .Cd "device vt"
 .Pp
 In
@@ -140,7 +139,6 @@ version.
 .It Dv VT_TWOBUTTON_MOUSE Ta Dv SC_TWOBUTTON_MOUSE
 .It Dv VT_MAXWINDOWS Ta Dv MAXCONS
 .It none Ta Dv SC_NO_CUTPASTE
-.It none Ta Dv SC_NO_SYSMOUSE
 .El
 .Sh START-UP OPERATION WITH X86 BIOS SYSTEMS
 The computer BIOS starts in text mode, and
@@ -154,13 +152,13 @@ is set, the system remains in text mode.
 Otherwise,
 .Nm
 switches to 640x480x16 VGA mode using
-.Fn vt_vga .
+.Xr vt_vga 4 .
 If a KMS
 .Pq Kernel Mode Switching
 video driver is available, the display is switched to high resolution
 and the KMS driver takes over.
 When a KMS driver is not available,
-.Fn vt_vga
+.Xr vt_vga 4
 remains active.
 .Sh LOADER TUNABLES
 These settings can be entered at the
@@ -208,12 +206,11 @@ terminal initialization information
 .Xr kbdmux 8 ,
 .Xr kldload 8 ,
 .Xr moused 8
-.\" WB: to be uncommented when an actual release contains vt(4)
-.\" .Sh HISTORY
-.\" The
-.\" Nm
-.\" driver first appeared in
-.\" .Fx 9.3 .
+.Sh HISTORY
+The
+Nm
+driver first appeared in
+.Fx 9.3 .
 .Sh AUTHORS
 .An -nosplit
 The

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 18:32:21 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 498CC7ED;
 Fri, 27 Jun 2014 18:32:21 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1D36C2DE0;
 Fri, 27 Jun 2014 18:32:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RIWK3B035672;
 Fri, 27 Jun 2014 18:32:20 GMT (envelope-from joel@svn.freebsd.org)
Received: (from joel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RIWKac035671;
 Fri, 27 Jun 2014 18:32:20 GMT (envelope-from joel@svn.freebsd.org)
Message-Id: <201406271832.s5RIWKac035671@svn.freebsd.org>
From: Joel Dahl 
Date: Fri, 27 Jun 2014 18:32:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267968 - head/share/man/man4
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 18:32:21 -0000

Author: joel (doc committer)
Date: Fri Jun 27 18:32:20 2014
New Revision: 267968
URL: http://svnweb.freebsd.org/changeset/base/267968

Log:
  Minor mdoc fix.

Modified:
  head/share/man/man4/vt.4

Modified: head/share/man/man4/vt.4
==============================================================================
--- head/share/man/man4/vt.4	Fri Jun 27 18:24:20 2014	(r267967)
+++ head/share/man/man4/vt.4	Fri Jun 27 18:32:20 2014	(r267968)
@@ -208,7 +208,7 @@ terminal initialization information
 .Xr moused 8
 .Sh HISTORY
 The
-Nm
+.Nm
 driver first appeared in
 .Fx 9.3 .
 .Sh AUTHORS

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 18:40:15 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3D6C1C3B;
 Fri, 27 Jun 2014 18:40:15 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2AA462E5F;
 Fri, 27 Jun 2014 18:40:15 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RIeFaV036989;
 Fri, 27 Jun 2014 18:40:15 GMT (envelope-from loos@svn.freebsd.org)
Received: (from loos@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RIeFF9036988;
 Fri, 27 Jun 2014 18:40:15 GMT (envelope-from loos@svn.freebsd.org)
Message-Id: <201406271840.s5RIeFF9036988@svn.freebsd.org>
From: Luiz Otavio O Souza 
Date: Fri, 27 Jun 2014 18:40:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267969 - head/usr.sbin/bsnmpd/modules/snmp_lm75
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 18:40:15 -0000

Author: loos
Date: Fri Jun 27 18:40:14 2014
New Revision: 267969
URL: http://svnweb.freebsd.org/changeset/base/267969

Log:
  Correct the buffer length check to avoid overflows.
  
  Found with:	Coverity Scan
  CID:		1222502, 1222503

Modified:
  head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.c

Modified: head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.c
==============================================================================
--- head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.c	Fri Jun 27 18:32:20 2014	(r267968)
+++ head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.c	Fri Jun 27 18:40:14 2014	(r267969)
@@ -140,7 +140,7 @@ sysctlname(int *oid, int nlen, char *nam
 {
 	int mib[12];
 
-	if (nlen > (int)sizeof(mib) + 2)
+	if (nlen > (int)(sizeof(mib) / sizeof(int) - 2))
 		return (-1);
 
 	mib[0] = 0;
@@ -158,7 +158,7 @@ sysctlgetnext(int *oid, int nlen, int *n
 {
 	int mib[12];
 
-	if (nlen  > (int)sizeof(mib) + 2)
+	if (nlen > (int)(sizeof(mib) / sizeof(int) - 2))
 		return (-1);
 
 	mib[0] = 0;
@@ -180,10 +180,13 @@ update_sensor_sysctl(char *obuf, size_t 
 
 	/* Fill out the mib information. */
 	snprintf(buf, sizeof(buf) - 1, "dev.lm75.%d.%s", idx, name);
-	len = 4;
+	len = sizeof(mib) / sizeof(int);
 	if (sysctlnametomib(buf, mib, &len) == -1)
 		return (-1);
 
+	if (len != 4)
+		return (-1);
+
 	/* Read the sysctl data. */
 	if (sysctl(mib, len, obuf, obuflen, NULL, 0) == -1)
 		return (-1);

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 18:51:19 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D83ED10A;
 Fri, 27 Jun 2014 18:51:19 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C632C2FBC;
 Fri, 27 Jun 2014 18:51:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RIpJrM042582;
 Fri, 27 Jun 2014 18:51:19 GMT (envelope-from mjg@svn.freebsd.org)
Received: (from mjg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RIpJfa042581;
 Fri, 27 Jun 2014 18:51:19 GMT (envelope-from mjg@svn.freebsd.org)
Message-Id: <201406271851.s5RIpJfa042581@svn.freebsd.org>
From: Mateusz Guzik 
Date: Fri, 27 Jun 2014 18:51:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267970 - head/usr.sbin/pw
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 18:51:19 -0000

Author: mjg
Date: Fri Jun 27 18:51:19 2014
New Revision: 267970
URL: http://svnweb.freebsd.org/changeset/base/267970

Log:
  pw: fix up deletion of users from groups
  
  Previuosly given 'foo,bar' members, removing 'foo' would result in an
  infinite loop.
  
  PR:		191427
  Submitted by:	Voradesh Yenbut 
  MFC after:	1 week

Modified:
  head/usr.sbin/pw/pw_user.c

Modified: head/usr.sbin/pw/pw_user.c
==============================================================================
--- head/usr.sbin/pw/pw_user.c	Fri Jun 27 18:40:14 2014	(r267969)
+++ head/usr.sbin/pw/pw_user.c	Fri Jun 27 18:51:19 2014	(r267970)
@@ -438,14 +438,13 @@ pw_user(struct userconf * cnf, int mode,
 				delgrent(GETGRNAM(a_name->val));
 			SETGRENT();
 			while ((grp = GETGRENT()) != NULL) {
-				int i;
+				int i, j;
 				char group[MAXLOGNAME];
 				if (grp->gr_mem != NULL) {
 					for (i = 0; grp->gr_mem[i] != NULL; i++) {
 						if (!strcmp(grp->gr_mem[i], a_name->val)) {
-							while (grp->gr_mem[i] != NULL) {
-								grp->gr_mem[i] = grp->gr_mem[i+1];
-							}	
+							for (j = i; grp->gr_mem[j] != NULL; j++)
+								grp->gr_mem[j] = grp->gr_mem[j+1];
 							strlcpy(group, grp->gr_name, MAXLOGNAME);
 							chggrent(group, grp);
 						}

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 18:58:22 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 92B59593;
 Fri, 27 Jun 2014 18:58:22 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7FDDA2057;
 Fri, 27 Jun 2014 18:58:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RIwMfS045973;
 Fri, 27 Jun 2014 18:58:22 GMT (envelope-from loos@svn.freebsd.org)
Received: (from loos@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RIwMEr045972;
 Fri, 27 Jun 2014 18:58:22 GMT (envelope-from loos@svn.freebsd.org)
Message-Id: <201406271858.s5RIwMEr045972@svn.freebsd.org>
From: Luiz Otavio O Souza 
Date: Fri, 27 Jun 2014 18:58:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267971 - head/usr.sbin/bsnmpd/modules/snmp_lm75
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 18:58:22 -0000

Author: loos
Date: Fri Jun 27 18:58:22 2014
New Revision: 267971
URL: http://svnweb.freebsd.org/changeset/base/267971

Log:
  Simplify the code a little bit using the update_sensor_sysctl() routine to
  retrieve the sensor temperature.
  
  This also avoid the overflow that could happen on sysctlnametomib(3)
  because the code was not checking the length of the mib array.
  
  CID:		1222504

Modified:
  head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.c

Modified: head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.c
==============================================================================
--- head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.c	Fri Jun 27 18:51:19 2014	(r267970)
+++ head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.c	Fri Jun 27 18:58:22 2014	(r267971)
@@ -172,7 +172,7 @@ sysctlgetnext(int *oid, int nlen, int *n
 }
 
 static int
-update_sensor_sysctl(char *obuf, size_t *obuflen, int idx, const char *name)
+update_sensor_sysctl(void *obuf, size_t *obuflen, int idx, const char *name)
 {
 	char buf[LM75BUF];
 	int mib[5];
@@ -213,22 +213,18 @@ update_sensor(struct lm75_snmp_sensor *s
 }
 
 static int
-add_sensor(char *buf, size_t nlen)
+add_sensor(char *buf)
 {
-	int idx, mib[5], temp;
+	int idx, temp;
 	size_t len;
 	struct lm75_snmp_sensor *sensor;
 
 	if (sscanf(buf, "dev.lm75.%d.temperature", &idx) != 1)
 		return (-1);
 
-	/* Fill out the mib information. */
-	if (sysctlnametomib(buf, mib, &nlen) == -1)
-		return (-1);
-
 	/* Read the sensor temperature. */
 	len = sizeof(temp);
-	if (sysctl(mib, nlen, &temp, &len, NULL, 0) == -1)
+	if (update_sensor_sysctl(&temp, &len, idx, "temperature") != 0)
 		return (-1);
 
 	/* Add the sensor data to the table. */
@@ -326,7 +322,7 @@ update_sensors(void)
 			continue;
 
 		if (strstr(buf, "temperature"))
-			if (add_sensor(buf, len) != 0) {
+			if (add_sensor(buf) != 0) {
 				free(oid);
 				return (-1);
 			}

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 19:07:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8654DA97;
 Fri, 27 Jun 2014 19:07:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 74435212E;
 Fri, 27 Jun 2014 19:07:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RJ71RN050777;
 Fri, 27 Jun 2014 19:07:01 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RJ714I050775;
 Fri, 27 Jun 2014 19:07:01 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201406271907.s5RJ714I050775@svn.freebsd.org>
From: Adrian Chadd 
Date: Fri, 27 Jun 2014 19:07:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267972 - head/sys/netinet
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 19:07:01 -0000

Author: adrian
Date: Fri Jun 27 19:07:00 2014
New Revision: 267972
URL: http://svnweb.freebsd.org/changeset/base/267972

Log:
  Add missing variable declarations when using RSS.
  
  Reported by: bryanv@

Modified:
  head/sys/netinet/ip_output.c

Modified: head/sys/netinet/ip_output.c
==============================================================================
--- head/sys/netinet/ip_output.c	Fri Jun 27 18:58:22 2014	(r267971)
+++ head/sys/netinet/ip_output.c	Fri Jun 27 19:07:00 2014	(r267972)
@@ -905,6 +905,10 @@ ip_ctloutput(struct socket *so, struct s
 {
 	struct	inpcb *inp = sotoinpcb(so);
 	int	error, optval;
+#ifdef	RSS
+	uint32_t rss_bucket;
+	int retval;
+#endif
 
 	error = optval = 0;
 	if (sopt->sopt_level != IPPROTO_IP) {

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 19:07:35 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E41B3C18;
 Fri, 27 Jun 2014 19:07:35 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D157C2145;
 Fri, 27 Jun 2014 19:07:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RJ7Z23050917;
 Fri, 27 Jun 2014 19:07:35 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RJ7ZYg050916;
 Fri, 27 Jun 2014 19:07:35 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201406271907.s5RJ7ZYg050916@svn.freebsd.org>
From: Ed Maste 
Date: Fri, 27 Jun 2014 19:07:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267973 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 19:07:36 -0000

Author: emaste
Date: Fri Jun 27 19:07:35 2014
New Revision: 267973
URL: http://svnweb.freebsd.org/changeset/base/267973

Log:
  Add CTLFLAG_NOFETCH flag; console vty code runs before tunable fetch
  
  Also remove redundant "" assignment for string in BSS.
  
  Submitted by:	hselasky@

Modified:
  head/sys/kern/kern_cons.c

Modified: head/sys/kern/kern_cons.c
==============================================================================
--- head/sys/kern/kern_cons.c	Fri Jun 27 19:07:00 2014	(r267972)
+++ head/sys/kern/kern_cons.c	Fri Jun 27 19:07:35 2014	(r267973)
@@ -652,9 +652,9 @@ sysbeep(int pitch __unused, int period _
 /*
  * Temporary support for sc(4) to vt(4) transition.
  */
-static char vty_name[16] = "";
-SYSCTL_STRING(_kern, OID_AUTO, vty, CTLFLAG_RDTUN, vty_name, 0,
-    "Console vty driver");
+static char vty_name[16];
+SYSCTL_STRING(_kern, OID_AUTO, vty, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, vty_name,
+    0, "Console vty driver");
 
 int
 vty_enabled(unsigned vty)

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 19:27:32 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 12D8E33F;
 Fri, 27 Jun 2014 19:27:32 +0000 (UTC)
Received: from mail-qc0-x22e.google.com (mail-qc0-x22e.google.com
 [IPv6:2607:f8b0:400d:c01::22e])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 94D0D2358;
 Fri, 27 Jun 2014 19:27:31 +0000 (UTC)
Received: by mail-qc0-f174.google.com with SMTP id x13so4837667qcv.19
 for ; Fri, 27 Jun 2014 12:27:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date:message-id:subject
 :from:to:cc:content-type;
 bh=UtxNAmIzebn7TC71HAqTh1HL0n5rjzYPgjLRE/mgk3A=;
 b=WEFjwSCfIoweaHrF5wJCrMYZ8ZPjk9NjiesPeB8U4b8Hx4JaWarZ3nB9Ajd4najK83
 6xw6+52VowZD6Xw1sAhOIgAC1zoEbwvk1CadtENpCuBqC0hYzOh1tarMRVW8YTuSocFQ
 NGUheY7ugNd5/pEXhjs1T2p37BxPgTMlYn+ugU4kRHJQSMuZ3/rt2MDqU+8mQ2lsf4vi
 V/nijaKen9tNbEzGd6oOp88Q3QhAKDrGBkgY+aa0uBwsTNugizdfRqlNuhr5Akltc5Y5
 qxyTLPVfKJTjYxpPqcGh27hxEcKN5rIqhoArE+jMal0U+iSjLDJWM9kuE08nmesp0aqo
 Dtrw==
MIME-Version: 1.0
X-Received: by 10.140.100.210 with SMTP id s76mr34317784qge.93.1403897250506; 
 Fri, 27 Jun 2014 12:27:30 -0700 (PDT)
Sender: carpeddiem@gmail.com
Received: by 10.140.49.239 with HTTP; Fri, 27 Jun 2014 12:27:30 -0700 (PDT)
In-Reply-To: <201406271633.s5RGXih6076565@svn.freebsd.org>
References: <201406271633.s5RGXih6076565@svn.freebsd.org>
Date: Fri, 27 Jun 2014 15:27:30 -0400
X-Google-Sender-Auth: LQknXLxhPvMEm7mjwrr3bMkpKuY
Message-ID: 
Subject: Re: svn commit: r267961 - in head/sys: amd64/acpica amd64/amd64
 amd64/pci amd64/vmm arm/arm arm/freescale/imx arm/xscale/ixp425 cam cam/ata
 cam/ctl cam/scsi cddl/compat/opensolaris/kern cddl/contrib/op...
From: Ed Maste 
To: Hans Petter Selasky 
Content-Type: text/plain; charset=UTF-8
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 19:27:32 -0000

On 27 June 2014 12:33, Hans Petter Selasky  wrote:
> Author: hselasky
> Date: Fri Jun 27 16:33:43 2014
> New Revision: 267961
> URL: http://svnweb.freebsd.org/changeset/base/267961

At r267969 sysctl strings are broken for me:

# uname -a
uname: sysctl: Cannot allocate memory
# sysctl kern.ostype
#

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 19:48:33 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 667D4C26;
 Fri, 27 Jun 2014 19:48:33 +0000 (UTC)
Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com
 [IPv6:2a00:1450:4010:c03::22e])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 5B4152573;
 Fri, 27 Jun 2014 19:48:32 +0000 (UTC)
Received: by mail-la0-f46.google.com with SMTP id el20so3243157lab.5
 for ; Fri, 27 Jun 2014 12:48:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=i2+PMrxdRL0G14qgTFNaotKjoFfkxOVW0ocbg0noiU8=;
 b=jCfpoxaVgRJCd0urk8xHzXfcxAqeQV3UZTVX1EJBmDAOyEimWK1199zx+JWBWyACls
 YzZZAPQalSh4/VSBOh6RtBbmuUsxc6cvLtPr0FX+afQmb/9pto2vZlI4E0CSgMrXhJ2U
 Lo+sF/6jwQsTkkvhhBYhhwyWzC4IoLfhScr+0X2hk9Ur8xpl4LRKSJs3cBCqgJSnt3UB
 Gluzc7z+cQHYcmwCN6FCAjewvIXOS3BUb0EqkbiYjMpFEFDJlQ4YBs2VpeGs6JIgmj7g
 UZehfuXWrbSqzthLICi5jK5HsF48VNsQdLU3QJYzbrUg9RUkw/uIF09Gl+ZYbSqmNnPM
 w5nQ==
MIME-Version: 1.0
X-Received: by 10.152.1.228 with SMTP id 4mr3077370lap.69.1403898509943; Fri,
 27 Jun 2014 12:48:29 -0700 (PDT)
Received: by 10.114.63.106 with HTTP; Fri, 27 Jun 2014 12:48:29 -0700 (PDT)
In-Reply-To: <201308212304.r7LN4mr6058450@svn.freebsd.org>
References: <201308212304.r7LN4mr6058450@svn.freebsd.org>
Date: Fri, 27 Jun 2014 12:48:29 -0700
Message-ID: 
Subject: Re: svn commit: r254627 - in head: bin/chflags bin/ls lib/libc/gen
 lib/libc/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/msdosfs
 sys/fs/smbfs sys/sys sys/ufs/ufs
From: Xin LI 
To: "Kenneth D. Merry" ,
 Craig Rodrigues 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Content-Filtered-By: Mailman/MimeDel 2.1.18
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 19:48:33 -0000

Hi,

Craig have hit an interesting issue today, where he tried to 'mv' a file
from ZFS dataset to a NFS mount, 'mv' bails out because chflags failed.

I think it's probably sensible to have mv ignoring UF_ARCHIVE, and set the
flag on the target unconditionally?  i.e.:

Index: mv.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- mv.c (revision 267940)
+++ mv.c (working copy)
@@ -337,8 +337,8 @@
  * on a file that we copied, i.e., that we didn't create.)
  */
  errno =3D 0;
- if (fchflags(to_fd, sbp->st_flags))
- if (errno !=3D EOPNOTSUPP || sbp->st_flags !=3D 0)
+ if (fchflags(to_fd, sbp->st_flags | UF_ARCHIVE))
+ if (errno !=3D EOPNOTSUPP || (sbp->st_flags & ~UF_ARCHIVE) !=3D 0)
  warn("%s: set flags (was: 0%07o)", to, sbp->st_flags);

  tval[0].tv_sec =3D sbp->st_atime;

Cheers,
=E2=80=8B

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 19:57:55 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id EEF67529;
 Fri, 27 Jun 2014 19:57:54 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D9C5B267F;
 Fri, 27 Jun 2014 19:57:54 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RJvsG4074327;
 Fri, 27 Jun 2014 19:57:54 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RJvs6j074326;
 Fri, 27 Jun 2014 19:57:54 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201406271957.s5RJvs6j074326@svn.freebsd.org>
From: Xin LI 
Date: Fri, 27 Jun 2014 19:57:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267977 - head/bin/mv
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 19:57:55 -0000

Author: delphij
Date: Fri Jun 27 19:57:54 2014
New Revision: 267977
URL: http://svnweb.freebsd.org/changeset/base/267977

Log:
  Always set UF_ARCHIVE on target (because they are by definition new files
  and should be archived) and ignore error when we can't set it (e.g. NFS).
  
  Reviewed by:	ken
  MFC after:	2 weeks

Modified:
  head/bin/mv/mv.c

Modified: head/bin/mv/mv.c
==============================================================================
--- head/bin/mv/mv.c	Fri Jun 27 19:50:30 2014	(r267976)
+++ head/bin/mv/mv.c	Fri Jun 27 19:57:54 2014	(r267977)
@@ -337,8 +337,8 @@ err:		if (unlink(to))
 	 * on a file that we copied, i.e., that we didn't create.)
 	 */
 	errno = 0;
-	if (fchflags(to_fd, sbp->st_flags))
-		if (errno != EOPNOTSUPP || sbp->st_flags != 0)
+	if (fchflags(to_fd, sbp->st_flags | UF_ARCHIVE))
+		if (errno != EOPNOTSUPP || ((sbp->st_flags & ~UF_ARCHIVE) != 0))
 			warn("%s: set flags (was: 0%07o)", to, sbp->st_flags);
 
 	tval[0].tv_sec = sbp->st_atime;

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 19:57:59 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 31EF8663;
 Fri, 27 Jun 2014 19:57:59 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 148092680;
 Fri, 27 Jun 2014 19:57:59 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RJvwj8074385;
 Fri, 27 Jun 2014 19:57:58 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RJvvDJ074376;
 Fri, 27 Jun 2014 19:57:57 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201406271957.s5RJvvDJ074376@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 27 Jun 2014 19:57:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267978 - in head: share/man/man4 sys/conf sys/dev/vt
 sys/kern sys/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 19:57:59 -0000

Author: marius
Date: Fri Jun 27 19:57:57 2014
New Revision: 267978
URL: http://svnweb.freebsd.org/changeset/base/267978

Log:
  In order to get vt(4) a bit closer to the feature set provided by sc(4),
  implement options TERMINAL_{KERN,NORM}_ATTR. These are aliased to
  SC_{KERNEL_CONS,NORM}_ATTR and like these latter, allow to change the
  default colors of normal and kernel text respectively.
  Note on the naming: Although affecting the output of vt(4), technically
  kern/subr_terminal.c is primarily concerned with changing default colors
  so it would be inconsistent to term these options VT_{KERN,NORM}_ATTR.
  Actually, if the architecture and abstraction of terminal+teken+vt would
  be perfect, dev/vt/* wouldn't be touched by this commit at all.
  
  Reviewed by:	emaste
  MFC after:	3 days
  Sponsored by:	Bally Wulff Games & Entertainment GmbH

Modified:
  head/share/man/man4/vt.4
  head/sys/conf/options
  head/sys/dev/vt/vt.h
  head/sys/dev/vt/vt_buf.c
  head/sys/dev/vt/vt_core.c
  head/sys/kern/subr_terminal.c
  head/sys/sys/terminal.h

Modified: head/share/man/man4/vt.4
==============================================================================
--- head/share/man/man4/vt.4	Fri Jun 27 19:57:54 2014	(r267977)
+++ head/share/man/man4/vt.4	Fri Jun 27 19:57:57 2014	(r267978)
@@ -31,6 +31,8 @@
 .Nm vt
 .Nd virtual terminal console driver
 .Sh SYNOPSIS
+.Cd "options TERMINAL_KERN_ATTR=_attribute_"
+.Cd "options TERMINAL_NORM_ATTR=_attribute_"
 .Cd "options VT_MAXWINDOWS=N"
 .Cd "options VT_ALT_TO_ESC_HACK=1"
 .Cd "options VT_TWOBUTTON_MOUSE"
@@ -107,6 +109,15 @@ These kernel options control the
 .Nm
 driver.
 .Bl -tag -width MAXCONS
+.It Dv TERMINAL_NORM_ATTR=_attribute_
+.It Dv TERMINAL_KERN_ATTR=_attribute_
+These options allow to change the default colors used for normal and kernel
+text respectively.
+Available colors are defined in
+.In sys/terminal.h .
+See
+.Sx EXAMPLES
+below.
 .It Dv VT_MAXWINDOWS=N
 Set the number of virtual terminals to be created to
 .Fa N .
@@ -136,6 +147,8 @@ These options will be removed in a futur
 version.
 .Bl -column -offset indent ".Sy vt VT_TWOBUTTON_MOUSE" ".Sy SC_TWOBUTTON_MOUSE"
 .It Sy vt Option Name Ta Sy sc Option Name
+.It Dv TERMINAL_KERN_ATTR Ta Dv SC_KERNEL_CONS_ATTR
+.It Dv TERMINAL_NORM_ATTR Ta Dv SC_NORM_ATTR
 .It Dv VT_TWOBUTTON_MOUSE Ta Dv SC_TWOBUTTON_MOUSE
 .It Dv VT_MAXWINDOWS Ta Dv MAXCONS
 .It none Ta Dv SC_NO_CUTPASTE
@@ -177,6 +190,21 @@ driver for the system console, if the
 .Xr syscons 4
 driver is also compiled in and is the default.
 .El
+.Sh EXAMPLES
+The following line will change the default color of normal text.
+Normal text will be green on black background.
+Reversed normal text will be black on green background.
+Note that you cannot put any white space inside the quoted string,
+because of the current implementation of
+.Xr config 8 .
+.Pp
+.Dl "options TERMINAL_NORM_ATTR=(FG_GREEN|BG_BLACK)"
+.Pp
+The following line will change the default color of kernel messages.
+Kernel messages will be printed bright red on black background.
+Reversed kernel messages will be black on bright red background.
+.Pp
+.Dl "options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK)"
 .Sh FILES
 .Bl -tag -width /usr/share/syscons/keymaps/* -compact
 .It Pa /dev/console

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Fri Jun 27 19:57:54 2014	(r267977)
+++ head/sys/conf/options	Fri Jun 27 19:57:57 2014	(r267978)
@@ -763,10 +763,11 @@ SC_TWOBUTTON_MOUSE	opt_syscons.h
 DEV_SC			opt_syscons.h
 DEV_VT			opt_syscons.h
 
-
 # teken terminal emulator options
 TEKEN_CONS25		opt_teken.h
 TEKEN_UTF8		opt_teken.h
+TERMINAL_KERN_ATTR	opt_teken.h
+TERMINAL_NORM_ATTR	opt_teken.h
 
 # options for printf
 PRINTF_BUFR_SIZE	opt_printf.h

Modified: head/sys/dev/vt/vt.h
==============================================================================
--- head/sys/dev/vt/vt.h	Fri Jun 27 19:57:54 2014	(r267977)
+++ head/sys/dev/vt/vt.h	Fri Jun 27 19:57:57 2014	(r267978)
@@ -224,7 +224,7 @@ void vtbuf_extract_marked(struct vt_buf 
 	((mask)->vbm_row & ((uint64_t)1 << ((row) % 64)))
 #define	VTBUF_DIRTYCOL(mask, col) \
 	((mask)->vbm_col & ((uint64_t)1 << ((col) % 64)))
-#define	VTBUF_SPACE_CHAR	(' ' | TC_WHITE << 26 | TC_BLACK << 29)
+#define	VTBUF_SPACE_CHAR(attr)	(' ' | (attr))
 
 #define	VHS_SET	0
 #define	VHS_CUR	1

Modified: head/sys/dev/vt/vt_buf.c
==============================================================================
--- head/sys/dev/vt/vt_buf.c	Fri Jun 27 19:57:54 2014	(r267977)
+++ head/sys/dev/vt/vt_buf.c	Fri Jun 27 19:57:57 2014	(r267978)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -385,13 +386,13 @@ vtbuf_init_rows(struct vt_buf *vb)
 	vb->vb_history_size = MAX(vb->vb_history_size, vb->vb_scr_size.tp_row);
 
 	for (r = 0; r < vb->vb_history_size; r++)
-		vb->vb_rows[r] = &vb->vb_buffer[r *
-		    vb->vb_scr_size.tp_col];
+		vb->vb_rows[r] = &vb->vb_buffer[r * vb->vb_scr_size.tp_col];
 }
 
 void
 vtbuf_init_early(struct vt_buf *vb)
 {
+	term_rect_t rect;
 
 	vb->vb_flags |= VBF_CURSOR;
 	vb->vb_roffset = 0;
@@ -402,6 +403,10 @@ vtbuf_init_early(struct vt_buf *vb)
 	vb->vb_mark_end.tp_col = 0;
 
 	vtbuf_init_rows(vb);
+	rect.tr_begin.tp_row = rect.tr_begin.tp_col = 0;
+	rect.tr_end = vb->vb_scr_size;
+	vtbuf_fill(vb, &rect, VTBUF_SPACE_CHAR((boothowto & RB_MUTE) == 0 ?
+	    TERMINAL_KERN_ATTR : TERMINAL_NORM_ATTR));
 	vtbuf_make_undirty(vb);
 	if ((vb->vb_flags & VBF_MTX_INIT) == 0) {
 		mtx_init(&vb->vb_lock, "vtbuf", NULL, MTX_SPIN);
@@ -474,20 +479,27 @@ vtbuf_grow(struct vt_buf *vb, const term
 
 		/* Copy history and fill extra space. */
 		for (r = 0; r < history_size; r ++) {
+			/*
+			 * XXX VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR) will
+			 * extended lines of kernel text using the wrong
+			 * background color.
+			 */
 			row = rows[r];
 			if (r < h) { /* Copy. */
 				memmove(rows[r], copyrows[r],
 				    MIN(p->tp_col, w) * sizeof(term_char_t));
 				for (c = MIN(p->tp_col, w); c < p->tp_col;
 				    c++) {
-					row[c] = VTBUF_SPACE_CHAR;
+					row[c] = VTBUF_SPACE_CHAR(
+					    TERMINAL_NORM_ATTR);
 				}
 			} else { /* Just fill. */
 				rect.tr_begin.tp_col = 0;
 				rect.tr_begin.tp_row = r;
 				rect.tr_end.tp_col = p->tp_col;
 				rect.tr_end.tp_row = p->tp_row;
-				vtbuf_fill(vb, &rect, VTBUF_SPACE_CHAR);
+				vtbuf_fill(vb, &rect,
+				    VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR));
 				break;
 			}
 		}

Modified: head/sys/dev/vt/vt_core.c
==============================================================================
--- head/sys/dev/vt/vt_core.c	Fri Jun 27 19:57:54 2014	(r267977)
+++ head/sys/dev/vt/vt_core.c	Fri Jun 27 19:57:57 2014	(r267978)
@@ -958,6 +958,8 @@ vtterm_cnprobe(struct terminal *tm, stru
 	struct vt_window *vw = tm->tm_softc;
 	struct vt_device *vd = vw->vw_device;
 	struct winsize wsz;
+	term_attr_t attr;
+	term_char_t c;
 
 	if (!vty_enabled(VTY_VT))
 		return;
@@ -1002,7 +1004,12 @@ vtterm_cnprobe(struct terminal *tm, stru
 
 	vtbuf_init_early(&vw->vw_buf);
 	vt_winsize(vd, vw->vw_font, &wsz);
-	terminal_set_winsize(tm, &wsz);
+	c = (boothowto & RB_MUTE) == 0 ? TERMINAL_KERN_ATTR :
+	    TERMINAL_NORM_ATTR;
+	attr.ta_format = TCHAR_FORMAT(c);
+	attr.ta_fgcolor = TCHAR_FGCOLOR(c);
+	attr.ta_bgcolor = TCHAR_BGCOLOR(c);
+	terminal_set_winsize_blank(tm, &wsz, 1, &attr);
 
 	if (vtdbest != NULL) {
 #ifdef DEV_SPLASH
@@ -1160,7 +1167,7 @@ vt_change_font(struct vt_window *vw, str
 	/* Grow the screen buffer and terminal. */
 	terminal_mute(tm, 1);
 	vtbuf_grow(&vw->vw_buf, &size, vw->vw_buf.vb_history_size);
-	terminal_set_winsize_blank(tm, &wsz, 0);
+	terminal_set_winsize_blank(tm, &wsz, 0, NULL);
 	terminal_mute(tm, 0);
 
 	/* Actually apply the font to the current window. */
@@ -2127,7 +2134,7 @@ vt_allocate(struct vt_driver *drv, void 
 	/* Update console window sizes to actual. */
 	vt_winsize(vd, vd->vd_windows[VT_CONSWINDOW]->vw_font, &wsz);
 	terminal_set_winsize_blank(vd->vd_windows[VT_CONSWINDOW]->vw_terminal,
-	    &wsz, 0);
+	    &wsz, 0, NULL);
 }
 
 void

Modified: head/sys/kern/subr_terminal.c
==============================================================================
--- head/sys/kern/subr_terminal.c	Fri Jun 27 19:57:54 2014	(r267977)
+++ head/sys/kern/subr_terminal.c	Fri Jun 27 19:57:57 2014	(r267978)
@@ -119,20 +119,20 @@ static teken_funcs_t terminal_drawmethod
 
 /* Kernel message formatting. */
 static const teken_attr_t kernel_message = {
-	.ta_fgcolor	= TC_WHITE,
-	.ta_bgcolor	= TC_BLACK,
-	.ta_format	= TF_BOLD,
+	.ta_fgcolor	= TCHAR_FGCOLOR(TERMINAL_KERN_ATTR),
+	.ta_bgcolor	= TCHAR_BGCOLOR(TERMINAL_KERN_ATTR),
+	.ta_format	= TCHAR_FORMAT(TERMINAL_KERN_ATTR)
 };
 
 static const teken_attr_t default_message = {
-	.ta_fgcolor	= TC_WHITE,
-	.ta_bgcolor	= TC_BLACK,
+	.ta_fgcolor	= TCHAR_FGCOLOR(TERMINAL_NORM_ATTR),
+	.ta_bgcolor	= TCHAR_BGCOLOR(TERMINAL_NORM_ATTR),
+	.ta_format	= TCHAR_FORMAT(TERMINAL_NORM_ATTR)
 };
 
-#define	TCHAR_CREATE(c, a)	((c) | \
-	(a)->ta_format << 21 | \
-	teken_256to8((a)->ta_fgcolor) << 26 | \
-	teken_256to8((a)->ta_bgcolor) << 29)
+#define	TCHAR_CREATE(c, a)	((c) | TFORMAT((a)->ta_format) |	\
+	TCOLOR_FG(teken_256to8((a)->ta_fgcolor)) |			\
+	TCOLOR_BG(teken_256to8((a)->ta_bgcolor)))
 
 static void
 terminal_init(struct terminal *tm)
@@ -191,7 +191,7 @@ terminal_maketty(struct terminal *tm, co
 
 void
 terminal_set_winsize_blank(struct terminal *tm, const struct winsize *size,
-    int blank)
+    int blank, const term_attr_t *attr)
 {
 	term_rect_t r;
 
@@ -209,8 +209,8 @@ terminal_set_winsize_blank(struct termin
 	TERMINAL_UNLOCK(tm);
 
 	if ((blank != 0) && !(tm->tm_flags & TF_MUTE))
-		tm->tm_class->tc_fill(tm, &r, TCHAR_CREATE((teken_char_t)' ',
-		    &default_message));
+		tm->tm_class->tc_fill(tm, &r,
+		    TCHAR_CREATE((teken_char_t)' ', attr));
 
 	terminal_sync_ttysize(tm);
 }
@@ -219,7 +219,8 @@ void
 terminal_set_winsize(struct terminal *tm, const struct winsize *size)
 {
 
-	terminal_set_winsize_blank(tm, size, 1);
+	terminal_set_winsize_blank(tm, size, 1,
+	    (const term_attr_t *)&default_message);
 }
 
 /*

Modified: head/sys/sys/terminal.h
==============================================================================
--- head/sys/sys/terminal.h	Fri Jun 27 19:57:54 2014	(r267977)
+++ head/sys/sys/terminal.h	Fri Jun 27 19:57:57 2014	(r267978)
@@ -41,6 +41,9 @@
 
 #include 
 
+#include "opt_syscons.h"
+#include "opt_teken.h"
+
 struct terminal;
 struct thread;
 struct tty;
@@ -71,11 +74,71 @@ typedef uint32_t term_char_t;
 #define	TCHAR_CHARACTER(c)	((c) & 0x1fffff)
 #define	TCHAR_FORMAT(c)		(((c) >> 21) & 0x1f)
 #define	TCHAR_FGCOLOR(c)	(((c) >> 26) & 0x7)
-#define	TCHAR_BGCOLOR(c)	((c) >> 29)
+#define	TCHAR_BGCOLOR(c)	(((c) >> 29) & 0x7)
+
+typedef teken_attr_t term_attr_t;
 
 typedef teken_color_t term_color_t;
+#define	TCOLOR_FG(c)	(((c) & 0x7) << 26)
+#define	TCOLOR_BG(c)	(((c) & 0x7) << 29)
 #define	TCOLOR_LIGHT(c)	((c) | 0x8)
 #define	TCOLOR_DARK(c)	((c) & ~0x8)
+
+#define	TFORMAT(c)	(((c) & 0x1f) << 21)
+
+/* syscons(4) compatible color attributes for foreground text */
+#define	FG_BLACK		TCOLOR_FG(TC_BLACK)
+#define	FG_BLUE			TCOLOR_FG(TC_BLUE)
+#define	FG_GREEN		TCOLOR_FG(TC_GREEN)
+#define	FG_CYAN			TCOLOR_FG(TC_CYAN)
+#define	FG_RED			TCOLOR_FG(TC_RED)
+#define	FG_MAGENTA		TCOLOR_FG(TC_MAGENTA)
+#define	FG_BROWN		TCOLOR_FG(TC_BROWN)
+#define	FG_LIGHTGREY		TCOLOR_FG(TC_WHITE)
+#define	FG_DARKGREY		(TFORMAT(TF_BOLD) | TCOLOR_FG(TC_BLACK))
+#define	FG_LIGHTBLUE		(TFORMAT(TF_BOLD) | TCOLOR_FG(TC_BLUE))
+#define	FG_LIGHTGREEN		(TFORMAT(TF_BOLD) | TCOLOR_FG(TC_GREEN))
+#define	FG_LIGHTCYAN		(TFORMAT(TF_BOLD) | TCOLOR_FG(TC_CYAN))
+#define	FG_LIGHTRED		(TFORMAT(TF_BOLD) | TCOLOR_FG(TC_RED))
+#define	FG_LIGHTMAGENTA		(TFORMAT(TF_BOLD) | TCOLOR_FG(TC_MAGENTA))
+#define	FG_YELLOW		(TFORMAT(TF_BOLD) | TCOLOR_FG(TC_BROWN))
+#define	FG_WHITE		(TFORMAT(TF_BOLD) | TCOLOR_FG(TC_WHITE))
+#define	FG_BLINK		TFORMAT(TF_BLINK)
+
+/* syscons(4) compatible color attributes for text background */
+#define	BG_BLACK		TCOLOR_BG(TC_BLACK)
+#define	BG_BLUE			TCOLOR_BG(TC_BLUE)
+#define	BG_GREEN		TCOLOR_BG(TC_GREEN)
+#define	BG_CYAN			TCOLOR_BG(TC_CYAN)
+#define	BG_RED			TCOLOR_BG(TC_RED)
+#define	BG_MAGENTA		TCOLOR_BG(TC_MAGENTA)
+#define	BG_BROWN		TCOLOR_BG(TC_BROWN)
+#define	BG_LIGHTGREY		TCOLOR_BG(TC_WHITE)
+#define	BG_DARKGREY		(TFORMAT(TF_BOLD) | TCOLOR_BG(TC_BLACK))
+#define	BG_LIGHTBLUE		(TFORMAT(TF_BOLD) | TCOLOR_BG(TC_BLUE))
+#define	BG_LIGHTGREEN		(TFORMAT(TF_BOLD) | TCOLOR_BG(TC_GREEN))
+#define	BG_LIGHTCYAN		(TFORMAT(TF_BOLD) | TCOLOR_BG(TC_CYAN))
+#define	BG_LIGHTRED		(TFORMAT(TF_BOLD) | TCOLOR_BG(TC_RED))
+#define	BG_LIGHTMAGENTA		(TFORMAT(TF_BOLD) | TCOLOR_BG(TC_MAGENTA))
+#define	BG_YELLOW		(TFORMAT(TF_BOLD) | TCOLOR_BG(TC_BROWN))
+#define	BG_WHITE		(TFORMAT(TF_BOLD) | TCOLOR_BG(TC_WHITE))
+
+#ifndef TERMINAL_NORM_ATTR
+#ifdef SC_NORM_ATTR
+#define	TERMINAL_NORM_ATTR	SC_NORM_ATTR
+#else
+#define	TERMINAL_NORM_ATTR	(FG_LIGHTGREY | BG_BLACK)
+#endif
+#endif
+
+#ifndef TERMINAL_KERN_ATTR
+#ifdef SC_KERNEL_CONS_ATTR
+#define	TERMINAL_KERN_ATTR	SC_KERNEL_CONS_ATTR
+#else
+#define	TERMINAL_KERN_ATTR	(FG_WHITE | BG_BLACK)
+#endif
+#endif
+
 typedef teken_pos_t term_pos_t;
 typedef teken_rect_t term_rect_t;
 
@@ -138,7 +201,7 @@ struct terminal {
 struct terminal *terminal_alloc(const struct terminal_class *tc, void *softc);
 void	terminal_maketty(struct terminal *tm, const char *fmt, ...);
 void	terminal_set_winsize_blank(struct terminal *tm,
-    const struct winsize *size, int blank);
+    const struct winsize *size, int blank, const term_attr_t *attr);
 void	terminal_set_winsize(struct terminal *tm, const struct winsize *size);
 void	terminal_mute(struct terminal *tm, int yes);
 void	terminal_input_char(struct terminal *tm, term_char_t c);

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 20:18:33 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id EE005DD3;
 Fri, 27 Jun 2014 20:18:33 +0000 (UTC)
Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 73894285D;
 Fri, 27 Jun 2014 20:18:32 +0000 (UTC)
Received: from nargothrond.kdm.org (localhost [127.0.0.1])
 by nargothrond.kdm.org (8.14.9/8.14.2) with ESMTP id s5RJq1Ht052124;
 Fri, 27 Jun 2014 13:52:01 -0600 (MDT)
 (envelope-from ken@nargothrond.kdm.org)
Received: (from ken@localhost)
 by nargothrond.kdm.org (8.14.9/8.14.9/Submit) id s5RJq1DF052123;
 Fri, 27 Jun 2014 13:52:01 -0600 (MDT) (envelope-from ken)
Date: Fri, 27 Jun 2014 13:52:01 -0600
From: "Kenneth D. Merry" 
To: Xin LI 
Subject: Re: svn commit: r254627 - in head: bin/chflags bin/ls lib/libc/gen
 lib/libc/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/msdosfs
 sys/fs/smbfs sys/sys sys/ufs/ufs
Message-ID: <20140627195201.GA52113@nargothrond.kdm.org>
References: <201308212304.r7LN4mr6058450@svn.freebsd.org>
 
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: 
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: "svn-src-head@freebsd.org" ,
 Craig Rodrigues ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 20:18:34 -0000

On Fri, Jun 27, 2014 at 12:48:29 -0700, Xin LI wrote:
> Hi,
> 
> Craig have hit an interesting issue today, where he tried to 'mv' a file
> from ZFS dataset to a NFS mount, 'mv' bails out because chflags failed.
> 
> I think it's probably sensible to have mv ignoring UF_ARCHIVE, and set the
> flag on the target unconditionally?  i.e.:
> 
> Index: mv.c
> ===================================================================
> --- mv.c (revision 267940)
> +++ mv.c (working copy)
> @@ -337,8 +337,8 @@
>   * on a file that we copied, i.e., that we didn't create.)
>   */
>   errno = 0;
> - if (fchflags(to_fd, sbp->st_flags))
> - if (errno != EOPNOTSUPP || sbp->st_flags != 0)
> + if (fchflags(to_fd, sbp->st_flags | UF_ARCHIVE))
> + if (errno != EOPNOTSUPP || (sbp->st_flags & ~UF_ARCHIVE) != 0)
>   warn("%s: set flags (was: 0%07o)", to, sbp->st_flags);
> 
>   tval[0].tv_sec = sbp->st_atime;

Yes, that sounds like a good way to do it.

Ken
-- 
Kenneth Merry
ken@FreeBSD.ORG

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 20:19:14 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1A83CF19;
 Fri, 27 Jun 2014 20:19:14 +0000 (UTC)
Received: from mail-we0-x22f.google.com (mail-we0-x22f.google.com
 [IPv6:2a00:1450:400c:c03::22f])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 1170D2864;
 Fri, 27 Jun 2014 20:19:12 +0000 (UTC)
Received: by mail-we0-f175.google.com with SMTP id k48so5707350wev.34
 for ; Fri, 27 Jun 2014 13:19:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=w0l2a3MYhWdVB6iXzEquJTuVAfcUsCK8Dd6PFAA+TLA=;
 b=Dst+BoMg0v79NDlG3vJqn4jmDyAsTNCaVitUtUUxj6t+RG5OHZBPP8kItos/dwKvlR
 q0B1s5/7sxU5a+fxaifkoL76opf6py9vrFhye+eCgSnTICU9LmAFYyXuAnB5PWNwYBkJ
 2w8yMXgoliQ3drURgZFBLBLOCGKkvKDxMPRMaGtyp6XR2CawAb0WpKSw90kCt+3MQ5Oy
 NzHXUNOrq4T1XuB7R6+nbsqwDGzeNofLtSgsVct1w2Z19n0PjtHr6KaBlVhftBF+1jiv
 c1TAQt43ZZijqcGM68BKRnJ4LcBkPQ+Tn9EF6NigwIdoEnL5SVglGJNw6Lnnj4S7QxF6
 Yz/Q==
X-Received: by 10.180.37.230 with SMTP id b6mr14048562wik.47.1403900350783;
 Fri, 27 Jun 2014 13:19:10 -0700 (PDT)
Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net.
 [2001:470:1f08:1f7::2])
 by mx.google.com with ESMTPSA id gh16sm204437wic.3.2014.06.27.13.19.09
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Fri, 27 Jun 2014 13:19:10 -0700 (PDT)
Date: Fri, 27 Jun 2014 22:19:07 +0200
From: Mateusz Guzik 
To: Ed Maste 
Subject: Re: svn commit: r267961 - in head/sys: amd64/acpica amd64/amd64
 amd64/pci amd64/vmm arm/arm arm/freescale/imx arm/xscale/ixp425 cam cam/ata
 cam/ctl cam/scsi cddl/compat/opensolaris/kern cddl/contrib/op...
Message-ID: <20140627201907.GC22501@dft-labs.eu>
References: <201406271633.s5RGXih6076565@svn.freebsd.org>
 
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: 
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" ,
 Hans Petter Selasky 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 20:19:14 -0000

On Fri, Jun 27, 2014 at 03:27:30PM -0400, Ed Maste wrote:
> On 27 June 2014 12:33, Hans Petter Selasky  wrote:
> > Author: hselasky
> > Date: Fri Jun 27 16:33:43 2014
> > New Revision: 267961
> > URL: http://svnweb.freebsd.org/changeset/base/267961
> 
> At r267969 sysctl strings are broken for me:
> 
> # uname -a
> uname: sysctl: Cannot allocate memory
> # sysctl kern.ostype
> #
> 

The problem was with (arg2 == 0) check.

I have a hack which restores things for me, but since the check was put
in place just removing it may not be the correct approach.

That said, I would suggest reverting the change for the time being until
it is concluded what is the correct thing to do here.

fwiw, the hack is:
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index cb5a266..9b7f108 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1210,21 +1210,23 @@ sysctl_handle_string(SYSCTL_HANDLER_ARGS)
        size_t outlen;
        int error = 0;
 
-       /* check for zero-length buffer */
-       if (arg2 == 0)
-               return (ENOMEM);
-
        if (req->oldptr != NULL) {
                char *tmparg;
 
-               /* try to make a coherent snapshot of the string */
-               tmparg = malloc(arg2, M_SYSCTLTMP, M_WAITOK);
-               memcpy(tmparg, arg1, arg2);
+               if (arg2 != 0) {
+                       /* try to make a coherent snapshot of the string */
+                       tmparg = malloc(arg2, M_SYSCTLTMP, M_WAITOK);
+                       memcpy(tmparg, arg1, arg2);
+                       outlen = strnlen(tmparg, arg2 - 1) + 1;
+               } else {
+                       tmparg = arg1;
+                       outlen = strlen((char *)arg1)+1;
+               }
 
-               outlen = strnlen(tmparg, arg2 - 1) + 1;
                error = SYSCTL_OUT(req, tmparg, outlen);
 
-               free(tmparg, M_SYSCTLTMP);
+               if (tmparg != arg1)
+                       free(tmparg, M_SYSCTLTMP);
        } else {
                outlen = strnlen((char *)arg1, arg2 - 1) + 1;
                error = SYSCTL_OUT(req, NULL, outlen);

-- 
Mateusz Guzik 

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 20:41:13 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9E83ECA7;
 Fri, 27 Jun 2014 20:41:13 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 719D12ABF;
 Fri, 27 Jun 2014 20:41:13 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RKfDtd095098;
 Fri, 27 Jun 2014 20:41:13 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RKfDgg095096;
 Fri, 27 Jun 2014 20:41:13 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201406272041.s5RKfDgg095096@svn.freebsd.org>
From: Dimitry Andric 
Date: Fri, 27 Jun 2014 20:41:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267981 - head/contrib/llvm/lib/Target/PowerPC
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 20:41:13 -0000

Author: dim
Date: Fri Jun 27 20:41:12 2014
New Revision: 267981
URL: http://svnweb.freebsd.org/changeset/base/267981

Log:
  Pull in r211627 from upstream llvm trunk (by Bill Schmidt):
  
    [PPC64] Fix PR20071 (fctiduz generated for targets lacking that
    instruction)
  
    PR20071 identifies a problem in PowerPC's fast-isel implementation
    for floating-point conversion to integer.  The fctiduz instruction
    was added in Power ISA 2.06 (i.e., Power7 and later).  However, this
    instruction is being generated regardless of which 64-bit PowerPC
    target is selected.
  
    The intent is for fast-isel to punt to DAG selection when this
    instruction is not available.  This patch implements that change.
    For testing purposes, the existing fast-isel-conversion.ll test adds
    a RUN line for -mcpu=970 and tests for the expected code generation.
    Additionally, the existing test fast-isel-conversion-p5.ll was found
    to be incorrectly expecting the unavailable instruction to be
    generated.  I've removed these test variants since we have adequate
    coverage in fast-isel-conversion.ll.
  
  This is needed to compile clang with debug+asserts on older powerpc64
  and ppc970 targets.
  
  Requested by:	jhibbits
  MFC after:	3 days

Modified:
  head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp

Modified: head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp
==============================================================================
--- head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp	Fri Jun 27 20:39:45 2014	(r267980)
+++ head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp	Fri Jun 27 20:41:12 2014	(r267981)
@@ -1026,6 +1026,10 @@ bool PPCFastISel::SelectFPToI(const Inst
   if (DstVT != MVT::i32 && DstVT != MVT::i64)
     return false;
 
+  // If we don't have FCTIDUZ and we need it, punt to SelectionDAG.
+  if (DstVT == MVT::i64 && !IsSigned && !PPCSubTarget->hasFPCVT())
+    return false;
+
   Value *Src = I->getOperand(0);
   Type *SrcTy = Src->getType();
   if (!isTypeLegal(SrcTy, SrcVT))

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 20:45:18 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 26560FEC;
 Fri, 27 Jun 2014 20:45:18 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id ECC972AEA;
 Fri, 27 Jun 2014 20:45:17 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RKjHfE098277;
 Fri, 27 Jun 2014 20:45:17 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RKjHHO098276;
 Fri, 27 Jun 2014 20:45:17 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201406272045.s5RKjHHO098276@svn.freebsd.org>
From: Dimitry Andric 
Date: Fri, 27 Jun 2014 20:45:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267982 - head/contrib/llvm/patches
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 20:45:18 -0000

Author: dim
Date: Fri Jun 27 20:45:17 2014
New Revision: 267982
URL: http://svnweb.freebsd.org/changeset/base/267982

Log:
  Add the llvm patch for r267981.

Added:
  head/contrib/llvm/patches/patch-r267981-llvm-r211435-fix-ppc-fctiduz.diff

Added: head/contrib/llvm/patches/patch-r267981-llvm-r211435-fix-ppc-fctiduz.diff
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/llvm/patches/patch-r267981-llvm-r211435-fix-ppc-fctiduz.diff	Fri Jun 27 20:45:17 2014	(r267982)
@@ -0,0 +1,494 @@
+Pull in r211627 from upstream llvm trunk (by Bill Schmidt):
+
+  [PPC64] Fix PR20071 (fctiduz generated for targets lacking that
+  instruction)
+
+  PR20071 identifies a problem in PowerPC's fast-isel implementation
+  for floating-point conversion to integer.  The fctiduz instruction
+  was added in Power ISA 2.06 (i.e., Power7 and later).  However, this
+  instruction is being generated regardless of which 64-bit PowerPC
+  target is selected.
+
+  The intent is for fast-isel to punt to DAG selection when this
+  instruction is not available.  This patch implements that change.
+  For testing purposes, the existing fast-isel-conversion.ll test adds
+  a RUN line for -mcpu=970 and tests for the expected code generation.
+  Additionally, the existing test fast-isel-conversion-p5.ll was found
+  to be incorrectly expecting the unavailable instruction to be
+  generated.  I've removed these test variants since we have adequate
+  coverage in fast-isel-conversion.ll.
+
+This is needed to compile clang with debug+asserts on older powerpc64
+and ppc970 targets.
+
+Introduced here: http://svnweb.freebsd.org/changeset/base/267981
+
+Index: lib/Target/PowerPC/PPCFastISel.cpp
+===================================================================
+--- lib/Target/PowerPC/PPCFastISel.cpp	(revision 106)
++++ lib/Target/PowerPC/PPCFastISel.cpp	(revision 107)
+@@ -1026,6 +1026,10 @@ bool PPCFastISel::SelectFPToI(const Instruction *I
+   if (DstVT != MVT::i32 && DstVT != MVT::i64)
+     return false;
+ 
++  // If we don't have FCTIDUZ and we need it, punt to SelectionDAG.
++  if (DstVT == MVT::i64 && !IsSigned && !PPCSubTarget->hasFPCVT())
++    return false;
++
+   Value *Src = I->getOperand(0);
+   Type *SrcTy = Src->getType();
+   if (!isTypeLegal(SrcTy, SrcVT))
+Index: test/CodeGen/PowerPC/fast-isel-conversion-p5.ll
+===================================================================
+--- test/CodeGen/PowerPC/fast-isel-conversion-p5.ll	(revision 106)
++++ test/CodeGen/PowerPC/fast-isel-conversion-p5.ll	(revision 107)
+@@ -116,18 +116,6 @@ entry:
+   ret void
+ }
+ 
+-define void @fptoui_float_i64(float %a) nounwind ssp {
+-entry:
+-; ELF64: fptoui_float_i64
+-  %b.addr = alloca i64, align 4
+-  %conv = fptoui float %a to i64
+-; ELF64: fctiduz
+-; ELF64: stfd
+-; ELF64: ld
+-  store i64 %conv, i64* %b.addr, align 4
+-  ret void
+-}
+-
+ define void @fptoui_double_i32(double %a) nounwind ssp {
+ entry:
+ ; ELF64: fptoui_double_i32
+@@ -140,14 +128,3 @@ entry:
+   ret void
+ }
+ 
+-define void @fptoui_double_i64(double %a) nounwind ssp {
+-entry:
+-; ELF64: fptoui_double_i64
+-  %b.addr = alloca i64, align 8
+-  %conv = fptoui double %a to i64
+-; ELF64: fctiduz
+-; ELF64: stfd
+-; ELF64: ld
+-  store i64 %conv, i64* %b.addr, align 8
+-  ret void
+-}
+Index: test/CodeGen/PowerPC/fast-isel-conversion.ll
+===================================================================
+--- test/CodeGen/PowerPC/fast-isel-conversion.ll	(revision 106)
++++ test/CodeGen/PowerPC/fast-isel-conversion.ll	(revision 107)
+@@ -1,15 +1,24 @@
+ ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s --check-prefix=ELF64
++; RUN: llc < %s -O0 -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=970 | FileCheck %s --check-prefix=PPC970
+ 
++;; Tests for 970 don't use -fast-isel-abort because we intentionally punt
++;; to SelectionDAG in some cases.
++
+ ; Test sitofp
+ 
+ define void @sitofp_single_i64(i64 %a, float %b) nounwind ssp {
+ entry:
+ ; ELF64: sitofp_single_i64
++; PPC970: sitofp_single_i64
+   %b.addr = alloca float, align 4
+   %conv = sitofp i64 %a to float
+ ; ELF64: std
+ ; ELF64: lfd
+ ; ELF64: fcfids
++; PPC970: std
++; PPC970: lfd
++; PPC970: fcfid
++; PPC970: frsp
+   store float %conv, float* %b.addr, align 4
+   ret void
+ }
+@@ -17,11 +26,16 @@ entry:
+ define void @sitofp_single_i32(i32 %a, float %b) nounwind ssp {
+ entry:
+ ; ELF64: sitofp_single_i32
++; PPC970: sitofp_single_i32
+   %b.addr = alloca float, align 4
+   %conv = sitofp i32 %a to float
+ ; ELF64: std
+ ; ELF64: lfiwax
+ ; ELF64: fcfids
++; PPC970: std
++; PPC970: lfd
++; PPC970: fcfid
++; PPC970: frsp
+   store float %conv, float* %b.addr, align 4
+   ret void
+ }
+@@ -29,6 +43,7 @@ entry:
+ define void @sitofp_single_i16(i16 %a, float %b) nounwind ssp {
+ entry:
+ ; ELF64: sitofp_single_i16
++; PPC970: sitofp_single_i16
+   %b.addr = alloca float, align 4
+   %conv = sitofp i16 %a to float
+ ; ELF64: extsh
+@@ -35,6 +50,11 @@ entry:
+ ; ELF64: std
+ ; ELF64: lfd
+ ; ELF64: fcfids
++; PPC970: extsh
++; PPC970: std
++; PPC970: lfd
++; PPC970: fcfid
++; PPC970: frsp
+   store float %conv, float* %b.addr, align 4
+   ret void
+ }
+@@ -42,6 +62,7 @@ entry:
+ define void @sitofp_single_i8(i8 %a) nounwind ssp {
+ entry:
+ ; ELF64: sitofp_single_i8
++; PPC970: sitofp_single_i8
+   %b.addr = alloca float, align 4
+   %conv = sitofp i8 %a to float
+ ; ELF64: extsb
+@@ -48,6 +69,11 @@ entry:
+ ; ELF64: std
+ ; ELF64: lfd
+ ; ELF64: fcfids
++; PPC970: extsb
++; PPC970: std
++; PPC970: lfd
++; PPC970: fcfid
++; PPC970: frsp
+   store float %conv, float* %b.addr, align 4
+   ret void
+ }
+@@ -55,11 +81,15 @@ entry:
+ define void @sitofp_double_i32(i32 %a, double %b) nounwind ssp {
+ entry:
+ ; ELF64: sitofp_double_i32
++; PPC970: sitofp_double_i32
+   %b.addr = alloca double, align 8
+   %conv = sitofp i32 %a to double
+ ; ELF64: std
+ ; ELF64: lfiwax
+ ; ELF64: fcfid
++; PPC970: std
++; PPC970: lfd
++; PPC970: fcfid
+   store double %conv, double* %b.addr, align 8
+   ret void
+ }
+@@ -67,11 +97,15 @@ entry:
+ define void @sitofp_double_i64(i64 %a, double %b) nounwind ssp {
+ entry:
+ ; ELF64: sitofp_double_i64
++; PPC970: sitofp_double_i64
+   %b.addr = alloca double, align 8
+   %conv = sitofp i64 %a to double
+ ; ELF64: std
+ ; ELF64: lfd
+ ; ELF64: fcfid
++; PPC970: std
++; PPC970: lfd
++; PPC970: fcfid
+   store double %conv, double* %b.addr, align 8
+   ret void
+ }
+@@ -79,6 +113,7 @@ entry:
+ define void @sitofp_double_i16(i16 %a, double %b) nounwind ssp {
+ entry:
+ ; ELF64: sitofp_double_i16
++; PPC970: sitofp_double_i16
+   %b.addr = alloca double, align 8
+   %conv = sitofp i16 %a to double
+ ; ELF64: extsh
+@@ -85,6 +120,10 @@ entry:
+ ; ELF64: std
+ ; ELF64: lfd
+ ; ELF64: fcfid
++; PPC970: extsh
++; PPC970: std
++; PPC970: lfd
++; PPC970: fcfid
+   store double %conv, double* %b.addr, align 8
+   ret void
+ }
+@@ -92,6 +131,7 @@ entry:
+ define void @sitofp_double_i8(i8 %a, double %b) nounwind ssp {
+ entry:
+ ; ELF64: sitofp_double_i8
++; PPC970: sitofp_double_i8
+   %b.addr = alloca double, align 8
+   %conv = sitofp i8 %a to double
+ ; ELF64: extsb
+@@ -98,6 +138,10 @@ entry:
+ ; ELF64: std
+ ; ELF64: lfd
+ ; ELF64: fcfid
++; PPC970: extsb
++; PPC970: std
++; PPC970: lfd
++; PPC970: fcfid
+   store double %conv, double* %b.addr, align 8
+   ret void
+ }
+@@ -107,11 +151,13 @@ entry:
+ define void @uitofp_single_i64(i64 %a, float %b) nounwind ssp {
+ entry:
+ ; ELF64: uitofp_single_i64
++; PPC970: uitofp_single_i64
+   %b.addr = alloca float, align 4
+   %conv = uitofp i64 %a to float
+ ; ELF64: std
+ ; ELF64: lfd
+ ; ELF64: fcfidus
++; PPC970-NOT: fcfidus
+   store float %conv, float* %b.addr, align 4
+   ret void
+ }
+@@ -119,11 +165,14 @@ entry:
+ define void @uitofp_single_i32(i32 %a, float %b) nounwind ssp {
+ entry:
+ ; ELF64: uitofp_single_i32
++; PPC970: uitofp_single_i32
+   %b.addr = alloca float, align 4
+   %conv = uitofp i32 %a to float
+ ; ELF64: std
+ ; ELF64: lfiwzx
+ ; ELF64: fcfidus
++; PPC970-NOT: lfiwzx
++; PPC970-NOT: fcfidus
+   store float %conv, float* %b.addr, align 4
+   ret void
+ }
+@@ -131,6 +180,7 @@ entry:
+ define void @uitofp_single_i16(i16 %a, float %b) nounwind ssp {
+ entry:
+ ; ELF64: uitofp_single_i16
++; PPC970: uitofp_single_i16
+   %b.addr = alloca float, align 4
+   %conv = uitofp i16 %a to float
+ ; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 48
+@@ -137,6 +187,11 @@ entry:
+ ; ELF64: std
+ ; ELF64: lfd
+ ; ELF64: fcfidus
++; PPC970: rlwinm {{[0-9]+}}, {{[0-9]+}}, 0, 16, 31
++; PPC970: std
++; PPC970: lfd
++; PPC970: fcfid
++; PPC970: frsp
+   store float %conv, float* %b.addr, align 4
+   ret void
+ }
+@@ -144,6 +199,7 @@ entry:
+ define void @uitofp_single_i8(i8 %a) nounwind ssp {
+ entry:
+ ; ELF64: uitofp_single_i8
++; PPC970: uitofp_single_i8
+   %b.addr = alloca float, align 4
+   %conv = uitofp i8 %a to float
+ ; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 56
+@@ -150,6 +206,11 @@ entry:
+ ; ELF64: std
+ ; ELF64: lfd
+ ; ELF64: fcfidus
++; PPC970: rlwinm {{[0-9]+}}, {{[0-9]+}}, 0, 24, 31
++; PPC970: std
++; PPC970: lfd
++; PPC970: fcfid
++; PPC970: frsp
+   store float %conv, float* %b.addr, align 4
+   ret void
+ }
+@@ -157,11 +218,13 @@ entry:
+ define void @uitofp_double_i64(i64 %a, double %b) nounwind ssp {
+ entry:
+ ; ELF64: uitofp_double_i64
++; PPC970: uitofp_double_i64
+   %b.addr = alloca double, align 8
+   %conv = uitofp i64 %a to double
+ ; ELF64: std
+ ; ELF64: lfd
+ ; ELF64: fcfidu
++; PPC970-NOT: fcfidu
+   store double %conv, double* %b.addr, align 8
+   ret void
+ }
+@@ -169,11 +232,14 @@ entry:
+ define void @uitofp_double_i32(i32 %a, double %b) nounwind ssp {
+ entry:
+ ; ELF64: uitofp_double_i32
++; PPC970: uitofp_double_i32
+   %b.addr = alloca double, align 8
+   %conv = uitofp i32 %a to double
+ ; ELF64: std
+ ; ELF64: lfiwzx
+ ; ELF64: fcfidu
++; PPC970-NOT: lfiwzx
++; PPC970-NOT: fcfidu
+   store double %conv, double* %b.addr, align 8
+   ret void
+ }
+@@ -181,6 +247,7 @@ entry:
+ define void @uitofp_double_i16(i16 %a, double %b) nounwind ssp {
+ entry:
+ ; ELF64: uitofp_double_i16
++; PPC970: uitofp_double_i16
+   %b.addr = alloca double, align 8
+   %conv = uitofp i16 %a to double
+ ; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 48
+@@ -187,6 +254,10 @@ entry:
+ ; ELF64: std
+ ; ELF64: lfd
+ ; ELF64: fcfidu
++; PPC970: rlwinm {{[0-9]+}}, {{[0-9]+}}, 0, 16, 31
++; PPC970: std
++; PPC970: lfd
++; PPC970: fcfid
+   store double %conv, double* %b.addr, align 8
+   ret void
+ }
+@@ -194,6 +265,7 @@ entry:
+ define void @uitofp_double_i8(i8 %a, double %b) nounwind ssp {
+ entry:
+ ; ELF64: uitofp_double_i8
++; PPC970: uitofp_double_i8
+   %b.addr = alloca double, align 8
+   %conv = uitofp i8 %a to double
+ ; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 56
+@@ -200,6 +272,10 @@ entry:
+ ; ELF64: std
+ ; ELF64: lfd
+ ; ELF64: fcfidu
++; PPC970: rlwinm {{[0-9]+}}, {{[0-9]+}}, 0, 24, 31
++; PPC970: std
++; PPC970: lfd
++; PPC970: fcfid
+   store double %conv, double* %b.addr, align 8
+   ret void
+ }
+@@ -209,11 +285,15 @@ entry:
+ define void @fptosi_float_i32(float %a) nounwind ssp {
+ entry:
+ ; ELF64: fptosi_float_i32
++; PPC970: fptosi_float_i32
+   %b.addr = alloca i32, align 4
+   %conv = fptosi float %a to i32
+ ; ELF64: fctiwz
+ ; ELF64: stfd
+ ; ELF64: lwa
++; PPC970: fctiwz
++; PPC970: stfd
++; PPC970: lwa
+   store i32 %conv, i32* %b.addr, align 4
+   ret void
+ }
+@@ -221,11 +301,15 @@ entry:
+ define void @fptosi_float_i64(float %a) nounwind ssp {
+ entry:
+ ; ELF64: fptosi_float_i64
++; PPC970: fptosi_float_i64
+   %b.addr = alloca i64, align 4
+   %conv = fptosi float %a to i64
+ ; ELF64: fctidz
+ ; ELF64: stfd
+ ; ELF64: ld
++; PPC970: fctidz
++; PPC970: stfd
++; PPC970: ld
+   store i64 %conv, i64* %b.addr, align 4
+   ret void
+ }
+@@ -233,11 +317,15 @@ entry:
+ define void @fptosi_double_i32(double %a) nounwind ssp {
+ entry:
+ ; ELF64: fptosi_double_i32
++; PPC970: fptosi_double_i32
+   %b.addr = alloca i32, align 8
+   %conv = fptosi double %a to i32
+ ; ELF64: fctiwz
+ ; ELF64: stfd
+ ; ELF64: lwa
++; PPC970: fctiwz
++; PPC970: stfd
++; PPC970: lwa
+   store i32 %conv, i32* %b.addr, align 8
+   ret void
+ }
+@@ -245,11 +333,15 @@ entry:
+ define void @fptosi_double_i64(double %a) nounwind ssp {
+ entry:
+ ; ELF64: fptosi_double_i64
++; PPC970: fptosi_double_i64
+   %b.addr = alloca i64, align 8
+   %conv = fptosi double %a to i64
+ ; ELF64: fctidz
+ ; ELF64: stfd
+ ; ELF64: ld
++; PPC970: fctidz
++; PPC970: stfd
++; PPC970: ld
+   store i64 %conv, i64* %b.addr, align 8
+   ret void
+ }
+@@ -259,11 +351,15 @@ entry:
+ define void @fptoui_float_i32(float %a) nounwind ssp {
+ entry:
+ ; ELF64: fptoui_float_i32
++; PPC970: fptoui_float_i32
+   %b.addr = alloca i32, align 4
+   %conv = fptoui float %a to i32
+ ; ELF64: fctiwuz
+ ; ELF64: stfd
+ ; ELF64: lwz
++; PPC970: fctidz
++; PPC970: stfd
++; PPC970: lwz
+   store i32 %conv, i32* %b.addr, align 4
+   ret void
+ }
+@@ -271,11 +367,13 @@ entry:
+ define void @fptoui_float_i64(float %a) nounwind ssp {
+ entry:
+ ; ELF64: fptoui_float_i64
++; PPC970: fptoui_float_i64
+   %b.addr = alloca i64, align 4
+   %conv = fptoui float %a to i64
+ ; ELF64: fctiduz
+ ; ELF64: stfd
+ ; ELF64: ld
++; PPC970-NOT: fctiduz
+   store i64 %conv, i64* %b.addr, align 4
+   ret void
+ }
+@@ -283,11 +381,15 @@ entry:
+ define void @fptoui_double_i32(double %a) nounwind ssp {
+ entry:
+ ; ELF64: fptoui_double_i32
++; PPC970: fptoui_double_i32
+   %b.addr = alloca i32, align 8
+   %conv = fptoui double %a to i32
+ ; ELF64: fctiwuz
+ ; ELF64: stfd
+ ; ELF64: lwz
++; PPC970: fctidz
++; PPC970: stfd
++; PPC970: lwz
+   store i32 %conv, i32* %b.addr, align 8
+   ret void
+ }
+@@ -295,11 +397,13 @@ entry:
+ define void @fptoui_double_i64(double %a) nounwind ssp {
+ entry:
+ ; ELF64: fptoui_double_i64
++; PPC970: fptoui_double_i64
+   %b.addr = alloca i64, align 8
+   %conv = fptoui double %a to i64
+ ; ELF64: fctiduz
+ ; ELF64: stfd
+ ; ELF64: ld
++; PPC970-NOT: fctiduz
+   store i64 %conv, i64* %b.addr, align 8
+   ret void
+ }

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 21:33:15 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B3C7926E;
 Fri, 27 Jun 2014 21:33:15 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A14C22F75;
 Fri, 27 Jun 2014 21:33:15 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RLXFWm021831;
 Fri, 27 Jun 2014 21:33:15 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RLXFNX021830;
 Fri, 27 Jun 2014 21:33:15 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201406272133.s5RLXFNX021830@svn.freebsd.org>
From: Xin LI 
Date: Fri, 27 Jun 2014 21:33:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267984 - head/sys/dev/random
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 21:33:15 -0000

Author: delphij
Date: Fri Jun 27 21:33:15 2014
New Revision: 267984
URL: http://svnweb.freebsd.org/changeset/base/267984

Log:
  Use Intel's official name (Secure Key) per Intel® Digital Random Number
  Generator (DRNG) Software Implementation Guide.
  
  Reviewed by:	kib
  Approved by:	so
  MFC after:	2 weeks

Modified:
  head/sys/dev/random/ivy.c

Modified: head/sys/dev/random/ivy.c
==============================================================================
--- head/sys/dev/random/ivy.c	Fri Jun 27 20:57:12 2014	(r267983)
+++ head/sys/dev/random/ivy.c	Fri Jun 27 21:33:15 2014	(r267984)
@@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$");
 static int random_ivy_read(void *, int);
 
 static struct random_hardware_source random_ivy = {
-	.ident = "Hardware, Intel IvyBridge+ RNG",
+	.ident = "Hardware, Intel Secure Key RNG",
 	.source = RANDOM_PURE_RDRAND,
 	.read = random_ivy_read
 };

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 22:05:32 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B9F75D0F;
 Fri, 27 Jun 2014 22:05:32 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A2AA62230;
 Fri, 27 Jun 2014 22:05:32 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RM5WMJ036197;
 Fri, 27 Jun 2014 22:05:32 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RM5Mdk036126;
 Fri, 27 Jun 2014 22:05:22 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201406272205.s5RM5Mdk036126@svn.freebsd.org>
From: Glen Barber 
Date: Fri, 27 Jun 2014 22:05:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267985 - in head/sys: amd64/acpica amd64/amd64 amd64/pci
 amd64/vmm arm/arm arm/freescale/imx arm/xscale/ixp425 cam cam/ata cam/ctl
 cam/scsi cddl/compat/opensolaris/kern cddl/contrib/op...
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 22:05:32 -0000

Author: gjb
Date: Fri Jun 27 22:05:21 2014
New Revision: 267985
URL: http://svnweb.freebsd.org/changeset/base/267985

Log:
  Revert r267961, r267973:
  
  These changes prevent sysctl(8) from returning proper output,
  such as:
  
   1) no output from sysctl(8)
   2) erroneously returning ENOMEM with tools like truss(1)
      or uname(1)
   truss: can not get etype: Cannot allocate memory

Modified:
  head/sys/amd64/acpica/acpi_machdep.c
  head/sys/amd64/amd64/amd64_mem.c
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/amd64/mp_watchdog.c
  head/sys/amd64/amd64/pmap.c
  head/sys/amd64/amd64/sys_machdep.c
  head/sys/amd64/amd64/trap.c
  head/sys/amd64/pci/pci_cfgreg.c
  head/sys/amd64/vmm/vmm.c
  head/sys/arm/arm/busdma_machdep-v6.c
  head/sys/arm/arm/busdma_machdep.c
  head/sys/arm/arm/dump_machdep.c
  head/sys/arm/arm/platform.c
  head/sys/arm/arm/pmap-v6.c
  head/sys/arm/freescale/imx/imx6_anatop.c
  head/sys/arm/xscale/ixp425/if_npe.c
  head/sys/arm/xscale/ixp425/ixp425_npe.c
  head/sys/arm/xscale/ixp425/ixp425_qmgr.c
  head/sys/cam/ata/ata_da.c
  head/sys/cam/ata/ata_pmp.c
  head/sys/cam/cam.c
  head/sys/cam/cam_xpt.c
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_backend_block.c
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/cam/scsi/scsi_cd.c
  head/sys/cam/scsi/scsi_da.c
  head/sys/cam/scsi/scsi_enc_safte.c
  head/sys/cam/scsi/scsi_sa.c
  head/sys/cam/scsi/scsi_xpt.c
  head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
  head/sys/cddl/dev/dtrace/dtrace_sysctl.c
  head/sys/compat/ia32/ia32_sysvec.c
  head/sys/compat/x86bios/x86bios.c
  head/sys/dev/aac/aac_pci.c
  head/sys/dev/acpica/Osd/OsdSchedule.c
  head/sys/dev/acpica/acpi_cpu.c
  head/sys/dev/acpica/acpi_ec.c
  head/sys/dev/amr/amr_pci.c
  head/sys/dev/ata/ata-all.c
  head/sys/dev/ath/ah_osdep.c
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_debug.c
  head/sys/dev/bce/if_bce.c
  head/sys/dev/bge/if_bge.c
  head/sys/dev/bwn/if_bwn.c
  head/sys/dev/bxe/bxe.c
  head/sys/dev/cardbus/cardbus.c
  head/sys/dev/cs/if_cs.c
  head/sys/dev/cxgb/cxgb_include.h
  head/sys/dev/cxgb/cxgb_main.c
  head/sys/dev/cxgb/cxgb_sge.c
  head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c
  head/sys/dev/cxgbe/iw_cxgbe/cm.c
  head/sys/dev/drm/drm_drv.c
  head/sys/dev/drm/drm_sysctl.c
  head/sys/dev/drm2/drm_drv.c
  head/sys/dev/drm2/drm_sysctl.c
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/fb/vesa.c
  head/sys/dev/firewire/fwohci.c
  head/sys/dev/firewire/if_fwe.c
  head/sys/dev/firewire/if_fwip.c
  head/sys/dev/firewire/sbp.c
  head/sys/dev/glxiic/glxiic.c
  head/sys/dev/hptmv/hptproc.c
  head/sys/dev/hwpmc/hwpmc_logging.c
  head/sys/dev/hwpmc/hwpmc_mod.c
  head/sys/dev/iscsi/icl.c
  head/sys/dev/iscsi/iscsi.c
  head/sys/dev/iscsi_initiator/iscsi.c
  head/sys/dev/ixgbe/ixgbe.c
  head/sys/dev/malo/if_malo.c
  head/sys/dev/malo/if_malo_pci.c
  head/sys/dev/mfi/mfi.c
  head/sys/dev/mfi/mfi_cam.c
  head/sys/dev/mfi/mfi_pci.c
  head/sys/dev/mfi/mfi_tbolt.c
  head/sys/dev/mwl/if_mwl.c
  head/sys/dev/nand/nand.c
  head/sys/dev/pccard/pccard.c
  head/sys/dev/pccbb/pccbb.c
  head/sys/dev/pccbb/pccbb_isa.c
  head/sys/dev/pci/pci.c
  head/sys/dev/pci/pci_pci.c
  head/sys/dev/pci/vga_pci.c
  head/sys/dev/puc/puc_pci.c
  head/sys/dev/rt/if_rt.c
  head/sys/dev/sdhci/sdhci.c
  head/sys/dev/sdhci/sdhci_pci.c
  head/sys/dev/si/si.c
  head/sys/dev/sio/sio.c
  head/sys/dev/sis/if_sis.c
  head/sys/dev/sound/pcm/channel.c
  head/sys/dev/sound/pcm/feeder_chain.c
  head/sys/dev/sound/pcm/feeder_eq.c
  head/sys/dev/sound/pcm/feeder_rate.c
  head/sys/dev/sound/pcm/mixer.c
  head/sys/dev/sound/pcm/sound.c
  head/sys/dev/sound/usb/uaudio.c
  head/sys/dev/syscons/syscons.c
  head/sys/dev/uart/uart_dev_ns8250.c
  head/sys/dev/usb/controller/dwc_otg.c
  head/sys/dev/usb/controller/ehci.c
  head/sys/dev/usb/controller/ohci.c
  head/sys/dev/usb/controller/uhci.c
  head/sys/dev/usb/controller/usb_controller.c
  head/sys/dev/usb/controller/xhci.c
  head/sys/dev/usb/input/ukbd.c
  head/sys/dev/usb/serial/uftdi.c
  head/sys/dev/usb/serial/usb_serial.c
  head/sys/dev/usb/storage/umass.c
  head/sys/dev/usb/usb_debug.c
  head/sys/dev/usb/usb_dev.c
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usb_generic.c
  head/sys/dev/usb/usb_hub.c
  head/sys/dev/usb/usb_process.c
  head/sys/dev/usb/wlan/if_uath.c
  head/sys/dev/usb/wlan/if_upgt.c
  head/sys/dev/usb/wlan/if_urtw.c
  head/sys/dev/vt/vt.h
  head/sys/dev/wpi/if_wpi.c
  head/sys/gdb/gdb_cons.c
  head/sys/geom/concat/g_concat.c
  head/sys/geom/eli/g_eli.c
  head/sys/geom/eli/g_eli_key_cache.c
  head/sys/geom/gate/g_gate.c
  head/sys/geom/geom_disk.c
  head/sys/geom/geom_kern.c
  head/sys/geom/journal/g_journal.c
  head/sys/geom/label/g_label.c
  head/sys/geom/label/g_label.h
  head/sys/geom/linux_lvm/g_linux_lvm.c
  head/sys/geom/mirror/g_mirror.c
  head/sys/geom/part/g_part.c
  head/sys/geom/part/g_part_ldm.c
  head/sys/geom/raid/g_raid.c
  head/sys/geom/raid/g_raid.h
  head/sys/geom/raid/tr_raid1.c
  head/sys/geom/raid/tr_raid1e.c
  head/sys/geom/raid3/g_raid3.c
  head/sys/geom/shsec/g_shsec.c
  head/sys/geom/stripe/g_stripe.c
  head/sys/geom/vinum/geom_vinum.c
  head/sys/geom/virstor/g_virstor.c
  head/sys/i386/acpica/acpi_machdep.c
  head/sys/i386/bios/apm.c
  head/sys/i386/i386/i686_mem.c
  head/sys/i386/i386/machdep.c
  head/sys/i386/i386/mp_watchdog.c
  head/sys/i386/i386/pmap.c
  head/sys/i386/i386/trap.c
  head/sys/i386/pci/pci_cfgreg.c
  head/sys/i386/pci/pci_pir.c
  head/sys/ia64/ia64/dump_machdep.c
  head/sys/ia64/ia64/pmap.c
  head/sys/kern/imgact_elf.c
  head/sys/kern/kern_clocksource.c
  head/sys/kern/kern_cons.c
  head/sys/kern/kern_cpu.c
  head/sys/kern/kern_exec.c
  head/sys/kern/kern_intr.c
  head/sys/kern/kern_ktr.c
  head/sys/kern/kern_ktrace.c
  head/sys/kern/kern_linker.c
  head/sys/kern/kern_malloc.c
  head/sys/kern/kern_mbuf.c
  head/sys/kern/kern_mib.c
  head/sys/kern/kern_ntptime.c
  head/sys/kern/kern_osd.c
  head/sys/kern/kern_pmc.c
  head/sys/kern/kern_priv.c
  head/sys/kern/kern_shutdown.c
  head/sys/kern/kern_sig.c
  head/sys/kern/kern_sysctl.c
  head/sys/kern/kern_tc.c
  head/sys/kern/kern_timeout.c
  head/sys/kern/subr_bus.c
  head/sys/kern/subr_kdb.c
  head/sys/kern/subr_msgbuf.c
  head/sys/kern/subr_param.c
  head/sys/kern/subr_prf.c
  head/sys/kern/subr_rman.c
  head/sys/kern/subr_smp.c
  head/sys/kern/subr_witness.c
  head/sys/kern/sys_pipe.c
  head/sys/kern/sysv_msg.c
  head/sys/kern/sysv_sem.c
  head/sys/kern/sysv_shm.c
  head/sys/kern/vfs_init.c
  head/sys/kern/vfs_lookup.c
  head/sys/mips/cavium/usb/octusb.c
  head/sys/mips/mips/dump_machdep.c
  head/sys/mips/rt305x/uart_dev_rt305x.c
  head/sys/net/ieee8023ad_lacp.c
  head/sys/net/if.c
  head/sys/net/if_bridge.c
  head/sys/net/if_lagg.c
  head/sys/net/if_stf.c
  head/sys/net/if_tap.c
  head/sys/net/if_tun.c
  head/sys/net/netisr.c
  head/sys/net/route.c
  head/sys/netgraph/ng_base.c
  head/sys/netgraph/ng_mppc.c
  head/sys/netinet/in_mcast.c
  head/sys/netinet/in_rss.c
  head/sys/netinet/tcp_subr.c
  head/sys/netinet6/in6_mcast.c
  head/sys/netinet6/mld6.c
  head/sys/netpfil/ipfw/ip_fw2.c
  head/sys/netpfil/pf/pf.c
  head/sys/pc98/cbus/sio.c
  head/sys/pc98/pc98/machdep.c
  head/sys/pc98/pc98/pc98_machdep.c
  head/sys/security/mac_biba/mac_biba.c
  head/sys/security/mac_bsdextended/mac_bsdextended.c
  head/sys/security/mac_ifoff/mac_ifoff.c
  head/sys/security/mac_lomac/mac_lomac.c
  head/sys/security/mac_mls/mac_mls.c
  head/sys/security/mac_portacl/mac_portacl.c
  head/sys/sparc64/pci/psycho.c
  head/sys/sys/malloc.h
  head/sys/sys/param.h
  head/sys/sys/sysctl.h
  head/sys/vm/memguard.c
  head/sys/vm/redzone.c
  head/sys/vm/uma_core.c
  head/sys/vm/vm_init.c
  head/sys/vm/vm_map.c
  head/sys/vm/vm_mmap.c
  head/sys/vm/vm_page.c
  head/sys/vm/vm_radix.c
  head/sys/vm/vm_zeroidle.c
  head/sys/x86/cpufreq/hwpstate.c
  head/sys/x86/iommu/intel_utils.c
  head/sys/x86/pci/pci_bus.c
  head/sys/x86/x86/dump_machdep.c
  head/sys/x86/x86/io_apic.c
  head/sys/x86/x86/mca.c
  head/sys/x86/x86/tsc.c

Modified: head/sys/amd64/acpica/acpi_machdep.c
==============================================================================
--- head/sys/amd64/acpica/acpi_machdep.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/amd64/acpica/acpi_machdep.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -45,8 +45,9 @@ __FBSDID("$FreeBSD$");
 #include 
 
 int acpi_resume_beep;
-SYSCTL_INT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RWTUN,
-    &acpi_resume_beep, 0, "Beep the PC speaker when resuming");
+TUNABLE_INT("debug.acpi.resume_beep", &acpi_resume_beep);
+SYSCTL_INT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RW, &acpi_resume_beep,
+    0, "Beep the PC speaker when resuming");
 
 int acpi_reset_video;
 TUNABLE_INT("hw.acpi.reset_video", &acpi_reset_video);

Modified: head/sys/amd64/amd64/amd64_mem.c
==============================================================================
--- head/sys/amd64/amd64/amd64_mem.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/amd64/amd64/amd64_mem.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -69,6 +69,7 @@ static char *mem_owner_bios = "BIOS";
 	(((curr) & ~MDF_ATTRMASK) | ((new) & MDF_ATTRMASK))
 
 static int mtrrs_disabled;
+TUNABLE_INT("machdep.disable_mtrrs", &mtrrs_disabled);
 SYSCTL_INT(_machdep, OID_AUTO, disable_mtrrs, CTLFLAG_RDTUN,
     &mtrrs_disabled, 0, "Disable amd64 MTRRs.");
 

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/amd64/amd64/machdep.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -675,7 +675,8 @@ cpu_halt(void)
 void (*cpu_idle_hook)(sbintime_t) = NULL;	/* ACPI idle hook. */
 static int	cpu_ident_amdc1e = 0;	/* AMD C1E supported. */
 static int	idle_mwait = 1;		/* Use MONITOR/MWAIT for short idle. */
-SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RWTUN, &idle_mwait,
+TUNABLE_INT("machdep.idle_mwait", &idle_mwait);
+SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RW, &idle_mwait,
     0, "Use MONITOR/MWAIT for short idle");
 
 #define	STATE_RUNNING	0x0

Modified: head/sys/amd64/amd64/mp_watchdog.c
==============================================================================
--- head/sys/amd64/amd64/mp_watchdog.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/amd64/amd64/mp_watchdog.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -68,7 +68,8 @@ static int	watchdog_dontfire = 1;
 static int	watchdog_timer = -1;
 static int	watchdog_nmi = 1;
 
-SYSCTL_INT(_debug, OID_AUTO, watchdog_nmi, CTLFLAG_RWTUN, &watchdog_nmi, 0,
+TUNABLE_INT("debug.watchdog", &watchdog_cpu);
+SYSCTL_INT(_debug, OID_AUTO, watchdog_nmi, CTLFLAG_RW, &watchdog_nmi, 0,
     "IPI the boot processor with an NMI to enter the debugger");
 
 static struct callout	watchdog_callout;

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/amd64/amd64/pmap.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -332,8 +332,8 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pat_works
     "Is page attribute table fully functional?");
 
 static int pg_ps_enabled = 1;
-SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH,
-    &pg_ps_enabled, 0, "Are large page mappings enabled?");
+SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN, &pg_ps_enabled, 0,
+    "Are large page mappings enabled?");
 
 #define	PAT_INDEX_SIZE	8
 static int pat_index[PAT_INDEX_SIZE];	/* cache mode to PAT index conversion */
@@ -368,8 +368,8 @@ static int pmap_flags = PMAP_PDE_SUPERPA
 static struct unrhdr pcid_unr;
 static struct mtx pcid_mtx;
 int pmap_pcid_enabled = 0;
-SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH,
-    &pmap_pcid_enabled, 0, "Is TLB Context ID enabled ?");
+SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN, &pmap_pcid_enabled,
+    0, "Is TLB Context ID enabled ?");
 int invpcid_works = 0;
 SYSCTL_INT(_vm_pmap, OID_AUTO, invpcid_works, CTLFLAG_RD, &invpcid_works, 0,
     "Is the invpcid instruction available ?");

Modified: head/sys/amd64/amd64/sys_machdep.c
==============================================================================
--- head/sys/amd64/amd64/sys_machdep.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/amd64/amd64/sys_machdep.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -73,6 +73,7 @@ static void
 max_ldt_segment_init(void *arg __unused)
 {
 
+	TUNABLE_INT_FETCH("machdep.max_ldt_segment", &max_ldt_segment);
 	if (max_ldt_segment <= 0)
 		max_ldt_segment = 1;
 	if (max_ldt_segment > MAX_LD)

Modified: head/sys/amd64/amd64/trap.c
==============================================================================
--- head/sys/amd64/amd64/trap.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/amd64/amd64/trap.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -143,18 +143,20 @@ static char *trap_msg[] = {
 
 #ifdef KDB
 static int kdb_on_nmi = 1;
-SYSCTL_INT(_machdep, OID_AUTO, kdb_on_nmi, CTLFLAG_RWTUN,
+SYSCTL_INT(_machdep, OID_AUTO, kdb_on_nmi, CTLFLAG_RW,
 	&kdb_on_nmi, 0, "Go to KDB on NMI");
+TUNABLE_INT("machdep.kdb_on_nmi", &kdb_on_nmi);
 #endif
 static int panic_on_nmi = 1;
-SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RWTUN,
+SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RW,
 	&panic_on_nmi, 0, "Panic on NMI");
+TUNABLE_INT("machdep.panic_on_nmi", &panic_on_nmi);
 static int prot_fault_translation;
-SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RWTUN,
+SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RW,
     &prot_fault_translation, 0,
     "Select signal to deliver on protection fault");
 static int uprintf_signal;
-SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RWTUN,
+SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RW,
     &uprintf_signal, 0,
     "Print debugging information on trap signal to ctty");
 

Modified: head/sys/amd64/pci/pci_cfgreg.c
==============================================================================
--- head/sys/amd64/pci/pci_cfgreg.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/amd64/pci/pci_cfgreg.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -65,6 +65,7 @@ static int pcie_minbus, pcie_maxbus;
 static uint32_t pcie_badslots;
 static struct mtx pcicfg_mtx;
 static int mcfg_enable = 1;
+TUNABLE_INT("hw.pci.mcfg", &mcfg_enable);
 SYSCTL_INT(_hw_pci, OID_AUTO, mcfg, CTLFLAG_RDTUN, &mcfg_enable, 0,
     "Enable support for PCI-e memory mapped config access");
 

Modified: head/sys/amd64/vmm/vmm.c
==============================================================================
--- head/sys/amd64/vmm/vmm.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/amd64/vmm/vmm.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -199,6 +199,7 @@ SYSCTL_NODE(_hw, OID_AUTO, vmm, CTLFLAG_
  * interrupts disabled.
  */
 static int halt_detection_enabled = 1;
+TUNABLE_INT("hw.vmm.halt_detection", &halt_detection_enabled);
 SYSCTL_INT(_hw_vmm, OID_AUTO, halt_detection, CTLFLAG_RDTUN,
     &halt_detection_enabled, 0,
     "Halt VM if all vcpus execute HLT with interrupts disabled");

Modified: head/sys/arm/arm/busdma_machdep-v6.c
==============================================================================
--- head/sys/arm/arm/busdma_machdep-v6.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/arm/arm/busdma_machdep-v6.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -224,10 +224,10 @@ busdma_init(void *dummy)
 /*
  * This init historically used SI_SUB_VM, but now the init code requires
  * malloc(9) using M_DEVBUF memory, which is set up later than SI_SUB_VM, by
- * SI_SUB_KMEM and SI_ORDER_THIRD, so we'll go right after that by using
- * SI_SUB_KMEM and SI_ORDER_FOURTH.
+ * SI_SUB_KMEM and SI_ORDER_SECOND, so we'll go right after that by using
+ * SI_SUB_KMEM and SI_ORDER_THIRD.
  */
-SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_FOURTH, busdma_init, NULL);
+SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_THIRD, busdma_init, NULL);
 
 static __inline int
 _bus_dma_can_bounce(vm_offset_t lowaddr, vm_offset_t highaddr)

Modified: head/sys/arm/arm/busdma_machdep.c
==============================================================================
--- head/sys/arm/arm/busdma_machdep.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/arm/arm/busdma_machdep.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -276,10 +276,10 @@ busdma_init(void *dummy)
 /*
  * This init historically used SI_SUB_VM, but now the init code requires
  * malloc(9) using M_DEVBUF memory, which is set up later than SI_SUB_VM, by
- * SI_SUB_KMEM and SI_ORDER_THIRD, so we'll go right after that by using
- * SI_SUB_KMEM and SI_ORDER_FOURTH.
+ * SI_SUB_KMEM and SI_ORDER_SECOND, so we'll go right after that by using
+ * SI_SUB_KMEM and SI_ORDER_THIRD.
  */
-SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_FOURTH, busdma_init, NULL);
+SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_THIRD, busdma_init, NULL);
 
 /*
  * End block of code useful to transplant to other implementations.

Modified: head/sys/arm/arm/dump_machdep.c
==============================================================================
--- head/sys/arm/arm/dump_machdep.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/arm/arm/dump_machdep.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -50,7 +50,8 @@ __FBSDID("$FreeBSD$");
 CTASSERT(sizeof(struct kerneldumpheader) == 512);
 
 int do_minidump = 1;
-SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RWTUN, &do_minidump, 0,
+TUNABLE_INT("debug.minidump", &do_minidump);
+SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RW, &do_minidump, 0,
     "Enable mini crash dumps");
 
 /*

Modified: head/sys/arm/arm/platform.c
==============================================================================
--- head/sys/arm/arm/platform.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/arm/arm/platform.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -65,8 +65,8 @@ static platform_t	plat_obj;
 static struct kobj_ops	plat_kernel_kops;
 static struct platform_kobj	plat_kernel_obj;
 
-static char plat_name[64];
-SYSCTL_STRING(_hw, OID_AUTO, platform, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, plat_name, 0,
+static char plat_name[64] = "";
+SYSCTL_STRING(_hw, OID_AUTO, platform, CTLFLAG_RDTUN, plat_name, 0,
     "Platform currently in use");
 
 /*

Modified: head/sys/arm/arm/pmap-v6.c
==============================================================================
--- head/sys/arm/arm/pmap-v6.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/arm/arm/pmap-v6.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -465,7 +465,7 @@ static SYSCTL_NODE(_vm, OID_AUTO, pmap, 
 
 /* Superpages utilization enabled = 1 / disabled = 0 */
 static int sp_enabled = 1;
-SYSCTL_INT(_vm_pmap, OID_AUTO, sp_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &sp_enabled, 0,
+SYSCTL_INT(_vm_pmap, OID_AUTO, sp_enabled, CTLFLAG_RDTUN, &sp_enabled, 0,
     "Are large page mappings enabled?");
 
 SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_count, CTLFLAG_RD, &pv_entry_count, 0,

Modified: head/sys/arm/freescale/imx/imx6_anatop.c
==============================================================================
--- head/sys/arm/freescale/imx/imx6_anatop.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/arm/freescale/imx/imx6_anatop.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -375,12 +375,12 @@ cpufreq_initialize(struct imx6_anatop_so
 	    "CPU frequency");
 
 	SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), 
-	    OID_AUTO, "cpu_minmhz", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH,
-	    sc, 0, cpufreq_sysctl_minmhz, "IU", "Minimum CPU frequency");
+	    OID_AUTO, "cpu_minmhz", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0,
+	    cpufreq_sysctl_minmhz, "IU", "Minimum CPU frequency");
 
 	SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
-	    OID_AUTO, "cpu_maxmhz", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH,
-	    sc, 0, cpufreq_sysctl_maxmhz, "IU", "Maximum CPU frequency");
+	    OID_AUTO, "cpu_maxmhz", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0,
+	    cpufreq_sysctl_maxmhz, "IU", "Maximum CPU frequency");
 
 	SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
 	    OID_AUTO, "cpu_maxmhz_hw", CTLFLAG_RD, &sc->cpu_maxmhz_hw, 0, 
@@ -413,6 +413,9 @@ cpufreq_initialize(struct imx6_anatop_so
 	sc->cpu_maxmhz_hw = imx6_ocotp_mhz_tab[cfg3speed];
 	sc->cpu_maxmhz = sc->cpu_maxmhz_hw;
 
+	TUNABLE_INT_FETCH("hw.imx6.cpu_overclock_enable",
+	    &sc->cpu_overclock_enable);
+
 	TUNABLE_INT_FETCH("hw.imx6.cpu_minmhz", &sc->cpu_minmhz);
 	op = cpufreq_nearest_oppt(sc, sc->cpu_minmhz);
 	sc->cpu_minmhz = op->mhz;

Modified: head/sys/arm/xscale/ixp425/if_npe.c
==============================================================================
--- head/sys/arm/xscale/ixp425/if_npe.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/arm/xscale/ixp425/if_npe.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -255,8 +255,9 @@ static SYSCTL_NODE(_hw, OID_AUTO, npe, C
     "IXP4XX NPE driver parameters");
 
 static int npe_debug = 0;
-SYSCTL_INT(_hw_npe, OID_AUTO, debug, CTLFLAG_RWTUN, &npe_debug,
+SYSCTL_INT(_hw_npe, OID_AUTO, debug, CTLFLAG_RW, &npe_debug,
 	   0, "IXP4XX NPE network interface debug msgs");
+TUNABLE_INT("hw.npe.debug", &npe_debug);
 #define	DPRINTF(sc, fmt, ...) do {					\
 	if (sc->sc_debug) device_printf(sc->sc_dev, fmt, __VA_ARGS__);	\
 } while (0)
@@ -264,15 +265,18 @@ SYSCTL_INT(_hw_npe, OID_AUTO, debug, CTL
 	if (sc->sc_debug >= n) device_printf(sc->sc_dev, fmt, __VA_ARGS__);\
 } while (0)
 static int npe_tickinterval = 3;		/* npe_tick frequency (secs) */
-SYSCTL_INT(_hw_npe, OID_AUTO, tickinterval, CTLFLAG_RDTUN, &npe_tickinterval,
+SYSCTL_INT(_hw_npe, OID_AUTO, tickinterval, CTLFLAG_RD, &npe_tickinterval,
 	    0, "periodic work interval (secs)");
+TUNABLE_INT("hw.npe.tickinterval", &npe_tickinterval);
 
 static	int npe_rxbuf = 64;		/* # rx buffers to allocate */
-SYSCTL_INT(_hw_npe, OID_AUTO, rxbuf, CTLFLAG_RDTUN, &npe_rxbuf,
+SYSCTL_INT(_hw_npe, OID_AUTO, rxbuf, CTLFLAG_RD, &npe_rxbuf,
 	    0, "rx buffers allocated");
+TUNABLE_INT("hw.npe.rxbuf", &npe_rxbuf);
 static	int npe_txbuf = 128;		/* # tx buffers to allocate */
-SYSCTL_INT(_hw_npe, OID_AUTO, txbuf, CTLFLAG_RDTUN, &npe_txbuf,
+SYSCTL_INT(_hw_npe, OID_AUTO, txbuf, CTLFLAG_RD, &npe_txbuf,
 	    0, "tx buffers allocated");
+TUNABLE_INT("hw.npe.txbuf", &npe_txbuf);
 
 static int
 unit2npeid(int unit)

Modified: head/sys/arm/xscale/ixp425/ixp425_npe.c
==============================================================================
--- head/sys/arm/xscale/ixp425/ixp425_npe.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/arm/xscale/ixp425/ixp425_npe.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -181,8 +181,9 @@ typedef struct {
 } IxNpeDlNpeMgrStateInfoBlock;
 
 static int npe_debug = 0;
-SYSCTL_INT(_debug, OID_AUTO, ixp425npe, CTLFLAG_RWTUN, &npe_debug,
+SYSCTL_INT(_debug, OID_AUTO, ixp425npe, CTLFLAG_RW, &npe_debug,
 	   0, "IXP4XX NPE debug msgs");
+TUNABLE_INT("debug.ixp425npe", &npe_debug);
 #define	DPRINTF(dev, fmt, ...) do {					\
 	if (npe_debug) device_printf(dev, fmt, __VA_ARGS__);		\
 } while (0)

Modified: head/sys/arm/xscale/ixp425/ixp425_qmgr.c
==============================================================================
--- head/sys/arm/xscale/ixp425/ixp425_qmgr.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/arm/xscale/ixp425/ixp425_qmgr.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -159,9 +159,10 @@ struct ixpqmgr_softc {
 	uint32_t		aqmFreeSramAddress;	/* SRAM free space */
 };
 
-static int qmgr_debug;
-SYSCTL_INT(_debug, OID_AUTO, qmgr, CTLFLAG_RWTUN, &qmgr_debug,
+static int qmgr_debug = 0;
+SYSCTL_INT(_debug, OID_AUTO, qmgr, CTLFLAG_RW, &qmgr_debug,
 	   0, "IXP4XX Q-Manager debug msgs");
+TUNABLE_INT("debug.qmgr", &qmgr_debug);
 #define	DPRINTF(dev, fmt, ...) do {					\
 	if (qmgr_debug) printf(fmt, __VA_ARGS__);			\
 } while (0)

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cam/ata/ata_da.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -546,22 +546,30 @@ static int ada_write_cache = ADA_DEFAULT
 
 static SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0,
             "CAM Direct Access Disk driver");
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, legacy_aliases, CTLFLAG_RWTUN,
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, legacy_aliases, CTLFLAG_RW,
            &ada_legacy_aliases, 0, "Create legacy-like device aliases");
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, retry_count, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.cam.ada.legacy_aliases", &ada_legacy_aliases);
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, retry_count, CTLFLAG_RW,
            &ada_retry_count, 0, "Normal I/O retry count");
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, default_timeout, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.cam.ada.retry_count", &ada_retry_count);
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, default_timeout, CTLFLAG_RW,
            &ada_default_timeout, 0, "Normal I/O timeout (in seconds)");
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, send_ordered, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.cam.ada.default_timeout", &ada_default_timeout);
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, send_ordered, CTLFLAG_RW,
            &ada_send_ordered, 0, "Send Ordered Tags");
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_shutdown, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.cam.ada.send_ordered", &ada_send_ordered);
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_shutdown, CTLFLAG_RW,
            &ada_spindown_shutdown, 0, "Spin down upon shutdown");
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_suspend, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.cam.ada.spindown_shutdown", &ada_spindown_shutdown);
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_suspend, CTLFLAG_RW,
            &ada_spindown_suspend, 0, "Spin down upon suspend");
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, read_ahead, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.cam.ada.spindown_suspend", &ada_spindown_suspend);
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, read_ahead, CTLFLAG_RW,
            &ada_read_ahead, 0, "Enable disk read-ahead");
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, write_cache, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.cam.ada.read_ahead", &ada_read_ahead);
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, write_cache, CTLFLAG_RW,
            &ada_write_cache, 0, "Enable disk write cache");
+TUNABLE_INT("kern.cam.ada.write_cache", &ada_write_cache);
 
 /*
  * ADA_ORDEREDTAG_INTERVAL determines how often, relative

Modified: head/sys/cam/ata/ata_pmp.c
==============================================================================
--- head/sys/cam/ata/ata_pmp.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cam/ata/ata_pmp.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -139,12 +139,15 @@ static int pmp_hide_special = PMP_DEFAUL
 
 static SYSCTL_NODE(_kern_cam, OID_AUTO, pmp, CTLFLAG_RD, 0,
             "CAM Direct Access Disk driver");
-SYSCTL_INT(_kern_cam_pmp, OID_AUTO, retry_count, CTLFLAG_RWTUN,
+SYSCTL_INT(_kern_cam_pmp, OID_AUTO, retry_count, CTLFLAG_RW,
            &pmp_retry_count, 0, "Normal I/O retry count");
-SYSCTL_INT(_kern_cam_pmp, OID_AUTO, default_timeout, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.cam.pmp.retry_count", &pmp_retry_count);
+SYSCTL_INT(_kern_cam_pmp, OID_AUTO, default_timeout, CTLFLAG_RW,
            &pmp_default_timeout, 0, "Normal I/O timeout (in seconds)");
-SYSCTL_INT(_kern_cam_pmp, OID_AUTO, hide_special, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.cam.pmp.default_timeout", &pmp_default_timeout);
+SYSCTL_INT(_kern_cam_pmp, OID_AUTO, hide_special, CTLFLAG_RW,
            &pmp_hide_special, 0, "Hide extra ports");
+TUNABLE_INT("kern.cam.pmp.hide_special", &pmp_hide_special);
 
 static struct periph_driver pmpdriver =
 {

Modified: head/sys/cam/cam.c
==============================================================================
--- head/sys/cam/cam.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cam/cam.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -116,6 +116,7 @@ SYSCTL_NODE(_kern, OID_AUTO, cam, CTLFLA
 #endif
 
 int cam_sort_io_queues = CAM_DEFAULT_SORT_IO_QUEUES;
+TUNABLE_INT("kern.cam.sort_io_queues", &cam_sort_io_queues);
 SYSCTL_INT(_kern_cam, OID_AUTO, sort_io_queues, CTLFLAG_RWTUN,
     &cam_sort_io_queues, 0, "Sort IO queues to try and optimise disk access patterns");
 #endif

Modified: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cam/cam_xpt.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -149,6 +149,7 @@ typedef int	xpt_pdrvfunc_t (struct perip
 /* Transport layer configuration information */
 static struct xpt_softc xsoftc;
 
+TUNABLE_INT("kern.cam.boot_delay", &xsoftc.boot_delay);
 SYSCTL_INT(_kern_cam, OID_AUTO, boot_delay, CTLFLAG_RDTUN,
            &xsoftc.boot_delay, 0, "Bus registration wait time");
 
@@ -162,6 +163,7 @@ static struct cam_doneq cam_doneqs[MAXCP
 static int cam_num_doneqs;
 static struct proc *cam_proc;
 
+TUNABLE_INT("kern.cam.num_doneqs", &cam_num_doneqs);
 SYSCTL_INT(_kern_cam, OID_AUTO, num_doneqs, CTLFLAG_RDTUN,
            &cam_num_doneqs, 0, "Number of completion queues/threads");
 
@@ -195,10 +197,12 @@ static struct cdevsw xpt_cdevsw = {
 /* Storage for debugging datastructures */
 struct cam_path *cam_dpath;
 u_int32_t cam_dflags = CAM_DEBUG_FLAGS;
-SYSCTL_UINT(_kern_cam, OID_AUTO, dflags, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.cam.dflags", &cam_dflags);
+SYSCTL_UINT(_kern_cam, OID_AUTO, dflags, CTLFLAG_RW,
 	&cam_dflags, 0, "Enabled debug flags");
 u_int32_t cam_debug_delay = CAM_DEBUG_DELAY;
-SYSCTL_UINT(_kern_cam, OID_AUTO, debug_delay, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.cam.debug_delay", &cam_debug_delay);
+SYSCTL_UINT(_kern_cam, OID_AUTO, debug_delay, CTLFLAG_RW,
 	&cam_debug_delay, 0, "Delay in us after each debug message");
 
 /* Our boot-time initialization hook */

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cam/ctl/ctl.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -308,9 +308,11 @@ static int     index_to_aps_page;
 
 SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer");
 static int worker_threads = -1;
+TUNABLE_INT("kern.cam.ctl.worker_threads", &worker_threads);
 SYSCTL_INT(_kern_cam_ctl, OID_AUTO, worker_threads, CTLFLAG_RDTUN,
     &worker_threads, 1, "Number of worker threads");
 static int verbose = 0;
+TUNABLE_INT("kern.cam.ctl.verbose", &verbose);
 SYSCTL_INT(_kern_cam_ctl, OID_AUTO, verbose, CTLFLAG_RWTUN,
     &verbose, 0, "Show SCSI errors returned to initiator");
 

Modified: head/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_block.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cam/ctl/ctl_backend_block.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -220,9 +220,10 @@ struct ctl_be_block_io {
 };
 
 static int cbb_num_threads = 14;
+TUNABLE_INT("kern.cam.ctl.block.num_threads", &cbb_num_threads);
 SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, block, CTLFLAG_RD, 0,
 	    "CAM Target Layer Block Backend");
-SYSCTL_INT(_kern_cam_ctl_block, OID_AUTO, num_threads, CTLFLAG_RWTUN,
+SYSCTL_INT(_kern_cam_ctl_block, OID_AUTO, num_threads, CTLFLAG_RW,
            &cbb_num_threads, 0, "Number of threads per backing file");
 
 static struct ctl_be_block_io *ctl_alloc_beio(struct ctl_be_block_softc *softc);

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -85,15 +85,19 @@ static uma_zone_t cfiscsi_data_wait_zone
 SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, iscsi, CTLFLAG_RD, 0,
     "CAM Target Layer iSCSI Frontend");
 static int debug = 3;
+TUNABLE_INT("kern.cam.ctl.iscsi.debug", &debug);
 SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, debug, CTLFLAG_RWTUN,
     &debug, 1, "Enable debug messages");
 static int ping_timeout = 5;
+TUNABLE_INT("kern.cam.ctl.iscsi.ping_timeout", &ping_timeout);
 SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, ping_timeout, CTLFLAG_RWTUN,
     &ping_timeout, 5, "Interval between ping (NOP-Out) requests, in seconds");
 static int login_timeout = 60;
+TUNABLE_INT("kern.cam.ctl.iscsi.login_timeout", &login_timeout);
 SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, login_timeout, CTLFLAG_RWTUN,
     &login_timeout, 60, "Time to wait for ctld(8) to finish Login Phase, in seconds");
 static int maxcmdsn_delta = 256;
+TUNABLE_INT("kern.cam.ctl.iscsi.maxcmdsn_delta", &maxcmdsn_delta);
 SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, maxcmdsn_delta, CTLFLAG_RWTUN,
     &maxcmdsn_delta, 256, "Number of commands the initiator can send "
     "without confirmation");

Modified: head/sys/cam/scsi/scsi_cd.c
==============================================================================
--- head/sys/cam/scsi/scsi_cd.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cam/scsi/scsi_cd.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -277,12 +277,15 @@ static int cd_retry_count = CD_DEFAULT_R
 static int cd_timeout = CD_DEFAULT_TIMEOUT;
 
 static SYSCTL_NODE(_kern_cam, OID_AUTO, cd, CTLFLAG_RD, 0, "CAM CDROM driver");
-SYSCTL_INT(_kern_cam_cd, OID_AUTO, poll_period, CTLFLAG_RWTUN,
+SYSCTL_INT(_kern_cam_cd, OID_AUTO, poll_period, CTLFLAG_RW,
            &cd_poll_period, 0, "Media polling period in seconds");
-SYSCTL_INT(_kern_cam_cd, OID_AUTO, retry_count, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.cam.cd.poll_period", &cd_poll_period);
+SYSCTL_INT(_kern_cam_cd, OID_AUTO, retry_count, CTLFLAG_RW,
            &cd_retry_count, 0, "Normal I/O retry count");
-SYSCTL_INT(_kern_cam_cd, OID_AUTO, timeout, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.cam.cd.retry_count", &cd_retry_count);
+SYSCTL_INT(_kern_cam_cd, OID_AUTO, timeout, CTLFLAG_RW,
 	   &cd_timeout, 0, "Timeout, in us, for read operations");
+TUNABLE_INT("kern.cam.cd.timeout", &cd_timeout);
 
 static MALLOC_DEFINE(M_SCSICD, "scsi_cd", "scsi_cd buffers");
 

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cam/scsi/scsi_da.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -1188,14 +1188,18 @@ static int da_send_ordered = DA_DEFAULT_
 
 static SYSCTL_NODE(_kern_cam, OID_AUTO, da, CTLFLAG_RD, 0,
             "CAM Direct Access Disk driver");
-SYSCTL_INT(_kern_cam_da, OID_AUTO, poll_period, CTLFLAG_RWTUN,
+SYSCTL_INT(_kern_cam_da, OID_AUTO, poll_period, CTLFLAG_RW,
            &da_poll_period, 0, "Media polling period in seconds");
-SYSCTL_INT(_kern_cam_da, OID_AUTO, retry_count, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.cam.da.poll_period", &da_poll_period);
+SYSCTL_INT(_kern_cam_da, OID_AUTO, retry_count, CTLFLAG_RW,
            &da_retry_count, 0, "Normal I/O retry count");
-SYSCTL_INT(_kern_cam_da, OID_AUTO, default_timeout, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.cam.da.retry_count", &da_retry_count);
+SYSCTL_INT(_kern_cam_da, OID_AUTO, default_timeout, CTLFLAG_RW,
            &da_default_timeout, 0, "Normal I/O timeout (in seconds)");
-SYSCTL_INT(_kern_cam_da, OID_AUTO, send_ordered, CTLFLAG_RWTUN,
+TUNABLE_INT("kern.cam.da.default_timeout", &da_default_timeout);
+SYSCTL_INT(_kern_cam_da, OID_AUTO, send_ordered, CTLFLAG_RW,
            &da_send_ordered, 0, "Send Ordered Tags");
+TUNABLE_INT("kern.cam.da.send_ordered", &da_send_ordered);
 
 /*
  * DA_ORDEREDTAG_INTERVAL determines how often, relative

Modified: head/sys/cam/scsi/scsi_enc_safte.c
==============================================================================
--- head/sys/cam/scsi/scsi_enc_safte.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cam/scsi/scsi_enc_safte.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -226,8 +226,9 @@ static char *safte_2little = "Too Little
 
 int emulate_array_devices = 1;
 SYSCTL_DECL(_kern_cam_enc);
-SYSCTL_INT(_kern_cam_enc, OID_AUTO, emulate_array_devices, CTLFLAG_RWTUN,
+SYSCTL_INT(_kern_cam_enc, OID_AUTO, emulate_array_devices, CTLFLAG_RW,
            &emulate_array_devices, 0, "Emulate Array Devices for SAF-TE");
+TUNABLE_INT("kern.cam.enc.emulate_array_devices", &emulate_array_devices);
 
 static int
 safte_fill_read_buf_io(enc_softc_t *enc, struct enc_fsm_state *state,

Modified: head/sys/cam/scsi/scsi_sa.c
==============================================================================
--- head/sys/cam/scsi/scsi_sa.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cam/scsi/scsi_sa.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -445,10 +445,9 @@ static int sa_allow_io_split = SA_DEFAUL
  * is bad behavior, because it hides the true tape block size from the
  * application.
  */
+TUNABLE_INT("kern.cam.sa.allow_io_split", &sa_allow_io_split);
 static SYSCTL_NODE(_kern_cam, OID_AUTO, sa, CTLFLAG_RD, 0,
 		  "CAM Sequential Access Tape Driver");
-SYSCTL_INT(_kern_cam_sa, OID_AUTO, allow_io_split, CTLFLAG_RDTUN,
-    &sa_allow_io_split, 0, "Default I/O split value");
 
 static struct periph_driver sadriver =
 {
@@ -1495,7 +1494,7 @@ sasysctlinit(void *context, int pending)
 		goto bailout;
 
 	SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree),
-	    OID_AUTO, "allow_io_split", CTLTYPE_INT | CTLFLAG_RDTUN | CTLFLAG_NOFETCH, 
+	    OID_AUTO, "allow_io_split", CTLTYPE_INT | CTLFLAG_RDTUN, 
 	    &softc->allow_io_split, 0, "Allow Splitting I/O");
 	SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree),
 	    OID_AUTO, "maxio", CTLTYPE_INT | CTLFLAG_RD, 

Modified: head/sys/cam/scsi/scsi_xpt.c
==============================================================================
--- head/sys/cam/scsi/scsi_xpt.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cam/scsi/scsi_xpt.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -78,8 +78,9 @@ struct scsi_quirk_entry {
 #define SCSI_QUIRK(dev)	((struct scsi_quirk_entry *)((dev)->quirk))
 
 static int cam_srch_hi = 0;
+TUNABLE_INT("kern.cam.cam_srch_hi", &cam_srch_hi);
 static int sysctl_cam_search_luns(SYSCTL_HANDLER_ARGS);
-SYSCTL_PROC(_kern_cam, OID_AUTO, cam_srch_hi, CTLTYPE_INT | CTLFLAG_RWTUN, 0, 0,
+SYSCTL_PROC(_kern_cam, OID_AUTO, cam_srch_hi, CTLTYPE_INT|CTLFLAG_RW, 0, 0,
     sysctl_cam_search_luns, "I",
     "allow search above LUN 7 for SCSI3 and greater devices");
 

Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c
==============================================================================
--- head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$");
 
 static MALLOC_DEFINE(M_KSTAT, "kstat_data", "Kernel statistics");
 
-SYSCTL_ROOT_NODE(OID_AUTO, kstat, CTLFLAG_RW, 0, "Kernel statistics");
+SYSCTL_NODE(, OID_AUTO, kstat, CTLFLAG_RW, 0, "Kernel statistics");
 
 kstat_t *
 kstat_create(char *module, int instance, char *name, char *class, uchar_t type,

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -204,6 +204,8 @@ int zfs_arc_shrink_shift = 0;
 int zfs_arc_p_min_shift = 0;
 int zfs_disable_dup_eviction = 0;
 
+TUNABLE_QUAD("vfs.zfs.arc_max", &zfs_arc_max);
+TUNABLE_QUAD("vfs.zfs.arc_min", &zfs_arc_min);
 TUNABLE_QUAD("vfs.zfs.arc_meta_limit", &zfs_arc_meta_limit);
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_max, CTLFLAG_RDTUN, &zfs_arc_max, 0,

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -44,7 +44,8 @@ int zfs_dedup_prefetch = 1;
 
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_NODE(_vfs_zfs, OID_AUTO, dedup, CTLFLAG_RW, 0, "ZFS DEDUP");
-SYSCTL_INT(_vfs_zfs_dedup, OID_AUTO, prefetch, CTLFLAG_RWTUN, &zfs_dedup_prefetch,
+TUNABLE_INT("vfs.zfs.dedup.prefetch", &zfs_dedup_prefetch);
+SYSCTL_INT(_vfs_zfs_dedup, OID_AUTO, prefetch, CTLFLAG_RW, &zfs_dedup_prefetch,
     0, "Enable/disable prefetching of dedup-ed blocks which are going to be freed");
 
 static const ddt_ops_t *ddt_ops[DDT_TYPES] = {

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -54,6 +54,7 @@
  */
 int zfs_nopwrite_enabled = 1;
 SYSCTL_DECL(_vfs_zfs);
+TUNABLE_INT("vfs.zfs.nopwrite_enabled", &zfs_nopwrite_enabled);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, nopwrite_enabled, CTLFLAG_RDTUN,
     &zfs_nopwrite_enabled, 0, "Enable nopwrite feature");
 
@@ -1625,7 +1626,8 @@ dmu_object_set_compress(objset_t *os, ui
 }
 
 int zfs_mdcomp_disable = 0;
-SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_disable, CTLFLAG_RWTUN,
+TUNABLE_INT("vfs.zfs.mdcomp_disable", &zfs_mdcomp_disable);
+SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_disable, CTLFLAG_RW,
     &zfs_mdcomp_disable, 0, "Disable metadata compression");
 
 /*

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -55,12 +55,16 @@ SYSCTL_DECL(_vfs_zfs);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_disable, CTLFLAG_RW,
     &zfs_prefetch_disable, 0, "Disable prefetch");
 SYSCTL_NODE(_vfs_zfs, OID_AUTO, zfetch, CTLFLAG_RW, 0, "ZFS ZFETCH");
-SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RWTUN,
+TUNABLE_INT("vfs.zfs.zfetch.max_streams", &zfetch_max_streams);
+SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RW,
     &zfetch_max_streams, 0, "Max # of streams per zfetch");
+TUNABLE_INT("vfs.zfs.zfetch.min_sec_reap", &zfetch_min_sec_reap);
 SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, min_sec_reap, CTLFLAG_RDTUN,
     &zfetch_min_sec_reap, 0, "Min time before stream reclaim");
+TUNABLE_INT("vfs.zfs.zfetch.block_cap", &zfetch_block_cap);
 SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, block_cap, CTLFLAG_RDTUN,
     &zfetch_block_cap, 0, "Max number of blocks to fetch at a time");
+TUNABLE_QUAD("vfs.zfs.zfetch.array_rd_sz", &zfetch_array_rd_sz);
 SYSCTL_UQUAD(_vfs_zfs_zfetch, OID_AUTO, array_rd_sz, CTLFLAG_RDTUN,
     &zfetch_array_rd_sz, 0,
     "Number of bytes in a array_read at which we stop prefetching");

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -141,19 +141,23 @@ extern int zfs_vdev_async_write_active_m
 
 SYSCTL_DECL(_vfs_zfs);
 
+TUNABLE_QUAD("vfs.zfs.dirty_data_max", &zfs_dirty_data_max);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_max, CTLFLAG_RWTUN,
     &zfs_dirty_data_max, 0,
     "The maximum amount of dirty data in bytes after which new writes are "
     "halted until space becomes available");
 
+TUNABLE_QUAD("vfs.zfs.dirty_data_max_max", &zfs_dirty_data_max_max);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_max_max, CTLFLAG_RDTUN,
     &zfs_dirty_data_max_max, 0,
     "The absolute cap on dirty_data_max when auto calculating");
 
+TUNABLE_INT("vfs.zfs.dirty_data_max_percent", &zfs_dirty_data_max_percent);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, dirty_data_max_percent, CTLFLAG_RDTUN,
     &zfs_dirty_data_max_percent, 0,
     "The percent of physical memory used to auto calculate dirty_data_max");
 
+TUNABLE_QUAD("vfs.zfs.dirty_data_sync", &zfs_dirty_data_sync);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_sync, CTLFLAG_RWTUN,
     &zfs_dirty_data_sync, 0,
     "Force a txg if the number of dirty buffer bytes exceed this value");

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -71,23 +71,32 @@ boolean_t zfs_no_scrub_io = B_FALSE; /* 
 boolean_t zfs_no_scrub_prefetch = B_FALSE; /* set to disable srub prefetching */
 
 SYSCTL_DECL(_vfs_zfs);
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, top_maxinflight, CTLFLAG_RWTUN,
+TUNABLE_INT("vfs.zfs.top_maxinflight", &zfs_top_maxinflight);
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, top_maxinflight, CTLFLAG_RW,
     &zfs_top_maxinflight, 0, "Maximum I/Os per top-level vdev");
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, resilver_delay, CTLFLAG_RWTUN,
+TUNABLE_INT("vfs.zfs.resilver_delay", &zfs_resilver_delay);
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, resilver_delay, CTLFLAG_RW,
     &zfs_resilver_delay, 0, "Number of ticks to delay resilver");
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, scrub_delay, CTLFLAG_RWTUN,
+TUNABLE_INT("vfs.zfs.scrub_delay", &zfs_scrub_delay);
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, scrub_delay, CTLFLAG_RW,
     &zfs_scrub_delay, 0, "Number of ticks to delay scrub");
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, scan_idle, CTLFLAG_RWTUN,
+TUNABLE_INT("vfs.zfs.scan_idle", &zfs_scan_idle);
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, scan_idle, CTLFLAG_RW,
     &zfs_scan_idle, 0, "Idle scan window in clock ticks");
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, scan_min_time_ms, CTLFLAG_RWTUN,
+TUNABLE_INT("vfs.zfs.scan_min_time_ms", &zfs_scan_min_time_ms);
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, scan_min_time_ms, CTLFLAG_RW,
     &zfs_scan_min_time_ms, 0, "Min millisecs to scrub per txg");
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, free_min_time_ms, CTLFLAG_RWTUN,
+TUNABLE_INT("vfs.zfs.free_min_time_ms", &zfs_free_min_time_ms);
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, free_min_time_ms, CTLFLAG_RW,
     &zfs_free_min_time_ms, 0, "Min millisecs to free per txg");
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, resilver_min_time_ms, CTLFLAG_RWTUN,
+TUNABLE_INT("vfs.zfs.resilver_min_time_ms", &zfs_resilver_min_time_ms);
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, resilver_min_time_ms, CTLFLAG_RW,
     &zfs_resilver_min_time_ms, 0, "Min millisecs to resilver per txg");
-SYSCTL_INT(_vfs_zfs, OID_AUTO, no_scrub_io, CTLFLAG_RWTUN,
+TUNABLE_INT("vfs.zfs.no_scrub_io", &zfs_no_scrub_io);
+SYSCTL_INT(_vfs_zfs, OID_AUTO, no_scrub_io, CTLFLAG_RW,
     &zfs_no_scrub_io, 0, "Disable scrub I/O");
-SYSCTL_INT(_vfs_zfs, OID_AUTO, no_scrub_prefetch, CTLFLAG_RWTUN,
+TUNABLE_INT("vfs.zfs.no_scrub_prefetch", &zfs_no_scrub_prefetch);
+SYSCTL_INT(_vfs_zfs, OID_AUTO, no_scrub_prefetch, CTLFLAG_RW,
     &zfs_no_scrub_prefetch, 0, "Disable scrub prefetching");
 
 enum ddt_class zfs_scrub_ddt_class_max = DDT_CLASS_DUPLICATE;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -55,6 +55,7 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab
 
 uint64_t metaslab_aliquot = 512ULL << 10;
 uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1;	/* force gang blocks */
+TUNABLE_QUAD("vfs.zfs.metaslab.gang_bang", &metaslab_gang_bang);
 SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, gang_bang, CTLFLAG_RWTUN,
     &metaslab_gang_bang, 0,
     "Force gang block allocation for blocks larger than or equal to this value");
@@ -66,6 +67,7 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO,
  * Values should be greater than or equal to 100.
  */
 int zfs_condense_pct = 200;
+TUNABLE_INT("vfs.zfs.condense_pct", &zfs_condense_pct);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, condense_pct, CTLFLAG_RWTUN,
     &zfs_condense_pct, 0,
     "Condense on-disk spacemap when it is more than this many percents"
@@ -85,6 +87,7 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, condense_
  * no metaslab group will be excluded based on this criterion.
  */
 int zfs_mg_noalloc_threshold = 0;
+TUNABLE_INT("vfs.zfs.mg_noalloc_threshold", &zfs_mg_noalloc_threshold);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_noalloc_threshold, CTLFLAG_RWTUN,
     &zfs_mg_noalloc_threshold, 0,
     "Percentage of metaslab group size that should be free"
@@ -94,6 +97,7 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_noallo
  * When set will load all metaslabs when pool is first opened.
  */
 int metaslab_debug_load = 0;
+TUNABLE_INT("vfs.zfs.metaslab.debug_load", &metaslab_debug_load);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_load, CTLFLAG_RWTUN,
     &metaslab_debug_load, 0,
     "Load all metaslabs when pool is first opened");
@@ -102,6 +106,7 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, 
  * When set will prevent metaslabs from being unloaded.
  */
 int metaslab_debug_unload = 0;
+TUNABLE_INT("vfs.zfs.metaslab.debug_unload", &metaslab_debug_unload);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_unload, CTLFLAG_RWTUN,
     &metaslab_debug_unload, 0,
     "Prevent metaslabs from being unloaded");
@@ -113,6 +118,8 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, 
  * aggressive strategy (i.e search by size rather than offset).
  */
 uint64_t metaslab_df_alloc_threshold = SPA_MAXBLOCKSIZE;
+TUNABLE_QUAD("vfs.zfs.metaslab.df_alloc_threshold",
+    &metaslab_df_alloc_threshold);
 SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, df_alloc_threshold, CTLFLAG_RWTUN,
     &metaslab_df_alloc_threshold, 0,
     "Minimum size which forces the dynamic allocator to change it's allocation strategy");
@@ -124,25 +131,27 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO,
  * switch to using best-fit allocations.
  */
 int metaslab_df_free_pct = 4;
+TUNABLE_INT("vfs.zfs.metaslab.df_free_pct", &metaslab_df_free_pct);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, df_free_pct, CTLFLAG_RWTUN,
     &metaslab_df_free_pct, 0,
-    "The minimum free space, in percent, which must be available in a "
-    "space map to continue allocations in a first-fit fashion");
+    "The minimum free space, in percent, which must be available in a space map to continue allocations in a first-fit fashion");
 
 /*
  * A metaslab is considered "free" if it contains a contiguous
  * segment which is greater than metaslab_min_alloc_size.
  */
 uint64_t metaslab_min_alloc_size = DMU_MAX_ACCESS;
+TUNABLE_QUAD("vfs.zfs.metaslab.min_alloc_size",
+    &metaslab_min_alloc_size);
 SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, min_alloc_size, CTLFLAG_RWTUN,
     &metaslab_min_alloc_size, 0,
-    "A metaslab is considered \"free\" if it contains a contiguous "
-    "segment which is greater than vfs.zfs.metaslab.min_alloc_size");
+    "A metaslab is considered \"free\" if it contains a contiguous segment which is greater than vfs.zfs.metaslab.min_alloc_size");
 
 /*
  * Percentage of all cpus that can be used by the metaslab taskq.
  */
 int metaslab_load_pct = 50;
+TUNABLE_INT("vfs.zfs.metaslab.load_pct", &metaslab_load_pct);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, load_pct, CTLFLAG_RWTUN,
     &metaslab_load_pct, 0,
     "Percentage of cpus that can be used by the metaslab taskq");
@@ -153,6 +162,7 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, 
  * keep it loaded.
  */
 int metaslab_unload_delay = TXG_SIZE * 2;
+TUNABLE_INT("vfs.zfs.metaslab.unload_delay", &metaslab_unload_delay);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, unload_delay, CTLFLAG_RWTUN,
     &metaslab_unload_delay, 0,
     "Number of TXGs that an unused metaslab can be kept in memory");
@@ -163,11 +173,13 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, 
 boolean_t zfs_write_to_degraded = B_FALSE;
 SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_degraded, CTLFLAG_RWTUN,
     &zfs_write_to_degraded, 0, "Allow writing data to degraded vdevs");
+TUNABLE_INT("vfs.zfs.write_to_degraded", &zfs_write_to_degraded);
 
 /*
  * Max number of metaslabs per group to preload.
  */
 int metaslab_preload_limit = SPA_DVAS_PER_BP;
+TUNABLE_INT("vfs.zfs.metaslab.preload_limit", &metaslab_preload_limit);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_limit, CTLFLAG_RWTUN,
     &metaslab_preload_limit, 0,
     "Max number of metaslabs per group to preload");
@@ -176,6 +188,7 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, 
  * Enable/disable preloading of metaslab.
  */
 boolean_t metaslab_preload_enabled = B_TRUE;
+TUNABLE_INT("vfs.zfs.metaslab.preload_enabled", &metaslab_preload_enabled);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_enabled, CTLFLAG_RWTUN,
     &metaslab_preload_enabled, 0,
     "Max number of metaslabs per group to preload");
@@ -184,6 +197,8 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, 
  * Enable/disable additional weight factor for each metaslab.
  */
 boolean_t metaslab_weight_factor_enable = B_FALSE;
+TUNABLE_INT("vfs.zfs.metaslab.weight_factor_enable",
+    &metaslab_weight_factor_enable);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, weight_factor_enable, CTLFLAG_RWTUN,
     &metaslab_weight_factor_enable, 0,
     "Enable additional weight factor for each metaslab");

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -84,7 +84,8 @@
 static int check_hostid = 1;
 
 SYSCTL_DECL(_vfs_zfs);
-SYSCTL_INT(_vfs_zfs, OID_AUTO, check_hostid, CTLFLAG_RWTUN, &check_hostid, 0,
+TUNABLE_INT("vfs.zfs.check_hostid", &check_hostid);
+SYSCTL_INT(_vfs_zfs, OID_AUTO, check_hostid, CTLFLAG_RW, &check_hostid, 0,
     "Check hostid on import?");
 
 /*

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -244,6 +244,7 @@ int zfs_flags = ~(ZFS_DEBUG_DPRINTF | ZF
 int zfs_flags = 0;
 #endif
 SYSCTL_DECL(_debug);
+TUNABLE_INT("debug.zfs_flags", &zfs_flags);
 SYSCTL_INT(_debug, OID_AUTO, zfs_flags, CTLFLAG_RWTUN, &zfs_flags, 0,
     "ZFS debug flags.");
 
@@ -256,6 +257,7 @@ SYSCTL_INT(_debug, OID_AUTO, zfs_flags, 
  */
 int zfs_recover = 0;
 SYSCTL_DECL(_vfs_zfs);
+TUNABLE_INT("vfs.zfs.recover", &zfs_recover);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RDTUN, &zfs_recover, 0,
     "Try to recover from otherwise-fatal errors.");
 
@@ -268,6 +270,7 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, 
  * in a system panic.
  */
 uint64_t zfs_deadman_synctime_ms = 1000000ULL;
+TUNABLE_QUAD("vfs.zfs.deadman_synctime_ms", &zfs_deadman_synctime_ms);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_synctime_ms, CTLFLAG_RDTUN,
     &zfs_deadman_synctime_ms, 0,
     "Stalled ZFS I/O expiration time in milliseconds");
@@ -277,6 +280,7 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman
  * for hung I/O.
  */
 uint64_t zfs_deadman_checktime_ms = 5000ULL;
+TUNABLE_QUAD("vfs.zfs.deadman_checktime_ms", &zfs_deadman_checktime_ms);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_checktime_ms, CTLFLAG_RDTUN,
     &zfs_deadman_checktime_ms, 0,
     "Period of checks for stalled ZFS I/O in milliseconds");
@@ -286,6 +290,7 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman
  * zfs_deadman_init()
  */
 int zfs_deadman_enabled = -1;
+TUNABLE_INT("vfs.zfs.deadman_enabled", &zfs_deadman_enabled);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_enabled, CTLFLAG_RDTUN,
     &zfs_deadman_enabled, 0, "Kernel panic on stalled ZFS I/O");
 
@@ -299,6 +304,7 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_e
  *     (VDEV_RAIDZ_MAXPARITY + 1) * SPA_DVAS_PER_BP * 2 == 24
  */
 int spa_asize_inflation = 24;
+TUNABLE_INT("vfs.zfs.spa_asize_inflation", &spa_asize_inflation);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_asize_inflation, CTLFLAG_RWTUN,
     &spa_asize_inflation, 0, "Worst case inflation factor for single sector writes");
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -85,22 +85,31 @@ static u_int trim_vdev_max_pending = 64;
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_NODE(_vfs_zfs, OID_AUTO, trim, CTLFLAG_RD, 0, "ZFS TRIM");
 
+TUNABLE_INT("vfs.zfs.trim.txg_delay", &trim_txg_delay);
 SYSCTL_UINT(_vfs_zfs_trim, OID_AUTO, txg_delay, CTLFLAG_RWTUN, &trim_txg_delay,
     0, "Delay TRIMs by up to this many TXGs");
+
+TUNABLE_INT("vfs.zfs.trim.timeout", &trim_timeout);
 SYSCTL_UINT(_vfs_zfs_trim, OID_AUTO, timeout, CTLFLAG_RWTUN, &trim_timeout, 0,
     "Delay TRIMs by up to this many seconds");
+
+TUNABLE_INT("vfs.zfs.trim.max_interval", &trim_max_interval);
 SYSCTL_UINT(_vfs_zfs_trim, OID_AUTO, max_interval, CTLFLAG_RWTUN,
     &trim_max_interval, 0,
     "Maximum interval between TRIM queue processing (seconds)");
 
 SYSCTL_DECL(_vfs_zfs_vdev);
+TUNABLE_QUAD("vfs.zfs.vdev.trim_max_bytes", &trim_vdev_max_bytes);
 SYSCTL_QUAD(_vfs_zfs_vdev, OID_AUTO, trim_max_bytes, CTLFLAG_RWTUN,
     &trim_vdev_max_bytes, 0,
     "Maximum pending TRIM bytes for a vdev");
+
+TUNABLE_INT("vfs.zfs.vdev.trim_max_pending", &trim_vdev_max_pending);
 SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, trim_max_pending, CTLFLAG_RWTUN,
     &trim_vdev_max_pending, 0,
     "Maximum pending TRIM segments for a vdev");
 
+
 static void trim_map_vdev_commit_done(spa_t *spa, vdev_t *vd);
 
 static int

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -112,7 +112,8 @@ int zfs_txg_timeout = 5;	/* max seconds 
 
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_NODE(_vfs_zfs, OID_AUTO, txg, CTLFLAG_RW, 0, "ZFS TXG");
-SYSCTL_INT(_vfs_zfs_txg, OID_AUTO, timeout, CTLFLAG_RWTUN, &zfs_txg_timeout, 0,
+TUNABLE_INT("vfs.zfs.txg.timeout", &zfs_txg_timeout);
+SYSCTL_INT(_vfs_zfs_txg, OID_AUTO, timeout, CTLFLAG_RW, &zfs_txg_timeout, 0,
     "Maximum seconds worth of delta per txg");
 
 /*

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -90,10 +90,13 @@ int zfs_vdev_cache_bshift = 16;
 
 SYSCTL_DECL(_vfs_zfs_vdev);
 SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, cache, CTLFLAG_RW, 0, "ZFS VDEV Cache");
+TUNABLE_INT("vfs.zfs.vdev.cache.max", &zfs_vdev_cache_max);
 SYSCTL_INT(_vfs_zfs_vdev_cache, OID_AUTO, max, CTLFLAG_RDTUN,
     &zfs_vdev_cache_max, 0, "Maximum I/O request size that increase read size");
+TUNABLE_INT("vfs.zfs.vdev.cache.size", &zfs_vdev_cache_size);
 SYSCTL_INT(_vfs_zfs_vdev_cache, OID_AUTO, size, CTLFLAG_RDTUN,
     &zfs_vdev_cache_size, 0, "Size of VDEV cache");
+TUNABLE_INT("vfs.zfs.vdev.cache.bshift", &zfs_vdev_cache_bshift);
 SYSCTL_INT(_vfs_zfs_vdev_cache, OID_AUTO, bshift, CTLFLAG_RDTUN,
     &zfs_vdev_cache_bshift, 0, "Turn too small requests into 1 << this value");
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -53,12 +53,14 @@ DECLARE_GEOM_CLASS(zfs_vdev_class, zfs_v
 
 SYSCTL_DECL(_vfs_zfs_vdev);
 /* Don't send BIO_FLUSH. */
-static int vdev_geom_bio_flush_disable;
-SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_flush_disable, CTLFLAG_RWTUN,
+static int vdev_geom_bio_flush_disable = 0;
+TUNABLE_INT("vfs.zfs.vdev.bio_flush_disable", &vdev_geom_bio_flush_disable);
+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_flush_disable, CTLFLAG_RW,
     &vdev_geom_bio_flush_disable, 0, "Disable BIO_FLUSH");
 /* Don't send BIO_DELETE. */
-static int vdev_geom_bio_delete_disable;
-SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_delete_disable, CTLFLAG_RWTUN,
+static int vdev_geom_bio_delete_disable = 0;
+TUNABLE_INT("vfs.zfs.vdev.bio_delete_disable", &vdev_geom_bio_delete_disable);
+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_delete_disable, CTLFLAG_RW,
     &vdev_geom_bio_delete_disable, 0, "Disable BIO_DELETE");
 
 static void

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -74,26 +74,32 @@ static SYSCTL_NODE(_vfs_zfs_vdev, OID_AU
 
 /* Rotating media load calculation configuration. */
 static int rotating_inc = 0;
-SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_inc, CTLFLAG_RWTUN,
+TUNABLE_INT("vfs.zfs.vdev.mirror.rotating_inc", &rotating_inc);
+SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_inc, CTLFLAG_RW,
     &rotating_inc, 0, "Rotating media load increment for non-seeking I/O's");
 
 static int rotating_seek_inc = 5;
-SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_inc, CTLFLAG_RWTUN,
+TUNABLE_INT("vfs.zfs.vdev.mirror.rotating_seek_inc", &rotating_seek_inc);
+SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_inc, CTLFLAG_RW,
     &rotating_seek_inc, 0, "Rotating media load increment for seeking I/O's");
 
 static int rotating_seek_offset = 1 * 1024 * 1024;
-SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_offset, CTLFLAG_RWTUN,
+TUNABLE_INT("vfs.zfs.vdev.mirror.rotating_seek_offset", &rotating_seek_offset);
+SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_offset, CTLFLAG_RW,
     &rotating_seek_offset, 0, "Offset in bytes from the last I/O which "
     "triggers a reduced rotating media seek increment");
 
 /* Non-rotating media load calculation configuration. */
 static int non_rotating_inc = 0;
-SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_inc, CTLFLAG_RWTUN,
+TUNABLE_INT("vfs.zfs.vdev.mirror.non_rotating_inc", &non_rotating_inc);
+SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_inc, CTLFLAG_RW,
     &non_rotating_inc, 0,
     "Non-rotating media load increment for non-seeking I/O's");
 
 static int non_rotating_seek_inc = 1;
-SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_seek_inc, CTLFLAG_RWTUN,
+TUNABLE_INT("vfs.zfs.vdev.mirror.non_rotating_seek_inc",
+     &non_rotating_seek_inc);
+SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_seek_inc, CTLFLAG_RW,
     &non_rotating_seek_inc, 0,
     "Non-rotating media load increment for seeking I/O's");
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c	Fri Jun 27 21:33:15 2014	(r267984)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c	Fri Jun 27 22:05:21 2014	(r267985)
@@ -176,18 +176,23 @@ int zfs_vdev_write_gap_limit = 4 << 10;
 
 #ifdef __FreeBSD__
 SYSCTL_DECL(_vfs_zfs_vdev);
-SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, max_active, CTLFLAG_RWTUN,
+TUNABLE_INT("vfs.zfs.vdev.max_active", &zfs_vdev_max_active);
+SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, max_active, CTLFLAG_RW,
     &zfs_vdev_max_active, 0,

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 22:23:27 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id AC20B747;
 Fri, 27 Jun 2014 22:23:27 +0000 (UTC)
Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client CN "mailhost.stack.nl",
 Issuer "CA Cert Signing Authority" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 71A1A23EE;
 Fri, 27 Jun 2014 22:23:27 +0000 (UTC)
Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131])
 by mx1.stack.nl (Postfix) with ESMTP id 0304C358C5F;
 Sat, 28 Jun 2014 00:23:23 +0200 (CEST)
Received: by snail.stack.nl (Postfix, from userid 1677)
 id CD77528497; Sat, 28 Jun 2014 00:23:23 +0200 (CEST)
Date: Sat, 28 Jun 2014 00:23:23 +0200
From: Jilles Tjoelker 
To: Xin LI 
Subject: Re: svn commit: r267977 - head/bin/mv
Message-ID: <20140627222323.GA43131@stack.nl>
References: <201406271957.s5RJvs6j074326@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201406271957.s5RJvs6j074326@svn.freebsd.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 22:23:27 -0000

On Fri, Jun 27, 2014 at 07:57:54PM +0000, Xin LI wrote:
> Author: delphij
> Date: Fri Jun 27 19:57:54 2014
> New Revision: 267977
> URL: http://svnweb.freebsd.org/changeset/base/267977

> Log:
>   Always set UF_ARCHIVE on target (because they are by definition new files
>   and should be archived) and ignore error when we can't set it (e.g. NFS).

>   Reviewed by:	ken
>   MFC after:	2 weeks

> Modified:
>   head/bin/mv/mv.c

> Modified: head/bin/mv/mv.c
> ==============================================================================
> --- head/bin/mv/mv.c	Fri Jun 27 19:50:30 2014	(r267976)
> +++ head/bin/mv/mv.c	Fri Jun 27 19:57:54 2014	(r267977)
> @@ -337,8 +337,8 @@ err:		if (unlink(to))
>  	 * on a file that we copied, i.e., that we didn't create.)
>  	 */
>  	errno = 0;
> -	if (fchflags(to_fd, sbp->st_flags))
> -		if (errno != EOPNOTSUPP || sbp->st_flags != 0)
> +	if (fchflags(to_fd, sbp->st_flags | UF_ARCHIVE))
> +		if (errno != EOPNOTSUPP || ((sbp->st_flags & ~UF_ARCHIVE) != 0))
>  			warn("%s: set flags (was: 0%07o)", to, sbp->st_flags);
>  
>  	tval[0].tv_sec = sbp->st_atime;

The part ignoring failures to set UF_ARCHIVE is OK. However, it seems
inconsistent to set UF_ARCHIVE on a cross-filesystem mv of a single
file, but not on a cross-filesystem mv of a directory tree or a file
newly created via shell output redirection.

If UF_ARCHIVE is supposed to be set automatically, I think this should
be done in the kernel, like msdosfs already does. However, I'm not sure
this is actually a useful feature: backup programs are smarter than an
archive attribute these days.

-- 
Jilles Tjoelker

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 22:28:14 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C3AF79CE;
 Fri, 27 Jun 2014 22:28:14 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 970D42411;
 Fri, 27 Jun 2014 22:28:14 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RMSEpq046601;
 Fri, 27 Jun 2014 22:28:14 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RMSE1o046600;
 Fri, 27 Jun 2014 22:28:14 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201406272228.s5RMSE1o046600@svn.freebsd.org>
From: Alexander Motin 
Date: Fri, 27 Jun 2014 22:28:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267986 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 22:28:14 -0000

Author: mav
Date: Fri Jun 27 22:28:14 2014
New Revision: 267986
URL: http://svnweb.freebsd.org/changeset/base/267986

Log:
  Remove odd practice of inverting error codes.
  
  -EPERM is equal to ERESTART, returning which from ioctl() handler causes
  infinite syscall restart.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/ctl/ctl.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Fri Jun 27 22:05:21 2014	(r267985)
+++ head/sys/cam/ctl/ctl.c	Fri Jun 27 22:28:14 2014	(r267986)
@@ -2147,14 +2147,14 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 		 * to this FETD.
 		 */
 		if ((softc->ioctl_info.flags & CTL_IOCTL_FLAG_ENABLED) == 0) {
-			retval = -EPERM;
+			retval = EPERM;
 			break;
 		}
 
 		io = ctl_alloc_io(softc->ioctl_info.fe.ctl_pool_ref);
 		if (io == NULL) {
 			printf("ctl_ioctl: can't allocate ctl_io!\n");
-			retval = -ENOSPC;
+			retval = ENOSPC;
 			break;
 		}
 
@@ -2689,7 +2689,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 			softc->flags |= CTL_FLAG_REAL_SYNC;
 			break;
 		default:
-			retval = -EINVAL;
+			retval = EINVAL;
 			break;
 		}
 		mtx_unlock(&softc->ctl_lock);
@@ -3168,7 +3168,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 		if (found == 0) {
 			printf("ctl: unknown ioctl command %#lx or backend "
 			       "%d\n", cmd, type);
-			retval = -EINVAL;
+			retval = EINVAL;
 			break;
 		}
 		retval = backend->ioctl(dev, cmd, addr, flag, td);
@@ -3333,7 +3333,7 @@ ctl_pool_create(struct ctl_softc *ctl_so
 	pool = (struct ctl_io_pool *)malloc(sizeof(*pool), M_CTL,
 					    M_NOWAIT | M_ZERO);
 	if (pool == NULL) {
-		retval = -ENOMEM;
+		retval = ENOMEM;
 		goto bailout;
 	}
 
@@ -3416,7 +3416,7 @@ ctl_pool_acquire(struct ctl_io_pool *poo
 	mtx_assert(&pool->ctl_softc->pool_lock, MA_OWNED);
 
 	if (pool->flags & CTL_POOL_FLAG_INVALID)
-		return (-EINVAL);
+		return (EINVAL);
 
 	pool->refcount++;
 
@@ -9389,7 +9389,7 @@ ctl_tur(struct ctl_scsiio *ctsio)
 	CTL_DEBUG_PRINT(("ctl_tur\n"));
 
 	if (lun == NULL)
-		return (-EINVAL);
+		return (EINVAL);
 
 	ctsio->scsi_status = SCSI_STATUS_OK;
 	ctsio->io_hdr.status = CTL_SUCCESS;
@@ -13183,7 +13183,7 @@ ctl_queue(union ctl_io *io)
 		break;
 	default:
 		printf("ctl_queue: unknown I/O type %d\n", io->io_hdr.io_type);
-		return (-EINVAL);
+		return (EINVAL);
 	}
 
 	return (CTL_RETVAL_COMPLETE);

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 27 22:38:43 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4406AF93;
 Fri, 27 Jun 2014 22:38:43 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3146024F2;
 Fri, 27 Jun 2014 22:38:43 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RMchIM051593;
 Fri, 27 Jun 2014 22:38:43 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RMch3C051592;
 Fri, 27 Jun 2014 22:38:43 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201406272238.s5RMch3C051592@svn.freebsd.org>
From: Rui Paulo 
Date: Fri, 27 Jun 2014 22:38:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267987 - head/sys/modules/dtrace/dtrace
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 27 Jun 2014 22:38:43 -0000

Author: rpaulo
Date: Fri Jun 27 22:38:42 2014
New Revision: 267987
URL: http://svnweb.freebsd.org/changeset/base/267987

Log:
  Redefine SUNW based on SYSDIR in an attempt to fix a build problem.
  
  MFC after:	2 weeks

Modified:
  head/sys/modules/dtrace/dtrace/Makefile

Modified: head/sys/modules/dtrace/dtrace/Makefile
==============================================================================
--- head/sys/modules/dtrace/dtrace/Makefile	Fri Jun 27 22:28:14 2014	(r267986)
+++ head/sys/modules/dtrace/dtrace/Makefile	Fri Jun 27 22:38:42 2014	(r267987)
@@ -4,7 +4,7 @@ SYSDIR?=	${.CURDIR}/../../..
 
 ARCHDIR=	${MACHINE_CPUARCH}
 
-SUNW=	${.CURDIR}/../../../../cddl/contrib/opensolaris
+SUNW=	${SYSDIR}/../cddl/contrib/opensolaris
 
 .PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace
 .PATH: ${SYSDIR}/cddl/compat/opensolaris/kern

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 28 00:01:19 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 10E12F6E;
 Sat, 28 Jun 2014 00:01:19 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id F26032B95;
 Sat, 28 Jun 2014 00:01:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5S01Ir9090427;
 Sat, 28 Jun 2014 00:01:18 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5S01IGq090426;
 Sat, 28 Jun 2014 00:01:18 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201406280001.s5S01IGq090426@svn.freebsd.org>
From: Gavin Atkinson 
Date: Sat, 28 Jun 2014 00:01:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267991 - head/tools/tools/sysbuild
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 28 Jun 2014 00:01:19 -0000

Author: gavin
Date: Sat Jun 28 00:01:18 2014
New Revision: 267991
URL: http://svnweb.freebsd.org/changeset/base/267991

Log:
  Minimal update for cvsup -> svn change.

Modified:
  head/tools/tools/sysbuild/README

Modified: head/tools/tools/sysbuild/README
==============================================================================
--- head/tools/tools/sysbuild/README	Fri Jun 27 23:15:31 2014	(r267990)
+++ head/tools/tools/sysbuild/README	Sat Jun 28 00:01:18 2014	(r267991)
@@ -65,9 +65,8 @@ Next, install ports and sources:
 	cd /freebsd
 	mkdir ports src packages
 
-	# Or use svn if you prefer
-	csup -h cvsup.???.freebsd.org /usr/share/examples/cvsup/ports-supfile
-	csup -h cvsup.???.freebsd.org /usr/share/examples/cvsup/stable-supfile
+	svn co https://svn0.us-east.FreeBSD.org/base/stable/10 src
+	svn co https://svn0.us-east.FreeBSD.org/ports/head ports
 
 And we should be ready to try a shot:
 

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 28 01:02:33 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id CDEA8A1B;
 Sat, 28 Jun 2014 01:02:33 +0000 (UTC)
Received: from thyme.infocus-llc.com (server.infocus-llc.com [206.156.254.44])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client CN "*.infocus-llc.com", Issuer "*.infocus-llc.com" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 9F5DF2079;
 Sat, 28 Jun 2014 01:02:32 +0000 (UTC)
Received: from draco.over-yonder.net (c-75-65-60-66.hsd1.ms.comcast.net
 [75.65.60.66])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by thyme.infocus-llc.com (Postfix) with ESMTPSA id 41A7C37B568;
 Fri, 27 Jun 2014 20:02:25 -0500 (CDT)
Received: by draco.over-yonder.net (Postfix, from userid 100)
 id 3h0cBS4f2JzT9t; Fri, 27 Jun 2014 20:02:24 -0500 (CDT)
Date: Fri, 27 Jun 2014 20:02:24 -0500
From: "Matthew D. Fuller" 
To: Xin LI 
Subject: Re: svn commit: r254627 - in head: bin/chflags bin/ls lib/libc/gen
 lib/libc/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/msdosfs
 sys/fs/smbfs sys/sys sys/ufs/ufs
Message-ID: <20140628010224.GA86932@over-yonder.net>
References: <201308212304.r7LN4mr6058450@svn.freebsd.org>
 
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: 
X-Editor: vi
X-OS: FreeBSD 
User-Agent: Mutt/1.5.23-fullermd.4 (2014-03-12)
X-Virus-Scanned: clamav-milter 0.98.4 at thyme.infocus-llc.com
X-Virus-Status: Clean
Cc: "svn-src-head@freebsd.org" ,
 Craig Rodrigues ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" ,
 "Kenneth D. Merry" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 28 Jun 2014 01:02:33 -0000

On Fri, Jun 27, 2014 at 12:48:29PM -0700 I heard the voice of
Xin LI, and lo! it spake thus:
> 
> Craig have hit an interesting issue today, where he tried to 'mv' a
> file from ZFS dataset to a NFS mount, 'mv' bails out because chflags
> failed.

I've been getting these for a while on my -CURRENT box, where I mv
things from ZFS to NFS quite often, but it doesn't bail out; it keep
on going and just yells at me about every file.  I tried smacking it
around to fix it, but I wound up spilling my coffee instead   8-}


-- 
Matthew Fuller     (MF4839)   |  fullermd@over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
           On the Internet, nobody can hear you scream.

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 28 03:56:27 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C0F66FED;
 Sat, 28 Jun 2014 03:56:27 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A8EC22D4C;
 Sat, 28 Jun 2014 03:56:27 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5S3uRhm098374;
 Sat, 28 Jun 2014 03:56:27 GMT
 (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5S3uIRE098321;
 Sat, 28 Jun 2014 03:56:18 GMT
 (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201406280356.s5S3uIRE098321@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Sat, 28 Jun 2014 03:56:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267992 - in head/sys: amd64/acpica amd64/amd64 amd64/pci
 amd64/vmm arm/arm arm/freescale/imx arm/xscale/ixp425 cam cam/ata cam/ctl
 cam/scsi cddl/compat/opensolaris/kern cddl/contrib/op...
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 28 Jun 2014 03:56:27 -0000

Author: hselasky
Date: Sat Jun 28 03:56:17 2014
New Revision: 267992
URL: http://svnweb.freebsd.org/changeset/base/267992

Log:
  Pull in r267961 and r267973 again. Fix for issues reported will follow.

Modified:
  head/sys/amd64/acpica/acpi_machdep.c
  head/sys/amd64/amd64/amd64_mem.c
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/amd64/mp_watchdog.c
  head/sys/amd64/amd64/pmap.c
  head/sys/amd64/amd64/sys_machdep.c
  head/sys/amd64/amd64/trap.c
  head/sys/amd64/pci/pci_cfgreg.c
  head/sys/amd64/vmm/vmm.c
  head/sys/arm/arm/busdma_machdep-v6.c
  head/sys/arm/arm/busdma_machdep.c
  head/sys/arm/arm/dump_machdep.c
  head/sys/arm/arm/platform.c
  head/sys/arm/arm/pmap-v6.c
  head/sys/arm/freescale/imx/imx6_anatop.c
  head/sys/arm/xscale/ixp425/if_npe.c
  head/sys/arm/xscale/ixp425/ixp425_npe.c
  head/sys/arm/xscale/ixp425/ixp425_qmgr.c
  head/sys/cam/ata/ata_da.c
  head/sys/cam/ata/ata_pmp.c
  head/sys/cam/cam.c
  head/sys/cam/cam_xpt.c
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_backend_block.c
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/cam/scsi/scsi_cd.c
  head/sys/cam/scsi/scsi_da.c
  head/sys/cam/scsi/scsi_enc_safte.c
  head/sys/cam/scsi/scsi_sa.c
  head/sys/cam/scsi/scsi_xpt.c
  head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
  head/sys/cddl/dev/dtrace/dtrace_sysctl.c
  head/sys/compat/ia32/ia32_sysvec.c
  head/sys/compat/x86bios/x86bios.c
  head/sys/dev/aac/aac_pci.c
  head/sys/dev/acpica/Osd/OsdSchedule.c
  head/sys/dev/acpica/acpi_cpu.c
  head/sys/dev/acpica/acpi_ec.c
  head/sys/dev/amr/amr_pci.c
  head/sys/dev/ata/ata-all.c
  head/sys/dev/ath/ah_osdep.c
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_debug.c
  head/sys/dev/bce/if_bce.c
  head/sys/dev/bge/if_bge.c
  head/sys/dev/bwn/if_bwn.c
  head/sys/dev/bxe/bxe.c
  head/sys/dev/cardbus/cardbus.c
  head/sys/dev/cs/if_cs.c
  head/sys/dev/cxgb/cxgb_include.h
  head/sys/dev/cxgb/cxgb_main.c
  head/sys/dev/cxgb/cxgb_sge.c
  head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c
  head/sys/dev/cxgbe/iw_cxgbe/cm.c
  head/sys/dev/drm/drm_drv.c
  head/sys/dev/drm/drm_sysctl.c
  head/sys/dev/drm2/drm_drv.c
  head/sys/dev/drm2/drm_sysctl.c
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/fb/vesa.c
  head/sys/dev/firewire/fwohci.c
  head/sys/dev/firewire/if_fwe.c
  head/sys/dev/firewire/if_fwip.c
  head/sys/dev/firewire/sbp.c
  head/sys/dev/glxiic/glxiic.c
  head/sys/dev/hptmv/hptproc.c
  head/sys/dev/hwpmc/hwpmc_logging.c
  head/sys/dev/hwpmc/hwpmc_mod.c
  head/sys/dev/iscsi/icl.c
  head/sys/dev/iscsi/iscsi.c
  head/sys/dev/iscsi_initiator/iscsi.c
  head/sys/dev/ixgbe/ixgbe.c
  head/sys/dev/malo/if_malo.c
  head/sys/dev/malo/if_malo_pci.c
  head/sys/dev/mfi/mfi.c
  head/sys/dev/mfi/mfi_cam.c
  head/sys/dev/mfi/mfi_pci.c
  head/sys/dev/mfi/mfi_tbolt.c
  head/sys/dev/mwl/if_mwl.c
  head/sys/dev/nand/nand.c
  head/sys/dev/pccard/pccard.c
  head/sys/dev/pccbb/pccbb.c
  head/sys/dev/pccbb/pccbb_isa.c
  head/sys/dev/pci/pci.c
  head/sys/dev/pci/pci_pci.c
  head/sys/dev/pci/vga_pci.c
  head/sys/dev/puc/puc_pci.c
  head/sys/dev/rt/if_rt.c
  head/sys/dev/sdhci/sdhci.c
  head/sys/dev/sdhci/sdhci_pci.c
  head/sys/dev/si/si.c
  head/sys/dev/sio/sio.c
  head/sys/dev/sis/if_sis.c
  head/sys/dev/sound/pcm/channel.c
  head/sys/dev/sound/pcm/feeder_chain.c
  head/sys/dev/sound/pcm/feeder_eq.c
  head/sys/dev/sound/pcm/feeder_rate.c
  head/sys/dev/sound/pcm/mixer.c
  head/sys/dev/sound/pcm/sound.c
  head/sys/dev/sound/usb/uaudio.c
  head/sys/dev/syscons/syscons.c
  head/sys/dev/uart/uart_dev_ns8250.c
  head/sys/dev/usb/controller/dwc_otg.c
  head/sys/dev/usb/controller/ehci.c
  head/sys/dev/usb/controller/ohci.c
  head/sys/dev/usb/controller/uhci.c
  head/sys/dev/usb/controller/usb_controller.c
  head/sys/dev/usb/controller/xhci.c
  head/sys/dev/usb/input/ukbd.c
  head/sys/dev/usb/serial/uftdi.c
  head/sys/dev/usb/serial/usb_serial.c
  head/sys/dev/usb/storage/umass.c
  head/sys/dev/usb/usb_debug.c
  head/sys/dev/usb/usb_dev.c
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usb_generic.c
  head/sys/dev/usb/usb_hub.c
  head/sys/dev/usb/usb_process.c
  head/sys/dev/usb/wlan/if_uath.c
  head/sys/dev/usb/wlan/if_upgt.c
  head/sys/dev/usb/wlan/if_urtw.c
  head/sys/dev/vt/vt.h
  head/sys/dev/wpi/if_wpi.c
  head/sys/gdb/gdb_cons.c
  head/sys/geom/concat/g_concat.c
  head/sys/geom/eli/g_eli.c
  head/sys/geom/eli/g_eli_key_cache.c
  head/sys/geom/gate/g_gate.c
  head/sys/geom/geom_disk.c
  head/sys/geom/geom_kern.c
  head/sys/geom/journal/g_journal.c
  head/sys/geom/label/g_label.c
  head/sys/geom/label/g_label.h
  head/sys/geom/linux_lvm/g_linux_lvm.c
  head/sys/geom/mirror/g_mirror.c
  head/sys/geom/part/g_part.c
  head/sys/geom/part/g_part_ldm.c
  head/sys/geom/raid/g_raid.c
  head/sys/geom/raid/g_raid.h
  head/sys/geom/raid/tr_raid1.c
  head/sys/geom/raid/tr_raid1e.c
  head/sys/geom/raid3/g_raid3.c
  head/sys/geom/shsec/g_shsec.c
  head/sys/geom/stripe/g_stripe.c
  head/sys/geom/vinum/geom_vinum.c
  head/sys/geom/virstor/g_virstor.c
  head/sys/i386/acpica/acpi_machdep.c
  head/sys/i386/bios/apm.c
  head/sys/i386/i386/i686_mem.c
  head/sys/i386/i386/machdep.c
  head/sys/i386/i386/mp_watchdog.c
  head/sys/i386/i386/pmap.c
  head/sys/i386/i386/trap.c
  head/sys/i386/pci/pci_cfgreg.c
  head/sys/i386/pci/pci_pir.c
  head/sys/ia64/ia64/dump_machdep.c
  head/sys/ia64/ia64/pmap.c
  head/sys/kern/imgact_elf.c
  head/sys/kern/kern_clocksource.c
  head/sys/kern/kern_cons.c
  head/sys/kern/kern_cpu.c
  head/sys/kern/kern_exec.c
  head/sys/kern/kern_intr.c
  head/sys/kern/kern_ktr.c
  head/sys/kern/kern_ktrace.c
  head/sys/kern/kern_linker.c
  head/sys/kern/kern_malloc.c
  head/sys/kern/kern_mbuf.c
  head/sys/kern/kern_mib.c
  head/sys/kern/kern_ntptime.c
  head/sys/kern/kern_osd.c
  head/sys/kern/kern_pmc.c
  head/sys/kern/kern_priv.c
  head/sys/kern/kern_shutdown.c
  head/sys/kern/kern_sig.c
  head/sys/kern/kern_sysctl.c
  head/sys/kern/kern_tc.c
  head/sys/kern/kern_timeout.c
  head/sys/kern/subr_bus.c
  head/sys/kern/subr_kdb.c
  head/sys/kern/subr_msgbuf.c
  head/sys/kern/subr_param.c
  head/sys/kern/subr_prf.c
  head/sys/kern/subr_rman.c
  head/sys/kern/subr_smp.c
  head/sys/kern/subr_witness.c
  head/sys/kern/sys_pipe.c
  head/sys/kern/sysv_msg.c
  head/sys/kern/sysv_sem.c
  head/sys/kern/sysv_shm.c
  head/sys/kern/vfs_init.c
  head/sys/kern/vfs_lookup.c
  head/sys/mips/cavium/usb/octusb.c
  head/sys/mips/mips/dump_machdep.c
  head/sys/mips/rt305x/uart_dev_rt305x.c
  head/sys/net/ieee8023ad_lacp.c
  head/sys/net/if.c
  head/sys/net/if_bridge.c
  head/sys/net/if_lagg.c
  head/sys/net/if_stf.c
  head/sys/net/if_tap.c
  head/sys/net/if_tun.c
  head/sys/net/netisr.c
  head/sys/net/route.c
  head/sys/netgraph/ng_base.c
  head/sys/netgraph/ng_mppc.c
  head/sys/netinet/in_mcast.c
  head/sys/netinet/in_rss.c
  head/sys/netinet/tcp_subr.c
  head/sys/netinet6/in6_mcast.c
  head/sys/netinet6/mld6.c
  head/sys/netpfil/ipfw/ip_fw2.c
  head/sys/netpfil/pf/pf.c
  head/sys/pc98/cbus/sio.c
  head/sys/pc98/pc98/machdep.c
  head/sys/pc98/pc98/pc98_machdep.c
  head/sys/security/mac_biba/mac_biba.c
  head/sys/security/mac_bsdextended/mac_bsdextended.c
  head/sys/security/mac_ifoff/mac_ifoff.c
  head/sys/security/mac_lomac/mac_lomac.c
  head/sys/security/mac_mls/mac_mls.c
  head/sys/security/mac_portacl/mac_portacl.c
  head/sys/sparc64/pci/psycho.c
  head/sys/sys/malloc.h
  head/sys/sys/param.h
  head/sys/sys/sysctl.h
  head/sys/vm/memguard.c
  head/sys/vm/redzone.c
  head/sys/vm/uma_core.c
  head/sys/vm/vm_init.c
  head/sys/vm/vm_map.c
  head/sys/vm/vm_mmap.c
  head/sys/vm/vm_page.c
  head/sys/vm/vm_radix.c
  head/sys/vm/vm_zeroidle.c
  head/sys/x86/cpufreq/hwpstate.c
  head/sys/x86/iommu/intel_utils.c
  head/sys/x86/pci/pci_bus.c
  head/sys/x86/x86/dump_machdep.c
  head/sys/x86/x86/io_apic.c
  head/sys/x86/x86/mca.c
  head/sys/x86/x86/tsc.c

Modified: head/sys/amd64/acpica/acpi_machdep.c
==============================================================================
--- head/sys/amd64/acpica/acpi_machdep.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/amd64/acpica/acpi_machdep.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -45,9 +45,8 @@ __FBSDID("$FreeBSD$");
 #include 
 
 int acpi_resume_beep;
-TUNABLE_INT("debug.acpi.resume_beep", &acpi_resume_beep);
-SYSCTL_INT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RW, &acpi_resume_beep,
-    0, "Beep the PC speaker when resuming");
+SYSCTL_INT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RWTUN,
+    &acpi_resume_beep, 0, "Beep the PC speaker when resuming");
 
 int acpi_reset_video;
 TUNABLE_INT("hw.acpi.reset_video", &acpi_reset_video);

Modified: head/sys/amd64/amd64/amd64_mem.c
==============================================================================
--- head/sys/amd64/amd64/amd64_mem.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/amd64/amd64/amd64_mem.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -69,7 +69,6 @@ static char *mem_owner_bios = "BIOS";
 	(((curr) & ~MDF_ATTRMASK) | ((new) & MDF_ATTRMASK))
 
 static int mtrrs_disabled;
-TUNABLE_INT("machdep.disable_mtrrs", &mtrrs_disabled);
 SYSCTL_INT(_machdep, OID_AUTO, disable_mtrrs, CTLFLAG_RDTUN,
     &mtrrs_disabled, 0, "Disable amd64 MTRRs.");
 

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/amd64/amd64/machdep.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -675,8 +675,7 @@ cpu_halt(void)
 void (*cpu_idle_hook)(sbintime_t) = NULL;	/* ACPI idle hook. */
 static int	cpu_ident_amdc1e = 0;	/* AMD C1E supported. */
 static int	idle_mwait = 1;		/* Use MONITOR/MWAIT for short idle. */
-TUNABLE_INT("machdep.idle_mwait", &idle_mwait);
-SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RW, &idle_mwait,
+SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RWTUN, &idle_mwait,
     0, "Use MONITOR/MWAIT for short idle");
 
 #define	STATE_RUNNING	0x0

Modified: head/sys/amd64/amd64/mp_watchdog.c
==============================================================================
--- head/sys/amd64/amd64/mp_watchdog.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/amd64/amd64/mp_watchdog.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -68,8 +68,7 @@ static int	watchdog_dontfire = 1;
 static int	watchdog_timer = -1;
 static int	watchdog_nmi = 1;
 
-TUNABLE_INT("debug.watchdog", &watchdog_cpu);
-SYSCTL_INT(_debug, OID_AUTO, watchdog_nmi, CTLFLAG_RW, &watchdog_nmi, 0,
+SYSCTL_INT(_debug, OID_AUTO, watchdog_nmi, CTLFLAG_RWTUN, &watchdog_nmi, 0,
     "IPI the boot processor with an NMI to enter the debugger");
 
 static struct callout	watchdog_callout;

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/amd64/amd64/pmap.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -332,8 +332,8 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pat_works
     "Is page attribute table fully functional?");
 
 static int pg_ps_enabled = 1;
-SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN, &pg_ps_enabled, 0,
-    "Are large page mappings enabled?");
+SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH,
+    &pg_ps_enabled, 0, "Are large page mappings enabled?");
 
 #define	PAT_INDEX_SIZE	8
 static int pat_index[PAT_INDEX_SIZE];	/* cache mode to PAT index conversion */
@@ -368,8 +368,8 @@ static int pmap_flags = PMAP_PDE_SUPERPA
 static struct unrhdr pcid_unr;
 static struct mtx pcid_mtx;
 int pmap_pcid_enabled = 0;
-SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN, &pmap_pcid_enabled,
-    0, "Is TLB Context ID enabled ?");
+SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH,
+    &pmap_pcid_enabled, 0, "Is TLB Context ID enabled ?");
 int invpcid_works = 0;
 SYSCTL_INT(_vm_pmap, OID_AUTO, invpcid_works, CTLFLAG_RD, &invpcid_works, 0,
     "Is the invpcid instruction available ?");

Modified: head/sys/amd64/amd64/sys_machdep.c
==============================================================================
--- head/sys/amd64/amd64/sys_machdep.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/amd64/amd64/sys_machdep.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -73,7 +73,6 @@ static void
 max_ldt_segment_init(void *arg __unused)
 {
 
-	TUNABLE_INT_FETCH("machdep.max_ldt_segment", &max_ldt_segment);
 	if (max_ldt_segment <= 0)
 		max_ldt_segment = 1;
 	if (max_ldt_segment > MAX_LD)

Modified: head/sys/amd64/amd64/trap.c
==============================================================================
--- head/sys/amd64/amd64/trap.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/amd64/amd64/trap.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -143,20 +143,18 @@ static char *trap_msg[] = {
 
 #ifdef KDB
 static int kdb_on_nmi = 1;
-SYSCTL_INT(_machdep, OID_AUTO, kdb_on_nmi, CTLFLAG_RW,
+SYSCTL_INT(_machdep, OID_AUTO, kdb_on_nmi, CTLFLAG_RWTUN,
 	&kdb_on_nmi, 0, "Go to KDB on NMI");
-TUNABLE_INT("machdep.kdb_on_nmi", &kdb_on_nmi);
 #endif
 static int panic_on_nmi = 1;
-SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RW,
+SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RWTUN,
 	&panic_on_nmi, 0, "Panic on NMI");
-TUNABLE_INT("machdep.panic_on_nmi", &panic_on_nmi);
 static int prot_fault_translation;
-SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RW,
+SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RWTUN,
     &prot_fault_translation, 0,
     "Select signal to deliver on protection fault");
 static int uprintf_signal;
-SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RW,
+SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RWTUN,
     &uprintf_signal, 0,
     "Print debugging information on trap signal to ctty");
 

Modified: head/sys/amd64/pci/pci_cfgreg.c
==============================================================================
--- head/sys/amd64/pci/pci_cfgreg.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/amd64/pci/pci_cfgreg.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -65,7 +65,6 @@ static int pcie_minbus, pcie_maxbus;
 static uint32_t pcie_badslots;
 static struct mtx pcicfg_mtx;
 static int mcfg_enable = 1;
-TUNABLE_INT("hw.pci.mcfg", &mcfg_enable);
 SYSCTL_INT(_hw_pci, OID_AUTO, mcfg, CTLFLAG_RDTUN, &mcfg_enable, 0,
     "Enable support for PCI-e memory mapped config access");
 

Modified: head/sys/amd64/vmm/vmm.c
==============================================================================
--- head/sys/amd64/vmm/vmm.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/amd64/vmm/vmm.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -199,7 +199,6 @@ SYSCTL_NODE(_hw, OID_AUTO, vmm, CTLFLAG_
  * interrupts disabled.
  */
 static int halt_detection_enabled = 1;
-TUNABLE_INT("hw.vmm.halt_detection", &halt_detection_enabled);
 SYSCTL_INT(_hw_vmm, OID_AUTO, halt_detection, CTLFLAG_RDTUN,
     &halt_detection_enabled, 0,
     "Halt VM if all vcpus execute HLT with interrupts disabled");

Modified: head/sys/arm/arm/busdma_machdep-v6.c
==============================================================================
--- head/sys/arm/arm/busdma_machdep-v6.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/arm/arm/busdma_machdep-v6.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -224,10 +224,10 @@ busdma_init(void *dummy)
 /*
  * This init historically used SI_SUB_VM, but now the init code requires
  * malloc(9) using M_DEVBUF memory, which is set up later than SI_SUB_VM, by
- * SI_SUB_KMEM and SI_ORDER_SECOND, so we'll go right after that by using
- * SI_SUB_KMEM and SI_ORDER_THIRD.
+ * SI_SUB_KMEM and SI_ORDER_THIRD, so we'll go right after that by using
+ * SI_SUB_KMEM and SI_ORDER_FOURTH.
  */
-SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_THIRD, busdma_init, NULL);
+SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_FOURTH, busdma_init, NULL);
 
 static __inline int
 _bus_dma_can_bounce(vm_offset_t lowaddr, vm_offset_t highaddr)

Modified: head/sys/arm/arm/busdma_machdep.c
==============================================================================
--- head/sys/arm/arm/busdma_machdep.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/arm/arm/busdma_machdep.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -276,10 +276,10 @@ busdma_init(void *dummy)
 /*
  * This init historically used SI_SUB_VM, but now the init code requires
  * malloc(9) using M_DEVBUF memory, which is set up later than SI_SUB_VM, by
- * SI_SUB_KMEM and SI_ORDER_SECOND, so we'll go right after that by using
- * SI_SUB_KMEM and SI_ORDER_THIRD.
+ * SI_SUB_KMEM and SI_ORDER_THIRD, so we'll go right after that by using
+ * SI_SUB_KMEM and SI_ORDER_FOURTH.
  */
-SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_THIRD, busdma_init, NULL);
+SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_FOURTH, busdma_init, NULL);
 
 /*
  * End block of code useful to transplant to other implementations.

Modified: head/sys/arm/arm/dump_machdep.c
==============================================================================
--- head/sys/arm/arm/dump_machdep.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/arm/arm/dump_machdep.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -50,8 +50,7 @@ __FBSDID("$FreeBSD$");
 CTASSERT(sizeof(struct kerneldumpheader) == 512);
 
 int do_minidump = 1;
-TUNABLE_INT("debug.minidump", &do_minidump);
-SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RW, &do_minidump, 0,
+SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RWTUN, &do_minidump, 0,
     "Enable mini crash dumps");
 
 /*

Modified: head/sys/arm/arm/platform.c
==============================================================================
--- head/sys/arm/arm/platform.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/arm/arm/platform.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -65,8 +65,8 @@ static platform_t	plat_obj;
 static struct kobj_ops	plat_kernel_kops;
 static struct platform_kobj	plat_kernel_obj;
 
-static char plat_name[64] = "";
-SYSCTL_STRING(_hw, OID_AUTO, platform, CTLFLAG_RDTUN, plat_name, 0,
+static char plat_name[64];
+SYSCTL_STRING(_hw, OID_AUTO, platform, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, plat_name, 0,
     "Platform currently in use");
 
 /*

Modified: head/sys/arm/arm/pmap-v6.c
==============================================================================
--- head/sys/arm/arm/pmap-v6.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/arm/arm/pmap-v6.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -465,7 +465,7 @@ static SYSCTL_NODE(_vm, OID_AUTO, pmap, 
 
 /* Superpages utilization enabled = 1 / disabled = 0 */
 static int sp_enabled = 1;
-SYSCTL_INT(_vm_pmap, OID_AUTO, sp_enabled, CTLFLAG_RDTUN, &sp_enabled, 0,
+SYSCTL_INT(_vm_pmap, OID_AUTO, sp_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &sp_enabled, 0,
     "Are large page mappings enabled?");
 
 SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_count, CTLFLAG_RD, &pv_entry_count, 0,

Modified: head/sys/arm/freescale/imx/imx6_anatop.c
==============================================================================
--- head/sys/arm/freescale/imx/imx6_anatop.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/arm/freescale/imx/imx6_anatop.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -375,12 +375,12 @@ cpufreq_initialize(struct imx6_anatop_so
 	    "CPU frequency");
 
 	SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), 
-	    OID_AUTO, "cpu_minmhz", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0,
-	    cpufreq_sysctl_minmhz, "IU", "Minimum CPU frequency");
+	    OID_AUTO, "cpu_minmhz", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH,
+	    sc, 0, cpufreq_sysctl_minmhz, "IU", "Minimum CPU frequency");
 
 	SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
-	    OID_AUTO, "cpu_maxmhz", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0,
-	    cpufreq_sysctl_maxmhz, "IU", "Maximum CPU frequency");
+	    OID_AUTO, "cpu_maxmhz", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH,
+	    sc, 0, cpufreq_sysctl_maxmhz, "IU", "Maximum CPU frequency");
 
 	SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
 	    OID_AUTO, "cpu_maxmhz_hw", CTLFLAG_RD, &sc->cpu_maxmhz_hw, 0, 
@@ -413,9 +413,6 @@ cpufreq_initialize(struct imx6_anatop_so
 	sc->cpu_maxmhz_hw = imx6_ocotp_mhz_tab[cfg3speed];
 	sc->cpu_maxmhz = sc->cpu_maxmhz_hw;
 
-	TUNABLE_INT_FETCH("hw.imx6.cpu_overclock_enable",
-	    &sc->cpu_overclock_enable);
-
 	TUNABLE_INT_FETCH("hw.imx6.cpu_minmhz", &sc->cpu_minmhz);
 	op = cpufreq_nearest_oppt(sc, sc->cpu_minmhz);
 	sc->cpu_minmhz = op->mhz;

Modified: head/sys/arm/xscale/ixp425/if_npe.c
==============================================================================
--- head/sys/arm/xscale/ixp425/if_npe.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/arm/xscale/ixp425/if_npe.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -255,9 +255,8 @@ static SYSCTL_NODE(_hw, OID_AUTO, npe, C
     "IXP4XX NPE driver parameters");
 
 static int npe_debug = 0;
-SYSCTL_INT(_hw_npe, OID_AUTO, debug, CTLFLAG_RW, &npe_debug,
+SYSCTL_INT(_hw_npe, OID_AUTO, debug, CTLFLAG_RWTUN, &npe_debug,
 	   0, "IXP4XX NPE network interface debug msgs");
-TUNABLE_INT("hw.npe.debug", &npe_debug);
 #define	DPRINTF(sc, fmt, ...) do {					\
 	if (sc->sc_debug) device_printf(sc->sc_dev, fmt, __VA_ARGS__);	\
 } while (0)
@@ -265,18 +264,15 @@ TUNABLE_INT("hw.npe.debug", &npe_debug);
 	if (sc->sc_debug >= n) device_printf(sc->sc_dev, fmt, __VA_ARGS__);\
 } while (0)
 static int npe_tickinterval = 3;		/* npe_tick frequency (secs) */
-SYSCTL_INT(_hw_npe, OID_AUTO, tickinterval, CTLFLAG_RD, &npe_tickinterval,
+SYSCTL_INT(_hw_npe, OID_AUTO, tickinterval, CTLFLAG_RDTUN, &npe_tickinterval,
 	    0, "periodic work interval (secs)");
-TUNABLE_INT("hw.npe.tickinterval", &npe_tickinterval);
 
 static	int npe_rxbuf = 64;		/* # rx buffers to allocate */
-SYSCTL_INT(_hw_npe, OID_AUTO, rxbuf, CTLFLAG_RD, &npe_rxbuf,
+SYSCTL_INT(_hw_npe, OID_AUTO, rxbuf, CTLFLAG_RDTUN, &npe_rxbuf,
 	    0, "rx buffers allocated");
-TUNABLE_INT("hw.npe.rxbuf", &npe_rxbuf);
 static	int npe_txbuf = 128;		/* # tx buffers to allocate */
-SYSCTL_INT(_hw_npe, OID_AUTO, txbuf, CTLFLAG_RD, &npe_txbuf,
+SYSCTL_INT(_hw_npe, OID_AUTO, txbuf, CTLFLAG_RDTUN, &npe_txbuf,
 	    0, "tx buffers allocated");
-TUNABLE_INT("hw.npe.txbuf", &npe_txbuf);
 
 static int
 unit2npeid(int unit)

Modified: head/sys/arm/xscale/ixp425/ixp425_npe.c
==============================================================================
--- head/sys/arm/xscale/ixp425/ixp425_npe.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/arm/xscale/ixp425/ixp425_npe.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -181,9 +181,8 @@ typedef struct {
 } IxNpeDlNpeMgrStateInfoBlock;
 
 static int npe_debug = 0;
-SYSCTL_INT(_debug, OID_AUTO, ixp425npe, CTLFLAG_RW, &npe_debug,
+SYSCTL_INT(_debug, OID_AUTO, ixp425npe, CTLFLAG_RWTUN, &npe_debug,
 	   0, "IXP4XX NPE debug msgs");
-TUNABLE_INT("debug.ixp425npe", &npe_debug);
 #define	DPRINTF(dev, fmt, ...) do {					\
 	if (npe_debug) device_printf(dev, fmt, __VA_ARGS__);		\
 } while (0)

Modified: head/sys/arm/xscale/ixp425/ixp425_qmgr.c
==============================================================================
--- head/sys/arm/xscale/ixp425/ixp425_qmgr.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/arm/xscale/ixp425/ixp425_qmgr.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -159,10 +159,9 @@ struct ixpqmgr_softc {
 	uint32_t		aqmFreeSramAddress;	/* SRAM free space */
 };
 
-static int qmgr_debug = 0;
-SYSCTL_INT(_debug, OID_AUTO, qmgr, CTLFLAG_RW, &qmgr_debug,
+static int qmgr_debug;
+SYSCTL_INT(_debug, OID_AUTO, qmgr, CTLFLAG_RWTUN, &qmgr_debug,
 	   0, "IXP4XX Q-Manager debug msgs");
-TUNABLE_INT("debug.qmgr", &qmgr_debug);
 #define	DPRINTF(dev, fmt, ...) do {					\
 	if (qmgr_debug) printf(fmt, __VA_ARGS__);			\
 } while (0)

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cam/ata/ata_da.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -546,30 +546,22 @@ static int ada_write_cache = ADA_DEFAULT
 
 static SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0,
             "CAM Direct Access Disk driver");
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, legacy_aliases, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, legacy_aliases, CTLFLAG_RWTUN,
            &ada_legacy_aliases, 0, "Create legacy-like device aliases");
-TUNABLE_INT("kern.cam.ada.legacy_aliases", &ada_legacy_aliases);
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, retry_count, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, retry_count, CTLFLAG_RWTUN,
            &ada_retry_count, 0, "Normal I/O retry count");
-TUNABLE_INT("kern.cam.ada.retry_count", &ada_retry_count);
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, default_timeout, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, default_timeout, CTLFLAG_RWTUN,
            &ada_default_timeout, 0, "Normal I/O timeout (in seconds)");
-TUNABLE_INT("kern.cam.ada.default_timeout", &ada_default_timeout);
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, send_ordered, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, send_ordered, CTLFLAG_RWTUN,
            &ada_send_ordered, 0, "Send Ordered Tags");
-TUNABLE_INT("kern.cam.ada.send_ordered", &ada_send_ordered);
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_shutdown, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_shutdown, CTLFLAG_RWTUN,
            &ada_spindown_shutdown, 0, "Spin down upon shutdown");
-TUNABLE_INT("kern.cam.ada.spindown_shutdown", &ada_spindown_shutdown);
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_suspend, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, spindown_suspend, CTLFLAG_RWTUN,
            &ada_spindown_suspend, 0, "Spin down upon suspend");
-TUNABLE_INT("kern.cam.ada.spindown_suspend", &ada_spindown_suspend);
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, read_ahead, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, read_ahead, CTLFLAG_RWTUN,
            &ada_read_ahead, 0, "Enable disk read-ahead");
-TUNABLE_INT("kern.cam.ada.read_ahead", &ada_read_ahead);
-SYSCTL_INT(_kern_cam_ada, OID_AUTO, write_cache, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_ada, OID_AUTO, write_cache, CTLFLAG_RWTUN,
            &ada_write_cache, 0, "Enable disk write cache");
-TUNABLE_INT("kern.cam.ada.write_cache", &ada_write_cache);
 
 /*
  * ADA_ORDEREDTAG_INTERVAL determines how often, relative

Modified: head/sys/cam/ata/ata_pmp.c
==============================================================================
--- head/sys/cam/ata/ata_pmp.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cam/ata/ata_pmp.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -139,15 +139,12 @@ static int pmp_hide_special = PMP_DEFAUL
 
 static SYSCTL_NODE(_kern_cam, OID_AUTO, pmp, CTLFLAG_RD, 0,
             "CAM Direct Access Disk driver");
-SYSCTL_INT(_kern_cam_pmp, OID_AUTO, retry_count, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_pmp, OID_AUTO, retry_count, CTLFLAG_RWTUN,
            &pmp_retry_count, 0, "Normal I/O retry count");
-TUNABLE_INT("kern.cam.pmp.retry_count", &pmp_retry_count);
-SYSCTL_INT(_kern_cam_pmp, OID_AUTO, default_timeout, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_pmp, OID_AUTO, default_timeout, CTLFLAG_RWTUN,
            &pmp_default_timeout, 0, "Normal I/O timeout (in seconds)");
-TUNABLE_INT("kern.cam.pmp.default_timeout", &pmp_default_timeout);
-SYSCTL_INT(_kern_cam_pmp, OID_AUTO, hide_special, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_pmp, OID_AUTO, hide_special, CTLFLAG_RWTUN,
            &pmp_hide_special, 0, "Hide extra ports");
-TUNABLE_INT("kern.cam.pmp.hide_special", &pmp_hide_special);
 
 static struct periph_driver pmpdriver =
 {

Modified: head/sys/cam/cam.c
==============================================================================
--- head/sys/cam/cam.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cam/cam.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -116,7 +116,6 @@ SYSCTL_NODE(_kern, OID_AUTO, cam, CTLFLA
 #endif
 
 int cam_sort_io_queues = CAM_DEFAULT_SORT_IO_QUEUES;
-TUNABLE_INT("kern.cam.sort_io_queues", &cam_sort_io_queues);
 SYSCTL_INT(_kern_cam, OID_AUTO, sort_io_queues, CTLFLAG_RWTUN,
     &cam_sort_io_queues, 0, "Sort IO queues to try and optimise disk access patterns");
 #endif

Modified: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cam/cam_xpt.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -149,7 +149,6 @@ typedef int	xpt_pdrvfunc_t (struct perip
 /* Transport layer configuration information */
 static struct xpt_softc xsoftc;
 
-TUNABLE_INT("kern.cam.boot_delay", &xsoftc.boot_delay);
 SYSCTL_INT(_kern_cam, OID_AUTO, boot_delay, CTLFLAG_RDTUN,
            &xsoftc.boot_delay, 0, "Bus registration wait time");
 
@@ -163,7 +162,6 @@ static struct cam_doneq cam_doneqs[MAXCP
 static int cam_num_doneqs;
 static struct proc *cam_proc;
 
-TUNABLE_INT("kern.cam.num_doneqs", &cam_num_doneqs);
 SYSCTL_INT(_kern_cam, OID_AUTO, num_doneqs, CTLFLAG_RDTUN,
            &cam_num_doneqs, 0, "Number of completion queues/threads");
 
@@ -197,12 +195,10 @@ static struct cdevsw xpt_cdevsw = {
 /* Storage for debugging datastructures */
 struct cam_path *cam_dpath;
 u_int32_t cam_dflags = CAM_DEBUG_FLAGS;
-TUNABLE_INT("kern.cam.dflags", &cam_dflags);
-SYSCTL_UINT(_kern_cam, OID_AUTO, dflags, CTLFLAG_RW,
+SYSCTL_UINT(_kern_cam, OID_AUTO, dflags, CTLFLAG_RWTUN,
 	&cam_dflags, 0, "Enabled debug flags");
 u_int32_t cam_debug_delay = CAM_DEBUG_DELAY;
-TUNABLE_INT("kern.cam.debug_delay", &cam_debug_delay);
-SYSCTL_UINT(_kern_cam, OID_AUTO, debug_delay, CTLFLAG_RW,
+SYSCTL_UINT(_kern_cam, OID_AUTO, debug_delay, CTLFLAG_RWTUN,
 	&cam_debug_delay, 0, "Delay in us after each debug message");
 
 /* Our boot-time initialization hook */

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cam/ctl/ctl.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -308,11 +308,9 @@ static int     index_to_aps_page;
 
 SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer");
 static int worker_threads = -1;
-TUNABLE_INT("kern.cam.ctl.worker_threads", &worker_threads);
 SYSCTL_INT(_kern_cam_ctl, OID_AUTO, worker_threads, CTLFLAG_RDTUN,
     &worker_threads, 1, "Number of worker threads");
 static int verbose = 0;
-TUNABLE_INT("kern.cam.ctl.verbose", &verbose);
 SYSCTL_INT(_kern_cam_ctl, OID_AUTO, verbose, CTLFLAG_RWTUN,
     &verbose, 0, "Show SCSI errors returned to initiator");
 

Modified: head/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_block.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cam/ctl/ctl_backend_block.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -220,10 +220,9 @@ struct ctl_be_block_io {
 };
 
 static int cbb_num_threads = 14;
-TUNABLE_INT("kern.cam.ctl.block.num_threads", &cbb_num_threads);
 SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, block, CTLFLAG_RD, 0,
 	    "CAM Target Layer Block Backend");
-SYSCTL_INT(_kern_cam_ctl_block, OID_AUTO, num_threads, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_ctl_block, OID_AUTO, num_threads, CTLFLAG_RWTUN,
            &cbb_num_threads, 0, "Number of threads per backing file");
 
 static struct ctl_be_block_io *ctl_alloc_beio(struct ctl_be_block_softc *softc);

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -85,19 +85,15 @@ static uma_zone_t cfiscsi_data_wait_zone
 SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, iscsi, CTLFLAG_RD, 0,
     "CAM Target Layer iSCSI Frontend");
 static int debug = 3;
-TUNABLE_INT("kern.cam.ctl.iscsi.debug", &debug);
 SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, debug, CTLFLAG_RWTUN,
     &debug, 1, "Enable debug messages");
 static int ping_timeout = 5;
-TUNABLE_INT("kern.cam.ctl.iscsi.ping_timeout", &ping_timeout);
 SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, ping_timeout, CTLFLAG_RWTUN,
     &ping_timeout, 5, "Interval between ping (NOP-Out) requests, in seconds");
 static int login_timeout = 60;
-TUNABLE_INT("kern.cam.ctl.iscsi.login_timeout", &login_timeout);
 SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, login_timeout, CTLFLAG_RWTUN,
     &login_timeout, 60, "Time to wait for ctld(8) to finish Login Phase, in seconds");
 static int maxcmdsn_delta = 256;
-TUNABLE_INT("kern.cam.ctl.iscsi.maxcmdsn_delta", &maxcmdsn_delta);
 SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, maxcmdsn_delta, CTLFLAG_RWTUN,
     &maxcmdsn_delta, 256, "Number of commands the initiator can send "
     "without confirmation");

Modified: head/sys/cam/scsi/scsi_cd.c
==============================================================================
--- head/sys/cam/scsi/scsi_cd.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cam/scsi/scsi_cd.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -277,15 +277,12 @@ static int cd_retry_count = CD_DEFAULT_R
 static int cd_timeout = CD_DEFAULT_TIMEOUT;
 
 static SYSCTL_NODE(_kern_cam, OID_AUTO, cd, CTLFLAG_RD, 0, "CAM CDROM driver");
-SYSCTL_INT(_kern_cam_cd, OID_AUTO, poll_period, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_cd, OID_AUTO, poll_period, CTLFLAG_RWTUN,
            &cd_poll_period, 0, "Media polling period in seconds");
-TUNABLE_INT("kern.cam.cd.poll_period", &cd_poll_period);
-SYSCTL_INT(_kern_cam_cd, OID_AUTO, retry_count, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_cd, OID_AUTO, retry_count, CTLFLAG_RWTUN,
            &cd_retry_count, 0, "Normal I/O retry count");
-TUNABLE_INT("kern.cam.cd.retry_count", &cd_retry_count);
-SYSCTL_INT(_kern_cam_cd, OID_AUTO, timeout, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_cd, OID_AUTO, timeout, CTLFLAG_RWTUN,
 	   &cd_timeout, 0, "Timeout, in us, for read operations");
-TUNABLE_INT("kern.cam.cd.timeout", &cd_timeout);
 
 static MALLOC_DEFINE(M_SCSICD, "scsi_cd", "scsi_cd buffers");
 

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cam/scsi/scsi_da.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -1188,18 +1188,14 @@ static int da_send_ordered = DA_DEFAULT_
 
 static SYSCTL_NODE(_kern_cam, OID_AUTO, da, CTLFLAG_RD, 0,
             "CAM Direct Access Disk driver");
-SYSCTL_INT(_kern_cam_da, OID_AUTO, poll_period, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_da, OID_AUTO, poll_period, CTLFLAG_RWTUN,
            &da_poll_period, 0, "Media polling period in seconds");
-TUNABLE_INT("kern.cam.da.poll_period", &da_poll_period);
-SYSCTL_INT(_kern_cam_da, OID_AUTO, retry_count, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_da, OID_AUTO, retry_count, CTLFLAG_RWTUN,
            &da_retry_count, 0, "Normal I/O retry count");
-TUNABLE_INT("kern.cam.da.retry_count", &da_retry_count);
-SYSCTL_INT(_kern_cam_da, OID_AUTO, default_timeout, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_da, OID_AUTO, default_timeout, CTLFLAG_RWTUN,
            &da_default_timeout, 0, "Normal I/O timeout (in seconds)");
-TUNABLE_INT("kern.cam.da.default_timeout", &da_default_timeout);
-SYSCTL_INT(_kern_cam_da, OID_AUTO, send_ordered, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_da, OID_AUTO, send_ordered, CTLFLAG_RWTUN,
            &da_send_ordered, 0, "Send Ordered Tags");
-TUNABLE_INT("kern.cam.da.send_ordered", &da_send_ordered);
 
 /*
  * DA_ORDEREDTAG_INTERVAL determines how often, relative

Modified: head/sys/cam/scsi/scsi_enc_safte.c
==============================================================================
--- head/sys/cam/scsi/scsi_enc_safte.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cam/scsi/scsi_enc_safte.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -226,9 +226,8 @@ static char *safte_2little = "Too Little
 
 int emulate_array_devices = 1;
 SYSCTL_DECL(_kern_cam_enc);
-SYSCTL_INT(_kern_cam_enc, OID_AUTO, emulate_array_devices, CTLFLAG_RW,
+SYSCTL_INT(_kern_cam_enc, OID_AUTO, emulate_array_devices, CTLFLAG_RWTUN,
            &emulate_array_devices, 0, "Emulate Array Devices for SAF-TE");
-TUNABLE_INT("kern.cam.enc.emulate_array_devices", &emulate_array_devices);
 
 static int
 safte_fill_read_buf_io(enc_softc_t *enc, struct enc_fsm_state *state,

Modified: head/sys/cam/scsi/scsi_sa.c
==============================================================================
--- head/sys/cam/scsi/scsi_sa.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cam/scsi/scsi_sa.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -445,9 +445,10 @@ static int sa_allow_io_split = SA_DEFAUL
  * is bad behavior, because it hides the true tape block size from the
  * application.
  */
-TUNABLE_INT("kern.cam.sa.allow_io_split", &sa_allow_io_split);
 static SYSCTL_NODE(_kern_cam, OID_AUTO, sa, CTLFLAG_RD, 0,
 		  "CAM Sequential Access Tape Driver");
+SYSCTL_INT(_kern_cam_sa, OID_AUTO, allow_io_split, CTLFLAG_RDTUN,
+    &sa_allow_io_split, 0, "Default I/O split value");
 
 static struct periph_driver sadriver =
 {
@@ -1494,7 +1495,7 @@ sasysctlinit(void *context, int pending)
 		goto bailout;
 
 	SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree),
-	    OID_AUTO, "allow_io_split", CTLTYPE_INT | CTLFLAG_RDTUN, 
+	    OID_AUTO, "allow_io_split", CTLTYPE_INT | CTLFLAG_RDTUN | CTLFLAG_NOFETCH, 
 	    &softc->allow_io_split, 0, "Allow Splitting I/O");
 	SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree),
 	    OID_AUTO, "maxio", CTLTYPE_INT | CTLFLAG_RD, 

Modified: head/sys/cam/scsi/scsi_xpt.c
==============================================================================
--- head/sys/cam/scsi/scsi_xpt.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cam/scsi/scsi_xpt.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -78,9 +78,8 @@ struct scsi_quirk_entry {
 #define SCSI_QUIRK(dev)	((struct scsi_quirk_entry *)((dev)->quirk))
 
 static int cam_srch_hi = 0;
-TUNABLE_INT("kern.cam.cam_srch_hi", &cam_srch_hi);
 static int sysctl_cam_search_luns(SYSCTL_HANDLER_ARGS);
-SYSCTL_PROC(_kern_cam, OID_AUTO, cam_srch_hi, CTLTYPE_INT|CTLFLAG_RW, 0, 0,
+SYSCTL_PROC(_kern_cam, OID_AUTO, cam_srch_hi, CTLTYPE_INT | CTLFLAG_RWTUN, 0, 0,
     sysctl_cam_search_luns, "I",
     "allow search above LUN 7 for SCSI3 and greater devices");
 

Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c
==============================================================================
--- head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$");
 
 static MALLOC_DEFINE(M_KSTAT, "kstat_data", "Kernel statistics");
 
-SYSCTL_NODE(, OID_AUTO, kstat, CTLFLAG_RW, 0, "Kernel statistics");
+SYSCTL_ROOT_NODE(OID_AUTO, kstat, CTLFLAG_RW, 0, "Kernel statistics");
 
 kstat_t *
 kstat_create(char *module, int instance, char *name, char *class, uchar_t type,

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -204,8 +204,6 @@ int zfs_arc_shrink_shift = 0;
 int zfs_arc_p_min_shift = 0;
 int zfs_disable_dup_eviction = 0;
 
-TUNABLE_QUAD("vfs.zfs.arc_max", &zfs_arc_max);
-TUNABLE_QUAD("vfs.zfs.arc_min", &zfs_arc_min);
 TUNABLE_QUAD("vfs.zfs.arc_meta_limit", &zfs_arc_meta_limit);
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_max, CTLFLAG_RDTUN, &zfs_arc_max, 0,

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -44,8 +44,7 @@ int zfs_dedup_prefetch = 1;
 
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_NODE(_vfs_zfs, OID_AUTO, dedup, CTLFLAG_RW, 0, "ZFS DEDUP");
-TUNABLE_INT("vfs.zfs.dedup.prefetch", &zfs_dedup_prefetch);
-SYSCTL_INT(_vfs_zfs_dedup, OID_AUTO, prefetch, CTLFLAG_RW, &zfs_dedup_prefetch,
+SYSCTL_INT(_vfs_zfs_dedup, OID_AUTO, prefetch, CTLFLAG_RWTUN, &zfs_dedup_prefetch,
     0, "Enable/disable prefetching of dedup-ed blocks which are going to be freed");
 
 static const ddt_ops_t *ddt_ops[DDT_TYPES] = {

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -54,7 +54,6 @@
  */
 int zfs_nopwrite_enabled = 1;
 SYSCTL_DECL(_vfs_zfs);
-TUNABLE_INT("vfs.zfs.nopwrite_enabled", &zfs_nopwrite_enabled);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, nopwrite_enabled, CTLFLAG_RDTUN,
     &zfs_nopwrite_enabled, 0, "Enable nopwrite feature");
 
@@ -1626,8 +1625,7 @@ dmu_object_set_compress(objset_t *os, ui
 }
 
 int zfs_mdcomp_disable = 0;
-TUNABLE_INT("vfs.zfs.mdcomp_disable", &zfs_mdcomp_disable);
-SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_disable, CTLFLAG_RW,
+SYSCTL_INT(_vfs_zfs, OID_AUTO, mdcomp_disable, CTLFLAG_RWTUN,
     &zfs_mdcomp_disable, 0, "Disable metadata compression");
 
 /*

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -55,16 +55,12 @@ SYSCTL_DECL(_vfs_zfs);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_disable, CTLFLAG_RW,
     &zfs_prefetch_disable, 0, "Disable prefetch");
 SYSCTL_NODE(_vfs_zfs, OID_AUTO, zfetch, CTLFLAG_RW, 0, "ZFS ZFETCH");
-TUNABLE_INT("vfs.zfs.zfetch.max_streams", &zfetch_max_streams);
-SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RW,
+SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RWTUN,
     &zfetch_max_streams, 0, "Max # of streams per zfetch");
-TUNABLE_INT("vfs.zfs.zfetch.min_sec_reap", &zfetch_min_sec_reap);
 SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, min_sec_reap, CTLFLAG_RDTUN,
     &zfetch_min_sec_reap, 0, "Min time before stream reclaim");
-TUNABLE_INT("vfs.zfs.zfetch.block_cap", &zfetch_block_cap);
 SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, block_cap, CTLFLAG_RDTUN,
     &zfetch_block_cap, 0, "Max number of blocks to fetch at a time");
-TUNABLE_QUAD("vfs.zfs.zfetch.array_rd_sz", &zfetch_array_rd_sz);
 SYSCTL_UQUAD(_vfs_zfs_zfetch, OID_AUTO, array_rd_sz, CTLFLAG_RDTUN,
     &zfetch_array_rd_sz, 0,
     "Number of bytes in a array_read at which we stop prefetching");

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -141,23 +141,19 @@ extern int zfs_vdev_async_write_active_m
 
 SYSCTL_DECL(_vfs_zfs);
 
-TUNABLE_QUAD("vfs.zfs.dirty_data_max", &zfs_dirty_data_max);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_max, CTLFLAG_RWTUN,
     &zfs_dirty_data_max, 0,
     "The maximum amount of dirty data in bytes after which new writes are "
     "halted until space becomes available");
 
-TUNABLE_QUAD("vfs.zfs.dirty_data_max_max", &zfs_dirty_data_max_max);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_max_max, CTLFLAG_RDTUN,
     &zfs_dirty_data_max_max, 0,
     "The absolute cap on dirty_data_max when auto calculating");
 
-TUNABLE_INT("vfs.zfs.dirty_data_max_percent", &zfs_dirty_data_max_percent);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, dirty_data_max_percent, CTLFLAG_RDTUN,
     &zfs_dirty_data_max_percent, 0,
     "The percent of physical memory used to auto calculate dirty_data_max");
 
-TUNABLE_QUAD("vfs.zfs.dirty_data_sync", &zfs_dirty_data_sync);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, dirty_data_sync, CTLFLAG_RWTUN,
     &zfs_dirty_data_sync, 0,
     "Force a txg if the number of dirty buffer bytes exceed this value");

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -71,32 +71,23 @@ boolean_t zfs_no_scrub_io = B_FALSE; /* 
 boolean_t zfs_no_scrub_prefetch = B_FALSE; /* set to disable srub prefetching */
 
 SYSCTL_DECL(_vfs_zfs);
-TUNABLE_INT("vfs.zfs.top_maxinflight", &zfs_top_maxinflight);
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, top_maxinflight, CTLFLAG_RW,
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, top_maxinflight, CTLFLAG_RWTUN,
     &zfs_top_maxinflight, 0, "Maximum I/Os per top-level vdev");
-TUNABLE_INT("vfs.zfs.resilver_delay", &zfs_resilver_delay);
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, resilver_delay, CTLFLAG_RW,
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, resilver_delay, CTLFLAG_RWTUN,
     &zfs_resilver_delay, 0, "Number of ticks to delay resilver");
-TUNABLE_INT("vfs.zfs.scrub_delay", &zfs_scrub_delay);
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, scrub_delay, CTLFLAG_RW,
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, scrub_delay, CTLFLAG_RWTUN,
     &zfs_scrub_delay, 0, "Number of ticks to delay scrub");
-TUNABLE_INT("vfs.zfs.scan_idle", &zfs_scan_idle);
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, scan_idle, CTLFLAG_RW,
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, scan_idle, CTLFLAG_RWTUN,
     &zfs_scan_idle, 0, "Idle scan window in clock ticks");
-TUNABLE_INT("vfs.zfs.scan_min_time_ms", &zfs_scan_min_time_ms);
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, scan_min_time_ms, CTLFLAG_RW,
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, scan_min_time_ms, CTLFLAG_RWTUN,
     &zfs_scan_min_time_ms, 0, "Min millisecs to scrub per txg");
-TUNABLE_INT("vfs.zfs.free_min_time_ms", &zfs_free_min_time_ms);
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, free_min_time_ms, CTLFLAG_RW,
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, free_min_time_ms, CTLFLAG_RWTUN,
     &zfs_free_min_time_ms, 0, "Min millisecs to free per txg");
-TUNABLE_INT("vfs.zfs.resilver_min_time_ms", &zfs_resilver_min_time_ms);
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, resilver_min_time_ms, CTLFLAG_RW,
+SYSCTL_UINT(_vfs_zfs, OID_AUTO, resilver_min_time_ms, CTLFLAG_RWTUN,
     &zfs_resilver_min_time_ms, 0, "Min millisecs to resilver per txg");
-TUNABLE_INT("vfs.zfs.no_scrub_io", &zfs_no_scrub_io);
-SYSCTL_INT(_vfs_zfs, OID_AUTO, no_scrub_io, CTLFLAG_RW,
+SYSCTL_INT(_vfs_zfs, OID_AUTO, no_scrub_io, CTLFLAG_RWTUN,
     &zfs_no_scrub_io, 0, "Disable scrub I/O");
-TUNABLE_INT("vfs.zfs.no_scrub_prefetch", &zfs_no_scrub_prefetch);
-SYSCTL_INT(_vfs_zfs, OID_AUTO, no_scrub_prefetch, CTLFLAG_RW,
+SYSCTL_INT(_vfs_zfs, OID_AUTO, no_scrub_prefetch, CTLFLAG_RWTUN,
     &zfs_no_scrub_prefetch, 0, "Disable scrub prefetching");
 
 enum ddt_class zfs_scrub_ddt_class_max = DDT_CLASS_DUPLICATE;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -55,7 +55,6 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab
 
 uint64_t metaslab_aliquot = 512ULL << 10;
 uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1;	/* force gang blocks */
-TUNABLE_QUAD("vfs.zfs.metaslab.gang_bang", &metaslab_gang_bang);
 SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, gang_bang, CTLFLAG_RWTUN,
     &metaslab_gang_bang, 0,
     "Force gang block allocation for blocks larger than or equal to this value");
@@ -67,7 +66,6 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO,
  * Values should be greater than or equal to 100.
  */
 int zfs_condense_pct = 200;
-TUNABLE_INT("vfs.zfs.condense_pct", &zfs_condense_pct);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, condense_pct, CTLFLAG_RWTUN,
     &zfs_condense_pct, 0,
     "Condense on-disk spacemap when it is more than this many percents"
@@ -87,7 +85,6 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, condense_
  * no metaslab group will be excluded based on this criterion.
  */
 int zfs_mg_noalloc_threshold = 0;
-TUNABLE_INT("vfs.zfs.mg_noalloc_threshold", &zfs_mg_noalloc_threshold);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_noalloc_threshold, CTLFLAG_RWTUN,
     &zfs_mg_noalloc_threshold, 0,
     "Percentage of metaslab group size that should be free"
@@ -97,7 +94,6 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_noallo
  * When set will load all metaslabs when pool is first opened.
  */
 int metaslab_debug_load = 0;
-TUNABLE_INT("vfs.zfs.metaslab.debug_load", &metaslab_debug_load);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_load, CTLFLAG_RWTUN,
     &metaslab_debug_load, 0,
     "Load all metaslabs when pool is first opened");
@@ -106,7 +102,6 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, 
  * When set will prevent metaslabs from being unloaded.
  */
 int metaslab_debug_unload = 0;
-TUNABLE_INT("vfs.zfs.metaslab.debug_unload", &metaslab_debug_unload);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_unload, CTLFLAG_RWTUN,
     &metaslab_debug_unload, 0,
     "Prevent metaslabs from being unloaded");
@@ -118,8 +113,6 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, 
  * aggressive strategy (i.e search by size rather than offset).
  */
 uint64_t metaslab_df_alloc_threshold = SPA_MAXBLOCKSIZE;
-TUNABLE_QUAD("vfs.zfs.metaslab.df_alloc_threshold",
-    &metaslab_df_alloc_threshold);
 SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, df_alloc_threshold, CTLFLAG_RWTUN,
     &metaslab_df_alloc_threshold, 0,
     "Minimum size which forces the dynamic allocator to change it's allocation strategy");
@@ -131,27 +124,25 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO,
  * switch to using best-fit allocations.
  */
 int metaslab_df_free_pct = 4;
-TUNABLE_INT("vfs.zfs.metaslab.df_free_pct", &metaslab_df_free_pct);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, df_free_pct, CTLFLAG_RWTUN,
     &metaslab_df_free_pct, 0,
-    "The minimum free space, in percent, which must be available in a space map to continue allocations in a first-fit fashion");
+    "The minimum free space, in percent, which must be available in a "
+    "space map to continue allocations in a first-fit fashion");
 
 /*
  * A metaslab is considered "free" if it contains a contiguous
  * segment which is greater than metaslab_min_alloc_size.
  */
 uint64_t metaslab_min_alloc_size = DMU_MAX_ACCESS;
-TUNABLE_QUAD("vfs.zfs.metaslab.min_alloc_size",
-    &metaslab_min_alloc_size);
 SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, min_alloc_size, CTLFLAG_RWTUN,
     &metaslab_min_alloc_size, 0,
-    "A metaslab is considered \"free\" if it contains a contiguous segment which is greater than vfs.zfs.metaslab.min_alloc_size");
+    "A metaslab is considered \"free\" if it contains a contiguous "
+    "segment which is greater than vfs.zfs.metaslab.min_alloc_size");
 
 /*
  * Percentage of all cpus that can be used by the metaslab taskq.
  */
 int metaslab_load_pct = 50;
-TUNABLE_INT("vfs.zfs.metaslab.load_pct", &metaslab_load_pct);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, load_pct, CTLFLAG_RWTUN,
     &metaslab_load_pct, 0,
     "Percentage of cpus that can be used by the metaslab taskq");
@@ -162,7 +153,6 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, 
  * keep it loaded.
  */
 int metaslab_unload_delay = TXG_SIZE * 2;
-TUNABLE_INT("vfs.zfs.metaslab.unload_delay", &metaslab_unload_delay);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, unload_delay, CTLFLAG_RWTUN,
     &metaslab_unload_delay, 0,
     "Number of TXGs that an unused metaslab can be kept in memory");
@@ -173,13 +163,11 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, 
 boolean_t zfs_write_to_degraded = B_FALSE;
 SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_degraded, CTLFLAG_RWTUN,
     &zfs_write_to_degraded, 0, "Allow writing data to degraded vdevs");
-TUNABLE_INT("vfs.zfs.write_to_degraded", &zfs_write_to_degraded);
 
 /*
  * Max number of metaslabs per group to preload.
  */
 int metaslab_preload_limit = SPA_DVAS_PER_BP;
-TUNABLE_INT("vfs.zfs.metaslab.preload_limit", &metaslab_preload_limit);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_limit, CTLFLAG_RWTUN,
     &metaslab_preload_limit, 0,
     "Max number of metaslabs per group to preload");
@@ -188,7 +176,6 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, 
  * Enable/disable preloading of metaslab.
  */
 boolean_t metaslab_preload_enabled = B_TRUE;
-TUNABLE_INT("vfs.zfs.metaslab.preload_enabled", &metaslab_preload_enabled);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_enabled, CTLFLAG_RWTUN,
     &metaslab_preload_enabled, 0,
     "Max number of metaslabs per group to preload");
@@ -197,8 +184,6 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, 
  * Enable/disable additional weight factor for each metaslab.
  */
 boolean_t metaslab_weight_factor_enable = B_FALSE;
-TUNABLE_INT("vfs.zfs.metaslab.weight_factor_enable",
-    &metaslab_weight_factor_enable);
 SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, weight_factor_enable, CTLFLAG_RWTUN,
     &metaslab_weight_factor_enable, 0,
     "Enable additional weight factor for each metaslab");

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -84,8 +84,7 @@
 static int check_hostid = 1;
 
 SYSCTL_DECL(_vfs_zfs);
-TUNABLE_INT("vfs.zfs.check_hostid", &check_hostid);
-SYSCTL_INT(_vfs_zfs, OID_AUTO, check_hostid, CTLFLAG_RW, &check_hostid, 0,
+SYSCTL_INT(_vfs_zfs, OID_AUTO, check_hostid, CTLFLAG_RWTUN, &check_hostid, 0,
     "Check hostid on import?");
 
 /*

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -244,7 +244,6 @@ int zfs_flags = ~(ZFS_DEBUG_DPRINTF | ZF
 int zfs_flags = 0;
 #endif
 SYSCTL_DECL(_debug);
-TUNABLE_INT("debug.zfs_flags", &zfs_flags);
 SYSCTL_INT(_debug, OID_AUTO, zfs_flags, CTLFLAG_RWTUN, &zfs_flags, 0,
     "ZFS debug flags.");
 
@@ -257,7 +256,6 @@ SYSCTL_INT(_debug, OID_AUTO, zfs_flags, 
  */
 int zfs_recover = 0;
 SYSCTL_DECL(_vfs_zfs);
-TUNABLE_INT("vfs.zfs.recover", &zfs_recover);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RDTUN, &zfs_recover, 0,
     "Try to recover from otherwise-fatal errors.");
 
@@ -270,7 +268,6 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, 
  * in a system panic.
  */
 uint64_t zfs_deadman_synctime_ms = 1000000ULL;
-TUNABLE_QUAD("vfs.zfs.deadman_synctime_ms", &zfs_deadman_synctime_ms);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_synctime_ms, CTLFLAG_RDTUN,
     &zfs_deadman_synctime_ms, 0,
     "Stalled ZFS I/O expiration time in milliseconds");
@@ -280,7 +277,6 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman
  * for hung I/O.
  */
 uint64_t zfs_deadman_checktime_ms = 5000ULL;
-TUNABLE_QUAD("vfs.zfs.deadman_checktime_ms", &zfs_deadman_checktime_ms);
 SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_checktime_ms, CTLFLAG_RDTUN,
     &zfs_deadman_checktime_ms, 0,
     "Period of checks for stalled ZFS I/O in milliseconds");
@@ -290,7 +286,6 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman
  * zfs_deadman_init()
  */
 int zfs_deadman_enabled = -1;
-TUNABLE_INT("vfs.zfs.deadman_enabled", &zfs_deadman_enabled);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_enabled, CTLFLAG_RDTUN,
     &zfs_deadman_enabled, 0, "Kernel panic on stalled ZFS I/O");
 
@@ -304,7 +299,6 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_e
  *     (VDEV_RAIDZ_MAXPARITY + 1) * SPA_DVAS_PER_BP * 2 == 24
  */
 int spa_asize_inflation = 24;
-TUNABLE_INT("vfs.zfs.spa_asize_inflation", &spa_asize_inflation);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_asize_inflation, CTLFLAG_RWTUN,
     &spa_asize_inflation, 0, "Worst case inflation factor for single sector writes");
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -85,31 +85,22 @@ static u_int trim_vdev_max_pending = 64;
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_NODE(_vfs_zfs, OID_AUTO, trim, CTLFLAG_RD, 0, "ZFS TRIM");
 
-TUNABLE_INT("vfs.zfs.trim.txg_delay", &trim_txg_delay);
 SYSCTL_UINT(_vfs_zfs_trim, OID_AUTO, txg_delay, CTLFLAG_RWTUN, &trim_txg_delay,
     0, "Delay TRIMs by up to this many TXGs");
-
-TUNABLE_INT("vfs.zfs.trim.timeout", &trim_timeout);
 SYSCTL_UINT(_vfs_zfs_trim, OID_AUTO, timeout, CTLFLAG_RWTUN, &trim_timeout, 0,
     "Delay TRIMs by up to this many seconds");
-
-TUNABLE_INT("vfs.zfs.trim.max_interval", &trim_max_interval);
 SYSCTL_UINT(_vfs_zfs_trim, OID_AUTO, max_interval, CTLFLAG_RWTUN,
     &trim_max_interval, 0,
     "Maximum interval between TRIM queue processing (seconds)");
 
 SYSCTL_DECL(_vfs_zfs_vdev);
-TUNABLE_QUAD("vfs.zfs.vdev.trim_max_bytes", &trim_vdev_max_bytes);
 SYSCTL_QUAD(_vfs_zfs_vdev, OID_AUTO, trim_max_bytes, CTLFLAG_RWTUN,
     &trim_vdev_max_bytes, 0,
     "Maximum pending TRIM bytes for a vdev");
-
-TUNABLE_INT("vfs.zfs.vdev.trim_max_pending", &trim_vdev_max_pending);
 SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, trim_max_pending, CTLFLAG_RWTUN,
     &trim_vdev_max_pending, 0,
     "Maximum pending TRIM segments for a vdev");
 
-
 static void trim_map_vdev_commit_done(spa_t *spa, vdev_t *vd);
 
 static int

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -112,8 +112,7 @@ int zfs_txg_timeout = 5;	/* max seconds 
 
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_NODE(_vfs_zfs, OID_AUTO, txg, CTLFLAG_RW, 0, "ZFS TXG");
-TUNABLE_INT("vfs.zfs.txg.timeout", &zfs_txg_timeout);
-SYSCTL_INT(_vfs_zfs_txg, OID_AUTO, timeout, CTLFLAG_RW, &zfs_txg_timeout, 0,
+SYSCTL_INT(_vfs_zfs_txg, OID_AUTO, timeout, CTLFLAG_RWTUN, &zfs_txg_timeout, 0,
     "Maximum seconds worth of delta per txg");
 
 /*

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -90,13 +90,10 @@ int zfs_vdev_cache_bshift = 16;
 
 SYSCTL_DECL(_vfs_zfs_vdev);
 SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, cache, CTLFLAG_RW, 0, "ZFS VDEV Cache");
-TUNABLE_INT("vfs.zfs.vdev.cache.max", &zfs_vdev_cache_max);
 SYSCTL_INT(_vfs_zfs_vdev_cache, OID_AUTO, max, CTLFLAG_RDTUN,
     &zfs_vdev_cache_max, 0, "Maximum I/O request size that increase read size");
-TUNABLE_INT("vfs.zfs.vdev.cache.size", &zfs_vdev_cache_size);
 SYSCTL_INT(_vfs_zfs_vdev_cache, OID_AUTO, size, CTLFLAG_RDTUN,
     &zfs_vdev_cache_size, 0, "Size of VDEV cache");
-TUNABLE_INT("vfs.zfs.vdev.cache.bshift", &zfs_vdev_cache_bshift);
 SYSCTL_INT(_vfs_zfs_vdev_cache, OID_AUTO, bshift, CTLFLAG_RDTUN,
     &zfs_vdev_cache_bshift, 0, "Turn too small requests into 1 << this value");
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -53,14 +53,12 @@ DECLARE_GEOM_CLASS(zfs_vdev_class, zfs_v
 
 SYSCTL_DECL(_vfs_zfs_vdev);
 /* Don't send BIO_FLUSH. */
-static int vdev_geom_bio_flush_disable = 0;
-TUNABLE_INT("vfs.zfs.vdev.bio_flush_disable", &vdev_geom_bio_flush_disable);
-SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_flush_disable, CTLFLAG_RW,
+static int vdev_geom_bio_flush_disable;
+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_flush_disable, CTLFLAG_RWTUN,
     &vdev_geom_bio_flush_disable, 0, "Disable BIO_FLUSH");
 /* Don't send BIO_DELETE. */
-static int vdev_geom_bio_delete_disable = 0;
-TUNABLE_INT("vfs.zfs.vdev.bio_delete_disable", &vdev_geom_bio_delete_disable);
-SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_delete_disable, CTLFLAG_RW,
+static int vdev_geom_bio_delete_disable;
+SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_delete_disable, CTLFLAG_RWTUN,
     &vdev_geom_bio_delete_disable, 0, "Disable BIO_DELETE");
 
 static void

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -74,32 +74,26 @@ static SYSCTL_NODE(_vfs_zfs_vdev, OID_AU
 
 /* Rotating media load calculation configuration. */
 static int rotating_inc = 0;
-TUNABLE_INT("vfs.zfs.vdev.mirror.rotating_inc", &rotating_inc);
-SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_inc, CTLFLAG_RW,
+SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_inc, CTLFLAG_RWTUN,
     &rotating_inc, 0, "Rotating media load increment for non-seeking I/O's");
 
 static int rotating_seek_inc = 5;
-TUNABLE_INT("vfs.zfs.vdev.mirror.rotating_seek_inc", &rotating_seek_inc);
-SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_inc, CTLFLAG_RW,
+SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_inc, CTLFLAG_RWTUN,
     &rotating_seek_inc, 0, "Rotating media load increment for seeking I/O's");
 
 static int rotating_seek_offset = 1 * 1024 * 1024;
-TUNABLE_INT("vfs.zfs.vdev.mirror.rotating_seek_offset", &rotating_seek_offset);
-SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_offset, CTLFLAG_RW,
+SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, rotating_seek_offset, CTLFLAG_RWTUN,
     &rotating_seek_offset, 0, "Offset in bytes from the last I/O which "
     "triggers a reduced rotating media seek increment");
 
 /* Non-rotating media load calculation configuration. */
 static int non_rotating_inc = 0;
-TUNABLE_INT("vfs.zfs.vdev.mirror.non_rotating_inc", &non_rotating_inc);
-SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_inc, CTLFLAG_RW,
+SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_inc, CTLFLAG_RWTUN,
     &non_rotating_inc, 0,
     "Non-rotating media load increment for non-seeking I/O's");
 
 static int non_rotating_seek_inc = 1;
-TUNABLE_INT("vfs.zfs.vdev.mirror.non_rotating_seek_inc",
-     &non_rotating_seek_inc);
-SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_seek_inc, CTLFLAG_RW,
+SYSCTL_INT(_vfs_zfs_vdev_mirror, OID_AUTO, non_rotating_seek_inc, CTLFLAG_RWTUN,
     &non_rotating_seek_inc, 0,
     "Non-rotating media load increment for seeking I/O's");
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c	Sat Jun 28 00:01:18 2014	(r267991)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c	Sat Jun 28 03:56:17 2014	(r267992)
@@ -176,23 +176,18 @@ int zfs_vdev_write_gap_limit = 4 << 10;
 
 #ifdef __FreeBSD__
 SYSCTL_DECL(_vfs_zfs_vdev);
-TUNABLE_INT("vfs.zfs.vdev.max_active", &zfs_vdev_max_active);
-SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, max_active, CTLFLAG_RW,
+SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, max_active, CTLFLAG_RWTUN,
     &zfs_vdev_max_active, 0,

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 28 03:59:05 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1C7C2201;
 Sat, 28 Jun 2014 03:59:05 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 099092D5C;
 Sat, 28 Jun 2014 03:59:05 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5S3x4hQ098858;
 Sat, 28 Jun 2014 03:59:04 GMT
 (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5S3x4xV098857;
 Sat, 28 Jun 2014 03:59:04 GMT
 (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201406280359.s5S3x4xV098857@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Sat, 28 Jun 2014 03:59:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r267993 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 28 Jun 2014 03:59:05 -0000

Author: hselasky
Date: Sat Jun 28 03:59:04 2014
New Revision: 267993
URL: http://svnweb.freebsd.org/changeset/base/267993

Log:
  Fix regression issue after r267961. Handle special string case for
  SYSCTLs like previously.
  
  MFC after:	2 weeks
  Reported by:	several people

Modified:
  head/sys/kern/kern_sysctl.c

Modified: head/sys/kern/kern_sysctl.c
==============================================================================
--- head/sys/kern/kern_sysctl.c	Sat Jun 28 03:56:17 2014	(r267992)
+++ head/sys/kern/kern_sysctl.c	Sat Jun 28 03:59:04 2014	(r267993)
@@ -1210,9 +1210,12 @@ sysctl_handle_string(SYSCTL_HANDLER_ARGS
 	size_t outlen;
 	int error = 0;
 
-	/* check for zero-length buffer */
+	/*
+	 * A zero-length buffer indicates a fixed size read-only
+	 * string:
+	 */
 	if (arg2 == 0)
-		return (ENOMEM);
+		arg2 = strlen((char *)arg1) + 1;
 
 	if (req->oldptr != NULL) {
 		char *tmparg;

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 28 04:01:52 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 45E9B48F;
 Sat, 28 Jun 2014 04:01:52 +0000 (UTC)
Received: from mail.turbocat.net (mail.turbocat.net
 [IPv6:2a01:4f8:d16:4514::2])
 (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 044612DEF;
 Sat, 28 Jun 2014 04:01:52 +0000 (UTC)
Received: from laptop015.home.selasky.org
 (cm-176.74.213.204.customer.telag.net [176.74.213.204])
 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits))
 (No client certificate requested)
 by mail.turbocat.net (Postfix) with ESMTPSA id 85E1D1FE02D;
 Sat, 28 Jun 2014 06:01:50 +0200 (CEST)
Message-ID: <53AE3E42.7050606@selasky.org>
Date: Sat, 28 Jun 2014 06:02:10 +0200
From: Hans Petter Selasky 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:24.0) Gecko/20100101 Thunderbird/24.1.0
MIME-Version: 1.0
To: Mateusz Guzik , Ed Maste 
Subject: Re: svn commit: r267961 - in head/sys: amd64/acpica amd64/amd64
 amd64/pci
 amd64/vmm arm/arm arm/freescale/imx arm/xscale/ixp425 cam cam/ata cam/ctl
 cam/scsi cddl/compat/opensolaris/kern cddl/contrib/op...
References: <201406271633.s5RGXih6076565@svn.freebsd.org>
 
 <20140627201907.GC22501@dft-labs.eu>
In-Reply-To: <20140627201907.GC22501@dft-labs.eu>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 28 Jun 2014 04:01:52 -0000

On 06/27/14 22:19, Mateusz Guzik wrote:
> On Fri, Jun 27, 2014 at 03:27:30PM -0400, Ed Maste wrote:
>> On 27 June 2014 12:33, Hans Petter Selasky  wrote:
>>> Author: hselasky
>>> Date: Fri Jun 27 16:33:43 2014
>>> New Revision: 267961
>>> URL: http://svnweb.freebsd.org/changeset/base/267961
>>
>> At r267969 sysctl strings are broken for me:
>>
>> # uname -a
>> uname: sysctl: Cannot allocate memory
>> # sysctl kern.ostype
>> #
>>
>
> The problem was with (arg2 == 0) check.
>
> I have a hack which restores things for me, but since the check was put
> in place just removing it may not be the correct approach.
>
> That said, I would suggest reverting the change for the time being until
> it is concluded what is the correct thing to do here.

Hi,

Issue should be fixed in "r267993". If there are more issues let me know 
and I'll fix!

Again, sorry about the breakage.

--HPS

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 28 05:13:00 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5C0A3F67;
 Sat, 28 Jun 2014 05:13:00 +0000 (UTC)
Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 731932428;
 Sat, 28 Jun 2014 05:12:59 +0000 (UTC)
Received: from nargothrond.kdm.org (localhost [127.0.0.1])
 by nargothrond.kdm.org (8.14.9/8.14.2) with ESMTP id s5S5Cv1O059118;
 Fri, 27 Jun 2014 23:12:57 -0600 (MDT)
 (envelope-from ken@nargothrond.kdm.org)
Received: (from ken@localhost)
 by nargothrond.kdm.org (8.14.9/8.14.9/Submit) id s5S5CvAT059117;
 Fri, 27 Jun 2014 23:12:57 -0600 (MDT) (envelope-from ken)
Date: Fri, 27 Jun 2014 23:12:57 -0600
From: "Kenneth D. Merry" 
To: Alexander Motin 
Subject: Re: svn commit: r267986 - head/sys/cam/ctl
Message-ID: <20140628051256.GA59101@nargothrond.kdm.org>
References: <201406272228.s5RMSE1o046600@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201406272228.s5RMSE1o046600@svn.freebsd.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 28 Jun 2014 05:13:00 -0000

On Fri, Jun 27, 2014 at 22:28:14 +0000, Alexander Motin wrote:
> Author: mav
> Date: Fri Jun 27 22:28:14 2014
> New Revision: 267986
> URL: http://svnweb.freebsd.org/changeset/base/267986
> 
> Log:
>   Remove odd practice of inverting error codes.
>   
>   -EPERM is equal to ERESTART, returning which from ioctl() handler causes
>   infinite syscall restart.
>   
>   MFC after:	2 weeks

Oops.  Not sure how I left that in there.

I suppose you can tell it was originally written for Linux. :)

Ken
-- 
Kenneth Merry
ken@FreeBSD.ORG

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 28 05:18:04 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 13EF623E;
 Sat, 28 Jun 2014 05:18:04 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 016782447;
 Sat, 28 Jun 2014 05:18:04 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5S5I3FD037802;
 Sat, 28 Jun 2014 05:18:03 GMT (envelope-from mjg@svn.freebsd.org)
Received: (from mjg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5S5I3jt037801;
 Sat, 28 Jun 2014 05:18:03 GMT (envelope-from mjg@svn.freebsd.org)
Message-Id: <201406280518.s5S5I3jt037801@svn.freebsd.org>
From: Mateusz Guzik 
Date: Sat, 28 Jun 2014 05:18:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268000 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 28 Jun 2014 05:18:04 -0000

Author: mjg
Date: Sat Jun 28 05:18:03 2014
New Revision: 268000
URL: http://svnweb.freebsd.org/changeset/base/268000

Log:
  Make sure to always clear p_fd for process getting rid of its filetable.
  
  Filetable can be shared with other processes. Previous code failed to
  clear the pointer for all but the last process getting rid of the table.
  This is mostly cosmetics.
  
  Get rid of 'This should happen earlier' comment. Clearing the pointer in
  this place is fine as consumers can reliably check for files availability
  by inspecting fd_refcnt and vnodes availabity by NULL-checking them.
  
  MFC after:	1 week

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Sat Jun 28 04:32:42 2014	(r267999)
+++ head/sys/kern/kern_descrip.c	Sat Jun 28 05:18:03 2014	(r268000)
@@ -2003,6 +2003,11 @@ fdescfree(struct thread *td)
 		if (fdtol != NULL)
 			free(fdtol, M_FILEDESC_TO_LEADER);
 	}
+
+	mtx_lock(&fdesc_mtx);
+	td->td_proc->p_fd = NULL;
+	mtx_unlock(&fdesc_mtx);
+
 	FILEDESC_XLOCK(fdp);
 	i = --fdp->fd_refcnt;
 	FILEDESC_XUNLOCK(fdp);
@@ -2020,11 +2025,6 @@ fdescfree(struct thread *td)
 	}
 	FILEDESC_XLOCK(fdp);
 
-	/* XXX This should happen earlier. */
-	mtx_lock(&fdesc_mtx);
-	td->td_proc->p_fd = NULL;
-	mtx_unlock(&fdesc_mtx);
-
 	if (fdp->fd_nfiles > NDFILE)
 		free(fdp->fd_ofiles, M_FILEDESC);
 	if (NDSLOTS(fdp->fd_nfiles) > NDSLOTS(NDFILE))

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 28 05:41:55 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1C3A19FC;
 Sat, 28 Jun 2014 05:41:55 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E26AF262F;
 Sat, 28 Jun 2014 05:41:54 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5S5fsYE050132;
 Sat, 28 Jun 2014 05:41:54 GMT (envelope-from mjg@svn.freebsd.org)
Received: (from mjg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5S5fsr7050128;
 Sat, 28 Jun 2014 05:41:54 GMT (envelope-from mjg@svn.freebsd.org)
Message-Id: <201406280541.s5S5fsr7050128@svn.freebsd.org>
From: Mateusz Guzik 
Date: Sat, 28 Jun 2014 05:41:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268001 - in head/sys: kern sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 28 Jun 2014 05:41:55 -0000

Author: mjg
Date: Sat Jun 28 05:41:53 2014
New Revision: 268001
URL: http://svnweb.freebsd.org/changeset/base/268001

Log:
  Make fdunshare accept only td parameter.
  
  Proc had to match the thread anyway and 2 parameters were inconsistent
  with the rest.
  
  MFC after:	1 week

Modified:
  head/sys/kern/kern_descrip.c
  head/sys/kern/kern_exec.c
  head/sys/kern/kern_fork.c
  head/sys/sys/filedesc.h

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Sat Jun 28 05:18:03 2014	(r268000)
+++ head/sys/kern/kern_descrip.c	Sat Jun 28 05:41:53 2014	(r268001)
@@ -1850,9 +1850,10 @@ fdshare(struct filedesc *fdp)
  * Unshare a filedesc structure, if necessary by making a copy
  */
 void
-fdunshare(struct proc *p, struct thread *td)
+fdunshare(struct thread *td)
 {
 	struct filedesc *tmp;
+	struct proc *p = td->td_proc;
 
 	if (p->p_fd->fd_refcnt == 1)
 		return;

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c	Sat Jun 28 05:18:03 2014	(r268000)
+++ head/sys/kern/kern_exec.c	Sat Jun 28 05:41:53 2014	(r268001)
@@ -594,7 +594,7 @@ interpret:
 	 * For security and other reasons, the file descriptor table cannot
 	 * be shared after an exec.
 	 */
-	fdunshare(p, td);
+	fdunshare(td);
 
 	/*
 	 * Malloc things before we need locks.

Modified: head/sys/kern/kern_fork.c
==============================================================================
--- head/sys/kern/kern_fork.c	Sat Jun 28 05:18:03 2014	(r268000)
+++ head/sys/kern/kern_fork.c	Sat Jun 28 05:41:53 2014	(r268001)
@@ -341,8 +341,8 @@ fork_norfproc(struct thread *td, int fla
 	/*
 	 * Unshare file descriptors (from parent).
 	 */
-	if (flags & RFFDG) 
-		fdunshare(p1, td);
+	if (flags & RFFDG)
+		fdunshare(td);
 
 fail:
 	if (((p1->p_flag & (P_HADTHREADS|P_SYSTEM)) == P_HADTHREADS) &&

Modified: head/sys/sys/filedesc.h
==============================================================================
--- head/sys/sys/filedesc.h	Sat Jun 28 05:18:03 2014	(r268000)
+++ head/sys/sys/filedesc.h	Sat Jun 28 05:41:53 2014	(r268001)
@@ -152,7 +152,7 @@ int	fdcheckstd(struct thread *td);
 void	fdclose(struct filedesc *fdp, struct file *fp, int idx, struct thread *td);
 void	fdcloseexec(struct thread *td);
 struct	filedesc *fdcopy(struct filedesc *fdp);
-void	fdunshare(struct proc *p, struct thread *td);
+void	fdunshare(struct thread *td);
 void	fdescfree(struct thread *td);
 struct	filedesc *fdinit(struct filedesc *fdp);
 struct	filedesc *fdshare(struct filedesc *fdp);

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 28 05:51:45 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 977BDC98;
 Sat, 28 Jun 2014 05:51:45 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8534626CA;
 Sat, 28 Jun 2014 05:51:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5S5pjbx054547;
 Sat, 28 Jun 2014 05:51:45 GMT (envelope-from mjg@svn.freebsd.org)
Received: (from mjg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5S5pjAr054546;
 Sat, 28 Jun 2014 05:51:45 GMT (envelope-from mjg@svn.freebsd.org)
Message-Id: <201406280551.s5S5pjAr054546@svn.freebsd.org>
From: Mateusz Guzik 
Date: Sat, 28 Jun 2014 05:51:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268002 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 28 Jun 2014 05:51:45 -0000

Author: mjg
Date: Sat Jun 28 05:51:45 2014
New Revision: 268002
URL: http://svnweb.freebsd.org/changeset/base/268002

Log:
  Call fdcloseexec right after fdunshare.
  
  No functional changes.
  
  MFC after:	1 week

Modified:
  head/sys/kern/kern_exec.c

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c	Sat Jun 28 05:41:53 2014	(r268001)
+++ head/sys/kern/kern_exec.c	Sat Jun 28 05:51:45 2014	(r268002)
@@ -595,6 +595,8 @@ interpret:
 	 * be shared after an exec.
 	 */
 	fdunshare(td);
+	/* close files on exec */
+	fdcloseexec(td);
 
 	/*
 	 * Malloc things before we need locks.
@@ -608,8 +610,6 @@ interpret:
 		bcopy(imgp->args->begin_argv, newargs->ar_args, i);
 	}
 
-	/* close files on exec */
-	fdcloseexec(td);
 	vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
 
 	/* Get a reference to the vnode prior to locking the proc */

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 28 07:24:40 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 82F2033C;
 Sat, 28 Jun 2014 07:24:40 +0000 (UTC)
Received: from extdelivery1.dodo.com.au (extdelivery1.dodo.com.au
 [123.2.6.232]) by mx1.freebsd.org (Postfix) with ESMTP id 0EDE52D0A;
 Sat, 28 Jun 2014 07:24:39 +0000 (UTC)
Received: from extspam2.internal (extspam2.internal [10.20.4.19])
 by extdelivery1.dodo.com.au (Postfix) with ESMTP id 590152069C;
 Sat, 28 Jun 2014 17:24:37 +1000 (EST)
Received: from extrelay0.dodo.com.au (extrelay0.internal [10.20.4.23])
 by extspam2.internal (Postfix) with ESMTP id 3BBDA232D3;
 Sat, 28 Jun 2014 17:23:59 +1000 (EST)
Received: from etaplex.bde.org (unknown [139.218.225.48])
 by extrelay0.dodo.com.au (Postfix) with ESMTPS id 139C420C82;
 Sat, 28 Jun 2014 17:23:57 +1000 (EST)
Date: Sat, 28 Jun 2014 17:24:02 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@etaplex.bde.org
To: "Kenneth D. Merry" 
Subject: Re: svn commit: r254627 - in head: bin/chflags bin/ls lib/libc/gen
 lib/libc/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/msdosfs
 sys/fs/smbfs sys/sys sys/ufs/ufs
In-Reply-To: <20140627195201.GA52113@nargothrond.kdm.org>
Message-ID: <20140628165434.A1406@etaplex.bde.org>
References: <201308212304.r7LN4mr6058450@svn.freebsd.org>
 
 <20140627195201.GA52113@nargothrond.kdm.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Dodo-MailScanner-ID: 3BBDA232D3.83B5A
X-Dodo-MailScanner: Found to be clean
X-Dodo-MailScanner-From: brde@optusnet.com.au
X-Spam-Status: No
Cc: "svn-src-head@freebsd.org" ,
 Craig Rodrigues ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" ,
 Xin LI 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 28 Jun 2014 07:24:40 -0000

On Fri, 27 Jun 2014, Kenneth D. Merry wrote:

> On Fri, Jun 27, 2014 at 12:48:29 -0700, Xin LI wrote:
>> Hi,
>>
>> Craig have hit an interesting issue today, where he tried to 'mv' a file
>> from ZFS dataset to a NFS mount, 'mv' bails out because chflags failed.
>>
>> I think it's probably sensible to have mv ignoring UF_ARCHIVE, and set the
>> flag on the target unconditionally?  i.e.:
>>
>> Index: mv.c
>> ===================================================================
>> --- mv.c (revision 267940)
>> +++ mv.c (working copy)
>> @@ -337,8 +337,8 @@
>>   * on a file that we copied, i.e., that we didn't create.)
>>   */
>>   errno = 0;
>> - if (fchflags(to_fd, sbp->st_flags))
>> - if (errno != EOPNOTSUPP || sbp->st_flags != 0)
>> + if (fchflags(to_fd, sbp->st_flags | UF_ARCHIVE))
>> + if (errno != EOPNOTSUPP || (sbp->st_flags & ~UF_ARCHIVE) != 0)
>>   warn("%s: set flags (was: 0%07o)", to, sbp->st_flags);
>>
>>   tval[0].tv_sec = sbp->st_atime;
>
> Yes, that sounds like a good way to do it.

No, this is very broken.

Ignoring the error is bad enough.  POSIX requires duplicating all of
the attributes and certain error handling when they cannot be
duplicated.  File flags aren't a POSIX attribute, but not duplicating
or handling errors differently for them them breaks the spirit of the
POSIX spec.

Forcing the archive flag to be set on the copy is worse.  It is broken
especially broken  if the source and target both support the archive flag,
since it then fails to preserve the flag when it is clear on the source.

The old code was bad too.  I think it usually gives the POSIX behaviour,
but it only applies to the unusual case where only a few regular files
are moved, and its checking if the preservation worked can be done
better by stat()ing the result and comparing with the original.  The
usual case (by number of files moved, if not by mv instances), is for
moving whole directory heirarchies.  The above code is not used in that
case.  cp -pR is used.  cp -pR is more buggy than the above in general,
but for the chflags() its error handling is less fancy and thus stricter
than the above, so tends to produce thousands or warnings instead of only
1.  More and different details in another reply.

I sent the following mail to ken about this (mostly for cp -p instead of
mv) in April, but received no reply:

old> Copying files on freefall now causes annoying warnings.  This is because
old> zfs supports UF_ARCHIVE but nfs doesn't:
old> 
old> % Script started on Sat Apr  5 05:10:55 2014
old> % pts/29:bde@freefall:~/zmsun> cp -p $l/msun/Makefile .
old> % cp: chflags: ./Makefile: Operation not supported
old> % pts/29:bde@freefall:~/zmsun> echo $?
old> % 1
old> % pts/29:bde@freefall:~/zmsun> ls -lo $l/msun/Makefile Makefile
old> % -rw-r--r--  1 root  wheel  uarch 8610 Mar  2 11:00 /usr/src/lib/msun/Makefile
old> % -rw-r--r--  1 bde   devel  -     8610 Mar  2 11:00 Makefile
old> % pts/29:bde@freefall:~/zmsun> exit
old> % 
old> % Script done on Sat Apr  5 05:11:28 2014
old> 
old> cp works, but this is hard to determine since the exit status is 1.  Oops,
old> that means that cp doesn't work.  It also cannot copy the more important
old> uid and gid, but it doesn't warn about this or change the exit status to
old> 1 for this.  Not warning is a historical hack to keep cp usable.  Not
old> indicating the error in any other way is not good, but is also historical.
old> This is only done when chown() returns EPERM.  For chflags() on nfs, we're
old> getting EOPNOTSUPPORT for the whole syscall.

So cp -pR is completely broken for use by mv for the uid and gid, but works
almost as correctly as possibly for file flags.  POSIX has relaxed
requirements for cp relative to mv, since cp without -p is not required
to preserve any attributes, and cp with -p can't be expected to preserve
all the attributes in many cases, unlike the usual case for mv where it
is not across a file system.

old> The support is useless in practice, at least on freefall, because zfs
old> always sets UF_ARCHIVE and nothing ever clears it.  zfs sets it even
old> for directories and symlinks.
old> 
old> Also, sys/stat.h still has SF_ARCHIVED:
old> 
old> % #define	UF_ARCHIVE	0x00000800	/* file needs to be archived */
old> % #define	SF_ARCHIVED	0x00010000	/* file is archived */
old> 
old> It's not clear what SF_ARCHIVED means, especially since no file system
old> supports it.  The only references to it are:
old> 
old> % ./fs/tmpfs/tmpfs_subr.c:	if ((flags & ~(SF_APPEND | SF_ARCHIVED | SF_IMMUTABLE | SF_NOUNLINK |
old> % ./ufs/ufs/ufs_vnops.c:		if ((vap->va_flags & ~(SF_APPEND | SF_ARCHIVED | SF_IMMUTABLE |
old> 
old> So applications can set this flag for ffs and tmpfs, but since the fs never
old> changes it, it is almost useless.  Perhaps we left it for compatibility
old> in ffs.  tmpfs doesn't have anything to be compatible with.
old> 
old> UF_ARCHIVE and UF_NODUMP are fairly bogus for tmpfs too.  I think all they
old> do is prevent the above error when copying files from fs's that support
old> them.
old> 
old> Bruce

Attributes like file times cannot be preserved in general, and the
checks for this are both too strict and too weak.  Too strict because
it is impossible to preserve file times in general (utimes() cannot
even ask to preserve sub-microsecond resolution.  POSIX file systems
are only required to support seconds resolution.  FreeBSD supports
some non-POSIX file systems that have worse than seconds resolution).
Too weak because it is impossible to ask for strict preservation.
Syscalls silently change times to something that they can represent
or write.  Utilities don't check if the requested settings were
actually made.  They should check, but then there are problems
handling errors and complications configuring the utilities to do
the sloppy preservation that they historically did.  File times are
only a relatively simple unimportant case.

Bruce

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 28 09:53:45 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1271794D;
 Sat, 28 Jun 2014 09:53:45 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id F397A2787;
 Sat, 28 Jun 2014 09:53:44 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5S9riAS067585;
 Sat, 28 Jun 2014 09:53:44 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5S9ri9e067583;
 Sat, 28 Jun 2014 09:53:44 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201406280953.s5S9ri9e067583@svn.freebsd.org>
From: Dimitry Andric 
Date: Sat, 28 Jun 2014 09:53:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268003 - in head/contrib/llvm: lib/Target/PowerPC patches
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 28 Jun 2014 09:53:45 -0000

Author: dim
Date: Sat Jun 28 09:53:44 2014
New Revision: 268003
URL: http://svnweb.freebsd.org/changeset/base/268003

Log:
  Fix breakage after r267981.
  
  Pointy hat to:	dim
  MFC after:	3 days
  X-MFC-With:	r267981

Modified:
  head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp
  head/contrib/llvm/patches/patch-r267981-llvm-r211435-fix-ppc-fctiduz.diff

Modified: head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp
==============================================================================
--- head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp	Sat Jun 28 05:51:45 2014	(r268002)
+++ head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp	Sat Jun 28 09:53:44 2014	(r268003)
@@ -1027,7 +1027,7 @@ bool PPCFastISel::SelectFPToI(const Inst
     return false;
 
   // If we don't have FCTIDUZ and we need it, punt to SelectionDAG.
-  if (DstVT == MVT::i64 && !IsSigned && !PPCSubTarget->hasFPCVT())
+  if (DstVT == MVT::i64 && !IsSigned && !PPCSubTarget.hasFPCVT())
     return false;
 
   Value *Src = I->getOperand(0);

Modified: head/contrib/llvm/patches/patch-r267981-llvm-r211435-fix-ppc-fctiduz.diff
==============================================================================
--- head/contrib/llvm/patches/patch-r267981-llvm-r211435-fix-ppc-fctiduz.diff	Sat Jun 28 05:51:45 2014	(r268002)
+++ head/contrib/llvm/patches/patch-r267981-llvm-r211435-fix-ppc-fctiduz.diff	Sat Jun 28 09:53:44 2014	(r268003)
@@ -32,7 +32,7 @@ Index: lib/Target/PowerPC/PPCFastISel.cp
      return false;
  
 +  // If we don't have FCTIDUZ and we need it, punt to SelectionDAG.
-+  if (DstVT == MVT::i64 && !IsSigned && !PPCSubTarget->hasFPCVT())
++  if (DstVT == MVT::i64 && !IsSigned && !PPCSubTarget.hasFPCVT())
 +    return false;
 +
    Value *Src = I->getOperand(0);

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 28 11:32:03 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3F36C566;
 Sat, 28 Jun 2014 11:32:03 +0000 (UTC)
Received: from extdelivery1.dodo.com.au (extdelivery1.dodo.com.au
 [123.2.6.232]) by mx1.freebsd.org (Postfix) with ESMTP id BF6642F3B;
 Sat, 28 Jun 2014 11:32:02 +0000 (UTC)
Received: from extspam2.internal (extspam2.internal [10.20.4.19])
 by extdelivery1.dodo.com.au (Postfix) with ESMTP id 8B78320A9F;
 Sat, 28 Jun 2014 21:31:59 +1000 (EST)
Received: from extrelay0.dodo.com.au (extrelay0.internal [10.20.4.23])
 by extspam2.internal (Postfix) with ESMTP id 178F22312D;
 Sat, 28 Jun 2014 21:31:31 +1000 (EST)
Received: from etaplex.bde.org (unknown [139.218.225.48])
 by extrelay0.dodo.com.au (Postfix) with ESMTPS id C3734203B3;
 Sat, 28 Jun 2014 21:31:29 +1000 (EST)
Date: Sat, 28 Jun 2014 21:31:19 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@etaplex.bde.org
To: Jilles Tjoelker 
Subject: Re: svn commit: r267977 - head/bin/mv
In-Reply-To: <20140627222323.GA43131@stack.nl>
Message-ID: <20140628172421.U1406@etaplex.bde.org>
References: <201406271957.s5RJvs6j074326@svn.freebsd.org>
 <20140627222323.GA43131@stack.nl>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Dodo-MailScanner-ID: 178F22312D.35A35
X-Dodo-MailScanner: Found to be clean
X-Dodo-MailScanner-From: brde@optusnet.com.au
X-Spam-Status: No
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Xin LI 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 28 Jun 2014 11:32:03 -0000

On Sat, 28 Jun 2014, Jilles Tjoelker wrote:

> On Fri, Jun 27, 2014 at 07:57:54PM +0000, Xin LI wrote:
>> Author: delphij
>
>> Log:
>>   Always set UF_ARCHIVE on target (because they are by definition new files
>>   and should be archived) and ignore error when we can't set it (e.g. NFS).
>
>>   Reviewed by:	ken
>>   MFC after:	2 weeks
>
>> Modified:
>>   head/bin/mv/mv.c
>
>> Modified: head/bin/mv/mv.c
>> ==============================================================================
>> --- head/bin/mv/mv.c	Fri Jun 27 19:50:30 2014	(r267976)
>> +++ head/bin/mv/mv.c	Fri Jun 27 19:57:54 2014	(r267977)
>> @@ -337,8 +337,8 @@ err:		if (unlink(to))
>>  	 * on a file that we copied, i.e., that we didn't create.)
>>  	 */
>>  	errno = 0;
>> -	if (fchflags(to_fd, sbp->st_flags))
>> -		if (errno != EOPNOTSUPP || sbp->st_flags != 0)
>> +	if (fchflags(to_fd, sbp->st_flags | UF_ARCHIVE))
>> +		if (errno != EOPNOTSUPP || ((sbp->st_flags & ~UF_ARCHIVE) != 0))
>>  			warn("%s: set flags (was: 0%07o)", to, sbp->st_flags);
>>
>>  	tval[0].tv_sec = sbp->st_atime;
>
> The part ignoring failures to set UF_ARCHIVE is OK.

No, it is not OK.  The error was only a warning, and that is the best
possible.

> However, it seems
> inconsistent to set UF_ARCHIVE on a cross-filesystem mv of a single
> file, but not on a cross-filesystem mv of a directory tree

It is also inconsistent with within-filesystem mv's in both cases.

> or a file
> newly created via shell output redirection.

The file system should set it in that case, if the file system actually
supports UF_ARCHIVE.

> If UF_ARCHIVE is supposed to be set automatically, I think this should
> be done in the kernel, like msdosfs already does.

zfs sets it too.  That's where the problematic UF_ARCHIVE settings
come from.  The problem was just less visible for msdsofs since it
is less used for critical file systems.

It used to be an even larger problem for msdosfs.  msdosfs's archive
flag was mapped to SF_ARCHIVE instead of to UF_ARCHIVE.  So for mv
or cp -p from msdsofs to msdosfs (or a similar file system), you
could get an EPERM error.  The above hack only checks for
EOPNOTSUPP, so it made no difference.

When the target file system actually supports UF_ARCHIVE, the target
file already has UF_ARCHIVE set because the file is new.  Then the
chflags() is needed mainly to unset UF_ARCHIVE when the source file
doesn't have it set.  The change does the opposite.

The cp -pR case (for mv across file systems and cp itself) never even
had the EOPNOTSUPP hack (except possibly in recent versions which I
can't check now), so it tends to spew errors.  Old versions of cp -p
did the following:

@ 	/*
@ 	 * Changing the ownership probably won't succeed, unless we're root
@ 	 * or POSIX_CHOWN_RESTRICTED is not set.  Set uid/gid before setting
@ 	 * the mode; current BSD behavior is to remove all setuid bits on
@ 	 * chown.  If chown fails, lose setuid/setgid bits.
@ 	 */
@ 	if (!gotstat || fs->st_uid != ts.st_uid || fs->st_gid != ts.st_gid)

This avoids most chown()s by not attempting any.  Good.

@ 		if (fdval ? fchown(fd, fs->st_uid, fs->st_gid) :
@ 		    (islink ? lchown(to.p_path, fs->st_uid, fs->st_gid) :
@ 		    chown(to.p_path, fs->st_uid, fs->st_gid))) {

Here it would be better to stat() the file again and mostly not use the
syscall result.  syscalls that can set multiple attributes should allow
setting subsets and require checking to see which ones were set.
tcsettattr() is such a syscall.  It has the very bad error handling of
returning success if at least 1 attribute was set.  That is bad because
it is fail-unsafe for sloppy callers, and its success is guaranteed
since there are always attributes which can be set to an unchanged
value.  chown() is not such a syscall, but it is safer to check.

See the XXX comment before the above code in mv.  It is about
(mis)handling settable subsets of flags.  Currently there is no
reasonable way, since chflags() is like chown() and has to accept all
of the settings or not change any.

@ 			if (errno != EPERM) {
@ 				warn("chown: %s", to.p_path);
@ 				rval = 1;
@ 			}
@ 			fs->st_mode &= ~(S_ISUID | S_ISGID);
@ 		}
@ 
@ 	if (!gotstat || fs->st_mode != ts.st_mode)
@ 		if (fdval ? fchmod(fd, fs->st_mode) :
@ 		    (islink ? lchmod(to.p_path, fs->st_mode) :
@ 		    chmod(to.p_path, fs->st_mode))) {
@ 			warn("chmod: %s", to.p_path);
@ 			rval = 1;
@ 		}

Similarly for the mode, except not making null changes is closer to
being just an optimization.

Hmm, This order seems to be backwards.  Shouldn't we change the mode
before the ownerships go keep more permission for changing the mode?
We already change file flags last in case an immutable flag will be set.

@ 
@ 	if (!gotstat || fs->st_flags != ts.st_flags)

Avoiding null changes for file flags avoids permissions and support
problems in the usual case where the file flags are 0.  However, for
zfs and now msdosfs, this is now the unusual case -- the source file
flags are usually UF_ARCHIVE.  (For msdosfs, the archive flag used to
be SF_ARCHIVE, but this was inverted so the usual case for a new file
was  mapped to .  But
backing up under WinDOS normally clears the archive flag, so if it
is done then the usual case was  mapped
to .)

@ 		if (fdval ?
@ 		    fchflags(fd, fs->st_flags) :
@ 		    (islink ? (errno = ENOSYS) :
@ 		    chflags(to.p_path, fs->st_flags))) {
@ 			warn("chflags: %s", to.p_path);
@ 			rval = 1;
@ 		}

Note that any error here causes the exit status to be 1, while for
fastcopy() in mv, no fchflags() error causes the exit status to be 1,
and warnings are also suppressed for some EOPNOTSUPP errors.  Very
inconsistent.  fastcopy() also never sets the exit status to 1 for
errors in fchown(), fchmod() or utimes().  The utimes() in it is
also broken by being placed after the fchflags(), so it is certain
to fail if fchflags() set any immutable flag.  cp is careful to
avoid this bug.

POSIX specifies most of this: mv: "If the duplication of the file
characteristics fails for any reason, then mv shall write a diagnostic
message to stderr, but this failure shall not cause mv to modify its
exit status".  cp -p: only duplicating the times, uid, gid and certain
mode bits is required; a diagnostic is required for failure to duplicate
the times or certain mode bits is required; a diagnostic is optional
for failure to duplicate uid or gid; the exit status is not mentioned.
FreeBSD cp -p always modifies the exit status and prints a diagnostic
except for EPERM errors from chown().

For all attributes, modifying the exit status in cp -pR makes FreeBSD
cp -pR unusable for the mv across file systems that it is used for.
cp -pR has other bugs like snapping hard links and not preserving
directory times, but I still trust it more than fastcopy().

> However, I'm not sure
> this is actually a useful feature: backup programs are smarter than an
> archive attribute these days.

I mostly use the ctime to decide which files need backing up, but the
archive bit would have some advantage if backup programs and system
utilities actually supported it.  It can be controlled by utilities,
unlike ctimes.  msdosfs utilities had good support for it 25-30 years
ago (things like an option in all copying utilities to clear the archive
bit in the source after copying, so that all copying utilities can be
used to back up), but I never actually used this until recently.  I
don't see how a backup utility could get equivalent functionality
without maintaining large databases of files backed up and having bits
like the archive bit in the database, and sub-utilities to manage the
bits.

Bruce

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 28 14:58:51 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id DCEA5EF6;
 Sat, 28 Jun 2014 14:58:51 +0000 (UTC)
Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214])
 (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 968A02D41;
 Sat, 28 Jun 2014 14:58:50 +0000 (UTC)
Received: from laptop015.home.selasky.org
 (cm-176.74.213.204.customer.telag.net [176.74.213.204])
 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits))
 (No client certificate requested)
 by mail.turbocat.net (Postfix) with ESMTPSA id 9D39B1FE02D;
 Sat, 28 Jun 2014 16:58:43 +0200 (CEST)
Message-ID: <53AED837.8050702@selasky.org>
Date: Sat, 28 Jun 2014 16:59:03 +0200
From: Hans Petter Selasky 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:24.0) Gecko/20100101 Thunderbird/24.1.0
MIME-Version: 1.0
To: Mateusz Guzik , Ed Maste 
Subject: Re: svn commit: r267961 - in head/sys: amd64/acpica amd64/amd64
 amd64/pci
 amd64/vmm arm/arm arm/freescale/imx arm/xscale/ixp425 cam cam/ata cam/ctl
 cam/scsi cddl/compat/opensolaris/kern cddl/contrib/op...
References: <201406271633.s5RGXih6076565@svn.freebsd.org>
 
 <20140627201907.GC22501@dft-labs.eu> <53AE3E42.7050606@selasky.org>
In-Reply-To: <53AE3E42.7050606@selasky.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 28 Jun 2014 14:58:52 -0000

FYI:

Possibly the sysctl patches will not get MFCed, and be a FreeBSD-11 and 
onwards only feature, even though the commit message states MFC after xxx.

--HPS

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 28 15:26:47 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2E9FA529;
 Sat, 28 Jun 2014 15:26:47 +0000 (UTC)
Received: from smtp-out-05.shaw.ca (smtp-out-05.shaw.ca [64.59.134.13])
 by mx1.freebsd.org (Postfix) with ESMTP id D566F2F40;
 Sat, 28 Jun 2014 15:26:46 +0000 (UTC)
X-Cloudmark-SP-Filtered: true
X-Cloudmark-SP-Result: v=1.1 cv=/MiPqmMwFv6ha2ZBybe0ZU9m+O5sXPp7gEUgHVyRzyY=
 c=1 sm=1
 a=HLOMymIj7kQA:10 a=QrugwKR0C_UA:10 a=wAGQQ9Az6v0A:10 a=BLceEmwcHowA:10
 a=ICAaq7hcmGcA:10 a=kj9zAlcOel0A:10 a=IbtKDeXwb2+SRU442/pi3A==:17
 a=6I5d2MoRAAAA:8 a=BWvPGDcYAAAA:8 a=GvOj0c07uHoBtgSKvRMA:9
 a=CjuIK1q_8ugA:10 a=V7tsTZBp22UA:10 a=SV7veod9ZcQA:10
 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117
Received: from unknown (HELO spqr.komquats.com) ([96.50.7.119])
 by smtp-out-05.shaw.ca with ESMTP; 28 Jun 2014 09:26:40 -0600
Received: from slippy.cwsent.com (slippy [10.1.1.91])
 by spqr.komquats.com (Postfix) with ESMTP id B797E9C79;
 Sat, 28 Jun 2014 08:26:39 -0700 (PDT)
Received: from slippy.cwsent.com (localhost [127.0.0.1])
 by slippy.cwsent.com (8.14.9/8.14.9) with ESMTP id s5SFQcmW013281;
 Sat, 28 Jun 2014 08:26:38 -0700 (PDT)
 (envelope-from Cy.Schubert@komquats.com)
Received: from slippy (cy@localhost)
 by slippy.cwsent.com (8.14.9/8.14.8/Submit) with ESMTP id s5SFQcRZ013277;
 Sat, 28 Jun 2014 08:26:38 -0700 (PDT)
 (envelope-from Cy.Schubert@komquats.com)
Message-Id: <201406281526.s5SFQcRZ013277@slippy.cwsent.com>
X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs
X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6
Reply-to: Cy Schubert 
From: Cy Schubert 
X-os: FreeBSD
X-Sender: cy@cwsent.com
X-URL: http://www.komquats.com/
To: Dimitry Andric 
Subject: Re: svn commit: r268003 - in head/contrib/llvm: lib/Target/PowerPC 
 patches
In-Reply-To: Message from Dimitry Andric  of "Sat,
 28 Jun 2014 09:53:44 -0000." <201406280953.s5S9ri9e067583@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Date: Sat, 28 Jun 2014 08:26:37 -0700
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 28 Jun 2014 15:26:47 -0000

In message <201406280953.s5S9ri9e067583@svn.freebsd.org>, Dimitry Andric 
writes
:
> Author: dim
> Date: Sat Jun 28 09:53:44 2014
> New Revision: 268003
> URL: http://svnweb.freebsd.org/changeset/base/268003
> 
> Log:
>   Fix breakage after r267981.
>   
>   Pointy hat to:	dim
>   MFC after:	3 days
>   X-MFC-With:	r267981
> 
> Modified:
>   head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp
>   head/contrib/llvm/patches/patch-r267981-llvm-r211435-fix-ppc-fctiduz.diff
> 
> Modified: head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp
> =============================================================================
> =
> --- head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp	Sat Jun 28 05:5
> 1:45 2014	(r268002)
> +++ head/contrib/llvm/lib/Target/PowerPC/PPCFastISel.cpp	Sat Jun 28 09:5
> 3:44 2014	(r268003)
> @@ -1027,7 +1027,7 @@ bool PPCFastISel::SelectFPToI(const Inst
>      return false;
>  
>    // If we don't have FCTIDUZ and we need it, punt to SelectionDAG.
> -  if (DstVT == MVT::i64 && !IsSigned && !PPCSubTarget->hasFPCVT())
> +  if (DstVT == MVT::i64 && !IsSigned && !PPCSubTarget.hasFPCVT())
>      return false;
>  
>    Value *Src = I->getOperand(0);
> 
> Modified: head/contrib/llvm/patches/patch-r267981-llvm-r211435-fix-ppc-fctidu
> z.diff
> =============================================================================
> =
> --- head/contrib/llvm/patches/patch-r267981-llvm-r211435-fix-ppc-fctiduz.diff
> 	Sat Jun 28 05:51:45 2014	(r268002)
> +++ head/contrib/llvm/patches/patch-r267981-llvm-r211435-fix-ppc-fctiduz.diff
> 	Sat Jun 28 09:53:44 2014	(r268003)
> @@ -32,7 +32,7 @@ Index: lib/Target/PowerPC/PPCFastISel.cp
>       return false;
>   
>  +  // If we don't have FCTIDUZ and we need it, punt to SelectionDAG.
> -+  if (DstVT == MVT::i64 && !IsSigned && !PPCSubTarget->hasFPCVT())
> ++  if (DstVT == MVT::i64 && !IsSigned && !PPCSubTarget.hasFPCVT())
>  +    return false;
>  +
>     Value *Src = I->getOperand(0);
> 
> 

Thanks.

Looks like they changed PPCSubTarget to a pointer in llvm trunk about five 
weeks ago. :~


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX:     Web:  http://www.FreeBSD.org

	The need of the many outweighs the greed of the few.



From owner-svn-src-head@FreeBSD.ORG  Sat Jun 28 15:53:29 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 23C058B6;
 Sat, 28 Jun 2014 15:53:29 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 10EEF213A;
 Sat, 28 Jun 2014 15:53:29 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5SFrSAF032010;
 Sat, 28 Jun 2014 15:53:28 GMT
 (envelope-from dwmalone@svn.freebsd.org)
Received: (from dwmalone@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5SFrSdh032009;
 Sat, 28 Jun 2014 15:53:28 GMT
 (envelope-from dwmalone@svn.freebsd.org)
Message-Id: <201406281553.s5SFrSdh032009@svn.freebsd.org>
From: David Malone 
Date: Sat, 28 Jun 2014 15:53:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268004 - head/usr.sbin/rwhod
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 28 Jun 2014 15:53:29 -0000

Author: dwmalone
Date: Sat Jun 28 15:53:28 2014
New Revision: 268004
URL: http://svnweb.freebsd.org/changeset/base/268004

Log:
  Don't accidently skip every second line when calculating the
  idle time.
  
  MFC after:	2 weeks

Modified:
  head/usr.sbin/rwhod/rwhod.c

Modified: head/usr.sbin/rwhod/rwhod.c
==============================================================================
--- head/usr.sbin/rwhod/rwhod.c	Sat Jun 28 09:53:44 2014	(r268003)
+++ head/usr.sbin/rwhod/rwhod.c	Sat Jun 28 15:53:28 2014	(r268004)
@@ -488,7 +488,6 @@ sender_process(void)
 		for (we = mywd.wd_we; we < wend; we++) {
 			if (stat(we->we_utmp.out_line, &stb) >= 0)
 				we->we_idle = htonl(now - stb.st_atime);
-			we++;
 		}
 		(void) getloadavg(avenrun,
 		    sizeof(avenrun) / sizeof(avenrun[0]));

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 28 17:36:20 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id DDE0BEA0;
 Sat, 28 Jun 2014 17:36:20 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C90852843;
 Sat, 28 Jun 2014 17:36:20 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5SHaKRx078860;
 Sat, 28 Jun 2014 17:36:20 GMT
 (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5SHaJY8078852;
 Sat, 28 Jun 2014 17:36:19 GMT
 (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201406281736.s5SHaJY8078852@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Sat, 28 Jun 2014 17:36:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268005 - in head/sys: kern
 ofed/drivers/infiniband/ulp/sdp ofed/drivers/net/mlx4 ofed/include/linux
 pc98/pc98 sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 28 Jun 2014 17:36:21 -0000

Author: hselasky
Date: Sat Jun 28 17:36:18 2014
New Revision: 268005
URL: http://svnweb.freebsd.org/changeset/base/268005

Log:
  Compile fixes:
  
  Remove duplicate "debug_ktr.mask" sysctl definition.
  Remove now unused variable from "kern_ktr.c".
  This fixes build of "ktr" which was broken by r267961.
  
  Let the default value for "vm_kmem_size_scale" be zero. It is setup
  after that the sysctl has been initialized from "getenv()" in the
  "kmeminit()" function to equal the "VM_KMEM_SIZE_MAX" value, if
  zero. On Sparc64 the "VM_KMEM_SIZE_MAX" macro is not a constant. This
  fixes build of Sparc64 which was broken by r267961.
  
  Add a special macro to dynamically create SYSCTL root nodes, because
  root nodes have a special parent. This fixes build of existing OFED
  module and CANBUS module for pc98 which was broken by r267961.
  
  Add missing "sysctl.h" includes to get the needed sysctl header file
  declarations. This is needed after r267961.
  
  MFC after:	2 weeks

Modified:
  head/sys/kern/kern_ktr.c
  head/sys/kern/kern_malloc.c
  head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c
  head/sys/ofed/drivers/net/mlx4/en_netdev.c
  head/sys/ofed/include/linux/linux_compat.c
  head/sys/pc98/pc98/canbus.c
  head/sys/sys/sysctl.h

Modified: head/sys/kern/kern_ktr.c
==============================================================================
--- head/sys/kern/kern_ktr.c	Sat Jun 28 15:53:28 2014	(r268004)
+++ head/sys/kern/kern_ktr.c	Sat Jun 28 17:36:18 2014	(r268005)
@@ -102,13 +102,9 @@ int	ktr_version = KTR_VERSION;
 struct	ktr_entry ktr_buf_init[KTR_BOOT_ENTRIES];
 struct	ktr_entry *ktr_buf = ktr_buf_init;
 cpuset_t ktr_cpumask = CPUSET_T_INITIALIZER(KTR_CPUMASK);
-static char ktr_cpumask_str[CPUSETBUFSIZ];
 
 static SYSCTL_NODE(_debug, OID_AUTO, ktr, CTLFLAG_RD, 0, "KTR options");
 
-SYSCTL_INT(_debug_ktr, OID_AUTO, mask, CTLFLAG_RDTUN,
-    &ktr_mask, 0, "KTR mask");
-
 SYSCTL_INT(_debug_ktr, OID_AUTO, version, CTLFLAG_RD,
     &ktr_version, 0, "Version of the KTR interface");
 
@@ -175,7 +171,7 @@ sysctl_debug_ktr_mask(SYSCTL_HANDLER_ARG
 	return (error);
 }
 
-SYSCTL_PROC(_debug_ktr, OID_AUTO, mask, CTLTYPE_UINT|CTLFLAG_RW, 0, 0,
+SYSCTL_PROC(_debug_ktr, OID_AUTO, mask, CTLTYPE_UINT|CTLFLAG_RWTUN, 0, 0,
     sysctl_debug_ktr_mask, "IU",
     "Bitmask of KTR event classes for which logging is enabled");
 

Modified: head/sys/kern/kern_malloc.c
==============================================================================
--- head/sys/kern/kern_malloc.c	Sat Jun 28 15:53:28 2014	(r268004)
+++ head/sys/kern/kern_malloc.c	Sat Jun 28 17:36:18 2014	(r268005)
@@ -191,7 +191,7 @@ static u_long vm_kmem_size_max;
 SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_max, CTLFLAG_RDTUN, &vm_kmem_size_max, 0,
     "Maximum size of kernel memory");
 
-static u_int vm_kmem_size_scale = VM_KMEM_SIZE_SCALE;
+static u_int vm_kmem_size_scale;
 SYSCTL_UINT(_vm, OID_AUTO, kmem_size_scale, CTLFLAG_RDTUN, &vm_kmem_size_scale, 0,
     "Scale factor for kernel memory size");
 

Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c	Sat Jun 28 15:53:28 2014	(r268004)
+++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c	Sat Jun 28 17:36:18 2014	(r268005)
@@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 uma_zone_t	sdp_zone;
 struct rwlock	sdp_lock;

Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c
==============================================================================
--- head/sys/ofed/drivers/net/mlx4/en_netdev.c	Sat Jun 28 15:53:28 2014	(r268004)
+++ head/sys/ofed/drivers/net/mlx4/en_netdev.c	Sat Jun 28 17:36:18 2014	(r268005)
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 static void mlx4_en_init_locked(struct mlx4_en_priv *priv);
 static void mlx4_en_sysctl_stat(struct mlx4_en_priv *priv);

Modified: head/sys/ofed/include/linux/linux_compat.c
==============================================================================
--- head/sys/ofed/include/linux/linux_compat.c	Sat Jun 28 15:53:28 2014	(r268004)
+++ head/sys/ofed/include/linux/linux_compat.c	Sat Jun 28 17:36:18 2014	(r268005)
@@ -678,7 +678,7 @@ linux_compat_init(void)
 	struct sysctl_oid *rootoid;
 	int i;
 
-	rootoid = SYSCTL_ADD_NODE(NULL, SYSCTL_STATIC_CHILDREN(),
+	rootoid = SYSCTL_ADD_ROOT_NODE(NULL,
 	    OID_AUTO, "sys", CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, "sys");
 	kobject_init(&class_root, &class_ktype);
 	kobject_set_name(&class_root, "class");

Modified: head/sys/pc98/pc98/canbus.c
==============================================================================
--- head/sys/pc98/pc98/canbus.c	Sat Jun 28 15:53:28 2014	(r268004)
+++ head/sys/pc98/pc98/canbus.c	Sat Jun 28 17:36:18 2014	(r268005)
@@ -188,9 +188,8 @@ canbus_attach(device_t dev)
 
 	/* Dynamic sysctl tree setup */
 	sysctl_ctx_init(&sc->canbus_sysctl_ctx);
-	canbus_sysctl_tree = SYSCTL_ADD_NODE(&sc->canbus_sysctl_ctx,
-	    SYSCTL_STATIC_CHILDREN(/* tree top */), OID_AUTO,
-	    "canbus", CTLFLAG_RD, 0, "CanBe I/O Bus");
+	canbus_sysctl_tree = SYSCTL_ADD_ROOT_NODE(&sc->canbus_sysctl_ctx,
+	    OID_AUTO, "canbus", CTLFLAG_RD, 0, "CanBe I/O Bus");
 	SYSCTL_ADD_INT(&sc->canbus_sysctl_ctx,
 	    SYSCTL_CHILDREN(canbus_sysctl_tree), OID_AUTO, "io_delay_time",
 	    CTLFLAG_RW, &sc->io_delay_time, 0, "CanBe Bus I/O delay time");

Modified: head/sys/sys/sysctl.h
==============================================================================
--- head/sys/sys/sysctl.h	Sat Jun 28 15:53:28 2014	(r268004)
+++ head/sys/sys/sysctl.h	Sat Jun 28 17:36:18 2014	(r268005)
@@ -325,6 +325,10 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a
 	sysctl_add_oid(ctx, parent, nbr, name, CTLTYPE_NODE|(access),	    \
 	NULL, 0, handler, "N", __DESCR(descr))
 
+#define	SYSCTL_ADD_ROOT_NODE(ctx, nbr, name, access, handler, descr)	\
+	sysctl_add_oid(ctx, &sysctl__children, nbr, name,		\
+        CTLTYPE_NODE|(access), NULL, 0, handler, "N", __DESCR(descr))
+
 /* Oid for a string.  len can be 0 to indicate '\0' termination. */
 #define	SYSCTL_STRING(parent, nbr, name, access, arg, len, descr) \
 	SYSCTL_OID(parent, nbr, name, CTLTYPE_STRING|(access), \

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 28 18:53:03 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 28BB9D32;
 Sat, 28 Jun 2014 18:53:03 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 160DC2E86;
 Sat, 28 Jun 2014 18:53:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5SIr2Pm015142;
 Sat, 28 Jun 2014 18:53:02 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5SIr2oV015141;
 Sat, 28 Jun 2014 18:53:02 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201406281853.s5SIr2oV015141@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 28 Jun 2014 18:53:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268006 - head/sys/modules/dtrace/dtrace
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 28 Jun 2014 18:53:03 -0000

Author: rpaulo
Date: Sat Jun 28 18:53:02 2014
New Revision: 268006
URL: http://svnweb.freebsd.org/changeset/base/268006

Log:
  Move the -I of common/util to the proper place to fix the powerpc build.
  
  MFC after:	2 weeks

Modified:
  head/sys/modules/dtrace/dtrace/Makefile

Modified: head/sys/modules/dtrace/dtrace/Makefile
==============================================================================
--- head/sys/modules/dtrace/dtrace/Makefile	Sat Jun 28 17:36:18 2014	(r268005)
+++ head/sys/modules/dtrace/dtrace/Makefile	Sat Jun 28 18:53:02 2014	(r268006)
@@ -22,8 +22,7 @@ SRCS=		dtrace.c \
 SRCS+=		dis_tables.c \
 		instr_size.c
 CFLAGS+=	-I${SYSDIR}/cddl/contrib/opensolaris/uts/intel \
-		-I${SYSDIR}/cddl/dev/dtrace/x86 \
-		-I${SUNW}/common/util
+		-I${SYSDIR}/cddl/dev/dtrace/x86
 .endif
 
 SRCS+=		bus_if.h device_if.h vnode_if.h
@@ -45,6 +44,7 @@ CFLAGS+=	-I${SYSDIR}/cddl/compat/opensol
 		-I${SYSDIR}/cddl/dev/dtrace \
 		-I${SYSDIR}/cddl/dev/dtrace/${ARCHDIR} \
 		-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+		-I${SUNW}/common/util \
 		-I${SYSDIR} -DDIS_MEM
 
 CFLAGS+=	-DSMP

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 28 19:59:13 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 26269675;
 Sat, 28 Jun 2014 19:59:13 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EE5C1233F;
 Sat, 28 Jun 2014 19:59:12 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5SJxCLr043125;
 Sat, 28 Jun 2014 19:59:12 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5SJxCEn043122;
 Sat, 28 Jun 2014 19:59:12 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201406281959.s5SJxCEn043122@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Sat, 28 Jun 2014 19:59:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268007 - in head/sys:
 cddl/contrib/opensolaris/uts/common/dtrace modules/dtrace/fasttrap
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 28 Jun 2014 19:59:13 -0000

Author: pfg
Date: Sat Jun 28 19:59:12 2014
New Revision: 268007
URL: http://svnweb.freebsd.org/changeset/base/268007

Log:
  Revert	r267869:
  
  MFV	r260708
  4427 pid provider rejects probes with valid UTF-8 names
  
  Use of u8_textprep.c broke the build on powerpc.
  
  Reported by:	bz, rpaulo and tinderbox.
  Pointyhat:	me

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
  head/sys/modules/dtrace/fasttrap/Makefile

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c	Sat Jun 28 18:53:02 2014	(r268006)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c	Sat Jun 28 19:59:12 2014	(r268007)
@@ -28,9 +28,9 @@
  * Use is subject to license terms.
  */
 
-/*
- * Copyright (c) 2013, Joyent, Inc. All rights reserved.
- */
+#if defined(sun)
+#pragma ident	"%Z%%M%	%I%	%E% SMI"
+#endif
 
 #include 
 #include 
@@ -63,7 +63,6 @@
 #if !defined(sun)
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -2257,7 +2256,8 @@ fasttrap_ioctl(struct cdev *dev, u_long 
 		fasttrap_probe_spec_t *probe;
 		uint64_t noffs;
 		size_t size;
-		int ret, err;
+		int ret;
+		char *c;
 
 		if (copyin(&uprobe->ftps_noffs, &noffs,
 		    sizeof (uprobe->ftps_noffs)))
@@ -2286,16 +2286,18 @@ fasttrap_ioctl(struct cdev *dev, u_long 
 		 * Verify that the function and module strings contain no
 		 * funny characters.
 		 */
-		if (u8_validate(probe->ftps_func, strlen(probe->ftps_func),
-		    NULL, U8_VALIDATE_ENTIRE, &err) < 0) {
-			ret = EINVAL;
-			goto err;
+		for (c = &probe->ftps_func[0]; *c != '\0'; c++) {
+			if (*c < 0x20 || 0x7f <= *c) {
+				ret = EINVAL;
+				goto err;
+			}
 		}
 
-		if (u8_validate(probe->ftps_mod, strlen(probe->ftps_mod),
-		    NULL, U8_VALIDATE_ENTIRE, &err) < 0) {
-			ret = EINVAL;
-			goto err;
+		for (c = &probe->ftps_mod[0]; *c != '\0'; c++) {
+			if (*c < 0x20 || 0x7f <= *c) {
+				ret = EINVAL;
+				goto err;
+			}
 		}
 
 #ifdef notyet

Modified: head/sys/modules/dtrace/fasttrap/Makefile
==============================================================================
--- head/sys/modules/dtrace/fasttrap/Makefile	Sat Jun 28 18:53:02 2014	(r268006)
+++ head/sys/modules/dtrace/fasttrap/Makefile	Sat Jun 28 19:59:12 2014	(r268007)
@@ -8,9 +8,6 @@ KMOD=		fasttrap
 SRCS=		fasttrap.c fasttrap_isa.c opt_compat.h
 SRCS+=		vnode_if.h
 
-.PATH:		${.CURDIR}/../../../cddl/contrib/opensolaris/common/unicode
-SRCS+=		u8_textprep.c
-
 CFLAGS+=	-I${SYSDIR}/cddl/compat/opensolaris \
 		-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
 		-I${SYSDIR}

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 28 21:47:16 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8D43CE4B;
 Sat, 28 Jun 2014 21:47:16 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 608372A8C;
 Sat, 28 Jun 2014 21:47:16 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5SLlG6I094280;
 Sat, 28 Jun 2014 21:47:16 GMT
 (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5SLlGQH094279;
 Sat, 28 Jun 2014 21:47:16 GMT
 (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201406282147.s5SLlGQH094279@svn.freebsd.org>
From: Rick Macklem 
Date: Sat, 28 Jun 2014 21:47:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268008 - head/sys/fs/nfsclient
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 28 Jun 2014 21:47:16 -0000

Author: rmacklem
Date: Sat Jun 28 21:47:15 2014
New Revision: 268008
URL: http://svnweb.freebsd.org/changeset/base/268008

Log:
  There might be a potential race condition for the NFSv4 client
  when a newly created file has another open done on it that
  update the open mode. This patch moves the code that updates
  the open mode up into the block where the mutex is held to
  ensure this cannot happen. No bug caused by this potential
  race has been observed, but this fix is a safety belt to ensure
  it cannot happen.
  
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clstate.c

Modified: head/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clstate.c	Sat Jun 28 19:59:12 2014	(r268007)
+++ head/sys/fs/nfsclient/nfs_clstate.c	Sat Jun 28 21:47:15 2014	(r268008)
@@ -281,6 +281,23 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, i
 	    newonep);
 
 	/*
+	 * Now, check the mode on the open and return the appropriate
+	 * value.
+	 */
+	if (retp != NULL) {
+		if (nfhp != NULL && dp != NULL && nop == NULL)
+			/* new local open on delegation */
+			*retp = NFSCLOPEN_SETCRED;
+		else
+			*retp = NFSCLOPEN_OK;
+	}
+	if (op != NULL && (amode & ~(op->nfso_mode))) {
+		op->nfso_mode |= amode;
+		if (retp != NULL && dp == NULL)
+			*retp = NFSCLOPEN_DOOPEN;
+	}
+
+	/*
 	 * Serialize modifications to the open owner for multiple threads
 	 * within the same process using a read/write sleep lock.
 	 */
@@ -295,23 +312,6 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, i
 		*owpp = owp;
 	if (opp != NULL)
 		*opp = op;
-	if (retp != NULL) {
-		if (nfhp != NULL && dp != NULL && nop == NULL)
-			/* new local open on delegation */
-			*retp = NFSCLOPEN_SETCRED;
-		else
-			*retp = NFSCLOPEN_OK;
-	}
-
-	/*
-	 * Now, check the mode on the open and return the appropriate
-	 * value.
-	 */
-	if (op != NULL && (amode & ~(op->nfso_mode))) {
-		op->nfso_mode |= amode;
-		if (retp != NULL && dp == NULL)
-			*retp = NFSCLOPEN_DOOPEN;
-	}
 	return (0);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 29 01:04:12 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 64F39921;
 Sun, 29 Jun 2014 01:04:12 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 51ABB281A;
 Sun, 29 Jun 2014 01:04:12 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5T14C8k085631;
 Sun, 29 Jun 2014 01:04:12 GMT (envelope-from bryanv@svn.freebsd.org)
Received: (from bryanv@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5T14C7Z085630;
 Sun, 29 Jun 2014 01:04:12 GMT (envelope-from bryanv@svn.freebsd.org)
Message-Id: <201406290104.s5T14C7Z085630@svn.freebsd.org>
From: Bryan Venteicher 
Date: Sun, 29 Jun 2014 01:04:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268012 - head/sys/dev/vmware/vmxnet3
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 29 Jun 2014 01:04:12 -0000

Author: bryanv
Date: Sun Jun 29 01:04:11 2014
New Revision: 268012
URL: http://svnweb.freebsd.org/changeset/base/268012

Log:
  Give each interrupt a descriptive name when using MSIX
  
  MFC after:	3 days

Modified:
  head/sys/dev/vmware/vmxnet3/if_vmx.c

Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c
==============================================================================
--- head/sys/dev/vmware/vmxnet3/if_vmx.c	Sun Jun 29 00:50:56 2014	(r268011)
+++ head/sys/dev/vmware/vmxnet3/if_vmx.c	Sun Jun 29 01:04:11 2014	(r268012)
@@ -694,6 +694,8 @@ vmxnet3_setup_msix_interrupts(struct vmx
 		     vmxnet3_txq_intr, txq, &intr->vmxi_handler);
 		if (error)
 			return (error);
+		bus_describe_intr(dev, intr->vmxi_irq, intr->vmxi_handler,
+		    "tq%d", i);
 		txq->vxtxq_intr_idx = intr->vmxi_rid - 1;
 	}
 
@@ -703,6 +705,8 @@ vmxnet3_setup_msix_interrupts(struct vmx
 		    vmxnet3_rxq_intr, rxq, &intr->vmxi_handler);
 		if (error)
 			return (error);
+		bus_describe_intr(dev, intr->vmxi_irq, intr->vmxi_handler,
+		    "rq%d", i);
 		rxq->vxrxq_intr_idx = intr->vmxi_rid - 1;
 	}
 
@@ -710,6 +714,7 @@ vmxnet3_setup_msix_interrupts(struct vmx
 	    vmxnet3_event_intr, sc, &intr->vmxi_handler);
 	if (error)
 		return (error);
+	bus_describe_intr(dev, intr->vmxi_irq, intr->vmxi_handler, "event");
 	sc->vmx_event_intr_idx = intr->vmxi_rid - 1;
 
 	return (0);

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 29 02:28:06 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 60F304B1;
 Sun, 29 Jun 2014 02:28:06 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 33B242D5A;
 Sun, 29 Jun 2014 02:28:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5T2S6k3022675;
 Sun, 29 Jun 2014 02:28:06 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5T2S6fw022674;
 Sun, 29 Jun 2014 02:28:06 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201406290228.s5T2S6fw022674@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Sun, 29 Jun 2014 02:28:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268014 - head/sys/cddl/contrib/opensolaris/common/unicode
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 29 Jun 2014 02:28:06 -0000

Author: pfg
Date: Sun Jun 29 02:28:05 2014
New Revision: 268014
URL: http://svnweb.freebsd.org/changeset/base/268014

Log:
  Reduce some warnings in the Solaris unicode support.
  
  Clean some warnings from parenthesis and minor style issues.
  
  MFC after:	3 days

Modified:
  head/sys/cddl/contrib/opensolaris/common/unicode/u8_textprep.c

Modified: head/sys/cddl/contrib/opensolaris/common/unicode/u8_textprep.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/common/unicode/u8_textprep.c	Sun Jun 29 01:21:35 2014	(r268013)
+++ head/sys/cddl/contrib/opensolaris/common/unicode/u8_textprep.c	Sun Jun 29 02:28:05 2014	(r268014)
@@ -23,7 +23,6 @@
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
 
 
 /*
@@ -143,10 +142,10 @@
 #define	U8_16BIT_TABLE_INDICATOR	(0x8000U)
 
 /* The following are some convenience macros. */
-#define	U8_PUT_3BYTES_INTO_UTF32(u, b1, b2, b3) \
-	(u) = ((uint32_t)(b1) & 0x0F) << 12 | ((uint32_t)(b2) & 0x3F) << 6 | \
-		(uint32_t)(b3) & 0x3F;
-
+#define	U8_PUT_3BYTES_INTO_UTF32(u, b1, b2, b3)  \
+	(u) = ((((uint32_t)(b1) & 0x0F) << 12) | \
+		(((uint32_t)(b2) & 0x3F) << 6)  | \
+		((uint32_t)(b3) & 0x3F));
 #define	U8_SIMPLE_SWAP(a, b, t) \
 	(t) = (a); \
 	(a) = (b); \
@@ -216,10 +215,10 @@ const int8_t u8_number_of_bytes[0x100] =
 /*	80  81  82  83  84  85  86  87  88  89  8A  8B  8C  8D  8E  8F  */
 	I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_,
 
-/*  	90  91  92  93  94  95  96  97  98  99  9A  9B  9C  9D  9E  9F  */
+/*	90  91  92  93  94  95  96  97  98  99  9A  9B  9C  9D  9E  9F  */
 	I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_,
 
-/*  	A0  A1  A2  A3  A4  A5  A6  A7  A8  A9  AA  AB  AC  AD  AE  AF  */
+/*	A0  A1  A2  A3  A4  A5  A6  A7  A8  A9  AA  AB  AC  AD  AE  AF  */
 	I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_, I_,
 
 /*	B0  B1  B2  B3  B4  B5  B6  B7  B8  B9  BA  BB  BC  BD  BE  BF  */

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 29 18:38:45 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3CB94E00;
 Sun, 29 Jun 2014 18:38:45 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2A19F2F00;
 Sun, 29 Jun 2014 18:38:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5TIcjgF068536;
 Sun, 29 Jun 2014 18:38:45 GMT (envelope-from sbruno@svn.freebsd.org)
Received: (from sbruno@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5TIcjwg068535;
 Sun, 29 Jun 2014 18:38:45 GMT (envelope-from sbruno@svn.freebsd.org)
Message-Id: <201406291838.s5TIcjwg068535@svn.freebsd.org>
From: Sean Bruno 
Date: Sun, 29 Jun 2014 18:38:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268017 - head/sys/dev/ciss
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 29 Jun 2014 18:38:45 -0000

Author: sbruno
Date: Sun Jun 29 18:38:44 2014
New Revision: 268017
URL: http://svnweb.freebsd.org/changeset/base/268017

Log:
  Check return of cam_periph_find() before using it in a printf.
  
  If cam_periph_find() doesn't locate the path we requested, bail to error
  condition.
  
  Acquire ciss->mtx for this operation.
  
  Reviewed by:	"Benesh, Scott" 
  MFC after:	2 weeks

Modified:
  head/sys/dev/ciss/ciss.c

Modified: head/sys/dev/ciss/ciss.c
==============================================================================
--- head/sys/dev/ciss/ciss.c	Sun Jun 29 09:29:27 2014	(r268016)
+++ head/sys/dev/ciss/ciss.c	Sun Jun 29 18:38:44 2014	(r268017)
@@ -3429,13 +3429,17 @@ ciss_name_device(struct ciss_softc *sc, 
 			     target, 0);
 
     if (status == CAM_REQ_CMP) {
+	mtx_lock(&sc->ciss_mtx);
 	xpt_path_lock(path);
 	periph = cam_periph_find(path, NULL);
-	sprintf(sc->ciss_logical[bus][target].cl_name, "%s%d",
-		periph->periph_name, periph->unit_number);
 	xpt_path_unlock(path);
+	mtx_unlock(&sc->ciss_mtx);
 	xpt_free_path(path);
-	return(0);
+	if (periph != NULL) {
+		sprintf(sc->ciss_logical[bus][target].cl_name, "%s%d",
+			periph->periph_name, periph->unit_number);
+		return(0);
+	}
     }
     sc->ciss_logical[bus][target].cl_name[0] = 0;
     return(ENOENT);

From owner-svn-src-head@FreeBSD.ORG  Sun Jun 29 18:53:16 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id ACA01181;
 Sun, 29 Jun 2014 18:53:16 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9973E206C;
 Sun, 29 Jun 2014 18:53:16 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5TIrGgU076810;
 Sun, 29 Jun 2014 18:53:16 GMT (envelope-from sbruno@svn.freebsd.org)
Received: (from sbruno@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5TIrGuc076807;
 Sun, 29 Jun 2014 18:53:16 GMT (envelope-from sbruno@svn.freebsd.org)
Message-Id: <201406291853.s5TIrGuc076807@svn.freebsd.org>
From: Sean Bruno 
Date: Sun, 29 Jun 2014 18:53:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268018 - head/sys/dev/ciss
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 29 Jun 2014 18:53:16 -0000

Author: sbruno
Date: Sun Jun 29 18:53:15 2014
New Revision: 268018
URL: http://svnweb.freebsd.org/changeset/base/268018

Log:
  Add detection for ciss(4)  controllers that are set to non-raid JBOD mode.
  If a controller is set to JBOD, it has no RAID functions turned on.
  
  Populate even more of the firmware specification headers, copied from
  cciss_vol_status.
  
  Reviewed by:	Benesh, Scott 
  MFC after:	2 weeks

Modified:
  head/sys/dev/ciss/ciss.c
  head/sys/dev/ciss/cissreg.h

Modified: head/sys/dev/ciss/ciss.c
==============================================================================
--- head/sys/dev/ciss/ciss.c	Sun Jun 29 18:38:44 2014	(r268017)
+++ head/sys/dev/ciss/ciss.c	Sun Jun 29 18:53:15 2014	(r268018)
@@ -1220,7 +1220,7 @@ ciss_identify_adapter(struct ciss_softc 
     }
 
     /* sanity-check reply */
-    if (!sc->ciss_id->big_map_supported) {
+    if (!(sc->ciss_id->controller_flags & CONTROLLER_FLAGS_BIG_MAP_SUPPORT)) {
 	ciss_printf(sc, "adapter does not support BIG_MAP\n");
 	error = ENXIO;
 	goto out;
@@ -1250,7 +1250,7 @@ ciss_identify_adapter(struct ciss_softc 
 		    sc->ciss_id->configured_logical_drives,
 		    (sc->ciss_id->configured_logical_drives == 1) ? "" : "s");
 	ciss_printf(sc, "  firmware %4.4s\n", sc->ciss_id->running_firmware_revision);
-	ciss_printf(sc, "  %d SCSI channels\n", sc->ciss_id->scsi_bus_count);
+	ciss_printf(sc, "  %d SCSI channels\n", sc->ciss_id->scsi_chip_count);
 
 	ciss_printf(sc, "  signature '%.4s'\n", sc->ciss_cfg->signature);
 	ciss_printf(sc, "  valence %d\n", sc->ciss_cfg->valence);
@@ -1274,6 +1274,10 @@ ciss_identify_adapter(struct ciss_softc 
     	ciss_printf(sc, "  max logical logical volumes: %d\n", sc->ciss_cfg->max_logical_supported);
     	ciss_printf(sc, "  max physical disks supported: %d\n", sc->ciss_cfg->max_physical_supported);
     	ciss_printf(sc, "  max physical disks per logical volume: %d\n", sc->ciss_cfg->max_physical_per_logical);
+	ciss_printf(sc, "  JBOD Support is %s\n", (sc->ciss_id->uiYetMoreControllerFlags & YMORE_CONTROLLER_FLAGS_JBOD_SUPPORTED) ?
+			"Available" : "Unavailable");
+	ciss_printf(sc, "  JBOD Mode is %s\n", (sc->ciss_id->PowerUPNvramFlags & PWR_UP_FLAG_JBOD_ENABLED) ?
+			"Enabled" : "Disabled");
     }
 
 out:
@@ -3387,25 +3391,28 @@ ciss_cam_complete_fixup(struct ciss_soft
 	bus = cam_sim_bus(xpt_path_sim(csio->ccb_h.path));
 
 	/*
-	 * Don't let hard drives be seen by the DA driver.  They will still be
-	 * attached by the PASS driver.
+	 * If the controller is in JBOD mode, there are no logical volumes.
+	 * Let the disks be probed and dealt with via CAM.  Else, mask off 
+	 * the physical disks and setup the parts of the inq structure for
+	 * the logical volume.  swb
 	 */
-	if (CISS_IS_PHYSICAL(bus)) {
-	    if (SID_TYPE(inq) == T_DIRECT)
-		inq->device = (inq->device & 0xe0) | T_NODEVICE;
-	    return;
+	if( !(sc->ciss_id->PowerUPNvramFlags & PWR_UP_FLAG_JBOD_ENABLED)){
+		if (CISS_IS_PHYSICAL(bus)) {
+	    		if (SID_TYPE(inq) == T_DIRECT)
+				inq->device = (inq->device & 0xe0) | T_NODEVICE;
+	    		return;
+		}
+		cl = &sc->ciss_logical[bus][target];
+
+		padstr(inq->vendor, "HP",
+	       		SID_VENDOR_SIZE);
+		padstr(inq->product,
+	       		ciss_name_ldrive_org(cl->cl_ldrive->fault_tolerance),
+	       		SID_PRODUCT_SIZE);
+		padstr(inq->revision,
+	       		ciss_name_ldrive_status(cl->cl_lstatus->status),
+	       		SID_REVISION_SIZE);
 	}
-
-	cl = &sc->ciss_logical[bus][target];
-
-	padstr(inq->vendor, "HP",
-	       SID_VENDOR_SIZE);
-	padstr(inq->product,
-	       ciss_name_ldrive_org(cl->cl_ldrive->fault_tolerance),
-	       SID_PRODUCT_SIZE);
-	padstr(inq->revision,
-	       ciss_name_ldrive_status(cl->cl_lstatus->status),
-	       SID_REVISION_SIZE);
     }
 }
 

Modified: head/sys/dev/ciss/cissreg.h
==============================================================================
--- head/sys/dev/ciss/cissreg.h	Sun Jun 29 18:38:44 2014	(r268017)
+++ head/sys/dev/ciss/cissreg.h	Sun Jun 29 18:53:15 2014	(r268018)
@@ -615,26 +615,124 @@ struct ciss_bmic_id_table {
     char	running_firmware_revision[4];
     char	stored_firmware_revision[4];
     u_int8_t	hardware_revision;
-    u_int8_t	res1[4];
+    u_int8_t	boot_block_revision[4];
     u_int32_t	deprecated_drive_present_map;
     u_int32_t	deprecated_external_drive_present_map;
     u_int32_t	board_id;
-    u_int8_t	res2;
+    u_int8_t	swapped_error_cable;
     u_int32_t	deprecated_non_disk_map;
-    u_int8_t	res3[5];
+    u_int8_t	bad_host_ram_addr;
+    u_int8_t	cpu_revision;
+    u_int8_t	res3[3];
     char	marketting_revision;
-    u_int8_t	res4:3;
-    u_int8_t	more_than_seven_supported:1;
-    u_int8_t	res5:3;
-    u_int8_t	big_map_supported:1;		/* must be set! */
-    u_int8_t	res6[2];
-    u_int8_t	scsi_bus_count;
-    u_int32_t	res7;
+    u_int8_t	controller_flags;
+#define	CONTROLLER_FLAGS_FLASH_ROM_INSTALLED	0x01
+#define	CONTROLLER_FLAGS_DIAGS_MODE_BIT		0x02
+#define	CONTROLLER_FLAGS_EXPAND_32MB_FX 	0x04
+#define	CONTROLLER_FLAGS_MORE_THAN_7_SUPPORT 	0x08
+#define	CONTROLLER_FLAGS_DAISY_SUPPORT_BIT 	0x10
+#define	CONTROLLER_FLAGS_RES6 			0x20
+#define	CONTROLLER_FLAGS_RES7 			0x40
+#define	CONTROLLER_FLAGS_BIG_MAP_SUPPORT 	0x80
+    u_int8_t	host_flags;
+#define HOST_FLAGS_SDB_ASIC_WORK_AROUND 	0x01
+#define HOST_FLAGS_PCI_DATA_BUS_PARITY_SUPPORT	0x02
+#define HOST_FLAGS_RES3				0x04
+#define HOST_FLAGS_RES4				0x08
+#define HOST_FLAGS_RES5				0x10
+#define HOST_FLAGS_RES6				0x20
+#define HOST_FLAGS_RES7				0x30
+#define HOST_FLAGS_RES8				0x40
+    u_int8_t	expand_disable_code;
+#define EXPAND_DISABLE_NOT_NEEDED		0x01
+#define EXPAND_DISABLE_MISSING_CACHE_BOARD	0x02
+#define EXPAND_DISABLE_WCXC_FATAL_CACHE_BITS	0x04
+#define EXPAND_DISABLE_CACHE_PERM_DISABLED	0x08
+#define EXPAND_DISABLE_RAM_ALLOCATION_FAILED	0x10
+#define EXPAND_DISABLE_BATTEREIS_DISCHARGED	0x20
+#define EXPAND_DISABLE_RES7			0x40
+#define EXPAND_DISABLE_REBUILD_RUNNING		0x80
+    u_int8_t	scsi_chip_count;
+    u_int32_t	maximum_blocks;
     u_int32_t	controller_clock;
     u_int8_t	drives_per_scsi_bus;
     u_int8_t	big_drive_present_map[CISS_BIG_MAP_ENTRIES / 8];
     u_int8_t	big_external_drive_present_map[CISS_BIG_MAP_ENTRIES / 8];
     u_int8_t	big_non_disk_map[CISS_BIG_MAP_ENTRIES / 8];
+
+    u_int16_t	task_flags;		/* used for FW debugging */
+    u_int8_t	ICL_bus_map;		/* Bitmap used for ICL between controllers */
+    u_int8_t	redund_ctlr_modes_support;	/* See REDUNDANT MODE VALUES */
+    u_int8_t	curr_redund_ctlr_mode;
+    u_int8_t	redund_ctlr_status;
+    u_int8_t	redund_op_failure_code;
+
+    u_int8_t	unsupported_nile_bus;
+    u_int8_t	host_i2c_autorev;
+    u_int8_t	cpld_revision;
+    u_int8_t	fibre_chip_count;
+    u_int8_t	daughterboard_type;
+    u_int8_t	more_swapped_config_cable_error;
+
+    u_int8_t	license_key_status;
+    u_int8_t	access_module_status;
+    u_int8_t	features_supported[12];
+    u_int8_t	rec_rom_inact_rev[4];    /* Recovery ROM inactive f/w revision  */
+    u_int8_t	rec_rom_act_status;      /* Recovery ROM flags                  */
+    u_int8_t	pci_to_pci_status;       /* PCI to PCI bridge status            */
+    u_int32_t	redundant_server_info;   /* Reserved for future use             */
+    u_int8_t	percent_write_cache;     /* Percent of memory allocated to write cache */
+    u_int16_t	daughterboard_size_mb;   /* Total size (MB) of cache board      */
+    u_int8_t	cache_batter_count;      /* Number of cache batteries           */
+    u_int16_t	total_controller_mem_mb; /* Total size (MB) of atttached memory */
+    u_int8_t	more_controller_flags;   /* Additional controller flags byte    */
+    u_int8_t	x_board_host_i2c_rev;    /* 2nd byte of 3 byte autorev field    */
+    u_int8_t	battery_pic_rev;         /* BBWC PIC revision                   */
+/*
+ * Below here I have no documentation on the rest of this data structure.  It is
+ * inferred from the opensource cciss_vol_status application.  I assume that this 
+ * data strucutre is 512 bytes in total size, do not exceed it.
+ */
+    u_int8_t	bDdffVersion[4];         /* DDFF update engine version          */
+    u_int16_t	usMaxLogicalUnits;       /* Maximum logical units supported */
+    u_int16_t	usExtLogicalUnitCount;   /* Big num configured logical units */
+    u_int16_t	usMaxPhysicalDevices;    /* Maximum physical devices supported */
+    u_int16_t	usMaxPhyDrvPerLogicalUnit; /* Max physical drive per logical unit */
+    u_int8_t	bEnclosureCount;         /* Number of attached enclosures */
+    u_int8_t	bExpanderCount;          /* Number of expanders detected */
+    u_int16_t	usOffsetToEDPbitmap;     /* Offset to extended drive present map*/
+    u_int16_t	usOffsetToEEDPbitmap;    /* Offset to extended external drive present map */
+    u_int16_t	usOffsetToENDbitmap;     /* Offset to extended non-disk map */
+    u_int8_t	bInternalPortStatus[8];  /* Internal port status bytes */
+    u_int8_t	bExternalPortStatus[8];  /* External port status bytes */
+    u_int32_t	uiYetMoreControllerFlags;/* Yet More Controller flags  */
+#define YMORE_CONTROLLER_FLAGS_JBOD_SUPPORTED \
+	( 1 << 25 )			 /* Controller has JBOD support */
+
+    u_int8_t	bLastLockup;              /* Last lockup code */
+    u_int8_t	bSlot;                    /* PCI slot according to option ROM*/
+    u_int16_t	usBuildNum;               /* Build number */
+    u_int32_t	uiMaxSafeFullStripeSize;  /* Maximum safe full stripe size */
+    u_int32_t	uiTotalLength;            /* Total structure length */
+    u_int8_t	bVendorID[8];             /* Vendor ID */
+    u_int8_t	bProductID[16];           /* Product ID */
+/*
+ * These are even more obscure as they seem to only be available in cciss_vol_status
+ */
+    u_int32_t	ExtendedLastLockupCode;
+    u_int16_t	MaxRaid;
+    u_int16_t	MaxParity;
+    u_int16_t	MaxADGStripSize;
+    u_int16_t	YetMoreSwappedCables;
+    u_int8_t	MaxDevicePaths;
+    u_int8_t	PowerUPNvramFlags;
+#define PWR_UP_FLAG_JBOD_ENABLED	0x08	/*JBOD mode is enabled, all RAID features off */
+
+    u_int16_t	ZonedOffset;
+    u_int32_t   FixedFieldsLength;
+    u_int8_t	FWCompileTimeStamp[24];
+    u_int32_t	EvenMoreControllerFlags;
+    u_int8_t	padding[240];
 } __packed;
 
 /* CISS_BMIC_ID_PDRIVE */

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 00:20:14 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0D6C93D2;
 Mon, 30 Jun 2014 00:20:14 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EE4EE274D;
 Mon, 30 Jun 2014 00:20:13 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5U0KDfG026217;
 Mon, 30 Jun 2014 00:20:13 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5U0KCps026211;
 Mon, 30 Jun 2014 00:20:12 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201406300020.s5U0KCps026211@svn.freebsd.org>
From: Ed Maste 
Date: Mon, 30 Jun 2014 00:20:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268022 - in head: . share share/mk tools/build/options
 usr.bin
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 00:20:14 -0000

Author: emaste
Date: Mon Jun 30 00:20:12 2014
New Revision: 268022
URL: http://svnweb.freebsd.org/changeset/base/268022

Log:
  Rename the WITHOUT_VT_SUPPORT knob to WITHOUT_VT
  
  The _SUPPORT knobs have a consistent meaning which differs from the
  behaviour controlled by this knob.  As the knob is opt-out and has not
  appeared in a release the impact should be low.
  
  Suggested by:	imp, wblock
  MFC after:	1 week

Added:
  head/tools/build/options/WITHOUT_VT
     - copied unchanged from r268021, head/tools/build/options/WITHOUT_VT_SUPPORT
Deleted:
  head/tools/build/options/WITHOUT_VT_SUPPORT
Modified:
  head/Makefile.inc1
  head/UPDATING
  head/share/Makefile
  head/share/mk/src.opts.mk
  head/usr.bin/Makefile

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Sun Jun 29 22:35:47 2014	(r268021)
+++ head/Makefile.inc1	Mon Jun 30 00:20:12 2014	(r268022)
@@ -1198,7 +1198,7 @@ _gperf=		gnu/usr.bin/gperf
 _groff=		gnu/usr.bin/groff
 .endif
 
-.if ${MK_VT_SUPPORT} != "no"
+.if ${MK_VT} != "no"
 _vtfontcvt=	usr.bin/vtfontcvt
 .endif
 

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Sun Jun 29 22:35:47 2014	(r268021)
+++ head/UPDATING	Mon Jun 30 00:20:12 2014	(r268022)
@@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
 	disable the most expensive debugging functionality run
 	"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20140629:
+	The WITHOUT_VT_SUPPORT kernel config knob has been renamed
+	WITHOUT_VT.  (The other _SUPPORT knobs have a consistent meaning
+	which differs from the behaviour controlled by this knob.)
+
 20140619:
 	Maximal length of the serial number in CTL was increased from 16 to
 	64 chars, that breaks ABI.  All CTL-related tools, such as ctladm

Modified: head/share/Makefile
==============================================================================
--- head/share/Makefile	Sun Jun 29 22:35:47 2014	(r268021)
+++ head/share/Makefile	Mon Jun 30 00:20:12 2014	(r268022)
@@ -86,7 +86,7 @@ _syscons=	syscons
 _tests=		tests
 .endif
 
-.if ${MK_VT_SUPPORT} != "no"
+.if ${MK_VT} != "no"
 _vt=		vt
 .endif
 

Modified: head/share/mk/src.opts.mk
==============================================================================
--- head/share/mk/src.opts.mk	Sun Jun 29 22:35:47 2014	(r268021)
+++ head/share/mk/src.opts.mk	Mon Jun 30 00:20:12 2014	(r268022)
@@ -149,7 +149,7 @@ __DEFAULT_YES_OPTIONS = \
     USB \
     UTMPX \
     VI \
-    VT_SUPPORT \
+    VT \
     WIRELESS \
     WPA_SUPPLICANT_EAPOL \
     ZFS \

Copied: head/tools/build/options/WITHOUT_VT (from r268021, head/tools/build/options/WITHOUT_VT_SUPPORT)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/build/options/WITHOUT_VT	Mon Jun 30 00:20:12 2014	(r268022, copy of r268021, head/tools/build/options/WITHOUT_VT_SUPPORT)
@@ -0,0 +1,4 @@
+.\" $FreeBSD$
+Set to not build
+.Xr vt 4
+support files (fonts and keymaps).

Modified: head/usr.bin/Makefile
==============================================================================
--- head/usr.bin/Makefile	Sun Jun 29 22:35:47 2014	(r268021)
+++ head/usr.bin/Makefile	Mon Jun 30 00:20:12 2014	(r268022)
@@ -359,7 +359,7 @@ SUBDIR+=	yacc
 SUBDIR+=	vi
 .endif
 
-.if ${MK_VT_SUPPORT} != "no"
+.if ${MK_VT} != "no"
 SUBDIR+=	vtfontcvt
 .endif
 

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 00:22:41 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 974FF88E;
 Mon, 30 Jun 2014 00:22:41 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 84CBF2771;
 Mon, 30 Jun 2014 00:22:41 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5U0Mfob029622;
 Mon, 30 Jun 2014 00:22:41 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5U0Mfx2029621;
 Mon, 30 Jun 2014 00:22:41 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201406300022.s5U0Mfx2029621@svn.freebsd.org>
From: Ed Maste 
Date: Mon, 30 Jun 2014 00:22:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268023 - head/share/man/man5
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 00:22:41 -0000

Author: emaste
Date: Mon Jun 30 00:22:41 2014
New Revision: 268023
URL: http://svnweb.freebsd.org/changeset/base/268023

Log:
  Regenerate after r268022
  
  MFC after:	1 week

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==============================================================================
--- head/share/man/man5/src.conf.5	Mon Jun 30 00:20:12 2014	(r268022)
+++ head/share/man/man5/src.conf.5	Mon Jun 30 00:22:41 2014	(r268023)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
 .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des
 .\" $FreeBSD$
-.Dd June 17, 2014
+.Dd June 29, 2014
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -1022,7 +1022,7 @@ Set to not build
 .Xr telnet 8
 and related programs.
 .It Va WITH_TESTS
-.\" from FreeBSD: head/tools/build/options/WITH_TESTS 267033 2014-06-03 22:34:27Z jmmv
+.\" from FreeBSD: head/tools/build/options/WITH_TESTS 267432 2014-06-13 00:05:06Z gjb
 Set to install the
 .Fx
 Test Suite in
@@ -1088,8 +1088,8 @@ and
 .It Va WITHOUT_VI
 .\" from FreeBSD: head/tools/build/options/WITHOUT_VI 264903 2014-04-24 23:17:40Z imp
 Set to not build and install vi, view, ex and related programs.
-.It Va WITHOUT_VT_SUPPORT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_VT_SUPPORT 267582 2014-06-17 16:21:50Z emaste
+.It Va WITHOUT_VT
+.\" from FreeBSD: head/tools/build/options/WITHOUT_VT 268022 2014-06-30 00:20:12Z emaste
 Set to not build
 .Xr vt 4
 support files (fonts and keymaps).

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 00:41:46 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9D98BC86;
 Mon, 30 Jun 2014 00:41:46 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8B2EF28CB;
 Mon, 30 Jun 2014 00:41:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5U0fkxV038404;
 Mon, 30 Jun 2014 00:41:46 GMT (envelope-from scottl@svn.freebsd.org)
Received: (from scottl@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5U0fkwe038403;
 Mon, 30 Jun 2014 00:41:46 GMT (envelope-from scottl@svn.freebsd.org)
Message-Id: <201406300041.s5U0fkwe038403@svn.freebsd.org>
From: Scott Long 
Date: Mon, 30 Jun 2014 00:41:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268024 - head/sys/dev/isci/scil
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 00:41:46 -0000

Author: scottl
Date: Mon Jun 30 00:41:46 2014
New Revision: 268024
URL: http://svnweb.freebsd.org/changeset/base/268024

Log:
  Fix a case in ndling ATA_PASSTHROUGH commands that have an unaligned buffer.
  This impacts some home-rolled SMART tools.
  
  Reviewed by:	jimharris
  Obtained from:	Netflix
  MFC after:	2 days

Modified:
  head/sys/dev/isci/scil/scic_sds_stp_request.c

Modified: head/sys/dev/isci/scil/scic_sds_stp_request.c
==============================================================================
--- head/sys/dev/isci/scil/scic_sds_stp_request.c	Mon Jun 30 00:22:41 2014	(r268023)
+++ head/sys/dev/isci/scil/scic_sds_stp_request.c	Mon Jun 30 00:41:46 2014	(r268024)
@@ -1222,6 +1222,7 @@ SCI_STATUS scic_sds_stp_request_pio_data
          length -= copy_length;
          sgl_offset += copy_length;
          data_offset += copy_length;
+         source_address += copy_length;
 #endif
       }
    }

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 01:01:55 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A313386F;
 Mon, 30 Jun 2014 01:01:55 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 840CA2A20;
 Mon, 30 Jun 2014 01:01:55 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5U11tGK047482;
 Mon, 30 Jun 2014 01:01:55 GMT (envelope-from scottl@svn.freebsd.org)
Received: (from scottl@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5U11sWu047476;
 Mon, 30 Jun 2014 01:01:54 GMT (envelope-from scottl@svn.freebsd.org)
Message-Id: <201406300101.s5U11sWu047476@svn.freebsd.org>
From: Scott Long 
Date: Mon, 30 Jun 2014 01:01:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268025 - head/sys/dev/isci
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 01:01:55 -0000

Author: scottl
Date: Mon Jun 30 01:01:54 2014
New Revision: 268025
URL: http://svnweb.freebsd.org/changeset/base/268025

Log:
  In rare cases, a SATA drive can stop responding to commands and trigger a
  reset device task request from the driver.  If the drive fails to respond
  with a signature FIS, the driver would previously get into an endless retry
  loop, stalling all I/O to the drive and keeping user processes stranded.
  Instead, fail the i/o and invalidate the device if the task management
  command times out.  This is controllable with the sysctl and tunable
  hw.isci.fail_on_task_timeout
  dev.isci.0.fail_on_task_timeout
  
  The default for these is 1.
  
  Reviewed by:	jimharris
  Obtained from:	Netflix, Inc.
  MFC after:	2 days

Modified:
  head/sys/dev/isci/isci.h
  head/sys/dev/isci/isci_controller.c
  head/sys/dev/isci/isci_sysctl.c
  head/sys/dev/isci/isci_task_request.c

Modified: head/sys/dev/isci/isci.h
==============================================================================
--- head/sys/dev/isci/isci.h	Mon Jun 30 00:41:46 2014	(r268024)
+++ head/sys/dev/isci/isci.h	Mon Jun 30 01:01:54 2014	(r268025)
@@ -164,6 +164,7 @@ struct ISCI_CONTROLLER
 	uint32_t		initial_discovery_mask;
 	BOOL			is_frozen;
 	BOOL			release_queued_ccbs;
+	BOOL			fail_on_task_timeout;
 	uint8_t			*remote_device_memory;
 	struct ISCI_MEMORY	cached_controller_memory;
 	struct ISCI_MEMORY	uncached_controller_memory;

Modified: head/sys/dev/isci/isci_controller.c
==============================================================================
--- head/sys/dev/isci/isci_controller.c	Mon Jun 30 00:41:46 2014	(r268024)
+++ head/sys/dev/isci/isci_controller.c	Mon Jun 30 01:01:54 2014	(r268025)
@@ -300,6 +300,8 @@ SCI_STATUS isci_controller_initialize(st
 	SCI_CONTROLLER_HANDLE_T scic_controller_handle;
 	char led_name[64];
 	unsigned long tunable;
+	uint32_t io_shortage;
+	uint32_t fail_on_timeout;
 	int i;
 
 	scic_controller_handle =
@@ -365,10 +367,12 @@ SCI_STATUS isci_controller_initialize(st
 	 *  this io_shortage parameter, which will tell CAM that we have a
 	 *  large queue depth than we really do.
 	 */
-	uint32_t io_shortage = 0;
+	io_shortage = 0;
 	TUNABLE_INT_FETCH("hw.isci.io_shortage", &io_shortage);
 	controller->sim_queue_depth += io_shortage;
 
+	fail_on_timeout = 1;
+	TUNABLE_INT_FETCH("hw.isci.fail_on_task_timeout", &fail_on_timeout);
 	/* Attach to CAM using xpt_bus_register now, then immediately freeze
 	 *  the simq.  It will get released later when initial domain discovery
 	 *  is complete.

Modified: head/sys/dev/isci/isci_sysctl.c
==============================================================================
--- head/sys/dev/isci/isci_sysctl.c	Mon Jun 30 00:41:46 2014	(r268024)
+++ head/sys/dev/isci/isci_sysctl.c	Mon Jun 30 01:01:54 2014	(r268025)
@@ -222,6 +222,24 @@ isci_sysctl_log_frozen_lun_masks(SYSCTL_
 	return (0);
 }
 
+static int
+isci_sysctl_fail_on_task_timeout(SYSCTL_HANDLER_ARGS)
+{
+	struct isci_softc	*isci = (struct isci_softc *)arg1;
+	int32_t			fail_on_timeout = 0;
+	int			error, i;
+
+	error = sysctl_handle_int(oidp, &fail_on_timeout, 0, req);
+
+	if (error || fail_on_timeout == 0)
+		return (error);
+
+	for (i = 0; i < isci->controller_count; i++)
+		isci->controllers[i].fail_on_task_timeout = fail_on_timeout;
+
+	return (0);
+}
+
 void isci_sysctl_initialize(struct isci_softc *isci)
 {
 	struct sysctl_ctx_list *sysctl_ctx = device_get_sysctl_ctx(isci->device);
@@ -259,5 +277,10 @@ void isci_sysctl_initialize(struct isci_
 	    "log_frozen_lun_masks", CTLTYPE_UINT| CTLFLAG_RW, isci, 0,
 	    isci_sysctl_log_frozen_lun_masks, "IU",
 	    "Log frozen lun masks to kernel log");
+
+	SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO,
+	    "fail_on_task_timeout", CTLTYPE_UINT | CTLFLAG_RW, isci, 0,
+	    isci_sysctl_fail_on_task_timeout, "IU",
+	    "Fail a command that has encountered a task management timeout");
 }
 

Modified: head/sys/dev/isci/isci_task_request.c
==============================================================================
--- head/sys/dev/isci/isci_task_request.c	Mon Jun 30 00:41:46 2014	(r268024)
+++ head/sys/dev/isci/isci_task_request.c	Mon Jun 30 01:01:54 2014	(r268025)
@@ -206,8 +206,17 @@ isci_task_request_complete(SCI_CONTROLLE
 		break;
 
 	case SCI_FAILURE_TIMEOUT:
-		retry_task = TRUE;
-		isci_log_message(0, "ISCI", "task timeout - retrying\n");
+		if (isci_controller->fail_on_task_timeout) {
+			retry_task = FALSE;
+			isci_log_message(0, "ISCI",
+			    "task timeout - not retrying\n");
+			scif_cb_domain_device_removed(isci_controller,
+			    isci_remote_device->domain, isci_remote_device);
+		} else {
+			retry_task = TRUE;
+			isci_log_message(0, "ISCI",
+			    "task timeout - retrying\n");
+		}
 		break;
 
 	case SCI_TASK_FAILURE:

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 04:25:51 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9B0E7B1B;
 Mon, 30 Jun 2014 04:25:51 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7D05328B2;
 Mon, 30 Jun 2014 04:25:51 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5U4PpSk039292;
 Mon, 30 Jun 2014 04:25:51 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5U4Pp1Q039291;
 Mon, 30 Jun 2014 04:25:51 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201406300425.s5U4Pp1Q039291@svn.freebsd.org>
From: Adrian Chadd 
Date: Mon, 30 Jun 2014 04:25:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268026 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 04:25:51 -0000

Author: adrian
Date: Mon Jun 30 04:25:51 2014
New Revision: 268026
URL: http://svnweb.freebsd.org/changeset/base/268026

Log:
  If we're doing RSS then ensure that the callwheel swi's are CPU pinned.

Modified:
  head/sys/kern/kern_timeout.c

Modified: head/sys/kern/kern_timeout.c
==============================================================================
--- head/sys/kern/kern_timeout.c	Mon Jun 30 01:01:54 2014	(r268025)
+++ head/sys/kern/kern_timeout.c	Mon Jun 30 04:25:51 2014	(r268026)
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 #if defined(__arm__)
 #include "opt_timer.h"
 #endif
+#include "opt_rss.h"
 
 #include 
 #include 
@@ -104,8 +105,13 @@ static int ncallout;
 SYSCTL_INT(_kern, OID_AUTO, ncallout, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &ncallout, 0,
     "Number of entries in callwheel and size of timeout() preallocation");
 
+#ifdef	RSS
+static int pin_default_swi = 1;
+static int pin_pcpu_swi = 1;
+#else
 static int pin_default_swi = 0;
 static int pin_pcpu_swi = 0;
+#endif
 
 SYSCTL_INT(_kern, OID_AUTO, pin_default_swi, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &pin_default_swi,
     0, "Pin the default (non-per-cpu) swi (shared with PCPU 0 swi)");

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 04:26:29 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id F169CE56;
 Mon, 30 Jun 2014 04:26:29 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DF1FD28BE;
 Mon, 30 Jun 2014 04:26:29 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5U4QThE039445;
 Mon, 30 Jun 2014 04:26:29 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5U4QTiP039444;
 Mon, 30 Jun 2014 04:26:29 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201406300426.s5U4QTiP039444@svn.freebsd.org>
From: Adrian Chadd 
Date: Mon, 30 Jun 2014 04:26:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268027 - head/sys/netinet
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 04:26:30 -0000

Author: adrian
Date: Mon Jun 30 04:26:29 2014
New Revision: 268027
URL: http://svnweb.freebsd.org/changeset/base/268027

Log:
  If we're doing RSS then ensure the TCP timer selection uses the multi-CPU
  callwheel setup, rather than just dumping all the timers on swi0.

Modified:
  head/sys/netinet/tcp_timer.c

Modified: head/sys/netinet/tcp_timer.c
==============================================================================
--- head/sys/netinet/tcp_timer.c	Mon Jun 30 04:25:51 2014	(r268026)
+++ head/sys/netinet/tcp_timer.c	Mon Jun 30 04:26:29 2014	(r268027)
@@ -127,7 +127,11 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, rexm
     &tcp_rexmit_drop_options, 0,
     "Drop TCP options from 3rd and later retransmitted SYN");
 
+#ifdef	RSS
+static int	per_cpu_timers = 1;
+#else
 static int	per_cpu_timers = 0;
+#endif
 SYSCTL_INT(_net_inet_tcp, OID_AUTO, per_cpu_timers, CTLFLAG_RW,
     &per_cpu_timers , 0, "run tcp timers on all cpus");
 

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 04:34:59 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id CC849D4B;
 Mon, 30 Jun 2014 04:34:59 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id AE9F82980;
 Mon, 30 Jun 2014 04:34:59 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5U4YxpE043871;
 Mon, 30 Jun 2014 04:34:59 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5U4YxGY043870;
 Mon, 30 Jun 2014 04:34:59 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201406300434.s5U4YxGY043870@svn.freebsd.org>
From: Adrian Chadd 
Date: Mon, 30 Jun 2014 04:34:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268028 - head/sys/dev/e1000
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 04:35:00 -0000

Author: adrian
Date: Mon Jun 30 04:34:59 2014
New Revision: 268028
URL: http://svnweb.freebsd.org/changeset/base/268028

Log:
  Add initial RSS awareness to the igb(4) driver.
  
  The igb(4) hardware is capable of RSS hashing RX packets and doing RSS
  queue selection for up to 8 queues.  (I believe some hardware is limited
  to 4 queues, but I haven't tested on that.)
  
  However, even if multi-queue is enabled for igb(4), the RX path doesn't use
  the RSS flowid from the received descriptor.  It just uses the MSIX queue id.
  
  This patch does a handful of things if RSS is enabled:
  
  * Instead of using a random key at boot, fetch the RSS key from the RSS code
    and program that in to the RSS redirection table.
  
    That whole chunk of code should be double checked for endian correctness.
  
  * Use the RSS queue mapping to CPU ID to figure out where to thread pin
    the RX swi thread and the taskqueue threads for each queue.
  
  * The software queue is now really an "RSS bucket".
  
  * When programming the RSS indirection table, use the RSS code to
    figure out which RSS bucket each slot in the indirection table maps
    to.
  
  * When transmitting, use the flowid RSS mapping if the mbuf has
    an RSS aware hash.  The existing method wasn't guaranteed to align
    correctly with the destination RSS bucket (and thus CPU ID.)
  
  This code warns if the number of RSS buckets isn't the same as the
  automatically configured number of hardware queues.  The administrator
  will have to tweak one of them for better performance.
  
  There's currently no way to re-balance the RSS indirection table after
  startup.  I'll worry about that later.
  
  Additionally, it may be worthwhile to always use the full 32 bit flowid if
  multi-queue is enabled.  It'll make things like lagg(4) behave better with
  respect to traffic distribution.

Modified:
  head/sys/dev/e1000/if_igb.c

Modified: head/sys/dev/e1000/if_igb.c
==============================================================================
--- head/sys/dev/e1000/if_igb.c	Mon Jun 30 04:26:29 2014	(r268027)
+++ head/sys/dev/e1000/if_igb.c	Mon Jun 30 04:34:59 2014	(r268028)
@@ -35,6 +35,7 @@
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
+#include "opt_rss.h"
 
 #ifdef HAVE_KERNEL_OPTION_HEADERS
 #include "opt_device_polling.h"
@@ -84,6 +85,9 @@
 #include 
 #include 
 #include 
+#ifdef	RSS
+#include 
+#endif
 
 #include 
 #include 
@@ -967,12 +971,33 @@ igb_mq_start(struct ifnet *ifp, struct m
 	struct igb_queue	*que;
 	struct tx_ring		*txr;
 	int 			i, err = 0;
+#ifdef	RSS
+	uint32_t		bucket_id;
+#endif
 
 	/* Which queue to use */
-	if ((m->m_flags & M_FLOWID) != 0)
-		i = m->m_pkthdr.flowid % adapter->num_queues;
-	else
+	/*
+	 * When doing RSS, map it to the same outbound queue
+	 * as the incoming flow would be mapped to.
+	 *
+	 * If everything is setup correctly, it should be the
+	 * same bucket that the current CPU we're on is.
+	 */
+	if ((m->m_flags & M_FLOWID) != 0) {
+#ifdef	RSS
+		if (rss_hash2bucket(m->m_pkthdr.flowid,
+		    M_HASHTYPE_GET(m), &bucket_id) == 0) {
+			/* XXX TODO: spit out something if bucket_id > num_queues? */
+			i = bucket_id % adapter->num_queues;
+		} else {
+#endif
+			i = m->m_pkthdr.flowid % adapter->num_queues;
+#ifdef	RSS
+		}
+#endif
+	} else {
 		i = curcpu % adapter->num_queues;
+	}
 	txr = &adapter->tx_rings[i];
 	que = &adapter->queues[i];
 
@@ -2433,11 +2458,34 @@ igb_allocate_msix(struct adapter *adapte
 	device_t		dev = adapter->dev;
 	struct igb_queue	*que = adapter->queues;
 	int			error, rid, vector = 0;
+	int			cpu_id;
 
 	/* Be sure to start with all interrupts disabled */
 	E1000_WRITE_REG(&adapter->hw, E1000_IMC, ~0);
 	E1000_WRITE_FLUSH(&adapter->hw);
 
+#ifdef	RSS
+	/*
+	 * If we're doing RSS, the number of queues needs to
+	 * match the number of RSS buckets that are configured.
+	 *
+	 * + If there's more queues than RSS buckets, we'll end
+	 *   up with queues that get no traffic.
+	 *
+	 * + If there's more RSS buckets than queues, we'll end
+	 *   up having multiple RSS buckets map to the same queue,
+	 *   so there'll be some contention.
+	 */
+	if (adapter->num_queues != rss_getnumbuckets()) {
+		device_printf(dev,
+		    "%s: number of queues (%d) != number of RSS buckets (%d)"
+		    "; performance will be impacted.\n",
+		    __func__,
+		    adapter->num_queues,
+		    rss_getnumbuckets());
+	}
+#endif
+
 	for (int i = 0; i < adapter->num_queues; i++, vector++, que++) {
 		rid = vector +1;
 		que->res = bus_alloc_resource_any(dev,
@@ -2464,19 +2512,42 @@ igb_allocate_msix(struct adapter *adapte
 			que->eims = E1000_EICR_TX_QUEUE0 << i;
 		else
 			que->eims = 1 << vector;
+
+#ifdef	RSS
 		/*
-		** Bind the msix vector, and thus the
-		** rings to the corresponding cpu.
-		*/
+		 * The queue ID is used as the RSS layer bucket ID.
+		 * We look up the queue ID -> RSS CPU ID and select
+		 * that.
+		 */
+		cpu_id = rss_getcpu(i % rss_getnumbuckets());
+#else
+		/*
+		 * Bind the msix vector, and thus the
+		 * rings to the corresponding cpu.
+		 *
+		 * This just happens to match the default RSS round-robin
+		 * bucket -> queue -> CPU allocation.
+		 */
 		if (adapter->num_queues > 1) {
 			if (igb_last_bind_cpu < 0)
 				igb_last_bind_cpu = CPU_FIRST();
-			bus_bind_intr(dev, que->res, igb_last_bind_cpu);
+			cpu_id = igb_last_bind_cpu;
+		}
+#endif
+
+		if (adapter->num_queues > 1) {
+			bus_bind_intr(dev, que->res, cpu_id);
+#ifdef	RSS
+			device_printf(dev,
+				"Bound queue %d to RSS bucket %d\n",
+				i, cpu_id);
+#else
 			device_printf(dev,
 				"Bound queue %d to cpu %d\n",
-				i,igb_last_bind_cpu);
-			igb_last_bind_cpu = CPU_NEXT(igb_last_bind_cpu);
+				i, cpu_id);
+#endif
 		}
+
 #ifndef IGB_LEGACY_TX
 		TASK_INIT(&que->txr->txq_task, 0, igb_deferred_mq_start,
 		    que->txr);
@@ -2485,8 +2556,34 @@ igb_allocate_msix(struct adapter *adapte
 		TASK_INIT(&que->que_task, 0, igb_handle_que, que);
 		que->tq = taskqueue_create("igb_que", M_NOWAIT,
 		    taskqueue_thread_enqueue, &que->tq);
-		taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que",
-		    device_get_nameunit(adapter->dev));
+		if (adapter->num_queues > 1) {
+			/*
+			 * Only pin the taskqueue thread to a CPU if
+			 * RSS is in use.
+			 *
+			 * This again just happens to match the default RSS
+			 * round-robin bucket -> queue -> CPU allocation.
+			 */
+#ifdef	RSS
+			taskqueue_start_threads_pinned(&que->tq, 1, PI_NET,
+			    cpu_id,
+			    "%s que (bucket %d)",
+			    device_get_nameunit(adapter->dev),
+			    cpu_id);
+#else
+			taskqueue_start_threads(&que->tq, 1, PI_NET,
+			    "%s que (qid %d)",
+			    device_get_nameunit(adapter->dev),
+			    cpu_id);
+#endif
+		} else {
+			taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que",
+			    device_get_nameunit(adapter->dev));
+		}
+
+		/* Finally update the last bound CPU id */
+		if (adapter->num_queues > 1)
+			igb_last_bind_cpu = CPU_NEXT(igb_last_bind_cpu);
 	}
 
 	/* And Link */
@@ -2763,6 +2860,13 @@ igb_setup_msix(struct adapter *adapter)
 	/* Figure out a reasonable auto config value */
 	queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus;
 
+#ifdef	RSS
+	/* If we're doing RSS, clamp at the number of RSS buckets */
+	if (queues > rss_getnumbuckets())
+		queues = rss_getnumbuckets();
+#endif
+
+
 	/* Manual override */
 	if (igb_num_queues != 0)
 		queues = igb_num_queues;
@@ -4455,6 +4559,99 @@ fail:
 	return (ENOBUFS);
 }
 
+/*
+ * Initialise the RSS mapping for NICs that support multiple transmit/
+ * receive rings.
+ */
+static void
+igb_initialise_rss_mapping(struct adapter *adapter)
+{
+	struct e1000_hw *hw = &adapter->hw;
+	int i;
+	int queue_id;
+
+	u32 rss_key[10], mrqc, shift = 0;
+	union igb_reta {
+		u32 dword;
+		u8  bytes[4];
+	} reta;
+
+	/* XXX? */
+	if (adapter->hw.mac.type == e1000_82575)
+		shift = 6;
+
+	/*
+	 * The redirection table controls which destination
+	 * queue each bucket redirects traffic to.
+	 * Each DWORD represents four queues, with the LSB
+	 * being the first queue in the DWORD.
+	 *
+	 * This just allocates buckets to queues using round-robin
+	 * allocation.
+	 *
+	 * NOTE: It Just Happens to line up with the default
+	 * RSS allocation method.
+	 */
+
+	/* Warning FM follows */
+	for (i = 0; i < 128; i++) {
+#ifdef	RSS
+		queue_id = rss_get_indirection_to_bucket(i);
+		/*
+		 * If we have more queues than buckets, we'll
+		 * end up mapping buckets to a subset of the
+		 * queues.
+		 *
+		 * If we have more buckets than queues, we'll
+		 * end up instead assigning multiple buckets
+		 * to queues.
+		 *
+		 * Both are suboptimal, but we need to handle
+		 * the case so we don't go out of bounds
+		 * indexing arrays and such.
+		 */
+		queue_id = queue_id % adapter->num_queues;
+#else
+		queue_id = (i % adapter->num_queues);
+#endif
+		reta.bytes[i & 3] = queue_id << shift;
+
+		if ((i & 3) == 3)
+			E1000_WRITE_REG(hw,
+			    E1000_RETA(i >> 2), reta.dword);
+	}
+
+
+	/* Now fill in hash table */
+
+	/* XXX This means RSS enable + 8 queues for my igb (82580.) */
+	mrqc = E1000_MRQC_ENABLE_RSS_4Q;
+
+#ifdef	RSS
+	/* XXX ew typecasting */
+	rss_getkey((uint8_t *) &rss_key);
+#else
+	arc4rand(&rss_key, sizeof(rss_key), 0);
+#endif
+	for (i = 0; i < 10; i++)
+		E1000_WRITE_REG_ARRAY(hw,
+		    E1000_RSSRK(0), i, rss_key[i]);
+
+	/*
+	 * Configure the RSS fields to hash upon.
+	 */
+	mrqc |= (E1000_MRQC_RSS_FIELD_IPV4 |
+	    E1000_MRQC_RSS_FIELD_IPV4_TCP);
+	mrqc |= (E1000_MRQC_RSS_FIELD_IPV6 |
+	    E1000_MRQC_RSS_FIELD_IPV6_TCP);
+	mrqc |=( E1000_MRQC_RSS_FIELD_IPV4_UDP |
+	    E1000_MRQC_RSS_FIELD_IPV6_UDP);
+	mrqc |=( E1000_MRQC_RSS_FIELD_IPV6_UDP_EX |
+	    E1000_MRQC_RSS_FIELD_IPV6_TCP_EX);
+
+	E1000_WRITE_REG(hw, E1000_MRQC, mrqc);
+}
+
 /*********************************************************************
  *
  *  Enable receive unit.
@@ -4538,39 +4735,9 @@ igb_initialize_receive_units(struct adap
 	*/
 	rxcsum = E1000_READ_REG(hw, E1000_RXCSUM);
 	if (adapter->num_queues >1) {
-		u32 random[10], mrqc, shift = 0;
-		union igb_reta {
-			u32 dword;
-			u8  bytes[4];
-		} reta;
-
-		arc4rand(&random, sizeof(random), 0);
-		if (adapter->hw.mac.type == e1000_82575)
-			shift = 6;
-		/* Warning FM follows */
-		for (int i = 0; i < 128; i++) {
-			reta.bytes[i & 3] =
-			    (i % adapter->num_queues) << shift;
-			if ((i & 3) == 3)
-				E1000_WRITE_REG(hw,
-				    E1000_RETA(i >> 2), reta.dword);
-		}
-		/* Now fill in hash table */
-		mrqc = E1000_MRQC_ENABLE_RSS_4Q;
-		for (int i = 0; i < 10; i++)
-			E1000_WRITE_REG_ARRAY(hw,
-			    E1000_RSSRK(0), i, random[i]);
-
-		mrqc |= (E1000_MRQC_RSS_FIELD_IPV4 |
-		    E1000_MRQC_RSS_FIELD_IPV4_TCP);
-		mrqc |= (E1000_MRQC_RSS_FIELD_IPV6 |
-		    E1000_MRQC_RSS_FIELD_IPV6_TCP);
-		mrqc |=( E1000_MRQC_RSS_FIELD_IPV4_UDP |
-		    E1000_MRQC_RSS_FIELD_IPV6_UDP);
-		mrqc |=( E1000_MRQC_RSS_FIELD_IPV6_UDP_EX |
-		    E1000_MRQC_RSS_FIELD_IPV6_TCP_EX);
 
-		E1000_WRITE_REG(hw, E1000_MRQC, mrqc);
+		/* rss setup */
+		igb_initialise_rss_mapping(adapter);
 
 		/*
 		** NOTE: Receive Full-Packet Checksum Offload 
@@ -4831,7 +4998,7 @@ igb_rxeof(struct igb_queue *que, int cou
 	for (i = rxr->next_to_check; count != 0;) {
 		struct mbuf		*sendmp, *mh, *mp;
 		struct igb_rx_buf	*rxbuf;
-		u16			hlen, plen, hdr, vtag;
+		u16			hlen, plen, hdr, vtag, pkt_info;
 		bool			eop = FALSE;
  
 		cur = &rxr->rx_base[i];
@@ -4853,6 +5020,7 @@ igb_rxeof(struct igb_queue *que, int cou
 		else
 			vtag = le16toh(cur->wb.upper.vlan);
 		hdr = le16toh(cur->wb.lower.lo_dword.hs_rss.hdr_info);
+		pkt_info = le16toh(cur->wb.lower.lo_dword.hs_rss.pkt_info);
 		eop = ((staterr & E1000_RXD_STAT_EOP) == E1000_RXD_STAT_EOP);
 
 		/* Make sure all segments of a bad packet are discarded */
@@ -4952,7 +5120,43 @@ igb_rxeof(struct igb_queue *que, int cou
 				rxr->fmp->m_pkthdr.ether_vtag = vtag;
 				rxr->fmp->m_flags |= M_VLANTAG;
 			}
-#ifndef IGB_LEGACY_TX
+#ifdef	RSS
+			/* XXX set flowtype once this works right */
+			rxr->fmp->m_pkthdr.flowid = 
+			    le32toh(cur->wb.lower.hi_dword.rss);
+			rxr->fmp->m_flags |= M_FLOWID;
+			switch (pkt_info & E1000_RXDADV_RSSTYPE_MASK) {
+			case E1000_RXDADV_RSSTYPE_IPV4_TCP:
+				M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_RSS_TCP_IPV4);
+				break;
+			case E1000_RXDADV_RSSTYPE_IPV4:
+				M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_RSS_IPV4);
+				break;
+			case E1000_RXDADV_RSSTYPE_IPV6_TCP:
+				M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_RSS_TCP_IPV6);
+				break;
+			case E1000_RXDADV_RSSTYPE_IPV6_EX:
+				M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_RSS_IPV6_EX);
+				break;
+			case E1000_RXDADV_RSSTYPE_IPV6:
+				M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_RSS_IPV6);
+				break;
+			case E1000_RXDADV_RSSTYPE_IPV6_TCP_EX:
+				M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_RSS_TCP_IPV6_EX);
+				break;
+
+			/* XXX no UDP support in RSS just yet */
+#ifdef notyet
+			case E1000_RXDADV_RSSTYPE_IPV4_UDP:
+			case E1000_RXDADV_RSSTYPE_IPV6_UDP:
+			case E1000_RXDADV_RSSTYPE_IPV6_UDP_EX:
+#endif
+			
+			default:
+				/* XXX fallthrough */
+				M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_NONE);
+			}
+#elif !defined(IGB_LEGACY_TX)
 			rxr->fmp->m_pkthdr.flowid = que->msix;
 			rxr->fmp->m_flags |= M_FLOWID;
 #endif

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 04:38:29 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C74F9B96;
 Mon, 30 Jun 2014 04:38:29 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A805A29A7;
 Mon, 30 Jun 2014 04:38:29 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5U4cTlf044432;
 Mon, 30 Jun 2014 04:38:29 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5U4cTVF044431;
 Mon, 30 Jun 2014 04:38:29 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201406300438.s5U4cTVF044431@svn.freebsd.org>
From: Adrian Chadd 
Date: Mon, 30 Jun 2014 04:38:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268029 - head/sys/dev/ixgbe
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 04:38:30 -0000

Author: adrian
Date: Mon Jun 30 04:38:29 2014
New Revision: 268029
URL: http://svnweb.freebsd.org/changeset/base/268029

Log:
  Add initial RSS awareness to the ixgbe(4) driver.
  
  The ixgbe(4) hardware is capable of RSS hashing RX packets and doing RSS
  queue selection for up to 8 queues.
  
  However, even if multi-queue is enabled for ixgbe(4), the RX path doesn't use
  the RSS flowid from the received descriptor.  It just uses the MSIX queue id.
  
  This patch does a handful of things if RSS is enabled:
  
  * Instead of using a random key at boot, fetch the RSS key from the RSS code
    and program that in to the RSS redirection table.
  
    That whole chunk of code should be double checked for endian correctness.
  
  * Use the RSS queue mapping to CPU ID to figure out where to thread pin
    the RX swi thread and the taskqueue threads for each queue.
  
  * The software queue is now really an "RSS bucket".
  
  * When programming the RSS indirection table, use the RSS code to
    figure out which RSS bucket each slot in the indirection table maps
    to.
  
  * When transmitting, use the flowid RSS mapping if the mbuf has
    an RSS aware hash.  The existing method wasn't guaranteed to align
    correctly with the destination RSS bucket (and thus CPU ID.)
  
  This code warns if the number of RSS buckets isn't the same as the
  automatically configured number of hardware queues.  The administrator
  will have to tweak one of them for better performance.
  
  There's currently no way to re-balance the RSS indirection table after
  startup.  I'll worry about that later.
  
  Additionally, it may be worthwhile to always use the full 32 bit flowid if
  multi-queue is enabled.  It'll make things like lagg(4) behave better with
  respect to traffic distribution.

Modified:
  head/sys/dev/ixgbe/ixgbe.c

Modified: head/sys/dev/ixgbe/ixgbe.c
==============================================================================
--- head/sys/dev/ixgbe/ixgbe.c	Mon Jun 30 04:34:59 2014	(r268028)
+++ head/sys/dev/ixgbe/ixgbe.c	Mon Jun 30 04:38:29 2014	(r268029)
@@ -35,8 +35,13 @@
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
+#include "opt_rss.h"
 #include "ixgbe.h"
 
+#ifdef	RSS
+#include 
+#endif
+
 /*********************************************************************
  *  Set this to one to display debug statistics
  *********************************************************************/
@@ -809,12 +814,33 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 	struct ix_queue	*que;
 	struct tx_ring	*txr;
 	int 		i, err = 0;
+#ifdef	RSS
+	uint32_t bucket_id;
+#endif
 
 	/* Which queue to use */
-	if ((m->m_flags & M_FLOWID) != 0)
-		i = m->m_pkthdr.flowid % adapter->num_queues;
-	else
+	/*
+	 * When doing RSS, map it to the same outbound queue
+	 * as the incoming flow would be mapped to.
+	 *
+	 * If everything is setup correctly, it should be the
+	 * same bucket that the current CPU we're on is.
+	 */
+	if ((m->m_flags & M_FLOWID) != 0) {
+#ifdef	RSS
+		if (rss_hash2bucket(m->m_pkthdr.flowid,
+		    M_HASHTYPE_GET(m), &bucket_id) == 0) {
+			/* XXX TODO: spit out something if bucket_id > num_queues? */
+			i = bucket_id % adapter->num_queues;
+		} else {
+#endif
+			i = m->m_pkthdr.flowid % adapter->num_queues;
+#ifdef	RSS
+		}
+#endif
+	} else {
 		i = curcpu % adapter->num_queues;
+	}
 
 	txr = &adapter->tx_rings[i];
 	que = &adapter->queues[i];
@@ -2338,6 +2364,31 @@ ixgbe_allocate_msix(struct adapter *adap
 	struct 		ix_queue *que = adapter->queues;
 	struct  	tx_ring *txr = adapter->tx_rings;
 	int 		error, rid, vector = 0;
+	int		cpu_id;
+
+#ifdef	RSS
+	/*
+	 * If we're doing RSS, the number of queues needs to
+	 * match the number of RSS buckets that are configured.
+	 *
+	 * + If there's more queues than RSS buckets, we'll end
+	 *   up with queues that get no traffic.
+	 *
+	 * + If there's more RSS buckets than queues, we'll end
+	 *   up having multiple RSS buckets map to the same queue,
+	 *   so there'll be some contention.
+	 */
+	if (adapter->num_queues != rss_getnumbuckets()) {
+		device_printf(dev,
+		    "%s: number of queues (%d) != number of RSS buckets (%d)"
+		    "; performance will be impacted.\n",
+		    __func__,
+		    adapter->num_queues,
+		    rss_getnumbuckets());
+	}
+#endif
+
+
 
 	for (int i = 0; i < adapter->num_queues; i++, vector++, que++, txr++) {
 		rid = vector + 1;
@@ -2362,12 +2413,37 @@ ixgbe_allocate_msix(struct adapter *adap
 #endif
 		que->msix = vector;
         	adapter->que_mask |= (u64)(1 << que->msix);
+#ifdef	RSS
 		/*
-		** Bind the msix vector, and thus the
-		** ring to the corresponding cpu.
-		*/
+		 * The queue ID is used as the RSS layer bucket ID.
+		 * We look up the queue ID -> RSS CPU ID and select
+		 * that.
+		 */
+		cpu_id = rss_getcpu(i % rss_getnumbuckets());
+#else
+		/*
+		 * Bind the msix vector, and thus the
+		 * rings to the corresponding cpu.
+		 *
+		 * This just happens to match the default RSS round-robin
+		 * bucket -> queue -> CPU allocation.
+		 */
 		if (adapter->num_queues > 1)
-			bus_bind_intr(dev, que->res, i);
+			cpu_id = i;
+#endif
+		if (adapter->num_queues > 1)
+			bus_bind_intr(dev, que->res, cpu_id);
+
+#ifdef	RSS
+		device_printf(dev,
+		    "Bound RSS bucket %d to CPU %d\n",
+		    i, cpu_id);
+#else
+		device_printf(dev,
+		    "Bound queue %d to cpu %d\n",
+		    i, cpu_id);
+#endif
+
 
 #ifndef IXGBE_LEGACY_TX
 		TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr);
@@ -2375,8 +2451,16 @@ ixgbe_allocate_msix(struct adapter *adap
 		TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que);
 		que->tq = taskqueue_create_fast("ixgbe_que", M_NOWAIT,
 		    taskqueue_thread_enqueue, &que->tq);
+#ifdef	RSS
+		taskqueue_start_threads_pinned(&que->tq, 1, PI_NET,
+		    cpu_id,
+		    "%s (bucket %d)",
+		    device_get_nameunit(adapter->dev),
+		    cpu_id);
+#else
 		taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que",
 		    device_get_nameunit(adapter->dev));
+#endif
 	}
 
 	/* and Link */
@@ -2450,6 +2534,11 @@ ixgbe_setup_msix(struct adapter *adapter
 
 	/* Figure out a reasonable auto config value */
 	queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus;
+#ifdef	RSS
+	/* If we're doing RSS, clamp at the number of RSS buckets */
+	if (queues > rss_getnumbuckets())
+		queues = rss_getnumbuckets();
+#endif
 
 	if (ixgbe_num_queues != 0)
 		queues = ixgbe_num_queues;
@@ -4107,6 +4196,65 @@ fail:
 	return (ENOBUFS);
 }
 
+static void
+ixgbe_initialise_rss_mapping(struct adapter *adapter)
+{
+	struct ixgbe_hw	*hw = &adapter->hw;
+	uint32_t reta;
+	int i, j, queue_id;
+	uint32_t rss_key[10];
+	uint32_t mrqc;
+
+	/* Setup RSS */
+	reta = 0;
+
+#ifdef	RSS
+	/* Fetch the configured RSS key */
+	rss_getkey((uint8_t *) &rss_key);
+#else
+	/* set up random bits */
+	arc4rand(&rss_key, sizeof(rss_key), 0);
+#endif
+
+	/* Set up the redirection table */
+	for (i = 0, j = 0; i < 128; i++, j++) {
+		if (j == adapter->num_queues) j = 0;
+#ifdef	RSS
+		/*
+		 * Fetch the RSS bucket id for the given indirection entry.
+		 * Cap it at the number of configured buckets (which is
+		 * num_queues.)
+		 */
+		queue_id = rss_get_indirection_to_bucket(i);
+		queue_id = queue_id % adapter->num_queues;
+#else
+		queue_id = (j * 0x11);
+#endif
+		/* XXX endian? */
+		reta = (reta << 8) | queue_id;
+		if ((i & 3) == 3)
+			IXGBE_WRITE_REG(hw, IXGBE_RETA(i >> 2), reta);
+	}
+
+	/* Now fill our hash function seeds */
+	for (int i = 0; i < 10; i++)
+		IXGBE_WRITE_REG(hw, IXGBE_RSSRK(i), rss_key[i]);
+
+	/* Perform hash on these packet types */
+	mrqc = IXGBE_MRQC_RSSEN
+	     | IXGBE_MRQC_RSS_FIELD_IPV4
+	     | IXGBE_MRQC_RSS_FIELD_IPV4_TCP
+	     | IXGBE_MRQC_RSS_FIELD_IPV4_UDP
+	     | IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP
+	     | IXGBE_MRQC_RSS_FIELD_IPV6_EX
+	     | IXGBE_MRQC_RSS_FIELD_IPV6
+	     | IXGBE_MRQC_RSS_FIELD_IPV6_TCP
+	     | IXGBE_MRQC_RSS_FIELD_IPV6_UDP
+	     | IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP;
+	IXGBE_WRITE_REG(hw, IXGBE_MRQC, mrqc);
+}
+
+
 /*********************************************************************
  *
  *  Setup receive registers and features.
@@ -4123,7 +4271,7 @@ ixgbe_initialize_receive_units(struct ad
 	struct ixgbe_hw	*hw = &adapter->hw;
 	struct ifnet   *ifp = adapter->ifp;
 	u32		bufsz, rxctrl, fctrl, srrctl, rxcsum;
-	u32		reta, mrqc = 0, hlreg, random[10];
+	u32		hlreg;
 
 
 	/*
@@ -4195,39 +4343,9 @@ ixgbe_initialize_receive_units(struct ad
 
 	rxcsum = IXGBE_READ_REG(hw, IXGBE_RXCSUM);
 
-	/* Setup RSS */
-	if (adapter->num_queues > 1) {
-		int i, j;
-		reta = 0;
-
-		/* set up random bits */
-		arc4rand(&random, sizeof(random), 0);
-
-		/* Set up the redirection table */
-		for (i = 0, j = 0; i < 128; i++, j++) {
-			if (j == adapter->num_queues) j = 0;
-			reta = (reta << 8) | (j * 0x11);
-			if ((i & 3) == 3)
-				IXGBE_WRITE_REG(hw, IXGBE_RETA(i >> 2), reta);
-		}
-
-		/* Now fill our hash function seeds */
-		for (int i = 0; i < 10; i++)
-			IXGBE_WRITE_REG(hw, IXGBE_RSSRK(i), random[i]);
-
-		/* Perform hash on these packet types */
-		mrqc = IXGBE_MRQC_RSSEN
-		     | IXGBE_MRQC_RSS_FIELD_IPV4
-		     | IXGBE_MRQC_RSS_FIELD_IPV4_TCP
-		     | IXGBE_MRQC_RSS_FIELD_IPV4_UDP
-		     | IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP
-		     | IXGBE_MRQC_RSS_FIELD_IPV6_EX
-		     | IXGBE_MRQC_RSS_FIELD_IPV6
-		     | IXGBE_MRQC_RSS_FIELD_IPV6_TCP
-		     | IXGBE_MRQC_RSS_FIELD_IPV6_UDP
-		     | IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP;
-		IXGBE_WRITE_REG(hw, IXGBE_MRQC, mrqc);
+	ixgbe_initialise_rss_mapping(adapter);
 
+	if (adapter->num_queues > 1) {
 		/* RSS and RX IPP Checksum are mutually exclusive */
 		rxcsum |= IXGBE_RXCSUM_PCSD;
 	}
@@ -4400,6 +4518,7 @@ ixgbe_rxeof(struct ix_queue *que)
 	u16			count = rxr->process_limit;
 	union ixgbe_adv_rx_desc	*cur;
 	struct ixgbe_rx_buf	*rbuf, *nbuf;
+	u16			pkt_info;
 
 	IXGBE_RX_LOCK(rxr);
 
@@ -4424,6 +4543,7 @@ ixgbe_rxeof(struct ix_queue *que)
 
 		cur = &rxr->rx_base[i];
 		staterr = le32toh(cur->wb.upper.status_error);
+		pkt_info = le16toh(cur->wb.lower.lo_dword.hs_rss.pkt_info);
 
 		if ((staterr & IXGBE_RXD_STAT_DD) == 0)
 			break;
@@ -4556,9 +4676,44 @@ ixgbe_rxeof(struct ix_queue *que)
 			if ((ifp->if_capenable & IFCAP_RXCSUM) != 0)
 				ixgbe_rx_checksum(staterr, sendmp, ptype);
 #if __FreeBSD_version >= 800000
+#ifdef RSS
+			sendmp->m_pkthdr.flowid =
+			    le32toh(cur->wb.lower.hi_dword.rss);
+			sendmp->m_flags |= M_FLOWID;
+			switch (pkt_info & IXGBE_RXDADV_RSSTYPE_MASK) {
+			case IXGBE_RXDADV_RSSTYPE_IPV4_TCP:
+				M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_TCP_IPV4);
+				break;
+			case IXGBE_RXDADV_RSSTYPE_IPV4:
+				M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_IPV4);
+				break;
+			case IXGBE_RXDADV_RSSTYPE_IPV6_TCP:
+				M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_TCP_IPV6);
+				break;
+			case IXGBE_RXDADV_RSSTYPE_IPV6_EX:
+				M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_IPV6_EX);
+				break;
+			case IXGBE_RXDADV_RSSTYPE_IPV6:
+				M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_IPV6);
+				break;
+			case IXGBE_RXDADV_RSSTYPE_IPV6_TCP_EX:
+				M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_TCP_IPV6_EX);
+				break;
+			/* XXX no UDP support in RSS just yet */
+#ifdef	notyet
+			case IGXBE_RXDADV_RSSTYPE_IPV4_UDP:
+			case IGXBE_RXDADV_RSSTYPE_IPV6_UDP:
+			case IGXBE_RXDADV_RSSTYPE_IPV6_UDP_EX:
+#endif /* notyet */
+			default:
+				/* XXX fallthrough */
+				M_HASHTYPE_SET(sendmp, M_HASHTYPE_NONE);
+			}
+#else /* RSS */
 			sendmp->m_pkthdr.flowid = que->msix;
 			sendmp->m_flags |= M_FLOWID;
-#endif
+#endif /* RSS */
+#endif /* FreeBSD_version */
 		}
 next_desc:
 		bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map,

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 04:39:27 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 55733C8;
 Mon, 30 Jun 2014 04:39:27 +0000 (UTC)
Received: from mail-qc0-x230.google.com (mail-qc0-x230.google.com
 [IPv6:2607:f8b0:400d:c01::230])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id E7A7329AB;
 Mon, 30 Jun 2014 04:39:26 +0000 (UTC)
Received: by mail-qc0-f176.google.com with SMTP id w7so6472147qcr.21
 for ; Sun, 29 Jun 2014 21:39:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date:message-id:subject
 :from:to:content-type;
 bh=Bz/e0RNAaUufZIkLbgUo43sMZdYedEWPrYXcyBOBKE4=;
 b=0dB2sHiu3KVnTdh4OeklpqYuvQEmedECcDEWHVg3kBzx6uk83DzOlWQeSrO7DsXhAk
 9AXRWCetDYgc5n4uK4CuFTOhATaEudCOfLnklJEvXyIC/gJACzs83sCvGR1FoNg6vzv7
 49ZwTPdWvfDtKNtId1LFFTxNjmJshliVBcLrYv5Gcdvdd21/OnZJ4cUoP+ki6TdhD/aD
 2lRlpZxYgtt5jUDiT03VdKonuu6V01a8gI2MSPAPhDwMFNtoPBtv/TqAOiBLloApApUj
 OeJlzwRTwjH/AQbolUql4AgXjgFC6hub5ZjvRzOEf5gaFhnkPlatuTaE4qAnridMw1aU
 /yMg==
MIME-Version: 1.0
X-Received: by 10.140.47.48 with SMTP id l45mr15487167qga.24.1404103166009;
 Sun, 29 Jun 2014 21:39:26 -0700 (PDT)
Sender: adrian.chadd@gmail.com
Received: by 10.224.202.193 with HTTP; Sun, 29 Jun 2014 21:39:25 -0700 (PDT)
In-Reply-To: <201406300434.s5U4YxGY043870@svn.freebsd.org>
References: <201406300434.s5U4YxGY043870@svn.freebsd.org>
Date: Sun, 29 Jun 2014 21:39:25 -0700
X-Google-Sender-Auth: lwrhkFBgW9uTgycPkUpC4PeTIME
Message-ID: 
Subject: Re: svn commit: r268028 - head/sys/dev/e1000
From: Adrian Chadd 
To: "src-committers@freebsd.org" , 
 "svn-src-all@freebsd.org" , 
 "svn-src-head@freebsd.org" 
Content-Type: text/plain; charset=UTF-8
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 04:39:27 -0000

Reviewed by: jfv, gnn

On 29 June 2014 21:34, Adrian Chadd  wrote:
> Author: adrian
> Date: Mon Jun 30 04:34:59 2014
> New Revision: 268028
> URL: http://svnweb.freebsd.org/changeset/base/268028
>
> Log:
>   Add initial RSS awareness to the igb(4) driver.
>
>   The igb(4) hardware is capable of RSS hashing RX packets and doing RSS
>   queue selection for up to 8 queues.  (I believe some hardware is limited
>   to 4 queues, but I haven't tested on that.)
>
>   However, even if multi-queue is enabled for igb(4), the RX path doesn't use
>   the RSS flowid from the received descriptor.  It just uses the MSIX queue id.
>
>   This patch does a handful of things if RSS is enabled:
>
>   * Instead of using a random key at boot, fetch the RSS key from the RSS code
>     and program that in to the RSS redirection table.
>
>     That whole chunk of code should be double checked for endian correctness.
>
>   * Use the RSS queue mapping to CPU ID to figure out where to thread pin
>     the RX swi thread and the taskqueue threads for each queue.
>
>   * The software queue is now really an "RSS bucket".
>
>   * When programming the RSS indirection table, use the RSS code to
>     figure out which RSS bucket each slot in the indirection table maps
>     to.
>
>   * When transmitting, use the flowid RSS mapping if the mbuf has
>     an RSS aware hash.  The existing method wasn't guaranteed to align
>     correctly with the destination RSS bucket (and thus CPU ID.)
>
>   This code warns if the number of RSS buckets isn't the same as the
>   automatically configured number of hardware queues.  The administrator
>   will have to tweak one of them for better performance.
>
>   There's currently no way to re-balance the RSS indirection table after
>   startup.  I'll worry about that later.
>
>   Additionally, it may be worthwhile to always use the full 32 bit flowid if
>   multi-queue is enabled.  It'll make things like lagg(4) behave better with
>   respect to traffic distribution.
>
> Modified:
>   head/sys/dev/e1000/if_igb.c
>
> Modified: head/sys/dev/e1000/if_igb.c
> ==============================================================================
> --- head/sys/dev/e1000/if_igb.c Mon Jun 30 04:26:29 2014        (r268027)
> +++ head/sys/dev/e1000/if_igb.c Mon Jun 30 04:34:59 2014        (r268028)
> @@ -35,6 +35,7 @@
>
>  #include "opt_inet.h"
>  #include "opt_inet6.h"
> +#include "opt_rss.h"
>
>  #ifdef HAVE_KERNEL_OPTION_HEADERS
>  #include "opt_device_polling.h"
> @@ -84,6 +85,9 @@
>  #include 
>  #include 
>  #include 
> +#ifdef RSS
> +#include 
> +#endif
>
>  #include 
>  #include 
> @@ -967,12 +971,33 @@ igb_mq_start(struct ifnet *ifp, struct m
>         struct igb_queue        *que;
>         struct tx_ring          *txr;
>         int                     i, err = 0;
> +#ifdef RSS
> +       uint32_t                bucket_id;
> +#endif
>
>         /* Which queue to use */
> -       if ((m->m_flags & M_FLOWID) != 0)
> -               i = m->m_pkthdr.flowid % adapter->num_queues;
> -       else
> +       /*
> +        * When doing RSS, map it to the same outbound queue
> +        * as the incoming flow would be mapped to.
> +        *
> +        * If everything is setup correctly, it should be the
> +        * same bucket that the current CPU we're on is.
> +        */
> +       if ((m->m_flags & M_FLOWID) != 0) {
> +#ifdef RSS
> +               if (rss_hash2bucket(m->m_pkthdr.flowid,
> +                   M_HASHTYPE_GET(m), &bucket_id) == 0) {
> +                       /* XXX TODO: spit out something if bucket_id > num_queues? */
> +                       i = bucket_id % adapter->num_queues;
> +               } else {
> +#endif
> +                       i = m->m_pkthdr.flowid % adapter->num_queues;
> +#ifdef RSS
> +               }
> +#endif
> +       } else {
>                 i = curcpu % adapter->num_queues;
> +       }
>         txr = &adapter->tx_rings[i];
>         que = &adapter->queues[i];
>
> @@ -2433,11 +2458,34 @@ igb_allocate_msix(struct adapter *adapte
>         device_t                dev = adapter->dev;
>         struct igb_queue        *que = adapter->queues;
>         int                     error, rid, vector = 0;
> +       int                     cpu_id;
>
>         /* Be sure to start with all interrupts disabled */
>         E1000_WRITE_REG(&adapter->hw, E1000_IMC, ~0);
>         E1000_WRITE_FLUSH(&adapter->hw);
>
> +#ifdef RSS
> +       /*
> +        * If we're doing RSS, the number of queues needs to
> +        * match the number of RSS buckets that are configured.
> +        *
> +        * + If there's more queues than RSS buckets, we'll end
> +        *   up with queues that get no traffic.
> +        *
> +        * + If there's more RSS buckets than queues, we'll end
> +        *   up having multiple RSS buckets map to the same queue,
> +        *   so there'll be some contention.
> +        */
> +       if (adapter->num_queues != rss_getnumbuckets()) {
> +               device_printf(dev,
> +                   "%s: number of queues (%d) != number of RSS buckets (%d)"
> +                   "; performance will be impacted.\n",
> +                   __func__,
> +                   adapter->num_queues,
> +                   rss_getnumbuckets());
> +       }
> +#endif
> +
>         for (int i = 0; i < adapter->num_queues; i++, vector++, que++) {
>                 rid = vector +1;
>                 que->res = bus_alloc_resource_any(dev,
> @@ -2464,19 +2512,42 @@ igb_allocate_msix(struct adapter *adapte
>                         que->eims = E1000_EICR_TX_QUEUE0 << i;
>                 else
>                         que->eims = 1 << vector;
> +
> +#ifdef RSS
>                 /*
> -               ** Bind the msix vector, and thus the
> -               ** rings to the corresponding cpu.
> -               */
> +                * The queue ID is used as the RSS layer bucket ID.
> +                * We look up the queue ID -> RSS CPU ID and select
> +                * that.
> +                */
> +               cpu_id = rss_getcpu(i % rss_getnumbuckets());
> +#else
> +               /*
> +                * Bind the msix vector, and thus the
> +                * rings to the corresponding cpu.
> +                *
> +                * This just happens to match the default RSS round-robin
> +                * bucket -> queue -> CPU allocation.
> +                */
>                 if (adapter->num_queues > 1) {
>                         if (igb_last_bind_cpu < 0)
>                                 igb_last_bind_cpu = CPU_FIRST();
> -                       bus_bind_intr(dev, que->res, igb_last_bind_cpu);
> +                       cpu_id = igb_last_bind_cpu;
> +               }
> +#endif
> +
> +               if (adapter->num_queues > 1) {
> +                       bus_bind_intr(dev, que->res, cpu_id);
> +#ifdef RSS
> +                       device_printf(dev,
> +                               "Bound queue %d to RSS bucket %d\n",
> +                               i, cpu_id);
> +#else
>                         device_printf(dev,
>                                 "Bound queue %d to cpu %d\n",
> -                               i,igb_last_bind_cpu);
> -                       igb_last_bind_cpu = CPU_NEXT(igb_last_bind_cpu);
> +                               i, cpu_id);
> +#endif
>                 }
> +
>  #ifndef IGB_LEGACY_TX
>                 TASK_INIT(&que->txr->txq_task, 0, igb_deferred_mq_start,
>                     que->txr);
> @@ -2485,8 +2556,34 @@ igb_allocate_msix(struct adapter *adapte
>                 TASK_INIT(&que->que_task, 0, igb_handle_que, que);
>                 que->tq = taskqueue_create("igb_que", M_NOWAIT,
>                     taskqueue_thread_enqueue, &que->tq);
> -               taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que",
> -                   device_get_nameunit(adapter->dev));
> +               if (adapter->num_queues > 1) {
> +                       /*
> +                        * Only pin the taskqueue thread to a CPU if
> +                        * RSS is in use.
> +                        *
> +                        * This again just happens to match the default RSS
> +                        * round-robin bucket -> queue -> CPU allocation.
> +                        */
> +#ifdef RSS
> +                       taskqueue_start_threads_pinned(&que->tq, 1, PI_NET,
> +                           cpu_id,
> +                           "%s que (bucket %d)",
> +                           device_get_nameunit(adapter->dev),
> +                           cpu_id);
> +#else
> +                       taskqueue_start_threads(&que->tq, 1, PI_NET,
> +                           "%s que (qid %d)",
> +                           device_get_nameunit(adapter->dev),
> +                           cpu_id);
> +#endif
> +               } else {
> +                       taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que",
> +                           device_get_nameunit(adapter->dev));
> +               }
> +
> +               /* Finally update the last bound CPU id */
> +               if (adapter->num_queues > 1)
> +                       igb_last_bind_cpu = CPU_NEXT(igb_last_bind_cpu);
>         }
>
>         /* And Link */
> @@ -2763,6 +2860,13 @@ igb_setup_msix(struct adapter *adapter)
>         /* Figure out a reasonable auto config value */
>         queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus;
>
> +#ifdef RSS
> +       /* If we're doing RSS, clamp at the number of RSS buckets */
> +       if (queues > rss_getnumbuckets())
> +               queues = rss_getnumbuckets();
> +#endif
> +
> +
>         /* Manual override */
>         if (igb_num_queues != 0)
>                 queues = igb_num_queues;
> @@ -4455,6 +4559,99 @@ fail:
>         return (ENOBUFS);
>  }
>
> +/*
> + * Initialise the RSS mapping for NICs that support multiple transmit/
> + * receive rings.
> + */
> +static void
> +igb_initialise_rss_mapping(struct adapter *adapter)
> +{
> +       struct e1000_hw *hw = &adapter->hw;
> +       int i;
> +       int queue_id;
> +
> +       u32 rss_key[10], mrqc, shift = 0;
> +       union igb_reta {
> +               u32 dword;
> +               u8  bytes[4];
> +       } reta;
> +
> +       /* XXX? */
> +       if (adapter->hw.mac.type == e1000_82575)
> +               shift = 6;
> +
> +       /*
> +        * The redirection table controls which destination
> +        * queue each bucket redirects traffic to.
> +        * Each DWORD represents four queues, with the LSB
> +        * being the first queue in the DWORD.
> +        *
> +        * This just allocates buckets to queues using round-robin
> +        * allocation.
> +        *
> +        * NOTE: It Just Happens to line up with the default
> +        * RSS allocation method.
> +        */
> +
> +       /* Warning FM follows */
> +       for (i = 0; i < 128; i++) {
> +#ifdef RSS
> +               queue_id = rss_get_indirection_to_bucket(i);
> +               /*
> +                * If we have more queues than buckets, we'll
> +                * end up mapping buckets to a subset of the
> +                * queues.
> +                *
> +                * If we have more buckets than queues, we'll
> +                * end up instead assigning multiple buckets
> +                * to queues.
> +                *
> +                * Both are suboptimal, but we need to handle
> +                * the case so we don't go out of bounds
> +                * indexing arrays and such.
> +                */
> +               queue_id = queue_id % adapter->num_queues;
> +#else
> +               queue_id = (i % adapter->num_queues);
> +#endif
> +               reta.bytes[i & 3] = queue_id << shift;
> +
> +               if ((i & 3) == 3)
> +                       E1000_WRITE_REG(hw,
> +                           E1000_RETA(i >> 2), reta.dword);
> +       }
> +
> +
> +       /* Now fill in hash table */
> +
> +       /* XXX This means RSS enable + 8 queues for my igb (82580.) */
> +       mrqc = E1000_MRQC_ENABLE_RSS_4Q;
> +
> +#ifdef RSS
> +       /* XXX ew typecasting */
> +       rss_getkey((uint8_t *) &rss_key);
> +#else
> +       arc4rand(&rss_key, sizeof(rss_key), 0);
> +#endif
> +       for (i = 0; i < 10; i++)
> +               E1000_WRITE_REG_ARRAY(hw,
> +                   E1000_RSSRK(0), i, rss_key[i]);
> +
> +       /*
> +        * Configure the RSS fields to hash upon.
> +        */
> +       mrqc |= (E1000_MRQC_RSS_FIELD_IPV4 |
> +           E1000_MRQC_RSS_FIELD_IPV4_TCP);
> +       mrqc |= (E1000_MRQC_RSS_FIELD_IPV6 |
> +           E1000_MRQC_RSS_FIELD_IPV6_TCP);
> +       mrqc |=( E1000_MRQC_RSS_FIELD_IPV4_UDP |
> +           E1000_MRQC_RSS_FIELD_IPV6_UDP);
> +       mrqc |=( E1000_MRQC_RSS_FIELD_IPV6_UDP_EX |
> +           E1000_MRQC_RSS_FIELD_IPV6_TCP_EX);
> +
> +       E1000_WRITE_REG(hw, E1000_MRQC, mrqc);
> +}
> +
>  /*********************************************************************
>   *
>   *  Enable receive unit.
> @@ -4538,39 +4735,9 @@ igb_initialize_receive_units(struct adap
>         */
>         rxcsum = E1000_READ_REG(hw, E1000_RXCSUM);
>         if (adapter->num_queues >1) {
> -               u32 random[10], mrqc, shift = 0;
> -               union igb_reta {
> -                       u32 dword;
> -                       u8  bytes[4];
> -               } reta;
> -
> -               arc4rand(&random, sizeof(random), 0);
> -               if (adapter->hw.mac.type == e1000_82575)
> -                       shift = 6;
> -               /* Warning FM follows */
> -               for (int i = 0; i < 128; i++) {
> -                       reta.bytes[i & 3] =
> -                           (i % adapter->num_queues) << shift;
> -                       if ((i & 3) == 3)
> -                               E1000_WRITE_REG(hw,
> -                                   E1000_RETA(i >> 2), reta.dword);
> -               }
> -               /* Now fill in hash table */
> -               mrqc = E1000_MRQC_ENABLE_RSS_4Q;
> -               for (int i = 0; i < 10; i++)
> -                       E1000_WRITE_REG_ARRAY(hw,
> -                           E1000_RSSRK(0), i, random[i]);
> -
> -               mrqc |= (E1000_MRQC_RSS_FIELD_IPV4 |
> -                   E1000_MRQC_RSS_FIELD_IPV4_TCP);
> -               mrqc |= (E1000_MRQC_RSS_FIELD_IPV6 |
> -                   E1000_MRQC_RSS_FIELD_IPV6_TCP);
> -               mrqc |=( E1000_MRQC_RSS_FIELD_IPV4_UDP |
> -                   E1000_MRQC_RSS_FIELD_IPV6_UDP);
> -               mrqc |=( E1000_MRQC_RSS_FIELD_IPV6_UDP_EX |
> -                   E1000_MRQC_RSS_FIELD_IPV6_TCP_EX);
>
> -               E1000_WRITE_REG(hw, E1000_MRQC, mrqc);
> +               /* rss setup */
> +               igb_initialise_rss_mapping(adapter);
>
>                 /*
>                 ** NOTE: Receive Full-Packet Checksum Offload
> @@ -4831,7 +4998,7 @@ igb_rxeof(struct igb_queue *que, int cou
>         for (i = rxr->next_to_check; count != 0;) {
>                 struct mbuf             *sendmp, *mh, *mp;
>                 struct igb_rx_buf       *rxbuf;
> -               u16                     hlen, plen, hdr, vtag;
> +               u16                     hlen, plen, hdr, vtag, pkt_info;
>                 bool                    eop = FALSE;
>
>                 cur = &rxr->rx_base[i];
> @@ -4853,6 +5020,7 @@ igb_rxeof(struct igb_queue *que, int cou
>                 else
>                         vtag = le16toh(cur->wb.upper.vlan);
>                 hdr = le16toh(cur->wb.lower.lo_dword.hs_rss.hdr_info);
> +               pkt_info = le16toh(cur->wb.lower.lo_dword.hs_rss.pkt_info);
>                 eop = ((staterr & E1000_RXD_STAT_EOP) == E1000_RXD_STAT_EOP);
>
>                 /* Make sure all segments of a bad packet are discarded */
> @@ -4952,7 +5120,43 @@ igb_rxeof(struct igb_queue *que, int cou
>                                 rxr->fmp->m_pkthdr.ether_vtag = vtag;
>                                 rxr->fmp->m_flags |= M_VLANTAG;
>                         }
> -#ifndef IGB_LEGACY_TX
> +#ifdef RSS
> +                       /* XXX set flowtype once this works right */
> +                       rxr->fmp->m_pkthdr.flowid =
> +                           le32toh(cur->wb.lower.hi_dword.rss);
> +                       rxr->fmp->m_flags |= M_FLOWID;
> +                       switch (pkt_info & E1000_RXDADV_RSSTYPE_MASK) {
> +                       case E1000_RXDADV_RSSTYPE_IPV4_TCP:
> +                               M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_RSS_TCP_IPV4);
> +                               break;
> +                       case E1000_RXDADV_RSSTYPE_IPV4:
> +                               M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_RSS_IPV4);
> +                               break;
> +                       case E1000_RXDADV_RSSTYPE_IPV6_TCP:
> +                               M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_RSS_TCP_IPV6);
> +                               break;
> +                       case E1000_RXDADV_RSSTYPE_IPV6_EX:
> +                               M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_RSS_IPV6_EX);
> +                               break;
> +                       case E1000_RXDADV_RSSTYPE_IPV6:
> +                               M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_RSS_IPV6);
> +                               break;
> +                       case E1000_RXDADV_RSSTYPE_IPV6_TCP_EX:
> +                               M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_RSS_TCP_IPV6_EX);
> +                               break;
> +
> +                       /* XXX no UDP support in RSS just yet */
> +#ifdef notyet
> +                       case E1000_RXDADV_RSSTYPE_IPV4_UDP:
> +                       case E1000_RXDADV_RSSTYPE_IPV6_UDP:
> +                       case E1000_RXDADV_RSSTYPE_IPV6_UDP_EX:
> +#endif
> +
> +                       default:
> +                               /* XXX fallthrough */
> +                               M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_NONE);
> +                       }
> +#elif !defined(IGB_LEGACY_TX)
>                         rxr->fmp->m_pkthdr.flowid = que->msix;
>                         rxr->fmp->m_flags |= M_FLOWID;
>  #endif
>

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 04:39:34 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 04A84258;
 Mon, 30 Jun 2014 04:39:34 +0000 (UTC)
Received: from mail-qa0-x231.google.com (mail-qa0-x231.google.com
 [IPv6:2607:f8b0:400d:c00::231])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 987E529AD;
 Mon, 30 Jun 2014 04:39:33 +0000 (UTC)
Received: by mail-qa0-f49.google.com with SMTP id w8so5911276qac.36
 for ; Sun, 29 Jun 2014 21:39:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date:message-id:subject
 :from:to:content-type;
 bh=sIPhOE6wXw8vnHpkJNntKILJVxhuGwnIH+1bSEHlUAM=;
 b=Vv7oyUfcL+uVNBQMFFGpU8Z6vyUvJPkM9g/ybmEhP27PI8oh09CDd+lHVkfAjKJ7Jo
 cUgcZQ2zwleTKXhHTeZOpIih2XVtarhoCLxEySY3l9V9DrvwIJgSkNHubBc+aUXpUDE1
 rD8BSGUQAncCx02GCkxYLod8OAYhM/G+YygmpRhxaNNEf46I25fLQboPbsOdSzJr3n3N
 500iMnwYAebsDHJXRWqc35uSTbmZCSh07R+SSvHcTvctHw7MgYHuWDvBjs8ZR636PROw
 iBXyfgnWtAgLHx58UWSqo4JoQHcbsKVnpkm3kmJCoiPCzLmulwBiiE/envgEWU+zSxsb
 1G/w==
MIME-Version: 1.0
X-Received: by 10.224.130.201 with SMTP id u9mr56400543qas.98.1404103172744;
 Sun, 29 Jun 2014 21:39:32 -0700 (PDT)
Sender: adrian.chadd@gmail.com
Received: by 10.224.202.193 with HTTP; Sun, 29 Jun 2014 21:39:32 -0700 (PDT)
In-Reply-To: <201406300438.s5U4cTVF044431@svn.freebsd.org>
References: <201406300438.s5U4cTVF044431@svn.freebsd.org>
Date: Sun, 29 Jun 2014 21:39:32 -0700
X-Google-Sender-Auth: 0sBhY199QpBT3RYVhP_2xw3o_HE
Message-ID: 
Subject: Re: svn commit: r268029 - head/sys/dev/ixgbe
From: Adrian Chadd 
To: "src-committers@freebsd.org" , 
 "svn-src-all@freebsd.org" , 
 "svn-src-head@freebsd.org" 
Content-Type: text/plain; charset=UTF-8
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 04:39:34 -0000

Reviewed by: jfv, gnn

On 29 June 2014 21:38, Adrian Chadd  wrote:
> Author: adrian
> Date: Mon Jun 30 04:38:29 2014
> New Revision: 268029
> URL: http://svnweb.freebsd.org/changeset/base/268029
>
> Log:
>   Add initial RSS awareness to the ixgbe(4) driver.
>
>   The ixgbe(4) hardware is capable of RSS hashing RX packets and doing RSS
>   queue selection for up to 8 queues.
>
>   However, even if multi-queue is enabled for ixgbe(4), the RX path doesn't use
>   the RSS flowid from the received descriptor.  It just uses the MSIX queue id.
>
>   This patch does a handful of things if RSS is enabled:
>
>   * Instead of using a random key at boot, fetch the RSS key from the RSS code
>     and program that in to the RSS redirection table.
>
>     That whole chunk of code should be double checked for endian correctness.
>
>   * Use the RSS queue mapping to CPU ID to figure out where to thread pin
>     the RX swi thread and the taskqueue threads for each queue.
>
>   * The software queue is now really an "RSS bucket".
>
>   * When programming the RSS indirection table, use the RSS code to
>     figure out which RSS bucket each slot in the indirection table maps
>     to.
>
>   * When transmitting, use the flowid RSS mapping if the mbuf has
>     an RSS aware hash.  The existing method wasn't guaranteed to align
>     correctly with the destination RSS bucket (and thus CPU ID.)
>
>   This code warns if the number of RSS buckets isn't the same as the
>   automatically configured number of hardware queues.  The administrator
>   will have to tweak one of them for better performance.
>
>   There's currently no way to re-balance the RSS indirection table after
>   startup.  I'll worry about that later.
>
>   Additionally, it may be worthwhile to always use the full 32 bit flowid if
>   multi-queue is enabled.  It'll make things like lagg(4) behave better with
>   respect to traffic distribution.
>
> Modified:
>   head/sys/dev/ixgbe/ixgbe.c
>
> Modified: head/sys/dev/ixgbe/ixgbe.c
> ==============================================================================
> --- head/sys/dev/ixgbe/ixgbe.c  Mon Jun 30 04:34:59 2014        (r268028)
> +++ head/sys/dev/ixgbe/ixgbe.c  Mon Jun 30 04:38:29 2014        (r268029)
> @@ -35,8 +35,13 @@
>
>  #include "opt_inet.h"
>  #include "opt_inet6.h"
> +#include "opt_rss.h"
>  #include "ixgbe.h"
>
> +#ifdef RSS
> +#include 
> +#endif
> +
>  /*********************************************************************
>   *  Set this to one to display debug statistics
>   *********************************************************************/
> @@ -809,12 +814,33 @@ ixgbe_mq_start(struct ifnet *ifp, struct
>         struct ix_queue *que;
>         struct tx_ring  *txr;
>         int             i, err = 0;
> +#ifdef RSS
> +       uint32_t bucket_id;
> +#endif
>
>         /* Which queue to use */
> -       if ((m->m_flags & M_FLOWID) != 0)
> -               i = m->m_pkthdr.flowid % adapter->num_queues;
> -       else
> +       /*
> +        * When doing RSS, map it to the same outbound queue
> +        * as the incoming flow would be mapped to.
> +        *
> +        * If everything is setup correctly, it should be the
> +        * same bucket that the current CPU we're on is.
> +        */
> +       if ((m->m_flags & M_FLOWID) != 0) {
> +#ifdef RSS
> +               if (rss_hash2bucket(m->m_pkthdr.flowid,
> +                   M_HASHTYPE_GET(m), &bucket_id) == 0) {
> +                       /* XXX TODO: spit out something if bucket_id > num_queues? */
> +                       i = bucket_id % adapter->num_queues;
> +               } else {
> +#endif
> +                       i = m->m_pkthdr.flowid % adapter->num_queues;
> +#ifdef RSS
> +               }
> +#endif
> +       } else {
>                 i = curcpu % adapter->num_queues;
> +       }
>
>         txr = &adapter->tx_rings[i];
>         que = &adapter->queues[i];
> @@ -2338,6 +2364,31 @@ ixgbe_allocate_msix(struct adapter *adap
>         struct          ix_queue *que = adapter->queues;
>         struct          tx_ring *txr = adapter->tx_rings;
>         int             error, rid, vector = 0;
> +       int             cpu_id;
> +
> +#ifdef RSS
> +       /*
> +        * If we're doing RSS, the number of queues needs to
> +        * match the number of RSS buckets that are configured.
> +        *
> +        * + If there's more queues than RSS buckets, we'll end
> +        *   up with queues that get no traffic.
> +        *
> +        * + If there's more RSS buckets than queues, we'll end
> +        *   up having multiple RSS buckets map to the same queue,
> +        *   so there'll be some contention.
> +        */
> +       if (adapter->num_queues != rss_getnumbuckets()) {
> +               device_printf(dev,
> +                   "%s: number of queues (%d) != number of RSS buckets (%d)"
> +                   "; performance will be impacted.\n",
> +                   __func__,
> +                   adapter->num_queues,
> +                   rss_getnumbuckets());
> +       }
> +#endif
> +
> +
>
>         for (int i = 0; i < adapter->num_queues; i++, vector++, que++, txr++) {
>                 rid = vector + 1;
> @@ -2362,12 +2413,37 @@ ixgbe_allocate_msix(struct adapter *adap
>  #endif
>                 que->msix = vector;
>                 adapter->que_mask |= (u64)(1 << que->msix);
> +#ifdef RSS
>                 /*
> -               ** Bind the msix vector, and thus the
> -               ** ring to the corresponding cpu.
> -               */
> +                * The queue ID is used as the RSS layer bucket ID.
> +                * We look up the queue ID -> RSS CPU ID and select
> +                * that.
> +                */
> +               cpu_id = rss_getcpu(i % rss_getnumbuckets());
> +#else
> +               /*
> +                * Bind the msix vector, and thus the
> +                * rings to the corresponding cpu.
> +                *
> +                * This just happens to match the default RSS round-robin
> +                * bucket -> queue -> CPU allocation.
> +                */
>                 if (adapter->num_queues > 1)
> -                       bus_bind_intr(dev, que->res, i);
> +                       cpu_id = i;
> +#endif
> +               if (adapter->num_queues > 1)
> +                       bus_bind_intr(dev, que->res, cpu_id);
> +
> +#ifdef RSS
> +               device_printf(dev,
> +                   "Bound RSS bucket %d to CPU %d\n",
> +                   i, cpu_id);
> +#else
> +               device_printf(dev,
> +                   "Bound queue %d to cpu %d\n",
> +                   i, cpu_id);
> +#endif
> +
>
>  #ifndef IXGBE_LEGACY_TX
>                 TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr);
> @@ -2375,8 +2451,16 @@ ixgbe_allocate_msix(struct adapter *adap
>                 TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que);
>                 que->tq = taskqueue_create_fast("ixgbe_que", M_NOWAIT,
>                     taskqueue_thread_enqueue, &que->tq);
> +#ifdef RSS
> +               taskqueue_start_threads_pinned(&que->tq, 1, PI_NET,
> +                   cpu_id,
> +                   "%s (bucket %d)",
> +                   device_get_nameunit(adapter->dev),
> +                   cpu_id);
> +#else
>                 taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que",
>                     device_get_nameunit(adapter->dev));
> +#endif
>         }
>
>         /* and Link */
> @@ -2450,6 +2534,11 @@ ixgbe_setup_msix(struct adapter *adapter
>
>         /* Figure out a reasonable auto config value */
>         queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus;
> +#ifdef RSS
> +       /* If we're doing RSS, clamp at the number of RSS buckets */
> +       if (queues > rss_getnumbuckets())
> +               queues = rss_getnumbuckets();
> +#endif
>
>         if (ixgbe_num_queues != 0)
>                 queues = ixgbe_num_queues;
> @@ -4107,6 +4196,65 @@ fail:
>         return (ENOBUFS);
>  }
>
> +static void
> +ixgbe_initialise_rss_mapping(struct adapter *adapter)
> +{
> +       struct ixgbe_hw *hw = &adapter->hw;
> +       uint32_t reta;
> +       int i, j, queue_id;
> +       uint32_t rss_key[10];
> +       uint32_t mrqc;
> +
> +       /* Setup RSS */
> +       reta = 0;
> +
> +#ifdef RSS
> +       /* Fetch the configured RSS key */
> +       rss_getkey((uint8_t *) &rss_key);
> +#else
> +       /* set up random bits */
> +       arc4rand(&rss_key, sizeof(rss_key), 0);
> +#endif
> +
> +       /* Set up the redirection table */
> +       for (i = 0, j = 0; i < 128; i++, j++) {
> +               if (j == adapter->num_queues) j = 0;
> +#ifdef RSS
> +               /*
> +                * Fetch the RSS bucket id for the given indirection entry.
> +                * Cap it at the number of configured buckets (which is
> +                * num_queues.)
> +                */
> +               queue_id = rss_get_indirection_to_bucket(i);
> +               queue_id = queue_id % adapter->num_queues;
> +#else
> +               queue_id = (j * 0x11);
> +#endif
> +               /* XXX endian? */
> +               reta = (reta << 8) | queue_id;
> +               if ((i & 3) == 3)
> +                       IXGBE_WRITE_REG(hw, IXGBE_RETA(i >> 2), reta);
> +       }
> +
> +       /* Now fill our hash function seeds */
> +       for (int i = 0; i < 10; i++)
> +               IXGBE_WRITE_REG(hw, IXGBE_RSSRK(i), rss_key[i]);
> +
> +       /* Perform hash on these packet types */
> +       mrqc = IXGBE_MRQC_RSSEN
> +            | IXGBE_MRQC_RSS_FIELD_IPV4
> +            | IXGBE_MRQC_RSS_FIELD_IPV4_TCP
> +            | IXGBE_MRQC_RSS_FIELD_IPV4_UDP
> +            | IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP
> +            | IXGBE_MRQC_RSS_FIELD_IPV6_EX
> +            | IXGBE_MRQC_RSS_FIELD_IPV6
> +            | IXGBE_MRQC_RSS_FIELD_IPV6_TCP
> +            | IXGBE_MRQC_RSS_FIELD_IPV6_UDP
> +            | IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP;
> +       IXGBE_WRITE_REG(hw, IXGBE_MRQC, mrqc);
> +}
> +
> +
>  /*********************************************************************
>   *
>   *  Setup receive registers and features.
> @@ -4123,7 +4271,7 @@ ixgbe_initialize_receive_units(struct ad
>         struct ixgbe_hw *hw = &adapter->hw;
>         struct ifnet   *ifp = adapter->ifp;
>         u32             bufsz, rxctrl, fctrl, srrctl, rxcsum;
> -       u32             reta, mrqc = 0, hlreg, random[10];
> +       u32             hlreg;
>
>
>         /*
> @@ -4195,39 +4343,9 @@ ixgbe_initialize_receive_units(struct ad
>
>         rxcsum = IXGBE_READ_REG(hw, IXGBE_RXCSUM);
>
> -       /* Setup RSS */
> -       if (adapter->num_queues > 1) {
> -               int i, j;
> -               reta = 0;
> -
> -               /* set up random bits */
> -               arc4rand(&random, sizeof(random), 0);
> -
> -               /* Set up the redirection table */
> -               for (i = 0, j = 0; i < 128; i++, j++) {
> -                       if (j == adapter->num_queues) j = 0;
> -                       reta = (reta << 8) | (j * 0x11);
> -                       if ((i & 3) == 3)
> -                               IXGBE_WRITE_REG(hw, IXGBE_RETA(i >> 2), reta);
> -               }
> -
> -               /* Now fill our hash function seeds */
> -               for (int i = 0; i < 10; i++)
> -                       IXGBE_WRITE_REG(hw, IXGBE_RSSRK(i), random[i]);
> -
> -               /* Perform hash on these packet types */
> -               mrqc = IXGBE_MRQC_RSSEN
> -                    | IXGBE_MRQC_RSS_FIELD_IPV4
> -                    | IXGBE_MRQC_RSS_FIELD_IPV4_TCP
> -                    | IXGBE_MRQC_RSS_FIELD_IPV4_UDP
> -                    | IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP
> -                    | IXGBE_MRQC_RSS_FIELD_IPV6_EX
> -                    | IXGBE_MRQC_RSS_FIELD_IPV6
> -                    | IXGBE_MRQC_RSS_FIELD_IPV6_TCP
> -                    | IXGBE_MRQC_RSS_FIELD_IPV6_UDP
> -                    | IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP;
> -               IXGBE_WRITE_REG(hw, IXGBE_MRQC, mrqc);
> +       ixgbe_initialise_rss_mapping(adapter);
>
> +       if (adapter->num_queues > 1) {
>                 /* RSS and RX IPP Checksum are mutually exclusive */
>                 rxcsum |= IXGBE_RXCSUM_PCSD;
>         }
> @@ -4400,6 +4518,7 @@ ixgbe_rxeof(struct ix_queue *que)
>         u16                     count = rxr->process_limit;
>         union ixgbe_adv_rx_desc *cur;
>         struct ixgbe_rx_buf     *rbuf, *nbuf;
> +       u16                     pkt_info;
>
>         IXGBE_RX_LOCK(rxr);
>
> @@ -4424,6 +4543,7 @@ ixgbe_rxeof(struct ix_queue *que)
>
>                 cur = &rxr->rx_base[i];
>                 staterr = le32toh(cur->wb.upper.status_error);
> +               pkt_info = le16toh(cur->wb.lower.lo_dword.hs_rss.pkt_info);
>
>                 if ((staterr & IXGBE_RXD_STAT_DD) == 0)
>                         break;
> @@ -4556,9 +4676,44 @@ ixgbe_rxeof(struct ix_queue *que)
>                         if ((ifp->if_capenable & IFCAP_RXCSUM) != 0)
>                                 ixgbe_rx_checksum(staterr, sendmp, ptype);
>  #if __FreeBSD_version >= 800000
> +#ifdef RSS
> +                       sendmp->m_pkthdr.flowid =
> +                           le32toh(cur->wb.lower.hi_dword.rss);
> +                       sendmp->m_flags |= M_FLOWID;
> +                       switch (pkt_info & IXGBE_RXDADV_RSSTYPE_MASK) {
> +                       case IXGBE_RXDADV_RSSTYPE_IPV4_TCP:
> +                               M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_TCP_IPV4);
> +                               break;
> +                       case IXGBE_RXDADV_RSSTYPE_IPV4:
> +                               M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_IPV4);
> +                               break;
> +                       case IXGBE_RXDADV_RSSTYPE_IPV6_TCP:
> +                               M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_TCP_IPV6);
> +                               break;
> +                       case IXGBE_RXDADV_RSSTYPE_IPV6_EX:
> +                               M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_IPV6_EX);
> +                               break;
> +                       case IXGBE_RXDADV_RSSTYPE_IPV6:
> +                               M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_IPV6);
> +                               break;
> +                       case IXGBE_RXDADV_RSSTYPE_IPV6_TCP_EX:
> +                               M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_TCP_IPV6_EX);
> +                               break;
> +                       /* XXX no UDP support in RSS just yet */
> +#ifdef notyet
> +                       case IGXBE_RXDADV_RSSTYPE_IPV4_UDP:
> +                       case IGXBE_RXDADV_RSSTYPE_IPV6_UDP:
> +                       case IGXBE_RXDADV_RSSTYPE_IPV6_UDP_EX:
> +#endif /* notyet */
> +                       default:
> +                               /* XXX fallthrough */
> +                               M_HASHTYPE_SET(sendmp, M_HASHTYPE_NONE);
> +                       }
> +#else /* RSS */
>                         sendmp->m_pkthdr.flowid = que->msix;
>                         sendmp->m_flags |= M_FLOWID;
> -#endif
> +#endif /* RSS */
> +#endif /* FreeBSD_version */
>                 }
>  next_desc:
>                 bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map,
>

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 05:33:53 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 61C61606;
 Mon, 30 Jun 2014 05:33:53 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 342A42DFA;
 Mon, 30 Jun 2014 05:33:53 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5U5XrhL071294;
 Mon, 30 Jun 2014 05:33:53 GMT (envelope-from eadler@svn.freebsd.org)
Received: (from eadler@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5U5XqZj071286;
 Mon, 30 Jun 2014 05:33:52 GMT (envelope-from eadler@svn.freebsd.org)
Message-Id: <201406300533.s5U5XqZj071286@svn.freebsd.org>
From: Eitan Adler 
Date: Mon, 30 Jun 2014 05:33:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268030 - in head: etc/mtree usr.sbin/chown
 usr.sbin/chown/tests
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 05:33:53 -0000

Author: eadler
Date: Mon Jun 30 05:33:52 2014
New Revision: 268030
URL: http://svnweb.freebsd.org/changeset/base/268030

Log:
  chown: add a test
  
  Add a test for the chown utility. This sets up chown(8) to be capable of being
  tested.  As such, only add one test for now as an example.

Added:
  head/usr.sbin/chown/tests/
  head/usr.sbin/chown/tests/Makefile   (contents, props changed)
  head/usr.sbin/chown/tests/chown-f_test.sh   (contents, props changed)
Modified:
  head/etc/mtree/BSD.tests.dist
  head/usr.sbin/chown/Makefile

Modified: head/etc/mtree/BSD.tests.dist
==============================================================================
--- head/etc/mtree/BSD.tests.dist	Mon Jun 30 04:38:29 2014	(r268029)
+++ head/etc/mtree/BSD.tests.dist	Mon Jun 30 05:33:52 2014	(r268030)
@@ -21,6 +21,8 @@
     ..
     tests
         bin
+            chown
+            ..
             date
             ..
             mv

Modified: head/usr.sbin/chown/Makefile
==============================================================================
--- head/usr.sbin/chown/Makefile	Mon Jun 30 04:38:29 2014	(r268029)
+++ head/usr.sbin/chown/Makefile	Mon Jun 30 05:33:52 2014	(r268030)
@@ -1,8 +1,14 @@
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
 # $FreeBSD$
 
+.include 
+
 PROG=	chown
 LINKS=	${BINDIR}/chown /usr/bin/chgrp
 MAN=	chgrp.1 chown.8
 
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
 .include 

Added: head/usr.sbin/chown/tests/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/usr.sbin/chown/tests/Makefile	Mon Jun 30 05:33:52 2014	(r268030)
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/bin/chown
+
+TAP_TESTS_SH=			chown-f_test
+
+.include 

Added: head/usr.sbin/chown/tests/chown-f_test.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/usr.sbin/chown/tests/chown-f_test.sh	Mon Jun 30 05:33:52 2014	(r268030)
@@ -0,0 +1,21 @@
+#!/bin/sh
+# $FreeBSD$
+
+base=`basename $0`
+
+echo "1..1"
+
+name="chown -f root:wheel file"
+if [ `id -u` -eq 0 ]; then
+	echo "ok 3 - $name # skip Test must not be uid 0."
+else
+    touch file
+    output=$(chown -f root:wheel file 2>&1)
+    if [ $? -eq 0 -a -z "$output" ]
+    then
+        echo "ok 1 - $name"
+    else
+        echo "not ok 1 - $name"
+    fi
+    rm file
+fi

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 14:56:05 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D4FFA41A;
 Mon, 30 Jun 2014 14:56:05 +0000 (UTC)
Received: from mail-lb0-x236.google.com (mail-lb0-x236.google.com
 [IPv6:2a00:1450:4010:c04::236])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 7B4D02050;
 Mon, 30 Jun 2014 14:56:04 +0000 (UTC)
Received: by mail-lb0-f182.google.com with SMTP id c11so6024754lbj.13
 for ; Mon, 30 Jun 2014 07:56:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date:message-id:subject
 :from:to:cc:content-type;
 bh=s7vMybR1NxVCaIOhLV4ippWDSkyo4g2p+nrCW+ZTVXE=;
 b=zkbyyhxdjXfdSIV75YPGBDkwLRFM8R9pY4DCYdX2ujHs4GOTU0hdBdqKUFTIQaxgml
 ptcHN6lH5SolzI8HpJQFalfyT0X+AzHs2abFSGWw8rW/TNw7VxVoDW70WaFAKHjxjh+w
 hhV+Sl1cxY8bIwg/PRlhRBxxbuUZhE2OiduWIL095bfG7ozrDNlM5wsB3VPLKCc0Kwaq
 lrqRlX+ONHroky6nO+uJCNS9TCQvHwpxcFpzKZfsfMz/+zS87Vc0y98nuL14jqusyEC1
 6LBiWG8YzFjBP133ktChQFRyiv5MLn4YP2Ukpykru11tkx6R3xcXrjs+yG/OBvbHwQZe
 vCug==
MIME-Version: 1.0
X-Received: by 10.152.184.41 with SMTP id er9mr4410lac.97.1404140161942; Mon,
 30 Jun 2014 07:56:01 -0700 (PDT)
Sender: rizzo.unipi@gmail.com
Received: by 10.114.22.100 with HTTP; Mon, 30 Jun 2014 07:56:01 -0700 (PDT)
In-Reply-To: 
References: <201406300434.s5U4YxGY043870@svn.freebsd.org>
 
Date: Mon, 30 Jun 2014 16:56:01 +0200
X-Google-Sender-Auth: pPtSX84bn-f550w2ABdJ3QEX_hY
Message-ID: 
Subject: Re: svn commit: r268028 - head/sys/dev/e1000
From: Luigi Rizzo 
To: Adrian Chadd 
Content-Type: text/plain; charset=UTF-8
X-Content-Filtered-By: Mailman/MimeDel 2.1.18
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 14:56:05 -0000

I am getting the following error while compiling with gcc:

cc1: warnings being treated as errors
/usr/home/luigi/FreeBSD/head/sys/dev/e1000/if_igb.c: In function
'igb_attach':
/usr/home/luigi/FreeBSD/head/sys/dev/e1000/if_igb.c:2461: warning: 'cpu_id'
may be used uninitialized in this function
/usr/home/luigi/FreeBSD/head/sys/dev/e1000/if_igb.c:2461: note: 'cpu_id'
was declared here

(the code is correct, apparently gcc cannot understand that).

For compatibility i'd throw in an explicit initialization,
however it might be worthwhile rewriting the code with a single
if (adapter->num_queues > 1) { ...} block within the for(),
and also using only one #ifdef RSS -- the other places only
differ in the string passed to diagnostics or comments.

cheers
luigi


the code detect that
cpu_id is only used when


On Mon, Jun 30, 2014 at 6:39 AM, Adrian Chadd  wrote:

> Reviewed by: jfv, gnn
>
> On 29 June 2014 21:34, Adrian Chadd  wrote:
> > Author: adrian
> > Date: Mon Jun 30 04:34:59 2014
> > New Revision: 268028
> > URL: http://svnweb.freebsd.org/changeset/base/268028
> >
> > Log:
> >   Add initial RSS awareness to the igb(4) driver.
> >
> >   The igb(4) hardware is capable of RSS hashing RX packets and doing RSS
> >   queue selection for up to 8 queues.  (I believe some hardware is
> limited
> >   to 4 queues, but I haven't tested on that.)
> >
> >   However, even if multi-queue is enabled for igb(4), the RX path
> doesn't use
> >   the RSS flowid from the received descriptor.  It just uses the MSIX
> queue id.
> >
> >   This patch does a handful of things if RSS is enabled:
> >
> >   * Instead of using a random key at boot, fetch the RSS key from the
> RSS code
> >     and program that in to the RSS redirection table.
> >
> >     That whole chunk of code should be double checked for endian
> correctness.
> >
> >   * Use the RSS queue mapping to CPU ID to figure out where to thread pin
> >     the RX swi thread and the taskqueue threads for each queue.
> >
> >   * The software queue is now really an "RSS bucket".
> >
> >   * When programming the RSS indirection table, use the RSS code to
> >     figure out which RSS bucket each slot in the indirection table maps
> >     to.
> >
> >   * When transmitting, use the flowid RSS mapping if the mbuf has
> >     an RSS aware hash.  The existing method wasn't guaranteed to align
> >     correctly with the destination RSS bucket (and thus CPU ID.)
> >
> >   This code warns if the number of RSS buckets isn't the same as the
> >   automatically configured number of hardware queues.  The administrator
> >   will have to tweak one of them for better performance.
> >
> >   There's currently no way to re-balance the RSS indirection table after
> >   startup.  I'll worry about that later.
> >
> >   Additionally, it may be worthwhile to always use the full 32 bit
> flowid if
> >   multi-queue is enabled.  It'll make things like lagg(4) behave better
> with
> >   respect to traffic distribution.
> >
> > Modified:
> >   head/sys/dev/e1000/if_igb.c
> >
> > Modified: head/sys/dev/e1000/if_igb.c
> >
> ==============================================================================
> > --- head/sys/dev/e1000/if_igb.c Mon Jun 30 04:26:29 2014        (r268027)
> > +++ head/sys/dev/e1000/if_igb.c Mon Jun 30 04:34:59 2014        (r268028)
> > @@ -35,6 +35,7 @@
> >
> >  #include "opt_inet.h"
> >  #include "opt_inet6.h"
> > +#include "opt_rss.h"
> >
> >  #ifdef HAVE_KERNEL_OPTION_HEADERS
> >  #include "opt_device_polling.h"
> > @@ -84,6 +85,9 @@
> >  #include 
> >  #include 
> >  #include 
> > +#ifdef RSS
> > +#include 
> > +#endif
> >
> >  #include 
> >  #include 
> > @@ -967,12 +971,33 @@ igb_mq_start(struct ifnet *ifp, struct m
> >         struct igb_queue        *que;
> >         struct tx_ring          *txr;
> >         int                     i, err = 0;
> > +#ifdef RSS
> > +       uint32_t                bucket_id;
> > +#endif
> >
> >         /* Which queue to use */
> > -       if ((m->m_flags & M_FLOWID) != 0)
> > -               i = m->m_pkthdr.flowid % adapter->num_queues;
> > -       else
> > +       /*
> > +        * When doing RSS, map it to the same outbound queue
> > +        * as the incoming flow would be mapped to.
> > +        *
> > +        * If everything is setup correctly, it should be the
> > +        * same bucket that the current CPU we're on is.
> > +        */
> > +       if ((m->m_flags & M_FLOWID) != 0) {
> > +#ifdef RSS
> > +               if (rss_hash2bucket(m->m_pkthdr.flowid,
> > +                   M_HASHTYPE_GET(m), &bucket_id) == 0) {
> > +                       /* XXX TODO: spit out something if bucket_id >
> num_queues? */
> > +                       i = bucket_id % adapter->num_queues;
> > +               } else {
> > +#endif
> > +                       i = m->m_pkthdr.flowid % adapter->num_queues;
> > +#ifdef RSS
> > +               }
> > +#endif
> > +       } else {
> >                 i = curcpu % adapter->num_queues;
> > +       }
> >         txr = &adapter->tx_rings[i];
> >         que = &adapter->queues[i];
> >
> > @@ -2433,11 +2458,34 @@ igb_allocate_msix(struct adapter *adapte
> >         device_t                dev = adapter->dev;
> >         struct igb_queue        *que = adapter->queues;
> >         int                     error, rid, vector = 0;
> > +       int                     cpu_id;
> >
> >         /* Be sure to start with all interrupts disabled */
> >         E1000_WRITE_REG(&adapter->hw, E1000_IMC, ~0);
> >         E1000_WRITE_FLUSH(&adapter->hw);
> >
> > +#ifdef RSS
> > +       /*
> > +        * If we're doing RSS, the number of queues needs to
> > +        * match the number of RSS buckets that are configured.
> > +        *
> > +        * + If there's more queues than RSS buckets, we'll end
> > +        *   up with queues that get no traffic.
> > +        *
> > +        * + If there's more RSS buckets than queues, we'll end
> > +        *   up having multiple RSS buckets map to the same queue,
> > +        *   so there'll be some contention.
> > +        */
> > +       if (adapter->num_queues != rss_getnumbuckets()) {
> > +               device_printf(dev,
> > +                   "%s: number of queues (%d) != number of RSS buckets
> (%d)"
> > +                   "; performance will be impacted.\n",
> > +                   __func__,
> > +                   adapter->num_queues,
> > +                   rss_getnumbuckets());
> > +       }
> > +#endif
> > +
> >         for (int i = 0; i < adapter->num_queues; i++, vector++, que++) {
> >                 rid = vector +1;
> >                 que->res = bus_alloc_resource_any(dev,
> > @@ -2464,19 +2512,42 @@ igb_allocate_msix(struct adapter *adapte
> >                         que->eims = E1000_EICR_TX_QUEUE0 << i;
> >                 else
> >                         que->eims = 1 << vector;
> > +
> > +#ifdef RSS
> >                 /*
> > -               ** Bind the msix vector, and thus the
> > -               ** rings to the corresponding cpu.
> > -               */
> > +                * The queue ID is used as the RSS layer bucket ID.
> > +                * We look up the queue ID -> RSS CPU ID and select
> > +                * that.
> > +                */
> > +               cpu_id = rss_getcpu(i % rss_getnumbuckets());
> > +#else
> > +               /*
> > +                * Bind the msix vector, and thus the
> > +                * rings to the corresponding cpu.
> > +                *
> > +                * This just happens to match the default RSS round-robin
> > +                * bucket -> queue -> CPU allocation.
> > +                */
> >                 if (adapter->num_queues > 1) {
> >                         if (igb_last_bind_cpu < 0)
> >                                 igb_last_bind_cpu = CPU_FIRST();
> > -                       bus_bind_intr(dev, que->res, igb_last_bind_cpu);
> > +                       cpu_id = igb_last_bind_cpu;
> > +               }
> > +#endif
> > +
> > +               if (adapter->num_queues > 1) {
> > +                       bus_bind_intr(dev, que->res, cpu_id);
> > +#ifdef RSS
> > +                       device_printf(dev,
> > +                               "Bound queue %d to RSS bucket %d\n",
> > +                               i, cpu_id);
> > +#else
> >                         device_printf(dev,
> >                                 "Bound queue %d to cpu %d\n",
> > -                               i,igb_last_bind_cpu);
> > -                       igb_last_bind_cpu = CPU_NEXT(igb_last_bind_cpu);
> > +                               i, cpu_id);
> > +#endif
> >                 }
> > +
> >  #ifndef IGB_LEGACY_TX
> >                 TASK_INIT(&que->txr->txq_task, 0, igb_deferred_mq_start,
> >                     que->txr);
> > @@ -2485,8 +2556,34 @@ igb_allocate_msix(struct adapter *adapte
> >                 TASK_INIT(&que->que_task, 0, igb_handle_que, que);
> >                 que->tq = taskqueue_create("igb_que", M_NOWAIT,
> >                     taskqueue_thread_enqueue, &que->tq);
> > -               taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que",
> > -                   device_get_nameunit(adapter->dev));
> > +               if (adapter->num_queues > 1) {
> > +                       /*
> > +                        * Only pin the taskqueue thread to a CPU if
> > +                        * RSS is in use.
> > +                        *
> > +                        * This again just happens to match the default
> RSS
> > +                        * round-robin bucket -> queue -> CPU allocation.
> > +                        */
> > +#ifdef RSS
> > +                       taskqueue_start_threads_pinned(&que->tq, 1,
> PI_NET,
> > +                           cpu_id,
> > +                           "%s que (bucket %d)",
> > +                           device_get_nameunit(adapter->dev),
> > +                           cpu_id);
> > +#else
> > +                       taskqueue_start_threads(&que->tq, 1, PI_NET,
> > +                           "%s que (qid %d)",
> > +                           device_get_nameunit(adapter->dev),
> > +                           cpu_id);
> > +#endif
> > +               } else {
> > +                       taskqueue_start_threads(&que->tq, 1, PI_NET, "%s
> que",
> > +                           device_get_nameunit(adapter->dev));
> > +               }
> > +
> > +               /* Finally update the last bound CPU id */
> > +               if (adapter->num_queues > 1)
> > +                       igb_last_bind_cpu = CPU_NEXT(igb_last_bind_cpu);
> >         }
> >
> >         /* And Link */
> > @@ -2763,6 +2860,13 @@ igb_setup_msix(struct adapter *adapter)
> >         /* Figure out a reasonable auto config value */
> >         queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus;
> >
> > +#ifdef RSS
> > +       /* If we're doing RSS, clamp at the number of RSS buckets */
> > +       if (queues > rss_getnumbuckets())
> > +               queues = rss_getnumbuckets();
> > +#endif
> > +
> > +
> >         /* Manual override */
> >         if (igb_num_queues != 0)
> >                 queues = igb_num_queues;
> > @@ -4455,6 +4559,99 @@ fail:
> >         return (ENOBUFS);
> >  }
> >
> > +/*
> > + * Initialise the RSS mapping for NICs that support multiple transmit/
> > + * receive rings.
> > + */
> > +static void
> > +igb_initialise_rss_mapping(struct adapter *adapter)
> > +{
> > +       struct e1000_hw *hw = &adapter->hw;
> > +       int i;
> > +       int queue_id;
> > +
> > +       u32 rss_key[10], mrqc, shift = 0;
> > +       union igb_reta {
> > +               u32 dword;
> > +               u8  bytes[4];
> > +       } reta;
> > +
> > +       /* XXX? */
> > +       if (adapter->hw.mac.type == e1000_82575)
> > +               shift = 6;
> > +
> > +       /*
> > +        * The redirection table controls which destination
> > +        * queue each bucket redirects traffic to.
> > +        * Each DWORD represents four queues, with the LSB
> > +        * being the first queue in the DWORD.
> > +        *
> > +        * This just allocates buckets to queues using round-robin
> > +        * allocation.
> > +        *
> > +        * NOTE: It Just Happens to line up with the default
> > +        * RSS allocation method.
> > +        */
> > +
> > +       /* Warning FM follows */
> > +       for (i = 0; i < 128; i++) {
> > +#ifdef RSS
> > +               queue_id = rss_get_indirection_to_bucket(i);
> > +               /*
> > +                * If we have more queues than buckets, we'll
> > +                * end up mapping buckets to a subset of the
> > +                * queues.
> > +                *
> > +                * If we have more buckets than queues, we'll
> > +                * end up instead assigning multiple buckets
> > +                * to queues.
> > +                *
> > +                * Both are suboptimal, but we need to handle
> > +                * the case so we don't go out of bounds
> > +                * indexing arrays and such.
> > +                */
> > +               queue_id = queue_id % adapter->num_queues;
> > +#else
> > +               queue_id = (i % adapter->num_queues);
> > +#endif
> > +               reta.bytes[i & 3] = queue_id << shift;
> > +
> > +               if ((i & 3) == 3)
> > +                       E1000_WRITE_REG(hw,
> > +                           E1000_RETA(i >> 2), reta.dword);
> > +       }
> > +
> > +
> > +       /* Now fill in hash table */
> > +
> > +       /* XXX This means RSS enable + 8 queues for my igb (82580.) */
> > +       mrqc = E1000_MRQC_ENABLE_RSS_4Q;
> > +
> > +#ifdef RSS
> > +       /* XXX ew typecasting */
> > +       rss_getkey((uint8_t *) &rss_key);
> > +#else
> > +       arc4rand(&rss_key, sizeof(rss_key), 0);
> > +#endif
> > +       for (i = 0; i < 10; i++)
> > +               E1000_WRITE_REG_ARRAY(hw,
> > +                   E1000_RSSRK(0), i, rss_key[i]);
> > +
> > +       /*
> > +        * Configure the RSS fields to hash upon.
> > +        */
> > +       mrqc |= (E1000_MRQC_RSS_FIELD_IPV4 |
> > +           E1000_MRQC_RSS_FIELD_IPV4_TCP);
> > +       mrqc |= (E1000_MRQC_RSS_FIELD_IPV6 |
> > +           E1000_MRQC_RSS_FIELD_IPV6_TCP);
> > +       mrqc |=( E1000_MRQC_RSS_FIELD_IPV4_UDP |
> > +           E1000_MRQC_RSS_FIELD_IPV6_UDP);
> > +       mrqc |=( E1000_MRQC_RSS_FIELD_IPV6_UDP_EX |
> > +           E1000_MRQC_RSS_FIELD_IPV6_TCP_EX);
> > +
> > +       E1000_WRITE_REG(hw, E1000_MRQC, mrqc);
> > +}
> > +
> >  /*********************************************************************
> >   *
> >   *  Enable receive unit.
> > @@ -4538,39 +4735,9 @@ igb_initialize_receive_units(struct adap
> >         */
> >         rxcsum = E1000_READ_REG(hw, E1000_RXCSUM);
> >         if (adapter->num_queues >1) {
> > -               u32 random[10], mrqc, shift = 0;
> > -               union igb_reta {
> > -                       u32 dword;
> > -                       u8  bytes[4];
> > -               } reta;
> > -
> > -               arc4rand(&random, sizeof(random), 0);
> > -               if (adapter->hw.mac.type == e1000_82575)
> > -                       shift = 6;
> > -               /* Warning FM follows */
> > -               for (int i = 0; i < 128; i++) {
> > -                       reta.bytes[i & 3] =
> > -                           (i % adapter->num_queues) << shift;
> > -                       if ((i & 3) == 3)
> > -                               E1000_WRITE_REG(hw,
> > -                                   E1000_RETA(i >> 2), reta.dword);
> > -               }
> > -               /* Now fill in hash table */
> > -               mrqc = E1000_MRQC_ENABLE_RSS_4Q;
> > -               for (int i = 0; i < 10; i++)
> > -                       E1000_WRITE_REG_ARRAY(hw,
> > -                           E1000_RSSRK(0), i, random[i]);
> > -
> > -               mrqc |= (E1000_MRQC_RSS_FIELD_IPV4 |
> > -                   E1000_MRQC_RSS_FIELD_IPV4_TCP);
> > -               mrqc |= (E1000_MRQC_RSS_FIELD_IPV6 |
> > -                   E1000_MRQC_RSS_FIELD_IPV6_TCP);
> > -               mrqc |=( E1000_MRQC_RSS_FIELD_IPV4_UDP |
> > -                   E1000_MRQC_RSS_FIELD_IPV6_UDP);
> > -               mrqc |=( E1000_MRQC_RSS_FIELD_IPV6_UDP_EX |
> > -                   E1000_MRQC_RSS_FIELD_IPV6_TCP_EX);
> >
> > -               E1000_WRITE_REG(hw, E1000_MRQC, mrqc);
> > +               /* rss setup */
> > +               igb_initialise_rss_mapping(adapter);
> >
> >                 /*
> >                 ** NOTE: Receive Full-Packet Checksum Offload
> > @@ -4831,7 +4998,7 @@ igb_rxeof(struct igb_queue *que, int cou
> >         for (i = rxr->next_to_check; count != 0;) {
> >                 struct mbuf             *sendmp, *mh, *mp;
> >                 struct igb_rx_buf       *rxbuf;
> > -               u16                     hlen, plen, hdr, vtag;
> > +               u16                     hlen, plen, hdr, vtag, pkt_info;
> >                 bool                    eop = FALSE;
> >
> >                 cur = &rxr->rx_base[i];
> > @@ -4853,6 +5020,7 @@ igb_rxeof(struct igb_queue *que, int cou
> >                 else
> >                         vtag = le16toh(cur->wb.upper.vlan);
> >                 hdr = le16toh(cur->wb.lower.lo_dword.hs_rss.hdr_info);
> > +               pkt_info =
> le16toh(cur->wb.lower.lo_dword.hs_rss.pkt_info);
> >                 eop = ((staterr & E1000_RXD_STAT_EOP) ==
> E1000_RXD_STAT_EOP);
> >
> >                 /* Make sure all segments of a bad packet are discarded
> */
> > @@ -4952,7 +5120,43 @@ igb_rxeof(struct igb_queue *que, int cou
> >                                 rxr->fmp->m_pkthdr.ether_vtag = vtag;
> >                                 rxr->fmp->m_flags |= M_VLANTAG;
> >                         }
> > -#ifndef IGB_LEGACY_TX
> > +#ifdef RSS
> > +                       /* XXX set flowtype once this works right */
> > +                       rxr->fmp->m_pkthdr.flowid =
> > +                           le32toh(cur->wb.lower.hi_dword.rss);
> > +                       rxr->fmp->m_flags |= M_FLOWID;
> > +                       switch (pkt_info & E1000_RXDADV_RSSTYPE_MASK) {
> > +                       case E1000_RXDADV_RSSTYPE_IPV4_TCP:
> > +                               M_HASHTYPE_SET(rxr->fmp,
> M_HASHTYPE_RSS_TCP_IPV4);
> > +                               break;
> > +                       case E1000_RXDADV_RSSTYPE_IPV4:
> > +                               M_HASHTYPE_SET(rxr->fmp,
> M_HASHTYPE_RSS_IPV4);
> > +                               break;
> > +                       case E1000_RXDADV_RSSTYPE_IPV6_TCP:
> > +                               M_HASHTYPE_SET(rxr->fmp,
> M_HASHTYPE_RSS_TCP_IPV6);
> > +                               break;
> > +                       case E1000_RXDADV_RSSTYPE_IPV6_EX:
> > +                               M_HASHTYPE_SET(rxr->fmp,
> M_HASHTYPE_RSS_IPV6_EX);
> > +                               break;
> > +                       case E1000_RXDADV_RSSTYPE_IPV6:
> > +                               M_HASHTYPE_SET(rxr->fmp,
> M_HASHTYPE_RSS_IPV6);
> > +                               break;
> > +                       case E1000_RXDADV_RSSTYPE_IPV6_TCP_EX:
> > +                               M_HASHTYPE_SET(rxr->fmp,
> M_HASHTYPE_RSS_TCP_IPV6_EX);
> > +                               break;
> > +
> > +                       /* XXX no UDP support in RSS just yet */
> > +#ifdef notyet
> > +                       case E1000_RXDADV_RSSTYPE_IPV4_UDP:
> > +                       case E1000_RXDADV_RSSTYPE_IPV6_UDP:
> > +                       case E1000_RXDADV_RSSTYPE_IPV6_UDP_EX:
> > +#endif
> > +
> > +                       default:
> > +                               /* XXX fallthrough */
> > +                               M_HASHTYPE_SET(rxr->fmp,
> M_HASHTYPE_NONE);
> > +                       }
> > +#elif !defined(IGB_LEGACY_TX)
> >                         rxr->fmp->m_pkthdr.flowid = que->msix;
> >                         rxr->fmp->m_flags |= M_FLOWID;
> >  #endif
> >
>
>


-- 
-----------------------------------------+-------------------------------
 Prof. Luigi RIZZO, rizzo@iet.unipi.it  . Dip. di Ing. dell'Informazione
 http://www.iet.unipi.it/~luigi/        . Universita` di Pisa
 TEL      +39-050-2211611               . via Diotisalvi 2
 Mobile   +39-338-6809875               . 56122 PISA (Italy)
-----------------------------------------+-------------------------------

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 15:03:37 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 239D962C;
 Mon, 30 Jun 2014 15:03:37 +0000 (UTC)
Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238])
 by mx1.freebsd.org (Postfix) with ESMTP id D76DC2111;
 Mon, 30 Jun 2014 15:03:36 +0000 (UTC)
Received: by onelab2.iet.unipi.it (Postfix, from userid 275)
 id D209F7300A; Mon, 30 Jun 2014 17:06:58 +0200 (CEST)
Date: Mon, 30 Jun 2014 17:06:58 +0200
From: Luigi Rizzo 
To: Adrian Chadd 
Subject: Re: svn commit: r268028 - head/sys/dev/e1000
Message-ID: <20140630150658.GA4742@onelab2.iet.unipi.it>
References: <201406300434.s5U4YxGY043870@svn.freebsd.org>
 
 
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: 
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 15:03:37 -0000

On Mon, Jun 30, 2014 at 04:56:01PM +0200, Luigi Rizzo wrote:
> I am getting the following error while compiling with gcc:
> 
> cc1: warnings being treated as errors
> /usr/home/luigi/FreeBSD/head/sys/dev/e1000/if_igb.c: In function
> 'igb_attach':
> /usr/home/luigi/FreeBSD/head/sys/dev/e1000/if_igb.c:2461: warning: 'cpu_id'
> may be used uninitialized in this function
> /usr/home/luigi/FreeBSD/head/sys/dev/e1000/if_igb.c:2461: note: 'cpu_id'
> was declared here
> 
> (the code is correct, apparently gcc cannot understand that).
> 
> For compatibility i'd throw in an explicit initialization,
> however it might be worthwhile rewriting the code with a single
> if (adapter->num_queues > 1) { ...} block within the for(),
> and also using only one #ifdef RSS -- the other places only
> differ in the string passed to diagnostics or comments.

and the same goes for the recent changes to ixgbe.c

cheers
luigi

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 16:02:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id BFACB795;
 Mon, 30 Jun 2014 16:02:01 +0000 (UTC)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 93CD1273A;
 Mon, 30 Jun 2014 16:02:01 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 88302B93A;
 Mon, 30 Jun 2014 12:02:00 -0400 (EDT)
From: John Baldwin 
To: Hans Petter Selasky 
Subject: Re: svn commit: r267961 - in head/sys: amd64/acpica amd64/amd64
 amd64/pci amd64/vmm arm/arm arm/freescale/imx arm/xscale/ixp425 cam cam/ata
 cam/ctl cam/scsi cddl/compat/opensolaris/kern cddl/contrib/op...
Date: Mon, 30 Jun 2014 11:43:26 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; )
References: <201406271633.s5RGXih6076565@svn.freebsd.org>
 <53AE3E42.7050606@selasky.org> <53AED837.8050702@selasky.org>
In-Reply-To: <53AED837.8050702@selasky.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201406301143.26218.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Mon, 30 Jun 2014 12:02:00 -0400 (EDT)
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 Mateusz Guzik , Ed Maste ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 16:02:01 -0000

On Saturday, June 28, 2014 10:59:03 am Hans Petter Selasky wrote:
> FYI:
> 
> Possibly the sysctl patches will not get MFCed, and be a FreeBSD-11 and 
> onwards only feature, even though the commit message states MFC after xxx.

I suspect that that is probably for the best.  Also, it would have been better 
to split out the other changes (like fixing mismatched tunables, etc.) into a 
separate commit from the CTLFLAG_TUN change.  That makes reviewing them 
easier, and it also means you could more easily MFC just those fixes without 
pulling in the larger change.

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 16:18:38 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id EBCF2E7E;
 Mon, 30 Jun 2014 16:18:38 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D8E0C2879;
 Mon, 30 Jun 2014 16:18:38 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5UGIcmJ079534;
 Mon, 30 Jun 2014 16:18:38 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5UGIcDr079532;
 Mon, 30 Jun 2014 16:18:38 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201406301618.s5UGIcDr079532@svn.freebsd.org>
From: Ed Maste 
Date: Mon, 30 Jun 2014 16:18:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268045 - in head/sys: amd64/conf i386/conf
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 16:18:39 -0000

Author: emaste
Date: Mon Jun 30 16:18:38 2014
New Revision: 268045
URL: http://svnweb.freebsd.org/changeset/base/268045

Log:
  Add vt(4) to GENERIC and retire the separate VT config
  
  vt(4) and sc(4) can now coexist in the same kernel.  To choose the vt
  driver, set the loader tunable kern.vty=vt .

Deleted:
  head/sys/amd64/conf/VT
  head/sys/i386/conf/VT
Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/i386/conf/GENERIC

Modified: head/sys/amd64/conf/GENERIC
==============================================================================
--- head/sys/amd64/conf/GENERIC	Mon Jun 30 16:16:35 2014	(r268044)
+++ head/sys/amd64/conf/GENERIC	Mon Jun 30 16:18:38 2014	(r268045)
@@ -184,6 +184,11 @@ device		splash			# Splash screen and scr
 device		sc
 options 	SC_PIXEL_MODE		# add support for the raster text mode
 
+# vt is the new video console driver
+device		vt
+device		vt_vga
+device		vt_efifb
+
 device		agp			# support several AGP chipsets
 
 # PCCARD (PCMCIA) support

Modified: head/sys/i386/conf/GENERIC
==============================================================================
--- head/sys/i386/conf/GENERIC	Mon Jun 30 16:16:35 2014	(r268044)
+++ head/sys/i386/conf/GENERIC	Mon Jun 30 16:18:38 2014	(r268045)
@@ -187,6 +187,10 @@ device		splash			# Splash screen and scr
 device		sc
 options 	SC_PIXEL_MODE		# add support for the raster text mode
 
+# vt is the new video console driver
+device		vt
+device		vt_vga
+
 device		agp			# support several AGP chipsets
 
 # Power management support (see NOTES for more options)

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 16:39:38 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 06615C37;
 Mon, 30 Jun 2014 16:39:38 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CDB5B2A77;
 Mon, 30 Jun 2014 16:39:37 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5UGdbew089216;
 Mon, 30 Jun 2014 16:39:37 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5UGdb84089215;
 Mon, 30 Jun 2014 16:39:37 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201406301639.s5UGdb84089215@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Mon, 30 Jun 2014 16:39:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268049 - head/sbin/ifconfig
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 16:39:38 -0000

Author: ume
Date: Mon Jun 30 16:39:37 2014
New Revision: 268049
URL: http://svnweb.freebsd.org/changeset/base/268049

Log:
  Fix ifconfig to show pltime and vltime with -L option,
  again after usage change from time_second to time_uptime.
  
  PR:		188520
  Submitted by:	Guy Yur 
  MFC after:	1 week

Modified:
  head/sbin/ifconfig/af_inet6.c

Modified: head/sbin/ifconfig/af_inet6.c
==============================================================================
--- head/sbin/ifconfig/af_inet6.c	Mon Jun 30 16:32:49 2014	(r268048)
+++ head/sbin/ifconfig/af_inet6.c	Mon Jun 30 16:39:37 2014	(r268049)
@@ -42,6 +42,7 @@ static const char rcsid[] =
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -98,20 +99,21 @@ static void
 setip6lifetime(const char *cmd, const char *val, int s, 
     const struct afswtch *afp)
 {
-	time_t newval, t;
+	struct timespec now;
+	time_t newval;
 	char *ep;
 
-	t = time(NULL);
+	clock_gettime(CLOCK_MONOTONIC_FAST, &now);
 	newval = (time_t)strtoul(val, &ep, 0);
 	if (val == ep)
 		errx(1, "invalid %s", cmd);
 	if (afp->af_af != AF_INET6)
 		errx(1, "%s not allowed for the AF", cmd);
 	if (strcmp(cmd, "vltime") == 0) {
-		in6_addreq.ifra_lifetime.ia6t_expire = t + newval;
+		in6_addreq.ifra_lifetime.ia6t_expire = now.tv_sec + newval;
 		in6_addreq.ifra_lifetime.ia6t_vltime = newval;
 	} else if (strcmp(cmd, "pltime") == 0) {
-		in6_addreq.ifra_lifetime.ia6t_preferred = t + newval;
+		in6_addreq.ifra_lifetime.ia6t_preferred = now.tv_sec + newval;
 		in6_addreq.ifra_lifetime.ia6t_pltime = newval;
 	}
 }
@@ -172,9 +174,11 @@ in6_status(int s __unused, const struct 
 	int s6;
 	u_int32_t flags6;
 	struct in6_addrlifetime lifetime;
-	time_t t = time(NULL);
+	struct timespec now;
 	int error;
 
+	clock_gettime(CLOCK_MONOTONIC_FAST, &now);
+
 	memset(&null_sin, 0, sizeof(null_sin));
 
 	sin = (struct sockaddr_in6 *)ifa->ifa_addr;
@@ -258,15 +262,15 @@ in6_status(int s __unused, const struct 
 	if (ip6lifetime && (lifetime.ia6t_preferred || lifetime.ia6t_expire)) {
 		printf("pltime ");
 		if (lifetime.ia6t_preferred) {
-			printf("%s ", lifetime.ia6t_preferred < t
-				? "0" : sec2str(lifetime.ia6t_preferred - t));
+			printf("%s ", lifetime.ia6t_preferred < now.tv_sec
+				? "0" : sec2str(lifetime.ia6t_preferred - now.tv_sec));
 		} else
 			printf("infty ");
 
 		printf("vltime ");
 		if (lifetime.ia6t_expire) {
-			printf("%s ", lifetime.ia6t_expire < t
-				? "0" : sec2str(lifetime.ia6t_expire - t));
+			printf("%s ", lifetime.ia6t_expire < now.tv_sec
+				? "0" : sec2str(lifetime.ia6t_expire - now.tv_sec));
 		} else
 			printf("infty ");
 	}

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 16:44:39 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9FD28110;
 Mon, 30 Jun 2014 16:44:39 +0000 (UTC)
Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214])
 (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 586A82B38;
 Mon, 30 Jun 2014 16:44:38 +0000 (UTC)
Received: from laptop015.home.selasky.org
 (cm-176.74.213.204.customer.telag.net [176.74.213.204])
 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits))
 (No client certificate requested)
 by mail.turbocat.net (Postfix) with ESMTPSA id D86D51FE02D;
 Mon, 30 Jun 2014 18:44:24 +0200 (CEST)
Message-ID: <53B193F9.9070903@selasky.org>
Date: Mon, 30 Jun 2014 18:44:41 +0200
From: Hans Petter Selasky 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:24.0) Gecko/20100101 Thunderbird/24.1.0
MIME-Version: 1.0
To: John Baldwin 
Subject: Re: svn commit: r267961 - in head/sys: amd64/acpica amd64/amd64
 amd64/pci
 amd64/vmm arm/arm arm/freescale/imx arm/xscale/ixp425 cam cam/ata cam/ctl
 cam/scsi cddl/compat/opensolaris/kern cddl/contrib/op...
References: <201406271633.s5RGXih6076565@svn.freebsd.org>
 <53AE3E42.7050606@selasky.org> <53AED837.8050702@selasky.org>
 <201406301143.26218.jhb@freebsd.org>
In-Reply-To: <201406301143.26218.jhb@freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 Mateusz Guzik , Ed Maste ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 16:44:39 -0000

On 06/30/14 17:43, John Baldwin wrote:
> On Saturday, June 28, 2014 10:59:03 am Hans Petter Selasky wrote:
>> FYI:
>>
>> Possibly the sysctl patches will not get MFCed, and be a FreeBSD-11 and
>> onwards only feature, even though the commit message states MFC after xxx.
>
> I suspect that that is probably for the best.  Also, it would have been better
> to split out the other changes (like fixing mismatched tunables, etc.) into a
> separate commit from the CTLFLAG_TUN change.  That makes reviewing them
> easier, and it also means you could more easily MFC just those fixes without
> pulling in the larger change.
>

Hi,

Right.

BTW:

powerpc64 is failing due to my changes. I looks like a GCC issue, that 
it does not allow "static" and "extern" entries to reside in the same 
section. A simple way to solve this is by using a double pointer, so 
that the type of the exported section data is always "static" declared. 
Then GCC won't complain any more.

Any comments about how to resolve this?

--HPS

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 16:49:00 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D34624F9;
 Mon, 30 Jun 2014 16:49:00 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A46832B78;
 Mon, 30 Jun 2014 16:49:00 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5UGn0xC096498;
 Mon, 30 Jun 2014 16:49:00 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5UGn0Yt096497;
 Mon, 30 Jun 2014 16:49:00 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201406301649.s5UGn0Yt096497@svn.freebsd.org>
From: Ed Maste 
Date: Mon, 30 Jun 2014 16:49:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268050 - head/share/man/man4
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 16:49:00 -0000

Author: emaste
Date: Mon Jun 30 16:49:00 2014
New Revision: 268050
URL: http://svnweb.freebsd.org/changeset/base/268050

Log:
  Add a vt(4) cross reference to syscons(4)

Modified:
  head/share/man/man4/syscons.4

Modified: head/share/man/man4/syscons.4
==============================================================================
--- head/share/man/man4/syscons.4	Mon Jun 30 16:39:37 2014	(r268049)
+++ head/share/man/man4/syscons.4	Mon Jun 30 16:49:00 2014	(r268050)
@@ -533,6 +533,7 @@ to the kernel.
 .Xr splash 4 ,
 .Xr ukbd 4 ,
 .Xr vga 4 ,
+.Xr vt 4 ,
 .Xr kbdmap 5 ,
 .Xr rc.conf 5 ,
 .Xr ttys 5 ,

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 17:00:33 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 19638B8F;
 Mon, 30 Jun 2014 17:00:33 +0000 (UTC)
Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id A4AFE2C9F;
 Mon, 30 Jun 2014 17:00:32 +0000 (UTC)
Received: from alchemy.franken.de (localhost [127.0.0.1])
 by alchemy.franken.de (8.14.8/8.14.8/ALCHEMY.FRANKEN.DE) with ESMTP id
 s5UH0T9g064155
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Mon, 30 Jun 2014 19:00:29 +0200 (CEST)
 (envelope-from marius@alchemy.franken.de)
Received: (from marius@localhost)
 by alchemy.franken.de (8.14.8/8.14.8/Submit) id s5UH0TIp064154;
 Mon, 30 Jun 2014 19:00:29 +0200 (CEST) (envelope-from marius)
Date: Mon, 30 Jun 2014 19:00:29 +0200
From: Marius Strobl 
To: Ed Maste 
Subject: Re: svn commit: r268045 - in head/sys: amd64/conf i386/conf
Message-ID: <20140630170029.GD7615@alchemy.franken.de>
References: <201406301618.s5UGIcDr079532@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201406301618.s5UGIcDr079532@svn.freebsd.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3
 (alchemy.franken.de [0.0.0.0]); Mon, 30 Jun 2014 19:00:29 +0200 (CEST)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 17:00:33 -0000

On Mon, Jun 30, 2014 at 04:18:38PM +0000, Ed Maste wrote:
> Author: emaste
> Date: Mon Jun 30 16:18:38 2014
> New Revision: 268045
> URL: http://svnweb.freebsd.org/changeset/base/268045
> 
> Log:
>   Add vt(4) to GENERIC and retire the separate VT config
>   
>   vt(4) and sc(4) can now coexist in the same kernel.  To choose the vt
>   driver, set the loader tunable kern.vty=vt .

I don't know whether it previously was possible to build both syscons(4)
and vt(4) into a single kernel from a compiler and linker point of view.
However, at least now it's time to add the appropriate vt(4) bits to the
MI and various MD NOTES files.

Marius


From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 18:11:22 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id CD052A24;
 Mon, 30 Jun 2014 18:11:22 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B9DCC246D;
 Mon, 30 Jun 2014 18:11:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5UIBMjD036572;
 Mon, 30 Jun 2014 18:11:22 GMT
 (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5UIBMxh036571;
 Mon, 30 Jun 2014 18:11:22 GMT
 (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201406301811.s5UIBMxh036571@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Mon, 30 Jun 2014 18:11:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268055 - head/sys/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 18:11:22 -0000

Author: hselasky
Date: Mon Jun 30 18:11:22 2014
New Revision: 268055
URL: http://svnweb.freebsd.org/changeset/base/268055

Log:
  Workaround for bug in GCC on powerpc64. Symbols that are exported are
  by fault required to be all "static" or all "extern".

Modified:
  head/sys/sys/linker_set.h

Modified: head/sys/sys/linker_set.h
==============================================================================
--- head/sys/sys/linker_set.h	Mon Jun 30 17:04:55 2014	(r268054)
+++ head/sys/sys/linker_set.h	Mon Jun 30 18:11:22 2014	(r268055)
@@ -40,15 +40,26 @@
  * For ELF, this is done by constructing a separate segment for each set.
  */
 
+#if defined(__powerpc64__)
+/*
+ * Move the symbol pointer from ".text" to ".data" segment, to make
+ * the GCC compiler happy:
+ */
+#define	__MAKE_SET_CONST
+#else
+#define	__MAKE_SET_CONST const
+#endif
+
 /*
  * Private macros, not to be used outside this header file.
  */
 #ifdef __GNUCLIKE___SECTION
-#define __MAKE_SET(set, sym)						\
-	__GLOBL(__CONCAT(__start_set_,set));				\
-	__GLOBL(__CONCAT(__stop_set_,set));				\
-	static void const * const __set_##set##_sym_##sym 		\
-	__section("set_" #set) __used = &sym
+#define __MAKE_SET(set, sym)				\
+	__GLOBL(__CONCAT(__start_set_,set));		\
+	__GLOBL(__CONCAT(__stop_set_,set));		\
+	static void const * __MAKE_SET_CONST		\
+	__set_##set##_sym_##sym __section("set_" #set)	\
+	__used = &(sym)
 #else /* !__GNUCLIKE___SECTION */
 #ifndef lint
 #error this file needs to be ported to your compiler

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 18:16:44 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 82F73D9C;
 Mon, 30 Jun 2014 18:16:44 +0000 (UTC)
Received: from mail.turbocat.net (mail.turbocat.net
 [IPv6:2a01:4f8:d16:4514::2])
 (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 46A3824BA;
 Mon, 30 Jun 2014 18:16:43 +0000 (UTC)
Received: from laptop015.home.selasky.org
 (cm-176.74.213.204.customer.telag.net [176.74.213.204])
 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits))
 (No client certificate requested)
 by mail.turbocat.net (Postfix) with ESMTPSA id A566D1FE02D;
 Mon, 30 Jun 2014 20:16:42 +0200 (CEST)
Message-ID: <53B1A99C.5020607@selasky.org>
Date: Mon, 30 Jun 2014 20:17:00 +0200
From: Hans Petter Selasky 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:24.0) Gecko/20100101 Thunderbird/24.1.0
MIME-Version: 1.0
To: src-committers@freebsd.org, svn-src-all@freebsd.org, 
 svn-src-head@freebsd.org
Subject: Re: svn commit: r268055 - head/sys/sys
References: <201406301811.s5UIBMxh036571@svn.freebsd.org>
In-Reply-To: <201406301811.s5UIBMxh036571@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 18:16:44 -0000

On 06/30/14 20:11, Hans Petter Selasky wrote:
> Author: hselasky
> Date: Mon Jun 30 18:11:22 2014
> New Revision: 268055
> URL: http://svnweb.freebsd.org/changeset/base/268055
>
> Log:
>    Workaround for bug in GCC on powerpc64. Symbols that are exported are
>    by fault required to be all "static" or all "extern".
>
> Modified:
>    head/sys/sys/linker_set.h
>

Hi,

This commit should fix this and similar errors:

/src/sys/cam/cam.c:112: error: __set_sysctl_set_sym_sysctl___kern_cam 
causes a section type conflict
/src/sys/cam/cam.c:112: error: __set_sysctl_set_sym_sysctl___kern_cam 
causes a section type conflict

Fix probably belongs in GCC which is far outside my area. If someone 
finds and can fix the bug in the in-tree GCC code, that would be the 
best. Feel free to revert this patch when GCC has a fix.

Thank you!

--HPS

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 18:37:18 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 90F3E456;
 Mon, 30 Jun 2014 18:37:18 +0000 (UTC)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6685226A5;
 Mon, 30 Jun 2014 18:37:18 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3D195B917;
 Mon, 30 Jun 2014 14:37:17 -0400 (EDT)
From: John Baldwin 
To: Hans Petter Selasky 
Subject: Re: svn commit: r268055 - head/sys/sys
Date: Mon, 30 Jun 2014 14:37:08 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; )
References: <201406301811.s5UIBMxh036571@svn.freebsd.org>
In-Reply-To: <201406301811.s5UIBMxh036571@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201406301437.08687.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Mon, 30 Jun 2014 14:37:17 -0400 (EDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 18:37:18 -0000

On Monday, June 30, 2014 2:11:22 pm Hans Petter Selasky wrote:
> Author: hselasky
> Date: Mon Jun 30 18:11:22 2014
> New Revision: 268055
> URL: http://svnweb.freebsd.org/changeset/base/268055
> 
> Log:
>   Workaround for bug in GCC on powerpc64. Symbols that are exported are
>   by fault required to be all "static" or all "extern".
> 
> Modified:
>   head/sys/sys/linker_set.h
> 
> Modified: head/sys/sys/linker_set.h
> ==============================================================================
> --- head/sys/sys/linker_set.h	Mon Jun 30 17:04:55 2014	(r268054)
> +++ head/sys/sys/linker_set.h	Mon Jun 30 18:11:22 2014	(r268055)
> @@ -40,15 +40,26 @@
>   * For ELF, this is done by constructing a separate segment for each set.
>   */
>  
> +#if defined(__powerpc64__)
> +/*
> + * Move the symbol pointer from ".text" to ".data" segment, to make
> + * the GCC compiler happy:
> + */
> +#define	__MAKE_SET_CONST
> +#else
> +#define	__MAKE_SET_CONST const
> +#endif
> +
>  /*
>   * Private macros, not to be used outside this header file.
>   */
>  #ifdef __GNUCLIKE___SECTION
> -#define __MAKE_SET(set, sym)						\
> -	__GLOBL(__CONCAT(__start_set_,set));				\
> -	__GLOBL(__CONCAT(__stop_set_,set));				\
> -	static void const * const __set_##set##_sym_##sym 		\
> -	__section("set_" #set) __used = &sym
> +#define __MAKE_SET(set, sym)				\
> +	__GLOBL(__CONCAT(__start_set_,set));		\
> +	__GLOBL(__CONCAT(__stop_set_,set));		\
> +	static void const * __MAKE_SET_CONST		\
> +	__set_##set##_sym_##sym __section("set_" #set)	\
> +	__used = &(sym)

Reindenting the whitespace made this diff harder to read.  Why hasn't this
been a problem before on powerpc64?

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 18:43:37 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6113274A;
 Mon, 30 Jun 2014 18:43:37 +0000 (UTC)
Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214])
 (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1E2582769;
 Mon, 30 Jun 2014 18:43:36 +0000 (UTC)
Received: from laptop015.home.selasky.org
 (cm-176.74.213.204.customer.telag.net [176.74.213.204])
 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits))
 (No client certificate requested)
 by mail.turbocat.net (Postfix) with ESMTPSA id 088C01FE02D;
 Mon, 30 Jun 2014 20:43:25 +0200 (CEST)
Message-ID: <53B1AFDE.30104@selasky.org>
Date: Mon, 30 Jun 2014 20:43:42 +0200
From: Hans Petter Selasky 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:24.0) Gecko/20100101 Thunderbird/24.1.0
MIME-Version: 1.0
To: John Baldwin 
Subject: Re: svn commit: r268055 - head/sys/sys
References: <201406301811.s5UIBMxh036571@svn.freebsd.org>
 <201406301437.08687.jhb@freebsd.org>
In-Reply-To: <201406301437.08687.jhb@freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 18:43:37 -0000

On 06/30/14 20:37, John Baldwin wrote:
> Reindenting the whitespace made this diff harder to read.  Why hasn't this
> been a problem before on powerpc64?

Hi,

This has not been a problem before, because producers of DATA_SET()'s 
were using syntax along these lines:

static int test2;
static int test3;

DATA_SET(test, test2);
DATA_SET(test, test3);

Now if you change this simple code to:

static int test2;
int test3;

DATA_SET(test, test2);
DATA_SET(test, test3);

It breaks on powerpc64. Should be very easy to reproduce.

The problem with SYSCTL's is that some are global and some are not. 
Before an indirect pointer was hiding this problem from appearing.

Do you see? Or do you want me to explain more.

--HPS

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 18:47:31 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9860F9EC;
 Mon, 30 Jun 2014 18:47:31 +0000 (UTC)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6F7B3279A;
 Mon, 30 Jun 2014 18:47:31 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 808BFB95E;
 Mon, 30 Jun 2014 14:47:30 -0400 (EDT)
From: John Baldwin 
To: Hans Petter Selasky 
Subject: Re: svn commit: r268055 - head/sys/sys
Date: Mon, 30 Jun 2014 14:47:21 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; )
References: <201406301811.s5UIBMxh036571@svn.freebsd.org>
 <201406301437.08687.jhb@freebsd.org> <53B1AFDE.30104@selasky.org>
In-Reply-To: <53B1AFDE.30104@selasky.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201406301447.21620.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Mon, 30 Jun 2014 14:47:30 -0400 (EDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 18:47:31 -0000

On Monday, June 30, 2014 2:43:42 pm Hans Petter Selasky wrote:
> On 06/30/14 20:37, John Baldwin wrote:
> > Reindenting the whitespace made this diff harder to read.  Why hasn't this
> > been a problem before on powerpc64?
> 
> Hi,
> 
> This has not been a problem before, because producers of DATA_SET()'s 
> were using syntax along these lines:
> 
> static int test2;
> static int test3;
> 
> DATA_SET(test, test2);
> DATA_SET(test, test3);
> 
> Now if you change this simple code to:
> 
> static int test2;
> int test3;
> 
> DATA_SET(test, test2);
> DATA_SET(test, test3);
> 
> It breaks on powerpc64. Should be very easy to reproduce.
> 
> The problem with SYSCTL's is that some are global and some are not. 
> Before an indirect pointer was hiding this problem from appearing.
> 
> Do you see? Or do you want me to explain more.

Ahh, ok.  Seems odd that this sort of thing would be ppc64-specific however.

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 19:34:17 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6BD0723A;
 Mon, 30 Jun 2014 19:34:17 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 594F32C35;
 Mon, 30 Jun 2014 19:34:17 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5UJYHve076958;
 Mon, 30 Jun 2014 19:34:17 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5UJYHkp076957;
 Mon, 30 Jun 2014 19:34:17 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201406301934.s5UJYHkp076957@svn.freebsd.org>
From: Ed Maste 
Date: Mon, 30 Jun 2014 19:34:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268059 - head/sys/conf
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 19:34:17 -0000

Author: emaste
Date: Mon Jun 30 19:34:16 2014
New Revision: 268059
URL: http://svnweb.freebsd.org/changeset/base/268059

Log:
  Add missing VT_ kernel config knobs
  
  MFC after:	1 week

Modified:
  head/sys/conf/options

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Mon Jun 30 19:33:04 2014	(r268058)
+++ head/sys/conf/options	Mon Jun 30 19:34:16 2014	(r268059)
@@ -736,8 +736,6 @@ SAFE_RNDTEST		opt_safe.h
 
 # syscons/vt options
 MAXCONS			opt_syscons.h
-VT_FB_DEFAULT_WIDTH	opt_syscons.h
-VT_FB_DEFAULT_HEIGHT	opt_syscons.h
 SC_ALT_MOUSE_IMAGE	opt_syscons.h
 SC_CUT_SPACES2TABS	opt_syscons.h
 SC_CUT_SEPCHARS		opt_syscons.h
@@ -760,6 +758,11 @@ SC_NORM_REV_ATTR	opt_syscons.h
 SC_PIXEL_MODE		opt_syscons.h
 SC_RENDER_DEBUG		opt_syscons.h
 SC_TWOBUTTON_MOUSE	opt_syscons.h
+VT_ALT_TO_ESC_HACK	opt_syscons.h
+VT_FB_DEFAULT_WIDTH	opt_syscons.h
+VT_FB_DEFAULT_HEIGHT	opt_syscons.h
+VT_MAXWINDOWS		opt_syscons.h
+VT_TWOBUTTON_MOUSE	opt_syscons.h
 DEV_SC			opt_syscons.h
 DEV_VT			opt_syscons.h
 

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 20:15:59 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 01330B6;
 Mon, 30 Jun 2014 20:15:59 +0000 (UTC)
Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 8A3342FD7;
 Mon, 30 Jun 2014 20:15:58 +0000 (UTC)
Received: from alchemy.franken.de (localhost [127.0.0.1])
 by alchemy.franken.de (8.14.8/8.14.8/ALCHEMY.FRANKEN.DE) with ESMTP id
 s5UKFtas065097
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Mon, 30 Jun 2014 22:15:55 +0200 (CEST)
 (envelope-from marius@alchemy.franken.de)
Received: (from marius@localhost)
 by alchemy.franken.de (8.14.8/8.14.8/Submit) id s5UKFtNN065096;
 Mon, 30 Jun 2014 22:15:55 +0200 (CEST) (envelope-from marius)
Date: Mon, 30 Jun 2014 22:15:55 +0200
From: Marius Strobl 
To: John Baldwin 
Subject: Re: svn commit: r268055 - head/sys/sys
Message-ID: <20140630201555.GE7615@alchemy.franken.de>
References: <201406301811.s5UIBMxh036571@svn.freebsd.org>
 <201406301437.08687.jhb@freebsd.org> <53B1AFDE.30104@selasky.org>
 <201406301447.21620.jhb@freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201406301447.21620.jhb@freebsd.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3
 (alchemy.franken.de [0.0.0.0]); Mon, 30 Jun 2014 22:15:55 +0200 (CEST)
Cc: Hans Petter Selasky , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 20:15:59 -0000

On Mon, Jun 30, 2014 at 02:47:21PM -0400, John Baldwin wrote:
> On Monday, June 30, 2014 2:43:42 pm Hans Petter Selasky wrote:
> > On 06/30/14 20:37, John Baldwin wrote:
> > > Reindenting the whitespace made this diff harder to read.  Why hasn't this
> > > been a problem before on powerpc64?
> > 
> > Hi,
> > 
> > This has not been a problem before, because producers of DATA_SET()'s 
> > were using syntax along these lines:
> > 
> > static int test2;
> > static int test3;
> > 
> > DATA_SET(test, test2);
> > DATA_SET(test, test3);
> > 
> > Now if you change this simple code to:
> > 
> > static int test2;
> > int test3;
> > 
> > DATA_SET(test, test2);
> > DATA_SET(test, test3);
> > 
> > It breaks on powerpc64. Should be very easy to reproduce.
> > 
> > The problem with SYSCTL's is that some are global and some are not. 
> > Before an indirect pointer was hiding this problem from appearing.
> > 
> > Do you see? Or do you want me to explain more.
> 
> Ahh, ok.  Seems odd that this sort of thing would be ppc64-specific however.
> 

Apparently it isn't and has also has shown up on at least ia64:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31490

Marius


From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 20:22:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3A2DC379;
 Mon, 30 Jun 2014 20:22:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 27CD120B4;
 Mon, 30 Jun 2014 20:22:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5UKM0NV001148;
 Mon, 30 Jun 2014 20:22:00 GMT (envelope-from bapt@svn.freebsd.org)
Received: (from bapt@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5UKM07V001147;
 Mon, 30 Jun 2014 20:22:00 GMT (envelope-from bapt@svn.freebsd.org)
Message-Id: <201406302022.s5UKM07V001147@svn.freebsd.org>
From: Baptiste Daroussin 
Date: Mon, 30 Jun 2014 20:22:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268063 - head/tools/build/mk
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 20:22:01 -0000

Author: bapt
Date: Mon Jun 30 20:22:00 2014
New Revision: 268063
URL: http://svnweb.freebsd.org/changeset/base/268063

Log:
  fill in the list of obsolete files when base is built with WITHOUT_INFO

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==============================================================================
--- head/tools/build/mk/OptionalObsoleteFiles.inc	Mon Jun 30 19:47:26 2014	(r268062)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc	Mon Jun 30 20:22:00 2014	(r268063)
@@ -1980,7 +1980,31 @@ OLD_FILES+=rescue/ping6
 .endif
 
 #.if ${MK_INFO} == no
-# to be filled in
+OLD_FILES+=usr/bin/info
+OLD_FILES+=usr/bin/infokey
+OLD_FILES+=usr/bin/install-info
+OLD_FILES+=usr/bin/makeinfo
+OLD_FILES+=usr/bin/texindex
+OLD_FILES+=usr/share/info/am-utils.info.gz
+OLD_FILES+=usr/share/info/as-utils.info.gz
+OLD_FILES+=usr/share/info/binutils.info.gz
+OLD_FILES+=usr/share/info/com_err.info.gz
+OLD_FILES+=usr/share/info/diff.info.gz
+OLD_FILES+=usr/share/info/gdb.info.gz
+OLD_FILES+=usr/share/info/gdbint.info.gz
+OLD_FILES+=usr/share/info/gperf.info.gz
+OLD_FILES+=usr/share/info/grep.info.gz
+OLD_FILES+=usr/share/info/groff.info.gz
+OLD_FILES+=usr/share/info/heimdal.info.gz
+OLD_FILES+=usr/share/info/history.info.gz
+OLD_FILES+=usr/share/info/info-stnd.info.gz
+OLD_FILES+=usr/share/info/info.info.gz
+OLD_FILES+=usr/share/info/ld.info.gz
+OLD_FILES+=usr/share/info/readline.info.gz
+OLD_FILES+=usr/share/info/regex.info.gz
+OLD_FILES+=usr/share/info/rluserman.info.gz
+OLD_FILES+=usr/share/info/stabs.info.gz
+OLD_FILES+=usr/share/info/texinfo.info.gz
 #.endif
 
 .if ${MK_IPFILTER} == no

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 20:24:00 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D03714F6;
 Mon, 30 Jun 2014 20:24:00 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BE3AF20D6;
 Mon, 30 Jun 2014 20:24:00 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5UKO0R5001457;
 Mon, 30 Jun 2014 20:24:00 GMT (envelope-from bapt@svn.freebsd.org)
Received: (from bapt@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5UKO055001456;
 Mon, 30 Jun 2014 20:24:00 GMT (envelope-from bapt@svn.freebsd.org)
Message-Id: <201406302024.s5UKO055001456@svn.freebsd.org>
From: Baptiste Daroussin 
Date: Mon, 30 Jun 2014 20:24:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268064 - head/tools/build/mk
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 20:24:00 -0000

Author: bapt
Date: Mon Jun 30 20:24:00 2014
New Revision: 268064
URL: http://svnweb.freebsd.org/changeset/base/268064

Log:
  Activate the condition for WITHOUT_INFO
  
  Submitted by:	antoine

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==============================================================================
--- head/tools/build/mk/OptionalObsoleteFiles.inc	Mon Jun 30 20:22:00 2014	(r268063)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc	Mon Jun 30 20:24:00 2014	(r268064)
@@ -1979,7 +1979,7 @@ OLD_FILES+=usr/share/man/man8/traceroute
 OLD_FILES+=rescue/ping6
 .endif
 
-#.if ${MK_INFO} == no
+.if ${MK_INFO} == no
 OLD_FILES+=usr/bin/info
 OLD_FILES+=usr/bin/infokey
 OLD_FILES+=usr/bin/install-info
@@ -2005,7 +2005,7 @@ OLD_FILES+=usr/share/info/regex.info.gz
 OLD_FILES+=usr/share/info/rluserman.info.gz
 OLD_FILES+=usr/share/info/stabs.info.gz
 OLD_FILES+=usr/share/info/texinfo.info.gz
-#.endif
+.endif
 
 .if ${MK_IPFILTER} == no
 OLD_FILES+=etc/periodic/security/510.ipfdenied

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 20:54:26 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D8EA5684;
 Mon, 30 Jun 2014 20:54:26 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BA8512477;
 Mon, 30 Jun 2014 20:54:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5UKsQYe015891;
 Mon, 30 Jun 2014 20:54:26 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5UKsQ5D015887;
 Mon, 30 Jun 2014 20:54:26 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201406302054.s5UKsQ5D015887@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Mon, 30 Jun 2014 20:54:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268066 - in head: lib/libc/regex sys/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 20:54:27 -0000

Author: pfg
Date: Mon Jun 30 20:54:25 2014
New Revision: 268066
URL: http://svnweb.freebsd.org/changeset/base/268066

Log:
  regex(3): Add support for \< and \> word delimiters
  
  Solaris and other OSs have support for \< and \> as word
  delimiters in utilities like sed(1). These are useful to
  have for general compatiblity with Solaris but should be
  avoided for portability with other systems, including the
  traditional BSDs.
  
  Bump __FreeBSD_version as this is likely to affect some
  userland utilities.
  
  Reference:
  https://www.illumos.org/issues/516
  
  PR:		bin/153257
  Obtained from:	Illumos
  MFC after:	1 month

Modified:
  head/lib/libc/regex/re_format.7
  head/lib/libc/regex/regcomp.c
  head/sys/sys/param.h

Modified: head/lib/libc/regex/re_format.7
==============================================================================
--- head/lib/libc/regex/re_format.7	Mon Jun 30 20:26:30 2014	(r268065)
+++ head/lib/libc/regex/re_format.7	Mon Jun 30 20:54:25 2014	(r268066)
@@ -36,7 +36,7 @@
 .\"	@(#)re_format.7	8.3 (Berkeley) 3/20/94
 .\" $FreeBSD$
 .\"
-.Dd March 20, 1994
+.Dd June 30, 2014
 .Dt RE_FORMAT 7
 .Os
 .Sh NAME
@@ -314,6 +314,13 @@ compatible with but not specified by
 .St -p1003.2 ,
 and should be used with
 caution in software intended to be portable to other systems.
+The additional word delimiters  
+.Ql \e<
+and
+.Ql \e> 
+are provided to ease compatibility with traditional
+.Xr svr4 4
+systems but are not portable and should be avoided.
 .Pp
 In the event that an RE could match more than one substring of a given
 string,

Modified: head/lib/libc/regex/regcomp.c
==============================================================================
--- head/lib/libc/regex/regcomp.c	Mon Jun 30 20:26:30 2014	(r268065)
+++ head/lib/libc/regex/regcomp.c	Mon Jun 30 20:54:25 2014	(r268066)
@@ -412,7 +412,17 @@ p_ere_exp(struct parse *p)
 	case '\\':
 		(void)REQUIRE(MORE(), REG_EESCAPE);
 		wc = WGETNEXT();
-		ordinary(p, wc);
+		switch (wc) {
+		case '<':
+			EMIT(OBOW, 0);
+			break;
+		case '>':
+			EMIT(OEOW, 0);
+			break;
+		default:
+			ordinary(p, wc);
+			break;
+		}
 		break;
 	case '{':		/* okay as ordinary except if digit follows */
 		(void)REQUIRE(!MORE() || !isdigit((uch)PEEK()), REG_BADRPT);
@@ -569,6 +579,12 @@ p_simp_re(struct parse *p,
 	case '[':
 		p_bracket(p);
 		break;
+	case BACKSL|'<':
+		EMIT(OBOW, 0);
+		break;
+	case BACKSL|'>':
+		EMIT(OEOW, 0);
+		break;
 	case BACKSL|'{':
 		SETERROR(REG_BADRPT);
 		break;

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h	Mon Jun 30 20:26:30 2014	(r268065)
+++ head/sys/sys/param.h	Mon Jun 30 20:54:25 2014	(r268066)
@@ -58,7 +58,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1100024	/* Master, propagated to newvers */
+#define __FreeBSD_version 1100025	/* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 21:03:48 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3AABDAA7;
 Mon, 30 Jun 2014 21:03:48 +0000 (UTC)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 108862568;
 Mon, 30 Jun 2014 21:03:48 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id E23C0B924;
 Mon, 30 Jun 2014 17:03:46 -0400 (EDT)
From: John Baldwin 
To: Marius Strobl 
Subject: Re: svn commit: r268055 - head/sys/sys
Date: Mon, 30 Jun 2014 17:03:25 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; )
References: <201406301811.s5UIBMxh036571@svn.freebsd.org>
 <201406301447.21620.jhb@freebsd.org>
 <20140630201555.GE7615@alchemy.franken.de>
In-Reply-To: <20140630201555.GE7615@alchemy.franken.de>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201406301703.25593.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Mon, 30 Jun 2014 17:03:47 -0400 (EDT)
Cc: Hans Petter Selasky , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 21:03:48 -0000

On Monday, June 30, 2014 4:15:55 pm Marius Strobl wrote:
> On Mon, Jun 30, 2014 at 02:47:21PM -0400, John Baldwin wrote:
> > On Monday, June 30, 2014 2:43:42 pm Hans Petter Selasky wrote:
> > > On 06/30/14 20:37, John Baldwin wrote:
> > > > Reindenting the whitespace made this diff harder to read.  Why hasn't this
> > > > been a problem before on powerpc64?
> > > 
> > > Hi,
> > > 
> > > This has not been a problem before, because producers of DATA_SET()'s 
> > > were using syntax along these lines:
> > > 
> > > static int test2;
> > > static int test3;
> > > 
> > > DATA_SET(test, test2);
> > > DATA_SET(test, test3);
> > > 
> > > Now if you change this simple code to:
> > > 
> > > static int test2;
> > > int test3;
> > > 
> > > DATA_SET(test, test2);
> > > DATA_SET(test, test3);
> > > 
> > > It breaks on powerpc64. Should be very easy to reproduce.
> > > 
> > > The problem with SYSCTL's is that some are global and some are not. 
> > > Before an indirect pointer was hiding this problem from appearing.
> > > 
> > > Do you see? Or do you want me to explain more.
> > 
> > Ahh, ok.  Seems odd that this sort of thing would be ppc64-specific however.
> > 
> 
> Apparently it isn't and has also has shown up on at least ia64:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31490

Ugh.  Maybe this should be conditional on the GCC version rather than ppc64?

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 22:36:16 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3F3CDB38
 for ; Mon, 30 Jun 2014 22:36:16 +0000 (UTC)
Received: from mail-qa0-x22c.google.com (mail-qa0-x22c.google.com
 [IPv6:2607:f8b0:400d:c00::22c])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id CF17A2D84
 for ; Mon, 30 Jun 2014 22:36:15 +0000 (UTC)
Received: by mail-qa0-f44.google.com with SMTP id hw13so6995489qab.17
 for ; Mon, 30 Jun 2014 15:36:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=eitanadler.com; s=0xdeadbeef;
 h=mime-version:sender:in-reply-to:references:from:date:message-id
 :subject:to:cc:content-type;
 bh=cFGYo5NEpSlAVewXwcz/bVo+AM5rK4Yx+Lb9wyDcqHk=;
 b=hlT8yyqn0ji17oVryzbErgyclpNzA/l9qPOP5TX1EeVTiV96fVHvpgAl6KClcRZL+D
 GUeP0yyyLT3ip+A+Hi0ozErNsA/JF0UWRhqqiNzWas8oRZWvTmCEJqgSfIt9pPWbqXxJ
 ThG2j9gV5zaVt6O9NOp+/2mCT+5rrSIYbO1Y4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
 :date:message-id:subject:to:cc:content-type;
 bh=cFGYo5NEpSlAVewXwcz/bVo+AM5rK4Yx+Lb9wyDcqHk=;
 b=QWOh9KjSuuNZclYwvqoaCegqOR/UEIdMhf2ckGyT3NWQ5xQRsCRYD5nvFENf1TJQA/
 imONfSTJ6MJZ9HsN6TbLe2tm7rzmC7GIgbyA/thnzuZPD6wSVaEe/HlZYKh6Zr4uNPB4
 yEmcKm0NH4ILf3CzZFB/SkYB0/EkZlUMjM/6z9IP2KMD8BiYi3XYi2aPcqeYpZ3/TMOg
 4AfR0xPT4g2inOaoP4vdXGmenNOFXX9nQeOKp8iRaEI74DlyUMP3TFGI+aORgt2C1wET
 ZyIxfJFbHpJ5kfFrFZglqD4WPH6pQaRDCP8KpaB8M358iRdFnRa1dhdY8vUM3BvZt2DS
 S4FQ==
X-Gm-Message-State: ALoCoQmooamgWBFn4CVR60sX4ASMHYfh70MM9HhdgsUlfOXcpHEoEM0mGmOzmuKoGTs/02dBOOQU
X-Received: by 10.224.171.195 with SMTP id i3mr66831924qaz.44.1404167774813;
 Mon, 30 Jun 2014 15:36:14 -0700 (PDT)
MIME-Version: 1.0
Sender: lists@eitanadler.com
Received: by 10.96.88.132 with HTTP; Mon, 30 Jun 2014 15:35:44 -0700 (PDT)
In-Reply-To: <201406301703.25593.jhb@freebsd.org>
References: <201406301811.s5UIBMxh036571@svn.freebsd.org>
 <201406301447.21620.jhb@freebsd.org>
 <20140630201555.GE7615@alchemy.franken.de>
 <201406301703.25593.jhb@freebsd.org>
From: Eitan Adler 
Date: Mon, 30 Jun 2014 15:35:44 -0700
X-Google-Sender-Auth: YlaPahxFGAcirUZN_186GFWmzCY
Message-ID: 
Subject: Re: svn commit: r268055 - head/sys/sys
To: John Baldwin 
Content-Type: text/plain; charset=UTF-8
Cc: Hans Petter Selasky , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org,
 Marius Strobl 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 22:36:16 -0000

On 30 June 2014 14:03, John Baldwin  wrote:
> On Monday, June 30, 2014 4:15:55 pm Marius Strobl wrote:
>> On Mon, Jun 30, 2014 at 02:47:21PM -0400, John Baldwin wrote:
>> > On Monday, June 30, 2014 2:43:42 pm Hans Petter Selasky wrote:
>> > > On 06/30/14 20:37, John Baldwin wrote:
>> > > > Reindenting the whitespace made this diff harder to read.  Why hasn't this
>> > > > been a problem before on powerpc64?
>> > >
>> > > Hi,
>> > >
>> > > This has not been a problem before, because producers of DATA_SET()'s
>> > > were using syntax along these lines:
>> > >
>> > > static int test2;
>> > > static int test3;
>> > >
>> > > DATA_SET(test, test2);
>> > > DATA_SET(test, test3);
>> > >
>> > > Now if you change this simple code to:
>> > >
>> > > static int test2;
>> > > int test3;
>> > >
>> > > DATA_SET(test, test2);
>> > > DATA_SET(test, test3);
>> > >
>> > > It breaks on powerpc64. Should be very easy to reproduce.
>> > >
>> > > The problem with SYSCTL's is that some are global and some are not.
>> > > Before an indirect pointer was hiding this problem from appearing.
>> > >
>> > > Do you see? Or do you want me to explain more.
>> >
>> > Ahh, ok.  Seems odd that this sort of thing would be ppc64-specific however.
>> >
>>
>> Apparently it isn't and has also has shown up on at least ia64:
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31490
>
> Ugh.  Maybe this should be conditional on the GCC version rather than ppc64?

There should also be a GCC bug id in a comment.



-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 23:34:37 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 751F77AF;
 Mon, 30 Jun 2014 23:34:37 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 622F92257;
 Mon, 30 Jun 2014 23:34:37 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5UNYbkg092920;
 Mon, 30 Jun 2014 23:34:37 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5UNYb5N092914;
 Mon, 30 Jun 2014 23:34:37 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201406302334.s5UNYb5N092914@svn.freebsd.org>
From: Adrian Chadd 
Date: Mon, 30 Jun 2014 23:34:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268067 - in head/sys/dev: e1000 ixgbe
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 23:34:37 -0000

Author: adrian
Date: Mon Jun 30 23:34:36 2014
New Revision: 268067
URL: http://svnweb.freebsd.org/changeset/base/268067

Log:
  Initialise these variables so gcc doesn't complain.
  
  Submitted by:	luigi

Modified:
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/ixgbe/ixgbe.c

Modified: head/sys/dev/e1000/if_igb.c
==============================================================================
--- head/sys/dev/e1000/if_igb.c	Mon Jun 30 20:54:25 2014	(r268066)
+++ head/sys/dev/e1000/if_igb.c	Mon Jun 30 23:34:36 2014	(r268067)
@@ -2458,7 +2458,7 @@ igb_allocate_msix(struct adapter *adapte
 	device_t		dev = adapter->dev;
 	struct igb_queue	*que = adapter->queues;
 	int			error, rid, vector = 0;
-	int			cpu_id;
+	int			cpu_id = 0;
 
 	/* Be sure to start with all interrupts disabled */
 	E1000_WRITE_REG(&adapter->hw, E1000_IMC, ~0);

Modified: head/sys/dev/ixgbe/ixgbe.c
==============================================================================
--- head/sys/dev/ixgbe/ixgbe.c	Mon Jun 30 20:54:25 2014	(r268066)
+++ head/sys/dev/ixgbe/ixgbe.c	Mon Jun 30 23:34:36 2014	(r268067)
@@ -2364,7 +2364,7 @@ ixgbe_allocate_msix(struct adapter *adap
 	struct 		ix_queue *que = adapter->queues;
 	struct  	tx_ring *txr = adapter->tx_rings;
 	int 		error, rid, vector = 0;
-	int		cpu_id;
+	int		cpu_id = 0;
 
 #ifdef	RSS
 	/*

From owner-svn-src-head@FreeBSD.ORG  Mon Jun 30 23:34:47 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 982F88EC;
 Mon, 30 Jun 2014 23:34:47 +0000 (UTC)
Received: from mail-qg0-x22e.google.com (mail-qg0-x22e.google.com
 [IPv6:2607:f8b0:400d:c04::22e])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 34E3E225B;
 Mon, 30 Jun 2014 23:34:47 +0000 (UTC)
Received: by mail-qg0-f46.google.com with SMTP id q107so2614802qgd.19
 for ; Mon, 30 Jun 2014 16:34:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date:message-id:subject
 :from:to:cc:content-type;
 bh=zlqw00DHL23FGG7vI2fbJBDHh/uQXN6FuIWTDGkLi8w=;
 b=dGvq4NID5YWmXlFZwHH2Tq1Dxg81AU1toiEgMDc6yBboIf2zVacw+kqRDHrMxOKwX2
 dPj3y0oisoQWqQwQV+5WOAUWhpRPK4I8nzYAs/503vmyAcStz3JxLoxIWNqoIkXmyns1
 8lvH86YhcdDHgQshkkf1s9eKhdxTj3hot1E05JOfq0QcoXbDr+PLZVLPtQSk49PdMkid
 S06rEHTneBBja3MtdxHZIO4v0ZP0/BkDeuVCUDQbiUjdZzIpGROXWNrluK+vYSrXeb2w
 06Qo8FpvrWwgq44RNgMJgQ7rN0ailu6e2x8sV7+g4a0daTL+KBIhCYTcsVGLuQ9gvOA6
 9Cfw==
MIME-Version: 1.0
X-Received: by 10.224.130.136 with SMTP id t8mr1865118qas.49.1404171286080;
 Mon, 30 Jun 2014 16:34:46 -0700 (PDT)
Sender: adrian.chadd@gmail.com
Received: by 10.224.202.193 with HTTP; Mon, 30 Jun 2014 16:34:46 -0700 (PDT)
In-Reply-To: <20140630150658.GA4742@onelab2.iet.unipi.it>
References: <201406300434.s5U4YxGY043870@svn.freebsd.org>
 
 
 <20140630150658.GA4742@onelab2.iet.unipi.it>
Date: Mon, 30 Jun 2014 16:34:46 -0700
X-Google-Sender-Auth: iJGKCDgjZyadwIbKFDLrnW_4yGw
Message-ID: 
Subject: Re: svn commit: r268028 - head/sys/dev/e1000
From: Adrian Chadd 
To: Luigi Rizzo 
Content-Type: text/plain; charset=UTF-8
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 30 Jun 2014 23:34:47 -0000

Fixed in both! thanks!


-a


On 30 June 2014 08:06, Luigi Rizzo  wrote:
> On Mon, Jun 30, 2014 at 04:56:01PM +0200, Luigi Rizzo wrote:
>> I am getting the following error while compiling with gcc:
>>
>> cc1: warnings being treated as errors
>> /usr/home/luigi/FreeBSD/head/sys/dev/e1000/if_igb.c: In function
>> 'igb_attach':
>> /usr/home/luigi/FreeBSD/head/sys/dev/e1000/if_igb.c:2461: warning: 'cpu_id'
>> may be used uninitialized in this function
>> /usr/home/luigi/FreeBSD/head/sys/dev/e1000/if_igb.c:2461: note: 'cpu_id'
>> was declared here
>>
>> (the code is correct, apparently gcc cannot understand that).
>>
>> For compatibility i'd throw in an explicit initialization,
>> however it might be worthwhile rewriting the code with a single
>> if (adapter->num_queues > 1) { ...} block within the for(),
>> and also using only one #ifdef RSS -- the other places only
>> differ in the string passed to diagnostics or comments.
>
> and the same goes for the recent changes to ixgbe.c
>
> cheers
> luigi

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 00:22:55 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id BF48217F;
 Tue,  1 Jul 2014 00:22:55 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 926FE262C;
 Tue,  1 Jul 2014 00:22:55 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s610Mtwc016412;
 Tue, 1 Jul 2014 00:22:55 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s610MsIV016407;
 Tue, 1 Jul 2014 00:22:54 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201407010022.s610MsIV016407@svn.freebsd.org>
From: Ed Maste 
Date: Tue, 1 Jul 2014 00:22:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268069 - in head/sys: amd64/conf conf i386/conf ia64/conf
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 00:22:55 -0000

Author: emaste
Date: Tue Jul  1 00:22:54 2014
New Revision: 268069
URL: http://svnweb.freebsd.org/changeset/base/268069

Log:
  Add vt(4) devices and options to NOTES
  
  Reviewed by:	marius (earlier version)

Modified:
  head/sys/amd64/conf/NOTES
  head/sys/conf/NOTES
  head/sys/i386/conf/NOTES
  head/sys/ia64/conf/NOTES

Modified: head/sys/amd64/conf/NOTES
==============================================================================
--- head/sys/amd64/conf/NOTES	Mon Jun 30 23:39:13 2014	(r268068)
+++ head/sys/amd64/conf/NOTES	Tue Jul  1 00:22:54 2014	(r268069)
@@ -248,6 +248,10 @@ options 	VGA_WIDTH90		# support 90 colum
 # Debugging.
 options 	VGA_DEBUG
 
+# vt(4) drivers.
+device		vt_vga		# VGA
+device		vt_efifb	# EFI framebuffer
+
 # Linear framebuffer driver for S3 VESA 1.2 cards. Works on top of VESA.
 device		s3pci
 

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Mon Jun 30 23:39:13 2014	(r268068)
+++ head/sys/conf/NOTES	Tue Jul  1 00:22:54 2014	(r268069)
@@ -1452,6 +1452,20 @@ options 	SC_NO_SUSPEND_VTYSWITCH
 options 	TEKEN_CONS25		# cons25-style terminal emulation
 options 	TEKEN_UTF8		# UTF-8 output handling
 
+# The vt video console driver.
+device		vt
+options		VT_ALT_TO_ESC_HACK=1	# Prepend ESC sequence to ALT keys
+options		VT_MAXWINDOWS=16	# Number of virtual consoles
+options		VT_TWOBUTTON_MOUSE	# Use right mouse button to paste
+
+# The following options set the default framebuffer size.
+options		VT_FB_DEFAULT_HEIGHT=480
+options		VT_FB_DEFAULT_WIDTH=640
+
+# The following options will let you change the default vt terminal colors.
+options		TERMINAL_NORM_ATTR=(FG_GREEN|BG_BLACK)
+options		TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK)
+
 #
 # Optional devices:
 #

Modified: head/sys/i386/conf/NOTES
==============================================================================
--- head/sys/i386/conf/NOTES	Mon Jun 30 23:39:13 2014	(r268068)
+++ head/sys/i386/conf/NOTES	Tue Jul  1 00:22:54 2014	(r268069)
@@ -466,6 +466,9 @@ options 	VGA_WIDTH90		# support 90 colum
 # Debugging.
 options 	VGA_DEBUG
 
+# vt(4) drivers.
+device		vt_vga
+
 # Linear framebuffer driver for S3 VESA 1.2 cards. Works on top of VESA.
 device		s3pci
 

Modified: head/sys/ia64/conf/NOTES
==============================================================================
--- head/sys/ia64/conf/NOTES	Mon Jun 30 23:39:13 2014	(r268068)
+++ head/sys/ia64/conf/NOTES	Tue Jul  1 00:22:54 2014	(r268069)
@@ -97,6 +97,9 @@ options 	VGA_WIDTH90		# support 90 colum
 # Debugging.
 options 	VGA_DEBUG
 
+# vt(4) drivers.
+device		vt_vga
+
 # AGP debugging.
 options 	AGP_DEBUG
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 02:01:57 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E9EA4706
 for ; Tue,  1 Jul 2014 02:01:57 +0000 (UTC)
Received: from ns.kevlo.org (220-135-115-6.HINET-IP.hinet.net [220.135.115.6])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256
 bits))
 (Client CN "ns.kevlo.org", Issuer "ns.kevlo.org" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 74A8F2DBB
 for ; Tue,  1 Jul 2014 02:01:56 +0000 (UTC)
Received: from ns.kevlo.org (localhost [127.0.0.1])
 by ns.kevlo.org (8.14.8/8.14.8) with ESMTP id s6121TKd025930
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Tue, 1 Jul 2014 10:01:30 +0800 (CST)
 (envelope-from kevlo@ns.kevlo.org)
Received: (from kevlo@localhost)
 by ns.kevlo.org (8.14.8/8.14.8/Submit) id s6121ROU025929;
 Tue, 1 Jul 2014 10:01:27 +0800 (CST) (envelope-from kevlo)
Date: Tue, 1 Jul 2014 10:01:27 +0800
From: Kevin Lo 
To: Hans Petter Selasky 
Subject: Re: svn commit: r266490 - head/sys/dev/usb/net
Message-ID: <20140701020127.GA25900@ns.kevlo.org>
References: <201405210809.s4L89jXL075920@svn.freebsd.org>
 <53AD471B.5080408@selasky.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <53AD471B.5080408@selasky.org>
User-Agent: Mutt/1.5.22 (2013-10-16)
Cc: svn-src-head@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 02:01:58 -0000

On Fri, Jun 27, 2014 at 12:27:39PM +0200, Hans Petter Selasky wrote:
> 
> Hi Kevin,

Hi HPS,

> axge_rx_frame() looked a bit broken. I've tried to fix it:
> 
> http://svnweb.freebsd.org/changeset/base/267955
> 
> and
> 
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191432
> 
> Please verify!
> 
> Thank you!

Unfortunately your fix has dropped performance :(
Using iperf to measure throughput:

w/o your fix:
0.0-60.0 sec    667 MBytes      93.2 Mbits/sec

w/ your fix:
0.0-60.0 sec    86.6 MBytes     12.1 Mbits/sec

> --HPS

	Kevin

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 04:23:23 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6655013C;
 Tue,  1 Jul 2014 04:23:23 +0000 (UTC)
Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214])
 (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 656912904;
 Tue,  1 Jul 2014 04:23:22 +0000 (UTC)
Received: from laptop015.home.selasky.org
 (cm-176.74.213.204.customer.telag.net [176.74.213.204])
 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits))
 (No client certificate requested)
 by mail.turbocat.net (Postfix) with ESMTPSA id 9A9B71FE02D;
 Tue,  1 Jul 2014 06:23:07 +0200 (CEST)
Message-ID: <53B237BC.4090207@selasky.org>
Date: Tue, 01 Jul 2014 06:23:24 +0200
From: Hans Petter Selasky 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:24.0) Gecko/20100101 Thunderbird/24.1.0
MIME-Version: 1.0
To: Eitan Adler , John Baldwin 
Subject: Re: svn commit: r268055 - head/sys/sys
References: <201406301811.s5UIBMxh036571@svn.freebsd.org>
 <201406301447.21620.jhb@freebsd.org>
 <20140630201555.GE7615@alchemy.franken.de>
 <201406301703.25593.jhb@freebsd.org>
 
In-Reply-To: 
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Marius Strobl 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 04:23:23 -0000

On 07/01/14 00:35, Eitan Adler wrote:
> On 30 June 2014 14:03, John Baldwin  wrote:
>> On Monday, June 30, 2014 4:15:55 pm Marius Strobl wrote:
>>> On Mon, Jun 30, 2014 at 02:47:21PM -0400, John Baldwin wrote:
>>>> On Monday, June 30, 2014 2:43:42 pm Hans Petter Selasky wrote:
>>>>> On 06/30/14 20:37, John Baldwin wrote:
>>>>>> Reindenting the whitespace made this diff harder to read.  Why hasn't this
>>>>>> been a problem before on powerpc64?
>>>>>
>>>>> Hi,
>>>>>
>>>>> This has not been a problem before, because producers of DATA_SET()'s
>>>>> were using syntax along these lines:
>>>>>
>>>>> static int test2;
>>>>> static int test3;
>>>>>
>>>>> DATA_SET(test, test2);
>>>>> DATA_SET(test, test3);
>>>>>
>>>>> Now if you change this simple code to:
>>>>>
>>>>> static int test2;
>>>>> int test3;
>>>>>
>>>>> DATA_SET(test, test2);
>>>>> DATA_SET(test, test3);
>>>>>
>>>>> It breaks on powerpc64. Should be very easy to reproduce.
>>>>>
>>>>> The problem with SYSCTL's is that some are global and some are not.
>>>>> Before an indirect pointer was hiding this problem from appearing.
>>>>>
>>>>> Do you see? Or do you want me to explain more.
>>>>
>>>> Ahh, ok.  Seems odd that this sort of thing would be ppc64-specific however.
>>>>
>>>
>>> Apparently it isn't and has also has shown up on at least ia64:
>>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31490
>>
>> Ugh.  Maybe this should be conditional on the GCC version rather than ppc64?
>
> There should also be a GCC bug id in a comment.
>

Hi,

Feel free to update my patch for linker_set.h. This is beyond what I 
feel comfortable at :-)

BTW: Is it possible to import those GCC patches into base?

Thank you!

--HPS


From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 04:33:38 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 623C82E7;
 Tue,  1 Jul 2014 04:33:38 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 43A6E29AD;
 Tue,  1 Jul 2014 04:33:38 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s614XcXd031272;
 Tue, 1 Jul 2014 04:33:38 GMT (envelope-from scottl@svn.freebsd.org)
Received: (from scottl@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s614Xbwt031267;
 Tue, 1 Jul 2014 04:33:37 GMT (envelope-from scottl@svn.freebsd.org)
Message-Id: <201407010433.s614Xbwt031267@svn.freebsd.org>
From: Scott Long 
Date: Tue, 1 Jul 2014 04:33:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268071 - head/sys/dev/mps
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 04:33:38 -0000

Author: scottl
Date: Tue Jul  1 04:33:36 2014
New Revision: 268071
URL: http://svnweb.freebsd.org/changeset/base/268071

Log:
  Refactor some code in mps.c to reduce header pollution.
  
  Reviewed by:	gibbs
  Obtained from:	Netflix, Inc.
  MFC after:	2 days

Modified:
  head/sys/dev/mps/mps.c
  head/sys/dev/mps/mps_sas.c
  head/sys/dev/mps/mps_sas.h
  head/sys/dev/mps/mps_user.c
  head/sys/dev/mps/mpsvar.h

Modified: head/sys/dev/mps/mps.c
==============================================================================
--- head/sys/dev/mps/mps.c	Tue Jul  1 00:59:45 2014	(r268070)
+++ head/sys/dev/mps/mps.c	Tue Jul  1 04:33:36 2014	(r268071)
@@ -75,7 +75,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 static int mps_diag_reset(struct mps_softc *sc, int sleep_flag);
 static int mps_init_queues(struct mps_softc *sc);
@@ -328,11 +327,9 @@ mps_transition_operational(struct mps_so
 static int
 mps_iocfacts_allocate(struct mps_softc *sc, uint8_t attaching)
 {
-	int error, i;
+	int error;
 	Mpi2IOCFactsReply_t saved_facts;
 	uint8_t saved_mode, reallocating;
-	struct mpssas_lun *lun, *lun_tmp;
-	struct mpssas_target *targ;
 
 	mps_dprint(sc, MPS_TRACE, "%s\n", __func__);
 
@@ -489,27 +486,7 @@ mps_iocfacts_allocate(struct mps_softc *
 	 */
 	if (reallocating) {
 		mps_iocfacts_free(sc);
-
-		/*
-		 * The number of targets is based on IOC Facts, so free all of
-		 * the allocated LUNs for each target and then the target buffer
-		 * itself.
-		 */
-		for (i=0; i< saved_facts.MaxTargets; i++) {
-			targ = &sc->sassc->targets[i];
-			SLIST_FOREACH_SAFE(lun, &targ->luns, lun_link,
-			    lun_tmp) {
-				free(lun, M_MPT2);
-			}
-		}
-		free(sc->sassc->targets, M_MPT2);
-
-		sc->sassc->targets = malloc(sizeof(struct mpssas_target) *
-		    sc->facts->MaxTargets, M_MPT2, M_WAITOK|M_ZERO);
-		if (!sc->sassc->targets) {
-			panic("%s failed to alloc targets with error %d\n",
-			    __func__, ENOMEM);
-		}
+		mpssas_realloc_targets(sc, saved_facts.MaxTargets);
 	}
 
 	/*

Modified: head/sys/dev/mps/mps_sas.c
==============================================================================
--- head/sys/dev/mps/mps_sas.c	Tue Jul  1 00:59:45 2014	(r268070)
+++ head/sys/dev/mps/mps_sas.c	Tue Jul  1 04:33:36 2014	(r268071)
@@ -3591,3 +3591,33 @@ mpssas_check_id(struct mpssas_softc *sas
 
 	return (0);
 }
+
+void
+mpssas_realloc_targets(struct mps_softc *sc, int maxtargets)
+{
+	struct mpssas_softc *sassc;
+	struct mpssas_lun *lun, *lun_tmp;
+	struct mpssas_target *targ;
+	int i;
+
+	sassc = sc->sassc;
+	/*
+	 * The number of targets is based on IOC Facts, so free all of
+	 * the allocated LUNs for each target and then the target buffer
+	 * itself.
+	 */
+	for (i=0; i< maxtargets; i++) {
+		targ = &sassc->targets[i];
+		SLIST_FOREACH_SAFE(lun, &targ->luns, lun_link, lun_tmp) {
+			free(lun, M_MPT2);
+		}
+	}
+	free(sassc->targets, M_MPT2);
+
+	sassc->targets = malloc(sizeof(struct mpssas_target) * maxtargets,
+	    M_MPT2, M_WAITOK|M_ZERO);
+	if (!sassc->targets) {
+		panic("%s failed to alloc targets with error %d\n",
+		    __func__, ENOMEM);
+	}
+}

Modified: head/sys/dev/mps/mps_sas.h
==============================================================================
--- head/sys/dev/mps/mps_sas.h	Tue Jul  1 00:59:45 2014	(r268070)
+++ head/sys/dev/mps/mps_sas.h	Tue Jul  1 04:33:36 2014	(r268071)
@@ -156,7 +156,5 @@ void mpssas_discovery_end(struct mpssas_
 void mpssas_startup_increment(struct mpssas_softc *sassc);
 void mpssas_startup_decrement(struct mpssas_softc *sassc);
 
-struct mps_command * mpssas_alloc_tm(struct mps_softc *sc);
-void mpssas_free_tm(struct mps_softc *sc, struct mps_command *tm);
 void mpssas_firmware_event_work(void *arg, int pending);
 int mpssas_check_id(struct mpssas_softc *sassc, int id);

Modified: head/sys/dev/mps/mps_user.c
==============================================================================
--- head/sys/dev/mps/mps_user.c	Tue Jul  1 00:59:45 2014	(r268070)
+++ head/sys/dev/mps/mps_user.c	Tue Jul  1 04:33:36 2014	(r268071)
@@ -101,7 +101,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 

Modified: head/sys/dev/mps/mpsvar.h
==============================================================================
--- head/sys/dev/mps/mpsvar.h	Tue Jul  1 00:59:45 2014	(r268070)
+++ head/sys/dev/mps/mpsvar.h	Tue Jul  1 04:33:36 2014	(r268071)
@@ -756,6 +756,9 @@ void mpssas_prepare_remove(struct mpssas
 void mpssas_prepare_volume_remove(struct mpssas_softc *sassc, uint16_t handle);
 int mpssas_startup(struct mps_softc *sc);
 struct mpssas_target * mpssas_find_target_by_handle(struct mpssas_softc *, int, uint16_t);
+void mpssas_realloc_targets(struct mps_softc *sc, int maxtargets);
+struct mps_command * mpssas_alloc_tm(struct mps_softc *sc);
+void mpssas_free_tm(struct mps_softc *sc, struct mps_command *tm);
 
 SYSCTL_DECL(_hw_mps);
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 04:44:19 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E137554A;
 Tue,  1 Jul 2014 04:44:18 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CE9472A7A;
 Tue,  1 Jul 2014 04:44:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s614iIYZ035840;
 Tue, 1 Jul 2014 04:44:18 GMT (envelope-from scottl@svn.freebsd.org)
Received: (from scottl@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s614iIp9035838;
 Tue, 1 Jul 2014 04:44:18 GMT (envelope-from scottl@svn.freebsd.org)
Message-Id: <201407010444.s614iIp9035838@svn.freebsd.org>
From: Scott Long 
Date: Tue, 1 Jul 2014 04:44:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268072 - head/sys/dev/mps
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 04:44:19 -0000

Author: scottl
Date: Tue Jul  1 04:44:18 2014
New Revision: 268072
URL: http://svnweb.freebsd.org/changeset/base/268072

Log:
  Add accessor functions for manipulating the CAM CCB status field.
  
  Reviewed by:	gibbs
  Obtained from:	Netflix, Inc
  MFC after:	2 days

Modified:
  head/sys/dev/mps/mps_sas.c
  head/sys/dev/mps/mps_sas.h

Modified: head/sys/dev/mps/mps_sas.c
==============================================================================
--- head/sys/dev/mps/mps_sas.c	Tue Jul  1 04:33:36 2014	(r268071)
+++ head/sys/dev/mps/mps_sas.c	Tue Jul  1 04:44:18 2014	(r268072)
@@ -597,7 +597,7 @@ mpssas_remove_device(struct mps_softc *s
 
 		mps_dprint(sc, MPS_XINFO, "Completing missed command %p\n", tm);
 		ccb = tm->cm_complete_data;
-		ccb->ccb_h.status = CAM_DEV_NOT_THERE;
+		mpssas_set_ccbstatus(ccb, CAM_DEV_NOT_THERE);
 		mpssas_scsiio_complete(sc, tm);
 	}
 }
@@ -984,7 +984,7 @@ mpssas_action(struct cam_sim *sim, union
 		 */
 		cpi->maxio = 256 * 1024;
 #endif
-		cpi->ccb_h.status = CAM_REQ_CMP;
+		mpssas_set_ccbstatus(ccb, CAM_REQ_CMP);
 		break;
 	}
 	case XPT_GET_TRAN_SETTINGS:
@@ -1003,7 +1003,7 @@ mpssas_action(struct cam_sim *sim, union
 		    cts->ccb_h.target_id));
 		targ = &sassc->targets[cts->ccb_h.target_id];
 		if (targ->handle == 0x0) {
-			cts->ccb_h.status = CAM_SEL_TIMEOUT;
+			mpssas_set_ccbstatus(ccb, CAM_SEL_TIMEOUT);
 			break;
 		}
 
@@ -1030,12 +1030,12 @@ mpssas_action(struct cam_sim *sim, union
 		scsi->valid = CTS_SCSI_VALID_TQ;
 		scsi->flags = CTS_SCSI_FLAGS_TAG_ENB;
 
-		cts->ccb_h.status = CAM_REQ_CMP;
+		mpssas_set_ccbstatus(ccb, CAM_REQ_CMP);
 		break;
 	}
 	case XPT_CALC_GEOMETRY:
 		cam_calc_geometry(&ccb->ccg, /*extended*/1);
-		ccb->ccb_h.status = CAM_REQ_CMP;
+		mpssas_set_ccbstatus(ccb, CAM_REQ_CMP);
 		break;
 	case XPT_RESET_DEV:
 		mps_dprint(sassc->sc, MPS_XINFO, "mpssas_action XPT_RESET_DEV\n");
@@ -1046,7 +1046,7 @@ mpssas_action(struct cam_sim *sim, union
 	case XPT_TERM_IO:
 		mps_dprint(sassc->sc, MPS_XINFO,
 		    "mpssas_action faking success for abort or reset\n");
-		ccb->ccb_h.status = CAM_REQ_CMP;
+		mpssas_set_ccbstatus(ccb, CAM_REQ_CMP);
 		break;
 	case XPT_SCSI_IO:
 		mpssas_action_scsiio(sassc, ccb);
@@ -1057,7 +1057,7 @@ mpssas_action(struct cam_sim *sim, union
 		return;
 #endif
 	default:
-		ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
+		mpssas_set_ccbstatus(ccb, CAM_FUNC_NOTAVAIL);
 		break;
 	}
 	xpt_done(ccb);
@@ -1586,8 +1586,7 @@ mpssas_scsiio_timeout(void *data)
 	/* XXX first, check the firmware state, to see if it's still
 	 * operational.  if not, do a diag reset.
 	 */
-
-	cm->cm_ccb->ccb_h.status = CAM_CMD_TIMEOUT;
+	mpssas_set_ccbstatus(cm->cm_ccb, CAM_CMD_TIMEOUT);
 	cm->cm_state = MPS_CM_STATE_TIMEDOUT;
 	TAILQ_INSERT_TAIL(&targ->timedout_commands, cm, cm_recovery);
 
@@ -1648,14 +1647,14 @@ mpssas_action_scsiio(struct mpssas_softc
 	if (targ->handle == 0x0) {
 		mps_dprint(sc, MPS_ERROR, "%s NULL handle for target %u\n", 
 		    __func__, csio->ccb_h.target_id);
-		csio->ccb_h.status = CAM_SEL_TIMEOUT;
+		mpssas_set_ccbstatus(ccb, CAM_SEL_TIMEOUT);
 		xpt_done(ccb);
 		return;
 	}
 	if (targ->flags & MPS_TARGET_FLAGS_RAID_COMPONENT) {
 		mps_dprint(sc, MPS_ERROR, "%s Raid component no SCSI IO "
 		    "supported %u\n", __func__, csio->ccb_h.target_id);
-		csio->ccb_h.status = CAM_TID_INVALID;
+		mpssas_set_ccbstatus(ccb, CAM_TID_INVALID);
 		xpt_done(ccb);
 		return;
 	}
@@ -1664,7 +1663,7 @@ mpssas_action_scsiio(struct mpssas_softc
 	 * Progress" and was actually aborted by the upper layer.  Check for
 	 * this here and complete the command without error.
 	 */
-	if (ccb->ccb_h.status != CAM_REQ_INPROG) {
+	if (mpssas_get_ccbstatus(ccb) != CAM_REQ_INPROG) {
 		mps_dprint(sc, MPS_TRACE, "%s Command is not in progress for "
 		    "target %u\n", __func__, csio->ccb_h.target_id);
 		xpt_done(ccb);
@@ -1677,16 +1676,16 @@ mpssas_action_scsiio(struct mpssas_softc
 	 */
 	if (targ->flags & MPSSAS_TARGET_INREMOVAL) {
 		if (targ->devinfo == 0)
-			csio->ccb_h.status = CAM_REQ_CMP;
+			mpssas_set_ccbstatus(ccb, CAM_REQ_CMP);
 		else
-			csio->ccb_h.status = CAM_SEL_TIMEOUT;
+			mpssas_set_ccbstatus(ccb, CAM_SEL_TIMEOUT);
 		xpt_done(ccb);
 		return;
 	}
 
 	if ((sc->mps_flags & MPS_FLAGS_SHUTDOWN) != 0) {
 		mps_dprint(sc, MPS_INFO, "%s shutting down\n", __func__);
-		csio->ccb_h.status = CAM_TID_INVALID;
+		mpssas_set_ccbstatus(ccb, CAM_TID_INVALID);
 		xpt_done(ccb);
 		return;
 	}
@@ -1765,7 +1764,7 @@ mpssas_action_scsiio(struct mpssas_softc
 	req->Control = htole32(mpi_control);
 	if (MPS_SET_LUN(req->LUN, csio->ccb_h.target_lun) != 0) {
 		mps_free_command(sc, cm);
-		ccb->ccb_h.status = CAM_LUN_INVALID;
+		mpssas_set_ccbstatus(ccb, CAM_LUN_INVALID);
 		xpt_done(ccb);
 		return;
 	}
@@ -1853,10 +1852,10 @@ mpssas_action_scsiio(struct mpssas_softc
 	 * the I/O to the IR volume itself.
 	 */
 	if (sc->WD_valid_config) {
-		if (ccb->ccb_h.status != MPS_WD_RETRY) {
+		if (mpssas_get_ccbstatus(ccb) != MPS_WD_RETRY) {
 			mpssas_direct_drive_io(sassc, cm, ccb);
 		} else {
-			ccb->ccb_h.status = CAM_REQ_INPROG;
+			mpssas_set_ccbstatus(ccb, CAM_REQ_INPROG);
 		}
 	}
 
@@ -2150,7 +2149,7 @@ mpssas_scsiio_complete(struct mps_softc 
 		 * because there can be no reply when we haven't actually
 		 * gone out to the hardware.
 		 */
-		ccb->ccb_h.status = CAM_REQUEUE_REQ;
+		mpssas_set_ccbstatus(ccb, CAM_REQUEUE_REQ);
 
 		/*
 		 * Currently the only error included in the mask is
@@ -2173,11 +2172,11 @@ mpssas_scsiio_complete(struct mps_softc 
 
 	/* Take the fast path to completion */
 	if (cm->cm_reply == NULL) {
-		if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG) {
+		if (mpssas_get_ccbstatus(ccb) == CAM_REQ_INPROG) {
 			if ((sc->mps_flags & MPS_FLAGS_DIAGRESET) != 0)
-				ccb->ccb_h.status = CAM_SCSI_BUS_RESET;
+				mpssas_set_ccbstatus(ccb, CAM_SCSI_BUS_RESET);
 			else {
-				ccb->ccb_h.status = CAM_REQ_CMP;
+				mpssas_set_ccbstatus(ccb, CAM_REQ_CMP);
 				ccb->csio.scsi_status = SCSI_STATUS_OK;
 			}
 			if (sassc->flags & MPSSAS_QUEUE_FROZEN) {
@@ -2193,10 +2192,10 @@ mpssas_scsiio_complete(struct mps_softc 
 		 * CAM_REQ_CMP.  The first is if MPS_CM_FLAGS_ERROR_MASK is
 		 * set, the second is in the MPS_FLAGS_DIAGRESET above.
 		 */
-		if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+		if (mpssas_get_ccbstatus(ccb) != CAM_REQ_CMP) {
 			/*
 			 * Freeze the dev queue so that commands are
-			 * executed in the correct order with after error
+			 * executed in the correct order after error
 			 * recovery.
 			 */
 			ccb->ccb_h.status |= CAM_DEV_QFRZN;
@@ -2220,7 +2219,7 @@ mpssas_scsiio_complete(struct mps_softc 
 	 */
 	if (cm->cm_flags & MPS_CM_FLAGS_DD_IO) {
 		mps_free_command(sc, cm);
-		ccb->ccb_h.status = MPS_WD_RETRY;
+		mpssas_set_ccbstatus(ccb, MPS_WD_RETRY);
 		mpssas_action_scsiio(sassc, ccb);
 		return;
 	}
@@ -2239,7 +2238,7 @@ mpssas_scsiio_complete(struct mps_softc 
 		/* Completion failed at the transport level. */
 		if (rep->SCSIState & (MPI2_SCSI_STATE_NO_SCSI_STATUS |
 		    MPI2_SCSI_STATE_TERMINATED)) {
-			ccb->ccb_h.status = CAM_REQ_CMP_ERR;
+			mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR);
 			break;
 		}
 
@@ -2248,7 +2247,7 @@ mpssas_scsiio_complete(struct mps_softc 
 		 * recover the command.
 		 */
 		if (rep->SCSIState & MPI2_SCSI_STATE_AUTOSENSE_FAILED) {
-			ccb->ccb_h.status = CAM_AUTOSENSE_FAIL;
+			mpssas_set_ccbstatus(ccb, CAM_AUTOSENSE_FAIL);
 			break;
 		}
 
@@ -2272,16 +2271,16 @@ mpssas_scsiio_complete(struct mps_softc 
 		 */
 		if ((rep->SCSIStatus == MPI2_SCSI_STATUS_COMMAND_TERMINATED) ||
 		    (rep->SCSIStatus == MPI2_SCSI_STATUS_TASK_ABORTED)) {
-			ccb->ccb_h.status = CAM_REQ_ABORTED;
+			mpssas_set_ccbstatus(ccb, CAM_REQ_ABORTED);
 			break;
 		}
 
 		/* Handle normal status and sense */
 		csio->scsi_status = rep->SCSIStatus;
 		if (rep->SCSIStatus == MPI2_SCSI_STATUS_GOOD)
-			ccb->ccb_h.status = CAM_REQ_CMP;
+			mpssas_set_ccbstatus(ccb, CAM_REQ_CMP);
 		else
-			ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR;
+			mpssas_set_ccbstatus(ccb, CAM_SCSI_STATUS_ERROR);
 
 		if (rep->SCSIState & MPI2_SCSI_STATE_AUTOSENSE_VALID) {
 			int sense_len, returned_sense_len;
@@ -2345,13 +2344,13 @@ mpssas_scsiio_complete(struct mps_softc 
 		 * failed.
 		 */
 		if (cm->cm_targ->devinfo == 0)
-			ccb->ccb_h.status = CAM_REQ_CMP;
+			mpssas_set_ccbstatus(ccb, CAM_REQ_CMP);
 		else
-			ccb->ccb_h.status = CAM_DEV_NOT_THERE;
+			mpssas_set_ccbstatus(ccb, CAM_DEV_NOT_THERE);
 		break;
 	case MPI2_IOCSTATUS_INVALID_SGL:
 		mps_print_scsiio_cmd(sc, cm);
-		ccb->ccb_h.status = CAM_UNREC_HBA_ERROR;
+		mpssas_set_ccbstatus(ccb, CAM_UNREC_HBA_ERROR);
 		break;
 	case MPI2_IOCSTATUS_SCSI_TASK_TERMINATED:
 		/*
@@ -2364,14 +2363,14 @@ mpssas_scsiio_complete(struct mps_softc 
 		 * on the console.
 		 */
 		if (cm->cm_state == MPS_CM_STATE_TIMEDOUT)
-			ccb->ccb_h.status = CAM_CMD_TIMEOUT;
+			mpssas_set_ccbstatus(ccb, CAM_CMD_TIMEOUT);
 		else
-			ccb->ccb_h.status = CAM_REQ_ABORTED;
+			mpssas_set_ccbstatus(ccb, CAM_REQ_ABORTED);
 		break;
 	case MPI2_IOCSTATUS_SCSI_DATA_OVERRUN:
 		/* resid is ignored for this condition */
 		csio->resid = 0;
-		ccb->ccb_h.status = CAM_DATA_RUN_ERR;
+		mpssas_set_ccbstatus(ccb, CAM_DATA_RUN_ERR);
 		break;
 	case MPI2_IOCSTATUS_SCSI_IOC_TERMINATED:
 	case MPI2_IOCSTATUS_SCSI_EXT_TERMINATED:
@@ -2380,7 +2379,7 @@ mpssas_scsiio_complete(struct mps_softc 
 		 * transient transport-related) errors, retry these without
 		 * decrementing the retry count.
 		 */
-		ccb->ccb_h.status = CAM_REQUEUE_REQ;
+		mpssas_set_ccbstatus(ccb, CAM_REQUEUE_REQ);
 		mpssas_log_command(cm, MPS_INFO,
 		    "terminated ioc %x scsi %x state %x xfer %u\n",
 		    le16toh(rep->IOCStatus), rep->SCSIStatus, rep->SCSIState,
@@ -2402,7 +2401,7 @@ mpssas_scsiio_complete(struct mps_softc 
 		    le16toh(rep->IOCStatus), rep->SCSIStatus, rep->SCSIState,
 		    le32toh(rep->TransferCount));
 		csio->resid = cm->cm_length;
-		ccb->ccb_h.status = CAM_REQ_CMP_ERR;
+		mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR);
 		break;
 	}
 	
@@ -2415,7 +2414,7 @@ mpssas_scsiio_complete(struct mps_softc 
 		    "unfreezing SIM queue\n");
 	}
 
-	if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+	if (mpssas_get_ccbstatus(ccb) != CAM_REQ_CMP) {
 		ccb->ccb_h.status |= CAM_DEV_QFRZN;
 		xpt_freeze_devq(ccb->ccb_h.path, /*count*/ 1);
 	}
@@ -2713,14 +2712,14 @@ mpssas_smpio_complete(struct mps_softc *
 	if ((cm->cm_flags & MPS_CM_FLAGS_ERROR_MASK) != 0) {
 		mps_dprint(sc, MPS_ERROR,"%s: cm_flags = %#x on SMP request!\n",
 			   __func__, cm->cm_flags);
-		ccb->ccb_h.status = CAM_REQ_CMP_ERR;
+		mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR);
 		goto bailout;
         }
 
 	rpl = (MPI2_SMP_PASSTHROUGH_REPLY *)cm->cm_reply;
 	if (rpl == NULL) {
 		mps_dprint(sc, MPS_ERROR, "%s: NULL cm_reply!\n", __func__);
-		ccb->ccb_h.status = CAM_REQ_CMP_ERR;
+		mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR);
 		goto bailout;
 	}
 
@@ -2733,7 +2732,7 @@ mpssas_smpio_complete(struct mps_softc *
 	    rpl->SASStatus != MPI2_SASSTATUS_SUCCESS) {
 		mps_dprint(sc, MPS_XINFO, "%s: IOCStatus %04x SASStatus %02x\n",
 		    __func__, le16toh(rpl->IOCStatus), rpl->SASStatus);
-		ccb->ccb_h.status = CAM_REQ_CMP_ERR;
+		mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR);
 		goto bailout;
 	}
 
@@ -2742,9 +2741,9 @@ mpssas_smpio_complete(struct mps_softc *
 		   (uintmax_t)sasaddr);
 
 	if (ccb->smpio.smp_response[2] == SMP_FR_ACCEPTED)
-		ccb->ccb_h.status = CAM_REQ_CMP;
+		mpssas_set_ccbstatus(ccb, CAM_REQ_CMP);
 	else
-		ccb->ccb_h.status = CAM_SMP_STATUS_ERROR;
+		mpssas_set_ccbstatus(ccb, CAM_SMP_STATUS_ERROR);
 
 bailout:
 	/*
@@ -2780,7 +2779,7 @@ mpssas_send_smpcmd(struct mpssas_softc *
 	case CAM_DATA_SG_PADDR:
 		mps_dprint(sc, MPS_ERROR,
 			   "%s: physical addresses not supported\n", __func__);
-		ccb->ccb_h.status = CAM_REQ_INVALID;
+		mpssas_set_ccbstatus(ccb, CAM_REQ_INVALID);
 		xpt_done(ccb);
 		return;
 	case CAM_DATA_SG:
@@ -2794,7 +2793,7 @@ mpssas_send_smpcmd(struct mpssas_softc *
 				   "%s: multiple request or response "
 				   "buffer segments not supported for SMP\n",
 				   __func__);
-			ccb->ccb_h.status = CAM_REQ_INVALID;
+			mpssas_set_ccbstatus(ccb, CAM_REQ_INVALID);
 			xpt_done(ccb);
 			return;
 		}
@@ -2828,7 +2827,7 @@ mpssas_send_smpcmd(struct mpssas_softc *
 		response = ccb->smpio.smp_response;
 		break;
 	default:
-		ccb->ccb_h.status = CAM_REQ_INVALID;
+		mpssas_set_ccbstatus(ccb, CAM_REQ_INVALID);
 		xpt_done(ccb);
 		return;
 	}
@@ -2837,7 +2836,7 @@ mpssas_send_smpcmd(struct mpssas_softc *
 	if (cm == NULL) {
 		mps_dprint(sc, MPS_ERROR,
 		    "%s: cannot allocate command\n", __func__);
-		ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+		mpssas_set_ccbstatus(ccb, CAM_RESRC_UNAVAIL);
 		xpt_done(ccb);
 		return;
 	}
@@ -2925,7 +2924,7 @@ mpssas_send_smpcmd(struct mpssas_softc *
 
 bailout_error:
 	mps_free_command(sc, cm);
-	ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+	mpssas_set_ccbstatus(ccb, CAM_RESRC_UNAVAIL);
 	xpt_done(ccb);
 	return;
 
@@ -2950,7 +2949,7 @@ mpssas_action_smpio(struct mpssas_softc 
 		mps_dprint(sc, MPS_ERROR,
 			   "%s: target %d does not exist!\n", __func__,
 			   ccb->ccb_h.target_id);
-		ccb->ccb_h.status = CAM_SEL_TIMEOUT;
+		mpssas_set_ccbstatus(ccb, CAM_SEL_TIMEOUT);
 		xpt_done(ccb);
 		return;
 	}
@@ -2999,7 +2998,7 @@ mpssas_action_smpio(struct mpssas_softc 
 			mps_dprint(sc, MPS_ERROR,
 				   "%s: handle %d does not have a valid "
 				   "parent handle!\n", __func__, targ->handle);
-			ccb->ccb_h.status = CAM_REQ_INVALID;
+			mpssas_set_ccbstatus(ccb, CAM_REQ_INVALID);
 			goto bailout;
 		}
 #ifdef OLD_MPS_PROBE
@@ -3010,7 +3009,7 @@ mpssas_action_smpio(struct mpssas_softc 
 			mps_dprint(sc, MPS_ERROR,
 				   "%s: handle %d does not have a valid "
 				   "parent target!\n", __func__, targ->handle);
-			ccb->ccb_h.status = CAM_REQ_INVALID;
+			mpssas_set_ccbstatus(ccb, CAM_REQ_INVALID);
 			goto bailout;
 		}
 
@@ -3020,7 +3019,7 @@ mpssas_action_smpio(struct mpssas_softc 
 				   "%s: handle %d parent %d does not "
 				   "have an SMP target!\n", __func__,
 				   targ->handle, parent_target->handle);
-			ccb->ccb_h.status = CAM_REQ_INVALID;
+			mpssas_set_ccbstatus(ccb, CAM_REQ_INVALID);
 			goto bailout;
 
 		}
@@ -3033,7 +3032,7 @@ mpssas_action_smpio(struct mpssas_softc 
 				   "%s: handle %d parent %d does not "
 				   "have an SMP target!\n", __func__,
 				   targ->handle, targ->parent_handle);
-			ccb->ccb_h.status = CAM_REQ_INVALID;
+			mpssas_set_ccbstatus(ccb, CAM_REQ_INVALID);
 			goto bailout;
 
 		}
@@ -3042,7 +3041,7 @@ mpssas_action_smpio(struct mpssas_softc 
 				   "%s: handle %d parent handle %d does "
 				   "not have a valid SAS address!\n",
 				   __func__, targ->handle, targ->parent_handle);
-			ccb->ccb_h.status = CAM_REQ_INVALID;
+			mpssas_set_ccbstatus(ccb, CAM_REQ_INVALID);
 			goto bailout;
 		}
 
@@ -3055,7 +3054,7 @@ mpssas_action_smpio(struct mpssas_softc 
 		mps_dprint(sc, MPS_INFO,
 			   "%s: unable to find SAS address for handle %d\n",
 			   __func__, targ->handle);
-		ccb->ccb_h.status = CAM_REQ_INVALID;
+		mpssas_set_ccbstatus(ccb, CAM_REQ_INVALID);
 		goto bailout;
 	}
 	mpssas_send_smpcmd(sassc, ccb, sasaddr);
@@ -3087,7 +3086,7 @@ mpssas_action_resetdev(struct mpssas_sof
 	if (tm == NULL) {
 		mps_dprint(sc, MPS_ERROR,
 		    "command alloc failure in mpssas_action_resetdev\n");
-		ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+		mpssas_set_ccbstatus(ccb, CAM_RESRC_UNAVAIL);
 		xpt_done(ccb);
 		return;
 	}
@@ -3135,7 +3134,7 @@ mpssas_resetdev_complete(struct mps_soft
 			   "%s: cm_flags = %#x for reset of handle %#04x! "
 			   "This should not happen!\n", __func__, tm->cm_flags,
 			   req->DevHandle);
-		ccb->ccb_h.status = CAM_REQ_CMP_ERR;
+		mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR);
 		goto bailout;
 	}
 
@@ -3144,12 +3143,12 @@ mpssas_resetdev_complete(struct mps_soft
 	    le16toh(resp->IOCStatus), le32toh(resp->ResponseCode));
 
 	if (le32toh(resp->ResponseCode) == MPI2_SCSITASKMGMT_RSP_TM_COMPLETE) {
-		ccb->ccb_h.status = CAM_REQ_CMP;
+		mpssas_set_ccbstatus(ccb, CAM_REQ_CMP);
 		mpssas_announce_reset(sc, AC_SENT_BDR, tm->cm_targ->tid,
 		    CAM_LUN_WILDCARD);
 	}
 	else
-		ccb->ccb_h.status = CAM_REQ_CMP_ERR;
+		mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR);
 
 bailout:
 
@@ -3251,7 +3250,7 @@ mpssas_async(void *callback_arg, uint32_
 			cam_release_devq(cdai.ccb_h.path,
 					 0, 0, 0, FALSE);
 
-		if (((cdai.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP)
+		if ((mpssas_get_ccbstatus((union ccb *)&cdai) == CAM_REQ_CMP)
 		 && (rcap_buf.prot & SRC16_PROT_EN)) {
 			lun->eedp_formatted = TRUE;
 			lun->eedp_block_size = scsi_4btoul(rcap_buf.length);
@@ -3453,7 +3452,7 @@ mpssas_read_cap_done(struct cam_periph *
 		 * the lun as not supporting EEDP and set the block size
 		 * to 0.
 		 */
-		if (((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)
+		if ((mpssas_get_ccbstatus(done_ccb) != CAM_REQ_CMP)
 		 || (done_ccb->csio.scsi_status != SCSI_STATUS_OK)) {
 			lun->eedp_formatted = FALSE;
 			lun->eedp_block_size = 0;

Modified: head/sys/dev/mps/mps_sas.h
==============================================================================
--- head/sys/dev/mps/mps_sas.h	Tue Jul  1 04:33:36 2014	(r268071)
+++ head/sys/dev/mps/mps_sas.h	Tue Jul  1 04:44:18 2014	(r268072)
@@ -145,6 +145,19 @@ mpssas_set_lun(uint8_t *lun, u_int ccblu
 	return (0);
 }
 
+static __inline void
+mpssas_set_ccbstatus(union ccb *ccb, int status)
+{
+	ccb->ccb_h.status &= ~CAM_STATUS_MASK;
+	ccb->ccb_h.status |= status;
+}
+
+static __inline int
+mpssas_get_ccbstatus(union ccb *ccb)
+{
+	return (ccb->ccb_h.status & CAM_STATUS_MASK);
+}
+
 #define MPS_SET_SINGLE_LUN(req, lun)	\
 do {					\
 	bzero((req)->LUN, 8);		\

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 06:29:16 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 375604C8;
 Tue,  1 Jul 2014 06:29:16 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2638C2991;
 Tue,  1 Jul 2014 06:29:16 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s616TGXP082443;
 Tue, 1 Jul 2014 06:29:16 GMT (envelope-from mjg@svn.freebsd.org)
Received: (from mjg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s616TFul082441;
 Tue, 1 Jul 2014 06:29:15 GMT (envelope-from mjg@svn.freebsd.org)
Message-Id: <201407010629.s616TFul082441@svn.freebsd.org>
From: Mateusz Guzik 
Date: Tue, 1 Jul 2014 06:29:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268074 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 06:29:16 -0000

Author: mjg
Date: Tue Jul  1 06:29:15 2014
New Revision: 268074
URL: http://svnweb.freebsd.org/changeset/base/268074

Log:
  Perform a lockless check in sigacts_shared.
  
  It is used only during execve (i.e. singlethreaded), so there is no fear
  of returning 'not shared' which soon becomes 'shared'.
  
  While here reorganize the code a little to avoid proc lock/unlock in
  shared case.
  
  MFC after:	1 week

Modified:
  head/sys/kern/kern_exec.c
  head/sys/kern/kern_sig.c

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c	Tue Jul  1 06:23:48 2014	(r268073)
+++ head/sys/kern/kern_exec.c	Tue Jul  1 06:29:15 2014	(r268074)
@@ -621,18 +621,17 @@ interpret:
 	 * handlers. In execsigs(), the new process will have its signals
 	 * reset.
 	 */
-	PROC_LOCK(p);
-	oldcred = crcopysafe(p, newcred);
 	if (sigacts_shared(p->p_sigacts)) {
 		oldsigacts = p->p_sigacts;
-		PROC_UNLOCK(p);
 		newsigacts = sigacts_alloc();
 		sigacts_copy(newsigacts, oldsigacts);
-		PROC_LOCK(p);
-		p->p_sigacts = newsigacts;
 	} else
 		oldsigacts = NULL;
 
+	PROC_LOCK(p);
+	if (oldsigacts)
+		p->p_sigacts = newsigacts;
+	oldcred = crcopysafe(p, newcred);
 	/* Stop profiling */
 	stopprofclock(p);
 

Modified: head/sys/kern/kern_sig.c
==============================================================================
--- head/sys/kern/kern_sig.c	Tue Jul  1 06:23:48 2014	(r268073)
+++ head/sys/kern/kern_sig.c	Tue Jul  1 06:29:15 2014	(r268074)
@@ -3453,10 +3453,6 @@ sigacts_copy(struct sigacts *dest, struc
 int
 sigacts_shared(struct sigacts *ps)
 {
-	int shared;
 
-	mtx_lock(&ps->ps_mtx);
-	shared = ps->ps_refcnt > 1;
-	mtx_unlock(&ps->ps_mtx);
-	return (shared);
+	return (ps->ps_refcnt > 1);
 }

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 06:43:19 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C1717847;
 Tue,  1 Jul 2014 06:43:19 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id AC40D2B11;
 Tue,  1 Jul 2014 06:43:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s616hJYG090826;
 Tue, 1 Jul 2014 06:43:19 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s616hGEJ090802;
 Tue, 1 Jul 2014 06:43:16 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201407010643.s616hGEJ090802@svn.freebsd.org>
From: Xin LI 
Date: Tue, 1 Jul 2014 06:43:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268075 - in head: cddl/contrib/opensolaris/cmd/zdb
 cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool
 cddl/contrib/opensolaris/cmd/zstreamdump cddl/contrib/opensolaris...
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 06:43:19 -0000

Author: delphij
Date: Tue Jul  1 06:43:15 2014
New Revision: 268075
URL: http://svnweb.freebsd.org/changeset/base/268075

Log:
  MFV r267565:
  
  4757 ZFS embedded-data block pointers ("zero block compression")
  4913 zfs release should not be subject to space checks
  
  MFC after:	2 weeks

Added:
  head/sys/cddl/boot/zfs/blkptr.c   (contents, props changed)
     - copied, changed from r267565, vendor-sys/illumos/dist/uts/common/fs/zfs/blkptr.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/blkptr.c
     - copied unchanged from r267565, vendor-sys/illumos/dist/uts/common/fs/zfs/blkptr.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/blkptr.h
     - copied unchanged from r267565, vendor-sys/illumos/dist/uts/common/fs/zfs/sys/blkptr.h
Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  head/cddl/contrib/opensolaris/cmd/zfs/zfs.8
  head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
  head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7
  head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c
  head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
  head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
  head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h
  head/cddl/sbin/zpool/Makefile
  head/cddl/usr.bin/zinject/Makefile
  head/cddl/usr.sbin/zdb/Makefile
  head/cddl/usr.sbin/zhack/Makefile
  head/sys/boot/zfs/zfsimpl.c
  head/sys/cddl/boot/zfs/README
  head/sys/cddl/boot/zfs/zfsimpl.h
  head/sys/cddl/boot/zfs/zfssubr.c
  head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c
  head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h
  head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c
  head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h
  head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
  head/sys/conf/files
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/cmd/zfs/   (props changed)
  head/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Tue Jul  1 06:29:15 2014	(r268074)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Tue Jul  1 06:43:15 2014	(r268075)
@@ -1059,8 +1059,17 @@ snprintf_blkptr_compact(char *blkbuf, si
 		return;
 	}
 
-	blkbuf[0] = '\0';
+	if (BP_IS_EMBEDDED(bp)) {
+		(void) sprintf(blkbuf,
+		    "EMBEDDED et=%u %llxL/%llxP B=%llu",
+		    (int)BPE_GET_ETYPE(bp),
+		    (u_longlong_t)BPE_GET_LSIZE(bp),
+		    (u_longlong_t)BPE_GET_PSIZE(bp),
+		    (u_longlong_t)bp->blk_birth);
+		return;
+	}
 
+	blkbuf[0] = '\0';
 	for (int i = 0; i < ndvas; i++)
 		(void) snprintf(blkbuf + strlen(blkbuf),
 		    buflen - strlen(blkbuf), "%llu:%llx:%llx ",
@@ -1078,7 +1087,7 @@ snprintf_blkptr_compact(char *blkbuf, si
 		    "%llxL/%llxP F=%llu B=%llu/%llu",
 		    (u_longlong_t)BP_GET_LSIZE(bp),
 		    (u_longlong_t)BP_GET_PSIZE(bp),
-		    (u_longlong_t)bp->blk_fill,
+		    (u_longlong_t)BP_GET_FILL(bp),
 		    (u_longlong_t)bp->blk_birth,
 		    (u_longlong_t)BP_PHYSICAL_BIRTH(bp));
 	}
@@ -1091,8 +1100,10 @@ print_indirect(blkptr_t *bp, const zbook
 	char blkbuf[BP_SPRINTF_LEN];
 	int l;
 
-	ASSERT3U(BP_GET_TYPE(bp), ==, dnp->dn_type);
-	ASSERT3U(BP_GET_LEVEL(bp), ==, zb->zb_level);
+	if (!BP_IS_EMBEDDED(bp)) {
+		ASSERT3U(BP_GET_TYPE(bp), ==, dnp->dn_type);
+		ASSERT3U(BP_GET_LEVEL(bp), ==, zb->zb_level);
+	}
 
 	(void) printf("%16llx ", (u_longlong_t)blkid2offset(dnp, bp, zb));
 
@@ -1146,10 +1157,10 @@ visit_indirect(spa_t *spa, const dnode_p
 			err = visit_indirect(spa, dnp, cbp, &czb);
 			if (err)
 				break;
-			fill += cbp->blk_fill;
+			fill += BP_GET_FILL(cbp);
 		}
 		if (!err)
-			ASSERT3U(fill, ==, bp->blk_fill);
+			ASSERT3U(fill, ==, BP_GET_FILL(bp));
 		(void) arc_buf_remove_ref(buf, &buf);
 	}
 
@@ -1816,14 +1827,14 @@ dump_dir(objset_t *os)
 
 	if (dds.dds_type == DMU_OST_META) {
 		dds.dds_creation_txg = TXG_INITIAL;
-		usedobjs = os->os_rootbp->blk_fill;
+		usedobjs = BP_GET_FILL(os->os_rootbp);
 		refdbytes = os->os_spa->spa_dsl_pool->
 		    dp_mos_dir->dd_phys->dd_used_bytes;
 	} else {
 		dmu_objset_space(os, &refdbytes, &scratch, &usedobjs, &scratch);
 	}
 
-	ASSERT3U(usedobjs, ==, os->os_rootbp->blk_fill);
+	ASSERT3U(usedobjs, ==, BP_GET_FILL(os->os_rootbp));
 
 	zdb_nicenum(refdbytes, numbuf);
 
@@ -2134,6 +2145,9 @@ typedef struct zdb_cb {
 	zdb_blkstats_t	zcb_type[ZB_TOTAL + 1][ZDB_OT_TOTAL + 1];
 	uint64_t	zcb_dedup_asize;
 	uint64_t	zcb_dedup_blocks;
+	uint64_t	zcb_embedded_blocks[NUM_BP_EMBEDDED_TYPES];
+	uint64_t	zcb_embedded_histogram[NUM_BP_EMBEDDED_TYPES]
+	    [BPE_PAYLOAD_SIZE];
 	uint64_t	zcb_start;
 	uint64_t	zcb_lastprint;
 	uint64_t	zcb_totalasize;
@@ -2188,6 +2202,13 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t *
 
 	}
 
+	if (BP_IS_EMBEDDED(bp)) {
+		zcb->zcb_embedded_blocks[BPE_GET_ETYPE(bp)]++;
+		zcb->zcb_embedded_histogram[BPE_GET_ETYPE(bp)]
+		    [BPE_GET_PSIZE(bp)]++;
+		return;
+	}
+
 	if (dump_opt['L'])
 		return;
 
@@ -2287,7 +2308,8 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog
 
 	is_metadata = (BP_GET_LEVEL(bp) != 0 || DMU_OT_IS_METADATA(type));
 
-	if (dump_opt['c'] > 1 || (dump_opt['c'] && is_metadata)) {
+	if (!BP_IS_EMBEDDED(bp) &&
+	    (dump_opt['c'] > 1 || (dump_opt['c'] && is_metadata))) {
 		size_t size = BP_GET_PSIZE(bp);
 		void *data = zio_data_buf_alloc(size);
 		int flags = ZIO_FLAG_CANFAIL | ZIO_FLAG_SCRUB | ZIO_FLAG_RAW;
@@ -2479,7 +2501,7 @@ dump_block_stats(spa_t *spa)
 	zdb_blkstats_t *zb, *tzb;
 	uint64_t norm_alloc, norm_space, total_alloc, total_found;
 	int flags = TRAVERSE_PRE | TRAVERSE_PREFETCH_METADATA | TRAVERSE_HARD;
-	int leaks = 0;
+	boolean_t leaks = B_FALSE;
 
 	(void) printf("\nTraversing all blocks %s%s%s%s%s...\n\n",
 	    (dump_opt['c'] || !dump_opt['L']) ? "to verify " : "",
@@ -2567,7 +2589,7 @@ dump_block_stats(spa_t *spa)
 		    (u_longlong_t)total_alloc,
 		    (dump_opt['L']) ? "unreachable" : "leaked",
 		    (longlong_t)(total_alloc - total_found));
-		leaks = 1;
+		leaks = B_TRUE;
 	}
 
 	if (tzb->zb_count == 0)
@@ -2599,6 +2621,23 @@ dump_block_stats(spa_t *spa)
 	(void) printf("\tSPA allocated: %10llu     used: %5.2f%%\n",
 	    (u_longlong_t)norm_alloc, 100.0 * norm_alloc / norm_space);
 
+	for (bp_embedded_type_t i = 0; i < NUM_BP_EMBEDDED_TYPES; i++) {
+		if (zcb.zcb_embedded_blocks[i] == 0)
+			continue;
+		(void) printf("\n");
+		(void) printf("\tadditional, non-pointer bps of type %u: "
+		    "%10llu\n",
+		    i, (u_longlong_t)zcb.zcb_embedded_blocks[i]);
+
+		if (dump_opt['b'] >= 3) {
+			(void) printf("\t number of (compressed) bytes:  "
+			    "number of bps\n");
+			dump_histogram(zcb.zcb_embedded_histogram[i],
+			    sizeof (zcb.zcb_embedded_histogram[i]) /
+			    sizeof (zcb.zcb_embedded_histogram[i][0]), 0);
+		}
+	}
+
 	if (tzb->zb_ditto_samevdev != 0) {
 		(void) printf("\tDittoed blocks on same vdev: %llu\n",
 		    (longlong_t)tzb->zb_ditto_samevdev);
@@ -2711,14 +2750,14 @@ zdb_ddt_add_cb(spa_t *spa, zilog_t *zilo
 	avl_index_t where;
 	zdb_ddt_entry_t *zdde, zdde_search;
 
-	if (BP_IS_HOLE(bp))
+	if (BP_IS_HOLE(bp) || BP_IS_EMBEDDED(bp))
 		return (0);
 
 	if (dump_opt['S'] > 1 && zb->zb_level == ZB_ROOT_LEVEL) {
 		(void) printf("traversing objset %llu, %llu objects, "
 		    "%lu blocks so far\n",
 		    (u_longlong_t)zb->zb_objset,
-		    (u_longlong_t)bp->blk_fill,
+		    (u_longlong_t)BP_GET_FILL(bp),
 		    avl_numnodes(t));
 	}
 

Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8	Tue Jul  1 06:29:15 2014	(r268074)
+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8	Tue Jul  1 06:43:15 2014	(r268075)
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 27, 2014
+.Dd June 30, 2014
 .Dt ZFS 8
 .Os
 .Sh NAME
@@ -179,11 +179,12 @@
 .Ar bookmark
 .Nm
 .Cm send
-.Op Fl DnPpRv
+.Op Fl DnPpRve
 .Op Fl i Ar snapshot | Fl I Ar snapshot
 .Ar snapshot
 .Nm
 .Cm send
+.Op Fl e
 .Op Fl i Ar snapshot Ns | Ns bookmark
 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
 .Nm
@@ -2476,7 +2477,7 @@ feature.
 .It Xo
 .Nm
 .Cm send
-.Op Fl DnPpRv
+.Op Fl DnPpRve
 .Op Fl i Ar snapshot | Fl I Ar snapshot
 .Ar snapshot
 .Xc
@@ -2548,6 +2549,29 @@ be used regardless of the dataset's
 property, but performance will be much better if the filesystem uses a
 dedup-capable checksum (eg.
 .Sy sha256 ) .
+.It Fl e
+Generate a more compact stream by using WRITE_EMBEDDED records for blocks
+which are stored more compactly on disk by the
+.Sy embedded_data
+pool
+feature.
+This flag has no effect if the
+.Sy embedded_data
+feature is
+disabled.
+The receiving system must have the
+.Sy embedded_data
+feature
+enabled.
+If the
+.Sy lz4_compress
+feature is active on the sending system,
+then the receiving system must have that feature enabled as well.
+See
+.Xr zpool-features 7
+for details on ZFS feature flags and the
+.Sy embedded_data
+feature.
 .It Fl p
 Include the dataset's properties in the stream. This flag is implicit when
 .Fl R
@@ -2572,6 +2596,7 @@ on future versions of
 .It Xo
 .Nm
 .Cm send
+.Op Fl e
 .Op Fl i Ar snapshot Ns | Ns Ar bookmark
 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
 .Xc
@@ -2597,6 +2622,29 @@ specified as the last component of the n
 If the incremental target is a clone, the incremental source can
 be the origin snapshot, or an earlier snapshot in the origin's filesystem,
 or the origin's origin, etc.
+.It Fl e
+Generate a more compact stream by using WRITE_EMBEDDED records for blocks
+which are stored more compactly on disk by the
+.Sy embedded_data
+pool
+feature.
+This flag has no effect if the
+.Sy embedded_data
+feature is
+disabled.
+The receiving system must have the
+.Sy embedded_data
+feature
+enabled.
+If the
+.Sy lz4_compress
+feature is active on the sending system,
+then the receiving system must have that feature enabled as well.
+See
+.Xr zpool-features 7
+for details on ZFS feature flags and the
+.Sy embedded_data
+feature.
 .El
 .It Xo
 .Nm

Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c	Tue Jul  1 06:29:15 2014	(r268074)
+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c	Tue Jul  1 06:43:15 2014	(r268075)
@@ -274,9 +274,9 @@ get_usage(zfs_help_t idx)
 	case HELP_ROLLBACK:
 		return (gettext("\trollback [-rRf] \n"));
 	case HELP_SEND:
-		return (gettext("\tsend [-DnPpRv] [-[iI] snapshot] "
+		return (gettext("\tsend [-DnPpRve] [-[iI] snapshot] "
 		    "\n"
-		    "\tsend [-i snapshot|bookmark] "
+		    "\tsend [-e] [-i snapshot|bookmark] "
 		    "\n"));
 	case HELP_SET:
 		return (gettext("\tset  "
@@ -590,6 +590,7 @@ finish_progress(char *done)
 	free(pt_header);
 	pt_header = NULL;
 }
+
 /*
  * zfs clone [-p] [-o prop=value] ...  
  *
@@ -3368,6 +3369,7 @@ rollback_check_dependent(zfs_handle_t *z
 	zfs_close(zhp);
 	return (0);
 }
+
 /*
  * Report any snapshots more recent than the one specified.  Used when '-r' is
  * not specified.  We reuse this same callback for the snapshot dependents - if
@@ -3707,7 +3709,7 @@ zfs_do_send(int argc, char **argv)
 	boolean_t extraverbose = B_FALSE;
 
 	/* check options */
-	while ((c = getopt(argc, argv, ":i:I:RDpvnP")) != -1) {
+	while ((c = getopt(argc, argv, ":i:I:RDpvnPe")) != -1) {
 		switch (c) {
 		case 'i':
 			if (fromname)
@@ -3742,6 +3744,9 @@ zfs_do_send(int argc, char **argv)
 		case 'n':
 			flags.dryrun = B_TRUE;
 			break;
+		case 'e':
+			flags.embed_data = B_TRUE;
+			break;
 		case ':':
 			(void) fprintf(stderr, gettext("missing argument for "
 			    "'%c' option\n"), optopt);
@@ -3780,6 +3785,7 @@ zfs_do_send(int argc, char **argv)
 	if (strchr(argv[0], '@') == NULL ||
 	    (fromname && strchr(fromname, '#') != NULL)) {
 		char frombuf[ZFS_MAXNAMELEN];
+		enum lzc_send_flags lzc_flags = 0;
 
 		if (flags.replicate || flags.doall || flags.props ||
 		    flags.dedup || flags.dryrun || flags.verbose ||
@@ -3794,6 +3800,9 @@ zfs_do_send(int argc, char **argv)
 		if (zhp == NULL)
 			return (1);
 
+		if (flags.embed_data)
+			lzc_flags |= LZC_SEND_FLAG_EMBED_DATA;
+
 		if (fromname != NULL &&
 		    (fromname[0] == '#' || fromname[0] == '@')) {
 			/*
@@ -3807,7 +3816,7 @@ zfs_do_send(int argc, char **argv)
 			(void) strlcat(frombuf, fromname, sizeof (frombuf));
 			fromname = frombuf;
 		}
-		err = zfs_send_one(zhp, fromname, STDOUT_FILENO);
+		err = zfs_send_one(zhp, fromname, STDOUT_FILENO, lzc_flags);
 		zfs_close(zhp);
 		return (err != 0);
 	}

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7	Tue Jul  1 06:29:15 2014	(r268074)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7	Tue Jul  1 06:43:15 2014	(r268075)
@@ -23,7 +23,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 23, 2014
+.Dd June 30, 2014
 .Dt ZPOOL-FEATURES 7
 .Os
 .Sh NAME
@@ -396,6 +396,34 @@ This feature becomes
 as soon as it is enabled and will
 never return to being
 .Sy enabled .
+.It Sy embedded_data
+.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:embedded_data"
+.It GUID Ta com.delphix:embedded_data
+.It READ\-ONLY COMPATIBLE Ta no
+.It DEPENDENCIES Ta none
+.El
+.Pp
+This feature improves the performance and compression ratio of
+highly-compressible blocks.
+Blocks whose contents can compress to 112 bytes
+or smaller can take advantage of this feature.
+.Pp
+When this feature is enabled, the contents of highly-compressible blocks are
+stored in the block "pointer" itself
+.Po a misnomer in this case, as it contains
+the compresseed data, rather than a pointer to its location on disk
+.Pc .
+Thus
+the space of the block
+.Pq one sector, typically 512 bytes or 4KB
+is saved,
+and no additional i/o is needed to read and write the data block.
+.Pp
+This feature becomes
+.Sy active
+as soon as it is enabled and will
+never return to being
+.Sy enabled .
 .El
 .Sh SEE ALSO
 .Xr zpool 8

Modified: head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c	Tue Jul  1 06:29:15 2014	(r268074)
+++ head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c	Tue Jul  1 06:43:15 2014	(r268075)
@@ -49,7 +49,6 @@
  */
 #define	DUMP_GROUPING	4
 
-uint64_t drr_record_count[DRR_NUMTYPES];
 uint64_t total_write_size = 0;
 uint64_t total_stream_len = 0;
 FILE *send_stream = 0;
@@ -123,7 +122,7 @@ print_block(char *buf, int length)
 	 * Start printing ASCII characters at a constant offset, after
 	 * the hex prints. Leave 3 characters per byte on a line (2 digit
 	 * hex number plus 1 space) plus spaces between characters and
-	 * groupings
+	 * groupings.
 	 */
 	int ascii_start = BYTES_PER_LINE * 3 +
 	    BYTES_PER_LINE / DUMP_GROUPING + 2;
@@ -160,6 +159,8 @@ int
 main(int argc, char *argv[])
 {
 	char *buf = malloc(INITIAL_BUFLEN);
+	uint64_t drr_record_count[DRR_NUMTYPES] = { 0 };
+	uint64_t total_records = 0;
 	dmu_replay_record_t thedrr;
 	dmu_replay_record_t *drr = &thedrr;
 	struct drr_begin *drrb = &thedrr.drr_u.drr_begin;
@@ -170,6 +171,7 @@ main(int argc, char *argv[])
 	struct drr_write_byref *drrwbr = &thedrr.drr_u.drr_write_byref;
 	struct drr_free *drrf = &thedrr.drr_u.drr_free;
 	struct drr_spill *drrs = &thedrr.drr_u.drr_spill;
+	struct drr_write_embedded *drrwe = &thedrr.drr_u.drr_write_embedded;
 	char c;
 	boolean_t verbose = B_FALSE;
 	boolean_t first = B_TRUE;
@@ -264,6 +266,7 @@ main(int argc, char *argv[])
 		}
 
 		drr_record_count[drr->drr_type]++;
+		total_records++;
 
 		switch (drr->drr_type) {
 		case DRR_BEGIN:
@@ -376,8 +379,8 @@ main(int argc, char *argv[])
 				    drro->drr_bonuslen);
 			}
 			if (drro->drr_bonuslen > 0) {
-				(void) ssread(buf, P2ROUNDUP(drro->drr_bonuslen,
-				    8), &zc);
+				(void) ssread(buf,
+				    P2ROUNDUP(drro->drr_bonuslen, 8), &zc);
 				if (dump) {
 					print_block(buf,
 					    P2ROUNDUP(drro->drr_bonuslen, 8));
@@ -506,6 +509,38 @@ main(int argc, char *argv[])
 				print_block(buf, drrs->drr_length);
 			}
 			break;
+		case DRR_WRITE_EMBEDDED:
+			if (do_byteswap) {
+				drrwe->drr_object =
+				    BSWAP_64(drrwe->drr_object);
+				drrwe->drr_offset =
+				    BSWAP_64(drrwe->drr_offset);
+				drrwe->drr_length =
+				    BSWAP_64(drrwe->drr_length);
+				drrwe->drr_toguid =
+				    BSWAP_64(drrwe->drr_toguid);
+				drrwe->drr_lsize =
+				    BSWAP_32(drrwe->drr_lsize);
+				drrwe->drr_psize =
+				    BSWAP_32(drrwe->drr_psize);
+			}
+			if (verbose) {
+				(void) printf("WRITE_EMBEDDED object = %llu "
+				    "offset = %llu length = %llu\n"
+				    "toguid = %llx comp = %u etype = %u "
+				    "lsize = %u psize = %u\n",
+				    (u_longlong_t)drrwe->drr_object,
+				    (u_longlong_t)drrwe->drr_offset,
+				    (u_longlong_t)drrwe->drr_length,
+				    (u_longlong_t)drrwe->drr_toguid,
+				    drrwe->drr_compression,
+				    drrwe->drr_etype,
+				    drrwe->drr_lsize,
+				    drrwe->drr_psize);
+			}
+			(void) ssread(buf,
+			    P2ROUNDUP(drrwe->drr_psize, 8), &zc);
+			break;
 		}
 		pcksum = zc;
 	}
@@ -524,18 +559,16 @@ main(int argc, char *argv[])
 	    (u_longlong_t)drr_record_count[DRR_FREEOBJECTS]);
 	(void) printf("\tTotal DRR_WRITE records = %lld\n",
 	    (u_longlong_t)drr_record_count[DRR_WRITE]);
+	(void) printf("\tTotal DRR_WRITE_BYREF records = %lld\n",
+	    (u_longlong_t)drr_record_count[DRR_WRITE_BYREF]);
+	(void) printf("\tTotal DRR_WRITE_EMBEDDED records = %lld\n",
+	    (u_longlong_t)drr_record_count[DRR_WRITE_EMBEDDED]);
 	(void) printf("\tTotal DRR_FREE records = %lld\n",
 	    (u_longlong_t)drr_record_count[DRR_FREE]);
 	(void) printf("\tTotal DRR_SPILL records = %lld\n",
 	    (u_longlong_t)drr_record_count[DRR_SPILL]);
 	(void) printf("\tTotal records = %lld\n",
-	    (u_longlong_t)(drr_record_count[DRR_BEGIN] +
-	    drr_record_count[DRR_OBJECT] +
-	    drr_record_count[DRR_FREEOBJECTS] +
-	    drr_record_count[DRR_WRITE] +
-	    drr_record_count[DRR_FREE] +
-	    drr_record_count[DRR_SPILL] +
-	    drr_record_count[DRR_END]));
+	    (u_longlong_t)total_records);
 	(void) printf("\tTotal write size = %lld (0x%llx)\n",
 	    (u_longlong_t)total_write_size, (u_longlong_t)total_write_size);
 	(void) printf("\tTotal stream length = %lld (0x%llx)\n",

Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Tue Jul  1 06:29:15 2014	(r268074)
+++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Tue Jul  1 06:43:15 2014	(r268075)
@@ -53,7 +53,7 @@
  *     At random times, the child self-immolates with a SIGKILL.
  *     This is the software equivalent of pulling the power cord.
  *     The parent then runs the test again, using the existing
- *     storage pool, as many times as desired. If backwards compatability
+ *     storage pool, as many times as desired. If backwards compatibility
  *     testing is enabled ztest will sometimes run the "older" version
  *     of ztest after a SIGKILL.
  *
@@ -1267,13 +1267,13 @@ static void
 ztest_bt_verify(ztest_block_tag_t *bt, objset_t *os, uint64_t object,
     uint64_t offset, uint64_t gen, uint64_t txg, uint64_t crtxg)
 {
-	ASSERT(bt->bt_magic == BT_MAGIC);
-	ASSERT(bt->bt_objset == dmu_objset_id(os));
-	ASSERT(bt->bt_object == object);
-	ASSERT(bt->bt_offset == offset);
-	ASSERT(bt->bt_gen <= gen);
-	ASSERT(bt->bt_txg <= txg);
-	ASSERT(bt->bt_crtxg == crtxg);
+	ASSERT3U(bt->bt_magic, ==, BT_MAGIC);
+	ASSERT3U(bt->bt_objset, ==, dmu_objset_id(os));
+	ASSERT3U(bt->bt_object, ==, object);
+	ASSERT3U(bt->bt_offset, ==, offset);
+	ASSERT3U(bt->bt_gen, <=, gen);
+	ASSERT3U(bt->bt_txg, <=, txg);
+	ASSERT3U(bt->bt_crtxg, ==, crtxg);
 }
 
 static ztest_block_tag_t *
@@ -3472,6 +3472,11 @@ ztest_dsl_dataset_promote_busy(ztest_ds_
 	if (error)
 		fatal(0, "dmu_objset_own(%s) = %d", snap2name, error);
 	error = dsl_dataset_promote(clone2name, NULL);
+	if (error == ENOSPC) {
+		dmu_objset_disown(os, FTAG);
+		ztest_record_enospc(FTAG);
+		goto out;
+	}
 	if (error != EBUSY)
 		fatal(0, "dsl_dataset_promote(%s), %d, not EBUSY", clone2name,
 		    error);
@@ -3627,11 +3632,19 @@ ztest_dmu_read_write(ztest_ds_t *zd, uin
 		return;
 	}
 
-	dmu_object_set_checksum(os, bigobj,
-	    (enum zio_checksum)ztest_random_dsl_prop(ZFS_PROP_CHECKSUM), tx);
+	enum zio_checksum cksum;
+	do {
+		cksum = (enum zio_checksum)
+		    ztest_random_dsl_prop(ZFS_PROP_CHECKSUM);
+	} while (cksum >= ZIO_CHECKSUM_LEGACY_FUNCTIONS);
+	dmu_object_set_checksum(os, bigobj, cksum, tx);
 
-	dmu_object_set_compress(os, bigobj,
-	    (enum zio_compress)ztest_random_dsl_prop(ZFS_PROP_COMPRESSION), tx);
+	enum zio_compress comp;
+	do {
+		comp = (enum zio_compress)
+		    ztest_random_dsl_prop(ZFS_PROP_COMPRESSION);
+	} while (comp >= ZIO_COMPRESS_LEGACY_FUNCTIONS);
+	dmu_object_set_compress(os, bigobj, comp, tx);
 
 	/*
 	 * For each index from n to n + s, verify that the existing bufwad
@@ -4711,8 +4724,13 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, 
 	error = dsl_dataset_user_hold(holds, 0, NULL);
 	fnvlist_free(holds);
 
-	if (error)
-		fatal(0, "dsl_dataset_user_hold(%s)", fullname, tag);
+	if (error == ENOSPC) {
+		ztest_record_enospc("dsl_dataset_user_hold");
+		goto out;
+	} else if (error) {
+		fatal(0, "dsl_dataset_user_hold(%s, %s) = %u",
+		    fullname, tag, error);
+	}
 
 	error = dsl_destroy_snapshot(fullname, B_FALSE);
 	if (error != EBUSY) {
@@ -5165,7 +5183,7 @@ ztest_run_zdb(char *pool)
 	isa = strdup(isa);
 	/* LINTED */
 	(void) sprintf(bin,
-	    "/usr/sbin%.*s/zdb -bcc%s%s -U %s %s",
+	    "/usr/sbin%.*s/zdb -bcc%s%s -d -U %s %s",
 	    isalen,
 	    isa,
 	    ztest_opts.zo_verbose >= 3 ? "s" : "",

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h	Tue Jul  1 06:29:15 2014	(r268074)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h	Tue Jul  1 06:43:15 2014	(r268075)
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef	__cplusplus
 extern "C" {
@@ -607,13 +608,16 @@ typedef struct sendflags {
 
 	/* show progress (ie. -v) */
 	boolean_t progress;
+
+	/* WRITE_EMBEDDED records of type DATA are permitted */
+	boolean_t embed_data;
 } sendflags_t;
 
 typedef boolean_t (snapfilter_cb_t)(zfs_handle_t *, void *);
 
 extern int zfs_send(zfs_handle_t *, const char *, const char *,
     sendflags_t *, int, snapfilter_cb_t, void *, nvlist_t **);
-extern int zfs_send_one(zfs_handle_t *, const char *, int);
+extern int zfs_send_one(zfs_handle_t *, const char *, int, enum lzc_send_flags);
 
 extern int zfs_promote(zfs_handle_t *);
 extern int zfs_hold(zfs_handle_t *, const char *, const char *,

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c	Tue Jul  1 06:29:15 2014	(r268074)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c	Tue Jul  1 06:43:15 2014	(r268075)
@@ -21,7 +21,7 @@
 
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
  * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  * Copyright (c) 2012 Pawel Jakub Dawidek .
  * All rights reserved.
@@ -45,6 +45,7 @@
 #include 
 
 #include 
+#include 
 
 #include "zfs_namecheck.h"
 #include "zfs_prop.h"
@@ -222,6 +223,7 @@ cksummer(void *arg)
 	struct drr_object *drro = &thedrr.drr_u.drr_object;
 	struct drr_write *drrw = &thedrr.drr_u.drr_write;
 	struct drr_spill *drrs = &thedrr.drr_u.drr_spill;
+	struct drr_write_embedded *drrwe = &thedrr.drr_u.drr_write_embedded;
 	FILE *ofp;
 	int outfd;
 	dmu_replay_record_t wbr_drr = {0};
@@ -418,6 +420,20 @@ cksummer(void *arg)
 			break;
 		}
 
+		case DRR_WRITE_EMBEDDED:
+		{
+			if (cksum_and_write(drr, sizeof (dmu_replay_record_t),
+			    &stream_cksum, outfd) == -1)
+				goto out;
+			(void) ssread(buf,
+			    P2ROUNDUP((uint64_t)drrwe->drr_psize, 8), ofp);
+			if (cksum_and_write(buf,
+			    P2ROUNDUP((uint64_t)drrwe->drr_psize, 8),
+			    &stream_cksum, outfd) == -1)
+				goto out;
+			break;
+		}
+
 		case DRR_FREE:
 		{
 			if (cksum_and_write(drr, sizeof (dmu_replay_record_t),
@@ -799,7 +815,7 @@ typedef struct send_dump_data {
 	char prevsnap[ZFS_MAXNAMELEN];
 	uint64_t prevsnap_obj;
 	boolean_t seenfrom, seento, replicate, doall, fromorigin;
-	boolean_t verbose, dryrun, parsable, progress;
+	boolean_t verbose, dryrun, parsable, progress, embed_data;
 	int outfd;
 	boolean_t err;
 	nvlist_t *fss;
@@ -878,7 +894,8 @@ estimate_ioctl(zfs_handle_t *zhp, uint64
  */
 static int
 dump_ioctl(zfs_handle_t *zhp, const char *fromsnap, uint64_t fromsnap_obj,
-    boolean_t fromorigin, int outfd, nvlist_t *debugnv)
+    boolean_t fromorigin, int outfd, enum lzc_send_flags flags,
+    nvlist_t *debugnv)
 {
 	zfs_cmd_t zc = { 0 };
 	libzfs_handle_t *hdl = zhp->zfs_hdl;
@@ -892,6 +909,7 @@ dump_ioctl(zfs_handle_t *zhp, const char
 	zc.zc_obj = fromorigin;
 	zc.zc_sendobj = zfs_prop_get_int(zhp, ZFS_PROP_OBJSETID);
 	zc.zc_fromobj = fromsnap_obj;
+	zc.zc_flags = flags;
 
 	VERIFY(0 == nvlist_alloc(&thisdbg, NV_UNIQUE_NAME, 0));
 	if (fromsnap && fromsnap[0] != '\0') {
@@ -1144,8 +1162,12 @@ dump_snapshot(zfs_handle_t *zhp, void *a
 			}
 		}
 
+		enum lzc_send_flags flags = 0;
+		if (sdd->embed_data)
+			flags |= LZC_SEND_FLAG_EMBED_DATA;
+
 		err = dump_ioctl(zhp, sdd->prevsnap, sdd->prevsnap_obj,
-		    fromorigin, sdd->outfd, sdd->debugnv);
+		    fromorigin, sdd->outfd, flags, sdd->debugnv);
 
 		if (sdd->progress) {
 			(void) pthread_cancel(tid);
@@ -1489,6 +1511,7 @@ zfs_send(zfs_handle_t *zhp, const char *
 	sdd.parsable = flags->parsable;
 	sdd.progress = flags->progress;
 	sdd.dryrun = flags->dryrun;
+	sdd.embed_data = flags->embed_data;
 	sdd.filter_cb = filter_func;
 	sdd.filter_cb_arg = cb_arg;
 	if (debugnvp)
@@ -1620,7 +1643,8 @@ err_out:
 }
 
 int
-zfs_send_one(zfs_handle_t *zhp, const char *from, int fd)
+zfs_send_one(zfs_handle_t *zhp, const char *from, int fd,
+    enum lzc_send_flags flags)
 {
 	int err;
 	libzfs_handle_t *hdl = zhp->zfs_hdl;
@@ -1629,7 +1653,7 @@ zfs_send_one(zfs_handle_t *zhp, const ch
 	(void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
 	    "warning: cannot send '%s'"), zhp->zfs_name);
 
-	err = lzc_send(zhp->zfs_name, from, fd);
+	err = lzc_send(zhp->zfs_name, from, fd, flags);
 	if (err != 0) {
 		switch (errno) {
 		case EXDEV:
@@ -2576,6 +2600,16 @@ recv_skip(libzfs_handle_t *hdl, int fd, 
 			(void) recv_read(hdl, fd, buf,
 			    drr->drr_u.drr_spill.drr_length, B_FALSE, NULL);
 			break;
+		case DRR_WRITE_EMBEDDED:
+			if (byteswap) {
+				drr->drr_u.drr_write_embedded.drr_psize =
+				    BSWAP_32(drr->drr_u.drr_write_embedded.
+				    drr_psize);
+			}
+			(void) recv_read(hdl, fd, buf,
+			    P2ROUNDUP(drr->drr_u.drr_write_embedded.drr_psize,
+			    8), B_FALSE, NULL);
+			break;
 		case DRR_WRITE_BYREF:
 		case DRR_FREEOBJECTS:
 		case DRR_FREE:

Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c	Tue Jul  1 06:29:15 2014	(r268074)
+++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c	Tue Jul  1 06:43:15 2014	(r268075)
@@ -486,6 +486,8 @@ lzc_get_holds(const char *snapname, nvli
 }
 
 /*
+ * Generate a zfs send stream for the specified snapshot and write it to
+ * the specified file descriptor.
  *
  * "snapname" is the full name of the snapshot to send (e.g. "pool/fs@snap")
  *
@@ -499,9 +501,15 @@ lzc_get_holds(const char *snapname, nvli
  * snapshot in the origin, etc.
  *
  * "fd" is the file descriptor to write the send stream to.
+ *
+ * If "flags" contains LZC_SEND_FLAG_EMBED_DATA, the stream is permitted
+ * to contain DRR_WRITE_EMBEDDED records with drr_etype==BP_EMBEDDED_TYPE_DATA,
+ * which the receiving system must support (as indicated by support
+ * for the "embedded_data" feature).
  */
 int
-lzc_send(const char *snapname, const char *from, int fd)
+lzc_send(const char *snapname, const char *from, int fd,
+    enum lzc_send_flags flags)
 {
 	nvlist_t *args;
 	int err;
@@ -510,6 +518,8 @@ lzc_send(const char *snapname, const cha
 	fnvlist_add_int32(args, "fd", fd);
 	if (from != NULL)
 		fnvlist_add_string(args, "fromsnap", from);
+	if (flags & LZC_SEND_FLAG_EMBED_DATA)
+		fnvlist_add_boolean(args, "embedok");
 	err = lzc_ioctl(ZFS_IOC_SEND_NEW, snapname, args, NULL);
 	nvlist_free(args);
 	return (err);

Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h	Tue Jul  1 06:29:15 2014	(r268074)
+++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h	Tue Jul  1 06:43:15 2014	(r268075)
@@ -53,7 +53,11 @@ int lzc_hold(nvlist_t *, int, nvlist_t *
 int lzc_release(nvlist_t *, nvlist_t **);
 int lzc_get_holds(const char *, nvlist_t **);
 
-int lzc_send(const char *, const char *, int);
+enum lzc_send_flags {
+	LZC_SEND_FLAG_EMBED_DATA = 1 << 0
+};
+
+int lzc_send(const char *, const char *, int, enum lzc_send_flags);
 int lzc_receive(const char *, nvlist_t *, const char *, boolean_t, int);
 int lzc_send_space(const char *, const char *, uint64_t *);
 

Modified: head/cddl/sbin/zpool/Makefile
==============================================================================
--- head/cddl/sbin/zpool/Makefile	Tue Jul  1 06:29:15 2014	(r268074)
+++ head/cddl/sbin/zpool/Makefile	Tue Jul  1 06:43:15 2014	(r268075)
@@ -18,6 +18,7 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/cont
 CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common
 CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libumem/common
 CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common
+CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common
 CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair
 CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs
 CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common

Modified: head/cddl/usr.bin/zinject/Makefile
==============================================================================
--- head/cddl/usr.bin/zinject/Makefile	Tue Jul  1 06:29:15 2014	(r268074)
+++ head/cddl/usr.bin/zinject/Makefile	Tue Jul  1 06:43:15 2014	(r268075)
@@ -11,6 +11,7 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/
 CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include
 CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem
 CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzfs/common
+CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzfs_core/common
 CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libzpool/common
 CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/lib/libnvpair
 CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Modified: head/cddl/usr.sbin/zdb/Makefile
==============================================================================
--- head/cddl/usr.sbin/zdb/Makefile	Tue Jul  1 06:29:15 2014	(r268074)
+++ head/cddl/usr.sbin/zdb/Makefile	Tue Jul  1 06:43:15 2014	(r268075)
@@ -15,6 +15,7 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp
 CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair
 CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common
 CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common
+CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common
 CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common
 CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs
 CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common

Modified: head/cddl/usr.sbin/zhack/Makefile
==============================================================================
--- head/cddl/usr.sbin/zhack/Makefile	Tue Jul  1 06:29:15 2014	(r268074)
+++ head/cddl/usr.sbin/zhack/Makefile	Tue Jul  1 06:43:15 2014	(r268075)
@@ -14,6 +14,7 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/comp
 CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair
 CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common
 CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common
+CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs_core/common
 CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common
 CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs
 CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common

Modified: head/sys/boot/zfs/zfsimpl.c
==============================================================================
--- head/sys/boot/zfs/zfsimpl.c	Tue Jul  1 06:29:15 2014	(r268074)
+++ head/sys/boot/zfs/zfsimpl.c	Tue Jul  1 06:43:15 2014	(r268075)
@@ -56,6 +56,7 @@ static const char *features_for_read[] =
 	"org.illumos:lz4_compress",
 	"com.delphix:hole_birth",
 	"com.delphix:extensible_dataset",
+	"com.delphix:embedded_data",
 	NULL
 };
 
@@ -1133,6 +1134,34 @@ zio_read(const spa_t *spa, const blkptr_
 	void *pbuf;
 	int i, error;
 
+	/*
+	 * Process data embedded in block pointer
+	 */
+	if (BP_IS_EMBEDDED(bp)) {
+		ASSERT(BPE_GET_ETYPE(bp) == BP_EMBEDDED_TYPE_DATA);
+
+		size = BPE_GET_PSIZE(bp);
+		ASSERT(size <= BPE_PAYLOAD_SIZE);
+
+		if (cpfunc != ZIO_COMPRESS_OFF)
+			pbuf = zfs_alloc(size);
+		else
+			pbuf = buf;
+
+		decode_embedded_bp_compressed(bp, pbuf);
+		error = 0;
+
+		if (cpfunc != ZIO_COMPRESS_OFF) {
+			error = zio_decompress_data(cpfunc, pbuf,
+			    size, buf, BP_GET_LSIZE(bp));
+			zfs_free(pbuf, size);
+		}
+		if (error != 0)
+			printf("ZFS: i/o error - unable to decompress block pointer data, error %d\n",
+			    error);
+		return (error);
+	}
+
 	error = EIO;
 
 	for (i = 0; i < SPA_DVAS_PER_BP; i++) {

Modified: head/sys/cddl/boot/zfs/README
==============================================================================
--- head/sys/cddl/boot/zfs/README	Tue Jul  1 06:29:15 2014	(r268074)
+++ head/sys/cddl/boot/zfs/README	Tue Jul  1 06:43:15 2014	(r268075)
@@ -7,9 +7,10 @@ are used by the ZFS bootstrap:
     sha256.c			checksum support
     lz4.c			compression support
     lzjb.c			compression support
+    blkptr.c			ZFS embedded-data block pointers support
     zfssubr.c			checksum, compression and raidz support
     zfsimpl.h			mostly describing the physical layout
 
-The files fletcher.c, lzjb.c and sha256.c are largely identical to the
-ZFS base code (with write support removed) and could be shared but
-that might complicate future imports from OpenSolaris.
+The files fletcher.c, lzjb.c, lz4.c, sha256.c and blkptr.c are largely identical
+to the ZFS base code (with write support removed) and could be shared but that
+might complicate future imports from Illumos.

Copied and modified: head/sys/cddl/boot/zfs/blkptr.c (from r267565, vendor-sys/illumos/dist/uts/common/fs/zfs/blkptr.c)
==============================================================================
--- vendor-sys/illumos/dist/uts/common/fs/zfs/blkptr.c	Tue Jun 17 07:35:54 2014	(r267565, copy source)
+++ head/sys/cddl/boot/zfs/blkptr.c	Tue Jul  1 06:43:15 2014	(r268075)
@@ -17,10 +17,6 @@
  * Copyright (c) 2013 by Delphix. All rights reserved.
  */
 
-#include 
-#include 
-#include 
-
 /*
  * Embedded-data Block Pointers
  *
@@ -43,48 +39,6 @@
  * See spa.h for details on the exact layout of embedded block pointers.
  */
 
-void
-encode_embedded_bp_compressed(blkptr_t *bp, void *data,
-    enum zio_compress comp, int uncompressed_size, int compressed_size)
-{
-	uint64_t *bp64 = (uint64_t *)bp;
-	uint64_t w = 0;
-	uint8_t *data8 = data;
-
-	ASSERT3U(compressed_size, <=, BPE_PAYLOAD_SIZE);
-	ASSERT(uncompressed_size == compressed_size ||
-	    comp != ZIO_COMPRESS_OFF);
-	ASSERT3U(comp, >=, ZIO_COMPRESS_OFF);
-	ASSERT3U(comp, <, ZIO_COMPRESS_FUNCTIONS);
-
-	bzero(bp, sizeof (*bp));
-	BP_SET_EMBEDDED(bp, B_TRUE);
-	BP_SET_COMPRESS(bp, comp);
-	BP_SET_BYTEORDER(bp, ZFS_HOST_BYTEORDER);
-	BPE_SET_LSIZE(bp, uncompressed_size);
-	BPE_SET_PSIZE(bp, compressed_size);
-
-	/*
-	 * Encode the byte array into the words of the block pointer.
-	 * First byte goes into low bits of first word (little endian).
-	 */
-	for (int i = 0; i < compressed_size; i++) {
-		BF64_SET(w, (i % sizeof (w)) * NBBY, NBBY, data8[i]);
-		if (i % sizeof (w) == sizeof (w) - 1) {
-			/* we've reached the end of a word */
-			ASSERT3P(bp64, <, bp + 1);
-			*bp64 = w;
-			bp64++;
-			if (!BPE_IS_PAYLOADWORD(bp, bp64))
-				bp64++;
-			w = 0;
-		}
-	}
-	/* write last partial word */
-	if (bp64 < (uint64_t *)(bp + 1))
-		*bp64 = w;
-}
-
 /*
  * buf must be at least BPE_GET_PSIZE(bp) bytes long (which will never be
  * more than BPE_PAYLOAD_SIZE bytes).

Modified: head/sys/cddl/boot/zfs/zfsimpl.h
==============================================================================
--- head/sys/cddl/boot/zfs/zfsimpl.h	Tue Jul  1 06:29:15 2014	(r268074)
+++ head/sys/cddl/boot/zfs/zfsimpl.h	Tue Jul  1 06:43:15 2014	(r268075)
@@ -55,9 +55,14 @@
 /*
  * Copyright 2013 by Saso Kiselkov. All rights reserved.
  */
+/*
+ * Copyright (c) 2013 by Delphix. All rights reserved.
+ */
 
 #define	MAXNAMELEN	256
 
+#define _NOTE(s)
+
 /* CRC64 table */
 #define	ZFS_CRC64_POLY	0xC96C5795D7870F42ULL	/* ECMA-182, reflected form */
 
@@ -163,7 +168,7 @@ typedef struct zio_cksum {
  *	+-------+-------+-------+-------+-------+-------+-------+-------+
  * 5	|G|			 offset3				|
  *	+-------+-------+-------+-------+-------+-------+-------+-------+
- * 6	|BDX|lvl| type	| cksum | comp	|     PSIZE	|     LSIZE	|
+ * 6	|BDX|lvl| type	| cksum |E| comp|    PSIZE	|     LSIZE	|

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 07:13:41 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id BACAC161;
 Tue,  1 Jul 2014 07:13:41 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A90BC2D8D;
 Tue,  1 Jul 2014 07:13:41 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s617DfHT005175;
 Tue, 1 Jul 2014 07:13:41 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s617Df7S005174;
 Tue, 1 Jul 2014 07:13:41 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201407010713.s617Df7S005174@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Tue, 1 Jul 2014 07:13:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268078 - head/sys/dev/usb/net
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 07:13:41 -0000

Author: hselasky
Date: Tue Jul  1 07:13:41 2014
New Revision: 268078
URL: http://svnweb.freebsd.org/changeset/base/268078

Log:
  Fix for use after free.
  
  MFC after:	3 days

Modified:
  head/sys/dev/usb/net/uhso.c

Modified: head/sys/dev/usb/net/uhso.c
==============================================================================
--- head/sys/dev/usb/net/uhso.c	Tue Jul  1 06:59:23 2014	(r268077)
+++ head/sys/dev/usb/net/uhso.c	Tue Jul  1 07:13:41 2014	(r268078)
@@ -559,8 +559,6 @@ uhso_attach(device_t self)
 	mtx_init(&sc->sc_mtx, "uhso", NULL, MTX_DEF);
 	ucom_ref(&sc->sc_super_ucom);
 
-	sc->sc_ucom = NULL;
-	sc->sc_ttys = 0;
 	sc->sc_radio = 1;
 
 	id = usbd_get_interface_descriptor(uaa->iface);
@@ -680,9 +678,6 @@ uhso_detach(device_t self)
 				    UHSO_CTRL_MAX);
 			}
 		}
-
-		free(sc->sc_tty, M_USBDEV);
-		free(sc->sc_ucom, M_USBDEV);
 	}
 
 	if (sc->sc_ifp != NULL) {
@@ -710,6 +705,8 @@ static void
 uhso_free_softc(struct uhso_softc *sc)
 {
 	if (ucom_unref(&sc->sc_super_ucom)) {
+		free(sc->sc_tty, M_USBDEV);
+		free(sc->sc_ucom, M_USBDEV);
 		mtx_destroy(&sc->sc_mtx);
 		device_free_softc(sc);
 	}

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 07:29:46 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 36F5B4D7;
 Tue,  1 Jul 2014 07:29:46 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 219712E90;
 Tue,  1 Jul 2014 07:29:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s617TkrE010448;
 Tue, 1 Jul 2014 07:29:46 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s617Tgts010424;
 Tue, 1 Jul 2014 07:29:42 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201407010729.s617Tgts010424@svn.freebsd.org>
From: Xin LI 
Date: Tue, 1 Jul 2014 07:29:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268079 - in head: cddl/contrib/opensolaris/cmd/zdb
 cddl/contrib/opensolaris/lib/libzfs/common
 sys/cddl/contrib/opensolaris/common/zfs
 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys...
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 07:29:46 -0000

Author: delphij
Date: Tue Jul  1 07:29:42 2014
New Revision: 268079
URL: http://svnweb.freebsd.org/changeset/base/268079

Log:
  MFV r267566:
  
  4390 i/o errors when deleting filesystem/zvol can lead to space map corruption
  
  MFC after:	2 weeks

Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
  head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Tue Jul  1 07:13:41 2014	(r268078)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Tue Jul  1 07:29:42 2014	(r268079)
@@ -75,9 +75,9 @@
 	DMU_OT_ZAP_OTHER : DMU_OT_NUMTYPES))
 
 #ifndef lint
-extern int zfs_recover;
+extern boolean_t zfs_recover;
 #else
-int zfs_recover;
+boolean_t zfs_recover;
 #endif
 
 const char cmdname[] = "zdb";

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c	Tue Jul  1 07:13:41 2014	(r268078)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c	Tue Jul  1 07:29:42 2014	(r268079)
@@ -303,6 +303,7 @@ zpool_get_prop(zpool_handle_t *zhp, zpoo
 		case ZPOOL_PROP_ALLOCATED:
 		case ZPOOL_PROP_FREE:
 		case ZPOOL_PROP_FREEING:
+		case ZPOOL_PROP_LEAKED:
 		case ZPOOL_PROP_EXPANDSZ:
 			if (literal) {
 				(void) snprintf(buf, len, "%llu",

Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c	Tue Jul  1 07:13:41 2014	(r268078)
+++ head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c	Tue Jul  1 07:29:42 2014	(r268079)
@@ -81,6 +81,8 @@ zpool_prop_init(void)
 	    ZFS_TYPE_POOL, "", "FREE");
 	zprop_register_number(ZPOOL_PROP_FREEING, "freeing", 0, PROP_READONLY,
 	    ZFS_TYPE_POOL, "", "FREEING");
+	zprop_register_number(ZPOOL_PROP_LEAKED, "leaked", 0, PROP_READONLY,
+	    ZFS_TYPE_POOL, "", "LEAKED");
 	zprop_register_number(ZPOOL_PROP_ALLOCATED, "allocated", 0,
 	    PROP_READONLY, ZFS_TYPE_POOL, "", "ALLOC");
 	zprop_register_number(ZPOOL_PROP_EXPANDSZ, "expandsize", 0,

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c	Tue Jul  1 07:13:41 2014	(r268078)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c	Tue Jul  1 07:29:42 2014	(r268079)
@@ -102,13 +102,27 @@ bptree_free(objset_t *os, uint64_t obj, 
 	return (dmu_object_free(os, obj, tx));
 }
 
+boolean_t
+bptree_is_empty(objset_t *os, uint64_t obj)
+{
+	dmu_buf_t *db;
+	bptree_phys_t *bt;
+	boolean_t rv;
+
+	VERIFY0(dmu_bonus_hold(os, obj, FTAG, &db));
+	bt = db->db_data;
+	rv = (bt->bt_begin == bt->bt_end);
+	dmu_buf_rele(db, FTAG);
+	return (rv);
+}
+
 void
 bptree_add(objset_t *os, uint64_t obj, blkptr_t *bp, uint64_t birth_txg,
     uint64_t bytes, uint64_t comp, uint64_t uncomp, dmu_tx_t *tx)
 {
 	dmu_buf_t *db;
 	bptree_phys_t *bt;
-	bptree_entry_phys_t bte;
+	bptree_entry_phys_t bte = { 0 };
 
 	/*
 	 * bptree objects are in the pool mos, therefore they can only be
@@ -122,7 +136,6 @@ bptree_add(objset_t *os, uint64_t obj, b
 
 	bte.be_birth_txg = birth_txg;
 	bte.be_bp = *bp;
-	bzero(&bte.be_zb, sizeof (bte.be_zb));
 	dmu_write(os, obj, bt->bt_end * sizeof (bte), sizeof (bte), &bte, tx);
 
 	dmu_buf_will_dirty(db, tx);
@@ -153,10 +166,27 @@ bptree_visit_cb(spa_t *spa, zilog_t *zil
 	return (err);
 }
 
+/*
+ * If "free" is set:
+ *  - It is assumed that "func" will be freeing the block pointers.
+ *  - If "func" returns nonzero, the bookmark will be remembered and
+ *    iteration will be restarted from this point on next invocation.
+ *  - If an i/o error is encountered (e.g. "func" returns EIO or ECKSUM),
+ *    bptree_iterate will remember the bookmark, continue traversing
+ *    any additional entries, and return 0.
+ *
+ * If "free" is not set, traversal will stop and return an error if
+ * an i/o error is encountered.
+ *
+ * In either case, if zfs_free_leak_on_eio is set, i/o errors will be
+ * ignored and traversal will continue (i.e. TRAVERSE_HARD will be passed to
+ * traverse_dataset_destroyed()).
+ */
 int
 bptree_iterate(objset_t *os, uint64_t obj, boolean_t free, bptree_itor_t func,
     void *arg, dmu_tx_t *tx)
 {
+	boolean_t ioerr = B_FALSE;
 	int err;
 	uint64_t i;
 	dmu_buf_t *db;
@@ -182,49 +212,82 @@ bptree_iterate(objset_t *os, uint64_t ob
 		bptree_entry_phys_t bte;
 		int flags = TRAVERSE_PREFETCH_METADATA | TRAVERSE_POST;
 
-		ASSERT(!free || i == ba.ba_phys->bt_begin);
-
 		err = dmu_read(os, obj, i * sizeof (bte), sizeof (bte),
 		    &bte, DMU_READ_NO_PREFETCH);
 		if (err != 0)
 			break;
 
-		if (zfs_recover)
+		if (zfs_free_leak_on_eio)
 			flags |= TRAVERSE_HARD;
+		zfs_dbgmsg("bptree index %d: traversing from min_txg=%lld "
+		    "bookmark %lld/%lld/%lld/%lld",
+		    i, (longlong_t)bte.be_birth_txg,
+		    (longlong_t)bte.be_zb.zb_objset,
+		    (longlong_t)bte.be_zb.zb_object,
+		    (longlong_t)bte.be_zb.zb_level,
+		    (longlong_t)bte.be_zb.zb_blkid);
 		err = traverse_dataset_destroyed(os->os_spa, &bte.be_bp,
 		    bte.be_birth_txg, &bte.be_zb, flags,
 		    bptree_visit_cb, &ba);
 		if (free) {
-			if (err == ERESTART) {
+			/*
+			 * The callback has freed the visited block pointers.
+			 * Record our traversal progress on disk, either by
+			 * updating this record's bookmark, or by logically
+			 * removing this record by advancing bt_begin.
+			 */
+			if (err != 0) {
 				/* save bookmark for future resume */
 				ASSERT3U(bte.be_zb.zb_objset, ==,
 				    ZB_DESTROYED_OBJSET);
 				ASSERT0(bte.be_zb.zb_level);
 				dmu_write(os, obj, i * sizeof (bte),
 				    sizeof (bte), &bte, tx);
-				break;
-			}
-			if (err != 0) {
+				if (err == EIO || err == ECKSUM ||
+				    err == ENXIO) {
+					/*
+					 * Skip the rest of this tree and
+					 * continue on to the next entry.
+					 */
+					err = 0;
+					ioerr = B_TRUE;
+				} else {
+					break;
+				}
+			} else if (ioerr) {
 				/*
-				 * We can not properly handle an i/o
-				 * error, because the traversal code
-				 * does not know how to resume from an
-				 * arbitrary bookmark.
+				 * This entry is finished, but there were
+				 * i/o errors on previous entries, so we
+				 * can't adjust bt_begin.  Set this entry's
+				 * be_birth_txg such that it will be
+				 * treated as a no-op in future traversals.
 				 */
-				zfs_panic_recover("error %u from "
-				    "traverse_dataset_destroyed()", err);
+				bte.be_birth_txg = UINT64_MAX;
+				dmu_write(os, obj, i * sizeof (bte),
+				    sizeof (bte), &bte, tx);
 			}
 
-			ba.ba_phys->bt_begin++;
-			(void) dmu_free_range(os, obj,
-			    i * sizeof (bte), sizeof (bte), tx);
+			if (!ioerr) {
+				ba.ba_phys->bt_begin++;
+				(void) dmu_free_range(os, obj,
+				    i * sizeof (bte), sizeof (bte), tx);
+			}
+		} else if (err != 0) {
+			break;
 		}
 	}
 
-	ASSERT(!free || err != 0 || ba.ba_phys->bt_begin == ba.ba_phys->bt_end);
+	ASSERT(!free || err != 0 || ioerr ||
+	    ba.ba_phys->bt_begin == ba.ba_phys->bt_end);
 
 	/* if all blocks are free there should be no used space */
 	if (ba.ba_phys->bt_begin == ba.ba_phys->bt_end) {
+		if (zfs_free_leak_on_eio) {
+			ba.ba_phys->bt_bytes = 0;
+			ba.ba_phys->bt_comp = 0;
+			ba.ba_phys->bt_uncomp = 0;
+		}
+
 		ASSERT0(ba.ba_phys->bt_bytes);
 		ASSERT0(ba.ba_phys->bt_comp);
 		ASSERT0(ba.ba_phys->bt_uncomp);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c	Tue Jul  1 07:13:41 2014	(r268078)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c	Tue Jul  1 07:29:42 2014	(r268079)
@@ -58,6 +58,7 @@ typedef struct traverse_data {
 	zbookmark_t *td_resume;
 	int td_flags;
 	prefetch_data_t *td_pfd;
+	boolean_t td_paused;
 	blkptr_cb_t *td_func;
 	void *td_arg;
 } traverse_data_t;
@@ -163,7 +164,6 @@ resume_skip_check(traverse_data_t *td, c
 		 * If we found the block we're trying to resume from, zero
 		 * the bookmark out to indicate that we have resumed.
 		 */
-		ASSERT3U(zb->zb_object, <=, td->td_resume->zb_object);
 		if (bcmp(zb, td->td_resume, sizeof (*zb)) == 0) {
 			bzero(td->td_resume, sizeof (*zb));
 			if (td->td_flags & TRAVERSE_POST)
@@ -174,14 +174,6 @@ resume_skip_check(traverse_data_t *td, c
 }
 
 static void
-traverse_pause(traverse_data_t *td, const zbookmark_t *zb)
-{
-	ASSERT(td->td_resume != NULL);
-	ASSERT0(zb->zb_level);
-	bcopy(zb, td->td_resume, sizeof (*td->td_resume));
-}
-
-static void
 traverse_prefetch_metadata(traverse_data_t *td,
     const blkptr_t *bp, const zbookmark_t *zb)
 {
@@ -210,11 +202,10 @@ traverse_visitbp(traverse_data_t *td, co
     const blkptr_t *bp, const zbookmark_t *zb)
 {
 	zbookmark_t czb;
-	int err = 0, lasterr = 0;
+	int err = 0;
 	arc_buf_t *buf = NULL;
 	prefetch_data_t *pd = td->td_pfd;
 	boolean_t hard = td->td_flags & TRAVERSE_HARD;
-	boolean_t pause = B_FALSE;
 
 	switch (resume_skip_check(td, dnp, zb)) {
 	case RESUME_SKIP_ALL:
@@ -253,7 +244,9 @@ traverse_visitbp(traverse_data_t *td, co
 
 	if (BP_IS_HOLE(bp)) {
 		err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg);
-		return (err);
+		if (err != 0)
+			goto post;
+		return (0);
 	}
 
 	if (pd && !pd->pd_exited &&
@@ -273,8 +266,6 @@ traverse_visitbp(traverse_data_t *td, co
 		    td->td_arg);
 		if (err == TRAVERSE_VISIT_NO_CHILDREN)
 			return (0);
-		if (err == ERESTART)
-			pause = B_TRUE; /* handle pausing at a common point */
 		if (err != 0)
 			goto post;
 	}
@@ -288,7 +279,7 @@ traverse_visitbp(traverse_data_t *td, co
 		err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf,
 		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
 		if (err != 0)
-			return (err);
+			goto post;
 		cbp = buf->b_data;
 
 		for (i = 0; i < epb; i++) {
@@ -304,11 +295,8 @@ traverse_visitbp(traverse_data_t *td, co
 			    zb->zb_level - 1,
 			    zb->zb_blkid * epb + i);
 			err = traverse_visitbp(td, dnp, &cbp[i], &czb);
-			if (err != 0) {
-				if (!hard)
-					break;
-				lasterr = err;
-			}
+			if (err != 0)
+				break;
 		}
 	} else if (BP_GET_TYPE(bp) == DMU_OT_DNODE) {
 		uint32_t flags = ARC_WAIT;
@@ -318,7 +306,7 @@ traverse_visitbp(traverse_data_t *td, co
 		err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf,
 		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
 		if (err != 0)
-			return (err);
+			goto post;
 		dnp = buf->b_data;
 
 		for (i = 0; i < epb; i++) {
@@ -330,11 +318,8 @@ traverse_visitbp(traverse_data_t *td, co
 		for (i = 0; i < epb; i++) {
 			err = traverse_dnode(td, &dnp[i], zb->zb_objset,
 			    zb->zb_blkid * epb + i);
-			if (err != 0) {
-				if (!hard)
-					break;
-				lasterr = err;
-			}
+			if (err != 0)
+				break;
 		}
 	} else if (BP_GET_TYPE(bp) == DMU_OT_OBJSET) {
 		uint32_t flags = ARC_WAIT;
@@ -344,7 +329,7 @@ traverse_visitbp(traverse_data_t *td, co
 		err = arc_read(NULL, td->td_spa, bp, arc_getbuf_func, &buf,
 		    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
 		if (err != 0)
-			return (err);
+			goto post;
 
 		osp = buf->b_data;
 		dnp = &osp->os_meta_dnode;
@@ -359,19 +344,11 @@ traverse_visitbp(traverse_data_t *td, co
 
 		err = traverse_dnode(td, dnp, zb->zb_objset,
 		    DMU_META_DNODE_OBJECT);
-		if (err && hard) {
-			lasterr = err;
-			err = 0;
-		}
 		if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) {
 			dnp = &osp->os_groupused_dnode;
 			err = traverse_dnode(td, dnp, zb->zb_objset,
 			    DMU_GROUPUSED_OBJECT);
 		}
-		if (err && hard) {
-			lasterr = err;
-			err = 0;
-		}
 		if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) {
 			dnp = &osp->os_userused_dnode;
 			err = traverse_dnode(td, dnp, zb->zb_objset,
@@ -383,19 +360,37 @@ traverse_visitbp(traverse_data_t *td, co
 		(void) arc_buf_remove_ref(buf, &buf);
 
 post:
-	if (err == 0 && (td->td_flags & TRAVERSE_POST)) {
+	if (err == 0 && (td->td_flags & TRAVERSE_POST))
 		err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg);
-		if (err == ERESTART)
-			pause = B_TRUE;
+
+	if (hard && (err == EIO || err == ECKSUM)) {
+		/*
+		 * Ignore this disk error as requested by the HARD flag,
+		 * and continue traversal.
+		 */
+		err = 0;
 	}
 
-	if (pause && td->td_resume != NULL) {
-		ASSERT3U(err, ==, ERESTART);
-		ASSERT(!hard);
-		traverse_pause(td, zb);
+	/*
+	 * If we are stopping here, set td_resume.
+	 */
+	if (td->td_resume != NULL && err != 0 && !td->td_paused) {
+		td->td_resume->zb_objset = zb->zb_objset;
+		td->td_resume->zb_object = zb->zb_object;
+		td->td_resume->zb_level = 0;
+		/*
+		 * If we have stopped on an indirect block (e.g. due to
+		 * i/o error), we have not visited anything below it.
+		 * Set the bookmark to the first level-0 block that we need
+		 * to visit.  This way, the resuming code does not need to
+		 * deal with resuming from indirect blocks.
+		 */
+		td->td_resume->zb_blkid = zb->zb_blkid <<
+		    (zb->zb_level * (dnp->dn_indblkshift - SPA_BLKPTRSHIFT));
+		td->td_paused = B_TRUE;
 	}
 
-	return (err != 0 ? err : lasterr);
+	return (err);
 }
 
 static void
@@ -420,30 +415,21 @@ static int
 traverse_dnode(traverse_data_t *td, const dnode_phys_t *dnp,
     uint64_t objset, uint64_t object)
 {
-	int j, err = 0, lasterr = 0;
+	int j, err = 0;
 	zbookmark_t czb;
-	boolean_t hard = (td->td_flags & TRAVERSE_HARD);
 
 	for (j = 0; j < dnp->dn_nblkptr; j++) {
 		SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j);
 		err = traverse_visitbp(td, dnp, &dnp->dn_blkptr[j], &czb);
-		if (err != 0) {
-			if (!hard)
-				break;
-			lasterr = err;
-		}
+		if (err != 0)
+			break;
 	}
 
 	if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) {
 		SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID);
 		err = traverse_visitbp(td, dnp, &dnp->dn_spill, &czb);
-		if (err != 0) {
-			if (!hard)
-				return (err);
-			lasterr = err;
-		}
 	}
-	return (err != 0 ? err : lasterr);
+	return (err);
 }
 
 /* ARGSUSED */
@@ -530,6 +516,7 @@ traverse_impl(spa_t *spa, dsl_dataset_t 
 	td.td_arg = arg;
 	td.td_pfd = &pd;
 	td.td_flags = flags;
+	td.td_paused = B_FALSE;
 
 	pd.pd_blks_max = zfs_pd_blks_max;
 	pd.pd_flags = flags;
@@ -603,7 +590,7 @@ int
 traverse_pool(spa_t *spa, uint64_t txg_start, int flags,
     blkptr_cb_t func, void *arg)
 {
-	int err, lasterr = 0;
+	int err;
 	uint64_t obj;
 	dsl_pool_t *dp = spa_get_dsl(spa);
 	objset_t *mos = dp->dp_meta_objset;
@@ -616,16 +603,15 @@ traverse_pool(spa_t *spa, uint64_t txg_s
 		return (err);
 
 	/* visit each dataset */
-	for (obj = 1; err == 0 || (err != ESRCH && hard);
+	for (obj = 1; err == 0;
 	    err = dmu_object_next(mos, &obj, FALSE, txg_start)) {
 		dmu_object_info_t doi;
 
 		err = dmu_object_info(mos, obj, &doi);
 		if (err != 0) {
-			if (!hard)
-				return (err);
-			lasterr = err;
-			continue;
+			if (hard)
+				continue;
+			break;
 		}
 
 		if (doi.doi_bonus_type == DMU_OT_DSL_DATASET) {
@@ -636,23 +622,19 @@ traverse_pool(spa_t *spa, uint64_t txg_s
 			err = dsl_dataset_hold_obj(dp, obj, FTAG, &ds);
 			dsl_pool_config_exit(dp, FTAG);
 			if (err != 0) {
-				if (!hard)
-					return (err);
-				lasterr = err;
-				continue;
+				if (hard)
+					continue;
+				break;
 			}
 			if (ds->ds_phys->ds_prev_snap_txg > txg)
 				txg = ds->ds_phys->ds_prev_snap_txg;
 			err = traverse_dataset(ds, txg, flags, func, arg);
 			dsl_dataset_rele(ds, FTAG);
-			if (err != 0) {
-				if (!hard)
-					return (err);
-				lasterr = err;
-			}
+			if (err != 0)
+				break;
 		}
 	}
 	if (err == ESRCH)
 		err = 0;
-	return (err != 0 ? err : lasterr);
+	return (err);
 }

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c	Tue Jul  1 07:13:41 2014	(r268078)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c	Tue Jul  1 07:29:42 2014	(r268079)
@@ -329,6 +329,13 @@ dsl_pool_open(dsl_pool_t *dp)
 		    dp->dp_meta_objset, obj));
 	}
 
+	/*
+	 * Note: errors ignored, because the leak dir will not exist if we
+	 * have not encountered a leak yet.
+	 */
+	(void) dsl_pool_open_special_dir(dp, LEAK_DIR_NAME,
+	    &dp->dp_leak_dir);
+
 	if (spa_feature_is_active(dp->dp_spa, SPA_FEATURE_ASYNC_DESTROY)) {
 		err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT,
 		    DMU_POOL_BPTREE_OBJ, sizeof (uint64_t), 1,
@@ -376,6 +383,8 @@ dsl_pool_close(dsl_pool_t *dp)
 		dsl_dir_rele(dp->dp_mos_dir, dp);
 	if (dp->dp_free_dir)
 		dsl_dir_rele(dp->dp_free_dir, dp);
+	if (dp->dp_leak_dir)
+		dsl_dir_rele(dp->dp_leak_dir, dp);
 	if (dp->dp_root_dir)
 		dsl_dir_rele(dp->dp_root_dir, dp);
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c	Tue Jul  1 07:13:41 2014	(r268078)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c	Tue Jul  1 07:29:42 2014	(r268079)
@@ -52,9 +52,7 @@
 
 typedef int (scan_cb_t)(dsl_pool_t *, const blkptr_t *, const zbookmark_t *);
 
-static scan_cb_t dsl_scan_defrag_cb;
 static scan_cb_t dsl_scan_scrub_cb;
-static scan_cb_t dsl_scan_remove_cb;
 static void dsl_scan_cancel_sync(void *, dmu_tx_t *);
 static void dsl_scan_sync_state(dsl_scan_t *, dmu_tx_t *tx);
 
@@ -68,7 +66,7 @@ unsigned int zfs_free_min_time_ms = 1000
 unsigned int zfs_resilver_min_time_ms = 3000; /* min millisecs to resilver
 						 per txg */
 boolean_t zfs_no_scrub_io = B_FALSE; /* set to disable scrub i/o */
-boolean_t zfs_no_scrub_prefetch = B_FALSE; /* set to disable srub prefetching */
+boolean_t zfs_no_scrub_prefetch = B_FALSE; /* set to disable scrub prefetch */
 
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_UINT(_vfs_zfs, OID_AUTO, top_maxinflight, CTLFLAG_RWTUN,
@@ -1380,7 +1378,7 @@ dsl_scan_active(dsl_scan_t *scn)
 	if (spa_shutting_down(spa))
 		return (B_FALSE);
 	if (scn->scn_phys.scn_state == DSS_SCANNING ||
-	    scn->scn_async_destroying)
+	    (scn->scn_async_destroying && !scn->scn_async_stalled))
 		return (B_TRUE);
 
 	if (spa_version(scn->scn_dp->dp_spa) >= SPA_VERSION_DEADLISTS) {
@@ -1395,7 +1393,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *
 {
 	dsl_scan_t *scn = dp->dp_scan;
 	spa_t *spa = dp->dp_spa;
-	int err;
+	int err = 0;
 
 	/*
 	 * Check for scn_restart_txg before checking spa_load_state, so
@@ -1413,7 +1411,10 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *
 		dsl_scan_setup_sync(&func, tx);
 	}
 
-	if (!dsl_scan_active(scn) ||
+	/*
+	 * If the scan is inactive due to a stalled async destroy, try again.
+	 */
+	if ((!scn->scn_async_stalled && !dsl_scan_active(scn)) ||
 	    spa_sync_pass(dp->dp_spa) > 1)
 		return;
 
@@ -1423,10 +1424,11 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *
 	spa->spa_scrub_active = B_TRUE;
 
 	/*
-	 * First process the free list.  If we pause the free, don't do
-	 * any scanning.  This ensures that there is no free list when
-	 * we are scanning, so the scan code doesn't have to worry about
-	 * traversing it.
+	 * First process the async destroys.  If we pause, don't do
+	 * any scrubbing or resilvering.  This ensures that there are no
+	 * async destroys while we are scanning, so the scan code doesn't
+	 * have to worry about traversing it.  It is also faster to free the
+	 * blocks than to scrub them.
 	 */
 	if (spa_version(dp->dp_spa) >= SPA_VERSION_DEADLISTS) {
 		scn->scn_is_bptree = B_FALSE;
@@ -1436,48 +1438,92 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *
 		    dsl_scan_free_block_cb, scn, tx);
 		VERIFY3U(0, ==, zio_wait(scn->scn_zio_root));
 
-		if (err == 0 && spa_feature_is_active(spa,
-		    SPA_FEATURE_ASYNC_DESTROY)) {
-			ASSERT(scn->scn_async_destroying);
-			scn->scn_is_bptree = B_TRUE;
-			scn->scn_zio_root = zio_root(dp->dp_spa, NULL,
-			    NULL, ZIO_FLAG_MUSTSUCCEED);
-			err = bptree_iterate(dp->dp_meta_objset,
-			    dp->dp_bptree_obj, B_TRUE, dsl_scan_free_block_cb,
-			    scn, tx);
-			VERIFY0(zio_wait(scn->scn_zio_root));
-
-			if (err == 0) {
-				/* finished; deactivate async destroy feature */
-				spa_feature_decr(spa, SPA_FEATURE_ASYNC_DESTROY,
-				    tx);
-				ASSERT(!spa_feature_is_active(spa,
-				    SPA_FEATURE_ASYNC_DESTROY));
-				VERIFY0(zap_remove(dp->dp_meta_objset,
-				    DMU_POOL_DIRECTORY_OBJECT,
-				    DMU_POOL_BPTREE_OBJ, tx));
-				VERIFY0(bptree_free(dp->dp_meta_objset,
-				    dp->dp_bptree_obj, tx));
-				dp->dp_bptree_obj = 0;
-				scn->scn_async_destroying = B_FALSE;
-			}
-		}
-		if (scn->scn_visited_this_txg) {
-			zfs_dbgmsg("freed %llu blocks in %llums from "
-			    "free_bpobj/bptree txg %llu",
-			    (longlong_t)scn->scn_visited_this_txg,
-			    (longlong_t)
-			    NSEC2MSEC(gethrtime() - scn->scn_sync_start_time),
-			    (longlong_t)tx->tx_txg);
-			scn->scn_visited_this_txg = 0;
-			/*
-			 * Re-sync the ddt so that we can further modify
-			 * it when doing bprewrite.
-			 */
-			ddt_sync(spa, tx->tx_txg);
+		if (err != 0 && err != ERESTART)
+			zfs_panic_recover("error %u from bpobj_iterate()", err);
+	}
+
+	if (err == 0 && spa_feature_is_active(spa, SPA_FEATURE_ASYNC_DESTROY)) {
+		ASSERT(scn->scn_async_destroying);
+		scn->scn_is_bptree = B_TRUE;
+		scn->scn_zio_root = zio_root(dp->dp_spa, NULL,
+		    NULL, ZIO_FLAG_MUSTSUCCEED);
+		err = bptree_iterate(dp->dp_meta_objset,
+		    dp->dp_bptree_obj, B_TRUE, dsl_scan_free_block_cb, scn, tx);
+		VERIFY0(zio_wait(scn->scn_zio_root));
+
+		if (err == EIO || err == ECKSUM) {
+			err = 0;
+		} else if (err != 0 && err != ERESTART) {
+			zfs_panic_recover("error %u from "
+			    "traverse_dataset_destroyed()", err);
 		}
-		if (err == ERESTART)
-			return;
+
+		/*
+		 * If we didn't make progress, mark the async destroy as
+		 * stalled, so that we will not initiate a spa_sync() on
+		 * its behalf.
+		 */
+		scn->scn_async_stalled = (scn->scn_visited_this_txg == 0);
+
+		if (bptree_is_empty(dp->dp_meta_objset, dp->dp_bptree_obj)) {
+			/* finished; deactivate async destroy feature */
+			spa_feature_decr(spa, SPA_FEATURE_ASYNC_DESTROY, tx);
+			ASSERT(!spa_feature_is_active(spa,
+			    SPA_FEATURE_ASYNC_DESTROY));
+			VERIFY0(zap_remove(dp->dp_meta_objset,
+			    DMU_POOL_DIRECTORY_OBJECT,
+			    DMU_POOL_BPTREE_OBJ, tx));
+			VERIFY0(bptree_free(dp->dp_meta_objset,
+			    dp->dp_bptree_obj, tx));
+			dp->dp_bptree_obj = 0;
+			scn->scn_async_destroying = B_FALSE;
+		}
+	}
+	if (scn->scn_visited_this_txg) {
+		zfs_dbgmsg("freed %llu blocks in %llums from "
+		    "free_bpobj/bptree txg %llu; err=%u",
+		    (longlong_t)scn->scn_visited_this_txg,
+		    (longlong_t)
+		    NSEC2MSEC(gethrtime() - scn->scn_sync_start_time),
+		    (longlong_t)tx->tx_txg, err);
+		scn->scn_visited_this_txg = 0;
+
+		/*
+		 * Write out changes to the DDT that may be required as a
+		 * result of the blocks freed.  This ensures that the DDT
+		 * is clean when a scrub/resilver runs.
+		 */
+		ddt_sync(spa, tx->tx_txg);
+	}
+	if (err != 0)
+		return;
+	if (!scn->scn_async_destroying && zfs_free_leak_on_eio &&
+	    (dp->dp_free_dir->dd_phys->dd_used_bytes != 0 ||
+	    dp->dp_free_dir->dd_phys->dd_compressed_bytes != 0 ||
+	    dp->dp_free_dir->dd_phys->dd_uncompressed_bytes != 0)) {
+		/*
+		 * We have finished background destroying, but there is still
+		 * some space left in the dp_free_dir. Transfer this leaked
+		 * space to the dp_leak_dir.
+		 */
+		if (dp->dp_leak_dir == NULL) {
+			rrw_enter(&dp->dp_config_rwlock, RW_WRITER, FTAG);
+			(void) dsl_dir_create_sync(dp, dp->dp_root_dir,
+			    LEAK_DIR_NAME, tx);
+			VERIFY0(dsl_pool_open_special_dir(dp,
+			    LEAK_DIR_NAME, &dp->dp_leak_dir));
+			rrw_exit(&dp->dp_config_rwlock, FTAG);
+		}
+		dsl_dir_diduse_space(dp->dp_leak_dir, DD_USED_HEAD,
+		    dp->dp_free_dir->dd_phys->dd_used_bytes,
+		    dp->dp_free_dir->dd_phys->dd_compressed_bytes,
+		    dp->dp_free_dir->dd_phys->dd_uncompressed_bytes, tx);
+		dsl_dir_diduse_space(dp->dp_free_dir, DD_USED_HEAD,
+		    -dp->dp_free_dir->dd_phys->dd_used_bytes,
+		    -dp->dp_free_dir->dd_phys->dd_compressed_bytes,
+		    -dp->dp_free_dir->dd_phys->dd_uncompressed_bytes, tx);
+	}
+	if (!scn->scn_async_destroying) {
 		/* finished; verify that space accounting went to zero */
 		ASSERT0(dp->dp_free_dir->dd_phys->dd_used_bytes);
 		ASSERT0(dp->dp_free_dir->dd_phys->dd_compressed_bytes);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Tue Jul  1 07:13:41 2014	(r268078)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Tue Jul  1 07:29:42 2014	(r268079)
@@ -257,19 +257,25 @@ spa_prop_get_config(spa_t *spa, nvlist_t
 	}
 
 	if (pool != NULL) {
-		dsl_dir_t *freedir = pool->dp_free_dir;
-
 		/*
 		 * The $FREE directory was introduced in SPA_VERSION_DEADLISTS,
 		 * when opening pools before this version freedir will be NULL.
 		 */
-		if (freedir != NULL) {
+		if (pool->dp_free_dir != NULL) {
 			spa_prop_add_list(*nvp, ZPOOL_PROP_FREEING, NULL,
-			    freedir->dd_phys->dd_used_bytes, src);
+			    pool->dp_free_dir->dd_phys->dd_used_bytes, src);
 		} else {
 			spa_prop_add_list(*nvp, ZPOOL_PROP_FREEING,
 			    NULL, 0, src);
 		}
+
+		if (pool->dp_leak_dir != NULL) {
+			spa_prop_add_list(*nvp, ZPOOL_PROP_LEAKED, NULL,
+			    pool->dp_leak_dir->dd_phys->dd_used_bytes, src);
+		} else {
+			spa_prop_add_list(*nvp, ZPOOL_PROP_LEAKED,
+			    NULL, 0, src);
+		}
 	}
 
 	spa_prop_add_list(*nvp, ZPOOL_PROP_GUID, NULL, spa_guid(spa), src);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c	Tue Jul  1 07:13:41 2014	(r268078)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c	Tue Jul  1 07:29:42 2014	(r268079)
@@ -254,12 +254,43 @@ SYSCTL_INT(_debug, OID_AUTO, zfs_flags, 
  * This should only be used as a last resort, as it typically results
  * in leaked space, or worse.
  */
-int zfs_recover = 0;
+boolean_t zfs_recover = B_FALSE;
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_INT(_vfs_zfs, OID_AUTO, recover, CTLFLAG_RDTUN, &zfs_recover, 0,
     "Try to recover from otherwise-fatal errors.");
 
 /*
+ * If destroy encounters an EIO while reading metadata (e.g. indirect
+ * blocks), space referenced by the missing metadata can not be freed.
+ * Normally this causes the background destroy to become "stalled", as
+ * it is unable to make forward progress.  While in this stalled state,
+ * all remaining space to free from the error-encountering filesystem is
+ * "temporarily leaked".  Set this flag to cause it to ignore the EIO,
+ * permanently leak the space from indirect blocks that can not be read,
+ * and continue to free everything else that it can.
+ *
+ * The default, "stalling" behavior is useful if the storage partially
+ * fails (i.e. some but not all i/os fail), and then later recovers.  In
+ * this case, we will be able to continue pool operations while it is
+ * partially failed, and when it recovers, we can continue to free the
+ * space, with no leaks.  However, note that this case is actually
+ * fairly rare.
+ *
+ * Typically pools either (a) fail completely (but perhaps temporarily,
+ * e.g. a top-level vdev going offline), or (b) have localized,
+ * permanent errors (e.g. disk returns the wrong data due to bit flip or
+ * firmware bug).  In case (a), this setting does not matter because the
+ * pool will be suspended and the sync thread will not be able to make
+ * forward progress regardless.  In case (b), because the error is
+ * permanent, the best we can do is leak the minimum amount of space,
+ * which is what setting this flag will do.  Therefore, it is reasonable
+ * for this flag to normally be set, but we chose the more conservative
+ * approach of not setting it, so that there is no possibility of
+ * leaking space in the "partial temporary" failure case.
+ */
+boolean_t zfs_free_leak_on_eio = B_FALSE;
+
+/*
  * Expiration time in milliseconds. This value has two meanings. First it is
  * used to determine when the spa_deadman() logic should fire. By default the
  * spa_deadman() will fire if spa_sync() has not completed in 1000 seconds.

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h	Tue Jul  1 07:13:41 2014	(r268078)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h	Tue Jul  1 07:29:42 2014	(r268079)
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
  */
 
 #ifndef	_SYS_BPTREE_H
@@ -50,6 +50,7 @@ typedef int bptree_itor_t(void *arg, con
 
 uint64_t bptree_alloc(objset_t *os, dmu_tx_t *tx);
 int bptree_free(objset_t *os, uint64_t obj, dmu_tx_t *tx);
+boolean_t bptree_is_empty(objset_t *os, uint64_t obj);
 
 void bptree_add(objset_t *os, uint64_t obj, blkptr_t *bp, uint64_t birth_txg,
     uint64_t bytes, uint64_t comp, uint64_t uncomp, dmu_tx_t *tx);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h	Tue Jul  1 07:13:41 2014	(r268078)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h	Tue Jul  1 07:29:42 2014	(r268079)
@@ -253,7 +253,6 @@ void zfs_znode_byteswap(void *buf, size_
 
 #define	DMU_USERUSED_OBJECT	(-1ULL)
 #define	DMU_GROUPUSED_OBJECT	(-2ULL)
-#define	DMU_DEADLIST_OBJECT	(-3ULL)
 
 /*
  * artificial blkids for bonus buffer and spill blocks

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h	Tue Jul  1 07:13:41 2014	(r268078)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h	Tue Jul  1 07:29:42 2014	(r268079)
@@ -160,6 +160,7 @@ boolean_t dsl_dir_is_zapified(dsl_dir_t 
 #define	ORIGIN_DIR_NAME "$ORIGIN"
 #define	XLATION_DIR_NAME "$XLATION"
 #define	FREE_DIR_NAME "$FREE"
+#define	LEAK_DIR_NAME "$LEAK"
 
 #ifdef ZFS_DEBUG
 #define	dprintf_dd(dd, fmt, ...) do { \

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h	Tue Jul  1 07:13:41 2014	(r268078)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h	Tue Jul  1 07:29:42 2014	(r268079)
@@ -84,6 +84,7 @@ typedef struct dsl_pool {
 	struct dsl_dir *dp_root_dir;
 	struct dsl_dir *dp_mos_dir;
 	struct dsl_dir *dp_free_dir;
+	struct dsl_dir *dp_leak_dir;
 	struct dsl_dataset *dp_origin_snap;
 	uint64_t dp_root_dir_obj;
 	struct taskq *dp_vnrele_taskq;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h	Tue Jul  1 07:13:41 2014	(r268078)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h	Tue Jul  1 07:29:42 2014	(r268079)
@@ -114,6 +114,7 @@ typedef struct dsl_scan {
 	/* for freeing blocks */
 	boolean_t scn_is_bptree;
 	boolean_t scn_async_destroying;
+	boolean_t scn_async_stalled;
 
 	/* for debugging / information */
 	uint64_t scn_visited_this_txg;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h	Tue Jul  1 07:13:41 2014	(r268078)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h	Tue Jul  1 07:29:42 2014	(r268079)
@@ -49,7 +49,8 @@ extern "C" {
 #endif
 
 extern int zfs_flags;
-extern int zfs_recover;
+extern boolean_t zfs_recover;
+extern boolean_t zfs_free_leak_on_eio;
 
 #define	ZFS_DEBUG_DPRINTF	(1<<0)
 #define	ZFS_DEBUG_DBUF_VERIFY	(1<<1)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c	Tue Jul  1 07:13:41 2014	(r268078)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c	Tue Jul  1 07:29:42 2014	(r268079)
@@ -28,7 +28,7 @@
 list_t zfs_dbgmsgs;
 int zfs_dbgmsg_size;
 kmutex_t zfs_dbgmsgs_lock;
-int zfs_dbgmsg_maxsize = 1<<20; /* 1MB */
+int zfs_dbgmsg_maxsize = 4<<20; /* 4MB */
 
 void
 zfs_dbgmsg_init(void)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c	Tue Jul  1 07:13:41 2014	(r268078)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c	Tue Jul  1 07:29:42 2014	(r268079)
@@ -3378,13 +3378,6 @@ zbookmark_is_before(const dnode_phys_t *
 	ASSERT(zb1->zb_objset == zb2->zb_objset);
 	ASSERT(zb2->zb_level == 0);
 
-	/*
-	 * A bookmark in the deadlist is considered to be after
-	 * everything else.
-	 */
-	if (zb2->zb_object == DMU_DEADLIST_OBJECT)
-		return (B_TRUE);
-
 	/* The objset_phys_t isn't before anything. */
 	if (dnp == NULL)
 		return (B_FALSE);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h	Tue Jul  1 07:13:41 2014	(r268078)
+++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h	Tue Jul  1 07:29:42 2014	(r268079)
@@ -193,6 +193,7 @@ typedef enum {
 	ZPOOL_PROP_COMMENT,
 	ZPOOL_PROP_EXPANDSZ,
 	ZPOOL_PROP_FREEING,
+	ZPOOL_PROP_LEAKED,
 	ZPOOL_NUM_PROPS
 } zpool_prop_t;
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 07:30:30 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C0AD3541;
 Tue,  1 Jul 2014 07:30:30 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id AE64C2E98;
 Tue,  1 Jul 2014 07:30:30 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s617UUeO011077;
 Tue, 1 Jul 2014 07:30:30 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s617UU3H011075;
 Tue, 1 Jul 2014 07:30:30 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201407010730.s617UU3H011075@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Tue, 1 Jul 2014 07:30:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268080 - head/sys/dev/usb/serial
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 07:30:30 -0000

Author: hselasky
Date: Tue Jul  1 07:30:29 2014
New Revision: 268080
URL: http://svnweb.freebsd.org/changeset/base/268080

Log:
  Fix order of USB serial layer uninit. Currently module dependency
  rules prevent the USB serial module to be unloaded before any client
  modules. This patch ensures that the "ucom_mtx" mutex is destroyed
  last when doing a system uninit in a monotolith build aswell.
  
  MFC after:	3 days

Modified:
  head/sys/dev/usb/serial/usb_serial.c
  head/sys/dev/usb/serial/usb_serial.h

Modified: head/sys/dev/usb/serial/usb_serial.c
==============================================================================
--- head/sys/dev/usb/serial/usb_serial.c	Tue Jul  1 07:29:42 2014	(r268079)
+++ head/sys/dev/usb/serial/usb_serial.c	Tue Jul  1 07:30:29 2014	(r268080)
@@ -200,7 +200,7 @@ ucom_uninit(void *arg)
 
 	mtx_destroy(&ucom_mtx);
 }
-SYSUNINIT(ucom_uninit, SI_SUB_KLD - 2, SI_ORDER_ANY, ucom_uninit, NULL);
+SYSUNINIT(ucom_uninit, SI_SUB_KLD - 3, SI_ORDER_ANY, ucom_uninit, NULL);
 
 /*
  * Mark a unit number (the X in cuaUX) as in use.

Modified: head/sys/dev/usb/serial/usb_serial.h
==============================================================================
--- head/sys/dev/usb/serial/usb_serial.h	Tue Jul  1 07:29:42 2014	(r268079)
+++ head/sys/dev/usb/serial/usb_serial.h	Tue Jul  1 07:30:29 2014	(r268080)
@@ -195,7 +195,7 @@ struct ucom_softc {
 #define	UCOM_MTX_LOCK(sc) mtx_lock((sc)->sc_mtx)
 #define	UCOM_MTX_UNLOCK(sc) mtx_unlock((sc)->sc_mtx)
 #define	UCOM_UNLOAD_DRAIN(x) \
-SYSUNINIT(var, SI_SUB_KLD - 3, SI_ORDER_ANY, ucom_drain_all, 0)
+SYSUNINIT(var, SI_SUB_KLD - 2, SI_ORDER_ANY, ucom_drain_all, 0)
 
 #define	ucom_cfg_do_request(udev,com,req,ptr,flags,timo) \
     usbd_do_request_proc(udev,&(com)->sc_super->sc_tq,req,ptr,flags,NULL,timo)

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 07:54:13 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2B920CBD;
 Tue,  1 Jul 2014 07:54:13 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 19E5020F6;
 Tue,  1 Jul 2014 07:54:13 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s617sCOO023193;
 Tue, 1 Jul 2014 07:54:12 GMT (envelope-from zec@svn.freebsd.org)
Received: (from zec@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s617sClV023192;
 Tue, 1 Jul 2014 07:54:12 GMT (envelope-from zec@svn.freebsd.org)
Message-Id: <201407010754.s617sClV023192@svn.freebsd.org>
From: Marko Zec 
Date: Tue, 1 Jul 2014 07:54:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268081 - head/sys/netgraph
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 07:54:13 -0000

Author: zec
Date: Tue Jul  1 07:54:12 2014
New Revision: 268081
URL: http://svnweb.freebsd.org/changeset/base/268081

Log:
  Remove any stale mbuf tags from packets being injected into a netgraph
  graph.  In particular, this solves some issues with (probably leaked)
  IPSec-related tags being looped back through netgraph to the inbound
  path which then misinterpreted the stale tags.
  
  MFC after:	7 days

Modified:
  head/sys/netgraph/ng_eiface.c

Modified: head/sys/netgraph/ng_eiface.c
==============================================================================
--- head/sys/netgraph/ng_eiface.c	Tue Jul  1 07:30:29 2014	(r268080)
+++ head/sys/netgraph/ng_eiface.c	Tue Jul  1 07:54:12 2014	(r268081)
@@ -236,6 +236,9 @@ ng_eiface_start2(node_p node, hook_p hoo
 		if (m == NULL)
 			break;
 
+		/* Peel the mbuf off any stale tags */
+		m_tag_delete_chain(m, NULL);
+
 		/*
 		 * Berkeley packet filter.
 		 * Pass packet to bpf if there is a listener.

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 07:56:08 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 740B9E23;
 Tue,  1 Jul 2014 07:56:08 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 55B18210D;
 Tue,  1 Jul 2014 07:56:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s617u8bg023565;
 Tue, 1 Jul 2014 07:56:08 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s617u8rd023564;
 Tue, 1 Jul 2014 07:56:08 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201407010756.s617u8rd023564@svn.freebsd.org>
From: Xin LI 
Date: Tue, 1 Jul 2014 07:56:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268082 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 07:56:08 -0000

Author: delphij
Date: Tue Jul  1 07:56:07 2014
New Revision: 268082
URL: http://svnweb.freebsd.org/changeset/base/268082

Log:
  MFV r267567:
  
  4881 zfs send performance degradation when embedded block pointers are
       encountered
  
  illumos/illumos-gate@06315b795c0d54f0228e0b8af497a28752dd92da
  
  MFC after:	2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c	Tue Jul  1 07:54:12 2014	(r268081)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c	Tue Jul  1 07:56:07 2014	(r268082)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
  */
 
 #include 
@@ -197,6 +197,16 @@ traverse_prefetch_metadata(traverse_data
 	    ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
 }
 
+static boolean_t
+prefetch_needed(prefetch_data_t *pfd, const blkptr_t *bp)
+{
+	ASSERT(pfd->pd_flags & TRAVERSE_PREFETCH_DATA);
+	if (BP_IS_HOLE(bp) || BP_IS_EMBEDDED(bp) ||
+	    BP_GET_TYPE(bp) == DMU_OT_INTENT_LOG)
+		return (B_FALSE);
+	return (B_TRUE);
+}
+
 static int
 traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
     const blkptr_t *bp, const zbookmark_t *zb)
@@ -242,16 +252,7 @@ traverse_visitbp(traverse_data_t *td, co
 		return (0);
 	}
 
-	if (BP_IS_HOLE(bp)) {
-		err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg);
-		if (err != 0)
-			goto post;
-		return (0);
-	}
-
-	if (pd && !pd->pd_exited &&
-	    ((pd->pd_flags & TRAVERSE_PREFETCH_DATA) ||
-	    BP_GET_TYPE(bp) == DMU_OT_DNODE || BP_GET_LEVEL(bp) > 0)) {
+	if (pd != NULL && !pd->pd_exited && prefetch_needed(pd, bp)) {
 		mutex_enter(&pd->pd_mtx);
 		ASSERT(pd->pd_blks_fetched >= 0);
 		while (pd->pd_blks_fetched == 0 && !pd->pd_exited)
@@ -261,6 +262,13 @@ traverse_visitbp(traverse_data_t *td, co
 		mutex_exit(&pd->pd_mtx);
 	}
 
+	if (BP_IS_HOLE(bp)) {
+		err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg);
+		if (err != 0)
+			goto post;
+		return (0);
+	}
+
 	if (td->td_flags & TRAVERSE_PRE) {
 		err = td->td_func(td->td_spa, NULL, bp, zb, dnp,
 		    td->td_arg);
@@ -444,10 +452,7 @@ traverse_prefetcher(spa_t *spa, zilog_t 
 	if (pfd->pd_cancel)
 		return (SET_ERROR(EINTR));
 
-	if (BP_IS_HOLE(bp) || BP_IS_EMBEDDED(bp) ||
-	    !((pfd->pd_flags & TRAVERSE_PREFETCH_DATA) ||
-	    BP_GET_TYPE(bp) == DMU_OT_DNODE || BP_GET_LEVEL(bp) > 0) ||
-	    BP_GET_TYPE(bp) == DMU_OT_INTENT_LOG)
+	if (!prefetch_needed(pfd, bp))
 		return (0);
 
 	mutex_enter(&pfd->pd_mtx);

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 08:02:26 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 03D1C1E9;
 Tue,  1 Jul 2014 08:02:26 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E64C221D9;
 Tue,  1 Jul 2014 08:02:25 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6182PNY027740;
 Tue, 1 Jul 2014 08:02:25 GMT (envelope-from zec@svn.freebsd.org)
Received: (from zec@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6182P8J027739;
 Tue, 1 Jul 2014 08:02:25 GMT (envelope-from zec@svn.freebsd.org)
Message-Id: <201407010802.s6182P8J027739@svn.freebsd.org>
From: Marko Zec 
Date: Tue, 1 Jul 2014 08:02:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268083 - head/sys/netipsec
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 08:02:26 -0000

Author: zec
Date: Tue Jul  1 08:02:25 2014
New Revision: 268083
URL: http://svnweb.freebsd.org/changeset/base/268083

Log:
  The assumption in ipsec4_process_packet() that the payload may be
  only IPv4 is wrong, so check the IP version before mangling the
  payload header.

Modified:
  head/sys/netipsec/ipsec_output.c

Modified: head/sys/netipsec/ipsec_output.c
==============================================================================
--- head/sys/netipsec/ipsec_output.c	Tue Jul  1 07:56:07 2014	(r268082)
+++ head/sys/netipsec/ipsec_output.c	Tue Jul  1 08:02:25 2014	(r268083)
@@ -498,9 +498,11 @@ ipsec4_process_packet(
 				goto bad;
 			}
 			ip = mtod(m, struct ip *);
-			ip->ip_len = htons(m->m_pkthdr.len);
-			ip->ip_sum = 0;
-			ip->ip_sum = in_cksum(m, ip->ip_hl << 2);
+			if (ip->ip_v == IPVERSION) {
+				ip->ip_len = htons(m->m_pkthdr.len);
+				ip->ip_sum = 0;
+				ip->ip_sum = in_cksum(m, ip->ip_hl << 2);
+			}
 
 			/* Encapsulate the packet */
 			error = ipip_output(m, isr, &mp, 0, 0);

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 08:20:35 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id ACDD750A;
 Tue,  1 Jul 2014 08:20:35 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 99099230B;
 Tue,  1 Jul 2014 08:20:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s618KZ18033895;
 Tue, 1 Jul 2014 08:20:35 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s618KYT5033891;
 Tue, 1 Jul 2014 08:20:34 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201407010820.s618KYT5033891@svn.freebsd.org>
From: Xin LI 
Date: Tue, 1 Jul 2014 08:20:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268084 - in head/cddl/contrib/opensolaris: cmd/zdb
 lib/libzpool/common lib/libzpool/common/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 08:20:35 -0000

Author: delphij
Date: Tue Jul  1 08:20:34 2014
New Revision: 268084
URL: http://svnweb.freebsd.org/changeset/base/268084

Log:
  MFV r267568:
  
  4891 want zdb option to dump all metadata
  
  illumos/illumos-gate@df15e419cb7359ba56ddddab9045e438d89e7cbc
  
  MFC after:	2 weeks

Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.8
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
  head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.8	Tue Jul  1 08:02:25 2014	(r268083)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.8	Tue Jul  1 08:20:34 2014	(r268084)
@@ -14,12 +14,12 @@
 .\"
 .\" Copyright 2012, Richard Lowe.
 .\" Copyright (c) 2012, Marcelo Araujo .
-.\" Copyright (c) 2012 by Delphix. All rights reserved.
+.\" Copyright (c) 2012, 2014 by Delphix. All rights reserved.
 .\" All Rights Reserved.
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 20, 2014
+.Dd July 1, 2014
 .Dt ZDB 8
 .Os
 .Sh NAME
@@ -32,6 +32,7 @@
 .Op Fl t Ar txg
 .Op Fl U Ar cache
 .Op Fl M Ar inflight I/Os
+.Op Fl x Ar dumpdir
 .Ar poolname
 .Op Ar object ...
 .Nm
@@ -217,6 +218,14 @@ Operate on an exported pool, not present
 The
 .Fl p
 flag specifies the path under which devices are to be searched.
+.It Fl x Ar dumpdir
+All blocks accessed will be copied to files in the specified directory.
+The blocks will be placed in sparse files whose name is the same as
+that of the file or device read.  zdb can be then run on the generated files.
+Note that the
+.Fl bbc
+flags are sufficient to access (and thus copy)
+all metadata on the pool.
 .It Fl F
 Attempt to make an unreadable pool readable by trying progressively older
 transactions.

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Tue Jul  1 08:02:25 2014	(r268083)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Tue Jul  1 08:20:34 2014	(r268084)
@@ -112,7 +112,7 @@ usage(void)
 {
 	(void) fprintf(stderr,
 	    "Usage: %s [-CumdibcsDvhLXFPA] [-t txg] [-e [-p path...]] "
-	    "[-U config] [-M inflight I/Os] poolname [object...]\n"
+	    "[-U config] [-M inflight I/Os] [-x dumpdir] poolname [object...]\n"
 	    "       %s [-divPA] [-e -p path...] [-U config] dataset "
 	    "[object...]\n"
 	    "       %s -m [-LXFPA] [-t txg] [-e [-p path...]] [-U config] "
@@ -150,7 +150,7 @@ usage(void)
 	(void) fprintf(stderr, "        -R read and display block from a "
 	    "device\n\n");
 	(void) fprintf(stderr, "    Below options are intended for use "
-	    "with other options (except -l):\n");
+	    "with other options:\n");
 	(void) fprintf(stderr, "        -A ignore assertions (-A), enable "
 	    "panic recovery (-AA) or both (-AAA)\n");
 	(void) fprintf(stderr, "        -F attempt automatic rewind within "
@@ -163,11 +163,14 @@ usage(void)
 	    "has altroot/not in a cachefile\n");
 	(void) fprintf(stderr, "        -p  -- use one or more with "
 	    "-e to specify path to vdev dir\n");
-	(void) fprintf(stderr, "	-P print numbers in parseable form\n");
+	(void) fprintf(stderr, "        -x  -- "
+	    "dump all read blocks into specified directory\n");
+	(void) fprintf(stderr, "        -P print numbers in parseable form\n");
 	(void) fprintf(stderr, "        -t  -- highest txg to use when "
 	    "searching for uberblocks\n");
 	(void) fprintf(stderr, "        -M  -- "
-	    "specify the maximum number of checksumming I/Os [default is 200]");
+	    "specify the maximum number of "
+	    "checksumming I/Os [default is 200]\n");
 	(void) fprintf(stderr, "Specify an option more than once (e.g. -bb) "
 	    "to make only that option verbose\n");
 	(void) fprintf(stderr, "Default is to dump everything non-verbosely\n");
@@ -3355,7 +3358,8 @@ main(int argc, char **argv)
 
 	dprintf_setup(&argc, argv);
 
-	while ((c = getopt(argc, argv, "bcdhilmM:suCDRSAFLXevp:t:U:P")) != -1) {
+	while ((c = getopt(argc, argv,
+	    "bcdhilmM:suCDRSAFLXx:evp:t:U:P")) != -1) {
 		switch (c) {
 		case 'b':
 		case 'c':
@@ -3408,6 +3412,9 @@ main(int argc, char **argv)
 			}
 			searchdirs[nsearch++] = optarg;
 			break;
+		case 'x':
+			vn_dumpdir = optarg;
+			break;
 		case 't':
 			max_txg = strtoull(optarg, NULL, 0);
 			if (max_txg < TXG_INITIAL) {

Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c	Tue Jul  1 08:02:25 2014	(r268083)
+++ head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c	Tue Jul  1 08:20:34 2014	(r268084)
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -52,6 +53,9 @@ char hw_serial[HW_HOSTID_LEN];
 kmutex_t cpu_lock;
 #endif
 
+/* If set, all blocks read will be copied to the specified directory. */
+char *vn_dumpdir = NULL;
+
 struct utsname utsname = {
 	"userland", "libzpool", "1", "1", "na"
 };
@@ -415,6 +419,7 @@ int
 vn_open(char *path, int x1, int flags, int mode, vnode_t **vpp, int x2, int x3)
 {
 	int fd;
+	int dump_fd;
 	vnode_t *vp;
 	int old_umask;
 	char realpath[MAXPATHLEN];
@@ -463,6 +468,17 @@ vn_open(char *path, int x1, int flags, i
 	if (flags & FCREAT)
 		(void) umask(old_umask);
 
+	if (vn_dumpdir != NULL) {
+		char dumppath[MAXPATHLEN];
+		(void) snprintf(dumppath, sizeof (dumppath),
+		    "%s/%s", vn_dumpdir, basename(realpath));
+		dump_fd = open64(dumppath, O_CREAT | O_WRONLY, 0666);
+		if (dump_fd == -1)
+			return (errno);
+	} else {
+		dump_fd = -1;
+	}
+
 	if (fd == -1)
 		return (errno);
 
@@ -478,6 +494,7 @@ vn_open(char *path, int x1, int flags, i
 	vp->v_fd = fd;
 	vp->v_size = st.st_size;
 	vp->v_path = spa_strdup(path);
+	vp->v_dump_fd = dump_fd;
 
 	return (0);
 }
@@ -510,6 +527,11 @@ vn_rdwr(int uio, vnode_t *vp, void *addr
 
 	if (uio == UIO_READ) {
 		iolen = pread64(vp->v_fd, addr, len, offset);
+		if (vp->v_dump_fd != -1) {
+			int status =
+			    pwrite64(vp->v_dump_fd, addr, iolen, offset);
+			ASSERT(status != -1);
+		}
 	} else {
 		/*
 		 * To simulate partial disk writes, we split writes into two
@@ -536,6 +558,8 @@ void
 vn_close(vnode_t *vp, int openflag, cred_t *cr, kthread_t *td)
 {
 	close(vp->v_fd);
+	if (vp->v_dump_fd != -1)
+		close(vp->v_dump_fd);
 	spa_strfree(vp->v_path);
 	umem_free(vp, sizeof (vnode_t));
 }

Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h	Tue Jul  1 08:02:25 2014	(r268083)
+++ head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h	Tue Jul  1 08:20:34 2014	(r268084)
@@ -424,8 +424,10 @@ typedef struct vnode {
 	uint64_t	v_size;
 	int		v_fd;
 	char		*v_path;
+	int		v_dump_fd;
 } vnode_t;
 
+extern char *vn_dumpdir;
 #define	AV_SCANSTAMP_SZ	32		/* length of anti-virus scanstamp */
 
 typedef struct xoptattr {

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 08:28:50 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7E39F855;
 Tue,  1 Jul 2014 08:28:50 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6B5A52406;
 Tue,  1 Jul 2014 08:28:50 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s618So5q038253;
 Tue, 1 Jul 2014 08:28:50 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s618So7g038252;
 Tue, 1 Jul 2014 08:28:50 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201407010828.s618So7g038252@svn.freebsd.org>
From: Xin LI 
Date: Tue, 1 Jul 2014 08:28:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268085 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 08:28:50 -0000

Author: delphij
Date: Tue Jul  1 08:28:49 2014
New Revision: 268085
URL: http://svnweb.freebsd.org/changeset/base/268085

Log:
  MFV r267569:
  
  4897 Space accounting mismatch in L2ARC/zpool
  
  illumos/illumos-dist@3038a2b421b40dc5ac11cd88423696618584f85a
  
  MFC after:	2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Tue Jul  1 08:20:34 2014	(r268084)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Tue Jul  1 08:28:49 2014	(r268085)
@@ -22,7 +22,7 @@
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2013 by Delphix. All rights reserved.
  * Copyright (c) 2014 by Saso Kiselkov. All rights reserved.
- * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
  */
 
 /*
@@ -1746,6 +1746,8 @@ arc_hdr_destroy(arc_buf_hdr_t *hdr)
 			list_remove(l2hdr->b_dev->l2ad_buflist, hdr);
 			ARCSTAT_INCR(arcstat_l2_size, -hdr->b_size);
 			ARCSTAT_INCR(arcstat_l2_asize, -l2hdr->b_asize);
+			vdev_space_update(l2hdr->b_dev->l2ad_vdev,
+			    -l2hdr->b_asize, 0, 0);
 			kmem_free(l2hdr, sizeof (l2arc_buf_hdr_t));
 			if (hdr->b_state == arc_l2c_only)
 				l2arc_hdr_stat_remove();
@@ -3699,6 +3701,8 @@ arc_release(arc_buf_t *buf, void *tag)
 
 	if (l2hdr) {
 		ARCSTAT_INCR(arcstat_l2_asize, -l2hdr->b_asize);
+		vdev_space_update(l2hdr->b_dev->l2ad_vdev,
+		    -l2hdr->b_asize, 0, 0);
 		trim_map_free(l2hdr->b_dev->l2ad_vdev, l2hdr->b_daddr,
 		    hdr->b_size, 0);
 		kmem_free(l2hdr, sizeof (l2arc_buf_hdr_t));
@@ -4600,6 +4604,7 @@ l2arc_write_done(zio_t *zio)
 	arc_buf_hdr_t *head, *ab, *ab_prev;
 	l2arc_buf_hdr_t *abl2;
 	kmutex_t *hash_lock;
+	int64_t bytes_dropped = 0;
 
 	cb = zio->io_private;
 	ASSERT(cb != NULL);
@@ -4647,6 +4652,7 @@ l2arc_write_done(zio_t *zio)
 			 */
 			list_remove(buflist, ab);
 			ARCSTAT_INCR(arcstat_l2_asize, -abl2->b_asize);
+			bytes_dropped += abl2->b_asize;
 			ab->b_l2hdr = NULL;
 			trim_map_free(abl2->b_dev->l2ad_vdev, abl2->b_daddr,
 			    ab->b_size, 0);
@@ -4667,6 +4673,8 @@ l2arc_write_done(zio_t *zio)
 	kmem_cache_free(hdr_cache, head);
 	mutex_exit(&l2arc_buflist_mtx);
 
+	vdev_space_update(dev->l2ad_vdev, -bytes_dropped, 0, 0);
+
 	l2arc_do_free_on_write();
 
 	kmem_free(cb, sizeof (l2arc_write_callback_t));
@@ -4806,6 +4814,7 @@ l2arc_evict(l2arc_dev_t *dev, uint64_t d
 	arc_buf_hdr_t *ab, *ab_prev;
 	kmutex_t *hash_lock;
 	uint64_t taddr;
+	int64_t bytes_evicted = 0;
 
 	buflist = dev->l2ad_buflist;
 
@@ -4904,6 +4913,7 @@ top:
 			if (ab->b_l2hdr != NULL) {
 				abl2 = ab->b_l2hdr;
 				ARCSTAT_INCR(arcstat_l2_asize, -abl2->b_asize);
+				bytes_evicted += abl2->b_asize;
 				ab->b_l2hdr = NULL;
 				kmem_free(abl2, sizeof (l2arc_buf_hdr_t));
 				ARCSTAT_INCR(arcstat_l2_size, -ab->b_size);
@@ -4920,7 +4930,7 @@ top:
 	}
 	mutex_exit(&l2arc_buflist_mtx);
 
-	vdev_space_update(dev->l2ad_vdev, -(taddr - dev->l2ad_evict), 0, 0);
+	vdev_space_update(dev->l2ad_vdev, -bytes_evicted, 0, 0);
 	dev->l2ad_evict = taddr;
 }
 
@@ -5173,15 +5183,13 @@ l2arc_write_buffers(spa_t *spa, l2arc_de
 	ARCSTAT_INCR(arcstat_l2_write_bytes, write_asize);
 	ARCSTAT_INCR(arcstat_l2_size, write_sz);
 	ARCSTAT_INCR(arcstat_l2_asize, write_asize);
-	vdev_space_update(dev->l2ad_vdev, write_psize, 0, 0);
+	vdev_space_update(dev->l2ad_vdev, write_asize, 0, 0);
 
 	/*
 	 * Bump device hand to the device start if it is approaching the end.
 	 * l2arc_evict() will already have evicted ahead for this case.
 	 */
 	if (dev->l2ad_hand >= (dev->l2ad_end - target_sz)) {
-		vdev_space_update(dev->l2ad_vdev,
-		    dev->l2ad_end - dev->l2ad_hand, 0, 0);
 		dev->l2ad_hand = dev->l2ad_start;
 		dev->l2ad_evict = dev->l2ad_start;
 		dev->l2ad_first = B_FALSE;

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 08:36:56 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id CB973B99;
 Tue,  1 Jul 2014 08:36:56 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B86E824CE;
 Tue,  1 Jul 2014 08:36:56 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s618au6s042700;
 Tue, 1 Jul 2014 08:36:56 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s618auuC042698;
 Tue, 1 Jul 2014 08:36:56 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201407010836.s618auuC042698@svn.freebsd.org>
From: Xin LI 
Date: Tue, 1 Jul 2014 08:36:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268086 - in head: cddl/contrib/opensolaris/cmd/ztest
 sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 08:36:57 -0000

Author: delphij
Date: Tue Jul  1 08:36:56 2014
New Revision: 268086
URL: http://svnweb.freebsd.org/changeset/base/268086

Log:
  MFV r267570:
  
  4756 metaslab_group_preload() could deadlock
  
  illumos/illumos-gate@30beaff42d8240ebf5386e8b7a14e3d137a1631f
  
  MFC after:	2 weeks

Modified:
  head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Tue Jul  1 08:28:49 2014	(r268085)
+++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Tue Jul  1 08:36:56 2014	(r268086)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 2012 Martin Matuska .  All rights reserved.
  * Copyright (c) 2013 Steven Hartland. All rights reserved.
@@ -187,6 +187,7 @@ static const ztest_shared_opts_t ztest_o
 extern uint64_t metaslab_gang_bang;
 extern uint64_t metaslab_df_alloc_threshold;
 extern uint64_t zfs_deadman_synctime_ms;
+extern int metaslab_preload_limit;
 
 static ztest_shared_opts_t *ztest_shared_opts;
 static ztest_shared_opts_t ztest_opts;
@@ -5596,6 +5597,7 @@ ztest_run(ztest_shared_t *zs)
 	kernel_init(FREAD | FWRITE);
 	VERIFY0(spa_open(ztest_opts.zo_pool, &spa, FTAG));
 	spa->spa_debug = B_TRUE;
+	metaslab_preload_limit = ztest_random(20) + 1;
 	ztest_spa = spa;
 
 	VERIFY0(dmu_objset_own(ztest_opts.zo_pool,

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c	Tue Jul  1 08:28:49 2014	(r268085)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c	Tue Jul  1 08:36:56 2014	(r268086)
@@ -1284,6 +1284,8 @@ metaslab_preload(void *arg)
 	metaslab_t *msp = arg;
 	spa_t *spa = msp->ms_group->mg_vd->vdev_spa;
 
+	ASSERT(!MUTEX_HELD(&msp->ms_group->mg_lock));
+
 	mutex_enter(&msp->ms_lock);
 	metaslab_load_wait(msp);
 	if (!msp->ms_loaded)
@@ -1308,19 +1310,36 @@ metaslab_group_preload(metaslab_group_t 
 		taskq_wait(mg->mg_taskq);
 		return;
 	}
-	mutex_enter(&mg->mg_lock);
 
+	mutex_enter(&mg->mg_lock);
 	/*
-	 * Prefetch the next potential metaslabs
+	 * Load the next potential metaslabs
 	 */
-	for (msp = avl_first(t); msp != NULL; msp = AVL_NEXT(t, msp)) {
+	msp = avl_first(t);
+	while (msp != NULL) {
+		metaslab_t *msp_next = AVL_NEXT(t, msp);
 
 		/* If we have reached our preload limit then we're done */
 		if (++m > metaslab_preload_limit)
 			break;
 
+		/*
+		 * We must drop the metaslab group lock here to preserve
+		 * lock ordering with the ms_lock (when grabbing both
+		 * the mg_lock and the ms_lock, the ms_lock must be taken
+		 * first).  As a result, it is possible that the ordering
+		 * of the metaslabs within the avl tree may change before
+		 * we reacquire the lock. The metaslab cannot be removed from
+		 * the tree while we're in syncing context so it is safe to
+		 * drop the mg_lock here. If the metaslabs are reordered
+		 * nothing will break -- we just may end up loading a
+		 * less than optimal one.
+		 */
+		mutex_exit(&mg->mg_lock);
 		VERIFY(taskq_dispatch(mg->mg_taskq, metaslab_preload,
 		    msp, TQ_SLEEP) != 0);
+		mutex_enter(&mg->mg_lock);
+		msp = msp_next;
 	}
 	mutex_exit(&mg->mg_lock);
 }

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 09:21:33 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7F80EA47;
 Tue,  1 Jul 2014 09:21:33 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5322B2942;
 Tue,  1 Jul 2014 09:21:33 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s619LXkP063078;
 Tue, 1 Jul 2014 09:21:33 GMT (envelope-from mjg@svn.freebsd.org)
Received: (from mjg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s619LXHL063077;
 Tue, 1 Jul 2014 09:21:33 GMT (envelope-from mjg@svn.freebsd.org)
Message-Id: <201407010921.s619LXHL063077@svn.freebsd.org>
From: Mateusz Guzik 
Date: Tue, 1 Jul 2014 09:21:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268087 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 09:21:33 -0000

Author: mjg
Date: Tue Jul  1 09:21:32 2014
New Revision: 268087
URL: http://svnweb.freebsd.org/changeset/base/268087

Log:
  Don't call crcopysafe or uifind unnecessarily in execve.
  
  MFC after:	1 week

Modified:
  head/sys/kern/kern_exec.c

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c	Tue Jul  1 08:36:56 2014	(r268086)
+++ head/sys/kern/kern_exec.c	Tue Jul  1 09:21:32 2014	(r268087)
@@ -336,7 +336,7 @@ do_execve(td, args, mac_p)
 	struct proc *p = td->td_proc;
 	struct nameidata nd;
 	struct ucred *newcred = NULL, *oldcred;
-	struct uidinfo *euip;
+	struct uidinfo *euip = NULL;
 	register_t *stack_base;
 	int error, i;
 	struct image_params image_params, *imgp;
@@ -601,8 +601,6 @@ interpret:
 	/*
 	 * Malloc things before we need locks.
 	 */
-	newcred = crget();
-	euip = uifind(attr.va_uid);
 	i = imgp->args->begin_envv - imgp->args->begin_argv;
 	/* Cache arguments if they fit inside our allowance */
 	if (ps_arg_cache_limit >= i + sizeof(struct pargs)) {
@@ -631,7 +629,7 @@ interpret:
 	PROC_LOCK(p);
 	if (oldsigacts)
 		p->p_sigacts = newsigacts;
-	oldcred = crcopysafe(p, newcred);
+	oldcred = p->p_ucred;
 	/* Stop profiling */
 	stopprofclock(p);
 
@@ -721,6 +719,8 @@ interpret:
 		vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
 		if (error != 0)
 			goto done1;
+		newcred = crdup(oldcred);
+		euip = uifind(attr.va_uid);
 		PROC_LOCK(p);
 		/*
 		 * Set the new credentials.
@@ -745,7 +745,6 @@ interpret:
 		change_svuid(newcred, newcred->cr_uid);
 		change_svgid(newcred, newcred->cr_gid);
 		p->p_ucred = newcred;
-		newcred = NULL;
 	} else {
 		if (oldcred->cr_uid == oldcred->cr_ruid &&
 		    oldcred->cr_gid == oldcred->cr_rgid)
@@ -764,10 +763,12 @@ interpret:
 		 */
 		if (oldcred->cr_svuid != oldcred->cr_uid ||
 		    oldcred->cr_svgid != oldcred->cr_gid) {
+			PROC_UNLOCK(p);
+			newcred = crdup(oldcred);
+			PROC_LOCK(p);
 			change_svuid(newcred, newcred->cr_uid);
 			change_svgid(newcred, newcred->cr_gid);
 			p->p_ucred = newcred;
-			newcred = NULL;
 		}
 	}
 
@@ -844,11 +845,10 @@ done1:
 	/*
 	 * Free any resources malloc'd earlier that we didn't use.
 	 */
-	uifree(euip);
-	if (newcred == NULL)
+	if (euip != NULL)
+		uifree(euip);
+	if (newcred != NULL)
 		crfree(oldcred);
-	else
-		crfree(newcred);
 	VOP_UNLOCK(imgp->vp, 0);
 
 	/*

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 10:51:20 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D2E6C17E;
 Tue,  1 Jul 2014 10:51:20 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BFEFA20DF;
 Tue,  1 Jul 2014 10:51:20 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61ApKQO005711;
 Tue, 1 Jul 2014 10:51:20 GMT (envelope-from scottl@svn.freebsd.org)
Received: (from scottl@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61ApKO0005710;
 Tue, 1 Jul 2014 10:51:20 GMT (envelope-from scottl@svn.freebsd.org)
Message-Id: <201407011051.s61ApKO0005710@svn.freebsd.org>
From: Scott Long 
Date: Tue, 1 Jul 2014 10:51:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268088 - head/sys/dev/mps
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 10:51:20 -0000

Author: scottl
Date: Tue Jul  1 10:51:20 2014
New Revision: 268088
URL: http://svnweb.freebsd.org/changeset/base/268088

Log:
  Don't overload the CCB status field within the driver.
  
  Obtained from:	Netflix, Inc.
  MFC after:	2 days

Modified:
  head/sys/dev/mps/mps_sas.c

Modified: head/sys/dev/mps/mps_sas.c
==============================================================================
--- head/sys/dev/mps/mps_sas.c	Tue Jul  1 09:21:32 2014	(r268087)
+++ head/sys/dev/mps/mps_sas.c	Tue Jul  1 10:51:20 2014	(r268088)
@@ -1852,7 +1852,7 @@ mpssas_action_scsiio(struct mpssas_softc
 	 * the I/O to the IR volume itself.
 	 */
 	if (sc->WD_valid_config) {
-		if (mpssas_get_ccbstatus(ccb) != MPS_WD_RETRY) {
+		if (ccb->ccb_h.sim_priv.entries[0].field == MPS_WD_RETRY) {
 			mpssas_direct_drive_io(sassc, cm, ccb);
 		} else {
 			mpssas_set_ccbstatus(ccb, CAM_REQ_INPROG);
@@ -2219,10 +2219,11 @@ mpssas_scsiio_complete(struct mps_softc 
 	 */
 	if (cm->cm_flags & MPS_CM_FLAGS_DD_IO) {
 		mps_free_command(sc, cm);
-		mpssas_set_ccbstatus(ccb, MPS_WD_RETRY);
+		ccb->ccb_h.sim_priv.entries[0].field = MPS_WD_RETRY;
 		mpssas_action_scsiio(sassc, ccb);
 		return;
-	}
+	} else
+		ccb->ccb_h.sim_priv.entries[0].field = 0;
 
 	switch (le16toh(rep->IOCStatus) & MPI2_IOCSTATUS_MASK) {
 	case MPI2_IOCSTATUS_SCSI_DATA_UNDERRUN:

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 11:42:52 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5126ED8D;
 Tue,  1 Jul 2014 11:42:52 +0000 (UTC)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E446125E5;
 Tue,  1 Jul 2014 11:42:51 +0000 (UTC)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s61BgjbE066338
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Tue, 1 Jul 2014 14:42:45 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s61BgjbE066338
Received: (from kostik@localhost)
 by tom.home (8.14.9/8.14.9/Submit) id s61BgjSD066337;
 Tue, 1 Jul 2014 14:42:45 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Tue, 1 Jul 2014 14:42:45 +0300
From: Konstantin Belousov 
To: Mateusz Guzik 
Subject: Re: svn commit: r268087 - head/sys/kern
Message-ID: <20140701114245.GO93733@kib.kiev.ua>
References: <201407010921.s619LXHL063077@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="li6R/r59jzh/oGCG"
Content-Disposition: inline
In-Reply-To: <201407010921.s619LXHL063077@svn.freebsd.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 autolearn_force=no version=3.4.0
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 11:42:52 -0000


--li6R/r59jzh/oGCG
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Jul 01, 2014 at 09:21:33AM +0000, Mateusz Guzik wrote:
> Author: mjg
> Date: Tue Jul  1 09:21:32 2014
> New Revision: 268087

> URL: http://svnweb.freebsd.org/changeset/base/268087
>=20
> Log:
>   Don't call crcopysafe or uifind unnecessarily in execve.
>  =20
>   MFC after:	1 week
>=20
> Modified:
>   head/sys/kern/kern_exec.c
>=20
> Modified: head/sys/kern/kern_exec.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/kern/kern_exec.c	Tue Jul  1 08:36:56 2014	(r268086)
> +++ head/sys/kern/kern_exec.c	Tue Jul  1 09:21:32 2014	(r268087)
> @@ -336,7 +336,7 @@ do_execve(td, args, mac_p)
>  	struct proc *p =3D td->td_proc;
>  	struct nameidata nd;
>  	struct ucred *newcred =3D NULL, *oldcred;
> -	struct uidinfo *euip;
> +	struct uidinfo *euip =3D NULL;
>  	register_t *stack_base;
>  	int error, i;
>  	struct image_params image_params, *imgp;
> @@ -601,8 +601,6 @@ interpret:
>  	/*
>  	 * Malloc things before we need locks.
>  	 */
> -	newcred =3D crget();
> -	euip =3D uifind(attr.va_uid);
>  	i =3D imgp->args->begin_envv - imgp->args->begin_argv;
>  	/* Cache arguments if they fit inside our allowance */
>  	if (ps_arg_cache_limit >=3D i + sizeof(struct pargs)) {
> @@ -631,7 +629,7 @@ interpret:
>  	PROC_LOCK(p);
>  	if (oldsigacts)
>  		p->p_sigacts =3D newsigacts;
> -	oldcred =3D crcopysafe(p, newcred);
> +	oldcred =3D p->p_ucred;
>  	/* Stop profiling */
>  	stopprofclock(p);
> =20
> @@ -721,6 +719,8 @@ interpret:
>  		vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
>  		if (error !=3D 0)
>  			goto done1;
> +		newcred =3D crdup(oldcred);
> +		euip =3D uifind(attr.va_uid);
>  		PROC_LOCK(p);
>  		/*
>  		 * Set the new credentials.
> @@ -745,7 +745,6 @@ interpret:
>  		change_svuid(newcred, newcred->cr_uid);
>  		change_svgid(newcred, newcred->cr_gid);
>  		p->p_ucred =3D newcred;
> -		newcred =3D NULL;
>  	} else {
>  		if (oldcred->cr_uid =3D=3D oldcred->cr_ruid &&
>  		    oldcred->cr_gid =3D=3D oldcred->cr_rgid)
> @@ -764,10 +763,12 @@ interpret:
>  		 */
>  		if (oldcred->cr_svuid !=3D oldcred->cr_uid ||
>  		    oldcred->cr_svgid !=3D oldcred->cr_gid) {
> +			PROC_UNLOCK(p);
> +			newcred =3D crdup(oldcred);
> +			PROC_LOCK(p);
>  			change_svuid(newcred, newcred->cr_uid);
>  			change_svgid(newcred, newcred->cr_gid);
>  			p->p_ucred =3D newcred;
> -			newcred =3D NULL;
>  		}
>  	}
> =20
> @@ -844,11 +845,10 @@ done1:
>  	/*
>  	 * Free any resources malloc'd earlier that we didn't use.
>  	 */
> -	uifree(euip);
> -	if (newcred =3D=3D NULL)
> +	if (euip !=3D NULL)
> +		uifree(euip);
> +	if (newcred !=3D NULL)
>  		crfree(oldcred);
> -	else
> -		crfree(newcred);
>  	VOP_UNLOCK(imgp->vp, 0);
> =20
>  	/*

Old code did the malloc(M_WAITOK) call in crget() before the text vnode
was locked.  After your change, the crdup() is called with the vnode locked.
Witness would not tell you that anything is wrong there, but the new
code is worse than the previous structure, even if malloc() was sometimes
done when not needed.

To satisfy the memory request from malloc(), pagedaemon or laundry may
need to lock the vnode, which creates a circular dependency.  Pagedaemon
locks vnodes with timeout, which just means that it would not be able
to clean pages while execve() is stuck in malloc(M_WAITOK), while
laundry takes the vnode lock without timeout, hanging until the malloc
request is satisfied.

The rule is, do not allocate memory while vnodes are locked.  It is not
always followed, but it makes no sense to change existing correct code
to broke the pattern.

--li6R/r59jzh/oGCG
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJTsp61AAoJEJDCuSvBvK1BVr0P/0ZrHyYse98/Vl3mFB8V5XFf
+cLNbCobf8bd1bNCn0h8dStfCQ9rQayHcDbM+sVquQDAh8lyg6B8HUDZuW7TDQSJ
7NM36JZMQI34PGCrucpQCpVOTwnruNmtHEuudi5TVfjyceLOu5dim6QVSOZ80buk
p6/zc448dc0gz74ec+01ZYQa9fzhjseNOJlwyZSYHfUr5YfXmDMrl0S4esxbsVNB
CPBiBortiAvpsDhpHR+/w5KwHmjgTDoogwSIbOX1Jas5XRnbnvMGQMhFTUNzz/Eb
x2o0xg3jrfBR214ESwHtp+Kz6g+Gi/tr4VrfZ58LJE4fIs7MKjF19x9wfL22MVBi
W5USQwC7z73msSCUBkS7O3VIaciiz6lv6UAkCNYoCzwsfgTZIY5QniSp6KAK3SDV
alJhXrYDv/2QeU7js2k0HUxOg/3aj2WCpvZDkeDWsbjtzuqQLZnAG3UiYI3ukfLm
rLWhsP25zP4R6VZji/yNVbw9/gERipyS9ssv1YIlazGku2VJZA8JMHIhMTuF4W9A
AKu/vxfzr9RM0FV17bHoD+5q94ciVQuhgbKA8gxDIu5yLy5UMBjkorX0yQVpa2da
/ME/GaUwsGrca2cV0clEwvJd5z8+NqixL+mePeJ6Q/Apr/DgLQjKiMKAV6hrpJKD
0OxeZKDsZ0UeWLoki+iE
=t4qw
-----END PGP SIGNATURE-----

--li6R/r59jzh/oGCG--

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 11:56:18 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 035E11E9;
 Tue,  1 Jul 2014 11:56:18 +0000 (UTC)
Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com
 [IPv6:2a00:1450:400c:c05::233])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 23A0126D8;
 Tue,  1 Jul 2014 11:56:16 +0000 (UTC)
Received: by mail-wi0-f179.google.com with SMTP id cc10so7580129wib.12
 for ; Tue, 01 Jul 2014 04:56:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=r+hzMBOX8HWz2d4Jx+FNj68qLtRG9Mmncty6AtKMw9Q=;
 b=VqJj/WaUzGsixb6FDhzNWblF0S3zUftiNg6cYudx7jR6TJx3ywgacXA3NrqVPoLVkS
 321YxgRQepkaorGEGYHhLWvbieh7QgTZ+hxxJrW8YLWZjdfcmS6v5WAITLcBJoD2PKAe
 uLaMCeOE19ZigrshER8jybXOpfvJHbPs+H784AwJ+hG9CB3PMV6vgt6KCtQoVKRcz/pv
 qV0FuZLU/2L/xGrSDU7/z5+n0OP4OuXCkpGVFsmrXYnG6syWIBQYEPHIFZuhB6kdw97O
 tZZMq6sJAcUCht8BL/xiU2psxbU6Pr0ZYUqeN4fiP1wj6ubJWw+dWGAQM2PzMUlhxiir
 Y9AQ==
X-Received: by 10.180.84.226 with SMTP id c2mr16124840wiz.50.1404215775273;
 Tue, 01 Jul 2014 04:56:15 -0700 (PDT)
Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net.
 [2001:470:1f08:1f7::2])
 by mx.google.com with ESMTPSA id nf11sm8729244wic.9.2014.07.01.04.56.14
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Tue, 01 Jul 2014 04:56:14 -0700 (PDT)
Date: Tue, 1 Jul 2014 13:56:12 +0200
From: Mateusz Guzik 
To: Konstantin Belousov 
Subject: Re: svn commit: r268087 - head/sys/kern
Message-ID: <20140701115612.GA26696@dft-labs.eu>
References: <201407010921.s619LXHL063077@svn.freebsd.org>
 <20140701114245.GO93733@kib.kiev.ua>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20140701114245.GO93733@kib.kiev.ua>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Mateusz Guzik 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 11:56:18 -0000

On Tue, Jul 01, 2014 at 02:42:45PM +0300, Konstantin Belousov wrote:
> Old code did the malloc(M_WAITOK) call in crget() before the text vnode
> was locked.  After your change, the crdup() is called with the vnode locked.
> Witness would not tell you that anything is wrong there, but the new
> code is worse than the previous structure, even if malloc() was sometimes
> done when not needed.
> 
> To satisfy the memory request from malloc(), pagedaemon or laundry may
> need to lock the vnode, which creates a circular dependency.  Pagedaemon
> locks vnodes with timeout, which just means that it would not be able
> to clean pages while execve() is stuck in malloc(M_WAITOK), while
> laundry takes the vnode lock without timeout, hanging until the malloc
> request is satisfied.
> 
> The rule is, do not allocate memory while vnodes are locked.  It is not
> always followed, but it makes no sense to change existing correct code
> to broke the pattern.

Right, my bad. This was intended to be a minor cleanup, I'm happy to
revert if you want.

Note that current code relocks the vnode already, so there should be no
harm doing the same in 'else' case. (Although LK_RETRY looks somewhat
fishy in here.)

That said I propose the following:
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index cce687b..9b3a99d 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -716,11 +716,11 @@ interpret:
 		VOP_UNLOCK(imgp->vp, 0);
 		setugidsafety(td);
 		error = fdcheckstd(td);
-		vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
 		if (error != 0)
 			goto done1;
 		newcred = crdup(oldcred);
 		euip = uifind(attr.va_uid);
+		vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
 		PROC_LOCK(p);
 		/*
 		 * Set the new credentials.
@@ -764,7 +764,9 @@ interpret:
 		if (oldcred->cr_svuid != oldcred->cr_uid ||
 		    oldcred->cr_svgid != oldcred->cr_gid) {
 			PROC_UNLOCK(p);
+			VOP_UNLOCK(imgp->vp, 0);
 			newcred = crdup(oldcred);
+			vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
 			PROC_LOCK(p);
 			change_svuid(newcred, newcred->cr_uid);
 			change_svgid(newcred, newcred->cr_gid);
@@ -841,6 +843,7 @@ interpret:
 
 	SDT_PROBE(proc, kernel, , exec__success, args->fname, 0, 0, 0, 0);
 
+	VOP_UNLOCK(imgp->vp, 0);
 done1:
 	/*
 	 * Free any resources malloc'd earlier that we didn't use.
@@ -849,7 +852,6 @@ done1:
 		uifree(euip);
 	if (newcred != NULL)
 		crfree(oldcred);
-	VOP_UNLOCK(imgp->vp, 0);
 
 	/*
 	 * Handle deferred decrement of ref counts.
-- 
Mateusz Guzik 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 12:31:03 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E88B42BF;
 Tue,  1 Jul 2014 12:31:03 +0000 (UTC)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8777E2AA4;
 Tue,  1 Jul 2014 12:31:03 +0000 (UTC)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s61CUwMO077600
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Tue, 1 Jul 2014 15:30:58 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s61CUwMO077600
Received: (from kostik@localhost)
 by tom.home (8.14.9/8.14.9/Submit) id s61CUwb1077599;
 Tue, 1 Jul 2014 15:30:58 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Tue, 1 Jul 2014 15:30:58 +0300
From: Konstantin Belousov 
To: Mateusz Guzik 
Subject: Re: svn commit: r268087 - head/sys/kern
Message-ID: <20140701123058.GP93733@kib.kiev.ua>
References: <201407010921.s619LXHL063077@svn.freebsd.org>
 <20140701114245.GO93733@kib.kiev.ua>
 <20140701115612.GA26696@dft-labs.eu>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="rK9cUJk4ANtwQkTL"
Content-Disposition: inline
In-Reply-To: <20140701115612.GA26696@dft-labs.eu>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 autolearn_force=no version=3.4.0
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Mateusz Guzik 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 12:31:04 -0000


--rK9cUJk4ANtwQkTL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Jul 01, 2014 at 01:56:12PM +0200, Mateusz Guzik wrote:
> On Tue, Jul 01, 2014 at 02:42:45PM +0300, Konstantin Belousov wrote:
> > Old code did the malloc(M_WAITOK) call in crget() before the text vnode
> > was locked.  After your change, the crdup() is called with the vnode lo=
cked.
> > Witness would not tell you that anything is wrong there, but the new
> > code is worse than the previous structure, even if malloc() was sometim=
es
> > done when not needed.
> >=20
> > To satisfy the memory request from malloc(), pagedaemon or laundry may
> > need to lock the vnode, which creates a circular dependency.  Pagedaemon
> > locks vnodes with timeout, which just means that it would not be able
> > to clean pages while execve() is stuck in malloc(M_WAITOK), while
> > laundry takes the vnode lock without timeout, hanging until the malloc
> > request is satisfied.
> >=20
> > The rule is, do not allocate memory while vnodes are locked.  It is not
> > always followed, but it makes no sense to change existing correct code
> > to broke the pattern.
>=20
> Right, my bad. This was intended to be a minor cleanup, I'm happy to
> revert if you want.
>=20
> Note that current code relocks the vnode already, so there should be no
> harm doing the same in 'else' case. (Although LK_RETRY looks somewhat
> fishy in here.)
>=20
> That said I propose the following:
> diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
> index cce687b..9b3a99d 100644
> --- a/sys/kern/kern_exec.c
> +++ b/sys/kern/kern_exec.c
> @@ -716,11 +716,11 @@ interpret:
>  		VOP_UNLOCK(imgp->vp, 0);
>  		setugidsafety(td);
>  		error =3D fdcheckstd(td);
> -		vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
>  		if (error !=3D 0)
>  			goto done1;
>  		newcred =3D crdup(oldcred);
>  		euip =3D uifind(attr.va_uid);
> +		vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
>  		PROC_LOCK(p);
>  		/*
>  		 * Set the new credentials.
This is definitely fine.

> @@ -764,7 +764,9 @@ interpret:
>  		if (oldcred->cr_svuid !=3D oldcred->cr_uid ||
>  		    oldcred->cr_svgid !=3D oldcred->cr_gid) {
>  			PROC_UNLOCK(p);
> +			VOP_UNLOCK(imgp->vp, 0);
>  			newcred =3D crdup(oldcred);
> +			vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
>  			PROC_LOCK(p);
>  			change_svuid(newcred, newcred->cr_uid);
>  			change_svgid(newcred, newcred->cr_gid);
Use of LK_RETRY is fine as far errors from  VOPs which actually perform
accesses to the vnode are checked.  It means that reclaimed vnode would
be detected later.

In fact, could the vnode unlock moved much earlier, in particular,
to avoid the same unlock/lock in the pmc hook call ?  The only use
for the vnode after the VREF() is done, as I see, is to check
for MNT_NOSUID.  Can we test this earlier, and cache the result ?
I do not think that the possible race with flag changing under us
matter.

> @@ -841,6 +843,7 @@ interpret:
> =20
>  	SDT_PROBE(proc, kernel, , exec__success, args->fname, 0, 0, 0, 0);
> =20
> +	VOP_UNLOCK(imgp->vp, 0);
>  done1:
>  	/*
>  	 * Free any resources malloc'd earlier that we didn't use.
This change is fine but unrelated.  There is no harm of calling free()
while holding vnode lock.

> @@ -849,7 +852,6 @@ done1:
>  		uifree(euip);
>  	if (newcred !=3D NULL)
>  		crfree(oldcred);
> -	VOP_UNLOCK(imgp->vp, 0);
> =20
>  	/*
>  	 * Handle deferred decrement of ref counts.
> --=20
> Mateusz Guzik 

--rK9cUJk4ANtwQkTL
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJTsqoCAAoJEJDCuSvBvK1B+xAP/0qnA6avxqIff/MDGGfJwUZz
ycHLv1oTdrz74llaIkqYri6coP+a7uywANU5+pfZBW0Vr+1qVrMAsAnOH8eUriQJ
3EhpQT0Flg70ctWQE8i/L6onrDSyamLUqPkTHLLITC9gSkR5APp3Qhbp5r11bbI7
nemko+8T83modpQPrdmQE3beBlhsRg+C/Is4iQMfct3xYuHmzBDpPYqegn3/HGFH
IPq8q5je+8vyyskGErRBh5E2R3BEKfllvQm9LRjcc8PeW4LKkfnDLjPD77JZThi0
Ag98Nzy6ME+cpdHHiFLiZ8dh2ckYjuGbj4nIt+A/7F07ayEuhzLHZLKD2s/WIOnD
EEJMPSxeXLIid7mv2JSsNXjnQWisoq0Myj8N8D0wEb4bs/WfuDyUKxn9zDfXXQ71
4l9xbGjszKxdg156SJiB1zGIuAgT+q85nr79ZcvfPo/o6xEondu/IzIqdtKJVcqo
9qQ5qkJcIHdVz2KGdTZKFnfl4dm+9v6WR+PnMiidKS31e/f8ksOK/x6mInZFk6cp
GGvzJVRuhFgzpftEYfRFauSqklLl7URIMRHZy/1ZdPmiSheYihVhKRZzUyzyZDQz
4My5/GTjfUOGZ9gonuBr7z2IW+wS54hFg8cp64j3psVMzhlWPX4m5ZlmdTpWkEro
OX8rSQQjc4lDrzVqfqQH
=8+zG
-----END PGP SIGNATURE-----

--rK9cUJk4ANtwQkTL--

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 12:40:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 74C0C876;
 Tue,  1 Jul 2014 12:40:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 625A82B13;
 Tue,  1 Jul 2014 12:40:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61Ce1V8053368;
 Tue, 1 Jul 2014 12:40:01 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61Ce1KC053366;
 Tue, 1 Jul 2014 12:40:01 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201407011240.s61Ce1KC053366@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Tue, 1 Jul 2014 12:40:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268089 - head/sys/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 12:40:01 -0000

Author: ae
Date: Tue Jul  1 12:40:00 2014
New Revision: 268089
URL: http://svnweb.freebsd.org/changeset/base/268089

Log:
  Linux uses its own UUID for data partitions.
  
  MFC after:	1 week

Modified:
  head/sys/sys/gpt.h

Modified: head/sys/sys/gpt.h
==============================================================================
--- head/sys/sys/gpt.h	Tue Jul  1 10:51:20 2014	(r268088)
+++ head/sys/sys/gpt.h	Tue Jul  1 12:40:00 2014	(r268089)
@@ -114,7 +114,8 @@ struct gpt_ent {
 #define	GPT_ENT_TYPE_MS_LDM_DATA	\
 	{0xaf9b60a0,0x1431,0x4f62,0xbc,0x68,{0x33,0x11,0x71,0x4a,0x69,0xad}}
 
-#define	GPT_ENT_TYPE_LINUX_DATA		GPT_ENT_TYPE_MS_BASIC_DATA
+#define	GPT_ENT_TYPE_LINUX_DATA		\
+	{0x0fc63daf,0x8483,0x4772,0x8e,0x79,{0x3d,0x69,0xd8,0x47,0x7d,0xe4}}
 #define	GPT_ENT_TYPE_LINUX_RAID		\
 	{0xa19d880f,0x05fc,0x4d3b,0xa0,0x06,{0x74,0x3f,0x0f,0x84,0x91,0x1e}}
 #define	GPT_ENT_TYPE_LINUX_SWAP		\

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 12:44:47 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id DB447380;
 Tue,  1 Jul 2014 12:44:47 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C68DF2C5D;
 Tue,  1 Jul 2014 12:44:47 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61CilNs057317;
 Tue, 1 Jul 2014 12:44:47 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61CilhB057316;
 Tue, 1 Jul 2014 12:44:47 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201407011244.s61CilhB057316@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Tue, 1 Jul 2014 12:44:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268090 - head/sbin/geom/class/part
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 12:44:47 -0000

Author: ae
Date: Tue Jul  1 12:44:47 2014
New Revision: 268090
URL: http://svnweb.freebsd.org/changeset/base/268090

Log:
  Document all aliases supported by GEOM_PART class.
  
  MFC after:	1 week

Modified:
  head/sbin/geom/class/part/gpart.8

Modified: head/sbin/geom/class/part/gpart.8
==============================================================================
--- head/sbin/geom/class/part/gpart.8	Tue Jul  1 12:40:00 2014	(r268089)
+++ head/sbin/geom/class/part/gpart.8	Tue Jul  1 12:44:47 2014	(r268090)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 11, 2014
+.Dd July 1, 2014
 .Dt GPART 8
 .Os
 .Sh NAME
@@ -550,8 +550,9 @@ The
 .Nm
 utility also allows the user to specify scheme-specific partition types
 for partition types that do not have symbolic names.
-Symbolic names currently understood are:
-.Bl -tag -width ".Cm ms-ldm-metadata"
+Symbolic names currently understood and used by
+.Fx are:
+.Bl -tag -width ".Cm dragonfly-disklabel64"
 .It Cm bios-boot
 The system partition dedicated to second stage of the boot loader program.
 Usually it is used by the GRUB 2 loader for GPT partitioning schemes.
@@ -563,16 +564,6 @@ Interface (EFI).
 In such cases, the GPT partitioning scheme is used and the
 actual partition type for the system partition can also be specified as
 .Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93b" .
-.It Cm fat16
-A partition that contains a FAT16 filesystem.
-The scheme-specific type is
-.Qq Li "!6"
-for MBR.
-.It Cm fat32
-A partition that contains a FAT32 filesystem.
-The scheme-specific type is
-.Qq Li "!11"
-for MBR.
 .It Cm freebsd
 A
 .Fx
@@ -631,6 +622,145 @@ The scheme-specific types are
 for APM,
 .Qq Li "!516e7cba-6ecf-11d6-8ff8-00022d09712b"
 for GPT, and 0x0904 for VTOC8.
+.El
+.Pp
+Another symbolic names that can be used with
+.Cm gpart
+utility are:
+.Bl -tag -width ".Cm dragonfly-disklabel64"
+.It Cm apple-boot
+An Apple Mac OS X partition dedicated to bootloader.
+The scheme-specific types are
+.Qq Li "!Apple_Bootstrap"
+for APM and
+.Qq Li "!426f6f74-0000-11aa-aa11-00306543ecac"
+for GPT.
+.It Cm apple-hfs
+An Apple Mac OS X partition that contains a HFS or HFS+ filesystem.
+The scheme-specific types are
+.Qq Li "!Apple_HFS"
+for APM and
+.Qq Li "!48465300-0000-11aa-aa11-00306543ecac"
+for GPT.
+.It Cm apple-label
+An Apple Mac OS X partition dedicated to partition metadata that descibes
+disk device.
+The scheme-specific type is
+.Qq Li "!4c616265-6c00-11aa-aa11-00306543ecac"
+for GPT.
+.It Cm apple-raid
+An Apple Mac OS X partition used in a software RAID configuration.
+The scheme-specific type is
+.Qq Li "!52414944-0000-11aa-aa11-00306543ecac"
+for GPT.
+.It Cm apple-raid-offline
+An Apple Mac OS X partition used in a software RAID configuration.
+The scheme-specific type is
+.Qq Li "!52414944-5f4f-11aa-aa11-00306543ecac"
+for GPT.
+.It Cm apple-tv-recovery
+An Apple Mac OS X partition used by Apple TV.
+The scheme-specific type is
+.Qq Li "!5265636f-7665-11aa-aa11-00306543ecac"
+for GPT.
+.It Cm apple-ufs
+An Apple Mac OS X partition that contains a UFS filesystem.
+The scheme-specific types are
+.Qq Li "!Apple_UNIX_SVR2"
+for APM and
+.Qq Li "!55465300-0000-11aa-aa11-00306543ecac"
+for GPT.
+.It Cm dragonfly-label32
+A DragonFlyBSD partition subdivided into filesystems with a
+.Bx
+disklabel.
+The scheme-specific type is
+.Qq Li "!9d087404-1ca5-11dc-8817-01301bb8a9f5"
+for GPT.
+.It Cm dragonfly-label64
+A DragonFlyBSD partition subdivided into filesystems with a
+disklabel64.
+The scheme-specific type is
+.Qq Li "!3d48ce54-1d16-11dc-8696-01301bb8a9f5"
+for GPT.
+.It Cm dragonfly-legacy
+A legacy partition type used in DragonFlyBSD.
+The scheme-specific type is
+.Qq Li "!bd215ab2-1d16-11dc-8696-01301bb8a9f5"
+for GPT.
+.It Cm dragonfly-ccd
+A DragonFlyBSD partition used with Concatenated Disk driver.
+The scheme-specific type is
+.Qq Li "!dbd5211b-1ca5-11dc-8817-01301bb8a9f5"
+for GPT.
+.It Cm dragonfly-hammer
+A DragonFlyBSD partition that contains a Hammer filesystem.
+The scheme-specific type is
+.Qq Li "!61dc63ac-6e38-11dc-8513-01301bb8a9f5"
+for GPT.
+.It Cm dragonfly-hammer2
+A DragonFlyBSD partition that contains a Hammer2 filesystem.
+The scheme-specific type is
+.Qq Li "!5cbb9ad1-862d-11dc-a94d-01301bb8a9f5"
+for GPT.
+.It Cm dragonfly-swap
+A DragonFlyBSD partition dedicated to swap space.
+The scheme-specific type is
+.Qq Li "!9d58fdbd-1ca5-11dc-8817-01301bb8a9f5"
+for GPT.
+.It Cm dragonfly-ufs
+A DragonFlyBSD partition that contains an UFS1 filesystem.
+The scheme-specific type is
+.Qq Li "!9d94ce7c-1ca5-11dc-8817-01301bb8a9f5"
+for GPT.
+.It Cm dragonfly-vinum
+A DragonFlyBSD partition used with Logical Volume Manager.
+The scheme-specific type is
+.Qq Li "!9dd4478f-1ca5-11dc-8817-01301bb8a9f5"
+for GPT.
+.It Cm ebr
+A partition subdivided into filesystems with a EBR.
+The scheme-specific type is
+.Qq Li "!5"
+for MBR.
+.It Cm fat16
+A partition that contains a FAT16 filesystem.
+The scheme-specific type is
+.Qq Li "!6"
+for MBR.
+.It Cm fat32
+A partition that contains a FAT32 filesystem.
+The scheme-specific type is
+.Qq Li "!11"
+for MBR.
+.It Cm linux-data
+A Linux partition that contains some filesystem with data.
+The scheme-specific types are
+.Qq Li "!131"
+for MBR and
+.Qq Li "!0fc63daf-8483-4772-8e79-3d69d8477de4"
+for GPT.
+.It Cm linux-lvm
+A Linux partition dedicated to Logical Volume Manager.
+The scheme-specific types are
+.Qq Li "!142"
+for MBR and
+.Qq Li "!e6d6d379-f507-44c2-a23c-238f2a3df928"
+for GPT.
+.It Cm linux-raid
+A Linux partition used in a software RAID configuration.
+The scheme-specific types are
+.Qq Li "!253"
+for MBR and
+.Qq Li "!a19d880f-05fc-4d3b-a006-743f0f84911e"
+for GPT.
+.It Cm linux-swap
+A Linux partition dedicated to swap space.
+The scheme-specific types are
+.Qq Li "!130"
+for MBR and
+.Qq Li "!0657fd6d-a4ab-43c4-84e5-0933c84b4f4f"
+for GPT.
 .It Cm mbr
 A partition that is sub-partitioned by a Master Boot Record (MBR).
 This type is known as
@@ -658,6 +788,36 @@ A partition that contains Logical Disk M
 The scheme-specific type is
 .Qq Li "!5808c8aa-7e8f-42e0-85d2-e1e90434cfb3"
 for GPT.
+.It Cm netbsd-ccd
+A NetBSD partition used with Concatenated Disk driver.
+The scheme-specific type is
+.Qq Li "!2db519c4-b10f-11dc-b99b-0019d1879648"
+for GPT.
+.It Cm netbsd-cgd
+An encrypted NetBSD partition.
+The scheme-specific type is
+.Qq Li "!2db519ec-b10f-11dc-b99b-0019d1879648"
+for GPT.
+.It Cm netbsd-ffs
+A NetBSD partition that contains an UFS filesystem.
+The scheme-specific type is
+.Qq Li "!49f48d5a-b10e-11dc-b99b-0019d1879648"
+for GPT.
+.It Cm netbsd-lfs
+A NetBSD partition that contains an LFS filesystem.
+The scheme-specific type is
+.Qq Li "!49f48d82-b10e-11dc-b99b-0019d1879648"
+for GPT.
+.It Cm netbsd-raid
+A NetBSD partition used in a software RAID configuration.
+The scheme-specific type is
+.Qq Li "!49f48daa-b10e-11dc-b99b-0019d1879648"
+for GPT.
+.It Cm netbsd-swap
+A NetBSD partition dedicated to swap space.
+The scheme-specific type is
+.Qq Li "!49f48d32-b10e-11dc-b99b-0019d1879648"
+for GPT.
 .It Cm ntfs
 A partition that contains a NTFS or exFAT filesystem.
 The scheme-specific type is

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 12:54:22 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id DA5DBDF8;
 Tue,  1 Jul 2014 12:54:21 +0000 (UTC)
Received: from mail-we0-x235.google.com (mail-we0-x235.google.com
 [IPv6:2a00:1450:400c:c03::235])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 5E1692DC2;
 Tue,  1 Jul 2014 12:54:20 +0000 (UTC)
Received: by mail-we0-f181.google.com with SMTP id q59so9578071wes.26
 for ; Tue, 01 Jul 2014 05:54:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=HU4JcN1pIld1QQEliNvgqOi7mseDYkPVZ0+hGBmddI0=;
 b=ehqDj2PBA+RawyNs220OB+kXxtLaO0fP43iAaypiw/SsKyDvuJc46b90QzGZeeHd7k
 aXRzh1MJNe8cCExc+WdY0+Efa8qNvQkoSMH7WL+TemzHHDQVWT7VcnZLKL6d2V5Spnhb
 8qo36gKyq0exSIC9nwn7iGhL7xOkAv22WBLRRrA79PvPWyP+7mtVZhfLkZxgTlKfMSE1
 mdLvWZ9OI3Tem4CntHnLSlSbO2koitmNO5n7AA84Zxgvd9mvS2iz4aeEdiWPcxRk0K+z
 +9LZzjO9JtuW5zpsM/eH6HHqd2GFVP6o1EGRE6j8WtwJGME5uGAmP0lczsAwP+RaVg+q
 2g8g==
X-Received: by 10.180.105.68 with SMTP id gk4mr35925804wib.24.1404219258587;
 Tue, 01 Jul 2014 05:54:18 -0700 (PDT)
Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net.
 [2001:470:1f08:1f7::2])
 by mx.google.com with ESMTPSA id i8sm43032397wiw.22.2014.07.01.05.54.17
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Tue, 01 Jul 2014 05:54:17 -0700 (PDT)
Date: Tue, 1 Jul 2014 14:54:10 +0200
From: Mateusz Guzik 
To: Konstantin Belousov 
Subject: Re: svn commit: r268087 - head/sys/kern
Message-ID: <20140701125410.GB26696@dft-labs.eu>
References: <201407010921.s619LXHL063077@svn.freebsd.org>
 <20140701114245.GO93733@kib.kiev.ua>
 <20140701115612.GA26696@dft-labs.eu>
 <20140701123058.GP93733@kib.kiev.ua>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20140701123058.GP93733@kib.kiev.ua>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Mateusz Guzik 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 12:54:22 -0000

On Tue, Jul 01, 2014 at 03:30:58PM +0300, Konstantin Belousov wrote:
> On Tue, Jul 01, 2014 at 01:56:12PM +0200, Mateusz Guzik wrote:
> > That said I propose the following:
> > diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
> > index cce687b..9b3a99d 100644
> > --- a/sys/kern/kern_exec.c
> > +++ b/sys/kern/kern_exec.c
> > @@ -716,11 +716,11 @@ interpret:
> >  		VOP_UNLOCK(imgp->vp, 0);
> >  		setugidsafety(td);
> >  		error = fdcheckstd(td);
> > -		vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
> >  		if (error != 0)
> >  			goto done1;
> >  		newcred = crdup(oldcred);
> >  		euip = uifind(attr.va_uid);
> > +		vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
> >  		PROC_LOCK(p);
> >  		/*
> >  		 * Set the new credentials.
> This is definitely fine.
> 
> > @@ -764,7 +764,9 @@ interpret:
> >  		if (oldcred->cr_svuid != oldcred->cr_uid ||
> >  		    oldcred->cr_svgid != oldcred->cr_gid) {
> >  			PROC_UNLOCK(p);
> > +			VOP_UNLOCK(imgp->vp, 0);
> >  			newcred = crdup(oldcred);
> > +			vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
> >  			PROC_LOCK(p);
> >  			change_svuid(newcred, newcred->cr_uid);
> >  			change_svgid(newcred, newcred->cr_gid);
> Use of LK_RETRY is fine as far errors from  VOPs which actually perform
> accesses to the vnode are checked.  It means that reclaimed vnode would
> be detected later.
> 
> In fact, could the vnode unlock moved much earlier, in particular,
> to avoid the same unlock/lock in the pmc hook call ?  The only use
> for the vnode after the VREF() is done, as I see, is to check
> for MNT_NOSUID.  Can we test this earlier, and cache the result ?
> I do not think that the possible race with flag changing under us
> matter.
> 

It is passed down to MAC (mac_vnode_execve_will_transition and
mac_vnode_execve_transition) and then vfs_mark_atime.

I don't see how to easily reorganize the code to simplify stuff and
reduce relocking.

> > @@ -841,6 +843,7 @@ interpret:
> >  
> >  	SDT_PROBE(proc, kernel, , exec__success, args->fname, 0, 0, 0, 0);
> >  
> > +	VOP_UNLOCK(imgp->vp, 0);
> >  done1:
> >  	/*
> >  	 * Free any resources malloc'd earlier that we didn't use.
> This change is fine but unrelated.  There is no harm of calling free()
> while holding vnode lock.
> 

I moved this unlock so that there is no need to lock the vnode after
failed fdcheckstd, which would also require additional cleanup for
newcred and euip.

-- 
Mateusz Guzik 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 13:59:46 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E182DF07;
 Tue,  1 Jul 2014 13:59:46 +0000 (UTC)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BADD52405;
 Tue,  1 Jul 2014 13:59:46 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 49A15B91C;
 Tue,  1 Jul 2014 09:59:45 -0400 (EDT)
From: John Baldwin 
To: Mateusz Guzik 
Subject: Re: svn commit: r268074 - head/sys/kern
Date: Tue, 1 Jul 2014 09:40:57 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; )
References: <201407010629.s616TFul082441@svn.freebsd.org>
In-Reply-To: <201407010629.s616TFul082441@svn.freebsd.org>
MIME-Version: 1.0
Message-Id: <201407010940.57602.jhb@freebsd.org>
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Tue, 01 Jul 2014 09:59:45 -0400 (EDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 13:59:47 -0000

On Tuesday, July 01, 2014 2:29:15 am Mateusz Guzik wrote:
> Author: mjg
> Date: Tue Jul  1 06:29:15 2014
> New Revision: 268074
> URL: http://svnweb.freebsd.org/changeset/base/268074
> 
> Log:
>   Perform a lockless check in sigacts_shared.
>   
>   It is used only during execve (i.e. singlethreaded), so there is no fear
>   of returning 'not shared' which soon becomes 'shared'.
>   
>   While here reorganize the code a little to avoid proc lock/unlock in
>   shared case.
>   
>   MFC after:	1 week
> 
> Modified:
>   head/sys/kern/kern_exec.c
>   head/sys/kern/kern_sig.c
> 
> Modified: head/sys/kern/kern_exec.c
> 
==============================================================================
> --- head/sys/kern/kern_exec.c	Tue Jul  1 06:23:48 2014	(r268073)
> +++ head/sys/kern/kern_exec.c	Tue Jul  1 06:29:15 2014	(r268074)
> @@ -621,18 +621,17 @@ interpret:
>  	 * handlers. In execsigs(), the new process will have its signals
>  	 * reset.
>  	 */
> -	PROC_LOCK(p);
> -	oldcred = crcopysafe(p, newcred);
>  	if (sigacts_shared(p->p_sigacts)) {
>  		oldsigacts = p->p_sigacts;
> -		PROC_UNLOCK(p);
>  		newsigacts = sigacts_alloc();
>  		sigacts_copy(newsigacts, oldsigacts);
> -		PROC_LOCK(p);
> -		p->p_sigacts = newsigacts;
>  	} else
>  		oldsigacts = NULL;
>  
> +	PROC_LOCK(p);
> +	if (oldsigacts)
> +		p->p_sigacts = newsigacts;
> +	oldcred = crcopysafe(p, newcred);
>  	/* Stop profiling */
>  	stopprofclock(p);
>  
> 
> Modified: head/sys/kern/kern_sig.c
> 
==============================================================================
> --- head/sys/kern/kern_sig.c	Tue Jul  1 06:23:48 2014	(r268073)
> +++ head/sys/kern/kern_sig.c	Tue Jul  1 06:29:15 2014	(r268074)
> @@ -3453,10 +3453,6 @@ sigacts_copy(struct sigacts *dest, struc
>  int
>  sigacts_shared(struct sigacts *ps)
>  {
> -	int shared;
>  
> -	mtx_lock(&ps->ps_mtx);
> -	shared = ps->ps_refcnt > 1;
> -	mtx_unlock(&ps->ps_mtx);
> -	return (shared);
> +	return (ps->ps_refcnt > 1);
>  }

You should KASSERT() in sigacts_shared that P_HADTHREADS is not set so that 
new code does not call this function unsafely in the future.

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 14:07:29 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id BE5F025C;
 Tue,  1 Jul 2014 14:07:29 +0000 (UTC)
Received: from mail-qa0-x232.google.com (mail-qa0-x232.google.com
 [IPv6:2607:f8b0:400d:c00::232])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 4D75024C7;
 Tue,  1 Jul 2014 14:07:29 +0000 (UTC)
Received: by mail-qa0-f50.google.com with SMTP id m5so7594881qaj.37
 for ; Tue, 01 Jul 2014 07:07:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date:message-id:subject
 :from:to:cc:content-type;
 bh=LfodGPLjIITZ9KOlvgrNbkD63oqS4gYgvdvAgkHinMg=;
 b=mDnP+2dqwhdcqoNOkcSOk5pdOTAQAQZEGMXWE/h6ixbR4EXEVNKGw5kkxerXAhkBkM
 CKS7fMESv8pgVAhc9qxeaal8jFVnC0tGEk4Oe5q6sAzAmj/u4M09yFan8jx6N9y/CRSy
 b2/E6UnKky7jah0aPA3JQxWoLt6Rd5Xca5pOJ0sSvlcMhPsHLgkwjMwSMwBXF3i0FrtW
 znLhF5oSddAGM5Mm3Twe+ABzl9++lTkK8Lb1OqFDAV9kKgZ2rCxc+GAh9A/Q8Dawm8Oh
 /IaLd7PB2NofPT8QONNhL1D8xGIi0+ku/lD2HhID4su7olAH8CMZrWsxBC06ZR0Ff+iL
 uBDw==
MIME-Version: 1.0
X-Received: by 10.224.167.70 with SMTP id p6mr62166557qay.48.1404223648510;
 Tue, 01 Jul 2014 07:07:28 -0700 (PDT)
Sender: mdf356@gmail.com
Received: by 10.229.245.5 with HTTP; Tue, 1 Jul 2014 07:07:28 -0700 (PDT)
In-Reply-To: <201407010921.s619LXHL063077@svn.freebsd.org>
References: <201407010921.s619LXHL063077@svn.freebsd.org>
Date: Tue, 1 Jul 2014 07:07:28 -0700
X-Google-Sender-Auth: oZ_Jbdvt3CPnkuG0Lz6GMLe2TeU
Message-ID: 
Subject: Re: svn commit: r268087 - head/sys/kern
From: Matthew Fleming 
To: Mateusz Guzik 
Content-Type: text/plain; charset=UTF-8
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 14:07:29 -0000

On Tue, Jul 1, 2014 at 2:21 AM, Mateusz Guzik  wrote:
> Author: mjg
> Date: Tue Jul  1 09:21:32 2014
> New Revision: 268087
> URL: http://svnweb.freebsd.org/changeset/base/268087
>
> Log:
>   Don't call crcopysafe or uifind unnecessarily in execve.

I'm not sure the code works.

It gets a copy of the pointer p_ucred under the PROC_LOCK.  The
PROC_LOCK is released before newcred = crdup(oldcred) is called.  Thus
you may be copying an old version of the credentials if any of the
other functions that modify them run in the meantime.

Maybe this can't happen because the process is single-threaded at the
time and all the other sets of p_ucred come via a syscall.  I didn't
look at all the functions in the kernel which set p_ucred.  But only
in the case that none of them can run during do_execve this code would
be safe.  In which case it at least deserves a comment indicating the
code is violating the normal locking and safety on p_ucred.

There's no assert in the do_execve() code, but kern_execve() will
force single-threaded before calling do_execve().

Also, what is the motivation to avoid the crcopy?  Is there a
measurable performance impact?

Thanks,
matthew

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 14:19:26 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9DB8999E;
 Tue,  1 Jul 2014 14:19:26 +0000 (UTC)
Received: from mail-wi0-x22d.google.com (mail-wi0-x22d.google.com
 [IPv6:2a00:1450:400c:c05::22d])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 9793E25E8;
 Tue,  1 Jul 2014 14:19:25 +0000 (UTC)
Received: by mail-wi0-f173.google.com with SMTP id cc10so7927542wib.12
 for ; Tue, 01 Jul 2014 07:19:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=a2OnOAXlbOgnin1spTNsTbSVIBqzS88oss5wG5mwBOg=;
 b=WApoEy2Ymup/ovXIGBoXNvQprk3YDd9uv8NywWm5Mxntk/Ll8szEb4OK08xty9TYC1
 QNjOGI53nc75fgdN5u/OHde/spHdUZkZ3QZfFnV2hwLN8YVbIenkSnNtMEEMoqsF+4/+
 Jj9iAl8r8MmuQvJ077SpJgfyP2weni0R36Th5TjXHNpKVu6McsPitdfOsYzR7fBn0lkx
 PTfTn7yvkS7KRG0Dvazy6p6wAieI8uWpyFu+W70+OXbNA/ve0FY9PLVu8L/4iLq1jbtb
 ET3qPl3cFNx0TOZuOiV38XBo10KreQKdQxmtsCOAf2jMgBn9xtqkGNZUa6kVeOfG348Z
 6izg==
X-Received: by 10.180.82.7 with SMTP id e7mr36612259wiy.74.1404224363695;
 Tue, 01 Jul 2014 07:19:23 -0700 (PDT)
Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net.
 [2001:470:1f08:1f7::2])
 by mx.google.com with ESMTPSA id eo4sm43837601wid.4.2014.07.01.07.19.22
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Tue, 01 Jul 2014 07:19:23 -0700 (PDT)
Date: Tue, 1 Jul 2014 16:19:20 +0200
From: Mateusz Guzik 
To: John Baldwin 
Subject: Re: svn commit: r268074 - head/sys/kern
Message-ID: <20140701141920.GC26696@dft-labs.eu>
References: <201407010629.s616TFul082441@svn.freebsd.org>
 <201407010940.57602.jhb@freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <201407010940.57602.jhb@freebsd.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Mateusz Guzik 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 14:19:26 -0000

On Tue, Jul 01, 2014 at 09:40:57AM -0400, John Baldwin wrote:
> On Tuesday, July 01, 2014 2:29:15 am Mateusz Guzik wrote:
> > Modified: head/sys/kern/kern_sig.c
> > 
> ==============================================================================
> > --- head/sys/kern/kern_sig.c	Tue Jul  1 06:23:48 2014	(r268073)
> > +++ head/sys/kern/kern_sig.c	Tue Jul  1 06:29:15 2014	(r268074)
> > @@ -3453,10 +3453,6 @@ sigacts_copy(struct sigacts *dest, struc
> >  int
> >  sigacts_shared(struct sigacts *ps)
> >  {
> > -	int shared;
> >  
> > -	mtx_lock(&ps->ps_mtx);
> > -	shared = ps->ps_refcnt > 1;
> > -	mtx_unlock(&ps->ps_mtx);
> > -	return (shared);
> > +	return (ps->ps_refcnt > 1);
> >  }
> 
> You should KASSERT() in sigacts_shared that P_HADTHREADS is not set so that 
> new code does not call this function unsafely in the future.
> 

Looks more like !P_HADTHREADS || p->p_singlethread != NULL on the first
sight, but yeah, I'll add an assertion.

Thanks,
-- 
Mateusz Guzik 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 14:32:53 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8E45029E;
 Tue,  1 Jul 2014 14:32:53 +0000 (UTC)
Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com
 [IPv6:2a00:1450:400c:c05::22e])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 88D6D2775;
 Tue,  1 Jul 2014 14:32:52 +0000 (UTC)
Received: by mail-wi0-f174.google.com with SMTP id bs8so7966393wib.1
 for ; Tue, 01 Jul 2014 07:32:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=ugZvKhvdiQmQXqbtfmLWeEKe9eGUOMEx4Mw0EOWWNuc=;
 b=uSk5aKpnYMkRnm6h26O/eHv9FO5NNoJUVqMGWdqnsRaXtvcXpuiwetI7W/UXLph5Cp
 OumbBFlTo6cA7WTcFPfMYlDyBSeLOjJyri+T/HD79BMRk+2dQATNK9pGslXCsWUKquh/
 DtdA//BMSSKZnx6UKuYcbm8pWQbddj8Km50BFu3og8nHjw3fb+VLWKLvreVGduGvEVpT
 Mt5SETi2/fybTnGPPzsUfjAdlvbr+whn73qM9didpWR89EBU563AmpL6qkGgYQSFIvp6
 Gozpg7nvhM8fYf605k6VYgTvLBcwetdXsM1awZHMgVtPyZCYO2tncMofvP+5Loil4Sou
 OvUQ==
X-Received: by 10.194.200.37 with SMTP id jp5mr3539535wjc.120.1404225167099;
 Tue, 01 Jul 2014 07:32:47 -0700 (PDT)
Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net.
 [2001:470:1f08:1f7::2])
 by mx.google.com with ESMTPSA id wp6sm48547088wjb.9.2014.07.01.07.32.45
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Tue, 01 Jul 2014 07:32:46 -0700 (PDT)
Date: Tue, 1 Jul 2014 16:32:38 +0200
From: Mateusz Guzik 
To: Matthew Fleming 
Subject: Re: svn commit: r268087 - head/sys/kern
Message-ID: <20140701143238.GD26696@dft-labs.eu>
References: <201407010921.s619LXHL063077@svn.freebsd.org>
 
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: 
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" ,
 Mateusz Guzik 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 14:32:53 -0000

On Tue, Jul 01, 2014 at 07:07:28AM -0700, Matthew Fleming wrote:
> On Tue, Jul 1, 2014 at 2:21 AM, Mateusz Guzik  wrote:
> > Author: mjg
> > Date: Tue Jul  1 09:21:32 2014
> > New Revision: 268087
> > URL: http://svnweb.freebsd.org/changeset/base/268087
> >
> > Log:
> >   Don't call crcopysafe or uifind unnecessarily in execve.
> 
> I'm not sure the code works.
> 
> It gets a copy of the pointer p_ucred under the PROC_LOCK.  The
> PROC_LOCK is released before newcred = crdup(oldcred) is called.  Thus
> you may be copying an old version of the credentials if any of the
> other functions that modify them run in the meantime.
> 
> Maybe this can't happen because the process is single-threaded at the
> time and all the other sets of p_ucred come via a syscall.  I didn't
> look at all the functions in the kernel which set p_ucred.  But only
> in the case that none of them can run during do_execve this code would
> be safe.  In which case it at least deserves a comment indicating the
> code is violating the normal locking and safety on p_ucred.
> 

All other threads have to be blocked, otherwise there are more dangerous
races - for instance we support sharing file descriptor tables, so
execve makes sure to unshare the table (fdunshare()), which is
especially important for suid binaries. If other threads could execute,
they could fork off after fdunshare() and then have a table shared with
now privileged process.

That said, I can add appropriate comment + assertion at top of do_execve
later, just wanted to note the code was assuming that the process is left
alone prior to my changes.

> Also, what is the motivation to avoid the crcopy?  Is there a
> measurable performance impact?
> 

It's just a minor cleanup.

-- 
Mateusz Guzik 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 14:33:49 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2BB393EC;
 Tue,  1 Jul 2014 14:33:49 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id F34692781;
 Tue,  1 Jul 2014 14:33:48 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61EXm1M010600;
 Tue, 1 Jul 2014 14:33:48 GMT (envelope-from loos@svn.freebsd.org)
Received: (from loos@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61EXmO7010598;
 Tue, 1 Jul 2014 14:33:48 GMT (envelope-from loos@svn.freebsd.org)
Message-Id: <201407011433.s61EXmO7010598@svn.freebsd.org>
From: Luiz Otavio O Souza 
Date: Tue, 1 Jul 2014 14:33:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268093 - head/sys/dev/etherswitch/rtl8366
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 14:33:49 -0000

Author: loos
Date: Tue Jul  1 14:33:48 2014
New Revision: 268093
URL: http://svnweb.freebsd.org/changeset/base/268093

Log:
  Add the CPU port flag to the CPU port on rtl8366 (port 5).
  
  Do not allow any media change on the switch CPU port.
  
  Tested on TP-Link WR1043ND.

Modified:
  head/sys/dev/etherswitch/rtl8366/rtl8366rb.c
  head/sys/dev/etherswitch/rtl8366/rtl8366rbvar.h

Modified: head/sys/dev/etherswitch/rtl8366/rtl8366rb.c
==============================================================================
--- head/sys/dev/etherswitch/rtl8366/rtl8366rb.c	Tue Jul  1 14:12:59 2014	(r268092)
+++ head/sys/dev/etherswitch/rtl8366/rtl8366rb.c	Tue Jul  1 14:33:48 2014	(r268093)
@@ -570,6 +570,7 @@ rtl_getport(device_t dev, etherswitch_po
 			return (err);
 	} else {
 		/* fill in fixed values for CPU port */
+		p->es_flags |= ETHERSWITCH_PORT_CPU;
 		ifmr->ifm_count = 0;
 		smi_read(dev, RTL8366RB_PLSR_BASE + (RTL8366RB_NUM_PHYS)/2, &v, RTL_WAITOK);
 		v = v >> (8 * ((RTL8366RB_NUM_PHYS) % 2));
@@ -606,6 +607,8 @@ rtl_setport(device_t dev, etherswitch_po
 		RTL8366RB_PVCR_VAL(p->es_port, vlangroup), RTL_WAITOK);
 	if (err)
 		return (err);
+	if (p->es_port == RTL8366RB_CPU_PORT)
+		return (0);
 	mii = device_get_softc(sc->miibus[p->es_port]);
 	ifm = &mii->mii_media;
 	err = ifmedia_ioctl(sc->ifp[p->es_port], &p->es_ifr, ifm, SIOCSIFMEDIA);

Modified: head/sys/dev/etherswitch/rtl8366/rtl8366rbvar.h
==============================================================================
--- head/sys/dev/etherswitch/rtl8366/rtl8366rbvar.h	Tue Jul  1 14:12:59 2014	(r268092)
+++ head/sys/dev/etherswitch/rtl8366/rtl8366rbvar.h	Tue Jul  1 14:33:48 2014	(r268093)
@@ -168,9 +168,10 @@
 	(RTL8366RB_PACR | (1 << (((phy) & 0x1f) + 9)) | (((page) & 0xf) << 5) | ((reg) & 0x1f))
 
 /* general characteristics of the chip */
-#define RTL8366RB_NUM_PORTS			6
-#define RTL8366RB_NUM_PHYS			(RTL8366RB_NUM_PORTS-1)
-#define RTL8366RB_NUM_VLANS			16
-#define RTL8366RB_NUM_PHY_REG			32
+#define	RTL8366RB_CPU_PORT			5
+#define	RTL8366RB_NUM_PORTS			6
+#define	RTL8366RB_NUM_PHYS			(RTL8366RB_NUM_PORTS-1)
+#define	RTL8366RB_NUM_VLANS			16
+#define	RTL8366RB_NUM_PHY_REG			32
 
 #endif

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 14:49:47 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0226CE8B;
 Tue,  1 Jul 2014 14:49:47 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E3C8128E3;
 Tue,  1 Jul 2014 14:49:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61EnkGo016542;
 Tue, 1 Jul 2014 14:49:46 GMT (envelope-from loos@svn.freebsd.org)
Received: (from loos@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61EnkDX016540;
 Tue, 1 Jul 2014 14:49:46 GMT (envelope-from loos@svn.freebsd.org)
Message-Id: <201407011449.s61EnkDX016540@svn.freebsd.org>
From: Luiz Otavio O Souza 
Date: Tue, 1 Jul 2014 14:49:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268094 - head/sys/dev/etherswitch/rtl8366
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 14:49:47 -0000

Author: loos
Date: Tue Jul  1 14:49:46 2014
New Revision: 268094
URL: http://svnweb.freebsd.org/changeset/base/268094

Log:
  Fix the reported status for the switch CPU port which was (wrongly)
  reporting half-duplex link.
  
  Tested on TP-Link WR1043ND.

Modified:
  head/sys/dev/etherswitch/rtl8366/rtl8366rb.c
  head/sys/dev/etherswitch/rtl8366/rtl8366rbvar.h

Modified: head/sys/dev/etherswitch/rtl8366/rtl8366rb.c
==============================================================================
--- head/sys/dev/etherswitch/rtl8366/rtl8366rb.c	Tue Jul  1 14:33:48 2014	(r268093)
+++ head/sys/dev/etherswitch/rtl8366/rtl8366rb.c	Tue Jul  1 14:49:46 2014	(r268094)
@@ -268,7 +268,7 @@ rtl8366rb_update_ifmedia(int portstatus,
 		*media_active |= IFM_1000_T;
 		break;
 	}
-	if ((portstatus & RTL8366RB_PLSR_FULLDUPLEX) == 0)
+	if ((portstatus & RTL8366RB_PLSR_FULLDUPLEX) != 0)
 		*media_active |= IFM_FDX;
 	else
 		*media_active |= IFM_HDX;

Modified: head/sys/dev/etherswitch/rtl8366/rtl8366rbvar.h
==============================================================================
--- head/sys/dev/etherswitch/rtl8366/rtl8366rbvar.h	Tue Jul  1 14:33:48 2014	(r268093)
+++ head/sys/dev/etherswitch/rtl8366/rtl8366rbvar.h	Tue Jul  1 14:49:46 2014	(r268094)
@@ -70,7 +70,7 @@
 #define RTL8366RB_PLSR_SPEED_10		0x00
 #define RTL8366RB_PLSR_SPEED_100	0x01
 #define RTL8366RB_PLSR_SPEED_1000	0x02
-#define RTL8366RB_PLSR_FULLDUPLEX	0x08
+#define RTL8366RB_PLSR_FULLDUPLEX	0x04
 #define RTL8366RB_PLSR_LINK		0x10
 #define RTL8366RB_PLSR_TXPAUSE		0x20
 #define RTL8366RB_PLSR_RXPAUSE		0x40

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 14:54:34 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 991B3265;
 Tue,  1 Jul 2014 14:54:34 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 86B2D29AB;
 Tue,  1 Jul 2014 14:54:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61EsYAq020421;
 Tue, 1 Jul 2014 14:54:34 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61EsYSc020420;
 Tue, 1 Jul 2014 14:54:34 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201407011454.s61EsYSc020420@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 1 Jul 2014 14:54:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268095 - head/sys/dev/ata/chipsets
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 14:54:34 -0000

Author: marius
Date: Tue Jul  1 14:54:34 2014
New Revision: 268095
URL: http://svnweb.freebsd.org/changeset/base/268095

Log:
  Actually pro AMD chipsets.
  
  MFC after:	3 days
  Sponsored by:	Bally Wulff Games & Entertainment GmbH

Modified:
  head/sys/dev/ata/chipsets/ata-ati.c

Modified: head/sys/dev/ata/chipsets/ata-ati.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-ati.c	Tue Jul  1 14:49:46 2014	(r268094)
+++ head/sys/dev/ata/chipsets/ata-ati.c	Tue Jul  1 14:54:34 2014	(r268095)
@@ -98,7 +98,7 @@ ata_ati_probe(device_t dev)
      { ATA_AMD_HUDSON2_S5,  0x00, ATI_AHCI, 0, ATA_SA300, "Hudson-2" },
      { 0, 0, 0, 0, 0, 0}};
 
-    if (pci_get_vendor(dev) != ATA_ATI_ID)
+    if (pci_get_vendor(dev) != ATA_AMD_ID && pci_get_vendor(dev) != ATA_ATI_ID)
 	return ENXIO;
 
     if (!(ctlr->chip = ata_match_chip(dev, ids)))

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 15:05:24 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 25B9780F;
 Tue,  1 Jul 2014 15:05:24 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1297E2ABA;
 Tue,  1 Jul 2014 15:05:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61F5OrZ025684;
 Tue, 1 Jul 2014 15:05:24 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61F5O6G025682;
 Tue, 1 Jul 2014 15:05:24 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407011505.s61F5O6G025682@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 1 Jul 2014 15:05:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268096 - in head/sys/cam: ctl scsi
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 15:05:24 -0000

Author: mav
Date: Tue Jul  1 15:05:23 2014
New Revision: 268096
URL: http://svnweb.freebsd.org/changeset/base/268096

Log:
  Add more formal and strict command parsing and validation.
  
  For every supported command define CDB length and mask of bits that are
  allowed to be set.  This allows to remove bunch of checks through the code
  and still make the validation more strict.  To properly do it for commands
  supporting multiple service actions, formalize their parsing by adding
  subtables for each of such commands.
  
  As visible effect, this change allows to add support for REPORT SUPPORTED
  OPERATION CODES command, reporting to client all the data about supported
  SCSI commands, except timeouts.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_cmd_table.c
  head/sys/cam/ctl/ctl_private.h
  head/sys/cam/scsi/scsi_all.h

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Tue Jul  1 14:54:34 2014	(r268095)
+++ head/sys/cam/ctl/ctl.c	Tue Jul  1 15:05:23 2014	(r268096)
@@ -390,7 +390,7 @@ static ctl_action ctl_check_ooa(struct c
 static int ctl_check_blocked(struct ctl_lun *lun);
 static int ctl_scsiio_lun_check(struct ctl_softc *ctl_softc,
 				struct ctl_lun *lun,
-				struct ctl_cmd_entry *entry,
+				const struct ctl_cmd_entry *entry,
 				struct ctl_scsiio *ctsio);
 //static int ctl_check_rtr(union ctl_io *pending_io, struct ctl_softc *softc);
 static void ctl_failover(void);
@@ -428,6 +428,12 @@ static void ctl_enqueue_incoming(union c
 static void ctl_enqueue_rtr(union ctl_io *io);
 static void ctl_enqueue_done(union ctl_io *io);
 static void ctl_enqueue_isc(union ctl_io *io);
+static const struct ctl_cmd_entry *
+    ctl_get_cmd_entry(struct ctl_scsiio *ctsio);
+static const struct ctl_cmd_entry *
+    ctl_validate_command(struct ctl_scsiio *ctsio);
+static int ctl_cmd_applicable(uint8_t lun_type,
+    const struct ctl_cmd_entry *entry);
 
 /*
  * Load the serialization table.  This isn't very pretty, but is probably
@@ -619,11 +625,9 @@ ctl_isc_event_handler(ctl_ha_channel cha
 			memcpy(io->scsiio.cdb, msg_info.scsi.cdb,
 			       CTL_MAX_CDBLEN);
 			if (ctl_softc->ha_mode == CTL_HA_MODE_XFER) {
-				struct ctl_cmd_entry *entry;
-				uint8_t opcode;
+				const struct ctl_cmd_entry *entry;
 
-				opcode = io->scsiio.cdb[0];
-				entry = &ctl_cmd_table[opcode];
+				entry = ctl_get_cmd_entry(&io->scsiio);
 				io->io_hdr.flags &= ~CTL_FLAG_DATA_MASK;
 				io->io_hdr.flags |=
 					entry->flags & CTL_FLAG_DATA_MASK;
@@ -4969,50 +4973,11 @@ ctl_scsi_release(struct ctl_scsiio *ctsi
 	ctl_softc = control_softc;
 
 	switch (ctsio->cdb[0]) {
-	case RELEASE: {
-		struct scsi_release *cdb;
-
-		cdb = (struct scsi_release *)ctsio->cdb;
-		if ((cdb->byte2 & 0x1f) != 0) {
-			ctl_set_invalid_field(ctsio,
-					      /*sks_valid*/ 1,
-					      /*command*/ 1,
-					      /*field*/ 1,
-					      /*bit_valid*/ 0,
-					      /*bit*/ 0);
-			ctl_done((union ctl_io *)ctsio);
-			return (CTL_RETVAL_COMPLETE);
-		}
-		break;
-	}
 	case RELEASE_10: {
 		struct scsi_release_10 *cdb;
 
 		cdb = (struct scsi_release_10 *)ctsio->cdb;
 
-		if ((cdb->byte2 & SR10_EXTENT) != 0) {
-			ctl_set_invalid_field(ctsio,
-					      /*sks_valid*/ 1,
-					      /*command*/ 1,
-					      /*field*/ 1,
-					      /*bit_valid*/ 1,
-					      /*bit*/ 0);
-			ctl_done((union ctl_io *)ctsio);
-			return (CTL_RETVAL_COMPLETE);
-
-		}
-
-		if ((cdb->byte2 & SR10_3RDPTY) != 0) {
-			ctl_set_invalid_field(ctsio,
-					      /*sks_valid*/ 1,
-					      /*command*/ 1,
-					      /*field*/ 1,
-					      /*bit_valid*/ 1,
-					      /*bit*/ 4);
-			ctl_done((union ctl_io *)ctsio);
-			return (CTL_RETVAL_COMPLETE);
-		}
-
 		if (cdb->byte2 & SR10_LONGID)
 			longid = 1;
 		else
@@ -5106,49 +5071,11 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi
 	ctl_softc = control_softc;
 
 	switch (ctsio->cdb[0]) {
-	case RESERVE: {
-		struct scsi_reserve *cdb;
-
-		cdb = (struct scsi_reserve *)ctsio->cdb;
-		if ((cdb->byte2 & 0x1f) != 0) {
-			ctl_set_invalid_field(ctsio,
-					      /*sks_valid*/ 1,
-					      /*command*/ 1,
-					      /*field*/ 1,
-					      /*bit_valid*/ 0,
-					      /*bit*/ 0);
-			ctl_done((union ctl_io *)ctsio);
-			return (CTL_RETVAL_COMPLETE);
-		}
-		resv_id = cdb->resv_id;
-		length = scsi_2btoul(cdb->length);
-		break;
-	}
 	case RESERVE_10: {
 		struct scsi_reserve_10 *cdb;
 
 		cdb = (struct scsi_reserve_10 *)ctsio->cdb;
 
-		if ((cdb->byte2 & SR10_EXTENT) != 0) {
-			ctl_set_invalid_field(ctsio,
-					      /*sks_valid*/ 1,
-					      /*command*/ 1,
-					      /*field*/ 1,
-					      /*bit_valid*/ 1,
-					      /*bit*/ 0);
-			ctl_done((union ctl_io *)ctsio);
-			return (CTL_RETVAL_COMPLETE);
-		}
-		if ((cdb->byte2 & SR10_3RDPTY) != 0) {
-			ctl_set_invalid_field(ctsio,
-					      /*sks_valid*/ 1,
-					      /*command*/ 1,
-					      /*field*/ 1,
-					      /*bit_valid*/ 1,
-					      /*bit*/ 4);
-			ctl_done((union ctl_io *)ctsio);
-			return (CTL_RETVAL_COMPLETE);
-		}
 		if (cdb->byte2 & SR10_LONGID)
 			longid = 1;
 		else
@@ -5261,35 +5188,6 @@ ctl_start_stop(struct ctl_scsiio *ctsio)
 		return (CTL_RETVAL_COMPLETE);
 	}
 
-	/*
-	 * We don't support the power conditions field.  We need to check
-	 * this prior to checking the load/eject and start/stop bits.
-	 */
-	if ((cdb->how & SSS_PC_MASK) != SSS_PC_START_VALID) {
-		ctl_set_invalid_field(ctsio,
-				      /*sks_valid*/ 1,
-				      /*command*/ 1,
-				      /*field*/ 4,
-				      /*bit_valid*/ 1,
-				      /*bit*/ 4);
-		ctl_done((union ctl_io *)ctsio);
-		return (CTL_RETVAL_COMPLETE);
-	}
-
-	/*
-	 * Media isn't removable, so we can't load or eject it.
-	 */
-	if ((cdb->how & SSS_LOEJ) != 0) {
-		ctl_set_invalid_field(ctsio,
-				      /*sks_valid*/ 1,
-				      /*command*/ 1,
-				      /*field*/ 4,
-				      /*bit_valid*/ 1,
-				      /*bit*/ 1);
-		ctl_done((union ctl_io *)ctsio);
-		return (CTL_RETVAL_COMPLETE);
-	}
-
 	if ((lun->flags & CTL_LUN_PR_RESERVED)
 	 && ((cdb->how & SSS_START)==0)) {
 		uint32_t residx;
@@ -5387,7 +5285,6 @@ ctl_sync_cache(struct ctl_scsiio *ctsio)
 	struct ctl_softc *ctl_softc;
 	uint64_t starting_lba;
 	uint32_t block_count;
-	int reladr, immed;
 	int retval;
 
 	CTL_DEBUG_PRINT(("ctl_sync_cache\n"));
@@ -5395,20 +5292,12 @@ ctl_sync_cache(struct ctl_scsiio *ctsio)
 	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
 	ctl_softc = control_softc;
 	retval = 0;
-	reladr = 0;
-	immed = 0;
 
 	switch (ctsio->cdb[0]) {
 	case SYNCHRONIZE_CACHE: {
 		struct scsi_sync_cache *cdb;
 		cdb = (struct scsi_sync_cache *)ctsio->cdb;
 
-		if (cdb->byte2 & SSC_RELADR)
-			reladr = 1;
-
-		if (cdb->byte2 & SSC_IMMED)
-			immed = 1;
-
 		starting_lba = scsi_4btoul(cdb->begin_lba);
 		block_count = scsi_2btoul(cdb->lb_count);
 		break;
@@ -5417,12 +5306,6 @@ ctl_sync_cache(struct ctl_scsiio *ctsio)
 		struct scsi_sync_cache_16 *cdb;
 		cdb = (struct scsi_sync_cache_16 *)ctsio->cdb;
 
-		if (cdb->byte2 & SSC_RELADR)
-			reladr = 1;
-
-		if (cdb->byte2 & SSC_IMMED)
-			immed = 1;
-
 		starting_lba = scsi_8btou64(cdb->begin_lba);
 		block_count = scsi_4btoul(cdb->lb_count);
 		break;
@@ -5434,41 +5317,6 @@ ctl_sync_cache(struct ctl_scsiio *ctsio)
 		break; /* NOTREACHED */
 	}
 
-	if (immed) {
-		/*
-		 * We don't support the immediate bit.  Since it's in the
-		 * same place for the 10 and 16 byte SYNCHRONIZE CACHE
-		 * commands, we can just return the same error in either
-		 * case.
-		 */
-		ctl_set_invalid_field(ctsio,
-				      /*sks_valid*/ 1,
-				      /*command*/ 1,
-				      /*field*/ 1,
-				      /*bit_valid*/ 1,
-				      /*bit*/ 1);
-		ctl_done((union ctl_io *)ctsio);
-		goto bailout;
-	}
-
-	if (reladr) {
-		/*
-		 * We don't support the reladr bit either.  It can only be
-		 * used with linked commands, and we don't support linked
-		 * commands.  Since the bit is in the same place for the
-		 * 10 and 16 byte SYNCHRONIZE CACHE * commands, we can
-		 * just return the same error in either case.
-		 */
-		ctl_set_invalid_field(ctsio,
-				      /*sks_valid*/ 1,
-				      /*command*/ 1,
-				      /*field*/ 1,
-				      /*bit_valid*/ 1,
-				      /*bit*/ 0);
-		ctl_done((union ctl_io *)ctsio);
-		goto bailout;
-	}
-
 	/*
 	 * We check the LBA and length, but don't do anything with them.
 	 * A SYNCHRONIZE CACHE will cause the entire cache for this lun to
@@ -5655,16 +5503,6 @@ ctl_read_buffer(struct ctl_scsiio *ctsio
 		ctl_done((union ctl_io *)ctsio);
 		return (CTL_RETVAL_COMPLETE);
 	}
-	if (cdb->buffer_id != 0) {
-		ctl_set_invalid_field(ctsio,
-				      /*sks_valid*/ 1,
-				      /*command*/ 1,
-				      /*field*/ 2,
-				      /*bit_valid*/ 0,
-				      /*bit*/ 0);
-		ctl_done((union ctl_io *)ctsio);
-		return (CTL_RETVAL_COMPLETE);
-	}
 
 	len = scsi_3btoul(cdb->length);
 	buffer_offset = scsi_3btoul(cdb->offset);
@@ -5723,16 +5561,6 @@ ctl_write_buffer(struct ctl_scsiio *ctsi
 		ctl_done((union ctl_io *)ctsio);
 		return (CTL_RETVAL_COMPLETE);
 	}
-	if (cdb->buffer_id != 0) {
-		ctl_set_invalid_field(ctsio,
-				      /*sks_valid*/ 1,
-				      /*command*/ 1,
-				      /*field*/ 2,
-				      /*bit_valid*/ 0,
-				      /*bit*/ 0);
-		ctl_done((union ctl_io *)ctsio);
-		return (CTL_RETVAL_COMPLETE);
-	}
 
 	len = scsi_3btoul(cdb->length);
 	buffer_offset = scsi_3btoul(cdb->offset);
@@ -7049,7 +6877,7 @@ ctl_read_capacity(struct ctl_scsiio *cts
 	return (CTL_RETVAL_COMPLETE);
 }
 
-static int
+int
 ctl_read_capacity_16(struct ctl_scsiio *ctsio)
 {
 	struct scsi_read_capacity_16 *cdb;
@@ -7113,37 +6941,7 @@ ctl_read_capacity_16(struct ctl_scsiio *
 }
 
 int
-ctl_service_action_in(struct ctl_scsiio *ctsio)
-{
-	struct scsi_service_action_in *cdb;
-	int retval;
-
-	CTL_DEBUG_PRINT(("ctl_service_action_in\n"));
-
-	cdb = (struct scsi_service_action_in *)ctsio->cdb;
-
-	retval = CTL_RETVAL_COMPLETE;
-
-	switch (cdb->service_action) {
-	case SRC16_SERVICE_ACTION:
-		retval = ctl_read_capacity_16(ctsio);
-		break;
-	default:
-		ctl_set_invalid_field(/*ctsio*/ ctsio,
-				      /*sks_valid*/ 1,
-				      /*command*/ 1,
-				      /*field*/ 1,
-				      /*bit_valid*/ 1,
-				      /*bit*/ 4);
-		ctl_done((union ctl_io *)ctsio);
-		break;
-	}
-
-	return (retval);
-}
-
-int
-ctl_maintenance_in(struct ctl_scsiio *ctsio)
+ctl_report_tagret_port_groups(struct ctl_scsiio *ctsio)
 {
 	struct scsi_maintenance_in *cdb;
 	int retval;
@@ -7156,7 +6954,7 @@ ctl_maintenance_in(struct ctl_scsiio *ct
 	struct scsi_target_port_descriptor  *tp_desc_ptr1_1, *tp_desc_ptr1_2,
 	                                    *tp_desc_ptr2_1, *tp_desc_ptr2_2;
 
-	CTL_DEBUG_PRINT(("ctl_maintenance_in\n"));
+	CTL_DEBUG_PRINT(("ctl_report_tagret_port_groups\n"));
 
 	cdb = (struct scsi_maintenance_in *)ctsio->cdb;
 	softc = control_softc;
@@ -7164,17 +6962,6 @@ ctl_maintenance_in(struct ctl_scsiio *ct
 
 	retval = CTL_RETVAL_COMPLETE;
 
-	if ((cdb->byte2 & SERVICE_ACTION_MASK) != SA_RPRT_TRGT_GRP) {
-		ctl_set_invalid_field(/*ctsio*/ ctsio,
-				      /*sks_valid*/ 1,
-				      /*command*/ 1,
-				      /*field*/ 1,
-				      /*bit_valid*/ 1,
-				      /*bit*/ 4);
-		ctl_done((union ctl_io *)ctsio);
-		return(retval);
-	}
-
 	single = ctl_is_single;
 	if (single)
         	num_target_port_groups = NUM_TARGET_PORT_GROUPS - 1;
@@ -7290,6 +7077,217 @@ ctl_maintenance_in(struct ctl_scsiio *ct
 }
 
 int
+ctl_report_supported_opcodes(struct ctl_scsiio *ctsio)
+{
+	struct ctl_lun *lun;
+	struct scsi_report_supported_opcodes *cdb;
+	const struct ctl_cmd_entry *entry, *sentry;
+	struct scsi_report_supported_opcodes_all *all;
+	struct scsi_report_supported_opcodes_descr *descr;
+	struct scsi_report_supported_opcodes_one *one;
+	int retval;
+	int alloc_len, total_len;
+	int opcode, service_action, i, j, num;
+
+	CTL_DEBUG_PRINT(("ctl_report_supported_opcodes\n"));
+
+	cdb = (struct scsi_report_supported_opcodes *)ctsio->cdb;
+	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
+
+	retval = CTL_RETVAL_COMPLETE;
+
+	opcode = cdb->requested_opcode;
+	service_action = scsi_2btoul(cdb->requested_service_action);
+	switch (cdb->options & RSO_OPTIONS_MASK) {
+	case RSO_OPTIONS_ALL:
+		num = 0;
+		for (i = 0; i < 256; i++) {
+			entry = &ctl_cmd_table[i];
+			if (entry->flags & CTL_CMD_FLAG_SA5) {
+				for (j = 0; j < 32; j++) {
+					sentry = &((const struct ctl_cmd_entry *)
+					    entry->execute)[j];
+					if (ctl_cmd_applicable(
+					    lun->be_lun->lun_type, sentry))
+						num++;
+				}
+			} else {
+				if (ctl_cmd_applicable(lun->be_lun->lun_type,
+				    entry))
+					num++;
+			}
+		}
+		total_len = sizeof(struct scsi_report_supported_opcodes_all) +
+		    num * sizeof(struct scsi_report_supported_opcodes_descr);
+		break;
+	case RSO_OPTIONS_OC:
+		if (ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) {
+			ctl_set_invalid_field(/*ctsio*/ ctsio,
+					      /*sks_valid*/ 1,
+					      /*command*/ 1,
+					      /*field*/ 2,
+					      /*bit_valid*/ 1,
+					      /*bit*/ 2);
+			ctl_done((union ctl_io *)ctsio);
+			return (CTL_RETVAL_COMPLETE);
+		}
+		total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32;
+		break;
+	case RSO_OPTIONS_OC_SA:
+		if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) == 0 ||
+		    service_action >= 32) {
+			ctl_set_invalid_field(/*ctsio*/ ctsio,
+					      /*sks_valid*/ 1,
+					      /*command*/ 1,
+					      /*field*/ 2,
+					      /*bit_valid*/ 1,
+					      /*bit*/ 2);
+			ctl_done((union ctl_io *)ctsio);
+			return (CTL_RETVAL_COMPLETE);
+		}
+		total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32;
+		break;
+	default:
+		ctl_set_invalid_field(/*ctsio*/ ctsio,
+				      /*sks_valid*/ 1,
+				      /*command*/ 1,
+				      /*field*/ 2,
+				      /*bit_valid*/ 1,
+				      /*bit*/ 2);
+		ctl_done((union ctl_io *)ctsio);
+		return (CTL_RETVAL_COMPLETE);
+	}
+
+	alloc_len = scsi_4btoul(cdb->length);
+
+	ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
+
+	ctsio->kern_sg_entries = 0;
+
+	if (total_len < alloc_len) {
+		ctsio->residual = alloc_len - total_len;
+		ctsio->kern_data_len = total_len;
+		ctsio->kern_total_len = total_len;
+	} else {
+		ctsio->residual = 0;
+		ctsio->kern_data_len = alloc_len;
+		ctsio->kern_total_len = alloc_len;
+	}
+	ctsio->kern_data_resid = 0;
+	ctsio->kern_rel_offset = 0;
+
+	switch (cdb->options & RSO_OPTIONS_MASK) {
+	case RSO_OPTIONS_ALL:
+		all = (struct scsi_report_supported_opcodes_all *)
+		    ctsio->kern_data_ptr;
+		num = 0;
+		for (i = 0; i < 256; i++) {
+			entry = &ctl_cmd_table[i];
+			if (entry->flags & CTL_CMD_FLAG_SA5) {
+				for (j = 0; j < 32; j++) {
+					sentry = &((const struct ctl_cmd_entry *)
+					    entry->execute)[j];
+					if (!ctl_cmd_applicable(
+					    lun->be_lun->lun_type, sentry))
+						continue;
+					descr = &all->descr[num++];
+					descr->opcode = i;
+					scsi_ulto2b(j, descr->service_action);
+					descr->flags = RSO_SERVACTV;
+					scsi_ulto2b(sentry->length,
+					    descr->cdb_length);
+				}
+			} else {
+				if (!ctl_cmd_applicable(lun->be_lun->lun_type,
+				    entry))
+					continue;
+				descr = &all->descr[num++];
+				descr->opcode = i;
+				scsi_ulto2b(0, descr->service_action);
+				descr->flags = 0;
+				scsi_ulto2b(entry->length, descr->cdb_length);
+			}
+		}
+		scsi_ulto4b(
+		    num * sizeof(struct scsi_report_supported_opcodes_descr),
+		    all->length);
+		break;
+	case RSO_OPTIONS_OC:
+		one = (struct scsi_report_supported_opcodes_one *)
+		    ctsio->kern_data_ptr;
+		entry = &ctl_cmd_table[opcode];
+		goto fill_one;
+	case RSO_OPTIONS_OC_SA:
+		one = (struct scsi_report_supported_opcodes_one *)
+		    ctsio->kern_data_ptr;
+		entry = &ctl_cmd_table[opcode];
+		entry = &((const struct ctl_cmd_entry *)
+		    entry->execute)[service_action];
+fill_one:
+		if (ctl_cmd_applicable(lun->be_lun->lun_type, entry)) {
+			one->support = 3;
+			scsi_ulto2b(entry->length, one->cdb_length);
+			one->cdb_usage[0] = opcode;
+			memcpy(&one->cdb_usage[1], entry->usage,
+			    entry->length - 1);
+		} else
+			one->support = 1;
+		break;
+	}
+
+	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
+	ctsio->be_move_done = ctl_config_move_done;
+
+	ctl_datamove((union ctl_io *)ctsio);
+	return(retval);
+}
+
+int
+ctl_report_supported_tmf(struct ctl_scsiio *ctsio)
+{
+	struct ctl_lun *lun;
+	struct scsi_report_supported_tmf *cdb;
+	struct scsi_report_supported_tmf_data *data;
+	int retval;
+	int alloc_len, total_len;
+
+	CTL_DEBUG_PRINT(("ctl_report_supported_tmf\n"));
+
+	cdb = (struct scsi_report_supported_tmf *)ctsio->cdb;
+	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
+
+	retval = CTL_RETVAL_COMPLETE;
+
+	total_len = sizeof(struct scsi_report_supported_tmf_data);
+	alloc_len = scsi_4btoul(cdb->length);
+
+	ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
+
+	ctsio->kern_sg_entries = 0;
+
+	if (total_len < alloc_len) {
+		ctsio->residual = alloc_len - total_len;
+		ctsio->kern_data_len = total_len;
+		ctsio->kern_total_len = total_len;
+	} else {
+		ctsio->residual = 0;
+		ctsio->kern_data_len = alloc_len;
+		ctsio->kern_total_len = alloc_len;
+	}
+	ctsio->kern_data_resid = 0;
+	ctsio->kern_rel_offset = 0;
+
+	data = (struct scsi_report_supported_tmf_data *)ctsio->kern_data_ptr;
+	data->byte1 |= RST_ATS | RST_LURS | RST_TRS;
+
+	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
+	ctsio->be_move_done = ctl_config_move_done;
+
+	ctl_datamove((union ctl_io *)ctsio);
+	return (retval);
+}
+
+int
 ctl_persistent_reserve_in(struct ctl_scsiio *ctsio)
 {
 	struct scsi_per_res_in *cdb;
@@ -7325,18 +7323,8 @@ retry:
 	case SPRI_RC: /* report capabilities */
 		total_len = sizeof(struct scsi_per_res_cap);
 		break;
-	case SPRI_RS: /* read full status */
 	default:
-		mtx_unlock(&lun->lun_lock);
-		ctl_set_invalid_field(ctsio,
-				      /*sks_valid*/ 1,
-				      /*command*/ 1,
-				      /*field*/ 1,
-				      /*bit_valid*/ 1,
-				      /*bit*/ 0);
-		ctl_done((union ctl_io *)ctsio);
-		return (CTL_RETVAL_COMPLETE);
-		break; /* NOTREACHED */
+		panic("Invalid PR type %x", cdb->action);
 	}
 	mtx_unlock(&lun->lun_lock);
 
@@ -8045,28 +8033,6 @@ ctl_persistent_reserve_out(struct ctl_sc
 		}
 	}
 
-	switch (cdb->action & SPRO_ACTION_MASK) {
-	case SPRO_REGISTER:
-	case SPRO_RESERVE:
-	case SPRO_RELEASE:
-	case SPRO_CLEAR:
-	case SPRO_PREEMPT:
-	case SPRO_REG_IGNO:
-		break;
-	case SPRO_REG_MOVE:
-	case SPRO_PRE_ABO:
-	default:
-		ctl_set_invalid_field(/*ctsio*/ ctsio,
-				      /*sks_valid*/ 1,
-				      /*command*/ 1,
-				      /*field*/ 1,
-				      /*bit_valid*/ 1,
-				      /*bit*/ 0);
-		ctl_done((union ctl_io *)ctsio);
-		return (CTL_RETVAL_COMPLETE);
-		break; /* NOTREACHED */
-	}
-
 	param_len = scsi_4btoul(cdb->length);
 
 	if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) {
@@ -8435,19 +8401,8 @@ ctl_persistent_reserve_out(struct ctl_sc
 			return (CTL_RETVAL_COMPLETE);
 		break;
 	}
-	case SPRO_REG_MOVE:
-	case SPRO_PRE_ABO:
 	default:
-		free(ctsio->kern_data_ptr, M_CTL);
-		ctl_set_invalid_field(/*ctsio*/ ctsio,
-				      /*sks_valid*/ 1,
-				      /*command*/ 1,
-				      /*field*/ 1,
-				      /*bit_valid*/ 1,
-				      /*bit*/ 0);
-		ctl_done((union ctl_io *)ctsio);
-		return (CTL_RETVAL_COMPLETE);
-		break; /* NOTREACHED */
+		panic("Invalid PR type %x", cdb->action);
 	}
 
 done:
@@ -8596,7 +8551,7 @@ ctl_read_write(struct ctl_scsiio *ctsio)
 	struct ctl_lba_len_flags *lbalen;
 	uint64_t lba;
 	uint32_t num_blocks;
-	int reladdr, fua, dpo, ebp;
+	int fua, dpo;
 	int retval;
 	int isread;
 
@@ -8604,10 +8559,8 @@ ctl_read_write(struct ctl_scsiio *ctsio)
 
 	CTL_DEBUG_PRINT(("ctl_read_write: command: %#x\n", ctsio->cdb[0]));
 
-	reladdr = 0;
 	fua = 0;
 	dpo = 0;
-	ebp = 0;
 
 	retval = CTL_RETVAL_COMPLETE;
 
@@ -8655,17 +8608,11 @@ ctl_read_write(struct ctl_scsiio *ctsio)
 
 		cdb = (struct scsi_rw_10 *)ctsio->cdb;
 
-		if (cdb->byte2 & SRW10_RELADDR)
-			reladdr = 1;
 		if (cdb->byte2 & SRW10_FUA)
 			fua = 1;
 		if (cdb->byte2 & SRW10_DPO)
 			dpo = 1;
 
-		if ((cdb->opcode == WRITE_10)
-		 && (cdb->byte2 & SRW10_EBP))
-			ebp = 1;
-
 		lba = scsi_4btoul(cdb->addr);
 		num_blocks = scsi_2btoul(cdb->length);
 		break;
@@ -8695,8 +8642,6 @@ ctl_read_write(struct ctl_scsiio *ctsio)
 
 		cdb = (struct scsi_rw_12 *)ctsio->cdb;
 
-		if (cdb->byte2 & SRW12_RELADDR)
-			reladdr = 1;
 		if (cdb->byte2 & SRW12_FUA)
 			fua = 1;
 		if (cdb->byte2 & SRW12_DPO)
@@ -8724,8 +8669,6 @@ ctl_read_write(struct ctl_scsiio *ctsio)
 
 		cdb = (struct scsi_rw_16 *)ctsio->cdb;
 
-		if (cdb->byte2 & SRW12_RELADDR)
-			reladdr = 1;
 		if (cdb->byte2 & SRW12_FUA)
 			fua = 1;
 		if (cdb->byte2 & SRW12_DPO)
@@ -8765,20 +8708,6 @@ ctl_read_write(struct ctl_scsiio *ctsio)
 	 * getting it to do write-through for a particular transaction may
 	 * not be possible.
 	 */
-	/*
-	 * We don't support relative addressing.  That also requires
-	 * supporting linked commands, which we don't do.
-	 */
-	if (reladdr != 0) {
-		ctl_set_invalid_field(ctsio,
-				      /*sks_valid*/ 1,
-				      /*command*/ 1,
-				      /*field*/ 1,
-				      /*bit_valid*/ 1,
-				      /*bit*/ 0);
-		ctl_done((union ctl_io *)ctsio);
-		return (CTL_RETVAL_COMPLETE);
-	}
 
 	/*
 	 * The first check is to make sure we're in bounds, the second
@@ -10328,7 +10257,7 @@ ctl_extent_check(union ctl_io *io1, unio
 static ctl_action
 ctl_check_for_blockage(union ctl_io *pending_io, union ctl_io *ooa_io)
 {
-	struct ctl_cmd_entry *pending_entry, *ooa_entry;
+	const struct ctl_cmd_entry *pending_entry, *ooa_entry;
 	ctl_serialize_action *serialize_row;
 
 	/*
@@ -10401,8 +10330,8 @@ ctl_check_for_blockage(union ctl_io *pen
 	  || (ooa_io->scsiio.tag_type == CTL_TAG_ORDERED)))
 		return (CTL_ACTION_BLOCK);
 
-	pending_entry = &ctl_cmd_table[pending_io->scsiio.cdb[0]];
-	ooa_entry = &ctl_cmd_table[ooa_io->scsiio.cdb[0]];
+	pending_entry = ctl_get_cmd_entry(&pending_io->scsiio);
+	ooa_entry = ctl_get_cmd_entry(&ooa_io->scsiio);
 
 	serialize_row = ctl_serialize_table[ooa_entry->seridx];
 
@@ -10532,9 +10461,8 @@ ctl_check_blocked(struct ctl_lun *lun)
 		case CTL_ACTION_PASS:
 		case CTL_ACTION_SKIP: {
 			struct ctl_softc *softc;
-			struct ctl_cmd_entry *entry;
+			const struct ctl_cmd_entry *entry;
 			uint32_t initidx;
-			uint8_t opcode;
 			int isc_retval;
 
 			/*
@@ -10571,8 +10499,7 @@ ctl_check_blocked(struct ctl_lun *lun)
 				}
 				break;
 			}
-			opcode = cur_blocked->scsiio.cdb[0];
-			entry = &ctl_cmd_table[opcode];
+			entry = ctl_get_cmd_entry(&cur_blocked->scsiio);
 			softc = control_softc;
 
 			initidx = ctl_get_initindex(&cur_blocked->io_hdr.nexus);
@@ -10620,7 +10547,7 @@ ctl_check_blocked(struct ctl_lun *lun)
  */
 static int
 ctl_scsiio_lun_check(struct ctl_softc *ctl_softc, struct ctl_lun *lun,
-		     struct ctl_cmd_entry *entry, struct ctl_scsiio *ctsio)
+    const struct ctl_cmd_entry *entry, struct ctl_scsiio *ctsio)
 {
 	int retval;
 
@@ -10980,8 +10907,7 @@ static int
 ctl_scsiio_precheck(struct ctl_softc *ctl_softc, struct ctl_scsiio *ctsio)
 {
 	struct ctl_lun *lun;
-	struct ctl_cmd_entry *entry;
-	uint8_t opcode;
+	const struct ctl_cmd_entry *entry;
 	uint32_t initidx, targ_lun;
 	int retval;
 
@@ -10989,8 +10915,6 @@ ctl_scsiio_precheck(struct ctl_softc *ct
 
 	lun = NULL;
 
-	opcode = ctsio->cdb[0];
-
 	targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun;
 	if ((targ_lun < CTL_MAX_LUNS)
 	 && (ctl_softc->ctl_luns[targ_lun] != NULL)) {
@@ -11009,13 +10933,27 @@ ctl_scsiio_precheck(struct ctl_softc *ct
 			if (lun->be_lun->lun_type == T_PROCESSOR) {
 				ctsio->io_hdr.flags |= CTL_FLAG_CONTROL_DEV;
 			}
+
+			/*
+			 * Every I/O goes into the OOA queue for a
+			 * particular LUN, and stays there until completion.
+			 */
+			mtx_lock(&lun->lun_lock);
+			TAILQ_INSERT_TAIL(&lun->ooa_queue, &ctsio->io_hdr,
+			    ooa_links);
 		}
 	} else {
 		ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = NULL;
 		ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = NULL;
 	}
 
-	entry = &ctl_cmd_table[opcode];
+	/* Get command entry and return error if it is unsuppotyed. */
+	entry = ctl_validate_command(ctsio);
+	if (entry == NULL) {
+		if (lun)
+			mtx_unlock(&lun->lun_lock);
+		return (retval);
+	}
 
 	ctsio->io_hdr.flags &= ~CTL_FLAG_DATA_MASK;
 	ctsio->io_hdr.flags |= entry->flags & CTL_FLAG_DATA_MASK;
@@ -11039,43 +10977,15 @@ ctl_scsiio_precheck(struct ctl_softc *ct
 		CTL_DEBUG_PRINT(("ctl_scsiio_precheck: bailing out due to invalid LUN\n"));
 		return (retval);
 	} else {
-		mtx_lock(&lun->lun_lock);
-
-		/*
-		 * Every I/O goes into the OOA queue for a particular LUN, and
-		 * stays there until completion.
-		 */
-		TAILQ_INSERT_TAIL(&lun->ooa_queue, &ctsio->io_hdr, ooa_links);
-
 		/*
 		 * Make sure we support this particular command on this LUN.
 		 * e.g., we don't support writes to the control LUN.
 		 */
-		switch (lun->be_lun->lun_type) {
-		case T_PROCESSOR:
-		 	if (((entry->flags & CTL_CMD_FLAG_OK_ON_PROC) == 0)
-			 && ((entry->flags & CTL_CMD_FLAG_OK_ON_ALL_LUNS)
-			      == 0)) {
-				mtx_unlock(&lun->lun_lock);
-				ctl_set_invalid_opcode(ctsio);
-				ctl_done((union ctl_io *)ctsio);
-				return (retval);
-			}
-			break;
-		case T_DIRECT:
-			if (((entry->flags & CTL_CMD_FLAG_OK_ON_SLUN) == 0)
-			 && ((entry->flags & CTL_CMD_FLAG_OK_ON_ALL_LUNS)
-			      == 0)){
-				mtx_unlock(&lun->lun_lock);
-				ctl_set_invalid_opcode(ctsio);
-				ctl_done((union ctl_io *)ctsio);
-				return (retval);
-			}
-			break;
-		default:
+		if (!ctl_cmd_applicable(lun->be_lun->lun_type, entry)) {
 			mtx_unlock(&lun->lun_lock);
-			panic("Unsupported CTL LUN type %d\n",
-			      lun->be_lun->lun_type);
+			ctl_set_invalid_opcode(ctsio);
+			ctl_done((union ctl_io *)ctsio);
+			return (retval);
 		}
 	}
 
@@ -11087,7 +10997,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct
 	 * this initiator, clear it, because it sent down a command other
 	 * than request sense.
 	 */
-	if ((opcode != REQUEST_SENSE)
+	if ((ctsio->cdb[0] != REQUEST_SENSE)
 	 && (ctl_is_set(lun->have_ca, initidx)))
 		ctl_clear_mask(lun->have_ca, initidx);
 
@@ -11183,7 +11093,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct
 		    CTL_HA_STATUS_SUCCESS) {
 			printf("CTL:precheck, ctl_ha_msg_send returned %d\n",
 			       isc_retval);
-			printf("CTL:opcode is %x\n",opcode);
+			printf("CTL:opcode is %x\n", ctsio->cdb[0]);
 		} else {
 #if 0
 			printf("CTL:Precheck sent msg, opcode is %x\n",opcode);
@@ -11238,17 +11148,85 @@ ctl_scsiio_precheck(struct ctl_softc *ct
 	return (retval);
 }
 
+const struct ctl_cmd_entry *
+ctl_get_cmd_entry(struct ctl_scsiio *ctsio)
+{
+	const struct ctl_cmd_entry *entry;
+	int service_action;
+
+	entry = &ctl_cmd_table[ctsio->cdb[0]];
+	if (entry->flags & CTL_CMD_FLAG_SA5) {
+		service_action = ctsio->cdb[1] & SERVICE_ACTION_MASK;
+		entry = &((const struct ctl_cmd_entry *)
+		    entry->execute)[service_action];
+	}
+	return (entry);
+}
+
+const struct ctl_cmd_entry *
+ctl_validate_command(struct ctl_scsiio *ctsio)
+{
+	const struct ctl_cmd_entry *entry;
+	int i;
+	uint8_t diff;
+
+	entry = ctl_get_cmd_entry(ctsio);
+	if (entry->execute == NULL) {
+		ctl_set_invalid_opcode(ctsio);
+		ctl_done((union ctl_io *)ctsio);
+		return (NULL);
+	}
+	KASSERT(entry->length > 0,
+	    ("Not defined length for command 0x%02x/0x%02x",
+	     ctsio->cdb[0], ctsio->cdb[1]));
+	for (i = 1; i < entry->length; i++) {
+		diff = ctsio->cdb[i] & ~entry->usage[i - 1];
+		if (diff == 0)
+			continue;
+		ctl_set_invalid_field(ctsio,
+				      /*sks_valid*/ 1,
+				      /*command*/ 1,
+				      /*field*/ i,
+				      /*bit_valid*/ 1,
+				      /*bit*/ fls(diff) - 1);
+		ctl_done((union ctl_io *)ctsio);
+		return (NULL);
+	}
+	return (entry);
+}
+
+static int
+ctl_cmd_applicable(uint8_t lun_type, const struct ctl_cmd_entry *entry)
+{
+
+	switch (lun_type) {
+	case T_PROCESSOR:
+		if (((entry->flags & CTL_CMD_FLAG_OK_ON_PROC) == 0) &&
+		    ((entry->flags & CTL_CMD_FLAG_OK_ON_ALL_LUNS) == 0))
+			return (0);
+		break;
+	case T_DIRECT:
+		if (((entry->flags & CTL_CMD_FLAG_OK_ON_SLUN) == 0) &&
+		    ((entry->flags & CTL_CMD_FLAG_OK_ON_ALL_LUNS) == 0))
+			return (0);
+		break;
+	default:
+		return (0);
+	}
+	return (1);
+}
+
 static int
 ctl_scsiio(struct ctl_scsiio *ctsio)
 {
 	int retval;
-	struct ctl_cmd_entry *entry;
+	const struct ctl_cmd_entry *entry;
 
 	retval = CTL_RETVAL_COMPLETE;
 
 	CTL_DEBUG_PRINT(("ctl_scsiio cdb[0]=%02X\n", ctsio->cdb[0]));
 
-	entry = &ctl_cmd_table[ctsio->cdb[0]];
+	entry = ctl_get_cmd_entry(ctsio);
 
 	/*
 	 * If this I/O has been aborted, just send it straight to
@@ -11684,15 +11662,13 @@ ctl_handle_isc(union ctl_io *io)
 		free_io = ctl_serialize_other_sc_cmd(&io->scsiio);
 		break;
 	case CTL_MSG_R2R: {
-		uint8_t opcode;
-		struct ctl_cmd_entry *entry;
+		const struct ctl_cmd_entry *entry;
 
 		/*
 		 * This is only used in SER_ONLY mode.
 		 */
 		free_io = 0;
-		opcode = io->scsiio.cdb[0];
-		entry = &ctl_cmd_table[opcode];
+		entry = ctl_get_cmd_entry(&io->scsiio);

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 15:05:31 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B5B56959;
 Tue,  1 Jul 2014 15:05:31 +0000 (UTC)
Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com
 [IPv6:2a00:1450:400c:c05::232])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id AF8D92ABD;
 Tue,  1 Jul 2014 15:05:30 +0000 (UTC)
Received: by mail-wi0-f178.google.com with SMTP id n15so7935501wiw.17
 for ; Tue, 01 Jul 2014 08:05:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to
 :mime-version:content-type:content-transfer-encoding;
 bh=K5zfTZdxNzaHSnRl+638wu8zrSAWWvgvIjGcW2xMeqk=;
 b=QZCUQtLy0S+hM9fjVy3KDHwnaFMiDrIF1GGYVsJuGg5gqQUwKHmDxHPLT3oWM3N4WV
 I2KqWWB7ergMK2MwoZVYzdt67DK2c3r/5uH7elLEs6M89SYCyg1F7Q1bngZfy/IV59lW
 dkxK/EuV+bz+TNgHhupCbaF+avvf67TVs96b3mkCbvPYwBjp5lxVONdlFvUK//b50A1O
 KQzzi5LXjXgbaOfNJds2LFQ4lCo8Dom0SUe1acaiCSf50aj9OSWYVXiXyf4E/ju+hZ2l
 +Rj3Lp1rb9gI7suYHWje0BsC5/dRepYregWBl5wFIUYAG79wbBMIut2cHqqnn/Y8KIcr
 hRsQ==
X-Received: by 10.194.88.199 with SMTP id bi7mr53692162wjb.79.1404227128944;
 Tue, 01 Jul 2014 08:05:28 -0700 (PDT)
Received: from ernst.home (p4FC0FE50.dip0.t-ipconnect.de. [79.192.254.80])
 by mx.google.com with ESMTPSA id hc4sm48681043wjc.38.2014.07.01.08.05.27
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Tue, 01 Jul 2014 08:05:28 -0700 (PDT)
Date: Tue, 1 Jul 2014 17:05:24 +0200
From: Gary Jennejohn 
To: Mateusz Guzik 
Subject: Re: svn commit: r268074 - head/sys/kern
Message-ID: <20140701170524.76e41d9a@ernst.home>
In-Reply-To: <20140701141920.GC26696@dft-labs.eu>
References: <201407010629.s616TFul082441@svn.freebsd.org>
 <201407010940.57602.jhb@freebsd.org>
 <20140701141920.GC26696@dft-labs.eu>
Reply-To: gljennjohn@gmail.com
X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.17; amd64-portbld-freebsd11.0)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Mateusz Guzik ,
 John Baldwin 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 15:05:31 -0000

On Tue, 1 Jul 2014 16:19:20 +0200
Mateusz Guzik  wrote:

> On Tue, Jul 01, 2014 at 09:40:57AM -0400, John Baldwin wrote:
> > On Tuesday, July 01, 2014 2:29:15 am Mateusz Guzik wrote:
> > > Modified: head/sys/kern/kern_sig.c
> > > 
> > ==============================================================================
> > > --- head/sys/kern/kern_sig.c	Tue Jul  1 06:23:48 2014	(r268073)
> > > +++ head/sys/kern/kern_sig.c	Tue Jul  1 06:29:15 2014	(r268074)
> > > @@ -3453,10 +3453,6 @@ sigacts_copy(struct sigacts *dest, struc
> > >  int
> > >  sigacts_shared(struct sigacts *ps)
> > >  {
> > > -	int shared;
> > >  
> > > -	mtx_lock(&ps->ps_mtx);
> > > -	shared = ps->ps_refcnt > 1;
> > > -	mtx_unlock(&ps->ps_mtx);
> > > -	return (shared);
> > > +	return (ps->ps_refcnt > 1);
> > >  }
> > 
> > You should KASSERT() in sigacts_shared that P_HADTHREADS is not set so that 
> > new code does not call this function unsafely in the future.
> > 
> 
> Looks more like !P_HADTHREADS || p->p_singlethread != NULL on the first
> sight, but yeah, I'll add an assertion.
> 

Also, please fix the build with gcc, which dies with an error that
newsigacts may be use unitialzed.

What I did was set both oldsigacts and newsigacts to NULL before this
line at around 622:

if (sigacts_share(p->p_sigacts)) {

which allowed me to remove the else branch for setting oldsigacts to
NULL.

-- 
Gary Jennejohn

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 15:36:06 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5CC91278;
 Tue,  1 Jul 2014 15:36:06 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3E3DD2E12;
 Tue,  1 Jul 2014 15:36:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61Fa6lU040389;
 Tue, 1 Jul 2014 15:36:06 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61Fa5pe040386;
 Tue, 1 Jul 2014 15:36:05 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201407011536.s61Fa5pe040386@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Tue, 1 Jul 2014 15:36:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268097 - in head/sys:
 cddl/contrib/opensolaris/uts/common/dtrace modules/dtrace/fasttrap
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 15:36:06 -0000

Author: pfg
Date: Tue Jul  1 15:36:05 2014
New Revision: 268097
URL: http://svnweb.freebsd.org/changeset/base/268097

Log:
  Revert r268007, and re-adapt MFV r260708:
  
  4427 pid provider rejects probes with valid UTF-8 names
  
  Use of u8_textprep.c required -Wno-cast-qual for powerpc.
  
  MFC after:	2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
  head/sys/modules/dtrace/fasttrap/Makefile

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c	Tue Jul  1 15:05:23 2014	(r268096)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c	Tue Jul  1 15:36:05 2014	(r268097)
@@ -28,9 +28,9 @@
  * Use is subject to license terms.
  */
 
-#if defined(sun)
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-#endif
+/*
+ * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ */
 
 #include 
 #include 
@@ -63,6 +63,7 @@
 #if !defined(sun)
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2256,8 +2257,7 @@ fasttrap_ioctl(struct cdev *dev, u_long 
 		fasttrap_probe_spec_t *probe;
 		uint64_t noffs;
 		size_t size;
-		int ret;
-		char *c;
+		int ret, err;
 
 		if (copyin(&uprobe->ftps_noffs, &noffs,
 		    sizeof (uprobe->ftps_noffs)))
@@ -2286,18 +2286,16 @@ fasttrap_ioctl(struct cdev *dev, u_long 
 		 * Verify that the function and module strings contain no
 		 * funny characters.
 		 */
-		for (c = &probe->ftps_func[0]; *c != '\0'; c++) {
-			if (*c < 0x20 || 0x7f <= *c) {
-				ret = EINVAL;
-				goto err;
-			}
+		if (u8_validate(probe->ftps_func, strlen(probe->ftps_func),
+		    NULL, U8_VALIDATE_ENTIRE, &err) < 0) {
+			ret = EINVAL;
+			goto err;
 		}
 
-		for (c = &probe->ftps_mod[0]; *c != '\0'; c++) {
-			if (*c < 0x20 || 0x7f <= *c) {
-				ret = EINVAL;
-				goto err;
-			}
+		if (u8_validate(probe->ftps_mod, strlen(probe->ftps_mod),
+		    NULL, U8_VALIDATE_ENTIRE, &err) < 0) {
+			ret = EINVAL;
+			goto err;
 		}
 
 #ifdef notyet

Modified: head/sys/modules/dtrace/fasttrap/Makefile
==============================================================================
--- head/sys/modules/dtrace/fasttrap/Makefile	Tue Jul  1 15:05:23 2014	(r268096)
+++ head/sys/modules/dtrace/fasttrap/Makefile	Tue Jul  1 15:36:05 2014	(r268097)
@@ -20,9 +20,13 @@ CFLAGS+=	-I${SYSDIR}/cddl/contrib/openso
 .PATH:		${SYSDIR}/cddl/contrib/opensolaris/uts/powerpc/dtrace
 .endif
 
+.PATH:		${.CURDIR}/../../../cddl/contrib/opensolaris/common/unicode
+SRCS+=		u8_textprep.c
+
 CFLAGS+=	-DSMP
 
 .include 
 
 CFLAGS+=	-include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
+CWARNFLAGS+=	-Wno-cast-qual
 CWARNFLAGS+=	-Wno-unused

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 15:41:17 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C0E01764;
 Tue,  1 Jul 2014 15:41:17 +0000 (UTC)
Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com
 [IPv6:2a00:1450:400c:c00::22a])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id BE0D92EE6;
 Tue,  1 Jul 2014 15:41:16 +0000 (UTC)
Received: by mail-wg0-f42.google.com with SMTP id z12so9859289wgg.25
 for ; Tue, 01 Jul 2014 08:41:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=kvZcA2coRdRWPBkjZA+865xFSaXXb50Hks79A3UMEOg=;
 b=Kbbq/lJrrGeZgBzMKov7vJvn5XCb3QjKrjeyoWT22iXojcjqdMkTkwEehr9RHmCiar
 EDmFm9P2gsylocGJifduapHo4SDgUQegUz0OC5/kJBReMgltERYgHPvv6CLVa6Qatjik
 OsiAIXKZV6LWdmvzpm7cszFBmbnToEG7KE1co5HF4ZO8D46TtBI/Z7dBTWe1ETzXb/oQ
 NEvbxAdMGIfE9+G1rfBz+H/tG3+TIaUM6GMG7aNZU6X7ng0ooyYXg0eurb5hQ1roi0Eh
 nugMpSz/mUWWLu4k/VSj5O9AcuSgsq10BR4vcPXgZ/jPVYPRmzmnqC/q41CNRx5z7ibw
 At/w==
X-Received: by 10.180.80.70 with SMTP id p6mr16486052wix.22.1404229275007;
 Tue, 01 Jul 2014 08:41:15 -0700 (PDT)
Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net.
 [2001:470:1f08:1f7::2])
 by mx.google.com with ESMTPSA id lo18sm44571015wic.1.2014.07.01.08.41.13
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Tue, 01 Jul 2014 08:41:14 -0700 (PDT)
Date: Tue, 1 Jul 2014 17:41:12 +0200
From: Mateusz Guzik 
To: Gary Jennejohn 
Subject: Re: svn commit: r268074 - head/sys/kern
Message-ID: <20140701154111.GF26696@dft-labs.eu>
References: <201407010629.s616TFul082441@svn.freebsd.org>
 <201407010940.57602.jhb@freebsd.org>
 <20140701141920.GC26696@dft-labs.eu>
 <20140701170524.76e41d9a@ernst.home>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20140701170524.76e41d9a@ernst.home>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Mateusz Guzik ,
 John Baldwin 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 15:41:17 -0000

On Tue, Jul 01, 2014 at 05:05:24PM +0200, Gary Jennejohn wrote:
> On Tue, 1 Jul 2014 16:19:20 +0200
> Mateusz Guzik  wrote:
> 
> > On Tue, Jul 01, 2014 at 09:40:57AM -0400, John Baldwin wrote:
> > > On Tuesday, July 01, 2014 2:29:15 am Mateusz Guzik wrote:
> > > > Modified: head/sys/kern/kern_sig.c
> > > > 
> > > ==============================================================================
> > > > --- head/sys/kern/kern_sig.c	Tue Jul  1 06:23:48 2014	(r268073)
> > > > +++ head/sys/kern/kern_sig.c	Tue Jul  1 06:29:15 2014	(r268074)
> > > > @@ -3453,10 +3453,6 @@ sigacts_copy(struct sigacts *dest, struc
> > > >  int
> > > >  sigacts_shared(struct sigacts *ps)
> > > >  {
> > > > -	int shared;
> > > >  
> > > > -	mtx_lock(&ps->ps_mtx);
> > > > -	shared = ps->ps_refcnt > 1;
> > > > -	mtx_unlock(&ps->ps_mtx);
> > > > -	return (shared);
> > > > +	return (ps->ps_refcnt > 1);
> > > >  }
> > > 
> > > You should KASSERT() in sigacts_shared that P_HADTHREADS is not set so that 
> > > new code does not call this function unsafely in the future.
> > > 
> > 
> > Looks more like !P_HADTHREADS || p->p_singlethread != NULL on the first
> > sight, but yeah, I'll add an assertion.
> > 
> 
> Also, please fix the build with gcc, which dies with an error that
> newsigacts may be use unitialzed.
> 
> What I did was set both oldsigacts and newsigacts to NULL before this
> line at around 622:
> 
> if (sigacts_share(p->p_sigacts)) {
> 
> which allowed me to remove the else branch for setting oldsigacts to
> NULL.
> 

Sorry for breakage.

Does the following fix the problem for you?

diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 91d161d..dc4eb9b 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -625,8 +625,10 @@ interpret:
 		oldsigacts = p->p_sigacts;
 		newsigacts = sigacts_alloc();
 		sigacts_copy(newsigacts, oldsigacts);
-	} else
+	} else {
 		oldsigacts = NULL;
+		newsigacts = NULL; /* satisfy gcc */
+	}
 
 	PROC_LOCK(p);
 	if (oldsigacts)

-- 
Mateusz Guzik 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 16:36:41 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 981CE9ED;
 Tue,  1 Jul 2014 16:36:41 +0000 (UTC)
Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com
 [IPv6:2a00:1450:400c:c00::234])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 939B424E1;
 Tue,  1 Jul 2014 16:36:40 +0000 (UTC)
Received: by mail-wg0-f52.google.com with SMTP id x13so1093986wgg.35
 for ; Tue, 01 Jul 2014 09:36:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to
 :mime-version:content-type:content-transfer-encoding;
 bh=wajW2kBzdi6oE+ol2yorCyQhnz2oja8vEP36XlLRLBk=;
 b=CZVF8qvQ/sau516HhOvma3iGOfEpThhMP6pS/+t1X4a3XRDN5YmrRSevNkmwmbXcKc
 zQWD0VVdm2v5pnWTsBgfEw9KwBmmNOVxNR/MOem+UYaZe11S0ik4aVSwImvacpxnn5Av
 +l3/T753Qvd+DA5nEo+niYGyIzViL2w39bcNaApjN/bas6wJJ5zgpwtfxfbU6E1ftuFF
 6wTX+Ll6H+2Nmo7BPesHTtDSGB1IpJ7hx6xpF25QZ7cSLw8l/ACuwKbx6dde9LZOw/dG
 95rqbTWZOxzeXKImbF/dfGzgjuda590to/kr0mAqpghkUf1C2ksnHZh6AhwdYQtXgE3m
 CYRg==
X-Received: by 10.180.206.73 with SMTP id lm9mr38420782wic.54.1404232598821;
 Tue, 01 Jul 2014 09:36:38 -0700 (PDT)
Received: from ernst.home (p4FC0FE50.dip0.t-ipconnect.de. [79.192.254.80])
 by mx.google.com with ESMTPSA id cz4sm44948150wib.23.2014.07.01.09.36.37
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Tue, 01 Jul 2014 09:36:38 -0700 (PDT)
Date: Tue, 1 Jul 2014 18:36:35 +0200
From: Gary Jennejohn 
To: Mateusz Guzik 
Subject: Re: svn commit: r268074 - head/sys/kern
Message-ID: <20140701183635.59bcd412@ernst.home>
In-Reply-To: <20140701154111.GF26696@dft-labs.eu>
References: <201407010629.s616TFul082441@svn.freebsd.org>
 <201407010940.57602.jhb@freebsd.org>
 <20140701141920.GC26696@dft-labs.eu>
 <20140701170524.76e41d9a@ernst.home>
 <20140701154111.GF26696@dft-labs.eu>
Reply-To: gljennjohn@gmail.com
X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.17; amd64-portbld-freebsd11.0)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Mateusz Guzik ,
 John Baldwin 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 16:36:41 -0000

On Tue, 1 Jul 2014 17:41:12 +0200
Mateusz Guzik  wrote:

> On Tue, Jul 01, 2014 at 05:05:24PM +0200, Gary Jennejohn wrote:
> > On Tue, 1 Jul 2014 16:19:20 +0200
> > Mateusz Guzik  wrote:
> > 
> > > On Tue, Jul 01, 2014 at 09:40:57AM -0400, John Baldwin wrote:
> > > > On Tuesday, July 01, 2014 2:29:15 am Mateusz Guzik wrote:
> > > > > Modified: head/sys/kern/kern_sig.c
> > > > > 
> > > > ==============================================================================
> > > > > --- head/sys/kern/kern_sig.c	Tue Jul  1 06:23:48 2014	(r268073)
> > > > > +++ head/sys/kern/kern_sig.c	Tue Jul  1 06:29:15 2014	(r268074)
> > > > > @@ -3453,10 +3453,6 @@ sigacts_copy(struct sigacts *dest, struc
> > > > >  int
> > > > >  sigacts_shared(struct sigacts *ps)
> > > > >  {
> > > > > -	int shared;
> > > > >  
> > > > > -	mtx_lock(&ps->ps_mtx);
> > > > > -	shared = ps->ps_refcnt > 1;
> > > > > -	mtx_unlock(&ps->ps_mtx);
> > > > > -	return (shared);
> > > > > +	return (ps->ps_refcnt > 1);
> > > > >  }
> > > > 
> > > > You should KASSERT() in sigacts_shared that P_HADTHREADS is not set so that 
> > > > new code does not call this function unsafely in the future.
> > > > 
> > > 
> > > Looks more like !P_HADTHREADS || p->p_singlethread != NULL on the first
> > > sight, but yeah, I'll add an assertion.
> > > 
> > 
> > Also, please fix the build with gcc, which dies with an error that
> > newsigacts may be use unitialzed.
> > 
> > What I did was set both oldsigacts and newsigacts to NULL before this
> > line at around 622:
> > 
> > if (sigacts_share(p->p_sigacts)) {
> > 
> > which allowed me to remove the else branch for setting oldsigacts to
> > NULL.
> > 
> 
> Sorry for breakage.
> 
> Does the following fix the problem for you?
> 
> diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
> index 91d161d..dc4eb9b 100644
> --- a/sys/kern/kern_exec.c
> +++ b/sys/kern/kern_exec.c
> @@ -625,8 +625,10 @@ interpret:
>  		oldsigacts = p->p_sigacts;
>  		newsigacts = sigacts_alloc();
>  		sigacts_copy(newsigacts, oldsigacts);
> -	} else
> +	} else {
>  		oldsigacts = NULL;
> +		newsigacts = NULL; /* satisfy gcc */
> +	}
>  
>  	PROC_LOCK(p);
>  	if (oldsigacts)
> 

Yes, this also works.

-- 
Gary Jennejohn

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 16:52:42 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C69431C5;
 Tue,  1 Jul 2014 16:52:42 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B43402690;
 Tue,  1 Jul 2014 16:52:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61Gqg9J078226;
 Tue, 1 Jul 2014 16:52:42 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61GqfDT078222;
 Tue, 1 Jul 2014 16:52:41 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407011652.s61GqfDT078222@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 1 Jul 2014 16:52:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268103 - in head/sys/cam: ctl scsi
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 16:52:42 -0000

Author: mav
Date: Tue Jul  1 16:52:41 2014
New Revision: 268103
URL: http://svnweb.freebsd.org/changeset/base/268103

Log:
  Add support for REPORT TIMESTAMP command.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_cmd_table.c
  head/sys/cam/ctl/ctl_private.h
  head/sys/cam/scsi/scsi_all.h

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Tue Jul  1 16:01:48 2014	(r268102)
+++ head/sys/cam/ctl/ctl.c	Tue Jul  1 16:52:41 2014	(r268103)
@@ -7288,6 +7288,58 @@ ctl_report_supported_tmf(struct ctl_scsi
 }
 
 int
+ctl_report_timestamp(struct ctl_scsiio *ctsio)
+{
+	struct ctl_lun *lun;
+	struct scsi_report_timestamp *cdb;
+	struct scsi_report_timestamp_data *data;
+	struct timeval tv;
+	int64_t timestamp;
+	int retval;
+	int alloc_len, total_len;
+
+	CTL_DEBUG_PRINT(("ctl_report_timestamp\n"));
+
+	cdb = (struct scsi_report_timestamp *)ctsio->cdb;
+	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
+
+	retval = CTL_RETVAL_COMPLETE;
+
+	total_len = sizeof(struct scsi_report_timestamp_data);
+	alloc_len = scsi_4btoul(cdb->length);
+
+	ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO);
+
+	ctsio->kern_sg_entries = 0;
+
+	if (total_len < alloc_len) {
+		ctsio->residual = alloc_len - total_len;
+		ctsio->kern_data_len = total_len;
+		ctsio->kern_total_len = total_len;
+	} else {
+		ctsio->residual = 0;
+		ctsio->kern_data_len = alloc_len;
+		ctsio->kern_total_len = alloc_len;
+	}
+	ctsio->kern_data_resid = 0;
+	ctsio->kern_rel_offset = 0;
+
+	data = (struct scsi_report_timestamp_data *)ctsio->kern_data_ptr;
+	scsi_ulto2b(sizeof(*data) - 2, data->length);
+	data->origin = RTS_ORIG_OUTSIDE;
+	getmicrotime(&tv);
+	timestamp = (int64_t)tv.tv_sec * 1000 + tv.tv_usec / 1000;
+	scsi_ulto4b(timestamp >> 16, data->timestamp);
+	scsi_ulto2b(timestamp & 0xffff, &data->timestamp[4]);
+
+	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
+	ctsio->be_move_done = ctl_config_move_done;
+
+	ctl_datamove((union ctl_io *)ctsio);
+	return (retval);
+}
+
+int
 ctl_persistent_reserve_in(struct ctl_scsiio *ctsio)
 {
 	struct scsi_per_res_in *cdb;

Modified: head/sys/cam/ctl/ctl_cmd_table.c
==============================================================================
--- head/sys/cam/ctl/ctl_cmd_table.c	Tue Jul  1 16:01:48 2014	(r268102)
+++ head/sys/cam/ctl/ctl_cmd_table.c	Tue Jul  1 16:52:41 2014	(r268103)
@@ -309,7 +309,19 @@ const struct ctl_cmd_entry ctl_cmd_table
  CTL_LUN_PAT_NONE,
  12, {0x0d, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
 
-/* 0e-1f */
+/* 0E */
+{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
+
+/* 0F REPORT TIMESTAMP */
+{ctl_report_timestamp, CTL_SERIDX_MAIN_IN, CTL_CMD_FLAG_OK_ON_BOTH |
+					   CTL_CMD_FLAG_OK_ON_STOPPED |
+					   CTL_CMD_FLAG_OK_ON_INOPERABLE |
+					   CTL_CMD_FLAG_OK_ON_SECONDARY |
+					   CTL_FLAG_DATA_IN,
+ CTL_LUN_PAT_NONE,
+ 12, {0x0f, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
+
+/* 10-1f */
 };
 
 const struct ctl_cmd_entry ctl_cmd_table[256] =

Modified: head/sys/cam/ctl/ctl_private.h
==============================================================================
--- head/sys/cam/ctl/ctl_private.h	Tue Jul  1 16:01:48 2014	(r268102)
+++ head/sys/cam/ctl/ctl_private.h	Tue Jul  1 16:52:41 2014	(r268103)
@@ -501,6 +501,7 @@ int ctl_persistent_reserve_out(struct ct
 int ctl_report_tagret_port_groups(struct ctl_scsiio *ctsio);
 int ctl_report_supported_opcodes(struct ctl_scsiio *ctsio);
 int ctl_report_supported_tmf(struct ctl_scsiio *ctsio);
+int ctl_report_timestamp(struct ctl_scsiio *ctsio);
 int ctl_isc(struct ctl_scsiio *ctsio);
 
 #endif	/* _KERNEL */

Modified: head/sys/cam/scsi/scsi_all.h
==============================================================================
--- head/sys/cam/scsi/scsi_all.h	Tue Jul  1 16:01:48 2014	(r268102)
+++ head/sys/cam/scsi/scsi_all.h	Tue Jul  1 16:52:41 2014	(r268103)
@@ -1059,6 +1059,29 @@ struct scsi_report_supported_tmf_data
 	uint8_t  reserved[2];
 };
 
+struct scsi_report_timestamp
+{
+	uint8_t  opcode;
+	uint8_t  service_action;
+	uint8_t  reserved[4];
+	uint8_t  length[4];
+	uint8_t  reserved1;
+	uint8_t  control;
+};
+
+struct scsi_report_timestamp_data
+{
+	uint8_t  length[2];
+	uint8_t  origin;
+#define RTS_ORIG_MASK		0x00
+#define RTS_ORIG_ZERO		0x00
+#define RTS_ORIG_SET		0x02
+#define RTS_ORIG_OUTSIDE	0x03
+	uint8_t  reserved;
+	uint8_t  timestamp[6];
+	uint8_t  reserve2[2];
+};
+
 struct ata_pass_16 {
 	u_int8_t opcode;
 	u_int8_t protocol;

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 17:27:49 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0F5642C8;
 Tue,  1 Jul 2014 17:27:49 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id F189329BE;
 Tue,  1 Jul 2014 17:27:48 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61HRmmF093227;
 Tue, 1 Jul 2014 17:27:48 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61HRmY6093226;
 Tue, 1 Jul 2014 17:27:48 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201407011727.s61HRmY6093226@svn.freebsd.org>
From: Adrian Chadd 
Date: Tue, 1 Jul 2014 17:27:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268105 - head/sys/netinet
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 17:27:49 -0000

Author: adrian
Date: Tue Jul  1 17:27:48 2014
New Revision: 268105
URL: http://svnweb.freebsd.org/changeset/base/268105

Log:
  Remove old reference to IP_RSSCPUID.
  
  Submitted by:	Eggert, Lars 

Modified:
  head/sys/netinet/ip_output.c

Modified: head/sys/netinet/ip_output.c
==============================================================================
--- head/sys/netinet/ip_output.c	Tue Jul  1 17:16:59 2014	(r268104)
+++ head/sys/netinet/ip_output.c	Tue Jul  1 17:27:48 2014	(r268105)
@@ -1177,9 +1177,6 @@ ip_ctloutput(struct socket *so, struct s
 		case IP_RECVTOS:
 		case IP_FLOWID:
 		case IP_FLOWTYPE:
-#ifdef	RSS
-		case IP_RSSCPUID:
-#endif
 			switch (sopt->sopt_name) {
 
 			case IP_TOS:

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 18:07:23 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 60E0CA96;
 Tue,  1 Jul 2014 18:07:23 +0000 (UTC)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DA7E82D91;
 Tue,  1 Jul 2014 18:07:22 +0000 (UTC)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s61I7HK4059347
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Tue, 1 Jul 2014 21:07:17 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s61I7HK4059347
Received: (from kostik@localhost)
 by tom.home (8.14.9/8.14.9/Submit) id s61I7Ha1059346;
 Tue, 1 Jul 2014 21:07:17 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Tue, 1 Jul 2014 21:07:17 +0300
From: Konstantin Belousov 
To: Mateusz Guzik 
Subject: Re: svn commit: r268087 - head/sys/kern
Message-ID: <20140701180717.GS93733@kib.kiev.ua>
References: <201407010921.s619LXHL063077@svn.freebsd.org>
 
 <20140701143238.GD26696@dft-labs.eu>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="fbLRCyggVpgIMbCc"
Content-Disposition: inline
In-Reply-To: <20140701143238.GD26696@dft-labs.eu>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 autolearn_force=no version=3.4.0
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home
Cc: "svn-src-head@freebsd.org" ,
 Matthew Fleming ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" ,
 Mateusz Guzik 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 18:07:23 -0000


--fbLRCyggVpgIMbCc
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Jul 01, 2014 at 04:32:38PM +0200, Mateusz Guzik wrote:
> On Tue, Jul 01, 2014 at 07:07:28AM -0700, Matthew Fleming wrote:
> > On Tue, Jul 1, 2014 at 2:21 AM, Mateusz Guzik  wrote:
> > > Author: mjg
> > > Date: Tue Jul  1 09:21:32 2014
> > > New Revision: 268087
> > > URL: http://svnweb.freebsd.org/changeset/base/268087
> > >
> > > Log:
> > >   Don't call crcopysafe or uifind unnecessarily in execve.
> >=20
> > I'm not sure the code works.
> >=20
> > It gets a copy of the pointer p_ucred under the PROC_LOCK.  The
> > PROC_LOCK is released before newcred =3D crdup(oldcred) is called.  Thus
> > you may be copying an old version of the credentials if any of the
> > other functions that modify them run in the meantime.
> >=20
> > Maybe this can't happen because the process is single-threaded at the
> > time and all the other sets of p_ucred come via a syscall.  I didn't
> > look at all the functions in the kernel which set p_ucred.  But only
> > in the case that none of them can run during do_execve this code would
> > be safe.  In which case it at least deserves a comment indicating the
> > code is violating the normal locking and safety on p_ucred.
> >=20
>=20
> All other threads have to be blocked, otherwise there are more dangerous
> races - for instance we support sharing file descriptor tables, so
> execve makes sure to unshare the table (fdunshare()), which is
> especially important for suid binaries. If other threads could execute,
> they could fork off after fdunshare() and then have a table shared with
> now privileged process.
In fact, other threads can execute, just not in this process.
If rfork(2) was used, then the filedesc table can be shared, but
not the address space.

I somehow thought that you already ensured that this does not happen.
>=20
> That said, I can add appropriate comment + assertion at top of do_execve
> later, just wanted to note the code was assuming that the process is left
> alone prior to my changes.
>=20
> > Also, what is the motivation to avoid the crcopy?  Is there a
> > measurable performance impact?
> >=20
>=20
> It's just a minor cleanup.
>=20
> --=20
> Mateusz Guzik 

--fbLRCyggVpgIMbCc
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJTsvjUAAoJEJDCuSvBvK1B7ZoQAKCuVci2LNNImsU92e7kUUjY
CedqfbEwM90nAsIpDw9AIGj33i2U2pef4Wqd+SkK0VuEuU8YHfiGKhzHSSFQ923A
8cx8ujES70UNphADX+FxWEbZCbk2Sd/2MxDqq/kEUfZvtWewe+EnrELkxqX9oQAC
FRdOadUSftxTFGJEq6+kY232R0EgCISXd8wuN5z03WUqTJ4QC7XpBgo+Qc5TBfU+
aCcq1O7y5pEGE0Q0k3xxtqP3hZ6jxiLjTLNRFmoCZt+sVLyHl7QpJutQhOMnY4HP
chUajvsRMP59V/FkzcciI1bEjwa2HN8ocGMHpwhqF4YVBs5hgFRvUWnYgqGUS9EG
Ubr5Kvi0EXaIMIx4T3HVTO8e1s2Ls0SPSrHWHq7WhMFo8M7H5jWouPHNbdUth7EV
0UdCyxJ3hlIMugbTJtj6to9++5AijCDxAVRV8jWcWyOl7zp7m2jswHuR1DRxT3Gd
4uFT0PBq0L98CSKOi/QrEpWsPU5RRxzrZLx2ef3Pl+jXJxsFWROvRh2noYu6dUeg
a7tOZyFnptKSvlNqfvZetUPyRJRfiviW61LN/miGO0LYWsZr7/e4mH4RXEpNSr8E
DZs09icA690Sjt2k87SXJhMuxPWZSvhkVJinU0jSBnLB+tXh/bCy053B4hJ4Zzpr
0fkhT0oKpjJMt/qj34rx
=GaO8
-----END PGP SIGNATURE-----

--fbLRCyggVpgIMbCc--

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 18:09:08 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 53D45C01;
 Tue,  1 Jul 2014 18:09:08 +0000 (UTC)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CF0F82DA9;
 Tue,  1 Jul 2014 18:09:07 +0000 (UTC)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s61I93ug059379
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Tue, 1 Jul 2014 21:09:03 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s61I93ug059379
Received: (from kostik@localhost)
 by tom.home (8.14.9/8.14.9/Submit) id s61I93is059378;
 Tue, 1 Jul 2014 21:09:03 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Tue, 1 Jul 2014 21:09:03 +0300
From: Konstantin Belousov 
To: Mateusz Guzik 
Subject: Re: svn commit: r268087 - head/sys/kern
Message-ID: <20140701180903.GT93733@kib.kiev.ua>
References: <201407010921.s619LXHL063077@svn.freebsd.org>
 <20140701114245.GO93733@kib.kiev.ua>
 <20140701115612.GA26696@dft-labs.eu>
 <20140701123058.GP93733@kib.kiev.ua>
 <20140701125410.GB26696@dft-labs.eu>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="8i1mnYwBm74ExquZ"
Content-Disposition: inline
In-Reply-To: <20140701125410.GB26696@dft-labs.eu>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 autolearn_force=no version=3.4.0
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Mateusz Guzik 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 18:09:08 -0000


--8i1mnYwBm74ExquZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Jul 01, 2014 at 02:54:10PM +0200, Mateusz Guzik wrote:
> On Tue, Jul 01, 2014 at 03:30:58PM +0300, Konstantin Belousov wrote:
> > On Tue, Jul 01, 2014 at 01:56:12PM +0200, Mateusz Guzik wrote:
> > > That said I propose the following:
> > > diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
> > > index cce687b..9b3a99d 100644
> > > --- a/sys/kern/kern_exec.c
> > > +++ b/sys/kern/kern_exec.c
> > > @@ -716,11 +716,11 @@ interpret:
> > >  		VOP_UNLOCK(imgp->vp, 0);
> > >  		setugidsafety(td);
> > >  		error =3D fdcheckstd(td);
> > > -		vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
> > >  		if (error !=3D 0)
> > >  			goto done1;
> > >  		newcred =3D crdup(oldcred);
> > >  		euip =3D uifind(attr.va_uid);
> > > +		vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
> > >  		PROC_LOCK(p);
> > >  		/*
> > >  		 * Set the new credentials.
> > This is definitely fine.
> >=20
> > > @@ -764,7 +764,9 @@ interpret:
> > >  		if (oldcred->cr_svuid !=3D oldcred->cr_uid ||
> > >  		    oldcred->cr_svgid !=3D oldcred->cr_gid) {
> > >  			PROC_UNLOCK(p);
> > > +			VOP_UNLOCK(imgp->vp, 0);
> > >  			newcred =3D crdup(oldcred);
> > > +			vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
> > >  			PROC_LOCK(p);
> > >  			change_svuid(newcred, newcred->cr_uid);
> > >  			change_svgid(newcred, newcred->cr_gid);
> > Use of LK_RETRY is fine as far errors from  VOPs which actually perform
> > accesses to the vnode are checked.  It means that reclaimed vnode would
> > be detected later.
> >=20
> > In fact, could the vnode unlock moved much earlier, in particular,
> > to avoid the same unlock/lock in the pmc hook call ?  The only use
> > for the vnode after the VREF() is done, as I see, is to check
> > for MNT_NOSUID.  Can we test this earlier, and cache the result ?
> > I do not think that the possible race with flag changing under us
> > matter.
> >=20
>=20
> It is passed down to MAC (mac_vnode_execve_will_transition and
> mac_vnode_execve_transition) and then vfs_mark_atime.
And we can lock it only there.

>=20
> I don't see how to easily reorganize the code to simplify stuff and
> reduce relocking.
>=20
> > > @@ -841,6 +843,7 @@ interpret:
> > > =20
> > >  	SDT_PROBE(proc, kernel, , exec__success, args->fname, 0, 0, 0, 0);
> > > =20
> > > +	VOP_UNLOCK(imgp->vp, 0);
> > >  done1:
> > >  	/*
> > >  	 * Free any resources malloc'd earlier that we didn't use.
> > This change is fine but unrelated.  There is no harm of calling free()
> > while holding vnode lock.
> >=20
>=20
> I moved this unlock so that there is no need to lock the vnode after
> failed fdcheckstd, which would also require additional cleanup for
> newcred and euip.
>=20
> --=20
> Mateusz Guzik 

--8i1mnYwBm74ExquZ
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJTsvk+AAoJEJDCuSvBvK1BoAAP/is7K60DhgvmqVn7QP+rkxLP
X30Oe0Wd6yWjweVKL9XQrkHhrdUL4cryV8ZHTTpN5gnSPqOLaNkvNxCbc9bUd6gC
Ja4JD77ujnTAYkFhg+3h/mf74ZaP2R2GhLEqiij95pw9lYWo3HqjREw6tiwu9gpx
+9LbYASQnWvTtY/ihxTuw8b1pIM1IykcxzFZwYO17Ny2hD5cV7W+ylKGPVH3EkXD
Rh9+qnFuRWa0UtCrtgrVVI6c9fYySmNdZyevpUYSepSLqC6DZP+Ly3ppq93uJq2y
+6+aO2WGiecfkvqdWtEt7oDXQGflGx4XoZjfsgXYHkM6axv61/stFQBhFXJZnZ1W
t7ltyNVp1T/IAU15aGucZTYzOyPh0UukxaGPG9DdlXJ44OnEpQjMGSexhIqnayoa
XP5jctJebmkF0MSbfeJzdErTdMvXpkkB6uIol+WSXRLbaExd0niaFUzos+yYAOq9
MH41wHu5tPTqPXLLVUiwQM+t5b+vDd2TCDhg7NI1Q8M3mie+kTT9G5q8pOlrqRju
W+TLsOW+F27LOtQdhjJq+5dB/Ag5opvumA2IMmNeGc/4et1VvLNEjgwVwOXR3sH7
ZL2I2JYJG4H5Xc/cGhEVc3piQFcyPqKA2MvPGPm0jLggSx7gi0K7u3CLLJ692Pl5
U99ExJTppKEBJZIkgjhy
=rv5x
-----END PGP SIGNATURE-----

--8i1mnYwBm74ExquZ--

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 18:24:55 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3E9DA48F;
 Tue,  1 Jul 2014 18:24:55 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2CD8B2F52;
 Tue,  1 Jul 2014 18:24:55 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61IOt3Z022118;
 Tue, 1 Jul 2014 18:24:55 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61IOtdq022117;
 Tue, 1 Jul 2014 18:24:55 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201407011824.s61IOtdq022117@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 1 Jul 2014 18:24:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268109 - head/sys/dev/tws
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 18:24:55 -0000

Author: jhb
Date: Tue Jul  1 18:24:54 2014
New Revision: 268109
URL: http://svnweb.freebsd.org/changeset/base/268109

Log:
  Free the static DMA buffer holding the command ring during detach as well
  as if attach fails.

Modified:
  head/sys/dev/tws/tws.c

Modified: head/sys/dev/tws/tws.c
==============================================================================
--- head/sys/dev/tws/tws.c	Tue Jul  1 18:23:00 2014	(r268108)
+++ head/sys/dev/tws/tws.c	Tue Jul  1 18:24:54 2014	(r268109)
@@ -310,6 +310,12 @@ tws_attach(device_t dev)
 attach_fail_4:
     tws_teardown_intr(sc);
     destroy_dev(sc->tws_cdev);
+    if (sc->dma_mem_phys)
+	    bus_dmamap_unload(sc->cmd_tag, sc->cmd_map);
+    if (sc->dma_mem)
+	    bus_dmamem_free(sc->cmd_tag, sc->dma_mem, sc->cmd_map);
+    if (sc->cmd_tag)
+	    bus_dma_tag_destroy(sc->cmd_tag);
 attach_fail_3:
     for(i=0;iirqs;i++) {
         if ( sc->irq_res[i] ){
@@ -383,6 +389,13 @@ tws_detach(device_t dev)
 
     tws_cam_detach(sc);
 
+    if (sc->dma_mem_phys)
+	    bus_dmamap_unload(sc->cmd_tag, sc->cmd_map);
+    if (sc->dma_mem)
+	    bus_dmamem_free(sc->cmd_tag, sc->dma_mem, sc->cmd_map);
+    if (sc->cmd_tag)
+	    bus_dma_tag_destroy(sc->cmd_tag);
+
     /* Release memory resource */
     if ( sc->mfa_res ){
         if (bus_release_resource(sc->tws_dev,

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 18:26:30 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id BAE8A600;
 Tue,  1 Jul 2014 18:26:30 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A8EC82F6F;
 Tue,  1 Jul 2014 18:26:30 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61IQUHZ022446;
 Tue, 1 Jul 2014 18:26:30 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61IQUaf022445;
 Tue, 1 Jul 2014 18:26:30 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201407011826.s61IQUaf022445@svn.freebsd.org>
From: Glen Barber 
Date: Tue, 1 Jul 2014 18:26:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268110 - head/share/mk
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 18:26:30 -0000

Author: gjb
Date: Tue Jul  1 18:26:30 2014
New Revision: 268110
URL: http://svnweb.freebsd.org/changeset/base/268110

Log:
  Merge r267837 from ^/projects/release-debugdist:
    When building world when WITH_DEBUG_FILES is set,
    avoid building ar(1) archives with '-g'.
  
  Tested on:	head@r267801
  Reviewed by:	emaste, imp
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/share/mk/bsd.lib.mk

Modified: head/share/mk/bsd.lib.mk
==============================================================================
--- head/share/mk/bsd.lib.mk	Tue Jul  1 18:24:54 2014	(r268109)
+++ head/share/mk/bsd.lib.mk	Tue Jul  1 18:26:30 2014	(r268110)
@@ -45,7 +45,8 @@ STRIP?=	-s
 
 .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \
     empty(DEBUG_FLAGS:M-gdwarf*)
-CFLAGS+= -g
+SHARED_CFLAGS+= -g
+SHARED_CXXFLAGS+= -g
 CTFFLAGS+= -g
 .endif
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 19:04:05 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 596DEE04;
 Tue,  1 Jul 2014 19:04:05 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3A36C23A6;
 Tue,  1 Jul 2014 19:04:05 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61J45J5042109;
 Tue, 1 Jul 2014 19:04:05 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61J44DF042107;
 Tue, 1 Jul 2014 19:04:04 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201407011904.s61J44DF042107@svn.freebsd.org>
From: Glen Barber 
Date: Tue, 1 Jul 2014 19:04:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268111 - in head: . release
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 19:04:05 -0000

Author: gjb
Date: Tue Jul  1 19:04:04 2014
New Revision: 268111
URL: http://svnweb.freebsd.org/changeset/base/268111

Log:
  Merge ^/projects/release-debugdist into ^/head:
  r262491, r262493, r262516, r267345, r267397:
  
  r262491:
    Add DEBUG_DISTRIBUTIONS, and set it to include base and
    EXTRA_DISTRIBUTIONS, excluding 'doc', since the documentation
    distribution does not have corresponding debug information.
  
    Use DEBUG_DISTRIBUTIONS in the 'distributeworld installworld'
    and 'packageworld' targets, to reduce the number of occurances
    of excluding distributions that do not have .debug files.
  
  r262493:
    In release/Makefile, explicitly set WITHOUT_DEBUG_FILES=1
    for dvdrom and cdrom targets.  (Later reverted.)
  
    Exclude the *.debug.txz distributions from dvdrom and
    cdrom images, but include them for ftp distribution.
  
  r262516:
    Rename ${dist}.debug.txz to ${dist}-dbg.txz to prevent the
    following output:
  	eval: ${base....}: Bad substitution
  	eval: ${doc....}: Bad substitution
  	eval: ${games....}: Bad substitution
  	eval: ${lib32....}: Bad substitution
  
    This also follows other naming conventions seen in the
    wild.
  
  r267345:
    Explicitly set MK_DEBUG_FILES=no, which overrides the
    WITH_DEBUG_FILES=1 and WITHOUT_DEBUG_FILES=1 collisions
    previously experienced.
  
    This change allows us to create the {base,kernel}_debug.txz
    distributions without accidentally installing the *.debug
    files on the medium itself.
  
  r267397:
    Remove evaluations of MK_DEBUG_FILES where not needed.
    If DEBUG_DISTRIBUTIONS is empty, which is true if
    MK_DEBUG_FILES evaluates to 'no' above, the loop does
    nothing.
  
  MFC after:	1 month
  Tested on:	head@r267801
  Reviewed by:	brooks [1], emaste, imp [1]
  		[1] earlier version
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/Makefile.inc1
  head/release/Makefile

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Tue Jul  1 18:26:30 2014	(r268110)
+++ head/Makefile.inc1	Tue Jul  1 19:04:04 2014	(r268111)
@@ -782,6 +782,11 @@ EXTRA_DISTRIBUTIONS+=	lib32
 EXTRA_DISTRIBUTIONS+=	tests
 .endif
 
+DEBUG_DISTRIBUTIONS=
+.if ${MK_DEBUG_FILES} != "no"
+DEBUG_DISTRIBUTIONS+=	base ${EXTRA_DISTRIBUTIONS:S,doc,,}
+.endif
+
 MTREE_MAGIC?=	mtree 2.0
 
 distributeworld installworld: _installcheck_world
@@ -858,8 +863,7 @@ distributeworld installworld: _installch
 	awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \
 	${DESTDIR}/${DISTDIR}/${dist}.meta
 .endfor
-.if ${MK_DEBUG_FILES} != "no"
-. for dist in base ${EXTRA_DISTRIBUTIONS}
+.for dist in ${DEBUG_DISTRIBUTIONS}
 	@# For each file that exists in this dist, print the corresponding
 	@# line from the METALOG.  This relies on the fact that
 	@# a line containing only the filename will sort immediatly before
@@ -868,8 +872,7 @@ distributeworld installworld: _installch
 	find ./${dist}/usr/lib/debug | sort -u ${METALOG} - | \
 	awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \
 	${DESTDIR}/${DISTDIR}/${dist}.debug.meta
-. endfor
-.endif
+.endfor
 .endif
 .endif
 
@@ -887,19 +890,17 @@ packageworld:
 .endif
 .endfor
 
-.if ${MK_DEBUG_FILES} != "no"
-. for dist in base ${EXTRA_DISTRIBUTIONS}
-.  if defined(NO_ROOT)
+.for dist in ${DEBUG_DISTRIBUTIONS}
+. if defined(NO_ROOT)
 	${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
-	    tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.debug.txz \
+	    tar cvJf ${DESTDIR}/${DISTDIR}/${dist}-dbg.txz \
 	    @${DESTDIR}/${DISTDIR}/${dist}.debug.meta
-.  else
+. else
 	${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
-	    tar cvJfL ${DESTDIR}/${DISTDIR}/${dist}.debug.txz \
+	    tar cvJfL ${DESTDIR}/${DISTDIR}/${dist}-dbg.txz \
 	    usr/lib/debug
-.  endif
-. endfor
-.endif
+. endif
+.endfor
 
 #
 # reinstall

Modified: head/release/Makefile
==============================================================================
--- head/release/Makefile	Tue Jul  1 18:26:30 2014	(r268110)
+++ head/release/Makefile	Tue Jul  1 19:04:04 2014	(r268111)
@@ -155,10 +155,13 @@ system: packagesystem
 	mkdir -p release
 	cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \
 		DESTDIR=${.OBJDIR}/release MK_RESCUE=no MK_KERNEL_SYMBOLS=no \
-		MK_PROFILE=no MK_SENDMAIL=no MK_TESTS=no MK_LIB32=no
+		MK_PROFILE=no MK_SENDMAIL=no MK_TESTS=no MK_LIB32=no \
+		MK_DEBUG_FILES=no
 # Copy distfiles
 	mkdir -p release/usr/freebsd-dist
-	cp *.txz MANIFEST release/usr/freebsd-dist
+	for dist in MANIFEST $$(ls *.txz | grep -v -- '-dbg'); \
+	    do cp $${dist} release/usr/freebsd-dist; \
+	done
 # Copy documentation, if generated
 .if !defined(NODOC)
 	cp reldoc/* release
@@ -180,7 +183,7 @@ bootonly: packagesystem
 	    MK_INSTALLLIB=no MK_LIB32=no MK_MAIL=no \
 	    MK_NCP=no MK_TOOLCHAIN=no MK_PROFILE=no \
 	    MK_INSTALLIB=no MK_RESCUE=no MK_DICT=no \
-	    MK_KERNEL_SYMBOLS=no MK_TESTS=no
+	    MK_KERNEL_SYMBOLS=no MK_TESTS=no MK_DEBUG_FILES=no
 # Copy manifest only (no distfiles) to get checksums
 	mkdir -p bootonly/usr/freebsd-dist
 	cp MANIFEST bootonly/usr/freebsd-dist
@@ -200,10 +203,12 @@ dvd:
 	mkdir -p ${.TARGET}
 	cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \
 		DESTDIR=${.OBJDIR}/${.TARGET} MK_RESCUE=no MK_KERNEL_SYMBOLS=no \
-		MK_TESTS=no
+		MK_TESTS=no MK_DEBUG_FILES=no
 # Copy distfiles
 	mkdir -p ${.TARGET}/usr/freebsd-dist
-	cp *.txz MANIFEST ${.TARGET}/usr/freebsd-dist
+	for dist in MANIFEST $$(ls *.txz | grep -v -- '-dbg'); \
+	    do cp $${dist} ${.TARGET}/usr/freebsd-dist; \
+	done
 # Copy documentation, if generated
 .if !defined(NODOC)
 	cp reldoc/* ${.TARGET}

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 19:50:47 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 920DB21F;
 Tue,  1 Jul 2014 19:50:47 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 739F527D5;
 Tue,  1 Jul 2014 19:50:47 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61Jol0j064132;
 Tue, 1 Jul 2014 19:50:47 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61JolsV064131;
 Tue, 1 Jul 2014 19:50:47 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201407011950.s61JolsV064131@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Tue, 1 Jul 2014 19:50:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268113 - head/sys/dev/bge
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 19:50:47 -0000

Author: marcel
Date: Tue Jul  1 19:50:47 2014
New Revision: 268113
URL: http://svnweb.freebsd.org/changeset/base/268113

Log:
  Convert bge(4) to use the driver API.
  
  Submitted by:   Sreekanth Rupavatharam 
  Obtained from:  Juniper Networks, Inc.

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c	Tue Jul  1 19:11:00 2014	(r268112)
+++ head/sys/dev/bge/if_bge.c	Tue Jul  1 19:50:47 2014	(r268113)
@@ -422,18 +422,18 @@ static int bge_encap(struct bge_softc *,
 static void bge_intr(void *);
 static int bge_msi_intr(void *);
 static void bge_intr_task(void *, int);
-static void bge_start_locked(struct ifnet *);
-static void bge_start(struct ifnet *);
-static int bge_ioctl(struct ifnet *, u_long, caddr_t);
+static void bge_start_locked(if_t);
+static void bge_start(if_t);
+static int bge_ioctl(if_t, u_long, caddr_t);
 static void bge_init_locked(struct bge_softc *);
 static void bge_init(void *);
 static void bge_stop_block(struct bge_softc *, bus_size_t, uint32_t);
 static void bge_stop(struct bge_softc *);
 static void bge_watchdog(struct bge_softc *);
 static int bge_shutdown(device_t);
-static int bge_ifmedia_upd_locked(struct ifnet *);
-static int bge_ifmedia_upd(struct ifnet *);
-static void bge_ifmedia_sts(struct ifnet *, struct ifmediareq *);
+static int bge_ifmedia_upd_locked(if_t);
+static int bge_ifmedia_upd(if_t);
+static void bge_ifmedia_sts(if_t, struct ifmediareq *);
 
 static uint8_t bge_nvram_getbyte(struct bge_softc *, int, uint8_t *);
 static int bge_read_nvram(struct bge_softc *, caddr_t, int, int);
@@ -474,7 +474,7 @@ static int bge_miibus_readreg(device_t, 
 static int bge_miibus_writereg(device_t, int, int, int);
 static void bge_miibus_statchg(device_t);
 #ifdef DEVICE_POLLING
-static int bge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count);
+static int bge_poll(if_t ifp, enum poll_cmd cmd, int count);
 #endif
 
 #define	BGE_RESET_SHUTDOWN	0
@@ -1244,7 +1244,7 @@ bge_miibus_statchg(device_t dev)
 	uint32_t mac_mode, rx_mode, tx_mode;
 
 	sc = device_get_softc(dev);
-	if ((sc->bge_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+	if ((if_getdrvflags(sc->bge_ifp) & IFF_DRV_RUNNING) == 0)
 		return;
 	mii = device_get_softc(sc->bge_miibus);
 
@@ -1320,7 +1320,7 @@ bge_newbuf_std(struct bge_softc *sc, int
 	int error, nsegs;
 
 	if (sc->bge_flags & BGE_FLAG_JUMBO_STD &&
-	    (sc->bge_ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN +
+	    (if_getmtu(sc->bge_ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN +
 	    ETHER_VLAN_ENCAP_LEN > (MCLBYTES - ETHER_ALIGN))) {
 		m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES);
 		if (m == NULL)
@@ -1598,14 +1598,14 @@ bge_init_tx_ring(struct bge_softc *sc)
 static void
 bge_setpromisc(struct bge_softc *sc)
 {
-	struct ifnet *ifp;
+	if_t ifp;
 
 	BGE_LOCK_ASSERT(sc);
 
 	ifp = sc->bge_ifp;
 
 	/* Enable or disable promiscuous mode as needed. */
-	if (ifp->if_flags & IFF_PROMISC)
+	if (if_getflags(ifp) & IFF_PROMISC)
 		BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_RX_PROMISC);
 	else
 		BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_RX_PROMISC);
@@ -1614,16 +1614,27 @@ bge_setpromisc(struct bge_softc *sc)
 static void
 bge_setmulti(struct bge_softc *sc)
 {
-	struct ifnet *ifp;
-	struct ifmultiaddr *ifma;
+	if_t ifp;
+	int mc_count = 0;
 	uint32_t hashes[4] = { 0, 0, 0, 0 };
-	int h, i;
+	int h, i, mcnt;
+	unsigned char *mta;
 
 	BGE_LOCK_ASSERT(sc);
 
 	ifp = sc->bge_ifp;
 
-	if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
+	mc_count = if_multiaddr_count(ifp, -1);
+	mta = malloc(sizeof(unsigned char) *  ETHER_ADDR_LEN *
+	    mc_count, M_DEVBUF, M_NOWAIT);
+
+	if(mta == NULL) {
+		device_printf(sc->bge_dev, 
+		    "Failed to allocated temp mcast list\n");
+		return;
+	}
+
+	if (if_getflags(ifp) & IFF_ALLMULTI || if_getflags(ifp) & IFF_PROMISC) {
 		for (i = 0; i < 4; i++)
 			CSR_WRITE_4(sc, BGE_MAR0 + (i * 4), 0xFFFFFFFF);
 		return;
@@ -1633,32 +1644,30 @@ bge_setmulti(struct bge_softc *sc)
 	for (i = 0; i < 4; i++)
 		CSR_WRITE_4(sc, BGE_MAR0 + (i * 4), 0);
 
-	/* Now program new ones. */
-	if_maddr_rlock(ifp);
-	TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
-		if (ifma->ifma_addr->sa_family != AF_LINK)
-			continue;
+	if_multiaddr_array(ifp, mta, &mcnt, mc_count);
+	for(i = 0; i < mcnt; i++) {
 		h = ether_crc32_le(LLADDR((struct sockaddr_dl *)
-		    ifma->ifma_addr), ETHER_ADDR_LEN) & 0x7F;
+		    (mta + (i * ETHER_ADDR_LEN))), ETHER_ADDR_LEN) & 0x7F;
 		hashes[(h & 0x60) >> 5] |= 1 << (h & 0x1F);
 	}
-	if_maddr_runlock(ifp);
 
 	for (i = 0; i < 4; i++)
 		CSR_WRITE_4(sc, BGE_MAR0 + (i * 4), hashes[i]);
+
+	free(mta, M_DEVBUF);
 }
 
 static void
 bge_setvlan(struct bge_softc *sc)
 {
-	struct ifnet *ifp;
+	if_t ifp;
 
 	BGE_LOCK_ASSERT(sc);
 
 	ifp = sc->bge_ifp;
 
 	/* Enable or disable VLAN tag stripping as needed. */
-	if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING)
+	if (if_getcapenable(ifp) & IFCAP_VLAN_HWTAGGING)
 		BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_RX_KEEP_VLAN_DIAG);
 	else
 		BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_RX_KEEP_VLAN_DIAG);
@@ -1994,7 +2003,7 @@ bge_blockinit(struct bge_softc *sc)
 	/* Configure mbuf pool watermarks */
 	if (BGE_IS_5717_PLUS(sc)) {
 		CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x0);
-		if (sc->bge_ifp->if_mtu > ETHERMTU) {
+		if (if_getmtu(sc->bge_ifp) > ETHERMTU) {
 			CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x7e);
 			CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0xea);
 		} else {
@@ -3294,7 +3303,7 @@ bge_devinfo(struct bge_softc *sc)
 static int
 bge_attach(device_t dev)
 {
-	struct ifnet *ifp;
+	if_t ifp;
 	struct bge_softc *sc;
 	uint32_t hwcfg = 0, misccfg, pcistate;
 	u_char eaddr[ETHER_ADDR_LEN];
@@ -3723,28 +3732,27 @@ bge_attach(device_t dev)
 		error = ENXIO;
 		goto fail;
 	}
-	ifp->if_softc = sc;
+	if_setsoftc(ifp, sc);
 	if_initname(ifp, device_get_name(dev), device_get_unit(dev));
-	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
-	ifp->if_ioctl = bge_ioctl;
-	ifp->if_start = bge_start;
-	ifp->if_init = bge_init;
-	ifp->if_snd.ifq_drv_maxlen = BGE_TX_RING_CNT - 1;
-	IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen);
-	IFQ_SET_READY(&ifp->if_snd);
-	ifp->if_hwassist = sc->bge_csum_features;
-	ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING |
-	    IFCAP_VLAN_MTU;
+	if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST);
+	if_setioctlfn(ifp, bge_ioctl);
+	if_setstartfn(ifp, bge_start);
+	if_setinitfn(ifp, bge_init);
+	if_setsendqlen(ifp, BGE_TX_RING_CNT);
+	if_setsendqready(ifp);
+	if_sethwassist(ifp, sc->bge_csum_features);
+	if_setcapabilities(ifp, IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING |
+	    IFCAP_VLAN_MTU);
 	if ((sc->bge_flags & (BGE_FLAG_TSO | BGE_FLAG_TSO3)) != 0) {
-		ifp->if_hwassist |= CSUM_TSO;
-		ifp->if_capabilities |= IFCAP_TSO4 | IFCAP_VLAN_HWTSO;
+		if_sethwassistbits(ifp, CSUM_TSO, 0);
+		if_setcapabilitiesbit(ifp, IFCAP_TSO4 | IFCAP_VLAN_HWTSO, 0);
 	}
 #ifdef IFCAP_VLAN_HWCSUM
-	ifp->if_capabilities |= IFCAP_VLAN_HWCSUM;
+	if_setcapabilitiesbit(ifp, IFCAP_VLAN_HWCSUM, 0);
 #endif
-	ifp->if_capenable = ifp->if_capabilities;
+	if_setcapenable(ifp, if_getcapabilities(ifp));
 #ifdef DEVICE_POLLING
-	ifp->if_capabilities |= IFCAP_POLLING;
+	if_setcapabilitiesbit(ifp, IFCAP_POLLING, 0);
 #endif
 
 	/*
@@ -3752,9 +3760,9 @@ bge_attach(device_t dev)
 	 * to hardware bugs.
 	 */
 	if (sc->bge_chipid == BGE_CHIPID_BCM5700_B0) {
-		ifp->if_capabilities &= ~IFCAP_HWCSUM;
-		ifp->if_capenable &= ~IFCAP_HWCSUM;
-		ifp->if_hwassist = 0;
+		if_setcapabilitiesbit(ifp, 0, IFCAP_HWCSUM);
+		if_setcapenablebit(ifp, 0, IFCAP_HWCSUM);
+		if_sethwassist(ifp, 0);
 	}
 
 	/*
@@ -3829,7 +3837,7 @@ bge_attach(device_t dev)
 		sc->bge_phy_flags |= BGE_PHY_NO_WIRESPEED;
 
 	if (sc->bge_flags & BGE_FLAG_TBI) {
-		ifmedia_init(&sc->bge_ifmedia, IFM_IMASK, bge_ifmedia_upd,
+		ifmedia_init_drv(&sc->bge_ifmedia, IFM_IMASK, bge_ifmedia_upd,
 		    bge_ifmedia_sts);
 		ifmedia_add(&sc->bge_ifmedia, IFM_ETHER | IFM_1000_SX, 0, NULL);
 		ifmedia_add(&sc->bge_ifmedia, IFM_ETHER | IFM_1000_SX | IFM_FDX,
@@ -3850,9 +3858,10 @@ bge_attach(device_t dev)
 again:
 		bge_asf_driver_up(sc);
 
-		error = mii_attach(dev, &sc->bge_miibus, ifp, bge_ifmedia_upd,
-		    bge_ifmedia_sts, capmask, sc->bge_phy_addr, MII_OFFSET_ANY,
-		    MIIF_DOPAUSE);
+		error = mii_attach(dev, &sc->bge_miibus, ifp, 
+		    (ifm_change_cb_t)bge_ifmedia_upd,
+		    (ifm_stat_cb_t)bge_ifmedia_sts, capmask, sc->bge_phy_addr, 
+		    MII_OFFSET_ANY, MIIF_DOPAUSE);
 		if (error != 0) {
 			if (trys++ < 4) {
 				device_printf(sc->bge_dev, "Try again\n");
@@ -3889,7 +3898,7 @@ again:
 	ether_ifattach(ifp, eaddr);
 
 	/* Tell upper layer we support long frames. */
-	ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
+	if_setifheaderlen(ifp, sizeof(struct ether_vlan_header));
 
 	/*
 	 * Hookup IRQ last.
@@ -3936,13 +3945,13 @@ static int
 bge_detach(device_t dev)
 {
 	struct bge_softc *sc;
-	struct ifnet *ifp;
+	if_t ifp;
 
 	sc = device_get_softc(dev);
 	ifp = sc->bge_ifp;
 
 #ifdef DEVICE_POLLING
-	if (ifp->if_capenable & IFCAP_POLLING)
+	if (if_getcapenable(ifp) & IFCAP_POLLING)
 		ether_poll_deregister(ifp);
 #endif
 
@@ -4298,7 +4307,7 @@ bge_rxreuse_jumbo(struct bge_softc *sc, 
 static int
 bge_rxeof(struct bge_softc *sc, uint16_t rx_prod, int holdlck)
 {
-	struct ifnet *ifp;
+	if_t ifp;
 	int rx_npkts = 0, stdcnt = 0, jumbocnt = 0;
 	uint16_t rx_cons;
 
@@ -4315,8 +4324,8 @@ bge_rxeof(struct bge_softc *sc, uint16_t
 	bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag,
 	    sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_POSTWRITE);
 	if (BGE_IS_JUMBO_CAPABLE(sc) &&
-	    ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN >
-	    (MCLBYTES - ETHER_ALIGN))
+	    if_getmtu(ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN + 
+	    ETHER_VLAN_ENCAP_LEN > (MCLBYTES - ETHER_ALIGN))
 		bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag,
 		    sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_POSTWRITE);
 
@@ -4328,7 +4337,7 @@ bge_rxeof(struct bge_softc *sc, uint16_t
 		int			have_tag = 0;
 
 #ifdef DEVICE_POLLING
-		if (ifp->if_capenable & IFCAP_POLLING) {
+		if (if_getcapenable(ifp) & IFCAP_POLLING) {
 			if (sc->rxcycles <= 0)
 				break;
 			sc->rxcycles--;
@@ -4340,7 +4349,7 @@ bge_rxeof(struct bge_softc *sc, uint16_t
 		rxidx = cur_rx->bge_idx;
 		BGE_INC(rx_cons, sc->bge_return_ring_cnt);
 
-		if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING &&
+		if (if_getcapenable(ifp) & IFCAP_VLAN_HWTAGGING &&
 		    cur_rx->bge_flags & BGE_RXBDFLAG_VLAN_TAG) {
 			have_tag = 1;
 			vlan_tag = cur_rx->bge_vlan_tag;
@@ -4355,7 +4364,7 @@ bge_rxeof(struct bge_softc *sc, uint16_t
 			}
 			if (bge_newbuf_jumbo(sc, rxidx) != 0) {
 				bge_rxreuse_jumbo(sc, rxidx);
-				ifp->if_iqdrops++;
+				if_inciqdrops(ifp, 1);
 				continue;
 			}
 			BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT);
@@ -4368,13 +4377,13 @@ bge_rxeof(struct bge_softc *sc, uint16_t
 			}
 			if (bge_newbuf_std(sc, rxidx) != 0) {
 				bge_rxreuse_std(sc, rxidx);
-				ifp->if_iqdrops++;
+				if_inciqdrops(ifp, 1);
 				continue;
 			}
 			BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT);
 		}
 
-		ifp->if_ipackets++;
+		if_incipackets(ifp, 1);
 #ifndef __NO_STRICT_ALIGNMENT
 		/*
 		 * For architectures with strict alignment we must make sure
@@ -4389,7 +4398,7 @@ bge_rxeof(struct bge_softc *sc, uint16_t
 		m->m_pkthdr.len = m->m_len = cur_rx->bge_len - ETHER_CRC_LEN;
 		m->m_pkthdr.rcvif = ifp;
 
-		if (ifp->if_capenable & IFCAP_RXCSUM)
+		if (if_getcapenable(ifp) & IFCAP_RXCSUM)
 			bge_rxcsum(sc, cur_rx, m);
 
 		/*
@@ -4403,13 +4412,13 @@ bge_rxeof(struct bge_softc *sc, uint16_t
 
 		if (holdlck != 0) {
 			BGE_UNLOCK(sc);
-			(*ifp->if_input)(ifp, m);
+			if_input(ifp, m);
 			BGE_LOCK(sc);
 		} else
-			(*ifp->if_input)(ifp, m);
+			if_input(ifp, m);
 		rx_npkts++;
 
-		if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
+		if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING))
 			return (rx_npkts);
 	}
 
@@ -4437,7 +4446,7 @@ bge_rxeof(struct bge_softc *sc, uint16_t
 	 * If you need correct statistics, you can enable this check.
 	 */
 	if (BGE_IS_5705_PLUS(sc))
-		ifp->if_ierrors += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_DROPS);
+		if_incierrors(ifp, CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_DROPS));
 #endif
 	return (rx_npkts);
 }
@@ -4481,7 +4490,7 @@ static void
 bge_txeof(struct bge_softc *sc, uint16_t tx_cons)
 {
 	struct bge_tx_bd *cur_tx;
-	struct ifnet *ifp;
+	if_t ifp;
 
 	BGE_LOCK_ASSERT(sc);
 
@@ -4503,7 +4512,7 @@ bge_txeof(struct bge_softc *sc, uint16_t
 		idx = sc->bge_tx_saved_considx;
 		cur_tx = &sc->bge_ldata.bge_tx_ring[idx];
 		if (cur_tx->bge_flags & BGE_TXBDFLAG_END)
-			ifp->if_opackets++;
+			if_incopackets(ifp, 1);
 		if (sc->bge_cdata.bge_tx_chain[idx] != NULL) {
 			bus_dmamap_sync(sc->bge_cdata.bge_tx_mtag,
 			    sc->bge_cdata.bge_tx_dmamap[idx],
@@ -4517,22 +4526,22 @@ bge_txeof(struct bge_softc *sc, uint16_t
 		BGE_INC(sc->bge_tx_saved_considx, BGE_TX_RING_CNT);
 	}
 
-	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
+	if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE);
 	if (sc->bge_txcnt == 0)
 		sc->bge_timer = 0;
 }
 
 #ifdef DEVICE_POLLING
 static int
-bge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
+bge_poll(if_t ifp, enum poll_cmd cmd, int count)
 {
-	struct bge_softc *sc = ifp->if_softc;
+	struct bge_softc *sc = if_getsoftc(ifp);
 	uint16_t rx_prod, tx_cons;
 	uint32_t statusword;
 	int rx_npkts = 0;
 
 	BGE_LOCK(sc);
-	if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
+	if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING)) {
 		BGE_UNLOCK(sc);
 		return (rx_npkts);
 	}
@@ -4564,12 +4573,12 @@ bge_poll(struct ifnet *ifp, enum poll_cm
 
 	sc->rxcycles = count;
 	rx_npkts = bge_rxeof(sc, rx_prod, 1);
-	if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
+	if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING)) {
 		BGE_UNLOCK(sc);
 		return (rx_npkts);
 	}
 	bge_txeof(sc, tx_cons);
-	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
+	if (!if_sendq_empty(ifp))
 		bge_start_locked(ifp);
 
 	BGE_UNLOCK(sc);
@@ -4595,7 +4604,7 @@ static void
 bge_intr_task(void *arg, int pending)
 {
 	struct bge_softc *sc;
-	struct ifnet *ifp;
+	if_t ifp;
 	uint32_t status, status_tag;
 	uint16_t rx_prod, tx_cons;
 
@@ -4603,7 +4612,7 @@ bge_intr_task(void *arg, int pending)
 	ifp = sc->bge_ifp;
 
 	BGE_LOCK(sc);
-	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
+	if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) {
 		BGE_UNLOCK(sc);
 		return;
 	}
@@ -4632,17 +4641,17 @@ bge_intr_task(void *arg, int pending)
 	/* Let controller work. */
 	bge_writembx(sc, BGE_MBX_IRQ0_LO, status_tag);
 
-	if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
+	if (if_getdrvflags(ifp) & IFF_DRV_RUNNING &&
 	    sc->bge_rx_saved_considx != rx_prod) {
 		/* Check RX return ring producer/consumer. */
 		BGE_UNLOCK(sc);
 		bge_rxeof(sc, rx_prod, 0);
 		BGE_LOCK(sc);
 	}
-	if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+	if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
 		/* Check TX ring producer/consumer. */
 		bge_txeof(sc, tx_cons);
-		if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
+		if (!if_sendq_empty(ifp))
 			bge_start_locked(ifp);
 	}
 	BGE_UNLOCK(sc);
@@ -4652,7 +4661,7 @@ static void
 bge_intr(void *xsc)
 {
 	struct bge_softc *sc;
-	struct ifnet *ifp;
+	if_t ifp;
 	uint32_t statusword;
 	uint16_t rx_prod, tx_cons;
 
@@ -4663,7 +4672,7 @@ bge_intr(void *xsc)
 	ifp = sc->bge_ifp;
 
 #ifdef DEVICE_POLLING
-	if (ifp->if_capenable & IFCAP_POLLING) {
+	if (if_getcapenable(ifp) & IFCAP_POLLING) {
 		BGE_UNLOCK(sc);
 		return;
 	}
@@ -4712,18 +4721,18 @@ bge_intr(void *xsc)
 	    statusword || sc->bge_link_evt)
 		bge_link_upd(sc);
 
-	if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+	if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
 		/* Check RX return ring producer/consumer. */
 		bge_rxeof(sc, rx_prod, 1);
 	}
 
-	if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+	if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
 		/* Check TX ring producer/consumer. */
 		bge_txeof(sc, tx_cons);
 	}
 
-	if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
-	    !IFQ_DRV_IS_EMPTY(&ifp->if_snd))
+	if (if_getdrvflags(ifp) & IFF_DRV_RUNNING &&
+	    !if_sendq_empty(ifp))
 		bge_start_locked(ifp);
 
 	BGE_UNLOCK(sc);
@@ -4787,7 +4796,7 @@ bge_tick(void *xsc)
 		 */
 #ifdef DEVICE_POLLING
 		/* In polling mode we poll link state in bge_poll(). */
-		if (!(sc->bge_ifp->if_capenable & IFCAP_POLLING))
+		if (!(sc->bge_if_getcapenable(ifp) & IFCAP_POLLING))
 #endif
 		{
 		sc->bge_link_evt++;
@@ -4808,7 +4817,7 @@ bge_tick(void *xsc)
 static void
 bge_stats_update_regs(struct bge_softc *sc)
 {
-	struct ifnet *ifp;
+	if_t ifp;
 	struct bge_mac_stats *stats;
 	uint32_t val;
 
@@ -4908,9 +4917,9 @@ bge_stats_update_regs(struct bge_softc *
 	stats->RecvThresholdHit +=
 	    CSR_READ_4(sc, BGE_RXLP_LOCSTAT_RXTHRESH_HIT);
 
-	ifp->if_collisions = (u_long)stats->etherStatsCollisions;
-	ifp->if_ierrors = (u_long)(stats->NoMoreRxBDs + stats->InputDiscards +
-	    stats->InputErrors);
+	if_setcollisions(ifp, (u_long)stats->etherStatsCollisions);
+	if_setierrors(ifp, (u_long)(stats->NoMoreRxBDs + stats->InputDiscards +
+	    stats->InputErrors));
 
 	if (sc->bge_flags & BGE_FLAG_RDMA_BUG) {
 		/*
@@ -4976,7 +4985,7 @@ bge_stats_clear_regs(struct bge_softc *s
 static void
 bge_stats_update(struct bge_softc *sc)
 {
-	struct ifnet *ifp;
+	if_t ifp;
 	bus_size_t stats;
 	uint32_t cnt;	/* current register value */
 
@@ -4988,21 +4997,21 @@ bge_stats_update(struct bge_softc *sc)
 	CSR_READ_4(sc, stats + offsetof(struct bge_stats, stat))
 
 	cnt = READ_STAT(sc, stats, txstats.etherStatsCollisions.bge_addr_lo);
-	ifp->if_collisions += (uint32_t)(cnt - sc->bge_tx_collisions);
+	if_inccollisions(ifp, (uint32_t)(cnt - sc->bge_tx_collisions));
 	sc->bge_tx_collisions = cnt;
 
 	cnt = READ_STAT(sc, stats, nicNoMoreRxBDs.bge_addr_lo);
-	ifp->if_ierrors += (uint32_t)(cnt - sc->bge_rx_nobds);
+	if_incierrors(ifp, (uint32_t)(cnt - sc->bge_rx_nobds));
 	sc->bge_rx_nobds = cnt;
 	cnt = READ_STAT(sc, stats, ifInErrors.bge_addr_lo);
-	ifp->if_ierrors += (uint32_t)(cnt - sc->bge_rx_inerrs);
+	if_incierrors(ifp, (uint32_t)(cnt - sc->bge_rx_inerrs));
 	sc->bge_rx_inerrs = cnt;
 	cnt = READ_STAT(sc, stats, ifInDiscards.bge_addr_lo);
-	ifp->if_ierrors += (uint32_t)(cnt - sc->bge_rx_discards);
+	if_incierrors(ifp, (uint32_t)(cnt - sc->bge_rx_discards));
 	sc->bge_rx_discards = cnt;
 
 	cnt = READ_STAT(sc, stats, txstats.ifOutDiscards.bge_addr_lo);
-	ifp->if_oerrors += (uint32_t)(cnt - sc->bge_tx_discards);
+	if_incoerrors(ifp, (uint32_t)(cnt - sc->bge_tx_discards));
 	sc->bge_tx_discards = cnt;
 
 #undef	READ_STAT
@@ -5329,29 +5338,29 @@ bge_encap(struct bge_softc *sc, struct m
  * to the mbuf data regions directly in the transmit descriptors.
  */
 static void
-bge_start_locked(struct ifnet *ifp)
+bge_start_locked(if_t ifp)
 {
 	struct bge_softc *sc;
 	struct mbuf *m_head;
 	uint32_t prodidx;
 	int count;
 
-	sc = ifp->if_softc;
+	sc = if_getsoftc(ifp);
 	BGE_LOCK_ASSERT(sc);
 
 	if (!sc->bge_link ||
-	    (ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
+	    (if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
 	    IFF_DRV_RUNNING)
 		return;
 
 	prodidx = sc->bge_tx_prodidx;
 
-	for (count = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd);) {
+	for (count = 0; !if_sendq_empty(ifp);) {
 		if (sc->bge_txcnt > BGE_TX_RING_CNT - 16) {
-			ifp->if_drv_flags |= IFF_DRV_OACTIVE;
+			if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0);
 			break;
 		}
-		IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
+		m_head = if_dequeue(ifp);
 		if (m_head == NULL)
 			break;
 
@@ -5363,8 +5372,8 @@ bge_start_locked(struct ifnet *ifp)
 		if (bge_encap(sc, &m_head, &prodidx)) {
 			if (m_head == NULL)
 				break;
-			IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
-			ifp->if_drv_flags |= IFF_DRV_OACTIVE;
+			if_sendq_prepend(ifp, m_head);
+			if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0);
 			break;
 		}
 		++count;
@@ -5373,11 +5382,7 @@ bge_start_locked(struct ifnet *ifp)
 		 * If there's a BPF listener, bounce a copy of this frame
 		 * to him.
 		 */
-#ifdef ETHER_BPF_MTAP
-		ETHER_BPF_MTAP(ifp, m_head);
-#else
-		BPF_MTAP(ifp, m_head);
-#endif
+		if_bpfmtap(ifp, m_head);
 	}
 
 	if (count > 0) {
@@ -5403,11 +5408,11 @@ bge_start_locked(struct ifnet *ifp)
  * to the mbuf data regions directly in the transmit descriptors.
  */
 static void
-bge_start(struct ifnet *ifp)
+bge_start(if_t ifp)
 {
 	struct bge_softc *sc;
 
-	sc = ifp->if_softc;
+	sc = if_getsoftc(ifp);
 	BGE_LOCK(sc);
 	bge_start_locked(ifp);
 	BGE_UNLOCK(sc);
@@ -5416,7 +5421,7 @@ bge_start(struct ifnet *ifp)
 static void
 bge_init_locked(struct bge_softc *sc)
 {
-	struct ifnet *ifp;
+	if_t ifp;
 	uint16_t *m;
 	uint32_t mode;
 
@@ -5424,7 +5429,7 @@ bge_init_locked(struct bge_softc *sc)
 
 	ifp = sc->bge_ifp;
 
-	if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+	if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
 		return;
 
 	/* Cancel pending I/O and flush buffers. */
@@ -5450,9 +5455,9 @@ bge_init_locked(struct bge_softc *sc)
 	ifp = sc->bge_ifp;
 
 	/* Specify MTU. */
-	CSR_WRITE_4(sc, BGE_RX_MTU, ifp->if_mtu +
+	CSR_WRITE_4(sc, BGE_RX_MTU, if_getmtu(ifp) +
 	    ETHER_HDR_LEN + ETHER_CRC_LEN +
-	    (ifp->if_capenable & IFCAP_VLAN_MTU ? ETHER_VLAN_ENCAP_LEN : 0));
+	    (if_getcapenable(ifp) & IFCAP_VLAN_MTU ? ETHER_VLAN_ENCAP_LEN : 0));
 
 	/* Load our MAC address. */
 	m = (uint16_t *)IF_LLADDR(sc->bge_ifp);
@@ -5473,10 +5478,10 @@ bge_init_locked(struct bge_softc *sc)
 		sc->bge_csum_features &= ~CSUM_UDP;
 	else
 		sc->bge_csum_features |= CSUM_UDP;
-	if (ifp->if_capabilities & IFCAP_TXCSUM &&
-	    ifp->if_capenable & IFCAP_TXCSUM) {
-		ifp->if_hwassist &= ~(BGE_CSUM_FEATURES | CSUM_UDP);
-		ifp->if_hwassist |= sc->bge_csum_features;
+	if (if_getcapabilities(ifp) & IFCAP_TXCSUM &&
+	    if_getcapenable(ifp) & IFCAP_TXCSUM) {
+		if_sethwassistbits(ifp, 0, (BGE_CSUM_FEATURES | CSUM_UDP));
+		if_sethwassistbits(ifp, sc->bge_csum_features, 0);
 	}
 
 	/* Init RX ring. */
@@ -5506,8 +5511,8 @@ bge_init_locked(struct bge_softc *sc)
 
 	/* Init jumbo RX ring. */
 	if (BGE_IS_JUMBO_CAPABLE(sc) &&
-	    ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN >
-	    (MCLBYTES - ETHER_ALIGN)) {
+	    if_getmtu(ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN + 
+     	    ETHER_VLAN_ENCAP_LEN > (MCLBYTES - ETHER_ALIGN)) {
 		if (bge_init_rx_ring_jumbo(sc) != 0) {
 			device_printf(sc->bge_dev,
 			    "no memory for jumbo Rx buffers.\n");
@@ -5568,7 +5573,7 @@ bge_init_locked(struct bge_softc *sc)
 
 #ifdef DEVICE_POLLING
 	/* Disable interrupts if we are polling. */
-	if (ifp->if_capenable & IFCAP_POLLING) {
+	if (if_getcapenable(ifp) & IFCAP_POLLING) {
 		BGE_SETBIT(sc, BGE_PCI_MISC_CTL,
 		    BGE_PCIMISCCTL_MASK_PCI_INTR);
 		bge_writembx(sc, BGE_MBX_IRQ0_LO, 1);
@@ -5582,8 +5587,8 @@ bge_init_locked(struct bge_softc *sc)
 	bge_writembx(sc, BGE_MBX_IRQ0_LO, 0);
 	}
 
-	ifp->if_drv_flags |= IFF_DRV_RUNNING;
-	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
+	if_setdrvflagbits(ifp, IFF_DRV_RUNNING, 0);
+	if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE);
 
 	bge_ifmedia_upd_locked(ifp);
 
@@ -5604,9 +5609,9 @@ bge_init(void *xsc)
  * Set media options.
  */
 static int
-bge_ifmedia_upd(struct ifnet *ifp)
+bge_ifmedia_upd(if_t ifp)
 {
-	struct bge_softc *sc = ifp->if_softc;
+	struct bge_softc *sc = if_getsoftc(ifp);
 	int res;
 
 	BGE_LOCK(sc);
@@ -5617,9 +5622,9 @@ bge_ifmedia_upd(struct ifnet *ifp)
 }
 
 static int
-bge_ifmedia_upd_locked(struct ifnet *ifp)
+bge_ifmedia_upd_locked(if_t ifp)
 {
-	struct bge_softc *sc = ifp->if_softc;
+	struct bge_softc *sc = if_getsoftc(ifp);
 	struct mii_data *mii;
 	struct mii_softc *miisc;
 	struct ifmedia *ifm;
@@ -5702,14 +5707,14 @@ bge_ifmedia_upd_locked(struct ifnet *ifp
  * Report current media status.
  */
 static void
-bge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
+bge_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr)
 {
-	struct bge_softc *sc = ifp->if_softc;
+	struct bge_softc *sc = if_getsoftc(ifp);
 	struct mii_data *mii;
 
 	BGE_LOCK(sc);
 
-	if ((ifp->if_flags & IFF_UP) == 0) {
+	if ((if_getflags(ifp) & IFF_UP) == 0) {
 		BGE_UNLOCK(sc);
 		return;
 	}
@@ -5742,9 +5747,9 @@ bge_ifmedia_sts(struct ifnet *ifp, struc
 }
 
 static int
-bge_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
+bge_ioctl(if_t ifp, u_long command, caddr_t data)
 {
-	struct bge_softc *sc = ifp->if_softc;
+	struct bge_softc *sc = if_getsoftc(ifp);
 	struct ifreq *ifr = (struct ifreq *) data;
 	struct mii_data *mii;
 	int flags, mask, error = 0;
@@ -5763,10 +5768,10 @@ bge_ioctl(struct ifnet *ifp, u_long comm
 			break;
 		}
 		BGE_LOCK(sc);
-		if (ifp->if_mtu != ifr->ifr_mtu) {
-			ifp->if_mtu = ifr->ifr_mtu;
-			if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
-				ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+		if (if_getmtu(ifp) != ifr->ifr_mtu) {
+			if_setmtu(ifp, ifr->ifr_mtu);
+			if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
+				if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING);
 				bge_init_locked(sc);
 			}
 		}
@@ -5774,7 +5779,7 @@ bge_ioctl(struct ifnet *ifp, u_long comm
 		break;
 	case SIOCSIFFLAGS:
 		BGE_LOCK(sc);
-		if (ifp->if_flags & IFF_UP) {
+		if (if_getflags(ifp) & IFF_UP) {
 			/*
 			 * If only the state of the PROMISC flag changed,
 			 * then just use the 'set promisc mode' command
@@ -5783,8 +5788,8 @@ bge_ioctl(struct ifnet *ifp, u_long comm
 			 * waiting for it to start up, which may take a
 			 * second or two.  Similarly for ALLMULTI.
 			 */
-			if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
-				flags = ifp->if_flags ^ sc->bge_if_flags;
+			if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
+				flags = if_getflags(ifp) ^ sc->bge_if_flags;
 				if (flags & IFF_PROMISC)
 					bge_setpromisc(sc);
 				if (flags & IFF_ALLMULTI)
@@ -5792,17 +5797,17 @@ bge_ioctl(struct ifnet *ifp, u_long comm
 			} else
 				bge_init_locked(sc);
 		} else {
-			if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+			if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
 				bge_stop(sc);
 			}
 		}
-		sc->bge_if_flags = ifp->if_flags;
+		sc->bge_if_flags = if_getflags(ifp);
 		BGE_UNLOCK(sc);
 		error = 0;
 		break;
 	case SIOCADDMULTI:
 	case SIOCDELMULTI:
-		if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+		if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
 			BGE_LOCK(sc);
 			bge_setmulti(sc);
 			BGE_UNLOCK(sc);
@@ -5821,7 +5826,7 @@ bge_ioctl(struct ifnet *ifp, u_long comm
 		}
 		break;
 	case SIOCSIFCAP:
-		mask = ifr->ifr_reqcap ^ ifp->if_capenable;
+		mask = ifr->ifr_reqcap ^ if_getcapenable(ifp);
 #ifdef DEVICE_POLLING
 		if (mask & IFCAP_POLLING) {
 			if (ifr->ifr_reqcap & IFCAP_POLLING) {
@@ -5832,7 +5837,7 @@ bge_ioctl(struct ifnet *ifp, u_long comm
 				BGE_SETBIT(sc, BGE_PCI_MISC_CTL,
 				    BGE_PCIMISCCTL_MASK_PCI_INTR);
 				bge_writembx(sc, BGE_MBX_IRQ0_LO, 1);
-				ifp->if_capenable |= IFCAP_POLLING;
+				if_setcapenablebit(ifp, IFCAP_POLLING, 0);
 				BGE_UNLOCK(sc);
 			} else {
 				error = ether_poll_deregister(ifp);
@@ -5841,53 +5846,55 @@ bge_ioctl(struct ifnet *ifp, u_long comm
 				BGE_CLRBIT(sc, BGE_PCI_MISC_CTL,
 				    BGE_PCIMISCCTL_MASK_PCI_INTR);
 				bge_writembx(sc, BGE_MBX_IRQ0_LO, 0);
-				ifp->if_capenable &= ~IFCAP_POLLING;
+				if_setcapenablebit(ifp, 0, IFCAP_POLLING);
 				BGE_UNLOCK(sc);
 			}
 		}
 #endif
 		if ((mask & IFCAP_TXCSUM) != 0 &&
-		    (ifp->if_capabilities & IFCAP_TXCSUM) != 0) {
-			ifp->if_capenable ^= IFCAP_TXCSUM;
-			if ((ifp->if_capenable & IFCAP_TXCSUM) != 0)
-				ifp->if_hwassist |= sc->bge_csum_features;
+		    (if_getcapabilities(ifp) & IFCAP_TXCSUM) != 0) {
+			if_togglecapenable(ifp, IFCAP_TXCSUM);
+			if ((if_getcapenable(ifp) & IFCAP_TXCSUM) != 0)
+				if_sethwassistbits(ifp,
+				    sc->bge_csum_features, 0);
 			else
-				ifp->if_hwassist &= ~sc->bge_csum_features;
+				if_sethwassistbits(ifp, 0,
+				    sc->bge_csum_features);
 		}
 
 		if ((mask & IFCAP_RXCSUM) != 0 &&
-		    (ifp->if_capabilities & IFCAP_RXCSUM) != 0)
-			ifp->if_capenable ^= IFCAP_RXCSUM;
+		    (if_getcapabilities(ifp) & IFCAP_RXCSUM) != 0)
+			if_togglecapenable(ifp, IFCAP_RXCSUM);
 
 		if ((mask & IFCAP_TSO4) != 0 &&
-		    (ifp->if_capabilities & IFCAP_TSO4) != 0) {
-			ifp->if_capenable ^= IFCAP_TSO4;
-			if ((ifp->if_capenable & IFCAP_TSO4) != 0)
-				ifp->if_hwassist |= CSUM_TSO;
+		    (if_getcapabilities(ifp) & IFCAP_TSO4) != 0) {
+			if_togglecapenable(ifp, IFCAP_TSO4);
+			if ((if_getcapenable(ifp) & IFCAP_TSO4) != 0)
+				if_sethwassistbits(ifp, CSUM_TSO, 0);
 			else
-				ifp->if_hwassist &= ~CSUM_TSO;
+				if_sethwassistbits(ifp, 0, CSUM_TSO);
 		}
 
 		if (mask & IFCAP_VLAN_MTU) {
-			ifp->if_capenable ^= IFCAP_VLAN_MTU;
-			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+			if_togglecapenable(ifp, IFCAP_VLAN_MTU);
+			if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING);
 			bge_init(sc);
 		}
 
 		if ((mask & IFCAP_VLAN_HWTSO) != 0 &&
-		    (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0)
-			ifp->if_capenable ^= IFCAP_VLAN_HWTSO;
+		    (if_getcapabilities(ifp) & IFCAP_VLAN_HWTSO) != 0)
+			if_togglecapenable(ifp, IFCAP_VLAN_HWTSO);
 		if ((mask & IFCAP_VLAN_HWTAGGING) != 0 &&
-		    (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) {
-			ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
-			if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0)
-				ifp->if_capenable &= ~IFCAP_VLAN_HWTSO;
+		    (if_getcapabilities(ifp) & IFCAP_VLAN_HWTAGGING) != 0) {
+			if_togglecapenable(ifp, IFCAP_VLAN_HWTAGGING);
+			if ((if_getcapenable(ifp) & IFCAP_VLAN_HWTAGGING) == 0)
+				if_setcapenablebit(ifp, 0, IFCAP_VLAN_HWTSO);
 			BGE_LOCK(sc);
 			bge_setvlan(sc);
 			BGE_UNLOCK(sc);
 		}
 #ifdef VLAN_CAPABILITIES
-		VLAN_CAPABILITIES(ifp);
+		if_vlancap(ifp);
 #endif
 		break;
 	default:
@@ -5901,7 +5908,7 @@ bge_ioctl(struct ifnet *ifp, u_long comm
 static void
 bge_watchdog(struct bge_softc *sc)
 {
-	struct ifnet *ifp;
+	if_t ifp;
 	uint32_t status;
 
 	BGE_LOCK_ASSERT(sc);
@@ -5940,10 +5947,10 @@ bge_watchdog(struct bge_softc *sc)
 
 	if_printf(ifp, "watchdog timeout -- resetting\n");
 
-	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+	if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING);
 	bge_init_locked(sc);
 
-	ifp->if_oerrors++;
+	if_incoerrors(ifp, 1);
 }
 
 static void
@@ -5967,7 +5974,7 @@ bge_stop_block(struct bge_softc *sc, bus
 static void
 bge_stop(struct bge_softc *sc)
 {
-	struct ifnet *ifp;
+	if_t ifp;
 
 	BGE_LOCK_ASSERT(sc);
 
@@ -6057,7 +6064,7 @@ bge_stop(struct bge_softc *sc)
 		if_printf(sc->bge_ifp, "link DOWN\n");
 	sc->bge_link = 0;
 
-	ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
+	if_setdrvflagbits(ifp, 0, (IFF_DRV_RUNNING | IFF_DRV_OACTIVE));
 }
 
 /*
@@ -6094,14 +6101,14 @@ static int
 bge_resume(device_t dev)
 {
 	struct bge_softc *sc;
-	struct ifnet *ifp;
+	if_t ifp;
 
 	sc = device_get_softc(dev);
 	BGE_LOCK(sc);
 	ifp = sc->bge_ifp;
-	if (ifp->if_flags & IFF_UP) {
+	if (if_getflags(ifp) & IFF_UP) {
 		bge_init_locked(sc);
-		if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+		if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
 			bge_start_locked(ifp);
 	}
 	BGE_UNLOCK(sc);

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 20:00:36 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 87E4A53C;
 Tue,  1 Jul 2014 20:00:36 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 744302924;
 Tue,  1 Jul 2014 20:00:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61K0aQ9067441;
 Tue, 1 Jul 2014 20:00:36 GMT (envelope-from bdrewery@svn.freebsd.org)
Received: (from bdrewery@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61K0aCO067439;
 Tue, 1 Jul 2014 20:00:36 GMT (envelope-from bdrewery@svn.freebsd.org)
Message-Id: <201407012000.s61K0aCO067439@svn.freebsd.org>
From: Bryan Drewery 
Date: Tue, 1 Jul 2014 20:00:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268114 - in head/sys: fs/nfsserver nfsserver
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 20:00:36 -0000

Author: bdrewery
Date: Tue Jul  1 20:00:35 2014
New Revision: 268114
URL: http://svnweb.freebsd.org/changeset/base/268114

Log:
  Change NFS readdir() to only ignore cookies preceding the given offset for
  UFS rather than for all but ZFS.  This code was assuming that offsets were
  monotonically increasing for all file systems except ZFS and that the
  cookies from a previous call may have been rewound to a block boundary.
  According to mckusick@ only UFS is known to do this, so only requests against
  UFS file systems should remove cookies smaller than the given offset.  This
  fixes serving TMPFS over NFS as it too does not have monotonically increasing
  offsets.  The comment around the code also indicated it was specific to UFS.
  
  Some of the code using 'not_zfs' is specific to ZFS snapshot handling, so
  add a 'is_zfs' variable for those cases.
  
  It's possible that 'is_zfs' check for VFS_VGET() support may not be
  specific to ZFS.  This needs more research and testing.
  
  After this fix TMPFS and other file systems can be served over NFS.
  
  To test I compared the results of syncing a /usr/src tree into a tmpfs and
  serving that over NFS.  Before the fix 3589 files were missing on the remote
  view.  After the fix all files were successfully found.
  
  Reviewed by:	rmacklem
  Discussed with:	mckusick, rmacklem via fs@
  Discussed at:	http://lists.freebsd.org/pipermail/freebsd-fs/2014-April/019264.html
  MFC after:	2 weeks
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/fs/nfsserver/nfs_nfsdport.c
  head/sys/nfsserver/nfs_serv.c

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdport.c	Tue Jul  1 19:50:47 2014	(r268113)
+++ head/sys/fs/nfsserver/nfs_nfsdport.c	Tue Jul  1 20:00:35 2014	(r268114)
@@ -1551,7 +1551,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd
 	u_long *cookies = NULL, *cookiep;
 	struct uio io;
 	struct iovec iv;
-	int not_zfs;
+	int is_ufs;
 
 	if (nd->nd_repstat) {
 		nfsrv_postopattr(nd, getret, &at);
@@ -1606,7 +1606,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd
 			nfsrv_postopattr(nd, getret, &at);
 		goto out;
 	}
-	not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs");
+	is_ufs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "ufs") == 0;
 	MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK);
 again:
 	eofflag = 0;
@@ -1686,12 +1686,10 @@ again:
 	 * skip over the records that precede the requested offset. This
 	 * requires the assumption that file offset cookies monotonically
 	 * increase.
-	 * Since the offset cookies don't monotonically increase for ZFS,
-	 * this is not done when ZFS is the file system.
 	 */
 	while (cpos < cend && ncookies > 0 &&
 	    (dp->d_fileno == 0 || dp->d_type == DT_WHT ||
-	     (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff))) {
+	     (is_ufs == 1 && ((u_quad_t)(*cookiep)) <= toff))) {
 		cpos += dp->d_reclen;
 		dp = (struct dirent *)cpos;
 		cookiep++;
@@ -1804,7 +1802,7 @@ nfsrvd_readdirplus(struct nfsrv_descript
 	struct uio io;
 	struct iovec iv;
 	struct componentname cn;
-	int at_root, needs_unbusy, not_zfs, supports_nfsv4acls;
+	int at_root, is_ufs, is_zfs, needs_unbusy, supports_nfsv4acls;
 	struct mount *mp, *new_mp;
 	uint64_t mounted_on_fileno;
 
@@ -1884,7 +1882,8 @@ nfsrvd_readdirplus(struct nfsrv_descript
 			nfsrv_postopattr(nd, getret, &at);
 		goto out;
 	}
-	not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs");
+	is_ufs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "ufs") == 0;
+	is_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs") == 0;
 
 	MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK);
 again:
@@ -1957,12 +1956,10 @@ again:
 	 * skip over the records that precede the requested offset. This
 	 * requires the assumption that file offset cookies monotonically
 	 * increase.
-	 * Since the offset cookies don't monotonically increase for ZFS,
-	 * this is not done when ZFS is the file system.
 	 */
 	while (cpos < cend && ncookies > 0 &&
 	  (dp->d_fileno == 0 || dp->d_type == DT_WHT ||
-	   (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff) ||
+	   (is_ufs == 1 && ((u_quad_t)(*cookiep)) <= toff) ||
 	   ((nd->nd_flag & ND_NFSV4) &&
 	    ((dp->d_namlen == 1 && dp->d_name[0] == '.') ||
 	     (dp->d_namlen==2 && dp->d_name[0]=='.' && dp->d_name[1]=='.'))))) {
@@ -2004,7 +2001,7 @@ again:
 	 * This needs to be done here for NFSv4, since NFSv4 never does
 	 * a VFS_VGET() for "." or "..".
 	 */
-	if (not_zfs == 0) {
+	if (is_zfs == 1) {
 		r = VFS_VGET(mp, at.na_fileid, LK_SHARED, &nvp);
 		if (r == EOPNOTSUPP) {
 			usevget = 0;
@@ -2153,7 +2150,7 @@ again:
 					if (!r)
 					    r = nfsvno_getattr(nvp, nvap,
 						nd->nd_cred, p, 1);
-					if (r == 0 && not_zfs == 0 &&
+					if (r == 0 && is_zfs == 1 &&
 					    nfsrv_enable_crossmntpt != 0 &&
 					    (nd->nd_flag & ND_NFSV4) != 0 &&
 					    nvp->v_type == VDIR &&

Modified: head/sys/nfsserver/nfs_serv.c
==============================================================================
--- head/sys/nfsserver/nfs_serv.c	Tue Jul  1 19:50:47 2014	(r268113)
+++ head/sys/nfsserver/nfs_serv.c	Tue Jul  1 20:00:35 2014	(r268114)
@@ -2627,7 +2627,7 @@ nfsrv_readdir(struct nfsrv_descript *nfs
 	int v3 = (nfsd->nd_flag & ND_NFSV3);
 	u_quad_t off, toff, verf;
 	u_long *cookies = NULL, *cookiep; /* needs to be int64_t or off_t */
-	int not_zfs;
+	int is_ufs;
 
 	nfsdbprintf(("%s %d\n", __FILE__, __LINE__));
 	fhp = &nfh.fh_generic;
@@ -2690,7 +2690,7 @@ nfsrv_readdir(struct nfsrv_descript *nfs
 		error = 0;
 		goto nfsmout;
 	}
-	not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs") != 0;
+	is_ufs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "ufs") == 0;
 	VOP_UNLOCK(vp, 0);
 
 	/*
@@ -2777,12 +2777,10 @@ again:
 	 * skip over the records that precede the requested offset. This
 	 * requires the assumption that file offset cookies monotonically
 	 * increase.
-	 * Since the offset cookies don't monotonically increase for ZFS,
-	 * this is not done when ZFS is the file system.
 	 */
 	while (cpos < cend && ncookies > 0 &&
 		(dp->d_fileno == 0 || dp->d_type == DT_WHT ||
-		 (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff))) {
+		 (is_ufs == 1 && ((u_quad_t)(*cookiep)) <= toff))) {
 		cpos += dp->d_reclen;
 		dp = (struct dirent *)cpos;
 		cookiep++;
@@ -2928,7 +2926,7 @@ nfsrv_readdirplus(struct nfsrv_descript 
 	int usevget = 1;
 	struct componentname cn;
 	struct mount *mntp = NULL;
-	int not_zfs;
+	int is_ufs;
 
 	nfsdbprintf(("%s %d\n", __FILE__, __LINE__));
 	vp_locked = 0;
@@ -2988,7 +2986,7 @@ nfsrv_readdirplus(struct nfsrv_descript 
 		error = 0;
 		goto nfsmout;
 	}
-	not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs") != 0;
+	is_ufs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "ufs") == 0;
 	VOP_UNLOCK(vp, 0);
 	vp_locked = 0;
 	rbuf = malloc(siz, M_TEMP, M_WAITOK);
@@ -3068,12 +3066,10 @@ again:
 	 * skip over the records that precede the requested offset. This
 	 * requires the assumption that file offset cookies monotonically
 	 * increase.
-	 * Since the offset cookies don't monotonically increase for ZFS,
-	 * this is not done when ZFS is the file system.
 	 */
 	while (cpos < cend && ncookies > 0 &&
 		(dp->d_fileno == 0 || dp->d_type == DT_WHT ||
-		 (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff))) {
+		 (is_ufs == 1 && ((u_quad_t)(*cookiep)) <= toff))) {
 		cpos += dp->d_reclen;
 		dp = (struct dirent *)cpos;
 		cookiep++;

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 20:47:19 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 84E14F66;
 Tue,  1 Jul 2014 20:47:19 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 705D82CC6;
 Tue,  1 Jul 2014 20:47:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61KlJu4090409;
 Tue, 1 Jul 2014 20:47:19 GMT (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61KlGYY090389;
 Tue, 1 Jul 2014 20:47:16 GMT (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201407012047.s61KlGYY090389@svn.freebsd.org>
From: Rick Macklem 
Date: Tue, 1 Jul 2014 20:47:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268115 - in head/sys: conf fs/nfs fs/nfsclient
 fs/nfsserver modules/krpc rpc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 20:47:19 -0000

Author: rmacklem
Date: Tue Jul  1 20:47:16 2014
New Revision: 268115
URL: http://svnweb.freebsd.org/changeset/base/268115

Log:
  Merge the NFSv4.1 server code in projects/nfsv4.1-server over
  into head. The code is not believed to have any effect
  on the semantics of non-NFSv4.1 server behaviour.
  It is a rather large merge, but I am hoping that there will
  not be any regressions for the NFS server.
  
  MFC after:	1 month

Added:
  head/sys/rpc/clnt_bck.c   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/fs/nfs/nfs.h
  head/sys/fs/nfs/nfs_commonkrpc.c
  head/sys/fs/nfs/nfs_commonport.c
  head/sys/fs/nfs/nfs_commonsubs.c
  head/sys/fs/nfs/nfs_var.h
  head/sys/fs/nfs/nfsclstate.h
  head/sys/fs/nfs/nfsdport.h
  head/sys/fs/nfs/nfsport.h
  head/sys/fs/nfs/nfsproto.h
  head/sys/fs/nfs/nfsrvstate.h
  head/sys/fs/nfsclient/nfs_clstate.c
  head/sys/fs/nfsserver/nfs_nfsdcache.c
  head/sys/fs/nfsserver/nfs_nfsdkrpc.c
  head/sys/fs/nfsserver/nfs_nfsdport.c
  head/sys/fs/nfsserver/nfs_nfsdserv.c
  head/sys/fs/nfsserver/nfs_nfsdsocket.c
  head/sys/fs/nfsserver/nfs_nfsdstate.c
  head/sys/fs/nfsserver/nfs_nfsdsubs.c
  head/sys/modules/krpc/Makefile
  head/sys/rpc/krpc.h
  head/sys/rpc/svc.h
  head/sys/rpc/svc_vc.c

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Tue Jul  1 20:00:35 2014	(r268114)
+++ head/sys/conf/files	Tue Jul  1 20:47:16 2014	(r268115)
@@ -3810,6 +3810,7 @@ pci/viapm.c			optional viapm pci
 rpc/auth_none.c			optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd
 rpc/auth_unix.c			optional krpc | nfslockd | nfsclient | nfscl | nfsd
 rpc/authunix_prot.c		optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd
+rpc/clnt_bck.c			optional krpc | nfslockd | nfsserver | nfscl | nfsd
 rpc/clnt_dg.c			optional krpc | nfslockd | nfsclient | nfscl | nfsd
 rpc/clnt_rc.c			optional krpc | nfslockd | nfsclient | nfscl | nfsd
 rpc/clnt_vc.c			optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd

Modified: head/sys/fs/nfs/nfs.h
==============================================================================
--- head/sys/fs/nfs/nfs.h	Tue Jul  1 20:00:35 2014	(r268114)
+++ head/sys/fs/nfs/nfs.h	Tue Jul  1 20:47:16 2014	(r268115)
@@ -50,7 +50,8 @@
 #define	NFS_MAXREXMIT	100		/* Stop counting after this many */
 #define	NFSV4_CALLBACKTIMEO (2 * NFS_HZ) /* Timeout in ticks */
 #define	NFSV4_CALLBACKRETRY 5		/* Number of retries before failure */
-#define	NFSV4_CBSLOTS	8		/* Number of slots for session */
+#define	NFSV4_SLOTS	64		/* Number of slots, fore channel */
+#define	NFSV4_CBSLOTS	8		/* Number of slots, back channel */
 #define	NFSV4_CBRETRYCNT 4		/* # of CBRecall retries upon err */
 #define	NFSV4_UPCALLTIMEO (15 * NFS_HZ)	/* Timeout in ticks for upcalls */
 					/* to gssd or nfsuserd */
@@ -91,6 +92,9 @@
 #ifndef NFSLOCKHASHSIZE
 #define	NFSLOCKHASHSIZE		20	/* Size of server nfslock hash table */
 #endif
+#ifndef NFSSESSIONHASHSIZE
+#define	NFSSESSIONHASHSIZE	20	/* Size of server session hash table */
+#endif
 #define	NFSSTATEHASHSIZE	10	/* Size of server stateid hash table */
 #ifndef NFSUSERHASHSIZE
 #define	NFSUSERHASHSIZE		30	/* Size of user id hash table */
@@ -276,6 +280,8 @@ struct nfsreferral {
 #define	LCL_GSSINTEGRITY	0x00002000
 #define	LCL_GSSPRIVACY		0x00004000
 #define	LCL_ADMINREVOKED	0x00008000
+#define	LCL_RECLAIMCOMPLETE	0x00010000
+#define	LCL_NFSV41		0x00020000
 
 #define	LCL_GSS		LCL_KERBV	/* Or of all mechs */
 
@@ -318,6 +324,11 @@ struct nfsreferral {
 #define	NFSLCK_SETATTR		0x02000000
 #define	NFSLCK_DELEGPURGE	0x04000000
 #define	NFSLCK_DELEGRETURN	0x08000000
+#define	NFSLCK_WANTWDELEG	0x10000000
+#define	NFSLCK_WANTRDELEG	0x20000000
+#define	NFSLCK_WANTNODELEG	0x40000000
+#define	NFSLCK_WANTBITS							\
+    (NFSLCK_WANTWDELEG | NFSLCK_WANTRDELEG | NFSLCK_WANTNODELEG)
 
 /* And bits for nid_flag */
 #define	NFSID_INITIALIZE	0x0001
@@ -341,68 +352,120 @@ struct nfsreferral {
  * THE MACROS MUST BE MANUALLY MODIFIED IF NFSATTRBIT_MAXWORDS CHANGES!!
  * It is (NFSATTRBIT_MAX + 31) / 32.
  */
-#define	NFSATTRBIT_MAXWORDS	2
+#define	NFSATTRBIT_MAXWORDS	3
 
 typedef struct {
 	u_int32_t bits[NFSATTRBIT_MAXWORDS];
 } nfsattrbit_t;
 
-#define	NFSZERO_ATTRBIT(b) do { (b)->bits[0] = 0; (b)->bits[1] = 0; } while (0)
-#define	NFSSET_ATTRBIT(t, f) do { (t)->bits[0] = (f)->bits[0]; 		\
-				  (t)->bits[1] = (f)->bits[1]; } while (0)
+#define	NFSZERO_ATTRBIT(b) do {						\
+	(b)->bits[0] = 0;						\
+	(b)->bits[1] = 0;						\
+	(b)->bits[2] = 0;						\
+} while (0)
+
+#define	NFSSET_ATTRBIT(t, f) do {					\
+	(t)->bits[0] = (f)->bits[0];			 		\
+	(t)->bits[1] = (f)->bits[1];					\
+	(t)->bits[2] = (f)->bits[2];					\
+} while (0)
+
 #define	NFSSETSUPP_ATTRBIT(b) do { 					\
 	(b)->bits[0] = NFSATTRBIT_SUPP0; 				\
-	(b)->bits[1] = (NFSATTRBIT_SUPP1 | NFSATTRBIT_SUPPSETONLY); } while (0)
+	(b)->bits[1] = (NFSATTRBIT_SUPP1 | NFSATTRBIT_SUPPSETONLY);	\
+	(b)->bits[2] = NFSATTRBIT_SUPP2;				\
+} while (0)
+
 #define	NFSISSET_ATTRBIT(b, p)	((b)->bits[(p) / 32] & (1 << ((p) % 32)))
 #define	NFSSETBIT_ATTRBIT(b, p)	((b)->bits[(p) / 32] |= (1 << ((p) % 32)))
 #define	NFSCLRBIT_ATTRBIT(b, p)	((b)->bits[(p) / 32] &= ~(1 << ((p) % 32)))
+
 #define	NFSCLRALL_ATTRBIT(b, a)	do { 					\
-		(b)->bits[0] &= ~((a)->bits[0]); 			\
-		(b)->bits[1] &= ~((a)->bits[1]); 			\
-		} while (0)
+	(b)->bits[0] &= ~((a)->bits[0]);	 			\
+	(b)->bits[1] &= ~((a)->bits[1]);	 			\
+	(b)->bits[2] &= ~((a)->bits[2]);				\
+} while (0)
+
 #define	NFSCLRNOT_ATTRBIT(b, a)	do { 					\
-		(b)->bits[0] &= ((a)->bits[0]); 			\
-		(b)->bits[1] &= ((a)->bits[1]); 			\
-		} while (0)
+	(b)->bits[0] &= ((a)->bits[0]);		 			\
+	(b)->bits[1] &= ((a)->bits[1]);		 			\
+	(b)->bits[2] &= ((a)->bits[2]);		 			\
+} while (0)
+
 #define	NFSCLRNOTFILLABLE_ATTRBIT(b) do { 				\
-		(b)->bits[0] &= NFSATTRBIT_SUPP0; 			\
-		(b)->bits[1] &= NFSATTRBIT_SUPP1; } while (0)
+	(b)->bits[0] &= NFSATTRBIT_SUPP0;	 			\
+	(b)->bits[1] &= NFSATTRBIT_SUPP1;				\
+	(b)->bits[2] &= NFSATTRBIT_SUPP2;				\
+} while (0)
+
 #define	NFSCLRNOTSETABLE_ATTRBIT(b) do { 				\
-		(b)->bits[0] &= NFSATTRBIT_SETABLE0; 			\
-		(b)->bits[1] &= NFSATTRBIT_SETABLE1; } while (0)
-#define	NFSNONZERO_ATTRBIT(b)	((b)->bits[0] || (b)->bits[1])
-#define	NFSEQUAL_ATTRBIT(b, p)						\
-	((b)->bits[0] == (p)->bits[0] && (b)->bits[1] == (p)->bits[1])
+	(b)->bits[0] &= NFSATTRBIT_SETABLE0;	 			\
+	(b)->bits[1] &= NFSATTRBIT_SETABLE1;				\
+	(b)->bits[2] &= NFSATTRBIT_SETABLE2;				\
+} while (0)
+
+#define	NFSNONZERO_ATTRBIT(b)	((b)->bits[0] || (b)->bits[1] || (b)->bits[2])
+#define	NFSEQUAL_ATTRBIT(b, p)	((b)->bits[0] == (p)->bits[0] &&	\
+	(b)->bits[1] == (p)->bits[1] && (b)->bits[2] == (p)->bits[2])
+
 #define	NFSGETATTR_ATTRBIT(b) do { 					\
-		(b)->bits[0] = NFSATTRBIT_GETATTR0; 			\
-		(b)->bits[1] = NFSATTRBIT_GETATTR1; } while (0)
+	(b)->bits[0] = NFSATTRBIT_GETATTR0;	 			\
+	(b)->bits[1] = NFSATTRBIT_GETATTR1;				\
+	(b)->bits[2] = NFSATTRBIT_GETATTR2;				\
+} while (0)
+
 #define	NFSWCCATTR_ATTRBIT(b) do { 					\
-		(b)->bits[0] = NFSATTRBIT_WCCATTR0; 			\
-		(b)->bits[1] = NFSATTRBIT_WCCATTR1; } while (0)
+	(b)->bits[0] = NFSATTRBIT_WCCATTR0;	 			\
+	(b)->bits[1] = NFSATTRBIT_WCCATTR1;				\
+	(b)->bits[2] = NFSATTRBIT_WCCATTR2;				\
+} while (0)
+
 #define	NFSWRITEGETATTR_ATTRBIT(b) do { 				\
-		(b)->bits[0] = NFSATTRBIT_WRITEGETATTR0;		\
-		(b)->bits[1] = NFSATTRBIT_WRITEGETATTR1; } while (0)
+	(b)->bits[0] = NFSATTRBIT_WRITEGETATTR0;			\
+	(b)->bits[1] = NFSATTRBIT_WRITEGETATTR1;			\
+	(b)->bits[2] = NFSATTRBIT_WRITEGETATTR2;			\
+} while (0)
+
 #define	NFSCBGETATTR_ATTRBIT(b, c) do { 				\
-	(c)->bits[0] = ((b)->bits[0] & NFSATTRBIT_CBGETATTR0); 		\
-	(c)->bits[1] = ((b)->bits[1] & NFSATTRBIT_CBGETATTR1); } while (0)
+	(c)->bits[0] = ((b)->bits[0] & NFSATTRBIT_CBGETATTR0);		\
+	(c)->bits[1] = ((b)->bits[1] & NFSATTRBIT_CBGETATTR1);		\
+	(c)->bits[2] = ((b)->bits[2] & NFSATTRBIT_CBGETATTR2);		\
+} while (0)
+
 #define	NFSPATHCONF_GETATTRBIT(b) do { 					\
-		(b)->bits[0] = NFSGETATTRBIT_PATHCONF0; 		\
-		(b)->bits[1] = NFSGETATTRBIT_PATHCONF1; } while (0)
+	(b)->bits[0] = NFSGETATTRBIT_PATHCONF0;		 		\
+	(b)->bits[1] = NFSGETATTRBIT_PATHCONF1;				\
+	(b)->bits[2] = NFSGETATTRBIT_PATHCONF2;				\
+} while (0)
+
 #define	NFSSTATFS_GETATTRBIT(b)	do { 					\
-		(b)->bits[0] = NFSGETATTRBIT_STATFS0; 			\
-		(b)->bits[1] = NFSGETATTRBIT_STATFS1; } while (0)
+	(b)->bits[0] = NFSGETATTRBIT_STATFS0;	 			\
+	(b)->bits[1] = NFSGETATTRBIT_STATFS1;				\
+	(b)->bits[2] = NFSGETATTRBIT_STATFS2;				\
+} while (0)
+
 #define	NFSISSETSTATFS_ATTRBIT(b) 					\
 		(((b)->bits[0] & NFSATTRBIT_STATFS0) || 		\
-		 ((b)->bits[1] & NFSATTRBIT_STATFS1))
+		 ((b)->bits[1] & NFSATTRBIT_STATFS1) ||			\
+		 ((b)->bits[2] & NFSATTRBIT_STATFS2))
+
 #define	NFSCLRSTATFS_ATTRBIT(b)	do { 					\
-		(b)->bits[0] &= ~NFSATTRBIT_STATFS0; 			\
-		(b)->bits[1] &= ~NFSATTRBIT_STATFS1; } while (0)
+	(b)->bits[0] &= ~NFSATTRBIT_STATFS0;	 			\
+	(b)->bits[1] &= ~NFSATTRBIT_STATFS1;				\
+	(b)->bits[2] &= ~NFSATTRBIT_STATFS2;				\
+} while (0)
+
 #define	NFSREADDIRPLUS_ATTRBIT(b) do { 					\
-		(b)->bits[0] = NFSATTRBIT_READDIRPLUS0; 		\
-		(b)->bits[1] = NFSATTRBIT_READDIRPLUS1; } while (0)
+	(b)->bits[0] = NFSATTRBIT_READDIRPLUS0;		 		\
+	(b)->bits[1] = NFSATTRBIT_READDIRPLUS1;				\
+	(b)->bits[2] = NFSATTRBIT_READDIRPLUS2;				\
+} while (0)
+
 #define	NFSREFERRAL_ATTRBIT(b) do { 					\
-		(b)->bits[0] = NFSATTRBIT_REFERRAL0;	 		\
-		(b)->bits[1] = NFSATTRBIT_REFERRAL1; } while (0)
+	(b)->bits[0] = NFSATTRBIT_REFERRAL0;		 		\
+	(b)->bits[1] = NFSATTRBIT_REFERRAL1;				\
+	(b)->bits[2] = NFSATTRBIT_REFERRAL2;				\
+} while (0)
 
 /*
  * Store uid, gid creds that were used when the stateid was acquired.
@@ -529,6 +592,9 @@ struct nfsrv_descript {
 	int			nd_gssnamelen;	/* principal name length */
 	char			*nd_gssname;	/* principal name */
 	uint32_t		*nd_slotseq;	/* ptr to slot seq# in req */
+	uint8_t			nd_sessionid[NFSX_V4SESSIONID];	/* Session id */
+	uint32_t		nd_slotid;	/* Slotid for this RPC */
+	SVCXPRT			*nd_xprt;	/* Server RPC handle */
 };
 
 #define	nd_princlen	nd_gssnamelen
@@ -562,6 +628,8 @@ struct nfsrv_descript {
 #define	ND_NFSCL		0x01000000
 #define	ND_NFSV41		0x02000000
 #define	ND_HASSEQUENCE		0x04000000
+#define	ND_CACHETHIS		0x08000000
+#define	ND_LASTOP		0x10000000
 
 /*
  * ND_GSS should be the "or" of all GSS type authentications.

Modified: head/sys/fs/nfs/nfs_commonkrpc.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonkrpc.c	Tue Jul  1 20:00:35 2014	(r268114)
+++ head/sys/fs/nfs/nfs_commonkrpc.c	Tue Jul  1 20:47:16 2014	(r268115)
@@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 
 #include 
 
@@ -738,8 +739,12 @@ tryagain:
 	}
 
 	nd->nd_mrep = NULL;
-	stat = CLNT_CALL_MBUF(nrp->nr_client, &ext, procnum, nd->nd_mreq,
-	    &nd->nd_mrep, timo);
+	if (clp != NULL && sep != NULL)
+		stat = clnt_bck_call(nrp->nr_client, &ext, procnum,
+		    nd->nd_mreq, &nd->nd_mrep, timo, sep->nfsess_xprt);
+	else
+		stat = CLNT_CALL_MBUF(nrp->nr_client, &ext, procnum,
+		    nd->nd_mreq, &nd->nd_mrep, timo);
 
 	if (rep != NULL) {
 		/*
@@ -794,7 +799,8 @@ tryagain:
 	nd->nd_md = nd->nd_mrep;
 	nd->nd_dpos = NFSMTOD(nd->nd_md, caddr_t);
 	nd->nd_repstat = 0;
-	if (nd->nd_procnum != NFSPROC_NULL) {
+	if (nd->nd_procnum != NFSPROC_NULL &&
+	    nd->nd_procnum != NFSV4PROC_CBNULL) {
 		/* If sep == NULL, set it to the default in nmp. */
 		if (sep == NULL && nmp != NULL)
 			sep = NFSMNT_MDSSESSION(nmp);
@@ -826,11 +832,20 @@ tryagain:
 			/*
 			 * If the first op is Sequence, free up the slot.
 			 */
-			if (nmp != NULL && i == NFSV4OP_SEQUENCE && j != 0)
+			if ((nmp != NULL && i == NFSV4OP_SEQUENCE && j != 0) ||
+			    (clp != NULL && i == NFSV4OP_CBSEQUENCE && j != 0))
 				NFSCL_DEBUG(1, "failed seq=%d\n", j);
-			if (nmp != NULL && i == NFSV4OP_SEQUENCE && j == 0) {
-				NFSM_DISSECT(tl, uint32_t *, NFSX_V4SESSIONID +
-				    5 * NFSX_UNSIGNED);
+			if ((nmp != NULL && i == NFSV4OP_SEQUENCE && j == 0) ||
+			    (clp != NULL && i == NFSV4OP_CBSEQUENCE && j == 0)
+			    ) {
+				if (i == NFSV4OP_SEQUENCE)
+					NFSM_DISSECT(tl, uint32_t *,
+					    NFSX_V4SESSIONID +
+					    5 * NFSX_UNSIGNED);
+				else
+					NFSM_DISSECT(tl, uint32_t *,
+					    NFSX_V4SESSIONID +
+					    4 * NFSX_UNSIGNED);
 				mtx_lock(&sep->nfsess_mtx);
 				tl += NFSX_V4SESSIONID / NFSX_UNSIGNED;
 				retseq = fxdr_unsigned(uint32_t, *tl++);

Modified: head/sys/fs/nfs/nfs_commonport.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonport.c	Tue Jul  1 20:00:35 2014	(r268114)
+++ head/sys/fs/nfs/nfs_commonport.c	Tue Jul  1 20:47:16 2014	(r268115)
@@ -112,6 +112,7 @@ MALLOC_DEFINE(M_NEWNFSDEVINFO, "NFSCL de
 MALLOC_DEFINE(M_NEWNFSSOCKREQ, "NFSCL sockreq", "NFS Sock Req");
 MALLOC_DEFINE(M_NEWNFSCLDS, "NFSCL session", "NFSv4.1 Session");
 MALLOC_DEFINE(M_NEWNFSLAYRECALL, "NFSCL layrecall", "NFSv4.1 Layout Recall");
+MALLOC_DEFINE(M_NEWNFSDSESSION, "NFSD session", "NFSD Session for a client");
 
 /*
  * Definition of mutex locks.

Modified: head/sys/fs/nfs/nfs_commonsubs.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonsubs.c	Tue Jul  1 20:00:35 2014	(r268114)
+++ head/sys/fs/nfs/nfs_commonsubs.c	Tue Jul  1 20:47:16 2014	(r268115)
@@ -1733,6 +1733,23 @@ nfsv4_loadattr(struct nfsrv_descript *nd
 			}
 			attrsum += NFSX_HYPER;
 			break;
+		case NFSATTRBIT_SUPPATTREXCLCREAT:
+			retnotsup = 0;
+			error = nfsrv_getattrbits(nd, &retattrbits,
+			    &cnt, &retnotsup);
+			if (error)
+			    goto nfsmout;
+			if (compare && !(*retcmpp)) {
+			   NFSSETSUPP_ATTRBIT(&checkattrbits);
+			   NFSCLRNOTSETABLE_ATTRBIT(&checkattrbits);
+			   NFSCLRBIT_ATTRBIT(&checkattrbits,
+				NFSATTRBIT_TIMEACCESSSET);
+			   if (!NFSEQUAL_ATTRBIT(&retattrbits, &checkattrbits)
+			       || retnotsup)
+				*retcmpp = NFSERR_NOTSAME;
+			}
+			attrsum += cnt;
+			break;
 		default:
 			printf("EEK! nfsv4_loadattr unknown attr=%d\n",
 				bitpos);
@@ -2469,6 +2486,12 @@ nfsv4_fillattr(struct nfsrv_descript *nd
 			txdr_hyper(uquad, tl);
 			retnum += NFSX_HYPER;
 			break;
+		case NFSATTRBIT_SUPPATTREXCLCREAT:
+			NFSSETSUPP_ATTRBIT(&attrbits);
+			NFSCLRNOTSETABLE_ATTRBIT(&attrbits);
+			NFSCLRBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEACCESSSET);
+			retnum += nfsrv_putattrbit(nd, &attrbits);
+			break;
 		default:
 			printf("EEK! Bad V4 attribute bitpos=%d\n", bitpos);
 		};
@@ -3663,6 +3686,9 @@ nfsmout:
 
 /*
  * Handle an NFSv4.1 Sequence request for the session.
+ * If reply != NULL, use it to return the cached reply, as required.
+ * The client gets a cached reply via this call for callbacks, however the
+ * server gets a cached reply via the nfsv4_seqsess_cachereply() call.
  */
 int
 nfsv4_seqsession(uint32_t seqid, uint32_t slotid, uint32_t highslot,
@@ -3671,7 +3697,8 @@ nfsv4_seqsession(uint32_t seqid, uint32_
 	int error;
 
 	error = 0;
-	*reply = NULL;
+	if (reply != NULL)
+		*reply = NULL;
 	if (slotid > maxslot)
 		return (NFSERR_BADSLOT);
 	if (seqid == slots[slotid].nfssl_seq) {
@@ -3679,13 +3706,18 @@ nfsv4_seqsession(uint32_t seqid, uint32_
 		if (slots[slotid].nfssl_inprog != 0)
 			error = NFSERR_DELAY;
 		else if (slots[slotid].nfssl_reply != NULL) {
-			*reply = slots[slotid].nfssl_reply;
-			slots[slotid].nfssl_reply = NULL;
+			if (reply != NULL) {
+				*reply = slots[slotid].nfssl_reply;
+				slots[slotid].nfssl_reply = NULL;
+			}
 			slots[slotid].nfssl_inprog = 1;
+			error = NFSERR_REPLYFROMCACHE;
 		} else
-			error = NFSERR_SEQMISORDERED;
+			/* No reply cached, so just do it. */
+			slots[slotid].nfssl_inprog = 1;
 	} else if ((slots[slotid].nfssl_seq + 1) == seqid) {
-		m_freem(slots[slotid].nfssl_reply);
+		if (slots[slotid].nfssl_reply != NULL)
+			m_freem(slots[slotid].nfssl_reply);
 		slots[slotid].nfssl_reply = NULL;
 		slots[slotid].nfssl_inprog = 1;
 		slots[slotid].nfssl_seq++;
@@ -3696,12 +3728,22 @@ nfsv4_seqsession(uint32_t seqid, uint32_
 
 /*
  * Cache this reply for the slot.
+ * Use the "rep" argument to return the cached reply if repstat is set to
+ * NFSERR_REPLYFROMCACHE. The client never sets repstat to this value.
  */
 void
-nfsv4_seqsess_cacherep(uint32_t slotid, struct nfsslot *slots, struct mbuf *rep)
+nfsv4_seqsess_cacherep(uint32_t slotid, struct nfsslot *slots, int repstat,
+   struct mbuf **rep)
 {
 
-	slots[slotid].nfssl_reply = rep;
+	if (repstat == NFSERR_REPLYFROMCACHE) {
+		*rep = slots[slotid].nfssl_reply;
+		slots[slotid].nfssl_reply = NULL;
+	} else {
+		if (slots[slotid].nfssl_reply != NULL)
+			m_freem(slots[slotid].nfssl_reply);
+		slots[slotid].nfssl_reply = *rep;
+	}
 	slots[slotid].nfssl_inprog = 0;
 }
 
@@ -3713,9 +3755,36 @@ nfsv4_setsequence(struct nfsmount *nmp, 
     struct nfsclsession *sep, int dont_replycache)
 {
 	uint32_t *tl, slotseq = 0;
+	int error, maxslot, slotpos;
+	uint8_t sessionid[NFSX_V4SESSIONID];
+
+	error = nfsv4_sequencelookup(nmp, sep, &slotpos, &maxslot, &slotseq,
+	    sessionid);
+	if (error != 0)
+		return;
+	KASSERT(maxslot >= 0, ("nfscl_setsequence neg maxslot"));
+
+	/* Build the Sequence arguments. */
+	NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID + 4 * NFSX_UNSIGNED);
+	bcopy(sessionid, tl, NFSX_V4SESSIONID);
+	tl += NFSX_V4SESSIONID / NFSX_UNSIGNED;
+	nd->nd_slotseq = tl;
+	*tl++ = txdr_unsigned(slotseq);
+	*tl++ = txdr_unsigned(slotpos);
+	*tl++ = txdr_unsigned(maxslot);
+	if (dont_replycache == 0)
+		*tl = newnfs_true;
+	else
+		*tl = newnfs_false;
+	nd->nd_flag |= ND_HASSEQUENCE;
+}
+
+int
+nfsv4_sequencelookup(struct nfsmount *nmp, struct nfsclsession *sep,
+    int *slotposp, int *maxslotp, uint32_t *slotseqp, uint8_t *sessionid)
+{
 	int i, maxslot, slotpos;
 	uint64_t bitval;
-	uint8_t sessionid[NFSX_V4SESSIONID];
 
 	/* Find an unused slot. */
 	slotpos = -1;
@@ -3728,7 +3797,7 @@ nfsv4_setsequence(struct nfsmount *nmp, 
 				slotpos = i;
 				sep->nfsess_slots |= bitval;
 				sep->nfsess_slotseq[i]++;
-				slotseq = sep->nfsess_slotseq[i];
+				*slotseqp = sep->nfsess_slotseq[i];
 				break;
 			}
 			bitval <<= 1;
@@ -3739,10 +3808,11 @@ nfsv4_setsequence(struct nfsmount *nmp, 
 			 * This RPC attempt will fail when it calls
 			 * newnfs_request().
 			 */
-			if ((nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF)
+			if (nmp != NULL &&
+			    (nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF)
 			    != 0) {
 				mtx_unlock(&sep->nfsess_mtx);
-				return;
+				return (ESTALE);
 			}
 			/* Wake up once/sec, to check for a forced dismount. */
 			(void)mtx_sleep(&sep->nfsess_slots, &sep->nfsess_mtx,
@@ -3758,21 +3828,9 @@ nfsv4_setsequence(struct nfsmount *nmp, 
 	}
 	bcopy(sep->nfsess_sessionid, sessionid, NFSX_V4SESSIONID);
 	mtx_unlock(&sep->nfsess_mtx);
-	KASSERT(maxslot >= 0, ("nfscl_setsequence neg maxslot"));
-
-	/* Build the Sequence arguments. */
-	NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID + 4 * NFSX_UNSIGNED);
-	bcopy(sessionid, tl, NFSX_V4SESSIONID);
-	tl += NFSX_V4SESSIONID / NFSX_UNSIGNED;
-	nd->nd_slotseq = tl;
-	*tl++ = txdr_unsigned(slotseq);
-	*tl++ = txdr_unsigned(slotpos);
-	*tl++ = txdr_unsigned(maxslot);
-	if (dont_replycache == 0)
-		*tl = newnfs_true;
-	else
-		*tl = newnfs_false;
-	nd->nd_flag |= ND_HASSEQUENCE;
+	*slotposp = slotpos;
+	*maxslotp = maxslot;
+	return (0);
 }
 
 /*

Modified: head/sys/fs/nfs/nfs_var.h
==============================================================================
--- head/sys/fs/nfs/nfs_var.h	Tue Jul  1 20:00:35 2014	(r268114)
+++ head/sys/fs/nfs/nfs_var.h	Tue Jul  1 20:47:16 2014	(r268115)
@@ -61,6 +61,7 @@ union nethostaddr;
 struct nfsstate;
 struct nfslock;
 struct nfsclient;
+struct nfsdsession;
 struct nfslockconflict;
 struct nfsd_idargs;
 struct nfsd_clid;
@@ -90,8 +91,11 @@ NFS_READDIR_ARGS;
 /* nfs_nfsdstate.c */
 int nfsrv_setclient(struct nfsrv_descript *, struct nfsclient **,
     nfsquad_t *, nfsquad_t *, NFSPROC_T *);
-int nfsrv_getclient(nfsquad_t, int, struct nfsclient **, nfsquad_t,
-    struct nfsrv_descript *, NFSPROC_T *);
+int nfsrv_getclient(nfsquad_t, int, struct nfsclient **, struct nfsdsession *,
+    nfsquad_t, uint32_t, struct nfsrv_descript *, NFSPROC_T *);
+int nfsrv_destroyclient(nfsquad_t, NFSPROC_T *);
+int nfsrv_destroysession(struct nfsrv_descript *, uint8_t *);
+int nfsrv_freestateid(struct nfsrv_descript *, nfsv4stateid_t *, NFSPROC_T *);
 int nfsrv_adminrevoke(struct nfsd_clid *, NFSPROC_T *);
 void nfsrv_dumpclients(struct nfsd_dumpclients *, int);
 void nfsrv_dumplocks(vnode_t, struct nfsd_dumplocks *, int, NFSPROC_T *);
@@ -105,8 +109,8 @@ int nfsrv_opencheck(nfsquad_t, nfsv4stat
     vnode_t, struct nfsrv_descript *, NFSPROC_T *, int);
 int nfsrv_openupdate(vnode_t, struct nfsstate *, nfsquad_t,
     nfsv4stateid_t *, struct nfsrv_descript *, NFSPROC_T *);
-int nfsrv_delegupdate(nfsquad_t, nfsv4stateid_t *, vnode_t, int,
-    struct ucred *, NFSPROC_T *);
+int nfsrv_delegupdate(struct nfsrv_descript *, nfsquad_t, nfsv4stateid_t *,
+    vnode_t, int, struct ucred *, NFSPROC_T *);
 int nfsrv_releaselckown(struct nfsstate *, nfsquad_t, NFSPROC_T *);
 void nfsrv_zapclient(struct nfsclient *, NFSPROC_T *);
 int nfssvc_idname(struct nfsd_idargs *);
@@ -127,6 +131,10 @@ int nfsrv_checkgetattr(struct nfsrv_desc
 int nfsrv_nfsuserdport(u_short, NFSPROC_T *);
 void nfsrv_nfsuserddelport(void);
 void nfsrv_throwawayallstate(NFSPROC_T *);
+int nfsrv_checksequence(struct nfsrv_descript *, uint32_t, uint32_t *,
+    uint32_t *, int, uint32_t *, NFSPROC_T *);
+int nfsrv_checkreclaimcomplete(struct nfsrv_descript *);
+void nfsrv_cache_session(uint8_t *, uint32_t, int, struct mbuf **);
 
 /* nfs_nfsdserv.c */
 int nfsrvd_access(struct nfsrv_descript *, int,
@@ -211,10 +219,27 @@ int nfsrvd_releaselckown(struct nfsrv_de
     vnode_t, NFSPROC_T *, struct nfsexstuff *);
 int nfsrvd_pathconf(struct nfsrv_descript *, int,
     vnode_t, NFSPROC_T *, struct nfsexstuff *);
+int nfsrvd_exchangeid(struct nfsrv_descript *, int,
+    vnode_t, NFSPROC_T *, struct nfsexstuff *);
+int nfsrvd_createsession(struct nfsrv_descript *, int,
+    vnode_t, NFSPROC_T *, struct nfsexstuff *);
+int nfsrvd_sequence(struct nfsrv_descript *, int,
+    vnode_t, NFSPROC_T *, struct nfsexstuff *);
+int nfsrvd_reclaimcomplete(struct nfsrv_descript *, int,
+    vnode_t, NFSPROC_T *, struct nfsexstuff *);
+int nfsrvd_destroyclientid(struct nfsrv_descript *, int,
+    vnode_t, NFSPROC_T *, struct nfsexstuff *);
+int nfsrvd_destroysession(struct nfsrv_descript *, int,
+    vnode_t, NFSPROC_T *, struct nfsexstuff *);
+int nfsrvd_freestateid(struct nfsrv_descript *, int,
+    vnode_t, NFSPROC_T *, struct nfsexstuff *);
+int nfsrvd_notsupp(struct nfsrv_descript *, int,
+    vnode_t, NFSPROC_T *, struct nfsexstuff *);
 
 /* nfs_nfsdsocket.c */
 void nfsrvd_rephead(struct nfsrv_descript *);
-void nfsrvd_dorpc(struct nfsrv_descript *, int, NFSPROC_T *);
+void nfsrvd_dorpc(struct nfsrv_descript *, int, u_char *, int, u_int32_t,
+    NFSPROC_T *);
 
 /* nfs_nfsdcache.c */
 void nfsrvd_initcache(void);
@@ -264,9 +289,11 @@ int nfsv4_getipaddr(struct nfsrv_descrip
     int *);
 int nfsv4_seqsession(uint32_t, uint32_t, uint32_t, struct nfsslot *,
     struct mbuf **, uint16_t);
-void nfsv4_seqsess_cacherep(uint32_t, struct nfsslot *, struct mbuf *);
+void nfsv4_seqsess_cacherep(uint32_t, struct nfsslot *, int, struct mbuf **);
 void nfsv4_setsequence(struct nfsmount *, struct nfsrv_descript *,
     struct nfsclsession *, int);
+int nfsv4_sequencelookup(struct nfsmount *, struct nfsclsession *, int *,
+    int *, uint32_t *, uint8_t *);
 void nfsv4_freeslot(struct nfsclsession *, int);
 
 /* nfs_clcomsubs.c */
@@ -322,6 +349,8 @@ int nfsrv_parsename(struct nfsrv_descrip
     NFSPATHLEN_T *);
 void nfsd_init(void);
 int nfsd_checkrootexp(struct nfsrv_descript *);
+void nfsd_getminorvers(struct nfsrv_descript *, u_char *, u_char **, int *,
+    u_int32_t *);
 
 /* nfs_clvfsops.c */
 void nfscl_retopts(struct nfsmount *, char *, size_t);
@@ -628,6 +657,7 @@ int nfsvno_advlock(vnode_t, int, u_int64
 int nfsrv_v4rootexport(void *, struct ucred *, NFSPROC_T *);
 int nfsvno_testexp(struct nfsrv_descript *, struct nfsexstuff *);
 uint32_t nfsrv_hashfh(fhandle_t *);
+uint32_t nfsrv_hashsessionid(uint8_t *);
 void nfsrv_backupstable(void);
 
 /* nfs_commonkrpc.c */

Modified: head/sys/fs/nfs/nfsclstate.h
==============================================================================
--- head/sys/fs/nfs/nfsclstate.h	Tue Jul  1 20:00:35 2014	(r268114)
+++ head/sys/fs/nfs/nfsclstate.h	Tue Jul  1 20:47:16 2014	(r268115)
@@ -57,6 +57,7 @@ struct nfsclsession {
 	struct mtx	nfsess_mtx;
 	struct nfsslot	nfsess_cbslots[NFSV4_CBSLOTS];
 	nfsquad_t	nfsess_clientid;
+	SVCXPRT		*nfsess_xprt;		/* For backchannel callback */
 	uint32_t	nfsess_slotseq[64];	/* Max for 64bit nm_slots */
 	uint64_t	nfsess_slots;
 	uint32_t	nfsess_sequenceid;

Modified: head/sys/fs/nfs/nfsdport.h
==============================================================================
--- head/sys/fs/nfs/nfsdport.h	Tue Jul  1 20:00:35 2014	(r268114)
+++ head/sys/fs/nfs/nfsdport.h	Tue Jul  1 20:47:16 2014	(r268115)
@@ -115,3 +115,9 @@ struct nfsexstuff {
 #define	NFSRV_MINFH	(sizeof (fhandle_t))
 #define	NFSRV_MAXFH	(sizeof (fhandle_t))
 
+/* Use this macro for debug printfs. */
+#define	NFSD_DEBUG(level, ...)	do {					\
+		if (nfsd_debuglevel >= (level))				\
+			printf(__VA_ARGS__);				\
+	} while (0)
+

Modified: head/sys/fs/nfs/nfsport.h
==============================================================================
--- head/sys/fs/nfs/nfsport.h	Tue Jul  1 20:00:35 2014	(r268114)
+++ head/sys/fs/nfs/nfsport.h	Tue Jul  1 20:47:16 2014	(r268115)
@@ -638,6 +638,9 @@ void nfsrvd_rcv(struct socket *, void *,
 #define	NFSUNLOCKSOCKREQ(r)	mtx_unlock(&((r)->nr_mtx))
 #define	NFSLOCKDS(d)		mtx_lock(&((d)->nfsclds_mtx))
 #define	NFSUNLOCKDS(d)		mtx_unlock(&((d)->nfsclds_mtx))
+#define	NFSSESSIONMUTEXPTR(s)	(&((s)->mtx))
+#define	NFSLOCKSESSION(s)	mtx_lock(&((s)->mtx))
+#define	NFSUNLOCKSESSION(s)	mtx_unlock(&((s)->mtx))
 
 /*
  * Use these macros to initialize/free a mutex.
@@ -733,6 +736,7 @@ MALLOC_DECLARE(M_NEWNFSDEVINFO);
 MALLOC_DECLARE(M_NEWNFSSOCKREQ);
 MALLOC_DECLARE(M_NEWNFSCLDS);
 MALLOC_DECLARE(M_NEWNFSLAYRECALL);
+MALLOC_DECLARE(M_NEWNFSDSESSION);
 #define	M_NFSRVCACHE	M_NEWNFSRVCACHE
 #define	M_NFSDCLIENT	M_NEWNFSDCLIENT
 #define	M_NFSDSTATE	M_NEWNFSDSTATE
@@ -758,6 +762,7 @@ MALLOC_DECLARE(M_NEWNFSLAYRECALL);
 #define	M_NFSSOCKREQ	M_NEWNFSSOCKREQ
 #define	M_NFSCLDS	M_NEWNFSCLDS
 #define	M_NFSLAYRECALL	M_NEWNFSLAYRECALL
+#define	M_NFSDSESSION	M_NEWNFSDSESSION
 
 #define	NFSINT_SIGMASK(set) 						\
 	(SIGISMEMBER(set, SIGINT) || SIGISMEMBER(set, SIGTERM) ||	\

Modified: head/sys/fs/nfs/nfsproto.h
==============================================================================
--- head/sys/fs/nfs/nfsproto.h	Tue Jul  1 20:00:35 2014	(r268114)
+++ head/sys/fs/nfs/nfsproto.h	Tue Jul  1 20:47:16 2014	(r268115)
@@ -389,9 +389,13 @@
 #define	NFSV4OPEN_CLAIMPREVIOUS		1
 #define	NFSV4OPEN_CLAIMDELEGATECUR	2
 #define	NFSV4OPEN_CLAIMDELEGATEPREV	3
+#define	NFSV4OPEN_CLAIMFH		4
+#define	NFSV4OPEN_CLAIMDELEGATECURFH	5
+#define	NFSV4OPEN_CLAIMDELEGATEPREVFH	6
 #define	NFSV4OPEN_DELEGATENONE		0
 #define	NFSV4OPEN_DELEGATEREAD		1
 #define	NFSV4OPEN_DELEGATEWRITE		2
+#define	NFSV4OPEN_DELEGATENONEEXT	3
 #define	NFSV4OPEN_LIMITSIZE		1
 #define	NFSV4OPEN_LIMITBLOCKS		2
 
@@ -479,6 +483,14 @@
 #define	NFSV4OPEN_ACCESSREAD		0x00000001
 #define	NFSV4OPEN_ACCESSWRITE		0x00000002
 #define	NFSV4OPEN_ACCESSBOTH		0x00000003
+#define	NFSV4OPEN_WANTDELEGMASK		0x0000ff00
+#define	NFSV4OPEN_WANTREADDELEG		0x00000100
+#define	NFSV4OPEN_WANTWRITEDELEG	0x00000200
+#define	NFSV4OPEN_WANTANYDELEG		0x00000300
+#define	NFSV4OPEN_WANTNODELEG		0x00000400
+#define	NFSV4OPEN_WANTCANCEL		0x00000500
+#define	NFSV4OPEN_WANTSIGNALDELEG	0x00010000
+#define	NFSV4OPEN_WANTPUSHDELEG		0x00020000
 
 #define	NFSV4OPEN_DENYNONE		0x00000000
 #define	NFSV4OPEN_DENYREAD		0x00000001
@@ -486,16 +498,35 @@
 #define	NFSV4OPEN_DENYBOTH		0x00000003
 
 /*
+ * Delegate_none_ext reply values.
+ */
+#define	NFSV4OPEN_NOTWANTED		0
+#define	NFSV4OPEN_CONTENTION		1
+#define	NFSV4OPEN_RESOURCE		2
+#define	NFSV4OPEN_NOTSUPPFTYPE		3
+#define	NFSV4OPEN_NOTSUPPWRITEFTYPE	4
+#define	NFSV4OPEN_NOTSUPPUPGRADE	5
+#define	NFSV4OPEN_NOTSUPPDOWNGRADE	6
+#define	NFSV4OPEN_CANCELLED		7
+#define	NFSV4OPEN_ISDIR			8
+
+/*
  * Open result flags
- * (The first two are in the spec. The rest are used internally.)
+ * (The first four are in the spec. The rest are used internally.)
  */
 #define	NFSV4OPEN_RESULTCONFIRM		0x00000002
 #define	NFSV4OPEN_LOCKTYPEPOSIX		0x00000004
+#define	NFSV4OPEN_PRESERVEUNLINKED	0x00000008
+#define	NFSV4OPEN_MAYNOTIFYLOCK		0x00000020
 #define	NFSV4OPEN_RFLAGS 						\
-		(NFSV4OPEN_RESULTCONFIRM | NFSV4OPEN_LOCKTYPEPOSIX)
+    (NFSV4OPEN_RESULTCONFIRM | NFSV4OPEN_LOCKTYPEPOSIX |		\
+    NFSV4OPEN_PRESERVEUNLINKED | NFSV4OPEN_MAYNOTIFYLOCK)
 #define	NFSV4OPEN_RECALL		0x00010000
 #define	NFSV4OPEN_READDELEGATE		0x00020000
 #define	NFSV4OPEN_WRITEDELEGATE		0x00040000
+#define	NFSV4OPEN_WDRESOURCE		0x00080000
+#define	NFSV4OPEN_WDCONTENTION		0x00100000
+#define	NFSV4OPEN_WDNOTWANTED		0x00200000
 
 /*
  * NFS V4 File Handle types
@@ -805,6 +836,27 @@ struct nfsv3_sattr {
 #define	NFSATTRBIT_TIMEMODIFY		53
 #define	NFSATTRBIT_TIMEMODIFYSET	54
 #define	NFSATTRBIT_MOUNTEDONFILEID	55
+#define	NFSATTRBIT_DIRNOTIFDELAY	56
+#define	NFSATTRBIT_DIRENTNOTIFDELAY	57
+#define	NFSATTRBIT_DACL			58
+#define	NFSATTRBIT_SACL			59
+#define	NFSATTRBIT_CHANGEPOLICY		60
+#define	NFSATTRBIT_FSSTATUS		61
+#define	NFSATTRBIT_FSLAYOUTTYPE		62
+#define	NFSATTRBIT_LAYOUTHINT		63
+#define	NFSATTRBIT_LAYOUTTYPE		64
+#define	NFSATTRBIT_LAYOUTBLKSIZE	65
+#define	NFSATTRBIT_LAYOUTALIGNMENT	66
+#define	NFSATTRBIT_FSLOCATIONSINFO	67
+#define	NFSATTRBIT_MDSTHRESHOLD		68
+#define	NFSATTRBIT_RETENTIONGET		69
+#define	NFSATTRBIT_RETENTIONSET		70
+#define	NFSATTRBIT_RETENTEVTGET		71
+#define	NFSATTRBIT_RETENTEVTSET		72
+#define	NFSATTRBIT_RETENTIONHOLD	73
+#define	NFSATTRBIT_MODESETMASKED	74
+#define	NFSATTRBIT_SUPPATTREXCLCREAT	75
+#define	NFSATTRBIT_FSCHARSETCAP		76
 
 #define	NFSATTRBM_SUPPORTEDATTRS	0x00000001
 #define	NFSATTRBM_TYPE			0x00000002
@@ -862,8 +914,29 @@ struct nfsv3_sattr {
 #define	NFSATTRBM_TIMEMODIFY		0x00200000
 #define	NFSATTRBM_TIMEMODIFYSET		0x00400000
 #define	NFSATTRBM_MOUNTEDONFILEID	0x00800000
+#define	NFSATTRBM_DIRNOTIFDELAY		0x01000000
+#define	NFSATTRBM_DIRENTNOTIFDELAY	0x02000000
+#define	NFSATTRBM_DACL			0x04000000
+#define	NFSATTRBM_SACL			0x08000000
+#define	NFSATTRBM_CHANGEPOLICY		0x10000000
+#define	NFSATTRBM_FSSTATUS		0x20000000
+#define	NFSATTRBM_FSLAYOUTTYPE		0x40000000
+#define	NFSATTRBM_LAYOUTHINT		0x80000000
+#define	NFSATTRBM_LAYOUTTYPE		0x00000001
+#define	NFSATTRBM_LAYOUTBLKSIZE		0x00000002
+#define	NFSATTRBM_LAYOUTALIGNMENT	0x00000004
+#define	NFSATTRBM_FSLOCATIONSINFO	0x00000008
+#define	NFSATTRBM_MDSTHRESHOLD		0x00000010
+#define	NFSATTRBM_RETENTIONGET		0x00000020
+#define	NFSATTRBM_RETENTIONSET		0x00000040
+#define	NFSATTRBM_RETENTEVTGET		0x00000080
+#define	NFSATTRBM_RETENTEVTSET		0x00000100
+#define	NFSATTRBM_RETENTIONHOLD		0x00000200
+#define	NFSATTRBM_MODESETMASKED		0x00000400
+#define	NFSATTRBM_SUPPATTREXCLCREAT	0x00000800
+#define	NFSATTRBM_FSCHARSETCAP		0x00001000
 
-#define	NFSATTRBIT_MAX			56
+#define	NFSATTRBIT_MAX			77
 
 /*
  * Sets of attributes that are supported, by words in the bitmap.
@@ -871,6 +944,7 @@ struct nfsv3_sattr {
 /*
  * NFSATTRBIT_SUPPORTED - SUPP0 - bits 0<->31
  *			  SUPP1 - bits 32<->63
+ *			  SUPP2 - bits 64<->95
  */
 #define	NFSATTRBIT_SUPP0						\
  	(NFSATTRBM_SUPPORTEDATTRS |					\
@@ -937,6 +1011,8 @@ struct nfsv3_sattr {
 #define	NFSATTRBIT_SUPP1	NFSATTRBIT_S1
 #endif
 
+#define	NFSATTRBIT_SUPP2	NFSATTRBM_SUPPATTREXCLCREAT
+
 /*
  * NFSATTRBIT_SUPPSETONLY is the OR of NFSATTRBIT_TIMEACCESSSET and
  * NFSATTRBIT_TIMEMODIFYSET.
@@ -947,6 +1023,7 @@ struct nfsv3_sattr {
 /*
  * NFSATTRBIT_SETABLE - SETABLE0 - bits 0<->31
  *			SETABLE1 - bits 32<->63
+ *			SETABLE2 - bits 64<->95
  */
 #define	NFSATTRBIT_SETABLE0						\
 	(NFSATTRBM_SIZE |						\
@@ -957,6 +1034,7 @@ struct nfsv3_sattr {
  	NFSATTRBM_OWNERGROUP |						\
  	NFSATTRBM_TIMEACCESSSET |					\
  	NFSATTRBM_TIMEMODIFYSET)
+#define	NFSATTRBIT_SETABLE2		0
 
 /*
  * Set of attributes that the getattr vnode op needs.
@@ -987,6 +1065,11 @@ struct nfsv3_sattr {
  	NFSATTRBM_TIMEMODIFY)
 
 /*
+ * NFSATTRBIT_GETATTR2 - bits 64<->95
+ */
+#define	NFSATTRBIT_GETATTR2		0
+
+/*
  * Subset of the above that the Write RPC gets.
  * OR of the following bits.
  * NFSATTRBIT_WRITEGETATTR0 - bits 0<->31
@@ -1013,6 +1096,11 @@ struct nfsv3_sattr {
  	NFSATTRBM_TIMEMODIFY)
 
 /*
+ * NFSATTRBIT_WRITEGETATTR2 - bits 64<->95
+ */
+#define	NFSATTRBIT_WRITEGETATTR2	0
+
+/*
  * Set of attributes that the wccattr operation op needs.
  * OR of the following bits.
  * NFSATTRBIT_WCCATTR0 - bits 0<->31
@@ -1026,6 +1114,11 @@ struct nfsv3_sattr {
  	(NFSATTRBM_TIMEMODIFY)
 
 /*
+ * NFSATTRBIT_WCCATTR2 - bits 64<->95
+ */
+#define	NFSATTRBIT_WCCATTR2		0
+
+/*
  * NFSATTRBIT_CBGETATTR0 - bits 0<->31
  */
 #define	NFSATTRBIT_CBGETATTR0	(NFSATTRBM_CHANGE | NFSATTRBM_SIZE)
@@ -1036,6 +1129,11 @@ struct nfsv3_sattr {
 #define	NFSATTRBIT_CBGETATTR1		0x0
 
 /*
+ * NFSATTRBIT_CBGETATTR2 - bits 64<->95
+ */
+#define	NFSATTRBIT_CBGETATTR2		0x0
+
+/*
  * Sets of attributes that require a VFS_STATFS() call to get the
  * values of.
  * NFSATTRBIT_STATFS0 - bits 0<->31
@@ -1067,6 +1165,11 @@ struct nfsv3_sattr {
 	NFSATTRBM_TIMEDELTA)
 
 /*
+ * NFSATTRBIT_STATFS2 - bits 64<->95
+ */
+#define	NFSATTRBIT_STATFS2		0
+
+/*
  * These are the bits that are needed by the nfs_statfs() call.
  * (The regular getattr bits are or'd in so the vnode gets the correct
  *  type, etc.)
@@ -1094,6 +1197,11 @@ struct nfsv3_sattr {
 				NFSATTRBM_TIMEDELTA)
 
 /*
+ * NFSGETATTRBIT_STATFS2 - bits 64<->95
+ */
+#define	NFSGETATTRBIT_STATFS2		0
+
+/*
  * Set of attributes for the equivalent of an nfsv3 pathconf rpc.
  * NFSGETATTRBIT_PATHCONF0 - bits 0<->31
  */
@@ -1111,6 +1219,11 @@ struct nfsv3_sattr {
 				NFSATTRBM_NOTRUNC)
 
 /*
+ * NFSGETATTRBIT_PATHCONF2 - bits 64<->95
+ */
+#define	NFSGETATTRBIT_PATHCONF2		0
+
+/*
  * Sets of attributes required by readdir and readdirplus.
  * NFSATTRBIT_READDIRPLUS0	(NFSATTRBIT_GETATTR0 | NFSATTRBIT_FILEHANDLE |
  *				 NFSATTRBIT_RDATTRERROR)
@@ -1118,6 +1231,7 @@ struct nfsv3_sattr {
 #define	NFSATTRBIT_READDIRPLUS0	(NFSATTRBIT_GETATTR0 | NFSATTRBM_FILEHANDLE | \
 				NFSATTRBM_RDATTRERROR)
 #define	NFSATTRBIT_READDIRPLUS1	NFSATTRBIT_GETATTR1
+#define	NFSATTRBIT_READDIRPLUS2		0
 
 /*
  * Set of attributes supported by Referral vnodes.
@@ -1125,6 +1239,7 @@ struct nfsv3_sattr {
 #define	NFSATTRBIT_REFERRAL0	(NFSATTRBM_TYPE | NFSATTRBM_FSID |	\
 	NFSATTRBM_RDATTRERROR | NFSATTRBM_FSLOCATIONS)
 #define	NFSATTRBIT_REFERRAL1	NFSATTRBM_MOUNTEDONFILEID
+#define	NFSATTRBIT_REFERRAL2		0
 
 /*
  * Structure for data handled by the statfs rpc. Since some fields are

Modified: head/sys/fs/nfs/nfsrvstate.h
==============================================================================
--- head/sys/fs/nfs/nfsrvstate.h	Tue Jul  1 20:00:35 2014	(r268114)
+++ head/sys/fs/nfs/nfsrvstate.h	Tue Jul  1 20:47:16 2014	(r268115)
@@ -42,6 +42,8 @@ LIST_HEAD(nfsclienthashhead, nfsclient);
 LIST_HEAD(nfsstatehead, nfsstate);
 LIST_HEAD(nfslockhead, nfslock);
 LIST_HEAD(nfslockhashhead, nfslockfile);
+LIST_HEAD(nfssessionhead, nfsdsession);
+LIST_HEAD(nfssessionhashhead, nfsdsession);
 
 /*
  * List head for nfsusrgrp.
@@ -64,6 +66,13 @@ TAILQ_HEAD(nfsuserlruhead, nfsusrgrp);
 	(&nfsgroupnamehash[((l)>=4?(*(p)+*((p)+1)+*((p)+2)+*((p)+3)):*(p)) \
 		% NFSGROUPHASHSIZE])
 
+struct nfssessionhash {
+	struct mtx			mtx;
+	struct nfssessionhashhead	list;
+};
+#define	NFSSESSIONHASH(f) 						\
+	(&nfssessionhash[nfsrv_hashsessionid(f) % NFSSESSIONHASHSIZE])
+
 /*
  * Client server structure for V4. It is doubly linked into two lists.
  * The first is a hash table based on the clientid and the second is a
@@ -76,6 +85,7 @@ struct nfsclient {
 	struct nfsstatehead lc_open;		/* Open owner list */
 	struct nfsstatehead lc_deleg;		/* Delegations */
 	struct nfsstatehead lc_olddeleg;	/* and old delegations */
+	struct nfssessionhead lc_session;	/* List of NFSv4.1 sessions */
 	time_t		lc_expiry;		/* Expiry time (sec) */
 	time_t		lc_delegtime;		/* Old deleg expiry (sec) */
 	nfsquad_t	lc_clientid;		/* 64 bit clientid */
@@ -101,6 +111,43 @@ struct nfsclient {
 #define	CLOPS_RENEWOP		0x0004
 
 /*
+ * Structure for an NFSv4.1 session.
+ * Locking rules for this structure.
+ * To add/delete one of these structures from the lists, you must lock
+ * both: NFSLOCKSESSION(session hashhead) and NFSLOCKSTATE() in that order.
+ * To traverse the lists looking for one of these, you must hold one
+ * of these two locks.
+ * The exception is if the thread holds the exclusive root sleep lock.
+ * In this case, all other nfsd threads are blocked, so locking the
+ * mutexes isn't required.
+ * When manipulating sess_refcnt, NFSLOCKSTATE() must be locked.
+ * When manipulating the fields withinsess_cbsess except nfsess_xprt,
+ * sess_cbsess.nfsess_mtx must be locked.
+ * When manipulating sess_slots and sess_cbsess.nfsess_xprt,
+ * NFSLOCKSESSION(session hashhead) must be locked.
+ */
+struct nfsdsession {
+	uint64_t		sess_refcnt;	/* Reference count. */
+	LIST_ENTRY(nfsdsession)	sess_hash;	/* Hash list of sessions. */
+	LIST_ENTRY(nfsdsession)	sess_list;	/* List of client sessions. */
+	struct nfsslot		sess_slots[NFSV4_SLOTS];
+	struct nfsclient	*sess_clp;	/* Associated clientid. */
+	uint32_t		sess_crflags;
+	uint32_t		sess_cbprogram;
+	uint32_t		sess_maxreq;
+	uint32_t		sess_maxresp;
+	uint32_t		sess_maxrespcached;
+	uint32_t		sess_maxops;
+	uint32_t		sess_maxslots;
+	uint32_t		sess_cbmaxreq;
+	uint32_t		sess_cbmaxresp;
+	uint32_t		sess_cbmaxrespcached;
+	uint32_t		sess_cbmaxops;
+	uint8_t			sess_sessionid[NFSX_V4SESSIONID];
+	struct nfsclsession	sess_cbsess;	/* Callback session. */
+};
+
+/*
  * Nfs state structure. I couldn't resist overloading this one, since
  * it makes cleanup, etc. simpler. These structures are used in four ways:
  * - open_owner structures chained off of nfsclient

Modified: head/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clstate.c	Tue Jul  1 20:00:35 2014	(r268114)
+++ head/sys/fs/nfsclient/nfs_clstate.c	Tue Jul  1 20:47:16 2014	(r268115)
@@ -3548,7 +3548,7 @@ out:
 		if (clp != NULL) {
 			nfsv4_seqsess_cacherep(slotid,
 			    NFSMNT_MDSSESSION(clp->nfsc_nmp)->nfsess_cbslots,
-			    rep);
+			    NFSERR_OK, &rep);
 			NFSUNLOCKCLSTATE();
 		} else {
 			NFSUNLOCKCLSTATE();

Modified: head/sys/fs/nfsserver/nfs_nfsdcache.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdcache.c	Tue Jul  1 20:00:35 2014	(r268114)
+++ head/sys/fs/nfsserver/nfs_nfsdcache.c	Tue Jul  1 20:47:16 2014	(r268115)
@@ -977,6 +977,9 @@ nfsrvd_refcache(struct nfsrvcache *rp)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 20:57:40 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 906E134A;
 Tue,  1 Jul 2014 20:57:40 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2EAB82DA5;
 Tue,  1 Jul 2014 20:57:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61KvedD094963;
 Tue, 1 Jul 2014 20:57:40 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61Kvdbd094960;
 Tue, 1 Jul 2014 20:57:39 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201407012057.s61Kvdbd094960@svn.freebsd.org>
From: Xin LI 
Date: Tue, 1 Jul 2014 20:57:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268116 - in head:
 cddl/contrib/opensolaris/lib/libzfs/common
 sys/cddl/contrib/opensolaris/common/zfs
 sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 20:57:40 -0000

Author: delphij
Date: Tue Jul  1 20:57:39 2014
New Revision: 268116
URL: http://svnweb.freebsd.org/changeset/base/268116

Log:
   - Fix handling of "new" style of ioctl in compatiblity mode [1];
   - Reorganize code and reduce diff from upstream;
   - Improve forward compatibility shims for previous kernel;
  
  Reported by:	sbruno [1]
  X-MFC-With:	r268075

Modified:
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c
  head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c	Tue Jul  1 20:47:16 2014	(r268115)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c	Tue Jul  1 20:57:39 2014	(r268116)
@@ -72,16 +72,23 @@ zcmd_ioctl(int fd, int request, zfs_cmd_
 	if (zfs_ioctl_version == ZFS_IOCVER_UNDEF)
 		zfs_ioctl_version = get_zfs_ioctl_version();
 
-	if (zfs_ioctl_version == ZFS_IOCVER_LZC)
-		cflag = ZFS_CMD_COMPAT_LZC;
-	else if (zfs_ioctl_version == ZFS_IOCVER_DEADMAN)
-		cflag = ZFS_CMD_COMPAT_DEADMAN;
-
-	/*
-	 * If vfs.zfs.version.ioctl is not defined, assume we have v28
-	 * compatible binaries and use vfs.zfs.version.spa to test for v15
-	 */
-	if (zfs_ioctl_version < ZFS_IOCVER_DEADMAN) {
+	if (zfs_ioctl_version >= ZFS_IOCVER_DEADMAN) {
+		switch (zfs_ioctl_version) {
+		case ZFS_IOCVER_ZCMD:
+			cflag = ZFS_CMD_COMPAT_ZCMD;
+			break;
+		case ZFS_IOCVER_LZC:
+			cflag = ZFS_CMD_COMPAT_LZC;
+			break;
+		case ZFS_IOCVER_DEADMAN:
+			cflag = ZFS_CMD_COMPAT_DEADMAN;
+			break;
+		}
+	} else {
+		/*
+		 * If vfs.zfs.version.ioctl is not defined, assume we have v28
+		 * compatible binaries and use vfs.zfs.version.spa to test for v15
+		 */
 		cflag = ZFS_CMD_COMPAT_V28;
 
 		if (zfs_spa_version < 0)

Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c	Tue Jul  1 20:47:16 2014	(r268115)
+++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c	Tue Jul  1 20:57:39 2014	(r268116)
@@ -697,6 +697,12 @@ zcmd_ioctl_compat(int fd, int request, z
 		zp.zfs_cmd_size = sizeof(zfs_cmd_t);
 		zp.zfs_ioctl_version = ZFS_IOCVER_CURRENT;
 		return (ioctl(fd, ncmd, &zp));
+	case ZFS_CMD_COMPAT_ZCMD:
+		ncmd = _IOWR('Z', request, struct zfs_iocparm);
+		zp.zfs_cmd = (uint64_t)zc;
+		zp.zfs_cmd_size = sizeof(zfs_cmd_zcmd_t);
+		zp.zfs_ioctl_version = ZFS_IOCVER_ZCMD;
+		return (ioctl(fd, ncmd, &zp));
 	case ZFS_CMD_COMPAT_LZC:
 		ncmd = _IOWR('Z', request, struct zfs_cmd);
 		return (ioctl(fd, ncmd, zc));
@@ -794,7 +800,8 @@ zfs_ioctl_compat_innvl(zfs_cmd_t *zc, nv
 	char *poolname, *snapname;
 	int err;
 
-	if (cflag == ZFS_CMD_COMPAT_NONE || cflag == ZFS_CMD_COMPAT_LZC)
+	if (cflag == ZFS_CMD_COMPAT_NONE || cflag == ZFS_CMD_COMPAT_LZC ||
+	    cflag == ZFS_CMD_COMPAT_ZCMD)
 		goto out;
 
 	switch (vec) {
@@ -945,7 +952,8 @@ zfs_ioctl_compat_outnvl(zfs_cmd_t *zc, n
 {
 	nvlist_t *tmpnvl;
 
-	if (cflag == ZFS_CMD_COMPAT_NONE || cflag == ZFS_CMD_COMPAT_LZC)
+	if (cflag == ZFS_CMD_COMPAT_NONE || cflag == ZFS_CMD_COMPAT_LZC ||
+	    cflag == ZFS_CMD_COMPAT_ZCMD)
 		return (outnvl);
 
 	switch (vec) {

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Tue Jul  1 20:47:16 2014	(r268115)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Tue Jul  1 20:57:39 2014	(r268116)
@@ -24,6 +24,7 @@
  * Copyright (c) 2011-2012 Pawel Jakub Dawidek .
  * All rights reserved.
  * Copyright 2013 Martin Matuska . All rights reserved.
+ * Copyright 2014 Xin Li . All rights reserved.
  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 2014, Joyent, Inc. All rights reserved.
  * Copyright (c) 2013 by Delphix. All rights reserved.
@@ -5922,6 +5923,7 @@ zfsdev_ioctl(struct cdev *dev, u_long zc
 	zfs_iocparm_t *zc_iocparm;
 	int cflag, cmd, oldvecnum;
 	boolean_t newioc, compat;
+	void *compat_zc = NULL;
 	cred_t *cr = td->td_ucred;
 #endif
 	const zfs_ioc_vec_t *vec;
@@ -5930,10 +5932,10 @@ zfsdev_ioctl(struct cdev *dev, u_long zc
 
 	cflag = ZFS_CMD_COMPAT_NONE;
 	compat = B_FALSE;
-	newioc = B_TRUE;
+	newioc = B_TRUE;	/* "new" style (zfs_iocparm_t) ioctl */
 
 	len = IOCPARM_LEN(zcmd);
-	cmd = zcmd & 0xff;
+	vecnum = cmd = zcmd & 0xff;
 
 	/*
 	 * Check if we are talking to supported older binaries
@@ -5941,96 +5943,112 @@ zfsdev_ioctl(struct cdev *dev, u_long zc
 	 */
 	if (len != sizeof(zfs_iocparm_t)) {
 		newioc = B_FALSE;
-		if (len == sizeof(zfs_cmd_t)) {
+		compat = B_TRUE;
+
+		vecnum = cmd;
+
+		switch (len) {
+		case sizeof(zfs_cmd_zcmd_t):
 			cflag = ZFS_CMD_COMPAT_LZC;
-			vecnum = cmd;
-		} else if (len == sizeof(zfs_cmd_deadman_t)) {
+			break;
+		case sizeof(zfs_cmd_deadman_t):
 			cflag = ZFS_CMD_COMPAT_DEADMAN;
-			compat = B_TRUE;
-			vecnum = cmd;
-		} else if (len == sizeof(zfs_cmd_v28_t)) {
+			break;
+		case sizeof(zfs_cmd_v28_t):
 			cflag = ZFS_CMD_COMPAT_V28;
-			compat = B_TRUE;
-			vecnum = cmd;
-		} else if (len == sizeof(zfs_cmd_v15_t)) {
+			break;
+		case sizeof(zfs_cmd_v15_t):
 			cflag = ZFS_CMD_COMPAT_V15;
-			compat = B_TRUE;
 			vecnum = zfs_ioctl_v15_to_v28[cmd];
-		} else
+
+			/*
+			 * Return without further handling
+			 * if the command is blacklisted.
+			 */
+			if (vecnum == ZFS_IOC_COMPAT_PASS)
+				return (0);
+			else if (vecnum == ZFS_IOC_COMPAT_FAIL)
+				return (ENOTSUP);
+			break;
+		default:
 			return (EINVAL);
-	} else
-		vecnum = cmd;
+		}
+	}
 
 #ifdef illumos
 	vecnum = cmd - ZFS_IOC_FIRST;
 	ASSERT3U(getmajor(dev), ==, ddi_driver_major(zfs_dip));
 #endif
 
-	if (compat) {
-		if (vecnum == ZFS_IOC_COMPAT_PASS)
-			return (0);
-		else if (vecnum == ZFS_IOC_COMPAT_FAIL)
-			return (ENOTSUP);
-	}
-
-	/*
-	 * Check if we have sufficient kernel memory allocated
-	 * for the zfs_cmd_t request.  Bail out if not so we
-	 * will not access undefined memory region.
-	 */
 	if (vecnum >= sizeof (zfs_ioc_vec) / sizeof (zfs_ioc_vec[0]))
 		return (SET_ERROR(EINVAL));
 	vec = &zfs_ioc_vec[vecnum];
 
-#ifdef illumos
 	zc = kmem_zalloc(sizeof(zfs_cmd_t), KM_SLEEP);
-	bzero(zc, sizeof(zfs_cmd_t));
 
+#ifdef illumos
 	error = ddi_copyin((void *)arg, zc, sizeof (zfs_cmd_t), flag);
 	if (error != 0) {
 		error = SET_ERROR(EFAULT);
 		goto out;
 	}
 #else	/* !illumos */
-	/*
-	 * We don't alloc/free zc only if talking to library ioctl version 2
-	 */
-	if (cflag != ZFS_CMD_COMPAT_LZC) {
-		zc = kmem_zalloc(sizeof(zfs_cmd_t), KM_SLEEP);
-		bzero(zc, sizeof(zfs_cmd_t));
-	} else {
-		zc = (void *)arg;
-		error = 0;
-	}
+	bzero(zc, sizeof(zfs_cmd_t));
 
 	if (newioc) {
 		zc_iocparm = (void *)arg;
-		if (zc_iocparm->zfs_cmd_size != sizeof(zfs_cmd_t)) {
-			error = SET_ERROR(EFAULT);
-			goto out;
-		}
-		error = ddi_copyin((void *)(uintptr_t)zc_iocparm->zfs_cmd, zc,
-		    sizeof(zfs_cmd_t), flag);
-		if (error != 0) {
-			error = SET_ERROR(EFAULT);
+
+		switch (zc_iocparm->zfs_ioctl_version) {
+		case ZFS_IOCVER_CURRENT:
+			if (zc_iocparm->zfs_cmd_size != sizeof(zfs_cmd_t)) {
+				error = SET_ERROR(EINVAL);
+				goto out;
+			}
+			break;
+		case ZFS_IOCVER_ZCMD:
+			if (zc_iocparm->zfs_cmd_size > sizeof(zfs_cmd_t) ||
+			    zc_iocparm->zfs_cmd_size < sizeof(zfs_cmd_zcmd_t)) {
+				error = SET_ERROR(EFAULT);
+				goto out;
+			}
+			compat = B_TRUE;
+			cflag = ZFS_CMD_COMPAT_ZCMD;
+			break;
+		default:
+			error = SET_ERROR(EINVAL);
 			goto out;
+			/* NOTREACHED */
 		}
-		if (zc_iocparm->zfs_ioctl_version != ZFS_IOCVER_CURRENT) {
-			compat = B_TRUE;
 
-			switch (zc_iocparm->zfs_ioctl_version) {
-			case ZFS_IOCVER_ZCMD:
-				cflag = ZFS_CMD_COMPAT_ZCMD;
-				break;
-			default:
-				error = SET_ERROR(EINVAL);
+		if (compat) {
+			ASSERT(sizeof(zfs_cmd_t) >= zc_iocparm->zfs_cmd_size);
+			compat_zc = kmem_zalloc(sizeof(zfs_cmd_t), KM_SLEEP);
+			bzero(compat_zc, sizeof(zfs_cmd_t));
+
+			error = ddi_copyin((void *)(uintptr_t)zc_iocparm->zfs_cmd,
+			    compat_zc, zc_iocparm->zfs_cmd_size, flag);
+			if (error != 0) {
+				error = SET_ERROR(EFAULT);
+				goto out;
+			}
+		} else {
+			error = ddi_copyin((void *)(uintptr_t)zc_iocparm->zfs_cmd,
+			    zc, zc_iocparm->zfs_cmd_size, flag);
+			if (error != 0) {
+				error = SET_ERROR(EFAULT);
 				goto out;
 			}
 		}
 	}
 
 	if (compat) {
-		zfs_cmd_compat_get(zc, arg, cflag);
+		if (newioc) {
+			ASSERT(compat_zc != NULL);
+			zfs_cmd_compat_get(zc, compat_zc, cflag);
+		} else {
+			ASSERT(compat_zc == NULL);
+			zfs_cmd_compat_get(zc, arg, cflag);
+		}
 		oldvecnum = vecnum;
 		error = zfs_ioctl_compat_pre(zc, &vecnum, cflag);
 		if (error != 0)
@@ -6126,7 +6144,7 @@ zfsdev_ioctl(struct cdev *dev, u_long zc
 		fnvlist_free(lognv);
 
 		/* rewrite outnvl for backwards compatibility */
-		if (cflag != ZFS_CMD_COMPAT_NONE && cflag != ZFS_CMD_COMPAT_LZC)
+		if (compat)
 			outnvl = zfs_ioctl_compat_outnvl(zc, outnvl, vecnum,
 			    cflag);
 
@@ -6151,17 +6169,30 @@ zfsdev_ioctl(struct cdev *dev, u_long zc
 out:
 	nvlist_free(innvl);
 
-	if (compat) {
-		zfs_ioctl_compat_post(zc, cmd, cflag);
-		zfs_cmd_compat_put(zc, arg, vecnum, cflag);
-	}
-
 #ifdef illumos
 	rc = ddi_copyout(zc, (void *)arg, sizeof (zfs_cmd_t), flag);
 	if (error == 0 && rc != 0)
 		error = SET_ERROR(EFAULT);
 #else
-	if (newioc) {
+	if (compat) {
+		zfs_ioctl_compat_post(zc, cmd, cflag);
+		if (newioc) {
+			ASSERT(compat_zc != NULL);
+			ASSERT(sizeof(zfs_cmd_t) >= zc_iocparm->zfs_cmd_size);
+
+			zfs_cmd_compat_put(zc, compat_zc, vecnum, cflag);
+			rc = ddi_copyout(compat_zc,
+			    (void *)(uintptr_t)zc_iocparm->zfs_cmd,
+			    zc_iocparm->zfs_cmd_size, flag);
+			if (error == 0 && rc != 0)
+				error = SET_ERROR(EFAULT);
+			kmem_free(compat_zc, sizeof (zfs_cmd_t));
+		} else {
+			zfs_cmd_compat_put(zc, arg, vecnum, cflag);
+		}
+	} else {
+		ASSERT(newioc);
+
 		rc = ddi_copyout(zc, (void *)(uintptr_t)zc_iocparm->zfs_cmd,
 		    sizeof (zfs_cmd_t), flag);
 		if (error == 0 && rc != 0)
@@ -6178,15 +6209,7 @@ out:
 			strfree(saved_poolname);
 	}
 
-#ifdef illumos
 	kmem_free(zc, sizeof (zfs_cmd_t));
-#else
-	/*
-	 * We don't alloc/free zc only if talking to library ioctl version 2
-	 */
-	if (cflag != ZFS_CMD_COMPAT_LZC)
-		kmem_free(zc, sizeof (zfs_cmd_t));
-#endif
 	return (error);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 21:04:40 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C5A828E3;
 Tue,  1 Jul 2014 21:04:40 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B23EF2E75;
 Tue,  1 Jul 2014 21:04:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61L4ebV099427;
 Tue, 1 Jul 2014 21:04:40 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61L4e4f099426;
 Tue, 1 Jul 2014 21:04:40 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201407012104.s61L4e4f099426@svn.freebsd.org>
From: Glen Barber 
Date: Tue, 1 Jul 2014 21:04:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268117 - head/release/doc/en_US.ISO8859-1/relnotes
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 21:04:40 -0000

Author: gjb
Date: Tue Jul  1 21:04:40 2014
New Revision: 268117
URL: http://svnweb.freebsd.org/changeset/base/268117

Log:
  Document r268045, vt(4) now in GENERIC.
  Remove r260888, VT kernel configuration file is gone.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==============================================================================
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Tue Jul  1 20:57:39 2014	(r268116)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Tue Jul  1 21:04:40 2014	(r268117)
@@ -108,10 +108,6 @@
   
     Kernel Changes
 
-    The VT kernel
-      configuration file has been added, which enables the new
-      vt console driver.
-
     Support for GPS ports has been added to
       &man.uhso.4;.
 
@@ -160,6 +156,14 @@
       &man.sysctl.8; on &intel; processors with Turbo
       Boost ™ enabled has been fixed.
 
+    The VT kernel
+      configuration file has been removed, and the &man.vt.4;
+      driver is included in the GENERIC kernel.
+      To enable &man.vt.4;, enter set kern.vty=vt
+      at the &man.loader.8; prompt during boot, or add
+      kern.vty=vt to &man.loader.conf.5; and
+      reboot the system.
+
     
       Virtualization support
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 21:12:49 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 189D0CBA;
 Tue,  1 Jul 2014 21:12:49 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0584E2F45;
 Tue,  1 Jul 2014 21:12:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61LCmt6004247;
 Tue, 1 Jul 2014 21:12:48 GMT (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61LCmU4004246;
 Tue, 1 Jul 2014 21:12:48 GMT (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201407012112.s61LCmU4004246@svn.freebsd.org>
From: Rick Macklem 
Date: Tue, 1 Jul 2014 21:12:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268118 - head/sys/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 21:12:49 -0000

Author: rmacklem
Date: Tue Jul  1 21:12:48 2014
New Revision: 268118
URL: http://svnweb.freebsd.org/changeset/base/268118

Log:
  Bump __FreeBSD_version since r268115 changed the internal
  interfaces used between the NFS related modules, including
  the krpc.

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h	Tue Jul  1 21:04:40 2014	(r268117)
+++ head/sys/sys/param.h	Tue Jul  1 21:12:48 2014	(r268118)
@@ -58,7 +58,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1100025	/* Master, propagated to newvers */
+#define __FreeBSD_version 1100026	/* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 21:51:36 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0082D175;
 Tue,  1 Jul 2014 21:51:35 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DD9272260;
 Tue,  1 Jul 2014 21:51:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61LpZlf022769;
 Tue, 1 Jul 2014 21:51:35 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61LpUap022738;
 Tue, 1 Jul 2014 21:51:30 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201407012151.s61LpUap022738@svn.freebsd.org>
From: Xin LI 
Date: Tue, 1 Jul 2014 21:51:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268123 - in head: cddl/contrib/opensolaris/cmd/zdb
 cddl/contrib/opensolaris/lib/libzfs/common
 sys/cddl/contrib/opensolaris/uts/common/fs/zfs
 sys/cddl/contrib/opensolaris/uts/common/fs/...
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 21:51:36 -0000

Author: delphij
Date: Tue Jul  1 21:51:30 2014
New Revision: 268123
URL: http://svnweb.freebsd.org/changeset/base/268123

Log:
  MFV r268119:
  
  4914 zfs on-disk bookmark structure should be named *_phys_t
  
  illumos/illumos-gate@7802d7bf98dec568dadf72286893b1fe5abd8602
  
  MFC after:	2 weeks

Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_inject.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Tue Jul  1 21:51:30 2014	(r268123)
@@ -21,7 +21,7 @@
 
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
  */
 
 #include 
@@ -1035,7 +1035,8 @@ dump_dnode(objset_t *os, uint64_t object
 }
 
 static uint64_t
-blkid2offset(const dnode_phys_t *dnp, const blkptr_t *bp, const zbookmark_t *zb)
+blkid2offset(const dnode_phys_t *dnp, const blkptr_t *bp,
+    const zbookmark_phys_t *zb)
 {
 	if (dnp == NULL) {
 		ASSERT(zb->zb_level < 0);
@@ -1097,7 +1098,7 @@ snprintf_blkptr_compact(char *blkbuf, si
 }
 
 static void
-print_indirect(blkptr_t *bp, const zbookmark_t *zb,
+print_indirect(blkptr_t *bp, const zbookmark_phys_t *zb,
     const dnode_phys_t *dnp)
 {
 	char blkbuf[BP_SPRINTF_LEN];
@@ -1126,7 +1127,7 @@ print_indirect(blkptr_t *bp, const zbook
 
 static int
 visit_indirect(spa_t *spa, const dnode_phys_t *dnp,
-    blkptr_t *bp, const zbookmark_t *zb)
+    blkptr_t *bp, const zbookmark_phys_t *zb)
 {
 	int err = 0;
 
@@ -1152,7 +1153,7 @@ visit_indirect(spa_t *spa, const dnode_p
 		/* recursively visit blocks below this */
 		cbp = buf->b_data;
 		for (i = 0; i < epb; i++, cbp++) {
-			zbookmark_t czb;
+			zbookmark_phys_t czb;
 
 			SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object,
 			    zb->zb_level - 1,
@@ -1176,7 +1177,7 @@ dump_indirect(dnode_t *dn)
 {
 	dnode_phys_t *dnp = dn->dn_phys;
 	int j;
-	zbookmark_t czb;
+	zbookmark_phys_t czb;
 
 	(void) printf("Indirect blocks:\n");
 
@@ -2248,7 +2249,7 @@ zdb_blkptr_done(zio_t *zio)
 	blkptr_t *bp = zio->io_bp;
 	int ioerr = zio->io_error;
 	zdb_cb_t *zcb = zio->io_private;
-	zbookmark_t *zb = &zio->io_bookmark;
+	zbookmark_phys_t *zb = &zio->io_bookmark;
 
 	zio_data_buf_free(zio->io_data, zio->io_size);
 
@@ -2283,7 +2284,7 @@ zdb_blkptr_done(zio_t *zio)
 /* ARGSUSED */
 static int
 zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
-    const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
+    const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg)
 {
 	zdb_cb_t *zcb = arg;
 	dmu_object_type_t type;
@@ -2747,7 +2748,7 @@ typedef struct zdb_ddt_entry {
 /* ARGSUSED */
 static int
 zdb_ddt_add_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
-    const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
+    const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg)
 {
 	avl_tree_t *t = arg;
 	avl_index_t where;

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c	Tue Jul  1 21:51:30 2014	(r268123)
@@ -24,7 +24,7 @@
  */
 
 /*
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013, 2014 by Delphix. All rights reserved.
  */
 
 /*
@@ -122,7 +122,7 @@ zil_prt_rec_write(zilog_t *zilog, int tx
 {
 	char *data, *dlimit;
 	blkptr_t *bp = &lr->lr_blkptr;
-	zbookmark_t zb;
+	zbookmark_phys_t zb;
 	char buf[SPA_MAXBLOCKSIZE];
 	int verbose = MAX(dump_opt['d'], dump_opt['i']);
 	int error;

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c	Tue Jul  1 21:51:30 2014	(r268123)
@@ -22,7 +22,7 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
  * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  */
 
@@ -3513,7 +3513,7 @@ zpool_vdev_name(libzfs_handle_t *hdl, zp
 static int
 zbookmark_compare(const void *a, const void *b)
 {
-	return (memcmp(a, b, sizeof (zbookmark_t)));
+	return (memcmp(a, b, sizeof (zbookmark_phys_t)));
 }
 
 /*
@@ -3525,7 +3525,7 @@ zpool_get_errlog(zpool_handle_t *zhp, nv
 {
 	zfs_cmd_t zc = { 0 };
 	uint64_t count;
-	zbookmark_t *zb = NULL;
+	zbookmark_phys_t *zb = NULL;
 	int i;
 
 	/*
@@ -3538,7 +3538,7 @@ zpool_get_errlog(zpool_handle_t *zhp, nv
 	if (count == 0)
 		return (0);
 	if ((zc.zc_nvlist_dst = (uintptr_t)zfs_alloc(zhp->zpool_hdl,
-	    count * sizeof (zbookmark_t))) == (uintptr_t)NULL)
+	    count * sizeof (zbookmark_phys_t))) == (uintptr_t)NULL)
 		return (-1);
 	zc.zc_nvlist_dst_size = count;
 	(void) strcpy(zc.zc_name, zhp->zpool_name);
@@ -3547,11 +3547,14 @@ zpool_get_errlog(zpool_handle_t *zhp, nv
 		    &zc) != 0) {
 			free((void *)(uintptr_t)zc.zc_nvlist_dst);
 			if (errno == ENOMEM) {
+				void *dst;
+
 				count = zc.zc_nvlist_dst_size;
-				if ((zc.zc_nvlist_dst = (uintptr_t)
-				    zfs_alloc(zhp->zpool_hdl, count *
-				    sizeof (zbookmark_t))) == (uintptr_t)NULL)
+				dst = zfs_alloc(zhp->zpool_hdl, count *
+				    sizeof (zbookmark_phys_t));
+				if (dst == NULL)
 					return (-1);
+				zc.zc_nvlist_dst = (uintptr_t)dst;
 			} else {
 				return (-1);
 			}
@@ -3567,11 +3570,11 @@ zpool_get_errlog(zpool_handle_t *zhp, nv
 	 * _not_ copied as part of the process.  So we point the start of our
 	 * array appropriate and decrement the total number of elements.
 	 */
-	zb = ((zbookmark_t *)(uintptr_t)zc.zc_nvlist_dst) +
+	zb = ((zbookmark_phys_t *)(uintptr_t)zc.zc_nvlist_dst) +
 	    zc.zc_nvlist_dst_size;
 	count -= zc.zc_nvlist_dst_size;
 
-	qsort(zb, count, sizeof (zbookmark_t), zbookmark_compare);
+	qsort(zb, count, sizeof (zbookmark_phys_t), zbookmark_compare);
 
 	verify(nvlist_alloc(nverrlistp, 0, KM_SLEEP) == 0);
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Tue Jul  1 21:51:30 2014	(r268123)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
  * Copyright (c) 2014 by Saso Kiselkov. All rights reserved.
  * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
  */
@@ -780,7 +780,7 @@ typedef struct l2arc_read_callback {
 	arc_buf_t		*l2rcb_buf;		/* read buffer */
 	spa_t			*l2rcb_spa;		/* spa */
 	blkptr_t		l2rcb_bp;		/* original blkptr */
-	zbookmark_t		l2rcb_zb;		/* original bookmark */
+	zbookmark_phys_t	l2rcb_zb;		/* original bookmark */
 	int			l2rcb_flags;		/* original flags */
 	enum zio_compress	l2rcb_compress;		/* applied compress */
 } l2arc_read_callback_t;
@@ -3144,7 +3144,7 @@ arc_read_done(zio_t *zio)
 int
 arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done,
     void *private, zio_priority_t priority, int zio_flags, uint32_t *arc_flags,
-    const zbookmark_t *zb)
+    const zbookmark_phys_t *zb)
 {
 	arc_buf_hdr_t *hdr = NULL;
 	arc_buf_t *buf = NULL;
@@ -3338,7 +3338,7 @@ top:
 		 */
 		ASSERT3U(hdr->b_size, ==, size);
 		DTRACE_PROBE4(arc__miss, arc_buf_hdr_t *, hdr, blkptr_t *, bp,
-		    uint64_t, size, zbookmark_t *, zb);
+		    uint64_t, size, zbookmark_phys_t *, zb);
 		ARCSTAT_BUMP(arcstat_misses);
 		ARCSTAT_CONDSTAT(!(hdr->b_flags & ARC_PREFETCH),
 		    demand, prefetch, hdr->b_type != ARC_BUFC_METADATA,
@@ -3872,7 +3872,7 @@ arc_write(zio_t *pio, spa_t *spa, uint64
     blkptr_t *bp, arc_buf_t *buf, boolean_t l2arc, boolean_t l2arc_compress,
     const zio_prop_t *zp, arc_done_func_t *ready, arc_done_func_t *physdone,
     arc_done_func_t *done, void *private, zio_priority_t priority,
-    int zio_flags, const zbookmark_t *zb)
+    int zio_flags, const zbookmark_phys_t *zb)
 {
 	arc_buf_hdr_t *hdr = buf->b_hdr;
 	arc_write_callback_t *callback;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c	Tue Jul  1 21:51:30 2014	(r268123)
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
  */
 
 #include 
@@ -149,7 +149,7 @@ bptree_add(objset_t *os, uint64_t obj, b
 /* ARGSUSED */
 static int
 bptree_visit_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
-    const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
+    const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg)
 {
 	int err;
 	struct bptree_args *ba = arg;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Tue Jul  1 21:51:30 2014	(r268123)
@@ -521,7 +521,7 @@ static void
 dbuf_read_impl(dmu_buf_impl_t *db, zio_t *zio, uint32_t *flags)
 {
 	dnode_t *dn;
-	zbookmark_t zb;
+	zbookmark_phys_t zb;
 	uint32_t aflags = ARC_NOWAIT;
 
 	DB_DNODE_ENTER(db);
@@ -1856,7 +1856,7 @@ dbuf_prefetch(dnode_t *dn, uint64_t blki
 		if (bp && !BP_IS_HOLE(bp) && !BP_IS_EMBEDDED(bp)) {
 			dsl_dataset_t *ds = dn->dn_objset->os_dsl_dataset;
 			uint32_t aflags = ARC_NOWAIT | ARC_PREFETCH;
-			zbookmark_t zb;
+			zbookmark_phys_t zb;
 
 			SET_BOOKMARK(&zb, ds ? ds->ds_object : DMU_META_OBJSET,
 			    dn->dn_object, 0, blkid);
@@ -2725,7 +2725,7 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_
 	objset_t *os;
 	dmu_buf_impl_t *parent = db->db_parent;
 	uint64_t txg = tx->tx_txg;
-	zbookmark_t zb;
+	zbookmark_phys_t zb;
 	zio_prop_t zp;
 	zio_t *zio;
 	int wp_flag = 0;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c	Tue Jul  1 21:51:30 2014	(r268123)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
  */
 /* Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */
 /* Copyright (c) 2013, Joyent, Inc. All rights reserved. */
@@ -1447,7 +1447,7 @@ dmu_sync_late_arrival_done(zio_t *zio)
 
 static int
 dmu_sync_late_arrival(zio_t *pio, objset_t *os, dmu_sync_cb_t *done, zgd_t *zgd,
-    zio_prop_t *zp, zbookmark_t *zb)
+    zio_prop_t *zp, zbookmark_phys_t *zb)
 {
 	dmu_sync_arg_t *dsa;
 	dmu_tx_t *tx;
@@ -1508,7 +1508,7 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_s
 	dsl_dataset_t *ds = os->os_dsl_dataset;
 	dbuf_dirty_record_t *dr;
 	dmu_sync_arg_t *dsa;
-	zbookmark_t zb;
+	zbookmark_phys_t zb;
 	zio_prop_t zp;
 	dnode_t *dn;
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c	Tue Jul  1 21:51:30 2014	(r268123)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
  */
 
 #include 
@@ -130,7 +130,7 @@ report_dnode(struct diffarg *da, uint64_
 /* ARGSUSED */
 static int
 diff_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
-    const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
+    const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg)
 {
 	struct diffarg *da = arg;
 	int err = 0;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c	Tue Jul  1 21:51:30 2014	(r268123)
@@ -286,7 +286,7 @@ dmu_objset_open_impl(spa_t *spa, dsl_dat
 	os->os_rootbp = bp;
 	if (!BP_IS_HOLE(os->os_rootbp)) {
 		uint32_t aflags = ARC_WAIT;
-		zbookmark_t zb;
+		zbookmark_phys_t zb;
 		SET_BOOKMARK(&zb, ds ? ds->ds_object : DMU_META_OBJSET,
 		    ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID);
 
@@ -1023,7 +1023,7 @@ void
 dmu_objset_sync(objset_t *os, zio_t *pio, dmu_tx_t *tx)
 {
 	int txgoff;
-	zbookmark_t zb;
+	zbookmark_phys_t zb;
 	zio_prop_t zp;
 	zio_t *zio;
 	list_t *list;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c	Tue Jul  1 21:51:30 2014	(r268123)
@@ -21,7 +21,7 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
  * Copyright (c) 2014, Joyent, Inc. All rights reserved.
  * Copyright (c) 2012, Martin Matuska . All rights reserved.
  */
@@ -441,7 +441,7 @@ backup_do_embed(dmu_sendarg_t *dsp, cons
 /* ARGSUSED */
 static int
 backup_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
-    const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
+    const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg)
 {
 	dmu_sendarg_t *dsp = arg;
 	dmu_object_type_t type = bp ? BP_GET_TYPE(bp) : DMU_OT_NONE;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c	Tue Jul  1 21:51:30 2014	(r268123)
@@ -55,7 +55,7 @@ typedef struct traverse_data {
 	uint64_t td_objset;
 	blkptr_t *td_rootbp;
 	uint64_t td_min_txg;
-	zbookmark_t *td_resume;
+	zbookmark_phys_t *td_resume;
 	int td_flags;
 	prefetch_data_t *td_pfd;
 	boolean_t td_paused;
@@ -72,7 +72,7 @@ static int
 traverse_zil_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg)
 {
 	traverse_data_t *td = arg;
-	zbookmark_t zb;
+	zbookmark_phys_t zb;
 
 	if (BP_IS_HOLE(bp))
 		return (0);
@@ -96,7 +96,7 @@ traverse_zil_record(zilog_t *zilog, lr_t
 	if (lrc->lrc_txtype == TX_WRITE) {
 		lr_write_t *lr = (lr_write_t *)lrc;
 		blkptr_t *bp = &lr->lr_blkptr;
-		zbookmark_t zb;
+		zbookmark_phys_t zb;
 
 		if (BP_IS_HOLE(bp))
 			return (0);
@@ -150,7 +150,7 @@ typedef enum resume_skip {
  */
 static resume_skip_t
 resume_skip_check(traverse_data_t *td, const dnode_phys_t *dnp,
-    const zbookmark_t *zb)
+    const zbookmark_phys_t *zb)
 {
 	if (td->td_resume != NULL && !ZB_IS_ZERO(td->td_resume)) {
 		/*
@@ -175,7 +175,7 @@ resume_skip_check(traverse_data_t *td, c
 
 static void
 traverse_prefetch_metadata(traverse_data_t *td,
-    const blkptr_t *bp, const zbookmark_t *zb)
+    const blkptr_t *bp, const zbookmark_phys_t *zb)
 {
 	uint32_t flags = ARC_NOWAIT | ARC_PREFETCH;
 
@@ -209,9 +209,9 @@ prefetch_needed(prefetch_data_t *pfd, co
 
 static int
 traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
-    const blkptr_t *bp, const zbookmark_t *zb)
+    const blkptr_t *bp, const zbookmark_phys_t *zb)
 {
-	zbookmark_t czb;
+	zbookmark_phys_t czb;
 	int err = 0;
 	arc_buf_t *buf = NULL;
 	prefetch_data_t *pd = td->td_pfd;
@@ -406,7 +406,7 @@ prefetch_dnode_metadata(traverse_data_t 
     uint64_t objset, uint64_t object)
 {
 	int j;
-	zbookmark_t czb;
+	zbookmark_phys_t czb;
 
 	for (j = 0; j < dnp->dn_nblkptr; j++) {
 		SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j);
@@ -424,7 +424,7 @@ traverse_dnode(traverse_data_t *td, cons
     uint64_t objset, uint64_t object)
 {
 	int j, err = 0;
-	zbookmark_t czb;
+	zbookmark_phys_t czb;
 
 	for (j = 0; j < dnp->dn_nblkptr; j++) {
 		SET_BOOKMARK(&czb, objset, object, dnp->dn_nlevels - 1, j);
@@ -443,7 +443,7 @@ traverse_dnode(traverse_data_t *td, cons
 /* ARGSUSED */
 static int
 traverse_prefetcher(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
-    const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
+    const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg)
 {
 	prefetch_data_t *pfd = arg;
 	uint32_t aflags = ARC_NOWAIT | ARC_PREFETCH;
@@ -473,7 +473,7 @@ traverse_prefetch_thread(void *arg)
 {
 	traverse_data_t *td_main = arg;
 	traverse_data_t td = *td_main;
-	zbookmark_t czb;
+	zbookmark_phys_t czb;
 
 	td.td_func = traverse_prefetcher;
 	td.td_arg = td_main->td_pfd;
@@ -495,12 +495,12 @@ traverse_prefetch_thread(void *arg)
  */
 static int
 traverse_impl(spa_t *spa, dsl_dataset_t *ds, uint64_t objset, blkptr_t *rootbp,
-    uint64_t txg_start, zbookmark_t *resume, int flags,
+    uint64_t txg_start, zbookmark_phys_t *resume, int flags,
     blkptr_cb_t func, void *arg)
 {
 	traverse_data_t td;
 	prefetch_data_t pd = { 0 };
-	zbookmark_t czb;
+	zbookmark_phys_t czb;
 	int err;
 
 	ASSERT(ds == NULL || objset == ds->ds_object);
@@ -581,7 +581,7 @@ traverse_dataset(dsl_dataset_t *ds, uint
 
 int
 traverse_dataset_destroyed(spa_t *spa, blkptr_t *blkptr,
-    uint64_t txg_start, zbookmark_t *resume, int flags,
+    uint64_t txg_start, zbookmark_phys_t *resume, int flags,
     blkptr_cb_t func, void *arg)
 {
 	return (traverse_impl(spa, NULL, ZB_DESTROYED_OBJSET,

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c	Tue Jul  1 21:51:30 2014	(r268123)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
  * Copyright (c) 2013 Steven Hartland. All rights reserved.
  * Copyright (c) 2013 by Joyent, Inc. All rights reserved.
  */
@@ -534,7 +534,7 @@ struct killarg {
 /* ARGSUSED */
 static int
 kill_blkptr(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
-    const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
+    const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg)
 {
 	struct killarg *ka = arg;
 	dmu_tx_t *tx = ka->tx;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c	Tue Jul  1 21:51:30 2014	(r268123)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
  */
 
 #include 
@@ -50,7 +50,8 @@
 #include 
 #endif
 
-typedef int (scan_cb_t)(dsl_pool_t *, const blkptr_t *, const zbookmark_t *);
+typedef int (scan_cb_t)(dsl_pool_t *, const blkptr_t *,
+    const zbookmark_phys_t *);
 
 static scan_cb_t dsl_scan_scrub_cb;
 static void dsl_scan_cancel_sync(void *, dmu_tx_t *);
@@ -370,7 +371,7 @@ dsl_scan_cancel(dsl_pool_t *dp)
 }
 
 static void dsl_scan_visitbp(blkptr_t *bp,
-    const zbookmark_t *zb, dnode_phys_t *dnp, arc_buf_t *pbuf,
+    const zbookmark_phys_t *zb, dnode_phys_t *dnp, arc_buf_t *pbuf,
     dsl_dataset_t *ds, dsl_scan_t *scn, dmu_objset_type_t ostype,
     dmu_tx_t *tx);
 static void dsl_scan_visitdnode(dsl_scan_t *, dsl_dataset_t *ds,
@@ -410,7 +411,7 @@ dsl_scan_sync_state(dsl_scan_t *scn, dmu
 }
 
 static boolean_t
-dsl_scan_check_pause(dsl_scan_t *scn, const zbookmark_t *zb)
+dsl_scan_check_pause(dsl_scan_t *scn, const zbookmark_phys_t *zb)
 {
 	uint64_t elapsed_nanosecs;
 	unsigned int mintime;
@@ -468,7 +469,7 @@ dsl_scan_zil_block(zilog_t *zilog, blkpt
 	dsl_pool_t *dp = zsa->zsa_dp;
 	dsl_scan_t *scn = dp->dp_scan;
 	zil_header_t *zh = zsa->zsa_zh;
-	zbookmark_t zb;
+	zbookmark_phys_t zb;
 
 	if (BP_IS_HOLE(bp) || bp->blk_birth <= scn->scn_phys.scn_cur_min_txg)
 		return (0);
@@ -500,7 +501,7 @@ dsl_scan_zil_record(zilog_t *zilog, lr_t
 		zil_header_t *zh = zsa->zsa_zh;
 		lr_write_t *lr = (lr_write_t *)lrc;
 		blkptr_t *bp = &lr->lr_blkptr;
-		zbookmark_t zb;
+		zbookmark_phys_t zb;
 
 		if (BP_IS_HOLE(bp) ||
 		    bp->blk_birth <= scn->scn_phys.scn_cur_min_txg)
@@ -550,7 +551,7 @@ static void
 dsl_scan_prefetch(dsl_scan_t *scn, arc_buf_t *buf, blkptr_t *bp,
     uint64_t objset, uint64_t object, uint64_t blkid)
 {
-	zbookmark_t czb;
+	zbookmark_phys_t czb;
 	uint32_t flags = ARC_NOWAIT | ARC_PREFETCH;
 
 	if (zfs_no_scrub_prefetch)
@@ -569,7 +570,7 @@ dsl_scan_prefetch(dsl_scan_t *scn, arc_b
 
 static boolean_t
 dsl_scan_check_resume(dsl_scan_t *scn, const dnode_phys_t *dnp,
-    const zbookmark_t *zb)
+    const zbookmark_phys_t *zb)
 {
 	/*
 	 * We never skip over user/group accounting objects (obj<0)
@@ -609,7 +610,7 @@ dsl_scan_check_resume(dsl_scan_t *scn, c
 static int
 dsl_scan_recurse(dsl_scan_t *scn, dsl_dataset_t *ds, dmu_objset_type_t ostype,
     dnode_phys_t *dnp, const blkptr_t *bp,
-    const zbookmark_t *zb, dmu_tx_t *tx, arc_buf_t **bufp)
+    const zbookmark_phys_t *zb, dmu_tx_t *tx, arc_buf_t **bufp)
 {
 	dsl_pool_t *dp = scn->scn_dp;
 	int zio_flags = ZIO_FLAG_CANFAIL | ZIO_FLAG_SCAN_THREAD;
@@ -632,7 +633,7 @@ dsl_scan_recurse(dsl_scan_t *scn, dsl_da
 			    zb->zb_object, zb->zb_blkid * epb + i);
 		}
 		for (i = 0, cbp = (*bufp)->b_data; i < epb; i++, cbp++) {
-			zbookmark_t czb;
+			zbookmark_phys_t czb;
 
 			SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object,
 			    zb->zb_level - 1,
@@ -716,7 +717,7 @@ dsl_scan_visitdnode(dsl_scan_t *scn, dsl
 	int j;
 
 	for (j = 0; j < dnp->dn_nblkptr; j++) {
-		zbookmark_t czb;
+		zbookmark_phys_t czb;
 
 		SET_BOOKMARK(&czb, ds ? ds->ds_object : 0, object,
 		    dnp->dn_nlevels - 1, j);
@@ -725,7 +726,7 @@ dsl_scan_visitdnode(dsl_scan_t *scn, dsl
 	}
 
 	if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) {
-		zbookmark_t czb;
+		zbookmark_phys_t czb;
 		SET_BOOKMARK(&czb, ds ? ds->ds_object : 0, object,
 		    0, DMU_SPILL_BLKID);
 		dsl_scan_visitbp(&dnp->dn_spill,
@@ -738,7 +739,7 @@ dsl_scan_visitdnode(dsl_scan_t *scn, dsl
  * first 5; we want them to be useful.
  */
 static void
-dsl_scan_visitbp(blkptr_t *bp, const zbookmark_t *zb,
+dsl_scan_visitbp(blkptr_t *bp, const zbookmark_phys_t *zb,
     dnode_phys_t *dnp, arc_buf_t *pbuf,
     dsl_dataset_t *ds, dsl_scan_t *scn, dmu_objset_type_t ostype,
     dmu_tx_t *tx)
@@ -802,7 +803,7 @@ static void
 dsl_scan_visit_rootbp(dsl_scan_t *scn, dsl_dataset_t *ds, blkptr_t *bp,
     dmu_tx_t *tx)
 {
-	zbookmark_t zb;
+	zbookmark_phys_t zb;
 
 	SET_BOOKMARK(&zb, ds ? ds->ds_object : DMU_META_OBJSET,
 	    ZB_ROOT_OBJECT, ZB_ROOT_LEVEL, ZB_ROOT_BLKID);
@@ -1229,7 +1230,7 @@ dsl_scan_ddt_entry(dsl_scan_t *scn, enum
 	const ddt_key_t *ddk = &dde->dde_key;
 	ddt_phys_t *ddp = dde->dde_phys;
 	blkptr_t bp;
-	zbookmark_t zb = { 0 };
+	zbookmark_phys_t zb = { 0 };
 
 	if (scn->scn_phys.scn_state != DSS_SCANNING)
 		return;
@@ -1297,7 +1298,7 @@ dsl_scan_visit(dsl_scan_t *scn, dmu_tx_t
 	 * In case we were paused right at the end of the ds, zero the
 	 * bookmark so we don't think that we're still trying to resume.
 	 */
-	bzero(&scn->scn_phys.scn_bookmark, sizeof (zbookmark_t));
+	bzero(&scn->scn_phys.scn_bookmark, sizeof (zbookmark_phys_t));
 
 	/* keep pulling things out of the zap-object-as-queue */
 	while (zap_cursor_init(&zc, dp->dp_meta_objset,
@@ -1694,7 +1695,7 @@ dsl_scan_scrub_done(zio_t *zio)
 
 static int
 dsl_scan_scrub_cb(dsl_pool_t *dp,
-    const blkptr_t *bp, const zbookmark_t *zb)
+    const blkptr_t *bp, const zbookmark_phys_t *zb)
 {
 	dsl_scan_t *scn = dp->dp_scan;
 	size_t size = BP_GET_PSIZE(bp);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Tue Jul  1 21:51:30 2014	(r268123)
@@ -809,7 +809,7 @@ spa_error_entry_compare(const void *a, c
 	int ret;
 
 	ret = bcmp(&sa->se_bookmark, &sb->se_bookmark,
-	    sizeof (zbookmark_t));
+	    sizeof (zbookmark_phys_t));
 
 	if (ret < 0)
 		return (-1);
@@ -1886,7 +1886,7 @@ spa_load_verify_done(zio_t *zio)
 /*ARGSUSED*/
 static int
 spa_load_verify_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
-    const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
+    const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg)
 {
 	if (!BP_IS_HOLE(bp) && !BP_IS_EMBEDDED(bp)) {
 		zio_t *rio = arg;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c	Tue Jul  1 21:51:30 2014	(r268123)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013, 2014 by Delphix. All rights reserved.
  */
 
 /*
@@ -35,7 +35,7 @@
  * deleted from the log when the scrub completes.
  *
  * The log is stored using a ZAP object whose key is a string form of the
- * zbookmark tuple (objset, object, level, blkid), and whose contents is an
+ * zbookmark_phys tuple (objset, object, level, blkid), and whose contents is an
  * optional 'objset:object' human-readable string describing the data.  When an
  * error is first logged, this string will be empty, indicating that no name is
  * known.  This prevents us from having to issue a potentially large amount of
@@ -59,7 +59,7 @@
  * Convert a bookmark to a string.
  */
 static void
-bookmark_to_name(zbookmark_t *zb, char *buf, size_t len)
+bookmark_to_name(zbookmark_phys_t *zb, char *buf, size_t len)
 {
 	(void) snprintf(buf, len, "%llx:%llx:%llx:%llx",
 	    (u_longlong_t)zb->zb_objset, (u_longlong_t)zb->zb_object,
@@ -71,7 +71,7 @@ bookmark_to_name(zbookmark_t *zb, char *
  */
 #ifdef _KERNEL
 static void
-name_to_bookmark(char *buf, zbookmark_t *zb)
+name_to_bookmark(char *buf, zbookmark_phys_t *zb)
 {
 	zb->zb_objset = strtonum(buf, &buf);
 	ASSERT(*buf == ':');
@@ -92,7 +92,7 @@ name_to_bookmark(char *buf, zbookmark_t 
 void
 spa_log_error(spa_t *spa, zio_t *zio)
 {
-	zbookmark_t *zb = &zio->io_logical->io_bookmark;
+	zbookmark_phys_t *zb = &zio->io_logical->io_bookmark;
 	spa_error_entry_t search;
 	spa_error_entry_t *new;
 	avl_tree_t *tree;
@@ -165,7 +165,7 @@ process_error_log(spa_t *spa, uint64_t o
 {
 	zap_cursor_t zc;
 	zap_attribute_t za;
-	zbookmark_t zb;
+	zbookmark_phys_t zb;
 
 	if (obj == 0)
 		return (0);
@@ -182,8 +182,8 @@ process_error_log(spa_t *spa, uint64_t o
 		name_to_bookmark(za.za_name, &zb);
 
 		if (copyout(&zb, (char *)addr +
-		    (*count - 1) * sizeof (zbookmark_t),
-		    sizeof (zbookmark_t)) != 0) {
+		    (*count - 1) * sizeof (zbookmark_phys_t),
+		    sizeof (zbookmark_phys_t)) != 0) {
 			zap_cursor_fini(&zc);
 			return (SET_ERROR(EFAULT));
 		}
@@ -207,8 +207,8 @@ process_error_list(avl_tree_t *list, voi
 			return (SET_ERROR(ENOMEM));
 
 		if (copyout(&se->se_bookmark, (char *)addr +
-		    (*count - 1) * sizeof (zbookmark_t),
-		    sizeof (zbookmark_t)) != 0)
+		    (*count - 1) * sizeof (zbookmark_phys_t),
+		    sizeof (zbookmark_phys_t)) != 0)
 			return (SET_ERROR(EFAULT));
 
 		*count -= 1;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h	Tue Jul  1 21:51:30 2014	(r268123)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
  * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
  */
 
@@ -105,12 +105,12 @@ int arc_referenced(arc_buf_t *buf);
 
 int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp,
     arc_done_func_t *done, void *priv, zio_priority_t priority, int flags,
-    uint32_t *arc_flags, const zbookmark_t *zb);
+    uint32_t *arc_flags, const zbookmark_phys_t *zb);
 zio_t *arc_write(zio_t *pio, spa_t *spa, uint64_t txg,
     blkptr_t *bp, arc_buf_t *buf, boolean_t l2arc, boolean_t l2arc_compress,
     const zio_prop_t *zp, arc_done_func_t *ready, arc_done_func_t *physdone,
     arc_done_func_t *done, void *priv, zio_priority_t priority,
-    int zio_flags, const zbookmark_t *zb);
+    int zio_flags, const zbookmark_phys_t *zb);
 void arc_freed(spa_t *spa, const blkptr_t *bp);
 
 void arc_set_callback(arc_buf_t *buf, arc_evict_func_t *func, void *priv);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bptree.h	Tue Jul  1 21:51:30 2014	(r268123)
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
  */
 
 #ifndef	_SYS_BPTREE_H
@@ -43,7 +43,7 @@ typedef struct bptree_phys {
 typedef struct bptree_entry_phys {
 	blkptr_t be_bp;
 	uint64_t be_birth_txg; /* only delete blocks born after this txg */
-	zbookmark_t be_zb; /* holds traversal resume point if needed */
+	zbookmark_phys_t be_zb; /* holds traversal resume point if needed */
 } bptree_entry_phys_t;
 
 typedef int bptree_itor_t(void *arg, const blkptr_t *bp, dmu_tx_t *tx);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h	Tue Jul  1 21:51:30 2014	(r268123)
@@ -64,7 +64,7 @@ struct dsl_pool;
 struct dnode;
 struct drr_begin;
 struct drr_end;
-struct zbookmark;
+struct zbookmark_phys;
 struct spa;
 struct nvlist;
 struct arc_buf;

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h	Tue Jul  1 21:51:30 2014	(r268123)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
  */
 
 #ifndef	_SYS_DMU_TRAVERSE_H
@@ -40,7 +40,7 @@ struct zilog;
 struct arc_buf;
 
 typedef int (blkptr_cb_t)(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
-    const zbookmark_t *zb, const struct dnode_phys *dnp, void *arg);
+    const zbookmark_phys_t *zb, const struct dnode_phys *dnp, void *arg);
 
 #define	TRAVERSE_PRE			(1<<0)
 #define	TRAVERSE_POST			(1<<1)
@@ -55,7 +55,7 @@ typedef int (blkptr_cb_t)(spa_t *spa, zi
 int traverse_dataset(struct dsl_dataset *ds,
     uint64_t txg_start, int flags, blkptr_cb_t func, void *arg);
 int traverse_dataset_destroyed(spa_t *spa, blkptr_t *blkptr,
-    uint64_t txg_start, zbookmark_t *resume, int flags,
+    uint64_t txg_start, zbookmark_phys_t *resume, int flags,
     blkptr_cb_t func, void *arg);
 int traverse_pool(spa_t *spa,
     uint64_t txg_start, int flags, blkptr_cb_t func, void *arg);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h	Tue Jul  1 21:51:30 2014	(r268123)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
  */
 
 #ifndef	_SYS_DSL_SCAN_H
@@ -62,7 +62,7 @@ typedef struct dsl_scan_phys {
 	uint64_t scn_errors;	/* scan I/O error count */
 	uint64_t scn_ddt_class_max;
 	ddt_bookmark_t scn_ddt_bookmark;
-	zbookmark_t scn_bookmark;
+	zbookmark_phys_t scn_bookmark;
 	uint64_t scn_flags; /* dsl_scan_flags_t */
 } dsl_scan_phys_t;
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h	Tue Jul  1 21:51:30 2014	(r268123)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  */
 
@@ -820,7 +820,7 @@ extern void spa_history_log_internal_dd(
     dmu_tx_t *tx, const char *fmt, ...);
 
 /* error handling */
-struct zbookmark;
+struct zbookmark_phys;
 extern void spa_log_error(spa_t *spa, zio_t *zio);
 extern void zfs_ereport_post(const char *cls, spa_t *spa, vdev_t *vd,
     zio_t *zio, uint64_t stateoroffset, uint64_t length);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h	Tue Jul  1 21:51:30 2014	(r268123)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  * Copyright 2013 Martin Matuska . All rights reserved.
  */
@@ -47,9 +47,9 @@ extern "C" {
 #endif
 
 typedef struct spa_error_entry {
-	zbookmark_t	se_bookmark;
-	char		*se_name;
-	avl_node_t	se_avl;
+	zbookmark_phys_t	se_bookmark;
+	char			*se_name;
+	avl_node_t		se_avl;
 } spa_error_entry_t;
 
 typedef struct spa_history_phys {

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h	Tue Jul  1 21:51:30 2014	(r268123)
@@ -22,8 +22,7 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
  * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
  */
 
@@ -264,16 +263,16 @@ extern const char *zio_type_name[ZIO_TYP
  * Note: this structure is called a bookmark because its original purpose
  * was to remember where to resume a pool-wide traverse.
  *
- * Note: this structure is passed between userland and the kernel.
- * Therefore it must not change size or alignment between 32/64 bit
- * compilation options.
+ * Note: this structure is passed between userland and the kernel, and is
+ * stored on disk (by virtue of being incorporated into other on-disk
+ * structures, e.g. dsl_scan_phys_t).
  */
-typedef struct zbookmark {
+typedef struct zbookmark_phys {
 	uint64_t	zb_objset;
 	uint64_t	zb_object;
 	int64_t		zb_level;
 	uint64_t	zb_blkid;
-} zbookmark_t;
+} zbookmark_phys_t;
 
 #define	SET_BOOKMARK(zb, objset, object, level, blkid)  \
 {                                                       \
@@ -417,7 +416,7 @@ extern zio_trim_stats_t zio_trim_stats;
 
 struct zio {
 	/* Core information about this I/O */
-	zbookmark_t	io_bookmark;
+	zbookmark_phys_t	io_bookmark;
 	zio_prop_t	io_prop;
 	zio_type_t	io_type;
 	enum zio_child	io_child_type;
@@ -499,17 +498,17 @@ extern zio_t *zio_root(spa_t *spa,
 
 extern zio_t *zio_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, void *data,
     uint64_t size, zio_done_func_t *done, void *priv,
-    zio_priority_t priority, enum zio_flag flags, const zbookmark_t *zb);
+    zio_priority_t priority, enum zio_flag flags, const zbookmark_phys_t *zb);
 
 extern zio_t *zio_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp,
     void *data, uint64_t size, const zio_prop_t *zp,
     zio_done_func_t *ready, zio_done_func_t *physdone, zio_done_func_t *done,
     void *priv,
-    zio_priority_t priority, enum zio_flag flags, const zbookmark_t *zb);
+    zio_priority_t priority, enum zio_flag flags, const zbookmark_phys_t *zb);
 
 extern zio_t *zio_rewrite(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp,
     void *data, uint64_t size, zio_done_func_t *done, void *priv,
-    zio_priority_t priority, enum zio_flag flags, zbookmark_t *zb);
+    zio_priority_t priority, enum zio_flag flags, zbookmark_phys_t *zb);
 
 extern void zio_write_override(zio_t *zio, blkptr_t *bp, int copies,
     boolean_t nopwrite);
@@ -631,9 +630,9 @@ extern void zfs_ereport_post_checksum(sp
 /* Called from spa_sync(), but primarily an injection handler */
 extern void spa_handle_ignored_writes(spa_t *spa);
 
-/* zbookmark functions */
+/* zbookmark_phys functions */
 boolean_t zbookmark_is_before(const struct dnode_phys *dnp,
-    const zbookmark_t *zb1, const zbookmark_t *zb2);
+    const zbookmark_phys_t *zb1, const zbookmark_phys_t *zb2);
 
 #ifdef	__cplusplus
 }

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c	Tue Jul  1 21:21:56 2014	(r268122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c	Tue Jul  1 21:51:30 2014	(r268123)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
  */
 
 /* Portions Copyright 2010 Robert Milkowski */
@@ -192,7 +192,7 @@ zil_read_log_block(zilog_t *zilog, const
 	enum zio_flag zio_flags = ZIO_FLAG_CANFAIL;
 	uint32_t aflags = ARC_WAIT;
 	arc_buf_t *abuf = NULL;
-	zbookmark_t zb;
+	zbookmark_phys_t zb;
 	int error;
 
 	if (zilog->zl_header->zh_claim_txg == 0)
@@ -265,7 +265,7 @@ zil_read_log_data(zilog_t *zilog, const 
 	const blkptr_t *bp = &lr->lr_blkptr;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 21:57:16 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 499C954B;
 Tue,  1 Jul 2014 21:57:16 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1CA9B2346;
 Tue,  1 Jul 2014 21:57:16 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61LvF7x024380;
 Tue, 1 Jul 2014 21:57:15 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61LvF7t024379;
 Tue, 1 Jul 2014 21:57:15 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201407012157.s61LvF7t024379@svn.freebsd.org>
From: Xin LI 
Date: Tue, 1 Jul 2014 21:57:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268124 - head/sys/cddl/contrib/opensolaris
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 21:57:16 -0000

Author: delphij
Date: Tue Jul  1 21:57:15 2014
New Revision: 268124
URL: http://svnweb.freebsd.org/changeset/base/268124

Log:
  Mark r268120 as merged.  We believe that the LZ4 usage in ZFS is not
  affected and plans to sync with upstream LZ4 in the near future.

Modified:
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 22:16:45 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4A51EE42;
 Tue,  1 Jul 2014 22:16:45 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 36E952516;
 Tue,  1 Jul 2014 22:16:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61MGjWM034653;
 Tue, 1 Jul 2014 22:16:45 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61MGjgd034652;
 Tue, 1 Jul 2014 22:16:45 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201407012216.s61MGjgd034652@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Tue, 1 Jul 2014 22:16:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268125 -
 head/sys/cddl/contrib/opensolaris/uts/common/dtrace
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 22:16:45 -0000

Author: pfg
Date: Tue Jul  1 22:16:44 2014
New Revision: 268125
URL: http://svnweb.freebsd.org/changeset/base/268125

Log:
  Small merges from OpenSolaris:
  
  These have no effect on FreeBSD, in fact they are ifdef'ed,
  but make easier future merges:
  
  6699767 panic in spec_open()
  
  6718877 crgetzoneid() use can cause problems when forking processes with
  USDT providers in a non global zone
  
  MFC after:	3 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Tue Jul  1 21:57:15 2014	(r268124)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Tue Jul  1 22:16:44 2014	(r268125)
@@ -12615,7 +12615,8 @@ dtrace_enabling_matchall(void)
 #if defined(sun)
 		cred_t *cr = enab->dten_vstate->dtvs_state->dts_cred.dcr_cred;
 
-		if (INGLOBALZONE(curproc) || getzoneid() == crgetzoneid(cr))
+		if (INGLOBALZONE(curproc) ||
+		    cr != NULL && getzoneid() == crgetzoneid(cr))
 #endif
 			(void) dtrace_enabling_match(enab, NULL);
 	}
@@ -16678,7 +16679,8 @@ dtrace_open(struct cdev *dev, int oflags
 	 * If this wasn't an open with the "helper" minor, then it must be
 	 * the "dtrace" minor.
 	 */
-	ASSERT(getminor(*devp) == DTRACEMNRN_DTRACE);
+	if (getminor(*devp) == DTRACEMNRN_DTRACE)
+		return (ENXIO);
 #else
 	cred_t *cred_p = NULL;
 	cred_p = dev->si_cred;

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 22:31:11 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1871B39A;
 Tue,  1 Jul 2014 22:31:11 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 02D282625;
 Tue,  1 Jul 2014 22:31:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61MVAEJ041839;
 Tue, 1 Jul 2014 22:31:10 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61MVAbB041834;
 Tue, 1 Jul 2014 22:31:10 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201407012231.s61MVAbB041834@svn.freebsd.org>
From: Xin LI 
Date: Tue, 1 Jul 2014 22:31:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268126 - in head: cddl/contrib/opensolaris/cmd/zpool
 sys/cddl/contrib/opensolaris/common/zfs
 sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 22:31:11 -0000

Author: delphij
Date: Tue Jul  1 22:31:09 2014
New Revision: 268126
URL: http://svnweb.freebsd.org/changeset/base/268126

Log:
  MFV r268121:
  
  4924 LZ4 Compression for metadata
  
  illumos/illumos-gate@b8289d24d866c1af02d7007348f7f057693c15d3
  
  MFC after:	2 weeks

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7
  head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7	Tue Jul  1 22:16:44 2014	(r268125)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7	Tue Jul  1 22:31:09 2014	(r268126)
@@ -23,7 +23,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 30, 2014
+.Dd July 1, 2014
 .Dt ZPOOL-FEATURES 7
 .Os
 .Sh NAME
@@ -235,14 +235,11 @@ administrator can turn on
 compression on any dataset on the
 pool using the
 .Xr zfs 8
-command. Please note that doing so will
-immediately activate the
-.Sy lz4_compress
-feature on the underlying
-pool
-.Pq even before any data is written ,
-and the feature will not be
-deactivated.
+command.
+Also, all newly written metadata
+will be compressed with
+.Sy lz4
+algorithm.
 Since this feature is not read-only compatible, this
 operation will render the pool unimportable on systems without support
 for the
@@ -251,6 +248,12 @@ feature.
 Booting off of
 .Sy lz4
 -compressed root pools is supported.
+.Pp
+This feature becomes
+.Sy active
+as soon as it is enabled and will
+never return to being
+.Sy enabled .
 .It Sy multi_vdev_crash_dump
 .Bl -column "READ\-ONLY COMPATIBLE" "com.joyent:multi_vdev_crash_dump"
 .It GUID Ta com.joyent:multi_vdev_crash_dump

Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c	Tue Jul  1 22:16:44 2014	(r268125)
+++ head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c	Tue Jul  1 22:31:09 2014	(r268126)
@@ -23,6 +23,7 @@
  * Copyright (c) 2013 by Delphix. All rights reserved.
  * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
  * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2014, Nexenta Systems, Inc. All rights reserved.
  */
 
 #ifdef _KERNEL
@@ -168,7 +169,7 @@ zpool_feature_init(void)
 	zfeature_register(SPA_FEATURE_LZ4_COMPRESS,
 	    "org.illumos:lz4_compress", "lz4_compress",
 	    "LZ4 compression algorithm support.", B_FALSE, B_FALSE,
-	    B_FALSE, NULL);
+	    B_TRUE, NULL);
 
 	zfeature_register(SPA_FEATURE_MULTI_VDEV_CRASH_DUMP,
 	    "com.joyent:multi_vdev_crash_dump", "multi_vdev_crash_dump",

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c	Tue Jul  1 22:16:44 2014	(r268125)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c	Tue Jul  1 22:31:09 2014	(r268126)
@@ -24,6 +24,7 @@
  */
 /* Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */
 /* Copyright (c) 2013, Joyent, Inc. All rights reserved. */
+/* Copyright (c) 2014, Nexenta Systems, Inc. All rights reserved. */
 
 #include 
 #include 
@@ -44,6 +45,7 @@
 #include 
 #include 
 #include 
+#include 
 #ifdef _KERNEL
 #include 
 #include 
@@ -1705,8 +1707,16 @@ dmu_write_policy(objset_t *os, dnode_t *
 		 * XXX -- we should design a compression algorithm
 		 * that specializes in arrays of bps.
 		 */
-		compress = zfs_mdcomp_disable ? ZIO_COMPRESS_EMPTY :
-		    ZIO_COMPRESS_LZJB;
+		boolean_t lz4_ac = spa_feature_is_active(os->os_spa,
+		    SPA_FEATURE_LZ4_COMPRESS);
+
+		if (zfs_mdcomp_disable) {
+			compress = ZIO_COMPRESS_EMPTY;
+		} else if (lz4_ac) {
+			compress = ZIO_COMPRESS_LZ4;
+		} else {
+			compress = ZIO_COMPRESS_LZJB;
+		}
 
 		/*
 		 * Metadata always gets checksummed.  If the data

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Tue Jul  1 22:16:44 2014	(r268125)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Tue Jul  1 22:31:09 2014	(r268126)
@@ -22,7 +22,7 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
- * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright (c) 2013, 2014, Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 2013 Martin Matuska . All rights reserved.
  */
 
@@ -6425,6 +6425,22 @@ spa_sync_upgrades(spa_t *spa, dmu_tx_t *
 	    spa->spa_uberblock.ub_version >= SPA_VERSION_FEATURES) {
 		spa_feature_create_zap_objects(spa, tx);
 	}
+
+	/*
+	 * LZ4_COMPRESS feature's behaviour was changed to activate_on_enable
+	 * when possibility to use lz4 compression for metadata was added
+	 * Old pools that have this feature enabled must be upgraded to have
+	 * this feature active
+	 */
+	if (spa->spa_uberblock.ub_version >= SPA_VERSION_FEATURES) {
+		boolean_t lz4_en = spa_feature_is_enabled(spa,
+		    SPA_FEATURE_LZ4_COMPRESS);
+		boolean_t lz4_ac = spa_feature_is_active(spa,
+		    SPA_FEATURE_LZ4_COMPRESS);
+
+		if (lz4_en && !lz4_ac)
+			spa_feature_incr(spa, SPA_FEATURE_LZ4_COMPRESS, tx);
+	}
 	rrw_exit(&dp->dp_config_rwlock, FTAG);
 }
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Tue Jul  1 22:16:44 2014	(r268125)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Tue Jul  1 22:31:09 2014	(r268126)
@@ -30,6 +30,7 @@
  * Copyright (c) 2013 by Delphix. All rights reserved.
  * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
  * Copyright (c) 2013 Steven Hartland. All rights reserved.
+ * Copyright (c) 2014, Nexenta Systems, Inc. All rights reserved.
  */
 
 /*
@@ -2504,37 +2505,6 @@ zfs_prop_set_special(const char *dsname,
 		}
 		break;
 	}
-	case ZFS_PROP_COMPRESSION:
-	{
-		if (intval == ZIO_COMPRESS_LZ4) {
-			spa_t *spa;
-
-			if ((err = spa_open(dsname, &spa, FTAG)) != 0)
-				return (err);
-
-			/*
-			 * Setting the LZ4 compression algorithm activates
-			 * the feature.
-			 */
-			if (!spa_feature_is_active(spa,
-			    SPA_FEATURE_LZ4_COMPRESS)) {
-				if ((err = zfs_prop_activate_feature(spa,
-				    SPA_FEATURE_LZ4_COMPRESS)) != 0) {
-					spa_close(spa, FTAG);
-					return (err);
-				}
-			}
-
-			spa_close(spa, FTAG);
-		}
-		/*
-		 * We still want the default set action to be performed in the
-		 * caller, we only performed zfeature settings here.
-		 */
-		err = -1;
-		break;
-	}
-
 	default:
 		err = -1;
 	}

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 22:32:12 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 88DAA4DC;
 Tue,  1 Jul 2014 22:32:12 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 761722696;
 Tue,  1 Jul 2014 22:32:12 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61MWCB6043774;
 Tue, 1 Jul 2014 22:32:12 GMT (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61MWCF7043773;
 Tue, 1 Jul 2014 22:32:12 GMT (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201407012232.s61MWCF7043773@svn.freebsd.org>
From: Rick Macklem 
Date: Tue, 1 Jul 2014 22:32:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268127 - head
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 22:32:12 -0000

Author: rmacklem
Date: Tue Jul  1 22:32:11 2014
New Revision: 268127
URL: http://svnweb.freebsd.org/changeset/base/268127

Log:
  Add an entry for r268115 to UPDATING.

Modified:
  head/UPDATING

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Tue Jul  1 22:31:09 2014	(r268126)
+++ head/UPDATING	Tue Jul  1 22:32:11 2014	(r268127)
@@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
 	disable the most expensive debugging functionality run
 	"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20140701:
+	Commit r268115 has added NFSv4.1 server support, merged from
+	projects/nfsv4.1-server.  Since this includes changes to the
+	internal interfaces between the NFS related modules, a full
+	build of the kernel and modules will be necessary.
+	__FreeBSD_version has been bumped.
+
 20140629:
 	The WITHOUT_VT_SUPPORT kernel config knob has been renamed
 	WITHOUT_VT.  (The other _SUPPORT knobs have a consistent meaning

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 22:42:55 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id F1EBCC44;
 Tue,  1 Jul 2014 22:42:54 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D2CCF2836;
 Tue,  1 Jul 2014 22:42:54 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61Mgs1Y048545;
 Tue, 1 Jul 2014 22:42:54 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61Mgs2A048542;
 Tue, 1 Jul 2014 22:42:54 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201407012242.s61Mgs2A048542@svn.freebsd.org>
From: Xin LI 
Date: Tue, 1 Jul 2014 22:42:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268128 - in head/sys/cddl/contrib/opensolaris:
 common/zfs uts/common/fs/zfs uts/common/sys/fs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 22:42:55 -0000

Author: delphij
Date: Tue Jul  1 22:42:53 2014
New Revision: 268128
URL: http://svnweb.freebsd.org/changeset/base/268128

Log:
  MFV r268122:
  
  4929 want prevsnap property
  
  illumos/illumos-gate@b461c7460e5e77cf65f00151162e654220c6e2fb
  
  MFC after:	2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c	Tue Jul  1 22:32:11 2014	(r268127)
+++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c	Tue Jul  1 22:42:53 2014	(r268128)
@@ -435,6 +435,8 @@ zfs_prop_init(void)
 	    PROP_READONLY, ZFS_TYPE_DATASET, "OBJSETID");
 	zprop_register_hidden(ZFS_PROP_INCONSISTENT, "inconsistent",
 	    PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "INCONSISTENT");
+	zprop_register_hidden(ZFS_PROP_PREV_SNAP, "prevsnap", PROP_TYPE_STRING,
+	    PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "PREVSNAP");
 
 	/* oddball properties */
 	zprop_register_impl(ZFS_PROP_CREATION, "creation", PROP_TYPE_NUMBER, 0,

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Tue Jul  1 22:32:11 2014	(r268127)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Tue Jul  1 22:42:53 2014	(r268128)
@@ -21,7 +21,7 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Portions Copyright (c) 2011 Martin Matuska 
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013, 2014 by Delphix. All rights reserved.
  * Copyright (c) 2014, Joyent, Inc. All rights reserved.
  * Copyright (c) 2014 RackTop Systems.
  */
@@ -1603,6 +1603,12 @@ dsl_dataset_stats(dsl_dataset_t *ds, nvl
 		    ds->ds_phys->ds_unique_bytes);
 		get_clones_stat(ds, nv);
 	} else {
+		if (ds->ds_prev != NULL && ds->ds_prev != dp->dp_origin_snap) {
+			char buf[MAXNAMELEN];
+			dsl_dataset_name(ds->ds_prev, buf);
+			dsl_prop_nvlist_add_string(nv, ZFS_PROP_PREV_SNAP, buf);
+		}
+
 		dsl_dir_stats(ds->ds_dir, nv);
 	}
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h	Tue Jul  1 22:32:11 2014	(r268127)
+++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h	Tue Jul  1 22:42:53 2014	(r268128)
@@ -151,6 +151,7 @@ typedef enum {
 	ZFS_PROP_FILESYSTEM_COUNT,
 	ZFS_PROP_SNAPSHOT_COUNT,
 	ZFS_PROP_REDUNDANT_METADATA,
+	ZFS_PROP_PREV_SNAP,
 	ZFS_NUM_PROPS
 } zfs_prop_t;
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 22:46:39 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id BA413EA2;
 Tue,  1 Jul 2014 22:46:39 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A7B4A285F;
 Tue,  1 Jul 2014 22:46:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61Mkdbp049308;
 Tue, 1 Jul 2014 22:46:39 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61MkdQc049307;
 Tue, 1 Jul 2014 22:46:39 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201407012246.s61MkdQc049307@svn.freebsd.org>
From: Xin LI 
Date: Tue, 1 Jul 2014 22:46:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268129 - head/bin/mv
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 22:46:39 -0000

Author: delphij
Date: Tue Jul  1 22:46:39 2014
New Revision: 268129
URL: http://svnweb.freebsd.org/changeset/base/268129

Log:
  Check if fchflags() is needed by fstat'ing before and check
  the results.
  
  Reviewed by:	jilles
  X-MFC-With:	r267977

Modified:
  head/bin/mv/mv.c

Modified: head/bin/mv/mv.c
==============================================================================
--- head/bin/mv/mv.c	Tue Jul  1 22:42:53 2014	(r268128)
+++ head/bin/mv/mv.c	Tue Jul  1 22:46:39 2014	(r268129)
@@ -278,6 +278,7 @@ fastcopy(const char *from, const char *t
 	static char *bp = NULL;
 	mode_t oldmode;
 	int nread, from_fd, to_fd;
+	struct stat tsb;
 
 	if ((from_fd = open(from, O_RDONLY, 0)) < 0) {
 		warn("fastcopy: open() failed (from): %s", from);
@@ -336,10 +337,18 @@ err:		if (unlink(to))
 	 * if the server supports flags and we were trying to *remove* flags
 	 * on a file that we copied, i.e., that we didn't create.)
 	 */
-	errno = 0;
-	if (fchflags(to_fd, sbp->st_flags | UF_ARCHIVE))
-		if (errno != EOPNOTSUPP || ((sbp->st_flags & ~UF_ARCHIVE) != 0))
-			warn("%s: set flags (was: 0%07o)", to, sbp->st_flags);
+	if (fstat(to_fd, &tsb) == 0) {
+		if ((sbp->st_flags  & ~UF_ARCHIVE) !=
+		    (tsb.st_flags & ~UF_ARCHIVE)) {
+			if (fchflags(to_fd,
+			    sbp->st_flags | (tsb.st_flags & UF_ARCHIVE)))
+				if (errno != EOPNOTSUPP ||
+				    ((sbp->st_flags & ~UF_ARCHIVE) != 0))
+					warn("%s: set flags (was: 0%07o)",
+					    to, sbp->st_flags);
+		}
+	} else
+		warn("%s: cannot stat", to);
 
 	tval[0].tv_sec = sbp->st_atime;
 	tval[1].tv_sec = sbp->st_mtime;

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 23:37:25 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 50F601FB;
 Tue,  1 Jul 2014 23:37:25 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 23CAB2C7D;
 Tue,  1 Jul 2014 23:37:25 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61NbP4Y073753;
 Tue, 1 Jul 2014 23:37:25 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61NbOGi073752;
 Tue, 1 Jul 2014 23:37:24 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201407012337.s61NbOGi073752@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Tue, 1 Jul 2014 23:37:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268130 -
 head/sys/cddl/contrib/opensolaris/uts/common/dtrace
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 23:37:25 -0000

Author: pfg
Date: Tue Jul  1 23:37:24 2014
New Revision: 268130
URL: http://svnweb.freebsd.org/changeset/base/268130

Log:
  Merge from OpenSolaris (15-Sep-2008):
  
  6735480 race between probe enabling and provider registration
  
  MFC after:	1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Tue Jul  1 22:46:39 2014	(r268129)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Tue Jul  1 23:37:24 2014	(r268130)
@@ -27,8 +27,6 @@
  * Copyright (c) 2012 by Delphix. All rights reserved.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*
  * DTrace - Dynamic Tracing for Solaris
  *
@@ -238,6 +236,7 @@ static dtrace_ecb_t	*dtrace_ecb_create_c
 static dtrace_genid_t	dtrace_probegen;	/* current probe generation */
 static dtrace_helpers_t *dtrace_deferred_pid;	/* deferred helper list */
 static dtrace_enabling_t *dtrace_retained;	/* list of retained enablings */
+static dtrace_genid_t	dtrace_retained_gen;	/* current retained enab gen */
 static dtrace_dynvar_t	dtrace_dynhash_sink;	/* end of dynamic hash chains */
 #if !defined(sun)
 static struct mtx	dtrace_unr_mtx;
@@ -12393,6 +12392,7 @@ dtrace_enabling_destroy(dtrace_enabling_
 		ASSERT(enab->dten_vstate->dtvs_state != NULL);
 		ASSERT(enab->dten_vstate->dtvs_state->dts_nretained > 0);
 		enab->dten_vstate->dtvs_state->dts_nretained--;
+		dtrace_retained_gen++;
 	}
 
 	if (enab->dten_prev == NULL) {
@@ -12435,6 +12435,7 @@ dtrace_enabling_retain(dtrace_enabling_t
 		return (ENOSPC);
 
 	state->dts_nretained++;
+	dtrace_retained_gen++;
 
 	if (dtrace_retained == NULL) {
 		dtrace_retained = enab;
@@ -12677,6 +12678,7 @@ dtrace_enabling_provide(dtrace_provider_
 {
 	int i, all = 0;
 	dtrace_probedesc_t desc;
+	dtrace_genid_t gen;
 
 	ASSERT(MUTEX_HELD(&dtrace_lock));
 	ASSERT(MUTEX_HELD(&dtrace_provider_lock));
@@ -12687,15 +12689,25 @@ dtrace_enabling_provide(dtrace_provider_
 	}
 
 	do {
-		dtrace_enabling_t *enab = dtrace_retained;
+		dtrace_enabling_t *enab;
 		void *parg = prv->dtpv_arg;
 
-		for (; enab != NULL; enab = enab->dten_next) {
+retry:
+		gen = dtrace_retained_gen;
+		for (enab = dtrace_retained; enab != NULL;
+		    enab = enab->dten_next) {
 			for (i = 0; i < enab->dten_ndesc; i++) {
 				desc = enab->dten_desc[i]->dted_probe;
 				mutex_exit(&dtrace_lock);
 				prv->dtpv_pops.dtps_provide(parg, &desc);
 				mutex_enter(&dtrace_lock);
+				/*
+				 * Process the retained enablings again if
+				 * they have changed while we weren't holding
+				 * dtrace_lock.
+				 */
+				if (gen != dtrace_retained_gen)
+					goto retry;
 			}
 		}
 	} while (all && (prv = prv->dtpv_next) != NULL);

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  1 23:41:55 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 20E72373;
 Tue,  1 Jul 2014 23:41:55 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0169F2D0B;
 Tue,  1 Jul 2014 23:41:55 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s61NfsW1077438;
 Tue, 1 Jul 2014 23:41:54 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s61Nfs2x077437;
 Tue, 1 Jul 2014 23:41:54 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201407012341.s61Nfs2x077437@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Tue, 1 Jul 2014 23:41:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268131 - head/sys/dev/nfe
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 01 Jul 2014 23:41:55 -0000

Author: marcel
Date: Tue Jul  1 23:41:54 2014
New Revision: 268131
URL: http://svnweb.freebsd.org/changeset/base/268131

Log:
  Convert nfe(4) to use the driver API.
  
  Submitted by: Mikhail 

Modified:
  head/sys/dev/nfe/if_nfe.c

Modified: head/sys/dev/nfe/if_nfe.c
==============================================================================
--- head/sys/dev/nfe/if_nfe.c	Tue Jul  1 23:37:24 2014	(r268130)
+++ head/sys/dev/nfe/if_nfe.c	Tue Jul  1 23:41:54 2014	(r268131)
@@ -88,7 +88,7 @@ static void nfe_mac_config(struct nfe_so
 static void nfe_set_intr(struct nfe_softc *);
 static __inline void nfe_enable_intr(struct nfe_softc *);
 static __inline void nfe_disable_intr(struct nfe_softc *);
-static int  nfe_ioctl(struct ifnet *, u_long, caddr_t);
+static int  nfe_ioctl(if_t, u_long, caddr_t);
 static void nfe_alloc_msix(struct nfe_softc *, int);
 static int nfe_intr(void *);
 static void nfe_int_task(void *, int);
@@ -101,12 +101,12 @@ static int  nfe_jrxeof(struct nfe_softc 
 static void nfe_txeof(struct nfe_softc *);
 static int  nfe_encap(struct nfe_softc *, struct mbuf **);
 static void nfe_setmulti(struct nfe_softc *);
-static void nfe_start(struct ifnet *);
-static void nfe_start_locked(struct ifnet *);
-static void nfe_watchdog(struct ifnet *);
+static void nfe_start(if_t);
+static void nfe_start_locked(if_t);
+static void nfe_watchdog(if_t);
 static void nfe_init(void *);
 static void nfe_init_locked(void *);
-static void nfe_stop(struct ifnet *);
+static void nfe_stop(if_t);
 static int  nfe_alloc_rx_ring(struct nfe_softc *, struct nfe_rx_ring *);
 static void nfe_alloc_jrx_ring(struct nfe_softc *, struct nfe_jrx_ring *);
 static int  nfe_init_rx_ring(struct nfe_softc *, struct nfe_rx_ring *);
@@ -116,8 +116,8 @@ static void nfe_free_jrx_ring(struct nfe
 static int  nfe_alloc_tx_ring(struct nfe_softc *, struct nfe_tx_ring *);
 static void nfe_init_tx_ring(struct nfe_softc *, struct nfe_tx_ring *);
 static void nfe_free_tx_ring(struct nfe_softc *, struct nfe_tx_ring *);
-static int  nfe_ifmedia_upd(struct ifnet *);
-static void nfe_ifmedia_sts(struct ifnet *, struct ifmediareq *);
+static int  nfe_ifmedia_upd(if_t);
+static void nfe_ifmedia_sts(if_t, struct ifmediareq *);
 static void nfe_tick(void *);
 static void nfe_get_macaddr(struct nfe_softc *, uint8_t *);
 static void nfe_set_macaddr(struct nfe_softc *, uint8_t *);
@@ -364,7 +364,7 @@ static int
 nfe_attach(device_t dev)
 {
 	struct nfe_softc *sc;
-	struct ifnet *ifp;
+	if_t ifp;
 	bus_addr_t dma_addr_max;
 	int error = 0, i, msic, phyloc, reg, rid;
 
@@ -570,9 +570,9 @@ nfe_attach(device_t dev)
 	if (error)
 		goto fail;
 
-	ifp = sc->nfe_ifp = if_alloc(IFT_ETHER);
+	ifp = sc->nfe_ifp = if_gethandle(IFT_ETHER);
 	if (ifp == NULL) {
-		device_printf(dev, "can not if_alloc()\n");
+		device_printf(dev, "can not if_gethandle()\n");
 		error = ENOSPC;
 		goto fail;
 	}
@@ -590,47 +590,47 @@ nfe_attach(device_t dev)
 	/* Create sysctl node. */
 	nfe_sysctl_node(sc);
 
-	ifp->if_softc = sc;
-	if_initname(ifp, device_get_name(dev), device_get_unit(dev));
-	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
-	ifp->if_ioctl = nfe_ioctl;
-	ifp->if_start = nfe_start;
-	ifp->if_hwassist = 0;
-	ifp->if_capabilities = 0;
-	ifp->if_init = nfe_init;
-	IFQ_SET_MAXLEN(&ifp->if_snd, NFE_TX_RING_COUNT - 1);
-	ifp->if_snd.ifq_drv_maxlen = NFE_TX_RING_COUNT - 1;
-	IFQ_SET_READY(&ifp->if_snd);
+	if_setsoftc(ifp, sc);
+	if_initname_drv(ifp, device_get_name(dev), device_get_unit(dev));
+	if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST);
+	if_setioctlfn(ifp, nfe_ioctl);
+	if_setstartfn(ifp, nfe_start);
+	if_sethwassist(ifp, 0);
+	if_setcapabilities(ifp, 0);
+	if_setinitfn(ifp, nfe_init);
+	if_setsendqlen(ifp, NFE_TX_RING_COUNT - 1);
+	if_setsendqready(ifp);
+
 
 	if (sc->nfe_flags & NFE_HW_CSUM) {
-		ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO4;
-		ifp->if_hwassist |= NFE_CSUM_FEATURES | CSUM_TSO;
+		if_setcapabilitiesbit(ifp, IFCAP_HWCSUM | IFCAP_TSO4, 0);
+		if_sethwassistbits(ifp, NFE_CSUM_FEATURES | CSUM_TSO, 0);
 	}
-	ifp->if_capenable = ifp->if_capabilities;
+	if_setcapenable(ifp, if_getcapabilities(ifp));
 
-	sc->nfe_framesize = ifp->if_mtu + NFE_RX_HEADERS;
+	sc->nfe_framesize = if_getmtu(ifp) + NFE_RX_HEADERS;
 	/* VLAN capability setup. */
-	ifp->if_capabilities |= IFCAP_VLAN_MTU;
+	if_setcapabilitiesbit(ifp, IFCAP_VLAN_MTU, 0);
 	if ((sc->nfe_flags & NFE_HW_VLAN) != 0) {
-		ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING;
-		if ((ifp->if_capabilities & IFCAP_HWCSUM) != 0)
-			ifp->if_capabilities |= IFCAP_VLAN_HWCSUM |
-			    IFCAP_VLAN_HWTSO;
+		if_setcapabilitiesbit(ifp, IFCAP_VLAN_HWTAGGING, 0);
+		if ((if_getcapabilities(ifp) & IFCAP_HWCSUM) != 0)
+			if_setcapabilitiesbit(ifp,
+			    (IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO), 0);
 	}
 
 	if (pci_find_cap(dev, PCIY_PMG, ®) == 0)
-		ifp->if_capabilities |= IFCAP_WOL_MAGIC;
-	ifp->if_capenable = ifp->if_capabilities;
+		if_setcapabilitiesbit(ifp, IFCAP_WOL_MAGIC, 0);
+	if_setcapenable(ifp, if_getcapabilities(ifp));
 
 	/*
 	 * Tell the upper layer(s) we support long frames.
-	 * Must appear after the call to ether_ifattach() because
-	 * ether_ifattach() sets ifi_hdrlen to the default value.
+	 * Must appear after the call to ether_ifattach_drv() because
+	 * ether_ifattach_drv() sets ifi_hdrlen to the default value.
 	 */
-	ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
+	if_setifheaderlen(ifp, sizeof(struct ether_vlan_header));
 
 #ifdef DEVICE_POLLING
-	ifp->if_capabilities |= IFCAP_POLLING;
+	if_setcapabilitiesbit(ifp, IFCAP_POLLING, 0);
 #endif
 
 	/* Do MII setup */
@@ -642,14 +642,14 @@ nfe_attach(device_t dev)
 		if (nfe_detect_msik9(sc) != 0)
 			phyloc = 0;
 	}
-	error = mii_attach(dev, &sc->nfe_miibus, ifp, nfe_ifmedia_upd,
-	    nfe_ifmedia_sts, BMSR_DEFCAPMASK, phyloc, MII_OFFSET_ANY,
-	    MIIF_DOPAUSE);
+	error = mii_attach(dev, &sc->nfe_miibus, ifp,
+	    (ifm_change_cb_t)nfe_ifmedia_upd, (ifm_stat_cb_t)nfe_ifmedia_sts,
+	    BMSR_DEFCAPMASK, phyloc, MII_OFFSET_ANY, MIIF_DOPAUSE);
 	if (error != 0) {
 		device_printf(dev, "attaching PHYs failed\n");
 		goto fail;
 	}
-	ether_ifattach(ifp, sc->eaddr);
+	ether_ifattach_drv(ifp, sc->eaddr);
 
 	TASK_INIT(&sc->nfe_int_task, 0, nfe_int_task, sc);
 	sc->nfe_tq = taskqueue_create_fast("nfe_taskq", M_WAITOK,
@@ -674,7 +674,7 @@ nfe_attach(device_t dev)
 		device_printf(dev, "couldn't set up irq\n");
 		taskqueue_free(sc->nfe_tq);
 		sc->nfe_tq = NULL;
-		ether_ifdetach(ifp);
+		ether_ifdetach_drv(ifp);
 		goto fail;
 	}
 
@@ -690,7 +690,7 @@ static int
 nfe_detach(device_t dev)
 {
 	struct nfe_softc *sc;
-	struct ifnet *ifp;
+	if_t ifp;
 	uint8_t eaddr[ETHER_ADDR_LEN];
 	int i, rid;
 
@@ -699,16 +699,16 @@ nfe_detach(device_t dev)
 	ifp = sc->nfe_ifp;
 
 #ifdef DEVICE_POLLING
-	if (ifp != NULL && ifp->if_capenable & IFCAP_POLLING)
+	if (ifp != NULL && if_getcapenable(ifp) & IFCAP_POLLING)
 		ether_poll_deregister(ifp);
 #endif
 	if (device_is_attached(dev)) {
 		NFE_LOCK(sc);
 		nfe_stop(ifp);
-		ifp->if_flags &= ~IFF_UP;
+		if_setflagbits(ifp, 0, IFF_UP);
 		NFE_UNLOCK(sc);
 		callout_drain(&sc->nfe_stat_ch);
-		ether_ifdetach(ifp);
+		ether_ifdetach_drv(ifp);
 	}
 
 	if (ifp) {
@@ -720,7 +720,7 @@ nfe_detach(device_t dev)
 		} else
 			bcopy(sc->eaddr, eaddr, ETHER_ADDR_LEN);
 		nfe_set_macaddr(sc, eaddr);
-		if_free(ifp);
+		if_free_drv(ifp);
 	}
 	if (sc->nfe_miibus)
 		device_delete_child(dev, sc->nfe_miibus);
@@ -805,14 +805,14 @@ static int
 nfe_resume(device_t dev)
 {
 	struct nfe_softc *sc;
-	struct ifnet *ifp;
+	if_t ifp;
 
 	sc = device_get_softc(dev);
 
 	NFE_LOCK(sc);
 	nfe_power(sc);
 	ifp = sc->nfe_ifp;
-	if (ifp->if_flags & IFF_UP)
+	if (if_getflags(ifp) & IFF_UP)
 		nfe_init_locked(sc);
 	sc->nfe_suspended = 0;
 	NFE_UNLOCK(sc);
@@ -892,7 +892,7 @@ nfe_miibus_statchg(device_t dev)
 {
 	struct nfe_softc *sc;
 	struct mii_data *mii;
-	struct ifnet *ifp;
+	if_t ifp;
 	uint32_t rxctl, txctl;
 
 	sc = device_get_softc(dev);
@@ -917,7 +917,7 @@ nfe_miibus_statchg(device_t dev)
 	nfe_mac_config(sc, mii);
 	txctl = NFE_READ(sc, NFE_TX_CTL);
 	rxctl = NFE_READ(sc, NFE_RX_CTL);
-	if (sc->nfe_link != 0 && (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
+	if (sc->nfe_link != 0 && (if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) {
 		txctl |= NFE_TX_START;
 		rxctl |= NFE_RX_START;
 	} else {
@@ -1634,15 +1634,15 @@ static poll_handler_t nfe_poll;
 
 
 static int
-nfe_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
+nfe_poll(if_t ifp, enum poll_cmd cmd, int count)
 {
-	struct nfe_softc *sc = ifp->if_softc;
+	struct nfe_softc *sc = if_getsoftc(ifp);
 	uint32_t r;
 	int rx_npkts = 0;
 
 	NFE_LOCK(sc);
 
-	if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
+	if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING)) {
 		NFE_UNLOCK(sc);
 		return (rx_npkts);
 	}
@@ -1652,7 +1652,7 @@ nfe_poll(struct ifnet *ifp, enum poll_cm
 	else
 		rx_npkts = nfe_rxeof(sc, count, &rx_npkts);
 	nfe_txeof(sc);
-	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
+	if (!if_sendq_empty(ifp))
 		nfe_start_locked(ifp);
 
 	if (cmd == POLL_AND_CHECK_STATUS) {
@@ -1710,14 +1710,14 @@ nfe_disable_intr(struct nfe_softc *sc)
 
 
 static int
-nfe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
+nfe_ioctl(if_t ifp, u_long cmd, caddr_t data)
 {
 	struct nfe_softc *sc;
 	struct ifreq *ifr;
 	struct mii_data *mii;
 	int error, init, mask;
 
-	sc = ifp->if_softc;
+	sc = if_getsoftc(ifp);
 	ifr = (struct ifreq *) data;
 	error = 0;
 	init = 0;
@@ -1725,16 +1725,16 @@ nfe_ioctl(struct ifnet *ifp, u_long cmd,
 	case SIOCSIFMTU:
 		if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > NFE_JUMBO_MTU)
 			error = EINVAL;
-		else if (ifp->if_mtu != ifr->ifr_mtu) {
+		else if (if_getmtu(ifp) != ifr->ifr_mtu) {
 			if ((((sc->nfe_flags & NFE_JUMBO_SUP) == 0) ||
 			    (sc->nfe_jumbo_disable != 0)) &&
 			    ifr->ifr_mtu > ETHERMTU)
 				error = EINVAL;
 			else {
 				NFE_LOCK(sc);
-				ifp->if_mtu = ifr->ifr_mtu;
-				if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
-					ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+				if_setmtu(ifp, ifr->ifr_mtu);
+				if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
+					if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING);
 					nfe_init_locked(sc);
 				}
 				NFE_UNLOCK(sc);
@@ -1743,29 +1743,29 @@ nfe_ioctl(struct ifnet *ifp, u_long cmd,
 		break;
 	case SIOCSIFFLAGS:
 		NFE_LOCK(sc);
-		if (ifp->if_flags & IFF_UP) {
+		if (if_getflags(ifp) & IFF_UP) {
 			/*
 			 * If only the PROMISC or ALLMULTI flag changes, then
 			 * don't do a full re-init of the chip, just update
 			 * the Rx filter.
 			 */
-			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) &&
-			    ((ifp->if_flags ^ sc->nfe_if_flags) &
+			if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) &&
+			    ((if_getflags(ifp) ^ sc->nfe_if_flags) &
 			     (IFF_ALLMULTI | IFF_PROMISC)) != 0)
 				nfe_setmulti(sc);
 			else
 				nfe_init_locked(sc);
 		} else {
-			if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+			if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
 				nfe_stop(ifp);
 		}
-		sc->nfe_if_flags = ifp->if_flags;
+		sc->nfe_if_flags = if_getflags(ifp);
 		NFE_UNLOCK(sc);
 		error = 0;
 		break;
 	case SIOCADDMULTI:
 	case SIOCDELMULTI:
-		if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
+		if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) {
 			NFE_LOCK(sc);
 			nfe_setmulti(sc);
 			NFE_UNLOCK(sc);
@@ -1775,10 +1775,10 @@ nfe_ioctl(struct ifnet *ifp, u_long cmd,
 	case SIOCSIFMEDIA:
 	case SIOCGIFMEDIA:
 		mii = device_get_softc(sc->nfe_miibus);
-		error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, cmd);
+		error = ifmedia_ioctl_drv(ifp, ifr, &mii->mii_media, cmd);
 		break;
 	case SIOCSIFCAP:
-		mask = ifr->ifr_reqcap ^ ifp->if_capenable;
+		mask = ifr->ifr_reqcap ^ if_getcapenable(ifp);
 #ifdef DEVICE_POLLING
 		if ((mask & IFCAP_POLLING) != 0) {
 			if ((ifr->ifr_reqcap & IFCAP_POLLING) != 0) {
@@ -1787,50 +1787,50 @@ nfe_ioctl(struct ifnet *ifp, u_long cmd,
 					break;
 				NFE_LOCK(sc);
 				nfe_disable_intr(sc);
-				ifp->if_capenable |= IFCAP_POLLING;
+				if_setcapenablebit(ifp, IFCAP_POLLING, 0);
 				NFE_UNLOCK(sc);
 			} else {
 				error = ether_poll_deregister(ifp);
 				/* Enable interrupt even in error case */
 				NFE_LOCK(sc);
 				nfe_enable_intr(sc);
-				ifp->if_capenable &= ~IFCAP_POLLING;
+				if_setcapenablebit(ifp, 0, IFCAP_POLLING);
 				NFE_UNLOCK(sc);
 			}
 		}
 #endif /* DEVICE_POLLING */
 		if ((mask & IFCAP_WOL_MAGIC) != 0 &&
-		    (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0)
-			ifp->if_capenable ^= IFCAP_WOL_MAGIC;
+		    (if_getcapabilities(ifp) & IFCAP_WOL_MAGIC) != 0)
+			if_togglecapenable(ifp, IFCAP_WOL_MAGIC);
 		if ((mask & IFCAP_TXCSUM) != 0 &&
-		    (ifp->if_capabilities & IFCAP_TXCSUM) != 0) {
-			ifp->if_capenable ^= IFCAP_TXCSUM;
-			if ((ifp->if_capenable & IFCAP_TXCSUM) != 0)
-				ifp->if_hwassist |= NFE_CSUM_FEATURES;
+		    (if_getcapabilities(ifp) & IFCAP_TXCSUM) != 0) {
+			if_togglecapenable(ifp, IFCAP_TXCSUM);
+			if ((if_getcapenable(ifp) & IFCAP_TXCSUM) != 0)
+				if_sethwassistbits(ifp, NFE_CSUM_FEATURES, 0);
 			else
-				ifp->if_hwassist &= ~NFE_CSUM_FEATURES;
+				if_sethwassistbits(ifp, 0, NFE_CSUM_FEATURES);
 		}
 		if ((mask & IFCAP_RXCSUM) != 0 &&
-		    (ifp->if_capabilities & IFCAP_RXCSUM) != 0) {
-			ifp->if_capenable ^= IFCAP_RXCSUM;
+		    (if_getcapabilities(ifp) & IFCAP_RXCSUM) != 0) {
+			if_togglecapenable(ifp, IFCAP_RXCSUM);
 			init++;
 		}
 		if ((mask & IFCAP_TSO4) != 0 &&
-		    (ifp->if_capabilities & IFCAP_TSO4) != 0) {
-			ifp->if_capenable ^= IFCAP_TSO4;
-			if ((IFCAP_TSO4 & ifp->if_capenable) != 0)
-				ifp->if_hwassist |= CSUM_TSO;
+		    (if_getcapabilities(ifp) & IFCAP_TSO4) != 0) {
+			if_togglecapenable(ifp, IFCAP_TSO4);
+			if ((IFCAP_TSO4 & if_getcapenable(ifp)) != 0)
+				if_sethwassistbits(ifp, CSUM_TSO, 0);
 			else
-				ifp->if_hwassist &= ~CSUM_TSO;
+				if_sethwassistbits(ifp, 0, CSUM_TSO);
 		}
 		if ((mask & IFCAP_VLAN_HWTSO) != 0 &&
-		    (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0)
-			ifp->if_capenable ^= IFCAP_VLAN_HWTSO;
+		    (if_getcapabilities(ifp) & IFCAP_VLAN_HWTSO) != 0)
+			if_togglecapenable(ifp, IFCAP_VLAN_HWTSO);
 		if ((mask & IFCAP_VLAN_HWTAGGING) != 0 &&
-		    (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) {
-			ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
-			if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0)
-				ifp->if_capenable &= ~IFCAP_VLAN_HWTSO;
+		    (if_getcapabilities(ifp) & IFCAP_VLAN_HWTAGGING) != 0) {
+			if_togglecapenable(ifp, IFCAP_VLAN_HWTAGGING);
+			if ((if_getcapenable(ifp) & IFCAP_VLAN_HWTAGGING) == 0)
+				if_setcapenablebit(ifp, 0, IFCAP_VLAN_HWTSO);
 			init++;
 		}
 		/*
@@ -1840,20 +1840,20 @@ nfe_ioctl(struct ifnet *ifp, u_long cmd,
 		 * VLAN stripping. So when we know Rx checksum offload is
 		 * disabled turn entire hardware VLAN assist off.
 		 */
-		if ((ifp->if_capenable & IFCAP_RXCSUM) == 0) {
-			if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0)
+		if ((if_getcapenable(ifp) & IFCAP_RXCSUM) == 0) {
+			if ((if_getcapenable(ifp) & IFCAP_VLAN_HWTAGGING) != 0)
 				init++;
-			ifp->if_capenable &= ~(IFCAP_VLAN_HWTAGGING |
-			    IFCAP_VLAN_HWTSO);
+			if_setcapenablebit(ifp, 0,
+			    (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO));
 		}
-		if (init > 0 && (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
-			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+		if (init > 0 && (if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) {
+			if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING);
 			nfe_init(sc);
 		}
-		VLAN_CAPABILITIES(ifp);
+		if_vlancap(ifp);
 		break;
 	default:
-		error = ether_ioctl(ifp, cmd, data);
+		error = ether_ioctl_drv(ifp, cmd, data);
 		break;
 	}
 
@@ -1883,7 +1883,7 @@ static void
 nfe_int_task(void *arg, int pending)
 {
 	struct nfe_softc *sc = arg;
-	struct ifnet *ifp = sc->nfe_ifp;
+	if_t ifp = sc->nfe_ifp;
 	uint32_t r;
 	int domore;
 
@@ -1899,7 +1899,7 @@ nfe_int_task(void *arg, int pending)
 	DPRINTFN(sc, 5, "nfe_intr: interrupt register %x\n", r);
 
 #ifdef DEVICE_POLLING
-	if (ifp->if_capenable & IFCAP_POLLING) {
+	if (if_getcapenable(ifp) & IFCAP_POLLING) {
 		NFE_UNLOCK(sc);
 		return;
 	}
@@ -1911,7 +1911,7 @@ nfe_int_task(void *arg, int pending)
 		DPRINTF(sc, "link state changed\n");
 	}
 
-	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
+	if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) {
 		NFE_UNLOCK(sc);
 		nfe_disable_intr(sc);
 		return;
@@ -1926,7 +1926,7 @@ nfe_int_task(void *arg, int pending)
 	/* check Tx ring */
 	nfe_txeof(sc);
 
-	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
+	if (!if_sendq_empty(ifp))
 		nfe_start_locked(ifp);
 
 	NFE_UNLOCK(sc);
@@ -2111,7 +2111,7 @@ nfe_jnewbuf(struct nfe_softc *sc, int id
 static int
 nfe_rxeof(struct nfe_softc *sc, int count, int *rx_npktsp)
 {
-	struct ifnet *ifp = sc->nfe_ifp;
+	if_t ifp = sc->nfe_ifp;
 	struct nfe_desc32 *desc32;
 	struct nfe_desc64 *desc64;
 	struct nfe_rx_data *data;
@@ -2149,7 +2149,7 @@ nfe_rxeof(struct nfe_softc *sc, int coun
 		prog++;
 		if ((sc->nfe_flags & (NFE_JUMBO_SUP | NFE_40BIT_ADDR)) == 0) {
 			if (!(flags & NFE_RX_VALID_V1)) {
-				ifp->if_ierrors++;
+				if_incierrors(ifp, 1);
 				nfe_discard_rxbuf(sc, sc->rxq.cur);
 				continue;
 			}
@@ -2159,7 +2159,7 @@ nfe_rxeof(struct nfe_softc *sc, int coun
 			}
 		} else {
 			if (!(flags & NFE_RX_VALID_V2)) {
-				ifp->if_ierrors++;
+				if_incierrors(ifp, 1);
 				nfe_discard_rxbuf(sc, sc->rxq.cur);
 				continue;
 			}
@@ -2171,20 +2171,20 @@ nfe_rxeof(struct nfe_softc *sc, int coun
 		}
 
 		if (flags & NFE_RX_ERROR) {
-			ifp->if_ierrors++;
+			if_incierrors(ifp, 1);
 			nfe_discard_rxbuf(sc, sc->rxq.cur);
 			continue;
 		}
 
 		m = data->m;
 		if (nfe_newbuf(sc, sc->rxq.cur) != 0) {
-			ifp->if_iqdrops++;
+			if_inciqdrops(ifp, 1);
 			nfe_discard_rxbuf(sc, sc->rxq.cur);
 			continue;
 		}
 
 		if ((vtag & NFE_RX_VTAG) != 0 &&
-		    (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) {
+		    (if_getcapenable(ifp) & IFCAP_VLAN_HWTAGGING) != 0) {
 			m->m_pkthdr.ether_vtag = vtag & 0xffff;
 			m->m_flags |= M_VLANTAG;
 		}
@@ -2192,7 +2192,7 @@ nfe_rxeof(struct nfe_softc *sc, int coun
 		m->m_pkthdr.len = m->m_len = len;
 		m->m_pkthdr.rcvif = ifp;
 
-		if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) {
+		if ((if_getcapenable(ifp) & IFCAP_RXCSUM) != 0) {
 			if ((flags & NFE_RX_IP_CSUMOK) != 0) {
 				m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED;
 				m->m_pkthdr.csum_flags |= CSUM_IP_VALID;
@@ -2205,10 +2205,10 @@ nfe_rxeof(struct nfe_softc *sc, int coun
 			}
 		}
 
-		ifp->if_ipackets++;
+		if_incipackets(ifp, 1);
 
 		NFE_UNLOCK(sc);
-		(*ifp->if_input)(ifp, m);
+		if_input(ifp, m);
 		NFE_LOCK(sc);
 		rx_npkts++;
 	}
@@ -2226,7 +2226,7 @@ nfe_rxeof(struct nfe_softc *sc, int coun
 static int
 nfe_jrxeof(struct nfe_softc *sc, int count, int *rx_npktsp)
 {
-	struct ifnet *ifp = sc->nfe_ifp;
+	if_t ifp = sc->nfe_ifp;
 	struct nfe_desc32 *desc32;
 	struct nfe_desc64 *desc64;
 	struct nfe_rx_data *data;
@@ -2265,7 +2265,7 @@ nfe_jrxeof(struct nfe_softc *sc, int cou
 		prog++;
 		if ((sc->nfe_flags & (NFE_JUMBO_SUP | NFE_40BIT_ADDR)) == 0) {
 			if (!(flags & NFE_RX_VALID_V1)) {
-				ifp->if_ierrors++;
+				if_incierrors(ifp, 1);
 				nfe_discard_jrxbuf(sc, sc->jrxq.jcur);
 				continue;
 			}
@@ -2275,7 +2275,7 @@ nfe_jrxeof(struct nfe_softc *sc, int cou
 			}
 		} else {
 			if (!(flags & NFE_RX_VALID_V2)) {
-				ifp->if_ierrors++;
+				if_incierrors(ifp, 1);
 				nfe_discard_jrxbuf(sc, sc->jrxq.jcur);
 				continue;
 			}
@@ -2287,20 +2287,20 @@ nfe_jrxeof(struct nfe_softc *sc, int cou
 		}
 
 		if (flags & NFE_RX_ERROR) {
-			ifp->if_ierrors++;
+			if_incierrors(ifp, 1);
 			nfe_discard_jrxbuf(sc, sc->jrxq.jcur);
 			continue;
 		}
 
 		m = data->m;
 		if (nfe_jnewbuf(sc, sc->jrxq.jcur) != 0) {
-			ifp->if_iqdrops++;
+			if_inciqdrops(ifp, 1);
 			nfe_discard_jrxbuf(sc, sc->jrxq.jcur);
 			continue;
 		}
 
 		if ((vtag & NFE_RX_VTAG) != 0 &&
-		    (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) {
+		    (if_getcapenable(ifp) & IFCAP_VLAN_HWTAGGING) != 0) {
 			m->m_pkthdr.ether_vtag = vtag & 0xffff;
 			m->m_flags |= M_VLANTAG;
 		}
@@ -2308,7 +2308,7 @@ nfe_jrxeof(struct nfe_softc *sc, int cou
 		m->m_pkthdr.len = m->m_len = len;
 		m->m_pkthdr.rcvif = ifp;
 
-		if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) {
+		if ((if_getcapenable(ifp) & IFCAP_RXCSUM) != 0) {
 			if ((flags & NFE_RX_IP_CSUMOK) != 0) {
 				m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED;
 				m->m_pkthdr.csum_flags |= CSUM_IP_VALID;
@@ -2321,10 +2321,10 @@ nfe_jrxeof(struct nfe_softc *sc, int cou
 			}
 		}
 
-		ifp->if_ipackets++;
+		if_incipackets(ifp, 1);
 
 		NFE_UNLOCK(sc);
-		(*ifp->if_input)(ifp, m);
+		if_input(ifp, m);
 		NFE_LOCK(sc);
 		rx_npkts++;
 	}
@@ -2342,7 +2342,7 @@ nfe_jrxeof(struct nfe_softc *sc, int cou
 static void
 nfe_txeof(struct nfe_softc *sc)
 {
-	struct ifnet *ifp = sc->nfe_ifp;
+	if_t ifp = sc->nfe_ifp;
 	struct nfe_desc32 *desc32;
 	struct nfe_desc64 *desc64;
 	struct nfe_tx_data *data = NULL;
@@ -2379,18 +2379,18 @@ nfe_txeof(struct nfe_softc *sc)
 				device_printf(sc->nfe_dev,
 				    "tx v1 error 0x%4b\n", flags, NFE_V1_TXERR);
 
-				ifp->if_oerrors++;
+				if_incoerrors(ifp, 1);
 			} else
-				ifp->if_opackets++;
+				if_incopackets(ifp, 1);
 		} else {
 			if ((flags & NFE_TX_LASTFRAG_V2) == 0)
 				continue;
 			if ((flags & NFE_TX_ERROR_V2) != 0) {
 				device_printf(sc->nfe_dev,
 				    "tx v2 error 0x%4b\n", flags, NFE_V2_TXERR);
-				ifp->if_oerrors++;
+				if_incoerrors(ifp, 1);
 			} else
-				ifp->if_opackets++;
+				if_incopackets(ifp, 1);
 		}
 
 		/* last fragment of the mbuf chain transmitted */
@@ -2405,7 +2405,7 @@ nfe_txeof(struct nfe_softc *sc)
 	if (prog > 0) {
 		sc->nfe_force_tx = 0;
 		sc->txq.next = cons;
-		ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
+		if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE);
 		if (sc->txq.queued == 0)
 			sc->nfe_watchdog_timer = 0;
 	}
@@ -2562,18 +2562,18 @@ nfe_encap(struct nfe_softc *sc, struct m
 static void
 nfe_setmulti(struct nfe_softc *sc)
 {
-	struct ifnet *ifp = sc->nfe_ifp;
-	struct ifmultiaddr *ifma;
-	int i;
+	if_t ifp = sc->nfe_ifp;
+	int i, mc_count, mcnt;
 	uint32_t filter;
 	uint8_t addr[ETHER_ADDR_LEN], mask[ETHER_ADDR_LEN];
 	uint8_t etherbroadcastaddr[ETHER_ADDR_LEN] = {
 		0xff, 0xff, 0xff, 0xff, 0xff, 0xff
 	};
+	uint8_t *mta;
 
 	NFE_LOCK_ASSERT(sc);
 
-	if ((ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) != 0) {
+	if ((if_getflags(ifp) & (IFF_ALLMULTI | IFF_PROMISC)) != 0) {
 		bzero(addr, ETHER_ADDR_LEN);
 		bzero(mask, ETHER_ADDR_LEN);
 		goto done;
@@ -2583,13 +2583,28 @@ nfe_setmulti(struct nfe_softc *sc)
 	bcopy(etherbroadcastaddr, mask, ETHER_ADDR_LEN);
 
 	if_maddr_rlock(ifp);
-	TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
-		u_char *addrp;
+	mc_count = if_multiaddr_count(ifp, -1);
+	mta = malloc(sizeof(uint8_t) * ETHER_ADDR_LEN * mc_count, M_DEVBUF,
+	    M_NOWAIT);
+
+	/* Unable to get memory - process without filtering */
+	if (mta == NULL) {
+		device_printf(sc->nfe_dev, "nfe_setmulti: failed to allocate"
+		    "temp multicast buffer!\n");
 
-		if (ifma->ifma_addr->sa_family != AF_LINK)
-			continue;
+		bzero(addr, ETHER_ADDR_LEN);
+		bzero(mask, ETHER_ADDR_LEN);
+		free(mta, M_DEVBUF);
+		if_maddr_runlock(ifp);
+		goto done;
+	};
+
+	if_setupmultiaddr(ifp, mta, &mcnt, mc_count);
 
-		addrp = LLADDR((struct sockaddr_dl *) ifma->ifma_addr);
+	for (i = 0; i < mcnt; i++) {
+		uint8_t *addrp;
+
+		addrp = mta + (i * ETHER_ADDR_LEN);
 		for (i = 0; i < ETHER_ADDR_LEN; i++) {
 			u_int8_t mcaddr = addrp[i];
 			addr[i] &= mcaddr;
@@ -2617,15 +2632,15 @@ done:
 	filter = NFE_READ(sc, NFE_RXFILTER);
 	filter &= NFE_PFF_RX_PAUSE;
 	filter |= NFE_RXFILTER_MAGIC;
-	filter |= (ifp->if_flags & IFF_PROMISC) ? NFE_PFF_PROMISC : NFE_PFF_U2M;
+	filter |= (if_getflags(ifp) & IFF_PROMISC) ? NFE_PFF_PROMISC : NFE_PFF_U2M;
 	NFE_WRITE(sc, NFE_RXFILTER, filter);
 }
 
 
 static void
-nfe_start(struct ifnet *ifp)
+nfe_start(if_t ifp)
 {
-	struct nfe_softc *sc = ifp->if_softc;
+	struct nfe_softc *sc = if_getsoftc(ifp);
 
 	NFE_LOCK(sc);
 	nfe_start_locked(ifp);
@@ -2633,32 +2648,33 @@ nfe_start(struct ifnet *ifp)
 }
 
 static void
-nfe_start_locked(struct ifnet *ifp)
+nfe_start_locked(if_t ifp)
 {
-	struct nfe_softc *sc = ifp->if_softc;
+	struct nfe_softc *sc = if_getsoftc(ifp);
 	struct mbuf *m0;
-	int enq;
+	int enq = 0;
 
 	NFE_LOCK_ASSERT(sc);
 
-	if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
+	if ((if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
 	    IFF_DRV_RUNNING || sc->nfe_link == 0)
 		return;
 
-	for (enq = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd);) {
-		IFQ_DRV_DEQUEUE(&ifp->if_snd, m0);
+	while (!if_sendq_empty(ifp)) {
+		m0 = if_dequeue(ifp);
+
 		if (m0 == NULL)
 			break;
 
 		if (nfe_encap(sc, &m0) != 0) {
 			if (m0 == NULL)
 				break;
-			IFQ_DRV_PREPEND(&ifp->if_snd, m0);
-			ifp->if_drv_flags |= IFF_DRV_OACTIVE;
+			if_sendq_prepend(ifp, m0);
+			if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0);
 			break;
 		}
 		enq++;
-		ETHER_BPF_MTAP(ifp, m0);
+		if_etherbpfmtap(ifp, m0);
 	}
 
 	if (enq > 0) {
@@ -2677,9 +2693,9 @@ nfe_start_locked(struct ifnet *ifp)
 
 
 static void
-nfe_watchdog(struct ifnet *ifp)
+nfe_watchdog(if_t ifp)
 {
-	struct nfe_softc *sc = ifp->if_softc;
+	struct nfe_softc *sc = if_getsoftc(ifp);
 
 	if (sc->nfe_watchdog_timer == 0 || --sc->nfe_watchdog_timer)
 		return;
@@ -2689,7 +2705,7 @@ nfe_watchdog(struct ifnet *ifp)
 	if (sc->txq.queued == 0) {
 		if_printf(ifp, "watchdog timeout (missed Tx interrupts) "
 		    "-- recovering\n");
-		if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
+		if (!if_sendq_empty(ifp))
 			nfe_start_locked(ifp);
 		return;
 	}
@@ -2707,8 +2723,8 @@ nfe_watchdog(struct ifnet *ifp)
 
 	if_printf(ifp, "watchdog timeout\n");
 
-	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
-	ifp->if_oerrors++;
+	if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING);
+	if_incoerrors(ifp, 1);
 	nfe_init_locked(sc);
 }
 
@@ -2728,7 +2744,7 @@ static void
 nfe_init_locked(void *xsc)
 {
 	struct nfe_softc *sc = xsc;
-	struct ifnet *ifp = sc->nfe_ifp;
+	if_t ifp = sc->nfe_ifp;
 	struct mii_data *mii;
 	uint32_t val;
 	int error;
@@ -2737,12 +2753,12 @@ nfe_init_locked(void *xsc)
 
 	mii = device_get_softc(sc->nfe_miibus);
 
-	if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+	if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
 		return;
 
 	nfe_stop(ifp);
 
-	sc->nfe_framesize = ifp->if_mtu + NFE_RX_HEADERS;
+	sc->nfe_framesize = if_getmtu(ifp) + NFE_RX_HEADERS;
 
 	nfe_init_tx_ring(sc, &sc->txq);
 	if (sc->nfe_framesize > (MCLBYTES - ETHER_HDR_LEN))
@@ -2771,16 +2787,16 @@ nfe_init_locked(void *xsc)
 	else if (sc->nfe_flags & NFE_JUMBO_SUP)
 		sc->rxtxctl |= NFE_RXTX_V2MAGIC;
 
-	if ((ifp->if_capenable & IFCAP_RXCSUM) != 0)
+	if ((if_getcapenable(ifp) & IFCAP_RXCSUM) != 0)
 		sc->rxtxctl |= NFE_RXTX_RXCSUM;
-	if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0)
+	if ((if_getcapenable(ifp) & IFCAP_VLAN_HWTAGGING) != 0)
 		sc->rxtxctl |= NFE_RXTX_VTAG_INSERT | NFE_RXTX_VTAG_STRIP;
 
 	NFE_WRITE(sc, NFE_RXTX_CTL, NFE_RXTX_RESET | sc->rxtxctl);
 	DELAY(10);
 	NFE_WRITE(sc, NFE_RXTX_CTL, sc->rxtxctl);
 
-	if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0)
+	if ((if_getcapenable(ifp) & IFCAP_VLAN_HWTAGGING) != 0)
 		NFE_WRITE(sc, NFE_VTAG_CTL, NFE_VTAG_ENABLE);
 	else
 		NFE_WRITE(sc, NFE_VTAG_CTL, 0);
@@ -2788,7 +2804,7 @@ nfe_init_locked(void *xsc)
 	NFE_WRITE(sc, NFE_SETUP_R6, 0);
 
 	/* set MAC address */
-	nfe_set_macaddr(sc, IF_LLADDR(ifp));
+	nfe_set_macaddr(sc, if_getlladdr(ifp));
 
 	/* tell MAC where rings are in memory */
 	if (sc->nfe_framesize > MCLBYTES - ETHER_HDR_LEN) {
@@ -2858,15 +2874,15 @@ nfe_init_locked(void *xsc)
 	nfe_stats_clear(sc);
 
 #ifdef DEVICE_POLLING
-	if (ifp->if_capenable & IFCAP_POLLING)
+	if (if_getcapenable(ifp) & IFCAP_POLLING)
 		nfe_disable_intr(sc);
 	else
 #endif
 	nfe_set_intr(sc);
 	nfe_enable_intr(sc); /* enable interrupts */
 
-	ifp->if_drv_flags |= IFF_DRV_RUNNING;
-	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
+	if_setdrvflagbits(ifp, IFF_DRV_RUNNING, 0);
+	if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE);
 
 	sc->nfe_link = 0;
 	mii_mediachg(mii);
@@ -2876,9 +2892,9 @@ nfe_init_locked(void *xsc)
 
 
 static void
-nfe_stop(struct ifnet *ifp)
+nfe_stop(if_t ifp)
 {
-	struct nfe_softc *sc = ifp->if_softc;
+	struct nfe_softc *sc = if_getsoftc(ifp);
 	struct nfe_rx_ring *rx_ring;
 	struct nfe_jrx_ring *jrx_ring;
 	struct nfe_tx_ring *tx_ring;
@@ -2889,7 +2905,7 @@ nfe_stop(struct ifnet *ifp)
 	NFE_LOCK_ASSERT(sc);
 
 	sc->nfe_watchdog_timer = 0;
-	ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
+	if_setdrvflagbits(ifp, 0, (IFF_DRV_RUNNING | IFF_DRV_OACTIVE));
 
 	callout_stop(&sc->nfe_stat_ch);
 
@@ -2951,9 +2967,9 @@ nfe_stop(struct ifnet *ifp)
 
 
 static int
-nfe_ifmedia_upd(struct ifnet *ifp)
+nfe_ifmedia_upd(if_t ifp)
 {
-	struct nfe_softc *sc = ifp->if_softc;
+	struct nfe_softc *sc = if_getsoftc(ifp);
 	struct mii_data *mii;
 
 	NFE_LOCK(sc);
@@ -2966,12 +2982,12 @@ nfe_ifmedia_upd(struct ifnet *ifp)
 
 
 static void
-nfe_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
+nfe_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr)
 {
 	struct nfe_softc *sc;
 	struct mii_data *mii;
 
-	sc = ifp->if_softc;
+	sc = if_getsoftc(ifp);
 
 	NFE_LOCK(sc);
 	mii = device_get_softc(sc->nfe_miibus);
@@ -2988,7 +3004,7 @@ nfe_tick(void *xsc)
 {
 	struct nfe_softc *sc;
 	struct mii_data *mii;
-	struct ifnet *ifp;
+	if_t ifp;
 
 	sc = (struct nfe_softc *)xsc;
 
@@ -3367,7 +3383,7 @@ nfe_set_linkspeed(struct nfe_softc *sc)
 static void
 nfe_set_wol(struct nfe_softc *sc)
 {
-	struct ifnet *ifp;
+	if_t ifp;
 	uint32_t wolctl;
 	int pmc;
 	uint16_t pmstat;
@@ -3377,12 +3393,12 @@ nfe_set_wol(struct nfe_softc *sc)
 	if (pci_find_cap(sc->nfe_dev, PCIY_PMG, &pmc) != 0)
 		return;
 	ifp = sc->nfe_ifp;
-	if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0)
+	if ((if_getcapenable(ifp) & IFCAP_WOL_MAGIC) != 0)
 		wolctl = NFE_WOL_MAGIC;
 	else
 		wolctl = 0;
 	NFE_WRITE(sc, NFE_WOL_CTL, wolctl);
-	if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) {
+	if ((if_getcapenable(ifp) & IFCAP_WOL_MAGIC) != 0) {
 		nfe_set_linkspeed(sc);
 		if ((sc->nfe_flags & NFE_PWR_MGMT) != 0)
 			NFE_WRITE(sc, NFE_PWR2_CTL,
@@ -3396,7 +3412,7 @@ nfe_set_wol(struct nfe_softc *sc)
 	/* Request PME if WOL is requested. */
 	pmstat = pci_read_config(sc->nfe_dev, pmc + PCIR_POWER_STATUS, 2);
 	pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE);
-	if ((ifp->if_capenable & IFCAP_WOL) != 0)
+	if ((if_getcapenable(ifp) & IFCAP_WOL) != 0)
 		pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE;
 	pci_write_config(sc->nfe_dev, pmc + PCIR_POWER_STATUS, pmstat, 2);
 }

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 04:06:07 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 162AB5CC;
 Wed,  2 Jul 2014 04:06:07 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 037B521E7;
 Wed,  2 Jul 2014 04:06:07 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62466c0000582;
 Wed, 2 Jul 2014 04:06:06 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62466oL000581;
 Wed, 2 Jul 2014 04:06:06 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201407020406.s62466oL000581@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Wed, 2 Jul 2014 04:06:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268134 - head/usr.bin/mkimg
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 04:06:07 -0000

Author: marcel
Date: Wed Jul  2 04:06:06 2014
New Revision: 268134
URL: http://svnweb.freebsd.org/changeset/base/268134

Log:
  Prepare for merging to stable/10: update the history section.

Modified:
  head/usr.bin/mkimg/mkimg.1

Modified: head/usr.bin/mkimg/mkimg.1
==============================================================================
--- head/usr.bin/mkimg/mkimg.1	Wed Jul  2 01:32:40 2014	(r268133)
+++ head/usr.bin/mkimg/mkimg.1	Wed Jul  2 04:06:06 2014	(r268134)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 22, 2014
+.Dd July 1, 2014
 .Dt MKIMG 1
 .Os
 .Sh NAME
@@ -173,8 +173,8 @@ In the following example the file system
 .Sh HISTORY
 The
 .Nm
-utility appeared in
-.Fx 11.0
+utility first appeared in
+.Fx 10.1
 .Sh AUTHORS
 The
 .Nm

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 05:09:42 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0A44C16B;
 Wed,  2 Jul 2014 05:09:42 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EB8F12683;
 Wed,  2 Jul 2014 05:09:41 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6259f9N029359;
 Wed, 2 Jul 2014 05:09:41 GMT (envelope-from eadler@svn.freebsd.org)
Received: (from eadler@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6259fmZ029357;
 Wed, 2 Jul 2014 05:09:41 GMT (envelope-from eadler@svn.freebsd.org)
Message-Id: <201407020509.s6259fmZ029357@svn.freebsd.org>
From: Eitan Adler 
Date: Wed, 2 Jul 2014 05:09:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268135 - in head: tools/build/mk usr.bin/svn/svn
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 05:09:42 -0000

Author: eadler
Date: Wed Jul  2 05:09:41 2014
New Revision: 268135
URL: http://svnweb.freebsd.org/changeset/base/268135

Log:
  Add documentation for svnlite.
  
  PR:		191544
  Reported by:	eric
  Reviewed by:	imp
  MFC After: 	1 week

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc
  head/usr.bin/svn/svn/Makefile

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==============================================================================
--- head/tools/build/mk/OptionalObsoleteFiles.inc	Wed Jul  2 04:06:06 2014	(r268134)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc	Wed Jul  2 05:09:41 2014	(r268135)
@@ -4716,6 +4716,7 @@ OLD_FILES+=usr/bin/svnliterdump
 OLD_FILES+=usr/bin/svnliteserve
 OLD_FILES+=usr/bin/svnlitesync
 OLD_FILES+=usr/bin/svnliteversion
+OLD_FILES+=usr/share/man/man1/svnlite.1.gz
 .endif
 
 .if ${MK_SVN} == no

Modified: head/usr.bin/svn/svn/Makefile
==============================================================================
--- head/usr.bin/svn/svn/Makefile	Wed Jul  2 04:06:06 2014	(r268134)
+++ head/usr.bin/svn/svn/Makefile	Wed Jul  2 05:09:41 2014	(r268135)
@@ -1,7 +1,5 @@
 # $FreeBSD$
 
-MAN=
-
 .include "${.CURDIR}/../Makefile.inc"
 
 .PATH:	${SVNDIR}/svn
@@ -64,4 +62,8 @@ freebsd-organization.h:
 	    > freebsd-organization.h
 .endif
 
+svnlite.1: svn.1
+	# Avoid the website
+	sed -E 's,(^| |B|`)svn,\1svnlite,g' ${SVNDIR}/svn/svn.1 > ${.OBJDIR}/svnlite.1
+
 .include 

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 05:45:40 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id F11BC9C5;
 Wed,  2 Jul 2014 05:45:40 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DE8492973;
 Wed,  2 Jul 2014 05:45:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s625jeZs047467;
 Wed, 2 Jul 2014 05:45:40 GMT (envelope-from mjg@svn.freebsd.org)
Received: (from mjg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s625jeih047466;
 Wed, 2 Jul 2014 05:45:40 GMT (envelope-from mjg@svn.freebsd.org)
Message-Id: <201407020545.s625jeih047466@svn.freebsd.org>
From: Mateusz Guzik 
Date: Wed, 2 Jul 2014 05:45:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268136 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 05:45:41 -0000

Author: mjg
Date: Wed Jul  2 05:45:40 2014
New Revision: 268136
URL: http://svnweb.freebsd.org/changeset/base/268136

Log:
  Plug gcc warning after r268074 about unitialized newsigacts
  
  Reported by:	Gary Jennejohn 

Modified:
  head/sys/kern/kern_exec.c

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c	Wed Jul  2 05:09:41 2014	(r268135)
+++ head/sys/kern/kern_exec.c	Wed Jul  2 05:45:40 2014	(r268136)
@@ -623,8 +623,10 @@ interpret:
 		oldsigacts = p->p_sigacts;
 		newsigacts = sigacts_alloc();
 		sigacts_copy(newsigacts, oldsigacts);
-	} else
+	} else {
 		oldsigacts = NULL;
+		newsigacts = NULL; /* satisfy gcc */
+	}
 
 	PROC_LOCK(p);
 	if (oldsigacts)

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 08:43:35 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 824D5284;
 Wed,  2 Jul 2014 08:43:35 +0000 (UTC)
Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com
 [IPv6:2a00:1450:400c:c00::22a])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 5EB7428EE;
 Wed,  2 Jul 2014 08:43:34 +0000 (UTC)
Received: by mail-wg0-f42.google.com with SMTP id z12so10673644wgg.13
 for ; Wed, 02 Jul 2014 01:43:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=AseMYvzBW7vig6STSeGHU1WEp59q7CwhDpHJqvqbtvw=;
 b=xy0osFEwaRFDZyyCicHJW8zdE8BckLnuehHXFdQq6KwvCJ9ZKeIsvp23/Nu3hSe6g7
 brbnalYEzLvh+ZgxSpgrEYiaPxBOyVPRSTwhd9weGj09IzvhGajhfLYWVdvW7xp7OqJb
 +c2RI72dks3o6DchNfrVbkP5FTH0UO+a1CMGDReYqy6hJNqYezw5x7tg2L2uZXzFMlkF
 ht8HAINZwBkTp633xJdkIl8YxSnjZi4XXEUiz5B63/KdRwG0Cnq8/OJEpY08LZzdsOZS
 0yfC4EcBz5Z559NoproypIYYwIIwFYTBj1Euw+D1HGsTFJo8zAtCI79t9zAz0uzlGcoK
 tXYg==
X-Received: by 10.180.108.103 with SMTP id hj7mr42680553wib.82.1404290611108; 
 Wed, 02 Jul 2014 01:43:31 -0700 (PDT)
Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net.
 [2001:470:1f08:1f7::2])
 by mx.google.com with ESMTPSA id lo18sm52820942wic.1.2014.07.02.01.43.29
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Wed, 02 Jul 2014 01:43:30 -0700 (PDT)
Date: Wed, 2 Jul 2014 10:43:28 +0200
From: Mateusz Guzik 
To: Konstantin Belousov 
Subject: Re: svn commit: r268087 - head/sys/kern
Message-ID: <20140702084327.GH26696@dft-labs.eu>
References: <201407010921.s619LXHL063077@svn.freebsd.org>
 
 <20140701143238.GD26696@dft-labs.eu>
 <20140701180717.GS93733@kib.kiev.ua>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20140701180717.GS93733@kib.kiev.ua>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "svn-src-head@freebsd.org" ,
 Matthew Fleming ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" ,
 Mateusz Guzik 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 08:43:35 -0000

On Tue, Jul 01, 2014 at 09:07:17PM +0300, Konstantin Belousov wrote:
> On Tue, Jul 01, 2014 at 04:32:38PM +0200, Mateusz Guzik wrote:
> > All other threads have to be blocked, otherwise there are more dangerous
> > races - for instance we support sharing file descriptor tables, so
> > execve makes sure to unshare the table (fdunshare()), which is
> > especially important for suid binaries. If other threads could execute,
> > they could fork off after fdunshare() and then have a table shared with
> > now privileged process.
> In fact, other threads can execute, just not in this process.
> If rfork(2) was used, then the filedesc table can be shared, but
> not the address space.
> 

There is no problem with threads using different struct proc.

If there are rforked threads with shared fdatble, refcount is > 1 and
fdunshare() copies the table. If refcount is 1, there is no rforked
thread which could modify the table. Either way, execing thread is safe
in that regard.

> I somehow thought that you already ensured that this does not happen.

My guess is you are referring to reading the table by
kern_proc_filedesc_out & friends when locks are dropped after permission
checks and nothing prevents target process from execing a suid binary
and leaking information if fdtable is read late enough.

This is not fixed yet. I had a tour over the kernel and several other
p_candebug users have this problem since they just PHOLD and drop locks.
Most PHOLD users need to also block execve, this requires some more time
to make sure all holes are spotted.

-- 
Mateusz Guzik 

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 08:45:27 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7FEA63E3;
 Wed,  2 Jul 2014 08:45:27 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6CDCF2903;
 Wed,  2 Jul 2014 08:45:27 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s628jRrb031825;
 Wed, 2 Jul 2014 08:45:27 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s628jRG5031824;
 Wed, 2 Jul 2014 08:45:27 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201407020845.s628jRG5031824@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Wed, 2 Jul 2014 08:45:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268137 - head/sys/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 08:45:27 -0000

Author: hselasky
Date: Wed Jul  2 08:45:26 2014
New Revision: 268137
URL: http://svnweb.freebsd.org/changeset/base/268137

Log:
  Define a "__weak" macro for declaring symbols "weak".

Modified:
  head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==============================================================================
--- head/sys/sys/cdefs.h	Wed Jul  2 05:45:40 2014	(r268136)
+++ head/sys/sys/cdefs.h	Wed Jul  2 08:45:26 2014	(r268137)
@@ -210,7 +210,9 @@
 #define	__packed
 #define	__aligned(x)
 #define	__section(x)
+#define	__weak
 #else
+#define	__weak		__attribute__((__weak__))
 #if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER)
 #define	__dead2
 #define	__pure2

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 08:49:07 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2CBF2713;
 Wed,  2 Jul 2014 08:49:07 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 19E16293D;
 Wed,  2 Jul 2014 08:49:07 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s628n6e8032406;
 Wed, 2 Jul 2014 08:49:06 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s628n68d032404;
 Wed, 2 Jul 2014 08:49:06 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201407020849.s628n68d032404@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Wed, 2 Jul 2014 08:49:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268138 - head/sys/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 08:49:07 -0000

Author: hselasky
Date: Wed Jul  2 08:49:06 2014
New Revision: 268138
URL: http://svnweb.freebsd.org/changeset/base/268138

Log:
  Add support for empty data sets. Data set begin and end pointers
  should resolve to "NULL" when not present. This is done by declaring
  the data set begin and end symbols as "weak".

Modified:
  head/sys/sys/linker_set.h

Modified: head/sys/sys/linker_set.h
==============================================================================
--- head/sys/sys/linker_set.h	Wed Jul  2 08:45:26 2014	(r268137)
+++ head/sys/sys/linker_set.h	Wed Jul  2 08:49:06 2014	(r268138)
@@ -79,9 +79,9 @@
 /*
  * Initialize before referring to a given linker set.
  */
-#define SET_DECLARE(set, ptype)						\
-	extern ptype *__CONCAT(__start_set_,set);			\
-	extern ptype *__CONCAT(__stop_set_,set)
+#define SET_DECLARE(set, ptype)					\
+	extern ptype __weak *__CONCAT(__start_set_,set);	\
+	extern ptype __weak *__CONCAT(__stop_set_,set)
 
 #define SET_BEGIN(set)							\
 	(&__CONCAT(__start_set_,set))

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 12:07:02 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 914A679E;
 Wed,  2 Jul 2014 12:07:02 +0000 (UTC)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2FF2A2D5C;
 Wed,  2 Jul 2014 12:07:01 +0000 (UTC)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s62C6vN2082442
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Wed, 2 Jul 2014 15:06:57 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s62C6vN2082442
Received: (from kostik@localhost)
 by tom.home (8.14.9/8.14.9/Submit) id s62C6vK5082441;
 Wed, 2 Jul 2014 15:06:57 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Wed, 2 Jul 2014 15:06:57 +0300
From: Konstantin Belousov 
To: Mateusz Guzik 
Subject: Re: svn commit: r268087 - head/sys/kern
Message-ID: <20140702120657.GZ93733@kib.kiev.ua>
References: <201407010921.s619LXHL063077@svn.freebsd.org>
 
 <20140701143238.GD26696@dft-labs.eu>
 <20140701180717.GS93733@kib.kiev.ua>
 <20140702084327.GH26696@dft-labs.eu>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="UpdKy7mRHviOTiWe"
Content-Disposition: inline
In-Reply-To: <20140702084327.GH26696@dft-labs.eu>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 autolearn_force=no version=3.4.0
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home
Cc: "svn-src-head@freebsd.org" ,
 Matthew Fleming ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" ,
 Mateusz Guzik 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 12:07:02 -0000


--UpdKy7mRHviOTiWe
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 02, 2014 at 10:43:28AM +0200, Mateusz Guzik wrote:
> On Tue, Jul 01, 2014 at 09:07:17PM +0300, Konstantin Belousov wrote:
> > On Tue, Jul 01, 2014 at 04:32:38PM +0200, Mateusz Guzik wrote:
> > > All other threads have to be blocked, otherwise there are more danger=
ous
> > > races - for instance we support sharing file descriptor tables, so
> > > execve makes sure to unshare the table (fdunshare()), which is
> > > especially important for suid binaries. If other threads could execut=
e,
> > > they could fork off after fdunshare() and then have a table shared wi=
th
> > > now privileged process.
> > In fact, other threads can execute, just not in this process.
> > If rfork(2) was used, then the filedesc table can be shared, but
> > not the address space.
> >=20
>=20
> There is no problem with threads using different struct proc.
>=20
> If there are rforked threads with shared fdatble, refcount is > 1 and
> fdunshare() copies the table. If refcount is 1, there is no rforked
> thread which could modify the table. Either way, execing thread is safe
> in that regard.
Thank you for clarifying, this is what I asked about.

>=20
> > I somehow thought that you already ensured that this does not happen.
>=20
> My guess is you are referring to reading the table by
> kern_proc_filedesc_out & friends when locks are dropped after permission
> checks and nothing prevents target process from execing a suid binary
> and leaking information if fdtable is read late enough.
>=20
> This is not fixed yet. I had a tour over the kernel and several other
> p_candebug users have this problem since they just PHOLD and drop locks.
> Most PHOLD users need to also block execve, this requires some more time
> to make sure all holes are spotted.
>=20
> --=20
> Mateusz Guzik 

--UpdKy7mRHviOTiWe
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJTs/XgAAoJEJDCuSvBvK1B348P+gLP99dg3L51uBkamMnMxm0V
kFTkebITM8LtOYoOiFqvLw/eeWJ6Bi//bgy8bGH7sw8HWpcfpRoTya3GF/zdS99C
46W8wtoXNvnFC05d4dbbFDQmKfihwy7AABhBGmPsK52MgOpytVbFAqR2P8FhYYvk
eHoBMXPnUpqVOUQyp00tWpc24bYanXZTpQ88AUYT7fVuCE7BMxOlQVQhuV6RyVi2
vu4IxPPU2zZyjv+Kym9a7rRDvwYw5vaEEjZw9ir5foAFKP414klY0yPvHeCe8DGd
UMuy5hJZWfxvY0S7t20PD3AJD7zttpcuFK9xi9VjpnQnnbx2P/+sR9mkA6HhNVe3
wyQsEPMLuZ+ZFPtE/+CnIQpGEzOBf4k7b0fqnWlECkQsZYM/P7u6aOXvHhf61U/p
EK5zzpjT9hhej1A4XOvjZOfopz1RQmP+98KnU98mCjoDm0BDK2x35Y0s6Qam3uf5
SHlc7Iq5gioYRN1DOwm1OQupFWoDBemciSV8fcMHlKe36zA/23AGRetPyiofWPGR
OyKRKt0hKgiXsECKTSRHIGxZMgF8e2kygoZWrS796CNzU+JIkjwgWM5jioh01ltm
enCqRmM0tG2fSOiX7BBMjpX20Q3nFYzT2y19EStp10LObPg1k6HVGWpESuX+XVrg
8rCrNlC7Ac9+dYq/kV7m
=9Mnb
-----END PGP SIGNATURE-----

--UpdKy7mRHviOTiWe--

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 12:13:12 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 08F8C957;
 Wed,  2 Jul 2014 12:13:12 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EA8BE2E03;
 Wed,  2 Jul 2014 12:13:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62CDBHv031610;
 Wed, 2 Jul 2014 12:13:11 GMT (envelope-from luigi@svn.freebsd.org)
Received: (from luigi@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62CDBM7031609;
 Wed, 2 Jul 2014 12:13:11 GMT (envelope-from luigi@svn.freebsd.org)
Message-Id: <201407021213.s62CDBM7031609@svn.freebsd.org>
From: Luigi Rizzo 
Date: Wed, 2 Jul 2014 12:13:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268156 - head/sys/dev/oce
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 12:13:12 -0000

Author: luigi
Date: Wed Jul  2 12:13:11 2014
New Revision: 268156
URL: http://svnweb.freebsd.org/changeset/base/268156

Log:
  Various bugfixes from Stefano Garzarella:
  
  1. oce_multiq_start(): make sure the buffer is consumed even on ENXIO
  2. oce_multiq_transmit(): there is an extra call to drbr_enqueue()
    causing the mbuf to be enqueued twice when the NIC's queue is full,
    and potential panics
  3. oce_multiq_transmit(): same problem fixed recently in ixgbe (r267187)
     and other drivers: if the mbuf is enqueued, the proper return value is 0
  
  Submitted by:	Stefano Garzarella
  MFC after:	3 days

Modified:
  head/sys/dev/oce/oce_if.c

Modified: head/sys/dev/oce/oce_if.c
==============================================================================
--- head/sys/dev/oce/oce_if.c	Wed Jul  2 11:51:01 2014	(r268155)
+++ head/sys/dev/oce/oce_if.c	Wed Jul  2 12:13:11 2014	(r268156)
@@ -563,9 +563,6 @@ oce_multiq_start(struct ifnet *ifp, stru
 	int queue_index = 0;
 	int status = 0;
 
-	if (!sc->link_status)
-		return ENXIO;
-
 	if ((m->m_flags & M_FLOWID) != 0)
 		queue_index = m->m_pkthdr.flowid % sc->nwqs;
 
@@ -1274,7 +1271,6 @@ oce_multiq_transmit(struct ifnet *ifp, s
 				drbr_putback(ifp, br, next);
 				wq->tx_stats.tx_stops ++;
 				ifp->if_drv_flags |= IFF_DRV_OACTIVE;
-				status = drbr_enqueue(ifp, br, next);
 			}  
 			break;
 		}
@@ -1285,7 +1281,7 @@ oce_multiq_transmit(struct ifnet *ifp, s
 		ETHER_BPF_MTAP(ifp, next);
 	}
 
-	return status;
+	return 0;
 }
 
 

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 13:24:23 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 17828860;
 Wed,  2 Jul 2014 13:24:23 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E06E224F3;
 Wed,  2 Jul 2014 13:24:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62DOMIr065098;
 Wed, 2 Jul 2014 13:24:22 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62DOMfa065093;
 Wed, 2 Jul 2014 13:24:22 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201407021324.s62DOMfa065093@svn.freebsd.org>
From: Ed Maste 
Date: Wed, 2 Jul 2014 13:24:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268158 - in head/sys: amd64/amd64 kern sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 13:24:23 -0000

Author: emaste
Date: Wed Jul  2 13:24:21 2014
New Revision: 268158
URL: http://svnweb.freebsd.org/changeset/base/268158

Log:
  Prefer vt(4) for UEFI boot
  
  The UEFI framebuffer driver vt_efifb requires vt(4), so add a mechanism
  for the startup routine to set the preferred console.  This change is
  ugly because console init happens very early in the boot, making a
  cleaner interface difficult.  This change is intended only to facilitate
  the sc(4) / vt(4) transition, and can be reverted once vt(4) is the
  default.

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/kern/kern_cons.c
  head/sys/sys/cons.h

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Wed Jul  2 13:09:26 2014	(r268157)
+++ head/sys/amd64/amd64/machdep.c	Wed Jul  2 13:24:21 2014	(r268158)
@@ -1955,6 +1955,14 @@ hammer_time(u_int64_t modulep, u_int64_t
 	clock_init();
 
 	/*
+	 * Use vt(4) by default for UEFI boot (during the sc(4)/vt(4)
+	 * transition).
+	 */
+	if (preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP) !=
+	    NULL)
+		vty_set_preferred(VTY_VT);
+
+	/*
 	 * Initialize the console before we print anything out.
 	 */
 	cninit();

Modified: head/sys/kern/kern_cons.c
==============================================================================
--- head/sys/kern/kern_cons.c	Wed Jul  2 13:09:26 2014	(r268157)
+++ head/sys/kern/kern_cons.c	Wed Jul  2 13:24:21 2014	(r268158)
@@ -652,6 +652,7 @@ sysbeep(int pitch __unused, int period _
 /*
  * Temporary support for sc(4) to vt(4) transition.
  */
+static unsigned vty_prefer;
 static char vty_name[16];
 SYSCTL_STRING(_kern, OID_AUTO, vty, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, vty_name,
     0, "Console vty driver");
@@ -676,6 +677,10 @@ vty_enabled(unsigned vty)
 				break;
 			}
 #endif
+			if (vty_prefer != 0) {
+				vty_selected = vty_prefer;
+				break;
+			}
 #if defined(DEV_SC)
 			vty_selected = VTY_SC;
 #elif defined(DEV_VT)
@@ -691,3 +696,16 @@ vty_enabled(unsigned vty)
 	return ((vty_selected & vty) != 0);
 }
 
+void
+vty_set_preferred(unsigned vty)
+{
+
+	vty_prefer = vty;
+#if !defined(DEV_SC)
+	vty_prefer &= ~DEV_SC;
+#endif
+#if !defined(DEV_VT)
+	vty_prefer &= ~DEV_VT;
+#endif
+}
+

Modified: head/sys/sys/cons.h
==============================================================================
--- head/sys/sys/cons.h	Wed Jul  2 13:09:26 2014	(r268157)
+++ head/sys/sys/cons.h	Wed Jul  2 13:24:21 2014	(r268158)
@@ -137,6 +137,7 @@ void	constty_clear(void);
 #define	VTY_SC 0x01
 #define	VTY_VT 0x02
 int	vty_enabled(unsigned int);
+void	vty_set_preferred(unsigned int);
 
 #endif /* _KERNEL */
 

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 14:34:02 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5B581ABB;
 Wed,  2 Jul 2014 14:34:02 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 488672C1D;
 Wed,  2 Jul 2014 14:34:02 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62EY2cl098977;
 Wed, 2 Jul 2014 14:34:02 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62EY2pX098976;
 Wed, 2 Jul 2014 14:34:02 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201407021434.s62EY2pX098976@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Wed, 2 Jul 2014 14:34:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268159 - head/usr.bin/mkimg
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 14:34:02 -0000

Author: marcel
Date: Wed Jul  2 14:34:01 2014
New Revision: 268159
URL: http://svnweb.freebsd.org/changeset/base/268159

Log:
  Add a ful stop after FreeBSD's version in the history section.
  
  Pointed out by: brueffer@ (thanks!)

Modified:
  head/usr.bin/mkimg/mkimg.1

Modified: head/usr.bin/mkimg/mkimg.1
==============================================================================
--- head/usr.bin/mkimg/mkimg.1	Wed Jul  2 13:24:21 2014	(r268158)
+++ head/usr.bin/mkimg/mkimg.1	Wed Jul  2 14:34:01 2014	(r268159)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 1, 2014
+.Dd July 2, 2014
 .Dt MKIMG 1
 .Os
 .Sh NAME
@@ -174,7 +174,7 @@ In the following example the file system
 The
 .Nm
 utility first appeared in
-.Fx 10.1
+.Fx 10.1 .
 .Sh AUTHORS
 The
 .Nm

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 14:47:49 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3CE0147A;
 Wed,  2 Jul 2014 14:47:49 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 28C452D50;
 Wed,  2 Jul 2014 14:47:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62ElnBU004569;
 Wed, 2 Jul 2014 14:47:49 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62ElnAg004568;
 Wed, 2 Jul 2014 14:47:49 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201407021447.s62ElnAg004568@svn.freebsd.org>
From: Ed Maste 
Date: Wed, 2 Jul 2014 14:47:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268160 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 14:47:49 -0000

Author: emaste
Date: Wed Jul  2 14:47:48 2014
New Revision: 268160
URL: http://svnweb.freebsd.org/changeset/base/268160

Log:
  Fix typos in VTY constant names from r268158

Modified:
  head/sys/kern/kern_cons.c

Modified: head/sys/kern/kern_cons.c
==============================================================================
--- head/sys/kern/kern_cons.c	Wed Jul  2 14:34:01 2014	(r268159)
+++ head/sys/kern/kern_cons.c	Wed Jul  2 14:47:48 2014	(r268160)
@@ -702,10 +702,10 @@ vty_set_preferred(unsigned vty)
 
 	vty_prefer = vty;
 #if !defined(DEV_SC)
-	vty_prefer &= ~DEV_SC;
+	vty_prefer &= ~VTY_SC;
 #endif
 #if !defined(DEV_VT)
-	vty_prefer &= ~DEV_VT;
+	vty_prefer &= ~VTY_VT;
 #endif
 }
 

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 15:23:14 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id BF8CF623;
 Wed,  2 Jul 2014 15:23:14 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id ABF2D217E;
 Wed,  2 Jul 2014 15:23:14 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62FNEKP023105;
 Wed, 2 Jul 2014 15:23:14 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62FNEXp023103;
 Wed, 2 Jul 2014 15:23:14 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201407021523.s62FNEXp023103@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Wed, 2 Jul 2014 15:23:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268162 - head/release/amd64
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 15:23:14 -0000

Author: nwhitehorn
Date: Wed Jul  2 15:23:13 2014
New Revision: 268162
URL: http://svnweb.freebsd.org/changeset/base/268162

Log:
  Now that GENERIC can boot on UEFI systems (r268158), switch the build to use
  UEFI-compatible images. These will boot as before on BIOS systems, but will
  boot using the UEFI loader on UEFI-aware systems.

Replaced:
  head/release/amd64/make-memstick.sh
     - copied unchanged from r268161, head/release/amd64/make-uefi-memstick.sh
  head/release/amd64/mkisoimages.sh
     - copied unchanged from r268161, head/release/amd64/mkisoimages-uefi.sh
Deleted:
  head/release/amd64/make-uefi-memstick.sh
  head/release/amd64/mkisoimages-uefi.sh

Copied: head/release/amd64/make-memstick.sh (from r268161, head/release/amd64/make-uefi-memstick.sh)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/release/amd64/make-memstick.sh	Wed Jul  2 15:23:13 2014	(r268162, copy of r268161, head/release/amd64/make-uefi-memstick.sh)
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# This script generates a "memstick image" (image that can be copied to a
+# USB memory stick) from a directory tree.  Note that the script does not
+# clean up after itself very well for error conditions on purpose so the
+# problem can be diagnosed (full filesystem most likely but ...).
+#
+# Usage: make-memstick.sh  
+#
+# $FreeBSD$
+#
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+export PATH
+
+if [ $# -ne 2 ]; then
+	echo "make-memstick.sh /path/to/directory /path/to/image/file"
+	exit 1
+fi
+
+if [ ! -d ${1} ]; then
+	echo "${1} must be a directory"
+	exit 1
+fi
+
+if [ -e ${2} ]; then
+	echo "won't overwrite ${2}"
+	exit 1
+fi
+
+echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab
+makefs -B little -o label=FreeBSD_Install ${2}.part ${1}
+if [ $? -ne 0 ]; then
+	echo "makefs failed"
+	exit 1
+fi
+rm ${1}/etc/fstab
+
+mkimg -s gpt -b ${1}/boot/pmbr -p efi:=${1}/boot/boot1.efifat -p freebsd-boot:=${1}/boot/gptboot -p freebsd-ufs:=${2}.part -p freebsd-swap::1M -o ${2}
+rm ${2}.part
+

Copied: head/release/amd64/mkisoimages.sh (from r268161, head/release/amd64/mkisoimages-uefi.sh)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/release/amd64/mkisoimages.sh	Wed Jul  2 15:23:13 2014	(r268162, copy of r268161, head/release/amd64/mkisoimages-uefi.sh)
@@ -0,0 +1,60 @@
+#!/bin/sh
+#
+# Module: mkisoimages.sh
+# Author: Jordan K Hubbard
+# Date:   22 June 2001
+#
+# $FreeBSD$
+#
+# This script is used by release/Makefile to build the (optional) ISO images
+# for a FreeBSD release.  It is considered architecture dependent since each
+# platform has a slightly unique way of making bootable CDs.  This script
+# is also allowed to generate any number of images since that is more of
+# publishing decision than anything else.
+#
+# Usage:
+#
+# mkisoimages.sh [-b] image-label image-name base-bits-dir [extra-bits-dir]
+#
+# Where -b is passed if the ISO image should be made "bootable" by
+# whatever standards this architecture supports (may be unsupported),
+# image-label is the ISO image label, image-name is the filename of the
+# resulting ISO image, base-bits-dir contains the image contents and
+# extra-bits-dir, if provided, contains additional files to be merged
+# into base-bits-dir as part of making the image.
+
+if [ "x$1" = "x-b" ]; then
+	# This is highly x86-centric and will be used directly below.
+	bootable="-o bootimage=i386;$4/boot/cdboot -o no-emul-boot"
+
+	# Make EFI system partition (should be done with makefs in the future)
+	dd if=/dev/zero of=efiboot.img bs=4k count=100
+	device=`mdconfig -a -t vnode -f efiboot.img`
+	newfs_msdos -F 12 -m 0xf8 /dev/$device
+	mkdir efi
+	mount -t msdosfs /dev/$device efi
+	mkdir -p efi/efi/boot
+	cp ${4}/boot/loader.efi efi/efi/boot/bootx64.efi
+	umount efi
+	rmdir efi
+	mdconfig -d -u $device
+	bootable="-o bootimage=i386;efiboot.img -o no-emul-boot $bootable"
+	
+	shift
+else
+	bootable=""
+fi
+
+if [ $# -lt 3 ]; then
+	echo Usage: $0 '[-b] image-label image-name base-bits-dir [extra-bits-dir]'
+	exit 1
+fi
+
+LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift
+NAME=$1; shift
+
+publisher="The FreeBSD Project.  http://www.FreeBSD.org/"
+echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab
+makefs -t cd9660 $bootable -o rockridge -o label=$LABEL -o publisher="$publisher" $NAME $*
+rm $1/etc/fstab
+rm -f efiboot.img

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 16:17:49 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 70C3A617;
 Wed,  2 Jul 2014 16:17:49 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5DF45268D;
 Wed,  2 Jul 2014 16:17:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62GHnNQ048196;
 Wed, 2 Jul 2014 16:17:49 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62GHnDc048195;
 Wed, 2 Jul 2014 16:17:49 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201407021617.s62GHnDc048195@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Wed, 2 Jul 2014 16:17:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268165 - head/sys/dev/bge
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 16:17:49 -0000

Author: marcel
Date: Wed Jul  2 16:17:48 2014
New Revision: 268165
URL: http://svnweb.freebsd.org/changeset/base/268165

Log:
  Fix off-by-one introduced by the conversion to the driver API.
  
  Submitted by:   Sreekanth Rupavatharam 
  Obtained from:  Juniper Networks, Inc.

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c	Wed Jul  2 16:11:59 2014	(r268164)
+++ head/sys/dev/bge/if_bge.c	Wed Jul  2 16:17:48 2014	(r268165)
@@ -3738,7 +3738,7 @@ bge_attach(device_t dev)
 	if_setioctlfn(ifp, bge_ioctl);
 	if_setstartfn(ifp, bge_start);
 	if_setinitfn(ifp, bge_init);
-	if_setsendqlen(ifp, BGE_TX_RING_CNT);
+	if_setsendqlen(ifp, BGE_TX_RING_CNT - 1);
 	if_setsendqready(ifp);
 	if_sethwassist(ifp, sc->bge_csum_features);
 	if_setcapabilities(ifp, IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING |

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 19:22:13 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 29E5E29B;
 Wed,  2 Jul 2014 19:22:13 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 178F12864;
 Wed,  2 Jul 2014 19:22:13 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62JMCfI041085;
 Wed, 2 Jul 2014 19:22:12 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62JMCtC041084;
 Wed, 2 Jul 2014 19:22:12 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201407021922.s62JMCtC041084@svn.freebsd.org>
From: Ed Maste 
Date: Wed, 2 Jul 2014 19:22:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268169 - head/share/man/man4
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 19:22:13 -0000

Author: emaste
Date: Wed Jul  2 19:22:12 2014
New Revision: 268169
URL: http://svnweb.freebsd.org/changeset/base/268169

Log:
  Clarify the setting of syscons driver flags
  
  Submitted by:	wblock

Modified:
  head/share/man/man4/syscons.4

Modified: head/share/man/man4/syscons.4
==============================================================================
--- head/share/man/man4/syscons.4	Wed Jul  2 19:18:59 2014	(r268168)
+++ head/share/man/man4/syscons.4	Wed Jul  2 19:22:12 2014	(r268169)
@@ -403,7 +403,9 @@ option too.
 The following driver flags can be used to control the
 .Nm
 driver.
-They can be set either in
+Driver flags can be set with the
+.Cd hint.sc.0.flags
+tunable, either in
 .Pa /boot/device.hints ,
 or else at the loader prompt (see
 .Xr loader 8 ) .

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 19:31:50 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0C79A9EF;
 Wed,  2 Jul 2014 19:31:50 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EDC8A2941;
 Wed,  2 Jul 2014 19:31:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62JVnaX045911;
 Wed, 2 Jul 2014 19:31:49 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62JVnM5045910;
 Wed, 2 Jul 2014 19:31:49 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201407021931.s62JVnM5045910@svn.freebsd.org>
From: Ed Maste 
Date: Wed, 2 Jul 2014 19:31:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268172 - head/usr.bin/vtfontcvt
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 19:31:50 -0000

Author: emaste
Date: Wed Jul  2 19:31:49 2014
New Revision: 268172
URL: http://svnweb.freebsd.org/changeset/base/268172

Log:
  vtfontcvt: correct width calculation (.hex files and commandline)
  
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/usr.bin/vtfontcvt/vtfontcvt.c

Modified: head/usr.bin/vtfontcvt/vtfontcvt.c
==============================================================================
--- head/usr.bin/vtfontcvt/vtfontcvt.c	Wed Jul  2 19:25:49 2014	(r268171)
+++ head/usr.bin/vtfontcvt/vtfontcvt.c	Wed Jul  2 19:31:49 2014	(r268172)
@@ -285,6 +285,16 @@ parse_bdf(FILE *fp, unsigned int map_idx
 	return (0);
 }
 
+static void
+set_width(int w)
+{
+
+	if (w <= 0 || w > 128)
+		errx(1, "invalid width %d", w);
+	width = w;
+	wbytes = howmany(width, 8);
+}
+
 static int
 parse_hex(FILE *fp, unsigned int map_idx)
 {
@@ -300,12 +310,12 @@ parse_hex(FILE *fp, unsigned int map_idx
 		if (strncmp(ln, "# Height: ", 10) == 0) {
 			height = atoi(ln + 10);
 		} else if (strncmp(ln, "# Width: ", 9) == 0) {
-			width = atoi(ln + 9);
+			set_width(atoi(ln + 9));
 		} else if (sscanf(ln, "%4x:", &curchar)) {
 			p = ln + 5;
 			chars_per_row = strlen(p) / height;
 			dwidth = width;
-			if (chars_per_row / 2 > width / 8)
+			if (chars_per_row / 2 > (width + 7) / 8)
 				dwidth *= 2; /* Double-width character. */
 			snprintf(fmt_str, sizeof(fmt_str), "%%%ux",
 			    chars_per_row);
@@ -528,12 +538,7 @@ main(int argc, char *argv[])
 			verbose = 1;
 			break;
 		case 'w':
-			val = atoi(optarg);
-			if (val <= 0 || val > 128) {
-				errx(1, "Invalid width %d", val);
-				return (1);
-			}
-			width = val;
+			set_width(atoi(optarg));
 			break;
 		case '?':
 		default:

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 19:46:42 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id DAD45F4D;
 Wed,  2 Jul 2014 19:46:42 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C83192A61;
 Wed,  2 Jul 2014 19:46:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62JkgVq051427;
 Wed, 2 Jul 2014 19:46:42 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62JkgHo051426;
 Wed, 2 Jul 2014 19:46:42 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201407021946.s62JkgHo051426@svn.freebsd.org>
From: Marius Strobl 
Date: Wed, 2 Jul 2014 19:46:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268173 - head/sys/conf
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 19:46:42 -0000

Author: marius
Date: Wed Jul  2 19:46:42 2014
New Revision: 268173
URL: http://svnweb.freebsd.org/changeset/base/268173

Log:
  Remove ofwfb(4) in order to fix the LINT build breakage caused by r268069.
  Both vt(4) and ofwfb(4) need a lot of love to be usable on sparc64 and even
  then the performance of ofwfb(4) would suck compared to hardware accelerated
  drivers like creator(4) and machfb(4).

Modified:
  head/sys/conf/files.sparc64

Modified: head/sys/conf/files.sparc64
==============================================================================
--- head/sys/conf/files.sparc64	Wed Jul  2 19:31:49 2014	(r268172)
+++ head/sys/conf/files.sparc64	Wed Jul  2 19:46:42 2014	(r268173)
@@ -60,7 +60,6 @@ dev/syscons/scterm-teken.c	optional	sc
 dev/syscons/scvtb.c		optional	sc
 dev/uart/uart_cpu_sparc64.c	optional	uart
 dev/uart/uart_kbd_sun.c		optional	uart sc | vt
-dev/vt/hw/ofwfb/ofwfb.c		optional	vt
 kern/kern_clocksource.c		standard
 kern/subr_dummy_vdso_tc.c	standard
 kern/syscalls.c			optional	ktr

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 20:04:56 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id BD98C9B7;
 Wed,  2 Jul 2014 20:04:56 +0000 (UTC)
Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A41E32C21;
 Wed,  2 Jul 2014 20:04:56 +0000 (UTC)
Received: from aurora.physics.berkeley.edu (aurora.Physics.Berkeley.EDU
 [128.32.117.67]) (authenticated bits=0)
 by c.mail.sonic.net (8.14.9/8.14.9) with ESMTP id s62K4mff013251
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);
 Wed, 2 Jul 2014 13:04:49 -0700
Message-ID: <53B465E0.1040309@freebsd.org>
Date: Wed, 02 Jul 2014 13:04:48 -0700
From: Nathan Whitehorn 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Marius Strobl , src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject: Re: svn commit: r268173 - head/sys/conf
References: <201407021946.s62JkgHo051426@svn.freebsd.org>
In-Reply-To: <201407021946.s62JkgHo051426@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Sonic-ID: C;8o/BHiQC5BG47MjHUc16mQ== M;pLgEHyQC5BG47MjHUc16mQ==
X-Spam-Flag: No
X-Sonic-Spam-Details: 0.0/5.0 by cerberusd
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 20:04:56 -0000

It worked at least on my Ultra 5 -- though probably because the ATI 
Mach64 FCode ROM there is substantially shared with the Mac version. It 
was even reasonably fast. But regardless of whether it's a generally 
useful console driver on SPARC, at least it proves that vt(4) works fine.
-Nathan

On 07/02/14 12:46, Marius Strobl wrote:
> Author: marius
> Date: Wed Jul  2 19:46:42 2014
> New Revision: 268173
> URL: http://svnweb.freebsd.org/changeset/base/268173
>
> Log:
>    Remove ofwfb(4) in order to fix the LINT build breakage caused by r268069.
>    Both vt(4) and ofwfb(4) need a lot of love to be usable on sparc64 and even
>    then the performance of ofwfb(4) would suck compared to hardware accelerated
>    drivers like creator(4) and machfb(4).
>
> Modified:
>    head/sys/conf/files.sparc64
>
> Modified: head/sys/conf/files.sparc64
> ==============================================================================
> --- head/sys/conf/files.sparc64	Wed Jul  2 19:31:49 2014	(r268172)
> +++ head/sys/conf/files.sparc64	Wed Jul  2 19:46:42 2014	(r268173)
> @@ -60,7 +60,6 @@ dev/syscons/scterm-teken.c	optional	sc
>   dev/syscons/scvtb.c		optional	sc
>   dev/uart/uart_cpu_sparc64.c	optional	uart
>   dev/uart/uart_kbd_sun.c		optional	uart sc | vt
> -dev/vt/hw/ofwfb/ofwfb.c		optional	vt
>   kern/kern_clocksource.c		standard
>   kern/subr_dummy_vdso_tc.c	standard
>   kern/syscalls.c			optional	ktr
>


From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 20:28:22 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D58DC364;
 Wed,  2 Jul 2014 20:28:22 +0000 (UTC)
Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 6D3EA2DF3;
 Wed,  2 Jul 2014 20:28:22 +0000 (UTC)
Received: from alchemy.franken.de (localhost [127.0.0.1])
 by alchemy.franken.de (8.14.8/8.14.8/ALCHEMY.FRANKEN.DE) with ESMTP id
 s62KSDWu092334
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Wed, 2 Jul 2014 22:28:13 +0200 (CEST)
 (envelope-from marius@alchemy.franken.de)
Received: (from marius@localhost)
 by alchemy.franken.de (8.14.8/8.14.8/Submit) id s62KSDL0092333;
 Wed, 2 Jul 2014 22:28:13 +0200 (CEST) (envelope-from marius)
Date: Wed, 2 Jul 2014 22:28:13 +0200
From: Marius Strobl 
To: Nathan Whitehorn 
Subject: Re: svn commit: r268173 - head/sys/conf
Message-ID: <20140702202813.GB69016@alchemy.franken.de>
References: <201407021946.s62JkgHo051426@svn.freebsd.org>
 <53B465E0.1040309@freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <53B465E0.1040309@freebsd.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3
 (alchemy.franken.de [0.0.0.0]); Wed, 02 Jul 2014 22:28:13 +0200 (CEST)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 20:28:22 -0000

On Wed, Jul 02, 2014 at 01:04:48PM -0700, Nathan Whitehorn wrote:
> It worked at least on my Ultra 5 -- though probably because the ATI 
> Mach64 FCode ROM there is substantially shared with the Mac version. It 
> was even reasonably fast. But regardless of whether it's a generally 
> useful console driver on SPARC, at least it proves that vt(4) works fine.

As for vt(4), it at least needs to be taught about the differences
between virtual, physical and bus address with a clue bat. Among
other problems, similar things hold for the #ifdef'ed sparc64 code
of ofwfb(4) in combination with the accesses it does. I guess it
only had a chance of working on your machine because its firmware
is kind enough to map the framebuffer in (which not all machine
models do) in the first place _and_ in a special way/location so
accesses didn't blow. Anyway, even when going the ofwfb(4) route,
doing reads and writes via bus_space(9) will be noticeably faster
than going through the MMU on sparc64.

Marius


From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 20:30:59 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A4244500;
 Wed,  2 Jul 2014 20:30:59 +0000 (UTC)
Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5C6B82E7B;
 Wed,  2 Jul 2014 20:30:58 +0000 (UTC)
Received: from aurora.physics.berkeley.edu (aurora.Physics.Berkeley.EDU
 [128.32.117.67]) (authenticated bits=0)
 by c.mail.sonic.net (8.14.9/8.14.9) with ESMTP id s62KUkvL003367
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);
 Wed, 2 Jul 2014 13:30:47 -0700
Message-ID: <53B46BF6.6040205@freebsd.org>
Date: Wed, 02 Jul 2014 13:30:46 -0700
From: Nathan Whitehorn 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Marius Strobl 
Subject: Re: svn commit: r268173 - head/sys/conf
References: <201407021946.s62JkgHo051426@svn.freebsd.org>
 <53B465E0.1040309@freebsd.org> <20140702202813.GB69016@alchemy.franken.de>
In-Reply-To: <20140702202813.GB69016@alchemy.franken.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Sonic-ID: C;VsyQvycC5BGT28jHUc16mQ== M;KJOxvycC5BGT28jHUc16mQ==
X-Spam-Flag: No
X-Sonic-Spam-Details: 0.0/5.0 by cerberusd
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 20:30:59 -0000


On 07/02/14 13:28, Marius Strobl wrote:
> On Wed, Jul 02, 2014 at 01:04:48PM -0700, Nathan Whitehorn wrote:
>> It worked at least on my Ultra 5 -- though probably because the ATI
>> Mach64 FCode ROM there is substantially shared with the Mac version. It
>> was even reasonably fast. But regardless of whether it's a generally
>> useful console driver on SPARC, at least it proves that vt(4) works fine.
> As for vt(4), it at least needs to be taught about the differences
> between virtual, physical and bus address with a clue bat. Among
> other problems, similar things hold for the #ifdef'ed sparc64 code
> of ofwfb(4) in combination with the accesses it does. I guess it
> only had a chance of working on your machine because its firmware
> is kind enough to map the framebuffer in (which not all machine
> models do) in the first place _and_ in a special way/location so
> accesses didn't blow. Anyway, even when going the ofwfb(4) route,
> doing reads and writes via bus_space(9) will be noticeably faster
> than going through the MMU on sparc64.

Yeah, the firmware there is pretty kind. I just wanted to make sure we 
were on the same page. The vt core does not require any changes, I 
think: it's just that you need new drivers for mach64 and, especially, 
creator.
-Nathan

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 20:41:00 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1A3D5B34;
 Wed,  2 Jul 2014 20:41:00 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 072CE2F21;
 Wed,  2 Jul 2014 20:41:00 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62KexTc077421;
 Wed, 2 Jul 2014 20:40:59 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62Kex4c077419;
 Wed, 2 Jul 2014 20:40:59 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201407022040.s62Kex4c077419@svn.freebsd.org>
From: Ed Maste 
Date: Wed, 2 Jul 2014 20:40:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268175 - in head/usr.sbin: kbdcontrol vidcontrol
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 20:41:00 -0000

Author: emaste
Date: Wed Jul  2 20:40:59 2014
New Revision: 268175
URL: http://svnweb.freebsd.org/changeset/base/268175

Log:
  Fix vt(4) detection in kbdcontrol and vidcontrol
  
  As sc(4) and vt(4) coexist and are both enabled in GENERIC, the existence
  of a vt(4) sysctl is not sufficient to determine that vt(4) is in use.
  
  Reported by:	Trond Endrestøl

Modified:
  head/usr.sbin/kbdcontrol/kbdcontrol.c
  head/usr.sbin/vidcontrol/vidcontrol.c

Modified: head/usr.sbin/kbdcontrol/kbdcontrol.c
==============================================================================
--- head/usr.sbin/kbdcontrol/kbdcontrol.c	Wed Jul  2 19:53:51 2014	(r268174)
+++ head/usr.sbin/kbdcontrol/kbdcontrol.c	Wed Jul  2 20:40:59 2014	(r268175)
@@ -146,11 +146,12 @@ static void	usage(void) __dead2;
 static int
 is_vt4(void)
 {
+	char vty_name[4] = "";
+	size_t len = sizeof(vty_name);
 
-	if (sysctlbyname("kern.vt.deadtimer", NULL, NULL, NULL, 0) == 0)
-		return (1);
-
-	return (0);
+	if (sysctlbyname("kern.vty", vty_name, &len, NULL, 0) != 0)
+		return (0);
+	return (strcmp(vty_name, "vt") == 0);
 }
 
 static char *

Modified: head/usr.sbin/vidcontrol/vidcontrol.c
==============================================================================
--- head/usr.sbin/vidcontrol/vidcontrol.c	Wed Jul  2 19:53:51 2014	(r268174)
+++ head/usr.sbin/vidcontrol/vidcontrol.c	Wed Jul  2 20:40:59 2014	(r268175)
@@ -216,11 +216,12 @@ usage(void)
 static int
 is_vt4(void)
 {
+	char vty_name[4] = "";
+	size_t len = sizeof(vty_name);
 
-	if (sysctlbyname("kern.vt.deadtimer", NULL, NULL, NULL, 0) == 0)
-		return (1);
-
-	return (0);
+	if (sysctlbyname("kern.vty", vty_name, &len, NULL, 0) != 0)
+		return (0);
+	return (strcmp(vty_name, "vt") == 0);
 }
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 21:08:26 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8E35A576;
 Wed,  2 Jul 2014 21:08:26 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7BC6521F5;
 Wed,  2 Jul 2014 21:08:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62L8Qhg091248;
 Wed, 2 Jul 2014 21:08:26 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62L8QmG091246;
 Wed, 2 Jul 2014 21:08:26 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201407022108.s62L8QmG091246@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Wed, 2 Jul 2014 21:08:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268176 - in head/sys/dev: bge nfe
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 21:08:26 -0000

Author: pluknet
Date: Wed Jul  2 21:08:25 2014
New Revision: 268176
URL: http://svnweb.freebsd.org/changeset/base/268176

Log:
  Fixed build with DEVICE_POLLING.

Modified:
  head/sys/dev/bge/if_bge.c
  head/sys/dev/nfe/if_nfe.c

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c	Wed Jul  2 20:40:59 2014	(r268175)
+++ head/sys/dev/bge/if_bge.c	Wed Jul  2 21:08:25 2014	(r268176)
@@ -4796,7 +4796,7 @@ bge_tick(void *xsc)
 		 */
 #ifdef DEVICE_POLLING
 		/* In polling mode we poll link state in bge_poll(). */
-		if (!(sc->bge_if_getcapenable(ifp) & IFCAP_POLLING))
+		if (!(if_getcapenable(sc->bge_ifp) & IFCAP_POLLING))
 #endif
 		{
 		sc->bge_link_evt++;
@@ -5830,7 +5830,7 @@ bge_ioctl(if_t ifp, u_long command, cadd
 #ifdef DEVICE_POLLING
 		if (mask & IFCAP_POLLING) {
 			if (ifr->ifr_reqcap & IFCAP_POLLING) {
-				error = ether_poll_register(bge_poll, ifp);
+				error = ether_poll_register_drv(bge_poll, ifp);
 				if (error)
 					return (error);
 				BGE_LOCK(sc);

Modified: head/sys/dev/nfe/if_nfe.c
==============================================================================
--- head/sys/dev/nfe/if_nfe.c	Wed Jul  2 20:40:59 2014	(r268175)
+++ head/sys/dev/nfe/if_nfe.c	Wed Jul  2 21:08:25 2014	(r268176)
@@ -1630,7 +1630,7 @@ nfe_free_tx_ring(struct nfe_softc *sc, s
 }
 
 #ifdef DEVICE_POLLING
-static poll_handler_t nfe_poll;
+static poll_handler_drv_t nfe_poll;
 
 
 static int
@@ -1782,7 +1782,7 @@ nfe_ioctl(if_t ifp, u_long cmd, caddr_t 
 #ifdef DEVICE_POLLING
 		if ((mask & IFCAP_POLLING) != 0) {
 			if ((ifr->ifr_reqcap & IFCAP_POLLING) != 0) {
-				error = ether_poll_register(nfe_poll, ifp);
+				error = ether_poll_register_drv(nfe_poll, ifp);
 				if (error)
 					break;
 				NFE_LOCK(sc);

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 21:25:32 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B0120E22;
 Wed,  2 Jul 2014 21:25:32 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9BFA823B0;
 Wed,  2 Jul 2014 21:25:32 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62LPWp8000667;
 Wed, 2 Jul 2014 21:25:32 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62LPWlK000666;
 Wed, 2 Jul 2014 21:25:32 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407022125.s62LPWlK000666@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 2 Jul 2014 21:25:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268178 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 21:25:32 -0000

Author: mav
Date: Wed Jul  2 21:25:32 2014
New Revision: 268178
URL: http://svnweb.freebsd.org/changeset/base/268178

Log:
  Fix bug in sync control in new "dev" mode of ZVOL (r265678).
  
  Don't check ZVOL_WCE flag, used in Solaris to control device "write cache".
  It is not applicable on FreeBSD and by default set to "disable".
  
  MFC after:	3 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c	Wed Jul  2 21:24:54 2014	(r268177)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c	Wed Jul  2 21:25:32 2014	(r268178)
@@ -1629,7 +1629,11 @@ zvol_write(struct cdev *dev, struct uio 
 	}
 #endif
 
+#ifdef sun
 	sync = !(zv->zv_flags & ZVOL_WCE) ||
+#else
+	sync =
+#endif
 	    (zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS);
 
 	rl = zfs_range_lock(&zv->zv_znode, uio->uio_loffset, uio->uio_resid,

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 22:04:13 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2DA5B515;
 Wed,  2 Jul 2014 22:04:13 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 00EB92715;
 Wed,  2 Jul 2014 22:04:13 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62M4CKQ020555;
 Wed, 2 Jul 2014 22:04:12 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62M4CEu020553;
 Wed, 2 Jul 2014 22:04:12 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201407022204.s62M4CEu020553@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Wed, 2 Jul 2014 22:04:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268182 - in head/libexec/rtld-elf: . ia64
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 22:04:13 -0000

Author: marcel
Date: Wed Jul  2 22:04:12 2014
New Revision: 268182
URL: http://svnweb.freebsd.org/changeset/base/268182

Log:
  Fix r264346 for ia64. We need to allocate memory for the function
  descriptors in order to relocate RTLD itself. To allocate memory,
  we need the pagesizes array initialized, but that happens after
  RTLD is relocated. This ordering is important for amd64, but it's
  opposite of what ia64 needs. Handle this conflict with the define
  called RTLD_INIT_PAGESIZES_EARLY. When defined, obtain the page
  sizes before relocating rtld, otherwise do it after.

Modified:
  head/libexec/rtld-elf/ia64/rtld_machdep.h
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/ia64/rtld_machdep.h
==============================================================================
--- head/libexec/rtld-elf/ia64/rtld_machdep.h	Wed Jul  2 21:53:34 2014	(r268181)
+++ head/libexec/rtld-elf/ia64/rtld_machdep.h	Wed Jul  2 22:04:12 2014	(r268182)
@@ -69,4 +69,6 @@ extern void *__tls_get_addr(unsigned lon
 #define	RTLD_DEFAULT_STACK_PF_EXEC	0
 #define	RTLD_DEFAULT_STACK_EXEC		0
 
+#define	RTLD_INIT_PAGESIZES_EARLY	1
+
 #endif

Modified: head/libexec/rtld-elf/rtld.c
==============================================================================
--- head/libexec/rtld-elf/rtld.c	Wed Jul  2 21:53:34 2014	(r268181)
+++ head/libexec/rtld-elf/rtld.c	Wed Jul  2 22:04:12 2014	(r268182)
@@ -1802,6 +1802,11 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo *
     const Elf_Dyn *dyn_soname;
     const Elf_Dyn *dyn_runpath;
 
+#ifdef RTLD_INIT_PAGESIZES_EARLY
+    /* The page size is required by the dynamic memory allocator. */
+    init_pagesizes(aux_info);
+#endif
+
     /*
      * Conjure up an Obj_Entry structure for the dynamic linker.
      *
@@ -1838,8 +1843,10 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo *
     /* Now that non-local variables can be accesses, copy out obj_rtld. */
     memcpy(&obj_rtld, &objtmp, sizeof(obj_rtld));
 
+#ifndef RTLD_INIT_PAGESIZES_EARLY
     /* The page size is required by the dynamic memory allocator. */
     init_pagesizes(aux_info);
+#endif
 
     if (aux_info[AT_OSRELDATE] != NULL)
 	    osreldate = aux_info[AT_OSRELDATE]->a_un.a_val;

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 22:04:16 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 17AEE5EB;
 Wed,  2 Jul 2014 22:04:14 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id AC5782717;
 Wed,  2 Jul 2014 22:04:14 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62M4EN6020678;
 Wed, 2 Jul 2014 22:04:14 GMT (envelope-from hiren@svn.freebsd.org)
Received: (from hiren@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62M4E0t020676;
 Wed, 2 Jul 2014 22:04:14 GMT (envelope-from hiren@svn.freebsd.org)
Message-Id: <201407022204.s62M4E0t020676@svn.freebsd.org>
From: Hiren Panchasara 
Date: Wed, 2 Jul 2014 22:04:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268183 - head/sys/netinet
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 22:04:16 -0000

Author: hiren
Date: Wed Jul  2 22:04:14 2014
New Revision: 268183
URL: http://svnweb.freebsd.org/changeset/base/268183

Log:
  

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c	Wed Jul  2 22:04:12 2014	(r268182)
+++ head/sys/netinet/tcp_input.c	Wed Jul  2 22:04:14 2014	(r268183)
@@ -3472,8 +3472,8 @@ tcp_mss_update(struct tcpcb *tp, int off
 		bcopy(&metrics, metricptr, sizeof(struct hc_metrics_lite));
 
 	/*
-	 * If there's a discovered mtu int tcp hostcache, use it
-	 * else, use the link mtu.
+	 * If there's a discovered mtu in tcp hostcache, use it.
+	 * Else, use the link mtu.
 	 */
 	if (metrics.rmx_mtu)
 		mss = min(metrics.rmx_mtu, maxmtu) - min_protoh;

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 22:05:22 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C80C7B11;
 Wed,  2 Jul 2014 22:05:22 +0000 (UTC)
Received: from mail-qg0-x230.google.com (mail-qg0-x230.google.com
 [IPv6:2607:f8b0:400d:c04::230])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 4AC982736;
 Wed,  2 Jul 2014 22:05:22 +0000 (UTC)
Received: by mail-qg0-f48.google.com with SMTP id q108so5275305qgd.21
 for ; Wed, 02 Jul 2014 15:05:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date:message-id:subject
 :from:to:content-type;
 bh=KZcIF7KPTmb6c4F9V3RRuTcMFU5GgMYscqTpfAtul8E=;
 b=PJsYuyqM7lFW8keUWUvUVT6SqLDmo686MHDmJMglvUi1oZ2bRy6avyF7ox05gSOO9M
 fxDuEEBvIJiZmllWHICjPh04PfRviuIwVNGmqw7tTeM8BHpQLYNRoHPD1fD3+43zuLyd
 I75qy8OP4+Tqx6JKtdmWFwTK4MKxojeKeRvq2gzeuIA13VhszPNnZGNqO8dhEK9z0BaE
 VGF1SggLTc/CH1QN9IuOyM5LkKTY/b31yhEqfigdjeULNjXMdTWJo4PH03tt6SuStYpW
 d1nDxiqL7gES/c1DdZsW43vPDPYyzio1BaQBi9bmEg2/vgVtWmbICINRx3Du6JN3dd1F
 15xQ==
MIME-Version: 1.0
X-Received: by 10.140.34.195 with SMTP id l61mr906741qgl.87.1404338720915;
 Wed, 02 Jul 2014 15:05:20 -0700 (PDT)
Sender: hiren.panchasara@gmail.com
Received: by 10.96.73.39 with HTTP; Wed, 2 Jul 2014 15:05:20 -0700 (PDT)
In-Reply-To: <201407022204.s62M4E0t020676@svn.freebsd.org>
References: <201407022204.s62M4E0t020676@svn.freebsd.org>
Date: Wed, 2 Jul 2014 15:05:20 -0700
X-Google-Sender-Auth: XAdb9hBtn3xqYs6IGgHKnFUW00Y
Message-ID: 
Subject: Re: svn commit: r268183 - head/sys/netinet
From: hiren panchasara 
To: src-committers ,
 svn-src-all , 
 svn-src-head 
Content-Type: text/plain; charset=UTF-8
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 22:05:22 -0000

On Wed, Jul 2, 2014 at 3:04 PM, Hiren Panchasara  wrote:
> Author: hiren
> Date: Wed Jul  2 22:04:14 2014
> New Revision: 268183
> URL: http://svnweb.freebsd.org/changeset/base/268183
>
> Log:

Ugh. sorry.

Commit log was supposed to be: Fix a typo and improve readability.
>
>
> Modified:
>   head/sys/netinet/tcp_input.c
>
> Modified: head/sys/netinet/tcp_input.c
> ==============================================================================
> --- head/sys/netinet/tcp_input.c        Wed Jul  2 22:04:12 2014        (r268182)
> +++ head/sys/netinet/tcp_input.c        Wed Jul  2 22:04:14 2014        (r268183)
> @@ -3472,8 +3472,8 @@ tcp_mss_update(struct tcpcb *tp, int off
>                 bcopy(&metrics, metricptr, sizeof(struct hc_metrics_lite));
>
>         /*
> -        * If there's a discovered mtu int tcp hostcache, use it
> -        * else, use the link mtu.
> +        * If there's a discovered mtu in tcp hostcache, use it.
> +        * Else, use the link mtu.
>          */
>         if (metrics.rmx_mtu)
>                 mss = min(metrics.rmx_mtu, maxmtu) - min_protoh;
>

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 22:09:07 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0DC5839D;
 Wed,  2 Jul 2014 22:09:07 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EE7AA2784;
 Wed,  2 Jul 2014 22:09:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62M96Z2022713;
 Wed, 2 Jul 2014 22:09:06 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62M96QR022712;
 Wed, 2 Jul 2014 22:09:06 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201407022209.s62M96QR022712@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Wed, 2 Jul 2014 22:09:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268185 - head/sys/ia64/ia64
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 22:09:07 -0000

Author: marcel
Date: Wed Jul  2 22:09:06 2014
New Revision: 268185
URL: http://svnweb.freebsd.org/changeset/base/268185

Log:
  Improve the KTR logs by naming the values.

Modified:
  head/sys/ia64/ia64/pmap.c

Modified: head/sys/ia64/ia64/pmap.c
==============================================================================
--- head/sys/ia64/ia64/pmap.c	Wed Jul  2 22:06:31 2014	(r268184)
+++ head/sys/ia64/ia64/pmap.c	Wed Jul  2 22:09:06 2014	(r268185)
@@ -484,7 +484,7 @@ void
 pmap_page_init(vm_page_t m)
 {
 
-	CTR2(KTR_PMAP, "%s(%p)", __func__, m);
+	CTR2(KTR_PMAP, "%s(m=%p)", __func__, m);
 
 	TAILQ_INIT(&m->md.pv_list);
 	m->md.memattr = VM_MEMATTR_DEFAULT;
@@ -623,7 +623,7 @@ void
 pmap_pinit0(pmap_t pmap)
 {
 
-	CTR2(KTR_PMAP, "%s(%p)", __func__, pmap);
+	CTR2(KTR_PMAP, "%s(pm=%p)", __func__, pmap);
 
 	PMAP_LOCK_INIT(pmap);
 	pmap_pinit_common(pmap);
@@ -637,7 +637,7 @@ int
 pmap_pinit(pmap_t pmap)
 {
 
-	CTR2(KTR_PMAP, "%s(%p)", __func__, pmap);
+	CTR2(KTR_PMAP, "%s(pm=%p)", __func__, pmap);
 
 	pmap_pinit_common(pmap);
 	return (1);
@@ -657,7 +657,7 @@ pmap_release(pmap_t pmap)
 {
 	int i;
 
-	CTR2(KTR_PMAP, "%s(%p)", __func__, pmap);
+	CTR2(KTR_PMAP, "%s(pm=%p)", __func__, pmap);
 
 	for (i = 0; i < IA64_VM_MINKERN_REGION; i++)
 		if (pmap->pm_rid[i])
@@ -674,7 +674,7 @@ pmap_growkernel(vm_offset_t addr)
 	struct ia64_lpte *leaf;
 	vm_page_t nkpg;
 
-	CTR2(KTR_PMAP, "%s(%#x)", __func__, addr);
+	CTR2(KTR_PMAP, "%s(va=%#lx)", __func__, addr);
 
 	while (kernel_vm_end <= addr) {
 		if (nkpt == PAGE_SIZE/8 + PAGE_SIZE*PAGE_SIZE/64)
@@ -1170,7 +1170,7 @@ pmap_extract(pmap_t pmap, vm_offset_t va
 	pmap_t oldpmap;
 	vm_paddr_t pa;
 
-	CTR3(KTR_PMAP, "%s(%p, %#x)", __func__, pmap, va);
+	CTR3(KTR_PMAP, "%s(pm=%p, va=%#lx)", __func__, pmap, va);
 
 	pa = 0;
 	PMAP_LOCK(pmap);
@@ -1198,7 +1198,8 @@ pmap_extract_and_hold(pmap_t pmap, vm_of
 	vm_page_t m;
 	vm_paddr_t pa;
 
-	CTR4(KTR_PMAP, "%s(%p, %#x, %#x)", __func__, pmap, va, prot);
+	CTR4(KTR_PMAP, "%s(pm=%p, va=%#lx, prot=%#x)", __func__, pmap, va,
+	    prot);
 
 	pa = 0;
 	m = NULL;
@@ -1381,7 +1382,7 @@ pmap_kextract(vm_offset_t va)
 	vm_paddr_t pa;
 	u_int idx;
 
-	CTR2(KTR_PMAP, "%s(%#x)", __func__, va);
+	CTR2(KTR_PMAP, "%s(va=%#lx)", __func__, va);
 
 	KASSERT(va >= VM_MAXUSER_ADDRESS, ("Must be kernel VA"));
 
@@ -1443,7 +1444,7 @@ pmap_qenter(vm_offset_t va, vm_page_t *m
 	struct ia64_lpte *pte;
 	int i;
 
-	CTR4(KTR_PMAP, "%s(%#x, %p, %d)", __func__, va, m, count);
+	CTR4(KTR_PMAP, "%s(va=%#lx, m_p=%p, cnt=%d)", __func__, va, m, count);
 
 	for (i = 0; i < count; i++) {
 		pte = pmap_find_kpte(va);
@@ -1468,7 +1469,7 @@ pmap_qremove(vm_offset_t va, int count)
 	struct ia64_lpte *pte;
 	int i;
 
-	CTR3(KTR_PMAP, "%s(%#x, %d)", __func__, va, count);
+	CTR3(KTR_PMAP, "%s(va=%#lx, cnt=%d)", __func__, va, count);
 
 	for (i = 0; i < count; i++) {
 		pte = pmap_find_kpte(va);
@@ -1490,7 +1491,7 @@ pmap_kenter(vm_offset_t va, vm_paddr_t p
 {
 	struct ia64_lpte *pte;
 
-	CTR3(KTR_PMAP, "%s(%#x, %#x)", __func__, va, pa);
+	CTR3(KTR_PMAP, "%s(va=%#lx, pa=%#lx)", __func__, va, pa);
 
 	pte = pmap_find_kpte(va);
 	if (pmap_present(pte))
@@ -1510,7 +1511,7 @@ pmap_kremove(vm_offset_t va)
 {
 	struct ia64_lpte *pte;
 
-	CTR2(KTR_PMAP, "%s(%#x)", __func__, va);
+	CTR2(KTR_PMAP, "%s(va=%#lx)", __func__, va);
 
 	pte = pmap_find_kpte(va);
 	if (pmap_present(pte)) {
@@ -1536,8 +1537,8 @@ vm_offset_t
 pmap_map(vm_offset_t *virt, vm_offset_t start, vm_offset_t end, int prot)
 {
 
-	CTR5(KTR_PMAP, "%s(%p, %#x, %#x, %#x)", __func__, virt, start, end,
-	    prot);
+	CTR5(KTR_PMAP, "%s(va_p=%p, sva=%#lx, eva=%#lx, prot=%#x)", __func__,
+	    virt, start, end, prot);
 
 	return IA64_PHYS_TO_RR7(start);
 }
@@ -1558,7 +1559,8 @@ pmap_remove(pmap_t pmap, vm_offset_t sva
 	vm_offset_t va;
 	struct ia64_lpte *pte;
 
-	CTR4(KTR_PMAP, "%s(%p, %#x, %#x)", __func__, pmap, sva, eva);
+	CTR4(KTR_PMAP, "%s(pm=%p, sva=%#lx, eva=%#lx)", __func__, pmap, sva,
+	    eva);
 
 	/*
 	 * Perform an unsynchronized read.  This is, however, safe.
@@ -1597,7 +1599,7 @@ pmap_remove_all(vm_page_t m)
 	pmap_t oldpmap;
 	pv_entry_t pv;
 
-	CTR2(KTR_PMAP, "%s(%p)", __func__, m);
+	CTR2(KTR_PMAP, "%s(m=%p)", __func__, m);
 
 	KASSERT((m->oflags & VPO_UNMANAGED) == 0,
 	    ("pmap_remove_all: page %p is not managed", m));
@@ -1631,8 +1633,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sv
 	pmap_t oldpmap;
 	struct ia64_lpte *pte;
 
-	CTR5(KTR_PMAP, "%s(%p, %#x, %#x, %#x)", __func__, pmap, sva, eva,
-	    prot);
+	CTR5(KTR_PMAP, "%s(pm=%p, sva=%#lx, eva=%#lx, prot=%#x)", __func__,
+	    pmap, sva, eva, prot);
 
 	if ((prot & VM_PROT_READ) == VM_PROT_NONE) {
 		pmap_remove(pmap, sva, eva);
@@ -1700,8 +1702,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, 
 	struct ia64_lpte *pte;
 	boolean_t icache_inval, managed;
 
-	CTR6(KTR_PMAP, "pmap_enter(%p, %#x, %#x, %p, %#x, %u)", pmap, va,
-	    access, m, prot, wired);
+	CTR6(KTR_PMAP, "pmap_enter(pm=%p, va=%#lx, acc=%#x, m=%p, prot=%#x, "
+	    "wired=%u)", pmap, va, access, m, prot, wired);
 
 	rw_wlock(&pvh_global_lock);
 	PMAP_LOCK(pmap);
@@ -1834,8 +1836,8 @@ pmap_enter_object(pmap_t pmap, vm_offset
 	vm_page_t m;
 	vm_pindex_t diff, psize;
 
-	CTR6(KTR_PMAP, "%s(%p, %#x, %#x, %p, %#x)", __func__, pmap, start,
-	    end, m_start, prot);
+	CTR6(KTR_PMAP, "%s(pm=%p, sva=%#lx, eva=%#lx, m=%p, prot=%#x)",
+	    __func__, pmap, start, end, m_start, prot);
 
 	VM_OBJECT_ASSERT_LOCKED(m_start->object);
 
@@ -1866,7 +1868,8 @@ pmap_enter_quick(pmap_t pmap, vm_offset_
 {
 	pmap_t oldpmap;
 
-	CTR5(KTR_PMAP, "%s(%p, %#x, %p, %#x)", __func__, pmap, va, m, prot);
+	CTR5(KTR_PMAP, "%s(pm=%p, va=%#lx, m=%p, prot=%#x)", __func__, pmap,
+	    va, m, prot);
 
 	rw_wlock(&pvh_global_lock);
 	PMAP_LOCK(pmap);
@@ -1929,8 +1932,8 @@ pmap_object_init_pt(pmap_t pmap, vm_offs
     vm_pindex_t pindex, vm_size_t size)
 {
 
-	CTR6(KTR_PMAP, "%s(%p, %#x, %p, %u, %#x)", __func__, pmap, addr,
-	    object, pindex, size);
+	CTR6(KTR_PMAP, "%s(pm=%p, va=%#lx, obj=%p, idx=%lu, sz=%#lx)",
+	    __func__, pmap, addr, object, pindex, size);
 
 	VM_OBJECT_ASSERT_WLOCKED(object);
 	KASSERT(object->type == OBJT_DEVICE || object->type == OBJT_SG,
@@ -1950,7 +1953,8 @@ pmap_change_wiring(pmap_t pmap, vm_offse
 	pmap_t oldpmap;
 	struct ia64_lpte *pte;
 
-	CTR4(KTR_PMAP, "%s(%p, %#x, %u)", __func__, pmap, va, wired);
+	CTR4(KTR_PMAP, "%s(pm=%p, va=%#lx, wired=%u)", __func__, pmap, va,
+	    wired);
 
 	PMAP_LOCK(pmap);
 	oldpmap = pmap_switch(pmap);
@@ -1981,8 +1985,8 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm
     vm_offset_t src_va)
 {
 
-	CTR6(KTR_PMAP, "%s(%p, %p, %#x, %#x, %#x)", __func__, dst_pmap,
-	    src_pmap, dst_va, len, src_va);
+	CTR6(KTR_PMAP, "%s(dpm=%p, spm=%p, dva=%#lx, sz=%#lx, sva=%#lx)",
+	    __func__, dst_pmap, src_pmap, dst_va, len, src_va);
 }
 
 /*
@@ -1995,7 +1999,7 @@ pmap_zero_page(vm_page_t m)
 {
 	void *p;
 
-	CTR2(KTR_PMAP, "%s(%p)", __func__, m);
+	CTR2(KTR_PMAP, "%s(m=%p)", __func__, m);
 
 	p = (void *)pmap_page_to_va(m);
 	bzero(p, PAGE_SIZE);
@@ -2013,7 +2017,7 @@ pmap_zero_page_area(vm_page_t m, int off
 {
 	char *p;
 
-	CTR4(KTR_PMAP, "%s(%p, %d, %d)", __func__, m, off, size);
+	CTR4(KTR_PMAP, "%s(m=%p, ofs=%d, len=%d)", __func__, m, off, size);
 
 	p = (void *)pmap_page_to_va(m);
 	bzero(p + off, size);
@@ -2029,7 +2033,7 @@ pmap_zero_page_idle(vm_page_t m)
 {
 	void *p;
 
-	CTR2(KTR_PMAP, "%s(%p)", __func__, m);
+	CTR2(KTR_PMAP, "%s(m=%p)", __func__, m);
 
 	p = (void *)pmap_page_to_va(m);
 	bzero(p, PAGE_SIZE);
@@ -2046,7 +2050,7 @@ pmap_copy_page(vm_page_t msrc, vm_page_t
 {
 	void *dst, *src;
 
-	CTR3(KTR_PMAP, "%s(%p, %p)", __func__, msrc, mdst);
+	CTR3(KTR_PMAP, "%s(sm=%p, dm=%p)", __func__, msrc, mdst);
 
 	src = (void *)pmap_page_to_va(msrc);
 	dst = (void *)pmap_page_to_va(mdst);
@@ -2061,8 +2065,8 @@ pmap_copy_pages(vm_page_t ma[], vm_offse
 	vm_offset_t a_pg_offset, b_pg_offset;
 	int cnt;
 
-	CTR6(KTR_PMAP, "%s(%p, %#x, %p, %#x, %#x)", __func__, ma,
-	    a_offset, mb, b_offset, xfersize);
+	CTR6(KTR_PMAP, "%s(m0=%p, va0=%#lx, m1=%p, va1=%#lx, sz=%#x)",
+	    __func__, ma, a_offset, mb, b_offset, xfersize);
 
 	while (xfersize > 0) {
 		a_pg_offset = a_offset & PAGE_MASK;
@@ -2094,7 +2098,7 @@ pmap_page_exists_quick(pmap_t pmap, vm_p
 	int loops = 0;
 	boolean_t rv;
 
-	CTR3(KTR_PMAP, "%s(%p, %p)", __func__, pmap, m);
+	CTR3(KTR_PMAP, "%s(pm=%p, m=%p)", __func__, pmap, m);
 
 	KASSERT((m->oflags & VPO_UNMANAGED) == 0,
 	    ("pmap_page_exists_quick: page %p is not managed", m));
@@ -2127,7 +2131,7 @@ pmap_page_wired_mappings(vm_page_t m)
 	pv_entry_t pv;
 	int count;
 
-	CTR2(KTR_PMAP, "%s(%p)", __func__, m);
+	CTR2(KTR_PMAP, "%s(m=%p)", __func__, m);
 
 	count = 0;
 	if ((m->oflags & VPO_UNMANAGED) != 0)
@@ -2168,7 +2172,7 @@ pmap_remove_pages(pmap_t pmap)
 	u_long inuse, bitmask;
 	int allfree, bit, field, idx;
 
-	CTR2(KTR_PMAP, "%s(%p)", __func__, pmap);
+	CTR2(KTR_PMAP, "%s(pm=%p)", __func__, pmap);
 
 	rw_wlock(&pvh_global_lock);
 	PMAP_LOCK(pmap);
@@ -2237,7 +2241,7 @@ pmap_ts_referenced(vm_page_t m)
 	pv_entry_t pv;
 	int count = 0;
 
-	CTR2(KTR_PMAP, "%s(%p)", __func__, m);
+	CTR2(KTR_PMAP, "%s(m=%p)", __func__, m);
 
 	KASSERT((m->oflags & VPO_UNMANAGED) == 0,
 	    ("pmap_ts_referenced: page %p is not managed", m));
@@ -2274,7 +2278,7 @@ pmap_is_modified(vm_page_t m)
 	pv_entry_t pv;
 	boolean_t rv;
 
-	CTR2(KTR_PMAP, "%s(%p)", __func__, m);
+	CTR2(KTR_PMAP, "%s(m=%p)", __func__, m);
 
 	KASSERT((m->oflags & VPO_UNMANAGED) == 0,
 	    ("pmap_is_modified: page %p is not managed", m));
@@ -2316,7 +2320,7 @@ pmap_is_prefaultable(pmap_t pmap, vm_off
 {
 	struct ia64_lpte *pte;
 
-	CTR3(KTR_PMAP, "%s(%p, %#x)", __func__, pmap, addr);
+	CTR3(KTR_PMAP, "%s(pm=%p, va=%#lx)", __func__, pmap, addr);
 
 	pte = pmap_find_vhpt(addr);
 	if (pte != NULL && pmap_present(pte))
@@ -2338,7 +2342,7 @@ pmap_is_referenced(vm_page_t m)
 	pv_entry_t pv;
 	boolean_t rv;
 
-	CTR2(KTR_PMAP, "%s(%p)", __func__, m);
+	CTR2(KTR_PMAP, "%s(m=%p)", __func__, m);
 
 	KASSERT((m->oflags & VPO_UNMANAGED) == 0,
 	    ("pmap_is_referenced: page %p is not managed", m));
@@ -2372,8 +2376,8 @@ pmap_advise(pmap_t pmap, vm_offset_t sva
 	pmap_t oldpmap;
 	vm_page_t m;
 
-	CTR5(KTR_PMAP, "%s(%p, %#x, %#x, %d)", __func__, pmap, sva, eva,
-	    advice);
+	CTR5(KTR_PMAP, "%s(pm=%p, sva=%#lx, eva=%#lx, adv=%d)", __func__,
+	    pmap, sva, eva, advice);
 
 	PMAP_LOCK(pmap);
 	oldpmap = pmap_switch(pmap);
@@ -2417,7 +2421,7 @@ pmap_clear_modify(vm_page_t m)
 	pmap_t oldpmap, pmap;
 	pv_entry_t pv;
 
-	CTR2(KTR_PMAP, "%s(%p)", __func__, m);
+	CTR2(KTR_PMAP, "%s(m=%p)", __func__, m);
 
 	KASSERT((m->oflags & VPO_UNMANAGED) == 0,
 	    ("pmap_clear_modify: page %p is not managed", m));
@@ -2460,7 +2464,7 @@ pmap_remove_write(vm_page_t m)
 	pv_entry_t pv;
 	vm_prot_t prot;
 
-	CTR2(KTR_PMAP, "%s(%p)", __func__, m);
+	CTR2(KTR_PMAP, "%s(m=%p)", __func__, m);
 
 	KASSERT((m->oflags & VPO_UNMANAGED) == 0,
 	    ("pmap_remove_write: page %p is not managed", m));
@@ -2540,7 +2544,8 @@ pmap_mapdev_attr(vm_paddr_t pa, vm_size_
 {
 	vm_offset_t va;
 
-	CTR4(KTR_PMAP, "%s(%#x, %#x, %#x)", __func__, pa, sz, attr);
+	CTR4(KTR_PMAP, "%s(pa=%#lx, sz=%#lx, attr=%#x)", __func__, pa, sz,
+	    attr);
 
 	va = pmap_mapdev_priv(pa, sz, attr);
 	return ((void *)(uintptr_t)va);
@@ -2553,7 +2558,7 @@ void
 pmap_unmapdev(vm_offset_t va, vm_size_t size)
 {
 
-	CTR3(KTR_PMAP, "%s(%#x, %#x)", __func__, va, size);
+	CTR3(KTR_PMAP, "%s(va=%#lx, sz=%#lx)", __func__, va, size);
 }
 
 /*
@@ -2579,7 +2584,7 @@ pmap_page_set_memattr(vm_page_t m, vm_me
 	pv_entry_t pv;
 	void *va;
 
-	CTR3(KTR_PMAP, "%s(%p, %#x)", __func__, m, ma);
+	CTR3(KTR_PMAP, "%s(m=%p, attr=%#x)", __func__, m, ma);
 
 	rw_wlock(&pvh_global_lock);
 	m->md.memattr = ma;
@@ -2627,7 +2632,8 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad
 	vm_paddr_t pa;
 	int val;
 
-	CTR4(KTR_PMAP, "%s(%p, %#x, %p)", __func__, pmap, addr, locked_pa);
+	CTR4(KTR_PMAP, "%s(pm=%p, va=%#lx, pa_p=%p)", __func__, pmap, addr,
+	    locked_pa);
 
 	PMAP_LOCK(pmap);
 retry:
@@ -2668,7 +2674,7 @@ void
 pmap_activate(struct thread *td)
 {
 
-	CTR2(KTR_PMAP, "%s(%p)", __func__, td);
+	CTR2(KTR_PMAP, "%s(td=%p)", __func__, td);
 
 	pmap_switch(vmspace_pmap(td->td_proc->p_vmspace));
 }
@@ -2713,7 +2719,7 @@ pmap_sync_icache(pmap_t pm, vm_offset_t 
 	vm_offset_t lim;
 	vm_size_t len;
 
-	CTR4(KTR_PMAP, "%s(%p, %#x, %#x)", __func__, pm, va, sz);
+	CTR4(KTR_PMAP, "%s(pm=%p, va=%#lx, sz=%#lx)", __func__, pm, va, sz);
 
 	sz += va & 31;
 	va &= ~31;
@@ -2743,8 +2749,8 @@ pmap_align_superpage(vm_object_t object,
     vm_offset_t *addr, vm_size_t size)
 {
 
-	CTR5(KTR_PMAP, "%s(%p, %#x, %p, %#x)", __func__, object, offset, addr,
-	    size);
+	CTR5(KTR_PMAP, "%s(obj=%p, ofs=%#lx, va_p=%p, sz=%#lx)", __func__,
+	    object, offset, addr, size);
 }
 
 #include "opt_ddb.h"

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 22:13:08 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 870619A5;
 Wed,  2 Jul 2014 22:13:08 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 74809282C;
 Wed,  2 Jul 2014 22:13:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62MD8C8027146;
 Wed, 2 Jul 2014 22:13:08 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62MD8DQ027145;
 Wed, 2 Jul 2014 22:13:08 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201407022213.s62MD8DQ027145@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Wed, 2 Jul 2014 22:13:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268186 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 22:13:08 -0000

Author: marcel
Date: Wed Jul  2 22:13:07 2014
New Revision: 268186
URL: http://svnweb.freebsd.org/changeset/base/268186

Log:
  Drop KTR records when we're in the debugger so that the debugger isn't
  changing or overwriting the trace buffer. When KTR is enabled for things
  like traps or pmap functions, the amount of logging can be substantial.

Modified:
  head/sys/kern/kern_ktr.c

Modified: head/sys/kern/kern_ktr.c
==============================================================================
--- head/sys/kern/kern_ktr.c	Wed Jul  2 22:09:06 2014	(r268185)
+++ head/sys/kern/kern_ktr.c	Wed Jul  2 22:13:07 2014	(r268186)
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -323,7 +324,7 @@ ktr_tracepoint(u_int mask, const char *f
 #endif
 	int cpu;
 
-	if (panicstr)
+	if (panicstr || kdb_active)
 		return;
 	if ((ktr_mask & mask) == 0 || ktr_buf == NULL)
 		return;

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 22:16:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B009AC5F;
 Wed,  2 Jul 2014 22:16:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9D50B2855;
 Wed,  2 Jul 2014 22:16:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62MG19j027831;
 Wed, 2 Jul 2014 22:16:01 GMT (envelope-from wblock@svn.freebsd.org)
Received: (from wblock@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62MG1qP027830;
 Wed, 2 Jul 2014 22:16:01 GMT (envelope-from wblock@svn.freebsd.org)
Message-Id: <201407022216.s62MG1qP027830@svn.freebsd.org>
From: Warren Block 
Date: Wed, 2 Jul 2014 22:16:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268187 - head/share/man/man4
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 22:16:01 -0000

Author: wblock (doc committer)
Date: Wed Jul  2 22:16:01 2014
New Revision: 268187
URL: http://svnweb.freebsd.org/changeset/base/268187

Log:
  Improve markup, change references to nonexistent vt_vga(4), remove some
  language redundancy, and move the examples so sections are in the
  standard order.
  
  MFC after:	1 week

Modified:
  head/share/man/man4/vt.4

Modified: head/share/man/man4/vt.4
==============================================================================
--- head/share/man/man4/vt.4	Wed Jul  2 22:13:07 2014	(r268186)
+++ head/share/man/man4/vt.4	Wed Jul  2 22:16:01 2014	(r268187)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 27, 2014
+.Dd July 2, 2014
 .Dt "VIRTUAL TERMINALS" 4
 .Os
 .Sh NAME
@@ -109,10 +109,10 @@ These kernel options control the
 .Nm
 driver.
 .Bl -tag -width MAXCONS
-.It Dv TERMINAL_NORM_ATTR=_attribute_
-.It Dv TERMINAL_KERN_ATTR=_attribute_
-These options allow to change the default colors used for normal and kernel
-text respectively.
+.It Dv TERMINAL_NORM_ATTR= Ns Pa attribute
+.It Dv TERMINAL_KERN_ATTR= Ns Pa attribute
+These options allow changing the default colors used for normal and kernel
+text.
 Available colors are defined in
 .In sys/terminal.h .
 See
@@ -165,13 +165,13 @@ is set, the system remains in text mode.
 Otherwise,
 .Nm
 switches to 640x480x16 VGA mode using
-.Xr vt_vga 4 .
+.Cm vt_vga .
 If a KMS
 .Pq Kernel Mode Switching
 video driver is available, the display is switched to high resolution
 and the KMS driver takes over.
 When a KMS driver is not available,
-.Xr vt_vga 4
+.Cm vt_vga
 remains active.
 .Sh LOADER TUNABLES
 These settings can be entered at the
@@ -184,27 +184,18 @@ Set to 1 to use virtual terminals in tex
 Features that require graphics mode, like loadable fonts, will be
 disabled.
 .It Va kern.vty
-Set to vt to choose the
+When both
 .Nm
-driver for the system console, if the
-.Xr syscons 4
-driver is also compiled in and is the default.
+and
+.Xr sc 4 have been compiled into the kernel, the one to use for the
+system console can be selected by setting this value to
+.Ql vt
+or
+.Ql sc .
+If this value is not set,
+.Xr sc 4
+is used.
 .El
-.Sh EXAMPLES
-The following line will change the default color of normal text.
-Normal text will be green on black background.
-Reversed normal text will be black on green background.
-Note that you cannot put any white space inside the quoted string,
-because of the current implementation of
-.Xr config 8 .
-.Pp
-.Dl "options TERMINAL_NORM_ATTR=(FG_GREEN|BG_BLACK)"
-.Pp
-The following line will change the default color of kernel messages.
-Kernel messages will be printed bright red on black background.
-Reversed kernel messages will be black on bright red background.
-.Pp
-.Dl "options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK)"
 .Sh FILES
 .Bl -tag -width /usr/share/syscons/keymaps/* -compact
 .It Pa /dev/console
@@ -214,6 +205,19 @@ virtual terminals
 .It Pa /etc/ttys
 terminal initialization information
 .El
+.Sh EXAMPLES
+This example changes the default color of normal text to green on a
+black background, or black on a green background when reversed.
+Note that white space cannot be used inside the attribute string
+because of the current implementation of
+.Xr config 8 .
+.Pp
+.Dl "options TERMINAL_NORM_ATTR=(FG_GREEN|BG_BLACK)"
+.Pp
+This line changes the default color of kernel messages to be bright red
+on a black background, or black on a bright red background when reversed.
+.Pp
+.Dl "options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK)"
 .Sh SEE ALSO
 .Xr kbdcontrol 1 ,
 .Xr login 1 ,

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 22:25:49 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A6F236A3;
 Wed,  2 Jul 2014 22:25:49 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7AAEB2957;
 Wed,  2 Jul 2014 22:25:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62MPngx032980;
 Wed, 2 Jul 2014 22:25:49 GMT (envelope-from hiren@svn.freebsd.org)
Received: (from hiren@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62MPnqI032979;
 Wed, 2 Jul 2014 22:25:49 GMT (envelope-from hiren@svn.freebsd.org)
Message-Id: <201407022225.s62MPnqI032979@svn.freebsd.org>
From: Hiren Panchasara 
Date: Wed, 2 Jul 2014 22:25:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268190 - head/sys/netinet
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 22:25:49 -0000

Author: hiren
Date: Wed Jul  2 22:25:48 2014
New Revision: 268190
URL: http://svnweb.freebsd.org/changeset/base/268190

Log:
  Fix a typo and improve readability.

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==============================================================================

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 22:33:29 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C0959A10;
 Wed,  2 Jul 2014 22:33:29 +0000 (UTC)
Received: from mail-qg0-x22c.google.com (mail-qg0-x22c.google.com
 [IPv6:2607:f8b0:400d:c04::22c])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 606102A01;
 Wed,  2 Jul 2014 22:33:29 +0000 (UTC)
Received: by mail-qg0-f44.google.com with SMTP id j107so5437253qga.31
 for ; Wed, 02 Jul 2014 15:33:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date:message-id:subject
 :from:to:content-type;
 bh=dt/oWA8U0BomF510GoOt+uDdvXRZWdRKmaag/4jmu9U=;
 b=y6sJv+S+T4/ynr8EX5aOwdfCo+nkodeT+8FAm7yQl3abDxvuXruQOBFjosyowtMMxf
 /gpsUqnHeTe7N1B5LBK2OAAQtQRRJonTT5d0cpshxyWFaaxoifdccMZfEVaqdV3QODta
 rE11Lb+TLQbX2w7bF0wb2u6rfhKeQUT4DFk8Epu8hOIM+RPHMXNs4oLHwgYPPVpFjauG
 GlYkvuFJ52G6ocaR4bfc/AcC99033Ur/YUWg7WEowEz5UkBT6eWWY2+lDhgqpJbBPKZs
 7s8V9BwwAKzvXaEiWbc8d7fopF0JQ+5yp1Soci3iXwwHt0Ad/MhXZ8Sf+C8viNsVIpn6
 J9WA==
MIME-Version: 1.0
X-Received: by 10.224.65.4 with SMTP id g4mr1220696qai.45.1404340408447; Wed,
 02 Jul 2014 15:33:28 -0700 (PDT)
Sender: hiren.panchasara@gmail.com
Received: by 10.96.73.39 with HTTP; Wed, 2 Jul 2014 15:33:28 -0700 (PDT)
In-Reply-To: <201407022225.s62MPnqI032979@svn.freebsd.org>
References: <201407022225.s62MPnqI032979@svn.freebsd.org>
Date: Wed, 2 Jul 2014 15:33:28 -0700
X-Google-Sender-Auth: -PExOJz5fyj3rW4RDULDBXe8Gok
Message-ID: 
Subject: Re: svn commit: r268190 - head/sys/netinet
From: hiren panchasara 
To: src-committers ,
 svn-src-all , 
 svn-src-head 
Content-Type: text/plain; charset=UTF-8
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 22:33:29 -0000

On Wed, Jul 2, 2014 at 3:25 PM, Hiren Panchasara  wrote:
> Author: hiren
> Date: Wed Jul  2 22:25:48 2014
> New Revision: 268190
> URL: http://svnweb.freebsd.org/changeset/base/268190
>
> Log:
>   Fix a typo and improve readability.

This commit is to somewhat "fix" my stupidity from r268183.

Thanks to gjb for his help and sorry for this whole thing.

Hiren

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 22:34:08 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 380C4B4B;
 Wed,  2 Jul 2014 22:34:08 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 18CCD2A04;
 Wed,  2 Jul 2014 22:34:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62MY7pv037488;
 Wed, 2 Jul 2014 22:34:07 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62MY7ZT037482;
 Wed, 2 Jul 2014 22:34:07 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201407022234.s62MY7ZT037482@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Wed, 2 Jul 2014 22:34:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268191 - head
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 22:34:08 -0000

Author: marcel
Date: Wed Jul  2 22:34:06 2014
New Revision: 268191
URL: http://svnweb.freebsd.org/changeset/base/268191

Log:
  Remove ia64 from the list of known architectures and add an entry to
  UPDATING. This is the first step towards the removal of ia64 from
  head. A buildworld for ia64 will now yield:
  
  % make buildworld
  make[1]: "/usr/src/Makefile.inc1" line 151: Unknown target ia64:ia64.
  
  While here, trim the ia64-specific additions from ObsoleteFiles.inc
  
  Discussed at: BSDcan

Modified:
  head/Makefile
  head/Makefile.inc1
  head/ObsoleteFiles.inc
  head/UPDATING

Modified: head/Makefile
==============================================================================
--- head/Makefile	Wed Jul  2 22:25:48 2014	(r268190)
+++ head/Makefile	Wed Jul  2 22:34:06 2014	(r268191)
@@ -82,7 +82,7 @@
 #
 # See src/UPDATING `COMMON ITEMS' for more complete information.
 #
-# If TARGET=machine (e.g. ia64, sparc64, ...) is specified you can
+# If TARGET=machine (e.g. powerpc, sparc64, ...) is specified you can
 # cross build world for other machine types using the buildworld target,
 # and once the world is built you can cross build a kernel using the
 # buildkernel target.
@@ -361,7 +361,7 @@ kernel-toolchains:
 # existing system is.
 #
 .if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets)
-TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64
+TARGETS?=amd64 arm i386 mips pc98 powerpc sparc64
 TARGET_ARCHES_arm?=	arm armeb armv6 armv6hf
 TARGET_ARCHES_mips?=	mipsel mips mips64el mips64 mipsn32
 TARGET_ARCHES_powerpc?=	powerpc powerpc64

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Wed Jul  2 22:25:48 2014	(r268190)
+++ head/Makefile.inc1	Wed Jul  2 22:34:06 2014	(r268191)
@@ -140,7 +140,7 @@ SRCRELDATE!=	awk '/^\#define[[:space:]]*
 VERSION=	FreeBSD ${REVISION}-${BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDATE}
 .endif
 
-KNOWN_ARCHES?=	amd64 arm armeb/arm armv6/arm armv6hf/arm i386 i386/pc98 ia64 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64
+KNOWN_ARCHES?=	amd64 arm armeb/arm armv6/arm armv6hf/arm i386 i386/pc98 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64
 .if ${TARGET} == ${TARGET_ARCH}
 _t=		${TARGET}
 .else

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Wed Jul  2 22:25:48 2014	(r268190)
+++ head/ObsoleteFiles.inc	Wed Jul  2 22:34:06 2014	(r268191)
@@ -1179,9 +1179,6 @@ OLD_FILES+=usr/include/xmmintrin.h
 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "arm"
 OLD_FILES+=usr/include/mmintrin.h
 .endif
-.if ${TARGET_ARCH} == "ia64"
-OLD_FILES+=usr/include/ia64intrin.h
-.endif
 .if ${TARGET_ARCH} == "powerpc"
 OLD_FILES+=usr/include/altivec.h
 OLD_FILES+=usr/include/ppc-asm.h
@@ -1199,10 +1196,6 @@ OLD_FILES+=usr/include/machine/rm7000.h
 OLD_FILES+=usr/include/machine/defs.h
 OLD_FILES+=usr/include/machine/queue.h
 .endif
-# 20100326: [ia64] removed 
-.if ${TARGET_ARCH} == "ia64"
-OLD_FILES+=usr/include/machine/nexusvar.h
-.endif
 # 20100326: gcpio removal
 OLD_FILES+=usr/bin/gcpio
 OLD_FILES+=usr/share/info/cpio.info.gz
@@ -1216,11 +1209,6 @@ OLD_FILES+=usr/share/man/man3/regexp.3.g
 OLD_FILES+=usr/share/man/man3/regsub.3.gz
 # 20100303: actual removal of utmp.h
 OLD_FILES+=usr/include/utmp.h
-# 20100227: [ia64] removed  and 
-.if ${TARGET_ARCH} == "ia64"
-OLD_FILES+=usr/include/machine/sapicreg.h
-OLD_FILES+=usr/include/machine/sapicvar.h
-.endif
 # 20100208: man pages moved
 .if ${TARGET_ARCH} == "i386"
 OLD_FILES+=usr/share/man/man4/i386/alpm.4.gz
@@ -1913,14 +1901,6 @@ OLD_FILES+=usr/share/man/man8/arlcontrol
 OLD_FILES+=sbin/sunlabel
 OLD_FILES+=usr/share/man/man8/sunlabel.8.gz
 .endif
-# 20080703: bsdlabel & fdisk removed on ia64
-.if ${TARGET_ARCH} == "ia64"
-OLD_FILES+=sbin/bsdlabel
-OLD_FILES+=usr/share/man/man8/bsdlabel.8.gz
-OLD_FILES+=usr/share/man/man8/disklabel.8.gz
-OLD_FILES+=sbin/fdisk
-OLD_FILES+=usr/share/man/man8/fdisk.8.gz
-.endif
 # 20080701: wpa_supplicant.conf moved to share/examples/etc/
 OLD_FILES+=usr/share/examples/wpa_supplicant/wpa_supplicant.conf
 OLD_DIRS+=usr/share/examples/wpa_supplicant
@@ -2129,12 +2109,6 @@ OLD_FILES+=usr/include/sys/_elf_solaris.
 OLD_FILES+=usr/share/man/man3/pmc_x86_get_msr.3.gz
 # 20071108: Removed very crunch OLDCARD support file
 OLD_FILES+=etc/defaults/pccard.conf
-# 20071104: Removed bsdlabel, fdisk and gpt from rescue on ia64.
-.if ${TARGET_ARCH} == "ia64"
-OLD_FILES+=rescue/bsdlabel
-OLD_FILES+=rescue/fdisk
-OLD_FILES+=rescue/gpt
-.endif
 # 20071025: rc.d/nfslocking superceeded by rc.d/lockd and rc.d/statd
 OLD_FILES+=etc/rc.d/nfslocking
 # 20070930: rename of cached to nscd
@@ -2795,10 +2769,6 @@ OLD_FILES+=usr/share/man/man8/mount_std.
 OLD_FILES+=usr/share/man/man4/uhidev.4.gz
 # 20061106: archive_write_prepare.3 removed
 OLD_FILES+=usr/share/man/man3/archive_write_prepare.3.gz
-.if ${TARGET_ARCH} == "ia64"
-# 20061104: skiload.help removed
-OLD_FILES+=boot/skiload.help
-.endif
 # 20061018: pccardc removed
 OLD_FILES+=usr/sbin/pccardc usr/share/man/man8/pccardc.8.gz
 # 20060930: demangle.h from contrib/libstdc++/include/ext/

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Wed Jul  2 22:25:48 2014	(r268190)
+++ head/UPDATING	Wed Jul  2 22:34:06 2014	(r268191)
@@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
 	disable the most expensive debugging functionality run
 	"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20140702:
+	The Itanium architecture (ia64) has been removed from the list of
+	known architectures. This is the first step in the removal of the
+	architecture.
+
 20140701:
 	Commit r268115 has added NFSv4.1 server support, merged from
 	projects/nfsv4.1-server.  Since this includes changes to the

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 23:07:01 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E477F5AE;
 Wed,  2 Jul 2014 23:07:01 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D20832C7A;
 Wed,  2 Jul 2014 23:07:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62N71Rw052014;
 Wed, 2 Jul 2014 23:07:01 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62N71pE052013;
 Wed, 2 Jul 2014 23:07:01 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201407022307.s62N71pE052013@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Wed, 2 Jul 2014 23:07:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268193 - head/usr.bin/sed
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 23:07:02 -0000

Author: pfg
Date: Wed Jul  2 23:07:01 2014
New Revision: 268193
URL: http://svnweb.freebsd.org/changeset/base/268193

Log:
  Fix sed(1) usage: the extension -i is not an optional.
  
  MFC after:	3 days

Modified:
  head/usr.bin/sed/main.c

Modified: head/usr.bin/sed/main.c
==============================================================================
--- head/usr.bin/sed/main.c	Wed Jul  2 23:05:57 2014	(r268192)
+++ head/usr.bin/sed/main.c	Wed Jul  2 23:07:01 2014	(r268193)
@@ -205,7 +205,7 @@ usage(void)
 {
 	(void)fprintf(stderr,
 	    "usage: %s script [-Ealnru] [-i[]] [file ...]\n"
-	    "\t%s [-Ealnu] [-i[]] [-e script] ... [-f script_file]"
+	    "\t%s [-Ealnu] [-i extension] [-e script] ... [-f script_file]"
 	    " ... [file ...]\n", getprogname(), getprogname());
 	exit(1);
 }

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  2 23:28:21 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E4D5E308;
 Wed,  2 Jul 2014 23:28:21 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D243D2E6B;
 Wed,  2 Jul 2014 23:28:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s62NSLJJ062451;
 Wed, 2 Jul 2014 23:28:21 GMT (envelope-from bryanv@svn.freebsd.org)
Received: (from bryanv@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s62NSLWZ062450;
 Wed, 2 Jul 2014 23:28:21 GMT (envelope-from bryanv@svn.freebsd.org)
Message-Id: <201407022328.s62NSLWZ062450@svn.freebsd.org>
From: Bryan Venteicher 
Date: Wed, 2 Jul 2014 23:28:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268196 - head/sys/dev/vmware/vmxnet3
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 02 Jul 2014 23:28:22 -0000

Author: bryanv
Date: Wed Jul  2 23:28:21 2014
New Revision: 268196
URL: http://svnweb.freebsd.org/changeset/base/268196

Log:
  Remove some write only variables
  
  MFC after:	3 days

Modified:
  head/sys/dev/vmware/vmxnet3/if_vmx.c

Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c
==============================================================================
--- head/sys/dev/vmware/vmxnet3/if_vmx.c	Wed Jul  2 23:23:18 2014	(r268195)
+++ head/sys/dev/vmware/vmxnet3/if_vmx.c	Wed Jul  2 23:28:21 2014	(r268196)
@@ -2226,12 +2226,10 @@ vmxnet3_legacy_intr(void *xsc)
 	struct vmxnet3_softc *sc;
 	struct vmxnet3_rxqueue *rxq;
 	struct vmxnet3_txqueue *txq;
-	struct ifnet *ifp;
 
 	sc = xsc;
 	rxq = &sc->vmx_rxq[0];
 	txq = &sc->vmx_txq[0];
-	ifp = sc->vmx_ifp;
 
 	if (sc->vmx_intr_type == VMXNET3_IT_LEGACY) {
 		if (vmxnet3_read_bar1(sc, VMXNET3_BAR1_INTR) == 0)
@@ -2260,11 +2258,9 @@ vmxnet3_txq_intr(void *xtxq)
 {
 	struct vmxnet3_softc *sc;
 	struct vmxnet3_txqueue *txq;
-	struct ifnet *ifp;
 
 	txq = xtxq;
 	sc = txq->vxtxq_sc;
-	ifp = sc->vmx_ifp;
 
 	if (sc->vmx_intr_mask_mode == VMXNET3_IMM_ACTIVE)
 		vmxnet3_disable_intr(sc, txq->vxtxq_intr_idx);
@@ -2774,7 +2770,6 @@ static int
 vmxnet3_txq_encap(struct vmxnet3_txqueue *txq, struct mbuf **m0)
 {
 	struct vmxnet3_softc *sc;
-	struct ifnet *ifp;
 	struct vmxnet3_txring *txr;
 	struct vmxnet3_txdesc *txd, *sop;
 	struct mbuf *m;
@@ -2783,7 +2778,6 @@ vmxnet3_txq_encap(struct vmxnet3_txqueue
 	int i, gen, nsegs, etype, proto, start, error;
 
 	sc = txq->vxtxq_sc;
-	ifp = sc->vmx_ifp;
 	start = 0;
 	txd = NULL;
 	txr = &txq->vxtxq_cmd_ring;

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 00:23:15 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 20809C35;
 Thu,  3 Jul 2014 00:23:15 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0DE0B245B;
 Thu,  3 Jul 2014 00:23:15 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s630NE0E093014;
 Thu, 3 Jul 2014 00:23:14 GMT (envelope-from grehan@svn.freebsd.org)
Received: (from grehan@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s630NEWP093013;
 Thu, 3 Jul 2014 00:23:14 GMT (envelope-from grehan@svn.freebsd.org)
Message-Id: <201407030023.s630NEWP093013@svn.freebsd.org>
From: Peter Grehan 
Date: Thu, 3 Jul 2014 00:23:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268202 - head/usr.sbin/bhyve
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 00:23:15 -0000

Author: grehan
Date: Thu Jul  3 00:23:14 2014
New Revision: 268202
URL: http://svnweb.freebsd.org/changeset/base/268202

Log:
  Use correct flag for event index.
  
  Submitted by:	luigi
  Obtained from:	Vincenzo Maffione, Universita` di Pisa
  MFC after:	1 week

Modified:
  head/usr.sbin/bhyve/virtio.c

Modified: head/usr.sbin/bhyve/virtio.c
==============================================================================
--- head/usr.sbin/bhyve/virtio.c	Wed Jul  2 23:57:55 2014	(r268201)
+++ head/usr.sbin/bhyve/virtio.c	Thu Jul  3 00:23:14 2014	(r268202)
@@ -437,7 +437,7 @@ vq_endchains(struct vqueue_info *vq, int
 	if (used_all_avail &&
 	    (vs->vs_negotiated_caps & VIRTIO_F_NOTIFY_ON_EMPTY))
 		intr = 1;
-	else if (vs->vs_flags & VIRTIO_EVENT_IDX) {
+	else if (vs->vs_negotiated_caps & VIRTIO_RING_F_EVENT_IDX) {
 		event_idx = VQ_USED_EVENT_IDX(vq);
 		/*
 		 * This calculation is per docs and the kernel

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 00:29:25 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 032FEEE2;
 Thu,  3 Jul 2014 00:29:25 +0000 (UTC)
Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CF5BB24AF;
 Thu,  3 Jul 2014 00:29:24 +0000 (UTC)
Received: from [192.168.2.31] (atc.xcllnt.net [50.0.150.213])
 (authenticated bits=0)
 by mail.xcllnt.net (8.14.9/8.14.9) with ESMTP id s630TMo2042474
 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO);
 Wed, 2 Jul 2014 17:29:23 -0700 (PDT)
 (envelope-from marcel@xcllnt.net)
Content-Type: multipart/signed;
 boundary="Apple-Mail=_D86C4159-7754-4F4E-B4E4-E336FC9EE5FA";
 protocol="application/pgp-signature"; micalg=pgp-sha1
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Subject: Re: svn commit: r268176 - in head/sys/dev: bge nfe
From: Marcel Moolenaar 
In-Reply-To: <201407022108.s62L8QmG091246@svn.freebsd.org>
Date: Wed, 2 Jul 2014 17:29:21 -0700
Message-Id: 
References: <201407022108.s62L8QmG091246@svn.freebsd.org>
To: Sergey Kandaurov 
X-Mailer: Apple Mail (2.1878.2)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 00:29:25 -0000


--Apple-Mail=_D86C4159-7754-4F4E-B4E4-E336FC9EE5FA
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii


On Jul 2, 2014, at 2:08 PM, Sergey Kandaurov  wrote:

> Author: pluknet
> Date: Wed Jul  2 21:08:25 2014
> New Revision: 268176
> URL: http://svnweb.freebsd.org/changeset/base/268176
> 
> Log:
>  Fixed build with DEVICE_POLLING.

Ugh... Thanks!

I'll add that to the checklist for people to verify.

-- 
Marcel Moolenaar
marcel@xcllnt.net



--Apple-Mail=_D86C4159-7754-4F4E-B4E4-E336FC9EE5FA
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iEYEARECAAYFAlO0o+EACgkQpgWlLWHuifYg+QCfQ00FzRx+1n7CLsfI0WvrwJhK
DXwAn1Kz/SF69pPaivkl2rBVUx/sxgJS
=+Z6S
-----END PGP SIGNATURE-----

--Apple-Mail=_D86C4159-7754-4F4E-B4E4-E336FC9EE5FA--

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 00:31:14 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 82BCFC5;
 Thu,  3 Jul 2014 00:31:14 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 704FD24C1;
 Thu,  3 Jul 2014 00:31:14 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s630VEtm097286;
 Thu, 3 Jul 2014 00:31:14 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s630VE9k097285;
 Thu, 3 Jul 2014 00:31:14 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201407030031.s630VE9k097285@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Thu, 3 Jul 2014 00:31:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268203 - head/usr.bin/sed
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 00:31:14 -0000

Author: pfg
Date: Thu Jul  3 00:31:13 2014
New Revision: 268203
URL: http://svnweb.freebsd.org/changeset/base/268203

Log:
  More sed(1) usage fixing: the extension -i is not optional.
  
  Pointed out by:	jmallet
  MFC after:	3 days

Modified:
  head/usr.bin/sed/main.c

Modified: head/usr.bin/sed/main.c
==============================================================================
--- head/usr.bin/sed/main.c	Thu Jul  3 00:23:14 2014	(r268202)
+++ head/usr.bin/sed/main.c	Thu Jul  3 00:31:13 2014	(r268203)
@@ -204,7 +204,7 @@ static void
 usage(void)
 {
 	(void)fprintf(stderr,
-	    "usage: %s script [-Ealnru] [-i[]] [file ...]\n"
+	    "usage: %s script [-Ealnru] [-i extension] [file ...]\n"
 	    "\t%s [-Ealnu] [-i extension] [-e script] ... [-f script_file]"
 	    " ... [file ...]\n", getprogname(), getprogname());
 	exit(1);

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 04:26:53 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C1261EBB;
 Thu,  3 Jul 2014 04:26:53 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 952A32819;
 Thu,  3 Jul 2014 04:26:53 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s634QrbO006216;
 Thu, 3 Jul 2014 04:26:53 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s634QrDI006215;
 Thu, 3 Jul 2014 04:26:53 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407030426.s634QrDI006215@svn.freebsd.org>
From: Alexander Motin 
Date: Thu, 3 Jul 2014 04:26:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268204 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 04:26:53 -0000

Author: mav
Date: Thu Jul  3 04:26:53 2014
New Revision: 268204
URL: http://svnweb.freebsd.org/changeset/base/268204

Log:
  Use separate memory type M_CTLIO for I/Os.
  
  CTL allocate large amount of RAM.  This change give some more stats.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/ctl/ctl.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Thu Jul  3 00:31:13 2014	(r268203)
+++ head/sys/cam/ctl/ctl.c	Thu Jul  3 04:26:53 2014	(r268204)
@@ -455,6 +455,7 @@ static struct cdevsw ctl_cdevsw = {
 
 
 MALLOC_DEFINE(M_CTL, "ctlmem", "Memory used for CTL");
+MALLOC_DEFINE(M_CTLIO, "ctlio", "Memory used for CTL requests");
 
 static int ctl_module_event_handler(module_t, int /*modeventtype_t*/, void *);
 
@@ -3358,7 +3359,7 @@ ctl_pool_create(struct ctl_softc *ctl_so
 	 * tracking.
 	 */
 	for (i = 0; i < total_ctl_io; i++) {
-		cur_io = (union ctl_io *)malloc(sizeof(*cur_io), M_CTL,
+		cur_io = (union ctl_io *)malloc(sizeof(*cur_io), M_CTLIO,
 						M_NOWAIT);
 		if (cur_io == NULL) {
 			retval = ENOMEM;
@@ -3377,7 +3378,7 @@ ctl_pool_create(struct ctl_softc *ctl_so
 							      links);
 			STAILQ_REMOVE(&pool->free_queue, &cur_io->io_hdr,
 				      ctl_io_hdr, links);
-			free(cur_io, M_CTL);
+			free(cur_io, M_CTLIO);
 		}
 
 		free(pool, M_CTL);
@@ -3439,7 +3440,7 @@ ctl_pool_release(struct ctl_io_pool *poo
 	while ((io = (union ctl_io *)STAILQ_FIRST(&pool->free_queue)) != NULL) {
 		STAILQ_REMOVE(&pool->free_queue, &io->io_hdr, ctl_io_hdr,
 			      links);
-		free(io, M_CTL);
+		free(io, M_CTLIO);
 	}
 
 	STAILQ_REMOVE(&ctl_softc->io_pools, pool, ctl_io_pool, links);
@@ -3543,7 +3544,7 @@ ctl_alloc_io(void *pool_ref)
 	 * The emergency pool (if it exists) didn't have one, so try an
 	 * atomic (i.e. nonblocking) malloc and see if we get lucky.
 	 */
-	io = (union ctl_io *)malloc(sizeof(*io), M_CTL, M_NOWAIT);
+	io = (union ctl_io *)malloc(sizeof(*io), M_CTLIO, M_NOWAIT);
 	if (io != NULL) {
 		/*
 		 * If the emergency pool exists but is empty, add this
@@ -3595,7 +3596,7 @@ ctl_free_io(union ctl_io *io)
 		 * Otherwise, just free it.  We probably malloced it and
 		 * the emergency pool wasn't available.
 		 */
-		free(io, M_CTL);
+		free(io, M_CTLIO);
 	}
 
 }

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 05:22:15 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0B682550;
 Thu,  3 Jul 2014 05:22:15 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EB9742C20;
 Thu,  3 Jul 2014 05:22:14 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s635MECv032807;
 Thu, 3 Jul 2014 05:22:14 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s635MELq032806;
 Thu, 3 Jul 2014 05:22:14 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201407030522.s635MELq032806@svn.freebsd.org>
From: Warner Losh 
Date: Thu, 3 Jul 2014 05:22:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268205 - head/sys/cam/ata
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 05:22:15 -0000

Author: imp
Date: Thu Jul  3 05:22:13 2014
New Revision: 268205
URL: http://svnweb.freebsd.org/changeset/base/268205

Log:
  Rework the BIO_DELETE code slightly. Always queue the BIO_DELETE
  requests on the trim_queue, even for the CFA ERASE. This allows us, in
  the future, to collapse adjacent requests. Since CFA ERASE is only for
  CF cards, and it is so restrictive in what it can do, the collapse
  code is not presently here. This also brings the ada driver more in
  line with the da driver's treatment of BIO_DELETEs.
  
  Reviewed by: mav@

Modified:
  head/sys/cam/ata/ata_da.c

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c	Thu Jul  3 04:26:53 2014	(r268204)
+++ head/sys/cam/ata/ata_da.c	Thu Jul  3 05:22:13 2014	(r268205)
@@ -719,8 +719,11 @@ adastrategy(struct bio *bp)
 	/*
 	 * Place it in the queue of disk activities for this disk
 	 */
-	if (bp->bio_cmd == BIO_DELETE &&
-	    (softc->flags & ADA_FLAG_CAN_TRIM)) {
+	if (bp->bio_cmd == BIO_DELETE) {
+		KASSERT((softc->flags & ADA_FLAG_CAN_TRIM) ||
+			((softc->flags & ADA_FLAG_CAN_CFA) &&
+			 !(softc->flags & ADA_FLAG_CAN_48BIT)),
+			("BIO_DELETE but no supported TRIM method."));
 		bioq_disksort(&softc->trim_queue, bp);
 	} else {
 		if (ADA_SIO)
@@ -1376,6 +1379,96 @@ adaregister(struct cam_periph *periph, v
 }
 
 static void
+ada_dsmtrim(struct ada_softc *softc, struct bio *bp, struct ccb_ataio *ataio)
+{
+	struct trim_request *req = &softc->trim_req;
+	uint64_t lastlba = (uint64_t)-1;
+	int c, lastcount = 0, off, ranges = 0;
+
+	bzero(req, sizeof(*req));
+	TAILQ_INIT(&req->bps);
+	do {
+		uint64_t lba = bp->bio_pblkno;
+		int count = bp->bio_bcount / softc->params.secsize;
+
+		bioq_remove(&softc->trim_queue, bp);
+
+		/* Try to extend the previous range. */
+		if (lba == lastlba) {
+			c = min(count, ATA_DSM_RANGE_MAX - lastcount);
+			lastcount += c;
+			off = (ranges - 1) * ATA_DSM_RANGE_SIZE;
+			req->data[off + 6] = lastcount & 0xff;
+			req->data[off + 7] =
+				(lastcount >> 8) & 0xff;
+			count -= c;
+			lba += c;
+		}
+
+		while (count > 0) {
+			c = min(count, ATA_DSM_RANGE_MAX);
+			off = ranges * ATA_DSM_RANGE_SIZE;
+			req->data[off + 0] = lba & 0xff;
+			req->data[off + 1] = (lba >> 8) & 0xff;
+			req->data[off + 2] = (lba >> 16) & 0xff;
+			req->data[off + 3] = (lba >> 24) & 0xff;
+			req->data[off + 4] = (lba >> 32) & 0xff;
+			req->data[off + 5] = (lba >> 40) & 0xff;
+			req->data[off + 6] = c & 0xff;
+			req->data[off + 7] = (c >> 8) & 0xff;
+			lba += c;
+			count -= c;
+			lastcount = c;
+			ranges++;
+			/*
+			 * Its the caller's responsibility to ensure the
+			 * request will fit so we don't need to check for
+			 * overrun here
+			 */
+		}
+		lastlba = lba;
+		TAILQ_INSERT_TAIL(&req->bps, bp, bio_queue);
+		bp = bioq_first(&softc->trim_queue);
+		if (bp == NULL ||
+		    bp->bio_bcount / softc->params.secsize >
+		    (softc->trim_max_ranges - ranges) * ATA_DSM_RANGE_MAX)
+			break;
+	} while (1);
+	cam_fill_ataio(ataio,
+	    ada_retry_count,
+	    adadone,
+	    CAM_DIR_OUT,
+	    0,
+	    req->data,
+	    ((ranges + ATA_DSM_BLK_RANGES - 1) /
+	    ATA_DSM_BLK_RANGES) * ATA_DSM_BLK_SIZE,
+	    ada_default_timeout * 1000);
+	ata_48bit_cmd(ataio, ATA_DATA_SET_MANAGEMENT,
+	    ATA_DSM_TRIM, 0, (ranges + ATA_DSM_BLK_RANGES -
+	    1) / ATA_DSM_BLK_RANGES);
+}
+
+static void
+ada_cfaerase(struct ada_softc *softc, struct bio *bp, struct ccb_ataio *ataio)
+{
+	uint64_t lba = bp->bio_pblkno;
+	uint16_t count = bp->bio_bcount / softc->params.secsize;
+
+	cam_fill_ataio(ataio,
+	    ada_retry_count,
+	    adadone,
+	    CAM_DIR_NONE,
+	    0,
+	    NULL,
+	    0,
+	    ada_default_timeout*1000);
+
+	if (count >= 256)
+		count = 0;
+	ata_28bit_cmd(ataio, ATA_CFA_ERASE, 0, lba, count);
+}
+
+static void
 adastart(struct cam_periph *periph, union ccb *start_ccb)
 {
 	struct ada_softc *softc = (struct ada_softc *)periph->softc;
@@ -1392,76 +1485,15 @@ adastart(struct cam_periph *periph, unio
 		/* Run TRIM if not running yet. */
 		if (!softc->trim_running &&
 		    (bp = bioq_first(&softc->trim_queue)) != 0) {
-			struct trim_request *req = &softc->trim_req;
-			struct bio *bp1;
-			uint64_t lastlba = (uint64_t)-1;
-			int c, lastcount = 0, off, ranges = 0;
-
+			if (softc->flags & ADA_FLAG_CAN_TRIM) {
+				ada_dsmtrim(softc, bp, ataio);
+			} else if ((softc->flags & ADA_FLAG_CAN_CFA) &&
+			    !(softc->flags & ADA_FLAG_CAN_48BIT)) {
+				ada_cfaerase(softc, bp, ataio);
+			} else {
+				panic("adastart: BIO_DELETE without method, not possible.");
+			}
 			softc->trim_running = 1;
-			bzero(req, sizeof(*req));
-			TAILQ_INIT(&req->bps);
-			bp1 = bp;
-			do {
-				uint64_t lba = bp1->bio_pblkno;
-				int count = bp1->bio_bcount /
-				    softc->params.secsize;
-
-				bioq_remove(&softc->trim_queue, bp1);
-
-				/* Try to extend the previous range. */
-				if (lba == lastlba) {
-					c = min(count, ATA_DSM_RANGE_MAX - lastcount);
-					lastcount += c;
-					off = (ranges - 1) * ATA_DSM_RANGE_SIZE;
-					req->data[off + 6] = lastcount & 0xff;
-					req->data[off + 7] =
-					    (lastcount >> 8) & 0xff;
-					count -= c;
-					lba += c;
-				}
-
-				while (count > 0) {
-					c = min(count, ATA_DSM_RANGE_MAX);
-					off = ranges * ATA_DSM_RANGE_SIZE;
-					req->data[off + 0] = lba & 0xff;
-					req->data[off + 1] = (lba >> 8) & 0xff;
-					req->data[off + 2] = (lba >> 16) & 0xff;
-					req->data[off + 3] = (lba >> 24) & 0xff;
-					req->data[off + 4] = (lba >> 32) & 0xff;
-					req->data[off + 5] = (lba >> 40) & 0xff;
-					req->data[off + 6] = c & 0xff;
-					req->data[off + 7] = (c >> 8) & 0xff;
-					lba += c;
-					count -= c;
-					lastcount = c;
-					ranges++;
-					/*
-					 * Its the caller's responsibility to ensure the
-					 * request will fit so we don't need to check for
-					 * overrun here
-					 */
-				}
-				lastlba = lba;
-				TAILQ_INSERT_TAIL(&req->bps, bp1, bio_queue);
-				bp1 = bioq_first(&softc->trim_queue);
-				if (bp1 == NULL ||
-				    bp1->bio_bcount / softc->params.secsize >
-				    (softc->trim_max_ranges - ranges) *
-				    ATA_DSM_RANGE_MAX)
-					break;
-			} while (1);
-			cam_fill_ataio(ataio,
-			    ada_retry_count,
-			    adadone,
-			    CAM_DIR_OUT,
-			    0,
-			    req->data,
-			    ((ranges + ATA_DSM_BLK_RANGES - 1) /
-			        ATA_DSM_BLK_RANGES) * ATA_DSM_BLK_SIZE,
-			    ada_default_timeout * 1000);
-			ata_48bit_cmd(ataio, ATA_DATA_SET_MANAGEMENT,
-			    ATA_DSM_TRIM, 0, (ranges + ATA_DSM_BLK_RANGES -
-			    1) / ATA_DSM_BLK_RANGES);
 			start_ccb->ccb_h.ccb_state = ADA_CCB_TRIM;
 			start_ccb->ccb_h.flags |= CAM_UNLOCKED;
 			goto out;
@@ -1596,25 +1628,6 @@ adastart(struct cam_periph *periph, unio
 			}
 			break;
 		}
-		case BIO_DELETE:
-		{
-			uint64_t lba = bp->bio_pblkno;
-			uint16_t count = bp->bio_bcount / softc->params.secsize;
-
-			cam_fill_ataio(ataio,
-			    ada_retry_count,
-			    adadone,
-			    CAM_DIR_NONE,
-			    0,
-			    NULL,
-			    0,
-			    ada_default_timeout*1000);
-
-			if (count >= 256)
-				count = 0;
-			ata_28bit_cmd(ataio, ATA_CFA_ERASE, 0, lba, count);
-			break;
-		}
 		case BIO_FLUSH:
 			cam_fill_ataio(ataio,
 			    1,

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 06:52:27 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3D1DA3CE;
 Thu,  3 Jul 2014 06:52:27 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 10A5922C9;
 Thu,  3 Jul 2014 06:52:27 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s636qQT4073494;
 Thu, 3 Jul 2014 06:52:26 GMT (envelope-from jhibbits@svn.freebsd.org)
Received: (from jhibbits@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s636qQ1I073493;
 Thu, 3 Jul 2014 06:52:26 GMT (envelope-from jhibbits@svn.freebsd.org)
Message-Id: <201407030652.s636qQ1I073493@svn.freebsd.org>
From: Justin Hibbits 
Date: Thu, 3 Jul 2014 06:52:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268207 - head/sys/dev/hwpmc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 06:52:27 -0000

Author: jhibbits
Date: Thu Jul  3 06:52:26 2014
New Revision: 268207
URL: http://svnweb.freebsd.org/changeset/base/268207

Log:
  Fix a bug in hwpmc(4) callchain retrieval, for both user and kernel.
  
  The array index for the callchain is getting double-incremented -- both in the
  loop and the storing.  It should only be incremented in one location.
  
  Also, constrain the stack pointer range check.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/hwpmc/hwpmc_powerpc.c

Modified: head/sys/dev/hwpmc/hwpmc_powerpc.c
==============================================================================
--- head/sys/dev/hwpmc/hwpmc_powerpc.c	Thu Jul  3 06:44:55 2014	(r268206)
+++ head/sys/dev/hwpmc/hwpmc_powerpc.c	Thu Jul  3 06:52:26 2014	(r268207)
@@ -55,20 +55,22 @@ int
 pmc_save_kernel_callchain(uintptr_t *cc, int maxsamples,
     struct trapframe *tf)
 {
+	uintptr_t *osp, *sp;
 	int frames = 0;
-	uintptr_t *sp;
 
 	cc[frames++] = PMC_TRAPFRAME_TO_PC(tf);
 	sp = (uintptr_t *)PMC_TRAPFRAME_TO_FP(tf);
+	osp = NULL;
 
 	for (; frames < maxsamples; frames++) {
-		if (!INKERNEL(sp))
+		if (!INKERNEL(sp) || sp <= osp)
 			break;
 #ifdef __powerpc64__
-		cc[frames++] = sp[2];
+		cc[frames] = sp[2];
 #else
-		cc[frames++] = sp[1];
+		cc[frames] = sp[1];
 #endif
+		osp = sp;
 		sp = (uintptr_t *)*sp;
 	}
 	return (frames);
@@ -184,26 +186,28 @@ int
 pmc_save_user_callchain(uintptr_t *cc, int maxsamples,
     struct trapframe *tf)
 {
-	uintptr_t *sp;
+	uintptr_t *osp, *sp;
 	int frames = 0;
 
 	cc[frames++] = PMC_TRAPFRAME_TO_PC(tf);
 	sp = (uintptr_t *)PMC_TRAPFRAME_TO_FP(tf);
+	osp = NULL;
 
 	for (; frames < maxsamples; frames++) {
-		if (!INUSER(sp))
+		if (!INUSER(sp) || sp <= osp)
 			break;
+		osp = sp;
 #ifdef __powerpc64__
 		/* Check if 32-bit mode. */
 		if (!(tf->srr1 & PSL_SF)) {
-			cc[frames++] = fuword32((uint32_t *)sp + 1);
+			cc[frames] = fuword32((uint32_t *)sp + 1);
 			sp = (uintptr_t *)(uintptr_t)fuword32(sp);
 		} else {
-			cc[frames++] = fuword(sp + 2);
+			cc[frames] = fuword(sp + 2);
 			sp = (uintptr_t *)fuword(sp);
 		}
 #else
-		cc[frames++] = fuword32((uint32_t *)sp + 1);
+		cc[frames] = fuword32((uint32_t *)sp + 1);
 		sp = (uintptr_t *)fuword32(sp);
 #endif
 	}

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 10:49:47 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 798CC574;
 Thu,  3 Jul 2014 10:49:47 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5ADDB2804;
 Thu,  3 Jul 2014 10:49:47 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s63Anl4F081450;
 Thu, 3 Jul 2014 10:49:47 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s63Anl9t081449;
 Thu, 3 Jul 2014 10:49:47 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201407031049.s63Anl9t081449@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Thu, 3 Jul 2014 10:49:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268209 - head/sys/dev/usb/net
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 10:49:47 -0000

Author: hselasky
Date: Thu Jul  3 10:49:46 2014
New Revision: 268209
URL: http://svnweb.freebsd.org/changeset/base/268209

Log:
  - Disable hardware checksumming until it is properly tested.
  - Don't discard frames if the dropped or error flag is set.
  - Don't remove the last 4-bytes of every packet.
  - Add extra range check for data position offset when receiving data.
  
  MFC after:	1 day
  PR:		191432

Modified:
  head/sys/dev/usb/net/if_axge.c

Modified: head/sys/dev/usb/net/if_axge.c
==============================================================================
--- head/sys/dev/usb/net/if_axge.c	Thu Jul  3 08:07:37 2014	(r268208)
+++ head/sys/dev/usb/net/if_axge.c	Thu Jul  3 10:49:46 2014	(r268209)
@@ -123,8 +123,8 @@ static int	axge_attach_post_sub(struct u
 static int	axge_ifmedia_upd(struct ifnet *);
 static void	axge_ifmedia_sts(struct ifnet *, struct ifmediareq *);
 static int	axge_ioctl(struct ifnet *, u_long, caddr_t);
-static int	axge_rx_frame(struct usb_ether *, struct usb_page_cache *, int);
-static int	axge_rxeof(struct usb_ether *, struct usb_page_cache *,
+static void	axge_rx_frame(struct usb_ether *, struct usb_page_cache *, int);
+static void	axge_rxeof(struct usb_ether *, struct usb_page_cache *,
 		    unsigned int, unsigned int, uint32_t);
 static void	axge_csum_cfg(struct usb_ether *);
 
@@ -605,8 +605,7 @@ axge_bulk_read_callback(struct usb_xfer 
 	switch (USB_GET_STATE(xfer)) {
 	case USB_ST_TRANSFERRED:
 		pc = usbd_xfer_get_frame(xfer, 0);
-		if (axge_rx_frame(ue, pc, actlen) != 0)
-			goto tr_setup;
+		axge_rx_frame(ue, pc, actlen);
 
 		/* FALLTHROUGH */
 	case USB_ST_SETUP:
@@ -926,12 +925,11 @@ axge_ioctl(struct ifnet *ifp, u_long cmd
 	return (error);
 }
 
-static int
+static void
 axge_rx_frame(struct usb_ether *ue, struct usb_page_cache *pc, int actlen)
 {
-	int error;
-	int pos;
-	int pkt_cnt;
+	uint32_t pos;
+	uint32_t pkt_cnt;
 	uint32_t rxhdr;
 	uint32_t pkt_hdr;
 	uint32_t hdr_off;
@@ -939,10 +937,9 @@ axge_rx_frame(struct usb_ether *ue, stru
 
 	/* verify we have enough data */
 	if (actlen < (int)sizeof(rxhdr))
-		return (EINVAL);
+		return;
 
 	pos = 0;
-	error = 0;
 
 	usbd_copy_out(pc, actlen - sizeof(rxhdr), &rxhdr, sizeof(rxhdr));
 	rxhdr = le32toh(rxhdr);
@@ -950,35 +947,36 @@ axge_rx_frame(struct usb_ether *ue, stru
 	pkt_cnt = (uint16_t)rxhdr;
 	hdr_off = (uint16_t)(rxhdr >> 16);
 
-	while (pkt_cnt > 0) {
+	while (pkt_cnt--) {
 		/* verify the header offset */
 		if ((int)(hdr_off + sizeof(pkt_hdr)) > actlen) {
-			error = EINVAL;
+			DPRINTF("End of packet headers\n");
+			break;
+		}
+		if ((int)pos >= actlen) {
+			DPRINTF("Data position reached end\n");
 			break;
 		}
 		usbd_copy_out(pc, hdr_off, &pkt_hdr, sizeof(pkt_hdr));
 
 		pkt_hdr = le32toh(pkt_hdr);
 		pktlen = (pkt_hdr >> 16) & 0x1fff;
-		if ((pkt_hdr & AXGE_RXHDR_CRC_ERR) ||
-		    (pkt_hdr & AXGE_RXHDR_DROP_ERR))
+		if (pkt_hdr & (AXGE_RXHDR_CRC_ERR | AXGE_RXHDR_DROP_ERR)) {
+			DPRINTF("Dropped a packet\n");
 			ue->ue_ifp->if_ierrors++;
-		/* verify the data payload */
-		if (pktlen < 6 || (int)(pos + 2 + pktlen - 6) > actlen) {
-			error = EINVAL;
-			break;
 		}
-		axge_rxeof(ue, pc, pos + 2, pktlen - 6, pkt_hdr);
+		if (pktlen >= 2 && (int)(pos + pktlen) <= actlen) {
+			axge_rxeof(ue, pc, pos + 2, pktlen - 2, pkt_hdr);
+		} else {
+			DPRINTF("Invalid packet pos=%d len=%d\n",
+			    (int)pos, (int)pktlen);
+		}
 		pos += (pktlen + 7) & ~7;
 		hdr_off += sizeof(pkt_hdr);
-		pkt_cnt--;
 	}
-	if (error != 0)
-		ue->ue_ifp->if_ierrors++;
-	return (error);
 }
 
-static int
+static void
 axge_rxeof(struct usb_ether *ue, struct usb_page_cache *pc,
     unsigned int offset, unsigned int len, uint32_t pkt_hdr)
 {
@@ -988,37 +986,34 @@ axge_rxeof(struct usb_ether *ue, struct 
 	ifp = ue->ue_ifp;
 	if (len < ETHER_HDR_LEN || len > MCLBYTES - ETHER_ALIGN) {
 		ifp->if_ierrors++;
-		return (EINVAL);
+		return;
 	}
 
 	m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
 	if (m == NULL) {
 		ifp->if_iqdrops++;
-		return (ENOMEM);
+		return;
 	}
-	m->m_len = m->m_pkthdr.len = MCLBYTES;
+	m->m_pkthdr.rcvif = ifp;
+	m->m_len = m->m_pkthdr.len = len + ETHER_ALIGN;
 	m_adj(m, ETHER_ALIGN);
 
 	usbd_copy_out(pc, offset, mtod(m, uint8_t *), len);
 
 	ifp->if_ipackets++;
-	m->m_pkthdr.rcvif = ifp;
-	m->m_pkthdr.len = m->m_len = len;
-
+#if 0
 	if ((pkt_hdr & (AXGE_RXHDR_L4CSUM_ERR | AXGE_RXHDR_L3CSUM_ERR)) == 0) {
-		m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED | CSUM_IP_VALID;
 		if ((pkt_hdr & AXGE_RXHDR_L4_TYPE_MASK) ==
 		    AXGE_RXHDR_L4_TYPE_TCP ||
 		    (pkt_hdr & AXGE_RXHDR_L4_TYPE_MASK) ==
 		    AXGE_RXHDR_L4_TYPE_UDP) {
 			m->m_pkthdr.csum_flags |= CSUM_DATA_VALID |
-			    CSUM_PSEUDO_HDR;
+			    CSUM_PSEUDO_HDR | CSUM_IP_CHECKED | CSUM_IP_VALID;
 			m->m_pkthdr.csum_data = 0xffff;
 		}
 	}
-
+#endif
 	_IF_ENQUEUE(&ue->ue_rxq, m);
-	return (0);
 }
 
 static void

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 11:06:28 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 54264B2F;
 Thu,  3 Jul 2014 11:06:28 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 28F652A0B;
 Thu,  3 Jul 2014 11:06:28 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s63B6Stm090424;
 Thu, 3 Jul 2014 11:06:28 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s63B6SRS090423;
 Thu, 3 Jul 2014 11:06:28 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201407031106.s63B6SRS090423@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 3 Jul 2014 11:06:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268211 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 11:06:28 -0000

Author: kib
Date: Thu Jul  3 11:06:27 2014
New Revision: 268211
URL: http://svnweb.freebsd.org/changeset/base/268211

Log:
  Micro-manage clang to get the expected inlining for cpu_search().
  Mark cpu_search_lowest/cpu_search_highest/cpu_search_both as noinline,
  while cpu_search() gets always_inline.  With the attributes set,
  cpu_search() is inlined in wrappers, and if()s with constant
  conditionals are optimized.
  
  On some tests on many-core machine, the hwpmc reported samples for
  cpu_search*() are reduced from 25% total to 9%.
  
  Submitted by:	"Rang, Anton" 
  MFC after:	1 week

Modified:
  head/sys/kern/sched_ule.c

Modified: head/sys/kern/sched_ule.c
==============================================================================
--- head/sys/kern/sched_ule.c	Thu Jul  3 10:59:42 2014	(r268210)
+++ head/sys/kern/sched_ule.c	Thu Jul  3 11:06:27 2014	(r268211)
@@ -622,12 +622,14 @@ struct cpu_search {
 	for ((cpu) = 0; (cpu) <= mp_maxid; (cpu)++)		\
 		if (CPU_ISSET(cpu, &mask))
 
-static __inline int cpu_search(const struct cpu_group *cg, struct cpu_search *low,
-    struct cpu_search *high, const int match);
-int cpu_search_lowest(const struct cpu_group *cg, struct cpu_search *low);
-int cpu_search_highest(const struct cpu_group *cg, struct cpu_search *high);
-int cpu_search_both(const struct cpu_group *cg, struct cpu_search *low,
+static __always_inline int cpu_search(const struct cpu_group *cg,
+    struct cpu_search *low, struct cpu_search *high, const int match);
+int __noinline cpu_search_lowest(const struct cpu_group *cg,
+    struct cpu_search *low);
+int __noinline cpu_search_highest(const struct cpu_group *cg,
     struct cpu_search *high);
+int __noinline cpu_search_both(const struct cpu_group *cg,
+    struct cpu_search *low, struct cpu_search *high);
 
 /*
  * Search the tree of cpu_groups for the lowest or highest loaded cpu
@@ -640,7 +642,7 @@ int cpu_search_both(const struct cpu_gro
  * match argument.  It is reduced to the minimum set for each case.  It is
  * also recursive to the depth of the tree.
  */
-static __inline int
+static __always_inline int
 cpu_search(const struct cpu_group *cg, struct cpu_search *low,
     struct cpu_search *high, const int match)
 {

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 11:19:17 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 22026FD1;
 Thu,  3 Jul 2014 11:19:17 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 028D22B11;
 Thu,  3 Jul 2014 11:19:17 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s63BJGKi095836;
 Thu, 3 Jul 2014 11:19:16 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s63BJGFn095835;
 Thu, 3 Jul 2014 11:19:16 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201407031119.s63BJGFn095835@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 3 Jul 2014 11:19:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268212 - head/lib/libc/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 11:19:17 -0000

Author: kib
Date: Thu Jul  3 11:19:16 2014
New Revision: 268212
URL: http://svnweb.freebsd.org/changeset/base/268212

Log:
  Note that most errors are possible for all syscalls from utimes(2)
  family.  Minor wording corrections.
  
  Based on the suggestions by bde.
  
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/lib/libc/sys/utimes.2

Modified: head/lib/libc/sys/utimes.2
==============================================================================
--- head/lib/libc/sys/utimes.2	Thu Jul  3 11:06:27 2014	(r268211)
+++ head/lib/libc/sys/utimes.2	Thu Jul  3 11:19:16 2014	(r268212)
@@ -30,7 +30,7 @@
 .\"     @(#)utimes.2	8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd April 10, 2008
+.Dd July 3, 2014
 .Dt UTIMES 2
 .Os
 .Sh NAME
@@ -119,22 +119,18 @@ is passed the special value
 .Dv AT_FDCWD
 in the
 .Fa fd
-parameter, the current working directory is used and the behavior is identical to
-a call to
+parameter, the current working directory is used and the behavior
+is identical to a call to
 .Fn utimes .
 .Sh RETURN VALUES
 .Rv -std
 .Sh ERRORS
-The
-.Fn utimes
-and
-.Fn lutimes
-system calls
-will fail if:
+All of the system call will fail if:
 .Bl -tag -width Er
 .It Bq Er EACCES
-Search permission is denied for a component of the path prefix;
-or the
+Search permission is denied for a component of the path prefix.
+.It Bq Er EACCES
+The
 .Fa times
 argument is
 .Dv NULL
@@ -148,6 +144,17 @@ or
 .Fa times
 argument
 points outside the process's allocated address space.
+.It Bq Er EFAULT
+The
+.Fa times
+argument
+points outside the process's allocated address space.
+.It Bq Er EINVAL
+The
+.Va tv_usec
+component of at least one of the values specified by the
+.Fa times
+argument has a value less than 0 or greater than 999999.
 .It Bq Er EIO
 An I/O error occurred while reading or writing the affected inode.
 .It Bq Er ELOOP
@@ -170,7 +177,8 @@ argument is not
 and the calling process's effective user ID
 does not match the owner of the file and is not the super-user.
 .It Bq Er EPERM
-The named file has its immutable or append-only flag set, see the
+The named file has its immutable or append-only flags set.
+See the
 .Xr chflags 2
 manual page for more information.
 .It Bq Er EROFS
@@ -189,40 +197,6 @@ argument
 does not refer to a valid descriptor.
 .El
 .Pp
-All of the system calls will fail if:
-.Bl -tag -width Er
-.It Bq Er EACCES
-The
-.Fa times
-argument is
-.Dv NULL
-and the effective user ID of the process does not
-match the owner of the file, and is not the super-user, and write
-access is denied.
-.It Bq Er EFAULT
-The
-.Fa times
-argument
-points outside the process's allocated address space.
-.It Bq Er EINVAL
-The
-.Va tv_usec
-component of at least one of the values specified by the
-.Fa times
-argument has a value less than 0 or greater than 999999.
-.It Bq Er EIO
-An I/O error occurred while reading or writing the affected inode.
-.It Bq Er EPERM
-The
-.Fa times
-argument is not
-.Dv NULL
-and the calling process's effective user ID
-does not match the owner of the file and is not the super-user.
-.It Bq Er EROFS
-The file system containing the file is mounted read-only.
-.El
-.Pp
 In addition to the errors returned by the
 .Fn utimes ,
 the

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 13:51:11 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 00E5955E;
 Thu,  3 Jul 2014 13:51:10 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E26502A7F;
 Thu,  3 Jul 2014 13:51:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s63DpArq067840;
 Thu, 3 Jul 2014 13:51:10 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s63DpAGk067839;
 Thu, 3 Jul 2014 13:51:10 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201407031351.s63DpAGk067839@svn.freebsd.org>
From: Ed Maste 
Date: Thu, 3 Jul 2014 13:51:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268215 - head/share/man/man4
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 13:51:11 -0000

Author: emaste
Date: Thu Jul  3 13:51:10 2014
New Revision: 268215
URL: http://svnweb.freebsd.org/changeset/base/268215

Log:
  Describe kern.vty sc/vt tunable in syscons(4)
  
  Reviewed by:	wblock

Modified:
  head/share/man/man4/syscons.4

Modified: head/share/man/man4/syscons.4
==============================================================================
--- head/share/man/man4/syscons.4	Thu Jul  3 13:49:43 2014	(r268214)
+++ head/share/man/man4/syscons.4	Thu Jul  3 13:51:10 2014	(r268215)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 11, 2009
+.Dd July 3, 2014
 .Dt SYSCONS 4
 .Os
 .Sh NAME
@@ -62,6 +62,10 @@ In
 .Pa /boot/device.hints :
 .Cd hint.sc.0.at="isa"
 .Cd hint.sc.0.vesa_mode=0x103
+.Pp
+In
+.Pa /boot/loader.conf :
+.Cd kern.vty=sc
 .Sh DESCRIPTION
 The
 .Nm
@@ -448,6 +452,26 @@ This option instructs the syscons driver
 for a keyboard device if it is not currently attached to one.
 Otherwise, the driver only probes for a keyboard once during bootup.
 .El
+.Ss Loader Tunables
+These settings can be entered at the
+.Xr loader 8
+prompt or in
+.Xr loader.conf 5 .
+.Bl -tag -width indent
+.It Va kern.vty
+When both
+.Nm
+and
+.Xr vt 4
+have been compiled into the kernel, the one to use for the system console can
+be selected by setting this variable to
+.Ql sc
+or
+.Ql vt .
+If not set,
+.Nm
+provides the default system console.
+.El
 .Sh FILES
 .Bl -tag -width /usr/share/syscons/xxxxyyyyzzz -compact
 .It Pa /dev/console

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 17:37:00 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8835D5F5;
 Thu,  3 Jul 2014 17:37:00 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5B32021D7;
 Thu,  3 Jul 2014 17:37:00 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s63Hb0Ol079242;
 Thu, 3 Jul 2014 17:37:00 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s63Hb0DH079233;
 Thu, 3 Jul 2014 17:37:00 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201407031737.s63Hb0DH079233@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Thu, 3 Jul 2014 17:36:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268224 - in
 head/sys/cddl/contrib/opensolaris/uts/common: dtrace sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 17:37:00 -0000

Author: pfg
Date: Thu Jul  3 17:36:59 2014
New Revision: 268224
URL: http://svnweb.freebsd.org/changeset/base/268224

Log:
  Merge from OpenSolaris (20-Apr-2008):
  
  6822482 DOF validation needs to handle loadable sections flagged as unloadable
  
  MFC after:	1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Thu Jul  3 17:35:01 2014	(r268223)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Thu Jul  3 17:36:59 2014	(r268224)
@@ -9774,7 +9774,7 @@ dtrace_difo_validate(dtrace_difo_t *dp, 
 			break;
 
 		default:
-			err += efunc(dp->dtdo_len - 1, "bad return size");
+			err += efunc(dp->dtdo_len - 1, "bad return size\n");
 		}
 	}
 
@@ -13718,6 +13718,13 @@ dtrace_dof_slurp(dof_hdr_t *dof, dtrace_
 			}
 		}
 
+		if (DOF_SEC_ISLOADABLE(sec->dofs_type) &&
+		    !(sec->dofs_flags & DOF_SECF_LOAD)) {
+			dtrace_dof_error(dof, "loadable section with load "
+			    "flag unset");
+			return (-1);
+		}
+
 		if (!(sec->dofs_flags & DOF_SECF_LOAD))
 			continue; /* just ignore non-loadable sections */
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h	Thu Jul  3 17:35:01 2014	(r268223)
+++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h	Thu Jul  3 17:36:59 2014	(r268224)
@@ -727,6 +727,20 @@ typedef struct dof_sec {
 
 #define	DOF_SECF_LOAD		1	/* section should be loaded */
 
+#define	DOF_SEC_ISLOADABLE(x)						\
+	(((x) == DOF_SECT_ECBDESC) || ((x) == DOF_SECT_PROBEDESC) ||	\
+	((x) == DOF_SECT_ACTDESC) || ((x) == DOF_SECT_DIFOHDR) ||	\
+	((x) == DOF_SECT_DIF) || ((x) == DOF_SECT_STRTAB) ||		\
+	((x) == DOF_SECT_VARTAB) || ((x) == DOF_SECT_RELTAB) ||		\
+	((x) == DOF_SECT_TYPTAB) || ((x) == DOF_SECT_URELHDR) ||	\
+	((x) == DOF_SECT_KRELHDR) || ((x) == DOF_SECT_OPTDESC) ||	\
+	((x) == DOF_SECT_PROVIDER) || ((x) == DOF_SECT_PROBES) ||	\
+	((x) == DOF_SECT_PRARGS) || ((x) == DOF_SECT_PROFFS) ||		\
+	((x) == DOF_SECT_INTTAB) || ((x) == DOF_SECT_XLTAB) ||		\
+	((x) == DOF_SECT_XLMEMBERS) || ((x) == DOF_SECT_XLIMPORT) ||	\
+	((x) == DOF_SECT_XLIMPORT) || ((x) == DOF_SECT_XLEXPORT) ||	\
+	((x) == DOF_SECT_PREXPORT) || ((x) == DOF_SECT_PRENOFFS))
+
 typedef struct dof_ecbdesc {
 	dof_secidx_t dofe_probes;	/* link to DOF_SECT_PROBEDESC */
 	dof_secidx_t dofe_pred;		/* link to DOF_SECT_DIFOHDR */

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 17:53:29 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 000A9F26;
 Thu,  3 Jul 2014 17:53:28 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E19BC2396;
 Thu,  3 Jul 2014 17:53:28 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s63HrSIw088393;
 Thu, 3 Jul 2014 17:53:28 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s63HrSjq088392;
 Thu, 3 Jul 2014 17:53:28 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201407031753.s63HrSjq088392@svn.freebsd.org>
From: Ed Maste 
Date: Thu, 3 Jul 2014 17:53:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268227 - head/sys/boot/amd64/efi
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 17:53:29 -0000

Author: emaste
Date: Thu Jul  3 17:53:28 2014
New Revision: 268227
URL: http://svnweb.freebsd.org/changeset/base/268227

Log:
  Display efi framebuffer dimensions on boot
  
  The EFI framebuffer produces corrupted output on certain systems.  For
  now display the framebuffer parameters (address, dimensions, etc.) on
  boot to aid in tracking down these issues.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/boot/amd64/efi/bootinfo.c

Modified: head/sys/boot/amd64/efi/bootinfo.c
==============================================================================
--- head/sys/boot/amd64/efi/bootinfo.c	Thu Jul  3 17:42:26 2014	(r268226)
+++ head/sys/boot/amd64/efi/bootinfo.c	Thu Jul  3 17:53:28 2014	(r268227)
@@ -225,8 +225,15 @@ bi_load_efi_data(struct preloaded_file *
 	struct efi_map_header *efihdr;
 	struct efi_fb efifb;
 
-	if (efi_find_framebuffer(&efifb) == 0)
+	if (efi_find_framebuffer(&efifb) == 0) {
+		printf("EFI framebuffer information:\n");
+		printf("addr, size     0x%lx, 0x%lx\n", efifb.fb_addr, efifb.fb_size);
+		printf("dimensions     %d x %d\n", efifb.fb_width, efifb.fb_height);
+		printf("stride         %d\n", efifb.fb_stride);
+		printf("masks          0x%08x, 0x%08x, 0x%08x, 0x%08x\n", efifb.fb_mask_red, efifb.fb_mask_green, efifb.fb_mask_blue, efifb.fb_mask_reserved);
+
 		file_addmetadata(kfp, MODINFOMD_EFI_FB, sizeof(efifb), &efifb);
+	}
 
 	efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf;
 

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 19:07:38 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6660BA34;
 Thu,  3 Jul 2014 19:07:38 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 535B529F3;
 Thu,  3 Jul 2014 19:07:38 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s63J7cBx023866;
 Thu, 3 Jul 2014 19:07:38 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s63J7bLa023863;
 Thu, 3 Jul 2014 19:07:37 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201407031907.s63J7bLa023863@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Thu, 3 Jul 2014 19:07:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268230 -
 head/sys/cddl/contrib/opensolaris/uts/common/dtrace
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 19:07:38 -0000

Author: pfg
Date: Thu Jul  3 19:07:37 2014
New Revision: 268230
URL: http://svnweb.freebsd.org/changeset/base/268230

Log:
  Merge from OpenSolaris (22-Apr-2008):
  
  6823388 DTrace ioctl handlers must validate all structure members
  
  MFC after:	1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Thu Jul  3 18:24:28 2014	(r268229)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Thu Jul  3 19:07:37 2014	(r268230)
@@ -12908,7 +12908,8 @@ dtrace_dof_copyin(uintptr_t uarg, int *e
 
 	dof = kmem_alloc(hdr.dofh_loadsz, KM_SLEEP);
 
-	if (copyin((void *)uarg, dof, hdr.dofh_loadsz) != 0) {
+	if (copyin((void *)uarg, dof, hdr.dofh_loadsz) != 0 ||
+	    dof->dofh_loadsz != hdr.dofh_loadsz) {
 		kmem_free(dof, hdr.dofh_loadsz);
 		*errp = EFAULT;
 		return (NULL);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c	Thu Jul  3 18:24:28 2014	(r268229)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c	Thu Jul  3 19:07:37 2014	(r268230)
@@ -2277,7 +2277,8 @@ fasttrap_ioctl(struct cdev *dev, u_long 
 
 		probe = kmem_alloc(size, KM_SLEEP);
 
-		if (copyin(uprobe, probe, size) != 0) {
+		if (copyin(uprobe, probe, size) != 0 ||
+		    probe->ftps_noffs != noffs) {
 			kmem_free(probe, size);
 			return (EFAULT);
 		}

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 19:25:24 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id CE37C1E5;
 Thu,  3 Jul 2014 19:25:24 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BB2A12B95;
 Thu,  3 Jul 2014 19:25:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s63JPO23033237;
 Thu, 3 Jul 2014 19:25:24 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s63JPOWW033236;
 Thu, 3 Jul 2014 19:25:24 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201407031925.s63JPOWW033236@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Thu, 3 Jul 2014 19:25:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268231 -
 head/sys/cddl/contrib/opensolaris/uts/common/dtrace
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 19:25:24 -0000

Author: pfg
Date: Thu Jul  3 19:25:24 2014
New Revision: 268231
URL: http://svnweb.freebsd.org/changeset/base/268231

Log:
  Merge from OpenSolaris (30-Jun-2009):
  
  6851093 system drops to kmdb with anonymous dtrace probes + kmdb
  
  This has no effect on FreeBSD (code is ifdef'ed) but is useful as
  reference for future merges.
  
  MFC after:	1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Thu Jul  3 19:07:37 2014	(r268230)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Thu Jul  3 19:25:24 2014	(r268231)
@@ -16750,7 +16750,7 @@ dtrace_open(struct cdev *dev, int oflags
 
 	if (state == NULL) {
 #if defined(sun)
-		if (--dtrace_opens == 0)
+		if (--dtrace_opens == 0 && dtrace_anon.dta_enabling == NULL)
 			(void) kdi_dtrace_set(KDI_DTSET_DTRACE_DEACTIVATE);
 #else
 		--dtrace_opens;
@@ -16806,7 +16806,11 @@ dtrace_dtr(void *data)
 
 	ASSERT(dtrace_opens > 0);
 #if defined(sun)
-	if (--dtrace_opens == 0)
+	/*
+	 * Only relinquish control of the kernel debugger interface when there
+	 * are no consumers and no anonymous enablings.
+	 */
+	if (--dtrace_opens == 0 && dtrace_anon.dta_enabling == NULL)
 		(void) kdi_dtrace_set(KDI_DTSET_DTRACE_DEACTIVATE);
 #else
 	--dtrace_opens;

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 19:37:26 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 251C53FC;
 Thu,  3 Jul 2014 19:37:26 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 12A472C74;
 Thu,  3 Jul 2014 19:37:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s63JbPot038032;
 Thu, 3 Jul 2014 19:37:25 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s63JbPf2038031;
 Thu, 3 Jul 2014 19:37:25 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201407031937.s63JbPf2038031@svn.freebsd.org>
From: Glen Barber 
Date: Thu, 3 Jul 2014 19:37:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268232 - head/release/arm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 19:37:26 -0000

Author: gjb
Date: Thu Jul  3 19:37:25 2014
New Revision: 268232
URL: http://svnweb.freebsd.org/changeset/base/268232

Log:
  The u-boot tarball needed for some boards, BEAGLEBONE for
  example, explicitly hard-code gcc(1) as the compiler.
  
  Partially revert r264703, which did a post-chroot install
  of gcc(1).  This was initially removed because gcc(1) fails
  to build usr.bin/dtc/ causing the xdev target to fail.  So
  this time, move the gcc(1) installation after xdev is built.
  
  This change is likely applicable to stable/10 arm build
  failures, as well.
  
  MFC after:	3 days
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/release/arm/release.sh

Modified: head/release/arm/release.sh
==============================================================================
--- head/release/arm/release.sh	Thu Jul  3 19:25:24 2014	(r268231)
+++ head/release/arm/release.sh	Thu Jul  3 19:37:25 2014	(r268232)
@@ -111,6 +111,9 @@ main() {
 			BATCH=1 FORCE_PKG_REGISTER=1 install clean distclean
 	done
 
+	eval chroot ${CHROOTDIR} make -C /usr/src/gnu/usr.bin/cc \
+		WITH_GCC=1 ${WORLD_FLAGS} -j1 obj depend all install
+
 	mkdir -p ${CHROOTDIR}/tmp/crochet/work
 	before_build
 	install_crochet

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 19:50:51 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6D2C476C;
 Thu,  3 Jul 2014 19:50:51 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4E2352D76;
 Thu,  3 Jul 2014 19:50:51 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s63JopjO043433;
 Thu, 3 Jul 2014 19:50:51 GMT (envelope-from loos@svn.freebsd.org)
Received: (from loos@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s63JopbC043432;
 Thu, 3 Jul 2014 19:50:51 GMT (envelope-from loos@svn.freebsd.org)
Message-Id: <201407031950.s63JopbC043432@svn.freebsd.org>
From: Luiz Otavio O Souza 
Date: Thu, 3 Jul 2014 19:50:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268233 - head/sys/dev/etherswitch/rtl8366
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 19:50:51 -0000

Author: loos
Date: Thu Jul  3 19:50:50 2014
New Revision: 268233
URL: http://svnweb.freebsd.org/changeset/base/268233

Log:
  Initialize the switch vlan table at attachment.
  
  Update some comments on code, specifying the correct vlans used on switch
  setup.
  
  Advertise the proper switch operation mode (the rtl8366rb only support
  dot1q vlans).
  
  This fixes the breakage that i introduced on r249752 and make the rtl8366rb
  switch works again with etherswitchcfg(8).
  
  Tested on TP-Link 1043ND.
  
  Tested by:	me, Harm Weites (harm at weites.com)

Modified:
  head/sys/dev/etherswitch/rtl8366/rtl8366rb.c

Modified: head/sys/dev/etherswitch/rtl8366/rtl8366rb.c
==============================================================================
--- head/sys/dev/etherswitch/rtl8366/rtl8366rb.c	Thu Jul  3 19:37:25 2014	(r268232)
+++ head/sys/dev/etherswitch/rtl8366/rtl8366rb.c	Thu Jul  3 19:50:50 2014	(r268233)
@@ -75,7 +75,8 @@ struct rtl8366rb_softc {
 static etherswitch_info_t etherswitch_info = {
 	.es_nports =		RTL8366RB_NUM_PORTS,
 	.es_nvlangroups =	RTL8366RB_NUM_VLANS,
-	.es_name =			"Realtek RTL8366RB"
+	.es_name =		"Realtek RTL8366RB",
+	.es_vlan_caps =		ETHERSWITCH_VLAN_DOT1Q,
 };
 
 #define RTL_LOCK(_sc)	mtx_lock(&(_sc)->sc_mtx)
@@ -148,6 +149,9 @@ rtl8366rb_probe(device_t dev)
 static void
 rtl8366rb_init(device_t dev)
 {
+	int i;
+	struct rtl8366rb_softc *sc;
+
 	/* Initialisation for TL-WR1043ND */
 	smi_rmw(dev, RTL8366RB_RCR,
 		RTL8366RB_RCR_HARD_RESET,
@@ -157,17 +161,21 @@ rtl8366rb_init(device_t dev)
 	smi_rmw(dev, RTL8366RB_SGCR,
 		RTL8366RB_SGCR_EN_VLAN | RTL8366RB_SGCR_EN_VLAN_4KTB,
 		RTL8366RB_SGCR_EN_VLAN, RTL_WAITOK);
-	/* remove port 0 form VLAN 0 */
+	/* Initialize our vlan table. */
+	sc = device_get_softc(dev);
+	for (i = 0; i <= 1; i++)
+		sc->vid[i] = (i + 1) | ETHERSWITCH_VID_VALID;
+	/* Remove port 0 from VLAN 1. */
 	smi_rmw(dev, RTL8366RB_VMCR(RTL8366RB_VMCR_MU_REG, 0),
 		(1 << 0), 0, RTL_WAITOK);
-	/* add port 0 untagged and port 5 tagged to VLAN 1 */
+	/* Add port 0 untagged and port 5 tagged to VLAN 2. */
 	smi_rmw(dev, RTL8366RB_VMCR(RTL8366RB_VMCR_MU_REG, 1),
 		((1 << 5 | 1 << 0) << RTL8366RB_VMCR_MU_MEMBER_SHIFT)
 			| ((1 << 5 | 1 << 0) << RTL8366RB_VMCR_MU_UNTAG_SHIFT),
 		((1 << 5 | 1 << 0) << RTL8366RB_VMCR_MU_MEMBER_SHIFT
 			| ((1 << 0) << RTL8366RB_VMCR_MU_UNTAG_SHIFT)),
 		RTL_WAITOK);
-	/* set PVLAN 1 for port 0 */
+	/* Set PVID 2 for port 0. */
 	smi_rmw(dev, RTL8366RB_PVCR_REG(0),
 		RTL8366RB_PVCR_VAL(0, RTL8366RB_PVCR_PORT_MASK),
 		RTL8366RB_PVCR_VAL(0, 1), RTL_WAITOK);
@@ -560,7 +568,7 @@ rtl_getport(device_t dev, etherswitch_po
 	sc = device_get_softc(dev);
 	vlangroup = RTL8366RB_PVCR_GET(p->es_port,
 		rtl_readreg(dev, RTL8366RB_PVCR_REG(p->es_port)));
-	p->es_pvid = sc->vid[vlangroup];
+	p->es_pvid = sc->vid[vlangroup] & ETHERSWITCH_VID_MASK;
 	
 	if (p->es_port < RTL8366RB_NUM_PHYS) {
 		mii = device_get_softc(sc->miibus[p->es_port]);
@@ -595,7 +603,7 @@ rtl_setport(device_t dev, etherswitch_po
 	sc = device_get_softc(dev);
 	vlangroup = -1;
 	for (i = 0; i < RTL8366RB_NUM_VLANS; i++) {
-		if (sc->vid[i] == p->es_pvid) {
+		if ((sc->vid[i] & ETHERSWITCH_VID_MASK) == p->es_pvid) {
 			vlangroup = i;
 			break;
 		}
@@ -618,13 +626,15 @@ rtl_setport(device_t dev, etherswitch_po
 static int
 rtl_getvgroup(device_t dev, etherswitch_vlangroup_t *vg)
 {
+	struct rtl8366rb_softc *sc;
 	uint16_t vmcr[3];
 	int i;
 	
 	for (i=0; i<3; i++)
 		vmcr[i] = rtl_readreg(dev, RTL8366RB_VMCR(i, vg->es_vlangroup));
 		
-	vg->es_vid = RTL8366RB_VMCR_VID(vmcr) | ETHERSWITCH_VID_VALID;
+	sc = device_get_softc(dev);
+	vg->es_vid = sc->vid[vg->es_vlangroup];
 	vg->es_member_ports = RTL8366RB_VMCR_MEMBER(vmcr);
 	vg->es_untagged_ports = RTL8366RB_VMCR_UNTAG(vmcr);
 	vg->es_fid = RTL8366RB_VMCR_FID(vmcr);
@@ -639,6 +649,10 @@ rtl_setvgroup(device_t dev, etherswitch_
 
 	sc = device_get_softc(dev);
 	sc->vid[g] = vg->es_vid;
+	/* VLAN group disabled ? */
+	if (vg->es_member_ports == 0 && vg->es_untagged_ports == 0 && vg->es_vid == 0)
+		return (0);
+	sc->vid[g] |= ETHERSWITCH_VID_VALID;
 	rtl_writereg(dev, RTL8366RB_VMCR(RTL8366RB_VMCR_DOT1Q_REG, g),
 		(vg->es_vid << RTL8366RB_VMCR_DOT1Q_VID_SHIFT) & RTL8366RB_VMCR_DOT1Q_VID_MASK);
 	rtl_writereg(dev, RTL8366RB_VMCR(RTL8366RB_VMCR_MU_REG, g),
@@ -650,6 +664,17 @@ rtl_setvgroup(device_t dev, etherswitch_
 }
 
 static int
+rtl_getconf(device_t dev, etherswitch_conf_t *conf)
+{
+
+	/* Return the VLAN mode. */
+	conf->cmd = ETHERSWITCH_CONF_VLAN_MODE;
+	conf->vlan_mode = ETHERSWITCH_VLAN_DOT1Q;
+
+	return (0);
+}
+
+static int
 rtl_readphy(device_t dev, int phy, int reg)
 {
 	struct rtl8366rb_softc *sc = device_get_softc(dev);
@@ -748,6 +773,7 @@ static device_method_t rtl8366rb_methods
 	DEVMETHOD(miibus_writereg,	rtl_writephy),
 
 	/* etherswitch interface */
+	DEVMETHOD(etherswitch_getconf,	rtl_getconf),
 	DEVMETHOD(etherswitch_getinfo,	rtl_getinfo),
 	DEVMETHOD(etherswitch_readreg,	rtl_readreg),
 	DEVMETHOD(etherswitch_writereg,	rtl_writereg),

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 19:52:11 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E52B08CF;
 Thu,  3 Jul 2014 19:52:11 +0000 (UTC)
Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 6069E2E01;
 Thu,  3 Jul 2014 19:52:10 +0000 (UTC)
Received: from alchemy.franken.de (localhost [127.0.0.1])
 by alchemy.franken.de (8.14.8/8.14.8/ALCHEMY.FRANKEN.DE) with ESMTP id
 s63Jq8PD003458
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Thu, 3 Jul 2014 21:52:08 +0200 (CEST)
 (envelope-from marius@alchemy.franken.de)
Received: (from marius@localhost)
 by alchemy.franken.de (8.14.8/8.14.8/Submit) id s63Jq8H5003457;
 Thu, 3 Jul 2014 21:52:08 +0200 (CEST) (envelope-from marius)
Date: Thu, 3 Jul 2014 21:52:08 +0200
From: Marius Strobl 
To: Nathan Whitehorn 
Subject: Re: svn commit: r268173 - head/sys/conf
Message-ID: <20140703195208.GE69016@alchemy.franken.de>
References: <201407021946.s62JkgHo051426@svn.freebsd.org>
 <53B465E0.1040309@freebsd.org>
 <20140702202813.GB69016@alchemy.franken.de>
 <53B46BF6.6040205@freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <53B46BF6.6040205@freebsd.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3
 (alchemy.franken.de [0.0.0.0]); Thu, 03 Jul 2014 21:52:08 +0200 (CEST)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 19:52:12 -0000

On Wed, Jul 02, 2014 at 01:30:46PM -0700, Nathan Whitehorn wrote:
> 
> On 07/02/14 13:28, Marius Strobl wrote:
> > On Wed, Jul 02, 2014 at 01:04:48PM -0700, Nathan Whitehorn wrote:
> >> It worked at least on my Ultra 5 -- though probably because the ATI
> >> Mach64 FCode ROM there is substantially shared with the Mac version. It
> >> was even reasonably fast. But regardless of whether it's a generally
> >> useful console driver on SPARC, at least it proves that vt(4) works fine.
> > As for vt(4), it at least needs to be taught about the differences
> > between virtual, physical and bus address with a clue bat. Among
> > other problems, similar things hold for the #ifdef'ed sparc64 code
> > of ofwfb(4) in combination with the accesses it does. I guess it
> > only had a chance of working on your machine because its firmware
> > is kind enough to map the framebuffer in (which not all machine
> > models do) in the first place _and_ in a special way/location so
> > accesses didn't blow. Anyway, even when going the ofwfb(4) route,
> > doing reads and writes via bus_space(9) will be noticeably faster
> > than going through the MMU on sparc64.
> 
> Yeah, the firmware there is pretty kind. I just wanted to make sure we 
> were on the same page. The vt core does not require any changes, I 
> think: it's just that you need new drivers for mach64 and, especially, 
> creator.

Well, at least dev/fb/fbd.c committed as part of vt(4) should need some
fixes and enhancements to work on sparc64 when it comes to running X.
But yes, ofwfb(4) being PCI-centric is yet another problem.

Marius


From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 20:16:49 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 08BB8283;
 Thu,  3 Jul 2014 20:16:49 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EA2E72FE6;
 Thu,  3 Jul 2014 20:16:48 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s63KGm6j059018;
 Thu, 3 Jul 2014 20:16:48 GMT (envelope-from loos@svn.freebsd.org)
Received: (from loos@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s63KGmlu059017;
 Thu, 3 Jul 2014 20:16:48 GMT (envelope-from loos@svn.freebsd.org)
Message-Id: <201407032016.s63KGmlu059017@svn.freebsd.org>
From: Luiz Otavio O Souza 
Date: Thu, 3 Jul 2014 20:16:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268235 - head/sys/mips/atheros
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 20:16:49 -0000

Author: loos
Date: Thu Jul  3 20:16:48 2014
New Revision: 268235
URL: http://svnweb.freebsd.org/changeset/base/268235

Log:
  Properly advertise that if_arge can handle long frames (if_arge is set to
  handle packets up to 1536 bytes)
  
  This fixes the need to frag that could happen when using vlans on top of
  if_arge (which is a common case for the use the switch ports as individual
  NICs).
  
  Previously to this commit any vlan setup with if_arge as parent would have
  the MTU of the parent interface reduced by the size of dot1q header
  (4 bytes).
  
  Tested on TP-Link 1043ND (where the WAN port is just a switch port setup to
  tag packets in a different VLAN than the LAN ports).
  
  Reported and tested by:	Harm Weites (harm at weites.com)

Modified:
  head/sys/mips/atheros/if_arge.c

Modified: head/sys/mips/atheros/if_arge.c
==============================================================================
--- head/sys/mips/atheros/if_arge.c	Thu Jul  3 20:10:30 2014	(r268234)
+++ head/sys/mips/atheros/if_arge.c	Thu Jul  3 20:16:48 2014	(r268235)
@@ -703,6 +703,9 @@ arge_attach(device_t dev)
 	ifp->if_snd.ifq_maxlen = ifqmaxlen;
 	IFQ_SET_READY(&ifp->if_snd);
 
+	/* Tell the upper layer(s) we support long frames. */
+	ifp->if_capabilities |= IFCAP_VLAN_MTU;
+
 	ifp->if_capenable = ifp->if_capabilities;
 #ifdef DEVICE_POLLING
 	ifp->if_capabilities |= IFCAP_POLLING;

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 20:31:45 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9C92E869;
 Thu,  3 Jul 2014 20:31:45 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8859321D5;
 Thu,  3 Jul 2014 20:31:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s63KVjOW067327;
 Thu, 3 Jul 2014 20:31:45 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s63KVh4E067310;
 Thu, 3 Jul 2014 20:31:43 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201407032031.s63KVh4E067310@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Thu, 3 Jul 2014 20:31:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268236 - head/usr.bin/mkimg
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 20:31:45 -0000

Author: marcel
Date: Thu Jul  3 20:31:43 2014
New Revision: 268236
URL: http://svnweb.freebsd.org/changeset/base/268236

Log:
  Add VHD support to mkimg(1). VHD is used by Xen and Microsoft's Hyper-V
  among others.
  
  Add an undocumented option for unit testing (-y). When given, the image
  will have UUIDs and timestamps synthesized in a way that gives identical
  results across runs. As such, UUIDs stop being unique, globally or
  otherwise.
  
  VHD support requested by: gjb@

Added:
  head/usr.bin/mkimg/vhd.c
     - copied unchanged from r268229, user/marcel/mkimg/vhd.c
Modified:
  head/usr.bin/mkimg/Makefile
  head/usr.bin/mkimg/gpt.c
  head/usr.bin/mkimg/image.c
  head/usr.bin/mkimg/image.h
  head/usr.bin/mkimg/mkimg.c
  head/usr.bin/mkimg/mkimg.h
  head/usr.bin/mkimg/raw.c
  head/usr.bin/mkimg/vmdk.c
Directory Properties:
  head/usr.bin/mkimg/   (props changed)

Modified: head/usr.bin/mkimg/Makefile
==============================================================================
--- head/usr.bin/mkimg/Makefile	Thu Jul  3 20:16:48 2014	(r268235)
+++ head/usr.bin/mkimg/Makefile	Thu Jul  3 20:31:43 2014	(r268236)
@@ -9,6 +9,7 @@ CFLAGS+=-DSPARSE_WRITE
 # List of formats to support
 SRCS+= \
 	raw.c \
+	vhd.c \
 	vmdk.c
 
 # List of schemes to support

Modified: head/usr.bin/mkimg/gpt.c
==============================================================================
--- head/usr.bin/mkimg/gpt.c	Thu Jul  3 20:16:48 2014	(r268235)
+++ head/usr.bin/mkimg/gpt.c	Thu Jul  3 20:31:43 2014	(r268236)
@@ -211,7 +211,7 @@ gpt_mktbl(u_int tblsz)
 	STAILQ_FOREACH(part, &partlist, link) {
 		ent = tbl + part->index;
 		gpt_uuid_enc(&ent->ent_type, ALIAS_TYPE2PTR(part->type));
-		uuidgen(&uuid, 1);
+		mkimg_uuid(&uuid);
 		gpt_uuid_enc(&ent->ent_uuid, &uuid);
 		le64enc(&ent->ent_lba_start, part->block);
 		le64enc(&ent->ent_lba_end, part->block + part->size - 1);
@@ -279,7 +279,7 @@ gpt_write(lba_t imgsz, void *bootcode)
 	le32enc(&hdr->hdr_size, offsetof(struct gpt_hdr, padding));
 	le64enc(&hdr->hdr_lba_start, 2 + tblsz);
 	le64enc(&hdr->hdr_lba_end, imgsz - tblsz - 2);
-	uuidgen(&uuid, 1);
+	mkimg_uuid(&uuid);
 	gpt_uuid_enc(&hdr->hdr_uuid, &uuid);
 	le32enc(&hdr->hdr_entries, nparts);
 	le32enc(&hdr->hdr_entsz, sizeof(struct gpt_ent));

Modified: head/usr.bin/mkimg/image.c
==============================================================================
--- head/usr.bin/mkimg/image.c	Thu Jul  3 20:16:48 2014	(r268235)
+++ head/usr.bin/mkimg/image.c	Thu Jul  3 20:31:43 2014	(r268236)
@@ -94,21 +94,42 @@ image_copyin(lba_t blk, int fd, uint64_t
 int
 image_copyout(int fd)
 {
+	off_t ofs;
+	int error;
+
+	error = image_copyout_region(fd, 0, image_size);
+	if (error)
+		return (error);
+
+	ofs = lseek(fd, 0L, SEEK_CUR);
+	if (ofs == -1)
+		return (0);
+	error = (ftruncate(fd, ofs) == -1) ? errno : 0;
+	return (error);
+}
+
+int
+image_copyout_region(int fd, lba_t blk, lba_t size)
+{
 	char *buffer;
 	off_t ofs;
+	size_t sz;
 	ssize_t rdsz, wrsz;
 	int error;
 
 	ofs = lseek(fd, 0L, SEEK_CUR);
 
-	if (lseek(image_fd, 0, SEEK_SET) != 0)
+	blk *= secsz;
+	if (lseek(image_fd, blk, SEEK_SET) != blk)
 		return (errno);
 	buffer = malloc(BUFFER_SIZE);
 	if (buffer == NULL)
 		return (errno);
 	error = 0;
-	while (1) {
-		rdsz = read(image_fd, buffer, BUFFER_SIZE);
+	size *= secsz;
+	while (size > 0) {
+		sz = (BUFFER_SIZE < size) ? BUFFER_SIZE : size;
+		rdsz = read(image_fd, buffer, sz);
 		if (rdsz <= 0) {
 			error = (rdsz < 0) ? errno : 0;
 			break;
@@ -120,14 +141,10 @@ image_copyout(int fd)
 			error = errno;
 			break;
 		}
+		assert(wrsz == rdsz);
+		size -= rdsz;
 	}
 	free(buffer);
-	if (error)
-		return (error);
-	ofs = lseek(fd, 0L, SEEK_CUR);
-	if (ofs == -1)
-		return (errno);
-	error = (ftruncate(fd, ofs) == -1) ? errno : 0;
 	return (error);
 }
 

Modified: head/usr.bin/mkimg/image.h
==============================================================================
--- head/usr.bin/mkimg/image.h	Thu Jul  3 20:16:48 2014	(r268235)
+++ head/usr.bin/mkimg/image.h	Thu Jul  3 20:31:43 2014	(r268236)
@@ -33,6 +33,7 @@ typedef int64_t lba_t;
 
 int image_copyin(lba_t blk, int fd, uint64_t *sizep);
 int image_copyout(int fd);
+int image_copyout_region(int fd, lba_t blk, lba_t size);
 lba_t image_get_size(void);
 int image_init(void);
 int image_set_size(lba_t blk);

Modified: head/usr.bin/mkimg/mkimg.c
==============================================================================
--- head/usr.bin/mkimg/mkimg.c	Thu Jul  3 20:16:48 2014	(r268235)
+++ head/usr.bin/mkimg/mkimg.c	Thu Jul  3 20:31:43 2014	(r268236)
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -50,6 +51,7 @@ __FBSDID("$FreeBSD$");
 struct partlisthead partlist = STAILQ_HEAD_INITIALIZER(partlist);
 u_int nparts = 0;
 
+u_int unit_testing;
 u_int verbose;
 
 u_int ncyls = 0;
@@ -258,6 +260,22 @@ sparse_write(int fd, const void *ptr, si
 }
 #endif /* SPARSE_WRITE */
 
+void
+mkimg_uuid(struct uuid *uuid)
+{
+	static uint8_t gen[sizeof(struct uuid)];
+	u_int i;
+
+	if (!unit_testing) {
+		uuidgen(uuid, 1);
+		return;
+	}
+
+	for (i = 0; i < sizeof(gen); i++)
+		gen[i]++;
+	memcpy(uuid, gen, sizeof(uuid_t));
+}
+
 static void
 mkimg(void)
 {
@@ -337,7 +355,7 @@ main(int argc, char *argv[])
 
 	bcfd = -1;
 	outfd = 1;	/* Write to stdout by default */
-	while ((c = getopt(argc, argv, "b:f:o:p:s:vH:P:S:T:")) != -1) {
+	while ((c = getopt(argc, argv, "b:f:o:p:s:vyH:P:S:T:")) != -1) {
 		switch (c) {
 		case 'b':	/* BOOT CODE */
 			if (bcfd != -1)
@@ -373,6 +391,9 @@ main(int argc, char *argv[])
 			if (error)
 				errc(EX_DATAERR, error, "scheme");
 			break;
+		case 'y':
+			unit_testing++;
+			break;
 		case 'v':
 			verbose++;
 			break;

Modified: head/usr.bin/mkimg/mkimg.h
==============================================================================
--- head/usr.bin/mkimg/mkimg.h	Thu Jul  3 20:16:48 2014	(r268235)
+++ head/usr.bin/mkimg/mkimg.h	Thu Jul  3 20:31:43 2014	(r268236)
@@ -50,6 +50,7 @@ struct part {
 extern STAILQ_HEAD(partlisthead, part) partlist;
 extern u_int nparts;
 
+extern u_int unit_testing;
 extern u_int verbose;
 
 extern u_int ncyls;
@@ -71,4 +72,7 @@ round_block(lba_t n)
 ssize_t sparse_write(int, const void *, size_t);
 #endif
 
+struct uuid;
+void mkimg_uuid(struct uuid *);
+
 #endif /* _MKIMG_MKIMG_H_ */

Modified: head/usr.bin/mkimg/raw.c
==============================================================================
--- head/usr.bin/mkimg/raw.c	Thu Jul  3 20:16:48 2014	(r268235)
+++ head/usr.bin/mkimg/raw.c	Thu Jul  3 20:31:43 2014	(r268236)
@@ -28,7 +28,6 @@
 __FBSDID("$FreeBSD$");
 
 #include 
-#include 
 #include 
 #include 
 #include 

Copied: head/usr.bin/mkimg/vhd.c (from r268229, user/marcel/mkimg/vhd.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/usr.bin/mkimg/vhd.c	Thu Jul  3 20:31:43 2014	(r268236, copy of r268229, user/marcel/mkimg/vhd.c)
@@ -0,0 +1,308 @@
+/*-
+ * Copyright (c) 2014 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "image.h"
+#include "format.h"
+#include "mkimg.h"
+
+/*
+ * Notes:
+ * o   File is in network byte order.
+ * o   File layout:
+ *	copy of disk footer
+ *	dynamic disk header
+ *	block allocation table (BAT)
+ *	data blocks
+ *	disk footer
+ * o   The timestamp is seconds since 1/1/2000 12:00:00 AM UTC
+ */
+
+#define	VHD_SECTOR_SIZE	512
+#define	VHD_BLOCK_SIZE	(4096 * VHD_SECTOR_SIZE)	/* 2MB blocks */
+
+struct vhd_footer {
+	uint64_t	cookie;
+#define	VHD_FOOTER_COOKIE	0x636f6e6563746978
+	uint32_t	features;
+#define	VHD_FEATURES_TEMPORARY	0x01
+#define	VHD_FEATURES_RESERVED	0x02
+	uint32_t	version;
+#define	VHD_VERSION		0x00010000
+	uint64_t	data_offset;
+	uint32_t	timestamp;
+	uint32_t	creator_tool;
+#define	VHD_CREATOR_TOOL	0x2a696d67	/* FreeBSD mkimg */
+	uint32_t	creator_version;
+#define	VHD_CREATOR_VERSION	0x00010000
+	uint32_t	creator_os;
+#define	VHD_CREATOR_OS		0x46425344
+	uint64_t	original_size;
+	uint64_t	current_size;
+	uint16_t	cylinders;
+	uint8_t		heads;
+	uint8_t		sectors;
+	uint32_t	disk_type;
+#define	VHD_DISK_TYPE_FIXED	2
+#define	VHD_DISK_TYPE_DYNAMIC	3
+#define	VHD_DISK_TYPE_DIFF	4
+	uint32_t	checksum;
+	uuid_t		id;
+	uint8_t		saved_state;
+	uint8_t		_reserved[427];
+};
+_Static_assert(sizeof(struct vhd_footer) == VHD_SECTOR_SIZE,
+    "Wrong size for footer");
+
+struct vhd_dyn_header {
+	uint64_t	cookie;
+#define	VHD_HEADER_COOKIE	0x6378737061727365
+	uint64_t	data_offset;
+	uint64_t	table_offset;
+	uint32_t	version;
+	uint32_t	max_entries;
+	uint32_t	block_size;
+	uint32_t	checksum;
+	uuid_t		parent_id;
+	uint32_t	parent_timestamp;
+	char		_reserved1[4];
+	uint16_t	parent_name[256];	/* UTF-16 */
+	struct {
+		uint32_t	code;
+		uint32_t	data_space;
+		uint32_t	data_length;
+		uint32_t	_reserved;
+		uint64_t	data_offset;
+	} parent_locator[8];
+	char		_reserved2[256];
+};
+_Static_assert(sizeof(struct vhd_dyn_header) == VHD_SECTOR_SIZE * 2,
+    "Wrong size for header");
+
+static int
+vhd_resize(lba_t imgsz)
+{
+	uint64_t imagesz;
+
+	imagesz = imgsz * secsz;
+	imagesz = (imagesz + VHD_BLOCK_SIZE - 1) & ~(VHD_BLOCK_SIZE - 1);
+	return (image_set_size(imagesz / secsz));
+}
+
+static uint32_t
+vhd_checksum(void *buf, size_t sz)
+{
+	uint8_t *p = buf;
+	uint32_t sum;
+	size_t ofs;
+
+	sum = 0;
+	for (ofs = 0; ofs < sz; ofs++)
+		sum += p[ofs];
+	return (~sum);
+}
+
+static uint32_t
+vhd_timestamp(void)
+{
+	time_t t;
+
+	if (!unit_testing) {
+		t = time(NULL);
+		return (t - 0x386d4380);
+	}
+
+	return (0x01234567);
+}
+
+static void
+vhd_uuid_enc(void *buf, const uuid_t *uuid)
+{
+	uint8_t *p = buf;
+	int i;
+
+	be32enc(p, uuid->time_low);
+	be16enc(p + 4, uuid->time_mid);
+	be16enc(p + 6, uuid->time_hi_and_version);
+	p[8] = uuid->clock_seq_hi_and_reserved;
+	p[9] = uuid->clock_seq_low;
+	for (i = 0; i < _UUID_NODE_LEN; i++)
+		p[10 + i] = uuid->node[i];
+}
+
+static void
+vhd_geometry(struct vhd_footer *footer)
+{
+	lba_t imgsz;
+	long cth;
+
+	/* Respect command line options if possible. */
+	if (nheads > 1 && nheads < 256 &&
+	    nsecs > 1 && nsecs < 256 &&
+	    ncyls < 65536) {
+		be16enc(&footer->cylinders, ncyls);
+		footer->heads = nheads;
+		footer->sectors = nsecs;
+		return;
+	}
+
+	imgsz = (image_get_size() * secsz) / VHD_SECTOR_SIZE;
+	if (imgsz > 65536 * 16 * 255)
+		imgsz = 65536 * 16 * 255;
+	if (imgsz >= 65535 * 16 * 63) {
+		be16enc(&footer->cylinders, imgsz / (16 * 255));
+		footer->heads = 16;
+		footer->sectors = 255;
+		return;
+	}
+	footer->sectors = 17;
+	cth = imgsz / 17;
+	footer->heads = (cth + 1023) / 1024;
+	if (footer->heads < 4)
+		footer->heads = 4;
+	if (cth >= (footer->heads * 1024) || footer->heads > 16) {
+		footer->heads = 16;
+		footer->sectors = 31;
+		cth = imgsz / 31;
+	}
+	if (cth >= (footer->heads * 1024)) {
+		footer->heads = 16;
+		footer->sectors = 63;
+		cth = imgsz / 63;
+	}
+	be16enc(&footer->cylinders, cth / footer->heads);
+}
+
+static int
+vhd_write(int fd)
+{
+	struct vhd_footer footer;
+	struct vhd_dyn_header header;
+	uuid_t id;
+	uint64_t imgsz;
+	lba_t blk, nblks;
+	uint32_t *bat;
+	void *bitmap;
+	size_t batsz;
+	uint32_t sector;
+	int bat_entries, error, entry;
+
+	imgsz = image_get_size() * secsz;
+	bat_entries = imgsz / VHD_BLOCK_SIZE;
+
+	memset(&footer, 0, sizeof(footer));
+	be64enc(&footer.cookie, VHD_FOOTER_COOKIE);
+	be32enc(&footer.features, VHD_FEATURES_RESERVED);
+	be32enc(&footer.version, VHD_VERSION);
+	be64enc(&footer.data_offset, sizeof(footer));
+	be32enc(&footer.timestamp, vhd_timestamp());
+	be32enc(&footer.creator_tool, VHD_CREATOR_TOOL);
+	be32enc(&footer.creator_version, VHD_CREATOR_VERSION);
+	be32enc(&footer.creator_os, VHD_CREATOR_OS);
+	be64enc(&footer.original_size, imgsz);
+	be64enc(&footer.current_size, imgsz);
+	vhd_geometry(&footer);
+	be32enc(&footer.disk_type, VHD_DISK_TYPE_DYNAMIC);
+	mkimg_uuid(&id);
+	vhd_uuid_enc(&footer.id, &id);
+	be32enc(&footer.checksum, vhd_checksum(&footer, sizeof(footer)));
+	if (sparse_write(fd, &footer, sizeof(footer)) < 0)
+		return (errno);
+
+	memset(&header, 0, sizeof(header));
+	be64enc(&header.cookie, VHD_HEADER_COOKIE);
+	be64enc(&header.data_offset, ~0ULL);
+	be64enc(&header.table_offset, sizeof(footer) + sizeof(header));
+	be32enc(&header.version, VHD_VERSION);
+	be32enc(&header.max_entries, bat_entries);
+	be32enc(&header.block_size, VHD_BLOCK_SIZE);
+	be32enc(&header.checksum, vhd_checksum(&header, sizeof(header)));
+	if (sparse_write(fd, &header, sizeof(header)) < 0)
+		return (errno);
+
+	batsz = bat_entries * sizeof(uint32_t);
+	batsz = (batsz + VHD_SECTOR_SIZE - 1) & ~(VHD_SECTOR_SIZE - 1);
+	bat = malloc(batsz);
+	if (bat == NULL)
+		return (errno);
+	memset(bat, 0xff, batsz);
+	sector = (sizeof(footer) + sizeof(header) + batsz) / VHD_SECTOR_SIZE;
+	for (entry = 0; entry < bat_entries; entry++) {
+		be32enc(&bat[entry], sector);
+		sector += (VHD_BLOCK_SIZE / VHD_SECTOR_SIZE) + 1;
+	}
+	if (sparse_write(fd, bat, batsz) < 0) {
+		free(bat);
+		return (errno);
+	}
+	free(bat);
+
+	bitmap = malloc(VHD_SECTOR_SIZE);
+	if (bitmap == NULL)
+		return (errno);
+	memset(bitmap, 0xff, VHD_SECTOR_SIZE);
+
+	blk = 0;
+	nblks = image_get_size();
+	while (blk < nblks) {
+		if (sparse_write(fd, bitmap, VHD_SECTOR_SIZE) < 0) {
+			error = errno;
+			break;
+		}
+		error = image_copyout_region(fd, blk, VHD_BLOCK_SIZE / secsz);
+		if (error)
+			break;
+		blk += VHD_BLOCK_SIZE / secsz;
+	}
+	free(bitmap);
+	if (blk != nblks)
+		return (error);
+
+	if (sparse_write(fd, &footer, sizeof(footer)) < 0)
+		return (errno);
+
+	return (0);
+}
+
+static struct mkimg_format vhd_format = {
+	.name = "vhd",
+	.description = "Virtual Hard Disk",
+	.resize = vhd_resize,
+	.write = vhd_write,
+};
+
+FORMAT_DEFINE(vhd_format);

Modified: head/usr.bin/mkimg/vmdk.c
==============================================================================
--- head/usr.bin/mkimg/vmdk.c	Thu Jul  3 20:16:48 2014	(r268235)
+++ head/usr.bin/mkimg/vmdk.c	Thu Jul  3 20:31:43 2014	(r268236)
@@ -28,7 +28,6 @@
 __FBSDID("$FreeBSD$");
 
 #include 
-#include 
 #include 
 #include 
 #include 

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 20:35:20 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from hub.FreeBSD.org (hub.freebsd.org
 [IPv6:2001:1900:2254:206c::16:88])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E342AA08;
 Thu,  3 Jul 2014 20:35:19 +0000 (UTC)
Date: Thu, 3 Jul 2014 16:35:16 -0400
From: Glen Barber 
To: Marcel Moolenaar 
Subject: Re: svn commit: r268236 - head/usr.bin/mkimg
Message-ID: <20140703203516.GH37967@hub.FreeBSD.org>
References: <201407032031.s63KVh4E067310@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature"; boundary="nqkreNcslJAfgyzk"
Content-Disposition: inline
In-Reply-To: <201407032031.s63KVh4E067310@svn.freebsd.org>
X-Operating-System: FreeBSD 11.0-CURRENT amd64
X-SCUD-Definition: Sudden Completely Unexpected Dataloss
X-SULE-Definition: Sudden Unexpected Learning Event
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 20:35:20 -0000


--nqkreNcslJAfgyzk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 03, 2014 at 08:31:43PM +0000, Marcel Moolenaar wrote:
> Author: marcel
> Date: Thu Jul  3 20:31:43 2014
> New Revision: 268236
> URL: http://svnweb.freebsd.org/changeset/base/268236
>=20
> Log:
>   Add VHD support to mkimg(1). VHD is used by Xen and Microsoft's Hyper-V
>   among others.
>  =20
>   Add an undocumented option for unit testing (-y). When given, the image
>   will have UUIDs and timestamps synthesized in a way that gives identical
>   results across runs. As such, UUIDs stop being unique, globally or
>   otherwise.
>  =20
>   VHD support requested by: gjb@
>=20

Thank you!

Glen


--nqkreNcslJAfgyzk
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJTtb6EAAoJELls3eqvi17QHYUP/3+M0sX5QFK/hvxI3hJ0zmyc
pEse3s5JfNduG99BojKwscPmcOhY6nnIiix2Vs7pAWGp2lBAsrso8C2BOe4V4jFI
ZxdDg9g6W/aWOWBZUn8kJZdfZkJR24IqBEvbKKmQ+E2kqvRZPz1XoNz4G109x1T5
H/ClulM2SmAJADKISP8Z4d9Hg1Nh1Pkq26ek+q+BHdH7CA4B//j1vLhtPLt4krXD
Q5F06a+4riOyl4G/Ia6LrgtFZrxZznxZ99Y0Z7rPfePWkNHj0txOt1o4JJS7LKYi
H47SPPEAFBX9FM7Mor0IspJoOsB7qpqxj6fp3aAVcDniEnLt21SPJkXebAgyFDAM
xe1tQAffQYDIjULPJqcLAS2vMNH2YYZNJI0clZGfTD9IPQRqccEwnFsH9pzbM7W/
98maTJRdkotOdPWCt/lkI+BzVFEHNIk5uBqIg8uoEoJUc2EpZfYl5yIkztfrYGR1
Sm5YG7v/jjL9ksNR0YDIBcBCtEhE9OLb9J4YS6epye2VJLZ8oR0mOUWMBNh/uxpF
5BWZRyxMOHTSJpYB9q6hWibeP37o3Q01BqNNYtRmWIEeZhDNXEtZ9RowUDoQAXQl
tdf02Uwnk3ij1IEMiefwLlYbYOojBIoVsB7/I3h8tqXgAWtVxuo/ifQi714W2vjS
Oi1z0fB5LZ2Dp1zhyz0c
=WD3u
-----END PGP SIGNATURE-----

--nqkreNcslJAfgyzk--

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 21:48:20 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B3BB3D9C;
 Thu,  3 Jul 2014 21:48:20 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 86FAF27BD;
 Thu,  3 Jul 2014 21:48:20 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s63LmKNo001601;
 Thu, 3 Jul 2014 21:48:20 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s63LmK4B001599;
 Thu, 3 Jul 2014 21:48:20 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201407032148.s63LmK4B001599@svn.freebsd.org>
From: Xin LI 
Date: Thu, 3 Jul 2014 21:48:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268238 - head/usr.sbin/gstat
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 21:48:20 -0000

Author: delphij
Date: Thu Jul  3 21:48:19 2014
New Revision: 268238
URL: http://svnweb.freebsd.org/changeset/base/268238

Log:
  Add an option, -p, which makes gstat(8) to only display physical providers
  (those with rank of 1).
  
  MFC after:	2 weeks

Modified:
  head/usr.sbin/gstat/gstat.8
  head/usr.sbin/gstat/gstat.c

Modified: head/usr.sbin/gstat/gstat.8
==============================================================================
--- head/usr.sbin/gstat/gstat.8	Thu Jul  3 20:35:33 2014	(r268237)
+++ head/usr.sbin/gstat/gstat.8	Thu Jul  3 21:48:19 2014	(r268238)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 17, 2014
+.Dd July 3, 2014
 .Dt GSTAT 8
 .Os
 .Sh NAME
@@ -32,7 +32,7 @@
 .Nd print statistics about GEOM disks
 .Sh SYNOPSIS
 .Nm
-.Op Fl abcdo
+.Op Fl abcdop
 .Op Fl f Ar filter
 .Op Fl I Ar interval
 .Sh DESCRIPTION
@@ -84,6 +84,8 @@ or
 .Cm us
 (the default) indicates that the update interval is specified in
 seconds, milliseconds, or microseconds, respectively.
+.It Fl p
+Only display physical providers (those with rank of 1).
 .El
 .Sh EXIT STATUS
 .Ex -std

Modified: head/usr.sbin/gstat/gstat.c
==============================================================================
--- head/usr.sbin/gstat/gstat.c	Thu Jul  3 20:35:33 2014	(r268237)
+++ head/usr.sbin/gstat/gstat.c	Thu Jul  3 21:48:19 2014	(r268238)
@@ -51,7 +51,7 @@
 #include 
 #include 
 
-static int flag_a, flag_b, flag_c, flag_d, flag_o;
+static int flag_a, flag_b, flag_c, flag_d, flag_o, flag_p;
 static int flag_I = 1000000;
 
 #define PRINTMSG(...) do {						\
@@ -104,7 +104,7 @@ main(int argc, char **argv)
 		flag_b = 1;
 
 	f_s[0] = '\0';
-	while ((i = getopt(argc, argv, "abdcf:oI:")) != -1) {
+	while ((i = getopt(argc, argv, "abdcf:I:op")) != -1) {
 		switch (i) {
 		case 'a':
 			flag_a = 1;
@@ -143,6 +143,9 @@ main(int argc, char **argv)
 				i *= 1;
 			flag_I = i;
 			break;
+		case 'p':
+			flag_p = 1;
+			break;
 		case '?':
 		default:
 			usage();
@@ -254,6 +257,9 @@ main(int argc, char **argv)
 				continue;
 			if (gid->lg_what == ISCONSUMER && !flag_c)
 				continue;
+			if (flag_p && gid->lg_what == ISPROVIDER &&
+			   ((struct gprovider *)(gid->lg_ptr))->lg_geom->lg_rank != 1)
+				continue;
 			/* Do not print past end of window */
 			if (!flag_b) {
 				getyx(stdscr, cury, curx);
@@ -443,7 +449,7 @@ main(int argc, char **argv)
 static void
 usage(void)
 {
-	fprintf(stderr, "usage: gstat [-abcd] [-f filter] [-I interval]\n");
+	fprintf(stderr, "usage: gstat [-abcdp] [-f filter] [-I interval]\n");
 	exit(EX_USAGE);
         /* NOTREACHED */
 }

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 21:55:47 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7AE033D9;
 Thu,  3 Jul 2014 21:55:47 +0000 (UTC)
Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6076528CD;
 Thu,  3 Jul 2014 21:55:47 +0000 (UTC)
Received: from aurora.physics.berkeley.edu (aurora.Physics.Berkeley.EDU
 [128.32.117.67]) (authenticated bits=0)
 by d.mail.sonic.net (8.14.9/8.14.9) with ESMTP id s63LtTP2013437
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);
 Thu, 3 Jul 2014 14:55:30 -0700
Message-ID: <53B5D151.60502@freebsd.org>
Date: Thu, 03 Jul 2014 14:55:29 -0700
From: Nathan Whitehorn 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Marius Strobl 
Subject: Re: svn commit: r268173 - head/sys/conf
References: <201407021946.s62JkgHo051426@svn.freebsd.org>
 <53B465E0.1040309@freebsd.org> <20140702202813.GB69016@alchemy.franken.de>
 <53B46BF6.6040205@freebsd.org> <20140703195208.GE69016@alchemy.franken.de>
In-Reply-To: <20140703195208.GE69016@alchemy.franken.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Sonic-ID: C;wJu4v/wC5BG89pBsdPQXfw== M;cJLfv/wC5BG89pBsdPQXfw==
X-Spam-Flag: No
X-Sonic-Spam-Details: 0.0/5.0 by cerberusd
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 21:55:47 -0000


On 07/03/14 12:52, Marius Strobl wrote:
> On Wed, Jul 02, 2014 at 01:30:46PM -0700, Nathan Whitehorn wrote:
>> On 07/02/14 13:28, Marius Strobl wrote:
>>> On Wed, Jul 02, 2014 at 01:04:48PM -0700, Nathan Whitehorn wrote:
>>>> It worked at least on my Ultra 5 -- though probably because the ATI
>>>> Mach64 FCode ROM there is substantially shared with the Mac version. It
>>>> was even reasonably fast. But regardless of whether it's a generally
>>>> useful console driver on SPARC, at least it proves that vt(4) works fine.
>>> As for vt(4), it at least needs to be taught about the differences
>>> between virtual, physical and bus address with a clue bat. Among
>>> other problems, similar things hold for the #ifdef'ed sparc64 code
>>> of ofwfb(4) in combination with the accesses it does. I guess it
>>> only had a chance of working on your machine because its firmware
>>> is kind enough to map the framebuffer in (which not all machine
>>> models do) in the first place _and_ in a special way/location so
>>> accesses didn't blow. Anyway, even when going the ofwfb(4) route,
>>> doing reads and writes via bus_space(9) will be noticeably faster
>>> than going through the MMU on sparc64.
>> Yeah, the firmware there is pretty kind. I just wanted to make sure we
>> were on the same page. The vt core does not require any changes, I
>> think: it's just that you need new drivers for mach64 and, especially,
>> creator.
> Well, at least dev/fb/fbd.c committed as part of vt(4) should need some
> fixes and enhancements to work on sparc64 when it comes to running X.

fbd needs a lot of help for a lot of reasons. It doesn't work with 
early-boot console drivers at all, for example. The way all the fb stuff 
connects is a horribly tangled evil octopus, as well. You'll notice that 
ofwfb just ignores all of it at present.

> But yes, ofwfb(4) being PCI-centric is yet another problem.
>

It isn't, actually, and will work perfectly well with non-PCI linear 
framebuffers. If the device is a PCI device, it has some hacks to work 
around broken firmwares. It also does some additional things in this 
case to set the mapping write-combining flag when you use it to mmap() 
physical memory (X UMS drivers do this). But I don't think SPARC 
supports pmap_setattr() anyway.
-Nathan

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 22:08:38 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 61496AD2;
 Thu,  3 Jul 2014 22:08:38 +0000 (UTC)
Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35])
 by mx1.freebsd.org (Postfix) with ESMTP id EE7A229D3;
 Thu,  3 Jul 2014 22:08:37 +0000 (UTC)
Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534)
 id 2642A20E7088B; Thu,  3 Jul 2014 22:08:30 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
 smtp1.multiplay.co.uk
X-Spam-Level: **
X-Spam-Status: No, score=2.3 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX,
 FSL_HELO_NON_FQDN_1,HELO_NO_DOMAIN,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no
 version=3.3.1
Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170])
 by smtp1.multiplay.co.uk (Postfix) with ESMTPS id D89DF20E70886;
 Thu,  3 Jul 2014 22:08:24 +0000 (UTC)
Message-ID: <8CE302A118494D52821C3BA2DAA92320@multiplay.co.uk>
From: "Steven Hartland" 
To: "Xin LI" , ,
 , 
References: <201407032148.s63LmK4B001599@svn.freebsd.org>
Subject: Re: svn commit: r268238 - head/usr.sbin/gstat
Date: Thu, 3 Jul 2014 23:08:18 +0100
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 22:08:38 -0000

Great idea thanks for this very useful :)

    Regards
    Steve
----- Original Message ----- 
From: "Xin LI" 
To: ; ; 
Sent: Thursday, July 03, 2014 10:48 PM
Subject: svn commit: r268238 - head/usr.sbin/gstat


> Author: delphij
> Date: Thu Jul  3 21:48:19 2014
> New Revision: 268238
> URL: http://svnweb.freebsd.org/changeset/base/268238
> 
> Log:
>  Add an option, -p, which makes gstat(8) to only display physical providers
>  (those with rank of 1).
>  
>  MFC after: 2 weeks
> 
> Modified:
>  head/usr.sbin/gstat/gstat.8
>  head/usr.sbin/gstat/gstat.c
> 
> Modified: head/usr.sbin/gstat/gstat.8
> ==============================================================================
> --- head/usr.sbin/gstat/gstat.8 Thu Jul  3 20:35:33 2014 (r268237)
> +++ head/usr.sbin/gstat/gstat.8 Thu Jul  3 21:48:19 2014 (r268238)
> @@ -24,7 +24,7 @@
> .\"
> .\" $FreeBSD$
> .\"
> -.Dd May 17, 2014
> +.Dd July 3, 2014
> .Dt GSTAT 8
> .Os
> .Sh NAME
> @@ -32,7 +32,7 @@
> .Nd print statistics about GEOM disks
> .Sh SYNOPSIS
> .Nm
> -.Op Fl abcdo
> +.Op Fl abcdop
> .Op Fl f Ar filter
> .Op Fl I Ar interval
> .Sh DESCRIPTION
> @@ -84,6 +84,8 @@ or
> .Cm us
> (the default) indicates that the update interval is specified in
> seconds, milliseconds, or microseconds, respectively.
> +.It Fl p
> +Only display physical providers (those with rank of 1).
> .El
> .Sh EXIT STATUS
> .Ex -std
> 
> Modified: head/usr.sbin/gstat/gstat.c
> ==============================================================================
> --- head/usr.sbin/gstat/gstat.c Thu Jul  3 20:35:33 2014 (r268237)
> +++ head/usr.sbin/gstat/gstat.c Thu Jul  3 21:48:19 2014 (r268238)
> @@ -51,7 +51,7 @@
> #include 
> #include 
> 
> -static int flag_a, flag_b, flag_c, flag_d, flag_o;
> +static int flag_a, flag_b, flag_c, flag_d, flag_o, flag_p;
> static int flag_I = 1000000;
> 
> #define PRINTMSG(...) do { \
> @@ -104,7 +104,7 @@ main(int argc, char **argv)
>  flag_b = 1;
> 
>  f_s[0] = '\0';
> - while ((i = getopt(argc, argv, "abdcf:oI:")) != -1) {
> + while ((i = getopt(argc, argv, "abdcf:I:op")) != -1) {
>  switch (i) {
>  case 'a':
>  flag_a = 1;
> @@ -143,6 +143,9 @@ main(int argc, char **argv)
>  i *= 1;
>  flag_I = i;
>  break;
> + case 'p':
> + flag_p = 1;
> + break;
>  case '?':
>  default:
>  usage();
> @@ -254,6 +257,9 @@ main(int argc, char **argv)
>  continue;
>  if (gid->lg_what == ISCONSUMER && !flag_c)
>  continue;
> + if (flag_p && gid->lg_what == ISPROVIDER &&
> +    ((struct gprovider *)(gid->lg_ptr))->lg_geom->lg_rank != 1)
> + continue;
>  /* Do not print past end of window */
>  if (!flag_b) {
>  getyx(stdscr, cury, curx);
> @@ -443,7 +449,7 @@ main(int argc, char **argv)
> static void
> usage(void)
> {
> - fprintf(stderr, "usage: gstat [-abcd] [-f filter] [-I interval]\n");
> + fprintf(stderr, "usage: gstat [-abcdp] [-f filter] [-I interval]\n");
>  exit(EX_USAGE);
>         /* NOTREACHED */
> }
> 
>

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 22:13:40 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id F1CC195
 for ; Thu,  3 Jul 2014 22:13:40 +0000 (UTC)
Received: from mail-qc0-x229.google.com (mail-qc0-x229.google.com
 [IPv6:2607:f8b0:400d:c01::229])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id A8A1B2A94
 for ; Thu,  3 Jul 2014 22:13:40 +0000 (UTC)
Received: by mail-qc0-f169.google.com with SMTP id c9so837568qcz.28
 for ; Thu, 03 Jul 2014 15:13:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=eitanadler.com; s=0xdeadbeef;
 h=mime-version:sender:in-reply-to:references:from:date:message-id
 :subject:to:cc:content-type;
 bh=pN+esI8EFGGOs4MO5wS9ubQt0nMAeOykP+RWVXcVqlk=;
 b=MrEcrYlTaX37crlgMLztg1Ixy4xGDanoUUjooq7Sg/gUUOQQbIOjkfJ14tIvaBKWYc
 JEI6iPfYiXZdxbsMQypCghJoJh2BiP9AXXjwz/8AcCJ+VeFSZY0bDbPxIWxGUB1/UP95
 u5qdYTkMzPMTSpFqqC5Q12rIorsZgLvGdorho=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
 :date:message-id:subject:to:cc:content-type;
 bh=pN+esI8EFGGOs4MO5wS9ubQt0nMAeOykP+RWVXcVqlk=;
 b=aKfx6aFTTxSPtTlyf0tUGHiiLMqzNSwbil3EjAO/s5DAnxrj3gNlz3Cu+nrhk8iNsU
 pwpYzeyWaDjCQwZS6Uug7xIEo6ki069k8tYCyVhFMc0Vdmt2ZD0z93kwzQBSKTe4FwX+
 EktetUOO/1D54++TawaCL+EIptCziDk8XmCH0NgYBNfMg/JSDEmz1x7nmX+hL+81UYmU
 MdbVIQsnJH581aFH7OGnNHDgH4n7HCkthFt++80UaK0/7tFE63L999TcjHy01SLdB3+W
 KnxclcWzDMY9Vdz7YZcYp5FuZB+xiRiMdNMtE9q7aympRcEmVf9nNGoFWNmnRIuBpuO3
 GuBg==
X-Gm-Message-State: ALoCoQl3jUNqmDI3hgRrtOkbgYF49gk/38Nyo92e/1aWt26no6MZ6knXTe93xN0SKpibdOZi5tnN
X-Received: by 10.224.88.129 with SMTP id a1mr12656496qam.23.1404425619796;
 Thu, 03 Jul 2014 15:13:39 -0700 (PDT)
MIME-Version: 1.0
Sender: lists@eitanadler.com
Received: by 10.96.88.132 with HTTP; Thu, 3 Jul 2014 15:13:09 -0700 (PDT)
In-Reply-To: <201407032031.s63KVh4E067310@svn.freebsd.org>
References: <201407032031.s63KVh4E067310@svn.freebsd.org>
From: Eitan Adler 
Date: Thu, 3 Jul 2014 15:13:09 -0700
X-Google-Sender-Auth: lGQ8rvcXLr2tzSzRrTZXkhUCfQ8
Message-ID: 
Subject: Re: svn commit: r268236 - head/usr.bin/mkimg
To: Marcel Moolenaar 
Content-Type: text/plain; charset=UTF-8
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 22:13:41 -0000

On 3 July 2014 13:31, Marcel Moolenaar  wrote:
> Author: marcel
> Date: Thu Jul  3 20:31:43 2014
> New Revision: 268236
> URL: http://svnweb.freebsd.org/changeset/base/268236
>
> Log:
>   Add VHD support to mkimg(1). VHD is used by Xen and Microsoft's Hyper-V
>   among others.
>
>   Add an undocumented option for unit testing (-y).

Please document this or remove it.  "Undocumented features" just a
longer spelling of "bug".

Its fine to document it as an "internal flag for unit testing, not to
be used by calling scripts".

-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 23:09:46 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5469F40B;
 Thu,  3 Jul 2014 23:09:46 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3F3CC2F04;
 Thu,  3 Jul 2014 23:09:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s63N9k9J041438;
 Thu, 3 Jul 2014 23:09:46 GMT (envelope-from ken@svn.freebsd.org)
Received: (from ken@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s63N9jJT041428;
 Thu, 3 Jul 2014 23:09:45 GMT (envelope-from ken@svn.freebsd.org)
Message-Id: <201407032309.s63N9jJT041428@svn.freebsd.org>
From: "Kenneth D. Merry" 
Date: Thu, 3 Jul 2014 23:09:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268240 - in head: sbin/camcontrol sys/cam/scsi
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 23:09:46 -0000

Author: ken
Date: Thu Jul  3 23:09:44 2014
New Revision: 268240
URL: http://svnweb.freebsd.org/changeset/base/268240

Log:
  Add persistent reservation support to camcontrol(8).
  
  camcontrol(8) now supports a new 'persist' subcommand that allows users to
  issue SCSI PERSISTENT RESERVE IN / OUT commands.
  
  sbin/camcontrol/Makefile:
  	Add persist.c.
  
  sbin/camcontrol/persist.c:
  	New persistent reservation support for camcontrol(8).
  
  	We have support for all known operation modes for PERSISTENT RESERVE
  	IN and PERSISTENT RESERVE OUT.
  	exceptions noted above.
  
  sbin/camcontrol/camcontrol.8:
  	Document the new 'persist' subcommand.
  
  	In the section on the Transport ID (-I) option, explain what
  	Transport IDs for each protocol should look like.  At some point
  	some of this information could probably get moved off in a
  	separate man page, either on Transport IDs alone or a man page
  	documenting the Transport ID parsing code.
  
  	Add a number of examples of persistent reservation commands.
  	Persistent Reservations are complex enough that the average user
  	probably won't be able to get the commands exactly right by just
  	reading the man page.  These examples show a few basic and
  	advanced examples of how to use persistent reservations.
  
  sbin/camcontrol/camcontrol.h:
  	Move the definition for camcontrol_optret here, so we can use it
  	for the persistent reservation code.
  
  	Add a definition for the new scsipersist() function.
  
  sbin/camcontrol/camcontrol.c:
  	Add 'persist' to the list of subcommands.
  
  	Document 'persist' in the help text.
  
  sys/cam/scsi/scsi_all.c:
  	Add the scsi_persistent_reserve_in() and
  	scsi_persistent_reserve_out() CCB building functions.
  
  	Add a new function, scsi_transportid_sbuf().  This takes a
  	SCSI Transport ID (documented in SPC-4), and prints it to
  	an sbuf(9).  There are some transports (like ATA, USB, and
  	SSA) for which there is no transport defined.  We need to
  	come up with a reasonable thing to do if we're presented
  	with a Transport ID that claims to be for one of those
  	protocols.
  
  	Add new routines scsi_get_nv() and scsi_nv_to_str().
  
  	These functions do a table lookup to go between a string and an
  	integer.  There are lots of table lookups needed in the
  	persistent reservation code in camcontrol(8).
  
  	Add a new function, scsi_parse_transportid(), along with leaf node
  	functions to parse:
  	FC, 1394 and SAS (scsi_parse_transportid_64bit())
  	iSCSI (scsi_parse_transportid_iscsi())
  	SPI (scsi_parse_transportid_spi())
  	RDMA (scsi_parse_transportid_rdma())
  	PCIe (scsi_parse_transportid_sop())
  
  	Transport IDs.  Given a string with the general form proto,id these
  	functions create a SCSI Transport ID structure.
  
  sys/cam/scsi/scsi_all.h:
  	Update the various persistent reservation data structures to
  	SPC4r36l, but also rename some fields that were previously
  	obsolete with the proper names from older SCSI specs.  This
  	allows using older, obsolete persistent reservation types when
  	desired.
  
  	Add function prototypes for the new persistent reservation CCB
  	building functions.
  
  	Add a data strucure for the READ FULL STATUS service action
  	of the PERSISTENT RESERVE IN command.
  
  	Add Transport ID structures for all protocols described in SPC-4.
  
  	Add a new series of SCSI_PROTO_XXX definitions, and
  	redefine other defines in terms of these new definitions.
  
  	Add a prototype for scsi_transportid_sbuf().
  
  	Change a couple of "obsolete" persistent reservation data
  	structure fields into something more meaningful, based on
  	what the field was called when it was defined in the spec.
  	(e.g. SPC, SPC-2, etc.)
  
  	Create a new define, SPRI_MAX_LEN, for the maximum allocation
  	length allowed for the PERSISTENT RESERVE IN command.
  
  	Add data structures and enumerations for the new name/value
  	translation functions.
  
  	Add data structures for SCSI over PCIe Routing IDs.
  
  	Bring the PERSISTENT RESERVE OUT Register and Move parameter list
  	structure (struct scsi_per_res_out_parms) up to date with SPC-4.
  
  	Add a data structure for the transport IDs that can optionally be
  	appended to the basic PERSISTENT RESERVE OUT parameter list.
  
  	Move SCSI protocol macro definitions out of the VPD page 0x83
  	definition and combine them with the more up to date protocol
  	definitions higher in the file.
  
  	Add function prototypes for scsi_nv_to_str(), scsi_get_nv(),
  	scsi_parse_transportid_64bit(), scsi_parse_transportid_spi(),
  	scsi_parse_transportid_rdma(), scsi_parse_transportid_iscsi(),
  	scsi_parse_transportid_sop(), and scsi_parse_transportid().
  
  Sponsored by:	Spectra Logic Corporation
  MFC after:	1 week

Added:
  head/sbin/camcontrol/persist.c   (contents, props changed)
Modified:
  head/sbin/camcontrol/Makefile
  head/sbin/camcontrol/camcontrol.8
  head/sbin/camcontrol/camcontrol.c
  head/sbin/camcontrol/camcontrol.h
  head/sys/cam/scsi/scsi_all.c
  head/sys/cam/scsi/scsi_all.h

Modified: head/sbin/camcontrol/Makefile
==============================================================================
--- head/sbin/camcontrol/Makefile	Thu Jul  3 22:25:59 2014	(r268239)
+++ head/sbin/camcontrol/Makefile	Thu Jul  3 23:09:44 2014	(r268240)
@@ -3,7 +3,7 @@
 PROG=	camcontrol
 SRCS=	camcontrol.c util.c
 .if !defined(RELEASE_CRUNCH)
-SRCS+=	fwdownload.c modeedit.c progress.c
+SRCS+=	fwdownload.c modeedit.c persist.c progress.c
 .else
 CFLAGS+= -DMINIMALISTIC
 .endif

Modified: head/sbin/camcontrol/camcontrol.8
==============================================================================
--- head/sbin/camcontrol/camcontrol.8	Thu Jul  3 22:25:59 2014	(r268239)
+++ head/sbin/camcontrol/camcontrol.8	Thu Jul  3 23:09:44 2014	(r268240)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 6, 2013
+.Dd November 20, 2013
 .Dt CAMCONTROL 8
 .Os
 .Sh NAME
@@ -269,6 +269,21 @@
 .Op Fl U Ar pwd
 .Op Fl y
 .Nm
+.Ic persist
+.Op device id
+.Op generic args
+.Aq Fl i Ar action | Fl o Ar action
+.Op Fl a
+.Op Fl I Ar trans_id
+.Op Fl k Ar key
+.Op Fl K Ar sa_key
+.Op Fl p
+.Op Fl R Ar rel_tgt_port
+.Op Fl s Ar scope
+.Op Fl S
+.Op Fl T Ar res_type
+.Op Fl U
+.Nm
 .Ic help
 .Sh DESCRIPTION
 The
@@ -1473,6 +1488,276 @@ to output a line for every firmware segm
 fwdownload command
 -- the same as the ones shown in simulation mode.
 .El
+.It Ic persist
+Persistent reservation support.
+Persistent reservations are a way to reserve a particular
+.Tn SCSI
+LUN for use by one or more
+.Tn SCSI
+initiators.
+If the
+.Fl i
+option is specified,
+.Nm
+will issue the
+.Tn SCSI
+PERSISTENT RESERVE IN
+command using the requested service action.
+If the
+.Fl o
+option is specified,
+.Nm
+will issue the
+.Tn SCSI
+PERSISTENT RESERVE OUT
+command using the requested service action.
+One of those two options is required.
+.Pp
+Persistent reservations are complex, and fully explaining them is outside
+the scope of this manual.
+Please visit
+http://www.t10.org
+and download the latest SPC spec for a full explanation of persistent
+reservations.
+.Bl -tag -width 8n
+.It Fl i Ar mode
+Specify the service action for the PERSISTENT RESERVE IN command.
+Supported service actions:
+.Bl -tag -width 19n
+.It read_keys
+Report the current persistent reservation generation (PRgeneration) and any
+registered keys.
+.It read_reservation
+Report the persistent reservation, if any.
+.It report_capabilities
+Report the persistent reservation capabilities of the LUN.
+.It read_full_status
+Report the full status of persistent reservations on the LUN.
+.El
+.It Fl o Ar mode
+Specify the service action for the PERSISTENT RESERVE OUT command.
+For service actions like register that are components of other service
+action names, the entire name must be specified.
+Otherwise, enough of the service action name must be specified to
+distinguish it from other possible service actions.
+Supported service actions:
+.Bl -tag -width 15n
+.It register
+Register a reservation key with the LUN or unregister a reservation key.
+To register a key, specify the requested key as the Service Action
+Reservation Key.
+To unregister a key, specify the previously registered key as the
+Reservation Key.
+To change a key, specify the old key as the Reservation Key and the new
+key as the Service Action Reservation Key.
+.It register_ignore
+This is similar to the register subcommand, except that the Reservation Key
+is ignored.
+The Service Action Reservation Key will overwrite any previous key
+registered for the initiator.
+.It reserve
+Create a reservation.
+A key must be registered with the LUN before the LUN can be reserved, and
+it must be specified as the Reservation Key.
+The type of reservation must also be specified.
+The scope defaults to LUN scope (LU_SCOPE), but may be changed.
+.It release
+Release a reservation.
+The Reservation Key must be specified.
+.It clear
+Release a reservation and remove all keys from the device.
+The Reservation Key must be specified.
+.It preempt
+Remove a reservation belonging to another initiator.
+The Reservation Key must be specified.
+The Service Action Reservation Key may be specified, depending on the
+operation being performed.
+.It preempt_abort
+Remove a reservation belonging to another initiator and abort all
+outstanding commands from that initiator.
+The Reservation Key must be specified.
+The Service Action Reservation Key may be specified, depending on the
+operation being performed.
+.It register_move
+Register another initiator with the LUN, and establish a reservation on the
+LUN for that initiator.
+The Reservation Key and Service Action Reservation Key must be specified.
+.It replace_lost
+Replace Lost Reservation information.
+.El
+.It Fl a
+Set the All Target Ports (ALL_TG_PT) bit.
+This requests that the key registration be applied to all target ports and
+not just the particular target port that receives the command.
+This only applies to the register and register_ignore actions.
+.It Fl I Ar tid
+Specify a Transport ID.
+This only applies to the Register and Register and Move service actions for
+Persistent Reserve Out.
+Multiple Transport IDs may be specified with multiple
+.Fl I
+arguments.
+With the Register service action, specifying one or more Transport IDs
+implicitly enables the
+.Fl S
+option which turns on the SPEC_I_PT bit.
+Transport IDs generally have the format protocol,id.
+.Bl -tag -width 5n
+.It SAS
+A SAS Transport ID consists of
+.Dq sas,
+followed by a 64-bit SAS address.
+For example:
+.Pp
+.Dl sas,0x1234567812345678
+.It FC
+A Fibre Channel Transport ID consists of
+.Dq fcp,
+followed by a 64-bit Fibre Channel World Wide Name. 
+For example:
+.Pp
+.Dl fcp,0x1234567812345678
+.It SPI
+A Parallel SCSI address consists of
+.Dq spi,
+followed by a SCSI target ID and a relative target port identifier.
+For example:
+.Pp
+.Dl spi,4,1
+.It 1394
+An IEEE 1394 (Firewire) Transport ID consists of
+.Dq sbp,
+followed by a 64-bit EUI-64 IEEE 1394 node unique identifier.
+For example:
+.Pp
+.Dl sbp,0x1234567812345678
+.It RDMA
+A SCSI over RDMA Transport ID consists of
+.Dq srp,
+followed by a 128-bit RDMA initiator port identifier.
+The port identifier must be exactly 32 or 34 (if the leading 0x is
+included) hexadecimal digits.
+Only hexadecimal (base 16) numbers are supported.
+For example:
+.Pp
+.Dl srp,0x12345678123456781234567812345678
+.It iSCSI
+An iSCSI Transport ID consists an iSCSI name and optionally a separator and
+iSCSI session ID.
+For example, if only the iSCSI name is specified:
+.Pp
+.Dl iqn.2012-06.com.example:target0
+.Pp
+If the iSCSI separator and initiator session ID are specified:
+.Pp
+.Dl iqn.2012-06.com.example:target0,i,0x123
+.It PCIe
+A SCSI over PCIe Transport ID consists of
+.Dq sop,
+followed by a PCIe Routing ID.
+The Routing ID consists of a bus, device and function or in the alternate
+form, a bus and function.
+The bus must be in the range of 0 to 255 inclusive and the device must be
+in the range of 0 to 31 inclusive.
+The function must be in the range of 0 to 7 inclusive if the standard form
+is used, and in the range of 0 to 255 inclusive if the alternate form is
+used.
+For example, if a bus, device and function are specified for the standard
+Routing ID form:
+.Pp
+.Dl sop,4,5,1
+.Pp
+If the alternate Routing ID form is used:
+.Pp
+.Dl sop,4,1
+.El
+.It Fl k Ar key
+Specify the Reservation Key.
+This may be in decimal, octal or hexadecimal format.
+The value is zero by default if not otherwise specified.
+The value must be between 0 and 2^64 - 1, inclusive.
+.It Fl K Ar key
+Specify the Service Action Reservation Key.
+This may be in decimal, octal or hexadecimal format.
+The value is zero by default if not otherwise specified.
+The value must be between 0 and 2^64 - 1, inclusive.
+.It Fl p
+Enable the Activate Persist Through Power Loss bit.
+This is only used for the register and register_ignore actions.
+This requests that the reservation persist across power loss events.
+.It Fl s Ar scope
+Specify the scope of the reservation.
+The scope may be specified by name or by number.
+The scope is ignored for register, register_ignore and clear.
+If the desired scope isn't available by name, you may specify the number.
+.Bl -tag -width 7n
+.It lun
+LUN scope (0x00).
+This encompasses the entire LUN.
+.It extent
+Extent scope (0x01).
+.It element
+Element scope (0x02).
+.El
+.It Fl R Ar rtp
+Specify the Relative Target Port.
+This only applies to the Register and Move service action of the Persistent
+Reserve Out command.
+.It Fl S
+Enable the SPEC_I_PT bit.
+This only applies to the Register service action of Persistent Reserve Out.
+You must also specify at least one Transport ID with
+.Fl I
+if this option is set.
+If you specify a Transport ID, this option is automatically set.
+It is an error to specify this option for any service action other than
+Register.
+.It Fl T Ar type
+Specify the reservation type.
+The reservation type may be specified by name or by number.
+If the desired reservation type isn't available by name, you may specify
+the number.
+Supported reservation type names:
+.Bl -tag -width 11n
+.It read_shared
+Read Shared mode.
+.It wr_ex
+Write Exclusive mode.
+May also be specified as
+.Dq write_exclusive .
+.It rd_ex
+Read Exclusive mode.
+May also be specified as
+.Dq read_exclusive .
+.It ex_ac
+Exclusive access mode.
+May also be specified as
+.Dq exclusive_access .
+.It wr_ex_ro
+Write Exclusive Registrants Only mode.
+May also be specified as 
+.Dq write_exclusive_reg_only .
+.It ex_ac_ro
+Exclusive Access Registrants Only mode.
+May also be specified as 
+.Dq exclusive_access_reg_only .
+.It wr_ex_ar
+Write Exclusive All Registrants mode.
+May also be specified as
+.Dq write_exclusive_all_regs .
+.It ex_ac_ar
+Exclusive Access All Registrants mode.
+May also be specified as 
+.Dq exclusive_access_all_regs .
+.El
+.It Fl U
+Specify that the target should unregister the initiator that sent
+the Register and Move request.
+By default, the target will not unregister the initiator that sends the
+Register and Move request.
+This option only applies to the Register and Move service action of the
+Persistent Reserve Out command.
+.El
 .It Ic help
 Print out verbose usage information.
 .El
@@ -1639,6 +1924,66 @@ power-on or hardware reset!
 .Pp
 .Em DO NOT
 use this on a device which has an active filesystem!
+.Pp
+.Bd -literal -offset indent
+camcontrol persist da0 -v -i read_keys
+.Ed
+.Pp
+This will read any persistent reservation keys registered with da0, and
+display any errors encountered when sending the PERSISTENT RESERVE IN
+.Tn SCSI 
+command.
+.Bd -literal -offset indent
+camcontrol persist da0 -v -o register -a -K 0x12345678
+.Ed
+.Pp
+This will register the persistent reservation key 0x12345678 with da0,
+apply that registration to all ports on da0, and display any errors that
+occur when sending the PERSISTENT RESERVE OUT command.
+.Bd -literal -offset indent
+camcontrol persist da0 -v -o reserve -s lun -k 0x12345678 -T ex_ac
+.Ed
+.Pp
+This will reserve da0 for the exlusive use of the initiator issuing the
+command.
+The scope of the reservation is the entire LUN.
+Any errors sending the PERSISTENT RESERVE OUT command will be displayed.
+.Bd -literal -offset indent
+camcontrol persist da0 -v -i read_full
+.Ed
+.Pp
+This will display the full status of all reservations on da0 and print out
+status if there are any errors.
+.Bd -literal -offset indent
+camcontrol persist da0 -v -o release -k 0x12345678 -T ex_ac
+.Ed
+.Pp
+This will release a reservation on da0 of the type ex_ac
+(Exclusive Access).
+The Reservation Key for this registration is 0x12345678.
+Any errors that occur will be displayed.
+.Bd -literal -offset indent
+camcontrol persist da0 -v -o register -K 0x12345678 -S \e
+	-I sas,0x1234567812345678 -I sas,0x8765432187654321
+.Ed
+.Pp
+This will register the key 0x12345678 with da0, specifying that it applies
+to the SAS initiators with SAS addresses 0x1234567812345678 and
+0x8765432187654321.
+.Bd -literal -offset indent
+camcontrol persist da0 -v -o register_move -k 0x87654321 \e
+	-K 0x12345678 -U -p -R 2 -I fcp,0x1234567812345678
+.Ed
+.Pp
+This will move the registration from the current initiator, whose
+Registration Key is 0x87654321, to the Fibre Channel initiator with the 
+Fiber Channel World Wide Node Name 0x1234567812345678.
+A new registration key, 0x12345678, will be registered for the initiator 
+with the Fibre Channel World Wide Node Name 0x1234567812345678, and the
+current initiator will be unregistered from the target.
+The reservation will be moved to relative target port 2 on the target
+device.
+The registration will persist across power losses.
 .Sh SEE ALSO
 .Xr cam 3 ,
 .Xr cam_cdbparse 3 ,

Modified: head/sbin/camcontrol/camcontrol.c
==============================================================================
--- head/sbin/camcontrol/camcontrol.c	Thu Jul  3 22:25:59 2014	(r268239)
+++ head/sbin/camcontrol/camcontrol.c	Thu Jul  3 23:09:44 2014	(r268240)
@@ -96,6 +96,7 @@ typedef enum {
 	CAM_CMD_SECURITY	= 0x0000001d,
 	CAM_CMD_HPA		= 0x0000001e,
 	CAM_CMD_SANITIZE	= 0x0000001f,
+	CAM_CMD_PERSIST		= 0x00000020
 } cam_cmdmask;
 
 typedef enum {
@@ -218,6 +219,7 @@ static struct camcontrol_opts option_tab
 	{"fwdownload", CAM_CMD_DOWNLOAD_FW, CAM_ARG_NONE, "f:ys"},
 	{"security", CAM_CMD_SECURITY, CAM_ARG_NONE, "d:e:fh:k:l:qs:T:U:y"},
 	{"hpa", CAM_CMD_HPA, CAM_ARG_NONE, "Pflp:qs:U:y"},
+	{"persist", CAM_CMD_PERSIST, CAM_ARG_NONE, "ai:I:k:K:o:ps:ST:U"},
 #endif /* MINIMALISTIC */
 	{"help", CAM_CMD_USAGE, CAM_ARG_NONE, NULL},
 	{"-?", CAM_CMD_USAGE, CAM_ARG_NONE, NULL},
@@ -225,12 +227,6 @@ static struct camcontrol_opts option_tab
 	{NULL, 0, 0, NULL}
 };
 
-typedef enum {
-	CC_OR_NOT_FOUND,
-	CC_OR_AMBIGUOUS,
-	CC_OR_FOUND
-} camcontrol_optret;
-
 struct cam_devitem {
 	struct device_match_result dev_match;
 	int num_periphs;
@@ -7826,6 +7822,9 @@ usage(int printlong)
 "                              [-U ] [-y]\n"
 "        camcontrol hpa        [dev_id][generic args] [-f] [-l] [-P] [-p pwd]\n"
 "                              [-q] [-s max_sectors] [-U pwd] [-y]\n"
+"        camcontrol persist    [dev_id][generic args] <-i action|-o action>\n"
+"                              [-a][-I tid][-k key][-K sa_key][-p][-R rtp]\n"
+"                              [-s scope][-S][-T type][-U]\n"
 #endif /* MINIMALISTIC */
 "        camcontrol help\n");
 	if (!printlong)
@@ -7862,8 +7861,9 @@ usage(int printlong)
 "idle        send the ATA IDLE command to the named device\n"
 "standby     send the ATA STANDBY command to the named device\n"
 "sleep       send the ATA SLEEP command to the named device\n"
-"fwdownload  program firmware of the named device with the given image"
+"fwdownload  program firmware of the named device with the given image\n"
 "security    report or send ATA security commands to the named device\n"
+"persist     send the SCSI PERSISTENT RESERVE IN or OUT commands\n"
 "help        this message\n"
 "Device Identifiers:\n"
 "bus:target        specify the bus and target, lun defaults to 0\n"
@@ -7998,6 +7998,22 @@ usage(int printlong)
 "                  device\n"
 "-U pwd            unlock the HPA configuration of the device\n"
 "-y                don't ask any questions\n"
+"persist arguments:\n"
+"-i action         specify read_keys, read_reservation, report_cap, or\n"
+"                  read_full_status\n"
+"-o action         specify register, register_ignore, reserve, release,\n"
+"                  clear, preempt, preempt_abort, register_move, replace_lost\n"
+"-a                set the All Target Ports (ALL_TG_PT) bit\n"
+"-I tid            specify a Transport ID, e.g.: sas,0x1234567812345678\n"
+"-k key            specify the Reservation Key\n"
+"-K sa_key         specify the Service Action Reservation Key\n"
+"-p                set the Activate Persist Through Power Loss bit\n"
+"-R rtp            specify the Relative Target Port\n"
+"-s scope          specify the scope: lun, extent, element or a number\n"
+"-S                specify Transport ID for register, requires -I\n"
+"-T res_type       specify the reservation type: read_shared, wr_ex, rd_ex,\n"
+"                  ex_ac, wr_ex_ro, ex_ac_ro, wr_ex_ar, ex_ac_ar\n"
+"-U                unregister the current initiator for register_move\n"
 );
 #endif /* MINIMALISTIC */
 }
@@ -8332,6 +8348,11 @@ main(int argc, char **argv)
 			error = scsisanitize(cam_dev, argc, argv,
 					     combinedopt, retry_count, timeout);
 			break;
+		case CAM_CMD_PERSIST:
+			error = scsipersist(cam_dev, argc, argv, combinedopt,
+			    retry_count, timeout, arglist & CAM_ARG_VERBOSE,
+			    arglist & CAM_ARG_ERR_RECOVER);
+			break;
 #endif /* MINIMALISTIC */
 		case CAM_CMD_USAGE:
 			usage(1);

Modified: head/sbin/camcontrol/camcontrol.h
==============================================================================
--- head/sbin/camcontrol/camcontrol.h	Thu Jul  3 22:25:59 2014	(r268239)
+++ head/sbin/camcontrol/camcontrol.h	Thu Jul  3 23:09:44 2014	(r268240)
@@ -30,6 +30,13 @@
 
 #ifndef _CAMCONTROL_H
 #define _CAMCONTROL_H
+
+typedef enum {
+	CC_OR_NOT_FOUND,
+	CC_OR_AMBIGUOUS,
+	CC_OR_FOUND
+} camcontrol_optret;
+
 /*
  * get_hook: Structure for evaluating args in a callback.
  */
@@ -56,6 +63,9 @@ void mode_list(struct cam_device *device
 	       int retry_count, int timeout);
 int scsidoinquiry(struct cam_device *device, int argc, char **argv,
 		  char *combinedopt, int retry_count, int timeout);
+int scsipersist(struct cam_device *device, int argc, char **argv,
+		char *combinedopt, int retry_count, int timeout, int verbose,
+		int err_recover);
 char *cget(void *hook, char *name);
 int iget(void *hook, char *name);
 void arg_put(void *hook, int letter, void *arg, int count, char *name);

Added: head/sbin/camcontrol/persist.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sbin/camcontrol/persist.c	Thu Jul  3 23:09:44 2014	(r268240)
@@ -0,0 +1,966 @@
+/*-
+ * Copyright (c) 2013 Spectra Logic Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for further
+ *    binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ *
+ * Authors: Ken Merry           (Spectra Logic Corporation)
+ */
+/*
+ * SCSI Persistent Reservation support for camcontrol(8).
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "camcontrol.h"
+
+struct persist_transport_id {
+	struct scsi_transportid_header *hdr;
+	unsigned int alloc_len;
+	STAILQ_ENTRY(persist_transport_id) links;
+};
+
+/*
+ * Service Actions for PERSISTENT RESERVE IN.
+ */
+static struct scsi_nv persist_in_actions[] = {
+	{ "read_keys", SPRI_RK },
+	{ "read_reservation", SPRI_RR },
+	{ "report_capabilities", SPRI_RC },
+	{ "read_full_status", SPRI_RS }
+};
+
+/*
+ * Service Actions for PERSISTENT RESERVE OUT.
+ */
+static struct scsi_nv persist_out_actions[] = {
+	{ "register", SPRO_REGISTER },
+	{ "reserve", SPRO_RESERVE },
+	{ "release" , SPRO_RELEASE },
+	{ "clear", SPRO_CLEAR },
+	{ "preempt", SPRO_PREEMPT },
+	{ "preempt_abort", SPRO_PRE_ABO },
+	{ "register_ignore", SPRO_REG_IGNO },
+	{ "register_move", SPRO_REG_MOVE },
+	{ "replace_lost", SPRO_REPL_LOST_RES }
+};
+
+/*
+ * Known reservation scopes.  As of SPC-4, only LU_SCOPE is used in the
+ * spec.  The others are obsolete.
+ */
+static struct scsi_nv persist_scope_table[] = {
+	{ "lun", SPR_LU_SCOPE },
+	{ "extent", SPR_EXTENT_SCOPE },
+	{ "element", SPR_ELEMENT_SCOPE }
+};
+
+/*
+ * Reservation types.  The longer name for a given reservation type is
+ * listed first, so that it makes more sense when we print out the
+ * reservation type.  We step through the table linearly when looking for
+ * the text name for a particular numeric reservation type value.
+ */
+static struct scsi_nv persist_type_table[] = {
+	{ "read_shared", SPR_TYPE_RD_SHARED },
+	{ "write_exclusive", SPR_TYPE_WR_EX },
+	{ "wr_ex", SPR_TYPE_WR_EX },
+	{ "read_exclusive", SPR_TYPE_RD_EX },
+	{ "rd_ex", SPR_TYPE_RD_EX },
+	{ "exclusive_access", SPR_TYPE_EX_AC },
+	{ "ex_ac", SPR_TYPE_EX_AC },
+	{ "write_exclusive_reg_only", SPR_TYPE_WR_EX_RO },
+	{ "wr_ex_ro", SPR_TYPE_WR_EX_RO },
+	{ "exclusive_access_reg_only", SPR_TYPE_EX_AC_RO },
+	{ "ex_ac_ro", SPR_TYPE_EX_AC_RO },
+	{ "write_exclusive_all_regs", SPR_TYPE_WR_EX_AR },
+	{ "wr_ex_ar", SPR_TYPE_WR_EX_AR },
+	{ "exclusive_access_all_regs", SPR_TYPE_EX_AC_AR },
+	{ "ex_ac_ar", SPR_TYPE_EX_AC_AR }
+};
+
+/*
+ * Print out the standard scope/type field.
+ */
+static void
+persist_print_scopetype(uint8_t scopetype)
+{
+	const char *tmpstr;
+	int num_entries;
+
+	num_entries = sizeof(persist_scope_table) /
+		      sizeof(persist_scope_table[0]);
+	tmpstr = scsi_nv_to_str(persist_scope_table, num_entries,
+				scopetype & SPR_SCOPE_MASK);
+	fprintf(stdout, "Scope: %s (%#x)\n", (tmpstr != NULL) ? tmpstr :
+		"Unknown", (scopetype & SPR_SCOPE_MASK) >> SPR_SCOPE_SHIFT);
+
+	num_entries = sizeof(persist_type_table) /
+		      sizeof(persist_type_table[0]);
+	tmpstr = scsi_nv_to_str(persist_type_table, num_entries,
+				scopetype & SPR_TYPE_MASK);
+	fprintf(stdout, "Type: %s (%#x)\n", (tmpstr != NULL) ? tmpstr :
+		"Unknown", scopetype & SPR_TYPE_MASK);
+}
+
+static void
+persist_print_transportid(uint8_t *buf, uint32_t len)
+{
+	struct sbuf *sb;
+
+	sb = sbuf_new_auto();
+	if (sb == NULL)
+		fprintf(stderr, "Unable to allocate sbuf\n");
+
+	scsi_transportid_sbuf(sb, (struct scsi_transportid_header *)buf, len);
+
+	sbuf_finish(sb);
+
+	fprintf(stdout, "%s\n", sbuf_data(sb));
+
+	sbuf_delete(sb);
+}
+
+/*
+ * Print out a persistent reservation.  This is used with the READ
+ * RESERVATION (0x01) service action of the PERSISTENT RESERVE IN command.
+ */
+static void
+persist_print_res(struct scsi_per_res_in_header *hdr, uint32_t valid_len)
+{
+	uint32_t length;
+	struct scsi_per_res_in_rsrv *res;
+
+	length = scsi_4btoul(hdr->length);
+	length = MIN(length, valid_len);
+
+	res = (struct scsi_per_res_in_rsrv *)hdr;
+
+	if (length < sizeof(res->data) - sizeof(res->data.extent_length)) {
+		if (length == 0)
+			fprintf(stdout, "No reservations.\n");
+		else
+			warnx("unable to print reservation, only got %u "
+			      "valid bytes", length);
+		return;
+	}
+	fprintf(stdout, "PRgeneration: %#x\n",
+		scsi_4btoul(res->header.generation));
+	fprintf(stdout, "Reservation Key: %#jx\n",
+		(uintmax_t)scsi_8btou64(res->data.reservation));
+	fprintf(stdout, "Scope address: %#x\n",
+		scsi_4btoul(res->data.scope_addr));
+
+	persist_print_scopetype(res->data.scopetype);
+
+	fprintf(stdout, "Extent length: %u\n",
+		scsi_2btoul(res->data.extent_length));
+}
+
+/*
+ * Print out persistent reservation keys.  This is used with the READ KEYS
+ * service action of the PERSISTENT RESERVE IN command.
+ */
+static void
+persist_print_keys(struct scsi_per_res_in_header *hdr, uint32_t valid_len)
+{
+	uint32_t length, num_keys, i;
+	struct scsi_per_res_key *key;
+
+	length = scsi_4btoul(hdr->length);
+	length = MIN(length, valid_len);
+
+	num_keys = length / sizeof(*key);
+
+	fprintf(stdout, "PRgeneration: %#x\n", scsi_4btoul(hdr->generation));
+	fprintf(stdout, "%u key%s%s\n", num_keys, (num_keys == 1) ? "" : "s",
+		(num_keys == 0) ? "." : ":");
+
+	for (i = 0, key = (struct scsi_per_res_key *)&hdr[1]; i < num_keys;
+	     i++, key++) {
+		fprintf(stdout, "%u: %#jx\n", i,
+			(uintmax_t)scsi_8btou64(key->key));
+	}
+}
+
+/*
+ * Print out persistent reservation capabilities.  This is used with the
+ * REPORT CAPABILITIES service action of the PERSISTENT RESERVE IN command.
+ */
+static void
+persist_print_cap(struct scsi_per_res_cap *cap, uint32_t valid_len)
+{
+	uint32_t length;
+	int check_type_mask = 0;
+
+	length = scsi_2btoul(cap->length);
+	length = MIN(length, valid_len);
+
+	if (length < __offsetof(struct scsi_per_res_cap, type_mask)) {
+		fprintf(stdout, "Insufficient data (%u bytes) to report "
+			"full capabilities\n", length);
+		return;
+	}
+	if (length >= __offsetof(struct scsi_per_res_cap, reserved))
+		check_type_mask = 1;
+	
+	fprintf(stdout, "Replace Lost Reservation Capable (RLR_C): %d\n",
+		(cap->flags1 & SPRI_RLR_C) ? 1 : 0);
+	fprintf(stdout, "Compatible Reservation Handling (CRH): %d\n",
+		(cap->flags1 & SPRI_CRH) ? 1 : 0);
+	fprintf(stdout, "Specify Initiator Ports Capable (SIP_C): %d\n",
+		(cap->flags1 & SPRI_SIP_C) ? 1 : 0);
+	fprintf(stdout, "All Target Ports Capable (ATP_C): %d\n",
+		(cap->flags1 & SPRI_ATP_C) ? 1 : 0);
+	fprintf(stdout, "Persist Through Power Loss Capable (PTPL_C): %d\n",
+		(cap->flags1 & SPRI_PTPL_C) ? 1 : 0);
+	fprintf(stdout, "ALLOW COMMANDS field: (%#x)\n",
+		(cap->flags2 & SPRI_ALLOW_CMD_MASK) >> SPRI_ALLOW_CMD_SHIFT);
+	/*
+	 * These cases are cut-and-pasted from SPC4r36l.  There is no
+	 * succinct way to describe these otherwise, and even with the
+	 * verbose description, the user will probably have to refer to
+	 * the spec to fully understand what is going on.
+	 */
+	switch (cap->flags2 & SPRI_ALLOW_CMD_MASK) {
+	case SPRI_ALLOW_1:
+		fprintf(stdout,
+"    The device server allows the TEST UNIT READY command through Write\n"
+"    Exclusive type reservations and Exclusive Access type reservations\n"
+"    and does not provide information about whether the following commands\n"
+"    are allowed through Write Exclusive type reservations:\n"
+"        a) the MODE SENSE command, READ ATTRIBUTE command, READ BUFFER\n"
+"           command, RECEIVE COPY RESULTS command, RECEIVE DIAGNOSTIC\n"
+"           RESULTS command, REPORT SUPPORTED OPERATION CODES command,\n"
+"           and REPORT SUPPORTED TASK MANAGEMENT FUNCTION command; and\n"
+"        b) the READ DEFECT DATA command (see SBC-3).\n");
+		break;
+	case SPRI_ALLOW_2:
+		fprintf(stdout,
+"    The device server allows the TEST UNIT READY command through Write\n"
+"    Exclusive type reservations and Exclusive Access type reservations\n"
+"    and does not allow the following commands through Write Exclusive type\n"
+"    reservations:\n"
+"        a) the MODE SENSE command, READ ATTRIBUTE command, READ BUFFER\n"
+"           command, RECEIVE DIAGNOSTIC RESULTS command, REPORT SUPPORTED\n"
+"           OPERATION CODES command, and REPORT SUPPORTED TASK MANAGEMENT\n"
+"           FUNCTION command; and\n"
+"        b) the READ DEFECT DATA command.\n"
+"    The device server does not allow the RECEIVE COPY RESULTS command\n"
+"    through Write Exclusive type reservations or Exclusive Access type\n"
+"    reservations.\n");
+		break;
+	case SPRI_ALLOW_3:
+		fprintf(stdout,
+"    The device server allows the TEST UNIT READY command through Write\n"
+"    Exclusive type reservations and Exclusive Access type reservations\n"
+"    and allows the following commands through Write Exclusive type\n"
+"    reservations:\n"
+"        a) the MODE SENSE command, READ ATTRIBUTE command, READ BUFFER\n"
+"           command, RECEIVE DIAGNOSTIC RESULTS command, REPORT SUPPORTED\n"
+"           OPERATION CODES command, and REPORT SUPPORTED TASK MANAGEMENT\n"
+"           FUNCTION command; and\n"
+"        b) the READ DEFECT DATA command.\n"
+"    The device server does not allow the RECEIVE COPY RESULTS command\n"
+"    through Write Exclusive type reservations or Exclusive Access type\n"
+"    reservations.\n");
+		break;
+	case SPRI_ALLOW_4:
+		fprintf(stdout,
+"    The device server allows the TEST UNIT READY command and the RECEIVE\n"
+"    COPY RESULTS command through Write Exclusive type reservations and\n"
+"    Exclusive Access type reservations and allows the following commands\n"
+"    through Write Exclusive type reservations:\n"
+"        a) the MODE SENSE command, READ ATTRIBUTE command, READ BUFFER\n"
+"           command, RECEIVE DIAGNOSTIC RESULTS command, REPORT SUPPORTED\n"
+"           OPERATION CODES command, and REPORT SUPPORTED TASK MANAGEMENT\n"
+"           FUNCTION command; and\n"
+"        b) the READ DEFECT DATA command.\n");
+		break;
+	case SPRI_ALLOW_NA:
+		fprintf(stdout,
+"    No information is provided about whether certain commands are allowed\n"
+"    through certain types of persistent reservations.\n");
+		break;
+	default:
+		fprintf(stdout,
+"    Unknown ALLOW COMMANDS value %#x\n",
+			(cap->flags2 & SPRI_ALLOW_CMD_MASK) >>
+			SPRI_ALLOW_CMD_SHIFT);
+		break;
+	}
+	fprintf(stdout, "Persist Through Power Loss Activated (PTPL_A): %d\n",
+		(cap->flags2 & SPRI_PTPL_A) ? 1 : 0);
+	if ((check_type_mask != 0)
+	 && (cap->flags2 & SPRI_TMV)) {
+		fprintf(stdout, "Supported Persistent Reservation Types:\n");
+		fprintf(stdout, "    Write Exclusive - All Registrants "
+			"(WR_EX_AR): %d\n",
+			(cap->type_mask[0] & SPRI_TM_WR_EX_AR)? 1 : 0);
+		fprintf(stdout, "    Exclusive Access - Registrants Only "
+			"(EX_AC_RO): %d\n",
+			(cap->type_mask[0] & SPRI_TM_EX_AC_RO) ? 1 : 0);
+		fprintf(stdout, "    Write Exclusive - Registrants Only "
+			"(WR_EX_RO): %d\n",
+			(cap->type_mask[0] & SPRI_TM_WR_EX_RO)? 1 : 0);
+		fprintf(stdout, "    Exclusive Access (EX_AC): %d\n",
+			(cap->type_mask[0] & SPRI_TM_EX_AC) ? 1 : 0);
+		fprintf(stdout, "    Write Exclusive (WR_EX): %d\n",
+			(cap->type_mask[0] & SPRI_TM_WR_EX) ? 1 : 0);
+		fprintf(stdout, "    Exclusive Access - All Registrants "
+			"(EX_AC_AR): %d\n",
+			(cap->type_mask[1] & SPRI_TM_EX_AC_AR) ? 1 : 0);
+	} else {
+		fprintf(stdout, "Persistent Reservation Type Mask is NOT "
+			"valid\n");
+	}
+
+	
+}
+
+static void
+persist_print_full(struct scsi_per_res_in_header *hdr, uint32_t valid_len)
+{
+	uint32_t length, len_to_go = 0;
+	struct scsi_per_res_in_full_desc *desc;
+	uint8_t *cur_pos;
+	int i;
+
+	length = scsi_4btoul(hdr->length);
+	length = MIN(length, valid_len);
+
+	if (length < sizeof(*desc)) {
+		if (length == 0)
+			fprintf(stdout, "No reservations.\n");
+		else
+			warnx("unable to print reservation, only got %u "
+			      "valid bytes", length);
+		return;
+	}
+
+	fprintf(stdout, "PRgeneration: %#x\n", scsi_4btoul(hdr->generation));
+	cur_pos = (uint8_t *)&hdr[1];
+	for (len_to_go = length, i = 0,
+	     desc = (struct scsi_per_res_in_full_desc *)cur_pos;
+	     len_to_go >= sizeof(*desc);
+	     desc = (struct scsi_per_res_in_full_desc *)cur_pos, i++) {
+		uint32_t additional_length, cur_length;
+
+
+		fprintf(stdout, "Reservation Key: %#jx\n",
+			(uintmax_t)scsi_8btou64(desc->res_key.key));
+		fprintf(stdout, "All Target Ports (ALL_TG_PT): %d\n",
+			(desc->flags & SPRI_FULL_ALL_TG_PT) ? 1 : 0);
+		fprintf(stdout, "Reservation Holder (R_HOLDER): %d\n",
+			(desc->flags & SPRI_FULL_R_HOLDER) ? 1 : 0);
+		
+		if (desc->flags & SPRI_FULL_R_HOLDER)
+			persist_print_scopetype(desc->scopetype);
+
+		if ((desc->flags & SPRI_FULL_ALL_TG_PT) == 0)
+			fprintf(stdout, "Relative Target Port ID: %#x\n",
+				scsi_2btoul(desc->rel_trgt_port_id));
+
+		additional_length = scsi_4btoul(desc->additional_length);
+
+		persist_print_transportid(desc->transport_id,
+					  additional_length);
+
+		cur_length = sizeof(*desc) + additional_length;
+		len_to_go -= cur_length;
+		cur_pos += cur_length;
+	}
+}
+
+int
+scsipersist(struct cam_device *device, int argc, char **argv, char *combinedopt,
+	    int retry_count, int timeout, int verbosemode, int err_recover)
+{
+	union ccb *ccb = NULL;
+	int c, in = 0, out = 0;
+	int action = -1, num_ids = 0;
+	int error = 0;
+	uint32_t res_len = 0;
+	unsigned long rel_tgt_port = 0;
+	uint8_t *res_buf = NULL;
+	int scope = SPR_LU_SCOPE, res_type = 0, key_set = 0, sa_key_set = 0;
+	struct persist_transport_id *id, *id2;
+	STAILQ_HEAD(, persist_transport_id) transport_id_list;
+	uint64_t key = 0, sa_key = 0;
+	struct scsi_nv *table = NULL;
+	size_t table_size = 0, id_len = 0;
+	uint32_t valid_len = 0;
+	int all_tg_pt = 0, aptpl = 0, spec_i_pt = 0, unreg = 0,rel_port_set = 0;
+
+	STAILQ_INIT(&transport_id_list);
+
+	ccb = cam_getccb(device);
+	if (ccb == NULL) {
+		warnx("%s: error allocating CCB", __func__);
+		error = 1;
+		goto bailout;
+	}
+
+	bzero(&(&ccb->ccb_h)[1],
+	      sizeof(union ccb) - sizeof(struct ccb_hdr));
+
+	while ((c = getopt(argc, argv, combinedopt)) != -1) {
+		switch (c) {
+		case 'a':
+			all_tg_pt = 1;
+			break;
+		case 'I': {
+			int error_str_len = 128;
+			char error_str[error_str_len];
+			char *id_str;
+
+			id = malloc(sizeof(*id));
+			if (id == NULL) {
+				warnx("%s: error allocating %zu bytes",
+				    __func__, sizeof(*id));
+				error = 1;
+				goto bailout;
+			}
+			bzero(id, sizeof(*id));
+
+			id_str = strdup(optarg);
+			if (id_str == NULL) {
+				warnx("%s: error duplicating string %s",
+				    __func__, optarg);
+				free(id);
+				error = 1;
+				goto bailout;
+			}
+			error = scsi_parse_transportid(id_str, &id->hdr,
+			    &id->alloc_len, error_str, error_str_len);
+			if (error != 0) {
+				warnx("%s", error_str);
+				error = 1;
+				free(id);
+				free(id_str);
+				goto bailout;
+			}
+			free(id_str);
+
+			STAILQ_INSERT_TAIL(&transport_id_list, id, links);
+			num_ids++;
+			id_len += id->alloc_len;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Thu Jul  3 23:12:43 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id CFA1D56C;
 Thu,  3 Jul 2014 23:12:43 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BD8472F85;
 Thu,  3 Jul 2014 23:12:43 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s63NChXw045082;
 Thu, 3 Jul 2014 23:12:43 GMT (envelope-from hiren@svn.freebsd.org)
Received: (from hiren@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s63NChq9045081;
 Thu, 3 Jul 2014 23:12:43 GMT (envelope-from hiren@svn.freebsd.org)
Message-Id: <201407032312.s63NChq9045081@svn.freebsd.org>
From: Hiren Panchasara 
Date: Thu, 3 Jul 2014 23:12:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268241 - head/sys/netinet
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 03 Jul 2014 23:12:43 -0000

Author: hiren
Date: Thu Jul  3 23:12:43 2014
New Revision: 268241
URL: http://svnweb.freebsd.org/changeset/base/268241

Log:
  Fix a typo.

Modified:
  head/sys/netinet/tcp_output.c

Modified: head/sys/netinet/tcp_output.c
==============================================================================
--- head/sys/netinet/tcp_output.c	Thu Jul  3 23:09:44 2014	(r268240)
+++ head/sys/netinet/tcp_output.c	Thu Jul  3 23:12:43 2014	(r268241)
@@ -1160,7 +1160,7 @@ send:
 	 * the template, but need a way to checksum without them.
 	 */
 	/*
-	 * m->m_pkthdr.len should have been set before cksum calcuration,
+	 * m->m_pkthdr.len should have been set before checksum calculation,
 	 * because in6_cksum() need it.
 	 */
 #ifdef INET6

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  4 04:47:30 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2E7403D3;
 Fri,  4 Jul 2014 04:47:30 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 023CF2C50;
 Fri,  4 Jul 2014 04:47:30 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s644lT5l006719;
 Fri, 4 Jul 2014 04:47:29 GMT (envelope-from eadler@svn.freebsd.org)
Received: (from eadler@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s644lT4O006716;
 Fri, 4 Jul 2014 04:47:29 GMT (envelope-from eadler@svn.freebsd.org)
Message-Id: <201407040447.s644lT4O006716@svn.freebsd.org>
From: Eitan Adler 
Date: Fri, 4 Jul 2014 04:47:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268242 - head/usr.bin/look
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 04 Jul 2014 04:47:30 -0000

Author: eadler
Date: Fri Jul  4 04:47:29 2014
New Revision: 268242
URL: http://svnweb.freebsd.org/changeset/base/268242

Log:
  look:	implement long options
  	gentoo has "util-linux 2.24.1" with long options.  Other distributions
  	have similar.
  
  	usage() is intentionally unchanged to keep it short and sweet
  
  Reviewed by:	jmg
  Discussed with:	adrian, jilles

Modified:
  head/usr.bin/look/look.1
  head/usr.bin/look/look.c

Modified: head/usr.bin/look/look.1
==============================================================================
--- head/usr.bin/look/look.1	Thu Jul  3 23:12:43 2014	(r268241)
+++ head/usr.bin/look/look.1	Fri Jul  4 04:47:29 2014	(r268242)
@@ -63,12 +63,12 @@ alphabetic characters is ignored.
 .Pp
 The following options are available:
 .Bl -tag -width indent
-.It Fl d
+.It Fl d , -alphanum
 Dictionary character set and order, i.e., only alphanumeric characters
 are compared.
-.It Fl f
+.It Fl f , -ignore-case
 Ignore the case of alphabetic characters.
-.It Fl t
+.It Fl t , -terminate Ar termchar
 Specify a string termination character, i.e., only the characters
 in
 .Ar string
@@ -106,7 +106,9 @@ implementation.
 .Pp
 The
 .Fl a
-flag is ignored for compability.
+and
+.Fl -alternative
+flags are ignored for compability.
 .Sh SEE ALSO
 .Xr grep 1 ,
 .Xr sort 1

Modified: head/usr.bin/look/look.c
==============================================================================
--- head/usr.bin/look/look.c	Thu Jul  3 23:12:43 2014	(r268241)
+++ head/usr.bin/look/look.c	Fri Jul  4 04:47:29 2014	(r268242)
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -88,6 +89,14 @@ static void	 print_from(wchar_t *, unsig
 
 static void usage(void);
 
+static struct option longopts[] = {
+	{ "alternative",no_argument,	NULL, 'a' },
+	{ "alphanum",	no_argument,	NULL, 'd' },
+	{ "ignore-case",no_argument,	NULL, 'i' },
+	{ "terminate",	required_argument, NULL, 't'},
+	{ NULL,		0,		NULL, 0 },
+};
+
 int
 main(int argc, char *argv[])
 {
@@ -102,7 +111,7 @@ main(int argc, char *argv[])
 
 	file = _path_words;
 	termchar = L'\0';
-	while ((ch = getopt(argc, argv, "adft:")) != -1)
+	while ((ch = getopt_long(argc, argv, "+adft:", longopts, NULL)) != -1)
 		switch(ch) {
 		case 'a':
 			/* COMPATIBILITY */

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  4 09:29:45 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 56DD0FA5;
 Fri,  4 Jul 2014 09:29:45 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4386223EC;
 Fri,  4 Jul 2014 09:29:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s649TjkS041303;
 Fri, 4 Jul 2014 09:29:45 GMT (envelope-from mr@svn.freebsd.org)
Received: (from mr@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s649ThgV041291;
 Fri, 4 Jul 2014 09:29:43 GMT (envelope-from mr@svn.freebsd.org)
Message-Id: <201407040929.s649ThgV041291@svn.freebsd.org>
From: Michael Reifenberger 
Date: Fri, 4 Jul 2014 09:29:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268246 - head/tools/tools/nanobsd/rescue
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 04 Jul 2014 09:29:45 -0000

Author: mr
Date: Fri Jul  4 09:29:43 2014
New Revision: 268246
URL: http://svnweb.freebsd.org/changeset/base/268246

Log:
  Adopt to current and other changes:
  	use dedicated kernel files with some local settings
  	use mkimg for ISO building
  	put images into separate directory and rename them for better consistency

Added:
  head/tools/tools/nanobsd/rescue/R32   (contents, props changed)
  head/tools/tools/nanobsd/rescue/R64   (contents, props changed)
Modified:
  head/tools/tools/nanobsd/rescue/build.sh
  head/tools/tools/nanobsd/rescue/common
  head/tools/tools/nanobsd/rescue/merge.sh
  head/tools/tools/nanobsd/rescue/rescue_amd64.conf
  head/tools/tools/nanobsd/rescue/rescue_i386.conf

Added: head/tools/tools/nanobsd/rescue/R32
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/tools/nanobsd/rescue/R32	Fri Jul  4 09:29:43 2014	(r268246)
@@ -0,0 +1,14 @@
+#
+# R32 -- Generic kernel configuration file with modifications for rescue.
+#
+# $FreeBSD$
+
+include GENERIC
+
+ident	R32
+
+nooptions	INVARIANTS
+nooptions	INVARIANT_SUPPORT
+nooptions	WITNESS
+nooptions	WITNESS_SKIPSPIN
+nooptions	MALLOC_DEBUG_MAXZONES

Added: head/tools/tools/nanobsd/rescue/R64
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/tools/nanobsd/rescue/R64	Fri Jul  4 09:29:43 2014	(r268246)
@@ -0,0 +1,14 @@
+#
+# R64 -- Generic kernel configuration file with modifications for rescue.
+#
+# $FreeBSD$
+
+include GENERIC
+
+ident	R64
+
+nooptions	INVARIANTS
+nooptions	INVARIANT_SUPPORT
+nooptions	WITNESS
+nooptions	WITNESS_SKIPSPIN
+nooptions	MALLOC_DEBUG_MAXZONES

Modified: head/tools/tools/nanobsd/rescue/build.sh
==============================================================================
--- head/tools/tools/nanobsd/rescue/build.sh	Fri Jul  4 07:02:11 2014	(r268245)
+++ head/tools/tools/nanobsd/rescue/build.sh	Fri Jul  4 09:29:43 2014	(r268246)
@@ -3,6 +3,8 @@
 # $FreeBSD$
 #
 
+today=`date '+%Y%m%d'`
+
 if [ -z "${1}" -o \! -f "${1}" ]; then
   echo "Usage: $0 cfg_file [-bhiknw]"
   echo "-i : skip image build"
@@ -15,4 +17,26 @@ fi
 CFG="${1}"
 shift;
 
+if [ \! -d /usr/obj/Rescue ]; then
+  mkdir -p /usr/obj/Rescue
+fi
+
 sh ../nanobsd.sh $* -c ${CFG}
+
+F32="/usr/obj/Rescue/rescue_${today}_x32"
+D32="/usr/obj/nanobsd.rescue_i386"
+if [ -f "${D32}/_.disk.full" ]; then
+  mv "${D32}/_.disk.full" "${F32}.img"
+fi
+if [ -f "${D32}/_.disk.iso" ]; then
+  mv "${D32}/_.disk.iso" "${F32}.iso"
+fi
+
+F64="/usr/obj/Rescue/rescue_${today}_x64"
+D64="/usr/obj/nanobsd.rescue_amd64"
+if [ -f "${D64}/_.disk.full" ]; then
+  mv "${D64}/_.disk.full" "${F64}.img"
+fi
+if [ -f "${D64}/_.disk.iso" ]; then
+  mv "${D64}/_.disk.iso" "${F64}.iso"
+fi

Modified: head/tools/tools/nanobsd/rescue/common
==============================================================================
--- head/tools/tools/nanobsd/rescue/common	Fri Jul  4 07:02:11 2014	(r268245)
+++ head/tools/tools/nanobsd/rescue/common	Fri Jul  4 09:29:43 2014	(r268246)
@@ -3,7 +3,7 @@
 #
 NANO_TOOLS=`pwd`
 NANO_PACKAGE_DIR=`pwd`/Pkg
-NANO_RAM_TMPVARSIZE=20480
+NANO_RAM_TMPVARSIZE=40960
 NANO_PMAKE="make -j 8"
 NANO_LABEL="rescue"
 NANO_RAM_TMPVARSIZE=40960
@@ -68,6 +68,7 @@ cust_etc_cfg () (
 	echo "#ifconfig_fxp0=\"AUTO\"" >> etc/rc.conf
 	echo "#sshd_enable=\"YES\"" >> etc/rc.conf
 	echo "/dev/ufs/${NANO_LABEL}s1a / ufs ro,noatime 0 0" > etc/fstab
+	echo "/dev/${NANO_DRIVE}s3 /cfg ufs rw,noauto 2 2" >> etc/fstab
 	echo "tmpfs /boot/zfs tmpfs rw,size=1048576,mode=777 0 0" >> etc/fstab
 	echo "ports:/usr/ports /usr/ports nfs rw,noauto,noatime,bg,soft,intr,nfsv3 0 0" >> etc/fstab
 #	echo "/dev/ad1s1a /scratch ufs rw,noauto,noatime 0 0" >> etc/fstab
@@ -100,9 +101,9 @@ last_orders () (
 	touch conf/default/etc/.keepme
 	touch conf/default/var/.keepme
 	cd ..
-	mkisofs -quiet -r -J -no-emul-boot \
-	-V ${NANO_LABEL} \
-	-b boot/cdboot -o _.disk.iso _.w/
+	makefs -t cd9660 -o rockridge \
+	-o label="${NANO_LABEL}" -o publisher="RMX" \
+	-o bootimage="i386;_.w/boot/cdboot" -o no-emul-boot _.disk.iso _.w/
 	)
 )
 

Modified: head/tools/tools/nanobsd/rescue/merge.sh
==============================================================================
--- head/tools/tools/nanobsd/rescue/merge.sh	Fri Jul  4 07:02:11 2014	(r268245)
+++ head/tools/tools/nanobsd/rescue/merge.sh	Fri Jul  4 09:29:43 2014	(r268246)
@@ -1,18 +1,28 @@
 #!/bin/sh
 # $FreeBSD$
 
-D1="/usr/obj/nanobsd.rescue_i386"
-D2="/usr/obj/nanobsd.rescue_amd64"
+today=`date '+%Y%m%d'`
 
-MD=`mdconfig -a -t vnode -f ${D1}/_.disk.full`
+I32="/usr/obj/Rescue/rescue_${today}_x32.img"
+I64="/usr/obj/Rescue/rescue_${today}_x64.img"
+IAL="/usr/obj/Rescue/rescue_${today}_xal.img"
+D64="/usr/obj/nanobsd.rescue_amd64"
+MNT="/usr/obj/Rescue/_mnt"
+
+if [ \! -d "$MNT" ]; then
+  mkdir "$MNT"
+fi
 
-dd if=${D2}/_.disk.image of=/dev/${MD}s2 bs=128k
+dd if=${I32} of=${IAL} bs=128k
+MD=`mdconfig -a -t vnode -f ${IAL}`
+
+dd if=${D64}/_.disk.image of=/dev/${MD}s2 bs=128k
 tunefs -L rescues2a /dev/${MD}s2a
-mount /dev/${MD}s2a ${D1}/_.mnt
+mount /dev/${MD}s2a ${MNT}
 
-sed -i "" -e 's/rescues1/rescues2/' ${D1}/_.mnt/conf/base/etc/fstab
-sed -i "" -e 's/rescues1/rescues2/' ${D1}/_.mnt/etc/fstab
+sed -i "" -e 's/rescues1/rescues2/' ${MNT}/conf/base/etc/fstab
+sed -i "" -e 's/rescues1/rescues2/' ${MNT}/etc/fstab
 
-umount ${D1}/_.mnt
+umount ${MNT}
 
 mdconfig -d -u ${MD}

Modified: head/tools/tools/nanobsd/rescue/rescue_amd64.conf
==============================================================================
--- head/tools/tools/nanobsd/rescue/rescue_amd64.conf	Fri Jul  4 07:02:11 2014	(r268245)
+++ head/tools/tools/nanobsd/rescue/rescue_amd64.conf	Fri Jul  4 09:29:43 2014	(r268246)
@@ -1,7 +1,7 @@
 #
 # $FreeBSD$
 #
-NANO_KERNEL=GENERIC
+NANO_KERNEL=R64
 NANO_ARCH=amd64
 TARGET_ARCH=amd64; export TARGET_ARCH
 #TARGET_CPUTYPE=amd64; export TARGET_CPUTYPE

Modified: head/tools/tools/nanobsd/rescue/rescue_i386.conf
==============================================================================
--- head/tools/tools/nanobsd/rescue/rescue_i386.conf	Fri Jul  4 07:02:11 2014	(r268245)
+++ head/tools/tools/nanobsd/rescue/rescue_i386.conf	Fri Jul  4 09:29:43 2014	(r268246)
@@ -1,7 +1,7 @@
 #
 # $FreeBSD$
 #
-NANO_KERNEL=GENERIC
+NANO_KERNEL=R32
 NANO_ARCH=i386
 TARGET_ARCH=i386; export TARGET_ARCH
 #TARGET_CPUTYPE=i386; export TARGET_CPUTYPE

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  4 14:32:16 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 428C5B0C;
 Fri,  4 Jul 2014 14:32:16 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 300992FFD;
 Fri,  4 Jul 2014 14:32:16 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s64EWGVq092343;
 Fri, 4 Jul 2014 14:32:16 GMT (envelope-from jmg@svn.freebsd.org)
Received: (from jmg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64EWGwC092342;
 Fri, 4 Jul 2014 14:32:16 GMT (envelope-from jmg@svn.freebsd.org)
Message-Id: <201407041432.s64EWGwC092342@svn.freebsd.org>
From: John-Mark Gurney 
Date: Fri, 4 Jul 2014 14:32:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268253 - head/sys/conf
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 04 Jul 2014 14:32:16 -0000

Author: jmg
Date: Fri Jul  4 14:32:15 2014
New Revision: 268253
URL: http://svnweb.freebsd.org/changeset/base/268253

Log:
  BREAK_TO_DEBUGGER is not just serial console anymore, it controls all
  console's ability to enter the debugger....  rwatson forgot to document
  this when he changed it back in 2011...  There is more docs to write
  about this, but at least fix this for now...
  
  Reviewed by:	emaste
  MFC after:	1 week

Modified:
  head/sys/conf/NOTES

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Fri Jul  4 14:00:29 2014	(r268252)
+++ head/sys/conf/NOTES	Fri Jul  4 14:32:15 2014	(r268253)
@@ -1823,7 +1823,7 @@ hint.uart.0.baud="115200"
 #
 
 # Options for serial drivers that support consoles:
-options 	BREAK_TO_DEBUGGER	# A BREAK on a serial console goes to
+options 	BREAK_TO_DEBUGGER	# A BREAK/DBG on the console goes to
 					# ddb, if available.
 
 # Solaris implements a new BREAK which is initiated by a character

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  4 14:49:40 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 910C554B;
 Fri,  4 Jul 2014 14:49:40 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7E67E2174;
 Fri,  4 Jul 2014 14:49:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s64EnesB098486;
 Fri, 4 Jul 2014 14:49:40 GMT (envelope-from jmg@svn.freebsd.org)
Received: (from jmg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64EneL8098485;
 Fri, 4 Jul 2014 14:49:40 GMT (envelope-from jmg@svn.freebsd.org)
Message-Id: <201407041449.s64EneL8098485@svn.freebsd.org>
From: John-Mark Gurney 
Date: Fri, 4 Jul 2014 14:49:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268254 - head/sys/boot/forth
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 04 Jul 2014 14:49:40 -0000

Author: jmg
Date: Fri Jul  4 14:49:40 2014
New Revision: 268254
URL: http://svnweb.freebsd.org/changeset/base/268254

Log:
  add a hit that you can enable this by default if you want...  necessary
  if you want the keyboard break to work early in boot..
  
  MFC after:	1 week

Modified:
  head/sys/boot/forth/loader.conf

Modified: head/sys/boot/forth/loader.conf
==============================================================================
--- head/sys/boot/forth/loader.conf	Fri Jul  4 14:32:15 2014	(r268253)
+++ head/sys/boot/forth/loader.conf	Fri Jul  4 14:49:40 2014	(r268254)
@@ -134,6 +134,7 @@ module_path="/boot/modules"	# Set the mo
 #vfs.root.mountfrom=""		# Specify root partition in a way the
 				# kernel understands
 #vm.kmem_size=""		# Sets the size of kernel memory (bytes)
+#debug.kdb.break_to_debugger="0" # Allow console to break into debugger.
 #debug.ktr.cpumask="0xf"	# Bitmask of CPUs to enable KTR on
 #debug.ktr.mask="0x1200"	# Bitmask of KTR events to enable
 #debug.ktr.verbose="1"		# Enable console dump of KTR events

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  4 15:55:34 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7AA13A1F;
 Fri,  4 Jul 2014 15:55:34 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5B64A276D;
 Fri,  4 Jul 2014 15:55:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s64FtYLT031014;
 Fri, 4 Jul 2014 15:55:34 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64FtWvP030997;
 Fri, 4 Jul 2014 15:55:32 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201407041555.s64FtWvP030997@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Fri, 4 Jul 2014 15:55:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268256 - in head: sbin/geom/class/part sys/geom/part
 sys/sys usr.sbin/bsdinstall/partedit
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 04 Jul 2014 15:55:34 -0000

Author: nwhitehorn
Date: Fri Jul  4 15:55:32 2014
New Revision: 268256
URL: http://svnweb.freebsd.org/changeset/base/268256

Log:
  After EFI support was added to the installer, it needed to allow boot
  partitions of types other than "freebsd-boot" (in particular, "efi").
  This allows the removal of some nasty hacks for supporting PowerPC systems,
  in particular aliasing freebsd-boot to apple-boot on APM and an IBM-specific
  code on MBR.
  
  This changes the installer to use the correct names, which also breaks a
  degeneracy in the meaning of "freebsd-boot" that allows the addition
  of support for some newer IBM systems that can boot from GPT in addition to
  MBR. Since I have no idea how to detect which those systems are, leave
  the default on IBM PPC systems as MBR for now.

Modified:
  head/sbin/geom/class/part/gpart.8
  head/sys/geom/part/g_part.c
  head/sys/geom/part/g_part.h
  head/sys/geom/part/g_part_apm.c
  head/sys/geom/part/g_part_gpt.c
  head/sys/geom/part/g_part_mbr.c
  head/sys/sys/gpt.h
  head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c

Modified: head/sbin/geom/class/part/gpart.8
==============================================================================
--- head/sbin/geom/class/part/gpart.8	Fri Jul  4 15:09:56 2014	(r268255)
+++ head/sbin/geom/class/part/gpart.8	Fri Jul  4 15:55:32 2014	(r268256)
@@ -553,6 +553,16 @@ for partition types that do not have sym
 Symbolic names currently understood and used by
 .Fx are:
 .Bl -tag -width ".Cm dragonfly-disklabel64"
+.It Cm apple-boot
+The system partition dedicated to storing boot loaders on some Apple
+systems.
+The scheme-specific types are
+.Qq Li "!171"
+for MBR,
+.Qq Li "!Apple_Bootstrap"
+for APM, and
+.Qq Li "!426f6f74-0000-11aa-aa11-00306543ecac"
+for GPT.
 .It Cm bios-boot
 The system partition dedicated to second stage of the boot loader program.
 Usually it is used by the GRUB 2 loader for GPT partitioning schemes.
@@ -823,6 +833,14 @@ A partition that contains a NTFS or exFA
 The scheme-specific type is
 .Qq Li "!7"
 for MBR.
+.It Cm prep-boot
+The system partition dedicated to storing boot loaders on some PowerPC systems,
+notably those made by IBM.
+The scheme-specific types are
+.Qq Li "!65"
+for MBR and
+.Qq Li "!0x9e1a2d38-c612-4316-aa26-8b49521e5a8b"
+for GPT.
 .It Cm vmware-vmfs
 A partition that contains a VMware File System (VMFS).
 The scheme-specific types are
@@ -1018,7 +1036,7 @@ Instead, the 800 KBytes bootstrap code i
 should be written with the
 .Cm gpart bootcode
 command to a partition of type
-.Cm freebsd-boot ,
+.Cm apple-boot ,
 which should also be 800 KB in size.
 .Sh OPERATIONAL FLAGS
 Actions other than the

Modified: head/sys/geom/part/g_part.c
==============================================================================
--- head/sys/geom/part/g_part.c	Fri Jul  4 15:09:56 2014	(r268255)
+++ head/sys/geom/part/g_part.c	Fri Jul  4 15:55:32 2014	(r268256)
@@ -117,6 +117,7 @@ struct g_part_alias_list {
 	{ "dragonfly-legacy", G_PART_ALIAS_DFBSD_LEGACY },
 	{ "dragonfly-hammer", G_PART_ALIAS_DFBSD_HAMMER },
 	{ "dragonfly-hammer2", G_PART_ALIAS_DFBSD_HAMMER2 },
+	{ "prep-boot", G_PART_ALIAS_PREP_BOOT },
 };
 
 SYSCTL_DECL(_kern_geom);

Modified: head/sys/geom/part/g_part.h
==============================================================================
--- head/sys/geom/part/g_part.h	Fri Jul  4 15:09:56 2014	(r268255)
+++ head/sys/geom/part/g_part.h	Fri Jul  4 15:55:32 2014	(r268256)
@@ -84,6 +84,7 @@ enum g_part_alias {
 	G_PART_ALIAS_DFBSD_LEGACY,	/* A DfBSD legacy partition entry */
 	G_PART_ALIAS_DFBSD_HAMMER,	/* A DfBSD HAMMER FS partition entry */
 	G_PART_ALIAS_DFBSD_HAMMER2,	/* A DfBSD HAMMER2 FS partition entry */
+	G_PART_ALIAS_PREP_BOOT,		/* A PREP/CHRP boot partition entry. */
 	/* Keep the following last */
 	G_PART_ALIAS_COUNT
 };

Modified: head/sys/geom/part/g_part_apm.c
==============================================================================
--- head/sys/geom/part/g_part_apm.c	Fri Jul  4 15:09:56 2014	(r268255)
+++ head/sys/geom/part/g_part_apm.c	Fri Jul  4 15:55:32 2014	(r268256)
@@ -149,11 +149,6 @@ apm_parse_type(const char *type, char *b
 		strcpy(buf, APM_ENT_TYPE_APPLE_UFS);
 		return (0);
 	}
-	alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_BOOT);
-	if (!strcasecmp(type, alias)) {
-		strcpy(buf, APM_ENT_TYPE_APPLE_BOOT);
-		return (0);
-	}
 	alias = g_part_alias_name(G_PART_ALIAS_FREEBSD);
 	if (!strcasecmp(type, alias)) {
 		strcpy(buf, APM_ENT_TYPE_FREEBSD);

Modified: head/sys/geom/part/g_part_gpt.c
==============================================================================
--- head/sys/geom/part/g_part_gpt.c	Fri Jul  4 15:09:56 2014	(r268255)
+++ head/sys/geom/part/g_part_gpt.c	Fri Jul  4 15:55:32 2014	(r268256)
@@ -190,6 +190,7 @@ static struct uuid gpt_uuid_dfbsd_hammer
 static struct uuid gpt_uuid_dfbsd_hammer2 = GPT_ENT_TYPE_DRAGONFLY_HAMMER2;
 static struct uuid gpt_uuid_dfbsd_label32 = GPT_ENT_TYPE_DRAGONFLY_LABEL32;
 static struct uuid gpt_uuid_dfbsd_label64 = GPT_ENT_TYPE_DRAGONFLY_LABEL64;
+static struct uuid gpt_uuid_prep_boot = GPT_ENT_TYPE_PREP_BOOT;
 
 static struct g_part_uuid_alias {
 	struct uuid *uuid;
@@ -240,6 +241,7 @@ static struct g_part_uuid_alias {
 	{ &gpt_uuid_dfbsd_hammer2,	G_PART_ALIAS_DFBSD_HAMMER2,	 0 },
 	{ &gpt_uuid_dfbsd_label32,	G_PART_ALIAS_DFBSD,		 0xa5 },
 	{ &gpt_uuid_dfbsd_label64,	G_PART_ALIAS_DFBSD64,		 0xa5 },
+	{ &gpt_uuid_prep_boot,		G_PART_ALIAS_PREP_BOOT,		 0x41 },
 	{ NULL, 0, 0 }
 };
 

Modified: head/sys/geom/part/g_part_mbr.c
==============================================================================
--- head/sys/geom/part/g_part_mbr.c	Fri Jul  4 15:09:56 2014	(r268255)
+++ head/sys/geom/part/g_part_mbr.c	Fri Jul  4 15:55:32 2014	(r268256)
@@ -127,7 +127,7 @@ static struct g_part_mbr_alias {
 	{ DOSPTYP_LINUX,	G_PART_ALIAS_LINUX_DATA },
 	{ DOSPTYP_LINLVM,	G_PART_ALIAS_LINUX_LVM },
 	{ DOSPTYP_LINRAID,	G_PART_ALIAS_LINUX_RAID },
-	{ DOSPTYP_PPCBOOT,	G_PART_ALIAS_FREEBSD_BOOT },
+	{ DOSPTYP_PPCBOOT,	G_PART_ALIAS_PREP_BOOT },
 	{ DOSPTYP_VMFS,		G_PART_ALIAS_VMFS },
 	{ DOSPTYP_VMKDIAG,	G_PART_ALIAS_VMKDIAG },
 };

Modified: head/sys/sys/gpt.h
==============================================================================
--- head/sys/sys/gpt.h	Fri Jul  4 15:09:56 2014	(r268255)
+++ head/sys/sys/gpt.h	Fri Jul  4 15:55:32 2014	(r268256)
@@ -91,6 +91,8 @@ struct gpt_ent {
 	{0x516e7cb8,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}}
 #define	GPT_ENT_TYPE_FREEBSD_ZFS	\
 	{0x516e7cba,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}}
+#define	GPT_ENT_TYPE_PREP_BOOT		\
+	{0x9e1a2d38,0xc612,0x4316,0xaa,0x26,{0x8b,0x49,0x52,0x1e,0x5a,0x8b}}
 
 /*
  * The following are unused but documented here to avoid reuse.

Modified: head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c
==============================================================================
--- head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c	Fri Jul  4 15:09:56 2014	(r268255)
+++ head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c	Fri Jul  4 15:55:32 2014	(r268256)
@@ -60,7 +60,8 @@ is_scheme_bootable(const char *part_type
 	if (strcmp(platform, "ps3") == 0 && strcmp(part_type, "GPT") == 0)
 		return (1);
 	if (strcmp(platform, "chrp") == 0 &&
-	    (strcmp(part_type, "MBR") == 0 || strcmp(part_type, "BSD") == 0))
+	    (strcmp(part_type, "MBR") == 0 || strcmp(part_type, "BSD") == 0 ||
+	     strcmp(part_type, "GPT") == 0))
 		return (1);
 
 	return (0);
@@ -68,13 +69,28 @@ is_scheme_bootable(const char *part_type
 
 size_t
 bootpart_size(const char *part_type) {
+	size_t platlen = sizeof(platform);
+	if (strlen(platform) == 0)
+		sysctlbyname("hw.platform", platform, &platlen, NULL, -1);
+
 	if (strcmp(part_type, "APM") == 0 || strcmp(part_type, "MBR") == 0)
 		return (800*1024);
+	if (strcmp(platform, "chrp") == 0 && strcmp(part_type, "GPT") == 0)
+		return (800*1024);
 	return (0);
 }
 
 const char *
 bootpart_type(const char *scheme) {
+	size_t platlen = sizeof(platform);
+	if (strlen(platform) == 0)
+		sysctlbyname("hw.platform", platform, &platlen, NULL, -1);
+
+	if (strcmp(platform, "chrp") == 0)
+		return ("prep-boot");
+	if (strcmp(platform, "powermac") == 0)
+		return ("apple-boot");
+
 	return ("freebsd-boot");
 }
 
@@ -85,9 +101,14 @@ bootcode_path(const char *part_type) {
 	
 const char *
 partcode_path(const char *part_type) {
+	size_t platlen = sizeof(platform);
+	if (strlen(platform) == 0)
+		sysctlbyname("hw.platform", platform, &platlen, NULL, -1);
+
 	if (strcmp(part_type, "APM") == 0)
 		return ("/boot/boot1.hfs");
-	if (strcmp(part_type, "MBR") == 0)
+	if (strcmp(part_type, "MBR") == 0 ||
+	    (strcmp(platform, "chrp") == 0 && strcmp(part_type, "GPT") == 0))
 		return ("/boot/boot1.elf");
 	return (NULL);
 }

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  4 18:47:26 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 24AB910F;
 Fri,  4 Jul 2014 18:47:26 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id ECF4D2685;
 Fri,  4 Jul 2014 18:47:25 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s64IlPKd011213;
 Fri, 4 Jul 2014 18:47:25 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64IlPfP011210;
 Fri, 4 Jul 2014 18:47:25 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201407041847.s64IlPfP011210@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Fri, 4 Jul 2014 18:47:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268264 - head/usr.bin/mkimg
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 04 Jul 2014 18:47:26 -0000

Author: marcel
Date: Fri Jul  4 18:47:25 2014
New Revision: 268264
URL: http://svnweb.freebsd.org/changeset/base/268264

Log:
  Document the -y option as a unit test option.
  Add missing -v (and -y) to the usage message.
  
  Requested by: eadler@

Modified:
  head/usr.bin/mkimg/mkimg.1
  head/usr.bin/mkimg/mkimg.c

Modified: head/usr.bin/mkimg/mkimg.1
==============================================================================
--- head/usr.bin/mkimg/mkimg.1	Fri Jul  4 18:26:32 2014	(r268263)
+++ head/usr.bin/mkimg/mkimg.1	Fri Jul  4 18:47:25 2014	(r268264)
@@ -24,12 +24,12 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 2, 2014
+.Dd July 4, 2014
 .Dt MKIMG 1
 .Os
 .Sh NAME
 .Nm mkimg
-.Nd "utility to make a disk image"
+.Nd "utility to make disk images"
 .Sh SYNOPSIS
 .Nm
 .Op Fl H Ar heads
@@ -40,6 +40,7 @@
 .Op Fl f Ar format
 .Op Fl o Ar outfile
 .Op Fl v
+.Op Fl y
 .Fl s Ar scheme
 .Fl p Ar partition
 .Op Fl p Ar partition ...
@@ -111,6 +112,16 @@ option increases the level of output tha
 .Nm
 utility prints.
 .Pp
+The
+.Op Fl y
+option is used for testing purposes only and is not to be used in production.
+When present, the
+.Nm
+utility will generate predictable values for Universally Unique Identifiers
+(UUIDs) and time stamps so that consecutive runs of the
+.Nm
+utility will create images that are identical.
+.Pp
 For a complete list of supported partitioning schemes or supported output
 format, or for a detailed description of how to specify partitions, run the
 .Nm

Modified: head/usr.bin/mkimg/mkimg.c
==============================================================================
--- head/usr.bin/mkimg/mkimg.c	Fri Jul  4 18:26:32 2014	(r268263)
+++ head/usr.bin/mkimg/mkimg.c	Fri Jul  4 18:47:25 2014	(r268264)
@@ -75,6 +75,8 @@ usage(const char *why)
 	fprintf(stderr, "\t-o \t-  file to write image into\n");
 	fprintf(stderr, "\t-p \n");
 	fprintf(stderr, "\t-s \n");
+	fprintf(stderr, "\t-v\t\t-  increase verbosity\n");
+	fprintf(stderr, "\t-y\t\t-  [developers] enable unit test\n");
 	fprintf(stderr, "\t-H \t-  number of heads to simulate\n");
 	fprintf(stderr, "\t-P \t-  physical sector size\n");
 	fprintf(stderr, "\t-S \t-  logical sector size\n");

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  4 19:19:00 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E842EA56;
 Fri,  4 Jul 2014 19:18:59 +0000 (UTC)
Received: from mail-ob0-x22d.google.com (mail-ob0-x22d.google.com
 [IPv6:2607:f8b0:4003:c01::22d])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 8D27328FB;
 Fri,  4 Jul 2014 19:18:59 +0000 (UTC)
Received: by mail-ob0-f173.google.com with SMTP id va2so2183175obc.4
 for ; Fri, 04 Jul 2014 12:18:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=IAqUAanYZzOJcQZ8dD5LBadMCw7VyVVzqljaKEmmuCs=;
 b=m+7J4fWoehk6PQ7I3IdX3WmY2B0t4/sd1BsL9sfI+TXhU1NdszsasVYHOyPoopzu8P
 1VMty1/YI9GjdVnZPEozCZ0OJxdn0OaPISSQZAHGaS3kg0PlBGa+sI4H97hSXpQzHKQz
 Sig8l11xTMNCBHDrFLZj+t5Vkf8IrrkAtbPJ7BKI2YDfTApDUD8IZjtSuy29AShPixr8
 xHUnVTwt69W++AcK06/o0vJZa61lFASQ/5PN58eSZkXJsYpoIvSZXhThlWao4HweTtz1
 Xv2dU8mu8O5W++Gw/COKUKNQxytmIFDX+S4hBBJxd1tIMw8XJVI+TnVkY5RbDVpegqLE
 PcWw==
MIME-Version: 1.0
X-Received: by 10.60.47.12 with SMTP id z12mr14312782oem.71.1404501538925;
 Fri, 04 Jul 2014 12:18:58 -0700 (PDT)
Received: by 10.182.142.34 with HTTP; Fri, 4 Jul 2014 12:18:58 -0700 (PDT)
In-Reply-To: <201406222013.s5MKDwHw045376@svn.freebsd.org>
References: <201406222013.s5MKDwHw045376@svn.freebsd.org>
Date: Fri, 4 Jul 2014 15:18:58 -0400
Message-ID: 
Subject: Re: svn commit: r267745 - head/lib/libc/stdlib
From: Benjamin Kaduk 
To: "Pedro F. Giffuni" 
Content-Type: text/plain; charset=UTF-8
X-Content-Filtered-By: Mailman/MimeDel 2.1.18
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 04 Jul 2014 19:19:00 -0000

On Sun, Jun 22, 2014 at 4:13 PM, Pedro F. Giffuni  wrote:

> Author: pfg
> Date: Sun Jun 22 20:13:57 2014
> New Revision: 267745
> URL: http://svnweb.freebsd.org/changeset/base/267745
>
> Log:
>   getopt(3): recognize option:: as GNU extension for "optional options".
>
[...]

>  is to follow.
> +If an individual character is followed by two colons, then the
> +option argument is optional;
> +.Va optarg
> +is set to the rest of the current
> +.Va argv
> +word, or
> +.Dv NULL
> +if there were no more characters in the current word.
> +This is a
> +.Nx
> +extension.
>

.Nx is NetBSD, not GNU...

-Ben

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  4 19:19:05 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1F63EB91;
 Fri,  4 Jul 2014 19:19:05 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 01B0428FC;
 Fri,  4 Jul 2014 19:19:05 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s64JJ47i026150;
 Fri, 4 Jul 2014 19:19:04 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64JJ34c026144;
 Fri, 4 Jul 2014 19:19:03 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407041919.s64JJ34c026144@svn.freebsd.org>
From: Alexander Motin 
Date: Fri, 4 Jul 2014 19:19:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268265 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 04 Jul 2014 19:19:05 -0000

Author: mav
Date: Fri Jul  4 19:19:03 2014
New Revision: 268265
URL: http://svnweb.freebsd.org/changeset/base/268265

Log:
  Remove targ_enable()/targ_disable() frontend methods.
  
  Those methods were never implemented, and I believe that their concept is
  wrong, since single frontend (SCSI port) can not handle several targets.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_frontend.h
  head/sys/cam/ctl/ctl_frontend_cam_sim.c
  head/sys/cam/ctl/ctl_frontend_internal.c
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/cam/ctl/scsi_ctl.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Fri Jul  4 18:47:25 2014	(r268264)
+++ head/sys/cam/ctl/ctl.c	Fri Jul  4 19:19:03 2014	(r268265)
@@ -329,8 +329,6 @@ static int ctl_open(struct cdev *dev, in
 static int ctl_close(struct cdev *dev, int flags, int fmt, struct thread *td);
 static void ctl_ioctl_online(void *arg);
 static void ctl_ioctl_offline(void *arg);
-static int ctl_ioctl_targ_enable(void *arg, struct ctl_id targ_id);
-static int ctl_ioctl_targ_disable(void *arg, struct ctl_id targ_id);
 static int ctl_ioctl_lun_enable(void *arg, struct ctl_id targ_id, int lun_id);
 static int ctl_ioctl_lun_disable(void *arg, struct ctl_id targ_id, int lun_id);
 static int ctl_ioctl_do_datamove(struct ctl_scsiio *ctsio);
@@ -1093,8 +1091,6 @@ ctl_init(void)
 	fe->port_online = ctl_ioctl_online;
 	fe->port_offline = ctl_ioctl_offline;
 	fe->onoff_arg = &softc->ioctl_info;
-	fe->targ_enable = ctl_ioctl_targ_enable;
-	fe->targ_disable = ctl_ioctl_targ_disable;
 	fe->lun_enable = ctl_ioctl_lun_enable;
 	fe->lun_disable = ctl_ioctl_lun_disable;
 	fe->targ_lun_arg = &softc->ioctl_info;
@@ -1449,22 +1445,6 @@ bailout:
 	return (retval);
 }
 
-/*
- * XXX KDM should we pretend to do something in the target/lun
- * enable/disable functions?
- */
-static int
-ctl_ioctl_targ_enable(void *arg, struct ctl_id targ_id)
-{
-	return (0);
-}
-
-static int
-ctl_ioctl_targ_disable(void *arg, struct ctl_id targ_id)
-{
-	return (0);
-}
-
 static int
 ctl_ioctl_lun_enable(void *arg, struct ctl_id targ_id, int lun_id)
 {
@@ -4310,24 +4290,6 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft
 	STAILQ_FOREACH(fe, &ctl_softc->fe_list, links) {
 		int retval;
 
-		/*
-		 * XXX KDM this only works for ONE TARGET ID.  We'll need
-		 * to do things differently if we go to a multiple target
-		 * ID scheme.
-		 */
-		if ((fe->status & CTL_PORT_STATUS_TARG_ONLINE) == 0) {
-
-			retval = fe->targ_enable(fe->targ_lun_arg, target_id);
-			if (retval != 0) {
-				printf("ctl_alloc_lun: FETD %s port %d "
-				       "returned error %d for targ_enable on "
-				       "target %ju\n", fe->port_name,
-				       fe->targ_port, retval,
-				       (uintmax_t)target_id.id);
-			} else
-				fe->status |= CTL_PORT_STATUS_TARG_ONLINE;
-		}
-
 		retval = fe->lun_enable(fe->targ_lun_arg, target_id,lun_number);
 		if (retval != 0) {
 			printf("ctl_alloc_lun: FETD %s port %d returned error "

Modified: head/sys/cam/ctl/ctl_frontend.h
==============================================================================
--- head/sys/cam/ctl/ctl_frontend.h	Fri Jul  4 18:47:25 2014	(r268264)
+++ head/sys/cam/ctl/ctl_frontend.h	Fri Jul  4 19:19:03 2014	(r268265)
@@ -105,30 +105,6 @@ typedef int (*fe_devid_t)(struct ctl_scs
  *			  and port_offline().  This is specified by the
  *			  FETD.
  *
- * targ_enable():	  This function is called, with targ_lun_arg and a
- * 			  target ID as its arguments, by CTL when it wants
- *			  the FETD to enable a particular target.  targ_enable()
- *			  will always be called for a particular target ID
- * 			  before any LUN is enabled for that target.  If the
- *			  FETD does not support enabling targets, but rather
- *			  LUNs, it should ignore this call and return 0.  If
- *			  the FETD does support enabling targets, it should
- *			  return 0 for success and non-zero if it cannot
- *			  enable the given target.
- *
- *			  TODO:  Add the ability to specify a WWID here.
- *
- * targ_disable():	  This function is called, with targ_lun_arg and a
- *			  target ID as its arguments, by CTL when it wants
- *			  the FETD to disable a particular target.
- *			  targ_disable() will always be called for a
- *			  particular target ID after all LUNs are disabled
- *			  on that particular target.  If the FETD does not
- *			  support enabling targets, it should ignore this
- *			  call and return 0.  If the FETD does support
- *			  enabling targets, it should return 0 for success,
- *			  and non-zero if it cannot disable the given target.
- *
  * lun_enable():	  This function is called, with targ_lun_arg, a target
  *			  ID and a LUN ID as its arguments, by CTL when it
  *			  wants the FETD to enable a particular LUN.  If the
@@ -212,8 +188,6 @@ struct ctl_frontend {
 	port_func_t	port_online;		/* passed to CTL */
 	port_func_t	port_offline;		/* passed to CTL */
 	void		*onoff_arg;		/* passed to CTL */
-	targ_func_t	targ_enable;		/* passed to CTL */
-	targ_func_t	targ_disable;		/* passed to CTL */
 	lun_func_t	lun_enable;		/* passed to CTL */
 	lun_func_t	lun_disable;		/* passed to CTL */
 	fe_ioctl_t	ioctl;			/* passed to CTL */

Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_cam_sim.c	Fri Jul  4 18:47:25 2014	(r268264)
+++ head/sys/cam/ctl/ctl_frontend_cam_sim.c	Fri Jul  4 19:19:03 2014	(r268265)
@@ -101,8 +101,6 @@ void cfcs_shutdown(void);
 static void cfcs_poll(struct cam_sim *sim);
 static void cfcs_online(void *arg);
 static void cfcs_offline(void *arg);
-static int cfcs_targ_enable(void *arg, struct ctl_id targ_id);
-static int cfcs_targ_disable(void *arg, struct ctl_id targ_id);
 static int cfcs_lun_enable(void *arg, struct ctl_id target_id, int lun_id);
 static int cfcs_lun_disable(void *arg, struct ctl_id target_id, int lun_id);
 static void cfcs_datamove(union ctl_io *io);
@@ -163,8 +161,6 @@ cfcs_init(void)
 	fe->port_online = cfcs_online;
 	fe->port_offline = cfcs_offline;
 	fe->onoff_arg = softc;
-	fe->targ_enable = cfcs_targ_enable;
-	fe->targ_disable = cfcs_targ_disable;
 	fe->lun_enable = cfcs_lun_enable;
 	fe->lun_disable = cfcs_lun_disable;
 	fe->targ_lun_arg = softc;
@@ -336,18 +332,6 @@ cfcs_offline(void *arg)
 }
 
 static int
-cfcs_targ_enable(void *arg, struct ctl_id targ_id)
-{
-	return (0);
-}
-
-static int
-cfcs_targ_disable(void *arg, struct ctl_id targ_id)
-{
-	return (0);
-}
-
-static int
 cfcs_lun_enable(void *arg, struct ctl_id target_id, int lun_id)
 {
 	return (0);

Modified: head/sys/cam/ctl/ctl_frontend_internal.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_internal.c	Fri Jul  4 18:47:25 2014	(r268264)
+++ head/sys/cam/ctl/ctl_frontend_internal.c	Fri Jul  4 19:19:03 2014	(r268265)
@@ -192,8 +192,6 @@ int cfi_init(void);
 void cfi_shutdown(void) __unused;
 static void cfi_online(void *arg);
 static void cfi_offline(void *arg);
-static int cfi_targ_enable(void *arg, struct ctl_id targ_id);
-static int cfi_targ_disable(void *arg, struct ctl_id targ_id);
 static int cfi_lun_enable(void *arg, struct ctl_id target_id, int lun_id);
 static int cfi_lun_disable(void *arg, struct ctl_id target_id, int lun_id);
 static void cfi_datamove(union ctl_io *io);
@@ -261,8 +259,6 @@ cfi_init(void)
 	fe->port_online = cfi_online;
 	fe->port_offline = cfi_offline;
 	fe->onoff_arg = softc;
-	fe->targ_enable = cfi_targ_enable;
-	fe->targ_disable = cfi_targ_disable;
 	fe->lun_enable = cfi_lun_enable;
 	fe->lun_disable = cfi_lun_disable;
 	fe->targ_lun_arg = softc;
@@ -347,18 +343,6 @@ cfi_offline(void *arg)
 }
 
 static int
-cfi_targ_enable(void *arg, struct ctl_id targ_id)
-{
-	return (0);
-}
-
-static int
-cfi_targ_disable(void *arg, struct ctl_id targ_id)
-{
-	return (0);
-}
-
-static int
 cfi_lun_enable(void *arg, struct ctl_id target_id, int lun_id)
 {
 	struct cfi_softc *softc;

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Fri Jul  4 18:47:25 2014	(r268264)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Fri Jul  4 19:19:03 2014	(r268265)
@@ -145,8 +145,6 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO
 int		cfiscsi_init(void);
 static void	cfiscsi_online(void *arg);
 static void	cfiscsi_offline(void *arg);
-static int	cfiscsi_targ_enable(void *arg, struct ctl_id targ_id);
-static int	cfiscsi_targ_disable(void *arg, struct ctl_id targ_id);
 static int	cfiscsi_lun_enable(void *arg,
 		    struct ctl_id target_id, int lun_id);
 static int	cfiscsi_lun_disable(void *arg,
@@ -1342,8 +1340,6 @@ cfiscsi_init(void)
 	fe->port_online = cfiscsi_online;
 	fe->port_offline = cfiscsi_offline;
 	fe->onoff_arg = softc;
-	fe->targ_enable = cfiscsi_targ_enable;
-	fe->targ_disable = cfiscsi_targ_disable;
 	fe->lun_enable = cfiscsi_lun_enable;
 	fe->lun_disable = cfiscsi_lun_disable;
 	fe->targ_lun_arg = softc;
@@ -1447,20 +1443,6 @@ cfiscsi_offline(void *arg)
 #endif
 }
 
-static int
-cfiscsi_targ_enable(void *arg, struct ctl_id targ_id)
-{
-
-	return (0);
-}
-
-static int
-cfiscsi_targ_disable(void *arg, struct ctl_id targ_id)
-{
-
-	return (0);
-}
-
 static void
 cfiscsi_ioctl_handoff(struct ctl_iscsi *ci)
 {

Modified: head/sys/cam/ctl/scsi_ctl.c
==============================================================================
--- head/sys/cam/ctl/scsi_ctl.c	Fri Jul  4 18:47:25 2014	(r268264)
+++ head/sys/cam/ctl/scsi_ctl.c	Fri Jul  4 19:19:03 2014	(r268265)
@@ -211,8 +211,6 @@ static void		ctlfedone(struct cam_periph
 static void 		ctlfe_onoffline(void *arg, int online);
 static void 		ctlfe_online(void *arg);
 static void 		ctlfe_offline(void *arg);
-static int 		ctlfe_targ_enable(void *arg, struct ctl_id targ_id);
-static int 		ctlfe_targ_disable(void *arg, struct ctl_id targ_id);
 static int 		ctlfe_lun_enable(void *arg, struct ctl_id targ_id,
 					 int lun_id);
 static int 		ctlfe_lun_disable(void *arg, struct ctl_id targ_id,
@@ -410,8 +408,6 @@ ctlfeasync(void *callback_arg, uint32_t 
 		fe->port_online = ctlfe_online;
 		fe->port_offline = ctlfe_offline;
 		fe->onoff_arg = bus_softc;
-		fe->targ_enable = ctlfe_targ_enable;
-		fe->targ_disable = ctlfe_targ_disable;
 		fe->lun_enable = ctlfe_lun_enable;
 		fe->lun_disable = ctlfe_lun_disable;
 		fe->targ_lun_arg = bus_softc;
@@ -1927,18 +1923,6 @@ ctlfe_offline(void *arg)
 	xpt_free_path(path);
 }
 
-static int
-ctlfe_targ_enable(void *arg, struct ctl_id targ_id)
-{
-	return (0);
-}
-
-static int
-ctlfe_targ_disable(void *arg, struct ctl_id targ_id)
-{
-	return (0);
-}
-
 /*
  * This will get called to enable a LUN on every bus that is attached to
  * CTL.  So we only need to create a path/periph for this particular bus.

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  4 19:27:08 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 026A7DCD;
 Fri,  4 Jul 2014 19:27:08 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E2F8A29BB;
 Fri,  4 Jul 2014 19:27:07 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s64JR7Vl030366;
 Fri, 4 Jul 2014 19:27:07 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64JR7CG030357;
 Fri, 4 Jul 2014 19:27:07 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407041927.s64JR7CG030357@svn.freebsd.org>
From: Alexander Motin 
Date: Fri, 4 Jul 2014 19:27:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268266 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 04 Jul 2014 19:27:08 -0000

Author: mav
Date: Fri Jul  4 19:27:06 2014
New Revision: 268266
URL: http://svnweb.freebsd.org/changeset/base/268266

Log:
  Separate concepts of frontend and port.
  
  Before iSCSI implementation CTL had no knowledge about frontend drivers,
  it had only frontends, which really were ports (alike to LUNs, if comparing
  to backends).  But iSCSI added there ioctl() method, which does not belong
  to frontend as a port, but belongs to a frontend driver.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_frontend.c
  head/sys/cam/ctl/ctl_frontend.h
  head/sys/cam/ctl/ctl_frontend_cam_sim.c
  head/sys/cam/ctl/ctl_frontend_internal.c
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/cam/ctl/ctl_frontend_iscsi.h
  head/sys/cam/ctl/ctl_private.h
  head/sys/cam/ctl/scsi_ctl.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Fri Jul  4 19:19:03 2014	(r268265)
+++ head/sys/cam/ctl/ctl.c	Fri Jul  4 19:27:06 2014	(r268266)
@@ -466,6 +466,11 @@ static moduledata_t ctl_moduledata = {
 DECLARE_MODULE(ctl, ctl_moduledata, SI_SUB_CONFIGURE, SI_ORDER_THIRD);
 MODULE_VERSION(ctl, 1);
 
+static struct ctl_frontend ioctl_frontend =
+{
+	.name = "ioctl",
+};
+
 static void
 ctl_isc_handler_finish_xfer(struct ctl_softc *ctl_softc,
 			    union ctl_ha_msg *msg_info)
@@ -926,7 +931,7 @@ ctl_init(void)
 {
 	struct ctl_softc *softc;
 	struct ctl_io_pool *internal_pool, *emergency_pool, *other_pool;
-	struct ctl_frontend *fe;
+	struct ctl_port *port;
         uint8_t sc_id =0;
 	int i, error, retval;
 	//int isc_retval;
@@ -1006,6 +1011,7 @@ ctl_init(void)
 	STAILQ_INIT(&softc->lun_list);
 	STAILQ_INIT(&softc->pending_lun_queue);
 	STAILQ_INIT(&softc->fe_list);
+	STAILQ_INIT(&softc->port_list);
 	STAILQ_INIT(&softc->be_list);
 	STAILQ_INIT(&softc->io_pools);
 
@@ -1083,23 +1089,25 @@ ctl_init(void)
 	/*
 	 * Initialize the ioctl front end.
 	 */
-	fe = &softc->ioctl_info.fe;
-	sprintf(softc->ioctl_info.port_name, "CTL ioctl");
-	fe->port_type = CTL_PORT_IOCTL;
-	fe->num_requested_ctl_io = 100;
-	fe->port_name = softc->ioctl_info.port_name;
-	fe->port_online = ctl_ioctl_online;
-	fe->port_offline = ctl_ioctl_offline;
-	fe->onoff_arg = &softc->ioctl_info;
-	fe->lun_enable = ctl_ioctl_lun_enable;
-	fe->lun_disable = ctl_ioctl_lun_disable;
-	fe->targ_lun_arg = &softc->ioctl_info;
-	fe->fe_datamove = ctl_ioctl_datamove;
-	fe->fe_done = ctl_ioctl_done;
-	fe->max_targets = 15;
-	fe->max_target_id = 15;
+	ctl_frontend_register(&ioctl_frontend);
+	port = &softc->ioctl_info.port;
+	port->frontend = &ioctl_frontend;
+	sprintf(softc->ioctl_info.port_name, "ioctl");
+	port->port_type = CTL_PORT_IOCTL;
+	port->num_requested_ctl_io = 100;
+	port->port_name = softc->ioctl_info.port_name;
+	port->port_online = ctl_ioctl_online;
+	port->port_offline = ctl_ioctl_offline;
+	port->onoff_arg = &softc->ioctl_info;
+	port->lun_enable = ctl_ioctl_lun_enable;
+	port->lun_disable = ctl_ioctl_lun_disable;
+	port->targ_lun_arg = &softc->ioctl_info;
+	port->fe_datamove = ctl_ioctl_datamove;
+	port->fe_done = ctl_ioctl_done;
+	port->max_targets = 15;
+	port->max_target_id = 15;
 
-	if (ctl_frontend_register(&softc->ioctl_info.fe,
+	if (ctl_port_register(&softc->ioctl_info.port,
 	                  (softc->flags & CTL_FLAG_MASTER_SHELF)) != 0) {
 		printf("ctl: ioctl front end registration failed, will "
 		       "continue anyway\n");
@@ -1125,7 +1133,7 @@ ctl_shutdown(void)
 
 	softc = (struct ctl_softc *)control_softc;
 
-	if (ctl_frontend_deregister(&softc->ioctl_info.fe) != 0)
+	if (ctl_port_deregister(&softc->ioctl_info.port) != 0)
 		printf("ctl: ioctl front end deregistration failed\n");
 
 	mtx_lock(&softc->ctl_lock);
@@ -1140,6 +1148,8 @@ ctl_shutdown(void)
 
 	mtx_unlock(&softc->ctl_lock);
 
+	ctl_frontend_deregister(&ioctl_frontend);
+
 	/*
 	 * This will rip the rug out from under any FETDs or anyone else
 	 * that has a pool allocated.  Since we increment our module
@@ -1204,7 +1214,7 @@ int
 ctl_port_enable(ctl_port_type port_type)
 {
 	struct ctl_softc *softc;
-	struct ctl_frontend *fe;
+	struct ctl_port *port;
 
 	if (ctl_is_single == 0) {
 		union ctl_ha_msg msg_info;
@@ -1233,13 +1243,13 @@ ctl_port_enable(ctl_port_type port_type)
 
 	softc = control_softc;
 
-	STAILQ_FOREACH(fe, &softc->fe_list, links) {
-		if (port_type & fe->port_type)
+	STAILQ_FOREACH(port, &softc->port_list, links) {
+		if (port_type & port->port_type)
 		{
 #if 0
-			printf("port %d\n", fe->targ_port);
+			printf("port %d\n", port->targ_port);
 #endif
-			ctl_frontend_online(fe);
+			ctl_port_online(port);
 		}
 	}
 
@@ -1250,13 +1260,13 @@ int
 ctl_port_disable(ctl_port_type port_type)
 {
 	struct ctl_softc *softc;
-	struct ctl_frontend *fe;
+	struct ctl_port *port;
 
 	softc = control_softc;
 
-	STAILQ_FOREACH(fe, &softc->fe_list, links) {
-		if (port_type & fe->port_type)
-			ctl_frontend_offline(fe);
+	STAILQ_FOREACH(port, &softc->port_list, links) {
+		if (port_type & port->port_type)
+			ctl_port_offline(port);
 	}
 
 	return (0);
@@ -1274,7 +1284,7 @@ ctl_port_list(struct ctl_port_entry *ent
 	      ctl_port_type port_type, int no_virtual)
 {
 	struct ctl_softc *softc;
-	struct ctl_frontend *fe;
+	struct ctl_port *port;
 	int entries_dropped, entries_filled;
 	int retval;
 	int i;
@@ -1287,14 +1297,14 @@ ctl_port_list(struct ctl_port_entry *ent
 
 	i = 0;
 	mtx_lock(&softc->ctl_lock);
-	STAILQ_FOREACH(fe, &softc->fe_list, links) {
+	STAILQ_FOREACH(port, &softc->port_list, links) {
 		struct ctl_port_entry *entry;
 
-		if ((fe->port_type & port_type) == 0)
+		if ((port->port_type & port_type) == 0)
 			continue;
 
 		if ((no_virtual != 0)
-		 && (fe->virtual_port != 0))
+		 && (port->virtual_port != 0))
 			continue;
 
 		if (entries_filled >= num_entries_alloced) {
@@ -1303,13 +1313,13 @@ ctl_port_list(struct ctl_port_entry *ent
 		}
 		entry = &entries[i];
 
-		entry->port_type = fe->port_type;
-		strlcpy(entry->port_name, fe->port_name,
+		entry->port_type = port->port_type;
+		strlcpy(entry->port_name, port->port_name,
 			sizeof(entry->port_name));
-		entry->physical_port = fe->physical_port;
-		entry->virtual_port = fe->virtual_port;
-		entry->wwnn = fe->wwnn;
-		entry->wwpn = fe->wwpn;
+		entry->physical_port = port->physical_port;
+		entry->virtual_port = port->virtual_port;
+		entry->wwnn = port->wwnn;
+		entry->wwpn = port->wwpn;
 
 		i++;
 		entries_filled++;
@@ -2134,7 +2144,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 			break;
 		}
 
-		io = ctl_alloc_io(softc->ioctl_info.fe.ctl_pool_ref);
+		io = ctl_alloc_io(softc->ioctl_info.port.ctl_pool_ref);
 		if (io == NULL) {
 			printf("ctl_ioctl: can't allocate ctl_io!\n");
 			retval = ENOSPC;
@@ -2158,7 +2168,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 		/*
 		 * The user sets the initiator ID, target and LUN IDs.
 		 */
-		io->io_hdr.nexus.targ_port = softc->ioctl_info.fe.targ_port;
+		io->io_hdr.nexus.targ_port = softc->ioctl_info.port.targ_port;
 		io->io_hdr.flags |= CTL_FLAG_USER_REQ;
 		if ((io->io_hdr.io_type == CTL_IO_SCSI)
 		 && (io->scsiio.tag_type != CTL_TAG_UNTAGGED))
@@ -2181,20 +2191,20 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 	case CTL_ENABLE_PORT:
 	case CTL_DISABLE_PORT:
 	case CTL_SET_PORT_WWNS: {
-		struct ctl_frontend *fe;
+		struct ctl_port *port;
 		struct ctl_port_entry *entry;
 
 		entry = (struct ctl_port_entry *)addr;
 		
 		mtx_lock(&softc->ctl_lock);
-		STAILQ_FOREACH(fe, &softc->fe_list, links) {
+		STAILQ_FOREACH(port, &softc->port_list, links) {
 			int action, done;
 
 			action = 0;
 			done = 0;
 
 			if ((entry->port_type == CTL_PORT_NONE)
-			 && (entry->targ_port == fe->targ_port)) {
+			 && (entry->targ_port == port->targ_port)) {
 				/*
 				 * If the user only wants to enable or
 				 * disable or set WWNs on a specific port,
@@ -2202,7 +2212,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 				 */
 				action = 1;
 				done = 1;
-			} else if (entry->port_type & fe->port_type) {
+			} else if (entry->port_type & port->port_type) {
 				/*
 				 * Compare the user's type mask with the
 				 * particular frontend type to see if we
@@ -2237,21 +2247,21 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 
 					STAILQ_FOREACH(lun, &softc->lun_list,
 						       links) {
-						fe->lun_enable(fe->targ_lun_arg,
+						port->lun_enable(port->targ_lun_arg,
 						    lun->target,
 						    lun->lun);
 					}
 
-					ctl_frontend_online(fe);
+					ctl_port_online(port);
 				} else if (cmd == CTL_DISABLE_PORT) {
 					struct ctl_lun *lun;
 
-					ctl_frontend_offline(fe);
+					ctl_port_offline(port);
 
 					STAILQ_FOREACH(lun, &softc->lun_list,
 						       links) {
-						fe->lun_disable(
-						    fe->targ_lun_arg,
+						port->lun_disable(
+						    port->targ_lun_arg,
 						    lun->target,
 						    lun->lun);
 					}
@@ -2260,7 +2270,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 				mtx_lock(&softc->ctl_lock);
 
 				if (cmd == CTL_SET_PORT_WWNS)
-					ctl_frontend_set_wwns(fe,
+					ctl_port_set_wwns(port,
 					    (entry->flags & CTL_PORT_WWNN_VALID) ?
 					    1 : 0, entry->wwnn,
 					    (entry->flags & CTL_PORT_WWPN_VALID) ?
@@ -2273,7 +2283,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 		break;
 	}
 	case CTL_GET_PORT_LIST: {
-		struct ctl_frontend *fe;
+		struct ctl_port *port;
 		struct ctl_port_list *list;
 		int i;
 
@@ -2293,7 +2303,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 		list->dropped_num = 0;
 		i = 0;
 		mtx_lock(&softc->ctl_lock);
-		STAILQ_FOREACH(fe, &softc->fe_list, links) {
+		STAILQ_FOREACH(port, &softc->port_list, links) {
 			struct ctl_port_entry entry, *list_entry;
 
 			if (list->fill_num >= list->alloc_num) {
@@ -2301,15 +2311,15 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 				continue;
 			}
 
-			entry.port_type = fe->port_type;
-			strlcpy(entry.port_name, fe->port_name,
+			entry.port_type = port->port_type;
+			strlcpy(entry.port_name, port->port_name,
 				sizeof(entry.port_name));
-			entry.targ_port = fe->targ_port;
-			entry.physical_port = fe->physical_port;
-			entry.virtual_port = fe->virtual_port;
-			entry.wwnn = fe->wwnn;
-			entry.wwpn = fe->wwpn;
-			if (fe->status & CTL_PORT_STATUS_ONLINE)
+			entry.targ_port = port->targ_port;
+			entry.physical_port = port->physical_port;
+			entry.virtual_port = port->virtual_port;
+			entry.wwnn = port->wwnn;
+			entry.wwpn = port->wwpn;
+			if (port->status & CTL_PORT_STATUS_ONLINE)
 				entry.online = 1;
 			else
 				entry.online = 0;
@@ -2844,6 +2854,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 	}
 	case CTL_DUMP_STRUCTS: {
 		int i, j, k;
+		struct ctl_port *port;
 		struct ctl_frontend *fe;
 
 		printf("CTL IID to WWPN map start:\n");
@@ -2881,26 +2892,25 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 			}
 		}
 		printf("CTL Persistent Reservation information end\n");
-		printf("CTL Frontends:\n");
+		printf("CTL Ports:\n");
 		/*
 		 * XXX KDM calling this without a lock.  We'd likely want
 		 * to drop the lock before calling the frontend's dump
 		 * routine anyway.
 		 */
+		STAILQ_FOREACH(port, &softc->port_list, links) {
+			printf("Port %s Frontend %s Type %u pport %d vport %d WWNN "
+			       "%#jx WWPN %#jx\n", port->port_name,
+			       port->frontend->name, port->port_type,
+			       port->physical_port, port->virtual_port,
+			       (uintmax_t)port->wwnn, (uintmax_t)port->wwpn);
+		}
+		printf("CTL Port information end\n");
+		printf("CTL Frontends:\n");
 		STAILQ_FOREACH(fe, &softc->fe_list, links) {
-			printf("Frontend %s Type %u pport %d vport %d WWNN "
-			       "%#jx WWPN %#jx\n", fe->port_name, fe->port_type,
-			       fe->physical_port, fe->virtual_port,
-			       (uintmax_t)fe->wwnn, (uintmax_t)fe->wwpn);
-
-			/*
-			 * Frontends are not required to support the dump
-			 * routine.
-			 */
-			if (fe->fe_dump == NULL)
-				continue;
-
-			fe->fe_dump();
+			printf("Frontend %s\n", fe->name);
+			if (fe->fe_dump != NULL)
+				fe->fe_dump();
 		}
 		printf("CTL Frontend information end\n");
 		break;
@@ -3112,14 +3122,15 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 
 		mtx_lock(&softc->ctl_lock);
 		STAILQ_FOREACH(fe, &softc->fe_list, links) {
-			if (strcmp(fe->port_name, "iscsi") == 0)
+			if (strcmp(fe->name, "iscsi") == 0)
 				break;
 		}
 		mtx_unlock(&softc->ctl_lock);
 
 		if (fe == NULL) {
 			ci->status = CTL_ISCSI_ERROR;
-			snprintf(ci->error_str, sizeof(ci->error_str), "Backend \"iscsi\" not found.");
+			snprintf(ci->error_str, sizeof(ci->error_str),
+			    "Frontend \"iscsi\" not found.");
 			break;
 		}
 
@@ -3378,7 +3389,6 @@ ctl_pool_create(struct ctl_softc *ctl_so
 #if 0
 	if ((pool_type != CTL_POOL_EMERGENCY)
 	 && (pool_type != CTL_POOL_INTERNAL)
-	 && (pool_type != CTL_POOL_IOCTL)
 	 && (pool_type != CTL_POOL_4OTHERSC))
 		MOD_INC_USE_COUNT;
 #endif
@@ -3432,7 +3442,7 @@ ctl_pool_release(struct ctl_io_pool *poo
 #if 0
 	if ((pool->type != CTL_POOL_EMERGENCY)
 	 && (pool->type != CTL_POOL_INTERNAL)
-	 && (pool->type != CTL_POOL_IOCTL))
+	 && (pool->type != CTL_POOL_4OTHERSC))
 		MOD_DEC_USE_COUNT;
 #endif
 
@@ -4138,7 +4148,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft
 	      struct ctl_be_lun *const be_lun, struct ctl_id target_id)
 {
 	struct ctl_lun *nlun, *lun;
-	struct ctl_frontend *fe;
+	struct ctl_port *port;
 	int lun_number, i, lun_malloced;
 
 	if (be_lun == NULL)
@@ -4287,17 +4297,17 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft
 	 * already.  Enable the target ID if it hasn't been enabled, and
 	 * enable this particular LUN.
 	 */
-	STAILQ_FOREACH(fe, &ctl_softc->fe_list, links) {
+	STAILQ_FOREACH(port, &ctl_softc->port_list, links) {
 		int retval;
 
-		retval = fe->lun_enable(fe->targ_lun_arg, target_id,lun_number);
+		retval = port->lun_enable(port->targ_lun_arg, target_id,lun_number);
 		if (retval != 0) {
 			printf("ctl_alloc_lun: FETD %s port %d returned error "
 			       "%d for lun_enable on target %ju lun %d\n",
-			       fe->port_name, fe->targ_port, retval,
+			       port->port_name, port->targ_port, retval,
 			       (uintmax_t)target_id.id, lun_number);
 		} else
-			fe->status |= CTL_PORT_STATUS_LUN_ONLINE;
+			port->status |= CTL_PORT_STATUS_LUN_ONLINE;
 	}
 	return (0);
 }
@@ -4313,7 +4323,7 @@ ctl_free_lun(struct ctl_lun *lun)
 {
 	struct ctl_softc *softc;
 #if 0
-	struct ctl_frontend *fe;
+	struct ctl_port *port;
 #endif
 	struct ctl_lun *nlun;
 	int i;
@@ -4337,7 +4347,7 @@ ctl_free_lun(struct ctl_lun *lun)
 	 * XXX KDM this scheme only works for a single target/multiple LUN
 	 * setup.  It needs to be revamped for a multiple target scheme.
 	 *
-	 * XXX KDM this results in fe->lun_disable() getting called twice,
+	 * XXX KDM this results in port->lun_disable() getting called twice,
 	 * once when ctl_disable_lun() is called, and a second time here.
 	 * We really need to re-think the LUN disable semantics.  There
 	 * should probably be several steps/levels to LUN removal:
@@ -4349,37 +4359,37 @@ ctl_free_lun(struct ctl_lun *lun)
 	 * the front end ports, at least for individual LUNs.
 	 */
 #if 0
-	STAILQ_FOREACH(fe, &softc->fe_list, links) {
+	STAILQ_FOREACH(port, &softc->port_list, links) {
 		int retval;
 
-		retval = fe->lun_disable(fe->targ_lun_arg, lun->target,
+		retval = port->lun_disable(port->targ_lun_arg, lun->target,
 					 lun->lun);
 		if (retval != 0) {
 			printf("ctl_free_lun: FETD %s port %d returned error "
 			       "%d for lun_disable on target %ju lun %jd\n",
-			       fe->port_name, fe->targ_port, retval,
+			       port->port_name, port->targ_port, retval,
 			       (uintmax_t)lun->target.id, (intmax_t)lun->lun);
 		}
 
 		if (STAILQ_FIRST(&softc->lun_list) == NULL) {
-			fe->status &= ~CTL_PORT_STATUS_LUN_ONLINE;
+			port->status &= ~CTL_PORT_STATUS_LUN_ONLINE;
 
-			retval = fe->targ_disable(fe->targ_lun_arg,lun->target);
+			retval = port->targ_disable(port->targ_lun_arg,lun->target);
 			if (retval != 0) {
 				printf("ctl_free_lun: FETD %s port %d "
 				       "returned error %d for targ_disable on "
-				       "target %ju\n", fe->port_name,
-				       fe->targ_port, retval,
+				       "target %ju\n", port->port_name,
+				       port->targ_port, retval,
 				       (uintmax_t)lun->target.id);
 			} else
-				fe->status &= ~CTL_PORT_STATUS_TARG_ONLINE;
+				port->status &= ~CTL_PORT_STATUS_TARG_ONLINE;
 
-			if ((fe->status & CTL_PORT_STATUS_TARG_ONLINE) != 0)
+			if ((port->status & CTL_PORT_STATUS_TARG_ONLINE) != 0)
 				continue;
 
 #if 0
-			fe->port_offline(fe->onoff_arg);
-			fe->status &= ~CTL_PORT_STATUS_ONLINE;
+			port->port_offline(port->onoff_arg);
+			port->status &= ~CTL_PORT_STATUS_ONLINE;
 #endif
 		}
 	}
@@ -4434,7 +4444,7 @@ int
 ctl_enable_lun(struct ctl_be_lun *be_lun)
 {
 	struct ctl_softc *ctl_softc;
-	struct ctl_frontend *fe, *nfe;
+	struct ctl_port *port, *nport;
 	struct ctl_lun *lun;
 	int retval;
 
@@ -4456,8 +4466,8 @@ ctl_enable_lun(struct ctl_be_lun *be_lun
 	lun->flags &= ~CTL_LUN_DISABLED;
 	mtx_unlock(&lun->lun_lock);
 
-	for (fe = STAILQ_FIRST(&ctl_softc->fe_list); fe != NULL; fe = nfe) {
-		nfe = STAILQ_NEXT(fe, links);
+	for (port = STAILQ_FIRST(&ctl_softc->port_list); port != NULL; port = nport) {
+		nport = STAILQ_NEXT(port, links);
 
 		/*
 		 * Drop the lock while we call the FETD's enable routine.
@@ -4465,18 +4475,18 @@ ctl_enable_lun(struct ctl_be_lun *be_lun
 		 * case of the internal initiator frontend.
 		 */
 		mtx_unlock(&ctl_softc->ctl_lock);
-		retval = fe->lun_enable(fe->targ_lun_arg, lun->target,lun->lun);
+		retval = port->lun_enable(port->targ_lun_arg, lun->target,lun->lun);
 		mtx_lock(&ctl_softc->ctl_lock);
 		if (retval != 0) {
 			printf("%s: FETD %s port %d returned error "
 			       "%d for lun_enable on target %ju lun %jd\n",
-			       __func__, fe->port_name, fe->targ_port, retval,
+			       __func__, port->port_name, port->targ_port, retval,
 			       (uintmax_t)lun->target.id, (intmax_t)lun->lun);
 		}
 #if 0
 		 else {
             /* NOTE:  TODO:  why does lun enable affect port status? */
-			fe->status |= CTL_PORT_STATUS_LUN_ONLINE;
+			port->status |= CTL_PORT_STATUS_LUN_ONLINE;
 		}
 #endif
 	}
@@ -4490,7 +4500,7 @@ int
 ctl_disable_lun(struct ctl_be_lun *be_lun)
 {
 	struct ctl_softc *ctl_softc;
-	struct ctl_frontend *fe;
+	struct ctl_port *port;
 	struct ctl_lun *lun;
 	int retval;
 
@@ -4508,7 +4518,7 @@ ctl_disable_lun(struct ctl_be_lun *be_lu
 	lun->flags |= CTL_LUN_DISABLED;
 	mtx_unlock(&lun->lun_lock);
 
-	STAILQ_FOREACH(fe, &ctl_softc->fe_list, links) {
+	STAILQ_FOREACH(port, &ctl_softc->port_list, links) {
 		mtx_unlock(&ctl_softc->ctl_lock);
 		/*
 		 * Drop the lock before we call the frontend's disable
@@ -4517,13 +4527,13 @@ ctl_disable_lun(struct ctl_be_lun *be_lu
 		 * XXX KDM what happens if the frontend list changes while
 		 * we're traversing it?  It's unlikely, but should be handled.
 		 */
-		retval = fe->lun_disable(fe->targ_lun_arg, lun->target,
+		retval = port->lun_disable(port->targ_lun_arg, lun->target,
 					 lun->lun);
 		mtx_lock(&ctl_softc->ctl_lock);
 		if (retval != 0) {
 			printf("ctl_alloc_lun: FETD %s port %d returned error "
 			       "%d for lun_disable on target %ju lun %jd\n",
-			       fe->port_name, fe->targ_port, retval,
+			       port->port_name, port->targ_port, retval,
 			       (uintmax_t)lun->target.id, (intmax_t)lun->lun);
 		}
 	}
@@ -9475,16 +9485,16 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
 	struct scsi_vpd_id_t10 *t10id;
 	struct ctl_softc *ctl_softc;
 	struct ctl_lun *lun;
-	struct ctl_frontend *fe;
+	struct ctl_port *port;
 	char *val;
 	int data_len, devid_len;
 
 	ctl_softc = control_softc;
 
-	fe = ctl_softc->ctl_ports[ctl_port_idx(ctsio->io_hdr.nexus.targ_port)];
+	port = ctl_softc->ctl_ports[ctl_port_idx(ctsio->io_hdr.nexus.targ_port)];
 
-	if (fe->devid != NULL)
-		return ((fe->devid)(ctsio, alloc_len));
+	if (port->devid != NULL)
+		return ((port->devid)(ctsio, alloc_len));
 
 	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
 
@@ -9547,7 +9557,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
 	/*
 	 * For Fibre channel,
 	 */
-	if (fe->port_type == CTL_PORT_FC)
+	if (port->port_type == CTL_PORT_FC)
 	{
 		desc->proto_codeset = (SCSI_PROTO_FC << 4) |
 				      SVPD_ID_CODESET_ASCII;
@@ -9596,7 +9606,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
 		desc1->identifier[7] += ctsio->io_hdr.nexus.targ_port;
 #endif
 
-	be64enc(desc1->identifier, fe->wwpn);
+	be64enc(desc1->identifier, port->wwpn);
 
 	/*
 	 * desc2 is for the Relative Target Port(type 4h) identifier

Modified: head/sys/cam/ctl/ctl_frontend.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend.c	Fri Jul  4 19:19:03 2014	(r268265)
+++ head/sys/cam/ctl/ctl_frontend.c	Fri Jul  4 19:27:06 2014	(r268266)
@@ -66,7 +66,60 @@ __FBSDID("$FreeBSD$");
 extern struct ctl_softc *control_softc;
 
 int
-ctl_frontend_register(struct ctl_frontend *fe, int master_shelf)
+ctl_frontend_register(struct ctl_frontend *fe)
+{
+	struct ctl_frontend *fe_tmp;
+
+	KASSERT(control_softc != NULL, ("CTL is not initialized"));
+
+	/*
+	 * Sanity check, make sure this isn't a duplicate registration.
+	 */
+	mtx_lock(&control_softc->ctl_lock);
+	STAILQ_FOREACH(fe_tmp, &control_softc->fe_list, links) {
+		if (strcmp(fe_tmp->name, fe->name) == 0) {
+			mtx_unlock(&control_softc->ctl_lock);
+			return (-1);
+		}
+	}
+	mtx_unlock(&control_softc->ctl_lock);
+	STAILQ_INIT(&fe->port_list);
+
+	/*
+	 * Call the frontend's initialization routine.
+	 */
+	if (fe->init != NULL)
+		fe->init();
+
+	mtx_lock(&control_softc->ctl_lock);
+	control_softc->num_frontends++;
+	STAILQ_INSERT_TAIL(&control_softc->fe_list, fe, links);
+	mtx_unlock(&control_softc->ctl_lock);
+	return (0);
+}
+
+int
+ctl_frontend_deregister(struct ctl_frontend *fe)
+{
+
+	if (!STAILQ_EMPTY(&fe->port_list))
+		return (-1);
+
+	mtx_lock(&control_softc->ctl_lock);
+	STAILQ_REMOVE(&control_softc->fe_list, fe, ctl_frontend, links);
+	control_softc->num_frontends--;
+	mtx_unlock(&control_softc->ctl_lock);
+
+	/*
+	 * Call the frontend's shutdown routine.
+	 */
+	if (fe->shutdown != NULL)
+		fe->shutdown();
+	return (0);
+}
+
+int
+ctl_port_register(struct ctl_port *port, int master_shelf)
 {
 	struct ctl_io_pool *pool;
 	int port_num;
@@ -80,13 +133,13 @@ ctl_frontend_register(struct ctl_fronten
 	port_num = ctl_ffz(&control_softc->ctl_port_mask, CTL_MAX_PORTS);
 	if ((port_num == -1)
 	 || (ctl_set_mask(&control_softc->ctl_port_mask, port_num) == -1)) {
-		fe->targ_port = -1;
+		port->targ_port = -1;
 		mtx_unlock(&control_softc->ctl_lock);
 		return (1);
 	}
-	control_softc->num_frontends++;
-
+	control_softc->num_ports++;
 	mtx_unlock(&control_softc->ctl_lock);
+
 	/*
 	 * We add 20 to whatever the caller requests, so he doesn't get
 	 * burned by queueing things back to the pending sense queue.  In
@@ -95,36 +148,30 @@ ctl_frontend_register(struct ctl_fronten
 	 * pending sense queue on the next command, whether or not it is
 	 * a REQUEST SENSE.
 	 */
-	retval = ctl_pool_create(control_softc,
-				 (fe->port_type != CTL_PORT_IOCTL) ?
-				 CTL_POOL_FETD : CTL_POOL_IOCTL,
-				 fe->num_requested_ctl_io + 20, &pool);
+	retval = ctl_pool_create(control_softc, CTL_POOL_FETD,
+				 port->num_requested_ctl_io + 20, &pool);
 	if (retval != 0) {
-		fe->targ_port = -1;
+		port->targ_port = -1;
 		mtx_lock(&control_softc->ctl_lock);
 		ctl_clear_mask(&control_softc->ctl_port_mask, port_num);
 		mtx_unlock(&control_softc->ctl_lock);
 		return (retval);
 	}
+	port->ctl_pool_ref = pool;
 
 	mtx_lock(&control_softc->ctl_lock);
-
-	/* For now assume master shelf */
-	//fe->targ_port = port_num;
-	fe->targ_port = port_num + (master_shelf!=0 ? 0 : CTL_MAX_PORTS);
-	fe->max_initiators = CTL_MAX_INIT_PER_PORT;
-	STAILQ_INSERT_TAIL(&control_softc->fe_list, fe, links);
-	control_softc->ctl_ports[port_num] = fe;
-
+	port->targ_port = port_num + (master_shelf != 0 ? 0 : CTL_MAX_PORTS);
+	port->max_initiators = CTL_MAX_INIT_PER_PORT;
+	STAILQ_INSERT_TAIL(&port->frontend->port_list, port, links);
+	STAILQ_INSERT_TAIL(&control_softc->port_list, port, links);
+	control_softc->ctl_ports[port_num] = port;
 	mtx_unlock(&control_softc->ctl_lock);
 
-	fe->ctl_pool_ref = pool;
-
 	return (retval);
 }
 
 int
-ctl_frontend_deregister(struct ctl_frontend *fe)
+ctl_port_deregister(struct ctl_port *port)
 {
 	struct ctl_io_pool *pool;
 	int port_num;
@@ -132,18 +179,19 @@ ctl_frontend_deregister(struct ctl_front
 
 	retval = 0;
 
-	pool = (struct ctl_io_pool *)fe->ctl_pool_ref;
+	pool = (struct ctl_io_pool *)port->ctl_pool_ref;
 
-	if (fe->targ_port == -1) {
+	if (port->targ_port == -1) {
 		retval = 1;
 		goto bailout;
 	}
 
 	mtx_lock(&control_softc->ctl_lock);
-	STAILQ_REMOVE(&control_softc->fe_list, fe, ctl_frontend, links);
-	control_softc->num_frontends--;
-	port_num = (fe->targ_port < CTL_MAX_PORTS) ? fe->targ_port :
-	                                             fe->targ_port - CTL_MAX_PORTS;
+	STAILQ_REMOVE(&control_softc->port_list, port, ctl_port, links);
+	STAILQ_REMOVE(&port->frontend->port_list, port, ctl_port, fe_links);
+	control_softc->num_ports--;
+	port_num = (port->targ_port < CTL_MAX_PORTS) ? port->targ_port :
+	    port->targ_port - CTL_MAX_PORTS;
 	ctl_clear_mask(&control_softc->ctl_port_mask, port_num);
 	control_softc->ctl_ports[port_num] = NULL;
 	mtx_unlock(&control_softc->ctl_lock);
@@ -155,30 +203,30 @@ bailout:
 }
 
 void
-ctl_frontend_set_wwns(struct ctl_frontend *fe, int wwnn_valid, uint64_t wwnn,
+ctl_port_set_wwns(struct ctl_port *port, int wwnn_valid, uint64_t wwnn,
 		      int wwpn_valid, uint64_t wwpn)
 {
 	if (wwnn_valid)
-		fe->wwnn = wwnn;
+		port->wwnn = wwnn;
 
 	if (wwpn_valid)
-		fe->wwpn = wwpn;
+		port->wwpn = wwpn;
 }
 
 void
-ctl_frontend_online(struct ctl_frontend *fe)
+ctl_port_online(struct ctl_port *port)
 {
-	fe->port_online(fe->onoff_arg);
+	port->port_online(port->onoff_arg);
 	/* XXX KDM need a lock here? */
-	fe->status |= CTL_PORT_STATUS_ONLINE;
+	port->status |= CTL_PORT_STATUS_ONLINE;
 }
 
 void
-ctl_frontend_offline(struct ctl_frontend *fe)
+ctl_port_offline(struct ctl_port *port)
 {
-	fe->port_offline(fe->onoff_arg);
+	port->port_offline(port->onoff_arg);
 	/* XXX KDM need a lock here? */
-	fe->status &= ~CTL_PORT_STATUS_ONLINE;
+	port->status &= ~CTL_PORT_STATUS_ONLINE;
 }
 
 /*

Modified: head/sys/cam/ctl/ctl_frontend.h
==============================================================================
--- head/sys/cam/ctl/ctl_frontend.h	Fri Jul  4 19:19:03 2014	(r268265)
+++ head/sys/cam/ctl/ctl_frontend.h	Fri Jul  4 19:27:06 2014	(r268266)
@@ -39,6 +39,8 @@
 #ifndef	_CTL_FRONTEND_H_
 #define	_CTL_FRONTEND_H_
 
+#define	CTL_FE_NAME_LEN		32
+
 typedef enum {
 	CTL_PORT_STATUS_NONE		= 0x00,
 	CTL_PORT_STATUS_ONLINE		= 0x01,
@@ -46,6 +48,8 @@ typedef enum {
 	CTL_PORT_STATUS_LUN_ONLINE	= 0x04
 } ctl_port_status;
 
+typedef int (*fe_init_t)(void);
+typedef void (*fe_shutdown_t)(void);
 typedef void (*port_func_t)(void *onoff_arg);
 typedef int (*targ_func_t)(void *arg, struct ctl_id targ_id);
 typedef	int (*lun_func_t)(void *arg, struct ctl_id targ_id, int lun_id);
@@ -53,6 +57,31 @@ typedef int (*fe_ioctl_t)(struct cdev *d
 			  struct thread *td);
 typedef int (*fe_devid_t)(struct ctl_scsiio *ctsio, int alloc_len);
 
+#define CTL_FRONTEND_DECLARE(name, driver) \
+	static int name ## _modevent(module_t mod, int type, void *data) \
+	{ \
+		switch (type) { \
+		case MOD_LOAD: \
+			ctl_frontend_register( \
+				(struct ctl_frontend *)data); \
+			break; \
+		case MOD_UNLOAD: \
+			printf(#name " module unload - not possible for this module type\n"); \
+			return EINVAL; \
+		default: \
+			return EOPNOTSUPP; \
+		} \
+		return 0; \
+	} \
+	static moduledata_t name ## _mod = { \
+		#name, \
+		name ## _modevent, \
+		(void *)&driver \
+	}; \
+	DECLARE_MODULE(name, name ## _mod, SI_SUB_CONFIGURE, SI_ORDER_FOURTH); \
+	MODULE_DEPEND(name, ctl, 1, 1, 1); \
+	MODULE_DEPEND(name, cam, 1, 1, 1)
+
 /*
  * The ctl_frontend structure is the registration mechanism between a FETD
  * (Front End Target Driver) and the CTL layer.  Here is a description of
@@ -179,7 +208,8 @@ typedef int (*fe_devid_t)(struct ctl_scs
  * links:		  Linked list pointers, used by CTL.  The FETD
  *			  shouldn't touch this field.
  */
-struct ctl_frontend {
+struct ctl_port {
+	struct ctl_frontend *frontend;
 	ctl_port_type	port_type;		/* passed to CTL */
 	int		num_requested_ctl_io;	/* passed to CTL */
 	char		*port_name;		/* passed to CTL */
@@ -190,12 +220,10 @@ struct ctl_frontend {
 	void		*onoff_arg;		/* passed to CTL */
 	lun_func_t	lun_enable;		/* passed to CTL */
 	lun_func_t	lun_disable;		/* passed to CTL */
-	fe_ioctl_t	ioctl;			/* passed to CTL */
 	fe_devid_t	devid;			/* passed to CTL */
 	void		*targ_lun_arg;		/* passed to CTL */
 	void		(*fe_datamove)(union ctl_io *io); /* passed to CTL */
 	void		(*fe_done)(union ctl_io *io); /* passed to CTL */
-	void		(*fe_dump)(void);	/* passed to CTL */
 	int		max_targets;		/* passed to CTL */
 	int		max_target_id;		/* passed to CTL */
 	int32_t		targ_port;		/* passed back to FETD */
@@ -204,6 +232,17 @@ struct ctl_frontend {
 	uint64_t	wwnn;			/* set by CTL before online */
 	uint64_t	wwpn;			/* set by CTL before online */
 	ctl_port_status	status;			/* used by CTL */
+	STAILQ_ENTRY(ctl_port) fe_links;	/* used by CTL */
+	STAILQ_ENTRY(ctl_port) links;		/* used by CTL */
+};
+
+struct ctl_frontend {
+	char		name[CTL_FE_NAME_LEN];	/* passed to CTL */
+	fe_init_t	init;			/* passed to CTL */
+	fe_ioctl_t	ioctl;			/* passed to CTL */
+	void		(*fe_dump)(void);	/* passed to CTL */
+	fe_shutdown_t	shutdown;		/* passed to CTL */
+	STAILQ_HEAD(, ctl_port) port_list;	/* used by CTL */
 	STAILQ_ENTRY(ctl_frontend) links;	/* used by CTL */
 };
 
@@ -211,7 +250,7 @@ struct ctl_frontend {
  * This may block until resources are allocated.  Called at FETD module load
  * time. Returns 0 for success, non-zero for failure.
  */
-int ctl_frontend_register(struct ctl_frontend *fe, int master_SC);
+int ctl_frontend_register(struct ctl_frontend *fe);
 
 /*
  * Called at FETD module unload time.
@@ -220,20 +259,32 @@ int ctl_frontend_register(struct ctl_fro
 int ctl_frontend_deregister(struct ctl_frontend *fe);
 
 /*
+ * This may block until resources are allocated.  Called at FETD module load
+ * time. Returns 0 for success, non-zero for failure.
+ */
+int ctl_port_register(struct ctl_port *fe, int master_SC);
+
+/*
+ * Called at FETD module unload time.
+ * Returns 0 for success, non-zero for failure.
+ */
+int ctl_port_deregister(struct ctl_port *fe);
+
+/*
  * Called to set the WWNN and WWPN for a particular frontend.
  */
-void ctl_frontend_set_wwns(struct ctl_frontend *fe, int wwnn_valid,
+void ctl_port_set_wwns(struct ctl_port *port, int wwnn_valid,
 			   uint64_t wwnn, int wwpn_valid, uint64_t wwpn);
 
 /*
  * Called to bring a particular frontend online.
  */
-void ctl_frontend_online(struct ctl_frontend *fe);
+void ctl_port_online(struct ctl_port *fe);
 
 /*
  * Called to take a particular frontend offline.
  */
-void ctl_frontend_offline(struct ctl_frontend *fe);
+void ctl_port_offline(struct ctl_port *fe);
 
 /*
  * This routine queues I/O and task management requests from the FETD to the

Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_cam_sim.c	Fri Jul  4 19:19:03 2014	(r268265)
+++ head/sys/cam/ctl/ctl_frontend_cam_sim.c	Fri Jul  4 19:27:06 2014	(r268266)
@@ -74,13 +74,12 @@ struct cfcs_io {
 };
 
 struct cfcs_softc {
-	struct ctl_frontend fe;
+	struct ctl_port port;
 	char port_name[32];
 	struct cam_sim *sim;
 	struct cam_devq *devq;
 	struct cam_path *path;
 	struct mtx lock;
-	char lock_desc[32];
 	uint64_t wwnn;
 	uint64_t wwpn;
 	uint32_t cur_tag_num;
@@ -97,7 +96,6 @@ struct cfcs_softc {
 	CAM_SENSE_PHYS)
 
 int cfcs_init(void);
-void cfcs_shutdown(void);
 static void cfcs_poll(struct cam_sim *sim);
 static void cfcs_online(void *arg);
 static void cfcs_offline(void *arg);
@@ -122,25 +120,19 @@ SYSCTL_NODE(_kern_cam, OID_AUTO, ctl2cam
 SYSCTL_INT(_kern_cam_ctl2cam, OID_AUTO, max_sense, CTLFLAG_RW,
            &cfcs_max_sense, 0, "Maximum sense data size");
 
-static int cfcs_module_event_handler(module_t, int /*modeventtype_t*/, void *);
-
-static moduledata_t cfcs_moduledata = {
-	"ctlcfcs",
-	cfcs_module_event_handler,
-	NULL
+static struct ctl_frontend cfcs_frontend =
+{
+	.name = "camsim",
+	.init = cfcs_init,
 };
-
-DECLARE_MODULE(ctlcfcs, cfcs_moduledata, SI_SUB_CONFIGURE, SI_ORDER_FOURTH);
-MODULE_VERSION(ctlcfcs, 1);
-MODULE_DEPEND(ctlcfi, ctl, 1, 1, 1);
-MODULE_DEPEND(ctlcfi, cam, 1, 1, 1);
+CTL_FRONTEND_DECLARE(ctlcfcs, cfcs_frontend);
 
 int
 cfcs_init(void)
 {
 	struct cfcs_softc *softc;
 	struct ccb_setasync csa;
-	struct ctl_frontend *fe;
+	struct ctl_port *port;
 #ifdef NEEDTOPORT
 	char wwnn[8];
 #endif
@@ -149,32 +141,32 @@ cfcs_init(void)
 	softc = &cfcs_softc;
 	retval = 0;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  4 21:06:49 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 46A07E22;
 Fri,  4 Jul 2014 21:06:49 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 33C8D21D6;
 Fri,  4 Jul 2014 21:06:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s64L6n7a078536;
 Fri, 4 Jul 2014 21:06:49 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64L6nGI078535;
 Fri, 4 Jul 2014 21:06:49 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201407042106.s64L6nGI078535@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Fri, 4 Jul 2014 21:06:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268268 - head/lib/libc/stdlib
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 04 Jul 2014 21:06:49 -0000

Author: pfg
Date: Fri Jul  4 21:06:48 2014
New Revision: 268268
URL: http://svnweb.freebsd.org/changeset/base/268268

Log:
  getopt(3): clarify GNU instead of NetBSD.
  
  The manpage and the code for r267745 came from NetBSD but the
  option is inspired on GNU.
  
  Reported by:	Ben Kaduk
  MFC after:	3 days

Modified:
  head/lib/libc/stdlib/getopt.3

Modified: head/lib/libc/stdlib/getopt.3
==============================================================================
--- head/lib/libc/stdlib/getopt.3	Fri Jul  4 21:04:19 2014	(r268267)
+++ head/lib/libc/stdlib/getopt.3	Fri Jul  4 21:06:48 2014	(r268268)
@@ -74,7 +74,7 @@ word, or
 .Dv NULL
 if there were no more characters in the current word.
 This is a
-.Nx
+.It Tn GNU
 extension.
 For example, an option string
 .Li \&"x"

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  4 21:08:25 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4D57FF95
 for ; Fri,  4 Jul 2014 21:08:25 +0000 (UTC)
Received: from nm6.bullet.mail.bf1.yahoo.com (nm6.bullet.mail.bf1.yahoo.com
 [98.139.212.165])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EFD4A21F3
 for ; Fri,  4 Jul 2014 21:08:24 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1404508097; bh=dsAZUNhJNN8bgxHkXqytndbv7JC9DafpQnV8QjoStMs=;
 h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type;
 b=RzOPQxCcSr8pP6xA9Uv2oYQPQ4xDVWXIz4NpZggkLVz87boQmm+x44gRJ4ALqFzn7/ffqfolHN3XHdU91rWm+/TYWpeR3m3MDWUevqlH55aDIMnZ+YAKkNlgq4YpJQaljEDpcxY7ev62KyVi27oOFfRCHh+48Tp4Ut5XWGPHCxMLpGxoNXUuRsp1fpLybazGZTzN5VGtSKsTzJwMP2SEmtGcpCp6FC+gP0lr70itKI+JldpdDzrjB1W+aTQpqgencB3BKERFBBTTyzS8dOPAxXt0EQcobPfQ0f2wnVq1TD7MYQvbXI/Aujb3ucMdCFDtBXhBEJ6aaJskwz+RItahxw==
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com;
 b=j00KWdEz3aZaVHRWza5Y1iuRwUUaVztRi0s13X0URs346sHAPbLO00v8QjhmTgcpZnGdP1pQ87GUMrbqqxcyQp2/nG/EAfIKpj/KZ6r13lSdk7J1dArMYH3pD43K39/7p6jRwf/uBgoxHcnpYQUsiv8ClZhjWtmi1uhL2pNprz/CQd6kBcRyrz6vKTECkoM7johJGAd3TiqLsfaL/Oc/eW7fBNdC/VcVjV9W8vKRP1WzpSZ8VRxKMZ0WPyif/1vCtDnedOZfS0/ZJu9ijdl7rip8/mrendm0wD93JVgSSUOTfMmtx+FtSw2k6/gKwHHZvoDsQpds5wA3/heMxu2AKA==;
Received: from [98.139.215.140] by nm6.bullet.mail.bf1.yahoo.com with NNFMP;
 04 Jul 2014 21:08:17 -0000
Received: from [98.139.213.12] by tm11.bullet.mail.bf1.yahoo.com with NNFMP;
 04 Jul 2014 21:08:17 -0000
Received: from [127.0.0.1] by smtp112.mail.bf1.yahoo.com with NNFMP;
 04 Jul 2014 21:08:17 -0000
X-Yahoo-Newman-Id: 389219.78338.bm@smtp112.mail.bf1.yahoo.com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: V.Q_B4cVM1lsEOnTlSLwpfUdg500BWItvA5XwcpImKKY6uP
 s1N9qEHTjJN.RSqJ9ifO1JmMMSb5nQnRL1YTqQLIJAGFabujUbY0s8TNguOB
 Klbt0DoL3e.t2zA4W47vyBiLMKYY9Rujcu0hQqhEgzWI.5BzH7rmKqjj51nz
 H6nmUadzJvLBQ96e6z6rlAWhWAAF5R2DnXlPtbvoDnImGVvKGDL1mKYYiyrs
 vI9zMdm4ZDc9DQP8MwlFyt6fNYvr.NqBHi6P1zKAIyHNqUd4dCOrU5BA4UII
 suZtzNweSwzWrKgxIOGzS34ANAZYl2Hyo2qMVNtnDqPapCF3oQHSHNrZVgd3
 hAhFm5MsxXOVXiZRfvArVqN6HjS9do7aEU0sz8grKs7BAb.JhJBjngW3ygyX
 NrdzGsKHkiwKrNvuS_ht.63oYyQUUlbLYmRa47RYUu6lCUOJyazsVBN3EEmw
 ycyl_qclgAu_7BLhr4MQsU682njYcVgE6TPbnYSRQ.VE2NDUQLiHo1IdAPyG
 .cVysdKz62tgM8fhHQ_0FI68lPT2.feQ-
X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf
X-Rocket-Received: from [192.168.0.100] (pfg@190.157.126.109 with plain
 [63.250.193.228])
 by smtp112.mail.bf1.yahoo.com with SMTP; 04 Jul 2014 14:08:17 -0700 PDT
Message-ID: <53B717D3.4080508@freebsd.org>
Date: Fri, 04 Jul 2014 16:08:35 -0500
From: Pedro Giffuni 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Benjamin Kaduk 
Subject: Re: svn commit: r267745 - head/lib/libc/stdlib
References: <201406222013.s5MKDwHw045376@svn.freebsd.org>
 
In-Reply-To: 
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Content-Filtered-By: Mailman/MimeDel 2.1.18
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 04 Jul 2014 21:08:25 -0000


On 07/04/14 14:18, Benjamin Kaduk wrote:
> On Sun, Jun 22, 2014 at 4:13 PM, Pedro F. Giffuni  > wrote:
>
>     Author: pfg
>     Date: Sun Jun 22 20:13:57 2014
>     New Revision: 267745
>     URL: http://svnweb.freebsd.org/changeset/base/267745
>
>     Log:
>       getopt(3): recognize option:: as GNU extension for "optional
>     options".
>
> [...]
>
>      is to follow.
>     +If an individual character is followed by two colons, then the
>     +option argument is optional;
>     +.Va optarg
>     +is set to the rest of the current
>     +.Va argv
>     +word, or
>     +.Dv NULL
>     +if there were no more characters in the current word.
>     +This is a
>     +.Nx
>     +extension.
>
>
> .Nx is NetBSD, not GNU...
>

Thanks!

I tried to fix it in r268268 but I am not a documentation expert.

Regards,

Pedro.
> -Ben


From owner-svn-src-head@FreeBSD.ORG  Fri Jul  4 21:21:06 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D79458CE;
 Fri,  4 Jul 2014 21:21:06 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id AAF37239D;
 Fri,  4 Jul 2014 21:21:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s64LL6E8086635;
 Fri, 4 Jul 2014 21:21:06 GMT (envelope-from eadler@svn.freebsd.org)
Received: (from eadler@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64LL6Sn086632;
 Fri, 4 Jul 2014 21:21:06 GMT (envelope-from eadler@svn.freebsd.org)
Message-Id: <201407042121.s64LL6Sn086632@svn.freebsd.org>
From: Eitan Adler 
Date: Fri, 4 Jul 2014 21:21:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268269 - head/usr.bin/units
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 04 Jul 2014 21:21:06 -0000

Author: eadler
Date: Fri Jul  4 21:21:05 2014
New Revision: 268269
URL: http://svnweb.freebsd.org/changeset/base/268269

Log:
  units(1): add long options
  	Things brings additional compatibility with units 2.10
  
  Discussed with:	wblock (man page)

Modified:
  head/usr.bin/units/units.1
  head/usr.bin/units/units.c

Modified: head/usr.bin/units/units.1
==============================================================================
--- head/usr.bin/units/units.1	Fri Jul  4 21:06:48 2014	(r268268)
+++ head/usr.bin/units/units.1	Fri Jul  4 21:21:05 2014	(r268269)
@@ -13,17 +13,19 @@
 .Sh OPTIONS
 The following options are available:
 .Bl -tag -width indent
-.It Fl f Ar filename
+.It Fl f Ar filename No , Fl -file Ar filename
 Specify the name of the units data file to load.
-.It Fl q
+.It Fl q No , Fl -quiet
 Suppress prompting of the user for units and the display of statistics
 about the number of units loaded.
-.It Fl U
+.It Fl U No , Fl -unitsfile
 If the default unit file exists prints its location.  If not, print
 .Qo
 Units data file not found
 .Qc
-.It Fl V
+.It Fl v No , Fl -verbose
+Print the units in the conversion output.  Be more verbose in general.
+.It Fl V No , Fl -version
 Print the version number, usage, and then exit.
 .It Ar from-unit to-unit
 Allow a single unit conversion to be done directly from the command
@@ -31,8 +33,6 @@ line.
 The program will not print prompts.
 It will print out the
 result of the single specified conversion.
-.It Fl v
-Print the units in the conversion output.  Be more verbose in general.
 .El
 .Sh DESCRIPTION
 The

Modified: head/usr.bin/units/units.c
==============================================================================
--- head/usr.bin/units/units.c	Fri Jul  4 21:06:48 2014	(r268268)
+++ head/usr.bin/units/units.c	Fri Jul  4 21:21:05 2014	(r268269)
@@ -24,6 +24,7 @@ static const char rcsid[] =
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -702,6 +703,15 @@ usage(void)
 	exit(3);
 }
 
+static struct option longopts[] = {
+	{"file", required_argument, NULL, 'f'},
+	{"quiet", no_argument, NULL, 'q'},
+	{"verbose", no_argument, NULL, 'v'},
+	{"unitsfile", no_argument, NULL, 'U'},
+	{"version", no_argument, NULL, 'V'},
+	{ 0, 0, 0, 0 }
+};
+
 
 int
 main(int argc, char **argv)
@@ -718,7 +728,7 @@ main(int argc, char **argv)
 
 	quiet = false;
 	readfile = false;
-	while ((optchar = getopt(argc, argv, "f:qvUV")) != -1) {
+	while ((optchar = getopt_long(argc, argv, "+f:qvUV", longopts, NULL)) != -1) {
 		switch (optchar) {
 		case 'f':
 			readfile = true;

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  4 21:34:49 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 702C6E24;
 Fri,  4 Jul 2014 21:34:49 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5D53B250E;
 Fri,  4 Jul 2014 21:34:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s64LYnL5092462;
 Fri, 4 Jul 2014 21:34:49 GMT (envelope-from eadler@svn.freebsd.org)
Received: (from eadler@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64LYnUV092461;
 Fri, 4 Jul 2014 21:34:49 GMT (envelope-from eadler@svn.freebsd.org)
Message-Id: <201407042134.s64LYnUV092461@svn.freebsd.org>
From: Eitan Adler 
Date: Fri, 4 Jul 2014 21:34:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268270 - head/usr.bin/units
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 04 Jul 2014 21:34:49 -0000

Author: eadler
Date: Fri Jul  4 21:34:48 2014
New Revision: 268270
URL: http://svnweb.freebsd.org/changeset/base/268270

Log:
  units(1): Fix man page
  	Igor walks one way.  I walked the other.
  
  Reported by:	wblock

Modified:
  head/usr.bin/units/units.1

Modified: head/usr.bin/units/units.1
==============================================================================
--- head/usr.bin/units/units.1	Fri Jul  4 21:21:05 2014	(r268269)
+++ head/usr.bin/units/units.1	Fri Jul  4 21:34:48 2014	(r268270)
@@ -1,5 +1,5 @@
 .\" $FreeBSD$
-.Dd April 14, 2014
+.Dd July 4, 2014
 .Dt UNITS 1
 .Os
 .Sh NAME
@@ -19,12 +19,14 @@ Specify the name of the units data file 
 Suppress prompting of the user for units and the display of statistics
 about the number of units loaded.
 .It Fl U No , Fl -unitsfile
-If the default unit file exists prints its location.  If not, print
+If the default unit file exists prints its location.
+If not, print
 .Qo
 Units data file not found
 .Qc
 .It Fl v No , Fl -verbose
-Print the units in the conversion output.  Be more verbose in general.
+Print the units in the conversion output.
+Be more verbose in general.
 .It Fl V No , Fl -version
 Print the version number, usage, and then exit.
 .It Ar from-unit to-unit

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  4 22:19:22 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 53F4EB16;
 Fri,  4 Jul 2014 22:19:22 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 411E0280D;
 Fri,  4 Jul 2014 22:19:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s64MJMUL014526;
 Fri, 4 Jul 2014 22:19:22 GMT (envelope-from eadler@svn.freebsd.org)
Received: (from eadler@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64MJLY4014524;
 Fri, 4 Jul 2014 22:19:21 GMT (envelope-from eadler@svn.freebsd.org)
Message-Id: <201407042219.s64MJLY4014524@svn.freebsd.org>
From: Eitan Adler 
Date: Fri, 4 Jul 2014 22:19:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268271 - head/usr.bin/units
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 04 Jul 2014 22:19:22 -0000

Author: eadler
Date: Fri Jul  4 22:19:21 2014
New Revision: 268271
URL: http://svnweb.freebsd.org/changeset/base/268271

Log:
  units(1): Add 'help' flag
  	- Add support for --help for compatibility
  	- Make usage() static

Modified:
  head/usr.bin/units/units.1
  head/usr.bin/units/units.c

Modified: head/usr.bin/units/units.1
==============================================================================
--- head/usr.bin/units/units.1	Fri Jul  4 21:34:48 2014	(r268270)
+++ head/usr.bin/units/units.1	Fri Jul  4 22:19:21 2014	(r268271)
@@ -13,6 +13,8 @@
 .Sh OPTIONS
 The following options are available:
 .Bl -tag -width indent
+.It Fl h No , Fl -help
+Show an overview of options
 .It Fl f Ar filename No , Fl -file Ar filename
 Specify the name of the units data file to load.
 .It Fl q No , Fl -quiet

Modified: head/usr.bin/units/units.c
==============================================================================
--- head/usr.bin/units/units.c	Fri Jul  4 21:34:48 2014	(r268270)
+++ head/usr.bin/units/units.c	Fri Jul  4 22:19:21 2014	(r268271)
@@ -695,7 +695,7 @@ showanswer(struct unittype * have, struc
 }
 
 
-void 
+static void 
 usage(void)
 {
 	fprintf(stderr,
@@ -704,6 +704,7 @@ usage(void)
 }
 
 static struct option longopts[] = {
+	{"help", no_argument, NULL, 'h'},
 	{"file", required_argument, NULL, 'f'},
 	{"quiet", no_argument, NULL, 'q'},
 	{"verbose", no_argument, NULL, 'v'},
@@ -728,7 +729,7 @@ main(int argc, char **argv)
 
 	quiet = false;
 	readfile = false;
-	while ((optchar = getopt_long(argc, argv, "+f:qvUV", longopts, NULL)) != -1) {
+	while ((optchar = getopt_long(argc, argv, "+hf:qvUV", longopts, NULL)) != -1) {
 		switch (optchar) {
 		case 'f':
 			readfile = true;
@@ -753,6 +754,9 @@ main(int argc, char **argv)
 				printf("Units data file not found");
 			exit(0);
 			break;
+		case 'h':
+			/* FALLTHROUGH */
+
 		default:
 			usage();
 		}

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  4 22:39:40 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1AD352B6;
 Fri,  4 Jul 2014 22:39:40 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E2AFC29F4;
 Fri,  4 Jul 2014 22:39:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s64Mdd7X024228;
 Fri, 4 Jul 2014 22:39:39 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64Mdd3P024227;
 Fri, 4 Jul 2014 22:39:39 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201407042239.s64Mdd3P024227@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Fri, 4 Jul 2014 22:39:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268272 - head/lib/libc/locale
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 04 Jul 2014 22:39:40 -0000

Author: pfg
Date: Fri Jul  4 22:39:39 2014
New Revision: 268272
URL: http://svnweb.freebsd.org/changeset/base/268272

Log:
  minor perf enhancement for UTF-8
  
  Reduce some duplicate code.
  
  Reference:
  https://www.illumos.org/issues/628
  
  Obtained from:	Illumos
  MFC after:	1 week

Modified:
  head/lib/libc/locale/utf8.c

Modified: head/lib/libc/locale/utf8.c
==============================================================================
--- head/lib/libc/locale/utf8.c	Fri Jul  4 22:19:21 2014	(r268271)
+++ head/lib/libc/locale/utf8.c	Fri Jul  4 22:39:39 2014	(r268272)
@@ -1,4 +1,5 @@
 /*-
+ * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 2002-2004 Tim J. Robbins
  * All rights reserved.
  *
@@ -112,13 +113,6 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, 
 		/* Incomplete multibyte sequence */
 		return ((size_t)-2);
 
-	if (us->want == 0 && ((ch = (unsigned char)*s) & ~0x7f) == 0) {
-		/* Fast path for plain ASCII characters. */
-		if (pwc != NULL)
-			*pwc = ch;
-		return (ch != '\0' ? 1 : 0);
-	}
-
 	if (us->want == 0) {
 		/*
 		 * Determine the number of octets that make up this character
@@ -134,10 +128,12 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, 
 		 */
 		ch = (unsigned char)*s;
 		if ((ch & 0x80) == 0) {
-			mask = 0x7f;
-			want = 1;
-			lbound = 0;
-		} else if ((ch & 0xe0) == 0xc0) {
+			/* Fast path for plain ASCII characters. */
+			if (pwc != NULL)
+				*pwc = ch;
+			return (ch != '\0' ? 1 : 0);
+		}
+		if ((ch & 0xe0) == 0xc0) {
 			mask = 0x1f;
 			want = 2;
 			lbound = 0x80;
@@ -316,12 +312,6 @@ _UTF8_wcrtomb(char * __restrict s, wchar
 		/* Reset to initial shift state (no-op) */
 		return (1);
 
-	if ((wc & ~0x7f) == 0) {
-		/* Fast path for plain ASCII characters. */
-		*s = (char)wc;
-		return (1);
-	}
-
 	/*
 	 * Determine the number of octets needed to represent this character.
 	 * We always output the shortest sequence possible. Also specify the
@@ -329,8 +319,9 @@ _UTF8_wcrtomb(char * __restrict s, wchar
 	 * about the sequence length.
 	 */
 	if ((wc & ~0x7f) == 0) {
-		lead = 0;
-		len = 1;
+		/* Fast path for plain ASCII characters. */
+		*s = (char)wc;
+		return (1);
 	} else if ((wc & ~0x7ff) == 0) {
 		lead = 0xc0;
 		len = 2;

From owner-svn-src-head@FreeBSD.ORG  Fri Jul  4 22:47:07 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id BC6804CB;
 Fri,  4 Jul 2014 22:47:07 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A966E2AAA;
 Fri,  4 Jul 2014 22:47:07 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s64Ml7I1028443;
 Fri, 4 Jul 2014 22:47:07 GMT (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64Ml79d028442;
 Fri, 4 Jul 2014 22:47:07 GMT (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201407042247.s64Ml79d028442@svn.freebsd.org>
From: Rick Macklem 
Date: Fri, 4 Jul 2014 22:47:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268273 - head/sys/fs/nfsserver
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 04 Jul 2014 22:47:07 -0000

Author: rmacklem
Date: Fri Jul  4 22:47:07 2014
New Revision: 268273
URL: http://svnweb.freebsd.org/changeset/base/268273

Log:
  The new NFSv3 server did not generate directory postop attributes for
  the reply to ReaddirPlus when the server failed within the loop
  that calls VFS_VGET(). This failure is most likely an error
  return from VFS_VGET() caused by a bogus d_fileno that was
  truncated to 32bits.
  This patch fixes the server so that it will return directory postop
  attributes for the failure. It does not fix the underlying issue caused
  by d_fileno being uint32_t when a file system like ZFS generates
  a fileno that is greater than 32bits.
  
  Reported by:	jpaetzel
  Reviewed by:	jpaetzel
  MFC after:	1 month

Modified:
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdport.c	Fri Jul  4 22:39:39 2014	(r268272)
+++ head/sys/fs/nfsserver/nfs_nfsdport.c	Fri Jul  4 22:47:07 2014	(r268273)
@@ -2264,9 +2264,11 @@ again:
 	if (dirlen > cnt || nd->nd_repstat) {
 		if (!nd->nd_repstat && entrycnt == 0)
 			nd->nd_repstat = NFSERR_TOOSMALL;
-		if (nd->nd_repstat)
+		if (nd->nd_repstat) {
 			newnfs_trimtrailing(nd, mb0, bpos0);
-		else
+			if (nd->nd_flag & ND_NFSV3)
+				nfsrv_postopattr(nd, getret, &at);
+		} else
 			newnfs_trimtrailing(nd, mb1, bpos1);
 		eofflag = 0;
 	} else if (cpos < cend)

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 01:24:07 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4EBF49FD;
 Sat,  5 Jul 2014 01:24:07 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3C66C2681;
 Sat,  5 Jul 2014 01:24:07 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s651O7qE010119;
 Sat, 5 Jul 2014 01:24:07 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s651O7Pf010118;
 Sat, 5 Jul 2014 01:24:07 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407050124.s651O7Pf010118@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 5 Jul 2014 01:24:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268275 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 01:24:07 -0000

Author: mav
Date: Sat Jul  5 01:24:06 2014
New Revision: 268275
URL: http://svnweb.freebsd.org/changeset/base/268275

Log:
  Use proper links field for ports linking.

Modified:
  head/sys/cam/ctl/ctl_frontend.c

Modified: head/sys/cam/ctl/ctl_frontend.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend.c	Sat Jul  5 01:14:14 2014	(r268274)
+++ head/sys/cam/ctl/ctl_frontend.c	Sat Jul  5 01:24:06 2014	(r268275)
@@ -162,7 +162,7 @@ ctl_port_register(struct ctl_port *port,
 	mtx_lock(&control_softc->ctl_lock);
 	port->targ_port = port_num + (master_shelf != 0 ? 0 : CTL_MAX_PORTS);
 	port->max_initiators = CTL_MAX_INIT_PER_PORT;
-	STAILQ_INSERT_TAIL(&port->frontend->port_list, port, links);
+	STAILQ_INSERT_TAIL(&port->frontend->port_list, port, fe_links);
 	STAILQ_INSERT_TAIL(&control_softc->port_list, port, links);
 	control_softc->ctl_ports[port_num] = port;
 	mtx_unlock(&control_softc->ctl_lock);

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 02:38:54 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6B012263;
 Sat,  5 Jul 2014 02:38:54 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 582292AB5;
 Sat,  5 Jul 2014 02:38:54 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s652csd3042647;
 Sat, 5 Jul 2014 02:38:54 GMT (envelope-from grehan@svn.freebsd.org)
Received: (from grehan@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s652cs6t042646;
 Sat, 5 Jul 2014 02:38:54 GMT (envelope-from grehan@svn.freebsd.org)
Message-Id: <201407050238.s652cs6t042646@svn.freebsd.org>
From: Peter Grehan 
Date: Sat, 5 Jul 2014 02:38:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268276 - head/usr.sbin/bhyve
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 02:38:54 -0000

Author: grehan
Date: Sat Jul  5 02:38:53 2014
New Revision: 268276
URL: http://svnweb.freebsd.org/changeset/base/268276

Log:
  Extend capabilities to 64-bits in preparation for some API changes.
  The v1.0 virtio spec supports an extended size for guest/host
  caps, but in practice 64-bits should last for a long time.

Modified:
  head/usr.sbin/bhyve/virtio.h

Modified: head/usr.sbin/bhyve/virtio.h
==============================================================================
--- head/usr.sbin/bhyve/virtio.h	Sat Jul  5 01:24:06 2014	(r268275)
+++ head/usr.sbin/bhyve/virtio.h	Sat Jul  5 02:38:53 2014	(r268276)
@@ -352,7 +352,7 @@ struct virtio_consts {
 					/* called to read config regs */
 	int	(*vc_cfgwrite)(void *, int, int, uint32_t);
 					/* called to write config regs */
-	uint32_t vc_hv_caps;		/* hypervisor-provided capabilities */
+	uint64_t vc_hv_caps;		/* hypervisor-provided capabilities */
 };
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 03:17:58 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 863F6A7E;
 Sat,  5 Jul 2014 03:17:58 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 66CFB2DF7;
 Sat,  5 Jul 2014 03:17:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s653HwXh062181;
 Sat, 5 Jul 2014 03:17:58 GMT (envelope-from eadler@svn.freebsd.org)
Received: (from eadler@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s653HwJV062179;
 Sat, 5 Jul 2014 03:17:58 GMT (envelope-from eadler@svn.freebsd.org)
Message-Id: <201407050317.s653HwJV062179@svn.freebsd.org>
From: Eitan Adler 
Date: Sat, 5 Jul 2014 03:17:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268277 - head/usr.bin/units
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 03:17:58 -0000

Author: eadler
Date: Sat Jul  5 03:17:57 2014
New Revision: 268277
URL: http://svnweb.freebsd.org/changeset/base/268277

Log:
  units(1): Add 'terse' support
  	terse output is used when calling units from another script.

Modified:
  head/usr.bin/units/units.1
  head/usr.bin/units/units.c

Modified: head/usr.bin/units/units.1
==============================================================================
--- head/usr.bin/units/units.1	Sat Jul  5 02:38:53 2014	(r268276)
+++ head/usr.bin/units/units.1	Sat Jul  5 03:17:57 2014	(r268277)
@@ -26,6 +26,10 @@ If not, print
 .Qo
 Units data file not found
 .Qc
+.It Fl t No , Fl -terse
+Only print the result.  This is used when calling
+.Nm
+from other programs for easy to parse results.
 .It Fl v No , Fl -verbose
 Print the units in the conversion output.
 Be more verbose in general.

Modified: head/usr.bin/units/units.c
==============================================================================
--- head/usr.bin/units/units.c	Sat Jul  5 02:38:53 2014	(r268276)
+++ head/usr.bin/units/units.c	Sat Jul  5 03:17:57 2014	(r268277)
@@ -78,6 +78,7 @@ static char NULLUNIT[] = "";
 static int unitcount;
 static int prefixcount;
 static bool verbose = false;
+static bool terse = false;
 static const char * havestr;
 static const char * wantstr;
 
@@ -657,14 +658,16 @@ showanswer(struct unittype * have, struc
 		printf("conformability error\n");
 		if (verbose)
 			printf("\t%s = ", havestr);
-		else
+		else if (!terse)
 			printf("\t");
 		showunit(have);
-		if (verbose)
-			printf("\t%s = ", wantstr);
-		else
-			printf("\t");
-		showunit(want);
+		if (!terse) {
+			if (verbose)
+				printf("\t%s = ", wantstr);
+			else
+				printf("\t");
+			showunit(want);
+		}
 	}
 	else if (have->offset != want->offset) {
 		if (want->quantity)
@@ -684,12 +687,14 @@ showanswer(struct unittype * have, struc
 		ans = have->factor / want->factor;
 		if (verbose)
 			printf("\t%s = %.8g * %s\n", havestr, ans, wantstr);
-		else
+		else if (terse) 
+			printf("%.8g\n", ans);
+		else 
 			printf("\t* %.8g\n", ans);
 
 		if (verbose)
 			printf("\t%s = (1 / %.8g) * %s\n", havestr, 1/ans,  wantstr);
-		else
+		else if (!terse)
 			printf("\t/ %.8g\n", 1/ans);
 	}
 }
@@ -707,8 +712,9 @@ static struct option longopts[] = {
 	{"help", no_argument, NULL, 'h'},
 	{"file", required_argument, NULL, 'f'},
 	{"quiet", no_argument, NULL, 'q'},
-	{"verbose", no_argument, NULL, 'v'},
+	{"terse", no_argument, NULL, 't'},
 	{"unitsfile", no_argument, NULL, 'U'},
+	{"verbose", no_argument, NULL, 'v'},
 	{"version", no_argument, NULL, 'V'},
 	{ 0, 0, 0, 0 }
 };
@@ -729,7 +735,7 @@ main(int argc, char **argv)
 
 	quiet = false;
 	readfile = false;
-	while ((optchar = getopt_long(argc, argv, "+hf:qvUV", longopts, NULL)) != -1) {
+	while ((optchar = getopt_long(argc, argv, "+hf:qtvUV", longopts, NULL)) != -1) {
 		switch (optchar) {
 		case 'f':
 			readfile = true;
@@ -741,6 +747,9 @@ main(int argc, char **argv)
 		case 'q':
 			quiet = true;
 			break;
+		case 't':
+			terse = true;
+			break;
 		case 'v':
 			verbose = true;
 			break;
@@ -825,5 +834,5 @@ main(int argc, char **argv)
 
 	history_end(inhistory);
 	el_end(el);
-	return(0);
+	return (0);
 }

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 03:25:27 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8DB66D3A;
 Sat,  5 Jul 2014 03:25:27 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7B2E42EB3;
 Sat,  5 Jul 2014 03:25:27 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s653PR3i066630;
 Sat, 5 Jul 2014 03:25:27 GMT (envelope-from eadler@svn.freebsd.org)
Received: (from eadler@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s653PRqE066628;
 Sat, 5 Jul 2014 03:25:27 GMT (envelope-from eadler@svn.freebsd.org)
Message-Id: <201407050325.s653PRqE066628@svn.freebsd.org>
From: Eitan Adler 
Date: Sat, 5 Jul 2014 03:25:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268278 - head/usr.bin/units
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 03:25:27 -0000

Author: eadler
Date: Sat Jul  5 03:25:26 2014
New Revision: 268278
URL: http://svnweb.freebsd.org/changeset/base/268278

Log:
  units: Support start of line comments with '#'
  	Modern GNU units(1) supports comments anywhere with '#' but take the easy route for now and at least support start of line # comments.

Modified:
  head/usr.bin/units/units.1
  head/usr.bin/units/units.c

Modified: head/usr.bin/units/units.1
==============================================================================
--- head/usr.bin/units/units.1	Sat Jul  5 03:17:57 2014	(r268277)
+++ head/usr.bin/units/units.1	Sat Jul  5 03:25:26 2014	(r268278)
@@ -149,7 +149,7 @@ The
 program will not detect infinite loops that could be caused
 by careless unit definitions.
 Comments in the unit definition file
-begin with a '/' character at the beginning of a line.
+begin with a '#' or '/' character at the beginning of a line.
 .Pp
 Prefixes are defined in the same was as standard units, but with
 a trailing dash at the end of the prefix name.

Modified: head/usr.bin/units/units.c
==============================================================================
--- head/usr.bin/units/units.c	Sat Jul  5 03:17:57 2014	(r268277)
+++ head/usr.bin/units/units.c	Sat Jul  5 03:25:26 2014	(r268278)
@@ -166,7 +166,7 @@ readunits(const char *userfile)
 			break;
 		linenum++;
 		lineptr = line;
-		if (*lineptr == '/')
+		if (*lineptr == '/' || *lineptr == '#')
 			continue;
 		lineptr += strspn(lineptr, " \n\t");
 		len = strcspn(lineptr, " \n\t");

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 03:27:32 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8A491E84;
 Sat,  5 Jul 2014 03:27:32 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6AF072EBF;
 Sat,  5 Jul 2014 03:27:32 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s653RWBE066913;
 Sat, 5 Jul 2014 03:27:32 GMT (envelope-from eadler@svn.freebsd.org)
Received: (from eadler@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s653RW7L066912;
 Sat, 5 Jul 2014 03:27:32 GMT (envelope-from eadler@svn.freebsd.org)
Message-Id: <201407050327.s653RW7L066912@svn.freebsd.org>
From: Eitan Adler 
Date: Sat, 5 Jul 2014 03:27:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268279 - head/usr.bin/units
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 03:27:32 -0000

Author: eadler
Date: Sat Jul  5 03:27:31 2014
New Revision: 268279
URL: http://svnweb.freebsd.org/changeset/base/268279

Log:
  units(1): Convert units.lib to use '#' instead of '/'.
  	This allows us to run GNU units against our data files and compare the output.
  	In addition, current units(1) does not support '/' as a comment at all.

Modified:
  head/usr.bin/units/units.lib

Modified: head/usr.bin/units/units.lib
==============================================================================
--- head/usr.bin/units/units.lib	Sat Jul  5 03:25:26 2014	(r268278)
+++ head/usr.bin/units/units.lib	Sat Jul  5 03:27:31 2014	(r268279)
@@ -1,6 +1,6 @@
-/ $FreeBSD$
+# $FreeBSD$
 
-/ primitive units
+# primitive units
 
 m			!a!
 kg			!b!
@@ -13,7 +13,7 @@ bit			!h!
 erlang			!i!
 K			!j!
 
-/ prefixes
+# prefixes
 
 yotta-			1e24
 zetta-			1e21
@@ -68,7 +68,7 @@ a-			atto
 z-			zopto
 y-			yocto
 
-/ binary prefixes introduced in 1999
+# binary prefixes introduced in 1999
 exbi-			1152921504606846976
 pebi-			1125899906842624
 tebi-			1099511627776
@@ -83,7 +83,7 @@ Gi-			gibi
 Mi-			mebi
 Ki-			kibi
 
-/ constants
+# constants
 
 fuzz			1
 pi			3.14159265358979323846
@@ -109,7 +109,7 @@ electronmass		9.1093821545-31 kg
 protonmass		1.6726217129-27 kg
 neutronmass		1.6749272928-27 kg
 
-/ dimensionless
+# dimensionless
 
 radian			.5 / pi
 degree			1|180 pi-radian
@@ -127,7 +127,7 @@ steradian		radian2
 sphere			4 pi-steradian
 sr			steradian
 
-/ Time
+# Time
 
 second			sec
 s			sec
@@ -143,13 +143,13 @@ yr			year
 month			1|12 year
 us			microsec
 
-/ Mass
+# Mass
 
 gram			millikg
 gm			gram
 metricton		kilokg
 
-/ Avoirdupois
+# Avoirdupois
 
 lb			.45359237 kg
 pound			lb
@@ -164,7 +164,7 @@ shortton		2000 lb
 ton			shortton
 longton			2240 lb
 
-/ Apothecary
+# Apothecary
 
 scruple			20 grain
 apdram			60 grain
@@ -172,7 +172,7 @@ apounce			480 grain
 appound			5760 grain
 troypound		appound
 
-/ Mining
+# Mining
 
 troyounce		apounce
 troz			apounce
@@ -180,7 +180,7 @@ pennyweight		1|20 troz
 pwt			pennyweight
 dwt			pennyweight
 
-/ Length
+# Length
 
 meter			m
 micron			micrometer
@@ -208,7 +208,7 @@ cc			cm3
 liter			kilocc
 ml			milliliter
 
-/ US Liquid
+# US Liquid
 
 gallon			231 in3
 imperial		1.20095
@@ -222,7 +222,7 @@ floz			1|16 pt
 fldr			1|8 floz
 shot			3|2 floz
 
-/ US Dry
+# US Dry
 
 dry			268.8025 in3/gallon fuzz
 peck			8 dry-quart
@@ -231,7 +231,7 @@ bushel			4 peck
 bu			bushel
 chaldron		36 bushel
 
-/ British
+# British
 
 brgallon		277.420 in3 fuzz
 brquart			1|4 brgallon
@@ -241,10 +241,10 @@ brpeck			554.84 in3 fuzz
 brbushel		4 brpeck
 brhundredweight		112 lb
 
-/ Bottles
+# Bottles
 
 bottle			750 milliliter
-/bottle			fifth
+#bottle			fifth
 
 miniature		100 milliliter
 split			1|4 bottle
@@ -258,7 +258,7 @@ balthazar		16 bottle
 nebuchadnezzar		20 bottle
 sovereign		34 bottle
 
-/ Bottles - alternate names and spellings
+# Bottles - alternate names and spellings
 
 pony			split
 fillette		half
@@ -266,7 +266,7 @@ tappit-hen		3 imperial
 rheoboam		rehoboam
 shalmaneser		salmanazar
 
-/ Russian
+# Russian
 berkovets		10 pood
 pood			40 funt
 funt			0.40951 kg
@@ -279,7 +279,7 @@ verst			1066.8 m
 sazhen			1|500 verst
 kosayasazhen		1|430.2 verst
 arshin			1|1500 verst
-/ is not exactly defined
+# is not exactly defined
 ruell			16.54 in
 liniya			1|10 in
 vershok			1.75 in
@@ -296,7 +296,7 @@ sqverst			104.2 desyatina_state
 sqarshin		1|21600 desyatina_state
 sqfoot			1|117600 desyatina_state
 
-/ Energy Work
+# Energy Work
 
 newton			kg-m/sec2
 nt			newton
@@ -306,7 +306,7 @@ J			joule
 cal			4.1868 joule
 ergon			erg
 
-/ Electrical
+# Electrical
 
 coulomb			coul
 C			coul
@@ -325,14 +325,14 @@ H			henry
 weber			volt-sec
 Wb			weber
 
-/ Light
+# Light
 
 cd			candela
 lumen			cd sr
 lux			cd sr/m2
 
-/ EMU currencies have constant exchange rate against Euro since 1.1.1999.
-/ See http://en.wikipedia.org/wiki/Euro for details.
+# EMU currencies have constant exchange rate against Euro since 1.1.1999.
+# See http://en.wikipedia.org/wiki/Euro for details.
 austriaschilling	1|13.7603 euro
 belgiumfranc		1|40.3399 euro
 finlandmarkka		1|5.94573 euro
@@ -350,8 +350,8 @@ cypriotpound		1|0.585274 euro
 malteselira		1|0.429300 euro
 slovakkoruna		1|30.1260 euro
 
-/ These ones are pegged to the Euro
-/ See http://en.wikipedia.org/wiki/Euro for details.
+# These ones are pegged to the Euro
+# See http://en.wikipedia.org/wiki/Euro for details.
 bosniaherzegovinamark	1|1.95583 euro
 bulgarianlev		1|1.95583 euro
 capeverdeanescudo	1|110.265 euro
@@ -363,8 +363,8 @@ lithuanianlitas		1|3.45280 euro
 pacificfrancexchange	1|0.00838 euro
 westafricancfafranc	1|655.957 euro
 
-/ These ones are pegged on the US Dollar
-/ See http://en.wikipedia.org/wiki/USD for details.
+# These ones are pegged on the US Dollar
+# See http://en.wikipedia.org/wiki/USD for details.
 dollar			usdollar
 arubanflorin		1|1.75 usdollar
 bahamiandollar		1|1 usdollar
@@ -404,7 +404,7 @@ markka			finlandmarkka
 peseta			spainpeseta
 rand			southafricarand
 
-/ computer
+# computer
 
 baud			bit/sec
 nibble			4 bit
@@ -424,7 +424,7 @@ kilobyte		kbyte
 meg			megabyte
 
 
-/ Trivia
+# Trivia
 
 %			1|100
 abampere		10 ampere

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 03:34:54 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 41C47B3;
 Sat,  5 Jul 2014 03:34:54 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2E2B82F56;
 Sat,  5 Jul 2014 03:34:54 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s653YrX1071092;
 Sat, 5 Jul 2014 03:34:53 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s653Yq7n071085;
 Sat, 5 Jul 2014 03:34:52 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407050334.s653Yq7n071085@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 5 Jul 2014 03:34:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268280 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 03:34:54 -0000

Author: mav
Date: Sat Jul  5 03:34:52 2014
New Revision: 268280
URL: http://svnweb.freebsd.org/changeset/base/268280

Log:
  Make options KPI more generic to allow it to be used for ports too,
  not only for LUNs.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl.h
  head/sys/cam/ctl/ctl_backend.c
  head/sys/cam/ctl/ctl_backend.h
  head/sys/cam/ctl/ctl_backend_block.c
  head/sys/cam/ctl/ctl_backend_ramdisk.c
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sat Jul  5 03:27:31 2014	(r268279)
+++ head/sys/cam/ctl/ctl.c	Sat Jul  5 03:34:52 2014	(r268280)
@@ -2954,7 +2954,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 		struct sbuf *sb;
 		struct ctl_lun *lun;
 		struct ctl_lun_list *list;
-		struct ctl_be_lun_option *opt;
+		struct ctl_option *opt;
 
 		list = (struct ctl_lun_list *)addr;
 
@@ -9579,7 +9579,8 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
 	 */
 	desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10;
 	desc->length = sizeof(*t10id) + devid_len;
-	if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) {
+	if (lun == NULL || (val = ctl_get_opt(&lun->be_lun->options,
+	    "vendor")) == NULL) {
 		strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor));
 	} else {
 		memset(t10id->vendor, ' ', sizeof(t10id->vendor));
@@ -9963,7 +9964,8 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio
 	 * We have 8 bytes for the vendor name, and 16 bytes for the device
 	 * name and 4 bytes for the revision.
 	 */
-	if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) {
+	if (lun == NULL || (val = ctl_get_opt(&lun->be_lun->options,
+	    "vendor")) == NULL) {
 		strcpy(inq_ptr->vendor, CTL_VENDOR);
 	} else {
 		memset(inq_ptr->vendor, ' ', sizeof(inq_ptr->vendor));
@@ -9972,7 +9974,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio
 	}
 	if (lun == NULL) {
 		strcpy(inq_ptr->product, CTL_DIRECT_PRODUCT);
-	} else if ((val = ctl_get_opt(lun->be_lun, "product")) == NULL) {
+	} else if ((val = ctl_get_opt(&lun->be_lun->options, "product")) == NULL) {
 		switch (lun->be_lun->lun_type) {
 		case T_DIRECT:
 			strcpy(inq_ptr->product, CTL_DIRECT_PRODUCT);
@@ -9994,7 +9996,8 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio
 	 * XXX make this a macro somewhere so it automatically gets
 	 * incremented when we make changes.
 	 */
-	if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "revision")) == NULL) {
+	if (lun == NULL || (val = ctl_get_opt(&lun->be_lun->options,
+	    "revision")) == NULL) {
 		strncpy(inq_ptr->revision, "0001", sizeof(inq_ptr->revision));
 	} else {
 		memset(inq_ptr->revision, ' ', sizeof(inq_ptr->revision));

Modified: head/sys/cam/ctl/ctl.h
==============================================================================
--- head/sys/cam/ctl/ctl.h	Sat Jul  5 03:27:31 2014	(r268279)
+++ head/sys/cam/ctl/ctl.h	Sat Jul  5 03:34:52 2014	(r268280)
@@ -186,6 +186,22 @@ void ctl_config_write_done(union ctl_io 
 void ctl_portDB_changed(int portnum);
 void ctl_init_isc_msg(void);
 
+/*
+ * KPI to manipulate LUN/port options
+ */
+
+struct ctl_option {
+	STAILQ_ENTRY(ctl_option)	links;
+	char			*name;
+	char			*value;
+};
+typedef STAILQ_HEAD(ctl_options, ctl_option) ctl_options_t;
+
+struct ctl_be_arg;
+void ctl_init_opts(ctl_options_t *opts, int num_args, struct ctl_be_arg *args);
+void ctl_free_opts(ctl_options_t *opts);
+char * ctl_get_opt(ctl_options_t *opts, const char *name);
+
 #endif	/* _KERNEL */
 
 #endif	/* _CTL_H_ */

Modified: head/sys/cam/ctl/ctl_backend.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend.c	Sat Jul  5 03:27:31 2014	(r268279)
+++ head/sys/cam/ctl/ctl_backend.c	Sat Jul  5 03:34:52 2014	(r268280)
@@ -174,29 +174,29 @@ ctl_backend_find(char *backend_name)
 }
 
 void
-ctl_init_opts(struct ctl_be_lun *be_lun, struct ctl_lun_req *req)
+ctl_init_opts(ctl_options_t *opts, int num_args, struct ctl_be_arg *args)
 {
-	struct ctl_be_lun_option *opt;
+	struct ctl_option *opt;
 	int i;
 
-	STAILQ_INIT(&be_lun->options);
-	for (i = 0; i < req->num_be_args; i++) {
+	STAILQ_INIT(opts);
+	for (i = 0; i < num_args; i++) {
 		opt = malloc(sizeof(*opt), M_CTL, M_WAITOK);
-		opt->name = malloc(strlen(req->kern_be_args[i].kname) + 1, M_CTL, M_WAITOK);
-		strcpy(opt->name, req->kern_be_args[i].kname);
-		opt->value = malloc(strlen(req->kern_be_args[i].kvalue) + 1, M_CTL, M_WAITOK);
-		strcpy(opt->value, req->kern_be_args[i].kvalue);
-		STAILQ_INSERT_TAIL(&be_lun->options, opt, links);
+		opt->name = malloc(strlen(args[i].kname) + 1, M_CTL, M_WAITOK);
+		strcpy(opt->name, args[i].kname);
+		opt->value = malloc(strlen(args[i].kvalue) + 1, M_CTL, M_WAITOK);
+		strcpy(opt->value, args[i].kvalue);
+		STAILQ_INSERT_TAIL(opts, opt, links);
 	}
 }
 
 void
-ctl_free_opts(struct ctl_be_lun *be_lun)
+ctl_free_opts(ctl_options_t *opts)
 {
-	struct ctl_be_lun_option *opt;
+	struct ctl_option *opt;
 
-	while ((opt = STAILQ_FIRST(&be_lun->options)) != NULL) {
-		STAILQ_REMOVE_HEAD(&be_lun->options, links);
+	while ((opt = STAILQ_FIRST(opts)) != NULL) {
+		STAILQ_REMOVE_HEAD(opts, links);
 		free(opt->name, M_CTL);
 		free(opt->value, M_CTL);
 		free(opt, M_CTL);
@@ -204,11 +204,11 @@ ctl_free_opts(struct ctl_be_lun *be_lun)
 }
 
 char *
-ctl_get_opt(struct ctl_be_lun *be_lun, const char *name)
+ctl_get_opt(ctl_options_t *opts, const char *name)
 {
-	struct ctl_be_lun_option *opt;
+	struct ctl_option *opt;
 
-	STAILQ_FOREACH(opt, &be_lun->options, links) {
+	STAILQ_FOREACH(opt, opts, links) {
 		if (strcmp(opt->name, name) == 0) {
 			return (opt->value);
 		}

Modified: head/sys/cam/ctl/ctl_backend.h
==============================================================================
--- head/sys/cam/ctl/ctl_backend.h	Sat Jul  5 03:27:31 2014	(r268279)
+++ head/sys/cam/ctl/ctl_backend.h	Sat Jul  5 03:34:52 2014	(r268280)
@@ -180,12 +180,6 @@ typedef void (*be_lun_config_t)(void *be
  * The links field is for CTL internal use only, and should not be used by
  * the backend.
  */
-struct ctl_be_lun_option {
-	STAILQ_ENTRY(ctl_be_lun_option)	links;
-	char			*name;
-	char			*value;
-};
-
 struct ctl_be_lun {
 	uint8_t			lun_type;	/* passed to CTL */
 	ctl_backend_lun_flags	flags;		/* passed to CTL */
@@ -202,7 +196,7 @@ struct ctl_be_lun {
 	be_lun_config_t		lun_config_status; /* passed to CTL */
 	struct ctl_backend_driver *be;		/* passed to CTL */
 	void			*ctl_lun;	/* used by CTL */
-	STAILQ_HEAD(, ctl_be_lun_option) options; /* passed to CTL */
+	ctl_options_t		options;	/* passed to CTL */
 	STAILQ_ENTRY(ctl_be_lun) links;		/* used by CTL */
 };
 
@@ -301,14 +295,6 @@ int ctl_lun_online(struct ctl_be_lun *be
  */
 void ctl_lun_capacity_changed(struct ctl_be_lun *be_lun);
 
-/*
- * KPI to manipulate LUN options
- */
-struct ctl_lun_req;
-void ctl_init_opts(struct ctl_be_lun *be_lun, struct ctl_lun_req *req);
-void ctl_free_opts(struct ctl_be_lun *be_lun);
-char * ctl_get_opt(struct ctl_be_lun *be_lun, const char *name);
-
 #endif /* _KERNEL */
 #endif /* _CTL_BACKEND_H_ */
 

Modified: head/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_block.c	Sat Jul  5 03:27:31 2014	(r268279)
+++ head/sys/cam/ctl/ctl_backend_block.c	Sat Jul  5 03:34:52 2014	(r268280)
@@ -1857,7 +1857,8 @@ ctl_be_block_create(struct ctl_be_block_
 	sprintf(be_lun->lunname, "cblk%d", softc->num_luns);
 	mtx_init(&be_lun->io_lock, "cblk io lock", NULL, MTX_DEF);
 	mtx_init(&be_lun->queue_lock, "cblk queue lock", NULL, MTX_DEF);
-	ctl_init_opts(&be_lun->ctl_be_lun, req);
+	ctl_init_opts(&be_lun->ctl_be_lun.options,
+	    req->num_be_args, req->kern_be_args);
 
 	be_lun->lun_zone = uma_zcreate(be_lun->lunname, CTLBLK_MAX_SEG,
 	    NULL, NULL, NULL, NULL, /*align*/ 0, /*flags*/0);
@@ -1874,7 +1875,7 @@ ctl_be_block_create(struct ctl_be_block_
 		be_lun->ctl_be_lun.lun_type = T_DIRECT;
 
 	if (be_lun->ctl_be_lun.lun_type == T_DIRECT) {
-		value = ctl_get_opt(&be_lun->ctl_be_lun, "file");
+		value = ctl_get_opt(&be_lun->ctl_be_lun.options, "file");
 		if (value == NULL) {
 			snprintf(req->error_str, sizeof(req->error_str),
 				 "%s: no file argument specified", __func__);
@@ -1919,7 +1920,7 @@ ctl_be_block_create(struct ctl_be_block_
 	 * XXX This searching loop might be refactored to be combined with
 	 * the loop above,
 	 */
-	value = ctl_get_opt(&be_lun->ctl_be_lun, "num_threads");
+	value = ctl_get_opt(&be_lun->ctl_be_lun.options, "num_threads");
 	if (value != NULL) {
 		tmp_num_threads = strtol(value, NULL, 0);
 
@@ -1937,7 +1938,7 @@ ctl_be_block_create(struct ctl_be_block_
 		num_threads = tmp_num_threads;
 	}
 	unmap = 0;
-	value = ctl_get_opt(&be_lun->ctl_be_lun, "unmap");
+	value = ctl_get_opt(&be_lun->ctl_be_lun.options, "unmap");
 	if (value != NULL && strcmp(value, "on") == 0)
 		unmap = 1;
 
@@ -2102,7 +2103,7 @@ bailout_error:
 		free(be_lun->dev_path, M_CTLBLK);
 	if (be_lun->lun_zone != NULL)
 		uma_zdestroy(be_lun->lun_zone);
-	ctl_free_opts(&be_lun->ctl_be_lun);
+	ctl_free_opts(&be_lun->ctl_be_lun.options);
 	mtx_destroy(&be_lun->queue_lock);
 	mtx_destroy(&be_lun->io_lock);
 	free(be_lun, M_CTLBLK);
@@ -2190,7 +2191,7 @@ ctl_be_block_rm(struct ctl_be_block_soft
 
 	uma_zdestroy(be_lun->lun_zone);
 
-	ctl_free_opts(&be_lun->ctl_be_lun);
+	ctl_free_opts(&be_lun->ctl_be_lun.options);
 	free(be_lun->dev_path, M_CTLBLK);
 	mtx_destroy(&be_lun->queue_lock);
 	mtx_destroy(&be_lun->io_lock);

Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_ramdisk.c	Sat Jul  5 03:27:31 2014	(r268279)
+++ head/sys/cam/ctl/ctl_backend_ramdisk.c	Sat Jul  5 03:34:52 2014	(r268280)
@@ -505,7 +505,7 @@ ctl_backend_ramdisk_rm(struct ctl_be_ram
 	if (retval == 0) {
 		taskqueue_drain(be_lun->io_taskqueue, &be_lun->io_task);
 		taskqueue_free(be_lun->io_taskqueue);
-		ctl_free_opts(&be_lun->ctl_be_lun);
+		ctl_free_opts(&be_lun->ctl_be_lun.options);
 		mtx_destroy(&be_lun->queue_lock);
 		free(be_lun, M_RAMDISK);
 	}
@@ -548,7 +548,8 @@ ctl_backend_ramdisk_create(struct ctl_be
 		goto bailout_error;
 	}
 	sprintf(be_lun->lunname, "cram%d", softc->num_luns);
-	ctl_init_opts(&be_lun->ctl_be_lun, req);
+	ctl_init_opts(&be_lun->ctl_be_lun.options,
+	    req->num_be_args, req->kern_be_args);
 
 	if (params->flags & CTL_LUN_FLAG_DEV_TYPE)
 		be_lun->ctl_be_lun.lun_type = params->device_type;
@@ -586,7 +587,7 @@ ctl_backend_ramdisk_create(struct ctl_be
 	be_lun->softc = softc;
 
 	unmap = 0;
-	value = ctl_get_opt(&be_lun->ctl_be_lun, "unmap");
+	value = ctl_get_opt(&be_lun->ctl_be_lun.options, "unmap");
 	if (value != NULL && strcmp(value, "on") == 0)
 		unmap = 1;
 
@@ -721,7 +722,7 @@ bailout_error:
 		if (be_lun->io_taskqueue != NULL) {
 			taskqueue_free(be_lun->io_taskqueue);
 		}
-		ctl_free_opts(&be_lun->ctl_be_lun);
+		ctl_free_opts(&be_lun->ctl_be_lun.options);
 		mtx_destroy(&be_lun->queue_lock);
 		free(be_lun, M_RAMDISK);
 	}

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Sat Jul  5 03:27:31 2014	(r268279)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Sat Jul  5 03:34:52 2014	(r268280)
@@ -2106,7 +2106,8 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, 
 	desc->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_ASCII;
 	desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10;
 	desc->length = sizeof(*t10id) + devid_len;
-	if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) {
+	if (lun == NULL || (val = ctl_get_opt(&lun->be_lun->options,
+	    "vendor")) == NULL) {
 		strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor));
 	} else {
 		memset(t10id->vendor, ' ', sizeof(t10id->vendor));
@@ -2366,11 +2367,11 @@ cfiscsi_lun_enable(void *arg, struct ctl
 
 	softc = (struct cfiscsi_softc *)arg;
 
-	target = ctl_get_opt(control_softc->ctl_luns[lun_id]->be_lun,
+	target = ctl_get_opt(&control_softc->ctl_luns[lun_id]->be_lun->options,
 	    "cfiscsi_target");
-	target_alias = ctl_get_opt(control_softc->ctl_luns[lun_id]->be_lun,
+	target_alias = ctl_get_opt(&control_softc->ctl_luns[lun_id]->be_lun->options,
 	    "cfiscsi_target_alias");
-	lun = ctl_get_opt(control_softc->ctl_luns[lun_id]->be_lun,
+	lun = ctl_get_opt(&control_softc->ctl_luns[lun_id]->be_lun->options,
 	    "cfiscsi_lun");
 
 	if (target == NULL && lun == NULL)

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 03:49:21 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 441F23A3;
 Sat,  5 Jul 2014 03:49:21 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 253E12047;
 Sat,  5 Jul 2014 03:49:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s653nL8O076241;
 Sat, 5 Jul 2014 03:49:21 GMT (envelope-from eadler@svn.freebsd.org)
Received: (from eadler@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s653nLdY076240;
 Sat, 5 Jul 2014 03:49:21 GMT (envelope-from eadler@svn.freebsd.org)
Message-Id: <201407050349.s653nLdY076240@svn.freebsd.org>
From: Eitan Adler 
Date: Sat, 5 Jul 2014 03:49:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268282 - head/usr.bin/units
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 03:49:21 -0000

Author: eadler
Date: Sat Jul  5 03:49:20 2014
New Revision: 268282
URL: http://svnweb.freebsd.org/changeset/base/268282

Log:
  units(1): Clean up
  	Remove unused constant.  Add 'static' where able.

Modified:
  head/usr.bin/units/units.c

Modified: head/usr.bin/units/units.c
==============================================================================
--- head/usr.bin/units/units.c	Sat Jul  5 03:48:22 2014	(r268281)
+++ head/usr.bin/units/units.c	Sat Jul  5 03:49:20 2014	(r268282)
@@ -69,11 +69,7 @@ static struct {
 
 static char NULLUNIT[] = "";
 
-#ifdef MSDOS
-#define SEPARATOR      ";"
-#else
 #define SEPARATOR      ":"
-#endif
 
 static int unitcount;
 static int prefixcount;
@@ -107,7 +103,7 @@ static const char * prompt(EditLine *e _
 	return promptstr;
 }
 
-char *
+static char *
 dupstr(const char *str)
 {
 	char *ret;
@@ -119,7 +115,7 @@ dupstr(const char *str)
 }
 
 
-void 
+static void 
 readunits(const char *userfile)
 {
 	FILE *unitfile;
@@ -224,7 +220,7 @@ readunits(const char *userfile)
 	fclose(unitfile);
 }
 
-void 
+static void 
 initializeunit(struct unittype * theunit)
 {
 	theunit->numerator[0] = theunit->denominator[0] = NULL;
@@ -234,7 +230,7 @@ initializeunit(struct unittype * theunit
 }
 
 
-int 
+static int 
 addsubunit(char *product[], char *toadd)
 {
 	char **ptr;
@@ -251,7 +247,7 @@ addsubunit(char *product[], char *toadd)
 }
 
 
-void 
+static void 
 showunit(struct unittype * theunit)
 {
 	char **ptr;
@@ -313,7 +309,7 @@ zeroerror(void)
    Returns 0 for successful addition, nonzero on error.
 */
 
-int 
+static int 
 addunit(struct unittype * theunit, const char *toadd, int flip, int quantity)
 {
 	char *scratch, *savescr;
@@ -421,14 +417,14 @@ addunit(struct unittype * theunit, const
 }
 
 
-int 
+static int 
 compare(const void *item1, const void *item2)
 {
 	return strcmp(*(const char * const *)item1, *(const char * const *)item2);
 }
 
 
-void 
+static void 
 sortunit(struct unittype * theunit)
 {
 	char **ptr;
@@ -549,7 +545,7 @@ lookupunit(const char *unit)
 
 #define ERROR 4
 
-int 
+static int 
 reduceproduct(struct unittype * theunit, int flip)
 {
 
@@ -592,7 +588,7 @@ reduceproduct(struct unittype * theunit,
    Returns 0 on success, or 1 on unknown unit error.
 */
 
-int 
+static int 
 reduceunit(struct unittype * theunit)
 {
 	int ret;
@@ -607,7 +603,7 @@ reduceunit(struct unittype * theunit)
 }
 
 
-int 
+static int 
 compareproducts(char **one, char **two)
 {
 	while (*one || *two) {
@@ -630,7 +626,7 @@ compareproducts(char **one, char **two)
 
 /* Return zero if units are compatible, nonzero otherwise */
 
-int 
+static int 
 compareunits(struct unittype * first, struct unittype * second)
 {
 	return
@@ -639,7 +635,7 @@ compareunits(struct unittype * first, st
 }
 
 
-int 
+static int 
 completereduce(struct unittype * unit)
 {
 	if (reduceunit(unit))
@@ -649,7 +645,7 @@ completereduce(struct unittype * unit)
 	return 0;
 }
 
-void 
+static void 
 showanswer(struct unittype * have, struct unittype * want)
 {
 	double ans;

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 04:10:25 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B311E668;
 Sat,  5 Jul 2014 04:10:25 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9406F21FE;
 Sat,  5 Jul 2014 04:10:25 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s654APMH087793;
 Sat, 5 Jul 2014 04:10:25 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s654AP4D087788;
 Sat, 5 Jul 2014 04:10:25 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407050410.s654AP4D087788@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 5 Jul 2014 04:10:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268283 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 04:10:25 -0000

Author: mav
Date: Sat Jul  5 04:10:24 2014
New Revision: 268283
URL: http://svnweb.freebsd.org/changeset/base/268283

Log:
  Improve readability of XML generated by CTL_LUN_LIST.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_backend_block.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sat Jul  5 03:49:20 2014	(r268282)
+++ head/sys/cam/ctl/ctl.c	Sat Jul  5 04:10:24 2014	(r268283)
@@ -3007,7 +3007,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 			if (retval != 0)
 				break;
 
-			retval = sbuf_printf(sb, "%s"
+			retval = sbuf_printf(sb, "\t%s"
 					     "\n",
 					     (lun->backend == NULL) ?  "none" :
 					     lun->backend->name);
@@ -3015,7 +3015,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 			if (retval != 0)
 				break;
 
-			retval = sbuf_printf(sb, "%d\n",
+			retval = sbuf_printf(sb, "\t%d\n",
 					     lun->be_lun->lun_type);
 
 			if (retval != 0)
@@ -3028,20 +3028,20 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 				continue;
 			}
 
-			retval = sbuf_printf(sb, "%ju\n",
+			retval = sbuf_printf(sb, "\t%ju\n",
 					     (lun->be_lun->maxlba > 0) ?
 					     lun->be_lun->maxlba + 1 : 0);
 
 			if (retval != 0)
 				break;
 
-			retval = sbuf_printf(sb, "%u\n",
+			retval = sbuf_printf(sb, "\t%u\n",
 					     lun->be_lun->blocksize);
 
 			if (retval != 0)
 				break;
 
-			retval = sbuf_printf(sb, "");
+			retval = sbuf_printf(sb, "\t");
 
 			if (retval != 0)
 				break;
@@ -3057,7 +3057,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 			if (retval != 0)
 				break;
 
-			retval = sbuf_printf(sb, "");
+			retval = sbuf_printf(sb, "\t");
 
 			if (retval != 0)
 				break;
@@ -3078,7 +3078,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 					break;
 			}
 			STAILQ_FOREACH(opt, &lun->be_lun->options, links) {
-				retval = sbuf_printf(sb, "<%s>%s", opt->name, opt->value, opt->name);
+				retval = sbuf_printf(sb, "\t<%s>%s\n",
+				    opt->name, opt->value, opt->name);
 				if (retval != 0)
 					break;
 			}

Modified: head/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_block.c	Sat Jul  5 03:49:20 2014	(r268282)
+++ head/sys/cam/ctl/ctl_backend_block.c	Sat Jul  5 04:10:24 2014	(r268283)
@@ -2509,7 +2509,7 @@ ctl_be_block_lun_info(void *be_lun, stru
 	lun = (struct ctl_be_block_lun *)be_lun;
 	retval = 0;
 
-	retval = sbuf_printf(sb, "");
+	retval = sbuf_printf(sb, "\t");
 
 	if (retval != 0)
 		goto bailout;
@@ -2519,7 +2519,7 @@ ctl_be_block_lun_info(void *be_lun, stru
 	if (retval != 0)
 		goto bailout;
 
-	retval = sbuf_printf(sb, "");
+	retval = sbuf_printf(sb, "\n");
 
 bailout:
 

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 05:44:27 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 183E95B0;
 Sat,  5 Jul 2014 05:44:27 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 047C1287C;
 Sat,  5 Jul 2014 05:44:27 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s655iQpH031859;
 Sat, 5 Jul 2014 05:44:26 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s655iQ79031856;
 Sat, 5 Jul 2014 05:44:26 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407050544.s655iQ79031856@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 5 Jul 2014 05:44:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268284 - in head: sys/cam/ctl usr.sbin/ctladm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 05:44:27 -0000

Author: mav
Date: Sat Jul  5 05:44:26 2014
New Revision: 268284
URL: http://svnweb.freebsd.org/changeset/base/268284

Log:
  Introduce new IOCTL CTL_PORT_LIST reporting in more flexible XML format.
  
  Leave old CTL_GET_PORT_LIST in place so far.  Garbage-collect it later.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_ioctl.h
  head/usr.sbin/ctladm/ctladm.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sat Jul  5 04:10:24 2014	(r268283)
+++ head/sys/cam/ctl/ctl.c	Sat Jul  5 05:44:26 2014	(r268284)
@@ -3138,6 +3138,104 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 		retval = fe->ioctl(dev, cmd, addr, flag, td);
 		break;
 	}
+	case CTL_PORT_LIST: {
+		struct sbuf *sb;
+		struct ctl_port *port;
+		struct ctl_lun_list *list;
+//		struct ctl_option *opt;
+
+		list = (struct ctl_lun_list *)addr;
+
+		sb = sbuf_new(NULL, NULL, list->alloc_len, SBUF_FIXEDLEN);
+		if (sb == NULL) {
+			list->status = CTL_LUN_LIST_ERROR;
+			snprintf(list->error_str, sizeof(list->error_str),
+				 "Unable to allocate %d bytes for LUN list",
+				 list->alloc_len);
+			break;
+		}
+
+		sbuf_printf(sb, "\n");
+
+		mtx_lock(&softc->ctl_lock);
+		STAILQ_FOREACH(port, &softc->port_list, links) {
+			retval = sbuf_printf(sb, "\n",
+					     (uintmax_t)port->targ_port);
+
+			/*
+			 * Bail out as soon as we see that we've overfilled
+			 * the buffer.
+			 */
+			if (retval != 0)
+				break;
+
+			retval = sbuf_printf(sb, "\t%s"
+			    "\n", port->frontend->name);
+			if (retval != 0)
+				break;
+
+			retval = sbuf_printf(sb, "\t%d\n",
+					     port->port_type);
+			if (retval != 0)
+				break;
+
+			retval = sbuf_printf(sb, "\t%s\n",
+			    (port->status & CTL_PORT_STATUS_ONLINE) ? "YES" : "NO");
+			if (retval != 0)
+				break;
+
+			retval = sbuf_printf(sb, "\t%s\n",
+			    port->port_name);
+			if (retval != 0)
+				break;
+
+			retval = sbuf_printf(sb, "\t%d\n",
+			    port->physical_port);
+			if (retval != 0)
+				break;
+
+			retval = sbuf_printf(sb, "\t%d\n",
+			    port->virtual_port);
+			if (retval != 0)
+				break;
+
+			retval = sbuf_printf(sb, "\t%#jx\n",
+			    (uintmax_t)port->wwnn);
+			if (retval != 0)
+				break;
+
+			retval = sbuf_printf(sb, "\t%#jx\n",
+			    (uintmax_t)port->wwpn);
+			if (retval != 0)
+				break;
+
+			retval = sbuf_printf(sb, "\n");
+			if (retval != 0)
+				break;
+		}
+		mtx_unlock(&softc->ctl_lock);
+
+		if ((retval != 0)
+		 || ((retval = sbuf_printf(sb, "\n")) != 0)) {
+			retval = 0;
+			sbuf_delete(sb);
+			list->status = CTL_LUN_LIST_NEED_MORE_SPACE;
+			snprintf(list->error_str, sizeof(list->error_str),
+				 "Out of space, %d bytes is too small",
+				 list->alloc_len);
+			break;
+		}
+
+		sbuf_finish(sb);
+
+		retval = copyout(sbuf_data(sb), list->lun_xml,
+				 sbuf_len(sb) + 1);
+
+		list->fill_len = sbuf_len(sb) + 1;
+		list->status = CTL_LUN_LIST_OK;
+		sbuf_delete(sb);
+		break;
+	}
 	default: {
 		/* XXX KDM should we fix this? */
 #if 0

Modified: head/sys/cam/ctl/ctl_ioctl.h
==============================================================================
--- head/sys/cam/ctl/ctl_ioctl.h	Sat Jul  5 04:10:24 2014	(r268283)
+++ head/sys/cam/ctl/ctl_ioctl.h	Sat Jul  5 05:44:26 2014	(r268284)
@@ -789,6 +789,7 @@ struct ctl_iscsi {
 #define	CTL_ERROR_INJECT_DELETE	_IOW(CTL_MINOR, 0x23, struct ctl_error_desc)
 #define	CTL_SET_PORT_WWNS	_IOW(CTL_MINOR, 0x24, struct ctl_port_entry)
 #define	CTL_ISCSI		_IOWR(CTL_MINOR, 0x25, struct ctl_iscsi)
+#define	CTL_PORT_LIST		_IOWR(CTL_MINOR, 0x26, struct ctl_lun_list)
 
 #endif /* _CTL_IOCTL_H_ */
 

Modified: head/usr.sbin/ctladm/ctladm.c
==============================================================================
--- head/usr.sbin/ctladm/ctladm.c	Sat Jul  5 04:10:24 2014	(r268283)
+++ head/usr.sbin/ctladm/ctladm.c	Sat Jul  5 05:44:26 2014	(r268284)
@@ -95,6 +95,7 @@ typedef enum {
 	CTLADM_CMD_READ,
 	CTLADM_CMD_WRITE,
 	CTLADM_CMD_PORT,
+	CTLADM_CMD_PORTLIST,
 	CTLADM_CMD_READCAPACITY,
 	CTLADM_CMD_MODESENSE,
 	CTLADM_CMD_DUMPOOA,
@@ -190,6 +191,7 @@ static struct ctladm_opts option_table[]
 	{"modesense", CTLADM_CMD_MODESENSE, CTLADM_ARG_NEED_TL, "P:S:dlm:c:"},
 	{"modify", CTLADM_CMD_MODIFY, CTLADM_ARG_NONE, "b:l:s:"},
 	{"port", CTLADM_CMD_PORT, CTLADM_ARG_NONE, "lo:p:qt:w:W:x"},
+	{"portlist", CTLADM_CMD_PORTLIST, CTLADM_ARG_NONE, "f:vx"},
 	{"prin", CTLADM_CMD_PRES_IN, CTLADM_ARG_NEED_TL, "a:"},
 	{"prout", CTLADM_CMD_PRES_OUT, CTLADM_ARG_NEED_TL, "a:k:r:s:"},
 	{"read", CTLADM_CMD_READ, CTLADM_ARG_NEED_TL, rw_opts},
@@ -4073,6 +4075,269 @@ bailout:
 	return (retval);
 }
 
+/*
+ * Port information.
+ */
+struct cctl_port {
+	uint64_t port_id;
+	char *online;
+	char *frontend_type;
+	char *name;
+	int pp, vp;
+	char *wwnn, *wwpn;
+	STAILQ_HEAD(,cctl_lun_nv) attr_list;
+	STAILQ_ENTRY(cctl_port) links;
+};
+
+struct cctl_portlist_data {
+	int num_ports;
+	STAILQ_HEAD(,cctl_port) port_list;
+	struct cctl_port *cur_port;
+	int level;
+	struct sbuf *cur_sb[32];
+};
+
+static void
+cctl_start_pelement(void *user_data, const char *name, const char **attr)
+{
+	int i;
+	struct cctl_portlist_data *portlist;
+	struct cctl_port *cur_port;
+
+	portlist = (struct cctl_portlist_data *)user_data;
+	cur_port = portlist->cur_port;
+	portlist->level++;
+	if ((u_int)portlist->level >= (sizeof(portlist->cur_sb) /
+	    sizeof(portlist->cur_sb[0])))
+		errx(1, "%s: too many nesting levels, %zd max", __func__,
+		     sizeof(portlist->cur_sb) / sizeof(portlist->cur_sb[0]));
+
+	portlist->cur_sb[portlist->level] = sbuf_new_auto();
+	if (portlist->cur_sb[portlist->level] == NULL)
+		err(1, "%s: Unable to allocate sbuf", __func__);
+
+	if (strcmp(name, "targ_port") == 0) {
+		if (cur_port != NULL)
+			errx(1, "%s: improper port element nesting", __func__);
+
+		cur_port = calloc(1, sizeof(*cur_port));
+		if (cur_port == NULL)
+			err(1, "%s: cannot allocate %zd bytes", __func__,
+			    sizeof(*cur_port));
+
+		portlist->num_ports++;
+		portlist->cur_port = cur_port;
+
+		STAILQ_INIT(&cur_port->attr_list);
+		STAILQ_INSERT_TAIL(&portlist->port_list, cur_port, links);
+
+		for (i = 0; attr[i] != NULL; i += 2) {
+			if (strcmp(attr[i], "id") == 0) {
+				cur_port->port_id = strtoull(attr[i+1], NULL, 0);
+			} else {
+				errx(1, "%s: invalid LUN attribute %s = %s",
+				     __func__, attr[i], attr[i+1]);
+			}
+		}
+	}
+}
+
+static void
+cctl_end_pelement(void *user_data, const char *name)
+{
+	struct cctl_portlist_data *portlist;
+	struct cctl_port *cur_port;
+	char *str;
+
+	portlist = (struct cctl_portlist_data *)user_data;
+	cur_port = portlist->cur_port;
+
+	if ((cur_port == NULL)
+	 && (strcmp(name, "ctlportlist") != 0))
+		errx(1, "%s: cur_port == NULL! (name = %s)", __func__, name);
+
+	if (portlist->cur_sb[portlist->level] == NULL)
+		errx(1, "%s: no valid sbuf at level %d (name %s)", __func__,
+		     portlist->level, name);
+
+	if (sbuf_finish(portlist->cur_sb[portlist->level]) != 0)
+		err(1, "%s: sbuf_finish", __func__);
+	str = strdup(sbuf_data(portlist->cur_sb[portlist->level]));
+	if (str == NULL)
+		err(1, "%s can't allocate %zd bytes for string", __func__,
+		    sbuf_len(portlist->cur_sb[portlist->level]));
+
+	if (strlen(str) == 0) {
+		free(str);
+		str = NULL;
+	}
+
+	sbuf_delete(portlist->cur_sb[portlist->level]);
+	portlist->cur_sb[portlist->level] = NULL;
+	portlist->level--;
+
+	if (strcmp(name, "frontend_type") == 0) {
+		cur_port->frontend_type = str;
+		str = NULL;
+	} else if (strcmp(name, "port_name") == 0) {
+		cur_port->name = str;
+		str = NULL;
+	} else if (strcmp(name, "online") == 0) {
+		cur_port->online = str;
+		str = NULL;
+	} else if (strcmp(name, "physical_port") == 0) {
+		cur_port->pp = strtoull(str, NULL, 0);
+	} else if (strcmp(name, "virtual_port") == 0) {
+		cur_port->pp = strtoull(str, NULL, 0);
+	} else if (strcmp(name, "wwnn") == 0) {
+		cur_port->wwnn = str;
+		str = NULL;
+	} else if (strcmp(name, "wwpn") == 0) {
+		cur_port->wwpn = str;
+		str = NULL;
+	} else if (strcmp(name, "targ_port") == 0) {
+		portlist->cur_port = NULL;
+	} else if (strcmp(name, "ctlportlist") == 0) {
+		
+	} else {
+		struct cctl_lun_nv *nv;
+
+		nv = calloc(1, sizeof(*nv));
+		if (nv == NULL)
+			err(1, "%s: can't allocate %zd bytes for nv pair",
+			    __func__, sizeof(*nv));
+
+		nv->name = strdup(name);
+		if (nv->name == NULL)
+			err(1, "%s: can't allocated %zd bytes for string",
+			    __func__, strlen(name));
+
+		nv->value = str;
+		str = NULL;
+		STAILQ_INSERT_TAIL(&cur_port->attr_list, nv, links);
+	}
+
+	free(str);
+}
+
+static void
+cctl_char_phandler(void *user_data, const XML_Char *str, int len)
+{
+	struct cctl_portlist_data *portlist;
+
+	portlist = (struct cctl_portlist_data *)user_data;
+
+	sbuf_bcat(portlist->cur_sb[portlist->level], str, len);
+}
+
+static int
+cctl_portlist(int fd, int argc, char **argv, char *combinedopt)
+{
+	struct ctl_lun_list list;
+	struct cctl_portlist_data portlist;
+	struct cctl_port *port;
+	XML_Parser parser;
+	char *port_str;
+	int port_len;
+	int dump_xml = 0;
+	int retval, c;
+	char *frontend = NULL;
+	int verbose = 0;
+
+	retval = 0;
+	port_len = 4096;
+
+	bzero(&portlist, sizeof(portlist));
+	STAILQ_INIT(&portlist.port_list);
+
+	while ((c = getopt(argc, argv, combinedopt)) != -1) {
+		switch (c) {
+		case 'f':
+			frontend = strdup(optarg);
+			break;
+		case 'v':
+			verbose++;
+			break;
+		case 'x':
+			dump_xml = 1;
+			break;
+		default:
+			break;
+		}
+	}
+
+retry:
+	port_str = malloc(port_len);
+
+	bzero(&list, sizeof(list));
+	list.alloc_len = port_len;
+	list.status = CTL_LUN_LIST_NONE;
+	list.lun_xml = port_str;
+
+	if (ioctl(fd, CTL_PORT_LIST, &list) == -1) {
+		warn("%s: error issuing CTL_PORT_LIST ioctl", __func__);
+		retval = 1;
+		goto bailout;
+	}
+
+	if (list.status == CTL_LUN_LIST_ERROR) {
+		warnx("%s: error returned from CTL_PORT_LIST ioctl:\n%s",
+		      __func__, list.error_str);
+	} else if (list.status == CTL_LUN_LIST_NEED_MORE_SPACE) {
+		port_len = port_len << 1;
+		goto retry;
+	}
+
+	if (dump_xml != 0) {
+		printf("%s", port_str);
+		goto bailout;
+	}
+
+	parser = XML_ParserCreate(NULL);
+	if (parser == NULL) {
+		warn("%s: Unable to create XML parser", __func__);
+		retval = 1;
+		goto bailout;
+	}
+
+	XML_SetUserData(parser, &portlist);
+	XML_SetElementHandler(parser, cctl_start_pelement, cctl_end_pelement);
+	XML_SetCharacterDataHandler(parser, cctl_char_phandler);
+
+	retval = XML_Parse(parser, port_str, strlen(port_str), 1);
+	XML_ParserFree(parser);
+	if (retval != 1) {
+		retval = 1;
+		goto bailout;
+	}
+
+	printf("Port Online Frontend %-12s pp vp %-18s %-18s\n",
+	    "Name", "WWNN", "WWPN");
+	STAILQ_FOREACH(port, &portlist.port_list, links) {
+		struct cctl_lun_nv *nv;
+
+		if ((frontend != NULL)
+		 && (strcmp(port->frontend_type, frontend) != 0))
+			continue;
+
+		printf("%-4ju %-6s %-8s %-12s %-2d %-2d %-18s %-18s\n",
+		    (uintmax_t)port->port_id, port->online,
+		    port->frontend_type, port->name, port->pp, port->vp,
+		    port->wwnn, port->wwpn);
+
+		if (verbose == 0)
+			continue;
+
+		STAILQ_FOREACH(nv, &port->attr_list, links) {
+			printf("      %s=%s\n", nv->name, nv->value);
+		}
+	}
+bailout:
+	free(port_str);
+
+	return (retval);
+}
+
 void
 usage(int error)
 {
@@ -4104,7 +4369,7 @@ usage(int error)
 "                            [-S serial_num] [-t dev_type]\n"
 "         ctladm remove      <-b backend> <-l lun_id> [-o name=value]\n"
 "         ctladm modify      <-b backend> <-l lun_id> <-s size_bytes>\n"
-"         ctladm devlist     [-b][-v][-x]\n"
+"         ctladm devlist     [-b backend] [-v] [-x]\n"
 "         ctladm shutdown\n"
 "         ctladm startup\n"
 "         ctladm hardstop\n"
@@ -4120,6 +4385,7 @@ usage(int error)
 "                            [-s len fmt [args]] [-c] [-d delete_id]\n"
 "         ctladm port        <-l | -o  | [-w wwnn][-W wwpn]>\n"
 "                            [-p targ_port] [-t port_type] [-q] [-x]\n"
+"         ctladm portlist    [-f frontend] [-v] [-x]\n"
 "         ctladm islist      [-v | -x]\n"
 "         ctladm islogout    <-a | -c connection-id | -i name | -p portal>\n"
 "         ctladm isterminate <-a | -c connection-id | -i name | -p portal>\n"
@@ -4429,6 +4695,9 @@ main(int argc, char **argv)
 	case CTLADM_CMD_PORT:
 		retval = cctl_port(fd, argc, argv, combinedopt);
 		break;
+	case CTLADM_CMD_PORTLIST:
+		retval = cctl_portlist(fd, argc, argv, combinedopt);
+		break;
 	case CTLADM_CMD_READCAPACITY:
 		retval = cctl_read_capacity(fd, target, lun, initid, retries,
 					    argc, argv, combinedopt);

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 06:12:50 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 35063946;
 Sat,  5 Jul 2014 06:12:50 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 087372A7E;
 Sat,  5 Jul 2014 06:12:50 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s656Cnfw045497;
 Sat, 5 Jul 2014 06:12:49 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s656CnwY045496;
 Sat, 5 Jul 2014 06:12:49 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201407050612.s656CnwY045496@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Sat, 5 Jul 2014 06:12:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268285 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 06:12:50 -0000

Author: hselasky
Date: Sat Jul  5 06:12:48 2014
New Revision: 268285
URL: http://svnweb.freebsd.org/changeset/base/268285

Log:
  When getting the initial value of numeric tunables use the
  getenv_xxx() functions instead of strtoq(), because the getenv_xxx()
  functions include wrappers for various postfixes like G/M/K, which
  strtoq() doesn't do.

Modified:
  head/sys/kern/kern_sysctl.c

Modified: head/sys/kern/kern_sysctl.c
==============================================================================
--- head/sys/kern/kern_sysctl.c	Sat Jul  5 05:44:26 2014	(r268284)
+++ head/sys/kern/kern_sysctl.c	Sat Jul  5 06:12:48 2014	(r268285)
@@ -167,13 +167,14 @@ sysctl_load_tunable_by_oid_locked(struct
 {
 	struct sysctl_req req;
 	struct sysctl_oid *curr;
-	char *penv;
+	char *penv = NULL;
 	char path[64];
 	ssize_t rem = sizeof(path);
 	ssize_t len;
 	int val_int;
 	long val_long;
 	int64_t val_64;
+	quad_t val_quad;
 	int error;
 
 	path[--rem] = 0;
@@ -192,10 +193,6 @@ sysctl_load_tunable_by_oid_locked(struct
 			path[rem + len] = '.';
 	}
 
-	penv = getenv(path + rem);
-	if (penv == NULL)
-		return;
-
 	memset(&req, 0, sizeof(req));
 
 	req.td = curthread;
@@ -205,41 +202,52 @@ sysctl_load_tunable_by_oid_locked(struct
 
 	switch (oidp->oid_kind & CTLTYPE) {
 	case CTLTYPE_INT:
-		val_int = strtoq(penv, NULL, 0);
+		if (getenv_int(path + rem, &val_int) == 0)
+			return;
 		req.newlen = sizeof(val_int);
 		req.newptr = &val_int;
 		break;
 	case CTLTYPE_UINT:
-		val_int = strtouq(penv, NULL, 0);
+		if (getenv_uint(path + rem, (unsigned int *)&val_int) == 0)
+			return;
 		req.newlen = sizeof(val_int);
 		req.newptr = &val_int;
 		break;
 	case CTLTYPE_LONG:
-		val_long = strtoq(penv, NULL, 0);
+		if (getenv_long(path + rem, &val_long) == 0)
+			return;
 		req.newlen = sizeof(val_long);
 		req.newptr = &val_long;
 		break;
 	case CTLTYPE_ULONG:
-		val_long = strtouq(penv, NULL, 0);
+		if (getenv_ulong(path + rem, (unsigned long *)&val_long) == 0)
+			return;
 		req.newlen = sizeof(val_long);
 		req.newptr = &val_long;
 		break;
 	case CTLTYPE_S64:
-		val_64 = strtoq(penv, NULL, 0);
+		if (getenv_quad(path + rem, &val_quad) == 0)
+			return;
+		val_64 = val_quad;
 		req.newlen = sizeof(val_64);
 		req.newptr = &val_64;
 		break;
 	case CTLTYPE_U64:
-		val_64 = strtouq(penv, NULL, 0);
+		/* XXX there is no getenv_uquad() */
+		if (getenv_quad(path + rem, &val_quad) == 0)
+			return;
+		val_64 = val_quad;
 		req.newlen = sizeof(val_64);
 		req.newptr = &val_64;
 		break;
 	case CTLTYPE_STRING:
+		penv = getenv(path + rem);
+		if (penv == NULL)
+			return;
 		req.newlen = strlen(penv);
 		req.newptr = penv;
 		break;
 	default:
-		freeenv(penv);
 		return;
 	}
 	error = sysctl_root_handler_locked(oidp, oidp->oid_arg1,

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 07:15:20 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E0C24287;
 Sat,  5 Jul 2014 07:15:20 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B4B5C2E5E;
 Sat,  5 Jul 2014 07:15:20 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s657FK7g073579;
 Sat, 5 Jul 2014 07:15:20 GMT (envelope-from cy@svn.freebsd.org)
Received: (from cy@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s657FJEJ073575;
 Sat, 5 Jul 2014 07:15:19 GMT (envelope-from cy@svn.freebsd.org)
Message-Id: <201407050715.s657FJEJ073575@svn.freebsd.org>
From: Cy Schubert 
Date: Sat, 5 Jul 2014 07:15:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268286 - head/contrib/ipfilter/lib
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 07:15:21 -0000

Author: cy
Date: Sat Jul  5 07:15:19 2014
New Revision: 268286
URL: http://svnweb.freebsd.org/changeset/base/268286

Log:
  Fix compile-time errors when NO_WERROR and WITHOUT_INET6_SUPPORT
  (NO_INET6) are specified.
  
  Approved by:	glebius
  MFC after:	1 week

Modified:
  head/contrib/ipfilter/lib/printhost.c
  head/contrib/ipfilter/lib/printhostmask.c
  head/contrib/ipfilter/lib/save_v1trap.c
  head/contrib/ipfilter/lib/save_v2trap.c

Modified: head/contrib/ipfilter/lib/printhost.c
==============================================================================
--- head/contrib/ipfilter/lib/printhost.c	Sat Jul  5 06:12:48 2014	(r268285)
+++ head/contrib/ipfilter/lib/printhost.c	Sat Jul  5 07:15:19 2014	(r268286)
@@ -23,9 +23,9 @@ printhost(family, addr)
 	if ((family == -1) || !*addr)
 		PRINTF("any");
 	else {
+#ifdef  USE_INET6
 		void *ptr = addr;
 
-#ifdef  USE_INET6
 		PRINTF("%s", inet_ntop(family, ptr, ipbuf, sizeof(ipbuf)));
 #else
 		ipa.s_addr = *addr;

Modified: head/contrib/ipfilter/lib/printhostmask.c
==============================================================================
--- head/contrib/ipfilter/lib/printhostmask.c	Sat Jul  5 06:12:48 2014	(r268285)
+++ head/contrib/ipfilter/lib/printhostmask.c	Sat Jul  5 07:15:19 2014	(r268286)
@@ -25,9 +25,9 @@ printhostmask(family, addr, mask)
 	if ((family == -1) || ((!addr || !*addr) && (!mask || !*mask)))
 		PRINTF("any");
 	else {
+#ifdef  USE_INET6
 		void *ptr = addr;
 
-#ifdef  USE_INET6
 		PRINTF("%s", inet_ntop(family, ptr, ipbuf, sizeof(ipbuf)));
 #else
 		ipa.s_addr = *addr;

Modified: head/contrib/ipfilter/lib/save_v1trap.c
==============================================================================
--- head/contrib/ipfilter/lib/save_v1trap.c	Sat Jul  5 06:12:48 2014	(r268285)
+++ head/contrib/ipfilter/lib/save_v1trap.c	Sat Jul  5 07:15:19 2014	(r268286)
@@ -178,7 +178,7 @@ snmpv1_parse(char **strings)
 		if (ctx->fd >= 0) {
 			ctx->sin.sin_family = AF_INET;
 			ctx->sin.sin_port = htons(162);
-			if (connect(ctx->fd, &ctx->sin,
+			if (connect(ctx->fd, (struct sockaddr *)&ctx->sin,
 				    sizeof(ctx->sin)) != 0) {
 					snmpv1_destroy(ctx);
 					return NULL;

Modified: head/contrib/ipfilter/lib/save_v2trap.c
==============================================================================
--- head/contrib/ipfilter/lib/save_v2trap.c	Sat Jul  5 06:12:48 2014	(r268285)
+++ head/contrib/ipfilter/lib/save_v2trap.c	Sat Jul  5 07:15:19 2014	(r268286)
@@ -181,7 +181,7 @@ snmpv2_parse(char **strings)
 		if (ctx->fd >= 0) {
 			ctx->sin.sin_family = AF_INET;
 			ctx->sin.sin_port = htons(162);
-			if (connect(ctx->fd, &ctx->sin,
+			if (connect(ctx->fd, (struct sockaddr *)&ctx->sin,
 				    sizeof(ctx->sin)) != 0) {
 					snmpv2_destroy(ctx);
 					return NULL;

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 13:50:06 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8E3C548D;
 Sat,  5 Jul 2014 13:50:06 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6199B2BB4;
 Sat,  5 Jul 2014 13:50:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s65Do6Tc056759;
 Sat, 5 Jul 2014 13:50:06 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s65Do5pL056753;
 Sat, 5 Jul 2014 13:50:05 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407051350.s65Do5pL056753@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 5 Jul 2014 13:50:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268287 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 13:50:06 -0000

Author: mav
Date: Sat Jul  5 13:50:05 2014
New Revision: 268287
URL: http://svnweb.freebsd.org/changeset/base/268287

Log:
  Implement and use ctl_frontend_find().

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_frontend.c
  head/sys/cam/ctl/ctl_frontend.h

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sat Jul  5 07:15:19 2014	(r268286)
+++ head/sys/cam/ctl/ctl.c	Sat Jul  5 13:50:05 2014	(r268287)
@@ -3121,13 +3121,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 
 		ci = (struct ctl_iscsi *)addr;
 
-		mtx_lock(&softc->ctl_lock);
-		STAILQ_FOREACH(fe, &softc->fe_list, links) {
-			if (strcmp(fe->name, "iscsi") == 0)
-				break;
-		}
-		mtx_unlock(&softc->ctl_lock);
-
+		fe = ctl_frontend_find("iscsi");
 		if (fe == NULL) {
 			ci->status = CTL_ISCSI_ERROR;
 			snprintf(ci->error_str, sizeof(ci->error_str),

Modified: head/sys/cam/ctl/ctl_frontend.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend.c	Sat Jul  5 07:15:19 2014	(r268286)
+++ head/sys/cam/ctl/ctl_frontend.c	Sat Jul  5 13:50:05 2014	(r268287)
@@ -118,6 +118,23 @@ ctl_frontend_deregister(struct ctl_front
 	return (0);
 }
 
+struct ctl_frontend *
+ctl_frontend_find(char *frontend_name)
+{
+	struct ctl_softc *ctl_softc = control_softc;
+	struct ctl_frontend *fe;
+
+	mtx_lock(&ctl_softc->ctl_lock);
+	STAILQ_FOREACH(fe, &ctl_softc->fe_list, links) {
+		if (strcmp(fe->name, frontend_name) == 0) {
+			mtx_unlock(&ctl_softc->ctl_lock);
+			return (fe);
+		}
+	}
+	mtx_unlock(&ctl_softc->ctl_lock);
+	return (NULL);
+}
+
 int
 ctl_port_register(struct ctl_port *port, int master_shelf)
 {

Modified: head/sys/cam/ctl/ctl_frontend.h
==============================================================================
--- head/sys/cam/ctl/ctl_frontend.h	Sat Jul  5 07:15:19 2014	(r268286)
+++ head/sys/cam/ctl/ctl_frontend.h	Sat Jul  5 13:50:05 2014	(r268287)
@@ -259,6 +259,11 @@ int ctl_frontend_register(struct ctl_fro
 int ctl_frontend_deregister(struct ctl_frontend *fe);
 
 /*
+ * Find the frontend by its name. Returns NULL if not found.
+ */
+struct ctl_frontend * ctl_frontend_find(char *frontend_name);
+
+/*
  * This may block until resources are allocated.  Called at FETD module load
  * time. Returns 0 for success, non-zero for failure.
  */

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 14:32:43 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9108E52B;
 Sat,  5 Jul 2014 14:32:43 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7DBD72F48;
 Sat,  5 Jul 2014 14:32:43 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s65EWh0k079944;
 Sat, 5 Jul 2014 14:32:43 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s65EWho7079942;
 Sat, 5 Jul 2014 14:32:43 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407051432.s65EWho7079942@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 5 Jul 2014 14:32:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268288 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 14:32:43 -0000

Author: mav
Date: Sat Jul  5 14:32:42 2014
New Revision: 268288
URL: http://svnweb.freebsd.org/changeset/base/268288

Log:
  Improve CTL_BEARG_* flags support, including optional values copyout.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_backend.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sat Jul  5 13:50:05 2014	(r268287)
+++ head/sys/cam/ctl/ctl.c	Sat Jul  5 14:32:42 2014	(r268288)
@@ -2013,40 +2013,40 @@ ctl_copyin_alloc(void *user_addr, int le
 }
 
 static void
-ctl_free_args(int num_be_args, struct ctl_be_arg *be_args)
+ctl_free_args(int num_args, struct ctl_be_arg *args)
 {
 	int i;
 
-	if (be_args == NULL)
+	if (args == NULL)
 		return;
 
-	for (i = 0; i < num_be_args; i++) {
-		free(be_args[i].kname, M_CTL);
-		free(be_args[i].kvalue, M_CTL);
+	for (i = 0; i < num_args; i++) {
+		free(args[i].kname, M_CTL);
+		free(args[i].kvalue, M_CTL);
 	}
 
-	free(be_args, M_CTL);
+	free(args, M_CTL);
 }
 
 static struct ctl_be_arg *
-ctl_copyin_args(int num_be_args, struct ctl_be_arg *be_args,
+ctl_copyin_args(int num_args, struct ctl_be_arg *uargs,
 		char *error_str, size_t error_str_len)
 {
 	struct ctl_be_arg *args;
 	int i;
 
-	args = ctl_copyin_alloc(be_args, num_be_args * sizeof(*be_args),
+	args = ctl_copyin_alloc(uargs, num_args * sizeof(*args),
 				error_str, error_str_len);
 
 	if (args == NULL)
 		goto bailout;
 
-	for (i = 0; i < num_be_args; i++) {
+	for (i = 0; i < num_args; i++) {
 		args[i].kname = NULL;
 		args[i].kvalue = NULL;
 	}
 
-	for (i = 0; i < num_be_args; i++) {
+	for (i = 0; i < num_args; i++) {
 		uint8_t *tmpptr;
 
 		args[i].kname = ctl_copyin_alloc(args[i].name,
@@ -2060,31 +2060,43 @@ ctl_copyin_args(int num_be_args, struct 
 			goto bailout;
 		}
 
-		args[i].kvalue = NULL;
-
-		tmpptr = ctl_copyin_alloc(args[i].value,
-			args[i].vallen, error_str, error_str_len);
-		if (tmpptr == NULL)
-			goto bailout;
-
-		args[i].kvalue = tmpptr;
-
-		if ((args[i].flags & CTL_BEARG_ASCII)
-		 && (tmpptr[args[i].vallen - 1] != '\0')) {
-			snprintf(error_str, error_str_len, "Argument %d "
-				 "value is not NUL-terminated", i);
-			goto bailout;
+		if (args[i].flags & CTL_BEARG_RD) {
+			tmpptr = ctl_copyin_alloc(args[i].value,
+				args[i].vallen, error_str, error_str_len);
+			if (tmpptr == NULL)
+				goto bailout;
+			if ((args[i].flags & CTL_BEARG_ASCII)
+			 && (tmpptr[args[i].vallen - 1] != '\0')) {
+				snprintf(error_str, error_str_len, "Argument "
+				    "%d value is not NUL-terminated", i);
+				goto bailout;
+			}
+			args[i].kvalue = tmpptr;
+		} else {
+			args[i].kvalue = malloc(args[i].vallen,
+			    M_CTL, M_WAITOK | M_ZERO);
 		}
 	}
 
 	return (args);
 bailout:
 
-	ctl_free_args(num_be_args, args);
+	ctl_free_args(num_args, args);
 
 	return (NULL);
 }
 
+static void
+ctl_copyout_args(int num_args, struct ctl_be_arg *args)
+{
+	int i;
+
+	for (i = 0; i < num_args; i++) {
+		if (args[i].flags & CTL_BEARG_WR)
+			copyout(args[i].kvalue, args[i].value, args[i].vallen);
+	}
+}
+
 /*
  * Escape characters that are illegal or not recommended in XML.
  */
@@ -2945,6 +2957,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 		retval = backend->ioctl(dev, cmd, addr, flag, td);
 
 		if (lun_req->num_be_args > 0) {
+			ctl_copyout_args(lun_req->num_be_args,
+				      lun_req->kern_be_args);
 			ctl_free_args(lun_req->num_be_args,
 				      lun_req->kern_be_args);
 		}

Modified: head/sys/cam/ctl/ctl_backend.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend.c	Sat Jul  5 13:50:05 2014	(r268287)
+++ head/sys/cam/ctl/ctl_backend.c	Sat Jul  5 14:32:42 2014	(r268288)
@@ -181,6 +181,10 @@ ctl_init_opts(ctl_options_t *opts, int n
 
 	STAILQ_INIT(opts);
 	for (i = 0; i < num_args; i++) {
+		if ((args[i].flags & CTL_BEARG_RD) == 0)
+			continue;
+		if ((args[i].flags & CTL_BEARG_ASCII) == 0)
+			continue;
 		opt = malloc(sizeof(*opt), M_CTL, M_WAITOK);
 		opt->name = malloc(strlen(args[i].kname) + 1, M_CTL, M_WAITOK);
 		strcpy(opt->name, args[i].kname);

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 15:32:26 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 22264C8E;
 Sat,  5 Jul 2014 15:32:26 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0FCD6241A;
 Sat,  5 Jul 2014 15:32:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s65FWPi7009177;
 Sat, 5 Jul 2014 15:32:25 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s65FWP3w009176;
 Sat, 5 Jul 2014 15:32:25 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407051532.s65FWP3w009176@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 5 Jul 2014 15:32:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268289 - head/usr.sbin/ctladm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 15:32:26 -0000

Author: mav
Date: Sat Jul  5 15:32:25 2014
New Revision: 268289
URL: http://svnweb.freebsd.org/changeset/base/268289

Log:
  Fix minor copy-paste bug in r268284.

Modified:
  head/usr.sbin/ctladm/ctladm.c

Modified: head/usr.sbin/ctladm/ctladm.c
==============================================================================
--- head/usr.sbin/ctladm/ctladm.c	Sat Jul  5 14:32:42 2014	(r268288)
+++ head/usr.sbin/ctladm/ctladm.c	Sat Jul  5 15:32:25 2014	(r268289)
@@ -4188,7 +4188,7 @@ cctl_end_pelement(void *user_data, const
 	} else if (strcmp(name, "physical_port") == 0) {
 		cur_port->pp = strtoull(str, NULL, 0);
 	} else if (strcmp(name, "virtual_port") == 0) {
-		cur_port->pp = strtoull(str, NULL, 0);
+		cur_port->vp = strtoull(str, NULL, 0);
 	} else if (strcmp(name, "wwnn") == 0) {
 		cur_port->wwnn = str;
 		str = NULL;

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 15:36:17 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E18CBFF9;
 Sat,  5 Jul 2014 15:36:17 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C38472439;
 Sat,  5 Jul 2014 15:36:17 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s65FaHDj009877;
 Sat, 5 Jul 2014 15:36:17 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s65FaH0B009876;
 Sat, 5 Jul 2014 15:36:17 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201407051536.s65FaH0B009876@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Sat, 5 Jul 2014 15:36:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268290 -
 head/sys/cddl/contrib/opensolaris/uts/common/dtrace
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 15:36:18 -0000

Author: pfg
Date: Sat Jul  5 15:36:17 2014
New Revision: 268290
URL: http://svnweb.freebsd.org/changeset/base/268290

Log:
  Merge from OpenSolaris (24-Jul-2010):
  
  6679140 asymmetric alloc/dealloc activity can induce dynamic variable drops
  6679193 dtrace_dynvar walker produces flood of dtrace_dynhash_sink
  
  This finishes a set of merges from the older OpenSolaris releases.
  Still the FreeBSD port has many differences that are difficult to
  account for but that seems normal given that the kernels are different.
  
  MFC after:	1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Sat Jul  5 15:32:25 2014	(r268289)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c	Sat Jul  5 15:36:17 2014	(r268290)
@@ -22,7 +22,7 @@
  */
 
 /*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  * Copyright (c) 2012 by Delphix. All rights reserved.
  */
@@ -238,6 +238,7 @@ static dtrace_helpers_t *dtrace_deferred
 static dtrace_enabling_t *dtrace_retained;	/* list of retained enablings */
 static dtrace_genid_t	dtrace_retained_gen;	/* current retained enab gen */
 static dtrace_dynvar_t	dtrace_dynhash_sink;	/* end of dynamic hash chains */
+static int		dtrace_dynvar_failclean; /* dynvars failed to clean */
 #if !defined(sun)
 static struct mtx	dtrace_unr_mtx;
 MTX_SYSINIT(dtrace_unr_mtx, &dtrace_unr_mtx, "Unique resource identifier", MTX_DEF);
@@ -1558,12 +1559,12 @@ dtrace_dynvar_clean(dtrace_dstate_t *dst
 {
 	dtrace_dynvar_t *dirty;
 	dtrace_dstate_percpu_t *dcpu;
-	int i, work = 0;
+	dtrace_dynvar_t **rinsep;
+	int i, j, work = 0;
 
 	for (i = 0; i < NCPU; i++) {
 		dcpu = &dstate->dtds_percpu[i];
-
-		ASSERT(dcpu->dtdsc_rinsing == NULL);
+		rinsep = &dcpu->dtdsc_rinsing;
 
 		/*
 		 * If the dirty list is NULL, there is no dirty work to do.
@@ -1571,14 +1572,62 @@ dtrace_dynvar_clean(dtrace_dstate_t *dst
 		if (dcpu->dtdsc_dirty == NULL)
 			continue;
 
-		/*
-		 * If the clean list is non-NULL, then we're not going to do
-		 * any work for this CPU -- it means that there has not been
-		 * a dtrace_dynvar() allocation on this CPU (or from this CPU)
-		 * since the last time we cleaned house.
-		 */
-		if (dcpu->dtdsc_clean != NULL)
+		if (dcpu->dtdsc_rinsing != NULL) {
+			/*
+			 * If the rinsing list is non-NULL, then it is because
+			 * this CPU was selected to accept another CPU's
+			 * dirty list -- and since that time, dirty buffers
+			 * have accumulated.  This is a highly unlikely
+			 * condition, but we choose to ignore the dirty
+			 * buffers -- they'll be picked up a future cleanse.
+			 */
 			continue;
+		}
+
+		if (dcpu->dtdsc_clean != NULL) {
+			/*
+			 * If the clean list is non-NULL, then we're in a
+			 * situation where a CPU has done deallocations (we
+			 * have a non-NULL dirty list) but no allocations (we
+			 * also have a non-NULL clean list).  We can't simply
+			 * move the dirty list into the clean list on this
+			 * CPU, yet we also don't want to allow this condition
+			 * to persist, lest a short clean list prevent a
+			 * massive dirty list from being cleaned (which in
+			 * turn could lead to otherwise avoidable dynamic
+			 * drops).  To deal with this, we look for some CPU
+			 * with a NULL clean list, NULL dirty list, and NULL
+			 * rinsing list -- and then we borrow this CPU to
+			 * rinse our dirty list.
+			 */
+			for (j = 0; j < NCPU; j++) {
+				dtrace_dstate_percpu_t *rinser;
+
+				rinser = &dstate->dtds_percpu[j];
+
+				if (rinser->dtdsc_rinsing != NULL)
+					continue;
+
+				if (rinser->dtdsc_dirty != NULL)
+					continue;
+
+				if (rinser->dtdsc_clean != NULL)
+					continue;
+
+				rinsep = &rinser->dtdsc_rinsing;
+				break;
+			}
+
+			if (j == NCPU) {
+				/*
+				 * We were unable to find another CPU that
+				 * could accept this dirty list -- we are
+				 * therefore unable to clean it now.
+				 */
+				dtrace_dynvar_failclean++;
+				continue;
+			}
+		}
 
 		work = 1;
 
@@ -1595,7 +1644,7 @@ dtrace_dynvar_clean(dtrace_dstate_t *dst
 			 * on a hash chain, either the dirty list or the
 			 * rinsing list for some CPU must be non-NULL.)
 			 */
-			dcpu->dtdsc_rinsing = dirty;
+			*rinsep = dirty;
 			dtrace_membar_producer();
 		} while (dtrace_casptr(&dcpu->dtdsc_dirty,
 		    dirty, NULL) != dirty);
@@ -2026,7 +2075,7 @@ retry:
 			ASSERT(clean->dtdv_hashval == DTRACE_DYNHASH_FREE);
 
 			/*
-			 * Now we'll move the clean list to the free list.
+			 * Now we'll move the clean list to our free list.
 			 * It's impossible for this to fail:  the only way
 			 * the free list can be updated is through this
 			 * code path, and only one CPU can own the clean list.
@@ -2039,6 +2088,7 @@ retry:
 			 * owners of the clean lists out before resetting
 			 * the clean lists.
 			 */
+			dcpu = &dstate->dtds_percpu[me];
 			rval = dtrace_casptr(&dcpu->dtdsc_free, NULL, clean);
 			ASSERT(rval == NULL);
 			goto retry;
@@ -4729,7 +4779,7 @@ dtrace_dif_subr(uint_t subr, uint_t rd, 
 		int64_t index = (int64_t)tupregs[1].dttk_value;
 		int64_t remaining = (int64_t)tupregs[2].dttk_value;
 		size_t len = dtrace_strlen((char *)s, size);
-		int64_t i = 0;
+		int64_t i;
 
 		if (!dtrace_canload(s, len + 1, mstate, vstate)) {
 			regs[rd] = 0;

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 18:15:03 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id F39B34F7;
 Sat,  5 Jul 2014 18:15:02 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DF5A72FD4;
 Sat,  5 Jul 2014 18:15:02 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s65IF21x089101;
 Sat, 5 Jul 2014 18:15:02 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s65IF0We089069;
 Sat, 5 Jul 2014 18:15:00 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407051815.s65IF0We089069@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 5 Jul 2014 18:15:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268291 - in head: sys/cam/ctl usr.sbin/ctld
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 18:15:03 -0000

Author: mav
Date: Sat Jul  5 18:15:00 2014
New Revision: 268291
URL: http://svnweb.freebsd.org/changeset/base/268291

Log:
  Create separate CTL port for every iSCSI target (and maybe portal group).
  
  Having single port for all iSCSI connections makes problematic implementing
  some more advanced SCSI functionality in CTL, that require proper ports
  enumeration and identification.
  
  This change extends CTL iSCSI API, making ctld daemon to control list of
  iSCSI ports in CTL.  When new target is defined in config fine, ctld will
  create respective port in CTL.  When target is removed -- port will be
  also removed after all active commands through that port properly aborted.
  This change require ctld to be rebuilt to match the kernel.
  
  As a minor side effect, this allows to have iSCSI targets without LUNs.
  While that may look odd and not very useful, that is not incorrect.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl.h
  head/sys/cam/ctl/ctl_frontend.c
  head/sys/cam/ctl/ctl_frontend.h
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/cam/ctl/ctl_frontend_iscsi.h
  head/sys/cam/ctl/ctl_ioctl.h
  head/usr.sbin/ctld/ctld.c
  head/usr.sbin/ctld/ctld.h
  head/usr.sbin/ctld/kernel.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sat Jul  5 15:36:17 2014	(r268290)
+++ head/sys/cam/ctl/ctl.c	Sat Jul  5 18:15:00 2014	(r268291)
@@ -3146,11 +3146,41 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 		retval = fe->ioctl(dev, cmd, addr, flag, td);
 		break;
 	}
+	case CTL_PORT_REQ: {
+		struct ctl_req *req;
+		struct ctl_frontend *fe;
+
+		req = (struct ctl_req *)addr;
+
+		fe = ctl_frontend_find(req->driver);
+		if (fe == NULL) {
+			req->status = CTL_LUN_ERROR;
+			snprintf(req->error_str, sizeof(req->error_str),
+			    "Frontend \"%s\" not found.", req->driver);
+			break;
+		}
+		if (req->num_args > 0) {
+			req->kern_args = ctl_copyin_args(req->num_args,
+			    req->args, req->error_str, sizeof(req->error_str));
+			if (req->kern_args == NULL) {
+				req->status = CTL_LUN_ERROR;
+				break;
+			}
+		}
+
+		retval = fe->ioctl(dev, cmd, addr, flag, td);
+
+		if (req->num_args > 0) {
+			ctl_copyout_args(req->num_args, req->kern_args);
+			ctl_free_args(req->num_args, req->kern_args);
+		}
+		break;
+	}
 	case CTL_PORT_LIST: {
 		struct sbuf *sb;
 		struct ctl_port *port;
 		struct ctl_lun_list *list;
-//		struct ctl_option *opt;
+		struct ctl_option *opt;
 
 		list = (struct ctl_lun_list *)addr;
 
@@ -3217,6 +3247,13 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 			if (retval != 0)
 				break;
 
+			STAILQ_FOREACH(opt, &port->options, links) {
+				retval = sbuf_printf(sb, "\t<%s>%s\n",
+				    opt->name, opt->value, opt->name);
+				if (retval != 0)
+					break;
+			}
+
 			retval = sbuf_printf(sb, "\n");
 			if (retval != 0)
 				break;

Modified: head/sys/cam/ctl/ctl.h
==============================================================================
--- head/sys/cam/ctl/ctl.h	Sat Jul  5 15:36:17 2014	(r268290)
+++ head/sys/cam/ctl/ctl.h	Sat Jul  5 18:15:00 2014	(r268291)
@@ -103,6 +103,8 @@ union ctl_modepage_info {
  */
 #define CTL_WWPN_LEN   8
 
+#define	CTL_DRIVER_NAME_LEN	32
+
 /*
  * Unit attention types. ASC/ASCQ values for these should be placed in
  * ctl_build_ua.  These are also listed in order of reporting priority.

Modified: head/sys/cam/ctl/ctl_frontend.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend.c	Sat Jul  5 15:36:17 2014	(r268290)
+++ head/sys/cam/ctl/ctl_frontend.c	Sat Jul  5 18:15:00 2014	(r268291)
@@ -176,6 +176,9 @@ ctl_port_register(struct ctl_port *port,
 	}
 	port->ctl_pool_ref = pool;
 
+	if (port->options.stqh_first == NULL)
+		STAILQ_INIT(&port->options);
+
 	mtx_lock(&control_softc->ctl_lock);
 	port->targ_port = port_num + (master_shelf != 0 ? 0 : CTL_MAX_PORTS);
 	port->max_initiators = CTL_MAX_INIT_PER_PORT;
@@ -214,6 +217,7 @@ ctl_port_deregister(struct ctl_port *por
 	mtx_unlock(&control_softc->ctl_lock);
 
 	ctl_pool_free(pool);
+	ctl_free_opts(&port->options);
 
 bailout:
 	return (retval);

Modified: head/sys/cam/ctl/ctl_frontend.h
==============================================================================
--- head/sys/cam/ctl/ctl_frontend.h	Sat Jul  5 15:36:17 2014	(r268290)
+++ head/sys/cam/ctl/ctl_frontend.h	Sat Jul  5 18:15:00 2014	(r268291)
@@ -39,8 +39,6 @@
 #ifndef	_CTL_FRONTEND_H_
 #define	_CTL_FRONTEND_H_
 
-#define	CTL_FE_NAME_LEN		32
-
 typedef enum {
 	CTL_PORT_STATUS_NONE		= 0x00,
 	CTL_PORT_STATUS_ONLINE		= 0x01,
@@ -232,12 +230,13 @@ struct ctl_port {
 	uint64_t	wwnn;			/* set by CTL before online */
 	uint64_t	wwpn;			/* set by CTL before online */
 	ctl_port_status	status;			/* used by CTL */
+	ctl_options_t	options;		/* passed to CTL */
 	STAILQ_ENTRY(ctl_port) fe_links;	/* used by CTL */
 	STAILQ_ENTRY(ctl_port) links;		/* used by CTL */
 };
 
 struct ctl_frontend {
-	char		name[CTL_FE_NAME_LEN];	/* passed to CTL */
+	char		name[CTL_DRIVER_NAME_LEN];	/* passed to CTL */
 	fe_init_t	init;			/* passed to CTL */
 	fe_ioctl_t	ioctl;			/* passed to CTL */
 	void		(*fe_dump)(void);	/* passed to CTL */

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Sat Jul  5 15:36:17 2014	(r268290)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Sat Jul  5 18:15:00 2014	(r268291)
@@ -164,6 +164,8 @@ static void	cfiscsi_pdu_handle_logout_re
 static void	cfiscsi_session_terminate(struct cfiscsi_session *cs);
 static struct cfiscsi_target	*cfiscsi_target_find(struct cfiscsi_softc
 		    *softc, const char *name);
+static struct cfiscsi_target	*cfiscsi_target_find_or_create(
+    struct cfiscsi_softc *softc, const char *name, const char *alias);
 static void	cfiscsi_target_release(struct cfiscsi_target *ct);
 static void	cfiscsi_session_delete(struct cfiscsi_session *cs);
 
@@ -536,7 +538,7 @@ cfiscsi_pdu_handle_scsi_command(struct i
 		cfiscsi_session_terminate(cs);
 		return;
 	}
-	io = ctl_alloc_io(cs->cs_target->ct_softc->port.ctl_pool_ref);
+	io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref);
 	if (io == NULL) {
 		CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io; "
 		    "dropping connection");
@@ -548,7 +550,7 @@ cfiscsi_pdu_handle_scsi_command(struct i
 	io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = request;
 	io->io_hdr.io_type = CTL_IO_SCSI;
 	io->io_hdr.nexus.initid.id = cs->cs_ctl_initid;
-	io->io_hdr.nexus.targ_port = cs->cs_target->ct_softc->port.targ_port;
+	io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port;
 	io->io_hdr.nexus.targ_target.id = 0;
 	io->io_hdr.nexus.targ_lun = cfiscsi_decode_lun(bhssc->bhssc_lun);
 	io->io_hdr.nexus.lun_map_fn = cfiscsi_map_lun;
@@ -602,7 +604,7 @@ cfiscsi_pdu_handle_task_request(struct i
 
 	cs = PDU_SESSION(request);
 	bhstmr = (struct iscsi_bhs_task_management_request *)request->ip_bhs;
-	io = ctl_alloc_io(cs->cs_target->ct_softc->port.ctl_pool_ref);
+	io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref);
 	if (io == NULL) {
 		CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io;"
 		    "dropping connection");
@@ -614,7 +616,7 @@ cfiscsi_pdu_handle_task_request(struct i
 	io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = request;
 	io->io_hdr.io_type = CTL_IO_TASK;
 	io->io_hdr.nexus.initid.id = cs->cs_ctl_initid;
-	io->io_hdr.nexus.targ_port = cs->cs_target->ct_softc->port.targ_port;
+	io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port;
 	io->io_hdr.nexus.targ_target.id = 0;
 	io->io_hdr.nexus.targ_lun = cfiscsi_decode_lun(bhstmr->bhstmr_lun);
 	io->io_hdr.nexus.lun_map_fn = cfiscsi_map_lun;
@@ -1036,7 +1038,7 @@ cfiscsi_session_terminate_tasks(struct c
 	int error, last;
 
 #ifdef notyet
-	io = ctl_alloc_io(cs->cs_target->ct_softc->port.ctl_pool_ref);
+	io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref);
 	if (io == NULL) {
 		CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io");
 		return;
@@ -1045,7 +1047,7 @@ cfiscsi_session_terminate_tasks(struct c
 	io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = NULL;
 	io->io_hdr.io_type = CTL_IO_TASK;
 	io->io_hdr.nexus.initid.id = cs->cs_ctl_initid;
-	io->io_hdr.nexus.targ_port = cs->cs_target->ct_softc->port.targ_port;
+	io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port;
 	io->io_hdr.nexus.targ_target.id = 0;
 	io->io_hdr.nexus.targ_lun = lun;
 	io->taskio.tag_type = CTL_TAG_SIMPLE; /* XXX */
@@ -1064,7 +1066,7 @@ cfiscsi_session_terminate_tasks(struct c
 	CFISCSI_SESSION_LOCK(cs);
 	TAILQ_FOREACH_SAFE(cdw,
 	    &cs->cs_waiting_for_data_out, cdw_next, tmpcdw) {
-		io = ctl_alloc_io(cs->cs_target->ct_softc->port.ctl_pool_ref);
+		io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref);
 		if (io == NULL) {
 			CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io");
 			return;
@@ -1073,8 +1075,7 @@ cfiscsi_session_terminate_tasks(struct c
 		io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = NULL;
 		io->io_hdr.io_type = CTL_IO_TASK;
 		io->io_hdr.nexus.initid.id = cs->cs_ctl_initid;
-		io->io_hdr.nexus.targ_port =
-		    cs->cs_target->ct_softc->port.targ_port;
+		io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port;
 		io->io_hdr.nexus.targ_target.id = 0;
 		//io->io_hdr.nexus.targ_lun = lun; /* Not needed? */
 		io->taskio.tag_type = CTL_TAG_SIMPLE; /* XXX */
@@ -1197,7 +1198,7 @@ cfiscsi_session_register_initiator(struc
 	    i, softc->max_initiators);
 #endif
 	cs->cs_ctl_initid = i;
-	error = ctl_add_initiator(0x0, softc->port.targ_port, cs->cs_ctl_initid);
+	error = ctl_add_initiator(0x0, cs->cs_target->ct_port.targ_port, cs->cs_ctl_initid);
 	if (error != 0) {
 		CFISCSI_SESSION_WARN(cs, "ctl_add_initiator failed with error %d", error);
 		mtx_lock(&softc->lock);
@@ -1221,7 +1222,7 @@ cfiscsi_session_unregister_initiator(str
 
 	softc = &cfiscsi_softc;
 
-	error = ctl_remove_initiator(softc->port.targ_port, cs->cs_ctl_initid);
+	error = ctl_remove_initiator(cs->cs_target->ct_port.targ_port, cs->cs_ctl_initid);
 	if (error != 0) {
 		CFISCSI_SESSION_WARN(cs, "ctl_remove_initiator failed with error %d",
 		    error);
@@ -1312,7 +1313,6 @@ int
 cfiscsi_init(void)
 {
 	struct cfiscsi_softc *softc;
-	struct ctl_port *port;
 	int retval;
 
 	softc = &cfiscsi_softc;
@@ -1326,46 +1326,13 @@ cfiscsi_init(void)
 	TAILQ_INIT(&softc->sessions);
 	TAILQ_INIT(&softc->targets);
 
-	port = &softc->port;
-	port->frontend = &cfiscsi_frontend;
-	port->port_type = CTL_PORT_ISCSI;
-	/* XXX KDM what should the real number be here? */
-	port->num_requested_ctl_io = 4096;
-	snprintf(softc->port_name, sizeof(softc->port_name), "iscsi");
-	port->port_name = softc->port_name;
-	port->port_online = cfiscsi_online;
-	port->port_offline = cfiscsi_offline;
-	port->onoff_arg = softc;
-	port->lun_enable = cfiscsi_lun_enable;
-	port->lun_disable = cfiscsi_lun_disable;
-	port->targ_lun_arg = softc;
-	port->devid = cfiscsi_devid;
-	port->fe_datamove = cfiscsi_datamove;
-	port->fe_done = cfiscsi_done;
-
-	/* XXX KDM what should we report here? */
-	/* XXX These should probably be fetched from CTL. */
-	port->max_targets = 1;
-	port->max_target_id = 15;
-
-	retval = ctl_port_register(port, /*master_SC*/ 1);
-	if (retval != 0) {
-		CFISCSI_WARN("ctl_frontend_register() failed with error %d",
-		    retval);
-		retval = 1;
-		goto bailout;
-	}
-
-	softc->max_initiators = port->max_initiators;
+	softc->max_initiators = CTL_MAX_INIT_PER_PORT;
 
 	cfiscsi_data_wait_zone = uma_zcreate("cfiscsi_data_wait",
 	    sizeof(struct cfiscsi_data_wait), NULL, NULL, NULL, NULL,
 	    UMA_ALIGN_PTR, 0);
 
 	return (0);
-
-bailout:
-	return (retval);
 }
 
 #ifdef ICL_KERNEL_PROXY
@@ -1392,10 +1359,23 @@ static void
 cfiscsi_online(void *arg)
 {
 	struct cfiscsi_softc *softc;
+	struct cfiscsi_target *ct;
+	int online;
+
+	ct = (struct cfiscsi_target *)arg;
+	softc = ct->ct_softc;
 
-	softc = (struct cfiscsi_softc *)arg;
+	mtx_lock(&softc->lock);
+	if (ct->ct_online) {
+		mtx_unlock(&softc->lock);
+		return;
+	}
+	ct->ct_online = 1;
+	online = softc->online++;
+	mtx_unlock(&softc->lock);
+	if (online > 0)
+		return;
 
-	softc->online = 1;
 #ifdef ICL_KERNEL_PROXY
 	if (softc->listener != NULL)
 		icl_listen_free(softc->listener);
@@ -1407,16 +1387,28 @@ static void
 cfiscsi_offline(void *arg)
 {
 	struct cfiscsi_softc *softc;
+	struct cfiscsi_target *ct;
 	struct cfiscsi_session *cs;
+	int online;
 
-	softc = (struct cfiscsi_softc *)arg;
-
-	softc->online = 0;
+	ct = (struct cfiscsi_target *)arg;
+	softc = ct->ct_softc;
 
 	mtx_lock(&softc->lock);
-	TAILQ_FOREACH(cs, &softc->sessions, cs_next)
-		cfiscsi_session_terminate(cs);
+	if (!ct->ct_online) {
+		mtx_unlock(&softc->lock);
+		return;
+	}
+	ct->ct_online = 0;
+	online = --softc->online;
+
+	TAILQ_FOREACH(cs, &softc->sessions, cs_next) {
+		if (cs->cs_target == ct)
+			cfiscsi_session_terminate(cs);
+	}
 	mtx_unlock(&softc->lock);
+	if (online > 0)
+		return;
 
 #ifdef ICL_KERNEL_PROXY
 	icl_listen_free(softc->listener);
@@ -1440,18 +1432,19 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi *
 	    cihp->initiator_name, cihp->initiator_addr,
 	    cihp->target_name);
 
-	if (softc->online == 0) {
+	ct = cfiscsi_target_find(softc, cihp->target_name);
+	if (ct == NULL) {
 		ci->status = CTL_ISCSI_ERROR;
 		snprintf(ci->error_str, sizeof(ci->error_str),
-		    "%s: port offline", __func__);
+		    "%s: target not found", __func__);
 		return;
 	}
 
-	ct = cfiscsi_target_find(softc, cihp->target_name);
-	if (ct == NULL) {
+	if (ct->ct_online == 0) {
 		ci->status = CTL_ISCSI_ERROR;
 		snprintf(ci->error_str, sizeof(ci->error_str),
-		    "%s: target not found", __func__);
+		    "%s: port offline", __func__);
+		cfiscsi_target_release(ct);
 		return;
 	}
 
@@ -1949,11 +1942,148 @@ cfiscsi_ioctl_receive(struct ctl_iscsi *
 
 #endif /* !ICL_KERNEL_PROXY */
 
+static void
+cfiscsi_ioctl_port_create(struct ctl_req *req)
+{
+	struct cfiscsi_target *ct;
+	struct ctl_port *port;
+	const char *target, *alias, *tag;
+	ctl_options_t opts;
+	int retval;
+
+	ctl_init_opts(&opts, req->num_args, req->kern_args);
+	target = ctl_get_opt(&opts, "cfiscsi_target");
+	alias = ctl_get_opt(&opts, "cfiscsi_target_alias");
+	tag = ctl_get_opt(&opts, "cfiscsi_portal_group_tag");
+	if (target == NULL || tag == NULL) {
+		ctl_free_opts(&opts);
+		req->status = CTL_LUN_ERROR;
+		snprintf(req->error_str, sizeof(req->error_str),
+		    "Missing required argument");
+		return;
+	}
+	ct = cfiscsi_target_find_or_create(&cfiscsi_softc, target, alias);
+	if (ct == NULL) {
+		ctl_free_opts(&opts);
+		req->status = CTL_LUN_ERROR;
+		snprintf(req->error_str, sizeof(req->error_str),
+		    "failed to create target \"%s\"", target);
+		return;
+	}
+	if (ct->ct_state == CFISCSI_TARGET_STATE_ACTIVE) {
+		cfiscsi_target_release(ct);
+		ctl_free_opts(&opts);
+		req->status = CTL_LUN_ERROR;
+		snprintf(req->error_str, sizeof(req->error_str),
+		    "target \"%s\" already exist", target);
+		return;
+	}
+	port = &ct->ct_port;
+	if (ct->ct_state == CFISCSI_TARGET_STATE_DYING)
+		goto done;
+
+	port->frontend = &cfiscsi_frontend;
+	port->port_type = CTL_PORT_ISCSI;
+	/* XXX KDM what should the real number be here? */
+	port->num_requested_ctl_io = 4096;
+	port->port_name = "iscsi";
+	port->virtual_port = strtoul(tag, NULL, 0);
+	port->port_online = cfiscsi_online;
+	port->port_offline = cfiscsi_offline;
+	port->onoff_arg = ct;
+	port->lun_enable = cfiscsi_lun_enable;
+	port->lun_disable = cfiscsi_lun_disable;
+	port->targ_lun_arg = ct;
+	port->devid = cfiscsi_devid;
+	port->fe_datamove = cfiscsi_datamove;
+	port->fe_done = cfiscsi_done;
+
+	/* XXX KDM what should we report here? */
+	/* XXX These should probably be fetched from CTL. */
+	port->max_targets = 1;
+	port->max_target_id = 15;
+
+	port->options = opts;
+	STAILQ_INIT(&opts);
+
+	retval = ctl_port_register(port, /*master_SC*/ 1);
+	if (retval != 0) {
+		ctl_free_opts(&port->options);
+		cfiscsi_target_release(ct);
+		req->status = CTL_LUN_ERROR;
+		snprintf(req->error_str, sizeof(req->error_str),
+		    "ctl_frontend_register() failed with error %d", retval);
+		return;
+	}
+done:
+	ct->ct_state = CFISCSI_TARGET_STATE_ACTIVE;
+	req->status = CTL_LUN_OK;
+	memcpy(req->kern_args[0].kvalue, &port->targ_port,
+	    sizeof(port->targ_port)); //XXX
+}
+
+static void
+cfiscsi_ioctl_port_remove(struct ctl_req *req)
+{
+	struct cfiscsi_target *ct;
+	const char *target;
+	ctl_options_t opts;
+
+	ctl_init_opts(&opts, req->num_args, req->kern_args);
+	target = ctl_get_opt(&opts, "cfiscsi_target");
+	if (target == NULL) {
+		ctl_free_opts(&opts);
+		req->status = CTL_LUN_ERROR;
+		snprintf(req->error_str, sizeof(req->error_str),
+		    "Missing required argument");
+		return;
+	}
+	ct = cfiscsi_target_find(&cfiscsi_softc, target);
+	if (ct == NULL) {
+		ctl_free_opts(&opts);
+		req->status = CTL_LUN_ERROR;
+		snprintf(req->error_str, sizeof(req->error_str),
+		    "can't find target \"%s\"", target);
+		return;
+	}
+	if (ct->ct_state != CFISCSI_TARGET_STATE_ACTIVE) {
+		ctl_free_opts(&opts);
+		req->status = CTL_LUN_ERROR;
+		snprintf(req->error_str, sizeof(req->error_str),
+		    "target \"%s\" is already dying", target);
+		return;
+	}
+	ctl_free_opts(&opts);
+
+	ct->ct_state = CFISCSI_TARGET_STATE_DYING;
+	ctl_port_offline(&ct->ct_port);
+	cfiscsi_target_release(ct);
+	cfiscsi_target_release(ct);
+}
+
 static int
 cfiscsi_ioctl(struct cdev *dev,
     u_long cmd, caddr_t addr, int flag, struct thread *td)
 {
 	struct ctl_iscsi *ci;
+	struct ctl_req *req;
+
+	if (cmd == CTL_PORT_REQ) {
+		req = (struct ctl_req *)addr;
+		switch (req->reqtype) {
+		case CTL_REQ_CREATE:
+			cfiscsi_ioctl_port_create(req);
+			break;
+		case CTL_REQ_REMOVE:
+			cfiscsi_ioctl_port_remove(req);
+			break;
+		default:
+			req->status = CTL_LUN_ERROR;
+			snprintf(req->error_str, sizeof(req->error_str),
+			    "Unsupported request type %d", req->reqtype);
+		}
+		return (0);
+	}
 
 	if (cmd != CTL_ISCSI)
 		return (ENOTTY);
@@ -2223,6 +2353,12 @@ cfiscsi_target_release(struct cfiscsi_ta
 	if (refcount_release(&ct->ct_refcount)) {
 		TAILQ_REMOVE(&softc->targets, ct, ct_next);
 		mtx_unlock(&softc->lock);
+		if (ct->ct_state != CFISCSI_TARGET_STATE_INVALID) {
+			ct->ct_state = CFISCSI_TARGET_STATE_INVALID;
+			if (ctl_port_deregister(&ct->ct_port) != 0)
+				printf("%s: ctl_port_deregister() failed\n",
+				    __func__);
+		}
 		free(ct, M_CFISCSI);
 
 		return;
@@ -2237,7 +2373,8 @@ cfiscsi_target_find(struct cfiscsi_softc
 
 	mtx_lock(&softc->lock);
 	TAILQ_FOREACH(ct, &softc->targets, ct_next) {
-		if (strcmp(name, ct->ct_name) != 0)
+		if (strcmp(name, ct->ct_name) != 0 ||
+		    ct->ct_state != CFISCSI_TARGET_STATE_ACTIVE)
 			continue;
 		cfiscsi_target_hold(ct);
 		mtx_unlock(&softc->lock);
@@ -2262,7 +2399,8 @@ cfiscsi_target_find_or_create(struct cfi
 
 	mtx_lock(&softc->lock);
 	TAILQ_FOREACH(ct, &softc->targets, ct_next) {
-		if (strcmp(name, ct->ct_name) != 0)
+		if (strcmp(name, ct->ct_name) != 0 ||
+		    ct->ct_state == CFISCSI_TARGET_STATE_INVALID)
 			continue;
 		cfiscsi_target_hold(ct);
 		mtx_unlock(&softc->lock);
@@ -2336,22 +2474,6 @@ cfiscsi_target_set_lun(struct cfiscsi_ta
 #endif
 
 	ct->ct_luns[lun_id] = ctl_lun_id;
-	cfiscsi_target_hold(ct);
-
-	return (0);
-}
-
-static int
-cfiscsi_target_unset_lun(struct cfiscsi_target *ct, unsigned long lun_id)
-{
-
-	if (ct->ct_luns[lun_id] < 0) {
-		CFISCSI_WARN("lun %ld not allocated", lun_id);
-		return (-1);
-	}
-
-	ct->ct_luns[lun_id] = -1;
-	cfiscsi_target_release(ct);
 
 	return (0);
 }
@@ -2361,16 +2483,15 @@ cfiscsi_lun_enable(void *arg, struct ctl
 {
 	struct cfiscsi_softc *softc;
 	struct cfiscsi_target *ct;
-	const char *target = NULL, *target_alias = NULL;
+	const char *target = NULL;
 	const char *lun = NULL;
 	unsigned long tmp;
 
-	softc = (struct cfiscsi_softc *)arg;
+	ct = (struct cfiscsi_target *)arg;
+	softc = ct->ct_softc;
 
 	target = ctl_get_opt(&control_softc->ctl_luns[lun_id]->be_lun->options,
 	    "cfiscsi_target");
-	target_alias = ctl_get_opt(&control_softc->ctl_luns[lun_id]->be_lun->options,
-	    "cfiscsi_target_alias");
 	lun = ctl_get_opt(&control_softc->ctl_luns[lun_id]->be_lun->options,
 	    "cfiscsi_lun");
 
@@ -2383,15 +2504,11 @@ cfiscsi_lun_enable(void *arg, struct ctl
 		return (0);
 	}
 
-	ct = cfiscsi_target_find_or_create(softc, target, target_alias);
-	if (ct == NULL) {
-		CFISCSI_WARN("failed to create target \"%s\"", target);
+	if (strcmp(target, ct->ct_name) != 0)
 		return (0);
-	}
 
 	tmp = strtoul(lun, NULL, 10);
 	cfiscsi_target_set_lun(ct, tmp, lun_id);
-	cfiscsi_target_release(ct);
 	return (0);
 }
 
@@ -2402,19 +2519,17 @@ cfiscsi_lun_disable(void *arg, struct ct
 	struct cfiscsi_target *ct;
 	int i;
 
-	softc = (struct cfiscsi_softc *)arg;
+	ct = (struct cfiscsi_target *)arg;
+	softc = ct->ct_softc;
 
 	mtx_lock(&softc->lock);
-	TAILQ_FOREACH(ct, &softc->targets, ct_next) {
-		for (i = 0; i < CTL_MAX_LUNS; i++) {
-			if (ct->ct_luns[i] < 0)
-				continue;
-			if (ct->ct_luns[i] != lun_id)
-				continue;
-			mtx_unlock(&softc->lock);
-			cfiscsi_target_unset_lun(ct, i);
-			return (0);
-		}
+	for (i = 0; i < CTL_MAX_LUNS; i++) {
+		if (ct->ct_luns[i] < 0)
+			continue;
+		if (ct->ct_luns[i] != lun_id)
+			continue;
+		ct->ct_luns[lun_id] = -1;
+		break;
 	}
 	mtx_unlock(&softc->lock);
 	return (0);

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.h
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.h	Sat Jul  5 15:36:17 2014	(r268290)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.h	Sat Jul  5 18:15:00 2014	(r268291)
@@ -32,6 +32,10 @@
 #ifndef CTL_FRONTEND_ISCSI_H
 #define	CTL_FRONTEND_ISCSI_H
 
+#define CFISCSI_TARGET_STATE_INVALID	0
+#define CFISCSI_TARGET_STATE_ACTIVE	1
+#define CFISCSI_TARGET_STATE_DYING	2
+
 struct cfiscsi_target {
 	TAILQ_ENTRY(cfiscsi_target)	ct_next;
 	int				ct_luns[CTL_MAX_LUNS];
@@ -39,6 +43,9 @@ struct cfiscsi_target {
 	volatile u_int			ct_refcount;
 	char				ct_name[CTL_ISCSI_NAME_LEN];
 	char				ct_alias[CTL_ISCSI_ALIAS_LEN];
+	int				ct_state;
+	int				ct_online;
+	struct ctl_port			ct_port;
 };
 
 struct cfiscsi_data_wait {
@@ -96,7 +103,6 @@ struct icl_listen;
 #endif
 
 struct cfiscsi_softc {
-	struct ctl_port			port;
 	struct mtx			lock;
 	char				port_name[32];
 	int				online;

Modified: head/sys/cam/ctl/ctl_ioctl.h
==============================================================================
--- head/sys/cam/ctl/ctl_ioctl.h	Sat Jul  5 15:36:17 2014	(r268290)
+++ head/sys/cam/ctl/ctl_ioctl.h	Sat Jul  5 18:15:00 2014	(r268291)
@@ -595,6 +595,45 @@ struct ctl_lun_list {
 };
 
 /*
+ * Port request interface:
+ *
+ * driver:		This is required, and is NUL-terminated a string
+ *			that is the name of the frontend, like "iscsi" .
+ *
+ * reqtype:		The type of request, CTL_REQ_CREATE to create a
+ *			port, CTL_REQ_REMOVE to delete a port.
+ *
+ * num_be_args:		This is the number of frontend-specific arguments
+ *			in the be_args array.
+ *
+ * be_args:		This is an array of frontend-specific arguments.
+ *			See above for a description of the fields in this
+ *			structure.
+ *
+ * status:		Status of the request.
+ *
+ * error_str:		If the status is CTL_LUN_ERROR, this will
+ *			contain a string describing the error.
+ *
+ * kern_be_args:	For kernel use only.
+ */
+typedef enum {
+	CTL_REQ_CREATE,
+	CTL_REQ_REMOVE,
+	CTL_REQ_MODIFY,
+} ctl_req_type;
+
+struct ctl_req {
+	char			driver[CTL_DRIVER_NAME_LEN];
+	ctl_req_type		reqtype;
+	int			num_args;
+	struct ctl_be_arg	*args;
+	ctl_lun_status		status;
+	char			error_str[CTL_ERROR_STR_LEN];
+	struct ctl_be_arg	*kern_args;
+};
+
+/*
  * iSCSI status
  *
  * OK:			Request completed successfully.
@@ -789,7 +828,8 @@ struct ctl_iscsi {
 #define	CTL_ERROR_INJECT_DELETE	_IOW(CTL_MINOR, 0x23, struct ctl_error_desc)
 #define	CTL_SET_PORT_WWNS	_IOW(CTL_MINOR, 0x24, struct ctl_port_entry)
 #define	CTL_ISCSI		_IOWR(CTL_MINOR, 0x25, struct ctl_iscsi)
-#define	CTL_PORT_LIST		_IOWR(CTL_MINOR, 0x26, struct ctl_lun_list)
+#define	CTL_PORT_REQ		_IOWR(CTL_MINOR, 0x26, struct ctl_req)
+#define	CTL_PORT_LIST		_IOWR(CTL_MINOR, 0x27, struct ctl_lun_list)
 
 #endif /* _CTL_IOCTL_H_ */
 

Modified: head/usr.sbin/ctld/ctld.c
==============================================================================
--- head/usr.sbin/ctld/ctld.c	Sat Jul  5 15:36:17 2014	(r268290)
+++ head/usr.sbin/ctld/ctld.c	Sat Jul  5 18:15:00 2014	(r268291)
@@ -1120,7 +1120,6 @@ conf_verify(struct conf *conf)
 		if (!found_lun) {
 			log_warnx("no LUNs defined for target \"%s\"",
 			    targ->t_name);
-			return (1);
 		}
 	}
 	TAILQ_FOREACH(pg, &conf->conf_portal_groups, pg_next) {
@@ -1209,19 +1208,6 @@ conf_apply(struct conf *oldconf, struct 
 		}
 	}
 
-	if (oldconf->conf_kernel_port_on != newconf->conf_kernel_port_on) {
-		if (newconf->conf_kernel_port_on == true) {
-			log_debugx("enabling CTL iSCSI port");
-			error = kernel_port_on();
-			if (error != 0)
-				log_errx(1, "failed to enable CTL iSCSI port; exiting");
-		} else {
-			error = kernel_port_off();
-			if (error != 0)
-				log_warnx("failed to disable CTL iSCSI port");
-		}
-	}
-
 	/*
 	 * XXX: If target or lun removal fails, we should somehow "move"
 	 * 	the old lun or target into newconf, so that subsequent
@@ -1253,6 +1239,7 @@ conf_apply(struct conf *oldconf, struct 
 				}
 				lun_delete(oldlun);
 			}
+			kernel_port_remove(oldtarg);
 			target_delete(oldtarg);
 			continue;
 		}
@@ -1387,6 +1374,8 @@ conf_apply(struct conf *oldconf, struct 
 				cumulated_error++;
 			}
 		}
+		if (oldtarg == NULL)
+			kernel_port_add(newtarg);
 	}
 
 	/*

Modified: head/usr.sbin/ctld/ctld.h
==============================================================================
--- head/usr.sbin/ctld/ctld.h	Sat Jul  5 15:36:17 2014	(r268290)
+++ head/usr.sbin/ctld/ctld.h	Sat Jul  5 18:15:00 2014	(r268291)
@@ -272,8 +272,8 @@ int			kernel_lun_add(struct lun *lun);
 int			kernel_lun_resize(struct lun *lun);
 int			kernel_lun_remove(struct lun *lun);
 void			kernel_handoff(struct connection *conn);
-int			kernel_port_on(void);
-int			kernel_port_off(void);
+int			kernel_port_add(struct target *targ);
+int			kernel_port_remove(struct target *targ);
 void			kernel_capsicate(void);
 
 #ifdef ICL_KERNEL_PROXY

Modified: head/usr.sbin/ctld/kernel.c
==============================================================================
--- head/usr.sbin/ctld/kernel.c	Sat Jul  5 15:36:17 2014	(r268290)
+++ head/usr.sbin/ctld/kernel.c	Sat Jul  5 18:15:00 2014	(r268291)
@@ -119,10 +119,21 @@ struct cctl_lun {
 	STAILQ_ENTRY(cctl_lun) links;
 };
 
+struct cctl_port {
+	uint32_t port_id;
+	char *cfiscsi_target;
+	uint16_t cfiscsi_portal_group_tag;
+	STAILQ_HEAD(,cctl_lun_nv) attr_list;
+	STAILQ_ENTRY(cctl_port) links;
+};
+
 struct cctl_devlist_data {
 	int num_luns;
 	STAILQ_HEAD(,cctl_lun) lun_list;
 	struct cctl_lun *cur_lun;
+	int num_ports;
+	STAILQ_HEAD(,cctl_port) port_list;
+	struct cctl_port *cur_port;
 	int level;
 	struct sbuf *cur_sb[32];
 };
@@ -247,6 +258,109 @@ cctl_end_element(void *user_data, const 
 }
 
 static void
+cctl_start_pelement(void *user_data, const char *name, const char **attr)
+{
+	int i;
+	struct cctl_devlist_data *devlist;
+	struct cctl_port *cur_port;
+
+	devlist = (struct cctl_devlist_data *)user_data;
+	cur_port = devlist->cur_port;
+	devlist->level++;
+	if ((u_int)devlist->level >= (sizeof(devlist->cur_sb) /
+	    sizeof(devlist->cur_sb[0])))
+		log_errx(1, "%s: too many nesting levels, %zd max", __func__,
+		     sizeof(devlist->cur_sb) / sizeof(devlist->cur_sb[0]));
+
+	devlist->cur_sb[devlist->level] = sbuf_new_auto();
+	if (devlist->cur_sb[devlist->level] == NULL)
+		log_err(1, "%s: unable to allocate sbuf", __func__);
+
+	if (strcmp(name, "targ_port") == 0) {
+		if (cur_port != NULL)
+			log_errx(1, "%s: improper port element nesting (%s)",
+			    __func__, name);
+
+		cur_port = calloc(1, sizeof(*cur_port));
+		if (cur_port == NULL)
+			log_err(1, "%s: cannot allocate %zd bytes", __func__,
+			    sizeof(*cur_port));
+
+		devlist->num_ports++;
+		devlist->cur_port = cur_port;
+
+		STAILQ_INIT(&cur_port->attr_list);
+		STAILQ_INSERT_TAIL(&devlist->port_list, cur_port, links);
+
+		for (i = 0; attr[i] != NULL; i += 2) {
+			if (strcmp(attr[i], "id") == 0) {
+				cur_port->port_id = strtoul(attr[i+1], NULL, 0);
+			} else {
+				log_errx(1, "%s: invalid LUN attribute %s = %s",
+				     __func__, attr[i], attr[i+1]);
+			}
+		}
+	}
+}
+
+static void
+cctl_end_pelement(void *user_data, const char *name)
+{
+	struct cctl_devlist_data *devlist;
+	struct cctl_port *cur_port;
+	char *str;
+
+	devlist = (struct cctl_devlist_data *)user_data;
+	cur_port = devlist->cur_port;
+
+	if ((cur_port == NULL)
+	 && (strcmp(name, "ctlportlist") != 0))
+		log_errx(1, "%s: cur_port == NULL! (name = %s)", __func__, name);
+
+	if (devlist->cur_sb[devlist->level] == NULL)
+		log_errx(1, "%s: no valid sbuf at level %d (name %s)", __func__,
+		     devlist->level, name);
+
+	sbuf_finish(devlist->cur_sb[devlist->level]);
+	str = checked_strdup(sbuf_data(devlist->cur_sb[devlist->level]));
+
+	if (strlen(str) == 0) {
+		free(str);
+		str = NULL;
+	}
+
+	sbuf_delete(devlist->cur_sb[devlist->level]);
+	devlist->cur_sb[devlist->level] = NULL;
+	devlist->level--;
+
+	if (strcmp(name, "cfiscsi_target") == 0) {
+		cur_port->cfiscsi_target = str;
+		str = NULL;
+	} else if (strcmp(name, "cfiscsi_portal_group_tag") == 0) {
+		cur_port->cfiscsi_portal_group_tag = strtoul(str, NULL, 0);
+	} else if (strcmp(name, "targ_port") == 0) {
+		devlist->cur_port = NULL;
+	} else if (strcmp(name, "ctlportlist") == 0) {
+		
+	} else {
+		struct cctl_lun_nv *nv;
+
+		nv = calloc(1, sizeof(*nv));
+		if (nv == NULL)
+			log_err(1, "%s: can't allocate %zd bytes for nv pair",
+			    __func__, sizeof(*nv));
+
+		nv->name = checked_strdup(name);
+
+		nv->value = str;
+		str = NULL;
+		STAILQ_INSERT_TAIL(&cur_port->attr_list, nv, links);
+	}
+
+	free(str);
+}
+
+static void
 cctl_char_handler(void *user_data, const XML_Char *str, int len)
 {
 	struct cctl_devlist_data *devlist;
@@ -266,50 +380,51 @@ conf_new_from_kernel(void)
 	struct ctl_lun_list list;
 	struct cctl_devlist_data devlist;
 	struct cctl_lun *lun;
+	struct cctl_port *port;
 	XML_Parser parser;
-	char *lun_str = NULL;
-	int lun_len;
-	int retval;
-
-	lun_len = 4096;
+	char *str;
+	int len, retval;
 
 	bzero(&devlist, sizeof(devlist));
 	STAILQ_INIT(&devlist.lun_list);
+	STAILQ_INIT(&devlist.port_list);
 
 	log_debugx("obtaining previously configured CTL luns from the kernel");
 
+	str = NULL;
+	len = 4096;
 retry:
-	lun_str = realloc(lun_str, lun_len);
-	if (lun_str == NULL)
+	str = realloc(str, len);
+	if (str == NULL)
 		log_err(1, "realloc");
 
 	bzero(&list, sizeof(list));
-	list.alloc_len = lun_len;
+	list.alloc_len = len;
 	list.status = CTL_LUN_LIST_NONE;
-	list.lun_xml = lun_str;
+	list.lun_xml = str;
 
 	if (ioctl(ctl_fd, CTL_LUN_LIST, &list) == -1) {
 		log_warn("error issuing CTL_LUN_LIST ioctl");
-		free(lun_str);
+		free(str);
 		return (NULL);
 	}
 
 	if (list.status == CTL_LUN_LIST_ERROR) {
 		log_warnx("error returned from CTL_LUN_LIST ioctl: %s",
 		    list.error_str);
-		free(lun_str);
+		free(str);
 		return (NULL);
 	}
 
 	if (list.status == CTL_LUN_LIST_NEED_MORE_SPACE) {
-		lun_len = lun_len << 1;
+		len = len << 1;
 		goto retry;
 	}
 
 	parser = XML_ParserCreate(NULL);
 	if (parser == NULL) {
 		log_warnx("unable to create XML parser");
-		free(lun_str);
+		free(str);
 		return (NULL);
 	}
 
@@ -317,9 +432,58 @@ retry:
 	XML_SetElementHandler(parser, cctl_start_element, cctl_end_element);
 	XML_SetCharacterDataHandler(parser, cctl_char_handler);
 
-	retval = XML_Parse(parser, lun_str, strlen(lun_str), 1);
+	retval = XML_Parse(parser, str, strlen(str), 1);
+	XML_ParserFree(parser);
+	free(str);
+	if (retval != 1) {
+		log_warnx("XML_Parse failed");
+		return (NULL);
+	}
+
+	str = NULL;
+	len = 4096;
+retry_port:
+	str = realloc(str, len);
+	if (str == NULL)
+		log_err(1, "realloc");
+
+	bzero(&list, sizeof(list));
+	list.alloc_len = len;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 19:02:53 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id F10F97F2;
 Sat,  5 Jul 2014 19:02:53 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DDB4623DD;
 Sat,  5 Jul 2014 19:02:53 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s65J2rlT012789;
 Sat, 5 Jul 2014 19:02:53 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s65J2rO4012788;
 Sat, 5 Jul 2014 19:02:53 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201407051902.s65J2rO4012788@svn.freebsd.org>
From: Gavin Atkinson 
Date: Sat, 5 Jul 2014 19:02:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268292 - head/usr.bin/calendar/calendars
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 19:02:54 -0000

Author: gavin
Date: Sat Jul  5 19:02:53 2014
New Revision: 268292
URL: http://svnweb.freebsd.org/changeset/base/268292

Log:
  Dominion Day became Canada Day in 1982, update the holiday calendar.
  
  PR:		191533
  Submitted by:	db
  Obtained from:	http://www.pch.gc.ca/eng/1359137387574/1359137429809
  MFC after:	3 days

Modified:
  head/usr.bin/calendar/calendars/calendar.holiday

Modified: head/usr.bin/calendar/calendars/calendar.holiday
==============================================================================
--- head/usr.bin/calendar/calendars/calendar.holiday	Sat Jul  5 18:15:00 2014	(r268291)
+++ head/usr.bin/calendar/calendars/calendar.holiday	Sat Jul  5 19:02:53 2014	(r268292)
@@ -248,7 +248,7 @@
 06/30	Day of the Army in Guatemala
 06/MonFirst	Jefferson Davis's Birthday in Alabama & Mississippi (1st Monday)
 06/MonFirst	Jefferson Davis's Birthday in Florida, Georgia, & S. Carolina
-07/01	Dominion Day in Canada
+07/01	Canada Day
 07/01	Freedom Day in Suriname
 07/01	Independence Day in Burundi
 07/01	National Day in Rwanda

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 19:30:23 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1FE8D80E;
 Sat,  5 Jul 2014 19:30:23 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0BF1625DB;
 Sat,  5 Jul 2014 19:30:23 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s65JUNfN027764;
 Sat, 5 Jul 2014 19:30:23 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s65JULBO027752;
 Sat, 5 Jul 2014 19:30:21 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407051930.s65JULBO027752@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 5 Jul 2014 19:30:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268293 - in head: sys/cam/ctl usr.sbin/ctladm
 usr.sbin/ctld
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 19:30:23 -0000

Author: mav
Date: Sat Jul  5 19:30:20 2014
New Revision: 268293
URL: http://svnweb.freebsd.org/changeset/base/268293

Log:
  Burry devid port method, which was a gross hack.
  
  Instead make ports provide wanted port and target IDs, and LUNs provide
  wanted LUN IDs.  After that core Device ID VPD code only had to link all
  of them together and add relative port and port group numbers.
  
  LUN ID for iSCSI LUNs no longer created by CTL, but by ctld, and passed
  to CTL as "scsiname" LUN option.  This makes LUNs to report the same set
  of IDs, independently from the port through which it is accessed, as
  required by SCSI specifications.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_frontend.c
  head/sys/cam/ctl/ctl_frontend.h
  head/sys/cam/ctl/ctl_frontend_cam_sim.c
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/cam/ctl/ctl_private.h
  head/sys/cam/ctl/scsi_ctl.c
  head/usr.sbin/ctladm/ctladm.8
  head/usr.sbin/ctld/kernel.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sat Jul  5 19:02:53 2014	(r268292)
+++ head/sys/cam/ctl/ctl.c	Sat Jul  5 19:30:20 2014	(r268293)
@@ -4293,7 +4293,11 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft
 {
 	struct ctl_lun *nlun, *lun;
 	struct ctl_port *port;
+	struct scsi_vpd_id_descriptor *desc;
+	struct scsi_vpd_id_t10 *t10id;
+	const char *scsiname, *vendor;
 	int lun_number, i, lun_malloced;
+	int devidlen, idlen1, idlen2, len;
 
 	if (be_lun == NULL)
 		return (EINVAL);
@@ -4325,6 +4329,43 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft
 	if (lun_malloced)
 		lun->flags = CTL_LUN_MALLOCED;
 
+	/* Generate LUN ID. */
+	devidlen = max(CTL_DEVID_MIN_LEN,
+	    strnlen(be_lun->device_id, CTL_DEVID_LEN));
+	idlen1 = sizeof(*t10id) + devidlen;
+	len = sizeof(struct scsi_vpd_id_descriptor) + idlen1;
+	scsiname = ctl_get_opt(&be_lun->options, "scsiname");
+	if (scsiname != NULL) {
+		idlen2 = roundup2(strlen(scsiname) + 1, 4);
+		len += sizeof(struct scsi_vpd_id_descriptor) + idlen2;
+	}
+	lun->lun_devid = malloc(sizeof(struct ctl_devid) + len,
+	    M_CTL, M_WAITOK | M_ZERO);
+	lun->lun_devid->len = len;
+	desc = (struct scsi_vpd_id_descriptor *)lun->lun_devid->data;
+	desc->proto_codeset = SVPD_ID_CODESET_ASCII;
+	desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10;
+	desc->length = idlen1;
+	t10id = (struct scsi_vpd_id_t10 *)&desc->identifier[0];
+	memset(t10id->vendor, ' ', sizeof(t10id->vendor));
+	if ((vendor = ctl_get_opt(&be_lun->options, "vendor")) == NULL) {
+		strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor));
+	} else {
+		strncpy(t10id->vendor, vendor,
+		    min(sizeof(t10id->vendor), strlen(vendor)));
+	}
+	strncpy((char *)t10id->vendor_spec_id,
+	    (char *)be_lun->device_id, devidlen);
+	if (scsiname != NULL) {
+		desc = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] +
+		    desc->length);
+		desc->proto_codeset = SVPD_ID_CODESET_UTF8;
+		desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN |
+		    SVPD_ID_TYPE_SCSI_NAME;
+		desc->length = idlen2;
+		strlcpy(desc->identifier, scsiname, idlen2);
+	}
+
 	mtx_lock(&ctl_softc->ctl_lock);
 	/*
 	 * See if the caller requested a particular LUN number.  If so, see
@@ -4546,6 +4587,7 @@ ctl_free_lun(struct ctl_lun *lun)
 	lun->be_lun->lun_shutdown(lun->be_lun->be_lun);
 
 	mtx_destroy(&lun->lun_lock);
+	free(lun->lun_devid, M_CTL);
 	if (lun->flags & CTL_LUN_MALLOCED)
 		free(lun, M_CTL);
 
@@ -9624,39 +9666,29 @@ static int
 ctl_inquiry_evpd_devid(struct ctl_scsiio *ctsio, int alloc_len)
 {
 	struct scsi_vpd_device_id *devid_ptr;
-	struct scsi_vpd_id_descriptor *desc, *desc1;
-	struct scsi_vpd_id_descriptor *desc2, *desc3; /* for types 4h and 5h */
-	struct scsi_vpd_id_t10 *t10id;
+	struct scsi_vpd_id_descriptor *desc;
 	struct ctl_softc *ctl_softc;
 	struct ctl_lun *lun;
 	struct ctl_port *port;
-	char *val;
-	int data_len, devid_len;
+	int data_len;
+	uint8_t proto;
 
 	ctl_softc = control_softc;
 
 	port = ctl_softc->ctl_ports[ctl_port_idx(ctsio->io_hdr.nexus.targ_port)];
-
-	if (port->devid != NULL)
-		return ((port->devid)(ctsio, alloc_len));
-
 	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
 
-	if (lun == NULL) {
-		devid_len = CTL_DEVID_MIN_LEN;
-	} else {
-		devid_len = max(CTL_DEVID_MIN_LEN,
-		    strnlen(lun->be_lun->device_id, CTL_DEVID_LEN));
-	}
-
 	data_len = sizeof(struct scsi_vpd_device_id) +
-		sizeof(struct scsi_vpd_id_descriptor) +
-		sizeof(struct scsi_vpd_id_t10) + devid_len +
-		sizeof(struct scsi_vpd_id_descriptor) + CTL_WWPN_LEN +
-		sizeof(struct scsi_vpd_id_descriptor) +
+	    sizeof(struct scsi_vpd_id_descriptor) +
 		sizeof(struct scsi_vpd_id_rel_trgt_port_id) +
-		sizeof(struct scsi_vpd_id_descriptor) +
+	    sizeof(struct scsi_vpd_id_descriptor) +
 		sizeof(struct scsi_vpd_id_trgt_port_grp_id);
+	if (lun && lun->lun_devid)
+		data_len += lun->lun_devid->len;
+	if (port->port_devid)
+		data_len += port->port_devid->len;
+	if (port->target_devid)
+		data_len += port->target_devid->len;
 
 	ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
 	devid_ptr = (struct scsi_vpd_device_id *)ctsio->kern_data_ptr;
@@ -9675,15 +9707,6 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
 	ctsio->kern_rel_offset = 0;
 	ctsio->kern_sg_entries = 0;
 
-	desc = (struct scsi_vpd_id_descriptor *)devid_ptr->desc_list;
-	t10id = (struct scsi_vpd_id_t10 *)&desc->identifier[0];
-	desc1 = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] +
-		sizeof(struct scsi_vpd_id_t10) + devid_len);
-	desc2 = (struct scsi_vpd_id_descriptor *)(&desc1->identifier[0] +
-	          CTL_WWPN_LEN);
-	desc3 = (struct scsi_vpd_id_descriptor *)(&desc2->identifier[0] +
-	         sizeof(struct scsi_vpd_id_rel_trgt_port_id));
-
 	/*
 	 * The control device is always connected.  The disk device, on the
 	 * other hand, may not be online all the time.
@@ -9693,112 +9716,69 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
 				     lun->be_lun->lun_type;
 	else
 		devid_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT;
-
 	devid_ptr->page_code = SVPD_DEVICE_ID;
-
 	scsi_ulto2b(data_len - 4, devid_ptr->length);
 
-	/*
-	 * For Fibre channel,
-	 */
 	if (port->port_type == CTL_PORT_FC)
-	{
-		desc->proto_codeset = (SCSI_PROTO_FC << 4) |
-				      SVPD_ID_CODESET_ASCII;
-        	desc1->proto_codeset = (SCSI_PROTO_FC << 4) |
-		              SVPD_ID_CODESET_BINARY;
-	}
+		proto = SCSI_PROTO_FC << 4;
+	else if (port->port_type == CTL_PORT_ISCSI)
+		proto = SCSI_PROTO_ISCSI << 4;
 	else
-	{
-		desc->proto_codeset = (SCSI_PROTO_SPI << 4) |
-				      SVPD_ID_CODESET_ASCII;
-        	desc1->proto_codeset = (SCSI_PROTO_SPI << 4) |
-		              SVPD_ID_CODESET_BINARY;
-	}
-	desc2->proto_codeset = desc3->proto_codeset = desc1->proto_codeset;
+		proto = SCSI_PROTO_SPI << 4;
+	desc = (struct scsi_vpd_id_descriptor *)devid_ptr->desc_list;
 
 	/*
 	 * We're using a LUN association here.  i.e., this device ID is a
 	 * per-LUN identifier.
 	 */
-	desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10;
-	desc->length = sizeof(*t10id) + devid_len;
-	if (lun == NULL || (val = ctl_get_opt(&lun->be_lun->options,
-	    "vendor")) == NULL) {
-		strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor));
-	} else {
-		memset(t10id->vendor, ' ', sizeof(t10id->vendor));
-		strncpy(t10id->vendor, val,
-		    min(sizeof(t10id->vendor), strlen(val)));
+	if (lun && lun->lun_devid) {
+		memcpy(desc, lun->lun_devid->data, lun->lun_devid->len);
+		desc = (struct scsi_vpd_id_descriptor *)((uint8_t *)desc +
+		    lun->lun_devid->len);
 	}
 
 	/*
-	 * desc1 is for the WWPN which is a port asscociation.
+	 * This is for the WWPN which is a port association.
 	 */
-	desc1->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT | SVPD_ID_TYPE_NAA;
-	desc1->length = CTL_WWPN_LEN;
-	/* XXX Call Reggie's get_WWNN func here then add port # to the end */
-	/* For testing just create the WWPN */
-#if 0
-	ddb_GetWWNN((char *)desc1->identifier);
-
-	/* NOTE: if the port is 0 or 8 we don't want to subtract 1 */
-	/* This is so Copancontrol will return something sane */
-	if (ctsio->io_hdr.nexus.targ_port!=0 &&
-	    ctsio->io_hdr.nexus.targ_port!=8)
-		desc1->identifier[7] += ctsio->io_hdr.nexus.targ_port-1;
-	else
-		desc1->identifier[7] += ctsio->io_hdr.nexus.targ_port;
-#endif
-
-	be64enc(desc1->identifier, port->wwpn);
+	if (port->port_devid) {
+		memcpy(desc, port->port_devid->data, port->port_devid->len);
+		desc = (struct scsi_vpd_id_descriptor *)((uint8_t *)desc +
+		    port->port_devid->len);
+	}
 
 	/*
-	 * desc2 is for the Relative Target Port(type 4h) identifier
+	 * This is for the Relative Target Port(type 4h) identifier
 	 */
-	desc2->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT
-	                 | SVPD_ID_TYPE_RELTARG;
-	desc2->length = 4;
-//#if 0
-	/* NOTE: if the port is 0 or 8 we don't want to subtract 1 */
-	/* This is so Copancontrol will return something sane */
-	if (ctsio->io_hdr.nexus.targ_port!=0 &&
-	    ctsio->io_hdr.nexus.targ_port!=8)
-		desc2->identifier[3] = ctsio->io_hdr.nexus.targ_port - 1;
-	else
-	        desc2->identifier[3] = ctsio->io_hdr.nexus.targ_port;
-//#endif
+	desc->proto_codeset = proto | SVPD_ID_CODESET_BINARY;
+	desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
+	    SVPD_ID_TYPE_RELTARG;
+	desc->length = 4;
+	scsi_ulto2b(ctsio->io_hdr.nexus.targ_port, &desc->identifier[2]);
+	desc = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] +
+	    sizeof(struct scsi_vpd_id_rel_trgt_port_id));
 
 	/*
-	 * desc3 is for the Target Port Group(type 5h) identifier
+	 * This is for the Target Port Group(type 5h) identifier
 	 */
-	desc3->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT
-	                 | SVPD_ID_TYPE_TPORTGRP;
-	desc3->length = 4;
+	desc->proto_codeset = proto | SVPD_ID_CODESET_BINARY;
+	desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
+	    SVPD_ID_TYPE_TPORTGRP;
+	desc->length = 4;
 	if (ctsio->io_hdr.nexus.targ_port < CTL_MAX_PORTS || ctl_is_single)
-		desc3->identifier[3] = 1;
+		scsi_ulto2b(1, &desc->identifier[2]);
 	else
-		desc3->identifier[3] = 2;
+		scsi_ulto2b(2, &desc->identifier[2]);
+	desc = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] +
+	    sizeof(struct scsi_vpd_id_trgt_port_grp_id));
 
 	/*
-	 * If we've actually got a backend, copy the device id from the
-	 * per-LUN data.  Otherwise, set it to all spaces.
+	 * This is for the Target identifier
 	 */
-	if (lun != NULL) {
-		/*
-		 * Copy the backend's LUN ID.
-		 */
-		strncpy((char *)t10id->vendor_spec_id,
-			(char *)lun->be_lun->device_id, devid_len);
-	} else {
-		/*
-		 * No backend, set this to spaces.
-		 */
-		memset(t10id->vendor_spec_id, 0x20, devid_len);
+	if (port->target_devid) {
+		memcpy(desc, port->target_devid->data, port->target_devid->len);
 	}
 
 	ctsio->scsi_status = SCSI_STATUS_OK;
-
 	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
 	ctsio->be_move_done = ctl_config_move_done;
 	ctl_datamove((union ctl_io *)ctsio);

Modified: head/sys/cam/ctl/ctl_frontend.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend.c	Sat Jul  5 19:02:53 2014	(r268292)
+++ head/sys/cam/ctl/ctl_frontend.c	Sat Jul  5 19:30:20 2014	(r268293)
@@ -219,6 +219,11 @@ ctl_port_deregister(struct ctl_port *por
 	ctl_pool_free(pool);
 	ctl_free_opts(&port->options);
 
+	free(port->port_devid, M_CTL);
+	port->port_devid = NULL;
+	free(port->target_devid, M_CTL);
+	port->target_devid = NULL;
+
 bailout:
 	return (retval);
 }
@@ -227,11 +232,49 @@ void
 ctl_port_set_wwns(struct ctl_port *port, int wwnn_valid, uint64_t wwnn,
 		      int wwpn_valid, uint64_t wwpn)
 {
-	if (wwnn_valid)
+	struct scsi_vpd_id_descriptor *desc;
+	int len, proto;
+
+	if (port->port_type == CTL_PORT_FC)
+		proto = SCSI_PROTO_FC << 4;
+	else if (port->port_type == CTL_PORT_ISCSI)
+		proto = SCSI_PROTO_ISCSI << 4;
+	else
+		proto = SCSI_PROTO_SPI << 4;
+
+	if (wwnn_valid) {
 		port->wwnn = wwnn;
 
-	if (wwpn_valid)
+		free(port->target_devid, M_CTL);
+
+		len = sizeof(struct scsi_vpd_device_id) + CTL_WWPN_LEN;
+		port->target_devid = malloc(sizeof(struct ctl_devid) + len,
+		    M_CTL, M_WAITOK | M_ZERO);
+		port->target_devid->len = len;
+		desc = (struct scsi_vpd_id_descriptor *)port->target_devid->data;
+		desc->proto_codeset = proto | SVPD_ID_CODESET_BINARY;
+		desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_TARGET |
+		    SVPD_ID_TYPE_NAA;
+		desc->length = CTL_WWPN_LEN;
+		scsi_u64to8b(port->wwnn, desc->identifier);
+	}
+
+	if (wwpn_valid) {
 		port->wwpn = wwpn;
+
+		free(port->port_devid, M_CTL);
+
+		len = sizeof(struct scsi_vpd_device_id) + CTL_WWPN_LEN;
+		port->port_devid = malloc(sizeof(struct ctl_devid) + len,
+		    M_CTL, M_WAITOK | M_ZERO);
+		port->port_devid->len = len;
+		desc = (struct scsi_vpd_id_descriptor *)port->port_devid->data;
+		desc->proto_codeset = proto | SVPD_ID_CODESET_BINARY;
+		desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
+		    SVPD_ID_TYPE_NAA;
+		desc->length = CTL_WWPN_LEN;
+		scsi_u64to8b(port->wwpn, desc->identifier);
+	}
 }
 
 void

Modified: head/sys/cam/ctl/ctl_frontend.h
==============================================================================
--- head/sys/cam/ctl/ctl_frontend.h	Sat Jul  5 19:02:53 2014	(r268292)
+++ head/sys/cam/ctl/ctl_frontend.h	Sat Jul  5 19:30:20 2014	(r268293)
@@ -53,7 +53,6 @@ typedef int (*targ_func_t)(void *arg, st
 typedef	int (*lun_func_t)(void *arg, struct ctl_id targ_id, int lun_id);
 typedef int (*fe_ioctl_t)(struct cdev *dev, u_long cmd, caddr_t addr, int flag,
 			  struct thread *td);
-typedef int (*fe_devid_t)(struct ctl_scsiio *ctsio, int alloc_len);
 
 #define CTL_FRONTEND_DECLARE(name, driver) \
 	static int name ## _modevent(module_t mod, int type, void *data) \
@@ -218,7 +217,6 @@ struct ctl_port {
 	void		*onoff_arg;		/* passed to CTL */
 	lun_func_t	lun_enable;		/* passed to CTL */
 	lun_func_t	lun_disable;		/* passed to CTL */
-	fe_devid_t	devid;			/* passed to CTL */
 	void		*targ_lun_arg;		/* passed to CTL */
 	void		(*fe_datamove)(union ctl_io *io); /* passed to CTL */
 	void		(*fe_done)(union ctl_io *io); /* passed to CTL */
@@ -231,6 +229,8 @@ struct ctl_port {
 	uint64_t	wwpn;			/* set by CTL before online */
 	ctl_port_status	status;			/* used by CTL */
 	ctl_options_t	options;		/* passed to CTL */
+	struct ctl_devid *port_devid;		/* passed to CTL */
+	struct ctl_devid *target_devid;		/* passed to CTL */
 	STAILQ_ENTRY(ctl_port) fe_links;	/* used by CTL */
 	STAILQ_ENTRY(ctl_port) links;		/* used by CTL */
 };

Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_cam_sim.c	Sat Jul  5 19:02:53 2014	(r268292)
+++ head/sys/cam/ctl/ctl_frontend_cam_sim.c	Sat Jul  5 19:30:20 2014	(r268293)
@@ -193,8 +193,7 @@ cfcs_init(void)
 			/* Company ID */ 0x5000000000000000ULL |
 			/* NL-Port */    0x0300;
 		softc->wwpn = softc->wwnn + port->targ_port + 1;
-		port->wwnn = softc->wwnn;
-		port->wwpn = softc->wwpn;
+		ctl_port_set_wwns(port, true, softc->wwnn, true, softc->wwpn);
 	} else {
 		softc->wwnn = port->wwnn;
 		softc->wwpn = port->wwpn;

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Sat Jul  5 19:02:53 2014	(r268292)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Sat Jul  5 19:30:20 2014	(r268293)
@@ -151,7 +151,6 @@ static int	cfiscsi_lun_disable(void *arg
 		    struct ctl_id target_id, int lun_id);
 static int	cfiscsi_ioctl(struct cdev *dev,
 		    u_long cmd, caddr_t addr, int flag, struct thread *td);
-static int	cfiscsi_devid(struct ctl_scsiio *ctsio, int alloc_len);
 static void	cfiscsi_datamove(union ctl_io *io);
 static void	cfiscsi_done(union ctl_io *io);
 static uint32_t	cfiscsi_map_lun(void *arg, uint32_t lun);
@@ -1948,8 +1947,9 @@ cfiscsi_ioctl_port_create(struct ctl_req
 	struct cfiscsi_target *ct;
 	struct ctl_port *port;
 	const char *target, *alias, *tag;
+	struct scsi_vpd_id_descriptor *desc;
 	ctl_options_t opts;
-	int retval;
+	int retval, len, idlen;
 
 	ctl_init_opts(&opts, req->num_args, req->kern_args);
 	target = ctl_get_opt(&opts, "cfiscsi_target");
@@ -1994,7 +1994,6 @@ cfiscsi_ioctl_port_create(struct ctl_req
 	port->lun_enable = cfiscsi_lun_enable;
 	port->lun_disable = cfiscsi_lun_disable;
 	port->targ_lun_arg = ct;
-	port->devid = cfiscsi_devid;
 	port->fe_datamove = cfiscsi_datamove;
 	port->fe_done = cfiscsi_done;
 
@@ -2006,10 +2005,41 @@ cfiscsi_ioctl_port_create(struct ctl_req
 	port->options = opts;
 	STAILQ_INIT(&opts);
 
+	/* Generate Port ID. */
+	idlen = strlen(target) + strlen(",t,0x0001") + 1;
+	idlen = roundup2(idlen, 4);
+	len = sizeof(struct scsi_vpd_device_id) + idlen;
+	port->port_devid = malloc(sizeof(struct ctl_devid) + len,
+	    M_CTL, M_WAITOK | M_ZERO);
+	port->port_devid->len = len;
+	desc = (struct scsi_vpd_id_descriptor *)port->port_devid->data;
+	desc->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8;
+	desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
+	    SVPD_ID_TYPE_SCSI_NAME;
+	desc->length = idlen;
+	snprintf(desc->identifier, idlen, "%s,t,0x%4.4x",
+	    target, port->virtual_port);
+
+	/* Generate Target ID. */
+	idlen = strlen(target) + 1;
+	idlen = roundup2(idlen, 4);
+	len = sizeof(struct scsi_vpd_device_id) + idlen;
+	port->target_devid = malloc(sizeof(struct ctl_devid) + len,
+	    M_CTL, M_WAITOK | M_ZERO);
+	port->target_devid->len = len;
+	desc = (struct scsi_vpd_id_descriptor *)port->target_devid->data;
+	desc->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8;
+	desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_TARGET |
+	    SVPD_ID_TYPE_SCSI_NAME;
+	desc->length = idlen;
+	strlcpy(desc->identifier, target, idlen);
+
 	retval = ctl_port_register(port, /*master_SC*/ 1);
 	if (retval != 0) {
 		ctl_free_opts(&port->options);
 		cfiscsi_target_release(ct);
+		free(port->port_devid, M_CFISCSI);
+		free(port->target_devid, M_CFISCSI);
 		req->status = CTL_LUN_ERROR;
 		snprintf(req->error_str, sizeof(req->error_str),
 		    "ctl_frontend_register() failed with error %d", retval);
@@ -2136,206 +2166,6 @@ cfiscsi_ioctl(struct cdev *dev,
 	return (0);
 }
 
-static int
-cfiscsi_devid(struct ctl_scsiio *ctsio, int alloc_len)
-{
-	struct cfiscsi_session *cs;
-	struct scsi_vpd_device_id *devid_ptr;
-	struct scsi_vpd_id_descriptor *desc, *desc1, *desc2, *desc3, *desc4;
-	struct scsi_vpd_id_descriptor *desc5;
-	struct scsi_vpd_id_t10 *t10id;
-	struct ctl_lun *lun;
-	const struct icl_pdu *request;
-	int i, ret;
-	char *val;
-	size_t data_len, devid_len, wwnn_len, wwpn_len, lun_name_len;
-
-	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
-	request = ctsio->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr;
-	cs = PDU_SESSION(request);
-
-	wwpn_len = strlen(cs->cs_target->ct_name);
-	wwpn_len += strlen(",t,0x0001");
-	wwpn_len += 1; /* '\0' */
-	if ((wwpn_len % 4) != 0)
-		wwpn_len += (4 - (wwpn_len % 4));
-
-	wwnn_len = strlen(cs->cs_target->ct_name);
-	wwnn_len += 1; /* '\0' */
-	if ((wwnn_len % 4) != 0)
-		wwnn_len += (4 - (wwnn_len % 4));
-
-	if (lun == NULL) {
-		devid_len = CTL_DEVID_MIN_LEN;
-		lun_name_len = 0;
-	} else {
-		devid_len = max(CTL_DEVID_MIN_LEN,
-		    strnlen(lun->be_lun->device_id, CTL_DEVID_LEN));
-		lun_name_len = strlen(cs->cs_target->ct_name);
-		lun_name_len += strlen(",lun,XXXXXXXX");
-		lun_name_len += 1; /* '\0' */
-		if ((lun_name_len % 4) != 0)
-			lun_name_len += (4 - (lun_name_len % 4));
-	}
-
-	data_len = sizeof(struct scsi_vpd_device_id) +
-		sizeof(struct scsi_vpd_id_descriptor) +
-		sizeof(struct scsi_vpd_id_t10) + devid_len +
-		sizeof(struct scsi_vpd_id_descriptor) + lun_name_len +
-		sizeof(struct scsi_vpd_id_descriptor) + wwnn_len +
-		sizeof(struct scsi_vpd_id_descriptor) + wwpn_len +
-		sizeof(struct scsi_vpd_id_descriptor) +
-		sizeof(struct scsi_vpd_id_rel_trgt_port_id) +
-		sizeof(struct scsi_vpd_id_descriptor) +
-		sizeof(struct scsi_vpd_id_trgt_port_grp_id);
-
-	ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
-	devid_ptr = (struct scsi_vpd_device_id *)ctsio->kern_data_ptr;
-	ctsio->kern_sg_entries = 0;
-
-	if (data_len < alloc_len) {
-		ctsio->residual = alloc_len - data_len;
-		ctsio->kern_data_len = data_len;
-		ctsio->kern_total_len = data_len;
-	} else {
-		ctsio->residual = 0;
-		ctsio->kern_data_len = alloc_len;
-		ctsio->kern_total_len = alloc_len;
-	}
-	ctsio->kern_data_resid = 0;
-	ctsio->kern_rel_offset = 0;
-	ctsio->kern_sg_entries = 0;
-
-	desc = (struct scsi_vpd_id_descriptor *)devid_ptr->desc_list;
-	t10id = (struct scsi_vpd_id_t10 *)&desc->identifier[0];
-	desc1 = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] +
-	    sizeof(struct scsi_vpd_id_t10) + devid_len);
-	desc2 = (struct scsi_vpd_id_descriptor *)(&desc1->identifier[0] +
-	    lun_name_len);
-	desc3 = (struct scsi_vpd_id_descriptor *)(&desc2->identifier[0] +
-	    wwnn_len);
-	desc4 = (struct scsi_vpd_id_descriptor *)(&desc3->identifier[0] +
-	    wwpn_len);
-	desc5 = (struct scsi_vpd_id_descriptor *)(&desc4->identifier[0] +
-	    sizeof(struct scsi_vpd_id_rel_trgt_port_id));
-
-	if (lun != NULL)
-		devid_ptr->device = (SID_QUAL_LU_CONNECTED << 5) |
-		    lun->be_lun->lun_type;
-	else
-		devid_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT;
-
-	devid_ptr->page_code = SVPD_DEVICE_ID;
-
-	scsi_ulto2b(data_len - 4, devid_ptr->length);
-
-	/*
-	 * We're using a LUN association here.  i.e., this device ID is a
-	 * per-LUN identifier.
-	 */
-	desc->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_ASCII;
-	desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10;
-	desc->length = sizeof(*t10id) + devid_len;
-	if (lun == NULL || (val = ctl_get_opt(&lun->be_lun->options,
-	    "vendor")) == NULL) {
-		strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor));
-	} else {
-		memset(t10id->vendor, ' ', sizeof(t10id->vendor));
-		strncpy(t10id->vendor, val,
-		    min(sizeof(t10id->vendor), strlen(val)));
-	}
-
-	/*
-	 * If we've actually got a backend, copy the device id from the
-	 * per-LUN data.  Otherwise, set it to all spaces.
-	 */
-	if (lun != NULL) {
-		/*
-		 * Copy the backend's LUN ID.
-		 */
-		strncpy((char *)t10id->vendor_spec_id,
-		    (char *)lun->be_lun->device_id, devid_len);
-	} else {
-		/*
-		 * No backend, set this to spaces.
-		 */
-		memset(t10id->vendor_spec_id, 0x20, devid_len);
-	}
-
-	/*
-	 * desc1 is for the unique LUN name.
-	 *
-	 * XXX: According to SPC-3, LUN must report the same ID through
-	 *      all the ports.  The code below, however, reports the
-	 *      ID only via iSCSI.
-	 */
-	desc1->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8;
-	desc1->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN |
-		SVPD_ID_TYPE_SCSI_NAME;
-	desc1->length = lun_name_len;
-	if (lun != NULL) {
-		/*
-		 * Find the per-target LUN number.
-		 */
-		for (i = 0; i < CTL_MAX_LUNS; i++) {
-			if (cs->cs_target->ct_luns[i] == lun->lun)
-				break;
-		}
-		KASSERT(i < CTL_MAX_LUNS,
-		    ("lun %jd not found", (uintmax_t)lun->lun));
-		ret = snprintf(desc1->identifier, lun_name_len, "%s,lun,%d",
-		    cs->cs_target->ct_name, i);
-		KASSERT(ret > 0 && ret <= lun_name_len, ("bad snprintf"));
-	} else {
-		KASSERT(lun_name_len == 0, ("no lun, but lun_name_len != 0"));
-	}
-
-	/*
-	 * desc2 is for the Target Name.
-	 */
-	desc2->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8;
-	desc2->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_TARGET |
-	    SVPD_ID_TYPE_SCSI_NAME;
-	desc2->length = wwnn_len;
-	snprintf(desc2->identifier, wwnn_len, "%s", cs->cs_target->ct_name);
-
-	/*
-	 * desc3 is for the WWPN which is a port asscociation.
-	 */
-	desc3->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_UTF8;
-	desc3->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
-	    SVPD_ID_TYPE_SCSI_NAME;
-	desc3->length = wwpn_len;
-	snprintf(desc3->identifier, wwpn_len, "%s,t,0x%4.4x",
-	    cs->cs_target->ct_name, cs->cs_portal_group_tag);
-
-	/*
-	 * desc3 is for the Relative Target Port(type 4h) identifier
-	 */
-	desc4->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_BINARY;
-	desc4->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
-	    SVPD_ID_TYPE_RELTARG;
-	desc4->length = 4;
-	desc4->identifier[3] = 1;
-
-	/*
-	 * desc4 is for the Target Port Group(type 5h) identifier
-	 */
-	desc5->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_BINARY;
-	desc5->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
-	    SVPD_ID_TYPE_TPORTGRP;
-	desc5->length = 4;
-	desc5->identifier[3] = 1;
-
-	ctsio->scsi_status = SCSI_STATUS_OK;
-
-	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
-	ctsio->be_move_done = ctl_config_move_done;
-	ctl_datamove((union ctl_io *)ctsio);
-
-	return (CTL_RETVAL_COMPLETE);
-}
-
 static void
 cfiscsi_target_hold(struct cfiscsi_target *ct)
 {

Modified: head/sys/cam/ctl/ctl_private.h
==============================================================================
--- head/sys/cam/ctl/ctl_private.h	Sat Jul  5 19:02:53 2014	(r268292)
+++ head/sys/cam/ctl/ctl_private.h	Sat Jul  5 19:30:20 2014	(r268293)
@@ -367,6 +367,11 @@ struct ctl_per_res_info {
 #define CTL_PR_ALL_REGISTRANTS  0xFFFF
 #define CTL_PR_NO_RESERVATION   0xFFF0
 
+struct ctl_devid {
+	int		len;
+	uint8_t		data[];
+};
+
 /*
  * For report target port groups.
  */
@@ -402,6 +407,7 @@ struct ctl_lun {
 	uint16_t        		pr_res_idx;
 	uint8_t				res_type;
 	uint8_t				write_buffer[524288];
+	struct ctl_devid		*lun_devid;
 };
 
 typedef enum {

Modified: head/sys/cam/ctl/scsi_ctl.c
==============================================================================
--- head/sys/cam/ctl/scsi_ctl.c	Sat Jul  5 19:02:53 2014	(r268292)
+++ head/sys/cam/ctl/scsi_ctl.c	Sat Jul  5 19:30:20 2014	(r268293)
@@ -1732,10 +1732,9 @@ ctlfe_onoffline(void *arg, int online)
 			 * using with the frontend code so it's reported
 			 * accurately.
 			 */
-			bus_softc->port.wwnn = 
-				ccb->knob.xport_specific.fc.wwnn;
-			bus_softc->port.wwpn = 
-				ccb->knob.xport_specific.fc.wwpn;
+			ctl_port_set_wwns(&bus_softc->port,
+			    true, ccb->knob.xport_specific.fc.wwnn,
+			    true, ccb->knob.xport_specific.fc.wwpn);
 			set_wwnn = 1;
 #else /* RANDOM_WWNN */
 			/*
@@ -1751,10 +1750,9 @@ ctlfe_onoffline(void *arg, int online)
 					bus_softc->port.wwpn;
 				set_wwnn = 1;
 			} else {
-				bus_softc->port.wwnn =
-					ccb->knob.xport_specific.fc.wwnn;
-				bus_softc->port.wwpn =
-					ccb->knob.xport_specific.fc.wwpn;
+				ctl_port_set_wwns(&bus_softc->port,
+				    true, ccb->knob.xport_specific.fc.wwnn,
+				    true, ccb->knob.xport_specific.fc.wwpn);
 			}
 #endif /* RANDOM_WWNN */
 

Modified: head/usr.sbin/ctladm/ctladm.8
==============================================================================
--- head/usr.sbin/ctladm/ctladm.8	Sat Jul  5 19:02:53 2014	(r268292)
+++ head/usr.sbin/ctladm/ctladm.8	Sat Jul  5 19:30:20 2014	(r268293)
@@ -945,6 +945,8 @@ Specifies LUN vendor string up to 8 char
 Specifies LUN product string up to 16 chars.
 .It Va revision
 Specifies LUN revision string up to 4 chars.
+.It Va scsiname
+Specifies LUN SCSI name string.
 .It Va unmap
 Set to "on", enables UNMAP support for the LUN.
 .El

Modified: head/usr.sbin/ctld/kernel.c
==============================================================================
--- head/usr.sbin/ctld/kernel.c	Sat Jul  5 19:02:53 2014	(r268292)
+++ head/usr.sbin/ctld/kernel.c	Sat Jul  5 19:30:20 2014	(r268293)
@@ -113,7 +113,6 @@ struct cctl_lun {
 	char *serial_number;
 	char *device_id;
 	char *cfiscsi_target;
-	char *cfiscsi_target_alias;
 	int cfiscsi_lun;
 	STAILQ_HEAD(,cctl_lun_nv) attr_list;
 	STAILQ_ENTRY(cctl_lun) links;
@@ -230,9 +229,6 @@ cctl_end_element(void *user_data, const 
 	} else if (strcmp(name, "cfiscsi_target") == 0) {
 		cur_lun->cfiscsi_target = str;
 		str = NULL;
-	} else if (strcmp(name, "cfiscsi_target_alias") == 0) {
-		cur_lun->cfiscsi_target_alias = str;
-		str = NULL;
 	} else if (strcmp(name, "cfiscsi_lun") == 0) {
 		cur_lun->cfiscsi_lun = strtoul(str, NULL, 0);
 	} else if (strcmp(name, "lun") == 0) {
@@ -640,17 +636,6 @@ kernel_lun_add(struct lun *lun)
 		assert(lo != NULL);
 	}
 
-	if (lun->l_target->t_alias != NULL) {
-		lo = lun_option_find(lun, "cfiscsi_target_alias");
-		if (lo != NULL) {
-			lun_option_set(lo, lun->l_target->t_alias);
-		} else {
-			lo = lun_option_new(lun, "cfiscsi_target_alias",
-			    lun->l_target->t_alias);
-			assert(lo != NULL);
-		}
-	}
-
 	asprintf(&tmp, "%d", lun->l_lun);
 	if (tmp == NULL)
 		log_errx(1, "asprintf");
@@ -664,6 +649,19 @@ kernel_lun_add(struct lun *lun)
 		assert(lo != NULL);
 	}
 
+	asprintf(&tmp, "%s,lun,%d", lun->l_target->t_name, lun->l_lun);
+	if (tmp == NULL)
+		log_errx(1, "asprintf");
+	lo = lun_option_find(lun, "scsiname");
+	if (lo != NULL) {
+		lun_option_set(lo, tmp);
+		free(tmp);
+	} else {
+		lo = lun_option_new(lun, "scsiname", tmp);
+		free(tmp);
+		assert(lo != NULL);
+	}
+
 	num_options = 0;
 	TAILQ_FOREACH(lo, &lun->l_options, lo_next)
 		num_options++;

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 19:31:23 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0B02E951;
 Sat,  5 Jul 2014 19:31:23 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EC40825E8;
 Sat,  5 Jul 2014 19:31:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s65JVMMV028834;
 Sat, 5 Jul 2014 19:31:22 GMT (envelope-from loos@svn.freebsd.org)
Received: (from loos@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s65JVMD4028833;
 Sat, 5 Jul 2014 19:31:22 GMT (envelope-from loos@svn.freebsd.org)
Message-Id: <201407051931.s65JVMD4028833@svn.freebsd.org>
From: Luiz Otavio O Souza 
Date: Sat, 5 Jul 2014 19:31:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268294 - head/sys/dev/etherswitch/rtl8366
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 19:31:23 -0000

Author: loos
Date: Sat Jul  5 19:31:22 2014
New Revision: 268294
URL: http://svnweb.freebsd.org/changeset/base/268294

Log:
  Allow the PVID setting on CPU port.
  
  Return our static list of supported media for the CPU port.
  
  Tested on TP-Link 1043ND.

Modified:
  head/sys/dev/etherswitch/rtl8366/rtl8366rb.c

Modified: head/sys/dev/etherswitch/rtl8366/rtl8366rb.c
==============================================================================
--- head/sys/dev/etherswitch/rtl8366/rtl8366rb.c	Sat Jul  5 19:30:20 2014	(r268293)
+++ head/sys/dev/etherswitch/rtl8366/rtl8366rb.c	Sat Jul  5 19:31:22 2014	(r268294)
@@ -579,13 +579,19 @@ rtl_getport(device_t dev, etherswitch_po
 	} else {
 		/* fill in fixed values for CPU port */
 		p->es_flags |= ETHERSWITCH_PORT_CPU;
-		ifmr->ifm_count = 0;
 		smi_read(dev, RTL8366RB_PLSR_BASE + (RTL8366RB_NUM_PHYS)/2, &v, RTL_WAITOK);
 		v = v >> (8 * ((RTL8366RB_NUM_PHYS) % 2));
 		rtl8366rb_update_ifmedia(v, &ifmr->ifm_status, &ifmr->ifm_active);
 		ifmr->ifm_current = ifmr->ifm_active;
 		ifmr->ifm_mask = 0;
 		ifmr->ifm_status = IFM_ACTIVE | IFM_AVALID;
+		/* Return our static media list. */
+		if (ifmr->ifm_count > 0) {
+			ifmr->ifm_count = 1;
+			ifmr->ifm_ulist[0] = IFM_MAKEWORD(IFM_ETHER, IFM_1000_T,
+			    IFM_FDX, 0);
+		} else
+			ifmr->ifm_count = 0;
 	}
 	return (0);
 }
@@ -598,7 +604,7 @@ rtl_setport(device_t dev, etherswitch_po
 	struct ifmedia *ifm;
 	struct mii_data *mii;
 
-	if (p->es_port < 0 || p->es_port >= RTL8366RB_NUM_PHYS)
+	if (p->es_port < 0 || p->es_port >= RTL8366RB_NUM_PORTS)
 		return (ENXIO);
 	sc = device_get_softc(dev);
 	vlangroup = -1;

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 19:37:39 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2D5B8F31;
 Sat,  5 Jul 2014 19:37:39 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1AB5B26AD;
 Sat,  5 Jul 2014 19:37:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s65JbcD4029937;
 Sat, 5 Jul 2014 19:37:38 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s65Jbc8O029936;
 Sat, 5 Jul 2014 19:37:38 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201407051937.s65Jbc8O029936@svn.freebsd.org>
From: Gavin Atkinson 
Date: Sat, 5 Jul 2014 19:37:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268295 - head/games/fortune/datfiles
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 19:37:39 -0000

Author: gavin
Date: Sat Jul  5 19:37:38 2014
New Revision: 268295
URL: http://svnweb.freebsd.org/changeset/base/268295

Log:
  Fix equation and limerick to be correct.  NetBSD fixed this 14 years ago
  (src/games/fortune/datfiles/fortunes2 1.7).
  
  PR:		188714
  Submitted by:	ksmakoto dd.iij4u.or.jp
  Reviewed by:	Wolfram Alpha
  MFC after:	3 days

Modified:
  head/games/fortune/datfiles/fortunes

Modified: head/games/fortune/datfiles/fortunes
==============================================================================
--- head/games/fortune/datfiles/fortunes	Sat Jul  5 19:31:22 2014	(r268294)
+++ head/games/fortune/datfiles/fortunes	Sat Jul  5 19:37:38 2014	(r268295)
@@ -570,7 +570,7 @@ writing.  Always pick on the correct idi
 the verb.  Last but not least, avoid cliches like the plague; seek
 viable alternatives.
 %
-	      1/2
+	      1/3
 	 /\(3)
 	 |     2			  1/3
 	 |    z dz cos(3 * PI / 9) = ln (e   )
@@ -578,7 +578,7 @@ viable alternatives.
 	\/ 1
 
 The integral of z squared, dz
-From 1 to the square root of 3
+From 1 to the cube root of 3
 	Times the cosine
 	Of 3 PI over nine
 Is the log of the cube root of e

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 19:49:32 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7F3D9523;
 Sat,  5 Jul 2014 19:49:32 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 52AB62784;
 Sat,  5 Jul 2014 19:49:32 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s65JnWUE034865;
 Sat, 5 Jul 2014 19:49:32 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s65JnWvq034864;
 Sat, 5 Jul 2014 19:49:32 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201407051949.s65JnWvq034864@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 5 Jul 2014 19:49:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268297 - head/lib/libthr
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 19:49:32 -0000

Author: rpaulo
Date: Sat Jul  5 19:49:31 2014
New Revision: 268297
URL: http://svnweb.freebsd.org/changeset/base/268297

Log:
  Add the DTrace probe definitions for plockstat support.
  
  This will be connected to the system later.
  
  Sponsored by:	The FreeBSD Foundation

Added:
  head/lib/libthr/plockstat.d   (contents, props changed)

Added: head/lib/libthr/plockstat.d
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libthr/plockstat.d	Sat Jul  5 19:49:31 2014	(r268297)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2010 The FreeBSD Foundation 
+ * All rights reserved. 
+ * 
+ * This software was developed by Rui Paulo under sponsorship from the
+ * FreeBSD Foundation. 
+ *  
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions 
+ * are met: 
+ * 1. Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer. 
+ * 2. Redistributions in binary form must reproduce the above copyright 
+ *    notice, this list of conditions and the following disclaimer in the 
+ *    documentation and/or other materials provided with the distribution. 
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
+ * SUCH DAMAGE. 
+ *
+ * $FreeBSD$
+ */
+
+provider plockstat {
+	probe mutex__acquire(void *mutex, int rec, int spincount);
+	probe mutex__release(void *mutex, int rec);
+	probe mutex__block(void *mutex);
+	probe mutex__spin(void *mutex);
+	probe mutex__spun(void *mutex, int success, int spincount);
+	probe mutex__blocked(void *mutex, int success);
+	probe mutex__error(void *mutex, int err);
+
+	probe rw__acquire(void *lock, int wr);
+	probe rw__release(void *lock, int wr);
+	probe rw__block(void *lock, int wr);
+	probe rw__blocked(void *lock, int wr, int success);
+	probe rw__error(void *lock, int wr, int err);
+};

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 19:53:22 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6C8C580F;
 Sat,  5 Jul 2014 19:53:22 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 599C5281A;
 Sat,  5 Jul 2014 19:53:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s65JrM3r038431;
 Sat, 5 Jul 2014 19:53:22 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s65JrM6V038430;
 Sat, 5 Jul 2014 19:53:22 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201407051953.s65JrM6V038430@svn.freebsd.org>
From: Gavin Atkinson 
Date: Sat, 5 Jul 2014 19:53:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268298 - head/usr.sbin/uhsoctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 19:53:22 -0000

Author: gavin
Date: Sat Jul  5 19:53:21 2014
New Revision: 268298
URL: http://svnweb.freebsd.org/changeset/base/268298

Log:
  Correct format string to fix build of uhsoctl when DEBUG is defined
  
  PR:		185007
  Submitted by:	saper saper.info
  MFC after:	3 days

Modified:
  head/usr.sbin/uhsoctl/uhsoctl.c

Modified: head/usr.sbin/uhsoctl/uhsoctl.c
==============================================================================
--- head/usr.sbin/uhsoctl/uhsoctl.c	Sat Jul  5 19:49:31 2014	(r268297)
+++ head/usr.sbin/uhsoctl/uhsoctl.c	Sat Jul  5 19:53:21 2014	(r268298)
@@ -601,7 +601,7 @@ at_cmd(struct ctx *ctx, const char *resp
 	if (resp != NULL) {
 		l = strlen(resp);
 #ifdef DEBUG
-		fprintf(stderr, "SYNC_EXP: %s (%d)\n", resp, l);
+		fprintf(stderr, "SYNC_EXP: %s (%zd)\n", resp, l);
 #endif
 	}
 

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 20:08:26 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5E05FF66;
 Sat,  5 Jul 2014 20:08:26 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4B035293D;
 Sat,  5 Jul 2014 20:08:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s65K8QXi044306;
 Sat, 5 Jul 2014 20:08:26 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s65K8QnI044305;
 Sat, 5 Jul 2014 20:08:26 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201407052008.s65K8QnI044305@svn.freebsd.org>
From: Gavin Atkinson 
Date: Sat, 5 Jul 2014 20:08:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268299 - head/usr.sbin/uhsoctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 20:08:26 -0000

Author: gavin
Date: Sat Jul  5 20:08:25 2014
New Revision: 268299
URL: http://svnweb.freebsd.org/changeset/base/268299

Log:
  Use %zu not %zd for printing size_t.
  
  PR:		185007
  Submitted by:	saper saper.info
  MFC after:	3 days

Modified:
  head/usr.sbin/uhsoctl/uhsoctl.c

Modified: head/usr.sbin/uhsoctl/uhsoctl.c
==============================================================================
--- head/usr.sbin/uhsoctl/uhsoctl.c	Sat Jul  5 19:53:21 2014	(r268298)
+++ head/usr.sbin/uhsoctl/uhsoctl.c	Sat Jul  5 20:08:25 2014	(r268299)
@@ -601,7 +601,7 @@ at_cmd(struct ctx *ctx, const char *resp
 	if (resp != NULL) {
 		l = strlen(resp);
 #ifdef DEBUG
-		fprintf(stderr, "SYNC_EXP: %s (%zd)\n", resp, l);
+		fprintf(stderr, "SYNC_EXP: %s (%zu)\n", resp, l);
 #endif
 	}
 

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 20:08:35 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C9394133;
 Sat,  5 Jul 2014 20:08:35 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B67C02941;
 Sat,  5 Jul 2014 20:08:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s65K8ZMS044392;
 Sat, 5 Jul 2014 20:08:35 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s65K8ZHX044391;
 Sat, 5 Jul 2014 20:08:35 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201407052008.s65K8ZHX044391@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 5 Jul 2014 20:08:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268300 - head/share/mk
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 20:08:35 -0000

Author: rpaulo
Date: Sat Jul  5 20:08:35 2014
New Revision: 268300
URL: http://svnweb.freebsd.org/changeset/base/268300

Log:
  bsd.dep.mk: add support for generating DTrace header files from .d files.
  
  MFC after:	3 weeks

Modified:
  head/share/mk/bsd.dep.mk

Modified: head/share/mk/bsd.dep.mk
==============================================================================
--- head/share/mk/bsd.dep.mk	Sat Jul  5 20:08:25 2014	(r268299)
+++ head/share/mk/bsd.dep.mk	Sat Jul  5 20:08:35 2014	(r268300)
@@ -78,6 +78,7 @@ ${_S:R}.o: ${_S}
 .endfor
 .endif
 
+# Lexical analyzers
 .for _LSRC in ${SRCS:M*.l:N*/*}
 .for _LC in ${_LSRC:R}.c
 ${_LC}: ${_LSRC}
@@ -90,6 +91,7 @@ CLEANFILES+= ${_LC}
 .endfor
 .endfor
 
+# Yacc grammars
 .for _YSRC in ${SRCS:M*.y:N*/*}
 .for _YC in ${_YSRC:R}.c
 SRCS:=	${SRCS:S/${_YSRC}/${_YC}/}
@@ -117,6 +119,16 @@ ${_YC:R}.o: ${_YC}
 .endif
 .endfor
 .endfor
+
+# DTrace probe definitions
+.for _DSRC in ${SRCS:M*.d:N*/*}
+.for _DH in ${_DSRC:R}.h
+${_DH}: ${_DSRC}
+	${DTRACE} -xnolibs -h -s ${.ALLSRC} 
+SRCS:=	${SRCS:S/${_DSRC}/${_DH}/}
+CLEANFILES+= ${_DH}
+.endfor
+.endfor
 .endif
 
 .if !target(depend)

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 20:16:02 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id DBFD5389;
 Sat,  5 Jul 2014 20:16:02 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C91BC29EE;
 Sat,  5 Jul 2014 20:16:02 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s65KG2lL048928;
 Sat, 5 Jul 2014 20:16:02 GMT (envelope-from loos@svn.freebsd.org)
Received: (from loos@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s65KG2gi048927;
 Sat, 5 Jul 2014 20:16:02 GMT (envelope-from loos@svn.freebsd.org)
Message-Id: <201407052016.s65KG2gi048927@svn.freebsd.org>
From: Luiz Otavio O Souza 
Date: Sat, 5 Jul 2014 20:16:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268301 - head/sbin/etherswitchcfg
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 20:16:03 -0000

Author: loos
Date: Sat Jul  5 20:16:02 2014
New Revision: 268301
URL: http://svnweb.freebsd.org/changeset/base/268301

Log:
  Check the number of returned entries before doing any access to ifm_ulist.

Modified:
  head/sbin/etherswitchcfg/etherswitchcfg.c

Modified: head/sbin/etherswitchcfg/etherswitchcfg.c
==============================================================================
--- head/sbin/etherswitchcfg/etherswitchcfg.c	Sat Jul  5 20:08:35 2014	(r268300)
+++ head/sbin/etherswitchcfg/etherswitchcfg.c	Sat Jul  5 20:16:02 2014	(r268301)
@@ -235,6 +235,8 @@ set_port_media(struct cfg *cfg, char *ar
 	p.es_ifmr.ifm_count = IFMEDIAREQ_NULISTENTRIES;
 	if (ioctl(cfg->fd, IOETHERSWITCHGETPORT, &p) != 0)
 		err(EX_OSERR, "ioctl(IOETHERSWITCHGETPORT)");
+	if (p.es_ifmr.ifm_count == 0)
+		return;
 	subtype = get_media_subtype(IFM_TYPE(ifm_ulist[0]), argv[1]);
 	p.es_ifr.ifr_media = (p.es_ifmr.ifm_current & IFM_IMASK) |
 	        IFM_TYPE(ifm_ulist[0]) | subtype;

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 21:18:34 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E2C4E313;
 Sat,  5 Jul 2014 21:18:34 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CF16F2E2C;
 Sat,  5 Jul 2014 21:18:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s65LIYOZ076815;
 Sat, 5 Jul 2014 21:18:34 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s65LIX4i076808;
 Sat, 5 Jul 2014 21:18:33 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407052118.s65LIX4i076808@svn.freebsd.org>
From: Alexander Motin 
Date: Sat, 5 Jul 2014 21:18:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268302 - in head: sys/cam/ctl usr.sbin/ctld
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 21:18:35 -0000

Author: mav
Date: Sat Jul  5 21:18:33 2014
New Revision: 268302
URL: http://svnweb.freebsd.org/changeset/base/268302

Log:
  Pass through iSCSI session ISID from LOGIN request to the CTL frontend.
  
  ISID is an important part of initiator transport ID for iSCSI.  It is not
  used now, but should be to properly implement persistent reservation.

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/cam/ctl/ctl_frontend_iscsi.h
  head/sys/cam/ctl/ctl_ioctl.h
  head/usr.sbin/ctld/ctld.h
  head/usr.sbin/ctld/kernel.c
  head/usr.sbin/ctld/login.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Sat Jul  5 20:16:02 2014	(r268301)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Sat Jul  5 21:18:33 2014	(r268302)
@@ -1507,6 +1507,13 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi *
 	    cihp->initiator_addr, sizeof(cs->cs_initiator_addr));
 	strlcpy(cs->cs_initiator_alias,
 	    cihp->initiator_alias, sizeof(cs->cs_initiator_alias));
+	memcpy(cs->cs_initiator_isid,
+	    cihp->initiator_isid, sizeof(cs->cs_initiator_isid));
+	snprintf(cs->cs_initiator_id, sizeof(cs->cs_initiator_id),
+	    "%s,i,0x%02x%02x%02x%02x%02x%02x", cs->cs_initiator_name,
+	    cihp->initiator_isid[0], cihp->initiator_isid[1],
+	    cihp->initiator_isid[2], cihp->initiator_isid[3],
+	    cihp->initiator_isid[4], cihp->initiator_isid[5]);
 
 #ifdef ICL_KERNEL_PROXY
 	if (cihp->socket > 0) {

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.h
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.h	Sat Jul  5 20:16:02 2014	(r268301)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.h	Sat Jul  5 21:18:33 2014	(r268302)
@@ -86,6 +86,8 @@ struct cfiscsi_session {
 	char				cs_initiator_name[CTL_ISCSI_NAME_LEN];
 	char				cs_initiator_addr[CTL_ISCSI_ADDR_LEN];
 	char				cs_initiator_alias[CTL_ISCSI_ALIAS_LEN];
+	char				cs_initiator_isid[6];
+	char				cs_initiator_id[CTL_ISCSI_NAME_LEN + 5 + 6 + 1];
 	unsigned int			cs_id;
 	int				cs_ctl_initid;
 #ifdef ICL_KERNEL_PROXY

Modified: head/sys/cam/ctl/ctl_ioctl.h
==============================================================================
--- head/sys/cam/ctl/ctl_ioctl.h	Sat Jul  5 20:16:02 2014	(r268301)
+++ head/sys/cam/ctl/ctl_ioctl.h	Sat Jul  5 21:18:33 2014	(r268302)
@@ -681,6 +681,7 @@ struct ctl_iscsi_handoff_params {
 	char			initiator_name[CTL_ISCSI_NAME_LEN];
 	char			initiator_addr[CTL_ISCSI_ADDR_LEN];
 	char			initiator_alias[CTL_ISCSI_ALIAS_LEN];
+	uint8_t			initiator_isid[6];
 	char			target_name[CTL_ISCSI_NAME_LEN];
 	int			socket;
 	int			portal_group_tag;

Modified: head/usr.sbin/ctld/ctld.h
==============================================================================
--- head/usr.sbin/ctld/ctld.h	Sat Jul  5 20:16:02 2014	(r268301)
+++ head/usr.sbin/ctld/ctld.h	Sat Jul  5 21:18:33 2014	(r268302)
@@ -178,6 +178,7 @@ struct connection {
 	char			*conn_initiator_name;
 	char			*conn_initiator_addr;
 	char			*conn_initiator_alias;
+	uint8_t			conn_initiator_isid[6];
 	uint32_t		conn_cmdsn;
 	uint32_t		conn_statsn;
 	size_t			conn_max_data_segment_length;

Modified: head/usr.sbin/ctld/kernel.c
==============================================================================
--- head/usr.sbin/ctld/kernel.c	Sat Jul  5 20:16:02 2014	(r268301)
+++ head/usr.sbin/ctld/kernel.c	Sat Jul  5 21:18:33 2014	(r268302)
@@ -787,6 +787,8 @@ kernel_handoff(struct connection *conn)
 		strlcpy(req.data.handoff.initiator_alias,
 		    conn->conn_initiator_alias, sizeof(req.data.handoff.initiator_alias));
 	}
+	memcpy(req.data.handoff.initiator_isid, conn->conn_initiator_isid,
+	    sizeof(req.data.handoff.initiator_isid));
 	strlcpy(req.data.handoff.target_name,
 	    conn->conn_target->t_name, sizeof(req.data.handoff.target_name));
 #ifdef ICL_KERNEL_PROXY

Modified: head/usr.sbin/ctld/login.c
==============================================================================
--- head/usr.sbin/ctld/login.c	Sat Jul  5 20:16:02 2014	(r268301)
+++ head/usr.sbin/ctld/login.c	Sat Jul  5 21:18:33 2014	(r268302)
@@ -850,6 +850,9 @@ login(struct connection *conn)
 		log_errx(1, "received Login PDU with non-zero TSIH");
 	}
 
+	memcpy(conn->conn_initiator_isid, bhslr->bhslr_isid,
+	    sizeof(conn->conn_initiator_isid));
+
 	/*
 	 * XXX: Implement the C flag some day.
 	 */

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 21:34:38 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 307C79B7;
 Sat,  5 Jul 2014 21:34:38 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 04BC42F8C;
 Sat,  5 Jul 2014 21:34:38 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s65LYbjh085508;
 Sat, 5 Jul 2014 21:34:37 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s65LYbj1085505;
 Sat, 5 Jul 2014 21:34:37 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201407052134.s65LYbj1085505@svn.freebsd.org>
From: Gavin Atkinson 
Date: Sat, 5 Jul 2014 21:34:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268303 - head/sys/dev/asmc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 21:34:38 -0000

Author: gavin
Date: Sat Jul  5 21:34:37 2014
New Revision: 268303
URL: http://svnweb.freebsd.org/changeset/base/268303

Log:
  Add support to asmc(4) for Macmini 3,1.
  
  PR:		190195
  Submitted by:	fbsdbugs2 sentry.org
  MFC after:	1 week
  Relnotes:	yes

Modified:
  head/sys/dev/asmc/asmc.c
  head/sys/dev/asmc/asmcvar.h

Modified: head/sys/dev/asmc/asmc.c
==============================================================================
--- head/sys/dev/asmc/asmc.c	Sat Jul  5 21:18:33 2014	(r268302)
+++ head/sys/dev/asmc/asmc.c	Sat Jul  5 21:34:37 2014	(r268303)
@@ -206,6 +206,15 @@ struct asmc_model asmc_models[] = {
 	  ASMC_MM_TEMPS, ASMC_MM_TEMPNAMES, ASMC_MM_TEMPDESCS
 	},
 
+	/* The Mac Mini 3,1 has no SMS */
+	{ 
+	  "Macmini3,1", "Apple SMC Mac Mini 3,1",
+	  NULL, NULL, NULL,
+	  ASMC_FAN_FUNCS,
+	  NULL, NULL, NULL,
+	  ASMC_MM31_TEMPS, ASMC_MM31_TEMPNAMES, ASMC_MM31_TEMPDESCS
+	},
+
 	/* Idem for the MacPro */
 	{
 	  "MacPro2", "Apple SMC Mac Pro (8-core)",

Modified: head/sys/dev/asmc/asmcvar.h
==============================================================================
--- head/sys/dev/asmc/asmcvar.h	Sat Jul  5 21:18:33 2014	(r268302)
+++ head/sys/dev/asmc/asmcvar.h	Sat Jul  5 21:34:37 2014	(r268303)
@@ -180,6 +180,25 @@ struct asmc_softc {
 #define ASMC_MM_TEMPDESCS	{ "Northbridge Point 1", \
 				  "Northbridge Point 2" }
 
+#define ASMC_MM31_TEMPS		{ "TC0D", "TC0H", \
+				  "TC0P", "TH0P", \
+				  "TN0D", "TN0P", \
+				  "TW0P", NULL }
+
+#define ASMC_MM31_TEMPNAMES	{ "cpu0_die", "cpu0_heatsink", \
+				  "cpu0_proximity", "hdd_bay", \
+				  "northbridge_die", \
+				  "northbridge_proximity", \
+				  "wireless_module", }
+
+#define ASMC_MM31_TEMPDESCS	{ "CPU0 Die Core Temperature", \
+				  "CPU0 Heatsink Temperature", \
+				  "CPU0 Proximity Temperature", \
+				  "HDD Bay Temperature", \
+				  "Northbridge Die Core Temperature", \
+				  "Northbridge Proximity Temperature", \
+				  "Wireless Module Temperature", }
+
 #define ASMC_MP_TEMPS		{ "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \
 				  "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \
 				  "TC2C", "TC2D", "TC3C", "TC3D", "THTG", \

From owner-svn-src-head@FreeBSD.ORG  Sat Jul  5 21:50:59 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E0D3BDB;
 Sat,  5 Jul 2014 21:50:59 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CE14E211D;
 Sat,  5 Jul 2014 21:50:59 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s65LoxOJ091254;
 Sat, 5 Jul 2014 21:50:59 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s65LoxMR091253;
 Sat, 5 Jul 2014 21:50:59 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201407052150.s65LoxMR091253@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Sat, 5 Jul 2014 21:50:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268304 - head/bin/sh
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 05 Jul 2014 21:51:00 -0000

Author: jilles
Date: Sat Jul  5 21:50:59 2014
New Revision: 268304
URL: http://svnweb.freebsd.org/changeset/base/268304

Log:
  sh: Fix overflow checking on 'ulimit' operand.

Modified:
  head/bin/sh/miscbltin.c

Modified: head/bin/sh/miscbltin.c
==============================================================================
--- head/bin/sh/miscbltin.c	Sat Jul  5 21:34:37 2014	(r268303)
+++ head/bin/sh/miscbltin.c	Sat Jul  5 21:50:59 2014	(r268304)
@@ -414,7 +414,6 @@ static const struct limits limits[] = {
 int
 ulimitcmd(int argc __unused, char **argv __unused)
 {
-	int	c;
 	rlim_t val = 0;
 	enum { SOFT = 0x1, HARD = 0x2 }
 			how = SOFT | HARD;
@@ -453,17 +452,22 @@ ulimitcmd(int argc __unused, char **argv
 		if (strcmp(p, "unlimited") == 0)
 			val = RLIM_INFINITY;
 		else {
-			val = 0;
+			char *end;
+			uintmax_t uval;
 
-			while ((c = *p++) >= '0' && c <= '9')
-			{
-				val = (val * 10) + (long)(c - '0');
-				if (val < 0)
-					break;
-			}
-			if (c)
+			if (*p < '0' || *p > '9')
+				error("bad number");
+			errno = 0;
+			uval = strtoumax(p, &end, 10);
+			if (errno != 0 || *end != '\0')
+				error("bad number");
+			if (uval > UINTMAX_MAX / l->factor)
+				error("bad number");
+			uval *= l->factor;
+			val = (rlim_t)uval;
+			if (val < 0 || (uintmax_t)val != uval ||
+			    val == RLIM_INFINITY)
 				error("bad number");
-			val *= l->factor;
 		}
 	}
 	if (all) {

From owner-svn-src-head@FreeBSD.ORG  Sun Jul  6 06:12:30 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7D1BD3FD;
 Sun,  6 Jul 2014 06:12:30 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6AC5D246F;
 Sun,  6 Jul 2014 06:12:30 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s666CUv9096898;
 Sun, 6 Jul 2014 06:12:30 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s666CUYs096897;
 Sun, 6 Jul 2014 06:12:30 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407060612.s666CUYs096897@svn.freebsd.org>
From: Alexander Motin 
Date: Sun, 6 Jul 2014 06:12:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268306 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 06 Jul 2014 06:12:30 -0000

Author: mav
Date: Sun Jul  6 06:12:29 2014
New Revision: 268306
URL: http://svnweb.freebsd.org/changeset/base/268306

Log:
  Relax some bit checks for INQUIRY command.
  
  FreeBSD still tries to put LUN number in second byte until it get device
  protocol version, even that it was obsoleted about 20 years ago.

Modified:
  head/sys/cam/ctl/ctl_cmd_table.c

Modified: head/sys/cam/ctl/ctl_cmd_table.c
==============================================================================
--- head/sys/cam/ctl/ctl_cmd_table.c	Sun Jul  6 03:31:01 2014	(r268305)
+++ head/sys/cam/ctl/ctl_cmd_table.c	Sun Jul  6 06:12:29 2014	(r268306)
@@ -410,7 +410,7 @@ const struct ctl_cmd_entry ctl_cmd_table
 			      CTL_CMD_FLAG_OK_ON_SECONDARY |
 			      CTL_FLAG_DATA_IN |
 			      CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
- CTL_LUN_PAT_NONE, 6, {0x01, 0xff, 0xff, 0xff, 0x07}},
+ CTL_LUN_PAT_NONE, 6, {0xe1, 0xff, 0xff, 0xff, 0x07}},
 
 /* 13 */
 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},

From owner-svn-src-head@FreeBSD.ORG  Sun Jul  6 06:21:35 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7DE7B570;
 Sun,  6 Jul 2014 06:21:35 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6A96724FA;
 Sun,  6 Jul 2014 06:21:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s666LZeY001441;
 Sun, 6 Jul 2014 06:21:35 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s666LYn4001436;
 Sun, 6 Jul 2014 06:21:34 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407060621.s666LYn4001436@svn.freebsd.org>
From: Alexander Motin 
Date: Sun, 6 Jul 2014 06:21:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268307 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 06 Jul 2014 06:21:35 -0000

Author: mav
Date: Sun Jul  6 06:21:34 2014
New Revision: 268307
URL: http://svnweb.freebsd.org/changeset/base/268307

Log:
  Move lun_map() method from command nexus to port.
  
  Previous implementation made impossible to do some things, such as calling
  it for ports other then one through which command arrived.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_frontend.h
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/cam/ctl/ctl_frontend_iscsi.h
  head/sys/cam/ctl/ctl_io.h

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sun Jul  6 06:12:29 2014	(r268306)
+++ head/sys/cam/ctl/ctl.c	Sun Jul  6 06:21:34 2014	(r268307)
@@ -346,6 +346,7 @@ static int ctl_ioctl(struct cdev *dev, u
 		     struct thread *td);
 uint32_t ctl_get_resindex(struct ctl_nexus *nexus);
 uint32_t ctl_port_idx(int port_num);
+static uint32_t ctl_map_lun(int port_num, uint32_t lun);
 #ifdef unused
 static union ctl_io *ctl_malloc_io(ctl_io_type io_type, uint32_t targ_port,
 				   uint32_t targ_target, uint32_t targ_lun,
@@ -3345,6 +3346,19 @@ ctl_port_idx(int port_num)
 		return(port_num - CTL_MAX_PORTS);
 }
 
+static uint32_t
+ctl_map_lun(int port_num, uint32_t lun_id)
+{
+	struct ctl_port *port;
+
+	port = control_softc->ctl_ports[ctl_port_idx(port_num)];
+	if (port == NULL)
+		return (UINT32_MAX);
+	if (port->lun_map == NULL)
+		return (lun_id);
+	return (port->lun_map(port->targ_lun_arg, lun_id));
+}
+
 /*
  * Note:  This only works for bitmask sizes that are at least 32 bits, and
  * that are a power of 2.
@@ -9256,9 +9270,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio
 
 	mtx_lock(&control_softc->ctl_lock);
 	for (targ_lun_id = 0, num_filled = 0; targ_lun_id < CTL_MAX_LUNS && num_filled < num_luns; targ_lun_id++) {
-		lun_id = targ_lun_id;
-		if (ctsio->io_hdr.nexus.lun_map_fn != NULL)
-			lun_id = ctsio->io_hdr.nexus.lun_map_fn(ctsio->io_hdr.nexus.lun_map_arg, lun_id);
+		lun_id = ctl_map_lun(ctsio->io_hdr.nexus.targ_port, targ_lun_id);
 		if (lun_id >= CTL_MAX_LUNS)
 			continue;
 		lun = control_softc->ctl_luns[lun_id];
@@ -13240,8 +13252,7 @@ ctl_queue_sense(union ctl_io *io)
 	 * information.
 	 */
 	targ_lun = io->io_hdr.nexus.targ_lun;
-	if (io->io_hdr.nexus.lun_map_fn != NULL)
-		targ_lun = io->io_hdr.nexus.lun_map_fn(io->io_hdr.nexus.lun_map_arg, targ_lun);
+	targ_lun = ctl_map_lun(io->io_hdr.nexus.targ_port, targ_lun);
 	if ((targ_lun < CTL_MAX_LUNS)
 	 && (ctl_softc->ctl_luns[targ_lun] != NULL))
 		lun = ctl_softc->ctl_luns[targ_lun];
@@ -13292,11 +13303,8 @@ ctl_queue(union ctl_io *io)
 #endif /* CTL_TIME_IO */
 
 	/* Map FE-specific LUN ID into global one. */
-	if (io->io_hdr.nexus.lun_map_fn != NULL)
-		io->io_hdr.nexus.targ_mapped_lun = io->io_hdr.nexus.lun_map_fn(
-		    io->io_hdr.nexus.lun_map_arg, io->io_hdr.nexus.targ_lun);
-	else
-		io->io_hdr.nexus.targ_mapped_lun = io->io_hdr.nexus.targ_lun;
+	io->io_hdr.nexus.targ_mapped_lun =
+	    ctl_map_lun(io->io_hdr.nexus.targ_port, io->io_hdr.nexus.targ_lun);
 
 	switch (io->io_hdr.io_type) {
 	case CTL_IO_SCSI:

Modified: head/sys/cam/ctl/ctl_frontend.h
==============================================================================
--- head/sys/cam/ctl/ctl_frontend.h	Sun Jul  6 06:12:29 2014	(r268306)
+++ head/sys/cam/ctl/ctl_frontend.h	Sun Jul  6 06:21:34 2014	(r268307)
@@ -49,8 +49,8 @@ typedef enum {
 typedef int (*fe_init_t)(void);
 typedef void (*fe_shutdown_t)(void);
 typedef void (*port_func_t)(void *onoff_arg);
-typedef int (*targ_func_t)(void *arg, struct ctl_id targ_id);
 typedef	int (*lun_func_t)(void *arg, struct ctl_id targ_id, int lun_id);
+typedef	uint32_t (*lun_map_func_t)(void *arg, uint32_t lun_id);
 typedef int (*fe_ioctl_t)(struct cdev *dev, u_long cmd, caddr_t addr, int flag,
 			  struct thread *td);
 
@@ -217,6 +217,7 @@ struct ctl_port {
 	void		*onoff_arg;		/* passed to CTL */
 	lun_func_t	lun_enable;		/* passed to CTL */
 	lun_func_t	lun_disable;		/* passed to CTL */
+	lun_map_func_t	lun_map;		/* passed to CTL */
 	void		*targ_lun_arg;		/* passed to CTL */
 	void		(*fe_datamove)(union ctl_io *io); /* passed to CTL */
 	void		(*fe_done)(union ctl_io *io); /* passed to CTL */

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Sun Jul  6 06:12:29 2014	(r268306)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Sun Jul  6 06:21:34 2014	(r268307)
@@ -149,11 +149,11 @@ static int	cfiscsi_lun_enable(void *arg,
 		    struct ctl_id target_id, int lun_id);
 static int	cfiscsi_lun_disable(void *arg,
 		    struct ctl_id target_id, int lun_id);
+static uint32_t	cfiscsi_lun_map(void *arg, uint32_t lun);
 static int	cfiscsi_ioctl(struct cdev *dev,
 		    u_long cmd, caddr_t addr, int flag, struct thread *td);
 static void	cfiscsi_datamove(union ctl_io *io);
 static void	cfiscsi_done(union ctl_io *io);
-static uint32_t	cfiscsi_map_lun(void *arg, uint32_t lun);
 static bool	cfiscsi_pdu_update_cmdsn(const struct icl_pdu *request);
 static void	cfiscsi_pdu_handle_nop_out(struct icl_pdu *request);
 static void	cfiscsi_pdu_handle_scsi_command(struct icl_pdu *request);
@@ -552,8 +552,6 @@ cfiscsi_pdu_handle_scsi_command(struct i
 	io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port;
 	io->io_hdr.nexus.targ_target.id = 0;
 	io->io_hdr.nexus.targ_lun = cfiscsi_decode_lun(bhssc->bhssc_lun);
-	io->io_hdr.nexus.lun_map_fn = cfiscsi_map_lun;
-	io->io_hdr.nexus.lun_map_arg = cs;
 	io->scsiio.tag_num = bhssc->bhssc_initiator_task_tag;
 	switch ((bhssc->bhssc_flags & BHSSC_FLAGS_ATTR)) {
 	case BHSSC_FLAGS_ATTR_UNTAGGED:
@@ -618,8 +616,6 @@ cfiscsi_pdu_handle_task_request(struct i
 	io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port;
 	io->io_hdr.nexus.targ_target.id = 0;
 	io->io_hdr.nexus.targ_lun = cfiscsi_decode_lun(bhstmr->bhstmr_lun);
-	io->io_hdr.nexus.lun_map_fn = cfiscsi_map_lun;
-	io->io_hdr.nexus.lun_map_arg = cs;
 	io->taskio.tag_type = CTL_TAG_SIMPLE; /* XXX */
 
 	switch (bhstmr->bhstmr_function & ~0x80) {
@@ -2000,6 +1996,7 @@ cfiscsi_ioctl_port_create(struct ctl_req
 	port->onoff_arg = ct;
 	port->lun_enable = cfiscsi_lun_enable;
 	port->lun_disable = cfiscsi_lun_disable;
+	port->lun_map = cfiscsi_lun_map;
 	port->targ_lun_arg = ct;
 	port->fe_datamove = cfiscsi_datamove;
 	port->fe_done = cfiscsi_done;
@@ -2246,7 +2243,7 @@ cfiscsi_target_find_or_create(struct cfi
 	}
 
 	for (i = 0; i < CTL_MAX_LUNS; i++)
-		newct->ct_luns[i] = -1;
+		newct->ct_luns[i] = UINT32_MAX;
 
 	strlcpy(newct->ct_name, name, sizeof(newct->ct_name));
 	if (alias != NULL)
@@ -2263,22 +2260,16 @@ cfiscsi_target_find_or_create(struct cfi
  * Takes LUN from the target space and returns LUN from the CTL space.
  */
 static uint32_t
-cfiscsi_map_lun(void *arg, uint32_t lun)
+cfiscsi_lun_map(void *arg, uint32_t lun)
 {
-	struct cfiscsi_session *cs;
-
-	cs = arg;
+	struct cfiscsi_target *ct = arg;
 
 	if (lun >= CTL_MAX_LUNS) {
 		CFISCSI_DEBUG("requested lun number %d is higher "
 		    "than maximum %d", lun, CTL_MAX_LUNS - 1);
-		return (0xffffffff);
+		return (UINT32_MAX);
 	}
-
-	if (cs->cs_target->ct_luns[lun] < 0)
-		return (0xffffffff);
-
-	return (cs->cs_target->ct_luns[lun]);
+	return (ct->ct_luns[lun]);
 }
 
 static int
@@ -2292,7 +2283,7 @@ cfiscsi_target_set_lun(struct cfiscsi_ta
 		return (-1);
 	}
 
-	if (ct->ct_luns[lun_id] >= 0) {
+	if (ct->ct_luns[lun_id] < CTL_MAX_LUNS) {
 		/*
 		 * CTL calls cfiscsi_lun_enable() twice for each LUN - once
 		 * when the LUN is created, and a second time just before
@@ -2361,11 +2352,9 @@ cfiscsi_lun_disable(void *arg, struct ct
 
 	mtx_lock(&softc->lock);
 	for (i = 0; i < CTL_MAX_LUNS; i++) {
-		if (ct->ct_luns[i] < 0)
-			continue;
 		if (ct->ct_luns[i] != lun_id)
 			continue;
-		ct->ct_luns[lun_id] = -1;
+		ct->ct_luns[i] = UINT32_MAX;
 		break;
 	}
 	mtx_unlock(&softc->lock);

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.h
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.h	Sun Jul  6 06:12:29 2014	(r268306)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.h	Sun Jul  6 06:21:34 2014	(r268307)
@@ -38,7 +38,7 @@
 
 struct cfiscsi_target {
 	TAILQ_ENTRY(cfiscsi_target)	ct_next;
-	int				ct_luns[CTL_MAX_LUNS];
+	uint32_t			ct_luns[CTL_MAX_LUNS];
 	struct cfiscsi_softc		*ct_softc;
 	volatile u_int			ct_refcount;
 	char				ct_name[CTL_ISCSI_NAME_LEN];

Modified: head/sys/cam/ctl/ctl_io.h
==============================================================================
--- head/sys/cam/ctl/ctl_io.h	Sun Jul  6 06:12:29 2014	(r268306)
+++ head/sys/cam/ctl/ctl_io.h	Sun Jul  6 06:21:34 2014	(r268307)
@@ -221,8 +221,6 @@ struct ctl_nexus {
 	struct ctl_id targ_target;	/* Destination target */
 	uint32_t targ_lun;		/* Destination lun */
 	uint32_t targ_mapped_lun;	/* Destination lun CTL-wide */
-	uint32_t (*lun_map_fn)(void *arg, uint32_t lun);
-	void *lun_map_arg;
 };
 
 typedef enum {

From owner-svn-src-head@FreeBSD.ORG  Sun Jul  6 07:02:37 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 67906975;
 Sun,  6 Jul 2014 07:02:37 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 53FB22762;
 Sun,  6 Jul 2014 07:02:37 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6672bmg019742;
 Sun, 6 Jul 2014 07:02:37 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6672aYW019740;
 Sun, 6 Jul 2014 07:02:36 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407060702.s6672aYW019740@svn.freebsd.org>
From: Alexander Motin 
Date: Sun, 6 Jul 2014 07:02:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268308 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 06 Jul 2014 07:02:37 -0000

Author: mav
Date: Sun Jul  6 07:02:36 2014
New Revision: 268308
URL: http://svnweb.freebsd.org/changeset/base/268308

Log:
  Make REPORT TARGET PORT GROUPS command report realistic data instead of
  hardcoded garbage.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_private.h

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sun Jul  6 06:21:34 2014	(r268307)
+++ head/sys/cam/ctl/ctl.c	Sun Jul  6 07:02:36 2014	(r268308)
@@ -347,6 +347,7 @@ static int ctl_ioctl(struct cdev *dev, u
 uint32_t ctl_get_resindex(struct ctl_nexus *nexus);
 uint32_t ctl_port_idx(int port_num);
 static uint32_t ctl_map_lun(int port_num, uint32_t lun);
+static uint32_t ctl_map_lun_back(int port_num, uint32_t lun);
 #ifdef unused
 static union ctl_io *ctl_malloc_io(ctl_io_type io_type, uint32_t targ_port,
 				   uint32_t targ_target, uint32_t targ_lun,
@@ -3359,6 +3360,22 @@ ctl_map_lun(int port_num, uint32_t lun_i
 	return (port->lun_map(port->targ_lun_arg, lun_id));
 }
 
+static uint32_t
+ctl_map_lun_back(int port_num, uint32_t lun_id)
+{
+	struct ctl_port *port;
+	uint32_t i;
+
+	port = control_softc->ctl_ports[ctl_port_idx(port_num)];
+	if (port->lun_map == NULL)
+		return (lun_id);
+	for (i = 0; i < CTL_MAX_LUNS; i++) {
+		if (port->lun_map(port->targ_lun_arg, i) == lun_id)
+			return (i);
+	}
+	return (UINT32_MAX);
+}
+
 /*
  * Note:  This only works for bitmask sizes that are at least 32 bits, and
  * that are a power of 2.
@@ -7118,14 +7135,14 @@ ctl_report_tagret_port_groups(struct ctl
 {
 	struct scsi_maintenance_in *cdb;
 	int retval;
-	int alloc_len, total_len = 0;
-	int num_target_port_groups, single;
+	int alloc_len, ext, total_len = 0, g, p, pc, pg;
+	int num_target_port_groups, num_target_ports, single;
 	struct ctl_lun *lun;
 	struct ctl_softc *softc;
+	struct ctl_port *port;
 	struct scsi_target_group_data *rtg_ptr;
-	struct scsi_target_port_group_descriptor *tpg_desc_ptr1, *tpg_desc_ptr2;
-	struct scsi_target_port_descriptor  *tp_desc_ptr1_1, *tp_desc_ptr1_2,
-	                                    *tp_desc_ptr2_1, *tp_desc_ptr2_2;
+	struct scsi_target_group_data_extended *rtg_ext_ptr;
+	struct scsi_target_port_group_descriptor *tpg_desc;
 
 	CTL_DEBUG_PRINT(("ctl_report_tagret_port_groups\n"));
 
@@ -7135,17 +7152,48 @@ ctl_report_tagret_port_groups(struct ctl
 
 	retval = CTL_RETVAL_COMPLETE;
 
+	switch (cdb->byte2 & STG_PDF_MASK) {
+	case STG_PDF_LENGTH:
+		ext = 0;
+		break;
+	case STG_PDF_EXTENDED:
+		ext = 1;
+		break;
+	default:
+		ctl_set_invalid_field(/*ctsio*/ ctsio,
+				      /*sks_valid*/ 1,
+				      /*command*/ 1,
+				      /*field*/ 2,
+				      /*bit_valid*/ 1,
+				      /*bit*/ 5);
+		ctl_done((union ctl_io *)ctsio);
+		return(retval);
+	}
+
 	single = ctl_is_single;
 	if (single)
-        	num_target_port_groups = NUM_TARGET_PORT_GROUPS - 1;
+		num_target_port_groups = 1;
 	else
-        	num_target_port_groups = NUM_TARGET_PORT_GROUPS;
+		num_target_port_groups = NUM_TARGET_PORT_GROUPS;
+	num_target_ports = 0;
+	mtx_lock(&softc->ctl_lock);
+	STAILQ_FOREACH(port, &softc->port_list, links) {
+		if ((port->status & CTL_PORT_STATUS_ONLINE) == 0)
+			continue;
+		if (ctl_map_lun_back(port->targ_port, lun->lun) >= CTL_MAX_LUNS)
+			continue;
+		num_target_ports++;
+	}
+	mtx_unlock(&softc->ctl_lock);
 
-	total_len = sizeof(struct scsi_target_group_data) +
-		sizeof(struct scsi_target_port_group_descriptor) *
+	if (ext)
+		total_len = sizeof(struct scsi_target_group_data_extended);
+	else
+		total_len = sizeof(struct scsi_target_group_data);
+	total_len += sizeof(struct scsi_target_port_group_descriptor) *
 		num_target_port_groups +
-		sizeof(struct scsi_target_port_descriptor) *
-		NUM_PORTS_PER_GRP * num_target_port_groups;
+	    sizeof(struct scsi_target_port_descriptor) *
+		num_target_ports * num_target_port_groups;
 
 	alloc_len = scsi_4btoul(cdb->length);
 
@@ -7165,76 +7213,51 @@ ctl_report_tagret_port_groups(struct ctl
 	ctsio->kern_data_resid = 0;
 	ctsio->kern_rel_offset = 0;
 
-	rtg_ptr = (struct scsi_target_group_data *)ctsio->kern_data_ptr;
-
-	tpg_desc_ptr1 = &rtg_ptr->groups[0];
-	tp_desc_ptr1_1 = &tpg_desc_ptr1->descriptors[0];
-	tp_desc_ptr1_2 = (struct scsi_target_port_descriptor *)
-	        &tp_desc_ptr1_1->desc_list[0];
-
-	if (single == 0) {
-		tpg_desc_ptr2 = (struct scsi_target_port_group_descriptor *)
-	                &tp_desc_ptr1_2->desc_list[0];
-		tp_desc_ptr2_1 = &tpg_desc_ptr2->descriptors[0];
-		tp_desc_ptr2_2 = (struct scsi_target_port_descriptor *)
-	        	&tp_desc_ptr2_1->desc_list[0];
-        } else {
-		tpg_desc_ptr2 = NULL;
-		tp_desc_ptr2_1 = NULL;
-		tp_desc_ptr2_2 = NULL;
-	}
-
-	scsi_ulto4b(total_len - 4, rtg_ptr->length);
-	if (single == 0) {
-        	if (ctsio->io_hdr.nexus.targ_port < CTL_MAX_PORTS) {
-			if (lun->flags & CTL_LUN_PRIMARY_SC) {
-				tpg_desc_ptr1->pref_state = TPG_PRIMARY;
-				tpg_desc_ptr2->pref_state =
-					TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED;
-			} else {
-				tpg_desc_ptr1->pref_state =
-					TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED;
-				tpg_desc_ptr2->pref_state = TPG_PRIMARY;
-			}
-		} else {
-			if (lun->flags & CTL_LUN_PRIMARY_SC) {
-				tpg_desc_ptr1->pref_state =
-					TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED;
-				tpg_desc_ptr2->pref_state = TPG_PRIMARY;
-			} else {
-				tpg_desc_ptr1->pref_state = TPG_PRIMARY;
-				tpg_desc_ptr2->pref_state =
-					TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED;
-			}
-		}
+	if (ext) {
+		rtg_ext_ptr = (struct scsi_target_group_data_extended *)
+		    ctsio->kern_data_ptr;
+		scsi_ulto4b(total_len - 4, rtg_ext_ptr->length);
+		rtg_ext_ptr->format_type = 0x10;
+		rtg_ext_ptr->implicit_transition_time = 0;
+		tpg_desc = &rtg_ext_ptr->groups[0];
 	} else {
-		tpg_desc_ptr1->pref_state = TPG_PRIMARY;
+		rtg_ptr = (struct scsi_target_group_data *)
+		    ctsio->kern_data_ptr;
+		scsi_ulto4b(total_len - 4, rtg_ptr->length);
+		tpg_desc = &rtg_ptr->groups[0];
 	}
-	tpg_desc_ptr1->support = 0;
-	tpg_desc_ptr1->target_port_group[1] = 1;
-	tpg_desc_ptr1->status = TPG_IMPLICIT;
-	tpg_desc_ptr1->target_port_count= NUM_PORTS_PER_GRP;
-
-	if (single == 0) {
-		tpg_desc_ptr2->support = 0;
-		tpg_desc_ptr2->target_port_group[1] = 2;
-		tpg_desc_ptr2->status = TPG_IMPLICIT;
-		tpg_desc_ptr2->target_port_count = NUM_PORTS_PER_GRP;
 
-		tp_desc_ptr1_1->relative_target_port_identifier[1] = 1;
-		tp_desc_ptr1_2->relative_target_port_identifier[1] = 2;
-
-		tp_desc_ptr2_1->relative_target_port_identifier[1] = 9;
-		tp_desc_ptr2_2->relative_target_port_identifier[1] = 10;
-	} else {
-        	if (ctsio->io_hdr.nexus.targ_port < CTL_MAX_PORTS) {
-			tp_desc_ptr1_1->relative_target_port_identifier[1] = 1;
-			tp_desc_ptr1_2->relative_target_port_identifier[1] = 2;
-		} else {
-			tp_desc_ptr1_1->relative_target_port_identifier[1] = 9;
-			tp_desc_ptr1_2->relative_target_port_identifier[1] = 10;
-		}
+	pg = ctsio->io_hdr.nexus.targ_port / CTL_MAX_PORTS;
+	mtx_lock(&softc->ctl_lock);
+	for (g = 0; g < num_target_port_groups; g++) {
+		if (g == pg)
+			tpg_desc->pref_state = TPG_PRIMARY |
+			    TPG_ASYMMETRIC_ACCESS_OPTIMIZED;
+		else
+			tpg_desc->pref_state =
+			    TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED;
+		tpg_desc->support = TPG_AO_SUP;
+		if (!single)
+			tpg_desc->support = TPG_AN_SUP;
+		scsi_ulto2b(g + 1, tpg_desc->target_port_group);
+		tpg_desc->status = TPG_IMPLICIT;
+		pc = 0;
+		STAILQ_FOREACH(port, &softc->port_list, links) {
+			if ((port->status & CTL_PORT_STATUS_ONLINE) == 0)
+				continue;
+			if (ctl_map_lun_back(port->targ_port, lun->lun) >=
+			    CTL_MAX_LUNS)
+				continue;
+			p = port->targ_port % CTL_MAX_PORTS + g * CTL_MAX_PORTS;
+			scsi_ulto2b(p, tpg_desc->descriptors[pc].
+			    relative_target_port_identifier);
+			pc++;
+		}
+		tpg_desc->target_port_count = pc;
+		tpg_desc = (struct scsi_target_port_group_descriptor *)
+		    &tpg_desc->descriptors[pc];
 	}
+	mtx_unlock(&softc->ctl_lock);
 
 	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
 	ctsio->be_move_done = ctl_config_move_done;
@@ -9776,10 +9799,8 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
 	desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_PORT |
 	    SVPD_ID_TYPE_TPORTGRP;
 	desc->length = 4;
-	if (ctsio->io_hdr.nexus.targ_port < CTL_MAX_PORTS || ctl_is_single)
-		scsi_ulto2b(1, &desc->identifier[2]);
-	else
-		scsi_ulto2b(2, &desc->identifier[2]);
+	scsi_ulto2b(ctsio->io_hdr.nexus.targ_port / CTL_MAX_PORTS + 1,
+	    &desc->identifier[2]);
 	desc = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] +
 	    sizeof(struct scsi_vpd_id_trgt_port_grp_id));
 

Modified: head/sys/cam/ctl/ctl_private.h
==============================================================================
--- head/sys/cam/ctl/ctl_private.h	Sun Jul  6 06:21:34 2014	(r268307)
+++ head/sys/cam/ctl/ctl_private.h	Sun Jul  6 07:02:36 2014	(r268308)
@@ -376,7 +376,6 @@ struct ctl_devid {
  * For report target port groups.
  */
 #define NUM_TARGET_PORT_GROUPS	2
-#define NUM_PORTS_PER_GRP	2
 
 struct ctl_lun {
 	struct mtx			lun_lock;

From owner-svn-src-head@FreeBSD.ORG  Sun Jul  6 07:34:19 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id F3608F01;
 Sun,  6 Jul 2014 07:34:18 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D3E61297E;
 Sun,  6 Jul 2014 07:34:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s667YI3K034354;
 Sun, 6 Jul 2014 07:34:18 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s667YIME034350;
 Sun, 6 Jul 2014 07:34:18 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407060734.s667YIME034350@svn.freebsd.org>
From: Alexander Motin 
Date: Sun, 6 Jul 2014 07:34:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268309 - in head/sys/cam: ctl scsi
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 06 Jul 2014 07:34:19 -0000

Author: mav
Date: Sun Jul  6 07:34:18 2014
New Revision: 268309
URL: http://svnweb.freebsd.org/changeset/base/268309

Log:
  Add support for SCSI Ports (88h) VPD page.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/scsi/scsi_all.h

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sun Jul  6 07:02:36 2014	(r268308)
+++ head/sys/cam/ctl/ctl.c	Sun Jul  6 07:34:18 2014	(r268309)
@@ -315,10 +315,11 @@ SYSCTL_INT(_kern_cam_ctl, OID_AUTO, verb
     &verbose, 0, "Show SCSI errors returned to initiator");
 
 /*
- * Serial number (0x80), device id (0x83), supported pages (0x00),
- * Block limits (0xB0) and Logical Block Provisioning (0xB2)
+ * Supported pages (0x00), Serial number (0x80), Device ID (0x83),
+ * SCSI Ports (0x88), Block limits (0xB0) and
+ * Logical Block Provisioning (0xB2)
  */
-#define SCSI_EVPD_NUM_SUPPORTED_PAGES	5
+#define SCSI_EVPD_NUM_SUPPORTED_PAGES	6
 
 static void ctl_isc_event_handler(ctl_ha_channel chanel, ctl_ha_event event,
 				  int param);
@@ -376,6 +377,8 @@ static void ctl_hndl_per_res_out_on_othe
 static int ctl_inquiry_evpd_supported(struct ctl_scsiio *ctsio, int alloc_len);
 static int ctl_inquiry_evpd_serial(struct ctl_scsiio *ctsio, int alloc_len);
 static int ctl_inquiry_evpd_devid(struct ctl_scsiio *ctsio, int alloc_len);
+static int ctl_inquiry_evpd_scsi_ports(struct ctl_scsiio *ctsio,
+					 int alloc_len);
 static int ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio,
 					 int alloc_len);
 static int ctl_inquiry_evpd_lbp(struct ctl_scsiio *ctsio, int alloc_len);
@@ -7238,7 +7241,7 @@ ctl_report_tagret_port_groups(struct ctl
 			    TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED;
 		tpg_desc->support = TPG_AO_SUP;
 		if (!single)
-			tpg_desc->support = TPG_AN_SUP;
+			tpg_desc->support |= TPG_AN_SUP;
 		scsi_ulto2b(g + 1, tpg_desc->target_port_group);
 		tpg_desc->status = TPG_IMPLICIT;
 		pc = 0;
@@ -9626,10 +9629,12 @@ ctl_inquiry_evpd_supported(struct ctl_sc
 	pages->page_list[1] = SVPD_UNIT_SERIAL_NUMBER;
 	/* Device Identification */
 	pages->page_list[2] = SVPD_DEVICE_ID;
+	/* SCSI Ports */
+	pages->page_list[3] = SVPD_SCSI_PORTS;
 	/* Block limits */
-	pages->page_list[3] = SVPD_BLOCK_LIMITS;
+	pages->page_list[4] = SVPD_BLOCK_LIMITS;
 	/* Logical Block Provisioning */
-	pages->page_list[4] = SVPD_LBP;
+	pages->page_list[5] = SVPD_LBP;
 
 	ctsio->scsi_status = SCSI_STATUS_OK;
 
@@ -9820,6 +9825,117 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio
 }
 
 static int
+ctl_inquiry_evpd_scsi_ports(struct ctl_scsiio *ctsio, int alloc_len)
+{
+	struct ctl_softc *softc = control_softc;
+	struct scsi_vpd_scsi_ports *sp;
+	struct scsi_vpd_port_designation *pd;
+	struct scsi_vpd_port_designation_cont *pdc;
+	struct ctl_lun *lun;
+	struct ctl_port *port;
+	int data_len, num_target_ports, id_len, g, pg, p;
+	int num_target_port_groups, single;
+
+	lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
+
+	single = ctl_is_single;
+	if (single)
+		num_target_port_groups = 1;
+	else
+		num_target_port_groups = NUM_TARGET_PORT_GROUPS;
+	num_target_ports = 0;
+	id_len = 0;
+	mtx_lock(&softc->ctl_lock);
+	STAILQ_FOREACH(port, &softc->port_list, links) {
+		if ((port->status & CTL_PORT_STATUS_ONLINE) == 0)
+			continue;
+		if (ctl_map_lun_back(port->targ_port, lun->lun) >=
+		    CTL_MAX_LUNS)
+			continue;
+		num_target_ports++;
+		if (port->port_devid)
+			id_len += port->port_devid->len;
+	}
+	mtx_unlock(&softc->ctl_lock);
+
+	data_len = sizeof(struct scsi_vpd_scsi_ports) + num_target_port_groups *
+	    num_target_ports * (sizeof(struct scsi_vpd_port_designation) +
+	     sizeof(struct scsi_vpd_port_designation_cont)) + id_len;
+	ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO);
+	sp = (struct scsi_vpd_scsi_ports *)ctsio->kern_data_ptr;
+	ctsio->kern_sg_entries = 0;
+
+	if (data_len < alloc_len) {
+		ctsio->residual = alloc_len - data_len;
+		ctsio->kern_data_len = data_len;
+		ctsio->kern_total_len = data_len;
+	} else {
+		ctsio->residual = 0;
+		ctsio->kern_data_len = alloc_len;
+		ctsio->kern_total_len = alloc_len;
+	}
+	ctsio->kern_data_resid = 0;
+	ctsio->kern_rel_offset = 0;
+	ctsio->kern_sg_entries = 0;
+
+	/*
+	 * The control device is always connected.  The disk device, on the
+	 * other hand, may not be online all the time.  Need to change this
+	 * to figure out whether the disk device is actually online or not.
+	 */
+	if (lun != NULL)
+		sp->device = (SID_QUAL_LU_CONNECTED << 5) |
+				  lun->be_lun->lun_type;
+	else
+		sp->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT;
+
+	sp->page_code = SVPD_SCSI_PORTS;
+	scsi_ulto2b(data_len - sizeof(struct scsi_vpd_scsi_ports),
+	    sp->page_length);
+	pd = &sp->design[0];
+
+	mtx_lock(&softc->ctl_lock);
+	if (softc->flags & CTL_FLAG_MASTER_SHELF)
+		pg = 0;
+	else
+		pg = 1;
+	for (g = 0; g < num_target_port_groups; g++) {
+		STAILQ_FOREACH(port, &softc->port_list, links) {
+			if ((port->status & CTL_PORT_STATUS_ONLINE) == 0)
+				continue;
+			if (ctl_map_lun_back(port->targ_port, lun->lun) >=
+			    CTL_MAX_LUNS)
+				continue;
+			p = port->targ_port % CTL_MAX_PORTS + g * CTL_MAX_PORTS;
+			scsi_ulto2b(p, pd->relative_port_id);
+			scsi_ulto2b(0, pd->initiator_transportid_length);
+			pdc = (struct scsi_vpd_port_designation_cont *)
+			    &pd->initiator_transportid[0];
+			if (port->port_devid && g == pg) {
+				id_len = port->port_devid->len;
+				scsi_ulto2b(port->port_devid->len,
+				    pdc->target_port_descriptors_length);
+				memcpy(pdc->target_port_descriptors,
+				    port->port_devid->data, port->port_devid->len);
+			} else {
+				id_len = 0;
+				scsi_ulto2b(0, pdc->target_port_descriptors_length);
+			}
+			pd = (struct scsi_vpd_port_designation *)
+			    ((uint8_t *)pdc->target_port_descriptors + id_len);
+		}
+	}
+	mtx_unlock(&softc->ctl_lock);
+
+	ctsio->scsi_status = SCSI_STATUS_OK;
+	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
+	ctsio->be_move_done = ctl_config_move_done;
+	ctl_datamove((union ctl_io *)ctsio);
+
+	return (CTL_RETVAL_COMPLETE);
+}
+
+static int
 ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio, int alloc_len)
 {
 	struct scsi_vpd_block_limits *bl_ptr;
@@ -9950,6 +10066,9 @@ ctl_inquiry_evpd(struct ctl_scsiio *ctsi
 	case SVPD_DEVICE_ID:
 		retval = ctl_inquiry_evpd_devid(ctsio, alloc_len);
 		break;
+	case SVPD_SCSI_PORTS:
+		retval = ctl_inquiry_evpd_scsi_ports(ctsio, alloc_len);
+		break;
 	case SVPD_BLOCK_LIMITS:
 		retval = ctl_inquiry_evpd_block_limits(ctsio, alloc_len);
 		break;

Modified: head/sys/cam/scsi/scsi_all.h
==============================================================================
--- head/sys/cam/scsi/scsi_all.h	Sun Jul  6 07:02:36 2014	(r268308)
+++ head/sys/cam/scsi/scsi_all.h	Sun Jul  6 07:34:18 2014	(r268309)
@@ -1733,6 +1733,31 @@ struct scsi_diag_page {
 	uint8_t params[0];
 };
 
+struct scsi_vpd_port_designation
+{
+	uint8_t reserved[2];
+	uint8_t relative_port_id[2];
+	uint8_t reserved2[2];
+	uint8_t initiator_transportid_length[2];
+	uint8_t initiator_transportid[0];
+};
+
+struct scsi_vpd_port_designation_cont
+{
+	uint8_t reserved[2];
+	uint8_t target_port_descriptors_length[2];
+	struct scsi_vpd_id_descriptor target_port_descriptors[0];
+};
+
+struct scsi_vpd_scsi_ports
+{
+	u_int8_t device;
+	u_int8_t page_code;
+#define	SVPD_SCSI_PORTS		0x88
+	u_int8_t page_length[2];
+	struct scsi_vpd_port_designation design[];
+};
+
 /*
  * ATA Information VPD Page based on
  * T10/2126-D Revision 04
@@ -1923,8 +1948,9 @@ struct scsi_target_group
 {
 	uint8_t opcode;
 	uint8_t service_action;
+#define	STG_PDF_MASK		0xe0
 #define	STG_PDF_LENGTH		0x00
-#define	RPL_PDF_EXTENDED	0x20
+#define	STG_PDF_EXTENDED	0x20
 	uint8_t reserved1[4];
 	uint8_t length[4];
 	uint8_t reserved2;
@@ -1974,7 +2000,7 @@ struct scsi_target_group_data {
 
 struct scsi_target_group_data_extended {
 	uint8_t length[4];	/* length of returned data, in bytes */
-	uint8_t format_type;	/* STG_PDF_LENGTH or RPL_PDF_EXTENDED */
+	uint8_t format_type;	/* STG_PDF_LENGTH or STG_PDF_EXTENDED */
 	uint8_t	implicit_transition_time;
 	uint8_t reserved[2];
 	struct scsi_target_port_group_descriptor groups[];

From owner-svn-src-head@FreeBSD.ORG  Sun Jul  6 10:24:06 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id CFFA7AA2;
 Sun,  6 Jul 2014 10:24:06 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A345C24CA;
 Sun,  6 Jul 2014 10:24:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s66AO6n1012249;
 Sun, 6 Jul 2014 10:24:06 GMT (envelope-from andrew@svn.freebsd.org)
Received: (from andrew@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66AO6R9012248;
 Sun, 6 Jul 2014 10:24:06 GMT (envelope-from andrew@svn.freebsd.org)
Message-Id: <201407061024.s66AO6R9012248@svn.freebsd.org>
From: Andrew Turner 
Date: Sun, 6 Jul 2014 10:24:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268310 - head/libexec/rtld-elf/arm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 06 Jul 2014 10:24:06 -0000

Author: andrew
Date: Sun Jul  6 10:24:06 2014
New Revision: 268310
URL: http://svnweb.freebsd.org/changeset/base/268310

Log:
  Align the stack in _rtld_bind_start. Normally this is called with the
  correct stack alignment, however when we have a leaf function that uses
  thread local storage it calls __aeabi_read_tp to get the thread pointer.
  Neither GCC or clang see this as a function call so will align the stack
  to a 4-byte boundary. This may be a problem as _rtld_bind expects to be
  on an 8-byte boundary.
  
  The solution is to store a copy of the stack pointer and force the
  alignment before calling _rtld_bind.
  
  This fixes a problem with armeb where applications would crash in odd ways.
  It should also remove the need for a local patch to clang to force the
  stack alignment to an 8-byte boundary, even for leaf functions. Further
  testing will be needed before reverting this local change to clang as we
  may rely on it in other places.
  
  Reviewed by:	jmg@

Modified:
  head/libexec/rtld-elf/arm/rtld_start.S

Modified: head/libexec/rtld-elf/arm/rtld_start.S
==============================================================================
--- head/libexec/rtld-elf/arm/rtld_start.S	Sun Jul  6 07:34:18 2014	(r268309)
+++ head/libexec/rtld-elf/arm/rtld_start.S	Sun Jul  6 10:24:06 2014	(r268310)
@@ -77,7 +77,7 @@ __FBSDID("$FreeBSD$");
  *	lr = &GOT[2]
  */
 _rtld_bind_start:
-	stmdb	sp!,{r0-r4,sl,fp}
+	stmdb	sp!,{r0-r5,sl,fp}
 
 	sub	r1, ip, lr		/* r1 = 4 * (n + 1) */
 	sub	r1, r1, #4		/* r1 = 4 * n */
@@ -86,11 +86,14 @@ _rtld_bind_start:
 	ldr	r0, [lr, #-4]		/* get obj ptr from GOT[1] */
 	mov	r4, ip			/* save GOT location */
 
+	mov	r5, sp			/* Save the stack pointer */
+	bic	sp, sp, #7		/* Align the stack pointer */
 	bl	_rtld_bind		/* Call the binder */
+	mov	sp, r5			/* Restore the old stack pointer */
 
 	str	r0, [r4]		/* save address in GOT */
 	mov	ip, r0			/* save new address */
 
-	ldmia	sp!,{r0-r4,sl,fp,lr}	/* restore the stack */
+	ldmia	sp!,{r0-r5,sl,fp,lr}	/* restore the stack */
 	mov	pc, ip			/* jump to the new address */
 

From owner-svn-src-head@FreeBSD.ORG  Sun Jul  6 13:04:52 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A41AC96F;
 Sun,  6 Jul 2014 13:04:52 +0000 (UTC)
Received: from fep22.mx.upcmail.net (fep22.mx.upcmail.net [62.179.121.42])
 by mx1.freebsd.org (Postfix) with ESMTP id 63B792059;
 Sun,  6 Jul 2014 13:04:50 +0000 (UTC)
Received: from edge04.upcmail.net ([192.168.13.239]) by viefep20-int.chello.at
 (InterMail vM.8.01.05.13 201-2260-151-135-20130320) with ESMTP
 id <20140706130435.WXLZ5688.viefep20-int.chello.at@edge04.upcmail.net>;
 Sun, 6 Jul 2014 15:04:35 +0200
Received: from mole.fafoe.narf.at ([80.109.55.137])
 by edge04.upcmail.net with edge
 id P14b1o00K2xdvHc0314bk4; Sun, 06 Jul 2014 15:04:35 +0200
X-SourceIP: 80.109.55.137
Received: by mole.fafoe.narf.at (Postfix, from userid 1001)
 id 15B296D456; Sun,  6 Jul 2014 15:04:35 +0200 (CEST)
Date: Sun, 6 Jul 2014 15:04:34 +0200
From: Stefan Farfeleder 
To: Ed Maste 
Subject: Re: svn commit: r268045 - in head/sys: amd64/conf i386/conf
Message-ID: <20140706130434.GA1294@mole.fafoe.narf.at>
References: <201406301618.s5UGIcDr079532@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201406301618.s5UGIcDr079532@svn.freebsd.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 06 Jul 2014 13:04:52 -0000

On Mon, Jun 30, 2014 at 04:18:38PM +0000, Ed Maste wrote:
> Author: emaste
> Date: Mon Jun 30 16:18:38 2014
> New Revision: 268045
> URL: http://svnweb.freebsd.org/changeset/base/268045
> 
> Log:
>   Add vt(4) to GENERIC and retire the separate VT config
>   
>   vt(4) and sc(4) can now coexist in the same kernel.  To choose the vt
>   driver, set the loader tunable kern.vty=vt .

Hi Ed,

I just added `device vt' to my kernel and set kern.vty=vt, but got no
output at all upon rebooting. I tried setting hw.vga.textmode=1 as found
in the man page but that didn't change anything.

Only on the Wiki page I then found I need `device vt_vga' as well. With
this it works for me now. In case it matters I have an nVidia graphic
card and nvidia.ko loaded.

Would it be possible to make this a runtime printf if missing? Or at
least it should be added to vt(4) (there doesn't seem to be a man page
for vt_vga) and maybe UPDATING.

BR,
Stefan

From owner-svn-src-head@FreeBSD.ORG  Sun Jul  6 14:14:08 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 2CC482C4;
 Sun,  6 Jul 2014 14:14:08 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1A39C2573;
 Sun,  6 Jul 2014 14:14:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s66EE7G5020738;
 Sun, 6 Jul 2014 14:14:07 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66EE7am020737;
 Sun, 6 Jul 2014 14:14:07 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201407061414.s66EE7am020737@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Sun, 6 Jul 2014 14:14:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268314 - head/sys/ofed/drivers/infiniband/hw/mlx4
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 06 Jul 2014 14:14:08 -0000

Author: hselasky
Date: Sun Jul  6 14:14:07 2014
New Revision: 268314
URL: http://svnweb.freebsd.org/changeset/base/268314

Log:
  Fix some compile warnings.
  
  MFC after:	4 weeks
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/ofed/drivers/infiniband/hw/mlx4/qp.c

Modified: head/sys/ofed/drivers/infiniband/hw/mlx4/qp.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/hw/mlx4/qp.c	Sun Jul  6 14:04:48 2014	(r268313)
+++ head/sys/ofed/drivers/infiniband/hw/mlx4/qp.c	Sun Jul  6 14:14:07 2014	(r268314)
@@ -264,7 +264,7 @@ static void post_nop_wqe(struct mlx4_ib_
 	/* Pad the remainder of the WQE with an inline data segment. */
 	if (size > s) {
 		inl = wqe + s;
-		inl->byte_count = cpu_to_be32(1 << 31 | (size - s - sizeof *inl));
+		inl->byte_count = cpu_to_be32(1U << 31 | (size - s - sizeof *inl));
 	}
 	ctrl->srcrb_flags = 0;
 	ctrl->fence_size = size / 16;
@@ -1146,7 +1146,7 @@ static void mlx4_ib_lock_cqs(struct mlx4
 {
 	if (send_cq == recv_cq) {
 		spin_lock_irq(&send_cq->lock);
-		__acquire(&recv_cq->lock);
+		(void) __acquire(&recv_cq->lock);
 	} else if (send_cq->mcq.cqn < recv_cq->mcq.cqn) {
 		spin_lock_irq(&send_cq->lock);
 		spin_lock_nested(&recv_cq->lock, SINGLE_DEPTH_NESTING);
@@ -1160,7 +1160,7 @@ static void mlx4_ib_unlock_cqs(struct ml
 	__releases(&send_cq->lock) __releases(&recv_cq->lock)
 {
 	if (send_cq == recv_cq) {
-		__release(&recv_cq->lock);
+		(void) __release(&recv_cq->lock);
 		spin_unlock_irq(&send_cq->lock);
 	} else if (send_cq->mcq.cqn < recv_cq->mcq.cqn) {
 		spin_unlock(&recv_cq->lock);
@@ -2422,11 +2422,11 @@ static int build_sriov_qp0_header(struct
 	spc = MLX4_INLINE_ALIGN -
 	      ((unsigned long) (inl + 1) & (MLX4_INLINE_ALIGN - 1));
 	if (header_size <= spc) {
-		inl->byte_count = cpu_to_be32(1 << 31 | header_size);
+		inl->byte_count = cpu_to_be32(1U << 31 | header_size);
 		memcpy(inl + 1, sqp->header_buf, header_size);
 		i = 1;
 	} else {
-		inl->byte_count = cpu_to_be32(1 << 31 | spc);
+		inl->byte_count = cpu_to_be32(1U << 31 | spc);
 		memcpy(inl + 1, sqp->header_buf, spc);
 
 		inl = (void *) (inl + 1) + spc;
@@ -2445,7 +2445,7 @@ static int build_sriov_qp0_header(struct
 		 * of 16 mod 64.
 		 */
 		wmb();
-		inl->byte_count = cpu_to_be32(1 << 31 | (header_size - spc));
+		inl->byte_count = cpu_to_be32(1U << 31 | (header_size - spc));
 		i = 2;
 	}
 
@@ -2629,11 +2629,11 @@ static int build_mlx_header(struct mlx4_
 	spc = MLX4_INLINE_ALIGN -
 		((unsigned long) (inl + 1) & (MLX4_INLINE_ALIGN - 1));
 	if (header_size <= spc) {
-		inl->byte_count = cpu_to_be32(1 << 31 | header_size);
+		inl->byte_count = cpu_to_be32(1U << 31 | header_size);
 		memcpy(inl + 1, sqp->header_buf, header_size);
 		i = 1;
 	} else {
-		inl->byte_count = cpu_to_be32(1 << 31 | spc);
+		inl->byte_count = cpu_to_be32(1U << 31 | spc);
 		memcpy(inl + 1, sqp->header_buf, spc);
 
 		inl = (void *) (inl + 1) + spc;
@@ -2652,7 +2652,7 @@ static int build_mlx_header(struct mlx4_
 		 * of 16 mod 64.
 		 */
 		wmb();
-		inl->byte_count = cpu_to_be32(1 << 31 | (header_size - spc));
+		inl->byte_count = cpu_to_be32(1U << 31 | (header_size - spc));
 		i = 2;
 	}
 
@@ -2797,17 +2797,17 @@ static void build_tunnel_header(struct i
 	if (sizeof (hdr) <= spc) {
 		memcpy(inl + 1, &hdr, sizeof (hdr));
 		wmb();
-		inl->byte_count = cpu_to_be32(1 << 31 | sizeof (hdr));
+		inl->byte_count = cpu_to_be32(1U << 31 | sizeof (hdr));
 		i = 1;
 	} else {
 		memcpy(inl + 1, &hdr, spc);
 		wmb();
-		inl->byte_count = cpu_to_be32(1 << 31 | spc);
+		inl->byte_count = cpu_to_be32(1U << 31 | spc);
 
 		inl = (void *) (inl + 1) + spc;
 		memcpy(inl + 1, (void *) &hdr + spc, sizeof (hdr) - spc);
 		wmb();
-		inl->byte_count = cpu_to_be32(1 << 31 | (sizeof (hdr) - spc));
+		inl->byte_count = cpu_to_be32(1U << 31 | (sizeof (hdr) - spc));
 		i = 2;
 	}
 

From owner-svn-src-head@FreeBSD.ORG  Sun Jul  6 14:20:47 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 910F6615;
 Sun,  6 Jul 2014 14:20:47 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7DBC625D0;
 Sun,  6 Jul 2014 14:20:47 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s66EKluo022456;
 Sun, 6 Jul 2014 14:20:47 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66EKltE022455;
 Sun, 6 Jul 2014 14:20:47 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201407061420.s66EKltE022455@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Sun, 6 Jul 2014 14:20:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268315 - head/sys/ofed/drivers/infiniband/hw/mlx4
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 06 Jul 2014 14:20:47 -0000

Author: hselasky
Date: Sun Jul  6 14:20:47 2014
New Revision: 268315
URL: http://svnweb.freebsd.org/changeset/base/268315

Log:
  Fix compile warning.
  
  MFC after:	4 weeks
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/ofed/drivers/infiniband/hw/mlx4/mcg.c

Modified: head/sys/ofed/drivers/infiniband/hw/mlx4/mcg.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/hw/mlx4/mcg.c	Sun Jul  6 14:14:07 2014	(r268314)
+++ head/sys/ofed/drivers/infiniband/hw/mlx4/mcg.c	Sun Jul  6 14:20:47 2014	(r268315)
@@ -665,7 +665,7 @@ static void mlx4_ib_mcg_work_handler(str
 			if (!list_empty(&group->pending_list))
 				req = list_first_entry(&group->pending_list,
 						struct mcast_req, group_list);
-			if ((method == IB_MGMT_METHOD_GET_RESP)) {
+			if (method == IB_MGMT_METHOD_GET_RESP) {
 					if (req) {
 						send_reply_to_slave(req->func, group, &req->sa_mad, status);
 						--group->func[req->func].num_pend_reqs;

From owner-svn-src-head@FreeBSD.ORG  Sun Jul  6 14:22:14 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 531FD7B9;
 Sun,  6 Jul 2014 14:22:14 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3F3152657;
 Sun,  6 Jul 2014 14:22:14 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s66EMEt9025263;
 Sun, 6 Jul 2014 14:22:14 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66EMD61025258;
 Sun, 6 Jul 2014 14:22:13 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201407061422.s66EMD61025258@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Sun, 6 Jul 2014 14:22:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268316 - in head/sys/ofed: drivers/infiniband/hw/mlx4
 drivers/net/mlx4 include/linux
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 06 Jul 2014 14:22:14 -0000

Author: hselasky
Date: Sun Jul  6 14:22:13 2014
New Revision: 268316
URL: http://svnweb.freebsd.org/changeset/base/268316

Log:
  Fix OFED startup order: All SYSINIT()'s and modules should be loaded
  prior to starting "/sbin/init" which will run all the "/etc/rc.d/xxx"
  scripts. Else there can be a race configuring the interfaces via
  "/etc/rc.conf".
  
  MFC after:	4 weeks
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/ofed/drivers/infiniband/hw/mlx4/main.c
  head/sys/ofed/drivers/net/mlx4/en_main.c
  head/sys/ofed/drivers/net/mlx4/main.c
  head/sys/ofed/include/linux/module.h

Modified: head/sys/ofed/drivers/infiniband/hw/mlx4/main.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/hw/mlx4/main.c	Sun Jul  6 14:20:47 2014	(r268315)
+++ head/sys/ofed/drivers/infiniband/hw/mlx4/main.c	Sun Jul  6 14:22:13 2014	(r268316)
@@ -2414,6 +2414,6 @@ static moduledata_t mlx4ib_mod = {
         .evhand = mlx4ib_evhand,
 };
 
-DECLARE_MODULE(mlx4ib, mlx4ib_mod, SI_SUB_SMP, SI_ORDER_ANY);
+DECLARE_MODULE(mlx4ib, mlx4ib_mod, SI_SUB_OFED_PREINIT, SI_ORDER_ANY);
 MODULE_DEPEND(mlx4ib, mlx4, 1, 1, 1);
 MODULE_DEPEND(mlx4ib, ibcore, 1, 1, 1);

Modified: head/sys/ofed/drivers/net/mlx4/en_main.c
==============================================================================
--- head/sys/ofed/drivers/net/mlx4/en_main.c	Sun Jul  6 14:20:47 2014	(r268315)
+++ head/sys/ofed/drivers/net/mlx4/en_main.c	Sun Jul  6 14:22:13 2014	(r268316)
@@ -383,5 +383,5 @@ static moduledata_t mlxen_mod = {
         .name = "mlxen",
 	.evhand = mlxen_evhand,
 };
-DECLARE_MODULE(mlxen, mlxen_mod, SI_SUB_SMP, SI_ORDER_ANY);
+DECLARE_MODULE(mlxen, mlxen_mod, SI_SUB_OFED_PREINIT, SI_ORDER_ANY);
 MODULE_DEPEND(mlxen, mlx4, 1, 1, 1);

Modified: head/sys/ofed/drivers/net/mlx4/main.c
==============================================================================
--- head/sys/ofed/drivers/net/mlx4/main.c	Sun Jul  6 14:20:47 2014	(r268315)
+++ head/sys/ofed/drivers/net/mlx4/main.c	Sun Jul  6 14:22:13 2014	(r268316)
@@ -2875,4 +2875,4 @@ static moduledata_t mlx4_mod = {
 	.evhand = mlx4_evhand,
 };
 MODULE_VERSION(mlx4, 1);
-DECLARE_MODULE(mlx4, mlx4_mod, SI_SUB_SMP, SI_ORDER_ANY);
+DECLARE_MODULE(mlx4, mlx4_mod, SI_SUB_OFED_PREINIT, SI_ORDER_ANY);

Modified: head/sys/ofed/include/linux/module.h
==============================================================================
--- head/sys/ofed/include/linux/module.h	Sun Jul  6 14:20:47 2014	(r268315)
+++ head/sys/ofed/include/linux/module.h	Sun Jul  6 14:22:13 2014	(r268316)
@@ -44,6 +44,11 @@
 #define	EXPORT_SYMBOL(name)
 #define	EXPORT_SYMBOL_GPL(name)
 
+/* OFED pre-module initialization */
+#define	SI_SUB_OFED_PREINIT	(SI_SUB_KTHREAD_INIT - 2)
+/* OFED default module initialization */
+#define	SI_SUB_OFED_MODINIT	(SI_SUB_KTHREAD_INIT - 1)
+
 #include 
 
 static inline void
@@ -68,17 +73,17 @@ _module_run(void *arg)
 }
 
 #define	module_init(fn)							\
-	SYSINIT(fn, SI_SUB_LAST, SI_ORDER_FIRST, _module_run, (fn))
+	SYSINIT(fn, SI_SUB_OFED_MODINIT, SI_ORDER_FIRST, _module_run, (fn))
 
 /*
  * XXX This is a freebsdism designed to work around not having a module
  * load order resolver built in.
  */
 #define	module_init_order(fn, order)					\
-	SYSINIT(fn, SI_SUB_LAST, (order), _module_run, (fn))
+	SYSINIT(fn, SI_SUB_OFED_MODINIT, (order), _module_run, (fn))
 
 #define	module_exit(fn)						\
-	SYSUNINIT(fn, SI_SUB_LAST, SI_ORDER_FIRST, _module_run, (fn))
+	SYSUNINIT(fn, SI_SUB_OFED_MODINIT, SI_ORDER_FIRST, _module_run, (fn))
 
 #define	module_get(module)
 #define	module_put(module)

From owner-svn-src-head@FreeBSD.ORG  Sun Jul  6 16:19:56 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 76E3A7F9;
 Sun,  6 Jul 2014 16:19:56 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 635872E9A;
 Sun,  6 Jul 2014 16:19:56 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s66GJufI081154;
 Sun, 6 Jul 2014 16:19:56 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66GJupD081152;
 Sun, 6 Jul 2014 16:19:56 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201407061619.s66GJupD081152@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Sun, 6 Jul 2014 16:19:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268320 - in head/sys/powerpc: include powerpc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 06 Jul 2014 16:19:56 -0000

Author: nwhitehorn
Date: Sun Jul  6 16:19:55 2014
New Revision: 268320
URL: http://svnweb.freebsd.org/changeset/base/268320

Log:
  Add a new CPU id for a POWER8 variant.

Modified:
  head/sys/powerpc/include/spr.h
  head/sys/powerpc/powerpc/cpu.c

Modified: head/sys/powerpc/include/spr.h
==============================================================================
--- head/sys/powerpc/include/spr.h	Sun Jul  6 16:05:32 2014	(r268319)
+++ head/sys/powerpc/include/spr.h	Sun Jul  6 16:19:55 2014	(r268320)
@@ -169,7 +169,8 @@
 #define	  IBM970MP		  0x0044
 #define	  IBM970GX		  0x0045
 #define	  IBMPOWER7PLUS		  0x004a
-#define	  IBMPOWER8		  0x004b
+#define	  IBMPOWER8E		  0x004b
+#define	  IBMPOWER8		  0x004d
 #define	  MPC860		  0x0050
 #define	  IBMCELLBE		  0x0070
 #define	  MPC8240		  0x0081

Modified: head/sys/powerpc/powerpc/cpu.c
==============================================================================
--- head/sys/powerpc/powerpc/cpu.c	Sun Jul  6 16:05:32 2014	(r268319)
+++ head/sys/powerpc/powerpc/cpu.c	Sun Jul  6 16:19:55 2014	(r268320)
@@ -146,6 +146,9 @@ static const struct cputab models[] = {
         { "IBM POWER7+",	IBMPOWER7PLUS,	REVFMT_MAJMIN,
 	   PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU,
 	   NULL },
+        { "IBM POWER8E",	IBMPOWER8E,	REVFMT_MAJMIN,
+	   PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU,
+	   NULL },
         { "IBM POWER8",		IBMPOWER8,	REVFMT_MAJMIN,
 	   PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU,
 	   NULL },

From owner-svn-src-head@FreeBSD.ORG  Sun Jul  6 16:20:38 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3CD8695E;
 Sun,  6 Jul 2014 16:20:38 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 29A4D2F07;
 Sun,  6 Jul 2014 16:20:38 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s66GKc5W081376;
 Sun, 6 Jul 2014 16:20:38 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66GKce3081375;
 Sun, 6 Jul 2014 16:20:38 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201407061620.s66GKce3081375@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Sun, 6 Jul 2014 16:20:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268321 - head/sys/powerpc/include
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 06 Jul 2014 16:20:38 -0000

Author: nwhitehorn
Date: Sun Jul  6 16:20:37 2014
New Revision: 268321
URL: http://svnweb.freebsd.org/changeset/base/268321

Log:
  In case we ever support little-endian PowerPC (probably userland only),
  avoid hardcoding endianness here.

Modified:
  head/sys/powerpc/include/endian.h

Modified: head/sys/powerpc/include/endian.h
==============================================================================
--- head/sys/powerpc/include/endian.h	Sun Jul  6 16:19:55 2014	(r268320)
+++ head/sys/powerpc/include/endian.h	Sun Jul  6 16:20:37 2014	(r268321)
@@ -39,8 +39,13 @@
 /*
  * Define the order of 32-bit words in 64-bit words.
  */
+#ifdef __LITTLE_ENDIAN__
+#define	_QUAD_HIGHWORD 1
+#define	_QUAD_LOWWORD 0
+#else
 #define	_QUAD_HIGHWORD 0
 #define	_QUAD_LOWWORD 1
+#endif
 
 /*
  * GCC defines _BIG_ENDIAN and _LITTLE_ENDIAN equal to __BIG_ENDIAN__
@@ -131,9 +136,16 @@ __bswap64_var(__uint64_t _x)
 #define	__bswap64(x)	(__is_constant(x) ? __bswap64_const(x) : \
 	__bswap64_var(x))
 
+#ifdef __LITTLE_ENDIAN__
+#define	__htonl(x)	(__bswap32((__uint32_t)(x)))
+#define	__htons(x)	(__bswap16((__uint16_t)(x)))
+#define	__ntohl(x)	(__bswap32((__uint32_t)(x)))
+#define	__ntohs(x)	(__bswap16((__uint16_t)(x)))
+#else
 #define	__htonl(x)	((__uint32_t)(x))
 #define	__htons(x)	((__uint16_t)(x))
 #define	__ntohl(x)	((__uint32_t)(x))
 #define	__ntohs(x)	((__uint16_t)(x))
+#endif
 
 #endif /* !_MACHINE_ENDIAN_H_ */

From owner-svn-src-head@FreeBSD.ORG  Sun Jul  6 17:37:50 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D09D2566;
 Sun,  6 Jul 2014 17:37:50 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BCBCC24B5;
 Sun,  6 Jul 2014 17:37:50 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s66HboNb018385;
 Sun, 6 Jul 2014 17:37:50 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66HbnLi018378;
 Sun, 6 Jul 2014 17:37:49 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407061737.s66HbnLi018378@svn.freebsd.org>
From: Alexander Motin 
Date: Sun, 6 Jul 2014 17:37:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268326 - in head: sys/dev/iscsi usr.sbin/iscsid
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 06 Jul 2014 17:37:50 -0000

Author: mav
Date: Sun Jul  6 17:37:49 2014
New Revision: 268326
URL: http://svnweb.freebsd.org/changeset/base/268326

Log:
  Make iSCSI initiator keep Initiator Session ID (ISID) across reconnects.
  
  Previously ISID was changed every time, that made impossible correct
  persistent reservation, because reconnected session was identified as
  completely new one.
  
  Reviewed by:	trasz
  MFC after:	1 week

Modified:
  head/sys/dev/iscsi/iscsi.c
  head/sys/dev/iscsi/iscsi.h
  head/sys/dev/iscsi/iscsi_ioctl.h
  head/usr.sbin/iscsid/iscsid.c
  head/usr.sbin/iscsid/iscsid.h
  head/usr.sbin/iscsid/login.c

Modified: head/sys/dev/iscsi/iscsi.c
==============================================================================
--- head/sys/dev/iscsi/iscsi.c	Sun Jul  6 17:29:19 2014	(r268325)
+++ head/sys/dev/iscsi/iscsi.c	Sun Jul  6 17:37:49 2014	(r268326)
@@ -1221,6 +1221,9 @@ iscsi_ioctl_daemon_wait(struct iscsi_sof
 		ISCSI_SESSION_UNLOCK(is);
 
 		request->idr_session_id = is->is_id;
+		memcpy(&request->idr_isid, &is->is_isid,
+		    sizeof(request->idr_isid));
+		request->idr_tsih = 0;	/* New or reinstated session. */
 		memcpy(&request->idr_conf, &is->is_conf,
 		    sizeof(request->idr_conf));
 
@@ -1270,7 +1273,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_
 
 	strlcpy(is->is_target_alias, handoff->idh_target_alias,
 	    sizeof(is->is_target_alias));
-	memcpy(is->is_isid, handoff->idh_isid, sizeof(is->is_isid));
+	is->is_tsih = handoff->idh_tsih;
 	is->is_statsn = handoff->idh_statsn;
 	is->is_initial_r2t = handoff->idh_initial_r2t;
 	is->is_immediate_data = handoff->idh_immediate_data;
@@ -1663,6 +1666,9 @@ iscsi_ioctl_session_add(struct iscsi_sof
 	is->is_softc = sc;
 	sc->sc_last_session_id++;
 	is->is_id = sc->sc_last_session_id;
+	is->is_isid[0] = 0x80; /* RFC 3720, 10.12.5: 10b, "Random" ISID. */
+	arc4rand(&is->is_isid[1], 5, 0);
+	is->is_tsih = 0;
 	callout_init(&is->is_callout, 1);
 	callout_reset(&is->is_callout, 1 * hz, iscsi_callout, is);
 	TAILQ_INSERT_TAIL(&sc->sc_sessions, is, is_next);

Modified: head/sys/dev/iscsi/iscsi.h
==============================================================================
--- head/sys/dev/iscsi/iscsi.h	Sun Jul  6 17:29:19 2014	(r268325)
+++ head/sys/dev/iscsi/iscsi.h	Sun Jul  6 17:37:49 2014	(r268326)
@@ -64,6 +64,7 @@ struct iscsi_session {
 	size_t				is_max_burst_length;
 	size_t				is_first_burst_length;
 	uint8_t				is_isid[6];
+	uint16_t			is_tsih;
 	bool				is_immediate_data;
 	size_t				is_max_data_segment_length;
 	char				is_target_alias[ISCSI_ALIAS_LEN];

Modified: head/sys/dev/iscsi/iscsi_ioctl.h
==============================================================================
--- head/sys/dev/iscsi/iscsi_ioctl.h	Sun Jul  6 17:29:19 2014	(r268325)
+++ head/sys/dev/iscsi/iscsi_ioctl.h	Sun Jul  6 17:37:49 2014	(r268326)
@@ -91,8 +91,8 @@ struct iscsi_session_state {
 struct iscsi_daemon_request {
 	unsigned int			idr_session_id;
 	struct iscsi_session_conf	idr_conf;
-	uint8_t				idr_spare_isid[6];
-	uint16_t			idr_spare_tsih;
+	uint8_t				idr_isid[6];
+	uint16_t			idr_tsih;
 	uint16_t			idr_spare_cid;
 	int				idr_spare[4];
 };
@@ -101,9 +101,9 @@ struct iscsi_daemon_handoff {
 	unsigned int			idh_session_id;
 	int				idh_socket;
 	char				idh_target_alias[ISCSI_ALIAS_LEN];
-	uint8_t				idh_isid[6];
-	uint16_t			idr_spare_tsih;
-	uint16_t			idr_spare_cid;
+	uint8_t				idh_spare_isid[6];
+	uint16_t			idh_tsih;
+	uint16_t			idh_spare_cid;
 	uint32_t			idh_statsn;
 	int				idh_header_digest;
 	int				idh_data_digest;

Modified: head/usr.sbin/iscsid/iscsid.c
==============================================================================
--- head/usr.sbin/iscsid/iscsid.c	Sun Jul  6 17:29:19 2014	(r268325)
+++ head/usr.sbin/iscsid/iscsid.c	Sun Jul  6 17:37:49 2014	(r268326)
@@ -149,8 +149,8 @@ resolve_addr(const struct connection *co
 }
 
 static struct connection *
-connection_new(unsigned int session_id, const struct iscsi_session_conf *conf,
-    int iscsi_fd)
+connection_new(unsigned int session_id, const uint8_t isid[8], uint16_t tsih,
+    const struct iscsi_session_conf *conf, int iscsi_fd)
 {
 	struct connection *conn;
 	struct addrinfo *from_ai, *to_ai;
@@ -176,6 +176,8 @@ connection_new(unsigned int session_id, 
 	conn->conn_first_burst_length = 65536;
 
 	conn->conn_session_id = session_id;
+	memcpy(&conn->conn_isid, isid, sizeof(conn->conn_isid));
+	conn->conn_tsih = tsih;
 	conn->conn_iscsi_fd = iscsi_fd;
 
 	/*
@@ -264,7 +266,7 @@ handoff(struct connection *conn)
 	idh.idh_socket = conn->conn_socket;
 	strlcpy(idh.idh_target_alias, conn->conn_target_alias,
 	    sizeof(idh.idh_target_alias));
-	memcpy(idh.idh_isid, conn->conn_isid, sizeof(idh.idh_isid));
+	idh.idh_tsih = conn->conn_tsih;
 	idh.idh_statsn = conn->conn_statsn;
 	idh.idh_header_digest = conn->conn_header_digest;
 	idh.idh_data_digest = conn->conn_data_digest;
@@ -430,7 +432,8 @@ handle_request(int iscsi_fd, const struc
 		setproctitle("%s", request->idr_conf.isc_target_addr);
 	}
 
-	conn = connection_new(request->idr_session_id, &request->idr_conf, iscsi_fd);
+	conn = connection_new(request->idr_session_id, request->idr_isid,
+	    request->idr_tsih, &request->idr_conf, iscsi_fd);
 	set_timeout(timeout);
 	capsicate(conn);
 	login(conn);

Modified: head/usr.sbin/iscsid/iscsid.h
==============================================================================
--- head/usr.sbin/iscsid/iscsid.h	Sun Jul  6 17:29:19 2014	(r268325)
+++ head/usr.sbin/iscsid/iscsid.h	Sun Jul  6 17:37:49 2014	(r268326)
@@ -51,6 +51,7 @@ struct connection {
 	struct iscsi_session_conf	conn_conf;
 	char			conn_target_alias[ISCSI_ADDR_LEN];
 	uint8_t			conn_isid[6];
+	uint16_t		conn_tsih;
 	uint32_t		conn_statsn;
 	int			conn_header_digest;
 	int			conn_data_digest;

Modified: head/usr.sbin/iscsid/login.c
==============================================================================
--- head/usr.sbin/iscsid/login.c	Sun Jul  6 17:29:19 2014	(r268325)
+++ head/usr.sbin/iscsid/login.c	Sun Jul  6 17:37:49 2014	(r268326)
@@ -260,6 +260,7 @@ login_receive(struct connection *conn)
 		    "is %d, should be %d", ntohl(bhslr->bhslr_statsn),
 		    conn->conn_statsn + 1);
 	}
+	conn->conn_tsih = ntohs(bhslr->bhslr_tsih);
 	conn->conn_statsn = ntohl(bhslr->bhslr_statsn);
 
 	initial = false;
@@ -295,6 +296,7 @@ login_new_request(struct connection *con
 	login_set_nsg(request, nsg);
 
 	memcpy(bhslr->bhslr_isid, &conn->conn_isid, sizeof(bhslr->bhslr_isid));
+	bhslr->bhslr_tsih = htons(conn->conn_tsih);
 	bhslr->bhslr_initiator_task_tag = 0;
 	bhslr->bhslr_cmdsn = 0;
 	bhslr->bhslr_expstatsn = htonl(conn->conn_statsn + 1);
@@ -824,24 +826,6 @@ login_chap(struct connection *conn)
 	log_debugx("CHAP authentication done");
 }
 
-static void
-login_create_isid(struct connection *conn)
-{
-	int rv;
-
-	/*
-	 * RFC 3720, 10.12.5: 10b, "Random" ISID.
-	 *
-	 */
-	conn->conn_isid[0] = 0x80; 
-
-	rv = RAND_bytes(&conn->conn_isid[1], 3);
-	if (rv != 1) {
-		log_errx(1, "RAND_bytes failed: %s",
-		    ERR_error_string(ERR_get_error(), NULL));
-	}
-}
-
 void
 login(struct connection *conn)
 {
@@ -851,8 +835,6 @@ login(struct connection *conn)
 	const char *auth_method;
 	int i;
 
-	login_create_isid(conn);
-
 	log_debugx("beginning Login phase; sending Login PDU");
 	request = login_new_request(conn, BHSLR_STAGE_SECURITY_NEGOTIATION);
 	request_keys = keys_new();

From owner-svn-src-head@FreeBSD.ORG  Sun Jul  6 17:42:40 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6260D7F1;
 Sun,  6 Jul 2014 17:42:40 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 341902545;
 Sun,  6 Jul 2014 17:42:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s66HgeC8022568;
 Sun, 6 Jul 2014 17:42:40 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66Hgcwc022560;
 Sun, 6 Jul 2014 17:42:38 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201407061742.s66Hgcwc022560@svn.freebsd.org>
From: Alan Cox 
Date: Sun, 6 Jul 2014 17:42:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268327 - in head/sys: amd64/amd64 i386/i386 i386/xen
 ia64/ia64 mips/mips sparc64/sparc64 vm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 06 Jul 2014 17:42:40 -0000

Author: alc
Date: Sun Jul  6 17:42:38 2014
New Revision: 268327
URL: http://svnweb.freebsd.org/changeset/base/268327

Log:
  Introduce pmap_unwire().  It will replace pmap_change_wiring().  There are
  several reasons for this change:
  
  pmap_change_wiring() has never (in my memory) been used to set the wired
  attribute on a virtual page.  We have always used pmap_enter() to do that.
  Moreover, it is not really safe to use pmap_change_wiring() to set the wired
  attribute on a virtual page.  The description of pmap_change_wiring() says
  that it assumes the existence of a mapping in the pmap.  However, non-wired
  mappings may be reclaimed by the pmap at any time.  (See pmap_collect().)
  Many implementations of pmap_change_wiring() will crash if the mapping does
  not exist.
  
  pmap_unwire() accepts a range of virtual addresses, whereas
  pmap_change_wiring() acts upon a single virtual page.  Since we are
  typically unwiring a range of virtual addresses, pmap_unwire() will be more
  efficient.  Moreover, pmap_unwire() allows us to unwire superpage mappings.
  Previously, we were forced to demote the superpage mapping, because
  pmap_change_wiring() only allowed us to express the unwiring of a single
  base page mapping at a time.  This added to the overhead of unwiring for
  large ranges of addresses, including the implicit unwiring that occurs at
  process termination.
  
  Implementations for arm and powerpc will follow.
  
  Discussed with:	jeff, marcel
  Reviewed by:	kib
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/i386/i386/pmap.c
  head/sys/i386/xen/pmap.c
  head/sys/ia64/ia64/pmap.c
  head/sys/mips/mips/pmap.c
  head/sys/sparc64/sparc64/pmap.c
  head/sys/vm/pmap.h

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Sun Jul  6 17:37:49 2014	(r268326)
+++ head/sys/amd64/amd64/pmap.c	Sun Jul  6 17:42:38 2014	(r268327)
@@ -4736,6 +4736,102 @@ out:
 }
 
 /*
+ *	Clear the wired attribute from the mappings for the specified range of
+ *	addresses in the given pmap.  Every valid mapping within that range
+ *	must have the wired attribute set.  In contrast, invalid mappings
+ *	cannot have the wired attribute set, so they are ignored.
+ *
+ *	The wired attribute of the page table entry is not a hardware feature,
+ *	so there is no need to invalidate any TLB entries.
+ */
+void
+pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
+{
+	vm_offset_t va_next;
+	pml4_entry_t *pml4e;
+	pdp_entry_t *pdpe;
+	pd_entry_t *pde;
+	pt_entry_t *pte, PG_V;
+	boolean_t pv_lists_locked;
+
+	PG_V = pmap_valid_bit(pmap);
+	pv_lists_locked = FALSE;
+resume:
+	PMAP_LOCK(pmap);
+	for (; sva < eva; sva = va_next) {
+		pml4e = pmap_pml4e(pmap, sva);
+		if ((*pml4e & PG_V) == 0) {
+			va_next = (sva + NBPML4) & ~PML4MASK;
+			if (va_next < sva)
+				va_next = eva;
+			continue;
+		}
+		pdpe = pmap_pml4e_to_pdpe(pml4e, sva);
+		if ((*pdpe & PG_V) == 0) {
+			va_next = (sva + NBPDP) & ~PDPMASK;
+			if (va_next < sva)
+				va_next = eva;
+			continue;
+		}
+		va_next = (sva + NBPDR) & ~PDRMASK;
+		if (va_next < sva)
+			va_next = eva;
+		pde = pmap_pdpe_to_pde(pdpe, sva);
+		if ((*pde & PG_V) == 0)
+			continue;
+		if ((*pde & PG_PS) != 0) {
+			if ((*pde & PG_W) == 0)
+				panic("pmap_unwire: pde %#jx is missing PG_W",
+				    (uintmax_t)*pde);
+
+			/*
+			 * Are we unwiring the entire large page?  If not,
+			 * demote the mapping and fall through.
+			 */
+			if (sva + NBPDR == va_next && eva >= va_next) {
+				atomic_clear_long(pde, PG_W);
+				pmap->pm_stats.wired_count -= NBPDR /
+				    PAGE_SIZE;
+				continue;
+			} else {
+				if (!pv_lists_locked) {
+					pv_lists_locked = TRUE;
+					if (!rw_try_rlock(&pvh_global_lock)) {
+						PMAP_UNLOCK(pmap);
+						rw_rlock(&pvh_global_lock);
+						/* Repeat sva. */
+						goto resume;
+					}
+				}
+				if (!pmap_demote_pde(pmap, pde, sva))
+					panic("pmap_unwire: demotion failed");
+			}
+		}
+		if (va_next > eva)
+			va_next = eva;
+		for (pte = pmap_pde_to_pte(pde, sva); sva != va_next; pte++,
+		    sva += PAGE_SIZE) {
+			if ((*pte & PG_V) == 0)
+				continue;
+			if ((*pte & PG_W) == 0)
+				panic("pmap_unwire: pte %#jx is missing PG_W",
+				    (uintmax_t)*pte);
+
+			/*
+			 * PG_W must be cleared atomically.  Although the pmap
+			 * lock synchronizes access to PG_W, another processor
+			 * could be setting PG_M and/or PG_A concurrently.
+			 */
+			atomic_clear_long(pte, PG_W);
+			pmap->pm_stats.wired_count--;
+		}
+	}
+	if (pv_lists_locked)
+		rw_runlock(&pvh_global_lock);
+	PMAP_UNLOCK(pmap);
+}
+
+/*
  *	Copy the range specified by src_addr/len
  *	from the source map to the range dst_addr/len
  *	in the destination map.

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Sun Jul  6 17:37:49 2014	(r268326)
+++ head/sys/i386/i386/pmap.c	Sun Jul  6 17:42:38 2014	(r268327)
@@ -4012,6 +4012,99 @@ out:
 	PMAP_UNLOCK(pmap);
 }
 
+/*
+ *	Clear the wired attribute from the mappings for the specified range of
+ *	addresses in the given pmap.  Every valid mapping within that range
+ *	must have the wired attribute set.  In contrast, invalid mappings
+ *	cannot have the wired attribute set, so they are ignored.
+ *
+ *	The wired attribute of the page table entry is not a hardware feature,
+ *	so there is no need to invalidate any TLB entries.
+ */
+void
+pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
+{
+	vm_offset_t pdnxt;
+	pd_entry_t *pde;
+	pt_entry_t *pte;
+	boolean_t pv_lists_locked;
+
+	if (pmap_is_current(pmap))
+		pv_lists_locked = FALSE;
+	else {
+		pv_lists_locked = TRUE;
+resume:
+		rw_wlock(&pvh_global_lock);
+		sched_pin();
+	}
+	PMAP_LOCK(pmap);
+	for (; sva < eva; sva = pdnxt) {
+		pdnxt = (sva + NBPDR) & ~PDRMASK;
+		if (pdnxt < sva)
+			pdnxt = eva;
+		pde = pmap_pde(pmap, sva);
+		if ((*pde & PG_V) == 0)
+			continue;
+		if ((*pde & PG_PS) != 0) {
+			if ((*pde & PG_W) == 0)
+				panic("pmap_unwire: pde %#jx is missing PG_W",
+				    (uintmax_t)*pde);
+
+			/*
+			 * Are we unwiring the entire large page?  If not,
+			 * demote the mapping and fall through.
+			 */
+			if (sva + NBPDR == pdnxt && eva >= pdnxt) {
+				/*
+				 * Regardless of whether a pde (or pte) is 32
+				 * or 64 bits in size, PG_W is among the least
+				 * significant 32 bits.
+				 */
+				atomic_clear_int((u_int *)pde, PG_W);
+				pmap->pm_stats.wired_count -= NBPDR /
+				    PAGE_SIZE;
+				continue;
+			} else {
+				if (!pv_lists_locked) {
+					pv_lists_locked = TRUE;
+					if (!rw_try_wlock(&pvh_global_lock)) {
+						PMAP_UNLOCK(pmap);
+						/* Repeat sva. */
+						goto resume;
+					}
+					sched_pin();
+				}
+				if (!pmap_demote_pde(pmap, pde, sva))
+					panic("pmap_unwire: demotion failed");
+			}
+		}
+		if (pdnxt > eva)
+			pdnxt = eva;
+		for (pte = pmap_pte_quick(pmap, sva); sva != pdnxt; pte++,
+		    sva += PAGE_SIZE) {
+			if ((*pte & PG_V) == 0)
+				continue;
+			if ((*pte & PG_W) == 0)
+				panic("pmap_unwire: pte %#jx is missing PG_W",
+				    (uintmax_t)*pte);
+
+			/*
+			 * PG_W must be cleared atomically.  Although the pmap
+			 * lock synchronizes access to PG_W, another processor
+			 * could be setting PG_M and/or PG_A concurrently.
+			 *
+			 * PG_W is among the least significant 32 bits.
+			 */
+			atomic_clear_int((u_int *)pte, PG_W);
+			pmap->pm_stats.wired_count--;
+		}
+	}
+	if (pv_lists_locked) {
+		sched_unpin();
+		rw_wunlock(&pvh_global_lock);
+	}
+	PMAP_UNLOCK(pmap);
+}
 
 
 /*

Modified: head/sys/i386/xen/pmap.c
==============================================================================
--- head/sys/i386/xen/pmap.c	Sun Jul  6 17:37:49 2014	(r268326)
+++ head/sys/i386/xen/pmap.c	Sun Jul  6 17:42:38 2014	(r268327)
@@ -3199,6 +3199,57 @@ pmap_change_wiring(pmap_t pmap, vm_offse
 	rw_wunlock(&pvh_global_lock);
 }
 
+/*
+ *	Clear the wired attribute from the mappings for the specified range of
+ *	addresses in the given pmap.  Every valid mapping within that range
+ *	must have the wired attribute set.  In contrast, invalid mappings
+ *	cannot have the wired attribute set, so they are ignored.
+ *
+ *	The wired attribute of the page table entry is not a hardware feature,
+ *	so there is no need to invalidate any TLB entries.
+ */
+void
+pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
+{
+	vm_offset_t pdnxt;
+	pd_entry_t *pde;
+	pt_entry_t *pte;
+
+	CTR3(KTR_PMAP, "pmap_unwire: pmap=%p sva=0x%x eva=0x%x", pmap, sva,
+	    eva);
+	rw_wlock(&pvh_global_lock);
+	sched_pin();
+	PMAP_LOCK(pmap);
+	for (; sva < eva; sva = pdnxt) {
+		pdnxt = (sva + NBPDR) & ~PDRMASK;
+		if (pdnxt < sva)
+			pdnxt = eva;
+		pde = pmap_pde(pmap, sva);
+		if ((*pde & PG_V) == 0)
+			continue;
+		if ((*pde & PG_PS) != 0)
+			panic("pmap_unwire: unexpected PG_PS in pde %#jx",
+			    (uintmax_t)*pde);
+		if (pdnxt > eva)
+			pdnxt = eva;
+		for (pte = pmap_pte_quick(pmap, sva); sva != pdnxt; pte++,
+		    sva += PAGE_SIZE) {
+			if ((*pte & PG_V) == 0)
+				continue;
+			if ((*pte & PG_W) == 0)
+				panic("pmap_unwire: pte %#jx is missing PG_W",
+				    (uintmax_t)*pte);
+			PT_SET_VA_MA(pte, *pte & ~PG_W, FALSE);
+			pmap->pm_stats.wired_count--;
+		}
+	}
+	if (*PMAP1)
+		PT_CLEAR_VA(PMAP1, FALSE);
+	PT_UPDATES_FLUSH();
+	sched_unpin();
+	rw_wunlock(&pvh_global_lock);
+	PMAP_UNLOCK(pmap);
+}
 
 
 /*

Modified: head/sys/ia64/ia64/pmap.c
==============================================================================
--- head/sys/ia64/ia64/pmap.c	Sun Jul  6 17:37:49 2014	(r268326)
+++ head/sys/ia64/ia64/pmap.c	Sun Jul  6 17:42:38 2014	(r268327)
@@ -1974,6 +1974,38 @@ pmap_change_wiring(pmap_t pmap, vm_offse
 }
 
 /*
+ *	Clear the wired attribute from the mappings for the specified range of
+ *	addresses in the given pmap.  Every valid mapping within that range
+ *	must have the wired attribute set.  In contrast, invalid mappings
+ *	cannot have the wired attribute set, so they are ignored.
+ *
+ *	The wired attribute of the page table entry is not a hardware feature,
+ *	so there is no need to invalidate any TLB entries.
+ */
+void
+pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
+{
+	pmap_t oldpmap;
+	struct ia64_lpte *pte;
+
+	CTR4(KTR_PMAP, "%s(%p, %#x, %#x)", __func__, pmap, sva, eva);
+
+	PMAP_LOCK(pmap);
+	oldpmap = pmap_switch(pmap);
+	for (; sva < eva; sva += PAGE_SIZE) {
+		pte = pmap_find_vhpt(sva);
+		if (pte == NULL)
+			continue;
+		if (!pmap_wired(pte))
+			panic("pmap_unwire: pte %p isn't wired", pte);
+		pmap->pm_stats.wired_count--;
+		pmap_clear_wired(pte);
+	}
+	pmap_switch(oldpmap);
+	PMAP_UNLOCK(pmap);
+}
+
+/*
  *	Copy the range specified by src_addr/len
  *	from the source map to the range dst_addr/len
  *	in the destination map.

Modified: head/sys/mips/mips/pmap.c
==============================================================================
--- head/sys/mips/mips/pmap.c	Sun Jul  6 17:37:49 2014	(r268326)
+++ head/sys/mips/mips/pmap.c	Sun Jul  6 17:42:38 2014	(r268327)
@@ -2456,6 +2456,55 @@ pmap_change_wiring(pmap_t pmap, vm_offse
 }
 
 /*
+ *	Clear the wired attribute from the mappings for the specified range of
+ *	addresses in the given pmap.  Every valid mapping within that range
+ *	must have the wired attribute set.  In contrast, invalid mappings
+ *	cannot have the wired attribute set, so they are ignored.
+ *
+ *	The wired attribute of the page table entry is not a hardware feature,
+ *	so there is no need to invalidate any TLB entries.
+ */
+void
+pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
+{
+	pd_entry_t *pde, *pdpe;
+	pt_entry_t *pte;
+	vm_offset_t va_next;
+
+	PMAP_LOCK(pmap);
+	for (; sva < eva; sva = va_next) {
+		pdpe = pmap_segmap(pmap, sva);
+#ifdef __mips_n64
+		if (*pdpe == NULL) {
+			va_next = (sva + NBSEG) & ~SEGMASK;
+			if (va_next < sva)
+				va_next = eva;
+			continue;
+		}
+#endif
+		va_next = (sva + NBPDR) & ~PDRMASK;
+		if (va_next < sva)
+			va_next = eva;
+		pde = pmap_pdpe_to_pde(pdpe, sva);
+		if (*pde == NULL)
+			continue;
+		if (va_next > eva)
+			va_next = eva;
+		for (pte = pmap_pde_to_pte(pde, sva); sva != va_next; pte++,
+		    sva += PAGE_SIZE) {
+			if (!pte_test(pte, PTE_V))
+				continue;
+			if (!pte_test(pte, PTE_W))
+				panic("pmap_unwire: pte %#jx is missing PG_W",
+				    (uintmax_t)*pte);
+			pte_clear(pte, PTE_W);
+			pmap->pm_stats.wired_count--;
+		}
+	}
+	PMAP_UNLOCK(pmap);
+}
+
+/*
  *	Copy the range specified by src_addr/len
  *	from the source map to the range dst_addr/len
  *	in the destination map.

Modified: head/sys/sparc64/sparc64/pmap.c
==============================================================================
--- head/sys/sparc64/sparc64/pmap.c	Sun Jul  6 17:37:49 2014	(r268326)
+++ head/sys/sparc64/sparc64/pmap.c	Sun Jul  6 17:42:38 2014	(r268327)
@@ -141,6 +141,8 @@ static void pmap_bootstrap_set_tte(struc
 static void pmap_cache_remove(vm_page_t m, vm_offset_t va);
 static int pmap_protect_tte(struct pmap *pm1, struct pmap *pm2,
     struct tte *tp, vm_offset_t va);
+static int pmap_unwire_tte(pmap_t pm, pmap_t pm2, struct tte *tp,
+    vm_offset_t va);
 
 /*
  * Map the given physical page at the specified virtual address in the
@@ -1690,6 +1692,44 @@ pmap_change_wiring(pmap_t pm, vm_offset_
 }
 
 static int
+pmap_unwire_tte(pmap_t pm, pmap_t pm2, struct tte *tp, vm_offset_t va)
+{
+
+	PMAP_LOCK_ASSERT(pm, MA_OWNED);
+	if ((tp->tte_data & TD_WIRED) == 0)
+		panic("pmap_unwire_tte: tp %p is missing TD_WIRED", tp);
+	atomic_clear_long(&tp->tte_data, TD_WIRED);
+	pm->pm_stats.wired_count--;
+	return (1);
+}
+
+/*
+ * Clear the wired attribute from the mappings for the specified range of
+ * addresses in the given pmap.  Every valid mapping within that range must
+ * have the wired attribute set.  In contrast, invalid mappings cannot have
+ * the wired attribute set, so they are ignored.
+ *
+ * The wired attribute of the translation table entry is not a hardware
+ * feature, so there is no need to invalidate any TLB entries.
+ */
+void
+pmap_unwire(pmap_t pm, vm_offset_t sva, vm_offset_t eva)
+{
+	vm_offset_t va;
+	struct tte *tp;
+
+	PMAP_LOCK(pm);
+	if (eva - sva > PMAP_TSB_THRESH)
+		tsb_foreach(pm, NULL, sva, eva, pmap_unwire_tte);
+	else {
+		for (va = sva; va < eva; va += PAGE_SIZE)
+			if ((tp = tsb_tte_lookup(pm, va)) != NULL)
+				pmap_unwire_tte(pm, NULL, tp, va);
+	}
+	PMAP_UNLOCK(pm);
+}
+
+static int
 pmap_copy_tte(pmap_t src_pmap, pmap_t dst_pmap, struct tte *tp,
     vm_offset_t va)
 {

Modified: head/sys/vm/pmap.h
==============================================================================
--- head/sys/vm/pmap.h	Sun Jul  6 17:37:49 2014	(r268326)
+++ head/sys/vm/pmap.h	Sun Jul  6 17:42:38 2014	(r268327)
@@ -142,6 +142,7 @@ void		 pmap_remove_pages(pmap_t);
 void		 pmap_remove_write(vm_page_t m);
 void		 pmap_sync_icache(pmap_t, vm_offset_t, vm_size_t);
 boolean_t	 pmap_ts_referenced(vm_page_t m);
+void		 pmap_unwire(pmap_t pmap, vm_offset_t start, vm_offset_t end);
 void		 pmap_zero_page(vm_page_t);
 void		 pmap_zero_page_area(vm_page_t, int off, int size);
 void		 pmap_zero_page_idle(vm_page_t);

From owner-svn-src-head@FreeBSD.ORG  Sun Jul  6 17:58:00 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id CD52BE24;
 Sun,  6 Jul 2014 17:58:00 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BA3B02639;
 Sun,  6 Jul 2014 17:58:00 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s66Hw0FA028338;
 Sun, 6 Jul 2014 17:58:00 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66HvxtG028322;
 Sun, 6 Jul 2014 17:57:59 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407061757.s66HvxtG028322@svn.freebsd.org>
From: Alexander Motin 
Date: Sun, 6 Jul 2014 17:57:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268328 - in head: sys/cam/ctl usr.sbin/ctld
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 06 Jul 2014 17:58:00 -0000

Author: mav
Date: Sun Jul  6 17:57:59 2014
New Revision: 268328
URL: http://svnweb.freebsd.org/changeset/base/268328

Log:
  Close race in r268291 between port destruction, delayed by sessions
  teardown, and new port creation during `service ctld restart`.
  
  Close it by returning iSCSI port internal state, that allows to identify
  dying ports, which should not be counted as existing, from really alive.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_frontend.h
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/usr.sbin/ctld/kernel.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sun Jul  6 17:42:38 2014	(r268327)
+++ head/sys/cam/ctl/ctl.c	Sun Jul  6 17:57:59 2014	(r268328)
@@ -3252,6 +3252,11 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 			if (retval != 0)
 				break;
 
+			if (port->port_info != NULL) {
+				retval = port->port_info(port->onoff_arg, sb);
+				if (retval != 0)
+					break;
+			}
 			STAILQ_FOREACH(opt, &port->options, links) {
 				retval = sbuf_printf(sb, "\t<%s>%s\n",
 				    opt->name, opt->value, opt->name);

Modified: head/sys/cam/ctl/ctl_frontend.h
==============================================================================
--- head/sys/cam/ctl/ctl_frontend.h	Sun Jul  6 17:42:38 2014	(r268327)
+++ head/sys/cam/ctl/ctl_frontend.h	Sun Jul  6 17:57:59 2014	(r268328)
@@ -49,6 +49,7 @@ typedef enum {
 typedef int (*fe_init_t)(void);
 typedef void (*fe_shutdown_t)(void);
 typedef void (*port_func_t)(void *onoff_arg);
+typedef int (*port_info_func_t)(void *onoff_arg, struct sbuf *sb);
 typedef	int (*lun_func_t)(void *arg, struct ctl_id targ_id, int lun_id);
 typedef	uint32_t (*lun_map_func_t)(void *arg, uint32_t lun_id);
 typedef int (*fe_ioctl_t)(struct cdev *dev, u_long cmd, caddr_t addr, int flag,
@@ -214,6 +215,7 @@ struct ctl_port {
 	int		virtual_port;		/* passed to CTL */
 	port_func_t	port_online;		/* passed to CTL */
 	port_func_t	port_offline;		/* passed to CTL */
+	port_info_func_t port_info;		/* passed to CTL */
 	void		*onoff_arg;		/* passed to CTL */
 	lun_func_t	lun_enable;		/* passed to CTL */
 	lun_func_t	lun_disable;		/* passed to CTL */

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Sun Jul  6 17:42:38 2014	(r268327)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Sun Jul  6 17:57:59 2014	(r268328)
@@ -145,6 +145,7 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO
 int		cfiscsi_init(void);
 static void	cfiscsi_online(void *arg);
 static void	cfiscsi_offline(void *arg);
+static int	cfiscsi_info(void *arg, struct sbuf *sb);
 static int	cfiscsi_lun_enable(void *arg,
 		    struct ctl_id target_id, int lun_id);
 static int	cfiscsi_lun_disable(void *arg,
@@ -1411,6 +1412,17 @@ cfiscsi_offline(void *arg)
 #endif
 }
 
+static int
+cfiscsi_info(void *arg, struct sbuf *sb)
+{
+	struct cfiscsi_target *ct = (struct cfiscsi_target *)arg;
+	int retval;
+
+	retval = sbuf_printf(sb, "\t%d\n",
+	    ct->ct_state);
+	return (retval);
+}
+
 static void
 cfiscsi_ioctl_handoff(struct ctl_iscsi *ci)
 {
@@ -1993,6 +2005,7 @@ cfiscsi_ioctl_port_create(struct ctl_req
 	port->virtual_port = strtoul(tag, NULL, 0);
 	port->port_online = cfiscsi_online;
 	port->port_offline = cfiscsi_offline;
+	port->port_info = cfiscsi_info;
 	port->onoff_arg = ct;
 	port->lun_enable = cfiscsi_lun_enable;
 	port->lun_disable = cfiscsi_lun_disable;

Modified: head/usr.sbin/ctld/kernel.c
==============================================================================
--- head/usr.sbin/ctld/kernel.c	Sun Jul  6 17:42:38 2014	(r268327)
+++ head/usr.sbin/ctld/kernel.c	Sun Jul  6 17:57:59 2014	(r268328)
@@ -120,6 +120,7 @@ struct cctl_lun {
 
 struct cctl_port {
 	uint32_t port_id;
+	int cfiscsi_status;
 	char *cfiscsi_target;
 	uint16_t cfiscsi_portal_group_tag;
 	STAILQ_HEAD(,cctl_lun_nv) attr_list;
@@ -332,6 +333,8 @@ cctl_end_pelement(void *user_data, const
 	if (strcmp(name, "cfiscsi_target") == 0) {
 		cur_port->cfiscsi_target = str;
 		str = NULL;
+	} else if (strcmp(name, "cfiscsi_status") == 0) {
+		cur_port->cfiscsi_status = strtoul(str, NULL, 0);
 	} else if (strcmp(name, "cfiscsi_portal_group_tag") == 0) {
 		cur_port->cfiscsi_portal_group_tag = strtoul(str, NULL, 0);
 	} else if (strcmp(name, "targ_port") == 0) {
@@ -494,6 +497,11 @@ retry_port:
 			    "ignoring", (uintmax_t)port->port_id);
 			continue;
 		}
+		if (port->cfiscsi_status != 1) {
+			log_debugx("CTL port %ju is not active (%d); ignoring",
+			    (uintmax_t)port->port_id, port->cfiscsi_status);
+			continue;
+		}
 
 		targ = target_find(conf, port->cfiscsi_target);
 		if (targ == NULL) {

From owner-svn-src-head@FreeBSD.ORG  Sun Jul  6 19:21:58 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 433A4F17;
 Sun,  6 Jul 2014 19:21:58 +0000 (UTC)
Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu
 [128.104.255.23])
 by mx1.freebsd.org (Postfix) with ESMTP id 16C732D3A;
 Sun,  6 Jul 2014 19:21:57 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 7A81138060;
 Sun,  6 Jul 2014 14:21:57 -0500 (CDT)
X-Virus-Scanned: amavisd-new at icecube.wisc.edu
Received: from i3mail.icecube.wisc.edu ([127.0.0.1])
 by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030)
 with ESMTP id cdEJQxPz0SVp; Sun,  6 Jul 2014 14:21:57 -0500 (CDT)
Received: from comporellon.tachypleus.net (polaris.tachypleus.net
 [75.101.50.44])
 by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id DD2133805B;
 Sun,  6 Jul 2014 14:21:56 -0500 (CDT)
Message-ID: <53B9A1CD.2010803@freebsd.org>
Date: Sun, 06 Jul 2014 12:21:49 -0700
From: Nathan Whitehorn 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Andrew Turner , src-committers@freebsd.org, 
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject: Re: svn commit: r268310 - head/libexec/rtld-elf/arm
References: <201407061024.s66AO6R9012248@svn.freebsd.org>
In-Reply-To: <201407061024.s66AO6R9012248@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 06 Jul 2014 19:21:58 -0000

Thank you! I can now upgrade my AVILA for the first time in 3 years. 
Most things seem to work fine, despite the long absence.
-Nathan

On 07/06/14 03:24, Andrew Turner wrote:
> Author: andrew
> Date: Sun Jul  6 10:24:06 2014
> New Revision: 268310
> URL: http://svnweb.freebsd.org/changeset/base/268310
>
> Log:
>    Align the stack in _rtld_bind_start. Normally this is called with the
>    correct stack alignment, however when we have a leaf function that uses
>    thread local storage it calls __aeabi_read_tp to get the thread pointer.
>    Neither GCC or clang see this as a function call so will align the stack
>    to a 4-byte boundary. This may be a problem as _rtld_bind expects to be
>    on an 8-byte boundary.
>    
>    The solution is to store a copy of the stack pointer and force the
>    alignment before calling _rtld_bind.
>    
>    This fixes a problem with armeb where applications would crash in odd ways.
>    It should also remove the need for a local patch to clang to force the
>    stack alignment to an 8-byte boundary, even for leaf functions. Further
>    testing will be needed before reverting this local change to clang as we
>    may rely on it in other places.
>    
>    Reviewed by:	jmg@
>
> Modified:
>    head/libexec/rtld-elf/arm/rtld_start.S
>
> Modified: head/libexec/rtld-elf/arm/rtld_start.S
> ==============================================================================
> --- head/libexec/rtld-elf/arm/rtld_start.S	Sun Jul  6 07:34:18 2014	(r268309)
> +++ head/libexec/rtld-elf/arm/rtld_start.S	Sun Jul  6 10:24:06 2014	(r268310)
> @@ -77,7 +77,7 @@ __FBSDID("$FreeBSD$");
>    *	lr = &GOT[2]
>    */
>   _rtld_bind_start:
> -	stmdb	sp!,{r0-r4,sl,fp}
> +	stmdb	sp!,{r0-r5,sl,fp}
>   
>   	sub	r1, ip, lr		/* r1 = 4 * (n + 1) */
>   	sub	r1, r1, #4		/* r1 = 4 * n */
> @@ -86,11 +86,14 @@ _rtld_bind_start:
>   	ldr	r0, [lr, #-4]		/* get obj ptr from GOT[1] */
>   	mov	r4, ip			/* save GOT location */
>   
> +	mov	r5, sp			/* Save the stack pointer */
> +	bic	sp, sp, #7		/* Align the stack pointer */
>   	bl	_rtld_bind		/* Call the binder */
> +	mov	sp, r5			/* Restore the old stack pointer */
>   
>   	str	r0, [r4]		/* save address in GOT */
>   	mov	ip, r0			/* save new address */
>   
> -	ldmia	sp!,{r0-r4,sl,fp,lr}	/* restore the stack */
> +	ldmia	sp!,{r0-r5,sl,fp,lr}	/* restore the stack */
>   	mov	pc, ip			/* jump to the new address */
>   
>


From owner-svn-src-head@FreeBSD.ORG  Sun Jul  6 20:09:23 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id EE94910D;
 Sun,  6 Jul 2014 20:09:23 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DC02520E7;
 Sun,  6 Jul 2014 20:09:23 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s66K9Nu1094879;
 Sun, 6 Jul 2014 20:09:23 GMT (envelope-from andreast@svn.freebsd.org)
Received: (from andreast@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66K9NSV094878;
 Sun, 6 Jul 2014 20:09:23 GMT (envelope-from andreast@svn.freebsd.org)
Message-Id: <201407062009.s66K9NSV094878@svn.freebsd.org>
From: Andreas Tobler 
Date: Sun, 6 Jul 2014 20:09:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268330 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 06 Jul 2014 20:09:24 -0000

Author: andreast
Date: Sun Jul  6 20:09:23 2014
New Revision: 268330
URL: http://svnweb.freebsd.org/changeset/base/268330

Log:
  Make gcc happy, init idlen2.

Modified:
  head/sys/cam/ctl/ctl.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sun Jul  6 18:16:04 2014	(r268329)
+++ head/sys/cam/ctl/ctl.c	Sun Jul  6 20:09:23 2014	(r268330)
@@ -4336,7 +4336,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft
 	struct scsi_vpd_id_t10 *t10id;
 	const char *scsiname, *vendor;
 	int lun_number, i, lun_malloced;
-	int devidlen, idlen1, idlen2, len;
+	int devidlen, idlen1, idlen2 = 0, len;
 
 	if (be_lun == NULL)
 		return (EINVAL);

From owner-svn-src-head@FreeBSD.ORG  Sun Jul  6 21:18:57 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 24E92CED;
 Sun,  6 Jul 2014 21:18:57 +0000 (UTC)
Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com
 [IPv6:2a00:1450:400c:c05::229])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 2F9A3266A;
 Sun,  6 Jul 2014 21:18:56 +0000 (UTC)
Received: by mail-wi0-f169.google.com with SMTP id hi2so13857658wib.0
 for ; Sun, 06 Jul 2014 14:18:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=rPFtZRn/EN9Wiys0+zIcYwiXxTWXr6brPzL1YN628qU=;
 b=cio+gjkDc78WuQXrzU3O49ght3Aepw9iea5mvzHDZzhfXmvLyqI2wZC0+PJ4b+FMbk
 Nlkgb499CQ0HBSILeD9Y4gPiWVL2qHe0LYbdJbeZccXXH+DzbotM8OpK0h2NIY0xqr5b
 7i6idEMhtwrs/qQkWZBwehtriCAjff6+s1REALD+H6but+C5X0uu6g0MYn8PJ/ANzYOu
 g1YXhn9aDRMmXU20xK0szWtKtbAqMly1yFreFF65RK6Rmsnn+KbriM5xjPgaRrWdmJyX
 obuQ5LeYgDnipFAz6T7FSPk6EpSpWntiZgeTlR0oO4L76fnO5QBmOwmdoNq/H518aCtl
 80CQ==
X-Received: by 10.180.81.37 with SMTP id w5mr70820001wix.65.1404681534412;
 Sun, 06 Jul 2014 14:18:54 -0700 (PDT)
Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net.
 [2001:470:1f08:1f7::2])
 by mx.google.com with ESMTPSA id gh16sm107192414wic.3.2014.07.06.14.18.53
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Sun, 06 Jul 2014 14:18:53 -0700 (PDT)
Date: Sun, 6 Jul 2014 23:18:51 +0200
From: Mateusz Guzik 
To: Konstantin Belousov 
Subject: Re: svn commit: r268087 - head/sys/kern
Message-ID: <20140706211850.GA17706@dft-labs.eu>
References: <201407010921.s619LXHL063077@svn.freebsd.org>
 <20140701114245.GO93733@kib.kiev.ua>
 <20140701115612.GA26696@dft-labs.eu>
 <20140701123058.GP93733@kib.kiev.ua>
 <20140701125410.GB26696@dft-labs.eu>
 <20140701180903.GT93733@kib.kiev.ua>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20140701180903.GT93733@kib.kiev.ua>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Mateusz Guzik 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 06 Jul 2014 21:18:57 -0000

On Tue, Jul 01, 2014 at 09:09:03PM +0300, Konstantin Belousov wrote:
> On Tue, Jul 01, 2014 at 02:54:10PM +0200, Mateusz Guzik wrote:
> > It is passed down to MAC (mac_vnode_execve_will_transition and
> > mac_vnode_execve_transition) and then vfs_mark_atime.
> And we can lock it only there.
> 

I don't see how this code could be reorganized to reduce vnode lock
coverage and not add unlock + lock pair to the common case (no hwpmc and
no credential change).

vfs_mark_atime is only called when execve cannot return an error
anymore, with vnode locked and proc unlocked. Moving it before hwpmc
checks would require additional pair of proc unlock/lock.

That said, I would prefer to just commit previously proposed fixup.

-- 
Mateusz Guzik 

From owner-svn-src-head@FreeBSD.ORG  Sun Jul  6 21:39:06 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 24C7519C;
 Sun,  6 Jul 2014 21:39:06 +0000 (UTC)
Received: from mail-wg0-x233.google.com (mail-wg0-x233.google.com
 [IPv6:2a00:1450:400c:c00::233])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 415DC27E6;
 Sun,  6 Jul 2014 21:39:05 +0000 (UTC)
Received: by mail-wg0-f51.google.com with SMTP id x12so3479317wgg.22
 for ; Sun, 06 Jul 2014 14:39:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=VjcKwX9AOKst+tGM50y2Jh69XF4m+4zZQQPGWCbBf7U=;
 b=Prr+Q0oY5uagNC1JgAoZBde305Zm1OfYUG2U3uD/gzMN5n3wnnLrVV2HfsWGgpIJRr
 HWyz9o54g1TBixm+79/0U35uOJvz+r/jk6WrbCigSNIEP/rdkKt50A+UNwWAA3yoWJ2k
 awMGm7pA/m0ILRDAMOzcIL5IR7vz68N1w/pc4ok3oEmY4s8DA/uaErYM0ihnrMtu82Tb
 ghll8v144bRHA29VFVB4YAEEqrPH0FbpuJY4eLBZrKkAUlaBddHHZigJkXh/Sfxwke8x
 bYkBOZ29tXCcDrlsuqp3AIKOBkEoXrkA0FBjGvQkFNexDLXFKXdTjJf1DqfMoURxA0Fu
 u6ug==
X-Received: by 10.180.221.162 with SMTP id qf2mr31572838wic.75.1404682743474; 
 Sun, 06 Jul 2014 14:39:03 -0700 (PDT)
Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net.
 [2001:470:1f08:1f7::2])
 by mx.google.com with ESMTPSA id ja9sm107325573wic.8.2014.07.06.14.39.02
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Sun, 06 Jul 2014 14:39:02 -0700 (PDT)
Date: Sun, 6 Jul 2014 23:39:00 +0200
From: Mateusz Guzik 
To: Konstantin Belousov 
Subject: Re: svn commit: r268087 - head/sys/kern
Message-ID: <20140706213900.GB17706@dft-labs.eu>
References: <201407010921.s619LXHL063077@svn.freebsd.org>
 <20140701114245.GO93733@kib.kiev.ua>
 <20140701115612.GA26696@dft-labs.eu>
 <20140701123058.GP93733@kib.kiev.ua>
 <20140701125410.GB26696@dft-labs.eu>
 <20140701180903.GT93733@kib.kiev.ua>
 <20140706211850.GA17706@dft-labs.eu>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20140706211850.GA17706@dft-labs.eu>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Mateusz Guzik 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 06 Jul 2014 21:39:06 -0000

On Sun, Jul 06, 2014 at 11:18:51PM +0200, Mateusz Guzik wrote:
> On Tue, Jul 01, 2014 at 09:09:03PM +0300, Konstantin Belousov wrote:
> > On Tue, Jul 01, 2014 at 02:54:10PM +0200, Mateusz Guzik wrote:
> > > It is passed down to MAC (mac_vnode_execve_will_transition and
> > > mac_vnode_execve_transition) and then vfs_mark_atime.
> > And we can lock it only there.
> > 
> 
> I don't see how this code could be reorganized to reduce vnode lock
> coverage and not add unlock + lock pair to the common case (no hwpmc and
> no credential change).
> 
> vfs_mark_atime is only called when execve cannot return an error
> anymore, with vnode locked and proc unlocked. Moving it before hwpmc
> checks would require additional pair of proc unlock/lock.
> 
> That said, I would prefer to just commit previously proposed fixup.
> 

hm, I only now notice that fexecve case does:
vn_lock(binvp, LK_EXCLUSIVE | LK_RETRY)

I guess this can be safely changed to LK_SHARED.

-- 
Mateusz Guzik 

From owner-svn-src-head@FreeBSD.ORG  Sun Jul  6 23:08:47 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9D2AB188;
 Sun,  6 Jul 2014 23:08:47 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8AB0E2E92;
 Sun,  6 Jul 2014 23:08:47 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s66N8lXt078737;
 Sun, 6 Jul 2014 23:08:47 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s66N8luj078736;
 Sun, 6 Jul 2014 23:08:47 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201407062308.s66N8luj078736@svn.freebsd.org>
From: Gavin Atkinson 
Date: Sun, 6 Jul 2014 23:08:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268342 - head
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 06 Jul 2014 23:08:47 -0000

Author: gavin
Date: Sun Jul  6 23:08:47 2014
New Revision: 268342
URL: http://svnweb.freebsd.org/changeset/base/268342

Log:
  Remove /usr/share/doc/psd/28.cvs/paper.ps.gz if it exists, as it is
  obsolete since r251794.
  
  PR:		191003
  Submitted by:	Vick Khera
  MFC after:	3 days

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Sun Jul  6 23:01:29 2014	(r268341)
+++ head/ObsoleteFiles.inc	Sun Jul  6 23:08:47 2014	(r268342)
@@ -559,6 +559,7 @@ OLD_FILES+=usr/share/man/man9/vfs_mount.
 OLD_FILES+=usr/bin/cvs
 OLD_FILES+=usr/bin/cvsbug
 OLD_FILES+=usr/share/doc/psd/28.cvs/paper.ascii.gz
+OLD_FILES+=usr/share/doc/psd/28.cvs/paper.ps.gz
 OLD_DIRS+=usr/share/doc/psd/28.cvs
 OLD_FILES+=usr/share/examples/cvs/contrib/README
 OLD_FILES+=usr/share/examples/cvs/contrib/clmerge

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 00:02:49 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id CAE9A376;
 Mon,  7 Jul 2014 00:02:49 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B836D2369;
 Mon,  7 Jul 2014 00:02:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6702n4R006630;
 Mon, 7 Jul 2014 00:02:49 GMT (envelope-from bryanv@svn.freebsd.org)
Received: (from bryanv@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6702nlE006629;
 Mon, 7 Jul 2014 00:02:49 GMT (envelope-from bryanv@svn.freebsd.org)
Message-Id: <201407070002.s6702nlE006629@svn.freebsd.org>
From: Bryan Venteicher 
Date: Mon, 7 Jul 2014 00:02:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268349 - head/sys/netinet6
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 00:02:49 -0000

Author: bryanv
Date: Mon Jul  7 00:02:49 2014
New Revision: 268349
URL: http://svnweb.freebsd.org/changeset/base/268349

Log:
  Use the appropriate IPv6 hashtype defines when looking up the PCBGROUP
  
  Reviewed by:	adrian@

Modified:
  head/sys/netinet6/in6_pcbgroup.c

Modified: head/sys/netinet6/in6_pcbgroup.c
==============================================================================
--- head/sys/netinet6/in6_pcbgroup.c	Sun Jul  6 23:27:13 2014	(r268348)
+++ head/sys/netinet6/in6_pcbgroup.c	Mon Jul  7 00:02:49 2014	(r268349)
@@ -72,9 +72,9 @@ in6_pcbgroup_byhash(struct inpcbinfo *pc
 
 #ifdef RSS
 	if ((pcbinfo->ipi_hashfields == IPI_HASHFIELDS_4TUPLE &&
-	    hashtype == M_HASHTYPE_RSS_TCP_IPV4) ||
+	    hashtype == M_HASHTYPE_RSS_TCP_IPV6) ||
 	    (pcbinfo->ipi_hashfields == IPI_HASHFIELDS_2TUPLE &&
-	    hashtype == M_HASHTYPE_RSS_IPV4))
+	    hashtype == M_HASHTYPE_RSS_IPV6))
 		return (&pcbinfo->ipi_pcbgroups[
 		    in6_pcbgroup_getbucket(pcbinfo, hash)]);
 #endif

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 00:12:19 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 62848615;
 Mon,  7 Jul 2014 00:12:19 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4E7FE2429;
 Mon,  7 Jul 2014 00:12:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s670CJlB011487;
 Mon, 7 Jul 2014 00:12:19 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s670CJxY011486;
 Mon, 7 Jul 2014 00:12:19 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201407070012.s670CJxY011486@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Mon, 7 Jul 2014 00:12:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268350 - head/sys/dev/vt/hw/ofwfb
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 00:12:19 -0000

Author: nwhitehorn
Date: Mon Jul  7 00:12:18 2014
New Revision: 268350
URL: http://svnweb.freebsd.org/changeset/base/268350

Log:
  Use common vt_fb parts in ofwfb as far as we are able without sacrificing
  performance.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/vt/hw/ofwfb/ofwfb.c

Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c
==============================================================================
--- head/sys/dev/vt/hw/ofwfb/ofwfb.c	Mon Jul  7 00:02:49 2014	(r268349)
+++ head/sys/dev/vt/hw/ofwfb/ofwfb.c	Mon Jul  7 00:12:18 2014	(r268350)
@@ -30,8 +30,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -47,24 +49,17 @@ __FBSDID("$FreeBSD$");
 #include 
 
 struct ofwfb_softc {
+	struct fb_info	fb;
+
 	phandle_t	sc_node;
+	bus_space_tag_t	sc_memt; 
 
 	struct ofw_pci_register sc_pciaddrs[8];
 	int		sc_num_pciaddrs;
-
-
-	intptr_t	sc_addr;
-	int		sc_depth;
-	int		sc_stride;
-
-	bus_space_tag_t	sc_memt; 
-
-	uint32_t	sc_colormap[16];
 };
 
 static vd_probe_t	ofwfb_probe;
 static vd_init_t	ofwfb_init;
-static vd_blank_t	ofwfb_blank;
 static vd_bitbltchr_t	ofwfb_bitbltchr;
 static vd_fb_mmap_t	ofwfb_mmap;
 
@@ -72,7 +67,7 @@ static const struct vt_driver vt_ofwfb_d
 	.vd_name	= "ofwfb",
 	.vd_probe	= ofwfb_probe,
 	.vd_init	= ofwfb_init,
-	.vd_blank	= ofwfb_blank,
+	.vd_blank	= vt_fb_blank,
 	.vd_bitbltchr	= ofwfb_bitbltchr,
 	.vd_maskbitbltchr = ofwfb_bitbltchr,
 	.vd_fb_mmap	= ofwfb_mmap,
@@ -108,36 +103,11 @@ ofwfb_probe(struct vt_device *vd)
 }
 
 static void
-ofwfb_blank(struct vt_device *vd, term_color_t color)
-{
-	struct ofwfb_softc *sc = vd->vd_softc;
-	u_int ofs, size;
-	uint32_t c;
-
-	size = sc->sc_stride * vd->vd_height;
-	switch (sc->sc_depth) {
-	case 8:
-		c = (color << 24) | (color << 16) | (color << 8) | color;
-		for (ofs = 0; ofs < size/4; ofs++)
-			*(uint32_t *)(sc->sc_addr + 4*ofs) = c;
-		break;
-	case 32:
-		c = sc->sc_colormap[color];
-		for (ofs = 0; ofs < size; ofs++)
-			*(uint32_t *)(sc->sc_addr + 4*ofs) = c;
-		break;
-	default:
-		/* panic? */
-		break;
-	}
-}
-
-static void
 ofwfb_bitbltchr(struct vt_device *vd, const uint8_t *src, const uint8_t *mask,
     int bpl, vt_axis_t top, vt_axis_t left, unsigned int width,
     unsigned int height, term_color_t fg, term_color_t bg)
 {
-	struct ofwfb_softc *sc = vd->vd_softc;
+	struct fb_info *sc = vd->vd_softc;
 	u_long line;
 	uint32_t fgc, bgc;
 	int c;
@@ -147,8 +117,8 @@ ofwfb_bitbltchr(struct vt_device *vd, co
 		uint8_t	 c[4];
 	} ch1, ch2;
 
-	fgc = sc->sc_colormap[fg];
-	bgc = sc->sc_colormap[bg];
+	fgc = sc->fb_cmap[fg];
+	bgc = sc->fb_cmap[bg];
 	b = m = 0;
 
 	/* Don't try to put off screen pixels */
@@ -156,8 +126,8 @@ ofwfb_bitbltchr(struct vt_device *vd, co
 	    vd->vd_height))
 		return;
 
-	line = (sc->sc_stride * top) + left * sc->sc_depth/8;
-	if (mask == NULL && sc->sc_depth == 8 && (width % 8 == 0)) {
+	line = (sc->fb_stride * top) + left * sc->fb_bpp/8;
+	if (mask == NULL && sc->fb_bpp == 8 && (width % 8 == 0)) {
 		for (; height > 0; height--) {
 			for (c = 0; c < width; c += 8) {
 				b = *src++;
@@ -183,11 +153,11 @@ ofwfb_bitbltchr(struct vt_device *vd, co
 				if (b & 0x02) ch2.c[2] = fg;
 				if (b & 0x01) ch2.c[3] = fg;
 
-				*(uint32_t *)(sc->sc_addr + line + c) = ch1.l;
-				*(uint32_t *)(sc->sc_addr + line + c + 4) =
+				*(uint32_t *)(sc->fb_vbase + line + c) = ch1.l;
+				*(uint32_t *)(sc->fb_vbase + line + c + 4) =
 				    ch2.l;
 			}
-			line += sc->sc_stride;
+			line += sc->fb_stride;
 		}
 	} else {
 		for (; height > 0; height--) {
@@ -205,13 +175,13 @@ ofwfb_bitbltchr(struct vt_device *vd, co
 					if ((m & 0x80) == 0)
 						continue;
 				}
-				switch(sc->sc_depth) {
+				switch(sc->fb_bpp) {
 				case 8:
-					*(uint8_t *)(sc->sc_addr + line + c) =
+					*(uint8_t *)(sc->fb_vbase + line + c) =
 					    b & 0x80 ? fg : bg;
 					break;
 				case 32:
-					*(uint32_t *)(sc->sc_addr + line + 4*c)
+					*(uint32_t *)(sc->fb_vbase + line + 4*c)
 					    = (b & 0x80) ? fgc : bgc;
 					break;
 				default:
@@ -219,7 +189,7 @@ ofwfb_bitbltchr(struct vt_device *vd, co
 					break;
 				}
 			}
-			line += sc->sc_stride;
+			line += sc->fb_stride;
 		}
 	}
 }
@@ -243,16 +213,16 @@ ofwfb_initialize(struct vt_device *vd)
 	 * Set up the color map
 	 */
 
-	switch (sc->sc_depth) {
+	switch (sc->fb.fb_bpp) {
 	case 8:
-		vt_generate_vga_palette(sc->sc_colormap, COLOR_FORMAT_RGB, 255,
+		vt_generate_vga_palette(sc->fb.fb_cmap, COLOR_FORMAT_RGB, 255,
 		    0, 255, 8, 255, 16);
 
 		for (i = 0; i < 16; i++) {
 			OF_call_method("color!", ih, 4, 1,
-			    (cell_t)((sc->sc_colormap[i] >> 16) & 0xff),
-			    (cell_t)((sc->sc_colormap[i] >> 8) & 0xff),
-			    (cell_t)((sc->sc_colormap[i] >> 0) & 0xff),
+			    (cell_t)((sc->fb.fb_cmap[i] >> 16) & 0xff),
+			    (cell_t)((sc->fb.fb_cmap[i] >> 8) & 0xff),
+			    (cell_t)((sc->fb.fb_cmap[i] >> 0) & 0xff),
 			    (cell_t)i, &retval);
 		}
 		break;
@@ -265,24 +235,23 @@ ofwfb_initialize(struct vt_device *vd)
 		 * endianness slightly different. Figure out the host-view
 		 * endianness of the frame buffer.
 		 */
-		oldpix = bus_space_read_4(sc->sc_memt, sc->sc_addr, 0);
-		bus_space_write_4(sc->sc_memt, sc->sc_addr, 0, 0xff000000);
-		if (*(uint8_t *)(sc->sc_addr) == 0xff)
-			vt_generate_vga_palette(sc->sc_colormap,
+		oldpix = bus_space_read_4(sc->sc_memt, sc->fb.fb_vbase, 0);
+		bus_space_write_4(sc->sc_memt, sc->fb.fb_vbase, 0, 0xff000000);
+		if (*(uint8_t *)(sc->fb.fb_vbase) == 0xff)
+			vt_generate_vga_palette(sc->fb.fb_cmap,
 			    COLOR_FORMAT_RGB, 255, 16, 255, 8, 255, 0);
 		else
-			vt_generate_vga_palette(sc->sc_colormap,
+			vt_generate_vga_palette(sc->fb.fb_cmap,
 			    COLOR_FORMAT_RGB, 255, 0, 255, 8, 255, 16);
-		bus_space_write_4(sc->sc_memt, sc->sc_addr, 0, oldpix);
+		bus_space_write_4(sc->sc_memt, sc->fb.fb_vbase, 0, oldpix);
 		break;
 
 	default:
-		panic("Unknown color space depth %d", sc->sc_depth);
+		panic("Unknown color space depth %d", sc->fb.fb_bpp);
 		break;
         }
 
-	/* Clear the screen. */
-	ofwfb_blank(vd, TC_BLACK);
+	sc->fb.fb_cmsize = 16;
 }
 
 static int
@@ -293,7 +262,7 @@ ofwfb_init(struct vt_device *vd)
 	phandle_t chosen;
 	ihandle_t stdout;
 	phandle_t node;
-	uint32_t depth, height, width;
+	uint32_t depth, height, width, stride;
 	uint32_t fb_phys;
 	int i, len;
 #ifdef __sparc64__
@@ -326,21 +295,23 @@ ofwfb_init(struct vt_device *vd)
 	if (OF_getproplen(node, "height") != sizeof(height) ||
 	    OF_getproplen(node, "width") != sizeof(width) ||
 	    OF_getproplen(node, "depth") != sizeof(depth) ||
-	    OF_getproplen(node, "linebytes") != sizeof(sc->sc_stride))
+	    OF_getproplen(node, "linebytes") != sizeof(sc->fb.fb_stride))
 		return (CN_DEAD);
 
 	/* Only support 8 and 32-bit framebuffers */
 	OF_getprop(node, "depth", &depth, sizeof(depth));
 	if (depth != 8 && depth != 32)
 		return (CN_DEAD);
-	sc->sc_depth = depth;
+	sc->fb.fb_bpp = depth;
 
 	OF_getprop(node, "height", &height, sizeof(height));
 	OF_getprop(node, "width", &width, sizeof(width));
-	OF_getprop(node, "linebytes", &sc->sc_stride, sizeof(sc->sc_stride));
+	OF_getprop(node, "linebytes", &stride, sizeof(stride));
 
-	vd->vd_height = height;
-	vd->vd_width = width;
+	sc->fb.fb_height = height;
+	sc->fb.fb_width = width;
+	sc->fb.fb_stride = stride;
+	sc->fb.fb_size = sc->fb.fb_height * sc->fb.fb_stride;
 
 	/*
 	 * Get the PCI addresses of the adapter, if present. The node may be the
@@ -368,12 +339,13 @@ ofwfb_init(struct vt_device *vd)
 
 	#if defined(__powerpc__)
 		sc->sc_memt = &bs_be_tag;
-		bus_space_map(sc->sc_memt, fb_phys, height * sc->sc_stride,
-		    BUS_SPACE_MAP_PREFETCHABLE, &sc->sc_addr);
+		bus_space_map(sc->sc_memt, fb_phys, height * sc->fb.fb_stride,
+		    BUS_SPACE_MAP_PREFETCHABLE, &sc->fb.fb_vbase);
 	#elif defined(__sparc64__)
 		OF_decode_addr(node, 0, &space, &phys);
 		sc->sc_memt = &ofwfb_memt[0];
-		sc->sc_addr = sparc64_fake_bustag(space, fb_phys, sc->sc_memt);
+		sc->fb.fb_vbase =
+		    sparc64_fake_bustag(space, fb_phys, sc->sc_memt);
 	#else
 		#error Unsupported platform!
 	#endif
@@ -388,7 +360,8 @@ ofwfb_init(struct vt_device *vd)
 		fb_phys = sc->sc_num_pciaddrs;
 		for (i = 0; i < sc->sc_num_pciaddrs; i++) {
 			/* If it is too small, not the framebuffer */
-			if (sc->sc_pciaddrs[i].size_lo < sc->sc_stride*height)
+			if (sc->sc_pciaddrs[i].size_lo <
+			    sc->fb.fb_stride * height)
 				continue;
 			/* If it is not memory, it isn't either */
 			if (!(sc->sc_pciaddrs[i].phys_hi &
@@ -408,7 +381,7 @@ ofwfb_init(struct vt_device *vd)
 			return (CN_DEAD);
 
 	#if defined(__powerpc__)
-		OF_decode_addr(node, fb_phys, &sc->sc_memt, &sc->sc_addr);
+		OF_decode_addr(node, fb_phys, &sc->sc_memt, &sc->fb.fb_vbase);
 	#elif defined(__sparc64__)
 		OF_decode_addr(node, fb_phys, &space, &phys);
 		sc->sc_memt = &ofwfb_memt[0];
@@ -416,7 +389,11 @@ ofwfb_init(struct vt_device *vd)
 	#endif
         }
 
+	sc->fb.fb_pbase = fb_phys;
+
 	ofwfb_initialize(vd);
+	fb_probe(&sc->fb);
+	vt_fb_init(vd);
 
 	return (CN_INTERNAL);
 }
@@ -436,6 +413,7 @@ ofwfb_mmap(struct vt_device *vd, vm_ooff
 	  if (offset >= sc->sc_pciaddrs[i].phys_lo &&
 	    offset < (sc->sc_pciaddrs[i].phys_lo + sc->sc_pciaddrs[i].size_lo))
 		{
+#ifdef VM_MEMATTR_WRITE_COMBINING
 			/*
 			 * If this is a prefetchable BAR, we can (and should)
 			 * enable write-combining.
@@ -443,6 +421,7 @@ ofwfb_mmap(struct vt_device *vd, vm_ooff
 			if (sc->sc_pciaddrs[i].phys_hi &
 			    OFW_PCI_PHYS_HI_PREFETCHABLE)
 				*memattr = VM_MEMATTR_WRITE_COMBINING;
+#endif
 
 			*paddr = offset;
 			return (0);

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 00:27:18 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 171EBA78;
 Mon,  7 Jul 2014 00:27:18 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 005C82519;
 Mon,  7 Jul 2014 00:27:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s670RHuG016793;
 Mon, 7 Jul 2014 00:27:17 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s670R9aV016742;
 Mon, 7 Jul 2014 00:27:09 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201407070027.s670R9aV016742@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Mon, 7 Jul 2014 00:27:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268351 - in head:
 cddl/contrib/opensolaris/lib/libdtrace/common cddl/lib/libzpool etc/etc.ia64
 gnu/lib/csu gnu/lib/libgcc gnu/usr.bin/binutils/as/ia64-freebsd
 gnu/usr.bin/binutils/ld g...
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 00:27:18 -0000

Author: marcel
Date: Mon Jul  7 00:27:09 2014
New Revision: 268351
URL: http://svnweb.freebsd.org/changeset/base/268351

Log:
  Remove ia64.
  
  This includes:
  o   All directories named *ia64*
  o   All files named *ia64*
  o   All ia64-specific code guarded by __ia64__
  o   All ia64-specific makefile logic
  o   Mention of ia64 in comments and documentation
  
  This excludes:
  o   Everything under contrib/
  o   Everything under crypto/
  o   sys/xen/interface
  o   sys/sys/elf_common.h
  
  Discussed at: BSDcan

Deleted:
  head/etc/etc.ia64/
  head/gnu/usr.bin/binutils/as/ia64-freebsd/
  head/gnu/usr.bin/binutils/ld/Makefile.ia64
  head/gnu/usr.bin/binutils/ld/elf64_ia64_fbsd.sh
  head/gnu/usr.bin/binutils/libbfd/Makefile.ia64
  head/gnu/usr.bin/binutils/libopcodes/Makefile.ia64
  head/gnu/usr.bin/gdb/arch/ia64/
  head/gnu/usr.bin/gdb/kgdb/trgt_ia64.c
  head/lib/clang/include/IA64GenAsmWriter.inc
  head/lib/clang/include/IA64GenDAGISel.inc
  head/lib/clang/include/IA64GenInstrInfo.inc
  head/lib/clang/include/IA64GenRegisterInfo.inc
  head/lib/csu/ia64/
  head/lib/libc/ia64/
  head/lib/libkvm/kvm_ia64.c
  head/lib/libthr/arch/ia64/
  head/lib/libthread_db/arch/ia64/
  head/lib/msun/ia64/
  head/libexec/rtld-elf/ia64/
  head/release/ia64/
  head/sbin/Makefile.ia64
  head/sbin/mca/
  head/secure/lib/libcrypto/opensslconf-ia64.h
  head/sys/boot/Makefile.ia64
  head/sys/boot/efi/include/ia64/
  head/sys/boot/ficl/ia64/
  head/sys/boot/ia64/
  head/sys/cddl/contrib/opensolaris/common/atomic/ia64/
  head/sys/conf/Makefile.ia64
  head/sys/conf/files.ia64
  head/sys/conf/ldscript.ia64
  head/sys/conf/options.ia64
  head/sys/contrib/ia64/
  head/sys/dev/hwpmc/hwpmc_ia64.c
  head/sys/dev/uart/uart_cpu_ia64.c
  head/sys/ia64/
  head/sys/libkern/ia64/
  head/sys/xen/interface/arch-ia64/
  head/sys/xen/interface/arch-ia64.h
  head/tools/regression/ia64/
  head/tools/tools/gdb_regofs/ia64.c
  head/usr.bin/Makefile.ia64
  head/usr.bin/gprof/ia64.h
  head/usr.bin/truss/ia64-fbsd.c
  head/usr.bin/xlint/arch/ia64/
  head/usr.sbin/Makefile.ia64
Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
  head/cddl/lib/libzpool/Makefile
  head/gnu/lib/csu/Makefile
  head/gnu/lib/libgcc/Makefile
  head/gnu/usr.bin/binutils/ld/Makefile
  head/gnu/usr.bin/binutils/libbfd/Makefile
  head/gnu/usr.bin/binutils/libbfd/bfd.h
  head/gnu/usr.bin/cc/Makefile.tgt
  head/gnu/usr.bin/cc/include/Makefile
  head/lib/Makefile
  head/lib/libarchive/Makefile
  head/lib/libc/Makefile
  head/lib/libc/gen/tls.c
  head/lib/libc/mips/arith.h
  head/lib/libc/xdr/xdr_float.c
  head/lib/libkvm/kvm_amd64.c
  head/lib/libkvm/kvm_i386.c
  head/lib/libstand/Makefile
  head/lib/msun/sparc64/fenv.h
  head/lib/msun/src/math.h
  head/lib/ncurses/ncurses/Makefile
  head/libexec/rtld-elf/rtld.c
  head/release/doc/README
  head/release/doc/en_US.ISO8859-1/hardware/article.xml
  head/release/doc/en_US.ISO8859-1/readme/article.xml
  head/release/doc/share/examples/Makefile.relnotesng
  head/release/doc/share/misc/dev.archlist.txt
  head/release/doc/share/xml/release.ent
  head/rescue/rescue/Makefile
  head/sbin/bsdlabel/bsdlabel.8
  head/sbin/bsdlabel/bsdlabel.c
  head/sbin/fdisk/fdisk.c
  head/share/dict/freebsd
  head/share/examples/etc/make.conf
  head/share/man/man4/acpi.4
  head/share/man/man4/aout.4
  head/share/man/man4/inet.4
  head/share/man/man4/smp.4
  head/share/man/man5/src.conf.5
  head/share/man/man9/atomic.9
  head/share/man/man9/get_cyclecount.9
  head/share/mk/bsd.cpu.mk
  head/share/mk/bsd.endian.mk
  head/share/mk/bsd.sys.mk
  head/sys/Makefile
  head/sys/boot/common/Makefile.inc
  head/sys/boot/efi/include/amd64/pe.h
  head/sys/boot/efi/include/efiapi.h
  head/sys/boot/efi/include/i386/pe.h
  head/sys/boot/ficl/loader.c
  head/sys/boot/libstand32/Makefile
  head/sys/boot/userboot/libstand/Makefile
  head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/freebsd32/freebsd32_util.h
  head/sys/compat/ia32/ia32_util.h
  head/sys/compat/ndis/pe_var.h
  head/sys/conf/kern.mk
  head/sys/contrib/dev/acpica/acpica_prep.sh
  head/sys/dev/acpica/acpi_hpet.c
  head/sys/dev/amr/amrio.h
  head/sys/dev/ath/if_ath_ahb.c
  head/sys/dev/ath/if_ath_pci.c
  head/sys/dev/atkbdc/atkbdc.c
  head/sys/dev/drm/drm.h
  head/sys/dev/drm/drm_sarea.h
  head/sys/dev/drm2/drm.h
  head/sys/dev/drm2/drm_sarea.h
  head/sys/dev/fb/fbreg.h
  head/sys/dev/pci/vga_pci.c
  head/sys/dev/sound/pcm/pcm.h
  head/sys/dev/sym/sym_hipd.c
  head/sys/dev/txp/if_txp.c
  head/sys/dev/vt/hw/vga/vt_vga.c
  head/sys/kern/imgact_elf.c
  head/sys/kern/kern_exec.c
  head/sys/kern/kern_thread.c
  head/sys/kern/link_elf.c
  head/sys/kern/subr_witness.c
  head/sys/modules/Makefile
  head/sys/modules/acpi/acpi/Makefile
  head/sys/modules/hwpmc/Makefile
  head/sys/modules/ppc/Makefile
  head/sys/modules/sound/sound/Makefile
  head/sys/sys/disklabel.h
  head/sys/sys/efi.h
  head/sys/sys/fnv_hash.h
  head/sys/sys/kerneldump.h
  head/sys/sys/sysctl.h
  head/sys/sys/sysent.h
  head/sys/vm/vm_mmap.c
  head/sys/vm/vm_pageout.c
  head/sys/vm/vm_unix.c
  head/sys/x86/include/segments.h
  head/sys/x86/iommu/intel_drv.c
  head/tools/build/mk/OptionalObsoleteFiles.inc
  head/tools/regression/README
  head/tools/regression/filemon/Makefile
  head/usr.bin/gprof/gprof.h
  head/usr.bin/truss/extern.h
  head/usr.bin/truss/main.c
  head/usr.bin/xlint/lint1/param.h
  head/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c
  head/usr.sbin/config/config.5
  head/usr.sbin/crunch/crunchide/Makefile
  head/usr.sbin/crunch/crunchide/exec_elf32.c
  head/usr.sbin/mergemaster/mergemaster.sh
  head/usr.sbin/ntp/config.h
  head/usr.sbin/pkg/elf_tables.h

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c	Mon Jul  7 00:27:09 2014	(r268351)
@@ -230,9 +230,6 @@ prepare_elf32(dtrace_hdl_t *dtp, const d
 #if defined(__arm__)
 /* XXX */
 printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
-#elif defined(__ia64__)
-/* XXX */
-printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
 #elif defined(__i386) || defined(__amd64)
 			rel->r_offset = s->dofs_offset +
 			    dofr[j].dofr_offset;
@@ -424,8 +421,6 @@ prepare_elf64(dtrace_hdl_t *dtp, const d
 #ifdef DOODAD
 #if defined(__arm__)
 /* XXX */
-#elif defined(__ia64__)
-/* XXX */
 #elif defined(__mips__)
 /* XXX */
 #elif defined(__powerpc__)
@@ -535,8 +530,6 @@ dump_elf32(dtrace_hdl_t *dtp, const dof_
 	elf_file.ehdr.e_type = ET_REL;
 #if defined(__arm__)
 	elf_file.ehdr.e_machine = EM_ARM;
-#elif defined(__ia64__)
-	elf_file.ehdr.e_machine = EM_IA_64;
 #elif defined(__mips__)
 	elf_file.ehdr.e_machine = EM_MIPS;
 #elif defined(__powerpc__)
@@ -683,8 +676,6 @@ dump_elf64(dtrace_hdl_t *dtp, const dof_
 	elf_file.ehdr.e_type = ET_REL;
 #if defined(__arm__)
 	elf_file.ehdr.e_machine = EM_ARM;
-#elif defined(__ia64__)
-	elf_file.ehdr.e_machine = EM_IA_64;
 #elif defined(__mips__)
 	elf_file.ehdr.e_machine = EM_MIPS;
 #elif defined(__powerpc__)
@@ -814,15 +805,6 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, i
 printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
 	return (0);
 }
-#elif defined(__ia64__)
-/* XXX */
-static int
-dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela,
-    uint32_t *off)
-{
-printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
-	return (0);
-}
 #elif defined(__mips__)
 /* XXX */
 static int
@@ -1235,9 +1217,7 @@ process_obj(dtrace_hdl_t *dtp, const cha
 
 	if (dtp->dt_oflags & DTRACE_O_LP64) {
 		eclass = ELFCLASS64;
-#if defined(__ia64__)
-		emachine1 = emachine2 = EM_IA_64;
-#elif defined(__mips__)
+#if defined(__mips__)
 		emachine1 = emachine2 = EM_MIPS;
 #elif defined(__powerpc__)
 		emachine1 = emachine2 = EM_PPC64;
@@ -1258,7 +1238,7 @@ process_obj(dtrace_hdl_t *dtp, const cha
 #elif defined(__sparc)
 		emachine1 = EM_SPARC;
 		emachine2 = EM_SPARC32PLUS;
-#elif defined(__i386) || defined(__amd64) || defined(__ia64__)
+#elif defined(__i386) || defined(__amd64)
 		emachine1 = emachine2 = EM_386;
 #endif
 		symsize = sizeof (Elf32_Sym);

Modified: head/cddl/lib/libzpool/Makefile
==============================================================================
--- head/cddl/lib/libzpool/Makefile	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/cddl/lib/libzpool/Makefile	Mon Jul  7 00:27:09 2014	(r268351)
@@ -14,7 +14,7 @@
 .if exists(${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}/opensolaris_atomic.S)
 .PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}
 ATOMIC_SRCS=	opensolaris_atomic.S
-.if ${MACHINE_ARCH} != "ia64" && ${MACHINE_ARCH} != "sparc64"
+.if ${MACHINE_ARCH} != "sparc64"
 ACFLAGS+=	-Wa,--noexecstack
 .endif
 .else

Modified: head/gnu/lib/csu/Makefile
==============================================================================
--- head/gnu/lib/csu/Makefile	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/gnu/lib/csu/Makefile	Mon Jul  7 00:27:09 2014	(r268351)
@@ -28,13 +28,6 @@ MKDEP=		-DCRT_BEGIN
 CFLAGS+=	-DTARGET_ARM_EABI
 .endif
 
-.if ${MACHINE_CPUARCH} == "ia64"
-BEGINSRC=	crtbegin.asm
-ENDSRC=		crtend.asm
-CFLAGS+=	-x assembler-with-cpp	# Ugly hack
-CFLAGS+=	-include osreldate.h
-.undef SRCS				# hack for 'make depend'
-.endif
 .if ${MACHINE_CPUARCH} == "powerpc"
 TGTOBJS=	crtsavres.o
 SRCS+=		crtsavres.asm

Modified: head/gnu/lib/libgcc/Makefile
==============================================================================
--- head/gnu/lib/libgcc/Makefile	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/gnu/lib/libgcc/Makefile	Mon Jul  7 00:27:09 2014	(r268351)
@@ -137,17 +137,6 @@ LIB2FUNCS_EXTRA+= fixdfdi.c fixunssfsi.c
 .endif
 .endif
 
-.if ${TARGET_CPUARCH} == "ia64"
-#	from config/ia64/t-ia64
-LIB1ASMSRC   = lib1funcs.asm
-LIB1ASMFUNCS = __divxf3 __divdf3 __divsf3 \
-	__divdi3 __moddi3 __udivdi3 __umoddi3 \
-	__divsi3 __modsi3 __udivsi3 __umodsi3 __save_stack_nonlocal \
-	__nonlocal_goto __restore_stack_nonlocal __trampoline \
-	_fixtfdi _fixunstfdi _floatditf
-LIB2ADDEH = unwind-ia64.c unwind-sjlj.c unwind-c.c
-.endif
-
 .if ${TARGET_ARCH} == "powerpc"
 #	from config/rs6000/t-ppccomm
 LIB2FUNCS_EXTRA = tramp.asm

Modified: head/gnu/usr.bin/binutils/ld/Makefile
==============================================================================
--- head/gnu/usr.bin/binutils/ld/Makefile	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/gnu/usr.bin/binutils/ld/Makefile	Mon Jul  7 00:27:09 2014	(r268351)
@@ -5,10 +5,6 @@
 
 .PATH: ${SRCDIR}/ld
 
-.if ${TARGET_ARCH} == "ia64"
-CFLAGS+= -O1
-.endif
-
 PROG=	ld
 SCRIPTDIR= /usr/libdata/ldscripts
 SRCS+=	ldcref.c \

Modified: head/gnu/usr.bin/binutils/libbfd/Makefile
==============================================================================
--- head/gnu/usr.bin/binutils/libbfd/Makefile	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/gnu/usr.bin/binutils/libbfd/Makefile	Mon Jul  7 00:27:09 2014	(r268351)
@@ -42,7 +42,7 @@ SRCS+=	archive.c \
 	targets.c \
 	targmatch.h \
 	tekhex.c
-.if (${TARGET_ARCH} == "ia64" || ${TARGET_ARCH} == "sparc64")
+.if ${TARGET_ARCH} == "sparc64"
 WARNS?=	2
 .endif
 CFLAGS+= -D_GNU_SOURCE

Modified: head/gnu/usr.bin/binutils/libbfd/bfd.h
==============================================================================
--- head/gnu/usr.bin/binutils/libbfd/bfd.h	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/gnu/usr.bin/binutils/libbfd/bfd.h	Mon Jul  7 00:27:09 2014	(r268351)
@@ -85,7 +85,7 @@ extern "C" {
 #define BFD_HOST_64BIT_LONG 0
 #define BFD_HOST_64_BIT long long
 #define BFD_HOST_U_64_BIT unsigned long long
-#elif defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) || defined(__ia64__)
+#elif defined(__alpha__) || defined(__sparc64__) || defined(__amd64__)
 #define BFD_HOST_64BIT_LONG 1
 #define BFD_HOST_64_BIT long
 #define BFD_HOST_U_64_BIT unsigned long

Modified: head/gnu/usr.bin/cc/Makefile.tgt
==============================================================================
--- head/gnu/usr.bin/cc/Makefile.tgt	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/gnu/usr.bin/cc/Makefile.tgt	Mon Jul  7 00:27:09 2014	(r268351)
@@ -11,9 +11,6 @@ TARGET_CPUARCH=${MACHINE_CPUARCH}
 TARGET_ARCH?=	${MACHINE_ARCH}
 GCC_CPU=${TARGET_CPUARCH:C/amd64/i386/:C/powerpc/rs6000/:C/sparc64/sparc/}
 
-.if ${TARGET_ARCH} == "ia64"
-TARGET_CPU_DEFAULT= MASK_GNU_AS|MASK_GNU_LD
-.endif
 .if ${TARGET_ARCH} == "sparc64"
 TARGET_CPU_DEFAULT= TARGET_CPU_ultrasparc
 .endif

Modified: head/gnu/usr.bin/cc/include/Makefile
==============================================================================
--- head/gnu/usr.bin/cc/include/Makefile	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/gnu/usr.bin/cc/include/Makefile	Mon Jul  7 00:27:09 2014	(r268351)
@@ -12,8 +12,6 @@ INCSDIR=${INCLUDEDIR}/gcc/${GCCVER}
 INCS=	ammintrin.h emmintrin.h mmintrin.h mm3dnow.h pmmintrin.h \
 	tmmintrin.h xmmintrin.h mm_malloc.h
 INCS+=	wmmintrin.h __wmmintrin_aes.h __wmmintrin_pclmul.h
-.elif ${TARGET_ARCH} == "ia64"
-INCS=	ia64intrin.h
 .elif ${TARGET_ARCH} == "arm"
 INCS=	mmintrin.h
 .elif ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpc64"

Modified: head/lib/Makefile
==============================================================================
--- head/lib/Makefile	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/lib/Makefile	Mon Jul  7 00:27:09 2014	(r268351)
@@ -44,7 +44,6 @@ SUBDIR=	${SUBDIR_ORDERED} \
 	libdevstat \
 	libdwarf \
 	libedit \
-	${_libefi} \
 	libexecinfo \
 	libexpat \
 	libfetch \
@@ -237,11 +236,6 @@ _librtld_db=	librtld_db
 _libvmmapi=	libvmmapi
 .endif
 
-.if ${MACHINE_CPUARCH} == "ia64"
-_libefi=	libefi
-_libsmb=	libsmb
-.endif
-
 .if ${MACHINE_CPUARCH} == "mips"
 _libproc=	libproc
 _librtld_db=	librtld_db

Modified: head/lib/libarchive/Makefile
==============================================================================
--- head/lib/libarchive/Makefile	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/lib/libarchive/Makefile	Mon Jul  7 00:27:09 2014	(r268351)
@@ -41,7 +41,7 @@ SHARED_CFLAGS+=	-DHAVE_ICONV=1 -DHAVE_IC
 .endif
 
 .if ${MACHINE_ARCH:Marm*} != "" || ${MACHINE_ARCH:Mmips*} != "" || \
-	${MACHINE_ARCH:Msparc64*} != "" || ${MACHINE_ARCH:Mia64*} != ""
+	${MACHINE_ARCH:Msparc64*} != ""
 NO_WCAST_ALIGN=	yes
 .if ${MACHINE_ARCH:M*64*} == ""
 CFLAGS+=	-DPPMD_32BIT

Modified: head/lib/libc/Makefile
==============================================================================
--- head/lib/libc/Makefile	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/lib/libc/Makefile	Mon Jul  7 00:27:09 2014	(r268351)
@@ -80,7 +80,6 @@ NOASM=
 .include "${LIBC_SRCTOP}/nls/Makefile.inc"
 .include "${LIBC_SRCTOP}/posix1e/Makefile.inc"
 .if ${LIBC_ARCH} != "amd64" && \
-    ${LIBC_ARCH} != "ia64" && \
     ${LIBC_ARCH} != "powerpc64" && \
     ${LIBC_ARCH} != "sparc64" && \
     ${MACHINE_ARCH:Mmipsn32*} == "" && \

Modified: head/lib/libc/gen/tls.c
==============================================================================
--- head/lib/libc/gen/tls.c	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/lib/libc/gen/tls.c	Mon Jul  7 00:27:09 2014	(r268351)
@@ -62,7 +62,7 @@ void _rtld_free_tls(void *tls, size_t tc
 void *__libc_allocate_tls(void *oldtls, size_t tcbsize, size_t tcbalign);
 void __libc_free_tls(void *tls, size_t tcbsize, size_t tcbalign);
 
-#if defined(__ia64__) || defined(__amd64__)
+#if defined(__amd64__)
 #define TLS_TCB_ALIGN 16
 #elif defined(__powerpc__) || defined(__i386__) || defined(__arm__) || \
     defined(__sparc64__) || defined(__mips__)
@@ -71,8 +71,7 @@ void __libc_free_tls(void *tls, size_t t
 #error TLS_TCB_ALIGN undefined for target architecture
 #endif
 
-#if defined(__arm__) || defined(__ia64__) || defined(__mips__) || \
-    defined(__powerpc__)
+#if defined(__arm__) || defined(__mips__) || defined(__powerpc__)
 #define TLS_VARIANT_I
 #endif
 #if defined(__i386__) || defined(__amd64__) || defined(__sparc64__)

Modified: head/lib/libc/mips/arith.h
==============================================================================
--- head/lib/libc/mips/arith.h	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/lib/libc/mips/arith.h	Mon Jul  7 00:27:09 2014	(r268351)
@@ -18,9 +18,6 @@
 #define Double_Align
 #else
 /* TODO: Generate these values on a LE machine */
-/* Current values were stolen from ia64 except the
- * Xpointer define.
- */
 #define IEEE_8087
 #define Arith_Kind_ASL 1
 #define Long int

Modified: head/lib/libc/xdr/xdr_float.c
==============================================================================
--- head/lib/libc/xdr/xdr_float.c	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/lib/libc/xdr/xdr_float.c	Mon Jul  7 00:27:09 2014	(r268351)
@@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$");
 
 #if defined(__m68k__) || defined(__sparc__) || defined(__i386__) || \
     defined(__mips__) || defined(__ns32k__) || defined(__alpha__) || \
-    defined(__arm__) || defined(__ppc__) || defined(__ia64__) || \
+    defined(__arm__) || defined(__ppc__) || \
     defined(__arm26__) || defined(__sparc64__) || defined(__amd64__)
 #include 
 #define IEEEFP

Modified: head/lib/libkvm/kvm_amd64.c
==============================================================================
--- head/lib/libkvm/kvm_amd64.c	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/lib/libkvm/kvm_amd64.c	Mon Jul  7 00:27:09 2014	(r268351)
@@ -81,7 +81,7 @@ struct vmstate {
 /*
  * Map the ELF headers into the process' address space. We do this in two
  * steps: first the ELF header itself and using that information the whole
- * set of headers. (Taken from kvm_ia64.c)
+ * set of headers.
  */
 static int
 _kvm_maphdrs(kvm_t *kd, size_t sz)
@@ -105,7 +105,6 @@ _kvm_maphdrs(kvm_t *kd, size_t sz)
 
 /*
  * Translate a physical memory address to a file-offset in the crash-dump.
- * (Taken from kvm_ia64.c)
  */
 static size_t
 _kvm_pa2off(kvm_t *kd, uint64_t pa, off_t *ofs)

Modified: head/lib/libkvm/kvm_i386.c
==============================================================================
--- head/lib/libkvm/kvm_i386.c	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/lib/libkvm/kvm_i386.c	Mon Jul  7 00:27:09 2014	(r268351)
@@ -87,7 +87,7 @@ struct vmstate {
 /*
  * Map the ELF headers into the process' address space. We do this in two
  * steps: first the ELF header itself and using that information the whole
- * set of headers. (Taken from kvm_ia64.c)
+ * set of headers.
  */
 static int
 _kvm_maphdrs(kvm_t *kd, size_t sz)
@@ -111,7 +111,6 @@ _kvm_maphdrs(kvm_t *kd, size_t sz)
 
 /*
  * Translate a physical memory address to a file-offset in the crash-dump.
- * (Taken from kvm_ia64.c)
  */
 static size_t
 _kvm_pa2off(kvm_t *kd, uint64_t pa, off_t *ofs)

Modified: head/lib/libstand/Makefile
==============================================================================
--- head/lib/libstand/Makefile	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/lib/libstand/Makefile	Mon Jul  7 00:27:09 2014	(r268351)
@@ -57,12 +57,10 @@ SRCS+= ntoh.c
 
 # string functions from libc
 .PATH: ${.CURDIR}/../libc/string
-.if ${MACHINE_CPUARCH} != "ia64"
 SRCS+=	bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \
 	memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \
 	strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \
 	strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
-.endif
 .if ${MACHINE_CPUARCH} == "arm"
 .PATH: ${.CURDIR}/../libc/arm/gen
 
@@ -83,17 +81,6 @@ SRCS+=	aeabi_memcmp.S aeabi_memcpy.S aea
 .endif
 
 .endif
-.if ${MACHINE_CPUARCH} == "ia64"
-.PATH: ${.CURDIR}/../libc/ia64/string
-SRCS+=	bcmp.c bcopy.S bzero.S ffs.S memccpy.c memchr.c memcmp.c memcpy.S \
-	memmove.S memset.c strcat.c strchr.c strcmp.c strcpy.c strcspn.c \
-	strlen.c strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
-	strspn.c strstr.c strtok.c swab.c
-
-.PATH: ${.CURDIR}/../libc/ia64/gen
-SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S
-SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S
-.endif
 .if ${MACHINE_CPUARCH} == "powerpc"
 .PATH: ${.CURDIR}/../libc/quad
 SRCS+=	ashldi3.c ashrdi3.c

Modified: head/lib/msun/sparc64/fenv.h
==============================================================================
--- head/lib/msun/sparc64/fenv.h	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/lib/msun/sparc64/fenv.h	Mon Jul  7 00:27:09 2014	(r268351)
@@ -108,9 +108,9 @@ fesetexceptflag(const fexcept_t *__flagp
 }
 
 /*
- * In contrast with the ia64 platform, it seems to be worthwhile to
- * inline this function on sparc64 even when the arguments are not
- * compile-time constants.  Perhaps this depends on the register window.
+ * It seems to be worthwhile to inline this function even when the
+ * arguments are not compile-time constants.  Perhaps this depends
+ * on the register window.
  */
 __fenv_static inline int
 feraiseexcept(int __excepts)

Modified: head/lib/msun/src/math.h
==============================================================================
--- head/lib/msun/src/math.h	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/lib/msun/src/math.h	Mon Jul  7 00:27:09 2014	(r268351)
@@ -69,10 +69,6 @@ extern const union __nan_un {
 #define	math_errhandling	MATH_ERREXCEPT
 
 #define	FP_FAST_FMAF	1
-#ifdef __ia64__
-#define	FP_FAST_FMA	1
-#define	FP_FAST_FMAL	1
-#endif
 
 /* Symbolic constants to classify floating point numbers. */
 #define	FP_INFINITE	0x01

Modified: head/lib/ncurses/ncurses/Makefile
==============================================================================
--- head/lib/ncurses/ncurses/Makefile	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/lib/ncurses/ncurses/Makefile	Mon Jul  7 00:27:09 2014	(r268351)
@@ -55,7 +55,7 @@ HAVE_TERMIOS_H=		1
 HAVE_TERMIO_H=		0
 HAVE_VSSCANF=		1
 HEADER_STDBOOL=		1
-# XXX amd64, ia64 1L and int
+# XXX amd64 1L and int
 ONEUL=			1UL
 TYPEOF_CHTYPE=		long
 TYPEOF_MMASK_T=		long

Modified: head/libexec/rtld-elf/rtld.c
==============================================================================
--- head/libexec/rtld-elf/rtld.c	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/libexec/rtld-elf/rtld.c	Mon Jul  7 00:27:09 2014	(r268351)
@@ -3084,9 +3084,7 @@ do_dlsym(void *handle, const char *name,
     const Elf_Sym *def;
     SymLook req;
     RtldLockState lockstate;
-#ifndef __ia64__
     tls_index ti;
-#endif
     int res;
 
     def = NULL;
@@ -3191,24 +3189,17 @@ do_dlsym(void *handle, const char *name,
 
 	/*
 	 * The value required by the caller is derived from the value
-	 * of the symbol. For the ia64 architecture, we need to
-	 * construct a function descriptor which the caller can use to
-	 * call the function with the right 'gp' value. For other
-	 * architectures and for non-functions, the value is simply
-	 * the relocated value of the symbol.
+	 * of the symbol. this is simply the relocated value of the
+	 * symbol.
 	 */
 	if (ELF_ST_TYPE(def->st_info) == STT_FUNC)
 	    return (make_function_pointer(def, defobj));
 	else if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC)
 	    return (rtld_resolve_ifunc(defobj, def));
 	else if (ELF_ST_TYPE(def->st_info) == STT_TLS) {
-#ifdef __ia64__
-	    return (__tls_get_addr(defobj->tlsindex, def->st_value));
-#else
 	    ti.ti_module = defobj->tlsindex;
 	    ti.ti_offset = def->st_value;
 	    return (__tls_get_addr(&ti));
-#endif
 	} else
 	    return (defobj->relocbase + def->st_value);
     }
@@ -4341,7 +4332,7 @@ tls_get_addr_common(Elf_Addr **dtvp, int
 	return (tls_get_addr_slow(dtvp, index, offset));
 }
 
-#if defined(__arm__) || defined(__ia64__) || defined(__mips__) || defined(__powerpc__)
+#if defined(__arm__) || defined(__mips__) || defined(__powerpc__)
 
 /*
  * Allocate Static TLS using the Variant I method.

Modified: head/release/doc/README
==============================================================================
--- head/release/doc/README	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/release/doc/README	Mon Jul  7 00:27:09 2014	(r268351)
@@ -99,10 +99,10 @@ element will be included.  For example:
 
 	SPARC64-specific text
 
-The currently-supported architectures are amd64, arm, i386, ia64,
-pc98, powerpc, and sparc64.  An element may appear for multiple
-architectures by specifying a comma-separated list of architectures
-(i.e. arch="sparc64,ia64").
+The currently-supported architectures are amd64, arm, i386, pc98,
+powerpc and sparc64.  An element may appear for multiple architectures
+by specifying a comma-separated list of architectures
+(i.e. arch="sparc64,amd64").
 
 When creating a translation, make a new directory under this
 directory with a language code (paralleling the DocProj directory

Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml
==============================================================================
--- head/release/doc/en_US.ISO8859-1/hardware/article.xml	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/release/doc/en_US.ISO8859-1/hardware/article.xml	Mon Jul  7 00:27:09 2014	(r268351)
@@ -129,10 +129,10 @@
       
 
       &intel; EM64T is an extended version of IA-32 (x86) and
-	different from &intel; IA-64 (Itanium) architecture, which
-	&os;/ia64 supports.  Some &intel;'s old documentation refers
-	to &intel; EM64T as 64-bit extension technology
-	or IA-32e.
+	different from &intel; IA-64 (Itanium) architecture.  Some
+	&intel;'s old documentation refers to &intel; EM64T as
+	64-bit extension technology or
+	IA-32e.
 
       Both Uniprocessor (UP) and Symmetric Multi-processor (SMP)
 	configurations are supported.
@@ -232,41 +232,6 @@
 	more information.
     
 
-    
-      ia64
-
-      Currently supported processors are the &itanium;
-	and the &itanium;
-	  2.
-
-      Supported chipsets include:
-
-      
-	
-	  HP zx1
-	
-
-	
-	  &intel; 460GX
-	
-
-	
-	  &intel; E8870
-	
-      
-
-      Both Uniprocessor (UP) and Symmetric Multi-processor (SMP)
-	configurations are supported.
-
-      Most devices that can be found in or are compatible with
-	&arch.ia64; machines are fully supported.  The notable
-	exception is the VGA console. The &os; support for VGA
-	consoles is at this time too much based on PC hardware and not
-	all &arch.ia64; machines have chipsets that provide sufficient
-	PC legacy support. As such &man.syscons.4; can not be enabled
-	and the use of a serial console is required.
-    
-
     
       pc98
 
@@ -651,9 +616,8 @@
     
       Disk Controllers
 
-      [&arch.amd64;, &arch.i386;, &arch.ia64;, &arch.pc98;,
-	&arch.sparc64;] IDE/ATA controllers (&man.ata.4;
-	driver)
+      [&arch.amd64;, &arch.i386;, &arch.pc98;, &arch.sparc64;]
+	IDE/ATA controllers (&man.ata.4; driver)
 
       [&arch.pc98;] IDE/ATA controllers (wdc driver)
 
@@ -1124,8 +1088,8 @@
       [&arch.i386;] DigiBoard intelligent serial cards (digi
 	driver)
 
-      [&arch.amd64;, &arch.i386;, &arch.ia64;] PCI-Based
-	multi-port serial boards (&man.puc.4; driver)
+      [&arch.amd64;, &arch.i386;] PCI-Based multi-port serial
+	boards (&man.puc.4; driver)
 
       
 	
@@ -1147,10 +1111,6 @@
 	
 
 	
-	  [&arch.ia64;] Diva Serial (GSP) Multiport UART
-	
-
-	
 	  [&arch.amd64;, &arch.i386;] Dolphin Peripherals
 	    4025/4035/4036
 	
@@ -1428,7 +1388,7 @@
     
       USB Devices
 
-      [&arch.amd64;, &arch.i386;, &arch.ia64;, &arch.pc98;] A
+      [&arch.amd64;, &arch.i386;, &arch.pc98;] A
 	range of USB peripherals are supported; devices known to work
 	are listed in this section.  Owing to the generic nature of
 	most USB devices, with some exceptions any device of a given
@@ -1436,14 +1396,14 @@
 	here.
 
       
-	[&arch.amd64;, &arch.i386;, &arch.ia64;, &arch.pc98;]
+	[&arch.amd64;, &arch.i386;, &arch.pc98;]
 	  USB Ethernet adapters can be found in the section listing
 	  Ethernet
 	    interfaces.
       
 
       
-	[&arch.amd64;, &arch.i386;, &arch.ia64;, &arch.pc98;]
+	[&arch.amd64;, &arch.i386;, &arch.pc98;]
 	  USB Bluetooth adapters can be found in Bluetooth section.
       
 
@@ -1451,14 +1411,14 @@
 
       &hwlist.uhci;
 
-      [&arch.amd64;, &arch.i386;, &arch.ia64;, &arch.pc98;] USB
+      [&arch.amd64;, &arch.i386;, &arch.pc98;] USB
 	2.0 controllers using the EHCI interface (&man.ehci.4;
 	driver)
 
-      [&arch.amd64;, &arch.i386;, &arch.ia64;, &arch.pc98;]
+      [&arch.amd64;, &arch.i386;, &arch.pc98;]
 	Hubs
 
-      [&arch.amd64;, &arch.i386;, &arch.ia64;, &arch.pc98;]
+      [&arch.amd64;, &arch.i386;, &arch.pc98;]
 	Keyboards (&man.ukbd.4; driver)
 
       [&arch.amd64;, &arch.i386;, &arch.pc98;]
@@ -1490,7 +1450,7 @@
 
       &hwlist.umodem;
 
-      [&arch.amd64;, &arch.i386;, &arch.ia64;, &arch.pc98;] Mice
+      [&arch.amd64;, &arch.i386;, &arch.pc98;] Mice
 	(&man.ums.4; driver)
 
       &hwlist.ulpt;
@@ -1569,7 +1529,7 @@
 	  found at http://www.x.org/.
       
 
-      [&arch.amd64;, &arch.i386;, &arch.ia64;, &arch.pc98;]
+      [&arch.amd64;, &arch.i386;, &arch.pc98;]
 	Keyboards including:
 
       
@@ -1588,12 +1548,12 @@
 	
 
 	
-	  [&arch.amd64;, &arch.i386;, &arch.ia64;, &arch.pc98;]
+	  [&arch.amd64;, &arch.i386;, &arch.pc98;]
 	    USB keyboards (&man.ukbd.4; driver)
 	
       
 
-      [&arch.amd64;, &arch.i386;, &arch.ia64;, &arch.pc98;]
+      [&arch.amd64;, &arch.i386;, &arch.pc98;]
 	Pointing devices including:
 
       
@@ -1613,7 +1573,7 @@
 	
 
 	
-	  [&arch.amd64;, &arch.i386;, &arch.ia64;, &arch.pc98;]
+	  [&arch.amd64;, &arch.i386;, &arch.pc98;]
 	    USB mice (&man.ums.4; driver)
 	
       

Modified: head/release/doc/en_US.ISO8859-1/readme/article.xml
==============================================================================
--- head/release/doc/en_US.ISO8859-1/readme/article.xml	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/release/doc/en_US.ISO8859-1/readme/article.xml	Mon Jul  7 00:27:09 2014	(r268351)
@@ -68,7 +68,6 @@
       &os; is an operating system based on 4.4 BSD Lite for
 	AMD64 and Intel EM64T based PC hardware (&arch.amd64;),
 	Intel, AMD, Cyrix or NexGen x86 based PC hardware (&arch.i386;),
-	Intel Itanium Processor based computers (&arch.ia64;),
 	NEC PC-9801/9821 series PCs and compatibles (&arch.pc98;),
 	and &ultrasparc; machines (&arch.sparc64;).  Versions
 	for the &arm; (&arch.arm;), &mips; (&arch.mips;), and
@@ -326,7 +325,7 @@
       
 
       On platforms that support &man.bsdinstall.8; (currently
-	&arch.amd64;, &arch.i386;, &arch.ia64;, &arch.pc98;, and &arch.sparc64;), these documents are generally available via the
+	&arch.amd64;, &arch.i386;, &arch.pc98;, and &arch.sparc64;), these documents are generally available via the
 	Documentation menu during installation.  Once the system is
 	installed, you can revisit this menu by re-running the
 	&man.bsdinstall.8; utility.

Modified: head/release/doc/share/examples/Makefile.relnotesng
==============================================================================
--- head/release/doc/share/examples/Makefile.relnotesng	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/release/doc/share/examples/Makefile.relnotesng	Mon Jul  7 00:27:09 2014	(r268351)
@@ -6,7 +6,7 @@
 # the build tree.
 #
 
-ARCHS=		amd64 ia64 i386 pc98 powerpc sparc64
+ARCHS=		amd64 i386 pc98 powerpc sparc64
 MULTITEXTS=	
 UNITEXTS=	hardware readme relnotes errata
 

Modified: head/release/doc/share/misc/dev.archlist.txt
==============================================================================
--- head/release/doc/share/misc/dev.archlist.txt	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/release/doc/share/misc/dev.archlist.txt	Mon Jul  7 00:27:09 2014	(r268351)
@@ -35,43 +35,43 @@
 # Empty lines, and lines beginning with "#" are ignored.
 # [,...]
 #
-aac	i386,ia64,amd64
+aac	i386,amd64
 adv	i386,pc98,amd64
 adw	i386,pc98,amd64
 aha	i386
 ahb	i386
-ahd	i386,sparc64,ia64,amd64
+ahd	i386,sparc64,amd64
 aic	i386,pc98,amd64
 amd	i386,pc98,amd64
 arcmsr	i386,amd64
 asr	i386
 ath	i386,pc98,amd64,sparc64
-aue	i386,pc98,ia64,amd64,powerpc
+aue	i386,pc98,amd64,powerpc
 axe	i386,pc98,amd64,powerpc
 bce	i386,amd64
-bge	i386,pc98,sparc64,ia64,amd64
+bge	i386,pc98,sparc64,amd64
 bktr	i386,pc98
 bt	i386,amd64
 bxe	i386,amd64
-cdce	i386,pc98,ia64,amd64,powerpc
-ciss	i386,ia64,amd64
+cdce	i386,pc98,amd64,powerpc
+ciss	i386,amd64
 ce	i386,pc98
 cm	i386
 cnw	i386,pc98,amd64
 cp	i386,pc98
 ct	pc98
 ctau	i386
-cue	i386,pc98,ia64,amd64,powerpc
+cue	i386,pc98,amd64,powerpc
 cx	i386
 cxgb	i386,amd64
-de	i386,pc98,ia64,amd64
-dpt	i386,ia64,amd64
+de	i386,pc98,amd64
+dpt	i386,amd64
 ed	i386,pc98
 ep	i386,pc98,amd64
 esp	sparc64
 ex	i386,amd64
 fe	i386,pc98,amd64
-fwohci	i386,sparc64,ia64,amd64,powerpc
+fwohci	i386,sparc64,amd64,powerpc
 hifn	i386,pc98,amd64
 hpt27xx	i386,amd64
 hptiop	i386,amd64
@@ -79,15 +79,15 @@ hptmv	i386,amd64
 hptrr	i386,amd64
 ida	i386
 ie	i386
-iir	i386,ia64,amd64
+iir	i386,amd64
 ips	i386,amd64
 isci	i386,amd64
 ixgb	i386,amd64
-kue	i386,pc98,ia64,amd64,powerpc
+kue	i386,pc98,amd64,powerpc
 lge	i386,pc98,amd64
-mfi	i386,ia64,amd64
-mlx	i386,ia64,amd64
-mly	i386,ia64,amd64
+mfi	i386,amd64
+mlx	i386,amd64
+mly	i386,amd64
 msk	i386,amd64
 mxge	i386,amd64
 my	i386,pc98
@@ -99,9 +99,9 @@ ng_ubt	i386,pc98,amd64
 nsp	i386,pc98
 nxge	i386,amd64
 oce	i386,amd64
-ohci	i386,pc98,ia64,amd64,powerpc
+ohci	i386,pc98,amd64,powerpc
 oltr	i386
-pcn	i386,pc98,ia64,amd64
+pcn	i386,pc98,amd64
 pst	i386
 qlxgb	amd64
 qlxgbe	amd64
@@ -113,7 +113,7 @@ rue	i386,pc98,amd64
 rum	i386,amd64
 run	i386,amd64
 safe	i386,pc98,amd64
-sbp	i386,sparc64,ia64,amd64
+sbp	i386,sparc64,amd64
 sfgxe	amd64
 sn	i386,amd64
 snc	pc98
@@ -160,7 +160,7 @@ ubser	i386,pc98,amd64
 ucycom	i386,pc98,amd64
 udav	i386,pc98,amd64
 uftdi	i386,pc98,amd64
-uhci	i386,pc98,ia64,amd64,powerpc
+uhci	i386,pc98,amd64,powerpc
 ulpt	i386,pc98,amd64,powerpc
 umass	i386,pc98,amd64,powerpc
 umodem	i386,pc98,amd64
@@ -170,7 +170,7 @@ urio	i386,pc98,amd64,powerpc
 uvisor	i386,pc98,amd64
 uvscom	i386,pc98,amd64
 vpo	i386
-vx	i386,pc98,ia64,amd64
+vx	i386,pc98,amd64
 vxge	i386,amd64
 wb	i386,pc98,amd64
 xe	i386,amd64

Modified: head/release/doc/share/xml/release.ent
==============================================================================
--- head/release/doc/share/xml/release.ent	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/release/doc/share/xml/release.ent	Mon Jul  7 00:27:09 2014	(r268351)
@@ -65,7 +65,6 @@
 
 
 
-
 
 
 

Modified: head/rescue/rescue/Makefile
==============================================================================
--- head/rescue/rescue/Makefile	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/rescue/rescue/Makefile	Mon Jul  7 00:27:09 2014	(r268351)
@@ -136,10 +136,6 @@ CRUNCH_PROGS_sbin+= bsdlabel
 CRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98
 .endif
 
-.if ${MACHINE_CPUARCH} == "ia64"
-CRUNCH_PROGS_sbin+= mca
-.endif
-
 .if ${MACHINE_CPUARCH} == "sparc64"
 CRUNCH_PROGS_sbin+= bsdlabel sunlabel
 .endif

Modified: head/sbin/bsdlabel/bsdlabel.8
==============================================================================
--- head/sbin/bsdlabel/bsdlabel.8	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/sbin/bsdlabel/bsdlabel.8	Mon Jul  7 00:27:09 2014	(r268351)
@@ -109,7 +109,7 @@ argument forces
 .Nm
 to use a layout suitable for a different architecture.
 Current valid values are
-.Cm i386 , amd64 , ia64 ,
+.Cm i386 , amd64 , 
 and
 .Cm pc98 .
 If this option is omitted,

Modified: head/sbin/bsdlabel/bsdlabel.c
==============================================================================
--- head/sbin/bsdlabel/bsdlabel.c	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/sbin/bsdlabel/bsdlabel.c	Mon Jul  7 00:27:09 2014	(r268351)
@@ -165,7 +165,6 @@ main(int argc, char *argv[])
 			case 'm':
 				if (!strcmp(optarg, "i386") ||
 				    !strcmp(optarg, "amd64") ||
-				    !strcmp(optarg, "ia64") ||
 				    !strcmp(optarg, "pc98")) {
 					labelsoffset = 1;
 					labeloffset = 0;

Modified: head/sbin/fdisk/fdisk.c
==============================================================================
--- head/sbin/fdisk/fdisk.c	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/sbin/fdisk/fdisk.c	Mon Jul  7 00:27:09 2014	(r268351)
@@ -507,7 +507,6 @@ print_part(const struct dos_partition *p
 static void
 init_boot(void)
 {
-#ifndef __ia64__
 	const char *fname;
 	int fdesc, n;
 	struct stat sb;
@@ -529,15 +528,6 @@ init_boot(void)
 		err(1, "%s", fname);
 	if (n != mboot.bootinst_size)
 		errx(1, "%s: short read", fname);
-#else
-	if (mboot.bootinst != NULL)
-		free(mboot.bootinst);
-	mboot.bootinst_size = secsize;
-	if ((mboot.bootinst = malloc(mboot.bootinst_size)) == NULL)
-		errx(1, "unable to allocate boot block buffer");
-	memset(mboot.bootinst, 0, mboot.bootinst_size);
-	le16enc(&mboot.bootinst[DOSMAGICOFFSET], DOSMAGIC);
-#endif
 }
 
 

Modified: head/share/dict/freebsd
==============================================================================
--- head/share/dict/freebsd	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/share/dict/freebsd	Mon Jul  7 00:27:09 2014	(r268351)
@@ -79,7 +79,6 @@ ISBN
 ISDN
 ISP
 Iomega
-Itanium
 JDK
 JRE
 JSP

Modified: head/share/examples/etc/make.conf
==============================================================================
--- head/share/examples/etc/make.conf	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/share/examples/etc/make.conf	Mon Jul  7 00:27:09 2014	(r268351)
@@ -40,7 +40,6 @@
 #       (VIA CPUs)	c7, c3-2, c3
 #   AMD64 architecture:	amdfam10, opteron-sse3, athlon64-sse3, k8-sse3,
 #			opteron, athlon64, k8, core2, nocona
-#   Intel ia64 architecture:	itanium2, itanium
 #   SPARC-V9 architecture:	v9 (generic 64-bit V9), ultrasparc (default
 #				if omitted), ultrasparc3
 # Additionally the following CPU types are recognized by clang:

Modified: head/share/man/man4/acpi.4
==============================================================================
--- head/share/man/man4/acpi.4	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/share/man/man4/acpi.4	Mon Jul  7 00:27:09 2014	(r268351)
@@ -580,7 +580,7 @@ and
 .Xr iasl 8
 utilities and some ACPI knowledge.
 .Sh COMPATIBILITY
-ACPI is only found and supported on i386/ia32, ia64, and amd64.
+ACPI is only found and supported on i386/ia32 and amd64.
 .Sh SEE ALSO
 .Xr kenv 1 ,
 .Xr acpi_thermal 4 ,

Modified: head/share/man/man4/aout.4
==============================================================================
--- head/share/man/man4/aout.4	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/share/man/man4/aout.4	Mon Jul  7 00:27:09 2014	(r268351)
@@ -40,7 +40,7 @@ executable format was used before the re
 Since i386 was the only supported architecture at that time,
 .Xr a.out 5
 executables can only be activated on platforms that support
-execution of i386 code, such as i386, amd64 and (partially) ia64.
+execution of i386 code, such as i386 and amd64.
 .Pp
 To add kernel support for old syscalls and old syscall invocation methods,
 place the following options in the kernel configuration file:

Modified: head/share/man/man4/inet.4
==============================================================================
--- head/share/man/man4/inet.4	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/share/man/man4/inet.4	Mon Jul  7 00:27:09 2014	(r268351)
@@ -56,10 +56,9 @@ protocol.
 Internet addresses are four byte quantities, stored in
 network standard format (on little endian machines, such as the
 .Tn alpha ,
-.Tn amd64 ,
-.Tn i386
+.Tn amd64
 and
-.Tn ia64
+.Tn i386
 these are word and byte reversed).
 The include file
 .In netinet/in.h

Modified: head/share/man/man4/smp.4
==============================================================================
--- head/share/man/man4/smp.4	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/share/man/man4/smp.4	Mon Jul  7 00:27:09 2014	(r268351)
@@ -39,7 +39,7 @@ kernel implements symmetric multi-proces
 Support for multi-processor systems is present for all Tier-1
 architectures on
 .Fx .
-Currently, this includes amd64, i386, ia64, and sparc64.
+Currently, this includes amd64, i386 and sparc64.
 Support is enabled using
 .Cd options SMP .
 It is permissible to use the SMP kernel configuration on non-SMP equipped
@@ -158,6 +158,6 @@ in
 .Bsx .
 .Pp
 .Fx 5.0
-also introduced support for SMP on the ia64 and sparc64 architectures.
+also introduced support for SMP on the sparc64 architecture.
 .Sh AUTHORS
 .An Steve Passe Aq Mt fsmp@FreeBSD.org

Modified: head/share/man/man5/src.conf.5
==============================================================================
--- head/share/man/man5/src.conf.5	Mon Jul  7 00:12:18 2014	(r268350)
+++ head/share/man/man5/src.conf.5	Mon Jul  7 00:27:09 2014	(r268351)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
-.\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des
+.\" from FreeBSD: stable/10/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des
 .\" $FreeBSD$
-.Dd June 29, 2014
+.Dd July 4, 2014
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -78,1071 +78,49 @@ The following list provides a name and s
 that can be used for source builds.
 .Bl -tag -width indent
 .It Va WITHOUT_ACCT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_ACCT 223201 2011-06-17 20:47:44Z ed
+.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ACCT 223201 2011-06-17 20:47:44Z ed
 Set to not build process accounting tools such as
 .Xr accton 8
 and
 .Xr sa 8 .
 .It Va WITHOUT_ACPI
-.\" from FreeBSD: head/tools/build/options/WITHOUT_ACPI 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ACPI 156932 2006-03-21 07:50:50Z ru
 Set to not build
 .Xr acpiconf 8 ,
 .Xr acpidump 8
 and related programs.
 .It Va WITHOUT_AMD
-.\" from FreeBSD: head/tools/build/options/WITHOUT_AMD 183242 2008-09-21 22:02:26Z sam
+.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_AMD 183242 2008-09-21 22:02:26Z sam
 Set to not build
 .Xr amd 8 ,
 and related programs.
 .It Va WITHOUT_APM
-.\" from FreeBSD: head/tools/build/options/WITHOUT_APM 183242 2008-09-21 22:02:26Z sam
+.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_APM 183242 2008-09-21 22:02:26Z sam
 Set to not build
 .Xr apm 8 ,
 .Xr apmd 8
 and related programs.
 .It Va WITHOUT_ARM_EABI
-.\" from FreeBSD: head/tools/build/options/WITHOUT_ARM_EABI 253396 2013-07-16 19:15:19Z andrew
+.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ARM_EABI 253396 2013-07-16 19:15:19Z andrew
 Set the ARM ABI to OABI.
 .It Va WITHOUT_ASSERT_DEBUG
-.\" from FreeBSD: head/tools/build/options/WITHOUT_ASSERT_DEBUG 162215 2006-09-11 13:55:27Z ru
+.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ASSERT_DEBUG 162215 2006-09-11 13:55:27Z ru
 Set to compile programs and libraries without the
 .Xr assert 3
 checks.
 .It Va WITHOUT_AT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_AT 183242 2008-09-21 22:02:26Z sam
+.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_AT 183242 2008-09-21 22:02:26Z sam
 Set to not build
 .Xr at 1
 and related utilities.
 .It Va WITHOUT_ATM
-.\" from FreeBSD: head/tools/build/options/WITHOUT_ATM 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ATM 156932 2006-03-21 07:50:50Z ru
 Set to not build
 programs and libraries related to ATM networking.
 .It Va WITHOUT_AUDIT
-.\" from FreeBSD: head/tools/build/options/WITHOUT_AUDIT 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_AUDIT 156932 2006-03-21 07:50:50Z ru
 Set to not build audit support into system programs.
 .It Va WITHOUT_AUTHPF
-.\" from FreeBSD: head/tools/build/options/WITHOUT_AUTHPF 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_AUTHPF 156932 2006-03-21 07:50:50Z ru
 Set to not build
 .Xr authpf 8 .
-.It Va WITHOUT_BINUTILS
-.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 266158 2014-05-15 16:51:45Z brooks
-Set to not build or install binutils (as, c++-filt, gconv,
-ld, nm, objcopy, objdump, readelf, size and strip) as part
-of the normal system build.
-The resulting system cannot build programs from source.
-.It Va WITHOUT_BINUTILS_BOOTSTRAP
-.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp
-Set to not build binutils (as, c++-filt, gconv,
-ld, nm, objcopy, objdump, readelf, size and strip)
-as part of the bootstrap process.
-.Bf -symbolic
-The option does not work for build targets unless some alternative
-toolchain is provided.
-.Ef

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 00:36:18 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from hub.FreeBSD.org (hub.freebsd.org
 [IPv6:2001:1900:2254:206c::16:88])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 11CFBD25;
 Mon,  7 Jul 2014 00:36:16 +0000 (UTC)
Date: Sun, 6 Jul 2014 20:36:13 -0400
From: Glen Barber 
To: Marcel Moolenaar 
Subject: Re: svn commit: r268351 - in head:
 cddl/contrib/opensolaris/lib/libdtrace/common cddl/lib/libzpool etc/etc.ia64
 gnu/lib/csu gnu/lib/libgcc gnu/usr.bin/binutils/as/ia64-freebsd
 gnu/usr.bin/binutils/ld g...
Message-ID: <20140707003613.GV1216@hub.FreeBSD.org>
References: <201407070027.s670R9aV016742@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature"; boundary="YnIutncTLXsDZs5t"
Content-Disposition: inline
In-Reply-To: <201407070027.s670R9aV016742@svn.freebsd.org>
X-Operating-System: FreeBSD 11.0-CURRENT amd64
X-SCUD-Definition: Sudden Completely Unexpected Dataloss
X-SULE-Definition: Sudden Unexpected Learning Event
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 00:36:18 -0000


--YnIutncTLXsDZs5t
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Jul 07, 2014 at 12:27:09AM +0000, Marcel Moolenaar wrote:
> Author: marcel
> Date: Mon Jul  7 00:27:09 2014
> New Revision: 268351
> URL: http://svnweb.freebsd.org/changeset/base/268351
>=20
> Log:
>   Remove ia64.
>  =20

And gjb is sad, because ia64 snapshots took such little time to build.

But you know why.  :-)

Glen


--YnIutncTLXsDZs5t
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJTuet9AAoJELls3eqvi17QzQMP/0NDMc8/3PfuC6UcDPQMOqpA
lYppqLtAy+OImvS+PbCSkhvvvGvQgA7qKDQyZ2kUImmHF8YK4uzMeO63TUjongbb
z1vTkkzwbDSRYZGRo5Xpw4A3LkuwM8q54L89Ucs35bbTQibNISdfCt6qiJZ3souC
eo/5rN+n5a5n9wkozh33j4f3e7vSdZ6RlbPOgzXTv/EzTV9RxLVf6tZBW1AZOp0Q
qzL/F2eTnbnhnZH0hjlw/7er3BwVIijUPrAwAfRuAcfVA3mySMnmm8yO4xJir8ij
iDhHSQei0usgapGmmz8ZhA4yQs1qlf/iWGnELwQQciPY3aQ6Up71vnMeioqnBFOQ
AJrAl1Ua0uIirDirDUtkeVGP1/QH95QsiBoOBoDdcCUFy68hrsEV1lMtjjHRWUdd
b7czRmGEFhvj4DJ6adAZs9jKam+0c/Hgz+4N25sS0pZ8kXUghR7stMRWmaHRnzZt
DdgB4QWirhUzcqwF21eH5Z5uHw42DD57ieJdKxlDsvFSFuAqYWbAficiM46wz+Tq
Y78U/E+G9OEtaCu1neXfQl8rQm/vySbW42apu0H9He2YV6ztUnbtahgFgg+uNXeh
AZnRwwQA+NBH4A+gh2YQZqUbgTmBUVIhFnkmWKP2TYVN+PcfV0r/h7FcsBUOZcxM
uYYjQ04gQxF5kEFdVasA
=yB5T
-----END PGP SIGNATURE-----

--YnIutncTLXsDZs5t--

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 03:10:58 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 771A4715;
 Mon,  7 Jul 2014 03:10:58 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 63357214C;
 Mon,  7 Jul 2014 03:10:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s673Awr2092278;
 Mon, 7 Jul 2014 03:10:58 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s673AvNQ090889;
 Mon, 7 Jul 2014 03:10:57 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407070310.s673AvNQ090889@svn.freebsd.org>
From: Alexander Motin 
Date: Mon, 7 Jul 2014 03:10:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268353 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 03:10:58 -0000

Author: mav
Date: Mon Jul  7 03:10:56 2014
New Revision: 268353
URL: http://svnweb.freebsd.org/changeset/base/268353

Log:
  Implement ABORT TASK SET and I_T NEXUS RESET task management functions.
  
  Use the last one to terminate active commands on iSCSI session termination.
  Previous code was aborting only commands doing some data moves.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl.h
  head/sys/cam/ctl/ctl_error.c
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/cam/ctl/ctl_io.h
  head/sys/cam/ctl/ctl_util.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Mon Jul  7 02:47:41 2014	(r268352)
+++ head/sys/cam/ctl/ctl.c	Mon Jul  7 03:10:56 2014	(r268353)
@@ -407,6 +407,8 @@ static int ctl_target_reset(struct ctl_s
 static int ctl_lun_reset(struct ctl_lun *lun, union ctl_io *io,
 			 ctl_ua_type ua_type);
 static int ctl_abort_task(union ctl_io *io);
+static int ctl_abort_task_set(union ctl_io *io);
+static int ctl_i_t_nexus_reset(union ctl_io *io);
 static void ctl_run_task(union ctl_io *io);
 #ifdef CTL_IO_DELAY
 static void ctl_datamove_timer_wakeup(void *arg);
@@ -7482,7 +7484,8 @@ ctl_report_supported_tmf(struct ctl_scsi
 	ctsio->kern_rel_offset = 0;
 
 	data = (struct scsi_report_supported_tmf_data *)ctsio->kern_data_ptr;
-	data->byte1 |= RST_ATS | RST_LURS | RST_TRS;
+	data->byte1 |= RST_ATS | RST_ATSS | RST_LURS | RST_TRS;
+	data->byte2 |= RST_ITNRS;
 
 	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
 	ctsio->be_move_done = ctl_config_move_done;
@@ -11673,6 +11676,97 @@ ctl_lun_reset(struct ctl_lun *lun, union
 }
 
 static int
+ctl_abort_tasks_lun(struct ctl_lun *lun, uint32_t targ_port, uint32_t init_id,
+    int other_sc)
+{
+	union ctl_io *xio;
+	int found;
+
+	mtx_assert(&lun->lun_lock, MA_OWNED);
+
+	/*
+	 * Run through the OOA queue and attempt to find the given I/O.
+	 * The target port, initiator ID, tag type and tag number have to
+	 * match the values that we got from the initiator.  If we have an
+	 * untagged command to abort, simply abort the first untagged command
+	 * we come to.  We only allow one untagged command at a time of course.
+	 */
+	for (xio = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); xio != NULL;
+	     xio = (union ctl_io *)TAILQ_NEXT(&xio->io_hdr, ooa_links)) {
+
+		if ((targ_port == xio->io_hdr.nexus.targ_port) &&
+		    (init_id == xio->io_hdr.nexus.initid.id)) {
+			xio->io_hdr.flags |= CTL_FLAG_ABORT;
+			found = 1;
+			if (!other_sc && !(lun->flags & CTL_LUN_PRIMARY_SC)) {
+				union ctl_ha_msg msg_info;
+
+				msg_info.hdr.nexus = xio->io_hdr.nexus;
+				msg_info.task.task_action = CTL_TASK_ABORT_TASK;
+				msg_info.task.tag_num = xio->scsiio.tag_num;
+				msg_info.task.tag_type = xio->scsiio.tag_type;
+				msg_info.hdr.msg_type = CTL_MSG_MANAGE_TASKS;
+				msg_info.hdr.original_sc = NULL;
+				msg_info.hdr.serializing_sc = NULL;
+				ctl_ha_msg_send(CTL_HA_CHAN_CTL,
+				    (void *)&msg_info, sizeof(msg_info), 0);
+			}
+		}
+	}
+	return (found);
+}
+
+static int
+ctl_abort_task_set(union ctl_io *io)
+{
+	struct ctl_softc *softc = control_softc;
+	struct ctl_lun *lun;
+	uint32_t targ_lun;
+
+	/*
+	 * Look up the LUN.
+	 */
+	targ_lun = io->io_hdr.nexus.targ_mapped_lun;
+	mtx_lock(&softc->ctl_lock);
+	if ((targ_lun < CTL_MAX_LUNS) && (softc->ctl_luns[targ_lun] != NULL))
+		lun = softc->ctl_luns[targ_lun];
+	else {
+		mtx_unlock(&softc->ctl_lock);
+		return (1);
+	}
+
+	mtx_lock(&lun->lun_lock);
+	mtx_unlock(&softc->ctl_lock);
+	ctl_abort_tasks_lun(lun, io->io_hdr.nexus.targ_port,
+	    io->io_hdr.nexus.initid.id,
+	    (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) != 0);
+	mtx_unlock(&lun->lun_lock);
+	return (0);
+}
+
+static int
+ctl_i_t_nexus_reset(union ctl_io *io)
+{
+	struct ctl_softc *softc = control_softc;
+	struct ctl_lun *lun;
+	uint32_t initindex;
+
+	initindex = ctl_get_initindex(&io->io_hdr.nexus);
+	mtx_lock(&softc->ctl_lock);
+	STAILQ_FOREACH(lun, &softc->lun_list, links) {
+		mtx_lock(&lun->lun_lock);
+		ctl_abort_tasks_lun(lun, io->io_hdr.nexus.targ_port,
+		    io->io_hdr.nexus.initid.id,
+		    (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) != 0);
+		ctl_clear_mask(lun->have_ca, initindex);
+		lun->pending_sense[initindex].ua_pending |= CTL_UA_I_T_NEXUS_LOSS;
+		mtx_unlock(&lun->lun_lock);
+	}
+	mtx_unlock(&softc->ctl_lock);
+	return (0);
+}
+
+static int
 ctl_abort_task(union ctl_io *io)
 {
 	union ctl_io *xio;
@@ -11875,11 +11969,15 @@ ctl_run_task(union ctl_io *io)
 		retval = ctl_abort_task(io);
 		break;
 	case CTL_TASK_ABORT_TASK_SET:
+		retval = ctl_abort_task_set(io);
 		break;
 	case CTL_TASK_CLEAR_ACA:
 		break;
 	case CTL_TASK_CLEAR_TASK_SET:
 		break;
+	case CTL_TASK_I_T_NEXUS_RESET:
+		retval = ctl_i_t_nexus_reset(io);
+		break;
 	case CTL_TASK_LUN_RESET: {
 		struct ctl_lun *lun;
 		uint32_t targ_lun;

Modified: head/sys/cam/ctl/ctl.h
==============================================================================
--- head/sys/cam/ctl/ctl.h	Mon Jul  7 02:47:41 2014	(r268352)
+++ head/sys/cam/ctl/ctl.h	Mon Jul  7 03:10:56 2014	(r268353)
@@ -115,17 +115,18 @@ typedef enum {
 	CTL_UA_POWERON		= 0x0001,
 	CTL_UA_BUS_RESET	= 0x0002,
 	CTL_UA_TARG_RESET	= 0x0004,
-	CTL_UA_LUN_RESET	= 0x0008,
-	CTL_UA_LUN_CHANGE	= 0x0010,
-	CTL_UA_MODE_CHANGE	= 0x0020,
-	CTL_UA_LOG_CHANGE	= 0x0040,
-	CTL_UA_LVD		= 0x0080,
-	CTL_UA_SE		= 0x0100,
-	CTL_UA_RES_PREEMPT	= 0x0200,
-	CTL_UA_RES_RELEASE	= 0x0400,
-	CTL_UA_REG_PREEMPT  	= 0x0800,
-	CTL_UA_ASYM_ACC_CHANGE  = 0x1000,
-	CTL_UA_CAPACITY_CHANGED = 0x2000
+	CTL_UA_I_T_NEXUS_LOSS	= 0x0008,
+	CTL_UA_LUN_RESET	= 0x0010,
+	CTL_UA_LUN_CHANGE	= 0x0020,
+	CTL_UA_MODE_CHANGE	= 0x0030,
+	CTL_UA_LOG_CHANGE	= 0x0080,
+	CTL_UA_LVD		= 0x0100,
+	CTL_UA_SE		= 0x0200,
+	CTL_UA_RES_PREEMPT	= 0x0400,
+	CTL_UA_RES_RELEASE	= 0x0800,
+	CTL_UA_REG_PREEMPT  	= 0x1000,
+	CTL_UA_ASYM_ACC_CHANGE  = 0x2000,
+	CTL_UA_CAPACITY_CHANGED = 0x4000
 } ctl_ua_type;
 
 #ifdef	_KERNEL

Modified: head/sys/cam/ctl/ctl_error.c
==============================================================================
--- head/sys/cam/ctl/ctl_error.c	Mon Jul  7 02:47:41 2014	(r268352)
+++ head/sys/cam/ctl/ctl_error.c	Mon Jul  7 03:10:56 2014	(r268353)
@@ -401,6 +401,11 @@ ctl_build_ua(ctl_ua_type ua_type, struct
 		asc = 0x29;
 		ascq = 0x03;
 		break;
+	case CTL_UA_I_T_NEXUS_LOSS:
+		/* 29h/07h  I_T NEXUS LOSS OCCURRED */
+		asc = 0x29;
+		ascq = 0x07;
+		break;
 	case CTL_UA_LUN_RESET:
 		/* 29h/00h  POWER ON, RESET, OR BUS DEVICE RESET OCCURRED */
 		/*

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Mon Jul  7 02:47:41 2014	(r268352)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Mon Jul  7 03:10:56 2014	(r268353)
@@ -627,6 +627,12 @@ cfiscsi_pdu_handle_task_request(struct i
 		io->taskio.task_action = CTL_TASK_ABORT_TASK;
 		io->taskio.tag_num = bhstmr->bhstmr_referenced_task_tag;
 		break;
+	case BHSTMR_FUNCTION_ABORT_TASK_SET:
+#if 0
+		CFISCSI_SESSION_DEBUG(cs, "BHSTMR_FUNCTION_ABORT_TASK_SET");
+#endif
+		io->taskio.task_action = CTL_TASK_ABORT_TASK_SET;
+		break;
 	case BHSTMR_FUNCTION_LOGICAL_UNIT_RESET:
 #if 0
 		CFISCSI_SESSION_DEBUG(cs, "BHSTMR_FUNCTION_LOGICAL_UNIT_RESET");
@@ -1029,64 +1035,36 @@ cfiscsi_callout(void *context)
 static void
 cfiscsi_session_terminate_tasks(struct cfiscsi_session *cs)
 {
-	struct cfiscsi_data_wait *cdw, *tmpcdw;
+	struct cfiscsi_data_wait *cdw;
 	union ctl_io *io;
 	int error, last;
 
-#ifdef notyet
 	io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref);
 	if (io == NULL) {
 		CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io");
 		return;
 	}
 	ctl_zero_io(io);
-	io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = NULL;
+	io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = cs;
 	io->io_hdr.io_type = CTL_IO_TASK;
 	io->io_hdr.nexus.initid.id = cs->cs_ctl_initid;
 	io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port;
 	io->io_hdr.nexus.targ_target.id = 0;
-	io->io_hdr.nexus.targ_lun = lun;
+	io->io_hdr.nexus.targ_lun = 0;
 	io->taskio.tag_type = CTL_TAG_SIMPLE; /* XXX */
-	io->taskio.task_action = CTL_TASK_ABORT_TASK_SET;
+	io->taskio.task_action = CTL_TASK_I_T_NEXUS_RESET;
+	refcount_acquire(&cs->cs_outstanding_ctl_pdus);
 	error = ctl_queue(io);
 	if (error != CTL_RETVAL_COMPLETE) {
 		CFISCSI_SESSION_WARN(cs, "ctl_queue() failed; error %d", error);
+		refcount_release(&cs->cs_outstanding_ctl_pdus);
 		ctl_free_io(io);
 	}
-#else
-	/*
-	 * CTL doesn't currently support CTL_TASK_ABORT_TASK_SET, so instead
-	 * just iterate over tasks that are waiting for something - data - and
-	 * terminate those.
-	 */
+
 	CFISCSI_SESSION_LOCK(cs);
-	TAILQ_FOREACH_SAFE(cdw,
-	    &cs->cs_waiting_for_data_out, cdw_next, tmpcdw) {
-		io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref);
-		if (io == NULL) {
-			CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io");
-			return;
-		}
-		ctl_zero_io(io);
-		io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = NULL;
-		io->io_hdr.io_type = CTL_IO_TASK;
-		io->io_hdr.nexus.initid.id = cs->cs_ctl_initid;
-		io->io_hdr.nexus.targ_port = cs->cs_target->ct_port.targ_port;
-		io->io_hdr.nexus.targ_target.id = 0;
-		//io->io_hdr.nexus.targ_lun = lun; /* Not needed? */
-		io->taskio.tag_type = CTL_TAG_SIMPLE; /* XXX */
-		io->taskio.task_action = CTL_TASK_ABORT_TASK;
-		io->taskio.tag_num = cdw->cdw_initiator_task_tag;
-		error = ctl_queue(io);
-		if (error != CTL_RETVAL_COMPLETE) {
-			CFISCSI_SESSION_WARN(cs, "ctl_queue() failed; error %d", error);
-			ctl_free_io(io);
-			return;
-		}
-#if 0
-		CFISCSI_SESSION_DEBUG(cs, "removing csw for initiator task tag "
-		    "0x%x", cdw->cdw_initiator_task_tag);
-#endif
+	while ((cdw = TAILQ_FIRST(&cs->cs_waiting_for_data_out)) != NULL) {
+		TAILQ_REMOVE(&cs->cs_waiting_for_data_out, cdw, cdw_next);
+		CFISCSI_SESSION_UNLOCK(cs);
 		/*
 		 * Set nonzero port status; this prevents backends from
 		 * assuming that the data transfer actually succeeded
@@ -1094,11 +1072,10 @@ cfiscsi_session_terminate_tasks(struct c
 		 */
 		cdw->cdw_ctl_io->scsiio.io_hdr.port_status = 42;
 		cdw->cdw_ctl_io->scsiio.be_move_done(cdw->cdw_ctl_io);
-		TAILQ_REMOVE(&cs->cs_waiting_for_data_out, cdw, cdw_next);
 		uma_zfree(cfiscsi_data_wait_zone, cdw);
+		CFISCSI_SESSION_LOCK(cs);
 	}
 	CFISCSI_SESSION_UNLOCK(cs);
-#endif
 
 	/*
 	 * Wait for CTL to terminate all the tasks.
@@ -1110,7 +1087,7 @@ cfiscsi_session_terminate_tasks(struct c
 			break;
 		CFISCSI_SESSION_WARN(cs, "waiting for CTL to terminate tasks, "
 		    "%d remaining", cs->cs_outstanding_ctl_pdus);
-		pause("cfiscsi_terminate", 1);
+		pause("cfiscsi_terminate", hz / 100);
 	}
 }
 
@@ -2850,14 +2827,18 @@ cfiscsi_done(union ctl_io *io)
 	KASSERT(((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE),
 		("invalid CTL status %#x", io->io_hdr.status));
 
-	request = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr;
-	if (request == NULL) {
+	if (io->io_hdr.io_type == CTL_IO_TASK &&
+	    io->taskio.task_action == CTL_TASK_I_T_NEXUS_RESET) {
 		/*
 		 * Implicit task termination has just completed; nothing to do.
 		 */
+		cs = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr;
+		refcount_release(&cs->cs_outstanding_ctl_pdus);
+		ctl_free_io(io);
 		return;
 	}
 
+	request = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr;
 	cs = PDU_SESSION(request);
 	refcount_release(&cs->cs_outstanding_ctl_pdus);
 

Modified: head/sys/cam/ctl/ctl_io.h
==============================================================================
--- head/sys/cam/ctl/ctl_io.h	Mon Jul  7 02:47:41 2014	(r268352)
+++ head/sys/cam/ctl/ctl_io.h	Mon Jul  7 03:10:56 2014	(r268353)
@@ -364,6 +364,7 @@ typedef enum {
 	CTL_TASK_ABORT_TASK_SET,
 	CTL_TASK_CLEAR_ACA,
 	CTL_TASK_CLEAR_TASK_SET,
+	CTL_TASK_I_T_NEXUS_RESET,
 	CTL_TASK_LUN_RESET,
 	CTL_TASK_TARGET_RESET,
 	CTL_TASK_BUS_RESET,

Modified: head/sys/cam/ctl/ctl_util.c
==============================================================================
--- head/sys/cam/ctl/ctl_util.c	Mon Jul  7 02:47:41 2014	(r268352)
+++ head/sys/cam/ctl/ctl_util.c	Mon Jul  7 03:10:56 2014	(r268353)
@@ -84,6 +84,7 @@ static struct ctl_task_desc ctl_task_tab
 	{CTL_TASK_ABORT_TASK_SET, "Abort Task Set"},
 	{CTL_TASK_CLEAR_ACA, "Clear ACA"},
 	{CTL_TASK_CLEAR_TASK_SET, "Clear Task Set"},
+	{CTL_TASK_I_T_NEXUS_RESET, "I_T Nexus Reset"},
 	{CTL_TASK_LUN_RESET, "LUN Reset"},
 	{CTL_TASK_TARGET_RESET, "Target Reset"},
 	{CTL_TASK_BUS_RESET, "Bus Reset"},

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 05:17:17 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9497C73A;
 Mon,  7 Jul 2014 05:17:17 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8219429BB;
 Mon,  7 Jul 2014 05:17:17 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s675HHbP048972;
 Mon, 7 Jul 2014 05:17:17 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s675HHr9048970;
 Mon, 7 Jul 2014 05:17:17 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201407070517.s675HHr9048970@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Mon, 7 Jul 2014 05:17:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268354 - head/sys/dev/usb/controller
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 05:17:17 -0000

Author: hselasky
Date: Mon Jul  7 05:17:16 2014
New Revision: 268354
URL: http://svnweb.freebsd.org/changeset/base/268354

Log:
  Improve support for Intel Lynx Point USB 3.0 controllers by masking
  the port routing bits like done in Linux.
  
  MFC after:	1 week
  Tested by:	Tur-Wei Chan 

Modified:
  head/sys/dev/usb/controller/xhci_pci.c
  head/sys/dev/usb/controller/xhcireg.h

Modified: head/sys/dev/usb/controller/xhci_pci.c
==============================================================================
--- head/sys/dev/usb/controller/xhci_pci.c	Mon Jul  7 03:10:56 2014	(r268353)
+++ head/sys/dev/usb/controller/xhci_pci.c	Mon Jul  7 05:17:16 2014	(r268354)
@@ -157,6 +157,9 @@ xhci_pci_port_route(device_t self, uint3
 	temp |= set;
 	temp &= ~clear;
 
+	/* Don't set bits which the hardware doesn't support */
+	temp &= pci_read_config(self, PCI_XHCI_INTEL_USB3PRM, 4);
+
 	pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4);
 	pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4);
 

Modified: head/sys/dev/usb/controller/xhcireg.h
==============================================================================
--- head/sys/dev/usb/controller/xhcireg.h	Mon Jul  7 03:10:56 2014	(r268353)
+++ head/sys/dev/usb/controller/xhcireg.h	Mon Jul  7 05:17:16 2014	(r268354)
@@ -35,7 +35,9 @@
 #define	PCI_XHCI_FLADJ		0x61	/* RW frame length adjust */
 
 #define	PCI_XHCI_INTEL_XUSB2PR	0xD0	/* Intel USB2 Port Routing */
+#define	PCI_XHCI_INTEL_USB2PRM	0xD4	/* Intel USB2 Port Routing Mask */
 #define	PCI_XHCI_INTEL_USB3_PSSEN 0xD8	/* Intel USB3 Port SuperSpeed Enable */
+#define	PCI_XHCI_INTEL_USB3PRM	0xDC	/* Intel USB3 Port Routing Mask */
 
 /* XHCI capability registers */
 #define	XHCI_CAPLENGTH		0x00	/* RO capability */

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 05:48:12 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E5B21E5B;
 Mon,  7 Jul 2014 05:48:11 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D38922BD6;
 Mon,  7 Jul 2014 05:48:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s675mB9i062639;
 Mon, 7 Jul 2014 05:48:11 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s675mBUm062637;
 Mon, 7 Jul 2014 05:48:11 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407070548.s675mBUm062637@svn.freebsd.org>
From: Alexander Motin 
Date: Mon, 7 Jul 2014 05:48:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268356 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 05:48:12 -0000

Author: mav
Date: Mon Jul  7 05:48:11 2014
New Revision: 268356
URL: http://svnweb.freebsd.org/changeset/base/268356

Log:
  When new connection comes in, check whether we already have session from
  the same intiator (Name+ISID).  If so -- terminate the old session and let
  the new one take its place, as required by iSCSI RFC.

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/cam/ctl/ctl_frontend_iscsi.h

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Mon Jul  7 05:31:50 2014	(r268355)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Mon Jul  7 05:48:11 2014	(r268356)
@@ -1087,7 +1087,8 @@ cfiscsi_session_terminate_tasks(struct c
 			break;
 		CFISCSI_SESSION_WARN(cs, "waiting for CTL to terminate tasks, "
 		    "%d remaining", cs->cs_outstanding_ctl_pdus);
-		pause("cfiscsi_terminate", hz / 100);
+		tsleep(__DEVOLATILE(void *, &cs->cs_outstanding_ctl_pdus),
+		    0, "cfiscsi_terminate", hz / 100);
 	}
 }
 
@@ -1404,7 +1405,7 @@ static void
 cfiscsi_ioctl_handoff(struct ctl_iscsi *ci)
 {
 	struct cfiscsi_softc *softc;
-	struct cfiscsi_session *cs;
+	struct cfiscsi_session *cs, *cs2;
 	struct cfiscsi_target *ct;
 	struct ctl_iscsi_handoff_params *cihp;
 	int error;
@@ -1500,12 +1501,34 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi *
 	    cihp->initiator_isid[2], cihp->initiator_isid[3],
 	    cihp->initiator_isid[4], cihp->initiator_isid[5]);
 
+	refcount_acquire(&cs->cs_outstanding_ctl_pdus);
+restart:
+	if (!cs->cs_terminating) {
+		mtx_lock(&softc->lock);
+		TAILQ_FOREACH(cs2, &softc->sessions, cs_next) {
+			if (cs2 != cs && cs2->cs_tasks_aborted == false &&
+			    strcmp(cs->cs_initiator_id, cs2->cs_initiator_id) == 0) {
+				cfiscsi_session_terminate(cs2);
+				mtx_unlock(&softc->lock);
+				pause("cfiscsi_reinstate", 1);
+				goto restart;
+			}
+		}
+		mtx_unlock(&softc->lock);
+	}
+
+	/*
+	 * Register initiator with CTL.
+	 */
+	cfiscsi_session_register_initiator(cs);
+
 #ifdef ICL_KERNEL_PROXY
 	if (cihp->socket > 0) {
 #endif
 		error = icl_conn_handoff(cs->cs_conn, cihp->socket);
 		if (error != 0) {
-			cfiscsi_session_delete(cs);
+			cfiscsi_session_terminate(cs);
+			refcount_release(&cs->cs_outstanding_ctl_pdus);
 			ci->status = CTL_ISCSI_ERROR;
 			snprintf(ci->error_str, sizeof(ci->error_str),
 			    "%s: icl_conn_handoff failed with error %d",
@@ -1516,11 +1539,6 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi *
 	}
 #endif
 
-	/*
-	 * Register initiator with CTL.
-	 */
-	cfiscsi_session_register_initiator(cs);
-
 #ifdef ICL_KERNEL_PROXY
 	cs->cs_login_phase = false;
 
@@ -1535,6 +1553,7 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi *
 	}
 #endif
 
+	refcount_release(&cs->cs_outstanding_ctl_pdus);
 	ci->status = CTL_ISCSI_OK;
 }
 
@@ -2833,7 +2852,9 @@ cfiscsi_done(union ctl_io *io)
 		 * Implicit task termination has just completed; nothing to do.
 		 */
 		cs = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr;
+		cs->cs_tasks_aborted = true;
 		refcount_release(&cs->cs_outstanding_ctl_pdus);
+		wakeup(__DEVOLATILE(void *, &cs->cs_outstanding_ctl_pdus));
 		ctl_free_io(io);
 		return;
 	}

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.h
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.h	Mon Jul  7 05:31:50 2014	(r268355)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.h	Mon Jul  7 05:48:11 2014	(r268356)
@@ -80,6 +80,7 @@ struct cfiscsi_session {
 	int				cs_portal_group_tag;
 	struct cv			cs_maintenance_cv;
 	bool				cs_terminating;
+	bool				cs_tasks_aborted;
 	size_t				cs_max_data_segment_length;
 	size_t				cs_max_burst_length;
 	bool				cs_immediate_data;

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 06:17:08 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 498A9503;
 Mon,  7 Jul 2014 06:17:08 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3837A2DED;
 Mon,  7 Jul 2014 06:17:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s676H8PX076701;
 Mon, 7 Jul 2014 06:17:08 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s676H8b4076700;
 Mon, 7 Jul 2014 06:17:08 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407070617.s676H8b4076700@svn.freebsd.org>
From: Alexander Motin 
Date: Mon, 7 Jul 2014 06:17:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268357 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 06:17:08 -0000

Author: mav
Date: Mon Jul  7 06:17:07 2014
New Revision: 268357
URL: http://svnweb.freebsd.org/changeset/base/268357

Log:
  Correction to r268356: collide only sessions to the same target.

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Mon Jul  7 05:48:11 2014	(r268356)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Mon Jul  7 06:17:07 2014	(r268357)
@@ -1507,6 +1507,8 @@ restart:
 		mtx_lock(&softc->lock);
 		TAILQ_FOREACH(cs2, &softc->sessions, cs_next) {
 			if (cs2 != cs && cs2->cs_tasks_aborted == false &&
+			    cs->cs_target == cs2->cs_target &&
+			    cs->cs_portal_group_tag == cs2->cs_portal_group_tag &&
 			    strcmp(cs->cs_initiator_id, cs2->cs_initiator_id) == 0) {
 				cfiscsi_session_terminate(cs2);
 				mtx_unlock(&softc->lock);

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 06:24:04 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E05E6791;
 Mon,  7 Jul 2014 06:24:03 +0000 (UTC)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 829E22E8B;
 Mon,  7 Jul 2014 06:24:03 +0000 (UTC)
Received: from tom.home (kib@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s676Nvig050827
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Mon, 7 Jul 2014 09:23:57 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s676Nvig050827
Received: (from kostik@localhost)
 by tom.home (8.14.9/8.14.9/Submit) id s676Nvpf050826;
 Mon, 7 Jul 2014 09:23:57 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Mon, 7 Jul 2014 09:23:57 +0300
From: Konstantin Belousov 
To: Mateusz Guzik 
Subject: Re: svn commit: r268087 - head/sys/kern
Message-ID: <20140707062357.GF93733@kib.kiev.ua>
References: <201407010921.s619LXHL063077@svn.freebsd.org>
 <20140701114245.GO93733@kib.kiev.ua>
 <20140701115612.GA26696@dft-labs.eu>
 <20140701123058.GP93733@kib.kiev.ua>
 <20140701125410.GB26696@dft-labs.eu>
 <20140701180903.GT93733@kib.kiev.ua>
 <20140706211850.GA17706@dft-labs.eu>
 <20140706213900.GB17706@dft-labs.eu>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="YKGyq5YQxDjF8U6+"
Content-Disposition: inline
In-Reply-To: <20140706213900.GB17706@dft-labs.eu>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 autolearn_force=no version=3.4.0
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Mateusz Guzik 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 06:24:04 -0000


--YKGyq5YQxDjF8U6+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Jul 06, 2014 at 11:39:00PM +0200, Mateusz Guzik wrote:
> On Sun, Jul 06, 2014 at 11:18:51PM +0200, Mateusz Guzik wrote:
> > On Tue, Jul 01, 2014 at 09:09:03PM +0300, Konstantin Belousov wrote:
> > > On Tue, Jul 01, 2014 at 02:54:10PM +0200, Mateusz Guzik wrote:
> > > > It is passed down to MAC (mac_vnode_execve_will_transition and
> > > > mac_vnode_execve_transition) and then vfs_mark_atime.
> > > And we can lock it only there.
> > >=20
> >=20
> > I don't see how this code could be reorganized to reduce vnode lock
> > coverage and not add unlock + lock pair to the common case (no hwpmc and
> > no credential change).
> >=20
> > vfs_mark_atime is only called when execve cannot return an error
> > anymore, with vnode locked and proc unlocked. Moving it before hwpmc
> > checks would require additional pair of proc unlock/lock.
> >=20
> > That said, I would prefer to just commit previously proposed fixup.
> >=20
Ok.

>=20
> hm, I only now notice that fexecve case does:
> vn_lock(binvp, LK_EXCLUSIVE | LK_RETRY)
>=20
> I guess this can be safely changed to LK_SHARED.

No, it cannot.  The VV_TEXT flag must be handled under the exclusive lock.

--YKGyq5YQxDjF8U6+
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJTujz9AAoJEJDCuSvBvK1B9xQQAJKAK5B6rrkQhaQfF/Aq7U26
rxlDFM9TRW2XY9M6NSAGYd9f47VfHqGKCcdfW3RANj2mJkAPBz9ZtAuQcQnhQFox
77nAiLi4XTGe8+cV9ZhSAsEpP7mG47etyqN7mi7Q9zg/spVOLUeL6hvxuV7W/QUZ
aPgZBNR8+Oe5Wvu9+SvrM4vhxxEY/Ns1mrcrZsCMGVWWKq1KvrVLSkgXlHl5S6aJ
xY1t6RVcOq3TAqqNMPD3MmBdpnc7l7Sjgx14WLbGN8ZjcZznwu0P17QYvxa+h0Pb
38HGUwGkFZaPlJIQzBtu04SRZJGpbhHrTQ0t3cNS9jII5sz0ARV/XoMS/HOtC9vy
ETnHtt+La4E0u3cAvEwRO3JvJh19cHHOSDm+B3jv+0wHDIQ/IU71ZqUaKf8365YK
HNlUBjc2GrW0U7yAYTd4WYaWNnfDyRnuNuyeh+x+f4poWcxzeN5FG1wegSb2upWP
48wpxAHPFFlxbgTqBX+DmUtxliiPHgMkvQPFKabLGbXXayPLmRzCdqn12iWBJ3Hr
wy/xMU6fpY77fwn6U5eODtjkFpKlzSo6O9bxyD6Nvv4+HrHnmq80trAxQndM2ffD
7ditGe/IvNdotTHQdUzgnsZq42Mq548EsU87gHfLqTOijmXPyWscY7QzoR3X+8Tn
2r+2+gberebDSdVVzYxB
=DL2z
-----END PGP SIGNATURE-----

--YKGyq5YQxDjF8U6+--

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 08:22:39 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id EBFB35CE;
 Mon,  7 Jul 2014 08:22:39 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BF0DB27E2;
 Mon,  7 Jul 2014 08:22:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s678MdSa036700;
 Mon, 7 Jul 2014 08:22:39 GMT (envelope-from fabient@svn.freebsd.org)
Received: (from fabient@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s678MdLd036699;
 Mon, 7 Jul 2014 08:22:39 GMT (envelope-from fabient@svn.freebsd.org)
Message-Id: <201407070822.s678MdLd036699@svn.freebsd.org>
From: Fabien Thomas 
Date: Mon, 7 Jul 2014 08:22:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268359 - head/sys/dev/mge
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 08:22:40 -0000

Author: fabient
Date: Mon Jul  7 08:22:39 2014
New Revision: 268359
URL: http://svnweb.freebsd.org/changeset/base/268359

Log:
  Optim and Fix for mge driver:
  - add missing rcvif in mbuf
  - add missing ipacket stat
  - remove uncessary mbuf copy on output path
  - fix deadlock of the TX engine in case of error
  
  Obtained from:	NETASQ
  MFC after:	2 weeks

Modified:
  head/sys/dev/mge/if_mge.c

Modified: head/sys/dev/mge/if_mge.c
==============================================================================
--- head/sys/dev/mge/if_mge.c	Mon Jul  7 06:37:14 2014	(r268358)
+++ head/sys/dev/mge/if_mge.c	Mon Jul  7 08:22:39 2014	(r268359)
@@ -1140,6 +1140,8 @@ mge_intr_rx_locked(struct mge_softc *sc,
 			mb->m_pkthdr.len -= 2;
 			mb->m_data += 2;
 
+			mb->m_pkthdr.rcvif = ifp;
+
 			mge_offload_process_frame(ifp, mb, status,
 			    bufsize);
 
@@ -1159,6 +1161,8 @@ mge_intr_rx_locked(struct mge_softc *sc,
 			count -= 1;
 	}
 
+	ifp->if_ipackets += rx_npkts;
+
 	return (rx_npkts);
 }
 
@@ -1437,12 +1441,6 @@ mge_encap(struct mge_softc *sc, struct m
 
 	ifp = sc->ifp;
 
-	/* Check for free descriptors */
-	if (sc->tx_desc_used_count + 1 >= MGE_TX_DESC_NUM) {
-		/* No free descriptors */
-		return (-1);
-	}
-
 	/* Fetch unused map */
 	desc_no = sc->tx_desc_curr;
 	dw = &sc->mge_tx_desc[desc_no];
@@ -1451,9 +1449,16 @@ mge_encap(struct mge_softc *sc, struct m
 	/* Create mapping in DMA memory */
 	error = bus_dmamap_load_mbuf_sg(sc->mge_tx_dtag, mapp, m0, segs, &nsegs,
 	    BUS_DMA_NOWAIT);
-	if (error != 0 || nsegs != 1 ) {
+	if (error != 0) {
+		m_freem(m0);
+		return (error);
+	}
+
+	/* Only one segment is supported. */
+	if (nsegs != 1) {
 		bus_dmamap_unload(sc->mge_tx_dtag, mapp);
-		return ((error != 0) ? error : -1);
+		m_freem(m0);
+		return (-1);
 	}
 
 	bus_dmamap_sync(sc->mge_tx_dtag, mapp, BUS_DMASYNC_PREWRITE);
@@ -1553,15 +1558,33 @@ mge_start_locked(struct ifnet *ifp)
 		if (m0 == NULL)
 			break;
 
-		mtmp = m_defrag(m0, M_NOWAIT);
-		if (mtmp)
-			m0 = mtmp;
+		if (m0->m_pkthdr.csum_flags & (CSUM_IP|CSUM_TCP|CSUM_UDP) ||
+		    m0->m_flags & M_VLANTAG) {
+			if (M_WRITABLE(m0) == 0) {
+				mtmp = m_dup(m0, M_NOWAIT);
+				m_freem(m0);
+				if (mtmp == NULL)
+					continue;
+				m0 = mtmp;
+			}
+		}
+		/* The driver support only one DMA fragment. */
+		if (m0->m_next != NULL) {
+			mtmp = m_defrag(m0, M_NOWAIT);
+			if (mtmp)
+				m0 = mtmp;
+		}
 
-		if (mge_encap(sc, m0)) {
+		/* Check for free descriptors */
+		if (sc->tx_desc_used_count + 1 >= MGE_TX_DESC_NUM) {
 			IF_PREPEND(&ifp->if_snd, m0);
 			ifp->if_drv_flags |= IFF_DRV_OACTIVE;
 			break;
 		}
+
+		if (mge_encap(sc, m0) != 0)
+			break;
+
 		queued++;
 		BPF_MTAP(ifp, m0);
 	}

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 08:58:37 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8610E59C;
 Mon,  7 Jul 2014 08:58:37 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5AC2A2C49;
 Mon,  7 Jul 2014 08:58:37 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s678wbsq051158;
 Mon, 7 Jul 2014 08:58:37 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s678wbwr051157;
 Mon, 7 Jul 2014 08:58:37 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407070858.s678wbwr051157@svn.freebsd.org>
From: Alexander Motin 
Date: Mon, 7 Jul 2014 08:58:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268361 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 08:58:37 -0000

Author: mav
Date: Mon Jul  7 08:58:36 2014
New Revision: 268361
URL: http://svnweb.freebsd.org/changeset/base/268361

Log:
  Fix bugs for PERSISTENT RESERVE OUT bits in r268096.

Modified:
  head/sys/cam/ctl/ctl_cmd_table.c

Modified: head/sys/cam/ctl/ctl_cmd_table.c
==============================================================================
--- head/sys/cam/ctl/ctl_cmd_table.c	Mon Jul  7 08:42:04 2014	(r268360)
+++ head/sys/cam/ctl/ctl_cmd_table.c	Mon Jul  7 08:58:36 2014	(r268361)
@@ -127,7 +127,7 @@ const struct ctl_cmd_entry ctl_cmd_table
 						  CTL_FLAG_DATA_OUT |
 						  CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
  CTL_LUN_PAT_NONE,
- 10, { 0x00, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}},
+ 10, { 0x01, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}},
 
 /* 02 RELEASE */
 {ctl_persistent_reserve_out, CTL_SERIDX_PRES_OUT, CTL_CMD_FLAG_ALLOW_ON_RESV |
@@ -138,7 +138,7 @@ const struct ctl_cmd_entry ctl_cmd_table
 						  CTL_FLAG_DATA_OUT |
 						  CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
  CTL_LUN_PAT_NONE,
- 10, { 0x00, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}},
+ 10, { 0x02, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}},
 
 /* 03 CLEAR */
 {ctl_persistent_reserve_out, CTL_SERIDX_PRES_OUT, CTL_CMD_FLAG_ALLOW_ON_RESV |
@@ -149,7 +149,7 @@ const struct ctl_cmd_entry ctl_cmd_table
 						  CTL_FLAG_DATA_OUT |
 						  CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
  CTL_LUN_PAT_NONE,
- 10, { 0x00, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}},
+ 10, { 0x03, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}},
 
 /* 04 PREEMPT */
 {ctl_persistent_reserve_out, CTL_SERIDX_PRES_OUT, CTL_CMD_FLAG_ALLOW_ON_RESV |
@@ -160,7 +160,7 @@ const struct ctl_cmd_entry ctl_cmd_table
 						  CTL_FLAG_DATA_OUT |
 						  CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
  CTL_LUN_PAT_NONE,
- 10, { 0x00, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}},
+ 10, { 0x04, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}},
 
 /* 05 PREEMPT AND ABORT */
 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
@@ -174,7 +174,7 @@ const struct ctl_cmd_entry ctl_cmd_table
 						  CTL_FLAG_DATA_OUT |
 						  CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
  CTL_LUN_PAT_NONE,
- 10, { 0x00, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}},
+ 10, { 0x06, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}},
 
 /* 07 REGISTER AND MOVE */
 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 09:37:24 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 379BF50B;
 Mon,  7 Jul 2014 09:37:24 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 236FA2FE4;
 Mon,  7 Jul 2014 09:37:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s679bONm070354;
 Mon, 7 Jul 2014 09:37:24 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s679bMnb070347;
 Mon, 7 Jul 2014 09:37:22 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407070937.s679bMnb070347@svn.freebsd.org>
From: Alexander Motin 
Date: Mon, 7 Jul 2014 09:37:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268362 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 09:37:24 -0000

Author: mav
Date: Mon Jul  7 09:37:22 2014
New Revision: 268362
URL: http://svnweb.freebsd.org/changeset/base/268362

Log:
  Teach ctl_add_initiator() to dynamically allocate IIDs from pool.
  
  If port passed negative IID value, the function will try to allocate IID
  from the pool of unused, based on passed wwpn or name arguments.  It does
  all its best to make IID unique and persistent across reconnects.
  
  This makes persistent reservation properly work for iSCSI.  Previously,
  in case of reconnects, reservation could be unexpectedly lost, or even
  migrate between intiators.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_frontend.c
  head/sys/cam/ctl/ctl_frontend.h
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/cam/ctl/ctl_frontend_iscsi.h
  head/sys/cam/ctl/ctl_private.h
  head/sys/cam/ctl/scsi_ctl.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Mon Jul  7 08:58:36 2014	(r268361)
+++ head/sys/cam/ctl/ctl.c	Mon Jul  7 09:37:22 2014	(r268362)
@@ -1089,11 +1089,6 @@ ctl_init(void)
 		printf("ctl: CAM Target Layer loaded\n");
 
 	/*
-	 * Initialize the initiator and portname mappings
-	 */
-	memset(softc->wwpn_iid, 0, sizeof(softc->wwpn_iid));
-
-	/*
 	 * Initialize the ioctl front end.
 	 */
 	ctl_frontend_register(&ioctl_frontend);
@@ -1365,32 +1360,24 @@ ctl_ioctl_offline(void *arg)
 
 /*
  * Remove an initiator by port number and initiator ID.
- * Returns 0 for success, 1 for failure.
+ * Returns 0 for success, -1 for failure.
  */
 int
-ctl_remove_initiator(int32_t targ_port, uint32_t iid)
+ctl_remove_initiator(struct ctl_port *port, int iid)
 {
-	struct ctl_softc *softc;
-
-	softc = control_softc;
+	struct ctl_softc *softc = control_softc;
 
 	mtx_assert(&softc->ctl_lock, MA_NOTOWNED);
 
-	if ((targ_port < 0)
-	 || (targ_port > CTL_MAX_PORTS)) {
-		printf("%s: invalid port number %d\n", __func__, targ_port);
-		return (1);
-	}
 	if (iid > CTL_MAX_INIT_PER_PORT) {
 		printf("%s: initiator ID %u > maximun %u!\n",
 		       __func__, iid, CTL_MAX_INIT_PER_PORT);
-		return (1);
+		return (-1);
 	}
 
 	mtx_lock(&softc->ctl_lock);
-
-	softc->wwpn_iid[targ_port][iid].in_use = 0;
-
+	port->wwpn_iid[iid].in_use--;
+	port->wwpn_iid[iid].last_use = time_uptime;
 	mtx_unlock(&softc->ctl_lock);
 
 	return (0);
@@ -1398,41 +1385,91 @@ ctl_remove_initiator(int32_t targ_port, 
 
 /*
  * Add an initiator to the initiator map.
- * Returns 0 for success, 1 for failure.
+ * Returns iid for success, < 0 for failure.
  */
 int
-ctl_add_initiator(uint64_t wwpn, int32_t targ_port, uint32_t iid)
+ctl_add_initiator(struct ctl_port *port, int iid, uint64_t wwpn, char *name)
 {
-	struct ctl_softc *softc;
-	int retval;
-
-	softc = control_softc;
+	struct ctl_softc *softc = control_softc;
+	time_t best_time;
+	int i, best;
 
 	mtx_assert(&softc->ctl_lock, MA_NOTOWNED);
 
-	retval = 0;
-
-	if ((targ_port < 0)
-	 || (targ_port > CTL_MAX_PORTS)) {
-		printf("%s: invalid port number %d\n", __func__, targ_port);
-		return (1);
-	}
-	if (iid > CTL_MAX_INIT_PER_PORT) {
-		printf("%s: WWPN %#jx initiator ID %u > maximun %u!\n",
+	if (iid >= CTL_MAX_INIT_PER_PORT) {
+		printf("%s: WWPN %#jx initiator ID %u > maximum %u!\n",
 		       __func__, wwpn, iid, CTL_MAX_INIT_PER_PORT);
-		return (1);
+		free(name, M_CTL);
+		return (-1);
 	}
 
 	mtx_lock(&softc->ctl_lock);
 
-	if (softc->wwpn_iid[targ_port][iid].in_use != 0) {
+	if (iid < 0 && (wwpn != 0 || name != NULL)) {
+		for (i = 0; i < CTL_MAX_INIT_PER_PORT; i++) {
+			if (wwpn != 0 && wwpn == port->wwpn_iid[i].wwpn) {
+				iid = i;
+				break;
+			}
+			if (name != NULL && port->wwpn_iid[i].name != NULL &&
+			    strcmp(name, port->wwpn_iid[i].name) == 0) {
+				iid = i;
+				break;
+			}
+		}
+	}
+
+	if (iid < 0) {
+		for (i = 0; i < CTL_MAX_INIT_PER_PORT; i++) {
+			if (port->wwpn_iid[i].in_use == 0 &&
+			    port->wwpn_iid[i].wwpn == 0 &&
+			    port->wwpn_iid[i].name == NULL) {
+				iid = i;
+				break;
+			}
+		}
+	}
+
+	if (iid < 0) {
+		best = -1;
+		best_time = INT32_MAX;
+		for (i = 0; i < CTL_MAX_INIT_PER_PORT; i++) {
+			if (port->wwpn_iid[i].in_use == 0) {
+				if (port->wwpn_iid[i].last_use < best_time) {
+					best = i;
+					best_time = port->wwpn_iid[i].last_use;
+				}
+			}
+		}
+		iid = best;
+	}
+
+	if (iid < 0) {
+		mtx_unlock(&softc->ctl_lock);
+		free(name, M_CTL);
+		return (-2);
+	}
+
+	if (port->wwpn_iid[iid].in_use > 0 && (wwpn != 0 || name != NULL)) {
 		/*
-		 * We don't treat this as an error.
+		 * This is not an error yet.
 		 */
-		if (softc->wwpn_iid[targ_port][iid].wwpn == wwpn) {
-			printf("%s: port %d iid %u WWPN %#jx arrived again?\n",
-			       __func__, targ_port, iid, (uintmax_t)wwpn);
-			goto bailout;
+		if (wwpn != 0 && wwpn == port->wwpn_iid[iid].wwpn) {
+#if 0
+			printf("%s: port %d iid %u WWPN %#jx arrived"
+			    " again\n", __func__, port->targ_port,
+			    iid, (uintmax_t)wwpn);
+#endif
+			goto take;
+		}
+		if (name != NULL && port->wwpn_iid[iid].name != NULL &&
+		    strcmp(name, port->wwpn_iid[iid].name) == 0) {
+#if 0
+			printf("%s: port %d iid %u name '%s' arrived"
+			    " again\n", __func__, port->targ_port,
+			    iid, name);
+#endif
+			goto take;
 		}
 
 		/*
@@ -1440,26 +1477,25 @@ ctl_add_initiator(uint64_t wwpn, int32_t
 		 * driver is telling us we have a new WWPN for this
 		 * initiator ID, so we pretty much need to use it.
 		 */
-		printf("%s: port %d iid %u WWPN %#jx arrived, WWPN %#jx is "
-		       "still at that address\n", __func__, targ_port, iid,
-		       (uintmax_t)wwpn,
-		       (uintmax_t)softc->wwpn_iid[targ_port][iid].wwpn);
+		printf("%s: port %d iid %u WWPN %#jx '%s' arrived,"
+		    " but WWPN %#jx '%s' is still at that address\n",
+		    __func__, port->targ_port, iid, wwpn, name,
+		    (uintmax_t)port->wwpn_iid[iid].wwpn,
+		    port->wwpn_iid[iid].name);
 
 		/*
 		 * XXX KDM clear have_ca and ua_pending on each LUN for
 		 * this initiator.
 		 */
 	}
-	softc->wwpn_iid[targ_port][iid].in_use = 1;
-	softc->wwpn_iid[targ_port][iid].iid = iid;
-	softc->wwpn_iid[targ_port][iid].wwpn = wwpn;
-	softc->wwpn_iid[targ_port][iid].port = targ_port;
-
-bailout:
-
+take:
+	free(port->wwpn_iid[iid].name, M_CTL);
+	port->wwpn_iid[iid].name = name;
+	port->wwpn_iid[iid].wwpn = wwpn;
+	port->wwpn_iid[iid].in_use++;
 	mtx_unlock(&softc->ctl_lock);
 
-	return (retval);
+	return (iid);
 }
 
 static int
@@ -2872,23 +2908,11 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 		break;
 	}
 	case CTL_DUMP_STRUCTS: {
-		int i, j, k;
+		int i, j, k, idx;
 		struct ctl_port *port;
 		struct ctl_frontend *fe;
 
-		printf("CTL IID to WWPN map start:\n");
-		for (i = 0; i < CTL_MAX_PORTS; i++) {
-			for (j = 0; j < CTL_MAX_INIT_PER_PORT; j++) {
-				if (softc->wwpn_iid[i][j].in_use == 0)
-					continue;
-
-				printf("port %d iid %u WWPN %#jx\n",
-				       softc->wwpn_iid[i][j].port,
-				       softc->wwpn_iid[i][j].iid, 
-				       (uintmax_t)softc->wwpn_iid[i][j].wwpn);
-			}
-		}
-		printf("CTL IID to WWPN map end\n");
+		mtx_lock(&softc->ctl_lock);
 		printf("CTL Persistent Reservation information start:\n");
 		for (i = 0; i < CTL_MAX_LUNS; i++) {
 			struct ctl_lun *lun;
@@ -2901,33 +2925,46 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 
 			for (j = 0; j < (CTL_MAX_PORTS * 2); j++) {
 				for (k = 0; k < CTL_MAX_INIT_PER_PORT; k++){
-					if (lun->per_res[j+k].registered == 0)
+					idx = j * CTL_MAX_INIT_PER_PORT + k;
+					if (lun->per_res[idx].registered == 0)
 						continue;
-					printf("LUN %d port %d iid %d key "
+					printf("  LUN %d port %d iid %d key "
 					       "%#jx\n", i, j, k,
 					       (uintmax_t)scsi_8btou64(
-					       lun->per_res[j+k].res_key.key));
+					       lun->per_res[idx].res_key.key));
 				}
 			}
 		}
 		printf("CTL Persistent Reservation information end\n");
 		printf("CTL Ports:\n");
-		/*
-		 * XXX KDM calling this without a lock.  We'd likely want
-		 * to drop the lock before calling the frontend's dump
-		 * routine anyway.
-		 */
 		STAILQ_FOREACH(port, &softc->port_list, links) {
-			printf("Port %s Frontend %s Type %u pport %d vport %d WWNN "
-			       "%#jx WWPN %#jx\n", port->port_name,
+			printf("  Port %d '%s' Frontend '%s' Type %u pp %d vp %d WWNN "
+			       "%#jx WWPN %#jx\n", port->targ_port, port->port_name,
 			       port->frontend->name, port->port_type,
 			       port->physical_port, port->virtual_port,
 			       (uintmax_t)port->wwnn, (uintmax_t)port->wwpn);
+			for (j = 0; j < CTL_MAX_INIT_PER_PORT; j++) {
+				if (port->wwpn_iid[j].in_use == 0 &&
+				    port->wwpn_iid[j].wwpn == 0 &&
+				    port->wwpn_iid[j].name == NULL)
+					continue;
+
+				printf("    iid %u use %d WWPN %#jx '%s'\n",
+				    j, port->wwpn_iid[j].in_use,
+				    (uintmax_t)port->wwpn_iid[j].wwpn,
+				    port->wwpn_iid[j].name);
+			}
 		}
 		printf("CTL Port information end\n");
+		mtx_unlock(&softc->ctl_lock);
+		/*
+		 * XXX KDM calling this without a lock.  We'd likely want
+		 * to drop the lock before calling the frontend's dump
+		 * routine anyway.
+		 */
 		printf("CTL Frontends:\n");
 		STAILQ_FOREACH(fe, &softc->fe_list, links) {
-			printf("Frontend %s\n", fe->name);
+			printf("  Frontend '%s'\n", fe->name);
 			if (fe->fe_dump != NULL)
 				fe->fe_dump();
 		}

Modified: head/sys/cam/ctl/ctl_frontend.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend.c	Mon Jul  7 08:58:36 2014	(r268361)
+++ head/sys/cam/ctl/ctl_frontend.c	Mon Jul  7 09:37:22 2014	(r268362)
@@ -158,6 +158,17 @@ ctl_port_register(struct ctl_port *port,
 	mtx_unlock(&control_softc->ctl_lock);
 
 	/*
+	 * Initialize the initiator and portname mappings
+	 */
+	port->max_initiators = CTL_MAX_INIT_PER_PORT;
+	port->wwpn_iid = malloc(sizeof(*port->wwpn_iid) * port->max_initiators,
+	    M_CTL, M_NOWAIT | M_ZERO);
+	if (port->wwpn_iid == NULL) {
+		retval = ENOMEM;
+		goto error;
+	}
+
+	/*
 	 * We add 20 to whatever the caller requests, so he doesn't get
 	 * burned by queueing things back to the pending sense queue.  In
 	 * theory, there should probably only be one outstanding item, at
@@ -168,6 +179,8 @@ ctl_port_register(struct ctl_port *port,
 	retval = ctl_pool_create(control_softc, CTL_POOL_FETD,
 				 port->num_requested_ctl_io + 20, &pool);
 	if (retval != 0) {
+		free(port->wwpn_iid, M_CTL);
+error:
 		port->targ_port = -1;
 		mtx_lock(&control_softc->ctl_lock);
 		ctl_clear_mask(&control_softc->ctl_port_mask, port_num);
@@ -181,7 +194,6 @@ ctl_port_register(struct ctl_port *port,
 
 	mtx_lock(&control_softc->ctl_lock);
 	port->targ_port = port_num + (master_shelf != 0 ? 0 : CTL_MAX_PORTS);
-	port->max_initiators = CTL_MAX_INIT_PER_PORT;
 	STAILQ_INSERT_TAIL(&port->frontend->port_list, port, fe_links);
 	STAILQ_INSERT_TAIL(&control_softc->port_list, port, links);
 	control_softc->ctl_ports[port_num] = port;
@@ -194,8 +206,7 @@ int
 ctl_port_deregister(struct ctl_port *port)
 {
 	struct ctl_io_pool *pool;
-	int port_num;
-	int retval;
+	int port_num, retval, i;
 
 	retval = 0;
 
@@ -223,6 +234,9 @@ ctl_port_deregister(struct ctl_port *por
 	port->port_devid = NULL;
 	free(port->target_devid, M_CTL);
 	port->target_devid = NULL;
+	for (i = 0; i < port->max_initiators; i++)
+		free(port->wwpn_iid[i].name, M_CTL);
+	free(port->wwpn_iid, M_CTL);
 
 bailout:
 	return (retval);

Modified: head/sys/cam/ctl/ctl_frontend.h
==============================================================================
--- head/sys/cam/ctl/ctl_frontend.h	Mon Jul  7 08:58:36 2014	(r268361)
+++ head/sys/cam/ctl/ctl_frontend.h	Mon Jul  7 09:37:22 2014	(r268362)
@@ -80,6 +80,13 @@ typedef int (*fe_ioctl_t)(struct cdev *d
 	MODULE_DEPEND(name, ctl, 1, 1, 1); \
 	MODULE_DEPEND(name, cam, 1, 1, 1)
 
+struct ctl_wwpn_iid {
+	int in_use;
+	time_t last_use;
+	uint64_t wwpn;
+	char *name;
+};
+
 /*
  * The ctl_frontend structure is the registration mechanism between a FETD
  * (Front End Target Driver) and the CTL layer.  Here is a description of
@@ -228,6 +235,7 @@ struct ctl_port {
 	int32_t		targ_port;		/* passed back to FETD */
 	void		*ctl_pool_ref;		/* passed back to FETD */
 	uint32_t	max_initiators;		/* passed back to FETD */
+	struct ctl_wwpn_iid *wwpn_iid;		/* used by CTL */
 	uint64_t	wwnn;			/* set by CTL before online */
 	uint64_t	wwpn;			/* set by CTL before online */
 	ctl_port_status	status;			/* used by CTL */
@@ -269,13 +277,13 @@ struct ctl_frontend * ctl_frontend_find(
  * This may block until resources are allocated.  Called at FETD module load
  * time. Returns 0 for success, non-zero for failure.
  */
-int ctl_port_register(struct ctl_port *fe, int master_SC);
+int ctl_port_register(struct ctl_port *port, int master_SC);
 
 /*
  * Called at FETD module unload time.
  * Returns 0 for success, non-zero for failure.
  */
-int ctl_port_deregister(struct ctl_port *fe);
+int ctl_port_deregister(struct ctl_port *port);
 
 /*
  * Called to set the WWNN and WWPN for a particular frontend.
@@ -312,21 +320,18 @@ int ctl_queue(union ctl_io *io);
 int ctl_queue_sense(union ctl_io *io);
 
 /*
- * This routine adds an initiator to CTL's port database.  The WWPN should
- * be the FC WWPN, if available.  The targ_port field should be the same as
- * the targ_port passed back from CTL in the ctl_frontend structure above.
+ * This routine adds an initiator to CTL's port database.
  * The iid field should be the same as the iid passed in the nexus of each
  * ctl_io from this initiator.
+ * The WWPN should be the FC WWPN, if available.
  */
-int ctl_add_initiator(uint64_t wwpn, int32_t targ_port, uint32_t iid);
+int ctl_add_initiator(struct ctl_port *port, int iid, uint64_t wwpn, char *name);
 
 /*
- * This routine will remove an initiator from CTL's port database.  The
- * targ_port field should be the same as the targ_port passed back in the
- * ctl_frontend structure above.  The iid field should be the same as the
- * iid passed in the nexus of each ctl_io from this initiator.
+ * This routine will remove an initiator from CTL's port database.
+ * The iid field should be the same as the iid passed in the nexus of each
+ * ctl_io from this initiator.
  */
-int
-ctl_remove_initiator(int32_t targ_port, uint32_t iid);
+int ctl_remove_initiator(struct ctl_port *port, int iid);
 
 #endif	/* _CTL_FRONTEND_H_ */

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Mon Jul  7 08:58:36 2014	(r268361)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Mon Jul  7 09:37:22 2014	(r268362)
@@ -1146,41 +1146,25 @@ cfiscsi_session_terminate(struct cfiscsi
 static int
 cfiscsi_session_register_initiator(struct cfiscsi_session *cs)
 {
-	int error, i;
-	struct cfiscsi_softc *softc;
+	struct cfiscsi_target *ct;
+	char *name;
+	int i;
 
 	KASSERT(cs->cs_ctl_initid == -1, ("already registered"));
 
-	softc = &cfiscsi_softc;
-
-	mtx_lock(&softc->lock);
-	for (i = 0; i < softc->max_initiators; i++) {
-		if (softc->ctl_initids[i] == 0)
-			break;
-	}
-	if (i == softc->max_initiators) {
-		CFISCSI_SESSION_WARN(cs, "too many concurrent sessions (%d)",
-		    softc->max_initiators);
-		mtx_unlock(&softc->lock);
+	ct = cs->cs_target;
+	name = strdup(cs->cs_initiator_id, M_CTL);
+	i = ctl_add_initiator(&ct->ct_port, -1, 0, name);
+	if (i < 0) {
+		CFISCSI_SESSION_WARN(cs, "ctl_add_initiator failed with error %d",
+		    i);
+		cs->cs_ctl_initid = -1;
 		return (1);
 	}
-	softc->ctl_initids[i] = 1;
-	mtx_unlock(&softc->lock);
-
+	cs->cs_ctl_initid = i;
 #if 0
-	CFISCSI_SESSION_DEBUG(cs, "adding initiator id %d, max %d",
-	    i, softc->max_initiators);
+	CFISCSI_SESSION_DEBUG(cs, "added initiator id %d", i);
 #endif
-	cs->cs_ctl_initid = i;
-	error = ctl_add_initiator(0x0, cs->cs_target->ct_port.targ_port, cs->cs_ctl_initid);
-	if (error != 0) {
-		CFISCSI_SESSION_WARN(cs, "ctl_add_initiator failed with error %d", error);
-		mtx_lock(&softc->lock);
-		softc->ctl_initids[cs->cs_ctl_initid] = 0;
-		mtx_unlock(&softc->lock);
-		cs->cs_ctl_initid = -1;
-		return (1);
-	}
 
 	return (0);
 }
@@ -1189,21 +1173,15 @@ static void
 cfiscsi_session_unregister_initiator(struct cfiscsi_session *cs)
 {
 	int error;
-	struct cfiscsi_softc *softc;
 
 	if (cs->cs_ctl_initid == -1)
 		return;
 
-	softc = &cfiscsi_softc;
-
-	error = ctl_remove_initiator(cs->cs_target->ct_port.targ_port, cs->cs_ctl_initid);
+	error = ctl_remove_initiator(&cs->cs_target->ct_port, cs->cs_ctl_initid);
 	if (error != 0) {
 		CFISCSI_SESSION_WARN(cs, "ctl_remove_initiator failed with error %d",
 		    error);
 	}
-	mtx_lock(&softc->lock);
-	softc->ctl_initids[cs->cs_ctl_initid] = 0;
-	mtx_unlock(&softc->lock);
 	cs->cs_ctl_initid = -1;
 }
 
@@ -1300,8 +1278,6 @@ cfiscsi_init(void)
 	TAILQ_INIT(&softc->sessions);
 	TAILQ_INIT(&softc->targets);
 
-	softc->max_initiators = CTL_MAX_INIT_PER_PORT;
-
 	cfiscsi_data_wait_zone = uma_zcreate("cfiscsi_data_wait",
 	    sizeof(struct cfiscsi_data_wait), NULL, NULL, NULL, NULL,
 	    UMA_ALIGN_PTR, 0);

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.h
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.h	Mon Jul  7 08:58:36 2014	(r268361)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.h	Mon Jul  7 09:37:22 2014	(r268362)
@@ -112,8 +112,6 @@ struct cfiscsi_softc {
 	unsigned int			last_session_id;
 	TAILQ_HEAD(, cfiscsi_target)	targets;
 	TAILQ_HEAD(, cfiscsi_session)	sessions;
-	char				ctl_initids[CTL_MAX_INIT_PER_PORT];
-	int				max_initiators;
 #ifdef ICL_KERNEL_PROXY
 	struct icl_listen		*listener;
 	struct cv			accept_cv;

Modified: head/sys/cam/ctl/ctl_private.h
==============================================================================
--- head/sys/cam/ctl/ctl_private.h	Mon Jul  7 08:58:36 2014	(r268361)
+++ head/sys/cam/ctl/ctl_private.h	Mon Jul  7 09:37:22 2014	(r268362)
@@ -414,13 +414,6 @@ typedef enum {
 	CTL_FLAG_MASTER_SHELF	= 0x04
 } ctl_gen_flags;
 
-struct ctl_wwpn_iid {
-	int in_use;
-	uint64_t wwpn;
-	uint32_t iid;
-	int32_t port;
-};
-
 #define CTL_MAX_THREADS		16
 
 struct ctl_thread {
@@ -453,7 +446,6 @@ struct ctl_softc {
 	int targ_online;
 	uint32_t ctl_lun_mask[CTL_MAX_LUNS >> 5];
 	struct ctl_lun *ctl_luns[CTL_MAX_LUNS];
-	struct ctl_wwpn_iid wwpn_iid[CTL_MAX_PORTS][CTL_MAX_INIT_PER_PORT];
 	uint32_t ctl_port_mask;
 	uint64_t aps_locked_lun;
 	STAILQ_HEAD(, ctl_lun) lun_list;

Modified: head/sys/cam/ctl/scsi_ctl.c
==============================================================================
--- head/sys/cam/ctl/scsi_ctl.c	Mon Jul  7 08:58:36 2014	(r268361)
+++ head/sys/cam/ctl/scsi_ctl.c	Mon Jul  7 09:37:22 2014	(r268362)
@@ -484,14 +484,14 @@ ctlfeasync(void *callback_arg, uint32_t 
 				break;
 			}
 			if (dev_chg->arrived != 0) {
-				retval = ctl_add_initiator(dev_chg->wwpn,
-					softc->port.targ_port, dev_chg->target);
+				retval = ctl_add_initiator(&softc->port,
+				    dev_chg->target, dev_chg->wwpn, NULL);
 			} else {
-				retval = ctl_remove_initiator(
-					softc->port.targ_port, dev_chg->target);
+				retval = ctl_remove_initiator(&softc->port,
+				    dev_chg->target);
 			}
 
-			if (retval != 0) {
+			if (retval < 0) {
 				printf("%s: could not %s port %d iid %u "
 				       "WWPN %#jx!\n", __func__,
 				       (dev_chg->arrived != 0) ? "add" :

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 11:05:06 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4F3C9141;
 Mon,  7 Jul 2014 11:05:06 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3BA8427B2;
 Mon,  7 Jul 2014 11:05:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s67B56ZC013320;
 Mon, 7 Jul 2014 11:05:06 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s67B55Hx013313;
 Mon, 7 Jul 2014 11:05:05 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407071105.s67B55Hx013313@svn.freebsd.org>
From: Alexander Motin 
Date: Mon, 7 Jul 2014 11:05:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268363 - in head: sys/cam/ctl usr.sbin/ctladm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 11:05:06 -0000

Author: mav
Date: Mon Jul  7 11:05:04 2014
New Revision: 268363
URL: http://svnweb.freebsd.org/changeset/base/268363

Log:
  Add support for READ FULL STATUS action of PERSISTENT RESERVE IN command.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl.h
  head/sys/cam/ctl/ctl_cmd_table.c
  head/sys/cam/ctl/scsi_ctl.c
  head/usr.sbin/ctladm/ctladm.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Mon Jul  7 09:37:22 2014	(r268362)
+++ head/sys/cam/ctl/ctl.c	Mon Jul  7 11:05:04 2014	(r268363)
@@ -1499,6 +1499,61 @@ take:
 }
 
 static int
+ctl_create_iid(struct ctl_port *port, int iid, uint8_t *buf)
+{
+	int len;
+
+	switch (port->port_type) {
+	case CTL_PORT_FC:
+	{
+		struct scsi_transportid_fcp *id =
+		    (struct scsi_transportid_fcp *)buf;
+		if (port->wwpn_iid[iid].wwpn == 0)
+			return (0);
+		memset(id, 0, sizeof(*id));
+		id->format_protocol = SCSI_PROTO_FC;
+		scsi_u64to8b(port->wwpn_iid[iid].wwpn, id->n_port_name);
+		return (sizeof(*id));
+	}
+	case CTL_PORT_ISCSI:
+	{
+		struct scsi_transportid_iscsi_port *id =
+		    (struct scsi_transportid_iscsi_port *)buf;
+		if (port->wwpn_iid[iid].name == NULL)
+			return (0);
+		memset(id, 0, 256);
+		id->format_protocol = SCSI_TRN_ISCSI_FORMAT_PORT |
+		    SCSI_PROTO_ISCSI;
+		len = strlcpy(id->iscsi_name, port->wwpn_iid[iid].name, 252) + 1;
+		len = roundup2(min(len, 252), 4);
+		scsi_ulto2b(len, id->additional_length);
+		return (sizeof(*id) + len);
+	}
+	case CTL_PORT_SAS:
+	{
+		struct scsi_transportid_sas *id =
+		    (struct scsi_transportid_sas *)buf;
+		if (port->wwpn_iid[iid].wwpn == 0)
+			return (0);
+		memset(id, 0, sizeof(*id));
+		id->format_protocol = SCSI_PROTO_SAS;
+		scsi_u64to8b(port->wwpn_iid[iid].wwpn, id->sas_address);
+		return (sizeof(*id));
+	}
+	default:
+	{
+		struct scsi_transportid_spi *id =
+		    (struct scsi_transportid_spi *)buf;
+		memset(id, 0, sizeof(*id));
+		id->format_protocol = SCSI_PROTO_SPI;
+		scsi_ulto2b(iid, id->scsi_addr);
+		scsi_ulto2b(port->targ_port, id->rel_trgt_port_id);
+		return (sizeof(*id));
+	}
+	}
+}
+
+static int
 ctl_ioctl_lun_enable(void *arg, struct ctl_id targ_id, int lun_id)
 {
 	return (0);
@@ -7619,6 +7674,11 @@ retry:
 	case SPRI_RC: /* report capabilities */
 		total_len = sizeof(struct scsi_per_res_cap);
 		break;
+	case SPRI_RS: /* read full status */
+		total_len = sizeof(struct scsi_per_res_in_header) +
+		    (sizeof(struct scsi_per_res_in_full_desc) + 256) *
+		    lun->pr_key_count;
+		break;
 	default:
 		panic("Invalid PR type %x", cdb->action);
 	}
@@ -7775,7 +7835,62 @@ retry:
 		scsi_ulto2b(type_mask, res_cap->type_mask);
 		break;
 	}
-	case SPRI_RS: //read full status
+	case SPRI_RS: { // read full status
+		struct scsi_per_res_in_full *res_status;
+		struct scsi_per_res_in_full_desc *res_desc;
+		struct ctl_port *port;
+		int i, len;
+
+		res_status = (struct scsi_per_res_in_full*)ctsio->kern_data_ptr;
+
+		/*
+		 * We had to drop the lock to allocate our buffer, which
+		 * leaves time for someone to come in with another
+		 * persistent reservation.  (That is unlikely, though,
+		 * since this should be the only persistent reservation
+		 * command active right now.)
+		 */
+		if (total_len < (sizeof(struct scsi_per_res_in_header) +
+		    (sizeof(struct scsi_per_res_in_full_desc) + 256) *
+		     lun->pr_key_count)){
+			mtx_unlock(&lun->lun_lock);
+			free(ctsio->kern_data_ptr, M_CTL);
+			printf("%s: reservation length changed, retrying\n",
+			       __func__);
+			goto retry;
+		}
+
+		scsi_ulto4b(lun->PRGeneration, res_status->header.generation);
+
+		res_desc = &res_status->desc[0];
+		for (i = 0; i < 2*CTL_MAX_INITIATORS; i++) {
+			if (!lun->per_res[i].registered)
+				continue;
+
+			memcpy(&res_desc->res_key, &lun->per_res[i].res_key.key,
+			    sizeof(res_desc->res_key));
+			if ((lun->flags & CTL_LUN_PR_RESERVED) &&
+			    (lun->pr_res_idx == i ||
+			     lun->pr_res_idx == CTL_PR_ALL_REGISTRANTS)) {
+				res_desc->flags = SPRI_FULL_R_HOLDER;
+				res_desc->scopetype = lun->res_type;
+			}
+			scsi_ulto2b(i / CTL_MAX_INIT_PER_PORT,
+			    res_desc->rel_trgt_port_id);
+			len = 0;
+			port = softc->ctl_ports[i / CTL_MAX_INIT_PER_PORT];
+			if (port != NULL)
+				len = ctl_create_iid(port,
+				    i % CTL_MAX_INIT_PER_PORT,
+				    res_desc->transport_id);
+			scsi_ulto4b(len, res_desc->additional_length);
+			res_desc = (struct scsi_per_res_in_full_desc *)
+			    &res_desc->transport_id[len];
+		}
+		scsi_ulto4b((uint8_t *)res_desc - (uint8_t *)&res_status->desc[0],
+		    res_status->header.length);
+		break;
+	}
 	default:
 		/*
 		 * This is a bug, because we just checked for this above,

Modified: head/sys/cam/ctl/ctl.h
==============================================================================
--- head/sys/cam/ctl/ctl.h	Mon Jul  7 09:37:22 2014	(r268362)
+++ head/sys/cam/ctl/ctl.h	Mon Jul  7 11:05:04 2014	(r268363)
@@ -53,6 +53,7 @@ typedef enum {
 	CTL_PORT_IOCTL		= 0x04,
 	CTL_PORT_INTERNAL	= 0x08,
 	CTL_PORT_ISCSI		= 0x10,
+	CTL_PORT_SAS		= 0x20,
 	CTL_PORT_ALL		= 0xff,
 	CTL_PORT_ISC		= 0x100 // FC port for inter-shelf communication
 } ctl_port_type;

Modified: head/sys/cam/ctl/ctl_cmd_table.c
==============================================================================
--- head/sys/cam/ctl/ctl_cmd_table.c	Mon Jul  7 09:37:22 2014	(r268362)
+++ head/sys/cam/ctl/ctl_cmd_table.c	Mon Jul  7 11:05:04 2014	(r268363)
@@ -99,7 +99,15 @@ const struct ctl_cmd_entry ctl_cmd_table
  10, { 0x02, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07}},
 
 /* 03 READ FULL STATUS */
-{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
+{ctl_persistent_reserve_in, CTL_SERIDX_INQ, CTL_CMD_FLAG_ALLOW_ON_RESV |
+					    CTL_CMD_FLAG_OK_ON_BOTH |
+					    CTL_CMD_FLAG_OK_ON_STOPPED |
+					    CTL_CMD_FLAG_OK_ON_INOPERABLE |
+					    CTL_CMD_FLAG_OK_ON_SECONDARY |
+					    CTL_FLAG_DATA_IN |
+					    CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
+ CTL_LUN_PAT_NONE,
+ 10, { 0x03, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07}},
 
 /* 04-1f */
 };

Modified: head/sys/cam/ctl/scsi_ctl.c
==============================================================================
--- head/sys/cam/ctl/scsi_ctl.c	Mon Jul  7 09:37:22 2014	(r268362)
+++ head/sys/cam/ctl/scsi_ctl.c	Mon Jul  7 11:05:04 2014	(r268363)
@@ -372,6 +372,8 @@ ctlfeasync(void *callback_arg, uint32_t 
 		 */
 		if (cpi->transport == XPORT_FC)
 			port->port_type = CTL_PORT_FC;
+		else if (cpi->transport == XPORT_SAS)
+			port->port_type = CTL_PORT_SAS;
 		else
 			port->port_type = CTL_PORT_SCSI;
 

Modified: head/usr.sbin/ctladm/ctladm.c
==============================================================================
--- head/usr.sbin/ctladm/ctladm.c	Mon Jul  7 09:37:22 2014	(r268362)
+++ head/usr.sbin/ctladm/ctladm.c	Mon Jul  7 11:05:04 2014	(r268363)
@@ -500,6 +500,9 @@ retry:
 		case CTL_PORT_ISCSI:
 			type = "ISCSI";
 			break;
+		case CTL_PORT_SAS:
+			type = "SAS";
+			break;
 		default:
 			type = "UNKNOWN";
 			break;
@@ -590,6 +593,7 @@ static struct ctladm_opts cctl_fe_table[
 	{"scsi", CTL_PORT_SCSI, CTLADM_ARG_NONE, NULL},
 	{"internal", CTL_PORT_INTERNAL, CTLADM_ARG_NONE, NULL},
 	{"iscsi", CTL_PORT_ISCSI, CTLADM_ARG_NONE, NULL},
+	{"sas", CTL_PORT_SAS, CTLADM_ARG_NONE, NULL},
 	{"all", CTL_PORT_ALL, CTLADM_ARG_NONE, NULL},
 	{NULL, 0, 0, NULL}
 };

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 11:52:23 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id F1B67313;
 Mon,  7 Jul 2014 11:52:22 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DEE262BE9;
 Mon,  7 Jul 2014 11:52:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s67BqM4t036002;
 Mon, 7 Jul 2014 11:52:22 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s67BqMgF036001;
 Mon, 7 Jul 2014 11:52:22 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407071152.s67BqMgF036001@svn.freebsd.org>
From: Alexander Motin 
Date: Mon, 7 Jul 2014 11:52:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268364 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 11:52:23 -0000

Author: mav
Date: Mon Jul  7 11:52:22 2014
New Revision: 268364
URL: http://svnweb.freebsd.org/changeset/base/268364

Log:
  Fix "use after free" on port creation error in r268291.

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Mon Jul  7 11:05:04 2014	(r268363)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Mon Jul  7 11:52:22 2014	(r268364)
@@ -1945,26 +1945,26 @@ cfiscsi_ioctl_port_create(struct ctl_req
 	alias = ctl_get_opt(&opts, "cfiscsi_target_alias");
 	tag = ctl_get_opt(&opts, "cfiscsi_portal_group_tag");
 	if (target == NULL || tag == NULL) {
-		ctl_free_opts(&opts);
 		req->status = CTL_LUN_ERROR;
 		snprintf(req->error_str, sizeof(req->error_str),
 		    "Missing required argument");
+		ctl_free_opts(&opts);
 		return;
 	}
 	ct = cfiscsi_target_find_or_create(&cfiscsi_softc, target, alias);
 	if (ct == NULL) {
-		ctl_free_opts(&opts);
 		req->status = CTL_LUN_ERROR;
 		snprintf(req->error_str, sizeof(req->error_str),
 		    "failed to create target \"%s\"", target);
+		ctl_free_opts(&opts);
 		return;
 	}
 	if (ct->ct_state == CFISCSI_TARGET_STATE_ACTIVE) {
-		cfiscsi_target_release(ct);
-		ctl_free_opts(&opts);
 		req->status = CTL_LUN_ERROR;
 		snprintf(req->error_str, sizeof(req->error_str),
 		    "target \"%s\" already exist", target);
+		cfiscsi_target_release(ct);
+		ctl_free_opts(&opts);
 		return;
 	}
 	port = &ct->ct_port;

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 14:03:31 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0850B5F1;
 Mon,  7 Jul 2014 14:03:31 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EA10528E9;
 Mon,  7 Jul 2014 14:03:30 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s67E3UHo000588;
 Mon, 7 Jul 2014 14:03:30 GMT (envelope-from mjg@svn.freebsd.org)
Received: (from mjg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s67E3Unc000587;
 Mon, 7 Jul 2014 14:03:30 GMT (envelope-from mjg@svn.freebsd.org)
Message-Id: <201407071403.s67E3Unc000587@svn.freebsd.org>
From: Mateusz Guzik 
Date: Mon, 7 Jul 2014 14:03:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268365 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 14:03:31 -0000

Author: mjg
Date: Mon Jul  7 14:03:30 2014
New Revision: 268365
URL: http://svnweb.freebsd.org/changeset/base/268365

Log:
  Don't call crdup nor uifind under vnode lock.
  
  A locked vnode can get into the way of satisyfing malloc with M_WATOK.
  
  This is a fixup to r268087.
  
  Suggested by:	kib
  MFC after:	1 week

Modified:
  head/sys/kern/kern_exec.c

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c	Mon Jul  7 11:52:22 2014	(r268364)
+++ head/sys/kern/kern_exec.c	Mon Jul  7 14:03:30 2014	(r268365)
@@ -718,11 +718,11 @@ interpret:
 		VOP_UNLOCK(imgp->vp, 0);
 		setugidsafety(td);
 		error = fdcheckstd(td);
-		vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
 		if (error != 0)
 			goto done1;
 		newcred = crdup(oldcred);
 		euip = uifind(attr.va_uid);
+		vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
 		PROC_LOCK(p);
 		/*
 		 * Set the new credentials.
@@ -766,7 +766,9 @@ interpret:
 		if (oldcred->cr_svuid != oldcred->cr_uid ||
 		    oldcred->cr_svgid != oldcred->cr_gid) {
 			PROC_UNLOCK(p);
+			VOP_UNLOCK(imgp->vp, 0);
 			newcred = crdup(oldcred);
+			vn_lock(imgp->vp, LK_SHARED | LK_RETRY);
 			PROC_LOCK(p);
 			change_svuid(newcred, newcred->cr_uid);
 			change_svgid(newcred, newcred->cr_gid);
@@ -843,6 +845,7 @@ interpret:
 
 	SDT_PROBE(proc, kernel, , exec__success, args->fname, 0, 0, 0, 0);
 
+	VOP_UNLOCK(imgp->vp, 0);
 done1:
 	/*
 	 * Free any resources malloc'd earlier that we didn't use.
@@ -851,7 +854,6 @@ done1:
 		uifree(euip);
 	if (newcred != NULL)
 		crfree(oldcred);
-	VOP_UNLOCK(imgp->vp, 0);
 
 	/*
 	 * Handle deferred decrement of ref counts.

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 14:10:36 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 12B4795A;
 Mon,  7 Jul 2014 14:10:36 +0000 (UTC)
Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com
 [IPv6:2a00:1450:400c:c00::234])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 2DAC42965;
 Mon,  7 Jul 2014 14:10:35 +0000 (UTC)
Received: by mail-wg0-f52.google.com with SMTP id b13so4393188wgh.11
 for ; Mon, 07 Jul 2014 07:10:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=QRMQ8DkeyoKegBz5sI2BrhHWQAhRL81at9HacbbtcQM=;
 b=WPf9EWyMEKigiV07zcUSeOQ0M571c3uWzFtYiP4U0vgOkWRuHDJbiAH8XS7T2YbDvs
 Enke6jdHmVTv+t7PpjJorlFf62SkNIY7tmjZtE439femcTe4QMc8FOhTshcvEW9bqAKi
 7JWqPVsYP08o18a4xGdWP1qfHyFASZdmujW+l4AjYAtbhw9Q4xY9VRTa7jbJtrkoern5
 i2t65DKF592+gn7yw3JMFVntySaDJWjKRgpdeqYk6fbRpxqQXA4NQGmyBlfsTo/K+c8H
 9+SBrAqS1dpYBMSZ44OQdFEnYBzYFpBQq/+rqGXUkSDErm4PP91s0jIJRKm9K4YaLgXy
 hLQQ==
X-Received: by 10.180.96.97 with SMTP id dr1mr77211413wib.19.1404742233190;
 Mon, 07 Jul 2014 07:10:33 -0700 (PDT)
Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net.
 [2001:470:1f08:1f7::2])
 by mx.google.com with ESMTPSA id r9sm115561929wia.17.2014.07.07.07.10.31
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Mon, 07 Jul 2014 07:10:32 -0700 (PDT)
Date: Mon, 7 Jul 2014 16:10:24 +0200
From: Mateusz Guzik 
To: Konstantin Belousov 
Subject: Re: svn commit: r268087 - head/sys/kern
Message-ID: <20140707141024.GA5265@dft-labs.eu>
References: <201407010921.s619LXHL063077@svn.freebsd.org>
 <20140701114245.GO93733@kib.kiev.ua>
 <20140701115612.GA26696@dft-labs.eu>
 <20140701123058.GP93733@kib.kiev.ua>
 <20140701125410.GB26696@dft-labs.eu>
 <20140701180903.GT93733@kib.kiev.ua>
 <20140706211850.GA17706@dft-labs.eu>
 <20140706213900.GB17706@dft-labs.eu>
 <20140707062357.GF93733@kib.kiev.ua>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20140707062357.GF93733@kib.kiev.ua>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Mateusz Guzik 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 14:10:36 -0000

On Mon, Jul 07, 2014 at 09:23:57AM +0300, Konstantin Belousov wrote:
> On Sun, Jul 06, 2014 at 11:39:00PM +0200, Mateusz Guzik wrote:
> > > That said, I would prefer to just commit previously proposed fixup.
> > > 
> Ok.
> 

Committed as r268365.

> > 
> > hm, I only now notice that fexecve case does:
> > vn_lock(binvp, LK_EXCLUSIVE | LK_RETRY)
> > 
> > I guess this can be safely changed to LK_SHARED.
> 
> No, it cannot.  The VV_TEXT flag must be handled under the exclusive lock.


Allright, not touching this one.

Thanks,
-- 
Mateusz Guzik 

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 16:43:43 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 699A3B85;
 Mon,  7 Jul 2014 16:43:43 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 54B1D2850;
 Mon,  7 Jul 2014 16:43:43 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s67GhhGH081105;
 Mon, 7 Jul 2014 16:43:43 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s67GhhA6081104;
 Mon, 7 Jul 2014 16:43:43 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201407071643.s67GhhA6081104@svn.freebsd.org>
From: Dimitry Andric 
Date: Mon, 7 Jul 2014 16:43:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268368 - head/share/man/man5
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 16:43:43 -0000

Author: dim
Date: Mon Jul  7 16:43:42 2014
New Revision: 268368
URL: http://svnweb.freebsd.org/changeset/base/268368

Log:
  Regenerate src.conf.5, which was completely busted by r268351.

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==============================================================================
--- head/share/man/man5/src.conf.5	Mon Jul  7 15:31:46 2014	(r268367)
+++ head/share/man/man5/src.conf.5	Mon Jul  7 16:43:42 2014	(r268368)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
-.\" from FreeBSD: stable/10/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des
+.\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des
 .\" $FreeBSD$
-.Dd July 4, 2014
+.Dd July 7, 2014
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -78,49 +78,1071 @@ The following list provides a name and s
 that can be used for source builds.
 .Bl -tag -width indent
 .It Va WITHOUT_ACCT
-.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ACCT 223201 2011-06-17 20:47:44Z ed
+.\" from FreeBSD: head/tools/build/options/WITHOUT_ACCT 223201 2011-06-17 20:47:44Z ed
 Set to not build process accounting tools such as
 .Xr accton 8
 and
 .Xr sa 8 .
 .It Va WITHOUT_ACPI
-.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ACPI 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: head/tools/build/options/WITHOUT_ACPI 156932 2006-03-21 07:50:50Z ru
 Set to not build
 .Xr acpiconf 8 ,
 .Xr acpidump 8
 and related programs.
 .It Va WITHOUT_AMD
-.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_AMD 183242 2008-09-21 22:02:26Z sam
+.\" from FreeBSD: head/tools/build/options/WITHOUT_AMD 183242 2008-09-21 22:02:26Z sam
 Set to not build
 .Xr amd 8 ,
 and related programs.
 .It Va WITHOUT_APM
-.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_APM 183242 2008-09-21 22:02:26Z sam
+.\" from FreeBSD: head/tools/build/options/WITHOUT_APM 183242 2008-09-21 22:02:26Z sam
 Set to not build
 .Xr apm 8 ,
 .Xr apmd 8
 and related programs.
 .It Va WITHOUT_ARM_EABI
-.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ARM_EABI 253396 2013-07-16 19:15:19Z andrew
+.\" from FreeBSD: head/tools/build/options/WITHOUT_ARM_EABI 253396 2013-07-16 19:15:19Z andrew
 Set the ARM ABI to OABI.
 .It Va WITHOUT_ASSERT_DEBUG
-.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ASSERT_DEBUG 162215 2006-09-11 13:55:27Z ru
+.\" from FreeBSD: head/tools/build/options/WITHOUT_ASSERT_DEBUG 162215 2006-09-11 13:55:27Z ru
 Set to compile programs and libraries without the
 .Xr assert 3
 checks.
 .It Va WITHOUT_AT
-.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_AT 183242 2008-09-21 22:02:26Z sam
+.\" from FreeBSD: head/tools/build/options/WITHOUT_AT 183242 2008-09-21 22:02:26Z sam
 Set to not build
 .Xr at 1
 and related utilities.
 .It Va WITHOUT_ATM
-.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ATM 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: head/tools/build/options/WITHOUT_ATM 156932 2006-03-21 07:50:50Z ru
 Set to not build
 programs and libraries related to ATM networking.
 .It Va WITHOUT_AUDIT
-.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_AUDIT 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: head/tools/build/options/WITHOUT_AUDIT 156932 2006-03-21 07:50:50Z ru
 Set to not build audit support into system programs.
 .It Va WITHOUT_AUTHPF
-.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_AUTHPF 156932 2006-03-21 07:50:50Z ru
+.\" from FreeBSD: head/tools/build/options/WITHOUT_AUTHPF 156932 2006-03-21 07:50:50Z ru
 Set to not build
 .Xr authpf 8 .
+.It Va WITHOUT_BINUTILS
+.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 266158 2014-05-15 16:51:45Z brooks
+Set to not build or install binutils (as, c++-filt, gconv,
+ld, nm, objcopy, objdump, readelf, size and strip) as part
+of the normal system build.
+The resulting system cannot build programs from source.
+.It Va WITHOUT_BINUTILS_BOOTSTRAP
+.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp
+Set to not build binutils (as, c++-filt, gconv,
+ld, nm, objcopy, objdump, readelf, size and strip)
+as part of the bootstrap process.
+.Bf -symbolic
+The option does not work for build targets unless some alternative
+toolchain is provided.
+.Ef
+.It Va WITHOUT_BLUETOOTH
+.\" from FreeBSD: head/tools/build/options/WITHOUT_BLUETOOTH 156932 2006-03-21 07:50:50Z ru
+Set to not build Bluetooth related kernel modules, programs and libraries.
+.It Va WITHOUT_BOOT
+.\" from FreeBSD: head/tools/build/options/WITHOUT_BOOT 156932 2006-03-21 07:50:50Z ru
+Set to not build the boot blocks and loader.
+.It Va WITHOUT_BSD_CPIO
+.\" from FreeBSD: head/tools/build/options/WITHOUT_BSD_CPIO 179813 2008-06-16 05:48:15Z dougb
+Set to not build the BSD licensed version of cpio based on
+.Xr libarchive 3 .
+.It Va WITH_BSD_GREP
+.\" from FreeBSD: head/tools/build/options/WITH_BSD_GREP 222273 2011-05-25 01:04:12Z obrien
+Install BSD-licensed grep as '[ef]grep' instead of GNU grep.
+.It Va WITHOUT_BSNMP
+.\" from FreeBSD: head/tools/build/options/WITHOUT_BSNMP 183306 2008-09-23 16:15:42Z sam
+Set to not build or install
+.Xr bsnmpd 1
+and related libraries and data files.
+.It Va WITHOUT_BZIP2
+.\" from FreeBSD: head/tools/build/options/WITHOUT_BZIP2 174550 2007-12-12 16:43:17Z ru
+Set to not build contributed bzip2 software as a part of the base system.
+.Bf -symbolic
+The option has no effect yet.
+.Ef
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_BZIP2_SUPPORT
+.El
+.It Va WITHOUT_BZIP2_SUPPORT
+.\" from FreeBSD: head/tools/build/options/WITHOUT_BZIP2_SUPPORT 166255 2007-01-26 10:19:08Z delphij
+Set to build some programs without optional bzip2 support.
+.It Va WITHOUT_CALENDAR
+.\" from FreeBSD: head/tools/build/options/WITHOUT_CALENDAR 156932 2006-03-21 07:50:50Z ru
+Set to not build
+.Xr calendar 1 .
+.It Va WITHOUT_CAPSICUM
+.\" from FreeBSD: head/tools/build/options/WITHOUT_CAPSICUM 229319 2012-01-02 21:57:58Z rwatson
+Set to not build Capsicum support into system programs.
+.It Va WITHOUT_CASPER
+.\" from FreeBSD: head/tools/build/options/WITHOUT_CASPER 258838 2013-12-02 08:21:28Z pjd
+Set to not build Casper program and related libraries.
+.It Va WITHOUT_CDDL
+.\" from FreeBSD: head/tools/build/options/WITHOUT_CDDL 163861 2006-11-01 09:02:11Z jb
+Set to not build code licensed under Sun's CDDL.
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_CTF
+.It
+.Va WITHOUT_ZFS
+.El
+.It Va WITHOUT_CLANG
+.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG 264660 2014-04-18 17:03:58Z imp
+Set to not build the Clang C/C++ compiler during the regular phase of the build.
+.Pp
+It is a default setting on
+arm/armeb, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64.
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_CLANG_EXTRAS
+.It
+.Va WITHOUT_CLANG_FULL
+.El
+.It Va WITH_CLANG
+.\" from FreeBSD: head/tools/build/options/WITH_CLANG 264660 2014-04-18 17:03:58Z imp
+Set to build the Clang C/C++ compiler during the normal phase of the build.
+.Pp
+It is a default setting on
+amd64/amd64, arm/arm, arm/armv6, arm/armv6hf, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64.
+.It Va WITHOUT_CLANG_BOOTSTRAP
+.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp
+Set to not build the Clang C/C++ compiler during the bootstrap phase of the build.
+You must enable wither gcc or clang bootstrap to be able to build the system,
+unless an alternative compiiler is provided via
+XCC.
+.Pp
+It is a default setting on
+arm/armeb, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64.
+.It Va WITH_CLANG_BOOTSTRAP
+.\" from FreeBSD: head/tools/build/options/WITH_CLANG_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp
+Set to build the Clang C/C++ compiler during the bootstrap phase of the build.
+.Pp
+It is a default setting on
+amd64/amd64, arm/arm, arm/armv6, arm/armv6hf, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64.
+.It Va WITH_CLANG_EXTRAS
+.\" from FreeBSD: head/tools/build/options/WITH_CLANG_EXTRAS 231057 2012-02-05 23:56:22Z dim
+Set to build additional clang and llvm tools, such as bugpoint.
+.It Va WITHOUT_CLANG_FULL
+.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_FULL 246259 2013-02-02 22:28:29Z dim
+Set to avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of
+the Clang C/C++ compiler.
+.Pp
+It is a default setting on
+arm/arm, arm/armeb, arm/armv6, arm/armv6hf, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32 and sparc64/sparc64.
+.It Va WITH_CLANG_FULL
+.\" from FreeBSD: head/tools/build/options/WITH_CLANG_FULL 246259 2013-02-02 22:28:29Z dim
+Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the
+Clang C/C++ compiler.
+.Pp
+It is a default setting on
+amd64/amd64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64.
+.It Va WITHOUT_CLANG_IS_CC
+.\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_IS_CC 242629 2012-11-05 21:53:23Z brooks
+Set to install the GCC compiler as
+.Pa /usr/bin/cc ,
+.Pa /usr/bin/c++
+and
+.Pa /usr/bin/cpp .
+.Pp
+It is a default setting on
+arm/armeb, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
+.It Va WITH_CLANG_IS_CC
+.\" from FreeBSD: head/tools/build/options/WITH_CLANG_IS_CC 235342 2012-05-12 16:12:36Z gjb
+Set to install the Clang C/C++ compiler as
+.Pa /usr/bin/cc ,
+.Pa /usr/bin/c++
+and
+.Pa /usr/bin/cpp .
+.Pp
+It is a default setting on
+amd64/amd64, arm/arm, arm/armv6, arm/armv6hf, i386/i386 and pc98/i386.
+.It Va WITHOUT_CPP
+.\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru
+Set to not build
+.Xr cpp 1 .
+.It Va WITHOUT_CROSS_COMPILER
+.\" from FreeBSD: head/tools/build/options/WITHOUT_CROSS_COMPILER 264660 2014-04-18 17:03:58Z imp
+Set to not build any cross compiler in the cross-tools stage of buildworld.
+If you are compiling a different version of
+.Fx 
+than what is installed on the system, you will need to provide an alternate
+compiler with XCC to ensure success.
+If you are compiling with an identical version of
+.Fx 
+to the host, this option may be safely used.
+This option may also be safe when the host version of
+.Fx 
+is close to the sources being built, but all bets are off if there have
+been any changes to the toolchain between the versions.
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_BINUTILS_BOOTSTRAP
+.It
+.Va WITHOUT_CLANG_BOOTSTRAP
+.It
+.Va WITHOUT_GCC_BOOTSTRAP
+.El
+.It Va WITHOUT_CRYPT
+.\" from FreeBSD: head/tools/build/options/WITHOUT_CRYPT 156932 2006-03-21 07:50:50Z ru
+Set to not build any crypto code.
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_KERBEROS
+.It
+.Va WITHOUT_KERBEROS_SUPPORT
+.It
+.Va WITHOUT_OPENSSH
+.It
+.Va WITHOUT_OPENSSL
+.El
+.Pp
+When set, the following options are also in effect:
+.Pp
+.Bl -inset -compact
+.It Va WITHOUT_GSSAPI
+(unless
+.Va WITH_GSSAPI
+is set explicitly)
+.El
+.It Va WITH_CTF
+.\" from FreeBSD: head/tools/build/options/WITH_CTF 228159 2011-11-30 18:22:44Z fjoe
+Set to compile with CTF (Compact C Type Format) data.
+CTF data encapsulates a reduced form of debugging information
+similar to DWARF and the venerable stabs and is required for DTrace.
+.It Va WITHOUT_CTM
+.\" from FreeBSD: head/tools/build/options/WITHOUT_CTM 183242 2008-09-21 22:02:26Z sam
+Set to not build
+.Xr ctm 1
+and related utilities.
+.It Va WITHOUT_CXX
+.\" from FreeBSD: head/tools/build/options/WITHOUT_CXX 220402 2011-04-06 20:19:07Z uqs
+Set to not build
+.Xr g++ 1
+and related libraries.
+It will also prevent building of
+.Xr gperf 1
+and
+.Xr devd 8 .
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_CLANG
+.It
+.Va WITHOUT_CLANG_EXTRAS
+.It
+.Va WITHOUT_CLANG_FULL
+.It
+.Va WITHOUT_GROFF
+.El
+.It Va WITH_DEBUG_FILES
+.\" from FreeBSD: head/tools/build/options/WITH_DEBUG_FILES 251512 2013-06-07 21:40:02Z emaste
+Set to strip debug info into a separate file for each executable binary
+and shared library.
+The debug files will be placed in a subdirectory of
+.Pa /usr/lib/debug
+and are located automatically by
+.Xr gdb 1 .
+.It Va WITHOUT_DICT
+.\" from FreeBSD: head/tools/build/options/WITHOUT_DICT 156932 2006-03-21 07:50:50Z ru
+Set to not build the Webster dictionary files.
+.It Va WITHOUT_DMAGENT
+.\" from FreeBSD: head/tools/build/options/WITHOUT_DMAGENT 262335 2014-02-22 13:05:23Z bapt
+Set to not build dma Mail Transport Agent
+.It Va WITHOUT_DOCCOMPRESS
+.\" from FreeBSD: head/tools/build/options/WITHOUT_DOCCOMPRESS 266752 2014-05-27 15:52:27Z gjb
+Set to not to install compressed system documentation.
+Only the uncompressed version will be installed.
+.It Va WITHOUT_DYNAMICROOT
+.\" from FreeBSD: head/tools/build/options/WITHOUT_DYNAMICROOT 156932 2006-03-21 07:50:50Z ru
+Set this if you do not want to link
+.Pa /bin
+and
+.Pa /sbin
+dynamically.
+.It Va WITHOUT_ED_CRYPTO
+.\" from FreeBSD: head/tools/build/options/WITHOUT_ED_CRYPTO 235660 2012-05-19 20:05:27Z marcel
+Set to build
+.Xr ed 1
+without support for encryption/decryption.
+.It Va WITH_EISA
+.\" from FreeBSD: head/tools/build/options/WITH_EISA 264654 2014-04-18 16:53:06Z imp
+Set to build EISA kernel modules.
+.It Va WITHOUT_EXAMPLES
+.\" from FreeBSD: head/tools/build/options/WITHOUT_EXAMPLES 156938 2006-03-21 09:06:24Z ru
+Set to avoid installing examples to
+.Pa /usr/share/examples/ .
+.It Va WITHOUT_FDT
+.\" from FreeBSD: head/tools/build/options/WITHOUT_FDT 221539 2011-05-06 19:10:27Z ru
+Set to not build Flattened Device Tree support as part of the base system.
+This includes the device tree compiler (dtc) and libfdt support library.
+.It Va WITHOUT_FLOPPY
+.\" from FreeBSD: head/tools/build/options/WITHOUT_FLOPPY 221540 2011-05-06 19:13:03Z ru
+Set to not build or install programs
+for operating floppy disk driver.
+.It Va WITH_FMAKE
+.\" from FreeBSD: head/tools/build/options/WITH_FMAKE 266752 2014-05-27 15:52:27Z gjb
+Causes the old FreeBSD 
+.Xr make 1
+program to be built and installed as fmake.
+.It Va WITHOUT_FMTREE
+.\" from FreeBSD: head/tools/build/options/WITHOUT_FMTREE 261299 2014-01-30 21:37:43Z brooks
+Set to not build and install
+.Pa /usr/sbin/fmtree .
+.It Va WITHOUT_FORTH
+.\" from FreeBSD: head/tools/build/options/WITHOUT_FORTH 156932 2006-03-21 07:50:50Z ru
+Set to build bootloaders without Forth support.
+.It Va WITHOUT_FP_LIBC
+.\" from FreeBSD: head/tools/build/options/WITHOUT_FP_LIBC 156932 2006-03-21 07:50:50Z ru
+Set to build
+.Nm libc
+without floating-point support.
+.It Va WITHOUT_FREEBSD_UPDATE
+.\" from FreeBSD: head/tools/build/options/WITHOUT_FREEBSD_UPDATE 183242 2008-09-21 22:02:26Z sam
+Set to not build
+.Xr freebsd-update 8 .
+.It Va WITHOUT_GAMES
+.\" from FreeBSD: head/tools/build/options/WITHOUT_GAMES 156932 2006-03-21 07:50:50Z ru
+Set to not build games.
+.It Va WITHOUT_GCC
+.\" from FreeBSD: head/tools/build/options/WITHOUT_GCC 264660 2014-04-18 17:03:58Z imp
+Set to not build and install gcc and g++ as part of the normal build process.
+.Pp
+It is a default setting on
+amd64/amd64, arm/arm, arm/armv6, arm/armv6hf and i386/i386.
+.It Va WITH_GCC
+.\" from FreeBSD: head/tools/build/options/WITH_GCC 255326 2013-09-06 20:49:48Z zeising
+Set to build and install gcc and g++.
+.Pp
+It is a default setting on
+arm/armeb, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
+.It Va WITHOUT_GCC_BOOTSTRAP
+.\" from FreeBSD: head/tools/build/options/WITHOUT_GCC_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp
+Set to not build gcc and g++ as part of the bootstrap process.
+You must enable wither gcc or clang bootstrap to be able to build the system,
+unless an alternative compiiler is provided via
+XCC.
+.Pp
+It is a default setting on
+amd64/amd64, arm/arm, arm/armv6, arm/armv6hf and i386/i386.
+.It Va WITH_GCC_BOOTSTRAP
+.\" from FreeBSD: head/tools/build/options/WITH_GCC_BOOTSTRAP 264660 2014-04-18 17:03:58Z imp
+Set to build gcc and g++ as part of the bootstrap process.
+.Pp
+It is a default setting on
+arm/armeb, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
+.It Va WITHOUT_GCOV
+.\" from FreeBSD: head/tools/build/options/WITHOUT_GCOV 156932 2006-03-21 07:50:50Z ru
+Set to not build the
+.Xr gcov 1
+tool.
+.It Va WITHOUT_GDB
+.\" from FreeBSD: head/tools/build/options/WITHOUT_GDB 156932 2006-03-21 07:50:50Z ru
+Set to not build
+.Xr gdb 1 .
+.It Va WITHOUT_GNU
+.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU 174550 2007-12-12 16:43:17Z ru
+Set to not build contributed GNU software as a part of the base system.
+This option can be useful if the system built must not contain any code
+covered by the GNU Public License due to legal reasons.
+.Bf -symbolic
+The option has no effect yet.
+.Ef
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_GNU_SUPPORT
+.El
+.It Va WITHOUT_GNUCXX
+.\" from FreeBSD: head/tools/build/options/WITHOUT_GNUCXX 255321 2013-09-06 20:08:03Z theraven
+Do not build the GNU C++ stack (g++, libstdc++).
+This is the default on platforms where clang is the system compiler.
+.Pp
+It is a default setting on
+amd64/amd64, arm/arm, arm/armv6, arm/armv6hf, i386/i386 and pc98/i386.
+.It Va WITH_GNUCXX
+.\" from FreeBSD: head/tools/build/options/WITH_GNUCXX 255321 2013-09-06 20:08:03Z theraven
+Build the GNU C++ stack (g++, libstdc++).
+This is the default on platforms where gcc is the system compiler.
+.Pp
+It is a default setting on
+arm/armeb, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64.
+.It Va WITHOUT_GNU_GREP_COMPAT
+.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_GREP_COMPAT 266752 2014-05-27 15:52:27Z gjb
+Set this option to omit the gnu extentions to grep from being included in 
+BSD grep.
+.It Va WITHOUT_GNU_SUPPORT
+.\" from FreeBSD: head/tools/build/options/WITHOUT_GNU_SUPPORT 156932 2006-03-21 07:50:50Z ru
+Set to build some programs without optional GNU support.
+.It Va WITHOUT_GPIB
+.\" from FreeBSD: head/tools/build/options/WITHOUT_GPIB 156932 2006-03-21 07:50:50Z ru
+Set to not build GPIB bus support.
+.It Va WITHOUT_GPIO
+.\" from FreeBSD: head/tools/build/options/WITHOUT_GPIO 228081 2011-11-28 17:54:34Z dim
+Set to not build
+.Xr gpioctl 8
+as part of the base system.
+.It Va WITHOUT_GPL_DTC
+.\" from FreeBSD: head/tools/build/options/WITHOUT_GPL_DTC 264515 2014-04-15 20:41:55Z imp
+Set to build the BSD licensed version of the device tree compiler, instead of the
+GPL'd one from elinux.org.
+.It Va WITHOUT_GROFF
+.\" from FreeBSD: head/tools/build/options/WITHOUT_GROFF 218941 2011-02-22 08:13:49Z uqs
+Set to not build
+.Xr groff 1
+and
+.Xr vgrind 1 .
+You should consider installing the textproc/groff port to not break
+.Xr man 1 .
+.It Va WITHOUT_GSSAPI
+.\" from FreeBSD: head/tools/build/options/WITHOUT_GSSAPI 174548 2007-12-12 16:39:32Z ru
+Set to not build libgssapi.
+.It Va WITH_HESIOD
+.\" from FreeBSD: head/tools/build/options/WITH_HESIOD 156932 2006-03-21 07:50:50Z ru
+Set to build Hesiod support.
+.It Va WITHOUT_HTML
+.\" from FreeBSD: head/tools/build/options/WITHOUT_HTML 156932 2006-03-21 07:50:50Z ru
+Set to not build HTML docs.
+.It Va WITHOUT_ICONV
+.\" from FreeBSD: head/tools/build/options/WITHOUT_ICONV 254919 2013-08-26 17:15:56Z antoine
+Set to not build iconv as part of libc.
+.It Va WITHOUT_INET
+.\" from FreeBSD: head/tools/build/options/WITHOUT_INET 221266 2011-04-30 17:58:28Z bz
+Set to not build programs and libraries related to IPv4 networking.
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_INET_SUPPORT
+.El
+.It Va WITHOUT_INET6
+.\" from FreeBSD: head/tools/build/options/WITHOUT_INET6 156932 2006-03-21 07:50:50Z ru
+Set to not build
+programs and libraries related to IPv6 networking.
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_INET6_SUPPORT
+.El
+.It Va WITHOUT_INET6_SUPPORT
+.\" from FreeBSD: head/tools/build/options/WITHOUT_INET6_SUPPORT 156932 2006-03-21 07:50:50Z ru
+Set to build libraries, programs, and kernel modules without IPv6 support.
+.It Va WITHOUT_INET_SUPPORT
+.\" from FreeBSD: head/tools/build/options/WITHOUT_INET_SUPPORT 221266 2011-04-30 17:58:28Z bz
+Set to build libraries, programs, and kernel modules without IPv4 support.
+.It Va WITHOUT_INFO
+.\" from FreeBSD: head/tools/build/options/WITHOUT_INFO 156932 2006-03-21 07:50:50Z ru
+Set to not make or install
+.Xr info 5
+files.
+.It Va WITHOUT_INSTALLLIB
+.\" from FreeBSD: head/tools/build/options/WITHOUT_INSTALLLIB 174497 2007-12-09 21:56:21Z dougb
+Set this if you do not want to install optional libraries.
+For example when creating a
+.Xr nanobsd 8
+image.
+.It Va WITH_INSTALL_AS_USER
+.\" from FreeBSD: head/tools/build/options/WITH_INSTALL_AS_USER 238021 2012-07-02 20:24:01Z marcel
+Set to make install targets succeed for non-root users by installing
+files with owner and group attributes set to that of the user running
+the
+.Xr make 1
+command.
+The user still has to set the
+.Va DESTDIR
+variable to point to a directory where the user has write permissions.
+.It Va WITHOUT_IPFILTER
+.\" from FreeBSD: head/tools/build/options/WITHOUT_IPFILTER 156932 2006-03-21 07:50:50Z ru
+Set to not build IP Filter package.
+.It Va WITHOUT_IPFW
+.\" from FreeBSD: head/tools/build/options/WITHOUT_IPFW 183242 2008-09-21 22:02:26Z sam
+Set to not build IPFW tools.
+.It Va WITHOUT_JAIL
+.\" from FreeBSD: head/tools/build/options/WITHOUT_JAIL 249966 2013-04-27 04:09:09Z eadler
+Set to not build tools for the support of jails; e.g.,
+.Xr jail 8 .
+.It Va WITHOUT_KDUMP
+.\" from FreeBSD: head/tools/build/options/WITHOUT_KDUMP 240690 2012-09-19 11:38:37Z zeising
+Set to not build
+.Xr kdump 1
+and
+.Xr truss 1 .
+.It Va WITHOUT_KERBEROS
+.\" from FreeBSD: head/tools/build/options/WITHOUT_KERBEROS 174549 2007-12-12 16:42:03Z ru
+Set this if you do not want to build Kerberos 5 (KTH Heimdal).
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_KERBEROS_SUPPORT
+.El
+.Pp
+When set, the following options are also in effect:
+.Pp
+.Bl -inset -compact
+.It Va WITHOUT_GSSAPI
+(unless
+.Va WITH_GSSAPI
+is set explicitly)
+.El
+.It Va WITHOUT_KERBEROS_SUPPORT
+.\" from FreeBSD: head/tools/build/options/WITHOUT_KERBEROS_SUPPORT 251794 2013-06-15 20:29:07Z eadler
+Set to build some programs without Kerberos support, like
+.Xr ssh 1 ,
+.Xr telnet 1 ,
+.Xr sshd 8 ,
+and
+.Xr telnetd 8 .
+.It Va WITHOUT_KVM
+.\" from FreeBSD: head/tools/build/options/WITHOUT_KVM 174550 2007-12-12 16:43:17Z ru
+Set to not build the
+.Nm libkvm
+library as a part of the base system.
+.Bf -symbolic
+The option has no effect yet.
+.Ef
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_KVM_SUPPORT
+.El
+.It Va WITHOUT_KVM_SUPPORT
+.\" from FreeBSD: head/tools/build/options/WITHOUT_KVM_SUPPORT 170644 2007-06-13 02:08:04Z sepotvin
+Set to build some programs without optional
+.Nm libkvm
+support.
+.It Va WITHOUT_LDNS
+.\" from FreeBSD: head/tools/build/options/WITHOUT_LDNS 255591 2013-09-15 13:11:13Z des
+Setting this variable will prevent the LDNS library from being built.
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_LDNS_UTILS
+.It
+.Va WITHOUT_UNBOUND
+.El
+.It Va WITHOUT_LDNS_UTILS
+.\" from FreeBSD: head/tools/build/options/WITHOUT_LDNS_UTILS 255850 2013-09-24 14:33:31Z des
+Setting this variable will prevent building the LDNS utilities
+.Xr drill 1
+and
+.Xr host 1 .
+.It Va WITHOUT_LEGACY_CONSOLE
+.\" from FreeBSD: head/tools/build/options/WITHOUT_LEGACY_CONSOLE 249966 2013-04-27 04:09:09Z eadler
+Set to not build programs that support a legacy PC console; e.g.,
+.Xr kbdcontrol 8
+and
+.Xr vidcontrol 8 .
+.It Va WITHOUT_LIB32
+.\" from FreeBSD: head/tools/build/options/WITHOUT_LIB32 156932 2006-03-21 07:50:50Z ru
+On amd64, set to not build 32-bit library set and a
+.Nm ld-elf32.so.1
+runtime linker.
+.It Va WITHOUT_LIBCPLUSPLUS
+.\" from FreeBSD: head/tools/build/options/WITHOUT_LIBCPLUSPLUS 246262 2013-02-02 22:42:46Z dim
+Set to avoid building libcxxrt and libc++.
+.It Va WITHOUT_LIBPTHREAD
+.\" from FreeBSD: head/tools/build/options/WITHOUT_LIBPTHREAD 188848 2009-02-20 11:09:55Z mtm
+Set to not build the
+.Nm libpthread
+providing library,
+.Nm libthr .
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_LIBTHR
+.El
+.It Va WITHOUT_LIBTHR
+.\" from FreeBSD: head/tools/build/options/WITHOUT_LIBTHR 156932 2006-03-21 07:50:50Z ru
+Set to not build the
+.Nm libthr
+(1:1 threading)
+library.
+.It Va WITH_LLDB
+.\" from FreeBSD: head/tools/build/options/WITH_LLDB 255722 2013-09-20 01:52:02Z emaste
+Set to build the LLDB debugger.
+.It Va WITHOUT_LOCALES
+.\" from FreeBSD: head/tools/build/options/WITHOUT_LOCALES 156932 2006-03-21 07:50:50Z ru
+Set to not build localization files; see
+.Xr locale 1 .
+.It Va WITHOUT_LOCATE
+.\" from FreeBSD: head/tools/build/options/WITHOUT_LOCATE 183242 2008-09-21 22:02:26Z sam
+Set to not build
+.Xr locate 1
+and related programs.
+.It Va WITHOUT_LPR
+.\" from FreeBSD: head/tools/build/options/WITHOUT_LPR 156932 2006-03-21 07:50:50Z ru
+Set to not build
+.Xr lpr 1
+and related programs.
+.It Va WITHOUT_LS_COLORS
+.\" from FreeBSD: head/tools/build/options/WITHOUT_LS_COLORS 235660 2012-05-19 20:05:27Z marcel
+Set to build
+.Xr ls 1
+without support for colors to distinguish file types.
+.It Va WITHOUT_LZMA_SUPPORT
+.\" from FreeBSD: head/tools/build/options/WITHOUT_LZMA_SUPPORT 245171 2013-01-08 18:37:12Z obrien
+Set to build some programs without optional lzma compression support.
+.It Va WITHOUT_MAIL
+.\" from FreeBSD: head/tools/build/options/WITHOUT_MAIL 183242 2008-09-21 22:02:26Z sam
+Set to not build any mail support (MUA or MTA).
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_DMAGENT
+.It
+.Va WITHOUT_MAILWRAPPER
+.It
+.Va WITHOUT_SENDMAIL
+.El
+.It Va WITHOUT_MAILWRAPPER
+.\" from FreeBSD: head/tools/build/options/WITHOUT_MAILWRAPPER 156932 2006-03-21 07:50:50Z ru
+Set to not build the
+.Xr mailwrapper 8
+MTA selector.
+.It Va WITHOUT_MAKE
+.\" from FreeBSD: head/tools/build/options/WITHOUT_MAKE 183242 2008-09-21 22:02:26Z sam
+Set to not install
+.Xr make 1
+and related support files.
+.It Va WITHOUT_MAN
+.\" from FreeBSD: head/tools/build/options/WITHOUT_MAN 156932 2006-03-21 07:50:50Z ru
+Set to not build manual pages.
+When set, the following options are also in effect:
+.Pp
+.Bl -inset -compact
+.It Va WITHOUT_MAN_UTILS
+(unless
+.Va WITH_MAN_UTILS
+is set explicitly)
+.El
+.It Va WITHOUT_MANCOMPRESS
+.\" from FreeBSD: head/tools/build/options/WITHOUT_MANCOMPRESS 266752 2014-05-27 15:52:27Z gjb
+Set to not to install compressed man pages.
+Only the uncompressed versions will be installed.
+.It Va WITHOUT_MAN_UTILS
+.\" from FreeBSD: head/tools/build/options/WITHOUT_MAN_UTILS 208322 2010-05-20 00:07:21Z jkim
+Set to not build utilities for manual pages,
+.Xr apropos 1 ,
+.Xr catman 1 ,
+.Xr makewhatis 1 ,
+.Xr man 1 ,
+.Xr whatis 1 ,
+.Xr manctl 8 ,
+and related support files.
+.It Va WITH_NAND
+.\" from FreeBSD: head/tools/build/options/WITH_NAND 235537 2012-05-17 10:11:18Z gber
+Set to build the NAND Flash components.
+.It Va WITHOUT_NDIS
+.\" from FreeBSD: head/tools/build/options/WITHOUT_NDIS 183242 2008-09-21 22:02:26Z sam
+Set to not build programs and libraries
+related to NDIS emulation support.
+.It Va WITHOUT_NETCAT
+.\" from FreeBSD: head/tools/build/options/WITHOUT_NETCAT 156932 2006-03-21 07:50:50Z ru
+Set to not build
+.Xr nc 1
+utility.
+.It Va WITHOUT_NETGRAPH
+.\" from FreeBSD: head/tools/build/options/WITHOUT_NETGRAPH 183242 2008-09-21 22:02:26Z sam
+Set to not build applications to support
+.Xr netgraph 4 .
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_ATM
+.It
+.Va WITHOUT_BLUETOOTH
+.It
+.Va WITHOUT_NETGRAPH_SUPPORT
+.El
+.It Va WITHOUT_NETGRAPH_SUPPORT
+.\" from FreeBSD: head/tools/build/options/WITHOUT_NETGRAPH_SUPPORT 183305 2008-09-23 16:11:15Z sam
+Set to build libraries, programs, and kernel modules without netgraph support.
+.It Va WITHOUT_NIS
+.\" from FreeBSD: head/tools/build/options/WITHOUT_NIS 156932 2006-03-21 07:50:50Z ru
+Set to not build
+.Xr NIS 8
+support and related programs.
+If set, you might need to adopt your
+.Xr nsswitch.conf 5
+and remove
+.Sq nis
+entries.
+.It Va WITHOUT_NLS
+.\" from FreeBSD: head/tools/build/options/WITHOUT_NLS 156932 2006-03-21 07:50:50Z ru
+Set to not build NLS catalogs.
+.It Va WITHOUT_NLS_CATALOGS
+.\" from FreeBSD: head/tools/build/options/WITHOUT_NLS_CATALOGS 156932 2006-03-21 07:50:50Z ru
+Set to not build NLS catalog support for
+.Xr csh 1 .
+.It Va WITHOUT_NS_CACHING
+.\" from FreeBSD: head/tools/build/options/WITHOUT_NS_CACHING 172803 2007-10-19 14:01:25Z ru
+Set to disable name caching in the
+.Pa nsswitch
+subsystem.
+The generic caching daemon,
+.Xr nscd 8 ,
+will not be built either if this option is set.
+.It Va WITHOUT_NTP
+.\" from FreeBSD: head/tools/build/options/WITHOUT_NTP 183242 2008-09-21 22:02:26Z sam
+Set to not build
+.Xr ntpd 8
+and related programs.
+.It Va WITH_OFED
+.\" from FreeBSD: head/tools/build/options/WITH_OFED 228081 2011-11-28 17:54:34Z dim
+Set to build the
+.Dq "OpenFabrics Enterprise Distribution"
+Infiniband software stack.
+.It Va WITH_OPENLDAP
+.\" from FreeBSD: head/tools/build/options/WITH_OPENLDAP 264902 2014-04-24 23:17:31Z imp
+Enable building openldap support for kerberos.
+.It Va WITHOUT_OPENSSH
+.\" from FreeBSD: head/tools/build/options/WITHOUT_OPENSSH 156932 2006-03-21 07:50:50Z ru
+Set to not build OpenSSH.
+.It Va WITH_OPENSSH_NONE_CIPHER
+.\" from FreeBSD: head/tools/build/options/WITH_OPENSSH_NONE_CIPHER 245527 2013-01-17 01:51:04Z bz
+Set to include the "None" cipher support in OpenSSH and its libraries.
+Additional adjustments may need to be done to system configuration
+files, such as
+.Xr sshd_config 5 ,
+to enable this cipher.
+Please see
+.Pa /usr/src/crypto/openssh/README.hpn
+for full details.
+.It Va WITHOUT_OPENSSL
+.\" from FreeBSD: head/tools/build/options/WITHOUT_OPENSSL 156932 2006-03-21 07:50:50Z ru
+Set to not build OpenSSL.
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_KERBEROS
+.It
+.Va WITHOUT_KERBEROS_SUPPORT
+.It
+.Va WITHOUT_OPENSSH
+.El
+.Pp
+When set, the following options are also in effect:
+.Pp
+.Bl -inset -compact
+.It Va WITHOUT_GSSAPI
+(unless
+.Va WITH_GSSAPI
+is set explicitly)
+.El
+.It Va WITHOUT_PAM
+.\" from FreeBSD: head/tools/build/options/WITHOUT_PAM 174550 2007-12-12 16:43:17Z ru
+Set to not build PAM library and modules.
+.Bf -symbolic
+This option is deprecated and does nothing.
+.Ef
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_PAM_SUPPORT
+.El
+.It Va WITHOUT_PAM_SUPPORT
+.\" from FreeBSD: head/tools/build/options/WITHOUT_PAM_SUPPORT 156932 2006-03-21 07:50:50Z ru
+Set to build some programs without PAM support, particularly
+.Xr ftpd 8
+and
+.Xr ppp 8 .
+.It Va WITHOUT_PC_SYSINSTALL
+.\" from FreeBSD: head/tools/build/options/WITHOUT_PC_SYSINSTALL 245606 2013-01-18 15:57:09Z eadler
+Set to not build
+.Xr pc-sysinstall 8
+and related programs.
+.It Va WITHOUT_PF
+.\" from FreeBSD: head/tools/build/options/WITHOUT_PF 156932 2006-03-21 07:50:50Z ru
+Set to not build PF firewall package.
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_AUTHPF
+.El
+.It Va WITH_PIE
+.\" from FreeBSD: head/tools/build/options/WITH_PIE 267233 2014-06-08 17:29:31Z bdrewery
+Enable building of Position-Independent Executables (PIEs).
+.It Va WITHOUT_PKGBOOTSTRAP
+.\" from FreeBSD: head/tools/build/options/WITHOUT_PKGBOOTSTRAP 258924 2013-12-04 15:58:42Z bdrewery
+Set to not build
+.Xr pkg 7
+bootstrap tool.
+.It Va WITHOUT_PMC
+.\" from FreeBSD: head/tools/build/options/WITHOUT_PMC 183242 2008-09-21 22:02:26Z sam
+Set to not build
+.Xr pmccontrol 8
+and related programs.
+.It Va WITHOUT_PORTSNAP
+.\" from FreeBSD: head/tools/build/options/WITHOUT_PORTSNAP 183242 2008-09-21 22:02:26Z sam
+Set to not build or install
+.Xr portsnap 8
+and related files.
+.It Va WITHOUT_PPP
+.\" from FreeBSD: head/tools/build/options/WITHOUT_PPP 183242 2008-09-21 22:02:26Z sam
+Set to not build
+.Xr ppp 8
+and related programs.
+.It Va WITHOUT_PROFILE
+.\" from FreeBSD: head/tools/build/options/WITHOUT_PROFILE 228196 2011-12-02 09:09:54Z fjoe
+Set to avoid compiling profiled libraries.
+.It Va WITHOUT_QUOTAS
+.\" from FreeBSD: head/tools/build/options/WITHOUT_QUOTAS 183242 2008-09-21 22:02:26Z sam
+Set to not build
+.Xr quota 8
+and related programs.
+.It Va WITHOUT_RCMDS
+.\" from FreeBSD: head/tools/build/options/WITHOUT_RCMDS 156932 2006-03-21 07:50:50Z ru
+Disable building of the
+.Bx
+r-commands.
+This includes
+.Xr rlogin 1 ,
+.Xr rsh 1 ,
+etc.
+.It Va WITHOUT_RCS
+.\" from FreeBSD: head/tools/build/options/WITHOUT_RCS 256198 2013-10-09 17:07:20Z gjb
+Set to not build
+.Xr rcs 1
+and related utilities.
+.It Va WITHOUT_RESCUE
+.\" from FreeBSD: head/tools/build/options/WITHOUT_RESCUE 156932 2006-03-21 07:50:50Z ru
+Set to not build
+.Xr rescue 8 .
+.It Va WITHOUT_ROUTED
+.\" from FreeBSD: head/tools/build/options/WITHOUT_ROUTED 183242 2008-09-21 22:02:26Z sam
+Set to not build
+.Xr routed 8
+utility.
+.It Va WITHOUT_SENDMAIL
+.\" from FreeBSD: head/tools/build/options/WITHOUT_SENDMAIL 156932 2006-03-21 07:50:50Z ru
+Set to not build
+.Xr sendmail 8
+and related programs.
+.It Va WITHOUT_SETUID_LOGIN
+.\" from FreeBSD: head/tools/build/options/WITHOUT_SETUID_LOGIN 156932 2006-03-21 07:50:50Z ru
+Set this to disable the installation of
+.Xr login 1
+as a set-user-ID root program.
+.It Va WITHOUT_SHAREDOCS
+.\" from FreeBSD: head/tools/build/options/WITHOUT_SHAREDOCS 156932 2006-03-21 07:50:50Z ru
+Set to not build the
+.Bx 4.4
+legacy docs.
+.It Va WITH_SHARED_TOOLCHAIN
+.\" from FreeBSD: head/tools/build/options/WITH_SHARED_TOOLCHAIN 235342 2012-05-12 16:12:36Z gjb
+Set to build the toolchain binaries shared.
+The set includes
+.Xr cc 1 ,
+.Xr make 1
+and necessary utilities like assembler, linker and library archive manager.
+.It Va WITH_SORT_THREADS
+.\" from FreeBSD: head/tools/build/options/WITH_SORT_THREADS 264158 2014-04-05 18:00:45Z imp
+Set to enable threads in
+.Xr sort 1 .
+.It Va WITHOUT_SOURCELESS
+.\" from FreeBSD: head/tools/build/options/WITHOUT_SOURCELESS 230972 2012-02-04 00:54:43Z rmh
+Set to not build kernel modules that include sourceless code (either microcode or native code for host CPU).
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_SOURCELESS_HOST
+.It
+.Va WITHOUT_SOURCELESS_UCODE
+.El
+.It Va WITHOUT_SOURCELESS_HOST
+.\" from FreeBSD: head/tools/build/options/WITHOUT_SOURCELESS_HOST 230972 2012-02-04 00:54:43Z rmh
+Set to not build kernel modules that include sourceless native code for host CPU.
+.It Va WITHOUT_SOURCELESS_UCODE
+.\" from FreeBSD: head/tools/build/options/WITHOUT_SOURCELESS_UCODE 230972 2012-02-04 00:54:43Z rmh
+Set to not build kernel modules that include sourceless microcode.
+.It Va WITHOUT_SSP
+.\" from FreeBSD: head/tools/build/options/WITHOUT_SSP 180012 2008-06-25 21:33:28Z ru
+Set to not build world with propolice stack smashing protection.
+.It Va WITH_SVN
+.\" from FreeBSD: head/tools/build/options/WITH_SVN 252561 2013-07-03 12:36:47Z zeising
+Set to install
+.Xr svnlite 1
+as
+.Xr svn 1 .
+.It Va WITHOUT_SVNLITE
+.\" from FreeBSD: head/tools/build/options/WITHOUT_SVNLITE 252561 2013-07-03 12:36:47Z zeising
+Set to not build
+.Xr svnlite 1
+and related programs.
+.It Va WITHOUT_SYMVER
+.\" from FreeBSD: head/tools/build/options/WITHOUT_SYMVER 169649 2007-05-17 05:03:24Z deischen
+Set to disable symbol versioning when building shared libraries.
+.It Va WITHOUT_SYSCALL_COMPAT
+.\" from FreeBSD: head/tools/build/options/WITHOUT_SYSCALL_COMPAT 265826 2014-05-10 16:37:28Z imp
+Do not include some compatible syscall wrappers in libc.
+.It Va WITHOUT_SYSCONS
+.\" from FreeBSD: head/tools/build/options/WITHOUT_SYSCONS 156932 2006-03-21 07:50:50Z ru
+Set to not build
+.Xr syscons 4
+support files such as keyboard maps, fonts, and screen output maps.
+.It Va WITHOUT_SYSINSTALL
+.\" from FreeBSD: head/tools/build/options/WITHOUT_SYSINSTALL 183242 2008-09-21 22:02:26Z sam
+Set to not build
+.Xr sysinstall 8
+and related programs.
+.It Va WITHOUT_TCSH
+.\" from FreeBSD: head/tools/build/options/WITHOUT_TCSH 156932 2006-03-21 07:50:50Z ru
+Set to not build and install
+.Pa /bin/csh
+(which is
+.Xr tcsh 1 ) .
+.It Va WITHOUT_TELNET
+.\" from FreeBSD: head/tools/build/options/WITHOUT_TELNET 183242 2008-09-21 22:02:26Z sam
+Set to not build
+.Xr telnet 8
+and related programs.
+.It Va WITH_TESTS
+.\" from FreeBSD: head/tools/build/options/WITH_TESTS 267432 2014-06-13 00:05:06Z gjb
+Set to install the
+.Fx
+Test Suite in
+.Pa /usr/tests/ .
+See
+.Xr tests 7
+for more details.
+.It Va WITHOUT_TEXTPROC
+.\" from FreeBSD: head/tools/build/options/WITHOUT_TEXTPROC 183242 2008-09-21 22:02:26Z sam
+Set to not build
+programs used for text processing.
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_GROFF
+.El
+.It Va WITHOUT_TOOLCHAIN
+.\" from FreeBSD: head/tools/build/options/WITHOUT_TOOLCHAIN 174550 2007-12-12 16:43:17Z ru
+Set to not install
+programs used for program development,
+compilers, debuggers etc.
+.Bf -symbolic
+The option does not work for build targets.
+.Ef
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 16:55:08 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4A6E1FB5;
 Mon,  7 Jul 2014 16:55:08 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 381942962;
 Mon,  7 Jul 2014 16:55:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s67Gt814086031;
 Mon, 7 Jul 2014 16:55:08 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s67Gt8cw086030;
 Mon, 7 Jul 2014 16:55:08 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201407071655.s67Gt8cw086030@svn.freebsd.org>
From: Warner Losh 
Date: Mon, 7 Jul 2014 16:55:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268369 - head/share/man/man9
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 16:55:08 -0000

Author: imp
Date: Mon Jul  7 16:55:07 2014
New Revision: 268369
URL: http://svnweb.freebsd.org/changeset/base/268369

Log:
  Document C_HARDCLOCK flag.

Modified:
  head/share/man/man9/timeout.9

Modified: head/share/man/man9/timeout.9
==============================================================================
--- head/share/man/man9/timeout.9	Mon Jul  7 16:43:42 2014	(r268368)
+++ head/share/man/man9/timeout.9	Mon Jul  7 16:55:07 2014	(r268369)
@@ -372,6 +372,11 @@ divided by acceptable time deviation: 1 
 Smaller value allows to aggregate more events in one timer interrupt to
 reduce processing overhead and power consumption.
 .El
+.It Dv C_HARDCLOCK
+Align the timeouts, if possible, to 
+.Fn hardclock  
+calls.
+.El
 .Pp
 The functions
 .Fn callout_reset_curcpu

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 17:34:49 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4C9DAF98;
 Mon,  7 Jul 2014 17:34:49 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 202112D55;
 Mon,  7 Jul 2014 17:34:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s67HYmRh004711;
 Mon, 7 Jul 2014 17:34:48 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s67HYmBW004710;
 Mon, 7 Jul 2014 17:34:48 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407071734.s67HYmBW004710@svn.freebsd.org>
From: Alexander Motin 
Date: Mon, 7 Jul 2014 17:34:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268370 - head/sys/dev/iscsi
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 17:34:49 -0000

Author: mav
Date: Mon Jul  7 17:34:48 2014
New Revision: 268370
URL: http://svnweb.freebsd.org/changeset/base/268370

Log:
  Make XPT_GET_TRAN_SETTINGS to report CAM that command queueing is enabled,
  but make couple changes to handle non-queued commands too, if happen.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/iscsi/iscsi.c

Modified: head/sys/dev/iscsi/iscsi.c
==============================================================================
--- head/sys/dev/iscsi/iscsi.c	Mon Jul  7 16:55:07 2014	(r268369)
+++ head/sys/dev/iscsi/iscsi.c	Mon Jul  7 17:34:48 2014	(r268370)
@@ -1341,7 +1341,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_
 
 		is->is_sim = cam_sim_alloc(iscsi_action, iscsi_poll, "iscsi",
 		    is, is->is_id /* unit */, &is->is_lock,
-		    maxtags, maxtags, is->is_devq);
+		    1, maxtags, is->is_devq);
 		if (is->is_sim == NULL) {
 			ISCSI_SESSION_UNLOCK(is);
 			ISCSI_SESSION_WARN(is, "failed to allocate SIM");
@@ -1960,23 +1960,24 @@ iscsi_action_scsiio(struct iscsi_session
 		break;
 	}
 
-        switch (csio->tag_action) {
-        case MSG_HEAD_OF_Q_TAG:
-		bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_HOQ;
-		break;
-                break;
-        case MSG_ORDERED_Q_TAG:
-		bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_ORDERED;
-                break;
-        case MSG_ACA_TASK:
-		bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_ACA;
-                break;
-        case CAM_TAG_ACTION_NONE:
-        case MSG_SIMPLE_Q_TAG:
-        default:
-		bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_SIMPLE;
-                break;
-        }
+	if ((ccb->ccb_h.flags & CAM_TAG_ACTION_VALID) != 0) {
+		switch (csio->tag_action) {
+		case MSG_HEAD_OF_Q_TAG:
+			bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_HOQ;
+			break;
+		case MSG_ORDERED_Q_TAG:
+			bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_ORDERED;
+			break;
+		case MSG_ACA_TASK:
+			bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_ACA;
+			break;
+		case MSG_SIMPLE_Q_TAG:
+		default:
+			bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_SIMPLE;
+			break;
+		}
+	} else
+		bhssc->bhssc_flags |= BHSSC_FLAGS_ATTR_UNTAGGED;
 
 	bhssc->bhssc_lun = htobe64(CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun));
 	bhssc->bhssc_initiator_task_tag = is->is_initiator_task_tag;
@@ -2069,6 +2070,23 @@ iscsi_action(struct cam_sim *sim, union 
 		cpi->ccb_h.status = CAM_REQ_CMP;
 		break;
 	}
+	case XPT_GET_TRAN_SETTINGS:
+	{
+		struct ccb_trans_settings	*cts;
+		struct ccb_trans_settings_scsi	*scsi;
+
+		cts = &ccb->cts;
+		scsi = &cts->proto_specific.scsi;
+
+		cts->protocol = PROTO_SCSI;
+		cts->protocol_version = SCSI_REV_SPC3;
+		cts->transport = XPORT_ISCSI;
+		cts->transport_version = 0;
+		scsi->valid = CTS_SCSI_VALID_TQ;
+		scsi->flags = CTS_SCSI_FLAGS_TAG_ENB;
+		cts->ccb_h.status = CAM_REQ_CMP;
+		break;
+	}
 	case XPT_CALC_GEOMETRY:
 		cam_calc_geometry(&ccb->ccg, /*extended*/1);
 		ccb->ccb_h.status = CAM_REQ_CMP;

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 22:02:40 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 85BC4C37;
 Mon,  7 Jul 2014 22:02:40 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3C61F260E;
 Mon,  7 Jul 2014 22:02:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s67M2el0032974;
 Mon, 7 Jul 2014 22:02:40 GMT (envelope-from truckman@svn.freebsd.org)
Received: (from truckman@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s67M2eLm032973;
 Mon, 7 Jul 2014 22:02:40 GMT (envelope-from truckman@svn.freebsd.org)
Message-Id: <201407072202.s67M2eLm032973@svn.freebsd.org>
From: Don Lewis 
Date: Mon, 7 Jul 2014 22:02:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268373 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 22:02:40 -0000

Author: truckman
Date: Mon Jul  7 22:02:39 2014
New Revision: 268373
URL: http://svnweb.freebsd.org/changeset/base/268373

Log:
  Declaration whitespace changes for style(9).
  
  MFC after:	1 week

Modified:
  head/sys/kern/subr_rman.c

Modified: head/sys/kern/subr_rman.c
==============================================================================
--- head/sys/kern/subr_rman.c	Mon Jul  7 21:27:47 2014	(r268372)
+++ head/sys/kern/subr_rman.c	Mon Jul  7 22:02:39 2014	(r268373)
@@ -94,12 +94,12 @@ struct resource_i {
 	u_long	r_end;		/* index of the last entry (inclusive) */
 	u_int	r_flags;
 	void	*r_virtual;	/* virtual address of this resource */
-	struct	device *r_dev;	/* device which has allocated this resource */
-	struct	rman *r_rm;	/* resource manager from whence this came */
+	struct device *r_dev;	/* device which has allocated this resource */
+	struct rman *r_rm;	/* resource manager from whence this came */
 	int	r_rid;		/* optional rid for this resource. */
 };
 
-static int     rman_debug = 0;
+static int rman_debug = 0;
 SYSCTL_INT(_debug, OID_AUTO, rman_debug, CTLFLAG_RWTUN,
     &rman_debug, 0, "rman debug");
 
@@ -107,12 +107,12 @@ SYSCTL_INT(_debug, OID_AUTO, rman_debug,
 
 static MALLOC_DEFINE(M_RMAN, "rman", "Resource manager");
 
-struct	rman_head rman_head;
-static	struct mtx rman_mtx; /* mutex to protect rman_head */
-static	int int_rman_activate_resource(struct rman *rm, struct resource_i *r,
+struct rman_head rman_head;
+static struct mtx rman_mtx; /* mutex to protect rman_head */
+static int int_rman_activate_resource(struct rman *rm, struct resource_i *r,
 				       struct resource_i **whohas);
-static	int int_rman_deactivate_resource(struct resource_i *r);
-static	int int_rman_release_resource(struct rman *rm, struct resource_i *r);
+static int int_rman_deactivate_resource(struct resource_i *r);
+static int int_rman_release_resource(struct rman *rm, struct resource_i *r);
 
 static __inline struct resource_i *
 int_alloc_resource(int malloc_flag)
@@ -316,8 +316,8 @@ rman_last_free_region(struct rman *rm, u
 int
 rman_adjust_resource(struct resource *rr, u_long start, u_long end)
 {
-	struct	resource_i *r, *s, *t, *new;
-	struct	rman *rm;
+	struct resource_i *r, *s, *t, *new;
+	struct rman *rm;
 
 	/* Not supported for shared resources. */
 	r = rr->__r_i;
@@ -438,12 +438,12 @@ rman_adjust_resource(struct resource *rr
 
 struct resource *
 rman_reserve_resource_bound(struct rman *rm, u_long start, u_long end,
-		      u_long count, u_long bound,  u_int flags,
-		      struct device *dev)
+			    u_long count, u_long bound, u_int flags,
+			    struct device *dev)
 {
-	u_int	new_rflags;
-	struct	resource_i *r, *s, *rv;
-	u_long	rstart, rend, amask, bmask;
+	u_int new_rflags;
+	struct resource_i *r, *s, *rv;
+	u_long rstart, rend, amask, bmask;
 
 	rv = NULL;
 
@@ -720,9 +720,9 @@ rman_activate_resource(struct resource *
 int
 rman_await_resource(struct resource *re, int pri, int timo)
 {
-	int	rv;
-	struct	resource_i *r, *whohas;
-	struct	rman *rm;
+	int rv;
+	struct resource_i *r, *whohas;
+	struct rman *rm;
 
 	r = re->__r_i;
 	rm = r->r_rm;
@@ -758,7 +758,7 @@ int_rman_deactivate_resource(struct reso
 int
 rman_deactivate_resource(struct resource *r)
 {
-	struct	rman *rm;
+	struct rman *rm;
 
 	rm = r->__r_i->r_rm;
 	mtx_lock(rm->rm_mtx);
@@ -770,7 +770,7 @@ rman_deactivate_resource(struct resource
 static int
 int_rman_release_resource(struct rman *rm, struct resource_i *r)
 {
-	struct	resource_i *s, *t;
+	struct resource_i *s, *t;
 
 	if (r->r_flags & RF_ACTIVE)
 		int_rman_deactivate_resource(r);
@@ -864,9 +864,9 @@ out:
 int
 rman_release_resource(struct resource *re)
 {
-	int	rv;
-	struct	resource_i *r;
-	struct	rman *rm;
+	int rv;
+	struct resource_i *r;
+	struct rman *rm;
 
 	r = re->__r_i;
 	rm = r->r_rm;
@@ -879,7 +879,7 @@ rman_release_resource(struct resource *r
 uint32_t
 rman_make_alignment_flags(uint32_t size)
 {
-	int	i;
+	int i;
 
 	/*
 	 * Find the hightest bit set, and add one if more than one bit
@@ -897,96 +897,112 @@ rman_make_alignment_flags(uint32_t size)
 void
 rman_set_start(struct resource *r, u_long start)
 {
+
 	r->__r_i->r_start = start;
 }
 
 u_long
 rman_get_start(struct resource *r)
 {
+
 	return (r->__r_i->r_start);
 }
 
 void
 rman_set_end(struct resource *r, u_long end)
 {
+
 	r->__r_i->r_end = end;
 }
 
 u_long
 rman_get_end(struct resource *r)
 {
+
 	return (r->__r_i->r_end);
 }
 
 u_long
 rman_get_size(struct resource *r)
 {
+
 	return (r->__r_i->r_end - r->__r_i->r_start + 1);
 }
 
 u_int
 rman_get_flags(struct resource *r)
 {
+
 	return (r->__r_i->r_flags);
 }
 
 void
 rman_set_virtual(struct resource *r, void *v)
 {
+
 	r->__r_i->r_virtual = v;
 }
 
 void *
 rman_get_virtual(struct resource *r)
 {
+
 	return (r->__r_i->r_virtual);
 }
 
 void
 rman_set_bustag(struct resource *r, bus_space_tag_t t)
 {
+
 	r->r_bustag = t;
 }
 
 bus_space_tag_t
 rman_get_bustag(struct resource *r)
 {
+
 	return (r->r_bustag);
 }
 
 void
 rman_set_bushandle(struct resource *r, bus_space_handle_t h)
 {
+
 	r->r_bushandle = h;
 }
 
 bus_space_handle_t
 rman_get_bushandle(struct resource *r)
 {
+
 	return (r->r_bushandle);
 }
 
 void
 rman_set_rid(struct resource *r, int rid)
 {
+
 	r->__r_i->r_rid = rid;
 }
 
 int
 rman_get_rid(struct resource *r)
 {
+
 	return (r->__r_i->r_rid);
 }
 
 void
 rman_set_device(struct resource *r, struct device *dev)
 {
+
 	r->__r_i->r_dev = dev;
 }
 
 struct device *
 rman_get_device(struct resource *r)
 {
+
 	return (r->__r_i->r_dev);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 23:21:08 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 91CE5EAE;
 Mon,  7 Jul 2014 23:21:08 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7EB4E2C5B;
 Mon,  7 Jul 2014 23:21:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s67NL86M070575;
 Mon, 7 Jul 2014 23:21:08 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s67NL8HX070573;
 Mon, 7 Jul 2014 23:21:08 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201407072321.s67NL8HX070573@svn.freebsd.org>
From: Warner Losh 
Date: Mon, 7 Jul 2014 23:21:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268374 - in head/sys: fs/nandfs sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 23:21:08 -0000

Author: imp
Date: Mon Jul  7 23:21:07 2014
New Revision: 268374
URL: http://svnweb.freebsd.org/changeset/base/268374

Log:
  Naughty NANDFS was using hidden unused flag, hiding the fact that the
  flag was used and wasn't really available. Change the name without
  fixing any laying issues that might be present in NANDFS' use of this
  flag.

Modified:
  head/sys/fs/nandfs/nandfs.h
  head/sys/sys/buf.h

Modified: head/sys/fs/nandfs/nandfs.h
==============================================================================
--- head/sys/fs/nandfs/nandfs.h	Mon Jul  7 22:02:39 2014	(r268373)
+++ head/sys/fs/nandfs/nandfs.h	Mon Jul  7 23:21:07 2014	(r268374)
@@ -303,8 +303,8 @@ struct nandfs_node {
 #define	PRINT_NODE_FLAGS \
 	"\10\1IN_ACCESS\2IN_CHANGE\3IN_UPDATE\4IN_MODIFIED\5IN_RENAME"
 
-#define	NANDFS_GATHER(x) ((x)->b_flags |= B_00800000)
-#define	NANDFS_UNGATHER(x) ((x)->b_flags &= ~B_00800000)
-#define	NANDFS_ISGATHERED(x) ((x)->b_flags & B_00800000)
+#define	NANDFS_GATHER(x) ((x)->b_flags |= B_FS_FLAG1)
+#define	NANDFS_UNGATHER(x) ((x)->b_flags &= ~B_FS_FLAG1)
+#define	NANDFS_ISGATHERED(x) ((x)->b_flags & B_FS_FLAG1)
 
 #endif /* !_FS_NANDFS_NANDFS_H_ */

Modified: head/sys/sys/buf.h
==============================================================================
--- head/sys/sys/buf.h	Mon Jul  7 22:02:39 2014	(r268373)
+++ head/sys/sys/buf.h	Mon Jul  7 23:21:07 2014	(r268374)
@@ -213,7 +213,7 @@ struct buf {
 #define	B_00100000	0x00100000	/* Available flag. */
 #define	B_DIRTY		0x00200000	/* Needs writing later (in EXT2FS). */
 #define	B_RELBUF	0x00400000	/* Release VMIO buffer. */
-#define	B_00800000	0x00800000	/* Available flag. */
+#define	B_FS_FLAG1	0x00800000	/* Available flag for FS use. */
 #define	B_NOCOPY	0x01000000	/* Don't copy-on-write this buf. */
 #define	B_INFREECNT	0x02000000	/* buf is counted in numfreebufs */
 #define	B_PAGING	0x04000000	/* volatile paging I/O -- bypass VMIO */

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 23:21:16 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7FD36FE8;
 Mon,  7 Jul 2014 23:21:16 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 6CA402C5D;
 Mon,  7 Jul 2014 23:21:16 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s67NLGOl070651;
 Mon, 7 Jul 2014 23:21:16 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s67NLGLE070650;
 Mon, 7 Jul 2014 23:21:16 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201407072321.s67NLGLE070650@svn.freebsd.org>
From: Warner Losh 
Date: Mon, 7 Jul 2014 23:21:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268375 - head/sys/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 23:21:16 -0000

Author: imp
Date: Mon Jul  7 23:21:15 2014
New Revision: 268375
URL: http://svnweb.freebsd.org/changeset/base/268375

Log:
  Fix typo in flag name.

Modified:
  head/sys/sys/buf.h

Modified: head/sys/sys/buf.h
==============================================================================
--- head/sys/sys/buf.h	Mon Jul  7 23:21:07 2014	(r268374)
+++ head/sys/sys/buf.h	Mon Jul  7 23:21:15 2014	(r268375)
@@ -210,7 +210,7 @@ struct buf {
 #define	B_CLUSTEROK	0x00020000	/* Pagein op, so swap() can count it. */
 #define	B_000400000	0x00040000	/* Available flag. */
 #define	B_000800000	0x00080000	/* Available flag. */
-#define	B_00100000	0x00100000	/* Available flag. */
+#define	B_001000000	0x00100000	/* Available flag. */
 #define	B_DIRTY		0x00200000	/* Needs writing later (in EXT2FS). */
 #define	B_RELBUF	0x00400000	/* Release VMIO buffer. */
 #define	B_FS_FLAG1	0x00800000	/* Available flag for FS use. */

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 23:21:21 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 405391BB;
 Mon,  7 Jul 2014 23:21:21 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2DD962C63;
 Mon,  7 Jul 2014 23:21:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s67NLLCr070714;
 Mon, 7 Jul 2014 23:21:21 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s67NLL7p070713;
 Mon, 7 Jul 2014 23:21:21 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201407072321.s67NLL7p070713@svn.freebsd.org>
From: Warner Losh 
Date: Mon, 7 Jul 2014 23:21:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268376 - head/bin/rm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 23:21:21 -0000

Author: imp
Date: Mon Jul  7 23:21:20 2014
New Revision: 268376
URL: http://svnweb.freebsd.org/changeset/base/268376

Log:
  rm -rf can fail sometimes with an error from fts_read. Make it honor
  fflag to ignore fts_read errors, but stop deleting from that directory
  because no further progress can be made.
  
  When building a kernel with a high -j value on a high core count
  machine, during the cleanobj phase we can wind up doing multiple rm
  -rf at the same time for modules that have subdirectories. This
  exposed this race (sometimes) as fts_read can return an error if the
  directory is removed by another rm -rf. Since the intent of the -f
  flag was to ignore errors, even if this was a bug in fts_read, we
  should ignore the error like we've been instructed to do.

Modified:
  head/bin/rm/rm.c

Modified: head/bin/rm/rm.c
==============================================================================
--- head/bin/rm/rm.c	Mon Jul  7 23:21:15 2014	(r268375)
+++ head/bin/rm/rm.c	Mon Jul  7 23:21:20 2014	(r268376)
@@ -335,7 +335,7 @@ err:
 		warn("%s", p->fts_path);
 		eval = 1;
 	}
-	if (errno)
+	if (!fflag && errno)
 		err(1, "fts_read");
 	fts_close(fts);
 }

From owner-svn-src-head@FreeBSD.ORG  Mon Jul  7 23:21:25 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E5AA42F9;
 Mon,  7 Jul 2014 23:21:25 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D302A2C66;
 Mon,  7 Jul 2014 23:21:25 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s67NLPJT070777;
 Mon, 7 Jul 2014 23:21:25 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s67NLPBC070776;
 Mon, 7 Jul 2014 23:21:25 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201407072321.s67NLPBC070776@svn.freebsd.org>
From: Warner Losh 
Date: Mon, 7 Jul 2014 23:21:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268377 - head
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 07 Jul 2014 23:21:26 -0000

Author: imp
Date: Mon Jul  7 23:21:25 2014
New Revision: 268377
URL: http://svnweb.freebsd.org/changeset/base/268377

Log:
  xdev builds libsupc++ and libstdc++ in a slightly strange way. This
  cause a race to be exposed between the two. Compensate for this race
  by serializing the build/install of libstdc++ before libsupc++.

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Mon Jul  7 23:21:20 2014	(r268376)
+++ head/Makefile.inc1	Mon Jul  7 23:21:25 2014	(r268377)
@@ -1497,6 +1497,7 @@ _prebuild_libs=	${_kerberos5_lib_libasn1
 .if ${MK_GNUCXX} != "no" && ${MK_CXX} != "no"
 _prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++
 gnu/lib/libstdc++__L: lib/msun__L
+gnu/lib/libsubc++__L: gnu/lib/libstdc++__L
 .endif
 
 .if defined(WITH_ATF) || ${MK_TESTS} != "no"

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 02:11:48 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id AF85830A;
 Tue,  8 Jul 2014 02:11:48 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9D1FF2C81;
 Tue,  8 Jul 2014 02:11:48 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s682BmVL050265;
 Tue, 8 Jul 2014 02:11:48 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s682Bmmc050264;
 Tue, 8 Jul 2014 02:11:48 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201407080211.s682Bmmc050264@svn.freebsd.org>
From: Warner Losh 
Date: Tue, 8 Jul 2014 02:11:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268380 - head
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 02:11:48 -0000

Author: imp
Date: Tue Jul  8 02:11:48 2014
New Revision: 268380
URL: http://svnweb.freebsd.org/changeset/base/268380

Log:
  Typo means that this couldn't have possibly fixed anything, so revert
  r268377.

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Tue Jul  8 01:01:30 2014	(r268379)
+++ head/Makefile.inc1	Tue Jul  8 02:11:48 2014	(r268380)
@@ -1497,7 +1497,6 @@ _prebuild_libs=	${_kerberos5_lib_libasn1
 .if ${MK_GNUCXX} != "no" && ${MK_CXX} != "no"
 _prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++
 gnu/lib/libstdc++__L: lib/msun__L
-gnu/lib/libsubc++__L: gnu/lib/libstdc++__L
 .endif
 
 .if defined(WITH_ATF) || ${MK_TESTS} != "no"

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 02:43:05 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6B2E49FC;
 Tue,  8 Jul 2014 02:43:05 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 588F72EC5;
 Tue,  8 Jul 2014 02:43:05 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s682h5AV064212;
 Tue, 8 Jul 2014 02:43:05 GMT (envelope-from wblock@svn.freebsd.org)
Received: (from wblock@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s682h5E9064211;
 Tue, 8 Jul 2014 02:43:05 GMT (envelope-from wblock@svn.freebsd.org)
Message-Id: <201407080243.s682h5E9064211@svn.freebsd.org>
From: Warren Block 
Date: Tue, 8 Jul 2014 02:43:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268381 - head/usr.bin/showmount
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 02:43:05 -0000

Author: wblock (doc committer)
Date: Tue Jul  8 02:43:04 2014
New Revision: 268381
URL: http://svnweb.freebsd.org/changeset/base/268381

Log:
  Make synopsis version of -3 flag match other uses in the page.
  
  MFC after:	1 week

Modified:
  head/usr.bin/showmount/showmount.8

Modified: head/usr.bin/showmount/showmount.8
==============================================================================
--- head/usr.bin/showmount/showmount.8	Tue Jul  8 02:11:48 2014	(r268380)
+++ head/usr.bin/showmount/showmount.8	Tue Jul  8 02:43:04 2014	(r268381)
@@ -40,7 +40,8 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl a | d
-.Op Fl e3
+.Op Fl e
+.Op Fl 3
 .Op Ar host
 .Sh DESCRIPTION
 The

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 07:09:16 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8FBA9818;
 Tue,  8 Jul 2014 07:09:16 +0000 (UTC)
Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "vps1.elischer.org",
 Issuer "CA Cert Signing Authority" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 6457422E9;
 Tue,  8 Jul 2014 07:09:15 +0000 (UTC)
Received: from Julian-MBP3.local
 (ppp121-45-236-203.lns20.per1.internode.on.net [121.45.236.203])
 (authenticated bits=0)
 by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id s6879Bke049432
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO);
 Tue, 8 Jul 2014 00:09:13 -0700 (PDT)
 (envelope-from julian@freebsd.org)
Message-ID: <53BB9911.60804@freebsd.org>
Date: Tue, 08 Jul 2014 15:09:05 +0800
From: Julian Elischer 
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Warner Losh , svn-src-head@freebsd.org
Subject: Re: svn commit: r268376 - head/bin/rm
References: <201407072321.s67NLL7p070713@svn.freebsd.org>
In-Reply-To: <201407072321.s67NLL7p070713@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 07:09:16 -0000

On 7/8/14, 7:21 AM, Warner Losh wrote:
> Author: imp
> Date: Mon Jul  7 23:21:20 2014
> New Revision: 268376
> URL: http://svnweb.freebsd.org/changeset/base/268376
>
> Log:
>    rm -rf can fail sometimes with an error from fts_read. Make it honor
>    fflag to ignore fts_read errors, but stop deleting from that directory
>    because no further progress can be made.
>    
>    When building a kernel with a high -j value on a high core count
>    machine, during the cleanobj phase we can wind up doing multiple rm
>    -rf at the same time for modules that have subdirectories. This
>    exposed this race (sometimes) as fts_read can return an error if the
>    directory is removed by another rm -rf. Since the intent of the -f
>    flag was to ignore errors, even if this was a bug in fts_read, we
>    should ignore the error like we've been instructed to do.
One could make an argument that being unable to delete something 
because someone else deleted it first is a "non error".
Even without -f
>


From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 08:05:42 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id CF654373;
 Tue,  8 Jul 2014 08:05:42 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id BD4FE2726;
 Tue,  8 Jul 2014 08:05:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6885gbN015188;
 Tue, 8 Jul 2014 08:05:42 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6885gXi015186;
 Tue, 8 Jul 2014 08:05:42 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201407080805.s6885gXi015186@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 8 Jul 2014 08:05:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268383 - in head/sys: amd64/amd64 i386/i386
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 08:05:42 -0000

Author: kib
Date: Tue Jul  8 08:05:42 2014
New Revision: 268383
URL: http://svnweb.freebsd.org/changeset/base/268383

Log:
  Correct si_code for the SIGBUS signal generated by the alignment trap.
  
  Reported and tested by:	pho
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/amd64/amd64/trap.c
  head/sys/i386/i386/trap.c

Modified: head/sys/amd64/amd64/trap.c
==============================================================================
--- head/sys/amd64/amd64/trap.c	Tue Jul  8 04:51:42 2014	(r268382)
+++ head/sys/amd64/amd64/trap.c	Tue Jul  8 08:05:42 2014	(r268383)
@@ -313,6 +313,10 @@ trap(struct trapframe *frame)
 			i = SIGBUS;
 			ucode = BUS_OBJERR;
 			break;
+		case T_ALIGNFLT:
+			i = SIGBUS;
+			ucode = BUS_ADRALN;
+			break;
 		case T_DOUBLEFLT:	/* double fault */
 		default:
 			i = SIGBUS;

Modified: head/sys/i386/i386/trap.c
==============================================================================
--- head/sys/i386/i386/trap.c	Tue Jul  8 04:51:42 2014	(r268382)
+++ head/sys/i386/i386/trap.c	Tue Jul  8 08:05:42 2014	(r268383)
@@ -366,6 +366,10 @@ trap(struct trapframe *frame)
 			i = SIGBUS;
 			ucode = BUS_OBJERR;
 			break;
+		case T_ALIGNFLT:
+			i = SIGBUS;
+			ucode = BUS_ADRALN;
+			break;
 		case T_DOUBLEFLT:	/* double fault */
 		default:
 			i = SIGBUS;

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 08:10:16 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4FBCC52C;
 Tue,  8 Jul 2014 08:10:16 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3E3602766;
 Tue,  8 Jul 2014 08:10:16 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s688AGn7016433;
 Tue, 8 Jul 2014 08:10:16 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s688AGsJ016432;
 Tue, 8 Jul 2014 08:10:16 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201407080810.s688AGsJ016432@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 8 Jul 2014 08:10:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268384 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 08:10:16 -0000

Author: kib
Date: Tue Jul  8 08:10:15 2014
New Revision: 268384
URL: http://svnweb.freebsd.org/changeset/base/268384

Log:
  Correct the problem reported by test16 from
  tools/regression/file/flock/flock.c, which completes the fix in
  r192685.  When the lock was stolen from us, retry the whole lock
  sequence in kernel, instead of returning EINTR to usermode and hoping
  that application would handle it correctly by restarting the lock
  acquire.
  
  Tested by:	pho
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks

Modified:
  head/sys/kern/kern_lockf.c

Modified: head/sys/kern/kern_lockf.c
==============================================================================
--- head/sys/kern/kern_lockf.c	Tue Jul  8 08:05:42 2014	(r268383)
+++ head/sys/kern/kern_lockf.c	Tue Jul  8 08:10:15 2014	(r268384)
@@ -469,6 +469,9 @@ lf_advlockasync(struct vop_advlockasync_
 			return (EOVERFLOW);
 		end = start + oadd;
 	}
+
+retry_setlock:
+
 	/*
 	 * Avoid the common case of unlocking when inode has no locks.
 	 */
@@ -744,6 +747,11 @@ lf_advlockasync(struct vop_advlockasync_
 		sx_destroy(&freestate->ls_lock);
 		free(freestate, M_LOCKF);
 	}
+
+	if (error == EDOOFUS) {
+		KASSERT(ap->a_op == F_SETLK, ("EDOOFUS"));
+		goto retry_setlock;
+	}
 	return (error);
 }
 
@@ -1459,7 +1467,7 @@ lf_setlock(struct lockf *state, struct l
 		lock->lf_refs++;
 		error = sx_sleep(lock, &state->ls_lock, priority, lockstr, 0);
 		if (lf_free_lock(lock)) {
-			error = EINTR;
+			error = EDOOFUS;
 			goto out;
 		}
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 08:11:52 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id DA77D67E;
 Tue,  8 Jul 2014 08:11:52 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C826027E0;
 Tue,  8 Jul 2014 08:11:52 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s688BqEu019099;
 Tue, 8 Jul 2014 08:11:52 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s688Bq6Z019098;
 Tue, 8 Jul 2014 08:11:52 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201407080811.s688Bq6Z019098@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 8 Jul 2014 08:11:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268385 - head/tools/regression/file/flock
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 08:11:52 -0000

Author: kib
Date: Tue Jul  8 08:11:52 2014
New Revision: 268385
URL: http://svnweb.freebsd.org/changeset/base/268385

Log:
  Make this compilable on latest Linux'es without warnings.
  
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/tools/regression/file/flock/flock.c

Modified: head/tools/regression/file/flock/flock.c
==============================================================================
--- head/tools/regression/file/flock/flock.c	Tue Jul  8 08:10:15 2014	(r268384)
+++ head/tools/regression/file/flock/flock.c	Tue Jul  8 08:11:52 2014	(r268385)
@@ -27,6 +27,7 @@
  * $FreeBSD$
  */
 
+#include 
 #include 
 #ifdef __FreeBSD__
 #include 
@@ -39,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -51,9 +53,13 @@
 #include 
 #else
 #ifndef __unused
+#ifdef __GNUC__
+#define	__unused	__attribute__((__unused__))
+#else
 #define __unused
 #endif
 #endif
+#endif
 
 int verbose = 0;
 
@@ -1329,7 +1335,6 @@ test15(int fd, __unused int argc, const 
 	 */
 	int pid;
 	int pfd[2];
-	int fd2;
 	struct flock fl;
 	char ch;
 	int res;
@@ -1366,7 +1371,7 @@ test15(int fd, __unused int argc, const 
 	if (read(pfd[0], &ch, 1) != 1)
 		err(1, "reading from pipe (child)");
 
-	fd2 = dup(fd);
+	(void)dup(fd);
 	if (flock(fd, LOCK_SH) < 0)
 		err(1, "flock shared");
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 08:34:35 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7C357BB4;
 Tue,  8 Jul 2014 08:34:35 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5071E298F;
 Tue,  8 Jul 2014 08:34:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s688YZnu029133;
 Tue, 8 Jul 2014 08:34:35 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s688YZlx029132;
 Tue, 8 Jul 2014 08:34:35 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407080834.s688YZlx029132@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 8 Jul 2014 08:34:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268387 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 08:34:35 -0000

Author: mav
Date: Tue Jul  8 08:34:34 2014
New Revision: 268387
URL: http://svnweb.freebsd.org/changeset/base/268387

Log:
  Fix task management functions status: task not found is not an error,
  while not implemented function is.

Modified:
  head/sys/cam/ctl/ctl.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Tue Jul  8 08:18:44 2014	(r268386)
+++ head/sys/cam/ctl/ctl.c	Tue Jul  8 08:34:34 2014	(r268387)
@@ -11944,7 +11944,7 @@ ctl_abort_task(union ctl_io *io)
 		lun = ctl_softc->ctl_luns[targ_lun];
 	else {
 		mtx_unlock(&ctl_softc->ctl_lock);
-		goto bailout;
+		return (1);
 	}
 
 #if 0
@@ -12047,8 +12047,6 @@ ctl_abort_task(union ctl_io *io)
 	}
 	mtx_unlock(&lun->lun_lock);
 
-bailout:
-
 	if (found == 0) {
 		/*
 		 * This isn't really an error.  It's entirely possible for
@@ -12064,9 +12062,8 @@ bailout:
 		       io->io_hdr.nexus.targ_lun, io->taskio.tag_num,
 		       io->taskio.tag_type);
 #endif
-		return (1);
-	} else
-		return (0);
+	}
+	return (0);
 }
 
 /*
@@ -12076,15 +12073,12 @@ bailout:
 static void
 ctl_run_task(union ctl_io *io)
 {
-	struct ctl_softc *ctl_softc;
-	int retval;
+	struct ctl_softc *ctl_softc = control_softc;
+	int retval = 1;
 	const char *task_desc;
 
 	CTL_DEBUG_PRINT(("ctl_run_task\n"));
 
-	ctl_softc = control_softc;
-	retval = 0;
-
 	KASSERT(io->io_hdr.io_type == CTL_IO_TASK,
 	    ("ctl_run_task: Unextected io_type %d\n",
 	     io->io_hdr.io_type));
@@ -12133,7 +12127,6 @@ ctl_run_task(union ctl_io *io)
 	case CTL_TASK_LUN_RESET: {
 		struct ctl_lun *lun;
 		uint32_t targ_lun;
-		int retval;
 
 		targ_lun = io->io_hdr.nexus.targ_mapped_lun;
 		mtx_lock(&ctl_softc->ctl_lock);
@@ -12190,12 +12183,6 @@ ctl_run_task(union ctl_io *io)
 		io->io_hdr.status = CTL_SUCCESS;
 	else
 		io->io_hdr.status = CTL_ERROR;
-
-	/*
-	 * This will queue this I/O to the done queue, but the
-	 * work thread won't be able to process it until we
-	 * return and the lock is released.
-	 */
 	ctl_done(io);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 09:37:42 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 09D44C00;
 Tue,  8 Jul 2014 09:37:42 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EA9502E71;
 Tue,  8 Jul 2014 09:37:41 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s689bfJX058866;
 Tue, 8 Jul 2014 09:37:41 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s689bfSY058865;
 Tue, 8 Jul 2014 09:37:41 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407080937.s689bfSY058865@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 8 Jul 2014 09:37:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268388 - head/sys/dev/iscsi
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 09:37:42 -0000

Author: mav
Date: Tue Jul  8 09:37:41 2014
New Revision: 268388
URL: http://svnweb.freebsd.org/changeset/base/268388

Log:
  Add XPT_ABORT support to iSCSI initiator.
  
  While CAM does not use it normally, it is useful for targets testing.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/iscsi/iscsi.c

Modified: head/sys/dev/iscsi/iscsi.c
==============================================================================
--- head/sys/dev/iscsi/iscsi.c	Tue Jul  8 08:34:34 2014	(r268387)
+++ head/sys/dev/iscsi/iscsi.c	Tue Jul  8 09:37:41 2014	(r268388)
@@ -152,6 +152,7 @@ static void	iscsi_pdu_queue(struct icl_p
 static void	iscsi_pdu_update_statsn(const struct icl_pdu *response);
 static void	iscsi_pdu_handle_nop_in(struct icl_pdu *response);
 static void	iscsi_pdu_handle_scsi_response(struct icl_pdu *response);
+static void	iscsi_pdu_handle_task_response(struct icl_pdu *response);
 static void	iscsi_pdu_handle_data_in(struct icl_pdu *response);
 static void	iscsi_pdu_handle_logout_response(struct icl_pdu *response);
 static void	iscsi_pdu_handle_r2t(struct icl_pdu *response);
@@ -163,7 +164,7 @@ static void	iscsi_action(struct cam_sim 
 static void	iscsi_poll(struct cam_sim *sim);
 static struct iscsi_outstanding	*iscsi_outstanding_find(struct iscsi_session *is,
 		    uint32_t initiator_task_tag);
-static int	iscsi_outstanding_add(struct iscsi_session *is,
+static struct iscsi_outstanding	*iscsi_outstanding_add(struct iscsi_session *is,
 		    uint32_t initiator_task_tag, union ccb *ccb);
 static void	iscsi_outstanding_remove(struct iscsi_session *is,
 		    struct iscsi_outstanding *io);
@@ -274,27 +275,35 @@ iscsi_session_logout(struct iscsi_sessio
 }
 
 static void
-iscsi_session_terminate_tasks(struct iscsi_session *is, bool requeue)
+iscsi_session_terminate_task(struct iscsi_session *is,
+    struct iscsi_outstanding *io, bool requeue)
 {
-	struct iscsi_outstanding *io, *tmp;
 
-	ISCSI_SESSION_LOCK_ASSERT(is);
-	
-	TAILQ_FOREACH_SAFE(io, &is->is_outstanding, io_next, tmp) {
-		if (requeue) {
-			io->io_ccb->ccb_h.status &= ~CAM_SIM_QUEUED;
+	if (io->io_ccb != NULL) {
+		io->io_ccb->ccb_h.status &= ~(CAM_SIM_QUEUED | CAM_STATUS_MASK);
+		if (requeue)
 			io->io_ccb->ccb_h.status |= CAM_REQUEUE_REQ;
-		} else {
-			io->io_ccb->ccb_h.status = CAM_REQ_ABORTED;
-		}
-
+		else
+			io->io_ccb->ccb_h.status |= CAM_REQ_ABORTED;
 		if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) {
+			io->io_ccb->ccb_h.status |= CAM_DEV_QFRZN;
 			xpt_freeze_devq(io->io_ccb->ccb_h.path, 1);
 			ISCSI_SESSION_DEBUG(is, "freezing devq");
 		}
-		io->io_ccb->ccb_h.status |= CAM_DEV_QFRZN;
 		xpt_done(io->io_ccb);
-		iscsi_outstanding_remove(is, io);
+	}
+	iscsi_outstanding_remove(is, io);
+}
+
+static void
+iscsi_session_terminate_tasks(struct iscsi_session *is, bool requeue)
+{
+	struct iscsi_outstanding *io, *tmp;
+
+	ISCSI_SESSION_LOCK_ASSERT(is);
+
+	TAILQ_FOREACH_SAFE(io, &is->is_outstanding, io_next, tmp) {
+		iscsi_session_terminate_task(is, io, requeue);
 	}
 }
 
@@ -693,6 +702,9 @@ iscsi_receive_callback(struct icl_pdu *r
 	case ISCSI_BHS_OPCODE_SCSI_RESPONSE:
 		iscsi_pdu_handle_scsi_response(response);
 		break;
+	case ISCSI_BHS_OPCODE_TASK_RESPONSE:
+		iscsi_pdu_handle_task_response(response);
+		break;
 	case ISCSI_BHS_OPCODE_SCSI_DATA_IN:
 		iscsi_pdu_handle_data_in(response);
 		break;
@@ -813,7 +825,7 @@ iscsi_pdu_handle_scsi_response(struct ic
 
 	bhssr = (struct iscsi_bhs_scsi_response *)response->ip_bhs;
 	io = iscsi_outstanding_find(is, bhssr->bhssr_initiator_task_tag);
-	if (io == NULL) {
+	if (io == NULL || io->io_ccb == NULL) {
 		ISCSI_SESSION_WARN(is, "bad itt 0x%x", bhssr->bhssr_initiator_task_tag);
 		icl_pdu_free(response);
 		iscsi_session_reconnect(is);
@@ -913,6 +925,38 @@ out:
 }
 
 static void
+iscsi_pdu_handle_task_response(struct icl_pdu *response)
+{
+	struct iscsi_bhs_task_management_response *bhstmr;
+	struct iscsi_outstanding *io, *aio;
+	struct iscsi_session *is;
+
+	is = PDU_SESSION(response);
+
+	bhstmr = (struct iscsi_bhs_task_management_response *)response->ip_bhs;
+	io = iscsi_outstanding_find(is, bhstmr->bhstmr_initiator_task_tag);
+	if (io == NULL || io->io_ccb != NULL) {
+		ISCSI_SESSION_WARN(is, "bad itt 0x%x",
+		    bhstmr->bhstmr_initiator_task_tag);
+		icl_pdu_free(response);
+		iscsi_session_reconnect(is);
+		return;
+	}
+
+	if (bhstmr->bhstmr_response != BHSTMR_RESPONSE_FUNCTION_COMPLETE) {
+		ISCSI_SESSION_WARN(is, "task response 0x%x",
+		    bhstmr->bhstmr_response);
+	} else {
+		aio = iscsi_outstanding_find(is, io->io_datasn);
+		if (aio != NULL && aio->io_ccb != NULL)
+			iscsi_session_terminate_task(is, aio, false);
+	}
+
+	iscsi_outstanding_remove(is, io);
+	icl_pdu_free(response);
+}
+
+static void
 iscsi_pdu_handle_data_in(struct icl_pdu *response)
 {
 	struct iscsi_bhs_data_in *bhsdi;
@@ -924,7 +968,7 @@ iscsi_pdu_handle_data_in(struct icl_pdu 
 	is = PDU_SESSION(response);
 	bhsdi = (struct iscsi_bhs_data_in *)response->ip_bhs;
 	io = iscsi_outstanding_find(is, bhsdi->bhsdi_initiator_task_tag);
-	if (io == NULL) {
+	if (io == NULL || io->io_ccb == NULL) {
 		ISCSI_SESSION_WARN(is, "bad itt 0x%x", bhsdi->bhsdi_initiator_task_tag);
 		icl_pdu_free(response);
 		iscsi_session_reconnect(is);
@@ -1037,7 +1081,7 @@ iscsi_pdu_handle_r2t(struct icl_pdu *res
 
 	bhsr2t = (struct iscsi_bhs_r2t *)response->ip_bhs;
 	io = iscsi_outstanding_find(is, bhsr2t->bhsr2t_initiator_task_tag);
-	if (io == NULL) {
+	if (io == NULL || io->io_ccb == NULL) {
 		ISCSI_SESSION_WARN(is, "bad itt 0x%x; reconnecting",
 		    bhsr2t->bhsr2t_initiator_task_tag);
 		icl_pdu_free(response);
@@ -1878,7 +1922,21 @@ iscsi_outstanding_find(struct iscsi_sess
 	return (NULL);
 }
 
-static int
+static struct iscsi_outstanding *
+iscsi_outstanding_find_ccb(struct iscsi_session *is, union ccb *ccb)
+{
+	struct iscsi_outstanding *io;
+
+	ISCSI_SESSION_LOCK_ASSERT(is);
+
+	TAILQ_FOREACH(io, &is->is_outstanding, io_next) {
+		if (io->io_ccb == ccb)
+			return (io);
+	}
+	return (NULL);
+}
+
+static struct iscsi_outstanding *
 iscsi_outstanding_add(struct iscsi_session *is,
     uint32_t initiator_task_tag, union ccb *ccb)
 {
@@ -1892,12 +1950,12 @@ iscsi_outstanding_add(struct iscsi_sessi
 	io = uma_zalloc(iscsi_outstanding_zone, M_NOWAIT | M_ZERO);
 	if (io == NULL) {
 		ISCSI_SESSION_WARN(is, "failed to allocate %zd bytes", sizeof(*io));
-		return (ENOMEM);
+		return (NULL);
 	}
 	io->io_initiator_task_tag = initiator_task_tag;
 	io->io_ccb = ccb;
 	TAILQ_INSERT_TAIL(&is->is_outstanding, io, io_next);
-	return (0);
+	return (io);
 }
 
 static void
@@ -1911,11 +1969,66 @@ iscsi_outstanding_remove(struct iscsi_se
 }
 
 static void
+iscsi_action_abort(struct iscsi_session *is, union ccb *ccb)
+{
+	struct icl_pdu *request;
+	struct iscsi_bhs_task_management_request *bhstmr;
+	struct ccb_abort *cab = &ccb->cab;
+	struct iscsi_outstanding *io, *aio;
+
+	ISCSI_SESSION_LOCK_ASSERT(is);
+
+#if 0
+	KASSERT(is->is_login_phase == false, ("%s called during Login Phase", __func__));
+#else
+	if (is->is_login_phase) {
+		ccb->ccb_h.status = CAM_REQ_ABORTED;
+		xpt_done(ccb);
+		return;
+	}
+#endif
+
+	aio = iscsi_outstanding_find_ccb(is, cab->abort_ccb);
+	if (aio == NULL) {
+		ccb->ccb_h.status = CAM_REQ_CMP;
+		xpt_done(ccb);
+		return;
+	}
+
+	request = icl_pdu_new_bhs(is->is_conn, M_NOWAIT);
+	if (request == NULL) {
+		ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+		xpt_done(ccb);
+		return;
+	}
+
+	bhstmr = (struct iscsi_bhs_task_management_request *)request->ip_bhs;
+	bhstmr->bhstmr_opcode = ISCSI_BHS_OPCODE_TASK_REQUEST;
+	bhstmr->bhstmr_function = 0x80 | BHSTMR_FUNCTION_ABORT_TASK;
+
+	bhstmr->bhstmr_lun = htobe64(CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun));
+	bhstmr->bhstmr_initiator_task_tag = is->is_initiator_task_tag;
+	is->is_initiator_task_tag++;
+	bhstmr->bhstmr_referenced_task_tag = aio->io_initiator_task_tag;
+
+	io = iscsi_outstanding_add(is, bhstmr->bhstmr_initiator_task_tag, NULL);
+	if (io == NULL) {
+		icl_pdu_free(request);
+		ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
+		xpt_done(ccb);
+		return;
+	}
+	io->io_datasn = aio->io_initiator_task_tag;
+	iscsi_pdu_queue_locked(request);
+}
+
+static void
 iscsi_action_scsiio(struct iscsi_session *is, union ccb *ccb)
 {
 	struct icl_pdu *request;
 	struct iscsi_bhs_scsi_command *bhssc;
 	struct ccb_scsiio *csio;
+	struct iscsi_outstanding *io;
 	size_t len;
 	int error;
 
@@ -1991,8 +2104,8 @@ iscsi_action_scsiio(struct iscsi_session
 	else
 		memcpy(&bhssc->bhssc_cdb, csio->cdb_io.cdb_bytes, csio->cdb_len);
 
-	error = iscsi_outstanding_add(is, bhssc->bhssc_initiator_task_tag, ccb);
-	if (error != 0) {
+	io = iscsi_outstanding_add(is, bhssc->bhssc_initiator_task_tag, ccb);
+	if (io == NULL) {
 		icl_pdu_free(request);
 		if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) {
 			xpt_freeze_devq(ccb->ccb_h.path, 1);
@@ -2096,12 +2209,14 @@ iscsi_action(struct cam_sim *sim, union 
 	 * XXX: What's the point?
 	 */
 	case XPT_RESET_BUS:
-	case XPT_ABORT:
 	case XPT_TERM_IO:
 		ISCSI_SESSION_DEBUG(is, "faking success for reset, abort, or term_io");
 		ccb->ccb_h.status = CAM_REQ_CMP;
 		break;
 #endif
+	case XPT_ABORT:
+		iscsi_action_abort(is, ccb);
+		return;
 	case XPT_SCSI_IO:
 		iscsi_action_scsiio(is, ccb);
 		return;

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 10:49:10 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4C009224;
 Tue,  8 Jul 2014 10:49:10 +0000 (UTC)
Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id BCEC82463;
 Tue,  8 Jul 2014 10:49:09 +0000 (UTC)
Received: from alchemy.franken.de (localhost [127.0.0.1])
 by alchemy.franken.de (8.14.8/8.14.8/ALCHEMY.FRANKEN.DE) with ESMTP id
 s68An0nW074412
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Tue, 8 Jul 2014 12:49:00 +0200 (CEST)
 (envelope-from marius@alchemy.franken.de)
Received: (from marius@localhost)
 by alchemy.franken.de (8.14.8/8.14.8/Submit) id s68An0gh074411;
 Tue, 8 Jul 2014 12:49:00 +0200 (CEST) (envelope-from marius)
Date: Tue, 8 Jul 2014 12:49:00 +0200
From: Marius Strobl 
To: Hans Petter Selasky 
Subject: Re: svn commit: r268354 - head/sys/dev/usb/controller
Message-ID: <20140708104900.GG7615@alchemy.franken.de>
References: <201407070517.s675HHr9048970@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201407070517.s675HHr9048970@svn.freebsd.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3
 (alchemy.franken.de [0.0.0.0]); Tue, 08 Jul 2014 12:49:00 +0200 (CEST)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 10:49:10 -0000

On Mon, Jul 07, 2014 at 05:17:17AM +0000, Hans Petter Selasky wrote:
> Author: hselasky
> Date: Mon Jul  7 05:17:16 2014
> New Revision: 268354
> URL: http://svnweb.freebsd.org/changeset/base/268354
> 
> Log:
>   Improve support for Intel Lynx Point USB 3.0 controllers by masking
>   the port routing bits like done in Linux.
>   
>   MFC after:	1 week
>   Tested by:	Tur-Wei Chan 
> 
> Modified:
>   head/sys/dev/usb/controller/xhci_pci.c
>   head/sys/dev/usb/controller/xhcireg.h
> 
> Modified: head/sys/dev/usb/controller/xhci_pci.c
> ==============================================================================
> --- head/sys/dev/usb/controller/xhci_pci.c	Mon Jul  7 03:10:56 2014	(r268353)
> +++ head/sys/dev/usb/controller/xhci_pci.c	Mon Jul  7 05:17:16 2014	(r268354)
> @@ -157,6 +157,9 @@ xhci_pci_port_route(device_t self, uint3
>  	temp |= set;
>  	temp &= ~clear;
>  
> +	/* Don't set bits which the hardware doesn't support */
> +	temp &= pci_read_config(self, PCI_XHCI_INTEL_USB3PRM, 4);
> +
>  	pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4);
>  	pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4);
>  

Is there a reason you only exclude ports that PCI_XHCI_INTEL_USB3PRM
reports as not switchable to SuperSpeed, but not also ports that the
hardware reports as not routable between the EHCI and xHCI controller
via PCI_XHCI_INTEL_USB2PRM (as Linux does, which might be wront,
though)?

> 
> Modified: head/sys/dev/usb/controller/xhcireg.h
> ==============================================================================
> --- head/sys/dev/usb/controller/xhcireg.h	Mon Jul  7 03:10:56 2014	(r268353)
> +++ head/sys/dev/usb/controller/xhcireg.h	Mon Jul  7 05:17:16 2014	(r268354)
> @@ -35,7 +35,9 @@
>  #define	PCI_XHCI_FLADJ		0x61	/* RW frame length adjust */
>  
>  #define	PCI_XHCI_INTEL_XUSB2PR	0xD0	/* Intel USB2 Port Routing */
> +#define	PCI_XHCI_INTEL_USB2PRM	0xD4	/* Intel USB2 Port Routing Mask */
>  #define	PCI_XHCI_INTEL_USB3_PSSEN 0xD8	/* Intel USB3 Port SuperSpeed Enable */
> +#define	PCI_XHCI_INTEL_USB3PRM	0xDC	/* Intel USB3 Port Routing Mask */
>  
>  /* XHCI capability registers */
>  #define	XHCI_CAPLENGTH		0x00	/* RO capability */

Marius


From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 12:15:16 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 87E1D9D3;
 Tue,  8 Jul 2014 12:15:16 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5BA012BE7;
 Tue,  8 Jul 2014 12:15:16 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68CFGPk037258;
 Tue, 8 Jul 2014 12:15:16 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68CFGxj037257;
 Tue, 8 Jul 2014 12:15:16 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407081215.s68CFGxj037257@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 8 Jul 2014 12:15:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268391 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 12:15:16 -0000

Author: mav
Date: Tue Jul  8 12:15:15 2014
New Revision: 268391
URL: http://svnweb.freebsd.org/changeset/base/268391

Log:
  Return task management requests to queued execution, but differently.
  
  Testing shown that both original queued design with separate task queue,
  and recent direct execution design had significant flaw: If abort request
  arrives just after the victim, the last one may not be in the ooa_queue
  yet, and so invisible for the task management function.
  
  Unlike original queued implementation, use same queue for all SCSI and
  TASK requests from the same initiator. That avoids races between them:
  task functions are always executed in proper time, relatively to other
  requests.

Modified:
  head/sys/cam/ctl/ctl.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Tue Jul  8 10:11:47 2014	(r268390)
+++ head/sys/cam/ctl/ctl.c	Tue Jul  8 12:15:15 2014	(r268391)
@@ -12066,10 +12066,6 @@ ctl_abort_task(union ctl_io *io)
 	return (0);
 }
 
-/*
- * This routine cannot block!  It must be callable from an interrupt
- * handler as well as from the work thread.
- */
 static void
 ctl_run_task(union ctl_io *io)
 {
@@ -13690,10 +13686,8 @@ ctl_queue(union ctl_io *io)
 
 	switch (io->io_hdr.io_type) {
 	case CTL_IO_SCSI:
-		ctl_enqueue_incoming(io);
-		break;
 	case CTL_IO_TASK:
-		ctl_run_task(io);
+		ctl_enqueue_incoming(io);
 		break;
 	default:
 		printf("ctl_queue: unknown I/O type %d\n", io->io_hdr.io_type);
@@ -13862,6 +13856,16 @@ ctl_work_thread(void *arg)
 			retval = ctl_process_done(io);
 			continue;
 		}
+		io = (union ctl_io *)STAILQ_FIRST(&thr->incoming_queue);
+		if (io != NULL) {
+			STAILQ_REMOVE_HEAD(&thr->incoming_queue, links);
+			mtx_unlock(&thr->queue_lock);
+			if (io->io_hdr.io_type == CTL_IO_TASK)
+				ctl_run_task(io);
+			else
+				ctl_scsiio_precheck(softc, &io->scsiio);
+			continue;
+		}
 		if (!ctl_pause_rtr) {
 			io = (union ctl_io *)STAILQ_FIRST(&thr->rtr_queue);
 			if (io != NULL) {
@@ -13873,13 +13877,6 @@ ctl_work_thread(void *arg)
 				continue;
 			}
 		}
-		io = (union ctl_io *)STAILQ_FIRST(&thr->incoming_queue);
-		if (io != NULL) {
-			STAILQ_REMOVE_HEAD(&thr->incoming_queue, links);
-			mtx_unlock(&thr->queue_lock);
-			ctl_scsiio_precheck(softc, &io->scsiio);
-			continue;
-		}
 
 		/* Sleep until we have something to do. */
 		mtx_sleep(thr, &thr->queue_lock, PDROP | PRIBIO, "-", 0);
@@ -13917,8 +13914,11 @@ ctl_enqueue_incoming(union ctl_io *io)
 {
 	struct ctl_softc *softc = control_softc;
 	struct ctl_thread *thr;
+	u_int idx;
 
-	thr = &softc->threads[io->io_hdr.nexus.targ_mapped_lun % worker_threads];
+	idx = (io->io_hdr.nexus.targ_port * 127 +
+	       io->io_hdr.nexus.initid.id) % worker_threads;
+	thr = &softc->threads[idx];
 	mtx_lock(&thr->queue_lock);
 	STAILQ_INSERT_TAIL(&thr->incoming_queue, &io->io_hdr, links);
 	mtx_unlock(&thr->queue_lock);

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 12:16:28 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8FB2FB20;
 Tue,  8 Jul 2014 12:16:28 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7D0712BF8;
 Tue,  8 Jul 2014 12:16:28 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68CGS3S037649;
 Tue, 8 Jul 2014 12:16:28 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68CGSA3037646;
 Tue, 8 Jul 2014 12:16:28 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407081216.s68CGSA3037646@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 8 Jul 2014 12:16:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268392 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 12:16:28 -0000

Author: mav
Date: Tue Jul  8 12:16:28 2014
New Revision: 268392
URL: http://svnweb.freebsd.org/changeset/base/268392

Log:
  Do not return statuses for aborted iSCSI commands.

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Tue Jul  8 12:15:15 2014	(r268391)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Tue Jul  8 12:16:28 2014	(r268392)
@@ -2698,6 +2698,16 @@ cfiscsi_scsi_command_done(union ctl_io *
 	CFISCSI_SESSION_UNLOCK(cs);
 #endif
 
+	/*
+	 * Do not return status for aborted commands.
+	 * There are exceptions, but none supported by CTL yet.
+	 */
+	if (io->io_hdr.status == CTL_CMD_ABORTED) {
+		ctl_free_io(io);
+		icl_pdu_free(request);
+		return;
+	}
+
 	response = cfiscsi_pdu_new_response(request, M_WAITOK);
 	bhssr = (struct iscsi_bhs_scsi_response *)response->ip_bhs;
 	bhssr->bhssr_opcode = ISCSI_BHS_OPCODE_SCSI_RESPONSE;

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 12:19:34 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A13DADE2;
 Tue,  8 Jul 2014 12:19:34 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 8E7A82C1E;
 Tue,  8 Jul 2014 12:19:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68CJYkv038667;
 Tue, 8 Jul 2014 12:19:34 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68CJYqc038666;
 Tue, 8 Jul 2014 12:19:34 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201407081219.s68CJYqc038666@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Tue, 8 Jul 2014 12:19:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268393 - head/lib/libc/stdlib
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 12:19:34 -0000

Author: pluknet
Date: Tue Jul  8 12:19:34 2014
New Revision: 268393
URL: http://svnweb.freebsd.org/changeset/base/268393

Log:
  [mdoc] Fix previous change.

Modified:
  head/lib/libc/stdlib/getopt.3

Modified: head/lib/libc/stdlib/getopt.3
==============================================================================
--- head/lib/libc/stdlib/getopt.3	Tue Jul  8 12:16:28 2014	(r268392)
+++ head/lib/libc/stdlib/getopt.3	Tue Jul  8 12:19:34 2014	(r268393)
@@ -74,7 +74,7 @@ word, or
 .Dv NULL
 if there were no more characters in the current word.
 This is a
-.It Tn GNU
+.Tn GNU
 extension.
 For example, an option string
 .Li \&"x"

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 12:57:13 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3D6A8D67;
 Tue,  8 Jul 2014 12:57:13 +0000 (UTC)
Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214])
 (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id EDE0A2F78;
 Tue,  8 Jul 2014 12:57:12 +0000 (UTC)
Received: from laptop015.home.selasky.org
 (cm-176.74.213.204.customer.telag.net [176.74.213.204])
 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits))
 (No client certificate requested)
 by mail.turbocat.net (Postfix) with ESMTPSA id 5A7FE1FE028;
 Tue,  8 Jul 2014 14:57:02 +0200 (CEST)
Message-ID: <53BBEAA6.8090006@selasky.org>
Date: Tue, 08 Jul 2014 14:57:10 +0200
From: Hans Petter Selasky 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:24.0) Gecko/20100101 Thunderbird/24.1.0
MIME-Version: 1.0
To: Marius Strobl 
Subject: Re: svn commit: r268354 - head/sys/dev/usb/controller
References: <201407070517.s675HHr9048970@svn.freebsd.org>
 <20140708104900.GG7615@alchemy.franken.de>
In-Reply-To: <20140708104900.GG7615@alchemy.franken.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 12:57:13 -0000

On 07/08/14 12:49, Marius Strobl wrote:
> On Mon, Jul 07, 2014 at 05:17:17AM +0000, Hans Petter Selasky wrote:
>> Author: hselasky
>> Date: Mon Jul  7 05:17:16 2014
>> New Revision: 268354
>> URL: http://svnweb.freebsd.org/changeset/base/268354
>>
>> Log:
>>    Improve support for Intel Lynx Point USB 3.0 controllers by masking
>>    the port routing bits like done in Linux.
>>
>>    MFC after:	1 week
>>    Tested by:	Tur-Wei Chan 
>>
>> Modified:
>>    head/sys/dev/usb/controller/xhci_pci.c
>>    head/sys/dev/usb/controller/xhcireg.h
>>
>> Modified: head/sys/dev/usb/controller/xhci_pci.c
>> ==============================================================================
>> --- head/sys/dev/usb/controller/xhci_pci.c	Mon Jul  7 03:10:56 2014	(r268353)
>> +++ head/sys/dev/usb/controller/xhci_pci.c	Mon Jul  7 05:17:16 2014	(r268354)
>> @@ -157,6 +157,9 @@ xhci_pci_port_route(device_t self, uint3
>>   	temp |= set;
>>   	temp &= ~clear;
>>
>> +	/* Don't set bits which the hardware doesn't support */
>> +	temp &= pci_read_config(self, PCI_XHCI_INTEL_USB3PRM, 4);
>> +
>>   	pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4);
>>   	pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4);
>>
>
> Is there a reason you only exclude ports that PCI_XHCI_INTEL_USB3PRM
> reports as not switchable to SuperSpeed, but not also ports that the
> hardware reports as not routable between the EHCI and xHCI controller
> via PCI_XHCI_INTEL_USB2PRM (as Linux does, which might be wront,
> though)?
>

No specific reason. Feel free to experiment.

--HPS


From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 13:01:36 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C8C792CC;
 Tue,  8 Jul 2014 13:01:36 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B63AF2FE2;
 Tue,  8 Jul 2014 13:01:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68D1a38063247;
 Tue, 8 Jul 2014 13:01:36 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68D1a0X063246;
 Tue, 8 Jul 2014 13:01:36 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407081301.s68D1a0X063246@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 8 Jul 2014 13:01:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268395 - head/sys/dev/isp
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 13:01:36 -0000

Author: mav
Date: Tue Jul  8 13:01:36 2014
New Revision: 268395
URL: http://svnweb.freebsd.org/changeset/base/268395

Log:
  Pass correct command that should be aborted to ISPCTL_ABORT_CMD.
  
  This makes XPT_ABORT to work for me on initiator side of isp(4).
  Previous code was trying to abort the XPT_ABORT itself and failed.
  
  MFC after:	1 week

Modified:
  head/sys/dev/isp/isp_freebsd.c

Modified: head/sys/dev/isp/isp_freebsd.c
==============================================================================
--- head/sys/dev/isp/isp_freebsd.c	Tue Jul  8 12:46:33 2014	(r268394)
+++ head/sys/dev/isp/isp_freebsd.c	Tue Jul  8 13:01:36 2014	(r268395)
@@ -5107,7 +5107,7 @@ isp_action(struct cam_sim *sim, union cc
 			break;
 #endif
 		case XPT_SCSI_IO:
-			error = isp_control(isp, ISPCTL_ABORT_CMD, ccb);
+			error = isp_control(isp, ISPCTL_ABORT_CMD, accb);
 			if (error) {
 				ccb->ccb_h.status = CAM_UA_ABORT;
 			} else {

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 13:28:38 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 21AF1249;
 Tue,  8 Jul 2014 13:28:38 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 0F28322F5;
 Tue,  8 Jul 2014 13:28:38 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68DSbiO074606;
 Tue, 8 Jul 2014 13:28:37 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68DSb0d074605;
 Tue, 8 Jul 2014 13:28:37 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407081328.s68DSb0d074605@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 8 Jul 2014 13:28:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268398 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 13:28:38 -0000

Author: mav
Date: Tue Jul  8 13:28:37 2014
New Revision: 268398
URL: http://svnweb.freebsd.org/changeset/base/268398

Log:
  Fix typo in r267873.

Modified:
  head/sys/cam/ctl/ctl.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Tue Jul  8 13:24:00 2014	(r268397)
+++ head/sys/cam/ctl/ctl.c	Tue Jul  8 13:28:37 2014	(r268398)
@@ -11822,7 +11822,7 @@ ctl_lun_reset(struct ctl_lun *lun, union
 		ctl_clear_mask(lun->have_ca, i);
 		lun->pending_sense[i].ua_pending |= ua_type;
 	}
-	mtx_lock(&lun->lun_lock);
+	mtx_unlock(&lun->lun_lock);
 
 	return (0);
 }

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 14:35:10 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 03DDD2EF;
 Tue,  8 Jul 2014 14:35:10 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E5A642A16;
 Tue,  8 Jul 2014 14:35:09 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68EZ96G007479;
 Tue, 8 Jul 2014 14:35:09 GMT (envelope-from ian@svn.freebsd.org)
Received: (from ian@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68EZ91V007478;
 Tue, 8 Jul 2014 14:35:09 GMT (envelope-from ian@svn.freebsd.org)
Message-Id: <201407081435.s68EZ91V007478@svn.freebsd.org>
From: Ian Lepore 
Date: Tue, 8 Jul 2014 14:35:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268401 - head/sys/arm/freescale/imx
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 14:35:10 -0000

Author: ian
Date: Tue Jul  8 14:35:09 2014
New Revision: 268401
URL: http://svnweb.freebsd.org/changeset/base/268401

Log:
  Use named constant rather than '0' to access the reset controller register.

Modified:
  head/sys/arm/freescale/imx/imx6_mp.c

Modified: head/sys/arm/freescale/imx/imx6_mp.c
==============================================================================
--- head/sys/arm/freescale/imx/imx6_mp.c	Tue Jul  8 14:11:28 2014	(r268400)
+++ head/sys/arm/freescale/imx/imx6_mp.c	Tue Jul  8 14:35:09 2014	(r268401)
@@ -162,7 +162,7 @@ platform_mp_start_ap(void)
 		    ( 1 << (SRC_CONTROL_C1RST_SHIFT - 1 + i)));
 
 	}
-	bus_space_write_4(fdtbus_bs_tag, src, 0, val);
+	bus_space_write_4(fdtbus_bs_tag, src, SRC_CONTROL_REG, val);
 
 	armv7_sev();
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 14:37:02 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0AEA843E;
 Tue,  8 Jul 2014 14:37:02 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id ED07D2A29;
 Tue,  8 Jul 2014 14:37:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68Eb1Wj007762;
 Tue, 8 Jul 2014 14:37:01 GMT (envelope-from ian@svn.freebsd.org)
Received: (from ian@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68Eb1nt007761;
 Tue, 8 Jul 2014 14:37:01 GMT (envelope-from ian@svn.freebsd.org)
Message-Id: <201407081437.s68Eb1nt007761@svn.freebsd.org>
From: Ian Lepore 
Date: Tue, 8 Jul 2014 14:37:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268402 - head/share/mk
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 14:37:02 -0000

Author: ian
Date: Tue Jul  8 14:37:01 2014
New Revision: 268402
URL: http://svnweb.freebsd.org/changeset/base/268402

Log:
  Support CXXFLAGS.${MACHINE_ARCH} as well as CFLAGS.  This allows different
  C++ options for toolchain versus target when cross-building.

Modified:
  head/share/mk/bsd.cpu.mk

Modified: head/share/mk/bsd.cpu.mk
==============================================================================
--- head/share/mk/bsd.cpu.mk	Tue Jul  8 14:35:09 2014	(r268401)
+++ head/share/mk/bsd.cpu.mk	Tue Jul  8 14:37:01 2014	(r268402)
@@ -260,3 +260,4 @@ CFLAGS += ${_CPUCFLAGS}
 # Add in any architecture-specific CFLAGS.  
 # These come from make.conf or the command line or the environment.
 CFLAGS += ${CFLAGS.${MACHINE_ARCH}}
+CXXFLAGS += ${CXXFLAGS.${MACHINE_ARCH}}

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 14:42:45 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 27743885;
 Tue,  8 Jul 2014 14:42:45 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 14B1B2AF4;
 Tue,  8 Jul 2014 14:42:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68EgiLj011868;
 Tue, 8 Jul 2014 14:42:44 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68EgiK4011867;
 Tue, 8 Jul 2014 14:42:44 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201407081442.s68EgiK4011867@svn.freebsd.org>
From: Glen Barber 
Date: Tue, 8 Jul 2014 14:42:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268403 - head/release/doc/en_US.ISO8859-1/relnotes
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 14:42:45 -0000

Author: gjb
Date: Tue Jul  8 14:42:44 2014
New Revision: 268403
URL: http://svnweb.freebsd.org/changeset/base/268403

Log:
  Document r268351, end of ia64 support.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==============================================================================
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Tue Jul  8 14:37:01 2014	(r268402)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Tue Jul  8 14:42:44 2014	(r268403)
@@ -218,6 +218,9 @@
     
       Hardware Support
 
+      Support for &os;/ia64 has been dropped
+	as of &os; 11.
+
       
 	Multimedia Support
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 14:45:11 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B68B4ACC;
 Tue,  8 Jul 2014 14:45:11 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A3ED92B14;
 Tue,  8 Jul 2014 14:45:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68EjBVN012492;
 Tue, 8 Jul 2014 14:45:11 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68EjBiC012491;
 Tue, 8 Jul 2014 14:45:11 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201407081445.s68EjBiC012491@svn.freebsd.org>
From: Glen Barber 
Date: Tue, 8 Jul 2014 14:45:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268404 - head/release/doc/en_US.ISO8859-1/relnotes
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 14:45:11 -0000

Author: gjb
Date: Tue Jul  8 14:45:11 2014
New Revision: 268404
URL: http://svnweb.freebsd.org/changeset/base/268404

Log:
  Drop leading 'r' in revision number from previous commit.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==============================================================================
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Tue Jul  8 14:42:44 2014	(r268403)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Tue Jul  8 14:45:11 2014	(r268404)
@@ -218,7 +218,7 @@
     
       Hardware Support
 
-      Support for &os;/ia64 has been dropped
+      Support for &os;/ia64 has been dropped
 	as of &os; 11.
 
       

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 14:46:41 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 58949CF2;
 Tue,  8 Jul 2014 14:46:41 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 45DE82B32;
 Tue,  8 Jul 2014 14:46:41 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68EkfE2012738;
 Tue, 8 Jul 2014 14:46:41 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68EkfQV012737;
 Tue, 8 Jul 2014 14:46:41 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201407081446.s68EkfQV012737@svn.freebsd.org>
From: Glen Barber 
Date: Tue, 8 Jul 2014 14:46:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268405 - head/release/doc/en_US.ISO8859-1/relnotes
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 14:46:41 -0000

Author: gjb
Date: Tue Jul  8 14:46:40 2014
New Revision: 268405
URL: http://svnweb.freebsd.org/changeset/base/268405

Log:
  Document r268303, MacMini 3,1 support in asmc(4).
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==============================================================================
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Tue Jul  8 14:45:11 2014	(r268404)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Tue Jul  8 14:46:40 2014	(r268405)
@@ -218,6 +218,9 @@
     
       Hardware Support
 
+      The &man.asmc.4; driver has been updated
+	to support the &apple; MacMini 3,1.
+
       Support for &os;/ia64 has been dropped
 	as of &os; 11.
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 14:52:09 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id BA00B51F;
 Tue,  8 Jul 2014 14:52:09 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A58AE2C28;
 Tue,  8 Jul 2014 14:52:09 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68Eq91m017089;
 Tue, 8 Jul 2014 14:52:09 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68Eq914017088;
 Tue, 8 Jul 2014 14:52:09 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201407081452.s68Eq914017088@svn.freebsd.org>
From: Glen Barber 
Date: Tue, 8 Jul 2014 14:52:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268406 - head/release/doc/en_US.ISO8859-1/relnotes
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 14:52:09 -0000

Author: gjb
Date: Tue Jul  8 14:52:09 2014
New Revision: 268406
URL: http://svnweb.freebsd.org/changeset/base/268406

Log:
  Document r267359, disklabel64 partitioning scheme.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==============================================================================
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Tue Jul  8 14:46:40 2014	(r268405)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Tue Jul  8 14:52:09 2014	(r268406)
@@ -267,7 +267,9 @@
     
       Disks and Storage
 
-       
+      Support for the
+	disklabel64 partitioning scheme has been
+	added to &man.gpart.8;.
     
 
     

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 14:53:52 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 647FA765;
 Tue,  8 Jul 2014 14:53:52 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 51F712C44;
 Tue,  8 Jul 2014 14:53:52 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68Erqcw017335;
 Tue, 8 Jul 2014 14:53:52 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68ErqpE017334;
 Tue, 8 Jul 2014 14:53:52 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201407081453.s68ErqpE017334@svn.freebsd.org>
From: Glen Barber 
Date: Tue, 8 Jul 2014 14:53:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268407 - head/sbin/geom/class/part
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 14:53:52 -0000

Author: gjb
Date: Tue Jul  8 14:53:51 2014
New Revision: 268407
URL: http://svnweb.freebsd.org/changeset/base/268407

Log:
  Fix non-version text after .Fx macro usage.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sbin/geom/class/part/gpart.8

Modified: head/sbin/geom/class/part/gpart.8
==============================================================================
--- head/sbin/geom/class/part/gpart.8	Tue Jul  8 14:52:09 2014	(r268406)
+++ head/sbin/geom/class/part/gpart.8	Tue Jul  8 14:53:51 2014	(r268407)
@@ -551,7 +551,8 @@ The
 utility also allows the user to specify scheme-specific partition types
 for partition types that do not have symbolic names.
 Symbolic names currently understood and used by
-.Fx are:
+.Fx
+are:
 .Bl -tag -width ".Cm dragonfly-disklabel64"
 .It Cm apple-boot
 The system partition dedicated to storing boot loaders on some Apple

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 14:55:31 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A85BC997;
 Tue,  8 Jul 2014 14:55:31 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 95A6A2C59;
 Tue,  8 Jul 2014 14:55:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68EtVYJ017748;
 Tue, 8 Jul 2014 14:55:31 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68EtVfl017747;
 Tue, 8 Jul 2014 14:55:31 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201407081455.s68EtVfl017747@svn.freebsd.org>
From: Glen Barber 
Date: Tue, 8 Jul 2014 14:55:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268408 - head/release/doc/en_US.ISO8859-1/relnotes
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 14:55:31 -0000

Author: gjb
Date: Tue Jul  8 14:55:31 2014
New Revision: 268408
URL: http://svnweb.freebsd.org/changeset/base/268408

Log:
  Document r266770, Intel Centrino Wireless-N 105 support.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==============================================================================
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Tue Jul  8 14:53:51 2014	(r268407)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Tue Jul  8 14:55:31 2014	(r268408)
@@ -253,6 +253,10 @@
 	The &man.ath.hal.4; driver has been
 	  updated to support the Atheros AR1111 chipset.
+
+	Support for the &intel;
+	  Centrino™ Wireless-N 105 chipset has been
+	  added.
       
     
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 14:58:54 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 11A0EBAA
 for ; Tue,  8 Jul 2014 14:58:54 +0000 (UTC)
Received: from mail-ie0-f174.google.com (mail-ie0-f174.google.com
 [209.85.223.174])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id CA6832C84
 for ; Tue,  8 Jul 2014 14:58:53 +0000 (UTC)
Received: by mail-ie0-f174.google.com with SMTP id rd18so5101112iec.19
 for ; Tue, 08 Jul 2014 07:58:47 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:sender:content-type:mime-version:subject:from
 :in-reply-to:date:cc:message-id:references:to;
 bh=AX5pXHegZe19clXIjwYMo7wAspJ9YRT55HzV4Sp6qGI=;
 b=HRva60pNsnKCeUMuHu2pkKYUEyfbvF8Cy7oqAn/QlJVTmyidvGyuOG3qfkU8O/rw49
 uyFL5nS4JFWZ+gfgkO3KObEQ3qM2YFyBbiVQ3V8saEfx+DFOVXWr8CcbEq03+6mpwNPK
 VkVxfBXh1HkEHDUcSrVaMSj+80f88QI8KFgdgZ2FoPQ4SduwKEdzNiJxDPojvl4c4Aru
 RiR/HVpuwxySk3bkE3q/xvi1BNeCjlgi4Z+/m54oX5QGmMtBVM2mkMJB1Pn5Fqiewc7W
 fatsXhA8cfIqjEuXav5k0cYQE92VEdlqqBf53ixmFAzBysDxKnrAP9N4P9vCY8dEKEgb
 naPQ==
X-Gm-Message-State: ALoCoQlZkMi2KjeN6D1dvOOZf4b0rh/vm1HFDl/l3CNcC+xcWy92wfXcIdsLZtQJ9qOhBKZ294Uh
X-Received: by 10.43.78.19 with SMTP id zk19mr3397747icb.77.1404831527597;
 Tue, 08 Jul 2014 07:58:47 -0700 (PDT)
Received: from bsdimp.bsdimp.com
 (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198])
 by mx.google.com with ESMTPSA id j10sm6093519igv.17.2014.07.08.07.58.46
 for 
 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Tue, 08 Jul 2014 07:58:47 -0700 (PDT)
Sender: Warner Losh 
Content-Type: multipart/signed;
 boundary="Apple-Mail=_33D144FF-CB14-4772-B6B1-27DC415B46F5";
 protocol="application/pgp-signature"; micalg=pgp-sha512
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
Subject: Re: svn commit: r268376 - head/bin/rm
From: Warner Losh 
In-Reply-To: <53BB9911.60804@freebsd.org>
Date: Tue, 8 Jul 2014 08:58:45 -0600
Message-Id: <37C52A06-1FBA-4750-A6CC-F89B0347BED3@bsdimp.com>
References: <201407072321.s67NLL7p070713@svn.freebsd.org>
 <53BB9911.60804@freebsd.org>
To: Julian Elischer 
X-Mailer: Apple Mail (2.1878.6)
Cc: svn-src-head@freebsd.org, Warner Losh 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 14:58:54 -0000


--Apple-Mail=_33D144FF-CB14-4772-B6B1-27DC415B46F5
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252


On Jul 8, 2014, at 1:09 AM, Julian Elischer  wrote:

> On 7/8/14, 7:21 AM, Warner Losh wrote:
>> Author: imp
>> Date: Mon Jul  7 23:21:20 2014
>> New Revision: 268376
>> URL: http://svnweb.freebsd.org/changeset/base/268376
>>=20
>> Log:
>>   rm -rf can fail sometimes with an error from fts_read. Make it =
honor
>>   fflag to ignore fts_read errors, but stop deleting from that =
directory
>>   because no further progress can be made.
>>      When building a kernel with a high -j value on a high core count
>>   machine, during the cleanobj phase we can wind up doing multiple rm
>>   -rf at the same time for modules that have subdirectories. This
>>   exposed this race (sometimes) as fts_read can return an error if =
the
>>   directory is removed by another rm -rf. Since the intent of the -f
>>   flag was to ignore errors, even if this was a bug in fts_read, we
>>   should ignore the error like we've been instructed to do.
> One could make an argument that being unable to delete something =
because someone else deleted it first is a "non error".
> Even without -f

rm is supposed to return an error when you try to delete something that =
isn=92t there. Do you have a standards quote handy?

Warner


--Apple-Mail=_33D144FF-CB14-4772-B6B1-27DC415B46F5
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJTvAclAAoJEGwc0Sh9sBEAaxcP/0aq+6Hq7+88cTprWH4RHfWM
dx6jB0DtpA/8lzCNiKCW5UVOegvOtRNHmZlIyng+wo6XTXz4M5ETsAImdcvGcuA9
TnobVBtW0cGSudBdxTw+uPxDyGN3GCSSVxAj9i05914p/1efhWW9Udhzagz69PiI
0qShIUL2vITNzQs9CUbeS4omLFwH5eiOxrPb1swgDefssRxLeaUmvQrQJOTNCs3E
y2KXC3+v7Efd8LWEQKVEtj7oTG3IlCOLdOeO3Sq5vy8lIvDIAlZz3b/kr24lJ3KW
dWQzG+eI2vTi/CN+Gmyu1Yqj8jAJavGf+IJjMF+gjCXiQbmOkuYWx2wzuuRIXjvp
tKEQW2SAOp81J7OjABBSvDr2ZQdFMp+KrXqouCgBZYpQgaP423J/c9NAEvlbLBPU
AWsrqOCuwUluaRtm+s5zI4+G1F3auo+UZV+xJw0itnQvkQUG3eHUgxc/j6iXAua8
eLPtPgeaHQxLk7EPO4xIDYU5w76aZ7pyvwT+fss3kJdb69c5mliGoHgL1JBLh0VX
k0Fyhk1HVVmbQoPgddHC65jRFRLpvUEg5eSsNe+T5wHnaV7fSQ/y4o0q0lEDljYz
qHVYLEUPKYi5E1Mr8FFyL7n6pj46HKzIAMeJRa0s66A131ckgbMv02y43qNWSijp
GtfqCu6IFzoYks1aHbiT
=utBI
-----END PGP SIGNATURE-----

--Apple-Mail=_33D144FF-CB14-4772-B6B1-27DC415B46F5--

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 14:59:04 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3A961BE2;
 Tue,  8 Jul 2014 14:59:04 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2761A2C93;
 Tue,  8 Jul 2014 14:59:04 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68Ex4Lg018223;
 Tue, 8 Jul 2014 14:59:04 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68Ex3jH018221;
 Tue, 8 Jul 2014 14:59:03 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201407081459.s68Ex3jH018221@svn.freebsd.org>
From: Glen Barber 
Date: Tue, 8 Jul 2014 14:59:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268409 - in head/release/doc: en_US.ISO8859-1/relnotes
 share/xml
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 14:59:04 -0000

Author: gjb
Date: Tue Jul  8 14:59:03 2014
New Revision: 268409
URL: http://svnweb.freebsd.org/changeset/base/268409

Log:
  Document r266757, netmap(4) support for cxgbe(4).
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml
  head/release/doc/share/xml/sponsor.ent

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==============================================================================
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Tue Jul  8 14:55:31 2014	(r268408)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Tue Jul  8 14:59:03 2014	(r268409)
@@ -164,6 +164,10 @@
       kern.vty=vt to &man.loader.conf.5; and
       reboot the system.
 
+    Support for the &man.cxgbe.4; Terminator 5
+	(T5) 10G/40G cards has been added to &man.netmap.4;.
+
     
       Virtualization support
 

Modified: head/release/doc/share/xml/sponsor.ent
==============================================================================
--- head/release/doc/share/xml/sponsor.ent	Tue Jul  8 14:55:31 2014	(r268408)
+++ head/release/doc/share/xml/sponsor.ent	Tue Jul  8 14:59:03 2014	(r268409)
@@ -10,6 +10,8 @@
 
 
 
+
+
 
 
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 15:04:36 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 26DF2F7F;
 Tue,  8 Jul 2014 15:04:36 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 140A42D55;
 Tue,  8 Jul 2014 15:04:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68F4ZGB022334;
 Tue, 8 Jul 2014 15:04:35 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68F4Zs7022333;
 Tue, 8 Jul 2014 15:04:35 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201407081504.s68F4Zs7022333@svn.freebsd.org>
From: Glen Barber 
Date: Tue, 8 Jul 2014 15:04:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268410 - head/release/doc/en_US.ISO8859-1/relnotes
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 15:04:36 -0000

Author: gjb
Date: Tue Jul  8 15:04:35 2014
New Revision: 268410
URL: http://svnweb.freebsd.org/changeset/base/268410

Log:
  Document r266531, IMAGACT_BINMISC enabled by default.
  While here, fix a spacing nit from previous commit.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==============================================================================
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Tue Jul  8 14:59:03 2014	(r268409)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Tue Jul  8 15:04:35 2014	(r268410)
@@ -166,7 +166,12 @@
 
     Support for the &man.cxgbe.4; Terminator 5
-	(T5) 10G/40G cards has been added to &man.netmap.4;.
+      (T5) 10G/40G cards has been added to &man.netmap.4;.
+
+    The IMAGACT_BINMISC
+      kernel configuration option has been enabled by default,
+      which enables application execution through emulators, such
+      as Qemu.
 
     
       Virtualization support

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 15:14:22 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 011C28A0;
 Tue,  8 Jul 2014 15:14:21 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E25402E5A;
 Tue,  8 Jul 2014 15:14:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68FELid027190;
 Tue, 8 Jul 2014 15:14:21 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68FELUf027189;
 Tue, 8 Jul 2014 15:14:21 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201407081514.s68FELUf027189@svn.freebsd.org>
From: Glen Barber 
Date: Tue, 8 Jul 2014 15:14:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268413 - head/release/doc/en_US.ISO8859-1/relnotes
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 15:14:22 -0000

Author: gjb
Date: Tue Jul  8 15:14:21 2014
New Revision: 268413
URL: http://svnweb.freebsd.org/changeset/base/268413

Log:
  Sort by commit revision number.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==============================================================================
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Tue Jul  8 15:11:33 2014	(r268412)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Tue Jul  8 15:14:21 2014	(r268413)
@@ -156,6 +156,15 @@
       &man.sysctl.8; on &intel; processors with Turbo
       Boost ™ enabled has been fixed.
 
+    The IMAGACT_BINMISC
+      kernel configuration option has been enabled by default,
+      which enables application execution through emulators, such
+      as Qemu.
+
+    Support for the &man.cxgbe.4; Terminator 5
+      (T5) 10G/40G cards has been added to &man.netmap.4;.
+
     The VT kernel
       configuration file has been removed, and the &man.vt.4;
       driver is included in the GENERIC kernel.
@@ -164,15 +173,6 @@
       kern.vty=vt to &man.loader.conf.5; and
       reboot the system.
 
-    Support for the &man.cxgbe.4; Terminator 5
-      (T5) 10G/40G cards has been added to &man.netmap.4;.
-
-    The IMAGACT_BINMISC
-      kernel configuration option has been enabled by default,
-      which enables application execution through emulators, such
-      as Qemu.
-
     
       Virtualization support
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 16:38:07 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id A54BBD7C;
 Tue,  8 Jul 2014 16:38:07 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 85E382713;
 Tue,  8 Jul 2014 16:38:07 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68Gc7eq066314;
 Tue, 8 Jul 2014 16:38:07 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68Gc6Dd066305;
 Tue, 8 Jul 2014 16:38:06 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407081638.s68Gc6Dd066305@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 8 Jul 2014 16:38:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268418 - in head/sys/cam: ctl scsi
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 16:38:07 -0000

Author: mav
Date: Tue Jul  8 16:38:05 2014
New Revision: 268418
URL: http://svnweb.freebsd.org/changeset/base/268418

Log:
  Enable TAS feature: notify initiator if its command was aborted by other.
  
  That should make operation more kind to multi-initiator environment.
  Without this, other initiators may find out that something bad happened
  to their commands only via command timeout.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_error.c
  head/sys/cam/ctl/ctl_error.h
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/cam/ctl/ctl_io.h
  head/sys/cam/ctl/scsi_ctl.c
  head/sys/cam/scsi/scsi_all.h

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Tue Jul  8 16:31:59 2014	(r268417)
+++ head/sys/cam/ctl/ctl.c	Tue Jul  8 16:38:05 2014	(r268418)
@@ -282,8 +282,10 @@ static struct scsi_control_page control_
 	/*rlec*/0,
 	/*queue_flags*/0,
 	/*eca_and_aen*/0,
-	/*reserved*/0,
-	/*aen_holdoff_period*/{0, 0}
+	/*flags4*/SCP_TAS,
+	/*aen_holdoff_period*/{0, 0},
+	/*busy_timeout_period*/{0, 0},
+	/*extended_selftest_completion_time*/{0, 0}
 };
 
 static struct scsi_control_page control_page_changeable = {
@@ -292,8 +294,10 @@ static struct scsi_control_page control_
 	/*rlec*/SCP_DSENSE,
 	/*queue_flags*/0,
 	/*eca_and_aen*/0,
-	/*reserved*/0,
-	/*aen_holdoff_period*/{0, 0}
+	/*flags4*/0,
+	/*aen_holdoff_period*/{0, 0},
+	/*busy_timeout_period*/{0, 0},
+	/*extended_selftest_completion_time*/{0, 0}
 };
 
 
@@ -7576,7 +7580,7 @@ ctl_report_supported_tmf(struct ctl_scsi
 	ctsio->kern_rel_offset = 0;
 
 	data = (struct scsi_report_supported_tmf_data *)ctsio->kern_data_ptr;
-	data->byte1 |= RST_ATS | RST_ATSS | RST_LURS | RST_TRS;
+	data->byte1 |= RST_ATS | RST_ATSS | RST_CTSS | RST_LURS | RST_TRS;
 	data->byte2 |= RST_ITNRS;
 
 	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
@@ -11793,7 +11797,7 @@ ctl_lun_reset(struct ctl_lun *lun, union
 #endif
 	for (xio = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); xio != NULL;
 	     xio = (union ctl_io *)TAILQ_NEXT(&xio->io_hdr, ooa_links)) {
-		xio->io_hdr.flags |= CTL_FLAG_ABORT;
+		xio->io_hdr.flags |= CTL_FLAG_ABORT | CTL_FLAG_ABORT_STATUS;
 	}
 
 	/*
@@ -11846,8 +11850,13 @@ ctl_abort_tasks_lun(struct ctl_lun *lun,
 	for (xio = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); xio != NULL;
 	     xio = (union ctl_io *)TAILQ_NEXT(&xio->io_hdr, ooa_links)) {
 
-		if ((targ_port == xio->io_hdr.nexus.targ_port) &&
-		    (init_id == xio->io_hdr.nexus.initid.id)) {
+		if ((targ_port == UINT32_MAX ||
+		     targ_port == xio->io_hdr.nexus.targ_port) &&
+		    (init_id == UINT32_MAX ||
+		     init_id == xio->io_hdr.nexus.initid.id)) {
+			if (targ_port != xio->io_hdr.nexus.targ_port ||
+			    init_id != xio->io_hdr.nexus.initid.id)
+				xio->io_hdr.flags |= CTL_FLAG_ABORT_STATUS;
 			xio->io_hdr.flags |= CTL_FLAG_ABORT;
 			found = 1;
 			if (!other_sc && !(lun->flags & CTL_LUN_PRIMARY_SC)) {
@@ -11889,9 +11898,14 @@ ctl_abort_task_set(union ctl_io *io)
 
 	mtx_lock(&lun->lun_lock);
 	mtx_unlock(&softc->ctl_lock);
-	ctl_abort_tasks_lun(lun, io->io_hdr.nexus.targ_port,
-	    io->io_hdr.nexus.initid.id,
-	    (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) != 0);
+	if (io->taskio.task_action == CTL_TASK_ABORT_TASK_SET) {
+		ctl_abort_tasks_lun(lun, io->io_hdr.nexus.targ_port,
+		    io->io_hdr.nexus.initid.id,
+		    (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) != 0);
+	} else { /* CTL_TASK_CLEAR_TASK_SET */
+		ctl_abort_tasks_lun(lun, UINT32_MAX, UINT32_MAX,
+		    (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) != 0);
+	}
 	mtx_unlock(&lun->lun_lock);
 	return (0);
 }
@@ -12111,12 +12125,11 @@ ctl_run_task(union ctl_io *io)
 		retval = ctl_abort_task(io);
 		break;
 	case CTL_TASK_ABORT_TASK_SET:
+	case CTL_TASK_CLEAR_TASK_SET:
 		retval = ctl_abort_task_set(io);
 		break;
 	case CTL_TASK_CLEAR_ACA:
 		break;
-	case CTL_TASK_CLEAR_TASK_SET:
-		break;
 	case CTL_TASK_I_T_NEXUS_RESET:
 		retval = ctl_i_t_nexus_reset(io);
 		break;
@@ -13474,7 +13487,7 @@ ctl_process_done(union ctl_io *io)
 	 * whatever it needs to do to clean up its state.
 	 */
 	if (io->io_hdr.flags & CTL_FLAG_ABORT)
-		io->io_hdr.status = CTL_CMD_ABORTED;
+		ctl_set_task_aborted(&io->scsiio);
 
 	/*
 	 * We print out status for every task management command.  For SCSI

Modified: head/sys/cam/ctl/ctl_error.c
==============================================================================
--- head/sys/cam/ctl/ctl_error.c	Tue Jul  8 16:31:59 2014	(r268417)
+++ head/sys/cam/ctl/ctl_error.c	Tue Jul  8 16:38:05 2014	(r268418)
@@ -795,6 +795,18 @@ ctl_set_busy(struct ctl_scsiio *ctsio)
 }
 
 void
+ctl_set_task_aborted(struct ctl_scsiio *ctsio)
+{
+	struct scsi_sense_data *sense;
+
+	sense = &ctsio->sense_data;
+	memset(sense, 0, sizeof(*sense));
+	ctsio->scsi_status = SCSI_STATUS_TASK_ABORTED;
+	ctsio->sense_len = 0;
+	ctsio->io_hdr.status = CTL_CMD_ABORTED;
+}
+
+void
 ctl_set_success(struct ctl_scsiio *ctsio)
 {
 	struct scsi_sense_data *sense;

Modified: head/sys/cam/ctl/ctl_error.h
==============================================================================
--- head/sys/cam/ctl/ctl_error.h	Tue Jul  8 16:31:59 2014	(r268417)
+++ head/sys/cam/ctl/ctl_error.h	Tue Jul  8 16:38:05 2014	(r268418)
@@ -80,6 +80,7 @@ void ctl_set_data_phase_error(struct ctl
 void ctl_set_reservation_conflict(struct ctl_scsiio *ctsio);
 void ctl_set_queue_full(struct ctl_scsiio *ctsio);
 void ctl_set_busy(struct ctl_scsiio *ctsio);
+void ctl_set_task_aborted(struct ctl_scsiio *ctsio);
 void ctl_set_success(struct ctl_scsiio *ctsio);
 
 #endif	/* _CTL_ERROR_H_ */

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Tue Jul  8 16:31:59 2014	(r268417)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Tue Jul  8 16:38:05 2014	(r268418)
@@ -2702,7 +2702,8 @@ cfiscsi_scsi_command_done(union ctl_io *
 	 * Do not return status for aborted commands.
 	 * There are exceptions, but none supported by CTL yet.
 	 */
-	if (io->io_hdr.status == CTL_CMD_ABORTED) {
+	if (io->io_hdr.status == CTL_CMD_ABORTED &&
+	    (io->io_hdr.flags & CTL_FLAG_ABORT_STATUS) == 0) {
 		ctl_free_io(io);
 		icl_pdu_free(request);
 		return;

Modified: head/sys/cam/ctl/ctl_io.h
==============================================================================
--- head/sys/cam/ctl/ctl_io.h	Tue Jul  8 16:31:59 2014	(r268417)
+++ head/sys/cam/ctl/ctl_io.h	Tue Jul  8 16:38:05 2014	(r268418)
@@ -96,6 +96,7 @@ typedef enum {
 	CTL_FLAG_CONTROL_DEV	= 0x00000080,	/* processor device */
 	CTL_FLAG_ALLOCATED	= 0x00000100,	/* data space allocated */
 	CTL_FLAG_BLOCKED	= 0x00000200,	/* on the blocked queue */
+	CTL_FLAG_ABORT_STATUS	= 0x00000400,	/* return TASK ABORTED status */
 	CTL_FLAG_ABORT		= 0x00000800,	/* this I/O should be aborted */
 	CTL_FLAG_DMA_INPROG	= 0x00001000,	/* DMA in progress */
 	CTL_FLAG_NO_DATASYNC	= 0x00002000,	/* don't cache flush data */

Modified: head/sys/cam/ctl/scsi_ctl.c
==============================================================================
--- head/sys/cam/ctl/scsi_ctl.c	Tue Jul  8 16:31:59 2014	(r268417)
+++ head/sys/cam/ctl/scsi_ctl.c	Tue Jul  8 16:38:05 2014	(r268418)
@@ -805,7 +805,8 @@ ctlfestart(struct cam_periph *periph, un
 				scsi_status = SCSI_STATUS_BUSY;
 				csio->sense_len = 0;
 			} else if ((io->io_hdr.status & CTL_STATUS_MASK) ==
-				   CTL_CMD_ABORTED) {
+			     CTL_CMD_ABORTED &&
+			    (io->io_hdr.flags & CTL_FLAG_ABORT_STATUS) == 0) {
 				io->io_hdr.flags &= ~CTL_FLAG_STATUS_QUEUED;
 
 				/*

Modified: head/sys/cam/scsi/scsi_all.h
==============================================================================
--- head/sys/cam/scsi/scsi_all.h	Tue Jul  8 16:31:59 2014	(r268417)
+++ head/sys/cam/scsi/scsi_all.h	Tue Jul  8 16:38:05 2014	(r268418)
@@ -630,15 +630,24 @@ struct scsi_control_page {
 #define	SCP_QUEUE_ALG_MASK		0xF0
 #define	SCP_QUEUE_ALG_RESTRICTED	0x00
 #define	SCP_QUEUE_ALG_UNRESTRICTED	0x10
+#define	SCP_NUAR			0x08	/*No UA on release*/
 #define	SCP_QUEUE_ERR			0x02	/*Queued I/O aborted for CACs*/
 #define	SCP_QUEUE_DQUE			0x01	/*Queued I/O disabled*/
 	u_int8_t eca_and_aen;
 #define	SCP_EECA			0x80	/*Enable Extended CA*/
+#define	SCP_RAC				0x40	/*Report a check*/
+#define	SCP_SWP				0x08	/*Software Write Protect*/
 #define	SCP_RAENP			0x04	/*Ready AEN Permission*/
 #define	SCP_UAAENP			0x02	/*UA AEN Permission*/
 #define	SCP_EAENP			0x01	/*Error AEN Permission*/
-	u_int8_t reserved;
+	u_int8_t flags4;
+#define	SCP_ATO				0x80	/*Application tag owner*/
+#define	SCP_TAS				0x40	/*Task aborted status*/
+#define	SCP_ATMPE			0x20	/*Application tag mode page*/
+#define	SCP_RWWP			0x10	/*Reject write without prot*/
 	u_int8_t aen_holdoff_period[2];
+	u_int8_t busy_timeout_period[2];
+	u_int8_t extended_selftest_completion_time[2];
 };
 
 struct scsi_cache_page {

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 16:56:21 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C858C392;
 Tue,  8 Jul 2014 16:56:21 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B56D028C7;
 Tue,  8 Jul 2014 16:56:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68GuLLm075330;
 Tue, 8 Jul 2014 16:56:21 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68GuLcS075328;
 Tue, 8 Jul 2014 16:56:21 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407081656.s68GuLcS075328@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 8 Jul 2014 16:56:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268419 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 16:56:21 -0000

Author: mav
Date: Tue Jul  8 16:56:21 2014
New Revision: 268419
URL: http://svnweb.freebsd.org/changeset/base/268419

Log:
  Fix use-after-free on XPT_RESET_BUS.
  
  That command is not queued, so does not use later status update.

Modified:
  head/sys/cam/ctl/ctl_frontend_cam_sim.c

Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_cam_sim.c	Tue Jul  8 16:38:05 2014	(r268418)
+++ head/sys/cam/ctl/ctl_frontend_cam_sim.c	Tue Jul  8 16:56:21 2014	(r268419)
@@ -460,6 +460,10 @@ cfcs_done(union ctl_io *io)
 	union ccb *ccb;
 
 	ccb = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr;
+	if (ccb == NULL) {
+		ctl_free_io(io);
+		return;
+	}
 
 	/*
 	 * At this point we should have status.  If we don't, that's a bug.
@@ -741,7 +745,8 @@ cfcs_action(struct cam_sim *sim, union c
 
 		ctl_zero_io(io);
 		/* Save pointers on both sides */
-		io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = ccb;
+		if (ccb->ccb_h.func_code == XPT_RESET_DEV)
+			io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = ccb;
 		ccb->ccb_h.io_ptr = io;
 
 		io->io_hdr.io_type = CTL_IO_TASK;

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 17:26:09 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 0C8A7B35;
 Tue,  8 Jul 2014 17:26:09 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id ED6FA2BA2;
 Tue,  8 Jul 2014 17:26:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68HQ85S089623;
 Tue, 8 Jul 2014 17:26:08 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68HQ8fb089622;
 Tue, 8 Jul 2014 17:26:08 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407081726.s68HQ8fb089622@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 8 Jul 2014 17:26:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268420 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 17:26:09 -0000

Author: mav
Date: Tue Jul  8 17:26:08 2014
New Revision: 268420
URL: http://svnweb.freebsd.org/changeset/base/268420

Log:
  Remove IO_SYNC flag when writing extended file attributes on ZFS.
  
  While it is possible to create and write file, modify its permissions, etc.
  without ever doing sync, it looks odd that it is required for setting
  extended file attributes on ZFS.  UFS does not do sync there too.
  
  Samba uses those extended attributes to store some its data, and doing it
  synchronously by many times reduces file creation performance for systems
  without SLOG device.
  
  Reviewed by:	delphij, jpaetzel, silence on fs@
  MFC after:	2 weeks
  Sponsored by:	iXsystems, Inc.

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Tue Jul  8 16:56:21 2014	(r268419)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Tue Jul  8 17:26:08 2014	(r268420)
@@ -6875,7 +6875,7 @@ vop_setextattr {
 	va.va_size = 0;
 	error = VOP_SETATTR(vp, &va, ap->a_cred);
 	if (error == 0)
-		VOP_WRITE(vp, ap->a_uio, IO_UNIT | IO_SYNC, ap->a_cred);
+		VOP_WRITE(vp, ap->a_uio, IO_UNIT, ap->a_cred);
 
 	VOP_UNLOCK(vp, 0);
 	vn_close(vp, flags, ap->a_cred, td);

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 18:51:04 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 73094FF;
 Tue,  8 Jul 2014 18:51:04 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 605162403;
 Tue,  8 Jul 2014 18:51:04 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68Ip4AQ028552;
 Tue, 8 Jul 2014 18:51:04 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68Ip4qg028551;
 Tue, 8 Jul 2014 18:51:04 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407081851.s68Ip4qg028551@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 8 Jul 2014 18:51:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268421 - head/sys/cam/ctl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 18:51:04 -0000

Author: mav
Date: Tue Jul  8 18:51:03 2014
New Revision: 268421
URL: http://svnweb.freebsd.org/changeset/base/268421

Log:
  Remove status setting from datamove() path.  Leave that to other places.

Modified:
  head/sys/cam/ctl/ctl.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Tue Jul  8 17:26:08 2014	(r268420)
+++ head/sys/cam/ctl/ctl.c	Tue Jul  8 18:51:03 2014	(r268421)
@@ -12506,7 +12506,6 @@ ctl_datamove(union ctl_io *io)
 		       io->io_hdr.nexus.targ_port,
 		       (uintmax_t)io->io_hdr.nexus.targ_target.id,
 		       io->io_hdr.nexus.targ_lun);
-		io->io_hdr.status = CTL_CMD_ABORTED;
 		io->io_hdr.port_status = 31337;
 		/*
 		 * Note that the backend, in this case, will get the
@@ -13262,24 +13261,18 @@ ctl_datamove_remote(union ctl_io *io)
 
 	/*
 	 * Note that we look for an aborted I/O here, but don't do some of
-	 * the other checks that ctl_datamove() normally does.  We don't
-	 * need to run the task queue, because this I/O is on the ISC
-	 * queue, which is executed by the work thread after the task queue.
+	 * the other checks that ctl_datamove() normally does.
 	 * We don't need to run the datamove delay code, since that should
 	 * have been done if need be on the other controller.
 	 */
 	if (io->io_hdr.flags & CTL_FLAG_ABORT) {
-
 		printf("%s: tag 0x%04x on (%d:%d:%d:%d) aborted\n", __func__,
 		       io->scsiio.tag_num, io->io_hdr.nexus.initid.id,
 		       io->io_hdr.nexus.targ_port,
 		       io->io_hdr.nexus.targ_target.id,
 		       io->io_hdr.nexus.targ_lun);
-		io->io_hdr.status = CTL_CMD_ABORTED;
 		io->io_hdr.port_status = 31338;
-
 		ctl_send_datamove_done(io, /*have_lock*/ 0);
-
 		return;
 	}
 

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 20:51:04 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 30804598;
 Tue,  8 Jul 2014 20:51:04 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 110C22FFE;
 Tue,  8 Jul 2014 20:51:04 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68Kp3w6087605;
 Tue, 8 Jul 2014 20:51:03 GMT (envelope-from neel@svn.freebsd.org)
Received: (from neel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68Kp3Ia087604;
 Tue, 8 Jul 2014 20:51:03 GMT (envelope-from neel@svn.freebsd.org)
Message-Id: <201407082051.s68Kp3Ia087604@svn.freebsd.org>
From: Neel Natu 
Date: Tue, 8 Jul 2014 20:51:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268427 - head/sys/amd64/vmm/intel
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 20:51:04 -0000

Author: neel
Date: Tue Jul  8 20:51:03 2014
New Revision: 268427
URL: http://svnweb.freebsd.org/changeset/base/268427

Log:
  Invalidate guest TLB mappings as a side-effect of its CR3 being updated.
  
  This is a pre-requisite for task switch emulation since the CR3 is loaded
  from the new TSS.

Modified:
  head/sys/amd64/vmm/intel/vmx.c

Modified: head/sys/amd64/vmm/intel/vmx.c
==============================================================================
--- head/sys/amd64/vmm/intel/vmx.c	Tue Jul  8 20:45:38 2014	(r268426)
+++ head/sys/amd64/vmm/intel/vmx.c	Tue Jul  8 20:51:03 2014	(r268427)
@@ -974,7 +974,7 @@ vmx_vminit(struct vm *vm, pmap_t pmap)
 		vmx->cap[i].proc_ctls = procbased_ctls;
 		vmx->cap[i].proc_ctls2 = procbased_ctls2;
 
-		vmx->state[i].lastcpu = -1;
+		vmx->state[i].lastcpu = NOCPU;
 		vmx->state[i].vpid = vpid[i];
 
 		msr_save_area_init(vmx->guest_msrs[i], &guest_msr_count);
@@ -1047,27 +1047,37 @@ vmx_astpending_trace(struct vmx *vmx, in
 }
 
 static VMM_STAT_INTEL(VCPU_INVVPID_SAVED, "Number of vpid invalidations saved");
+static VMM_STAT_INTEL(VCPU_INVVPID_DONE, "Number of vpid invalidations done");
 
-static void
-vmx_set_pcpu_defaults(struct vmx *vmx, int vcpu, pmap_t pmap)
+/*
+ * Invalidate guest mappings identified by its vpid from the TLB.
+ */
+static __inline void
+vmx_invvpid(struct vmx *vmx, int vcpu, pmap_t pmap, int running)
 {
 	struct vmxstate *vmxstate;
 	struct invvpid_desc invvpid_desc;
 
 	vmxstate = &vmx->state[vcpu];
-	if (vmxstate->lastcpu == curcpu)
+	if (vmxstate->vpid == 0)
 		return;
 
-	vmxstate->lastcpu = curcpu;
-
-	vmm_stat_incr(vmx->vm, vcpu, VCPU_MIGRATIONS, 1);
+	if (!running) {
+		/*
+		 * Set the 'lastcpu' to an invalid host cpu.
+		 *
+		 * This will invalidate TLB entries tagged with the vcpu's
+		 * vpid the next time it runs via vmx_set_pcpu_defaults().
+		 */
+		vmxstate->lastcpu = NOCPU;
+		return;
+	}
 
-	vmcs_write(VMCS_HOST_TR_BASE, vmm_get_host_trbase());
-	vmcs_write(VMCS_HOST_GDTR_BASE, vmm_get_host_gdtrbase());
-	vmcs_write(VMCS_HOST_GS_BASE, vmm_get_host_gsbase());
+	KASSERT(curthread->td_critnest > 0, ("%s: vcpu %d running outside "
+	    "critical section", __func__, vcpu));
 
 	/*
-	 * If we are using VPIDs then invalidate all mappings tagged with 'vpid'
+	 * Invalidate all mappings tagged with 'vpid'
 	 *
 	 * We do this because this vcpu was executing on a different host
 	 * cpu when it last ran. We do not track whether it invalidated
@@ -1081,25 +1091,43 @@ vmx_set_pcpu_defaults(struct vmx *vmx, i
 	 * Note also that this will invalidate mappings tagged with 'vpid'
 	 * for "all" EP4TAs.
 	 */
-	if (vmxstate->vpid != 0) {
-		if (pmap->pm_eptgen == vmx->eptgen[curcpu]) {
-			invvpid_desc._res1 = 0;
-			invvpid_desc._res2 = 0;
-			invvpid_desc.vpid = vmxstate->vpid;
-			invvpid_desc.linear_addr = 0;
-			invvpid(INVVPID_TYPE_SINGLE_CONTEXT, invvpid_desc);
-		} else {
-			/*
-			 * The invvpid can be skipped if an invept is going to
-			 * be performed before entering the guest. The invept
-			 * will invalidate combined mappings tagged with
-			 * 'vmx->eptp' for all vpids.
-			 */
-			vmm_stat_incr(vmx->vm, vcpu, VCPU_INVVPID_SAVED, 1);
-		}
+	if (pmap->pm_eptgen == vmx->eptgen[curcpu]) {
+		invvpid_desc._res1 = 0;
+		invvpid_desc._res2 = 0;
+		invvpid_desc.vpid = vmxstate->vpid;
+		invvpid_desc.linear_addr = 0;
+		invvpid(INVVPID_TYPE_SINGLE_CONTEXT, invvpid_desc);
+		vmm_stat_incr(vmx->vm, vcpu, VCPU_INVVPID_DONE, 1);
+	} else {
+		/*
+		 * The invvpid can be skipped if an invept is going to
+		 * be performed before entering the guest. The invept
+		 * will invalidate combined mappings tagged with
+		 * 'vmx->eptp' for all vpids.
+		 */
+		vmm_stat_incr(vmx->vm, vcpu, VCPU_INVVPID_SAVED, 1);
 	}
 }
 
+static void
+vmx_set_pcpu_defaults(struct vmx *vmx, int vcpu, pmap_t pmap)
+{
+	struct vmxstate *vmxstate;
+
+	vmxstate = &vmx->state[vcpu];
+	if (vmxstate->lastcpu == curcpu)
+		return;
+
+	vmxstate->lastcpu = curcpu;
+
+	vmm_stat_incr(vmx->vm, vcpu, VCPU_MIGRATIONS, 1);
+
+	vmcs_write(VMCS_HOST_TR_BASE, vmm_get_host_trbase());
+	vmcs_write(VMCS_HOST_GDTR_BASE, vmm_get_host_gdtrbase());
+	vmcs_write(VMCS_HOST_GS_BASE, vmm_get_host_gsbase());
+	vmx_invvpid(vmx, vcpu, pmap, 1);
+}
+
 /*
  * We depend on 'procbased_ctls' to have the Interrupt Window Exiting bit set.
  */
@@ -2584,6 +2612,7 @@ vmx_setreg(void *arg, int vcpu, int reg,
 {
 	int error, hostcpu, running, shadow;
 	uint64_t ctls;
+	pmap_t pmap;
 	struct vmx *vmx = arg;
 
 	running = vcpu_is_running(vmx->vm, vcpu, &hostcpu);
@@ -2621,6 +2650,18 @@ vmx_setreg(void *arg, int vcpu, int reg,
 			error = vmcs_setreg(&vmx->vmcs[vcpu], running,
 				    VMCS_IDENT(shadow), val);
 		}
+
+		if (reg == VM_REG_GUEST_CR3) {
+			/*
+			 * Invalidate the guest vcpu's TLB mappings to emulate
+			 * the behavior of updating %cr3.
+			 *
+			 * XXX the processor retains global mappings when %cr3
+			 * is updated but vmx_invvpid() does not.
+			 */
+			pmap = vmx->ctx[vcpu].pmap;
+			vmx_invvpid(vmx, vcpu, pmap, running);
+		}
 	}
 
 	return (error);

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 21:48:58 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 99B0E994;
 Tue,  8 Jul 2014 21:48:58 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 86DAE24F9;
 Tue,  8 Jul 2014 21:48:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68LmwPa014764;
 Tue, 8 Jul 2014 21:48:58 GMT (envelope-from neel@svn.freebsd.org)
Received: (from neel@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68LmwcJ014762;
 Tue, 8 Jul 2014 21:48:58 GMT (envelope-from neel@svn.freebsd.org)
Message-Id: <201407082148.s68LmwcJ014762@svn.freebsd.org>
From: Neel Natu 
Date: Tue, 8 Jul 2014 21:48:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268428 - in head/sys/amd64: include vmm/intel
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 21:48:58 -0000

Author: neel
Date: Tue Jul  8 21:48:57 2014
New Revision: 268428
URL: http://svnweb.freebsd.org/changeset/base/268428

Log:
  Accurately identify the vcpu's operating mode as 64-bit, compatibility,
  protected or real.

Modified:
  head/sys/amd64/include/vmm.h
  head/sys/amd64/vmm/intel/vmx.c

Modified: head/sys/amd64/include/vmm.h
==============================================================================
--- head/sys/amd64/include/vmm.h	Tue Jul  8 20:51:03 2014	(r268427)
+++ head/sys/amd64/include/vmm.h	Tue Jul  8 21:48:57 2014	(r268428)
@@ -329,6 +329,8 @@ struct seg_desc {
 #define	SEG_DESC_UNUSABLE(desc)		((desc)->access & 0x10000)
 
 enum vm_cpu_mode {
+	CPU_MODE_REAL,
+	CPU_MODE_PROTECTED,
 	CPU_MODE_COMPATIBILITY,		/* IA-32E mode (CS.L = 0) */
 	CPU_MODE_64BIT,			/* IA-32E mode (CS.L = 1) */
 };

Modified: head/sys/amd64/vmm/intel/vmx.c
==============================================================================
--- head/sys/amd64/vmm/intel/vmx.c	Tue Jul  8 20:51:03 2014	(r268427)
+++ head/sys/amd64/vmm/intel/vmx.c	Tue Jul  8 21:48:57 2014	(r268428)
@@ -1687,11 +1687,19 @@ vmx_cpl(void)
 static enum vm_cpu_mode
 vmx_cpu_mode(void)
 {
+	uint32_t csar;
 
-	if (vmcs_read(VMCS_GUEST_IA32_EFER) & EFER_LMA)
-		return (CPU_MODE_64BIT);
-	else
-		return (CPU_MODE_COMPATIBILITY);
+	if (vmcs_read(VMCS_GUEST_IA32_EFER) & EFER_LMA) {
+		csar = vmcs_read(VMCS_GUEST_CS_ACCESS_RIGHTS);
+		if (csar & 0x2000)
+			return (CPU_MODE_64BIT);	/* CS.L = 1 */
+		else
+			return (CPU_MODE_COMPATIBILITY);
+	} else if (vmcs_read(VMCS_GUEST_CR0) & CR0_PE) {
+		return (CPU_MODE_PROTECTED);
+	} else {
+		return (CPU_MODE_REAL);
+	}
 }
 
 static enum vm_paging_mode

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 21:50:14 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4AE9DAF4;
 Tue,  8 Jul 2014 21:50:14 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 383FB2505;
 Tue,  8 Jul 2014 21:50:14 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68LoEZA015055;
 Tue, 8 Jul 2014 21:50:14 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68LoDSw015053;
 Tue, 8 Jul 2014 21:50:13 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201407082150.s68LoDSw015053@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Tue, 8 Jul 2014 21:50:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268429 - in head: bin/sh/tests/builtins tools/build/mk
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 21:50:14 -0000

Author: jilles
Date: Tue Jul  8 21:50:13 2014
New Revision: 268429
URL: http://svnweb.freebsd.org/changeset/base/268429

Log:
  Don't install locale1.0 if MK_NLS == no.
  
  The test locale1.0 depends on locale support; it is meaningless without a
  working LC_MESSAGES.
  
  I added an OptionalObsoleteFiles.inc entry.
  
  PR:		181151
  Submitted by:	Garrett Cooper (original version)
  MFC after:	1 week
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/bin/sh/tests/builtins/Makefile
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/bin/sh/tests/builtins/Makefile
==============================================================================
--- head/bin/sh/tests/builtins/Makefile	Tue Jul  8 21:48:57 2014	(r268428)
+++ head/bin/sh/tests/builtins/Makefile	Tue Jul  8 21:50:13 2014	(r268429)
@@ -99,7 +99,9 @@ FILES+=		local1.0
 FILES+=		local2.0
 FILES+=		local3.0
 FILES+=		local4.0
+.if ${MK_NLS} != "no"
 FILES+=		locale1.0
+.endif
 FILES+=		printf1.0
 FILES+=		printf2.0
 FILES+=		printf3.0

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==============================================================================
--- head/tools/build/mk/OptionalObsoleteFiles.inc	Tue Jul  8 21:48:57 2014	(r268428)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc	Tue Jul  8 21:50:13 2014	(r268429)
@@ -3382,9 +3382,10 @@ OLD_FILES+=var/yp/Makefile
 OLD_FILES+=var/yp/Makefile.dist
 .endif
 
-#.if ${MK_NLS} == no
+.if ${MK_NLS} == no
+OLD_FILES+=usr/tests/bin/sh/builtins/locale1.0
 # to be filled in
-#.endif
+.endif
 
 .if ${MK_NTP} == no
 OLD_FILES+=etc/ntp.conf

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 21:54:24 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1ABDD19D;
 Tue,  8 Jul 2014 21:54:24 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 084E325DC;
 Tue,  8 Jul 2014 21:54:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68LsNMA018907;
 Tue, 8 Jul 2014 21:54:23 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68LsNIo018906;
 Tue, 8 Jul 2014 21:54:23 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201407082154.s68LsNIo018906@svn.freebsd.org>
From: Xin LI 
Date: Tue, 8 Jul 2014 21:54:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268430 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 21:54:24 -0000

Author: delphij
Date: Tue Jul  8 21:54:23 2014
New Revision: 268430
URL: http://svnweb.freebsd.org/changeset/base/268430

Log:
  Don't leave the padding between the msg header and the cmsg data,
  and the padding after the cmsg data un-initialized.
  
  Submitted by:	tuexen
  Security:	CVE-2014-3952
  Security:	FreeBSD-SA-14:17.kmem

Modified:
  head/sys/kern/uipc_sockbuf.c

Modified: head/sys/kern/uipc_sockbuf.c
==============================================================================
--- head/sys/kern/uipc_sockbuf.c	Tue Jul  8 21:50:13 2014	(r268429)
+++ head/sys/kern/uipc_sockbuf.c	Tue Jul  8 21:54:23 2014	(r268430)
@@ -1071,6 +1071,11 @@ sbcreatecontrol(caddr_t p, int size, int
 	m->m_len = 0;
 	KASSERT(CMSG_SPACE((u_int)size) <= M_TRAILINGSPACE(m),
 	    ("sbcreatecontrol: short mbuf"));
+	/*
+	 * Don't leave the padding between the msg header and the
+	 * cmsg data and the padding after the cmsg data un-initialized.
+	 */
+	bzero(cp, CMSG_SPACE((u_int)size));
 	if (p != NULL)
 		(void)memcpy(CMSG_DATA(cp), p, size);
 	m->m_len = CMSG_SPACE(size);

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 21:54:28 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D98592D7;
 Tue,  8 Jul 2014 21:54:28 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C653F25DD;
 Tue,  8 Jul 2014 21:54:28 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68LsSdj018966;
 Tue, 8 Jul 2014 21:54:28 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68LsSAZ018962;
 Tue, 8 Jul 2014 21:54:28 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201407082154.s68LsSAZ018962@svn.freebsd.org>
From: Xin LI 
Date: Tue, 8 Jul 2014 21:54:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268431 - head/sys/netinet
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 21:54:28 -0000

Author: delphij
Date: Tue Jul  8 21:54:27 2014
New Revision: 268431
URL: http://svnweb.freebsd.org/changeset/base/268431

Log:
  Initialize SCTP cmsg's and notification's buffer before copying out
  to userland.
  
  Submitted by:	tuexen
  Security:	CVE-2014-3953
  Security:	FreeBSD-SA-14:17.kmem

Modified:
  head/sys/netinet/sctp_auth.c
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctp_auth.c
==============================================================================
--- head/sys/netinet/sctp_auth.c	Tue Jul  8 21:54:23 2014	(r268430)
+++ head/sys/netinet/sctp_auth.c	Tue Jul  8 21:54:27 2014	(r268431)
@@ -1790,6 +1790,7 @@ sctp_notify_authentication(struct sctp_t
 
 	SCTP_BUF_LEN(m_notify) = 0;
 	auth = mtod(m_notify, struct sctp_authkey_event *);
+	memset(auth, 0, sizeof(struct sctp_authkey_event));
 	auth->auth_type = SCTP_AUTHENTICATION_EVENT;
 	auth->auth_flags = 0;
 	auth->auth_length = sizeof(*auth);

Modified: head/sys/netinet/sctp_indata.c
==============================================================================
--- head/sys/netinet/sctp_indata.c	Tue Jul  8 21:54:23 2014	(r268430)
+++ head/sys/netinet/sctp_indata.c	Tue Jul  8 21:54:27 2014	(r268431)
@@ -250,6 +250,11 @@ sctp_build_ctl_nchunk(struct sctp_inpcb 
 
 	/* We need a CMSG header followed by the struct */
 	cmh = mtod(ret, struct cmsghdr *);
+	/*
+	 * Make sure that there is no un-initialized padding between the
+	 * cmsg header and cmsg data and after the cmsg data.
+	 */
+	memset(cmh, 0, len);
 	if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO)) {
 		cmh->cmsg_level = IPPROTO_SCTP;
 		cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_rcvinfo));

Modified: head/sys/netinet/sctputil.c
==============================================================================
--- head/sys/netinet/sctputil.c	Tue Jul  8 21:54:23 2014	(r268430)
+++ head/sys/netinet/sctputil.c	Tue Jul  8 21:54:27 2014	(r268431)
@@ -2622,6 +2622,7 @@ sctp_notify_assoc_change(uint16_t state,
 		}
 		SCTP_BUF_NEXT(m_notify) = NULL;
 		sac = mtod(m_notify, struct sctp_assoc_change *);
+		memset(sac, 0, notif_len);
 		sac->sac_type = SCTP_ASSOC_CHANGE;
 		sac->sac_flags = 0;
 		sac->sac_length = sizeof(struct sctp_assoc_change);
@@ -2835,21 +2836,21 @@ sctp_notify_send_failed(struct sctp_tcb 
 	if (m_notify == NULL)
 		/* no space left */
 		return;
-	length += chk->send_size;
-	length -= sizeof(struct sctp_data_chunk);
 	SCTP_BUF_LEN(m_notify) = 0;
 	if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) {
 		ssfe = mtod(m_notify, struct sctp_send_failed_event *);
+		memset(ssfe, 0, length);
 		ssfe->ssfe_type = SCTP_SEND_FAILED_EVENT;
 		if (sent) {
 			ssfe->ssfe_flags = SCTP_DATA_SENT;
 		} else {
 			ssfe->ssfe_flags = SCTP_DATA_UNSENT;
 		}
+		length += chk->send_size;
+		length -= sizeof(struct sctp_data_chunk);
 		ssfe->ssfe_length = length;
 		ssfe->ssfe_error = error;
 		/* not exactly what the user sent in, but should be close :) */
-		bzero(&ssfe->ssfe_info, sizeof(ssfe->ssfe_info));
 		ssfe->ssfe_info.snd_sid = chk->rec.data.stream_number;
 		ssfe->ssfe_info.snd_flags = chk->rec.data.rcv_flags;
 		ssfe->ssfe_info.snd_ppid = chk->rec.data.payloadtype;
@@ -2859,12 +2860,15 @@ sctp_notify_send_failed(struct sctp_tcb 
 		SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_send_failed_event);
 	} else {
 		ssf = mtod(m_notify, struct sctp_send_failed *);
+		memset(ssf, 0, length);
 		ssf->ssf_type = SCTP_SEND_FAILED;
 		if (sent) {
 			ssf->ssf_flags = SCTP_DATA_SENT;
 		} else {
 			ssf->ssf_flags = SCTP_DATA_UNSENT;
 		}
+		length += chk->send_size;
+		length -= sizeof(struct sctp_data_chunk);
 		ssf->ssf_length = length;
 		ssf->ssf_error = error;
 		/* not exactly what the user sent in, but should be close :) */
@@ -2948,16 +2952,16 @@ sctp_notify_send_failed2(struct sctp_tcb
 		/* no space left */
 		return;
 	}
-	length += sp->length;
 	SCTP_BUF_LEN(m_notify) = 0;
 	if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) {
 		ssfe = mtod(m_notify, struct sctp_send_failed_event *);
+		memset(ssfe, 0, length);
 		ssfe->ssfe_type = SCTP_SEND_FAILED_EVENT;
 		ssfe->ssfe_flags = SCTP_DATA_UNSENT;
+		length += sp->length;
 		ssfe->ssfe_length = length;
 		ssfe->ssfe_error = error;
 		/* not exactly what the user sent in, but should be close :) */
-		bzero(&ssfe->ssfe_info, sizeof(ssfe->ssfe_info));
 		ssfe->ssfe_info.snd_sid = sp->stream;
 		if (sp->some_taken) {
 			ssfe->ssfe_info.snd_flags = SCTP_DATA_LAST_FRAG;
@@ -2971,12 +2975,13 @@ sctp_notify_send_failed2(struct sctp_tcb
 		SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_send_failed_event);
 	} else {
 		ssf = mtod(m_notify, struct sctp_send_failed *);
+		memset(ssf, 0, length);
 		ssf->ssf_type = SCTP_SEND_FAILED;
 		ssf->ssf_flags = SCTP_DATA_UNSENT;
+		length += sp->length;
 		ssf->ssf_length = length;
 		ssf->ssf_error = error;
 		/* not exactly what the user sent in, but should be close :) */
-		bzero(&ssf->ssf_info, sizeof(ssf->ssf_info));
 		ssf->ssf_info.sinfo_stream = sp->stream;
 		ssf->ssf_info.sinfo_ssn = 0;
 		if (sp->some_taken) {
@@ -3038,6 +3043,7 @@ sctp_notify_adaptation_layer(struct sctp
 		return;
 	SCTP_BUF_LEN(m_notify) = 0;
 	sai = mtod(m_notify, struct sctp_adaptation_event *);
+	memset(sai, 0, sizeof(struct sctp_adaptation_event));
 	sai->sai_type = SCTP_ADAPTATION_INDICATION;
 	sai->sai_flags = 0;
 	sai->sai_length = sizeof(struct sctp_adaptation_event);
@@ -3093,6 +3099,7 @@ sctp_notify_partial_delivery_indication(
 		return;
 	SCTP_BUF_LEN(m_notify) = 0;
 	pdapi = mtod(m_notify, struct sctp_pdapi_event *);
+	memset(pdapi, 0, sizeof(struct sctp_pdapi_event));
 	pdapi->pdapi_type = SCTP_PARTIAL_DELIVERY_EVENT;
 	pdapi->pdapi_flags = 0;
 	pdapi->pdapi_length = sizeof(struct sctp_pdapi_event);
@@ -3202,6 +3209,7 @@ sctp_notify_shutdown_event(struct sctp_t
 		/* no space left */
 		return;
 	sse = mtod(m_notify, struct sctp_shutdown_event *);
+	memset(sse, 0, sizeof(struct sctp_shutdown_event));
 	sse->sse_type = SCTP_SHUTDOWN_EVENT;
 	sse->sse_flags = 0;
 	sse->sse_length = sizeof(struct sctp_shutdown_event);
@@ -3252,6 +3260,7 @@ sctp_notify_sender_dry_event(struct sctp
 	}
 	SCTP_BUF_LEN(m_notify) = 0;
 	event = mtod(m_notify, struct sctp_sender_dry_event *);
+	memset(event, 0, sizeof(struct sctp_sender_dry_event));
 	event->sender_dry_type = SCTP_SENDER_DRY_EVENT;
 	event->sender_dry_flags = 0;
 	event->sender_dry_length = sizeof(struct sctp_sender_dry_event);
@@ -3284,7 +3293,6 @@ sctp_notify_stream_reset_add(struct sctp
 	struct mbuf *m_notify;
 	struct sctp_queued_to_read *control;
 	struct sctp_stream_change_event *stradd;
-	int len;
 
 	if ((stcb == NULL) ||
 	    (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_STREAM_CHANGEEVNT))) {
@@ -3297,25 +3305,20 @@ sctp_notify_stream_reset_add(struct sctp
 		return;
 	}
 	stcb->asoc.peer_req_out = 0;
-	m_notify = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA);
+	m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_stream_change_event), 0, M_NOWAIT, 1, MT_DATA);
 	if (m_notify == NULL)
 		/* no space left */
 		return;
 	SCTP_BUF_LEN(m_notify) = 0;
-	len = sizeof(struct sctp_stream_change_event);
-	if (len > M_TRAILINGSPACE(m_notify)) {
-		/* never enough room */
-		sctp_m_freem(m_notify);
-		return;
-	}
 	stradd = mtod(m_notify, struct sctp_stream_change_event *);
+	memset(stradd, 0, sizeof(struct sctp_stream_change_event));
 	stradd->strchange_type = SCTP_STREAM_CHANGE_EVENT;
 	stradd->strchange_flags = flag;
-	stradd->strchange_length = len;
+	stradd->strchange_length = sizeof(struct sctp_stream_change_event);
 	stradd->strchange_assoc_id = sctp_get_associd(stcb);
 	stradd->strchange_instrms = numberin;
 	stradd->strchange_outstrms = numberout;
-	SCTP_BUF_LEN(m_notify) = len;
+	SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_stream_change_event);
 	SCTP_BUF_NEXT(m_notify) = NULL;
 	if (sctp_sbspace(&stcb->asoc, &stcb->sctp_socket->so_rcv) < SCTP_BUF_LEN(m_notify)) {
 		/* no space */
@@ -3346,32 +3349,26 @@ sctp_notify_stream_reset_tsn(struct sctp
 	struct mbuf *m_notify;
 	struct sctp_queued_to_read *control;
 	struct sctp_assoc_reset_event *strasoc;
-	int len;
 
 	if ((stcb == NULL) ||
 	    (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_ASSOC_RESETEVNT))) {
 		/* event not enabled */
 		return;
 	}
-	m_notify = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA);
+	m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_assoc_reset_event), 0, M_NOWAIT, 1, MT_DATA);
 	if (m_notify == NULL)
 		/* no space left */
 		return;
 	SCTP_BUF_LEN(m_notify) = 0;
-	len = sizeof(struct sctp_assoc_reset_event);
-	if (len > M_TRAILINGSPACE(m_notify)) {
-		/* never enough room */
-		sctp_m_freem(m_notify);
-		return;
-	}
 	strasoc = mtod(m_notify, struct sctp_assoc_reset_event *);
+	memset(strasoc, 0, sizeof(struct sctp_assoc_reset_event));
 	strasoc->assocreset_type = SCTP_ASSOC_RESET_EVENT;
 	strasoc->assocreset_flags = flag;
-	strasoc->assocreset_length = len;
+	strasoc->assocreset_length = sizeof(struct sctp_assoc_reset_event);
 	strasoc->assocreset_assoc_id = sctp_get_associd(stcb);
 	strasoc->assocreset_local_tsn = sending_tsn;
 	strasoc->assocreset_remote_tsn = recv_tsn;
-	SCTP_BUF_LEN(m_notify) = len;
+	SCTP_BUF_LEN(m_notify) = sizeof(struct sctp_assoc_reset_event);
 	SCTP_BUF_NEXT(m_notify) = NULL;
 	if (sctp_sbspace(&stcb->asoc, &stcb->sctp_socket->so_rcv) < SCTP_BUF_LEN(m_notify)) {
 		/* no space */
@@ -3424,6 +3421,7 @@ sctp_notify_stream_reset(struct sctp_tcb
 		return;
 	}
 	strreset = mtod(m_notify, struct sctp_stream_reset_event *);
+	memset(strreset, 0, len);
 	strreset->strreset_type = SCTP_STREAM_RESET_EVENT;
 	strreset->strreset_flags = flag;
 	strreset->strreset_length = len;
@@ -6236,9 +6234,12 @@ sctp_soreceive(struct socket *so,
 		fromlen = 0;
 	}
 
+	if (filling_sinfo) {
+		memset(&sinfo, 0, sizeof(struct sctp_extrcvinfo));
+	}
 	error = sctp_sorecvmsg(so, uio, mp0, from, fromlen, flagsp,
 	    (struct sctp_sndrcvinfo *)&sinfo, filling_sinfo);
-	if ((controlp) && (filling_sinfo)) {
+	if (controlp != NULL) {
 		/* copy back the sinfo in a CMSG format */
 		if (filling_sinfo)
 			*controlp = sctp_build_ctl_nchunk(inp,

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 22:04:44 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E7BA1E8C;
 Tue,  8 Jul 2014 22:04:44 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id D510026D8;
 Tue,  8 Jul 2014 22:04:44 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68M4iJu024632;
 Tue, 8 Jul 2014 22:04:44 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68M4igR024629;
 Tue, 8 Jul 2014 22:04:44 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201407082204.s68M4igR024629@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Tue, 8 Jul 2014 22:04:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268436 - head/bin/sh/tests/parameters
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 22:04:45 -0000

Author: jilles
Date: Tue Jul  8 22:04:44 2014
New Revision: 268436
URL: http://svnweb.freebsd.org/changeset/base/268436

Log:
  sh: Add test for ${01} and ${010} that already works.
  
  Although it is probably unwise to use this, POSIX is clear that leading
  zeroes are permitted in positional parameters (and do not indicate octal).
  
  Such positional parameters are checked for being unset and/or null
  correctly, but their value is incorrectly expanded.

Added:
  head/bin/sh/tests/parameters/positional3.0   (contents, props changed)
Modified:
  head/bin/sh/tests/parameters/Makefile

Modified: head/bin/sh/tests/parameters/Makefile
==============================================================================
--- head/bin/sh/tests/parameters/Makefile	Tue Jul  8 21:55:39 2014	(r268435)
+++ head/bin/sh/tests/parameters/Makefile	Tue Jul  8 22:04:44 2014	(r268436)
@@ -13,6 +13,7 @@ FILES+=		optind1.0
 FILES+=		optind2.0
 FILES+=		positional1.0
 FILES+=		positional2.0
+FILES+=		positional3.0
 FILES+=		pwd1.0
 FILES+=		pwd2.0
 

Added: head/bin/sh/tests/parameters/positional3.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/bin/sh/tests/parameters/positional3.0	Tue Jul  8 22:04:44 2014	(r268436)
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+r=$(${SH} -c 'echo ${01:+yes}${010:+yes}' '' a '' '' '' '' '' '' '' '' b)
+[ "$r" = yesyes ]

From owner-svn-src-head@FreeBSD.ORG  Tue Jul  8 22:27:56 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 85D441F7;
 Tue,  8 Jul 2014 22:27:56 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 70F1928E1;
 Tue,  8 Jul 2014 22:27:56 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s68MRu3Y036176;
 Tue, 8 Jul 2014 22:27:56 GMT (envelope-from sjg@svn.freebsd.org)
Received: (from sjg@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s68MRoYK036143;
 Tue, 8 Jul 2014 22:27:50 GMT (envelope-from sjg@svn.freebsd.org)
Message-Id: <201407082227.s68MRoYK036143@svn.freebsd.org>
From: "Simon J. Gerraty" 
Date: Tue, 8 Jul 2014 22:27:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268437 - in head: contrib/bmake contrib/bmake/mk
 contrib/bmake/mk/sys usr.bin/bmake
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 08 Jul 2014 22:27:56 -0000

Author: sjg
Date: Tue Jul  8 22:27:50 2014
New Revision: 268437
URL: http://svnweb.freebsd.org/changeset/base/268437

Log:
  Update to bmake-20140620
  Main change is detection of malformed variable references.
  
  Reviewed by:	obrien

Modified:
  head/contrib/bmake/ChangeLog
  head/contrib/bmake/Makefile
  head/contrib/bmake/README
  head/contrib/bmake/bmake.1
  head/contrib/bmake/bmake.cat1
  head/contrib/bmake/boot-strap
  head/contrib/bmake/bsd.after-import.mk
  head/contrib/bmake/config.h.in
  head/contrib/bmake/configure
  head/contrib/bmake/configure.in
  head/contrib/bmake/main.c
  head/contrib/bmake/make.1
  head/contrib/bmake/mk/ChangeLog
  head/contrib/bmake/mk/autodep.mk
  head/contrib/bmake/mk/dirdeps.mk
  head/contrib/bmake/mk/dpadd.mk
  head/contrib/bmake/mk/gendirdeps.mk
  head/contrib/bmake/mk/host-target.mk
  head/contrib/bmake/mk/install-mk
  head/contrib/bmake/mk/lib.mk
  head/contrib/bmake/mk/meta.autodep.mk
  head/contrib/bmake/mk/meta2deps.py
  head/contrib/bmake/mk/meta2deps.sh
  head/contrib/bmake/mk/options.mk
  head/contrib/bmake/mk/rst2htm.mk
  head/contrib/bmake/mk/sys.mk
  head/contrib/bmake/mk/sys/SunOS.mk
  head/contrib/bmake/mk/target-flags.mk
  head/contrib/bmake/mk/warnings.mk
  head/contrib/bmake/os.sh
  head/contrib/bmake/parse.c
  head/contrib/bmake/str.c
  head/contrib/bmake/var.c
  head/usr.bin/bmake/Makefile
  head/usr.bin/bmake/config.h
Directory Properties:
  head/contrib/bmake/   (props changed)

Modified: head/contrib/bmake/ChangeLog
==============================================================================
--- head/contrib/bmake/ChangeLog	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/ChangeLog	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,3 +1,28 @@
+2014-06-20  Simon J. Gerraty  
+
+	* Makefile (MAKE_VERSION): 20140620
+	  Merge with NetBSD make, pick up
+	  o var.c return varNoError rather than var_Error for ::= modidiers.
+
+2014-05-22  Simon J. Gerraty  
+
+	* Makefile (MAKE_VERSION): 20140522
+	  Merge with NetBSD make, pick up
+	  o var.c detect some parse errors.
+
+2014-04-05  Simon J. Gerraty  
+
+	* Fix spelling errors - patch from Pedro Giffuni
+
+2014-02-14  Simon J. Gerraty  
+
+	* Makefile (MAKE_VERSION): 20140214
+	  Merge with NetBSD make, pick up
+	  o .INCLUDEFROM*
+	  o use Var_Value to get MAKEOBJDIR[PREFIX]
+	  o reduced realloc'ign in brk_string.
+	* configure.in: add a check for compiler supporting __func__
+
 2014-01-03  Simon J. Gerraty  
 
 	* boot-strap: ignore mksrc=none
@@ -64,7 +89,7 @@
 
 	* Makefile (MAKE_VERSION): 20130716
 	  Merge with NetBSD make, pick up
-	  o number of gmake compatability tweaks
+	  o number of gmake compatibility tweaks
 	    -w for gmake style entering/leaving messages
 	    if .MAKE.LEVEL > 0 indicate it in progname "make[1]" etc.
 	    handle MAKEFLAGS containing only letters.

Modified: head/contrib/bmake/Makefile
==============================================================================
--- head/contrib/bmake/Makefile	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/Makefile	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,7 +1,7 @@
-#	$Id: Makefile,v 1.23 2014/01/02 22:20:52 sjg Exp $
+#	$Id: Makefile,v 1.27 2014/06/20 14:51:54 sjg Exp $
 
 # Base version on src date
-MAKE_VERSION= 20140101
+MAKE_VERSION= 20140620
 
 PROG=	bmake
 
@@ -117,7 +117,7 @@ MANTARGET?= man
 # turn this on by default - ignored if we are root
 WITH_INSTALL_AS_USER=
 
-# supress with -DWITHOUT_*
+# suppress with -DWITHOUT_*
 OPTIONS_DEFAULT_YES+= \
 	AUTOCONF_MK \
 	INSTALL_MK \

Modified: head/contrib/bmake/README
==============================================================================
--- head/contrib/bmake/README	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/README	Tue Jul  8 22:27:50 2014	(r268437)
@@ -18,7 +18,7 @@ interesting changes, so that bmake track
 
 Building:
 
-The prefered way to bootstrap bmake is:
+The preferred way to bootstrap bmake is:
 
 ./bmake/boot-strap
 

Modified: head/contrib/bmake/bmake.1
==============================================================================
--- head/contrib/bmake/bmake.1	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/bmake.1	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.226 2013/11/07 18:50:46 dholland Exp $
+.\"	$NetBSD: make.1,v 1.229 2014/01/19 10:23:29 apb Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	from: @(#)make.1	8.4 (Berkeley) 3/19/94
 .\"
-.Dd October 25, 2013
+.Dd February 14, 2014
 .Dt MAKE 1
 .Os
 .Sh NAME
@@ -706,6 +706,10 @@ was executed.
 Refer to the description of
 .Ql Ev PWD
 for more details.
+.It Va .INCLUDEDFROMDIR
+The directory of the file this Makefile was included from.
+.It Va .INCLUDEDFROMFILE
+The filename of the file this Makefile was included from.
 .It Ev MAKE
 The name that
 .Nm
@@ -1246,6 +1250,15 @@ and
 are orthogonal; the former specifies whether multiple words are
 potentially affected, the latter whether multiple substitutions can
 potentially occur within each affected word.
+.Pp
+As for the
+.Cm \&:S
+modifier, the
+.Ar pattern
+and
+.Ar replacement
+are subjected to variable expansion before being parsed as
+regular expressions.
 .It Cm \&:T
 Replaces each word in the variable with its last component.
 .It Cm \&:u

Modified: head/contrib/bmake/bmake.cat1
==============================================================================
--- head/contrib/bmake/bmake.cat1	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/bmake.cat1	Tue Jul  8 22:27:50 2014	(r268437)
@@ -450,6 +450,13 @@ VVAARRIIAABBLLEE AASSSSIIGG
      _._C_U_R_D_I_R         A path to the directory where bbmmaakkee was executed.  Refer
                      to the description of `PWD' for more details.
 
+     _._I_N_C_L_U_D_E_D_F_R_O_M_D_I_R
+                     The directory of the file this Makefile was included
+                     from.
+
+     _._I_N_C_L_U_D_E_D_F_R_O_M_F_I_L_E
+                     The filename of the file this Makefile was included from.
+
      MAKE            The name that bbmmaakkee was executed with (_a_r_g_v_[_0_]).  For
                      compatibility bbmmaakkee also sets _._M_A_K_E with the same value.
                      The preferred variable to use is the environment variable
@@ -796,6 +803,9 @@ VVAARRIIAABBLLEE AASSSSIIGG
           multiple words are potentially affected, the latter whether multiple
           substitutions can potentially occur within each affected word.
 
+          As for the ::SS modifier, the _p_a_t_t_e_r_n and _r_e_p_l_a_c_e_m_e_n_t are subjected to
+          variable expansion before being parsed as regular expressions.
+
      ::TT   Replaces each word in the variable with its last component.
 
      ::uu   Remove adjacent duplicate words (like uniq(1)).
@@ -1384,4 +1394,4 @@ BBUUGGSS
 
      There is no way of escaping a space character in a filename.
 
-NetBSD 5.1                     October 25, 2013                     NetBSD 5.1
+NetBSD 5.1                     February 14, 2014                    NetBSD 5.1

Modified: head/contrib/bmake/boot-strap
==============================================================================
--- head/contrib/bmake/boot-strap	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/boot-strap	Tue Jul  8 22:27:50 2014	(r268437)
@@ -111,7 +111,7 @@
 #	Simon J. Gerraty 
 
 # RCSid:
-#	$Id: boot-strap,v 1.44 2014/01/08 14:49:10 sjg Exp $
+#	$Id: boot-strap,v 1.45 2014/04/05 22:56:54 sjg Exp $
 #
 #	@(#) Copyright (c) 2001 Simon J. Gerraty
 #
@@ -197,7 +197,7 @@ get_optarg() {
 
 here=`'pwd'`
 if [ $here = $Mydir ]; then
-   # avoid polution
+   # avoid pollution
    OBJROOT=../
 fi
 
@@ -453,7 +453,7 @@ op_all() {
 		echo "Use --install-destdir=/somewhere to set DESTDIR during install"
 		echo "Use --install-host-target to use INSTALL_BIN=$HOST_TARGET/bin"
 		echo "Use -DWITH_PROG_VERSION to install as bmake-$MAKE_VERSION"
-		echo "Use -DWITHOUT_PROG_LINK to supress bmake -> bmake-$MAKE_VERSION symlink"
+		echo "Use -DWITHOUT_PROG_LINK to suppress bmake -> bmake-$MAKE_VERSION symlink"
 		echo "Use -DWITHOUT_INSTALL_MK to skip installing files to $prefix/share/mk"
 	fi
 }

Modified: head/contrib/bmake/bsd.after-import.mk
==============================================================================
--- head/contrib/bmake/bsd.after-import.mk	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/bsd.after-import.mk	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,4 +1,4 @@
-# $Id: bsd.after-import.mk,v 1.11 2012/12/29 19:32:25 sjg Exp $
+# $Id: bsd.after-import.mk,v 1.12 2014/02/14 23:45:49 sjg Exp $
 
 # This makefile is for use when integrating bmake into a BSD build
 # system.  Use this makefile after importing bmake.
@@ -41,15 +41,13 @@ SRCTOP := ${srctop}
 HOST_OS!= uname
 .endif
 
-# .../share/mk will find ${SRCTOP}/share/mk
-# if we are within ${SRCTOP}
-DEFAULT_SYS_PATH= .../share/mk:/usr/share/mk
-
 BOOTSTRAP_ARGS = \
-	--with-default-sys-path='${DEFAULT_SYS_PATH}' \
 	--prefix /usr \
 	--share /usr/share
 
+.if !empty(DEFAULT_SYS_PATH)
+BOOTSTRAP_ARGS += --with-default-sys-path='${DEFAULT_SYS_PATH}'
+.endif
 
 # run boot-strap with minimal influence
 bootstrap:	${BMAKE_SRC}/boot-strap ${MAKEFILE}

Modified: head/contrib/bmake/config.h.in
==============================================================================
--- head/contrib/bmake/config.h.in	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/config.h.in	Tue Jul  8 22:27:50 2014	(r268437)
@@ -144,6 +144,9 @@
    `HAVE_STRUCT_STAT_ST_RDEV' instead. */
 #undef HAVE_ST_RDEV
 
+/* Define to 1 if you have the `sysctl' function. */
+#undef HAVE_SYSCTL
+
 /* Define to 1 if you have the  header file, and it defines `DIR'.
    */
 #undef HAVE_SYS_DIR_H
@@ -164,6 +167,9 @@
 /* Define to 1 if you have the  header file. */
 #undef HAVE_SYS_STAT_H
 
+/* Define to 1 if you have the  header file. */
+#undef HAVE_SYS_SYSCTL_H
+
 /* Define to 1 if you have the  header file. */
 #undef HAVE_SYS_TIME_H
 
@@ -298,6 +304,9 @@
 /* Define to 1 if you need to in order for `stat' and other things to work. */
 #undef _POSIX_SOURCE
 
+/* C99 function name */
+#undef __func__
+
 /* Define to empty if `const' does not conform to ANSI C. */
 #undef const
 

Modified: head/contrib/bmake/configure
==============================================================================
Binary file (source and/or target). No diff available.

Modified: head/contrib/bmake/configure.in
==============================================================================
--- head/contrib/bmake/configure.in	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/configure.in	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,12 +1,12 @@
 dnl
 dnl RCSid:
-dnl	$Id: configure.in,v 1.51 2014/01/02 22:20:52 sjg Exp $
+dnl	$Id: configure.in,v 1.52 2014/02/15 22:27:59 sjg Exp $
 dnl
 dnl Process this file with autoconf to produce a configure script
 dnl
 AC_PREREQ(2.50)
-AC_INIT([bmake], [20140101], [sjg@NetBSD.org])
-AC_CONFIG_HEADER(config.h)
+AC_INIT([bmake], [20140214], [sjg@NetBSD.org])
+AC_CONFIG_HEADERS(config.h)
 
 dnl make srcdir absolute
 case "$srcdir" in
@@ -203,6 +203,11 @@ dnl
 AC_HEADER_STAT
 AC_STRUCT_ST_RDEV
 dnl
+echo "checking if compiler supports __func__" >&6
+AC_LANG(C)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[[const char *func = __func__;]])],,
+	AC_DEFINE(__func__, __FUNCTION__, C99 function name))
+dnl
 dnl we want this for unit-tests/Makefile
 echo $ECHO_N "checking if diff -u works... $ECHO_C" >&6
 if diff -u /dev/null /dev/null > /dev/null 2>&1; then

Modified: head/contrib/bmake/main.c
==============================================================================
--- head/contrib/bmake/main.c	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/main.c	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.225 2013/09/14 15:09:34 matt Exp $	*/
+/*	$NetBSD: main.c,v 1.226 2014/02/07 17:23:35 pooka Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.225 2013/09/14 15:09:34 matt Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.226 2014/02/07 17:23:35 pooka Exp $";
 #else
 #include 
 #ifndef lint
@@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)main.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.225 2013/09/14 15:09:34 matt Exp $");
+__RCSID("$NetBSD: main.c,v 1.226 2014/02/07 17:23:35 pooka Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1102,11 +1102,12 @@ main(int argc, char **argv)
 	 */
 #ifndef NO_PWD_OVERRIDE
 	if (!ignorePWD) {
-		char *pwd;
+		char *pwd, *ptmp1 = NULL, *ptmp2 = NULL;
 
 		if ((pwd = getenv("PWD")) != NULL &&
-		    getenv("MAKEOBJDIRPREFIX") == NULL) {
-			const char *makeobjdir = getenv("MAKEOBJDIR");
+		    Var_Value("MAKEOBJDIRPREFIX", VAR_CMD, &ptmp1) == NULL) {
+			const char *makeobjdir = Var_Value("MAKEOBJDIR",
+			    VAR_CMD, &ptmp2);
 
 			if (makeobjdir == NULL || !strchr(makeobjdir, '$')) {
 				if (stat(pwd, &sb) == 0 &&
@@ -1115,6 +1116,8 @@ main(int argc, char **argv)
 					(void)strncpy(curdir, pwd, MAXPATHLEN);
 			}
 		}
+		free(ptmp1);
+		free(ptmp2);
 	}
 #endif
 	Var_Set(".CURDIR", curdir, VAR_GLOBAL, 0);
@@ -1131,11 +1134,13 @@ main(int argc, char **argv)
 	Dir_Init(curdir);
 	(void)Main_SetObjdir(curdir);
 
-	if ((path = getenv("MAKEOBJDIRPREFIX")) != NULL) {
+	if ((path = Var_Value("MAKEOBJDIRPREFIX", VAR_CMD, &p1)) != NULL) {
 		(void)snprintf(mdpath, MAXPATHLEN, "%s%s", path, curdir);
 		(void)Main_SetObjdir(mdpath);
-	} else if ((path = getenv("MAKEOBJDIR")) != NULL) {
+		free(p1);
+	} else if ((path = Var_Value("MAKEOBJDIR", VAR_CMD, &p1)) != NULL) {
 		(void)Main_SetObjdir(path);
+		free(p1);
 	} else {
 		(void)snprintf(mdpath, MAXPATHLEN, "%s.%s", _PATH_OBJDIR, machine);
 		if (!Main_SetObjdir(mdpath) && !Main_SetObjdir(_PATH_OBJDIR)) {

Modified: head/contrib/bmake/make.1
==============================================================================
--- head/contrib/bmake/make.1	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/make.1	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.226 2013/11/07 18:50:46 dholland Exp $
+.\"	$NetBSD: make.1,v 1.230 2014/02/15 18:55:30 sjg Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	from: @(#)make.1	8.4 (Berkeley) 3/19/94
 .\"
-.Dd October 25, 2013
+.Dd February 14, 2014
 .Dt MAKE 1
 .Os
 .Sh NAME
@@ -706,6 +706,10 @@ was executed.
 Refer to the description of
 .Ql Ev PWD
 for more details.
+.It Va .INCLUDEDFROMDIR
+The directory of the file this Makefile was included from.
+.It Va .INCLUDEDFROMFILE
+The filename of the file this Makefile was included from.
 .It Ev MAKE
 The name that
 .Nm
@@ -1257,6 +1261,15 @@ and
 are orthogonal; the former specifies whether multiple words are
 potentially affected, the latter whether multiple substitutions can
 potentially occur within each affected word.
+.Pp
+As for the
+.Cm \&:S
+modifier, the
+.Ar pattern
+and
+.Ar replacement
+are subjected to variable expansion before being parsed as
+regular expressions.
 .It Cm \&:T
 Replaces each word in the variable with its last component.
 .It Cm \&:u

Modified: head/contrib/bmake/mk/ChangeLog
==============================================================================
--- head/contrib/bmake/mk/ChangeLog	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/mk/ChangeLog	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,3 +1,60 @@
+2014-05-22  Simon J. Gerraty  
+
+	* install-mk (MK_VERSION): 20140522
+
+	* lib.mk: use CC to link shlib for linux too
+	  patch from Brendan MacDonell
+
+2014-05-05  Simon J. Gerraty  
+
+	* meta.autodep.mk: add _reldir_{finish,failed} for gathering stats
+	  if WITH_META_STATS is defined.
+
+2014-05-02  Simon J. Gerraty  
+
+	* dirdeps.mk: accept -DWITHOUT_DIRDEPS (same a as -DNO_DIRDEPS)
+	  to supress dirdeps outside of .CURDIR.
+
+2014-04-05  Simon J. Gerraty  
+
+	* Fix spelling errors - patch from Pedro Giffuni
+
+2014-03-14  Simon J. Gerraty  
+
+	* install-mk (MK_VERSION): 20140314
+
+	* dirdeps.mk (beforedirdeps): a handy hook
+
+	* dirdeps.mk (DIRDEP_MAKE): allow the actual command we run
+	  to visit leaf dirs to be intercepted (eg. for distributed
+	  build).
+
+	* dirdeps.mk (__depdirs): ensure // don't sneak in
+	
+	* gendirdeps.mk (DIRDEPS): ensure // don't sneak in
+
+
+2014-02-21  Simon J. Gerraty  
+
+	* rst2htm.mk (RST2PDF): add support for rst2pdf
+
+2014-02-14  Simon J. Gerraty  
+
+	* install-mk (MK_VERSION): bump version
+	* dirdeps.mk (_last_dependfile): use .INCLUDEDFROMFILE if
+	  available.
+
+2014-02-10  Simon J. Gerraty  
+
+	* options.mk: avoid :U so this isn't bmake dependent
+
+2014-02-09  Simon J. Gerraty  
+
+	* options.mk: cleanup and simplify semanitcs 
+	  NO_* dominates all, if both WITH_* and WITHOUT_*
+	  are defined then result is DOMINATE_* which defaults to "no".
+	  Ie. WITHOUT_ normally wins.
+
 2013-12-12  Simon J. Gerraty  
 
 	* install-mk (MK_VERSION): bump version
@@ -490,7 +547,7 @@
 	* dep.mk: auto.dep.mk does not do 'make depend' so ignore it if
 	  asked to do that.
 	  fix/simplify the tests for when to run mkdep.
-	* auto.dep.mk: add some explaination of how/what we do.
+	* auto.dep.mk: add some explanation of how/what we do.
 	* autodep.mk: skip the .OPTIONAL frobbing of .depend
 	  bmake's FROM_DEPEND flag makes it redundant.
 	
@@ -640,7 +697,7 @@
 2006-12-30  Simon J. Gerraty  
 
 	* install-mk (MK_VERSION): bump version
-	* added libs.mk - analagous to progs.mk
+	* added libs.mk - analogous to progs.mk
 	  make both of them always inlcude {lib,prog}.mk
 
 2006-12-28  Simon J. Gerraty  

Modified: head/contrib/bmake/mk/autodep.mk
==============================================================================
--- head/contrib/bmake/mk/autodep.mk	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/mk/autodep.mk	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,6 +1,6 @@
 #
 # RCSid:
-#	$Id: autodep.mk,v 1.32 2010/04/19 17:37:56 sjg Exp $
+#	$Id: autodep.mk,v 1.33 2014/04/05 22:56:54 sjg Exp $
 #
 #	@(#) Copyright (c) 1999-2010, Simon J. Gerraty
 #
@@ -16,7 +16,7 @@
 
 # This module provides automagic dependency generation along the
 # lines suggested in the GNU make.info
-# The depend target is mainly for backwards compatability,
+# The depend target is mainly for backwards compatibility,
 # dependencies are normally updated as part of compilation.
 
 # set MKDEP=autodep and dep.mk will include us

Modified: head/contrib/bmake/mk/dirdeps.mk
==============================================================================
--- head/contrib/bmake/mk/dirdeps.mk	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/mk/dirdeps.mk	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,4 +1,4 @@
-# $Id: dirdeps.mk,v 1.29 2013/10/13 18:43:53 sjg Exp $
+# $Id: dirdeps.mk,v 1.35 2014/05/03 06:27:56 sjg Exp $
 
 # Copyright (c) 2010-2013, Juniper Networks, Inc.
 # All rights reserved.
@@ -44,7 +44,7 @@
 #	All unqualified entries end up being qualified with .${TARGET_SPEC}
 #	and partially qualified (if TARGET_SPEC_VARS has multiple
 #	entries) are also expanded to a full ..
-#	The  _DIRDEPS_USE target uses the suffix to set TARGET_SPEC
+#	The  _DIRDEP_USE target uses the suffix to set TARGET_SPEC
 #	correctly when visiting each entry.
 #
 #	The fully qualified directory entries are used to construct a
@@ -71,7 +71,7 @@
 #
 # TARGET_SPEC_VARS
 #	The default value is just MACHINE, and for most environments
-#	this is sufficient.  The _DIRDEPS_USE target actually sets
+#	this is sufficient.  The _DIRDEP_USE target actually sets
 #	both MACHINE and TARGET_SPEC to the suffix of the current
 #	target so that in the general case TARGET_SPEC can be ignored.
 #
@@ -196,7 +196,11 @@ N_notmachine := ${.MAKE.DEPENDFILE_PREFE
 # if we were included recursively _DEP_TARGET_SPEC should be valid.
 .if empty(_DEP_TARGET_SPEC)
 # we may or may not have included a dependfile yet
+.if defined(.INCLUDEDFROMFILE)
+_last_dependfile := ${.INCLUDEDFROMFILE:M${.MAKE.DEPENDFILE_PREFIX}*}
+.else
 _last_dependfile := ${.MAKE.MAKEFILES:M*/${.MAKE.DEPENDFILE_PREFIX}*:[-1]}
+.endif
 .if !empty(_debug_reldir)
 .info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: _last_dependfile='${_last_dependfile}'
 .endif
@@ -239,7 +243,8 @@ DEP_MACHINE := ${_DEP_TARGET_SPEC}
 # we can use this as a clue to do initialization and other one time things.
 .if !target(_DIRDEP_USE)
 # make sure this target exists
-dirdeps:
+dirdeps: beforedirdeps .WAIT
+beforedirdeps:
 
 # We normally expect to be included by Makefile.depend.*
 # which sets the DEP_* macros below.
@@ -269,12 +274,15 @@ DEP_SKIP_DIR = ${SKIP_DIR} \
 
 NSkipDir = ${DEP_SKIP_DIR:${M_ListToSkip}}
 
-.if defined(NO_DIRDEPS) || defined(NODIRDEPS)
+.if defined(NO_DIRDEPS) || defined(NODIRDEPS) || defined(WITHOUT_DIRDEPS)
 # confine ourselves to the original dir
 DIRDEPS_FILTER += M${_DEP_RELDIR}*
 .endif
 
-# we supress SUBDIR when visiting the leaves
+# this is what we run below
+DIRDEP_MAKE?= ${.MAKE}
+
+# we suppress SUBDIR when visiting the leaves
 # we assume sys.mk will set MACHINE_ARCH
 # you can add extras to DIRDEP_USE_ENV
 # if there is no makefile in the target directory, we skip it.
@@ -285,7 +293,7 @@ _DIRDEP_USE:	.USE .MAKE
 		MACHINE_ARCH= NO_SUBDIR=1 ${DIRDEP_USE_ENV} \
 		TARGET_SPEC=${.TARGET:E} \
 		MACHINE=${.TARGET:E} \
-		${.MAKE} -C ${.TARGET:R} || exit 1; \
+		${DIRDEP_MAKE} -C ${.TARGET:R} || exit 1; \
 		break; \
 	done
 
@@ -397,7 +405,7 @@ DEP_DIRDEPS_FILTER = U
 .endif
 
 # this is what we start with
-__depdirs := ${DIRDEPS:${NSkipDir}:${DEP_DIRDEPS_FILTER:ts:}:O:u:@d@${SRCTOP}/$d@}
+__depdirs := ${DIRDEPS:${NSkipDir}:${DEP_DIRDEPS_FILTER:ts:}:C,//+,/,g:O:u:@d@${SRCTOP}/$d@}
 
 # some entries may be qualified with . 
 # the :M*/*/*.* just tries to limit the dirs we check to likely ones.

Modified: head/contrib/bmake/mk/dpadd.mk
==============================================================================
--- head/contrib/bmake/mk/dpadd.mk	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/mk/dpadd.mk	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,4 +1,4 @@
-# $Id: dpadd.mk,v 1.18 2011/11/10 05:13:37 sjg Exp $
+# $Id: dpadd.mk,v 1.19 2014/04/05 22:56:54 sjg Exp $
 #
 #	@(#) Copyright (c) 2004, Simon J. Gerraty
 #
@@ -68,7 +68,7 @@ DPLIBS+= ${LIBDMALLOC}
 .endif
 .endif
 
-# Order -L's to seach ours first.
+# Order -L's to search ours first.
 # Avoids picking up old versions already installed.
 __dpadd_libdirs := ${__dpadd_libs:R:H:S/^/-L/g:O:u:N-L}
 LDADD += ${__dpadd_libdirs:M-L${OBJTOP}/*}
@@ -99,9 +99,9 @@ SRC_LIBS+= ${_OBJDIR}/lib${LIB}.a
 # This little bit of magic, assumes that SRC_libfoo will be
 # set if it cannot be correctly derrived from ${LIBFOO}
 # Note that SRC_libfoo and INCLUDES_libfoo should be named for the
-# actual libary name not the variable name that might refer to it.
+# actual library name not the variable name that might refer to it.
 # 99% of the time the two are the same, but the DPADD logic
-# only has the libary name available, so stick to that.
+# only has the library name available, so stick to that.
 # 
 
 SRC_LIBS?=

Modified: head/contrib/bmake/mk/gendirdeps.mk
==============================================================================
--- head/contrib/bmake/mk/gendirdeps.mk	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/mk/gendirdeps.mk	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,4 +1,4 @@
-# $Id: gendirdeps.mk,v 1.23 2013/09/04 17:49:20 sjg Exp $
+# $Id: gendirdeps.mk,v 1.25 2014/03/14 21:28:37 sjg Exp $
 
 # Copyright (c) 2010-2013, Juniper Networks, Inc.
 # All rights reserved.
@@ -229,7 +229,7 @@ DIRDEPS = \
 	${qualdir_list:N${RELDIR}.*:N${RELDIR}/*}
 
 # We only consider things below $RELDIR/ if they have a makefile.
-# This is the same test that _DIRDEPS_USE applies.
+# This is the same test that _DIRDEP_USE applies.
 # We have do a double test with dirdep_list as it _may_ contain 
 # qualified dirs - if we got anything from a stage dir.
 # qualdir_list we know are all qualified.
@@ -240,7 +240,7 @@ DIRDEPS += \
 	${dirdep_list:M${RELDIR}/*:@d@${.MAKE.MAKEFILE_PREFERENCE:@m@${exists(${SRCTOP}/$d/$m):?$d:${exists(${SRCTOP}/${d:R}/$m):?$d:}}@}@} \
 	${qualdir_list:M${RELDIR}/*:@d@${.MAKE.MAKEFILE_PREFERENCE:@m@${exists(${SRCTOP}/${d:R}/$m):?$d:}@}@}
 
-DIRDEPS := ${DIRDEPS:${GENDIRDEPS_FILTER:UNno:ts:}:O:u}
+DIRDEPS := ${DIRDEPS:${GENDIRDEPS_FILTER:UNno:ts:}:C,//+,/,g:O:u}
 
 .if ${DEBUG_GENDIRDEPS:Uno:@x@${RELDIR:M$x}@} != ""
 .info ${RELDIR}: M2D_OBJROOTS=${M2D_OBJROOTS}
@@ -261,7 +261,7 @@ src_dirdep_list = \
 SRC_DIRDEPS = \
 	${src_dirdep_list:N${RELDIR}:N${RELDIR}/*:C,(/h)/.*,,}
 
-SRC_DIRDEPS := ${SRC_DIRDEPS:${GENDIRDEPS_SRC_FILTER:UN/*:ts:}:O:u}
+SRC_DIRDEPS := ${SRC_DIRDEPS:${GENDIRDEPS_SRC_FILTER:UN/*:ts:}:C,//+,/,g:O:u}
 
 # if you want to capture SRC_DIRDEPS in .MAKE.DEPENDFILE put
 # SRC_DIRDEPS_FILE = ${_DEPENDFILE} 

Modified: head/contrib/bmake/mk/host-target.mk
==============================================================================
--- head/contrib/bmake/mk/host-target.mk	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/mk/host-target.mk	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,5 +1,5 @@
 # RCSid:
-#	$Id: host-target.mk,v 1.6 2011/03/02 05:05:21 sjg Exp $
+#	$Id: host-target.mk,v 1.7 2014/05/16 17:54:52 sjg Exp $
 
 # Host platform information; may be overridden
 .if !defined(_HOST_OSNAME)
@@ -18,6 +18,10 @@ _HOST_ARCH != uname -m
 .endif
 .export _HOST_ARCH
 .endif
+.if !defined(HOST_MACHINE)
+HOST_MACHINE != uname -m
+.export HOST_MACHINE
+.endif
 
 HOST_OSMAJOR := ${_HOST_OSREL:C/[^0-9].*//}
 HOST_OSTYPE  :=	${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//}-${_HOST_ARCH}

Modified: head/contrib/bmake/mk/install-mk
==============================================================================
--- head/contrib/bmake/mk/install-mk	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/mk/install-mk	Tue Jul  8 22:27:50 2014	(r268437)
@@ -55,7 +55,7 @@
 #       Simon J. Gerraty 
 
 # RCSid:
-#	$Id: install-mk,v 1.95 2013/12/20 06:08:52 sjg Exp $
+#	$Id: install-mk,v 1.100 2014/05/23 01:30:36 sjg Exp $
 #
 #	@(#) Copyright (c) 1994 Simon J. Gerraty
 #
@@ -70,7 +70,7 @@
 #	sjg@crufty.net
 #
 
-MK_VERSION=20131212
+MK_VERSION=20140522
 OWNER=
 GROUP=
 MODE=444

Modified: head/contrib/bmake/mk/lib.mk
==============================================================================
--- head/contrib/bmake/mk/lib.mk	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/mk/lib.mk	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,4 +1,4 @@
-# $Id: lib.mk,v 1.49 2013/07/18 05:46:24 sjg Exp $
+# $Id: lib.mk,v 1.51 2014/05/23 01:30:36 sjg Exp $
 
 .if !target(__${.PARSEFILE}__)
 __${.PARSEFILE}__:
@@ -55,7 +55,7 @@ CFLAGS+=	${COPTS}
 # are built for different platforms and object formats.
 # OBJECT_FMT:		currently either "ELF" or "a.out", from 
 # SHLIB_SOVERSION:	version number to be compiled into a shared library
-#			via -soname. Usualy ${SHLIB_MAJOR} on ELF.
+#			via -soname. Usually ${SHLIB_MAJOR} on ELF.
 #			NetBSD/pmax used to use ${SHLIB_MAJOR}[.${SHLIB_MINOR}
 #			[.${SHLIB_TEENY}]]
 # SHLIB_SHFLAGS:	Flags to tell ${LD} to emit shared library.
@@ -123,7 +123,7 @@ SHLIB_LDSTARTFILE?=	/usr/lib/crtbeginS.o
 SHLIB_LDENDFILE?=	/usr/lib/crtendS.o
 .endif
 
-# for compatability with the following
+# for compatibility with the following
 CC_PIC?= ${CPICFLAGS}
 LD_shared=${SHLIB_SHFLAGS}
 
@@ -175,9 +175,10 @@ AR_cq= -cqs
 .elif ${TARGET_OSNAME} == "FreeBSD"
 LD_solib= lib${LIB}_pic.a
 .elif ${TARGET_OSNAME} == "Linux"
+SHLIB_LD = ${CC}
 # this is ambiguous of course
-LD_shared=-shared -h lib${LIB}.so.${SHLIB_MAJOR}
-LD_solib= --whole-archive lib${LIB}_pic.a
+LD_shared=-shared -Wl,"-h lib${LIB}.so.${SHLIB_MAJOR}"
+LD_solib= -Wl,--whole-archive lib${LIB}_pic.a -Wl,--no-whole-archive
 # Linux uses GNU ld, which is a multi-pass linker
 # so we don't need to use lorder or tsort
 LD_objs = ${OBJS}
@@ -259,7 +260,7 @@ OPTIMIZE_OBJECT_META_FILES ?= yes
 
 
 .if ${MK_LIBTOOL} == "yes"
-# because libtool is so facist about naming the object files,
+# because libtool is so fascist about naming the object files,
 # we cannot (yet) build profiled libs
 MK_PROFILE=no
 _LIBS=lib${LIB}.a
@@ -413,7 +414,7 @@ SHLIB_AGE?=0
 .s.o .S.o .c.o:
 	${LIBTOOL} --mode=compile ${CC} ${LT_STATIC} ${CFLAGS} ${CPPFLAGS} ${IMPFLAGS} -c ${.IMPSRC}
 
-# can't really do profiled libs with libtool - its too facist about
+# can't really do profiled libs with libtool - its too fascist about
 # naming the output...
 lib${LIB}.a:: ${OBJS}
 	@rm -f ${.TARGET}

Modified: head/contrib/bmake/mk/meta.autodep.mk
==============================================================================
--- head/contrib/bmake/mk/meta.autodep.mk	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/mk/meta.autodep.mk	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,4 +1,4 @@
-# $Id: meta.autodep.mk,v 1.32 2012/11/13 00:44:26 sjg Exp $
+# $Id: meta.autodep.mk,v 1.35 2014/05/09 00:05:46 sjg Exp $
 
 #
 #	@(#) Copyright (c) 2010, Simon J. Gerraty
@@ -120,7 +120,7 @@ FORCE_DPADD += ${_nonlibs:@x@${DPADD:M*/
 # some makefiles and/or targets contain
 # circular dependencies if you dig too deep 
 # (as meta mode is apt to do) 
-# so we provide a means of supressing them.
+# so we provide a means of suppressing them.
 # the input to the loop below is target: dependency
 # with just one dependency per line.
 # Also some targets are not really local, or use random names.
@@ -137,7 +137,7 @@ SUPPRESS_DEPEND += \
 # the double $$ defers initial evaluation
 # if necessary, we fake .po dependencies, just so the result 
 # in Makefile.depend* is stable
-# The current objdir may be refered to in various ways
+# The current objdir may be referred to in various ways
 OBJDIR_REFS += ${.OBJDIR} ${.OBJDIR:tA} ${_OBJDIR} ${RELOBJTOP}/${RELDIR}
 _depend = .depend
 # it would be nice to be able to get .SUFFIXES as ${.SUFFIXES}
@@ -176,7 +176,9 @@ _depend =
 .info ${_DEPENDFILE:S,${SRCTOP}/,,} _depend=${_depend}
 .endif
 
+.if ${UPDATE_DEPENDFILE} == "yes"
 gendirdeps:	${_DEPENDFILE}
+.endif
 
 .if !target(${_DEPENDFILE})
 .if ${_bootstrap_dirdeps} == "yes"
@@ -259,4 +261,28 @@ ${_DEPENDFILE}: .PRECIOUS
 .endif
 
 CLEANFILES += *.meta filemon.* *.db
+
+# these make it easy to gather some stats
+now_utc = ${%s:L:gmtime}
+start_utc := ${now_utc}
+
+meta_stats= meta=${empty(.MAKE.META.FILES):?0:${.MAKE.META.FILES:[#]}} \
+	created=${empty(.MAKE.META.CREATED):?0:${.MAKE.META.CREATED:[#]}}
+
+#.END: _reldir_finish
+.if target(gendirdeps)
+_reldir_finish: gendirdeps
+.endif
+_reldir_finish: .NOMETA
+	@echo "${TIME_STAMP} Finished ${RELDIR}.${TARGET_SPEC} seconds=$$(( ${now_utc} - ${start_utc} )) ${meta_stats}"
+
+#.ERROR: _reldir_failed
+_reldir_failed: .NOMETA
+	@echo "${TIME_STAMP} Failed ${RELDIR}.${TARGET_SPEC} seconds=$$(( ${now_utc} - ${start_utc} )) ${meta_stats}"
+
+.if defined(WITH_META_STATS) && ${.MAKE.LEVEL} > 0
+.END: _reldir_finish
+.ERROR: _reldir_failed
+.endif
+
 .endif

Modified: head/contrib/bmake/mk/meta2deps.py
==============================================================================
--- head/contrib/bmake/mk/meta2deps.py	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/mk/meta2deps.py	Tue Jul  8 22:27:50 2014	(r268437)
@@ -37,7 +37,7 @@ We only pay attention to a subset of the
 
 """
 RCSid:
-	$Id: meta2deps.py,v 1.16 2013/12/20 06:08:52 sjg Exp $
+	$Id: meta2deps.py,v 1.17 2014/04/05 22:56:54 sjg Exp $
 
 	Copyright (c) 2011-2013, Juniper Networks, Inc.
 	All rights reserved.
@@ -166,7 +166,7 @@ class MetaFile:
         	Sometimes MACHINE isn't enough.
                 
         HOST_TARGET
-		when we build for the psuedo machine 'host'
+		when we build for the pseudo machine 'host'
 		the object tree uses HOST_TARGET rather than MACHINE.
 
         OBJROOTS a list of the common prefix for all obj dirs it might
@@ -296,7 +296,7 @@ class MetaFile:
                 print("%s: %sAdd: %s" % (self.name, clue, data), file=self.debug_out)
 
     def find_top(self, path, list):
-        """the logical tree may be split accross multiple trees"""
+        """the logical tree may be split across multiple trees"""
         for top in list:
             if path.startswith(top):
                 if self.debug > 2:

Modified: head/contrib/bmake/mk/meta2deps.sh
==============================================================================
--- head/contrib/bmake/mk/meta2deps.sh	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/mk/meta2deps.sh	Tue Jul  8 22:27:50 2014	(r268437)
@@ -77,7 +77,7 @@
 
 
 # RCSid:
-#	$Id: meta2deps.sh,v 1.6 2013/05/11 05:16:26 sjg Exp $
+#	$Id: meta2deps.sh,v 1.7 2014/04/05 22:56:54 sjg Exp $
 
 # Copyright (c) 2010-2013, Juniper Networks, Inc.
 # All rights reserved.
@@ -348,7 +348,7 @@ meta2deps() {
 	[ -s $f ] || continue
 	case $f in
 	*qual) # a list of .dirdep files
-	    # we can prefix everthing with $OBJTOP to
+	    # we can prefix everything with $OBJTOP to
 	    # tell gendirdeps.mk that these are
 	    # DIRDEP entries, since they are already
 	    # qualified with . as needed.

Modified: head/contrib/bmake/mk/options.mk
==============================================================================
--- head/contrib/bmake/mk/options.mk	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/mk/options.mk	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,4 +1,4 @@
-# $Id: options.mk,v 1.7 2013/04/17 20:32:38 sjg Exp $
+# $Id: options.mk,v 1.10 2014/02/11 18:34:48 sjg Exp $
 #
 #	@(#) Copyright (c) 2012, Simon J. Gerraty
 #
@@ -30,15 +30,27 @@ OPTIONS_DEFAULT_VALUES += \
 	${OPTIONS_DEFAULT_YES:O:u:S,$,/yes,}
 
 OPTION_PREFIX ?= MK_
+
+# NO_* takes precedence
+# If both WITH_* and WITHOUT_* are defined, WITHOUT_ wins unless
+# DOMINANT_* is set to "yes"
+# Otherwise WITH_* and WITHOUT_* override the default.
 .for o in ${OPTIONS_DEFAULT_VALUES:M*/*}
-.if ${o:T:tl} == "no"
-.if defined(WITH_${o:H}) && !defined(NO_${o:H}) && !defined(NO${o:H})
+.if defined(NO_${o:H}) || defined(NO${o:H})
+# we cannot do it
+${OPTION_PREFIX}${o:H} ?= no
+.elif defined(WITH_${o:H}) && defined(WITHOUT_${o:H})
+# normally WITHOUT_ wins
+DOMINANT_${o:H} ?= no
+${OPTION_PREFIX}${o:H} ?= ${DOMINANT_${o:H}}
+.elif ${o:T:tl} == "no"
+.if defined(WITH_${o:H})
 ${OPTION_PREFIX}${o:H} ?= yes
 .else
 ${OPTION_PREFIX}${o:H} ?= no
 .endif
 .else
-.if defined(WITHOUT_${o:H}) || defined(NO_${o:H}) || defined(NO${o:H})
+.if defined(WITHOUT_${o:H})
 ${OPTION_PREFIX}${o:H} ?= no
 .else
 ${OPTION_PREFIX}${o:H} ?= yes
@@ -47,11 +59,19 @@ ${OPTION_PREFIX}${o:H} ?= yes
 .endfor
 
 # OPTIONS_DEFAULT_DEPENDENT += FOO_UTILS/FOO
-# if neither WITH[OUT]_FOO_UTILS is set, use value of ${OPTION_PREFIX}FOO
+# If neither WITH[OUT]_FOO_UTILS is set, (see rules above)
+# use the value of ${OPTION_PREFIX}FOO
 .for o in ${OPTIONS_DEFAULT_DEPENDENT:M*/*:O:u}
-.if defined(WITH_${o:H}) && !defined(NO_${o:H}) && !defined(NO${o:H})
+.if defined(NO_${o:H}) || defined(NO${o:H})
+# we cannot do it
+${OPTION_PREFIX}${o:H} ?= no
+.elif defined(WITH_${o:H}) && defined(WITHOUT_${o:H})
+# normally WITHOUT_ wins
+DOMINANT_${o:H} ?= no
+${OPTION_PREFIX}${o:H} ?= ${DOMINANT_${o:H}}
+.elif defined(WITH_${o:H})
 ${OPTION_PREFIX}${o:H} ?= yes
-.elif defined(WITHOUT_${o:H}) || defined(NO_${o:H}) || defined(NO${o:H})
+.elif defined(WITHOUT_${o:H})
 ${OPTION_PREFIX}${o:H} ?= no
 .else
 ${OPTION_PREFIX}${o:H} ?= ${${OPTION_PREFIX}${o:T}}

Modified: head/contrib/bmake/mk/rst2htm.mk
==============================================================================
--- head/contrib/bmake/mk/rst2htm.mk	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/mk/rst2htm.mk	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,4 +1,4 @@
-# $Id: rst2htm.mk,v 1.8 2011/04/03 21:39:25 sjg Exp $
+# $Id: rst2htm.mk,v 1.9 2014/02/22 01:52:41 sjg Exp $
 #
 #	@(#) Copyright (c) 2009, Simon J. Gerraty
 #
@@ -22,6 +22,7 @@ TXTSRCS != 'ls' -1t ${.CURDIR}/*.txt ${.
 RSTSRCS ?= ${TXTSRCS}
 HTMFILES ?= ${RSTSRCS:R:T:O:u:%=%.htm}
 RST2HTML ?= rst2html.py
+RST2PDF ?= rst2pdf
 RST2S5 ?= rst2s5.py
 # the following will run RST2S5 if the target name contains the word 'slides'
 # otherwise it uses RST2HTML
@@ -33,11 +34,15 @@ CLEANFILES += ${HTMFILES}
 
 html:	${HTMFILES}
 
-.SUFFIXES: ${RST_SUFFIXES} .htm
+.SUFFIXES: ${RST_SUFFIXES} .htm .pdf
 
 ${RST_SUFFIXES:@s@$s.htm@}:
 	${RST2HTM} ${.IMPSRC} ${.TARGET}
 
+${RST_SUFFIXES:@s@$s.pdf@}:
+	${RST2PDF} ${.IMPSRC} ${.TARGET}
+
 .for s in ${RSTSRCS:O:u}
 ${s:R:T}.htm: $s
+${s:R:T}.pdf: $s
 .endfor

Modified: head/contrib/bmake/mk/sys.mk
==============================================================================
--- head/contrib/bmake/mk/sys.mk	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/mk/sys.mk	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,4 +1,4 @@
-# $Id: sys.mk,v 1.35 2012/11/12 06:27:51 sjg Exp $
+# $Id: sys.mk,v 1.36 2014/05/11 00:30:19 sjg Exp $
 #
 #	@(#) Copyright (c) 2003-2009, Simon J. Gerraty
 #
@@ -77,7 +77,7 @@ M_ListToSkip= O:u:ts::S,:,:N,g:S,^,N,
 # type should be a builtin in any sh since about 1980,
 # AUTOCONF := ${autoconf:L:${M_whence}}
 M_type = @x@(type $$x 2> /dev/null); echo;@:sh:[0]:N* found*:[@]:C,[()],,g
-M_whence = ${M_type}:M/*
+M_whence = ${M_type}:M/*:[1]
 
 # convert a path to a valid shell variable
 M_P2V = tu:C,[./-],_,g

Modified: head/contrib/bmake/mk/sys/SunOS.mk
==============================================================================
--- head/contrib/bmake/mk/sys/SunOS.mk	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/mk/sys/SunOS.mk	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,4 +1,4 @@
-#	$Id: SunOS.mk,v 1.5 2010/01/11 23:02:05 sjg Exp $
+#	$Id: SunOS.mk,v 1.6 2014/04/05 22:56:54 sjg Exp $
 
 .if ${.PARSEFILE} == "sys.mk"
 .include 
@@ -12,7 +12,7 @@ ROOT_GROUP=	root
 
 SHLIB_FULLVERSION = ${SHLIB_MAJOR}
 
-# supress the dependency
+# suppress the dependency
 LIBCRT0= /dev/null
 
 .ifndef CC

Modified: head/contrib/bmake/mk/target-flags.mk
==============================================================================
--- head/contrib/bmake/mk/target-flags.mk	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/mk/target-flags.mk	Tue Jul  8 22:27:50 2014	(r268437)
@@ -3,7 +3,7 @@
 #
 # DESCRIPTION:
 #	Include this macro file after all others in a makefile and
-#	follow it with any target specfic flag settings.
+#	follow it with any target specific flag settings.
 #	For each such variable v in TARGET_FLAG_VARS we set:
 #.nf
 #
@@ -37,7 +37,7 @@
 
 
 # RCSid:
-#	$Id: target-flags.mk,v 1.8 2002/05/08 06:01:00 sjg Exp $
+#	$Id: target-flags.mk,v 1.9 2014/04/05 22:56:54 sjg Exp $
 #
 #	@(#) Copyright (c) 1998-2002, Simon J. Gerraty
 #

Modified: head/contrib/bmake/mk/warnings.mk
==============================================================================
--- head/contrib/bmake/mk/warnings.mk	Tue Jul  8 22:04:44 2014	(r268436)
+++ head/contrib/bmake/mk/warnings.mk	Tue Jul  8 22:27:50 2014	(r268437)
@@ -1,5 +1,5 @@
 # RCSid:
-#	$Id: warnings.mk,v 1.7 2009/12/11 17:06:03 sjg Exp $
+#	$Id: warnings.mk,v 1.8 2014/04/02 19:20:23 sjg Exp $
 #
 #	@(#) Copyright (c) 2002, Simon J. Gerraty
 #
@@ -42,24 +42,30 @@ HIGH_WARNINGS?= ${MEDIUM_WARNINGS} \
 	-Wswitch \
 	-Wwrite-strings
 
+EXTRA_WARNINGS?= ${HIGH_WARNINGS} -Wextra
+

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 00:12:06 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 32677470;
 Wed,  9 Jul 2014 00:12:06 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 204232660;
 Wed,  9 Jul 2014 00:12:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s690C5v2004492;
 Wed, 9 Jul 2014 00:12:05 GMT (envelope-from peter@svn.freebsd.org)
Received: (from peter@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s690C52u004491;
 Wed, 9 Jul 2014 00:12:05 GMT (envelope-from peter@svn.freebsd.org)
Message-Id: <201407090012.s690C52u004491@svn.freebsd.org>
From: Peter Wemm 
Date: Wed, 9 Jul 2014 00:12:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268441 - head/sys/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 00:12:06 -0000

Author: peter
Date: Wed Jul  9 00:12:05 2014
New Revision: 268441
URL: http://svnweb.freebsd.org/changeset/base/268441

Log:
  Bump __FreeBSD_version after last SA-14:17.kmem so we have something
  to test against in the freebsd.org cluster.

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h	Tue Jul  8 23:11:15 2014	(r268440)
+++ head/sys/sys/param.h	Wed Jul  9 00:12:05 2014	(r268441)
@@ -58,7 +58,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1100026	/* Master, propagated to newvers */
+#define __FreeBSD_version 1100027	/* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 00:55:51 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C04A14F5;
 Wed,  9 Jul 2014 00:55:51 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id AD1502AB5;
 Wed,  9 Jul 2014 00:55:51 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s690tplN026160;
 Wed, 9 Jul 2014 00:55:51 GMT (envelope-from jmmv@svn.freebsd.org)
Received: (from jmmv@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s690toYE026156;
 Wed, 9 Jul 2014 00:55:50 GMT (envelope-from jmmv@svn.freebsd.org)
Message-Id: <201407090055.s690toYE026156@svn.freebsd.org>
From: Julio Merino 
Date: Wed, 9 Jul 2014 00:55:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268445 - in head: libexec/atf/atf-sh/tests share/mk
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 00:55:51 -0000

Author: jmmv
Date: Wed Jul  9 00:55:50 2014
New Revision: 268445
URL: http://svnweb.freebsd.org/changeset/base/268445

Log:
  Fix atf-sh's integration_test
  
  With the move of atf-sh into /usr/libexec in r267181, some of the
  tests in the integration_test program broke because they could not
  execute atf-sh from the path any longer.
  
  This slipped through because I do have a local atf installation in
  my home directory that appears in my path, hence the tests could
  still execute my own version.
  
  Fix this by forcing /usr/libexec to appear at the beginning of the
  path when attempting to execute atf-sh.
  
  To make upgrading easy (and to avoid an unnecessary entry in UPDATING),
  make integration_test depend on the Makefile so that a rebuild of the
  shell script is triggered.  This requires a hack in the *.test.mk files
  to ensure the Makefile is not treated as a source to the generated
  program.  Ugly, I know, but I don't have a better way of doing this at
  the moment.  Will think of one once I address the TODO in the *.test.mk
  files that suggests generalizing the file generation functionality.
  
  PR:		191052
  Reviewed by:	Garrett Cooper

Modified:
  head/libexec/atf/atf-sh/tests/Makefile
  head/share/mk/atf.test.mk
  head/share/mk/plain.test.mk
  head/share/mk/tap.test.mk

Modified: head/libexec/atf/atf-sh/tests/Makefile
==============================================================================
--- head/libexec/atf/atf-sh/tests/Makefile	Wed Jul  9 00:12:56 2014	(r268444)
+++ head/libexec/atf/atf-sh/tests/Makefile	Wed Jul  9 00:55:50 2014	(r268445)
@@ -10,12 +10,15 @@ ATF=		${.CURDIR:H:H:H:H}/contrib/atf
 ATF_TESTS_SH+=	atf_check_test
 ATF_TESTS_SH+=	config_test
 ATF_TESTS_SH+=	integration_test
-ATF_TESTS_SH_SED_integration_test= \
-    -e 's,/usr/bin/env *atf-sh,/usr/libexec/atf-sh,g'
 ATF_TESTS_SH+=	normalize_test
 ATF_TESTS_SH+=	tc_test
 ATF_TESTS_SH+=	tp_test
 
+integration_test: Makefile
+ATF_TESTS_SH_SED_integration_test= \
+    -e 's,atf_check,PATH=/usr/libexec:$${PATH} atf_check,g' \
+    -e 's,/usr/bin/env *atf-sh,/usr/libexec/atf-sh,g'
+
 SCRIPTS+=		misc_helpers
 SCRIPTSDIR_misc_helpers=${TESTSDIR}
 CLEANFILES+=		misc_helpers misc_helpers.tmp

Modified: head/share/mk/atf.test.mk
==============================================================================
--- head/share/mk/atf.test.mk	Wed Jul  9 00:12:56 2014	(r268444)
+++ head/share/mk/atf.test.mk	Wed Jul  9 00:55:50 2014	(r268445)
@@ -105,7 +105,8 @@ ATF_TESTS_SH_SED_${_T}?= # empty
 ATF_TESTS_SH_SRC_${_T}?= ${_T}.sh
 ${_T}: ${ATF_TESTS_SH_SRC_${_T}}
 	echo '#! /usr/libexec/atf-sh' > ${.TARGET}.tmp
-	cat ${.ALLSRC} | sed ${ATF_TESTS_SH_SED_${_T}} >>${.TARGET}.tmp
+	cat ${.ALLSRC:N*Makefile*} \
+	    | sed ${ATF_TESTS_SH_SED_${_T}} >>${.TARGET}.tmp
 	chmod +x ${.TARGET}.tmp
 	mv ${.TARGET}.tmp ${.TARGET}
 .endfor

Modified: head/share/mk/plain.test.mk
==============================================================================
--- head/share/mk/plain.test.mk	Wed Jul  9 00:12:56 2014	(r268444)
+++ head/share/mk/plain.test.mk	Wed Jul  9 00:55:50 2014	(r268445)
@@ -57,7 +57,8 @@ CLEANFILES+= ${_T} ${_T}.tmp
 PLAIN_TESTS_SH_SED_${_T}?= # empty
 PLAIN_TESTS_SH_SRC_${_T}?= ${_T}.sh
 ${_T}: ${PLAIN_TESTS_SH_SRC_${_T}}
-	cat ${.ALLSRC} | sed ${PLAIN_TESTS_SH_SED_${_T}} >${.TARGET}.tmp
+	cat ${.ALLSRC:N*Makefile*} \
+	    | sed ${PLAIN_TESTS_SH_SED_${_T}} >${.TARGET}.tmp
 	chmod +x ${.TARGET}.tmp
 	mv ${.TARGET}.tmp ${.TARGET}
 .endfor

Modified: head/share/mk/tap.test.mk
==============================================================================
--- head/share/mk/tap.test.mk	Wed Jul  9 00:12:56 2014	(r268444)
+++ head/share/mk/tap.test.mk	Wed Jul  9 00:55:50 2014	(r268445)
@@ -66,7 +66,7 @@ TAP_TESTS_PERL_SRC_${_T}?= ${_T}.pl
 ${_T}: ${TAP_TESTS_PERL_SRC_${_T}}
 	{ \
 	    echo '#! ${TAP_PERL_INTERPRETER}'; \
-	    cat ${.ALLSRC} | sed ${TAP_TESTS_PERL_SED_${_T}}; \
+	    cat ${.ALLSRC:N*Makefile*} | sed ${TAP_TESTS_PERL_SED_${_T}}; \
 	} >${.TARGET}.tmp
 	chmod +x ${.TARGET}.tmp
 	mv ${.TARGET}.tmp ${.TARGET}

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 01:07:26 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from hub.FreeBSD.org (hub.freebsd.org
 [IPv6:2001:1900:2254:206c::16:88])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 270C98F8;
 Wed,  9 Jul 2014 01:07:25 +0000 (UTC)
Date: Tue, 8 Jul 2014 21:07:19 -0400
From: Glen Barber 
To: Julio Merino 
Subject: Re: svn commit: r267424 - in head: share/mk tools/build/options
Message-ID: <20140709010719.GM1216@hub.FreeBSD.org>
References: <201406121854.s5CIsrmq000136@svn.freebsd.org>
 <20140612235647.GO1248@hub.FreeBSD.org>
 <20140613002017.GP1248@hub.FreeBSD.org>
 
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature"; boundary="9HASspBA3mgrZm7c"
Content-Disposition: inline
In-Reply-To: 
X-Operating-System: FreeBSD 11.0-CURRENT amd64
X-SCUD-Definition: Sudden Completely Unexpected Dataloss
X-SULE-Definition: Sudden Unexpected Learning Event
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 01:07:26 -0000


--9HASspBA3mgrZm7c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Jul 08, 2014 at 09:03:04PM -0400, Julio Merino wrote:
> On Thu, Jun 12, 2014 at 8:20 PM, Glen Barber  wrote:
> > On Thu, Jun 12, 2014 at 07:56:47PM -0400, Glen Barber wrote:
> >> On Thu, Jun 12, 2014 at 06:54:53PM +0000, Julio Merino wrote:
> >> > Author: jmmv
> >> > Date: Thu Jun 12 18:54:52 2014
> >> > New Revision: 267424
> >> > URL: http://svnweb.freebsd.org/changeset/base/267424
> >> >
> >> > Log:
> >> >   Enable MK_TESTS by default.
> >> >
> >> >   This was never intended to be off by default but was done this way
> >> >   because the initial patches broke the build.  Things seem stable n=
ow
> >> >   (have been so for a while too) and "make tinderbox" is clean so le=
t's
> >> >   try again.
> >> >
> >> >   Announced in freebsd-current; all reported shortcomings have been
> >> >   addressed.
> >> >
> >>
> >> Unless you do it in the next 5 minutes, I will revert this to shut up
> >> the tinderbox mail.
> >>
> >
> > Sorry, had to revert this.  The tinderbox is unhappy.
>=20
> Where can I find any details about what failed?

This is one of the build failure cases:

https://lists.freebsd.org/pipermail/freebsd-tinderbox/2014-June/014357.html

The bottom of the URL contains a link to the full build failure log, but
it is outdated by now.

Glen


--9HASspBA3mgrZm7c
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJTvJXHAAoJELls3eqvi17Qop4P/iWQ0NQascM4hJHktG3ijR9T
LDzjhV3Dh2rH0jSoTuesyH7slKQSnxmJy1bZpqNyAMwOn6Q+yX1ejbeR1wu3fTCJ
Wv/szn5BoWs3fkb0XE8CmkOHSbSk0IW1oVE8kAhWlnD4UyqrpKSDP41xETVabXvv
coTRSx+7Awdoza1EiCrFq2B6Bv/iMEOlMkgKj4oRQNcHWZOY3XY8m4yUWL+2QnRl
jPdSlm2/ZSFo5xYryVpIOPQtpJ2JH49YDRwp0tEQSLJjZnDwUoWamyHJjh5m0BCM
fNn9z4UjhFHczSZ9bl+JPg3SFa03dbSKdjXocddVzraoBvMxDCd8Z6t5+sDk2b2v
3XZgnQpsMTOBQFdHOE2ySCL5JJUp/S8/GF1MipH5CbyEa7m/pz54VYkub6qJYPr6
d+YZvE3IlNzIs1Bet2Fofz4HAfyANSx0AAWHe+owWCF+ZyRzmJW+W1wcuWTtLdW8
5pKWBPiw1V/Yqc78qfwsNZhjODQF3/HOLiEkPJd7djq+udj/AhN7bytNbAaKMWQs
c1OsEjGgtlo3ef40YpvI3NrFPJh87LUTMEaZqvvQmGtOOMXOuBXHAXuHhcX0MLFc
RNY0idhvjOY74YC/geNojxf7oGL3WZ+fKrWhhhZP8496Yc3bjBdNAS6ORWGbua90
wYV+mBodfUdowItr0sof
=oGsC
-----END PGP SIGNATURE-----

--9HASspBA3mgrZm7c--

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 01:28:25 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9EC9BD8C
 for ; Wed,  9 Jul 2014 01:28:25 +0000 (UTC)
Received: from mail-qg0-f52.google.com (mail-qg0-f52.google.com
 [209.85.192.52])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 5E3992CFE
 for ; Wed,  9 Jul 2014 01:28:25 +0000 (UTC)
Received: by mail-qg0-f52.google.com with SMTP id f51so5670235qge.25
 for ; Tue, 08 Jul 2014 18:28:18 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
 :date:message-id:subject:to:cc:content-type;
 bh=E9m+qBImxgogRzaA6z7YZKIjlooVbbj7GX8Lwrs6OHQ=;
 b=FbOGJXlFK7xP3olntwGer9uRLVbDmny0EKQw9bC564bOSnWhTgSt1tbQnJyPFHSPZw
 BcV6bDQDUxcnzYSlwuBqO8nlYm519cX3w0D4ZZ1WkQ3WPC155mQc1p9d7oC0xq8iNXy7
 GqVsUKbkLTKzwjA42PRl0PpRnHBghgF6KPjU3WN4V1CykJ+u7zR/kNLLA6A9eORNPVhk
 mgFTNGikVgjT62PzqHlfsddxMCIclLyR+pLwYElWKNMFOi/vv0rnkCp6awUDhPyJgnki
 ZeOQbHqVw5L1fJWTv+bQ9VSosMqT6lZ7QdlPuGpeZL6xA0jG2HJmJdB5ArU+H/zeKDny
 jtRg==
X-Gm-Message-State: ALoCoQlDgbSMKQ9fX4IvSby4ONFiP+8CqjP1zv6tWWn3njej85JrLheLXnlb/FdGOQ+0E564vl2t
X-Received: by 10.224.135.2 with SMTP id l2mr66933022qat.37.1404867804911;
 Tue, 08 Jul 2014 18:03:24 -0700 (PDT)
MIME-Version: 1.0
Sender: jmmv@meroh.net
Received: by 10.96.83.99 with HTTP; Tue, 8 Jul 2014 18:03:04 -0700 (PDT)
X-Originating-IP: [184.153.117.174]
In-Reply-To: <20140613002017.GP1248@hub.FreeBSD.org>
References: <201406121854.s5CIsrmq000136@svn.freebsd.org>
 <20140612235647.GO1248@hub.FreeBSD.org>
 <20140613002017.GP1248@hub.FreeBSD.org>
From: Julio Merino 
Date: Tue, 8 Jul 2014 21:03:04 -0400
X-Google-Sender-Auth: x_XD8ky2PxDkMUHjPmd-uvXe03A
Message-ID: 
Subject: Re: svn commit: r267424 - in head: share/mk tools/build/options
To: Glen Barber 
Content-Type: text/plain; charset=UTF-8
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 01:28:25 -0000

On Thu, Jun 12, 2014 at 8:20 PM, Glen Barber  wrote:
> On Thu, Jun 12, 2014 at 07:56:47PM -0400, Glen Barber wrote:
>> On Thu, Jun 12, 2014 at 06:54:53PM +0000, Julio Merino wrote:
>> > Author: jmmv
>> > Date: Thu Jun 12 18:54:52 2014
>> > New Revision: 267424
>> > URL: http://svnweb.freebsd.org/changeset/base/267424
>> >
>> > Log:
>> >   Enable MK_TESTS by default.
>> >
>> >   This was never intended to be off by default but was done this way
>> >   because the initial patches broke the build.  Things seem stable now
>> >   (have been so for a while too) and "make tinderbox" is clean so let's
>> >   try again.
>> >
>> >   Announced in freebsd-current; all reported shortcomings have been
>> >   addressed.
>> >
>>
>> Unless you do it in the next 5 minutes, I will revert this to shut up
>> the tinderbox mail.
>>
>
> Sorry, had to revert this.  The tinderbox is unhappy.

Where can I find any details about what failed?

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 01:33:36 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4C8EEE06;
 Wed,  9 Jul 2014 01:33:36 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 39DAD2D89;
 Wed,  9 Jul 2014 01:33:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s691XaOd043277;
 Wed, 9 Jul 2014 01:33:36 GMT (envelope-from markj@svn.freebsd.org)
Received: (from markj@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s691Xa6L043276;
 Wed, 9 Jul 2014 01:33:36 GMT (envelope-from markj@svn.freebsd.org)
Message-Id: <201407090133.s691Xa6L043276@svn.freebsd.org>
From: Mark Johnston 
Date: Wed, 9 Jul 2014 01:33:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268446 - head/lib/libc/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 01:33:36 -0000

Author: markj
Date: Wed Jul  9 01:33:35 2014
New Revision: 268446
URL: http://svnweb.freebsd.org/changeset/base/268446

Log:
  Fix a typo.
  
  MFC after:	3 days

Modified:
  head/lib/libc/sys/procctl.2

Modified: head/lib/libc/sys/procctl.2
==============================================================================
--- head/lib/libc/sys/procctl.2	Wed Jul  9 00:55:50 2014	(r268445)
+++ head/lib/libc/sys/procctl.2	Wed Jul  9 01:33:35 2014	(r268446)
@@ -50,7 +50,7 @@ If multiple processes match the identifi
 .Nm
 will make a
 .Dq best effort
-to control as many of the selected possibles as possible.
+to control as many of the selected processes as possible.
 An error is only returned if no selected processes successfully complete
 the request.
 The following identifier types are supported:

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 02:32:27 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from hub.FreeBSD.org (hub.freebsd.org
 [IPv6:2001:1900:2254:206c::16:88])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 84D61AAC;
 Wed,  9 Jul 2014 02:32:26 +0000 (UTC)
Date: Tue, 8 Jul 2014 22:32:22 -0400
From: Glen Barber 
To: Julio Merino 
Subject: Re: svn commit: r267424 - in head: share/mk tools/build/options
Message-ID: <20140709023222.GO1216@hub.FreeBSD.org>
References: <201406121854.s5CIsrmq000136@svn.freebsd.org>
 <20140612235647.GO1248@hub.FreeBSD.org>
 <20140613002017.GP1248@hub.FreeBSD.org>
 
 <20140709010719.GM1216@hub.FreeBSD.org>
 
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature"; boundary="U2TwCo+MHNvvM16y"
Content-Disposition: inline
In-Reply-To: 
X-Operating-System: FreeBSD 11.0-CURRENT amd64
X-SCUD-Definition: Sudden Completely Unexpected Dataloss
X-SULE-Definition: Sudden Unexpected Learning Event
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 02:32:27 -0000


--U2TwCo+MHNvvM16y
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Jul 08, 2014 at 10:28:25PM -0400, Julio Merino wrote:
> On Tue, Jul 8, 2014 at 9:07 PM, Glen Barber  wrote:
> > This is one of the build failure cases:
> >
> > https://lists.freebsd.org/pipermail/freebsd-tinderbox/2014-June/014357.=
html
>=20
> Am I reading that right in that this was on a 9.2-STABLE host building HE=
AD?

Yes.

(I have no idea why, to be honest.  The tinderbox are outside of the
cluster admins control.)

Reverting the commit was lesser evil than the constant spam from the
builder.

Glen


--U2TwCo+MHNvvM16y
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJTvKm2AAoJELls3eqvi17Q07MP/jf4rZTas71Pldo24LN05btT
GLyLSwiaFaJvGrLNxYs1FDAEY9URddO+eoUKM7T4i/H+Dc2VV37kJlFiaDvdy2JB
73/Sw5mUb53v+q1GHi+AqZyiS7cqZ2v64WC7qomtqer4ZlBAa9O78OyCgqt65Tn3
+yiz0KBl/NsfnQh0p6cyXThfN7EdeRBta0nRrRmKr9GaeSOSNCc2tyL5g9aZfZ8c
gDwAco2GzgEVlUW5l04oFod/II2yLVHHmQs5J2mE09EhibeGmuM2XCkLqHuPYJKs
md6ABhwUVYz7XsSEY++RRok951CN9w70bCi8KbhOU6yYjbdU5o9gpolsznBOpG+2
TGmckMP2oWQ3cxmmnytiqhNm5lXI8vc/zuXTqFK3ZtqikuvgCnktjSx0QZOC6AZ8
cl0Mx7HXfepKkWhZLMdBE/PPSdAXMwPUkcGYX0WyZ7GLZo4xND0Fmf+CDTZVjTu2
fSlrZ/EQ1JMkdKx0HsDqxprPOX7K2c1jt1MuLDCwC/VfCcH/5RZgGZ1Z5RMYRpG0
PvocPPclKCJ3QcVoKz7cQxJhxnhkZ2+r26RPg3fPoAL7RY+bPj2oJ6eQMtBx9jAt
SC85yFoKGdHkQpt3HBoAITg7t4uVftW7BO/dkhA4I12fh3XfaTxtXQy2BCQF4VtL
ScyOYaMP0cRAsShTP2PW
=PJUe
-----END PGP SIGNATURE-----

--U2TwCo+MHNvvM16y--

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 02:36:32 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 31B73CEF
 for ; Wed,  9 Jul 2014 02:36:32 +0000 (UTC)
Received: from mail-qa0-f44.google.com (mail-qa0-f44.google.com
 [209.85.216.44])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id E357F2427
 for ; Wed,  9 Jul 2014 02:36:31 +0000 (UTC)
Received: by mail-qa0-f44.google.com with SMTP id hw13so5620900qab.3
 for ; Tue, 08 Jul 2014 19:36:25 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
 :date:message-id:subject:to:cc:content-type;
 bh=vbN2jQdW/kxuinbaVBC+E8Bkr7idGzxMPBQnAVOBUrA=;
 b=OUhQkQ/q5TifdkhSUH6NzQFwAvgLJhF6njrwVpcIMpzMi6+CqP6peZBHsaPQT/AFrL
 nZvyoo57hVnyhsPUeeza10m0H3p1uS8WRFL+r7gto+VcEWdzXyVXdZ0Q1xGsg17hwvVR
 +zhm7anPWDrj2vMw1LiKSe1dvU5ZJMwqvEFqMj4O5num6DABkphQwJ97khYEokxhbDo1
 WkRGmYssA02up9ces5oWScjltmj4vHircagf6F/XtgQjD2P68mwY5hhriKBYzk8zCWsi
 /XV7irhwZq322Epx+7foMfAhke4AxK644h7iB+asHAP9I94NiKAvRVeB0oVePaNffisX
 oB+A==
X-Gm-Message-State: ALoCoQnpporvGFQkJKIWJ5l8rOLzXYF4Ec0RHR+Qp6OMBfaDh/PufI0CAnkW6z/v3mV4aMSW8wFy
X-Received: by 10.140.46.70 with SMTP id j64mr63047755qga.27.1404872925190;
 Tue, 08 Jul 2014 19:28:45 -0700 (PDT)
MIME-Version: 1.0
Sender: jmmv@meroh.net
Received: by 10.96.83.99 with HTTP; Tue, 8 Jul 2014 19:28:25 -0700 (PDT)
X-Originating-IP: [184.153.117.174]
In-Reply-To: <20140709010719.GM1216@hub.FreeBSD.org>
References: <201406121854.s5CIsrmq000136@svn.freebsd.org>
 <20140612235647.GO1248@hub.FreeBSD.org>
 <20140613002017.GP1248@hub.FreeBSD.org>
 
 <20140709010719.GM1216@hub.FreeBSD.org>
From: Julio Merino 
Date: Tue, 8 Jul 2014 22:28:25 -0400
X-Google-Sender-Auth: JrExH8RVxOb4lEE1PZOLlMyrSlI
Message-ID: 
Subject: Re: svn commit: r267424 - in head: share/mk tools/build/options
To: Glen Barber 
Content-Type: text/plain; charset=UTF-8
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 02:36:32 -0000

On Tue, Jul 8, 2014 at 9:07 PM, Glen Barber  wrote:
> This is one of the build failure cases:
>
> https://lists.freebsd.org/pipermail/freebsd-tinderbox/2014-June/014357.html

Am I reading that right in that this was on a 9.2-STABLE host building HEAD?

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 02:41:11 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B70F9D38
 for ; Wed,  9 Jul 2014 02:41:11 +0000 (UTC)
Received: from mail-qg0-f49.google.com (mail-qg0-f49.google.com
 [209.85.192.49])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 736B2243F
 for ; Wed,  9 Jul 2014 02:41:11 +0000 (UTC)
Received: by mail-qg0-f49.google.com with SMTP id f51so5747198qge.8
 for ; Tue, 08 Jul 2014 19:41:10 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
 :date:message-id:subject:to:cc:content-type;
 bh=OfnTpJU2xhFwNJpNPS4t1tO4OMRFzqBBtxJxbMTYZO8=;
 b=A7H9wZMzuH0xsEnqkZ2xLIF2i7j0wRbAUMGty7zdziuEQyPW9PaZtgOkesm3rYEESv
 XI/8+RTiZv5ZOHqsae40b6Ez84h4j0Yo/ITmB/B3AG0Pt5V3fsA+hBktTvgTVKr/xot1
 QMjJHLhWNZHotdr8C7Esi4o5UPkv/d7RX0IiXHs7lafIaQsD5GS0ArAG3TIjxi9TUWu4
 mba8rDhPwCcsvrX4kw+Ule6ifhAPQIy3HGsSEedBOO7sHMy34UJrYZPdUQIdLv9lGkqh
 fmgoxQBfrK2q6Xs/eb+UkJ1aKhqqXPmJcTF2ZkkLnzPxcxk3fdF+ePHaRRla11J6EpAL
 5kUQ==
X-Gm-Message-State: ALoCoQkUQiINXZG46jjPKuO+4w/D7Wm0jqS10mgG4gXwT4ngqmLGZ3xyvJTNfxNTwYGuk38X9Ssq
X-Received: by 10.140.91.164 with SMTP id z33mr61358764qgd.65.1404873264931;
 Tue, 08 Jul 2014 19:34:24 -0700 (PDT)
MIME-Version: 1.0
Sender: jmmv@meroh.net
Received: by 10.96.83.99 with HTTP; Tue, 8 Jul 2014 19:34:04 -0700 (PDT)
X-Originating-IP: [184.153.117.174]
In-Reply-To: <20140709023222.GO1216@hub.FreeBSD.org>
References: <201406121854.s5CIsrmq000136@svn.freebsd.org>
 <20140612235647.GO1248@hub.FreeBSD.org>
 <20140613002017.GP1248@hub.FreeBSD.org>
 
 <20140709010719.GM1216@hub.FreeBSD.org>
 
 <20140709023222.GO1216@hub.FreeBSD.org>
From: Julio Merino 
Date: Tue, 8 Jul 2014 22:34:04 -0400
X-Google-Sender-Auth: BFoW7B3Uwkzf9c9EBukdDXIF8BQ
Message-ID: 
Subject: Re: svn commit: r267424 - in head: share/mk tools/build/options
To: Glen Barber 
Content-Type: text/plain; charset=UTF-8
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 02:41:11 -0000

On Tue, Jul 8, 2014 at 10:32 PM, Glen Barber  wrote:
> On Tue, Jul 08, 2014 at 10:28:25PM -0400, Julio Merino wrote:
>> On Tue, Jul 8, 2014 at 9:07 PM, Glen Barber  wrote:
>> > This is one of the build failure cases:
>> >
>> > https://lists.freebsd.org/pipermail/freebsd-tinderbox/2014-June/014357.html
>>
>> Am I reading that right in that this was on a 9.2-STABLE host building HEAD?
>
> Yes.
>
> (I have no idea why, to be honest.  The tinderbox are outside of the
> cluster admins control.)

OK.  Regardless, I suppose that being able to build HEAD from the
supported releases is supposed to work?  Even from 8.4?  Will
investigate for 9.x.

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 04:37:51 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 3EFD42C7;
 Wed,  9 Jul 2014 04:37:51 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 066E82E1B;
 Wed,  9 Jul 2014 04:37:51 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s694boGE060643;
 Wed, 9 Jul 2014 04:37:50 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s694bodU060641;
 Wed, 9 Jul 2014 04:37:50 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201407090437.s694bodU060641@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 9 Jul 2014 04:37:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268447 - in head: sys/cam/ctl usr.sbin/ctladm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 04:37:51 -0000

Author: mav
Date: Wed Jul  9 04:37:50 2014
New Revision: 268447
URL: http://svnweb.freebsd.org/changeset/base/268447

Log:
  Add LUN options to specify 64-bit EUI and NAA identifiers.

Modified:
  head/sys/cam/ctl/ctl.c
  head/usr.sbin/ctladm/ctladm.8

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Wed Jul  9 01:33:35 2014	(r268446)
+++ head/sys/cam/ctl/ctl.c	Wed Jul  9 04:37:50 2014	(r268447)
@@ -4432,7 +4432,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft
 	struct ctl_port *port;
 	struct scsi_vpd_id_descriptor *desc;
 	struct scsi_vpd_id_t10 *t10id;
-	const char *scsiname, *vendor;
+	const char *eui, *naa, *scsiname, *vendor;
 	int lun_number, i, lun_malloced;
 	int devidlen, idlen1, idlen2 = 0, len;
 
@@ -4476,6 +4476,14 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft
 		idlen2 = roundup2(strlen(scsiname) + 1, 4);
 		len += sizeof(struct scsi_vpd_id_descriptor) + idlen2;
 	}
+	eui = ctl_get_opt(&be_lun->options, "eui");
+	if (eui != NULL) {
+		len += sizeof(struct scsi_vpd_id_descriptor) + 8;
+	}
+	naa = ctl_get_opt(&be_lun->options, "naa");
+	if (naa != NULL) {
+		len += sizeof(struct scsi_vpd_id_descriptor) + 8;
+	}
 	lun->lun_devid = malloc(sizeof(struct ctl_devid) + len,
 	    M_CTL, M_WAITOK | M_ZERO);
 	lun->lun_devid->len = len;
@@ -4502,6 +4510,24 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft
 		desc->length = idlen2;
 		strlcpy(desc->identifier, scsiname, idlen2);
 	}
+	if (eui != NULL) {
+		desc = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] +
+		    desc->length);
+		desc->proto_codeset = SVPD_ID_CODESET_BINARY;
+		desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN |
+		    SVPD_ID_TYPE_EUI64;
+		desc->length = 8;
+		scsi_u64to8b(strtouq(eui, NULL, 0), desc->identifier);
+	}
+	if (naa != NULL) {
+		desc = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] +
+		    desc->length);
+		desc->proto_codeset = SVPD_ID_CODESET_BINARY;
+		desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN |
+		    SVPD_ID_TYPE_NAA;
+		desc->length = 8;
+		scsi_u64to8b(strtouq(naa, NULL, 0), desc->identifier);
+	}
 
 	mtx_lock(&ctl_softc->ctl_lock);
 	/*

Modified: head/usr.sbin/ctladm/ctladm.8
==============================================================================
--- head/usr.sbin/ctladm/ctladm.8	Wed Jul  9 01:33:35 2014	(r268446)
+++ head/usr.sbin/ctladm/ctladm.8	Wed Jul  9 04:37:50 2014	(r268447)
@@ -34,7 +34,7 @@
 .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $
 .\" $FreeBSD$
 .\"
-.Dd June 15, 2014
+.Dd July 9, 2014
 .Dt CTLADM 8
 .Os
 .Sh NAME
@@ -947,6 +947,10 @@ Specifies LUN product string up to 16 ch
 Specifies LUN revision string up to 4 chars.
 .It Va scsiname
 Specifies LUN SCSI name string.
+.It Va eui
+Specifies LUN EUI-64 identified.
+.It Va naa
+Specifies LUN NAA identifier.
 .It Va unmap
 Set to "on", enables UNMAP support for the LUN.
 .El

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 07:48:06 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 761AE6C4;
 Wed,  9 Jul 2014 07:48:06 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 4B2542D0E;
 Wed,  9 Jul 2014 07:48:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s697m61Q045225;
 Wed, 9 Jul 2014 07:48:06 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s697m6Ts045224;
 Wed, 9 Jul 2014 07:48:06 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201407090748.s697m6Ts045224@svn.freebsd.org>
From: Gleb Smirnoff 
Date: Wed, 9 Jul 2014 07:48:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268450 - head/sys/netinet
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 07:48:06 -0000

Author: glebius
Date: Wed Jul  9 07:48:05 2014
New Revision: 268450
URL: http://svnweb.freebsd.org/changeset/base/268450

Log:
  In several cases in ip_output() we obtain reference on ifa. Do not
  leak it.
  
  Together with:	asomers, np
  Sponsored by:	Nginx, Inc.

Modified:
  head/sys/netinet/ip_output.c

Modified: head/sys/netinet/ip_output.c
==============================================================================
--- head/sys/netinet/ip_output.c	Wed Jul  9 05:51:59 2014	(r268449)
+++ head/sys/netinet/ip_output.c	Wed Jul  9 07:48:05 2014	(r268450)
@@ -136,6 +136,7 @@ ip_output(struct mbuf *m, struct mbuf *o
 	struct rtentry *rte;	/* cache for ro->ro_rt */
 	struct in_addr odst;
 	struct m_tag *fwd_tag = NULL;
+	int have_ia_ref;
 #ifdef IPSEC
 	int no_route_but_check_spd = 0;
 #endif
@@ -202,6 +203,7 @@ ip_output(struct mbuf *m, struct mbuf *o
 	gw = dst = (struct sockaddr_in *)&ro->ro_dst;
 again:
 	ia = NULL;
+	have_ia_ref = 0;
 	/*
 	 * If there is a cached route, check that it is to the same
 	 * destination and is still up.  If not, free it and try again.
@@ -238,6 +240,7 @@ again:
 			error = ENETUNREACH;
 			goto bad;
 		}
+		have_ia_ref = 1;
 		ip->ip_dst.s_addr = INADDR_BROADCAST;
 		dst->sin_addr = ip->ip_dst;
 		ifp = ia->ia_ifp;
@@ -250,6 +253,7 @@ again:
 			error = ENETUNREACH;
 			goto bad;
 		}
+		have_ia_ref = 1;
 		ifp = ia->ia_ifp;
 		ip->ip_ttl = 1;
 		isbroadcast = in_broadcast(dst->sin_addr, ifp);
@@ -261,6 +265,8 @@ again:
 		 */
 		ifp = imo->imo_multicast_ifp;
 		IFP_TO_IA(ifp, ia);
+		if (ia)
+			have_ia_ref = 1;
 		isbroadcast = 0;	/* fool gcc */
 	} else {
 		/*
@@ -552,8 +558,11 @@ sendit:
 #endif
 			error = netisr_queue(NETISR_IP, m);
 			goto done;
-		} else
+		} else {
+			if (have_ia_ref)
+				ifa_free(&ia->ia_ifa);
 			goto again;	/* Redo the routing table lookup. */
+		}
 	}
 
 	/* See if local, if yes, send it to netisr with IP_FASTFWD_OURS. */
@@ -582,6 +591,8 @@ sendit:
 		m->m_flags |= M_SKIP_FIREWALL;
 		m->m_flags &= ~M_IP_NEXTHOP;
 		m_tag_delete(m, fwd_tag);
+		if (have_ia_ref)
+			ifa_free(&ia->ia_ifa);
 		goto again;
 	}
 
@@ -694,6 +705,8 @@ passout:
 done:
 	if (ro == &iproute)
 		RO_RTFREE(ro);
+	if (have_ia_ref)
+		ifa_free(&ia->ia_ifa);
 	return (error);
 bad:
 	m_freem(m);

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 08:12:59 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 6E916C3C;
 Wed,  9 Jul 2014 08:12:59 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 502CC2F63;
 Wed,  9 Jul 2014 08:12:59 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s698CxxN057883;
 Wed, 9 Jul 2014 08:12:59 GMT (envelope-from royger@svn.freebsd.org)
Received: (from royger@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s698Cxsk057882;
 Wed, 9 Jul 2014 08:12:59 GMT (envelope-from royger@svn.freebsd.org)
Message-Id: <201407090812.s698Cxsk057882@svn.freebsd.org>
From: Roger Pau Monné 
Date: Wed, 9 Jul 2014 08:12:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268451 - head/sys/vm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 08:12:59 -0000

Author: royger
Date: Wed Jul  9 08:12:58 2014
New Revision: 268451
URL: http://svnweb.freebsd.org/changeset/base/268451

Log:
  vm_phys: remove limitation on number of fictitious regions
  
  The number of vm fictitious regions was limited to 8 by default, but
  Xen will make heavy usage of those kind of regions in order to map
  memory from foreign domains, so instead of increasing the default
  number, change the implementation to use a red-black tree to track vm
  fictitious ranges.
  
  The public interface remains the same.
  
  Sponsored by: Citrix Systems R&D
  Reviewed by: kib, alc
  Approved by: gibbs
  
  vm/vm_phys.c:
   - Replace the vm fictitious static array with a red-black tree.
   - Use a rwlock instead of a mutex, since now we also need to take the
     lock in vm_phys_fictitious_to_vm_page, and it can be shared.

Modified:
  head/sys/vm/vm_phys.c

Modified: head/sys/vm/vm_phys.c
==============================================================================
--- head/sys/vm/vm_phys.c	Wed Jul  9 07:48:05 2014	(r268450)
+++ head/sys/vm/vm_phys.c	Wed Jul  9 08:12:58 2014	(r268451)
@@ -52,8 +52,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -75,13 +77,25 @@ int vm_ndomains = 1;
 struct vm_phys_seg vm_phys_segs[VM_PHYSSEG_MAX];
 int vm_phys_nsegs;
 
-#define VM_PHYS_FICTITIOUS_NSEGS	8
-static struct vm_phys_fictitious_seg {
+struct vm_phys_fictitious_seg;
+static int vm_phys_fictitious_cmp(struct vm_phys_fictitious_seg *,
+    struct vm_phys_fictitious_seg *);
+
+RB_HEAD(fict_tree, vm_phys_fictitious_seg) vm_phys_fictitious_tree =
+    RB_INITIALIZER(_vm_phys_fictitious_tree);
+
+struct vm_phys_fictitious_seg {
+	RB_ENTRY(vm_phys_fictitious_seg) node;
+	/* Memory region data */
 	vm_paddr_t	start;
 	vm_paddr_t	end;
 	vm_page_t	first_page;
-} vm_phys_fictitious_segs[VM_PHYS_FICTITIOUS_NSEGS];
-static struct mtx vm_phys_fictitious_reg_mtx;
+};
+
+RB_GENERATE_STATIC(fict_tree, vm_phys_fictitious_seg, node,
+    vm_phys_fictitious_cmp);
+
+static struct rwlock vm_phys_fictitious_reg_lock;
 MALLOC_DEFINE(M_FICT_PAGES, "vm_fictitious", "Fictitious VM pages");
 
 static struct vm_freelist
@@ -113,6 +127,47 @@ static int vm_phys_paddr_to_segind(vm_pa
 static void vm_phys_split_pages(vm_page_t m, int oind, struct vm_freelist *fl,
     int order);
 
+/*
+ * Red-black tree helpers for vm fictitious range management.
+ */
+static inline int
+vm_phys_fictitious_in_range(struct vm_phys_fictitious_seg *p,
+    struct vm_phys_fictitious_seg *range)
+{
+
+	KASSERT(range->start != 0 && range->end != 0,
+	    ("Invalid range passed on search for vm_fictitious page"));
+	if (p->start >= range->end)
+		return (1);
+	if (p->start < range->start)
+		return (-1);
+
+	return (0);
+}
+
+static int
+vm_phys_fictitious_cmp(struct vm_phys_fictitious_seg *p1,
+    struct vm_phys_fictitious_seg *p2)
+{
+
+	/* Check if this is a search for a page */
+	if (p1->end == 0)
+		return (vm_phys_fictitious_in_range(p1, p2));
+
+	KASSERT(p2->end != 0,
+    ("Invalid range passed as second parameter to vm fictitious comparison"));
+
+	/* Searching to add a new range */
+	if (p1->end <= p2->start)
+		return (-1);
+	if (p1->start >= p2->end)
+		return (1);
+
+	panic("Trying to add overlapping vm fictitious ranges:\n"
+	    "[%#jx:%#jx] and [%#jx:%#jx]", (uintmax_t)p1->start,
+	    (uintmax_t)p1->end, (uintmax_t)p2->start, (uintmax_t)p2->end);
+}
+
 static __inline int
 vm_rr_selectdomain(void)
 {
@@ -353,7 +408,7 @@ vm_phys_init(void)
 			}
 		}
 	}
-	mtx_init(&vm_phys_fictitious_reg_mtx, "vmfctr", NULL, MTX_DEF);
+	rw_init(&vm_phys_fictitious_reg_lock, "vmfctr");
 }
 
 /*
@@ -517,20 +572,22 @@ vm_phys_paddr_to_vm_page(vm_paddr_t pa)
 vm_page_t
 vm_phys_fictitious_to_vm_page(vm_paddr_t pa)
 {
-	struct vm_phys_fictitious_seg *seg;
+	struct vm_phys_fictitious_seg tmp, *seg;
 	vm_page_t m;
-	int segind;
 
 	m = NULL;
-	for (segind = 0; segind < VM_PHYS_FICTITIOUS_NSEGS; segind++) {
-		seg = &vm_phys_fictitious_segs[segind];
-		if (pa >= seg->start && pa < seg->end) {
-			m = &seg->first_page[atop(pa - seg->start)];
-			KASSERT((m->flags & PG_FICTITIOUS) != 0,
-			    ("%p not fictitious", m));
-			break;
-		}
-	}
+	tmp.start = pa;
+	tmp.end = 0;
+
+	rw_rlock(&vm_phys_fictitious_reg_lock);
+	seg = RB_FIND(fict_tree, &vm_phys_fictitious_tree, &tmp);
+	rw_runlock(&vm_phys_fictitious_reg_lock);
+	if (seg == NULL)
+		return (NULL);
+
+	m = &seg->first_page[atop(pa - seg->start)];
+	KASSERT((m->flags & PG_FICTITIOUS) != 0, ("%p not fictitious", m));
+
 	return (m);
 }
 
@@ -541,10 +598,8 @@ vm_phys_fictitious_reg_range(vm_paddr_t 
 	struct vm_phys_fictitious_seg *seg;
 	vm_page_t fp;
 	long i, page_count;
-	int segind;
 #ifdef VM_PHYSSEG_DENSE
 	long pi;
-	boolean_t malloced;
 #endif
 
 	page_count = (end - start) / PAGE_SIZE;
@@ -555,46 +610,34 @@ vm_phys_fictitious_reg_range(vm_paddr_t 
 		if (atop(end) >= vm_page_array_size + first_page)
 			return (EINVAL);
 		fp = &vm_page_array[pi - first_page];
-		malloced = FALSE;
 	} else
 #endif
 	{
 		fp = malloc(page_count * sizeof(struct vm_page), M_FICT_PAGES,
 		    M_WAITOK | M_ZERO);
-#ifdef VM_PHYSSEG_DENSE
-		malloced = TRUE;
-#endif
 	}
 	for (i = 0; i < page_count; i++) {
 		vm_page_initfake(&fp[i], start + PAGE_SIZE * i, memattr);
 		fp[i].oflags &= ~VPO_UNMANAGED;
 		fp[i].busy_lock = VPB_UNBUSIED;
 	}
-	mtx_lock(&vm_phys_fictitious_reg_mtx);
-	for (segind = 0; segind < VM_PHYS_FICTITIOUS_NSEGS; segind++) {
-		seg = &vm_phys_fictitious_segs[segind];
-		if (seg->start == 0 && seg->end == 0) {
-			seg->start = start;
-			seg->end = end;
-			seg->first_page = fp;
-			mtx_unlock(&vm_phys_fictitious_reg_mtx);
-			return (0);
-		}
-	}
-	mtx_unlock(&vm_phys_fictitious_reg_mtx);
-#ifdef VM_PHYSSEG_DENSE
-	if (malloced)
-#endif
-		free(fp, M_FICT_PAGES);
-	return (EBUSY);
+
+	seg = malloc(sizeof(*seg), M_FICT_PAGES, M_WAITOK | M_ZERO);
+	seg->start = start;
+	seg->end = end;
+	seg->first_page = fp;
+
+	rw_wlock(&vm_phys_fictitious_reg_lock);
+	RB_INSERT(fict_tree, &vm_phys_fictitious_tree, seg);
+	rw_wunlock(&vm_phys_fictitious_reg_lock);
+
+	return (0);
 }
 
 void
 vm_phys_fictitious_unreg_range(vm_paddr_t start, vm_paddr_t end)
 {
-	struct vm_phys_fictitious_seg *seg;
-	vm_page_t fp;
-	int segind;
+	struct vm_phys_fictitious_seg *seg, tmp;
 #ifdef VM_PHYSSEG_DENSE
 	long pi;
 #endif
@@ -602,24 +645,24 @@ vm_phys_fictitious_unreg_range(vm_paddr_
 #ifdef VM_PHYSSEG_DENSE
 	pi = atop(start);
 #endif
+	tmp.start = start;
+	tmp.end = 0;
 
-	mtx_lock(&vm_phys_fictitious_reg_mtx);
-	for (segind = 0; segind < VM_PHYS_FICTITIOUS_NSEGS; segind++) {
-		seg = &vm_phys_fictitious_segs[segind];
-		if (seg->start == start && seg->end == end) {
-			seg->start = seg->end = 0;
-			fp = seg->first_page;
-			seg->first_page = NULL;
-			mtx_unlock(&vm_phys_fictitious_reg_mtx);
+	rw_wlock(&vm_phys_fictitious_reg_lock);
+	seg = RB_FIND(fict_tree, &vm_phys_fictitious_tree, &tmp);
+	if (seg->start != start || seg->end != end) {
+		rw_wunlock(&vm_phys_fictitious_reg_lock);
+		panic(
+		    "Unregistering not registered fictitious range [%#jx:%#jx]",
+		    (uintmax_t)start, (uintmax_t)end);
+	}
+	RB_REMOVE(fict_tree, &vm_phys_fictitious_tree, seg);
+	rw_wunlock(&vm_phys_fictitious_reg_lock);
 #ifdef VM_PHYSSEG_DENSE
-			if (pi < first_page || atop(end) >= vm_page_array_size)
+	if (pi < first_page || atop(end) >= vm_page_array_size)
 #endif
-				free(fp, M_FICT_PAGES);
-			return;
-		}
-	}
-	mtx_unlock(&vm_phys_fictitious_reg_mtx);
-	KASSERT(0, ("Unregistering not registered fictitious range"));
+		free(seg->first_page, M_FICT_PAGES);
+	free(seg, M_FICT_PAGES);
 }
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 09:15:08 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id B23E3ED1;
 Wed,  9 Jul 2014 09:15:08 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id A06192597;
 Wed,  9 Jul 2014 09:15:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s699F8dv084976;
 Wed, 9 Jul 2014 09:15:08 GMT (envelope-from culot@svn.freebsd.org)
Received: (from culot@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s699F8Jp084975;
 Wed, 9 Jul 2014 09:15:08 GMT (envelope-from culot@svn.freebsd.org)
Message-Id: <201407090915.s699F8Jp084975@svn.freebsd.org>
From: Frederic Culot 
Date: Wed, 9 Jul 2014 09:15:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268456 - head/share/misc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 09:15:08 -0000

Author: culot (ports committer)
Date: Wed Jul  9 09:15:08 2014
New Revision: 268456
URL: http://svnweb.freebsd.org/changeset/base/268456

Log:
  Update organization.dot to reflect current portmgr@

Modified:
  head/share/misc/organization.dot

Modified: head/share/misc/organization.dot
==============================================================================
--- head/share/misc/organization.dot	Wed Jul  9 08:23:22 2014	(r268455)
+++ head/share/misc/organization.dot	Wed Jul  9 09:15:08 2014	(r268456)
@@ -30,8 +30,8 @@ coresecretary [label="Core Team Secretar
 doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"]
 doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor, hrs"]
 portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"]
-portmgr [label="Port Management Team\nportmgr@FreeBSD.org\ntabthorpe, marcus, bapt,\nerwin, bdrewery,\nitetcu, miwi"]
-portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\ntabthorpe"]
+portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nantoine, bapt, bdrewery,\ndecke, erwin, mat,\nmiwi, swills, tabthorpe"]
+portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nculot"]
 re [label="Primary Release Engineering Team\nre@FreeBSD.org\nkib, blackend, jpaetzel, hrs, kensmith"]
 secteam [label="Security Team\nsecteam@FreeBSD.org\nsimon, qingli, delphij,\nremko, philip, stas, cperciva,\ncsjp, rwatson, miwi, bz"]
 portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\nmiwi, rea, swills, wxs,\njgh, sbz, eadler, zi, remko, simon"]

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 09:51:14 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 98DD2678;
 Wed,  9 Jul 2014 09:51:14 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 871202883;
 Wed,  9 Jul 2014 09:51:14 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s699pEFu000174;
 Wed, 9 Jul 2014 09:51:14 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s699pEBh000173;
 Wed, 9 Jul 2014 09:51:14 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201407090951.s699pEBh000173@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Wed, 9 Jul 2014 09:51:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268457 - head/usr.sbin/ctladm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 09:51:14 -0000

Author: pluknet
Date: Wed Jul  9 09:51:14 2014
New Revision: 268457
URL: http://svnweb.freebsd.org/changeset/base/268457

Log:
  Fix typos.

Modified:
  head/usr.sbin/ctladm/ctladm.8

Modified: head/usr.sbin/ctladm/ctladm.8
==============================================================================
--- head/usr.sbin/ctladm/ctladm.8	Wed Jul  9 09:15:08 2014	(r268456)
+++ head/usr.sbin/ctladm/ctladm.8	Wed Jul  9 09:51:14 2014	(r268457)
@@ -499,7 +499,7 @@ Specify relative addressing for the star
 relative addressing, since it only works for linked commands, and CTL
 does not support linked commands.
 .It Fl i
-Tell the target to return status immediately after issuing the SYHCHRONIZE CACHE
+Tell the target to return status immediately after issuing the SYNCHRONIZE CACHE
 command rather than waiting for the cache to finish syncing.  CTL does not
 support this bit.
 .It Fl c Ar cdbsize
@@ -948,7 +948,7 @@ Specifies LUN revision string up to 4 ch
 .It Va scsiname
 Specifies LUN SCSI name string.
 .It Va eui
-Specifies LUN EUI-64 identified.
+Specifies LUN EUI-64 identifier.
 .It Va naa
 Specifies LUN NAA identifier.
 .It Va unmap

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 11:41:32 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id AE0DE14F;
 Wed,  9 Jul 2014 11:41:32 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9CC1B224C;
 Wed,  9 Jul 2014 11:41:32 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s69BfWQ2051333;
 Wed, 9 Jul 2014 11:41:32 GMT (envelope-from pgj@svn.freebsd.org)
Received: (from pgj@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s69BfWYX051332;
 Wed, 9 Jul 2014 11:41:32 GMT (envelope-from pgj@svn.freebsd.org)
Message-Id: <201407091141.s69BfWYX051332@svn.freebsd.org>
From: Gabor Pali 
Date: Wed, 9 Jul 2014 11:41:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268458 - head/share/misc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 11:41:32 -0000

Author: pgj (doc,ports committer)
Date: Wed Jul  9 11:41:32 2014
New Revision: 268458
URL: http://svnweb.freebsd.org/changeset/base/268458

Log:
  - Update core members

Modified:
  head/share/misc/organization.dot

Modified: head/share/misc/organization.dot
==============================================================================
--- head/share/misc/organization.dot	Wed Jul  9 09:51:14 2014	(r268457)
+++ head/share/misc/organization.dot	Wed Jul  9 11:41:32 2014	(r268458)
@@ -25,7 +25,7 @@ _misc [label="Miscellaneous Hats"]
 
 # Development teams go here alphabetically sorted
 
-core [label="Core Team\ncore@FreeBSD.org\ntabthorpe, gavin, jhb, kib,\ntheraven, hrs, peter, miwi"]
+core [label="Core Team\ncore@FreeBSD.org\nbapt, emaste, gavin,\nglebius, gnn, hrs,\npeter, rwatson, theraven"]
 coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\npgj"]
 doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"]
 doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor, hrs"]

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 13:37:25 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 8AF3F9D8;
 Wed,  9 Jul 2014 13:37:25 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 776C22E2A;
 Wed,  9 Jul 2014 13:37:25 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s69DbPoL002480;
 Wed, 9 Jul 2014 13:37:25 GMT (envelope-from pgj@svn.freebsd.org)
Received: (from pgj@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s69DbPOL002479;
 Wed, 9 Jul 2014 13:37:25 GMT (envelope-from pgj@svn.freebsd.org)
Message-Id: <201407091337.s69DbPOL002479@svn.freebsd.org>
From: Gabor Pali 
Date: Wed, 9 Jul 2014 13:37:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268459 - head/share/misc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 13:37:25 -0000

Author: pgj (doc,ports committer)
Date: Wed Jul  9 13:37:24 2014
New Revision: 268459
URL: http://svnweb.freebsd.org/changeset/base/268459

Log:
  - Update core-secretary

Modified:
  head/share/misc/organization.dot

Modified: head/share/misc/organization.dot
==============================================================================
--- head/share/misc/organization.dot	Wed Jul  9 11:41:32 2014	(r268458)
+++ head/share/misc/organization.dot	Wed Jul  9 13:37:24 2014	(r268459)
@@ -26,7 +26,7 @@ _misc [label="Miscellaneous Hats"]
 # Development teams go here alphabetically sorted
 
 core [label="Core Team\ncore@FreeBSD.org\nbapt, emaste, gavin,\nglebius, gnn, hrs,\npeter, rwatson, theraven"]
-coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\npgj"]
+coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\nmatthew"]
 doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"]
 doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor, hrs"]
 portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"]

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 14:34:19 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D7A15D2F;
 Wed,  9 Jul 2014 14:34:19 +0000 (UTC)
Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au
 [211.29.132.80])
 by mx1.freebsd.org (Postfix) with ESMTP id 7FF7724DD;
 Wed,  9 Jul 2014 14:34:19 +0000 (UTC)
Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au
 (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133])
 by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 98C79D660A4;
 Thu, 10 Jul 2014 00:34:17 +1000 (EST)
Date: Thu, 10 Jul 2014 00:34:17 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Warner Losh 
Subject: Re: svn commit: r268376 - head/bin/rm
In-Reply-To: <201407072321.s67NLL7p070713@svn.freebsd.org>
Message-ID: <20140709233323.E2055@besplex.bde.org>
References: <201407072321.s67NLL7p070713@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.1 cv=eojmkOZX c=1 sm=1 tr=0
 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=faLKK8EkqBwA:10
 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=krcSLVLWv4mBT88GSpIA:9
 a=CjuIK1q_8ugA:10
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 14:34:19 -0000

On Mon, 7 Jul 2014, Warner Losh wrote:

> Log:
>  rm -rf can fail sometimes with an error from fts_read. Make it honor
>  fflag to ignore fts_read errors, but stop deleting from that directory
>  because no further progress can be made.
>
>  When building a kernel with a high -j value on a high core count
>  machine, during the cleanobj phase we can wind up doing multiple rm
>  -rf at the same time for modules that have subdirectories. This
>  exposed this race (sometimes) as fts_read can return an error if the
>  directory is removed by another rm -rf. Since the intent of the -f
>  flag was to ignore errors, even if this was a bug in fts_read, we
>  should ignore the error like we've been instructed to do.

This seems to be more broken than before.  Although the intent of using
-f is often to ignore errors, -f is supposed to only ignore ENOENT
errors except in some cases for complicated interactions with -i.

> Modified: head/bin/rm/rm.c
> ==============================================================================
> --- head/bin/rm/rm.c	Mon Jul  7 23:21:15 2014	(r268375)
> +++ head/bin/rm/rm.c	Mon Jul  7 23:21:20 2014	(r268376)
> @@ -335,7 +335,7 @@ err:
> 		warn("%s", p->fts_path);
> 		eval = 1;
> 	}
> -	if (errno)
> +	if (!fflag && errno)
> 		err(1, "fts_read");
> 	fts_close(fts);
> }

The old code was broken too.  Apart from its style bug (boolean test for
non-boolean), it tests errno in all cases after leaving the loop, but
most of the loop exits are not for errors so the test is of the garbage
value last written to errno.

So the old and new code both defeat the more careful tests of fflag combined
with errno the loop.  Most are of the form (!fflag || p->fts_errno != ENOENT)
(then at least a warning if this fails).  It also seems wrong to use
errno outside the loop and p->fts_errno in the loop.  Of course, outside
the loop, p is usually invalid, but that means that errno is very stale.

% 	while ((p = fts_read(fts)) != NULL) {

Normal loop exit is when this is NULL.  Then there is no error, and the
errno that is tested is pure garbage.   Fixing this alone might fix the
problem.  Otherwise, hopefully any error from things going away causes
an ENOENT error, so checking for that alone would fix the error handling.
That's a bit much to ask for -- if a whole subtree is removed then there
should be multiple ENOENT errors and probably other errors, and fts_read()
would find it hard to reduce to a single ENOENT without missing a more
serious error.

% 		switch (p->fts_info) {
% 		case FTS_DNR:
% 			if (!fflag || p->fts_errno != ENOENT) {
% 				warnx("%s: %s",
% 				    p->fts_path, strerror(p->fts_errno));
% 				eval = 1;
% 			}
% 			continue;

Normal error handling.  We check for ENOENT and handle the error completely
and don't break out of the loop.

% 		case FTS_ERR:
% 			errx(1, "%s: %s", p->fts_path, strerror(p->fts_errno));

Exit for fatal errors.  I think POSIX doesn't allow this, but requires
contining to the next arg.  Exiting the loop should give that, unless
fts_close() fails.

% 		case FTS_NS:
% 			/*
% 			 * Assume that since fts_read() couldn't stat the
% 			 * file, it can't be unlinked.
% 			 */
% 			if (!needstat)
% 				break;

Here we exit the loop for an assumed stat() error.  If this error is
anything other than ENOENT, then POSIX doesn't allow ignoring it but
it might allow quitting for the current arg.  If this error is
ENOENT, then the error handling seems to be even more broken.  We
shouldn't quit for the current arg on ENOENT, irrespective of fflag.

Permissions 000 on a file don't prevent stat'ing it, and I couldn't
find a simple example where this code is reached.

% ...
% 		case FTS_DP:
% 			/* Post-order: see if user skipped. */
% 			if (p->fts_number == SKIPPED)
% 				continue;
% 			break;

Most other cases don't exit the loop.

% ...
% 	}
% 	if (!fflag && errno)

More broken than before.

% 		err(1, "fts_read");

fts without FTS_NOCHDIR is fundamentally broken if the directory tree
can change underneath it, since (without more work by the caller) it
is impossible to get back to the original directory in fts_close()
or just up a level in the tree walk for small changes in the tree
(the caller cannot handle this with any reasonable anount of work).
FTS_NOCHDIR is only used by the following utilities in /usr/src/*bin:
cp, pax, gxip, find, grep, asf.  It is not used in chmod, rm, ls,
chflags, du, chown, ckdist, ctm, mtree, kldxref, setfmac.  Mixing
this flag gives the worse possible combination -- e.g., rm can handle
deeper trees by not using FTS_NOCHDIR, but cp cannot duplicate deep
trees.  POSIX requires handling unboundedly deep trees in bounded
memory for at last critical utilities like rm.  This is impossible,
and not using FTS_NOCHDIR in FreeBSD rm doesn't give it.

Bruce

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 14:36:04 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 5AE47EBC;
 Wed,  9 Jul 2014 14:36:04 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 48D9D24F6;
 Wed,  9 Jul 2014 14:36:04 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s69Ea4Sf030005;
 Wed, 9 Jul 2014 14:36:04 GMT (envelope-from ray@svn.freebsd.org)
Received: (from ray@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s69Ea4BX030004;
 Wed, 9 Jul 2014 14:36:04 GMT (envelope-from ray@svn.freebsd.org)
Message-Id: <201407091436.s69Ea4BX030004@svn.freebsd.org>
From: Aleksandr Rybalko 
Date: Wed, 9 Jul 2014 14:36:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268460 - head/sys/dev/vt
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 14:36:04 -0000

Author: ray
Date: Wed Jul  9 14:36:03 2014
New Revision: 268460
URL: http://svnweb.freebsd.org/changeset/base/268460

Log:
  Fix inconsistent token parameters for kbd_allocate() and kbd_release() in vt(4).
  
  PR:		191306
  Submitted by:	jau789@gmail.com
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/dev/vt/vt_core.c

Modified: head/sys/dev/vt/vt_core.c
==============================================================================
--- head/sys/dev/vt/vt_core.c	Wed Jul  9 13:37:24 2014	(r268459)
+++ head/sys/dev/vt/vt_core.c	Wed Jul  9 14:36:03 2014	(r268460)
@@ -618,7 +618,7 @@ vt_kbdevent(keyboard_t *kbd, int event, 
 	case KBDIO_UNLOADING:
 		mtx_lock(&Giant);
 		vd->vd_keyboard = -1;
-		kbd_release(kbd, (void *)&vd->vd_keyboard);
+		kbd_release(kbd, (void *)vd);
 		mtx_unlock(&Giant);
 		return (0);
 	default:
@@ -1785,11 +1785,10 @@ skip_thunk:
 				return (EINVAL);
 			}
 			i = kbd_allocate(kbd->kb_name, kbd->kb_unit,
-			    (void *)&vd->vd_keyboard, vt_kbdevent, vd);
+			    (void *)vd, vt_kbdevent, vd);
 			if (i >= 0) {
 				if (vd->vd_keyboard != -1) {
-					kbd_release(kbd,
-					    (void *)&vd->vd_keyboard);
+					kbd_release(kbd, (void *)vd);
 				}
 				kbd = kbd_get_keyboard(i);
 				vd->vd_keyboard = i;
@@ -1811,7 +1810,7 @@ skip_thunk:
 				mtx_unlock(&Giant);
 				return (EINVAL);
 			}
-			error = kbd_release(kbd, (void *)&vd->vd_keyboard);
+			error = kbd_release(kbd, (void *)vd);
 			if (error == 0) {
 				vd->vd_keyboard = -1;
 			}

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 15:52:32 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id C2BF5AF6;
 Wed,  9 Jul 2014 15:52:32 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id ACE712CE9;
 Wed,  9 Jul 2014 15:52:32 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s69FqWc3070697;
 Wed, 9 Jul 2014 15:52:32 GMT (envelope-from bapt@svn.freebsd.org)
Received: (from bapt@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s69FqUon070685;
 Wed, 9 Jul 2014 15:52:30 GMT (envelope-from bapt@svn.freebsd.org)
Message-Id: <201407091552.s69FqUon070685@svn.freebsd.org>
From: Baptiste Daroussin 
Date: Wed, 9 Jul 2014 15:52:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268461 - in head: . gnu/lib/libreadline
 gnu/lib/libreadline/history gnu/lib/libreadline/readline
 gnu/lib/libreadline/readline/doc gnu/usr.bin/gdb gnu/usr.bin/gdb/gdb
 gnu/usr.bin/gdb/gd...
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 15:52:32 -0000

Author: bapt
Date: Wed Jul  9 15:52:30 2014
New Revision: 268461
URL: http://svnweb.freebsd.org/changeset/base/268461

Log:
  The GNU readline library is now an INTERNALLIB - that is, it is
  statically linked into consumers (GDB and variants) in the base
  system, and the shared library is no longer installed.
  
  That also allows ports to be able to use a modern version of readline
  
  PR:		162948
  Reviewed by:	emaste

Deleted:
  head/gnu/lib/libreadline/history/
  head/gnu/lib/libreadline/readline/doc/
Modified:
  head/ObsoleteFiles.inc
  head/UPDATING
  head/gnu/lib/libreadline/Makefile
  head/gnu/lib/libreadline/readline/Makefile
  head/gnu/usr.bin/gdb/Makefile.inc
  head/gnu/usr.bin/gdb/gdb/Makefile
  head/gnu/usr.bin/gdb/gdbtui/Makefile
  head/gnu/usr.bin/gdb/kgdb/Makefile
  head/share/mk/bsd.libnames.mk
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Wed Jul  9 14:36:03 2014	(r268460)
+++ head/ObsoleteFiles.inc	Wed Jul  9 15:52:30 2014	(r268461)
@@ -38,6 +38,25 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20140705: turn libreadline into an internal lib
+OLD_LIBS+=lib/libreadline.so.8
+OLD_FILES+=usr/lib/libreadline.a
+OLD_FILES+=usr/lib/libreadline_p.a
+OLD_FILES+=usr/lib/libreadline.so
+OLD_FILES+=usr/lib/libhistory.a
+OLD_FILES+=usr/lib/libhistory_p.a
+OLD_FILES+=usr/lib/libhistory.so
+OLD_LIBS+=usr/lib/libhistory.so.8
+OLD_FILES+=usr/include/readline/chardefs.h
+OLD_FILES+=usr/include/readline/history.h
+OLD_FILES+=usr/include/readline/keymaps.h
+OLD_FILES+=usr/include/readline/readline.h
+OLD_FILES+=usr/include/readline/rlconf.h
+OLD_FILES+=usr/include/readline/rlstdc.h
+OLD_FILES+=usr/include/readline/rltypedefs.h
+OLD_FILES+=usr/include/readline/rltypedefs.h
+OLD_FILES+=usr/share/info/readline.info.gz
+OLD_FILES+=usr/share/man/man3/readline.3.gz
 # 20140625: csup removal
 OLD_FILES+=usr/bin/csup
 OLD_FILES+=usr/bin/cpasswd

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Wed Jul  9 14:36:03 2014	(r268460)
+++ head/UPDATING	Wed Jul  9 15:52:30 2014	(r268461)
@@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
 	disable the most expensive debugging functionality run
 	"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20140708:
+	The GNU readline library is now an INTERNALLIB - that is, it is
+	statically linked into consumers (GDB and variants) in the base
+	system, and the shared library is no longer installed.  The
+	devel/readline port is available for third party software that
+	requires readline.
+
 20140702:
 	The Itanium architecture (ia64) has been removed from the list of
 	known architectures. This is the first step in the removal of the

Modified: head/gnu/lib/libreadline/Makefile
==============================================================================
--- head/gnu/lib/libreadline/Makefile	Wed Jul  9 14:36:03 2014	(r268460)
+++ head/gnu/lib/libreadline/Makefile	Wed Jul  9 15:52:30 2014	(r268461)
@@ -1,5 +1,5 @@
 # $FreeBSD$
 
-SUBDIR = history readline
+SUBDIR = readline
 
 .include 

Modified: head/gnu/lib/libreadline/readline/Makefile
==============================================================================
--- head/gnu/lib/libreadline/readline/Makefile	Wed Jul  9 14:36:03 2014	(r268460)
+++ head/gnu/lib/libreadline/readline/Makefile	Wed Jul  9 15:52:30 2014	(r268461)
@@ -1,10 +1,8 @@
 # $FreeBSD$
 
-SUBDIR= doc
-
 LIB=    readline
-MAN=    doc/readline.3
-SHLIBDIR?=	/lib
+INTERNALLIB=	yes
+NO_MAN=	yes
 
 TILDESRC= tilde.c
 SRCS=     readline.c vi_mode.c funmap.c keymaps.c parens.c search.c \
@@ -15,13 +13,17 @@ SRCS=     readline.c vi_mode.c funmap.c 
 INSTALLED_HEADERS= readline.h chardefs.h keymaps.h history.h tilde.h \
 		   rlstdc.h rlconf.h rltypedefs.h
 
-DPADD=	${LIBTERMCAP}
-LDADD=	-ltermcap
-
-INCSDIR=${INCLUDEDIR}/readline
+CFLAGS+=	-I${.OBJDIR}/..
+SRCDIR=	${.CURDIR}/../../../../contrib/libreadline
 
-.for hdr in ${INSTALLED_HEADERS}
-INCS+=	${SRCDIR}/${hdr}
+.for _h in ${INSTALLED_HEADERS}
+CLEANFILES+=	${_h}
+DPSRCS+=	${.OBJDIR}/${_h}
+${.OBJDIR}/${_h}:	${SRCDIR}/${_h}
+	${INSTALL} ${.ALLSRC} ${.TARGET}
 .endfor
 
+DPADD=	${LIBTERMCAP}
+LDADD=	-ltermcap
+
 .include 

Modified: head/gnu/usr.bin/gdb/Makefile.inc
==============================================================================
--- head/gnu/usr.bin/gdb/Makefile.inc	Wed Jul  9 14:36:03 2014	(r268460)
+++ head/gnu/usr.bin/gdb/Makefile.inc	Wed Jul  9 15:52:30 2014	(r268461)
@@ -15,6 +15,8 @@ CNTRB_RL= ${CNTRB_ROOT}/libreadline
 OBJ_ROOT= ${.OBJDIR}/../..
 OBJ_BU= ${OBJ_ROOT}/binutils
 OBJ_GDB= ${OBJ_ROOT}/gdb
+OBJ_RL= ${OBJ_ROOT}/../lib/libreadline/readline
+LIBREADLINE=	${OBJ_ROOT}/../lib/libreadline/readline/libreadline.a
 
 # These assignments duplicate much of the functionality of
 # MACHINE_CPUARCH, but there's no easy way to export make functions...
@@ -46,6 +48,7 @@ CFLAGS+= -I${CNTRB_GDB}/gdb/config
 CFLAGS+= -I${CNTRB_BU}/include
 CFLAGS+= -I${CNTRB_GDB}/include
 CFLAGS+= -I${CNTRB_BU}/bfd
+CFLAGS+= -I${OBJ_RL}/..
 
 GENSRCS+= nm.h tm.h
 

Modified: head/gnu/usr.bin/gdb/gdb/Makefile
==============================================================================
--- head/gnu/usr.bin/gdb/gdb/Makefile	Wed Jul  9 14:36:03 2014	(r268460)
+++ head/gnu/usr.bin/gdb/gdb/Makefile	Wed Jul  9 15:52:30 2014	(r268461)
@@ -12,7 +12,7 @@ GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a
 LDFLAGS+= -Wl,-E
 
 DPADD=	${GDBLIBS} ${BULIBS} ${LIBM} ${LIBREADLINE} ${LIBTERMCAP} ${LIBGNUREGEX}
-LDADD=	${GDBLIBS} ${BULIBS} -lm -lreadline -ltermcap -lgnuregex
+LDADD=	${GDBLIBS} ${BULIBS} -lm ${LIBREADLINE} -ltermcap -lgnuregex
 
 NO_PIE=	yes
 

Modified: head/gnu/usr.bin/gdb/gdbtui/Makefile
==============================================================================
--- head/gnu/usr.bin/gdb/gdbtui/Makefile	Wed Jul  9 14:36:03 2014	(r268460)
+++ head/gnu/usr.bin/gdb/gdbtui/Makefile	Wed Jul  9 15:52:30 2014	(r268461)
@@ -13,7 +13,7 @@ GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a
 LDFLAGS+= -Wl,-E
 
 DPADD=	${GDBLIBS} ${BULIBS} ${LIBM} ${LIBREADLINE} ${LIBTERMCAP} ${LIBGNUREGEX}
-LDADD=	${GDBLIBS} ${BULIBS} -lm -lreadline -ltermcap -lgnuregex
+LDADD=	${GDBLIBS} ${BULIBS} -lm ${LIBREADLINE} -ltermcap -lgnuregex
 
 NO_PIE=	yes
 

Modified: head/gnu/usr.bin/gdb/kgdb/Makefile
==============================================================================
--- head/gnu/usr.bin/gdb/kgdb/Makefile	Wed Jul  9 14:36:03 2014	(r268460)
+++ head/gnu/usr.bin/gdb/kgdb/Makefile	Wed Jul  9 15:52:30 2014	(r268461)
@@ -10,7 +10,7 @@ GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a
 
 DPADD=	${GDBLIBS} ${BULIBS} ${LIBKVM} ${LIBM} ${LIBREADLINE} ${LIBTERMCAP} \
 	${LIBGNUREGEX}
-LDADD=	${GDBLIBS} ${BULIBS} -lkvm${GDB_SUFFIX} -lm -lreadline -ltermcap \
+LDADD=	${GDBLIBS} ${BULIBS} -lkvm${GDB_SUFFIX} -lm ${LIBREADLINE} -ltermcap \
 	-lgnuregex
 
 .if defined(GDB_CROSS_DEBUGGER)

Modified: head/share/mk/bsd.libnames.mk
==============================================================================
--- head/share/mk/bsd.libnames.mk	Wed Jul  9 14:36:03 2014	(r268460)
+++ head/share/mk/bsd.libnames.mk	Wed Jul  9 15:52:30 2014	(r268461)
@@ -57,7 +57,6 @@ LIBGNUREGEX?=	${DESTDIR}${LIBDIR}/libgnu
 LIBGSSAPI?=	${DESTDIR}${LIBDIR}/libgssapi.a
 LIBGSSAPI_KRB5?= ${DESTDIR}${LIBDIR}/libgssapi_krb5.a
 LIBHDB?=	${DESTDIR}${LIBDIR}/libhdb.a
-LIBHISTORY?=	${DESTDIR}${LIBDIR}/libhistory.a
 LIBHEIMBASE?=	${DESTDIR}${LIBDIR}/libheimbase.a
 LIBHEIMIPCC?=	${DESTDIR}${LIBPRIVATEDIR}/libheimipcc.a
 LIBHEIMIPCS?=	${DESTDIR}${LIBPRIVATEDIR}/libheimipcs.a
@@ -127,7 +126,6 @@ LIBPROC?=	${DESTDIR}${LIBDIR}/libproc.a
 LIBPROCSTAT?=	${DESTDIR}${LIBDIR}/libprocstat.a
 LIBPTHREAD?=	${DESTDIR}${LIBDIR}/libpthread.a
 LIBRADIUS?=	${DESTDIR}${LIBDIR}/libradius.a
-LIBREADLINE?=	${DESTDIR}${LIBDIR}/libreadline.a
 LIBROKEN?=	${DESTDIR}${LIBDIR}/libroken.a
 LIBRPCSVC?=	${DESTDIR}${LIBDIR}/librpcsvc.a
 LIBRPCSEC_GSS?=	${DESTDIR}${LIBDIR}/librpcsec_gss.a

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==============================================================================
--- head/tools/build/mk/OptionalObsoleteFiles.inc	Wed Jul  9 14:36:03 2014	(r268460)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc	Wed Jul  9 15:52:30 2014	(r268461)
@@ -1998,7 +1998,6 @@ OLD_FILES+=usr/share/info/history.info.g
 OLD_FILES+=usr/share/info/info-stnd.info.gz
 OLD_FILES+=usr/share/info/info.info.gz
 OLD_FILES+=usr/share/info/ld.info.gz
-OLD_FILES+=usr/share/info/readline.info.gz
 OLD_FILES+=usr/share/info/regex.info.gz
 OLD_FILES+=usr/share/info/rluserman.info.gz
 OLD_FILES+=usr/share/info/stabs.info.gz
@@ -3725,7 +3724,6 @@ OLD_FILES+=usr/lib/libpcap_p.a
 OLD_FILES+=usr/lib/libpmc_p.a
 OLD_FILES+=usr/lib/libpthread_p.a
 OLD_FILES+=usr/lib/libradius_p.a
-OLD_FILES+=usr/lib/libreadline_p.a
 OLD_FILES+=usr/lib/libroken_p.a
 OLD_FILES+=usr/lib/librpcsvc_p.a
 OLD_FILES+=usr/lib/librt_p.a

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 16:07:36 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9C4A9229;
 Wed,  9 Jul 2014 16:07:36 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 893EF2E0A;
 Wed,  9 Jul 2014 16:07:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s69G7ahK076729;
 Wed, 9 Jul 2014 16:07:36 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s69G7aQL076728;
 Wed, 9 Jul 2014 16:07:36 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201407091607.s69G7aQL076728@svn.freebsd.org>
From: Glen Barber 
Date: Wed, 9 Jul 2014 16:07:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268462 - head/release/doc/en_US.ISO8859-1/relnotes
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 16:07:36 -0000

Author: gjb
Date: Wed Jul  9 16:07:36 2014
New Revision: 268462
URL: http://svnweb.freebsd.org/changeset/base/268462

Log:
  Document r268461, readline(3) shlib no longer installed, and
  statically linked into consumers in the base system.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/release/doc/en_US.ISO8859-1/relnotes/article.xml

Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml
==============================================================================
--- head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Wed Jul  9 15:52:30 2014	(r268461)
+++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml	Wed Jul  9 16:07:36 2014	(r268462)
@@ -360,6 +360,11 @@
       /usr/local/etc/newsyslog.conf.d/
       directories by default for &man.newsyslog.8;.
 
+    The &man.readline.3; library is now
+      statically linked in software within the base system, and the
+      shared library is no longer installed, allowing the Ports
+      Collection to use a modern version of the library.
+
     
       <filename>/etc/rc.d</filename> Scripts
 

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 16:13:17 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 1C3E14B8
 for ; Wed,  9 Jul 2014 16:13:17 +0000 (UTC)
Received: from nm18-vm0.bullet.mail.bf1.yahoo.com
 (nm18-vm0.bullet.mail.bf1.yahoo.com [98.139.213.138])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 900382EC3
 for ; Wed,  9 Jul 2014 16:13:16 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1404922057; bh=ETjSjW2En0ZUyYwVEaorP03bXCQNnI9j5aaBsyJgQ+w=;
 h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding;
 b=OG7pVdMCjLjLzEa+vTfxdMqhjDcrGHtDr843bvJzErBe1gyG7RqVTjyFF3dxYlWL+6Rb81pVvB7aWnhwVXwlfb0Uc4g4Ud9K4xwPHkNML/yU3GU+3d+KP3vLr/tpHVFNhM3Kc1CuhTzpN/CGkroUkDgy1CPx9ewBAzSObOPGS6FhiPBapaunDeE9WlFuf6ZWgvIHYxyT1QHFEPsbHmAPtsfyLu0yZ9vGRHkYzyQQG5lFmAYV4DsXzt69xk2ijvCWfVzUkaq5jNN/ukLVw8id5RRN19NpnVrULGBF6xc1n0MgDR2ye63MnJldimx8PHyyiASkyPClSHaQP+wriP2dtg==
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com;
 b=WUWqGxeiXVBfZiBt4KmAApwPqnl//s+qAJzALCRs866a/1CakjZVFr+c1GngbvV3MP2H5hWkUGhkjoFe+hgeUzQBH9W11ryXZHbH0uJ4unJOvo24u5J3lv/hgv4K6IU3d02TrGOzS8A73nWFmYwnG9SQ868reqwLclIdwE8eF3CdmO79pnZHrfWYwxpp85ML+tQGPdrFWEuqqVYqqqDttci2z91OjKCxFoHBzSyeh18jBkofPYwsCBJz9nc7H2LWJ7famBJJMzeoYOumX4ywdWmiofXXIee6FuqHXPV500gZfVQboEQMztjLjgcAPCBGmOmvPruqiMRY53InjH2sdA==;
Received: from [66.196.81.174] by nm18.bullet.mail.bf1.yahoo.com with NNFMP;
 09 Jul 2014 16:07:37 -0000
Received: from [68.142.230.78] by tm20.bullet.mail.bf1.yahoo.com with NNFMP;
 09 Jul 2014 16:07:37 -0000
Received: from [127.0.0.1] by smtp235.mail.bf1.yahoo.com with NNFMP;
 09 Jul 2014 16:07:37 -0000
X-Yahoo-Newman-Id: 3014.89804.bm@smtp235.mail.bf1.yahoo.com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: NEpv3q0VM1k8BJEpnQyQ7AJ8n5HU7j6wzb866PotQYrjDiK
 Nkz3xq9HX42lMbxtDy_8vfjNIS.BYxWyb1.c8P9piA5GJKyBKCCFJWpdl1YF
 Yca8f6kR.YYbCoqkCpidMmRTHANs52j6yw8TfFgYRWJSjNOUh3Y2PKJSVO0g
 zS3Ra6S3_03todoRpRQEdLk3V.3VUVdb8UUOW6dMHYdYwqBOoeUgukNGODm1
 v7cLvFWK5EmaUPdaTJ_UjwYs.j9NDtdBacmU6G4rgBY9k0KLttmwsE0sc7gL
 ZxE8FuNhdmBLooc2njEU394da4t0Tnjcef08H8RbuDeQ_wgHNKC4BsI7EwXg
 Wrd3DjQTUbrBMzZNHjZOyGDCTK82ctMKRUo8vn3etsGr54L.KBCeJkpqw1wU
 g2NvbF6uKbpUAYaX7k1Dn96f7FeNYoEvrXXFceLaTxGxiwC8qco4ohJb58PU
 d9y9YCBVaUn64M4rrPfbJ9bDyQkG1.HKk3vn56HtCaeTrUOfWsVIHpNu2_xQ
 T6HNoglu_KGq0f7lwlB64ERXC_o_49_QdYsK8tR7079R12ZHyozXli6Tj5E5
 Rx1NYjh2d39aiWFWmCnzpOkwsKm_p0Z0x4Mr7riJ6Gs9BNMmrh5ajneWpHrm
 tn1iucU.rmUW4r0_Eioff_0y4OUebAYQRaX4jpukKtBdTndPZcPFBXFEvzyA
 zMHsbQZ0ujVlG1jPusaE.LSBkEvDqXzXRyXkNn3g6ttCOCg0YwLWB9aowJ55
 83wrwREgeadWctqk-
X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf
Message-ID: <53BD68E4.1070706@freebsd.org>
Date: Wed, 09 Jul 2014 11:08:04 -0500
From: Pedro Giffuni 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Baptiste Daroussin , src-committers@freebsd.org, 
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject: Re: svn commit: r268461 - in head: . gnu/lib/libreadline
 gnu/lib/libreadline/history
 gnu/lib/libreadline/readline gnu/lib/libreadline/readline/doc gnu/usr.bin/gdb
 gnu/usr.bin/gdb/gdb gnu/usr.bin/gdb/gd...
References: <201407091552.s69FqUon070685@svn.freebsd.org>
In-Reply-To: <201407091552.s69FqUon070685@svn.freebsd.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 16:13:17 -0000


On 07/09/14 10:52, Baptiste Daroussin wrote:
> Author: bapt
> Date: Wed Jul  9 15:52:30 2014
> New Revision: 268461
> URL: http://svnweb.freebsd.org/changeset/base/268461
>
> Log:
>    The GNU readline library is now an INTERNALLIB - that is, it is
>    statically linked into consumers (GDB and variants) in the base
>    system, and the shared library is no longer installed.
>    
>    That also allows ports to be able to use a modern version of readline
>   

Nice, thank you.
I guess libgnuregex is also a good candidate for such treatment :).

For a related reading:

http://dtrace.org/blogs/wesolows/2014/04/10/libsunw_ssl-or-how-smartos-avoids-sadness/

Cheers,

Pedro.

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 17:12:28 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E3ADB98B;
 Wed,  9 Jul 2014 17:12:28 +0000 (UTC)
Received: from mail-vc0-x22d.google.com (mail-vc0-x22d.google.com
 [IPv6:2607:f8b0:400c:c03::22d])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 3783F24A6;
 Wed,  9 Jul 2014 17:12:28 +0000 (UTC)
Received: by mail-vc0-f173.google.com with SMTP id lf12so7507577vcb.18
 for ; Wed, 09 Jul 2014 10:12:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date:message-id:subject
 :from:to:cc:content-type;
 bh=SVd08kRD4xCCQX/Q50NKIL5/ihnOS/7r1A9L51+KWic=;
 b=ez8ZsSecPHxucW6fhOEqm7o0+1QHdoB74vAhUA+byRki0nwnWAZ5c3rPch6+daFQjq
 SLtrT43JBVuFdyKmcaGv/LtiC1SCRAspcWIZt5IwYL5YRyGPl1Tage8aIKilhsu+FmrX
 WlTuXZSUroKWXbWPfVVnir9tRwlHTOmjffH0pTqmObd4PPbZM7uXJ/i8dGGxj1yLwluo
 Zz/1UHd4RJw3aawIPTSPy8t/QDgAaQwvtKk2s2HInfwN3SypMSN0a6Q++9cK7H4cmIJt
 CDlENSyqFQYK/atIiaaR3G8C0SZx00+f9tg0BhPfMRZJJyH2qxR+Rm/ZHquhliIC9y4X
 tcAg==
MIME-Version: 1.0
X-Received: by 10.58.46.34 with SMTP id s2mr1628164vem.49.1404925947108; Wed,
 09 Jul 2014 10:12:27 -0700 (PDT)
Sender: adrian.chadd@gmail.com
Received: by 10.224.202.193 with HTTP; Wed, 9 Jul 2014 10:12:27 -0700 (PDT)
In-Reply-To: <53BD68E4.1070706@freebsd.org>
References: <201407091552.s69FqUon070685@svn.freebsd.org>
 <53BD68E4.1070706@freebsd.org>
Date: Wed, 9 Jul 2014 10:12:27 -0700
X-Google-Sender-Auth: ZamK1d4xhLbl1rfqWFuUUlI2hvU
Message-ID: 
Subject: Re: svn commit: r268461 - in head: . gnu/lib/libreadline
 gnu/lib/libreadline/history gnu/lib/libreadline/readline
 gnu/lib/libreadline/readline/doc
 gnu/usr.bin/gdb gnu/usr.bin/gdb/gdb gnu/usr.bin/gdb/gd...
From: Adrian Chadd 
To: Pedro Giffuni 
Content-Type: text/plain; charset=UTF-8
Cc: "svn-src-head@freebsd.org" ,
 Baptiste Daroussin ,
 "src-committers@freebsd.org" ,
 "svn-src-all@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 17:12:29 -0000

Hi,

By doing this you're actually making more work for the really embedded
people who have size constraints on things.

I dislike privatelib but it at least allows for code sharing where
before people would just statically link things into binaries.

I've had to actively undo this kind of dumb before in order to get
things to fit on very small flash root filesystems.

Shared libraries are good. Please stop assuming we have lots of disk
space and RAM to have duplicates of things floating around.

I request that if you're going to de-shareify things in the future you
at least bring it up with the embedded crowd to see if we can find a
way or two to make it work. The review list doesn't have anyone on it
even remotely caring about memory or storage pressures.



Thanks,



-a


On 9 July 2014 09:08, Pedro Giffuni  wrote:
>
> On 07/09/14 10:52, Baptiste Daroussin wrote:
>>
>> Author: bapt
>> Date: Wed Jul  9 15:52:30 2014
>> New Revision: 268461
>> URL: http://svnweb.freebsd.org/changeset/base/268461
>>
>> Log:
>>    The GNU readline library is now an INTERNALLIB - that is, it is
>>    statically linked into consumers (GDB and variants) in the base
>>    system, and the shared library is no longer installed.
>>       That also allows ports to be able to use a modern version of
>> readline
>>
>
>
> Nice, thank you.
> I guess libgnuregex is also a good candidate for such treatment :).
>
> For a related reading:
>
> http://dtrace.org/blogs/wesolows/2014/04/10/libsunw_ssl-or-how-smartos-avoids-sadness/
>
> Cheers,
>
> Pedro.
>

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 17:23:12 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 4FCFAD50;
 Wed,  9 Jul 2014 17:23:12 +0000 (UTC)
Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com
 [IPv6:2a00:1450:400c:c00::231])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 3E83825BC;
 Wed,  9 Jul 2014 17:23:11 +0000 (UTC)
Received: by mail-wg0-f49.google.com with SMTP id a1so4407662wgh.20
 for ; Wed, 09 Jul 2014 10:23:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=n1GPv1Lq3XJDFYXHwa6KvUBSzLpjIIfs9VqV3W+xGoc=;
 b=YsY/yL0e776zk5OO+gPI4OKx0lMe3fEEF1i0MQJymUuQ0Fxuq2r6RaMioOdMYYB7Sb
 vPTLSvGum5ttwz+TQtDTZ/3HMyjq6k05VEFGmvGj8pap6d2FUTm2tBgp5rT72V/PratR
 yALC1eMvXfPq4POtbCjog32L95XrBc8su6iop6zAffPEh17eacqEsD980u4Z4c9L/aFV
 jzIxIqFkVHMLo3M1ZuQX8cERb5+TJIZecmHptCpixJgcE4ztl3xUiyR9/rrygNU44p7M
 3bmCpqW3STYgrEPRkipb0BmBrTqfADHHlP2dTnqztHHGWtM24ryHHmtGwwECTmAZ0uQ5
 YuHg==
X-Received: by 10.194.92.115 with SMTP id cl19mr50395510wjb.29.1404926589463; 
 Wed, 09 Jul 2014 10:23:09 -0700 (PDT)
Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1])
 by mx.google.com with ESMTPSA id r9sm21568144wia.17.2014.07.09.10.23.07
 for 
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 09 Jul 2014 10:23:08 -0700 (PDT)
Sender: Baptiste Daroussin 
Date: Wed, 9 Jul 2014 19:23:06 +0200
From: Baptiste Daroussin 
To: Adrian Chadd 
Subject: Re: svn commit: r268461 - in head: . gnu/lib/libreadline
 gnu/lib/libreadline/history gnu/lib/libreadline/readline
 gnu/lib/libreadline/readline/doc gnu/usr.bin/gdb gnu/usr.bin/gdb/gdb
 gnu/usr.bin/gdb/gd...
Message-ID: <20140709172305.GD56040@ivaldir.etoilebsd.net>
References: <201407091552.s69FqUon070685@svn.freebsd.org>
 <53BD68E4.1070706@freebsd.org>
 
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="UoPmpPX/dBe4BELn"
Content-Disposition: inline
In-Reply-To: 
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 Pedro Giffuni ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 17:23:12 -0000


--UoPmpPX/dBe4BELn
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 09, 2014 at 10:12:27AM -0700, Adrian Chadd wrote:
> Hi,
>=20
> By doing this you're actually making more work for the really embedded
> people who have size constraints on things.
>=20
> I dislike privatelib but it at least allows for code sharing where
> before people would just statically link things into binaries.

do you install gdb on your embedded environnement? because that is the only
user of libreadline.
>=20
> I've had to actively undo this kind of dumb before in order to get
> things to fit on very small flash root filesystems.
>=20
> Shared libraries are good. Please stop assuming we have lots of disk
> space and RAM to have duplicates of things floating around.

Facts:
Before
gdb + kgdb + gdbtui + libreadline.so.8 + libhistory.so.8 =3D 8976 k
After
gdb + kgdb + gdbtui =3D 8973 k

I don't think I have damaged too much your embedded system am I wrong?

Do I miss something?

(Yes I have checked that before turning into an internallib given my first
approach was to turn into a privatelib.

regards,
Bapt

--UoPmpPX/dBe4BELn
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlO9enkACgkQ8kTtMUmk6Ez1nQCcC+FhheIkKn7TXO5gEWjhxZT9
JPgAoLZRexZRluFNJ8bMRBSkhB+w+Mro
=CVAQ
-----END PGP SIGNATURE-----

--UoPmpPX/dBe4BELn--

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 17:31:57 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E66ACF53;
 Wed,  9 Jul 2014 17:31:57 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id B98062678;
 Wed,  9 Jul 2014 17:31:57 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s69HVvl9019002;
 Wed, 9 Jul 2014 17:31:57 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s69HVv9F019000;
 Wed, 9 Jul 2014 17:31:57 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201407091731.s69HVv9F019000@svn.freebsd.org>
From: Dimitry Andric 
Date: Wed, 9 Jul 2014 17:31:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268463 - head/lib/libproc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 17:31:58 -0000

Author: dim
Date: Wed Jul  9 17:31:57 2014
New Revision: 268463
URL: http://svnweb.freebsd.org/changeset/base/268463

Log:
  In libproc, avoid calling __cxa_demangle(), and thus depending on either
  libcxxrt or libsupc++, if WITHOUT_CXX is defined.
  
  Noticed by:	sbruno
  MFC after:	1 week

Modified:
  head/lib/libproc/Makefile
  head/lib/libproc/proc_sym.c

Modified: head/lib/libproc/Makefile
==============================================================================
--- head/lib/libproc/Makefile	Wed Jul  9 16:07:36 2014	(r268462)
+++ head/lib/libproc/Makefile	Wed Jul  9 17:31:57 2014	(r268463)
@@ -15,7 +15,9 @@ INCS=	libproc.h
 
 CFLAGS+=	-I${.CURDIR}
 
-.if ${MK_LIBCPLUSPLUS} != "no"
+.if ${MK_CXX} == "no"
+CFLAGS+=	-DNO_CXA_DEMANGLE
+.elif ${MK_LIBCPLUSPLUS} != "no"
 LDADD+=		-lcxxrt
 DPADD+=		${LIBCXXRT}
 .else

Modified: head/lib/libproc/proc_sym.c
==============================================================================
--- head/lib/libproc/proc_sym.c	Wed Jul  9 16:07:36 2014	(r268462)
+++ head/lib/libproc/proc_sym.c	Wed Jul  9 17:31:57 2014	(r268463)
@@ -46,27 +46,34 @@
 
 #include "_libproc.h"
 
+#ifndef NO_CXA_DEMANGLE
 extern char *__cxa_demangle(const char *, char *, size_t *, int *);
+#endif /* NO_CXA_DEMANGLE */
 
 static void	proc_rdl2prmap(rd_loadobj_t *, prmap_t *);
 
 static void
 demangle(const char *symbol, char *buf, size_t len)
 {
+#ifndef NO_CXA_DEMANGLE
 	char *dembuf;
-	size_t demlen = len;
+	size_t demlen;
 
-	dembuf = malloc(len);
-	if (!dembuf)
-		goto fail;
-	dembuf = __cxa_demangle(symbol, dembuf, &demlen, NULL);
-	if (!dembuf)
-		goto fail;
-	strlcpy(buf, dembuf, len);
-	free(dembuf);
+	if (symbol[0] == '_' && symbol[1] == 'Z' && symbol[2]) {
+		dembuf = malloc(len);
+		if (!dembuf)
+			goto fail;
+		demlen = len;
+		dembuf = __cxa_demangle(symbol, dembuf, &demlen, NULL);
+		if (!dembuf)
+			goto fail;
+		strlcpy(buf, dembuf, len);
+		free(dembuf);
+	}
 
 	return;
 fail:
+#endif /* NO_CXA_DEMANGLE */
 	strlcpy(buf, symbol, len);
 }
 
@@ -297,10 +304,7 @@ proc_addr2sym(struct proc_handle *p, uin
 		if (addr >= rsym && addr < rsym + sym.st_size) {
 			s = elf_strptr(e, dynsymstridx, sym.st_name);
 			if (s) {
-				if (s[0] == '_' && s[1] == 'Z' && s[2])
-					demangle(s, name, namesz);
-				else
-					strlcpy(name, s, namesz);
+				demangle(s, name, namesz);
 				memcpy(symcopy, &sym, sizeof(sym));
 				/*
 				 * DTrace expects the st_value to contain
@@ -335,10 +339,7 @@ symtab:
 		if (addr >= rsym && addr < rsym + sym.st_size) {
 			s = elf_strptr(e, symtabstridx, sym.st_name);
 			if (s) {
-				if (s[0] == '_' && s[1] == 'Z' && s[2])
-					demangle(s, name, namesz);
-				else
-					strlcpy(name, s, namesz);
+				demangle(s, name, namesz);
 				memcpy(symcopy, &sym, sizeof(sym));
 				/*
 				 * DTrace expects the st_value to contain

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 17:32:54 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 11E9F133;
 Wed,  9 Jul 2014 17:32:54 +0000 (UTC)
Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com
 [IPv6:2a00:1450:400c:c05::233])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 2C3672684;
 Wed,  9 Jul 2014 17:32:53 +0000 (UTC)
Received: by mail-wi0-f179.google.com with SMTP id cc10so3180355wib.6
 for ; Wed, 09 Jul 2014 10:32:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=De9Y7D7bDM9e4FmJGP41Gp5C10Eqzz/IAmzU8Xnv+QE=;
 b=CuR0ZEVu7BuKb2KfSt3zmCZSoAQNMdbHmyjPfcL2CyUSLyaj/p2hK3xhhuRHlKGvmQ
 OtAHxpoJDrfVvwM5/mlp6xgAECNgzBzn66yAf3ug5Kdj6bHkIDzJSGRv4O2R7U+6sKtX
 JxO4iQuCyc+lO0S3Kx0lUUyA2Ni/v9XMOBMY0/UOCwrm5FKR44IFHvCvNvvNqLDf5HYH
 PcahBTNHPiCGxfSKnM52N9QHxq41QPhJtwhZEegEEcB5izRHwBICf0hjsc6/BZYCYQDq
 DT649aF23qS3rfBCIYKIO3EcjE24/9LUZ8XkKHbs78Ho72teCUDLTACxJ/3UQA0ypbsl
 696Q==
X-Received: by 10.194.185.238 with SMTP id ff14mr50582937wjc.9.1404927171390; 
 Wed, 09 Jul 2014 10:32:51 -0700 (PDT)
Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1])
 by mx.google.com with ESMTPSA id de5sm21664365wib.18.2014.07.09.10.32.49
 for 
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 09 Jul 2014 10:32:50 -0700 (PDT)
Sender: Baptiste Daroussin 
Date: Wed, 9 Jul 2014 19:32:48 +0200
From: Baptiste Daroussin 
To: Pedro Giffuni 
Subject: Fix private/internal lib (was Re: svn commit: r268461 - in head: .
 gnu/lib/libreadline) gnu/lib/libreadline/history
 gnu/lib/libreadline/readline gnu/lib/libreadline/readline/doc
 gnu/usr.bin/gdb gnu/usr.bin/gdb/gdb gnu/usr.bin/gdb/gd...
Message-ID: <20140709173248.GE56040@ivaldir.etoilebsd.net>
References: <201407091552.s69FqUon070685@svn.freebsd.org>
 <53BD68E4.1070706@freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="Dzs2zDY0zgkG72+7"
Content-Disposition: inline
In-Reply-To: <53BD68E4.1070706@freebsd.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 17:32:54 -0000


--Dzs2zDY0zgkG72+7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 09, 2014 at 11:08:04AM -0500, Pedro Giffuni wrote:
>=20
> On 07/09/14 10:52, Baptiste Daroussin wrote:
> > Author: bapt
> > Date: Wed Jul  9 15:52:30 2014
> > New Revision: 268461
> > URL: http://svnweb.freebsd.org/changeset/base/268461
> >
> > Log:
> >    The GNU readline library is now an INTERNALLIB - that is, it is
> >    statically linked into consumers (GDB and variants) in the base
> >    system, and the shared library is no longer installed.
> >   =20
> >    That also allows ports to be able to use a modern version of readline
> >  =20
>=20
> Nice, thank you.
> I guess libgnuregex is also a good candidate for such treatment :).
>=20
gnuregex is another beast it is used in at more places:
- GNU diff
- GNU grep
- BSD grep
- gdb
- kgdb
- gdbtui

That makes it more a candidate for privatellib, but private lib needs to be
fixed first, it has a couple of problems so far:
- it installs .so, .a and _p.a files while it shouldn't
- they are listed in bsd.libnames.mk so exposed to any bsd.*.mk users when =
it
  should only be internal of to out build system
- when a part of the system tries to link to a privatelib it links to
  ${DESTDIR}/usr/lib/private/${LIB}.so when it should link to the path on O=
BJDIR
  because the .so is not supposed to be installed into the target.

We need a framework internal to the build system (aka not installed in base)
that list the privatelib/internallib (looks at the ugly thing I have done in
gdb/Makefile.inc) and we need to link to the .so/a which it in the OBJDIR n=
ot in
the DESTDIR.

I have no idea how to do that right now (Warner any idea coming into your m=
ind?)

regards,
Bapt

--Dzs2zDY0zgkG72+7
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlO9fMAACgkQ8kTtMUmk6EzX/wCeNsSvEu09aUmpptRkE+wY2ULT
n3gAnjQKPN773B+N3wqG71lhe50k0QuQ
=o6EH
-----END PGP SIGNATURE-----

--Dzs2zDY0zgkG72+7--

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 17:59:59 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7C33D616
 for ; Wed,  9 Jul 2014 17:59:59 +0000 (UTC)
Received: from mail-ie0-f179.google.com (mail-ie0-f179.google.com
 [209.85.223.179])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 3D60B2869
 for ; Wed,  9 Jul 2014 17:59:58 +0000 (UTC)
Received: by mail-ie0-f179.google.com with SMTP id lx4so5603741iec.38
 for ; Wed, 09 Jul 2014 10:59:58 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:sender:from:content-type:mime-version:subject
 :in-reply-to:date:cc:content-transfer-encoding:message-id:references
 :to; bh=0gZHopz35K1bpldzbsE4HVlpge9Xo3VrIXl/4+1620I=;
 b=F3SbTZFcuoUMtQpzpoViU/Tzws1FBUQuFoK+LRxIsi83pXatheTx0nZ2gaZC+Rxkwj
 4rOlFE7reaXm7aBVXxYMCDqiCrG+wR4u7l8VXeW627qHthGPbfKJBYTpUNpNzFaSXHLo
 JGHtUbrFIr1b6tzrQQBcf6v+rtbm2U72SbjzQruLraQ5DXwFOg3vY7Bqz7ztg0PoYN8Q
 XHWR1+pj8rAJfogcrAVYdKpzAbKdOMHFaUFYLfPITZlHZmE/4PlHODiXdktbMgoumNpb
 mBQR1gIpQEfrsUhysv+VtsXTfBlVTRuLbV5qYZUDq4+pNfeiB8pgRANfKZwMKEcJ5qD3
 2trQ==
X-Gm-Message-State: ALoCoQnM3YtvTO+GeN66pDhZfIvaXEuvNYI91lr5IyROrGUYQYhZ/lQ4cgsPCirxfOWUQQO/YB4P
X-Received: by 10.50.114.194 with SMTP id ji2mr15222495igb.21.1404928797998;
 Wed, 09 Jul 2014 10:59:57 -0700 (PDT)
Received: from bsdimp.bsdimp.com
 (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198])
 by mx.google.com with ESMTPSA id ci7sm17365561igb.11.2014.07.09.10.59.57
 for 
 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Wed, 09 Jul 2014 10:59:57 -0700 (PDT)
Sender: Warner Losh 
From: Warner Losh 
X-Google-Original-From: Warner Losh 
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
Subject: Re: svn commit: r267424 - in head: share/mk tools/build/options
In-Reply-To: 
Date: Wed, 9 Jul 2014 11:59:57 -0600
Content-Transfer-Encoding: quoted-printable
Message-Id: <3D612E9D-240A-4599-B8C4-84CB90440742@gmail.com>
References: <201406121854.s5CIsrmq000136@svn.freebsd.org>
 <20140612235647.GO1248@hub.FreeBSD.org>
 <20140613002017.GP1248@hub.FreeBSD.org>
 
 <20140709010719.GM1216@hub.FreeBSD.org>
 
 <20140709023222.GO1216@hub.FreeBSD.org>
 
To: Julio Merino 
X-Mailer: Apple Mail (2.1878.6)
Cc: svn-src-head@freebsd.org, Glen Barber ,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 17:59:59 -0000


On Jul 8, 2014, at 8:34 PM, Julio Merino  wrote:

> On Tue, Jul 8, 2014 at 10:32 PM, Glen Barber  wrote:
>> On Tue, Jul 08, 2014 at 10:28:25PM -0400, Julio Merino wrote:
>>> On Tue, Jul 8, 2014 at 9:07 PM, Glen Barber  wrote:
>>>> This is one of the build failure cases:
>>>>=20
>>>> =
https://lists.freebsd.org/pipermail/freebsd-tinderbox/2014-June/014357.htm=
l
>>>=20
>>> Am I reading that right in that this was on a 9.2-STABLE host =
building HEAD?
>>=20
>> Yes.
>>=20
>> (I have no idea why, to be honest.  The tinderbox are outside of the
>> cluster admins control.)
>=20
> OK.  Regardless, I suppose that being able to build HEAD from the
> supported releases is supposed to work?  Even from 8.4?  Will
> investigate for 9.x.

The officially supported list is (and has been since FreeBSD 5 was =
current):

HEAD builds on =93recent=94 -current systems, tip of the latest stable =
branch, latest stable branch latest release.

That=92s the entire supported list.

What often works is: HEAD builds on any system back to the branch point =
of the most recent stable branch and any point on the stable branch. =
Frequently back one or two stable branches. We have people actively =
ensuring that most points on the latest stable branch (10) work, and at =
least one person who submits fixes for 9 and I don=92t think we=92ve =
broken 8 (there may be a person for that too, I haven=92t seen any =
commits).

Currently, we can build on 8.4 (last time I checked), but that may =
change with the next clang import since 8.4 doesn=92t have a compiler =
that can build it. We administratively block 7.x support and have =
removed it from our build system. Really old branches are impossible to =
test, so we balance GCing support for them with their usefulness.

Warner=

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 18:05:31 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 7314994C;
 Wed,  9 Jul 2014 18:05:31 +0000 (UTC)
Received: from mail-qg0-x232.google.com (mail-qg0-x232.google.com
 [IPv6:2607:f8b0:400d:c04::232])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id DDE8E292F;
 Wed,  9 Jul 2014 18:05:30 +0000 (UTC)
Received: by mail-qg0-f50.google.com with SMTP id j5so6697805qga.23
 for ; Wed, 09 Jul 2014 11:05:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date:message-id:subject
 :from:to:cc:content-type;
 bh=tdHSqvInTzWy6R6P111dEadwvf7uwpDAVxDiMOMwz9U=;
 b=RUqzd/HCqEasSgZmCvbvm8v4kZdDdSfDXTieIc1R3Kfw4rSCQIhKqnB2FE/Me7hKpe
 483aG3k6yVfnKplxepIlVvbwQZd6gClqtZxWwyZGoTgcl9Josu5kmDrwMQXPsVBJnJpN
 RHwpeC8uhy2myynPK0ZUad53I6sr90ks6WmrXR+SwUQ0n0Im+7QEl5IbxgKCISiAjnPE
 AtzaWsLjmeE4lLIw9lHEfOyIXfBDEaA10ocSKXktvY5LP2e6tYYExa3MYoXHE+3bt4qz
 PtveAU46uko51acaLBfnMeD1zh2X+waxerbF9EqeUgL7I8W9kMcmZGzINtoyMcsCPIOK
 WrKA==
MIME-Version: 1.0
X-Received: by 10.140.47.48 with SMTP id l45mr67985016qga.24.1404929129912;
 Wed, 09 Jul 2014 11:05:29 -0700 (PDT)
Sender: adrian.chadd@gmail.com
Received: by 10.224.202.193 with HTTP; Wed, 9 Jul 2014 11:05:29 -0700 (PDT)
In-Reply-To: <20140709172305.GD56040@ivaldir.etoilebsd.net>
References: <201407091552.s69FqUon070685@svn.freebsd.org>
 <53BD68E4.1070706@freebsd.org>
 
 <20140709172305.GD56040@ivaldir.etoilebsd.net>
Date: Wed, 9 Jul 2014 11:05:29 -0700
X-Google-Sender-Auth: ORJgjuM9Jf8fY2A2eDPC7a_v6KU
Message-ID: 
Subject: Re: svn commit: r268461 - in head: . gnu/lib/libreadline
 gnu/lib/libreadline/history gnu/lib/libreadline/readline
 gnu/lib/libreadline/readline/doc
 gnu/usr.bin/gdb gnu/usr.bin/gdb/gdb gnu/usr.bin/gdb/gd...
From: Adrian Chadd 
To: Baptiste Daroussin 
Content-Type: text/plain; charset=UTF-8
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 Pedro Giffuni ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 18:05:31 -0000

On 9 July 2014 10:23, Baptiste Daroussin  wrote:
> On Wed, Jul 09, 2014 at 10:12:27AM -0700, Adrian Chadd wrote:
>> Hi,
>>
>> By doing this you're actually making more work for the really embedded
>> people who have size constraints on things.
>>
>> I dislike privatelib but it at least allows for code sharing where
>> before people would just statically link things into binaries.
>
> do you install gdb on your embedded environnement? because that is the only
> user of libreadline.

See below.

>>
>> I've had to actively undo this kind of dumb before in order to get
>> things to fit on very small flash root filesystems.
>>
>> Shared libraries are good. Please stop assuming we have lots of disk
>> space and RAM to have duplicates of things floating around.
>
> Facts:
> Before
> gdb + kgdb + gdbtui + libreadline.so.8 + libhistory.so.8 = 8976 k
> After
> gdb + kgdb + gdbtui = 8973 k
>
> I don't think I have damaged too much your embedded system am I wrong?
>
> Do I miss something?
>
> (Yes I have checked that before turning into an internallib given my first
> approach was to turn into a privatelib.

Sure, except for the people who have done things like rolled local
configuration/management telnet interfaces for these things. They're
also using libreadline (and things like the cisco UI library.)

And yeah, I do install gdb in there from time to time. Code sometimes
needs debugging. :-)



-a

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 18:27:50 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id D47F4168;
 Wed,  9 Jul 2014 18:27:50 +0000 (UTC)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5BD8D2B29;
 Wed,  9 Jul 2014 18:27:50 +0000 (UTC)
Received: from tom.home (kib@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s69IRjbZ088112
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
 Wed, 9 Jul 2014 21:27:45 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s69IRjbZ088112
Received: (from kostik@localhost)
 by tom.home (8.14.9/8.14.9/Submit) id s69IRjno088111;
 Wed, 9 Jul 2014 21:27:45 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Wed, 9 Jul 2014 21:27:45 +0300
From: Konstantin Belousov 
To: Adrian Chadd 
Subject: Re: svn commit: r268461 - in head: . gnu/lib/libreadline
 gnu/lib/libreadline/history gnu/lib/libreadline/readline
 gnu/lib/libreadline/readline/doc gnu/usr.bin/gdb gnu/usr.bin/gdb/gdb
 gnu/usr.bin/gdb/gd...
Message-ID: <20140709182745.GD93733@kib.kiev.ua>
References: <201407091552.s69FqUon070685@svn.freebsd.org>
 <53BD68E4.1070706@freebsd.org>
 
 <20140709172305.GD56040@ivaldir.etoilebsd.net>
 
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="8yXJwKnNP0rurr9c"
Content-Disposition: inline
In-Reply-To: 
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 autolearn_force=no version=3.4.0
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home
Cc: "svn-src-head@freebsd.org" ,
 Baptiste Daroussin , Pedro Giffuni ,
 "src-committers@freebsd.org" ,
 "svn-src-all@freebsd.org" 
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 18:27:50 -0000


--8yXJwKnNP0rurr9c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 09, 2014 at 11:05:29AM -0700, Adrian Chadd wrote:
> On 9 July 2014 10:23, Baptiste Daroussin  wrote:
> > On Wed, Jul 09, 2014 at 10:12:27AM -0700, Adrian Chadd wrote:
> >> Hi,
> >>
> >> By doing this you're actually making more work for the really embedded
> >> people who have size constraints on things.
> >>
> >> I dislike privatelib but it at least allows for code sharing where
> >> before people would just statically link things into binaries.
> >
> > do you install gdb on your embedded environnement? because that is the =
only
> > user of libreadline.
>=20
> See below.
>=20
> >>
> >> I've had to actively undo this kind of dumb before in order to get
> >> things to fit on very small flash root filesystems.
> >>
> >> Shared libraries are good. Please stop assuming we have lots of disk
> >> space and RAM to have duplicates of things floating around.
> >
> > Facts:
> > Before
> > gdb + kgdb + gdbtui + libreadline.so.8 + libhistory.so.8 =3D 8976 k
> > After
> > gdb + kgdb + gdbtui =3D 8973 k
> >
> > I don't think I have damaged too much your embedded system am I wrong?
> >
> > Do I miss something?
> >
> > (Yes I have checked that before turning into an internallib given my fi=
rst
> > approach was to turn into a privatelib.
>=20
> Sure, except for the people who have done things like rolled local
> configuration/management telnet interfaces for these things. They're
> also using libreadline (and things like the cisco UI library.)
>=20
> And yeah, I do install gdb in there from time to time. Code sometimes
> needs debugging. :-)
>=20

What Baptiste did is the only correct way to handle the ABI and API
un-stability issues with the third-party libraries.  The change is
good if only for this sole reason.  Private libraries still conflict
with the same library installed by other means, in the single process
image.

That said, if you do development directly on the tiny platforms, the
remote gdb server is probably better solution than the local gdb.
Also, WITH_SHARED_TOOLCHAIN probably would give you much bigger
savings both in disk space and used memory than libreadline and
libgnuregex.  I just abandoned a hope to flip this knob.

--8yXJwKnNP0rurr9c
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJTvYmhAAoJEJDCuSvBvK1BHpoP/iotJ2yg8lzfIjdkyz9bWNcQ
KtITXvDSENO9sdUf1Gc29R4lRHD7BEZjaI7C37DaafkV2AL5taHltT++NqKmSC4U
fEzyTv2c9Aau8V+nv0wp2zxWLq7dkMAY/5GDkzlT9JeATJ3ROfX6T5Wb19fAp6Nb
sEOSVv5wRQNMEkikNAX6Lq7RMJVL+XRt9nOOiriCDwid/xaWZE89uh3+wLmm5olm
QWcYCuC3OMNwP1Ee+qbk+Wy5l67xwXuq1a3hazydpldKEubs0cwcqOcP21K6pNFH
A6EKfLQkty4YuJyjFTKDjW2HTYr3gAzmo58GGXNZ0wV2PYXux5h7nEgXcd2HF+vF
sn4oTnFDTxU8AtxjStjsmuaRyicVS/ldEoHxAE4TM1NSM+nI199LxMKxSYxkuqwg
8y0QxL22fc2XTHxAHPVjMPJ6/uLeDK5+pEDBGRlGES1Kn4IjATw9mvTOOWJaKpqv
5qe3rdoDvCCs/aLZU5Y5EeEihN7yEvzyjAhQF0ZNaslMsMv2ovLVmTeqXiIjokuk
GYJJ2i4IeZRUcig0g9zMSFlpUSeMZZzXMAeDyFVa6x2WOvdQ+3v3OAc/2tKlwbat
4nOdcfkbtnC6hb7/mAI4dnjQVtXiiHOCZ1N4OAywt0Lhzh8ZzOnrq0eWlxIjHJWK
5sdQs1/F4Hn4Z9F73Km9
=nA8P
-----END PGP SIGNATURE-----

--8yXJwKnNP0rurr9c--

From owner-svn-src-head@FreeBSD.ORG  Wed Jul  9 18:32:42 2014
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id CBB7E4C7;
 Wed,  9 Jul 2014 18:32:42 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id AC1212BC9;
 Wed,  9 Jul 2014 18:32:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s69IWgMp047513;
 Wed, 9 Jul 2014 18:32:42 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.8/8.14.8/Submit) id s69IWfxd047502;
 Wed, 9 Jul 2014 18:32:41 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201407091832.s69IWfxd047502@svn.freebsd.org>
From: Xin LI 
Date: Wed, 9 Jul 2014 18:32:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r268464 - in
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 09 Jul 2014 18:32:43 -0000

Author: delphij
Date: Wed Jul  9 18:32:40 2014
New Revision: 268464
URL: http://svnweb.freebsd.org/changeset/base/268464

Log:
  MFV r268452:
  
  Explicitly mark file removal transactions as "presumed to result
  in a net free of space" so they will not fail with ENOSPC.
  
  Illumos issue:	4950 files sometimes can't be removed from a full
  		filesystem
  MFC after:	2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c	Wed Jul  9 17:31:57 2014	(r268463)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c	Wed Jul  9 18:32:40 2014	(r268464)
@@ -672,6 +672,12 @@ dmu_free_long_range_impl(objset_t *os, d
 		dmu_tx_t *tx = dmu_tx_create(os);
 		dmu_tx_hold_free(tx, dn->dn_object,
 		    chunk_begin, chunk_end - chunk_begin);
+
+		/*
+		 * Mark this transaction as typically resulting in a net
+		 * reduction in space used.
+		 */
+		dmu_tx_mark_netfree(tx);
 		err = dmu_tx_assign(tx, TXG_WAIT);
 		if (err) {
 			dmu_tx_abort(tx);
@@ -723,6 +729,7 @@ dmu_free_long_object(objset_t *os, uint6
 	tx = dmu_tx_create(os);
 	dmu_tx_hold_bonus(tx, object);
 	dmu_tx_hold_free(tx, object, 0, DMU_OBJECT_END);
+	dmu_tx_mark_netfree(tx);
 	err = dmu_tx_assign(tx, TXG_WAIT);
 	if (err == 0) {
 		err = dmu_object_free(os, object, tx);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c	Wed Jul  9 17:31:57 2014	(r268463)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c	Wed Jul  9 18:32:40 2014	(r268464)
@@ -21,7 +21,7 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
  */
 
 #include 
@@ -583,6 +583,32 @@ dmu_tx_count_free(dmu_tx_hold_t *txh, ui
 	txh->txh_space_tounref += unref;
 }
 
+/*
+ * This function marks the transaction as being a "net free".  The end
+ * result is that refquotas will be disabled for this transaction, and
+ * this transaction will be able to use half of the pool space overhead
+ * (see dsl_pool_adjustedsize()).  Therefore this function should only
+ * be called for transactions that we expect will not cause a net increase
+ * in the amount of space used (but it's OK if that is occasionally not true).
+ */
+void
+dmu_tx_mark_netfree(dmu_tx_t *tx)
+{
+	dmu_tx_hold_t *txh;
+
+	txh = dmu_tx_hold_object_impl(tx, tx->tx_objset,
+	    DMU_NEW_OBJECT, THT_FREE, 0, 0);
+
+	/*
+	 * Pretend that this operation will free 1GB of space.  This
+	 * should be large enough to cancel out the largest write.
+	 * We don't want to use something like UINT64_MAX, because that would
+	 * cause overflows when doing math with these values (e.g. in
+	 * dmu_tx_try_assign()).
+	 */
+	txh->txh_space_tofree = txh->txh_space_tounref = 1024 * 1024 * 1024;
+}
+
 void
 dmu_tx_hold_free(dmu_tx_t *tx, uint64_t object, uint64_t off, uint64_t len)
 {

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h	Wed Jul  9 17:31:57 2014	(r268463)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h	Wed Jul  9 18:32:40 2014	(r268464)
@@ -569,6 +569,7 @@ void dmu_tx_abort(dmu_tx_t *tx);
 int dmu_tx_assign(dmu_tx_t *tx, enum txg_how txg_how);
 void dmu_tx_wait(dmu_tx_t *tx);
 void dmu_tx_commit(dmu_tx_t *tx);
+void dmu_tx_mark_netfree(dmu_tx_t *tx);
 
 /*
  * To register a commit callback, dmu_tx_callback_register() must be called.

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c	Wed Jul  9 17:31:57 2014	(r268463)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c	Wed Jul  9 18:32:40 2014	(r268464)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013, 2014 by Delphix. All rights reserved.
  */
 
 #include 
@@ -559,6 +559,7 @@ zfs_purgedir(znode_t *dzp)
 		dmu_tx_hold_zap(tx, zfsvfs->z_unlinkedobj, FALSE, NULL);
 		/* Is this really needed ? */
 		zfs_sa_upgrade_txholds(tx, xzp);
+		dmu_tx_mark_netfree(tx);
 		error = dmu_tx_assign(tx, TXG_WAIT);
 		if (error) {
 			dmu_tx_abort(tx);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Wed Jul  9 17:31:57 2014	(r268463)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Wed Jul  9 18:32:40 2014	(r268464)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2013, 2014 by Delphix. All rights reserved.
  * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
  */
 
@@ -1568,7 +1568,7 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode
  *		cr	- credentials of caller.
  *		flag	- large file flag [UNUSED].
  *		ct	- caller context
- *		vsecp 	- ACL to be set
+ *		vsecp	- ACL to be set
  *
  *	OUT:	vpp	- vnode of created or trunc'd entry.
  *
@@ -1850,7 +1850,7 @@ zfs_remove(vnode_t *dvp, char *name, cre
 	zfsvfs_t	*zfsvfs = dzp->z_zfsvfs;
 	zilog_t		*zilog;
 	uint64_t	acl_obj, xattr_obj;
-	uint64_t 	xattr_obj_unlinked = 0;
+	uint64_t	xattr_obj_unlinked = 0;
 	uint64_t	obj = 0;
 	zfs_dirlock_t	*dl;
 	dmu_tx_t	*tx;
@@ -1950,6 +1950,14 @@ top:
 	/* charge as an update -- would be nice not to charge at all */
 	dmu_tx_hold_zap(tx, zfsvfs->z_unlinkedobj, FALSE, NULL);
 
+	/*
+	 * Mark this transaction as typically resulting in a net free of
+	 * space, unless object removal will be delayed indefinitely
+	 * (due to active holds on the vnode due to the file being open).
+	 */
+	if (may_delete_now)
+		dmu_tx_mark_netfree(tx);
+
 	error = dmu_tx_assign(tx, waited ? TXG_WAITED : TXG_NOWAIT);
 	if (error) {
 		zfs_dirent_unlock(dl);
@@ -1980,7 +1988,6 @@ top:
 	}
 
 	if (unlinked) {
-
 		/*
 		 * Hold z_lock so that we can make sure that the ACL obj
 		 * hasn't changed.  Could have been deleted due to
@@ -5056,13 +5063,13 @@ zfs_addmap(vnode_t *vp, offset_t off, st
  * last page is pushed.  The problem occurs when the msync() call is omitted,
  * which by far the most common case:
  *
- * 	open()
- * 	mmap()
- * 	
- * 	munmap()
- * 	close()
- * 	

0``````WP!Z``,```#D`'X`"P```/$` +MB@`#````]@".``$```#Y`)```P```/\`E``````!D@"5``````.3`)8````` +M`Y@`EP`````#HP"8``````.F`)D``````ZD`F@`````#L0";``````.T`)P` +M`0```\``G@`````#PP"?``$```/&`*$`````("(`H@`````@/`"C`````"!_ +M`*0`````(*<`I0`````AD`"F``4``"&H`*P`````(AD`K0`!```B'@"O``$` +M`"(I`+$`````(D@`L@`````B80"S`````")D`+0``0``(P(`M@`````C$`"W +M`````",@`+@``0``)0``N@`````E`@"[`````"4,`+P`````)1``O0`````E +M%`"^`````"48`+\`````)1P`P``````E)`#!`````"4L`,(`````)30`PP`` +M```E/`#$`````"50`,4`'```)8``X@`````EA`#C`````"6(`.0`````)8P` +MY0`````ED`#F``,``"6@`.H`````):P`ZP`````EL@#L`````"6Z`.T````` +M);P`[@`````EQ`#O`````"7+`/``````)=@`\0`!```F.@#S``(``"9``/8` +M````)D(`]P`````F8`#X`````"9C`/D`````)F4`^@`!```F:@#\`````"9L +$`/T````` +` +end From owner-svn-src-head@FreeBSD.ORG Thu May 29 18:13:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BCB9FA3; Thu, 29 May 2014 18:13:44 +0000 (UTC) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A78725A7; Thu, 29 May 2014 18:13:43 +0000 (UTC) Received: from [192.168.1.200] (p508F0AE5.dip0.t-ipconnect.de [80.143.10.229]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id 2708C1C104D8D; Thu, 29 May 2014 20:13:37 +0200 (CEST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266083 - in head/sys/arm: arm include From: Michael Tuexen In-Reply-To: Date: Thu, 29 May 2014 20:13:36 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de> References: <201405141911.s4EJBFZZ097826@svn.freebsd.org> <537D0952.2040001@selasky.org> <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org> <53871493.2010502@selasky.org> To: Mark R V Murray X-Mailer: Apple Mail (2.1878.2) Cc: Hans Petter Selasky , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 18:13:44 -0000 On 29 May 2014, at 19:41, Mark R V Murray wrote: >=20 > On 29 May 2014, at 12:05, Hans Petter Selasky wrote: >=20 >> On 05/22/14 09:09, Mark R V Murray wrote: >>>=20 >>> On 21 May 2014, at 21:15, Hans Petter Selasky = wrote: >>>=20 >>>> On 05/14/14 21:11, Mark Murray wrote: >>>>> Author: markm >>>>> Date: Wed May 14 19:11:15 2014 >>>>> New Revision: 266083 >>>>> URL: http://svnweb.freebsd.org/changeset/base/266083 >>>>>=20 >>>>> Log: >>>>> Give suitably-endowed ARMs a register similar to the x86 TSC = register. >>>>>=20 >>>>=20 >>>> Hi, >>>>=20 >>>> Regression issue: >>>> This commit prevents RPI-B from booting. >>>=20 >>> Thanks, I=92ll look at it ASAP. >>>=20 >>> M >>>=20 >>=20 >> Any news on this issue? >=20 > Hi >=20 > Yes, thanks! >=20 > I can make it work on RPI, but trying to find what else it will/won=92t = work on is more problematic. Wouldn't it require to use different registers on the RPI? This would = mean you would need more #ifdefs... I can test things on the RPI, but can't test on other platforms... Best regards Michael >=20 > I=92m considering disabling this on RPI, and then spending a bit of = time writing a full driver for this counter, then the annoying details = of the problem can be solved in FDT code. >=20 > M > --=20 > Mark R V Murray >=20 >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Thu May 29 18:15:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2AEC0193; Thu, 29 May 2014 18:15:21 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E548A25BA; Thu, 29 May 2014 18:15:20 +0000 (UTC) Received: from [2001:470:9174:1:15cb:b075:b4d8:4c48] by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1Wq4rC-0009At-7H; Thu, 29 May 2014 19:15:18 +0100 Subject: Re: svn commit: r266083 - in head/sys/arm: arm include Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Content-Type: text/plain; charset=windows-1252 From: Mark R V Murray In-Reply-To: <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de> Date: Thu, 29 May 2014 19:15:40 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405141911.s4EJBFZZ097826@svn.freebsd.org> <537D0952.2040001@selasky.org> <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org> <53871493.2010502@selasky.org> <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de> To: Michael Tuexen X-Mailer: Apple Mail (2.1878.2) X-SA-Score: -1.0 Cc: Hans Petter Selasky , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 18:15:21 -0000 On 29 May 2014, at 19:13, Michael Tuexen wrote: >> I can make it work on RPI, but trying to find what else it will/won=92t= work on is more problematic. > Wouldn't it require to use different registers on the RPI? This would = mean you > would need more #ifdefs=85 Thats the problem; too many #ifdefs. M --=20 Mark R V Murray From owner-svn-src-head@FreeBSD.ORG Thu May 29 18:27:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37CAA7A0; Thu, 29 May 2014 18:27:18 +0000 (UTC) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB83A26A4; Thu, 29 May 2014 18:27:17 +0000 (UTC) Received: from [192.168.1.200] (p508F3F42.dip0.t-ipconnect.de [80.143.63.66]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id E6C951C104F6F; Thu, 29 May 2014 20:27:14 +0200 (CEST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266083 - in head/sys/arm: arm include From: Michael Tuexen In-Reply-To: Date: Thu, 29 May 2014 20:27:13 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405141911.s4EJBFZZ097826@svn.freebsd.org> <537D0952.2040001@selasky.org> <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org> <53871493.2010502@selasky.org> <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de> To: Mark R V Murray X-Mailer: Apple Mail (2.1878.2) Cc: Hans Petter Selasky , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 18:27:18 -0000 On 29 May 2014, at 20:15, Mark R V Murray wrote: >=20 > On 29 May 2014, at 19:13, Michael Tuexen = wrote: >=20 >>> I can make it work on RPI, but trying to find what else it = will/won=92t work on is more problematic. >> Wouldn't it require to use different registers on the RPI? This would = mean you >> would need more #ifdefs=85 >=20 > Thats the problem; too many #ifdefs. So you could just keep the code for now, but reduce the #ifdefs to the = ones you know that work. Later on, you can replace it by the driver stuff... Best regards Michael >=20 > M > --=20 > Mark R V Murray >=20 >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Thu May 29 19:17:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A15CA8; Thu, 29 May 2014 19:17:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07DD82DD8; Thu, 29 May 2014 19:17:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TJHAVe067426; Thu, 29 May 2014 19:17:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TJHAmN067425; Thu, 29 May 2014 19:17:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405291917.s4TJHAmN067425@svn.freebsd.org> From: John Baldwin Date: Thu, 29 May 2014 19:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266852 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 19:17:11 -0000 Author: jhb Date: Thu May 29 19:17:10 2014 New Revision: 266852 URL: http://svnweb.freebsd.org/changeset/base/266852 Log: Fix pf(4) to build with MAXCPU set to 256. MAXCPU is actually a count, not a maximum ID value (so it is a cap on mp_ncpus, not mp_maxid). Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Thu May 29 18:05:03 2014 (r266851) +++ head/sys/netpfil/pf/pf.c Thu May 29 19:17:10 2014 (r266852) @@ -196,7 +196,7 @@ VNET_DEFINE(uint64_t, pf_stateid[MAXCPU] #define PFID_CPUSHIFT (sizeof(uint64_t) * NBBY - PFID_CPUBITS) #define PFID_CPUMASK ((uint64_t)((1 << PFID_CPUBITS) - 1) << PFID_CPUSHIFT) #define PFID_MAXID (~PFID_CPUMASK) -CTASSERT((1 << PFID_CPUBITS) > MAXCPU); +CTASSERT((1 << PFID_CPUBITS) >= MAXCPU); static void pf_src_tree_remove_state(struct pf_state *); static void pf_init_threshold(struct pf_threshold *, u_int32_t, From owner-svn-src-head@FreeBSD.ORG Thu May 29 19:21:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 470333D2; Thu, 29 May 2014 19:21:35 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C5372E78; Thu, 29 May 2014 19:21:35 +0000 (UTC) Received: from [2001:470:9174:1:7548:d50f:9b93:3d35] by gromit.grondar.org with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1Wq5tH-0009H3-5M; Thu, 29 May 2014 20:21:31 +0100 Subject: Re: svn commit: r266083 - in head/sys/arm: arm include Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Content-Type: text/plain; charset=windows-1252 From: Mark R V Murray In-Reply-To: Date: Thu, 29 May 2014 20:21:53 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405141911.s4EJBFZZ097826@svn.freebsd.org> <537D0952.2040001@selasky.org> <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org> <53871493.2010502@selasky.org> <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de> To: Michael Tuexen X-Mailer: Apple Mail (2.1878.2) X-SA-Score: -1.0 Cc: Hans Petter Selasky , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 19:21:35 -0000 On 29 May 2014, at 19:27, Michael Tuexen wrote: > On 29 May 2014, at 20:15, Mark R V Murray wrote: >=20 >>=20 >> On 29 May 2014, at 19:13, Michael Tuexen = wrote: >>=20 >>>> I can make it work on RPI, but trying to find what else it = will/won=92t work on is more problematic. >>> Wouldn't it require to use different registers on the RPI? This = would mean you >>> would need more #ifdefs=85 >>=20 >> Thats the problem; too many #ifdefs. > So you could just keep the code for now, but reduce the #ifdefs to the = ones you > know that work. Later on, you can replace it by the driver stuff=85 That=92s what I was thinking, yes. M --=20 Mark R V Murray From owner-svn-src-head@FreeBSD.ORG Thu May 29 19:43:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBBD4CFB; Thu, 29 May 2014 19:43:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9B08203E; Thu, 29 May 2014 19:43:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TJhhbJ080211; Thu, 29 May 2014 19:43:43 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TJhhYU080210; Thu, 29 May 2014 19:43:43 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405291943.s4TJhhYU080210@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 29 May 2014 19:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266853 - head/usr.bin/printf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 19:43:43 -0000 Author: pfg Date: Thu May 29 19:43:43 2014 New Revision: 266853 URL: http://svnweb.freebsd.org/changeset/base/266853 Log: Minor style knit. Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Thu May 29 19:17:10 2014 (r266852) +++ head/usr.bin/printf/printf.c Thu May 29 19:43:43 2014 (r266853) @@ -456,8 +456,7 @@ mknum(char *str, char ch) len = strlen(str) + 2; if (len > copy_size) { newlen = ((len + 1023) >> 10) << 10; - if ((newcopy = realloc(copy, newlen)) == NULL) - { + if ((newcopy = realloc(copy, newlen)) == NULL) { warnx("%s", strerror(ENOMEM)); return (NULL); } From owner-svn-src-head@FreeBSD.ORG Thu May 29 19:48:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E417541D; Thu, 29 May 2014 19:48:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1DE12097; Thu, 29 May 2014 19:48:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TJmIGU081334; Thu, 29 May 2014 19:48:18 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TJmIHN081333; Thu, 29 May 2014 19:48:18 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405291948.s4TJmIHN081333@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 29 May 2014 19:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266854 - head/usr.bin/printf/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 19:48:19 -0000 Author: pfg Date: Thu May 29 19:48:18 2014 New Revision: 266854 URL: http://svnweb.freebsd.org/changeset/base/266854 Log: Update number of tests. Suggested by: jmmv Modified: head/usr.bin/printf/tests/regress.sh Modified: head/usr.bin/printf/tests/regress.sh ============================================================================== --- head/usr.bin/printf/tests/regress.sh Thu May 29 19:43:43 2014 (r266853) +++ head/usr.bin/printf/tests/regress.sh Thu May 29 19:48:18 2014 (r266854) @@ -2,7 +2,7 @@ REGRESSION_START($1) -echo '1..15' +echo '1..23' REGRESSION_TEST(`b', `printf "abc%b%b" "def\n" "\cghi"') REGRESSION_TEST(`d', `printf "%d,%5d,%.5d,%0*d,%.*d\n" 123 123 123 5 123 5 123') From owner-svn-src-head@FreeBSD.ORG Thu May 29 19:57:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 072458B1; Thu, 29 May 2014 19:57:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8FBA2193; Thu, 29 May 2014 19:57:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TJvp9a085911; Thu, 29 May 2014 19:57:51 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TJvp07085910; Thu, 29 May 2014 19:57:51 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201405291957.s4TJvp07085910@svn.freebsd.org> From: Olivier Houchard Date: Thu, 29 May 2014 19:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266855 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 19:57:52 -0000 Author: cognet Date: Thu May 29 19:57:51 2014 New Revision: 266855 URL: http://svnweb.freebsd.org/changeset/base/266855 Log: In the grab function, keep the bit 6 on in the IER, on XScale, using 0 turns the UART off, which is unfortunate if one want to use it as a console. Modified: head/sys/dev/uart/uart_dev_ns8250.c Modified: head/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- head/sys/dev/uart/uart_dev_ns8250.c Thu May 29 19:48:18 2014 (r266854) +++ head/sys/dev/uart/uart_dev_ns8250.c Thu May 29 19:57:51 2014 (r266855) @@ -929,6 +929,7 @@ void ns8250_bus_grab(struct uart_softc *sc) { struct uart_bas *bas = &sc->sc_bas; + struct ns8250_softc *ns8250 = (struct ns8250_softc*)sc; /* * turn off all interrupts to enter polling mode. Leave the @@ -936,7 +937,11 @@ ns8250_bus_grab(struct uart_softc *sc) * All pending interupt signals are reset when IER is set to 0. */ uart_lock(sc->sc_hwmtx); - uart_setreg(bas, REG_IER, 0); + /* + * On XScale, bit 6 (0x40) is the UART Unit Enable, removing it + * turns the UART completely off, so make sure it is stays there. + */ + uart_setreg(bas, REG_IER, ns8250->ier & 0x40); uart_barrier(bas); uart_unlock(sc->sc_hwmtx); } From owner-svn-src-head@FreeBSD.ORG Thu May 29 20:26:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 537F0312; Thu, 29 May 2014 20:26:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 416B52427; Thu, 29 May 2014 20:26:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TKQ2wb099722; Thu, 29 May 2014 20:26:02 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TKQ27q099721; Thu, 29 May 2014 20:26:02 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201405292026.s4TKQ27q099721@svn.freebsd.org> From: Ed Maste Date: Thu, 29 May 2014 20:26:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266856 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 20:26:02 -0000 Author: emaste Date: Thu May 29 20:26:01 2014 New Revision: 266856 URL: http://svnweb.freebsd.org/changeset/base/266856 Log: Correct KASSERT strings Rows refer to height and cols to width. Modified: head/sys/dev/vt/vt_buf.c Modified: head/sys/dev/vt/vt_buf.c ============================================================================== --- head/sys/dev/vt/vt_buf.c Thu May 29 19:57:51 2014 (r266855) +++ head/sys/dev/vt/vt_buf.c Thu May 29 20:26:01 2014 (r266856) @@ -357,17 +357,17 @@ void vtbuf_fill_locked(struct vt_buf *vb, const term_rect_t *r, term_char_t c) { KASSERT(r->tr_begin.tp_row < vb->vb_scr_size.tp_row, - ("vtbuf_fill_locked begin.tp_row %d must be < screen width %d", + ("vtbuf_fill_locked begin.tp_row %d must be < screen height %d", r->tr_begin.tp_row, vb->vb_scr_size.tp_row)); KASSERT(r->tr_begin.tp_col < vb->vb_scr_size.tp_col, - ("vtbuf_fill_locked begin.tp_col %d must be < screen height %d", + ("vtbuf_fill_locked begin.tp_col %d must be < screen width %d", r->tr_begin.tp_col, vb->vb_scr_size.tp_col)); KASSERT(r->tr_end.tp_row <= vb->vb_scr_size.tp_row, - ("vtbuf_fill_locked end.tp_row %d must be <= screen width %d", + ("vtbuf_fill_locked end.tp_row %d must be <= screen height %d", r->tr_end.tp_row, vb->vb_scr_size.tp_row)); KASSERT(r->tr_end.tp_col <= vb->vb_scr_size.tp_col, - ("vtbuf_fill_locked end.tp_col %d must be <= screen height %d", + ("vtbuf_fill_locked end.tp_col %d must be <= screen width %d", r->tr_end.tp_col, vb->vb_scr_size.tp_col)); VTBUF_LOCK(vb); From owner-svn-src-head@FreeBSD.ORG Thu May 29 20:44:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B307B8E8; Thu, 29 May 2014 20:44:56 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 76C9925CE; Thu, 29 May 2014 20:44:55 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s4TKiswP049190 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 29 May 2014 13:44:54 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s4TKisdI049189; Thu, 29 May 2014 13:44:54 -0700 (PDT) (envelope-from jmg) Date: Thu, 29 May 2014 13:44:54 -0700 From: John-Mark Gurney To: Olivier Houchard Subject: Re: svn commit: r266855 - head/sys/dev/uart Message-ID: <20140529204454.GB43976@funkthat.com> References: <201405291957.s4TJvp07085910@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201405291957.s4TJvp07085910@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 29 May 2014 13:44:54 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 20:44:56 -0000 Olivier Houchard wrote this message on Thu, May 29, 2014 at 19:57 +0000: > Author: cognet > Date: Thu May 29 19:57:51 2014 > New Revision: 266855 > URL: http://svnweb.freebsd.org/changeset/base/266855 > > Log: > In the grab function, keep the bit 6 on in the IER, on XScale, using 0 > turns the UART off, which is unfortunate if one want to use it as a console. > > Modified: > head/sys/dev/uart/uart_dev_ns8250.c > > Modified: head/sys/dev/uart/uart_dev_ns8250.c > ============================================================================== > --- head/sys/dev/uart/uart_dev_ns8250.c Thu May 29 19:48:18 2014 (r266854) > +++ head/sys/dev/uart/uart_dev_ns8250.c Thu May 29 19:57:51 2014 (r266855) > @@ -929,6 +929,7 @@ void > ns8250_bus_grab(struct uart_softc *sc) > { > struct uart_bas *bas = &sc->sc_bas; > + struct ns8250_softc *ns8250 = (struct ns8250_softc*)sc; > > /* > * turn off all interrupts to enter polling mode. Leave the > @@ -936,7 +937,11 @@ ns8250_bus_grab(struct uart_softc *sc) > * All pending interupt signals are reset when IER is set to 0. > */ > uart_lock(sc->sc_hwmtx); > - uart_setreg(bas, REG_IER, 0); > + /* > + * On XScale, bit 6 (0x40) is the UART Unit Enable, removing it > + * turns the UART completely off, so make sure it is stays there. > + */ > + uart_setreg(bas, REG_IER, ns8250->ier & 0x40); > uart_barrier(bas); > uart_unlock(sc->sc_hwmtx); > } Should this be using ns8250->ier_mask instead of 0x40? It also looks like AVILA doesn't have the hints to set this like GUMSTIX does, and maybe adding this will help? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Thu May 29 20:47:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8804CDA8; Thu, 29 May 2014 20:47:01 +0000 (UTC) Received: from kanar.ci0.org (kanar.ci0.org [IPv6:2001:bc8:35e6::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FC2125F6; Thu, 29 May 2014 20:47:00 +0000 (UTC) Received: from kanar.ci0.org (pluxor@localhost [127.0.0.1]) by kanar.ci0.org (8.14.8/8.14.8) with ESMTP id s4TKkmfP006958; Thu, 29 May 2014 22:46:48 +0200 (CEST) (envelope-from cognet@ci0.org) Received: (from doginou@localhost) by kanar.ci0.org (8.14.8/8.14.8/Submit) id s4TKkmuf006957; Thu, 29 May 2014 22:46:48 +0200 (CEST) (envelope-from cognet@ci0.org) X-Authentication-Warning: kanar.ci0.org: doginou set sender to cognet@ci0.org using -f Date: Thu, 29 May 2014 22:46:48 +0200 From: Olivier Houchard To: John-Mark Gurney Subject: Re: svn commit: r266855 - head/sys/dev/uart Message-ID: <20140529204648.GA6936@ci0.org> References: <201405291957.s4TJvp07085910@svn.freebsd.org> <20140529204454.GB43976@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140529204454.GB43976@funkthat.com> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 20:47:01 -0000 On Thu, May 29, 2014 at 01:44:54PM -0700, John-Mark Gurney wrote: > Olivier Houchard wrote this message on Thu, May 29, 2014 at 19:57 +0000: > > Author: cognet > > Date: Thu May 29 19:57:51 2014 > > New Revision: 266855 > > URL: http://svnweb.freebsd.org/changeset/base/266855 > > > > Log: > > In the grab function, keep the bit 6 on in the IER, on XScale, using 0 > > turns the UART off, which is unfortunate if one want to use it as a console. > > > > Modified: > > head/sys/dev/uart/uart_dev_ns8250.c > > > > Modified: head/sys/dev/uart/uart_dev_ns8250.c > > ============================================================================== > > --- head/sys/dev/uart/uart_dev_ns8250.c Thu May 29 19:48:18 2014 (r266854) > > +++ head/sys/dev/uart/uart_dev_ns8250.c Thu May 29 19:57:51 2014 (r266855) > > @@ -929,6 +929,7 @@ void > > ns8250_bus_grab(struct uart_softc *sc) > > { > > struct uart_bas *bas = &sc->sc_bas; > > + struct ns8250_softc *ns8250 = (struct ns8250_softc*)sc; > > > > /* > > * turn off all interrupts to enter polling mode. Leave the > > @@ -936,7 +937,11 @@ ns8250_bus_grab(struct uart_softc *sc) > > * All pending interupt signals are reset when IER is set to 0. > > */ > > uart_lock(sc->sc_hwmtx); > > - uart_setreg(bas, REG_IER, 0); > > + /* > > + * On XScale, bit 6 (0x40) is the UART Unit Enable, removing it > > + * turns the UART completely off, so make sure it is stays there. > > + */ > > + uart_setreg(bas, REG_IER, ns8250->ier & 0x40); > > uart_barrier(bas); > > uart_unlock(sc->sc_hwmtx); > > } > > Should this be using ns8250->ier_mask instead of 0x40? > > It also looks like AVILA doesn't have the hints to set this like > GUMSTIX does, and maybe adding this will help? > Hmm you're right, this is probably better, I'll just do that :) Olivier From owner-svn-src-head@FreeBSD.ORG Thu May 29 20:53:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E206AFBC; Thu, 29 May 2014 20:53:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D02CB268D; Thu, 29 May 2014 20:53:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TKrrMo014206; Thu, 29 May 2014 20:53:53 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TKrrcd014205; Thu, 29 May 2014 20:53:53 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201405292053.s4TKrrcd014205@svn.freebsd.org> From: Hiroki Sato Date: Thu, 29 May 2014 20:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266857 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 20:53:54 -0000 Author: hrs Date: Thu May 29 20:53:53 2014 New Revision: 266857 URL: http://svnweb.freebsd.org/changeset/base/266857 Log: Add rwlock to struct dadq. A panic could occur when a large number of addresses performed DAD at the same time. Modified: head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Thu May 29 20:26:01 2014 (r266856) +++ head/sys/netinet6/nd6_nbr.c Thu May 29 20:53:53 2014 (r266857) @@ -88,8 +88,10 @@ static void nd6_dad_na_input(struct ifad static void nd6_na_output_fib(struct ifnet *, const struct in6_addr *, const struct in6_addr *, u_long, int, struct sockaddr *, u_int); -VNET_DEFINE(int, dad_ignore_ns) = 0; /* ignore NS in DAD - specwise incorrect*/ -VNET_DEFINE(int, dad_maxtry) = 15; /* max # of *tries* to transmit DAD packet */ +static VNET_DEFINE(int, dad_ignore_ns) = 0; /* ignore NS in DAD + - specwise incorrect */ +static VNET_DEFINE(int, dad_maxtry) = 15; /* max # of *tries* to + transmit DAD packet */ #define V_dad_ignore_ns VNET(dad_ignore_ns) #define V_dad_maxtry VNET(dad_maxtry) @@ -1165,20 +1167,30 @@ struct dadq { }; static VNET_DEFINE(TAILQ_HEAD(, dadq), dadq); -VNET_DEFINE(int, dad_init) = 0; -#define V_dadq VNET(dadq) -#define V_dad_init VNET(dad_init) +static VNET_DEFINE(struct rwlock, dad_rwlock); +#define V_dadq VNET(dadq) +#define V_dad_rwlock VNET(dad_rwlock) + +#define DADQ_LOCK_INIT() rw_init(&V_dad_rwlock, "nd6 DAD queue") +#define DADQ_LOCK_DESTROY() rw_destroy(&V_dad_rwlock) +#define DADQ_LOCK_INITIALIZED() rw_initialized(&V_dad_rwlock) +#define DADQ_RLOCK() rw_rlock(&V_dad_rwlock) +#define DADQ_RUNLOCK() rw_runlock(&V_dad_rwlock) +#define DADQ_WLOCK() rw_wlock(&V_dad_rwlock) +#define DADQ_WUNLOCK() rw_wunlock(&V_dad_rwlock) static struct dadq * nd6_dad_find(struct ifaddr *ifa) { struct dadq *dp; + DADQ_RLOCK(); TAILQ_FOREACH(dp, &V_dadq, dad_list) if (dp->dad_ifa == ifa) - return (dp); + break; + DADQ_RUNLOCK(); - return (NULL); + return (dp); } static void @@ -1206,9 +1218,9 @@ nd6_dad_start(struct ifaddr *ifa, int de struct dadq *dp; char ip6buf[INET6_ADDRSTRLEN]; - if (!V_dad_init) { + if (DADQ_LOCK_INITIALIZED() == 0) { + DADQ_LOCK_INIT(); TAILQ_INIT(&V_dadq); - V_dad_init++; } /* @@ -1258,7 +1270,9 @@ nd6_dad_start(struct ifaddr *ifa, int de #ifdef VIMAGE dp->dad_vnet = curvnet; #endif + DADQ_WLOCK(); TAILQ_INSERT_TAIL(&V_dadq, (struct dadq *)dp, dad_list); + DADQ_WUNLOCK(); nd6log((LOG_DEBUG, "%s: starting DAD for %s\n", if_name(ifa->ifa_ifp), ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr))); @@ -1291,7 +1305,7 @@ nd6_dad_stop(struct ifaddr *ifa) { struct dadq *dp; - if (!V_dad_init) + if (DADQ_LOCK_INITIALIZED() == 0) return; dp = nd6_dad_find(ifa); if (!dp) { @@ -1301,7 +1315,9 @@ nd6_dad_stop(struct ifaddr *ifa) nd6_dad_stoptimer(dp); + DADQ_WLOCK(); TAILQ_REMOVE(&V_dadq, (struct dadq *)dp, dad_list); + DADQ_WUNLOCK(); free(dp, M_IP6NDP); dp = NULL; ifa_free(ifa); @@ -1351,7 +1367,9 @@ nd6_dad_timer(struct dadq *dp) nd6log((LOG_INFO, "%s: could not run DAD, driver problem?\n", if_name(ifa->ifa_ifp))); + DADQ_WLOCK(); TAILQ_REMOVE(&V_dadq, (struct dadq *)dp, dad_list); + DADQ_WUNLOCK(); free(dp, M_IP6NDP); dp = NULL; ifa_free(ifa); @@ -1407,7 +1425,9 @@ nd6_dad_timer(struct dadq *dp) if_name(ifa->ifa_ifp), ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr))); + DADQ_WLOCK(); TAILQ_REMOVE(&V_dadq, (struct dadq *)dp, dad_list); + DADQ_WUNLOCK(); free(dp, M_IP6NDP); dp = NULL; ifa_free(ifa); @@ -1484,7 +1504,9 @@ nd6_dad_duplicated(struct ifaddr *ifa) } } + DADQ_WLOCK(); TAILQ_REMOVE(&V_dadq, (struct dadq *)dp, dad_list); + DADQ_WUNLOCK(); free(dp, M_IP6NDP); dp = NULL; ifa_free(ifa); From owner-svn-src-head@FreeBSD.ORG Thu May 29 21:00:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97662326; Thu, 29 May 2014 21:00:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85DB926D8; Thu, 29 May 2014 21:00:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TL061E015714; Thu, 29 May 2014 21:00:06 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TL06Ij015713; Thu, 29 May 2014 21:00:06 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201405292100.s4TL06Ij015713@svn.freebsd.org> From: Olivier Houchard Date: Thu, 29 May 2014 21:00:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266858 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 21:00:06 -0000 Author: cognet Date: Thu May 29 21:00:06 2014 New Revision: 266858 URL: http://svnweb.freebsd.org/changeset/base/266858 Log: In uart_bus_grab(), use the ier_mask instead of a custom hack for XScale. Suggested by: jmg Modified: head/sys/dev/uart/uart_dev_ns8250.c Modified: head/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- head/sys/dev/uart/uart_dev_ns8250.c Thu May 29 20:53:53 2014 (r266857) +++ head/sys/dev/uart/uart_dev_ns8250.c Thu May 29 21:00:06 2014 (r266858) @@ -930,6 +930,7 @@ ns8250_bus_grab(struct uart_softc *sc) { struct uart_bas *bas = &sc->sc_bas; struct ns8250_softc *ns8250 = (struct ns8250_softc*)sc; + u_char ier; /* * turn off all interrupts to enter polling mode. Leave the @@ -937,11 +938,8 @@ ns8250_bus_grab(struct uart_softc *sc) * All pending interupt signals are reset when IER is set to 0. */ uart_lock(sc->sc_hwmtx); - /* - * On XScale, bit 6 (0x40) is the UART Unit Enable, removing it - * turns the UART completely off, so make sure it is stays there. - */ - uart_setreg(bas, REG_IER, ns8250->ier & 0x40); + ier = uart_getreg(bas, REG_IER); + uart_setreg(bas, REG_IER, ier & ns8250->ier_mask); uart_barrier(bas); uart_unlock(sc->sc_hwmtx); } From owner-svn-src-head@FreeBSD.ORG Thu May 29 21:02:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D07A477B; Thu, 29 May 2014 21:02:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A44282771; Thu, 29 May 2014 21:02:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TL2vSN018885; Thu, 29 May 2014 21:02:57 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TL2vXR018884; Thu, 29 May 2014 21:02:57 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201405292102.s4TL2vXR018884@svn.freebsd.org> From: Dmitry Morozovsky Date: Thu, 29 May 2014 21:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266859 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 21:02:57 -0000 Author: marck (doc committer) Date: Thu May 29 21:02:57 2014 New Revision: 266859 URL: http://svnweb.freebsd.org/changeset/base/266859 Log: Change examples to have master skew above 0 to have ability to overwrite this from the slave (for example, when master is failing on disk IO and could not be logged into or execute cronjob). Commented out examples changed too to simplify future merging. Idea by: kaa@zvuki.ru Discussed with: glebius MFC after: 1 week Modified: head/share/man/man4/carp.4 Modified: head/share/man/man4/carp.4 ============================================================================== --- head/share/man/man4/carp.4 Thu May 29 21:00:06 2014 (r266858) +++ head/share/man/man4/carp.4 Thu May 29 21:02:57 2014 (r266859) @@ -210,17 +210,18 @@ Enable it on both hosts A and B: .Pp Assume that host A is the preferred master and we are running the 192.168.1.0/24 prefix on em0 and 192.168.2.0/24 on em1. -This is the setup for host A: +This is the setup for host A (advskew is above 0 so it could be overwritten +in the emergency situation from the other host): .Bd -literal -offset indent -ifconfig em0 vhid 1 pass mekmitasdigoat 192.168.1.1/24 -ifconfig em1 vhid 2 pass mekmitasdigoat 192.168.2.1/24 +ifconfig em0 vhid 1 advskew 100 pass mekmitasdigoat 192.168.1.1/24 +ifconfig em1 vhid 2 advskew 100 pass mekmitasdigoat 192.168.2.1/24 .Ed .Pp The setup for host B is identical, but it has a higher .Cm advskew : .Bd -literal -offset indent -ifconfig em0 vhid 1 advskew 100 pass mekmitasdigoat 192.168.1.1/24 -ifconfig em1 vhid 2 advskew 100 pass mekmitasdigoat 192.168.2.1/24 +ifconfig em0 vhid 1 advskew 200 pass mekmitasdigoat 192.168.1.1/24 +ifconfig em1 vhid 2 advskew 200 pass mekmitasdigoat 192.168.2.1/24 .Ed .Pp When one of the physical interfaces of host A fails, @@ -246,9 +247,9 @@ preempt host A on both interfaces instea .\"out slightly less frequently. .\".Bd -literal -offset indent .\"ifconfig carp0 create -.\"ifconfig carp0 vhid 1 pass mekmitasdigoat 192.168.1.10/24 +.\"ifconfig carp0 vhid 1 advskew 100 pass mekmitasdigoat 192.168.1.10/24 .\"ifconfig carp1 create -.\"ifconfig carp1 vhid 2 advskew 100 pass mekmitasdigoat 192.168.1.10/24 +.\"ifconfig carp1 vhid 2 advskew 200 pass mekmitasdigoat 192.168.1.10/24 .\".Ed .\".Pp .\"The configuration for host B is identical, except the @@ -256,9 +257,9 @@ preempt host A on both interfaces instea .\"is on virtual host 1 rather than virtual host 2. .\".Bd -literal -offset indent .\"ifconfig carp0 create -.\"ifconfig carp0 vhid 1 advskew 100 pass mekmitasdigoat 192.168.1.10/24 +.\"ifconfig carp0 vhid 1 advskew 200 pass mekmitasdigoat 192.168.1.10/24 .\"ifconfig carp1 create -.\"ifconfig carp1 vhid 2 pass mekmitasdigoat 192.168.1.10/24 +.\"ifconfig carp1 vhid 2 advskew 100 pass mekmitasdigoat 192.168.1.10/24 .\".Ed .\".Pp .\"Finally, the ARP balancing feature must be enabled on both hosts: From owner-svn-src-head@FreeBSD.ORG Thu May 29 21:03:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C81E8CE; Thu, 29 May 2014 21:03:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F1FB2784; Thu, 29 May 2014 21:03:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TL3qjM019087; Thu, 29 May 2014 21:03:52 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TL3ovP019075; Thu, 29 May 2014 21:03:50 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201405292103.s4TL3ovP019075@svn.freebsd.org> From: Alan Somers Date: Thu, 29 May 2014 21:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266860 - in head: sys/net sys/netinet sys/netinet6 tests/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 21:03:52 -0000 Author: asomers Date: Thu May 29 21:03:49 2014 New Revision: 266860 URL: http://svnweb.freebsd.org/changeset/base/266860 Log: Fix unintended KBI change from r264905. Add _fib versions of ifa_ifwithnet() and ifa_ifwithdstaddr() The legacy functions will call the _fib() versions with RT_ALL_FIBS, preserving legacy behavior. sys/net/if_var.h sys/net/if.c Add legacy-compatible functions as described above. Ensure legacy behavior when RT_ALL_FIBS is passed as fibnum. sys/netinet/in_pcb.c sys/netinet/ip_output.c sys/netinet/ip_options.c sys/net/route.c sys/net/rtsock.c sys/netinet6/nd6.c Call with _fib() functions if we must use a specific fib, or the legacy functions otherwise. tests/sys/netinet/fibs_test.sh tests/sys/netinet/udp_dontroute.c Improve the udp_dontroute test. The bug that this test exercises is that ifa_ifwithnet() will return the wrong address, if multiple interfaces have addresses on the same subnet but with different fibs. The previous version of the test only considered one possible failure mode: that ifa_ifwithnet_fib() might fail to find any suitable address at all. The new version also checks whether ifa_ifwithnet_fib() finds the correct address by checking where the ARP request goes. Reported by: bz, hrs Reviewed by: hrs MFC after: 1 week X-MFC-with: 264905 Sponsored by: Spectra Logic Modified: head/sys/net/if.c head/sys/net/if_var.h head/sys/net/route.c head/sys/net/rtsock.c head/sys/netinet/in_pcb.c head/sys/netinet/ip_options.c head/sys/netinet/ip_output.c head/sys/netinet6/nd6.c head/tests/sys/netinet/fibs_test.sh head/tests/sys/netinet/udp_dontroute.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu May 29 21:02:57 2014 (r266859) +++ head/sys/net/if.c Thu May 29 21:03:49 2014 (r266860) @@ -1650,7 +1650,7 @@ done: */ /*ARGSUSED*/ struct ifaddr * -ifa_ifwithdstaddr(struct sockaddr *addr, int fibnum) +ifa_ifwithdstaddr_fib(struct sockaddr *addr, int fibnum) { struct ifnet *ifp; struct ifaddr *ifa; @@ -1659,7 +1659,7 @@ ifa_ifwithdstaddr(struct sockaddr *addr, TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if ((ifp->if_flags & IFF_POINTOPOINT) == 0) continue; - if ((ifp->if_fib != fibnum)) + if ((fibnum != RT_ALL_FIBS) && (ifp->if_fib != fibnum)) continue; IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { @@ -1680,12 +1680,19 @@ done: return (ifa); } +struct ifaddr * +ifa_ifwithdstaddr(struct sockaddr *addr) +{ + + return (ifa_ifwithdstaddr_fib(addr, RT_ALL_FIBS)); +} + /* * Find an interface on a specific network. If many, choice * is most specific found. */ struct ifaddr * -ifa_ifwithnet(struct sockaddr *addr, int ignore_ptp, int fibnum) +ifa_ifwithnet_fib(struct sockaddr *addr, int ignore_ptp, int fibnum) { struct ifnet *ifp; struct ifaddr *ifa; @@ -1711,7 +1718,7 @@ ifa_ifwithnet(struct sockaddr *addr, int */ IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - if (ifp->if_fib != fibnum) + if ((fibnum != RT_ALL_FIBS) && (ifp->if_fib != fibnum)) continue; IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { @@ -1796,6 +1803,13 @@ done: return (ifa); } +struct ifaddr * +ifa_ifwithnet(struct sockaddr *addr, int ignore_ptp) +{ + + return (ifa_ifwithnet_fib(addr, ignore_ptp, RT_ALL_FIBS)); +} + /* * Find an interface address specific to an interface best matching * a given address. Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu May 29 21:02:57 2014 (r266859) +++ head/sys/net/if_var.h Thu May 29 21:03:49 2014 (r266860) @@ -495,8 +495,10 @@ int ifa_switch_loopback_route(struct ifa struct ifaddr *ifa_ifwithaddr(struct sockaddr *); int ifa_ifwithaddr_check(struct sockaddr *); struct ifaddr *ifa_ifwithbroadaddr(struct sockaddr *); -struct ifaddr *ifa_ifwithdstaddr(struct sockaddr *, int); -struct ifaddr *ifa_ifwithnet(struct sockaddr *, int, int); +struct ifaddr *ifa_ifwithdstaddr(struct sockaddr *); +struct ifaddr *ifa_ifwithdstaddr_fib(struct sockaddr *, int); +struct ifaddr *ifa_ifwithnet(struct sockaddr *, int); +struct ifaddr *ifa_ifwithnet_fib(struct sockaddr *, int, int); struct ifaddr *ifa_ifwithroute(int, struct sockaddr *, struct sockaddr *); struct ifaddr *ifa_ifwithroute_fib(int, struct sockaddr *, struct sockaddr *, u_int); struct ifaddr *ifaof_ifpforaddr(struct sockaddr *, struct ifnet *); Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu May 29 21:02:57 2014 (r266859) +++ head/sys/net/route.c Thu May 29 21:03:49 2014 (r266860) @@ -573,7 +573,7 @@ rtredirect_fib(struct sockaddr *dst, } /* verify the gateway is directly reachable */ - if ((ifa = ifa_ifwithnet(gateway, 0, fibnum)) == NULL) { + if ((ifa = ifa_ifwithnet_fib(gateway, 0, fibnum)) == NULL) { error = ENETUNREACH; goto out; } @@ -730,7 +730,7 @@ ifa_ifwithroute_fib(int flags, struct so */ ifa = NULL; if (flags & RTF_HOST) - ifa = ifa_ifwithdstaddr(dst, fibnum); + ifa = ifa_ifwithdstaddr_fib(dst, fibnum); if (ifa == NULL) ifa = ifa_ifwithaddr(gateway); } else { @@ -739,10 +739,10 @@ ifa_ifwithroute_fib(int flags, struct so * or host, the gateway may still be on the * other end of a pt to pt link. */ - ifa = ifa_ifwithdstaddr(gateway, fibnum); + ifa = ifa_ifwithdstaddr_fib(gateway, fibnum); } if (ifa == NULL) - ifa = ifa_ifwithnet(gateway, 0, fibnum); + ifa = ifa_ifwithnet_fib(gateway, 0, fibnum); if (ifa == NULL) { struct rtentry *rt = rtalloc1_fib(gateway, 0, RTF_RNH_LOCKED, fibnum); if (rt == NULL) @@ -856,7 +856,7 @@ rt_getifa_fib(struct rt_addrinfo *info, */ if (info->rti_ifp == NULL && ifpaddr != NULL && ifpaddr->sa_family == AF_LINK && - (ifa = ifa_ifwithnet(ifpaddr, 0, fibnum)) != NULL) { + (ifa = ifa_ifwithnet_fib(ifpaddr, 0, fibnum)) != NULL) { info->rti_ifp = ifa->ifa_ifp; ifa_free(ifa); } Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Thu May 29 21:02:57 2014 (r266859) +++ head/sys/net/rtsock.c Thu May 29 21:03:49 2014 (r266860) @@ -752,8 +752,7 @@ route_output(struct mbuf *m, struct sock rt->rt_ifp->if_type == IFT_PROPVIRTUAL) { struct ifaddr *ifa; - ifa = ifa_ifwithnet(info.rti_info[RTAX_DST], 1, - RT_DEFAULT_FIB); + ifa = ifa_ifwithnet(info.rti_info[RTAX_DST], 1); if (ifa != NULL) rt_maskedcopy(ifa->ifa_addr, &laddr, Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu May 29 21:02:57 2014 (r266859) +++ head/sys/netinet/in_pcb.c Thu May 29 21:03:49 2014 (r266860) @@ -745,11 +745,9 @@ in_pcbladdr(struct inpcb *inp, struct in struct in_ifaddr *ia; struct ifnet *ifp; - ia = ifatoia(ifa_ifwithdstaddr((struct sockaddr *)sin, - RT_DEFAULT_FIB)); + ia = ifatoia(ifa_ifwithdstaddr((struct sockaddr *)sin)); if (ia == NULL) - ia = ifatoia(ifa_ifwithnet((struct sockaddr *)sin, 0, - RT_DEFAULT_FIB)); + ia = ifatoia(ifa_ifwithnet((struct sockaddr *)sin, 0)); if (ia == NULL) { error = ENETUNREACH; goto done; @@ -864,10 +862,9 @@ in_pcbladdr(struct inpcb *inp, struct in sain.sin_len = sizeof(struct sockaddr_in); sain.sin_addr.s_addr = faddr->s_addr; - ia = ifatoia(ifa_ifwithdstaddr(sintosa(&sain), RT_DEFAULT_FIB)); + ia = ifatoia(ifa_ifwithdstaddr(sintosa(&sain))); if (ia == NULL) - ia = ifatoia(ifa_ifwithnet(sintosa(&sain), 0, - RT_DEFAULT_FIB)); + ia = ifatoia(ifa_ifwithnet(sintosa(&sain), 0)); if (ia == NULL) ia = ifatoia(ifa_ifwithaddr(sintosa(&sain))); Modified: head/sys/netinet/ip_options.c ============================================================================== --- head/sys/netinet/ip_options.c Thu May 29 21:02:57 2014 (r266859) +++ head/sys/netinet/ip_options.c Thu May 29 21:03:49 2014 (r266860) @@ -227,11 +227,8 @@ dropit: if (opt == IPOPT_SSRR) { #define INA struct in_ifaddr * #define SA struct sockaddr * - if ((ia = (INA)ifa_ifwithdstaddr((SA)&ipaddr, - RT_DEFAULT_FIB)) == NULL) { - ia = (INA)ifa_ifwithnet((SA)&ipaddr, 0, - RT_DEFAULT_FIB); - } + if ((ia = (INA)ifa_ifwithdstaddr((SA)&ipaddr)) == NULL) + ia = (INA)ifa_ifwithnet((SA)&ipaddr, 0); } else /* XXX MRT 0 for routing */ ia = ip_rtaddr(ipaddr.sin_addr, M_GETFIB(m)); Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Thu May 29 21:02:57 2014 (r266859) +++ head/sys/netinet/ip_output.c Thu May 29 21:03:49 2014 (r266860) @@ -233,8 +233,7 @@ again: */ if (flags & IP_SENDONES) { if ((ia = ifatoia(ifa_ifwithbroadaddr(sintosa(dst)))) == NULL && - (ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst), - RT_DEFAULT_FIB))) == NULL) { + (ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst)))) == NULL) { IPSTAT_INC(ips_noroute); error = ENETUNREACH; goto bad; @@ -245,10 +244,8 @@ again: ip->ip_ttl = 1; isbroadcast = 1; } else if (flags & IP_ROUTETOIF) { - if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst), - RT_DEFAULT_FIB))) == NULL && - (ia = ifatoia(ifa_ifwithnet(sintosa(dst), 0, - RT_DEFAULT_FIB))) == NULL) { + if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst)))) == NULL && + (ia = ifatoia(ifa_ifwithnet(sintosa(dst), 0))) == NULL) { IPSTAT_INC(ips_noroute); error = ENETUNREACH; goto bad; Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Thu May 29 21:02:57 2014 (r266859) +++ head/sys/netinet6/nd6.c Thu May 29 21:03:49 2014 (r266860) @@ -945,7 +945,7 @@ nd6_is_new_addr_neighbor(struct sockaddr * If the address is assigned on the node of the other side of * a p2p interface, the address should be a neighbor. */ - dstaddr = ifa_ifwithdstaddr((struct sockaddr *)addr, RT_DEFAULT_FIB); + dstaddr = ifa_ifwithdstaddr((struct sockaddr *)addr); if (dstaddr != NULL) { if (dstaddr->ifa_ifp == ifp) { ifa_free(dstaddr); Modified: head/tests/sys/netinet/fibs_test.sh ============================================================================== --- head/tests/sys/netinet/fibs_test.sh Thu May 29 21:02:57 2014 (r266859) +++ head/tests/sys/netinet/fibs_test.sh Thu May 29 21:03:49 2014 (r266860) @@ -369,25 +369,38 @@ udp_dontroute_body() atf_expect_fail "kern/187553 Source address selection for UDP packets with SO_DONTROUTE uses the default FIB" # Configure the TAP interface to use an RFC5737 nonrouteable address # and a non-default fib - ADDR="192.0.2.2" + ADDR0="192.0.2.2" + ADDR1="192.0.2.3" SUBNET="192.0.2.0" MASK="24" # Use a different IP on the same subnet as the target TARGET="192.0.2.100" + SRCDIR=`atf_get_srcdir` # Check system configuration if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then atf_skip "This test requires net.add_addr_allfibs=0" fi - get_fibs 1 + get_fibs 2 - # Configure a TAP interface - setup_tap ${FIB0} ${ADDR} ${MASK} + # Configure the TAP interfaces + setup_tap ${FIB0} ${ADDR0} ${MASK} + TARGET_TAP=${TAP} + setup_tap ${FIB1} ${ADDR1} ${MASK} # Send a UDP packet with SO_DONTROUTE. In the failure case, it will - # return ENETUNREACH - SRCDIR=`atf_get_srcdir` - atf_check -o ignore setfib ${FIB0} ${SRCDIR}/udp_dontroute ${TARGET} + # return ENETUNREACH, or send the packet to the wrong tap + atf_check -o ignore setfib ${FIB0} \ + ${SRCDIR}/udp_dontroute ${TARGET} /dev/${TARGET_TAP} + cleanup_tap + + # Repeat, but this time target the other tap + setup_tap ${FIB0} ${ADDR0} ${MASK} + setup_tap ${FIB1} ${ADDR1} ${MASK} + TARGET_TAP=${TAP} + + atf_check -o ignore setfib ${FIB1} \ + ${SRCDIR}/udp_dontroute ${TARGET} /dev/${TARGET_TAP} } udp_dontroute_cleanup() @@ -467,4 +480,5 @@ cleanup_tap() for TAPD in `cat "tap_devices_to_cleanup"`; do ifconfig ${TAPD} destroy done + rm "tap_devices_to_cleanup" } Modified: head/tests/sys/netinet/udp_dontroute.c ============================================================================== --- head/tests/sys/netinet/udp_dontroute.c Thu May 29 21:02:57 2014 (r266859) +++ head/tests/sys/netinet/udp_dontroute.c Thu May 29 21:03:49 2014 (r266860) @@ -39,9 +39,11 @@ #include #include +#include #include #include #include +#include /* * Sends a single UDP packet to the provided address, with SO_DONTROUTE set @@ -51,23 +53,31 @@ int main(int argc, char **argv) { struct sockaddr_in dst; - int s; + int s, t; int opt; int ret; - const char* buf = "Hello, World!"; + ssize_t len; + const char* sendbuf = "Hello, World!"; + const size_t buflen = 80; + char recvbuf[buflen]; - if (argc != 2) { - fprintf(stderr, "Usage: %s ip_address\n", argv[0]); + if (argc != 3) { + fprintf(stderr, "Usage: %s ip_address tapdev\n", argv[0]); exit(2); } + + t = open(argv[2], O_RDWR | O_NONBLOCK); + if (t < 0) + err(EXIT_FAILURE, "open"); + s = socket(PF_INET, SOCK_DGRAM, 0); if (s < 0) - err(errno, "socket"); + err(EXIT_FAILURE, "socket"); opt = 1; ret = setsockopt(s, SOL_SOCKET, SO_DONTROUTE, &opt, sizeof(opt)); if (ret == -1) - err(errno, "setsockopt(SO_DONTROUTE)"); + err(EXIT_FAILURE, "setsockopt(SO_DONTROUTE)"); dst.sin_len = sizeof(dst); dst.sin_family = AF_INET; @@ -77,10 +87,25 @@ main(int argc, char **argv) fprintf(stderr, "Invalid address: %s\n", argv[1]); exit(2); } - ret = sendto(s, buf, strlen(buf), 0, (struct sockaddr*)&dst, + ret = sendto(s, sendbuf, strlen(sendbuf), 0, (struct sockaddr*)&dst, dst.sin_len); if (ret == -1) - err(errno, "sendto"); + err(EXIT_FAILURE, "sendto"); + + /* Verify that the packet went to the desired tap device */ + len = read(t, recvbuf, buflen); + if (len == 0) + errx(EXIT_FAILURE, "read returned EOF"); + else if (len < 0 && errno == EAGAIN) + errx(EXIT_FAILURE, "Did not receive any packets"); + else if (len < 0) + err(EXIT_FAILURE, "read"); + + /* + * If read returned anything at all, consider it a success. The packet + * should be an Ethernet frame containing an ARP request for + * ip_address. We won't bother to decode it + */ return (0); } From owner-svn-src-head@FreeBSD.ORG Thu May 29 21:10:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFDCFA5; Thu, 29 May 2014 21:10:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D25D27E8; Thu, 29 May 2014 21:10:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TLAXNQ020409; Thu, 29 May 2014 21:10:33 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TLAXFU020408; Thu, 29 May 2014 21:10:33 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201405292110.s4TLAXFU020408@svn.freebsd.org> From: Ed Maste Date: Thu, 29 May 2014 21:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266861 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 21:10:33 -0000 Author: emaste Date: Thu May 29 21:10:33 2014 New Revision: 266861 URL: http://svnweb.freebsd.org/changeset/base/266861 Log: Update size in vt_grow if we don't have to reallocate vt_grow may be called with a new size that's larger than previous but does not require reallocation - for example, when the number of columns is the same and new number of rows is less than the history size. Prior to this change we would fail to update vb_scr_size, and then hit a KASSERT when trying to write to the newly visible rows. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_buf.c Modified: head/sys/dev/vt/vt_buf.c ============================================================================== --- head/sys/dev/vt/vt_buf.c Thu May 29 21:03:49 2014 (r266860) +++ head/sys/dev/vt/vt_buf.c Thu May 29 21:10:33 2014 (r266861) @@ -496,6 +496,9 @@ vtbuf_grow(struct vt_buf *vb, const term /* Deallocate old buffer. */ free(old, M_VTBUF); free(oldrows, M_VTBUF); + } else { + /* Just update the size. */ + vb->vb_scr_size = *p; } } From owner-svn-src-head@FreeBSD.ORG Thu May 29 21:52:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FE32C4D; Thu, 29 May 2014 21:52:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03EDA2C06; Thu, 29 May 2014 21:52:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TLqgew041301; Thu, 29 May 2014 21:52:42 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TLqgwF041300; Thu, 29 May 2014 21:52:42 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201405292152.s4TLqgwF041300@svn.freebsd.org> From: Ed Maste Date: Thu, 29 May 2014 21:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266862 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 21:52:43 -0000 Author: emaste Date: Thu May 29 21:52:42 2014 New Revision: 266862 URL: http://svnweb.freebsd.org/changeset/base/266862 Log: Correct vt(4) border calculations on font switch If a vt(4) font does not exactly fit the screen dimensions, the console window is offset so that it is centered. A rectangle is drawn at the top, left, right, and bottom of the screen, to erase any leftovers that are outside of the new usable console area. If the x offset or y offset is 0 then the left border or top border respectively is not drawn. The right and bottom borders may be one pixel larger than necessary due to rounding, and are always drawn. Prior to this change a 0 offset would result in a panic when calling vt_drawrect with an x or y coordinate of -1. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Thu May 29 21:10:33 2014 (r266861) +++ head/sys/dev/vt/vt_core.c Thu May 29 21:52:42 2014 (r266862) @@ -1171,22 +1171,27 @@ static int vt_set_border(struct vt_window *vw, struct vt_font *vf, term_color_t c) { struct vt_device *vd = vw->vw_device; - int l, r, t, b, w, h; + int x, y, off_x, off_y; if (vd->vd_driver->vd_drawrect == NULL) return (ENOTSUP); - w = vd->vd_width - 1; - h = vd->vd_height - 1; - l = vd->vd_offset.tp_col - 1; - r = w - l; - t = vd->vd_offset.tp_row - 1; - b = h - t; - - vd->vd_driver->vd_drawrect(vd, 0, 0, w, t, 1, c); /* Top bar. */ - vd->vd_driver->vd_drawrect(vd, 0, t, l, b, 1, c); /* Left bar. */ - vd->vd_driver->vd_drawrect(vd, r, t, w, b, 1, c); /* Right bar. */ - vd->vd_driver->vd_drawrect(vd, 0, b, w, h, 1, c); /* Bottom bar. */ + x = vd->vd_width - 1; + y = vd->vd_height - 1; + off_x = vd->vd_offset.tp_col; + off_y = vd->vd_offset.tp_row; + + /* Top bar. */ + if (off_y > 0) + vd->vd_driver->vd_drawrect(vd, 0, 0, x, off_y - 1, 1, c); + /* Left bar. */ + if (off_x > 0) + vd->vd_driver->vd_drawrect(vd, 0, off_y, off_x - 1, y - off_y, + 1, c); + /* Right bar. May be 1 pixel wider than necessary due to rounding. */ + vd->vd_driver->vd_drawrect(vd, x - off_x, off_y, x, y - off_y, 1, c); + /* Bottom bar. May be 1 mixel taller than necessary due to rounding. */ + vd->vd_driver->vd_drawrect(vd, 0, y - off_y, x, y, 1, c); return (0); } From owner-svn-src-head@FreeBSD.ORG Thu May 29 22:34:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6F8DB08; Thu, 29 May 2014 22:34:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA6662FA0; Thu, 29 May 2014 22:34:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4TMY4mn060155; Thu, 29 May 2014 22:34:04 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4TMY45I060153; Thu, 29 May 2014 22:34:04 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201405292234.s4TMY45I060153@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 29 May 2014 22:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266863 - in head: etc/mtree usr.sbin/unbound/local-setup X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 22:34:05 -0000 Author: des Date: Thu May 29 22:34:04 2014 New Revision: 266863 URL: http://svnweb.freebsd.org/changeset/base/266863 Log: Create /var/unbound/conf.d for additional configuration files. Ensure that it is used if present. MFH: 3 weeks Modified: head/etc/mtree/BSD.var.dist head/usr.sbin/unbound/local-setup/local-unbound-setup.sh Modified: head/etc/mtree/BSD.var.dist ============================================================================== --- head/etc/mtree/BSD.var.dist Thu May 29 21:52:42 2014 (r266862) +++ head/etc/mtree/BSD.var.dist Thu May 29 22:34:04 2014 (r266863) @@ -96,6 +96,8 @@ .. .. unbound uname=unbound gname=unbound mode=0755 + conf.d uname=unbound gname=unbound mode=0755 + .. .. yp .. Modified: head/usr.sbin/unbound/local-setup/local-unbound-setup.sh ============================================================================== --- head/usr.sbin/unbound/local-setup/local-unbound-setup.sh Thu May 29 21:52:42 2014 (r266862) +++ head/usr.sbin/unbound/local-setup/local-unbound-setup.sh Thu May 29 22:34:04 2014 (r266863) @@ -34,6 +34,7 @@ user="" unbound_conf="" forward_conf="" workdir="" +confdir="" chrootdir="" anchor="" pidfile="" @@ -55,6 +56,7 @@ bkext=$(date "+%Y%m%d.%H%M%S") set_defaults() { : ${user:=unbound} : ${workdir:=/var/unbound} + : ${confdir:=${workdir}/conf.d} : ${unbound_conf:=${workdir}/unbound.conf} : ${forward_conf:=${workdir}/forward.conf} : ${anchor:=${workdir}/root.key} @@ -195,6 +197,9 @@ gen_unbound_conf() { if [ -f "${forward_conf}" ] ; then echo "include: ${forward_conf}" fi + if [ -d "${confdir}" ] ; then + echo "include: ${confdir}/*.conf" + fi } # @@ -227,7 +232,8 @@ usage() { echo "options:" echo " -n do not start unbound" echo " -a path full path to trust anchor file" - echo " -c path full path to unbound configuration" + echo " -C path full path to additional configuration directory" + echo " -c path full path to unbound configuration file" echo " -f path full path to forwarding configuration" echo " -p path full path to pid file" echo " -R path full path to resolvconf.conf" @@ -247,11 +253,14 @@ main() { # # Parse and validate command-line options # - while getopts "a:c:f:np:R:r:s:u:w:" option ; do + while getopts "a:C:c:f:np:R:r:s:u:w:" option ; do case $option in a) anchor="$OPTARG" ;; + C) + confdir="$OPTARG" + ;; c) unbound_conf="$OPTARG" ;; From owner-svn-src-head@FreeBSD.ORG Fri May 30 01:09:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38EC1491; Fri, 30 May 2014 01:09:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 257632B24; Fri, 30 May 2014 01:09:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4U198Oq028756; Fri, 30 May 2014 01:09:08 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4U197Ox028750; Fri, 30 May 2014 01:09:07 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405300109.s4U197Ox028750@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 30 May 2014 01:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266865 - in head: include include/xlocale lib/libc/string X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 01:09:09 -0000 Author: pfg Date: Fri May 30 01:09:07 2014 New Revision: 266865 URL: http://svnweb.freebsd.org/changeset/base/266865 Log: Fix strcasecmp_l() and strncasecmp_l() POSIX 2008 compliance. POSIX.1-2008 specifies that those two functions should be declared by including , not (the latter only has strcoll_l() and strxfrm_l()): http://pubs.opengroup.org/onlinepubs/9699919799/functions/strcasecmp.html Obtained from: DragonFlyBSD Reviewed by: theraven MFC after: 2 weeks Added: head/include/xlocale/_strings.h - copied, changed from r266827, head/include/xlocale/_string.h Modified: head/include/strings.h head/include/xlocale/Makefile head/include/xlocale/_string.h head/lib/libc/string/strcasecmp.3 Modified: head/include/strings.h ============================================================================== --- head/include/strings.h Fri May 30 00:12:25 2014 (r266864) +++ head/include/strings.h Fri May 30 01:09:07 2014 (r266865) @@ -59,6 +59,10 @@ char *rindex(const char *, int) __pure; #endif int strcasecmp(const char *, const char *) __pure; int strncasecmp(const char *, const char *, size_t) __pure; + +#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) +#include +#endif __END_DECLS #endif /* _STRINGS_H_ */ Modified: head/include/xlocale/Makefile ============================================================================== --- head/include/xlocale/Makefile Fri May 30 00:12:25 2014 (r266864) +++ head/include/xlocale/Makefile Fri May 30 01:09:07 2014 (r266865) @@ -2,7 +2,7 @@ NO_OBJ= INCS= _ctype.h _inttypes.h _langinfo.h _locale.h _monetary.h _stdio.h\ - _stdlib.h _string.h _time.h _uchar.h _wchar.h + _stdlib.h _string.h _strings.h _time.h _uchar.h _wchar.h INCSDIR=${INCLUDEDIR}/xlocale .include Modified: head/include/xlocale/_string.h ============================================================================== --- head/include/xlocale/_string.h Fri May 30 00:12:25 2014 (r266864) +++ head/include/xlocale/_string.h Fri May 30 01:09:07 2014 (r266865) @@ -53,9 +53,7 @@ size_t strxfrm_l(char *, const char *, #ifdef _XLOCALE_H_ #ifndef _XLOCALE_STRING2_H #define _XLOCALE_STRING2_H -int strcasecmp_l(const char *, const char *, locale_t); char *strcasestr_l(const char *, const char *, locale_t); -int strncasecmp_l(const char *, const char *, size_t, locale_t); #endif /* _XLOCALE_STRING2_H */ #endif /* _XLOCALE_H_ */ Copied and modified: head/include/xlocale/_strings.h (from r266827, head/include/xlocale/_string.h) ============================================================================== --- head/include/xlocale/_string.h Thu May 29 01:42:22 2014 (r266827, copy source) +++ head/include/xlocale/_strings.h Fri May 30 01:09:07 2014 (r266865) @@ -32,30 +32,17 @@ typedef struct _xlocale *locale_t; #endif /* - * This file is included from both string.h and xlocale.h. We need to expose + * This file is included from both strings.h and xlocale.h. We need to expose * the declarations unconditionally if we are included from xlocale.h, but only * if we are in POSIX2008 mode if included from string.h. */ -#ifndef _XLOCALE_STRING1_H -#define _XLOCALE_STRING1_H +#ifndef _XLOCALE_STRINGS1_H +#define _XLOCALE_STRINGS1_H /* * POSIX2008 functions */ -int strcoll_l(const char *, const char *, locale_t); -size_t strxfrm_l(char *, const char *, size_t, locale_t); -#endif /* _XLOCALE_STRING1_H */ - -/* - * xlocale extensions - */ -#ifdef _XLOCALE_H_ -#ifndef _XLOCALE_STRING2_H -#define _XLOCALE_STRING2_H int strcasecmp_l(const char *, const char *, locale_t); -char *strcasestr_l(const char *, const char *, locale_t); int strncasecmp_l(const char *, const char *, size_t, locale_t); - -#endif /* _XLOCALE_STRING2_H */ -#endif /* _XLOCALE_H_ */ +#endif /* _XLOCALE_STRINGS1_H */ Modified: head/lib/libc/string/strcasecmp.3 ============================================================================== --- head/lib/libc/string/strcasecmp.3 Fri May 30 00:12:25 2014 (r266864) +++ head/lib/libc/string/strcasecmp.3 Fri May 30 01:09:07 2014 (r266865) @@ -30,7 +30,7 @@ .\" @(#)strcasecmp.3 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd June 9, 1993 +.Dd May 29, 2014 .Dt STRCASECMP 3 .Os .Sh NAME @@ -45,7 +45,7 @@ .Fn strcasecmp "const char *s1" "const char *s2" .Ft int .Fn strncasecmp "const char *s1" "const char *s2" "size_t len" -.In string.h +.In strings.h .In xlocale.h .Ft int .Fn strcasecmp_l "const char *s1" "const char *s2" "locale_t loc" From owner-svn-src-head@FreeBSD.ORG Fri May 30 02:16:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AAD22A3; Fri, 30 May 2014 02:16:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07FEC217D; Fri, 30 May 2014 02:16:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4U2GSa7059667; Fri, 30 May 2014 02:16:28 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4U2GS2A059666; Fri, 30 May 2014 02:16:28 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201405300216.s4U2GS2A059666@svn.freebsd.org> From: Benjamin Kaduk Date: Fri, 30 May 2014 02:16:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266866 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 02:16:29 -0000 Author: bjk (doc committer) Date: Fri May 30 02:16:28 2014 New Revision: 266866 URL: http://svnweb.freebsd.org/changeset/base/266866 Log: Minor mdoc fix Submitted by: hrs Approved by: hrs (mentor, implicit) Modified: head/lib/libc/sys/mlock.2 Modified: head/lib/libc/sys/mlock.2 ============================================================================== --- head/lib/libc/sys/mlock.2 Fri May 30 01:09:07 2014 (r266865) +++ head/lib/libc/sys/mlock.2 Fri May 30 02:16:28 2014 (r266866) @@ -94,7 +94,7 @@ limited in how much they can lock down. The amount of memory that a single process can .Fn mlock is limited by both the per-process -.Li RLIMIT_MEMLOCK +.Dv RLIMIT_MEMLOCK resource limit and the system-wide .Dq wired pages From owner-svn-src-head@FreeBSD.ORG Fri May 30 05:17:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18D33DF1; Fri, 30 May 2014 05:17:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06C4F2EC8; Fri, 30 May 2014 05:17:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4U5HEXi040723; Fri, 30 May 2014 05:17:14 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4U5HE5c040722; Fri, 30 May 2014 05:17:14 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201405300517.s4U5HE5c040722@svn.freebsd.org> From: Rui Paulo Date: Fri, 30 May 2014 05:17:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266868 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 05:17:15 -0000 Author: rpaulo Date: Fri May 30 05:17:14 2014 New Revision: 266868 URL: http://svnweb.freebsd.org/changeset/base/266868 Log: Cleanup the RADXA kernel config file a bit and enable modules. Modified: head/sys/arm/conf/RADXA Modified: head/sys/arm/conf/RADXA ============================================================================== --- head/sys/arm/conf/RADXA Fri May 30 04:44:07 2014 (r266867) +++ head/sys/arm/conf/RADXA Fri May 30 05:17:14 2014 (r266868) @@ -22,9 +22,6 @@ ident RADXA include "../rockchip/std.rk30xx" -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - options HZ=100 options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking @@ -51,6 +48,7 @@ options KBD_INSTALL_CDEV # install a CD options PREEMPTION options FREEBSD_BOOT_LOADER options VFP # vfp/neon +options SMP # Enable multiple cores # Debugging makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols @@ -73,7 +71,7 @@ options DIAGNOSTIC #device mmc # mmc/sd bus #device mmcsd # mmc/sd flash cards -# Boot device is 2nd slice on MMC/SD card +# Boot device is 2nd slice on USB options ROOTDEVNAME=\"ufs:/dev/da0s2\" # Console and misc @@ -121,4 +119,3 @@ options FDT options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=rk3188-radxa.dts -options SMP # Enable multiple cores From owner-svn-src-head@FreeBSD.ORG Fri May 30 05:18:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A572F41; Fri, 30 May 2014 05:18:35 +0000 (UTC) Received: from felyko.com (felyko.com [IPv6:2001:470:1:2d5:26:3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 5BF192ED0; Fri, 30 May 2014 05:18:35 +0000 (UTC) Received: from [IPv6:2601:9:8280:426:492f:3eef:f7f4:879e] (unknown [IPv6:2601:9:8280:426:492f:3eef:f7f4:879e]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 7394E34A9E7; Thu, 29 May 2014 22:18:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1401427114; bh=2c+xUc9WLnZc02QMkCq9svUOdZQOzTj56dXRfLxypdg=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=Ab5fhWilhm9+9iRgzGHsDkMMlvErNaQdFbse1cn8Eec/gR23rkmr127+MzjgAYRZv hElM7DRqCyKqYd4LCXHjhOE+R988Pg5Jr0fi6Qye1LysSWh7ug5Qr8/fWa0rOKZe0M /sum71VADf40BKX8WxhjtWUy6160h8mARcZwZ+sA= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266865 - in head: include include/xlocale lib/libc/string From: Rui Paulo In-Reply-To: <201405300109.s4U197Ox028750@svn.freebsd.org> Date: Thu, 29 May 2014 22:18:31 -0700 Content-Transfer-Encoding: 7bit Message-Id: <7AFBC7BD-9F6F-44AA-BBAE-B4A1B20E9B02@felyko.com> References: <201405300109.s4U197Ox028750@svn.freebsd.org> To: "Pedro F. Giffuni" X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 05:18:35 -0000 On May 29, 2014, at 18:09, Pedro F. Giffuni wrote: > Author: pfg > Date: Fri May 30 01:09:07 2014 > New Revision: 266865 > URL: http://svnweb.freebsd.org/changeset/base/266865 > > Log: > Fix strcasecmp_l() and strncasecmp_l() POSIX 2008 compliance. > > POSIX.1-2008 specifies that those two functions should be declared by > including , not (the latter only has strcoll_l() > and strxfrm_l()): > > http://pubs.opengroup.org/onlinepubs/9699919799/functions/strcasecmp.html Is this going to cause any ports fallout? -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Fri May 30 06:37:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0224BB6B; Fri, 30 May 2014 06:37:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6766249D; Fri, 30 May 2014 06:37:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4U6b7AA078062; Fri, 30 May 2014 06:37:07 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4U6b7i4078058; Fri, 30 May 2014 06:37:07 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201405300637.s4U6b7i4078058@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Fri, 30 May 2014 06:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266871 - in head/sys: arm/conf boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 06:37:08 -0000 Author: ganbold Date: Fri May 30 06:37:06 2014 New Revision: 266871 URL: http://svnweb.freebsd.org/changeset/base/266871 Log: Add common kernel config file for Rockchip RK3188 systems by splitting current RADXA config. Radxa Rock (RR) boards have few types such as RR (full version), RR Lite and some variants of RR engineering samples. Add kernel config and FDT file for RR Lite board. Approved by: stas (mentor) Added: head/sys/arm/conf/RADXA-LITE (contents, props changed) head/sys/arm/conf/RK3188 (contents, props changed) head/sys/boot/fdt/dts/arm/rk3188-radxa-lite.dts (contents, props changed) Modified: head/sys/arm/conf/RADXA Modified: head/sys/arm/conf/RADXA ============================================================================== --- head/sys/arm/conf/RADXA Fri May 30 06:34:29 2014 (r266870) +++ head/sys/arm/conf/RADXA Fri May 30 06:37:06 2014 (r266871) @@ -18,104 +18,10 @@ # # $FreeBSD$ +include "RK3188" ident RADXA -include "../rockchip/std.rk30xx" - -options HZ=100 -options SCHED_4BSD # 4BSD scheduler -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options TMPFS # Efficient memory filesystem -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE # ktrace(1) support -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options PREEMPTION -options FREEBSD_BOOT_LOADER -options VFP # vfp/neon -options SMP # Enable multiple cores - -# Debugging -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB -options DDB # Enable the kernel debugger -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options DIAGNOSTIC - -# NFS support -#options NFSCL -#options NFSSERVER # Network Filesystem Server -#options NFSCLIENT # Network Filesystem Client - -# MMC/SD/SDIO card slot support -#device mmc # mmc/sd bus -#device mmcsd # mmc/sd flash cards - -# Boot device is 2nd slice on USB -options ROOTDEVNAME=\"ufs:/dev/da0s2\" - -# Console and misc -device uart -device uart_ns8250 -device pty -device snp -device md -device random # Entropy device - -# I2C support -#device iicbus -#device iic - -# GPIO -device gpio - -device scbus # SCSI bus (required for SCSI) -device da # Direct Access (disks) -device pass - -# USB support -options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. -device usb -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE -device dwcotg # DWC OTG controller - -device umass - -# Ethernet -device loop -device ether -device mii -device smscphy -device bpf - -# USB ethernet support, requires miibus -device miibus -device udav - # Flattened Device Tree options FDT options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=rk3188-radxa.dts - Added: head/sys/arm/conf/RADXA-LITE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/RADXA-LITE Fri May 30 06:37:06 2014 (r266871) @@ -0,0 +1,27 @@ +# RADXA-LITE -- Custom configuration for the RADXA LITE ARM development +# platform, check out http://www.radxa.com +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include "RK3188" +ident RADXA-LITE + +# Flattened Device Tree +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=rk3188-radxa-lite.dts Added: head/sys/arm/conf/RK3188 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/RK3188 Fri May 30 06:37:06 2014 (r266871) @@ -0,0 +1,126 @@ +# Kernel configuration for Rockchip RK3188 systems. +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident RK3188 + +include "../rockchip/std.rk30xx" + +options HZ=100 +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options TMPFS # Efficient memory filesystem +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE # ktrace(1) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options PREEMPTION +options FREEBSD_BOOT_LOADER +options VFP # vfp/neon +options SMP # Enable multiple cores + +# Debugging +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +options BREAK_TO_DEBUGGER +#options VERBOSE_SYSINIT # Enable verbose sysinit messages +options KDB +options DDB # Enable the kernel debugger +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +options DIAGNOSTIC + +# NFS support +#options NFSCL +#options NFSSERVER # Network Filesystem Server +#options NFSCLIENT # Network Filesystem Client + +# MMC/SD/SDIO card slot support +#device mmc # mmc/sd bus +#device mmcsd # mmc/sd flash cards + +# Boot device is 2nd slice on USB +options ROOTDEVNAME=\"ufs:/dev/da0s2\" + +# Console and misc +device uart +device uart_ns8250 +device pty +device snp +device md +device random # Entropy device + +# I2C support +#device iicbus +#device iic + +# GPIO +device gpio + +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device pass + +# USB support +options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. +device usb +options USB_DEBUG +#options USB_REQ_DEBUG +#options USB_VERBOSE +device dwcotg # DWC OTG controller + +device umass + +# Ethernet +device loop +device ether +device mii +device bpf + +# Wireless NIC cards +options IEEE80211_DEBUG +options IEEE80211_AMPDU_AGE +options IEEE80211_SUPPORT_MESH +options IEEE80211_SUPPORT_TDMA +device wlan # 802.11 support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support +device urtwn +device urtwnfw +device firmware # Used by the above + +# USB ethernet support, requires miibus +device miibus +device udav Added: head/sys/boot/fdt/dts/arm/rk3188-radxa-lite.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/rk3188-radxa-lite.dts Fri May 30 06:37:06 2014 (r266871) @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2014 Ganbold Tsagaankhuu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/include/ "rk3188.dtsi" + +/ { + model = "Radxa RadxaRock Lite"; + + memory { + device_type = "memory"; + reg = < 0x60000000 0x40000000 >; /* 1GB RAM */ + }; + + aliases { + soc = &SOC; + }; + + SOC: rk3188 { + + uart2: serial@20064000 { + status = "okay"; + }; + + }; + + chosen { + bootargs = "-v"; + stdin = &uart2; + stdout = &uart2; + }; +}; + From owner-svn-src-head@FreeBSD.ORG Fri May 30 06:45:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DB91D2E; Fri, 30 May 2014 06:45:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E6CA2542; Fri, 30 May 2014 06:45:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4U6jpjC082237; Fri, 30 May 2014 06:45:51 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4U6joQG082233; Fri, 30 May 2014 06:45:50 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201405300645.s4U6joQG082233@svn.freebsd.org> From: Ruslan Bukin Date: Fri, 30 May 2014 06:45:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266872 - in head/sys: arm/samsung/exynos boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 06:45:51 -0000 Author: br Date: Fri May 30 06:45:50 2014 New Revision: 266872 URL: http://svnweb.freebsd.org/changeset/base/266872 Log: o Make keyboard-related properties to be compatible with vendor standard o Allow setting keymap in FDT, use hardcoded one by default o Represent fallback keymap as a list rather than directly usable M*N array Submitted by: Maxim Ignatenko Modified: head/sys/arm/samsung/exynos/chrome_kb.c head/sys/arm/samsung/exynos/chrome_kb.h head/sys/boot/fdt/dts/arm/exynos5250-chromebook-snow.dts head/sys/boot/fdt/dts/arm/exynos5250-chromebook-spring.dts Modified: head/sys/arm/samsung/exynos/chrome_kb.c ============================================================================== --- head/sys/arm/samsung/exynos/chrome_kb.c Fri May 30 06:37:06 2014 (r266871) +++ head/sys/arm/samsung/exynos/chrome_kb.c Fri May 30 06:45:50 2014 (r266872) @@ -105,9 +105,6 @@ __FBSDID("$FreeBSD$"); #define CKB_FLAG_POLLING 0x2 #define KBD_DRIVER_NAME "ckbd" -/* TODO: take interrupt from DTS */ -#define KB_GPIO_INT 146 - struct ckb_softc { keyboard_t sc_kbd; keymap_t sc_keymap; @@ -130,9 +127,11 @@ struct ckb_softc { int flag; int rows; int cols; + int gpio; device_t dev; device_t gpio_dev; struct thread *sc_poll_thread; + uint16_t *keymap; uint8_t *scan_local; uint8_t *scan; @@ -199,7 +198,7 @@ static int ckb_intr(keyboard_t *kbd, void *arg) { - return (0); + return (0); } /* lock the access to the keyboard, not used */ @@ -207,7 +206,7 @@ static int ckb_lock(keyboard_t *kbd, int lock) { - return (1); + return (1); } /* clear the internal state of the keyboard */ @@ -309,20 +308,33 @@ ckb_read(keyboard_t *kbd, int wait) return (0); } -int scantokey(int i, int j); - -int -scantokey(int i, int j) +static uint16_t +keymap_read(struct ckb_softc *sc, int col, int row) { - int k; - for (k = 0; k < KEYMAP_LEN; k++) - if ((keymap[k].col == i) && (keymap[k].row == j)) - return (keymap[k].key); + KASSERT(sc->keymap != NULL, "keymap_read: no keymap"); + if (col >= 0 && col < sc->cols && + row >= 0 && row < sc->rows) { + return sc->keymap[row * sc->cols + col]; + } return (0); } +static int +keymap_write(struct ckb_softc *sc, int col, int row, uint16_t key) +{ + + KASSERT(sc->keymap != NULL, "keymap_write: no keymap"); + if (col >= 0 && col < sc->cols && + row >= 0 && row < sc->rows) { + sc->keymap[row * sc->cols + col] = key; + return (0); + } + + return (-1); +} + /* read char from the keyboard */ static uint32_t ckb_read_char_locked(keyboard_t *kbd, int wait) @@ -350,9 +362,10 @@ ckb_read_char_locked(keyboard_t *kbd, in if (sc->sc_flags & CKB_FLAG_POLLING) { for (;;) { - GPIO_PIN_GET(sc->gpio_dev, KB_GPIO_INT, &status); + GPIO_PIN_GET(sc->gpio_dev, sc->gpio, &status); if (status == 0) { - if (ec_command(EC_CMD_MKBP_STATE, sc->scan, sc->cols, + if (ec_command(EC_CMD_MKBP_STATE, sc->scan, + sc->cols, sc->scan, sc->cols)) { return (NOKEY); } @@ -373,7 +386,7 @@ ckb_read_char_locked(keyboard_t *kbd, in if (oldbit == newbit) continue; - key = scantokey(i,j); + key = keymap_read(sc, i, j); if (key == 0) { continue; }; @@ -666,27 +679,109 @@ dummy_kbd_configure(int flags) KEYBOARD_DRIVER(ckbd, ckbdsw, dummy_kbd_configure); +/* + * Parses 'keymap' into sc->keymap. + * Requires sc->cols and sc->rows to be set. + */ +static int +parse_keymap(struct ckb_softc *sc, pcell_t *keymap, size_t len) +{ + int i; + + sc->keymap = malloc(sc->cols * sc->rows * sizeof(sc->keymap[0]), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (sc->keymap == NULL) { + return (ENOMEM); + } + + for (i = 0; i < len; i++) { + /* + * Return value is ignored, we just write whatever fits into + * specified number of rows and columns and silently ignore + * everything else. + * Keymap entries follow this format: 0xRRCCKKKK + * RR - row number, CC - column number, KKKK - key code + */ + keymap_write(sc, (keymap[i] >> 16) & 0xff, + (keymap[i] >> 24) & 0xff, + keymap[i] & 0xffff); + } + + return (0); +} + +/* Allocates a new array for keymap and returns it in 'keymap'. */ +static int +read_keymap(phandle_t node, const char *prop, pcell_t **keymap, size_t *len) +{ + + if ((*len = OF_getproplen(node, prop)) <= 0) { + return (ENXIO); + } + if ((*keymap = malloc(*len, M_DEVBUF, M_NOWAIT)) == NULL) { + return (ENOMEM); + } + if (OF_getencprop(node, prop, *keymap, *len) != *len) { + return (ENXIO); + } + return (0); +} + static int parse_dts(struct ckb_softc *sc) { phandle_t node; pcell_t dts_value; - int len; + pcell_t *keymap; + int len, ret; + const char *keymap_prop = NULL; if ((node = ofw_bus_get_node(sc->dev)) == -1) return (ENXIO); - if ((len = OF_getproplen(node, "keypad,num-rows")) <= 0) + if ((len = OF_getproplen(node, "google,key-rows")) <= 0) return (ENXIO); - OF_getprop(node, "keypad,num-rows", &dts_value, len); + OF_getprop(node, "google,key-rows", &dts_value, len); sc->rows = fdt32_to_cpu(dts_value); - if ((len = OF_getproplen(node, "keypad,num-columns")) <= 0) + if ((len = OF_getproplen(node, "google,key-columns")) <= 0) return (ENXIO); - OF_getprop(node, "keypad,num-columns", &dts_value, len); + OF_getprop(node, "google,key-columns", &dts_value, len); sc->cols = fdt32_to_cpu(dts_value); - if ((sc->rows == 0) || (sc->cols == 0)) + if ((len = OF_getproplen(node, "freebsd,intr-gpio")) <= 0) + return (ENXIO); + OF_getprop(node, "freebsd,intr-gpio", &dts_value, len); + sc->gpio = fdt32_to_cpu(dts_value); + + if (OF_hasprop(node, "freebsd,keymap")) { + keymap_prop = "freebsd,keymap"; + device_printf(sc->dev, "using FreeBSD-specific keymap from FDT\n"); + } else if (OF_hasprop(node, "linux,keymap")) { + keymap_prop = "linux,keymap"; + device_printf(sc->dev, "using Linux keymap from FDT\n"); + } else { + device_printf(sc->dev, "using built-in keymap\n"); + } + + if (keymap_prop != NULL) { + if ((ret = read_keymap(node, keymap_prop, &keymap, &len))) { + device_printf(sc->dev, + "failed to read keymap from FDT: %d\n", ret); + return (ret); + } + ret = parse_keymap(sc, keymap, len); + free(keymap, M_DEVBUF); + if (ret) { + return (ret); + } + } else { + if ((ret = parse_keymap(sc, default_keymap, KEYMAP_LEN))) { + return (ret); + } + } + + if ((sc->rows == 0) || (sc->cols == 0) || (sc->gpio == 0)) return (ENXIO); return (0); @@ -721,6 +816,7 @@ chrome_kb_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; + sc->keymap = NULL; if ((error = parse_dts(sc)) != 0) return error; @@ -736,8 +832,7 @@ chrome_kb_attach(device_t dev) sc->cols, sc->rows); #endif - /* TODO: take interrupt from DTS */ - pad_setup_intr(KB_GPIO_INT, ckb_ec_intr, sc); + pad_setup_intr(sc->gpio, ckb_ec_intr, sc); kbd = &sc->sc_kbd; rid = 0; @@ -786,7 +881,8 @@ chrome_kb_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (ofw_bus_is_compatible(dev, "google,cros-ec-keyb")) { + if (ofw_bus_is_compatible(dev, "google,cros-ec-keyb") || + ofw_bus_is_compatible(dev, "google,mkbp-keyb")) { device_set_desc(dev, "Chrome EC Keyboard"); return (BUS_PROBE_DEFAULT); } @@ -794,9 +890,24 @@ chrome_kb_probe(device_t dev) return (ENXIO); } +static int +chrome_kb_detach(device_t dev) +{ + struct ckb_softc *sc; + + sc = device_get_softc(dev); + + if (sc->keymap != NULL) { + free(sc->keymap, M_DEVBUF); + } + + return 0; +} + static device_method_t chrome_kb_methods[] = { DEVMETHOD(device_probe, chrome_kb_probe), DEVMETHOD(device_attach, chrome_kb_attach), + DEVMETHOD(device_detach, chrome_kb_detach), { 0, 0 } }; Modified: head/sys/arm/samsung/exynos/chrome_kb.h ============================================================================== --- head/sys/arm/samsung/exynos/chrome_kb.h Fri May 30 06:37:06 2014 (r266871) +++ head/sys/arm/samsung/exynos/chrome_kb.h Fri May 30 06:45:50 2014 (r266872) @@ -26,97 +26,93 @@ * $FreeBSD$ */ -void ckb_ec_intr(void *); +#include -struct key { - uint8_t row; - uint8_t col; - uint8_t key; -}; +void ckb_ec_intr(void *); #define KEYMAP_LEN 75 -struct key keymap[KEYMAP_LEN] = { - { 0x00, 0x01, 0x7d }, /* lmeta */ - { 0x00, 0x02, 0x3b }, /* F1 */ - { 0x00, 0x03, 0x30 }, /* B */ - { 0x00, 0x04, 0x44 }, /* F10 */ - { 0x00, 0x06, 0x31 }, /* N */ - { 0x00, 0x08, 0x0d }, /* = */ - { 0x00, 0x0a, 0x64 }, /* ralt */ - - { 0x01, 0x01, 0x01 }, /* escape */ - { 0x01, 0x02, 0x3e }, /* F4 */ - { 0x01, 0x03, 0x22 }, /* G */ - { 0x01, 0x04, 0x41 }, /* F7 */ - { 0x01, 0x06, 0x23 }, /* H */ - { 0x01, 0x08, 0x28 }, /* ' */ - { 0x01, 0x09, 0x43 }, /* F9 */ - { 0x01, 0x0b, 0x0e }, /* backspace */ - - { 0x02, 0x00, 0x1d }, /* lctrl */ - { 0x02, 0x01, 0x0f }, /* tab */ - { 0x02, 0x02, 0x3d }, /* F3 */ - { 0x02, 0x03, 0x14 }, /* t */ - { 0x02, 0x04, 0x40 }, /* F6 */ - { 0x02, 0x05, 0x1b }, /* ] */ - { 0x02, 0x06, 0x15 }, /* y */ - { 0x02, 0x07, 0x56 }, /* 102nd */ - { 0x02, 0x08, 0x1a }, /* [ */ - { 0x02, 0x09, 0x42 }, /* F8 */ - - { 0x03, 0x01, 0x29 }, /* grave */ - { 0x03, 0x02, 0x3c }, /* F2 */ - { 0x03, 0x03, 0x06 }, /* 5 */ - { 0x03, 0x04, 0x3f }, /* F5 */ - { 0x03, 0x06, 0x07 }, /* 6 */ - { 0x03, 0x08, 0x0c }, /* - */ - { 0x03, 0x0b, 0x2b }, /* \ */ - - { 0x04, 0x00, 0x61 }, /* rctrl */ - { 0x04, 0x01, 0x1e }, /* a */ - { 0x04, 0x02, 0x20 }, /* d */ - { 0x04, 0x03, 0x21 }, /* f */ - { 0x04, 0x04, 0x1f }, /* s */ - { 0x04, 0x05, 0x25 }, /* k */ - { 0x04, 0x06, 0x24 }, /* j */ - { 0x04, 0x08, 0x27 }, /* ; */ - { 0x04, 0x09, 0x26 }, /* l */ - { 0x04, 0x0a, 0x2b }, /* \ */ - { 0x04, 0x0b, 0x1c }, /* enter */ - - { 0x05, 0x01, 0x2c }, /* z */ - { 0x05, 0x02, 0x2e }, /* c */ - { 0x05, 0x03, 0x2f }, /* v */ - { 0x05, 0x04, 0x2d }, /* x */ - { 0x05, 0x05, 0x33 }, /* , */ - { 0x05, 0x06, 0x32 }, /* m */ - { 0x05, 0x07, 0x2a }, /* lsh */ - { 0x05, 0x08, 0x35 }, /* / */ - { 0x05, 0x09, 0x34 }, /* . */ - { 0x05, 0x0B, 0x39 }, /* space */ - - { 0x06, 0x01, 0x02 }, /* 1 */ - { 0x06, 0x02, 0x04 }, /* 3 */ - { 0x06, 0x03, 0x05 }, /* 4 */ - { 0x06, 0x04, 0x03 }, /* 2 */ - { 0x06, 0x05, 0x09 }, /* 8 */ - { 0x06, 0x06, 0x08 }, /* 7 */ - { 0x06, 0x08, 0x0b }, /* 0 */ - { 0x06, 0x09, 0x0a }, /* 9 */ - { 0x06, 0x0a, 0x38 }, /* lalt */ - { 0x06, 0x0b, 0x64 }, /* down */ - { 0x06, 0x0c, 0x62 }, /* right */ - - { 0x07, 0x01, 0x10 }, /* q */ - { 0x07, 0x02, 0x12 }, /* e */ - { 0x07, 0x03, 0x13 }, /* r */ - { 0x07, 0x04, 0x11 }, /* w */ - { 0x07, 0x05, 0x17 }, /* i */ - { 0x07, 0x06, 0x16 }, /* u */ - { 0x07, 0x07, 0x36 }, /* rsh */ - { 0x07, 0x08, 0x19 }, /* p */ - { 0x07, 0x09, 0x18 }, /* o */ - { 0x07, 0x0b, 0x5F }, /* up */ - { 0x07, 0x0c, 0x61 }, /* left */ +pcell_t default_keymap[KEYMAP_LEN] = { + 0x0001007d, /* lmeta */ + 0x0002003b, /* F1 */ + 0x00030030, /* B */ + 0x00040044, /* F10 */ + 0x00060031, /* N */ + 0x0008000d, /* = */ + 0x000a0064, /* ralt */ + + 0x01010001, /* escape */ + 0x0102003e, /* F4 */ + 0x01030022, /* G */ + 0x01040041, /* F7 */ + 0x01060023, /* H */ + 0x01080028, /* ' */ + 0x01090043, /* F9 */ + 0x010b000e, /* backspace */ + + 0x0200001d, /* lctrl */ + 0x0201000f, /* tab */ + 0x0202003d, /* F3 */ + 0x02030014, /* t */ + 0x02040040, /* F6 */ + 0x0205001b, /* ] */ + 0x02060015, /* y */ + 0x02070056, /* 102nd */ + 0x0208001a, /* [ */ + 0x02090042, /* F8 */ + + 0x03010029, /* grave */ + 0x0302003c, /* F2 */ + 0x03030006, /* 5 */ + 0x0304003f, /* F5 */ + 0x03060007, /* 6 */ + 0x0308000c, /* - */ + 0x030b002b, /* \ */ + + 0x04000061, /* rctrl */ + 0x0401001e, /* a */ + 0x04020020, /* d */ + 0x04030021, /* f */ + 0x0404001f, /* s */ + 0x04050025, /* k */ + 0x04060024, /* j */ + 0x04080027, /* ; */ + 0x04090026, /* l */ + 0x040a002b, /* \ */ + 0x040b001c, /* enter */ + + 0x0501002c, /* z */ + 0x0502002e, /* c */ + 0x0503002f, /* v */ + 0x0504002d, /* x */ + 0x05050033, /* , */ + 0x05060032, /* m */ + 0x0507002a, /* lsh */ + 0x05080035, /* / */ + 0x05090034, /* . */ + 0x050B0039, /* space */ + + 0x06010002, /* 1 */ + 0x06020004, /* 3 */ + 0x06030005, /* 4 */ + 0x06040003, /* 2 */ + 0x06050009, /* 8 */ + 0x06060008, /* 7 */ + 0x0608000b, /* 0 */ + 0x0609000a, /* 9 */ + 0x060a0038, /* lalt */ + 0x060b0064, /* down */ + 0x060c0062, /* right */ + + 0x07010010, /* q */ + 0x07020012, /* e */ + 0x07030013, /* r */ + 0x07040011, /* w */ + 0x07050017, /* i */ + 0x07060016, /* u */ + 0x07070036, /* rsh */ + 0x07080019, /* p */ + 0x07090018, /* o */ + 0x070b005F, /* up */ + 0x070c0061, /* left */ }; Modified: head/sys/boot/fdt/dts/arm/exynos5250-chromebook-snow.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/exynos5250-chromebook-snow.dts Fri May 30 06:37:06 2014 (r266871) +++ head/sys/boot/fdt/dts/arm/exynos5250-chromebook-snow.dts Fri May 30 06:45:50 2014 (r266872) @@ -59,9 +59,10 @@ }; keyboard-controller { - compatible = "google,cros-ec-keyb"; - keypad,num-rows = <8>; - keypad,num-columns = <13>; + compatible = "google,mkbp-keyb"; + google,key-rows = <8>; + google,key-columns = <13>; + freebsd,intr-gpio = <146>; }; }; Modified: head/sys/boot/fdt/dts/arm/exynos5250-chromebook-spring.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/exynos5250-chromebook-spring.dts Fri May 30 06:37:06 2014 (r266871) +++ head/sys/boot/fdt/dts/arm/exynos5250-chromebook-spring.dts Fri May 30 06:45:50 2014 (r266872) @@ -59,9 +59,10 @@ }; keyboard-controller { - compatible = "google,cros-ec-keyb"; - keypad,num-rows = <8>; - keypad,num-columns = <13>; + compatible = "google,mkbp-keyb"; + google,key-rows = <8>; + google,key-columns = <13>; + freebsd,intr-gpio = <146>; }; }; From owner-svn-src-head@FreeBSD.ORG Fri May 30 07:30:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BACF0555; Fri, 30 May 2014 07:30:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7C2828F7; Fri, 30 May 2014 07:30:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4U7UPLU001007; Fri, 30 May 2014 07:30:25 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4U7UP2T001005; Fri, 30 May 2014 07:30:25 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405300730.s4U7UP2T001005@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 30 May 2014 07:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266873 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 07:30:25 -0000 Author: hselasky Date: Fri May 30 07:30:24 2014 New Revision: 266873 URL: http://svnweb.freebsd.org/changeset/base/266873 Log: Add support for basic read, write and read capacity disk operations to the USB mass storage test utility file. Sponsored by: DARPA, AFRL Modified: head/sys/dev/usb/usb_msctest.c head/sys/dev/usb/usb_msctest.h Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Fri May 30 06:45:50 2014 (r266872) +++ head/sys/dev/usb/usb_msctest.c Fri May 30 07:30:24 2014 (r266873) @@ -87,9 +87,10 @@ enum { DIR_NONE, }; -#define SCSI_MAX_LEN MAX(0x100, BULK_SIZE) +#define SCSI_MAX_LEN MAX(SCSI_FIXED_BLOCK_SIZE, USB_MSCTEST_BULK_SIZE) #define SCSI_INQ_LEN 0x24 #define SCSI_SENSE_LEN 0xFF +#define SCSI_FIXED_BLOCK_SIZE 512 /* bytes */ static uint8_t scsi_test_unit_ready[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static uint8_t scsi_inquiry[] = { 0x12, 0x00, 0x00, 0x00, SCSI_INQ_LEN, 0x00 }; @@ -110,7 +111,10 @@ static uint8_t scsi_request_sense[] = { static uint8_t scsi_read_capacity[] = { 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -#define BULK_SIZE 64 /* dummy */ +#ifndef USB_MSCTEST_BULK_SIZE +#define USB_MSCTEST_BULK_SIZE 64 /* dummy */ +#endif + #define ERR_CSW_FAILED -1 /* Command Block Wrapper */ @@ -851,3 +855,101 @@ usb_msc_eject(struct usb_device *udev, u bbb_detach(sc); return (0); } + +usb_error_t +usb_msc_read_10(struct usb_device *udev, uint8_t iface_index, + uint32_t lba, uint32_t blocks, void *buffer) +{ + struct bbb_transfer *sc; + uint8_t cmd[10]; + usb_error_t err; + + cmd[0] = 0x28; /* READ_10 */ + cmd[1] = 0; + cmd[2] = lba >> 24; + cmd[3] = lba >> 16; + cmd[4] = lba >> 8; + cmd[5] = lba >> 0; + cmd[6] = 0; + cmd[7] = blocks >> 8; + cmd[8] = blocks; + cmd[9] = 0; + + sc = bbb_attach(udev, iface_index); + if (sc == NULL) + return (USB_ERR_INVAL); + + err = bbb_command_start(sc, DIR_IN, 0, buffer, + blocks * SCSI_FIXED_BLOCK_SIZE, cmd, 10, USB_MS_HZ); + + bbb_detach(sc); + + return (err); +} + +usb_error_t +usb_msc_write_10(struct usb_device *udev, uint8_t iface_index, + uint32_t lba, uint32_t blocks, void *buffer) +{ + struct bbb_transfer *sc; + uint8_t cmd[10]; + usb_error_t err; + + cmd[0] = 0x2a; /* WRITE_10 */ + cmd[1] = 0; + cmd[2] = lba >> 24; + cmd[3] = lba >> 16; + cmd[4] = lba >> 8; + cmd[5] = lba >> 0; + cmd[6] = 0; + cmd[7] = blocks >> 8; + cmd[8] = blocks; + cmd[9] = 0; + + sc = bbb_attach(udev, iface_index); + if (sc == NULL) + return (USB_ERR_INVAL); + + err = bbb_command_start(sc, DIR_OUT, 0, buffer, + blocks * SCSI_FIXED_BLOCK_SIZE, cmd, 10, USB_MS_HZ); + + bbb_detach(sc); + + return (err); +} + +usb_error_t +usb_msc_read_capacity(struct usb_device *udev, uint8_t iface_index, + uint32_t *lba_last, uint32_t *block_size) +{ + struct bbb_transfer *sc; + usb_error_t err; + + sc = bbb_attach(udev, iface_index); + if (sc == NULL) + return (USB_ERR_INVAL); + + err = bbb_command_start(sc, DIR_IN, 0, sc->buffer, 8, + &scsi_read_capacity, sizeof(scsi_read_capacity), + USB_MS_HZ); + + *lba_last = + (sc->buffer[0] << 24) | + (sc->buffer[1] << 16) | + (sc->buffer[2] << 8) | + (sc->buffer[3]); + + *block_size = + (sc->buffer[4] << 24) | + (sc->buffer[5] << 16) | + (sc->buffer[6] << 8) | + (sc->buffer[7]); + + /* we currently only support one block size */ + if (*block_size != SCSI_FIXED_BLOCK_SIZE) + err = USB_ERR_INVAL; + + bbb_detach(sc); + + return (err); +} Modified: head/sys/dev/usb/usb_msctest.h ============================================================================== --- head/sys/dev/usb/usb_msctest.h Fri May 30 06:45:50 2014 (r266872) +++ head/sys/dev/usb/usb_msctest.h Fri May 30 07:30:24 2014 (r266873) @@ -42,5 +42,14 @@ usb_error_t usb_msc_eject(struct usb_dev uint8_t iface_index, int method); usb_error_t usb_msc_auto_quirk(struct usb_device *udev, uint8_t iface_index); +usb_error_t usb_msc_read_10(struct usb_device *udev, + uint8_t iface_index, uint32_t lba, uint32_t blocks, + void *buffer); +usb_error_t usb_msc_write_10(struct usb_device *udev, + uint8_t iface_index, uint32_t lba, uint32_t blocks, + void *buffer); +usb_error_t usb_msc_read_capacity(struct usb_device *udev, + uint8_t iface_index, uint32_t *lba_last, + uint32_t *block_size); #endif /* _USB_MSCTEST_H_ */ From owner-svn-src-head@FreeBSD.ORG Fri May 30 07:43:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FEE08CB; Fri, 30 May 2014 07:43:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D2A72A05; Fri, 30 May 2014 07:43:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4U7hugO008804; Fri, 30 May 2014 07:43:56 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4U7huQs008803; Fri, 30 May 2014 07:43:56 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201405300743.s4U7huQs008803@svn.freebsd.org> From: Ruslan Bukin Date: Fri, 30 May 2014 07:43:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266874 - head/sys/arm/samsung/exynos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 07:43:56 -0000 Author: br Date: Fri May 30 07:43:55 2014 New Revision: 266874 URL: http://svnweb.freebsd.org/changeset/base/266874 Log: Fix off-by-one error that makes 0-th pins of each bank unreachable. Submitted by: Maxim Ignatenko Modified: head/sys/arm/samsung/exynos/exynos5_pad.c Modified: head/sys/arm/samsung/exynos/exynos5_pad.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_pad.c Fri May 30 07:30:24 2014 (r266873) +++ head/sys/arm/samsung/exynos/exynos5_pad.c Fri May 30 07:43:55 2014 (r266874) @@ -223,7 +223,7 @@ get_bank(int gpio_number, struct gpio_ba for (i = 0; i < NGRP; i++) { ngpio = gpio_map[i].ngpio; - if ((n + ngpio) >= gpio_number) { + if ((n + ngpio) > gpio_number) { *bank = gpio_map[i]; *pin_shift = (gpio_number - n); return (0); From owner-svn-src-head@FreeBSD.ORG Fri May 30 07:48:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6161AB61; Fri, 30 May 2014 07:48:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 345C72A31; Fri, 30 May 2014 07:48:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4U7muDd009658; Fri, 30 May 2014 07:48:56 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4U7mt0o009656; Fri, 30 May 2014 07:48:55 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201405300748.s4U7mt0o009656@svn.freebsd.org> From: Ruslan Bukin Date: Fri, 30 May 2014 07:48:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266875 - in head/sys: arm/samsung/exynos boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 07:48:56 -0000 Author: br Date: Fri May 30 07:48:55 2014 New Revision: 266875 URL: http://svnweb.freebsd.org/changeset/base/266875 Log: Reset HSIC hub during EHCI initialization. This makes devices connected to external USB ports available to the system. Submitted by: Maxim Ignatenko Modified: head/sys/arm/samsung/exynos/exynos5_ehci.c head/sys/boot/fdt/dts/arm/exynos5250-chromebook-spring.dts Modified: head/sys/arm/samsung/exynos/exynos5_ehci.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_ehci.c Fri May 30 07:43:55 2014 (r266874) +++ head/sys/arm/samsung/exynos/exynos5_ehci.c Fri May 30 07:48:55 2014 (r266875) @@ -180,9 +180,43 @@ gpio_ctrl(struct exynos_ehci_softc *esc, } static int +reset_hsic_hub(struct exynos_ehci_softc *esc, phandle_t hub) +{ + device_t gpio_dev; + pcell_t pin; + + /* TODO(imax): check that hub is compatible with "smsc,usb3503" */ + if (!OF_hasprop(hub, "freebsd,reset-gpio")) { + device_printf(esc->dev, + "cannot detect reset GPIO pin for HSIC hub\n"); + return (1); + } + + if (OF_getencprop(hub, "freebsd,reset-gpio", &pin, sizeof(pin)) < 0) { + device_printf(esc->dev, + "failed to decode reset GPIO pin number for HSIC hub\n"); + return (1); + } + + /* Get the GPIO device, we need this to give power to USB */ + gpio_dev = devclass_get_device(devclass_find("gpio"), 0); + if (gpio_dev == NULL) { + device_printf(esc->dev, "cant find gpio_dev\n"); + return (1); + } + + GPIO_PIN_SET(gpio_dev, pin, GPIO_PIN_LOW); + DELAY(100); + GPIO_PIN_SET(gpio_dev, pin, GPIO_PIN_HIGH); + + return (0); +} + +static int phy_init(struct exynos_ehci_softc *esc) { int reg; + phandle_t hub; gpio_ctrl(esc, GPIO_INPUT, 1); @@ -212,6 +246,10 @@ phy_init(struct exynos_ehci_softc *esc) reg &= ~(HOST_CTRL_RESET_LINK); bus_space_write_4(esc->host_bst, esc->host_bsh, 0x0, reg); + if ((hub = OF_finddevice("/hsichub")) != 0) { + reset_hsic_hub(esc, hub); + } + gpio_ctrl(esc, GPIO_OUTPUT, 1); return (0); Modified: head/sys/boot/fdt/dts/arm/exynos5250-chromebook-spring.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/exynos5250-chromebook-spring.dts Fri May 30 07:43:55 2014 (r266874) +++ head/sys/boot/fdt/dts/arm/exynos5250-chromebook-spring.dts Fri May 30 07:48:55 2014 (r266875) @@ -70,4 +70,9 @@ stdin = &serial2; stdout = &serial2; }; + + hsichub@13400000 { + compatible = "smsc,usb3503"; + freebsd,reset-gpio = <172>; + }; }; From owner-svn-src-head@FreeBSD.ORG Fri May 30 07:56:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7064D19; Fri, 30 May 2014 07:56:47 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id 9B0F52ADF; Fri, 30 May 2014 07:56:47 +0000 (UTC) Received: from bender.Home (97e07ba1.skybroadband.com [151.224.123.161]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 1F9415DEC1; Fri, 30 May 2014 07:56:38 +0000 (UTC) Date: Fri, 30 May 2014 08:56:29 +0100 From: Andrew Turner To: Ganbold Tsagaankhuu Subject: Re: svn commit: r266871 - in head/sys: arm/conf boot/fdt/dts/arm Message-ID: <20140530085629.28e3c568@bender.Home> In-Reply-To: <201405300637.s4U6b7i4078058@svn.freebsd.org> References: <201405300637.s4U6b7i4078058@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 07:56:47 -0000 On Fri, 30 May 2014 06:37:07 +0000 (UTC) Ganbold Tsagaankhuu wrote: > Author: ganbold > Date: Fri May 30 06:37:06 2014 > New Revision: 266871 > URL: http://svnweb.freebsd.org/changeset/base/266871 > > Log: > Add common kernel config file for Rockchip RK3188 systems by > splitting current RADXA config. Radxa Rock (RR) boards have few types > such as RR (full version), RR Lite and some variants of RR > engineering samples. Add kernel config and FDT file for RR Lite board. > > Approved by: stas (mentor) > > Added: > head/sys/arm/conf/RADXA-LITE (contents, props changed) > head/sys/arm/conf/RK3188 (contents, props changed) > head/sys/boot/fdt/dts/arm/rk3188-radxa-lite.dts (contents, props > changed) Modified: > head/sys/arm/conf/RADXA You should add "#NO_UNIVERSE" to the RADXA and RADXA-LITE configs. As they don't add any new devices or options other than the dts to compile there is no need to add them to the universe build. Andrew From owner-svn-src-head@FreeBSD.ORG Fri May 30 08:12:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 316122D5; Fri, 30 May 2014 08:12:03 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AACEE2C3D; Fri, 30 May 2014 08:12:02 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s4U8Br5u095793 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 30 May 2014 12:11:53 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s4U8BrHE095792; Fri, 30 May 2014 12:11:53 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 30 May 2014 12:11:53 +0400 From: Gleb Smirnoff To: Alan Somers Subject: Re: svn commit: r266860 - in head: sys/net sys/netinet sys/netinet6 tests/sys/netinet Message-ID: <20140530081153.GY50679@FreeBSD.org> References: <201405292103.s4TL3ovP019075@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201405292103.s4TL3ovP019075@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 08:12:03 -0000 On Thu, May 29, 2014 at 09:03:50PM +0000, Alan Somers wrote: A> Author: asomers A> Date: Thu May 29 21:03:49 2014 A> New Revision: 266860 A> URL: http://svnweb.freebsd.org/changeset/base/266860 A> A> Log: A> Fix unintended KBI change from r264905. Add _fib versions of A> ifa_ifwithnet() and ifa_ifwithdstaddr() The legacy functions will call the A> _fib() versions with RT_ALL_FIBS, preserving legacy behavior. Is this intended for MFC? If not, then I'd say that API bloat hurts more than KBI change in head/. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri May 30 08:22:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23D9C4A6; Fri, 30 May 2014 08:22:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0456D2CF1; Fri, 30 May 2014 08:22:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4U8Mwr0027125; Fri, 30 May 2014 08:22:58 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4U8Mw32027124; Fri, 30 May 2014 08:22:58 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201405300822.s4U8Mw32027124@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 30 May 2014 08:22:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266876 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 08:22:59 -0000 Author: glebius Date: Fri May 30 08:22:58 2014 New Revision: 266876 URL: http://svnweb.freebsd.org/changeset/base/266876 Log: Whitespace only. Modified: head/sys/kern/uipc_mbuf.c Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Fri May 30 07:48:55 2014 (r266875) +++ head/sys/kern/uipc_mbuf.c Fri May 30 08:22:58 2014 (r266876) @@ -288,7 +288,7 @@ void mb_free_ext(struct mbuf *m) { int skipmbuf; - + KASSERT((m->m_flags & M_EXT) == M_EXT, ("%s: M_EXT not set", __func__)); KASSERT(m->m_ext.ref_cnt != NULL, ("%s: ref_cnt not set", __func__)); @@ -339,7 +339,7 @@ mb_free_ext(struct mbuf *m) } if (skipmbuf) return; - + /* * Free this mbuf back to the mbuf zone with all m_ext * information purged. @@ -425,7 +425,7 @@ m_sanity(struct mbuf *m0, int sanitize) #ifdef INVARIANTS #define M_SANITY_ACTION(s) panic("mbuf %p: " s, m) -#else +#else #define M_SANITY_ACTION(s) printf("mbuf %p: " s, m) #endif @@ -583,7 +583,7 @@ m_prepend(struct mbuf *m, int len, int h if (len < MHLEN) MH_ALIGN(m, len); } else { - if (len < MLEN) + if (len < MLEN) M_ALIGN(m, len); } m->m_len = len; @@ -621,7 +621,7 @@ m_copym(struct mbuf *m, int off0, int le top = 0; while (len > 0) { if (m == NULL) { - KASSERT(len == M_COPYALL, + KASSERT(len == M_COPYALL, ("m_copym, length > size of mbuf chain")); break; } @@ -756,9 +756,9 @@ m_copymdata(struct mbuf *m, struct mbuf if (!(mm->m_flags & M_EXT)) return NULL; bcopy(&buf, (caddr_t *)mm->m_ext.ext_buf + - mm->m_ext.ext_size - mm->m_len, mm->m_len); + mm->m_ext.ext_size - mm->m_len, mm->m_len); mm->m_data = (caddr_t)mm->m_ext.ext_buf + - mm->m_ext.ext_size - mm->m_len; + mm->m_ext.ext_size - mm->m_len; } /* Append/prepend as many mbuf (clusters) as necessary to fit len. */ @@ -772,7 +772,7 @@ m_copymdata(struct mbuf *m, struct mbuf i = 0; for (x = z; x != NULL; x = x->m_next) { i += x->m_flags & M_EXT ? x->m_ext.ext_size : - (x->m_flags & M_PKTHDR ? MHLEN : MLEN); + (x->m_flags & M_PKTHDR ? MHLEN : MLEN); if (!x->m_next) break; } @@ -1569,7 +1569,7 @@ m_defrag(struct mbuf *m0, int how) goto nospace; } #endif - + if (m0->m_pkthdr.len > MHLEN) m_final = m_getcl(how, MT_DATA, M_PKTHDR); else @@ -1735,7 +1735,7 @@ m_fragment(struct mbuf *m0, int how, int if (!(m0->m_flags & M_PKTHDR)) return (m0); - + if ((length == 0) || (length < -2)) return (m0); @@ -1938,7 +1938,7 @@ m_unshare(struct mbuf *m0, int how) m->m_len <= M_TRAILINGSPACE(mprev)) { /* XXX: this ignores mbuf types */ memcpy(mtod(mprev, caddr_t) + mprev->m_len, - mtod(m, caddr_t), m->m_len); + mtod(m, caddr_t), m->m_len); mprev->m_len += m->m_len; mprev->m_next = m->m_next; /* unlink from chain */ m_free(m); /* reclaim mbuf */ @@ -1970,7 +1970,7 @@ m_unshare(struct mbuf *m0, int how) m->m_len <= M_TRAILINGSPACE(mprev)) { /* XXX: this ignores mbuf types */ memcpy(mtod(mprev, caddr_t) + mprev->m_len, - mtod(m, caddr_t), m->m_len); + mtod(m, caddr_t), m->m_len); mprev->m_len += m->m_len; mprev->m_next = m->m_next; /* unlink from chain */ m_free(m); /* reclaim mbuf */ @@ -2003,7 +2003,7 @@ m_unshare(struct mbuf *m0, int how) n->m_len = cc; if (mlast != NULL) mlast->m_next = n; - mlast = n; + mlast = n; #if 0 newipsecstat.ips_clcopied++; #endif @@ -2020,7 +2020,7 @@ m_unshare(struct mbuf *m0, int how) return (NULL); } } - n->m_next = m->m_next; + n->m_next = m->m_next; if (mprev == NULL) m0 = mfirst; /* new head of chain */ else @@ -2056,7 +2056,7 @@ m_profile(struct mbuf *m) int segments = 0; int used = 0; int wasted = 0; - + while (m) { segments++; used += m->m_len; @@ -2091,11 +2091,10 @@ mbprof_textify(void) int offset; char *c; uint64_t *p; - p = &mbprof.wasted[0]; c = mbprofbuf; - offset = snprintf(c, MP_MAXLINE + 10, + offset = snprintf(c, MP_MAXLINE + 10, "wasted:\n" "%ju %ju %ju %ju %ju %ju %ju %ju " "%ju %ju %ju %ju %ju %ju %ju %ju\n", @@ -2104,7 +2103,7 @@ mbprof_textify(void) #ifdef BIG_ARRAY p = &mbprof.wasted[16]; c += offset; - offset = snprintf(c, MP_MAXLINE, + offset = snprintf(c, MP_MAXLINE, "%ju %ju %ju %ju %ju %ju %ju %ju " "%ju %ju %ju %ju %ju %ju %ju %ju\n", p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], @@ -2112,7 +2111,7 @@ mbprof_textify(void) #endif p = &mbprof.used[0]; c += offset; - offset = snprintf(c, MP_MAXLINE + 10, + offset = snprintf(c, MP_MAXLINE + 10, "used:\n" "%ju %ju %ju %ju %ju %ju %ju %ju " "%ju %ju %ju %ju %ju %ju %ju %ju\n", @@ -2121,7 +2120,7 @@ mbprof_textify(void) #ifdef BIG_ARRAY p = &mbprof.used[16]; c += offset; - offset = snprintf(c, MP_MAXLINE, + offset = snprintf(c, MP_MAXLINE, "%ju %ju %ju %ju %ju %ju %ju %ju " "%ju %ju %ju %ju %ju %ju %ju %ju\n", p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], @@ -2129,7 +2128,7 @@ mbprof_textify(void) #endif p = &mbprof.segments[0]; c += offset; - offset = snprintf(c, MP_MAXLINE + 10, + offset = snprintf(c, MP_MAXLINE + 10, "segments:\n" "%ju %ju %ju %ju %ju %ju %ju %ju " "%ju %ju %ju %ju %ju %ju %ju %ju\n", @@ -2138,7 +2137,7 @@ mbprof_textify(void) #ifdef BIG_ARRAY p = &mbprof.segments[16]; c += offset; - offset = snprintf(c, MP_MAXLINE, + offset = snprintf(c, MP_MAXLINE, "%ju %ju %ju %ju %ju %ju %ju %ju " "%ju %ju %ju %ju %ju %ju %ju %jju", p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], @@ -2160,16 +2159,16 @@ static int mbprof_clr_handler(SYSCTL_HANDLER_ARGS) { int clear, error; - + clear = 0; error = sysctl_handle_int(oidp, &clear, 0, req); if (error || !req->newptr) return (error); - + if (clear) { bzero(&mbprof, sizeof(mbprof)); } - + return (error); } From owner-svn-src-head@FreeBSD.ORG Fri May 30 08:42:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7909FB30; Fri, 30 May 2014 08:42:24 +0000 (UTC) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 376A02EBB; Fri, 30 May 2014 08:42:24 +0000 (UTC) Received: from [192.168.1.200] (p508F3F42.dip0.t-ipconnect.de [80.143.63.66]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id 67DDB1C104DBB; Fri, 30 May 2014 10:42:19 +0200 (CEST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266083 - in head/sys/arm: arm include From: Michael Tuexen In-Reply-To: Date: Fri, 30 May 2014 10:42:18 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <9B438991-C970-46A7-8116-A490E02D7139@fh-muenster.de> References: <201405141911.s4EJBFZZ097826@svn.freebsd.org> <537D0952.2040001@selasky.org> <7610C8E6-3F01-4317-BC1A-67645A162CD7@FreeBSD.org> <53871493.2010502@selasky.org> <9412A358-EBCB-4A5A-B728-2A15C50FC217@fh-muenster.de> To: Mark R V Murray X-Mailer: Apple Mail (2.1878.2) Cc: Hans Petter Selasky , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 08:42:24 -0000 On 29 May 2014, at 21:21, Mark R V Murray wrote: >=20 > On 29 May 2014, at 19:27, Michael Tuexen = wrote: >=20 >> On 29 May 2014, at 20:15, Mark R V Murray wrote: >>=20 >>>=20 >>> On 29 May 2014, at 19:13, Michael Tuexen = wrote: >>>=20 >>>>> I can make it work on RPI, but trying to find what else it = will/won=92t work on is more problematic. >>>> Wouldn't it require to use different registers on the RPI? This = would mean you >>>> would need more #ifdefs=85 >>>=20 >>> Thats the problem; too many #ifdefs. >> So you could just keep the code for now, but reduce the #ifdefs to = the ones you >> know that work. Later on, you can replace it by the driver stuff=85 >=20 > That=92s what I was thinking, yes. Great. Let me know if you need testing support on the RPI... Best regards Michael >=20 > M > --=20 > Mark R V Murray >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Fri May 30 09:35:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F68BC58; Fri, 30 May 2014 09:35:12 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 4D8691DD2; Fri, 30 May 2014 09:35:11 +0000 (UTC) Message-ID: <538850B3.80806@FreeBSD.org> Date: Fri, 30 May 2014 13:34:43 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Hiroki Sato , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r266857 - head/sys/netinet6 References: <201405292053.s4TKrrcd014205@svn.freebsd.org> In-Reply-To: <201405292053.s4TKrrcd014205@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 09:35:12 -0000 On 30.05.2014 00:53, Hiroki Sato wrote: > Author: hrs > Date: Thu May 29 20:53:53 2014 > New Revision: 266857 > URL: http://svnweb.freebsd.org/changeset/base/266857 > > Log: > Add rwlock to struct dadq. A panic could occur when a large number of > addresses performed DAD at the same time. Hello, do you have a backtraces from these panics published somewhere? -- WBR, Andrey V. Elsukov From owner-svn-src-head@FreeBSD.ORG Fri May 30 09:43:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 349541AD; Fri, 30 May 2014 09:43:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22251238B; Fri, 30 May 2014 09:43:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4U9hXiS063565; Fri, 30 May 2014 09:43:33 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4U9hWFt063563; Fri, 30 May 2014 09:43:32 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405300943.s4U9hWFt063563@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 30 May 2014 09:43:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266878 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 09:43:33 -0000 Author: hselasky Date: Fri May 30 09:43:32 2014 New Revision: 266878 URL: http://svnweb.freebsd.org/changeset/base/266878 Log: Add support for snprintf() to libstand. Reviewed by: brooks @ Sponsored by: DARPA, AFRL Modified: head/lib/libstand/printf.c head/lib/libstand/stand.h Modified: head/lib/libstand/printf.c ============================================================================== --- head/lib/libstand/printf.c Fri May 30 09:39:59 2014 (r266877) +++ head/lib/libstand/printf.c Fri May 30 09:43:32 2014 (r266878) @@ -56,8 +56,16 @@ __FBSDID("$FreeBSD$"); #define MAXNBUF (sizeof(intmax_t) * CHAR_BIT + 1) +typedef void (kvprintf_fn_t)(int, void *); + static char *ksprintn (char *buf, uintmax_t num, int base, int *len, int upper); -static int kvprintf(char const *fmt, void (*func)(int), void *arg, int radix, va_list ap); +static int kvprintf(char const *fmt, kvprintf_fn_t *func, void *arg, int radix, va_list ap); + +static void +putchar_wrapper(int cc, void *arg) +{ + putchar(cc); +} int printf(const char *fmt, ...) @@ -66,7 +74,7 @@ printf(const char *fmt, ...) int retval; va_start(ap, fmt); - retval = kvprintf(fmt, putchar, NULL, 10, ap); + retval = kvprintf(fmt, putchar_wrapper, NULL, 10, ap); va_end(ap); return retval; } @@ -74,8 +82,7 @@ printf(const char *fmt, ...) void vprintf(const char *fmt, va_list ap) { - - kvprintf(fmt, putchar, NULL, 10, ap); + kvprintf(fmt, putchar_wrapper, NULL, 10, ap); } int @@ -91,6 +98,46 @@ sprintf(char *buf, const char *cfmt, ... return retval; } +struct print_buf { + char *buf; + size_t size; +}; + +static void +snprint_func(int ch, void *arg) +{ + struct print_buf *pbuf = arg; + + if (pbuf->size < 2) { + /* + * Reserve last buffer position for the terminating + * character: + */ + return; + } + *(pbuf->buf)++ = ch; + pbuf->size--; +} + +int +snprintf(char *buf, size_t size, const char *cfmt, ...) +{ + int retval; + va_list ap; + struct print_buf arg; + + arg.buf = buf; + arg.size = size; + + va_start(ap, cfmt); + retval = kvprintf(cfmt, &snprint_func, &arg, 10, ap); + va_end(ap); + + if (arg.size >= 1) + *(arg.buf)++ = 0; + return retval; +} + void vsprintf(char *buf, const char *cfmt, va_list ap) { @@ -149,9 +196,9 @@ ksprintn(char *nbuf, uintmax_t num, int * ("%*D", len, ptr, " " -> XX XX XX XX ... */ static int -kvprintf(char const *fmt, void (*func)(int), void *arg, int radix, va_list ap) +kvprintf(char const *fmt, kvprintf_fn_t *func, void *arg, int radix, va_list ap) { -#define PCHAR(c) {int cc=(c); if (func) (*func)(cc); else *d++ = cc; retval++; } +#define PCHAR(c) {int cc=(c); if (func) (*func)(cc, arg); else *d++ = cc; retval++; } char nbuf[MAXNBUF]; char *d; const char *p, *percent, *q; Modified: head/lib/libstand/stand.h ============================================================================== --- head/lib/libstand/stand.h Fri May 30 09:39:59 2014 (r266877) +++ head/lib/libstand/stand.h Fri May 30 09:43:32 2014 (r266878) @@ -238,6 +238,7 @@ extern void mallocstats(void); extern int printf(const char *fmt, ...) __printflike(1, 2); extern void vprintf(const char *fmt, __va_list); extern int sprintf(char *buf, const char *cfmt, ...) __printflike(2, 3); +extern int snprintf(char *buf, size_t size, const char *cfmt, ...) __printflike(3, 4); extern void vsprintf(char *buf, const char *cfmt, __va_list); extern void twiddle(void); From owner-svn-src-head@FreeBSD.ORG Fri May 30 10:18:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1833EE5A; Fri, 30 May 2014 10:18:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05C582625; Fri, 30 May 2014 10:18:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UAI1EX078339; Fri, 30 May 2014 10:18:01 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UAI16G078338; Fri, 30 May 2014 10:18:01 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405301018.s4UAI16G078338@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 30 May 2014 10:18:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266879 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 10:18:02 -0000 Author: hselasky Date: Fri May 30 10:18:01 2014 New Revision: 266879 URL: http://svnweb.freebsd.org/changeset/base/266879 Log: style(9) requires an empty line when function have no local variables. Suggested by: ae @ Sponsored by: DARPA, AFRL Modified: head/lib/libstand/printf.c Modified: head/lib/libstand/printf.c ============================================================================== --- head/lib/libstand/printf.c Fri May 30 09:43:32 2014 (r266878) +++ head/lib/libstand/printf.c Fri May 30 10:18:01 2014 (r266879) @@ -64,6 +64,7 @@ static int kvprintf(char const *fmt, kvp static void putchar_wrapper(int cc, void *arg) { + putchar(cc); } @@ -82,6 +83,7 @@ printf(const char *fmt, ...) void vprintf(const char *fmt, va_list ap) { + kvprintf(fmt, putchar_wrapper, NULL, 10, ap); } From owner-svn-src-head@FreeBSD.ORG Fri May 30 10:35:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7863C12B; Fri, 30 May 2014 10:35:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65B972777; Fri, 30 May 2014 10:35:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UAZqTp086733; Fri, 30 May 2014 10:35:52 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UAZpeV086730; Fri, 30 May 2014 10:35:51 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201405301035.s4UAZpeV086730@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 30 May 2014 10:35:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266880 - head/sys/geom/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 10:35:52 -0000 Author: ae Date: Fri May 30 10:35:51 2014 New Revision: 266880 URL: http://svnweb.freebsd.org/changeset/base/266880 Log: Use g_conf_printf_escaped() to escape symbols, which can break an XML tree. MFC after: 1 week Modified: head/sys/geom/part/g_part_apm.c head/sys/geom/part/g_part_gpt.c head/sys/geom/part/g_part_pc98.c Modified: head/sys/geom/part/g_part_apm.c ============================================================================== --- head/sys/geom/part/g_part_apm.c Fri May 30 10:18:01 2014 (r266879) +++ head/sys/geom/part/g_part_apm.c Fri May 30 10:35:51 2014 (r266880) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "g_part_if.h" @@ -310,10 +311,14 @@ g_part_apm_dumpconf(struct g_part_table /* confxml: partition entry information */ strncpy(u.name, entry->ent.ent_name, APM_ENT_NAMELEN); u.name[APM_ENT_NAMELEN] = '\0'; - sbuf_printf(sb, "%s\n", indent, u.name); + sbuf_printf(sb, "%s\n"); strncpy(u.type, entry->ent.ent_type, APM_ENT_TYPELEN); u.type[APM_ENT_TYPELEN] = '\0'; - sbuf_printf(sb, "%s%s\n", indent, u.type); + sbuf_printf(sb, "%s", indent); + g_conf_printf_escaped(sb, "%s", u.type); + sbuf_printf(sb, "\n"); } else { /* confxml: scheme information */ } Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Fri May 30 10:18:01 2014 (r266879) +++ head/sys/geom/part/g_part_gpt.c Fri May 30 10:35:51 2014 (r266880) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "g_part_if.h" @@ -1253,16 +1254,16 @@ g_gpt_printf_utf16(struct sbuf *sb, uint /* Write the Unicode character in UTF-8 */ if (ch < 0x80) - sbuf_printf(sb, "%c", ch); + g_conf_printf_escaped(sb, "%c", ch); else if (ch < 0x800) - sbuf_printf(sb, "%c%c", 0xc0 | (ch >> 6), + g_conf_printf_escaped(sb, "%c%c", 0xc0 | (ch >> 6), 0x80 | (ch & 0x3f)); else if (ch < 0x10000) - sbuf_printf(sb, "%c%c%c", 0xe0 | (ch >> 12), + g_conf_printf_escaped(sb, "%c%c%c", 0xe0 | (ch >> 12), 0x80 | ((ch >> 6) & 0x3f), 0x80 | (ch & 0x3f)); else if (ch < 0x200000) - sbuf_printf(sb, "%c%c%c%c", 0xf0 | (ch >> 18), - 0x80 | ((ch >> 12) & 0x3f), + g_conf_printf_escaped(sb, "%c%c%c%c", 0xf0 | + (ch >> 18), 0x80 | ((ch >> 12) & 0x3f), 0x80 | ((ch >> 6) & 0x3f), 0x80 | (ch & 0x3f)); } } Modified: head/sys/geom/part/g_part_pc98.c ============================================================================== --- head/sys/geom/part/g_part_pc98.c Fri May 30 10:18:01 2014 (r266879) +++ head/sys/geom/part/g_part_pc98.c Fri May 30 10:35:51 2014 (r266880) @@ -300,7 +300,9 @@ g_part_pc98_dumpconf(struct g_part_table sbuf_printf(sb, " xs PC98 xt %u sn %s", type, name); } else { /* confxml: partition entry information */ - sbuf_printf(sb, "%s\n", indent, name); + sbuf_printf(sb, "%s\n"); if (entry->ent.dp_mid & PC98_MID_BOOTABLE) sbuf_printf(sb, "%sbootable\n", indent); From owner-svn-src-head@FreeBSD.ORG Fri May 30 12:01:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9066642C for ; Fri, 30 May 2014 12:01:43 +0000 (UTC) Received: from nm36.bullet.mail.bf1.yahoo.com (nm36.bullet.mail.bf1.yahoo.com [72.30.239.5]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15E1D2ECB for ; Fri, 30 May 2014 12:01:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1401450948; bh=2DnZP6BU93rEP5IW9axqtjXuSTwboY+o801n1r8fgYA=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=Jf2TUi6bMmvUuQ3yf9Zjxws8oi8/rnrJ/khtM6lS+23SkdfmmZkYEaxCmLaVwosW6xKk8d6+2mDa4Opy0sBFq2rfJGRjywfOwveE/EwK1J4+iCUMO8YKtPr9VLsPv3YmFze1LfN/9nlKtjrwTVyabPZY8WJ7s+Ldle5vaN9Q8Mwn7w5lBTVT69J+TaUPt0BCLFOJtCboqvyd/u2g4Fl0cAmrkOnP4xcJ/M8AxbsqoE00227RjSeKlaRlolD/0gpvCpZPvzFdaql/L54ZXK5NItK0ZKA4cqzsvhd75oVD0UN1bAvWji51Cr35nGiuGVQVDKGc7vRf8xjLANmPpI19Vg== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=ccP6NcXAjZ/7Ezpzfgsm7LLllMv6yOJZq5gJAtmwMWvmbOy7JgxhHGrn4XZXmnvnyC4x9TMeoYTrFbIzn4G30aqzbVZazD+E1ZYNvFlh/e2fVOvJD9/lDCc+9wblgt8WI7y6tKHckf0RPiWy9lVyQyAjwmz0u/bWP1JIU5pzIA7AS+UnOGg2jUXXM6G0zv+ykf5OhxWH2VbV1FNc0wHR7u/7IVz6168QawMgrWdQE+I7qgubYUyBYffTAQJlni+pZFfTywDtK1bubfRQa3mmyV9CA/749zUbt24SfPVbR2N50kjHaTopEZxDvqQBXv7Oo0kslWrQzewWRCiiE2+39w==; Received: from [98.139.215.142] by nm36.bullet.mail.bf1.yahoo.com with NNFMP; 30 May 2014 11:55:48 -0000 Received: from [98.139.213.14] by tm13.bullet.mail.bf1.yahoo.com with NNFMP; 30 May 2014 11:55:48 -0000 Received: from [127.0.0.1] by smtp114.mail.bf1.yahoo.com with NNFMP; 30 May 2014 11:55:48 -0000 X-Yahoo-Newman-Id: 812183.22751.bm@smtp114.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: CYkQWWQVM1nW1Lib2vaHmXcVKl0aSBqfo.pYnX9m5XjjoCq eJJD3Em91SUpDigw.tKxr33G4Feu1G.hA2M565oA5mqLNP9WSY_fAxzjWQfl crrlrpDbL2mRqZeq0k32LaHnspG1NsDluNeBJgabxj6xWTGpallckzMCsNA_ sar1q0fFsospsMWxuuTLi6Zs1KYaowVepad9zQubkWuijZBTsPAk41BrUjaZ lBW3tN44ceQ6ZuCJZHtrKnzs.a14ZU5cc_qECV7A8nyNhl588BgVKGPyWNoo SWXfCzpVyKha1kfC1FQDjKaR1nb1HrcHk_unVQzesH2LaVyiA6_nxIkj2I5_ EK2dVmjeC0sNO1UDclCf6Sza73pRURSwDcZfqx9ICuI_Tpntxb7EdG6Qr55C yJm0kDphcd74khunyTECuP47cOM77_3P76WtuBNXi5azrcZmiDOjz9jyB8i6 AYzNUXC8qzSVKs9sBRJWA70SnxPIgSuQdvaHH.GyFwSuCX25PuZUac8Jph97 mAYGlZjm7narMlx.XMP4awmmvqKSSwJ_yh.BXbaItLpoBgusVbyr8zLMDq0L z_XyYW1pGrTbGW_LbB.EiKOCqvFE9r0UhubPfGsz5SkVZW547RQbghjyQdv1 RzbKL7MLPxEIkQgiA.Ug7w8_uN5DvCnMhZB3uaYbFAcrq X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.101] (pfg@190.157.126.109 with plain [98.139.211.125]) by smtp114.mail.bf1.yahoo.com with SMTP; 30 May 2014 04:55:48 -0700 PDT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266865 - in head: include include/xlocale lib/libc/string From: Pedro Giffuni In-Reply-To: <7AFBC7BD-9F6F-44AA-BBAE-B4A1B20E9B02@felyko.com> Date: Fri, 30 May 2014 06:55:46 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405300109.s4U197Ox028750@svn.freebsd.org> <7AFBC7BD-9F6F-44AA-BBAE-B4A1B20E9B02@felyko.com> To: Rui Paulo X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 12:01:43 -0000 Il giorno 30/mag/2014, alle ore 00:18, Rui Paulo ha = scritto: > On May 29, 2014, at 18:09, Pedro F. Giffuni wrote: >=20 >> Author: pfg >> Date: Fri May 30 01:09:07 2014 >> New Revision: 266865 >> URL: http://svnweb.freebsd.org/changeset/base/266865 >>=20 >> Log: >> Fix strcasecmp_l() and strncasecmp_l() POSIX 2008 compliance. >>=20 >> POSIX.1-2008 specifies that those two functions should be declared by >> including , not (the latter only has = strcoll_l() >> and strxfrm_l()): >>=20 >> = http://pubs.opengroup.org/onlinepubs/9699919799/functions/strcasecmp.html >=20 > Is this going to cause any ports fallout? >=20 I consider this a bug fix; I think ports should already be respecting = standards. Should I consider a FreeBSD_version bump JIC? Pedro. From owner-svn-src-head@FreeBSD.ORG Fri May 30 12:07:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8867760E; Fri, 30 May 2014 12:07:08 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 374CB2F13; Fri, 30 May 2014 12:07:07 +0000 (UTC) Received: from dhcp-172-17-155-98.eduroam.lapwing.private.cam.ac.uk (global-1-26.nat.csx.cam.ac.uk [131.111.184.26]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s4UC715J031475 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 30 May 2014 12:07:03 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r266865 - in head: include include/xlocale lib/libc/string From: David Chisnall In-Reply-To: <7AFBC7BD-9F6F-44AA-BBAE-B4A1B20E9B02@felyko.com> Date: Fri, 30 May 2014 13:06:56 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <16677001-62B2-4376-B968-FDBBBE8525A5@FreeBSD.org> References: <201405300109.s4U197Ox028750@svn.freebsd.org> <7AFBC7BD-9F6F-44AA-BBAE-B4A1B20E9B02@felyko.com> To: Rui Paulo X-Mailer: Apple Mail (2.1874) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Pedro F. Giffuni" , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 12:07:08 -0000 On 30 May 2014, at 06:18, Rui Paulo wrote: > Is this going to cause any ports fallout? It shouldn't do. Any code that compiles on OS X will expect these to be = in the correct place, and since DragonFly applied the fix first we'd = hopefully have found any fallout via dports. David From owner-svn-src-head@FreeBSD.ORG Fri May 30 13:10:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3919869; Fri, 30 May 2014 13:10:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4B6124C1; Fri, 30 May 2014 13:10:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UDAo07057014; Fri, 30 May 2014 13:10:50 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UDAoJv057009; Fri, 30 May 2014 13:10:50 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405301310.s4UDAoJv057009@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 30 May 2014 13:10:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266881 - head/sys/boot/usb/storage X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 13:10:51 -0000 Author: hselasky Date: Fri May 30 13:10:49 2014 New Revision: 266881 URL: http://svnweb.freebsd.org/changeset/base/266881 Log: Add support for USB mass storage to libusbboot. Sponsored by: DARPA, AFRL Added: head/sys/boot/usb/storage/ head/sys/boot/usb/storage/umass_common.c (contents, props changed) head/sys/boot/usb/storage/umass_common.h (contents, props changed) head/sys/boot/usb/storage/umass_loader.c (contents, props changed) Added: head/sys/boot/usb/storage/umass_common.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/usb/storage/umass_common.c Fri May 30 13:10:49 2014 (r266881) @@ -0,0 +1,87 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2014 Hans Petter Selasky + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include USB_GLOBAL_INCLUDE_FILE + +#include "umass_common.h" + +struct usb_attach_arg umass_uaa; + +static device_probe_t umass_probe; +static device_attach_t umass_attach; +static device_detach_t umass_detach; + +static devclass_t umass_devclass; + +static device_method_t umass_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, umass_probe), + DEVMETHOD(device_attach, umass_attach), + DEVMETHOD(device_detach, umass_detach), + + DEVMETHOD_END +}; + +static driver_t umass_driver = { + .name = "umass", + .methods = umass_methods, +}; + +DRIVER_MODULE(umass, uhub, umass_driver, umass_devclass, NULL, 0); + +static int +umass_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + + if (uaa->usb_mode != USB_MODE_HOST || + uaa->info.bInterfaceClass != UICLASS_MASS || + uaa->info.bInterfaceSubClass != UISUBCLASS_SCSI || + uaa->info.bInterfaceProtocol != UIPROTO_MASS_BBB || + device_get_unit(dev) != 0) + return (ENXIO); + return (0); +} + +static int +umass_attach(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + umass_uaa = *uaa; + return (0); /* success */ +} + +static int +umass_detach(device_t dev) +{ + memset(&umass_uaa, 0, sizeof(umass_uaa)); + return (0); +} Added: head/sys/boot/usb/storage/umass_common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/usb/storage/umass_common.h Fri May 30 13:10:49 2014 (r266881) @@ -0,0 +1,37 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2014 Hans Petter Selasky + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _UMASS_COMMON_H_ +#define _UMASS_COMMON_H_ + +extern struct usb_attach_arg umass_uaa; + +#endif /* _UMASS_COMMON_H_ */ Added: head/sys/boot/usb/storage/umass_loader.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/usb/storage/umass_loader.c Fri May 30 13:10:49 2014 (r266881) @@ -0,0 +1,197 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2014 Hans Petter Selasky + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +#include +#include + +#include +#include + +#define HAVE_STANDARD_DEFS + +#include USB_GLOBAL_INCLUDE_FILE + +#include "umass_common.h" + +static int umass_disk_init(void); +static int umass_disk_open(struct open_file *,...); +static int umass_disk_close(struct open_file *); +static void umass_disk_cleanup(void); +static int umass_disk_strategy(void *, int, daddr_t, size_t, char *, size_t *); +static void umass_disk_print(int); + +struct devsw umass_disk = { + .dv_name = "umass", + .dv_type = DEVT_DISK, + .dv_init = umass_disk_init, + .dv_strategy = umass_disk_strategy, + .dv_open = umass_disk_open, + .dv_close = umass_disk_close, + .dv_ioctl = noioctl, + .dv_print = umass_disk_print, + .dv_cleanup = umass_disk_cleanup, +}; + +static int +umass_disk_init(void) +{ + uint32_t time; + + usb_init(); + usb_needs_explore_all(); + + /* wait 8 seconds for a USB mass storage device to appear */ + for (time = 0; time < (8 * hz); time++) { + usb_idle(); + delay(1000000 / hz); + time++; + callout_process(1); + if (umass_uaa.device != NULL) + return (0); + } + return (0); +} + +static int +umass_disk_strategy(void *devdata, int flag, daddr_t dblk, size_t size, + char *buf, size_t *rsizep) +{ + if (umass_uaa.device == NULL) + return (ENXIO); + if (rsizep != NULL) + *rsizep = 0; + + if (flag == F_WRITE) { + if (usb_msc_write_10(umass_uaa.device, 0, dblk, size >> 9, buf) != 0) + return (EINVAL); + } else if (flag == F_READ) { + if (usb_msc_read_10(umass_uaa.device, 0, dblk, size >> 9, buf) != 0) + return (EINVAL); + } else { + return (EROFS); + } + + if (rsizep != NULL) + *rsizep = size; + return (0); +} + +static int +umass_disk_open_sub(struct disk_devdesc *dev) +{ + uint32_t nblock; + uint32_t blocksize; + + if (usb_msc_read_capacity(umass_uaa.device, 0, &nblock, &blocksize) != 0) + return (EINVAL); + + return (disk_open(dev, ((uint64_t)nblock + 1) * (uint64_t)blocksize, blocksize, 0)); +} + +static int +umass_disk_open(struct open_file *f,...) +{ + va_list ap; + struct disk_devdesc *dev; + + va_start(ap, f); + dev = va_arg(ap, struct disk_devdesc *); + va_end(ap); + + if (umass_uaa.device == NULL) + return (ENXIO); + if (dev->d_unit != 0) + return (EIO); + return (umass_disk_open_sub(dev)); +} + +static int +umass_disk_close(struct open_file *f) +{ + struct disk_devdesc *dev; + + dev = (struct disk_devdesc *)f->f_devdata; + return (disk_close(dev)); +} + +static void +umass_disk_print(int verbose) +{ + struct disk_devdesc dev; + + memset(&dev, 0, sizeof(dev)); + + pager_output(" umass0 UMASS device\n"); + dev.d_dev = &umass_disk; + dev.d_unit = 0; + dev.d_slice = -1; + dev.d_partition = -1; + + if (umass_disk_open_sub(&dev) == 0) { + disk_print(&dev, " umass0", verbose); + disk_close(&dev); + } +} + +static void +umass_disk_cleanup(void) +{ + disk_cleanup(&umass_disk); + + usb_uninit(); +} + + +/* USB specific functions */ + +extern void callout_process(int); +extern void usb_idle(void); +extern void usb_init(void); +extern void usb_uninit(void); + +void +DELAY(unsigned int usdelay) +{ + delay(usdelay); +} + +int +pause(const char *what, int timeout) +{ + if (timeout == 0) + timeout = 1; + + delay((1000000 / hz) * timeout); + + return (0); +} From owner-svn-src-head@FreeBSD.ORG Fri May 30 13:40:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E14AF66; Fri, 30 May 2014 13:40:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3184270A; Fri, 30 May 2014 13:39:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UDdxEE067672; Fri, 30 May 2014 13:39:59 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UDdxAb067664; Fri, 30 May 2014 13:39:59 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405301339.s4UDdxAb067664@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 30 May 2014 13:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266882 - head/sys/boot/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 13:40:00 -0000 Author: hselasky Date: Fri May 30 13:39:58 2014 New Revision: 266882 URL: http://svnweb.freebsd.org/changeset/base/266882 Log: USB boot library improvements: - Make the USB boot library more configurable. - Resolve compile issues when cross building. - Allow use of separate malloc. - Allow use of separate endian macros. Sponsored by: DARPA, AFRL Modified: head/sys/boot/usb/Makefile head/sys/boot/usb/bsd_kernel.c head/sys/boot/usb/bsd_kernel.h head/sys/boot/usb/usb_busdma_loader.c Modified: head/sys/boot/usb/Makefile ============================================================================== --- head/sys/boot/usb/Makefile Fri May 30 13:10:49 2014 (r266881) +++ head/sys/boot/usb/Makefile Fri May 30 13:39:58 2014 (r266882) @@ -30,6 +30,7 @@ S=${.CURDIR}/../.. .PATH: \ ${.CURDIR} \ + ${.CURDIR}/storage \ ${S}/dev/usb \ ${S}/dev/usb/controller \ ${S}/dev/usb/serial \ @@ -39,7 +40,7 @@ S=${.CURDIR}/../.. LIB= usbboot INTERNALLIB= OBJCOPY?= objcopy -SYSCC?= cc +SYSCC?= /usr/bin/cc CFLAGS+= -DBOOTPROG=\"usbloader\" CFLAGS+= -DUSB_GLOBAL_INCLUDE_FILE=\"bsd_global.h\" @@ -49,7 +50,13 @@ CFLAGS+= -Wformat -Wall CFLAGS+= -I${S} CFLAGS+= -I${T} CFLAGS+= -I${.CURDIR} +CFLAGS+= -I${.CURDIR}/../common CFLAGS+= -g +CFLAGS+= -DUSB_MSCTEST_BULK_SIZE=65536 +CFLAGS+= -DUSB_POOL_SIZE=262144 +CFLAGS+= -fno-pic +CFLAGS+= -DHAVE_ENDIAN_DEFS +CFLAGS+= -DHAVE_MALLOC .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -march=i386 @@ -58,6 +65,9 @@ CFLAGS.gcc+= -mpreferred-stack-boundary= .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -m32 .endif +.if ${MACHINE_CPUARCH} == "mips" +CFLAGS+= -mno-abicalls +.endif # # Single threaded BSD kernel @@ -77,19 +87,66 @@ SRCS+= usb_busdma_loader.c # # USB controller drivers # + +SRCS+= usb_controller.c + +.if defined(HAVE_AT91DCI) +CFLAGS += -DUSB_PCI_PROBE_LIST="\"at91dci\"" SRCS+= at91dci.c +.endif + +.if defined(HAVE_ATMEGADCI) +CFLAGS += -DUSB_PCI_PROBE_LIST="\"atmegadci\"" SRCS+= atmegadci.c +.endif + +.if defined(HAVE_AVR32DCI) +CFLAGS += -DUSB_PCI_PROBE_LIST="\"avr32dci\"" SRCS+= avr32dci.c -SRCS+= dwc_otg.c +.endif + +.if defined(HAVE_DWCOTG) +CFLAGS += -DUSB_PCI_PROBE_LIST="\"dwcotg\"" +SRCS+= dwcotg.c +.endif + +.if defined(HAVE_MUSBOTG) +CFLAGS += -DUSB_PCI_PROBE_LIST="\"musbotg\"" +SRCS+= musbotg.c +.endif + +.if defined(HAVE_EHCI) +CFLAGS += -DUSB_PCI_PROBE_LIST="\"ehci\"" SRCS+= ehci.c -SRCS+= musb_otg.c +.endif + +.if defined(HAVE_OHCI) +CFLAGS += -DUSB_PCI_PROBE_LIST="\"ohci\"" SRCS+= ohci.c +.endif + +.if defined(HAVE_UHCI) +CFLAGS += -DUSB_PCI_PROBE_LIST="\"uhci\"" SRCS+= uhci.c -SRCS+= uss820dci.c +.endif + +.if defined(HAVE_XHCI) +CFLAGS += -DUSB_PCI_PROBE_LIST="\"xhci\"" SRCS+= xhci.c -SRCS+= usb_controller.c +.endif + +.if defined(HAVE_USS820DCI) +CFLAGS += -DUSB_PCI_PROBE_LIST="\"uss820dci\"" +SRCS+= uss820dci.c +.endif -CFLAGS += -DUSB_PROBE_LIST="\"xhci\", \"ehci\", \"uhci\", \"ohci\"" +.if defined(HAVE_SAF1761OTG) +CFLAGS += -DUSB_PCI_PROBE_LIST="\"saf1761otg\"" +CFLAGS += -DUSB_PCI_MEMORY_ADDRESS=0x900000007f100000ULL +CFLAGS += -DUSB_PCI_MEMORY_SIZE=0x40000U +SRCS+= saf1761_otg.c +SRCS+= saf1761_otg_boot.c +.endif # # USB core and templates @@ -119,6 +176,15 @@ SRCS+= usb_template_audio.c SRCS+= sysinit_data.c SRCS+= sysuninit_data.c +# +# USB mass storage support +# +SRCS+= umass_common.c + +.if defined(HAVE_UMASS_LOADER) +SRCS+= umass_loader.c +.endif + CLEANFILES+= sysinit CLEANFILES+= sysinit.bin CLEANFILES+= sysinit_data.c Modified: head/sys/boot/usb/bsd_kernel.c ============================================================================== --- head/sys/boot/usb/bsd_kernel.c Fri May 30 13:10:49 2014 (r266881) +++ head/sys/boot/usb/bsd_kernel.c Fri May 30 13:39:58 2014 (r266882) @@ -1091,6 +1091,7 @@ usb_proc_mwait(struct usb_process *up, v * SYSTEM attach *------------------------------------------------------------------------*/ +#ifdef USB_PCI_PROBE_LIST static device_method_t pci_methods[] = { DEVMETHOD_END }; @@ -1105,9 +1106,7 @@ static devclass_t pci_devclass; DRIVER_MODULE(pci, pci, pci_driver, pci_devclass, 0, 0); static const char *usb_pci_devices[] = { -#ifdef USB_PROBE_LIST - USB_PROBE_LIST -#endif + USB_PCI_PROBE_LIST }; #define USB_PCI_USB_MAX (sizeof(usb_pci_devices) / sizeof(void *)) @@ -1150,11 +1149,13 @@ usb_pci_mod_unload(void *arg) device_delete_child(NULL, usb_pci_root); } SYSUNINIT(usb_pci_mod_unload, SI_SUB_RUN_SCHEDULER, SI_ORDER_MIDDLE, usb_pci_mod_unload, 0); +#endif /*------------------------------------------------------------------------* * MALLOC API *------------------------------------------------------------------------*/ +#ifndef HAVE_MALLOC #define USB_POOL_ALIGN 8 static uint8_t usb_pool[USB_POOL_SIZE] __aligned(USB_POOL_ALIGN); @@ -1183,7 +1184,7 @@ usb_malloc(unsigned long size) } if (hdr) { - printf("MALLOC: Entries = %d; Remainder = %d; Size = %d\n", + DPRINTF("MALLOC: Entries = %d; Remainder = %d; Size = %d\n", (int)usb_pool_entries, (int)usb_pool_rem, (int)size); TAILQ_REMOVE(&malloc_head, hdr, entry); @@ -1197,7 +1198,7 @@ usb_malloc(unsigned long size) usb_pool_rem -= size; usb_pool_entries++; - printf("MALLOC: Entries = %d; Remainder = %d; Size = %d\n", + DPRINTF("MALLOC: Entries = %d; Remainder = %d; Size = %d\n", (int)usb_pool_entries, (int)usb_pool_rem, (int)size); memset(hdr + 1, 0, hdr->size - sizeof(*hdr)); @@ -1219,6 +1220,7 @@ usb_free(void *arg) TAILQ_INSERT_TAIL(&malloc_head, hdr, entry); } +#endif char * usb_strdup(const char *str) @@ -1228,7 +1230,7 @@ usb_strdup(const char *str) len = 1 + strlen(str); - tmp = usb_malloc(len); + tmp = malloc(len,XXX,XXX); if (tmp == NULL) return (NULL); Modified: head/sys/boot/usb/bsd_kernel.h ============================================================================== --- head/sys/boot/usb/bsd_kernel.h Fri May 30 13:10:49 2014 (r266881) +++ head/sys/boot/usb/bsd_kernel.h Fri May 30 13:39:58 2014 (r266882) @@ -28,7 +28,8 @@ #define _BSD_KERNEL_H_ #define _KERNEL -#define __FreeBSD_version 1000000 +#undef __FreeBSD_version +#define __FreeBSD_version 1100000 #include #include @@ -92,8 +93,11 @@ SYSINIT_ENTRY(uniq##_entry, "sysuninit", #define BUS_SPACE_BARRIER_READ 0x01 #define BUS_SPACE_BARRIER_WRITE 0x02 #define hz 1000 +#undef PAGE_SIZE #define PAGE_SIZE 4096 +#undef MIN #define MIN(a,b) (((a) < (b)) ? (a) : (b)) +#undef MAX #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #define MTX_DEF 0 #define MTX_SPIN 0 @@ -104,10 +108,15 @@ SYSINIT_ENTRY(uniq##_entry, "sysuninit", #define cold 0 #define BUS_PROBE_GENERIC 0 #define CALLOUT_RETURNUNLOCKED 0x1 +#undef va_list #define va_list __builtin_va_list +#undef va_size #define va_size(type) __builtin_va_size(type) +#undef va_start #define va_start(ap, last) __builtin_va_start(ap, last) +#undef va_end #define va_end(ap) __builtin_va_end(ap) +#undef va_arg #define va_arg(ap, type) __builtin_va_arg((ap), type) #define DEVICE_ATTACH(dev, ...) \ (((device_attach_t *)(device_get_method(dev, "device_attach")))(dev,## __VA_ARGS__)) @@ -150,23 +159,38 @@ struct thread; struct malloc_type; struct usb_process; +#ifndef HAVE_STANDARD_DEFS +#define _UINT8_T_DECLARED typedef unsigned char uint8_t; +#define _INT8_T_DECLARED typedef signed char int8_t; - +#define _UINT16_T_DECLARED typedef unsigned short uint16_t; +#define _INT16_T_DECLARED typedef signed short int16_t; - +#define _UINT32_T_DECLARED typedef unsigned int uint32_t; +#define _INT32_T_DECLARED typedef signed int int32_t; - +#define _UINT64_T_DECLARED typedef unsigned long long uint64_t; +#define _INT16_T_DECLARED typedef signed long long int64_t; -typedef unsigned long bus_addr_t; -typedef unsigned long bus_size_t; +typedef uint16_t uid_t; +typedef uint16_t gid_t; +typedef uint16_t mode_t; + +typedef uint8_t *caddr_t; +typedef unsigned long __uintptr_t; +typedef unsigned long uintptr_t; typedef unsigned long size_t; typedef unsigned long u_long; +#endif + +typedef unsigned long bus_addr_t; +typedef unsigned long bus_size_t; typedef void *bus_dmamap_t; typedef void *bus_dma_tag_t; @@ -174,14 +198,6 @@ typedef void *bus_dma_tag_t; typedef void *bus_space_tag_t; typedef uint8_t *bus_space_handle_t; -typedef uint16_t uid_t; -typedef uint16_t gid_t; -typedef uint16_t mode_t; - -typedef uint8_t *caddr_t; -typedef unsigned long __uintptr_t; -typedef unsigned long uintptr_t; - /* SYSINIT API */ #include @@ -414,17 +430,31 @@ size_t strlen(const char *s); /* MALLOC API */ +#ifndef HAVE_MALLOC +#undef malloc #define malloc(s,x,f) usb_malloc(s) void *usb_malloc(size_t); +#undef free #define free(p,x) usb_free(p) void usb_free(void *); +#else +#undef malloc +void *malloc(size_t); +#define malloc(s,x,f) malloc(s) + +#undef free +void free(void *); +#define free(p,x) free(p) +#endif #define strdup(p,x) usb_strdup(p) char *usb_strdup(const char *str); /* ENDIANNESS */ +#ifndef HAVE_ENDIAN_DEFS + /* Assume little endian */ #define htole64(x) ((uint64_t)(x)) @@ -439,6 +469,10 @@ char *usb_strdup(const char *str); #define be32toh(x) ((uint32_t)(x)) #define htobe32(x) ((uint32_t)(x)) +#else +#include +#endif + /* USB */ typedef int usb_handle_request_t (device_t dev, const void *req, void **pptr, uint16_t *plen, uint16_t offset, uint8_t *pstate); Modified: head/sys/boot/usb/usb_busdma_loader.c ============================================================================== --- head/sys/boot/usb/usb_busdma_loader.c Fri May 30 13:10:49 2014 (r266881) +++ head/sys/boot/usb/usb_busdma_loader.c Fri May 30 13:39:58 2014 (r266882) @@ -211,13 +211,13 @@ usb_pc_alloc_mem(struct usb_page_cache * /* allocate zeroed memory */ if (align != 1) { - ptr = usb_malloc(size + align); + ptr = malloc(size + align, XXX, XXX); if (ptr == NULL) goto error; rem = (-((uintptr_t)ptr)) & (align - 1); } else { - ptr = usb_malloc(size); + ptr = malloc(size, XXX, XXX); if (ptr == NULL) goto error; rem = 0; @@ -258,7 +258,7 @@ void usb_pc_free_mem(struct usb_page_cache *pc) { if (pc != NULL && pc->buffer != NULL) { - usb_free(pc->tag); + free(pc->tag, XXX); pc->buffer = NULL; } } From owner-svn-src-head@FreeBSD.ORG Fri May 30 13:42:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 922041EF; Fri, 30 May 2014 13:42:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 734AE2781; Fri, 30 May 2014 13:42:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UDgCpb071022; Fri, 30 May 2014 13:42:12 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UDgCdc071021; Fri, 30 May 2014 13:42:12 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405301342.s4UDgCdc071021@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 30 May 2014 13:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266883 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 13:42:12 -0000 Author: hselasky Date: Fri May 30 13:42:11 2014 New Revision: 266883 URL: http://svnweb.freebsd.org/changeset/base/266883 Log: Add ISP/SAF1761 bootloader bus interface file. Sponsored by: DARPA, AFRL Added: head/sys/dev/usb/controller/saf1761_otg_boot.c (contents, props changed) Added: head/sys/dev/usb/controller/saf1761_otg_boot.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/saf1761_otg_boot.c Fri May 30 13:42:11 2014 (r266883) @@ -0,0 +1,146 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2014 Hans Petter Selasky + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include USB_GLOBAL_INCLUDE_FILE + +#include +#include + +static device_probe_t saf1761_otg_fdt_probe; +static device_attach_t saf1761_otg_fdt_attach; +static device_detach_t saf1761_otg_fdt_detach; + +static device_method_t saf1761_otg_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, saf1761_otg_fdt_probe), + DEVMETHOD(device_attach, saf1761_otg_fdt_attach), + DEVMETHOD(device_detach, saf1761_otg_fdt_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + DEVMETHOD_END +}; + +static driver_t saf1761_otg_driver = { + .name = "saf1761otg", + .methods = saf1761_otg_methods, + .size = sizeof(struct saf1761_otg_softc), +}; + +static devclass_t saf1761_otg_devclass; + +DRIVER_MODULE(saf1761otg, pci, saf1761_otg_driver, saf1761_otg_devclass, 0, 0); +MODULE_DEPEND(saf1761otg, usb, 1, 1, 1); + +static int +saf1761_otg_fdt_probe(device_t dev) +{ + if (device_get_unit(dev) != 0) + return (ENXIO); + + device_set_desc(dev, "ISP1761/SAF1761 DCI USB 2.0 Device Controller"); + + return (0); +} + +static int +saf1761_otg_fdt_attach(device_t dev) +{ + struct saf1761_otg_softc *sc = device_get_softc(dev); + int err; + + /* 32-bit data bus */ + sc->sc_hw_mode |= SOTG_HW_MODE_CTRL_DATA_BUS_WIDTH; + + /* initialise some bus fields */ + sc->sc_bus.parent = dev; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = SOTG_MAX_DEVICES; + + /* get all DMA memory */ + if (usb_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(dev), NULL)) + return (ENOMEM); + + sc->sc_io_res = (void *)1; + sc->sc_io_tag = (void *)1; + sc->sc_io_hdl = (void *)USB_PCI_MEMORY_ADDRESS; + sc->sc_io_size = USB_PCI_MEMORY_SIZE; + + sc->sc_bus.bdev = device_add_child(dev, "usbus", -1); + if (sc->sc_bus.bdev == NULL) + goto error; + + device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); + device_set_interrupt(dev, &saf1761_otg_filter_interrupt, &saf1761_otg_interrupt, sc); + + err = saf1761_otg_init(sc); + if (err) { + device_printf(dev, "Init failed\n"); + goto error; + } + err = device_probe_and_attach(sc->sc_bus.bdev); + if (err) { + device_printf(dev, "USB probe and attach failed\n"); + goto error; + } + return (0); + +error: + saf1761_otg_fdt_detach(dev); + return (ENXIO); +} + +static int +saf1761_otg_fdt_detach(device_t dev) +{ + struct saf1761_otg_softc *sc = device_get_softc(dev); + device_t bdev; + + if (sc->sc_bus.bdev) { + bdev = sc->sc_bus.bdev; + device_detach(bdev); + device_delete_child(dev, bdev); + } + + /* during module unload there are lots of children leftover */ + device_delete_children(dev); + + if (sc->sc_irq_res) { + /* + * Only call uninit() after init() + */ + saf1761_otg_uninit(sc); + } + usb_bus_mem_free_all(&sc->sc_bus, NULL); + + return (0); +} From owner-svn-src-head@FreeBSD.ORG Fri May 30 13:45:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D381E377; Fri, 30 May 2014 13:45:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A713C27A0; Fri, 30 May 2014 13:45:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UDjLRa071518; Fri, 30 May 2014 13:45:21 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UDjL13071515; Fri, 30 May 2014 13:45:21 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405301345.s4UDjL13071515@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 30 May 2014 13:45:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266884 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 13:45:21 -0000 Author: hselasky Date: Fri May 30 13:45:20 2014 New Revision: 266884 URL: http://svnweb.freebsd.org/changeset/base/266884 Log: Make driver detach code in USB mass storage test optional. Sponsored by: DARPA, AFRL Modified: head/sys/dev/usb/usb_freebsd.h head/sys/dev/usb/usb_freebsd_loader.h head/sys/dev/usb/usb_msctest.c Modified: head/sys/dev/usb/usb_freebsd.h ============================================================================== --- head/sys/dev/usb/usb_freebsd.h Fri May 30 13:42:11 2014 (r266883) +++ head/sys/dev/usb/usb_freebsd.h Fri May 30 13:45:20 2014 (r266884) @@ -41,6 +41,7 @@ #define USB_HAVE_TT_SUPPORT 1 #define USB_HAVE_POWERD 1 #define USB_HAVE_MSCTEST 1 +#define USB_HAVE_MSCTEST_DETACH 1 #define USB_HAVE_PF 1 #define USB_HAVE_ROOT_MOUNT_HOLD 1 #define USB_HAVE_ID_SECTION 1 Modified: head/sys/dev/usb/usb_freebsd_loader.h ============================================================================== --- head/sys/dev/usb/usb_freebsd_loader.h Fri May 30 13:42:11 2014 (r266883) +++ head/sys/dev/usb/usb_freebsd_loader.h Fri May 30 13:45:20 2014 (r266884) @@ -40,7 +40,8 @@ #define USB_HAVE_MBUF 0 #define USB_HAVE_TT_SUPPORT 1 #define USB_HAVE_POWERD 1 -#define USB_HAVE_MSCTEST 0 +#define USB_HAVE_MSCTEST 1 +#define USB_HAVE_MSCTEST_DETACH 0 #define USB_HAVE_PF 0 #define USB_HAVE_ROOT_MOUNT_HOLD 0 #define USB_HAVE_ID_SECTION 0 Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Fri May 30 13:42:11 2014 (r266883) +++ head/sys/dev/usb/usb_msctest.c Fri May 30 13:45:20 2014 (r266884) @@ -507,6 +507,8 @@ bbb_attach(struct usb_device *udev, uint struct usb_interface_descriptor *id; struct bbb_transfer *sc; usb_error_t err; + +#if USB_HAVE_MSCTEST_DETACH uint8_t do_unlock; /* Prevent re-enumeration */ @@ -520,6 +522,7 @@ bbb_attach(struct usb_device *udev, uint if (do_unlock) usbd_enum_unlock(udev); +#endif iface = usbd_get_iface(udev, iface_index); if (iface == NULL) From owner-svn-src-head@FreeBSD.ORG Fri May 30 13:53:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DAC68887; Fri, 30 May 2014 13:53:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C84F5288B; Fri, 30 May 2014 13:53:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UDrbqH075852; Fri, 30 May 2014 13:53:37 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UDrboI075851; Fri, 30 May 2014 13:53:37 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405301353.s4UDrboI075851@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 30 May 2014 13:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266885 - head/sys/boot/mips/beri/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 13:53:37 -0000 Author: hselasky Date: Fri May 30 13:53:37 2014 New Revision: 266885 URL: http://svnweb.freebsd.org/changeset/base/266885 Log: Fix delay() function in the BERI loader code. Reviewed by: brooks @ Sponsored by: DARPA, AFRL Modified: head/sys/boot/mips/beri/loader/main.c Modified: head/sys/boot/mips/beri/loader/main.c ============================================================================== --- head/sys/boot/mips/beri/loader/main.c Fri May 30 13:45:20 2014 (r266884) +++ head/sys/boot/mips/beri/loader/main.c Fri May 30 13:53:37 2014 (r266885) @@ -215,13 +215,25 @@ time(time_t *tloc) } /* - * Delay - presumably in usecs? + * Delay - in usecs + * + * NOTE: We are assuming that the CPU is running at 100MHz. */ void delay(int usecs) { - register_t t; + uint32_t delta; + uint32_t curr; + uint32_t last; - t = cp0_count_get() + usecs * 100; - while (cp0_count_get() < t); + last = cp0_count_get(); + while (usecs > 0) { + curr = cp0_count_get(); + delta = curr - last; + while (usecs > 0 && delta >= 100) { + usecs--; + last += 100; + delta -= 100; + } + } } From owner-svn-src-head@FreeBSD.ORG Fri May 30 13:54:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF93AAE5; Fri, 30 May 2014 13:54:44 +0000 (UTC) Received: from mail.soaustin.net (pancho.soaustin.net [76.74.250.40]) by mx1.freebsd.org (Postfix) with ESMTP id BFC90289F; Fri, 30 May 2014 13:54:44 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id 803465607F; Fri, 30 May 2014 08:54:44 -0500 (CDT) Date: Fri, 30 May 2014 08:54:44 -0500 From: Mark Linimon To: Pedro Giffuni Subject: Re: svn commit: r266865 - in head: include include/xlocale lib/libc/string Message-ID: <20140530135444.GB1168@lonesome.com> References: <201405300109.s4U197Ox028750@svn.freebsd.org> <7AFBC7BD-9F6F-44AA-BBAE-B4A1B20E9B02@felyko.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 13:54:45 -0000 On Fri, May 30, 2014 at 06:55:46AM -0500, Pedro Giffuni wrote: > I consider this a bug fix; I think ports should already be respecting standards. Hahahahahahaha You haven't looked at much ports code, I see :-) > Should I consider a FreeBSD_version bump JIC? Please. mcl From owner-svn-src-head@FreeBSD.ORG Fri May 30 14:05:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6B67D6F; Fri, 30 May 2014 14:05:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3CBB2979; Fri, 30 May 2014 14:05:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UE5VRw080829; Fri, 30 May 2014 14:05:31 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UE5VZo080828; Fri, 30 May 2014 14:05:31 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405301405.s4UE5VZo080828@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 30 May 2014 14:05:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266886 - head/sys/boot/usb/storage X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 14:05:31 -0000 Author: hselasky Date: Fri May 30 14:05:31 2014 New Revision: 266886 URL: http://svnweb.freebsd.org/changeset/base/266886 Log: Export structure(s) properly. Sponsored by: DARPA, AFRL Modified: head/sys/boot/usb/storage/umass_common.h Modified: head/sys/boot/usb/storage/umass_common.h ============================================================================== --- head/sys/boot/usb/storage/umass_common.h Fri May 30 13:53:37 2014 (r266885) +++ head/sys/boot/usb/storage/umass_common.h Fri May 30 14:05:31 2014 (r266886) @@ -32,6 +32,10 @@ #ifndef _UMASS_COMMON_H_ #define _UMASS_COMMON_H_ +struct usb_attach_arg; +struct devsw; + extern struct usb_attach_arg umass_uaa; +extern struct devsw umass_disk; #endif /* _UMASS_COMMON_H_ */ From owner-svn-src-head@FreeBSD.ORG Fri May 30 14:30:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8BB0BE0; Fri, 30 May 2014 14:30:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A61C12B83; Fri, 30 May 2014 14:30:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UEUrRi091999; Fri, 30 May 2014 14:30:53 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UEUrIu091997; Fri, 30 May 2014 14:30:53 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405301430.s4UEUrIu091997@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 30 May 2014 14:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266887 - head/sys/boot/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 14:30:53 -0000 Author: hselasky Date: Fri May 30 14:30:52 2014 New Revision: 266887 URL: http://svnweb.freebsd.org/changeset/base/266887 Log: Resolve issue with resolving malloc() and free() functions at linking time. Sponsored by: DARPA, AFRL Modified: head/sys/boot/usb/bsd_kernel.h head/sys/boot/usb/bsd_usbloader_test.c Modified: head/sys/boot/usb/bsd_kernel.h ============================================================================== --- head/sys/boot/usb/bsd_kernel.h Fri May 30 14:05:31 2014 (r266886) +++ head/sys/boot/usb/bsd_kernel.h Fri May 30 14:30:52 2014 (r266887) @@ -430,7 +430,6 @@ size_t strlen(const char *s); /* MALLOC API */ -#ifndef HAVE_MALLOC #undef malloc #define malloc(s,x,f) usb_malloc(s) void *usb_malloc(size_t); @@ -438,15 +437,6 @@ void *usb_malloc(size_t); #undef free #define free(p,x) usb_free(p) void usb_free(void *); -#else -#undef malloc -void *malloc(size_t); -#define malloc(s,x,f) malloc(s) - -#undef free -void free(void *); -#define free(p,x) free(p) -#endif #define strdup(p,x) usb_strdup(p) char *usb_strdup(const char *str); Modified: head/sys/boot/usb/bsd_usbloader_test.c ============================================================================== --- head/sys/boot/usb/bsd_usbloader_test.c Fri May 30 14:05:31 2014 (r266886) +++ head/sys/boot/usb/bsd_usbloader_test.c Fri May 30 14:30:52 2014 (r266887) @@ -26,6 +26,7 @@ #include #include +#include #include extern int usleep(int); @@ -36,6 +37,18 @@ extern void usb_uninit(void); #define hz 1000 +void * +usb_malloc(size_t size) +{ + return (malloc(size)); +} + +void +usb_free(void *ptr) +{ + free(ptr); +} + void DELAY(unsigned int delay) { From owner-svn-src-head@FreeBSD.ORG Fri May 30 14:49:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C35024B5 for ; Fri, 30 May 2014 14:49:14 +0000 (UTC) Received: from nm15.bullet.mail.bf1.yahoo.com (nm15.bullet.mail.bf1.yahoo.com [98.139.212.174]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AB0C2D73 for ; Fri, 30 May 2014 14:49:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1401461351; bh=pz7oJO1tWDeahFt7PJUSXELsg06tWv6Lvi7EmB8xupA=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:Organization:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=sCquJESGeV5ik2tEU08b9/V1zePkrcVnVcJVdv5xqPECLtsj25Fv4AVuYBnKrvC4/aVPEi+FOmBIkC8lHUdqyX3SoRdOsovxAI2dgC9kWWf4Cx3Zkg8tqaw7Bw35aHIqbB0G6xcN8jJXFRznq3Npc3GczSvGWnFpO+jEVMP1cgzsO+dRO8bbZREKEzb4L3o/gGafPOZvWfS6Uyv7jOAXTWj6Bygq02xMgv57TLUHnTgHWpGyw8b7z+ghAZ/UTf6GD4Xstexy5i1l7LiOo4DbKZFHmr9V4wG+HyCVOebQXI94BrHzxTTAcIxvxNDJDtxBmcQ+cb3Dh9VENkLVtBqzeg== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=G5DtBpiyi7lo0+Id9H8gLPbgrIJKyFVj0MqdZ99CaO5LQQjKiTqD8+cO3lPg/wRfXOgf1s+AahsLa6y2Cl30DXZFxCSkF2IBnWu5vOs4PhOBL5acvAfp5sqjOVK86FPgEq1MNoQjnF1VTfrKBxS0G6PUvvxsJVWqwcFW0si47fy0gUj4KoQJsUyjxEXuJsvy2ytJKNOEfTU3xtlbqAZtRx2A9U9z8T2MOsL3ggR5xR9FWgiDUjfMg7c/AIdQcibul1AQ93r3Bp1vWrjI3nSmPoWsi76NBSb6a1rL8HAQhHwuXlhBYiptnFxXdnr3g3FjuDq0hyMJNAGfre8N4+WHXA==; Received: from [98.139.215.143] by nm15.bullet.mail.bf1.yahoo.com with NNFMP; 30 May 2014 14:49:11 -0000 Received: from [98.139.211.197] by tm14.bullet.mail.bf1.yahoo.com with NNFMP; 30 May 2014 14:49:11 -0000 Received: from [127.0.0.1] by smtp206.mail.bf1.yahoo.com with NNFMP; 30 May 2014 14:49:11 -0000 X-Yahoo-Newman-Id: 631146.53039.bm@smtp206.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: ihNRLr4VM1l39GxY1rm_LoObsPRdfgdZwfk5biS.7SFx2wZ JW.X_gcyMe_pV219cUB.mT6kpiYO04LLhEzewWiX7La8WEtDD3onQzlfyeLo S77QdmTOPpW1I1R9kBmQwFwv4BlTJahtclHNLP93B4iDb1rJ87BFYBrFh6Am eV5xI631RSGS0pRCFnlAydtBfVgFGnk9iImVANPhlrn7E1sQ82o..yqKryDM e_ae3sncOF7TZdK9nYCOAHfkJGNAWgJ9GfFGiX.ONT8HXaEv9yOVICz_REnp 5m2vefD7TAYYnwN59zqLopdV1zJBnhviPYwYeEEPufx16MersoJxUyFzJ9aY p1vB9MIOsEHn_kjtukCHxwWfew8SYc62Fulg2g_wnQ8WM22_1U4sSwBCLsmc L_Xqp.cKKPYIjI0mwYiIgJ189j9rGy4_MH.b.gikuOCivY2f0A8paZFrppNU exk3vWQwL8_XCF3TrEBOyTYnEIDUNTQHiwPAmC8wpA9QS8rO0OEBpm2EtOVk KedJ7Rq7KvQO8oYWXsRw7RZpITBk3vOE- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain [98.138.105.21]) by smtp206.mail.bf1.yahoo.com with SMTP; 30 May 2014 07:49:11 -0700 PDT Message-ID: <53889A69.7060706@FreeBSD.org> Date: Fri, 30 May 2014 09:49:13 -0500 From: Pedro Giffuni Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Mark Linimon Subject: Re: svn commit: r266865 - in head: include include/xlocale lib/libc/string References: <201405300109.s4U197Ox028750@svn.freebsd.org> <7AFBC7BD-9F6F-44AA-BBAE-B4A1B20E9B02@felyko.com> <20140530135444.GB1168@lonesome.com> In-Reply-To: <20140530135444.GB1168@lonesome.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 14:49:14 -0000 El 5/30/2014 8:54 AM, Mark Linimon escribió: > On Fri, May 30, 2014 at 06:55:46AM -0500, Pedro Giffuni wrote: >> I consider this a bug fix; I think ports should already be respecting standards. > > Hahahahahahaha > > You haven't looked at much ports code, I see :-) > Not lately ;). >> Should I consider a FreeBSD_version bump JIC? > > Please. > OK, Give me one more day, I want to wrap some more libc changes (from Illumos). Pedro. From owner-svn-src-head@FreeBSD.ORG Fri May 30 14:54:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2B95897; Fri, 30 May 2014 14:54:10 +0000 (UTC) Received: from mail-wi0-x22f.google.com (mail-wi0-x22f.google.com [IPv6:2a00:1450:400c:c05::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAA3A2E2B; Fri, 30 May 2014 14:54:09 +0000 (UTC) Received: by mail-wi0-f175.google.com with SMTP id f8so1252628wiw.8 for ; Fri, 30 May 2014 07:54:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=4LqLNe5JwbGNtV9c6f3sFkoYctCi+Hu+/REQ18s7X7E=; b=jrhaPiGd5mc67y5KQiHKHjuqc01befgyxXFHfvmtdHyw7rlOvIAuCoh976kaQN/B65 R3Xiqfw848+qBotudtOrm23/ECg5jrFprhKUBQSeUluKcl7d2Hh9EYvN/5kmm4x7vLOe +UiSqIOBQU8fxFh18Arr40PJg0igcLaVOpfIiAemPPEDSd2/fOfACvR8E8Ndn/MGnB0A dA6ydIXUZpyIsAFVmcUf/3dT+qOnRsSmD3sworAE8a+1IdXhXZGaaQt0jWJNWv5moa2j XtXB6LYaqeds6oRAsFJn0mMxa+TY8BXt3qwttbCPEOos6SLcSB/ny/GBCHihmrnkxitk 3gKw== MIME-Version: 1.0 X-Received: by 10.194.7.232 with SMTP id m8mr22880308wja.47.1401461646588; Fri, 30 May 2014 07:54:06 -0700 (PDT) Reply-To: attilio@FreeBSD.org Sender: asmrookie@gmail.com Received: by 10.217.61.196 with HTTP; Fri, 30 May 2014 07:54:06 -0700 (PDT) In-Reply-To: <201405272131.s4RLVBEU035321@svn.freebsd.org> References: <201405272131.s4RLVBEU035321@svn.freebsd.org> Date: Fri, 30 May 2014 16:54:06 +0200 X-Google-Sender-Auth: KFtBUtGqOOMcassDU0T1iXNNeKs Message-ID: Subject: Re: svn commit: r266775 - head/sys/x86/x86 From: Attilio Rao To: Scott Long Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "Peel, Casey" , Benno Rice X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 14:54:10 -0000 On Tue, May 27, 2014 at 11:31 PM, Scott Long wrote: > Author: scottl > Date: Tue May 27 21:31:11 2014 > New Revision: 266775 > URL: http://svnweb.freebsd.org/changeset/base/266775 > > Log: > Eliminate the fake contig_dmamap and replace it with a new flag, > BUS_DMA_KMEM_ALLOC. They serve the same purpose, but using the flag > means that the map can be NULL again, which in turn enables significant > optimizations for the common case of no bouncing. While I think this is in general a good idea, unfortunately our drivers do so many dumb things when freeing DMA allocated buffers that having a NULL map is going to cause some "turbolence" and make such bugs more visible. An example is with ATA, where I think this fix is needed: http://www.freebsd.org/~attilio/dmamem_free-ata.patch Otherwise, what can happen with bounce buffers, is that the allocated memory via contig malloc was not going to be freed anytime. I tried to look around and I found questionable (read broken) code in basically every driver which allocates DMA buffers, so I really don't feel I want to fix the majority of our drivers. I just think such paths are not excercised enough to be seen in practice often or the bugs just get unnoticed. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Fri May 30 14:55:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBA6BA7E; Fri, 30 May 2014 14:55:37 +0000 (UTC) Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [IPv6:2a00:1450:400c:c05::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5ED32E41; Fri, 30 May 2014 14:55:36 +0000 (UTC) Received: by mail-wi0-f176.google.com with SMTP id n15so1232246wiw.9 for ; Fri, 30 May 2014 07:55:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=23wj0eYWR6tIgvGV9jrE+9aOHn2jVoPc4AqMlt0h6TE=; b=LEu3GskhrpDuZ9YlsY89yrqIL4HzPshlFP/J935vPqaL2YO/VYr8+eJqUn3i2Y8xOn sAgTXB4RXhHC7CJCeMeA0PKNqAoMFTZxQh0J3SfyQGJau+X7KE6MHYZEqZqZVzGB/gYw RkNFt0xAOZdGzuTxIsl+MqIWe1qN/VABq9cHQk/p0tHGwmqEiRt61c+xejLMzL/xIvJY uO/mi3BdWtTiH+CViTys5AAwSXLrhW4lixSuuZ/WnPsSR1ImmtHoN7i/CT15CJTqNiM7 6DRyTy1IHJRE96Ocuyd+dM64bWMQcVA2T80omZxOtTEpC3L8n5zN8+5tzCSeq1Kvp3rV rtuQ== MIME-Version: 1.0 X-Received: by 10.180.212.107 with SMTP id nj11mr7697631wic.40.1401461733642; Fri, 30 May 2014 07:55:33 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.194.168.130 with HTTP; Fri, 30 May 2014 07:55:33 -0700 (PDT) In-Reply-To: <20140530081153.GY50679@FreeBSD.org> References: <201405292103.s4TL3ovP019075@svn.freebsd.org> <20140530081153.GY50679@FreeBSD.org> Date: Fri, 30 May 2014 08:55:33 -0600 X-Google-Sender-Auth: NL8oSBLBiMdRbQp9TMfSLKdvWPQ Message-ID: Subject: Re: svn commit: r266860 - in head: sys/net sys/netinet sys/netinet6 tests/sys/netinet From: Alan Somers To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Alan Somers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 14:55:38 -0000 On Fri, May 30, 2014 at 2:11 AM, Gleb Smirnoff wrote: > On Thu, May 29, 2014 at 09:03:50PM +0000, Alan Somers wrote: > A> Author: asomers > A> Date: Thu May 29 21:03:49 2014 > A> New Revision: 266860 > A> URL: http://svnweb.freebsd.org/changeset/base/266860 > A> > A> Log: > A> Fix unintended KBI change from r264905. Add _fib versions of > A> ifa_ifwithnet() and ifa_ifwithdstaddr() The legacy functions will call the > A> _fib() versions with RT_ALL_FIBS, preserving legacy behavior. > > Is this intended for MFC? If not, then I'd say that API bloat hurts > more than KBI change in head/. Yes, it's intended for MFC. > > -- > Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Fri May 30 15:34:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C545AEE6; Fri, 30 May 2014 15:34:00 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9ABA021FF; Fri, 30 May 2014 15:34:00 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 8C580B963; Fri, 30 May 2014 11:33:59 -0400 (EDT) From: John Baldwin To: attilio@freebsd.org Subject: Re: svn commit: r266775 - head/sys/x86/x86 Date: Fri, 30 May 2014 11:03:11 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201405272131.s4RLVBEU035321@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201405301103.11980.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 30 May 2014 11:33:59 -0400 (EDT) Cc: "src-committers@freebsd.org" , Benno Rice , "svn-src-all@freebsd.org" , Scott Long , "svn-src-head@freebsd.org" , "Peel, Casey" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 15:34:00 -0000 On Friday, May 30, 2014 10:54:06 am Attilio Rao wrote: > On Tue, May 27, 2014 at 11:31 PM, Scott Long wrote: > > Author: scottl > > Date: Tue May 27 21:31:11 2014 > > New Revision: 266775 > > URL: http://svnweb.freebsd.org/changeset/base/266775 > > > > Log: > > Eliminate the fake contig_dmamap and replace it with a new flag, > > BUS_DMA_KMEM_ALLOC. They serve the same purpose, but using the flag > > means that the map can be NULL again, which in turn enables significant > > optimizations for the common case of no bouncing. > > While I think this is in general a good idea, unfortunately our > drivers do so many dumb things when freeing DMA allocated buffers that > having a NULL map is going to cause some "turbolence" and make such > bugs more visible. > An example is with ATA, where I think this fix is needed: > http://www.freebsd.org/~attilio/dmamem_free-ata.patch > > Otherwise, what can happen with bounce buffers, is that the allocated > memory via contig malloc was not going to be freed anytime. > > I tried to look around and I found questionable (read broken) code in > basically every driver which allocates DMA buffers, so I really don't > feel I want to fix the majority of our drivers. I just think such > paths are not excercised enough to be seen in practice often or the > bugs just get unnoticed. Eh, many maps for static allocations were already NULL and have been for a long time. This is nothign new. Plus, the diff you posted has a bug regardless of explicitly destroying a map created by bus_dmamem_alloc(). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri May 30 15:39:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACF6A3FE; Fri, 30 May 2014 15:39:27 +0000 (UTC) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8462F225E; Fri, 30 May 2014 15:39:26 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id bs8so1305383wib.3 for ; Fri, 30 May 2014 08:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=XFfergtBrahqAx0gLPRgMWCyBq7DXhaci2waVfrEveI=; b=E7omFOhegiluWDod5SDxpGveicp5juMWdsz0DDUbHZQ0Si8HqJcVL1B3JwnzhuImBl vrkeDdFqr9+vB4gBqyIfbMEXjxdMx203LSo/zoG94Fg1snqoPjgSaJTgIraJI1jPEb2P WzdtwhGBtPHjhLIB7aB6n91I8L0gEL6lJr3YGO7Fkkjl/DQqZEgUiJx1va88/ovHJ9N7 ++z/RxuRWL+jc659JBBUwF+mN51lqZbJA3MAoo9QT0IB38ZhQQWFiaxo/wE4qGN8TMQh o1P4XiWwhs+SIbchHdC0Xtjm2syGDf1p6TimVdgr4ynMgHFgl/vxQNS4zw3T9lc/ZITA m2sg== MIME-Version: 1.0 X-Received: by 10.181.8.67 with SMTP id di3mr7980138wid.8.1401464364461; Fri, 30 May 2014 08:39:24 -0700 (PDT) Reply-To: attilio@FreeBSD.org Sender: asmrookie@gmail.com Received: by 10.217.61.196 with HTTP; Fri, 30 May 2014 08:39:24 -0700 (PDT) In-Reply-To: <201405301103.11980.jhb@freebsd.org> References: <201405272131.s4RLVBEU035321@svn.freebsd.org> <201405301103.11980.jhb@freebsd.org> Date: Fri, 30 May 2014 17:39:24 +0200 X-Google-Sender-Auth: HKaN189w69ALy1IAhkHkLSetnwU Message-ID: Subject: Re: svn commit: r266775 - head/sys/x86/x86 From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: "src-committers@freebsd.org" , Benno Rice , "svn-src-all@freebsd.org" , Scott Long , "svn-src-head@freebsd.org" , "Peel, Casey" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 15:39:27 -0000 On Fri, May 30, 2014 at 5:03 PM, John Baldwin wrote: > On Friday, May 30, 2014 10:54:06 am Attilio Rao wrote: >> On Tue, May 27, 2014 at 11:31 PM, Scott Long wrote: >> > Author: scottl >> > Date: Tue May 27 21:31:11 2014 >> > New Revision: 266775 >> > URL: http://svnweb.freebsd.org/changeset/base/266775 >> > >> > Log: >> > Eliminate the fake contig_dmamap and replace it with a new flag, >> > BUS_DMA_KMEM_ALLOC. They serve the same purpose, but using the flag >> > means that the map can be NULL again, which in turn enables significant >> > optimizations for the common case of no bouncing. >> >> While I think this is in general a good idea, unfortunately our >> drivers do so many dumb things when freeing DMA allocated buffers that >> having a NULL map is going to cause some "turbolence" and make such >> bugs more visible. >> An example is with ATA, where I think this fix is needed: >> http://www.freebsd.org/~attilio/dmamem_free-ata.patch >> >> Otherwise, what can happen with bounce buffers, is that the allocated >> memory via contig malloc was not going to be freed anytime. >> >> I tried to look around and I found questionable (read broken) code in >> basically every driver which allocates DMA buffers, so I really don't >> feel I want to fix the majority of our drivers. I just think such >> paths are not excercised enough to be seen in practice often or the >> bugs just get unnoticed. > > Eh, many maps for static allocations were already NULL and have been for a > long time. This is nothign new. Plus, the diff you posted has a bug > regardless of explicitly destroying a map created by bus_dmamem_alloc(). Did you notice that I *removed* the destroy not *added*? Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Fri May 30 15:46:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3FCECA39; Fri, 30 May 2014 15:46:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D02A234D; Fri, 30 May 2014 15:46:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UFkBZZ027772; Fri, 30 May 2014 15:46:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UFkB43027771; Fri, 30 May 2014 15:46:11 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405301546.s4UFkB43027771@svn.freebsd.org> From: John Baldwin Date: Fri, 30 May 2014 15:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266891 - head/sys/dev/cfe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 15:46:11 -0000 Author: jhb Date: Fri May 30 15:46:10 2014 New Revision: 266891 URL: http://svnweb.freebsd.org/changeset/base/266891 Log: Use callout_*() rather than timeout()/untimeout(). Reviewed by: imp Modified: head/sys/dev/cfe/cfe_console.c Modified: head/sys/dev/cfe/cfe_console.c ============================================================================== --- head/sys/dev/cfe/cfe_console.c Fri May 30 15:02:29 2014 (r266890) +++ head/sys/dev/cfe/cfe_console.c Fri May 30 15:46:10 2014 (r266891) @@ -62,8 +62,7 @@ static struct ttydevsw cfe_ttydevsw = { static int conhandle = -1; /* XXX does cfe have to poll? */ static int polltime; -static struct callout_handle cfe_timeouthandle - = CALLOUT_HANDLE_INITIALIZER(&cfe_timeouthandle); +static struct callout cfe_timer; #if defined(KDB) static int alt_break_state; @@ -89,6 +88,7 @@ cn_drvinit(void *unused) if (cfe_consdev.cn_pri != CN_DEAD && cfe_consdev.cn_name[0] != '\0') { tp = tty_alloc(&cfe_ttydevsw, NULL); + callout_init_mtx(&cfe_timer, tty_getlock(tp), 0); tty_makedev(tp, NULL, "cfecons"); } } @@ -99,7 +99,7 @@ cfe_tty_open(struct tty *tp) polltime = hz / CFECONS_POLL_HZ; if (polltime < 1) polltime = 1; - cfe_timeouthandle = timeout(cfe_timeout, tp, polltime); + callout_reset(&cfe_timer, polltime, cfe_timeout, tp); return (0); } @@ -108,8 +108,7 @@ static void cfe_tty_close(struct tty *tp) { - /* XXX Should be replaced with callout_stop(9) */ - untimeout(cfe_timeout, tp, cfe_timeouthandle); + callout_stop(&cfe_timer); } static void @@ -141,13 +140,12 @@ cfe_timeout(void *v) tp = (struct tty *)v; - tty_lock(tp); + tty_lock_assert(tp, MA_OWNED); while ((c = cfe_cngetc(NULL)) != -1) ttydisc_rint(tp, c, 0); ttydisc_rint_done(tp); - tty_unlock(tp); - cfe_timeouthandle = timeout(cfe_timeout, tp, polltime); + callout_reset(&cfe_timer, polltime, cfe_timeout, tp); } static void From owner-svn-src-head@FreeBSD.ORG Fri May 30 15:47:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06C5DC97; Fri, 30 May 2014 15:47:52 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D03A62374; Fri, 30 May 2014 15:47:51 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id EBDD3B94B; Fri, 30 May 2014 11:47:50 -0400 (EDT) From: John Baldwin To: attilio@freebsd.org Subject: Re: svn commit: r266775 - head/sys/x86/x86 Date: Fri, 30 May 2014 11:47:46 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201405272131.s4RLVBEU035321@svn.freebsd.org> <201405301103.11980.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201405301147.46872.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 30 May 2014 11:47:51 -0400 (EDT) Cc: "src-committers@freebsd.org" , Benno Rice , "svn-src-all@freebsd.org" , Scott Long , "svn-src-head@freebsd.org" , "Peel, Casey" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 15:47:52 -0000 On Friday, May 30, 2014 11:39:24 am Attilio Rao wrote: > On Fri, May 30, 2014 at 5:03 PM, John Baldwin wrote: > > On Friday, May 30, 2014 10:54:06 am Attilio Rao wrote: > >> On Tue, May 27, 2014 at 11:31 PM, Scott Long wrote: > >> > Author: scottl > >> > Date: Tue May 27 21:31:11 2014 > >> > New Revision: 266775 > >> > URL: http://svnweb.freebsd.org/changeset/base/266775 > >> > > >> > Log: > >> > Eliminate the fake contig_dmamap and replace it with a new flag, > >> > BUS_DMA_KMEM_ALLOC. They serve the same purpose, but using the flag > >> > means that the map can be NULL again, which in turn enables significant > >> > optimizations for the common case of no bouncing. > >> > >> While I think this is in general a good idea, unfortunately our > >> drivers do so many dumb things when freeing DMA allocated buffers that > >> having a NULL map is going to cause some "turbolence" and make such > >> bugs more visible. > >> An example is with ATA, where I think this fix is needed: > >> http://www.freebsd.org/~attilio/dmamem_free-ata.patch > >> > >> Otherwise, what can happen with bounce buffers, is that the allocated > >> memory via contig malloc was not going to be freed anytime. > >> > >> I tried to look around and I found questionable (read broken) code in > >> basically every driver which allocates DMA buffers, so I really don't > >> feel I want to fix the majority of our drivers. I just think such > >> paths are not excercised enough to be seen in practice often or the > >> bugs just get unnoticed. > > > > Eh, many maps for static allocations were already NULL and have been for a > > long time. This is nothign new. Plus, the diff you posted has a bug > > regardless of explicitly destroying a map created by bus_dmamem_alloc(). > > Did you notice that I *removed* the destroy not *added*? Yes, my point was that that bug in the original code you are fixing was there regardless of Scott's change. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri May 30 15:51:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A18D2CD; Fri, 30 May 2014 15:51:42 +0000 (UTC) Received: from mail-we0-x230.google.com (mail-we0-x230.google.com [IPv6:2a00:1450:400c:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 764602420; Fri, 30 May 2014 15:51:41 +0000 (UTC) Received: by mail-we0-f176.google.com with SMTP id q59so2154631wes.21 for ; Fri, 30 May 2014 08:51:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=h8gc5cdCXUW3khzU4B3IrjVavaf8Fhc4WM0kBJ+jz/8=; b=vpMRMgearK8SsK+NdkJYq5Jrp8W9ZDwnK+B923il4Kq94xBx/dDaN+vFbL55EuMQLu eJhXlr7evHv1cgWGVHUc8uNOw+IkoyRU5uU79FHJAIBlgJXBUxAAhesPVRjVVzPUXJbE KU+k7j+ngl+sye4S8VIX7TmjH1Z0siRAlxPBbgWgvtZyET6MQp4UXRPotfCFz2JPCQ3m /JhrY3D5AcQEGYN3U7Cmvu0SIAObWAXm/aFxzm9k2fMyexTe/EOo1ENMayQwatYgcK5S ZVexlBC8Whe7iYGJm0nmsbYmXYg2jOjr22Xit3V27eJUuIiubAnWKk7gpdKcMDcIGeQK dgBw== MIME-Version: 1.0 X-Received: by 10.181.8.67 with SMTP id di3mr8081271wid.8.1401465098830; Fri, 30 May 2014 08:51:38 -0700 (PDT) Reply-To: attilio@FreeBSD.org Sender: asmrookie@gmail.com Received: by 10.217.61.196 with HTTP; Fri, 30 May 2014 08:51:38 -0700 (PDT) In-Reply-To: <201405301147.46872.jhb@freebsd.org> References: <201405272131.s4RLVBEU035321@svn.freebsd.org> <201405301103.11980.jhb@freebsd.org> <201405301147.46872.jhb@freebsd.org> Date: Fri, 30 May 2014 17:51:38 +0200 X-Google-Sender-Auth: UNRXeJU9dwNugudsPO8GXvkGdfo Message-ID: Subject: Re: svn commit: r266775 - head/sys/x86/x86 From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: "src-committers@freebsd.org" , Benno Rice , "svn-src-all@freebsd.org" , Scott Long , "svn-src-head@freebsd.org" , "Peel, Casey" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 15:51:42 -0000 On Fri, May 30, 2014 at 5:47 PM, John Baldwin wrote: > On Friday, May 30, 2014 11:39:24 am Attilio Rao wrote: >> On Fri, May 30, 2014 at 5:03 PM, John Baldwin wrote: >> > On Friday, May 30, 2014 10:54:06 am Attilio Rao wrote: >> >> On Tue, May 27, 2014 at 11:31 PM, Scott Long wrote: >> >> > Author: scottl >> >> > Date: Tue May 27 21:31:11 2014 >> >> > New Revision: 266775 >> >> > URL: http://svnweb.freebsd.org/changeset/base/266775 >> >> > >> >> > Log: >> >> > Eliminate the fake contig_dmamap and replace it with a new flag, >> >> > BUS_DMA_KMEM_ALLOC. They serve the same purpose, but using the flag >> >> > means that the map can be NULL again, which in turn enables significant >> >> > optimizations for the common case of no bouncing. >> >> >> >> While I think this is in general a good idea, unfortunately our >> >> drivers do so many dumb things when freeing DMA allocated buffers that >> >> having a NULL map is going to cause some "turbolence" and make such >> >> bugs more visible. >> >> An example is with ATA, where I think this fix is needed: >> >> http://www.freebsd.org/~attilio/dmamem_free-ata.patch >> >> >> >> Otherwise, what can happen with bounce buffers, is that the allocated >> >> memory via contig malloc was not going to be freed anytime. >> >> >> >> I tried to look around and I found questionable (read broken) code in >> >> basically every driver which allocates DMA buffers, so I really don't >> >> feel I want to fix the majority of our drivers. I just think such >> >> paths are not excercised enough to be seen in practice often or the >> >> bugs just get unnoticed. >> > >> > Eh, many maps for static allocations were already NULL and have been for a >> > long time. This is nothign new. Plus, the diff you posted has a bug >> > regardless of explicitly destroying a map created by bus_dmamem_alloc(). >> >> Did you notice that I *removed* the destroy not *added*? > > Yes, my point was that that bug in the original code you are fixing was there > regardless of Scott's change. And when I did say something different? I don't understand what's the point of your messages, besides showing that you didn't read correctly my patch. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Fri May 30 16:44:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40A95A38; Fri, 30 May 2014 16:44:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E0B628F9; Fri, 30 May 2014 16:44:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UGi4Zc054927; Fri, 30 May 2014 16:44:04 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UGi43p054926; Fri, 30 May 2014 16:44:04 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405301644.s4UGi43p054926@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 30 May 2014 16:44:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266892 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 16:44:04 -0000 Author: hselasky Date: Fri May 30 16:44:03 2014 New Revision: 266892 URL: http://svnweb.freebsd.org/changeset/base/266892 Log: It appears the ISP/SAF1761 sometimes is busy when reading the status word of the PTD and simply returns a value of zero. Retry a few times before giving up. Sponsored by: DARPA, AFRL Modified: head/sys/dev/usb/controller/saf1761_otg.c Modified: head/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.c Fri May 30 15:46:10 2014 (r266891) +++ head/sys/dev/usb/controller/saf1761_otg.c Fri May 30 16:44:03 2014 (r266892) @@ -291,11 +291,23 @@ saf1761_host_channel_free(struct saf1761 } static uint32_t -saf1761_peek_host_memory_le_4(struct saf1761_otg_softc *sc, uint32_t offset) +saf1761_peek_host_status_le_4(struct saf1761_otg_softc *sc, uint32_t offset) { - SAF1761_WRITE_LE_4(sc, SOTG_MEMORY_REG, offset); - SAF1761_90NS_DELAY(sc); /* read prefetch time is 90ns */ - return (SAF1761_READ_LE_4(sc, offset)); + uint32_t x = 0; + while (1) { + uint32_t retval; + + SAF1761_WRITE_LE_4(sc, SOTG_MEMORY_REG, offset); + SAF1761_90NS_DELAY(sc); /* read prefetch time is 90ns */ + retval = SAF1761_READ_LE_4(sc, offset); + if (retval != 0) + return (retval); + if (++x == 8) { + DPRINTF("STAUS is zero at offset 0x%x\n", offset); + break; + } + } + return (0); } static void @@ -415,9 +427,7 @@ saf1761_host_setup_tx(struct saf1761_otg if (td->channel < SOTG_HOST_CHANNEL_MAX) { pdt_addr = SOTG_PTD(td->channel); - status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); - if (status == 0) - status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + status = saf1761_peek_host_status_le_4(sc, pdt_addr + SOTG_PTD_DW3); DPRINTFN(5, "STATUS=0x%08x\n", status); @@ -487,9 +497,7 @@ saf1761_host_bulk_data_rx(struct saf1761 pdt_addr = SOTG_PTD(td->channel); - status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); - if (status == 0) - status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + status = saf1761_peek_host_status_le_4(sc, pdt_addr + SOTG_PTD_DW3); DPRINTFN(5, "STATUS=0x%08x\n", status); @@ -591,9 +599,7 @@ saf1761_host_bulk_data_tx(struct saf1761 pdt_addr = SOTG_PTD(td->channel); - status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); - if (status == 0) - status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + status = saf1761_peek_host_status_le_4(sc, pdt_addr + SOTG_PTD_DW3); DPRINTFN(5, "STATUS=0x%08x\n", status); @@ -681,9 +687,7 @@ saf1761_host_intr_data_rx(struct saf1761 pdt_addr = SOTG_PTD(td->channel); - status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); - if (status == 0) - status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + status = saf1761_peek_host_status_le_4(sc, pdt_addr + SOTG_PTD_DW3); DPRINTFN(5, "STATUS=0x%08x\n", status); @@ -788,9 +792,7 @@ saf1761_host_intr_data_tx(struct saf1761 pdt_addr = SOTG_PTD(td->channel); - status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); - if (status == 0) - status = saf1761_peek_host_memory_le_4(sc, pdt_addr + SOTG_PTD_DW3); + status = saf1761_peek_host_status_le_4(sc, pdt_addr + SOTG_PTD_DW3); DPRINTFN(5, "STATUS=0x%08x\n", status); From owner-svn-src-head@FreeBSD.ORG Fri May 30 16:45:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 154E7BF3; Fri, 30 May 2014 16:45:17 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD58C2920; Fri, 30 May 2014 16:45:16 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 8AACAB924; Fri, 30 May 2014 12:45:14 -0400 (EDT) From: John Baldwin To: attilio@freebsd.org Subject: Re: svn commit: r266775 - head/sys/x86/x86 Date: Fri, 30 May 2014 12:44:07 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201405272131.s4RLVBEU035321@svn.freebsd.org> <201405301147.46872.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201405301244.07316.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 30 May 2014 12:45:14 -0400 (EDT) Cc: "src-committers@freebsd.org" , Benno Rice , "svn-src-all@freebsd.org" , Scott Long , "svn-src-head@freebsd.org" , "Peel, Casey" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 16:45:17 -0000 On Friday, May 30, 2014 11:51:38 am Attilio Rao wrote: > On Fri, May 30, 2014 at 5:47 PM, John Baldwin wrote: > > On Friday, May 30, 2014 11:39:24 am Attilio Rao wrote: > >> On Fri, May 30, 2014 at 5:03 PM, John Baldwin wrote: > >> > On Friday, May 30, 2014 10:54:06 am Attilio Rao wrote: > >> >> On Tue, May 27, 2014 at 11:31 PM, Scott Long wrote: > >> >> > Author: scottl > >> >> > Date: Tue May 27 21:31:11 2014 > >> >> > New Revision: 266775 > >> >> > URL: http://svnweb.freebsd.org/changeset/base/266775 > >> >> > > >> >> > Log: > >> >> > Eliminate the fake contig_dmamap and replace it with a new flag, > >> >> > BUS_DMA_KMEM_ALLOC. They serve the same purpose, but using the flag > >> >> > means that the map can be NULL again, which in turn enables significant > >> >> > optimizations for the common case of no bouncing. > >> >> > >> >> While I think this is in general a good idea, unfortunately our > >> >> drivers do so many dumb things when freeing DMA allocated buffers that > >> >> having a NULL map is going to cause some "turbolence" and make such > >> >> bugs more visible. > >> >> An example is with ATA, where I think this fix is needed: > >> >> http://www.freebsd.org/~attilio/dmamem_free-ata.patch > >> >> > >> >> Otherwise, what can happen with bounce buffers, is that the allocated > >> >> memory via contig malloc was not going to be freed anytime. > >> >> > >> >> I tried to look around and I found questionable (read broken) code in > >> >> basically every driver which allocates DMA buffers, so I really don't > >> >> feel I want to fix the majority of our drivers. I just think such > >> >> paths are not excercised enough to be seen in practice often or the > >> >> bugs just get unnoticed. > >> > > >> > Eh, many maps for static allocations were already NULL and have been for a > >> > long time. This is nothign new. Plus, the diff you posted has a bug > >> > regardless of explicitly destroying a map created by bus_dmamem_alloc(). > >> > >> Did you notice that I *removed* the destroy not *added*? > > > > Yes, my point was that that bug in the original code you are fixing was there > > regardless of Scott's change. > > And when I did say something different? > I don't understand what's the point of your messages, besides showing > that you didn't read correctly my patch. I read yours correctly but worded mine poorly. My point is that Scott's change does not introduce anything new. We've had NULL maps for static allocations for many, many years. It's only been recently that we've had more maps not be NULL for this. However, even if you discounted the whole NULL vs non-NULL maps thing, the driver in question that you are fixing was broken regardless. That is, due to the extra bus_dmamap_destroy() the driver was broken regardless of whether the map was NULL or non-NULL. TL;DR: - Scott's change did not introduce any new behavior so we don't need to worry about a spate of new bugs uncovered in drivers because of it. - Your fix is correct, and it was broken with or without Scott's change. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri May 30 16:47:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C5DA3DFD; Fri, 30 May 2014 16:47:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9ABA12955; Fri, 30 May 2014 16:47:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UGltql055493; Fri, 30 May 2014 16:47:55 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UGlt2d055490; Fri, 30 May 2014 16:47:55 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405301647.s4UGlt2d055490@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 30 May 2014 16:47:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266893 - head/sys/boot/mips/beri/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 16:47:55 -0000 Author: hselasky Date: Fri May 30 16:47:54 2014 New Revision: 266893 URL: http://svnweb.freebsd.org/changeset/base/266893 Log: Add optional support for USB to BERI loader. Fix the linker script so that the garbage collection feature can be used when linking. Sponsored by: DARPA, AFRL Modified: head/sys/boot/mips/beri/loader/Makefile head/sys/boot/mips/beri/loader/loader.ldscript head/sys/boot/mips/beri/loader/main.c Modified: head/sys/boot/mips/beri/loader/Makefile ============================================================================== --- head/sys/boot/mips/beri/loader/Makefile Fri May 30 16:44:03 2014 (r266892) +++ head/sys/boot/mips/beri/loader/Makefile Fri May 30 16:47:54 2014 (r266893) @@ -136,6 +136,17 @@ FILES+= loader.rc FILES+= menu.rc .endif +.if defined(LOADER_USB_SUPPORT) +# Do garbage collection +CFLAGS+= -ffunction-sections -fdata-sections +CFLAGS+= -Wl,--gc-sections +# Link USB BOOT library +LDADD+= ${.OBJDIR}/../../../usb/libusbboot.a +CFLAGS+= -I${.CURDIR}/../../../usb +# Define USB SUPPORT +CFLAGS+= -DLOADER_USB_SUPPORT +.endif + all: loader .include Modified: head/sys/boot/mips/beri/loader/loader.ldscript ============================================================================== --- head/sys/boot/mips/beri/loader/loader.ldscript Fri May 30 16:44:03 2014 (r266892) +++ head/sys/boot/mips/beri/loader/loader.ldscript Fri May 30 16:47:54 2014 (r266893) @@ -58,11 +58,16 @@ SECTIONS . += SIZEOF_HEADERS; .text ALIGN(0x8): { - start.o(.text) - *(EXCLUDE_FILE (start.o) .text) + start.o(.text*) + *(EXCLUDE_FILE (start.o) .text*) + *(.rodata*) + + __start_set_Xcommand_set = .; + KEEP(*(set_Xcommand_set)) + __stop_set_Xcommand_set = .; } - .data ALIGN(0x8): { *(.data)} - .bss ALIGN(0x8): { *(.bss) } + .data ALIGN(0x8): { *(.data*)} + .bss ALIGN(0x8): { *(.bss*) } __heap = ALIGN(0x8); /* 64-bit aligned heap pointer */ __data_end = .; Modified: head/sys/boot/mips/beri/loader/main.c ============================================================================== --- head/sys/boot/mips/beri/loader/main.c Fri May 30 16:44:03 2014 (r266892) +++ head/sys/boot/mips/beri/loader/main.c Fri May 30 16:47:54 2014 (r266893) @@ -43,12 +43,19 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef LOADER_USB_SUPPORT +#include +#endif + static int __elfN(exec)(struct preloaded_file *); static void extract_currdev(struct bootinfo *); struct devsw *devsw[] = { &beri_cfi_disk, &beri_sdcard_disk, +#ifdef LOADER_USB_SUPPORT + &umass_disk, +#endif NULL }; From owner-svn-src-head@FreeBSD.ORG Fri May 30 16:49:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 037C7F59; Fri, 30 May 2014 16:49:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4FA72961; Fri, 30 May 2014 16:49:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UGnC1A055918; Fri, 30 May 2014 16:49:12 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UGnCql055914; Fri, 30 May 2014 16:49:12 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201405301649.s4UGnCql055914@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 30 May 2014 16:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266894 - head/sys/boot/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 16:49:13 -0000 Author: hselasky Date: Fri May 30 16:49:12 2014 New Revision: 266894 URL: http://svnweb.freebsd.org/changeset/base/266894 Log: Use own memory pool of 128K until further, hence that works the best. Sponsored by: DARPA, AFRL Modified: head/sys/boot/usb/Makefile head/sys/boot/usb/bsd_usbloader_test.c Modified: head/sys/boot/usb/Makefile ============================================================================== --- head/sys/boot/usb/Makefile Fri May 30 16:47:54 2014 (r266893) +++ head/sys/boot/usb/Makefile Fri May 30 16:49:12 2014 (r266894) @@ -53,10 +53,9 @@ CFLAGS+= -I${.CURDIR} CFLAGS+= -I${.CURDIR}/../common CFLAGS+= -g CFLAGS+= -DUSB_MSCTEST_BULK_SIZE=65536 -CFLAGS+= -DUSB_POOL_SIZE=262144 +CFLAGS+= -DUSB_POOL_SIZE=131072 CFLAGS+= -fno-pic CFLAGS+= -DHAVE_ENDIAN_DEFS -CFLAGS+= -DHAVE_MALLOC .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -march=i386 Modified: head/sys/boot/usb/bsd_usbloader_test.c ============================================================================== --- head/sys/boot/usb/bsd_usbloader_test.c Fri May 30 16:47:54 2014 (r266893) +++ head/sys/boot/usb/bsd_usbloader_test.c Fri May 30 16:49:12 2014 (r266894) @@ -37,6 +37,7 @@ extern void usb_uninit(void); #define hz 1000 +#ifdef HAVE_MALLOC void * usb_malloc(size_t size) { @@ -48,6 +49,7 @@ usb_free(void *ptr) { free(ptr); } +#endif void DELAY(unsigned int delay) From owner-svn-src-head@FreeBSD.ORG Fri May 30 16:53:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF73D3AC; Fri, 30 May 2014 16:53:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A28CE2A0C; Fri, 30 May 2014 16:53:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UGrs3M060794; Fri, 30 May 2014 16:53:54 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UGrsqB060792; Fri, 30 May 2014 16:53:54 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201405301653.s4UGrsqB060792@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 30 May 2014 16:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266895 - in head/etc: etc.amd64 etc.i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 16:53:54 -0000 Author: nwhitehorn Date: Fri May 30 16:53:53 2014 New Revision: 266895 URL: http://svnweb.freebsd.org/changeset/base/266895 Log: Enable a login console on ttyu0 by default if it is a serial console. This prevents surprising effects post-installation on serial-only x86 systems (e.g. bhyve) where the kernel messages will appear, rc scripts will run, and then there will be no login prompt and you will be locked out of the system. Thanks to Devin Teske and Peter Grehan for ideas and testing. With this patch, it may also be possible to unify all or most of the machine-specific ttys files. Modified: head/etc/etc.amd64/ttys head/etc/etc.i386/ttys Modified: head/etc/etc.amd64/ttys ============================================================================== --- head/etc/etc.amd64/ttys Fri May 30 16:49:12 2014 (r266894) +++ head/etc/etc.amd64/ttys Fri May 30 16:53:53 2014 (r266895) @@ -41,7 +41,7 @@ ttyv7 "/usr/libexec/getty Pc" xterm on ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty std.9600" dialup off secure +ttyu0 "/usr/libexec/getty std.9600" vt100 onifconsole secure ttyu1 "/usr/libexec/getty std.9600" dialup off secure ttyu2 "/usr/libexec/getty std.9600" dialup off secure ttyu3 "/usr/libexec/getty std.9600" dialup off secure Modified: head/etc/etc.i386/ttys ============================================================================== --- head/etc/etc.i386/ttys Fri May 30 16:49:12 2014 (r266894) +++ head/etc/etc.i386/ttys Fri May 30 16:53:53 2014 (r266895) @@ -41,7 +41,7 @@ ttyv7 "/usr/libexec/getty Pc" xterm on ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. -ttyu0 "/usr/libexec/getty std.9600" dialup off secure +ttyu0 "/usr/libexec/getty std.9600" vt100 onifconsole secure ttyu1 "/usr/libexec/getty std.9600" dialup off secure ttyu2 "/usr/libexec/getty std.9600" dialup off secure ttyu3 "/usr/libexec/getty std.9600" dialup off secure From owner-svn-src-head@FreeBSD.ORG Fri May 30 16:55:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 193285E7; Fri, 30 May 2014 16:55:10 +0000 (UTC) Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com [IPv6:2a00:1450:400c:c00::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE3002A22; Fri, 30 May 2014 16:55:08 +0000 (UTC) Received: by mail-wg0-f42.google.com with SMTP id y10so2237123wgg.25 for ; Fri, 30 May 2014 09:55:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=aUm1T1nASgXtQ8rkBmzO+3agl5xCkeFcYBMmOcJcOM4=; b=YkNHGpoE9le0NUmThbYDPOdgfcl1khhpWTSOjhcOmOUNG8lVfM5WCpDeICnojxBWsk pOwvH67n4eT/AzaRbewaNjhTL1L+2Mll6SR7TR2TA4jMvuFblV3q++pfuealaFW6Bzdp C63ufYzh286STHcfStTrHy2SI6Zin2Aa+uMmGFojaaDRq2KaFLrT3zu57L9zysQLb1kd jFWySv2SqfrKqd30c5MK6koJ+83lMnwT3ybOPdv3HGSXgYMNFHGZc/s6Puds3xJJYzdC eFMFLgcOWagDxN74cfmRqh52/VBeG8HUzw5+/FtTeFr88OtMjiLq0BmwJ12zZ2zZ0vnw wkfw== MIME-Version: 1.0 X-Received: by 10.194.7.232 with SMTP id m8mr23948565wja.47.1401468906173; Fri, 30 May 2014 09:55:06 -0700 (PDT) Reply-To: attilio@FreeBSD.org Sender: asmrookie@gmail.com Received: by 10.217.61.196 with HTTP; Fri, 30 May 2014 09:55:06 -0700 (PDT) In-Reply-To: <201405301244.07316.jhb@freebsd.org> References: <201405272131.s4RLVBEU035321@svn.freebsd.org> <201405301147.46872.jhb@freebsd.org> <201405301244.07316.jhb@freebsd.org> Date: Fri, 30 May 2014 18:55:06 +0200 X-Google-Sender-Auth: owgUQMcGubFhIXsjqdUqzZSR1Lg Message-ID: Subject: Re: svn commit: r266775 - head/sys/x86/x86 From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: "src-committers@freebsd.org" , Benno Rice , "svn-src-all@freebsd.org" , Scott Long , "svn-src-head@freebsd.org" , "Peel, Casey" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 16:55:10 -0000 On Fri, May 30, 2014 at 6:44 PM, John Baldwin wrote: > On Friday, May 30, 2014 11:51:38 am Attilio Rao wrote: >> On Fri, May 30, 2014 at 5:47 PM, John Baldwin wrote: >> > On Friday, May 30, 2014 11:39:24 am Attilio Rao wrote: >> >> On Fri, May 30, 2014 at 5:03 PM, John Baldwin wrote: >> >> > On Friday, May 30, 2014 10:54:06 am Attilio Rao wrote: >> >> >> On Tue, May 27, 2014 at 11:31 PM, Scott Long wrote: >> >> >> > Author: scottl >> >> >> > Date: Tue May 27 21:31:11 2014 >> >> >> > New Revision: 266775 >> >> >> > URL: http://svnweb.freebsd.org/changeset/base/266775 >> >> >> > >> >> >> > Log: >> >> >> > Eliminate the fake contig_dmamap and replace it with a new flag, >> >> >> > BUS_DMA_KMEM_ALLOC. They serve the same purpose, but using the flag >> >> >> > means that the map can be NULL again, which in turn enables significant >> >> >> > optimizations for the common case of no bouncing. >> >> >> >> >> >> While I think this is in general a good idea, unfortunately our >> >> >> drivers do so many dumb things when freeing DMA allocated buffers that >> >> >> having a NULL map is going to cause some "turbolence" and make such >> >> >> bugs more visible. >> >> >> An example is with ATA, where I think this fix is needed: >> >> >> http://www.freebsd.org/~attilio/dmamem_free-ata.patch >> >> >> >> >> >> Otherwise, what can happen with bounce buffers, is that the allocated >> >> >> memory via contig malloc was not going to be freed anytime. >> >> >> >> >> >> I tried to look around and I found questionable (read broken) code in >> >> >> basically every driver which allocates DMA buffers, so I really don't >> >> >> feel I want to fix the majority of our drivers. I just think such >> >> >> paths are not excercised enough to be seen in practice often or the >> >> >> bugs just get unnoticed. >> >> > >> >> > Eh, many maps for static allocations were already NULL and have been for a >> >> > long time. This is nothign new. Plus, the diff you posted has a bug >> >> > regardless of explicitly destroying a map created by bus_dmamem_alloc(). >> >> >> >> Did you notice that I *removed* the destroy not *added*? >> > >> > Yes, my point was that that bug in the original code you are fixing was there >> > regardless of Scott's change. >> >> And when I did say something different? >> I don't understand what's the point of your messages, besides showing >> that you didn't read correctly my patch. > > I read yours correctly but worded mine poorly. My point is that Scott's > change does not introduce anything new. We've had NULL maps for static > allocations for many, many years. It's only been recently that we've > had more maps not be NULL for this. However, even if you discounted > the whole NULL vs non-NULL maps thing, the driver in question that you > are fixing was broken regardless. That is, due to the extra > bus_dmamap_destroy() the driver was broken regardless of whether the map > was NULL or non-NULL. To be honest, pre-266775 the kernel would actually panic for this specific driver, because we were going to free memory that was never allocated (by having a valid mapping but an invalid dma memory pointer). That was prompted to look at the dma_alloc_*() bits of drivers. We need to make a real sweep at drivers on these bits. > > TL;DR: > > - Scott's change did not introduce any new behavior so we don't need to > worry about a spate of new bugs uncovered in drivers because of it. Not entirely true. For ATA it was before a panic and now it is a silent memory leak. For other drivers it may be the opposite. I could just find this one becaue I got bitten by it. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Fri May 30 18:51:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8560FCF; Fri, 30 May 2014 18:51:40 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BEAF2546; Fri, 30 May 2014 18:51:40 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0E774B924; Fri, 30 May 2014 14:51:38 -0400 (EDT) From: John Baldwin To: attilio@freebsd.org Subject: Re: svn commit: r266775 - head/sys/x86/x86 Date: Fri, 30 May 2014 14:06:42 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201405272131.s4RLVBEU035321@svn.freebsd.org> <201405301244.07316.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201405301406.42782.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 30 May 2014 14:51:38 -0400 (EDT) Cc: "src-committers@freebsd.org" , Benno Rice , "svn-src-all@freebsd.org" , Scott Long , "svn-src-head@freebsd.org" , "Peel, Casey" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 18:51:40 -0000 On Friday, May 30, 2014 12:55:06 pm Attilio Rao wrote: > On Fri, May 30, 2014 at 6:44 PM, John Baldwin wrote: > > On Friday, May 30, 2014 11:51:38 am Attilio Rao wrote: > >> On Fri, May 30, 2014 at 5:47 PM, John Baldwin wrote: > >> > On Friday, May 30, 2014 11:39:24 am Attilio Rao wrote: > >> >> On Fri, May 30, 2014 at 5:03 PM, John Baldwin wrote: > >> >> > On Friday, May 30, 2014 10:54:06 am Attilio Rao wrote: > >> >> >> On Tue, May 27, 2014 at 11:31 PM, Scott Long wrote: > >> >> >> > Author: scottl > >> >> >> > Date: Tue May 27 21:31:11 2014 > >> >> >> > New Revision: 266775 > >> >> >> > URL: http://svnweb.freebsd.org/changeset/base/266775 > >> >> >> > > >> >> >> > Log: > >> >> >> > Eliminate the fake contig_dmamap and replace it with a new flag, > >> >> >> > BUS_DMA_KMEM_ALLOC. They serve the same purpose, but using the flag > >> >> >> > means that the map can be NULL again, which in turn enables significant > >> >> >> > optimizations for the common case of no bouncing. > >> >> >> > >> >> >> While I think this is in general a good idea, unfortunately our > >> >> >> drivers do so many dumb things when freeing DMA allocated buffers that > >> >> >> having a NULL map is going to cause some "turbolence" and make such > >> >> >> bugs more visible. > >> >> >> An example is with ATA, where I think this fix is needed: > >> >> >> http://www.freebsd.org/~attilio/dmamem_free-ata.patch > >> >> >> > >> >> >> Otherwise, what can happen with bounce buffers, is that the allocated > >> >> >> memory via contig malloc was not going to be freed anytime. > >> >> >> > >> >> >> I tried to look around and I found questionable (read broken) code in > >> >> >> basically every driver which allocates DMA buffers, so I really don't > >> >> >> feel I want to fix the majority of our drivers. I just think such > >> >> >> paths are not excercised enough to be seen in practice often or the > >> >> >> bugs just get unnoticed. > >> >> > > >> >> > Eh, many maps for static allocations were already NULL and have been for a > >> >> > long time. This is nothign new. Plus, the diff you posted has a bug > >> >> > regardless of explicitly destroying a map created by bus_dmamem_alloc(). > >> >> > >> >> Did you notice that I *removed* the destroy not *added*? > >> > > >> > Yes, my point was that that bug in the original code you are fixing was there > >> > regardless of Scott's change. > >> > >> And when I did say something different? > >> I don't understand what's the point of your messages, besides showing > >> that you didn't read correctly my patch. > > > > I read yours correctly but worded mine poorly. My point is that Scott's > > change does not introduce anything new. We've had NULL maps for static > > allocations for many, many years. It's only been recently that we've > > had more maps not be NULL for this. However, even if you discounted > > the whole NULL vs non-NULL maps thing, the driver in question that you > > are fixing was broken regardless. That is, due to the extra > > bus_dmamap_destroy() the driver was broken regardless of whether the map > > was NULL or non-NULL. > > To be honest, pre-266775 the kernel would actually panic for this > specific driver, because we were going to free memory that was never > allocated (by having a valid mapping but an invalid dma memory > pointer). pre-239354 bus_dma would have used a NULL map just as it does now. And even some allocations during that window could still use a NULL map. The idea of a NULL map is not a new concept. Most maps from bus_dmamem_alloc() have been NULL for most of bus_dma's existence. > That was prompted to look at the dma_alloc_*() bits of drivers. > We need to make a real sweep at drivers on these bits. I did a start: http://p4web.freebsd.org/@@1194266?ac=10 -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri May 30 18:59:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 793CD3E2; Fri, 30 May 2014 18:59:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6757B2598; Fri, 30 May 2014 18:59:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UIxccB019724; Fri, 30 May 2014 18:59:38 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UIxcqs019723; Fri, 30 May 2014 18:59:38 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405301859.s4UIxcqs019723@svn.freebsd.org> From: Neel Natu Date: Fri, 30 May 2014 18:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266901 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 18:59:38 -0000 Author: neel Date: Fri May 30 18:59:37 2014 New Revision: 266901 URL: http://svnweb.freebsd.org/changeset/base/266901 Log: Allocate a zeroed LDT. Failing to do this might result in the LDT appearing to run out of free descriptors because of random junk in the descriptor's 'sd_type' field. http://lists.freebsd.org/pipermail/freebsd-amd64/2014-May/016088.html Reviewed by: kib MFC after: 2 weeks Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Fri May 30 18:14:15 2014 (r266900) +++ head/sys/amd64/amd64/sys_machdep.c Fri May 30 18:59:37 2014 (r266901) @@ -462,7 +462,7 @@ user_ldt_alloc(struct proc *p, int force new_ldt = malloc(sizeof(struct proc_ldt), M_SUBPROC, M_WAITOK); new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_arena, max_ldt_segment * sizeof(struct user_segment_descriptor), - M_WAITOK); + M_WAITOK | M_ZERO); if (new_ldt->ldt_base == NULL) { FREE(new_ldt, M_SUBPROC); mtx_lock(&dt_lock); From owner-svn-src-head@FreeBSD.ORG Fri May 30 19:45:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D90E430C; Fri, 30 May 2014 19:45:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6BA7296A; Fri, 30 May 2014 19:45:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UJjLnV042014; Fri, 30 May 2014 19:45:21 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UJjLga042013; Fri, 30 May 2014 19:45:21 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201405301945.s4UJjLga042013@svn.freebsd.org> From: Ed Maste Date: Fri, 30 May 2014 19:45:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266902 - head/etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 19:45:21 -0000 Author: emaste Date: Fri May 30 19:45:21 2014 New Revision: 266902 URL: http://svnweb.freebsd.org/changeset/base/266902 Log: Add missing libexec/bsdconfig subdirectories Modified: head/etc/mtree/BSD.usr.dist Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Fri May 30 18:59:37 2014 (r266901) +++ head/etc/mtree/BSD.usr.dist Fri May 30 19:45:21 2014 (r266902) @@ -101,6 +101,10 @@ .. include .. + includes + include + .. + .. .. bsdinstall .. From owner-svn-src-head@FreeBSD.ORG Fri May 30 20:12:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24B63CDB; Fri, 30 May 2014 20:12:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1257B2C16; Fri, 30 May 2014 20:12:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UKCleB055671; Fri, 30 May 2014 20:12:47 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UKClKp055670; Fri, 30 May 2014 20:12:47 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201405302012.s4UKClKp055670@svn.freebsd.org> From: Ed Maste Date: Fri, 30 May 2014 20:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266903 - head/usr.sbin/pmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 20:12:48 -0000 Author: emaste Date: Fri May 30 20:12:47 2014 New Revision: 266903 URL: http://svnweb.freebsd.org/changeset/base/266903 Log: Update default callchain depth to 16 to match kernel MFC after: 1 week Modified: head/usr.sbin/pmcstat/pmcstat.h Modified: head/usr.sbin/pmcstat/pmcstat.h ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.h Fri May 30 19:45:21 2014 (r266902) +++ head/usr.sbin/pmcstat/pmcstat.h Fri May 30 20:12:47 2014 (r266903) @@ -61,7 +61,7 @@ #define DEFAULT_DISPLAY_HEIGHT 256 /* file virtual height */ #define DEFAULT_DISPLAY_WIDTH 1024 /* file virtual width */ #define DEFAULT_BUFFER_SIZE 4096 -#define DEFAULT_CALLGRAPH_DEPTH 4 +#define DEFAULT_CALLGRAPH_DEPTH 16 #define PRINT_HEADER_PREFIX "# " #define READPIPEFD 0 From owner-svn-src-head@FreeBSD.ORG Fri May 30 20:56:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A589A42; Fri, 30 May 2014 20:56:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37E752F6D; Fri, 30 May 2014 20:56:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UKuTth074410; Fri, 30 May 2014 20:56:29 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UKuTa4074409; Fri, 30 May 2014 20:56:29 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405302056.s4UKuTa4074409@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 30 May 2014 20:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266904 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 20:56:29 -0000 Author: pfg Date: Fri May 30 20:56:28 2014 New Revision: 266904 URL: http://svnweb.freebsd.org/changeset/base/266904 Log: Bump FreeBSD_version due to changed header for strcasecmp(3) family. In r266865, strcasecmp_l() and strncasecmp_l() were moved from to for POSIX 2008 compliance. Requested by: linimon Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri May 30 20:12:47 2014 (r266903) +++ head/sys/sys/param.h Fri May 30 20:56:28 2014 (r266904) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100021 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100022 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Fri May 30 20:58:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5764BA2; Fri, 30 May 2014 20:58:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A33FE2F82; Fri, 30 May 2014 20:58:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UKwW6m074712; Fri, 30 May 2014 20:58:32 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UKwWJA074711; Fri, 30 May 2014 20:58:32 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405302058.s4UKwWJA074711@svn.freebsd.org> From: Neel Natu Date: Fri, 30 May 2014 20:58:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266905 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 20:58:32 -0000 Author: neel Date: Fri May 30 20:58:32 2014 New Revision: 266905 URL: http://svnweb.freebsd.org/changeset/base/266905 Log: Remove bogus check for kmem_malloc() failure even though M_WAITOK is set. Requested by: jkim Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Fri May 30 20:56:28 2014 (r266904) +++ head/sys/amd64/amd64/sys_machdep.c Fri May 30 20:58:32 2014 (r266905) @@ -357,8 +357,6 @@ amd64_set_ioperm(td, uap) if (pcb->pcb_tssp == NULL) { tssp = (struct amd64tss *)kmem_malloc(kernel_arena, ctob(IOPAGES+1), M_WAITOK); - if (tssp == NULL) - return (ENOMEM); iomap = (char *)&tssp[1]; memset(iomap, 0xff, IOPERM_BITMAP_SIZE); critical_enter(); @@ -463,11 +461,6 @@ user_ldt_alloc(struct proc *p, int force new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_arena, max_ldt_segment * sizeof(struct user_segment_descriptor), M_WAITOK | M_ZERO); - if (new_ldt->ldt_base == NULL) { - FREE(new_ldt, M_SUBPROC); - mtx_lock(&dt_lock); - return (NULL); - } new_ldt->ldt_refcnt = 1; sldt.ssd_base = (uint64_t)new_ldt->ldt_base; sldt.ssd_limit = max_ldt_segment * From owner-svn-src-head@FreeBSD.ORG Fri May 30 21:18:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD2133A3; Fri, 30 May 2014 21:18:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA55F214C; Fri, 30 May 2014 21:18:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4ULIrFQ084310; Fri, 30 May 2014 21:18:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4ULIrAa084309; Fri, 30 May 2014 21:18:53 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201405302118.s4ULIrAa084309@svn.freebsd.org> From: John Baldwin Date: Fri, 30 May 2014 21:18:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266906 - head/usr.bin/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 21:18:53 -0000 Author: jhb Date: Fri May 30 21:18:53 2014 New Revision: 266906 URL: http://svnweb.freebsd.org/changeset/base/266906 Log: Rework the notion of CPU used in top. In particular, for subsequent displays after a pause, use the difference in runtime divided by the length of the pause as the percentage of CPU used instead of the value calculated by the kernel. In addition, when determing if a process or thread is idle or not, treat any process or thread that has used any runtime or performed any context switches during the interval as busy. Note that the percent CPU is calculated as a double and stored in an array to avoid recalculating the value multiple times in the comparison method used to sort processes in the CPU display. Tested by: Jamie Landeg-Jones Reviewed by: emaste (earlier version) MFC after: 1 week Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Fri May 30 20:58:32 2014 (r266905) +++ head/usr.bin/top/machine.c Fri May 30 21:18:53 2014 (r266906) @@ -96,6 +96,7 @@ struct handle { #define RUTOT(pp) \ (RU(pp)->ru_inblock + RU(pp)->ru_oublock + RU(pp)->ru_majflt) +#define PCTCPU(pp) (pcpu[pp - pbase]) /* definitions for indices in the nlist array */ @@ -203,7 +204,14 @@ static struct kinfo_proc *previous_procs static struct kinfo_proc **previous_pref; static int previous_proc_count = 0; static int previous_proc_count_max = 0; -static int arc_enabled; +static int previous_thread; + +/* data used for recalculating pctcpu */ +static double *pcpu; +static struct timespec proc_uptime; +static struct timeval proc_wall_time; +static struct timeval previous_wall_time; +static uint64_t previous_interval = 0; /* total number of io operations */ static long total_inblock; @@ -212,6 +220,7 @@ static long total_majflt; /* these are for getting the memory statistics */ +static int arc_enabled; static int pageshift; /* log base 2 of the pagesize */ /* define pagetok in terms of pageshift */ @@ -329,6 +338,7 @@ machine_init(struct statics *statics, ch pbase = NULL; pref = NULL; + pcpu = NULL; nproc = 0; onproc = -1; @@ -650,6 +660,52 @@ get_io_stats(struct kinfo_proc *pp, long } /* + * If there was a previous update, use the delta in ki_runtime over + * the previous interval to calculate pctcpu. Otherwise, fall back + * to using the kernel's ki_pctcpu. + */ +static double +proc_calc_pctcpu(struct kinfo_proc *pp) +{ + const struct kinfo_proc *oldp; + + if (previous_interval != 0) { + oldp = get_old_proc(pp); + if (oldp != NULL) + return ((double)(pp->ki_runtime - oldp->ki_runtime) + / previous_interval); + + /* + * If this process/thread was created during the previous + * interval, charge it's total runtime to the previous + * interval. + */ + else if (pp->ki_start.tv_sec > previous_wall_time.tv_sec || + (pp->ki_start.tv_sec == previous_wall_time.tv_sec && + pp->ki_start.tv_usec >= previous_wall_time.tv_usec)) + return ((double)pp->ki_runtime / previous_interval); + } + return (pctdouble(pp->ki_pctcpu)); +} + +/* + * Return true if this process has used any CPU time since the + * previous update. + */ +static int +proc_used_cpu(struct kinfo_proc *pp) +{ + const struct kinfo_proc *oldp; + + oldp = get_old_proc(pp); + if (oldp == NULL) + return (PCTCPU(pp) != 0); + return (pp->ki_runtime != oldp->ki_runtime || + RU(pp)->ru_nvcsw != RU(oldp)->ru_nvcsw || + RU(pp)->ru_nivcsw != RU(oldp)->ru_nivcsw); +} + +/* * Return the total number of block in/out and faults by a process. */ long @@ -670,9 +726,11 @@ get_process_info(struct system_info *si, int total_procs; long p_io; long p_inblock, p_oublock, p_majflt, p_vcsw, p_ivcsw; + long nsec; int active_procs; struct kinfo_proc **prefp; struct kinfo_proc *pp; + struct timespec previous_proc_uptime; /* these are copied out of sel for speed */ int show_idle; @@ -684,6 +742,13 @@ get_process_info(struct system_info *si, int show_kidle; /* + * If thread state was toggled, don't cache the previous processes. + */ + if (previous_thread != sel->thread) + nproc = 0; + previous_thread = sel->thread; + + /* * Save the previous process info. */ if (previous_proc_count_max < nproc) { @@ -705,12 +770,32 @@ get_process_info(struct system_info *si, ps.thread ? compare_tid : compare_pid); } previous_proc_count = nproc; + previous_proc_uptime = proc_uptime; + previous_wall_time = proc_wall_time; + previous_interval = 0; pbase = kvm_getprocs(kd, sel->thread ? KERN_PROC_ALL : KERN_PROC_PROC, 0, &nproc); - if (nproc > onproc) - pref = realloc(pref, sizeof(*pref) * (onproc = nproc)); - if (pref == NULL || pbase == NULL) { + (void)gettimeofday(&proc_wall_time, NULL); + if (clock_gettime(CLOCK_UPTIME, &proc_uptime) != 0) + memset(&proc_uptime, 0, sizeof(proc_uptime)); + else if (previous_proc_uptime.tv_sec != 0 && + previous_proc_uptime.tv_nsec != 0) { + previous_interval = (proc_uptime.tv_sec - + previous_proc_uptime.tv_sec) * 1000000; + nsec = proc_uptime.tv_nsec - previous_proc_uptime.tv_nsec; + if (nsec < 0) { + previous_interval -= 1000000; + nsec += 1000000000; + } + previous_interval += nsec / 1000; + } + if (nproc > onproc) { + pref = realloc(pref, sizeof(*pref) * nproc); + pcpu = realloc(pcpu, sizeof(*pcpu) * nproc); + onproc = nproc; + } + if (pref == NULL || pbase == NULL || pcpu == NULL) { (void) fprintf(stderr, "top: Out of memory.\n"); quit(23); } @@ -763,9 +848,10 @@ get_process_info(struct system_info *si, if (!show_kidle && pp->ki_tdflags & TDF_IDLETD) /* skip kernel idle process */ continue; - + + PCTCPU(pp) = proc_calc_pctcpu(pp); if (displaymode == DISP_CPU && !show_idle && - (pp->ki_pctcpu == 0 || + (!proc_used_cpu(pp) || pp->ki_stat == SSTOP || pp->ki_stat == SIDL)) /* skip idle or non-running processes */ continue; @@ -848,7 +934,7 @@ format_next_process(caddr_t handle, char cputime = (pp->ki_runtime + 500000) / 1000000; /* calculate the base for cpu percentages */ - pct = pctdouble(pp->ki_pctcpu); + pct = PCTCPU(pp); /* generate "STATE" field */ switch (state = pp->ki_stat) { @@ -1169,14 +1255,12 @@ static int sorted_state[] = { #define ORDERKEY_PCTCPU(a, b) do { \ - long diff; \ + double diff; \ if (ps.wcpu) \ - diff = floor(1.0E6 * weighted_cpu(pctdouble((b)->ki_pctcpu), \ - (b))) - \ - floor(1.0E6 * weighted_cpu(pctdouble((a)->ki_pctcpu), \ - (a))); \ + diff = weighted_cpu(PCTCPU((b)), (b)) - \ + weighted_cpu(PCTCPU((a)), (a)); \ else \ - diff = (long)(b)->ki_pctcpu - (long)(a)->ki_pctcpu; \ + diff = PCTCPU((b)) - PCTCPU((a)); \ if (diff != 0) \ return (diff > 0 ? 1 : -1); \ } while (0) From owner-svn-src-head@FreeBSD.ORG Fri May 30 22:34:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF5A8515; Fri, 30 May 2014 22:34:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC9362773; Fri, 30 May 2014 22:34:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UMY6M0019472; Fri, 30 May 2014 22:34:06 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UMY6uV019471; Fri, 30 May 2014 22:34:06 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201405302234.s4UMY6uV019471@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 30 May 2014 22:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266907 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 22:34:06 -0000 Author: bz Date: Fri May 30 22:34:06 2014 New Revision: 266907 URL: http://svnweb.freebsd.org/changeset/base/266907 Log: While PAWS is disabled, there are no consumers for the tcp options argument to tcp_twcheck(); thus mark it __unused. MFC after: 2 weeks Modified: head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Fri May 30 21:18:53 2014 (r266906) +++ head/sys/netinet/tcp_timewait.c Fri May 30 22:34:06 2014 (r266907) @@ -363,7 +363,7 @@ tcp_twstart(struct tcpcb *tp) * looking for a pcb in the listen state. Returns 0 otherwise. */ int -tcp_twcheck(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th, +tcp_twcheck(struct inpcb *inp, struct tcpopt *to __unused, struct tcphdr *th, struct mbuf *m, int tlen) { struct tcptw *tw; From owner-svn-src-head@FreeBSD.ORG Fri May 30 22:59:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F012833; Fri, 30 May 2014 22:59:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C5C82916; Fri, 30 May 2014 22:59:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UMxkJw028796; Fri, 30 May 2014 22:59:46 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UMxkwp028795; Fri, 30 May 2014 22:59:46 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201405302259.s4UMxkwp028795@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 30 May 2014 22:59:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266908 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 22:59:46 -0000 Author: np Date: Fri May 30 22:59:45 2014 New Revision: 266908 URL: http://svnweb.freebsd.org/changeset/base/266908 Log: cxgbe(4): Fix a NULL dereference when the very first call to get_scatter_segment() in get_fl_payload() fails. While here, fix the code to adjust fl_bufs_used when a failure occurs for any other scatter segment. MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Fri May 30 22:34:06 2014 (r266907) +++ head/sys/dev/cxgbe/t4_sge.c Fri May 30 22:59:45 2014 (r266908) @@ -1628,6 +1628,7 @@ get_fl_payload(struct adapter *sc, struc nbuf = 0; len = G_RSPD_LEN(len_newbuf); if (__predict_false(fl->m0 != NULL)) { + M_ASSERTPKTHDR(fl->m0); MPASS(len == fl->m0->m_pkthdr.len); MPASS(fl->remaining < len); @@ -1651,6 +1652,8 @@ get_fl_payload(struct adapter *sc, struc */ m0 = get_scatter_segment(sc, fl, len, M_PKTHDR); + if (m0 == NULL) + goto done; len -= m0->m_len; pnext = &m0->m_next; while (len > 0) { @@ -1662,7 +1665,8 @@ get_segment: fl->m0 = m0; fl->pnext = pnext; fl->remaining = len; - return (NULL); + m0 = NULL; + goto done; } *pnext = m; pnext = &m->m_next; @@ -1671,7 +1675,7 @@ get_segment: *pnext = NULL; if (fl->rx_offset == 0) nbuf++; - +done: (*fl_bufs_used) += nbuf; return (m0); } From owner-svn-src-head@FreeBSD.ORG Fri May 30 23:10:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A94E6A45; Fri, 30 May 2014 23:10:15 +0000 (UTC) Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com [IPv6:2a00:1450:400c:c05::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B27F29D4; Fri, 30 May 2014 23:10:14 +0000 (UTC) Received: by mail-wi0-f177.google.com with SMTP id f8so1918372wiw.10 for ; Fri, 30 May 2014 16:10:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=CodSFOAh/ofROA9uxCNOFBD7s3syfpGI1FNic7RUeEM=; b=ipcmBSChZO0GMUoZRxQwU6bgyXAPNnSLtzL3rkZcxThMlWE0a3HjvjXozdta7sQnl9 nWOdMG0OCBpKx0lIdrfI7H06iyVDk9Gfhdb50Vfdb1M6w42rD9+l1TwG6B4Uobm8r8Bb s2pqnmOwbGDG7vjJohct+2LSv8nBFnE4JKzChdBm+CjUYdF+awIs4z7nb38pGeAK2T5T rUC7rnqSlaimrZcharHcRsII4NNoPPlier15hp9r71BGf3zK3wJ+7Ohx+g+Z+ulQww0F Zc+5ukBZj+pIxzahf7jKS6HcqkU/o9gIhTsLc+sjjs3hGDVBGQYx6rj1y3CuT7ABqcgU etGQ== MIME-Version: 1.0 X-Received: by 10.180.126.97 with SMTP id mx1mr783782wib.29.1401491412752; Fri, 30 May 2014 16:10:12 -0700 (PDT) Reply-To: attilio@FreeBSD.org Sender: asmrookie@gmail.com Received: by 10.217.61.196 with HTTP; Fri, 30 May 2014 16:10:12 -0700 (PDT) In-Reply-To: <201405301406.42782.jhb@freebsd.org> References: <201405272131.s4RLVBEU035321@svn.freebsd.org> <201405301244.07316.jhb@freebsd.org> <201405301406.42782.jhb@freebsd.org> Date: Sat, 31 May 2014 01:10:12 +0200 X-Google-Sender-Auth: xhcGb-Zd5YjCDOaoiBqBb5VZqds Message-ID: Subject: Re: svn commit: r266775 - head/sys/x86/x86 From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: "src-committers@freebsd.org" , Benno Rice , "svn-src-all@freebsd.org" , Scott Long , "svn-src-head@freebsd.org" , "Peel, Casey" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 23:10:15 -0000 On Fri, May 30, 2014 at 8:06 PM, John Baldwin wrote: > On Friday, May 30, 2014 12:55:06 pm Attilio Rao wrote: >> On Fri, May 30, 2014 at 6:44 PM, John Baldwin wrote: >> > On Friday, May 30, 2014 11:51:38 am Attilio Rao wrote: >> >> On Fri, May 30, 2014 at 5:47 PM, John Baldwin wrote: >> >> > On Friday, May 30, 2014 11:39:24 am Attilio Rao wrote: >> >> >> On Fri, May 30, 2014 at 5:03 PM, John Baldwin wrote: >> >> >> > On Friday, May 30, 2014 10:54:06 am Attilio Rao wrote: >> >> >> >> On Tue, May 27, 2014 at 11:31 PM, Scott Long > wrote: >> >> >> >> > Author: scottl >> >> >> >> > Date: Tue May 27 21:31:11 2014 >> >> >> >> > New Revision: 266775 >> >> >> >> > URL: http://svnweb.freebsd.org/changeset/base/266775 >> >> >> >> > >> >> >> >> > Log: >> >> >> >> > Eliminate the fake contig_dmamap and replace it with a new > flag, >> >> >> >> > BUS_DMA_KMEM_ALLOC. They serve the same purpose, but using the > flag >> >> >> >> > means that the map can be NULL again, which in turn enables > significant >> >> >> >> > optimizations for the common case of no bouncing. >> >> >> >> >> >> >> >> While I think this is in general a good idea, unfortunately our >> >> >> >> drivers do so many dumb things when freeing DMA allocated buffers > that >> >> >> >> having a NULL map is going to cause some "turbolence" and make such >> >> >> >> bugs more visible. >> >> >> >> An example is with ATA, where I think this fix is needed: >> >> >> >> http://www.freebsd.org/~attilio/dmamem_free-ata.patch >> >> >> >> >> >> >> >> Otherwise, what can happen with bounce buffers, is that the > allocated >> >> >> >> memory via contig malloc was not going to be freed anytime. >> >> >> >> >> >> >> >> I tried to look around and I found questionable (read broken) code > in >> >> >> >> basically every driver which allocates DMA buffers, so I really > don't >> >> >> >> feel I want to fix the majority of our drivers. I just think such >> >> >> >> paths are not excercised enough to be seen in practice often or the >> >> >> >> bugs just get unnoticed. >> >> >> > >> >> >> > Eh, many maps for static allocations were already NULL and have been > for a >> >> >> > long time. This is nothign new. Plus, the diff you posted has a > bug >> >> >> > regardless of explicitly destroying a map created by > bus_dmamem_alloc(). >> >> >> >> >> >> Did you notice that I *removed* the destroy not *added*? >> >> > >> >> > Yes, my point was that that bug in the original code you are fixing was > there >> >> > regardless of Scott's change. >> >> >> >> And when I did say something different? >> >> I don't understand what's the point of your messages, besides showing >> >> that you didn't read correctly my patch. >> > >> > I read yours correctly but worded mine poorly. My point is that Scott's >> > change does not introduce anything new. We've had NULL maps for static >> > allocations for many, many years. It's only been recently that we've >> > had more maps not be NULL for this. However, even if you discounted >> > the whole NULL vs non-NULL maps thing, the driver in question that you >> > are fixing was broken regardless. That is, due to the extra >> > bus_dmamap_destroy() the driver was broken regardless of whether the map >> > was NULL or non-NULL. >> >> To be honest, pre-266775 the kernel would actually panic for this >> specific driver, because we were going to free memory that was never >> allocated (by having a valid mapping but an invalid dma memory >> pointer). > > pre-239354 bus_dma would have used a NULL map just as it does now. And > even some allocations during that window could still use a NULL map. The > idea of a NULL map is not a new concept. Most maps from bus_dmamem_alloc() > have been NULL for most of bus_dma's existence. > >> That was prompted to look at the dma_alloc_*() bits of drivers. >> We need to make a real sweep at drivers on these bits. > > I did a start: http://p4web.freebsd.org/@@1194266?ac=10 I had converted if_alc.c, if_ale.c and e1000/ stuff before to give up. The first 2 looks good to me. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Fri May 30 23:37:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 188442F8; Fri, 30 May 2014 23:37:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 056AC2BE5; Fri, 30 May 2014 23:37:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4UNbVJm046571; Fri, 30 May 2014 23:37:31 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4UNbVta046570; Fri, 30 May 2014 23:37:31 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201405302337.s4UNbVta046570@svn.freebsd.org> From: Tycho Nightingale Date: Fri, 30 May 2014 23:37:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266910 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2014 23:37:32 -0000 Author: tychon Date: Fri May 30 23:37:31 2014 New Revision: 266910 URL: http://svnweb.freebsd.org/changeset/base/266910 Log: If VMX isn't enabled so long as the lock bit isn't set yet in MSR IA32_FEATURE_CONTROL it still can be. Approved by: grehan (co-mentor) Modified: head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Fri May 30 23:28:53 2014 (r266909) +++ head/sys/amd64/vmm/intel/vmx.c Fri May 30 23:37:31 2014 (r266910) @@ -512,6 +512,15 @@ static void vmx_enable(void *arg __unused) { int error; + uint64_t feature_control; + + feature_control = rdmsr(MSR_IA32_FEATURE_CONTROL); + if ((feature_control & IA32_FEATURE_CONTROL_LOCK) == 0 || + (feature_control & IA32_FEATURE_CONTROL_VMX_EN) == 0) { + wrmsr(MSR_IA32_FEATURE_CONTROL, + feature_control | IA32_FEATURE_CONTROL_VMX_EN | + IA32_FEATURE_CONTROL_LOCK); + } load_cr4(rcr4() | CR4_VMXE); @@ -547,7 +556,7 @@ vmx_init(int ipinum) * are set (bits 0 and 2 respectively). */ feature_control = rdmsr(MSR_IA32_FEATURE_CONTROL); - if ((feature_control & IA32_FEATURE_CONTROL_LOCK) == 0 || + if ((feature_control & IA32_FEATURE_CONTROL_LOCK) == 1 && (feature_control & IA32_FEATURE_CONTROL_VMX_EN) == 0) { printf("vmx_init: VMX operation disabled by BIOS\n"); return (ENXIO); From owner-svn-src-head@FreeBSD.ORG Sat May 31 00:54:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E788903; Sat, 31 May 2014 00:54:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B768219A; Sat, 31 May 2014 00:54:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4V0sMe4082262; Sat, 31 May 2014 00:54:22 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4V0sMFP082261; Sat, 31 May 2014 00:54:22 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201405310054.s4V0sMFP082261@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 31 May 2014 00:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266912 - head/usr.bin/printf/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2014 00:54:22 -0000 Author: pfg Date: Sat May 31 00:54:21 2014 New Revision: 266912 URL: http://svnweb.freebsd.org/changeset/base/266912 Log: Fix m2 regression test. This is not really a good test as the behaviour for /c is unspecified. For the record, ksh93 returns: $ printf "abc\n\cdef" abc ef$ Discussed with: Garret D'Amore (Illumos) Modified: head/usr.bin/printf/tests/regress.m2.out Modified: head/usr.bin/printf/tests/regress.m2.out ============================================================================== --- head/usr.bin/printf/tests/regress.m2.out Sat May 31 00:40:13 2014 (r266911) +++ head/usr.bin/printf/tests/regress.m2.out Sat May 31 00:54:21 2014 (r266912) @@ -1 +1,2 @@ abc +cdef \ No newline at end of file From owner-svn-src-head@FreeBSD.ORG Sat May 31 01:00:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53D5CAD; Sat, 31 May 2014 01:00:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 283D621C8; Sat, 31 May 2014 01:00:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4V10NGu085870; Sat, 31 May 2014 01:00:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4V10NKB085869; Sat, 31 May 2014 01:00:23 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201405310100.s4V10NKB085869@svn.freebsd.org> From: Xin LI Date: Sat, 31 May 2014 01:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266915 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2014 01:00:23 -0000 Author: delphij Date: Sat May 31 01:00:22 2014 New Revision: 266915 URL: http://svnweb.freebsd.org/changeset/base/266915 Log: MFV 266913+266914: 3897 zfs filesystem and snapshot limits (fix leak) 4901 zfs filesystem/snapshot limit leaks MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Sat May 31 00:58:34 2014 (r266914) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Sat May 31 01:00:22 2014 (r266915) @@ -489,7 +489,7 @@ dsl_dir_init_fs_ss_count(dsl_dir_t *dd, zap_attribute_t *za; dsl_dataset_t *ds; - ASSERT(spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT)); + ASSERT(spa_feature_is_active(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT)); ASSERT(dsl_pool_config_held(dp)); ASSERT(dmu_tx_is_syncing(tx)); @@ -549,6 +549,7 @@ dsl_dir_init_fs_ss_count(dsl_dir_t *dd, if (za->za_name[0] != '%') my_ss_cnt++; } + zap_cursor_fini(zc); dsl_dataset_rele(ds, FTAG); @@ -1717,7 +1718,7 @@ dsl_dir_rename_check(void *arg, dmu_tx_t } if (dmu_tx_is_syncing(tx)) { - if (spa_feature_is_enabled(dp->dp_spa, + if (spa_feature_is_active(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT)) { /* * Although this is the check function and we don't @@ -1745,8 +1746,11 @@ dsl_dir_rename_check(void *arg, dmu_tx_t err = zap_lookup(os, dd->dd_object, DD_FIELD_FILESYSTEM_COUNT, sizeof (fs_cnt), 1, &fs_cnt); - if (err != ENOENT && err != 0) + if (err != ENOENT && err != 0) { + dsl_dir_rele(newparent, FTAG); + dsl_dir_rele(dd, FTAG); return (err); + } /* * have to add 1 for the filesystem itself that we're @@ -1757,8 +1761,11 @@ dsl_dir_rename_check(void *arg, dmu_tx_t err = zap_lookup(os, dd->dd_object, DD_FIELD_SNAPSHOT_COUNT, sizeof (ss_cnt), 1, &ss_cnt); - if (err != ENOENT && err != 0) + if (err != ENOENT && err != 0) { + dsl_dir_rele(newparent, FTAG); + dsl_dir_rele(dd, FTAG); return (err); + } } /* no rename into our descendant */ @@ -1809,7 +1816,7 @@ dsl_dir_rename_sync(void *arg, dmu_tx_t * We already made sure the dd counts were initialized in the * check function. */ - if (spa_feature_is_enabled(dp->dp_spa, + if (spa_feature_is_active(dp->dp_spa, SPA_FEATURE_FS_SS_LIMIT)) { VERIFY0(zap_lookup(os, dd->dd_object, DD_FIELD_FILESYSTEM_COUNT, sizeof (fs_cnt), 1, From owner-svn-src-head@FreeBSD.ORG Sat May 31 05:16:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 762ABB2C; Sat, 31 May 2014 05:16:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 495002492; Sat, 31 May 2014 05:16:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4V5GDID098980; Sat, 31 May 2014 05:16:13 GMT (envelope-from pkelsey@svn.freebsd.org) Received: (from pkelsey@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4V5GCcZ098978; Sat, 31 May 2014 05:16:12 GMT (envelope-from pkelsey@svn.freebsd.org) Message-Id: <201405310516.s4V5GCcZ098978@svn.freebsd.org> From: Patrick Kelsey Date: Sat, 31 May 2014 05:16:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266917 - in head: share/misc usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2014 05:16:13 -0000 Author: pkelsey Date: Sat May 31 05:16:12 2014 New Revision: 266917 URL: http://svnweb.freebsd.org/changeset/base/266917 Log: - Added myself and mentor/mentee relationship to the src committers graph. - Added my info to the FreeBSD calendar. Approved by: jmallett (mentor) Modified: head/share/misc/committers-src.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sat May 31 01:44:11 2014 (r266916) +++ head/share/misc/committers-src.dot Sat May 31 05:16:12 2014 (r266917) @@ -241,6 +241,7 @@ philip [label="Philip Paeps\nphilip@Free phk [label="Poul-Henning Kamp\nphk@FreeBSD.org\n1994/02/21"] pho [label="Peter Holm\npho@FreeBSD.org\n2008/11/16"] pjd [label="Pawel Jakub Dawidek\npjd@FreeBSD.org\n2004/02/02"] +pkelsey [label="Patrick Kelsey\pkelsey@FreeBSD.org\n2014/05/29"] pluknet [label="Sergey Kandaurov\npluknet@FreeBSD.org\n2010/10/05"] ps [label="Paul Saab\nps@FreeBSD.org\n2000/02/23"] qingli [label="Qing Li\nqingli@FreeBSD.org\n2005/04/13"] @@ -509,6 +510,8 @@ jkoshy -> rstone jlemon -> bmilekic jlemon -> brooks +jmallett -> pkelsey + joerg -> brian joerg -> eik joerg -> jmg Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Sat May 31 01:44:11 2014 (r266916) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sat May 31 05:16:12 2014 (r266917) @@ -143,6 +143,7 @@ 05/01 Randall Stewart born in Spokane, Washington, United States, 1959 05/02 Wojciech A. Koszek born in Czestochowa, Poland, 1987 05/03 Brian Dean born in Elkins, West Virginia, United States, 1966 +05/03 Patrick Kelsey born in Freehold, New Jersey, United States, 1976 05/03 Robert Nicholas Maxwell Watson born in Harrow, Middlesex, United Kingdom, 1977 05/04 Denis Peplin born in Nizhniy Novgorod, Russian Federation, 1977 05/08 Kirill Ponomarew born in Volgograd, Russian Federation, 1977 From owner-svn-src-head@FreeBSD.ORG Sat May 31 06:23:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 290B390D; Sat, 31 May 2014 06:23:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7397B29D8; Sat, 31 May 2014 06:17:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4V6HZGT026659; Sat, 31 May 2014 06:17:35 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4V6HZB0026657; Sat, 31 May 2014 06:17:35 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201405310617.s4V6HZB0026657@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Sat, 31 May 2014 06:17:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266919 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2014 06:23:16 -0000 Author: ganbold Date: Sat May 31 06:17:34 2014 New Revision: 266919 URL: http://svnweb.freebsd.org/changeset/base/266919 Log: Add #NO_UNIVERSE to RADXA and RADXA-LITE kernel configs since there aren't any new devices in those files so unhook them from universe build. Approved by: stas (mentor) Modified: head/sys/arm/conf/RADXA head/sys/arm/conf/RADXA-LITE Modified: head/sys/arm/conf/RADXA ============================================================================== --- head/sys/arm/conf/RADXA Sat May 31 05:59:55 2014 (r266918) +++ head/sys/arm/conf/RADXA Sat May 31 06:17:34 2014 (r266919) @@ -18,6 +18,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + include "RK3188" ident RADXA Modified: head/sys/arm/conf/RADXA-LITE ============================================================================== --- head/sys/arm/conf/RADXA-LITE Sat May 31 05:59:55 2014 (r266918) +++ head/sys/arm/conf/RADXA-LITE Sat May 31 06:17:34 2014 (r266919) @@ -18,6 +18,8 @@ # # $FreeBSD$ +#NO_UNIVERSE + include "RK3188" ident RADXA-LITE From owner-svn-src-head@FreeBSD.ORG Sat May 31 14:27:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA7F1767; Sat, 31 May 2014 14:27:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DC562DB9; Sat, 31 May 2014 14:27:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4VERo1q045190; Sat, 31 May 2014 14:27:50 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4VERoJd045189; Sat, 31 May 2014 14:27:50 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405311427.s4VERoJd045189@svn.freebsd.org> From: Luiz Otavio O Souza Date: Sat, 31 May 2014 14:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266922 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2014 14:27:50 -0000 Author: loos Date: Sat May 31 14:27:50 2014 New Revision: 266922 URL: http://svnweb.freebsd.org/changeset/base/266922 Log: Add a bounds verification to the SCL and SDA pin values. At attach, print the SCL and SDA pin numbers. Remove a stray blank line. Remove the GPIOBUS locking from gpioiic_reset(), it is already called with this lock held. This fixes a crash when you try to scan the iicbus with i2c(8). Modified: head/sys/dev/gpio/gpioiic.c Modified: head/sys/dev/gpio/gpioiic.c ============================================================================== --- head/sys/dev/gpio/gpioiic.c Sat May 31 11:08:22 2014 (r266921) +++ head/sys/dev/gpio/gpioiic.c Sat May 31 14:27:50 2014 (r266922) @@ -46,6 +46,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#include + #include #include @@ -74,7 +76,6 @@ static int gpioiic_getsda(device_t); static int gpioiic_getscl(device_t); static int gpioiic_reset(device_t, u_char, u_char, u_char *); - static int gpioiic_probe(device_t dev) { @@ -91,13 +92,15 @@ gpioiic_probe(device_t dev) static int gpioiic_attach(device_t dev) { - struct gpioiic_softc *sc = device_get_softc(dev); device_t bitbang; #ifdef FDT phandle_t node; pcell_t pin; #endif + struct gpiobus_ivar *devi; + struct gpioiic_softc *sc; + sc = device_get_softc(dev); sc->sc_dev = dev; sc->sc_busdev = device_get_parent(dev); if (resource_int_value(device_get_name(dev), @@ -116,6 +119,15 @@ gpioiic_attach(device_t dev) sc->sda_pin = (int)pin; #endif + if (sc->scl_pin < 0 || sc->scl_pin > 1) + sc->scl_pin = SCL_PIN_DEFAULT; + if (sc->sda_pin < 0 || sc->sda_pin > 1) + sc->sda_pin = SDA_PIN_DEFAULT; + + devi = GPIOBUS_IVAR(dev); + device_printf(dev, "SCL pin: %d, SDA pin: %d\n", + devi->pins[sc->scl_pin], devi->pins[sc->sda_pin]); + /* add generic bit-banging code */ bitbang = device_add_child(dev, "iicbb", -1); device_probe_and_attach(bitbang); @@ -221,16 +233,11 @@ gpioiic_getsda(device_t dev) static int gpioiic_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr) { - struct gpioiic_softc *sc = device_get_softc(dev); - - GPIOBUS_LOCK_BUS(sc->sc_busdev); - GPIOBUS_ACQUIRE_BUS(sc->sc_busdev, sc->sc_dev); + struct gpioiic_softc *sc; + sc = device_get_softc(dev); gpioiic_reset_bus(sc->sc_dev); - GPIOBUS_RELEASE_BUS(sc->sc_busdev, sc->sc_dev); - GPIOBUS_UNLOCK_BUS(sc->sc_busdev); - return (IIC_ENOADDR); } From owner-svn-src-head@FreeBSD.ORG Sat May 31 14:38:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AA80ABD; Sat, 31 May 2014 14:38:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 380782E78; Sat, 31 May 2014 14:38:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4VEc6H6049742; Sat, 31 May 2014 14:38:06 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4VEc6KF049741; Sat, 31 May 2014 14:38:06 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201405311438.s4VEc6KF049741@svn.freebsd.org> From: Luiz Otavio O Souza Date: Sat, 31 May 2014 14:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266923 - head/sys/dev/iicbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2014 14:38:06 -0000 Author: loos Date: Sat May 31 14:38:05 2014 New Revision: 266923 URL: http://svnweb.freebsd.org/changeset/base/266923 Log: Ignore IIC_ENOADDR from iicbus_reset() as it only means we have a master-only controller. This fixes the iic bus scan with i2c(8) (on supported controllers). Tested with gpioiic(4). Modified: head/sys/dev/iicbus/iic.c Modified: head/sys/dev/iicbus/iic.c ============================================================================== --- head/sys/dev/iicbus/iic.c Sat May 31 14:27:50 2014 (r266922) +++ head/sys/dev/iicbus/iic.c Sat May 31 14:38:05 2014 (r266923) @@ -322,6 +322,12 @@ iicioctl(struct cdev *dev, u_long cmd, c case I2CRSTCARD: error = iicbus_reset(parent, IIC_UNKNOWN, 0, NULL); + /* + * Ignore IIC_ENOADDR as it only means we have a master-only + * controller. + */ + if (error == IIC_ENOADDR) + error = 0; break; case I2CWRITE: From owner-svn-src-head@FreeBSD.ORG Sat May 31 14:58:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31E813E3; Sat, 31 May 2014 14:58:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 129432FDE; Sat, 31 May 2014 14:58:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4VEwrcP058830; Sat, 31 May 2014 14:58:53 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4VEwrWY058828; Sat, 31 May 2014 14:58:53 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201405311458.s4VEwrWY058828@svn.freebsd.org> From: Dmitry Chagin Date: Sat, 31 May 2014 14:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266924 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2014 14:58:54 -0000 Author: dchagin Date: Sat May 31 14:58:53 2014 New Revision: 266924 URL: http://svnweb.freebsd.org/changeset/base/266924 Log: Glibc was switched to the FUTEX_WAIT_BITSET op and CLOCK_REALTIME flag has been added instead of FUTEX_WAIT to replace the FUTEX_WAIT logic which needs to do gettimeofday() calls before the futex syscall to convert the absolute timeout to a relative timeout. Before this the CLOCK_MONOTONIC used by the FUTEX_WAIT_BITSET op. When the FUTEX_CLOCK_REALTIME is specified the timeout is an absolute time, not a relative time. Rework futex_wait to handle this. On the side fix the futex leak in error case and remove useless parentheses. Properly calculate the timeout for the CLOCK_MONOTONIC case. MFC after: 3 days Modified: head/sys/compat/linux/linux_futex.c Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Sat May 31 14:38:05 2014 (r266923) +++ head/sys/compat/linux/linux_futex.c Sat May 31 14:58:53 2014 (r266924) @@ -128,9 +128,7 @@ LIN_SDT_PROBE_DEFINE3(futex, futex_reque "struct waiting_proc *", "uint32_t"); LIN_SDT_PROBE_DEFINE1(futex, futex_requeue, return, "int"); LIN_SDT_PROBE_DEFINE4(futex, futex_wait, entry, "struct futex *", - "struct waiting_proc **", "struct l_timespec *", "uint32_t"); -LIN_SDT_PROBE_DEFINE1(futex, futex_wait, copyin_error, "int"); -LIN_SDT_PROBE_DEFINE1(futex, futex_wait, itimerfix_error, "int"); + "struct waiting_proc **", "int", "uint32_t"); LIN_SDT_PROBE_DEFINE1(futex, futex_wait, sleep_error, "int"); LIN_SDT_PROBE_DEFINE1(futex, futex_wait, return, "int"); LIN_SDT_PROBE_DEFINE3(futex, futex_atomic_op, entry, "struct thread *", @@ -144,6 +142,7 @@ LIN_SDT_PROBE_DEFINE1(futex, futex_atomi LIN_SDT_PROBE_DEFINE2(futex, linux_sys_futex, entry, "struct thread *", "struct linux_sys_futex_args *"); LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_clockswitch); +LIN_SDT_PROBE_DEFINE1(futex, linux_sys_futex, itimerfix_error, "int"); LIN_SDT_PROBE_DEFINE1(futex, linux_sys_futex, copyin_error, "int"); LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, invalid_cmp_requeue_use); LIN_SDT_PROBE_DEFINE3(futex, linux_sys_futex, debug_wait, "uint32_t *", @@ -554,15 +553,12 @@ futex_requeue(struct futex *f, int n, st } static int -futex_wait(struct futex *f, struct waiting_proc *wp, struct l_timespec *ts, +futex_wait(struct futex *f, struct waiting_proc *wp, int timeout_hz, uint32_t bitset) { - struct l_timespec timeout; - struct timeval tv; - int timeout_hz; int error; - LIN_SDT_PROBE4(futex, futex_wait, entry, f, wp, ts, bitset); + LIN_SDT_PROBE4(futex, futex_wait, entry, f, wp, timeout_hz, bitset); if (bitset == 0) { LIN_SDT_PROBE1(futex, futex_wait, return, EINVAL); @@ -570,30 +566,9 @@ futex_wait(struct futex *f, struct waiti } f->f_bitset = bitset; - - if (ts != NULL) { - error = copyin(ts, &timeout, sizeof(timeout)); - if (error) { - LIN_SDT_PROBE1(futex, futex_wait, copyin_error, error); - LIN_SDT_PROBE1(futex, futex_wait, return, error); - return (error); - } - TIMESPEC_TO_TIMEVAL(&tv, &timeout); - error = itimerfix(&tv); - if (error) { - LIN_SDT_PROBE1(futex, futex_wait, itimerfix_error, - error); - LIN_SDT_PROBE1(futex, futex_wait, return, error); - return (error); - } - timeout_hz = tvtohz(&tv); - } else - timeout_hz = 0; - error = futex_sleep(f, wp, timeout_hz); - if (error) { + if (error) LIN_SDT_PROBE1(futex, futex_wait, sleep_error, error); - } if (error == EWOULDBLOCK) error = ETIMEDOUT; @@ -683,6 +658,9 @@ linux_sys_futex(struct thread *td, struc struct linux_emuldata *em; struct waiting_proc *wp; struct futex *f, *f2; + struct l_timespec timeout; + struct timeval utv, ctv; + int timeout_hz; int error; uint32_t flags, val; @@ -756,7 +734,38 @@ linux_sys_futex(struct thread *td, struc return (EWOULDBLOCK); } - error = futex_wait(f, wp, args->timeout, args->val3); + if (args->timeout != NULL) { + error = copyin(args->timeout, &timeout, sizeof(timeout)); + if (error) { + LIN_SDT_PROBE1(futex, linux_sys_futex, copyin_error, + error); + LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); + futex_put(f, wp); + return (error); + } + TIMESPEC_TO_TIMEVAL(&utv, &timeout); + error = itimerfix(&utv); + if (error) { + LIN_SDT_PROBE1(futex, linux_sys_futex, itimerfix_error, + error); + LIN_SDT_PROBE1(futex, linux_sys_futex, return, error); + futex_put(f, wp); + return (error); + } + if (clockrt) { + microtime(&ctv); + timevalsub(&utv, &ctv); + } else if (args->op == LINUX_FUTEX_WAIT_BITSET) { + microuptime(&ctv); + timevalsub(&utv, &ctv); + } + if (utv.tv_sec < 0) + timevalclear(&utv); + timeout_hz = tvtohz(&utv); + } else + timeout_hz = 0; + + error = futex_wait(f, wp, timeout_hz, args->val3); break; case LINUX_FUTEX_WAKE: From owner-svn-src-head@FreeBSD.ORG Sat May 31 15:01:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0D0874C; Sat, 31 May 2014 15:01:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD6A7206D; Sat, 31 May 2014 15:01:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4VF1qYa062557; Sat, 31 May 2014 15:01:52 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4VF1pR8062552; Sat, 31 May 2014 15:01:51 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201405311501.s4VF1pR8062552@svn.freebsd.org> From: Dmitry Chagin Date: Sat, 31 May 2014 15:01:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266925 - in head/sys: amd64/linux32 i386/linux kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2014 15:01:52 -0000 Author: dchagin Date: Sat May 31 15:01:51 2014 New Revision: 266925 URL: http://svnweb.freebsd.org/changeset/base/266925 Log: To allow to run the interpreter itself add a new ELF branding type. Allow Linux ABI to run ELF interpreter. MFC after: 3 days Modified: head/sys/amd64/linux32/linux32_sysvec.c head/sys/i386/linux/linux_sysvec.c head/sys/kern/imgact_elf.c head/sys/sys/imgact_elf.h Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Sat May 31 14:58:53 2014 (r266924) +++ head/sys/amd64/linux32/linux32_sysvec.c Sat May 31 15:01:51 2014 (r266925) @@ -1083,7 +1083,7 @@ static Elf32_Brandinfo linux_brand = { .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux32_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE | BI_CAN_EXEC_INTERP }; static Elf32_Brandinfo linux_glibc2brand = { @@ -1095,7 +1095,7 @@ static Elf32_Brandinfo linux_glibc2brand .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux32_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE | BI_CAN_EXEC_INTERP }; Elf32_Brandinfo *linux_brandlist[] = { Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Sat May 31 14:58:53 2014 (r266924) +++ head/sys/i386/linux/linux_sysvec.c Sat May 31 15:01:51 2014 (r266925) @@ -1058,7 +1058,7 @@ static Elf32_Brandinfo linux_brand = { .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE | BI_CAN_EXEC_INTERP }; static Elf32_Brandinfo linux_glibc2brand = { @@ -1070,7 +1070,7 @@ static Elf32_Brandinfo linux_glibc2brand .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux_brandnote, - .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE | BI_CAN_EXEC_INTERP }; Elf32_Brandinfo *linux_brandlist[] = { Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sat May 31 14:58:53 2014 (r266924) +++ head/sys/kern/imgact_elf.c Sat May 31 15:01:51 2014 (r266925) @@ -261,6 +261,8 @@ __elfN(get_brandinfo)(struct image_param { const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header; Elf_Brandinfo *bi; + const char *fname_name, *interp_brand_name; + int fname_len, interp_len; boolean_t ret; int i; @@ -311,6 +313,33 @@ __elfN(get_brandinfo)(struct image_param } } + /* Some ABI allows to run the interpreter itself. */ + for (i = 0; i < MAX_BRANDS; i++) { + bi = elf_brand_list[i]; + if (bi == NULL || bi->flags & BI_BRAND_NOTE_MANDATORY) + continue; + if (hdr->e_machine != bi->machine || + (bi->flags & BI_CAN_EXEC_INTERP) == 0) + continue; + /* + * Compare the interpreter name not the path to allow run it + * from everywhere. + */ + interp_brand_name = strrchr(bi->interp_path, '/'); + if (interp_brand_name == NULL) + interp_brand_name = bi->interp_path; + interp_len = strlen(interp_brand_name); + fname_name = strrchr(imgp->args->fname, '/'); + if (fname_name == NULL) + fname_name = imgp->args->fname; + fname_len = strlen(fname_name); + if (fname_len < interp_len) + continue; + ret = strncmp(fname_name, interp_brand_name, interp_len); + if (ret == 0) + return (bi); + } + /* Lacking a recognized interpreter, try the default brand */ for (i = 0; i < MAX_BRANDS; i++) { bi = elf_brand_list[i]; Modified: head/sys/sys/imgact_elf.h ============================================================================== --- head/sys/sys/imgact_elf.h Sat May 31 14:58:53 2014 (r266924) +++ head/sys/sys/imgact_elf.h Sat May 31 15:01:51 2014 (r266925) @@ -77,6 +77,7 @@ typedef struct { #define BI_CAN_EXEC_DYN 0x0001 #define BI_BRAND_NOTE 0x0002 /* May have note.ABI-tag section. */ #define BI_BRAND_NOTE_MANDATORY 0x0004 /* Must have note.ABI-tag section. */ +#define BI_CAN_EXEC_INTERP 0x0008 /* Allow to run interpreter itself. */ } __ElfN(Brandinfo); __ElfType(Auxargs); From owner-svn-src-head@FreeBSD.ORG Sat May 31 20:26:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C81D8C0; Sat, 31 May 2014 20:26:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5E502A49; Sat, 31 May 2014 20:26:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4VKQYw4008531; Sat, 31 May 2014 20:26:34 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4VKQY4p008530; Sat, 31 May 2014 20:26:34 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201405312026.s4VKQY4p008530@svn.freebsd.org> From: John-Mark Gurney Date: Sat, 31 May 2014 20:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266930 - head/usr.sbin/makefs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2014 20:26:34 -0000 Author: jmg Date: Sat May 31 20:26:34 2014 New Revision: 266930 URL: http://svnweb.freebsd.org/changeset/base/266930 Log: convert to using the _daddr_t types like newfs was... Put the superblock in the correct possition for UFS2... There is a bug in FFS that if we don't put it here (for UFS2), it will forcefully relocate the superblock, and I believe cause data loss.. I have a fix for that, but w/ how many releases are broken, we won't be able to switch to the better _FLOPPY (block 0) for this for a while.. Modified: head/usr.sbin/makefs/ffs/mkfs.c Modified: head/usr.sbin/makefs/ffs/mkfs.c ============================================================================== --- head/usr.sbin/makefs/ffs/mkfs.c Sat May 31 16:22:58 2014 (r266929) +++ head/usr.sbin/makefs/ffs/mkfs.c Sat May 31 20:26:34 2014 (r266930) @@ -253,10 +253,10 @@ ffs_mkfs(const char *fsys, const fsinfo_ if (Oflag <= 1) { sblock.fs_magic = FS_UFS1_MAGIC; sblock.fs_sblockloc = SBLOCK_UFS1; - sblock.fs_nindir = sblock.fs_bsize / sizeof(int32_t); + sblock.fs_nindir = sblock.fs_bsize / sizeof(ufs1_daddr_t); sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs1_dinode); sblock.fs_maxsymlinklen = ((NDADDR + NIADDR) * - sizeof (int32_t)); + sizeof (ufs1_daddr_t)); sblock.fs_old_inodefmt = FS_44INODEFMT; sblock.fs_old_cgoffset = 0; sblock.fs_old_cgmask = 0xffffffff; @@ -272,15 +272,11 @@ ffs_mkfs(const char *fsys, const fsinfo_ sblock.fs_old_nrpos = 1; } else { sblock.fs_magic = FS_UFS2_MAGIC; -#if 0 /* XXX makefs is used for small filesystems. */ sblock.fs_sblockloc = SBLOCK_UFS2; -#else - sblock.fs_sblockloc = SBLOCK_UFS1; -#endif - sblock.fs_nindir = sblock.fs_bsize / sizeof(int64_t); + sblock.fs_nindir = sblock.fs_bsize / sizeof(ufs2_daddr_t); sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs2_dinode); sblock.fs_maxsymlinklen = ((NDADDR + NIADDR) * - sizeof (int64_t)); + sizeof (ufs2_daddr_t)); } sblock.fs_sblkno = From owner-svn-src-head@FreeBSD.ORG Sat May 31 21:12:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E1109DA; Sat, 31 May 2014 21:12:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BB062E27; Sat, 31 May 2014 21:12:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4VLCF4G030871; Sat, 31 May 2014 21:12:15 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4VLCFFu030870; Sat, 31 May 2014 21:12:15 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201405312112.s4VLCFFu030870@svn.freebsd.org> From: Christian Brueffer Date: Sat, 31 May 2014 21:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266931 - head/usr.sbin/bsnmpd/modules/snmp_hast X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2014 21:12:15 -0000 Author: brueffer Date: Sat May 31 21:12:14 2014 New Revision: 266931 URL: http://svnweb.freebsd.org/changeset/base/266931 Log: Grammar cleanup; sort SEE ALSO. MFC after: 1 week Modified: head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 Modified: head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 Sat May 31 20:26:34 2014 (r266930) +++ head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 Sat May 31 21:12:14 2014 (r266931) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 9, 2013 +.Dd May 31, 2014 .Dt SNMP_HAST 3 .Os .Sh NAME @@ -40,11 +40,12 @@ The module implements a private BEGEMOT-HAST-MIB, which allows management of HAST resources. .Pp -The module uses +The module uses the .Xr hastd 8 control socket to communicate with the daemon. +The .Va hastConfigFile -variable can be used to specify the location of +variable can be used to specify the location of the .Xr hast.conf 5 file to find the address of the control connection. .Sh FILES @@ -62,8 +63,8 @@ configuration file. .Sh SEE ALSO .Xr bsnmpd 1 , .Xr gensnmptree 1 , +.Xr snmpmod 3 , .Xr hastctl 8 , -.Xr hastd 8 , -.Xr snmpmod 3 +.Xr hastd 8 .Sh AUTHORS .An Mikolaj Golub Aq trociny@FreeBSD.org From owner-svn-src-head@FreeBSD.ORG Sat May 31 22:25:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99CE1702; Sat, 31 May 2014 22:25:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 871E82382; Sat, 31 May 2014 22:25:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4VMPkB9062417; Sat, 31 May 2014 22:25:46 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4VMPk8t062416; Sat, 31 May 2014 22:25:46 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201405312225.s4VMPk8t062416@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 31 May 2014 22:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266932 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2014 22:25:46 -0000 Author: jilles Date: Sat May 31 22:25:45 2014 New Revision: 266932 URL: http://svnweb.freebsd.org/changeset/base/266932 Log: sh: Simplify find_command() slightly. Modified: head/bin/sh/exec.c Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Sat May 31 21:12:14 2014 (r266931) +++ head/bin/sh/exec.c Sat May 31 22:25:45 2014 (r266932) @@ -362,15 +362,13 @@ find_command(const char *name, struct cm e = ENOENT; idx = -1; -loop: - while ((fullname = padvance(&path, name)) != NULL) { - stunalloc(fullname); + for (;(fullname = padvance(&path, name)) != NULL; stunalloc(fullname)) { idx++; if (pathopt) { if (prefix("func", pathopt)) { /* handled below */ } else { - goto loop; /* ignore unimplemented options */ + continue; /* ignore unimplemented options */ } } if (fullname[0] != '/') @@ -378,13 +376,12 @@ loop: if (stat(fullname, &statb) < 0) { if (errno != ENOENT && errno != ENOTDIR) e = errno; - goto loop; + continue; } e = EACCES; /* if we fail, this will be the error */ if (!S_ISREG(statb.st_mode)) - goto loop; + continue; if (pathopt) { /* this is a %func directory */ - stalloc(strlen(fullname) + 1); readcmdfile(fullname); if ((cmdp = cmdlookup(name, 0)) == NULL || cmdp->cmdtype != CMDFUNCTION) error("%s not defined in %s", name, fullname); @@ -405,6 +402,7 @@ loop: #endif TRACE(("searchexec \"%s\" returns \"%s\"\n", name, fullname)); INTOFF; + stunalloc(fullname); cmdp = cmdlookup(name, 1); if (cmdp->cmdtype == CMDFUNCTION) cmdp = &loc_cmd; From owner-svn-src-head@FreeBSD.ORG Sat May 31 23:37:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7E991B6; Sat, 31 May 2014 23:37:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87BD62823; Sat, 31 May 2014 23:37:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4VNbawQ093704; Sat, 31 May 2014 23:37:36 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4VNbY0X093693; Sat, 31 May 2014 23:37:34 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201405312337.s4VNbY0X093693@svn.freebsd.org> From: Neel Natu Date: Sat, 31 May 2014 23:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266933 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/io usr.sbin/bhyve usr.sbin/bhyvectl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 May 2014 23:37:36 -0000 Author: neel Date: Sat May 31 23:37:34 2014 New Revision: 266933 URL: http://svnweb.freebsd.org/changeset/base/266933 Log: Activate vcpus from bhyve(8) using the ioctl VM_ACTIVATE_CPU instead of doing it implicitly in vmm.ko. Add ioctl VM_GET_CPUS to get the current set of 'active' and 'suspended' cpus and display them via /usr/sbin/bhyvectl using the "--get-active-cpus" and "--get-suspended-cpus" options. This is in preparation for being able to reset virtual machine state without having to destroy and recreate it. Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_dev.c head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/pci_lpc.c head/usr.sbin/bhyvectl/bhyvectl.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Sat May 31 22:25:45 2014 (r266932) +++ head/lib/libvmmapi/vmmapi.c Sat May 31 23:37:34 2014 (r266933) @@ -29,11 +29,12 @@ #include __FBSDID("$FreeBSD$"); -#include +#include #include #include #include #include +#include #include #include @@ -1043,3 +1044,44 @@ vm_copyout(struct vmctx *ctx, int vcpu, len -= n; } } + +static int +vm_get_cpus(struct vmctx *ctx, int which, cpuset_t *cpus) +{ + struct vm_cpuset vm_cpuset; + int error; + + bzero(&vm_cpuset, sizeof(struct vm_cpuset)); + vm_cpuset.which = which; + vm_cpuset.cpusetsize = sizeof(cpuset_t); + vm_cpuset.cpus = cpus; + + error = ioctl(ctx->fd, VM_GET_CPUS, &vm_cpuset); + return (error); +} + +int +vm_active_cpus(struct vmctx *ctx, cpuset_t *cpus) +{ + + return (vm_get_cpus(ctx, VM_ACTIVE_CPUS, cpus)); +} + +int +vm_suspended_cpus(struct vmctx *ctx, cpuset_t *cpus) +{ + + return (vm_get_cpus(ctx, VM_SUSPENDED_CPUS, cpus)); +} + +int +vm_activate_cpu(struct vmctx *ctx, int vcpu) +{ + struct vm_activate_cpu ac; + int error; + + bzero(&ac, sizeof(struct vm_activate_cpu)); + ac.vcpuid = vcpu; + error = ioctl(ctx->fd, VM_ACTIVATE_CPU, &ac); + return (error); +} Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Sat May 31 22:25:45 2014 (r266932) +++ head/lib/libvmmapi/vmmapi.h Sat May 31 23:37:34 2014 (r266933) @@ -29,6 +29,9 @@ #ifndef _VMMAPI_H_ #define _VMMAPI_H_ +#include +#include + struct iovec; struct vmctx; enum x2apic_state; @@ -125,6 +128,10 @@ void vm_copyout(struct vmctx *ctx, int v /* Reset vcpu register state */ int vcpu_reset(struct vmctx *ctx, int vcpu); +int vm_active_cpus(struct vmctx *ctx, cpuset_t *cpus); +int vm_suspended_cpus(struct vmctx *ctx, cpuset_t *cpus); +int vm_activate_cpu(struct vmctx *ctx, int vcpu); + /* * FreeBSD specific APIs */ Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Sat May 31 22:25:45 2014 (r266932) +++ head/sys/amd64/include/vmm.h Sat May 31 23:37:34 2014 (r266933) @@ -140,8 +140,9 @@ int vm_set_capability(struct vm *vm, int int vm_get_x2apic_state(struct vm *vm, int vcpu, enum x2apic_state *state); int vm_set_x2apic_state(struct vm *vm, int vcpu, enum x2apic_state state); int vm_apicid2vcpuid(struct vm *vm, int apicid); -void vm_activate_cpu(struct vm *vm, int vcpu); +int vm_activate_cpu(struct vm *vm, int vcpu); cpuset_t vm_active_cpus(struct vm *vm); +cpuset_t vm_suspended_cpus(struct vm *vm); struct vm_exit *vm_exitinfo(struct vm *vm, int vcpuid); void vm_exit_suspended(struct vm *vm, int vcpuid, uint64_t rip); Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Sat May 31 22:25:45 2014 (r266932) +++ head/sys/amd64/include/vmm_dev.h Sat May 31 23:37:34 2014 (r266933) @@ -177,6 +177,18 @@ struct vm_gla2gpa { uint64_t gpa; }; +struct vm_activate_cpu { + int vcpuid; +}; + +struct vm_cpuset { + int which; + int cpusetsize; + cpuset_t *cpus; +}; +#define VM_ACTIVE_CPUS 0 +#define VM_SUSPENDED_CPUS 1 + enum { /* general routines */ IOCNUM_ABIVERS = 0, @@ -229,6 +241,10 @@ enum { IOCNUM_ISA_DEASSERT_IRQ = 81, IOCNUM_ISA_PULSE_IRQ = 82, IOCNUM_ISA_SET_IRQ_TRIGGER = 83, + + /* vm_cpuset */ + IOCNUM_ACTIVATE_CPU = 90, + IOCNUM_GET_CPUSET = 91, }; #define VM_RUN \ @@ -301,4 +317,8 @@ enum { _IOWR('v', IOCNUM_GET_GPA_PMAP, struct vm_gpa_pte) #define VM_GLA2GPA \ _IOWR('v', IOCNUM_GLA2GPA, struct vm_gla2gpa) +#define VM_ACTIVATE_CPU \ + _IOW('v', IOCNUM_ACTIVATE_CPU, struct vm_activate_cpu) +#define VM_GET_CPUS \ + _IOW('v', IOCNUM_GET_CPUSET, struct vm_cpuset) #endif Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Sat May 31 22:25:45 2014 (r266932) +++ head/sys/amd64/vmm/io/vlapic.c Sat May 31 23:37:34 2014 (r266933) @@ -1004,11 +1004,7 @@ vlapic_icrlo_write_handler(struct vlapic if (vlapic2->boot_state != BS_SIPI) return (0); - /* - * XXX this assumes that the startup IPI always succeeds - */ vlapic2->boot_state = BS_RUNNING; - vm_activate_cpu(vlapic2->vm, dest); *retu = true; vmexit = vm_exitinfo(vlapic->vm, vlapic->vcpuid); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Sat May 31 22:25:45 2014 (r266932) +++ head/sys/amd64/vmm/vmm.c Sat May 31 23:37:34 2014 (r266933) @@ -342,8 +342,6 @@ vm_create(const char *name, struct vm ** struct vm *vm; struct vmspace *vmspace; - const int BSP = 0; - /* * If vmm.ko could not be successfully initialized then don't attempt * to create the virtual machine. @@ -373,8 +371,6 @@ vm_create(const char *name, struct vm ** guest_msrs_init(vm, i); } - vm_activate_cpu(vm, BSP); - *retvm = vm; return (0); } @@ -1294,6 +1290,12 @@ vm_run(struct vm *vm, struct vm_run *vmr if (vcpuid < 0 || vcpuid >= VM_MAXCPU) return (EINVAL); + if (!CPU_ISSET(vcpuid, &vm->active_cpus)) + return (EINVAL); + + if (CPU_ISSET(vcpuid, &vm->suspended_cpus)) + return (EINVAL); + rptr = &vm->rendezvous_func; sptr = &vm->suspend; pmap = vmspace_pmap(vm->vmspace); @@ -1708,17 +1710,19 @@ vcpu_get_state(struct vm *vm, int vcpuid return (state); } -void +int vm_activate_cpu(struct vm *vm, int vcpuid) { - KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, - ("vm_activate_cpu: invalid vcpuid %d", vcpuid)); - KASSERT(!CPU_ISSET(vcpuid, &vm->active_cpus), - ("vm_activate_cpu: vcpuid %d is already active", vcpuid)); + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + return (EINVAL); + + if (CPU_ISSET(vcpuid, &vm->active_cpus)) + return (EBUSY); VCPU_CTR0(vm, vcpuid, "activated"); CPU_SET_ATOMIC(vcpuid, &vm->active_cpus); + return (0); } cpuset_t @@ -1728,6 +1732,13 @@ vm_active_cpus(struct vm *vm) return (vm->active_cpus); } +cpuset_t +vm_suspended_cpus(struct vm *vm) +{ + + return (vm->suspended_cpus); +} + void * vcpu_stats(struct vm *vm, int vcpuid) { Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Sat May 31 22:25:45 2014 (r266932) +++ head/sys/amd64/vmm/vmm_dev.c Sat May 31 23:37:34 2014 (r266933) @@ -146,7 +146,8 @@ static int vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, struct thread *td) { - int error, vcpu, state_changed; + int error, vcpu, state_changed, size; + cpuset_t *cpuset; struct vmmdev_softc *sc; struct vm_memory_segment *seg; struct vm_register *vmreg; @@ -170,6 +171,8 @@ vmmdev_ioctl(struct cdev *cdev, u_long c struct vm_gpa_pte *gpapte; struct vm_suspend *vmsuspend; struct vm_gla2gpa *gg; + struct vm_activate_cpu *vac; + struct vm_cpuset *vm_cpuset; sc = vmmdev_lookup2(cdev); if (sc == NULL) @@ -195,6 +198,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c case VM_PPTDEV_MSIX: case VM_SET_X2APIC_STATE: case VM_GLA2GPA: + case VM_ACTIVATE_CPU: /* * XXX fragile, handle with care * Assumes that the first field of the ioctl data is the vcpu. @@ -439,6 +443,29 @@ vmmdev_ioctl(struct cdev *cdev, u_long c } break; } + case VM_ACTIVATE_CPU: + vac = (struct vm_activate_cpu *)data; + error = vm_activate_cpu(sc->vm, vac->vcpuid); + break; + case VM_GET_CPUS: + error = 0; + vm_cpuset = (struct vm_cpuset *)data; + size = vm_cpuset->cpusetsize; + if (size < sizeof(cpuset_t) || size > CPU_MAXSIZE / NBBY) { + error = ERANGE; + break; + } + cpuset = malloc(size, M_TEMP, M_WAITOK | M_ZERO); + if (vm_cpuset->which == VM_ACTIVE_CPUS) + *cpuset = vm_active_cpus(sc->vm); + else if (vm_cpuset->which == VM_SUSPENDED_CPUS) + *cpuset = vm_suspended_cpus(sc->vm); + else + error = EINVAL; + if (error == 0) + error = copyout(cpuset, vm_cpuset->cpus, size); + free(cpuset, M_TEMP); + break; default: error = ENOTTY; break; Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Sat May 31 22:25:45 2014 (r266932) +++ head/usr.sbin/bhyve/bhyverun.c Sat May 31 23:37:34 2014 (r266933) @@ -242,6 +242,15 @@ fbsdrun_addcpu(struct vmctx *ctx, int fr assert(fromcpu == BSP); + /* + * The 'newcpu' must be activated in the context of 'fromcpu'. If + * vm_activate_cpu() is delayed until newcpu's pthread starts running + * then vmm.ko is out-of-sync with bhyve and this can create a race + * with vm_suspend(). + */ + error = vm_activate_cpu(ctx, newcpu); + assert(error == 0); + CPU_SET_ATOMIC(newcpu, &cpumask); /* @@ -532,6 +541,7 @@ vm_loop(struct vmctx *ctx, int vcpu, uin int error, rc, prevcpu; enum vm_exitcode exitcode; enum vm_suspend_how how; + cpuset_t active_cpus; if (vcpumap[vcpu] != NULL) { error = pthread_setaffinity_np(pthread_self(), @@ -539,6 +549,9 @@ vm_loop(struct vmctx *ctx, int vcpu, uin assert(error == 0); } + error = vm_active_cpus(ctx, &active_cpus); + assert(CPU_ISSET(vcpu, &active_cpus)); + while (1) { error = vm_run(ctx, vcpu, rip, &vmexit[vcpu]); if (error != 0) Modified: head/usr.sbin/bhyve/pci_lpc.c ============================================================================== --- head/usr.sbin/bhyve/pci_lpc.c Sat May 31 22:25:45 2014 (r266932) +++ head/usr.sbin/bhyve/pci_lpc.c Sat May 31 23:37:34 2014 (r266933) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- head/usr.sbin/bhyvectl/bhyvectl.c Sat May 31 22:25:45 2014 (r266932) +++ head/usr.sbin/bhyvectl/bhyvectl.c Sat May 31 23:37:34 2014 (r266933) @@ -193,7 +193,9 @@ usage(void) " [--assert-lapic-lvt=]\n" " [--inject-nmi]\n" " [--force-reset]\n" - " [--force-poweroff]\n", + " [--force-poweroff]\n" + " [--get-active-cpus]\n" + " [--get-suspended-cpus]\n", progname); exit(1); } @@ -203,6 +205,7 @@ static int inject_nmi, assert_lapic_lvt; static int force_reset, force_poweroff; static const char *capname; static int create, destroy, get_lowmem, get_highmem; +static int get_active_cpus, get_suspended_cpus; static uint64_t memsize; static int set_cr0, get_cr0, set_cr3, get_cr3, set_cr4, get_cr4; static int set_efer, get_efer; @@ -390,6 +393,25 @@ enum { ASSERT_LAPIC_LVT, }; +static void +print_cpus(const char *banner, const cpuset_t *cpus) +{ + int i, first; + + first = 1; + printf("%s:\t", banner); + if (!CPU_EMPTY(cpus)) { + for (i = 0; i < CPU_SETSIZE; i++) { + if (CPU_ISSET(i, cpus)) { + printf("%s%d", first ? " " : ", ", i); + first = 0; + } + } + } else + printf(" (none)"); + printf("\n"); +} + int main(int argc, char *argv[]) { @@ -401,6 +423,7 @@ main(int argc, char *argv[]) uint64_t ctl, eptp, bm, addr, u64, pteval[4], *pte; struct vmctx *ctx; int wired; + cpuset_t cpus; uint64_t cr0, cr3, cr4, dr7, rsp, rip, rflags, efer, pat; uint64_t rax, rbx, rcx, rdx, rsi, rdi, rbp; @@ -570,6 +593,8 @@ main(int argc, char *argv[]) { "inject-nmi", NO_ARG, &inject_nmi, 1 }, { "force-reset", NO_ARG, &force_reset, 1 }, { "force-poweroff", NO_ARG, &force_poweroff, 1 }, + { "get-active-cpus", NO_ARG, &get_active_cpus, 1 }, + { "get-suspended-cpus", NO_ARG, &get_suspended_cpus, 1 }, { NULL, 0, NULL, 0 } }; @@ -1529,6 +1554,18 @@ main(int argc, char *argv[]) } } + if (!error && (get_active_cpus || get_all)) { + error = vm_active_cpus(ctx, &cpus); + if (!error) + print_cpus("active cpus", &cpus); + } + + if (!error && (get_suspended_cpus || get_all)) { + error = vm_suspended_cpus(ctx, &cpus); + if (!error) + print_cpus("suspended cpus", &cpus); + } + if (!error && run) { error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RIP, &rip); assert(error == 0); From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 02:13:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18E1C90A; Sun, 1 Jun 2014 02:13:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEA65227E; Sun, 1 Jun 2014 02:13:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s512D7tb064312; Sun, 1 Jun 2014 02:13:07 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s512D7Z6064311; Sun, 1 Jun 2014 02:13:07 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201406010213.s512D7Z6064311@svn.freebsd.org> From: Neel Natu Date: Sun, 1 Jun 2014 02:13:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266934 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 02:13:08 -0000 Author: neel Date: Sun Jun 1 02:13:07 2014 New Revision: 266934 URL: http://svnweb.freebsd.org/changeset/base/266934 Log: Limit the maximum number of back-to-back iterations of a "rep; ins/outs" to 16. This is arbitrary and is used to ensure that a vcpu goes back into the vm_run() loop to process interrupts or rendezvous events in a timely fashion. Found with: Coverity Scan CID: 1216436 Modified: head/usr.sbin/bhyve/inout.c Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Sat May 31 23:37:34 2014 (r266933) +++ head/usr.sbin/bhyve/inout.c Sun Jun 1 02:13:07 2014 (r266934) @@ -55,6 +55,10 @@ SET_DECLARE(inout_port_set, struct inout #define VERIFY_IOPORT(port, size) \ assert((port) >= 0 && (size) > 0 && ((port) + (size)) <= MAX_IOPORTS) +#ifndef min +#define min(a, b) ((a) < (b) ? (a) : (b)) +#endif + static struct { const char *name; int flags; @@ -109,7 +113,7 @@ emulate_inout(struct vmctx *ctx, int vcp void *arg; int error, retval; enum vm_reg_name idxreg; - uint64_t gla, index, count; + uint64_t gla, index, iterations, count; struct vm_inout_str *vis; struct iovec iov[2]; @@ -151,14 +155,17 @@ emulate_inout(struct vmctx *ctx, int vcp /* Count register */ count = vis->count & vie_size2mask(addrsize); - while (count) { + /* Limit number of back-to-back in/out emulations to 16 */ + iterations = min(count, 16); + while (iterations > 0) { if (vie_calculate_gla(vis->paging.cpu_mode, vis->seg_name, &vis->seg_desc, index, bytes, addrsize, prot, &gla)) { error = vm_inject_exception2(ctx, vcpu, IDT_GP, 0); assert(error == 0); - return (INOUT_RESTART); + retval = INOUT_RESTART; + break; } error = vm_gla2gpa(ctx, vcpu, &vis->paging, gla, bytes, @@ -196,6 +203,7 @@ emulate_inout(struct vmctx *ctx, int vcp index += bytes; count--; + iterations--; } /* Update index register */ From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 02:47:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C68494; Sun, 1 Jun 2014 02:47:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4943F24B2; Sun, 1 Jun 2014 02:47:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s512lAuP077974; Sun, 1 Jun 2014 02:47:10 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s512l9wN077972; Sun, 1 Jun 2014 02:47:09 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201406010247.s512l9wN077972@svn.freebsd.org> From: Neel Natu Date: Sun, 1 Jun 2014 02:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266935 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 02:47:10 -0000 Author: neel Date: Sun Jun 1 02:47:09 2014 New Revision: 266935 URL: http://svnweb.freebsd.org/changeset/base/266935 Log: Use MIN(a,b) from instead of rolling our own version. Pointed out by: grehan Modified: head/usr.sbin/bhyve/inout.c head/usr.sbin/bhyve/pci_virtio_block.c Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Sun Jun 1 02:13:07 2014 (r266934) +++ head/usr.sbin/bhyve/inout.c Sun Jun 1 02:47:09 2014 (r266935) @@ -55,10 +55,6 @@ SET_DECLARE(inout_port_set, struct inout #define VERIFY_IOPORT(port, size) \ assert((port) >= 0 && (size) > 0 && ((port) + (size)) <= MAX_IOPORTS) -#ifndef min -#define min(a, b) ((a) < (b) ? (a) : (b)) -#endif - static struct { const char *name; int flags; @@ -156,7 +152,7 @@ emulate_inout(struct vmctx *ctx, int vcp count = vis->count & vie_size2mask(addrsize); /* Limit number of back-to-back in/out emulations to 16 */ - iterations = min(count, 16); + iterations = MIN(count, 16); while (iterations > 0) { if (vie_calculate_gla(vis->paging.cpu_mode, vis->seg_name, &vis->seg_desc, index, bytes, Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Sun Jun 1 02:13:07 2014 (r266934) +++ head/usr.sbin/bhyve/pci_virtio_block.c Sun Jun 1 02:47:09 2014 (r266935) @@ -52,10 +52,6 @@ __FBSDID("$FreeBSD$"); #include "pci_emul.h" #include "virtio.h" -#ifndef min -#define min(a, b) ((a) < (b) ? (a) : (b)) -#endif - #define VTBLK_RINGSZ 64 #define VTBLK_MAXSEGS 32 @@ -217,7 +213,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *s case VBH_OP_IDENT: /* Assume a single buffer */ strlcpy(iov[1].iov_base, sc->vbsc_ident, - min(iov[1].iov_len, sizeof(sc->vbsc_ident))); + MIN(iov[1].iov_len, sizeof(sc->vbsc_ident))); err = 0; break; default: From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 03:14:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1DF1062A; Sun, 1 Jun 2014 03:14:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0904F2779; Sun, 1 Jun 2014 03:14:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s513E4sa092099; Sun, 1 Jun 2014 03:14:04 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s513E3DB092086; Sun, 1 Jun 2014 03:14:03 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201406010314.s513E3DB092086@svn.freebsd.org> From: Luiz Otavio O Souza Date: Sun, 1 Jun 2014 03:14:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266936 - in head: etc usr.sbin/bsnmpd/modules usr.sbin/bsnmpd/modules/snmp_lm75 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 03:14:05 -0000 Author: loos Date: Sun Jun 1 03:14:03 2014 New Revision: 266936 URL: http://svnweb.freebsd.org/changeset/base/266936 Log: Adds the bsnmp module to export the temperature data from lm75 sensors on the system. Together with lm75(4) this module allows easy temperature monitoring over SNMP, specially for embedded systems. Manual page reviewed by: brueffer (D128) Added: head/usr.sbin/bsnmpd/modules/snmp_lm75/ head/usr.sbin/bsnmpd/modules/snmp_lm75/BEGEMOT-LM75-MIB.txt (contents, props changed) head/usr.sbin/bsnmpd/modules/snmp_lm75/Makefile (contents, props changed) head/usr.sbin/bsnmpd/modules/snmp_lm75/lm75_tree.def (contents, props changed) head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.3 (contents, props changed) head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.c (contents, props changed) Modified: head/etc/snmpd.config head/usr.sbin/bsnmpd/modules/Makefile Modified: head/etc/snmpd.config ============================================================================== --- head/etc/snmpd.config Sun Jun 1 02:47:09 2014 (r266935) +++ head/etc/snmpd.config Sun Jun 1 03:14:03 2014 (r266936) @@ -279,6 +279,11 @@ begemotSnmpdModulePath."mibII" = "/usr/l #begemotNgControlNodeName = "snmpd" # +# LM75 Sensor module +# +#begemotSnmpdModulePath."lm75" = "/usr/lib/snmp_lm75.so" + +# # pf(4) module # #begemotSnmpdModulePath."pf" = "/usr/lib/snmp_pf.so" Modified: head/usr.sbin/bsnmpd/modules/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/Makefile Sun Jun 1 02:47:09 2014 (r266935) +++ head/usr.sbin/bsnmpd/modules/Makefile Sun Jun 1 03:14:03 2014 (r266936) @@ -12,6 +12,7 @@ SUBDIR= ${_snmp_atm} \ snmp_bridge \ snmp_hast \ snmp_hostres \ + snmp_lm75 \ snmp_mibII \ snmp_target \ snmp_usm \ Added: head/usr.sbin/bsnmpd/modules/snmp_lm75/BEGEMOT-LM75-MIB.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsnmpd/modules/snmp_lm75/BEGEMOT-LM75-MIB.txt Sun Jun 1 03:14:03 2014 (r266936) @@ -0,0 +1,160 @@ +-- +-- Copyright (c) 2014 Luiz Otavio O Souza +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions +-- are met: +-- 1. Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- 2. Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- +-- THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +-- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +-- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +-- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +-- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +-- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +-- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +-- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +-- SUCH DAMAGE. +-- +-- $FreeBSD$ +-- + +BEGEMOT-LM75-MIB DEFINITIONS ::= BEGIN + +IMPORTS + MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE, + Counter64, Integer32 + FROM SNMPv2-SMI + TEXTUAL-CONVENTION, RowStatus + FROM SNMPv2-TC + begemot + FROM BEGEMOT-MIB; + +begemotLoos MODULE-IDENTITY + LAST-UPDATED "201402240000Z" + ORGANIZATION "FreeBSD" + CONTACT-INFO + " Luiz Otavio O Souza + + Postal: N/A + + Fax: N/A + + E-Mail: loos@FreeBSD.org" + DESCRIPTION + "The Begemot MIB for reading lm75 sensors data." + REVISION "201402240000Z" + DESCRIPTION + "Initial revision." + ::= { begemot 400 } + +begemotLm75Objects OBJECT IDENTIFIER ::= { begemotLm75 1 } + +-- ---------------------------------------------------------- -- +-- Configuration parameters +-- ---------------------------------------------------------- -- + +lm75Sensor OBJECT IDENTIFIER ::= { begemotlm75Objects 1 } + +lm75Sensors OBJECT-TYPE + SYNTAX Integer32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Number of LM75 sensors in the system." + ::= { lm75Sensors 1 } + +-- ---------------------------------------------------------- -- +-- TempSensor Table +-- ---------------------------------------------------------- -- +lm75SensorTable OBJECT-TYPE + SYNTAX SEQUENCE OF Lm75SensorEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "A table containing information about all temperature sensors." + ::= { begemotLm75Objects 2 } + +loosTempSensorEntry OBJECT-TYPE + SYNTAX Lm75SensorEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "Table entry that describes one temperature sensor." + INDEX { lm75SensorIndex } + ::= { lm75SensorTable 1 } + +Lm75SensorEntry ::= SEQUENCE { + lm75SensorIndex Integer32, + lm75SensorSysctlIndex Integer32, + lm75SensorDesc OCTET STRING, + lm75SensorLocation OCTET STRING, + lm75SensorPnpInfo OCTET STRING, + lm75SensorParent OCTET STRING, + lm75SensorTemperature Integer32 +} + +lm75SensorIndex OBJECT-TYPE + SYNTAX Integer32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "LM75 Sensor index." + ::= { lm75SensorEntry 1 } + +lm75SensorSysctlIndex OBJECT-TYPE + SYNTAX Integer32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "LM75 Sensor sysctl index." + ::= { lm75SensorEntry 2 } + +lm75SensorDesc OBJECT-TYPE + SYNTAX OCTET STRING + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "LM75 Sensor description." + ::= { lm75SensorEntry 3 } + +lm75SensorLocation OBJECT-TYPE + SYNTAX OCTET STRING + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "LM75 Sensor location." + ::= { lm75SensorEntry 4 } + +lm75SensorPnpInfo OBJECT-TYPE + SYNTAX OCTET STRING + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "LM75 Sensor pnp information." + ::= { lm75SensorEntry 5 } + +lm75SensorParent OBJECT-TYPE + SYNTAX OCTET STRING + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "LM75 Sensor parent bus." + ::= { lm75SensorEntry 6 } + +lm75SensorTemperature OBJECT-TYPE + SYNTAX Integer32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "LM75 Sensor temperature." + ::= { lm75SensorEntry 7 } + +END Added: head/usr.sbin/bsnmpd/modules/snmp_lm75/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsnmpd/modules/snmp_lm75/Makefile Sun Jun 1 03:14:03 2014 (r266936) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +.include + +MOD= lm75 +SRCS= snmp_lm75.c +XSYM= begemotLm75 +MAN= snmp_lm75.3 + +BMIBS= BEGEMOT-LM75-MIB.txt +DEFS= ${MOD}_tree.def + +.include Added: head/usr.sbin/bsnmpd/modules/snmp_lm75/lm75_tree.def ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsnmpd/modules/snmp_lm75/lm75_tree.def Sun Jun 1 03:14:03 2014 (r266936) @@ -0,0 +1,56 @@ +#- +# Copyright (c) 2014 Luiz Otavio O Souza +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +(1 internet + (4 private + (1 enterprises + (12325 fokus + (1 begemot + (400 begemotLm75 + (1 begemotLm75Objects + (1 lm75Sensors + (1 lm75Sensors INTEGER32 op_lm75Sensors GET) + ) + (2 lm75SensorTable + (1 lm75SensorEntry : OCTETSTRING op_lm75SensorTable + (1 lm75SensorIndex INTEGER32 GET) + (2 lm75SensorSysctlIndex INTEGER32 GET) + (3 lm75SensorDesc OCTETSTRING GET) + (4 lm75SensorLocation OCTETSTRING GET) + (5 lm75SensorPnpInfo OCTETSTRING GET) + (6 lm75SensorParent OCTETSTRING GET) + (7 lm75SensorTemperature INTEGER32 GET) + ) + ) + ) + ) + ) + ) + ) + ) +) Added: head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.3 Sun Jun 1 03:14:03 2014 (r266936) @@ -0,0 +1,60 @@ +.\"- +.\" Copyright (c) 2014 Luiz Otavio O Souza +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd Jun 1, 2014 +.Dt SNMP_LM75 3 +.Os +.Sh NAME +.Nm snmp_lm75 +.Nd "LM75 Sensor module for" +.Xr bsnmpd 1 +.Sh LIBRARY +.Pq begemotSnmpdModulePath."lm75" = "/usr/lib/snmp_lm75.so" +.Sh DESCRIPTION +The +.Nm snmp_lm75 +module implements a private BEGEMOT-LM75-MIB, which allows +reading the temperature of the LM75 sensors on the system. +.Pp +The module reads the sensor(s) temperature using the +.Xr sysctl 8 +API. +.Sh FILES +.Bl -tag -width "XXXXXXXXX" +.It Pa /usr/share/snmp/defs/lm75_tree.def +The description of the MIB tree implemented by +.Nm . +.It Pa /usr/share/snmp/mibs/BEGEMOT-LM75-MIB.txt +The private BEGEMOT-LM75-MIB that is implemented by this module. +.El +.Sh SEE ALSO +.Xr bsnmpd 1 , +.Xr gensnmptree 1 , +.Xr snmpmod 3 , +.Xr lm75 4 +.Sh AUTHORS +.An Luiz Otavio O Souza Aq loos@FreeBSD.org . Added: head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.c Sun Jun 1 03:14:03 2014 (r266936) @@ -0,0 +1,436 @@ +/*- + * Copyright (c) 2014 Luiz Otavio O Souza + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include "lm75_oid.h" +#include "lm75_tree.h" + +#ifndef LM75BUF +#define LM75BUF 64 +#endif +#define TZ_ZEROC 2732 +#define UPDATE_INTERVAL 500 /* update interval in ticks */ + +static struct lmodule *module; + +static const struct asn_oid oid_lm75 = OIDX_begemotLm75; + +/* the Object Resource registration index */ +static u_int lm75_index = 0; + +/* Number of available sensors in the system. */ +static int lm75_sensors; + +/* + * Structure that describes single sensor. + */ +struct lm75_snmp_sensor { + TAILQ_ENTRY(lm75_snmp_sensor) link; + int32_t index; + int32_t sysctlidx; + int32_t temp; + char desc[LM75BUF]; + char location[LM75BUF]; + char parent[LM75BUF]; + char pnpinfo[LM75BUF]; +}; + +static TAILQ_HEAD(, lm75_snmp_sensor) sensors = + TAILQ_HEAD_INITIALIZER(sensors); + +/* Ticks of the last sensors reading. */ +static uint64_t last_sensors_update; + +static void free_sensors(void); +static int lm75_fini(void); +static int lm75_init(struct lmodule *mod, int argc, char *argv[]); +static void lm75_start(void); +static int update_sensors(void); + +const struct snmp_module config = { + .comment = + "This module implements the BEGEMOT MIB for reading LM75 sensors data.", + .init = lm75_init, + .start = lm75_start, + .fini = lm75_fini, + .tree = lm75_ctree, + .tree_size = lm75_CTREE_SIZE, +}; + +static int +lm75_init(struct lmodule *mod, int argc __unused, char *argv[] __unused) +{ + + module = mod; + + lm75_sensors = 0; + openlog("snmp_lm75", LOG_NDELAY | LOG_PID, LOG_DAEMON); + + return(0); +} + +static void +lm75_start(void) +{ + + lm75_index = or_register(&oid_lm75, + "The MIB module for reading lm75 sensors data.", module); +} + +static int +lm75_fini(void) +{ + + or_unregister(lm75_index); + free_sensors(); + closelog(); + + return (0); +} + +static void +free_sensors(void) +{ + struct lm75_snmp_sensor *sensor; + + while ((sensor = TAILQ_FIRST(&sensors)) != NULL) { + TAILQ_REMOVE(&sensors, sensor, link); + free(sensor); + } +} + +static int +sysctlname(int *oid, int nlen, char *name, size_t len) +{ + int mib[12]; + + if (nlen > (int)sizeof(mib) + 2) + return (-1); + + mib[0] = 0; + mib[1] = 1; + memcpy(mib + 2, oid, nlen * sizeof(int)); + + if (sysctl(mib, nlen + 2, name, &len, 0, 0) == -1) + return (-1); + + return (0); +} + +static int +sysctlgetnext(int *oid, int nlen, int *next, size_t *nextlen) +{ + int mib[12]; + + if (nlen > (int)sizeof(mib) + 2) + return (-1); + + mib[0] = 0; + mib[1] = 2; + memcpy(mib + 2, oid, nlen * sizeof(int)); + + if (sysctl(mib, nlen + 2, next, nextlen, 0, 0) == -1) + return (-1); + + return (0); +} + +static int +update_sensor_sysctl(char *obuf, size_t *obuflen, int idx, const char *name) +{ + char buf[LM75BUF]; + int mib[5]; + size_t len; + + /* Fill out the mib information. */ + snprintf(buf, sizeof(buf) - 1, "dev.lm75.%d.%s", idx, name); + len = 4; + if (sysctlnametomib(buf, mib, &len) == -1) + return (-1); + + /* Read the sysctl data. */ + if (sysctl(mib, len, obuf, obuflen, NULL, 0) == -1) + return (-1); + + return (0); +} + +static void +update_sensor(struct lm75_snmp_sensor *sensor, int idx) +{ + size_t len; + + len = sizeof(sensor->desc); + update_sensor_sysctl(sensor->desc, &len, idx, "%desc"); + + len = sizeof(sensor->location); + update_sensor_sysctl(sensor->location, &len, idx, "%location"); + + len = sizeof(sensor->pnpinfo); + update_sensor_sysctl(sensor->pnpinfo, &len, idx, "%pnpinfo"); + + len = sizeof(sensor->parent); + update_sensor_sysctl(sensor->parent, &len, idx, "%parent"); +} + +static int +add_sensor(char *buf, size_t nlen) +{ + int idx, mib[5], temp; + size_t len; + struct lm75_snmp_sensor *sensor; + + if (sscanf(buf, "dev.lm75.%d.temperature", &idx) != 1) + return (-1); + + /* Fill out the mib information. */ + if (sysctlnametomib(buf, mib, &nlen) == -1) + return (-1); + + /* Read the sensor temperature. */ + len = sizeof(temp); + if (sysctl(mib, nlen, &temp, &len, NULL, 0) == -1) + return (-1); + + /* Add the sensor data to the table. */ + sensor = calloc(1, sizeof(*sensor)); + if (sensor == NULL) { + syslog(LOG_ERR, "Unable to allocate %zu bytes for resource", + sizeof(*sensor)); + return (-1); + } + sensor->index = ++lm75_sensors; + sensor->sysctlidx = idx; + sensor->temp = (temp - TZ_ZEROC) / 10; + TAILQ_INSERT_TAIL(&sensors, sensor, link); + + update_sensor(sensor, idx); + + return (0); +} + +static int +update_sensors(void) +{ + char buf[LM75BUF]; + int i, root[5], *next, *oid; + size_t len, nextlen, rootlen; + static uint64_t now; + + now = get_ticks(); + if (now - last_sensors_update < UPDATE_INTERVAL) + return (0); + + last_sensors_update = now; + + /* Reset the sensor data. */ + free_sensors(); + lm75_sensors = 0; + + /* Start from the lm75 default root node. */ + rootlen = 2; + if (sysctlnametomib("dev.lm75", root, &rootlen) == -1) + return (0); + + oid = (int *)malloc(sizeof(int) * rootlen); + if (oid == NULL) { + perror("malloc"); + return (-1); + } + memcpy(oid, root, rootlen * sizeof(int)); + len = rootlen; + + /* Traverse the sysctl(3) interface and find the active sensors. */ + for (;;) { + + /* Find the size of the next mib. */ + nextlen = 0; + if (sysctlgetnext(oid, len, NULL, &nextlen) == -1) { + free(oid); + return (0); + } + /* Alocate and read the next mib. */ + next = (int *)malloc(nextlen); + if (next == NULL) { + syslog(LOG_ERR, + "Unable to allocate %zu bytes for resource", + nextlen); + free(oid); + return (-1); + } + if (sysctlgetnext(oid, len, next, &nextlen) == -1) { + free(oid); + free(next); + return (0); + } + free(oid); + /* Check if we care about the next mib. */ + for (i = 0; i < (int)rootlen; i++) + if (next[i] != root[i]) { + free(next); + return (0); + } + oid = (int *)malloc(nextlen); + if (oid == NULL) { + syslog(LOG_ERR, + "Unable to allocate %zu bytes for resource", + nextlen); + free(next); + return (-1); + } + memcpy(oid, next, nextlen); + free(next); + len = nextlen / sizeof(int); + + /* Find the mib name. */ + if (sysctlname(oid, len, buf, sizeof(buf)) != 0) + continue; + + if (strstr(buf, "temperature")) + if (add_sensor(buf, len) != 0) { + free(oid); + return (-1); + } + } + + return (0); +} + +int +op_lm75Sensors(struct snmp_context *context __unused, struct snmp_value *value, + u_int sub, u_int iidx __unused, enum snmp_op op) +{ + asn_subid_t which; + + if (update_sensors() == -1) + return (SNMP_ERR_RES_UNAVAIL); + + which = value->var.subs[sub - 1]; + + switch (op) { + case SNMP_OP_GET: + switch (which) { + case LEAF_lm75Sensors: + value->v.integer = lm75_sensors; + break; + default: + return (SNMP_ERR_RES_UNAVAIL); + } + break; + case SNMP_OP_SET: + return (SNMP_ERR_NOT_WRITEABLE); + case SNMP_OP_GETNEXT: + case SNMP_OP_ROLLBACK: + case SNMP_OP_COMMIT: + return (SNMP_ERR_NOERROR); + default: + return (SNMP_ERR_RES_UNAVAIL); + } + + return (SNMP_ERR_NOERROR); +} + +int +op_lm75SensorTable(struct snmp_context *context __unused, + struct snmp_value *value, u_int sub, u_int iidx __unused, enum snmp_op op) +{ + struct lm75_snmp_sensor *sensor; + asn_subid_t which; + int ret; + + if (update_sensors() == -1) + return (SNMP_ERR_RES_UNAVAIL); + + which = value->var.subs[sub - 1]; + + switch (op) { + case SNMP_OP_GETNEXT: + sensor = NEXT_OBJECT_INT(&sensors, &value->var, sub); + if (sensor == NULL) + return (SNMP_ERR_NOSUCHNAME); + value->var.len = sub + 1; + value->var.subs[sub] = sensor->index; + break; + case SNMP_OP_GET: + if (value->var.len - sub != 1) + return (SNMP_ERR_NOSUCHNAME); + sensor = FIND_OBJECT_INT(&sensors, &value->var, sub); + if (sensor == NULL) + return (SNMP_ERR_NOSUCHNAME); + break; + case SNMP_OP_SET: + return (SNMP_ERR_NOT_WRITEABLE); + case SNMP_OP_ROLLBACK: + case SNMP_OP_COMMIT: + return (SNMP_ERR_NOERROR); + default: + return (SNMP_ERR_RES_UNAVAIL); + } + + ret = SNMP_ERR_NOERROR; + + switch (which) { + case LEAF_lm75SensorIndex: + value->v.integer = sensor->index; + break; + case LEAF_lm75SensorSysctlIndex: + value->v.integer = sensor->sysctlidx; + break; + case LEAF_lm75SensorDesc: + ret = string_get(value, sensor->desc, -1); + break; + case LEAF_lm75SensorLocation: + ret = string_get(value, sensor->location, -1); + break; + case LEAF_lm75SensorPnpInfo: + ret = string_get(value, sensor->pnpinfo, -1); + break; + case LEAF_lm75SensorParent: + ret = string_get(value, sensor->parent, -1); + break; + case LEAF_lm75SensorTemperature: + value->v.integer = sensor->temp; + break; + default: + ret = SNMP_ERR_RES_UNAVAIL; + break; + } + + return (ret); +} From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 03:57:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81B92CC7; Sun, 1 Jun 2014 03:57:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65EA12A67; Sun, 1 Jun 2014 03:57:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s513vwui010415; Sun, 1 Jun 2014 03:57:58 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s513vwts010414; Sun, 1 Jun 2014 03:57:58 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201406010357.s513vwts010414@svn.freebsd.org> From: Luiz Otavio O Souza Date: Sun, 1 Jun 2014 03:57:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266937 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 03:57:58 -0000 Author: loos Date: Sun Jun 1 03:57:57 2014 New Revision: 266937 URL: http://svnweb.freebsd.org/changeset/base/266937 Log: Export two new settings for the AM335x PWM, the clock prescaler (clkdiv) and the actual PWM frequency. Enforce the maximum value for the period sysctl. The frequency systcl now allows the direct setting of the PWM frequency (it will try to find the better clkdiv and period for a given frequency, i.e. the ones that will give the better PWM resolution). This allows the use lower frequencies on the PWM. Without changing the clock prescaler the minimum PWM frequency was 1.52kHz. PWM frequencies checked with an osciloscope. PWM output tested with some R/C servos at 50Hz. Modified: head/sys/arm/ti/am335x/am335x_pwm.c Modified: head/sys/arm/ti/am335x/am335x_pwm.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_pwm.c Sun Jun 1 03:14:03 2014 (r266936) +++ head/sys/arm/ti/am335x/am335x_pwm.c Sun Jun 1 03:57:57 2014 (r266937) @@ -29,10 +29,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include +#include +#include #include +#include #include #include #include @@ -53,12 +54,13 @@ __FBSDID("$FreeBSD$"); /* In ticks */ #define DEFAULT_PWM_PERIOD 1000 +#define PWM_CLOCK 100000000UL #define PWM_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define PWM_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) #define PWM_LOCK_INIT(_sc) mtx_init(&(_sc)->sc_mtx, \ device_get_nameunit(_sc->sc_dev), "am335x_pwm softc", MTX_DEF) -#define PWM_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx); +#define PWM_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx) static struct resource_spec am335x_pwm_mem_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* PWMSS */ @@ -170,6 +172,8 @@ static struct resource_spec am335x_pwm_m static device_probe_t am335x_pwm_probe; static device_attach_t am335x_pwm_attach; static device_detach_t am335x_pwm_detach; + +static int am335x_pwm_clkdiv[8] = { 1, 2, 4, 8, 16, 32, 64, 128 }; struct am335x_pwm_softc { device_t sc_dev; @@ -177,6 +181,10 @@ struct am335x_pwm_softc { struct resource *sc_mem_res[4]; int sc_id; /* sysctl for configuration */ + int sc_pwm_clkdiv; + int sc_pwm_freq; + struct sysctl_oid *sc_clkdiv_oid; + struct sysctl_oid *sc_freq_oid; struct sysctl_oid *sc_period_oid; struct sysctl_oid *sc_chanA_oid; struct sysctl_oid *sc_chanB_oid; @@ -241,6 +249,98 @@ am335x_pwm_config_ecas(int unit, int per return (0); } +static void +am335x_pwm_freq(struct am335x_pwm_softc *sc) +{ + int clkdiv; + + clkdiv = am335x_pwm_clkdiv[sc->sc_pwm_clkdiv]; + sc->sc_pwm_freq = PWM_CLOCK / (1 * clkdiv) / sc->sc_pwm_period; +} + +static int +am335x_pwm_sysctl_freq(SYSCTL_HANDLER_ARGS) +{ + int clkdiv, error, freq, i, period; + struct am335x_pwm_softc *sc; + uint32_t reg; + + sc = (struct am335x_pwm_softc *)arg1; + + PWM_LOCK(sc); + freq = sc->sc_pwm_freq; + PWM_UNLOCK(sc); + + error = sysctl_handle_int(oidp, &freq, sizeof(freq), req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (freq > PWM_CLOCK) + freq = PWM_CLOCK; + + PWM_LOCK(sc); + if (freq != sc->sc_pwm_freq) { + for (i = nitems(am335x_pwm_clkdiv) - 1; i >= 0; i--) { + clkdiv = am335x_pwm_clkdiv[i]; + period = PWM_CLOCK / clkdiv / freq; + if (period > USHRT_MAX) + break; + sc->sc_pwm_clkdiv = i; + sc->sc_pwm_period = period; + } + /* Reset the duty cycle settings. */ + sc->sc_pwm_dutyA = 0; + sc->sc_pwm_dutyB = 0; + EPWM_WRITE2(sc, EPWM_CMPA, sc->sc_pwm_dutyA); + EPWM_WRITE2(sc, EPWM_CMPB, sc->sc_pwm_dutyB); + /* Update the clkdiv settings. */ + reg = EPWM_READ2(sc, EPWM_TBCTL); + reg &= ~TBCTL_CLKDIV_MASK; + reg |= TBCTL_CLKDIV(sc->sc_pwm_clkdiv); + EPWM_WRITE2(sc, EPWM_TBCTL, reg); + /* Update the period settings. */ + EPWM_WRITE2(sc, EPWM_TBPRD, sc->sc_pwm_period - 1); + am335x_pwm_freq(sc); + } + PWM_UNLOCK(sc); + + return (0); +} + +static int +am335x_pwm_sysctl_clkdiv(SYSCTL_HANDLER_ARGS) +{ + int error, i, clkdiv; + struct am335x_pwm_softc *sc; + uint32_t reg; + + sc = (struct am335x_pwm_softc *)arg1; + + PWM_LOCK(sc); + clkdiv = am335x_pwm_clkdiv[sc->sc_pwm_clkdiv]; + PWM_UNLOCK(sc); + + error = sysctl_handle_int(oidp, &clkdiv, sizeof(clkdiv), req); + if (error != 0 || req->newptr == NULL) + return (error); + + PWM_LOCK(sc); + if (clkdiv != am335x_pwm_clkdiv[sc->sc_pwm_clkdiv]) { + for (i = 0; i < nitems(am335x_pwm_clkdiv); i++) + if (clkdiv >= am335x_pwm_clkdiv[i]) + sc->sc_pwm_clkdiv = i; + + reg = EPWM_READ2(sc, EPWM_TBCTL); + reg &= ~TBCTL_CLKDIV_MASK; + reg |= TBCTL_CLKDIV(sc->sc_pwm_clkdiv); + EPWM_WRITE2(sc, EPWM_TBCTL, reg); + am335x_pwm_freq(sc); + } + PWM_UNLOCK(sc); + + return (0); +} + static int am335x_pwm_sysctl_duty(SYSCTL_HANDLER_ARGS) { @@ -292,15 +392,19 @@ am335x_pwm_sysctl_period(SYSCTL_HANDLER_ if (period < 1) return (EINVAL); - if ((period < sc->sc_pwm_dutyA) || (period < sc->sc_pwm_dutyB)) { - device_printf(sc->sc_dev, "Period can't be less then duty cycle\n"); - return (EINVAL); - } - + if (period > USHRT_MAX) + period = USHRT_MAX; PWM_LOCK(sc); + /* Reset the duty cycle settings. */ + sc->sc_pwm_dutyA = 0; + sc->sc_pwm_dutyB = 0; + EPWM_WRITE2(sc, EPWM_CMPA, sc->sc_pwm_dutyA); + EPWM_WRITE2(sc, EPWM_CMPB, sc->sc_pwm_dutyB); + /* Update the period settings. */ sc->sc_pwm_period = period; EPWM_WRITE2(sc, EPWM_TBPRD, period - 1); + am335x_pwm_freq(sc); PWM_UNLOCK(sc); return (error); @@ -360,6 +464,14 @@ am335x_pwm_attach(device_t dev) ctx = device_get_sysctl_ctx(sc->sc_dev); tree = device_get_sysctl_tree(sc->sc_dev); + sc->sc_clkdiv_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "clkdiv", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + am335x_pwm_sysctl_clkdiv, "I", "PWM clock prescaler"); + + sc->sc_freq_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "freq", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + am335x_pwm_sysctl_freq, "I", "PWM frequency"); + sc->sc_period_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "period", CTLTYPE_INT | CTLFLAG_RW, sc, 0, am335x_pwm_sysctl_period, "I", "PWM period"); @@ -372,7 +484,6 @@ am335x_pwm_attach(device_t dev) "dutyB", CTLTYPE_INT | CTLFLAG_RW, sc, 0, am335x_pwm_sysctl_duty, "I", "Channel B duty cycles"); - /* CONFIGURE EPWM1 */ reg = EPWM_READ2(sc, EPWM_TBCTL); reg &= ~(TBCTL_CLKDIV_MASK | TBCTL_HSPCLKDIV_MASK); @@ -381,6 +492,7 @@ am335x_pwm_attach(device_t dev) sc->sc_pwm_period = DEFAULT_PWM_PERIOD; sc->sc_pwm_dutyA = 0; sc->sc_pwm_dutyB = 0; + am335x_pwm_freq(sc); EPWM_WRITE2(sc, EPWM_TBPRD, sc->sc_pwm_period - 1); EPWM_WRITE2(sc, EPWM_CMPA, sc->sc_pwm_dutyA); From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 04:08:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61090FD2; Sun, 1 Jun 2014 04:08:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42E212B28; Sun, 1 Jun 2014 04:08:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5148kfq015413; Sun, 1 Jun 2014 04:08:46 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5148kZt015412; Sun, 1 Jun 2014 04:08:46 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201406010408.s5148kZt015412@svn.freebsd.org> From: Craig Rodrigues Date: Sun, 1 Jun 2014 04:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266938 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 04:08:46 -0000 Author: rodrigc Date: Sun Jun 1 04:08:45 2014 New Revision: 266938 URL: http://svnweb.freebsd.org/changeset/base/266938 Log: Allow customization of the brand displayed in the boot menu. If the user specifies in /boot/loader.conf: loader_brand="mycustom-brand" Then "mycustom-brand" will be executed instead of "fbsd-logo". Submitted by: alfred Obtained from: FreeNAS Modified: head/sys/boot/forth/brand.4th Modified: head/sys/boot/forth/brand.4th ============================================================================== --- head/sys/boot/forth/brand.4th Sun Jun 1 03:57:57 2014 (r266937) +++ head/sys/boot/forth/brand.4th Sun Jun 1 04:08:45 2014 (r266938) @@ -56,6 +56,8 @@ variable brandY \ NAME DESCRIPTION \ fbsd FreeBSD logo \ +\ NOTE: Setting `loader_brand' to the value of an existing function +\ (such as "mycustom-brand") will cause that symbol to be executed. \ NOTE: Setting `loader_brand' to an undefined value (such as "none") will \ prevent any brand from being drawn. \ @@ -87,5 +89,14 @@ variable brandY 2drop exit then + \ if it refers to a raw symbol then run that function + sfind if + brandX @ brandY @ + 2 roll + execute + else + drop + then + 2drop ; From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 04:11:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44A311B0; Sun, 1 Jun 2014 04:11:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2587B2B9E; Sun, 1 Jun 2014 04:11:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s514B6nC016478; Sun, 1 Jun 2014 04:11:06 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s514B6H7016477; Sun, 1 Jun 2014 04:11:06 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201406010411.s514B6H7016477@svn.freebsd.org> From: Adrian Chadd Date: Sun, 1 Jun 2014 04:11:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266939 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 04:11:06 -0000 Author: adrian Date: Sun Jun 1 04:11:05 2014 New Revision: 266939 URL: http://svnweb.freebsd.org/changeset/base/266939 Log: Pin the right thread. This _was_ right, a last minute suggestion and not enough testing makes Adrian a bad boy. Tested: * igb(4) with RSS patches, by hand verifying each igb(4) taskqueue tid from procstat -ka using cpuset -g -t . Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Sun Jun 1 04:08:45 2014 (r266938) +++ head/sys/kern/subr_taskqueue.c Sun Jun 1 04:11:05 2014 (r266939) @@ -538,7 +538,7 @@ _taskqueue_start_threads(struct taskqueu continue; td = tq->tq_threads[i]; if (mask) { - error = cpuset_setthread(curthread->td_tid, mask); + error = cpuset_setthread(td->td_tid, mask); /* * Failing to pin is rarely an actual fatal error; * it'll just affect performance. From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 05:02:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B98970F; Sun, 1 Jun 2014 05:02:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A1EA2152; Sun, 1 Jun 2014 05:02:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5152nIp040831; Sun, 1 Jun 2014 05:02:49 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5152niV040830; Sun, 1 Jun 2014 05:02:49 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201406010502.s5152niV040830@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Sun, 1 Jun 2014 05:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266940 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 05:02:49 -0000 Author: ganbold Date: Sun Jun 1 05:02:48 2014 New Revision: 266940 URL: http://svnweb.freebsd.org/changeset/base/266940 Log: Silence tinderbox build. Approved by: stas (mentor) Modified: head/sys/arm/conf/RK3188 Modified: head/sys/arm/conf/RK3188 ============================================================================== --- head/sys/arm/conf/RK3188 Sun Jun 1 04:11:05 2014 (r266939) +++ head/sys/arm/conf/RK3188 Sun Jun 1 05:02:48 2014 (r266940) @@ -124,3 +124,5 @@ device firmware # Used by the above # USB ethernet support, requires miibus device miibus device udav + +options FDT # Configure using FDT/DTB data. From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 07:28:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81FC790C; Sun, 1 Jun 2014 07:28:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E1132FA8; Sun, 1 Jun 2014 07:28:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s517SQs3099949; Sun, 1 Jun 2014 07:28:26 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s517SPQ1099942; Sun, 1 Jun 2014 07:28:25 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201406010728.s517SPQ1099942@svn.freebsd.org> From: Hiren Panchasara Date: Sun, 1 Jun 2014 07:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266941 - in head: sbin/ipfw sys/netinet sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 07:28:26 -0000 Author: hiren Date: Sun Jun 1 07:28:24 2014 New Revision: 266941 URL: http://svnweb.freebsd.org/changeset/base/266941 Log: ECN marking implenetation for dummynet. Changes include both DCTCP and RFC 3168 ECN marking methodology. DCTCP draft: http://tools.ietf.org/html/draft-bensley-tcpm-dctcp-00 Submitted by: Midori Kato (aoimidori27@gmail.com) Worked with: Lars Eggert (lars@netapp.com) Reviewed by: luigi, hiren Modified: head/sbin/ipfw/dummynet.c head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipfw2.h head/sys/netinet/ip_dummynet.h head/sys/netpfil/ipfw/ip_dn_glue.c head/sys/netpfil/ipfw/ip_dn_io.c head/sys/netpfil/ipfw/ip_dummynet.c Modified: head/sbin/ipfw/dummynet.c ============================================================================== --- head/sbin/ipfw/dummynet.c Sun Jun 1 05:02:48 2014 (r266940) +++ head/sbin/ipfw/dummynet.c Sun Jun 1 07:28:24 2014 (r266941) @@ -56,6 +56,7 @@ static struct _s_x dummynet_params[] = { { "sched_mask", TOK_SCHED_MASK }, { "flow_mask", TOK_FLOW_MASK }, { "droptail", TOK_DROPTAIL }, + { "ecn", TOK_ECN }, { "red", TOK_RED }, { "gred", TOK_GRED }, { "bw", TOK_BW }, @@ -239,7 +240,7 @@ print_flowset_parms(struct dn_fs *fs, ch else plr[0] = '\0'; - if (fs->flags & DN_IS_RED) /* RED parameters */ + if (fs->flags & DN_IS_RED) { /* RED parameters */ sprintf(red, "\n\t %cRED w_q %f min_th %d max_th %d max_p %f", (fs->flags & DN_IS_GENTLE_RED) ? 'G' : ' ', @@ -247,7 +248,9 @@ print_flowset_parms(struct dn_fs *fs, ch fs->min_th, fs->max_th, 1.0 * fs->max_p / (double)(1 << SCALE_RED)); - else + if (fs->flags & DN_IS_ECN) + strncat(red, " (ecn)", 6); + } else sprintf(red, "droptail"); if (prefix[0]) { @@ -1046,13 +1049,17 @@ end_mask: } if ((end = strsep(&av[0], "/"))) { double max_p = strtod(end, NULL); - if (max_p > 1 || max_p <= 0) - errx(EX_DATAERR, "0 < max_p <= 1"); + if (max_p > 1 || max_p < 0) + errx(EX_DATAERR, "0 <= max_p <= 1"); fs->max_p = (int)(max_p * (1 << SCALE_RED)); } ac--; av++; break; + case TOK_ECN: + fs->flags |= DN_IS_ECN; + break; + case TOK_DROPTAIL: NEED(fs, "droptail is only for flowsets"); fs->flags &= ~(DN_IS_RED|DN_IS_GENTLE_RED); @@ -1175,13 +1182,20 @@ end_mask: errx(EX_DATAERR, "2 <= queue size <= %ld", limit); } + if ((fs->flags & DN_IS_ECN) && !(fs->flags & DN_IS_RED)) + errx(EX_USAGE, "enable red/gred for ECN"); + if (fs->flags & DN_IS_RED) { size_t len; int lookup_depth, avg_pkt_size; - if (fs->min_th >= fs->max_th) + if (!(fs->flags & DN_IS_ECN) && (fs->min_th >= fs->max_th)) errx(EX_DATAERR, "min_th %d must be < than max_th %d", fs->min_th, fs->max_th); + else if ((fs->flags & DN_IS_ECN) && (fs->min_th > fs->max_th)) + errx(EX_DATAERR, "min_th %d must be =< than max_th %d", + fs->min_th, fs->max_th); + if (fs->max_th == 0) errx(EX_DATAERR, "max_th must be > 0"); Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Sun Jun 1 05:02:48 2014 (r266940) +++ head/sbin/ipfw/ipfw.8 Sun Jun 1 07:28:24 2014 (r266941) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 25, 2012 +.Dd May 31, 2014 .Dt IPFW 8 .Os .Sh NAME @@ -2441,22 +2441,23 @@ and control the maximum lengths that can be specified. .Pp .It Cm red | gred Ar w_q Ns / Ns Ar min_th Ns / Ns Ar max_th Ns / Ns Ar max_p +[ecn] Make use of the RED (Random Early Detection) queue management algorithm. .Ar w_q and .Ar max_p are floating -point numbers between 0 and 1 (0 not included), while +point numbers between 0 and 1 (inclusive), while .Ar min_th and .Ar max_th are integer numbers specifying thresholds for queue management (thresholds are computed in bytes if the queue has been defined in bytes, in slots otherwise). -The +The two parameters can also be of the same value if needed. The .Nm dummynet -also supports the gentle RED variant (gred). -Three +also supports the gentle RED variant (gred) and ECN (Explicit Congestion +Notification) as optional. Three .Xr sysctl 8 variables can be used to control the RED behaviour: .Bl -tag -width indent Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Sun Jun 1 05:02:48 2014 (r266940) +++ head/sbin/ipfw/ipfw2.h Sun Jun 1 07:28:24 2014 (r266941) @@ -165,6 +165,7 @@ enum tokens { TOK_BURST, TOK_RED, TOK_GRED, + TOK_ECN, TOK_DROPTAIL, TOK_PROTO, /* dummynet tokens */ Modified: head/sys/netinet/ip_dummynet.h ============================================================================== --- head/sys/netinet/ip_dummynet.h Sun Jun 1 05:02:48 2014 (r266940) +++ head/sys/netinet/ip_dummynet.h Sun Jun 1 07:28:24 2014 (r266941) @@ -104,6 +104,7 @@ enum { /* user flags */ DN_HAS_PROFILE = 0x0010, /* a link has a profile */ DN_IS_RED = 0x0020, DN_IS_GENTLE_RED= 0x0040, + DN_IS_ECN = 0x0080, DN_PIPE_CMD = 0x1000, /* pipe config... */ }; Modified: head/sys/netpfil/ipfw/ip_dn_glue.c ============================================================================== --- head/sys/netpfil/ipfw/ip_dn_glue.c Sun Jun 1 05:02:48 2014 (r266940) +++ head/sys/netpfil/ipfw/ip_dn_glue.c Sun Jun 1 07:28:24 2014 (r266941) @@ -83,6 +83,7 @@ struct dn_flow_set { #define DNOLD_QSIZE_IS_BYTES 0x0008 /* queue size is measured in bytes */ #define DNOLD_NOERROR 0x0010 /* do not report ENOBUFS on drops */ #define DNOLD_HAS_PROFILE 0x0020 /* the pipe has a delay profile. */ +#define DNOLD_IS_ECN 0x0040 #define DNOLD_IS_PIPE 0x4000 #define DNOLD_IS_QUEUE 0x8000 @@ -338,6 +339,8 @@ convertflags2new(int src) dst |= DN_IS_RED; if (src & DNOLD_IS_GENTLE_RED) dst |= DN_IS_GENTLE_RED; + if (src & DNOLD_IS_ECN) + dst |= DN_IS_ECN; if (src & DNOLD_HAS_PROFILE) dst |= DN_HAS_PROFILE; Modified: head/sys/netpfil/ipfw/ip_dn_io.c ============================================================================== --- head/sys/netpfil/ipfw/ip_dn_io.c Sun Jun 1 05:02:48 2014 (r266940) +++ head/sys/netpfil/ipfw/ip_dn_io.c Sun Jun 1 07:28:24 2014 (r266941) @@ -367,6 +367,8 @@ red_drops (struct dn_queue *q, int len) return (0); /* accept packet */ } if (q->avg >= fs->max_th) { /* average queue >= max threshold */ + if (fs->fs.flags & DN_IS_ECN) + return (1); if (fs->fs.flags & DN_IS_GENTLE_RED) { /* * According to Gentle-RED, if avg is greater than @@ -382,6 +384,8 @@ red_drops (struct dn_queue *q, int len) return (1); } } else if (q->avg > fs->min_th) { + if (fs->fs.flags & DN_IS_ECN) + return (1); /* * We compute p_b using the linear dropping function * p_b = c_1 * avg - c_2 @@ -414,6 +418,70 @@ red_drops (struct dn_queue *q, int len) } /* + * ECN/ECT Processing (partially adopted from altq) + */ +static int +ecn_mark(struct mbuf* m) +{ + struct ip *ip; + ip = mtod(m, struct ip *); + + switch (ip->ip_v) { + case IPVERSION: + { + u_int8_t otos; + int sum; + + if ((ip->ip_tos & IPTOS_ECN_MASK) == IPTOS_ECN_NOTECT) + return (0); /* not-ECT */ + if ((ip->ip_tos & IPTOS_ECN_MASK) == IPTOS_ECN_CE) + return (1); /* already marked */ + + /* + * ecn-capable but not marked, + * mark CE and update checksum + */ + otos = ip->ip_tos; + ip->ip_tos |= IPTOS_ECN_CE; + /* + * update checksum (from RFC1624) + * HC' = ~(~HC + ~m + m') + */ + sum = ~ntohs(ip->ip_sum) & 0xffff; + sum += (~otos & 0xffff) + ip->ip_tos; + sum = (sum >> 16) + (sum & 0xffff); + sum += (sum >> 16); /* add carry */ + ip->ip_sum = htons(~sum & 0xffff); + return (1); + } +#ifdef INET6 + case (IPV6_VERSION >> 4): + { + struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); + u_int32_t flowlabel; + + flowlabel = ntohl(ip6->ip6_flow); + if ((flowlabel >> 28) != 6) + return (0); /* version mismatch! */ + if ((flowlabel & (IPTOS_ECN_MASK << 20)) == + (IPTOS_ECN_NOTECT << 20)) + return (0); /* not-ECT */ + if ((flowlabel & (IPTOS_ECN_MASK << 20)) == + (IPTOS_ECN_CE << 20)) + return (1); /* already marked */ + /* + * ecn-capable but not marked, mark CE + */ + flowlabel |= (IPTOS_ECN_CE << 20); + ip6->ip6_flow = htonl(flowlabel); + return (1); + } +#endif + } + return (0); +} + +/* * Enqueue a packet in q, subject to space and queue management policy * (whose parameters are in q->fs). * Update stats for the queue and the scheduler. @@ -444,8 +512,10 @@ dn_enqueue(struct dn_queue *q, struct mb goto drop; if (f->plr && random() < f->plr) goto drop; - if (f->flags & DN_IS_RED && red_drops(q, m->m_pkthdr.len)) - goto drop; + if (f->flags & DN_IS_RED && red_drops(q, m->m_pkthdr.len)) { + if (!(f->flags & DN_IS_ECN) || !ecn_mark(m)) + goto drop; + } if (f->flags & DN_QSIZE_BYTES) { if (q->ni.len_bytes > f->qsize) goto drop; @@ -457,14 +527,14 @@ dn_enqueue(struct dn_queue *q, struct mb q->ni.len_bytes += len; ni->length++; ni->len_bytes += len; - return 0; + return (0); drop: io_pkt_drop++; q->ni.drops++; ni->drops++; FREE_PKT(m); - return 1; + return (1); } /* Modified: head/sys/netpfil/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netpfil/ipfw/ip_dummynet.c Sun Jun 1 05:02:48 2014 (r266940) +++ head/sys/netpfil/ipfw/ip_dummynet.c Sun Jun 1 07:28:24 2014 (r266941) @@ -1071,7 +1071,10 @@ config_red(struct dn_fsk *fs) fs->min_th = SCALE(fs->fs.min_th); fs->max_th = SCALE(fs->fs.max_th); - fs->c_1 = fs->max_p / (fs->fs.max_th - fs->fs.min_th); + if (fs->fs.max_th == fs->fs.min_th) + fs->c_1 = fs->max_p; + else + fs->c_1 = SCALE((int64_t)(fs->max_p)) / (fs->fs.max_th - fs->fs.min_th); fs->c_2 = SCALE_MUL(fs->c_1, SCALE(fs->fs.min_th)); if (fs->fs.flags & DN_IS_GENTLE_RED) { From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 07:34:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0F49DEA; Sun, 1 Jun 2014 07:34:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE633204D; Sun, 1 Jun 2014 07:34:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s517YsGS004036; Sun, 1 Jun 2014 07:34:54 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s517YsQU004035; Sun, 1 Jun 2014 07:34:54 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201406010734.s517YsQU004035@svn.freebsd.org> From: Ruslan Bukin Date: Sun, 1 Jun 2014 07:34:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266942 - head/sys/arm/samsung/exynos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 07:34:54 -0000 Author: br Date: Sun Jun 1 07:34:54 2014 New Revision: 266942 URL: http://svnweb.freebsd.org/changeset/base/266942 Log: Do only receive chars if there are some data in the buffer. This fixes operation on newer Exynos boards. Modified: head/sys/arm/samsung/exynos/uart.c Modified: head/sys/arm/samsung/exynos/uart.c ============================================================================== --- head/sys/arm/samsung/exynos/uart.c Sun Jun 1 07:28:24 2014 (r266941) +++ head/sys/arm/samsung/exynos/uart.c Sun Jun 1 07:34:54 2014 (r266942) @@ -286,8 +286,13 @@ s3c2410_bus_setsig(struct uart_softc *sc static int s3c2410_bus_receive(struct uart_softc *sc) { + struct uart_bas *bas; + + bas = &sc->sc_bas; + while (bus_space_read_4(bas->bst, bas->bsh, + SSCOM_UFSTAT) & UFSTAT_RXCOUNT) + uart_rx_put(sc, uart_getreg(&sc->sc_bas, SSCOM_URXH)); - uart_rx_put(sc, uart_getreg(&sc->sc_bas, SSCOM_URXH)); return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 08:15:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F118B35; Sun, 1 Jun 2014 08:15:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F76E2320; Sun, 1 Jun 2014 08:15:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s518FbtF023535; Sun, 1 Jun 2014 08:15:37 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s518FYaj023520; Sun, 1 Jun 2014 08:15:34 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201406010815.s518FYaj023520@svn.freebsd.org> From: Ruslan Bukin Date: Sun, 1 Jun 2014 08:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266943 - in head/sys: arm/conf arm/samsung/exynos boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 08:15:37 -0000 Author: br Date: Sun Jun 1 08:15:34 2014 New Revision: 266943 URL: http://svnweb.freebsd.org/changeset/base/266943 Log: Add support for Exynos 5420 Octa - 8-core heterogeneous (big.LITTLE) ARM machine (4 x Cortex-A15 @ 1.8Ghz, 4 x Cortex-A7 @ 1Ghz) Add configuration for Arndale Octa development board Added: head/sys/arm/conf/ARNDALE-OCTA (contents, props changed) head/sys/arm/conf/EXYNOS5.common (contents, props changed) head/sys/arm/conf/EXYNOS5250 - copied, changed from r266941, head/sys/arm/conf/EXYNOS5250.common head/sys/arm/conf/EXYNOS5420 (contents, props changed) head/sys/arm/samsung/exynos/std.exynos5250 - copied unchanged from r266941, head/sys/arm/samsung/exynos/std.exynos5 head/sys/arm/samsung/exynos/std.exynos5420 (contents, props changed) head/sys/boot/fdt/dts/arm/exynos5.dtsi (contents, props changed) head/sys/boot/fdt/dts/arm/exynos5420-arndale-octa.dts (contents, props changed) head/sys/boot/fdt/dts/arm/exynos5420.dtsi (contents, props changed) Deleted: head/sys/arm/conf/EXYNOS5250.common head/sys/arm/samsung/exynos/std.exynos5 Modified: head/sys/arm/conf/ARNDALE head/sys/arm/conf/CHROMEBOOK head/sys/boot/fdt/dts/arm/exynos5250-arndale.dts head/sys/boot/fdt/dts/arm/exynos5250.dtsi Modified: head/sys/arm/conf/ARNDALE ============================================================================== --- head/sys/arm/conf/ARNDALE Sun Jun 1 07:34:54 2014 (r266942) +++ head/sys/arm/conf/ARNDALE Sun Jun 1 08:15:34 2014 (r266943) @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "EXYNOS5250.common" +include "EXYNOS5250" ident ARNDALE #FDT Added: head/sys/arm/conf/ARNDALE-OCTA ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/ARNDALE-OCTA Sun Jun 1 08:15:34 2014 (r266943) @@ -0,0 +1,28 @@ +# Kernel configuration for Arndale Octa Board (Exynos 5420) +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +#NO_UNIVERSE + +include "EXYNOS5420" +ident ARNDALE-OCTA + +#FDT +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=exynos5420-arndale-octa.dts Modified: head/sys/arm/conf/CHROMEBOOK ============================================================================== --- head/sys/arm/conf/CHROMEBOOK Sun Jun 1 07:34:54 2014 (r266942) +++ head/sys/arm/conf/CHROMEBOOK Sun Jun 1 08:15:34 2014 (r266943) @@ -17,7 +17,7 @@ # # $FreeBSD$ -include "EXYNOS5250.common" +include "EXYNOS5250" ident CHROMEBOOK hints "CHROMEBOOK.hints" Added: head/sys/arm/conf/EXYNOS5.common ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/EXYNOS5.common Sun Jun 1 08:15:34 2014 (r266943) @@ -0,0 +1,129 @@ +# Kernel configuration for Samsung Exynos 5 SoC. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +makeoptions MODULES_OVERRIDE="" +makeoptions WITHOUT_MODULES="ahc" + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions WERROR="-Werror" + +options HZ=100 +options SCHED_4BSD # 4BSD scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options GEOM_PART_BSD # BSD partition scheme +options GEOM_PART_MBR # MBR partition scheme +options GEOM_PART_GPT # GUID partition tables +options TMPFS # Efficient memory filesystem +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV +options PREEMPTION +options FREEBSD_BOOT_LOADER +options VFP # vfp/neon + +# Debugging +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +options BREAK_TO_DEBUGGER +#options VERBOSE_SYSINIT # Enable verbose sysinit messages +options KDB +options DDB # Enable the kernel debugger +#options INVARIANTS # Enable calls of extra sanity checking +#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options DIAGNOSTIC + +# NFS support +options NFSCL # Network Filesystem Client +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCLIENT + +# Uncomment this for NFS root +#options NFS_ROOT # NFS usable as /, requires NFSCL +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ue0 + +device mmc # mmc/sd bus +device mmcsd # mmc/sd flash cards +device sdhci # generic sdhci + +options ROOTDEVNAME=\"ufs:/dev/da0\" + +# Pseudo devices + +device loop +device random +device pty +device md +device gpio + +# USB support +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. +device usb +options USB_DEBUG +#options USB_REQ_DEBUG +#options USB_VERBOSE +#device musb +device ehci +#device ohci + +device umass +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device pass + +# SATA +#device ata +#device atadisk +#device mvs + +# Serial ports +device uart + +# I2C (TWSI) +device iic +device iicbus + +# Ethernet +device ether +device mii +device smsc +device smscphy + +# USB ethernet support, requires miibus +device miibus +device axe # ASIX Electronics USB Ethernet +device bpf # Berkeley packet filter Copied and modified: head/sys/arm/conf/EXYNOS5250 (from r266941, head/sys/arm/conf/EXYNOS5250.common) ============================================================================== --- head/sys/arm/conf/EXYNOS5250.common Sun Jun 1 07:28:24 2014 (r266941, copy source) +++ head/sys/arm/conf/EXYNOS5250 Sun Jun 1 08:15:34 2014 (r266943) @@ -17,117 +17,10 @@ # # $FreeBSD$ -include "../samsung/exynos/std.exynos5" - -makeoptions MODULES_OVERRIDE="" -makeoptions WITHOUT_MODULES="ahc" - -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -makeoptions WERROR="-Werror" - -options HZ=100 -options SCHED_4BSD # 4BSD scheduler -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options GEOM_PART_BSD # BSD partition scheme -options GEOM_PART_MBR # MBR partition scheme -options GEOM_PART_GPT # GUID partition tables -options TMPFS # Efficient memory filesystem -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -options PROCFS # Process filesystem (requires PSEUDOFS) -options PSEUDOFS # Pseudo-filesystem framework -options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI -options KTRACE -options SYSVSHM # SYSV-style shared memory -options SYSVMSG # SYSV-style message queues -options SYSVSEM # SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -options KBD_INSTALL_CDEV -options PREEMPTION -options FREEBSD_BOOT_LOADER -options VFP # vfp/neon - -# Debugging -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB -options DDB # Enable the kernel debugger -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - -# NFS support -options NFSCL # Network Filesystem Client -options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCLIENT - -# Uncomment this for NFS root -#options NFS_ROOT # NFS usable as /, requires NFSCL -#options BOOTP_NFSROOT -#options BOOTP_COMPAT -#options BOOTP -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=ue0 - -device mmc # mmc/sd bus -device mmcsd # mmc/sd flash cards -device sdhci # generic sdhci - -options ROOTDEVNAME=\"ufs:/dev/da0\" +include "EXYNOS5.common" +include "../samsung/exynos/std.exynos5250" options SMP -# Pseudo devices - -device loop -device random -device pty -device md -device gpio - -# USB support -options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. -device usb -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE -#device musb -device ehci -#device ohci - -device umass -device scbus # SCSI bus (required for SCSI) -device da # Direct Access (disks) -device pass - -# SATA -#device ata -#device atadisk -#device mvs - -# Serial ports -device uart - -# I2C (TWSI) -device iic -device iicbus - -# Ethernet -device ether -device mii -device smsc -device smscphy - -# USB ethernet support, requires miibus -device miibus -device axe # ASIX Electronics USB Ethernet -device bpf # Berkeley packet filter +#FDT +options FDT Added: head/sys/arm/conf/EXYNOS5420 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/EXYNOS5420 Sun Jun 1 08:15:34 2014 (r266943) @@ -0,0 +1,24 @@ +# Kernel configuration for Samsung Exynos 5420 boards. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include "EXYNOS5.common" +include "../samsung/exynos/std.exynos5420" + +#FDT +options FDT Copied: head/sys/arm/samsung/exynos/std.exynos5250 (from r266941, head/sys/arm/samsung/exynos/std.exynos5) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/samsung/exynos/std.exynos5250 Sun Jun 1 08:15:34 2014 (r266943, copy of r266941, head/sys/arm/samsung/exynos/std.exynos5) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +makeoption ARM_LITTLE_ENDIAN + +cpu CPU_CORTEXA +machine arm armv6 + +options PHYSADDR=0x40000000 + +makeoptions KERNPHYSADDR=0x40f00000 +options KERNPHYSADDR=0x40f00000 + +makeoptions KERNVIRTADDR=0xc0f00000 +options KERNVIRTADDR=0xc0f00000 + +options ARM_L2_PIPT + +options IPI_IRQ_START=0 +options IPI_IRQ_END=15 + +files "../samsung/exynos/files.exynos5" Added: head/sys/arm/samsung/exynos/std.exynos5420 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/samsung/exynos/std.exynos5420 Sun Jun 1 08:15:34 2014 (r266943) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +makeoption ARM_LITTLE_ENDIAN + +cpu CPU_CORTEXA +machine arm armv6 + +options PHYSADDR=0x20000000 + +makeoptions KERNPHYSADDR=0x20f00000 +options KERNPHYSADDR=0x20f00000 + +makeoptions KERNVIRTADDR=0xc0f00000 +options KERNVIRTADDR=0xc0f00000 + +options ARM_L2_PIPT + +options IPI_IRQ_START=0 +options IPI_IRQ_END=15 + +files "../samsung/exynos/files.exynos5" Added: head/sys/boot/fdt/dts/arm/exynos5.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/exynos5.dtsi Sun Jun 1 08:15:34 2014 (r266943) @@ -0,0 +1,284 @@ +/*- + * Copyright (c) 2013-2014 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/ { + compatible = "samsung,exynos5"; + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&GIC>; + + aliases { + soc = &SOC; + serial0 = &serial0; + serial1 = &serial1; + serial2 = &serial2; + serial3 = &serial3; + clk0 = &clk0; + dp0 = &dp0; + fimd0 = &fimd0; + }; + + SOC: Exynos5@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges; + bus-frequency = <0>; + + GIC: interrupt-controller@10481000 { + compatible = "arm,gic"; + reg = < 0x10481000 0x1000 >, /* Distributor Registers */ + < 0x10482000 0x2000 >; /* CPU Interface Registers */ + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + }; + + combiner: interrupt-controller@10440000 { + compatible = "exynos,combiner"; + reg = <0x10440000 0x1000>; + interrupts = < 32 33 34 35 36 37 38 39 + 40 41 42 43 44 45 46 47 + 48 49 50 51 52 53 54 55 + 56 57 58 59 60 61 62 63 >; + interrupt-parent = <&GIC>; + }; + + clk0: clk@10010000 { + compatible = "exynos,clk"; + reg = < 0x10020000 0x20000 >; + }; + + mct { + compatible = "exynos,mct"; + reg = < 0x101C0000 0x1000 >; + clock-frequency = <24000000>; + }; + + generic_timer { + compatible = "arm,armv7-timer"; + clock-frequency = <24000000>; + interrupts = < 29 30 27 26 >; + interrupt-parent = <&GIC>; + }; + + pwm { + compatible = "samsung,s3c24x0-timer"; + reg = <0x12DD0000 0x1000>; + interrupts = < 71 >; + interrupt-parent = <&GIC>; + clock-frequency = <24000000>; + }; + + pad0: pad@11400000 { + compatible = "exynos,pad"; + status = "disabled"; + reg = <0x11400000 0x1000>, /* gpio left */ + <0x13400000 0x1000>, /* gpio right */ + <0x10D10000 0x1000>, /* gpio c2c */ + <0x03860000 0x1000>; + interrupts = < 78 77 82 79 >; + interrupt-parent = <&GIC>; + }; + + usb@12110000 { + compatible = "exynos,usb-ehci", "usb-ehci"; + reg = <0x12110000 0x1000>, /* EHCI */ + <0x12130000 0x1000>, /* EHCI host ctrl */ + <0x10040000 0x1000>, /* Power */ + <0x10050230 0x10>; /* Sysreg */ + interrupts = < 103 >; + interrupt-parent = <&GIC>; + }; + + usb@12120000 { + compatible = "exynos,usb-ohci", "usb-ohci"; + status = "disabled"; + reg = <0x12120000 0x10000>; + interrupts = < 103 >; + interrupt-parent = <&GIC>; + }; + + sdhci@12200000 { + compatible = "sdhci_generic"; + status = "disabled"; + reg = <0x12200000 0x1000>; + interrupts = <107>; + interrupt-parent = <&GIC>; + max-frequency = <24000000>; /* TODO: verify freq */ + }; + + sdhci@12210000 { + compatible = "sdhci_generic"; + status = "disabled"; + reg = <0x12210000 0x1000>; + interrupts = <108>; + interrupt-parent = <&GIC>; + max-frequency = <24000000>; + }; + + sdhci@12220000 { + compatible = "sdhci_generic"; + status = "disabled"; + reg = <0x12220000 0x1000>; + interrupts = <109>; + interrupt-parent = <&GIC>; + max-frequency = <24000000>; + }; + + sdhci@12230000 { + compatible = "sdhci_generic"; + status = "disabled"; + reg = <0x12230000 0x1000>; + interrupts = <110>; + interrupt-parent = <&GIC>; + max-frequency = <24000000>; + }; + + serial0: serial@12C00000 { + compatible = "exynos"; + status = "disabled"; + reg = <0x12C00000 0x100>; + interrupts = < 83 >; + interrupt-parent = <&GIC>; + clock-frequency = < 100000000 >; + current-speed = <115200>; + }; + + serial1: serial@12C10000 { + compatible = "exynos"; + status = "disabled"; + reg = <0x12C10000 0x100>; + interrupts = < 84 >; + interrupt-parent = <&GIC>; + clock-frequency = < 100000000 >; + current-speed = <115200>; + }; + + serial2: serial@12C20000 { + compatible = "exynos"; + status = "disabled"; + reg = <0x12C20000 0x100>; + interrupts = < 85 >; + interrupt-parent = <&GIC>; + clock-frequency = < 100000000 >; + current-speed = <115200>; + }; + + serial3: serial@12C30000 { + compatible = "exynos"; + status = "disabled"; + reg = <0x12C30000 0x100>; + interrupts = < 86 >; + interrupt-parent = <&GIC>; + clock-frequency = < 100000000 >; + current-speed = <115200>; + }; + + i2c0: i2c@12C60000 { + compatible = "exynos,i2c"; + status = "disabled"; + reg = <0x12C60000 0x10000>; + interrupts = < 88 >; + interrupt-parent = <&GIC>; + }; + + i2c1: i2c@12C70000 { + compatible = "exynos,i2c"; + status = "disabled"; + reg = <0x12C70000 0x10000>; + interrupts = < 89 >; + interrupt-parent = <&GIC>; + }; + + i2c2: i2c@12C80000 { + compatible = "exynos,i2c"; + status = "disabled"; + reg = <0x12C80000 0x10000>; + interrupts = < 90 >; + interrupt-parent = <&GIC>; + }; + + i2c3: i2c@12C90000 { + compatible = "exynos,i2c"; + status = "disabled"; + reg = <0x12C90000 0x10000>; + interrupts = < 91 >; + interrupt-parent = <&GIC>; + }; + + i2c4: i2c@12CA0000 { + compatible = "exynos,i2c"; + status = "disabled"; + reg = <0x12CA0000 0x10000>; + interrupts = < 92 >; + interrupt-parent = <&GIC>; + }; + + i2c5: i2c@12CB0000 { + compatible = "exynos,i2c"; + status = "disabled"; + reg = <0x12CB0000 0x10000>; + interrupts = < 93 >; + interrupt-parent = <&GIC>; + }; + + i2c6: i2c@12CC0000 { + compatible = "exynos,i2c"; + status = "disabled"; + reg = <0x12CC0000 0x10000>; + interrupts = < 94 >; + interrupt-parent = <&GIC>; + }; + + i2c7: i2c@12CD0000 { + compatible = "exynos,i2c"; + status = "disabled"; + reg = <0x12CD0000 0x10000>; + interrupts = < 95 >; + interrupt-parent = <&GIC>; + }; + + fimd0: fimd@14400000 { + compatible = "exynos,fimd"; + status = "disabled"; + reg = < 0x14400000 0x10000 >, /* fimd */ + < 0x14420000 0x10000 >, /* disp */ + < 0x10050000 0x220 >; /* sysreg */ + interrupt-parent = <&GIC>; + }; + + dp0: dp@145B0000 { + compatible = "exynos,dp"; + status = "disabled"; + reg = < 0x145B0000 0x10000 >, + < 0x10040720 0x10 >; /* PHY */ + interrupt-parent = <&GIC>; + }; + }; +}; Modified: head/sys/boot/fdt/dts/arm/exynos5250-arndale.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/exynos5250-arndale.dts Sun Jun 1 07:34:54 2014 (r266942) +++ head/sys/boot/fdt/dts/arm/exynos5250-arndale.dts Sun Jun 1 08:15:34 2014 (r266943) @@ -44,6 +44,10 @@ status = "okay"; }; + serial2: serial@12C20000 { + status = "okay"; + }; + }; chosen { Modified: head/sys/boot/fdt/dts/arm/exynos5250.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/exynos5250.dtsi Sun Jun 1 07:34:54 2014 (r266942) +++ head/sys/boot/fdt/dts/arm/exynos5250.dtsi Sun Jun 1 08:15:34 2014 (r266943) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ruslan Bukin + * Copyright (c) 2013-2014 Ruslan Bukin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,248 +26,27 @@ * $FreeBSD$ */ -/ { - compatible = "samsung,exynos5250"; - #address-cells = <1>; - #size-cells = <1>; - interrupt-parent = <&GIC>; +/include/ "exynos5.dtsi" - aliases { - soc = &SOC; - serial0 = &serial0; - serial1 = &serial1; - clk0 = &clk0; - dp0 = &dp0; - fimd0 = &fimd0; - }; +/ { + compatible = "samsung,exynos5250", "samsung,exynos5"; SOC: Exynos5@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "simple-bus"; - ranges; - bus-frequency = <0>; - - GIC: interrupt-controller@10481000 { - compatible = "arm,gic"; - reg = < 0x10481000 0x1000 >, /* Distributor Registers */ - < 0x10482000 0x2000 >; /* CPU Interface Registers */ - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - }; - - combiner: interrupt-controller@10440000 { - compatible = "exynos,combiner"; - reg = <0x10440000 0x1000>; - interrupts = < 32 33 34 35 36 37 38 39 - 40 41 42 43 44 45 46 47 - 48 49 50 51 52 53 54 55 - 56 57 58 59 60 61 62 63 >; - interrupt-parent = <&GIC>; - }; - - clk0: clk@10010000 { - compatible = "exynos,clk"; - reg = < 0x10020000 0x20000 >; - }; - - mct { - compatible = "exynos,mct"; - reg = < 0x101C0000 0x1000 >; - clock-frequency = <24000000>; - }; - - generic_timer { - compatible = "arm,armv7-timer"; - clock-frequency = <24000000>; - interrupts = < 29 30 27 26 >; - interrupt-parent = <&GIC>; - }; - - pwm { - compatible = "samsung,s3c24x0-timer"; - reg = <0x12DD0000 0x1000>; - interrupts = < 71 >; - interrupt-parent = <&GIC>; - clock-frequency = <24000000>; - }; - - pad0: pad@11400000 { - compatible = "exynos,pad"; - status = "disabled"; - reg = <0x11400000 0x1000>, /* gpio left */ - <0x13400000 0x1000>, /* gpio right */ - <0x10D10000 0x1000>, /* gpio c2c */ - <0x03860000 0x1000>; - interrupts = < 78 77 82 79 >; - interrupt-parent = <&GIC>; - }; - - usb@12110000 { - compatible = "exynos,usb-ehci", "usb-ehci"; - reg = <0x12110000 0x1000>, /* EHCI */ - <0x12130000 0x1000>, /* EHCI host ctrl */ - <0x10040000 0x1000>, /* Power */ - <0x10050230 0x10>; /* Sysreg */ - interrupts = < 103 >; - interrupt-parent = <&GIC>; - }; - - usb@12120000 { - compatible = "exynos,usb-ohci", "usb-ohci"; - reg = <0x12120000 0x10000>; - interrupts = < 103 >; - interrupt-parent = <&GIC>; - }; - - sdhci@12200000 { - compatible = "sdhci_generic"; - reg = <0x12200000 0x1000>; - interrupts = <107>; - interrupt-parent = <&GIC>; - max-frequency = <24000000>; /* TODO: verify freq */ - }; - - sdhci@12210000 { - compatible = "sdhci_generic"; - reg = <0x12210000 0x1000>; - interrupts = <108>; - interrupt-parent = <&GIC>; - max-frequency = <24000000>; - }; - - sdhci@12220000 { - compatible = "sdhci_generic"; - reg = <0x12220000 0x1000>; - interrupts = <109>; - interrupt-parent = <&GIC>; - max-frequency = <24000000>; - }; - - sdhci@12230000 { - compatible = "sdhci_generic"; - reg = <0x12230000 0x1000>; - interrupts = <110>; - interrupt-parent = <&GIC>; - max-frequency = <24000000>; - }; serial0: serial@12C00000 { - compatible = "exynos"; - reg = <0x12C00000 0x100>; - interrupts = < 83 >; - interrupt-parent = <&GIC>; clock-frequency = < 100000000 >; - current-speed = <115200>; }; serial1: serial@12C10000 { - compatible = "exynos"; - reg = <0x12C10000 0x100>; - interrupts = < 84 >; - interrupt-parent = <&GIC>; clock-frequency = < 100000000 >; - current-speed = <115200>; }; serial2: serial@12C20000 { - compatible = "exynos"; - reg = <0x12C20000 0x100>; - interrupts = < 85 >; - interrupt-parent = <&GIC>; clock-frequency = < 100000000 >; - current-speed = <115200>; }; serial3: serial@12C30000 { - compatible = "exynos"; - reg = <0x12C30000 0x100>; - interrupts = < 86 >; - interrupt-parent = <&GIC>; clock-frequency = < 100000000 >; - current-speed = <115200>; - }; - - i2c0: i2c@12C60000 { - compatible = "exynos,i2c"; - status = "disabled"; - reg = <0x12C60000 0x10000>; - interrupts = < 88 >; - interrupt-parent = <&GIC>; - }; - - i2c1: i2c@12C70000 { - compatible = "exynos,i2c"; - status = "disabled"; - reg = <0x12C70000 0x10000>; - interrupts = < 89 >; - interrupt-parent = <&GIC>; - }; - - i2c2: i2c@12C80000 { - compatible = "exynos,i2c"; - status = "disabled"; - reg = <0x12C80000 0x10000>; - interrupts = < 90 >; - interrupt-parent = <&GIC>; - }; - - i2c3: i2c@12C90000 { - compatible = "exynos,i2c"; - status = "disabled"; - reg = <0x12C90000 0x10000>; - interrupts = < 91 >; - interrupt-parent = <&GIC>; - }; - - i2c4: i2c@12CA0000 { - compatible = "exynos,i2c"; - status = "disabled"; - reg = <0x12CA0000 0x10000>; - interrupts = < 92 >; - interrupt-parent = <&GIC>; - }; - - i2c5: i2c@12CB0000 { - compatible = "exynos,i2c"; - status = "disabled"; - reg = <0x12CB0000 0x10000>; - interrupts = < 93 >; - interrupt-parent = <&GIC>; - }; - - i2c6: i2c@12CC0000 { - compatible = "exynos,i2c"; - status = "disabled"; - reg = <0x12CC0000 0x10000>; - interrupts = < 94 >; - interrupt-parent = <&GIC>; - }; - - i2c7: i2c@12CD0000 { - compatible = "exynos,i2c"; - status = "disabled"; - reg = <0x12CD0000 0x10000>; - interrupts = < 95 >; - interrupt-parent = <&GIC>; - }; - - fimd0: fimd@14400000 { - compatible = "exynos,fimd"; - status = "disabled"; - reg = < 0x14400000 0x10000 >, /* fimd */ - < 0x14420000 0x10000 >, /* disp */ - < 0x10050000 0x220 >; /* sysreg */ - interrupt-parent = <&GIC>; - }; - - dp0: dp@145B0000 { - compatible = "exynos,dp"; - status = "disabled"; - reg = < 0x145B0000 0x10000 >, - < 0x10040720 0x10 >; /* PHY */ - interrupt-parent = <&GIC>; }; }; }; Added: head/sys/boot/fdt/dts/arm/exynos5420-arndale-octa.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/exynos5420-arndale-octa.dts Sun Jun 1 08:15:34 2014 (r266943) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/include/ "exynos5420.dtsi" + +/ { + model = "Arndale Octa Board"; + + memory { + device_type = "memory"; + reg = < 0x20000000 0x40000000 >; /* 1G */ + }; + + SOC: Exynos5@0 { + serial3: serial@12C30000 { + status = "okay"; + }; + }; + + chosen { + stdin = &serial3; + stdout = &serial3; + }; +}; Added: head/sys/boot/fdt/dts/arm/exynos5420.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 08:34:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7C63A9; Sun, 1 Jun 2014 08:34:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9BF5251F; Sun, 1 Jun 2014 08:34:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s518Yk2c032220; Sun, 1 Jun 2014 08:34:46 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s518YkoR032214; Sun, 1 Jun 2014 08:34:46 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201406010834.s518YkoR032214@svn.freebsd.org> From: Ruslan Bukin Date: Sun, 1 Jun 2014 08:34:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266944 - head/sys/arm/samsung/exynos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 08:34:47 -0000 Author: br Date: Sun Jun 1 08:34:45 2014 New Revision: 266944 URL: http://svnweb.freebsd.org/changeset/base/266944 Log: Rename exynos uart driver filenames. Added: head/sys/arm/samsung/exynos/exynos_uart.c - copied, changed from r266942, head/sys/arm/samsung/exynos/uart.c head/sys/arm/samsung/exynos/exynos_uart.h - copied unchanged from r266941, head/sys/arm/samsung/exynos/uart.h Deleted: head/sys/arm/samsung/exynos/uart.c head/sys/arm/samsung/exynos/uart.h Modified: head/sys/arm/samsung/exynos/files.exynos5 Copied and modified: head/sys/arm/samsung/exynos/exynos_uart.c (from r266942, head/sys/arm/samsung/exynos/uart.c) ============================================================================== --- head/sys/arm/samsung/exynos/uart.c Sun Jun 1 07:34:54 2014 (r266942, copy source) +++ head/sys/arm/samsung/exynos/exynos_uart.c Sun Jun 1 08:34:45 2014 (r266944) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "uart_if.h" Copied: head/sys/arm/samsung/exynos/exynos_uart.h (from r266941, head/sys/arm/samsung/exynos/uart.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/samsung/exynos/exynos_uart.h Sun Jun 1 08:34:45 2014 (r266944, copy of r266941, head/sys/arm/samsung/exynos/uart.h) @@ -0,0 +1,126 @@ +/* $NetBSD: s3c2xx0reg.h,v 1.4 2004/02/12 03:47:29 bsh Exp $ */ + +/*- + * Copyright (c) 2002, 2003 Fujitsu Component Limited + * Copyright (c) 2002, 2003 Genetec Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of The Fujitsu Component Limited nor the name of + * Genetec corporation may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY FUJITSU COMPONENT LIMITED AND GENETEC + * CORPORATION ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL FUJITSU COMPONENT LIMITED OR GENETEC + * CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* s3c2410-specific registers */ +#define UMCON_AFC (1 << 4) /* auto flow control */ +#define UMSTAT_DCTS (1 << 2) /* CTS change */ +#define ULCON_IR (1 << 6) +#define ULCON_PARITY_SHIFT 3 + +/* + * Exynos-specific + * + * UFSTAT_TXFULL register differs between Exynos and others. + * Others have UFSTAT_TXFULL (1 << 9) + */ +#define UFSTAT_TXFULL (1 << 24) + +#define SSCOM_UINTM 0x038 +#define SSCOM_UINTP 0x030 + +/* common for s3c2800 and s3c24x0 */ +#define SSCOM_ULCON 0x00 /* UART line control */ +#define ULCON_PARITY_NONE (0 << ULCON_PARITY_SHIFT) +#define ULCON_PARITY_ODD (4 << ULCON_PARITY_SHIFT) +#define ULCON_PARITY_EVEN (5 << ULCON_PARITY_SHIFT) +#define ULCON_PARITY_ONE (6 << ULCON_PARITY_SHIFT) +#define ULCON_PARITY_ZERO (7 << ULCON_PARITY_SHIFT) +#define ULCON_STOP (1 << 2) +#define ULCON_LENGTH_5 0 +#define ULCON_LENGTH_6 1 +#define ULCON_LENGTH_7 2 +#define ULCON_LENGTH_8 3 +#define SSCOM_UCON 0x04 /* UART control */ +#define UCON_TXINT_TYPE (1 << 9) /* Tx interrupt. 0=pulse,1=level */ +#define UCON_TXINT_TYPE_LEVEL UCON_TXINT_TYPE +#define UCON_TXINT_TYPE_PULSE 0 +#define UCON_RXINT_TYPE (1 << 8) /* Rx interrupt */ +#define UCON_RXINT_TYPE_LEVEL UCON_RXINT_TYPE +#define UCON_RXINT_TYPE_PULSE 0 +#define UCON_TOINT (1 << 7) /* Rx timeout interrupt */ +#define UCON_ERRINT (1 << 6) /* receive error interrupt */ +#define UCON_LOOP (1 << 5) /* loopback */ +#define UCON_SBREAK (1 << 4) /* send break */ +#define UCON_TXMODE_DISABLE (0 << 2) +#define UCON_TXMODE_INT (1 << 2) +#define UCON_TXMODE_DMA (2 << 2) +#define UCON_TXMODE_MASK (3 << 2) +#define UCON_RXMODE_DISABLE (0 << 0) +#define UCON_RXMODE_INT (1 << 0) +#define UCON_RXMODE_DMA (2 << 0) +#define UCON_RXMODE_MASK (3 << 0) +#define SSCOM_UFCON 0x08 /* FIFO control */ +#define UFCON_TXTRIGGER_0 (0 << 6) +#define UFCON_TXTRIGGER_4 (1 << 6) +#define UFCON_TXTRIGGER_8 (2 << 6) +#define UFCON_TXTRIGGER_16 (3 << 6) +#define UFCON_RXTRIGGER_4 (0 << 4) +#define UFCON_RXTRIGGER_8 (1 << 4) +#define UFCON_RXTRIGGER_12 (2 << 4) +#define UFCON_RXTRIGGER_16 (3 << 4) +#define UFCON_TXFIFO_RESET (1 << 2) +#define UFCON_RXFIFO_RESET (1 << 1) +#define UFCON_FIFO_ENABLE (1 << 0) +#define SSCOM_UMCON 0x0c /* MODEM control */ +#define UMCON_RTS (1 << 0) /* Request to send */ +#define SSCOM_UTRSTAT 0x10 /* Status register */ +#define UTRSTAT_TXSHIFTER_EMPTY ( 1<< 2) +#define UTRSTAT_TXEMPTY (1 << 1) /* TX fifo or buffer empty */ +#define UTRSTAT_RXREADY (1 << 0) /* RX fifo or buffer is not empty */ +#define SSCOM_UERSTAT 0x14 /* Error status register */ +#define UERSTAT_BREAK (1 << 3) /* Break signal, not 2410 */ +#define UERSTAT_FRAME (1 << 2) /* Frame error */ +#define UERSTAT_PARITY (1 << 1) /* Parity error, not 2410 */ +#define UERSTAT_OVERRUN (1 << 0) /* Overrun */ +#define UERSTAT_ALL_ERRORS \ + (UERSTAT_OVERRUN|UERSTAT_BREAK|UERSTAT_FRAME|UERSTAT_PARITY) +#define SSCOM_UFSTAT 0x18 /* Fifo status register */ +#define UFSTAT_RXFULL (1 <<8) /* Rx fifo full */ +#define UFSTAT_TXCOUNT_SHIFT 4 /* TX FIFO count */ +#define UFSTAT_TXCOUNT (0x0f << UFSTAT_TXCOUNT_SHIFT) +#define UFSTAT_RXCOUNT_SHIFT 0 /* RX FIFO count */ +#define UFSTAT_RXCOUNT (0x0f << UFSTAT_RXCOUNT_SHIFT) +#define SSCOM_UMSTAT 0x1c /* Modem status register */ +#define UMSTAT_CTS (1 << 0) /* Clear to send */ +#if _BYTE_ORDER == _LITTLE_ENDIAN +#define SSCOM_UTXH 0x20 /* Transmit data register */ +#define SSCOM_URXH 0x24 /* Receive data register */ +#else +#define SSCOM_UTXH 0x23 /* Transmit data register */ +#define SSCOM_URXH 0x27 /* Receive data register */ +#endif +#define SSCOM_UBRDIV 0x28 /* baud-reate divisor */ +#define SSCOM_SIZE 0x2c Modified: head/sys/arm/samsung/exynos/files.exynos5 ============================================================================== --- head/sys/arm/samsung/exynos/files.exynos5 Sun Jun 1 08:15:34 2014 (r266943) +++ head/sys/arm/samsung/exynos/files.exynos5 Sun Jun 1 08:34:45 2014 (r266944) @@ -19,7 +19,7 @@ arm/samsung/exynos/exynos5_common.c sta arm/samsung/exynos/exynos5_machdep.c standard arm/samsung/exynos/exynos5_combiner.c standard arm/samsung/exynos/exynos5_pad.c optional gpio -arm/samsung/exynos/uart.c optional uart +arm/samsung/exynos/exynos_uart.c optional uart arm/samsung/exynos/exynos5_ehci.c optional ehci arm/samsung/exynos/exynos5_fimd.c optional vt arm/samsung/exynos/exynos5_i2c.c optional iicbus From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 08:45:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3781B393; Sun, 1 Jun 2014 08:45:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B26625FB; Sun, 1 Jun 2014 08:45:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s518jRS9036723; Sun, 1 Jun 2014 08:45:27 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s518jR5d036721; Sun, 1 Jun 2014 08:45:27 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201406010845.s518jR5d036721@svn.freebsd.org> From: Ruslan Bukin Date: Sun, 1 Jun 2014 08:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266945 - head/sys/arm/samsung/exynos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 08:45:28 -0000 Author: br Date: Sun Jun 1 08:45:27 2014 New Revision: 266945 URL: http://svnweb.freebsd.org/changeset/base/266945 Log: Fix i2c communication interface to be compatible with vendor tools, e.g. embedded controller tool Submitted by: Maxim Ignatenko Modified: head/sys/arm/samsung/exynos/chrome_ec.c head/sys/arm/samsung/exynos/exynos5_i2c.c Modified: head/sys/arm/samsung/exynos/chrome_ec.c ============================================================================== --- head/sys/arm/samsung/exynos/chrome_ec.c Sun Jun 1 08:34:45 2014 (r266944) +++ head/sys/arm/samsung/exynos/chrome_ec.c Sun Jun 1 08:45:27 2014 (r266945) @@ -165,7 +165,7 @@ ec_command(uint8_t cmd, uint8_t *dout, u int i; msg_dout = malloc(dout_len + 4, M_DEVBUF, M_NOWAIT); - msg_dinp = malloc(dinp_len + 4, M_DEVBUF, M_NOWAIT); + msg_dinp = malloc(dinp_len + 3, M_DEVBUF, M_NOWAIT); if (ec_sc == NULL) return (-1); @@ -184,7 +184,7 @@ ec_command(uint8_t cmd, uint8_t *dout, u struct iic_msg msgs[] = { { 0x1e, IIC_M_WR, dout_len + 4, msg_dout, }, - { 0x1e, IIC_M_RD, dinp_len + 4, msg_dinp, }, + { 0x1e, IIC_M_RD, dinp_len + 3, msg_dinp, }, }; ret = iicbus_transfer(sc->dev, msgs, 2); @@ -196,7 +196,7 @@ ec_command(uint8_t cmd, uint8_t *dout, u } for (i = 0; i < dinp_len; i++) { - dinp[i] = msg_dinp[i + 3]; + dinp[i] = msg_dinp[i + 2]; }; free(msg_dout, M_DEVBUF); Modified: head/sys/arm/samsung/exynos/exynos5_i2c.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_i2c.c Sun Jun 1 08:34:45 2014 (r266944) +++ head/sys/arm/samsung/exynos/exynos5_i2c.c Sun Jun 1 08:45:27 2014 (r266945) @@ -372,6 +372,13 @@ i2c_read(device_t dev, char *buf, int le mtx_lock(&sc->mutex); /* dummy read */ + clear_ipend(sc); + error = wait_for_iif(sc); + if (error) { + DPRINTF("cant i2c read: iif error\n"); + mtx_unlock(&sc->mutex); + return (error); + } READ1(sc, I2CDS); DPRINTF("Read "); From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 10:22:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92564641; Sun, 1 Jun 2014 10:22:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FFEB2D09; Sun, 1 Jun 2014 10:22:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s51AMJhR083221; Sun, 1 Jun 2014 10:22:19 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s51AMJWw083217; Sun, 1 Jun 2014 10:22:19 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406011022.s51AMJWw083217@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 1 Jun 2014 10:22:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266946 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 10:22:19 -0000 Author: hselasky Date: Sun Jun 1 10:22:18 2014 New Revision: 266946 URL: http://svnweb.freebsd.org/changeset/base/266946 Log: Add basic support for isochronous transfers in host mode to the ISP/SAF1761 driver. Sponsored by: DARPA, AFRL Modified: head/sys/dev/usb/controller/saf1761_otg.c head/sys/dev/usb/controller/saf1761_otg_reg.h Modified: head/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.c Sun Jun 1 08:45:27 2014 (r266945) +++ head/sys/dev/usb/controller/saf1761_otg.c Sun Jun 1 10:22:18 2014 (r266946) @@ -112,6 +112,7 @@ SYSCTL_INT(_hw_usb_saf1761_otg, OID_AUTO static const struct usb_bus_methods saf1761_otg_bus_methods; static const struct usb_pipe_methods saf1761_otg_non_isoc_methods; static const struct usb_pipe_methods saf1761_otg_device_isoc_methods; +static const struct usb_pipe_methods saf1761_otg_host_isoc_methods; static saf1761_otg_cmd_t saf1761_host_setup_tx; static saf1761_otg_cmd_t saf1761_host_bulk_data_rx; @@ -758,7 +759,8 @@ saf1761_host_intr_data_rx(struct saf1761 temp = SOTG_PTD_DW3_ACTIVE | (td->toggle << 25) | SOTG_PTD_DW3_CERR_3; SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW3, temp); - temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8) | (td->interval & 0xF8); + temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8) | + (td->interval & 0xF8); SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW2, temp); temp = td->dw1_value | (1 << 10) /* IN-PID */ | (td->ep_index >> 1); @@ -847,7 +849,8 @@ saf1761_host_intr_data_tx(struct saf1761 temp = SOTG_PTD_DW3_ACTIVE | (td->toggle << 25) | SOTG_PTD_DW3_CERR_3; SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW3, temp); - temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8) | (td->interval & 0xF8); + temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8) | + (td->interval & 0xF8); SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW2, temp); temp = td->dw1_value | (0 << 10) /* OUT-PID */ | (td->ep_index >> 1); @@ -874,21 +877,160 @@ complete: static uint8_t saf1761_host_isoc_data_rx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { + uint32_t pdt_addr; + uint32_t temp; + + if (td->channel < SOTG_HOST_CHANNEL_MAX) { + uint32_t status; + uint32_t count; + + pdt_addr = SOTG_PTD(td->channel); + + status = saf1761_peek_host_status_le_4(sc, pdt_addr + SOTG_PTD_DW3); + + DPRINTFN(5, "STATUS=0x%08x\n", status); + + if (status & SOTG_PTD_DW3_ACTIVE) { + goto busy; + } else if (status & SOTG_PTD_DW3_HALTED) { + goto complete; + } + count = (status & SOTG_PTD_DW3_XFER_COUNT); + + /* verify the packet byte count */ + if (count != td->max_packet_size) { + if (count < td->max_packet_size) { + /* we have a short packet */ + td->short_pkt = 1; + } else { + /* invalid USB packet */ + td->error_any = 1; + goto complete; + } + } + + /* verify the packet byte count */ + if (count > td->remainder) { + /* invalid USB packet */ + td->error_any = 1; + goto complete; + } + + saf1761_read_host_memory(sc, td, count); + goto complete; + } + + if (saf1761_host_channel_alloc(sc, td)) + goto busy; + + /* receive one more packet */ + + pdt_addr = SOTG_PTD(td->channel); + + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW7, 0); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW6, 0); + + temp = (0xFC << td->uframe) & 0xFF; /* complete split */ + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW5, temp); + + temp = (1U << td->uframe); /* start split */ + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW4, temp); + + temp = SOTG_PTD_DW3_ACTIVE | SOTG_PTD_DW3_CERR_3; + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW3, temp); + + temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW2, temp); + + temp = td->dw1_value | (1 << 10) /* IN-PID */ | (td->ep_index >> 1); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW1, temp); + + temp = (td->ep_index << 31) | (1 << 29) /* pkt-multiplier */ | + (td->max_packet_size << 18) /* wMaxPacketSize */ | + (td->max_packet_size << 3) /* transfer count */ | + SOTG_PTD_DW0_VALID; + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW0, temp); + /* activate PTD */ SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_SKIP_PTD, (~sc->sc_host_isoc_map) | sc->sc_host_isoc_suspend_map); - +busy: return (1); /* busy */ +complete: + saf1761_host_channel_free(sc, td); + return (0); /* complete */ } static uint8_t saf1761_host_isoc_data_tx(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { + uint32_t pdt_addr; + uint32_t temp; + uint32_t count; + + if (td->channel < SOTG_HOST_CHANNEL_MAX) { + uint32_t status; + + pdt_addr = SOTG_PTD(td->channel); + + status = saf1761_peek_host_status_le_4(sc, pdt_addr + SOTG_PTD_DW3); + + DPRINTFN(5, "STATUS=0x%08x\n", status); + + if (status & SOTG_PTD_DW3_ACTIVE) { + goto busy; + } else if (status & SOTG_PTD_DW3_HALTED) { + goto complete; + } + + goto complete; + } + if (saf1761_host_channel_alloc(sc, td)) + goto busy; + + count = td->max_packet_size; + if (td->remainder < count) { + /* we have a short packet */ + td->short_pkt = 1; + count = td->remainder; + } + + saf1761_write_host_memory(sc, td, count); + + /* send one more packet */ + + pdt_addr = SOTG_PTD(td->channel); + + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW7, 0); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW6, 0); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW5, 0); + + temp = (1U << td->uframe); /* start split */ + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW4, temp); + + temp = SOTG_PTD_DW3_ACTIVE | SOTG_PTD_DW3_CERR_3; + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW3, temp); + + temp = (SOTG_HC_MEMORY_ADDR(SOTG_DATA_ADDR(td->channel)) << 8); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW2, temp); + + temp = td->dw1_value | (0 << 10) /* OUT-PID */ | (td->ep_index >> 1); + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW1, temp); + + temp = (td->ep_index << 31) | (1 << 29) /* pkt-multiplier */ | + (count << 18) /* wMaxPacketSize */ | + (count << 3) /* transfer count */ | + SOTG_PTD_DW0_VALID; + SAF1761_WRITE_LE_4(sc, pdt_addr + SOTG_PTD_DW0, temp); + /* activate PTD */ SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_SKIP_PTD, (~sc->sc_host_isoc_map) | sc->sc_host_isoc_suspend_map); - +busy: return (1); /* busy */ +complete: + saf1761_host_channel_free(sc, td); + return (0); /* complete */ } static void @@ -2371,7 +2513,7 @@ static const struct usb_pipe_methods saf }; /*------------------------------------------------------------------------* - * saf1761_otg isochronous support + * saf1761_otg device side isochronous support *------------------------------------------------------------------------*/ static void saf1761_otg_device_isoc_open(struct usb_xfer *xfer) @@ -2453,6 +2595,88 @@ static const struct usb_pipe_methods saf }; /*------------------------------------------------------------------------* + * saf1761_otg host side isochronous support + *------------------------------------------------------------------------*/ +static void +saf1761_otg_host_isoc_open(struct usb_xfer *xfer) +{ + return; +} + +static void +saf1761_otg_host_isoc_close(struct usb_xfer *xfer) +{ + saf1761_otg_device_done(xfer, USB_ERR_CANCELLED); +} + +static void +saf1761_otg_host_isoc_enter(struct usb_xfer *xfer) +{ + struct saf1761_otg_softc *sc = SAF1761_OTG_BUS2SC(xfer->xroot->bus); + uint32_t temp; + uint32_t nframes; + + DPRINTFN(6, "xfer=%p next=%d nframes=%d\n", + xfer, xfer->endpoint->isoc_next, xfer->nframes); + + /* get the current frame index - we don't need the high bits */ + + nframes = (SAF1761_READ_LE_4(sc, SOTG_FRINDEX) & SOTG_FRINDEX_MASK) >> 3; + + /* + * check if the frame index is within the window where the + * frames will be inserted + */ + temp = (nframes - xfer->endpoint->isoc_next) & (SOTG_FRINDEX_MASK >> 3); + + if ((xfer->endpoint->is_synced == 0) || + (temp < xfer->nframes)) { + /* + * If there is data underflow or the pipe queue is + * empty we schedule the transfer a few frames ahead + * of the current frame position. Else two isochronous + * transfers might overlap. + */ + xfer->endpoint->isoc_next = (nframes + 3) & (SOTG_FRINDEX_MASK >> 3); + xfer->endpoint->is_synced = 1; + DPRINTFN(3, "start next=%d\n", xfer->endpoint->isoc_next); + } + /* + * compute how many milliseconds the insertion is ahead of the + * current frame position: + */ + temp = (xfer->endpoint->isoc_next - nframes) & (SOTG_FRINDEX_MASK >> 3); + + /* + * pre-compute when the isochronous transfer will be finished: + */ + xfer->isoc_time_complete = + usb_isoc_time_expand(&sc->sc_bus, nframes) + temp + + xfer->nframes; + + /* compute frame number for next insertion */ + xfer->endpoint->isoc_next += xfer->nframes; + + /* setup TDs */ + saf1761_otg_setup_standard_chain(xfer); +} + +static void +saf1761_otg_host_isoc_start(struct usb_xfer *xfer) +{ + /* start TD chain */ + saf1761_otg_start_standard_chain(xfer); +} + +static const struct usb_pipe_methods saf1761_otg_host_isoc_methods = +{ + .open = saf1761_otg_host_isoc_open, + .close = saf1761_otg_host_isoc_close, + .enter = saf1761_otg_host_isoc_enter, + .start = saf1761_otg_host_isoc_start, +}; + +/*------------------------------------------------------------------------* * saf1761_otg root control support *------------------------------------------------------------------------* * Simulate a hardware HUB by handling all the necessary requests. @@ -3174,7 +3398,17 @@ saf1761_otg_xfer_setup(struct usb_setup_ td->ep_index = ep_no; td->ep_type = ep_type; td->dw1_value = dw1; - td->uframe = 0; + if (ep_type == UE_ISOCHRONOUS) { + if (parm->udev->speed == USB_SPEED_HIGH) { + uint8_t uframe_index = (ntd - 1 - n); + uframe_index <<= usbd_xfer_get_fps_shift(xfer); + td->uframe = (uframe_index & 7); + } else { + td->uframe = 0; + } + } else { + td->uframe = 0; + } if (ep_type == UE_INTERRUPT) { if (xfer->interval > 32) td->interval = (32 / 2) << 3; @@ -3202,6 +3436,8 @@ static void saf1761_otg_ep_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc, struct usb_endpoint *ep) { + uint16_t mps; + DPRINTFN(2, "endpoint=%p, addr=%d, endpt=%d, mode=%d\n", ep, udev->address, edesc->bEndpointAddress, udev->flags.usb_mode); @@ -3211,6 +3447,20 @@ saf1761_otg_ep_init(struct usb_device *u return; } + /* Verify wMaxPacketSize */ + mps = UGETW(edesc->wMaxPacketSize); + if (udev->speed == USB_SPEED_HIGH) { + if ((mps >> 11) & 3) { + DPRINTF("A packet multiplier different from " + "1 is not supported\n"); + return; + } + } + if (mps > SOTG_HS_MAX_PACKET_SIZE) { + DPRINTF("Packet size %d bigger than %d\n", + (int)mps, SOTG_HS_MAX_PACKET_SIZE); + return; + } if (udev->flags.usb_mode == USB_MODE_DEVICE) { if (udev->speed != USB_SPEED_FULL && udev->speed != USB_SPEED_HIGH) { @@ -3227,13 +3477,11 @@ saf1761_otg_ep_init(struct usb_device *u } } else { switch (edesc->bmAttributes & UE_XFERTYPE) { - case UE_CONTROL: - case UE_BULK: - case UE_INTERRUPT: - ep->methods = &saf1761_otg_non_isoc_methods; + case UE_ISOCHRONOUS: + ep->methods = &saf1761_otg_host_isoc_methods; break; default: - /* TODO */ + ep->methods = &saf1761_otg_non_isoc_methods; break; } } Modified: head/sys/dev/usb/controller/saf1761_otg_reg.h ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg_reg.h Sun Jun 1 08:45:27 2014 (r266945) +++ head/sys/dev/usb/controller/saf1761_otg_reg.h Sun Jun 1 10:22:18 2014 (r266946) @@ -183,6 +183,7 @@ /* Host controller specific registers */ #define SOTG_FRINDEX 0x002c +#define SOTG_FRINDEX_MASK 0x3fff #define SOTG_CONFIGFLAG 0x0060 #define SOTG_CONFIGFLAG_ENABLE (1 << 0) #define SOTG_PORTSC1 0x0064 From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 11:25:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8487C11; Sun, 1 Jun 2014 11:25:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C745F227A; Sun, 1 Jun 2014 11:25:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s51BPYhV011153; Sun, 1 Jun 2014 11:25:34 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s51BPYxp011152; Sun, 1 Jun 2014 11:25:34 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201406011125.s51BPYxp011152@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 1 Jun 2014 11:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266947 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 11:25:34 -0000 Author: jilles Date: Sun Jun 1 11:25:34 2014 New Revision: 266947 URL: http://svnweb.freebsd.org/changeset/base/266947 Log: sh: Avoid undefined behaviour shifting negative values left in arithmetic. With i386 base clang, arith_yacc.o remains unchanged. Modified: head/bin/sh/arith_yacc.c Modified: head/bin/sh/arith_yacc.c ============================================================================== --- head/bin/sh/arith_yacc.c Sun Jun 1 10:22:18 2014 (r266946) +++ head/bin/sh/arith_yacc.c Sun Jun 1 11:25:34 2014 (r266947) @@ -139,7 +139,7 @@ static arith_t do_binop(int op, arith_t case ARITH_SUB: return (uintmax_t)a - (uintmax_t)b; case ARITH_LSHIFT: - return a << b; + return (uintmax_t)a << b; case ARITH_RSHIFT: return a >> b; case ARITH_LT: From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 13:33:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BAD2DFF0; Sun, 1 Jun 2014 13:33:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A89C52D64; Sun, 1 Jun 2014 13:33:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s51DXMHL071550; Sun, 1 Jun 2014 13:33:22 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s51DXMtX071549; Sun, 1 Jun 2014 13:33:22 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201406011333.s51DXMtX071549@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 1 Jun 2014 13:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266948 - head/usr.bin/printf/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 13:33:22 -0000 Author: jilles Date: Sun Jun 1 13:33:22 2014 New Revision: 266948 URL: http://svnweb.freebsd.org/changeset/base/266948 Log: printf: Install tests/regress.missingpos1.out, fixing tests. Modified: head/usr.bin/printf/tests/Makefile Modified: head/usr.bin/printf/tests/Makefile ============================================================================== --- head/usr.bin/printf/tests/Makefile Sun Jun 1 11:25:34 2014 (r266947) +++ head/usr.bin/printf/tests/Makefile Sun Jun 1 13:33:22 2014 (r266948) @@ -15,6 +15,7 @@ FILES+= regress.m2.out FILES+= regress.m3.out FILES+= regress.m4.out FILES+= regress.m5.out +FILES+= regress.missingpos1.out FILES+= regress.s.out FILES+= regress.sh FILES+= regress.zero.out From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 16:57:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 516C7AE9; Sun, 1 Jun 2014 16:57:56 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id 33D532D8A; Sun, 1 Jun 2014 16:57:55 +0000 (UTC) Received: from bender.Home (97e07ba1.skybroadband.com [151.224.123.161]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 078D55DEBC; Sun, 1 Jun 2014 16:57:48 +0000 (UTC) Date: Sun, 1 Jun 2014 17:57:42 +0100 From: Andrew Turner To: Ruslan Bukin Subject: Re: svn commit: r266943 - in head/sys: arm/conf arm/samsung/exynos boot/fdt/dts/arm Message-ID: <20140601175742.069d2301@bender.Home> In-Reply-To: <201406010815.s518FYaj023520@svn.freebsd.org> References: <201406010815.s518FYaj023520@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 16:57:56 -0000 On Sun, 1 Jun 2014 08:15:34 +0000 (UTC) Ruslan Bukin wrote: > Author: br > Date: Sun Jun 1 08:15:34 2014 > New Revision: 266943 > URL: http://svnweb.freebsd.org/changeset/base/266943 > > Log: > Add support for Exynos 5420 Octa - 8-core > heterogeneous (big.LITTLE) ARM machine > (4 x Cortex-A15 @ 1.8Ghz, 4 x Cortex-A7 @ 1Ghz) > > Add configuration for Arndale Octa development board > > Added: > head/sys/arm/conf/ARNDALE-OCTA (contents, props changed) > head/sys/arm/conf/EXYNOS5.common (contents, props changed) > head/sys/arm/conf/EXYNOS5250 > - copied, changed from r266941, > head/sys/arm/conf/EXYNOS5250.common head/sys/arm/conf/EXYNOS5420 > (contents, props changed) head/sys/arm/samsung/exynos/std.exynos5250 > - copied unchanged from r266941, > head/sys/arm/samsung/exynos/std.exynos5 > head/sys/arm/samsung/exynos/std.exynos5420 (contents, props > changed) head/sys/boot/fdt/dts/arm/exynos5.dtsi (contents, props > changed) head/sys/boot/fdt/dts/arm/exynos5420-arndale-octa.dts > (contents, props changed) head/sys/boot/fdt/dts/arm/exynos5420.dtsi > (contents, props changed) Deleted: head/sys/arm/conf/EXYNOS5250.common > head/sys/arm/samsung/exynos/std.exynos5 > Modified: > head/sys/arm/conf/ARNDALE > head/sys/arm/conf/CHROMEBOOK > head/sys/boot/fdt/dts/arm/exynos5250-arndale.dts > head/sys/boot/fdt/dts/arm/exynos5250.dtsi The EXYNOS5250 and EXYNOS5420 configs are missing an ident value. This causes universe to break. The following patch fixes it. Andrew Index: EXYNOS5250 =================================================================== --- EXYNOS5250 (revision 266949) +++ EXYNOS5250 (working copy) @@ -17,6 +17,7 @@ # # $FreeBSD$ +ident EXYNOS5250 include "EXYNOS5.common" include "../samsung/exynos/std.exynos5250" Index: EXYNOS5420 =================================================================== --- EXYNOS5420 (revision 266949) +++ EXYNOS5420 (working copy) @@ -17,6 +17,7 @@ # # $FreeBSD$ +ident EXYNOS5420 include "EXYNOS5.common" include "../samsung/exynos/std.exynos5420" From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 17:09:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F4DCD9A; Sun, 1 Jun 2014 17:09:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C5952E2D; Sun, 1 Jun 2014 17:09:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s51H92T3071311; Sun, 1 Jun 2014 17:09:02 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s51H9218071309; Sun, 1 Jun 2014 17:09:02 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201406011709.s51H9218071309@svn.freebsd.org> From: Ruslan Bukin Date: Sun, 1 Jun 2014 17:09:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266950 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 17:09:03 -0000 Author: br Date: Sun Jun 1 17:09:02 2014 New Revision: 266950 URL: http://svnweb.freebsd.org/changeset/base/266950 Log: Add ident value. This fixes universe build. Pointed out by: andrew Modified: head/sys/arm/conf/EXYNOS5250 head/sys/arm/conf/EXYNOS5420 Modified: head/sys/arm/conf/EXYNOS5250 ============================================================================== --- head/sys/arm/conf/EXYNOS5250 Sun Jun 1 16:35:22 2014 (r266949) +++ head/sys/arm/conf/EXYNOS5250 Sun Jun 1 17:09:02 2014 (r266950) @@ -17,6 +17,7 @@ # # $FreeBSD$ +ident EXYNOS5250 include "EXYNOS5.common" include "../samsung/exynos/std.exynos5250" Modified: head/sys/arm/conf/EXYNOS5420 ============================================================================== --- head/sys/arm/conf/EXYNOS5420 Sun Jun 1 16:35:22 2014 (r266949) +++ head/sys/arm/conf/EXYNOS5420 Sun Jun 1 17:09:02 2014 (r266950) @@ -17,6 +17,7 @@ # # $FreeBSD$ +ident EXYNOS5420 include "EXYNOS5.common" include "../samsung/exynos/std.exynos5420" From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 17:44:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0190C5C7; Sun, 1 Jun 2014 17:44:56 +0000 (UTC) Received: from mail.machdep.com (mail.machdep.com [195.91.211.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA05320CC; Sun, 1 Jun 2014 17:44:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=machdep.com) by mail.machdep.com with smtp (Exim 4.82 (FreeBSD)) (envelope-from ) id 1Wr9EL-0000J0-JF; Sun, 01 Jun 2014 21:07:33 +0400 Received: by machdep.com (nbSMTP-1.00) for uid 1001 br@machdep.com; Sun, 1 Jun 2014 21:07:33 +0400 (MSK) Date: Sun, 1 Jun 2014 21:07:33 +0400 From: Ruslan Bukin To: Andrew Turner Subject: Re: svn commit: r266943 - in head/sys: arm/conf arm/samsung/exynos boot/fdt/dts/arm Message-ID: <20140601170733.GA1150@machdep.com> References: <201406010815.s518FYaj023520@svn.freebsd.org> <20140601175742.069d2301@bender.Home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20140601175742.069d2301@bender.Home> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 17:44:56 -0000 On Sun, Jun 01, 2014 at 05:57:42PM +0100, Andrew Turner wrote: > The EXYNOS5250 and EXYNOS5420 configs are missing an ident value. This > causes universe to break. The following patch fixes it. Thanks. From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 18:16:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A136ECCD; Sun, 1 Jun 2014 18:16:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B817234E; Sun, 1 Jun 2014 18:16:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s51IG3Lm002368; Sun, 1 Jun 2014 18:16:03 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s51IG28t002361; Sun, 1 Jun 2014 18:16:02 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201406011816.s51IG28t002361@svn.freebsd.org> From: Bryan Venteicher Date: Sun, 1 Jun 2014 18:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266951 - in head/sys/dev/virtio: . pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 18:16:03 -0000 Author: bryanv Date: Sun Jun 1 18:16:01 2014 New Revision: 266951 URL: http://svnweb.freebsd.org/changeset/base/266951 Log: Split the virtio.h header file into multiple files Reorganize the previous contexts of the file as it is in Linux. The eventual goal is to install the header files and share them between the kernel and bhyve. MFC after: 1 week Added: head/sys/dev/virtio/virtio_config.h (contents, props changed) head/sys/dev/virtio/virtio_ids.h (contents, props changed) Modified: head/sys/dev/virtio/pci/virtio_pci.c head/sys/dev/virtio/virtio.c head/sys/dev/virtio/virtio.h head/sys/dev/virtio/virtqueue.c Modified: head/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.c Sun Jun 1 17:09:02 2014 (r266950) +++ head/sys/dev/virtio/pci/virtio_pci.c Sun Jun 1 18:16:01 2014 (r266951) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/dev/virtio/virtio.c ============================================================================== --- head/sys/dev/virtio/virtio.c Sun Jun 1 17:09:02 2014 (r266950) +++ head/sys/dev/virtio/virtio.c Sun Jun 1 18:16:01 2014 (r266951) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "virtio_bus_if.h" Modified: head/sys/dev/virtio/virtio.h ============================================================================== --- head/sys/dev/virtio/virtio.h Sun Jun 1 17:09:02 2014 (r266950) +++ head/sys/dev/virtio/virtio.h Sun Jun 1 18:16:01 2014 (r266951) @@ -1,29 +1,27 @@ /*- - * This header is BSD licensed so anyone can use the definitions to implement - * compatible drivers/servers. + * Copyright (c) 2014, Bryan Venteicher + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice unmodified, this list of conditions, and the following + * disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of IBM nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD$ */ @@ -31,44 +29,9 @@ #ifndef _VIRTIO_H_ #define _VIRTIO_H_ -struct vq_alloc_info; - -/* VirtIO device IDs. */ -#define VIRTIO_ID_NETWORK 0x01 -#define VIRTIO_ID_BLOCK 0x02 -#define VIRTIO_ID_CONSOLE 0x03 -#define VIRTIO_ID_ENTROPY 0x04 -#define VIRTIO_ID_BALLOON 0x05 -#define VIRTIO_ID_IOMEMORY 0x06 -#define VIRTIO_ID_SCSI 0x08 -#define VIRTIO_ID_9P 0x09 - -/* Status byte for guest to report progress. */ -#define VIRTIO_CONFIG_STATUS_RESET 0x00 -#define VIRTIO_CONFIG_STATUS_ACK 0x01 -#define VIRTIO_CONFIG_STATUS_DRIVER 0x02 -#define VIRTIO_CONFIG_STATUS_DRIVER_OK 0x04 -#define VIRTIO_CONFIG_STATUS_FAILED 0x80 - -/* - * Generate interrupt when the virtqueue ring is - * completely used, even if we've suppressed them. - */ -#define VIRTIO_F_NOTIFY_ON_EMPTY (1 << 24) - -/* - * The guest should never negotiate this feature; it - * is used to detect faulty drivers. - */ -#define VIRTIO_F_BAD_FEATURE (1 << 30) +#include -/* - * Some VirtIO feature bits (currently bits 28 through 31) are - * reserved for the transport being used (eg. virtio_ring), the - * rest are per-device feature bits. - */ -#define VIRTIO_TRANSPORT_F_START 28 -#define VIRTIO_TRANSPORT_F_END 32 +struct vq_alloc_info; /* * Each virtqueue indirect descriptor list must be physically contiguous. Added: head/sys/dev/virtio/virtio_config.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/virtio/virtio_config.h Sun Jun 1 18:16:01 2014 (r266951) @@ -0,0 +1,61 @@ +/*- + * This header is BSD licensed so anyone can use the definitions to implement + * compatible drivers/servers. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _VIRTIO_CONFIG_H_ +#define _VIRTIO_CONFIG_H_ + +/* Status byte for guest to report progress. */ +#define VIRTIO_CONFIG_STATUS_RESET 0x00 +#define VIRTIO_CONFIG_STATUS_ACK 0x01 +#define VIRTIO_CONFIG_STATUS_DRIVER 0x03 +#define VIRTIO_CONFIG_STATUS_DRIVER_OK 0x04 +#define VIRTIO_CONFIG_STATUS_FAILED 0x80 + +/* + * Generate interrupt when the virtqueue ring is + * completely used, even if we've suppressed them. + */ +#define VIRTIO_F_NOTIFY_ON_EMPTY (1 << 24) + +/* + * The guest should never negotiate this feature; it + * is used to detect faulty drivers. + */ +#define VIRTIO_F_BAD_FEATURE (1 << 30) + +/* + * Some VirtIO feature bits (currently bits 28 through 31) are + * reserved for the transport being used (eg. virtio_ring), the + * rest are per-device feature bits. + */ +#define VIRTIO_TRANSPORT_F_START 28 +#define VIRTIO_TRANSPORT_F_END 32 + +#endif /* _VIRTIO_CONFIG_H_ */ Added: head/sys/dev/virtio/virtio_ids.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/virtio/virtio_ids.h Sun Jun 1 18:16:01 2014 (r266951) @@ -0,0 +1,44 @@ +/*- + * This header is BSD licensed so anyone can use the definitions to implement + * compatible drivers/servers. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _VIRTIO_IDS_H_ +#define _VIRTIO_IDS_H_ + +/* VirtIO device IDs. */ +#define VIRTIO_ID_NETWORK 0x01 +#define VIRTIO_ID_BLOCK 0x02 +#define VIRTIO_ID_CONSOLE 0x03 +#define VIRTIO_ID_ENTROPY 0x04 +#define VIRTIO_ID_BALLOON 0x05 +#define VIRTIO_ID_IOMEMORY 0x06 +#define VIRTIO_ID_SCSI 0x08 +#define VIRTIO_ID_9P 0x09 + +#endif /* _VIRTIO_IDS_H_ */ Modified: head/sys/dev/virtio/virtqueue.c ============================================================================== --- head/sys/dev/virtio/virtqueue.c Sun Jun 1 17:09:02 2014 (r266950) +++ head/sys/dev/virtio/virtqueue.c Sun Jun 1 18:16:01 2014 (r266951) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 20:19:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74268B04; Sun, 1 Jun 2014 20:19:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61A2F2D12; Sun, 1 Jun 2014 20:19:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s51KJIuL056887; Sun, 1 Jun 2014 20:19:18 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s51KJIh3056886; Sun, 1 Jun 2014 20:19:18 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201406012019.s51KJIh3056886@svn.freebsd.org> From: Hiren Panchasara Date: Sun, 1 Jun 2014 20:19:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266955 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 20:19:18 -0000 Author: hiren Date: Sun Jun 1 20:19:17 2014 New Revision: 266955 URL: http://svnweb.freebsd.org/changeset/base/266955 Log: DNOLD_IS_ECN introduced by r266941 is not required. DNOLD_* flags are for compat with old binaries. Suggested by: luigi Modified: head/sys/netpfil/ipfw/ip_dn_glue.c Modified: head/sys/netpfil/ipfw/ip_dn_glue.c ============================================================================== --- head/sys/netpfil/ipfw/ip_dn_glue.c Sun Jun 1 20:08:37 2014 (r266954) +++ head/sys/netpfil/ipfw/ip_dn_glue.c Sun Jun 1 20:19:17 2014 (r266955) @@ -83,7 +83,6 @@ struct dn_flow_set { #define DNOLD_QSIZE_IS_BYTES 0x0008 /* queue size is measured in bytes */ #define DNOLD_NOERROR 0x0010 /* do not report ENOBUFS on drops */ #define DNOLD_HAS_PROFILE 0x0020 /* the pipe has a delay profile. */ -#define DNOLD_IS_ECN 0x0040 #define DNOLD_IS_PIPE 0x4000 #define DNOLD_IS_QUEUE 0x8000 @@ -339,8 +338,6 @@ convertflags2new(int src) dst |= DN_IS_RED; if (src & DNOLD_IS_GENTLE_RED) dst |= DN_IS_GENTLE_RED; - if (src & DNOLD_IS_ECN) - dst |= DN_IS_ECN; if (src & DNOLD_HAS_PROFILE) dst |= DN_HAS_PROFILE; From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 00:21:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4771147B; Mon, 2 Jun 2014 00:21:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B65A2218; Mon, 2 Jun 2014 00:21:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s520Lgd5067179; Mon, 2 Jun 2014 00:21:42 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s520Lgp8067178; Mon, 2 Jun 2014 00:21:42 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201406020021.s520Lgp8067178@svn.freebsd.org> From: Eitan Adler Date: Mon, 2 Jun 2014 00:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266959 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 00:21:43 -0000 Author: eadler Date: Mon Jun 2 00:21:42 2014 New Revision: 266959 URL: http://svnweb.freebsd.org/changeset/base/266959 Log: arc: add linting for python files Added: head/.arclint (contents, props changed) Added: head/.arclint ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/.arclint Mon Jun 2 00:21:42 2014 (r266959) @@ -0,0 +1,9 @@ +{ + "linters": { + "python": { + "type": "pep8", + "exclude": "(contrib)", + "include": "(\\.py$)" + } + } +} From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 02:00:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA5CC6E; Mon, 2 Jun 2014 02:00:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6E192905; Mon, 2 Jun 2014 02:00:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5220IcX009180; Mon, 2 Jun 2014 02:00:18 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5220H9g009173; Mon, 2 Jun 2014 02:00:17 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201406020200.s5220H9g009173@svn.freebsd.org> From: Luiz Otavio O Souza Date: Mon, 2 Jun 2014 02:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266960 - in head: share/man/man4/man4.arm sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 02:00:19 -0000 Author: loos Date: Mon Jun 2 02:00:17 2014 New Revision: 266960 URL: http://svnweb.freebsd.org/changeset/base/266960 Log: Configure the analog input 7 which, on BBB, is connected to the 3V3B rail through a voltage divisor (R163 and R164 on page 4 of BBB schematic). Add a note about this on ti_adc(4) man page. The ti_adc(4) man page will first appear on 10.1-RELEASE. MFC after: 1 week Suggested by: Sulev-Madis Silber (ketas) Manual page reviewed by: brueffer (D127) Modified: head/share/man/man4/man4.arm/ti_adc.4 head/sys/arm/ti/ti_adc.c head/sys/arm/ti/ti_adcreg.h head/sys/arm/ti/ti_adcvar.h Modified: head/share/man/man4/man4.arm/ti_adc.4 ============================================================================== --- head/share/man/man4/man4.arm/ti_adc.4 Mon Jun 2 00:21:42 2014 (r266959) +++ head/share/man/man4/man4.arm/ti_adc.4 Mon Jun 2 02:00:17 2014 (r266960) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 21, 2014 +.Dd June 1, 2014 .Dt TI_ADC 4 .Os .Sh NAME @@ -78,8 +78,17 @@ dev.ti_adc.0.ain.6.enable: 1 dev.ti_adc.0.ain.6.open_delay: 0 dev.ti_adc.0.ain.6.samples_avg: 4 dev.ti_adc.0.ain.6.input: 2308 +dev.ti_adc.0.ain.7.enable: 1 +dev.ti_adc.0.ain.7.open_delay: 0 +dev.ti_adc.0.ain.7.samples_avg: 0 +dev.ti_adc.0.ain.7.input: 3812 .Ed .Pp +On Beaglebone-black the analog input 7 is connected to the 3V3B rail through +a voltage divisor (2:1). +The 3V3B voltage rail comes from the TL5209 LDO regulator which is limited +to 500mA maximum. +.Pp Global settings: .Bl -tag -width ".Va dev.ti_adc.0.clockdiv" .It Va dev.ti_adc.0.clockdiv @@ -112,8 +121,8 @@ It is made of a 12 bit value (0 ~ 4095). The .Nm driver first appeared in -.Fx 11.0 . +.Fx 10.1 . .Sh AUTHORS .An -nosplit The driver and this manual page was written by -.An Luiz Otavio O Souza Aq loos@FreeBSD.org +.An Luiz Otavio O Souza Aq loos@FreeBSD.org . Modified: head/sys/arm/ti/ti_adc.c ============================================================================== --- head/sys/arm/ti/ti_adc.c Mon Jun 2 00:21:42 2014 (r266959) +++ head/sys/arm/ti/ti_adc.c Mon Jun 2 02:00:17 2014 (r266960) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include -/* Define our 7 steps, one for each input channel. */ +/* Define our 8 steps, one for each input channel. */ static struct ti_adc_input ti_adc_inputs[TI_ADC_NPINS] = { { .stepconfig = ADC_STEPCFG1, .stepdelay = ADC_STEPDLY1 }, { .stepconfig = ADC_STEPCFG2, .stepdelay = ADC_STEPDLY2 }, @@ -59,6 +59,7 @@ static struct ti_adc_input ti_adc_inputs { .stepconfig = ADC_STEPCFG5, .stepdelay = ADC_STEPDLY5 }, { .stepconfig = ADC_STEPCFG6, .stepdelay = ADC_STEPDLY6 }, { .stepconfig = ADC_STEPCFG7, .stepdelay = ADC_STEPDLY7 }, + { .stepconfig = ADC_STEPCFG8, .stepdelay = ADC_STEPDLY8 }, }; static int ti_adc_samples[5] = { 0, 2, 4, 8, 16 }; Modified: head/sys/arm/ti/ti_adcreg.h ============================================================================== --- head/sys/arm/ti/ti_adcreg.h Mon Jun 2 00:21:42 2014 (r266959) +++ head/sys/arm/ti/ti_adcreg.h Mon Jun 2 02:00:17 2014 (r266960) @@ -81,6 +81,8 @@ #define ADC_STEPDLY6 0x090 #define ADC_STEPCFG7 0x094 #define ADC_STEPDLY7 0x098 +#define ADC_STEPCFG8 0x09c +#define ADC_STEPDLY8 0x0a0 #define ADC_STEP_DIFF_CNTRL (1 << 25) #define ADC_STEP_RFM_MSK 0x01800000 #define ADC_STEP_RFM_SHIFT 23 Modified: head/sys/arm/ti/ti_adcvar.h ============================================================================== --- head/sys/arm/ti/ti_adcvar.h Mon Jun 2 00:21:42 2014 (r266959) +++ head/sys/arm/ti/ti_adcvar.h Mon Jun 2 02:00:17 2014 (r266960) @@ -29,7 +29,7 @@ #ifndef _TI_ADCVAR_H_ #define _TI_ADCVAR_H_ -#define TI_ADC_NPINS 7 +#define TI_ADC_NPINS 8 #define ADC_READ4(_sc, reg) bus_read_4((_sc)->sc_mem_res, reg) #define ADC_WRITE4(_sc, reg, value) \ From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 02:20:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 081F55DD; Mon, 2 Jun 2014 02:20:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9B422A79; Mon, 2 Jun 2014 02:20:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s522KSER019971; Mon, 2 Jun 2014 02:20:28 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s522KSjd019970; Mon, 2 Jun 2014 02:20:28 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201406020220.s522KSjd019970@svn.freebsd.org> From: Luiz Otavio O Souza Date: Mon, 2 Jun 2014 02:20:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266961 - head/usr.sbin/bsnmpd/modules/snmp_lm75 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 02:20:29 -0000 Author: loos Date: Mon Jun 2 02:20:28 2014 New Revision: 266961 URL: http://svnweb.freebsd.org/changeset/base/266961 Log: Never, ever, abbreviate the month names on manual pages. Pointed out by: brueffer Pointy hat to: loos Modified: head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.3 Modified: head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.3 ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.3 Mon Jun 2 02:00:17 2014 (r266960) +++ head/usr.sbin/bsnmpd/modules/snmp_lm75/snmp_lm75.3 Mon Jun 2 02:20:28 2014 (r266961) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jun 1, 2014 +.Dd June 2, 2014 .Dt SNMP_LM75 3 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 03:03:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5936B111; Mon, 2 Jun 2014 03:03:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A6CE2E55; Mon, 2 Jun 2014 03:03:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5233wPT039793; Mon, 2 Jun 2014 03:03:58 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5233vWm039790; Mon, 2 Jun 2014 03:03:57 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201406020303.s5233vWm039790@svn.freebsd.org> From: Benjamin Kaduk Date: Mon, 2 Jun 2014 03:03:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266962 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 03:03:58 -0000 Author: bjk (doc committer) Date: Mon Jun 2 03:03:57 2014 New Revision: 266962 URL: http://svnweb.freebsd.org/changeset/base/266962 Log: Document some more socket features Add some mention of the functions used by protocol implementations, upcalls, and other general routines. Not all functionality is documented; in particular: o the *at() variants, which are useful only for implementing the corresponding syscalls. o soconnect2(), also only used to implement a syscall (socketpair()). o sockargs(), which is essentually unused and only tangentially socket-related. o selsocket(), which is commented as being present solely for use by netncp and netsmb. o getsockaddr(), which is just a convenience shortcut for copyin(). Reviewed by: jhb (previous version) Approved by: hrs (mentor) Modified: head/share/man/man9/Makefile head/share/man/man9/socket.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Jun 2 02:20:28 2014 (r266961) +++ head/share/man/man9/Makefile Mon Jun 2 03:03:57 2014 (r266962) @@ -1260,15 +1260,41 @@ MLINKS+=sleepqueue.9 init_sleepqueues.9 sleepqueue.9 sleepq_timedwait_sig.9 \ sleepqueue.9 sleepq_wait.9 \ sleepqueue.9 sleepq_wait_sig.9 -MLINKS+=socket.9 sobind.9 \ +MLINKS+=socket.9 soabort.9 \ + socket.9 soaccept.9 \ + socket.9 sobind.9 \ + socket.9 socheckuid.9 \ socket.9 soclose.9 \ socket.9 soconnect.9 \ socket.9 socreate.9 \ + socket.9 sodisconnect.9 \ + socket.9 sodupsockaddr.9 \ + socket.9 sofree.9 \ socket.9 sogetopt.9 \ + socket.9 sohasoutofband.9 \ + socket.9 solisten.9 \ + socket.9 solisten_proto.9 \ + socket.9 solisten_proto_check.9 \ + socket.9 sonewconn.9 \ + socket.9 sooptcopyin.9 \ + socket.9 sooptcopyout.9 \ + socket.9 sopoll.9 \ + socket.9 sopoll_generic.9 \ socket.9 soreceive.9 \ + socket.9 soreceive_dgram.9 \ + socket.9 soreceive_generic.9 \ + socket.9 soreceive_stream.9 \ + socket.9 soreserve.9 \ + socket.9 sorflush.9 \ socket.9 sosend.9 \ + socket.9 sosend_dgram.9 \ + socket.9 sosend_generic.9 \ socket.9 sosetopt.9 \ - socket.9 soshutdown.9 + socket.9 soshutdown.9 \ + socket.9 sotoxsocket.9 \ + socket.9 soupcall_clear.9 \ + socket.9 soupcall_set.9 \ + socket.9 sowakeup.9 MLINKS+=spl.9 spl0.9 \ spl.9 splbio.9 \ spl.9 splclock.9 \ Modified: head/share/man/man9/socket.9 ============================================================================== --- head/share/man/man9/socket.9 Mon Jun 2 02:20:28 2014 (r266961) +++ head/share/man/man9/socket.9 Mon Jun 2 03:03:57 2014 (r266962) @@ -1,5 +1,6 @@ .\"- .\" Copyright (c) 2006 Robert N. M. Watson +.\" Copyright (c) 2014 Benjamin J. Kaduk .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 12, 2013 +.Dd May 26, 2014 .Dt SOCKET 9 .Os .Sh NAME @@ -34,6 +35,12 @@ .Sh SYNOPSIS .In sys/socket.h .In sys/socketvar.h +.Ft void +.Fn soabort "struct socket *so" +.Ft int +.Fn soaccept "struct socket *so" "struct sockaddr **nam" +.Ft int +.Fn socheckuid "struct socket *so" "uid_t uid" .Ft int .Fn sobind "struct socket *so" "struct sockaddr *nam" "struct thread *td" .Ft void @@ -46,21 +53,97 @@ .Fa "struct ucred *cred" "struct thread *td" .Fc .Ft int -.Fn sogetopt "struct socket *so" "struct sockopt *sopt" +.Fn sodisconnect "struct socket *so" +.Ft struct sockaddr * +.Fn sodupsockaddr "const struct sockaddr *sa" "int mflags" +.Ft void +.Fn sofree "struct socket *so" +.Ft void +.Fn sohasoutofband "struct socket *so" +.Ft int +.Fn solisten "struct socket *so" "int backlog" "struct thread *td" +.Ft void +.Fn solisten_proto "struct socket *so" "int backlog" +.Ft int +.Fn solisten_proto_check "struct socket *so" +.Ft struct socket * +.Fn sonewconn "struct socket *head" "int connstatus" +.Ft int +.Fo sopoll +.Fa "struct socket *so" "int events" "struct ucred *active_cred" +.Fa "struct thread *td" +.Fc +.Ft int +.Fo sopoll_generic +.Fa "struct socket *so" "int events" "struct ucred *active_cred" +.Fa "struct thread *td" +.Fc .Ft int .Fo soreceive .Fa "struct socket *so" "struct sockaddr **psa" "struct uio *uio" .Fa "struct mbuf **mp0" "struct mbuf **controlp" "int *flagsp" .Fc .Ft int -.Fn sosetopt "struct socket *so" "struct sockopt *sopt" +.Fo soreceive_stream +.Fa "struct socket *so" "struct sockaddr **paddr" +.Fa "struct uio *uio" "struct mbuf **mp0" "struct mbuf **controlp" +.Fa "int *flagsp" +.Fc +.Ft int +.Fo soreceive_dgram +.Fa "struct socket *so" "struct sockaddr **paddr" +.Fa "struct uio *uio" "struct mbuf **mp0" "struct mbuf **controlp" +.Fa "int *flagsp" +.Fc +.Ft int +.Fo soreceive_generic +.Fa "struct socket *so" "struct sockaddr **paddr" +.Fa "struct uio *uio" "struct mbuf **mp0" "struct mbuf **controlp" +.Fa "int *flagsp" +.Fc +.Ft int +.Fn soreserve "struct socket *so" "u_long sndcc" "u_long rcvcc" +.Ft void +.Fn sorflush "struct socket *so" .Ft int .Fo sosend .Fa "struct socket *so" "struct sockaddr *addr" "struct uio *uio" .Fa "struct mbuf *top" "struct mbuf *control" "int flags" "struct thread *td" .Fc .Ft int +.Fo sosend_dgram +.Fa "struct socket *so" "struct sockaddr *addr" +.Fa "struct uio *uio" "struct mbuf *top" "struct mbuf *control" +.Fa "int flags" "struct thread *td" +.Fc +.Ft int +.Fo sosend_generic +.Fa "struct socket *so" "struct sockaddr *addr" +.Fa "struct uio *uio" "struct mbuf *top" "struct mbuf *control" +.Fa "int flags" "struct thread *td" +.Fc +.Ft int .Fn soshutdown "struct socket *so" "int how" +.Ft void +.Fn sotoxsocket "struct socket *so" "struct xsocket *xso" +.Ft void +.Fn soupcall_clear "struct socket *so" "int which" +.Ft void +.Fo soupcall_set +.Fa "struct socket *so" "int which" +.Fa "int (*func)(struct socket *, void *, int)" "void *arg" +.Fc +.Ft void +.Fn sowakeup "struct socket *so" "struct sockbuf *sb" +.In sys/sockopt.h +.Ft int +.Fn sosetopt "struct socket *so" "struct sockopt *sopt" +.Ft int +.Fn sogetopt "struct socket *so" "struct sockopt *sopt" +.Ft int +.Fn sooptcopyin "struct sockopt *sopt" "void *buf" "size_t len" "size_t minlen" +.Ft int +.Fn sooptcopyout "struct sockopt *sopt" "const void *buf" "size_t len" .Sh DESCRIPTION The kernel .Nm @@ -75,6 +158,11 @@ While the user API operates on file desc operate directly on .Vt "struct socket" pointers. +Some portions of the kernel API exist only to implement the user API, +and are not expected to be used by kernel code. +The portions of the socket API used by socket consumers and +implementations of network protocols will differ; some routines +are only useful for protocol implementors. .Pp Except where otherwise indicated, .Nm @@ -107,6 +195,31 @@ Sockets may be closed and freed using .Fn soclose , which has similar semantics to .Xr close 2 . +.Pp +In certain circumstances, it is appropriate to destroy a socket without +waiting for it to disconnect, for which +.Fn soabort +is used. +This is only appropriate for incoming connections which are in a +partially connected state. +It must be called on an unreferenced socket, by the thread which +removed the socket from its listen queue, to prevent races. +It will call into protocol code, so no socket locks may be held +over the call. +The caller of +.Fn soabort +is responsible for setting the VNET context. +The normal path to freeing a socket is +.Fn sofree , +which handles reference counting on the socket. +It should be called whenever a reference is released, and also whenever +reference flags are cleared in socket or protocol code. +Calls to +.Fn sofree +should not be made from outside the socket layer; outside callers +should use +.Fn soclose +instead. .Ss Connections and Addresses The .Fn sobind @@ -146,12 +259,19 @@ fails, the caller must manually clear th .Dv SS_ISCONNECTING flag. .Pp +A call to +.Fn sodisconnect +disconnects the socket without closing it. +.Pp The .Fn soshutdown function is equivalent to the .Xr shutdown 2 system call, and causes part or all of a connection on a socket to be closed down. +.Pp +Sockets are transitioned from non-listening status to listening with +.Fn solisten . .Ss Socket Options The .Fn sogetopt @@ -195,6 +315,60 @@ Kernel space pointer to the argument val .It Va sopt_valsize Size of the argument value in bytes. .El +.Ss Socket Upcalls +In order for the owner of a socket to be notified when the socket +is ready to send or receive data, an upcall may be registered on +the socket. +The upcall is a function that will be called by the socket framework +when a socket buffer associated with the given socket is ready for +reading or writing. +.Fn soupcall_set +is used to register a socket upcall. +The function +.Va func +is registered, and the pointer +.Va arg +will be passed as its second argument when it is called by the framework. +The possible values for +.Va which +are +.Dv SO_RCV +and +.Dv SO_SND , +which register upcalls for receive and send events, respectively. +The upcall function +.Fn func +must return either +.Dv SU_OK +or +.Dv SU_ISCONNECTED , +depending on whether or not a call to +.Xr soisconnected +should be made by the socket framework after the upcall returns. +The upcall +.Va func +cannot call +.Xr soisconnected +itself due to lock ordering with the socket buffer lock. +Only +.Dv SO_RCV +upcalls should return +.Dv SU_ISCONNECTED . +When a +.Dv SO_RCV +upcall returns +.Dv SU_ISCONNECTED , +the upcall will be removed from the socket. +.Pp +Upcalls are removed from their socket by +.Fn soupcall_clear . +The +.Va which +argument again specifies whether the sending or receiving upcall is to +be cleared, with +.Dv SO_RCV +or +.Dv SO_SND . .Ss Socket I/O The .Fn soreceive @@ -281,6 +455,121 @@ context, or with a mutex held, will wish the .Dv MSG_DONTWAIT flag in order to prevent these functions from sleeping. +.Pp +A socket can be queried for readability, writability, out-of-band data, +or end-of-file using +.Fn sopoll . +The possible values for +.Va events +are as for +.Xr poll 2 , +with symbolic values +.Dv POLLIN , +.Dv POLLPRI , +.Dv POLLOUT , +.Dv POLLRDNORM , +.Dv POLLWRNORM , +.Dv POLLRDBAND , +and +.Dv POLLINGEOF +taken from +.In sys/poll.h . +.Pp +Calls to +.Fn soaccept +pass through to the protocol's accept routine to accept an incoming connection. +.Ss Socket Utility Functions +The uid of a socket's credential may be compared against a +.Va uid +with +.Fn socheckuid . +.Pp +A copy of an existing +.Vt struct sockaddr +may be made using +.Fn sodupsockaddr . +.Pp +Protocol implementations notify the socket layer of the arrival of +out-of-band data using +.Fn sohasoutofband , +so that the socket layer can notify socket consumers of the available data. +.Pp +An +.Dq external-format +version of a +.Vt struct socket +can be created using +.Fn sotoxsocket , +suitable for isolating user code from changes in the kernel structure. +.Ss Protocol Implementations +Protocols must supply an implementation for +.Fn solisten ; +such protocol implementations can call back into the socket layer using +.Fn solisten_proto_check +and +.Fn solisten_proto +to check and set the socket-layer listen state. +These callbacks are provided so that the protocol implementation +can order the socket layer and protocol locks as necessary. +Protocols must supply an implementation of +.Fn soreceive ; +the functions +.Fn soreceive_stream , +.Fn soreceive_dgram , +and +.Fn soreceive_generic +are supplied for use by such implementations. +.Pp +Protocol implementations can use +.Fn sonewconn +to create a socket and attach protocol state to that socket. +This can be used to create new sockets available for +.Fn soaccept +on a listen socket. +The returned socket has a reference count of zero. +.Pp +Protocols must supply an implementation for +.Fn sopoll ; +.Fn sopoll_generic +is provided for the use by protocol implementations. +.Pp +The functions +.Fn sosend_dgram +and +.Fn sosend_generic +are supplied to assist in protocol implementations of +.Fn sosend . +.Pp +When a protocol creates a new socket structure, it is necessary to +reserve socket buffer space for that socket, by calling +.Fn soreserve . +The rough inverse of this reservation is performed by +.Fn sorflush , +which is called automatically by the socket framework. +.Pp +When a protocol needs to wake up threads waiting for the socket to +become ready to read or write, variants of +.Fn sowakeup +are used. +The +.Fn sowakeup +function should not be called directly by protocol code, instead use the +wrappers +.Fn sorwakeup , +.Fn sorwakeup_locked , +.Fn sowwakeup , +and +.Fn sowwakeup_locked +for readers and writers, with the corresponding socket buffer lock +not already locked, or already held, respectively. +.Pp +The functions +.Fn sooptcopyin +and +.Fn sooptcopyout +are useful for transferring +.Vt struct sockopt +data between user and kernel code. .Sh SEE ALSO .Xr bind 2 , .Xr close 2 , @@ -304,7 +593,9 @@ This manual page was introduced in .Fx 7.0 . .Sh AUTHORS This manual page was written by -.An Robert Watson . +.An Robert Watson +and +.An Benjamin Kaduk . .Sh BUGS The use of explicitly passed credentials, credentials hung from explicitly passed threads, the credential on From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 03:07:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5CFA345; Mon, 2 Jun 2014 03:07:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C386F2E94; Mon, 2 Jun 2014 03:07:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5237GPq040532; Mon, 2 Jun 2014 03:07:16 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5237GZb040530; Mon, 2 Jun 2014 03:07:16 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201406020307.s5237GZb040530@svn.freebsd.org> From: Benjamin Kaduk Date: Mon, 2 Jun 2014 03:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266963 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 03:07:16 -0000 Author: bjk (doc committer) Date: Mon Jun 2 03:07:16 2014 New Revision: 266963 URL: http://svnweb.freebsd.org/changeset/base/266963 Log: Note that recording is not supported for snd_envy24* PR: docs/166755 Approved by: hrs (mentor) Modified: head/share/man/man4/snd_envy24.4 head/share/man/man4/snd_envy24ht.4 Modified: head/share/man/man4/snd_envy24.4 ============================================================================== --- head/share/man/man4/snd_envy24.4 Mon Jun 2 03:03:57 2014 (r266962) +++ head/share/man/man4/snd_envy24.4 Mon Jun 2 03:07:16 2014 (r266963) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 30, 2006 +.Dd June 1, 2014 .Dt SND_ENVY24 4 .Os .Sh NAME @@ -65,6 +65,8 @@ M-Audio Delta Dio 2496 .It Terratec DMX 6fire .El +Only analog playback is supported. +Recording and other features of these cards are not supported. .Sh SEE ALSO .Xr sound 4 .Sh HISTORY Modified: head/share/man/man4/snd_envy24ht.4 ============================================================================== --- head/share/man/man4/snd_envy24ht.4 Mon Jun 2 03:03:57 2014 (r266962) +++ head/share/man/man4/snd_envy24ht.4 Mon Jun 2 03:07:16 2014 (r266963) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 28, 2007 +.Dd June 1, 2014 .Dt SND_ENVY24HT 4 .Os .Sh NAME @@ -85,6 +85,8 @@ Terratec PHASE 22 .It Terratec PHASE 28 .El +Only analog playback is supported. +Recording and other features of these cards are not supported. .Sh SEE ALSO .Xr sound 4 .Sh HISTORY From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 03:27:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4327BE6; Mon, 2 Jun 2014 03:27:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1DFF2075; Mon, 2 Jun 2014 03:27:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s523RXiO049724; Mon, 2 Jun 2014 03:27:33 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s523RXst049723; Mon, 2 Jun 2014 03:27:33 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201406020327.s523RXst049723@svn.freebsd.org> From: John-Mark Gurney Date: Mon, 2 Jun 2014 03:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266964 - head/sys/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 03:27:33 -0000 Author: jmg Date: Mon Jun 2 03:27:33 2014 New Revision: 266964 URL: http://svnweb.freebsd.org/changeset/base/266964 Log: enable sound modules on arm.. This is necessary to get the uaudio module installed... Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Jun 2 03:07:16 2014 (r266963) +++ head/sys/modules/Makefile Mon Jun 2 03:27:33 2014 (r266964) @@ -778,6 +778,7 @@ _zfs= zfs .if ${MACHINE_CPUARCH} == "arm" _cfi= cfi _cpsw= cpsw +_sound= sound .endif .if ${MACHINE_CPUARCH} == "ia64" From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 07:08:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A156CBFF; Mon, 2 Jun 2014 07:08:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E7D72145; Mon, 2 Jun 2014 07:08:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5278Yg2047588; Mon, 2 Jun 2014 07:08:34 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5278YsX047587; Mon, 2 Jun 2014 07:08:34 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406020708.s5278YsX047587@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 2 Jun 2014 07:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266969 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 07:08:34 -0000 Author: hselasky Date: Mon Jun 2 07:08:34 2014 New Revision: 266969 URL: http://svnweb.freebsd.org/changeset/base/266969 Log: Change type of the DMA address so that on PAE platforms we get can 64-bit DMA addresses even though the USB stack currently only uses 32-bit DMA. Suggested by: Kohji Okuno Modified: head/sys/dev/usb/usb_busdma.h Modified: head/sys/dev/usb/usb_busdma.h ============================================================================== --- head/sys/dev/usb/usb_busdma.h Mon Jun 2 06:15:38 2014 (r266968) +++ head/sys/dev/usb/usb_busdma.h Mon Jun 2 07:08:34 2014 (r266969) @@ -62,7 +62,7 @@ typedef void (usb_dma_callback_t)(struct */ struct usb_page { #if USB_HAVE_BUSDMA - bus_size_t physaddr; + bus_addr_t physaddr; void *buffer; /* non Kernel Virtual Address */ #endif }; @@ -75,7 +75,7 @@ struct usb_page { struct usb_page_search { void *buffer; #if USB_HAVE_BUSDMA - bus_size_t physaddr; + bus_addr_t physaddr; #endif usb_size_t length; }; From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 08:19:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76B4444A; Mon, 2 Jun 2014 08:19:45 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id ECCCB2797; Mon, 2 Jun 2014 08:19:44 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s528JfZ0012953 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 2 Jun 2014 12:19:41 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s528JfA8012952; Mon, 2 Jun 2014 12:19:41 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 2 Jun 2014 12:19:41 +0400 From: Gleb Smirnoff To: Alan Somers Subject: Re: svn commit: r266860 - in head: sys/net sys/netinet sys/netinet6 tests/sys/netinet Message-ID: <20140602081941.GO50679@FreeBSD.org> References: <201405292103.s4TL3ovP019075@svn.freebsd.org> <20140530081153.GY50679@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 08:19:45 -0000 On Fri, May 30, 2014 at 08:55:33AM -0600, Alan Somers wrote: A> On Fri, May 30, 2014 at 2:11 AM, Gleb Smirnoff wrote: A> > On Thu, May 29, 2014 at 09:03:50PM +0000, Alan Somers wrote: A> > A> Author: asomers A> > A> Date: Thu May 29 21:03:49 2014 A> > A> New Revision: 266860 A> > A> URL: http://svnweb.freebsd.org/changeset/base/266860 A> > A> A> > A> Log: A> > A> Fix unintended KBI change from r264905. Add _fib versions of A> > A> ifa_ifwithnet() and ifa_ifwithdstaddr() The legacy functions will call the A> > A> _fib() versions with RT_ALL_FIBS, preserving legacy behavior. A> > A> > Is this intended for MFC? If not, then I'd say that API bloat hurts A> > more than KBI change in head/. A> A> Yes, it's intended for MFC. Is it possible to make API in head more strict and legacy free, then? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 10:25:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B9A1BA; Mon, 2 Jun 2014 10:25:05 +0000 (UTC) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.81]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF5EA2251; Mon, 2 Jun 2014 10:25:04 +0000 (UTC) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1WrPAF-0000wV-1n; Mon, 02 Jun 2014 12:08:23 +0200 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: "Bjoern A. Zeeb" , "Gleb Smirnoff" Subject: Re: svn commit: r266822 - head/sys/netipsec References: <201405282301.s4SN1Kcv020803@svn.freebsd.org> <20140529034442.GS50679@FreeBSD.org> Date: Mon, 02 Jun 2014 12:08:21 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <20140529034442.GS50679@FreeBSD.org> User-Agent: Opera Mail/12.17 (Win32) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: - X-Spam-Score: -1.5 X-Spam-Status: No, score=-1.5 required=5.0 tests=ALL_TRUSTED, BAYES_05 autolearn=disabled version=3.3.1 X-Scan-Signature: 74bd734068bee68206891dc8710ce62a Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 10:25:05 -0000 On Thu, 29 May 2014 05:44:42 +0200, Gleb Smirnoff wrote: > On Wed, May 28, 2014 at 11:01:20PM +0000, Bjoern A. Zeeb wrote: > B> Author: bz > B> Date: Wed May 28 23:01:20 2014 > B> New Revision: 266822 > B> URL: http://svnweb.freebsd.org/changeset/base/266822 > B> > B> Log: > B> Use IPv4 statistics in ipsec4_process_packet() rather than the IPv6 > B> version. This also unbreaks the NOINET6 builds after r266800. > B> > B> Modified: > B> head/sys/netipsec/ipsec_output.c > B> > B> Modified: head/sys/netipsec/ipsec_output.c > B> > ============================================================================== > B> --- head/sys/netipsec/ipsec_output.c Wed May 28 19:59:27 > 2014 (r266821) > B> +++ head/sys/netipsec/ipsec_output.c Wed May 28 23:01:20 > 2014 (r266822) > B> @@ -576,7 +576,7 @@ ipsec4_process_packet( > B> DPRINTF(("%s: unsupported protocol family %u\n", > B> __func__, dst->sa.sa_family)); > B> error = EPFNOSUPPORT; > B> - IPSEC6STAT_INC(ips_out_inval); > B> + IPSECSTAT_INC(ips_out_inval); > B> goto bad; > B> } > B> error = (*sav->tdb_xform->xf_output)(m, isr, NULL, i, off); > B> @@ -739,4 +739,4 @@ bad: > B> m_freem(m); > B> return error; > B> } > B> -#endif /*INET6*/ > B> \ No newline at end of file > B> +#endif /*INET6*/ > > Is there any reason to keep the line '\ No newline at end of file' when > it is no longer at the end of the file? > The '\ No newline at end of file' is part of the output of svn diff. It is not actual text in the file. I hope... :-) NB: editors on Windows very often forget the last newline, so I see this message a lot at my work. Ronald. From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 13:48:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 236B47B0; Mon, 2 Jun 2014 13:48:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FB2426CA; Mon, 2 Jun 2014 13:48:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s52DmvvE028593; Mon, 2 Jun 2014 13:48:57 GMT (envelope-from gahr@svn.freebsd.org) Received: (from gahr@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s52DmvME028590; Mon, 2 Jun 2014 13:48:57 GMT (envelope-from gahr@svn.freebsd.org) Message-Id: <201406021348.s52DmvME028590@svn.freebsd.org> From: Pietro Cerutti Date: Mon, 2 Jun 2014 13:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266971 - in head: lib/libc/stdio tools/regression/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 13:48:58 -0000 Author: gahr (ports committer) Date: Mon Jun 2 13:48:57 2014 New Revision: 266971 URL: http://svnweb.freebsd.org/changeset/base/266971 Log: - Return NULL and set errno to EINVAL if size is 0 (as required by POSIX). Update the manpage to reflect this change. - Always set the current position to the first null-byte when opening in append mode. This makes the implementation compatible with glibc's. Update the test suite. Reported by: pho Approved by: cognet Modified: head/lib/libc/stdio/fmemopen.c head/lib/libc/stdio/fopen.3 head/tools/regression/lib/libc/stdio/test-fmemopen.c Modified: head/lib/libc/stdio/fmemopen.c ============================================================================== --- head/lib/libc/stdio/fmemopen.c Mon Jun 2 10:14:03 2014 (r266970) +++ head/lib/libc/stdio/fmemopen.c Mon Jun 2 13:48:57 2014 (r266971) @@ -57,6 +57,14 @@ fmemopen(void * __restrict buf, size_t s int flags, rc; /* + * POSIX says we shall return EINVAL if size is 0. + */ + if (size == 0) { + errno = EINVAL; + return (NULL); + } + + /* * Retrieve the flags as used by open(2) from the mode argument, and * validate them. */ @@ -119,14 +127,7 @@ fmemopen(void * __restrict buf, size_t s */ switch (mode[0]) { case 'a': - if (ck->bin) { - /* - * This isn't useful, since the buffer isn't allowed - * to grow. - */ - ck->off = ck->len = size; - } else - ck->off = ck->len = strnlen(ck->buf, ck->size); + ck->off = ck->len = strnlen(ck->buf, ck->size); break; case 'r': ck->len = size; Modified: head/lib/libc/stdio/fopen.3 ============================================================================== --- head/lib/libc/stdio/fopen.3 Mon Jun 2 10:14:03 2014 (r266970) +++ head/lib/libc/stdio/fopen.3 Mon Jun 2 13:48:57 2014 (r266971) @@ -302,6 +302,15 @@ for any of the errors specified for the .Xr fclose 3 and .Xr fflush 3 . +.Pp +The +.Fn fmemopen +function +may also fail and set +.Va errno +if the +.Fa size +argument is 0. .Sh SEE ALSO .Xr open 2 , .Xr fclose 3 , Modified: head/tools/regression/lib/libc/stdio/test-fmemopen.c ============================================================================== --- head/tools/regression/lib/libc/stdio/test-fmemopen.c Mon Jun 2 10:14:03 2014 (r266970) +++ head/tools/regression/lib/libc/stdio/test-fmemopen.c Mon Jun 2 13:48:57 2014 (r266971) @@ -138,6 +138,13 @@ test_autoalloc() /* Close the FILE *. */ rc = fclose(fp); assert(rc == 0); + + /* Open a FILE * using a wrong mode */ + fp = fmemopen(NULL, 512, "r"); + assert(fp == NULL); + + fp = fmemopen(NULL, 512, "w"); + assert(fp == NULL); } void @@ -241,6 +248,44 @@ test_binary() assert(rc == 0); } +void +test_append_binary_pos() +{ + /* + * For compatibility with other implementations (glibc), we set the + * position to 0 when opening an automatically allocated binary stream + * for appending. + */ + + FILE *fp; + + fp = fmemopen(NULL, 16, "ab+"); + assert(ftell(fp) == 0L); + fclose(fp); + + /* + * Make sure that a pre-allocated buffer behaves correctly. + */ + char buf[] = "Hello"; + fp = fmemopen(buf, sizeof(buf), "ab+"); + assert(ftell(fp) == 5); + fclose(fp); +} + +void +test_size_0() +{ + /* + * POSIX mandates that we return EINVAL if size is 0 + */ + + FILE *fp; + + fp = fmemopen(NULL, 0, "r+"); + assert(fp == NULL); + assert(errno == EINVAL); +} + int main(void) { @@ -248,5 +293,7 @@ main(void) test_preexisting(); test_data_length(); test_binary(); + test_append_binary_pos(); + test_size_0(); return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 15:05:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C21ABB5; Mon, 2 Jun 2014 15:05:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19C452056; Mon, 2 Jun 2014 15:05:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s52F5PuV064452; Mon, 2 Jun 2014 15:05:25 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s52F5P1D064451; Mon, 2 Jun 2014 15:05:25 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201406021505.s52F5P1D064451@svn.freebsd.org> From: Ivan Voras Date: Mon, 2 Jun 2014 15:05:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266972 - head/sbin/geom/class/label X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 15:05:26 -0000 Author: ivoras Date: Mon Jun 2 15:05:25 2014 New Revision: 266972 URL: http://svnweb.freebsd.org/changeset/base/266972 Log: Document the diskid automatic label class. While there, also document the glabel "native" labels and explain why there are additional nodes created for nested GEOM classes. Reminded by: jmg Modified: head/sbin/geom/class/label/glabel.8 Modified: head/sbin/geom/class/label/glabel.8 ============================================================================== --- head/sbin/geom/class/label/glabel.8 Mon Jun 2 13:48:57 2014 (r266971) +++ head/sbin/geom/class/label/glabel.8 Mon Jun 2 15:05:25 2014 (r266972) @@ -130,8 +130,26 @@ GPT UUIDs (directory .Pa /dev/gptid/ ) . .El .Pp -Generic labels are created in the directory -.Pa /dev/label/ . +Generic disk ID strings are exported as labels in the format +.Pa /dev/diskid/GEOM_CLASS-ident +e.g. +.Pa /dev/diskid/DISK-6QG3Z026 . +.Pp +Generic labels created and managed solely by +.Xr glabel 8 +are created in the +.Pa /dev/label/ +directory. +.Pp +Note that for all label types, nested GEOM classes will cause additional +device nodes to be created, with context-specific data appended to their +names. E.g. for every node like +.Pa /dev/label/bigdisk +there will be additional entries for any partitions which the device +contains, like +.Pa /dev/label/bigdiskp1 +and +.Pa /dev/label/bigdiskp1a . .Pp The first argument to .Nm From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 17:54:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0B37ECD; Mon, 2 Jun 2014 17:54:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD745222C; Mon, 2 Jun 2014 17:54:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s52HsgER039643; Mon, 2 Jun 2014 17:54:42 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s52Hsd1B039620; Mon, 2 Jun 2014 17:54:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201406021754.s52Hsd1B039620@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 2 Jun 2014 17:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 17:54:43 -0000 Author: marcel Date: Mon Jun 2 17:54:39 2014 New Revision: 266974 URL: http://svnweb.freebsd.org/changeset/base/266974 Log: Introduce a procedural interface to the ifnet structure. The new interface allows the ifnet structure to be defined as an opaque type in NIC drivers. This then allows the ifnet structure to be changed without a need to change or recompile NIC drivers. Put differently, NIC drivers can be written and compiled once and be used with different network stack implementations, provided of course that those network stack implementations have an API and ABI compatible interface. This commit introduces the 'if_t' type to replace 'struct ifnet *' as the type of a network interface. The 'if_t' type is defined as 'void *' to enable the compiler to perform type conversion to 'struct ifnet *' and vice versa where needed and without warnings. The functions that implement the API are the only functions that need to have an explicit cast. The MII code has been converted to use the driver API to avoid unnecessary code churn. Code churn comes from having to work with both converted and unconverted drivers in correlation with having callback functions that take an interface. By converting the MII code first, the callback functions can be defined so that the compiler will perform the typecasts automatically. As soon as all drivers have been converted, the if_t type can be redefined as needed and the API functions can be fix to not need an explicit cast. The immediate benefactors of this change are: 1. Juniper Networks - The network stack implementation in Junos is entirely different from FreeBSD's one and this change allows Juniper to build "stock" NIC drivers that can be used in combination with both the FreeBSD and Junos stacks. 2. FreeBSD - This change opens the door towards changing ifnet and implementing new features and optimizations in the network stack without it requiring a change in the many NIC drivers FreeBSD has. Submitted by: Anuranjan Shukla Reviewed by: glebius@ Obtained from: Juniper Networks, Inc. Modified: head/sys/dev/dc/dcphy.c head/sys/dev/dc/pnphy.c head/sys/dev/fxp/inphy.c head/sys/dev/mii/brgphy.c head/sys/dev/mii/e1000phy.c head/sys/dev/mii/ip1000phy.c head/sys/dev/mii/jmphy.c head/sys/dev/mii/mii.c head/sys/dev/mii/miivar.h head/sys/dev/mii/nsphy.c head/sys/dev/mii/rgephy.c head/sys/dev/mii/truephy.c head/sys/dev/netmap/netmap_generic.c head/sys/dev/netmap/netmap_kern.h head/sys/kern/kern_poll.c head/sys/net/if.c head/sys/net/if_media.h head/sys/net/if_var.h head/sys/net/ifq.h Modified: head/sys/dev/dc/dcphy.c ============================================================================== --- head/sys/dev/dc/dcphy.c Mon Jun 2 17:34:08 2014 (r266973) +++ head/sys/dev/dc/dcphy.c Mon Jun 2 17:54:39 2014 (r266974) @@ -153,7 +153,7 @@ dcphy_attach(device_t dev) &dcphy_funcs, 0); /*PHY_RESET(sc);*/ - dc_sc = sc->mii_pdata->mii_ifp->if_softc; + dc_sc = if_getsoftc(sc->mii_pdata->mii_ifp); CSR_WRITE_4(dc_sc, DC_10BTSTAT, 0); CSR_WRITE_4(dc_sc, DC_10BTCTRL, 0); @@ -191,7 +191,7 @@ dcphy_service(struct mii_softc *sc, stru int reg; u_int32_t mode; - dc_sc = mii->mii_ifp->if_softc; + dc_sc = if_getsoftc(mii->mii_ifp); switch (cmd) { case MII_POLLSTAT: @@ -201,7 +201,7 @@ dcphy_service(struct mii_softc *sc, stru /* * If the interface is not up, don't do anything. */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) + if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0) break; mii->mii_media_active = IFM_NONE; @@ -251,7 +251,7 @@ dcphy_service(struct mii_softc *sc, stru /* * Is the interface even up? */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) + if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0) return (0); /* @@ -298,12 +298,12 @@ dcphy_status(struct mii_softc *sc) int anlpar, tstat; struct dc_softc *dc_sc; - dc_sc = mii->mii_ifp->if_softc; + dc_sc = if_getsoftc(mii->mii_ifp); mii->mii_media_status = IFM_AVALID; mii->mii_media_active = IFM_ETHER; - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) + if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0) return; tstat = CSR_READ_4(dc_sc, DC_10BTSTAT); @@ -378,7 +378,7 @@ dcphy_auto(struct mii_softc *mii) { struct dc_softc *sc; - sc = mii->mii_pdata->mii_ifp->if_softc; + sc = if_getsoftc(mii->mii_pdata->mii_ifp); DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_PORTSEL); DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_FULLDUPLEX); @@ -399,7 +399,7 @@ dcphy_reset(struct mii_softc *mii) { struct dc_softc *sc; - sc = mii->mii_pdata->mii_ifp->if_softc; + sc = if_getsoftc(mii->mii_pdata->mii_ifp); DC_CLRBIT(sc, DC_SIARESET, DC_SIA_RESET); DELAY(1000); Modified: head/sys/dev/dc/pnphy.c ============================================================================== --- head/sys/dev/dc/pnphy.c Mon Jun 2 17:34:08 2014 (r266973) +++ head/sys/dev/dc/pnphy.c Mon Jun 2 17:54:39 2014 (r266974) @@ -152,7 +152,7 @@ pnphy_service(struct mii_softc *sc, stru /* * If the interface is not up, don't do anything. */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) + if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0) break; /* @@ -180,7 +180,7 @@ pnphy_service(struct mii_softc *sc, stru /* * Is the interface even up? */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) + if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0) return (0); break; @@ -201,7 +201,7 @@ pnphy_status(struct mii_softc *sc) int reg; struct dc_softc *dc_sc; - dc_sc = mii->mii_ifp->if_softc; + dc_sc = if_getsoftc(mii->mii_ifp); mii->mii_media_status = IFM_AVALID; mii->mii_media_active = IFM_ETHER; Modified: head/sys/dev/fxp/inphy.c ============================================================================== --- head/sys/dev/fxp/inphy.c Mon Jun 2 17:34:08 2014 (r266973) +++ head/sys/dev/fxp/inphy.c Mon Jun 2 17:54:39 2014 (r266974) @@ -122,7 +122,7 @@ inphy_service(struct mii_softc *sc, stru /* * If the interface is not up, don't do anything. */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) + if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0) break; mii_phy_setmedia(sc); Modified: head/sys/dev/mii/brgphy.c ============================================================================== --- head/sys/dev/mii/brgphy.c Mon Jun 2 17:34:08 2014 (r266973) +++ head/sys/dev/mii/brgphy.c Mon Jun 2 17:54:39 2014 (r266974) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -197,7 +198,7 @@ brgphy_attach(device_t dev) struct bge_softc *bge_sc = NULL; struct bce_softc *bce_sc = NULL; struct mii_softc *sc; - struct ifnet *ifp; + if_t ifp; bsc = device_get_softc(dev); sc = &bsc->mii_sc; @@ -209,10 +210,10 @@ brgphy_attach(device_t dev) ifp = sc->mii_pdata->mii_ifp; /* Find the MAC driver associated with this PHY. */ - if (strcmp(ifp->if_dname, "bge") == 0) - bge_sc = ifp->if_softc; - else if (strcmp(ifp->if_dname, "bce") == 0) - bce_sc = ifp->if_softc; + if (strcmp(if_getdname(ifp), "bge") == 0) + bge_sc = if_getsoftc(ifp); + else if (strcmp(if_getdname(ifp), "bce") == 0) + bce_sc = if_getsoftc(ifp); /* Handle any special cases based on the PHY ID */ switch (sc->mii_mpd_oui) { @@ -879,7 +880,7 @@ brgphy_reset(struct mii_softc *sc) { struct bge_softc *bge_sc = NULL; struct bce_softc *bce_sc = NULL; - struct ifnet *ifp; + if_t ifp; int i, val; /* @@ -932,10 +933,10 @@ brgphy_reset(struct mii_softc *sc) ifp = sc->mii_pdata->mii_ifp; /* Find the driver associated with this PHY. */ - if (strcmp(ifp->if_dname, "bge") == 0) { - bge_sc = ifp->if_softc; - } else if (strcmp(ifp->if_dname, "bce") == 0) { - bce_sc = ifp->if_softc; + if (strcmp(if_getdname(ifp), "bge") == 0) { + bge_sc = if_getsoftc(ifp); + } else if (strcmp(if_getdname(ifp), "bce") == 0) { + bce_sc = if_getsoftc(ifp); } if (bge_sc) { @@ -954,7 +955,7 @@ brgphy_reset(struct mii_softc *sc) brgphy_fixup_jitter_bug(sc); if (bge_sc->bge_flags & BGE_FLAG_JUMBO) - brgphy_jumbo_settings(sc, ifp->if_mtu); + brgphy_jumbo_settings(sc, if_getmtu(ifp)); if ((bge_sc->bge_phy_flags & BGE_PHY_NO_WIRESPEED) == 0) brgphy_ethernet_wirespeed(sc); @@ -1065,11 +1066,11 @@ brgphy_reset(struct mii_softc *sc) (BCE_CHIP_REV(bce_sc) == BCE_CHIP_REV_Bx)) brgphy_fixup_disable_early_dac(sc); - brgphy_jumbo_settings(sc, ifp->if_mtu); + brgphy_jumbo_settings(sc, if_getmtu(ifp)); brgphy_ethernet_wirespeed(sc); } else { brgphy_fixup_ber_bug(sc); - brgphy_jumbo_settings(sc, ifp->if_mtu); + brgphy_jumbo_settings(sc, if_getmtu(ifp)); brgphy_ethernet_wirespeed(sc); } } Modified: head/sys/dev/mii/e1000phy.c ============================================================================== --- head/sys/dev/mii/e1000phy.c Mon Jun 2 17:34:08 2014 (r266973) +++ head/sys/dev/mii/e1000phy.c Mon Jun 2 17:54:39 2014 (r266974) @@ -132,14 +132,14 @@ static int e1000phy_attach(device_t dev) { struct mii_softc *sc; - struct ifnet *ifp; + if_t ifp; sc = device_get_softc(dev); mii_phy_dev_attach(dev, MIIF_NOMANPAUSE, &e1000phy_funcs, 0); ifp = sc->mii_pdata->mii_ifp; - if (strcmp(ifp->if_dname, "msk") == 0 && + if (strcmp(if_getdname(ifp), "msk") == 0 && (sc->mii_flags & MIIF_MACPRIV0) != 0) sc->mii_flags |= MIIF_PHYPRIV0; Modified: head/sys/dev/mii/ip1000phy.c ============================================================================== --- head/sys/dev/mii/ip1000phy.c Mon Jun 2 17:34:08 2014 (r266973) +++ head/sys/dev/mii/ip1000phy.c Mon Jun 2 17:54:39 2014 (r266974) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -109,7 +110,7 @@ ip1000phy_attach(device_t dev) ma = device_get_ivars(dev); flags = MIIF_NOISOLATE | MIIF_NOMANPAUSE; if (MII_MODEL(ma->mii_id2) == MII_MODEL_xxICPLUS_IP1000A && - strcmp(ma->mii_data->mii_ifp->if_dname, "stge") == 0 && + strcmp(if_getdname(ma->mii_data->mii_ifp), "stge") == 0 && (miibus_get_flags(dev) & MIIF_MACPRIV0) != 0) flags |= MIIF_PHYPRIV0; mii_phy_dev_attach(dev, flags, &ip1000phy_funcs, 1); Modified: head/sys/dev/mii/jmphy.c ============================================================================== --- head/sys/dev/mii/jmphy.c Mon Jun 2 17:34:08 2014 (r266973) +++ head/sys/dev/mii/jmphy.c Mon Jun 2 17:54:39 2014 (r266974) @@ -105,7 +105,7 @@ jmphy_attach(device_t dev) ma = device_get_ivars(dev); flags = 0; - if (strcmp(ma->mii_data->mii_ifp->if_dname, "jme") == 0 && + if (strcmp(if_getdname(ma->mii_data->mii_ifp), "jme") == 0 && (miibus_get_flags(dev) & MIIF_MACPRIV0) != 0) flags |= MIIF_PHYPRIV0; mii_phy_dev_attach(dev, flags, &jmphy_funcs, 1); Modified: head/sys/dev/mii/mii.c ============================================================================== --- head/sys/dev/mii/mii.c Mon Jun 2 17:34:08 2014 (r266973) +++ head/sys/dev/mii/mii.c Mon Jun 2 17:54:39 2014 (r266974) @@ -106,7 +106,7 @@ driver_t miibus_driver = { }; struct miibus_ivars { - struct ifnet *ifp; + if_t ifp; ifm_change_cb_t ifmedia_upd; ifm_stat_cb_t ifmedia_sts; u_int mii_flags; @@ -147,8 +147,8 @@ miibus_attach(device_t dev) ifmedia_init(&mii->mii_media, IFM_IMASK, ivars->ifmedia_upd, ivars->ifmedia_sts); mii->mii_ifp = ivars->ifp; - mii->mii_ifp->if_capabilities |= IFCAP_LINKSTATE; - mii->mii_ifp->if_capenable |= IFCAP_LINKSTATE; + if_setcapabilitiesbit(mii->mii_ifp, IFCAP_LINKSTATE, 0); + if_setcapenablebit(mii->mii_ifp, IFCAP_LINKSTATE, 0); LIST_INIT(&mii->mii_phys); return (bus_generic_attach(dev)); @@ -308,7 +308,7 @@ miibus_statchg(device_t dev) MIIBUS_STATCHG(parent); mii = device_get_softc(dev); - mii->mii_ifp->if_baudrate = ifmedia_baudrate(mii->mii_media_active); + if_setbaudrate(mii->mii_ifp, ifmedia_baudrate(mii->mii_media_active)); } static void @@ -330,7 +330,7 @@ miibus_linkchg(device_t dev) link_state = LINK_STATE_DOWN; } else link_state = LINK_STATE_UNKNOWN; - if_link_state_change(mii->mii_ifp, link_state); + if_linkstate_change_drv(mii->mii_ifp, link_state); } static void @@ -358,7 +358,7 @@ miibus_mediainit(device_t dev) * the PHYs to the network interface driver parent. */ int -mii_attach(device_t dev, device_t *miibus, struct ifnet *ifp, +mii_attach(device_t dev, device_t *miibus, void *ifp, ifm_change_cb_t ifmedia_upd, ifm_stat_cb_t ifmedia_sts, int capmask, int phyloc, int offloc, int flags) { Modified: head/sys/dev/mii/miivar.h ============================================================================== --- head/sys/dev/mii/miivar.h Mon Jun 2 17:34:08 2014 (r266973) +++ head/sys/dev/mii/miivar.h Mon Jun 2 17:54:39 2014 (r266974) @@ -36,6 +36,7 @@ #define _DEV_MII_MIIVAR_H_ #include +#include /* XXX driver API temporary */ /* * Media Independent Interface data structure defintions @@ -57,7 +58,7 @@ typedef void (*mii_statchg_t)(struct dev */ struct mii_data { struct ifmedia mii_media; /* media information */ - struct ifnet *mii_ifp; /* pointer back to network interface */ + if_t mii_ifp; /* pointer back to network interface */ /* * For network interfaces with multiple PHYs, a list of all @@ -246,7 +247,7 @@ MIIBUS_ACCESSOR(flags, FLAGS, u_int) extern devclass_t miibus_devclass; extern driver_t miibus_driver; -int mii_attach(device_t, device_t *, struct ifnet *, ifm_change_cb_t, +int mii_attach(device_t, device_t *, if_t, ifm_change_cb_t, ifm_stat_cb_t, int, int, int, int); void mii_down(struct mii_data *); int mii_mediachg(struct mii_data *); Modified: head/sys/dev/mii/nsphy.c ============================================================================== --- head/sys/dev/mii/nsphy.c Mon Jun 2 17:34:08 2014 (r266973) +++ head/sys/dev/mii/nsphy.c Mon Jun 2 17:54:39 2014 (r266974) @@ -186,7 +186,7 @@ nsphy_service(struct mii_softc *sc, stru */ reg |= 0x0100 | 0x0400; - if (strcmp(mii->mii_ifp->if_dname, "fxp") == 0) + if (strcmp(if_getdname(mii->mii_ifp), "fxp") == 0) PHY_WRITE(sc, MII_NSPHY_PCR, reg); mii_phy_setmedia(sc); Modified: head/sys/dev/mii/rgephy.c ============================================================================== --- head/sys/dev/mii/rgephy.c Mon Jun 2 17:34:08 2014 (r266973) +++ head/sys/dev/mii/rgephy.c Mon Jun 2 17:54:39 2014 (r266974) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -118,7 +119,7 @@ rgephy_attach(device_t dev) sc = device_get_softc(dev); ma = device_get_ivars(dev); flags = 0; - if (strcmp(ma->mii_data->mii_ifp->if_dname, "re") == 0) + if (strcmp(if_getdname(ma->mii_data->mii_ifp), "re") == 0) flags |= MIIF_PHYPRIV0; mii_phy_dev_attach(dev, flags, &rgephy_funcs, 0); Modified: head/sys/dev/mii/truephy.c ============================================================================== --- head/sys/dev/mii/truephy.c Mon Jun 2 17:34:08 2014 (r266973) +++ head/sys/dev/mii/truephy.c Mon Jun 2 17:54:39 2014 (r266974) @@ -265,7 +265,7 @@ truephy_reset(struct mii_softc *sc) mii_phy_reset(sc); - if (TRUEPHY_FRAMELEN(sc->mii_pdata->mii_ifp->if_mtu) > 2048) { + if (TRUEPHY_FRAMELEN((if_getmtu(sc->mii_pdata->mii_ifp)) > 2048)) { int conf; conf = PHY_READ(sc, TRUEPHY_CONF); Modified: head/sys/dev/netmap/netmap_generic.c ============================================================================== --- head/sys/dev/netmap/netmap_generic.c Mon Jun 2 17:34:08 2014 (r266973) +++ head/sys/dev/netmap/netmap_generic.c Mon Jun 2 17:54:39 2014 (r266974) @@ -804,3 +804,9 @@ generic_netmap_attach(struct ifnet *ifp) return retval; } + +struct netmap_adapter * +netmap_getna(if_t ifp) +{ + return (NA((struct ifnet *)ifp)); +} Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Mon Jun 2 17:34:08 2014 (r266973) +++ head/sys/dev/netmap/netmap_kern.h Mon Jun 2 17:54:39 2014 (r266974) @@ -1262,6 +1262,7 @@ void netmap_catch_tx(struct netmap_gener int generic_xmit_frame(struct ifnet *ifp, struct mbuf *m, void *addr, u_int len, u_int ring_nr); int generic_find_num_desc(struct ifnet *ifp, u_int *tx, u_int *rx); void generic_find_num_queues(struct ifnet *ifp, u_int *txq, u_int *rxq); +struct netmap_adapter *netmap_getna(if_t ifp); /* * netmap_mitigation API. This is used by the generic adapter @@ -1376,5 +1377,4 @@ void bdg_mismatch_datapath(struct netmap struct netmap_vp_adapter *dst_na, struct nm_bdg_fwd *ft_p, struct netmap_ring *ring, u_int *j, u_int lim, u_int *howmany); - #endif /* _NET_NETMAP_KERN_H_ */ Modified: head/sys/kern/kern_poll.c ============================================================================== --- head/sys/kern/kern_poll.c Mon Jun 2 17:34:08 2014 (r266973) +++ head/sys/kern/kern_poll.c Mon Jun 2 17:54:39 2014 (r266974) @@ -451,6 +451,19 @@ netisr_poll(void) mtx_unlock(&poll_mtx); } +/* The following should be temporary, till all drivers use the driver API */ +int +ether_poll_register_drv(poll_handler_drv_t *h, if_t ifh) +{ + return (ether_poll_register((poll_handler_t *)h, (struct ifnet *)ifh)); +} + +int +ether_poll_deregister_drv(if_t ifh) +{ + return (ether_poll_deregister((struct ifnet *)ifh)); +} + /* * Try to register routine for polling. Returns 0 if successful * (and polling should be enabled), error code otherwise. Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Jun 2 17:34:08 2014 (r266973) +++ head/sys/net/if.c Mon Jun 2 17:54:39 2014 (r266974) @@ -63,12 +63,16 @@ #include #include +#include +#include #include #include #include #include #include #include +#include +#include #include #include #include @@ -1400,17 +1404,17 @@ if_addr_runlock(struct ifnet *ifp) } void -if_maddr_rlock(struct ifnet *ifp) +if_maddr_rlock(if_t ifp) { - IF_ADDR_RLOCK(ifp); + IF_ADDR_RLOCK((struct ifnet *)ifp); } void -if_maddr_runlock(struct ifnet *ifp) +if_maddr_runlock(if_t ifp) { - IF_ADDR_RUNLOCK(ifp); + IF_ADDR_RUNLOCK((struct ifnet *)ifp); } /* @@ -3461,3 +3465,644 @@ if_deregister_com_alloc(u_char type) if_com_alloc[type] = NULL; if_com_free[type] = NULL; } + +/* API for driver access to network stack owned ifnet.*/ +uint64_t +if_setbaudrate(void *arg, uint64_t baudrate) +{ + struct ifnet *ifp = arg; + uint64_t oldbrate; + + oldbrate = ifp->if_baudrate; + ifp->if_baudrate = baudrate; + return (oldbrate); +} + +uint64_t +if_getbaudrate(if_t ifp) +{ + + return (((struct ifnet *)ifp)->if_baudrate); +} + +int +if_setcapabilities(if_t ifp, int capabilities) +{ + ((struct ifnet *)ifp)->if_capabilities = capabilities; + return (0); +} + +int +if_setcapabilitiesbit(if_t ifp, int setbit, int clearbit) +{ + ((struct ifnet *)ifp)->if_capabilities |= setbit; + ((struct ifnet *)ifp)->if_capabilities &= ~clearbit; + + return (0); +} + +int +if_getcapabilities(if_t ifp) +{ + return ((struct ifnet *)ifp)->if_capabilities; +} + +int +if_setcapenable(if_t ifp, int capabilities) +{ + ((struct ifnet *)ifp)->if_capenable = capabilities; + return (0); +} + +int +if_setcapenablebit(if_t ifp, int setcap, int clearcap) +{ + if(setcap) + ((struct ifnet *)ifp)->if_capenable |= setcap; + if(clearcap) + ((struct ifnet *)ifp)->if_capenable &= ~clearcap; + + return (0); +} + +const char * +if_getdname(if_t ifp) +{ + return ((struct ifnet *)ifp)->if_dname; +} + +int +if_togglecapenable(if_t ifp, int togglecap) +{ + ((struct ifnet *)ifp)->if_capenable ^= togglecap; + return (0); +} + +int +if_getcapenable(if_t ifp) +{ + return ((struct ifnet *)ifp)->if_capenable; +} + +/* + * This is largely undesirable because it ties ifnet to a device, but does + * provide flexiblity for an embedded product vendor. Should be used with + * the understanding that it violates the interface boundaries, and should be + * a last resort only. + */ +int +if_setdev(if_t ifp, void *dev) +{ + return (0); +} + +int +if_setdrvflagbits(if_t ifp, int set_flags, int clear_flags) +{ + ((struct ifnet *)ifp)->if_drv_flags |= set_flags; + ((struct ifnet *)ifp)->if_drv_flags &= ~clear_flags; + + return (0); +} + +int +if_getdrvflags(if_t ifp) +{ + return ((struct ifnet *)ifp)->if_drv_flags; +} + +int +if_setdrvflags(if_t ifp, int flags) +{ + ((struct ifnet *)ifp)->if_drv_flags = flags; + return (0); +} + + +int +if_setflags(if_t ifp, int flags) +{ + ((struct ifnet *)ifp)->if_flags = flags; + return (0); +} + +int +if_setflagbits(if_t ifp, int set, int clear) +{ + ((struct ifnet *)ifp)->if_flags |= set; + ((struct ifnet *)ifp)->if_flags &= ~clear; + + return (0); +} + +int +if_getflags(if_t ifp) +{ + return ((struct ifnet *)ifp)->if_flags; +} + +int +if_clearhwassist(if_t ifp) +{ + ((struct ifnet *)ifp)->if_hwassist = 0; + return (0); +} + +int +if_sethwassistbits(if_t ifp, int toset, int toclear) +{ + ((struct ifnet *)ifp)->if_hwassist |= toset; + ((struct ifnet *)ifp)->if_hwassist &= ~toclear; + + return (0); +} + +int +if_sethwassist(if_t ifp, int hwassist_bit) +{ + ((struct ifnet *)ifp)->if_hwassist = hwassist_bit; + return (0); +} + +int +if_gethwassist(if_t ifp) +{ + return ((struct ifnet *)ifp)->if_hwassist; +} + +int +if_setmtu(if_t ifp, int mtu) +{ + ((struct ifnet *)ifp)->if_mtu = mtu; + return (0); +} + +int +if_getmtu(if_t ifp) +{ + return ((struct ifnet *)ifp)->if_mtu; +} + +int +if_setsoftc(if_t ifp, void *softc) +{ + ((struct ifnet *)ifp)->if_softc = softc; + return (0); +} + +void * +if_getsoftc(if_t ifp) +{ + return ((struct ifnet *)ifp)->if_softc; +} + +void +if_setrcvif(struct mbuf *m, if_t ifp) +{ + m->m_pkthdr.rcvif = (struct ifnet *)ifp; +} + +void +if_setvtag(struct mbuf *m, uint16_t tag) +{ + m->m_pkthdr.ether_vtag = tag; +} + +uint16_t +if_getvtag(struct mbuf *m) +{ + + return (m->m_pkthdr.ether_vtag); +} + +/* Statistics */ +int +if_incipackets(if_t ifp, int pkts) +{ + ((struct ifnet *)ifp)->if_ipackets += pkts; + return (0); +} + +int +if_incopackets(if_t ifp, int pkts) +{ + ((struct ifnet *)ifp)->if_opackets += pkts; + return (0); +} + +int +if_incierrors(if_t ifp, int ierrors) +{ + ((struct ifnet *)ifp)->if_ierrors += ierrors; + return (0); +} + + +int +if_setierrors(if_t ifp, int ierrors) +{ + ((struct ifnet *)ifp)->if_ierrors = ierrors; + return (0); +} + +int +if_setoerrors(if_t ifp, int oerrors) +{ + ((struct ifnet *)ifp)->if_oerrors = oerrors; + return (0); +} + +int if_incoerrors(if_t ifp, int oerrors) +{ + ((struct ifnet *)ifp)->if_oerrors += oerrors; + return (0); +} + +int if_inciqdrops(if_t ifp, int val) +{ + ((struct ifnet *)ifp)->if_iqdrops += val; + return (0); +} + +int +if_setcollisions(if_t ifp, int collisions) +{ + ((struct ifnet *)ifp)->if_collisions = collisions; + return (0); +} + +int +if_inccollisions(if_t ifp, int collisions) +{ + ((struct ifnet *)ifp)->if_collisions += collisions; + return (0); +} + +int +if_setipackets(if_t ifp, int pkts) +{ + ((struct ifnet *)ifp)->if_ipackets = pkts; + return (0); +} + +int +if_setopackets(if_t ifp, int pkts) +{ + ((struct ifnet *)ifp)->if_opackets = pkts; + return (0); +} + +int +if_incobytes(if_t ifp, int bytes) +{ + ((struct ifnet *)ifp)->if_obytes += bytes; + return (0); +} + +int +if_setibytes(if_t ifp, int bytes) +{ + ((struct ifnet *)ifp)->if_ibytes = bytes; + return (0); +} + +int +if_setobytes(if_t ifp, int bytes) +{ + ((struct ifnet *)ifp)->if_obytes = bytes; + return (0); +} + + +int +if_sendq_empty(if_t ifp) +{ + return IFQ_DRV_IS_EMPTY(&((struct ifnet *)ifp)->if_snd); +} + +int if_getiqdrops(if_t ifp) +{ + return ((struct ifnet *)ifp)->if_iqdrops; +} + +int +if_incimcasts(if_t ifp, int mcast) +{ + ((struct ifnet *)ifp)->if_imcasts += mcast; + return (0); +} + + +int +if_incomcasts(if_t ifp, int mcast) +{ + ((struct ifnet *)ifp)->if_omcasts += mcast; + return (0); +} + +int +if_setimcasts(if_t ifp, int mcast) +{ + ((struct ifnet *)ifp)->if_imcasts = mcast; + return (0); +} + + +struct ifaddr * +if_getifaddr(if_t ifp) +{ + return ((struct ifnet *)ifp)->if_addr; +} + +int +if_getamcount(if_t ifp) +{ + return ((struct ifnet *)ifp)->if_amcount; +} + + +int +if_setsendqready(if_t ifp) +{ + IFQ_SET_READY(&((struct ifnet *)ifp)->if_snd); + return (0); +} + +int +if_setsendqlen(if_t ifp, int tx_desc_count) +{ + IFQ_SET_MAXLEN(&((struct ifnet *)ifp)->if_snd, tx_desc_count); + ((struct ifnet *)ifp)->if_snd.ifq_drv_maxlen = tx_desc_count; + + return (0); +} + +int +if_vlantrunkinuse(if_t ifp) +{ + return ((struct ifnet *)ifp)->if_vlantrunk != NULL?1:0; +} + +int +if_input(if_t ifp, struct mbuf* sendmp) +{ + (*((struct ifnet *)ifp)->if_input)((struct ifnet *)ifp, sendmp); + return (0); + +} + +/* XXX */ +#ifndef ETH_ADDR_LEN +#define ETH_ADDR_LEN 6 +#endif + +int +if_setupmultiaddr(if_t ifp, void *mta, int *cnt, int max) +{ + struct ifmultiaddr *ifma; + uint8_t *lmta = (uint8_t *)mta; + int mcnt = 0; + + TAILQ_FOREACH(ifma, &((struct ifnet *)ifp)->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + + if (mcnt == max) + break; + + bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), + &lmta[mcnt * ETH_ADDR_LEN], ETH_ADDR_LEN); + mcnt++; + } + *cnt = mcnt; + + return (0); +} + +int +if_multiaddr_array(if_t ifp, void *mta, int *cnt, int max) +{ + int error; + + if_maddr_rlock(ifp); + error = if_setupmultiaddr(ifp, mta, cnt, max); + if_maddr_runlock(ifp); + return (error); +} + +int +if_multiaddr_count(if_t ifp, int max) +{ + struct ifmultiaddr *ifma; + int count; + + count = 0; + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &((struct ifnet *)ifp)->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + count++; + if (count == max) + break; + } + if_maddr_runlock(ifp); + return (count); +} + +struct mbuf * +if_dequeue(if_t ifp) +{ + struct mbuf *m; + IFQ_DRV_DEQUEUE(&((struct ifnet *)ifp)->if_snd, m); + + return (m); +} + +int +if_sendq_prepend(if_t ifp, struct mbuf *m) +{ + IFQ_DRV_PREPEND(&((struct ifnet *)ifp)->if_snd, m); + return (0); +} + +int +if_setifheaderlen(if_t ifp, int len) +{ + ((struct ifnet *)ifp)->if_data.ifi_hdrlen = len; + return (0); +} + +caddr_t +if_getlladdr(if_t ifp) +{ + return (IF_LLADDR((struct ifnet *)ifp)); +} + +void * +if_gethandle(u_char type) +{ + return (if_alloc(type)); +} + +void +if_bpfmtap(if_t ifh, struct mbuf *m) +{ + struct ifnet *ifp = (struct ifnet *)ifh; + + BPF_MTAP(ifp, m); +} + +void +if_etherbpfmtap(if_t ifh, struct mbuf *m) +{ + struct ifnet *ifp = (struct ifnet *)ifh; + + ETHER_BPF_MTAP(ifp, m); +} + +void +if_vlancap(if_t ifh) +{ + struct ifnet *ifp = (struct ifnet *)ifh; + VLAN_CAPABILITIES(ifp); +} + +void +if_setinitfn(if_t ifp, void (*init_fn)(void *)) +{ + ((struct ifnet *)ifp)->if_init = init_fn; +} + +void +if_setioctlfn(if_t ifp, int (*ioctl_fn)(void *, u_long, caddr_t)) +{ + ((struct ifnet *)ifp)->if_ioctl = (void *)ioctl_fn; +} + +void +if_setstartfn(if_t ifp, void (*start_fn)(void *)) +{ + ((struct ifnet *)ifp)->if_start = (void *)start_fn; +} + +void +if_settransmitfn(if_t ifp, if_transmit_fn_t start_fn) +{ + ((struct ifnet *)ifp)->if_transmit = start_fn; +} + +void if_setqflushfn(if_t ifp, if_qflush_fn_t flush_fn) +{ + ((struct ifnet *)ifp)->if_qflush = flush_fn; + +} + +/* These wrappers are hopefully temporary, till all drivers use drvapi */ +#ifdef INET +void +arp_ifinit_drv(if_t ifh, struct ifaddr *ifa) +{ + arp_ifinit((struct ifnet *)ifh, ifa); +} +#endif + +void +ether_ifattach_drv(if_t ifh, const u_int8_t *lla) +{ + ether_ifattach((struct ifnet *)ifh, lla); +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 18:02:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D86F97D2; Mon, 2 Jun 2014 18:02:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C40E7232E; Mon, 2 Jun 2014 18:02:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s52I2AuI044074; Mon, 2 Jun 2014 18:02:10 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s52I2AFZ044073; Mon, 2 Jun 2014 18:02:10 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201406021802.s52I2AFZ044073@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 2 Jun 2014 18:02:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266975 - head/tools/ifnet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 18:02:10 -0000 Author: marcel Date: Mon Jun 2 18:02:10 2014 New Revision: 266975 URL: http://svnweb.freebsd.org/changeset/base/266975 Log: Add convert_drvapi.sh; a script that helps to convert NIC drivers to use the procedural interface. Submitted by: Sreekanth Rupavatharam Reviewed by: glebius@ Obtained from: Juniper Networks, Inc. Added: head/tools/ifnet/ head/tools/ifnet/convert_drvapi.sh (contents, props changed) Added: head/tools/ifnet/convert_drvapi.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/ifnet/convert_drvapi.sh Mon Jun 2 18:02:10 2014 (r266975) @@ -0,0 +1,255 @@ +#!/bin/sh +# +# Copyright (c) 2014 Juniper Networks, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD$ +# + +# +# Convert a NIC driver to use the procdural API. +# It doesn't take care of all the # cases yet, +# but still does about 95% of work. +# +# Author: Sreekanth Rupavatharam +# + +if [ $# -lt 1 ] +then + echo " $0 "; + exit 1; +fi + +# XXX - This needs to change if the data structure uses different name +__ifp__="ifp"; + +file=$1 + +rotateCursor() { + case $toggle + in + 1) + printf " \\ " + printf "\b\b" + toggle="2" + ;; + + 2) + printf " | " + printf "\b\b\b" + toggle="3" + ;; + + 3) + printf " / " + printf "\b\b\b" + toggle="4" + ;; + + *) + printf " - " + printf "\b\b\b" + toggle="1" + ;; + esac +} + +handle_set() { +# Handle the case where $__ifp__->if_blah = XX; + line=$1 + set=`echo $line| grep "$__ifp__->.* = "` + if [ ! -z "$set" ] + then + word=`echo $line | awk -F "if_" ' { print $2 }' | awk -F" =" '{ print $1 }'` + value=`echo $line | awk -F "=" '{ print $2 }' | sed -e 's/;//g'` + new=`echo if_set$word"\($__ifp__,"$value");"` + new=`echo $new | sed -e 's/&/\\\&/'` + old=`echo $line|sed -e 's/^[ ]*//'` + line=`echo $line| sed -e's/'$old'/'$new'/g'` + return 0 + fi + return 1 +} + +handle_inc() { + line=$1 + inc=`echo $line | grep "$__ifp__->.*++"` + if [ ! -z "$inc" ] + then + word=`echo $line | awk -F"if_" '{ print $2 }'|awk -F"\+" '{ print $1}'` + value=' 1'; + old=`echo $line|sed -e 's/^[ ]*//'` + new=`echo if_inc$word"\($__ifp__,"$value");"` + new=`echo $new | sed -e 's/&/\\\&/'` + line=`echo $line| sed -e's/'$old'/'$new'/g'` + return 0; + fi + return 1; +} + +handle_add() { + line=$1 + add=`echo $line|grep "$__ifp__->.*+= "` + if [ ! -z "$add" ] + then + word=`echo $line | awk -F"if_" '{ print $2 }'|awk '{ print $1}'` + value=`echo $line | awk -F"=" '{ print $2}' | sed -e 's/;//g'` + new=`echo if_inc$word"\($__ifp__,$value);"` + new=`echo $new | sed -e 's/&/\\\&/'` + old=`echo $line|sed -e 's/^[ ]*//'` + line=`echo $line| sed -e's/'$old'/'$new'/g'` + return 0 + fi + return 1; + +} + +handle_or() { + line=$1 + or=`echo $line|grep "$__ifp__->.*|= "` + if [ ! -z "$or" ] + then + word=`echo $line | awk -F"if_" '{ print $2 }'|awk '{ print $1}'` + value=`echo $line | awk -F"=" '{ print $2}' | sed -e 's/;//g'` + new=`echo if_set${word}bit"($__ifp__,$value, 0);"` + new=`echo $new | sed -e 's/&/\\\&/'` + #line=`echo $line|sed -e 's/&/\\&/'` + old=`echo $line|sed -e 's/^[ ]*//'` + line=`echo $line| sed -e's/'$old'/'$new'/g'` + return 0; + fi + return 1; + +} + +handle_and() { + line=$1 + or=`echo $line|grep "$__ifp__->.*&= "` + if [ ! -z "$or" ] + then + word=`echo $line | awk -F"if_" '{ print $2 }'|awk '{ print $1}'` + value=`echo $line | awk -F"=" '{ print $2}' | sed -e 's/;//g'` + value=`echo $value | sed -e's/~//g'` + new=`echo if_set${word}bit"\($__ifp__, 0,$value);"` + new=`echo $new | sed -e 's/&/\\\&/'` + old=`echo $line|sed -e 's/^[ ]*//'` + line=`echo $line| sed -e's/'$old'/'$new'/g'` + return 0; + fi + return 1; + +} + +# XXX - this needs updating +handle_misc() { + line=$1 + get=`echo $line | grep "if_capabilities\|if_flags\|if_softc\|if_capenable\|if_mtu\|if_drv_flags"` + if [ ! -z "$get" ] + then + word=`echo $line |awk -F"$__ifp__->if_" '{ print $2 }' | \ + sed -e's/[^a-zA-Z0-9_]/\@/'|awk -F"\@" '{ print $1}'` + old=`echo "$__ifp__->if_"${word}` + new=`echo "if_get"${word}"($__ifp__)"` + new=`echo $new | sed -e 's/&/\\\&/'` + line=`echo $line| sed -e's/'$old'/'$new'/g'` + return 0; + fi + return 1; + +} + +if [ -e $file.tmp ] +then + rm $file.tmp +fi +IFS= +echo -n "Conversion for $file started, please wait: " +FAIL_PAT="XXX - DRVAPI" +count=0 +cat $1 | while read -r line +do +count=`expr $count + 1` +rotateCursor +pat=`echo $line | grep "$__ifp__->"` +while [ "$pat" != "" ] +do + pat=`echo $line | grep "$__ifp__->"` + if [ ! -z `echo $pat | grep "$FAIL_PAT"` ] + then + break; + fi + + handle_set $line + + if [ $? != 0 ] + then + handle_inc $line + fi + + if [ $? != 0 ] + then + handle_add $line + fi + + if [ $? != 0 ] + then + handle_or $line + fi + + if [ $? != 0 ] + then + handle_and $line + fi + + if [ $? != 0 ] + + then + handle_misc $line + fi + + if [ $? != 0 ] + then + if [ ! -z `echo $line | grep "$__ifp__->"` ] + then + line=`echo $line | sed -e 's:$: \/* '${FAIL_PAT}' *\/:g'` + fi + fi +done + # Replace the ifnet * with if_t + if [ ! -z `echo $line | grep "struct ifnet"` ] + then + line=`echo $line | sed -e 's/struct ifnet[ \t]*\*/if_t /g'` + fi + echo "$line" >> $file.tmp +done +echo "" +count=`grep $FAIL_PAT $file.tmp | wc -l` +if [ $count -gt 0 ] +then + echo "$count lines could not be converted to DRVAPI" + echo "Look for /* $FAIL_PAT */ in the converted file" +fi +echo "original $file has been moved to $file.orig" +mv $file $file.orig +mv $file.tmp $file From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 18:26:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F670124; Mon, 2 Jun 2014 18:26:11 +0000 (UTC) Received: from mail-qa0-x236.google.com (mail-qa0-x236.google.com [IPv6:2607:f8b0:400d:c00::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC8642547; Mon, 2 Jun 2014 18:26:10 +0000 (UTC) Received: by mail-qa0-f54.google.com with SMTP id j15so3321511qaq.13 for ; Mon, 02 Jun 2014 11:26:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=aQcmRmTxysgzmiS90UB6iHPvvzXBleUlj7rnnYMYCG8=; b=OGQbWK3cAdLUDmy6XoUD9z8LIzMXvyHmCLL5L6KXXeVZYVPJsas3Kt4Lm8HT3A4Kl9 C2Xo92Q++E7VOe+ugA38bJ8dDfcv44FLfgxnbevlfWLRYcSmU0kMvS6o2KnI1lZr83VB Uqrce3lLLoTEB+ehczPaVKTxdZX9SKY6jm8TfU0AVmec0avm85WazHfLxqjHbOuUczg3 clllvar9AfyTs7QePvcFrmDHUTh44lmv5lLXTV2oybRELQ2CzO9xgPAnGoOCOXaWe/QU tnpMnLPgaC/wG8Z4mBtHDfMKsXpnxJzesQpNm5h9+BHeFl5uKL22VhXf5BW+R57hiQWx SKZw== MIME-Version: 1.0 X-Received: by 10.229.213.66 with SMTP id gv2mr51533329qcb.13.1401733570000; Mon, 02 Jun 2014 11:26:10 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.43.134 with HTTP; Mon, 2 Jun 2014 11:26:09 -0700 (PDT) In-Reply-To: <201406021754.s52Hsd1B039620@svn.freebsd.org> References: <201406021754.s52Hsd1B039620@svn.freebsd.org> Date: Mon, 2 Jun 2014 11:26:09 -0700 X-Google-Sender-Auth: L5hDQtppeg1HqgJb3L_36jdTJnE Message-ID: Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net From: Adrian Chadd To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 18:26:11 -0000 Woo! Would you mind doing up a 30 second "what convert X to Y" document so I can do the driveby on the wireless stack and drivers? I'll look at the script but since the wifi stack sits in between the normal network stack layering, I just want to make sure I get all of the right bits converted over all at the same time and have it have a good chance of working. Thanks! -a On 2 June 2014 10:54, Marcel Moolenaar wrote: > Author: marcel > Date: Mon Jun 2 17:54:39 2014 > New Revision: 266974 > URL: http://svnweb.freebsd.org/changeset/base/266974 > > Log: > Introduce a procedural interface to the ifnet structure. The new > interface allows the ifnet structure to be defined as an opaque > type in NIC drivers. This then allows the ifnet structure to be > changed without a need to change or recompile NIC drivers. > > Put differently, NIC drivers can be written and compiled once and > be used with different network stack implementations, provided of > course that those network stack implementations have an API and > ABI compatible interface. > > This commit introduces the 'if_t' type to replace 'struct ifnet *' > as the type of a network interface. The 'if_t' type is defined as > 'void *' to enable the compiler to perform type conversion to > 'struct ifnet *' and vice versa where needed and without warnings. > The functions that implement the API are the only functions that > need to have an explicit cast. > > The MII code has been converted to use the driver API to avoid > unnecessary code churn. Code churn comes from having to work with > both converted and unconverted drivers in correlation with having > callback functions that take an interface. By converting the MII > code first, the callback functions can be defined so that the > compiler will perform the typecasts automatically. > > As soon as all drivers have been converted, the if_t type can be > redefined as needed and the API functions can be fix to not need > an explicit cast. > > The immediate benefactors of this change are: > 1. Juniper Networks - The network stack implementation in Junos > is entirely different from FreeBSD's one and this change > allows Juniper to build "stock" NIC drivers that can be used > in combination with both the FreeBSD and Junos stacks. > 2. FreeBSD - This change opens the door towards changing ifnet > and implementing new features and optimizations in the network > stack without it requiring a change in the many NIC drivers > FreeBSD has. > > Submitted by: Anuranjan Shukla > Reviewed by: glebius@ > Obtained from: Juniper Networks, Inc. > > Modified: > head/sys/dev/dc/dcphy.c > head/sys/dev/dc/pnphy.c > head/sys/dev/fxp/inphy.c > head/sys/dev/mii/brgphy.c > head/sys/dev/mii/e1000phy.c > head/sys/dev/mii/ip1000phy.c > head/sys/dev/mii/jmphy.c > head/sys/dev/mii/mii.c > head/sys/dev/mii/miivar.h > head/sys/dev/mii/nsphy.c > head/sys/dev/mii/rgephy.c > head/sys/dev/mii/truephy.c > head/sys/dev/netmap/netmap_generic.c > head/sys/dev/netmap/netmap_kern.h > head/sys/kern/kern_poll.c > head/sys/net/if.c > head/sys/net/if_media.h > head/sys/net/if_var.h > head/sys/net/ifq.h > > Modified: head/sys/dev/dc/dcphy.c > ============================================================================== > --- head/sys/dev/dc/dcphy.c Mon Jun 2 17:34:08 2014 (r266973) > +++ head/sys/dev/dc/dcphy.c Mon Jun 2 17:54:39 2014 (r266974) > @@ -153,7 +153,7 @@ dcphy_attach(device_t dev) > &dcphy_funcs, 0); > > /*PHY_RESET(sc);*/ > - dc_sc = sc->mii_pdata->mii_ifp->if_softc; > + dc_sc = if_getsoftc(sc->mii_pdata->mii_ifp); > CSR_WRITE_4(dc_sc, DC_10BTSTAT, 0); > CSR_WRITE_4(dc_sc, DC_10BTCTRL, 0); > > @@ -191,7 +191,7 @@ dcphy_service(struct mii_softc *sc, stru > int reg; > u_int32_t mode; > > - dc_sc = mii->mii_ifp->if_softc; > + dc_sc = if_getsoftc(mii->mii_ifp); > > switch (cmd) { > case MII_POLLSTAT: > @@ -201,7 +201,7 @@ dcphy_service(struct mii_softc *sc, stru > /* > * If the interface is not up, don't do anything. > */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > + if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0) > break; > > mii->mii_media_active = IFM_NONE; > @@ -251,7 +251,7 @@ dcphy_service(struct mii_softc *sc, stru > /* > * Is the interface even up? > */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > + if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0) > return (0); > > /* > @@ -298,12 +298,12 @@ dcphy_status(struct mii_softc *sc) > int anlpar, tstat; > struct dc_softc *dc_sc; > > - dc_sc = mii->mii_ifp->if_softc; > + dc_sc = if_getsoftc(mii->mii_ifp); > > mii->mii_media_status = IFM_AVALID; > mii->mii_media_active = IFM_ETHER; > > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > + if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0) > return; > > tstat = CSR_READ_4(dc_sc, DC_10BTSTAT); > @@ -378,7 +378,7 @@ dcphy_auto(struct mii_softc *mii) > { > struct dc_softc *sc; > > - sc = mii->mii_pdata->mii_ifp->if_softc; > + sc = if_getsoftc(mii->mii_pdata->mii_ifp); > > DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_PORTSEL); > DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_FULLDUPLEX); > @@ -399,7 +399,7 @@ dcphy_reset(struct mii_softc *mii) > { > struct dc_softc *sc; > > - sc = mii->mii_pdata->mii_ifp->if_softc; > + sc = if_getsoftc(mii->mii_pdata->mii_ifp); > > DC_CLRBIT(sc, DC_SIARESET, DC_SIA_RESET); > DELAY(1000); > > Modified: head/sys/dev/dc/pnphy.c > ============================================================================== > --- head/sys/dev/dc/pnphy.c Mon Jun 2 17:34:08 2014 (r266973) > +++ head/sys/dev/dc/pnphy.c Mon Jun 2 17:54:39 2014 (r266974) > @@ -152,7 +152,7 @@ pnphy_service(struct mii_softc *sc, stru > /* > * If the interface is not up, don't do anything. > */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > + if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0) > break; > > /* > @@ -180,7 +180,7 @@ pnphy_service(struct mii_softc *sc, stru > /* > * Is the interface even up? > */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > + if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0) > return (0); > > break; > @@ -201,7 +201,7 @@ pnphy_status(struct mii_softc *sc) > int reg; > struct dc_softc *dc_sc; > > - dc_sc = mii->mii_ifp->if_softc; > + dc_sc = if_getsoftc(mii->mii_ifp); > > mii->mii_media_status = IFM_AVALID; > mii->mii_media_active = IFM_ETHER; > > Modified: head/sys/dev/fxp/inphy.c > ============================================================================== > --- head/sys/dev/fxp/inphy.c Mon Jun 2 17:34:08 2014 (r266973) > +++ head/sys/dev/fxp/inphy.c Mon Jun 2 17:54:39 2014 (r266974) > @@ -122,7 +122,7 @@ inphy_service(struct mii_softc *sc, stru > /* > * If the interface is not up, don't do anything. > */ > - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) > + if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0) > break; > > mii_phy_setmedia(sc); > > Modified: head/sys/dev/mii/brgphy.c > ============================================================================== > --- head/sys/dev/mii/brgphy.c Mon Jun 2 17:34:08 2014 (r266973) > +++ head/sys/dev/mii/brgphy.c Mon Jun 2 17:54:39 2014 (r266974) > @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > > #include > #include > @@ -197,7 +198,7 @@ brgphy_attach(device_t dev) > struct bge_softc *bge_sc = NULL; > struct bce_softc *bce_sc = NULL; > struct mii_softc *sc; > - struct ifnet *ifp; > + if_t ifp; > > bsc = device_get_softc(dev); > sc = &bsc->mii_sc; > @@ -209,10 +210,10 @@ brgphy_attach(device_t dev) > ifp = sc->mii_pdata->mii_ifp; > > /* Find the MAC driver associated with this PHY. */ > - if (strcmp(ifp->if_dname, "bge") == 0) > - bge_sc = ifp->if_softc; > - else if (strcmp(ifp->if_dname, "bce") == 0) > - bce_sc = ifp->if_softc; > + if (strcmp(if_getdname(ifp), "bge") == 0) > + bge_sc = if_getsoftc(ifp); > + else if (strcmp(if_getdname(ifp), "bce") == 0) > + bce_sc = if_getsoftc(ifp); > > /* Handle any special cases based on the PHY ID */ > switch (sc->mii_mpd_oui) { > @@ -879,7 +880,7 @@ brgphy_reset(struct mii_softc *sc) > { > struct bge_softc *bge_sc = NULL; > struct bce_softc *bce_sc = NULL; > - struct ifnet *ifp; > + if_t ifp; > int i, val; > > /* > @@ -932,10 +933,10 @@ brgphy_reset(struct mii_softc *sc) > ifp = sc->mii_pdata->mii_ifp; > > /* Find the driver associated with this PHY. */ > - if (strcmp(ifp->if_dname, "bge") == 0) { > - bge_sc = ifp->if_softc; > - } else if (strcmp(ifp->if_dname, "bce") == 0) { > - bce_sc = ifp->if_softc; > + if (strcmp(if_getdname(ifp), "bge") == 0) { > + bge_sc = if_getsoftc(ifp); > + } else if (strcmp(if_getdname(ifp), "bce") == 0) { > + bce_sc = if_getsoftc(ifp); > } > > if (bge_sc) { > @@ -954,7 +955,7 @@ brgphy_reset(struct mii_softc *sc) > brgphy_fixup_jitter_bug(sc); > > if (bge_sc->bge_flags & BGE_FLAG_JUMBO) > - brgphy_jumbo_settings(sc, ifp->if_mtu); > + brgphy_jumbo_settings(sc, if_getmtu(ifp)); > > if ((bge_sc->bge_phy_flags & BGE_PHY_NO_WIRESPEED) == 0) > brgphy_ethernet_wirespeed(sc); > @@ -1065,11 +1066,11 @@ brgphy_reset(struct mii_softc *sc) > (BCE_CHIP_REV(bce_sc) == BCE_CHIP_REV_Bx)) > brgphy_fixup_disable_early_dac(sc); > > - brgphy_jumbo_settings(sc, ifp->if_mtu); > + brgphy_jumbo_settings(sc, if_getmtu(ifp)); > brgphy_ethernet_wirespeed(sc); > } else { > brgphy_fixup_ber_bug(sc); > - brgphy_jumbo_settings(sc, ifp->if_mtu); > + brgphy_jumbo_settings(sc, if_getmtu(ifp)); > brgphy_ethernet_wirespeed(sc); > } > } > > Modified: head/sys/dev/mii/e1000phy.c > ============================================================================== > --- head/sys/dev/mii/e1000phy.c Mon Jun 2 17:34:08 2014 (r266973) > +++ head/sys/dev/mii/e1000phy.c Mon Jun 2 17:54:39 2014 (r266974) > @@ -132,14 +132,14 @@ static int > e1000phy_attach(device_t dev) > { > struct mii_softc *sc; > - struct ifnet *ifp; > + if_t ifp; > > sc = device_get_softc(dev); > > mii_phy_dev_attach(dev, MIIF_NOMANPAUSE, &e1000phy_funcs, 0); > > ifp = sc->mii_pdata->mii_ifp; > - if (strcmp(ifp->if_dname, "msk") == 0 && > + if (strcmp(if_getdname(ifp), "msk") == 0 && > (sc->mii_flags & MIIF_MACPRIV0) != 0) > sc->mii_flags |= MIIF_PHYPRIV0; > > > Modified: head/sys/dev/mii/ip1000phy.c > ============================================================================== > --- head/sys/dev/mii/ip1000phy.c Mon Jun 2 17:34:08 2014 (r266973) > +++ head/sys/dev/mii/ip1000phy.c Mon Jun 2 17:54:39 2014 (r266974) > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > > #include > @@ -109,7 +110,7 @@ ip1000phy_attach(device_t dev) > ma = device_get_ivars(dev); > flags = MIIF_NOISOLATE | MIIF_NOMANPAUSE; > if (MII_MODEL(ma->mii_id2) == MII_MODEL_xxICPLUS_IP1000A && > - strcmp(ma->mii_data->mii_ifp->if_dname, "stge") == 0 && > + strcmp(if_getdname(ma->mii_data->mii_ifp), "stge") == 0 && > (miibus_get_flags(dev) & MIIF_MACPRIV0) != 0) > flags |= MIIF_PHYPRIV0; > mii_phy_dev_attach(dev, flags, &ip1000phy_funcs, 1); > > Modified: head/sys/dev/mii/jmphy.c > ============================================================================== > --- head/sys/dev/mii/jmphy.c Mon Jun 2 17:34:08 2014 (r266973) > +++ head/sys/dev/mii/jmphy.c Mon Jun 2 17:54:39 2014 (r266974) > @@ -105,7 +105,7 @@ jmphy_attach(device_t dev) > > ma = device_get_ivars(dev); > flags = 0; > - if (strcmp(ma->mii_data->mii_ifp->if_dname, "jme") == 0 && > + if (strcmp(if_getdname(ma->mii_data->mii_ifp), "jme") == 0 && > (miibus_get_flags(dev) & MIIF_MACPRIV0) != 0) > flags |= MIIF_PHYPRIV0; > mii_phy_dev_attach(dev, flags, &jmphy_funcs, 1); > > Modified: head/sys/dev/mii/mii.c > ============================================================================== > --- head/sys/dev/mii/mii.c Mon Jun 2 17:34:08 2014 (r266973) > +++ head/sys/dev/mii/mii.c Mon Jun 2 17:54:39 2014 (r266974) > @@ -106,7 +106,7 @@ driver_t miibus_driver = { > }; > > struct miibus_ivars { > - struct ifnet *ifp; > + if_t ifp; > ifm_change_cb_t ifmedia_upd; > ifm_stat_cb_t ifmedia_sts; > u_int mii_flags; > @@ -147,8 +147,8 @@ miibus_attach(device_t dev) > ifmedia_init(&mii->mii_media, IFM_IMASK, ivars->ifmedia_upd, > ivars->ifmedia_sts); > mii->mii_ifp = ivars->ifp; > - mii->mii_ifp->if_capabilities |= IFCAP_LINKSTATE; > - mii->mii_ifp->if_capenable |= IFCAP_LINKSTATE; > + if_setcapabilitiesbit(mii->mii_ifp, IFCAP_LINKSTATE, 0); > + if_setcapenablebit(mii->mii_ifp, IFCAP_LINKSTATE, 0); > LIST_INIT(&mii->mii_phys); > > return (bus_generic_attach(dev)); > @@ -308,7 +308,7 @@ miibus_statchg(device_t dev) > MIIBUS_STATCHG(parent); > > mii = device_get_softc(dev); > - mii->mii_ifp->if_baudrate = ifmedia_baudrate(mii->mii_media_active); > + if_setbaudrate(mii->mii_ifp, ifmedia_baudrate(mii->mii_media_active)); > } > > static void > @@ -330,7 +330,7 @@ miibus_linkchg(device_t dev) > link_state = LINK_STATE_DOWN; > } else > link_state = LINK_STATE_UNKNOWN; > - if_link_state_change(mii->mii_ifp, link_state); > + if_linkstate_change_drv(mii->mii_ifp, link_state); > } > > static void > @@ -358,7 +358,7 @@ miibus_mediainit(device_t dev) > * the PHYs to the network interface driver parent. > */ > int > -mii_attach(device_t dev, device_t *miibus, struct ifnet *ifp, > +mii_attach(device_t dev, device_t *miibus, void *ifp, > ifm_change_cb_t ifmedia_upd, ifm_stat_cb_t ifmedia_sts, int capmask, > int phyloc, int offloc, int flags) > { > > Modified: head/sys/dev/mii/miivar.h > ============================================================================== > --- head/sys/dev/mii/miivar.h Mon Jun 2 17:34:08 2014 (r266973) > +++ head/sys/dev/mii/miivar.h Mon Jun 2 17:54:39 2014 (r266974) > @@ -36,6 +36,7 @@ > #define _DEV_MII_MIIVAR_H_ > > #include > +#include /* XXX driver API temporary */ > > /* > * Media Independent Interface data structure defintions > @@ -57,7 +58,7 @@ typedef void (*mii_statchg_t)(struct dev > */ > struct mii_data { > struct ifmedia mii_media; /* media information */ > - struct ifnet *mii_ifp; /* pointer back to network interface */ > + if_t mii_ifp; /* pointer back to network interface */ > > /* > * For network interfaces with multiple PHYs, a list of all > @@ -246,7 +247,7 @@ MIIBUS_ACCESSOR(flags, FLAGS, u_int) > extern devclass_t miibus_devclass; > extern driver_t miibus_driver; > > -int mii_attach(device_t, device_t *, struct ifnet *, ifm_change_cb_t, > +int mii_attach(device_t, device_t *, if_t, ifm_change_cb_t, > ifm_stat_cb_t, int, int, int, int); > void mii_down(struct mii_data *); > int mii_mediachg(struct mii_data *); > > Modified: head/sys/dev/mii/nsphy.c > ============================================================================== > --- head/sys/dev/mii/nsphy.c Mon Jun 2 17:34:08 2014 (r266973) > +++ head/sys/dev/mii/nsphy.c Mon Jun 2 17:54:39 2014 (r266974) > @@ -186,7 +186,7 @@ nsphy_service(struct mii_softc *sc, stru > */ > reg |= 0x0100 | 0x0400; > > - if (strcmp(mii->mii_ifp->if_dname, "fxp") == 0) > + if (strcmp(if_getdname(mii->mii_ifp), "fxp") == 0) > PHY_WRITE(sc, MII_NSPHY_PCR, reg); > > mii_phy_setmedia(sc); > > Modified: head/sys/dev/mii/rgephy.c > ============================================================================== > --- head/sys/dev/mii/rgephy.c Mon Jun 2 17:34:08 2014 (r266973) > +++ head/sys/dev/mii/rgephy.c Mon Jun 2 17:54:39 2014 (r266974) > @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > > #include > @@ -118,7 +119,7 @@ rgephy_attach(device_t dev) > sc = device_get_softc(dev); > ma = device_get_ivars(dev); > flags = 0; > - if (strcmp(ma->mii_data->mii_ifp->if_dname, "re") == 0) > + if (strcmp(if_getdname(ma->mii_data->mii_ifp), "re") == 0) > flags |= MIIF_PHYPRIV0; > mii_phy_dev_attach(dev, flags, &rgephy_funcs, 0); > > > Modified: head/sys/dev/mii/truephy.c > ============================================================================== > --- head/sys/dev/mii/truephy.c Mon Jun 2 17:34:08 2014 (r266973) > +++ head/sys/dev/mii/truephy.c Mon Jun 2 17:54:39 2014 (r266974) > @@ -265,7 +265,7 @@ truephy_reset(struct mii_softc *sc) > > mii_phy_reset(sc); > > - if (TRUEPHY_FRAMELEN(sc->mii_pdata->mii_ifp->if_mtu) > 2048) { > + if (TRUEPHY_FRAMELEN((if_getmtu(sc->mii_pdata->mii_ifp)) > 2048)) { > int conf; > > conf = PHY_READ(sc, TRUEPHY_CONF); > > Modified: head/sys/dev/netmap/netmap_generic.c > ============================================================================== > --- head/sys/dev/netmap/netmap_generic.c Mon Jun 2 17:34:08 2014 (r266973) > +++ head/sys/dev/netmap/netmap_generic.c Mon Jun 2 17:54:39 2014 (r266974) > @@ -804,3 +804,9 @@ generic_netmap_attach(struct ifnet *ifp) > > return retval; > } > + > +struct netmap_adapter * > +netmap_getna(if_t ifp) > +{ > + return (NA((struct ifnet *)ifp)); > +} > > Modified: head/sys/dev/netmap/netmap_kern.h > ============================================================================== > --- head/sys/dev/netmap/netmap_kern.h Mon Jun 2 17:34:08 2014 (r266973) > +++ head/sys/dev/netmap/netmap_kern.h Mon Jun 2 17:54:39 2014 (r266974) > @@ -1262,6 +1262,7 @@ void netmap_catch_tx(struct netmap_gener > int generic_xmit_frame(struct ifnet *ifp, struct mbuf *m, void *addr, u_int len, u_int ring_nr); > int generic_find_num_desc(struct ifnet *ifp, u_int *tx, u_int *rx); > void generic_find_num_queues(struct ifnet *ifp, u_int *txq, u_int *rxq); > +struct netmap_adapter *netmap_getna(if_t ifp); > > /* > * netmap_mitigation API. This is used by the generic adapter > @@ -1376,5 +1377,4 @@ void bdg_mismatch_datapath(struct netmap > struct netmap_vp_adapter *dst_na, > struct nm_bdg_fwd *ft_p, struct netmap_ring *ring, > u_int *j, u_int lim, u_int *howmany); > - > #endif /* _NET_NETMAP_KERN_H_ */ > > Modified: head/sys/kern/kern_poll.c > ============================================================================== > --- head/sys/kern/kern_poll.c Mon Jun 2 17:34:08 2014 (r266973) > +++ head/sys/kern/kern_poll.c Mon Jun 2 17:54:39 2014 (r266974) > @@ -451,6 +451,19 @@ netisr_poll(void) > mtx_unlock(&poll_mtx); > } > > +/* The following should be temporary, till all drivers use the driver API */ > +int > +ether_poll_register_drv(poll_handler_drv_t *h, if_t ifh) > +{ > + return (ether_poll_register((poll_handler_t *)h, (struct ifnet *)ifh)); > +} > + > +int > +ether_poll_deregister_drv(if_t ifh) > +{ > + return (ether_poll_deregister((struct ifnet *)ifh)); > +} > + > /* > * Try to register routine for polling. Returns 0 if successful > * (and polling should be enabled), error code otherwise. > > Modified: head/sys/net/if.c > ============================================================================== > --- head/sys/net/if.c Mon Jun 2 17:34:08 2014 (r266973) > +++ head/sys/net/if.c Mon Jun 2 17:54:39 2014 (r266974) > @@ -63,12 +63,16 @@ > #include > #include > > +#include > +#include > #include > #include > #include > #include > #include > #include > +#include > +#include > #include > #include > #include > @@ -1400,17 +1404,17 @@ if_addr_runlock(struct ifnet *ifp) > } > > void > -if_maddr_rlock(struct ifnet *ifp) > +if_maddr_rlock(if_t ifp) > { > > - IF_ADDR_RLOCK(ifp); > + IF_ADDR_RLOCK((struct ifnet *)ifp); > } > > void > -if_maddr_runlock(struct ifnet *ifp) > +if_maddr_runlock(if_t ifp) > { > > - IF_ADDR_RUNLOCK(ifp); > + IF_ADDR_RUNLOCK((struct ifnet *)ifp); > } > > /* > @@ -3461,3 +3465,644 @@ if_deregister_com_alloc(u_char type) > if_com_alloc[type] = NULL; > if_com_free[type] = NULL; > } > + > +/* API for driver access to network stack owned ifnet.*/ > +uint64_t > +if_setbaudrate(void *arg, uint64_t baudrate) > +{ > + struct ifnet *ifp = arg; > + uint64_t oldbrate; > + > + oldbrate = ifp->if_baudrate; > + ifp->if_baudrate = baudrate; > + return (oldbrate); > +} > + > +uint64_t > +if_getbaudrate(if_t ifp) > +{ > + > + return (((struct ifnet *)ifp)->if_baudrate); > +} > + > +int > +if_setcapabilities(if_t ifp, int capabilities) > +{ > + ((struct ifnet *)ifp)->if_capabilities = capabilities; > + return (0); > +} > + > +int > +if_setcapabilitiesbit(if_t ifp, int setbit, int clearbit) > +{ > + ((struct ifnet *)ifp)->if_capabilities |= setbit; > + ((struct ifnet *)ifp)->if_capabilities &= ~clearbit; > + > + return (0); > +} > + > +int > +if_getcapabilities(if_t ifp) > +{ > + return ((struct ifnet *)ifp)->if_capabilities; > +} > + > +int > +if_setcapenable(if_t ifp, int capabilities) > +{ > + ((struct ifnet *)ifp)->if_capenable = capabilities; > + return (0); > +} > + > +int > +if_setcapenablebit(if_t ifp, int setcap, int clearcap) > +{ > + if(setcap) > + ((struct ifnet *)ifp)->if_capenable |= setcap; > + if(clearcap) > + ((struct ifnet *)ifp)->if_capenable &= ~clearcap; > + > + return (0); > +} > + > +const char * > +if_getdname(if_t ifp) > +{ > + return ((struct ifnet *)ifp)->if_dname; > +} > + > +int > +if_togglecapenable(if_t ifp, int togglecap) > +{ > + ((struct ifnet *)ifp)->if_capenable ^= togglecap; > + return (0); > +} > + > +int > +if_getcapenable(if_t ifp) > +{ > + return ((struct ifnet *)ifp)->if_capenable; > +} > + > +/* > + * This is largely undesirable because it ties ifnet to a device, but does > + * provide flexiblity for an embedded product vendor. Should be used with > + * the understanding that it violates the interface boundaries, and should be > + * a last resort only. > + */ > +int > +if_setdev(if_t ifp, void *dev) > +{ > + return (0); > +} > + > +int > +if_setdrvflagbits(if_t ifp, int set_flags, int clear_flags) > +{ > + ((struct ifnet *)ifp)->if_drv_flags |= set_flags; > + ((struct ifnet *)ifp)->if_drv_flags &= ~clear_flags; > + > + return (0); > +} > + > +int > +if_getdrvflags(if_t ifp) > +{ > + return ((struct ifnet *)ifp)->if_drv_flags; > +} > + > +int > +if_setdrvflags(if_t ifp, int flags) > +{ > + ((struct ifnet *)ifp)->if_drv_flags = flags; > + return (0); > +} > + > + > +int > +if_setflags(if_t ifp, int flags) > +{ > + ((struct ifnet *)ifp)->if_flags = flags; > + return (0); > +} > + > +int > +if_setflagbits(if_t ifp, int set, int clear) > +{ > + ((struct ifnet *)ifp)->if_flags |= set; > + ((struct ifnet *)ifp)->if_flags &= ~clear; > + > + return (0); > +} > + > +int > +if_getflags(if_t ifp) > +{ > + return ((struct ifnet *)ifp)->if_flags; > +} > + > +int > +if_clearhwassist(if_t ifp) > +{ > + ((struct ifnet *)ifp)->if_hwassist = 0; > + return (0); > +} > + > +int > +if_sethwassistbits(if_t ifp, int toset, int toclear) > +{ > + ((struct ifnet *)ifp)->if_hwassist |= toset; > + ((struct ifnet *)ifp)->if_hwassist &= ~toclear; > + > + return (0); > +} > + > +int > +if_sethwassist(if_t ifp, int hwassist_bit) > +{ > + ((struct ifnet *)ifp)->if_hwassist = hwassist_bit; > + return (0); > +} > + > +int > +if_gethwassist(if_t ifp) > +{ > + return ((struct ifnet *)ifp)->if_hwassist; > +} > + > +int > +if_setmtu(if_t ifp, int mtu) > +{ > + ((struct ifnet *)ifp)->if_mtu = mtu; > + return (0); > +} > + > +int > +if_getmtu(if_t ifp) > +{ > + return ((struct ifnet *)ifp)->if_mtu; > +} > + > +int > +if_setsoftc(if_t ifp, void *softc) > +{ > + ((struct ifnet *)ifp)->if_softc = softc; > + return (0); > +} > + > +void * > +if_getsoftc(if_t ifp) > +{ > + return ((struct ifnet *)ifp)->if_softc; > +} > + > +void > +if_setrcvif(struct mbuf *m, if_t ifp) > +{ > + m->m_pkthdr.rcvif = (struct ifnet *)ifp; > +} > + > +void > +if_setvtag(struct mbuf *m, uint16_t tag) > +{ > + m->m_pkthdr.ether_vtag = tag; > +} > + > +uint16_t > +if_getvtag(struct mbuf *m) > +{ > + > + return (m->m_pkthdr.ether_vtag); > +} > + > +/* Statistics */ > +int > +if_incipackets(if_t ifp, int pkts) > +{ > + ((struct ifnet *)ifp)->if_ipackets += pkts; > + return (0); > +} > + > +int > +if_incopackets(if_t ifp, int pkts) > +{ > + ((struct ifnet *)ifp)->if_opackets += pkts; > + return (0); > +} > + > +int > +if_incierrors(if_t ifp, int ierrors) > +{ > + ((struct ifnet *)ifp)->if_ierrors += ierrors; > + return (0); > +} > + > + > +int > +if_setierrors(if_t ifp, int ierrors) > +{ > + ((struct ifnet *)ifp)->if_ierrors = ierrors; > + return (0); > +} > + > +int > +if_setoerrors(if_t ifp, int oerrors) > +{ > + ((struct ifnet *)ifp)->if_oerrors = oerrors; > + return (0); > +} > + > +int if_incoerrors(if_t ifp, int oerrors) > +{ > + ((struct ifnet *)ifp)->if_oerrors += oerrors; > + return (0); > +} > + > +int if_inciqdrops(if_t ifp, int val) > +{ > + ((struct ifnet *)ifp)->if_iqdrops += val; > + return (0); > +} > + > +int > +if_setcollisions(if_t ifp, int collisions) > +{ > + ((struct ifnet *)ifp)->if_collisions = collisions; > + return (0); > +} > + > +int > +if_inccollisions(if_t ifp, int collisions) > +{ > + ((struct ifnet *)ifp)->if_collisions += collisions; > + return (0); > +} > + > +int > +if_setipackets(if_t ifp, int pkts) > +{ > + ((struct ifnet *)ifp)->if_ipackets = pkts; > + return (0); > +} > + > +int > +if_setopackets(if_t ifp, int pkts) > +{ > + ((struct ifnet *)ifp)->if_opackets = pkts; > + return (0); > +} > + > +int > +if_incobytes(if_t ifp, int bytes) > +{ > + ((struct ifnet *)ifp)->if_obytes += bytes; > + return (0); > +} > + > +int > +if_setibytes(if_t ifp, int bytes) > +{ > + ((struct ifnet *)ifp)->if_ibytes = bytes; > + return (0); > +} > + > +int > +if_setobytes(if_t ifp, int bytes) > +{ > + ((struct ifnet *)ifp)->if_obytes = bytes; > + return (0); > +} > + > + > +int > +if_sendq_empty(if_t ifp) > +{ > + return IFQ_DRV_IS_EMPTY(&((struct ifnet *)ifp)->if_snd); > +} > + > +int if_getiqdrops(if_t ifp) > +{ > + return ((struct ifnet *)ifp)->if_iqdrops; > +} > + > +int > +if_incimcasts(if_t ifp, int mcast) > +{ > + ((struct ifnet *)ifp)->if_imcasts += mcast; > + return (0); > +} > + > + > +int > +if_incomcasts(if_t ifp, int mcast) > +{ > + ((struct ifnet *)ifp)->if_omcasts += mcast; > + return (0); > +} > + > +int > +if_setimcasts(if_t ifp, int mcast) > +{ > + ((struct ifnet *)ifp)->if_imcasts = mcast; > + return (0); > +} > + > + > +struct ifaddr * > +if_getifaddr(if_t ifp) > +{ > + return ((struct ifnet *)ifp)->if_addr; > +} > + > +int > +if_getamcount(if_t ifp) > +{ > + return ((struct ifnet *)ifp)->if_amcount; > +} > + > + > +int > +if_setsendqready(if_t ifp) > +{ > + IFQ_SET_READY(&((struct ifnet *)ifp)->if_snd); > + return (0); > +} > + > +int > +if_setsendqlen(if_t ifp, int tx_desc_count) > +{ > + IFQ_SET_MAXLEN(&((struct ifnet *)ifp)->if_snd, tx_desc_count); > + ((struct ifnet *)ifp)->if_snd.ifq_drv_maxlen = tx_desc_count; > + > + return (0); > +} > + > +int > +if_vlantrunkinuse(if_t ifp) > +{ > + return ((struct ifnet *)ifp)->if_vlantrunk != NULL?1:0; > +} > + > +int > +if_input(if_t ifp, struct mbuf* sendmp) > +{ > + (*((struct ifnet *)ifp)->if_input)((struct ifnet *)ifp, sendmp); > + return (0); > + > +} > + > +/* XXX */ > +#ifndef ETH_ADDR_LEN > +#define ETH_ADDR_LEN 6 > +#endif > + > +int > +if_setupmultiaddr(if_t ifp, void *mta, int *cnt, int max) > +{ > + struct ifmultiaddr *ifma; > + uint8_t *lmta = (uint8_t *)mta; > + int mcnt = 0; > + > + TAILQ_FOREACH(ifma, &((struct ifnet *)ifp)->if_multiaddrs, ifma_link) { > + if (ifma->ifma_addr->sa_family != AF_LINK) > + continue; > + > + if (mcnt == max) > + break; > + > + bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), > + &lmta[mcnt * ETH_ADDR_LEN], ETH_ADDR_LEN); > + mcnt++; > + } > + *cnt = mcnt; > + > + return (0); > +} > + > +int > +if_multiaddr_array(if_t ifp, void *mta, int *cnt, int max) > +{ > + int error; > + > + if_maddr_rlock(ifp); > + error = if_setupmultiaddr(ifp, mta, cnt, max); > + if_maddr_runlock(ifp); > + return (error); > +} > + > +int > +if_multiaddr_count(if_t ifp, int max) > +{ > + struct ifmultiaddr *ifma; > + int count; > + > + count = 0; > + if_maddr_rlock(ifp); > + TAILQ_FOREACH(ifma, &((struct ifnet *)ifp)->if_multiaddrs, ifma_link) { > + if (ifma->ifma_addr->sa_family != AF_LINK) > + continue; > + count++; > + if (count == max) > + break; > + } > + if_maddr_runlock(ifp); > + return (count); > +} > + > +struct mbuf * > +if_dequeue(if_t ifp) > +{ > + struct mbuf *m; > + IFQ_DRV_DEQUEUE(&((struct ifnet *)ifp)->if_snd, m); > + > + return (m); > +} > + > +int > +if_sendq_prepend(if_t ifp, struct mbuf *m) > +{ > + IFQ_DRV_PREPEND(&((struct ifnet *)ifp)->if_snd, m); > + return (0); > +} > + > +int > +if_setifheaderlen(if_t ifp, int len) > +{ > + ((struct ifnet *)ifp)->if_data.ifi_hdrlen = len; > + return (0); > +} > + > +caddr_t > +if_getlladdr(if_t ifp) > +{ > + return (IF_LLADDR((struct ifnet *)ifp)); > +} > + > +void * > +if_gethandle(u_char type) > +{ > + return (if_alloc(type)); > +} > + > +void > +if_bpfmtap(if_t ifh, struct mbuf *m) > +{ > + struct ifnet *ifp = (struct ifnet *)ifh; > + > + BPF_MTAP(ifp, m); > +} > + > +void > +if_etherbpfmtap(if_t ifh, struct mbuf *m) > +{ > + struct ifnet *ifp = (struct ifnet *)ifh; > + > + ETHER_BPF_MTAP(ifp, m); > +} > + > +void > +if_vlancap(if_t ifh) > +{ > + struct ifnet *ifp = (struct ifnet *)ifh; > + VLAN_CAPABILITIES(ifp); > +} > + > +void > +if_setinitfn(if_t ifp, void (*init_fn)(void *)) > +{ > + ((struct ifnet *)ifp)->if_init = init_fn; > +} > + > +void > +if_setioctlfn(if_t ifp, int (*ioctl_fn)(void *, u_long, caddr_t)) > +{ > + ((struct ifnet *)ifp)->if_ioctl = (void *)ioctl_fn; > +} > + > +void > +if_setstartfn(if_t ifp, void (*start_fn)(void *)) > +{ > + ((struct ifnet *)ifp)->if_start = (void *)start_fn; > +} > + > +void > +if_settransmitfn(if_t ifp, if_transmit_fn_t start_fn) > +{ > + ((struct ifnet *)ifp)->if_transmit = start_fn; > +} > + > +void if_setqflushfn(if_t ifp, if_qflush_fn_t flush_fn) > +{ > + ((struct ifnet *)ifp)->if_qflush = flush_fn; > + > +} > + > +/* These wrappers are hopefully temporary, till all drivers use drvapi */ > +#ifdef INET > +void > +arp_ifinit_drv(if_t ifh, struct ifaddr *ifa) > +{ > + arp_ifinit((struct ifnet *)ifh, ifa); > +} > +#endif > + > +void > +ether_ifattach_drv(if_t ifh, const u_int8_t *lla) > +{ > + ether_ifattach((struct ifnet *)ifh, lla); > +} > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 18:27:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1533279; Mon, 2 Jun 2014 18:27:03 +0000 (UTC) Received: from mail-qg0-x234.google.com (mail-qg0-x234.google.com [IPv6:2607:f8b0:400d:c04::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29399254F; Mon, 2 Jun 2014 18:27:03 +0000 (UTC) Received: by mail-qg0-f52.google.com with SMTP id a108so11246018qge.39 for ; Mon, 02 Jun 2014 11:27:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=0OtFC+Wf2A1beHxoz4xJDjNFDvHitCqn98zlT+awR+E=; b=fQ6we1J08gyij1/7X+xtVDvM2b3htSWVSoJaznu0DcR56cK502NQjU0EYOwumRCRwA cYh30/Dq7OVKAr1fVQRLdSut+n5rrJDBmjev+XS1seyNg873BWh5SPV5d2HXqwc7AIwA vEoY0B4T4v8jGHd2MNqHxpBq8HdMt1Lx9i8e7UwRH5Vv12xLU9Qd3MW0tfh+HuhqBs7P NHp98n9KDgQ+KaFlHf/n4FSqX7banaAvXus/XfqFuEagqpw/XMlurKn8EprLHs42trbq kE2S0jWrrXSO+IkTC1BWIUn+3/SQ5FrZWfDj3IV53uyyAkvGlMzFnaNOXJloZZhESLo4 7dbA== MIME-Version: 1.0 X-Received: by 10.140.91.5 with SMTP id y5mr48182142qgd.12.1401733622324; Mon, 02 Jun 2014 11:27:02 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.43.134 with HTTP; Mon, 2 Jun 2014 11:27:02 -0700 (PDT) In-Reply-To: References: <201406021754.s52Hsd1B039620@svn.freebsd.org> Date: Mon, 2 Jun 2014 11:27:02 -0700 X-Google-Sender-Auth: uUbYZPd7xLuPqxGmZBnNAoIrYmc Message-ID: Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net From: Adrian Chadd To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 18:27:03 -0000 .. and actually, bikeshedding for a moment, would we be able to move a lot of these accessor methods over to inlines? Would that break the Juniper way of doing things? -a On 2 June 2014 11:26, Adrian Chadd wrote: > Woo! > > Would you mind doing up a 30 second "what convert X to Y" document so > I can do the driveby on the wireless stack and drivers? > > I'll look at the script but since the wifi stack sits in between the > normal network stack layering, I just want to make sure I get all of > the right bits converted over all at the same time and have it have a > good chance of working. > > Thanks! > > > -a > > > On 2 June 2014 10:54, Marcel Moolenaar wrote: >> Author: marcel >> Date: Mon Jun 2 17:54:39 2014 >> New Revision: 266974 >> URL: http://svnweb.freebsd.org/changeset/base/266974 >> >> Log: >> Introduce a procedural interface to the ifnet structure. The new >> interface allows the ifnet structure to be defined as an opaque >> type in NIC drivers. This then allows the ifnet structure to be >> changed without a need to change or recompile NIC drivers. >> >> Put differently, NIC drivers can be written and compiled once and >> be used with different network stack implementations, provided of >> course that those network stack implementations have an API and >> ABI compatible interface. >> >> This commit introduces the 'if_t' type to replace 'struct ifnet *' >> as the type of a network interface. The 'if_t' type is defined as >> 'void *' to enable the compiler to perform type conversion to >> 'struct ifnet *' and vice versa where needed and without warnings. >> The functions that implement the API are the only functions that >> need to have an explicit cast. >> >> The MII code has been converted to use the driver API to avoid >> unnecessary code churn. Code churn comes from having to work with >> both converted and unconverted drivers in correlation with having >> callback functions that take an interface. By converting the MII >> code first, the callback functions can be defined so that the >> compiler will perform the typecasts automatically. >> >> As soon as all drivers have been converted, the if_t type can be >> redefined as needed and the API functions can be fix to not need >> an explicit cast. >> >> The immediate benefactors of this change are: >> 1. Juniper Networks - The network stack implementation in Junos >> is entirely different from FreeBSD's one and this change >> allows Juniper to build "stock" NIC drivers that can be used >> in combination with both the FreeBSD and Junos stacks. >> 2. FreeBSD - This change opens the door towards changing ifnet >> and implementing new features and optimizations in the network >> stack without it requiring a change in the many NIC drivers >> FreeBSD has. >> >> Submitted by: Anuranjan Shukla >> Reviewed by: glebius@ >> Obtained from: Juniper Networks, Inc. >> >> Modified: >> head/sys/dev/dc/dcphy.c >> head/sys/dev/dc/pnphy.c >> head/sys/dev/fxp/inphy.c >> head/sys/dev/mii/brgphy.c >> head/sys/dev/mii/e1000phy.c >> head/sys/dev/mii/ip1000phy.c >> head/sys/dev/mii/jmphy.c >> head/sys/dev/mii/mii.c >> head/sys/dev/mii/miivar.h >> head/sys/dev/mii/nsphy.c >> head/sys/dev/mii/rgephy.c >> head/sys/dev/mii/truephy.c >> head/sys/dev/netmap/netmap_generic.c >> head/sys/dev/netmap/netmap_kern.h >> head/sys/kern/kern_poll.c >> head/sys/net/if.c >> head/sys/net/if_media.h >> head/sys/net/if_var.h >> head/sys/net/ifq.h >> >> Modified: head/sys/dev/dc/dcphy.c >> ============================================================================== >> --- head/sys/dev/dc/dcphy.c Mon Jun 2 17:34:08 2014 (r266973) >> +++ head/sys/dev/dc/dcphy.c Mon Jun 2 17:54:39 2014 (r266974) >> @@ -153,7 +153,7 @@ dcphy_attach(device_t dev) >> &dcphy_funcs, 0); >> >> /*PHY_RESET(sc);*/ >> - dc_sc = sc->mii_pdata->mii_ifp->if_softc; >> + dc_sc = if_getsoftc(sc->mii_pdata->mii_ifp); >> CSR_WRITE_4(dc_sc, DC_10BTSTAT, 0); >> CSR_WRITE_4(dc_sc, DC_10BTCTRL, 0); >> >> @@ -191,7 +191,7 @@ dcphy_service(struct mii_softc *sc, stru >> int reg; >> u_int32_t mode; >> >> - dc_sc = mii->mii_ifp->if_softc; >> + dc_sc = if_getsoftc(mii->mii_ifp); >> >> switch (cmd) { >> case MII_POLLSTAT: >> @@ -201,7 +201,7 @@ dcphy_service(struct mii_softc *sc, stru >> /* >> * If the interface is not up, don't do anything. >> */ >> - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) >> + if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0) >> break; >> >> mii->mii_media_active = IFM_NONE; >> @@ -251,7 +251,7 @@ dcphy_service(struct mii_softc *sc, stru >> /* >> * Is the interface even up? >> */ >> - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) >> + if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0) >> return (0); >> >> /* >> @@ -298,12 +298,12 @@ dcphy_status(struct mii_softc *sc) >> int anlpar, tstat; >> struct dc_softc *dc_sc; >> >> - dc_sc = mii->mii_ifp->if_softc; >> + dc_sc = if_getsoftc(mii->mii_ifp); >> >> mii->mii_media_status = IFM_AVALID; >> mii->mii_media_active = IFM_ETHER; >> >> - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) >> + if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0) >> return; >> >> tstat = CSR_READ_4(dc_sc, DC_10BTSTAT); >> @@ -378,7 +378,7 @@ dcphy_auto(struct mii_softc *mii) >> { >> struct dc_softc *sc; >> >> - sc = mii->mii_pdata->mii_ifp->if_softc; >> + sc = if_getsoftc(mii->mii_pdata->mii_ifp); >> >> DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_PORTSEL); >> DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_FULLDUPLEX); >> @@ -399,7 +399,7 @@ dcphy_reset(struct mii_softc *mii) >> { >> struct dc_softc *sc; >> >> - sc = mii->mii_pdata->mii_ifp->if_softc; >> + sc = if_getsoftc(mii->mii_pdata->mii_ifp); >> >> DC_CLRBIT(sc, DC_SIARESET, DC_SIA_RESET); >> DELAY(1000); >> >> Modified: head/sys/dev/dc/pnphy.c >> ============================================================================== >> --- head/sys/dev/dc/pnphy.c Mon Jun 2 17:34:08 2014 (r266973) >> +++ head/sys/dev/dc/pnphy.c Mon Jun 2 17:54:39 2014 (r266974) >> @@ -152,7 +152,7 @@ pnphy_service(struct mii_softc *sc, stru >> /* >> * If the interface is not up, don't do anything. >> */ >> - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) >> + if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0) >> break; >> >> /* >> @@ -180,7 +180,7 @@ pnphy_service(struct mii_softc *sc, stru >> /* >> * Is the interface even up? >> */ >> - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) >> + if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0) >> return (0); >> >> break; >> @@ -201,7 +201,7 @@ pnphy_status(struct mii_softc *sc) >> int reg; >> struct dc_softc *dc_sc; >> >> - dc_sc = mii->mii_ifp->if_softc; >> + dc_sc = if_getsoftc(mii->mii_ifp); >> >> mii->mii_media_status = IFM_AVALID; >> mii->mii_media_active = IFM_ETHER; >> >> Modified: head/sys/dev/fxp/inphy.c >> ============================================================================== >> --- head/sys/dev/fxp/inphy.c Mon Jun 2 17:34:08 2014 (r266973) >> +++ head/sys/dev/fxp/inphy.c Mon Jun 2 17:54:39 2014 (r266974) >> @@ -122,7 +122,7 @@ inphy_service(struct mii_softc *sc, stru >> /* >> * If the interface is not up, don't do anything. >> */ >> - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) >> + if ((if_getflags(mii->mii_ifp) & IFF_UP) == 0) >> break; >> >> mii_phy_setmedia(sc); >> >> Modified: head/sys/dev/mii/brgphy.c >> ============================================================================== >> --- head/sys/dev/mii/brgphy.c Mon Jun 2 17:34:08 2014 (r266973) >> +++ head/sys/dev/mii/brgphy.c Mon Jun 2 17:54:39 2014 (r266974) >> @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include >> >> #include >> #include >> @@ -197,7 +198,7 @@ brgphy_attach(device_t dev) >> struct bge_softc *bge_sc = NULL; >> struct bce_softc *bce_sc = NULL; >> struct mii_softc *sc; >> - struct ifnet *ifp; >> + if_t ifp; >> >> bsc = device_get_softc(dev); >> sc = &bsc->mii_sc; >> @@ -209,10 +210,10 @@ brgphy_attach(device_t dev) >> ifp = sc->mii_pdata->mii_ifp; >> >> /* Find the MAC driver associated with this PHY. */ >> - if (strcmp(ifp->if_dname, "bge") == 0) >> - bge_sc = ifp->if_softc; >> - else if (strcmp(ifp->if_dname, "bce") == 0) >> - bce_sc = ifp->if_softc; >> + if (strcmp(if_getdname(ifp), "bge") == 0) >> + bge_sc = if_getsoftc(ifp); >> + else if (strcmp(if_getdname(ifp), "bce") == 0) >> + bce_sc = if_getsoftc(ifp); >> >> /* Handle any special cases based on the PHY ID */ >> switch (sc->mii_mpd_oui) { >> @@ -879,7 +880,7 @@ brgphy_reset(struct mii_softc *sc) >> { >> struct bge_softc *bge_sc = NULL; >> struct bce_softc *bce_sc = NULL; >> - struct ifnet *ifp; >> + if_t ifp; >> int i, val; >> >> /* >> @@ -932,10 +933,10 @@ brgphy_reset(struct mii_softc *sc) >> ifp = sc->mii_pdata->mii_ifp; >> >> /* Find the driver associated with this PHY. */ >> - if (strcmp(ifp->if_dname, "bge") == 0) { >> - bge_sc = ifp->if_softc; >> - } else if (strcmp(ifp->if_dname, "bce") == 0) { >> - bce_sc = ifp->if_softc; >> + if (strcmp(if_getdname(ifp), "bge") == 0) { >> + bge_sc = if_getsoftc(ifp); >> + } else if (strcmp(if_getdname(ifp), "bce") == 0) { >> + bce_sc = if_getsoftc(ifp); >> } >> >> if (bge_sc) { >> @@ -954,7 +955,7 @@ brgphy_reset(struct mii_softc *sc) >> brgphy_fixup_jitter_bug(sc); >> >> if (bge_sc->bge_flags & BGE_FLAG_JUMBO) >> - brgphy_jumbo_settings(sc, ifp->if_mtu); >> + brgphy_jumbo_settings(sc, if_getmtu(ifp)); >> >> if ((bge_sc->bge_phy_flags & BGE_PHY_NO_WIRESPEED) == 0) >> brgphy_ethernet_wirespeed(sc); >> @@ -1065,11 +1066,11 @@ brgphy_reset(struct mii_softc *sc) >> (BCE_CHIP_REV(bce_sc) == BCE_CHIP_REV_Bx)) >> brgphy_fixup_disable_early_dac(sc); >> >> - brgphy_jumbo_settings(sc, ifp->if_mtu); >> + brgphy_jumbo_settings(sc, if_getmtu(ifp)); >> brgphy_ethernet_wirespeed(sc); >> } else { >> brgphy_fixup_ber_bug(sc); >> - brgphy_jumbo_settings(sc, ifp->if_mtu); >> + brgphy_jumbo_settings(sc, if_getmtu(ifp)); >> brgphy_ethernet_wirespeed(sc); >> } >> } >> >> Modified: head/sys/dev/mii/e1000phy.c >> ============================================================================== >> --- head/sys/dev/mii/e1000phy.c Mon Jun 2 17:34:08 2014 (r266973) >> +++ head/sys/dev/mii/e1000phy.c Mon Jun 2 17:54:39 2014 (r266974) >> @@ -132,14 +132,14 @@ static int >> e1000phy_attach(device_t dev) >> { >> struct mii_softc *sc; >> - struct ifnet *ifp; >> + if_t ifp; >> >> sc = device_get_softc(dev); >> >> mii_phy_dev_attach(dev, MIIF_NOMANPAUSE, &e1000phy_funcs, 0); >> >> ifp = sc->mii_pdata->mii_ifp; >> - if (strcmp(ifp->if_dname, "msk") == 0 && >> + if (strcmp(if_getdname(ifp), "msk") == 0 && >> (sc->mii_flags & MIIF_MACPRIV0) != 0) >> sc->mii_flags |= MIIF_PHYPRIV0; >> >> >> Modified: head/sys/dev/mii/ip1000phy.c >> ============================================================================== >> --- head/sys/dev/mii/ip1000phy.c Mon Jun 2 17:34:08 2014 (r266973) >> +++ head/sys/dev/mii/ip1000phy.c Mon Jun 2 17:54:39 2014 (r266974) >> @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include >> #include >> >> #include >> @@ -109,7 +110,7 @@ ip1000phy_attach(device_t dev) >> ma = device_get_ivars(dev); >> flags = MIIF_NOISOLATE | MIIF_NOMANPAUSE; >> if (MII_MODEL(ma->mii_id2) == MII_MODEL_xxICPLUS_IP1000A && >> - strcmp(ma->mii_data->mii_ifp->if_dname, "stge") == 0 && >> + strcmp(if_getdname(ma->mii_data->mii_ifp), "stge") == 0 && >> (miibus_get_flags(dev) & MIIF_MACPRIV0) != 0) >> flags |= MIIF_PHYPRIV0; >> mii_phy_dev_attach(dev, flags, &ip1000phy_funcs, 1); >> >> Modified: head/sys/dev/mii/jmphy.c >> ============================================================================== >> --- head/sys/dev/mii/jmphy.c Mon Jun 2 17:34:08 2014 (r266973) >> +++ head/sys/dev/mii/jmphy.c Mon Jun 2 17:54:39 2014 (r266974) >> @@ -105,7 +105,7 @@ jmphy_attach(device_t dev) >> >> ma = device_get_ivars(dev); >> flags = 0; >> - if (strcmp(ma->mii_data->mii_ifp->if_dname, "jme") == 0 && >> + if (strcmp(if_getdname(ma->mii_data->mii_ifp), "jme") == 0 && >> (miibus_get_flags(dev) & MIIF_MACPRIV0) != 0) >> flags |= MIIF_PHYPRIV0; >> mii_phy_dev_attach(dev, flags, &jmphy_funcs, 1); >> >> Modified: head/sys/dev/mii/mii.c >> ============================================================================== >> --- head/sys/dev/mii/mii.c Mon Jun 2 17:34:08 2014 (r266973) >> +++ head/sys/dev/mii/mii.c Mon Jun 2 17:54:39 2014 (r266974) >> @@ -106,7 +106,7 @@ driver_t miibus_driver = { >> }; >> >> struct miibus_ivars { >> - struct ifnet *ifp; >> + if_t ifp; >> ifm_change_cb_t ifmedia_upd; >> ifm_stat_cb_t ifmedia_sts; >> u_int mii_flags; >> @@ -147,8 +147,8 @@ miibus_attach(device_t dev) >> ifmedia_init(&mii->mii_media, IFM_IMASK, ivars->ifmedia_upd, >> ivars->ifmedia_sts); >> mii->mii_ifp = ivars->ifp; >> - mii->mii_ifp->if_capabilities |= IFCAP_LINKSTATE; >> - mii->mii_ifp->if_capenable |= IFCAP_LINKSTATE; >> + if_setcapabilitiesbit(mii->mii_ifp, IFCAP_LINKSTATE, 0); >> + if_setcapenablebit(mii->mii_ifp, IFCAP_LINKSTATE, 0); >> LIST_INIT(&mii->mii_phys); >> >> return (bus_generic_attach(dev)); >> @@ -308,7 +308,7 @@ miibus_statchg(device_t dev) >> MIIBUS_STATCHG(parent); >> >> mii = device_get_softc(dev); >> - mii->mii_ifp->if_baudrate = ifmedia_baudrate(mii->mii_media_active); >> + if_setbaudrate(mii->mii_ifp, ifmedia_baudrate(mii->mii_media_active)); >> } >> >> static void >> @@ -330,7 +330,7 @@ miibus_linkchg(device_t dev) >> link_state = LINK_STATE_DOWN; >> } else >> link_state = LINK_STATE_UNKNOWN; >> - if_link_state_change(mii->mii_ifp, link_state); >> + if_linkstate_change_drv(mii->mii_ifp, link_state); >> } >> >> static void >> @@ -358,7 +358,7 @@ miibus_mediainit(device_t dev) >> * the PHYs to the network interface driver parent. >> */ >> int >> -mii_attach(device_t dev, device_t *miibus, struct ifnet *ifp, >> +mii_attach(device_t dev, device_t *miibus, void *ifp, >> ifm_change_cb_t ifmedia_upd, ifm_stat_cb_t ifmedia_sts, int capmask, >> int phyloc, int offloc, int flags) >> { >> >> Modified: head/sys/dev/mii/miivar.h >> ============================================================================== >> --- head/sys/dev/mii/miivar.h Mon Jun 2 17:34:08 2014 (r266973) >> +++ head/sys/dev/mii/miivar.h Mon Jun 2 17:54:39 2014 (r266974) >> @@ -36,6 +36,7 @@ >> #define _DEV_MII_MIIVAR_H_ >> >> #include >> +#include /* XXX driver API temporary */ >> >> /* >> * Media Independent Interface data structure defintions >> @@ -57,7 +58,7 @@ typedef void (*mii_statchg_t)(struct dev >> */ >> struct mii_data { >> struct ifmedia mii_media; /* media information */ >> - struct ifnet *mii_ifp; /* pointer back to network interface */ >> + if_t mii_ifp; /* pointer back to network interface */ >> >> /* >> * For network interfaces with multiple PHYs, a list of all >> @@ -246,7 +247,7 @@ MIIBUS_ACCESSOR(flags, FLAGS, u_int) >> extern devclass_t miibus_devclass; >> extern driver_t miibus_driver; >> >> -int mii_attach(device_t, device_t *, struct ifnet *, ifm_change_cb_t, >> +int mii_attach(device_t, device_t *, if_t, ifm_change_cb_t, >> ifm_stat_cb_t, int, int, int, int); >> void mii_down(struct mii_data *); >> int mii_mediachg(struct mii_data *); >> >> Modified: head/sys/dev/mii/nsphy.c >> ============================================================================== >> --- head/sys/dev/mii/nsphy.c Mon Jun 2 17:34:08 2014 (r266973) >> +++ head/sys/dev/mii/nsphy.c Mon Jun 2 17:54:39 2014 (r266974) >> @@ -186,7 +186,7 @@ nsphy_service(struct mii_softc *sc, stru >> */ >> reg |= 0x0100 | 0x0400; >> >> - if (strcmp(mii->mii_ifp->if_dname, "fxp") == 0) >> + if (strcmp(if_getdname(mii->mii_ifp), "fxp") == 0) >> PHY_WRITE(sc, MII_NSPHY_PCR, reg); >> >> mii_phy_setmedia(sc); >> >> Modified: head/sys/dev/mii/rgephy.c >> ============================================================================== >> --- head/sys/dev/mii/rgephy.c Mon Jun 2 17:34:08 2014 (r266973) >> +++ head/sys/dev/mii/rgephy.c Mon Jun 2 17:54:39 2014 (r266974) >> @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include >> #include >> >> #include >> @@ -118,7 +119,7 @@ rgephy_attach(device_t dev) >> sc = device_get_softc(dev); >> ma = device_get_ivars(dev); >> flags = 0; >> - if (strcmp(ma->mii_data->mii_ifp->if_dname, "re") == 0) >> + if (strcmp(if_getdname(ma->mii_data->mii_ifp), "re") == 0) >> flags |= MIIF_PHYPRIV0; >> mii_phy_dev_attach(dev, flags, &rgephy_funcs, 0); >> >> >> Modified: head/sys/dev/mii/truephy.c >> ============================================================================== >> --- head/sys/dev/mii/truephy.c Mon Jun 2 17:34:08 2014 (r266973) >> +++ head/sys/dev/mii/truephy.c Mon Jun 2 17:54:39 2014 (r266974) >> @@ -265,7 +265,7 @@ truephy_reset(struct mii_softc *sc) >> >> mii_phy_reset(sc); >> >> - if (TRUEPHY_FRAMELEN(sc->mii_pdata->mii_ifp->if_mtu) > 2048) { >> + if (TRUEPHY_FRAMELEN((if_getmtu(sc->mii_pdata->mii_ifp)) > 2048)) { >> int conf; >> >> conf = PHY_READ(sc, TRUEPHY_CONF); >> >> Modified: head/sys/dev/netmap/netmap_generic.c >> ============================================================================== >> --- head/sys/dev/netmap/netmap_generic.c Mon Jun 2 17:34:08 2014 (r266973) >> +++ head/sys/dev/netmap/netmap_generic.c Mon Jun 2 17:54:39 2014 (r266974) >> @@ -804,3 +804,9 @@ generic_netmap_attach(struct ifnet *ifp) >> >> return retval; >> } >> + >> +struct netmap_adapter * >> +netmap_getna(if_t ifp) >> +{ >> + return (NA((struct ifnet *)ifp)); >> +} >> >> Modified: head/sys/dev/netmap/netmap_kern.h >> ============================================================================== >> --- head/sys/dev/netmap/netmap_kern.h Mon Jun 2 17:34:08 2014 (r266973) >> +++ head/sys/dev/netmap/netmap_kern.h Mon Jun 2 17:54:39 2014 (r266974) >> @@ -1262,6 +1262,7 @@ void netmap_catch_tx(struct netmap_gener >> int generic_xmit_frame(struct ifnet *ifp, struct mbuf *m, void *addr, u_int len, u_int ring_nr); >> int generic_find_num_desc(struct ifnet *ifp, u_int *tx, u_int *rx); >> void generic_find_num_queues(struct ifnet *ifp, u_int *txq, u_int *rxq); >> +struct netmap_adapter *netmap_getna(if_t ifp); >> >> /* >> * netmap_mitigation API. This is used by the generic adapter >> @@ -1376,5 +1377,4 @@ void bdg_mismatch_datapath(struct netmap >> struct netmap_vp_adapter *dst_na, >> struct nm_bdg_fwd *ft_p, struct netmap_ring *ring, >> u_int *j, u_int lim, u_int *howmany); >> - >> #endif /* _NET_NETMAP_KERN_H_ */ >> >> Modified: head/sys/kern/kern_poll.c >> ============================================================================== >> --- head/sys/kern/kern_poll.c Mon Jun 2 17:34:08 2014 (r266973) >> +++ head/sys/kern/kern_poll.c Mon Jun 2 17:54:39 2014 (r266974) >> @@ -451,6 +451,19 @@ netisr_poll(void) >> mtx_unlock(&poll_mtx); >> } >> >> +/* The following should be temporary, till all drivers use the driver API */ >> +int >> +ether_poll_register_drv(poll_handler_drv_t *h, if_t ifh) >> +{ >> + return (ether_poll_register((poll_handler_t *)h, (struct ifnet *)ifh)); >> +} >> + >> +int >> +ether_poll_deregister_drv(if_t ifh) >> +{ >> + return (ether_poll_deregister((struct ifnet *)ifh)); >> +} >> + >> /* >> * Try to register routine for polling. Returns 0 if successful >> * (and polling should be enabled), error code otherwise. >> >> Modified: head/sys/net/if.c >> ============================================================================== >> --- head/sys/net/if.c Mon Jun 2 17:34:08 2014 (r266973) >> +++ head/sys/net/if.c Mon Jun 2 17:54:39 2014 (r266974) >> @@ -63,12 +63,16 @@ >> #include >> #include >> >> +#include >> +#include >> #include >> #include >> #include >> #include >> #include >> #include >> +#include >> +#include >> #include >> #include >> #include >> @@ -1400,17 +1404,17 @@ if_addr_runlock(struct ifnet *ifp) >> } >> >> void >> -if_maddr_rlock(struct ifnet *ifp) >> +if_maddr_rlock(if_t ifp) >> { >> >> - IF_ADDR_RLOCK(ifp); >> + IF_ADDR_RLOCK((struct ifnet *)ifp); >> } >> >> void >> -if_maddr_runlock(struct ifnet *ifp) >> +if_maddr_runlock(if_t ifp) >> { >> >> - IF_ADDR_RUNLOCK(ifp); >> + IF_ADDR_RUNLOCK((struct ifnet *)ifp); >> } >> >> /* >> @@ -3461,3 +3465,644 @@ if_deregister_com_alloc(u_char type) >> if_com_alloc[type] = NULL; >> if_com_free[type] = NULL; >> } >> + >> +/* API for driver access to network stack owned ifnet.*/ >> +uint64_t >> +if_setbaudrate(void *arg, uint64_t baudrate) >> +{ >> + struct ifnet *ifp = arg; >> + uint64_t oldbrate; >> + >> + oldbrate = ifp->if_baudrate; >> + ifp->if_baudrate = baudrate; >> + return (oldbrate); >> +} >> + >> +uint64_t >> +if_getbaudrate(if_t ifp) >> +{ >> + >> + return (((struct ifnet *)ifp)->if_baudrate); >> +} >> + >> +int >> +if_setcapabilities(if_t ifp, int capabilities) >> +{ >> + ((struct ifnet *)ifp)->if_capabilities = capabilities; >> + return (0); >> +} >> + >> +int >> +if_setcapabilitiesbit(if_t ifp, int setbit, int clearbit) >> +{ >> + ((struct ifnet *)ifp)->if_capabilities |= setbit; >> + ((struct ifnet *)ifp)->if_capabilities &= ~clearbit; >> + >> + return (0); >> +} >> + >> +int >> +if_getcapabilities(if_t ifp) >> +{ >> + return ((struct ifnet *)ifp)->if_capabilities; >> +} >> + >> +int >> +if_setcapenable(if_t ifp, int capabilities) >> +{ >> + ((struct ifnet *)ifp)->if_capenable = capabilities; >> + return (0); >> +} >> + >> +int >> +if_setcapenablebit(if_t ifp, int setcap, int clearcap) >> +{ >> + if(setcap) >> + ((struct ifnet *)ifp)->if_capenable |= setcap; >> + if(clearcap) >> + ((struct ifnet *)ifp)->if_capenable &= ~clearcap; >> + >> + return (0); >> +} >> + >> +const char * >> +if_getdname(if_t ifp) >> +{ >> + return ((struct ifnet *)ifp)->if_dname; >> +} >> + >> +int >> +if_togglecapenable(if_t ifp, int togglecap) >> +{ >> + ((struct ifnet *)ifp)->if_capenable ^= togglecap; >> + return (0); >> +} >> + >> +int >> +if_getcapenable(if_t ifp) >> +{ >> + return ((struct ifnet *)ifp)->if_capenable; >> +} >> + >> +/* >> + * This is largely undesirable because it ties ifnet to a device, but does >> + * provide flexiblity for an embedded product vendor. Should be used with >> + * the understanding that it violates the interface boundaries, and should be >> + * a last resort only. >> + */ >> +int >> +if_setdev(if_t ifp, void *dev) >> +{ >> + return (0); >> +} >> + >> +int >> +if_setdrvflagbits(if_t ifp, int set_flags, int clear_flags) >> +{ >> + ((struct ifnet *)ifp)->if_drv_flags |= set_flags; >> + ((struct ifnet *)ifp)->if_drv_flags &= ~clear_flags; >> + >> + return (0); >> +} >> + >> +int >> +if_getdrvflags(if_t ifp) >> +{ >> + return ((struct ifnet *)ifp)->if_drv_flags; >> +} >> + >> +int >> +if_setdrvflags(if_t ifp, int flags) >> +{ >> + ((struct ifnet *)ifp)->if_drv_flags = flags; >> + return (0); >> +} >> + >> + >> +int >> +if_setflags(if_t ifp, int flags) >> +{ >> + ((struct ifnet *)ifp)->if_flags = flags; >> + return (0); >> +} >> + >> +int >> +if_setflagbits(if_t ifp, int set, int clear) >> +{ >> + ((struct ifnet *)ifp)->if_flags |= set; >> + ((struct ifnet *)ifp)->if_flags &= ~clear; >> + >> + return (0); >> +} >> + >> +int >> +if_getflags(if_t ifp) >> +{ >> + return ((struct ifnet *)ifp)->if_flags; >> +} >> + >> +int >> +if_clearhwassist(if_t ifp) >> +{ >> + ((struct ifnet *)ifp)->if_hwassist = 0; >> + return (0); >> +} >> + >> +int >> +if_sethwassistbits(if_t ifp, int toset, int toclear) >> +{ >> + ((struct ifnet *)ifp)->if_hwassist |= toset; >> + ((struct ifnet *)ifp)->if_hwassist &= ~toclear; >> + >> + return (0); >> +} >> + >> +int >> +if_sethwassist(if_t ifp, int hwassist_bit) >> +{ >> + ((struct ifnet *)ifp)->if_hwassist = hwassist_bit; >> + return (0); >> +} >> + >> +int >> +if_gethwassist(if_t ifp) >> +{ >> + return ((struct ifnet *)ifp)->if_hwassist; >> +} >> + >> +int >> +if_setmtu(if_t ifp, int mtu) >> +{ >> + ((struct ifnet *)ifp)->if_mtu = mtu; >> + return (0); >> +} >> + >> +int >> +if_getmtu(if_t ifp) >> +{ >> + return ((struct ifnet *)ifp)->if_mtu; >> +} >> + >> +int >> +if_setsoftc(if_t ifp, void *softc) >> +{ >> + ((struct ifnet *)ifp)->if_softc = softc; >> + return (0); >> +} >> + >> +void * >> +if_getsoftc(if_t ifp) >> +{ >> + return ((struct ifnet *)ifp)->if_softc; >> +} >> + >> +void >> +if_setrcvif(struct mbuf *m, if_t ifp) >> +{ >> + m->m_pkthdr.rcvif = (struct ifnet *)ifp; >> +} >> + >> +void >> +if_setvtag(struct mbuf *m, uint16_t tag) >> +{ >> + m->m_pkthdr.ether_vtag = tag; >> +} >> + >> +uint16_t >> +if_getvtag(struct mbuf *m) >> +{ >> + >> + return (m->m_pkthdr.ether_vtag); >> +} >> + >> +/* Statistics */ >> +int >> +if_incipackets(if_t ifp, int pkts) >> +{ >> + ((struct ifnet *)ifp)->if_ipackets += pkts; >> + return (0); >> +} >> + >> +int >> +if_incopackets(if_t ifp, int pkts) >> +{ >> + ((struct ifnet *)ifp)->if_opackets += pkts; >> + return (0); >> +} >> + >> +int >> +if_incierrors(if_t ifp, int ierrors) >> +{ >> + ((struct ifnet *)ifp)->if_ierrors += ierrors; >> + return (0); >> +} >> + >> + >> +int >> +if_setierrors(if_t ifp, int ierrors) >> +{ >> + ((struct ifnet *)ifp)->if_ierrors = ierrors; >> + return (0); >> +} >> + >> +int >> +if_setoerrors(if_t ifp, int oerrors) >> +{ >> + ((struct ifnet *)ifp)->if_oerrors = oerrors; >> + return (0); >> +} >> + >> +int if_incoerrors(if_t ifp, int oerrors) >> +{ >> + ((struct ifnet *)ifp)->if_oerrors += oerrors; >> + return (0); >> +} >> + >> +int if_inciqdrops(if_t ifp, int val) >> +{ >> + ((struct ifnet *)ifp)->if_iqdrops += val; >> + return (0); >> +} >> + >> +int >> +if_setcollisions(if_t ifp, int collisions) >> +{ >> + ((struct ifnet *)ifp)->if_collisions = collisions; >> + return (0); >> +} >> + >> +int >> +if_inccollisions(if_t ifp, int collisions) >> +{ >> + ((struct ifnet *)ifp)->if_collisions += collisions; >> + return (0); >> +} >> + >> +int >> +if_setipackets(if_t ifp, int pkts) >> +{ >> + ((struct ifnet *)ifp)->if_ipackets = pkts; >> + return (0); >> +} >> + >> +int >> +if_setopackets(if_t ifp, int pkts) >> +{ >> + ((struct ifnet *)ifp)->if_opackets = pkts; >> + return (0); >> +} >> + >> +int >> +if_incobytes(if_t ifp, int bytes) >> +{ >> + ((struct ifnet *)ifp)->if_obytes += bytes; >> + return (0); >> +} >> + >> +int >> +if_setibytes(if_t ifp, int bytes) >> +{ >> + ((struct ifnet *)ifp)->if_ibytes = bytes; >> + return (0); >> +} >> + >> +int >> +if_setobytes(if_t ifp, int bytes) >> +{ >> + ((struct ifnet *)ifp)->if_obytes = bytes; >> + return (0); >> +} >> + >> + >> +int >> +if_sendq_empty(if_t ifp) >> +{ >> + return IFQ_DRV_IS_EMPTY(&((struct ifnet *)ifp)->if_snd); >> +} >> + >> +int if_getiqdrops(if_t ifp) >> +{ >> + return ((struct ifnet *)ifp)->if_iqdrops; >> +} >> + >> +int >> +if_incimcasts(if_t ifp, int mcast) >> +{ >> + ((struct ifnet *)ifp)->if_imcasts += mcast; >> + return (0); >> +} >> + >> + >> +int >> +if_incomcasts(if_t ifp, int mcast) >> +{ >> + ((struct ifnet *)ifp)->if_omcasts += mcast; >> + return (0); >> +} >> + >> +int >> +if_setimcasts(if_t ifp, int mcast) >> +{ >> + ((struct ifnet *)ifp)->if_imcasts = mcast; >> + return (0); >> +} >> + >> + >> +struct ifaddr * >> +if_getifaddr(if_t ifp) >> +{ >> + return ((struct ifnet *)ifp)->if_addr; >> +} >> + >> +int >> +if_getamcount(if_t ifp) >> +{ >> + return ((struct ifnet *)ifp)->if_amcount; >> +} >> + >> + >> +int >> +if_setsendqready(if_t ifp) >> +{ >> + IFQ_SET_READY(&((struct ifnet *)ifp)->if_snd); >> + return (0); >> +} >> + >> +int >> +if_setsendqlen(if_t ifp, int tx_desc_count) >> +{ >> + IFQ_SET_MAXLEN(&((struct ifnet *)ifp)->if_snd, tx_desc_count); >> + ((struct ifnet *)ifp)->if_snd.ifq_drv_maxlen = tx_desc_count; >> + >> + return (0); >> +} >> + >> +int >> +if_vlantrunkinuse(if_t ifp) >> +{ >> + return ((struct ifnet *)ifp)->if_vlantrunk != NULL?1:0; >> +} >> + >> +int >> +if_input(if_t ifp, struct mbuf* sendmp) >> +{ >> + (*((struct ifnet *)ifp)->if_input)((struct ifnet *)ifp, sendmp); >> + return (0); >> + >> +} >> + >> +/* XXX */ >> +#ifndef ETH_ADDR_LEN >> +#define ETH_ADDR_LEN 6 >> +#endif >> + >> +int >> +if_setupmultiaddr(if_t ifp, void *mta, int *cnt, int max) >> +{ >> + struct ifmultiaddr *ifma; >> + uint8_t *lmta = (uint8_t *)mta; >> + int mcnt = 0; >> + >> + TAILQ_FOREACH(ifma, &((struct ifnet *)ifp)->if_multiaddrs, ifma_link) { >> + if (ifma->ifma_addr->sa_family != AF_LINK) >> + continue; >> + >> + if (mcnt == max) >> + break; >> + >> + bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), >> + &lmta[mcnt * ETH_ADDR_LEN], ETH_ADDR_LEN); >> + mcnt++; >> + } >> + *cnt = mcnt; >> + >> + return (0); >> +} >> + >> +int >> +if_multiaddr_array(if_t ifp, void *mta, int *cnt, int max) >> +{ >> + int error; >> + >> + if_maddr_rlock(ifp); >> + error = if_setupmultiaddr(ifp, mta, cnt, max); >> + if_maddr_runlock(ifp); >> + return (error); >> +} >> + >> +int >> +if_multiaddr_count(if_t ifp, int max) >> +{ >> + struct ifmultiaddr *ifma; >> + int count; >> + >> + count = 0; >> + if_maddr_rlock(ifp); >> + TAILQ_FOREACH(ifma, &((struct ifnet *)ifp)->if_multiaddrs, ifma_link) { >> + if (ifma->ifma_addr->sa_family != AF_LINK) >> + continue; >> + count++; >> + if (count == max) >> + break; >> + } >> + if_maddr_runlock(ifp); >> + return (count); >> +} >> + >> +struct mbuf * >> +if_dequeue(if_t ifp) >> +{ >> + struct mbuf *m; >> + IFQ_DRV_DEQUEUE(&((struct ifnet *)ifp)->if_snd, m); >> + >> + return (m); >> +} >> + >> +int >> +if_sendq_prepend(if_t ifp, struct mbuf *m) >> +{ >> + IFQ_DRV_PREPEND(&((struct ifnet *)ifp)->if_snd, m); >> + return (0); >> +} >> + >> +int >> +if_setifheaderlen(if_t ifp, int len) >> +{ >> + ((struct ifnet *)ifp)->if_data.ifi_hdrlen = len; >> + return (0); >> +} >> + >> +caddr_t >> +if_getlladdr(if_t ifp) >> +{ >> + return (IF_LLADDR((struct ifnet *)ifp)); >> +} >> + >> +void * >> +if_gethandle(u_char type) >> +{ >> + return (if_alloc(type)); >> +} >> + >> +void >> +if_bpfmtap(if_t ifh, struct mbuf *m) >> +{ >> + struct ifnet *ifp = (struct ifnet *)ifh; >> + >> + BPF_MTAP(ifp, m); >> +} >> + >> +void >> +if_etherbpfmtap(if_t ifh, struct mbuf *m) >> +{ >> + struct ifnet *ifp = (struct ifnet *)ifh; >> + >> + ETHER_BPF_MTAP(ifp, m); >> +} >> + >> +void >> +if_vlancap(if_t ifh) >> +{ >> + struct ifnet *ifp = (struct ifnet *)ifh; >> + VLAN_CAPABILITIES(ifp); >> +} >> + >> +void >> +if_setinitfn(if_t ifp, void (*init_fn)(void *)) >> +{ >> + ((struct ifnet *)ifp)->if_init = init_fn; >> +} >> + >> +void >> +if_setioctlfn(if_t ifp, int (*ioctl_fn)(void *, u_long, caddr_t)) >> +{ >> + ((struct ifnet *)ifp)->if_ioctl = (void *)ioctl_fn; >> +} >> + >> +void >> +if_setstartfn(if_t ifp, void (*start_fn)(void *)) >> +{ >> + ((struct ifnet *)ifp)->if_start = (void *)start_fn; >> +} >> + >> +void >> +if_settransmitfn(if_t ifp, if_transmit_fn_t start_fn) >> +{ >> + ((struct ifnet *)ifp)->if_transmit = start_fn; >> +} >> + >> +void if_setqflushfn(if_t ifp, if_qflush_fn_t flush_fn) >> +{ >> + ((struct ifnet *)ifp)->if_qflush = flush_fn; >> + >> +} >> + >> +/* These wrappers are hopefully temporary, till all drivers use drvapi */ >> +#ifdef INET >> +void >> +arp_ifinit_drv(if_t ifh, struct ifaddr *ifa) >> +{ >> + arp_ifinit((struct ifnet *)ifh, ifa); >> +} >> +#endif >> + >> +void >> +ether_ifattach_drv(if_t ifh, const u_int8_t *lla) >> +{ >> + ether_ifattach((struct ifnet *)ifh, lla); >> +} >> >> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >> From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 18:30:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20494577; Mon, 2 Jun 2014 18:30:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EA84257D; Mon, 2 Jun 2014 18:30:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s52IUv6g055631; Mon, 2 Jun 2014 18:30:57 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s52IUvaR055630; Mon, 2 Jun 2014 18:30:57 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406021830.s52IUvaR055630@svn.freebsd.org> From: Ed Maste Date: Mon, 2 Jun 2014 18:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266976 - head/usr.bin/calendar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 18:30:58 -0000 Author: emaste Date: Mon Jun 2 18:30:57 2014 New Revision: 266976 URL: http://svnweb.freebsd.org/changeset/base/266976 Log: Remove extraneous "mkdir -p" The directory hierarchy is created by an mtree file (BSD.usr.dist, in the case of calendar(1)). An explicit "mkdir -p" in a program's Makefile is redundant, and can mask a missing mtree entry. Modified: head/usr.bin/calendar/Makefile Modified: head/usr.bin/calendar/Makefile ============================================================================== --- head/usr.bin/calendar/Makefile Mon Jun 2 18:02:10 2014 (r266975) +++ head/usr.bin/calendar/Makefile Mon Jun 2 18:30:57 2014 (r266976) @@ -19,7 +19,6 @@ beforeinstall: ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${TEXTMODE} \ ${.CURDIR}/calendars/calendar.* ${DESTDIR}${SHAREDIR}/calendar .for lang in ${INTER} - mkdir -p ${DESTDIR}${SHAREDIR}/calendar/${lang} ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${TEXTMODE} \ ${.CURDIR}/calendars/${lang}/calendar.* \ ${DESTDIR}${SHAREDIR}/calendar/${lang} From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 18:37:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B921856; Mon, 2 Jun 2014 18:37:44 +0000 (UTC) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3766265F; Mon, 2 Jun 2014 18:37:43 +0000 (UTC) Received: from [172.29.2.230] ([66.129.239.13]) (authenticated bits=0) by mail.xcllnt.net (8.14.9/8.14.9) with ESMTP id s52IbeGn010645 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 2 Jun 2014 11:37:41 -0700 (PDT) (envelope-from marcel@xcllnt.net) Content-Type: multipart/signed; boundary="Apple-Mail=_3244B879-1B4C-4B3E-BD19-0CE34D8285B9"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net From: Marcel Moolenaar In-Reply-To: Date: Mon, 2 Jun 2014 11:37:34 -0700 Message-Id: References: <201406021754.s52Hsd1B039620@svn.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1878.2) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Marcel Moolenaar , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 18:37:44 -0000 --Apple-Mail=_3244B879-1B4C-4B3E-BD19-0CE34D8285B9 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On Jun 2, 2014, at 11:26 AM, Adrian Chadd wrote: > Woo! > > Would you mind doing up a 30 second "what convert X to Y" document so > I can do the driveby on the wireless stack and drivers? I'm having difficulty parsing the question, but I think you're asking for a howto with gotchas and caveats, etc, right? If yes, I can definitely do that. > I'll look at the script but since the wifi stack sits in between the > normal network stack layering, I just want to make sure I get all of > the right bits converted over all at the same time and have it have a > good chance of working. Feel free to reach out to me. I may be able to have someone from Juniper help you with the WLAN code. -- Marcel Moolenaar marcel@xcllnt.net --Apple-Mail=_3244B879-1B4C-4B3E-BD19-0CE34D8285B9 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iEYEARECAAYFAlOMxG4ACgkQpgWlLWHuifackACfdapHq2DhhvWQsHzQdWclHgtA 5qAAmwVxUQZM+KdeqZt6lbnBDcNT8PXS =6Y6U -----END PGP SIGNATURE----- --Apple-Mail=_3244B879-1B4C-4B3E-BD19-0CE34D8285B9-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 18:42:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0483DB04; Mon, 2 Jun 2014 18:42:00 +0000 (UTC) Received: from mail-qg0-x231.google.com (mail-qg0-x231.google.com [IPv6:2607:f8b0:400d:c04::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 873DD26FB; Mon, 2 Jun 2014 18:41:59 +0000 (UTC) Received: by mail-qg0-f49.google.com with SMTP id a108so11156680qge.22 for ; Mon, 02 Jun 2014 11:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Awe45itBCeu5awfhY2DxR+cylchr+knAoPnqCtOnyh0=; b=qUDH6CoDxj6UNjubkdtkRQG6yvmsBB6C/FJB9pTfGQdKo8T9dJlJ3L1UoF/BwS8CDH kHYdpkmr1sJWcVT2mAyvCEjzs0aUeb3dgWXL8wZgzWNo+W2zFI5CmvMgjaEzDCjAKWci 6+ZeX+sB/WX84PcBlb2PjAGiODlfMSs0wVW4nZQfIe+dd7/3MEURpyaWkL3Ly+HF5tlJ Dkcp2dHyrKSdMOkqvyuuMWgUgn5ueN2OCMB5ERMbpUcprarZrKnT5Hh0rXkQEX+cA1P3 VY5peMr6cKPVx50cXj9tEn/FvKvlRwZPdfl5+ahQXZGSOWCHzL5YDGrazmj9zdfhXQSE dKlA== MIME-Version: 1.0 X-Received: by 10.224.43.148 with SMTP id w20mr53062990qae.26.1401734518731; Mon, 02 Jun 2014 11:41:58 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.43.134 with HTTP; Mon, 2 Jun 2014 11:41:58 -0700 (PDT) In-Reply-To: References: <201406021754.s52Hsd1B039620@svn.freebsd.org> Date: Mon, 2 Jun 2014 11:41:58 -0700 X-Google-Sender-Auth: I7kaX9w3QDoBxu0z0GO4JfAEk3w Message-ID: Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net From: Adrian Chadd To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Marcel Moolenaar , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 18:42:00 -0000 On 2 June 2014 11:37, Marcel Moolenaar wrote: > > On Jun 2, 2014, at 11:26 AM, Adrian Chadd wrote: > >> Woo! >> >> Would you mind doing up a 30 second "what convert X to Y" document so >> I can do the driveby on the wireless stack and drivers? > > I'm having difficulty parsing the question, but I think you're asking > for a howto with gotchas and caveats, etc, right? > > If yes, I can definitely do that. yup! and thanks! that'd be great. >> I'll look at the script but since the wifi stack sits in between the >> normal network stack layering, I just want to make sure I get all of >> the right bits converted over all at the same time and have it have a >> good chance of working. > > Feel free to reach out to me. I may be able to > have someone from Juniper help you with the WLAN > code. Sweet! That'd be great. -a From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 18:42:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C39F5C41; Mon, 2 Jun 2014 18:42:18 +0000 (UTC) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7658B26FE; Mon, 2 Jun 2014 18:42:18 +0000 (UTC) Received: from [172.29.2.230] ([66.129.239.13]) (authenticated bits=0) by mail.xcllnt.net (8.14.9/8.14.9) with ESMTP id s52IgFGq010665 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 2 Jun 2014 11:42:16 -0700 (PDT) (envelope-from marcel@xcllnt.net) Content-Type: multipart/signed; boundary="Apple-Mail=_25E40353-5F73-4341-A22C-3B49585DABC3"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net From: Marcel Moolenaar In-Reply-To: Date: Mon, 2 Jun 2014 11:42:10 -0700 Message-Id: References: <201406021754.s52Hsd1B039620@svn.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1878.2) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Marcel Moolenaar , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 18:42:18 -0000 --Apple-Mail=_25E40353-5F73-4341-A22C-3B49585DABC3 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On Jun 2, 2014, at 11:27 AM, Adrian Chadd wrote: > .. and actually, bikeshedding for a moment, would we be able to move a > lot of these accessor methods over to inlines? Would that break the > Juniper way of doing things? That would definitely break Juniper as it doesn't give a stable ABI. I've suggested an approach that allows for both, but it was deemed unnecessary. The argument being that the function call overhead is negligible. We can always revisit that decision if needed... -- Marcel Moolenaar marcel@xcllnt.net --Apple-Mail=_25E40353-5F73-4341-A22C-3B49585DABC3 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iEYEARECAAYFAlOMxYIACgkQpgWlLWHuifYNZwCgh5CbW/ZPwAnW7zIjoonnku8i lN4AoIih2kbiZMZj6p02wpQfegIUOses =K8Dy -----END PGP SIGNATURE----- --Apple-Mail=_25E40353-5F73-4341-A22C-3B49585DABC3-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 18:45:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC0CFDCB; Mon, 2 Jun 2014 18:45:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E8DE2721; Mon, 2 Jun 2014 18:45:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s52IjaoL062482; Mon, 2 Jun 2014 18:45:36 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s52IjaR8062480; Mon, 2 Jun 2014 18:45:36 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201406021845.s52IjaR8062480@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 2 Jun 2014 18:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266977 - head/sys/dev/fxp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 18:45:36 -0000 Author: marcel Date: Mon Jun 2 18:45:36 2014 New Revision: 266977 URL: http://svnweb.freebsd.org/changeset/base/266977 Log: Convert fxp(4) to use the driver API. Submitted by: Anuranjan Shukla Obtained from: Juniper Networks, Inc. Modified: head/sys/dev/fxp/if_fxp.c head/sys/dev/fxp/if_fxpvar.h Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Mon Jun 2 18:30:57 2014 (r266976) +++ head/sys/dev/fxp/if_fxp.c Mon Jun 2 18:45:36 2014 (r266977) @@ -220,20 +220,20 @@ static int fxp_resume(device_t dev); static const struct fxp_ident *fxp_find_ident(device_t dev); static void fxp_intr(void *xsc); -static void fxp_rxcsum(struct fxp_softc *sc, struct ifnet *ifp, +static void fxp_rxcsum(struct fxp_softc *sc, if_t ifp, struct mbuf *m, uint16_t status, int pos); -static int fxp_intr_body(struct fxp_softc *sc, struct ifnet *ifp, +static int fxp_intr_body(struct fxp_softc *sc, if_t ifp, uint8_t statack, int count); static void fxp_init(void *xsc); static void fxp_init_body(struct fxp_softc *sc, int); static void fxp_tick(void *xsc); -static void fxp_start(struct ifnet *ifp); -static void fxp_start_body(struct ifnet *ifp); +static void fxp_start(if_t ifp); +static void fxp_start_body(if_t ifp); static int fxp_encap(struct fxp_softc *sc, struct mbuf **m_head); static void fxp_txeof(struct fxp_softc *sc); static void fxp_stop(struct fxp_softc *sc); static void fxp_release(struct fxp_softc *sc); -static int fxp_ioctl(struct ifnet *ifp, u_long command, +static int fxp_ioctl(if_t ifp, u_long command, caddr_t data); static void fxp_watchdog(struct fxp_softc *sc); static void fxp_add_rfabuf(struct fxp_softc *sc, @@ -254,11 +254,11 @@ static void fxp_read_eeprom(struct fxp_ int offset, int words); static void fxp_write_eeprom(struct fxp_softc *sc, u_short *data, int offset, int words); -static int fxp_ifmedia_upd(struct ifnet *ifp); -static void fxp_ifmedia_sts(struct ifnet *ifp, +static int fxp_ifmedia_upd(if_t ifp); +static void fxp_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr); -static int fxp_serial_ifmedia_upd(struct ifnet *ifp); -static void fxp_serial_ifmedia_sts(struct ifnet *ifp, +static int fxp_serial_ifmedia_upd(if_t ifp); +static void fxp_serial_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr); static int fxp_miibus_readreg(device_t dev, int phy, int reg); static int fxp_miibus_writereg(device_t dev, int phy, int reg, @@ -427,7 +427,7 @@ fxp_attach(device_t dev) struct fxp_cb_tx *tcbp; struct fxp_tx *txp; struct fxp_rx *rxp; - struct ifnet *ifp; + if_t ifp; uint32_t val; uint16_t data; u_char eaddr[ETHER_ADDR_LEN]; @@ -439,11 +439,11 @@ fxp_attach(device_t dev) mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); callout_init_mtx(&sc->stat_ch, &sc->sc_mtx, 0); - ifmedia_init(&sc->sc_media, 0, fxp_serial_ifmedia_upd, + ifmedia_init_drv(&sc->sc_media, 0, fxp_serial_ifmedia_upd, fxp_serial_ifmedia_sts); - ifp = sc->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { + ifp = sc->ifp = if_gethandle(IFT_ETHER); + if (ifp == (void *)NULL) { device_printf(dev, "can not if_alloc()\n"); error = ENOSPC; goto fail; @@ -827,73 +827,75 @@ fxp_attach(device_t dev) flags = MIIF_NOISOLATE; if (sc->revision >= FXP_REV_82558_A4) flags |= MIIF_DOPAUSE; - error = mii_attach(dev, &sc->miibus, ifp, fxp_ifmedia_upd, - fxp_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, - MII_OFFSET_ANY, flags); + error = mii_attach(dev, &sc->miibus, ifp, + (ifm_change_cb_t)fxp_ifmedia_upd, + (ifm_stat_cb_t)fxp_ifmedia_sts, BMSR_DEFCAPMASK, + MII_PHY_ANY, MII_OFFSET_ANY, flags); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; } } - if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_init = fxp_init; - ifp->if_softc = sc; - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_ioctl = fxp_ioctl; - ifp->if_start = fxp_start; + if_initname_drv(ifp, device_get_name(dev), device_get_unit(dev)); + if_setdev(ifp, dev); + if_setinitfn(ifp, fxp_init); + if_setsoftc(ifp, sc); + if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); + if_setioctlfn(ifp, fxp_ioctl); + if_setstartfn(ifp, fxp_start); - ifp->if_capabilities = ifp->if_capenable = 0; + if_setcapabilities(ifp, 0); + if_setcapenable(ifp, 0); /* Enable checksum offload/TSO for 82550 or better chips */ if (sc->flags & FXP_FLAG_EXT_RFA) { - ifp->if_hwassist = FXP_CSUM_FEATURES | CSUM_TSO; - ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO4; - ifp->if_capenable |= IFCAP_HWCSUM | IFCAP_TSO4; + if_sethwassist(ifp, FXP_CSUM_FEATURES | CSUM_TSO); + if_setcapabilitiesbit(ifp, IFCAP_HWCSUM | IFCAP_TSO4, 0); + if_setcapenablebit(ifp, IFCAP_HWCSUM | IFCAP_TSO4, 0); } if (sc->flags & FXP_FLAG_82559_RXCSUM) { - ifp->if_capabilities |= IFCAP_RXCSUM; - ifp->if_capenable |= IFCAP_RXCSUM; + if_setcapabilitiesbit(ifp, IFCAP_RXCSUM, 0); + if_setcapenablebit(ifp, IFCAP_RXCSUM, 0); } if (sc->flags & FXP_FLAG_WOLCAP) { - ifp->if_capabilities |= IFCAP_WOL_MAGIC; - ifp->if_capenable |= IFCAP_WOL_MAGIC; + if_setcapabilitiesbit(ifp, IFCAP_WOL_MAGIC, 0); + if_setcapenablebit(ifp, IFCAP_WOL_MAGIC, 0); } #ifdef DEVICE_POLLING /* Inform the world we support polling. */ - ifp->if_capabilities |= IFCAP_POLLING; + if_setcapabilitiesbit(ifp, IFCAP_POLLING, 0); #endif /* * Attach the interface. */ - ether_ifattach(ifp, eaddr); + ether_ifattach_drv(ifp, eaddr); /* * Tell the upper layer(s) we support long frames. * Must appear after the call to ether_ifattach() because * ether_ifattach() sets ifi_hdrlen to the default value. */ - ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); - ifp->if_capabilities |= IFCAP_VLAN_MTU; - ifp->if_capenable |= IFCAP_VLAN_MTU; /* the hw bits already set */ + if_setifheaderlen(ifp, sizeof(struct ether_vlan_header)); + if_setcapabilitiesbit(ifp, IFCAP_VLAN_MTU, 0); + if_setcapenablebit(ifp, IFCAP_VLAN_MTU, 0); if ((sc->flags & FXP_FLAG_EXT_RFA) != 0) { - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | - IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO; - ifp->if_capenable |= IFCAP_VLAN_HWTAGGING | - IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO; + if_setcapabilitiesbit(ifp, IFCAP_VLAN_HWTAGGING | + IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO, 0); + if_setcapenablebit(ifp, IFCAP_VLAN_HWTAGGING | + IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO, 0); } /* * Let the system queue as many packets as we have available * TX descriptors. */ - IFQ_SET_MAXLEN(&ifp->if_snd, FXP_NTXCB - 1); - ifp->if_snd.ifq_drv_maxlen = FXP_NTXCB - 1; - IFQ_SET_READY(&ifp->if_snd); + if_setsendqlen(ifp, FXP_NTXCB - 1); + if_setsendqready(ifp); /* * Hook our interrupt after all initialization is complete. @@ -902,7 +904,7 @@ fxp_attach(device_t dev) NULL, fxp_intr, sc, &sc->ih); if (error) { device_printf(dev, "could not setup irq\n"); - ether_ifdetach(sc->ifp); + ether_ifdetach_drv(sc->ifp); goto fail; } @@ -991,7 +993,7 @@ fxp_release(struct fxp_softc *sc) if (sc->mcs_tag) bus_dma_tag_destroy(sc->mcs_tag); if (sc->ifp) - if_free(sc->ifp); + if_free_drv(sc->ifp); mtx_destroy(&sc->sc_mtx); } @@ -1005,8 +1007,8 @@ fxp_detach(device_t dev) struct fxp_softc *sc = device_get_softc(dev); #ifdef DEVICE_POLLING - if (sc->ifp->if_capenable & IFCAP_POLLING) - ether_poll_deregister(sc->ifp); + if (if_getcapenable(sc->ifp) & IFCAP_POLLING) + ether_poll_deregister_drv(sc->ifp); #endif FXP_LOCK(sc); @@ -1021,7 +1023,7 @@ fxp_detach(device_t dev) /* * Close down routes etc. */ - ether_ifdetach(sc->ifp); + ether_ifdetach_drv(sc->ifp); /* * Unhook interrupt before dropping lock. This is to prevent @@ -1061,7 +1063,7 @@ static int fxp_suspend(device_t dev) { struct fxp_softc *sc = device_get_softc(dev); - struct ifnet *ifp; + if_t ifp; int pmc; uint16_t pmstat; @@ -1071,12 +1073,12 @@ fxp_suspend(device_t dev) if (pci_find_cap(sc->dev, PCIY_PMG, &pmc) == 0) { pmstat = pci_read_config(sc->dev, pmc + PCIR_POWER_STATUS, 2); pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); - if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) { + if ((if_getcapenable(ifp) & IFCAP_WOL_MAGIC) != 0) { /* Request PME. */ pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; sc->flags |= FXP_FLAG_WOL; /* Reconfigure hardware to accept magic frames. */ - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); fxp_init_body(sc, 0); } pci_write_config(sc->dev, pmc + PCIR_POWER_STATUS, pmstat, 2); @@ -1097,7 +1099,7 @@ static int fxp_resume(device_t dev) { struct fxp_softc *sc = device_get_softc(dev); - struct ifnet *ifp = sc->ifp; + if_t ifp = sc->ifp; int pmc; uint16_t pmstat; @@ -1118,7 +1120,7 @@ fxp_resume(device_t dev) DELAY(10); /* reinitialize interface if necessary */ - if (ifp->if_flags & IFF_UP) + if (if_getflags(ifp) & IFF_UP) fxp_init_body(sc, 1); sc->suspended = 0; @@ -1323,9 +1325,9 @@ fxp_load_eeprom(struct fxp_softc *sc) * Grab the softc lock and call the real fxp_start_body() routine */ static void -fxp_start(struct ifnet *ifp) +fxp_start(if_t ifp) { - struct fxp_softc *sc = ifp->if_softc; + struct fxp_softc *sc = if_getsoftc(ifp); FXP_LOCK(sc); fxp_start_body(ifp); @@ -1338,15 +1340,15 @@ fxp_start(struct ifnet *ifp) * internal entry point only. */ static void -fxp_start_body(struct ifnet *ifp) +fxp_start_body(if_t ifp) { - struct fxp_softc *sc = ifp->if_softc; + struct fxp_softc *sc = if_getsoftc(ifp); struct mbuf *mb_head; int txqueued; FXP_LOCK_ASSERT(sc, MA_OWNED); - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + if ((if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) return; @@ -1359,27 +1361,26 @@ fxp_start_body(struct ifnet *ifp) * a NOP command when needed. */ txqueued = 0; - while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd) && - sc->tx_queued < FXP_NTXCB - 1) { + while (!if_sendq_empty(ifp) && sc->tx_queued < FXP_NTXCB - 1) { /* * Grab a packet to transmit. */ - IFQ_DRV_DEQUEUE(&ifp->if_snd, mb_head); + mb_head = if_dequeue(ifp); if (mb_head == NULL) break; if (fxp_encap(sc, &mb_head)) { if (mb_head == NULL) break; - IFQ_DRV_PREPEND(&ifp->if_snd, mb_head); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + if_sendq_prepend(ifp, mb_head); + if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); } txqueued++; /* * Pass packet to bpf if there is a listener. */ - BPF_MTAP(ifp, mb_head); + if_bpfmtap(ifp, mb_head); } /* @@ -1402,7 +1403,7 @@ fxp_start_body(struct ifnet *ifp) static int fxp_encap(struct fxp_softc *sc, struct mbuf **m_head) { - struct ifnet *ifp; + if_t ifp; struct mbuf *m; struct fxp_tx *txp; struct fxp_cb_tx *cbp; @@ -1669,17 +1670,17 @@ fxp_encap(struct fxp_softc *sc, struct m } #ifdef DEVICE_POLLING -static poll_handler_t fxp_poll; +static poll_handler_drv_t fxp_poll; static int -fxp_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) +fxp_poll(if_t ifp, enum poll_cmd cmd, int count) { - struct fxp_softc *sc = ifp->if_softc; + struct fxp_softc *sc = if_getsoftc(ifp); uint8_t statack; int rx_npkts = 0; FXP_LOCK(sc); - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING)) { FXP_UNLOCK(sc); return (rx_npkts); } @@ -1713,7 +1714,7 @@ static void fxp_intr(void *xsc) { struct fxp_softc *sc = xsc; - struct ifnet *ifp = sc->ifp; + if_t ifp = sc->ifp; uint8_t statack; FXP_LOCK(sc); @@ -1723,7 +1724,7 @@ fxp_intr(void *xsc) } #ifdef DEVICE_POLLING - if (ifp->if_capenable & IFCAP_POLLING) { + if (if_getcapenable(ifp) & IFCAP_POLLING) { FXP_UNLOCK(sc); return; } @@ -1744,7 +1745,7 @@ fxp_intr(void *xsc) * First ACK all the interrupts in this pass. */ CSR_WRITE_1(sc, FXP_CSR_SCB_STATACK, statack); - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) fxp_intr_body(sc, ifp, statack, -1); } FXP_UNLOCK(sc); @@ -1753,7 +1754,7 @@ fxp_intr(void *xsc) static void fxp_txeof(struct fxp_softc *sc) { - struct ifnet *ifp; + if_t ifp; struct fxp_tx *txp; ifp = sc->ifp; @@ -1772,7 +1773,7 @@ fxp_txeof(struct fxp_softc *sc) txp->tx_cb->tbd[0].tb_addr = 0; } sc->tx_queued--; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE); } sc->fxp_desc.tx_first = txp; bus_dmamap_sync(sc->cbl_tag, sc->cbl_map, @@ -1782,7 +1783,7 @@ fxp_txeof(struct fxp_softc *sc) } static void -fxp_rxcsum(struct fxp_softc *sc, struct ifnet *ifp, struct mbuf *m, +fxp_rxcsum(struct fxp_softc *sc, if_t ifp, struct mbuf *m, uint16_t status, int pos) { struct ether_header *eh; @@ -1860,7 +1861,7 @@ fxp_rxcsum(struct fxp_softc *sc, struct } static int -fxp_intr_body(struct fxp_softc *sc, struct ifnet *ifp, uint8_t statack, +fxp_intr_body(struct fxp_softc *sc, if_t ifp, uint8_t statack, int count) { struct mbuf *m; @@ -1902,7 +1903,7 @@ fxp_intr_body(struct fxp_softc *sc, stru /* * Try to start more packets transmitting. */ - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + if (!if_sendq_empty(ifp)) fxp_start_body(ifp); /* @@ -1969,7 +1970,7 @@ fxp_intr_body(struct fxp_softc *sc, stru */ total_len = le16toh(rfa->actual_size) & 0x3fff; if ((sc->flags & FXP_FLAG_82559_RXCSUM) != 0 && - (ifp->if_capenable & IFCAP_RXCSUM) != 0) { + (if_getcapenable(ifp) & IFCAP_RXCSUM) != 0) { /* Adjust for appended checksum bytes. */ total_len -= 2; } @@ -1984,12 +1985,12 @@ fxp_intr_body(struct fxp_softc *sc, stru } m->m_pkthdr.len = m->m_len = total_len; - m->m_pkthdr.rcvif = ifp; + if_setrcvif(m, ifp); /* Do IP checksum checking. */ - if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) + if ((if_getcapenable(ifp) & IFCAP_RXCSUM) != 0) fxp_rxcsum(sc, ifp, m, status, total_len); - if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0 && + if ((if_getcapenable(ifp) & IFCAP_VLAN_HWTAGGING) != 0 && (status & FXP_RFA_STATUS_VLAN) != 0) { m->m_pkthdr.ether_vtag = ntohs(rfa->rfax_vlan_id); @@ -2004,14 +2005,14 @@ fxp_intr_body(struct fxp_softc *sc, stru * calling if_input() on each one. */ FXP_UNLOCK(sc); - (*ifp->if_input)(ifp, m); + if_input(ifp, m); FXP_LOCK(sc); rx_npkts++; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) return (rx_npkts); } else { /* Reuse RFA and loaded DMA map. */ - ifp->if_iqdrops++; + if_inciqdrops(ifp, 1); fxp_discard_rfabuf(sc, rxp); } fxp_add_rfabuf(sc, rxp); @@ -2028,7 +2029,7 @@ fxp_intr_body(struct fxp_softc *sc, stru static void fxp_update_stats(struct fxp_softc *sc) { - struct ifnet *ifp = sc->ifp; + if_t ifp = sc->ifp; struct fxp_stats *sp = sc->fxp_stats; struct fxp_hwstats *hsp; uint32_t *status; @@ -2069,10 +2070,10 @@ fxp_update_stats(struct fxp_softc *sc) hsp->tx_tco += le16toh(sp->tx_tco); hsp->rx_tco += le16toh(sp->rx_tco); - ifp->if_opackets += le32toh(sp->tx_good); - ifp->if_collisions += le32toh(sp->tx_total_collisions); + if_incopackets(ifp, le32toh(sp->tx_good)); + if_inccollisions(ifp, le32toh(sp->tx_total_collisions)); if (sp->rx_good) { - ifp->if_ipackets += le32toh(sp->rx_good); + if_incipackets(ifp, le32toh(sp->rx_good)); sc->rx_idle_secs = 0; } else if (sc->flags & FXP_FLAG_RXBUG) { /* @@ -2080,17 +2081,17 @@ fxp_update_stats(struct fxp_softc *sc) */ sc->rx_idle_secs++; } - ifp->if_ierrors += + if_incierrors(ifp, le32toh(sp->rx_crc_errors) + le32toh(sp->rx_alignment_errors) + le32toh(sp->rx_rnr_errors) + - le32toh(sp->rx_overrun_errors); + le32toh(sp->rx_overrun_errors)); /* * If any transmit underruns occured, bump up the transmit * threshold by another 512 bytes (64 * 8). */ if (sp->tx_underruns) { - ifp->if_oerrors += le32toh(sp->tx_underruns); + if_incoerrors(ifp, le32toh(sp->tx_underruns)); if (tx_threshold < 192) tx_threshold += 64; } @@ -2115,7 +2116,7 @@ static void fxp_tick(void *xsc) { struct fxp_softc *sc = xsc; - struct ifnet *ifp = sc->ifp; + if_t ifp = sc->ifp; FXP_LOCK_ASSERT(sc, MA_OWNED); @@ -2143,8 +2144,8 @@ fxp_tick(void *xsc) */ if (sc->rx_idle_secs > FXP_MAX_RX_IDLE) { sc->rx_idle_secs = 0; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) { + if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); fxp_init_body(sc, 1); } return; @@ -2180,11 +2181,11 @@ fxp_tick(void *xsc) static void fxp_stop(struct fxp_softc *sc) { - struct ifnet *ifp = sc->ifp; + if_t ifp = sc->ifp; struct fxp_tx *txp; int i; - ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + if_setdrvflagbits(ifp, 0, (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)); sc->watchdog_timer = 0; /* @@ -2235,6 +2236,7 @@ fxp_stop(struct fxp_softc *sc) static void fxp_watchdog(struct fxp_softc *sc) { + if_t ifp = sc->ifp; FXP_LOCK_ASSERT(sc, MA_OWNED); @@ -2242,9 +2244,9 @@ fxp_watchdog(struct fxp_softc *sc) return; device_printf(sc->dev, "device timeout\n"); - sc->ifp->if_oerrors++; + if_incoerrors(ifp, 1); - sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); fxp_init_body(sc, 1); } @@ -2270,7 +2272,7 @@ fxp_init(void *xsc) static void fxp_init_body(struct fxp_softc *sc, int setmedia) { - struct ifnet *ifp = sc->ifp; + if_t ifp = sc->ifp; struct mii_data *mii; struct fxp_cb_config *cbp; struct fxp_cb_ias *cb_ias; @@ -2280,7 +2282,7 @@ fxp_init_body(struct fxp_softc *sc, int FXP_LOCK_ASSERT(sc, MA_OWNED); - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) return; /* @@ -2295,7 +2297,7 @@ fxp_init_body(struct fxp_softc *sc, int CSR_WRITE_4(sc, FXP_CSR_PORT, FXP_PORT_SOFTWARE_RESET); DELAY(50); - prm = (ifp->if_flags & IFF_PROMISC) ? 1 : 0; + prm = (if_getflags(ifp) & IFF_PROMISC) ? 1 : 0; /* * Initialize base of CBL and RFA memory. Loading with zero @@ -2322,7 +2324,7 @@ fxp_init_body(struct fxp_softc *sc, int * For ICH based controllers do not load microcode. */ if (sc->ident->ich == 0) { - if (ifp->if_flags & IFF_LINK0 && + if (if_getflags(ifp) & IFF_LINK0 && (sc->flags & FXP_FLAG_UCODE) == 0) fxp_load_ucode(sc); } @@ -2378,7 +2380,7 @@ fxp_init_body(struct fxp_softc *sc, int cbp->mediatype = sc->flags & FXP_FLAG_SERIAL_MEDIA ? 0 : 1; cbp->csma_dis = 0; /* (don't) disable link */ cbp->tcp_udp_cksum = ((sc->flags & FXP_FLAG_82559_RXCSUM) != 0 && - (ifp->if_capenable & IFCAP_RXCSUM) != 0) ? 1 : 0; + (if_getcapenable(ifp) & IFCAP_RXCSUM) != 0) ? 1 : 0; cbp->vlan_tco = 0; /* (don't) enable vlan wakeup */ cbp->link_wake_en = 0; /* (don't) assert PME# on link change */ cbp->arp_wake_en = 0; /* (don't) assert PME# on arp */ @@ -2405,10 +2407,10 @@ fxp_init_body(struct fxp_softc *sc, int cbp->force_fdx = 0; /* (don't) force full duplex */ cbp->fdx_pin_en = 1; /* (enable) FDX# pin */ cbp->multi_ia = 0; /* (don't) accept multiple IAs */ - cbp->mc_all = ifp->if_flags & IFF_ALLMULTI ? 1 : prm; + cbp->mc_all = if_getflags(ifp) & IFF_ALLMULTI ? 1 : prm; cbp->gamla_rx = sc->flags & FXP_FLAG_EXT_RFA ? 1 : 0; cbp->vlan_strip_en = ((sc->flags & FXP_FLAG_EXT_RFA) != 0 && - (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) ? 1 : 0; + (if_getcapenable(ifp) & IFCAP_VLAN_HWTAGGING) != 0) ? 1 : 0; if (sc->revision == FXP_REV_82557) { /* @@ -2487,7 +2489,7 @@ fxp_init_body(struct fxp_softc *sc, int cb_ias->cb_status = 0; cb_ias->cb_command = htole16(FXP_CB_COMMAND_IAS | FXP_CB_COMMAND_EL); cb_ias->link_addr = 0xffffffff; - bcopy(IF_LLADDR(sc->ifp), cb_ias->macaddr, ETHER_ADDR_LEN); + bcopy(if_getlladdr(sc->ifp), cb_ias->macaddr, ETHER_ADDR_LEN); /* * Start the IAS (Individual Address Setup) command/DMA. @@ -2549,8 +2551,7 @@ fxp_init_body(struct fxp_softc *sc, int if (sc->miibus != NULL && setmedia != 0) mii_mediachg(device_get_softc(sc->miibus)); - ifp->if_drv_flags |= IFF_DRV_RUNNING; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + if_setdrvflagbits(ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE); /* * Enable interrupts. @@ -2560,7 +2561,7 @@ fxp_init_body(struct fxp_softc *sc, int * ... but only do that if we are not polling. And because (presumably) * the default is interrupts on, we need to disable them explicitly! */ - if (ifp->if_capenable & IFCAP_POLLING ) + if (if_getcapenable(ifp) & IFCAP_POLLING ) CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, FXP_SCB_INTR_DISABLE); else #endif /* DEVICE_POLLING */ @@ -2573,14 +2574,14 @@ fxp_init_body(struct fxp_softc *sc, int } static int -fxp_serial_ifmedia_upd(struct ifnet *ifp) +fxp_serial_ifmedia_upd(if_t ifp) { return (0); } static void -fxp_serial_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) +fxp_serial_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr) { ifmr->ifm_active = IFM_ETHER|IFM_MANUAL; @@ -2590,9 +2591,9 @@ fxp_serial_ifmedia_sts(struct ifnet *ifp * Change media according to request. */ static int -fxp_ifmedia_upd(struct ifnet *ifp) +fxp_ifmedia_upd(if_t ifp) { - struct fxp_softc *sc = ifp->if_softc; + struct fxp_softc *sc = if_getsoftc(ifp); struct mii_data *mii; struct mii_softc *miisc; @@ -2609,9 +2610,9 @@ fxp_ifmedia_upd(struct ifnet *ifp) * Notify the world which media we're using. */ static void -fxp_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) +fxp_ifmedia_sts(if_t ifp, struct ifmediareq *ifmr) { - struct fxp_softc *sc = ifp->if_softc; + struct fxp_softc *sc = if_getsoftc(ifp); struct mii_data *mii; mii = device_get_softc(sc->miibus); @@ -2800,13 +2801,13 @@ fxp_miibus_statchg(device_t dev) { struct fxp_softc *sc; struct mii_data *mii; - struct ifnet *ifp; + if_t ifp; sc = device_get_softc(dev); mii = device_get_softc(sc->miibus); ifp = sc->ifp; - if (mii == NULL || ifp == NULL || - (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + if (mii == NULL || ifp == (void *)NULL || + (if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0 || (mii->mii_media_status & (IFM_AVALID | IFM_ACTIVE)) != (IFM_AVALID | IFM_ACTIVE)) return; @@ -2822,14 +2823,14 @@ fxp_miibus_statchg(device_t dev) */ if (sc->revision == FXP_REV_82557) return; - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); fxp_init_body(sc, 0); } static int -fxp_ioctl(struct ifnet *ifp, u_long command, caddr_t data) +fxp_ioctl(if_t ifp, u_long command, caddr_t data) { - struct fxp_softc *sc = ifp->if_softc; + struct fxp_softc *sc = if_getsoftc(ifp); struct ifreq *ifr = (struct ifreq *)data; struct mii_data *mii; int flag, mask, error = 0, reinit; @@ -2843,27 +2844,27 @@ fxp_ioctl(struct ifnet *ifp, u_long comm * XXX If it's up then re-initialize it. This is so flags * such as IFF_PROMISC are handled. */ - if (ifp->if_flags & IFF_UP) { - if (((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) && - ((ifp->if_flags ^ sc->if_flags) & + if (if_getflags(ifp) & IFF_UP) { + if (((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) && + ((if_getflags(ifp) ^ sc->if_flags) & (IFF_PROMISC | IFF_ALLMULTI | IFF_LINK0)) != 0) { - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); fxp_init_body(sc, 0); - } else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + } else if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) fxp_init_body(sc, 1); } else { - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) fxp_stop(sc); } - sc->if_flags = ifp->if_flags; + sc->if_flags = if_getflags(ifp); FXP_UNLOCK(sc); break; case SIOCADDMULTI: case SIOCDELMULTI: FXP_LOCK(sc); - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) { + if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); fxp_init_body(sc, 0); } FXP_UNLOCK(sc); @@ -2873,98 +2874,99 @@ fxp_ioctl(struct ifnet *ifp, u_long comm case SIOCGIFMEDIA: if (sc->miibus != NULL) { mii = device_get_softc(sc->miibus); - error = ifmedia_ioctl(ifp, ifr, + error = ifmedia_ioctl_drv(ifp, ifr, &mii->mii_media, command); } else { - error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, command); + error = ifmedia_ioctl_drv(ifp, ifr, &sc->sc_media, command); } break; case SIOCSIFCAP: reinit = 0; - mask = ifp->if_capenable ^ ifr->ifr_reqcap; + mask = if_getcapenable(ifp) ^ ifr->ifr_reqcap; #ifdef DEVICE_POLLING if (mask & IFCAP_POLLING) { if (ifr->ifr_reqcap & IFCAP_POLLING) { - error = ether_poll_register(fxp_poll, ifp); + error = ether_poll_register_drv(fxp_poll, ifp); if (error) return(error); FXP_LOCK(sc); CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, FXP_SCB_INTR_DISABLE); - ifp->if_capenable |= IFCAP_POLLING; + if_setcapenablebit(ifp, IFCAP_POLLING, 0); FXP_UNLOCK(sc); } else { - error = ether_poll_deregister(ifp); + error = ether_poll_deregister_drv(ifp); /* Enable interrupts in any case */ FXP_LOCK(sc); CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, 0); - ifp->if_capenable &= ~IFCAP_POLLING; + if_setcapenablebit(ifp, 0, IFCAP_POLLING); FXP_UNLOCK(sc); } } #endif FXP_LOCK(sc); if ((mask & IFCAP_TXCSUM) != 0 && - (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { - ifp->if_capenable ^= IFCAP_TXCSUM; - if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) - ifp->if_hwassist |= FXP_CSUM_FEATURES; + (if_getcapabilities(ifp) & IFCAP_TXCSUM) != 0) { + if_togglecapenable(ifp, IFCAP_TXCSUM); + if ((if_getcapenable(ifp) & IFCAP_TXCSUM) != 0) + if_sethwassistbits(ifp, FXP_CSUM_FEATURES, 0); else - ifp->if_hwassist &= ~FXP_CSUM_FEATURES; + if_sethwassistbits(ifp, 0, FXP_CSUM_FEATURES); } if ((mask & IFCAP_RXCSUM) != 0 && - (ifp->if_capabilities & IFCAP_RXCSUM) != 0) { - ifp->if_capenable ^= IFCAP_RXCSUM; + (if_getcapabilities(ifp) & IFCAP_RXCSUM) != 0) { + if_togglecapenable(ifp, IFCAP_RXCSUM); if ((sc->flags & FXP_FLAG_82559_RXCSUM) != 0) reinit++; } if ((mask & IFCAP_TSO4) != 0 && - (ifp->if_capabilities & IFCAP_TSO4) != 0) { - ifp->if_capenable ^= IFCAP_TSO4; - if ((ifp->if_capenable & IFCAP_TSO4) != 0) - ifp->if_hwassist |= CSUM_TSO; + (if_getcapabilities(ifp) & IFCAP_TSO4) != 0) { + if_togglecapenable(ifp, IFCAP_TSO4); + if ((if_getcapenable(ifp) & IFCAP_TSO4) != 0) + if_sethwassistbits(ifp, CSUM_TSO, 0); else - ifp->if_hwassist &= ~CSUM_TSO; + if_sethwassistbits(ifp, 0, CSUM_TSO); } if ((mask & IFCAP_WOL_MAGIC) != 0 && - (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0) - ifp->if_capenable ^= IFCAP_WOL_MAGIC; + (if_getcapabilities(ifp) & IFCAP_WOL_MAGIC) != 0) + if_togglecapenable(ifp, IFCAP_WOL_MAGIC); if ((mask & IFCAP_VLAN_MTU) != 0 && - (ifp->if_capabilities & IFCAP_VLAN_MTU) != 0) { - ifp->if_capenable ^= IFCAP_VLAN_MTU; + (if_getcapabilities(ifp) & IFCAP_VLAN_MTU) != 0) { + if_togglecapenable(ifp, IFCAP_VLAN_MTU); if (sc->revision != FXP_REV_82557) flag = FXP_FLAG_LONG_PKT_EN; else /* a hack to get long frames on the old chip */ flag = FXP_FLAG_SAVE_BAD; sc->flags ^= flag; - if (ifp->if_flags & IFF_UP) + if (if_getflags(ifp) & IFF_UP) reinit++; } if ((mask & IFCAP_VLAN_HWCSUM) != 0 && - (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0) - ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; + (if_getcapabilities(ifp) & IFCAP_VLAN_HWCSUM) != 0) + if_togglecapenable(ifp, IFCAP_VLAN_HWCSUM); if ((mask & IFCAP_VLAN_HWTSO) != 0 && - (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0) - ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + (if_getcapabilities(ifp) & IFCAP_VLAN_HWTSO) != 0) + if_togglecapenable(ifp, IFCAP_VLAN_HWTSO); if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && - (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) { - ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; - if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) - ifp->if_capenable &= - ~(IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM); + (if_getcapabilities(ifp) & IFCAP_VLAN_HWTAGGING) != 0) { + if_togglecapenable(ifp, IFCAP_VLAN_HWTAGGING); + if ((if_getcapenable(ifp) & IFCAP_VLAN_HWTAGGING) == 0) + if_setcapenablebit(ifp, 0, IFCAP_VLAN_HWTSO | + IFCAP_VLAN_HWCSUM); reinit++; } - if (reinit > 0 && (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + if (reinit > 0 && + (if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) { + if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); fxp_init_body(sc, 0); } FXP_UNLOCK(sc); - VLAN_CAPABILITIES(ifp); + if_vlancap(ifp); break; default: - error = ether_ioctl(ifp, command, data); + error = ether_ioctl_drv(ifp, command, data); } return (error); } @@ -2976,24 +2978,15 @@ static int fxp_mc_addrs(struct fxp_softc *sc) { struct fxp_cb_mcs *mcsp = sc->mcsp; - struct ifnet *ifp = sc->ifp; - struct ifmultiaddr *ifma; - int nmcasts; + if_t ifp = sc->ifp; + int nmcasts = 0; - nmcasts = 0; - if ((ifp->if_flags & IFF_ALLMULTI) == 0) { + if ((if_getflags(ifp) & IFF_ALLMULTI) == 0) { if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - if (nmcasts >= MAXMCADDR) { - ifp->if_flags |= IFF_ALLMULTI; - nmcasts = 0; - break; - } - bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), - &sc->mcsp->mc_addr[nmcasts][0], ETHER_ADDR_LEN); - nmcasts++; + if_setupmultiaddr(ifp, mcsp->mc_addr, &nmcasts, MAXMCADDR); + if (nmcasts >= MAXMCADDR) { + if_setflagbits(ifp, IFF_ALLMULTI, 0); + nmcasts = 0; } if_maddr_runlock(ifp); } Modified: head/sys/dev/fxp/if_fxpvar.h ============================================================================== --- head/sys/dev/fxp/if_fxpvar.h Mon Jun 2 18:30:57 2014 (r266976) +++ head/sys/dev/fxp/if_fxpvar.h Mon Jun 2 18:45:36 2014 (r266977) @@ -178,7 +178,7 @@ struct fxp_hwstats { * for functional grouping. */ struct fxp_softc { - struct ifnet *ifp; /* per-interface network data */ + void *ifp; /* per-interface network data */ struct resource *fxp_res[2]; /* I/O and IRQ resources */ struct resource_spec *fxp_spec; /* the resource spec we used */ void *ih; /* interrupt handler cookie */ From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 18:52:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7694290; Mon, 2 Jun 2014 18:52:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C51AA27F3; Mon, 2 Jun 2014 18:52:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s52Iq33Y066550; Mon, 2 Jun 2014 18:52:03 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s52Iq3gD066548; Mon, 2 Jun 2014 18:52:03 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201406021852.s52Iq3gD066548@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 2 Jun 2014 18:52:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266978 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 18:52:03 -0000 Author: marcel Date: Mon Jun 2 18:52:03 2014 New Revision: 266978 URL: http://svnweb.freebsd.org/changeset/base/266978 Log: Convert em(4) to use the driver API. Submitted by: Anuranjan Shukla Obtained from: Juniper Networks, Inc. Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h head/sys/dev/e1000/if_lem.c head/sys/dev/e1000/if_lem.h Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Mon Jun 2 18:45:36 2014 (r266977) +++ head/sys/dev/e1000/if_em.c Mon Jun 2 18:52:03 2014 (r266978) @@ -202,20 +202,20 @@ static int em_shutdown(device_t); static int em_suspend(device_t); static int em_resume(device_t); #ifdef EM_MULTIQUEUE -static int em_mq_start(struct ifnet *, struct mbuf *); -static int em_mq_start_locked(struct ifnet *, +static int em_mq_start(if_t, struct mbuf *); +static int em_mq_start_locked(if_t, struct tx_ring *, struct mbuf *); -static void em_qflush(struct ifnet *); +static void em_qflush(if_t); #else -static void em_start(struct ifnet *); -static void em_start_locked(struct ifnet *, struct tx_ring *); +static void em_start(if_t); +static void em_start_locked(if_t, struct tx_ring *); #endif -static int em_ioctl(struct ifnet *, u_long, caddr_t); +static int em_ioctl(if_t, u_long, caddr_t); static void em_init(void *); static void em_init_locked(struct adapter *); static void em_stop(void *); -static void em_media_status(struct ifnet *, struct ifmediareq *); -static int em_media_change(struct ifnet *); +static void em_media_status(if_t, struct ifmediareq *); +static int em_media_change(if_t); static void em_identify_hardware(struct adapter *); static int em_allocate_pci_resources(struct adapter *); static int em_allocate_legacy(struct adapter *); @@ -258,8 +258,8 @@ static void em_disable_promisc(struct ad static void em_set_multi(struct adapter *); static void em_update_link_status(struct adapter *); static void em_refresh_mbufs(struct rx_ring *, int); -static void em_register_vlan(void *, struct ifnet *, u16); -static void em_unregister_vlan(void *, struct ifnet *, u16); +static void em_register_vlan(void *, if_t, u16); +static void em_unregister_vlan(void *, if_t, u16); static void em_setup_vlan_hw_support(struct adapter *); static int em_xmit(struct tx_ring *, struct mbuf **); static int em_dma_malloc(struct adapter *, bus_size_t, @@ -302,7 +302,7 @@ static int em_sysctl_eee(SYSCTL_HANDLER_ static __inline void em_rx_discard(struct rx_ring *, int); #ifdef DEVICE_POLLING -static poll_handler_t em_poll; +static poll_handler_drv_t em_poll; #endif /* POLLING */ /********************************************************************* @@ -738,8 +738,7 @@ em_attach(device_t dev) em_get_hw_control(adapter); /* Tell the stack that the interface is not active */ - adapter->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - adapter->ifp->if_drv_flags |= IFF_DRV_OACTIVE; + if_setdrvflagbits(adapter->ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); adapter->led_dev = led_create(em_led_func, adapter, device_get_nameunit(dev)); @@ -755,8 +754,8 @@ err_late: em_free_transmit_structures(adapter); em_free_receive_structures(adapter); em_release_hw_control(adapter); - if (adapter->ifp != NULL) - if_free(adapter->ifp); + if (adapter->ifp != (void *)NULL) + if_free_drv(adapter->ifp); err_pci: em_free_pci_resources(adapter); free(adapter->mta, M_DEVBUF); @@ -779,19 +778,19 @@ static int em_detach(device_t dev) { struct adapter *adapter = device_get_softc(dev); - struct ifnet *ifp = adapter->ifp; + if_t ifp = adapter->ifp; INIT_DEBUGOUT("em_detach: begin"); /* Make sure VLANS are not using driver */ - if (adapter->ifp->if_vlantrunk != NULL) { + if (if_vlantrunkinuse(ifp)) { device_printf(dev,"Vlan in use, detach first\n"); return (EBUSY); } #ifdef DEVICE_POLLING - if (ifp->if_capenable & IFCAP_POLLING) - ether_poll_deregister(ifp); + if (if_getcapenable(ifp) & IFCAP_POLLING) + ether_poll_deregister_drv(ifp); #endif if (adapter->led_dev != NULL) @@ -814,7 +813,7 @@ em_detach(device_t dev) if (adapter->vlan_detach != NULL) EVENTHANDLER_DEREGISTER(vlan_unconfig, adapter->vlan_detach); - ether_ifdetach(adapter->ifp); + ether_ifdetach_drv(adapter->ifp); callout_drain(&adapter->timer); #ifdef DEV_NETMAP @@ -823,7 +822,7 @@ em_detach(device_t dev) em_free_pci_resources(adapter); bus_generic_detach(dev); - if_free(ifp); + if_free_drv(ifp); em_free_transmit_structures(adapter); em_free_receive_structures(adapter); @@ -870,7 +869,7 @@ em_resume(device_t dev) { struct adapter *adapter = device_get_softc(dev); struct tx_ring *txr = adapter->tx_rings; - struct ifnet *ifp = adapter->ifp; + if_t ifp = adapter->ifp; EM_CORE_LOCK(adapter); if (adapter->hw.mac.type == e1000_pch2lan) @@ -878,15 +877,15 @@ em_resume(device_t dev) em_init_locked(adapter); em_init_manageability(adapter); - if ((ifp->if_flags & IFF_UP) && - (ifp->if_drv_flags & IFF_DRV_RUNNING) && adapter->link_active) { + if ((if_getflags(ifp) & IFF_UP) && + (if_getdrvflags(ifp) & IFF_DRV_RUNNING) && adapter->link_active) { for (int i = 0; i < adapter->num_queues; i++, txr++) { EM_TX_LOCK(txr); #ifdef EM_MULTIQUEUE if (!drbr_empty(ifp, txr->br)) em_mq_start_locked(ifp, txr, NULL); #else - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + if (!if_sendq_empty(ifp)) em_start_locked(ifp, txr); #endif EM_TX_UNLOCK(txr); @@ -908,13 +907,13 @@ em_resume(device_t dev) * in this driver, rather than also having multiple tx queues. **********************************************************************/ static int -em_mq_start_locked(struct ifnet *ifp, struct tx_ring *txr, struct mbuf *m) +em_mq_start_locked(if_t ifp, struct tx_ring *txr, struct mbuf *m) { struct adapter *adapter = txr->adapter; struct mbuf *next; int err = 0, enq = 0; - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + if ((if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING || adapter->link_active == 0) { if (m != NULL) err = drbr_enqueue(ifp, txr->br, m); @@ -939,11 +938,11 @@ em_mq_start_locked(struct ifnet *ifp, st } drbr_advance(ifp, txr->br); enq++; - ifp->if_obytes += next->m_pkthdr.len; + if_incobytes(ifp, next->m_pkthdr.len); if (next->m_flags & M_MCAST) - ifp->if_omcasts++; - ETHER_BPF_MTAP(ifp, next); - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + if_incomcasts(ifp, 1); + if_etherbpfmtap(ifp, next); + if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) break; } @@ -956,7 +955,7 @@ em_mq_start_locked(struct ifnet *ifp, st if (txr->tx_avail < EM_MAX_SCATTER) em_txeof(txr); if (txr->tx_avail < EM_MAX_SCATTER) - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + if_setdrvflagbits(ifp, IFF_DRV_OACTIVE,0); return (err); } @@ -964,9 +963,9 @@ em_mq_start_locked(struct ifnet *ifp, st ** Multiqueue capable stack interface */ static int -em_mq_start(struct ifnet *ifp, struct mbuf *m) +em_mq_start(if_t ifp, struct mbuf *m) { - struct adapter *adapter = ifp->if_softc; + struct adapter *adapter = if_getsoftc(ifp); struct tx_ring *txr = adapter->tx_rings; int error; @@ -983,9 +982,9 @@ em_mq_start(struct ifnet *ifp, struct mb ** Flush all ring buffers */ static void -em_qflush(struct ifnet *ifp) +em_qflush(if_t ifp) { - struct adapter *adapter = ifp->if_softc; + struct adapter *adapter = if_getsoftc(ifp); struct tx_ring *txr = adapter->tx_rings; struct mbuf *m; @@ -1000,29 +999,29 @@ em_qflush(struct ifnet *ifp) #else /* !EM_MULTIQUEUE */ static void -em_start_locked(struct ifnet *ifp, struct tx_ring *txr) +em_start_locked(if_t ifp, struct tx_ring *txr) { - struct adapter *adapter = ifp->if_softc; + struct adapter *adapter = if_getsoftc(ifp); struct mbuf *m_head; EM_TX_LOCK_ASSERT(txr); - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING|IFF_DRV_OACTIVE)) != + if ((if_getdrvflags(ifp) & (IFF_DRV_RUNNING|IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) return; if (!adapter->link_active) return; - while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { + while (!if_sendq_empty(ifp)) { /* Call cleanup if number of TX descriptors low */ if (txr->tx_avail <= EM_TX_CLEANUP_THRESHOLD) em_txeof(txr); if (txr->tx_avail < EM_MAX_SCATTER) { - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + if_setdrvflagbits(ifp,IFF_DRV_OACTIVE, 0); break; } - IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); + m_head = if_dequeue(ifp); if (m_head == NULL) break; /* @@ -1032,12 +1031,12 @@ em_start_locked(struct ifnet *ifp, struc if (em_xmit(txr, &m_head)) { if (m_head == NULL) break; - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); + if_sendq_prepend(ifp, m_head); break; } /* Send a copy of the frame to the BPF listener */ - ETHER_BPF_MTAP(ifp, m_head); + if_etherbpfmtap(ifp, m_head); /* Set timeout in case hardware has problems transmitting. */ txr->watchdog_time = ticks; @@ -1048,12 +1047,12 @@ em_start_locked(struct ifnet *ifp, struc } static void -em_start(struct ifnet *ifp) +em_start(if_t ifp) { - struct adapter *adapter = ifp->if_softc; + struct adapter *adapter = if_getsoftc(ifp); struct tx_ring *txr = adapter->tx_rings; - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { EM_TX_LOCK(txr); em_start_locked(ifp, txr); EM_TX_UNLOCK(txr); @@ -1072,9 +1071,9 @@ em_start(struct ifnet *ifp) **********************************************************************/ static int -em_ioctl(struct ifnet *ifp, u_long command, caddr_t data) +em_ioctl(if_t ifp, u_long command, caddr_t data) { - struct adapter *adapter = ifp->if_softc; + struct adapter *adapter = if_getsoftc(ifp); struct ifreq *ifr = (struct ifreq *)data; #if defined(INET) || defined(INET6) struct ifaddr *ifa = (struct ifaddr *)data; @@ -1100,15 +1099,15 @@ em_ioctl(struct ifnet *ifp, u_long comma ** so we avoid doing it when possible. */ if (avoid_reset) { - ifp->if_flags |= IFF_UP; - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) + if_setflagbits(ifp,IFF_UP,0); + if (!(if_getdrvflags(ifp)& IFF_DRV_RUNNING)) em_init(adapter); #ifdef INET - if (!(ifp->if_flags & IFF_NOARP)) - arp_ifinit(ifp, ifa); + if (!(if_getflags(ifp) & IFF_NOARP)) + arp_ifinit_drv(ifp, ifa); #endif } else - error = ether_ioctl(ifp, command, data); + error = ether_ioctl_drv(ifp, command, data); break; case SIOCSIFMTU: { @@ -1146,9 +1145,9 @@ em_ioctl(struct ifnet *ifp, u_long comma break; } - ifp->if_mtu = ifr->ifr_mtu; + if_setmtu(ifp, ifr->ifr_mtu); adapter->hw.mac.max_frame_size = - ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; + if_getmtu(ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN; em_init_locked(adapter); EM_CORE_UNLOCK(adapter); break; @@ -1157,9 +1156,9 @@ em_ioctl(struct ifnet *ifp, u_long comma IOCTL_DEBUGOUT("ioctl rcv'd:\ SIOCSIFFLAGS (Set Interface Flags)"); EM_CORE_LOCK(adapter); - if (ifp->if_flags & IFF_UP) { - if ((ifp->if_drv_flags & IFF_DRV_RUNNING)) { - if ((ifp->if_flags ^ adapter->if_flags) & + if (if_getflags(ifp) & IFF_UP) { + if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { + if ((if_getflags(ifp) ^ adapter->if_flags) & (IFF_PROMISC | IFF_ALLMULTI)) { em_disable_promisc(adapter); em_set_promisc(adapter); @@ -1167,20 +1166,20 @@ em_ioctl(struct ifnet *ifp, u_long comma } else em_init_locked(adapter); } else - if (ifp->if_drv_flags & IFF_DRV_RUNNING) + if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) em_stop(adapter); - adapter->if_flags = ifp->if_flags; + adapter->if_flags = if_getflags(ifp); EM_CORE_UNLOCK(adapter); break; case SIOCADDMULTI: case SIOCDELMULTI: IOCTL_DEBUGOUT("ioctl rcv'd: SIOC(ADD|DEL)MULTI"); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { EM_CORE_LOCK(adapter); em_disable_intr(adapter); em_set_multi(adapter); #ifdef DEVICE_POLLING - if (!(ifp->if_capenable & IFCAP_POLLING)) + if (!(if_getcapenable(ifp) & IFCAP_POLLING)) #endif em_enable_intr(adapter); EM_CORE_UNLOCK(adapter); @@ -1200,7 +1199,7 @@ em_ioctl(struct ifnet *ifp, u_long comma case SIOCGIFMEDIA: IOCTL_DEBUGOUT("ioctl rcv'd: \ SIOCxIFMEDIA (Get/Set Interface Media)"); - error = ifmedia_ioctl(ifp, ifr, &adapter->media, command); + error = ifmedia_ioctl_drv(ifp, ifr, &adapter->media, command); break; case SIOCSIFCAP: { @@ -1208,62 +1207,62 @@ em_ioctl(struct ifnet *ifp, u_long comma IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFCAP (Set Capabilities)"); reinit = 0; - mask = ifr->ifr_reqcap ^ ifp->if_capenable; + mask = ifr->ifr_reqcap ^ if_getcapenable(ifp); #ifdef DEVICE_POLLING if (mask & IFCAP_POLLING) { if (ifr->ifr_reqcap & IFCAP_POLLING) { - error = ether_poll_register(em_poll, ifp); + error = ether_poll_register_drv(em_poll, ifp); if (error) return (error); EM_CORE_LOCK(adapter); em_disable_intr(adapter); - ifp->if_capenable |= IFCAP_POLLING; + if_setcapenablebit(ifp, IFCAP_POLLING, 0); EM_CORE_UNLOCK(adapter); } else { - error = ether_poll_deregister(ifp); + error = ether_poll_deregister_drv(ifp); /* Enable interrupt even in error case */ EM_CORE_LOCK(adapter); em_enable_intr(adapter); - ifp->if_capenable &= ~IFCAP_POLLING; + if_setcapenablebit(ifp, 0, IFCAP_POLLING); EM_CORE_UNLOCK(adapter); } } #endif if (mask & IFCAP_HWCSUM) { - ifp->if_capenable ^= IFCAP_HWCSUM; + if_togglecapenable(ifp,IFCAP_HWCSUM); reinit = 1; } if (mask & IFCAP_TSO4) { - ifp->if_capenable ^= IFCAP_TSO4; + if_togglecapenable(ifp,IFCAP_TSO4); reinit = 1; } if (mask & IFCAP_VLAN_HWTAGGING) { - ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + if_togglecapenable(ifp,IFCAP_VLAN_HWTAGGING); reinit = 1; } if (mask & IFCAP_VLAN_HWFILTER) { - ifp->if_capenable ^= IFCAP_VLAN_HWFILTER; + if_togglecapenable(ifp, IFCAP_VLAN_HWFILTER); reinit = 1; } if (mask & IFCAP_VLAN_HWTSO) { - ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + if_togglecapenable(ifp, IFCAP_VLAN_HWTSO); reinit = 1; } if ((mask & IFCAP_WOL) && - (ifp->if_capabilities & IFCAP_WOL) != 0) { + (if_getcapabilities(ifp) & IFCAP_WOL) != 0) { if (mask & IFCAP_WOL_MCAST) - ifp->if_capenable ^= IFCAP_WOL_MCAST; + if_togglecapenable(ifp, IFCAP_WOL_MCAST); if (mask & IFCAP_WOL_MAGIC) - ifp->if_capenable ^= IFCAP_WOL_MAGIC; + if_togglecapenable(ifp, IFCAP_WOL_MAGIC); } - if (reinit && (ifp->if_drv_flags & IFF_DRV_RUNNING)) + if (reinit && (if_getdrvflags(ifp) & IFF_DRV_RUNNING)) em_init(adapter); - VLAN_CAPABILITIES(ifp); + if_vlancap(ifp); break; } default: - error = ether_ioctl(ifp, command, data); + error = ether_ioctl_drv(ifp, command, data); break; } @@ -1285,7 +1284,7 @@ em_ioctl(struct ifnet *ifp, u_long comma static void em_init_locked(struct adapter *adapter) { - struct ifnet *ifp = adapter->ifp; + if_t ifp = adapter->ifp; device_t dev = adapter->dev; INIT_DEBUGOUT("em_init: begin"); @@ -1296,7 +1295,7 @@ em_init_locked(struct adapter *adapter) callout_stop(&adapter->timer); /* Get the latest mac address, User can use a LAA */ - bcopy(IF_LLADDR(adapter->ifp), adapter->hw.mac.addr, + bcopy(if_getlladdr(adapter->ifp), adapter->hw.mac.addr, ETHER_ADDR_LEN); /* Put the address into the Receive Address Array */ @@ -1322,11 +1321,11 @@ em_init_locked(struct adapter *adapter) E1000_WRITE_REG(&adapter->hw, E1000_VET, ETHERTYPE_VLAN); /* Set hardware offload abilities */ - ifp->if_hwassist = 0; - if (ifp->if_capenable & IFCAP_TXCSUM) - ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); - if (ifp->if_capenable & IFCAP_TSO4) - ifp->if_hwassist |= CSUM_TSO; + if_clearhwassist(ifp); + if (if_getcapenable(ifp) & IFCAP_TXCSUM) + if_sethwassistbits(ifp, CSUM_TCP | CSUM_UDP, 0); + if (if_getcapenable(ifp) & IFCAP_TSO4) + if_sethwassistbits(ifp, CSUM_TSO, 0); /* Configure for OS presence */ em_init_manageability(adapter); @@ -1358,8 +1357,8 @@ em_init_locked(struct adapter *adapter) em_initialize_receive_unit(adapter); /* Use real VLAN Filter support? */ - if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) { - if (ifp->if_capenable & IFCAP_VLAN_HWFILTER) + if (if_getcapenable(ifp) & IFCAP_VLAN_HWTAGGING) { + if (if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) /* Use real VLAN Filter support */ em_setup_vlan_hw_support(adapter); else { @@ -1374,8 +1373,7 @@ em_init_locked(struct adapter *adapter) em_set_promisc(adapter); /* Set the interface as ACTIVE */ - ifp->if_drv_flags |= IFF_DRV_RUNNING; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + if_setdrvflagbits(ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE); callout_reset(&adapter->timer, hz, em_local_timer, adapter); e1000_clear_hw_cntrs_base_generic(&adapter->hw); @@ -1395,7 +1393,7 @@ em_init_locked(struct adapter *adapter) * Only enable interrupts if we are not polling, make sure * they are off otherwise. */ - if (ifp->if_capenable & IFCAP_POLLING) + if (if_getcapenable(ifp) & IFCAP_POLLING) em_disable_intr(adapter); else #endif /* DEVICE_POLLING */ @@ -1424,16 +1422,16 @@ em_init(void *arg) * *********************************************************************/ static int -em_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) +em_poll(if_t ifp, enum poll_cmd cmd, int count) { - struct adapter *adapter = ifp->if_softc; + struct adapter *adapter = if_getsoftc(ifp); struct tx_ring *txr = adapter->tx_rings; struct rx_ring *rxr = adapter->rx_rings; u32 reg_icr; int rx_done; EM_CORE_LOCK(adapter); - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) { EM_CORE_UNLOCK(adapter); return (0); } @@ -1458,7 +1456,7 @@ em_poll(struct ifnet *ifp, enum poll_cmd if (!drbr_empty(ifp, txr->br)) em_mq_start_locked(ifp, txr, NULL); #else - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + if (!if_sendq_empty(ifp)) em_start_locked(ifp, txr); #endif EM_TX_UNLOCK(txr); @@ -1477,7 +1475,7 @@ static int em_irq_fast(void *arg) { struct adapter *adapter = arg; - struct ifnet *ifp; + if_t ifp; u32 reg_icr; ifp = adapter->ifp; @@ -1519,12 +1517,12 @@ static void em_handle_que(void *context, int pending) { struct adapter *adapter = context; - struct ifnet *ifp = adapter->ifp; + if_t ifp = adapter->ifp; struct tx_ring *txr = adapter->tx_rings; struct rx_ring *rxr = adapter->rx_rings; - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { bool more = em_rxeof(rxr, adapter->rx_process_limit, NULL); EM_TX_LOCK(txr); em_txeof(txr); @@ -1532,7 +1530,7 @@ em_handle_que(void *context, int pending if (!drbr_empty(ifp, txr->br)) em_mq_start_locked(ifp, txr, NULL); #else - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + if (!if_sendq_empty(ifp)) em_start_locked(ifp, txr); #endif EM_TX_UNLOCK(txr); @@ -1557,7 +1555,7 @@ em_msix_tx(void *arg) { struct tx_ring *txr = arg; struct adapter *adapter = txr->adapter; - struct ifnet *ifp = adapter->ifp; + if_t ifp = adapter->ifp; ++txr->tx_irq; EM_TX_LOCK(txr); @@ -1566,7 +1564,7 @@ em_msix_tx(void *arg) if (!drbr_empty(ifp, txr->br)) em_mq_start_locked(ifp, txr, NULL); #else - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + if (!if_sendq_empty(ifp)) em_start_locked(ifp, txr); #endif /* Reenable this interrupt */ @@ -1589,7 +1587,7 @@ em_msix_rx(void *arg) bool more; ++rxr->rx_irq; - if (!(adapter->ifp->if_drv_flags & IFF_DRV_RUNNING)) + if (!(if_getdrvflags(adapter->ifp) & IFF_DRV_RUNNING)) return; more = em_rxeof(rxr, adapter->rx_process_limit, NULL); if (more) @@ -1643,7 +1641,7 @@ em_handle_tx(void *context, int pending) { struct tx_ring *txr = context; struct adapter *adapter = txr->adapter; - struct ifnet *ifp = adapter->ifp; + if_t ifp = adapter->ifp; EM_TX_LOCK(txr); em_txeof(txr); @@ -1651,7 +1649,7 @@ em_handle_tx(void *context, int pending) if (!drbr_empty(ifp, txr->br)) em_mq_start_locked(ifp, txr, NULL); #else - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + if (!if_sendq_empty(ifp)) em_start_locked(ifp, txr); #endif E1000_WRITE_REG(&adapter->hw, E1000_IMS, txr->ims); @@ -1663,9 +1661,9 @@ em_handle_link(void *context, int pendin { struct adapter *adapter = context; struct tx_ring *txr = adapter->tx_rings; - struct ifnet *ifp = adapter->ifp; + if_t ifp = adapter->ifp; - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) + if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING)) return; EM_CORE_LOCK(adapter); @@ -1681,7 +1679,7 @@ em_handle_link(void *context, int pendin if (!drbr_empty(ifp, txr->br)) em_mq_start_locked(ifp, txr, NULL); #else - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + if (if_sendq_empty(ifp)) em_start_locked(ifp, txr); #endif EM_TX_UNLOCK(txr); @@ -1700,9 +1698,9 @@ em_handle_link(void *context, int pendin * **********************************************************************/ static void -em_media_status(struct ifnet *ifp, struct ifmediareq *ifmr) +em_media_status(if_t ifp, struct ifmediareq *ifmr) { - struct adapter *adapter = ifp->if_softc; + struct adapter *adapter = if_getsoftc(ifp); u_char fiber_type = IFM_1000_SX; INIT_DEBUGOUT("em_media_status: begin"); @@ -1752,9 +1750,9 @@ em_media_status(struct ifnet *ifp, struc * **********************************************************************/ static int -em_media_change(struct ifnet *ifp) +em_media_change(if_t ifp) { - struct adapter *adapter = ifp->if_softc; + struct adapter *adapter = if_getsoftc(ifp); struct ifmedia *ifm = &adapter->media; INIT_DEBUGOUT("em_media_change: begin"); @@ -2018,8 +2016,7 @@ retry: if (m_head->m_flags & M_VLANTAG) { /* Set the vlan id. */ - txd_upper |= - (htole16(m_head->m_pkthdr.ether_vtag) << 16); + txd_upper |= htole16((if_getvtag(m_head)) << 16); /* Tell hardware to add tag */ txd_lower |= htole32(E1000_TXD_CMD_VLE); } @@ -2122,18 +2119,18 @@ retry: static void em_set_promisc(struct adapter *adapter) { - struct ifnet *ifp = adapter->ifp; + if_t ifp = adapter->ifp; u32 reg_rctl; reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); - if (ifp->if_flags & IFF_PROMISC) { + if (if_getflags(ifp) & IFF_PROMISC) { reg_rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE); /* Turn this on if you want to see bad packets */ if (em_debug_sbp) reg_rctl |= E1000_RCTL_SBP; E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); - } else if (ifp->if_flags & IFF_ALLMULTI) { + } else if (if_getflags(ifp) & IFF_ALLMULTI) { reg_rctl |= E1000_RCTL_MPE; reg_rctl &= ~E1000_RCTL_UPE; E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); @@ -2143,34 +2140,16 @@ em_set_promisc(struct adapter *adapter) static void em_disable_promisc(struct adapter *adapter) { - struct ifnet *ifp = adapter->ifp; + if_t ifp = adapter->ifp; u32 reg_rctl; int mcnt = 0; reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); reg_rctl &= (~E1000_RCTL_UPE); - if (ifp->if_flags & IFF_ALLMULTI) + if (if_getflags(ifp) & IFF_ALLMULTI) mcnt = MAX_NUM_MULTICAST_ADDRESSES; - else { - struct ifmultiaddr *ifma; -#if __FreeBSD_version < 800000 - IF_ADDR_LOCK(ifp); -#else - if_maddr_rlock(ifp); -#endif - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - if (mcnt == MAX_NUM_MULTICAST_ADDRESSES) - break; - mcnt++; - } -#if __FreeBSD_version < 800000 - IF_ADDR_UNLOCK(ifp); -#else - if_maddr_runlock(ifp); -#endif - } + else + mcnt = if_multiaddr_count(ifp, MAX_NUM_MULTICAST_ADDRESSES); /* Don't disable if in MAX groups */ if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) reg_rctl &= (~E1000_RCTL_MPE); @@ -2189,8 +2168,7 @@ em_disable_promisc(struct adapter *adapt static void em_set_multi(struct adapter *adapter) { - struct ifnet *ifp = adapter->ifp; - struct ifmultiaddr *ifma; + if_t ifp = adapter->ifp; u32 reg_rctl = 0; u8 *mta; /* Multicast array memory */ int mcnt = 0; @@ -2210,27 +2188,8 @@ em_set_multi(struct adapter *adapter) msec_delay(5); } -#if __FreeBSD_version < 800000 - IF_ADDR_LOCK(ifp); -#else - if_maddr_rlock(ifp); -#endif - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - - if (mcnt == MAX_NUM_MULTICAST_ADDRESSES) - break; + if_multiaddr_array(ifp, mta, &mcnt, MAX_NUM_MULTICAST_ADDRESSES); - bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), - &mta[mcnt * ETH_ADDR_LEN], ETH_ADDR_LEN); - mcnt++; - } -#if __FreeBSD_version < 800000 - IF_ADDR_UNLOCK(ifp); -#else - if_maddr_runlock(ifp); -#endif if (mcnt >= MAX_NUM_MULTICAST_ADDRESSES) { reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); reg_rctl |= E1000_RCTL_MPE; @@ -2261,7 +2220,7 @@ static void em_local_timer(void *arg) { struct adapter *adapter = arg; - struct ifnet *ifp = adapter->ifp; + if_t ifp = adapter->ifp; struct tx_ring *txr = adapter->tx_rings; struct rx_ring *rxr = adapter->rx_rings; u32 trigger; @@ -2313,7 +2272,7 @@ hung: device_printf(adapter->dev,"TX(%d) desc avail = %d," "Next TX to Clean = %d\n", txr->me, txr->tx_avail, txr->next_to_clean); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING); adapter->watchdog_events++; adapter->pause_frames = 0; em_init_locked(adapter); @@ -2324,7 +2283,7 @@ static void em_update_link_status(struct adapter *adapter) { struct e1000_hw *hw = &adapter->hw; - struct ifnet *ifp = adapter->ifp; + if_t ifp = adapter->ifp; device_t dev = adapter->dev; struct tx_ring *txr = adapter->tx_rings; u32 link_check = 0; @@ -2375,10 +2334,11 @@ em_update_link_status(struct adapter *ad "Full Duplex" : "Half Duplex")); adapter->link_active = 1; adapter->smartspeed = 0; - ifp->if_baudrate = adapter->link_speed * 1000000; - if_link_state_change(ifp, LINK_STATE_UP); + if_setbaudrate(ifp, adapter->link_speed * 1000000); + if_linkstate_change_drv(ifp, LINK_STATE_UP); } else if (!link_check && (adapter->link_active == 1)) { - ifp->if_baudrate = adapter->link_speed = 0; + if_setbaudrate(ifp, 0); + adapter->link_speed = 0; adapter->link_duplex = 0; if (bootverbose) device_printf(dev, "Link is Down\n"); @@ -2386,7 +2346,7 @@ em_update_link_status(struct adapter *ad /* Link down, disable watchdog */ for (int i = 0; i < adapter->num_queues; i++, txr++) txr->queue_status = EM_QUEUE_IDLE; - if_link_state_change(ifp, LINK_STATE_DOWN); + if_linkstate_change_drv(ifp, LINK_STATE_DOWN); } } @@ -2403,7 +2363,7 @@ static void em_stop(void *arg) { struct adapter *adapter = arg; - struct ifnet *ifp = adapter->ifp; + if_t ifp = adapter->ifp; struct tx_ring *txr = adapter->tx_rings; EM_CORE_LOCK_ASSERT(adapter); @@ -2414,8 +2374,7 @@ em_stop(void *arg) callout_stop(&adapter->timer); /* Tell the stack that the interface is no longer active */ - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); /* Unarm watchdog timer. */ for (int i = 0; i < adapter->num_queues; i++, txr++) { @@ -2813,7 +2772,7 @@ static void em_reset(struct adapter *adapter) { device_t dev = adapter->dev; - struct ifnet *ifp = adapter->ifp; + if_t ifp = adapter->ifp; struct e1000_hw *hw = &adapter->hw; u16 rx_buffer_size; u32 pba; @@ -2911,7 +2870,7 @@ em_reset(struct adapter *adapter) /* Workaround: no TX flow ctrl for PCH */ hw->fc.requested_mode = e1000_fc_rx_pause; hw->fc.pause_time = 0xFFFF; /* override */ - if (ifp->if_mtu > ETHERMTU) { + if (if_getmtu(ifp) > ETHERMTU) { hw->fc.high_water = 0x3500; hw->fc.low_water = 0x1500; } else { @@ -2927,14 +2886,14 @@ em_reset(struct adapter *adapter) hw->fc.pause_time = 0x0650; hw->fc.refresh_time = 0x0400; /* Jumbos need adjusted PBA */ - if (ifp->if_mtu > ETHERMTU) + if (if_getmtu(ifp) > ETHERMTU) E1000_WRITE_REG(hw, E1000_PBA, 12); else E1000_WRITE_REG(hw, E1000_PBA, 26); break; case e1000_ich9lan: case e1000_ich10lan: - if (ifp->if_mtu > ETHERMTU) { + if (if_getmtu(ifp) > ETHERMTU) { hw->fc.high_water = 0x2800; hw->fc.low_water = hw->fc.high_water - 8; break; @@ -2970,47 +2929,47 @@ em_reset(struct adapter *adapter) static int em_setup_interface(device_t dev, struct adapter *adapter) { - struct ifnet *ifp; + if_t ifp; INIT_DEBUGOUT("em_setup_interface: begin"); - ifp = adapter->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { + ifp = adapter->ifp = if_gethandle(IFT_ETHER); + if (ifp == 0) { device_printf(dev, "can not allocate ifnet structure\n"); return (-1); } - if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_init = em_init; - ifp->if_softc = adapter; - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_ioctl = em_ioctl; + if_initname_drv(ifp, device_get_name(dev), device_get_unit(dev)); + if_setdev(ifp, dev); + if_setinitfn(ifp, em_init); + if_setsoftc(ifp, adapter); + if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); + if_setioctlfn(ifp, em_ioctl); #ifdef EM_MULTIQUEUE /* Multiqueue stack interface */ - ifp->if_transmit = em_mq_start; - ifp->if_qflush = em_qflush; + if_settransmitfn(ifp, em_mq_start); + if_setqflushfn(ifp, em_qflush); #else - ifp->if_start = em_start; - IFQ_SET_MAXLEN(&ifp->if_snd, adapter->num_tx_desc - 1); - ifp->if_snd.ifq_drv_maxlen = adapter->num_tx_desc - 1; - IFQ_SET_READY(&ifp->if_snd); + if_setstartfn(ifp, em_start); + if_setsendqlen(ifp, adapter->num_tx_desc - 1); + if_setsendqready(ifp); #endif - ether_ifattach(ifp, adapter->hw.mac.addr); + ether_ifattach_drv(ifp, adapter->hw.mac.addr); - ifp->if_capabilities = ifp->if_capenable = 0; + if_setcapabilities(ifp, 0); + if_setcapenable(ifp, 0); - ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM; - ifp->if_capabilities |= IFCAP_TSO4; + if_setcapabilitiesbit(ifp, IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | + IFCAP_TSO4, 0); /* * Tell the upper layer(s) we * support full VLAN capability */ - ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING - | IFCAP_VLAN_HWTSO - | IFCAP_VLAN_MTU; - ifp->if_capenable = ifp->if_capabilities; + if_setifheaderlen(ifp, sizeof(struct ether_vlan_header)); + if_setcapabilitiesbit(ifp, IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO | + IFCAP_VLAN_MTU, 0); + if_setcapenable(ifp, if_getcapabilities(ifp)); /* ** Don't turn this on by default, if vlans are @@ -3020,23 +2979,23 @@ em_setup_interface(device_t dev, struct ** using vlans directly on the em driver you can ** enable this and get full hardware tag filtering. */ - ifp->if_capabilities |= IFCAP_VLAN_HWFILTER; + if_setcapabilitiesbit(ifp, IFCAP_VLAN_HWFILTER,0); #ifdef DEVICE_POLLING - ifp->if_capabilities |= IFCAP_POLLING; + if_setcapabilitiesbit(ifp, IFCAP_POLLING,0); #endif /* Enable only WOL MAGIC by default */ if (adapter->wol) { - ifp->if_capabilities |= IFCAP_WOL; - ifp->if_capenable |= IFCAP_WOL_MAGIC; + if_setcapabilitiesbit(ifp, IFCAP_WOL, 0); + if_setcapenablebit(ifp, IFCAP_WOL_MAGIC, 0); } /* * Specify the media types supported by this adapter and register * callbacks to update media and link information */ - ifmedia_init(&adapter->media, IFM_IMASK, + ifmedia_init_drv(&adapter->media, IFM_IMASK, em_media_change, em_media_status); if ((adapter->hw.phy.media_type == e1000_media_type_fiber) || (adapter->hw.phy.media_type == e1000_media_type_internal_serdes)) { @@ -3351,8 +3310,8 @@ em_setup_transmit_ring(struct tx_ring *t struct em_buffer *txbuf; int i; #ifdef DEV_NETMAP - struct netmap_adapter *na = NA(adapter->ifp); struct netmap_slot *slot; + struct netmap_adapter *na = netmap_getna(adapter->ifp); #endif /* DEV_NETMAP */ /* Clear the old descriptor contents */ @@ -3832,7 +3791,7 @@ em_txeof(struct tx_ring *txr) int first, last, done, processed; struct em_buffer *tx_buffer; struct e1000_tx_desc *tx_desc, *eop_desc; - struct ifnet *ifp = adapter->ifp; + if_t ifp = adapter->ifp; EM_TX_LOCK_ASSERT(txr); #ifdef DEV_NETMAP @@ -3893,7 +3852,7 @@ em_txeof(struct tx_ring *txr) tx_buffer = &txr->tx_buffers[first]; tx_desc = &txr->tx_base[first]; } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 18:54:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A183471; Mon, 2 Jun 2014 18:54:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB9B82826; Mon, 2 Jun 2014 18:54:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s52IsjY8066908; Mon, 2 Jun 2014 18:54:45 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s52Isjcl066904; Mon, 2 Jun 2014 18:54:45 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201406021854.s52Isjcl066904@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 2 Jun 2014 18:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266979 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 18:54:46 -0000 Author: marcel Date: Mon Jun 2 18:54:45 2014 New Revision: 266979 URL: http://svnweb.freebsd.org/changeset/base/266979 Log: Convert bxe(4) to use the driver API. Submitted by: Sreekanth Rupavatharam Obtained from: Juniper Networks, Inc. Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_debug.c head/sys/dev/bxe/bxe_stats.c Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Mon Jun 2 18:52:03 2014 (r266978) +++ head/sys/dev/bxe/bxe.c Mon Jun 2 18:54:45 2014 (r266979) @@ -2723,11 +2723,11 @@ bxe_release_mutexes(struct bxe_softc *sc static void bxe_tx_disable(struct bxe_softc* sc) { - struct ifnet *ifp = sc->ifnet; + if_t ifp = sc->ifp; /* tell the stack the driver is stopped and TX queue is full */ - if (ifp != NULL) { - ifp->if_drv_flags = 0; + if (ifp != NULL) { + if_setdrvflags(ifp, 0); } } @@ -3180,7 +3180,7 @@ bxe_tpa_stop(struct bxe_softc * struct eth_end_agg_rx_cqe *cqe, uint16_t cqe_idx) { - struct ifnet *ifp = sc->ifnet; + if_t ifp = sc->ifp; struct mbuf *m; int rc = 0; @@ -3225,7 +3225,7 @@ bxe_tpa_stop(struct bxe_softc * } /* assign packet to this interface interface */ - m->m_pkthdr.rcvif = ifp; + if_setrcvif(m, ifp); #if __FreeBSD_version >= 800000 /* specify what RSS queue was used for this flow */ @@ -3233,11 +3233,11 @@ bxe_tpa_stop(struct bxe_softc * m->m_flags |= M_FLOWID; #endif - ifp->if_ipackets++; + if_incipackets(ifp, 1); fp->eth_q_stats.rx_tpa_pkts++; /* pass the frame to the stack */ - (*ifp->if_input)(ifp, m); + if_input(ifp, m); } /* we passed an mbuf up the stack or dropped the frame */ @@ -3253,7 +3253,7 @@ static uint8_t bxe_rxeof(struct bxe_softc *sc, struct bxe_fastpath *fp) { - struct ifnet *ifp = sc->ifnet; + if_t ifp = sc->ifp; uint16_t bd_cons, bd_prod, bd_prod_fw, comp_ring_cons; uint16_t hw_cq_cons, sw_cq_cons, sw_cq_prod; int rx_pkts = 0; @@ -3421,13 +3421,13 @@ bxe_rxeof(struct bxe_softc *sc, m->m_pkthdr.len = m->m_len = len; /* assign packet to this interface interface */ - m->m_pkthdr.rcvif = ifp; + if_setrcvif(m, ifp); /* assume no hardware checksum has complated */ m->m_pkthdr.csum_flags = 0; /* validate checksum if offload enabled */ - if (ifp->if_capenable & IFCAP_RXCSUM) { + if (if_getcapenable(ifp) & IFCAP_RXCSUM) { /* check for a valid IP frame */ if (!(cqe->fast_path_cqe.status_flags & ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG)) { @@ -3476,9 +3476,9 @@ next_rx: /* pass the frame to the stack */ if (__predict_true(m != NULL)) { - ifp->if_ipackets++; + if_incipackets(ifp, 1); rx_pkts++; - (*ifp->if_input)(ifp, m); + if_input(ifp, m); } next_cqe: @@ -3605,7 +3605,7 @@ static uint8_t bxe_txeof(struct bxe_softc *sc, struct bxe_fastpath *fp) { - struct ifnet *ifp = sc->ifnet; + if_t ifp = sc->ifp; uint16_t bd_cons, hw_cons, sw_cons, pkt_cons; uint16_t tx_bd_avail; @@ -3639,9 +3639,9 @@ bxe_txeof(struct bxe_softc *sc, tx_bd_avail = bxe_tx_avail(sc, fp); if (tx_bd_avail < BXE_TX_CLEANUP_THRESHOLD) { - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); } else { - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE); } if (fp->tx_pkt_prod != fp->tx_pkt_cons) { @@ -4528,9 +4528,9 @@ bxe_nic_unload(struct bxe_softc *sc, * the user runs "ifconfig bxe media ..." or "ifconfig bxe mediaopt ...". */ static int -bxe_ifmedia_update(struct ifnet *ifp) +bxe_ifmedia_update(struct ifnet *ifp) { - struct bxe_softc *sc = (struct bxe_softc *)ifp->if_softc; + struct bxe_softc *sc = (struct bxe_softc *)if_getsoftc(ifp); struct ifmedia *ifm; ifm = &sc->ifmedia; @@ -4563,10 +4563,10 @@ bxe_ifmedia_update(struct ifnet *ifp) static void bxe_ifmedia_status(struct ifnet *ifp, struct ifmediareq *ifmr) { - struct bxe_softc *sc = ifp->if_softc; + struct bxe_softc *sc = if_getsoftc(ifp); /* Report link down if the driver isn't running. */ - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) { ifmr->ifm_active |= IFM_NONE; return; } @@ -4709,8 +4709,8 @@ bxe_handle_chip_tq(void *context, switch (work) { case CHIP_TQ_START: - if ((sc->ifnet->if_flags & IFF_UP) && - !(sc->ifnet->if_drv_flags & IFF_DRV_RUNNING)) { + if ((if_getflags(sc->ifp) & IFF_UP) && + !(if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING)) { /* start the interface */ BLOGD(sc, DBG_LOAD, "Starting the interface...\n"); BXE_CORE_LOCK(sc); @@ -4720,8 +4720,8 @@ bxe_handle_chip_tq(void *context, break; case CHIP_TQ_STOP: - if (!(sc->ifnet->if_flags & IFF_UP) && - (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING)) { + if (!(if_getflags(sc->ifp) & IFF_UP) && + (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING)) { /* bring down the interface */ BLOGD(sc, DBG_LOAD, "Stopping the interface...\n"); bxe_periodic_stop(sc); @@ -4732,7 +4732,7 @@ bxe_handle_chip_tq(void *context, break; case CHIP_TQ_REINIT: - if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) { + if (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) { /* restart the interface */ BLOGD(sc, DBG_LOAD, "Restarting the interface...\n"); bxe_periodic_stop(sc); @@ -4755,11 +4755,11 @@ bxe_handle_chip_tq(void *context, * 0 = Success, >0 Failure */ static int -bxe_ioctl(struct ifnet *ifp, +bxe_ioctl(if_t ifp, u_long command, caddr_t data) { - struct bxe_softc *sc = ifp->if_softc; + struct bxe_softc *sc = if_getsoftc(ifp); struct ifreq *ifr = (struct ifreq *)data; struct bxe_nvram_data *nvdata; uint32_t priv_op; @@ -4790,9 +4790,12 @@ bxe_ioctl(struct ifnet *ifp, atomic_store_rel_int((volatile unsigned int *)&sc->mtu, (unsigned long)ifr->ifr_mtu); - atomic_store_rel_long((volatile unsigned long *)&ifp->if_mtu, + /* + atomic_store_rel_long((volatile unsigned long *)&if_getmtu(ifp), (unsigned long)ifr->ifr_mtu); - + XXX - Not sure why it needs to be atomic + */ + if_setmtu(ifp, ifr->ifr_mtu); reinit = 1; break; @@ -4801,8 +4804,8 @@ bxe_ioctl(struct ifnet *ifp, BLOGD(sc, DBG_IOCTL, "Received SIOCSIFFLAGS ioctl\n"); /* check if the interface is up */ - if (ifp->if_flags & IFF_UP) { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (if_getflags(ifp) & IFF_UP) { + if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { /* set the receive mode flags */ bxe_set_rx_mode(sc); } else { @@ -4810,7 +4813,7 @@ bxe_ioctl(struct ifnet *ifp, taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); } } else { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_STOP); taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); } @@ -4824,7 +4827,7 @@ bxe_ioctl(struct ifnet *ifp, BLOGD(sc, DBG_IOCTL, "Received SIOCADDMULTI/SIOCDELMULTI ioctl\n"); /* check if the interface is up */ - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { /* set the receive mode flags */ bxe_set_rx_mode(sc); } @@ -4833,72 +4836,73 @@ bxe_ioctl(struct ifnet *ifp, case SIOCSIFCAP: /* find out which capabilities have changed */ - mask = (ifr->ifr_reqcap ^ ifp->if_capenable); + mask = (ifr->ifr_reqcap ^ if_getcapenable(ifp)); BLOGD(sc, DBG_IOCTL, "Received SIOCSIFCAP ioctl (mask=0x%08x)\n", mask); /* toggle the LRO capabilites enable flag */ if (mask & IFCAP_LRO) { - ifp->if_capenable ^= IFCAP_LRO; + if_togglecapenable(ifp, IFCAP_LRO); BLOGD(sc, DBG_IOCTL, "Turning LRO %s\n", - (ifp->if_capenable & IFCAP_LRO) ? "ON" : "OFF"); + (if_getcapenable(ifp) & IFCAP_LRO) ? "ON" : "OFF"); reinit = 1; } /* toggle the TXCSUM checksum capabilites enable flag */ if (mask & IFCAP_TXCSUM) { - ifp->if_capenable ^= IFCAP_TXCSUM; + if_togglecapenable(ifp, IFCAP_TXCSUM); BLOGD(sc, DBG_IOCTL, "Turning TXCSUM %s\n", - (ifp->if_capenable & IFCAP_TXCSUM) ? "ON" : "OFF"); - if (ifp->if_capenable & IFCAP_TXCSUM) { - ifp->if_hwassist = (CSUM_IP | + (if_getcapenable(ifp) & IFCAP_TXCSUM) ? "ON" : "OFF"); + if (if_getcapenable(ifp) & IFCAP_TXCSUM) { + if_sethwassistbits(ifp, (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_TSO | CSUM_TCP_IPV6 | - CSUM_UDP_IPV6); + CSUM_UDP_IPV6), 0); } else { - ifp->if_hwassist = 0; + if_clearhwassist(ifp); /* XXX */ } } /* toggle the RXCSUM checksum capabilities enable flag */ if (mask & IFCAP_RXCSUM) { - ifp->if_capenable ^= IFCAP_RXCSUM; + if_togglecapenable(ifp, IFCAP_RXCSUM); BLOGD(sc, DBG_IOCTL, "Turning RXCSUM %s\n", - (ifp->if_capenable & IFCAP_RXCSUM) ? "ON" : "OFF"); - if (ifp->if_capenable & IFCAP_RXCSUM) { - ifp->if_hwassist = (CSUM_IP | + (if_getcapenable(ifp) & IFCAP_RXCSUM) ? "ON" : "OFF"); + if (if_getcapenable(ifp) & IFCAP_RXCSUM) { + if_sethwassistbits(ifp, (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_TSO | CSUM_TCP_IPV6 | - CSUM_UDP_IPV6); + CSUM_UDP_IPV6), 0); } else { - ifp->if_hwassist = 0; + if_clearhwassist(ifp); /* XXX */ } } /* toggle TSO4 capabilities enabled flag */ if (mask & IFCAP_TSO4) { - ifp->if_capenable ^= IFCAP_TSO4; + if_togglecapenable(ifp, IFCAP_TSO4); BLOGD(sc, DBG_IOCTL, "Turning TSO4 %s\n", - (ifp->if_capenable & IFCAP_TSO4) ? "ON" : "OFF"); + (if_getcapenable(ifp) & IFCAP_TSO4) ? "ON" : "OFF"); } /* toggle TSO6 capabilities enabled flag */ if (mask & IFCAP_TSO6) { - ifp->if_capenable ^= IFCAP_TSO6; + if_togglecapenable(ifp, IFCAP_TSO6); BLOGD(sc, DBG_IOCTL, "Turning TSO6 %s\n", - (ifp->if_capenable & IFCAP_TSO6) ? "ON" : "OFF"); + (if_getcapenable(ifp) & IFCAP_TSO6) ? "ON" : "OFF"); } /* toggle VLAN_HWTSO capabilities enabled flag */ if (mask & IFCAP_VLAN_HWTSO) { - ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + + if_togglecapenable(ifp, IFCAP_VLAN_HWTSO); BLOGD(sc, DBG_IOCTL, "Turning VLAN_HWTSO %s\n", - (ifp->if_capenable & IFCAP_VLAN_HWTSO) ? "ON" : "OFF"); + (if_getcapenable(ifp) & IFCAP_VLAN_HWTSO) ? "ON" : "OFF"); } /* toggle VLAN_HWCSUM capabilities enabled flag */ @@ -4941,7 +4945,7 @@ bxe_ioctl(struct ifnet *ifp, BLOGD(sc, DBG_IOCTL, "Received SIOCSIFMEDIA/SIOCGIFMEDIA ioctl (cmd=%lu)\n", (command & 0xff)); - error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command); + error = ifmedia_ioctl_drv(ifp, ifr, &sc->ifmedia, command); break; case SIOCGPRIVATE_0: @@ -4977,11 +4981,11 @@ bxe_ioctl(struct ifnet *ifp, default: BLOGD(sc, DBG_IOCTL, "Received Unknown Ioctl (cmd=%lu)\n", (command & 0xff)); - error = ether_ioctl(ifp, command, data); + error = ether_ioctl_drv(ifp, command, data); break; } - if (reinit && (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING)) { + if (reinit && (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING)) { BLOGD(sc, DBG_LOAD | DBG_IOCTL, "Re-initializing hardware from IOCTL change\n"); atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); @@ -5831,8 +5835,8 @@ bxe_tx_encap_continue: } static void -bxe_tx_start_locked(struct bxe_softc *sc, - struct ifnet *ifp, +bxe_tx_start_locked(struct bxe_softc *sc, + if_t ifp, struct bxe_fastpath *fp) { struct mbuf *m = NULL; @@ -5842,13 +5846,13 @@ bxe_tx_start_locked(struct bxe_softc BXE_FP_TX_LOCK_ASSERT(fp); /* keep adding entries while there are frames to send */ - while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { + while (!if_sendq_empty(ifp)) { /* * check for any frames to send * dequeue can still be NULL even if queue is not empty */ - IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + m = if_dequeue(ifp); if (__predict_false(m == NULL)) { break; } @@ -5865,8 +5869,8 @@ bxe_tx_start_locked(struct bxe_softc fp->eth_q_stats.tx_encap_failures++; if (m != NULL) { /* mark the TX queue as full and return the frame */ - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IFQ_DRV_PREPEND(&ifp->if_snd, m); + if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); + if_sendq_prepend(ifp, m); fp->eth_q_stats.mbuf_alloc_tx--; fp->eth_q_stats.tx_queue_xoff++; } @@ -5879,7 +5883,7 @@ bxe_tx_start_locked(struct bxe_softc tx_count++; /* send a copy of the frame to any BPF listeners. */ - BPF_MTAP(ifp, m); + if_etherbpfmtap(ifp, m); tx_bd_avail = bxe_tx_avail(sc, fp); @@ -5887,7 +5891,7 @@ bxe_tx_start_locked(struct bxe_softc if (tx_bd_avail < BXE_TX_CLEANUP_THRESHOLD) { /* bxe_txeof will set IFF_DRV_OACTIVE appropriately */ bxe_txeof(sc, fp); - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { + if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE) { break; } } @@ -5902,19 +5906,19 @@ bxe_tx_start_locked(struct bxe_softc /* Legacy (non-RSS) dispatch routine */ static void -bxe_tx_start(struct ifnet *ifp) +bxe_tx_start(if_t ifp) { struct bxe_softc *sc; struct bxe_fastpath *fp; - sc = ifp->if_softc; + sc = if_getsoftc(ifp); - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING)) { BLOGW(sc, "Interface not running, ignoring transmit request\n"); return; } - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { + if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE) { BLOGW(sc, "Interface TX queue is full, ignoring transmit request\n"); return; } @@ -5935,7 +5939,7 @@ bxe_tx_start(struct ifnet *ifp) static int bxe_tx_mq_start_locked(struct bxe_softc *sc, - struct ifnet *ifp, + if_t ifp, struct bxe_fastpath *fp, struct mbuf *m) { @@ -5952,7 +5956,7 @@ bxe_tx_mq_start_locked(struct bxe_softc } /* fetch the depth of the driver queue */ - depth = drbr_inuse(ifp, tx_br); + depth = drbr_inuse_drv(ifp, tx_br); if (depth > fp->eth_q_stats.tx_max_drbr_queue_depth) { fp->eth_q_stats.tx_max_drbr_queue_depth = depth; } @@ -5961,15 +5965,15 @@ bxe_tx_mq_start_locked(struct bxe_softc if (m == NULL) { /* no new work, check for pending frames */ - next = drbr_dequeue(ifp, tx_br); - } else if (drbr_needs_enqueue(ifp, tx_br)) { + next = drbr_dequeue_drv(ifp, tx_br); + } else if (drbr_needs_enqueue_drv(ifp, tx_br)) { /* have both new and pending work, maintain packet order */ - rc = drbr_enqueue(ifp, tx_br, m); + rc = drbr_enqueue_drv(ifp, tx_br, m); if (rc != 0) { fp->eth_q_stats.tx_soft_errors++; goto bxe_tx_mq_start_locked_exit; } - next = drbr_dequeue(ifp, tx_br); + next = drbr_dequeue_drv(ifp, tx_br); } else { /* new work only and nothing pending */ next = m; @@ -5991,9 +5995,9 @@ bxe_tx_mq_start_locked(struct bxe_softc fp->eth_q_stats.tx_encap_failures++; if (next != NULL) { /* mark the TX queue as full and save the frame */ - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); /* XXX this may reorder the frame */ - rc = drbr_enqueue(ifp, tx_br, next); + rc = drbr_enqueue_drv(ifp, tx_br, next); fp->eth_q_stats.mbuf_alloc_tx--; fp->eth_q_stats.tx_frames_deferred++; } @@ -6006,7 +6010,7 @@ bxe_tx_mq_start_locked(struct bxe_softc tx_count++; /* send a copy of the frame to any BPF listeners */ - BPF_MTAP(ifp, next); + if_etherbpfmtap(ifp, next); tx_bd_avail = bxe_tx_avail(sc, fp); @@ -6014,12 +6018,12 @@ bxe_tx_mq_start_locked(struct bxe_softc if (tx_bd_avail < BXE_TX_CLEANUP_THRESHOLD) { /* bxe_txeof will set IFF_DRV_OACTIVE appropriately */ bxe_txeof(sc, fp); - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { + if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE) { break; } } - next = drbr_dequeue(ifp, tx_br); + next = drbr_dequeue_drv(ifp, tx_br); } /* all TX packets were dequeued and/or the tx ring is full */ @@ -6038,7 +6042,7 @@ static int bxe_tx_mq_start(struct ifnet *ifp, struct mbuf *m) { - struct bxe_softc *sc = ifp->if_softc; + struct bxe_softc *sc = if_getsoftc(ifp); struct bxe_fastpath *fp; int fp_index, rc; @@ -6051,12 +6055,12 @@ bxe_tx_mq_start(struct ifnet *ifp, fp = &sc->fp[fp_index]; - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING)) { BLOGW(sc, "Interface not running, ignoring transmit request\n"); return (ENETDOWN); } - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { + if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE) { BLOGW(sc, "Interface TX queue is full, ignoring transmit request\n"); return (EBUSY); } @@ -6078,7 +6082,7 @@ bxe_tx_mq_start(struct ifnet *ifp, static void bxe_mq_flush(struct ifnet *ifp) { - struct bxe_softc *sc = ifp->if_softc; + struct bxe_softc *sc = if_getsoftc(ifp); struct bxe_fastpath *fp; struct mbuf *m; int i; @@ -6102,7 +6106,7 @@ bxe_mq_flush(struct ifnet *ifp) } } - if_qflush(ifp); + if_qflush_drv(ifp); } #endif /* FreeBSD_version >= 800000 */ @@ -6793,7 +6797,7 @@ bxe_alloc_fp_buffers(struct bxe_softc *s fp->rx_cq_prod = cqe_ring_prod; fp->eth_q_stats.rx_calls = fp->eth_q_stats.rx_pkts = 0; - if (sc->ifnet->if_capenable & IFCAP_LRO) { + if (if_getcapenable(sc->ifp) & IFCAP_LRO) { max_agg_queues = MAX_AGG_QS(sc); fp->tpa_enable = TRUE; @@ -8009,7 +8013,7 @@ bxe_drv_info_ether_stat(struct bxe_softc ether_stat->mtu_size = sc->mtu; ether_stat->feature_flags |= FEATURE_ETH_CHKSUM_OFFLOAD_MASK; - if (sc->ifnet->if_capenable & (IFCAP_TSO4 | IFCAP_TSO6)) { + if (if_getcapenable(sc->ifp) & (IFCAP_TSO4 | IFCAP_TSO6)) { ether_stat->feature_flags |= FEATURE_ETH_LSO_MASK; } @@ -9040,7 +9044,7 @@ bxe_handle_fp_tq(void *context, * can use to tell the task here not to do anything. */ #if 0 - if (!(sc->ifnet->if_drv_flags & IFF_DRV_RUNNING)) { + if (!(if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING)) { return; } #endif @@ -10602,7 +10606,7 @@ bxe_pf_init(struct bxe_softc *sc) * This flag is relevant for E1x only. * E2 doesn't have a TPA configuration in a function level. */ - flags |= (sc->ifnet->if_capenable & IFCAP_LRO) ? FUNC_FLG_TPA : 0; + flags |= (if_getcapenable(sc->ifp) & IFCAP_LRO) ? FUNC_FLG_TPA : 0; func_init.func_flgs = flags; func_init.pf_id = SC_FUNC(sc); @@ -11659,7 +11663,7 @@ bxe_get_q_flags(struct bxe_softc *sc, bxe_set_bit(ECORE_Q_FLG_OV, &flags); } - if (sc->ifnet->if_capenable & IFCAP_LRO) { + if (if_getcapenable(sc->ifp) & IFCAP_LRO) { bxe_set_bit(ECORE_Q_FLG_TPA, &flags); bxe_set_bit(ECORE_Q_FLG_TPA_IPV6, &flags); #if 0 @@ -11708,7 +11712,7 @@ bxe_pf_rx_q_prep(struct bxe_softc uint16_t sge_sz = 0; uint16_t tpa_agg_size = 0; - if (sc->ifnet->if_capenable & IFCAP_LRO) { + if (if_getcapenable(sc->ifp) & IFCAP_LRO) { pause->sge_th_lo = SGE_TH_LO(sc); pause->sge_th_hi = SGE_TH_HI(sc); @@ -12257,7 +12261,7 @@ bxe_link_report_locked(struct bxe_softc if (bxe_test_bit(BXE_LINK_REPORT_LINK_DOWN, &cur_data.link_report_flags)) { - if_link_state_change(sc->ifnet, LINK_STATE_DOWN); + if_linkstate_change_drv(sc->ifp, LINK_STATE_DOWN); BLOGI(sc, "NIC Link is Down\n"); } else { const char *duplex; @@ -12298,7 +12302,7 @@ bxe_link_report_locked(struct bxe_softc flow = "none"; } - if_link_state_change(sc->ifnet, LINK_STATE_UP); + if_linkstate_change_drv(sc->ifp, LINK_STATE_UP); BLOGI(sc, "NIC Link is Up, %d Mbps %s duplex, Flow control: %s\n", cur_data.line_speed, duplex, flow); } @@ -12468,19 +12472,14 @@ static int bxe_init_mcast_macs_list(struct bxe_softc *sc, struct ecore_mcast_ramrod_params *p) { - struct ifnet *ifp = sc->ifnet; + if_t ifp = sc->ifp; int mc_count = 0; - struct ifmultiaddr *ifma; + int mcnt, i; struct ecore_mcast_list_elem *mc_mac; + unsigned char *mta; - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) { - continue; - } - - mc_count++; - } - + mc_count = if_multiaddr_count(ifp, -1);/* XXX they don't have a limit */ + /* should we enforce one? */ ECORE_LIST_INIT(&p->mcast_list); p->mcast_list_len = 0; @@ -12488,19 +12487,27 @@ bxe_init_mcast_macs_list(struct bxe_soft return (0); } + mta = malloc(sizeof(unsigned char) * ETHER_ADDR_LEN * + mc_count, M_DEVBUF, M_NOWAIT); + + if(mta == NULL) { + BLOGE(sc, "Failed to allocate temp mcast list\n"); + return (-1); + } + mc_mac = malloc(sizeof(*mc_mac) * mc_count, M_DEVBUF, (M_NOWAIT | M_ZERO)); if (!mc_mac) { + free(mta, M_DEVBUF); BLOGE(sc, "Failed to allocate temp mcast list\n"); return (-1); } - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) { - continue; - } + if_multiaddr_array(ifp, mta, &mcnt, mc_count); /* mta and mcnt not expected + to be different */ + for(i=0; i< mcnt; i++) { - mc_mac->mac = (uint8_t *)LLADDR((struct sockaddr_dl *)ifma->ifma_addr); + bcopy((mta + (i * ETHER_ADDR_LEN)), mc_mac->mac, ETHER_ADDR_LEN); ECORE_LIST_PUSH_TAIL(&mc_mac->link, &p->mcast_list); BLOGD(sc, DBG_LOAD, @@ -12512,6 +12519,7 @@ bxe_init_mcast_macs_list(struct bxe_soft } p->mcast_list_len = mc_count; + free(mta, M_DEVBUF); return (0); } @@ -12571,7 +12579,7 @@ bxe_set_mc_list(struct bxe_softc *sc) static int bxe_set_uc_list(struct bxe_softc *sc) { - struct ifnet *ifp = sc->ifnet; + if_t ifp = sc->ifp; struct ecore_vlan_mac_obj *mac_obj = &sc->sp_objs->mac_obj; struct ifaddr *ifa; unsigned long ramrod_flags = 0; @@ -12580,7 +12588,7 @@ bxe_set_uc_list(struct bxe_softc *sc) #if __FreeBSD_version < 800000 IF_ADDR_LOCK(ifp); #else - if_addr_rlock(ifp); + if_addr_rlock_drv(ifp); #endif /* first schedule a cleanup up of old configuration */ @@ -12590,12 +12598,12 @@ bxe_set_uc_list(struct bxe_softc *sc) #if __FreeBSD_version < 800000 IF_ADDR_UNLOCK(ifp); #else - if_addr_runlock(ifp); + if_addr_runlock_drv(ifp); #endif return (rc); } - ifa = ifp->if_addr; + ifa = if_getifaddr(ifp); /* XXX Is this structure */ while (ifa) { if (ifa->ifa_addr->sa_family != AF_LINK) { ifa = TAILQ_NEXT(ifa, ifa_link); @@ -12613,7 +12621,7 @@ bxe_set_uc_list(struct bxe_softc *sc) #if __FreeBSD_version < 800000 IF_ADDR_UNLOCK(ifp); #else - if_addr_runlock(ifp); + if_addr_runlock_drv(ifp); #endif return (rc); } @@ -12624,7 +12632,7 @@ bxe_set_uc_list(struct bxe_softc *sc) #if __FreeBSD_version < 800000 IF_ADDR_UNLOCK(ifp); #else - if_addr_runlock(ifp); + if_addr_runlock_drv(ifp); #endif /* Execute the pending commands */ @@ -12638,7 +12646,7 @@ bxe_handle_rx_mode_tq(void *context, int pending) { struct bxe_softc *sc = (struct bxe_softc *)context; - struct ifnet *ifp = sc->ifnet; + if_t ifp = sc->ifp; uint32_t rx_mode = BXE_RX_MODE_NORMAL; BXE_CORE_LOCK(sc); @@ -12649,12 +12657,12 @@ bxe_handle_rx_mode_tq(void *context, return; } - BLOGD(sc, DBG_SP, "ifp->if_flags=0x%x\n", ifp->if_flags); + BLOGD(sc, DBG_SP, "if_flags(ifp)=0x%x\n", if_getflags(sc->ifp)); - if (ifp->if_flags & IFF_PROMISC) { + if (if_getflags(ifp) & IFF_PROMISC) { rx_mode = BXE_RX_MODE_PROMISC; - } else if ((ifp->if_flags & IFF_ALLMULTI) || - ((ifp->if_amcount > BXE_MAX_MULTICAST) && + } else if ((if_getflags(ifp) & IFF_ALLMULTI) || + ((if_getamcount(ifp) > BXE_MAX_MULTICAST) && CHIP_IS_E1(sc))) { rx_mode = BXE_RX_MODE_ALLMULTI; } else { @@ -13101,7 +13109,7 @@ bxe_nic_load(struct bxe_softc *sc, #endif /* Tell the stack the driver is running! */ - sc->ifnet->if_drv_flags = IFF_DRV_RUNNING; + if_setdrvflags(sc->ifp, IFF_DRV_RUNNING); BLOGD(sc, DBG_LOAD, "NIC successfully loaded\n"); @@ -13154,7 +13162,7 @@ bxe_init_locked(struct bxe_softc *sc) BXE_CORE_LOCK_ASSERT(sc); /* check if the driver is already running */ - if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) { + if (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) { BLOGD(sc, DBG_LOAD, "Init called while driver is running!\n"); return (0); } @@ -13219,7 +13227,7 @@ bxe_init_locked_done: /* Tell the stack the driver is NOT running! */ BLOGE(sc, "Initialization failed, " "stack notified driver is NOT running!\n"); - sc->ifnet->if_drv_flags &= ~IFF_DRV_RUNNING; + if_setdrvflagbits(sc->ifp, 0, IFF_DRV_RUNNING); } return (rc); @@ -13252,7 +13260,8 @@ bxe_init(void *xsc) static int bxe_init_ifnet(struct bxe_softc *sc) { - struct ifnet *ifp; + if_t ifp; + int capabilities; /* ifconfig entrypoint for media type/status reporting */ ifmedia_init(&sc->ifmedia, IFM_IMASK, @@ -13267,32 +13276,33 @@ bxe_init_ifnet(struct bxe_softc *sc) sc->ifmedia.ifm_media = sc->ifmedia.ifm_cur->ifm_media; /* XXX ? */ /* allocate the ifnet structure */ - if ((ifp = if_alloc(IFT_ETHER)) == NULL) { + if ((ifp = if_gethandle(IFT_ETHER)) == NULL) { BLOGE(sc, "Interface allocation failed!\n"); return (ENXIO); } - ifp->if_softc = sc; - if_initname(ifp, device_get_name(sc->dev), device_get_unit(sc->dev)); - ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); - ifp->if_ioctl = bxe_ioctl; - ifp->if_start = bxe_tx_start; + if_setsoftc(ifp, sc); + if_initname_drv(ifp, device_get_name(sc->dev), device_get_unit(sc->dev)); + if_setflags(ifp, (IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST)); + if_setioctlfn(ifp, bxe_ioctl); + if_setstartfn(ifp, bxe_tx_start); #if __FreeBSD_version >= 800000 - ifp->if_transmit = bxe_tx_mq_start; - ifp->if_qflush = bxe_mq_flush; + if_settransmitfn(ifp, bxe_tx_mq_start); + if_setqflushfn(ifp, bxe_mq_flush); #endif #ifdef FreeBSD8_0 - ifp->if_timer = 0; + if_settimer(ifp, 0); #endif - ifp->if_init = bxe_init; - ifp->if_mtu = sc->mtu; - ifp->if_hwassist = (CSUM_IP | + if_setinitfn(ifp, bxe_init); + if_setmtu(ifp, sc->mtu); + if_sethwassist(ifp, (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_TSO | CSUM_TCP_IPV6 | - CSUM_UDP_IPV6); - ifp->if_capabilities = + CSUM_UDP_IPV6)); + + capabilities = #if __FreeBSD_version < 700000 (IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | @@ -13312,18 +13322,17 @@ bxe_init_ifnet(struct bxe_softc *sc) IFCAP_TSO6 | IFCAP_WOL_MAGIC); #endif - ifp->if_capenable = ifp->if_capabilities; - ifp->if_capenable &= ~IFCAP_WOL_MAGIC; /* XXX not yet... */ - ifp->if_baudrate = IF_Gbps(10); - ifp->if_snd.ifq_drv_maxlen = sc->tx_ring_size; - - IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); - IFQ_SET_READY(&ifp->if_snd); + if_setcapabilitiesbit(ifp, capabilities, 0); /* XXX */ + if_setbaudrate(ifp, IF_Gbps(10)); +/* XXX */ + if_setsendqlen(ifp, sc->tx_ring_size); + if_setsendqready(ifp); +/* XXX */ - sc->ifnet = ifp; + sc->ifp = ifp; /* attach to the Ethernet interface list */ - ether_ifattach(ifp, sc->link_params.mac_addr); + ether_ifattach_drv(ifp, sc->link_params.mac_addr); return (0); } @@ -15182,7 +15191,7 @@ bxe_alloc_hsi_mem(struct bxe_softc *sc) /***********************/ /* set required sizes before mapping to conserve resources */ - if (sc->ifnet->if_capenable & (IFCAP_TSO4 | IFCAP_TSO6)) { + if (if_getcapenable(sc->ifp) & (IFCAP_TSO4 | IFCAP_TSO6)) { max_size = BXE_TSO_MAX_SIZE; max_segments = BXE_TSO_MAX_SEGMENTS; max_seg_size = BXE_TSO_MAX_SEG_SIZE; @@ -16388,8 +16397,8 @@ bxe_attach(device_t dev) /* allocate device interrupts */ if (bxe_interrupt_alloc(sc) != 0) { - if (sc->ifnet != NULL) { - ether_ifdetach(sc->ifnet); + if (sc->ifp != NULL) { + ether_ifdetach_drv(sc->ifp); } ifmedia_removeall(&sc->ifmedia); bxe_release_mutexes(sc); @@ -16401,8 +16410,8 @@ bxe_attach(device_t dev) /* allocate ilt */ if (bxe_alloc_ilt_mem(sc) != 0) { bxe_interrupt_free(sc); - if (sc->ifnet != NULL) { - ether_ifdetach(sc->ifnet); + if (sc->ifp != NULL) { + ether_ifdetach_drv(sc->ifp); } ifmedia_removeall(&sc->ifmedia); bxe_release_mutexes(sc); @@ -16415,8 +16424,8 @@ bxe_attach(device_t dev) if (bxe_alloc_hsi_mem(sc) != 0) { bxe_free_ilt_mem(sc); bxe_interrupt_free(sc); - if (sc->ifnet != NULL) { - ether_ifdetach(sc->ifnet); + if (sc->ifp != NULL) { + ether_ifdetach_drv(sc->ifp); } ifmedia_removeall(&sc->ifmedia); bxe_release_mutexes(sc); @@ -16474,14 +16483,14 @@ static int bxe_detach(device_t dev) { struct bxe_softc *sc; - struct ifnet *ifp; + if_t ifp; sc = device_get_softc(dev); BLOGD(sc, DBG_LOAD, "Starting detach...\n"); - ifp = sc->ifnet; - if (ifp != NULL && ifp->if_vlantrunk != NULL) { + ifp = sc->ifp; + if (ifp != NULL && if_vlantrunkinuse(ifp)) { BLOGE(sc, "Cannot detach while VLANs are in use.\n"); return(EBUSY); } @@ -16506,7 +16515,7 @@ bxe_detach(device_t dev) /* release the network interface */ if (ifp != NULL) { - ether_ifdetach(ifp); + ether_ifdetach_drv(ifp); } ifmedia_removeall(&sc->ifmedia); @@ -16528,8 +16537,8 @@ bxe_detach(device_t dev) bxe_deallocate_bars(sc); /* Release the FreeBSD interface. */ - if (sc->ifnet != NULL) { - if_free(sc->ifnet); + if (sc->ifp != NULL) { + if_free_drv(sc->ifp); } pci_disable_busmaster(dev); Modified: head/sys/dev/bxe/bxe.h ============================================================================== --- head/sys/dev/bxe/bxe.h Mon Jun 2 18:52:03 2014 (r266978) +++ head/sys/dev/bxe/bxe.h Mon Jun 2 18:54:45 2014 (r266979) @@ -57,8 +57,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include #include #include @@ -1367,9 +1367,9 @@ enum { struct bxe_softc { /* * First entry must be a pointer to the BSD ifnet struct which - * has a first element of 'void *if_softc' (which is us). + * has a first element of 'void *if_softc' (which is us). XXX */ - struct ifnet *ifnet; + if_t ifp; struct ifmedia ifmedia; /* network interface media structure */ int media; @@ -1528,22 +1528,22 @@ struct bxe_softc { #define BXE_MCAST_LOCK(sc) \ do { \ mtx_lock(&sc->mcast_mtx); \ - IF_ADDR_LOCK(sc->ifnet); \ + IF_ADDR_LOCK(sc->ifp); \ } while (0) #define BXE_MCAST_UNLOCK(sc) \ do { \ - IF_ADDR_UNLOCK(sc->ifnet); \ + IF_ADDR_UNLOCK(sc->ifp); \ mtx_unlock(&sc->mcast_mtx); \ } while (0) #else #define BXE_MCAST_LOCK(sc) \ do { \ mtx_lock(&sc->mcast_mtx); \ - if_maddr_rlock(sc->ifnet); \ + if_maddr_rlock(sc->ifp); \ } while (0) #define BXE_MCAST_UNLOCK(sc) \ do { \ - if_maddr_runlock(sc->ifnet); \ + if_maddr_runlock(sc->ifp); \ mtx_unlock(&sc->mcast_mtx); \ } while (0) #endif Modified: head/sys/dev/bxe/bxe_debug.c ============================================================================== --- head/sys/dev/bxe/bxe_debug.c Mon Jun 2 18:52:03 2014 (r266978) +++ head/sys/dev/bxe/bxe_debug.c Mon Jun 2 18:54:45 2014 (r266979) @@ -299,7 +299,7 @@ static void bxe_ddb(db_expr_t blah1, char *blah4) { char if_xname[IFNAMSIZ]; - struct ifnet *ifp = NULL; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 19:03:26 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2841696F; Mon, 2 Jun 2014 19:03:26 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC1CA290D; Mon, 2 Jun 2014 19:03:25 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WrXVz-0007OQ-Tp; Mon, 02 Jun 2014 19:03:24 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s52J3LSd001479; Mon, 2 Jun 2014 13:03:21 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19DuxAVEfg7vh6lIZf8HVK5 Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net From: Ian Lepore To: Marcel Moolenaar In-Reply-To: References: <201406021754.s52Hsd1B039620@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Mon, 02 Jun 2014 13:03:21 -0600 Message-ID: <1401735801.20883.103.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , Adrian Chadd , Marcel Moolenaar , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 19:03:26 -0000 On Mon, 2014-06-02 at 11:42 -0700, Marcel Moolenaar wrote: > On Jun 2, 2014, at 11:27 AM, Adrian Chadd wrote: > > > .. and actually, bikeshedding for a moment, would we be able to move a > > lot of these accessor methods over to inlines? Would that break the > > Juniper way of doing things? > > That would definitely break Juniper as it doesn't give a stable > ABI. > > I've suggested an approach that allows for both, but it was deemed > unnecessary. The argument being that the function call overhead is > negligible. > > We can always revisit that decision if needed... > In my experience, function call overhead is anything but minimal, especially on ARM platforms. -- Ian From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 19:27:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC913FB3; Mon, 2 Jun 2014 19:27:48 +0000 (UTC) Received: from mail-qa0-x233.google.com (mail-qa0-x233.google.com [IPv6:2607:f8b0:400d:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 470DF2B24; Mon, 2 Jun 2014 19:27:48 +0000 (UTC) Received: by mail-qa0-f51.google.com with SMTP id w8so3451217qac.10 for ; Mon, 02 Jun 2014 12:27:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=kz277CSPOZZwUhW3b5+TjXbivv57pTSnSEOEM7S1gj4=; b=j17Aaxa8MUTlwQz8T3G7uV7TVfm/oCVa7XvIyjbx0Fe7uOxsm3dl3C0IhYPbnh13ec dtrke/GNDzL5iofN8LjLmlp1malqkd5LY/jeeoqR+KdAWjbEAz+xgRdIH7ESNFvz6wqN cn6jNIwWvzl6DMEgg04Rxif8tqzygE9DIGEChwgNGZBcNbZOkDrGDTcJ7QevALKE06TV r3hWoPuxS33FB9mUBRoisTTaCNRMYzlOPyKpdo0ELguLai8HpA0dDYpcWI591LFXGydc UcNegjwRUFAWkGz++samP/Fh+FeuNj+Gk1ABW6iWt6mvaN/2CC62KLONXLrNue2YaG7I H9tg== MIME-Version: 1.0 X-Received: by 10.140.22.209 with SMTP id 75mr48696450qgn.4.1401737267479; Mon, 02 Jun 2014 12:27:47 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.43.134 with HTTP; Mon, 2 Jun 2014 12:27:47 -0700 (PDT) In-Reply-To: <1401735801.20883.103.camel@revolution.hippie.lan> References: <201406021754.s52Hsd1B039620@svn.freebsd.org> <1401735801.20883.103.camel@revolution.hippie.lan> Date: Mon, 2 Jun 2014 12:27:47 -0700 X-Google-Sender-Auth: Jix-BtB6BabmHe9Ue5W7dsqvC7c Message-ID: Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net From: Adrian Chadd To: Ian Lepore Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Marcel Moolenaar , "src-committers@freebsd.org" , Marcel Moolenaar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 19:27:48 -0000 On 2 June 2014 12:03, Ian Lepore wrote: > On Mon, 2014-06-02 at 11:42 -0700, Marcel Moolenaar wrote: >> On Jun 2, 2014, at 11:27 AM, Adrian Chadd wrote: >> >> > .. and actually, bikeshedding for a moment, would we be able to move a >> > lot of these accessor methods over to inlines? Would that break the >> > Juniper way of doing things? >> >> That would definitely break Juniper as it doesn't give a stable >> ABI. >> >> I've suggested an approach that allows for both, but it was deemed >> unnecessary. The argument being that the function call overhead is >> negligible. >> >> We can always revisit that decision if needed... >> > > In my experience, function call overhead is anything but minimal, > especially on ARM platforms. Same on MIPS. -a From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 19:53:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00AC37D9; Mon, 2 Jun 2014 19:53:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E04F62DD9; Mon, 2 Jun 2014 19:53:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s52JrsAH093330; Mon, 2 Jun 2014 19:53:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s52JrsMu093323; Mon, 2 Jun 2014 19:53:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406021953.s52JrsMu093323@svn.freebsd.org> From: Alexander Motin Date: Mon, 2 Jun 2014 19:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266981 - in head/sys: cam/scsi compat/freebsd32 compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 19:53:55 -0000 Author: mav Date: Mon Jun 2 19:53:53 2014 New Revision: 266981 URL: http://svnweb.freebsd.org/changeset/base/266981 Log: Overhaul CAM SG driver IOCTL interfaces. Make it really work for native FreeBSD programs. Before this it was broken for years due to different number of pointer dereferences in Linux and FreeBSD IOCTL paths, permanently returning errors to FreeBSD programs. This change breaks the driver FreeBSD IOCTL ABI, making it more strict, but since it was not working any way -- who bother. Add shims for 32-bit programs on 64-bit host, translating the argument of the SG_IO IOCTL for both FreeBSD and Linux ABIs. With this change I was able to run 32-bit Linux sg3_utils tools and simple 32 and 64-bit FreeBSD test tools on both 32 and 64-bit FreeBSD systems. MFC after: 1 month Modified: head/sys/cam/scsi/scsi_sg.c head/sys/cam/scsi/scsi_sg.h head/sys/compat/freebsd32/freebsd32_ioctl.c head/sys/compat/freebsd32/freebsd32_ioctl.h head/sys/compat/linux/linux_ioctl.c Modified: head/sys/cam/scsi/scsi_sg.c ============================================================================== --- head/sys/cam/scsi/scsi_sg.c Mon Jun 2 19:28:11 2014 (r266980) +++ head/sys/cam/scsi/scsi_sg.c Mon Jun 2 19:53:53 2014 (r266981) @@ -494,7 +494,7 @@ sgioctl(struct cdev *dev, u_long cmd, ca struct ccb_scsiio *csio; struct cam_periph *periph; struct sg_softc *softc; - struct sg_io_hdr req; + struct sg_io_hdr *req; int dir, error; periph = (struct cam_periph *)dev->si_drv1; @@ -507,40 +507,22 @@ sgioctl(struct cdev *dev, u_long cmd, ca error = 0; switch (cmd) { - case LINUX_SCSI_GET_BUS_NUMBER: { - int busno; - - busno = xpt_path_path_id(periph->path); - error = copyout(&busno, arg, sizeof(busno)); - break; - } - case LINUX_SCSI_GET_IDLUN: { - struct scsi_idlun idlun; - struct cam_sim *sim; + case SG_GET_VERSION_NUM: + { + int *version = (int *)arg; - idlun.dev_id = xpt_path_target_id(periph->path); - sim = xpt_path_sim(periph->path); - idlun.host_unique_id = sim->unit_number; - error = copyout(&idlun, arg, sizeof(idlun)); + *version = sg_version; break; } - case SG_GET_VERSION_NUM: - case LINUX_SG_GET_VERSION_NUM: - error = copyout(&sg_version, arg, sizeof(sg_version)); - break; case SG_SET_TIMEOUT: - case LINUX_SG_SET_TIMEOUT: { - u_int user_timeout; + { + u_int user_timeout = *(u_int *)arg; - error = copyin(arg, &user_timeout, sizeof(u_int)); - if (error == 0) { - softc->sg_user_timeout = user_timeout; - softc->sg_timeout = user_timeout / SG_DEFAULT_HZ * hz; - } + softc->sg_user_timeout = user_timeout; + softc->sg_timeout = user_timeout / SG_DEFAULT_HZ * hz; break; } case SG_GET_TIMEOUT: - case LINUX_SG_GET_TIMEOUT: /* * The value is returned directly to the syscall. */ @@ -548,17 +530,14 @@ sgioctl(struct cdev *dev, u_long cmd, ca error = 0; break; case SG_IO: - case LINUX_SG_IO: - error = copyin(arg, &req, sizeof(req)); - if (error) - break; + req = (struct sg_io_hdr *)arg; - if (req.cmd_len > IOCDBLEN) { + if (req->cmd_len > IOCDBLEN) { error = EINVAL; break; } - if (req.iovec_count != 0) { + if (req->iovec_count != 0) { error = EOPNOTSUPP; break; } @@ -566,14 +545,14 @@ sgioctl(struct cdev *dev, u_long cmd, ca ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); csio = &ccb->csio; - error = copyin(req.cmdp, &csio->cdb_io.cdb_bytes, - req.cmd_len); + error = copyin(req->cmdp, &csio->cdb_io.cdb_bytes, + req->cmd_len); if (error) { xpt_release_ccb(ccb); break; } - switch(req.dxfer_direction) { + switch(req->dxfer_direction) { case SG_DXFER_TO_DEV: dir = CAM_DIR_OUT; break; @@ -594,62 +573,57 @@ sgioctl(struct cdev *dev, u_long cmd, ca sgdone, dir|CAM_DEV_QFRZDIS, MSG_SIMPLE_Q_TAG, - req.dxferp, - req.dxfer_len, - req.mx_sb_len, - req.cmd_len, - req.timeout); + req->dxferp, + req->dxfer_len, + req->mx_sb_len, + req->cmd_len, + req->timeout); error = sgsendccb(periph, ccb); if (error) { - req.host_status = DID_ERROR; - req.driver_status = DRIVER_INVALID; + req->host_status = DID_ERROR; + req->driver_status = DRIVER_INVALID; xpt_release_ccb(ccb); break; } - req.status = csio->scsi_status; - req.masked_status = (csio->scsi_status >> 1) & 0x7f; - sg_scsiio_status(csio, &req.host_status, &req.driver_status); - req.resid = csio->resid; - req.duration = csio->ccb_h.timeout; - req.info = 0; - - error = copyout(&req, arg, sizeof(req)); - if ((error == 0) && (csio->ccb_h.status & CAM_AUTOSNS_VALID) - && (req.sbp != NULL)) { - req.sb_len_wr = req.mx_sb_len - csio->sense_resid; - error = copyout(&csio->sense_data, req.sbp, - req.sb_len_wr); + req->status = csio->scsi_status; + req->masked_status = (csio->scsi_status >> 1) & 0x7f; + sg_scsiio_status(csio, &req->host_status, &req->driver_status); + req->resid = csio->resid; + req->duration = csio->ccb_h.timeout; + req->info = 0; + + if ((csio->ccb_h.status & CAM_AUTOSNS_VALID) + && (req->sbp != NULL)) { + req->sb_len_wr = req->mx_sb_len - csio->sense_resid; + error = copyout(&csio->sense_data, req->sbp, + req->sb_len_wr); } xpt_release_ccb(ccb); break; case SG_GET_RESERVED_SIZE: - case LINUX_SG_GET_RESERVED_SIZE: { - int size = 32768; - - error = copyout(&size, arg, sizeof(size)); + { + int *size = (int *)arg; + *size = DFLTPHYS; break; } case SG_GET_SCSI_ID: - case LINUX_SG_GET_SCSI_ID: { - struct sg_scsi_id id; - - id.host_no = cam_sim_path(xpt_path_sim(periph->path)); - id.channel = xpt_path_path_id(periph->path); - id.scsi_id = xpt_path_target_id(periph->path); - id.lun = xpt_path_lun_id(periph->path); - id.scsi_type = softc->pd_type; - id.h_cmd_per_lun = 1; - id.d_queue_depth = 1; - id.unused[0] = 0; - id.unused[1] = 0; + struct sg_scsi_id *id = (struct sg_scsi_id *)arg; - error = copyout(&id, arg, sizeof(id)); + id->host_no = cam_sim_path(xpt_path_sim(periph->path)); + id->channel = xpt_path_path_id(periph->path); + id->scsi_id = xpt_path_target_id(periph->path); + id->lun = xpt_path_lun_id(periph->path); + id->scsi_type = softc->pd_type; + id->h_cmd_per_lun = 1; + id->d_queue_depth = 1; + id->unused[0] = 0; + id->unused[1] = 0; break; } @@ -672,25 +646,6 @@ sgioctl(struct cdev *dev, u_long cmd, ca case SG_SET_COMMAND_Q: case SG_SET_DEBUG: case SG_NEXT_CMD_LEN: - case LINUX_SG_EMULATED_HOST: - case LINUX_SG_SET_TRANSFORM: - case LINUX_SG_GET_TRANSFORM: - case LINUX_SG_GET_NUM_WAITING: - case LINUX_SG_SCSI_RESET: - case LINUX_SG_GET_REQUEST_TABLE: - case LINUX_SG_SET_KEEP_ORPHAN: - case LINUX_SG_GET_KEEP_ORPHAN: - case LINUX_SG_GET_ACCESS_COUNT: - case LINUX_SG_SET_FORCE_LOW_DMA: - case LINUX_SG_GET_LOW_DMA: - case LINUX_SG_GET_SG_TABLESIZE: - case LINUX_SG_SET_FORCE_PACK_ID: - case LINUX_SG_GET_PACK_ID: - case LINUX_SG_SET_RESERVED_SIZE: - case LINUX_SG_GET_COMMAND_Q: - case LINUX_SG_SET_COMMAND_Q: - case LINUX_SG_SET_DEBUG: - case LINUX_SG_NEXT_CMD_LEN: default: #ifdef CAMDEBUG printf("sgioctl: rejecting cmd 0x%lx\n", cmd); Modified: head/sys/cam/scsi/scsi_sg.h ============================================================================== --- head/sys/cam/scsi/scsi_sg.h Mon Jun 2 19:28:11 2014 (r266980) +++ head/sys/cam/scsi/scsi_sg.h Mon Jun 2 19:53:53 2014 (r266981) @@ -8,31 +8,31 @@ #define _SCSI_SG_H #define SGIOC '"' -#define SG_SET_TIMEOUT _IO(SGIOC, 0x01) +#define SG_SET_TIMEOUT _IOW(SGIOC, 0x01, u_int) #define SG_GET_TIMEOUT _IO(SGIOC, 0x02) -#define SG_EMULATED_HOST _IO(SGIOC, 0x03) +#define SG_EMULATED_HOST _IOR(SGIOC, 0x03, int) #define SG_SET_TRANSFORM _IO(SGIOC, 0x04) #define SG_GET_TRANSFORM _IO(SGIOC, 0x05) -#define SG_GET_COMMAND_Q _IO(SGIOC, 0x70) -#define SG_SET_COMMAND_Q _IO(SGIOC, 0x71) -#define SG_GET_RESERVED_SIZE _IO(SGIOC, 0x72) -#define SG_SET_RESERVED_SIZE _IO(SGIOC, 0x75) -#define SG_GET_SCSI_ID _IO(SGIOC, 0x76) -#define SG_SET_FORCE_LOW_DMA _IO(SGIOC, 0x79) -#define SG_GET_LOW_DMA _IO(SGIOC, 0x7a) -#define SG_SET_FORCE_PACK_ID _IO(SGIOC, 0x7b) -#define SG_GET_PACK_ID _IO(SGIOC, 0x7c) -#define SG_GET_NUM_WAITING _IO(SGIOC, 0x7d) -#define SG_SET_DEBUG _IO(SGIOC, 0x7e) -#define SG_GET_SG_TABLESIZE _IO(SGIOC, 0x7f) -#define SG_GET_VERSION_NUM _IO(SGIOC, 0x82) -#define SG_NEXT_CMD_LEN _IO(SGIOC, 0x83) -#define SG_SCSI_RESET _IO(SGIOC, 0x84) -#define SG_IO _IO(SGIOC, 0x85) +#define SG_GET_COMMAND_Q _IOW(SGIOC, 0x70, int) +#define SG_SET_COMMAND_Q _IOR(SGIOC, 0x71, int) +#define SG_GET_RESERVED_SIZE _IOR(SGIOC, 0x72, int) +#define SG_SET_RESERVED_SIZE _IOW(SGIOC, 0x75, int) +#define SG_GET_SCSI_ID _IOR(SGIOC, 0x76, struct sg_scsi_id) +#define SG_SET_FORCE_LOW_DMA _IOW(SGIOC, 0x79, int) +#define SG_GET_LOW_DMA _IOR(SGIOC, 0x7a, int) +#define SG_SET_FORCE_PACK_ID _IOW(SGIOC, 0x7b, int) +#define SG_GET_PACK_ID _IOR(SGIOC, 0x7c, int) +#define SG_GET_NUM_WAITING _IOR(SGIOC, 0x7d, int) +#define SG_SET_DEBUG _IOW(SGIOC, 0x7e, int) +#define SG_GET_SG_TABLESIZE _IOR(SGIOC, 0x7f, int) +#define SG_GET_VERSION_NUM _IOR(SGIOC, 0x82, int) +#define SG_NEXT_CMD_LEN _IOW(SGIOC, 0x83, int) +#define SG_SCSI_RESET _IOW(SGIOC, 0x84, int) +#define SG_IO _IOWR(SGIOC, 0x85, struct sg_io_hdr) #define SG_GET_REQUEST_TABLE _IO(SGIOC, 0x86) -#define SG_SET_KEEP_ORPHAN _IO(SGIOC, 0x87) -#define SG_GET_KEEP_ORPHAN _IO(SGIOC, 0x88) -#define SG_GET_ACCESS_COUNT _IO(SGIOC, 0x89) +#define SG_SET_KEEP_ORPHAN _IOW(SGIOC, 0x87, int) +#define SG_GET_KEEP_ORPHAN _IOR(SGIOC, 0x88, int) +#define SG_GET_ACCESS_COUNT _IOR(SGIOC, 0x89, int) struct sg_io_hdr { int interface_id; @@ -59,6 +59,31 @@ struct sg_io_hdr { u_int info; }; +struct sg_io_hdr32 { + int interface_id; + int dxfer_direction; + u_char cmd_len; + u_char mx_sb_len; + u_short iovec_count; + u_int dxfer_len; + uint32_t dxferp; + uint32_t cmdp; + uint32_t sbp; + u_int timeout; + u_int flags; + int pack_id; + uint32_t usr_ptr; + u_char status; + u_char masked_status; + u_char msg_status; + u_char sb_len_wr; + u_short host_status; + u_short driver_status; + int resid; + u_int duration; + u_int info; +}; + #define SG_DXFER_NONE -1 #define SG_DXFER_TO_DEV -2 #define SG_DXFER_FROM_DEV -3 Modified: head/sys/compat/freebsd32/freebsd32_ioctl.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_ioctl.c Mon Jun 2 19:28:11 2014 (r266980) +++ head/sys/compat/freebsd32/freebsd32_ioctl.c Mon Jun 2 19:53:53 2014 (r266981) @@ -344,6 +344,71 @@ cleanup: return (error); } +static int +freebsd32_ioctl_sg(struct thread *td, + struct freebsd32_ioctl_args *uap, struct file *fp) +{ + struct sg_io_hdr io; + struct sg_io_hdr32 io32; + int error; + + if ((error = copyin(uap->data, &io32, sizeof(io32))) != 0) + return (error); + + CP(io32, io, interface_id); + CP(io32, io, dxfer_direction); + CP(io32, io, cmd_len); + CP(io32, io, mx_sb_len); + CP(io32, io, iovec_count); + CP(io32, io, dxfer_len); + PTRIN_CP(io32, io, dxferp); + PTRIN_CP(io32, io, cmdp); + PTRIN_CP(io32, io, sbp); + CP(io32, io, timeout); + CP(io32, io, flags); + CP(io32, io, pack_id); + PTRIN_CP(io32, io, usr_ptr); + CP(io32, io, status); + CP(io32, io, masked_status); + CP(io32, io, msg_status); + CP(io32, io, sb_len_wr); + CP(io32, io, host_status); + CP(io32, io, driver_status); + CP(io32, io, resid); + CP(io32, io, duration); + CP(io32, io, info); + + if ((error = fo_ioctl(fp, SG_IO, (caddr_t)&io, td->td_ucred, td)) != 0) + return (error); + + CP(io, io32, interface_id); + CP(io, io32, dxfer_direction); + CP(io, io32, cmd_len); + CP(io, io32, mx_sb_len); + CP(io, io32, iovec_count); + CP(io, io32, dxfer_len); + PTROUT_CP(io, io32, dxferp); + PTROUT_CP(io, io32, cmdp); + PTROUT_CP(io, io32, sbp); + CP(io, io32, timeout); + CP(io, io32, flags); + CP(io, io32, pack_id); + PTROUT_CP(io, io32, usr_ptr); + CP(io, io32, status); + CP(io, io32, masked_status); + CP(io, io32, msg_status); + CP(io, io32, sb_len_wr); + CP(io, io32, host_status); + CP(io, io32, driver_status); + CP(io, io32, resid); + CP(io, io32, duration); + CP(io, io32, info); + + error = copyout(&io32, uap->data, sizeof(io32)); + + return (error); +} + int freebsd32_ioctl(struct thread *td, struct freebsd32_ioctl_args *uap) { @@ -393,6 +458,10 @@ freebsd32_ioctl(struct thread *td, struc error = freebsd32_ioctl_pciocgetconf(td, uap, fp); break; + case SG_IO_32: + error = freebsd32_ioctl_sg(td, uap, fp); + break; + default: fdrop(fp, td); ap.fd = uap->fd; Modified: head/sys/compat/freebsd32/freebsd32_ioctl.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_ioctl.h Mon Jun 2 19:28:11 2014 (r266980) +++ head/sys/compat/freebsd32/freebsd32_ioctl.h Mon Jun 2 19:53:53 2014 (r266981) @@ -32,6 +32,8 @@ #ifndef _COMPAT_FREEBSD32_IOCTL_H_ #define _COMPAT_FREEBSD32_IOCTL_H_ +#include + typedef __uint32_t caddr_t32; struct ioc_toc_header32 { @@ -122,5 +124,6 @@ struct pci_conf_io32 { #define MEMRANGE_GET32 _IOWR('m', 50, struct mem_range_op32) #define MEMRANGE_SET32 _IOW('m', 51, struct mem_range_op32) #define PCIOCGETCONF_32 _IOWR('p', 5, struct pci_conf_io32) +#define SG_IO_32 _IOWR(SGIOC, 0x85, struct sg_io_hdr32) #endif /* _COMPAT_FREEBSD32_IOCTL_H_ */ Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Mon Jun 2 19:28:11 2014 (r266980) +++ head/sys/compat/linux/linux_ioctl.c Mon Jun 2 19:53:53 2014 (r266981) @@ -92,6 +92,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + CTASSERT(LINUX_IFNAMSIZ == IFNAMSIZ); FEATURE(linuxulator_v4l, "V4L ioctl wrapper support in the linuxulator"); @@ -1646,9 +1648,32 @@ linux_ioctl_cdrom(struct thread *td, str } case LINUX_SCSI_GET_BUS_NUMBER: + { + struct sg_scsi_id id; + + error = fo_ioctl(fp, SG_GET_SCSI_ID, (caddr_t)&id, + td->td_ucred, td); + if (error) + break; + error = copyout(&id.channel, (void *)args->arg, sizeof(int)); + break; + } + case LINUX_SCSI_GET_IDLUN: - error = linux_ioctl_sg(td, args); + { + struct sg_scsi_id id; + struct scsi_idlun idl; + + error = fo_ioctl(fp, SG_GET_SCSI_ID, (caddr_t)&id, + td->td_ucred, td); + if (error) + break; + idl.dev_id = (id.scsi_id & 0xff) + ((id.lun & 0xff) << 8) + + ((id.channel & 0xff) << 16) + ((id.host_no & 0xff) << 24); + idl.host_unique_id = id.host_no; + error = copyout(&idl, (void *)args->arg, sizeof(idl)); break; + } /* LINUX_CDROM_SEND_PACKET */ /* LINUX_CDROM_NEXT_WRITABLE */ @@ -2618,12 +2643,20 @@ linux_ioctl_drm(struct thread *td, struc return sys_ioctl(td, (struct ioctl_args *)args); } +#ifdef COMPAT_LINUX32 +#define CP(src,dst,fld) do { (dst).fld = (src).fld; } while (0) +#define PTRIN_CP(src,dst,fld) \ + do { (dst).fld = PTRIN((src).fld); } while (0) +#define PTROUT_CP(src,dst,fld) \ + do { (dst).fld = PTROUT((src).fld); } while (0) + static int -linux_ioctl_sg(struct thread *td, struct linux_ioctl_args *args) +linux_ioctl_sg_io(struct thread *td, struct linux_ioctl_args *args) { + struct sg_io_hdr io; + struct sg_io_hdr32 io32; cap_rights_t rights; struct file *fp; - u_long cmd; int error; error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), &fp); @@ -2631,12 +2664,98 @@ linux_ioctl_sg(struct thread *td, struct printf("sg_linux_ioctl: fget returned %d\n", error); return (error); } - cmd = args->cmd; - error = (fo_ioctl(fp, cmd, (caddr_t)args->arg, td->td_ucred, td)); + if ((error = copyin((void *)args->arg, &io32, sizeof(io32))) != 0) + goto out; + + CP(io32, io, interface_id); + CP(io32, io, dxfer_direction); + CP(io32, io, cmd_len); + CP(io32, io, mx_sb_len); + CP(io32, io, iovec_count); + CP(io32, io, dxfer_len); + PTRIN_CP(io32, io, dxferp); + PTRIN_CP(io32, io, cmdp); + PTRIN_CP(io32, io, sbp); + CP(io32, io, timeout); + CP(io32, io, flags); + CP(io32, io, pack_id); + PTRIN_CP(io32, io, usr_ptr); + CP(io32, io, status); + CP(io32, io, masked_status); + CP(io32, io, msg_status); + CP(io32, io, sb_len_wr); + CP(io32, io, host_status); + CP(io32, io, driver_status); + CP(io32, io, resid); + CP(io32, io, duration); + CP(io32, io, info); + + if ((error = fo_ioctl(fp, SG_IO, (caddr_t)&io, td->td_ucred, td)) != 0) + goto out; + + CP(io, io32, interface_id); + CP(io, io32, dxfer_direction); + CP(io, io32, cmd_len); + CP(io, io32, mx_sb_len); + CP(io, io32, iovec_count); + CP(io, io32, dxfer_len); + PTROUT_CP(io, io32, dxferp); + PTROUT_CP(io, io32, cmdp); + PTROUT_CP(io, io32, sbp); + CP(io, io32, timeout); + CP(io, io32, flags); + CP(io, io32, pack_id); + PTROUT_CP(io, io32, usr_ptr); + CP(io, io32, status); + CP(io, io32, masked_status); + CP(io, io32, msg_status); + CP(io, io32, sb_len_wr); + CP(io, io32, host_status); + CP(io, io32, driver_status); + CP(io, io32, resid); + CP(io, io32, duration); + CP(io, io32, info); + + error = copyout(&io32, (void *)args->arg, sizeof(io32)); + +out: fdrop(fp, td); return (error); } +#endif + +static int +linux_ioctl_sg(struct thread *td, struct linux_ioctl_args *args) +{ + + switch (args->cmd) { + case LINUX_SG_GET_VERSION_NUM: + args->cmd = SG_GET_VERSION_NUM; + break; + case LINUX_SG_SET_TIMEOUT: + args->cmd = SG_SET_TIMEOUT; + break; + case LINUX_SG_GET_TIMEOUT: + args->cmd = SG_GET_TIMEOUT; + break; + case LINUX_SG_IO: + args->cmd = SG_IO; +#ifdef COMPAT_LINUX32 + return (linux_ioctl_sg_io(td, args)); +#endif + break; + case LINUX_SG_GET_RESERVED_SIZE: + args->cmd = SG_GET_RESERVED_SIZE; + break; + case LINUX_SG_GET_SCSI_ID: + args->cmd = SG_GET_SCSI_ID; + break; + default: + return (ENODEV); + } + return (sys_ioctl(td, (struct ioctl_args *)args)); +} /* * Video4Linux (V4L) ioctl handler From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 20:00:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFC49B9C for ; Mon, 2 Jun 2014 20:00:30 +0000 (UTC) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55A192E93 for ; Mon, 2 Jun 2014 20:00:29 +0000 (UTC) Received: by mail-lb0-f174.google.com with SMTP id n15so2809546lbi.5 for ; Mon, 02 Jun 2014 13:00:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=IYVEIAuY+l7oXV/fZawuQUGTNVRjvoHRxpYRXCj+ODA=; b=YyVpGyGROrGA6nTi8yfku98rckLUUfU0FaFeMQuqyzGNrwcOQW2UXwjQ8Nv6aOavpL ZVleFYJqGY+Ml6CeQLgFDPmFSpQ6pmeQW9nZuQNYbsAG0ysvU/DDD0egvb9eHgiAivFe kodmgW2dJokHKRAbVvfX4k3eClugdYABsvpRuqHHJ5Z6wTaSzV0o7jfl+F35jab6eSLc yH8RA9UfoJU/rp0APDHLF2qA+1AGdINmX9U0Yyle1B+IwOWBiDLGHIZWEAQsy7z+7RZ4 Dg8q26gEx2lRsBbK4DtxVZ1zcqxUSu2mLgLAGaJvzocsHyi06rhnBVq+zf4AHy0ag5UF kHZA== X-Gm-Message-State: ALoCoQm2srbXmWuh/sDP+PQdKLrOysP3duB4J2Ad+LcypCiqry0CFArcuR3Frz+jwri6OY3Jst8V X-Received: by 10.112.14.5 with SMTP id l5mr29125926lbc.12.1401738907913; Mon, 02 Jun 2014 12:55:07 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.124.8 with HTTP; Mon, 2 Jun 2014 12:54:47 -0700 (PDT) In-Reply-To: <201406021754.s52Hsd1B039620@svn.freebsd.org> References: <201406021754.s52Hsd1B039620@svn.freebsd.org> From: Juli Mallett Date: Mon, 2 Jun 2014 12:54:47 -0700 X-Google-Sender-Auth: 4GeIkYC_NgmUulTUOfN8XdcriNE Message-ID: Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 20:00:30 -0000 Marcel, On Mon, Jun 2, 2014 at 10:54 AM, Marcel Moolenaar wrote: > Author: marcel > Date: Mon Jun 2 17:54:39 2014 > New Revision: 266974 > URL: http://svnweb.freebsd.org/changeset/base/266974 > > Log: > Introduce a procedural interface to the ifnet structure. The new > interface allows the ifnet structure to be defined as an opaque > type in NIC drivers. This then allows the ifnet structure to be > changed without a need to change or recompile NIC drivers. > > Put differently, NIC drivers can be written and compiled once and > be used with different network stack implementations, provided of > course that those network stack implementations have an API and > ABI compatible interface. > > This commit introduces the 'if_t' type to replace 'struct ifnet *' > as the type of a network interface. The 'if_t' type is defined as > 'void *' to enable the compiler to perform type conversion to > 'struct ifnet *' and vice versa where needed and without warnings. > The functions that implement the API are the only functions that > need to have an explicit cast. > [...] > Submitted by: Anuranjan Shukla > Reviewed by: glebius@ > Obtained from: Juniper Networks, Inc. > Could you say a little bit about why so few reviewers? Also, why "if_t" rather than an opaque "struct ifnet" to minimize churn, and also not conflict with other "if_t" types one might be using in third-party kernel modules. It's a pretty general name, and that seems problematic. In general am enthused about this happening, just minor implementation concerns. Thanks, Juli. From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 20:50:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E893102; Mon, 2 Jun 2014 20:50:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B718236C; Mon, 2 Jun 2014 20:50:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s52Ko8Tv017029; Mon, 2 Jun 2014 20:50:08 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s52Ko8ZH017028; Mon, 2 Jun 2014 20:50:08 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201406022050.s52Ko8ZH017028@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 2 Jun 2014 20:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266983 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 20:50:09 -0000 Author: gnn Date: Mon Jun 2 20:50:08 2014 New Revision: 266983 URL: http://svnweb.freebsd.org/changeset/base/266983 Log: Add missing Ivy Bridge and Haswell events. Submitted by: Anton Rang MFC: 2 weeks Modified: head/sys/dev/hwpmc/pmc_events.h Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Mon Jun 2 20:23:41 2014 (r266982) +++ head/sys/dev/hwpmc/pmc_events.h Mon Jun 2 20:50:08 2014 (r266983) @@ -2573,6 +2573,7 @@ __PMC_EV_ALIAS("SIMD_INT_64.SHUFFLE_MOVE * Aliases for Haswell core PMC events */ #define __PMC_EV_ALIAS_HASWELL() \ +__PMC_EV_ALIAS_INTEL_ARCHITECTURAL() \ __PMC_EV_ALIAS("LD_BLOCKS.STORE_FORWARD", IAP_EVENT_03H_02H) \ __PMC_EV_ALIAS("MISALIGN_MEM_REF.LOADS", IAP_EVENT_05H_01H) \ __PMC_EV_ALIAS("MISALIGN_MEM_REF.STORES", IAP_EVENT_05H_02H) \ @@ -2794,6 +2795,7 @@ __PMC_EV_ALIAS("L2_LINES_OUT.DEMAND_DIRT #define __PMC_EV_ALIAS_IVYBRIDGE() \ +__PMC_EV_ALIAS_INTEL_ARCHITECTURAL() \ __PMC_EV_ALIAS("LD_BLOCKS.STORE_FORWARD", IAP_EVENT_03H_02H) \ __PMC_EV_ALIAS("MISALIGN_MEM_REF.LOADS", IAP_EVENT_05H_01H) \ __PMC_EV_ALIAS("MISALIGN_MEM_REF.STORES", IAP_EVENT_05H_02H) \ @@ -3002,6 +3004,7 @@ __PMC_EV_ALIAS("L2_LINES_OUT.PF_DIRTY", * Aliases for Ivy Bridge Xeon PMC events (325462-045US January 2013) */ #define __PMC_EV_ALIAS_IVYBRIDGE_XEON() \ +__PMC_EV_ALIAS_INTEL_ARCHITECTURAL() \ __PMC_EV_ALIAS("LD_BLOCKS.STORE_FORWARD", IAP_EVENT_03H_02H) \ __PMC_EV_ALIAS("MISALIGN_MEM_REF.LOADS", IAP_EVENT_05H_01H) \ __PMC_EV_ALIAS("MISALIGN_MEM_REF.STORES", IAP_EVENT_05H_02H) \ From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 20:51:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FB8A271; Mon, 2 Jun 2014 20:51:51 +0000 (UTC) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 204B423EA; Mon, 2 Jun 2014 20:51:50 +0000 (UTC) Received: from [172.29.2.230] ([66.129.239.13]) (authenticated bits=0) by mail.xcllnt.net (8.14.9/8.14.9) with ESMTP id s52Kpk1B011069 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 2 Jun 2014 13:51:48 -0700 (PDT) (envelope-from marcel@xcllnt.net) Content-Type: multipart/signed; boundary="Apple-Mail=_5CF7BD56-2034-4A33-9483-AAF01FFEC99B"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net From: Marcel Moolenaar In-Reply-To: Date: Mon, 2 Jun 2014 13:51:40 -0700 Message-Id: References: <201406021754.s52Hsd1B039620@svn.freebsd.org> To: Juli Mallett X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 20:51:51 -0000 --Apple-Mail=_5CF7BD56-2034-4A33-9483-AAF01FFEC99B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Jun 2, 2014, at 12:54 PM, Juli Mallett wrote: > Log: > Introduce a procedural interface to the ifnet structure. *snip* > Could you say a little bit about why so few reviewers? Sorry, my bad. The change was proposed and discussed on arch@ with pointers to the diff. Previous incarnations have been sent to net@ as well. I should have mentioned something along those lines. > Also, why "if_t" rather than an opaque "struct ifnet" to minimize = churn, and also not conflict with other "if_t" types one might be using = in third-party kernel modules. This has been covered on arch@ as well. It's probably best if I refer you to the email thread on arch@ so as to not pull emails out of context: http://lists.freebsd.org/pipermail/freebsd-arch/2014-May/015379.html > It's a pretty general name, and that seems problematic. In general = am enthused about this happening, just minor implementation concerns. It's appreciated. --=20 Marcel Moolenaar marcel@xcllnt.net --Apple-Mail=_5CF7BD56-2034-4A33-9483-AAF01FFEC99B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iEYEARECAAYFAlOM49wACgkQpgWlLWHuifbDrACggvPkO0bLhp+lwZn7b47Dusml YaoAoIiMz5ytsBqad08do0z88uWPcZ1S =W7x3 -----END PGP SIGNATURE----- --Apple-Mail=_5CF7BD56-2034-4A33-9483-AAF01FFEC99B-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 22:31:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7313CB8F; Mon, 2 Jun 2014 22:31:25 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C66F2BB4; Mon, 2 Jun 2014 22:31:25 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s52MVOfQ026864 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 2 Jun 2014 15:31:24 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s52MVOS1026863; Mon, 2 Jun 2014 15:31:24 -0700 (PDT) (envelope-from jmg) Date: Mon, 2 Jun 2014 15:31:24 -0700 From: John-Mark Gurney To: Ivan Voras Subject: Re: svn commit: r266972 - head/sbin/geom/class/label Message-ID: <20140602223124.GB43976@funkthat.com> References: <201406021505.s52F5P1D064451@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201406021505.s52F5P1D064451@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Mon, 02 Jun 2014 15:31:24 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 22:31:25 -0000 Ivan Voras wrote this message on Mon, Jun 02, 2014 at 15:05 +0000: > Author: ivoras > Date: Mon Jun 2 15:05:25 2014 > New Revision: 266972 > URL: http://svnweb.freebsd.org/changeset/base/266972 > > Log: > Document the diskid automatic label class. > While there, also document the glabel "native" labels and explain why > there are additional nodes created for nested GEOM classes. > > Reminded by: jmg Shouldn't kern.geom.label.disk_ident.enable also be documented here? Thanks! -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 22:58:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F15A500; Mon, 2 Jun 2014 22:58:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0B4E2DDE; Mon, 2 Jun 2014 22:58:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s52Mw0pm074225; Mon, 2 Jun 2014 22:58:00 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s52Mw01Y074224; Mon, 2 Jun 2014 22:58:00 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201406022258.s52Mw01Y074224@svn.freebsd.org> From: John-Mark Gurney Date: Mon, 2 Jun 2014 22:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266984 - head/usr.sbin/mixer X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 22:58:01 -0000 Author: jmg Date: Mon Jun 2 22:58:00 2014 New Revision: 266984 URL: http://svnweb.freebsd.org/changeset/base/266984 Log: add Xref to sound(4)... MFC after: 1 week Modified: head/usr.sbin/mixer/mixer.8 Modified: head/usr.sbin/mixer/mixer.8 ============================================================================== --- head/usr.sbin/mixer/mixer.8 Mon Jun 2 20:50:08 2014 (r266983) +++ head/usr.sbin/mixer/mixer.8 Mon Jun 2 22:58:00 2014 (r266984) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 14, 2008 +.Dd June 2, 2014 .Dt MIXER 8 .Os .Sh NAME @@ -161,7 +161,8 @@ as the mixer device. the default mixer device .El .Sh SEE ALSO -.Xr cdcontrol 1 +.Xr cdcontrol 1 , +.Xr sound 4 .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Mon Jun 2 23:50:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02E014F6; Mon, 2 Jun 2014 23:50:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E450B220F; Mon, 2 Jun 2014 23:50:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s52NoJVc096874; Mon, 2 Jun 2014 23:50:19 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s52NoJe1096873; Mon, 2 Jun 2014 23:50:19 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201406022350.s52NoJe1096873@svn.freebsd.org> From: John-Mark Gurney Date: Mon, 2 Jun 2014 23:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266985 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 23:50:20 -0000 Author: jmg Date: Mon Jun 2 23:50:19 2014 New Revision: 266985 URL: http://svnweb.freebsd.org/changeset/base/266985 Log: handle longer commands so that lines don't overflow... people who added commands forgot to check this... Modified: head/sys/ddb/db_command.c Modified: head/sys/ddb/db_command.c ============================================================================== --- head/sys/ddb/db_command.c Mon Jun 2 22:58:00 2014 (r266984) +++ head/sys/ddb/db_command.c Mon Jun 2 23:50:19 2014 (r266985) @@ -321,8 +321,8 @@ db_cmd_list(table) register struct command *cmd; LIST_FOREACH(cmd, table, next) { - db_printf("%-12s", cmd->name); - db_end_line(12); + db_printf("%-16s", cmd->name); + db_end_line(16); } } From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 00:58:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DAEEEA9D for ; Tue, 3 Jun 2014 00:58:38 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC73A2736 for ; Tue, 3 Jun 2014 00:58:38 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s530wcu3098925 for ; Tue, 3 Jun 2014 00:58:38 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s530wcON098921 for svn-src-head@freebsd.org; Tue, 3 Jun 2014 00:58:38 GMT (envelope-from bdrewery) Received: (qmail 38172 invoked from network); 2 Jun 2014 19:58:35 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 2 Jun 2014 19:58:35 -0500 Message-ID: <538D1DB7.7010508@FreeBSD.org> Date: Mon, 02 Jun 2014 19:58:31 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "Simon J. Gerraty" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r266760 - head/contrib/bmake References: <201405271839.s4RIdDq8055387@svn.freebsd.org> In-Reply-To: <201405271839.s4RIdDq8055387@svn.freebsd.org> X-Enigmail-Version: 1.6 OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sp2atufWPENE25jIM5uBICGDmKr8t2f9J" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 00:58:39 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --sp2atufWPENE25jIM5uBICGDmKr8t2f9J Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 5/27/2014 1:39 PM, Simon J. Gerraty wrote: > Author: sjg > Date: Tue May 27 18:39:13 2014 > New Revision: 266760 > URL: http://svnweb.freebsd.org/changeset/base/266760 >=20 > Log: > Portmgr no longer need the UL hack. > =20 > Reviewed by: obrien >=20 > Modified: > head/contrib/bmake/var.c >=20 Not sure if anyone cares, but this change breaks all ports tree checkouts from before 2014-05-05 on src head with this revision. You'll need http://svnweb.freebsd.org/ports?view=3Drevision&revision=3D352986 or= use fmake. It will manifest as: > # make -V PKGNAME > make: "/poudriere/ports/default/Mk/bsd.port.mk" line 4971: warning: dup= licate script for target "-depends" ignored > make: "/poudriere/ports/default/Mk/bsd.port.mk" line 4971: warning: usi= ng previous script for "-depends" defined here > make: "/poudriere/ports/default/Mk/bsd.port.mk" line 4971: warning: dup= licate script for target "-depends" ignored > make: "/poudriere/ports/default/Mk/bsd.port.mk" line 4971: warning: usi= ng previous script for "-depends" defined here > make: "/poudriere/ports/default/Mk/bsd.port.mk" line 4974: warning: dup= licate script for target "-depends" ignored > make: "/poudriere/ports/default/Mk/bsd.port.mk" line 4971: warning: usi= ng previous script for "-depends" defined here > make: "/poudriere/ports/default/Mk/bsd.port.mk" line 4971: warning: dup= licate script for target "-depends" ignored > make: "/poudriere/ports/default/Mk/bsd.port.mk" line 4971: warning: usi= ng previous script for "-depends" defined here > make: "/poudriere/ports/default/Mk/bsd.port.mk" line 4971: warning: dup= licate script for target "-depends" ignored > make: "/poudriere/ports/default/Mk/bsd.port.mk" line 4971: warning: usi= ng previous script for "-depends" defined here --=20 Regards, Bryan Drewery --sp2atufWPENE25jIM5uBICGDmKr8t2f9J Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJTjR24AAoJEDXXcbtuRpfPKXIIALpyAxJMD7NAU+4q+DiOGPYX e250yn9NeJZT4e8EVfy5UNqwzpcxL6dlOa4l1A6BL+n9B6Zfs92HJQ8a/bRxZ09f H7jJ1ZkjEE3rfQWMg6WJL6PBuB/w8wAbayaozF5x8rie/rgPQQD/Xk2iqxet0e3L JLr6yZcubkPIhMs70CzWkL8oLOru5Pm6BIdj8A2RUZl+2cggszzzh9D2PAWf8Vlz fkJQVygODrbqp10hSLKPjeGGapuscvE8vTLD4W6eSBkff/EfeocRzewg4hzLIjRz KqfRgq6CSQX0vD6EKdFypUu1OAj0YO4geKg8oplT0yKH1LqXnT3ZmrPxvY/Q9wk= =mRVt -----END PGP SIGNATURE----- --sp2atufWPENE25jIM5uBICGDmKr8t2f9J-- From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 01:29:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 755B5E07; Tue, 3 Jun 2014 01:29:46 +0000 (UTC) Received: from mail-pb0-x231.google.com (mail-pb0-x231.google.com [IPv6:2607:f8b0:400e:c01::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FE9929C3; Tue, 3 Jun 2014 01:29:46 +0000 (UTC) Received: by mail-pb0-f49.google.com with SMTP id jt11so4798926pbb.22 for ; Mon, 02 Jun 2014 18:29:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=ccOdxafiN2thqgxSYpIVvC2m/ttKpuuTs9cK17g6T3M=; b=nTWXvX3tw6FmRJHDq0HMXR/wFshn6TyoYZNeauIekpU5IjgqHOss0dgZ+jwl90h+ZT Ael0WW1rCp5PVwVcx+tBvAoFiIvIn9QJbU9m4H1fACODwYVQ5l7aG2Z0N1d56oQcuKm4 F9P3WJHSRQg2bo9f+XhIaQLK84XCzAnkjAxYUHeLt8n3Su226ewBrUqhyZ7ETXVgPW/f gMOujl3GxDpVb3zrorUfwKGmmeuXdeHiJmKjsfsvH3hLa9Y9VK8rfNLSknDovdO9YBMM yORfEhvK7IAZ8vKgZ/rH8yNqxMpGHoTsZ1atkD3YMZ++aVBTu33ejzqY1JojjIXAFQ/2 JV5A== X-Received: by 10.69.31.202 with SMTP id ko10mr40323878pbd.23.1401758985824; Mon, 02 Jun 2014 18:29:45 -0700 (PDT) Received: from pyunyh@gmail.com (lpe4.p59-icn.cdngp.net. [114.111.62.249]) by mx.google.com with ESMTPSA id io6sm71374717pac.44.2014.06.02.18.29.42 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 02 Jun 2014 18:29:45 -0700 (PDT) From: Yonghyeon PYUN X-Google-Original-From: "Yonghyeon PYUN" Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Tue, 03 Jun 2014 10:29:39 +0900 Date: Tue, 3 Jun 2014 10:29:39 +0900 To: Marcel Moolenaar Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net Message-ID: <20140603012939.GA2998@michelle.cdnetworks.com> Reply-To: pyunyh@gmail.com References: <201406021754.s52Hsd1B039620@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: "svn-src-head@freebsd.org" , Adrian Chadd , Marcel Moolenaar , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 01:29:46 -0000 On Mon, Jun 02, 2014 at 11:42:10AM -0700, Marcel Moolenaar wrote: > > On Jun 2, 2014, at 11:27 AM, Adrian Chadd wrote: > > > .. and actually, bikeshedding for a moment, would we be able to move a > > lot of these accessor methods over to inlines? Would that break the > > Juniper way of doing things? > > That would definitely break Juniper as it doesn't give a stable > ABI. > > I've suggested an approach that allows for both, but it was deemed > unnecessary. The argument being that the function call overhead is > negligible. > > We can always revisit that decision if needed... > The function call overheads shall show measurable differences on slow boxes. This change adds several function calls in driver's fast path(interrupt handler, packet statistics, checksum offloading checking and etc) and these functions would be called on every TX/RX packet. It would be great if there is a way to minimize function call overheads in fast path. From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 01:30:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88F70F45; Tue, 3 Jun 2014 01:30:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76F9029C9; Tue, 3 Jun 2014 01:30:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s531UXn7046171; Tue, 3 Jun 2014 01:30:33 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s531UXc7046170; Tue, 3 Jun 2014 01:30:33 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201406030130.s531UXc7046170@svn.freebsd.org> From: Kevin Lo Date: Tue, 3 Jun 2014 01:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266990 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 01:30:33 -0000 Author: kevlo Date: Tue Jun 3 01:30:32 2014 New Revision: 266990 URL: http://svnweb.freebsd.org/changeset/base/266990 Log: Fix build UDP-Lite with VIMAGE enabled when building with gcc. Reported and tested by: Jason Hellenthal Modified: head/sys/netinet/udp_var.h Modified: head/sys/netinet/udp_var.h ============================================================================== --- head/sys/netinet/udp_var.h Tue Jun 3 01:24:46 2014 (r266989) +++ head/sys/netinet/udp_var.h Tue Jun 3 01:30:32 2014 (r266990) @@ -126,6 +126,7 @@ void kmod_udpstat_inc(int statnum); #define UDPCTL_PCBLIST 5 /* list of PCBs for UDP sockets */ #ifdef _KERNEL +#include SYSCTL_DECL(_net_inet_udp); extern struct pr_usrreqs udp_usrreqs; From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 02:14:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 8D02B3B9; Tue, 3 Jun 2014 02:14:31 +0000 (UTC) Date: Tue, 3 Jun 2014 02:14:31 +0000 From: Alexey Dokuchaev To: Dmitry Chagin Subject: Re: svn commit: r266924 - head/sys/compat/linux Message-ID: <20140603021431.GE60685@FreeBSD.org> References: <201405311458.s4VEwrWY058828@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201405311458.s4VEwrWY058828@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 02:14:31 -0000 On Sat, May 31, 2014 at 02:58:53PM +0000, Dmitry Chagin wrote: > New Revision: 266924 > URL: http://svnweb.freebsd.org/changeset/base/266924 > > Log: > Glibc was switched to the FUTEX_WAIT_BITSET op and CLOCK_REALTIME > flag has been added instead of FUTEX_WAIT to replace the FUTEX_WAIT > logic which needs to do gettimeofday() calls before the futex syscall > to convert the absolute timeout to a relative timeout. > Before this the CLOCK_MONOTONIC used by the FUTEX_WAIT_BITSET op. Great to see you back in action Dmitry! Can we hope to see Linuxulator support for recent Debian/Ubuntu userland soonish? :-) More and more applications require it, and thus cannot be run on FreeBSD, which sucks *a lot*. ./danfe From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 04:47:29 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87444426; Tue, 3 Jun 2014 04:47:29 +0000 (UTC) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2lp0206.outbound.protection.outlook.com [207.46.163.206]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26AB029C7; Tue, 3 Jun 2014 04:47:27 +0000 (UTC) Received: from BY2PR05CA039.namprd05.prod.outlook.com (10.141.250.29) by BY2PR05MB111.namprd05.prod.outlook.com (10.242.38.26) with Microsoft SMTP Server (TLS) id 15.0.949.11; Tue, 3 Jun 2014 04:47:18 +0000 Received: from BN1BFFO11FD009.protection.gbl (2a01:111:f400:7c10::1:190) by BY2PR05CA039.outlook.office365.com (2a01:111:e400:2c5f::29) with Microsoft SMTP Server (TLS) id 15.0.949.11 via Frontend Transport; Tue, 3 Jun 2014 04:47:18 +0000 Received: from P-EMF03-SAC.jnpr.net (66.129.239.17) by BN1BFFO11FD009.mail.protection.outlook.com (10.58.144.72) with Microsoft SMTP Server (TLS) id 15.0.949.9 via Frontend Transport; Tue, 3 Jun 2014 04:47:18 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMF03-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.146.0; Mon, 2 Jun 2014 21:46:53 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id s534kcn27154; Mon, 2 Jun 2014 21:46:38 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 81DF6580A1; Mon, 2 Jun 2014 21:46:38 -0700 (PDT) To: Bryan Drewery Subject: Re: svn commit: r266760 - head/contrib/bmake In-Reply-To: <538D1DB7.7010508@FreeBSD.org> References: <201405271839.s4RIdDq8055387@svn.freebsd.org> <538D1DB7.7010508@FreeBSD.org> Comments: In-reply-to: Bryan Drewery message dated "Mon, 02 Jun 2014 19:58:31 -0500." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Mon, 2 Jun 2014 21:46:38 -0700 Message-ID: <20140603044638.81DF6580A1@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.129.239.17; CTRY:US; IPV:NLI; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(377424004)(199002)(189002)(97736001)(81542001)(81342001)(87286001)(104166001)(99396002)(88136002)(46102001)(81156002)(93916002)(86362001)(87936001)(62966002)(92566001)(92726001)(102836001)(33656002)(102176002)(44976005)(83322001)(53416003)(6806004)(76176999)(77096999)(50986999)(93546004)(77982001)(64706001)(4396001)(50226001)(74662001)(76482001)(74502001)(79102001)(31966008)(47776003)(20776003)(21056001)(77156001)(84676001)(48376002)(89996001)(69596002)(68736004)(80022001)(83072002)(90896003)(85852003)(50466002)(42262001); DIR:OUT; SFP:; SCL:1; SRVR:BY2PR05MB111; H:P-EMF03-SAC.jnpr.net; FPR:; MLV:sfv; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Antispam: BL:0; ACTION:Default; RISK:Low; SCL:0; SPMLVL:NotSpam; PCL:0; RULEID: X-Forefront-PRVS: 02318D10FB Received-SPF: SoftFail (: domain of transitioning juniper.net discourages use of 66.129.239.17 as permitted sender) Authentication-Results: spf=softfail (sender IP is 66.129.239.17) smtp.mailfrom=sjg@juniper.net; X-OriginatorOrg: juniper.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 04:47:29 -0000 On Mon, 2 Jun 2014 19:58:31 -0500, Bryan Drewery writes: >Not sure if anyone cares, but this change breaks all ports tree >checkouts from before 2014-05-05 on src head with this revision. Yes, an older ports tree would need an older bmake (or fmake). Are we saying ports is *not* ready for that hack to be removed? From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 05:01:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD912811; Tue, 3 Jun 2014 05:01:01 +0000 (UTC) Received: from mail-qa0-x236.google.com (mail-qa0-x236.google.com [IPv6:2607:f8b0:400d:c00::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A0752B29; Tue, 3 Jun 2014 05:01:01 +0000 (UTC) Received: by mail-qa0-f54.google.com with SMTP id j15so4183086qaq.27 for ; Mon, 02 Jun 2014 22:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Hfw7CLShEALeMP9NbOJGcOWcO7QniA56wbG5oVTJ4YE=; b=XCTDtXaauWgqeJRUEPprzEn5BvbEJf5sgNfT4l6daIY9VzX0Z1FnIViVzKT5vgzBog X6CqGks6mYJpfGcgXjP85WYRzDNPSd7hz5s06ueYwN8ikEX2LYcD40TKd/uSQ5llHuVf jiARS/ZVpKeiRv2UO8eyCBhIVti+cu8x+azzI4AURahJN3AN+Oj1IPAk0MGfY5ksFPcB c/J9GP/+pdWVCPYZocoGkVavD0rJC3965PnGkNLgUAW8EzakHCJpSGo/8kKFcoCdehsE U087wMLkJYMayCZxmlAc13W1kbmwnjlSak7cfxO/o5UZq3uNNivFF2uSk0nqtv8iXF/e eX9w== MIME-Version: 1.0 X-Received: by 10.224.135.66 with SMTP id m2mr58338164qat.55.1401771660439; Mon, 02 Jun 2014 22:01:00 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.43.134 with HTTP; Mon, 2 Jun 2014 22:01:00 -0700 (PDT) In-Reply-To: <20140603012939.GA2998@michelle.cdnetworks.com> References: <201406021754.s52Hsd1B039620@svn.freebsd.org> <20140603012939.GA2998@michelle.cdnetworks.com> Date: Mon, 2 Jun 2014 22:01:00 -0700 X-Google-Sender-Auth: PL47hhwgoWMTS5bSb6cDwTDssYc Message-ID: Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net From: Adrian Chadd To: Yong-Hyeon Pyun Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Marcel Moolenaar , "src-committers@freebsd.org" , Marcel Moolenaar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 05:01:02 -0000 On 2 June 2014 18:29, Yonghyeon PYUN wrote: > On Mon, Jun 02, 2014 at 11:42:10AM -0700, Marcel Moolenaar wrote: >> >> On Jun 2, 2014, at 11:27 AM, Adrian Chadd wrote: >> >> > .. and actually, bikeshedding for a moment, would we be able to move a >> > lot of these accessor methods over to inlines? Would that break the >> > Juniper way of doing things? >> >> That would definitely break Juniper as it doesn't give a stable >> ABI. >> >> I've suggested an approach that allows for both, but it was deemed >> unnecessary. The argument being that the function call overhead is >> negligible. >> >> We can always revisit that decision if needed... >> > > The function call overheads shall show measurable differences on > slow boxes. This change adds several function calls in driver's > fast path(interrupt handler, packet statistics, checksum > offloading checking and etc) and these functions would be called > on every TX/RX packet. > It would be great if there is a way to minimize function call > overheads in fast path. I wonder if in the short term we should just use inlines for now, at least so the methodization can get done without hurting people on ARM/MIPS. ARM/MIPS people (me included) - let's see if we can generate some number? -a From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 05:19:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 653E9735; Tue, 3 Jun 2014 05:19:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A55F2C9B; Tue, 3 Jun 2014 05:19:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s535JBpP050906; Tue, 3 Jun 2014 05:19:11 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s535JB7H050905; Tue, 3 Jun 2014 05:19:11 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201406030519.s535JB7H050905@svn.freebsd.org> From: Maxim Sobolev Date: Tue, 3 Jun 2014 05:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267001 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 05:19:11 -0000 Author: sobomax Date: Tue Jun 3 05:19:10 2014 New Revision: 267001 URL: http://svnweb.freebsd.org/changeset/base/267001 Log: Fix few outdated names of defines: o NR_REG_SW_NIC -> NR_REG_SW o NR_RING_NIC_SW -> NR_REG_NIC_SW o NETMAP_NO_TX_SYNC -> NETMAP_NO_TX_POLL o NETMAP_DO_RX_SYNC -> NETMAP_DO_RX_POLL I hope dear luigi has not left those as an excercise to careful reader, in which case I apologize in advance for ruining his play. MFC after: 1 week Modified: head/share/man/man4/netmap.4 Modified: head/share/man/man4/netmap.4 ============================================================================== --- head/share/man/man4/netmap.4 Tue Jun 3 04:38:13 2014 (r267000) +++ head/share/man/man4/netmap.4 Tue Jun 3 05:19:10 2014 (r267001) @@ -612,9 +612,9 @@ In the example below, "netmap:foo" is an .Bl -tag -width XXXXX .It NR_REG_ALL_NIC "netmap:foo" (default) all hardware ring pairs -.It NR_REG_SW_NIC "netmap:foo^" +.It NR_REG_SW "netmap:foo^" the ``host rings'', connecting to the host stack. -.It NR_RING_NIC_SW "netmap:foo+ +.It NR_REG_NIC_SW "netmap:foo+ all hardware rings and the host rings .It NR_REG_ONE_NIC "netmap:foo-i" only the i-th hardware ring pair, where the number is in @@ -639,7 +639,7 @@ or call pushes out any pending packets on the transmit ring, even if no write events are specified. The feature can be disabled by or-ing -.Va NETMAP_NO_TX_SYNC +.Va NETMAP_NO_TX_POLL to the value written to .Va nr_ringid. When this feature is used, @@ -679,13 +679,13 @@ are supported too. .Pp Packets in transmit rings are normally pushed out (and buffers reclaimed) even without -requesting write events. Passing the NETMAP_NO_TX_SYNC flag to +requesting write events. Passing the NETMAP_NO_TX_POLL flag to .Em NIOCREGIF disables this feature. By default, receive rings are processed only if read -events are requested. Passing the NETMAP_DO_RX_SYNC flag to +events are requested. Passing the NETMAP_DO_RX_POLL flag to .Em NIOCREGIF updates receive rings even without read events. -Note that on epoll and kqueue, NETMAP_NO_TX_SYNC and NETMAP_DO_RX_SYNC +Note that on epoll and kqueue, NETMAP_NO_TX_POLL and NETMAP_DO_RX_POLL only have an effect when some event is posted for the file descriptor. .Sh LIBRARIES The From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 06:35:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8573A94; Tue, 3 Jun 2014 06:35:18 +0000 (UTC) Received: from mail-wg0-x22d.google.com (mail-wg0-x22d.google.com [IPv6:2a00:1450:400c:c00::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A18D722CD; Tue, 3 Jun 2014 06:35:17 +0000 (UTC) Received: by mail-wg0-f45.google.com with SMTP id m15so6092760wgh.28 for ; Mon, 02 Jun 2014 23:35:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=IGMFW6gzGhoZnqTvQycU5msUDF3ttoB0NlGGu2XmHGc=; b=v7oKd3D00/BPz9FvKxPMi/E8C7x9haDkp0EID4xLTy4HMnclBYM/bDh3rHDvyRMix6 AoaSX2oTE/PJ5bxx3n9DC9Lt/uagmesm253SNgTbFIVKh6hF6EbOKunNIgiattm/cWed WLX1F6HkesM186Lkh4mKjYM1oIUK39fiCMMoNlqc8AwG9wQgmmSBZVn8og1pwGggbGDH OkNGQuPSEG+xetyAA0NgLljOw/2p+1xx/xESagMt1L0WqPgvE59DNfUDMgNwz9RlI5t3 Kj02+hLCQjSOIQEKoJtVo0qFi0WpqEJ3H/mDlzte62iPtlbf/J/hg+mWW3caF0lIRpDx ZJJQ== X-Received: by 10.194.81.98 with SMTP id z2mr57744380wjx.12.1401777315844; Mon, 02 Jun 2014 23:35:15 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id l5sm130262wif.22.2014.06.02.23.35.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jun 2014 23:35:14 -0700 (PDT) Sender: Baptiste Daroussin Date: Tue, 3 Jun 2014 08:35:12 +0200 From: Baptiste Daroussin To: "Simon J. Gerraty" Subject: Re: svn commit: r266760 - head/contrib/bmake Message-ID: <20140603063512.GB45150@ivaldir.etoilebsd.net> References: <201405271839.s4RIdDq8055387@svn.freebsd.org> <538D1DB7.7010508@FreeBSD.org> <20140603044638.81DF6580A1@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="neYutvxvOLaeuPCA" Content-Disposition: inline In-Reply-To: <20140603044638.81DF6580A1@chaos.jnpr.net> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bryan Drewery X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 06:35:18 -0000 --neYutvxvOLaeuPCA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 02, 2014 at 09:46:38PM -0700, Simon J. Gerraty wrote: >=20 > On Mon, 2 Jun 2014 19:58:31 -0500, Bryan Drewery writes: > >Not sure if anyone cares, but this change breaks all ports tree > >checkouts from before 2014-05-05 on src head with this revision.=20 >=20 > Yes, an older ports tree would need an older bmake (or fmake). > Are we saying ports is *not* ready for that hack to be removed? >=20 IMHO it is, just people has to be aware of that :) regards, Bapt --neYutvxvOLaeuPCA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iEYEARECAAYFAlONbKAACgkQ8kTtMUmk6Ewp9QCdFRnCEa2pbjb7lWqA8esrfJTw ogcAnRV3rVyrGWTIfIF05uhuvqtznGYI =MWVd -----END PGP SIGNATURE----- --neYutvxvOLaeuPCA-- From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 07:11:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFB5B3FE; Tue, 3 Jun 2014 07:11:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BD8E25E5; Tue, 3 Jun 2014 07:11:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s537BMuQ003388; Tue, 3 Jun 2014 07:11:22 GMT (envelope-from gahr@svn.freebsd.org) Received: (from gahr@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s537BMCa003387; Tue, 3 Jun 2014 07:11:22 GMT (envelope-from gahr@svn.freebsd.org) Message-Id: <201406030711.s537BMCa003387@svn.freebsd.org> From: Pietro Cerutti Date: Tue, 3 Jun 2014 07:11:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267004 - head/tools/regression/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 07:11:22 -0000 Author: gahr (ports committer) Date: Tue Jun 3 07:11:22 2014 New Revision: 267004 URL: http://svnweb.freebsd.org/changeset/base/267004 Log: - Use strlen instead of hardcoding a number - Terminate a sentence with a period Approved by: cognet Modified: head/tools/regression/lib/libc/stdio/test-fmemopen.c Modified: head/tools/regression/lib/libc/stdio/test-fmemopen.c ============================================================================== --- head/tools/regression/lib/libc/stdio/test-fmemopen.c Tue Jun 3 06:56:54 2014 (r267003) +++ head/tools/regression/lib/libc/stdio/test-fmemopen.c Tue Jun 3 07:11:22 2014 (r267004) @@ -268,7 +268,7 @@ test_append_binary_pos() */ char buf[] = "Hello"; fp = fmemopen(buf, sizeof(buf), "ab+"); - assert(ftell(fp) == 5); + assert(ftell(fp) == strlen(buf)); fclose(fp); } @@ -276,7 +276,7 @@ void test_size_0() { /* - * POSIX mandates that we return EINVAL if size is 0 + * POSIX mandates that we return EINVAL if size is 0. */ FILE *fp; From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 07:31:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF2DC88C; Tue, 3 Jun 2014 07:31:22 +0000 (UTC) Received: from mail-lb0-x231.google.com (mail-lb0-x231.google.com [IPv6:2a00:1450:4010:c04::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B5432793; Tue, 3 Jun 2014 07:31:21 +0000 (UTC) Received: by mail-lb0-f177.google.com with SMTP id s7so3152208lbd.36 for ; Tue, 03 Jun 2014 00:31:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=ZUtEXhPUbG9ydoLbdqzWgrkp2s6Xlye3GXhJ9am7drg=; b=cMcSUkBC3CbX3orr0Q2G74apqQktsQ95LzBNIn90m11u9cY7lo1nfOOhy3sKflb7MV M3NNicnfclUk604baoAiJI6+FmJC8ZqUiTAD87lThdtBu2MO9njtdj8qbZ+SQtTXGdTe gdb05u9wjTxGjpQMs+hNrsfUDlUeOmsJXzpuNh597t/Cd6nKn7y0XHziss2HtVHS0G8Y o9Do3hvUY+jZFFiKbDvQzGhBD3jDLs1km3SLLdsuv8uSSKaZBAVBnRNSIk/N6HsHI8I1 79M5jG2fgg0vgGDVX3bVtJxLGWd5Yf6MnZneE122TJW+Yezf+b+u3WWoehkCzqwYpqsr RepA== X-Received: by 10.112.198.102 with SMTP id jb6mr27096205lbc.18.1401780679383; Tue, 03 Jun 2014 00:31:19 -0700 (PDT) Received: from dchagin.static.corbina.net (dchagin.static.corbina.ru. [78.107.232.239]) by mx.google.com with ESMTPSA id zx3sm15223989lbc.2.2014.06.03.00.31.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jun 2014 00:31:18 -0700 (PDT) Sender: Dmitry Chagin Received: from dchagin.static.corbina.net (localhost [127.0.0.1]) by dchagin.static.corbina.net (8.14.8/8.14.8) with ESMTP id s537VGWU002003; Tue, 3 Jun 2014 11:31:16 +0400 (MSK) (envelope-from dchagin@dchagin.static.corbina.net) Received: (from dchagin@localhost) by dchagin.static.corbina.net (8.14.8/8.14.8/Submit) id s537VGwc002002; Tue, 3 Jun 2014 11:31:16 +0400 (MSK) (envelope-from dchagin) Date: Tue, 3 Jun 2014 11:31:16 +0400 From: Chagin Dmitry To: Alexey Dokuchaev Subject: Re: svn commit: r266924 - head/sys/compat/linux Message-ID: <20140603073116.GA1978@dchagin.static.corbina.net> References: <201405311458.s4VEwrWY058828@svn.freebsd.org> <20140603021431.GE60685@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VS++wcV0S1rZb1Fb" Content-Disposition: inline In-Reply-To: <20140603021431.GE60685@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 07:31:22 -0000 --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 03, 2014 at 02:14:31AM +0000, Alexey Dokuchaev wrote: > On Sat, May 31, 2014 at 02:58:53PM +0000, Dmitry Chagin wrote: > > New Revision: 266924 > > URL: http://svnweb.freebsd.org/changeset/base/266924 > >=20 > > Log: > > Glibc was switched to the FUTEX_WAIT_BITSET op and CLOCK_REALTIME > > flag has been added instead of FUTEX_WAIT to replace the FUTEX_WAIT > > logic which needs to do gettimeofday() calls before the futex syscall > > to convert the absolute timeout to a relative timeout. > > Before this the CLOCK_MONOTONIC used by the FUTEX_WAIT_BITSET op. >=20 > Great to see you back in action Dmitry! >=20 thanks, Alexey! > Can we hope to see Linuxulator support for recent Debian/Ubuntu userland > soonish? :-) More and more applications require it, and thus cannot be > run on FreeBSD, which sucks *a lot*. >=20 We [our small linux team :)] have fedora-19 and f-20 port for lemul testing. For now I know two bugs which prevent me from merging lemul to HEAD (both compat32): 1. firefox 29 hungs when it loads plugins 2. skype-delel spontaneously dies when at start. --=20 Have fun! chd --VS++wcV0S1rZb1Fb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlONecQACgkQ0t2Tb3OO/O0uJgCgvflviqxBvQAAgfykvuG8ixdR g/0AnRv46Ejp/tUs+uO4eY+5knES6YUP =Cm5E -----END PGP SIGNATURE----- --VS++wcV0S1rZb1Fb-- From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 08:54:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 5C6C8BE9; Tue, 3 Jun 2014 08:54:23 +0000 (UTC) Date: Tue, 3 Jun 2014 08:54:23 +0000 From: Alexey Dokuchaev To: Chagin Dmitry Subject: Re: svn commit: r266924 - head/sys/compat/linux Message-ID: <20140603085423.GA28161@FreeBSD.org> References: <201405311458.s4VEwrWY058828@svn.freebsd.org> <20140603021431.GE60685@FreeBSD.org> <20140603073116.GA1978@dchagin.static.corbina.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140603073116.GA1978@dchagin.static.corbina.net> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 08:54:23 -0000 On Tue, Jun 03, 2014 at 11:31:16AM +0400, Chagin Dmitry wrote: > On Tue, Jun 03, 2014 at 02:14:31AM +0000, Alexey Dokuchaev wrote: > > Can we hope to see Linuxulator support for recent Debian/Ubuntu userland > > soonish? :-) More and more applications require it, and thus cannot be > > run on FreeBSD, which sucks *a lot*. > > We [our small linux team :)] have fedora-19 and f-20 port for lemul > testing. For now I know two bugs which prevent me from merging lemul to > HEAD (both compat32): > > 1. firefox 29 hungs when it loads plugins > 2. skype-delel spontaneously dies when at start. You can also try to run Kingsoft Office for Linux [1]; if that would be possible on FreeBSD, it'll make a large leap forward (currently it's not). [1] http://wps-community.org/download.html From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 08:59:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AAEBAD85; Tue, 3 Jun 2014 08:59:45 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BB6A2F71; Tue, 3 Jun 2014 08:59:44 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s538xfEh019166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 Jun 2014 12:59:41 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s538xf2O019165; Tue, 3 Jun 2014 12:59:41 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 3 Jun 2014 12:59:41 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net Message-ID: <20140603085941.GW50679@FreeBSD.org> References: <201406021754.s52Hsd1B039620@svn.freebsd.org> <1401735801.20883.103.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Marcel Moolenaar , Ian Lepore , "svn-src-all@freebsd.org" , Marcel Moolenaar , "src-committers@freebsd.org" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 08:59:45 -0000 On Mon, Jun 02, 2014 at 12:27:47PM -0700, Adrian Chadd wrote: A> >> > .. and actually, bikeshedding for a moment, would we be able to move a A> >> > lot of these accessor methods over to inlines? Would that break the A> >> > Juniper way of doing things? A> >> A> >> That would definitely break Juniper as it doesn't give a stable A> >> ABI. A> >> A> >> I've suggested an approach that allows for both, but it was deemed A> >> unnecessary. The argument being that the function call overhead is A> >> negligible. A> >> A> >> We can always revisit that decision if needed... A> >> A> > A> > In my experience, function call overhead is anything but minimal, A> > especially on ARM platforms. A> A> Same on MIPS. And same on amd64. While benchmarking the counter(9), I even encountered artifacts when function call was faster than inline. Of course, function call shouldn't be via a pointer. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 11:34:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86F301C9; Tue, 3 Jun 2014 11:34:40 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 1D20A2E85; Tue, 3 Jun 2014 11:34:39 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 3F9D2D63CDA; Tue, 3 Jun 2014 21:11:43 +1000 (EST) Date: Tue, 3 Jun 2014 21:11:37 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John-Mark Gurney Subject: Re: svn commit: r266985 - head/sys/ddb In-Reply-To: <201406022350.s52NoJe1096873@svn.freebsd.org> Message-ID: <20140603193401.W1018@besplex.bde.org> References: <201406022350.s52NoJe1096873@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eojmkOZX c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=Mtxxv-QYS58A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=Vqz-XXCvPmqd0_mSjAgA:9 a=aDvwUABlz0NCpQcX:21 a=aw1NSLr4V71kp6Ql:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 11:34:40 -0000 On Mon, 2 Jun 2014, John-Mark Gurney wrote: > Log: > handle longer commands so that lines don't overflow... people who added > commands forgot to check this... Please fix the sticky "." key on your keyboard. It keeps repeating spuriously. Also the shift key. The correct fix is to remove or rename the long commands. > Modified: head/sys/ddb/db_command.c > ============================================================================== > --- head/sys/ddb/db_command.c Mon Jun 2 22:58:00 2014 (r266984) > +++ head/sys/ddb/db_command.c Mon Jun 2 23:50:19 2014 (r266985) > @@ -321,8 +321,8 @@ db_cmd_list(table) > register struct command *cmd; > > LIST_FOREACH(cmd, table, next) { > - db_printf("%-12s", cmd->name); > - db_end_line(12); > + db_printf("%-16s", cmd->name); > + db_end_line(16); > } > } 12 is already too long. Who wants to type 11-15 character command names? It would be better to punish long command name[r]s using "%-11.11s " format (with complications to avoid the trailing space(s) in the last column). This punishment is not very severe since command names should be unique in the first character or 2. This is needed anyway, to avoid typing long command names. The command name parser supports this by matching the name typed with a possibly-longer name in the table. Expanding to 16 adds the following bugs: - reduction in the number of fields on an 80 column terminal from 6 or 7 to 4 or 5 (from 6 * 12 + 7 or 8 left over depending on auto-wrap to 4 * 16 + 15 or 16 left over) - different mishandling of autowrap. In -current, the handling seems to be to always waste the last 16 columns (previously only 8). This avoids problems with auto-wrap, but the change makes it waste many more columns. The number of fields is now 4 (was 6). 6 * 13 would fit just as well as 6 * 12 (except for terminals with between 73 and 78 columns). The formatting now works as follows: The db_end_line()'s are not correctly paired with the db_printf()'s, but they work. There is none before the first db_printf(), but callers should arrange to start on a new line so there is no danger of overruning the line before db_end_line() can check for overrun. Then each db_end_line() except the last one (dynamically) is correctly paired with the next db_printf(). Then the last db_end_line() checks for output that will never be done. It may print a newline prematurely. Perhaps an extra newline is printed to complete the table. This is unclear because db_cmd_list() doesn't print one itself. I think the prompt code _expects_ to be called with the previous line not always terminated, and prints a newline iff necessary. It used to give 7 fields of width 12 that were somehow usually displayed nicely in 80 columns on a syscons terminal, depending on whether the 12 characters printed in the 7 available columns for the last field had enough trailing spaces. The trailing spaces were apparently discarded by terminal magic on some terminals. But command names of length exactly 8 gave auto-wrap problems, and ones of length 9-12 were displayed in full and ran into the next line iff they were in the 7th field. Command names of length 12 of course ran into each other in any field except the last one. Since command namers usually get things like this wrong, short names should be enforced by panicing for long ones. I once fixed all sleep message strings to fit in the available 6 characters, but neglected to enforce this, so there are many more broken ones now. This bug is now most common in the zfs and audit subsystems. From top output: 10 root -16 - 0K 16K audit_ 21 12:47 0.00% [audit] 6 root -8 - 0K 96K spa->s 5 0:30 0.00% [zfskern{trim zfreefall}] 6 root 20 - 0K 96K arc_re 10 0:20 0.00% [zfskern{arc_reclaim_thre}] 23 root -16 - 0K 16K sdflus 18 0:19 0.00% [softdepflush] 6 root -8 - 0K 96K l2arc_ 14 0:13 0.00% [zfskern{l2arc_feed_threa}] 670 auditdistd 20 0 23692K 3292K sigwai 11 0:04 0.00% auditdistd: [audit.ysv.FreeBSD. 8 root -16 - 0K 16K ipmire 0 0:00 0.00% [ipmi0: kcs] The bad sleep messages are not even designed to be useful when truncated to 6 characters, so for example almost the signal in audit_mumble is truncated, but all the noise is kept. ipmire would be a good name for mired ip but not for ipmi. The bad sleep messages are mishandled differently in ps; - in normal ps l output, MWCHAN is 6 wide - but if any sleep message is longer than 6, MWCHAN is up to 8 wide. The above subsystems still get their strings truncated, e.g. (ps lH output): 0 6 0 0 20 0 0 96 arc_recl DL - 0:20.04 [zfsk 0 6 0 0 -8 0 0 96 l2arc_fe DL - 0:13.24 [zfsk 0 6 0 0 -8 0 0 96 spa->spa DL - 0:29.53 [zfsk 0 6 0 0 -8 0 0 96 tx->tx_q DL - 0:05.60 [zfsk 0 6 0 0 -8 0 0 96 tx->tx_s DL - 62:10.01 [zfsk 0 10 0 0 -16 0 0 16 audit_wo DL - 12:47.10 [audi 78 670 669 0 20 0 23692 3292 sigwait SJ - 0:03.56 audit Space that is not available is used to expand the MWCHAN field (and some others), so the main command name is truncated almost into oblivion (just 4 columns for it, after wasting another one for "["). - wide output format fixes the truncated main command name, but MWCHAN remains truncated at 8: 0 6 0 0 20 0 0 96 arc_recl DL - 0:20.04 [zfskern/arc_reclaim] 0 6 0 0 -8 0 0 96 l2arc_fe DL - 0:13.24 [zfskern/l2arc_feed_] 0 6 0 0 -8 0 0 96 spa->spa DL - 0:29.53 [zfskern/trim zfreef] 0 6 0 0 -8 0 0 96 tx->tx_q DL - 0:05.60 [zfskern/txg_thread_] 0 6 0 0 -8 0 0 96 tx->tx_s DL - 62:10.58 [zfskern/txg_thread_] 0 10 0 0 -16 0 0 16 audit_wo DL - 12:47.20 [audit] Actually, thread names are truncated by other mechanisms. Partly in the kernel, so ps cannot recover. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 12:35:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F2C36B3; Tue, 3 Jun 2014 12:35:57 +0000 (UTC) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 428D22459; Tue, 3 Jun 2014 12:35:56 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id CB02BD44FBD; Tue, 3 Jun 2014 22:04:09 +1000 (EST) Date: Tue, 3 Jun 2014 22:04:09 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net In-Reply-To: <1401735801.20883.103.camel@revolution.hippie.lan> Message-ID: <20140603212553.P1018@besplex.bde.org> References: <201406021754.s52Hsd1B039620@svn.freebsd.org> <1401735801.20883.103.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=U6SrU4bu c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=A1emcgW2bmQA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=vIjQHYS3pqU84ZPjkucA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 Cc: Adrian Chadd , Marcel Moolenaar , "svn-src-all@freebsd.org" , Marcel Moolenaar , "src-committers@freebsd.org" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 12:35:57 -0000 On Mon, 2 Jun 2014, Ian Lepore wrote: > On Mon, 2014-06-02 at 11:42 -0700, Marcel Moolenaar wrote: >> On Jun 2, 2014, at 11:27 AM, Adrian Chadd wrote: >> >>> .. and actually, bikeshedding for a moment, would we be able to move a >>> lot of these accessor methods over to inlines? Would that break the >>> Juniper way of doing things? >> >> That would definitely break Juniper as it doesn't give a stable >> ABI. >> >> I've suggested an approach that allows for both, but it was deemed >> unnecessary. The argument being that the function call overhead is >> negligible. >> >> We can always revisit that decision if needed... I thought it was obviously necessary. Juniper gets the stable ABI and slowness, while the default is to have the same code as before, except it is obfuscated by macros or inline functions. > In my experience, function call overhead is anything but minimal, > especially on ARM platforms. This is of course machine-dependent. It is not very large on modern x86. It was large on old x86. I think it needs mainly deep pipelines and out of order execution to be fase. Testing on old Athlon64 showed that the overhead is quite large even on modern x86. Direct accesses to a memory variable can be done at 2 per cycle in a 4-way unrolled loop, but the best I could find for accessor(&var) in a function call was 1 per 8 cycles, with unrolling making the accesses slower. 16 times slower. The unrolled loop is favourable to the simple operation of a memory load or store of a single memory (in-cache) variable, but also to calling a single accessor function. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 13:33:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99F92F9E; Tue, 3 Jun 2014 13:33:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87F3F2AEC; Tue, 3 Jun 2014 13:33:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s53DXiFD076475; Tue, 3 Jun 2014 13:33:44 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s53DXiIc076473; Tue, 3 Jun 2014 13:33:44 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201406031333.s53DXiIc076473@svn.freebsd.org> From: Aleksandr Rybalko Date: Tue, 3 Jun 2014 13:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267007 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 13:33:44 -0000 Author: ray Date: Tue Jun 3 13:33:43 2014 New Revision: 267007 URL: http://svnweb.freebsd.org/changeset/base/267007 Log: Fix case when vt(4) started w/o driver assigned. o Always init locks and cv ASAP. o Initialize driver-independent parts even if driver probing fail. o Allow to call vt_upgrade anytime, for later loaded drivers. o New window flag VWF_READY, to track if window already initialized. Other updates: o Pass vd as a cookie for kbd_allocate. o Do not blank window on driver replacement. Tested by: hselasky (RPi), emaste(VGA, EFIFB, KMS), me MFC after: 7 days Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Tue Jun 3 08:08:12 2014 (r267006) +++ head/sys/dev/vt/vt.h Tue Jun 3 13:33:43 2014 (r267007) @@ -259,6 +259,7 @@ struct vt_window { #define VWF_CONSOLE 0x8 /* Kernel message console window. */ #define VWF_VTYLOCK 0x10 /* Prevent window switch. */ #define VWF_MOUSE_HIDE 0x20 /* Disable mouse events processing. */ +#define VWF_READY 0x40 /* Window fully initialized. */ #define VWF_SWWAIT_REL 0x10000 /* Program wait for VT acquire is done. */ #define VWF_SWWAIT_ACQ 0x20000 /* Program wait for VT release is done. */ pid_t vw_pid; /* Terminal holding process */ Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Tue Jun 3 08:08:12 2014 (r267006) +++ head/sys/dev/vt/vt_core.c Tue Jun 3 13:33:43 2014 (r267007) @@ -120,9 +120,10 @@ VT_SYSCTL_INT(debug, 0, "vt(9) debug lev VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode"); VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend"); +static struct vt_device vt_consdev; static unsigned int vt_unit = 0; static MALLOC_DEFINE(M_VT, "vt", "vt device"); -struct vt_device *main_vd = NULL; +struct vt_device *main_vd = &vt_consdev; /* Boot logo. */ extern unsigned int vt_logo_width; @@ -214,12 +215,14 @@ static void vt_update_static(void *dummy) { - if (main_vd != NULL) { + if (main_vd->vd_driver != NULL) printf("VT: running with driver \"%s\".\n", main_vd->vd_driver->vd_name); - mtx_init(&main_vd->vd_lock, "vtdev", NULL, MTX_DEF); - cv_init(&main_vd->vd_winswitch, "vtwswt"); - } + else + printf("VT: init without driver.\n"); + + mtx_init(&main_vd->vd_lock, "vtdev", NULL, MTX_DEF); + cv_init(&main_vd->vd_winswitch, "vtwswt"); } static void @@ -633,11 +636,9 @@ vt_allocate_keyboard(struct vt_device *v keyboard_t *k0, *k; keyboard_info_t ki; - idx0 = kbd_allocate("kbdmux", -1, (void *)&vd->vd_keyboard, - vt_kbdevent, vd); - /* XXX: kb_token lost */ + idx0 = kbd_allocate("kbdmux", -1, vd, vt_kbdevent, vd); vd->vd_keyboard = idx0; - if (idx0 != -1) { + if (idx0 >= 0) { DPRINTF(20, "%s: kbdmux allocated, idx = %d\n", __func__, idx0); k0 = kbd_get_keyboard(idx0); @@ -657,8 +658,11 @@ vt_allocate_keyboard(struct vt_device *v } } else { DPRINTF(20, "%s: no kbdmux allocated\n", __func__); - idx0 = kbd_allocate("*", -1, (void *)&vd->vd_keyboard, - vt_kbdevent, vd); + idx0 = kbd_allocate("*", -1, vd, vt_kbdevent, vd); + if (idx0 < 0) { + DPRINTF(10, "%s: No keyboard found.\n", __func__); + return (-1); + } } DPRINTF(20, "%s: vd_keyboard = %d\n", __func__, vd->vd_keyboard); @@ -970,15 +974,14 @@ vtterm_cnprobe(struct terminal *tm, stru if (vtdbest == NULL) { cp->cn_pri = CN_DEAD; vd->vd_flags |= VDF_DEAD; - return; + } else { + vd->vd_driver = vtdbest; + cp->cn_pri = vd->vd_driver->vd_init(vd); } - vd->vd_driver = vtdbest; - - cp->cn_pri = vd->vd_driver->vd_init(vd); + /* Check if driver's vt_init return CN_DEAD. */ if (cp->cn_pri == CN_DEAD) { vd->vd_flags |= VDF_DEAD; - return; } /* Initialize any early-boot keyboard drivers */ @@ -988,6 +991,7 @@ vtterm_cnprobe(struct terminal *tm, stru vd->vd_windows[VT_CONSWINDOW] = vw; sprintf(cp->cn_name, "ttyv%r", VT_UNIT(vw)); + /* Attach default font if not in TEXTMODE. */ if (!(vd->vd_flags & VDF_TEXTMODE)) vw->vw_font = vtfont_ref(&vt_font_default); @@ -995,12 +999,12 @@ vtterm_cnprobe(struct terminal *tm, stru vt_winsize(vd, vw->vw_font, &wsz); terminal_set_winsize(tm, &wsz); + if (vtdbest != NULL) { #ifdef DEV_SPLASH - vtterm_splash(vd); + vtterm_splash(vd); #endif - - vd->vd_flags |= VDF_INITIALIZED; - main_vd = vd; + vd->vd_flags |= VDF_INITIALIZED; + } } static int @@ -1987,44 +1991,41 @@ vt_upgrade(struct vt_device *vd) struct vt_window *vw; unsigned int i; - /* Device didn't pass vd_init() or already upgraded. */ - if (vd->vd_flags & (VDF_ASYNC|VDF_DEAD)) { - /* Refill settings with new sizes anyway. */ - vt_resize(vd); - return; - } - vd->vd_flags |= VDF_ASYNC; - for (i = 0; i < VT_MAXWINDOWS; i++) { vw = vd->vd_windows[i]; if (vw == NULL) { /* New window. */ vw = vt_allocate_window(vd, i); - } else if (vw->vw_flags & VWF_CONSOLE) { - /* For existing console window. */ - callout_init(&vw->vw_proc_dead_timer, 0); } - if (i == VT_CONSWINDOW) { - /* Console window. */ - EVENTHANDLER_REGISTER(shutdown_pre_sync, - vt_window_switch, vw, SHUTDOWN_PRI_DEFAULT); + if (!(vw->vw_flags & VWF_READY)) { + callout_init(&vw->vw_proc_dead_timer, 0); + terminal_maketty(vw->vw_terminal, "v%r", VT_UNIT(vw)); + vw->vw_flags |= VWF_READY; + if (vw->vw_flags & VWF_CONSOLE) { + /* For existing console window. */ + EVENTHANDLER_REGISTER(shutdown_pre_sync, + vt_window_switch, vw, SHUTDOWN_PRI_DEFAULT); + } } - terminal_maketty(vw->vw_terminal, "v%r", VT_UNIT(vw)); } VT_LOCK(vd); if (vd->vd_curwindow == NULL) vd->vd_curwindow = vd->vd_windows[VT_CONSWINDOW]; + if (!(vd->vd_flags & VDF_ASYNC)) { /* Attach keyboard. */ vt_allocate_keyboard(vd); DPRINTF(20, "%s: vd_keyboard = %d\n", __func__, vd->vd_keyboard); - /* Init 25 Hz timer. */ - callout_init_mtx(&vd->vd_timer, &vd->vd_lock, 0); + /* Init 25 Hz timer. */ + callout_init_mtx(&vd->vd_timer, &vd->vd_lock, 0); + + /* Start timer when everything ready. */ + vd->vd_flags |= VDF_ASYNC; + callout_reset(&vd->vd_timer, hz / VT_TIMERFREQ, vt_timer, vd); + } - /* Start timer when everything ready. */ - callout_reset(&vd->vd_timer, hz / VT_TIMERFREQ, vt_timer, vd); VT_UNLOCK(vd); /* Refill settings with new sizes. */ @@ -2055,13 +2056,10 @@ vt_allocate(struct vt_driver *drv, void struct vt_device *vd; struct winsize wsz; - if (main_vd == NULL) { - main_vd = malloc(sizeof *vd, M_VT, M_WAITOK|M_ZERO); + if (main_vd->vd_driver == NULL) { + main_vd->vd_driver = drv; printf("VT: initialize with new VT driver \"%s\".\n", drv->vd_name); - mtx_init(&main_vd->vd_lock, "vtdev", NULL, MTX_DEF); - cv_init(&main_vd->vd_winswitch, "vtwswt"); - } else { /* * Check if have rights to replace current driver. For example: @@ -2117,7 +2115,8 @@ vt_allocate(struct vt_driver *drv, void /* Update console window sizes to actual. */ vt_winsize(vd, vd->vd_windows[VT_CONSWINDOW]->vw_font, &wsz); - terminal_set_winsize(vd->vd_windows[VT_CONSWINDOW]->vw_terminal, &wsz); + terminal_set_winsize_blank(vd->vd_windows[VT_CONSWINDOW]->vw_terminal, + &wsz, 0); } void From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 13:40:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D25634A; Tue, 3 Jun 2014 13:40:02 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id CD4392B74; Tue, 3 Jun 2014 13:40:01 +0000 (UTC) Received: from terran (unknown [192.168.99.1]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPA id 99A27C4930; Tue, 3 Jun 2014 16:39:54 +0300 (EEST) Date: Tue, 3 Jun 2014 16:41:06 +0300 From: Aleksandr Rybalko To: Hans Petter Selasky Subject: Re: svn commit: r265927 - head/sys/dev/vt Message-Id: <20140603164106.42d1ded73c01d1eb80cdb255@freebsd.org> In-Reply-To: <537DF75B.9040607@selasky.org> References: <201405121929.s4CJTcBx010967@svn.freebsd.org> <537D0AAB.3090303@selasky.org> <537DF75B.9040607@selasky.org> X-Mailer: Sylpheed 3.3.1 (GTK+ 2.24.22; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Aleksandr Rybalko , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 13:40:02 -0000 On Thu, 22 May 2014 15:10:51 +0200 Hans Petter Selasky wrote: > On 05/21/14 22:20, Hans Petter Selasky wrote: > > On 05/12/14 21:29, Aleksandr Rybalko wrote: > >> Author: ray > >> Date: Mon May 12 19:29:38 2014 > >> New Revision: 265927 > >> URL: http://svnweb.freebsd.org/changeset/base/265927 > >> > >> Log: > >> Update terminal sizes in any case when new vt(4) driver arrive. > >> (Plus remove one unused newline) > >> > >> Sponsored by: The FreeBSD Foundation > >> > >> Modified: > >> head/sys/dev/vt/vt_core.c > >> > > > > This patch causes panic when booting the RPI-B: > > > > VT: initialize with new VT driver "fb". > > panic: mtx_lock() of spin mutex (null) @ > > /usr/img/freebsd/sys/dev/vt/vt_core.c:2037 > > KDB: enter: panic > > [ thread pid 0 tid 100000 ] > > Stopped at $d: ldrb r15, [r15, r15, ror r15]! > > > > __mtx_lock_flags() at > > vt_resize() at vt_upgrade() at > > mi_startup() at mi_startup+0x11c > > > > > > --HPS > > > > This patch fixes it. Not sure if it is correct. Idea is right, but I did it another way a bit :) Fixed in r267007. > > --HPS > > > diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c > > index 39b9265..d85d5e8 100644 > > --- a/sys/dev/vt/vt_core.c > > +++ b/sys/dev/vt/vt_core.c > > @@ -145,6 +145,7 @@ static int vt_late_window_switch(struct vt_window *); > > static int vt_proc_alive(struct vt_window *); > > static void vt_resize(struct vt_device *); > > static void vt_update_static(void *); > > +static void vt_upgrade_static(void *); > > > > SET_DECLARE(vt_drv_set, struct vt_driver); > > > > @@ -203,23 +204,28 @@ DATA_SET(cons_set, vt_consterm_consdev); > > * Right after kmem is done to allow early drivers to use locking and allocate > > * memory. > > */ > > -SYSINIT(vt_update_static, SI_SUB_KMEM, SI_ORDER_ANY, vt_update_static, > > - &vt_consdev); > > +SYSINIT(vt_init_1, SI_SUB_KMEM, SI_ORDER_ANY, vt_update_static, NULL); > > /* Delay until all devices attached, to not waste time. */ > > -SYSINIT(vt_early_cons, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_ANY, vt_upgrade, > > - &vt_consdev); > > +SYSINIT(vt_init_2, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_ANY, vt_upgrade_static, NULL); > > > > /* Initialize locks/mem depended members. */ > > static void > > vt_update_static(void *dummy) > > { > > + if (main_vd == NULL) > > + return; > > + printf("VT: running with driver \"%s\".\n", > > + main_vd->vd_driver->vd_name); > > + mtx_init(&main_vd->vd_lock, "vtdev", NULL, MTX_DEF); > > + cv_init(&main_vd->vd_winswitch, "vtwswt"); > > +} > > > > - if (main_vd != NULL) { > > - printf("VT: running with driver \"%s\".\n", > > - main_vd->vd_driver->vd_name); > > - mtx_init(&main_vd->vd_lock, "vtdev", NULL, MTX_DEF); > > - cv_init(&main_vd->vd_winswitch, "vtwswt"); > > - } > > +static void > > +vt_upgrade_static(void *dummy) > > +{ > > + if (main_vd == NULL) > > + return; > > + vt_upgrade(main_vd); > > } > > > > static void > > > > > -- Aleksandr Rybalko From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 14:10:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCE1681F; Tue, 3 Jun 2014 14:10:25 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 252492F24; Tue, 3 Jun 2014 14:10:23 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s53EAKk0020841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 Jun 2014 18:10:20 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s53EAKQt020840; Tue, 3 Jun 2014 18:10:20 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 3 Jun 2014 18:10:20 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net Message-ID: <20140603141020.GB50679@FreeBSD.org> References: <201406021754.s52Hsd1B039620@svn.freebsd.org> <1401735801.20883.103.camel@revolution.hippie.lan> <20140603085941.GW50679@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140603085941.GW50679@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Marcel Moolenaar , Ian Lepore , "svn-src-all@freebsd.org" , Marcel Moolenaar , "src-committers@freebsd.org" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 14:10:25 -0000 On Tue, Jun 03, 2014 at 12:59:41PM +0400, Gleb Smirnoff wrote: T> On Mon, Jun 02, 2014 at 12:27:47PM -0700, Adrian Chadd wrote: T> A> >> > .. and actually, bikeshedding for a moment, would we be able to move a T> A> >> > lot of these accessor methods over to inlines? Would that break the T> A> >> > Juniper way of doing things? T> A> >> T> A> >> That would definitely break Juniper as it doesn't give a stable T> A> >> ABI. T> A> >> T> A> >> I've suggested an approach that allows for both, but it was deemed T> A> >> unnecessary. The argument being that the function call overhead is T> A> >> negligible. T> A> >> T> A> >> We can always revisit that decision if needed... T> A> >> T> A> > T> A> > In my experience, function call overhead is anything but minimal, T> A> > especially on ARM platforms. T> A> T> A> Same on MIPS. T> T> And same on amd64. While benchmarking the counter(9), I even encountered T> artifacts when function call was faster than inline. T> T> Of course, function call shouldn't be via a pointer. Sorry, I misunderstood the "anything but minimal" phrase. That's why my reply Adrian and Ian looks odd. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 14:46:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D72F836; Tue, 3 Jun 2014 14:46:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B35A22CC; Tue, 3 Jun 2014 14:46:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s53Ekpdw009586; Tue, 3 Jun 2014 14:46:51 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s53EkpVg009585; Tue, 3 Jun 2014 14:46:51 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201406031446.s53EkpVg009585@svn.freebsd.org> From: Luiz Otavio O Souza Date: Tue, 3 Jun 2014 14:46:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267009 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 14:46:51 -0000 Author: loos Date: Tue Jun 3 14:46:50 2014 New Revision: 267009 URL: http://svnweb.freebsd.org/changeset/base/267009 Log: Remove the unnecessary i2c slave address assignment. The ti_i2c controller only works in the master mode and the i2c address passed on iicbus_reset() is used to set the controller slave address when operating as an i2c slave (which isn't currently supported). When talking to a slave, the slave address is correctly provided to ti_i2c_tranfer(). Modified: head/sys/arm/ti/ti_i2c.c Modified: head/sys/arm/ti/ti_i2c.c ============================================================================== --- head/sys/arm/ti/ti_i2c.c Tue Jun 3 13:47:00 2014 (r267008) +++ head/sys/arm/ti/ti_i2c.c Tue Jun 3 14:46:50 2014 (r267009) @@ -92,7 +92,6 @@ struct ti_i2c_softc volatile uint16_t sc_stat_flags; /* contains the status flags last IRQ */ - uint16_t sc_i2c_addr; uint16_t sc_rev; }; @@ -310,10 +309,6 @@ ti_i2c_reset(device_t dev, u_char speed, TI_I2C_LOCK(sc); - if (oldaddr) - *oldaddr = sc->sc_i2c_addr; - sc->sc_i2c_addr = addr; - /* First disable the controller while changing the clocks */ con_reg = ti_i2c_read_reg(sc, I2C_REG_CON); ti_i2c_write_reg(sc, I2C_REG_CON, 0x0000); @@ -325,9 +320,6 @@ ti_i2c_reset(device_t dev, u_char speed, ti_i2c_write_reg(sc, I2C_REG_SCLL, clkcfg->scll | (clkcfg->hsscll<<8)); ti_i2c_write_reg(sc, I2C_REG_SCLH, clkcfg->sclh | (clkcfg->hssclh<<8)); - /* Set the remote slave address */ - ti_i2c_write_reg(sc, I2C_REG_SA, addr); - /* Check if we are dealing with high speed mode */ if ((clkcfg->hsscll + clkcfg->hssclh) > 0) con_reg = I2C_CON_OPMODE_HS; @@ -339,7 +331,7 @@ ti_i2c_reset(device_t dev, u_char speed, TI_I2C_UNLOCK(sc); - return 0; + return (IIC_ENOADDR); } /** From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 16:47:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 722CC769; Tue, 3 Jun 2014 16:47:08 +0000 (UTC) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F1C22EC0; Tue, 3 Jun 2014 16:47:07 +0000 (UTC) Received: from mobile-198-228-206-168.mycingular.net ([198.228.206.168]:36026 helo=[172.20.10.3]) by vps.hungerhost.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80.1) (envelope-from ) id 1WrrrX-0002IL-8S; Tue, 03 Jun 2014 12:47:00 -0400 From: "George Neville-Neil" To: "Marcel Moolenaar" Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net Date: Tue, 03 Jun 2014 12:46:56 -0400 Message-ID: <3DD60E8E-7B9B-4CF2-823F-3BF3469EB0C3@neville-neil.com> In-Reply-To: References: <201406021754.s52Hsd1B039620@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=_MailMate_D0D7414A-FB77-4FA6-A253-A97DB0E20BC1_="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Mailer: MailMate (1.7.2r3905) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com Cc: "svn-src-head@freebsd.org" , Adrian Chadd , Marcel Moolenaar , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 16:47:08 -0000 This is an OpenPGP/MIME signed message (RFC 3156 and 4880). --=_MailMate_D0D7414A-FB77-4FA6-A253-A97DB0E20BC1_= Content-Type: text/plain On 2 Jun 2014, at 14:37, Marcel Moolenaar wrote: > On Jun 2, 2014, at 11:26 AM, Adrian Chadd wrote: > >> Woo! >> >> Would you mind doing up a 30 second "what convert X to Y" document so >> I can do the driveby on the wireless stack and drivers? > > I'm having difficulty parsing the question, but I think you're asking > for a howto with gotchas and caveats, etc, right? > > If yes, I can definitely do that. Jumping in in the middle. What would REALLY help is a man page that described the API. Best, George --=_MailMate_D0D7414A-FB77-4FA6-A253-A97DB0E20BC1_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - http://gpgtools.org iEYEARECAAYFAlON/AAACgkQYdh2wUQKM9I9egCgk9DG01W6atoLYGVy8WMndJkw QF0AoIME6hTYtH95gptofnbrGDIC7VzH =2ETG -----END PGP SIGNATURE----- --=_MailMate_D0D7414A-FB77-4FA6-A253-A97DB0E20BC1_=-- From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 16:49:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CADBA8D0; Tue, 3 Jun 2014 16:49:29 +0000 (UTC) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A95C2ED4; Tue, 3 Jun 2014 16:49:29 +0000 (UTC) Received: from [172.29.2.230] ([66.129.239.13]) (authenticated bits=0) by mail.xcllnt.net (8.14.9/8.14.9) with ESMTP id s53GnQi4003100 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 3 Jun 2014 09:49:27 -0700 (PDT) (envelope-from marcel@xcllnt.net) Content-Type: multipart/signed; boundary="Apple-Mail=_02C390B4-39A0-423B-B2C8-9A7A8941D148"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net From: Marcel Moolenaar In-Reply-To: <3DD60E8E-7B9B-4CF2-823F-3BF3469EB0C3@neville-neil.com> Date: Tue, 3 Jun 2014 09:49:19 -0700 Message-Id: References: <201406021754.s52Hsd1B039620@svn.freebsd.org> <3DD60E8E-7B9B-4CF2-823F-3BF3469EB0C3@neville-neil.com> To: George Neville-Neil X-Mailer: Apple Mail (2.1878.2) Cc: "svn-src-head@freebsd.org" , Adrian Chadd , Marcel Moolenaar , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 16:49:29 -0000 --Apple-Mail=_02C390B4-39A0-423B-B2C8-9A7A8941D148 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On Jun 3, 2014, at 9:46 AM, George Neville-Neil wrote: > On 2 Jun 2014, at 14:37, Marcel Moolenaar wrote: > >> On Jun 2, 2014, at 11:26 AM, Adrian Chadd wrote: >> >>> Woo! >>> >>> Would you mind doing up a 30 second "what convert X to Y" document so >>> I can do the driveby on the wireless stack and drivers? >> >> I'm having difficulty parsing the question, but I think you're asking >> for a howto with gotchas and caveats, etc, right? >> >> If yes, I can definitely do that. > > Jumping in in the middle. What would REALLY help is a man page that > described the API. Good point. I'll jot that one down too as an action item. -- Marcel Moolenaar marcel@xcllnt.net --Apple-Mail=_02C390B4-39A0-423B-B2C8-9A7A8941D148 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iEYEARECAAYFAlON/I8ACgkQpgWlLWHuifaBPQCfQDA6m+wrRzdjXTh3HpzAvoWK /C4An1iHUDzOD0muhZKSBPP/y7kasEPD =OoTm -----END PGP SIGNATURE----- --Apple-Mail=_02C390B4-39A0-423B-B2C8-9A7A8941D148-- From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 17:06:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E7ED120; Tue, 3 Jun 2014 17:06:02 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CBED82072; Tue, 3 Jun 2014 17:06:01 +0000 (UTC) Received: from [192.168.0.96] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.7) with ESMTP id s53H5tNk070916 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 3 Jun 2014 17:05:58 GMT (envelope-from theraven@theravensnest.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net From: David Chisnall In-Reply-To: Date: Tue, 3 Jun 2014 18:05:50 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201406021754.s52Hsd1B039620@svn.freebsd.org> <20140603012939.GA2998@michelle.cdnetworks.com> To: Adrian Chadd X-Mailer: Apple Mail (2.1874) Cc: Yong-Hyeon Pyun , Marcel Moolenaar , "svn-src-all@freebsd.org" , Marcel Moolenaar , "src-committers@freebsd.org" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 17:06:02 -0000 On 3 Jun 2014, at 06:01, Adrian Chadd wrote: > I wonder if in the short term we should just use inlines for now, at > least so the methodization can get done without hurting people on > ARM/MIPS. It's probably worth thinking a bit more carefully about the KPI, since = it's something we'll likely be stuck with for a long time... If access to a particular field is on the hot path, and you're never = going to want to do interposition, then the obvious thing to do is have = a method that returns a pointer to the field so that you can cache it in = the caller. Some thought needs to be given there as to whether these = things are _Atomic() qualified for when we (eventually) move to C11 for = the kernel. For drivers that are compiled into the kernel, there's no issue with = making the call inline, but if we want to have a stable KBI for modules = then that needs to be conditional. I'm a bit wary about things that = will introduce significant performance differences between things built = as modules and compiled into the kernel. Longer term, there's also the possibility of shipping modules as LLVM IR = and doing install-time specialisation of them against the current = kernel, which would make avoiding the function call a premature = optimisation that we'd have to keep living with. David From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 17:43:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 407A111C; Tue, 3 Jun 2014 17:43:04 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 13D932411; Tue, 3 Jun 2014 17:43:03 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s53Hh1o9042819 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 3 Jun 2014 10:43:02 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s53Hh1Rl042818; Tue, 3 Jun 2014 10:43:01 -0700 (PDT) (envelope-from jmg) Date: Tue, 3 Jun 2014 10:43:01 -0700 From: John-Mark Gurney To: Bruce Evans Subject: Re: svn commit: r266985 - head/sys/ddb Message-ID: <20140603174301.GA31367@funkthat.com> References: <201406022350.s52NoJe1096873@svn.freebsd.org> <20140603193401.W1018@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140603193401.W1018@besplex.bde.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 03 Jun 2014 10:43:02 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 17:43:04 -0000 Bruce Evans wrote this message on Tue, Jun 03, 2014 at 21:11 +1000: > On Mon, 2 Jun 2014, John-Mark Gurney wrote: > > >Log: > > handle longer commands so that lines don't overflow... people who added > > commands forgot to check this... > > Please fix the sticky "." key on your keyboard. It keeps repeating > spuriously. Also the shift key. > > The correct fix is to remove or rename the long commands. I agree, and once that has been fixed, we can change this back, but like vmstat 1, it's anoying when things overflow/wrap incorrectly... > 12 is already too long. Who wants to type 11-15 character command > names? It would be better to punish long command name[r]s using > "%-11.11s " format (with complications to avoid the trailing space(s) > in the last column). This punishment is not very severe since command > names should be unique in the first character or 2. This is needed > anyway, to avoid typing long command names. The command name parser > supports this by matching the name typed with a possibly-longer name > in the table. But then we'll have to add logic to make sure that what ever we truncate to, that they are unique, and as this width isn't a magic number, it'll be hard... Also, the feature of being able to type only partial command names is undocumented in ddb(4), so, expecting people to know this is surprising... Anyone wanting to submit patches to ddb(4), I'll review and commit... > Expanding to 16 adds the following bugs: > - reduction in the number of fields on an 80 column terminal from 6 or 7 > to 4 or 5 (from 6 * 12 + 7 or 8 left over depending on auto-wrap to > 4 * 16 + 15 or 16 left over) Yeh, it looks like autowrap isn't happening as I thought it was, and 16 is too large, and 15 would have been better to keep it at 5 columns, as countfreebufs only needs 13 characters... Once I have verified this I'll back down the width to 15... Though this is probably related to the fact that using column 80 can have issues depending if the terminal auto-continues to the next line or not, where if you unconditionally include a new line, it will then add a blank line instead of putting you back to the start... > - different mishandling of autowrap. In -current, the handling seems to > be to always waste the last 16 columns (previously only 8). This > avoids problems with auto-wrap, but the change makes it waste many > more columns. The number of fields is now 4 (was 6). 6 * 13 would > fit just as well as 6 * 12 (except for terminals with between 73 and > 78 columns). The formatting now works as follows: > The db_end_line()'s are not correctly paired with the db_printf()'s, > but they work. There is none before the first db_printf(), but callers > should arrange to start on a new line so there is no danger of > overruning the line before db_end_line() can check for overrun. Then > each db_end_line() except the last one (dynamically) is correctly paired > with the next db_printf(). Then the last db_end_line() checks for > output that will never be done. It may print a newline prematurely. > Perhaps an extra newline is printed to complete the table. This is > unclear because db_cmd_list() doesn't print one itself. I think > the prompt code _expects_ to be called with the previous line not > always terminated, and prints a newline iff necessary. > It used to give 7 fields of width 12 that were somehow usually > displayed nicely in 80 columns on a syscons terminal, depending > on whether the 12 characters printed in the 7 available columns > for the last field had enough trailing spaces. The trailing spaces > were apparently discarded by terminal magic on some terminals. But > command names of length exactly 8 gave auto-wrap problems, and ones > of length 9-12 were displayed in full and ran into the next line iff > they were in the 7th field. Command names of length 12 of course > ran into each other in any field except the last one. > > Since command namers usually get things like this wrong, short names > should be enforced by panicing for long ones. I once fixed all sleep > message strings to fit in the available 6 characters, but neglected > to enforce this, so there are many more broken ones now. This bug is > now most common in the zfs and audit subsystems. From top output: [deleted comment about wait states as unrelated to my commit] -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 17:44:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 845132A3; Tue, 3 Jun 2014 17:44:57 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CB252431; Tue, 3 Jun 2014 17:44:56 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s53Hitbv042877 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 3 Jun 2014 10:44:56 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s53Hitfa042876; Tue, 3 Jun 2014 10:44:55 -0700 (PDT) (envelope-from jmg) Date: Tue, 3 Jun 2014 10:44:55 -0700 From: John-Mark Gurney To: Marcel Moolenaar Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net Message-ID: <20140603174455.GB31367@funkthat.com> References: <201406021754.s52Hsd1B039620@svn.freebsd.org> <3DD60E8E-7B9B-4CF2-823F-3BF3469EB0C3@neville-neil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 03 Jun 2014 10:44:56 -0700 (PDT) Cc: Adrian Chadd , Marcel Moolenaar , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "svn-src-head@freebsd.org" , George Neville-Neil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 17:44:57 -0000 Marcel Moolenaar wrote this message on Tue, Jun 03, 2014 at 09:49 -0700: > > On Jun 3, 2014, at 9:46 AM, George Neville-Neil wrote: > > > On 2 Jun 2014, at 14:37, Marcel Moolenaar wrote: > > > >> On Jun 2, 2014, at 11:26 AM, Adrian Chadd wrote: > >> > >>> Woo! > >>> > >>> Would you mind doing up a 30 second "what convert X to Y" document so > >>> I can do the driveby on the wireless stack and drivers? > >> > >> I'm having difficulty parsing the question, but I think you're asking > >> for a howto with gotchas and caveats, etc, right? > >> > >> If yes, I can definitely do that. > > > > Jumping in in the middle. What would REALLY help is a man page that > > described the API. > > Good point. I'll jot that one down too as an action item. Don't like issues like not knowing mdoc stop you from writting one.. I know the -doc people are interested in helping, and I am too... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 17:53:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19EA04BD; Tue, 3 Jun 2014 17:53:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E01C72511; Tue, 3 Jun 2014 17:53:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s53HrBEl095508; Tue, 3 Jun 2014 17:53:11 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s53HrB6X095507; Tue, 3 Jun 2014 17:53:11 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406031753.s53HrB6X095507@svn.freebsd.org> From: Ed Maste Date: Tue, 3 Jun 2014 17:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267011 - head/tools/tools/vt/fontcvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 17:53:12 -0000 Author: emaste Date: Tue Jun 3 17:53:11 2014 New Revision: 267011 URL: http://svnweb.freebsd.org/changeset/base/267011 Log: vt fontcvt: Make height and width optional arguments Now defaults to a 16x8 font size. The height and width can be specified using -h and -w respectively. Sponsored by: The FreeBSD Foundation Modified: head/tools/tools/vt/fontcvt/fontcvt.c Modified: head/tools/tools/vt/fontcvt/fontcvt.c ============================================================================== --- head/tools/tools/vt/fontcvt/fontcvt.c Tue Jun 3 14:50:51 2014 (r267010) +++ head/tools/tools/vt/fontcvt/fontcvt.c Tue Jun 3 17:53:11 2014 (r267011) @@ -39,12 +39,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define VFNT_MAPS 4 #define VFNT_MAP_NORMAL 0 #define VFNT_MAP_BOLD 2 -static unsigned int width, wbytes, height; +static unsigned int width = 8, wbytes, height = 16; struct glyph { TAILQ_ENTRY(glyph) g_list; @@ -83,7 +84,7 @@ usage(void) { fprintf(stderr, -"usage: fontcvt width height normal.bdf bold.bdf out.fnt\n"); +"usage: fontcvt [-w width] [-h height] normal.bdf bold.bdf out.fnt\n"); exit(1); } @@ -384,27 +385,42 @@ write_fnt(const char *filename) int main(int argc, char *argv[]) { + int ch; assert(sizeof(struct file_header) == 32); assert(sizeof(struct file_mapping) == 8); - if (argc != 6) + while ((ch = getopt(argc, argv, "h:w:")) != -1) { + switch (ch) { + case 'h': + height = atoi(optarg); + break; + case 'w': + height = atoi(optarg); + break; + case '?': + default: + usage(); + } + } + argc -= optind; + argv += optind; + + if (argc != 3) usage(); - - width = atoi(argv[1]); + wbytes = howmany(width, 8); - height = atoi(argv[2]); - if (parse_bdf(argv[3], VFNT_MAP_NORMAL) != 0) + if (parse_bdf(argv[0], VFNT_MAP_NORMAL) != 0) return (1); - if (parse_bdf(argv[4], VFNT_MAP_BOLD) != 0) + if (parse_bdf(argv[1], VFNT_MAP_BOLD) != 0) return (1); number_glyphs(); fold_mappings(0); fold_mappings(1); fold_mappings(2); fold_mappings(3); - if (write_fnt(argv[5]) != 0) + if (write_fnt(argv[2]) != 0) return (1); printf( From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 17:54:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B6F1603; Tue, 3 Jun 2014 17:54:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07D38251A; Tue, 3 Jun 2014 17:54:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s53HsIbs095684; Tue, 3 Jun 2014 17:54:18 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s53HsIsI095683; Tue, 3 Jun 2014 17:54:18 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406031754.s53HsIsI095683@svn.freebsd.org> From: Ed Maste Date: Tue, 3 Jun 2014 17:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267012 - head/tools/tools/vt/fontcvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 17:54:19 -0000 Author: emaste Date: Tue Jun 3 17:54:18 2014 New Revision: 267012 URL: http://svnweb.freebsd.org/changeset/base/267012 Log: vt fontcvt: Make the bold font optional Sponsored by: The FreeBSD Foundation Modified: head/tools/tools/vt/fontcvt/fontcvt.c Modified: head/tools/tools/vt/fontcvt/fontcvt.c ============================================================================== --- head/tools/tools/vt/fontcvt/fontcvt.c Tue Jun 3 17:53:11 2014 (r267011) +++ head/tools/tools/vt/fontcvt/fontcvt.c Tue Jun 3 17:54:18 2014 (r267012) @@ -84,7 +84,7 @@ usage(void) { fprintf(stderr, -"usage: fontcvt [-w width] [-h height] normal.bdf bold.bdf out.fnt\n"); +"usage: fontcvt [-w width] [-h height] normal.bdf [bold.bdf] out.fnt\n"); exit(1); } @@ -406,21 +406,27 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - if (argc != 3) + if (argc < 2 || argc > 3) usage(); wbytes = howmany(width, 8); if (parse_bdf(argv[0], VFNT_MAP_NORMAL) != 0) return (1); - if (parse_bdf(argv[1], VFNT_MAP_BOLD) != 0) - return (1); + argc--; + argv++; + if (argc == 2) { + if (parse_bdf(argv[0], VFNT_MAP_BOLD) != 0) + return (1); + argc--; + argv++; + } number_glyphs(); fold_mappings(0); fold_mappings(1); fold_mappings(2); fold_mappings(3); - if (write_fnt(argv[2]) != 0) + if (write_fnt(argv[0]) != 0) return (1); printf( From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 19:01:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16D88D43; Tue, 3 Jun 2014 19:01:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03A1A2AEC; Tue, 3 Jun 2014 19:01:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s53J1csf026706; Tue, 3 Jun 2014 19:01:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s53J1cTf026705; Tue, 3 Jun 2014 19:01:38 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201406031901.s53J1cTf026705@svn.freebsd.org> From: Xin LI Date: Tue, 3 Jun 2014 19:01:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267013 - head/contrib/openpam/lib/libpam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 19:01:39 -0000 Author: delphij Date: Tue Jun 3 19:01:38 2014 New Revision: 267013 URL: http://svnweb.freebsd.org/changeset/base/267013 Log: Fix incorrect error handling in PAM policy parser. [SA-14:13] Modified: head/contrib/openpam/lib/libpam/openpam_configure.c Modified: head/contrib/openpam/lib/libpam/openpam_configure.c ============================================================================== --- head/contrib/openpam/lib/libpam/openpam_configure.c Tue Jun 3 17:54:18 2014 (r267012) +++ head/contrib/openpam/lib/libpam/openpam_configure.c Tue Jun 3 19:01:38 2014 (r267013) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2001-2003 Networks Associates Technology, Inc. - * Copyright (c) 2004-2012 Dag-Erling Smørgrav + * Copyright (c) 2004-2014 Dag-Erling Smørgrav * All rights reserved. * * This software was developed for the FreeBSD Project by ThinkSec AS and @@ -193,6 +193,7 @@ openpam_parse_chain(pam_handle_t *pamh, openpam_log(PAM_LOG_ERROR, "%s(%d): missing or invalid facility", filename, lineno); + errno = EINVAL; goto fail; } if (facility != fclt && facility != PAM_FACILITY_ANY) { @@ -208,18 +209,28 @@ openpam_parse_chain(pam_handle_t *pamh, openpam_log(PAM_LOG_ERROR, "%s(%d): missing or invalid service name", filename, lineno); + errno = EINVAL; goto fail; } if (wordv[i] != NULL) { openpam_log(PAM_LOG_ERROR, "%s(%d): garbage at end of line", filename, lineno); + errno = EINVAL; goto fail; } ret = openpam_load_chain(pamh, servicename, fclt); FREEV(wordc, wordv); - if (ret < 0) + if (ret < 0) { + /* + * Bogus errno, but this ensures that the + * outer loop does not just ignore the + * error and keep searching. + */ + if (errno == ENOENT) + errno = EINVAL; goto fail; + } continue; } @@ -229,6 +240,7 @@ openpam_parse_chain(pam_handle_t *pamh, openpam_log(PAM_LOG_ERROR, "%s(%d): missing or invalid control flag", filename, lineno); + errno = EINVAL; goto fail; } @@ -238,6 +250,7 @@ openpam_parse_chain(pam_handle_t *pamh, openpam_log(PAM_LOG_ERROR, "%s(%d): missing or invalid module name", filename, lineno); + errno = EINVAL; goto fail; } @@ -247,8 +260,11 @@ openpam_parse_chain(pam_handle_t *pamh, this->flag = ctlf; /* load module */ - if ((this->module = openpam_load_module(modulename)) == NULL) + if ((this->module = openpam_load_module(modulename)) == NULL) { + if (errno == ENOENT) + errno = ENOEXEC; goto fail; + } /* * The remaining items in wordv are the module's @@ -281,7 +297,11 @@ openpam_parse_chain(pam_handle_t *pamh, * The loop ended because openpam_readword() returned NULL, which * can happen for four different reasons: an I/O error (ferror(f) * is true), a memory allocation failure (ferror(f) is false, - * errno is non-zero) + * feof(f) is false, errno is non-zero), the file ended with an + * unterminated quote or backslash escape (ferror(f) is false, + * feof(f) is true, errno is non-zero), or the end of the file was + * reached without error (ferror(f) is false, feof(f) is true, + * errno is zero). */ if (ferror(f) || errno != 0) goto syserr; @@ -402,6 +422,9 @@ openpam_load_chain(pam_handle_t *pamh, } ret = openpam_load_file(pamh, service, facility, filename, style); + /* success */ + if (ret > 0) + RETURNN(ret); /* the file exists, but an error occurred */ if (ret == -1 && errno != ENOENT) RETURNN(ret); @@ -411,7 +434,8 @@ openpam_load_chain(pam_handle_t *pamh, } /* no hit */ - RETURNN(0); + errno = ENOENT; + RETURNN(-1); } /* @@ -432,8 +456,10 @@ openpam_configure(pam_handle_t *pamh, openpam_log(PAM_LOG_ERROR, "invalid service name"); RETURNC(PAM_SYSTEM_ERR); } - if (openpam_load_chain(pamh, service, PAM_FACILITY_ANY) < 0) - goto load_err; + if (openpam_load_chain(pamh, service, PAM_FACILITY_ANY) < 0) { + if (errno != ENOENT) + goto load_err; + } for (fclt = 0; fclt < PAM_NUM_FACILITIES; ++fclt) { if (pamh->chains[fclt] != NULL) continue; From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 19:20:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A171C290; Tue, 3 Jun 2014 19:20:22 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 4AAE02CED; Tue, 3 Jun 2014 19:20:21 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id ECB481045867; Wed, 4 Jun 2014 04:58:52 +1000 (EST) Date: Wed, 4 Jun 2014 04:58:46 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John-Mark Gurney Subject: Re: svn commit: r266985 - head/sys/ddb In-Reply-To: <20140603174301.GA31367@funkthat.com> Message-ID: <20140604034825.D3520@besplex.bde.org> References: <201406022350.s52NoJe1096873@svn.freebsd.org> <20140603193401.W1018@besplex.bde.org> <20140603174301.GA31367@funkthat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=QIpRGG7L c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=Mtxxv-QYS58A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=PvGfoO7WqQUQVrqFx4QA:9 a=6ZgNavTZfb1XXPiL:21 a=YY_KByE-cBk4sRAW:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 19:20:22 -0000 On Tue, 3 Jun 2014, John-Mark Gurney wrote: > Bruce Evans wrote this message on Tue, Jun 03, 2014 at 21:11 +1000: >> On Mon, 2 Jun 2014, John-Mark Gurney wrote: >> >>> Log: >>> handle longer commands so that lines don't overflow... people who added >>> commands forgot to check this... > ... >> 12 is already too long. Who wants to type 11-15 character command >> names? It would be better to punish long command name[r]s using >> "%-11.11s " format (with complications to avoid the trailing space(s) >> in the last column). This punishment is not very severe since command >> names should be unique in the first character or 2. This is needed >> anyway, to avoid typing long command names. The command name parser >> supports this by matching the name typed with a possibly-longer name >> in the table. > > But then we'll have to add logic to make sure that what ever we > truncate to, that they are unique, and as this width isn't a magic > number, it'll be hard... The list of commands is mainly a hint. Doesn't matter much if the names are truncated. (It matters that the list is unsorted (even the static part of it in the source code is unsorted, and the man page is only partly sorted) so it is hard to find things in it.) > Also, the feature of being able to type only partial command names > is undocumented in ddb(4), so, expecting people to know this is > surprising... Many of the standard ones like s (step) are documented, and are also implemented as a separate command. This implementation is to make s unambiguous. Otherwise you would have to type st to disambiguate it from other commands starting with s. People should know this without documentation. Who would expect to type "step" instead of "s"? "step" and "s" are compatible with gdb. I don't remember ever typing "step" in either. (Even "s is too much to type. Better debuggers give the alternative of using a single function key for stepping if the console has function keys.) In gdb, the history makes longer commands easier to type by copying lines from history. History in ddb doesn't work so well, since it is tiny, unsearchable, and quickly fills up with garbage. The history buffer of size 2048 should be able to hold 2048 s commands even without discarding duplicates, but actually fills up with just 2048/DB_MAXLINE = 17 repeated s commands. There is no documented or explicit alias for "show", but I don't remember ever typing anything except "sh" for it. > Anyone wanting to submit patches to ddb(4), I'll review and commit... > >> Expanding to 16 adds the following bugs: >> - reduction in the number of fields on an 80 column terminal from 6 or 7 >> to 4 or 5 (from 6 * 12 + 7 or 8 left over depending on auto-wrap to >> 4 * 16 + 15 or 16 left over) > > Yeh, it looks like autowrap isn't happening as I thought it was, and > 16 is too large, and 15 would have been better to keep it at 5 columns, > as countfreebufs only needs 13 characters... Once I have verified this > I'll back down the width to 15... Just as easy to fix countfreebufs if it is the only one longer than 11. Or just remove countfreebufs. It is doesn't exist according to ddb.4 :-). countfreebufs actually needs 14 (1 for a separator). 6*14 exceeds 80, but 5*14 is still better than 5*15 since it works down to 71-column terminals and is easier to read by not leaving so much white space between fields. There may be several other nonexistent commands outside of the primary command table. These need documentation more than the primary ones since they are harder to find in the source code. In the primary command tables, only the following names are longer than 8: - "registers" (length 9). Only in the "show" subtable. - "findstack" (length 9) In FreeBSD-5.2, there was only 1 dynamic extension with a name longer than 8: "lockedvnods". This is an especially stupid name. It is very verbose, but saves a whole character by abbreviating "virtual (?) inode" as "vnod" instead of as the usual "vn". > Though this is probably related to the fact that using column 80 can > have issues depending if the terminal auto-continues to the next line > or not, where if you unconditionally include a new line, it will then > add a blank line instead of putting you back to the start... Sure. 1 is subtracted from the terminal width to avoid problems with auto-wrap provided the line length is never exceeded. Width 80 is hard-coded as 79 in the initializer for db_max_width. You have to change this using the maxwidth variable if you are on a terminal with a different width, or better change the terminal. db_printf() does tab expansion to help keep track of the output position, so this has a chance of working. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 19:24:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD5C579F; Tue, 3 Jun 2014 19:24:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DDE22D96; Tue, 3 Jun 2014 19:24:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s53JOsC7037464; Tue, 3 Jun 2014 19:24:54 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s53JOrT3037460; Tue, 3 Jun 2014 19:24:53 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201406031924.s53JOrT3037460@svn.freebsd.org> From: Luiz Otavio O Souza Date: Tue, 3 Jun 2014 19:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267021 - in head/sys: arm/broadcom/bcm2835 arm/ti boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 19:24:54 -0000 Author: loos Date: Tue Jun 3 19:24:53 2014 New Revision: 267021 URL: http://svnweb.freebsd.org/changeset/base/267021 Log: FreeBSD, historically, has always used 8-bit addresses for i2c devices (7-bit device address << 1), always leaving the room for the read/write bit. This commit convert ti_i2c and revert r259127 on bcm2835_bsc to make them compatible with 8-bit addresses. Previous to this commit an i2c device would have different addresses depending on the controller it was attached to (by example, when compared to any iicbb(4) based i2c controller), which was a pretty annoying behavior. Also, update the PMIC i2c address on beaglebone* DTS files to match the new address scheme. Now the userland utilities need to do the correct slave address shifting (but it is going to work with any i2c controller on the system). Discussed with: ian MFC after: 2 weeks Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c head/sys/arm/ti/ti_i2c.c head/sys/boot/fdt/dts/arm/beaglebone-black.dts head/sys/boot/fdt/dts/arm/beaglebone.dts Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Tue Jun 3 19:06:47 2014 (r267020) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Tue Jun 3 19:24:53 2014 (r267021) @@ -407,7 +407,7 @@ bcm_bsc_transfer(device_t dev, struct ii for (i = 0; i < nmsgs; i++) { /* Write the slave address. */ - BCM_BSC_WRITE(sc, BCM_BSC_SLAVE, msgs[i].slave); + BCM_BSC_WRITE(sc, BCM_BSC_SLAVE, msgs[i].slave >> 1); /* Write the data length. */ BCM_BSC_WRITE(sc, BCM_BSC_DLEN, msgs[i].len); Modified: head/sys/arm/ti/ti_i2c.c ============================================================================== --- head/sys/arm/ti/ti_i2c.c Tue Jun 3 19:06:47 2014 (r267020) +++ head/sys/arm/ti/ti_i2c.c Tue Jun 3 19:24:53 2014 (r267021) @@ -763,7 +763,7 @@ ti_i2c_transfer(device_t dev, struct iic } /* set the slave address */ - ti_i2c_write_reg(sc, I2C_REG_SA, msgs[i].slave); + ti_i2c_write_reg(sc, I2C_REG_SA, msgs[i].slave >> 1); /* perform the read or write */ if (msgs[i].flags & IIC_M_RD) { Modified: head/sys/boot/fdt/dts/arm/beaglebone-black.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/beaglebone-black.dts Tue Jun 3 19:06:47 2014 (r267020) +++ head/sys/boot/fdt/dts/arm/beaglebone-black.dts Tue Jun 3 19:24:53 2014 (r267021) @@ -149,7 +149,7 @@ i2c@44e0b000 { pmic@24 { compatible = "ti,am335x-pmic"; - reg = <0x24>; + reg = <0x48>; }; }; }; Modified: head/sys/boot/fdt/dts/arm/beaglebone.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/beaglebone.dts Tue Jun 3 19:06:47 2014 (r267020) +++ head/sys/boot/fdt/dts/arm/beaglebone.dts Tue Jun 3 19:24:53 2014 (r267021) @@ -133,7 +133,7 @@ i2c@44e0b000 { pmic@24 { compatible = "ti,am335x-pmic"; - reg = <0x24>; + reg = <0x48>; }; }; }; From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 19:31:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28F58C2C; Tue, 3 Jun 2014 19:31:58 +0000 (UTC) Received: from mail-ve0-x229.google.com (mail-ve0-x229.google.com [IPv6:2607:f8b0:400c:c01::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B90DD2E55; Tue, 3 Jun 2014 19:31:57 +0000 (UTC) Received: by mail-ve0-f169.google.com with SMTP id jx11so7574805veb.14 for ; Tue, 03 Jun 2014 12:31:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=O2rvMvf6FjWvK9Zxr3bDeqbvM1N0mao74d/qDX00kU8=; b=ZTgtCBfcYHNh7y9uxXehk1B9kbmOxsEfHmEeMo2LN1QRGR8VFZ0Mh7OYrLpSw4ZBn3 0VLDfsuBIkB2tset1mPCWmOtFDFHh4WeirmHoLhwfsrvWD6BdFhO1o3+IrpNBywEtEb7 RENmJKM/Tw4gk/f2SYHmLBZnHwIZyk4FUEDP6xhLr5I/FlXkQuY6LSH040wrrR47K3Jl H62UA6A4ERLGr/yDpaIMbbGh+TzWuZQprU6hvIccqpbknlSmvF4P/UMJBhFtqXmiLDOJ SkspehTFV3q3xF04OQDpvlG9QoKj8CRv1iB7wlsFFRzkpkom0CCvx4AMcrj2GJxOsMMG csTA== X-Received: by 10.58.47.36 with SMTP id a4mr4040025ven.63.1401823916859; Tue, 03 Jun 2014 12:31:56 -0700 (PDT) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.58.24.72 with HTTP; Tue, 3 Jun 2014 12:31:16 -0700 (PDT) In-Reply-To: <20140602223124.GB43976@funkthat.com> References: <201406021505.s52F5P1D064451@svn.freebsd.org> <20140602223124.GB43976@funkthat.com> From: Ivan Voras Date: Tue, 3 Jun 2014 21:31:16 +0200 X-Google-Sender-Auth: vPLBIN1ceZ1gEvlLN7E40CPXwgk Message-ID: Subject: Re: svn commit: r266972 - head/sbin/geom/class/label To: John-Mark Gurney Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 19:31:58 -0000 Hi, None of the other classes have the sysctls documented here, there's only a description of the kern.geom.label.debug flag. I guess adding a wildcard catch-all section for the kern.geom.label.*.enable would be best here. On 3 June 2014 00:31, John-Mark Gurney wrote: > Ivan Voras wrote this message on Mon, Jun 02, 2014 at 15:05 +0000: >> Author: ivoras >> Date: Mon Jun 2 15:05:25 2014 >> New Revision: 266972 >> URL: http://svnweb.freebsd.org/changeset/base/266972 >> >> Log: >> Document the diskid automatic label class. >> While there, also document the glabel "native" labels and explain why >> there are additional nodes created for nested GEOM classes. >> >> Reminded by: jmg > > Shouldn't kern.geom.label.disk_ident.enable also be documented here? > > Thanks! > > -- > John-Mark Gurney Voice: +1 415 225 5579 > > "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 19:44:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98EAD829; Tue, 3 Jun 2014 19:44:02 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 56CB222A7; Tue, 3 Jun 2014 19:44:02 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s53Ji0fU044709 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 3 Jun 2014 12:44:01 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s53Ji0lg044708; Tue, 3 Jun 2014 12:44:00 -0700 (PDT) (envelope-from jmg) Date: Tue, 3 Jun 2014 12:44:00 -0700 From: John-Mark Gurney To: Ivan Voras Subject: Re: svn commit: r266972 - head/sbin/geom/class/label Message-ID: <20140603194400.GG31367@funkthat.com> References: <201406021505.s52F5P1D064451@svn.freebsd.org> <20140602223124.GB43976@funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 03 Jun 2014 12:44:01 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 19:44:02 -0000 Ivan Voras wrote this message on Tue, Jun 03, 2014 at 21:31 +0200: > None of the other classes have the sysctls documented here, there's > only a description of the kern.geom.label.debug flag. That's probably because people haven't spent much time documenting their code... Just because other classes have bad documentation doesn't mean glabel should have bad docs... If you don't want to document the sysctl's on glabel(8), another option is to create a new page, glabel(9), xref it on glabel(8) and document it there, but that seems excesive, unless you need to document more specific kernel features of glabel... Plus, it'd make it harder for users to track down.. > I guess adding a wildcard catch-all section for the > kern.geom.label.*.enable would be best here. Yes, that would be useful, even just mentioning the sysctl tree is good... And since we've started adding descriptions to your sysctls, they are somewhat self documenting now, just need to know that they exist... Thanks. > On 3 June 2014 00:31, John-Mark Gurney wrote: > > Ivan Voras wrote this message on Mon, Jun 02, 2014 at 15:05 +0000: > >> Author: ivoras > >> Date: Mon Jun 2 15:05:25 2014 > >> New Revision: 266972 > >> URL: http://svnweb.freebsd.org/changeset/base/266972 > >> > >> Log: > >> Document the diskid automatic label class. > >> While there, also document the glabel "native" labels and explain why > >> there are additional nodes created for nested GEOM classes. > >> > >> Reminded by: jmg > > > > Shouldn't kern.geom.label.disk_ident.enable also be documented here? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 20:58:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D1B01EA; Tue, 3 Jun 2014 20:58:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1ACF729D7; Tue, 3 Jun 2014 20:58:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s53KwBK4081028; Tue, 3 Jun 2014 20:58:11 GMT (envelope-from gahr@svn.freebsd.org) Received: (from gahr@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s53KwBQ7081027; Tue, 3 Jun 2014 20:58:11 GMT (envelope-from gahr@svn.freebsd.org) Message-Id: <201406032058.s53KwBQ7081027@svn.freebsd.org> From: Pietro Cerutti Date: Tue, 3 Jun 2014 20:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267026 - head/usr.bin/users X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 20:58:12 -0000 Author: gahr (ports committer) Date: Tue Jun 3 20:58:11 2014 New Revision: 267026 URL: http://svnweb.freebsd.org/changeset/base/267026 Log: - style, remove (void) in front of printf and the like CR: D161 Approved by: cognet, bapt Modified: head/usr.bin/users/users.c Modified: head/usr.bin/users/users.c ============================================================================== --- head/usr.bin/users/users.c Tue Jun 3 20:27:07 2014 (r267025) +++ head/usr.bin/users/users.c Tue Jun 3 20:58:11 2014 (r267026) @@ -86,17 +86,17 @@ main(int argc, char **argv) /* NOTREACHED */ } } - (void)strlcpy(names[ncnt], ut->ut_user, sizeof(*names)); + strlcpy(names[ncnt], ut->ut_user, sizeof(*names)); ++ncnt; } endutxent(); if (ncnt > 0) { qsort(names, ncnt, sizeof(namebuf), scmp); - (void)printf("%s", names[0]); + printf("%s", names[0]); for (cnt = 1; cnt < ncnt; ++cnt) if (strcmp(names[cnt], names[cnt - 1]) != 0) - (void)printf(" %s", names[cnt]); - (void)printf("\n"); + printf(" %s", names[cnt]); + printf("\n"); } exit(0); } @@ -104,7 +104,7 @@ main(int argc, char **argv) static void usage(void) { - (void)fprintf(stderr, "usage: users\n"); + fprintf(stderr, "usage: users\n"); exit(1); } From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 20:59:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22D2B351; Tue, 3 Jun 2014 20:59:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1075829E2; Tue, 3 Jun 2014 20:59:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s53KxQcq081244; Tue, 3 Jun 2014 20:59:26 GMT (envelope-from gahr@svn.freebsd.org) Received: (from gahr@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s53KxQAp081243; Tue, 3 Jun 2014 20:59:26 GMT (envelope-from gahr@svn.freebsd.org) Message-Id: <201406032059.s53KxQAp081243@svn.freebsd.org> From: Pietro Cerutti Date: Tue, 3 Jun 2014 20:59:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267027 - head/usr.bin/users X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 20:59:27 -0000 Author: gahr (ports committer) Date: Tue Jun 3 20:59:26 2014 New Revision: 267027 URL: http://svnweb.freebsd.org/changeset/base/267027 Log: - Avoid calling a wrapper function around strcmp - Use sizeof(*array) instead of sizeof(element) everywhere CR: D161 Approved by: cognet, bapt Modified: head/usr.bin/users/users.c Modified: head/usr.bin/users/users.c ============================================================================== --- head/usr.bin/users/users.c Tue Jun 3 20:58:11 2014 (r267026) +++ head/usr.bin/users/users.c Tue Jun 3 20:59:26 2014 (r267027) @@ -50,9 +50,9 @@ static const char rcsid[] = #include #include -typedef char namebuf[sizeof(((struct utmpx *)0)->ut_user) + 1]; +typedef char namebuf[sizeof(((struct utmpx *)0)->ut_user) + 1]; +typedef int (*scmp)(const void *, const void *); -int scmp(const void *, const void *); static void usage(void); int @@ -91,7 +91,7 @@ main(int argc, char **argv) } endutxent(); if (ncnt > 0) { - qsort(names, ncnt, sizeof(namebuf), scmp); + qsort(names, ncnt, sizeof(*names), (scmp)strcmp); printf("%s", names[0]); for (cnt = 1; cnt < ncnt; ++cnt) if (strcmp(names[cnt], names[cnt - 1]) != 0) @@ -107,10 +107,3 @@ usage(void) fprintf(stderr, "usage: users\n"); exit(1); } - -int -scmp(const void *p, const void *q) -{ - - return (strcmp(p, q)); -} From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 21:03:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27EF9738; Tue, 3 Jun 2014 21:03:04 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E13142A9C; Tue, 3 Jun 2014 21:03:03 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s53L32KI045890 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 3 Jun 2014 14:03:03 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s53L32Qj045889; Tue, 3 Jun 2014 14:03:02 -0700 (PDT) (envelope-from jmg) Date: Tue, 3 Jun 2014 14:03:02 -0700 From: John-Mark Gurney To: Luiz Otavio O Souza Subject: Re: svn commit: r267021 - in head/sys: arm/broadcom/bcm2835 arm/ti boot/fdt/dts/arm Message-ID: <20140603210302.GK31367@funkthat.com> References: <201406031924.s53JOrT3037460@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201406031924.s53JOrT3037460@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 03 Jun 2014 14:03:03 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 21:03:04 -0000 Luiz Otavio O Souza wrote this message on Tue, Jun 03, 2014 at 19:24 +0000: > Author: loos > Date: Tue Jun 3 19:24:53 2014 > New Revision: 267021 > URL: http://svnweb.freebsd.org/changeset/base/267021 > > Log: > FreeBSD, historically, has always used 8-bit addresses for i2c devices > (7-bit device address << 1), always leaving the room for the read/write bit. > > This commit convert ti_i2c and revert r259127 on bcm2835_bsc to make them > compatible with 8-bit addresses. Previous to this commit an i2c device > would have different addresses depending on the controller it was attached > to (by example, when compared to any iicbb(4) based i2c controller), which > was a pretty annoying behavior. > > Also, update the PMIC i2c address on beaglebone* DTS files to match the new > address scheme. > > Now the userland utilities need to do the correct slave address shifting > (but it is going to work with any i2c controller on the system). > > Discussed with: ian > MFC after: 2 weeks We should probably document this in the iicbus(4) or iic(4) man page, want to do the honors? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 21:06:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 245E993B; Tue, 3 Jun 2014 21:06:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11AB12ABF; Tue, 3 Jun 2014 21:06:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s53L63KX085625; Tue, 3 Jun 2014 21:06:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s53L63oR085624; Tue, 3 Jun 2014 21:06:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406032106.s53L63oR085624@svn.freebsd.org> From: Alexander Motin Date: Tue, 3 Jun 2014 21:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267029 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 21:06:04 -0000 Author: mav Date: Tue Jun 3 21:06:03 2014 New Revision: 267029 URL: http://svnweb.freebsd.org/changeset/base/267029 Log: Replace gethrtime() with cpu_ticks(), as source of random for the taskqueue selection. gethrtime() in our port updated with HZ rate, so unusable for this specific purpose, completely draining benefit of multiple taskqueues. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jun 3 21:02:19 2014 (r267028) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jun 3 21:06:03 2014 (r267029) @@ -953,7 +953,7 @@ spa_taskq_dispatch_ent(spa_t *spa, zio_t if (tqs->stqs_count == 1) { tq = tqs->stqs_taskq[0]; } else { - tq = tqs->stqs_taskq[gethrtime() % tqs->stqs_count]; + tq = tqs->stqs_taskq[cpu_ticks() % tqs->stqs_count]; } taskq_dispatch_ent(tq, func, arg, flags, ent); From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 21:31:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3EBAF8F; Tue, 3 Jun 2014 21:31:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1C7D2D25; Tue, 3 Jun 2014 21:31:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s53LVS3l098607; Tue, 3 Jun 2014 21:31:28 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s53LVSkp098606; Tue, 3 Jun 2014 21:31:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201406032131.s53LVSkp098606@svn.freebsd.org> From: Xin LI Date: Tue, 3 Jun 2014 21:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267030 - head/sys/dev/hpt27xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 21:31:28 -0000 Author: delphij Date: Tue Jun 3 21:31:28 2014 New Revision: 267030 URL: http://svnweb.freebsd.org/changeset/base/267030 Log: Don't leak Giant. Noticed by: Sascha Wildner (DragonFlyBSD) via IRC Reviewed by: mav MFC after: 3 days Modified: head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Modified: head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c ============================================================================== --- head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Tue Jun 3 21:06:03 2014 (r267029) +++ head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Tue Jun 3 21:31:28 2014 (r267030) @@ -1345,17 +1345,19 @@ static int hpt_rescan_bus(void) ldm_for_each_vbus(vbus, vbus_ext) { if ((ccb = xpt_alloc_ccb()) == NULL) { + mtx_unlock(&Giant); return(ENOMEM); } if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(vbus_ext->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_free_ccb(ccb); + mtx_unlock(&Giant); return(EIO); } xpt_rescan(ccb); } mtx_unlock(&Giant); - return(0); + return(0); } From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 21:46:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7EB6B426; Tue, 3 Jun 2014 21:46:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C25C2E3E; Tue, 3 Jun 2014 21:46:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s53LkEfl003908; Tue, 3 Jun 2014 21:46:14 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s53LkEPb003907; Tue, 3 Jun 2014 21:46:14 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201406032146.s53LkEPb003907@svn.freebsd.org> From: John-Mark Gurney Date: Tue, 3 Jun 2014 21:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267031 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 21:46:14 -0000 Author: jmg Date: Tue Jun 3 21:46:13 2014 New Revision: 267031 URL: http://svnweb.freebsd.org/changeset/base/267031 Log: don't check fs_flags for _FLAGS_UPDATED as it is stored in fs_old_flags.. If you had a UFS2 FS that didn't have it's super block at SBLOCK_UFS2, you'll end up corrupting your FS as the superblock is updated and written to a different location... makefs used to put the superblock at SBLOCK_UFS1 for UFS 2 FS's causing this issue... Reviewed by: silience from mckusick MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Tue Jun 3 21:31:28 2014 (r267030) +++ head/sys/ufs/ffs/ffs_vfsops.c Tue Jun 3 21:46:13 2014 (r267031) @@ -1931,13 +1931,13 @@ ffs_sbupdate(ump, waitfor, suspended) } bp = sbbp; if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_sblockloc != SBLOCK_UFS1 && - (fs->fs_flags & FS_FLAGS_UPDATED) == 0) { + (fs->fs_old_flags & FS_FLAGS_UPDATED) == 0) { printf("WARNING: %s: correcting fs_sblockloc from %jd to %d\n", fs->fs_fsmnt, fs->fs_sblockloc, SBLOCK_UFS1); fs->fs_sblockloc = SBLOCK_UFS1; } if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_sblockloc != SBLOCK_UFS2 && - (fs->fs_flags & FS_FLAGS_UPDATED) == 0) { + (fs->fs_old_flags & FS_FLAGS_UPDATED) == 0) { printf("WARNING: %s: correcting fs_sblockloc from %jd to %d\n", fs->fs_fsmnt, fs->fs_sblockloc, SBLOCK_UFS2); fs->fs_sblockloc = SBLOCK_UFS2; From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 22:34:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F35D37E3; Tue, 3 Jun 2014 22:34:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E008A22FD; Tue, 3 Jun 2014 22:34:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s53MYRHR031883; Tue, 3 Jun 2014 22:34:27 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s53MYRk1031881; Tue, 3 Jun 2014 22:34:27 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201406032234.s53MYRk1031881@svn.freebsd.org> From: Julio Merino Date: Tue, 3 Jun 2014 22:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267033 - in head: share/man/man5 tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 22:34:28 -0000 Author: jmmv Date: Tue Jun 3 22:34:27 2014 New Revision: 267033 URL: http://svnweb.freebsd.org/changeset/base/267033 Log: Merge (unused) documentation of WITHOUT_TESTS into WITH_TESTS. The description of WITH/WITHOUT tweaks should only document the non-default option. TESTS still defaults to no, so the option to be documented is WITH_TESTS. Deleted: head/tools/build/options/WITHOUT_TESTS Modified: head/share/man/man5/src.conf.5 head/tools/build/options/WITH_TESTS Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue Jun 3 22:26:46 2014 (r267032) +++ head/share/man/man5/src.conf.5 Tue Jun 3 22:34:27 2014 (r267033) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd May 27, 2014 +.Dd June 3, 2014 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1022,7 +1022,8 @@ and related programs. .\" from FreeBSD: head/tools/build/options/WITH_TESTS 264408 2014-04-13 11:29:52Z jmmv Set to install the .Fx -Test Suite. +Test Suite in +.Pa /usr/tests/ . See .Xr tests 7 for more details. Modified: head/tools/build/options/WITH_TESTS ============================================================================== --- head/tools/build/options/WITH_TESTS Tue Jun 3 22:26:46 2014 (r267032) +++ head/tools/build/options/WITH_TESTS Tue Jun 3 22:34:27 2014 (r267033) @@ -1,7 +1,8 @@ .\" $FreeBSD$ Set to install the .Fx -Test Suite. +Test Suite in +.Pa /usr/tests/ . See .Xr tests 7 for more details. From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 23:45:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F04D839E; Tue, 3 Jun 2014 23:45:18 +0000 (UTC) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 28908283D; Tue, 3 Jun 2014 23:45:18 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 5586125D3A85; Tue, 3 Jun 2014 23:45:14 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 5BCE8C22BD1; Tue, 3 Jun 2014 23:45:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id cbboa208AmIW; Tue, 3 Jun 2014 23:45:12 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:c134:ee3c:ac56:1105] (unknown [IPv6:fde9:577b:c1a9:4410:c134:ee3c:ac56:1105]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id A5396C22B96; Tue, 3 Jun 2014 23:45:10 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r267029 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs From: "Bjoern A. Zeeb" In-Reply-To: <201406032106.s53L63oR085624@svn.freebsd.org> Date: Tue, 3 Jun 2014 23:45:00 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201406032106.s53L63oR085624@svn.freebsd.org> To: Alexander Motin X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 23:45:19 -0000 On 03 Jun 2014, at 21:06 , Alexander Motin wrote: > Author: mav > Date: Tue Jun 3 21:06:03 2014 > New Revision: 267029 > URL: http://svnweb.freebsd.org/changeset/base/267029 >=20 > Log: > Replace gethrtime() with cpu_ticks(), as source of random for the = taskqueue > selection. gethrtime() in our port updated with HZ rate, so unusable = for > this specific purpose, completely draining benefit of multiple = taskqueues. >=20 > MFC after: 2 weeks >=20 I am seeing this now for all buildworld targets: = /storage/head/obj//arm.armeb/scratch/tmp/bz/head.svn/tmp/usr/lib/libzpool.= so: undefined reference to `cpu_ticks' > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c >=20 > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jun = 3 21:02:19 2014 (r267028) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jun = 3 21:06:03 2014 (r267029) > @@ -953,7 +953,7 @@ spa_taskq_dispatch_ent(spa_t *spa, zio_t > if (tqs->stqs_count =3D=3D 1) { > tq =3D tqs->stqs_taskq[0]; > } else { > - tq =3D tqs->stqs_taskq[gethrtime() % tqs->stqs_count]; > + tq =3D tqs->stqs_taskq[cpu_ticks() % tqs->stqs_count]; > } >=20 > taskq_dispatch_ent(tq, func, arg, flags, ent); >=20 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 02:52:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DADF93F0; Wed, 4 Jun 2014 02:52:10 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A8FB2703; Wed, 4 Jun 2014 02:52:09 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s542pW0T024467 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 4 Jun 2014 06:51:32 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s542pWoA024466; Wed, 4 Jun 2014 06:51:32 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 4 Jun 2014 06:51:32 +0400 From: Gleb Smirnoff To: David Chisnall Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net Message-ID: <20140604025132.GD50679@FreeBSD.org> References: <201406021754.s52Hsd1B039620@svn.freebsd.org> <20140603012939.GA2998@michelle.cdnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Yong-Hyeon Pyun , Adrian Chadd , Marcel Moolenaar , "svn-src-all@freebsd.org" , Marcel Moolenaar , "src-committers@freebsd.org" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 02:52:10 -0000 On Tue, Jun 03, 2014 at 06:05:50PM +0100, David Chisnall wrote: D> On 3 Jun 2014, at 06:01, Adrian Chadd wrote: D> D> > I wonder if in the short term we should just use inlines for now, at D> > least so the methodization can get done without hurting people on D> > ARM/MIPS. D> D> It's probably worth thinking a bit more carefully about the KPI, since it's something we'll likely be stuck with for a long time... D> D> If access to a particular field is on the hot path, and you're never going to want to do interposition, then the obvious thing to do is have a method that returns a pointer to the field so that you can cache it in the caller. Some thought needs to be given there as to whether these things are _Atomic() qualified for when we (eventually) move to C11 for the kernel. Yes, this is the plan. Some high performance drivers can cache pointers to partial contents of an ifnet(9). -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 02:52:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD6BB533; Wed, 4 Jun 2014 02:52:43 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 40D14270D; Wed, 4 Jun 2014 02:52:42 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s542qeZ3024485 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 4 Jun 2014 06:52:40 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s542qe4m024484; Wed, 4 Jun 2014 06:52:40 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 4 Jun 2014 06:52:40 +0400 From: Gleb Smirnoff To: George Neville-Neil Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net Message-ID: <20140604025240.GE50679@FreeBSD.org> References: <201406021754.s52Hsd1B039620@svn.freebsd.org> <3DD60E8E-7B9B-4CF2-823F-3BF3469EB0C3@neville-neil.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3DD60E8E-7B9B-4CF2-823F-3BF3469EB0C3@neville-neil.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Adrian Chadd , Marcel Moolenaar , "svn-src-all@freebsd.org" , Marcel Moolenaar , "src-committers@freebsd.org" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 02:52:43 -0000 On Tue, Jun 03, 2014 at 12:46:56PM -0400, George Neville-Neil wrote: G> >> Woo! G> >> G> >> Would you mind doing up a 30 second "what convert X to Y" document so G> >> I can do the driveby on the wireless stack and drivers? G> > G> > I'm having difficulty parsing the question, but I think you're asking G> > for a howto with gotchas and caveats, etc, right? G> > G> > If yes, I can definitely do that. G> G> Jumping in in the middle. What would REALLY help is a man page that G> described the API. The API has only started to be developed. Once done (hopefully before 11.0), it would of course be documented. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 03:02:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CF869C3; Wed, 4 Jun 2014 03:02:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CA74285E; Wed, 4 Jun 2014 03:02:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5432npl094686; Wed, 4 Jun 2014 03:02:49 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5432n6j094685; Wed, 4 Jun 2014 03:02:49 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406040302.s5432n6j094685@svn.freebsd.org> From: Ed Maste Date: Wed, 4 Jun 2014 03:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267035 - head/tools/tools/vt/fontcvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 03:02:50 -0000 Author: emaste Date: Wed Jun 4 03:02:49 2014 New Revision: 267035 URL: http://svnweb.freebsd.org/changeset/base/267035 Log: vt fontcvt: Use a hash to speed up glyph deduplication Walking a linked list of all glyphs to look for a duplicate is very slow for large fonts (e.g., for CJK character sets). In my test the runtime for a sample 40000 character font went from just over 80 seconds on average to just over 2 seconds. Sponsored by: The FreeBSD Foundation Modified: head/tools/tools/vt/fontcvt/fontcvt.c Modified: head/tools/tools/vt/fontcvt/fontcvt.c ============================================================================== --- head/tools/tools/vt/fontcvt/fontcvt.c Wed Jun 4 01:08:57 2014 (r267034) +++ head/tools/tools/vt/fontcvt/fontcvt.c Wed Jun 4 03:02:49 2014 (r267035) @@ -30,6 +30,8 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include #include #include @@ -49,11 +51,14 @@ static unsigned int width = 8, wbytes, h struct glyph { TAILQ_ENTRY(glyph) g_list; + SLIST_ENTRY(glyph) g_hash; uint8_t *g_data; unsigned int g_index; }; +#define FONTCVT_NHASH 4096 TAILQ_HEAD(glyph_list, glyph); +static SLIST_HEAD(, glyph) glyph_hash[FONTCVT_NHASH]; static struct glyph_list glyphs[VFNT_MAPS] = { TAILQ_HEAD_INITIALIZER(glyphs[0]), TAILQ_HEAD_INITIALIZER(glyphs[1]), @@ -147,17 +152,16 @@ static struct glyph * add_glyph(const uint8_t *bytes, unsigned int map_idx, int fallback) { struct glyph *gl; - unsigned int i; + int hash; glyph_total++; glyph_count[map_idx]++; - for (i = 0; i < VFNT_MAPS; i++) { - TAILQ_FOREACH(gl, &glyphs[i], g_list) { - if (memcmp(gl->g_data, bytes, wbytes * height) == 0) { - glyph_dupe++; - return (gl); - } + hash = fnv_32_buf(bytes, wbytes * height, FNV1_32_INIT) % FONTCVT_NHASH; + SLIST_FOREACH(gl, &glyph_hash[hash], g_hash) { + if (memcmp(gl->g_data, bytes, wbytes * height) == 0) { + glyph_dupe++; + return (gl); } } @@ -168,6 +172,7 @@ add_glyph(const uint8_t *bytes, unsigned TAILQ_INSERT_HEAD(&glyphs[map_idx], gl, g_list); else TAILQ_INSERT_TAIL(&glyphs[map_idx], gl, g_list); + SLIST_INSERT_HEAD(&glyph_hash[hash], gl, g_hash); glyph_unique++; return (gl); From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 04:18:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E356C9EC; Wed, 4 Jun 2014 04:18:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE3482F20; Wed, 4 Jun 2014 04:18:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s544IXTt039952; Wed, 4 Jun 2014 04:18:33 GMT (envelope-from allanjude@svn.freebsd.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s544IXXU039950; Wed, 4 Jun 2014 04:18:33 GMT (envelope-from allanjude@svn.freebsd.org) Message-Id: <201406040418.s544IXXU039950@svn.freebsd.org> From: Allan Jude Date: Wed, 4 Jun 2014 04:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267037 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 04:18:34 -0000 Author: allanjude (doc committer) Date: Wed Jun 4 04:18:33 2014 New Revision: 267037 URL: http://svnweb.freebsd.org/changeset/base/267037 Log: Further updates to the netstat(1) man page and usage message - Reformat the entire man page - Create a proper synopsis section - Use itemized-lists to describe each flag, rather than paragraphs - Cross-reference common flags to a 'general flags' sub-section with short inline description of the flag - Label 'general flags' sub-section - Apply additional fixes suggested by wblock, brueffer, and bdrewery - Update .Dd that got undone previously - Change the order of the .Op Fl to be alphabetical - Add the -i | -I interface flags to the description of 'interface display mode' - Fix missing parameters in man page - Fix missing parameters in usage() - Sync man page and usage() MFC Note: stable/9 and stable/10 do not have -R, will need to be removed when merged CR: D58 Reviewed by: brueffer, bcr Approved by: wblock (mentor) MFC after: 7 days Sponsored by: ScaleEngine Inc. Modified: head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.1 Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Wed Jun 4 03:03:34 2014 (r267036) +++ head/usr.bin/netstat/main.c Wed Jun 4 04:18:33 2014 (r267037) @@ -828,14 +828,16 @@ usage(void) " [-M core] [-N system]", " netstat -i | -I interface [-46abdhnW] [-f address_family]\n" " [-M core] [-N system]", -" netstat -w wait [-I interface] [-46d] [-M core] [-N system] [-q howmany]", -" netstat -s [-s] [-46z] [-f protocol_family | -p protocol]\n" -" [-M core] [-N system]", -" netstat -i | -I interface [-46s] [-f protocol_family | -p protocol]\n" +" netstat -w wait [-I interface] [-46d] [-M core] [-N system]\n" +" [-q howmany]", +" netstat -s [-46sz] [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", +" netstat -i | -I interface -s [-46s]\n" +" [-f protocol_family | -p protocol] [-M core] [-N system]", " netstat -m [-M core] [-N system]", -" netstat -B [-I interface]", -" netstat -r [-46AanW] [-f address_family] [-M core] [-N system]", +" netstat -B [-z] [-I interface]", +" netstat -r [-46AnW] [-F fibnum] [-f address_family]\n" +" [-M core] [-N system]", " netstat -rs [-s] [-M core] [-N system]", " netstat -g [-46W] [-f address_family] [-M core] [-N system]", " netstat -gs [-46s] [-f address_family] [-M core] [-N system]", Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Wed Jun 4 03:03:34 2014 (r267036) +++ head/usr.bin/netstat/netstat.1 Wed Jun 4 04:18:33 2014 (r267037) @@ -28,12 +28,70 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd January 11, 2014 +.Dd July 4, 2014 .Dt NETSTAT 1 .Os .Sh NAME .Nm netstat -.Nd show network status +.Nd show network status and statistics +.Sh SYNOPSIS +.Bk -words +.Bl -tag -width "netstat" +.It Nm +.Op Fl 46AaLnRSTWx +.Op Fl f Ar protocol_family | Fl p Ar protocol +.Op Fl M Ar core +.Op Fl N Ar system +.It Nm Fl i | I Ar interface +.Op Fl 46abdhnW +.Op Fl f Ar address_family +.Op Fl M Ar core +.Op Fl N Ar system +.It Nm Fl w Ar wait +.Op Fl I Ar interface +.Op Fl 46d +.Op Fl M Ar core +.Op Fl N Ar system +.Op Fl q Ar howmany +.It Nm Fl s +.Op Fl 46sz +.Op Fl f Ar protocol_family | Fl p Ar protocol +.Op Fl M Ar core +.Op Fl N Ar system +.It Nm Fl i | I Ar interface Fl s +.Op Fl 46s +.Op Fl f Ar protocol_family | Fl p Ar protocol +.Op Fl M Ar core +.Op Fl N Ar system +.It Nm Fl m +.Op Fl M Ar core +.Op Fl N Ar system +.It Nm Fl B +.Op Fl z +.Op Fl I Ar interface +.It Nm Fl r +.Op Fl 46AnW +.Op Fl F Ar fibnum +.Op Fl f Ar address_family +.Op Fl M Ar core +.Op Fl N Ar system +.It Nm Fl rs +.Op Fl s +.Op Fl M Ar core +.Op Fl N Ar system +.It Nm Fl g +.Op Fl 46W +.Op Fl f Ar address_family +.Op Fl M Ar core +.Op Fl N Ar system +.It Nm Fl gs +.Op Fl 46s +.Op Fl f Ar address_family +.Op Fl M Ar core +.Op Fl N Ar system +.It Nm Fl Q +.Ek +.El .Sh DESCRIPTION The .Nm @@ -45,7 +103,7 @@ depending on the options for the informa .It Xo .Bk -words .Nm -.Op Fl 46AaLnSTWxR +.Op Fl 46AaLnRSTWx .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system @@ -53,50 +111,132 @@ depending on the options for the informa .Xc Display a list of active sockets (protocol control blocks) -for each network protocol, -for a particular -.Ar protocol_family , -or for a single -.Ar protocol . -If -.Fl A -is also present, -show the address of a protocol control block (PCB) +for each network protocol. +.Pp +The default display for active sockets shows the local +and remote addresses, send and receive queue sizes (in bytes), protocol, +and the internal state of the protocol. +Address formats are of the form +.Dq host.port +or +.Dq network.port +if a socket's address specifies a network but no specific host address. +When known, the host and network addresses are displayed symbolically +according to the databases +.Xr hosts 5 +and +.Xr networks 5 , +respectively. +If a symbolic name for an address is unknown, or if +the +.Fl n +option is specified, the address is printed numerically, according +to the address family. +For more information regarding +the Internet IPv4 +.Dq dot format , +refer to +.Xr inet 3 . +Unspecified, +or +.Dq wildcard , +addresses and ports appear as +.Dq Li * . +.Bl -tag -width indent +.It Fl 4 +Show IPv4 only. +See +.Sx GENERAL OPTIONS . +.It Fl 6 +Show IPv6 only. +See +.Sx GENERAL OPTIONS . +.It Fl A +Show the address of a protocol control block (PCB) associated with a socket; used for debugging. -If -.Fl a -is also present, -show the state of all sockets; +.It Fl a +Show the state of all sockets; normally sockets used by server processes are not shown. -If -.Fl L -is also present, -show the size of the various listen queues. +.It Fl L +Show the size of the various listen queues. The first count shows the number of unaccepted connections, the second count shows the amount of unaccepted incomplete connections, and the third count is the maximum number of queued connections. -If -.Fl S -is also present, -show network addresses as numbers (as with +.It Fl n +Do not resolve numeric addresses and port numbers to names. +See +.Sx GENERAL OPTIONS . +.It Fl R +Display the flowid and flowtype for each socket. +flowid is a 32 bit hardware specific identifier for each flow. +flowtype defines which protocol fields are hashed to produce the id. +A complete listing is available in +.Pa sys/mbuf.h +under +.Dv M_HASHTYPE_* . +.It Fl S +Show network addresses as numbers (as with .Fl n ) but show ports symbolically. -If +.It Fl T +Display diagnostic information from the TCP control block. +Fields include the number of packets requiring retransmission, +received out-of-order, and those advertising a zero-sized window. +.It Fl W +Avoid truncating addresses even if this causes some fields to overflow. +.It Fl x +Display socket buffer and TCP timer statistics for each +internet socket. +.Pp +The .Fl x -is present, display socket buffer and tcp timer statistics for each internet socket. -If -.Fl R -is present, display the flowid and flowtype for each internet socket. -When -.Fl T -is present, display information from the TCP control block, including -retransmits, out-of-order packets received, and zero-sized windows advertised. +flag causes +.Nm +to output all the information recorded about data +stored in the socket buffers. +The fields are: +.Bl -column ".Li R-MBUF" +.It Li R-MBUF Ta Number of mbufs in the receive queue. +.It Li S-MBUF Ta Number of mbufs in the send queue. +.It Li R-CLUS Ta Number of clusters, of any type, in the receive +queue. +.It Li S-CLUS Ta Number of clusters, of any type, in the send queue. +.It Li R-HIWA Ta Receive buffer high water mark, in bytes. +.It Li S-HIWA Ta Send buffer high water mark, in bytes. +.It Li R-LOWA Ta Receive buffer low water mark, in bytes. +.It Li S-LOWA Ta Send buffer low water mark, in bytes. +.It Li R-BCNT Ta Receive buffer byte count. +.It Li S-BCNT Ta Send buffer byte count. +.It Li R-BMAX Ta Maximum bytes that can be used in the receive buffer. +.It Li S-BMAX Ta Maximum bytes that can be used in the send buffer. +.El +.It Fl f Ar protocol_family +Filter by +.Ar protocol_family . +See +.Sx GENERAL OPTIONS . +.It Fl p Ar protocol +Filter by +.Ar protocol . +See +.Sx GENERAL OPTIONS . +.It Fl M +Use an alternative core. +See +.Sx GENERAL OPTIONS . +.It Fl N +Use an alternative kernel image. +See +.Sx GENERAL OPTIONS . +.El .It Xo .Bk -words .Nm .Fl i | I Ar interface .Op Fl 46abdhnW .Op Fl f Ar address_family +.Op Fl M Ar core +.Op Fl N Ar system .Ek .Xc Show the state of all network interfaces or a single @@ -108,30 +248,59 @@ An asterisk .Pq Dq Li * after an interface name indicates that the interface is .Dq down . -If -.Fl a -is also present, multicast addresses currently in use are shown +.Pp +When +.Nm +is invoked with +.Fl i +.Pq all interfaces +or +.Fl I Ar interface , +it provides a table of cumulative +statistics regarding packets transferred, errors, and collisions. +The network addresses of the interface +and the maximum transmission unit +.Pq Dq mtu +are also displayed. +.Bl -tag -width indent +.It Fl 4 +Show IPv4 only. +See +.Sx GENERAL OPTIONS . +.It Fl 6 +Show IPv6 only. +See +.Sx GENERAL OPTIONS . +.It Fl a +Multicast addresses currently in use are shown for each Ethernet interface and for each IP interface address. Multicast addresses are shown on separate lines following the interface address with which they are associated. -If -.Fl b -is also present, show the number of bytes in and out. -If -.Fl d -is also present, show the number of dropped packets. -If -.Fl h -is also present, print all counters in human readable form. -If -.Fl W -is also present, print interface names using a wider field size. +.It Fl b +Show the number of bytes in and out. +.It Fl d +Show the number of dropped packets. +.It Fl h +Print all counters in human readable form. +.It Fl n +Do not resolve numeric addresses and port numbers to names. +See +.Sx GENERAL OPTIONS . +.It Fl W +Avoid truncating interface names even if this causes some fields to overflow. +.Sx GENERAL OPTIONS . +.It Fl f Ar protocol_family +Filter by +.Ar protocol_family . +See +.Sx GENERAL OPTIONS . +.El .It Xo .Bk -words .Nm .Fl w Ar wait .Op Fl I Ar interface -.Op Fl d +.Op Fl 46d .Op Fl M Ar core .Op Fl N Ar system .Op Fl q Ar howmany @@ -139,55 +308,139 @@ is also present, print interface names u .Xc At intervals of .Ar wait -seconds, -display the information regarding packet -traffic on all configured network interfaces -or a single +seconds, display the information regarding packet traffic on all +configured network interfaces or a single .Ar interface . -If -.Fl q -is also present, exit after +.Pp +When +.Nm +is invoked with the +.Fl w +option and a +.Ar wait +interval argument, it displays a running count of statistics related to +network interfaces. +An obsolescent version of this option used a numeric parameter +with no option, and is currently supported for backward compatibility. +By default, this display summarizes information for all interfaces. +Information for a specific interface may be displayed with the +.Fl I Ar interface +option. +.Bl -tag -width indent +.It Fl I Ar interface +Only show information regarding +.Ar interface +.It Fl 4 +Show IPv4 only. +See +.Sx GENERAL OPTIONS . +.It Fl 6 +Show IPv6 only. +See +.Sx GENERAL OPTIONS . +.It Fl d +Show the number of dropped packets. +.It Fl M +Use an alternative core. +See +.Sx GENERAL OPTIONS . +.It Fl N +Use an alternative kernel image. +See +.Sx GENERAL OPTIONS . +.It Fl q +Exit after .Ar howmany outputs. -If -.Fl d -is also present, show the number of dropped packets. +.El .It Xo .Bk -words .Nm -.Fl s Op Fl s -.Op Fl 46z +.Fl s +.Op Fl 46sz .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system .Ek .Xc -Display system-wide statistics for each network protocol, -for a particular -.Ar protocol_family , -or for a single -.Ar protocol . +Display system-wide statistics for each network protocol. +.Bl -tag -width indent +.It Fl 4 +Show IPv4 only. +See +.Sx GENERAL OPTIONS . +.It Fl 6 +Show IPv6 only. +See +.Sx GENERAL OPTIONS . +.It Fl s If .Fl s is repeated, counters with a value of zero are suppressed. -If -.Fl z -is also present, reset statistic counters after displaying them. +.It Fl z +Reset statistic counters after displaying them. +.It Fl f Ar protocol_family +Filter by +.Ar protocol_family . +See +.Sx GENERAL OPTIONS . +.It Fl p Ar protocol +Filter by +.Ar protocol . +See +.Sx GENERAL OPTIONS . +.It Fl M +Use an alternative core. +See +.Sx GENERAL OPTIONS . +.It Fl N +Use an alternative kernel image +See +.Sx GENERAL OPTIONS . +.El .It Xo .Bk -words .Nm .Fl i | I Ar interface Fl s -.Op Fl 46 +.Op Fl 46s .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system .Ek .Xc -Display per-interface statistics for each network protocol, -for a particular -.Ar protocol_family , -or for a single +Display per-interface statistics for each network protocol. +.Bl -tag -width indent +.It Fl 4 +Show IPv4 only +See +.Sx GENERAL OPTIONS . +.It Fl 6 +Show IPv6 only +See +.Sx GENERAL OPTIONS . +.It Fl s +If +.Fl s +is repeated, counters with a value of zero are suppressed. +.It Fl f Ar protocol_family +Filter by +.Ar protocol_family . +See +.Sx GENERAL OPTIONS . +.It Fl p Ar protocol +Filter by .Ar protocol . +See +.Sx GENERAL OPTIONS . +.It Fl M +Use an alternative core +See +.Sx GENERAL OPTIONS . +.It Fl N +Use an alternative kernel image +See +.Sx GENERAL OPTIONS . +.El .It Xo .Bk -words .Nm @@ -199,6 +452,16 @@ or for a single Show statistics recorded by the memory management routines .Pq Xr mbuf 9 . The network manages a private pool of memory buffers. +.Bl -tag -width indent +.It Fl M +Use an alternative core +See +.Sx GENERAL OPTIONS . +.It Fl N +Use an alternative kernel image +See +.Sx GENERAL OPTIONS . +.El .It Xo .Bk -words .Nm @@ -214,11 +477,39 @@ This includes information like how many packets have been matched, dropped and received by the bpf device, also information about current buffer sizes and device states. +.Pp +The +.Xr bpf 4 +flags displayed when +.Nm +is invoked with the +.Fl B +option represent the underlying parameters of the bpf peer. +Each flag is +represented as a single lower case letter. +The mapping between the letters and flags in order of appearance are: +.Bl -column ".Li i" +.It Li p Ta Set if listening promiscuously +.It Li i Ta Dv BIOCIMMEDIATE No has been set on the device +.It Li f Ta Dv BIOCGHDRCMPLT No status: source link addresses are being +filled automatically +.It Li s Ta Dv BIOCGSEESENT No status: see packets originating locally and +remotely on the interface. +.It Li a Ta Packet reception generates a signal +.It Li l Ta Dv BIOCLOCK No status: descriptor has been locked +.El +.Pp +For more information about these flags, please refer to +.Xr bpf 4 . +.Bl -tag -width indent +.It Fl z +Reset statistic counters after displaying them. +.El .It Xo .Bk -words .Nm .Fl r -.Op Fl 46AanW +.Op Fl 46AnW .Op Fl F Ar fibnum .Op Fl f Ar address_family .Op Fl M Ar core @@ -226,35 +517,91 @@ states. .Ek .Xc Display the contents of routing tables. +.Pp When -.Fl f -is specified, a routing table for a particular -.Ar address_family -is displayed. -When -.Fl F -is specified, a routing table with the number -.Ar fibnum -is displayed. +.Nm +is invoked with the routing table option +.Fl r , +it lists the available routes and their status. +Each route consists of a destination host or network, and a gateway to use +in forwarding packets. +The flags field shows a collection of information about the route stored +as binary choices. +The individual flags are discussed in more detail in the +.Xr route 8 +and +.Xr route 4 +manual pages. +The mapping between letters and flags is: +.Bl -column ".Li W" ".Dv RTF_WASCLONED" +.It Li 1 Ta Dv RTF_PROTO1 Ta "Protocol specific routing flag #1" +.It Li 2 Ta Dv RTF_PROTO2 Ta "Protocol specific routing flag #2" +.It Li 3 Ta Dv RTF_PROTO3 Ta "Protocol specific routing flag #3" +.It Li B Ta Dv RTF_BLACKHOLE Ta "Just discard pkts (during updates)" +.It Li b Ta Dv RTF_BROADCAST Ta "The route represents a broadcast address" +.It Li D Ta Dv RTF_DYNAMIC Ta "Created dynamically (by redirect)" +.It Li G Ta Dv RTF_GATEWAY Ta "Destination requires forwarding by intermediary" +.It Li H Ta Dv RTF_HOST Ta "Host entry (net otherwise)" +.It Li L Ta Dv RTF_LLINFO Ta "Valid protocol to link address translation" +.It Li M Ta Dv RTF_MODIFIED Ta "Modified dynamically (by redirect)" +.It Li R Ta Dv RTF_REJECT Ta "Host or net unreachable" +.It Li S Ta Dv RTF_STATIC Ta "Manually added" +.It Li U Ta Dv RTF_UP Ta "Route usable" +.It Li X Ta Dv RTF_XRESOLVE Ta "External daemon translates proto to link address" +.El +.Pp +Direct routes are created for each +interface attached to the local host; +the gateway field for such entries shows the address of the outgoing interface. +The refcnt field gives the +current number of active uses of the route. +Connection oriented +protocols normally hold on to a single route for the duration of +a connection while connectionless protocols obtain a route while sending +to the same destination. +The use field provides a count of the number of packets +sent using that route. +The interface entry indicates the network interface utilized for the route. +.Bl -tag -width indent +.It Fl 4 +Show IPv4 only. +See +.Sx GENERAL OPTIONS . +.It Fl 6 +Show IPv6 only. +See +.Sx GENERAL OPTIONS . +.It Fl A +Show the contents of the internal Patricia tree +structures; used for debugging. +.It Fl n +Do not resolve numeric addresses and port numbers to names. +See +.Sx GENERAL OPTIONS . +.It Fl W +Show the path MTU for each route, and print interface names with a +wider field size. +.It Fl F +Display the routing table with the number +.Ar fibnum . If the specified .Ar fibnum is -1 or .Fl F is not specified, the default routing table is displayed. -If -.Fl A -is also present, -show the contents of the internal Patricia tree -structures; used for debugging. -When -.Fl W -is also present, -show the path MTU -for each route, -and print interface -names with a wider -field size. +.It Fl f +Display the routing table for a particular +.Ar address_family . +.It Fl M +Use an alternative core +See +.Sx GENERAL OPTIONS . +.It Fl N +Use an alternative kernel image +See +.Sx GENERAL OPTIONS . +.El .It Xo .Bk -words .Nm @@ -265,9 +612,20 @@ field size. .Ek .Xc Display routing statistics. +.Bl -tag -width indent +.It Fl s If .Fl s is repeated, counters with a value of zero are suppressed. +.It Fl M +Use an alternative core +See +.Sx GENERAL OPTIONS . +.It Fl N +Use an alternative kernel image +See +.Sx GENERAL OPTIONS . +.El .It Xo .Bk -words .Nm @@ -287,6 +645,31 @@ This option is applicable only to the and .Cm inet6 address families. +.Bl -tag -width indent +.It Fl 4 +Show IPv4 only +See +.Sx GENERAL OPTIONS . +.It Fl 6 +Show IPv6 only +See +.Sx GENERAL OPTIONS . +.It Fl W +Avoid truncating addresses even if this causes some fields to overflow. +.It Fl f Ar protocol_family +Filter by +.Ar protocol_family . +See +.Sx GENERAL OPTIONS . +.It Fl M +Use an alternative core +See +.Sx GENERAL OPTIONS . +.It Fl N +Use an alternative kernel image +See +.Sx GENERAL OPTIONS . +.El .It Xo .Bk -words .Nm @@ -298,9 +681,33 @@ address families. .Ek .Xc Show multicast routing statistics. +.Bl -tag -width indent +.It Fl 4 +Show IPv4 only +See +.Sx GENERAL OPTIONS . +.It Fl 6 +Show IPv6 only +See +.Sx GENERAL OPTIONS . +.It Fl s If .Fl s is repeated, counters with a value of zero are suppressed. +.It Fl f Ar protocol_family +Filter by +.Ar protocol_family . +See +.Sx GENERAL OPTIONS . +.It Fl M +Use an alternative core +See +.Sx GENERAL OPTIONS . +.It Fl N +Use an alternative kernel image +See +.Sx GENERAL OPTIONS . +.El .It Xo .Bk -words .Nm @@ -318,16 +725,19 @@ The flags field shows available ISR hand .El .El .Pp +.Ss GENERAL OPTIONS Some options have the general meaning: .Bl -tag -width flag .It Fl 4 Is shorthand for .Fl f .Ar inet +.Pq Show only IPv4 .It Fl 6 Is shorthand for .Fl f .Ar inet6 +.Pq Show only IPv6 .It Fl f Ar address_family , Fl p Ar protocol Limit display to those records of the specified @@ -367,156 +777,6 @@ Normally .Nm attempts to resolve addresses and ports, and display them symbolically. -.It Fl W -In certain displays, avoid truncating addresses even if this causes -some fields to overflow. -.It Fl R -Display the flowid and flowtype for each socket. -flowid is a 32 bit hardware specific identifier for each flow. -flowtype defines which protocol fields are hashed to produce the id. -A complete listing is available in -.Pa sys/mbuf.h -under M_HASHTYPE_* -.El -.Pp -The default display, for active sockets, shows the local -and remote addresses, send and receive queue sizes (in bytes), protocol, -and the internal state of the protocol. -Address formats are of the form -.Dq host.port -or -.Dq network.port -if a socket's address specifies a network but no specific host address. -When known, the host and network addresses are displayed symbolically -according to the databases -.Xr hosts 5 -and -.Xr networks 5 , -respectively. -If a symbolic name for an address is unknown, or if -the -.Fl n -option is specified, the address is printed numerically, according -to the address family. -For more information regarding -the Internet IPv4 -.Dq dot format , -refer to -.Xr inet 3 . -Unspecified, -or -.Dq wildcard , -addresses and ports appear as -.Dq Li * . -.Pp -The interface display provides a table of cumulative -statistics regarding packets transferred, errors, and collisions. -The network addresses of the interface -and the maximum transmission unit -.Pq Dq mtu -are also displayed. -.Pp -The routing table display indicates the available routes and their status. -Each route consists of a destination host or network, and a gateway to use -in forwarding packets. -The flags field shows a collection of information about the route stored -as binary choices. -The individual flags are discussed in more detail in the -.Xr route 8 -and -.Xr route 4 -manual pages. -The mapping between letters and flags is: -.Bl -column ".Li W" ".Dv RTF_WASCLONED" -.It Li 1 Ta Dv RTF_PROTO1 Ta "Protocol specific routing flag #1" -.It Li 2 Ta Dv RTF_PROTO2 Ta "Protocol specific routing flag #2" -.It Li 3 Ta Dv RTF_PROTO3 Ta "Protocol specific routing flag #3" -.It Li B Ta Dv RTF_BLACKHOLE Ta "Just discard pkts (during updates)" -.It Li b Ta Dv RTF_BROADCAST Ta "The route represents a broadcast address" -.It Li D Ta Dv RTF_DYNAMIC Ta "Created dynamically (by redirect)" -.It Li G Ta Dv RTF_GATEWAY Ta "Destination requires forwarding by intermediary" -.It Li H Ta Dv RTF_HOST Ta "Host entry (net otherwise)" -.It Li L Ta Dv RTF_LLINFO Ta "Valid protocol to link address translation" -.It Li M Ta Dv RTF_MODIFIED Ta "Modified dynamically (by redirect)" -.It Li R Ta Dv RTF_REJECT Ta "Host or net unreachable" -.It Li S Ta Dv RTF_STATIC Ta "Manually added" -.It Li U Ta Dv RTF_UP Ta "Route usable" -.It Li X Ta Dv RTF_XRESOLVE Ta "External daemon translates proto to link address" -.El -.Pp -Direct routes are created for each -interface attached to the local host; -the gateway field for such entries shows the address of the outgoing interface. -The refcnt field gives the -current number of active uses of the route. -Connection oriented -protocols normally hold on to a single route for the duration of -a connection while connectionless protocols obtain a route while sending -to the same destination. -The use field provides a count of the number of packets -sent using that route. -The interface entry indicates the network interface utilized for the route. -.Pp -When -.Nm -is invoked with the -.Fl w -option and a -.Ar wait -interval argument, it displays a running count of statistics related to -network interfaces. -An obsolescent version of this option used a numeric parameter -with no option, and is currently supported for backward compatibility. -By default, this display summarizes information for all interfaces. -Information for a specific interface may be displayed with the -.Fl I -option. -.Pp -The -.Xr bpf 4 -flags displayed when -.Nm -is invoked with the -.Fl B -option represent the underlying parameters of the bpf peer. -Each flag is -represented as a single lower case letter. -The mapping between the letters and flags in order of appearance are: -.Bl -column ".Li i" -.It Li p Ta Set if listening promiscuously -.It Li i Ta Dv BIOCIMMEDIATE No has been set on the device -.It Li f Ta Dv BIOCGHDRCMPLT No status: source link addresses are being -filled automatically -.It Li s Ta Dv BIOCGSEESENT No status: see packets originating locally and -remotely on the interface. -.It Li a Ta Packet reception generates a signal -.It Li l Ta Dv BIOCLOCK No status: descriptor has been locked -.El -.Pp -For more information about these flags, please refer to -.Xr bpf 4 . -.Pp -The -.Fl x -flag causes -.Nm -to output all the information recorded about data -stored in the socket buffers. -The fields are: -.Bl -column ".Li R-MBUF" -.It Li R-MBUF Ta Number of mbufs in the receive queue. -.It Li S-MBUF Ta Number of mbufs in the send queue. -.It Li R-CLUS Ta Number of clusters, of any type, in the receive -queue. -.It Li S-CLUS Ta Number of clusters, of any type, in the send queue. -.It Li R-HIWA Ta Receive buffer high water mark, in bytes. -.It Li S-HIWA Ta Send buffer high water mark, in bytes. -.It Li R-LOWA Ta Receive buffer low water mark, in bytes. -.It Li S-LOWA Ta Send buffer low water mark, in bytes. -.It Li R-BCNT Ta Receive buffer byte count. -.It Li S-BCNT Ta Send buffer byte count. -.It Li R-BMAX Ta Maximum bytes that can be used in the receive buffer. -.It Li S-BMAX Ta Maximum bytes that can be used in the send buffer. .El .Sh SEE ALSO .Xr fstat 1 , From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 05:04:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15D1AECD; Wed, 4 Jun 2014 05:04:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 025632235; Wed, 4 Jun 2014 05:04:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5454F2S068358; Wed, 4 Jun 2014 05:04:15 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5454FM3068357; Wed, 4 Jun 2014 05:04:15 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201406040504.s5454FM3068357@svn.freebsd.org> From: Bryan Drewery Date: Wed, 4 Jun 2014 05:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267038 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 05:04:16 -0000 Author: bdrewery Date: Wed Jun 4 05:04:15 2014 New Revision: 267038 URL: http://svnweb.freebsd.org/changeset/base/267038 Log: - Naively fix build by partially reverting r267029 to still use gethrtime() when building libzpool. X-MFC-With: 267029 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Wed Jun 4 04:18:33 2014 (r267037) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Wed Jun 4 05:04:15 2014 (r267038) @@ -953,7 +953,11 @@ spa_taskq_dispatch_ent(spa_t *spa, zio_t if (tqs->stqs_count == 1) { tq = tqs->stqs_taskq[0]; } else { +#ifdef _KERNEL tq = tqs->stqs_taskq[cpu_ticks() % tqs->stqs_count]; +#else + tq = tqs->stqs_taskq[gethrtime() % tqs->stqs_count]; +#endif } taskq_dispatch_ent(tq, func, arg, flags, ent); From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 05:04:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 944F6A5 for ; Wed, 4 Jun 2014 05:04:48 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5890F2242 for ; Wed, 4 Jun 2014 05:04:48 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s5454mdT071270 for ; Wed, 4 Jun 2014 05:04:48 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s5454lec071264 for svn-src-head@freebsd.org; Wed, 4 Jun 2014 05:04:47 GMT (envelope-from bdrewery) Received: (qmail 35739 invoked from network); 4 Jun 2014 00:04:45 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 4 Jun 2014 00:04:45 -0500 Message-ID: <538EA8E4.1070300@FreeBSD.org> Date: Wed, 04 Jun 2014 00:04:36 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r267029 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201406032106.s53L63oR085624@svn.freebsd.org> In-Reply-To: <201406032106.s53L63oR085624@svn.freebsd.org> X-Enigmail-Version: 1.6 OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pCObaMKpaP8FXAblIcCRAjj2NVNaNtiGb" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 05:04:48 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pCObaMKpaP8FXAblIcCRAjj2NVNaNtiGb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 6/3/2014 4:06 PM, Alexander Motin wrote: > Author: mav > Date: Tue Jun 3 21:06:03 2014 > New Revision: 267029 > URL: http://svnweb.freebsd.org/changeset/base/267029 >=20 > Log: > Replace gethrtime() with cpu_ticks(), as source of random for the tas= kqueue > selection. gethrtime() in our port updated with HZ rate, so unusable= for > this specific purpose, completely draining benefit of multiple taskqu= eues. > =20 > MFC after: 2 weeks >=20 > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c >=20 > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jun = 3 21:02:19 2014 (r267028) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jun = 3 21:06:03 2014 (r267029) > @@ -953,7 +953,7 @@ spa_taskq_dispatch_ent(spa_t *spa, zio_t > if (tqs->stqs_count =3D=3D 1) { > tq =3D tqs->stqs_taskq[0]; > } else { > - tq =3D tqs->stqs_taskq[gethrtime() % tqs->stqs_count]; > + tq =3D tqs->stqs_taskq[cpu_ticks() % tqs->stqs_count]; > } > =20 > taskq_dispatch_ent(tq, func, arg, flags, ent); >=20 FYI r267038. --=20 Regards, Bryan Drewery --pCObaMKpaP8FXAblIcCRAjj2NVNaNtiGb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJTjqjoAAoJEDXXcbtuRpfPBDkIALkJ7A+OSts7Jh8BjLix2D63 Kp5snxnJOwruIKfeSpDvE8VXFwVHPTpoXltl7YgoepvlEdLoFTq2+IDvWqyROiX+ rgd2AWn5xgM7pV67HZe8YtZRBTXZ0HNyzQ40Sy2ZbS0udeq1hLqjMUBUy/12cmDG +Jw8oVylwsP62CJiLzaX/GBuLGPq4sitBn3yqj0sMgp9zsJHQ2brS/UXkcy07vhz kqqoVSLZT3Lnmefs9u/2NDc0l0g0RCfbxqi7UMQPN9qHyFpXXEuUnjL1YiQNG80S /z/cKe8wOklXEkqShtsNleiyVlXPrag8yqw51UkpEVci+MzyhW9SKhRxAVdHgOw= =8+rR -----END PGP SIGNATURE----- --pCObaMKpaP8FXAblIcCRAjj2NVNaNtiGb-- From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 05:47:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C18EB90; Wed, 4 Jun 2014 05:47:17 +0000 (UTC) Received: from mail.vnode.se (mail.vnode.se [212.247.52.13]) by mx1.freebsd.org (Postfix) with ESMTP id 19CD0255F; Wed, 4 Jun 2014 05:47:16 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id BE99CE3F07A; Wed, 4 Jun 2014 07:40:43 +0200 (CEST) X-Virus-Scanned: amavisd-new at vnode.se Received: from mail.vnode.se ([127.0.0.1]) by mail.vnode.se (mail.vnode.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KVzu9A3R1ZZN; Wed, 4 Jun 2014 07:40:41 +0200 (CEST) Received: from [10.101.130.71] (edsfw.benders.se [212.247.52.27]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id 0B93FE3F079; Wed, 4 Jun 2014 07:40:40 +0200 (CEST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r267026 - head/usr.bin/users From: Joel Dahl In-Reply-To: <201406032058.s53KwBQ7081027@svn.freebsd.org> Date: Wed, 4 Jun 2014 07:40:41 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <3C6FB011-B509-4264-91B5-7D1115C9592F@vnode.se> References: <201406032058.s53KwBQ7081027@svn.freebsd.org> To: Pietro Cerutti X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 05:47:17 -0000 3 jun 2014 kl. 22:58 skrev Pietro Cerutti : > Author: gahr (ports committer) > Date: Tue Jun 3 20:58:11 2014 > New Revision: 267026 > URL: http://svnweb.freebsd.org/changeset/base/267026 >=20 > Log: > - style, remove (void) in front of printf and the like >=20 > CR: D161 > Approved by: cognet, bapt Hmm, I=92ve been MIA for a few weeks. What does =94CR D161=94 mean? =97 Joel= From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 05:56:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from ptrcrt.ch (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06860D26; Wed, 4 Jun 2014 05:56:43 +0000 (UTC) Date: Wed, 4 Jun 2014 07:56:23 +0200 From: Pietro Cerutti To: Joel Dahl Subject: Re: svn commit: r267026 - head/usr.bin/users Message-ID: <20140604055623.GA2579@ptrcrt.ch> Reply-To: gahr@FreeBSD.org References: <201406032058.s53KwBQ7081027@svn.freebsd.org> <3C6FB011-B509-4264-91B5-7D1115C9592F@vnode.se> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Nq2Wo0NMKNjxTN9z" Content-Disposition: inline In-Reply-To: <3C6FB011-B509-4264-91B5-7D1115C9592F@vnode.se> X-PGP-Key: fp="DA6D E106 A5B8 54B8 5DD8 6D49 ADD0 D38E A192 089E"; id="0xA192089E"; get=; get=; User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 05:56:45 -0000 --Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2014-Jun-04, 07:40, Joel Dahl wrote: >=20 > 3 jun 2014 kl. 22:58 skrev Pietro Cerutti : >=20 > > Author: gahr (ports committer) > > Date: Tue Jun 3 20:58:11 2014 > > New Revision: 267026 > > URL: http://svnweb.freebsd.org/changeset/base/267026 > >=20 > > Log: > > - style, remove (void) in front of printf and the like > >=20 > > CR: D161 > > Approved by: cognet, bapt >=20 > Hmm, I=E2=80=99ve been MIA for a few weeks. What does =E2=80=9DCR D161=E2= =80=9D mean? Code Review, see [1]=C2=A0and [2]. [1] https://phabric.freebsd.org/D161 [2] https://wiki.freebsd.org/CodeReview --=20 Pietro Cerutti The FreeBSD Project gahr@FreeBSD.org PGP Public Key: http://gahr.ch/pgp --Nq2Wo0NMKNjxTN9z Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQJ8BAEBCgBmBQJTjrUHXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQTZERTEwNkE1Qjg1NEI4NUREODZENDlB REQwRDM4RUExOTIwODlFAAoJEK3Q046hkgie9qUP/AiscVQ+RaVPTrLTSOYYr3yU seCmwrO5KfWZ3ABnxZ38hJbD3OIPG+eHf182ZSVtjLcnPh7LeQzzkRwyq2VX/jex EHPqh86olDOs5jQ4wu15lQ5GEadl2yYYLkpWwjSr+FfXRT+sdW+ywRvhbczOPwlN hkgIfZeuECtbVdbZ5tJ0V3OZ6OxhUk/WIiCl+mjjqKQKa/2zE6YwyRmABeqKOOmM jqmNgB99lJ7mLvPFdGUY+S3GVhMVIRff8alaMvdqzdjMlnYxb2smscVaYow2rNeI wPfkJSw4Jm/FFyQeEueaMEHWGTARmmBet6munye0Bqds73CLbgnV5TD7dIDcdcLP eJr9r3+Zo/jcgxKB9bJ6b4xmtJIcZp+DT/hEJ6WmPiMMeUgUwffk9RBuxswGKyr+ zqRswIsLI2CDdRS6UCxyYnGZLA/CVQD6IcEAS7AqSiWZRCDnzi2OZBTiTyYlLGdK ZAzKMNKIdCuK30nSk1Ox/Kid/RmdAIjh8kAP2eO8Ies3mO/M5nJPqQMLoEISCpCl JvXu4nOmEDQb7CUHPG0l19td68IWt7nenNazuuGRviBlsqEEoG8J6pSajhThRTJD F8PUGFzvZdIG54uEBUftGrwtyo2sM2TQ6M23NM3Ch1szDBQCqTxT0jEoIyUs0AqT 67+QYcKp8r7ZJ1k/UoFm =802w -----END PGP SIGNATURE----- --Nq2Wo0NMKNjxTN9z-- From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 06:10:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EBC2372; Wed, 4 Jun 2014 06:10:08 +0000 (UTC) Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com [IPv6:2a00:1450:400c:c00::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6ED0526F7; Wed, 4 Jun 2014 06:10:07 +0000 (UTC) Received: by mail-wg0-f42.google.com with SMTP id y10so7720362wgg.13 for ; Tue, 03 Jun 2014 23:10:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=e4lShFZU1O+zs1UedG0cHKDo6pXG67o+AH9gG/1yUZ8=; b=iUAgET5ScKfPzVpmFyLjgC+tk03kt7vzLOsy1wmb2qvMDvHXdlVB+m4fDFspDkNR7c 15iCOPd6n+4kb/0BMtHc5xIzsAHyfInYY7t3hG2XxFmcOEupzl67sy7Z9bI3DbYzKrr8 KBzdz5VvrHXX58qsuoGPBnGcDEI6xYIjHzIOWMZ1kqqhCMsak9s782IN7zuBv1KsZRrL iSAO/78PQQO9u88mVdSKf8YVA76soNFMbvl+zEosOuBLY3Ey/VK6Nlji16H6bHx1oDSu xTqguRE6c+6H4VV/80nlIuOU064uQQzgAQSOXlF7bZEcNojQbeIiY7mMqDYLM1b7voVg 71Ew== X-Received: by 10.15.102.74 with SMTP id bq50mr3465940eeb.4.1401862205608; Tue, 03 Jun 2014 23:10:05 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by mx.google.com with ESMTPSA id m2sm3218106eey.36.2014.06.03.23.10.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Jun 2014 23:10:05 -0700 (PDT) Sender: Alexander Motin Message-ID: <538EB83B.70700@FreeBSD.org> Date: Wed, 04 Jun 2014 09:10:03 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Bryan Drewery , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r267029 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201406032106.s53L63oR085624@svn.freebsd.org> <538EA8E4.1070300@FreeBSD.org> In-Reply-To: <538EA8E4.1070300@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 06:10:08 -0000 On 04.06.2014 08:04, Bryan Drewery wrote: > On 6/3/2014 4:06 PM, Alexander Motin wrote: >> Author: mav >> Date: Tue Jun 3 21:06:03 2014 >> New Revision: 267029 >> URL: http://svnweb.freebsd.org/changeset/base/267029 >> >> Log: >> Replace gethrtime() with cpu_ticks(), as source of random for the taskqueue >> selection. gethrtime() in our port updated with HZ rate, so unusable for >> this specific purpose, completely draining benefit of multiple taskqueues. >> >> MFC after: 2 weeks >> >> Modified: >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jun 3 21:02:19 2014 (r267028) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jun 3 21:06:03 2014 (r267029) >> @@ -953,7 +953,7 @@ spa_taskq_dispatch_ent(spa_t *spa, zio_t >> if (tqs->stqs_count == 1) { >> tq = tqs->stqs_taskq[0]; >> } else { >> - tq = tqs->stqs_taskq[gethrtime() % tqs->stqs_count]; >> + tq = tqs->stqs_taskq[cpu_ticks() % tqs->stqs_count]; >> } >> >> taskq_dispatch_ent(tq, func, arg, flags, ent); >> > > FYI r267038. Thanks. I am sorry. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 07:26:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9FDAC481 for ; Wed, 4 Jun 2014 07:26:38 +0000 (UTC) Received: from mail-qg0-x232.google.com (mail-qg0-x232.google.com [IPv6:2607:f8b0:400d:c04::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 597C22FAD for ; Wed, 4 Jun 2014 07:26:38 +0000 (UTC) Received: by mail-qg0-f50.google.com with SMTP id z60so14757732qgd.23 for ; Wed, 04 Jun 2014 00:26:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=jT1v7kX0AIt6vottEP/640OOn3poQ9knTPojI+1/78w=; b=AGwVdoJrSxAmpfTV7iPy9Sk08PVYxU/CzDQCME6GcK05LomzplFF9bQm5sAPs5pfur NfgbQYG31PnRy8OrjTEpEijq1AYwDe59io33zW0mR4Ycnn0vL+Gvy6xYPoLY4GPgIZgL K3myrlePr1HPD/AIdMHusu9L8FS5Hey1E9ebc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=jT1v7kX0AIt6vottEP/640OOn3poQ9knTPojI+1/78w=; b=OkHEPRHX1FPAA1NsBcWe1R9oE5z8FQq0rj9xuhiVd2Le4h6WZBrthOgtj7zmS7rpkd iyukzXwYyhpSegpncOq2y0d9LIl20Egz1hIsF5LRQ9ah4Y1NwlGB09W+DKzVX0u7prRW j92oTGsbNub7SH/F9IItH+Yu5L5x7YP9ACCzT1VxUAshmbBkNEzCv2vjqE9Va71vN62Z px8ixiA0kAEdOwQG8Bn+DqCp/EgLvPNPtEpFztvsDXBepMfBi6auHfXwuhBqe2YkgZ8g pRVKUSrKzJH2i7sOZoyu9F5DN/4Vhz7qk3Ou/Q+Cehos+HGRIAT2u/M81BVDBo7YDDs5 BlqQ== X-Gm-Message-State: ALoCoQlaVURW0ViBE6At46uMkZJQTdiJuQhoyTng3kOeBthERYzEcYtoLpGKsGZ8M5x5W/VJq+x8 X-Received: by 10.224.92.75 with SMTP id q11mr66537070qam.15.1401866797401; Wed, 04 Jun 2014 00:26:37 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.222.131 with HTTP; Wed, 4 Jun 2014 00:26:07 -0700 (PDT) In-Reply-To: <20140603063512.GB45150@ivaldir.etoilebsd.net> References: <201405271839.s4RIdDq8055387@svn.freebsd.org> <538D1DB7.7010508@FreeBSD.org> <20140603044638.81DF6580A1@chaos.jnpr.net> <20140603063512.GB45150@ivaldir.etoilebsd.net> From: Eitan Adler Date: Wed, 4 Jun 2014 00:26:07 -0700 X-Google-Sender-Auth: A_IusKQizNWIHrdPYPLtKV2Znwo Message-ID: Subject: Re: svn commit: r266760 - head/contrib/bmake To: Baptiste Daroussin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Bryan Drewery , src-committers@freebsd.org, "Simon J. Gerraty" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 07:26:38 -0000 On 2 June 2014 23:35, Baptiste Daroussin wrote: > On Mon, Jun 02, 2014 at 09:46:38PM -0700, Simon J. Gerraty wrote: >> >> On Mon, 2 Jun 2014 19:58:31 -0500, Bryan Drewery writes: >> >Not sure if anyone cares, but this change breaks all ports tree >> >checkouts from before 2014-05-05 on src head with this revision. >> >> Yes, an older ports tree would need an older bmake (or fmake). >> Are we saying ports is *not* ready for that hack to be removed? >> > > IMHO it is, just people has to be aware of that :) ports-announce@ is the correct location for this announcement :) -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 07:39:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71BEE8EB; Wed, 4 Jun 2014 07:39:50 +0000 (UTC) Received: from mail-wg0-x22d.google.com (mail-wg0-x22d.google.com [IPv6:2a00:1450:400c:c00::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 660C32094; Wed, 4 Jun 2014 07:39:49 +0000 (UTC) Received: by mail-wg0-f45.google.com with SMTP id m15so7803567wgh.28 for ; Wed, 04 Jun 2014 00:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=wFSJmyEn9qIla5E/goPiVIrUPTa4o6HrKmPUG0rgJ4c=; b=MXWWxLWyKMNLPZ0dUCZ+Q9AcGyOMlLd4pNK4nyqs65LsCu+zEATUKXO6MV23FrjsJg FN1YmYXgsWK9NY93HhfZZLGJsaREYjNP7tjkg/eZScWzXTKdGlpdxlkC8VZT4ro1iusx 1HYFRpDHpc+tnGAjwlB7q9e5fW4qMEa3CCeW30Asrm/vXmXen6doq5fGVH9a5NRXeGTQ 2N9x+RDHKU8S7oEUwnrRg4SJc203+HDjpMiV4UY+PnVsczeaK3feQExGM3iGP/pQQcHg WopmCO1b7XpgQLr+OZs38DjJOpQ1fYnAQnPNejzfsHde8CKqm46inVHo7D0V3XRYErXn /eYA== X-Received: by 10.180.105.72 with SMTP id gk8mr2524061wib.32.1401867587594; Wed, 04 Jun 2014 00:39:47 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id b16sm2578033wjx.45.2014.06.04.00.39.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Jun 2014 00:39:46 -0700 (PDT) Sender: Baptiste Daroussin Date: Wed, 4 Jun 2014 09:39:44 +0200 From: Baptiste Daroussin To: Eitan Adler Subject: Re: svn commit: r266760 - head/contrib/bmake Message-ID: <20140604073944.GE30972@ivaldir.etoilebsd.net> References: <201405271839.s4RIdDq8055387@svn.freebsd.org> <538D1DB7.7010508@FreeBSD.org> <20140603044638.81DF6580A1@chaos.jnpr.net> <20140603063512.GB45150@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IU5/I01NYhRvwH70" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Bryan Drewery , src-committers@freebsd.org, "Simon J. Gerraty" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 07:39:50 -0000 --IU5/I01NYhRvwH70 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 04, 2014 at 12:26:07AM -0700, Eitan Adler wrote: > On 2 June 2014 23:35, Baptiste Daroussin wrote: > > On Mon, Jun 02, 2014 at 09:46:38PM -0700, Simon J. Gerraty wrote: > >> > >> On Mon, 2 Jun 2014 19:58:31 -0500, Bryan Drewery writes: > >> >Not sure if anyone cares, but this change breaks all ports tree > >> >checkouts from before 2014-05-05 on src head with this revision. > >> > >> Yes, an older ports tree would need an older bmake (or fmake). > >> Are we saying ports is *not* ready for that hack to be removed? > >> > > > > IMHO it is, just people has to be aware of that :) >=20 > ports-announce@ is the correct location for this announcement :) >=20 Unsure, that only concerns current and people on current are mostly unlikel= y to go backward on a ports tree revision, neither to get stuck with a given rev= ision and quarterly is not support on current so :) regards, Bapt --IU5/I01NYhRvwH70 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iEYEARECAAYFAlOOzUAACgkQ8kTtMUmk6EwnMQCePVtxri4RInma6wlUUbchRN2o 5dkAn2GFSBPfCpb9hzzWa87G/yCd5ce0 =/TG3 -----END PGP SIGNATURE----- --IU5/I01NYhRvwH70-- From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 09:18:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28E744AA; Wed, 4 Jun 2014 09:18:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 157BE293C; Wed, 4 Jun 2014 09:18:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s549IEvJ086160; Wed, 4 Jun 2014 09:18:14 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s549IDHu086158; Wed, 4 Jun 2014 09:18:13 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406040918.s549IDHu086158@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 4 Jun 2014 09:18:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267041 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 09:18:15 -0000 Author: hselasky Date: Wed Jun 4 09:18:13 2014 New Revision: 267041 URL: http://svnweb.freebsd.org/changeset/base/267041 Log: Fixes for the RSU driver: - The R92S_TCR register is an 8-bit register. Don't access it like a 16-bit register. - Disable parsing the delete station event, due to many false events. - Ensure that there is only one transfer queue for each endpoint, so that packets transmitted don't get out of order. MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rsureg.h Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Wed Jun 4 06:21:54 2014 (r267040) +++ head/sys/dev/usb/wlan/if_rsu.c Wed Jun 4 09:18:13 2014 (r267041) @@ -128,10 +128,8 @@ static const STRUCT_USB_HOST_ID rsu_devs static device_probe_t rsu_match; static device_attach_t rsu_attach; static device_detach_t rsu_detach; -static usb_callback_t rsu_bulk_tx_callback_0; -static usb_callback_t rsu_bulk_tx_callback_1; -static usb_callback_t rsu_bulk_tx_callback_2; -static usb_callback_t rsu_bulk_tx_callback_3; +static usb_callback_t rsu_bulk_tx_callback_be_bk; +static usb_callback_t rsu_bulk_tx_callback_vi_vo; static usb_callback_t rsu_bulk_rx_callback; static usb_error_t rsu_do_request(struct rsu_softc *, struct usb_device_request *, void *); @@ -221,6 +219,13 @@ MODULE_DEPEND(rsu, usb, 1, 1, 1); MODULE_DEPEND(rsu, firmware, 1, 1, 1); MODULE_VERSION(rsu, 1); +static uint8_t rsu_wme_ac_xfer_map[4] = { + [WME_AC_BE] = RSU_BULK_TX_BE_BK, + [WME_AC_BK] = RSU_BULK_TX_BE_BK, + [WME_AC_VI] = RSU_BULK_TX_VI_VO, + [WME_AC_VO] = RSU_BULK_TX_VI_VO, +}; + static const struct usb_config rsu_config[RSU_N_TRANSFER] = { [RSU_BULK_RX] = { .type = UE_BULK, @@ -233,20 +238,7 @@ static const struct usb_config rsu_confi }, .callback = rsu_bulk_rx_callback }, - [RSU_BULK_TX_BE] = { - .type = UE_BULK, - .endpoint = 0x06, - .direction = UE_DIR_OUT, - .bufsize = RSU_TXBUFSZ, - .flags = { - .ext_buffer = 1, - .pipe_bof = 1, - .force_short_xfer = 1 - }, - .callback = rsu_bulk_tx_callback_0, - .timeout = RSU_TX_TIMEOUT - }, - [RSU_BULK_TX_BK] = { + [RSU_BULK_TX_BE_BK] = { .type = UE_BULK, .endpoint = 0x06, .direction = UE_DIR_OUT, @@ -256,10 +248,10 @@ static const struct usb_config rsu_confi .pipe_bof = 1, .force_short_xfer = 1 }, - .callback = rsu_bulk_tx_callback_1, + .callback = rsu_bulk_tx_callback_be_bk, .timeout = RSU_TX_TIMEOUT }, - [RSU_BULK_TX_VI] = { + [RSU_BULK_TX_VI_VO] = { .type = UE_BULK, .endpoint = 0x04, .direction = UE_DIR_OUT, @@ -269,20 +261,7 @@ static const struct usb_config rsu_confi .pipe_bof = 1, .force_short_xfer = 1 }, - .callback = rsu_bulk_tx_callback_2, - .timeout = RSU_TX_TIMEOUT - }, - [RSU_BULK_TX_VO] = { - .type = UE_BULK, - .endpoint = 0x04, - .direction = UE_DIR_OUT, - .bufsize = RSU_TXBUFSZ, - .flags = { - .ext_buffer = 1, - .pipe_bof = 1, - .force_short_xfer = 1 - }, - .callback = rsu_bulk_tx_callback_3, + .callback = rsu_bulk_tx_callback_vi_vo, .timeout = RSU_TX_TIMEOUT }, }; @@ -614,7 +593,7 @@ rsu_alloc_tx_list(struct rsu_softc *sc) STAILQ_INIT(&sc->sc_tx_inactive); - for (i = 0; i != RSU_MAX_TX_EP; i++) { + for (i = 0; i != RSU_N_TRANSFER; i++) { STAILQ_INIT(&sc->sc_tx_active[i]); STAILQ_INIT(&sc->sc_tx_pending[i]); } @@ -634,7 +613,7 @@ rsu_free_tx_list(struct rsu_softc *sc) /* prevent further allocations from TX list(s) */ STAILQ_INIT(&sc->sc_tx_inactive); - for (i = 0; i != RSU_MAX_TX_EP; i++) { + for (i = 0; i != RSU_N_TRANSFER; i++) { STAILQ_INIT(&sc->sc_tx_active[i]); STAILQ_INIT(&sc->sc_tx_pending[i]); } @@ -874,7 +853,7 @@ rsu_read_rom(struct rsu_softc *sc) static int rsu_fw_cmd(struct rsu_softc *sc, uint8_t code, void *buf, int len) { - const uint8_t which = RSU_BULK_TX_VO - RSU_BULK_TX_BE; + const uint8_t which = rsu_wme_ac_xfer_map[WME_AC_VO]; struct rsu_data *data; struct r92s_tx_desc *txd; struct r92s_fw_cmd_hdr *cmd; @@ -913,7 +892,7 @@ rsu_fw_cmd(struct rsu_softc *sc, uint8_t DPRINTFN(2, "Tx cmd code=0x%x len=0x%x\n", code, cmdsz); data->buflen = xferlen; STAILQ_INSERT_TAIL(&sc->sc_tx_pending[which], data, next); - usbd_transfer_start(sc->sc_xfer[which + RSU_BULK_TX_BE]); + usbd_transfer_start(sc->sc_xfer[which]); return (0); } @@ -926,6 +905,7 @@ rsu_calib_task(void *arg, int pending __ uint32_t reg; DPRINTFN(6, "running calibration task\n"); + RSU_LOCK(sc); #ifdef notyet /* Read WPS PBC status. */ @@ -942,12 +922,9 @@ rsu_calib_task(void *arg, int pending __ reg = rsu_read_4(sc, R92S_IOCMD_DATA); DPRINTFN(8, "RSSI=%d%%\n", reg >> 4); } - if (sc->sc_calibrating) { - RSU_UNLOCK(sc); - taskqueue_enqueue_timeout(taskqueue_thread, &sc->calib_task, - hz * 2); - } else - RSU_UNLOCK(sc); + if (sc->sc_calibrating) + taskqueue_enqueue_timeout(taskqueue_thread, &sc->calib_task, hz); + RSU_UNLOCK(sc); } static int @@ -1001,11 +978,10 @@ rsu_newstate(struct ieee80211vap *vap, e break; } sc->sc_calibrating = 1; + /* Start periodic calibration. */ + taskqueue_enqueue_timeout(taskqueue_thread, &sc->calib_task, hz); RSU_UNLOCK(sc); IEEE80211_LOCK(ic); - /* Start periodic calibration. */ - taskqueue_enqueue_timeout(taskqueue_thread, &sc->calib_task, hz * 2); - return (uvp->newstate(vap, nstate, arg)); } @@ -1271,6 +1247,9 @@ rsu_rx_event(struct rsu_softc *sc, uint8 if (vap->iv_state == IEEE80211_S_AUTH) rsu_event_join_bss(sc, buf, len); break; +#if 0 +XXX This event is occurring regularly, possibly due to some power saving event +XXX and disrupts the WLAN traffic. Disable for now. case R92S_EVT_DEL_STA: DPRINTF("disassociated from %s\n", ether_sprintf(buf)); if (vap->iv_state == IEEE80211_S_RUN && @@ -1280,6 +1259,7 @@ rsu_rx_event(struct rsu_softc *sc, uint8 RSU_LOCK(sc); } break; +#endif case R92S_EVT_WPS_PBC: DPRINTF("WPS PBC pushed.\n"); break; @@ -1289,6 +1269,8 @@ rsu_rx_event(struct rsu_softc *sc, uint8 printf("FWDBG: %s\n", (char *)buf); } break; + default: + break; } } @@ -1662,27 +1644,15 @@ tr_setup: } static void -rsu_bulk_tx_callback_0(struct usb_xfer *xfer, usb_error_t error) +rsu_bulk_tx_callback_be_bk(struct usb_xfer *xfer, usb_error_t error) { - rsu_bulk_tx_callback_sub(xfer, error, 0); + rsu_bulk_tx_callback_sub(xfer, error, RSU_BULK_TX_BE_BK); } static void -rsu_bulk_tx_callback_1(struct usb_xfer *xfer, usb_error_t error) +rsu_bulk_tx_callback_vi_vo(struct usb_xfer *xfer, usb_error_t error) { - rsu_bulk_tx_callback_sub(xfer, error, 1); -} - -static void -rsu_bulk_tx_callback_2(struct usb_xfer *xfer, usb_error_t error) -{ - rsu_bulk_tx_callback_sub(xfer, error, 2); -} - -static void -rsu_bulk_tx_callback_3(struct usb_xfer *xfer, usb_error_t error) -{ - rsu_bulk_tx_callback_sub(xfer, error, 3); + rsu_bulk_tx_callback_sub(xfer, error, RSU_BULK_TX_VI_VO); } static int @@ -1720,12 +1690,10 @@ rsu_tx_start(struct rsu_softc *sc, struc switch (type) { case IEEE80211_FC0_TYPE_CTL: case IEEE80211_FC0_TYPE_MGT: - which = RSU_BULK_TX_VO - RSU_BULK_TX_BE; + which = rsu_wme_ac_xfer_map[WME_AC_VO]; break; default: - which = M_WME_GETAC(m0); - KASSERT(which < RSU_MAX_TX_EP, - ("unsupported WME pipe %d", which)); + which = rsu_wme_ac_xfer_map[M_WME_GETAC(m0)]; break; } hasqos = 0; @@ -1790,7 +1758,7 @@ rsu_tx_start(struct rsu_softc *sc, struc STAILQ_INSERT_TAIL(&sc->sc_tx_pending[which], data, next); /* start transfer, if any */ - usbd_transfer_start(sc->sc_xfer[which + RSU_BULK_TX_BE]); + usbd_transfer_start(sc->sc_xfer[which]); return (0); } @@ -2105,7 +2073,7 @@ rsu_power_off(struct rsu_softc *sc) static int rsu_fw_loadsection(struct rsu_softc *sc, const uint8_t *buf, int len) { - const uint8_t which = RSU_BULK_TX_VO - RSU_BULK_TX_BE; + const uint8_t which = rsu_wme_ac_xfer_map[WME_AC_VO]; struct rsu_data *data; struct r92s_tx_desc *txd; int mlen; @@ -2130,7 +2098,7 @@ rsu_fw_loadsection(struct rsu_softc *sc, buf += mlen; len -= mlen; } - usbd_transfer_start(sc->sc_xfer[RSU_BULK_TX_BE + which]); + usbd_transfer_start(sc->sc_xfer[which]); return (0); } @@ -2146,6 +2114,11 @@ rsu_load_firmware(struct rsu_softc *sc) uint32_t reg; int ntries, error; + if (rsu_read_1(sc, R92S_TCR) & R92S_TCR_FWRDY) { + DPRINTF("Firmware already loaded\n"); + return (0); + } + RSU_UNLOCK(sc); /* Read firmware image from the filesystem. */ if ((fw = firmware_get("rsu-rtl8712fw")) == NULL) { @@ -2202,7 +2175,7 @@ rsu_load_firmware(struct rsu_softc *sc) /* Wait for load to complete. */ for (ntries = 0; ntries != 50; ntries++) { usb_pause_mtx(&sc->sc_mtx, hz / 100); - reg = rsu_read_2(sc, R92S_TCR); + reg = rsu_read_1(sc, R92S_TCR); if (reg & R92S_TCR_IMEM_CODE_DONE) break; } @@ -2211,7 +2184,6 @@ rsu_load_firmware(struct rsu_softc *sc) error = ETIMEDOUT; goto fail; } - /* Load EMEM section. */ error = rsu_fw_loadsection(sc, emem, ememsz); if (error != 0) { @@ -2231,7 +2203,6 @@ rsu_load_firmware(struct rsu_softc *sc) error = ETIMEDOUT; goto fail; } - /* Enable CPU. */ rsu_write_1(sc, R92S_SYS_CLKR, rsu_read_1(sc, R92S_SYS_CLKR) | R92S_SYS_CPU_CLKSEL); @@ -2250,7 +2221,7 @@ rsu_load_firmware(struct rsu_softc *sc) } /* Wait for CPU to initialize. */ for (ntries = 0; ntries < 100; ntries++) { - if (rsu_read_2(sc, R92S_TCR) & R92S_TCR_IMEM_RDY) + if (rsu_read_1(sc, R92S_TCR) & R92S_TCR_IMEM_RDY) break; rsu_ms_delay(sc); } @@ -2282,7 +2253,7 @@ rsu_load_firmware(struct rsu_softc *sc) } /* Wait for load to complete. */ for (ntries = 0; ntries < 100; ntries++) { - if (rsu_read_2(sc, R92S_TCR) & R92S_TCR_DMEM_CODE_DONE) + if (rsu_read_1(sc, R92S_TCR) & R92S_TCR_DMEM_CODE_DONE) break; rsu_ms_delay(sc); } @@ -2294,7 +2265,7 @@ rsu_load_firmware(struct rsu_softc *sc) } /* Wait for firmware readiness. */ for (ntries = 0; ntries < 60; ntries++) { - if (!(rsu_read_2(sc, R92S_TCR) & R92S_TCR_FWRDY)) + if (!(rsu_read_1(sc, R92S_TCR) & R92S_TCR_FWRDY)) break; rsu_ms_delay(sc); } @@ -2372,6 +2343,7 @@ rsu_init_locked(struct rsu_softc *sc) rsu_power_on_acut(sc); else rsu_power_on_bcut(sc); + /* Load firmware. */ error = rsu_load_firmware(sc); if (error != 0) Modified: head/sys/dev/usb/wlan/if_rsureg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rsureg.h Wed Jun 4 06:21:54 2014 (r267040) +++ head/sys/dev/usb/wlan/if_rsureg.h Wed Jun 4 09:18:13 2014 (r267041) @@ -698,11 +698,9 @@ struct rsu_host_cmd_ring { enum { RSU_BULK_RX, - RSU_BULK_TX_BE, /* = WME_AC_BE */ - RSU_BULK_TX_BK, /* = WME_AC_BK */ - RSU_BULK_TX_VI, /* = WME_AC_VI */ - RSU_BULK_TX_VO, /* = WME_AC_VI */ - RSU_N_TRANSFER = 5, + RSU_BULK_TX_BE_BK, /* = WME_AC_BE/BK */ + RSU_BULK_TX_VI_VO, /* = WME_AC_VI/VO */ + RSU_N_TRANSFER, }; struct rsu_data { @@ -727,8 +725,6 @@ struct rsu_vap { #define RSU_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) #define RSU_ASSERT_LOCKED(sc) mtx_assert(&(sc)->sc_mtx, MA_OWNED) -#define RSU_MAX_TX_EP 4 - struct rsu_softc { struct ifnet *sc_ifp; device_t sc_dev; @@ -754,9 +750,9 @@ struct rsu_softc { STAILQ_HEAD(, rsu_data) sc_rx_active; STAILQ_HEAD(, rsu_data) sc_rx_inactive; - STAILQ_HEAD(, rsu_data) sc_tx_active[RSU_MAX_TX_EP]; + STAILQ_HEAD(, rsu_data) sc_tx_active[RSU_N_TRANSFER]; STAILQ_HEAD(, rsu_data) sc_tx_inactive; - STAILQ_HEAD(, rsu_data) sc_tx_pending[RSU_MAX_TX_EP]; + STAILQ_HEAD(, rsu_data) sc_tx_pending[RSU_N_TRANSFER]; union { struct rsu_rx_radiotap_header th; From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 10:29:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06D568A9; Wed, 4 Jun 2014 10:29:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7DE92F8F; Wed, 4 Jun 2014 10:29:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s54AT1Zh017603; Wed, 4 Jun 2014 10:29:01 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54AT1DV017602; Wed, 4 Jun 2014 10:29:01 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406041029.s54AT1DV017602@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 4 Jun 2014 10:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267044 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 10:29:02 -0000 Author: hselasky Date: Wed Jun 4 10:29:01 2014 New Revision: 267044 URL: http://svnweb.freebsd.org/changeset/base/267044 Log: The external USB HUB in the RPI-B rejects control endpoint traffic using the BULK endpoint type, while other USB HUBs do not. Disable endpoint type workaround for TT traffic. MFC after: 3 days Modified: head/sys/dev/usb/controller/dwc_otg.c Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Wed Jun 4 09:54:01 2014 (r267043) +++ head/sys/dev/usb/controller/dwc_otg.c Wed Jun 4 10:29:01 2014 (r267044) @@ -3161,11 +3161,20 @@ dwc_otg_setup_standard_chain(struct usb_ (xfer->max_packet_size << HCCHAR_MPS_SHIFT) | HCCHAR_CHENA; - /* XXX stability hack - possible HW issue */ - if (td->ep_type == UE_CONTROL) + /* + * XXX stability hack - possible HW issue + * + * Disable workaround when using a transaction + * translator, hence some TTs reject control endpoint + * traffic using BULK endpoint type: + */ + if (td->ep_type == UE_CONTROL && + (xfer->xroot->udev->speed == USB_SPEED_HIGH || + xfer->xroot->udev->parent_hs_hub == NULL)) { hcchar |= (UE_BULK << HCCHAR_EPTYPE_SHIFT); - else + } else { hcchar |= (td->ep_type << HCCHAR_EPTYPE_SHIFT); + } if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_LOW) hcchar |= HCCHAR_LSPDDEV; From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 12:05:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7C383E5; Wed, 4 Jun 2014 12:05:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 944362A29; Wed, 4 Jun 2014 12:05:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s54C5muU063929; Wed, 4 Jun 2014 12:05:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54C5mIp063927; Wed, 4 Jun 2014 12:05:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406041205.s54C5mIp063927@svn.freebsd.org> From: Alexander Motin Date: Wed, 4 Jun 2014 12:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267051 - in head/sys: cam/scsi compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 12:05:48 -0000 Author: mav Date: Wed Jun 4 12:05:47 2014 New Revision: 267051 URL: http://svnweb.freebsd.org/changeset/base/267051 Log: - Add support for SG_GET_SG_TABLESIZE IOCTL to report that we don't support scatter/gather lists. - Return error for still unsupported SG 3.x API read/write calls. MFC after: 1 month Modified: head/sys/cam/scsi/scsi_sg.c head/sys/compat/linux/linux_ioctl.c Modified: head/sys/cam/scsi/scsi_sg.c ============================================================================== --- head/sys/cam/scsi/scsi_sg.c Wed Jun 4 12:03:51 2014 (r267050) +++ head/sys/cam/scsi/scsi_sg.c Wed Jun 4 12:05:47 2014 (r267051) @@ -627,6 +627,13 @@ sgioctl(struct cdev *dev, u_long cmd, ca break; } + case SG_GET_SG_TABLESIZE: + { + int *size = (int *)arg; + *size = 0; + break; + } + case SG_EMULATED_HOST: case SG_SET_TRANSFORM: case SG_GET_TRANSFORM: @@ -638,7 +645,6 @@ sgioctl(struct cdev *dev, u_long cmd, ca case SG_GET_ACCESS_COUNT: case SG_SET_FORCE_LOW_DMA: case SG_GET_LOW_DMA: - case SG_GET_SG_TABLESIZE: case SG_SET_FORCE_PACK_ID: case SG_GET_PACK_ID: case SG_SET_RESERVED_SIZE: @@ -684,6 +690,12 @@ sgwrite(struct cdev *dev, struct uio *ui if (error) goto out_hdr; + /* XXX: We don't support SG 3.x read/write API. */ + if (hdr->reply_len < 0) { + error = ENODEV; + goto out_hdr; + } + ccb = xpt_alloc_ccb(); if (ccb == NULL) { error = ENOMEM; Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Wed Jun 4 12:03:51 2014 (r267050) +++ head/sys/compat/linux/linux_ioctl.c Wed Jun 4 12:05:47 2014 (r267051) @@ -2751,6 +2751,9 @@ linux_ioctl_sg(struct thread *td, struct case LINUX_SG_GET_SCSI_ID: args->cmd = SG_GET_SCSI_ID; break; + case LINUX_SG_GET_SG_TABLESIZE: + args->cmd = SG_GET_SG_TABLESIZE; + break; default: return (ENODEV); } From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 13:13:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD5559D3; Wed, 4 Jun 2014 13:13:08 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 6FD7F2142; Wed, 4 Jun 2014 13:13:07 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 94ACCD62C25; Wed, 4 Jun 2014 23:13:00 +1000 (EST) Date: Wed, 4 Jun 2014 23:12:59 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bryan Drewery Subject: Re: svn commit: r267029 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs In-Reply-To: <538EA8E4.1070300@FreeBSD.org> Message-ID: <20140604212719.C1160@besplex.bde.org> References: <201406032106.s53L63oR085624@svn.freebsd.org> <538EA8E4.1070300@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=QIpRGG7L c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=zLs_Eyj1CTsA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=93T7grC1Rw9fpiornocA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 13:13:09 -0000 On Wed, 4 Jun 2014, Bryan Drewery wrote: > On 6/3/2014 4:06 PM, Alexander Motin wrote: >> Author: mav >> Date: Tue Jun 3 21:06:03 2014 >> New Revision: 267029 >> URL: http://svnweb.freebsd.org/changeset/base/267029 >> >> Log: >> Replace gethrtime() with cpu_ticks(), as source of random for the taskqueue >> selection. gethrtime() in our port updated with HZ rate, so unusable for >> this specific purpose, completely draining benefit of multiple taskqueues. >> >> MFC after: 2 weeks >> >> Modified: >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jun 3 21:02:19 2014 (r267028) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jun 3 21:06:03 2014 (r267029) >> @@ -953,7 +953,7 @@ spa_taskq_dispatch_ent(spa_t *spa, zio_t >> if (tqs->stqs_count == 1) { >> tq = tqs->stqs_taskq[0]; >> } else { >> - tq = tqs->stqs_taskq[gethrtime() % tqs->stqs_count]; >> + tq = tqs->stqs_taskq[cpu_ticks() % tqs->stqs_count]; >> } >> >> taskq_dispatch_ent(tq, func, arg, flags, ent); Bugs remaining in this include: - the comment before this function still says that gethrtime() is used: /* * Dispatch a task to the appropriate taskq for the ZFS I/O type and priority. * Note that a type may have multiple discrete taskqs to avoid lock contention * on the taskq itself. In that case we choose which taskq at random by using * the low bits of gethrtime(). */ - timing functions are a bogus source of random bits. The get_cyclecount() function should be used for this, though its existence is a bug and its name and implementation are worse. On some arches (actually just i386, but should be arm too), cputick() is the same as get_cyclecount(). cputick() has to be correct for timing, but get_cyclecount() doesn't, so get_cyclecount() can be more optimized, but on some arches get_cyclecount() is correct for timing too. The implementation of this varies gratuitously with the arch. Only arm is very bad: - arm: get_cyclecount() is binuptime() with bogus scaling. This shows another bug in the above change -- depending on the details of the ticker and its scaling, there may be no random low bits at all. stqs_count is dynamically initialized and it is not clear if it is a power of 2, or a prime... The bogus scaling is: binuptime(&bt); return ((uint64_t)bt.sec << 56 | bt.frac >> 8); The 8 lower bits may or may not be random (or even nonzero) but they are always discarded. The remaining lower bits may or may not be random (or even zero). 56 top bits of the seconds part are always discarded. Old versions were better. They xor'ed the seconds and fraction part. This is inconsistent with the bad function name, but better for randomness. It is still an error to use only the low bits. Using all the bits modulo a prime would work well: tq = tqs->stqs_taskq[cpu_ticks() % BIGPRIME % tqs->stqs_count]; The magic BIGPRIME only needs to be relatively prime to the infinite- precision maxof(typeof(get_cyclecount()) + 1), so it doesn't depend on the details of get_cyclecount(). For general use, BIGPRIME should be 64 bits, but 32 bits should be enough for anyone and the the 64-bit division for excessive generality would be slow. The existing 64-bit division is already excessively general and gratuitously slow. Both cpu_ticks() and gethrtime() are 64 bits. The division should have been reduced to 32 bits using (uint32_t)getmumbletime() % count. When ntpd is active, the lower bits in the fraction normally contain significant randomness from micro-adjustments, so they should not be discarded. Otherwise, there is really no randomness in lower bits, but they may change in step with high bits depending on the details of the clock frequency and scaling. - i386: get_cyclecount() is cputicks(). This is different from amd64 because rdtsc() is not always available and cputicks() handles the details of sometimes using a timecounter. This is unnecessarily slow when cputicks() doesn't use rdtsc(). cputicks() isn't inline, and it uses lots of function pointers. It even uses a function pointer for rdtsc(). cputicks() is much more important than get_cyclecount(). It should be optimized. arm should use it even if it is not optimized. get_cyclecount() is abused as a cycle count in: - netinet/sctp_os_bsd.h. microtime() with an x86 TSC timecounter is plenty fast and accurate enough for timestamping 1 GBps ethernet. (I sometimes use nanotime(), but find that actually using the nanoseconds resolution usually just makes the output too verbose with noise in the last 3 decimal digits, so the output formatting routine needs to reduce to microseconds.) - kern/ktr_time.c. The undocumented unsupported option KTR_TIME defaults to being get_cyclecount(). KTR needs to timestamp low-level functions, so the timestamp function needs to be lower-level and nanotime() might not be low enough. However, i386 sometimes uses the timecounter, and arm always does, to nanotime() must be low enough. nanotime() also gives nicely biased and scaled timestamps. KTR has null support for scaling the timestamps that it makes. In the kernel, it just prints raw values in %10.10lld format. ktrdump(1) is further from knowing how to scale them. It just prints them or differences of them in %16ju format. 16 is excessively wide, yet not wide enough to print UINT64_MAX (that takes 20 decimal digits. Only 16 hex digits). At least it doesn't use the long long abomination. - kern/subr_bus.c. get_cyclecount() is not abused, but its result is assigned to a variable named attachtime. This is fed to random_harvest() as the vatiable named *entropy, so it is clearly random and not a time. The existence of get_cyclecount() is a bug since all uses are satisifed with a timestamp and it is better to optimize the timestamp functions than have special versions of them for just randomness. It was created before cputick() existed. cputick() is a fast enough timestamp function for all random uses (it basically uses a cycle counter if available, else falls back to using the timecounter). However, bugs pointed out above show that it is confusing to use functions whose names are related to timers as a source of randomness. A name with "random" in it would be better. Also, some arches may have a random register (in the CPU so it is fast to read) but no x86-style cycle counter or fast timecounter. These arches should use the random register for the random function. The random register just doesn't need to be very wide or crypto quality. Some of the bugs are documented in get_cyclecount(9). It is documented as monotonically increasing, although the xor version on arm was far from that and the current version wraps every 256 seconds. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 15:19:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79E785A3 for ; Wed, 4 Jun 2014 15:19:55 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C98B2DC0 for ; Wed, 4 Jun 2014 15:19:55 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s54FJt4c073278 for ; Wed, 4 Jun 2014 15:19:55 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s54FJtQk073268 for svn-src-head@freebsd.org; Wed, 4 Jun 2014 15:19:55 GMT (envelope-from bdrewery) Received: (qmail 39200 invoked from network); 4 Jun 2014 10:19:53 -0500 Received: from unknown (HELO blah) (freebsd@shatow.net@67.182.131.225) by sweb.xzibition.com with ESMTPA; 4 Jun 2014 10:19:53 -0500 Message-ID: <538F3918.6040002@FreeBSD.org> Date: Wed, 04 Jun 2014 10:19:52 -0500 From: "Drewery, Bryan" Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Eitan Adler , Baptiste Daroussin Subject: Re: svn commit: r266760 - head/contrib/bmake References: <201405271839.s4RIdDq8055387@svn.freebsd.org> <538D1DB7.7010508@FreeBSD.org> <20140603044638.81DF6580A1@chaos.jnpr.net> <20140603063512.GB45150@ivaldir.etoilebsd.net> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "Simon J. Gerraty" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 15:19:55 -0000 On 6/4/14, 2:26 AM, Eitan Adler wrote: > On 2 June 2014 23:35, Baptiste Daroussin wrote: >> On Mon, Jun 02, 2014 at 09:46:38PM -0700, Simon J. Gerraty wrote: >>> >>> On Mon, 2 Jun 2014 19:58:31 -0500, Bryan Drewery writes: >>>> Not sure if anyone cares, but this change breaks all ports tree >>>> checkouts from before 2014-05-05 on src head with this revision. >>> >>> Yes, an older ports tree would need an older bmake (or fmake). >>> Are we saying ports is *not* ready for that hack to be removed? >>> >> >> IMHO it is, just people has to be aware of that :) > > ports-announce@ is the correct location for this announcement :) > I think that would just confuse people. I don't think this is worthy of such a big announcement. I can write up something to current@ and ports@ though. It's really only an issue if you are trying to use older ports tree and why would you anyway in most cases? -- Regards, Bryan Drewery From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 15:30:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 963CAA7F; Wed, 4 Jun 2014 15:30:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83D0A2F27; Wed, 4 Jun 2014 15:30:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s54FUnPa059601; Wed, 4 Jun 2014 15:30:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54FUn7q059600; Wed, 4 Jun 2014 15:30:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406041530.s54FUn7q059600@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 4 Jun 2014 15:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267060 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 15:30:49 -0000 Author: kib Date: Wed Jun 4 15:30:49 2014 New Revision: 267060 URL: http://svnweb.freebsd.org/changeset/base/267060 Log: Allow shared locking for the tmpfs vnodes. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/tmpfs/tmpfs_subr.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Wed Jun 4 15:18:46 2014 (r267059) +++ head/sys/fs/tmpfs/tmpfs_subr.c Wed Jun 4 15:30:49 2014 (r267060) @@ -595,6 +595,8 @@ loop1: default: panic("tmpfs_alloc_vp: type %p %d", node, (int)node->tn_type); } + if (vp->v_type != VFIFO) + VN_LOCK_ASHARE(vp); error = insmntque1(vp, mp, tmpfs_insmntque_dtr, NULL); if (error) From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 16:06:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 707D1C1D; Wed, 4 Jun 2014 16:06:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 519AA2268; Wed, 4 Jun 2014 16:06:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s54G6d68077412; Wed, 4 Jun 2014 16:06:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54G6cQh077407; Wed, 4 Jun 2014 16:06:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406041606.s54G6cQh077407@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 4 Jun 2014 16:06:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267062 - in head: lib/libpmc sys/dev/hwpmc sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 16:06:39 -0000 Author: kib Date: Wed Jun 4 16:06:38 2014 New Revision: 267062 URL: http://svnweb.freebsd.org/changeset/base/267062 Log: For Xeon 7500 and 48XX (Nehalem EX and Westmere EX) variants of the Core i7 and Westmere processors, the uncore PMC subsystem is completely different from the uncore PMC on smaller versions of CPUs. Disable existing uncore hwpmc code for EX, otherwise non-existing MSRs are accessed. The cores PMCs seems to be identical for non-EX and EX, according to the SDM. Reviewed by: davide, fabient Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/lib/libpmc/libpmc.c head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/hwpmc_intel.c head/sys/sys/pmc.h Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Wed Jun 4 15:31:57 2014 (r267061) +++ head/lib/libpmc/libpmc.c Wed Jun 4 16:06:38 2014 (r267062) @@ -190,6 +190,11 @@ static const struct pmc_event_descr core __PMC_EV_ALIAS_COREI7() }; +static const struct pmc_event_descr nehalem_ex_event_table[] = +{ + __PMC_EV_ALIAS_COREI7() +}; + static const struct pmc_event_descr haswell_event_table[] = { __PMC_EV_ALIAS_HASWELL() @@ -220,6 +225,11 @@ static const struct pmc_event_descr west __PMC_EV_ALIAS_WESTMERE() }; +static const struct pmc_event_descr westmere_ex_event_table[] = +{ + __PMC_EV_ALIAS_WESTMERE() +}; + static const struct pmc_event_descr corei7uc_event_table[] = { __PMC_EV_ALIAS_COREI7UC() @@ -255,12 +265,14 @@ PMC_MDEP_TABLE(atom_silvermont, IAP, PMC PMC_MDEP_TABLE(core, IAP, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); +PMC_MDEP_TABLE(nehalem_ex, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(haswell, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(ivybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(ivybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(sandybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(westmere, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); +PMC_MDEP_TABLE(westmere_ex, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(k7, K7, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(k8, K8, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(p4, P4, PMC_CLASS_SOFT, PMC_CLASS_TSC); @@ -298,12 +310,14 @@ PMC_CLASS_TABLE_DESC(atom_silvermont, IA PMC_CLASS_TABLE_DESC(core, IAP, core, iap); PMC_CLASS_TABLE_DESC(core2, IAP, core2, iap); PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap); +PMC_CLASS_TABLE_DESC(nehalem_ex, IAP, nehalem_ex, iap); PMC_CLASS_TABLE_DESC(haswell, IAP, haswell, iap); PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap); PMC_CLASS_TABLE_DESC(ivybridge_xeon, IAP, ivybridge_xeon, iap); PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap); PMC_CLASS_TABLE_DESC(sandybridge_xeon, IAP, sandybridge_xeon, iap); PMC_CLASS_TABLE_DESC(westmere, IAP, westmere, iap); +PMC_CLASS_TABLE_DESC(westmere_ex, IAP, westmere_ex, iap); PMC_CLASS_TABLE_DESC(ucf, UCF, ucf, ucf); PMC_CLASS_TABLE_DESC(corei7uc, UCP, corei7uc, ucp); PMC_CLASS_TABLE_DESC(haswelluc, UCP, haswelluc, ucp); @@ -608,6 +622,8 @@ static struct pmc_event_alias core2_alia #define atom_silvermont_aliases_without_iaf core2_aliases_without_iaf #define corei7_aliases core2_aliases #define corei7_aliases_without_iaf core2_aliases_without_iaf +#define nehalem_ex_aliases core2_aliases +#define nehalem_ex_aliases_without_iaf core2_aliases_without_iaf #define haswell_aliases core2_aliases #define haswell_aliases_without_iaf core2_aliases_without_iaf #define ivybridge_aliases core2_aliases @@ -620,6 +636,8 @@ static struct pmc_event_alias core2_alia #define sandybridge_xeon_aliases_without_iaf core2_aliases_without_iaf #define westmere_aliases core2_aliases #define westmere_aliases_without_iaf core2_aliases_without_iaf +#define westmere_ex_aliases core2_aliases +#define westmere_ex_aliases_without_iaf core2_aliases_without_iaf #define IAF_KW_OS "os" #define IAF_KW_USR "usr" @@ -863,7 +881,9 @@ iap_allocate_pmc(enum pmc_event pe, char } else return (-1); } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_COREI7 || - cpu_info.pm_cputype == PMC_CPU_INTEL_WESTMERE) { + cpu_info.pm_cputype == PMC_CPU_INTEL_WESTMERE || + cpu_info.pm_cputype == PMC_CPU_INTEL_NEHALEM_EX || + cpu_info.pm_cputype == PMC_CPU_INTEL_WESTMERE_EX) { if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { n = pmc_parse_mask(iap_rsp_mask_i7_wm, p, &rsp); } else @@ -2760,6 +2780,10 @@ pmc_event_names_of_class(enum pmc_class ev = corei7_event_table; count = PMC_EVENT_TABLE_SIZE(corei7); break; + case PMC_CPU_INTEL_NEHALEM_EX: + ev = nehalem_ex_event_table; + count = PMC_EVENT_TABLE_SIZE(nehalem_ex); + break; case PMC_CPU_INTEL_HASWELL: ev = haswell_event_table; count = PMC_EVENT_TABLE_SIZE(haswell); @@ -2784,6 +2808,10 @@ pmc_event_names_of_class(enum pmc_class ev = westmere_event_table; count = PMC_EVENT_TABLE_SIZE(westmere); break; + case PMC_CPU_INTEL_WESTMERE_EX: + ev = westmere_ex_event_table; + count = PMC_EVENT_TABLE_SIZE(westmere_ex); + break; } break; case PMC_CLASS_UCF: @@ -3079,6 +3107,9 @@ pmc_init(void) pmc_class_table[n++] = &corei7uc_class_table_descr; PMC_MDEP_INIT_INTEL_V2(corei7); break; + case PMC_CPU_INTEL_NEHALEM_EX: + PMC_MDEP_INIT_INTEL_V2(nehalem_ex); + break; case PMC_CPU_INTEL_HASWELL: pmc_class_table[n++] = &ucf_class_table_descr; pmc_class_table[n++] = &haswelluc_class_table_descr; @@ -3103,6 +3134,9 @@ pmc_init(void) pmc_class_table[n++] = &westmereuc_class_table_descr; PMC_MDEP_INIT_INTEL_V2(westmere); break; + case PMC_CPU_INTEL_WESTMERE_EX: + PMC_MDEP_INIT_INTEL_V2(westmere_ex); + break; case PMC_CPU_INTEL_PIV: PMC_MDEP_INIT(p4); pmc_class_table[n] = &p4_class_table_descr; @@ -3237,6 +3271,11 @@ _pmc_name_of_event(enum pmc_event pe, en ev = corei7_event_table; evfence = corei7_event_table + PMC_EVENT_TABLE_SIZE(corei7); break; + case PMC_CPU_INTEL_NEHALEM_EX: + ev = nehalem_ex_event_table; + evfence = nehalem_ex_event_table + + PMC_EVENT_TABLE_SIZE(nehalem_ex); + break; case PMC_CPU_INTEL_HASWELL: ev = haswell_event_table; evfence = haswell_event_table + PMC_EVENT_TABLE_SIZE(haswell); @@ -3261,6 +3300,11 @@ _pmc_name_of_event(enum pmc_event pe, en ev = westmere_event_table; evfence = westmere_event_table + PMC_EVENT_TABLE_SIZE(westmere); break; + case PMC_CPU_INTEL_WESTMERE_EX: + ev = westmere_ex_event_table; + evfence = westmere_ex_event_table + + PMC_EVENT_TABLE_SIZE(westmere_ex); + break; default: /* Unknown CPU type. */ break; } Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Wed Jun 4 15:31:57 2014 (r267061) +++ head/sys/dev/hwpmc/hwpmc_core.c Wed Jun 4 16:06:38 2014 (r267062) @@ -2021,6 +2021,7 @@ iap_allocate_pmc(int cpu, int ri, struct switch (core_cputype) { case PMC_CPU_INTEL_COREI7: + case PMC_CPU_INTEL_NEHALEM_EX: if (iap_event_corei7_ok_on_counter(ev, ri) == 0) return (EINVAL); break; @@ -2033,6 +2034,7 @@ iap_allocate_pmc(int cpu, int ri, struct return (EINVAL); break; case PMC_CPU_INTEL_WESTMERE: + case PMC_CPU_INTEL_WESTMERE_EX: if (iap_event_westmere_ok_on_counter(ev, ri) == 0) return (EINVAL); break; @@ -2186,7 +2188,9 @@ iap_allocate_pmc(int cpu, int ri, struct ev == PMC_EV_IAP_EVENT_BBH_01H) return (EINVAL); if ((core_cputype == PMC_CPU_INTEL_COREI7 || - core_cputype == PMC_CPU_INTEL_WESTMERE) && + core_cputype == PMC_CPU_INTEL_WESTMERE || + core_cputype == PMC_CPU_INTEL_NEHALEM_EX || + core_cputype == PMC_CPU_INTEL_WESTMERE_EX) && a->pm_md.pm_iap.pm_iap_rsp & ~IA_OFFCORE_RSP_MASK_I7WM) return (EINVAL); else if ((core_cputype == PMC_CPU_INTEL_SANDYBRIDGE || Modified: head/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_intel.c Wed Jun 4 15:31:57 2014 (r267061) +++ head/sys/dev/hwpmc/hwpmc_intel.c Wed Jun 4 16:06:38 2014 (r267062) @@ -147,15 +147,22 @@ pmc_intel_initialize(void) * Per Intel document 253669-032 9/2009, * pages A-2 and A-57 */ - case 0x2E: cputype = PMC_CPU_INTEL_COREI7; nclasses = 5; break; + case 0x2E: + cputype = PMC_CPU_INTEL_NEHALEM_EX; + nclasses = 3; + break; case 0x25: /* Per Intel document 253669-033US 12/2009. */ case 0x2C: /* Per Intel document 253669-033US 12/2009. */ cputype = PMC_CPU_INTEL_WESTMERE; nclasses = 5; break; + case 0x2F: /* Westmere-EX, seen in wild */ + cputype = PMC_CPU_INTEL_WESTMERE_EX; + nclasses = 3; + break; case 0x2A: /* Per Intel document 253669-039US 05/2011. */ cputype = PMC_CPU_INTEL_SANDYBRIDGE; nclasses = 5; @@ -218,9 +225,11 @@ pmc_intel_initialize(void) case PMC_CPU_INTEL_CORE2: case PMC_CPU_INTEL_CORE2EXTREME: case PMC_CPU_INTEL_COREI7: + case PMC_CPU_INTEL_NEHALEM_EX: case PMC_CPU_INTEL_IVYBRIDGE: case PMC_CPU_INTEL_SANDYBRIDGE: case PMC_CPU_INTEL_WESTMERE: + case PMC_CPU_INTEL_WESTMERE_EX: case PMC_CPU_INTEL_SANDYBRIDGE_XEON: case PMC_CPU_INTEL_IVYBRIDGE_XEON: case PMC_CPU_INTEL_HASWELL: @@ -307,10 +316,12 @@ pmc_intel_finalize(struct pmc_mdep *md) case PMC_CPU_INTEL_CORE2: case PMC_CPU_INTEL_CORE2EXTREME: case PMC_CPU_INTEL_COREI7: + case PMC_CPU_INTEL_NEHALEM_EX: case PMC_CPU_INTEL_HASWELL: case PMC_CPU_INTEL_IVYBRIDGE: case PMC_CPU_INTEL_SANDYBRIDGE: case PMC_CPU_INTEL_WESTMERE: + case PMC_CPU_INTEL_WESTMERE_EX: case PMC_CPU_INTEL_SANDYBRIDGE_XEON: case PMC_CPU_INTEL_IVYBRIDGE_XEON: pmc_core_finalize(md); Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Wed Jun 4 15:31:57 2014 (r267061) +++ head/sys/sys/pmc.h Wed Jun 4 16:06:38 2014 (r267062) @@ -92,6 +92,8 @@ __PMC_CPU(INTEL_IVYBRIDGE_XEON, 0x90, "Intel Ivy Bridge Xeon") \ __PMC_CPU(INTEL_HASWELL, 0x91, "Intel Haswell") \ __PMC_CPU(INTEL_ATOM_SILVERMONT, 0x92, "Intel Atom Silvermont") \ + __PMC_CPU(INTEL_NEHALEM_EX, 0x93, "Intel Nehalem Xeon 7500") \ + __PMC_CPU(INTEL_WESTMERE_EX, 0x94, "Intel Westmere Xeon E7") \ __PMC_CPU(INTEL_XSCALE, 0x100, "Intel XScale") \ __PMC_CPU(MIPS_24K, 0x200, "MIPS 24K") \ __PMC_CPU(MIPS_OCTEON, 0x201, "Cavium Octeon") \ From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 16:20:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF9471A8; Wed, 4 Jun 2014 16:20:35 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 7040C23C5; Wed, 4 Jun 2014 16:20:35 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 03B0B1044667; Thu, 5 Jun 2014 02:20:32 +1000 (EST) Date: Thu, 5 Jun 2014 02:20:24 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pietro Cerutti Subject: Re: svn commit: r267027 - head/usr.bin/users In-Reply-To: <201406032059.s53KxQAp081243@svn.freebsd.org> Message-ID: <20140605013835.M1934@besplex.bde.org> References: <201406032059.s53KxQAp081243@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=U6SrU4bu c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=M9zwebxRaw4A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=iRfTH0PG8UVemprl3JAA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 16:20:36 -0000 On Tue, 3 Jun 2014, Pietro Cerutti wrote: > Log: > - Avoid calling a wrapper function around strcmp This changes correct code to give undefined behaviour. > - Use sizeof(*array) instead of sizeof(element) everywhere This also allows removal of a typedef obfuscation. > Modified: head/usr.bin/users/users.c > ============================================================================== > --- head/usr.bin/users/users.c Tue Jun 3 20:58:11 2014 (r267026) > +++ head/usr.bin/users/users.c Tue Jun 3 20:59:26 2014 (r267027) > @@ -50,9 +50,9 @@ static const char rcsid[] = > #include > #include > > -typedef char namebuf[sizeof(((struct utmpx *)0)->ut_user) + 1]; > +typedef char namebuf[sizeof(((struct utmpx *)0)->ut_user) + 1]; > +typedef int (*scmp)(const void *, const void *); Most typedefs shouldn't exist, and these 2 are no exceptions. 'namebuf' only existed to reduce 2 copies of a type declaration to 1. It obfuscated both. Now it is only used once. 'scmp' only exists to help implement undefined behaviour. The change also de-KNFizes the formatting (from tab to space after the first part of the type). > @@ -91,7 +91,7 @@ main(int argc, char **argv) > } > endutxent(); > if (ncnt > 0) { > - qsort(names, ncnt, sizeof(namebuf), scmp); > + qsort(names, ncnt, sizeof(*names), (scmp)strcmp); qsort()'s function pointer must point to a function like scmp, not a different type of function with the type mismatch hidden by a bogus cast. The type puns fail as follow: - strcmp is initially a function - dereferencing it gives a pointer to a function of the type of strcmp - casting this pointer to (scmp) gives a pointer to a different type of function. The behaviour is defined. The representation may change. - use of such a cast function pointer to call the function is undefined unless the pointer is converted back to the original (pointer) type before making the call. Since qsort() cannot possibly know the original type, it cannot convert back. It is a feature that qsort()'s API doesn't have a function pointer typedef. There are a few legitimate uses for function pointer typedefs, but in practices most uses are for bogus casts to hide undefined behaviour, as above. The qsort() call also uses the other type obfuscation. 'namebuf' is the typedef-name. This typedef name was only used twice, first to declare 'names' and also here. Now with the better spelling of the sizeof(), the typedef name is only used once. It just obfuscates the declaration of 'names'. > ... > @@ -107,10 +107,3 @@ usage(void) > fprintf(stderr, "usage: users\n"); > exit(1); > } > - > -int > -scmp(const void *p, const void *q) > -{ > - > - return (strcmp(p, q)); > -} Most qsort() functions have to look like this, or a bit more complicated, to avoid the undefined behaviour. This one looks simpler than it is. It has to convert the arg types to those of strcmp(), but this happens automatically due to strcmp()s prototype. The arg types started as strings, but had to be converted to const void *'s to match qsort()'s API, then have to be converted back to strings here. The undefined behaviour is usually to work in practice because only Vax hardware is supported. strings are so similar to void * that it is hard to tell if the behaviour can ever be undefined in practice for type puns between them. But the behaviour is more clearly undefined for function pointers because compatibility of void * and char * as args doesn't extend to the function pointers. The implementation could reasonably check all types at runtime and is only constrained from generating a fatal error for type mismatches for certain mismatches that are specified to work for compatibility reasons. I think that if the bogus conversions get as far as calling the function, then the behaviour is defined by the compatibility kludges: - string args became const void * in qsort()'s internals - they are not converted back when they are passed to strcmp() - however, the compatibility kludges now apply. const void * looks enough like const char * to work. (I think it may have a different representation, but only with bits that aren't really used, for example extra type bits that might be used for error checking but must not be used here due to the compatibility kludges.) Bruce From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 16:29:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA113559; Wed, 4 Jun 2014 16:29:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7B3A24B3; Wed, 4 Jun 2014 16:29:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s54GTIvu086902; Wed, 4 Jun 2014 16:29:18 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54GTI3s086901; Wed, 4 Jun 2014 16:29:18 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201406041629.s54GTI3s086901@svn.freebsd.org> From: Ivan Voras Date: Wed, 4 Jun 2014 16:29:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267063 - head/sbin/geom/class/label X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 16:29:18 -0000 Author: ivoras Date: Wed Jun 4 16:29:18 2014 New Revision: 267063 URL: http://svnweb.freebsd.org/changeset/base/267063 Log: Bulk document the kern.geom.label.*.enable sysctls and tunables. Modified: head/sbin/geom/class/label/glabel.8 Modified: head/sbin/geom/class/label/glabel.8 ============================================================================== --- head/sbin/geom/class/label/glabel.8 Wed Jun 4 16:06:38 2014 (r267062) +++ head/sbin/geom/class/label/glabel.8 Wed Jun 4 16:29:18 2014 (r267063) @@ -223,6 +223,19 @@ This can be set to a number between 0 an If set to 0 minimal debug information is printed, and if set to 2 the maximum amount of debug information is printed. .El +.Bl -tag -width indent +.It Va kern.geom.label.*.enable : No 1 +Most +.Nm LABEL +providers implement a +.Xr sysctl 8 +flag and a tunable variable named in the above format. This flag +controls if the label provider will be active, tasting devices +and creating label nodes in the +.Xr devfs 5 +tree. It is sometimes desirable to disable certain label types if +they conflict with other classes in complex GEOM topologies. +.Bl .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 16:55:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BB3A97B; Wed, 4 Jun 2014 16:55:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79BA2274F; Wed, 4 Jun 2014 16:55:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s54Gtd9a000822; Wed, 4 Jun 2014 16:55:39 GMT (envelope-from allanjude@svn.freebsd.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54Gtdg6000821; Wed, 4 Jun 2014 16:55:39 GMT (envelope-from allanjude@svn.freebsd.org) Message-Id: <201406041655.s54Gtdg6000821@svn.freebsd.org> From: Allan Jude Date: Wed, 4 Jun 2014 16:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267064 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 16:55:39 -0000 Author: allanjude (doc committer) Date: Wed Jun 4 16:55:38 2014 New Revision: 267064 URL: http://svnweb.freebsd.org/changeset/base/267064 Log: Sadly, we do not actually live in the future. Approved by: wblock (mentor) Modified: head/usr.bin/netstat/netstat.1 Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Wed Jun 4 16:29:18 2014 (r267063) +++ head/usr.bin/netstat/netstat.1 Wed Jun 4 16:55:38 2014 (r267064) @@ -28,7 +28,7 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd July 4, 2014 +.Dd June 4, 2014 .Dt NETSTAT 1 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 16:57:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 110DCB21; Wed, 4 Jun 2014 16:57:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F31F1276C; Wed, 4 Jun 2014 16:57:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s54Gv56w001074; Wed, 4 Jun 2014 16:57:05 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54Gv5S0001073; Wed, 4 Jun 2014 16:57:05 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406041657.s54Gv5S0001073@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 4 Jun 2014 16:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267065 - head/sys/dev/virtio/network X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 16:57:06 -0000 Author: luigi Date: Wed Jun 4 16:57:05 2014 New Revision: 267065 URL: http://svnweb.freebsd.org/changeset/base/267065 Log: make sure ifp->if_transmit returns 0 if a buffer is enqueued. A similar fix should be applied to vmxnet, ixgbe, igb, i40e. (some of them previously reported by Michael Tuexen) Drivers using if_transmit are correct, and so are most of the other drivers that reassing if_transmit. Among other things, this bug causes panics when using netmap emulation on top of generic drivers. Approved by: bryanv MFC after: 3 days Modified: head/sys/dev/virtio/network/if_vtnet.c Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Wed Jun 4 16:55:38 2014 (r267064) +++ head/sys/dev/virtio/network/if_vtnet.c Wed Jun 4 16:57:05 2014 (r267065) @@ -2262,7 +2262,6 @@ vtnet_txq_mq_start_locked(struct vtnet_t while ((m = drbr_peek(ifp, br)) != NULL) { if (virtqueue_full(vq)) { drbr_putback(ifp, br, m); - error = ENOBUFS; break; } @@ -2285,7 +2284,7 @@ vtnet_txq_mq_start_locked(struct vtnet_t txq->vtntx_watchdog = VTNET_TX_TIMEOUT; } - return (error); + return (0); } static int From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 16:58:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3A40C6F; Wed, 4 Jun 2014 16:58:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B89092776; Wed, 4 Jun 2014 16:58:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s54GwZNB001292; Wed, 4 Jun 2014 16:58:35 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54GwZn4001291; Wed, 4 Jun 2014 16:58:35 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406041658.s54GwZn4001291@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 4 Jun 2014 16:58:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267066 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 16:58:36 -0000 Author: hselasky Date: Wed Jun 4 16:58:35 2014 New Revision: 267066 URL: http://svnweb.freebsd.org/changeset/base/267066 Log: More RSU fixes: - Properly align temporary buffer to 32-bit. - Add an extra parenthesis to make expression clear. - Range check the association ID received from hardware. MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_rsu.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Wed Jun 4 16:57:05 2014 (r267065) +++ head/sys/dev/usb/wlan/if_rsu.c Wed Jun 4 16:58:35 2014 (r267066) @@ -1057,7 +1057,8 @@ rsu_join_bss(struct rsu_softc *sc, struc struct ndis_wlan_bssid_ex *bss; struct ndis_802_11_fixed_ies *fixed; struct r92s_fw_cmd_auth auth; - uint8_t buf[sizeof(*bss) + 128], *frm; + uint8_t buf[sizeof(*bss) + 128] __aligned(4); + uint8_t *frm; uint8_t opmode; int error; @@ -1071,7 +1072,7 @@ rsu_join_bss(struct rsu_softc *sc, struc memset(&auth, 0, sizeof(auth)); if (vap->iv_flags & IEEE80211_F_WPA) { auth.mode = R92S_AUTHMODE_WPA; - auth.dot1x = ni->ni_authmode == IEEE80211_AUTH_8021X; + auth.dot1x = (ni->ni_authmode == IEEE80211_AUTH_8021X); } else auth.mode = R92S_AUTHMODE_OPEN; DPRINTF("setting auth mode to %d\n", auth.mode); @@ -1192,6 +1193,7 @@ rsu_event_join_bss(struct rsu_softc *sc, struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); struct ieee80211_node *ni = vap->iv_bss; struct r92s_event_join_bss *rsp; + uint32_t tmp; int res; if (__predict_false(len < sizeof(*rsp))) @@ -1206,9 +1208,14 @@ rsu_event_join_bss(struct rsu_softc *sc, RSU_LOCK(sc); return; } + tmp = le32toh(rsp->associd); + if (tmp >= vap->iv_max_aid) { + DPRINTF("Assoc ID overflow\n"); + tmp = 1; + } DPRINTF("associated with %s associd=%d\n", - ether_sprintf(rsp->bss.macaddr), le32toh(rsp->associd)); - ni->ni_associd = le32toh(rsp->associd) | 0xc000; + ether_sprintf(rsp->bss.macaddr), tmp); + ni->ni_associd = tmp | 0xc000; RSU_UNLOCK(sc); ieee80211_new_state(vap, IEEE80211_S_RUN, IEEE80211_FC0_SUBTYPE_ASSOC_RESP); From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 17:17:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00C2D592; Wed, 4 Jun 2014 17:17:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E315B2970; Wed, 4 Jun 2014 17:17:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s54HHU7d010632; Wed, 4 Jun 2014 17:17:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54HHUSr010631; Wed, 4 Jun 2014 17:17:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406041717.s54HHUSr010631@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 4 Jun 2014 17:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267067 - head/usr.bin/yes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 17:17:31 -0000 Author: kib Date: Wed Jun 4 17:17:30 2014 New Revision: 267067 URL: http://svnweb.freebsd.org/changeset/base/267067 Log: Cross-reference jot(1) and seq(1). MFC after: 3 days Modified: head/usr.bin/yes/yes.1 Modified: head/usr.bin/yes/yes.1 ============================================================================== --- head/usr.bin/yes/yes.1 Wed Jun 4 16:58:35 2014 (r267066) +++ head/usr.bin/yes/yes.1 Wed Jun 4 17:17:30 2014 (r267067) @@ -28,7 +28,7 @@ .\" @(#)yes.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 6, 1993 +.Dd June 4, 2014 .Dt YES 1 .Os .Sh NAME @@ -45,6 +45,9 @@ utility outputs or, by default, .Dq y , forever. +.Sh SEE ALSO +.Xr jot 1 , +.Xr seq 1 . .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 19:42:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 571B4AC6; Wed, 4 Jun 2014 19:42:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4499128A2; Wed, 4 Jun 2014 19:42:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s54JgmYm079461; Wed, 4 Jun 2014 19:42:48 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54Jgm8Q079460; Wed, 4 Jun 2014 19:42:48 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406041942.s54Jgm8Q079460@svn.freebsd.org> From: Ed Maste Date: Wed, 4 Jun 2014 19:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267078 - head/sys/dev/vt/font X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 19:42:48 -0000 Author: emaste Date: Wed Jun 4 19:42:47 2014 New Revision: 267078 URL: http://svnweb.freebsd.org/changeset/base/267078 Log: Update vt(4) console font author's email address MFC after: 3 days Modified: head/sys/dev/vt/font/vt_font_default.c Modified: head/sys/dev/vt/font/vt_font_default.c ============================================================================== --- head/sys/dev/vt/font/vt_font_default.c Wed Jun 4 18:58:32 2014 (r267077) +++ head/sys/dev/vt/font/vt_font_default.c Wed Jun 4 19:42:47 2014 (r267078) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Please contribute any changes back to . + * Please contribute any changes back to . */ #include From owner-svn-src-head@FreeBSD.ORG Wed Jun 4 20:05:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9215259; Wed, 4 Jun 2014 20:05:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C70012AB6; Wed, 4 Jun 2014 20:05:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s54K5qPG089131; Wed, 4 Jun 2014 20:05:52 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s54K5qDg089130; Wed, 4 Jun 2014 20:05:52 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406042005.s54K5qDg089130@svn.freebsd.org> From: Ed Maste Date: Wed, 4 Jun 2014 20:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267079 - head/sys/dev/vt/font X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2014 20:05:52 -0000 Author: emaste Date: Wed Jun 4 20:05:52 2014 New Revision: 267079 URL: http://svnweb.freebsd.org/changeset/base/267079 Log: Remove extra copy of old email address. MFC after: 3 days Modified: head/sys/dev/vt/font/vt_font_default.c Modified: head/sys/dev/vt/font/vt_font_default.c ============================================================================== --- head/sys/dev/vt/font/vt_font_default.c Wed Jun 4 19:42:47 2014 (r267078) +++ head/sys/dev/vt/font/vt_font_default.c Wed Jun 4 20:05:52 2014 (r267079) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2011 Dimitar Toshkov Zhekov - * All rights reserved. + * Copyright (c) 2011 Dimitar Toshkov Zhekov. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 00:05:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF232F4A for ; Thu, 5 Jun 2014 00:05:56 +0000 (UTC) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C3DA2393 for ; Thu, 5 Jun 2014 00:05:56 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id jt11so232556pbb.27 for ; Wed, 04 Jun 2014 17:05:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:content-type:mime-version:subject :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=QiNKFF/c4BhOwv/4QutIyQ31u+IBS7JS+6zIEdoZa6M=; b=TqcbSIRDpRJtTxzU1FIHpCpaWYovGVA9OmJHlyHegd0d7Z80ZteX8GfZ8qYCC8lKk5 kkD11fg6oXjMeDOTjjuaPVgAZGHk5XsaJaQmY5TJCE7sdyWpnUWTJYdhALhAJjJxNrHN XR4Kh0C1XLuce0yk68vmJRvT8hDzGp/mbIlNjWkp8kwl/v1oYR3t56zsHqn2/nAhf9pL O7kKC+Ri6P6Gtr+/K3GeVTmnDUMCSNAKYcbJUR2YUtzA/94zdAh7RgvfMMDSKb6fe574 pDBl7f7hzx8gyB68h8cglkuNdBxfGfafYNFWN0oCWEonCob44f4kUfYEdpWzOiGGwmrm k2Tg== X-Gm-Message-State: ALoCoQmd2x5UQ6v55MaeON98XQJFAozNxilmjf/8eIyAiA4R9tvxjk0LlUj67FxMZ6GcKIqBArgS X-Received: by 10.68.231.229 with SMTP id tj5mr68745870pbc.101.1401926749512; Wed, 04 Jun 2014 17:05:49 -0700 (PDT) Received: from [10.64.26.207] (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id hb10sm15101275pbd.75.2014.06.04.17.05.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Jun 2014 17:05:48 -0700 (PDT) Sender: Warner Losh From: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266760 - head/contrib/bmake In-Reply-To: <20140603063512.GB45150@ivaldir.etoilebsd.net> Date: Wed, 4 Jun 2014 18:05:47 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201405271839.s4RIdDq8055387@svn.freebsd.org> <538D1DB7.7010508@FreeBSD.org> <20140603044638.81DF6580A1@chaos.jnpr.net> <20140603063512.GB45150@ivaldir.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Bryan Drewery , src-committers@FreeBSD.org, "Simon J. Gerraty" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 00:05:56 -0000 On Jun 3, 2014, at 12:35 AM, Baptiste Daroussin = wrote: > On Mon, Jun 02, 2014 at 09:46:38PM -0700, Simon J. Gerraty wrote: >>=20 >> On Mon, 2 Jun 2014 19:58:31 -0500, Bryan Drewery writes: >>> Not sure if anyone cares, but this change breaks all ports tree >>> checkouts from before 2014-05-05 on src head with this revision.=20 >>=20 >> Yes, an older ports tree would need an older bmake (or fmake). >> Are we saying ports is *not* ready for that hack to be removed? >>=20 >=20 > IMHO it is, just people has to be aware of that :) It would be nice if we could put that code back into make, but have it disabled. There are several people that use custom old trees that are hitting this when they build on newer systems=85 While /usr/ports is = ready, forks of it might not be. I=92m cool with having it be turned off by = default, but it sure would be convenient to be able to flip it back on=85 Anybody object if I do this? Warner From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 00:38:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D58E9DD; Thu, 5 Jun 2014 00:38:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B1D8267A; Thu, 5 Jun 2014 00:38:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s550cW2I011667; Thu, 5 Jun 2014 00:38:32 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s550cWnk011666; Thu, 5 Jun 2014 00:38:32 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201406050038.s550cWnk011666@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 5 Jun 2014 00:38:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267082 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 00:38:33 -0000 Author: np Date: Thu Jun 5 00:38:32 2014 New Revision: 267082 URL: http://svnweb.freebsd.org/changeset/base/267082 Log: cxgbe(4): Properly account for the freelist buffers used when returning early from service_iq due to a budget restriction. This fixes a potential rx hang when using INTx. MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Wed Jun 4 21:17:51 2014 (r267081) +++ head/sys/dev/cxgbe/t4_sge.c Thu Jun 5 00:38:32 2014 (r267082) @@ -1424,8 +1424,15 @@ service_iq(struct sge_iq *iq, int budget } #endif - if (budget) + if (budget) { + if (fl_bufs_used) { + FL_LOCK(fl); + fl->needed += fl_bufs_used; + refill_fl(sc, fl, 32); + FL_UNLOCK(fl); + } return (EINPROGRESS); + } } } From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 01:55:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37740F7C; Thu, 5 Jun 2014 01:55:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 255EB2D5B; Thu, 5 Jun 2014 01:55:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s551tOvZ048362; Thu, 5 Jun 2014 01:55:24 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s551tOdY048361; Thu, 5 Jun 2014 01:55:24 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201406050155.s551tOdY048361@svn.freebsd.org> From: Kevin Lo Date: Thu, 5 Jun 2014 01:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267089 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 01:55:24 -0000 Author: kevlo Date: Thu Jun 5 01:55:23 2014 New Revision: 267089 URL: http://svnweb.freebsd.org/changeset/base/267089 Log: Remove D-Link DWA140 rev D1 by accident. Pointed out by Anders Larsson in private email. Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Thu Jun 5 01:52:20 2014 (r267088) +++ head/sys/dev/usb/wlan/if_run.c Thu Jun 5 01:55:23 2014 (r267089) @@ -181,6 +181,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(DLINK, DWA127), RUN_DEV(DLINK, DWA140B3), RUN_DEV(DLINK, DWA160B2), + RUN_DEV(DLINK, DWA140D1), RUN_DEV(DLINK, DWA162), RUN_DEV(DLINK2, DWA130), RUN_DEV(DLINK2, RT2870_1), From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 01:58:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E701A183; Thu, 5 Jun 2014 01:58:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4DF72D80; Thu, 5 Jun 2014 01:58:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s551wLcs048761; Thu, 5 Jun 2014 01:58:21 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s551wL6Z048760; Thu, 5 Jun 2014 01:58:21 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201406050158.s551wL6Z048760@svn.freebsd.org> From: Warren Block Date: Thu, 5 Jun 2014 01:58:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267090 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 01:58:22 -0000 Author: wblock (doc committer) Date: Thu Jun 5 01:58:21 2014 New Revision: 267090 URL: http://svnweb.freebsd.org/changeset/base/267090 Log: Correct the document date for last change. MFC after: 1 week Modified: head/share/man/man5/passwd.5 Modified: head/share/man/man5/passwd.5 ============================================================================== --- head/share/man/man5/passwd.5 Thu Jun 5 01:55:23 2014 (r267089) +++ head/share/man/man5/passwd.5 Thu Jun 5 01:58:21 2014 (r267090) @@ -31,7 +31,7 @@ .\" From: @(#)passwd.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 23, 2012 +.Dd May 29, 2014 .Dt PASSWD 5 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 03:16:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50CC2BB3; Thu, 5 Jun 2014 03:16:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E32A2417; Thu, 5 Jun 2014 03:16:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s553GOai085260; Thu, 5 Jun 2014 03:16:24 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s553GO5I085259; Thu, 5 Jun 2014 03:16:24 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201406050316.s553GO5I085259@svn.freebsd.org> From: Kevin Lo Date: Thu, 5 Jun 2014 03:16:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267091 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 03:16:24 -0000 Author: kevlo Date: Thu Jun 5 03:16:23 2014 New Revision: 267091 URL: http://svnweb.freebsd.org/changeset/base/267091 Log: Catch up with recent changes... Modified: head/share/man/man9/mbuf.9 Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Thu Jun 5 01:58:21 2014 (r267090) +++ head/share/man/man9/mbuf.9 Thu Jun 5 03:16:23 2014 (r267091) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 30, 2014 +.Dd June 5, 2014 .Dt MBUF 9 .Os .\" @@ -209,24 +209,26 @@ The flag bits are defined as follows: .Bd -literal /* mbuf flags */ -#define M_EXT 0x0001 /* has associated external storage */ -#define M_PKTHDR 0x0002 /* start of record */ -#define M_EOR 0x0004 /* end of record */ -#define M_RDONLY 0x0008 /* associated data marked read-only */ -#define M_PROTO1 0x0010 /* protocol-specific */ -#define M_PROTO2 0x0020 /* protocol-specific */ -#define M_PROTO3 0x0040 /* protocol-specific */ -#define M_PROTO4 0x0080 /* protocol-specific */ -#define M_PROTO5 0x0100 /* protocol-specific */ -#define M_PROTO6 0x4000 /* protocol-specific (avoid M_BCAST conflict) */ -#define M_FREELIST 0x8000 /* mbuf is on the free list */ +#define M_EXT 0x00000001 /* has associated external storage */ +#define M_PKTHDR 0x00000002 /* start of record */ +#define M_EOR 0x00000004 /* end of record */ +#define M_RDONLY 0x00000008 /* associated data marked read-only */ +#define M_PROTO1 0x00001000 /* protocol-specific */ +#define M_PROTO2 0x00002000 /* protocol-specific */ +#define M_PROTO3 0x00004000 /* protocol-specific */ +#define M_PROTO4 0x00008000 /* protocol-specific */ +#define M_PROTO5 0x00010000 /* protocol-specific */ +#define M_PROTO6 0x00020000 /* protocol-specific */ +#define M_PROTO7 0x00040000 /* protocol-specific */ +#define M_PROTO8 0x00080000 /* protocol-specific */ +#define M_PROTO9 0x00100000 /* protocol-specific */ +#define M_PROTO10 0x00200000 /* protocol-specific */ +#define M_PROTO11 0x00400000 /* protocol-specific */ +#define M_PROTO12 0x00800000 /* protocol-specific */ /* mbuf pkthdr flags (also stored in m_flags) */ -#define M_BCAST 0x0200 /* send/received as link-level broadcast */ -#define M_MCAST 0x0400 /* send/received as link-level multicast */ -#define M_FRAG 0x0800 /* packet is fragment of larger packet */ -#define M_FIRSTFRAG 0x1000 /* packet is first fragment */ -#define M_LASTFRAG 0x2000 /* packet is last fragment */ +#define M_BCAST 0x00000010 /* send/received as link-level broadcast */ +#define M_MCAST 0x00000020 /* send/received as link-level multicast */ .Ed .Pp The available @@ -251,10 +253,10 @@ The available external buffer types are #define EXT_JUMBO16 5 /* jumbo cluster 16184 bytes */ #define EXT_PACKET 6 /* mbuf+cluster from packet zone */ #define EXT_MBUF 7 /* external mbuf reference (M_IOVEC) */ -#define EXT_NET_DRV 100 /* custom ext_buf provided by net driver(s) */ -#define EXT_MOD_TYPE 200 /* custom module's ext_buf type */ -#define EXT_DISPOSABLE 300 /* can throw this buffer away w/page flipping */ -#define EXT_EXTREF 400 /* has externally maintained ref_cnt ptr */ +#define EXT_NET_DRV 252 /* custom ext_buf provided by net driver(s) */ +#define EXT_MOD_TYPE 253 /* custom module's ext_buf type */ +#define EXT_DISPOSABLE 254 /* can throw this buffer away w/page flipping */ +#define EXT_EXTREF 255 /* has externally maintained ref_cnt ptr */ .Ed .Pp If the From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 03:18:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0F70D0C; Thu, 5 Jun 2014 03:18:56 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E26F2433; Thu, 5 Jun 2014 03:18:56 +0000 (UTC) Received: from Julian-MBP3.local (etroy.elischer.org [121.45.232.70]) (authenticated bits=0) by vps1.elischer.org (8.14.8/8.14.8) with ESMTP id s553Iiwk092884 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 4 Jun 2014 20:18:46 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <538FE18E.7050101@freebsd.org> Date: Thu, 05 Jun 2014 11:18:38 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "Drewery, Bryan" , Eitan Adler , Baptiste Daroussin Subject: Re: svn commit: r266760 - head/contrib/bmake References: <201405271839.s4RIdDq8055387@svn.freebsd.org> <538D1DB7.7010508@FreeBSD.org> <20140603044638.81DF6580A1@chaos.jnpr.net> <20140603063512.GB45150@ivaldir.etoilebsd.net> <538F3918.6040002@FreeBSD.org> In-Reply-To: <538F3918.6040002@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "Simon J. Gerraty" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 03:18:56 -0000 On 6/4/14, 11:19 PM, Drewery, Bryan wrote: > On 6/4/14, 2:26 AM, Eitan Adler wrote: >> On 2 June 2014 23:35, Baptiste Daroussin wrote: >>> On Mon, Jun 02, 2014 at 09:46:38PM -0700, Simon J. Gerraty wrote: >>>> >>>> On Mon, 2 Jun 2014 19:58:31 -0500, Bryan Drewery writes: >>>>> Not sure if anyone cares, but this change breaks all ports tree >>>>> checkouts from before 2014-05-05 on src head with this revision. >>>> >>>> Yes, an older ports tree would need an older bmake (or fmake). >>>> Are we saying ports is *not* ready for that hack to be removed? >>>> >>> >>> IMHO it is, just people has to be aware of that :) >> >> ports-announce@ is the correct location for this announcement :) >> > > I think that would just confuse people. I don't think this is worthy > of such a big announcement. I can write up something to current@ and > ports@ though. It's really only an issue if you are trying to use > older ports tree and why would you anyway in most cases? > We have a scenario where we check out a ports tree at one revision, but then need to slide parts of it back and forth to get to a specific revision of a port that we need. We can not affort to re-verrify every port revision every month, so it stays at an old revision generally but individual ports my upgrade if there is a security risk or may remain on anold revision if a newer version breaks thins for us. (it happens). If that breaks we will not be happy From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 03:46:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96C2668C; Thu, 5 Jun 2014 03:46:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A3D426A6; Thu, 5 Jun 2014 03:46:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s553klss099321; Thu, 5 Jun 2014 03:46:47 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s553klum099320; Thu, 5 Jun 2014 03:46:47 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201406050346.s553klum099320@svn.freebsd.org> From: Davide Italiano Date: Thu, 5 Jun 2014 03:46:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267092 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 03:46:47 -0000 Author: davide Date: Thu Jun 5 03:46:46 2014 New Revision: 267092 URL: http://svnweb.freebsd.org/changeset/base/267092 Log: Convert functions to the new-style format. Submitted by: Vijay Singh via -hackers Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Thu Jun 5 03:16:23 2014 (r267091) +++ head/sys/kern/kern_timeout.c Thu Jun 5 03:46:46 2014 (r267092) @@ -873,10 +873,7 @@ softclock(void *arg) * identify entries for untimeout. */ struct callout_handle -timeout(ftn, arg, to_ticks) - timeout_t *ftn; - void *arg; - int to_ticks; +timeout(timeout_t *ftn, void *arg, int to_ticks) { struct callout_cpu *cc; struct callout *new; @@ -898,10 +895,7 @@ timeout(ftn, arg, to_ticks) } void -untimeout(ftn, arg, handle) - timeout_t *ftn; - void *arg; - struct callout_handle handle; +untimeout(timeout_t *ftn, void *arg, struct callout_handle handle) { struct callout_cpu *cc; @@ -1084,9 +1078,7 @@ callout_schedule(struct callout *c, int } int -_callout_stop_safe(c, safe) - struct callout *c; - int safe; +_callout_stop_safe(struct callout *c, int safe) { struct callout_cpu *cc, *old_cc; struct lock_class *class; @@ -1258,9 +1250,7 @@ again: } void -callout_init(c, mpsafe) - struct callout *c; - int mpsafe; +callout_init(struct callout *c, int mpsafe) { bzero(c, sizeof *c); if (mpsafe) { @@ -1274,10 +1264,7 @@ callout_init(c, mpsafe) } void -_callout_init_lock(c, lock, flags) - struct callout *c; - struct lock_object *lock; - int flags; +_callout_init_lock(struct callout *c, struct lock_object *lock, int flags) { bzero(c, sizeof *c); c->c_lock = lock; @@ -1309,8 +1296,7 @@ _callout_init_lock(c, lock, flags) * 2 days. Your milage may vary. - Ken Key */ void -adjust_timeout_calltodo(time_change) - struct timeval *time_change; +adjust_timeout_calltodo(struct timeval *time_change) { register struct callout *p; unsigned long delta_ticks; From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 07:28:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2FFEC3B; Thu, 5 Jun 2014 07:28:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C725B2870; Thu, 5 Jun 2014 07:28:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s557SRRA099122; Thu, 5 Jun 2014 07:28:27 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s557SRD8099121; Thu, 5 Jun 2014 07:28:27 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201406050728.s557SRD8099121@svn.freebsd.org> From: Maxim Konovalov Date: Thu, 5 Jun 2014 07:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267097 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 07:28:28 -0000 Author: maxim Date: Thu Jun 5 07:28:27 2014 New Revision: 267097 URL: http://svnweb.freebsd.org/changeset/base/267097 Log: OpenBSD 5.5, Mac OS X 10.10, Dragonfly BSD 3.8.0 added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Thu Jun 5 06:29:18 2014 (r267096) +++ head/share/misc/bsd-family-tree Thu Jun 5 07:28:27 2014 (r267097) @@ -296,14 +296,15 @@ FreeBSD 5.2 | | | | | | | | *--FreeBSD | | NetBSD 6.1.3 | | | 10.0 | | | | | - | | | NetBSD 6.1.4 | DragonFly 3.6.1 - | | | | | - | | | | | - | | | | DragonFly 3.6.2 - | | | | | - | | | | | - | | | | | + | | | | | DragonFly 3.6.1 + | | | | | | + | | | | | | + | | | | | DragonFly 3.6.2 + | | | NetBSD 6.1.4 | | | | | | | + | | | OpenBSD 5.5 | + | Mac OS X | | | + | 10.10 | | DragonFly 3.8.0 | | | | | | | | | | | | | | | @@ -638,6 +639,9 @@ DragonFly 3.6.1 2014-02-22 [DFB] DragonFly 3.6.2 2014-04-10 [DFB] NetBSD 6.0.5 2014-04-19 [NDB] NetBSD 6.1.4 2014-04-19 [NDB] +OpenBSD 5.5 2014-05-01 [OBD] +Mac OS X 10.10 2014-06-02 [APL] +DragonFly 3.8.0 2014-06-04 [DFB] Bibliography ------------------------ From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 08:20:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7E6ADF0; Thu, 5 Jun 2014 08:20:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C2872D3F; Thu, 5 Jun 2014 08:20:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s558KFR5024436; Thu, 5 Jun 2014 08:20:15 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s558KFx8024435; Thu, 5 Jun 2014 08:20:15 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201406050820.s558KFx8024435@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 5 Jun 2014 08:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267098 - head/usr.bin/yes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 08:20:15 -0000 Author: pluknet Date: Thu Jun 5 08:20:14 2014 New Revision: 267098 URL: http://svnweb.freebsd.org/changeset/base/267098 Log: mdoc: drop the trailing dot from the xref list. Modified: head/usr.bin/yes/yes.1 Modified: head/usr.bin/yes/yes.1 ============================================================================== --- head/usr.bin/yes/yes.1 Thu Jun 5 07:28:27 2014 (r267097) +++ head/usr.bin/yes/yes.1 Thu Jun 5 08:20:14 2014 (r267098) @@ -47,7 +47,7 @@ or, by default, forever. .Sh SEE ALSO .Xr jot 1 , -.Xr seq 1 . +.Xr seq 1 .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 09:27:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F2198D6; Thu, 5 Jun 2014 09:27:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D26B236F; Thu, 5 Jun 2014 09:27:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s559Rgsp054666; Thu, 5 Jun 2014 09:27:42 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s559RgSe054665; Thu, 5 Jun 2014 09:27:42 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201406050927.s559RgSe054665@svn.freebsd.org> From: Maxim Konovalov Date: Thu, 5 Jun 2014 09:27:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267099 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 09:27:42 -0000 Author: maxim Date: Thu Jun 5 09:27:42 2014 New Revision: 267099 URL: http://svnweb.freebsd.org/changeset/base/267099 Log: Mac OS X 10.10 is not released yet, removed. Pointed out by: pluknet Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Thu Jun 5 08:20:14 2014 (r267098) +++ head/share/misc/bsd-family-tree Thu Jun 5 09:27:42 2014 (r267099) @@ -303,8 +303,7 @@ FreeBSD 5.2 | | | | | NetBSD 6.1.4 | | | | | | | | | | OpenBSD 5.5 | - | Mac OS X | | | - | 10.10 | | DragonFly 3.8.0 + | | | | DragonFly 3.8.0 | | | | | | | | | | | | | | | @@ -640,7 +639,6 @@ DragonFly 3.6.2 2014-04-10 [DFB] NetBSD 6.0.5 2014-04-19 [NDB] NetBSD 6.1.4 2014-04-19 [NDB] OpenBSD 5.5 2014-05-01 [OBD] -Mac OS X 10.10 2014-06-02 [APL] DragonFly 3.8.0 2014-06-04 [DFB] Bibliography From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 10:11:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from ptrcrt.ch (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90C6923E; Thu, 5 Jun 2014 10:11:52 +0000 (UTC) Date: Thu, 5 Jun 2014 12:11:48 +0200 From: Pietro Cerutti To: Bruce Evans Subject: Re: svn commit: r267027 - head/usr.bin/users Message-ID: <20140605101148.GJ37870@ptrcrt.ch> Reply-To: gahr@FreeBSD.org References: <201406032059.s53KxQAp081243@svn.freebsd.org> <20140605013835.M1934@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zOcTNEe3AzgCmdo9" Content-Disposition: inline In-Reply-To: <20140605013835.M1934@besplex.bde.org> X-PGP-Key: fp="DA6D E106 A5B8 54B8 5DD8 6D49 ADD0 D38E A192 089E"; id="0xA192089E"; get=; get=; User-Agent: Mutt/1.5.23 (2014-03-12) Cc: bapt@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Julian Elischer , cognet@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 10:11:54 -0000 --zOcTNEe3AzgCmdo9 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Bruce, your comments do make sense. I semi-seriously suggest that we get rid of the current implementation and replace it with this. Comments? /* * Copyright (c) 2014 Pietro Cerutti * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPO= SE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTI= AL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI= CT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD: head/usr.bin/users/users.c 267027 2014-06-03 20:59:26Z = gahr $"); #include #include #include #include #include #include #include using namespace std; int main(int argc, char **) { struct utmpx *ut; vector names; if (argc > 1) { cerr << "usage: users" << endl; return (1); } setutxent(); while ((ut =3D getutxent()) !=3D NULL) { if (ut->ut_type !=3D USER_PROCESS) continue; names.push_back(ut->ut_user); } endutxent(); if (names.size() =3D=3D 0) { return (0); } sort(begin(names), end(names)); vector::iterator last(unique(begin(names), end(names))); copy(begin(names), last-1, ostream_iterator(cout, " ")); cout << *(last-1) << endl; } On 2014-Jun-05, 02:20, Bruce Evans wrote: > On Tue, 3 Jun 2014, Pietro Cerutti wrote: >=20 > > Log: > > - Avoid calling a wrapper function around strcmp >=20 > This changes correct code to give undefined behaviour. >=20 > > - Use sizeof(*array) instead of sizeof(element) everywhere >=20 > This also allows removal of a typedef obfuscation. >=20 > > Modified: head/usr.bin/users/users.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/usr.bin/users/users.c Tue Jun 3 20:58:11 2014 (r267026) > > +++ head/usr.bin/users/users.c Tue Jun 3 20:59:26 2014 (r267027) > > @@ -50,9 +50,9 @@ static const char rcsid[] =3D > > #include > > #include > > > > -typedef char namebuf[sizeof(((struct utmpx *)0)->ut_user) + 1]; > > +typedef char namebuf[sizeof(((struct utmpx *)0)->ut_user) + 1]; > > +typedef int (*scmp)(const void *, const void *); >=20 > Most typedefs shouldn't exist, and these 2 are no exceptions. >=20 > 'namebuf' only existed to reduce 2 copies of a type declaration to 1. > It obfuscated both. Now it is only used once. >=20 > 'scmp' only exists to help implement undefined behaviour. >=20 > The change also de-KNFizes the formatting (from tab to space after the > first part of the type). >=20 > > @@ -91,7 +91,7 @@ main(int argc, char **argv) > > } > > endutxent(); > > if (ncnt > 0) { > > - qsort(names, ncnt, sizeof(namebuf), scmp); > > + qsort(names, ncnt, sizeof(*names), (scmp)strcmp); >=20 > qsort()'s function pointer must point to a function like scmp, not > a different type of function with the type mismatch hidden by a bogus > cast. >=20 > The type puns fail as follow: > - strcmp is initially a function > - dereferencing it gives a pointer to a function of the type of strcmp > - casting this pointer to (scmp) gives a pointer to a different type > of function. The behaviour is defined. The representation may > change. > - use of such a cast function pointer to call the function is undefined > unless the pointer is converted back to the original (pointer) type > before making the call. Since qsort() cannot possibly know the origin= al > type, it cannot convert back. >=20 > It is a feature that qsort()'s API doesn't have a function pointer typede= f. > There are a few legitimate uses for function pointer typedefs, but in > practices most uses are for bogus casts to hide undefined behaviour, as > above. >=20 > The qsort() call also uses the other type obfuscation. 'namebuf' is > the typedef-name. This typedef name was only used twice, first to > declare 'names' and also here. Now with the better spelling of the > sizeof(), the typedef name is only used once. It just obfuscates > the declaration of 'names'. >=20 > > ... > > @@ -107,10 +107,3 @@ usage(void) > > fprintf(stderr, "usage: users\n"); > > exit(1); > > } > > - > > -int > > -scmp(const void *p, const void *q) > > -{ > > - > > - return (strcmp(p, q)); > > -} >=20 > Most qsort() functions have to look like this, or a bit more complicated, > to avoid the undefined behaviour. This one looks simpler than it is. > It has to convert the arg types to those of strcmp(), but this happens > automatically due to strcmp()s prototype. The arg types started as > strings, but had to be converted to const void *'s to match qsort()'s > API, then have to be converted back to strings here. >=20 > The undefined behaviour is usually to work in practice because only > Vax hardware is supported. strings are so similar to void * that it > is hard to tell if the behaviour can ever be undefined in practice > for type puns between them. But the behaviour is more clearly undefined > for function pointers because compatibility of void * and char * as > args doesn't extend to the function pointers. The implementation could > reasonably check all types at runtime and is only constrained from > generating a fatal error for type mismatches for certain mismatches > that are specified to work for compatibility reasons. I think that > if the bogus conversions get as far as calling the function, then > the behaviour is defined by the compatibility kludges: > - string args became const void * in qsort()'s internals > - they are not converted back when they are passed to strcmp() > - however, the compatibility kludges now apply. const void * looks > enough like const char * to work. (I think it may have a different > representation, but only with bits that aren't really used, for > example extra type bits that might be used for error checking > but must not be used here due to the compatibility kludges.) >=20 > Bruce --=20 Pietro Cerutti The FreeBSD Project gahr@FreeBSD.org PGP Public Key: http://gahr.ch/pgp --zOcTNEe3AzgCmdo9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJTkEJkXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQTZERTEwNkE1Qjg1NEI4NUREODZENDlB REQwRDM4RUExOTIwODlFAAoJEK3Q046hkgieQF4P/AmNjl1Bp7L1dex3jcmhntm6 VefBMgUNyhIvmXs/yu5BqYeshlHrHNpcQtwqQ8oLWVlmRn6DQpiOLvvdpvgvOe8A 8cGkTH9l9tPqwghV9fn/tN0p04w8lbvhNZCshaSZ0oE8X+jECwc94ilfxkfQDv9Q 8J7sRiyfp2D8kAM8/zsKHM//QoD5bbvi1eHiAPnKt3SSAwCQ6EGA8qU3Ou42WAFQ QjRyOZ9CBkRRwik/f60rvBDqRq5Gpxokzd9m4Hsl25CjH/RdlzQiaON+out7KWEK zuHvFrWUr5tFs566cQV/ETCyHucHBq6APDS+BOd3VChka9uUQUk+PuXzqrYQHWP/ i1dgthO8b8P0eX+XnCgFog3t9BPD25khM5Nfd7YYKwM/dcbg+cN09JPU/Onmi2FP H0mEvHWdshUTPl4y9QL5XbsecIIjLZhdEM4zW1Ij3+bb3NecTKGNtIJY1Q5Hk6tK 1ewgi1jRybq+oX67eGGpQdfy+LJKHYmoF8+XLJ39Ltn977NPIcJzFyvy0jV7arlZ DxUuRagUCl72G0iXpSuaTU3iddjCBRn0ZgA7n0Q3GJjbBRj0Jm78uV9JeljJ7/Vd ukDREHXung18HxmHJTMXBZEDriX20BDVs5pBCzon3YhvAFa+FFBbMZ13nTPBwgEH hFQeUVeRiJMYvy90Wc2y =LX0s -----END PGP SIGNATURE----- --zOcTNEe3AzgCmdo9-- From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 12:32:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37A9B5E2; Thu, 5 Jun 2014 12:32:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18A902582; Thu, 5 Jun 2014 12:32:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55CWHhx038365; Thu, 5 Jun 2014 12:32:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55CWHg2038359; Thu, 5 Jun 2014 12:32:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201406051232.s55CWHg2038359@svn.freebsd.org> From: Xin LI Date: Thu, 5 Jun 2014 12:32:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267102 - head/crypto/openssl/ssl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 12:32:18 -0000 Author: delphij Date: Thu Jun 5 12:32:16 2014 New Revision: 267102 URL: http://svnweb.freebsd.org/changeset/base/267102 Log: Fix OpenSSL multiple vulnerabilities. Security: CVE-2014-0195, CVE-2014-0221, CVE-2014-0224, CVE-2014-3470 Security: SA-14:14.openssl Approved by: so Modified: head/crypto/openssl/ssl/d1_both.c head/crypto/openssl/ssl/s3_clnt.c head/crypto/openssl/ssl/s3_pkt.c head/crypto/openssl/ssl/s3_srvr.c head/crypto/openssl/ssl/ssl3.h Modified: head/crypto/openssl/ssl/d1_both.c ============================================================================== --- head/crypto/openssl/ssl/d1_both.c Thu Jun 5 12:27:14 2014 (r267101) +++ head/crypto/openssl/ssl/d1_both.c Thu Jun 5 12:32:16 2014 (r267102) @@ -627,7 +627,16 @@ dtls1_reassemble_fragment(SSL *s, struct frag->msg_header.frag_off = 0; } else + { frag = (hm_fragment*) item->data; + if (frag->msg_header.msg_len != msg_hdr->msg_len) + { + item = NULL; + frag = NULL; + goto err; + } + } + /* If message is already reassembled, this must be a * retransmit and can be dropped. @@ -784,6 +793,7 @@ dtls1_get_message_fragment(SSL *s, int s int i,al; struct hm_header_st msg_hdr; + redo: /* see if we have the required fragment already */ if ((frag_len = dtls1_retrieve_buffered_fragment(s,max,ok)) || *ok) { @@ -842,8 +852,7 @@ dtls1_get_message_fragment(SSL *s, int s s->msg_callback_arg); s->init_num = 0; - return dtls1_get_message_fragment(s, st1, stn, - max, ok); + goto redo; } else /* Incorrectly formated Hello request */ { Modified: head/crypto/openssl/ssl/s3_clnt.c ============================================================================== --- head/crypto/openssl/ssl/s3_clnt.c Thu Jun 5 12:27:14 2014 (r267101) +++ head/crypto/openssl/ssl/s3_clnt.c Thu Jun 5 12:32:16 2014 (r267102) @@ -559,6 +559,7 @@ int ssl3_connect(SSL *s) case SSL3_ST_CR_FINISHED_A: case SSL3_ST_CR_FINISHED_B: + s->s3->flags |= SSL3_FLAGS_CCS_OK; ret=ssl3_get_finished(s,SSL3_ST_CR_FINISHED_A, SSL3_ST_CR_FINISHED_B); if (ret <= 0) goto end; @@ -915,6 +916,7 @@ int ssl3_get_server_hello(SSL *s) SSLerr(SSL_F_SSL3_GET_SERVER_HELLO,SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT); goto f_err; } + s->s3->flags |= SSL3_FLAGS_CCS_OK; s->hit=1; } else /* a miss or crap from the other end */ @@ -2510,6 +2512,13 @@ int ssl3_send_client_key_exchange(SSL *s int ecdh_clnt_cert = 0; int field_size = 0; + if (s->session->sess_cert == NULL) + { + ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_UNEXPECTED_MESSAGE); + SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,SSL_R_UNEXPECTED_MESSAGE); + goto err; + } + /* Did we send out the client's * ECDH share for use in premaster * computation as part of client certificate? Modified: head/crypto/openssl/ssl/s3_pkt.c ============================================================================== --- head/crypto/openssl/ssl/s3_pkt.c Thu Jun 5 12:27:14 2014 (r267101) +++ head/crypto/openssl/ssl/s3_pkt.c Thu Jun 5 12:32:16 2014 (r267102) @@ -1301,6 +1301,15 @@ start: goto f_err; } + if (!(s->s3->flags & SSL3_FLAGS_CCS_OK)) + { + al=SSL_AD_UNEXPECTED_MESSAGE; + SSLerr(SSL_F_SSL3_READ_BYTES,SSL_R_CCS_RECEIVED_EARLY); + goto f_err; + } + + s->s3->flags &= ~SSL3_FLAGS_CCS_OK; + rr->length=0; if (s->msg_callback) @@ -1435,7 +1444,7 @@ int ssl3_do_change_cipher_spec(SSL *s) if (s->s3->tmp.key_block == NULL) { - if (s->session == NULL) + if (s->session == NULL || s->session->master_key_length == 0) { /* might happen if dtls1_read_bytes() calls this */ SSLerr(SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC,SSL_R_CCS_RECEIVED_EARLY); Modified: head/crypto/openssl/ssl/s3_srvr.c ============================================================================== --- head/crypto/openssl/ssl/s3_srvr.c Thu Jun 5 12:27:14 2014 (r267101) +++ head/crypto/openssl/ssl/s3_srvr.c Thu Jun 5 12:32:16 2014 (r267102) @@ -673,6 +673,7 @@ int ssl3_accept(SSL *s) case SSL3_ST_SR_CERT_VRFY_A: case SSL3_ST_SR_CERT_VRFY_B: + s->s3->flags |= SSL3_FLAGS_CCS_OK; /* we should decide if we expected this one */ ret=ssl3_get_cert_verify(s); if (ret <= 0) goto end; @@ -700,6 +701,7 @@ int ssl3_accept(SSL *s) case SSL3_ST_SR_FINISHED_A: case SSL3_ST_SR_FINISHED_B: + s->s3->flags |= SSL3_FLAGS_CCS_OK; ret=ssl3_get_finished(s,SSL3_ST_SR_FINISHED_A, SSL3_ST_SR_FINISHED_B); if (ret <= 0) goto end; @@ -770,7 +772,10 @@ int ssl3_accept(SSL *s) s->s3->tmp.next_state=SSL3_ST_SR_FINISHED_A; #else if (s->s3->next_proto_neg_seen) + { + s->s3->flags |= SSL3_FLAGS_CCS_OK; s->s3->tmp.next_state=SSL3_ST_SR_NEXT_PROTO_A; + } else s->s3->tmp.next_state=SSL3_ST_SR_FINISHED_A; #endif Modified: head/crypto/openssl/ssl/ssl3.h ============================================================================== --- head/crypto/openssl/ssl/ssl3.h Thu Jun 5 12:27:14 2014 (r267101) +++ head/crypto/openssl/ssl/ssl3.h Thu Jun 5 12:32:16 2014 (r267102) @@ -399,6 +399,7 @@ typedef struct ssl3_buffer_st * effected, but we can't prevent that. */ #define SSL3_FLAGS_SGC_RESTART_DONE 0x0040 +#define SSL3_FLAGS_CCS_OK 0x0080 #ifndef OPENSSL_NO_SSL_INTERN From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 12:51:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DBAC131; Thu, 5 Jun 2014 12:51:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B1BC28BC; Thu, 5 Jun 2014 12:51:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55CpDQZ044544; Thu, 5 Jun 2014 12:51:13 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55CpD0a044543; Thu, 5 Jun 2014 12:51:13 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406051251.s55CpD0a044543@svn.freebsd.org> From: Michael Tuexen Date: Thu, 5 Jun 2014 12:51:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267105 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 12:51:13 -0000 Author: tuexen Date: Thu Jun 5 12:51:12 2014 New Revision: 267105 URL: http://svnweb.freebsd.org/changeset/base/267105 Log: Use ENOBUFS instead of ENOMEM in error situations related to m_uiotombuf(). This was suggested by kevlo@. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Thu Jun 5 12:33:23 2014 (r267104) +++ head/sys/netinet/sctp_output.c Thu Jun 5 12:51:12 2014 (r267105) @@ -11911,8 +11911,8 @@ sctp_copy_resume(struct uio *uio, m = m_uiotombuf(uio, M_WAITOK, max_send_len, 0, (M_PKTHDR | (user_marks_eor ? M_EOR : 0))); if (m == NULL) { - SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); - *error = ENOMEM; + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, ENOBUFS); + *error = ENOBUFS; } else { *sndout = m_length(m, NULL); *new_tail = m_last(m); @@ -11931,8 +11931,8 @@ sctp_copy_one(struct sctp_stream_queue_p sp->data = m_uiotombuf(uio, M_WAITOK, sp->length, resv_upfront, 0); if (sp->data == NULL) { - SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); - return (ENOMEM); + SCTP_LTRACE_ERR_RET(NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, ENOBUFS); + return (ENOBUFS); } sp->tail_mbuf = m_last(sp->data); return (0); From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 13:11:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D219EA5; Thu, 5 Jun 2014 13:11:50 +0000 (UTC) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 200992AF8; Thu, 5 Jun 2014 13:11:49 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.8/8.14.8/ALCHEMY.FRANKEN.DE) with ESMTP id s55DBdXA053296 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 5 Jun 2014 15:11:39 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.8/8.14.8/Submit) id s55DBdav053295; Thu, 5 Jun 2014 15:11:39 +0200 (CEST) (envelope-from marius) Date: Thu, 5 Jun 2014 15:11:38 +0200 From: Marius Strobl To: Warner Losh Subject: Re: svn commit: r263749 - in head: . sys/amd64/conf sys/conf sys/i386/conf sys/sparc64/conf Message-ID: <20140605131138.GG679@alchemy.franken.de> References: <201403252208.s2PM8VXj019660@svn.freebsd.org> <201404071505.09468.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (alchemy.franken.de [0.0.0.0]); Thu, 05 Jun 2014 15:11:39 +0200 (CEST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 13:11:50 -0000 On Mon, Apr 07, 2014 at 03:12:34PM -0600, Warner Losh wrote: > > On Apr 7, 2014, at 1:05 PM, John Baldwin wrote: > > > On Tuesday, March 25, 2014 6:08:31 pm Warner Losh wrote: > >> Author: imp > >> Date: Tue Mar 25 22:08:31 2014 > >> New Revision: 263749 > >> URL: http://svnweb.freebsd.org/changeset/base/263749 > >> > >> Log: > >> Rather than require a makeoptions DEBUG to get debug correct, > >> add it in kern.mk, but only if we're using clang. While this > >> ... > >> Modified: head/sys/amd64/conf/GENERIC > >> ============================================================================== > >> --- head/sys/amd64/conf/GENERIC Tue Mar 25 21:57:50 2014 (r263748) > >> +++ head/sys/amd64/conf/GENERIC Tue Mar 25 22:08:31 2014 (r263749) > >> @@ -21,7 +21,7 @@ > >> cpu HAMMER > >> ident GENERIC > >> > >> -makeoptions DEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols > >> +makeoptions DEBUG=-g > >> makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support > > > > Did you mean to lose this comment in all these files? > > No. I didn?t mean to loose it. Damn. Thanks! FYI, restoring these comments and then MFCing the whole thing - which would be great to have in 9.3-RELEASE - is still missing. Marius From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 13:49:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4CD7BD2C; Thu, 5 Jun 2014 13:49:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3848A2F84; Thu, 5 Jun 2014 13:49:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55DncXv071638; Thu, 5 Jun 2014 13:49:38 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55DncxC071637; Thu, 5 Jun 2014 13:49:38 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406051349.s55DncxC071637@svn.freebsd.org> From: Ed Maste Date: Thu, 5 Jun 2014 13:49:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267109 - head/sys/dev/vt/font X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 13:49:38 -0000 Author: emaste Date: Thu Jun 5 13:49:37 2014 New Revision: 267109 URL: http://svnweb.freebsd.org/changeset/base/267109 Log: Update vt(4) "Terminus BSD Console" font "Terminus BSD Console" is a derivative of Terminus that is provided by Mr. Dimitar Zhekov under the 2-clause BSD license for use by the FreeBSD vt(4) console. Reviewed by: jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/font/vt_font_default.c Modified: head/sys/dev/vt/font/vt_font_default.c ============================================================================== --- head/sys/dev/vt/font/vt_font_default.c Thu Jun 5 13:24:12 2014 (r267108) +++ head/sys/dev/vt/font/vt_font_default.c Thu Jun 5 13:49:37 2014 (r267109) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 Dimitar Toshkov Zhekov. All rights reserved. + * Copyright (C) 2014 Dimitar Toshkov Zhekov. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -21,8 +21,13 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * Please contribute any changes back to . + */ + +/* + * This is the "Terminus BSD Console" font, a derivative of Terminus that is + * provided under the 2-clause BSD license for use by the FreeBSD vt(4) + * console. Please contribute any changes back to Mr. Zhekov at + * . */ #include @@ -30,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include -static uint8_t font_bytes[1422 * 16] = { +static uint8_t font_bytes[1477 * 16] = { 0x00, 0x00, 0x7e, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, @@ -784,8 +789,8 @@ static uint8_t font_bytes[1422 * 16] = { 0x40, 0x20, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x04, 0x04, 0x04, 0x04, 0x44, 0x44, 0x44, 0x24, 0x14, 0x0c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x92, 0x92, - 0x92, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x92, 0x92, + 0x92, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x28, 0x28, 0x44, 0x44, 0x82, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x82, 0x44, 0x44, @@ -952,68 +957,112 @@ static uint8_t font_bytes[1422 * 16] = { 0xff, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0xff, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0xef, 0x00, 0xef, 0x28, 0x28, 0x28, - 0x28, 0x28, 0x28, 0x28, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x28, 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xc0, 0x20, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x20, 0xc0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, + 0xfc, 0xfc, 0xfc, 0xfc, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, + 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf0, 0xf0, 0xf0, 0xf0, + 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, + 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, + 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, + 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, - 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, - 0x88, 0x22, 0x88, 0x22, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, - 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xee, 0xbb, 0xee, 0xbb, + 0x0f, 0x0f, 0x0f, 0x0f, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, + 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0xaa, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xee, 0xbb, 0xee, 0xbb, 0xee, 0xbb, 0xee, 0xbb, 0xee, 0xbb, 0xee, 0xbb, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, - 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, - 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, + 0xee, 0xbb, 0xee, 0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, + 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, + 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, + 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, - 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x3c, 0x3c, - 0x3c, 0x3c, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x7e, 0x7e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x38, 0x38, - 0x7c, 0x7c, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc0, 0xf0, 0xfc, 0xff, 0xfc, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c, 0x38, 0x38, 0x10, 0x10, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0f, 0x3f, 0xff, - 0x3f, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x28, 0x44, 0x82, 0x44, 0x28, 0x10, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x24, - 0x24, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xdb, 0xdb, 0xe7, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x7c, 0x82, 0xaa, 0x82, 0x82, 0xba, - 0x92, 0x82, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xfe, - 0xd6, 0xfe, 0xfe, 0xc6, 0xee, 0xfe, 0xfe, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x10, 0x92, 0x54, 0x38, 0xee, 0x38, 0x54, 0x92, 0x10, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x44, 0x38, - 0x10, 0x7c, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x06, - 0x0a, 0x12, 0x38, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x10, 0x38, 0x7c, 0xfe, 0xfe, 0x7c, 0x10, 0x10, 0x38, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x10, 0x54, 0xfe, - 0xfe, 0x54, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3e, 0x22, 0x3e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0xc0, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x42, 0x7e, 0x42, 0x42, 0x42, - 0x42, 0x42, 0x42, 0x44, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, + 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, + 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x7e, 0x7e, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, + 0x7e, 0x7e, 0x7e, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0xfc, 0xff, 0xfc, 0xf0, 0xc0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c, + 0x38, 0x38, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x0f, 0x3f, 0xff, 0x3f, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x28, 0x44, 0x82, + 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x24, 0x24, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xdb, + 0xdb, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x7c, 0x82, + 0xaa, 0x82, 0x82, 0xba, 0x92, 0x82, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7c, 0xfe, 0xd6, 0xfe, 0xfe, 0xc6, 0xee, 0xfe, 0xfe, 0x7c, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x92, 0x54, 0x38, 0xee, + 0x38, 0x54, 0x92, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, + 0x44, 0x44, 0x44, 0x38, 0x10, 0x7c, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1e, 0x06, 0x0a, 0x12, 0x38, 0x44, 0x44, 0x44, 0x44, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x38, 0x7c, 0xfe, 0xfe, + 0x7c, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, + 0x38, 0x10, 0x54, 0xfe, 0xfe, 0x54, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x22, 0x3e, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x42, + 0x7e, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x44, 0x80, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x04, 0x04, 0x88, 0x88, 0x50, 0x50, 0x20, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x06, 0x06, 0xcc, 0xcc, + 0x78, 0x78, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x44, + 0x28, 0x18, 0x18, 0x14, 0x22, 0x20, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0c, 0xcc, 0x78, 0x38, 0x38, 0x3c, 0x66, 0x60, 0xc0, 0xc0, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x88, 0x9c, 0xaa, 0x88, 0x88, 0x88, + 0x10, 0x20, 0x40, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, + 0x80, 0x80, 0xf8, 0x00, 0x11, 0x19, 0x15, 0x13, 0x11, 0x11, 0x00, 0x00, + 0x00, 0x38, 0x44, 0x44, 0x44, 0x44, 0xfe, 0xfe, 0xee, 0xc6, 0xee, 0xfe, + 0xfe, 0xfe, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff, + 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x80, 0x40, 0x20, 0x10, + 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, + 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff, 0xff, 0x7f, 0x3f, 0x1f, + 0x0f, 0x07, 0x03, 0x01, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, + 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, @@ -1903,19 +1952,39 @@ static uint8_t font_bytes[1422 * 16] = { 0x18, 0x18, 0x18, 0x18, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0xff, 0xff, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0xef, 0xef, 0x00, 0xef, 0xef, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, - 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x3c, 0x3c, 0x7e, 0x7e, 0xff, 0xff, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0xfc, 0xff, - 0xff, 0xfc, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x7e, 0x7e, 0x3c, 0x3c, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x0f, 0x3f, 0xff, 0xff, 0x3f, 0x0f, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, - 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x3c, 0x66, 0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0f, 0x1c, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, + 0xf0, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x38, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1c, 0x0f, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf8, 0xf8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, + 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1f, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x38, 0x38, + 0x38, 0x38, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, + 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0xfe, 0xfe, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, + 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x3c, 0x3c, 0x7e, 0x7e, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0xfc, 0xff, 0xff, 0xfc, 0xf0, 0xc0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x7e, + 0x3c, 0x3c, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x0f, 0x3f, 0xff, 0xff, 0x3f, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0x7e, 0x3c, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x66, 0xc3, + 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x7e, 0x7e, 0x7e, 0x7e, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x18, 0xdb, 0x7e, 0x3c, 0xe7, 0x3c, 0x7e, 0xdb, 0x18, 0x00, 0x00, 0x00, 0x00, @@ -1927,9 +1996,19 @@ static uint8_t font_bytes[1422 * 16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x66, 0x7e, 0x60, 0x60, 0x60, 0x60, 0x60, 0xe0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x66, 0x7e, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6e, 0xec, 0xc0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x07, 0x0e, 0x0e, 0xdc, 0xfc, 0x78, 0x78, 0x30, 0x30, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xee, 0x7c, 0x3c, 0x3c, 0x3e, + 0x77, 0x73, 0xe0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xcc, 0xde, + 0xff, 0xcc, 0xcc, 0xcc, 0x98, 0x30, 0x60, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, + 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0x00, 0x33, 0x3b, 0x3f, 0x37, + 0x33, 0x33, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0xff, 0xff, + 0xe7, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0x00, 0x00, 0x80, 0xc0, 0x60, 0x30, + 0x18, 0x0c, 0x06, 0x03, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, + 0x01, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0xc0, 0x60, 0x30, 0x18, + 0x0c, 0x06, 0x03, 0x01, }; -static struct vt_font_map font_mapping_normal[248] = { +static struct vt_font_map font_mapping_normal[252] = { { 0x0020, 0x0001, 0x5e }, { 0x00a0, 0x0001, 0x00 }, { 0x00a1, 0x0060, 0x6e }, { 0x0110, 0x008f, 0x00 }, { 0x0111, 0x00cf, 0x08 }, { 0x011a, 0x00d2, 0x01 }, @@ -2038,155 +2117,163 @@ static struct vt_font_map font_mapping_n { 0x2212, 0x000e, 0x00 }, { 0x2219, 0x0233, 0x01 }, { 0x221e, 0x0235, 0x01 }, { 0x2227, 0x0237, 0x03 }, { 0x2248, 0x023b, 0x00 }, { 0x2260, 0x023c, 0x01 }, - { 0x2264, 0x023e, 0x01 }, { 0x2302, 0x0240, 0x00 }, - { 0x2310, 0x0241, 0x00 }, { 0x2320, 0x0242, 0x01 }, - { 0x23ba, 0x0244, 0x03 }, { 0x2409, 0x0248, 0x04 }, - { 0x2424, 0x024d, 0x00 }, { 0x2500, 0x024e, 0x03 }, - { 0x2508, 0x0252, 0x43 }, { 0x2550, 0x0296, 0x1c }, - { 0x2580, 0x02b3, 0x08 }, { 0x258c, 0x02bc, 0x00 }, - { 0x2590, 0x02bd, 0x03 }, { 0x2596, 0x02c1, 0x0a }, - { 0x25ac, 0x02cc, 0x00 }, { 0x25ae, 0x02cd, 0x00 }, - { 0x25b2, 0x02ce, 0x00 }, { 0x25b6, 0x02cf, 0x00 }, - { 0x25bc, 0x02d0, 0x00 }, { 0x25c0, 0x02d1, 0x00 }, - { 0x25c6, 0x02d2, 0x00 }, { 0x25ca, 0x02d3, 0x01 }, - { 0x25d8, 0x02d5, 0x01 }, { 0x263a, 0x02d7, 0x02 }, - { 0x2640, 0x02da, 0x00 }, { 0x2642, 0x02db, 0x00 }, - { 0x2660, 0x02dc, 0x00 }, { 0x2663, 0x02dd, 0x00 }, - { 0x2665, 0x02de, 0x00 }, { 0x2666, 0x02d2, 0x00 }, - { 0x266a, 0x02df, 0x01 }, { 0xf6be, 0x0148, 0x00 }, + { 0x2264, 0x023e, 0x01 }, { 0x2300, 0x0230, 0x00 }, + { 0x2302, 0x0240, 0x00 }, { 0x2310, 0x0241, 0x00 }, + { 0x2320, 0x0242, 0x01 }, { 0x23ba, 0x0244, 0x03 }, + { 0x2409, 0x0248, 0x04 }, { 0x2424, 0x024d, 0x00 }, + { 0x2500, 0x024e, 0x03 }, { 0x2508, 0x0252, 0x43 }, + { 0x2550, 0x0296, 0x20 }, { 0x2574, 0x02b7, 0x1f }, + { 0x2596, 0x02d7, 0x0a }, { 0x25ac, 0x02e2, 0x00 }, + { 0x25ae, 0x02e3, 0x00 }, { 0x25b2, 0x02e4, 0x00 }, + { 0x25b6, 0x02e5, 0x00 }, { 0x25bc, 0x02e6, 0x00 }, + { 0x25c0, 0x02e7, 0x00 }, { 0x25c6, 0x02e8, 0x00 }, + { 0x25ca, 0x02e9, 0x01 }, { 0x25cf, 0x0212, 0x00 }, + { 0x25d8, 0x02eb, 0x01 }, { 0x263a, 0x02ed, 0x02 }, + { 0x2640, 0x02f0, 0x00 }, { 0x2642, 0x02f1, 0x00 }, + { 0x2660, 0x02f2, 0x00 }, { 0x2663, 0x02f3, 0x00 }, + { 0x2665, 0x02f4, 0x00 }, { 0x2666, 0x02e8, 0x00 }, + { 0x266a, 0x02f5, 0x01 }, { 0x2713, 0x02f7, 0x01 }, + { 0x2717, 0x02f9, 0x01 }, { 0xe0a0, 0x02fb, 0x02 }, + { 0xe0b0, 0x02fe, 0x03 }, { 0xf6be, 0x0148, 0x00 }, }; -static struct vt_font_map font_mapping_bold[260] = { - { 0x0021, 0x02e1, 0x0b }, { 0x002d, 0x0205, 0x00 }, - { 0x002e, 0x02ed, 0x50 }, { 0x00a1, 0x033e, 0x07 }, - { 0x00aa, 0x0346, 0x03 }, { 0x00af, 0x034a, 0x07 }, - { 0x00b7, 0x0233, 0x00 }, { 0x00b8, 0x0352, 0x57 }, - { 0x0110, 0x036a, 0x00 }, { 0x0111, 0x03aa, 0x08 }, - { 0x011a, 0x03ad, 0x01 }, { 0x011c, 0x03b3, 0x59 }, - { 0x0178, 0x040d, 0x07 }, { 0x0186, 0x0415, 0x00 }, - { 0x018e, 0x0416, 0x02 }, { 0x0192, 0x0419, 0x00 }, - { 0x019d, 0x041a, 0x01 }, { 0x01b7, 0x041c, 0x00 }, - { 0x0218, 0x041d, 0x03 }, { 0x0232, 0x0421, 0x01 }, - { 0x0237, 0x0423, 0x00 }, { 0x0254, 0x0424, 0x00 }, - { 0x0258, 0x0425, 0x01 }, { 0x025b, 0x0427, 0x00 }, - { 0x0272, 0x0428, 0x00 }, { 0x0292, 0x0429, 0x00 }, - { 0x02bb, 0x042a, 0x02 }, { 0x02c6, 0x042d, 0x01 }, - { 0x02d8, 0x042e, 0x01 }, { 0x02db, 0x0430, 0x02 }, - { 0x0300, 0x031f, 0x00 }, { 0x0301, 0x034f, 0x00 }, - { 0x0302, 0x042d, 0x00 }, { 0x0303, 0x0431, 0x00 }, - { 0x0306, 0x042e, 0x00 }, { 0x030c, 0x042e, 0x00 }, - { 0x0329, 0x0433, 0x00 }, { 0x0384, 0x0434, 0x06 }, - { 0x038c, 0x043b, 0x00 }, { 0x038e, 0x043c, 0x02 }, - { 0x0391, 0x0300, 0x01 }, { 0x0393, 0x043f, 0x01 }, - { 0x0395, 0x0304, 0x00 }, { 0x0396, 0x0319, 0x00 }, - { 0x0397, 0x0307, 0x00 }, { 0x0398, 0x0441, 0x00 }, - { 0x0399, 0x0308, 0x00 }, { 0x039a, 0x030a, 0x00 }, - { 0x039b, 0x0442, 0x00 }, { 0x039c, 0x030c, 0x01 }, - { 0x039e, 0x0443, 0x00 }, { 0x039f, 0x030e, 0x00 }, - { 0x03a0, 0x0444, 0x00 }, { 0x03a1, 0x030f, 0x00 }, - { 0x03a3, 0x0445, 0x00 }, { 0x03a4, 0x0313, 0x00 }, - { 0x03a5, 0x0318, 0x00 }, { 0x03a6, 0x0446, 0x00 }, - { 0x03a7, 0x0317, 0x00 }, { 0x03a8, 0x0447, 0x01 }, - { 0x03aa, 0x0369, 0x00 }, { 0x03ab, 0x040d, 0x00 }, - { 0x03ac, 0x0449, 0x08 }, { 0x03b5, 0x0427, 0x00 }, - { 0x03b6, 0x0452, 0x00 }, { 0x03b7, 0x041b, 0x00 }, - { 0x03b8, 0x0453, 0x01 }, { 0x03ba, 0x03cf, 0x00 }, - { 0x03bb, 0x0455, 0x00 }, { 0x03bc, 0x0350, 0x00 }, - { 0x03bd, 0x0335, 0x00 }, { 0x03be, 0x0456, 0x00 }, - { 0x03bf, 0x032e, 0x00 }, { 0x03c0, 0x0457, 0x0b }, - { 0x03cc, 0x038d, 0x00 }, { 0x03cd, 0x0463, 0x01 }, - { 0x03f3, 0x0329, 0x00 }, { 0x03f4, 0x0465, 0x00 }, - { 0x0400, 0x0362, 0x00 }, { 0x0401, 0x0365, 0x00 }, - { 0x0402, 0x0466, 0x02 }, { 0x0405, 0x0312, 0x00 }, - { 0x0406, 0x0308, 0x00 }, { 0x0407, 0x0369, 0x00 }, - { 0x0408, 0x0309, 0x00 }, { 0x0409, 0x0469, 0x06 }, - { 0x0410, 0x0300, 0x00 }, { 0x0411, 0x0470, 0x00 }, - { 0x0412, 0x0301, 0x00 }, { 0x0413, 0x043f, 0x00 }, - { 0x0414, 0x0471, 0x00 }, { 0x0415, 0x0304, 0x00 }, - { 0x0416, 0x0472, 0x00 }, { 0x0417, 0x02f2, 0x00 }, - { 0x0418, 0x0473, 0x01 }, { 0x041a, 0x030a, 0x00 }, - { 0x041b, 0x0475, 0x00 }, { 0x041c, 0x030c, 0x00 }, - { 0x041d, 0x0307, 0x00 }, { 0x041e, 0x030e, 0x00 }, - { 0x041f, 0x0444, 0x00 }, { 0x0420, 0x030f, 0x00 }, - { 0x0421, 0x0302, 0x00 }, { 0x0422, 0x0313, 0x00 }, - { 0x0423, 0x0476, 0x01 }, { 0x0425, 0x0317, 0x00 }, - { 0x0426, 0x0478, 0x09 }, { 0x0430, 0x0320, 0x00 }, - { 0x0431, 0x0482, 0x02 }, { 0x0434, 0x0326, 0x00 }, - { 0x0435, 0x0324, 0x00 }, { 0x0436, 0x0485, 0x01 }, - { 0x0438, 0x0334, 0x00 }, { 0x0439, 0x0404, 0x00 }, - { 0x043a, 0x03cf, 0x00 }, { 0x043b, 0x0487, 0x02 }, - { 0x043e, 0x032e, 0x00 }, { 0x043f, 0x0457, 0x00 }, - { 0x0440, 0x032f, 0x00 }, { 0x0441, 0x0322, 0x00 }, - { 0x0442, 0x048a, 0x00 }, { 0x0443, 0x0338, 0x00 }, - { 0x0444, 0x048b, 0x00 }, { 0x0445, 0x0337, 0x00 }, - { 0x0446, 0x048c, 0x09 }, { 0x0450, 0x0382, 0x00 }, - { 0x0451, 0x0385, 0x00 }, { 0x0452, 0x0496, 0x02 }, - { 0x0455, 0x0332, 0x00 }, { 0x0456, 0x0328, 0x00 }, - { 0x0457, 0x0389, 0x00 }, { 0x0458, 0x0329, 0x00 }, - { 0x0459, 0x0499, 0x01 }, { 0x045b, 0x03be, 0x00 }, - { 0x045c, 0x049b, 0x00 }, { 0x045d, 0x0393, 0x00 }, - { 0x045e, 0x049c, 0x01 }, { 0x0490, 0x049e, 0x0d }, - { 0x04a0, 0x04ac, 0x05 }, { 0x04aa, 0x04b2, 0x01 }, - { 0x04ae, 0x0318, 0x00 }, { 0x04af, 0x0450, 0x00 }, - { 0x04b0, 0x04b4, 0x03 }, { 0x04b6, 0x04b8, 0x05 }, - { 0x04d0, 0x039c, 0x01 }, { 0x04d2, 0x035e, 0x00 }, - { 0x04d3, 0x037e, 0x00 }, { 0x04d4, 0x0360, 0x00 }, - { 0x04d5, 0x0380, 0x00 }, { 0x04d6, 0x03ad, 0x01 }, - { 0x04d8, 0x0417, 0x00 }, { 0x04d9, 0x0426, 0x00 }, - { 0x04da, 0x04be, 0x05 }, { 0x04e2, 0x04c4, 0x00 }, - { 0x04e3, 0x0402, 0x00 }, { 0x04e4, 0x04c5, 0x00 }, - { 0x04e5, 0x0396, 0x00 }, { 0x04e6, 0x0370, 0x00 }, - { 0x04e7, 0x0390, 0x00 }, { 0x04e8, 0x0465, 0x00 }, - { 0x04e9, 0x04c6, 0x05 }, { 0x04ef, 0x0422, 0x00 }, - { 0x04f0, 0x04cc, 0x00 }, { 0x04f1, 0x0399, 0x00 }, - { 0x04f2, 0x04cd, 0x03 }, { 0x04f8, 0x04d1, 0x01 }, - { 0x1e34, 0x04d3, 0x01 }, { 0x1eb8, 0x04d5, 0x01 }, - { 0x1ebc, 0x04d7, 0x01 }, { 0x1eca, 0x04d9, 0x03 }, - { 0x1ee4, 0x04dd, 0x01 }, { 0x1ef8, 0x04df, 0x01 }, - { 0x2010, 0x0349, 0x00 }, { 0x2011, 0x0349, 0x00 }, +static struct vt_font_map font_mapping_bold[272] = { + { 0x0021, 0x0302, 0x0b }, { 0x002d, 0x0205, 0x00 }, + { 0x002e, 0x030e, 0x50 }, { 0x00a1, 0x035f, 0x07 }, + { 0x00aa, 0x0367, 0x03 }, { 0x00af, 0x036b, 0x07 }, + { 0x00b7, 0x0233, 0x00 }, { 0x00b8, 0x0373, 0x57 }, + { 0x0110, 0x038b, 0x00 }, { 0x0111, 0x03cb, 0x08 }, + { 0x011a, 0x03ce, 0x01 }, { 0x011c, 0x03d4, 0x59 }, + { 0x0178, 0x042e, 0x07 }, { 0x0186, 0x0436, 0x00 }, + { 0x018e, 0x0437, 0x02 }, { 0x0192, 0x043a, 0x00 }, + { 0x019d, 0x043b, 0x01 }, { 0x01b7, 0x043d, 0x00 }, + { 0x0218, 0x043e, 0x03 }, { 0x0232, 0x0442, 0x01 }, + { 0x0237, 0x0444, 0x00 }, { 0x0254, 0x0445, 0x00 }, + { 0x0258, 0x0446, 0x01 }, { 0x025b, 0x0448, 0x00 }, + { 0x0272, 0x0449, 0x00 }, { 0x0292, 0x044a, 0x00 }, + { 0x02bb, 0x044b, 0x02 }, { 0x02c6, 0x044e, 0x01 }, + { 0x02d8, 0x044f, 0x01 }, { 0x02db, 0x0451, 0x02 }, + { 0x0300, 0x0340, 0x00 }, { 0x0301, 0x0370, 0x00 }, + { 0x0302, 0x044e, 0x00 }, { 0x0303, 0x0452, 0x00 }, + { 0x0306, 0x044f, 0x00 }, { 0x030c, 0x044f, 0x00 }, + { 0x0329, 0x0454, 0x00 }, { 0x0384, 0x0455, 0x06 }, + { 0x038c, 0x045c, 0x00 }, { 0x038e, 0x045d, 0x02 }, + { 0x0391, 0x0321, 0x01 }, { 0x0393, 0x0460, 0x01 }, + { 0x0395, 0x0325, 0x00 }, { 0x0396, 0x033a, 0x00 }, + { 0x0397, 0x0328, 0x00 }, { 0x0398, 0x0462, 0x00 }, + { 0x0399, 0x0329, 0x00 }, { 0x039a, 0x032b, 0x00 }, + { 0x039b, 0x0463, 0x00 }, { 0x039c, 0x032d, 0x01 }, + { 0x039e, 0x0464, 0x00 }, { 0x039f, 0x032f, 0x00 }, + { 0x03a0, 0x0465, 0x00 }, { 0x03a1, 0x0330, 0x00 }, + { 0x03a3, 0x0466, 0x00 }, { 0x03a4, 0x0334, 0x00 }, + { 0x03a5, 0x0339, 0x00 }, { 0x03a6, 0x0467, 0x00 }, + { 0x03a7, 0x0338, 0x00 }, { 0x03a8, 0x0468, 0x01 }, + { 0x03aa, 0x038a, 0x00 }, { 0x03ab, 0x042e, 0x00 }, + { 0x03ac, 0x046a, 0x08 }, { 0x03b5, 0x0448, 0x00 }, + { 0x03b6, 0x0473, 0x00 }, { 0x03b7, 0x043c, 0x00 }, + { 0x03b8, 0x0474, 0x01 }, { 0x03ba, 0x03f0, 0x00 }, + { 0x03bb, 0x0476, 0x00 }, { 0x03bc, 0x0371, 0x00 }, + { 0x03bd, 0x0356, 0x00 }, { 0x03be, 0x0477, 0x00 }, + { 0x03bf, 0x034f, 0x00 }, { 0x03c0, 0x0478, 0x0b }, + { 0x03cc, 0x03ae, 0x00 }, { 0x03cd, 0x0484, 0x01 }, + { 0x03f3, 0x034a, 0x00 }, { 0x03f4, 0x0486, 0x00 }, + { 0x0400, 0x0383, 0x00 }, { 0x0401, 0x0386, 0x00 }, + { 0x0402, 0x0487, 0x02 }, { 0x0405, 0x0333, 0x00 }, + { 0x0406, 0x0329, 0x00 }, { 0x0407, 0x038a, 0x00 }, + { 0x0408, 0x032a, 0x00 }, { 0x0409, 0x048a, 0x06 }, + { 0x0410, 0x0321, 0x00 }, { 0x0411, 0x0491, 0x00 }, + { 0x0412, 0x0322, 0x00 }, { 0x0413, 0x0460, 0x00 }, + { 0x0414, 0x0492, 0x00 }, { 0x0415, 0x0325, 0x00 }, + { 0x0416, 0x0493, 0x00 }, { 0x0417, 0x0313, 0x00 }, + { 0x0418, 0x0494, 0x01 }, { 0x041a, 0x032b, 0x00 }, + { 0x041b, 0x0496, 0x00 }, { 0x041c, 0x032d, 0x00 }, + { 0x041d, 0x0328, 0x00 }, { 0x041e, 0x032f, 0x00 }, + { 0x041f, 0x0465, 0x00 }, { 0x0420, 0x0330, 0x00 }, + { 0x0421, 0x0323, 0x00 }, { 0x0422, 0x0334, 0x00 }, + { 0x0423, 0x0497, 0x01 }, { 0x0425, 0x0338, 0x00 }, + { 0x0426, 0x0499, 0x09 }, { 0x0430, 0x0341, 0x00 }, + { 0x0431, 0x04a3, 0x02 }, { 0x0434, 0x0347, 0x00 }, + { 0x0435, 0x0345, 0x00 }, { 0x0436, 0x04a6, 0x01 }, + { 0x0438, 0x0355, 0x00 }, { 0x0439, 0x0425, 0x00 }, + { 0x043a, 0x03f0, 0x00 }, { 0x043b, 0x04a8, 0x02 }, + { 0x043e, 0x034f, 0x00 }, { 0x043f, 0x0478, 0x00 }, + { 0x0440, 0x0350, 0x00 }, { 0x0441, 0x0343, 0x00 }, + { 0x0442, 0x04ab, 0x00 }, { 0x0443, 0x0359, 0x00 }, + { 0x0444, 0x04ac, 0x00 }, { 0x0445, 0x0358, 0x00 }, + { 0x0446, 0x04ad, 0x09 }, { 0x0450, 0x03a3, 0x00 }, + { 0x0451, 0x03a6, 0x00 }, { 0x0452, 0x04b7, 0x02 }, + { 0x0455, 0x0353, 0x00 }, { 0x0456, 0x0349, 0x00 }, + { 0x0457, 0x03aa, 0x00 }, { 0x0458, 0x034a, 0x00 }, + { 0x0459, 0x04ba, 0x01 }, { 0x045b, 0x03df, 0x00 }, + { 0x045c, 0x04bc, 0x00 }, { 0x045d, 0x03b4, 0x00 }, + { 0x045e, 0x04bd, 0x01 }, { 0x0490, 0x04bf, 0x0d }, + { 0x04a0, 0x04cd, 0x05 }, { 0x04aa, 0x04d3, 0x01 }, + { 0x04ae, 0x0339, 0x00 }, { 0x04af, 0x0471, 0x00 }, + { 0x04b0, 0x04d5, 0x03 }, { 0x04b6, 0x04d9, 0x05 }, + { 0x04d0, 0x03bd, 0x01 }, { 0x04d2, 0x037f, 0x00 }, + { 0x04d3, 0x039f, 0x00 }, { 0x04d4, 0x0381, 0x00 }, + { 0x04d5, 0x03a1, 0x00 }, { 0x04d6, 0x03ce, 0x01 }, + { 0x04d8, 0x0438, 0x00 }, { 0x04d9, 0x0447, 0x00 }, + { 0x04da, 0x04df, 0x05 }, { 0x04e2, 0x04e5, 0x00 }, + { 0x04e3, 0x0423, 0x00 }, { 0x04e4, 0x04e6, 0x00 }, + { 0x04e5, 0x03b7, 0x00 }, { 0x04e6, 0x0391, 0x00 }, + { 0x04e7, 0x03b1, 0x00 }, { 0x04e8, 0x0486, 0x00 }, + { 0x04e9, 0x04e7, 0x05 }, { 0x04ef, 0x0443, 0x00 }, + { 0x04f0, 0x04ed, 0x00 }, { 0x04f1, 0x03ba, 0x00 }, + { 0x04f2, 0x04ee, 0x03 }, { 0x04f8, 0x04f2, 0x01 }, + { 0x1e34, 0x04f4, 0x01 }, { 0x1eb8, 0x04f6, 0x01 }, + { 0x1ebc, 0x04f8, 0x01 }, { 0x1eca, 0x04fa, 0x03 }, + { 0x1ee4, 0x04fe, 0x01 }, { 0x1ef8, 0x0500, 0x01 }, + { 0x2010, 0x036a, 0x00 }, { 0x2011, 0x036a, 0x00 }, { 0x2012, 0x0205, 0x00 }, { 0x2013, 0x0205, 0x00 }, - { 0x2016, 0x04e1, 0x03 }, { 0x201a, 0x02ec, 0x00 }, - { 0x201b, 0x04e5, 0x06 }, { 0x2026, 0x04ec, 0x00 }, - { 0x2030, 0x04ed, 0x00 }, { 0x2032, 0x04ee, 0x01 }, - { 0x2039, 0x04f0, 0x01 }, { 0x203c, 0x04f2, 0x00 }, - { 0x203e, 0x04f3, 0x00 }, { 0x207f, 0x04f4, 0x00 }, - { 0x20a7, 0x04f5, 0x00 }, { 0x20ac, 0x04f6, 0x00 }, - { 0x20ae, 0x04f7, 0x00 }, { 0x210e, 0x0327, 0x00 }, - { 0x210f, 0x03be, 0x00 }, { 0x2126, 0x0448, 0x00 }, - { 0x2190, 0x04f8, 0x05 }, { 0x21a8, 0x04fe, 0x00 }, - { 0x21b5, 0x04ff, 0x00 }, { 0x21d0, 0x0500, 0x05 }, - { 0x2203, 0x0506, 0x00 }, { 0x2205, 0x0507, 0x00 }, - { 0x2206, 0x0440, 0x00 }, { 0x2208, 0x0508, 0x00 }, - { 0x220a, 0x0509, 0x00 }, { 0x2212, 0x0205, 0x00 }, - { 0x2219, 0x050a, 0x01 }, { 0x221e, 0x050c, 0x01 }, - { 0x2227, 0x050e, 0x03 }, { 0x2248, 0x0512, 0x00 }, - { 0x2260, 0x0513, 0x01 }, { 0x2264, 0x0515, 0x01 }, - { 0x2302, 0x0517, 0x00 }, { 0x2310, 0x0518, 0x00 }, - { 0x2320, 0x0519, 0x01 }, { 0x23ba, 0x051b, 0x02 }, - { 0x23bd, 0x02b4, 0x00 }, { 0x2409, 0x051e, 0x04 }, - { 0x2424, 0x0523, 0x00 }, { 0x2500, 0x024f, 0x00 }, - { 0x2501, 0x0524, 0x00 }, { 0x2502, 0x0251, 0x00 }, - { 0x2503, 0x0525, 0x00 }, { 0x2508, 0x0253, 0x00 }, - { 0x2509, 0x0526, 0x00 }, { 0x250a, 0x0255, 0x00 }, - { 0x250b, 0x0527, 0x00 }, { 0x250c, 0x0259, 0x00 }, - { 0x250d, 0x0528, 0x02 }, { 0x2510, 0x025d, 0x00 }, - { 0x2511, 0x052b, 0x02 }, { 0x2514, 0x0261, 0x00 }, - { 0x2515, 0x052e, 0x02 }, { 0x2518, 0x0265, 0x00 }, - { 0x2519, 0x0531, 0x02 }, { 0x251c, 0x026d, 0x00 }, - { 0x251d, 0x0534, 0x06 }, { 0x2524, 0x0275, 0x00 }, - { 0x2525, 0x053b, 0x06 }, { 0x252c, 0x027d, 0x00 }, - { 0x252d, 0x0542, 0x06 }, { 0x2534, 0x0285, 0x00 }, - { 0x2535, 0x0549, 0x06 }, { 0x253c, 0x0295, 0x00 }, - { 0x253d, 0x0550, 0x0e }, { 0x2550, 0x055f, 0x1c }, - { 0x25a0, 0x057c, 0x00 }, { 0x25ac, 0x057d, 0x00 }, - { 0x25ae, 0x057e, 0x00 }, { 0x25b2, 0x057f, 0x00 }, - { 0x25b6, 0x0580, 0x00 }, { 0x25bc, 0x0581, 0x00 }, - { 0x25c0, 0x0582, 0x00 }, { 0x25c6, 0x0583, 0x00 }, - { 0x25ca, 0x0584, 0x01 }, { 0x25d9, 0x0586, 0x00 }, - { 0x263c, 0x0587, 0x00 }, { 0x2640, 0x0588, 0x00 }, - { 0x2642, 0x0589, 0x00 }, { 0x2660, 0x058a, 0x00 }, - { 0x2663, 0x058b, 0x00 }, { 0x2666, 0x0583, 0x00 }, - { 0x266a, 0x058c, 0x01 }, { 0xf6be, 0x0423, 0x00 }, + { 0x2016, 0x0502, 0x03 }, { 0x201a, 0x030d, 0x00 }, + { 0x201b, 0x0506, 0x06 }, { 0x2026, 0x050d, 0x00 }, + { 0x2030, 0x050e, 0x00 }, { 0x2032, 0x050f, 0x01 }, + { 0x2039, 0x0511, 0x01 }, { 0x203c, 0x0513, 0x00 }, + { 0x203e, 0x0514, 0x00 }, { 0x207f, 0x0515, 0x00 }, + { 0x20a7, 0x0516, 0x00 }, { 0x20ac, 0x0517, 0x00 }, + { 0x20ae, 0x0518, 0x00 }, { 0x210e, 0x0348, 0x00 }, + { 0x210f, 0x03df, 0x00 }, { 0x2126, 0x0469, 0x00 }, + { 0x2190, 0x0519, 0x05 }, { 0x21a8, 0x051f, 0x00 }, + { 0x21b5, 0x0520, 0x00 }, { 0x21d0, 0x0521, 0x05 }, + { 0x2203, 0x0527, 0x00 }, { 0x2205, 0x0528, 0x00 }, + { 0x2206, 0x0461, 0x00 }, { 0x2208, 0x0529, 0x00 }, + { 0x220a, 0x052a, 0x00 }, { 0x2212, 0x0205, 0x00 }, + { 0x2219, 0x052b, 0x01 }, { 0x221e, 0x052d, 0x01 }, + { 0x2227, 0x052f, 0x03 }, { 0x2248, 0x0533, 0x00 }, + { 0x2260, 0x0534, 0x01 }, { 0x2264, 0x0536, 0x01 }, + { 0x2300, 0x0528, 0x00 }, { 0x2302, 0x0538, 0x00 }, + { 0x2310, 0x0539, 0x00 }, { 0x2320, 0x053a, 0x01 }, + { 0x23ba, 0x053c, 0x02 }, { 0x23bd, 0x02c4, 0x00 }, + { 0x2409, 0x053f, 0x04 }, { 0x2424, 0x0544, 0x00 }, + { 0x2500, 0x024f, 0x00 }, { 0x2501, 0x0545, 0x00 }, + { 0x2502, 0x0251, 0x00 }, { 0x2503, 0x0546, 0x00 }, + { 0x2508, 0x0253, 0x00 }, { 0x2509, 0x0547, 0x00 }, + { 0x250a, 0x0255, 0x00 }, { 0x250b, 0x0548, 0x00 }, + { 0x250c, 0x0259, 0x00 }, { 0x250d, 0x0549, 0x02 }, + { 0x2510, 0x025d, 0x00 }, { 0x2511, 0x054c, 0x02 }, + { 0x2514, 0x0261, 0x00 }, { 0x2515, 0x054f, 0x02 }, + { 0x2518, 0x0265, 0x00 }, { 0x2519, 0x0552, 0x02 }, + { 0x251c, 0x026d, 0x00 }, { 0x251d, 0x0555, 0x06 }, + { 0x2524, 0x0275, 0x00 }, { 0x2525, 0x055c, 0x06 }, + { 0x252c, 0x027d, 0x00 }, { 0x252d, 0x0563, 0x06 }, + { 0x2534, 0x0285, 0x00 }, { 0x2535, 0x056a, 0x06 }, + { 0x253c, 0x0295, 0x00 }, { 0x253d, 0x0571, 0x0e }, + { 0x2550, 0x0580, 0x20 }, { 0x2574, 0x05a1, 0x01 }, + { 0x2576, 0x02bd, 0x01 }, { 0x2578, 0x05a3, 0x07 }, + { 0x25a0, 0x05ab, 0x00 }, { 0x25ac, 0x05ac, 0x00 }, + { 0x25ae, 0x05ad, 0x00 }, { 0x25b2, 0x05ae, 0x00 }, + { 0x25b6, 0x05af, 0x00 }, { 0x25bc, 0x05b0, 0x00 }, + { 0x25c0, 0x05b1, 0x00 }, { 0x25c6, 0x05b2, 0x00 }, + { 0x25ca, 0x05b3, 0x01 }, { 0x25cf, 0x05b5, 0x00 }, + { 0x25d9, 0x05b6, 0x00 }, { 0x263c, 0x05b7, 0x00 }, + { 0x2640, 0x05b8, 0x00 }, { 0x2642, 0x05b9, 0x00 }, + { 0x2660, 0x05ba, 0x00 }, { 0x2663, 0x05bb, 0x00 }, + { 0x2666, 0x05b2, 0x00 }, { 0x266a, 0x05bc, 0x01 }, + { 0x2713, 0x02f8, 0x00 }, { 0x2714, 0x05be, 0x00 }, + { 0x2717, 0x02fa, 0x00 }, { 0x2718, 0x05bf, 0x00 }, + { 0xe0a0, 0x05c0, 0x02 }, { 0xe0b1, 0x05c3, 0x00 }, + { 0xe0b3, 0x05c4, 0x00 }, { 0xf6be, 0x0444, 0x00 }, }; struct vt_font vt_font_default = { @@ -2199,6 +2286,6 @@ struct vt_font vt_font_default = { font_mapping_bold, NULL, }, - .vf_map_count = { 248, 0, 260, 0 }, + .vf_map_count = { 252, 0, 272, 0 }, .vf_refcount = 1, }; From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 14:19:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8FBE5ED; Thu, 5 Jun 2014 14:19:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C62DC2275; Thu, 5 Jun 2014 14:19:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55EJW2M085508; Thu, 5 Jun 2014 14:19:32 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55EJWPc085507; Thu, 5 Jun 2014 14:19:32 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406051419.s55EJWPc085507@svn.freebsd.org> From: Ed Maste Date: Thu, 5 Jun 2014 14:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267110 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 14:19:32 -0000 Author: emaste Date: Thu Jun 5 14:19:32 2014 New Revision: 267110 URL: http://svnweb.freebsd.org/changeset/base/267110 Log: Update reported libusb version to 1.0.13 QEMU libusb host support needs at least libusbx-1.0.13, and our in-tree libusb supports the required functionality. Exp-run in PR. PR: 181035 Modified: head/lib/libusb/libusb-1.0.pc Modified: head/lib/libusb/libusb-1.0.pc ============================================================================== --- head/lib/libusb/libusb-1.0.pc Thu Jun 5 13:49:37 2014 (r267109) +++ head/lib/libusb/libusb-1.0.pc Thu Jun 5 14:19:32 2014 (r267110) @@ -6,6 +6,6 @@ includedir=${prefix}/include Name: libusb-1.0 Description: Library that abstracts ways to access USB devices (v1.0) -Version: 1.0.9 +Version: 1.0.13 Libs: -L${libdir} -lusb Cflags: -I${includedir} From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 15:38:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5624D01 for ; Thu, 5 Jun 2014 15:38:57 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DFDC2B3F for ; Thu, 5 Jun 2014 15:38:57 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s55Fcvoe085540 for ; Thu, 5 Jun 2014 15:38:57 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s55Fcveh085531 for svn-src-head@freebsd.org; Thu, 5 Jun 2014 15:38:57 GMT (envelope-from bdrewery) Received: (qmail 65701 invoked from network); 5 Jun 2014 10:38:55 -0500 Received: from unknown (HELO blah) (freebsd@shatow.net@67.182.131.225) by sweb.xzibition.com with ESMTPA; 5 Jun 2014 10:38:55 -0500 Message-ID: <53908F10.20204@FreeBSD.org> Date: Thu, 05 Jun 2014 10:38:56 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Julian Elischer Subject: Re: svn commit: r266760 - head/contrib/bmake References: <201405271839.s4RIdDq8055387@svn.freebsd.org> <538D1DB7.7010508@FreeBSD.org> <20140603044638.81DF6580A1@chaos.jnpr.net> <20140603063512.GB45150@ivaldir.etoilebsd.net> <538F3918.6040002@FreeBSD.org> <538FE18E.7050101@freebsd.org> In-Reply-To: <538FE18E.7050101@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Baptiste Daroussin , src-committers@freebsd.org, Eitan Adler , svn-src-all@freebsd.org, "Simon J. Gerraty" , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 15:38:57 -0000 On Wed Jun 4 22:18:38 2014, Julian Elischer wrote: > On 6/4/14, 11:19 PM, Drewery, Bryan wrote: >> On 6/4/14, 2:26 AM, Eitan Adler wrote: >>> On 2 June 2014 23:35, Baptiste Daroussin wrote: >>>> On Mon, Jun 02, 2014 at 09:46:38PM -0700, Simon J. Gerraty wrote: >>>>> >>>>> On Mon, 2 Jun 2014 19:58:31 -0500, Bryan Drewery writes: >>>>>> Not sure if anyone cares, but this change breaks all ports tree >>>>>> checkouts from before 2014-05-05 on src head with this revision. >>>>> >>>>> Yes, an older ports tree would need an older bmake (or fmake). >>>>> Are we saying ports is *not* ready for that hack to be removed? >>>>> >>>> >>>> IMHO it is, just people has to be aware of that :) >>> >>> ports-announce@ is the correct location for this announcement :) >>> >> >> I think that would just confuse people. I don't think this is worthy >> of such a big announcement. I can write up something to current@ and >> ports@ though. It's really only an issue if you are trying to use >> older ports tree and why would you anyway in most cases? >> > We have a scenario where we check out a ports tree at one revision, > but then need to slide parts of it back and forth to get to a specific > revision of a port that we need. We can not affort to re-verrify every > port revision every month, so it stays at an old revision generally > but individual ports my upgrade if there is a security risk or may > remain on anold revision if a newer version breaks thins for us. (it > happens). > > If that breaks we will not be happy Are you running head base though and frequently updating? I too use an older ports tree in various places, but not following head enough where it matters much. -- Regards, Bryan Drewery From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 17:13:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB8BDD85; Thu, 5 Jun 2014 17:13:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BED2D24BE; Thu, 5 Jun 2014 17:13:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55HDgOs074558; Thu, 5 Jun 2014 17:13:42 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55HDgQ5074556; Thu, 5 Jun 2014 17:13:42 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201406051713.s55HDgQ5074556@svn.freebsd.org> From: Warner Losh Date: Thu, 5 Jun 2014 17:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267118 - in head/sys/cam: ata scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 17:13:43 -0000 Author: imp Date: Thu Jun 5 17:13:42 2014 New Revision: 267118 URL: http://svnweb.freebsd.org/changeset/base/267118 Log: The code that combines adjacent ranges for BIO_DELETEs to optimize trims to the device assumes the list is sorted. Don't apply the optimization of not sorting the queue when we have SSDs to the delete_queue, since it causes more discard traffic to the drive. While one could argue that the higher levels should coalesce the trims, that's not done today, so some optimization at this level is needed. CR: https://phabric.freebsd.org/D142 Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Thu Jun 5 16:03:55 2014 (r267117) +++ head/sys/cam/ata/ata_da.c Thu Jun 5 17:13:42 2014 (r267118) @@ -729,10 +729,7 @@ adastrategy(struct bio *bp) */ if (bp->bio_cmd == BIO_DELETE && (softc->flags & ADA_FLAG_CAN_TRIM)) { - if (ADA_SIO) - bioq_disksort(&softc->trim_queue, bp); - else - bioq_insert_tail(&softc->trim_queue, bp); + bioq_disksort(&softc->trim_queue, bp); } else { if (ADA_SIO) bioq_disksort(&softc->bio_queue, bp); Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Jun 5 16:03:55 2014 (r267117) +++ head/sys/cam/scsi/scsi_da.c Thu Jun 5 17:13:42 2014 (r267118) @@ -1383,10 +1383,7 @@ dastrategy(struct bio *bp) * Place it in the queue of disk activities for this disk */ if (bp->bio_cmd == BIO_DELETE) { - if (DA_SIO) - bioq_disksort(&softc->delete_queue, bp); - else - bioq_insert_tail(&softc->delete_queue, bp); + bioq_disksort(&softc->delete_queue, bp); } else if (DA_SIO) { bioq_disksort(&softc->bio_queue, bp); } else { @@ -2805,16 +2802,9 @@ cmd6workaround(union ccb *ccb) da_delete_method_desc[old_method], da_delete_method_desc[softc->delete_method]); - if (DA_SIO) { - while ((bp = bioq_takefirst(&softc->delete_run_queue)) - != NULL) - bioq_disksort(&softc->delete_queue, bp); - } else { - while ((bp = bioq_takefirst(&softc->delete_run_queue)) - != NULL) - bioq_insert_tail(&softc->delete_queue, bp); - } - bioq_insert_tail(&softc->delete_queue, + while ((bp = bioq_takefirst(&softc->delete_run_queue)) != NULL) + bioq_disksort(&softc->delete_queue, bp); + bioq_disksort(&softc->delete_queue, (struct bio *)ccb->ccb_h.ccb_bp); ccb->ccb_h.ccb_bp = NULL; return (0); From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 17:58:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5691B1A; Thu, 5 Jun 2014 17:58:46 +0000 (UTC) Received: from mail-lb0-x22c.google.com (mail-lb0-x22c.google.com [IPv6:2a00:1450:4010:c04::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A159C2886; Thu, 5 Jun 2014 17:58:45 +0000 (UTC) Received: by mail-lb0-f172.google.com with SMTP id l4so826626lbv.31 for ; Thu, 05 Jun 2014 10:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=2mf2HhmG2NsOvxb3OK5dwPEEaRfRtunJZPaT5opbWIA=; b=stEIdahkl56psjkk/2ApgBR4vGOPeVIOhhOkRtH+OvJCaxKFu7tsW00mYS1bxAC7X3 Mj0e9bKd6zElH804qR34n/ymvwtrrt/V6lMRyKg2WXAtn2p9NNnoFHzKPOb7o0nRpZee Hk/PfA9hGeGUt8VM/PV+19BflNuPOf1T5/qLXJofsXrx1JxFS7v9eACkbduuC8c3Vbam vTnQc6RmKVvgdX2PgxnkRgS4NM38SfdkuLcf5SkrO4r6POZhnTjQlf6xzwPfwWUP4J8y xPQz0/H4rzWXq3pQfbtH2Vw78pAbwNkaata9ERj+RUmdIfaDmLowwJ6o81FTJ3B1DIKh ZzSw== MIME-Version: 1.0 X-Received: by 10.152.27.134 with SMTP id t6mr48185203lag.41.1401991123635; Thu, 05 Jun 2014 10:58:43 -0700 (PDT) Sender: crodr001@gmail.com Received: by 10.112.67.73 with HTTP; Thu, 5 Jun 2014 10:58:43 -0700 (PDT) In-Reply-To: References: <201405271839.s4RIdDq8055387@svn.freebsd.org> <538D1DB7.7010508@FreeBSD.org> <20140603044638.81DF6580A1@chaos.jnpr.net> <20140603063512.GB45150@ivaldir.etoilebsd.net> Date: Thu, 5 Jun 2014 10:58:43 -0700 X-Google-Sender-Auth: 4Z8EGLktEGbPEzX2NCA9th7moCg Message-ID: Subject: Re: svn commit: r266760 - head/contrib/bmake From: Craig Rodrigues To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Cc: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, Bryan Drewery , svn-src-head@freebsd.org, "Simon J. Gerraty" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 17:58:46 -0000 On Wed, Jun 4, 2014 at 5:05 PM, Warner Losh wrote: > > It would be nice if we could put that code back into make, but have > it disabled. There are several people that use custom old trees that are > hitting this when they build on newer systems... While /usr/ports is ready, > forks of it might not be. I'm cool with having it be turned off by default, > but it sure would be convenient to be able to flip it back on... Anybody > object if I do this? > > Warner I think we need something like this, because there are people out there building embedded products such as FreeNAS which need to use an older ports tree, but may be using newer FreeBSD build servers or FreeBSD desktops to do the build. -- Craig From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 18:01:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0F8AF2F; Thu, 5 Jun 2014 18:01:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEB192924; Thu, 5 Jun 2014 18:01:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55I1xwl097497; Thu, 5 Jun 2014 18:01:59 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55I1xRi097496; Thu, 5 Jun 2014 18:01:59 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406051801.s55I1xRi097496@svn.freebsd.org> From: Ed Maste Date: Thu, 5 Jun 2014 18:01:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267119 - head/tools/tools/vt/fontcvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 18:02:00 -0000 Author: emaste Date: Thu Jun 5 18:01:59 2014 New Revision: 267119 URL: http://svnweb.freebsd.org/changeset/base/267119 Log: vt fontcvt: -w sets the width, not height Modified: head/tools/tools/vt/fontcvt/fontcvt.c Modified: head/tools/tools/vt/fontcvt/fontcvt.c ============================================================================== --- head/tools/tools/vt/fontcvt/fontcvt.c Thu Jun 5 17:13:42 2014 (r267118) +++ head/tools/tools/vt/fontcvt/fontcvt.c Thu Jun 5 18:01:59 2014 (r267119) @@ -401,7 +401,7 @@ main(int argc, char *argv[]) height = atoi(optarg); break; case 'w': - height = atoi(optarg); + width = atoi(optarg); break; case '?': default: From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 18:17:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76579CD7; Thu, 5 Jun 2014 18:17:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 628D02ABC; Thu, 5 Jun 2014 18:17:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55IHf3v004210; Thu, 5 Jun 2014 18:17:41 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55IHf5u004208; Thu, 5 Jun 2014 18:17:41 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406051817.s55IHf5u004208@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 5 Jun 2014 18:17:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267120 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 18:17:41 -0000 Author: hselasky Date: Thu Jun 5 18:17:40 2014 New Revision: 267120 URL: http://svnweb.freebsd.org/changeset/base/267120 Log: Try to fix DWC OTG regression issues with full and low speed devices: - Remove double buffering interrupt and isochronous traffic via the transaction translator. It can be avoided because the DWC OTG will always delay the start split transactions for interrupt and isochronous traffic, but will not delay the complete split transactions, if we set the odd frame bit correctly. - Need to check the transfer cache field in the device done function to be sure all allocated channels are freed and not the transfer first one. This seems to resolve the control endpoint transfer type quirk which is now removed. - Make sure any received data upon TX is dumped else RX path will stop. - Transmit isochronous data before receiving isochronous data as a means to optimise the TT schedule. - Implement a simple TT bandwidth scheduler. - Cleanup use of old "td->error" variable. - On interrupt IN traffic via the transaction translator we simply ignore missed transfer opportunities and silently retry the transaction upon next available time slot. MFC after: 3 days Modified: head/sys/dev/usb/controller/dwc_otg.c head/sys/dev/usb/controller/dwc_otg.h Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Thu Jun 5 18:01:59 2014 (r267119) +++ head/sys/dev/usb/controller/dwc_otg.c Thu Jun 5 18:17:40 2014 (r267120) @@ -592,13 +592,13 @@ dwc_otg_clear_hcint(struct dwc_otg_softc } static uint8_t -dwc_otg_host_channel_alloc(struct dwc_otg_softc *sc, struct dwc_otg_td *td, uint8_t which, uint8_t is_out) +dwc_otg_host_channel_alloc(struct dwc_otg_softc *sc, struct dwc_otg_td *td, uint8_t is_out) { uint32_t tx_p_size; uint32_t tx_np_size; uint8_t x; - if (td->channel[which] < DWC_OTG_MAX_CHANNELS) + if (td->channel < DWC_OTG_MAX_CHANNELS) return (0); /* already allocated */ /* check if device is suspended */ @@ -658,7 +658,7 @@ dwc_otg_host_channel_alloc(struct dwc_ot sc->sc_active_rx_ep |= (1 << x); /* set channel */ - td->channel[which] = x; + td->channel = x; return (0); /* allocated */ } @@ -668,16 +668,16 @@ dwc_otg_host_channel_alloc(struct dwc_ot } static void -dwc_otg_host_channel_free(struct dwc_otg_softc *sc, struct dwc_otg_td *td, uint8_t which) +dwc_otg_host_channel_free(struct dwc_otg_softc *sc, struct dwc_otg_td *td) { uint8_t x; - if (td->channel[which] >= DWC_OTG_MAX_CHANNELS) + if (td->channel >= DWC_OTG_MAX_CHANNELS) return; /* already freed */ /* free channel */ - x = td->channel[which]; - td->channel[which] = DWC_OTG_MAX_CHANNELS; + x = td->channel; + td->channel = DWC_OTG_MAX_CHANNELS; DPRINTF("CH=%d\n", x); @@ -707,6 +707,18 @@ dwc_otg_host_channel_free(struct dwc_otg sc->sc_active_rx_ep &= ~(1 << x); } +static void +dwc_otg_host_dump_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td) +{ + /* dump any pending messages */ + if (sc->sc_last_rx_status != 0) { + if (td->channel < DWC_OTG_MAX_CHANNELS && + td->channel == GRXSTSRD_CHNUM_GET(sc->sc_last_rx_status)) { + dwc_otg_common_rx_ack(sc); + } + } +} + static uint8_t dwc_otg_host_setup_tx(struct dwc_otg_softc *sc, struct dwc_otg_td *td) { @@ -715,13 +727,15 @@ dwc_otg_host_setup_tx(struct dwc_otg_sof uint32_t hcchar; uint8_t delta; - if (td->channel[0] < DWC_OTG_MAX_CHANNELS) { - hcint = sc->sc_chan_state[td->channel[0]].hcint; + dwc_otg_host_dump_rx(sc, td); + + if (td->channel < DWC_OTG_MAX_CHANNELS) { + hcint = sc->sc_chan_state[td->channel].hcint; DPRINTF("CH=%d ST=%d HCINT=0x%08x HCCHAR=0x%08x HCTSIZ=0x%08x\n", - td->channel[0], td->state, hcint, - DWC_OTG_READ_4(sc, DOTG_HCCHAR(td->channel[0])), - DWC_OTG_READ_4(sc, DOTG_HCTSIZ(td->channel[0]))); + td->channel, td->state, hcint, + DWC_OTG_READ_4(sc, DOTG_HCCHAR(td->channel)), + DWC_OTG_READ_4(sc, DOTG_HCTSIZ(td->channel))); } else { hcint = 0; goto check_state; @@ -731,12 +745,12 @@ dwc_otg_host_setup_tx(struct dwc_otg_sof HCINT_ACK | HCINT_NYET)) { /* give success bits priority over failure bits */ } else if (hcint & HCINT_STALL) { - DPRINTF("CH=%d STALL\n", td->channel[0]); + DPRINTF("CH=%d STALL\n", td->channel); td->error_stall = 1; td->error_any = 1; goto complete; } else if (hcint & HCINT_ERRORS) { - DPRINTF("CH=%d ERROR\n", td->channel[0]); + DPRINTF("CH=%d ERROR\n", td->channel); td->errcnt++; if (td->hcsplt != 0 || td->errcnt >= 3) { td->error_any = 1; @@ -804,7 +818,7 @@ check_state: send_pkt: /* free existing channel, if any */ - dwc_otg_host_channel_free(sc, td, 0); + dwc_otg_host_channel_free(sc, td); if (sizeof(req) != td->remainder) { td->error_any = 1; @@ -827,7 +841,7 @@ send_pkt: } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(sc, td, 0, 1)) { + if (dwc_otg_host_channel_alloc(sc, td, 1)) { td->state = DWC_CHAN_ST_START; goto busy; } @@ -841,23 +855,29 @@ send_pkt: usbd_copy_out(td->pc, 0, &req, sizeof(req)); - DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel[0]), + DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), (sizeof(req) << HCTSIZ_XFERSIZE_SHIFT) | (1 << HCTSIZ_PKTCNT_SHIFT) | (HCTSIZ_PID_SETUP << HCTSIZ_PID_SHIFT)); - DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel[0]), td->hcsplt); + DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel), td->hcsplt); hcchar = td->hcchar; hcchar &= ~(HCCHAR_EPDIR_IN | HCCHAR_EPTYPE_MASK); hcchar |= UE_CONTROL << HCCHAR_EPTYPE_SHIFT; /* must enable channel before writing data to FIFO */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel[0]), hcchar); + DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel), hcchar); /* transfer data into FIFO */ bus_space_write_region_4(sc->sc_io_tag, sc->sc_io_hdl, - DOTG_DFIFO(td->channel[0]), (uint32_t *)&req, sizeof(req) / 4); + DOTG_DFIFO(td->channel), (uint32_t *)&req, sizeof(req) / 4); + + /* wait until next slot before trying complete split */ + if (td->ep_type == UE_INTERRUPT || td->ep_type == UE_ISOCHRONOUS) + td->tt_complete_slot = sc->sc_last_frame_num + 2; + else + td->tt_complete_slot = sc->sc_last_frame_num + 1; /* store number of bytes transmitted */ td->tx_bytes = sizeof(req); @@ -865,7 +885,7 @@ send_pkt: send_cpkt: /* free existing channel, if any */ - dwc_otg_host_channel_free(sc, td, 0); + dwc_otg_host_channel_free(sc, td); delta = td->tt_complete_slot - sc->sc_last_frame_num - 1; if (td->tt_scheduled == 0 || delta < DWC_OTG_TT_SLOT_MAX) { @@ -880,34 +900,34 @@ send_cpkt: goto complete; } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(sc, td, 0, 0)) { + if (dwc_otg_host_channel_alloc(sc, td, 0)) { td->state = DWC_CHAN_ST_WAIT_C_PKT; goto busy; } - /* wait until next slot before trying again */ - td->tt_complete_slot++; + /* wait until next slot before trying complete split */ + td->tt_complete_slot = sc->sc_last_frame_num + 1; td->hcsplt |= HCSPLT_COMPSPLT; td->state = DWC_CHAN_ST_WAIT_C_ANE; - DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel[0]), + DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(td->channel), (HCTSIZ_PID_SETUP << HCTSIZ_PID_SHIFT)); - DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel[0]), td->hcsplt); + DWC_OTG_WRITE_4(sc, DOTG_HCSPLT(td->channel), td->hcsplt); hcchar = td->hcchar; hcchar &= ~(HCCHAR_EPDIR_IN | HCCHAR_EPTYPE_MASK); hcchar |= UE_CONTROL << HCCHAR_EPTYPE_SHIFT; /* must enable channel before writing data to FIFO */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel[0]), hcchar); + DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(td->channel), hcchar); busy: return (1); /* busy */ complete: - dwc_otg_host_channel_free(sc, td, 0); + dwc_otg_host_channel_free(sc, td); return (0); /* complete */ } @@ -1085,55 +1105,21 @@ busy: } static uint8_t -dwc_otg_host_data_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td) +dwc_otg_host_data_rx_sub(struct dwc_otg_softc *sc, struct dwc_otg_td *td) { - uint32_t hcint; - uint32_t hcchar; uint32_t count; - uint8_t delta; uint8_t channel; - channel = td->channel[td->tt_channel_tog]; - - if (channel < DWC_OTG_MAX_CHANNELS) { - hcint = sc->sc_chan_state[channel].hcint; - - DPRINTF("CH=%d ST=%d HCINT=0x%08x HCCHAR=0x%08x HCTSIZ=0x%08x\n", - channel, td->state, hcint, - DWC_OTG_READ_4(sc, DOTG_HCCHAR(channel)), - DWC_OTG_READ_4(sc, DOTG_HCTSIZ(channel))); - } else { - hcint = 0; - goto check_state; - } - - /* check interrupt bits */ - - if (hcint & (HCINT_RETRY | - HCINT_ACK | HCINT_NYET)) { - /* give success bits priority over failure bits */ - } else if (hcint & HCINT_STALL) { - DPRINTF("CH=%d STALL\n", channel); - td->error_stall = 1; - td->error_any = 1; - goto complete; - } else if (hcint & HCINT_ERRORS) { - DPRINTF("CH=%d ERROR\n", channel); - td->errcnt++; - if (td->hcsplt != 0 || td->errcnt >= 3) { - if (td->ep_type != UE_ISOCHRONOUS) { - td->error_any = 1; - goto complete; - } - } - } - /* check endpoint status */ if (sc->sc_last_rx_status == 0) - goto check_state; + goto busy; + + channel = td->channel; + if (channel >= DWC_OTG_MAX_CHANNELS) + goto busy; if (GRXSTSRD_CHNUM_GET(sc->sc_last_rx_status) != channel) - goto check_state; + goto busy; switch (sc->sc_last_rx_status & GRXSTSRD_PKTSTS_MASK) { case GRXSTSRH_IN_DATA: @@ -1141,7 +1127,7 @@ dwc_otg_host_data_rx(struct dwc_otg_soft DPRINTF("DATA ST=%d STATUS=0x%08x\n", (int)td->state, (int)sc->sc_last_rx_status); - if (hcint & HCINT_SOFTWARE_ONLY) { + if (sc->sc_chan_state[channel].hcint & HCINT_SOFTWARE_ONLY) { /* * When using SPLIT transactions on interrupt * endpoints, sometimes data occurs twice. @@ -1203,21 +1189,71 @@ dwc_otg_host_data_rx(struct dwc_otg_soft td->remainder -= count; td->offset += count; - hcint |= HCINT_SOFTWARE_ONLY; - sc->sc_chan_state[channel].hcint = hcint; + sc->sc_chan_state[channel].hcint |= HCINT_SOFTWARE_ONLY; break; - default: break; } /* release FIFO */ dwc_otg_common_rx_ack(sc); +busy: + return (0); +complete: + return (1); +} -check_state: - if (hcint & (HCINT_ERRORS | HCINT_RETRY | - HCINT_ACK | HCINT_NYET)) { - if (!(hcint & HCINT_ERRORS)) - td->errcnt = 0; +static uint8_t +dwc_otg_host_data_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td) +{ + uint32_t hcint; + uint32_t hcchar; + uint8_t delta; + uint8_t channel; + + channel = td->channel; + + if (channel < DWC_OTG_MAX_CHANNELS) { + hcint = sc->sc_chan_state[channel].hcint; + + DPRINTF("CH=%d ST=%d HCINT=0x%08x HCCHAR=0x%08x HCTSIZ=0x%08x\n", + channel, td->state, hcint, + DWC_OTG_READ_4(sc, DOTG_HCCHAR(channel)), + DWC_OTG_READ_4(sc, DOTG_HCTSIZ(channel))); + + /* check interrupt bits */ + if (hcint & (HCINT_RETRY | + HCINT_ACK | HCINT_NYET)) { + /* give success bits priority over failure bits */ + } else if (hcint & HCINT_STALL) { + DPRINTF("CH=%d STALL\n", channel); + td->error_stall = 1; + td->error_any = 1; + goto complete; + } else if (hcint & HCINT_ERRORS) { + DPRINTF("CH=%d ERROR\n", channel); + td->errcnt++; + if (td->hcsplt != 0 || td->errcnt >= 3) { + if (td->ep_type != UE_ISOCHRONOUS) { + td->error_any = 1; + goto complete; + } + } + } + + /* check channels for data, if any */ + if (dwc_otg_host_data_rx_sub(sc, td)) + goto complete; + + /* refresh interrupt status */ + hcint = sc->sc_chan_state[channel].hcint; + + if (hcint & (HCINT_ERRORS | HCINT_RETRY | + HCINT_ACK | HCINT_NYET)) { + if (!(hcint & HCINT_ERRORS)) + td->errcnt = 0; + } + } else { + hcint = 0; } switch (td->state) { @@ -1306,7 +1342,7 @@ check_state: receive_pkt: /* free existing channel, if any */ - dwc_otg_host_channel_free(sc, td, td->tt_channel_tog); + dwc_otg_host_channel_free(sc, td); if (td->hcsplt != 0) { delta = td->tt_complete_slot - sc->sc_last_frame_num - 1; @@ -1316,9 +1352,18 @@ receive_pkt: } delta = sc->sc_last_frame_num - td->tt_start_slot; if (delta > DWC_OTG_TT_SLOT_MAX) { - /* we missed the service interval */ - if (td->ep_type != UE_ISOCHRONOUS) + if (td->ep_type == UE_INTERRUPT) { + /* + * Happens from time to time avoid + * posting an error, instead retry + * the start split packet: + */ + td->tt_scheduled = 0; + goto receive_spkt; + } else if (td->ep_type != UE_ISOCHRONOUS) { + /* we missed the service interval */ td->error_any = 1; + } goto complete; } /* complete split */ @@ -1330,12 +1375,12 @@ receive_pkt: } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(sc, td, td->tt_channel_tog, 0)) { + if (dwc_otg_host_channel_alloc(sc, td, 0)) { td->state = DWC_CHAN_ST_WAIT_C_PKT; goto busy; } - channel = td->channel[td->tt_channel_tog]; + channel = td->channel; /* set toggle, if any */ if (td->set_toggle) { @@ -1357,46 +1402,23 @@ receive_pkt: hcchar = td->hcchar; hcchar |= HCCHAR_EPDIR_IN; - /* check if other channel is allocated */ - if (td->channel[td->tt_channel_tog ^ 1] < DWC_OTG_MAX_CHANNELS) { - /* second - receive after next SOF event */ - if ((sc->sc_last_frame_num & 1) != 0) - hcchar |= HCCHAR_ODDFRM; - else - hcchar &= ~HCCHAR_ODDFRM; - - /* other channel is next */ - td->tt_channel_tog ^= 1; - td->tt_complete_slot++; + /* receive complete split ASAP */ + if ((sc->sc_last_frame_num & 1) != 0) + hcchar |= HCCHAR_ODDFRM; + else + hcchar &= ~HCCHAR_ODDFRM; - /* must enable channel before data can be received */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar); - } else { - /* first - receive after second next SOF event */ - if ((sc->sc_last_frame_num & 1) == 0) - hcchar |= HCCHAR_ODDFRM; - else - hcchar &= ~HCCHAR_ODDFRM; + /* must enable channel before data can be received */ + DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar); - /* must enable channel before data can be received */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar); + /* wait until next slot before trying complete split */ + td->tt_complete_slot = sc->sc_last_frame_num + 1; - if (td->hcsplt != 0) { - if (td->ep_type == UE_ISOCHRONOUS || td->ep_type == UE_INTERRUPT) { - /* allocate a second channel */ - td->tt_channel_tog ^= 1; - goto receive_pkt; - } else { - td->tt_complete_slot++; - } - } - } goto busy; receive_spkt: /* free existing channel(s), if any */ - dwc_otg_host_channel_free(sc, td, 0); - dwc_otg_host_channel_free(sc, td, 1); + dwc_otg_host_channel_free(sc, td); delta = td->tt_start_slot - sc->sc_last_frame_num - 1; if (td->tt_scheduled == 0 || delta < DWC_OTG_TT_SLOT_MAX) { @@ -1412,19 +1434,16 @@ receive_spkt: } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(sc, td, 0, 0)) { + if (dwc_otg_host_channel_alloc(sc, td, 0)) { td->state = DWC_CHAN_ST_START; goto busy; } - channel = td->channel[0]; + channel = td->channel; td->hcsplt &= ~HCSPLT_COMPSPLT; td->state = DWC_CHAN_ST_WAIT_S_ANE; - /* reset channel toggle */ - td->tt_channel_tog = 0; - /* receive one packet */ DWC_OTG_WRITE_4(sc, DOTG_HCTSIZ(channel), (HCTSIZ_PID_DATA0 << HCTSIZ_PID_SHIFT)); @@ -1440,14 +1459,19 @@ receive_spkt: hcchar = td->hcchar; hcchar |= HCCHAR_EPDIR_IN; + /* wait until next slot before trying complete split */ + if (td->ep_type == UE_INTERRUPT || td->ep_type == UE_ISOCHRONOUS) + td->tt_complete_slot = sc->sc_last_frame_num + 2; + else + td->tt_complete_slot = sc->sc_last_frame_num + 1; + /* must enable channel before data can be received */ DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar); busy: return (1); /* busy */ complete: - dwc_otg_host_channel_free(sc, td, 0); - dwc_otg_host_channel_free(sc, td, 1); + dwc_otg_host_channel_free(sc, td); return (0); /* complete */ } @@ -1569,7 +1593,9 @@ dwc_otg_host_data_tx(struct dwc_otg_soft uint8_t delta; uint8_t channel; - channel = td->channel[td->tt_channel_tog]; + dwc_otg_host_dump_rx(sc, td); + + channel = td->channel; if (channel < DWC_OTG_MAX_CHANNELS) { hcint = sc->sc_chan_state[channel].hcint; @@ -1578,36 +1604,34 @@ dwc_otg_host_data_tx(struct dwc_otg_soft channel, td->state, hcint, DWC_OTG_READ_4(sc, DOTG_HCCHAR(channel)), DWC_OTG_READ_4(sc, DOTG_HCTSIZ(channel))); - } else { - hcint = 0; - goto check_state; - } - if (hcint & (HCINT_RETRY | - HCINT_ACK | HCINT_NYET)) { - /* give success bits priority over failure bits */ - } else if (hcint & HCINT_STALL) { - DPRINTF("CH=%d STALL\n", channel); - td->error_stall = 1; - td->error_any = 1; - goto complete; - } else if (hcint & HCINT_ERRORS) { - DPRINTF("CH=%d ERROR\n", channel); - td->errcnt++; - if (td->hcsplt != 0 || td->errcnt >= 3) { + if (hcint & (HCINT_RETRY | + HCINT_ACK | HCINT_NYET)) { + /* give success bits priority over failure bits */ + } else if (hcint & HCINT_STALL) { + DPRINTF("CH=%d STALL\n", channel); + td->error_stall = 1; td->error_any = 1; goto complete; + } else if (hcint & HCINT_ERRORS) { + DPRINTF("CH=%d ERROR\n", channel); + td->errcnt++; + if (td->hcsplt != 0 || td->errcnt >= 3) { + td->error_any = 1; + goto complete; + } } - } - if (hcint & (HCINT_ERRORS | HCINT_RETRY | - HCINT_ACK | HCINT_NYET)) { + if (hcint & (HCINT_ERRORS | HCINT_RETRY | + HCINT_ACK | HCINT_NYET)) { - if (!(hcint & HCINT_ERRORS)) - td->errcnt = 0; + if (!(hcint & HCINT_ERRORS)) + td->errcnt = 0; + } + } else { + hcint = 0; } -check_state: switch (td->state) { case DWC_CHAN_ST_START: goto send_pkt; @@ -1694,16 +1718,16 @@ check_state: td->tt_xactpos++; /* free existing channel, if any */ - dwc_otg_host_channel_free(sc, td, td->tt_channel_tog); + dwc_otg_host_channel_free(sc, td); td->state = DWC_CHAN_ST_TX_PKT_ISOC; /* FALLTHROUGH */ case DWC_CHAN_ST_TX_PKT_ISOC: - if (dwc_otg_host_channel_alloc(sc, td, 0, 1)) + if (dwc_otg_host_channel_alloc(sc, td, 1)) break; - channel = td->channel[0]; + channel = td->channel; goto send_isoc_pkt; default: break; @@ -1712,8 +1736,7 @@ check_state: send_pkt: /* free existing channel(s), if any */ - dwc_otg_host_channel_free(sc, td, 0); - dwc_otg_host_channel_free(sc, td, 1); + dwc_otg_host_channel_free(sc, td); if (td->hcsplt != 0) { delta = td->tt_start_slot - sc->sc_last_frame_num - 1; @@ -1734,12 +1757,12 @@ send_pkt: } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(sc, td, 0, 1)) { + if (dwc_otg_host_channel_alloc(sc, td, 1)) { td->state = DWC_CHAN_ST_START; goto busy; } - channel = td->channel[0]; + channel = td->channel; /* set toggle, if any */ if (td->set_toggle) { @@ -1757,7 +1780,7 @@ send_isoc_pkt: count = td->remainder; if (count > HCSPLT_XACTLEN_BURST) { DPRINTF("TT overflow\n"); - td->error = 1; + td->error_any = 1; goto complete; } /* Update transaction position */ @@ -1883,7 +1906,7 @@ send_isoc_pkt: send_cpkt: /* free existing channel, if any */ - dwc_otg_host_channel_free(sc, td, td->tt_channel_tog); + dwc_otg_host_channel_free(sc, td); delta = td->tt_complete_slot - sc->sc_last_frame_num - 1; if (td->tt_scheduled == 0 || delta < DWC_OTG_TT_SLOT_MAX) { @@ -1899,12 +1922,12 @@ send_cpkt: } /* allocate a new channel */ - if (dwc_otg_host_channel_alloc(sc, td, td->tt_channel_tog, 0)) { + if (dwc_otg_host_channel_alloc(sc, td, 0)) { td->state = DWC_CHAN_ST_WAIT_C_PKT; goto busy; } - channel = td->channel[td->tt_channel_tog]; + channel = td->channel; td->hcsplt |= HCSPLT_COMPSPLT; td->state = DWC_CHAN_ST_WAIT_C_ANE; @@ -1917,48 +1940,22 @@ send_cpkt: hcchar = td->hcchar; hcchar &= ~HCCHAR_EPDIR_IN; - /* check if other channel is allocated */ - if (td->channel[td->tt_channel_tog ^ 1] < DWC_OTG_MAX_CHANNELS) { - /* second - receive after next SOF event */ - if ((sc->sc_last_frame_num & 1) != 0) - hcchar |= HCCHAR_ODDFRM; - else - hcchar &= ~HCCHAR_ODDFRM; - - /* other channel is next */ - td->tt_channel_tog ^= 1; - /* wait until next slot before trying again */ - td->tt_complete_slot++; - - /* must enable channel before data can be received */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar); - } else { - /* first - receive after second next SOF event */ - if ((sc->sc_last_frame_num & 1) == 0) - hcchar |= HCCHAR_ODDFRM; - else - hcchar &= ~HCCHAR_ODDFRM; + /* receive complete split ASAP */ + if ((sc->sc_last_frame_num & 1) != 0) + hcchar |= HCCHAR_ODDFRM; + else + hcchar &= ~HCCHAR_ODDFRM; - /* must enable channel before data can be received */ - DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar); + /* must enable channel before data can be received */ + DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar); - if (td->hcsplt != 0) { - if (td->ep_type == UE_ISOCHRONOUS || td->ep_type == UE_INTERRUPT) { - /* allocate a second channel */ - td->tt_channel_tog ^= 1; - goto send_cpkt; - } else { - /* wait until next slot before trying again */ - td->tt_complete_slot++; - } - } - } + /* wait until next slot before trying complete split */ + td->tt_complete_slot = sc->sc_last_frame_num + 1; busy: return (1); /* busy */ complete: - dwc_otg_host_channel_free(sc, td, 0); - dwc_otg_host_channel_free(sc, td, 1); + dwc_otg_host_channel_free(sc, td); return (0); /* complete */ } @@ -2348,6 +2345,21 @@ dwc_otg_host_channel_disable(struct dwc_ sc->sc_chan_state[x].tx_np_size = 0; } +static uint16_t +dwc_otg_compute_tt_slot(struct dwc_otg_tt_info *pinfo, uint16_t io_bytes) +{ + const uint16_t limit = (188 * 5) / 6; /* includes bit-stuffing */ + uint16_t retval = pinfo->slot_index; + + pinfo->bytes_used += io_bytes; + while (pinfo->slot_index < 6 && + pinfo->bytes_used >= limit) { + pinfo->bytes_used -= limit; + pinfo->slot_index++; + } + return (retval); +} + static uint8_t dwc_otg_update_host_transfer_schedule_locked(struct dwc_otg_softc *sc) { @@ -2356,6 +2368,7 @@ dwc_otg_update_host_transfer_schedule_lo struct usb_xfer *xfer_next; struct dwc_otg_td *td; uint16_t temp; + uint16_t slot; uint8_t x; temp = DWC_OTG_READ_4(sc, DOTG_HFNUM) & DWC_OTG_FRAME_MASK; @@ -2377,11 +2390,19 @@ dwc_otg_update_host_transfer_schedule_lo } if ((temp & 7) == 0) { + + /* reset the schedule */ + memset(sc->sc_tt_info, 0, sizeof(sc->sc_tt_info)); + TAILQ_FOREACH_SAFE(xfer, &sc->sc_bus.intr_q.head, wait_entry, xfer_next) { td = xfer->td_transfer_cache; if (td == NULL || td->ep_type != UE_ISOCHRONOUS) continue; + /* check for IN direction */ + if ((td->hcchar & HCCHAR_EPDIR_IN) != 0) + continue; + /* execute more frames */ td->tmr_val = 0; @@ -2390,9 +2411,40 @@ dwc_otg_update_host_transfer_schedule_lo if (td->hcsplt == 0 || td->tt_scheduled != 0) continue; + /* compute slot */ + slot = temp + dwc_otg_compute_tt_slot( + sc->sc_tt_info + td->tt_index, td->remainder); + /* Start ASAP */ - td->tt_start_slot = temp + 0; - td->tt_complete_slot = temp + 2; + td->tt_start_slot = slot + 0; + td->tt_scheduled = 1; + TAILQ_REMOVE(&sc->sc_bus.intr_q.head, xfer, wait_entry); + TAILQ_INSERT_TAIL(&head, xfer, wait_entry); + } + + TAILQ_FOREACH_SAFE(xfer, &sc->sc_bus.intr_q.head, wait_entry, xfer_next) { + td = xfer->td_transfer_cache; + if (td == NULL || td->ep_type != UE_ISOCHRONOUS) + continue; + + /* check for OUT direction */ + if ((td->hcchar & HCCHAR_EPDIR_IN) == 0) + continue; + + /* execute more frames */ + td->tmr_val = 0; + + sc->sc_needsof = 1; + + if (td->hcsplt == 0 || td->tt_scheduled != 0) + continue; + + /* compute slot */ + slot = temp + dwc_otg_compute_tt_slot( + sc->sc_tt_info + td->tt_index, td->remainder); + + /* Start ASAP */ + td->tt_start_slot = slot + 0; td->tt_scheduled = 1; TAILQ_REMOVE(&sc->sc_bus.intr_q.head, xfer, wait_entry); TAILQ_INSERT_TAIL(&head, xfer, wait_entry); @@ -2417,9 +2469,12 @@ dwc_otg_update_host_transfer_schedule_lo continue; } + /* compute slot */ + slot = temp + dwc_otg_compute_tt_slot(sc->sc_tt_info + td->tt_index, + td->max_packet_size); + /* start ASAP */ - td->tt_start_slot = temp + 0; - td->tt_complete_slot = temp + 2; + td->tt_start_slot = slot + 0; sc->sc_needsof = 1; td->tt_scheduled = 1; TAILQ_REMOVE(&sc->sc_bus.intr_q.head, xfer, wait_entry); @@ -2439,9 +2494,11 @@ dwc_otg_update_host_transfer_schedule_lo if (td->hcsplt == 0 || td->tt_scheduled != 0) continue; + /* compute slot */ + slot = temp + dwc_otg_compute_tt_slot(sc->sc_tt_info + td->tt_index, 0); + /* start ASAP */ - td->tt_start_slot = temp + 0; - td->tt_complete_slot = temp + 1; + td->tt_start_slot = slot + 0; td->tt_scheduled = 1; TAILQ_REMOVE(&sc->sc_bus.intr_q.head, xfer, wait_entry); TAILQ_INSERT_TAIL(&head, xfer, wait_entry); @@ -2461,9 +2518,17 @@ dwc_otg_update_host_transfer_schedule_lo if (td->hcsplt == 0 || td->tt_scheduled != 0) continue; + /* compute slot */ + slot = dwc_otg_compute_tt_slot(sc->sc_tt_info + td->tt_index, 0); + + /* figure out highest slot number */ + if (slot < (temp & 7)) + slot = temp; + else + slot += (temp & ~7); + /* start ASAP */ - td->tt_start_slot = temp + 0; - td->tt_complete_slot = temp + 1; + td->tt_start_slot = slot + 0; td->tt_scheduled = 1; TAILQ_REMOVE(&sc->sc_bus.intr_q.head, xfer, wait_entry); TAILQ_INSERT_TAIL(&head, xfer, wait_entry); @@ -2940,12 +3005,10 @@ dwc_otg_setup_standard_chain_sub(struct td->set_toggle = 0; td->got_short = 0; td->did_nak = 0; - td->channel[0] = DWC_OTG_MAX_CHANNELS; - td->channel[1] = DWC_OTG_MAX_CHANNELS; + td->channel = DWC_OTG_MAX_CHANNELS; td->state = 0; td->errcnt = 0; td->tt_scheduled = 0; - td->tt_channel_tog = 0; td->tt_xactpos = HCSPLT_XACTPOS_BEGIN; } @@ -3159,23 +3222,9 @@ dwc_otg_setup_standard_chain(struct usb_ (xfer->address << HCCHAR_DEVADDR_SHIFT) | ((xfer->endpointno & UE_ADDR) << HCCHAR_EPNUM_SHIFT) | (xfer->max_packet_size << HCCHAR_MPS_SHIFT) | + (td->ep_type << HCCHAR_EPTYPE_SHIFT) | HCCHAR_CHENA; - /* - * XXX stability hack - possible HW issue - * - * Disable workaround when using a transaction - * translator, hence some TTs reject control endpoint - * traffic using BULK endpoint type: - */ - if (td->ep_type == UE_CONTROL && - (xfer->xroot->udev->speed == USB_SPEED_HIGH || - xfer->xroot->udev->parent_hs_hub == NULL)) { - hcchar |= (UE_BULK << HCCHAR_EPTYPE_SHIFT); - } else { - hcchar |= (td->ep_type << HCCHAR_EPTYPE_SHIFT); - } - if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_LOW) hcchar |= HCCHAR_LSPDDEV; if (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) @@ -3472,12 +3521,9 @@ dwc_otg_device_done(struct usb_xfer *xfe } else { struct dwc_otg_td *td; - td = xfer->td_transfer_first; - - if (td != NULL) { - dwc_otg_host_channel_free(sc, td, 0); - dwc_otg_host_channel_free(sc, td, 1); - } + td = xfer->td_transfer_cache; + if (td != NULL) + dwc_otg_host_channel_free(sc, td); } /* dequeue transfer and start next transfer */ usbd_transfer_done(xfer, error); @@ -4674,6 +4720,16 @@ dwc_otg_xfer_setup(struct usb_setup_para td = USB_ADD_BYTES(parm->buf, parm->size[0]); + /* compute shared bandwidth resource index for TT */ + if (parm->udev->parent_hs_hub != NULL && parm->udev->speed != USB_SPEED_HIGH) { + if (parm->udev->parent_hs_hub->ddesc.bDeviceProtocol == UDPROTO_HSHUBMTT) + td->tt_index = parm->udev->device_index; + else + td->tt_index = parm->udev->parent_hs_hub->device_index; + } else { + td->tt_index = parm->udev->device_index; + } + /* init TD */ td->max_packet_size = xfer->max_packet_size; td->max_packet_count = xfer->max_packet_count; Modified: head/sys/dev/usb/controller/dwc_otg.h ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.h Thu Jun 5 18:01:59 2014 (r267119) +++ head/sys/dev/usb/controller/dwc_otg.h Thu Jun 5 18:17:40 2014 (r267120) @@ -68,7 +68,8 @@ struct dwc_otg_td { uint8_t did_nak; /* NAK counter */ uint8_t ep_no; uint8_t ep_type; - uint8_t channel[2]; + uint8_t channel; + uint8_t tt_index; /* TT data */ uint8_t tt_start_slot; /* TT data */ uint8_t tt_complete_slot; /* TT data */ uint8_t tt_xactpos; /* TT data */ @@ -80,7 +81,6 @@ struct dwc_otg_td { #define DWC_CHAN_ST_WAIT_C_PKT 4 #define DWC_CHAN_ST_TX_PKT_ISOC 5 #define DWC_CHAN_ST_TX_WAIT_ISOC 6 - uint8_t error:1; uint8_t error_any:1; uint8_t error_stall:1; uint8_t alt_next:1; @@ -90,7 +90,12 @@ struct dwc_otg_td { uint8_t set_toggle:1; uint8_t got_short:1; uint8_t tt_scheduled:1; - uint8_t tt_channel_tog:1; +}; + +struct dwc_otg_tt_info { + uint16_t bytes_used; + uint8_t slot_index; + uint8_t dummy; }; struct dwc_otg_std_temp { @@ -160,6 +165,7 @@ struct dwc_otg_softc { struct usb_bus sc_bus; union dwc_otg_hub_temp sc_hub_temp; struct dwc_otg_profile sc_hw_ep_profile[DWC_OTG_MAX_ENDPOINTS]; + struct dwc_otg_tt_info sc_tt_info[DWC_OTG_MAX_DEVICES]; struct usb_callout sc_timer; struct usb_device *sc_devices[DWC_OTG_MAX_DEVICES]; From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 18:19:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 037031FD; Thu, 5 Jun 2014 18:19:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E51322AED; Thu, 5 Jun 2014 18:19:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55IJmOj004864; Thu, 5 Jun 2014 18:19:48 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55IJmdU004863; Thu, 5 Jun 2014 18:19:48 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406051819.s55IJmdU004863@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 5 Jun 2014 18:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267121 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 18:19:49 -0000 Author: hselasky Date: Thu Jun 5 18:19:48 2014 New Revision: 267121 URL: http://svnweb.freebsd.org/changeset/base/267121 Log: Need to check the transfer cache field in the device done function to be sure all allocated channels are freed and not the transfer first one. Modified: head/sys/dev/usb/controller/saf1761_otg.c Modified: head/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.c Thu Jun 5 18:17:40 2014 (r267120) +++ head/sys/dev/usb/controller/saf1761_otg.c Thu Jun 5 18:19:48 2014 (r267121) @@ -2098,7 +2098,7 @@ saf1761_otg_device_done(struct usb_xfer } else { struct saf1761_otg_td *td; - td = xfer->td_transfer_first; + td = xfer->td_transfer_cache; if (td != NULL) saf1761_host_channel_free(sc, td); From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 18:23:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BD81620; Thu, 5 Jun 2014 18:23:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48D492B98; Thu, 5 Jun 2014 18:23:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55INqI2008950; Thu, 5 Jun 2014 18:23:52 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55INplk008948; Thu, 5 Jun 2014 18:23:51 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406051823.s55INplk008948@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 5 Jun 2014 18:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267122 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 18:23:52 -0000 Author: hselasky Date: Thu Jun 5 18:23:51 2014 New Revision: 267122 URL: http://svnweb.freebsd.org/changeset/base/267122 Log: - Verify that we don't load more data into a FIFO than it is configured to handle. - Add code to handle suspend and resume. MFC after: 3 days Modified: head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/musb_otg.h Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Thu Jun 5 18:19:48 2014 (r267121) +++ head/sys/dev/usb/controller/musb_otg.c Thu Jun 5 18:23:51 2014 (r267122) @@ -131,7 +131,7 @@ static void musbotg_do_poll(struct usb_b static void musbotg_standard_done(struct usb_xfer *); static void musbotg_interrupt_poll(struct musbotg_softc *); static void musbotg_root_intr(struct musbotg_softc *); -static int musbotg_channel_alloc(struct musbotg_softc *, struct musbotg_td *td); +static int musbotg_channel_alloc(struct musbotg_softc *, struct musbotg_td *td, uint8_t); static void musbotg_channel_free(struct musbotg_softc *, struct musbotg_td *td); static void musbotg_ep_int_set(struct musbotg_softc *sc, int channel, int on); @@ -149,7 +149,7 @@ static const struct usb_hw_ep_profile mu }; static int -musbotg_channel_alloc(struct musbotg_softc *sc, struct musbotg_td *td) +musbotg_channel_alloc(struct musbotg_softc *sc, struct musbotg_td *td, uint8_t is_tx) { int ch; int ep; @@ -173,12 +173,23 @@ musbotg_channel_alloc(struct musbotg_sof return (0); } - for (ch = 1; ch < MUSB2_EP_MAX; ch++) { - if (!(sc->sc_channel_mask & (1 << ch))) { - sc->sc_channel_mask |= (1 << ch); - musbotg_ep_int_set(sc, ch, 1); - return (ch); - } + for (ch = sc->sc_ep_max; ch != 0; ch--) { + if (sc->sc_channel_mask & (1 << ch)) + continue; + + /* check FIFO size requirement */ + if (is_tx) { + if (td->max_frame_size > + sc->sc_hw_ep_profile[ch].max_in_frame_size) + continue; + } else { + if (td->max_frame_size > + sc->sc_hw_ep_profile[ch].max_out_frame_size) + continue; + } + sc->sc_channel_mask |= (1 << ch); + musbotg_ep_int_set(sc, ch, 1); + return (ch); } DPRINTFN(-1, "No available channels. Mask: %04x\n", sc->sc_channel_mask); @@ -377,7 +388,7 @@ musbotg_dev_ctrl_setup_rx(struct musbotg sc = MUSBOTG_PC2SC(td->pc); if (td->channel == -1) - td->channel = musbotg_channel_alloc(sc, td); + td->channel = musbotg_channel_alloc(sc, td, 0); /* EP0 is busy, wait */ if (td->channel == -1) @@ -498,7 +509,7 @@ musbotg_host_ctrl_setup_tx(struct musbot sc = MUSBOTG_PC2SC(td->pc); if (td->channel == -1) - td->channel = musbotg_channel_alloc(sc, td); + td->channel = musbotg_channel_alloc(sc, td, 1); /* EP0 is busy, wait */ if (td->channel == -1) @@ -870,7 +881,7 @@ musbotg_host_ctrl_data_rx(struct musbotg sc = MUSBOTG_PC2SC(td->pc); if (td->channel == -1) - td->channel = musbotg_channel_alloc(sc, td); + td->channel = musbotg_channel_alloc(sc, td, 0); /* EP0 is busy, wait */ if (td->channel == -1) @@ -1049,7 +1060,7 @@ musbotg_host_ctrl_data_tx(struct musbotg sc = MUSBOTG_PC2SC(td->pc); if (td->channel == -1) - td->channel = musbotg_channel_alloc(sc, td); + td->channel = musbotg_channel_alloc(sc, td, 1); /* No free EPs */ if (td->channel == -1) @@ -1259,7 +1270,7 @@ musbotg_host_ctrl_status_rx(struct musbo sc = MUSBOTG_PC2SC(td->pc); if (td->channel == -1) - td->channel = musbotg_channel_alloc(sc, td); + td->channel = musbotg_channel_alloc(sc, td, 0); /* EP0 is busy, wait */ if (td->channel == -1) @@ -1346,7 +1357,7 @@ musbotg_host_ctrl_status_tx(struct musbo sc = MUSBOTG_PC2SC(td->pc); if (td->channel == -1) - td->channel = musbotg_channel_alloc(sc, td); + td->channel = musbotg_channel_alloc(sc, td, 1); /* EP0 is busy, wait */ if (td->channel == -1) @@ -1419,7 +1430,7 @@ musbotg_dev_data_rx(struct musbotg_td *t sc = MUSBOTG_PC2SC(td->pc); if (td->channel == -1) - td->channel = musbotg_channel_alloc(sc, td); + td->channel = musbotg_channel_alloc(sc, td, 0); /* EP0 is busy, wait */ if (td->channel == -1) @@ -1567,7 +1578,7 @@ musbotg_dev_data_tx(struct musbotg_td *t sc = MUSBOTG_PC2SC(td->pc); if (td->channel == -1) - td->channel = musbotg_channel_alloc(sc, td); + td->channel = musbotg_channel_alloc(sc, td, 1); /* EP0 is busy, wait */ if (td->channel == -1) @@ -1695,7 +1706,7 @@ musbotg_host_data_rx(struct musbotg_td * sc = MUSBOTG_PC2SC(td->pc); if (td->channel == -1) - td->channel = musbotg_channel_alloc(sc, td); + td->channel = musbotg_channel_alloc(sc, td, 0); /* No free EPs */ if (td->channel == -1) @@ -1917,7 +1928,7 @@ musbotg_host_data_tx(struct musbotg_td * sc = MUSBOTG_PC2SC(td->pc); if (td->channel == -1) - td->channel = musbotg_channel_alloc(sc, td); + td->channel = musbotg_channel_alloc(sc, td, 1); /* No free EPs */ if (td->channel == -1) @@ -3226,6 +3237,7 @@ musbotg_init(struct musbotg_softc *sc) pf->support_out = 1; } else if (frx && (temp <= nrx)) { pf->max_out_frame_size = 1 << frx; + pf->max_in_frame_size = 0; pf->is_simplex = 1; /* simplex */ pf->support_multi_buffer = 1; pf->support_bulk = 1; @@ -3234,6 +3246,7 @@ musbotg_init(struct musbotg_softc *sc) pf->support_out = 1; } else if (ftx && (temp <= ntx)) { pf->max_in_frame_size = 1 << ftx; + pf->max_out_frame_size = 0; pf->is_simplex = 1; /* simplex */ pf->support_multi_buffer = 1; pf->support_bulk = 1; @@ -3287,18 +3300,6 @@ musbotg_uninit(struct musbotg_softc *sc) } static void -musbotg_suspend(struct musbotg_softc *sc) -{ - /* TODO */ -} - -static void -musbotg_resume(struct musbotg_softc *sc) -{ - /* TODO */ -} - -static void musbotg_do_poll(struct usb_bus *bus) { struct musbotg_softc *sc = MUSBOTG_BUS2SC(bus); @@ -4214,13 +4215,13 @@ musbotg_set_hw_power_sleep(struct usb_bu switch (state) { case USB_HW_POWER_SUSPEND: - musbotg_suspend(sc); + musbotg_uninit(sc); break; case USB_HW_POWER_SHUTDOWN: musbotg_uninit(sc); break; case USB_HW_POWER_RESUME: - musbotg_resume(sc); + musbotg_init(sc); break; default: break; Modified: head/sys/dev/usb/controller/musb_otg.h ============================================================================== --- head/sys/dev/usb/controller/musb_otg.h Thu Jun 5 18:19:48 2014 (r267121) +++ head/sys/dev/usb/controller/musb_otg.h Thu Jun 5 18:23:51 2014 (r267122) @@ -388,7 +388,7 @@ struct musbotg_flags { struct musbotg_softc { struct usb_bus sc_bus; union musbotg_hub_temp sc_hub_temp; - struct usb_hw_ep_profile sc_hw_ep_profile[16]; + struct usb_hw_ep_profile sc_hw_ep_profile[MUSB2_EP_MAX]; struct usb_device *sc_devices[MUSB2_MAX_DEVICES]; struct resource *sc_io_res; From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 18:38:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 929EFC6A; Thu, 5 Jun 2014 18:38:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 739BD2CC7; Thu, 5 Jun 2014 18:38:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55IcS4o014711; Thu, 5 Jun 2014 18:38:28 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55IcSJT014710; Thu, 5 Jun 2014 18:38:28 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406051838.s55IcSJT014710@svn.freebsd.org> From: Ed Maste Date: Thu, 5 Jun 2014 18:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267123 - head/tools/tools/vt/fontcvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 18:38:28 -0000 Author: emaste Date: Thu Jun 5 18:38:27 2014 New Revision: 267123 URL: http://svnweb.freebsd.org/changeset/base/267123 Log: Support "GNU Unifont" format font data The GNU Unifont .hex format is a text file. Each line represents one glyph and consists of a four-digit hex code point, a colon, and pairs of hex digits representing the bitmap. By default an 8x16 font is assumed, with 16x16 double-width glyphs, resulting in either 32 or 64 hex digits for the bitmap. Our version of the file format supports comments at the top of the file to set the height and width: # Height: # Width: Each row of bitmap data is rounded up to byte width - for example, a 10-pixel wide font uses 4 characters per row. See http://czyborra.com/unifont/ for more background on the original format. Sponsored by: The FreeBSD Foundation Modified: head/tools/tools/vt/fontcvt/fontcvt.c Modified: head/tools/tools/vt/fontcvt/fontcvt.c ============================================================================== --- head/tools/tools/vt/fontcvt/fontcvt.c Thu Jun 5 18:23:51 2014 (r267122) +++ head/tools/tools/vt/fontcvt/fontcvt.c Thu Jun 5 18:38:27 2014 (r267123) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009 The FreeBSD Foundation + * Copyright (c) 2009, 2014 The FreeBSD Foundation * All rights reserved. * * This software was developed by Ed Schouten under sponsorship from the @@ -179,6 +179,30 @@ add_glyph(const uint8_t *bytes, unsigned } static int +add_char(unsigned curchar, unsigned map_idx, uint8_t *bytes, uint8_t *bytes_r) +{ + struct glyph *gl; + + /* Prevent adding two glyphs for 0xFFFD */ + if (curchar == 0xFFFD) { + if (map_idx < VFNT_MAP_BOLD) + gl = add_glyph(bytes, 0, 1); + } else if (curchar >= 0x20) { + gl = add_glyph(bytes, map_idx, 0); + if (add_mapping(gl, curchar, map_idx) != 0) + return (1); + if (bytes_r != NULL) { + gl = add_glyph(bytes_r, map_idx + 1, 0); + if (add_mapping(gl, curchar, + map_idx + 1) != 0) + return (1); + } + } + return (0); +} + + +static int parse_bitmap_line(uint8_t *left, uint8_t *right, unsigned int line, unsigned int dwidth) { @@ -218,20 +242,12 @@ parse_bitmap_line(uint8_t *left, uint8_t } static int -parse_bdf(const char *filename, unsigned int map_idx) +parse_bdf(FILE *fp, unsigned int map_idx) { - FILE *fp; char *ln; size_t length; uint8_t bytes[wbytes * height], bytes_r[wbytes * height]; unsigned int curchar = 0, dwidth = 0, i, line; - struct glyph *gl; - - fp = fopen(filename, "r"); - if (fp == NULL) { - perror(filename); - return (1); - } while ((ln = fgetln(fp, &length)) != NULL) { ln[length - 1] = '\0'; @@ -257,27 +273,73 @@ parse_bdf(const char *filename, unsigned return (1); } - /* Prevent adding two glyphs for 0xFFFD */ - if (curchar == 0xFFFD) { - if (map_idx < VFNT_MAP_BOLD) - gl = add_glyph(bytes, 0, 1); - } else if (curchar >= 0x20) { - gl = add_glyph(bytes, map_idx, 0); - if (add_mapping(gl, curchar, map_idx) != 0) + if (add_char(curchar, map_idx, bytes, + dwidth == width * 2 ? bytes_r : NULL) != 0) + return (1); + } + } + + return (0); +} + +static int +parse_hex(FILE *fp, unsigned int map_idx) +{ + char *ln, *p; + char fmt_str[8]; + size_t length; + uint8_t bytes[wbytes * height], bytes_r[wbytes * height]; + unsigned curchar = 0, i, line, chars_per_row, dwidth; + + while ((ln = fgetln(fp, &length)) != NULL) { + ln[length - 1] = '\0'; + + if (strncmp(ln, "# Height: ", 10) == 0) { + height = atoi(ln + 10); + } else if (strncmp(ln, "# Width: ", 9) == 0) { + width = atoi(ln + 9); + } else if (sscanf(ln, "%4x:", &curchar)) { + p = ln + 5; + chars_per_row = strlen(p) / height; + dwidth = width; + if (chars_per_row / 2 > width / 8) + dwidth *= 2; /* Double-width character. */ + snprintf(fmt_str, sizeof(fmt_str), "%%%ux", + chars_per_row); + + for (i = 0; i < height; i++) { + sscanf(p, fmt_str, &line); + p += chars_per_row; + if (parse_bitmap_line(bytes + i * wbytes, + bytes_r + i * wbytes, line, dwidth) != 0) return (1); - if (dwidth == width * 2) { - gl = add_glyph(bytes_r, map_idx + 1, 0); - if (add_mapping(gl, curchar, - map_idx + 1) != 0) - return (1); - } } + + if (add_char(curchar, map_idx, bytes, + dwidth == width * 2 ? bytes_r : NULL) != 0) + return (1); } } - return (0); } +static int +parse_file(const char *filename, unsigned int map_idx) +{ + FILE *fp; + size_t len; + + fp = fopen(filename, "r"); + if (fp == NULL) { + perror(filename); + return (1); + } + len = strlen(filename); + if (len > 4 && strcasecmp(filename + len - 4, ".hex") == 0) + return parse_hex(fp, map_idx); + return parse_bdf(fp, map_idx); +} + static void number_glyphs(void) { @@ -416,12 +478,12 @@ main(int argc, char *argv[]) wbytes = howmany(width, 8); - if (parse_bdf(argv[0], VFNT_MAP_NORMAL) != 0) + if (parse_file(argv[0], VFNT_MAP_NORMAL) != 0) return (1); argc--; argv++; if (argc == 2) { - if (parse_bdf(argv[0], VFNT_MAP_BOLD) != 0) + if (parse_file(argv[0], VFNT_MAP_BOLD) != 0) return (1); argc--; argv++; From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 18:53:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7642F3CD; Thu, 5 Jun 2014 18:53:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49C032E97; Thu, 5 Jun 2014 18:53:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55IrvJY023266; Thu, 5 Jun 2014 18:53:57 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55Irutx023262; Thu, 5 Jun 2014 18:53:56 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406051853.s55Irutx023262@svn.freebsd.org> From: Ed Maste Date: Thu, 5 Jun 2014 18:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267124 - in head: etc/mtree share share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 18:53:57 -0000 Author: emaste Date: Thu Jun 5 18:53:56 2014 New Revision: 267124 URL: http://svnweb.freebsd.org/changeset/base/267124 Log: Install VT support files They can be disabled by setting WITHOUT_VT_SUPPORT=yes in src.conf. Sponsored by: The FreeBSD Foundation Added: head/tools/build/options/WITHOUT_VT_SUPPORT (contents, props changed) Modified: head/etc/mtree/BSD.usr.dist head/share/Makefile head/share/mk/src.opts.mk Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Thu Jun 5 18:38:27 2014 (r267123) +++ head/etc/mtree/BSD.usr.dist Thu Jun 5 18:53:56 2014 (r267124) @@ -1408,6 +1408,12 @@ catalog .. .. + vt + fonts + .. + keymaps + .. + .. zoneinfo Africa .. Modified: head/share/Makefile ============================================================================== --- head/share/Makefile Thu Jun 5 18:38:27 2014 (r267123) +++ head/share/Makefile Thu Jun 5 18:53:56 2014 (r267124) @@ -28,6 +28,7 @@ SUBDIR= ${_colldef} \ termcap \ ${_tests} \ ${_timedef} \ + ${_vt} \ ${_zoneinfo} # NB: keep these sorted by MK_* knobs @@ -85,6 +86,10 @@ _syscons= syscons _tests= tests .endif +.if ${MK_VT_SUPPORT} != "no" +_vt= vt +.endif + .if ${MK_ZONEINFO} != "no" _zoneinfo= zoneinfo .endif Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Jun 5 18:38:27 2014 (r267123) +++ head/share/mk/src.opts.mk Thu Jun 5 18:53:56 2014 (r267124) @@ -148,6 +148,7 @@ __DEFAULT_YES_OPTIONS = \ USB \ UTMPX \ VI \ + VT_SUPPORT \ WIRELESS \ WPA_SUPPLICANT_EAPOL \ ZFS \ Added: head/tools/build/options/WITHOUT_VT_SUPPORT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_VT_SUPPORT Thu Jun 5 18:53:56 2014 (r267124) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr vt 4 +support files (fonts). From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 18:59:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7990667; Thu, 5 Jun 2014 18:59:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5E502EC8; Thu, 5 Jun 2014 18:59:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55IxL0V024156; Thu, 5 Jun 2014 18:59:21 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55IxLoi024155; Thu, 5 Jun 2014 18:59:21 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406051859.s55IxLoi024155@svn.freebsd.org> From: Ed Maste Date: Thu, 5 Jun 2014 18:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267125 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 18:59:21 -0000 Author: emaste Date: Thu Jun 5 18:59:21 2014 New Revision: 267125 URL: http://svnweb.freebsd.org/changeset/base/267125 Log: Regen after r267124 for WITHOUT_VT_SUPPORT Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Jun 5 18:53:56 2014 (r267124) +++ head/share/man/man5/src.conf.5 Thu Jun 5 18:59:21 2014 (r267125) @@ -1085,6 +1085,11 @@ and .It Va WITHOUT_VI .\" from FreeBSD: head/tools/build/options/WITHOUT_VI 264903 2014-04-24 23:17:40Z imp Set to not build and install vi, view, ex and related programs. +.It Va WITHOUT_VT_SUPPORT +.\" from FreeBSD: head/tools/build/options/WITHOUT_VT_SUPPORT 267124 2014-06-05 18:53:56Z emaste +Set to not build +.Xr vt 4 +support files (fonts). .It Va WITHOUT_WARNS .\" from FreeBSD: head/tools/build/options/WITHOUT_WARNS 265830 2014-05-10 16:37:53Z imp Set this to not add warning flags to the compiler invocations. From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 19:38:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72C2D9B5; Thu, 5 Jun 2014 19:38:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60AD82120; Thu, 5 Jun 2014 19:38:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55Jcj2F042957; Thu, 5 Jun 2014 19:38:45 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55Jcj1h042956; Thu, 5 Jun 2014 19:38:45 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406051938.s55Jcj1h042956@svn.freebsd.org> From: Ed Maste Date: Thu, 5 Jun 2014 19:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267126 - head/tools/tools/vt/fontcvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 19:38:45 -0000 Author: emaste Date: Thu Jun 5 19:38:44 2014 New Revision: 267126 URL: http://svnweb.freebsd.org/changeset/base/267126 Log: vt fontcvt: Accept space after BITMAP in .bdf parser The Unifont BDF generator incorrectly adds a space after BITMAP, and and that error has been widely propagated. Modified: head/tools/tools/vt/fontcvt/fontcvt.c Modified: head/tools/tools/vt/fontcvt/fontcvt.c ============================================================================== --- head/tools/tools/vt/fontcvt/fontcvt.c Thu Jun 5 18:59:21 2014 (r267125) +++ head/tools/tools/vt/fontcvt/fontcvt.c Thu Jun 5 19:38:44 2014 (r267126) @@ -260,7 +260,8 @@ parse_bdf(FILE *fp, unsigned int map_idx dwidth = atoi(ln + 7); } - if (strcmp(ln, "BITMAP") == 0) { + if (strncmp(ln, "BITMAP", 6) == 0 && + (ln[6] == ' ' || ln[6] == '\0')) { for (i = 0; i < height; i++) { if ((ln = fgetln(fp, &length)) == NULL) { fprintf(stderr, "Unexpected EOF!\n"); From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 20:27:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 152CB73B; Thu, 5 Jun 2014 20:27:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02DC525FD; Thu, 5 Jun 2014 20:27:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55KRGaM064457; Thu, 5 Jun 2014 20:27:16 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55KRGlA064455; Thu, 5 Jun 2014 20:27:16 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201406052027.s55KRGlA064455@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 5 Jun 2014 20:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267127 - head/lib/libfetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 20:27:17 -0000 Author: des Date: Thu Jun 5 20:27:16 2014 New Revision: 267127 URL: http://svnweb.freebsd.org/changeset/base/267127 Log: If HTTP_USER_AGENT is defined but empty, don't send User-Agent at all. PR: 184507 Submitted by: jbeich@tormail.org (with modifications) MFC after: 1 week Modified: head/lib/libfetch/fetch.3 head/lib/libfetch/http.c Modified: head/lib/libfetch/fetch.3 ============================================================================== --- head/lib/libfetch/fetch.3 Thu Jun 5 19:38:44 2014 (r267126) +++ head/lib/libfetch/fetch.3 Thu Jun 5 20:27:16 2014 (r267127) @@ -627,6 +627,7 @@ the document URL will be used as referre Specifies the User-Agent string to use for HTTP requests. This can be useful when working with HTTP origin or proxy servers that differentiate between user agents. +If defined but empty, no User-Agent header is sent. .It Ev NETRC Specifies a file to use instead of .Pa ~/.netrc Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Thu Jun 5 19:38:44 2014 (r267126) +++ head/lib/libfetch/http.c Thu Jun 5 20:27:16 2014 (r267127) @@ -1683,10 +1683,15 @@ http_request(struct url *URL, const char else http_cmd(conn, "Referer: %s", p); } - if ((p = getenv("HTTP_USER_AGENT")) != NULL && *p != '\0') - http_cmd(conn, "User-Agent: %s", p); - else - http_cmd(conn, "User-Agent: %s " _LIBFETCH_VER, getprogname()); + if ((p = getenv("HTTP_USER_AGENT")) != NULL) { + /* no User-Agent if defined but empty */ + if (*p != '\0') + http_cmd(conn, "User-Agent: %s", p); + } else { + /* default User-Agent */ + http_cmd(conn, "User-Agent: %s " _LIBFETCH_VER, + getprogname()); + } if (url->offset > 0) http_cmd(conn, "Range: bytes=%lld-", (long long)url->offset); http_cmd(conn, "Connection: close"); From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 21:12:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C4BC3A2; Thu, 5 Jun 2014 21:12:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 690302B1E; Thu, 5 Jun 2014 21:12:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55LChDL087904; Thu, 5 Jun 2014 21:12:43 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55LCfIU087896; Thu, 5 Jun 2014 21:12:42 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406052112.s55LCfIU087896@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 5 Jun 2014 21:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267128 - in head/sys: dev/netmap net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 21:12:43 -0000 Author: luigi Date: Thu Jun 5 21:12:41 2014 New Revision: 267128 URL: http://svnweb.freebsd.org/changeset/base/267128 Log: whitespace change: remove trailing whitespace Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_mem2.c head/sys/dev/netmap/netmap_pipe.c head/sys/dev/netmap/netmap_vale.c head/sys/net/netmap.h head/sys/net/netmap_user.h Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Thu Jun 5 20:27:16 2014 (r267127) +++ head/sys/dev/netmap/netmap.c Thu Jun 5 21:12:41 2014 (r267128) @@ -1019,7 +1019,7 @@ netmap_rxsync_from_host(struct netmap_ad nm_i = kring->nr_hwtail; stop_i = nm_prev(nm_i, lim); - while ( nm_i != stop_i && (m = mbq_dequeue(q)) != NULL ) { + while ( nm_i != stop_i && (m = mbq_dequeue(q)) != NULL ) { int len = MBUF_LEN(m); struct netmap_slot *slot = &ring->slot[nm_i]; @@ -1515,7 +1515,7 @@ netmap_set_ringid(struct netmap_priv_d * if (nm_rx_si_user(priv)) na->rx_si_users++; if (netmap_verbose) { - D("%s: tx [%d,%d) rx [%d,%d) id %d", + D("%s: tx [%d,%d) rx [%d,%d) id %d", NM_IFPNAME(na->ifp), priv->np_txqfirst, priv->np_txqlast, @@ -2120,7 +2120,7 @@ do_retry_rx: * Transparent mode: marked bufs on rx rings between * kring->nr_hwcur and ring->head * are passed to the other endpoint. - * + * * In this mode we also scan the sw rxring, which in * turn passes packets up. * Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Thu Jun 5 20:27:16 2014 (r267127) +++ head/sys/dev/netmap/netmap_kern.h Thu Jun 5 21:12:41 2014 (r267128) @@ -678,7 +678,7 @@ static inline uint32_t nm_kr_rxspace(struct netmap_kring *k) { int space = k->nr_hwtail - k->nr_hwcur; - if (space < 0) + if (space < 0) space += k->nkr_num_slots; ND("preserving %d rx slots %d -> %d", space, k->nr_hwcur, k->nr_hwtail); @@ -827,7 +827,7 @@ nm_txsync_finalize(struct netmap_kring * { /* update ring tail to what the kernel knows */ kring->ring->tail = kring->rtail = kring->nr_hwtail; - + /* note, head/rhead/hwcur might be behind cur/rcur * if no carrier */ Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Thu Jun 5 20:27:16 2014 (r267127) +++ head/sys/dev/netmap/netmap_mem2.c Thu Jun 5 21:12:41 2014 (r267128) @@ -992,7 +992,7 @@ netmap_mem_private_new(const char *name, if (p[NETMAP_RING_POOL].num < v) p[NETMAP_RING_POOL].num = v; /* for each pipe we only need the buffers for the 4 "real" rings. - * On the other end, the pipe ring dimension may be different from + * On the other end, the pipe ring dimension may be different from * the parent port ring dimension. As a compromise, we allocate twice the * space actually needed if the pipe rings were the same size as the parent rings */ Modified: head/sys/dev/netmap/netmap_pipe.c ============================================================================== --- head/sys/dev/netmap/netmap_pipe.c Thu Jun 5 20:27:16 2014 (r267127) +++ head/sys/dev/netmap/netmap_pipe.c Thu Jun 5 21:12:41 2014 (r267128) @@ -391,7 +391,7 @@ err: /* netmap_pipe_reg. * * There are two cases on registration (onoff==1) - * + * * 1.a) state is * * usr1 --> e1 --> e2 @@ -403,7 +403,7 @@ err: * usr1 --> e1 --> e2 <-- usr2 * * and we are e2. Drop the ref e1 is holding. - * + * * There are two additional cases on unregister (onoff==0) * * 2.a) state is @@ -462,14 +462,14 @@ netmap_pipe_reg(struct netmap_adapter *n * * 1) state is * - * usr1 --> e1 --> e2 + * usr1 --> e1 --> e2 * - * and we are e1 (e2 is not registered, so krings_delete cannot be + * and we are e1 (e2 is not registered, so krings_delete cannot be * called on it); * * 2) state is * - * usr1 --> e1 e2 <-- usr2 + * usr1 --> e1 e2 <-- usr2 * * and we are either e1 or e2. * @@ -519,7 +519,7 @@ netmap_pipe_dtor(struct netmap_adapter * pna->peer_ref = 0; netmap_adapter_put(&pna->peer->up); } - if (pna->role == NR_REG_PIPE_MASTER) + if (pna->role == NR_REG_PIPE_MASTER) netmap_pipe_remove(pna->parent, pna); netmap_adapter_put(pna->parent); free(na->ifp, M_DEVBUF); @@ -587,7 +587,7 @@ netmap_get_pipe_na(struct nmreq *nmr, st error = ENODEV; goto put_out; } - /* we create both master and slave. + /* we create both master and slave. * The endpoint we were asked for holds a reference to * the other one. */ Modified: head/sys/dev/netmap/netmap_vale.c ============================================================================== --- head/sys/dev/netmap/netmap_vale.c Thu Jun 5 20:27:16 2014 (r267127) +++ head/sys/dev/netmap/netmap_vale.c Thu Jun 5 21:12:41 2014 (r267128) @@ -1783,7 +1783,7 @@ netmap_bwrap_intr_notify(struct netmap_a if (is_host_ring) { vpna = hostna; ring_nr = 0; - } + } /* simulate a user wakeup on the rx ring */ /* fetch packets that have arrived. * XXX maybe do this in a loop ? Modified: head/sys/net/netmap.h ============================================================================== --- head/sys/net/netmap.h Thu Jun 5 20:27:16 2014 (r267127) +++ head/sys/net/netmap.h Thu Jun 5 21:12:41 2014 (r267128) @@ -447,7 +447,7 @@ struct netmap_if { * * nr_arg1, nr_arg2, nr_arg3 (in/out) command specific * - * + * * */ @@ -467,7 +467,7 @@ struct netmap_if { * *** INVALID 0xA000 * one pipe ring, slave 0xC000 ring index * *** INVALID 0xE000 - * + * */ struct nmreq { char nr_name[IFNAMSIZ]; Modified: head/sys/net/netmap_user.h ============================================================================== --- head/sys/net/netmap_user.h Thu Jun 5 20:27:16 2014 (r267127) +++ head/sys/net/netmap_user.h Thu Jun 5 21:12:41 2014 (r267128) @@ -293,7 +293,7 @@ typedef void (*nm_cb_t)(u_char *, const * if passed a netmap_desc with mem != NULL, * use that memory instead of mmap. */ - + static struct nm_desc *nm_open(const char *ifname, const struct nmreq *req, uint64_t flags, const struct nm_desc *arg); @@ -531,7 +531,7 @@ nm_open(const char *ifname, const struct } } #endif /* debugging */ - + d->cur_tx_ring = d->first_tx_ring; d->cur_rx_ring = d->first_rx_ring; return d; From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 21:35:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1AF2B23; Thu, 5 Jun 2014 21:35:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF5FA2D0A; Thu, 5 Jun 2014 21:35:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55LZAL5097498; Thu, 5 Jun 2014 21:35:10 GMT (envelope-from zbb@svn.freebsd.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55LZAEv097496; Thu, 5 Jun 2014 21:35:10 GMT (envelope-from zbb@svn.freebsd.org) Message-Id: <201406052135.s55LZAEv097496@svn.freebsd.org> From: Zbigniew Bodek Date: Thu, 5 Jun 2014 21:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267129 - head/sys/arm/mv/armadaxp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 21:35:11 -0000 Author: zbb Date: Thu Jun 5 21:35:10 2014 New Revision: 267129 URL: http://svnweb.freebsd.org/changeset/base/267129 Log: Fix broken SMP startup on Armada XP after r265694 During Armada's platform_mp_start_ap(), mptramp code is being copied to the specific physical location (0xffff0000). Before r265694 the address to which the code should be copied was equal to the address of mpentry routine that followed the mptramp in locore.S. Now the mptramp end address should be exported and used as a copy limit. Reviewed by: gber Modified: head/sys/arm/mv/armadaxp/armadaxp_mp.c head/sys/arm/mv/armadaxp/mptramp.S Modified: head/sys/arm/mv/armadaxp/armadaxp_mp.c ============================================================================== --- head/sys/arm/mv/armadaxp/armadaxp_mp.c Thu Jun 5 21:12:41 2014 (r267128) +++ head/sys/arm/mv/armadaxp/armadaxp_mp.c Thu Jun 5 21:35:10 2014 (r267129) @@ -97,8 +97,7 @@ platform_mp_init_secondary(void) } void mptramp(void); - - +void mptramp_end(void); void platform_mp_start_ap(void) @@ -116,7 +115,7 @@ platform_mp_start_ap(void) pmap_kenter_nocache(smp_boot, 0xffff0000); dst = (uint32_t *) smp_boot; - for (src = (uint32_t *)mptramp; src < (uint32_t *)mpentry; + for (src = (uint32_t *)mptramp; src < (uint32_t *)mptramp_end; src++, dst++) { *dst = *src; } Modified: head/sys/arm/mv/armadaxp/mptramp.S ============================================================================== --- head/sys/arm/mv/armadaxp/mptramp.S Thu Jun 5 21:12:41 2014 (r267128) +++ head/sys/arm/mv/armadaxp/mptramp.S Thu Jun 5 21:35:10 2014 (r267129) @@ -54,3 +54,5 @@ Lpmureg: .word 0xd0022124 END(mptramp) + .global _C_LABEL(mptramp_end) +_C_LABEL(mptramp_end): From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 21:37:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4D80F4F; Thu, 5 Jun 2014 21:37:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 889A32D47; Thu, 5 Jun 2014 21:37:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55Lb5iP098140; Thu, 5 Jun 2014 21:37:05 GMT (envelope-from zbb@svn.freebsd.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55Lb5jB098138; Thu, 5 Jun 2014 21:37:05 GMT (envelope-from zbb@svn.freebsd.org) Message-Id: <201406052137.s55Lb5jB098138@svn.freebsd.org> From: Zbigniew Bodek Date: Thu, 5 Jun 2014 21:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267130 - head/sys/arm/mv/armadaxp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 21:37:05 -0000 Author: zbb Date: Thu Jun 5 21:37:04 2014 New Revision: 267130 URL: http://svnweb.freebsd.org/changeset/base/267130 Log: Avoid using hard-coded SoC's register address in mptramp code for Armada XP SoC's registers base address may differ between boards (0xf1000000 or 0xd0000000). Therefore, in order to use the proper CPU Boot Address Redirect register during SMP initialization in mptramp the real, physical address has to be passed to mptramp based on the value from DT. Reviewed by: gber Modified: head/sys/arm/mv/armadaxp/armadaxp_mp.c head/sys/arm/mv/armadaxp/mptramp.S Modified: head/sys/arm/mv/armadaxp/armadaxp_mp.c ============================================================================== --- head/sys/arm/mv/armadaxp/armadaxp_mp.c Thu Jun 5 21:35:10 2014 (r267129) +++ head/sys/arm/mv/armadaxp/armadaxp_mp.c Thu Jun 5 21:37:04 2014 (r267130) @@ -37,6 +37,8 @@ #include #include +#include + #include #include #include @@ -98,12 +100,13 @@ platform_mp_init_secondary(void) void mptramp(void); void mptramp_end(void); +extern vm_offset_t mptramp_pmu_boot; void platform_mp_start_ap(void) { uint32_t reg, *src, *dst, cpu_num, div_val, cputype; - vm_offset_t smp_boot; + vm_offset_t smp_boot, pmu_boot_off; /* * Initialization procedure depends on core revision, * in this step CHIP ID is checked to choose proper procedure @@ -114,6 +117,12 @@ platform_mp_start_ap(void) smp_boot = kva_alloc(PAGE_SIZE); pmap_kenter_nocache(smp_boot, 0xffff0000); dst = (uint32_t *) smp_boot; + /* + * Set the PA of CPU0 Boot Address Redirect register used in + * mptramp according to the actual SoC registers' base address. + */ + pmu_boot_off = (CPU_PMU(0) - MV_BASE) + CPU_PMU_BOOT; + mptramp_pmu_boot = fdt_immr_pa + pmu_boot_off; for (src = (uint32_t *)mptramp; src < (uint32_t *)mptramp_end; src++, dst++) { Modified: head/sys/arm/mv/armadaxp/mptramp.S ============================================================================== --- head/sys/arm/mv/armadaxp/mptramp.S Thu Jun 5 21:35:10 2014 (r267129) +++ head/sys/arm/mv/armadaxp/mptramp.S Thu Jun 5 21:37:04 2014 (r267130) @@ -29,6 +29,8 @@ __FBSDID("$FreeBSD$"); +.global _C_LABEL(mptramp_pmu_boot) + ASENTRY_NP(mptramp) mov r0, #0 mcr p15, 0, r0, c7, c7, 0 @@ -44,14 +46,15 @@ ASENTRY_NP(mptramp) /* Read boot address for CPU */ mov r1, #0x100 mul r2, r0, r1 - ldr r1, Lpmureg + ldr r1, mptramp_pmu_boot add r0, r2, r1 ldr r1, [r0], #0x00 mov pc, r1 -Lpmureg: - .word 0xd0022124 +_C_LABEL(mptramp_pmu_boot): + .word 0x0 + END(mptramp) .global _C_LABEL(mptramp_end) From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 22:10:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AE13BBB; Thu, 5 Jun 2014 22:10:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 089BA204E; Thu, 5 Jun 2014 22:10:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55MAPQB012810; Thu, 5 Jun 2014 22:10:25 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55MAPM1012809; Thu, 5 Jun 2014 22:10:25 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201406052210.s55MAPM1012809@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 5 Jun 2014 22:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267131 - head/lib/libfetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 22:10:26 -0000 Author: bapt Date: Thu Jun 5 22:10:25 2014 New Revision: 267131 URL: http://svnweb.freebsd.org/changeset/base/267131 Log: Use NULL instead of 0 Patch by Sascha Wildner for Dragonfly Reviewed by: des Obtained from: Dragonfly MFC after: 1 week Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Thu Jun 5 21:37:04 2014 (r267130) +++ head/lib/libfetch/http.c Thu Jun 5 22:10:25 2014 (r267131) @@ -1030,7 +1030,7 @@ typedef struct { static void init_http_auth_params(http_auth_params_t *s) { - s->scheme = s->realm = s->user = s->password = 0; + s->scheme = s->realm = s->user = s->password = NULL; } static void @@ -1249,7 +1249,7 @@ http_digest_auth(conn_t *conn, const cha int r; char noncecount[10]; char cnonce[40]; - char *options = 0; + char *options = NULL; if (!c->realm || !c->nonce) { DEBUG(fprintf(stderr, "realm/nonce not set in challenge\n")); From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 22:13:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 265C4D55; Thu, 5 Jun 2014 22:13:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13AC420DB; Thu, 5 Jun 2014 22:13:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55MDUiU016426; Thu, 5 Jun 2014 22:13:30 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55MDUV6016425; Thu, 5 Jun 2014 22:13:30 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201406052213.s55MDUV6016425@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 5 Jun 2014 22:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267132 - head/lib/libfetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 22:13:31 -0000 Author: bapt Date: Thu Jun 5 22:13:30 2014 New Revision: 267132 URL: http://svnweb.freebsd.org/changeset/base/267132 Log: Remove unnecessary semicolons Patch by Sascha Wildner for Dragonfly Reviewed by: des Obtained from: Dragonfly MFC after: 1 week Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Thu Jun 5 22:10:25 2014 (r267131) +++ head/lib/libfetch/http.c Thu Jun 5 22:13:30 2014 (r267132) @@ -1129,7 +1129,7 @@ CvtHex(IN HASH Bin, OUT HASHHEX Hex) Hex[i*2] = hexchars[j]; j = Bin[i] & 0xf; Hex[i*2+1] = hexchars[j]; - }; + } Hex[HASHHEXLEN] = '\0'; }; @@ -1164,7 +1164,7 @@ DigestCalcHA1( MD5Update(&Md5Ctx, ":", 1); MD5Update(&Md5Ctx, pszCNonce, strlen(pszCNonce)); MD5Final(HA1, &Md5Ctx); - }; + } CvtHex(HA1, SessionKey); } @@ -1198,7 +1198,7 @@ DigestCalcResponse( if (strcasecmp(pszQop, "auth-int") == 0) { MD5Update(&Md5Ctx, ":", 1); MD5Update(&Md5Ctx, HEntity, HASHHEXLEN); - }; + } MD5Final(HA2, &Md5Ctx); CvtHex(HA2, HA2Hex); @@ -1215,7 +1215,7 @@ DigestCalcResponse( MD5Update(&Md5Ctx, ":", 1); MD5Update(&Md5Ctx, pszQop, strlen(pszQop)); MD5Update(&Md5Ctx, ":", 1); - }; + } MD5Update(&Md5Ctx, HA2Hex, HASHHEXLEN); MD5Final(RespHash, &Md5Ctx); CvtHex(RespHash, Response); From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 22:16:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4490BE; Thu, 5 Jun 2014 22:16:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A18842113; Thu, 5 Jun 2014 22:16:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55MGR7G017094; Thu, 5 Jun 2014 22:16:27 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55MGRiK017091; Thu, 5 Jun 2014 22:16:27 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201406052216.s55MGRiK017091@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 5 Jun 2014 22:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267133 - head/lib/libfetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 22:16:27 -0000 Author: bapt Date: Thu Jun 5 22:16:26 2014 New Revision: 267133 URL: http://svnweb.freebsd.org/changeset/base/267133 Log: Add support for arbitrary http requests Submitted by: Alex Hornung Reviewed by: des Obtained from: Dragonfly MFC after: 3 week Modified: head/lib/libfetch/common.h head/lib/libfetch/fetch.h head/lib/libfetch/http.c Modified: head/lib/libfetch/common.h ============================================================================== --- head/lib/libfetch/common.h Thu Jun 5 22:13:30 2014 (r267132) +++ head/lib/libfetch/common.h Thu Jun 5 22:16:26 2014 (r267133) @@ -117,6 +117,9 @@ int fetch_no_proxy_match(const char *) */ FILE *http_request(struct url *, const char *, struct url_stat *, struct url *, const char *); +FILE *http_request_body(struct url *, const char *, + struct url_stat *, struct url *, const char *, + const char *, const char *); FILE *ftp_request(struct url *, const char *, struct url_stat *, struct url *, const char *); Modified: head/lib/libfetch/fetch.h ============================================================================== --- head/lib/libfetch/fetch.h Thu Jun 5 22:13:30 2014 (r267132) +++ head/lib/libfetch/fetch.h Thu Jun 5 22:16:26 2014 (r267133) @@ -102,6 +102,8 @@ FILE *fetchGetHTTP(struct url *, const FILE *fetchPutHTTP(struct url *, const char *); int fetchStatHTTP(struct url *, struct url_stat *, const char *); struct url_ent *fetchListHTTP(struct url *, const char *); +FILE *fetchReqHTTP(struct url *, const char *, const char *, + const char *, const char *); /* FTP-specific functions */ FILE *fetchXGetFTP(struct url *, struct url_stat *, const char *); Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Thu Jun 5 22:13:30 2014 (r267132) +++ head/lib/libfetch/http.c Thu Jun 5 22:16:26 2014 (r267133) @@ -1494,6 +1494,14 @@ http_print_html(FILE *out, FILE *in) * Core */ +FILE * +http_request(struct url *URL, const char *op, struct url_stat *us, + struct url *purl, const char *flags) +{ + + return (http_request_body(URL, op, us, purl, flags, NULL, NULL)); +} + /* * Send a request and process the reply * @@ -1501,8 +1509,9 @@ http_print_html(FILE *out, FILE *in) * XXX off into a separate function. */ FILE * -http_request(struct url *URL, const char *op, struct url_stat *us, - struct url *purl, const char *flags) +http_request_body(struct url *URL, const char *op, struct url_stat *us, + struct url *purl, const char *flags, const char *content_type, + const char *body) { char timebuf[80]; char hbuf[MAXHOSTNAMELEN + 7], *host; @@ -1519,6 +1528,7 @@ http_request(struct url *URL, const char http_headerbuf_t headerbuf; http_auth_challenges_t server_challenges; http_auth_challenges_t proxy_challenges; + size_t body_len; /* The following calls don't allocate anything */ init_http_headerbuf(&headerbuf); @@ -1695,8 +1705,19 @@ http_request(struct url *URL, const char if (url->offset > 0) http_cmd(conn, "Range: bytes=%lld-", (long long)url->offset); http_cmd(conn, "Connection: close"); + + if (body) { + body_len = strlen(body); + http_cmd(conn, "Content-Length: %zu", body_len); + if (content_type != NULL) + http_cmd(conn, "Content-Type: %s", content_type); + } + http_cmd(conn, ""); + if (body) + fetch_write(conn, body, body_len); + /* * Force the queued request to be dispatched. Normally, one * would do this with shutdown(2) but squid proxies can be @@ -2047,3 +2068,12 @@ fetchListHTTP(struct url *url __unused, warnx("fetchListHTTP(): not implemented"); return (NULL); } + +FILE * +fetchReqHTTP(struct url *URL, const char *method, const char *flags, + const char *content_type, const char *body) +{ + + return (http_request_body(URL, method, NULL, http_get_proxy(URL, flags), + flags, content_type, body)); +} From owner-svn-src-head@FreeBSD.ORG Thu Jun 5 23:53:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A58D8BB0; Thu, 5 Jun 2014 23:53:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 923602975; Thu, 5 Jun 2014 23:53:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s55Nrl1k062523; Thu, 5 Jun 2014 23:53:47 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s55NrlcY062522; Thu, 5 Jun 2014 23:53:47 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406052353.s55NrlcY062522@svn.freebsd.org> From: Glen Barber Date: Thu, 5 Jun 2014 23:53:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267134 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 23:53:47 -0000 Author: gjb Date: Thu Jun 5 23:53:47 2014 New Revision: 267134 URL: http://svnweb.freebsd.org/changeset/base/267134 Log: Document r266463, newsyslog.conf(5) includes in conf.d. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 5 22:16:26 2014 (r267133) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 5 23:53:47 2014 (r267134) @@ -320,6 +320,12 @@ adds event collection after the specified number of seconds. + The default &man.newsyslog.conf.5; now + includes files in the + /etc/newsyslog.conf.d/ and + /usr/local/etc/newsyslog.conf.d/ + directories by default for &man.newsyslog.8;. + <filename>/etc/rc.d</filename> Scripts From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 00:22:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D2D1A02; Fri, 6 Jun 2014 00:22:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 594852BFA; Fri, 6 Jun 2014 00:22:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s560MKeO077618; Fri, 6 Jun 2014 00:22:20 GMT (envelope-from allanjude@svn.freebsd.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s560MKbi077617; Fri, 6 Jun 2014 00:22:20 GMT (envelope-from allanjude@svn.freebsd.org) Message-Id: <201406060022.s560MKbi077617@svn.freebsd.org> From: Allan Jude Date: Fri, 6 Jun 2014 00:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267141 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 00:22:20 -0000 Author: allanjude (doc committer) Date: Fri Jun 6 00:22:19 2014 New Revision: 267141 URL: http://svnweb.freebsd.org/changeset/base/267141 Log: Style cleanups on ifconfig.8 fix igor warnings uppercase all instances of Ethernet replace bad e.g. CR: D91 Approved by: wblock (mentor) Modified: head/sbin/ifconfig/ifconfig.8 Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Fri Jun 6 00:20:54 2014 (r267140) +++ head/sbin/ifconfig/ifconfig.8 Fri Jun 6 00:22:19 2014 (r267141) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd October 21, 2013 +.Dd June 5, 2014 .Dt IFCONFIG 8 .Os .Sh NAME @@ -141,13 +141,13 @@ The link-level .Pq Dq link address is specified as a series of colon-separated hex digits. -This can be used to -e.g.,\& set a new MAC address on an ethernet interface, though the -mechanism used is not ethernet-specific. +This can be used to, for example, +set a new MAC address on an Ethernet interface, though the +mechanism used is not Ethernet specific. If the interface is already up when this option is used, it will be briefly brought down and then brought back up again in order to ensure that the receive -filter in the underlying ethernet hardware is properly reprogrammed. +filter in the underlying Ethernet hardware is properly reprogrammed. .It Ar address_family Specify the address family @@ -179,7 +179,7 @@ or .Dq lladdr . Specifying .Fl l Dq ether -will list only ethernet interfaces, excluding all other interface types, +will list only Ethernet interfaces, excluding all other interface types, including the loopback interface. .It Ar dest_address Specify the address of the correspondent on the other end @@ -661,7 +661,8 @@ Clear a flag .Cm defaultif . .It Cm ifdisabled Set a flag to disable all of IPv6 network communications on the -specified interface. Note that if there are already configured IPv6 +specified interface. +Note that if there are already configured IPv6 addresses on that interface, all of them are marked as .Dq tentative and DAD will be performed when this flag is cleared. @@ -1087,7 +1088,8 @@ specifies the number of beacon intervals and must be in the range 1 to 15. By default DTIM is 1 (i.e., DTIM occurs at each beacon). .It Cm quiet -Enable the use of quiet IE. Hostap will use this to silence other +Enable the use of quiet IE. +Hostap will use this to silence other stations to reduce interference for radar detection when operating on 5GHz frequency and doth support is enabled. Use @@ -1102,9 +1104,11 @@ scheduled quiet intervals defined by Qui Set the QUIET .Ar count to the number of TBTTs until the beacon interval during which the -next quiet interval shall start. A value of 1 indicates the quiet +next quiet interval shall start. +A value of 1 indicates the quiet interval will start during the beacon interval starting at the next -TBTT. A value 0 is reserved. +TBTT. +A value 0 is reserved. .It Cm quiet_offset Ar offset Set the QUIET .Ar offset @@ -2354,7 +2358,8 @@ Another name for the parameter. .It Cm accept_rev_ethip_ver Set a flag to accept both correct EtherIP packets and ones -with reversed version field. Enabled by default. +with reversed version field. +Enabled by default. This is for backward compatibility with .Fx 6.1 , 6.2, 6.3, 7.0, and 7.1. @@ -2363,7 +2368,8 @@ Clear a flag .Cm accept_rev_ethip_ver . .It Cm send_rev_ethip_ver Set a flag to send EtherIP packets with reversed version -field intentionally. Disabled by default. +field intentionally. +Disabled by default. This is for backward compatibility with .Fx 6.1 , 6.2, 6.3, 7.0, and 7.1. @@ -2446,7 +2452,7 @@ pseudo-interface. The .Xr vlan 4 interface is assigned a -copy of the parent interface's flags and the parent's ethernet address. +copy of the parent interface's flags and the parent's Ethernet address. The .Cm vlandev and @@ -2570,7 +2576,7 @@ If an .Ar address_family is specified, only interfaces of that type will be listed. .Fl l Dq ether -will list only ethernet adapters, excluding the loopback interface. +will list only Ethernet adapters, excluding the loopback interface. Use of this flag is mutually exclusive with all other flags and commands, except for .Fl d From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 00:24:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFF63B6F; Fri, 6 Jun 2014 00:24:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 830192C10; Fri, 6 Jun 2014 00:24:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s560O5mo077926; Fri, 6 Jun 2014 00:24:05 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s560O57I077923; Fri, 6 Jun 2014 00:24:05 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201406060024.s560O57I077923@svn.freebsd.org> From: Andrey Zonov Date: Fri, 6 Jun 2014 00:24:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267142 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 00:24:05 -0000 Author: zont Date: Fri Jun 6 00:24:04 2014 New Revision: 267142 URL: http://svnweb.freebsd.org/changeset/base/267142 Log: Use mtx_lock_spin/mtx_unlock_spin primitives on spin lock Reviewed by: luigi MFC after: 1 week Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_mbq.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Fri Jun 6 00:22:19 2014 (r267141) +++ head/sys/dev/netmap/netmap.c Fri Jun 6 00:24:04 2014 (r267142) @@ -1009,7 +1009,7 @@ netmap_rxsync_from_host(struct netmap_ad (void)pwait; /* disable unused warnings */ (void)td; - mtx_lock(&q->lock); + mtx_lock_spin(&q->lock); /* First part: import newly received packets */ n = mbq_len(q); @@ -1051,7 +1051,7 @@ netmap_rxsync_from_host(struct netmap_ad if (kring->rcur == kring->rtail && td) /* no bufs available */ selrecord(td, &kring->si); - mtx_unlock(&q->lock); + mtx_unlock_spin(&q->lock); return ret; } @@ -2381,7 +2381,7 @@ netmap_transmit(struct ifnet *ifp, struc * not possible on Linux). * Also avoid overflowing the queue. */ - mtx_lock(&q->lock); + mtx_lock_spin(&q->lock); space = kring->nr_hwtail - kring->nr_hwcur; if (space < 0) @@ -2398,7 +2398,7 @@ netmap_transmit(struct ifnet *ifp, struc m = NULL; error = 0; } - mtx_unlock(&q->lock); + mtx_unlock_spin(&q->lock); done: if (m) Modified: head/sys/dev/netmap/netmap_mbq.c ============================================================================== --- head/sys/dev/netmap/netmap_mbq.c Fri Jun 6 00:22:19 2014 (r267141) +++ head/sys/dev/netmap/netmap_mbq.c Fri Jun 6 00:24:04 2014 (r267142) @@ -76,9 +76,9 @@ static inline void __mbq_enqueue(struct void mbq_safe_enqueue(struct mbq *q, struct mbuf *m) { - mtx_lock(&q->lock); + mtx_lock_spin(&q->lock); __mbq_enqueue(q, m); - mtx_unlock(&q->lock); + mtx_unlock_spin(&q->lock); } @@ -110,9 +110,9 @@ struct mbuf *mbq_safe_dequeue(struct mbq { struct mbuf *ret; - mtx_lock(&q->lock); + mtx_lock_spin(&q->lock); ret = __mbq_dequeue(q); - mtx_unlock(&q->lock); + mtx_unlock_spin(&q->lock); return ret; } From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 03:17:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E44255C1; Fri, 6 Jun 2014 03:17:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1B312B15; Fri, 6 Jun 2014 03:17:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s563HbA7059215; Fri, 6 Jun 2014 03:17:37 GMT (envelope-from brd@svn.freebsd.org) Received: (from brd@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s563HbcP059214; Fri, 6 Jun 2014 03:17:37 GMT (envelope-from brd@svn.freebsd.org) Message-Id: <201406060317.s563HbcP059214@svn.freebsd.org> From: Brad Davis Date: Fri, 6 Jun 2014 03:17:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267145 - head/sys/geom/eli X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 03:17:38 -0000 Author: brd (doc committer) Date: Fri Jun 6 03:17:37 2014 New Revision: 267145 URL: http://svnweb.freebsd.org/changeset/base/267145 Log: - Fix the keyfile being cleared prematurely after r259428 PR: 185084 Submitted by: fk@fabiankeil.de Reviewed by: pjd@ Modified: head/sys/geom/eli/g_eli.c Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Fri Jun 6 02:55:18 2014 (r267144) +++ head/sys/geom/eli/g_eli.c Fri Jun 6 03:17:37 2014 (r267145) @@ -990,7 +990,6 @@ g_eli_keyfiles_load(struct hmac_ctx *ctx G_ELI_DEBUG(1, "Loaded keyfile %s for %s (type: %s).", file, provider, name); g_eli_crypto_hmac_update(ctx, data, size); - bzero(data, size); } } @@ -1140,6 +1139,7 @@ g_eli_taste(struct g_class *mp, struct g g_eli_keyfiles_clear(pp->name); return (NULL); } + g_eli_keyfiles_clear(pp->name); G_ELI_DEBUG(1, "Using Master Key %u for %s.", nkey, pp->name); break; } From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 04:08:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8957622; Fri, 6 Jun 2014 04:08:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C97482F3C; Fri, 6 Jun 2014 04:08:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5648uLA082736; Fri, 6 Jun 2014 04:08:56 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5648tci082729; Fri, 6 Jun 2014 04:08:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201406060408.s5648tci082729@svn.freebsd.org> From: Warner Losh Date: Fri, 6 Jun 2014 04:08:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267146 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf sparc64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 04:08:57 -0000 Author: imp Date: Fri Jun 6 04:08:55 2014 New Revision: 267146 URL: http://svnweb.freebsd.org/changeset/base/267146 Log: Restore comments accidentally removed. MFC after: 3 days Modified: head/sys/amd64/conf/GENERIC head/sys/arm/conf/ZEDBOARD head/sys/i386/conf/GENERIC head/sys/i386/conf/XEN head/sys/ia64/conf/GENERIC head/sys/sparc64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri Jun 6 03:17:37 2014 (r267145) +++ head/sys/amd64/conf/GENERIC Fri Jun 6 04:08:55 2014 (r267146) @@ -21,7 +21,7 @@ cpu HAMMER ident GENERIC -makeoptions DEBUG=-g +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support options SCHED_ULE # ULE scheduler Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Fri Jun 6 03:17:37 2014 (r267145) +++ head/sys/arm/conf/ZEDBOARD Fri Jun 6 04:08:55 2014 (r267146) @@ -59,7 +59,7 @@ options VFP # vfp/neon options SMP # Symmetric MultiProcessor Kernel # Debugging -makeoptions DEBUG=-g +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options DDB options KDB # options BREAK_TO_DEBUGGER Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri Jun 6 03:17:37 2014 (r267145) +++ head/sys/i386/conf/GENERIC Fri Jun 6 04:08:55 2014 (r267146) @@ -23,7 +23,7 @@ cpu I586_CPU cpu I686_CPU ident GENERIC -makeoptions DEBUG=-g +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support options SCHED_ULE # ULE scheduler Modified: head/sys/i386/conf/XEN ============================================================================== --- head/sys/i386/conf/XEN Fri Jun 6 03:17:37 2014 (r267145) +++ head/sys/i386/conf/XEN Fri Jun 6 04:08:55 2014 (r267146) @@ -6,7 +6,7 @@ cpu I686_CPU ident XEN -makeoptions DEBUG=-g +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols # The following modules don't build with PAE and XEN enabled. makeoptions WITHOUT_MODULES="ctl dpt drm drm2 hptmv ida malo mwl" Modified: head/sys/ia64/conf/GENERIC ============================================================================== --- head/sys/ia64/conf/GENERIC Fri Jun 6 03:17:37 2014 (r267145) +++ head/sys/ia64/conf/GENERIC Fri Jun 6 04:08:55 2014 (r267146) @@ -23,7 +23,7 @@ cpu ITANIUM2 ident GENERIC -makeoptions DEBUG=-g # Build kernel with debug information. +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options AUDIT # Security event auditing options CAPABILITY_MODE # Capsicum capability mode Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri Jun 6 03:17:37 2014 (r267145) +++ head/sys/sparc64/conf/GENERIC Fri Jun 6 04:08:55 2014 (r267146) @@ -21,7 +21,7 @@ cpu SUN4U ident GENERIC -makeoptions DEBUG=-g +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols # Platforms supported # At this time all platforms are supported, as-is. From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 04:09:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC5B0759; Fri, 6 Jun 2014 04:09:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD2BC2F3E; Fri, 6 Jun 2014 04:09:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56499ST082872; Fri, 6 Jun 2014 04:09:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s564971o082857; Fri, 6 Jun 2014 04:09:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201406060409.s564971o082857@svn.freebsd.org> From: Warner Losh Date: Fri, 6 Jun 2014 04:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267147 - in head: bin/ed lib/libtelnet libexec/telnetd release/picobsd/bridge release/picobsd/qemu usr.bin/telnet usr.sbin/ntp/ntp-keygen usr.sbin/ntp/ntpd usr.sbin/ppp usr.sbin/sendma... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 04:09:10 -0000 Author: imp Date: Fri Jun 6 04:09:07 2014 New Revision: 267147 URL: http://svnweb.freebsd.org/changeset/base/267147 Log: When building picobsd, define WITHOUT_OPENSSL and WITHOUT_KERBEROS and remove the now-redundant checks for RELEASE_CRUNCH. This originally was defined for building smaller sysinstall images, but was later also used by picobsd builds for a similar purpose. Now that we've moved away from sysinstall, picobsd is the only remaining consumer of this interface. Adding these two options reduces the RELEASE_CRUNCH special cases in the tree by half. Modified: head/bin/ed/Makefile head/lib/libtelnet/Makefile head/libexec/telnetd/Makefile head/release/picobsd/bridge/crunch.conf head/release/picobsd/qemu/crunch.conf head/usr.bin/telnet/Makefile head/usr.sbin/ntp/ntp-keygen/Makefile head/usr.sbin/ntp/ntpd/Makefile head/usr.sbin/ppp/Makefile head/usr.sbin/sendmail/Makefile head/usr.sbin/tcpdump/tcpdump/Makefile Modified: head/bin/ed/Makefile ============================================================================== --- head/bin/ed/Makefile Fri Jun 6 04:08:55 2014 (r267146) +++ head/bin/ed/Makefile Fri Jun 6 04:09:07 2014 (r267147) @@ -7,9 +7,7 @@ SRCS= buf.c cbc.c glbl.c io.c main.c re. LINKS= ${BINDIR}/ed ${BINDIR}/red MLINKS= ed.1 red.1 -.if !defined(RELEASE_CRUNCH) && \ - ${MK_OPENSSL} != "no" && \ - ${MK_ED_CRYPTO} != "no" +.if ${MK_OPENSSL} != "no" && ${MK_ED_CRYPTO} != "no" CFLAGS+=-DDES DPADD= ${LIBCRYPTO} LDADD= -lcrypto Modified: head/lib/libtelnet/Makefile ============================================================================== --- head/lib/libtelnet/Makefile Fri Jun 6 04:08:55 2014 (r267146) +++ head/lib/libtelnet/Makefile Fri Jun 6 04:09:07 2014 (r267147) @@ -15,7 +15,6 @@ CFLAGS+= -I${TELNETDIR} WARNS?= 2 -.if !defined(RELEASE_CRUNCH) .if ${MK_OPENSSL} != "no" SRCS+= encrypt.c auth.c enc_des.c sra.c pk.c CFLAGS+= -DENCRYPTION -DAUTHENTICATION -DSRA @@ -26,7 +25,6 @@ SRCS+= kerberos5.c CFLAGS+= -DKRB5 -I${KRB5DIR}/lib/krb5 -I${KRB5OBJDIR} -I${ASN1OBJDIR} CFLAGS+= -DFORWARD -Dnet_write=telnet_net_write .endif -.endif INCS= ${TELNETDIR}/arpa/telnet.h INCSDIR= ${INCLUDEDIR}/arpa Modified: head/libexec/telnetd/Makefile ============================================================================== --- head/libexec/telnetd/Makefile Fri Jun 6 04:08:55 2014 (r267146) +++ head/libexec/telnetd/Makefile Fri Jun 6 04:09:07 2014 (r267147) @@ -31,8 +31,6 @@ LIBTELNET= ${.OBJDIR}/../../lib/libtelne DPADD= ${LIBUTIL} ${LIBTERMCAP} ${LIBTELNET} LDADD= -lutil -ltermcap ${LIBTELNET} -# XXX for src/release/picobsd -.if !defined(RELEASE_CRUNCH) .if ${MK_OPENSSL} != "no" SRCS+= authenc.c CFLAGS+= -DAUTHENTICATION -DENCRYPTION @@ -45,6 +43,5 @@ CFLAGS+= -DKRB5 -DFORWARD -Dnet_write=te DPADD+= ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBROKEN} ${LIBCOM_ERR} LDADD+= -lkrb5 -lhx509 -lasn1 -lroken -lcom_err .endif -.endif .include Modified: head/release/picobsd/bridge/crunch.conf ============================================================================== --- head/release/picobsd/bridge/crunch.conf Fri Jun 6 04:08:55 2014 (r267146) +++ head/release/picobsd/bridge/crunch.conf Fri Jun 6 04:09:07 2014 (r267147) @@ -31,6 +31,7 @@ buildopts -DWITHOUT_PAM -DRELEASE_CRUNCH -DPPP_NO_NETGRAPH buildopts -DTRACEROUTE_NO_IPSEC -DNO_INET6 +buildopts -DWITHOUT_KERBEROS -DWITHOUT_OPENSSL # Directories where to look for sources of various binaries. # @__CWD__@ is a magic keyword in the picobsd's (Makefile.conf) Modified: head/release/picobsd/qemu/crunch.conf ============================================================================== --- head/release/picobsd/qemu/crunch.conf Fri Jun 6 04:08:55 2014 (r267146) +++ head/release/picobsd/qemu/crunch.conf Fri Jun 6 04:09:07 2014 (r267147) @@ -31,6 +31,7 @@ buildopts -DWITHOUT_PAM -DRELEASE_CRUNCH -DPPP_NO_NETGRAPH buildopts -DTRACEROUTE_NO_IPSEC -DNO_INET6 +buildopts -DWITHOUT_KERBEROS -DWITHOUT_OPENSSL # Directories where to look for sources of various binaries. # @__CWD__@ is a magic keyword in the picobsd's (Makefile.conf) Modified: head/usr.bin/telnet/Makefile ============================================================================== --- head/usr.bin/telnet/Makefile Fri Jun 6 04:08:55 2014 (r267146) +++ head/usr.bin/telnet/Makefile Fri Jun 6 04:09:07 2014 (r267147) @@ -34,7 +34,6 @@ SRCS+= genget.c getent.c misc.c CFLAGS+= -DHAS_CGETENT .endif -.if !defined(RELEASE_CRUNCH) .if ${MK_OPENSSL} != "no" SRCS+= authenc.c CFLAGS+= -DENCRYPTION -DAUTHENTICATION -DIPSEC @@ -47,6 +46,5 @@ CFLAGS+= -DKRB5 -DFORWARD -Dnet_write=te DPADD+= ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBCOM_ERR} ${LIBROKEN} LDADD+= -lkrb5 -lhx509 -lasn1 -lcom_err -lroken .endif -.endif .include Modified: head/usr.sbin/ntp/ntp-keygen/Makefile ============================================================================== --- head/usr.sbin/ntp/ntp-keygen/Makefile Fri Jun 6 04:08:55 2014 (r267146) +++ head/usr.sbin/ntp/ntp-keygen/Makefile Fri Jun 6 04:09:07 2014 (r267147) @@ -16,7 +16,7 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/n DPADD= ${LIBNTP} ${LIBOPTS} LDADD= ${LIBNTP} ${LIBOPTS} -.if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH) +.if ${MK_OPENSSL} != "no" DPADD+= ${LIBMD} ${LIBCRYPTO} LDADD+= -lmd -lcrypto .endif Modified: head/usr.sbin/ntp/ntpd/Makefile ============================================================================== --- head/usr.sbin/ntp/ntpd/Makefile Fri Jun 6 04:08:55 2014 (r267146) +++ head/usr.sbin/ntp/ntpd/Makefile Fri Jun 6 04:09:07 2014 (r267147) @@ -35,7 +35,7 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/n DPADD= ${LIBPARSE} ${LIBNTP} ${LIBM} ${LIBMD} ${LIBRT} ${LIBOPTS} LDADD= ${LIBPARSE} ${LIBNTP} -lm -lmd -lrt ${LIBOPTS} -.if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH) +.if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto .endif Modified: head/usr.sbin/ppp/Makefile ============================================================================== --- head/usr.sbin/ppp/Makefile Fri Jun 6 04:08:55 2014 (r267146) +++ head/usr.sbin/ppp/Makefile Fri Jun 6 04:09:07 2014 (r267147) @@ -76,8 +76,7 @@ CFLAGS+=-DNOSUID SRCS+= id.c .endif -.if defined(RELEASE_CRUNCH) || ${MK_OPENSSL} == "no" || \ - defined(PPP_NO_DES) +.if ${MK_OPENSSL} == "no" || defined(PPP_NO_DES) CFLAGS+=-DNODES .else SRCS+= chap_ms.c mppe.c Modified: head/usr.sbin/sendmail/Makefile ============================================================================== --- head/usr.sbin/sendmail/Makefile Fri Jun 6 04:08:55 2014 (r267146) +++ head/usr.sbin/sendmail/Makefile Fri Jun 6 04:09:07 2014 (r267147) @@ -60,7 +60,7 @@ LDADD+= ${LIBSMUTIL} ${LIBSM} SRCS+= sm_os.h CLEANFILES+=sm_os.h -.if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH) +.if ${MK_OPENSSL} != "no" # STARTTLS support CFLAGS+= -DSTARTTLS -D_FFR_TLS_1 DPADD+= ${LIBSSL} ${LIBCRYPTO} Modified: head/usr.sbin/tcpdump/tcpdump/Makefile ============================================================================== --- head/usr.sbin/tcpdump/tcpdump/Makefile Fri Jun 6 04:08:55 2014 (r267146) +++ head/usr.sbin/tcpdump/tcpdump/Makefile Fri Jun 6 04:09:07 2014 (r267147) @@ -167,7 +167,7 @@ DPADD+= ${LIBCAPSICUM} ${LIBNV} LDADD+= -lcapsicum -lnv CFLAGS+=-DHAVE_LIBCAPSICUM .endif -.if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH) +.if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto CFLAGS+= -I${DESTDIR}/usr/include/openssl From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 08:05:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAC37682; Fri, 6 Jun 2014 08:05:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF0B222B5; Fri, 6 Jun 2014 08:05:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5685Y2m088851; Fri, 6 Jun 2014 08:05:34 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5685YVJ088850; Fri, 6 Jun 2014 08:05:34 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201406060805.s5685YVJ088850@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 6 Jun 2014 08:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267148 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 08:05:35 -0000 Author: bapt Date: Fri Jun 6 08:05:34 2014 New Revision: 267148 URL: http://svnweb.freebsd.org/changeset/base/267148 Log: Prevent arc commands from overwriting history Modified: head/.arcconfig Modified: head/.arcconfig ============================================================================== --- head/.arcconfig Fri Jun 6 04:09:07 2014 (r267147) +++ head/.arcconfig Fri Jun 6 08:05:34 2014 (r267148) @@ -1,4 +1,5 @@ { "project.name": "S", - "phabricator.uri" : "https://phabric.freebsd.org/" + "phabricator.uri" : "https://phabric.freebsd.org/", + "history.immutable" : true } From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 08:42:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00A84FA0; Fri, 6 Jun 2014 08:42:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9261262F; Fri, 6 Jun 2014 08:42:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s568g3qt006288; Fri, 6 Jun 2014 08:42:03 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s568g3W9006287; Fri, 6 Jun 2014 08:42:03 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201406060842.s568g3W9006287@svn.freebsd.org> From: Joel Dahl Date: Fri, 6 Jun 2014 08:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267149 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 08:42:04 -0000 Author: joel (doc committer) Date: Fri Jun 6 08:42:03 2014 New Revision: 267149 URL: http://svnweb.freebsd.org/changeset/base/267149 Log: Minor mdoc nit. Modified: head/usr.bin/netstat/netstat.1 Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Fri Jun 6 08:05:34 2014 (r267148) +++ head/usr.bin/netstat/netstat.1 Fri Jun 6 08:42:03 2014 (r267149) @@ -90,8 +90,8 @@ .Op Fl M Ar core .Op Fl N Ar system .It Nm Fl Q -.Ek .El +.Ek .Sh DESCRIPTION The .Nm From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 10:40:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 948FB412; Fri, 6 Jun 2014 10:40:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82AB22092; Fri, 6 Jun 2014 10:40:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56AeK68058980; Fri, 6 Jun 2014 10:40:20 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56AeKxi058979; Fri, 6 Jun 2014 10:40:20 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406061040.s56AeKxi058979@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 6 Jun 2014 10:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267150 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 10:40:20 -0000 Author: luigi Date: Fri Jun 6 10:40:20 2014 New Revision: 267150 URL: http://svnweb.freebsd.org/changeset/base/267150 Log: prevent a panic when the netdev/ifp is not set in attach (internal c63a7b85) MFC after: 3 days Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Fri Jun 6 08:42:03 2014 (r267149) +++ head/sys/dev/netmap/netmap.c Fri Jun 6 10:40:20 2014 (r267150) @@ -2260,7 +2260,8 @@ netmap_attach(struct netmap_adapter *arg fail: D("fail, arg %p ifp %p na %p", arg, ifp, hwna); - netmap_detach(ifp); + if (ifp) + netmap_detach(ifp); return (hwna ? EINVAL : ENOMEM); } From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 10:50:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D26B6CC; Fri, 6 Jun 2014 10:50:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AF1C2176; Fri, 6 Jun 2014 10:50:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56AoFBm061844; Fri, 6 Jun 2014 10:50:15 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56AoFfH061843; Fri, 6 Jun 2014 10:50:15 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406061050.s56AoFfH061843@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 6 Jun 2014 10:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267151 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 10:50:15 -0000 Author: luigi Date: Fri Jun 6 10:50:14 2014 New Revision: 267151 URL: http://svnweb.freebsd.org/changeset/base/267151 Log: add checks for invalid buffer pointers and lengths Modified: head/sys/dev/netmap/netmap_vale.c Modified: head/sys/dev/netmap/netmap_vale.c ============================================================================== --- head/sys/dev/netmap/netmap_vale.c Fri Jun 6 10:40:20 2014 (r267150) +++ head/sys/dev/netmap/netmap_vale.c Fri Jun 6 10:50:14 2014 (r267151) @@ -959,6 +959,14 @@ nm_bdg_preflush(struct netmap_vp_adapter ft[ft_i].ft_next = NM_FT_NULL; buf = ft[ft_i].ft_buf = (slot->flags & NS_INDIRECT) ? (void *)(uintptr_t)slot->ptr : BDG_NMB(&na->up, slot); + if (unlikely(buf == NULL)) { + RD(5, "NULL %s buffer pointer from %s slot %d len %d", + (slot->flags & NS_INDIRECT) ? "INDIRECT" : "DIRECT", + kring->name, j, ft[ft_i].ft_len); + buf = ft[ft_i].ft_buf = NMB_VA(0); /* the 'null' buffer */ + ft[ft_i].ft_len = 0; + ft[ft_i].ft_flags = 0; + } __builtin_prefetch(buf); ++ft_i; if (slot->flags & NS_MOREFRAG) { @@ -1312,6 +1320,7 @@ nm_bdg_flush(struct nm_bdg_fwd *ft, u_in needed = d->bq_len + brddst->bq_len; if (unlikely(dst_na->virt_hdr_len != na->virt_hdr_len)) { + RD(3, "virt_hdr_mismatch, src %d len %d", na->virt_hdr_len, dst_na->virt_hdr_len); /* There is a virtio-net header/offloadings mismatch between * source and destination. The slower mismatch datapath will * be used to cope with all the mismatches. @@ -1412,6 +1421,11 @@ retry: /* round to a multiple of 64 */ copy_len = (copy_len + 63) & ~63; + if (unlikely(copy_len > NETMAP_BUF_SIZE || + copy_len > NETMAP_BUF_SIZE)) { + RD(5, "invalid len %d, down to 64", (int)copy_len); + copy_len = dst_len = 64; // XXX + } if (ft_p->ft_flags & NS_INDIRECT) { if (copyin(src, dst, copy_len)) { // invalid user pointer, pretend len is 0 From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 11:12:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12542F20; Fri, 6 Jun 2014 11:12:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F385E23B0; Fri, 6 Jun 2014 11:12:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56BCJNY074712; Fri, 6 Jun 2014 11:12:19 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56BCJ70074711; Fri, 6 Jun 2014 11:12:19 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201406061112.s56BCJ70074711@svn.freebsd.org> From: Kevin Lo Date: Fri, 6 Jun 2014 11:12:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267152 - head/sys/dev/i40e X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 11:12:20 -0000 Author: kevlo Date: Fri Jun 6 11:12:19 2014 New Revision: 267152 URL: http://svnweb.freebsd.org/changeset/base/267152 Log: Replace deprecated M_DONTWAIT with M_NOWAIT. Reviewed by: jfv Modified: head/sys/dev/i40e/i40e_txrx.c Modified: head/sys/dev/i40e/i40e_txrx.c ============================================================================== --- head/sys/dev/i40e/i40e_txrx.c Fri Jun 6 10:50:14 2014 (r267151) +++ head/sys/dev/i40e/i40e_txrx.c Fri Jun 6 11:12:19 2014 (r267152) @@ -210,7 +210,7 @@ i40e_xmit(struct i40e_queue *que, struct if (error == EFBIG) { struct mbuf *m; - m = m_defrag(*m_headp, M_DONTWAIT); + m = m_defrag(*m_headp, M_NOWAIT); if (m == NULL) { que->mbuf_defrag_failed++; m_freem(*m_headp); @@ -834,7 +834,7 @@ i40e_refresh_mbufs(struct i40e_queue *qu goto no_split; if (buf->m_head == NULL) { - mh = m_gethdr(M_DONTWAIT, MT_DATA); + mh = m_gethdr(M_NOWAIT, MT_DATA); if (mh == NULL) goto update; } else @@ -861,7 +861,7 @@ i40e_refresh_mbufs(struct i40e_queue *qu no_split: if (buf->m_pack == NULL) { - mp = m_getjcl(M_DONTWAIT, MT_DATA, + mp = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, rxr->mbuf_sz); if (mp == NULL) goto update; From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 11:36:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D82958F; Fri, 6 Jun 2014 11:36:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE5DB258A; Fri, 6 Jun 2014 11:36:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56Ba5sE084172; Fri, 6 Jun 2014 11:36:05 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56Ba58D084170; Fri, 6 Jun 2014 11:36:05 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201406061136.s56Ba58D084170@svn.freebsd.org> From: Christian Brueffer Date: Fri, 6 Jun 2014 11:36:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267153 - head/gnu/usr.bin/groff/tmac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 11:36:06 -0000 Author: brueffer Date: Fri Jun 6 11:36:05 2014 New Revision: 267153 URL: http://svnweb.freebsd.org/changeset/base/267153 Log: Add Lb string for libcuse. Modified: head/gnu/usr.bin/groff/tmac/mdoc.local Modified: head/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- head/gnu/usr.bin/groff/tmac/mdoc.local Fri Jun 6 11:12:19 2014 (r267152) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Fri Jun 6 11:36:05 2014 (r267153) @@ -35,6 +35,7 @@ .ds doc-str-Lb-libarchive Streaming Archive Library (libarchive, \-larchive) .ds doc-str-Lb-libbluetooth Bluetooth User Library (libbluetooth, \-lbluetooth) .ds doc-str-Lb-libcapsicum Capsicum Library (libcapsicum, \-lcapsicum) +.ds doc-str-Lb-libcuse Userland Character Device Library (libcuse, \-lcuse) .ds doc-str-Lb-libedit Line Editor and History Library (libedit, \-ledit) .ds doc-str-Lb-libefi EFI Runtime Services Library (libefi, \-lefi) .ds doc-str-Lb-libelf ELF Parsing Library (libelf, \-lelf) From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 11:52:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A48899E; Fri, 6 Jun 2014 11:52:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 472D22712; Fri, 6 Jun 2014 11:52:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56BqVrw092514; Fri, 6 Jun 2014 11:52:31 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56BqVp8092513; Fri, 6 Jun 2014 11:52:31 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201406061152.s56BqVp8092513@svn.freebsd.org> From: Christian Brueffer Date: Fri, 6 Jun 2014 11:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267154 - head/lib/libcuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 11:52:31 -0000 Author: brueffer Date: Fri Jun 6 11:52:30 2014 New Revision: 267154 URL: http://svnweb.freebsd.org/changeset/base/267154 Log: Add missing MLINKs. Modified: head/lib/libcuse/Makefile Modified: head/lib/libcuse/Makefile ============================================================================== --- head/lib/libcuse/Makefile Fri Jun 6 11:36:05 2014 (r267153) +++ head/lib/libcuse/Makefile Fri Jun 6 11:52:30 2014 (r267154) @@ -40,6 +40,7 @@ LDADD+= ${PTHREAD_LIBS} MLINKS= MLINKS+= cuse.3 cuse_alloc_unit_number.3 +MLINKS+= cuse.3 cuse_alloc_unit_number_by_id.3 MLINKS+= cuse.3 cuse_copy_in.3 MLINKS+= cuse.3 cuse_copy_out.3 MLINKS+= cuse.3 cuse_dev_create.3 @@ -49,7 +50,10 @@ MLINKS+= cuse.3 cuse_dev_get_per_file_ha MLINKS+= cuse.3 cuse_dev_get_priv0.3 MLINKS+= cuse.3 cuse_dev_get_priv1.3 MLINKS+= cuse.3 cuse_dev_set_per_file_handle.3 +MLINKS+= cuse.3 cuse_dev_set_priv0.3 +MLINKS+= cuse.3 cuse_dev_set_priv1.3 MLINKS+= cuse.3 cuse_free_unit_number.3 +MLINKS+= cuse.3 cuse_free_unit_number_by_id.3 MLINKS+= cuse.3 cuse_got_peer_signal.3 MLINKS+= cuse.3 cuse_init.3 MLINKS+= cuse.3 cuse_poll_wakeup.3 @@ -59,6 +63,7 @@ MLINKS+= cuse.3 cuse_uninit.3 MLINKS+= cuse.3 cuse_vmalloc.3 MLINKS+= cuse.3 cuse_is_vmalloc_addr.3 MLINKS+= cuse.3 cuse_vmfree.3 +MLINKS+= cuse.3 cuse_vmoffset.3 MLINKS+= cuse.3 cuse_wait_and_process.3 .include From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 12:06:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6318B2AD; Fri, 6 Jun 2014 12:06:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 436D728C1; Fri, 6 Jun 2014 12:06:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56C6fml097955; Fri, 6 Jun 2014 12:06:41 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56C6frU097954; Fri, 6 Jun 2014 12:06:41 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201406061206.s56C6frU097954@svn.freebsd.org> From: Christian Brueffer Date: Fri, 6 Jun 2014 12:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267155 - head/lib/libcuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 12:06:41 -0000 Author: brueffer Date: Fri Jun 6 12:06:40 2014 New Revision: 267155 URL: http://svnweb.freebsd.org/changeset/base/267155 Log: Mdoc cleanup, typo and grammar fixes. Modified: head/lib/libcuse/cuse.3 Modified: head/lib/libcuse/cuse.3 ============================================================================== --- head/lib/libcuse/cuse.3 Fri Jun 6 11:52:30 2014 (r267154) +++ head/lib/libcuse/cuse.3 Fri Jun 6 12:06:40 2014 (r267155) @@ -25,271 +25,263 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 23, 2014 +.Dd June 6, 2014 .Dt CUSE 3 .Os .Sh NAME .Nm libcuse -. .Nd "Userland character device library" -. -. .Sh LIBRARY -. -. -Userland character device library (libcuse -lcuse) -. -. +.Lb libcuse .Sh SYNOPSIS -. -.Pp To load the required kernel module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent cuse_load="YES" .Ed -. .Pp -. .In cuse.h -. -. .Sh DESCRIPTION The .Nm -library contains functions to create a character device in userspace. The +library contains functions to create a character device in userspace. +The .Nm library is thread safe. -. -. .Sh LIBRARY INITIALISATION / DEINITIALISATION -. -.Pp -. .Ft "int" .Fn "cuse_init" "void" This function initialises .Nm . Must be called at the beginning of the program. This function returns 0 on success or a negative value on failure. -See CUSE_ERR_XXX for known error codes. -If the cuse kernel module is not loaded, CUSE_ERR_NOT_LOADED is -returned. -. +See +.Dv CUSE_ERR_XXX +for known error codes. +If the cuse kernel module is not loaded, +.Dv CUSE_ERR_NOT_LOADED +is returned. .Pp -. .Ft "int" .Fn "cuse_uninit" "void" Deinitialise .Nm . Can be called at the end of the application. This function returns 0 on success or a negative value on failure. -See CUSE_ERR_XXX for known error codes. -. -. +See +.Dv CUSE_ERR_XXX +for known error codes. .Sh UNIT MANAGEMENT -. .Ft "int" .Fn "cuse_alloc_unit_number" "int *" This function stores a uniq system unit number at the pointed integer loation. This function returns 0 on success or a negative value on failure. -See CUSE_ERR_XXX for known error codes. -. +See +.Dv CUSE_ERR_XXX +for known error codes. .Pp -. .Ft "int" .Fn "cuse_alloc_unit_number_by_id" "int *" "int id" -This function stores a uniq system unit number at the pointed +This function stores a unique system unit number at the pointed integer loation. The returned unit number is uniq within the given ID. Valid ID values are defined by the cuse include file. -See the CUSE_ID_XXX() macros for more information. +See the +.Fn CUSE_ID_XXX +macros for more information. This function returns 0 on success or a negative value on failure. -See CUSE_ERR_XXX for known error codes. -. +See +.Dv CUSE_ERR_XXX +for known error codes. .Pp -. .Ft "int" .Fn "cuse_free_unit_number" "int" This function frees the given allocated system unit number. This function returns 0 on success or a negative value on failure. -See CUSE_ERR_XXX for known error codes. -. +See +.Dv CUSE_ERR_XXX +for known error codes. .Pp -. .Ft "int" .Fn "cuse_free_unit_number_by_id" "int unit" "int id" This function frees the given allocated system unit number belonging to the given ID. If both the unit and id argument is -1, all allocated units will be freed. This function returns 0 on success or a negative value on failure. -See CUSE_ERR_XXX for known error codes. -. -. +See +.Dv CUSE_ERR_XXX +for known error codes. .Sh LIBRARY USAGE -. -. .Ft "void *" .Fn "cuse_vmalloc" "int size" This function allocates .Ar size -bytes of memory. Only memory allocated by this function can be memory -mapped by mmap(). This function returns a valid data pointer on success or -NULL on failure. -. +bytes of memory. +Only memory allocated by this function can be memory +mapped by +.Xr mmap 2 . +This function returns a valid data pointer on success or +.Dv NULL +on failure. .Pp -. .Ft "int" .Fn "cuse_is_vmalloc_addr" "void *" This function returns non-zero if the passed pointer points to a valid -and non-freed allocation, as returned by "cuse_vmalloc()". +and non-freed allocation, as returned by +.Fn cuse_vmalloc . Else this function returns zero. -. .Pp -. .Ft "void" .Fn "cuse_vmfree" "void *" -This function frees memory allocated by cuse_vmalloc(). Note that the +This function frees memory allocated by +.Fn cuse_vmalloc . +Note that the cuse library will internally not free the memory until the -cuse_uninit() function is called and that the number of uniq +.Fn cuse_uninit +function is called and that the number of unique allocations is limited. -. -. .Pp -. .Ft "unsigned long" .Fn "cuse_vmoffset" "void *" This function returns the mmap offset that the client must use to access the allocated memory. -. .Pp -. .Ft "struct cuse_dev *" .Fn "cuse_dev_create" "const struct cuse_methods *mtod" "void *priv0" "void *priv1" "uid_t" "gid_t" "int permission" "const char *fmt" "..." This function creates a new character device according to the given -parameters. This function returns a valid cuse_dev structure pointer -on success or NULL on failure. The device name can only contain a-z, +parameters. +This function returns a valid cuse_dev structure pointer +on success or +.Dv NULL +on failure. +The device name can only contain a-z, A-Z, 0-9, dot, / and underscore characters. -. .Pp -. .Ft "void" .Fn "cuse_dev_destroy" "struct cuse_dev *" This functions destroys a previously created character device. -. .Pp -. -. .Ft "void *" -.Fn "cuse_dev_get_priv0" "struct cuse_dev *" -, +.Fn "cuse_dev_get_priv0" "struct cuse_dev *" , .Ft "void *" -.Fn "cuse_dev_get_priv1" "struct cuse_dev *" -, +.Fn "cuse_dev_get_priv1" "struct cuse_dev *" , .Ft "void" -.Fn "cuse_dev_set_priv0" "struct cuse_dev *" "void *" -, +.Fn "cuse_dev_set_priv0" "struct cuse_dev *" "void *" , .Ft "void" .Fn "cuse_dev_set_priv1" "struct cuse_dev *" "void *" These functions are used to set and get the private data of the given cuse device. -. .Pp -. .Ft "int" .Fn "cuse_wait_and_process" "void" -This function will block and do event processing. If parallell I/O is +This function will block and do event processing. +If parallel I/O is required multiple threads must be created looping on this function. This function returns 0 on success or a negative value on failure. -See CUSE_ERR_XXX for known error codes. -. +See +.Dv CUSE_ERR_XXX +for known error codes. .Pp -. .Ft "void *" -.Fn "cuse_dev_get_per_file_handle" "struct cuse_dev *" -, +.Fn "cuse_dev_get_per_file_handle" "struct cuse_dev *" , .Ft "void" .Fn "cuse_dev_set_per_file_handle" "struct cuse_dev *" "void *" These functions are used to set and get the per-file-open specific handle and should only be used inside the cuse file operation callbacks. -. .Pp -. .Ft "void" .Fn "cuse_set_local" "int" -This function instructs cuse_copy_out() and cuse_copy_in() that the +This function instructs +.Fn cuse_copy_out +and +.Fn cuse_copy_in +that the user pointer is local, if the argument passed to it is non-zero. Else the user pointer is assumed to be at the peer application. This function should only be used inside the cuse file operation callbacks. The value is reset to zero when the given file operation returns, and does not affect any other file operation callbacks. -. .Pp -. .Ft "int" .Fn "cuse_get_local" "void" -Return current local state. See "cuse_set_local" function. -. +Returns the current local state. +See +.Fn cuse_set_local . .Pp -. .Ft "int" -.Fn "cuse_copy_out" "const void *src" "void *peer_dst" "int len" -, +.Fn "cuse_copy_out" "const void *src" "void *peer_dst" "int len" , .Ft "int" .Fn "cuse_copy_in" "const void *peer_src" "void *dst" "int len" These functions are used to transfer data between the local -application and the peer application. These functions must be used -when operating on the data pointers passed to the cm_read(), -cm_write() and cm_ioctl() callback functions. +application and the peer application. +These functions must be used +when operating on the data pointers passed to the +.Fn cm_read , +.Fn cm_write , +and +.Fn cm_ioctl +callback functions. These functions return 0 on success or a negative value on failure. -See CUSE_ERR_XXX for known error codes. -. +See +.Dv CUSE_ERR_XXX +for known error codes. .Pp -. .Ft "int" .Fn "cuse_got_peer_signal" "void" This function is used to check if a signal has been delivered to the peer application and should only be used inside the cuse file -operation callbacks. This function returns 0 if a signal has been +operation callbacks. +This function returns 0 if a signal has been delivered to the caller. Else it returns a negative value. -See CUSE_ERR_XXX for known error codes. -. +See +.Dv CUSE_ERR_XXX +for known error codes. .Pp -. .Ft "struct cuse_dev *" .Fn "cuse_dev_get_current" "int *pcmd" This function is used to get the current cuse device pointer and the -currently executing command, by CUSE_CMD_XXX value. The pcmd argument -is allowed to be NULL. This function should only be used inside the -cuse file operation callbacks. On success a valid cuse device pointer -is returned. On failure NULL is returned. -. +currently executing command, by +.Dv CUSE_CMD_XXX +value. +The +.Ar pcmd +argument +is allowed to be +.Dv NULL . +This function should only be used inside the +cuse file operation callbacks. +On success a valid cuse device pointer +is returned. +On failure +.Dv NULL +is returned. .Pp -. .Ft "void" .Fn "cuse_poll_wakeup" "void" This function will wake up any file pollers. -. .Pp -. .Sh LIBRARY LIMITATIONS -. -. -Transfer lengths for read, write, cuse_copy_in and cuse_copy_out +Transfer lengths for +.Fn read , +.Fn write , +.Fn cuse_copy_in , +and +.Fn cuse_copy_out should not exceed what can fit into a 32-bit signed integer and is -defined by the CUSE_LENGTH_MAX macro. -. +defined by the +.Fn CUSE_LENGTH_MAX +macro. Transfer lengths for ioctls should not exceed what is defined by the -CUSE_BUFFER_MAX macro. -. -. +.Fn CUSE_BUFFER_MAX +macro. .Sh LIBRARY CALLBACK METHODS -. -In general fflags are defined by CUSE_FFLAG_XXX and errors are defined by CUSE_ERR_XXX. -. +In general fflags are defined by +.Dv CUSE_FFLAG_XXX +and errors are defined by +.Dv CUSE_ERR_XXX . .Bd -literal -offset indent enum { CUSE_ERR_NONE @@ -324,55 +316,65 @@ enum { CUSE_CMD_MAX }; .Ed -. .Pp -. .Ft "int" .Fn "cuse_open_t" "struct cuse_dev *" "int fflags" -This functions returns a CUSE_ERR_XXX value. -. +This function returns a +.Dv CUSE_ERR_XXX +value. .Pp -. .Ft "int" .Fn "cuse_close_t" "struct cuse_dev *" "int fflags" -This functions returns a CUSE_ERR_XXX value. -. +This function returns a +.Dv CUSE_ERR_XXX +value. .Pp -. .Ft "int" .Fn "cuse_read_t" "struct cuse_dev *" "int fflags" "void *peer_ptr" "int len" -This functions returns a CUSE_ERR_XXX value in case of failure or the -actually transferred length in case of success. cuse_copy_in() and -cuse_copy_out() must be used to transfer data to and from the -peer_ptr. -. +This function returns a +.Dv CUSE_ERR_XXX +value in case of failure or the +actually transferred length in case of success. +.Fn cuse_copy_in +and +.Fn cuse_copy_out +must be used to transfer data to and from the +.Ar peer_ptr . .Pp -. .Ft "int" .Fn "cuse_write_t" "struct cuse_dev *" "int fflags" "const void *peer_ptr" "int len" -This functions returns a CUSE_ERR_XXX value in case of failure or the -actually transferred length in case of success. cuse_copy_in() and -cuse_copy_out() must be used to transfer data to and from the -peer_ptr. -. +This function returns a +.Dv CUSE_ERR_XXX +value in case of failure or the +actually transferred length in case of success. +.Fn cuse_copy_in +and +.Fn cuse_copy_out +must be used to transfer data to and from the +.Ar peer_ptr . .Pp -. .Ft "int" .Fn "cuse_ioctl_t" "struct cuse_dev *" "int fflags" "unsigned long cmd" "void *peer_data" -This functions returns a CUSE_ERR_XXX value in case of failure or zero -in case of success. cuse_copy_in() and cuse_copy_out() must be used to -transfer data to and from the peer_data. -. +This function returns a +.Dv CUSE_ERR_XXX +value in case of failure or zero +in case of success. +.Fn cuse_copy_in +and +.Fn cuse_copy_out +must be used to +transfer data to and from the +.Ar peer_data . .Pp -. .Ft "int" .Fn "cuse_poll_t" "struct cuse_dev *" "int fflags" "int events" -This functions returns a mask of CUSE_POLL_XXX values in case of -failure and success. The events argument is also a mask of -CUSE_POLL_XXX values. -. +This function returns a mask of +.Dv CUSE_POLL_XXX +values in case of failure and success. +The events argument is also a mask of +.Dv CUSE_POLL_XXX +values. .Pp -. .Bd -literal -offset indent struct cuse_methods { cuse_open_t *cm_open; @@ -383,11 +385,6 @@ struct cuse_methods { cuse_poll_t *cm_poll; }; .Ed -. -. -.Sh SEE ALSO -. .Sh HISTORY -. .Nm -was written by Hans Petter Selasky . +was written by Hans Petter Selasky. From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 13:00:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4CDB9A3F; Fri, 6 Jun 2014 13:00:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39E892E0C; Fri, 6 Jun 2014 13:00:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56D0ski024724; Fri, 6 Jun 2014 13:00:54 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56D0s5B024723; Fri, 6 Jun 2014 13:00:54 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201406061300.s56D0s5B024723@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 6 Jun 2014 13:00:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267159 - head/sbin/geom/class/stripe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 13:00:54 -0000 Author: pjd Date: Fri Jun 6 13:00:53 2014 New Revision: 267159 URL: http://svnweb.freebsd.org/changeset/base/267159 Log: The 'create' subcommand doesn't have '-h' option. Modified: head/sbin/geom/class/stripe/geom_stripe.c Modified: head/sbin/geom/class/stripe/geom_stripe.c ============================================================================== --- head/sbin/geom/class/stripe/geom_stripe.c Fri Jun 6 12:52:44 2014 (r267158) +++ head/sbin/geom/class/stripe/geom_stripe.c Fri Jun 6 13:00:53 2014 (r267159) @@ -62,7 +62,7 @@ struct g_command class_commands[] = { { 's', "stripesize", GSTRIPE_STRIPESIZE, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - "[-hv] [-s stripesize] name prov prov ..." + "[-v] [-s stripesize] name prov prov ..." }, { "destroy", G_FLAG_VERBOSE, NULL, { From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 13:36:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D841DED7; Fri, 6 Jun 2014 13:36:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C53D3219C; Fri, 6 Jun 2014 13:36:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56DaqFA040804; Fri, 6 Jun 2014 13:36:52 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56DaqWn040803; Fri, 6 Jun 2014 13:36:52 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406061336.s56DaqWn040803@svn.freebsd.org> From: Glen Barber Date: Fri, 6 Jun 2014 13:36:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267160 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 13:36:52 -0000 Author: gjb Date: Fri Jun 6 13:36:52 2014 New Revision: 267160 URL: http://svnweb.freebsd.org/changeset/base/267160 Log: Dereference portaudit(1), as it is now deprecated and its functionality exists in pkg-audit(8). Submitted by: Ronald Klop MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Fri Jun 6 13:00:53 2014 (r267159) +++ head/share/man/man7/ports.7 Fri Jun 6 13:36:52 2014 (r267160) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 17, 2014 +.Dd June 6, 2014 .Dt PORTS 7 .Os .Sh NAME @@ -458,7 +458,7 @@ If defined, only operate on a port if it If defined, only operate on a port if it can be installed 100% automatically. .It Va DISABLE_VULNERABILITIES If defined, disable check for security vulnerabilities using -.Xr portaudit 1 Pq Pa ports/ports-mgmt/portaudit +.Xr pkg-audit 8 when installing new ports. .It Va NO_IGNORE If defined, allow installation of ports marked as @@ -539,7 +539,7 @@ The big Kahuna. .Pp The following are part of the ports collection: .Pp -.Xr portaudit 1 , +.Xr pkg 7 , .Xr portlint 1 .Rs .%B "The FreeBSD Handbook" From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 14:49:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B820281; Fri, 6 Jun 2014 14:49:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18EC6290B; Fri, 6 Jun 2014 14:49:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56En05B073029; Fri, 6 Jun 2014 14:49:00 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56En06e073028; Fri, 6 Jun 2014 14:49:00 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201406061449.s56En06e073028@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 6 Jun 2014 14:49:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267162 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 14:49:01 -0000 Author: jilles Date: Fri Jun 6 14:49:00 2014 New Revision: 267162 URL: http://svnweb.freebsd.org/changeset/base/267162 Log: ktrace: Use designated initializers for the data_lengths array. In the .o file, this only changes some line numbers (head amd64) because element 0 is no longer explicitly initialized. This should make bugs like FreeBSD-SA-14:12.ktrace less likely. Discussed with: des MFC after: 1 week Modified: head/sys/kern/kern_ktrace.c Modified: head/sys/kern/kern_ktrace.c ============================================================================== --- head/sys/kern/kern_ktrace.c Fri Jun 6 13:37:40 2014 (r267161) +++ head/sys/kern/kern_ktrace.c Fri Jun 6 14:49:00 2014 (r267162) @@ -109,21 +109,20 @@ struct ktr_request { }; static int data_lengths[] = { - 0, /* none */ - offsetof(struct ktr_syscall, ktr_args), /* KTR_SYSCALL */ - sizeof(struct ktr_sysret), /* KTR_SYSRET */ - 0, /* KTR_NAMEI */ - sizeof(struct ktr_genio), /* KTR_GENIO */ - sizeof(struct ktr_psig), /* KTR_PSIG */ - sizeof(struct ktr_csw), /* KTR_CSW */ - 0, /* KTR_USER */ - 0, /* KTR_STRUCT */ - 0, /* KTR_SYSCTL */ - sizeof(struct ktr_proc_ctor), /* KTR_PROCCTOR */ - 0, /* KTR_PROCDTOR */ - sizeof(struct ktr_cap_fail), /* KTR_CAPFAIL */ - sizeof(struct ktr_fault), /* KTR_FAULT */ - sizeof(struct ktr_faultend), /* KTR_FAULTEND */ + [KTR_SYSCALL] = offsetof(struct ktr_syscall, ktr_args), + [KTR_SYSRET] = sizeof(struct ktr_sysret), + [KTR_NAMEI] = 0, + [KTR_GENIO] = sizeof(struct ktr_genio), + [KTR_PSIG] = sizeof(struct ktr_psig), + [KTR_CSW] = sizeof(struct ktr_csw), + [KTR_USER] = 0, + [KTR_STRUCT] = 0, + [KTR_SYSCTL] = 0, + [KTR_PROCCTOR] = sizeof(struct ktr_proc_ctor), + [KTR_PROCDTOR] = 0, + [KTR_CAPFAIL] = sizeof(struct ktr_cap_fail), + [KTR_FAULT] = sizeof(struct ktr_fault), + [KTR_FAULTEND] = sizeof(struct ktr_faultend), }; static STAILQ_HEAD(, ktr_request) ktr_free; From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 14:57:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3263876C; Fri, 6 Jun 2014 14:57:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FDD12A39; Fri, 6 Jun 2014 14:57:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56EvHdr077199; Fri, 6 Jun 2014 14:57:17 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56EvGcj077198; Fri, 6 Jun 2014 14:57:16 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406061457.s56EvGcj077198@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 6 Jun 2014 14:57:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267163 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 14:57:17 -0000 Author: luigi Date: Fri Jun 6 14:57:16 2014 New Revision: 267163 URL: http://svnweb.freebsd.org/changeset/base/267163 Log: remove two debugging messages, align comments with the code in our development trunk Modified: head/sys/dev/netmap/netmap_generic.c Modified: head/sys/dev/netmap/netmap_generic.c ============================================================================== --- head/sys/dev/netmap/netmap_generic.c Fri Jun 6 14:49:00 2014 (r267162) +++ head/sys/dev/netmap/netmap_generic.c Fri Jun 6 14:57:16 2014 (r267163) @@ -81,18 +81,25 @@ __FBSDID("$FreeBSD$"); #include #include -#define rtnl_lock() D("rtnl_lock called"); -#define rtnl_unlock() D("rtnl_unlock called"); +#define rtnl_lock() ND("rtnl_lock called"); +#define rtnl_unlock() ND("rtnl_unlock called"); #define MBUF_TXQ(m) ((m)->m_pkthdr.flowid) #define MBUF_RXQ(m) ((m)->m_pkthdr.flowid) #define smp_mb() /* - * mbuf wrappers + * FreeBSD mbuf allocator/deallocator in emulation mode: + * + * We allocate EXT_PACKET mbuf+clusters, but need to set M_NOFREE + * so that the destructor, if invoked, will not free the packet. + * In principle we should set the destructor only on demand, + * but since there might be a race we better do it on allocation. + * As a consequence, we also need to set the destructor or we + * would leak buffers. */ /* - * we allocate an EXT_PACKET + * mbuf wrappers */ #define netmap_get_mbuf(len) m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR|M_NOFREE) @@ -808,5 +815,5 @@ generic_netmap_attach(struct ifnet *ifp) struct netmap_adapter * netmap_getna(if_t ifp) { - return (NA((struct ifnet *)ifp)); + return (NA((struct ifnet *)ifp)); } From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 14:57:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2014098F; Fri, 6 Jun 2014 14:57:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B6522A46; Fri, 6 Jun 2014 14:57:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56EveO4077374; Fri, 6 Jun 2014 14:57:40 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56Eve6U077373; Fri, 6 Jun 2014 14:57:40 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406061457.s56Eve6U077373@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 6 Jun 2014 14:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267164 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 14:57:41 -0000 Author: luigi Date: Fri Jun 6 14:57:40 2014 New Revision: 267164 URL: http://svnweb.freebsd.org/changeset/base/267164 Log: rate limit some error messages Modified: head/sys/dev/netmap/netmap_vale.c Modified: head/sys/dev/netmap/netmap_vale.c ============================================================================== --- head/sys/dev/netmap/netmap_vale.c Fri Jun 6 14:57:16 2014 (r267163) +++ head/sys/dev/netmap/netmap_vale.c Fri Jun 6 14:57:40 2014 (r267164) @@ -1072,7 +1072,7 @@ netmap_bdg_learning(char *buf, u_int buf uint64_t smac, dmac; if (buf_len < 14) { - D("invalid buf length %d", buf_len); + RD(5, "invalid buf length %d", buf_len); return NM_BDG_NOPORT; } dmac = le64toh(*(uint64_t *)(buf)) & 0xffffffffffff; From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 14:58:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99A15AE1; Fri, 6 Jun 2014 14:58:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C6FE2A51; Fri, 6 Jun 2014 14:58:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56EwQrQ077526; Fri, 6 Jun 2014 14:58:26 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56EwQMQ077524; Fri, 6 Jun 2014 14:58:26 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406061458.s56EwQMQ077524@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 6 Jun 2014 14:58:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267165 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 14:58:26 -0000 Author: luigi Date: Fri Jun 6 14:58:25 2014 New Revision: 267165 URL: http://svnweb.freebsd.org/changeset/base/267165 Log: align comments with the ones in our development trunk Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Fri Jun 6 14:57:40 2014 (r267164) +++ head/sys/dev/netmap/netmap.c Fri Jun 6 14:58:25 2014 (r267165) @@ -270,6 +270,7 @@ netmap_disable_ring(struct netmap_kring } +/* stop or enable all the rings of na */ static void netmap_set_all_rings(struct ifnet *ifp, int stopped) { @@ -303,6 +304,13 @@ netmap_set_all_rings(struct ifnet *ifp, } +/* + * Convenience function used in drivers. Waits for current txsync()s/rxsync()s + * to finish and prevents any new one from starting. Call this before turning + * netmap mode off, or before removing the harware rings (e.g., on module + * onload). As a rule of thumb for linux drivers, this should be placed near + * each napi_disable(). + */ void netmap_disable_all_rings(struct ifnet *ifp) { @@ -310,6 +318,11 @@ netmap_disable_all_rings(struct ifnet *i } +/* + * Convenience function used in drivers. Re-enables rxsync and txsync on the + * adapter's rings In linux drivers, this should be placed near each + * napi_enable(). + */ void netmap_enable_all_rings(struct ifnet *ifp) { @@ -393,6 +406,7 @@ nm_dump_buf(char *p, int len, int lim, c * Fetch configuration from the device, to cope with dynamic * reconfigurations after loading the module. */ +/* call with NMG_LOCK held */ int netmap_update_config(struct netmap_adapter *na) { @@ -447,18 +461,20 @@ netmap_rxsync_compat(struct netmap_kring return na->nm_rxsync(na, kring->ring_id, flags); } +/* kring->nm_sync callback for the host tx ring */ static int netmap_txsync_to_host_compat(struct netmap_kring *kring, int flags) { - (void)flags; + (void)flags; /* unused */ netmap_txsync_to_host(kring->na); return 0; } +/* kring->nm_sync callback for the host rx ring */ static int netmap_rxsync_from_host_compat(struct netmap_kring *kring, int flags) { - (void)flags; + (void)flags; /* unused */ netmap_rxsync_from_host(kring->na, NULL, NULL); return 0; } @@ -489,6 +505,7 @@ netmap_rxsync_from_host_compat(struct ne * Note: for compatibility, host krings are created even when not needed. * The tailroom space is currently used by vale ports for allocating leases. */ +/* call with NMG_LOCK held */ int netmap_krings_create(struct netmap_adapter *na, u_int tailroom) { @@ -567,6 +584,7 @@ netmap_krings_create(struct netmap_adapt /* undo the actions performed by netmap_krings_create */ +/* call with NMG_LOCK held */ void netmap_krings_delete(struct netmap_adapter *na) { @@ -586,6 +604,7 @@ netmap_krings_delete(struct netmap_adapt * on the rings connected to the host so we need to purge * them first. */ +/* call with NMG_LOCK held */ static void netmap_hw_krings_delete(struct netmap_adapter *na) { @@ -598,6 +617,12 @@ netmap_hw_krings_delete(struct netmap_ad } +/* create a new netmap_if for a newly registered fd. + * If this is the first registration of the adapter, + * also create the netmap rings and their in-kernel view, + * the netmap krings. + */ +/* call with NMG_LOCK held */ static struct netmap_if* netmap_if_new(const char *ifname, struct netmap_adapter *na) { @@ -608,17 +633,23 @@ netmap_if_new(const char *ifname, struct return NULL; } - if (na->active_fds) + if (na->active_fds) /* already registered */ goto final; + /* create and init the krings arrays. + * Depending on the adapter, this may also create + * the netmap rings themselves + */ if (na->nm_krings_create(na)) goto cleanup; + /* create all missing netmap rings */ if (netmap_mem_rings_create(na)) goto cleanup; final: + /* in all cases, create a new netmap if */ nifp = netmap_mem_if_new(ifname, na); if (nifp == NULL) goto cleanup; @@ -638,8 +669,8 @@ cleanup: /* grab a reference to the memory allocator, if we don't have one already. The * reference is taken from the netmap_adapter registered with the priv. - * */ +/* call with NMG_LOCK held */ static int netmap_get_memory_locked(struct netmap_priv_d* p) { @@ -672,6 +703,7 @@ netmap_get_memory_locked(struct netmap_p } +/* call with NMG_LOCK *not* held */ int netmap_get_memory(struct netmap_priv_d* p) { @@ -683,6 +715,7 @@ netmap_get_memory(struct netmap_priv_d* } +/* call with NMG_LOCK held */ static int netmap_have_memory_locked(struct netmap_priv_d* p) { @@ -690,6 +723,7 @@ netmap_have_memory_locked(struct netmap_ } +/* call with NMG_LOCK held */ static void netmap_drop_memory_locked(struct netmap_priv_d* p) { @@ -755,6 +789,7 @@ netmap_do_unregif(struct netmap_priv_d * netmap_mem_if_delete(na, nifp); } +/* call with NMG_LOCK held */ static __inline int nm_tx_si_user(struct netmap_priv_d *priv) { @@ -762,6 +797,7 @@ nm_tx_si_user(struct netmap_priv_d *priv (priv->np_txqlast - priv->np_txqfirst > 1)); } +/* call with NMG_LOCK held */ static __inline int nm_rx_si_user(struct netmap_priv_d *priv) { @@ -771,8 +807,12 @@ nm_rx_si_user(struct netmap_priv_d *priv /* + * Destructor of the netmap_priv_d, called when the fd has + * no active open() and mmap(). Also called in error paths. + * * returns 1 if this is the last instance and we can free priv */ +/* call with NMG_LOCK held */ int netmap_dtor_locked(struct netmap_priv_d *priv) { @@ -805,6 +845,7 @@ netmap_dtor_locked(struct netmap_priv_d } +/* call with NMG_LOCK *not* held */ void netmap_dtor(void *data) { @@ -1194,6 +1235,12 @@ netmap_get_na(struct nmreq *nmr, struct if (*na != NULL) /* valid match in netmap_get_bdg_na() */ goto pipes; + /* + * This must be a hardware na, lookup the name in the system. + * Note that by hardware we actually mean "it shows up in ifconfig". + * This may still be a tap, a veth/epair, or even a + * persistent VALE port. + */ ifp = ifunit_ref(nmr->nr_name); if (ifp == NULL) { return ENXIO; @@ -1212,6 +1259,11 @@ netmap_get_na(struct nmreq *nmr, struct netmap_adapter_get(ret); pipes: + /* + * If we are opening a pipe whose parent was not in netmap mode, + * we have to allocate the pipe array now. + * XXX get rid of this clumsiness (2014-03-15) + */ error = netmap_pipe_alloc(*na, nmr); out: @@ -1219,7 +1271,7 @@ out: netmap_adapter_put(ret); if (ifp) - if_rele(ifp); + if_rele(ifp); /* allow live unloading of drivers modules */ return error; } @@ -1555,10 +1607,9 @@ netmap_do_regif(struct netmap_priv_d *pr goto out; } nifp = netmap_if_new(NM_IFPNAME(ifp), na); + + /* Allocate a netmap_if and, if necessary, all the netmap_ring's */ if (nifp == NULL) { /* allocation failed */ - /* we should drop the allocator, but only - * if we were the ones who grabbed it - */ error = ENOMEM; goto out; } @@ -1568,10 +1619,8 @@ netmap_do_regif(struct netmap_priv_d *pr } else { /* Otherwise set the card in netmap mode * and make it use the shared buffers. - * - * do not core lock because the race is harmless here, - * there cannot be any traffic to netmap_transmit() */ + /* cache the allocator info in the na */ na->na_lut = na->nm_mem->pools[NETMAP_BUF_POOL].lut; ND("%p->na_lut == %p", na, na->na_lut); na->na_lut_objtotal = na->nm_mem->pools[NETMAP_BUF_POOL].objtotal; @@ -1585,6 +1634,9 @@ out: *err = error; if (error) { priv->np_na = NULL; + /* we should drop the allocator, but only + * if we were the ones who grabbed it + */ if (need_mem) netmap_drop_memory_locked(priv); } @@ -2008,6 +2060,12 @@ flush_tx: continue; /* only one thread does txsync */ if (nm_kr_tryget(kring)) { + /* either busy or stopped + * XXX if the ring is stopped, sleeping would + * be better. In current code, however, we only + * stop the rings for brief intervals (2014-03-14) + */ + if (netmap_verbose) RD(2, "%p lost race on txring %d, ok", priv, i); @@ -2049,7 +2107,7 @@ flush_tx: */ if (want_rx) { int send_down = 0; /* transparent mode */ - /* two rounds here to for race avoidance */ + /* two rounds here for race avoidance */ do_retry_rx: for (i = priv->np_rxqfirst; i < priv->np_rxqlast; i++) { int found = 0; @@ -2139,6 +2197,7 @@ do_retry_rx: static int netmap_hw_krings_create(struct netmap_adapter *); +/* default notify callback */ static int netmap_notify(struct netmap_adapter *na, u_int n_ring, enum txrx tx, int flags) @@ -2148,11 +2207,16 @@ netmap_notify(struct netmap_adapter *na, if (tx == NR_TX) { kring = na->tx_rings + n_ring; OS_selwakeup(&kring->si, PI_NET); + /* optimization: avoid a wake up on the global + * queue if nobody has registered for more + * than one ring + */ if (na->tx_si_users > 0) OS_selwakeup(&na->tx_si, PI_NET); } else { kring = na->rx_rings + n_ring; OS_selwakeup(&kring->si, PI_NET); + /* optimization: same as above */ if (na->rx_si_users > 0) OS_selwakeup(&na->rx_si, PI_NET); } @@ -2160,7 +2224,11 @@ netmap_notify(struct netmap_adapter *na, } -// XXX check handling of failures +/* called by all routines that create netmap_adapters. + * Attach na to the ifp (if any) and provide defaults + * for optional callbacks. Defaults assume that we + * are creating an hardware netmap_adapter. + */ int netmap_attach_common(struct netmap_adapter *na) { @@ -2182,6 +2250,10 @@ netmap_attach_common(struct netmap_adapt NETMAP_SET_CAPABLE(ifp); if (na->nm_krings_create == NULL) { + /* we assume that we have been called by a driver, + * since other port types all provide their own + * nm_krings_create + */ na->nm_krings_create = netmap_hw_krings_create; na->nm_krings_delete = netmap_hw_krings_delete; } @@ -2195,10 +2267,11 @@ netmap_attach_common(struct netmap_adapt } +/* standard cleanup, called by all destructors */ void netmap_detach_common(struct netmap_adapter *na) { - if (na->ifp) + if (na->ifp != NULL) WNA(na->ifp) = NULL; /* XXX do we need this? */ if (na->tx_rings) { /* XXX should not happen */ @@ -2255,7 +2328,11 @@ netmap_attach(struct netmap_adapter *arg hwna->nm_ndo.ndo_start_xmit = linux_netmap_start_xmit; #endif /* linux */ - D("success for %s", NM_IFPNAME(ifp)); + D("success for %s tx %d/%d rx %d/%d queues/slots", + NM_IFPNAME(ifp), + hwna->up.num_tx_rings, hwna->up.num_tx_desc, + hwna->up.num_rx_rings, hwna->up.num_rx_desc + ); return 0; fail: @@ -2295,6 +2372,7 @@ NM_DBG(netmap_adapter_put)(struct netmap return 1; } +/* nm_krings_create callback for all hardware native adapters */ int netmap_hw_krings_create(struct netmap_adapter *na) { @@ -2310,8 +2388,7 @@ netmap_hw_krings_create(struct netmap_ad /* - * Free the allocated memory linked to the given ``netmap_adapter`` - * object. + * Called on module unload by the netmap-enabled drivers */ void netmap_detach(struct ifnet *ifp) @@ -2406,6 +2483,10 @@ done: m_freem(m); /* unconditionally wake up listeners */ na->nm_notify(na, na->num_rx_rings, NR_RX, 0); + /* this is normally netmap_notify(), but for nics + * connected to a bridge it is netmap_bwrap_intr_notify(), + * that possibly forwards the frames through the switch + */ return (error); } Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Fri Jun 6 14:57:40 2014 (r267164) +++ head/sys/dev/netmap/netmap_kern.h Fri Jun 6 14:58:25 2014 (r267165) @@ -183,9 +183,6 @@ extern NMG_LOCK_T netmap_global_lock; * the next empty buffer as known by the hardware (next_to_check or so). * TX rings: hwcur + hwofs coincides with next_to_send * - * Clients cannot issue concurrent syscall on a ring. The system - * detects this and reports an error using two flags, - * NKR_WBUSY and NKR_RBUSY * For received packets, slot->flags is set to nkr_slot_flags * so we can provide a proper initial value (e.g. set NS_FORWARD * when operating in 'transparent' mode). @@ -208,7 +205,7 @@ extern NMG_LOCK_T netmap_global_lock; * The kring is manipulated by txsync/rxsync and generic netmap function. * * Concurrent rxsync or txsync on the same ring are prevented through - * by nm_kr_lock() which in turn uses nr_busy. This is all we need + * by nm_kr_(try)lock() which in turn uses nr_busy. This is all we need * for NIC rings, and for TX rings attached to the host stack. * * RX rings attached to the host stack use an mbq (rx_queue) on both @@ -440,15 +437,18 @@ struct netmap_adapter { /* * nm_dtor() is the cleanup routine called when destroying * the adapter. + * Called with NMG_LOCK held. * * nm_register() is called on NIOCREGIF and close() to enter * or exit netmap mode on the NIC + * Called with NMG_LOCK held. * * nm_txsync() pushes packets to the underlying hw/switch * * nm_rxsync() collects packets from the underlying hw/switch * * nm_config() returns configuration information from the OS + * Called with NMG_LOCK held. * * nm_krings_create() create and init the krings array * (the array layout must conform to the description @@ -456,13 +456,12 @@ struct netmap_adapter { * * nm_krings_delete() cleanup and delete the kring array * - * nm_notify() is used to act after data have become available. + * nm_notify() is used to act after data have become available + * (or the stopped state of the ring has changed) * For hw devices this is typically a selwakeup(), * but for NIC/host ports attached to a switch (or vice-versa) * we also need to invoke the 'txsync' code downstream. */ - - /* private cleanup */ void (*nm_dtor)(struct netmap_adapter *); int (*nm_register)(struct netmap_adapter *, int onoff); From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 15:15:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10B4982F; Fri, 6 Jun 2014 15:15:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F274A2C89; Fri, 6 Jun 2014 15:15:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56FFR7W086859; Fri, 6 Jun 2014 15:15:27 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56FFRK9086858; Fri, 6 Jun 2014 15:15:27 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406061515.s56FFRK9086858@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 6 Jun 2014 15:15:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267167 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 15:15:28 -0000 Author: luigi Date: Fri Jun 6 15:15:27 2014 New Revision: 267167 URL: http://svnweb.freebsd.org/changeset/base/267167 Log: whitespace change: fix one comment, remove a stale one. Modified: head/sys/net/netmap.h Modified: head/sys/net/netmap.h ============================================================================== --- head/sys/net/netmap.h Fri Jun 6 15:09:08 2014 (r267166) +++ head/sys/net/netmap.h Fri Jun 6 15:15:27 2014 (r267167) @@ -124,7 +124,7 @@ * space with a parent device. The ifname indicates the parent device, * which must already exist. Flags in nr_flags indicate if we want to * bind the master or slave side, the index (from nr_ringid) - * is just a cookie and does need to be sequential. + * is just a cookie and does not need to be sequential. * * + NIOCREGIF can also attach to 'monitor' rings that replicate * the content of specific rings, also from the same memory space. @@ -228,7 +228,7 @@ struct netmap_slot { * 'head' and 'cur' must be incremented as slots are filled * with new packets to be sent; * 'cur' can be moved further ahead if we need more space - * for new transmissions. + * for new transmissions. XXX todo (2014-03-12) * * In RX rings: * @@ -454,20 +454,6 @@ struct netmap_if { /* * struct nmreq overlays a struct ifreq (just the name) - * - * On input, nr_ringid indicates which rings we are requesting, - * with the low flags for the specific ring number. - * selection FLAGS RING INDEX - * - * all the NIC rings 0x0000 - - * only HOST ring 0x2000 ring index - * single NIC ring 0x4000 - - * all the NIC+HOST rings 0x6000 - - * one pipe ring, master 0x8000 ring index - * *** INVALID 0xA000 - * one pipe ring, slave 0xC000 ring index - * *** INVALID 0xE000 - * */ struct nmreq { char nr_name[IFNAMSIZ]; From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 15:17:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A227AB7; Fri, 6 Jun 2014 15:17:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2B392CB0; Fri, 6 Jun 2014 15:17:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56FHJE3087250; Fri, 6 Jun 2014 15:17:19 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56FHJoL087249; Fri, 6 Jun 2014 15:17:19 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406061517.s56FHJoL087249@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 6 Jun 2014 15:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267168 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 15:17:20 -0000 Author: luigi Date: Fri Jun 6 15:17:19 2014 New Revision: 267168 URL: http://svnweb.freebsd.org/changeset/base/267168 Log: misc bugfixes: - stdio.h is needed for fprint() - make memsize uint32_t to avoid errors due to overflow - honor the *XPOLL flagg in NIOCREGIF requests - mmap fails wit MAP_FAILED, not NULL. MFC after: 3 days Modified: head/sys/net/netmap_user.h Modified: head/sys/net/netmap_user.h ============================================================================== --- head/sys/net/netmap_user.h Fri Jun 6 15:15:27 2014 (r267167) +++ head/sys/net/netmap_user.h Fri Jun 6 15:17:19 2014 (r267168) @@ -133,6 +133,7 @@ nm_ring_space(struct netmap_ring *ring) #ifndef HAVE_NETMAP_WITH_LIBS #define HAVE_NETMAP_WITH_LIBS +#include #include #include #include /* memset */ @@ -192,7 +193,7 @@ struct nm_desc { struct nm_desc *self; /* point to self if netmap. */ int fd; void *mem; - int memsize; + uint32_t memsize; int done_mmap; /* set if mem is the result of mmap */ struct netmap_if * const nifp; uint16_t first_tx_ring, last_tx_ring, cur_tx_ring; @@ -404,8 +405,6 @@ nm_open(const char *ifname, const struct errmsg = "invalid ringid"; goto fail; } - /* add the *XPOLL flags */ - nr_ringid |= new_flags & (NETMAP_NO_TX_POLL | NETMAP_DO_RX_POLL); d = (struct nm_desc *)calloc(1, sizeof(*d)); if (d == NULL) { @@ -461,6 +460,9 @@ nm_open(const char *ifname, const struct d->req.nr_flags = parent->req.nr_flags; } } + /* add the *XPOLL flags */ + d->req.nr_ringid |= new_flags & (NETMAP_NO_TX_POLL | NETMAP_DO_RX_POLL); + if (ioctl(d->fd, NIOCREGIF, &d->req)) { errmsg = "NIOCREGIF failed"; goto fail; @@ -472,10 +474,11 @@ nm_open(const char *ifname, const struct d->memsize = parent->memsize; d->mem = parent->mem; } else { + /* XXX TODO: check if memsize is too large (or there is overflow) */ d->memsize = d->req.nr_memsize; d->mem = mmap(0, d->memsize, PROT_WRITE | PROT_READ, MAP_SHARED, d->fd, 0); - if (d->mem == NULL) { + if (d->mem == MAP_FAILED) { errmsg = "mmap failed"; goto fail; } From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 15:47:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA9E5647; Fri, 6 Jun 2014 15:47:06 +0000 (UTC) Received: from mail-we0-x22a.google.com (mail-we0-x22a.google.com [IPv6:2a00:1450:400c:c03::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E87FD208D; Fri, 6 Jun 2014 15:47:05 +0000 (UTC) Received: by mail-we0-f170.google.com with SMTP id u57so3109299wes.1 for ; Fri, 06 Jun 2014 08:47:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=AFZq6ZM9MyYJZ+DCgr1Scz3ZcLEhj0T61XijrjLeONs=; b=SEfCkkS//02UvJ96NJZ4URlZz3goE8sgrHj9IzlML/KrxeUBwCdig8lAk/UHtaTy79 +38vYtphFmwxlbOAh501VAPNOP0oczvrGVILKjOap8gsIZ8dY5uL5xkiVjZhDCUEPBJ2 JsJcr60rnUdADBrPS80TzBsX6FzwQ4Eo4jsnY8g4DZBKS4+81jdJ7SHo9zitUeKyn9z1 c9Y+VeNUoBPUfaylcSYXu3D/M52xzGAPDthA9dzzvDFP5+siPt7h2FyCiLGJQrJ7nBZO rfNPwg49xeb+o0xMa8WZJle5BOcWt0v4aHoApRv7UVBirFjmaBqzCsgkC+hmebPndItM Vgsw== X-Received: by 10.180.94.163 with SMTP id dd3mr6631485wib.26.1402069624164; Fri, 06 Jun 2014 08:47:04 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id b19sm22023404wic.5.2014.06.06.08.47.03 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 06 Jun 2014 08:47:03 -0700 (PDT) Date: Fri, 6 Jun 2014 17:47:01 +0200 From: Mateusz Guzik To: Dmitry Chagin Subject: Re: svn commit: r266925 - in head/sys: amd64/linux32 i386/linux kern sys Message-ID: <20140606154701.GA26114@dft-labs.eu> References: <201405311501.s4VF1pR8062552@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201405311501.s4VF1pR8062552@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 15:47:06 -0000 On Sat, May 31, 2014 at 03:01:51PM +0000, Dmitry Chagin wrote: > Author: dchagin > Date: Sat May 31 15:01:51 2014 > New Revision: 266925 > URL: http://svnweb.freebsd.org/changeset/base/266925 > > Log: > To allow to run the interpreter itself add a new ELF branding type. > Allow Linux ABI to run ELF interpreter. > [..] > + /* Some ABI allows to run the interpreter itself. */ > + for (i = 0; i < MAX_BRANDS; i++) { > + bi = elf_brand_list[i]; > + if (bi == NULL || bi->flags & BI_BRAND_NOTE_MANDATORY) > + continue; > + if (hdr->e_machine != bi->machine || > + (bi->flags & BI_CAN_EXEC_INTERP) == 0) > + continue; > + /* > + * Compare the interpreter name not the path to allow run it > + * from everywhere. > + */ > + interp_brand_name = strrchr(bi->interp_path, '/'); > + if (interp_brand_name == NULL) > + interp_brand_name = bi->interp_path; > + interp_len = strlen(interp_brand_name); > + fname_name = strrchr(imgp->args->fname, '/'); Don't know about the rest, but this part looks incorrect. fname is NULL (which will crash in strrchr) when fexecve is executed. > + if (fname_name == NULL) > + fname_name = imgp->args->fname; > + fname_len = strlen(fname_name); > + if (fname_len < interp_len) > + continue; > + ret = strncmp(fname_name, interp_brand_name, interp_len); > + if (ret == 0) > + return (bi); > + } > + -- Mateusz Guzik From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 16:18:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4FDF724D; Fri, 6 Jun 2014 16:18:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D56923B3; Fri, 6 Jun 2014 16:18:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56GIb9F017153; Fri, 6 Jun 2014 16:18:37 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56GIb48017152; Fri, 6 Jun 2014 16:18:37 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201406061618.s56GIb48017152@svn.freebsd.org> From: Tycho Nightingale Date: Fri, 6 Jun 2014 16:18:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267169 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 16:18:38 -0000 Author: tychon Date: Fri Jun 6 16:18:37 2014 New Revision: 267169 URL: http://svnweb.freebsd.org/changeset/base/267169 Log: Some devices (e.g. Intel AHCI and NICs) support quad-word access to register pairs where two 32-bit registers make up a larger logical size. Support those access by splitting the quad-word into two double-words. Reviewed by: grehan Modified: head/usr.sbin/bhyve/pci_emul.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Fri Jun 6 15:17:19 2014 (r267168) +++ head/usr.sbin/bhyve/pci_emul.c Fri Jun 6 16:18:37 2014 (r267169) @@ -375,10 +375,27 @@ pci_emul_mem_handler(struct vmctx *ctx, offset = addr - pdi->pi_bar[bidx].addr; - if (dir == MEM_F_WRITE) - (*pe->pe_barwrite)(ctx, vcpu, pdi, bidx, offset, size, *val); - else - *val = (*pe->pe_barread)(ctx, vcpu, pdi, bidx, offset, size); + if (dir == MEM_F_WRITE) { + if (pdi->pi_bar[bidx].type == PCIBAR_MEM32 && size == 8) { + (*pe->pe_barwrite)(ctx, vcpu, pdi, bidx, offset, + 4, *val & 0xffffffff); + (*pe->pe_barwrite)(ctx, vcpu, pdi, bidx, offset + 4, + 4, *val >> 32); + } else { + (*pe->pe_barwrite)(ctx, vcpu, pdi, bidx, offset, + size, *val); + } + } else { + if (pdi->pi_bar[bidx].type == PCIBAR_MEM32 && size == 8) { + *val = (*pe->pe_barread)(ctx, vcpu, pdi, bidx, + offset, 4); + *val |= (*pe->pe_barread)(ctx, vcpu, pdi, bidx, + offset + 4, 4) << 32; + } else { + *val = (*pe->pe_barread)(ctx, vcpu, pdi, bidx, + offset, size); + } + } return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 16:23:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A2C04DA; Fri, 6 Jun 2014 16:23:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57D8B2472; Fri, 6 Jun 2014 16:23:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56GN9ZP020837; Fri, 6 Jun 2014 16:23:09 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56GN9uJ020835; Fri, 6 Jun 2014 16:23:09 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406061623.s56GN9uJ020835@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 6 Jun 2014 16:23:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267170 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 16:23:09 -0000 Author: luigi Date: Fri Jun 6 16:23:08 2014 New Revision: 267170 URL: http://svnweb.freebsd.org/changeset/base/267170 Log: move netmap_getna() to a freebsd-specific file Modified: head/sys/dev/netmap/netmap_freebsd.c head/sys/dev/netmap/netmap_generic.c Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Fri Jun 6 16:18:37 2014 (r267169) +++ head/sys/dev/netmap/netmap_freebsd.c Fri Jun 6 16:23:08 2014 (r267170) @@ -223,6 +223,14 @@ generic_xmit_frame(struct ifnet *ifp, st } +#if __FreeBSD_version >= 1100005 +struct netmap_adapter * +netmap_getna(if_t ifp) +{ + return (NA((struct ifnet *)ifp)); +} +#endif /* __FreeBSD_version >= 1100005 */ + /* * The following two functions are empty until we have a generic * way to extract the info from the ifp Modified: head/sys/dev/netmap/netmap_generic.c ============================================================================== --- head/sys/dev/netmap/netmap_generic.c Fri Jun 6 16:18:37 2014 (r267169) +++ head/sys/dev/netmap/netmap_generic.c Fri Jun 6 16:23:08 2014 (r267170) @@ -811,9 +811,3 @@ generic_netmap_attach(struct ifnet *ifp) return retval; } - -struct netmap_adapter * -netmap_getna(if_t ifp) -{ - return (NA((struct ifnet *)ifp)); -} From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 16:37:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9A3289A; Fri, 6 Jun 2014 16:37:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE3AF25A9; Fri, 6 Jun 2014 16:37:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56GbhOA025760; Fri, 6 Jun 2014 16:37:43 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56Gbhmg025757; Fri, 6 Jun 2014 16:37:43 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201406061637.s56Gbhmg025757@svn.freebsd.org> From: Kevin Lo Date: Fri, 6 Jun 2014 16:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267171 - in head/sys/arm: at91 freescale/imx ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 16:37:44 -0000 Author: kevlo Date: Fri Jun 6 16:37:42 2014 New Revision: 267171 URL: http://svnweb.freebsd.org/changeset/base/267171 Log: Remove extra semicolons. Modified: head/sys/arm/at91/board_tsc4370.c head/sys/arm/freescale/imx/imx_sdhci.c head/sys/arm/ti/am335x/am335x_lcd.c Modified: head/sys/arm/at91/board_tsc4370.c ============================================================================== --- head/sys/arm/at91/board_tsc4370.c Fri Jun 6 16:23:08 2014 (r267170) +++ head/sys/arm/at91/board_tsc4370.c Fri Jun 6 16:37:42 2014 (r267171) @@ -332,19 +332,19 @@ set_mac_from_idprom(void) DEVOFFSET_BSO_SIGNATURE + sizeof(sig), &dev_offset, sizeof(dev_offset)); if (status == -1) - return -1;; + return -1; /* Check for the boot section signature. */ status = eeprom_read(EE_DEV_ADDR, dev_offset + OFFSET_BS_SIGNATURE, &sig, sizeof(sig)); if ((status == -1) || (sig != BS_SIGNATURE)) - return -1;; + return -1; } dev_offset += OFFSET_EUI64; /* Read the EUI64 from the device. */ if (eeprom_read(EE_DEV_ADDR, dev_offset, eui64, sizeof(eui64)) == -1) - return -1;; + return -1; /* Transcribe the EUI-64 to a MAC-48. * Modified: head/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- head/sys/arm/freescale/imx/imx_sdhci.c Fri Jun 6 16:23:08 2014 (r267170) +++ head/sys/arm/freescale/imx/imx_sdhci.c Fri Jun 6 16:37:42 2014 (r267171) @@ -153,7 +153,7 @@ static struct ofw_compat_data compat_dat {"fsl,imx53-esdhc", HWTYPE_ESDHC}, {"fsl,imx51-esdhc", HWTYPE_ESDHC}, {NULL, HWTYPE_NONE}, -};; +}; static void imx_sdhc_set_clock(struct imx_sdhci_softc *sc, int enable); static void imx_sdhci_r1bfix_func(void *arg); Modified: head/sys/arm/ti/am335x/am335x_lcd.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_lcd.c Fri Jun 6 16:23:08 2014 (r267170) +++ head/sys/arm/ti/am335x/am335x_lcd.c Fri Jun 6 16:37:42 2014 (r267171) @@ -223,7 +223,7 @@ am335x_lcd_sysctl_backlight(SYSCTL_HANDL int error; int backlight; - backlight = sc->sc_backlight;; + backlight = sc->sc_backlight; error = sysctl_handle_int(oidp, &backlight, 0, req); if (error != 0 || req->newptr == NULL) From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 17:03:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7164F44; Fri, 6 Jun 2014 17:03:23 +0000 (UTC) Received: from mail-lb0-x235.google.com (mail-lb0-x235.google.com [IPv6:2a00:1450:4010:c04::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D18012831; Fri, 6 Jun 2014 17:03:22 +0000 (UTC) Received: by mail-lb0-f181.google.com with SMTP id q8so1724391lbi.12 for ; Fri, 06 Jun 2014 10:03:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=99wqtcfgAACQIActdbi9sPYJjnusBPRCmINztugfhh8=; b=jOVdvlMhjOi/JANdwGZLfK9c8ilOQPIpHnzbaGNHO7evzXb4V5E2yvq3nXsy9DWF74 uhVWjD3LyY8ZKVPQWRGYAmkcSUzhraVw+8gRTa3PqtQ8AD7I/V4dVUV782sgVrbPZQph PAe6D15nNctMbx8dcwWERQ0Oeg4ndm45eA/6OoBGNyPJTYzdX8cnzbNQeKHeUNc+kVhu 5UG4V5XCf6pYYptDjLD3VhK8jQKxi7wgtOeWN3qYrljLnJEnvl5jgRymEeMV+RNkxku7 3oHjQ5q05w6qoLA2UTT+5U4gypUiW8uiGBdZPDsgDCddvtbgPeQHW9n8NnxqN8TA77n9 DD3g== X-Received: by 10.112.51.37 with SMTP id h5mr4395663lbo.24.1402074200790; Fri, 06 Jun 2014 10:03:20 -0700 (PDT) Received: from dchagin.static.corbina.net (dchagin.static.corbina.ru. [78.107.232.239]) by mx.google.com with ESMTPSA id z1sm8193665lal.6.2014.06.06.10.03.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jun 2014 10:03:19 -0700 (PDT) Sender: Dmitry Chagin Received: from dchagin.static.corbina.net (localhost [127.0.0.1]) by dchagin.static.corbina.net (8.14.9/8.14.8) with ESMTP id s56H3Iwl004086; Fri, 6 Jun 2014 21:03:18 +0400 (MSK) (envelope-from dchagin@dchagin.static.corbina.net) Received: (from dchagin@localhost) by dchagin.static.corbina.net (8.14.9/8.14.8/Submit) id s56H3InR004085; Fri, 6 Jun 2014 21:03:18 +0400 (MSK) (envelope-from dchagin) Date: Fri, 6 Jun 2014 21:03:18 +0400 From: Chagin Dmitry To: Mateusz Guzik Subject: Re: svn commit: r266925 - in head/sys: amd64/linux32 i386/linux kern sys Message-ID: <20140606170318.GA4076@dchagin.static.corbina.net> References: <201405311501.s4VF1pR8062552@svn.freebsd.org> <20140606154701.GA26114@dft-labs.eu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VS++wcV0S1rZb1Fb" Content-Disposition: inline In-Reply-To: <20140606154701.GA26114@dft-labs.eu> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 17:03:23 -0000 --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 06, 2014 at 05:47:01PM +0200, Mateusz Guzik wrote: > On Sat, May 31, 2014 at 03:01:51PM +0000, Dmitry Chagin wrote: > > Author: dchagin > > Date: Sat May 31 15:01:51 2014 > > New Revision: 266925 > > URL: http://svnweb.freebsd.org/changeset/base/266925 > >=20 > > Log: > > To allow to run the interpreter itself add a new ELF branding type. > > Allow Linux ABI to run ELF interpreter. > > =20 >=20 > [..] >=20 > > + /* Some ABI allows to run the interpreter itself. */ > > + for (i =3D 0; i < MAX_BRANDS; i++) { > > + bi =3D elf_brand_list[i]; > > + if (bi =3D=3D NULL || bi->flags & BI_BRAND_NOTE_MANDATORY) > > + continue; > > + if (hdr->e_machine !=3D bi->machine || > > + (bi->flags & BI_CAN_EXEC_INTERP) =3D=3D 0) > > + continue; > > + /* > > + * Compare the interpreter name not the path to allow run it > > + * from everywhere. > > + */ > > + interp_brand_name =3D strrchr(bi->interp_path, '/'); > > + if (interp_brand_name =3D=3D NULL) > > + interp_brand_name =3D bi->interp_path; > > + interp_len =3D strlen(interp_brand_name); > > + fname_name =3D strrchr(imgp->args->fname, '/'); >=20 > Don't know about the rest, but this part looks incorrect. >=20 > fname is NULL (which will crash in strrchr) when fexecve is executed. >=20 yes, indeed. will fix, thanks > > + if (fname_name =3D=3D NULL) > > + fname_name =3D imgp->args->fname; > > + fname_len =3D strlen(fname_name); > > + if (fname_len < interp_len) > > + continue; > > + ret =3D strncmp(fname_name, interp_brand_name, interp_len); > > + if (ret =3D=3D 0) > > + return (bi); > > + } > > + >=20 >=20 > --=20 > Mateusz Guzik --=20 Have fun! chd --VS++wcV0S1rZb1Fb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlOR9FYACgkQ0t2Tb3OO/O0epgCgv3ULNBtfdx1CHNCcV+4gPped RVkAniithXjQPp868zNReeI3DWYzcUWK =7K9X -----END PGP SIGNATURE----- --VS++wcV0S1rZb1Fb-- From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 17:05:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C154C242; Fri, 6 Jun 2014 17:05:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE6A22853; Fri, 6 Jun 2014 17:05:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56H5iCo038973; Fri, 6 Jun 2014 17:05:44 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56H5hmE038968; Fri, 6 Jun 2014 17:05:43 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201406061705.s56H5hmE038968@svn.freebsd.org> From: Julio Merino Date: Fri, 6 Jun 2014 17:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267172 - in head: . lib/atf/libatf-c lib/atf/libatf-c++ tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 17:05:44 -0000 Author: jmmv Date: Fri Jun 6 17:05:43 2014 New Revision: 267172 URL: http://svnweb.freebsd.org/changeset/base/267172 Log: Homogenize libatf-* version numbers with upstream. The libatf-* major version numbers in FreeBSD were one version ahead of upstream because, when atf was first imported into FreeBSD, the upstream numbers were not respected. This is just confusing and bound to cause problems down the road. Fix this by taking advantage of the fact that libatf-* are now private and that atf is not yet built by default. However, and unfortunately, a clean build is needed for tests to continue working once "make delete-old-libs" has been run; hence the note in UPDATING. Modified: head/UPDATING head/lib/atf/libatf-c++/Makefile head/lib/atf/libatf-c/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Jun 6 16:37:42 2014 (r267171) +++ head/UPDATING Fri Jun 6 17:05:43 2014 (r267172) @@ -31,6 +31,22 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20140606: + The libatf-c and libatf-c++ major versions were downgraded to 0 and + 1 respectively to match the upstream numbers. They were out of + sync because, when they were originally added to FreeBSD, the + upstream versions were not respected. These libraries are private + and not yet built by default, so renumbering them should be a + non-issue. However, unclean source trees will yield broken test + programs once the operator executes "make delete-old-libs" after a + "make installworld". + + If you are using WITH_TESTS=yes (not the default), wipe the object + tree and rebuild from scratch to prevent spurious test failures. + This is only needed once: the old, misnumbered libraries have been + added to OptionalObsoleteFiles.inc so they will be removed during a + clean upgrade. + 20140512: Clang and llvm have been upgraded to 3.4.1 release. Modified: head/lib/atf/libatf-c++/Makefile ============================================================================== --- head/lib/atf/libatf-c++/Makefile Fri Jun 6 16:37:42 2014 (r267171) +++ head/lib/atf/libatf-c++/Makefile Fri Jun 6 17:05:43 2014 (r267172) @@ -30,7 +30,7 @@ LIB= atf-c++ PRIVATELIB= true -SHLIB_MAJOR= 2 +SHLIB_MAJOR= 1 # libatf-c++ depends on the C version of the ATF library to build. DPADD= ${LIBATFC} Modified: head/lib/atf/libatf-c/Makefile ============================================================================== --- head/lib/atf/libatf-c/Makefile Fri Jun 6 16:37:42 2014 (r267171) +++ head/lib/atf/libatf-c/Makefile Fri Jun 6 17:05:43 2014 (r267172) @@ -30,7 +30,7 @@ LIB= atf-c PRIVATELIB= true -SHLIB_MAJOR= 1 +SHLIB_MAJOR= 0 ATF= ${.CURDIR:H:H:H}/contrib/atf .PATH: ${ATF} Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jun 6 16:37:42 2014 (r267171) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jun 6 17:05:43 2014 (r267172) @@ -4112,6 +4112,8 @@ OLD_LIBS+=usr/lib/libatf-c.a OLD_LIBS+=usr/lib/libatf-c.so OLD_LIBS+=usr/lib/libatf-c.so.1 OLD_LIBS+=usr/lib/libatf-c_p.a +OLD_LIBS+=usr/lib/private/libatf-c.so.1 +OLD_LIBS+=usr/lib/private/libatf-c++.so.2 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" OLD_LIBS+=usr/lib32/libatf-c++.a OLD_LIBS+=usr/lib32/libatf-c++.so @@ -4122,6 +4124,8 @@ OLD_LIBS+=usr/lib32/libatf-c.a OLD_LIBS+=usr/lib32/libatf-c.so OLD_LIBS+=usr/lib32/libatf-c.so.1 OLD_LIBS+=usr/lib32/libatf-c_p.a +OLD_LIBS+=usr/lib32/private/libatf-c.so.1 +OLD_LIBS+=usr/lib32/private/libatf-c++.so.2 .endif OLD_FILES+=usr/libdata/pkgconfig/atf-c++.pc OLD_FILES+=usr/libdata/pkgconfig/atf-c.pc From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 17:38:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B5D1DC0; Fri, 6 Jun 2014 17:38:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88D112B3B; Fri, 6 Jun 2014 17:38:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56HcUup052783; Fri, 6 Jun 2014 17:38:30 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56HcUlU052782; Fri, 6 Jun 2014 17:38:30 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406061738.s56HcUlU052782@svn.freebsd.org> From: Ed Maste Date: Fri, 6 Jun 2014 17:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267173 - head/tools/tools/vt/fontcvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 17:38:30 -0000 Author: emaste Date: Fri Jun 6 17:38:30 2014 New Revision: 267173 URL: http://svnweb.freebsd.org/changeset/base/267173 Log: Update after r267011: use -h height and -w width args Modified: head/tools/tools/vt/fontcvt/terminus.sh Modified: head/tools/tools/vt/fontcvt/terminus.sh ============================================================================== --- head/tools/tools/vt/fontcvt/terminus.sh Fri Jun 6 17:05:43 2014 (r267172) +++ head/tools/tools/vt/fontcvt/terminus.sh Fri Jun 6 17:38:30 2014 (r267173) @@ -1,10 +1,12 @@ #!/bin/sh +# $FreeBSD$ + for i in 6:12 8:14 8:16 10:18 10:20 11:22 12:24 14:28 16:32 do C=`echo $i | cut -f 1 -d :` R=`echo $i | cut -f 2 -d :` ./fontcvt \ - $C $R \ + -w $C -h $R \ ~/terminus-font-4.36/ter-u${R}n.bdf \ ~/terminus-font-4.36/ter-u${R}b.bdf \ terminus-u${R}.vfnt From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 17:38:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B830CEF8; Fri, 6 Jun 2014 17:38:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A523B2B3D; Fri, 6 Jun 2014 17:38:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56HccHH052841; Fri, 6 Jun 2014 17:38:38 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56HccXq052837; Fri, 6 Jun 2014 17:38:38 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201406061738.s56HccXq052837@svn.freebsd.org> From: Bryan Drewery Date: Fri, 6 Jun 2014 17:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267174 - head/usr.bin/rpcgen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 17:38:38 -0000 Author: bdrewery Date: Fri Jun 6 17:38:37 2014 New Revision: 267174 URL: http://svnweb.freebsd.org/changeset/base/267174 Log: Fix some rpcgen sample file issues. * -Sc was generating code without a return type on main. * -Sm was generating an unusable clean target due to undefined RM. * -Sm was generating clean target with extra preceding space. PR: 185582 Submitted by: Pawel Biernacki MFC after: 1 week Modified: head/usr.bin/rpcgen/rpc_main.c head/usr.bin/rpcgen/rpc_sample.c Modified: head/usr.bin/rpcgen/rpc_main.c ============================================================================== --- head/usr.bin/rpcgen/rpc_main.c Fri Jun 6 17:38:30 2014 (r267173) +++ head/usr.bin/rpcgen/rpc_main.c Fri Jun 6 17:38:37 2014 (r267174) @@ -878,8 +878,8 @@ $(TARGETS_SVC.c) \n\n"); f_print(fout, "\t$(CC) -o $(CLIENT) $(OBJECTS_CLNT) \ $(LDLIBS) \n\n"); f_print(fout, "$(SERVER) : $(OBJECTS_SVC) \n"); - f_print(fout, "\t$(CC) -o $(SERVER) $(OBJECTS_SVC) $(LDLIBS)\n\n "); - f_print(fout, "clean:\n\t $(RM) -f core $(TARGETS) $(OBJECTS_CLNT) \ + f_print(fout, "\t$(CC) -o $(SERVER) $(OBJECTS_SVC) $(LDLIBS)\n\n"); + f_print(fout, "clean:\n\t rm -f core $(TARGETS) $(OBJECTS_CLNT) \ $(OBJECTS_SVC) $(CLIENT) $(SERVER)\n\n"); } Modified: head/usr.bin/rpcgen/rpc_sample.c ============================================================================== --- head/usr.bin/rpcgen/rpc_sample.c Fri Jun 6 17:38:30 2014 (r267173) +++ head/usr.bin/rpcgen/rpc_sample.c Fri Jun 6 17:38:37 2014 (r267174) @@ -270,6 +270,7 @@ write_sample_clnt_main(void) version_list *vp; f_print(fout, "\n\n"); + f_print(fout, "int\n"); f_print(fout, "main(int argc, char *argv[])\n{\n"); f_print(fout, "\tchar *host;"); From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 17:53:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5C7CA5B; Fri, 6 Jun 2014 17:53:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A33662CF6; Fri, 6 Jun 2014 17:53:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56Hr5Od061113; Fri, 6 Jun 2014 17:53:05 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56Hr5ni061112; Fri, 6 Jun 2014 17:53:05 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201406061753.s56Hr5ni061112@svn.freebsd.org> From: Julio Merino Date: Fri, 6 Jun 2014 17:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267176 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 17:53:05 -0000 Author: jmmv Date: Fri Jun 6 17:53:05 2014 New Revision: 267176 URL: http://svnweb.freebsd.org/changeset/base/267176 Log: Add the *_TESTS_SH_SED_* functionality to atf.test.mk. This exists already in plain.test.mk and tap.test.mk and should have been added to atf.test.mk too when the feature was first introduced. (It is probably time to address the related TODOs but I will do that separately.) Modified: head/share/mk/atf.test.mk Modified: head/share/mk/atf.test.mk ============================================================================== --- head/share/mk/atf.test.mk Fri Jun 6 17:42:55 2014 (r267175) +++ head/share/mk/atf.test.mk Fri Jun 6 17:53:05 2014 (r267176) @@ -98,10 +98,14 @@ _TESTS+= ${ATF_TESTS_SH} SCRIPTSDIR_${_T}= ${TESTSDIR} TEST_INTERFACE.${_T}= atf CLEANFILES+= ${_T} ${_T}.tmp +# TODO(jmmv): It seems to me that this SED and SRC functionality should +# exist in bsd.prog.mk along the support for SCRIPTS. Move it there if +# this proves to be useful within the tests. +ATF_TESTS_SH_SED_${_T}?= # empty ATF_TESTS_SH_SRC_${_T}?= ${_T}.sh ${_T}: ${ATF_TESTS_SH_SRC_${_T}} echo '#! /usr/bin/atf-sh' > ${.TARGET}.tmp - cat ${.ALLSRC} >> ${.TARGET}.tmp + cat ${.ALLSRC} | sed ${ATF_TESTS_SH_SED_${_T}} >>${.TARGET}.tmp chmod +x ${.TARGET}.tmp mv ${.TARGET}.tmp ${.TARGET} .endfor From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 18:02:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 666EE162; Fri, 6 Jun 2014 18:02:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 471AC2E02; Fri, 6 Jun 2014 18:02:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56I2Xn4065772; Fri, 6 Jun 2014 18:02:33 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56I2WeZ065768; Fri, 6 Jun 2014 18:02:32 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406061802.s56I2WeZ065768@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 6 Jun 2014 18:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267177 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 18:02:33 -0000 Author: luigi Date: Fri Jun 6 18:02:32 2014 New Revision: 267177 URL: http://svnweb.freebsd.org/changeset/base/267177 Log: introduce mbq_lock() and mbq_unlock() for the mbq, so it is easier to buil the same code on linux (this generalizes the change in svn 267142) MFC after: 3 days Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_mbq.c head/sys/dev/netmap/netmap_mbq.h Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Fri Jun 6 17:53:05 2014 (r267176) +++ head/sys/dev/netmap/netmap.c Fri Jun 6 18:02:32 2014 (r267177) @@ -1050,7 +1050,7 @@ netmap_rxsync_from_host(struct netmap_ad (void)pwait; /* disable unused warnings */ (void)td; - mtx_lock_spin(&q->lock); + mbq_lock(q); /* First part: import newly received packets */ n = mbq_len(q); @@ -1092,7 +1092,7 @@ netmap_rxsync_from_host(struct netmap_ad if (kring->rcur == kring->rtail && td) /* no bufs available */ selrecord(td, &kring->si); - mtx_unlock_spin(&q->lock); + mbq_unlock(q); return ret; } @@ -2459,7 +2459,7 @@ netmap_transmit(struct ifnet *ifp, struc * not possible on Linux). * Also avoid overflowing the queue. */ - mtx_lock_spin(&q->lock); + mbq_lock(q); space = kring->nr_hwtail - kring->nr_hwcur; if (space < 0) @@ -2476,7 +2476,7 @@ netmap_transmit(struct ifnet *ifp, struc m = NULL; error = 0; } - mtx_unlock_spin(&q->lock); + mbq_unlock(q); done: if (m) Modified: head/sys/dev/netmap/netmap_mbq.c ============================================================================== --- head/sys/dev/netmap/netmap_mbq.c Fri Jun 6 17:53:05 2014 (r267176) +++ head/sys/dev/netmap/netmap_mbq.c Fri Jun 6 18:02:32 2014 (r267177) @@ -76,9 +76,9 @@ static inline void __mbq_enqueue(struct void mbq_safe_enqueue(struct mbq *q, struct mbuf *m) { - mtx_lock_spin(&q->lock); + mbq_lock(q); __mbq_enqueue(q, m); - mtx_unlock_spin(&q->lock); + mbq_unlock(q); } @@ -110,9 +110,9 @@ struct mbuf *mbq_safe_dequeue(struct mbq { struct mbuf *ret; - mtx_lock_spin(&q->lock); + mbq_lock(q); ret = __mbq_dequeue(q); - mtx_unlock_spin(&q->lock); + mbq_unlock(q); return ret; } Modified: head/sys/dev/netmap/netmap_mbq.h ============================================================================== --- head/sys/dev/netmap/netmap_mbq.h Fri Jun 6 17:53:05 2014 (r267176) +++ head/sys/dev/netmap/netmap_mbq.h Fri Jun 6 18:02:32 2014 (r267177) @@ -62,7 +62,17 @@ void mbq_enqueue(struct mbq *q, struct m struct mbuf *mbq_dequeue(struct mbq *q); void mbq_purge(struct mbq *q); -/* XXX missing mbq_lock() and mbq_unlock */ +static inline void +mbq_lock(struct mbq *q) +{ + mtx_lock_spin(&q->lock); +} + +static inline void +mbq_unlock(struct mbq *q) +{ + mtx_unlock_spin(&q->lock); +} void mbq_safe_init(struct mbq *q); void mbq_safe_destroy(struct mbq *q); From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 18:23:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0487D0E; Fri, 6 Jun 2014 18:23:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CB8E2038; Fri, 6 Jun 2014 18:23:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56INowN075243; Fri, 6 Jun 2014 18:23:50 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56INoha075238; Fri, 6 Jun 2014 18:23:50 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201406061823.s56INoha075238@svn.freebsd.org> From: Tycho Nightingale Date: Fri, 6 Jun 2014 18:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267178 - in head/sys/amd64/vmm: intel io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 18:23:50 -0000 Author: tychon Date: Fri Jun 6 18:23:49 2014 New Revision: 267178 URL: http://svnweb.freebsd.org/changeset/base/267178 Log: Support guest accesses to %cr8. Reviewed by: neel Modified: head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/io/vlapic.h Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Fri Jun 6 18:02:32 2014 (r267177) +++ head/sys/amd64/vmm/intel/vmx.c Fri Jun 6 18:23:49 2014 (r267178) @@ -83,7 +83,9 @@ __FBSDID("$FreeBSD$"); (PROCBASED_SECONDARY_CONTROLS | \ PROCBASED_IO_EXITING | \ PROCBASED_MSR_BITMAPS | \ - PROCBASED_CTLS_WINDOW_SETTING) + PROCBASED_CTLS_WINDOW_SETTING | \ + PROCBASED_CR8_LOAD_EXITING | \ + PROCBASED_CR8_STORE_EXITING) #define PROCBASED_CTLS_ZERO_SETTING \ (PROCBASED_CR3_LOAD_EXITING | \ PROCBASED_CR3_STORE_EXITING | \ @@ -714,6 +716,13 @@ vmx_init(int ipinum) procbased_ctls2 &= ~PROCBASED2_VIRTUALIZE_X2APIC_MODE; /* + * No need to emulate accesses to %CR8 if virtual + * interrupt delivery is enabled. + */ + procbased_ctls &= ~PROCBASED_CR8_LOAD_EXITING; + procbased_ctls &= ~PROCBASED_CR8_STORE_EXITING; + + /* * Check for Posted Interrupts only if Virtual Interrupt * Delivery is enabled. */ @@ -1426,97 +1435,130 @@ vmx_emulate_xsetbv(struct vmx *vmx, int return (HANDLED); } -static int -vmx_emulate_cr_access(struct vmx *vmx, int vcpu, uint64_t exitqual) +static uint64_t +vmx_get_guest_reg(struct vmx *vmx, int vcpu, int ident) { - int cr, vmcs_guest_cr, vmcs_shadow_cr; - uint64_t crval, regval, ones_mask, zeros_mask; const struct vmxctx *vmxctx; - /* We only handle mov to %cr0 or %cr4 at this time */ - if ((exitqual & 0xf0) != 0x00) - return (UNHANDLED); + vmxctx = &vmx->ctx[vcpu]; - cr = exitqual & 0xf; - if (cr != 0 && cr != 4) - return (UNHANDLED); + switch (ident) { + case 0: + return (vmxctx->guest_rax); + case 1: + return (vmxctx->guest_rcx); + case 2: + return (vmxctx->guest_rdx); + case 3: + return (vmxctx->guest_rbx); + case 4: + return (vmcs_read(VMCS_GUEST_RSP)); + case 5: + return (vmxctx->guest_rbp); + case 6: + return (vmxctx->guest_rsi); + case 7: + return (vmxctx->guest_rdi); + case 8: + return (vmxctx->guest_r8); + case 9: + return (vmxctx->guest_r9); + case 10: + return (vmxctx->guest_r10); + case 11: + return (vmxctx->guest_r11); + case 12: + return (vmxctx->guest_r12); + case 13: + return (vmxctx->guest_r13); + case 14: + return (vmxctx->guest_r14); + case 15: + return (vmxctx->guest_r15); + default: + panic("invalid vmx register %d", ident); + } +} + +static void +vmx_set_guest_reg(struct vmx *vmx, int vcpu, int ident, uint64_t regval) +{ + struct vmxctx *vmxctx; - regval = 0; /* silence gcc */ vmxctx = &vmx->ctx[vcpu]; - /* - * We must use vmcs_write() directly here because vmcs_setreg() will - * call vmclear(vmcs) as a side-effect which we certainly don't want. - */ - switch ((exitqual >> 8) & 0xf) { + switch (ident) { case 0: - regval = vmxctx->guest_rax; + vmxctx->guest_rax = regval; break; case 1: - regval = vmxctx->guest_rcx; + vmxctx->guest_rcx = regval; break; case 2: - regval = vmxctx->guest_rdx; + vmxctx->guest_rdx = regval; break; case 3: - regval = vmxctx->guest_rbx; + vmxctx->guest_rbx = regval; break; case 4: - regval = vmcs_read(VMCS_GUEST_RSP); + vmcs_write(VMCS_GUEST_RSP, regval); break; case 5: - regval = vmxctx->guest_rbp; + vmxctx->guest_rbp = regval; break; case 6: - regval = vmxctx->guest_rsi; + vmxctx->guest_rsi = regval; break; case 7: - regval = vmxctx->guest_rdi; + vmxctx->guest_rdi = regval; break; case 8: - regval = vmxctx->guest_r8; + vmxctx->guest_r8 = regval; break; case 9: - regval = vmxctx->guest_r9; + vmxctx->guest_r9 = regval; break; case 10: - regval = vmxctx->guest_r10; + vmxctx->guest_r10 = regval; break; case 11: - regval = vmxctx->guest_r11; + vmxctx->guest_r11 = regval; break; case 12: - regval = vmxctx->guest_r12; + vmxctx->guest_r12 = regval; break; case 13: - regval = vmxctx->guest_r13; + vmxctx->guest_r13 = regval; break; case 14: - regval = vmxctx->guest_r14; + vmxctx->guest_r14 = regval; break; case 15: - regval = vmxctx->guest_r15; + vmxctx->guest_r15 = regval; break; + default: + panic("invalid vmx register %d", ident); } +} - if (cr == 0) { - ones_mask = cr0_ones_mask; - zeros_mask = cr0_zeros_mask; - vmcs_guest_cr = VMCS_GUEST_CR0; - vmcs_shadow_cr = VMCS_CR0_SHADOW; - } else { - ones_mask = cr4_ones_mask; - zeros_mask = cr4_zeros_mask; - vmcs_guest_cr = VMCS_GUEST_CR4; - vmcs_shadow_cr = VMCS_CR4_SHADOW; - } - vmcs_write(vmcs_shadow_cr, regval); - - crval = regval | ones_mask; - crval &= ~zeros_mask; - vmcs_write(vmcs_guest_cr, crval); +static int +vmx_emulate_cr0_access(struct vmx *vmx, int vcpu, uint64_t exitqual) +{ + uint64_t crval, regval; + + /* We only handle mov to %cr0 at this time */ + if ((exitqual & 0xf0) != 0x00) + return (UNHANDLED); - if (cr == 0 && regval & CR0_PG) { + regval = vmx_get_guest_reg(vmx, vcpu, (exitqual >> 8) & 0xf); + + vmcs_write(VMCS_CR0_SHADOW, regval); + + crval = regval | cr0_ones_mask; + crval &= ~cr0_zeros_mask; + vmcs_write(VMCS_GUEST_CR0, crval); + + if (regval & CR0_PG) { uint64_t efer, entry_ctls; /* @@ -1537,6 +1579,48 @@ vmx_emulate_cr_access(struct vmx *vmx, i return (HANDLED); } +static int +vmx_emulate_cr4_access(struct vmx *vmx, int vcpu, uint64_t exitqual) +{ + uint64_t crval, regval; + + /* We only handle mov to %cr4 at this time */ + if ((exitqual & 0xf0) != 0x00) + return (UNHANDLED); + + regval = vmx_get_guest_reg(vmx, vcpu, (exitqual >> 8) & 0xf); + + vmcs_write(VMCS_CR4_SHADOW, regval); + + crval = regval | cr4_ones_mask; + crval &= ~cr4_zeros_mask; + vmcs_write(VMCS_GUEST_CR4, crval); + + return (HANDLED); +} + +static int +vmx_emulate_cr8_access(struct vmx *vmx, int vcpu, uint64_t exitqual) +{ + uint64_t regval; + + /* We only handle mov %cr8 to/from a register at this time. */ + if ((exitqual & 0xe0) != 0x00) { + return (UNHANDLED); + } + + if (exitqual & 0x10) { + regval = vlapic_get_tpr(vm_lapic(vmx->vm, vcpu)); + vmx_set_guest_reg(vmx, vcpu, (exitqual >> 8) & 0xf, + regval >> 4); + } else { + regval = vmx_get_guest_reg(vmx, vcpu, (exitqual >> 8) & 0xf); + vlapic_set_tpr(vm_lapic(vmx->vm, vcpu), regval << 4); + } + + return (HANDLED); +} + /* * From section "Guest Register State" in the Intel SDM: CPL = SS.DPL */ @@ -1929,7 +2013,17 @@ vmx_exit_process(struct vmx *vmx, int vc switch (reason) { case EXIT_REASON_CR_ACCESS: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_CR_ACCESS, 1); - handled = vmx_emulate_cr_access(vmx, vcpu, qual); + switch (qual & 0xf) { + case 0: + handled = vmx_emulate_cr0_access(vmx, vcpu, qual); + break; + case 4: + handled = vmx_emulate_cr4_access(vmx, vcpu, qual); + break; + case 8: + handled = vmx_emulate_cr8_access(vmx, vcpu, qual); + break; + } break; case EXIT_REASON_RDMSR: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_RDMSR, 1); Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Fri Jun 6 18:02:32 2014 (r267177) +++ head/sys/amd64/vmm/io/vlapic.c Fri Jun 6 18:23:49 2014 (r267178) @@ -1184,7 +1184,7 @@ vlapic_read(struct vlapic *vlapic, int m *data = lapic->version; break; case APIC_OFFSET_TPR: - *data = lapic->tpr; + *data = vlapic_get_tpr(vlapic); break; case APIC_OFFSET_APR: *data = lapic->apr; @@ -1305,8 +1305,7 @@ vlapic_write(struct vlapic *vlapic, int vlapic_id_write_handler(vlapic); break; case APIC_OFFSET_TPR: - lapic->tpr = data & 0xff; - vlapic_update_ppr(vlapic); + vlapic_set_tpr(vlapic, data & 0xff); break; case APIC_OFFSET_EOI: vlapic_process_eoi(vlapic); @@ -1611,3 +1610,20 @@ vlapic_set_tmr_level(struct vlapic *vlap VLAPIC_CTR1(vlapic, "vector %d set to level-triggered", vector); vlapic_set_tmr(vlapic, vector, true); } + +void +vlapic_set_tpr(struct vlapic *vlapic, uint8_t val) +{ + struct LAPIC *lapic = vlapic->apic_page; + + lapic->tpr = val; + vlapic_update_ppr(vlapic); +} + +uint8_t +vlapic_get_tpr(struct vlapic *vlapic) +{ + struct LAPIC *lapic = vlapic->apic_page; + + return (lapic->tpr); +} Modified: head/sys/amd64/vmm/io/vlapic.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic.h Fri Jun 6 18:02:32 2014 (r267177) +++ head/sys/amd64/vmm/io/vlapic.h Fri Jun 6 18:23:49 2014 (r267178) @@ -92,6 +92,9 @@ void vlapic_reset_tmr(struct vlapic *vla void vlapic_set_tmr_level(struct vlapic *vlapic, uint32_t dest, bool phys, int delmode, int vector); +void vlapic_set_tpr(struct vlapic *vlapic, uint8_t val); +uint8_t vlapic_get_tpr(struct vlapic *vlapic); + /* APIC write handlers */ void vlapic_id_write_handler(struct vlapic *vlapic); void vlapic_ldr_write_handler(struct vlapic *vlapic); From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 18:32:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF926F8B; Fri, 6 Jun 2014 18:32:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CCA620E0; Fri, 6 Jun 2014 18:32:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56IW51Q079380; Fri, 6 Jun 2014 18:32:05 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56IW5Lt079379; Fri, 6 Jun 2014 18:32:05 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406061832.s56IW5Lt079379@svn.freebsd.org> From: Ed Maste Date: Fri, 6 Jun 2014 18:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267179 - head/sys/dev/vt/font X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 18:32:05 -0000 Author: emaste Date: Fri Jun 6 18:32:05 2014 New Revision: 267179 URL: http://svnweb.freebsd.org/changeset/base/267179 Log: Clarify statement on font origin Submitted by: Dimitar Zhekov Modified: head/sys/dev/vt/font/vt_font_default.c Modified: head/sys/dev/vt/font/vt_font_default.c ============================================================================== --- head/sys/dev/vt/font/vt_font_default.c Fri Jun 6 18:23:49 2014 (r267178) +++ head/sys/dev/vt/font/vt_font_default.c Fri Jun 6 18:32:05 2014 (r267179) @@ -24,9 +24,9 @@ */ /* - * This is the "Terminus BSD Console" font, a derivative of Terminus that is - * provided under the 2-clause BSD license for use by the FreeBSD vt(4) - * console. Please contribute any changes back to Mr. Zhekov at + * This is the "Terminus BSD Console" font. It is identical to the standard + * variant of Terminus Font 8x16, but provided under the 2-clause BSD License + * (FreeBSD License). Please contribute any changes back to Mr. Zhekov at * . */ From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 18:36:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9FEF203; Fri, 6 Jun 2014 18:36:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAC28210F; Fri, 6 Jun 2014 18:36:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56Ia2js079950; Fri, 6 Jun 2014 18:36:02 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56Ia2ea079947; Fri, 6 Jun 2014 18:36:02 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406061836.s56Ia2ea079947@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 6 Jun 2014 18:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267180 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 18:36:02 -0000 Author: luigi Date: Fri Jun 6 18:36:02 2014 New Revision: 267180 URL: http://svnweb.freebsd.org/changeset/base/267180 Log: better handling of netmap emulation over standard device drivers: plug a potential mbuf leak, and detect bogus drivers that return ENOBUFS even when the packet has been queued. MFC after: 3 days Modified: head/sys/dev/netmap/netmap_freebsd.c head/sys/dev/netmap/netmap_generic.c Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Fri Jun 6 18:32:05 2014 (r267179) +++ head/sys/dev/netmap/netmap_freebsd.c Fri Jun 6 18:36:02 2014 (r267180) @@ -61,7 +61,8 @@ /* ======================== FREEBSD-SPECIFIC ROUTINES ================== */ -rawsum_t nm_csum_raw(uint8_t *data, size_t len, rawsum_t cur_sum) +rawsum_t +nm_csum_raw(uint8_t *data, size_t len, rawsum_t cur_sum) { /* TODO XXX please use the FreeBSD implementation for this. */ uint16_t *words = (uint16_t *)data; @@ -80,7 +81,8 @@ rawsum_t nm_csum_raw(uint8_t *data, size /* Fold a raw checksum: 'cur_sum' is in host byte order, while the * return value is in network byte order. */ -uint16_t nm_csum_fold(rawsum_t cur_sum) +uint16_t +nm_csum_fold(rawsum_t cur_sum) { /* TODO XXX please use the FreeBSD implementation for this. */ while (cur_sum >> 16) @@ -89,7 +91,8 @@ uint16_t nm_csum_fold(rawsum_t cur_sum) return htobe16((~cur_sum) & 0xFFFF); } -uint16_t nm_csum_ipv4(struct nm_iphdr *iph) +uint16_t +nm_csum_ipv4(struct nm_iphdr *iph) { #if 0 return in_cksum_hdr((void *)iph); @@ -98,7 +101,8 @@ uint16_t nm_csum_ipv4(struct nm_iphdr *i #endif } -void nm_csum_tcpudp_ipv4(struct nm_iphdr *iph, void *data, +void +nm_csum_tcpudp_ipv4(struct nm_iphdr *iph, void *data, size_t datalen, uint16_t *check) { #ifdef INET @@ -120,7 +124,8 @@ void nm_csum_tcpudp_ipv4(struct nm_iphdr #endif } -void nm_csum_tcpudp_ipv6(struct nm_ipv6hdr *ip6h, void *data, +void +nm_csum_tcpudp_ipv6(struct nm_ipv6hdr *ip6h, void *data, size_t datalen, uint16_t *check) { #ifdef INET6 @@ -143,7 +148,8 @@ void nm_csum_tcpudp_ipv6(struct nm_ipv6h int netmap_catch_rx(struct netmap_adapter *na, int intercept) { - struct netmap_generic_adapter *gna = (struct netmap_generic_adapter *)na; + struct netmap_generic_adapter *gna = + (struct netmap_generic_adapter *)na; struct ifnet *ifp = na->ifp; if (intercept) { @@ -209,11 +215,29 @@ generic_xmit_frame(struct ifnet *ifp, st { int ret; - m->m_len = m->m_pkthdr.len = 0; + /* + * The mbuf should be a cluster from our special pool, + * so we do not need to do an m_copyback but just copy + * (and eventually, just reference the netmap buffer) + */ - // copy data to the mbuf - m_copyback(m, 0, len, addr); - // inc refcount. We are alone, so we can skip the atomic + if (*m->m_ext.ref_cnt != 1) { + D("invalid refcnt %d for %p", + *m->m_ext.ref_cnt, m); + panic("in generic_xmit_frame"); + } + // XXX the ext_size check is unnecessary if we link the netmap buf + if (m->m_ext.ext_size < len) { + RD(5, "size %d < len %d", m->m_ext.ext_size, len); + len = m->m_ext.ext_size; + } + if (0) { /* XXX seems to have negligible benefits */ + m->m_ext.ext_buf = m->m_data = addr; + } else { + bcopy(addr, m->m_data, len); + } + m->m_len = m->m_pkthdr.len = len; + // inc refcount. All ours, we could skip the atomic atomic_fetchadd_int(m->m_ext.ref_cnt, 1); m->m_flags |= M_FLOWID; m->m_pkthdr.flowid = ring_nr; @@ -238,7 +262,7 @@ netmap_getna(if_t ifp) int generic_find_num_desc(struct ifnet *ifp, unsigned int *tx, unsigned int *rx) { - D("called"); + D("called, in tx %d rx %d", *tx, *rx); return 0; } @@ -246,13 +270,14 @@ generic_find_num_desc(struct ifnet *ifp, void generic_find_num_queues(struct ifnet *ifp, u_int *txq, u_int *rxq) { - D("called"); + D("called, in txq %d rxq %d", *txq, *rxq); *txq = netmap_generic_rings; *rxq = netmap_generic_rings; } -void netmap_mitigation_init(struct nm_generic_mit *mit, struct netmap_adapter *na) +void +netmap_mitigation_init(struct nm_generic_mit *mit, struct netmap_adapter *na) { ND("called"); mit->mit_pending = 0; @@ -260,26 +285,30 @@ void netmap_mitigation_init(struct nm_ge } -void netmap_mitigation_start(struct nm_generic_mit *mit) +void +netmap_mitigation_start(struct nm_generic_mit *mit) { ND("called"); } -void netmap_mitigation_restart(struct nm_generic_mit *mit) +void +netmap_mitigation_restart(struct nm_generic_mit *mit) { ND("called"); } -int netmap_mitigation_active(struct nm_generic_mit *mit) +int +netmap_mitigation_active(struct nm_generic_mit *mit) { ND("called"); return 0; } -void netmap_mitigation_cleanup(struct nm_generic_mit *mit) +void +netmap_mitigation_cleanup(struct nm_generic_mit *mit) { ND("called"); } Modified: head/sys/dev/netmap/netmap_generic.c ============================================================================== --- head/sys/dev/netmap/netmap_generic.c Fri Jun 6 18:32:05 2014 (r267179) +++ head/sys/dev/netmap/netmap_generic.c Fri Jun 6 18:36:02 2014 (r267180) @@ -81,8 +81,8 @@ __FBSDID("$FreeBSD$"); #include #include -#define rtnl_lock() ND("rtnl_lock called"); -#define rtnl_unlock() ND("rtnl_unlock called"); +#define rtnl_lock() ND("rtnl_lock called") +#define rtnl_unlock() ND("rtnl_unlock called") #define MBUF_TXQ(m) ((m)->m_pkthdr.flowid) #define MBUF_RXQ(m) ((m)->m_pkthdr.flowid) #define smp_mb() @@ -101,7 +101,6 @@ __FBSDID("$FreeBSD$"); /* * mbuf wrappers */ -#define netmap_get_mbuf(len) m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR|M_NOFREE) /* mbuf destructor, also need to change the type to EXT_EXTREF, * add an M_NOFREE flag, and then clear the flag and @@ -113,6 +112,32 @@ __FBSDID("$FreeBSD$"); (m)->m_ext.ext_type = EXT_EXTREF; \ } while (0) +static void +netmap_default_mbuf_destructor(struct mbuf *m) +{ + /* restore original mbuf */ + m->m_ext.ext_buf = m->m_data = m->m_ext.ext_arg1; + m->m_ext.ext_arg1 = NULL; + m->m_ext.ext_type = EXT_PACKET; + m->m_ext.ext_free = NULL; + if (*(m->m_ext.ref_cnt) == 0) + *(m->m_ext.ref_cnt) = 1; + uma_zfree(zone_pack, m); +} + +static inline struct mbuf * +netmap_get_mbuf(int len) +{ + struct mbuf *m; + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR | M_NOFREE); + if (m) { + m->m_ext.ext_arg1 = m->m_ext.ext_buf; // XXX save + m->m_ext.ext_free = (void *)netmap_default_mbuf_destructor; + m->m_ext.ext_type = EXT_EXTREF; + ND(5, "create m %p refcnt %d", m, *m->m_ext.ref_cnt); + } + return m; +} #define GET_MBUF_REFCNT(m) ((m)->m_ext.ref_cnt ? *(m)->m_ext.ref_cnt : -1) @@ -230,7 +255,7 @@ generic_netmap_register(struct netmap_ad #endif /* REG_RESET */ if (enable) { /* Enable netmap mode. */ - /* Init the mitigation support. */ + /* Init the mitigation support on all the rx queues. */ gna->mit = malloc(na->num_rx_rings * sizeof(struct nm_generic_mit), M_DEVBUF, M_NOWAIT | M_ZERO); if (!gna->mit) { @@ -380,15 +405,11 @@ out: static void generic_mbuf_destructor(struct mbuf *m) { - if (netmap_verbose) - D("Tx irq (%p) queue %d", m, MBUF_TXQ(m)); netmap_generic_irq(MBUF_IFP(m), MBUF_TXQ(m), NULL); #ifdef __FreeBSD__ - m->m_ext.ext_type = EXT_PACKET; - m->m_ext.ext_free = NULL; - if (*(m->m_ext.ref_cnt) == 0) - *(m->m_ext.ref_cnt) = 1; - uma_zfree(zone_pack, m); + if (netmap_verbose) + RD(5, "Tx irq (%p) queue %d index %d" , m, MBUF_TXQ(m), (int)(uintptr_t)m->m_ext.ext_arg1); + netmap_default_mbuf_destructor(m); #endif /* __FreeBSD__ */ IFRATE(rate_ctx.new.txirq++); } @@ -478,12 +499,12 @@ generic_set_tx_event(struct netmap_kring e = generic_tx_event_middle(kring, hwcur); m = kring->tx_pool[e]; + ND(5, "Request Event at %d mbuf %p refcnt %d", e, m, m ? GET_MBUF_REFCNT(m) : -2 ); if (m == NULL) { /* This can happen if there is already an event on the netmap slot 'e': There is nothing to do. */ return; } - ND("Event at %d mbuf %p refcnt %d", e, m, GET_MBUF_REFCNT(m)); kring->tx_pool[e] = NULL; SET_MBUF_DESTRUCTOR(m, generic_mbuf_destructor); @@ -777,6 +798,10 @@ generic_netmap_attach(struct ifnet *ifp) generic_find_num_desc(ifp, &num_tx_desc, &num_rx_desc); ND("Netmap ring size: TX = %d, RX = %d", num_tx_desc, num_rx_desc); + if (num_tx_desc == 0 || num_rx_desc == 0) { + D("Device has no hw slots (tx %u, rx %u)", num_tx_desc, num_rx_desc); + return EINVAL; + } gna = malloc(sizeof(*gna), M_DEVBUF, M_NOWAIT | M_ZERO); if (gna == NULL) { From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 18:58:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50BC19E0; Fri, 6 Jun 2014 18:58:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 321BF22ED; Fri, 6 Jun 2014 18:58:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56Iw9G7089376; Fri, 6 Jun 2014 18:58:09 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56Iw7Pp089361; Fri, 6 Jun 2014 18:58:07 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201406061858.s56Iw7Pp089361@svn.freebsd.org> From: Julio Merino Date: Fri, 6 Jun 2014 18:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267181 - in head: . etc/mtree libexec/atf libexec/atf/atf-check libexec/atf/atf-sh libexec/atf/atf-sh/tests share/mk tools/build/mk usr.bin usr.bin/atf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 18:58:09 -0000 Author: jmmv Date: Fri Jun 6 18:58:06 2014 New Revision: 267181 URL: http://svnweb.freebsd.org/changeset/base/267181 Log: Move atf-sh from /usr/bin/ to /usr/libexec/ In r266650, we made libatf-c and libatf-c++ private libraries so that no components outside of the source tree could unintendedly depend on them. This change does the same for the "atf-sh library" by moving the atf-sh interpreter from its public location in /usr/bin/ to the private location in /usr/libexec/. Our build system will ensure that our own test programs use the right binary, but users won't be able to depend on atf-sh by "mistake". Committing this now to ride the UPDATING notice added with r267172 today. Added: head/libexec/atf/atf-sh/ - copied from r267172, head/usr.bin/atf/atf-sh/ Deleted: head/usr.bin/atf/ Modified: head/UPDATING head/etc/mtree/BSD.tests.dist head/libexec/atf/Makefile head/libexec/atf/Makefile.inc head/libexec/atf/atf-check/Makefile head/libexec/atf/atf-sh/tests/Makefile head/share/mk/atf.test.mk head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/Makefile Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Jun 6 18:36:02 2014 (r267180) +++ head/UPDATING Fri Jun 6 18:58:06 2014 (r267181) @@ -41,11 +41,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 programs once the operator executes "make delete-old-libs" after a "make installworld". + Additionally, the atf-sh binary was made private by moving it into + /usr/libexec/. Already-built shell test programs will keep the + path to the old binary so they will break after "make delete-old" + is run. + If you are using WITH_TESTS=yes (not the default), wipe the object tree and rebuild from scratch to prevent spurious test failures. - This is only needed once: the old, misnumbered libraries have been - added to OptionalObsoleteFiles.inc so they will be removed during a - clean upgrade. + This is only needed once: the misnumbered libraries and misplaced + binaries have been added to OptionalObsoleteFiles.inc so they will + be removed during a clean upgrade. 20140512: Clang and llvm have been upgraded to 3.4.1 release. Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Fri Jun 6 18:36:02 2014 (r267180) +++ head/etc/mtree/BSD.tests.dist Fri Jun 6 18:58:06 2014 (r267181) @@ -88,6 +88,8 @@ atf atf-check .. + atf-sh + .. .. .. sbin @@ -127,10 +129,6 @@ usr.bin apply .. - atf - atf-sh - .. - .. bmake archives fmt_44bsd Modified: head/libexec/atf/Makefile ============================================================================== --- head/libexec/atf/Makefile Fri Jun 6 18:36:02 2014 (r267180) +++ head/libexec/atf/Makefile Fri Jun 6 18:58:06 2014 (r267181) @@ -25,6 +25,6 @@ # # $FreeBSD$ -SUBDIR= atf-check tests +SUBDIR= atf-check atf-sh tests .include Modified: head/libexec/atf/Makefile.inc ============================================================================== --- head/libexec/atf/Makefile.inc Fri Jun 6 18:36:02 2014 (r267180) +++ head/libexec/atf/Makefile.inc Fri Jun 6 18:58:06 2014 (r267181) @@ -28,3 +28,5 @@ CFLAGS+= -DHAVE_CONFIG_H WARNS?= 3 + +.include "../Makefile.inc" Modified: head/libexec/atf/atf-check/Makefile ============================================================================== --- head/libexec/atf/atf-check/Makefile Fri Jun 6 18:36:02 2014 (r267180) +++ head/libexec/atf/atf-check/Makefile Fri Jun 6 18:58:06 2014 (r267181) @@ -31,7 +31,6 @@ ATF= ${.CURDIR:H:H:H}/contrib/atf .PATH: ${ATF}/atf-sh -BINDIR= /usr/libexec PROG_CXX= atf-check SRCS= atf-check.cpp MAN= atf-check.1 Modified: head/libexec/atf/atf-sh/tests/Makefile ============================================================================== --- head/usr.bin/atf/atf-sh/tests/Makefile Fri Jun 6 17:05:43 2014 (r267172) +++ head/libexec/atf/atf-sh/tests/Makefile Fri Jun 6 18:58:06 2014 (r267181) @@ -2,7 +2,7 @@ .include -TESTSDIR= ${TESTSBASE}/usr.bin/atf/atf-sh +TESTSDIR= ${TESTSBASE}/libexec/atf/atf-sh ATF= ${.CURDIR:H:H:H:H}/contrib/atf .PATH: ${ATF}/atf-sh @@ -10,6 +10,8 @@ ATF= ${.CURDIR:H:H:H:H}/contrib/atf ATF_TESTS_SH+= atf_check_test ATF_TESTS_SH+= config_test ATF_TESTS_SH+= integration_test +ATF_TESTS_SH_SED_integration_test= \ + -e 's,/usr/bin/env *atf-sh,/usr/libexec/atf-sh,g' ATF_TESTS_SH+= normalize_test ATF_TESTS_SH+= tc_test ATF_TESTS_SH+= tp_test @@ -18,7 +20,7 @@ SCRIPTS+= misc_helpers SCRIPTSDIR_misc_helpers=${TESTSDIR} CLEANFILES+= misc_helpers misc_helpers.tmp misc_helpers: misc_helpers.sh - echo '#! /usr/bin/atf-sh' >${.TARGET}.tmp + echo '#! /usr/libexec/atf-sh' >${.TARGET}.tmp cat ${.ALLSRC} >>${.TARGET}.tmp chmod +x ${.TARGET}.tmp mv ${.TARGET}.tmp ${.TARGET} Modified: head/share/mk/atf.test.mk ============================================================================== --- head/share/mk/atf.test.mk Fri Jun 6 18:36:02 2014 (r267180) +++ head/share/mk/atf.test.mk Fri Jun 6 18:58:06 2014 (r267181) @@ -104,7 +104,7 @@ CLEANFILES+= ${_T} ${_T}.tmp ATF_TESTS_SH_SED_${_T}?= # empty ATF_TESTS_SH_SRC_${_T}?= ${_T}.sh ${_T}: ${ATF_TESTS_SH_SRC_${_T}} - echo '#! /usr/bin/atf-sh' > ${.TARGET}.tmp + echo '#! /usr/libexec/atf-sh' > ${.TARGET}.tmp cat ${.ALLSRC} | sed ${ATF_TESTS_SH_SED_${_T}} >>${.TARGET}.tmp chmod +x ${.TARGET}.tmp mv ${.TARGET}.tmp ${.TARGET} Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jun 6 18:36:02 2014 (r267180) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jun 6 18:58:06 2014 (r267181) @@ -4103,6 +4103,7 @@ OLD_FILES+=usr/share/man/man8/telnetd.8. .endif .if ${MK_TESTS} == yes +OLD_FILES+=usr/bin/atf-sh OLD_LIBS+=usr/lib/libatf-c++.a OLD_LIBS+=usr/lib/libatf-c++.so OLD_LIBS+=usr/lib/libatf-c++.so.1 @@ -4135,6 +4136,17 @@ OLD_FILES+=usr/share/aclocal/atf-c.m4 OLD_FILES+=usr/share/aclocal/atf-common.m4 OLD_FILES+=usr/share/aclocal/atf-sh.m4 OLD_DIRS+=usr/share/aclocal +OLD_FILES+=usr/tests/usr.bin/atf/Kyuafile +OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/Kyuafile +OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/atf_check_test +OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/config_test +OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/integration_test +OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/misc_helpers +OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/normalize_test +OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/tc_test +OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/tp_test +OLD_DIRS+=usr/tests/usr.bin/atf/atf-sh +OLD_DIRS+=usr/tests/usr.bin/atf OLD_FILES+=usr/tests/lib/atf/libatf-c/test_helpers_test OLD_FILES+=usr/tests/lib/atf/test-programs/fork_test OLD_FILES+=usr/tests/lib/atf/libatf-c++/application_test Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Fri Jun 6 18:36:02 2014 (r267180) +++ head/usr.bin/Makefile Fri Jun 6 18:58:06 2014 (r267181) @@ -12,7 +12,6 @@ SUBDIR= alias \ apply \ asa \ - ${_atf} \ awk \ banner \ basename \ @@ -333,7 +332,6 @@ SUBDIR+= telnet .endif .if ${MK_TESTS} != "no" -_atf= atf _tests= tests .endif From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 19:00:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02953BA0; Fri, 6 Jun 2014 19:00:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2FE9230A; Fri, 6 Jun 2014 19:00:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56J0iKF090669; Fri, 6 Jun 2014 19:00:44 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56J0h5q090661; Fri, 6 Jun 2014 19:00:43 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201406061900.s56J0h5q090661@svn.freebsd.org> From: Joel Dahl Date: Fri, 6 Jun 2014 19:00:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267182 - in head: sbin/geom/class/label sbin/reboot share/man/man4 usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 19:00:45 -0000 Author: joel (doc committer) Date: Fri Jun 6 19:00:43 2014 New Revision: 267182 URL: http://svnweb.freebsd.org/changeset/base/267182 Log: Minor mdoc improvements. Modified: head/sbin/geom/class/label/glabel.8 head/sbin/reboot/boot_i386.8 head/share/man/man4/mrsas.4 head/share/man/man4/ng_bridge.4 head/share/man/man4/ng_ppp.4 head/share/man/man4/nvme.4 head/usr.bin/mkimg/mkimg.1 Modified: head/sbin/geom/class/label/glabel.8 ============================================================================== --- head/sbin/geom/class/label/glabel.8 Fri Jun 6 18:58:06 2014 (r267181) +++ head/sbin/geom/class/label/glabel.8 Fri Jun 6 19:00:43 2014 (r267182) @@ -235,7 +235,7 @@ and creating label nodes in the .Xr devfs 5 tree. It is sometimes desirable to disable certain label types if they conflict with other classes in complex GEOM topologies. -.Bl +.El .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES Modified: head/sbin/reboot/boot_i386.8 ============================================================================== --- head/sbin/reboot/boot_i386.8 Fri Jun 6 18:58:06 2014 (r267181) +++ head/sbin/reboot/boot_i386.8 Fri Jun 6 19:00:43 2014 (r267182) @@ -113,7 +113,6 @@ boot device, as a hint about available b .Ic ?\& may also be specified as the last segment of a path, in which case the listing will be of the relevant subdirectory.) -.Pp .It Xo .Sm off .Ar bios_drive : interface ( unit , Oo Ar slice , Oc Ar part ) Modified: head/share/man/man4/mrsas.4 ============================================================================== --- head/share/man/man4/mrsas.4 Fri Jun 6 18:58:06 2014 (r267181) +++ head/share/man/man4/mrsas.4 Fri Jun 6 19:00:43 2014 (r267182) @@ -321,7 +321,7 @@ management interface .Xr mfi 4 , .Xr pci 4 , .Xr device.hints 5 , -.Xt camcontrol 8 +.Xr camcontrol 8 .Sh HISTORY The .Nm Modified: head/share/man/man4/ng_bridge.4 ============================================================================== --- head/share/man/man4/ng_bridge.4 Fri Jun 6 18:58:06 2014 (r267181) +++ head/share/man/man4/ng_bridge.4 Fri Jun 6 19:00:43 2014 (r267182) @@ -139,7 +139,6 @@ The determines how quickly a host must jump from one link to another before we declare a loopback condition. The default is one second. -.Pp .It Dv NGM_BRIDGE_GET_CONFIG Pq Ic getconfig Returns the current configuration as a .Dv "struct ng_bridge_config" . Modified: head/share/man/man4/ng_ppp.4 ============================================================================== --- head/share/man/man4/ng_ppp.4 Fri Jun 6 18:58:06 2014 (r267181) +++ head/share/man/man4/ng_ppp.4 Fri Jun 6 19:00:43 2014 (r267182) @@ -385,7 +385,6 @@ struct ng_ppp_node_conf { struct ng_ppp_link_conf links[NG_PPP_MAX_LINKS]; }; .Ed -.Pp .It Dv NGM_PPP_GET_CONFIG Pq Ic getconfig Returns the current configuration as a .Dv "struct ng_ppp_node_conf" . Modified: head/share/man/man4/nvme.4 ============================================================================== --- head/share/man/man4/nvme.4 Fri Jun 6 18:58:06 2014 (r267181) +++ head/share/man/man4/nvme.4 Fri Jun 6 19:00:43 2014 (r267182) @@ -85,7 +85,6 @@ the format .Pa /dev/nvmeXnsY . Note that the NVM Express specification starts numbering namespaces at 1, not 0, and this driver follows that convention. -.El .Sh CONFIGURATION By default, .Nm Modified: head/usr.bin/mkimg/mkimg.1 ============================================================================== --- head/usr.bin/mkimg/mkimg.1 Fri Jun 6 18:58:06 2014 (r267181) +++ head/usr.bin/mkimg/mkimg.1 Fri Jun 6 19:00:43 2014 (r267182) @@ -115,6 +115,12 @@ For a complete list of supported partiti format, or for a detailed description of how to specify partitions, run the .Nm utility without any arguments. +.Sh ENVIRONMENT +.Bl -tag -width "TMPDIR" -compact +.It Ev TMPDIR +Directory to put temporary files in; default is +.Pa /tmp . +.El .Sh EXAMPLES To create a bootable disk image that is partitioned using the GPT scheme and containing a root file system that was previously created using @@ -159,11 +165,6 @@ For partitioning schemes that feature pa utility supports assigning labels to the partitions specified. In the following example the file system partition is labeled as 'backup': .Dl % mkimg -s gpt -p freebsd-ufs/backup:=file-system.ufs -o gpt.img -.Sh ENVIRONMENT -.Bl -tag -width "TMPDIR" -compact -.It Ev TMPDIR -Directory to put temporary files in; default is -.Pa /tmp . .Sh SEE ALSO .Xr gpart 8 .Xr makefs 8 From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 19:02:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D9B4D0A; Fri, 6 Jun 2014 19:02:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A60D2389; Fri, 6 Jun 2014 19:02:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56J2kfG093296; Fri, 6 Jun 2014 19:02:46 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56J2kKF093295; Fri, 6 Jun 2014 19:02:46 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406061902.s56J2kKF093295@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 6 Jun 2014 19:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267183 - head/sys/boot/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 19:02:46 -0000 Author: hselasky Date: Fri Jun 6 19:02:45 2014 New Revision: 267183 URL: http://svnweb.freebsd.org/changeset/base/267183 Log: Compilation fixes. Modified: head/sys/boot/usb/bsd_kernel.h Modified: head/sys/boot/usb/bsd_kernel.h ============================================================================== --- head/sys/boot/usb/bsd_kernel.h Fri Jun 6 19:00:43 2014 (r267182) +++ head/sys/boot/usb/bsd_kernel.h Fri Jun 6 19:02:45 2014 (r267183) @@ -38,6 +38,7 @@ #define isalpha(x) (((x) >= 'a' && (x) <= 'z') || ((x) >= 'A' && (x) <= 'Z')) #define isdigit(x) ((x) >= '0' && (x) <= '9') #define panic(...) do { printf("USB PANIC: " __VA_ARGS__); while (1) ; } while (0) +#define rebooting 0 #define M_USB 0 #define M_USBDEV 0 #define USB_PROC_MAX 3 @@ -182,9 +183,10 @@ typedef uint16_t gid_t; typedef uint16_t mode_t; typedef uint8_t *caddr_t; -typedef unsigned long __uintptr_t; +#define _UINTPTR_T_DECLARED typedef unsigned long uintptr_t; +#define _SIZE_T_DECLARED typedef unsigned long size_t; typedef unsigned long u_long; #endif From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 19:10:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12A2CFEF; Fri, 6 Jun 2014 19:10:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3CF5240E; Fri, 6 Jun 2014 19:10:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56JANSv094641; Fri, 6 Jun 2014 19:10:23 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56JANCe094640; Fri, 6 Jun 2014 19:10:23 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201406061910.s56JANCe094640@svn.freebsd.org> From: Christian Brueffer Date: Fri, 6 Jun 2014 19:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267184 - head/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 19:10:24 -0000 Author: brueffer Date: Fri Jun 6 19:10:23 2014 New Revision: 267184 URL: http://svnweb.freebsd.org/changeset/base/267184 Log: Add vte(4) to the hardware notes. MFC after: 3 days Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Jun 6 19:02:45 2014 (r267183) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Jun 6 19:10:23 2014 (r267184) @@ -944,6 +944,8 @@ &hwlist.vr; + &hwlist.vte; + &hwlist.vx; &hwlist.vxge; From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 20:01:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 816F9441; Fri, 6 Jun 2014 20:01:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E72B291C; Fri, 6 Jun 2014 20:01:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56K1kPM021453; Fri, 6 Jun 2014 20:01:46 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56K1kpM021452; Fri, 6 Jun 2014 20:01:46 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201406062001.s56K1kpM021452@svn.freebsd.org> From: Christian Brueffer Date: Fri, 6 Jun 2014 20:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267185 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 20:01:46 -0000 Author: brueffer Date: Fri Jun 6 20:01:45 2014 New Revision: 267185 URL: http://svnweb.freebsd.org/changeset/base/267185 Log: Minor improvements. MFC after: 1 week Modified: head/share/man/man4/xnb.4 Modified: head/share/man/man4/xnb.4 ============================================================================== --- head/share/man/man4/xnb.4 Fri Jun 6 19:10:23 2014 (r267184) +++ head/share/man/man4/xnb.4 Fri Jun 6 20:01:45 2014 (r267185) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 6, 2012 +.Dd June 6, 2014 .Dt XNB 4 .Os .Sh NAME @@ -116,7 +116,9 @@ machine. However, when a Xennet interface is bridged to a physical interface, a correct checksum must be attached to any packets bound for that physical interface. -Currently, FreeBSD lacks any mechanism for an ethernet device to +Currently, +.Fx +lacks any mechanism for an Ethernet device to inform the OS that newly received packets are valid even though their checksums are not. So if the netfront driver is configured to offload checksum calculations, From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 20:49:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 304DF72D; Fri, 6 Jun 2014 20:49:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 039932D19; Fri, 6 Jun 2014 20:49:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56Knuag043734; Fri, 6 Jun 2014 20:49:56 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56KnuS9043729; Fri, 6 Jun 2014 20:49:56 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406062049.s56KnuS9043729@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 6 Jun 2014 20:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267187 - in head/sys/dev: e1000 ixgbe vmware/vmxnet3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 20:49:57 -0000 Author: luigi Date: Fri Jun 6 20:49:56 2014 New Revision: 267187 URL: http://svnweb.freebsd.org/changeset/base/267187 Log: make sure if_transmit returns 0 if the mbuf is enqueued. ixgbe/ixv.c still needs a similar fix but it takes a little more restructuring of the code. MFC after: 3 days Modified: head/sys/dev/e1000/if_igb.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/vmware/vmxnet3/if_vmx.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri Jun 6 20:35:40 2014 (r267186) +++ head/sys/dev/e1000/if_igb.c Fri Jun 6 20:49:56 2014 (r267187) @@ -989,12 +989,12 @@ igb_mq_start(struct ifnet *ifp, struct m if (err) return (err); if (IGB_TX_TRYLOCK(txr)) { - err = igb_mq_start_locked(ifp, txr); + igb_mq_start_locked(ifp, txr); IGB_TX_UNLOCK(txr); } else taskqueue_enqueue(que->tq, &txr->txq_task); - return (err); + return (0); } static int Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Fri Jun 6 20:35:40 2014 (r267186) +++ head/sys/dev/ixgbe/ixgbe.c Fri Jun 6 20:49:56 2014 (r267187) @@ -831,12 +831,12 @@ ixgbe_mq_start(struct ifnet *ifp, struct if (err) return (err); if (IXGBE_TX_TRYLOCK(txr)) { - err = ixgbe_mq_start_locked(ifp, txr); + ixgbe_mq_start_locked(ifp, txr); IXGBE_TX_UNLOCK(txr); } else taskqueue_enqueue(que->tq, &txr->txq_task); - return (err); + return (0); } static int Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmx.c Fri Jun 6 20:35:40 2014 (r267186) +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Fri Jun 6 20:49:56 2014 (r267187) @@ -2935,7 +2935,6 @@ vmxnet3_txq_mq_start_locked(struct vmxne /* Assume worse case if this mbuf is the head of a chain. */ if (m->m_next != NULL && avail < VMXNET3_TX_MAXSEGS) { drbr_putback(ifp, br, m); - error = ENOBUFS; break; } @@ -2958,7 +2957,7 @@ vmxnet3_txq_mq_start_locked(struct vmxne txq->vxtxq_watchdog = VMXNET3_WATCHDOG_TIMEOUT; } - return (error); + return (0); } static int From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 20:59:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6CDAD48; Fri, 6 Jun 2014 20:59:56 +0000 (UTC) Received: from mail-qg0-x22d.google.com (mail-qg0-x22d.google.com [IPv6:2607:f8b0:400d:c04::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 660E72E1C; Fri, 6 Jun 2014 20:59:56 +0000 (UTC) Received: by mail-qg0-f45.google.com with SMTP id z60so5623232qgd.32 for ; Fri, 06 Jun 2014 13:59:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=UVT781kFN43r1Ns68jN1Rjbn+E13HSdjVM78cyeutLE=; b=KAWlqRP98ugk515BYaxOnPQi345q7yBbDpm4Hb7w0DujntNm5DYPoKKA0C0tU1NCJb 04RKpECcwRz+vH54JXb6w11kkwVgMSLjbta+BHboecTg/24ir7tXRAqEAL8VRX1wfJrH 2st4KM1VcvX3dgrH1ERchYzjAcl/A9INdgAEvI0QXLiknFCUUwV5lrmYZcvcBp93g9bU pNNtadEPEhI5LlwczH86NHhg2QnOlybD05PRqszON6LjvR8GbnWuyqz8N5dXn2CZaKbC pE1CQ6J6uhfH4A78JsV54vgH8oac9dbEtxUSULw1zagfQXxuY49jWJrCahlgmoOKuTrD bAQg== MIME-Version: 1.0 X-Received: by 10.140.91.5 with SMTP id y5mr12209451qgd.12.1402088395609; Fri, 06 Jun 2014 13:59:55 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.43.134 with HTTP; Fri, 6 Jun 2014 13:59:55 -0700 (PDT) In-Reply-To: <201406062049.s56KnuS9043729@svn.freebsd.org> References: <201406062049.s56KnuS9043729@svn.freebsd.org> Date: Fri, 6 Jun 2014 16:59:55 -0400 X-Google-Sender-Auth: Sfw6kBXr8ZT33tLCAtU9VNa8G7k Message-ID: Subject: Re: svn commit: r267187 - in head/sys/dev: e1000 ixgbe vmware/vmxnet3 From: Adrian Chadd To: Luigi Rizzo Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 20:59:57 -0000 Thanks for finally committing this stuff! -a On 6 June 2014 16:49, Luigi Rizzo wrote: > Author: luigi > Date: Fri Jun 6 20:49:56 2014 > New Revision: 267187 > URL: http://svnweb.freebsd.org/changeset/base/267187 > > Log: > make sure if_transmit returns 0 if the mbuf is enqueued. > ixgbe/ixv.c still needs a similar fix but it takes a little > more restructuring of the code. > > MFC after: 3 days > > Modified: > head/sys/dev/e1000/if_igb.c > head/sys/dev/ixgbe/ixgbe.c > head/sys/dev/vmware/vmxnet3/if_vmx.c > > Modified: head/sys/dev/e1000/if_igb.c > ============================================================================== > --- head/sys/dev/e1000/if_igb.c Fri Jun 6 20:35:40 2014 (r267186) > +++ head/sys/dev/e1000/if_igb.c Fri Jun 6 20:49:56 2014 (r267187) > @@ -989,12 +989,12 @@ igb_mq_start(struct ifnet *ifp, struct m > if (err) > return (err); > if (IGB_TX_TRYLOCK(txr)) { > - err = igb_mq_start_locked(ifp, txr); > + igb_mq_start_locked(ifp, txr); > IGB_TX_UNLOCK(txr); > } else > taskqueue_enqueue(que->tq, &txr->txq_task); > > - return (err); > + return (0); > } > > static int > > Modified: head/sys/dev/ixgbe/ixgbe.c > ============================================================================== > --- head/sys/dev/ixgbe/ixgbe.c Fri Jun 6 20:35:40 2014 (r267186) > +++ head/sys/dev/ixgbe/ixgbe.c Fri Jun 6 20:49:56 2014 (r267187) > @@ -831,12 +831,12 @@ ixgbe_mq_start(struct ifnet *ifp, struct > if (err) > return (err); > if (IXGBE_TX_TRYLOCK(txr)) { > - err = ixgbe_mq_start_locked(ifp, txr); > + ixgbe_mq_start_locked(ifp, txr); > IXGBE_TX_UNLOCK(txr); > } else > taskqueue_enqueue(que->tq, &txr->txq_task); > > - return (err); > + return (0); > } > > static int > > Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c > ============================================================================== > --- head/sys/dev/vmware/vmxnet3/if_vmx.c Fri Jun 6 20:35:40 2014 (r267186) > +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Fri Jun 6 20:49:56 2014 (r267187) > @@ -2935,7 +2935,6 @@ vmxnet3_txq_mq_start_locked(struct vmxne > /* Assume worse case if this mbuf is the head of a chain. */ > if (m->m_next != NULL && avail < VMXNET3_TX_MAXSEGS) { > drbr_putback(ifp, br, m); > - error = ENOBUFS; > break; > } > > @@ -2958,7 +2957,7 @@ vmxnet3_txq_mq_start_locked(struct vmxne > txq->vxtxq_watchdog = VMXNET3_WATCHDOG_TIMEOUT; > } > > - return (error); > + return (0); > } > > static int > From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 21:13:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C2335EF; Fri, 6 Jun 2014 21:13:29 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 13C262FC1; Fri, 6 Jun 2014 21:13:28 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id A92D0D617B9; Sat, 7 Jun 2014 07:13:16 +1000 (EST) Date: Sat, 7 Jun 2014 07:13:13 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pietro Cerutti Subject: Re: svn commit: r267027 - head/usr.bin/users In-Reply-To: <20140605101148.GJ37870@ptrcrt.ch> Message-ID: <20140607061954.S9562@besplex.bde.org> References: <201406032059.s53KxQAp081243@svn.freebsd.org> <20140605013835.M1934@besplex.bde.org> <20140605101148.GJ37870@ptrcrt.ch> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=eojmkOZX c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=M9zwebxRaw4A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=2NTOfg1Ub98rnNZzmX8A:9 a=4nYZKbiEO7K0d1u-:21 a=sZPDjW1OswgcD5fj:21 a=CjuIK1q_8ugA:10 Cc: bapt@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, Bruce Evans , svn-src-head@freebsd.org, Julian Elischer , cognet@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 21:13:29 -0000 On Thu, 5 Jun 2014, Pietro Cerutti wrote: > your comments do make sense. I semi-seriously suggest that we get rid of > the current implementation and replace it with this. Comments? Not for me, thanks. > ... > int > main(int argc, char **) > { > struct utmpx *ut; > vector names; > > if (argc > 1) { > cerr << "usage: users" << endl; > return (1); > } This doesn't give quite the same error handling as the getopt() call, but the C version could use the same simplification. The C version even has dead code for argc and argc. It has almost as many style bugs as the above. > > setutxent(); > while ((ut = getutxent()) != NULL) { > if (ut->ut_type != USER_PROCESS) > continue; > names.push_back(ut->ut_user); > } This is simpler, but the C version does much more than needed too. ut_user is now guaranteed to be NUL terminated. The above depends on this, but the current version still uses old code that adds a NUL terminator. This gives minor complications. It should be possible to build an array of pointers and just sort that. However, the getutxent() API is nasty, and is under-documented in FreeBSD. It returns a pointer to static storage (perhaps thread-local), as is common for bad old APIs. This is documented in POSIX, but doesn't seem to be documented in FreeBSD. It is obviously not expected that there be a large number of users (else the serial API would be worse than it is), so a small amount of statically allocated storage should be enough, especially if the application only has to hold the pointers and the database holds the strings. The 4.4BSD-Lite version of user(1) had a fixed limit of 200 users. Memory is free-er than it used to be, especially virtually, so no one would notice the bloat for statically allocating enough for a measly few million users, but in practice a few thousand should be enough. The unformatted output is bad for just 200 users. The above has only C++ default error handling. I know little about C++, but doubt that you it matches the errx() reporting exactly. Of course, realloc() can't fail, especially with only a few million users, so no error handling would work too. If there is a memory shortage, then getutxent() might fail too and its API doesn't even allow determining if there was an error -- the output would be truncated; I prefer a core dump. > endutxent(); > > if (names.size() == 0) { > return (0); > } > The C version can use the same simplifcation (to reduce indentation). > sort(begin(names), end(names)); > vector::iterator last(unique(begin(names), end(names))); > copy(begin(names), last-1, ostream_iterator(cout, " ")); > cout << *(last-1) << endl; > } This is not simpler. I prefer to iterate with a for loop (that is not obfuscated with a macro). The C code is simple and was mostly correct here. Except it has the usual null error checking for printf() failure, and bogus void'ing of the return value. The above seems to duplicate the null error handling. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 21:38:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 375FACB; Fri, 6 Jun 2014 21:38:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2462C21F7; Fri, 6 Jun 2014 21:38:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56LcoAV069538; Fri, 6 Jun 2014 21:38:50 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56Lco3q069537; Fri, 6 Jun 2014 21:38:50 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201406062138.s56Lco3q069537@svn.freebsd.org> From: Rick Macklem Date: Fri, 6 Jun 2014 21:38:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267191 - head/sys/fs/nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 21:38:50 -0000 Author: rmacklem Date: Fri Jun 6 21:38:49 2014 New Revision: 267191 URL: http://svnweb.freebsd.org/changeset/base/267191 Log: The new NFS server would not allow a hard link to be created to a symlink. This restriction (which was inherited from OpenBSD) is not required by the NFS RFCs. Since this is allowed by the old NFS server, it is a POLA violation to not allow it. This patch modifies the new NFS server to allow this. Reported by: jhb Reviewed by: jhb MFC after: 3 days Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Fri Jun 6 21:38:34 2014 (r267190) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Fri Jun 6 21:38:49 2014 (r267191) @@ -1620,13 +1620,6 @@ nfsrvd_link(struct nfsrv_descript *nd, i nd->nd_repstat = NFSERR_INVAL; if (tovp) vrele(tovp); - } else if (vnode_vtype(vp) == VLNK) { - if (nd->nd_flag & ND_NFSV2) - nd->nd_repstat = NFSERR_INVAL; - else - nd->nd_repstat = NFSERR_NOTSUPP; - if (tovp) - vrele(tovp); } if (!nd->nd_repstat) { if (nd->nd_flag & ND_NFSV4) { From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 21:58:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC00E998; Fri, 6 Jun 2014 21:58:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A912E23C0; Fri, 6 Jun 2014 21:58:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56LwS0k078864; Fri, 6 Jun 2014 21:58:28 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56LwSea078860; Fri, 6 Jun 2014 21:58:28 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201406062158.s56LwSea078860@svn.freebsd.org> From: Aleksandr Rybalko Date: Fri, 6 Jun 2014 21:58:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267194 - in head/share/vt: . keymaps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 21:58:28 -0000 Author: ray Date: Fri Jun 6 21:58:27 2014 New Revision: 267194 URL: http://svnweb.freebsd.org/changeset/base/267194 Log: Add Ukranian vt(4) keymaps as an example. Sponsored by: The FreeBSD Foundation Added: head/share/vt/keymaps/ head/share/vt/keymaps/Makefile (contents, props changed) head/share/vt/keymaps/ua.kbd (contents, props changed) head/share/vt/keymaps/ua.shift.alt.kbd (contents, props changed) Modified: head/share/vt/Makefile Modified: head/share/vt/Makefile ============================================================================== --- head/share/vt/Makefile Fri Jun 6 21:45:14 2014 (r267193) +++ head/share/vt/Makefile Fri Jun 6 21:58:27 2014 (r267194) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= fonts +SUBDIR= fonts keymaps .include Added: head/share/vt/keymaps/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/keymaps/Makefile Fri Jun 6 21:58:27 2014 (r267194) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +FILES= ua.kbd ua.shift.alt.kbd + +FILESDIR= ${SHAREDIR}/vt/keymaps + +NO_OBJ= + +.include Added: head/share/vt/keymaps/ua.kbd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/keymaps/ua.kbd Fri Jun 6 21:58:27 2014 (r267194) @@ -0,0 +1,242 @@ +# $FreeBSD$ +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug nop O + 002 '1' '!' nop nop '1' '!' nop nop O + 003 '2' '@' nul nul '2' '"' nul nul O + 004 '3' '#' nop nop '3' '/' nop nop O + 005 '4' '$' nop nop '4' '$' nop nop O + 006 '5' '%' nop nop '5' ':' nop nop O + 007 '6' '^' rs rs '6' ',' rs rs O + 008 '7' '&' nop nop '7' '.' nop nop O + 009 '8' '*' nop nop '8' ';' nop nop O + 010 '9' '(' nop nop '9' '?' nop nop O + 011 '0' ')' nop nop '0' '%' nop nop O + 012 '-' '_' ns ns '-' '_' ns ns O + 013 '=' '+' nop nop '=' '+' nop nop O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop btab btab nop nop O + 016 'q' 'Q' dc1 dc1 1081 1049 dc1 dc1 C + 017 'w' 'W' etb etb 1094 1062 etb etb C + 018 'e' 'E' enq enq 1091 1059 enq enq C + 019 'r' 'R' dc2 dc2 1082 1050 dc2 dc2 C + 020 't' 'T' dc4 dc4 1077 1045 dc4 dc4 C + 021 'y' 'Y' em em 1085 1053 em em C + 022 'u' 'U' nak nak 1075 1043 nak nak C + 023 'i' 'I' ht ht 1096 1064 ht ht C + 024 'o' 'O' si si 1097 1065 si si C + 025 'p' 'P' dle dle 1079 1047 dle dle C + 026 '[' '{' esc esc 1093 1061 esc esc O + 027 ']' '}' gs gs 1111 1031 1098 1066 O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 1092 1060 soh soh C + 031 's' 'S' dc3 dc3 1110 1030 1099 1067 C + 032 'd' 'D' eot eot 1074 1042 eot eot C + 033 'f' 'F' ack ack 1072 1040 ack ack C + 034 'g' 'G' bel bel 1087 1055 bel bel C + 035 'h' 'H' bs bs 1088 1056 bs bs C + 036 'j' 'J' nl nl 1086 1054 nl nl C + 037 'k' 'K' vt vt 1083 1051 vt vt C + 038 'l' 'L' ff ff 1076 1044 ff ff C + 039 ';' ':' nop nop 1078 1046 nop nop O + 040 ''' '"' nop nop 1108 1028 1101 1069 O + 041 '`' '~' nop nop 1169 1168 1105 1025 O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 '\' '|' fs fs '\' '|' fs fs O + 044 'z' 'Z' sub sub 1103 1071 sub sub C + 045 'x' 'X' can can 1095 1063 can can C + 046 'c' 'C' etx etx 1089 1057 etx etx C + 047 'v' 'V' syn syn 1084 1052 syn syn C + 048 'b' 'B' stx stx 1080 1048 stx stx C + 049 'n' 'N' so so 1090 1058 so so C + 050 'm' 'M' cr cr 1100 1068 cr cr C + 051 ',' '<' nop nop 1073 1041 nop nop O + 052 '.' '>' nop nop 1102 1070 nop nop O + 053 '/' '?' nop nop '/' '?' nop nop O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' nl nl '*' '*' nl nl O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 alock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 fkey90 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 fkey91 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 fkey92 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 alock alock alock alock alock alock alock alock O + 085 nop nop nop nop nop nop nop nop O + 086 nop nop nop nop nop nop nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' O + 092 nscr pscr debug nop nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey69 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey70 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey71 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey73 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey75 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey77 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey78 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey79 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey80 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 del del fkey81 del fkey61 fkey61 boot boot O + 104 slock slock slock slock slock slock slock slock O + 105 meta fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 meta fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 meta fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O + 109 nop nop nop nop nop nop nop nop O + 110 nop nop nop nop nop nop nop nop O + 111 nop nop nop nop nop nop nop nop O + 112 nop nop nop nop nop nop nop nop O + 113 nop nop nop nop nop nop nop nop O + 114 nop nop nop nop nop nop nop nop O + 115 nop nop nop nop nop nop nop nop O + 116 nop nop nop nop nop nop nop nop O + 117 nop nop nop nop nop nop nop nop O + 118 nop nop nop nop nop nop nop nop O + 119 nop nop nop nop nop nop nop nop O + 120 nop nop nop nop nop nop nop nop O + 121 nop nop nop nop nop nop nop nop O + 122 nop nop nop nop nop nop nop nop O + 123 nop nop nop nop nop nop nop nop O + 124 nop nop nop nop nop nop nop nop O + 125 nop nop nop nop nop nop nop nop O + 126 nop nop nop nop nop nop nop nop O + 127 nop nop nop nop nop nop nop nop O +# + 128 nop nop nop nop nop nop nop nop O + 129 esc esc esc esc esc esc debug esc O + 130 '1' '!' nop nop '1' '!' nop nop O + 131 '2' '"' nul nul '2' '@' nul nul O + 132 '3' '/' nop nop '3' '#' nop nop O + 133 '4' '$' nop nop '4' '$' nop nop O + 134 '5' ':' nop nop '5' '%' nop nop O + 135 '6' ',' rs rs '6' '^' rs rs O + 136 '7' '.' nop nop '7' '&' nop nop O + 137 '8' ';' nop nop '8' '*' nop nop O + 138 '9' '?' nop nop '9' '(' nop nop O + 139 '0' '%' nop nop '0' ')' nop nop O + 140 '-' '_' ns ns '-' '_' ns ns O + 141 '=' '+' nop nop '=' '+' nop nop O + 142 bs bs del del bs bs del del O + 143 ht btab nop nop btab btab nop nop O + 144 1081 1049 dc1 dc1 'q' 'Q' dc1 dc1 C + 145 1094 1062 etb etb 'w' 'W' etb etb C + 146 1091 1059 enq enq 'e' 'E' enq enq C + 147 1082 1050 dc2 dc2 'r' 'R' dc2 dc2 C + 148 1077 1045 dc4 dc4 't' 'T' dc4 dc4 C + 149 1085 1053 em em 'y' 'Y' em em C + 150 1075 1043 nak nak 'u' 'U' nak nak C + 151 1096 1064 ht ht 'i' 'I' ht ht C + 152 1097 1065 si si 'o' 'O' si si C + 153 1079 1047 dle dle 'p' 'P' dle dle C + 154 1093 1061 esc esc '[' '{' esc esc C + 155 1111 1031 gs gs ']' '}' 1098 1066 C + 156 cr cr nl nl cr cr nl nl O + 157 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 158 1092 1060 soh soh 'a' 'A' soh soh C + 159 1110 1030 dc3 dc3 's' 'S' 1099 1067 C + 160 1074 1042 eot eot 'd' 'D' eot eot C + 161 1072 1040 ack ack 'f' 'F' ack ack C + 162 1087 1055 bel bel 'g' 'G' bel bel C + 163 1088 1056 bs bs 'h' 'H' bs bs C + 164 1086 1054 nl nl 'j' 'J' nl nl C + 165 1083 1051 vt vt 'k' 'K' vt vt C + 166 1076 1044 ff ff 'l' 'L' ff ff C + 167 1078 1046 nop nop ';' ':' nop nop C + 168 1108 1028 nop nop ''' '"' 1101 1069 C + 169 1169 1168 nop nop '`' '~' 1105 1025 C + 170 lshift lshift lshift lshift lshift lshift lshift lshift O + 171 '\' '|' fs fs '\' '|' fs fs O + 172 1103 1071 sub sub 'z' 'Z' sub sub C + 173 1095 1063 can can 'x' 'X' can can C + 174 1089 1057 etx etx 'c' 'C' etx etx C + 175 1084 1052 syn syn 'v' 'V' syn syn C + 176 1080 1048 stx stx 'b' 'B' stx stx C + 177 1090 1058 so so 'n' 'N' so so C + 178 1100 1068 cr cr 'm' 'M' cr cr C + 179 1073 1041 nop nop ',' '<' nop nop C + 180 1102 1070 nop nop '.' '>' nop nop C + 181 '/' '?' nop nop '/' '?' nop nop O + 182 rshift rshift rshift rshift rshift rshift rshift rshift O + 183 '*' '*' nl nl '*' '*' nl nl O + 184 lalt lalt lalt lalt lalt lalt lalt lalt O + 185 ' ' ' ' nul ' ' ' ' ' ' ' ' susp O + 186 alock clock clock clock clock clock clock clock O + 187 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 188 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 189 fkey03 fkey15 fkey27 fkey39 scr03 scr13 fkey90 scr13 O + 190 fkey04 fkey16 fkey28 fkey40 scr04 scr14 fkey91 scr14 O + 191 fkey05 fkey17 fkey29 fkey41 scr05 scr15 fkey92 scr15 O + 192 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 193 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 194 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 195 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 196 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 197 nlock nlock nlock nlock nlock nlock nlock nlock O + 198 slock slock slock slock slock slock slock slock O + 199 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 200 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 201 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 202 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 203 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 204 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 205 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 206 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 207 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 208 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 209 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 210 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 211 del '.' '.' '.' '.' '.' boot boot N + 212 alock alock alock alock alock alock alock alock O + 213 nop nop nop nop nop nop nop nop O + 214 nop nop nop nop nop nop nop nop O + 215 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 216 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 217 cr cr nl nl cr cr nl nl O + 218 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 219 '/' '/' '/' '/' '/' '/' '/' '/' O + 220 nscr pscr debug nop nop nop nop nop O + 221 ralt ralt ralt ralt ralt ralt ralt ralt O + 222 fkey49 fkey49 fkey69 fkey49 fkey49 fkey49 fkey49 fkey49 O + 223 fkey50 fkey50 fkey70 fkey50 fkey50 fkey50 fkey50 fkey50 O + 224 fkey51 fkey51 fkey71 fkey51 fkey51 fkey51 fkey51 fkey51 O + 225 fkey53 fkey53 fkey73 fkey53 fkey53 fkey53 fkey53 fkey53 O + 226 fkey55 fkey55 fkey75 fkey55 fkey55 fkey55 fkey55 fkey55 O + 227 fkey57 fkey57 fkey77 fkey57 fkey57 fkey57 fkey57 fkey57 O + 228 fkey58 fkey58 fkey78 fkey58 fkey58 fkey58 fkey58 fkey58 O + 229 fkey59 fkey59 fkey79 fkey59 fkey59 fkey59 fkey59 fkey59 O + 230 fkey60 paste fkey80 fkey60 fkey60 fkey60 fkey60 fkey60 O + 231 del del fkey81 del fkey61 fkey61 boot boot O + 232 slock slock slock slock slock slock slock slock O + 233 meta fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 234 meta fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 235 meta fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O Added: head/share/vt/keymaps/ua.shift.alt.kbd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/keymaps/ua.shift.alt.kbd Fri Jun 6 21:58:27 2014 (r267194) @@ -0,0 +1,254 @@ +# $FreeBSD$ +# +# keyboard mapping for both Ukrainian and Russian languages, koi8-u charset. +# by sia@lot.cs.kiev.ua +# based on ru.koi8-r.kbd by ache@FreeBSD.org +# some additions by petr@i.am and kunia@i.am +# +# it has 'i', 'ye','yi',"g'" at positions of '-','=','\','`'; +# ->`1234567890-=\<- +# ->­1234567890¦¤§<- +# Lwin,Rwin=Meta, Menu=Screensaver +# PrScr=NextScreen, Shift+PrScr=PrevScreen +# Shift+Insert=paste +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc nop nop esc esc debug nop O + 002 '1' '!' nop nop '1' '!' nop nop O + 003 '2' '@' nul nul '2' '"' 9472 9472 O + 004 '3' '#' nop nop '3' ''' nop nop O + 005 '4' '$' nop nop '4' ';' nop nop O + 006 '5' '%' nop nop '5' ':' nop nop O + 007 '6' '^' rs rs '6' ',' 183 183 O + 008 '7' '&' nop nop '7' '.' nop nop O + 009 '8' '*' nop nop '8' '*' nop nop O + 010 '9' '(' nop nop '9' '(' nop nop O + 011 '0' ')' nop nop '0' ')' nop nop O + 012 '-' '_' ns ns 1110 1030 247 247 O + 013 '=' '+' nop nop 1108 1028 nop nop O + 014 bs bs del del bs bs 1066 1066 O + 015 ht btab nop nop ht btab nop nop O + 016 'q' 'Q' dc1 dc1 1081 1049 9618 9618 C + 017 'w' 'W' etb etb 1094 1062 8776 8776 C + 018 'e' 'E' enq enq 1091 1059 9496 9496 C + 019 'r' 'R' dc2 dc2 1082 1050 9619 9619 C + 020 't' 'T' dc4 dc4 1077 1045 9632 9632 C + 021 'y' 'Y' em em 1085 1053 8805 8805 C + 022 'u' 'U' nak nak 1075 1043 8729 8729 C + 023 'i' 'I' ht ht 1096 1064 9524 9524 C + 024 'o' 'O' si si 1097 1065 9616 9616 C + 025 'p' 'P' dle dle 1079 1047 9617 9617 C + 026 '[' '{' esc esc 1093 1061 8993 8993 O + 027 ']' '}' gs gs 1098 1066 178 178 O + 028 cr cr nl nl cr cr 9532 9532 O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 1092 1060 9474 9474 C + 031 's' 'S' dc3 dc3 1099 1067 8992 8992 C + 032 'd' 'D' eot eot 1074 1042 9492 9492 C + 033 'f' 'F' ack ack 1072 1040 9500 9500 C + 034 'g' 'G' bel bel 1087 1055 9508 9508 C + 035 'h' 'H' bs bs 1088 1056 9516 9516 C + 036 'j' 'J' nl nl 1086 1054 9532 9532 C + 037 'k' 'K' vt vt 1083 1051 9600 9600 C + 038 'l' 'L' ff ff 1076 1044 9604 9604 C + 039 ';' ':' nop nop 1078 1046 nop nop O + 040 ''' '"' nop nop 1101 1069 nop nop O + 041 '`' '~' nop nop 1169 1168 nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 '\' '|' fs fs 1111 1031 176 176 O + 044 'z' 'Z' sub sub 1103 1071 160 160 C + 045 'x' 'X' can can 1095 1063 8804 8804 C + 046 'c' 'C' etx etx 1089 1057 9488 9488 C + 047 'v' 'V' syn syn 1084 1052 8730 8730 C + 048 'b' 'B' stx stx 1080 1048 9484 9484 C + 049 'n' 'N' so so 1090 1058 9612 9612 C + 050 'm' 'M' cr cr 1100 1068 9608 9608 C + 051 ',' '<' nop nop 1073 1041 nop nop O + 052 '.' '>' nop nop 1102 1070 nop nop O + 053 '/' '?' nop nop 1105 1025 nop nop O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' nl nl '*' '*' 9532 9532 O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' ' ' ' ' ' ' ' ' 9552 9552 O + 058 alock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' 1031 1031 1031 1031 N + 072 fkey50 '8' '8' '8' 9574 9574 9574 9574 N + 073 fkey51 '9' '9' '9' 9575 9575 9575 9575 N + 074 fkey52 '-' '-' '-' 1169 1169 1169 1169 N + 075 fkey53 '4' '4' '4' 1028 1028 1028 1028 N + 076 fkey48 '5' '5' '5' 9571 9571 9571 9571 N + 077 fkey55 '6' '6' '6' 1030 1030 1030 1030 N + 078 fkey56 '+' '+' '+' 9562 9562 9562 9562 N + 079 fkey57 '1' '1' '1' 9568 9568 9568 9568 N + 080 fkey58 '2' '2' '2' 9569 9569 9569 9569 N + 081 fkey59 '3' '3' '3' 1025 1025 1025 1025 N + 082 fkey60 '0' '0' '0' 9567 9567 9567 9567 N + 083 fkey54 '.' del del 1066 1066 boot halt N + 084 alock alock alock alock alock alock alock alock O + 085 nop nop nop nop nop nop nop nop O + 086 nop nop nop nop nop nop nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl 9608 9608 9532 9532 O + 090 alock rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' nop nop 9566 9566 nop nop O + 092 nscr pscr debug nop nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey69 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey70 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey71 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey73 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey75 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey77 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey78 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey79 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey80 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 del del fkey81 del fkey61 fkey61 boot pdwn O + 104 slock saver slock saver susp nop susp nop O + 105 meta fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 meta fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 saver fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O + 109 nop nop nop nop nop nop nop nop O + 110 nop nop nop nop nop nop nop nop O + 111 nop nop nop nop nop nop nop nop O + 112 nop nop nop nop nop nop nop nop O + 113 nop nop nop nop nop nop nop nop O + 114 nop nop nop nop nop nop nop nop O + 115 nop nop nop nop nop nop nop nop O + 116 nop nop nop nop nop nop nop nop O + 117 nop nop nop nop nop nop nop nop O + 118 nop nop nop nop nop nop nop nop O + 119 nop nop nop nop nop nop nop nop O + 120 nop nop nop nop nop nop nop nop O + 121 nop nop nop nop nop nop nop nop O + 122 nop nop nop nop nop nop nop nop O + 123 nop nop nop nop nop nop nop nop O + 124 nop nop nop nop nop nop nop nop O + 125 nop nop nop nop nop nop nop nop O + 126 nop nop nop nop nop nop nop nop O + 127 nop nop nop nop nop nop nop nop O + 128 nop nop nop nop nop nop nop nop O + 129 esc esc nop nop esc esc debug nop O + 130 '1' '!' nop nop '1' '!' nop nop O + 131 '2' '"' nul nul '2' '@' 9472 9472 O + 132 '3' ''' nop nop '3' '#' nop nop O + 133 '4' ';' nop nop '4' '$' nop nop O + 134 '5' ':' nop nop '5' '%' nop nop O + 135 '6' ',' rs rs '6' '^' 183 183 O + 136 '7' '.' nop nop '7' '&' nop nop O + 137 '8' '*' nop nop '8' '*' nop nop O + 138 '9' '(' nop nop '9' '(' nop nop O + 139 '0' ')' nop nop '0' ')' nop nop O + 140 1110 1030 ns ns '-' '_' 247 247 O + 141 1108 1028 nop nop '=' '+' nop nop O + 142 bs bs del del bs bs 1066 1066 O + 143 ht btab nop nop ht btab nop nop O + 144 1081 1049 dc1 dc1 'q' 'Q' 9618 9618 C + 145 1094 1062 etb etb 'w' 'W' 8776 8776 C + 146 1091 1059 enq enq 'e' 'E' 9496 9496 C + 147 1082 1050 dc2 dc2 'r' 'R' 9619 9619 C + 148 1077 1045 dc4 dc4 't' 'T' 9632 9632 C + 149 1085 1053 em em 'y' 'Y' 8805 8805 C + 150 1075 1043 nak nak 'u' 'U' 8729 8729 C + 151 1096 1064 ht ht 'i' 'I' 9524 9524 C + 152 1097 1065 si si 'o' 'O' 9616 9616 C + 153 1079 1047 dle dle 'p' 'P' 9617 9617 C + 154 1093 1061 esc esc '[' '{' 8993 8993 C + 155 1098 1066 gs gs ']' '}' 178 178 C + 156 cr cr nl nl cr cr 9532 9532 O + 157 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 158 1092 1060 soh soh 'a' 'A' 9474 9474 C + 159 1099 1067 dc3 dc3 's' 'S' 8992 8992 C + 160 1074 1042 eot eot 'd' 'D' 9492 9492 C + 161 1072 1040 ack ack 'f' 'F' 9500 9500 C + 162 1087 1055 bel bel 'g' 'G' 9508 9508 C + 163 1088 1056 bs bs 'h' 'H' 9516 9516 C + 164 1086 1054 nl nl 'j' 'J' 9532 9532 C + 165 1083 1051 vt vt 'k' 'K' 9600 9600 C + 166 1076 1044 ff ff 'l' 'L' 9604 9604 C + 167 1078 1046 nop nop ';' ':' nop nop C + 168 1101 1069 nop nop ''' '"' nop nop C + 169 1169 1168 nop nop '`' '~' nop nop C + 170 lshift lshift lshift lshift lshift lshift lshift lshift O + 171 1111 1031 fs fs '\' '|' 176 176 O + 172 1103 1071 sub sub 'z' 'Z' 160 160 C + 173 1095 1063 can can 'x' 'X' 8804 8804 C + 174 1089 1057 etx etx 'c' 'C' 9488 9488 C + 175 1084 1052 syn syn 'v' 'V' 8730 8730 C + 176 1080 1048 stx stx 'b' 'B' 9484 9484 C + 177 1090 1058 so so 'n' 'N' 9612 9612 C + 178 1100 1068 cr cr 'm' 'M' 9608 9608 C + 179 1073 1041 nop nop ',' '<' nop nop C + 180 1102 1070 nop nop '.' '>' nop nop C + 181 1105 1025 nop nop '/' '?' nop nop O + 182 rshift rshift rshift rshift rshift rshift rshift rshift O + 183 '*' '*' nl nl '*' '*' 9532 9532 O + 184 lalt lalt lalt lalt lalt lalt lalt lalt O + 185 ' ' ' ' ' ' ' ' ' ' ' ' 9552 9552 O + 186 alock clock clock clock clock clock clock clock O + 187 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 188 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 189 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 190 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 191 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 192 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 193 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 194 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 195 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 196 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 197 nlock nlock nlock nlock nlock nlock nlock nlock O + 198 slock slock slock slock slock slock slock slock O + 199 fkey49 '7' '7' '7' 1031 1031 1031 1031 N + 200 fkey50 '8' '8' '8' 9574 9574 9574 9574 N + 201 fkey51 '9' '9' '9' 9575 9575 9575 9575 N + 202 fkey52 '-' '-' '-' 1169 1169 1169 1169 N + 203 fkey53 '4' '4' '4' 1028 1028 1028 1028 N + 204 fkey48 '5' '5' '5' 9571 9571 9571 9571 N + 205 fkey55 '6' '6' '6' 1030 1030 1030 1030 N + 206 fkey56 '+' '+' '+' 9562 9562 9562 9562 N + 207 fkey57 '1' '1' '1' 9568 9568 9568 9568 N + 208 fkey58 '2' '2' '2' 9569 9569 9569 9569 N + 209 fkey59 '3' '3' '3' 1025 1025 1025 1025 N + 210 fkey60 '0' '0' '0' 9567 9567 9567 9567 N + 211 del '.' del del 1066 1066 boot halt N + 212 alock alock alock alock alock alock alock alock O + 213 nop nop nop nop nop nop nop nop O + 214 nop nop nop nop nop nop nop nop O + 215 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 216 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 217 cr cr nl nl 9608 9608 9532 9532 O + 218 alock rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 219 '/' '/' nop nop 9566 9566 nop nop O + 220 nscr pscr debug nop nop nop nop nop O + 221 ralt ralt ralt ralt ralt ralt ralt ralt O + 222 fkey49 fkey49 fkey69 fkey49 fkey49 fkey49 fkey49 fkey49 O + 223 fkey50 fkey50 fkey70 fkey50 fkey50 fkey50 fkey50 fkey50 O + 224 fkey51 fkey51 fkey71 fkey51 fkey51 fkey51 fkey51 fkey51 O + 225 fkey53 fkey53 fkey73 fkey53 fkey53 fkey53 fkey53 fkey53 O + 226 fkey55 fkey55 fkey75 fkey55 fkey55 fkey55 fkey55 fkey55 O + 227 fkey57 fkey57 fkey77 fkey57 fkey57 fkey57 fkey57 fkey57 O + 228 fkey58 fkey58 fkey78 fkey58 fkey58 fkey58 fkey58 fkey58 O + 229 fkey59 fkey59 fkey79 fkey59 fkey59 fkey59 fkey59 fkey59 O + 230 fkey60 paste fkey80 fkey60 fkey60 fkey60 fkey60 fkey60 O + 231 del del fkey81 del fkey61 fkey61 boot pdwn O + 232 slock saver slock saver susp nop susp nop O + 233 meta fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 234 meta fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 235 saver fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 236 nop nop nop nop nop nop nop nop O From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 22:52:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35C6AF49; Fri, 6 Jun 2014 22:52:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0897828D5; Fri, 6 Jun 2014 22:52:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56MqBJI007792; Fri, 6 Jun 2014 22:52:11 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56MqBY7007790; Fri, 6 Jun 2014 22:52:11 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201406062252.s56MqBY7007790@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 6 Jun 2014 22:52:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267196 - head/bin/ps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 22:52:12 -0000 Author: pluknet Date: Fri Jun 6 22:52:11 2014 New Revision: 267196 URL: http://svnweb.freebsd.org/changeset/base/267196 Log: Add support for inspecting process flags set in p_flag2. Reviewed by: jhb MFC after: 1 week Modified: head/bin/ps/keyword.c head/bin/ps/ps.1 Modified: head/bin/ps/keyword.c ============================================================================== --- head/bin/ps/keyword.c Fri Jun 6 22:14:25 2014 (r267195) +++ head/bin/ps/keyword.c Fri Jun 6 22:52:11 2014 (r267196) @@ -87,8 +87,10 @@ static VAR var[] = { {"etimes", "ELAPSED", NULL, USER, elapseds, 0, CHAR, NULL, 0}, {"euid", "", "uid", 0, NULL, 0, CHAR, NULL, 0}, {"f", "F", NULL, 0, kvar, KOFF(ki_flag), INT, "x", 0}, + {"f2", "F2", NULL, 0, kvar, KOFF(ki_flag2), INT, "08x", 0}, {"fib", "FIB", NULL, 0, kvar, KOFF(ki_fibnum), INT, "d", 0}, {"flags", "", "f", 0, NULL, 0, CHAR, NULL, 0}, + {"flags2", "", "f2", 0, NULL, 0, CHAR, NULL, 0}, {"gid", "GID", NULL, 0, kvar, KOFF(ki_groups), UINT, UIDFMT, 0}, {"group", "GROUP", NULL, LJUST, egroupname, 0, CHAR, NULL, 0}, {"ignored", "", "sigignore", 0, NULL, 0, CHAR, NULL, 0}, Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Fri Jun 6 22:14:25 2014 (r267195) +++ head/bin/ps/ps.1 Fri Jun 6 22:52:11 2014 (r267196) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd May 2, 2014 +.Dd June 6, 2014 .Dt PS 1 .Os .Sh NAME @@ -340,6 +340,15 @@ the include file .It Dv "P_SWAPPINGIN" Ta No "0x40000000" Ta "Process is being swapped in" .It Dv "P_PPTRACE" Ta No "0x80000000" Ta "Vforked child issued ptrace(PT_TRACEME)" .El +.It Cm flags2 +The flags kept in +.Va p_flag2 +associated with the process as in +the include file +.In sys/proc.h : +.Bl -column P2_INHERIT_PROTECTED 0x00000001 +.It Dv "P2_INHERIT_PROTECTED" Ta No "0x00000001" Ta "New children get P_PROTECTED" +.El .It Cm label The MAC label of the process. .It Cm lim @@ -534,6 +543,9 @@ default FIB number, see .It Cm flags the process flags, in hexadecimal (alias .Cm f ) +.It Cm flags2 +the additional set of process flags, in hexadecimal (alias +.Cm f2 ) .It Cm gid effective group ID (alias .Cm egid ) From owner-svn-src-head@FreeBSD.ORG Fri Jun 6 23:54:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BEF11FC; Fri, 6 Jun 2014 23:54:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 300D22E20; Fri, 6 Jun 2014 23:54:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s56Ns162036793; Fri, 6 Jun 2014 23:54:01 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s56Ns0PO036784; Fri, 6 Jun 2014 23:54:00 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201406062354.s56Ns0PO036784@svn.freebsd.org> From: Rui Paulo Date: Fri, 6 Jun 2014 23:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267197 - in head/sys/boot/fdt/dts: . arm mips powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2014 23:54:01 -0000 Author: rpaulo Date: Fri Jun 6 23:53:59 2014 New Revision: 267197 URL: http://svnweb.freebsd.org/changeset/base/267197 Log: Add Makefiles to automatically test all the DTS files. There are several broken DTS files right now in the arm directory. Added: head/sys/boot/fdt/dts/Makefile (contents, props changed) head/sys/boot/fdt/dts/Makefile.inc (contents, props changed) head/sys/boot/fdt/dts/arm/Makefile (contents, props changed) head/sys/boot/fdt/dts/mips/Makefile (contents, props changed) head/sys/boot/fdt/dts/powerpc/Makefile (contents, props changed) Added: head/sys/boot/fdt/dts/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/Makefile Fri Jun 6 23:53:59 2014 (r267197) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR=arm mips powerpc + +.include Added: head/sys/boot/fdt/dts/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/Makefile.inc Fri Jun 6 23:53:59 2014 (r267197) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +test-dts: +.for dts in ${DTS} + dtc -I dts -O dtb -o /dev/null ${dts} +.endfor + Added: head/sys/boot/fdt/dts/arm/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/Makefile Fri Jun 6 23:53:59 2014 (r267197) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +DTS!=ls *.dts + +all: test-dts + +.include Added: head/sys/boot/fdt/dts/mips/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/mips/Makefile Fri Jun 6 23:53:59 2014 (r267197) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +DTS!=ls *.dts + +all: test-dts + +.include Added: head/sys/boot/fdt/dts/powerpc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/powerpc/Makefile Fri Jun 6 23:53:59 2014 (r267197) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +DTS!=ls *.dts + +all: test-dts + +.include From owner-svn-src-head@FreeBSD.ORG Sat Jun 7 02:38:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74869F6D; Sat, 7 Jun 2014 02:38:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6259A2D5E; Sat, 7 Jun 2014 02:38:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s572cESB016333; Sat, 7 Jun 2014 02:38:14 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s572cEev016332; Sat, 7 Jun 2014 02:38:14 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201406070238.s572cEev016332@svn.freebsd.org> From: Rui Paulo Date: Sat, 7 Jun 2014 02:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267199 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2014 02:38:14 -0000 Author: rpaulo Date: Sat Jun 7 02:38:13 2014 New Revision: 267199 URL: http://svnweb.freebsd.org/changeset/base/267199 Log: Fix the script to run make_dtb.sh instead of just dtc. Modified: head/sys/boot/fdt/dts/Makefile.inc Modified: head/sys/boot/fdt/dts/Makefile.inc ============================================================================== --- head/sys/boot/fdt/dts/Makefile.inc Sat Jun 7 02:30:10 2014 (r267198) +++ head/sys/boot/fdt/dts/Makefile.inc Sat Jun 7 02:38:13 2014 (r267199) @@ -1,7 +1,10 @@ # $FreeBSD$ +SYSDIR?=${.CURDIR}/../../../.. + test-dts: .for dts in ${DTS} - dtc -I dts -O dtb -o /dev/null ${dts} + @env MACHINE=`basename ${.CURDIR}` ${SYSDIR}/tools/fdt/make_dtb.sh ${SYSDIR} ${dts} /tmp + .endfor From owner-svn-src-head@FreeBSD.ORG Sat Jun 7 02:55:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E415F6C0; Sat, 7 Jun 2014 02:55:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0CC92EDB; Sat, 7 Jun 2014 02:55:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s572trSj025703; Sat, 7 Jun 2014 02:55:53 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s572trBD025700; Sat, 7 Jun 2014 02:55:53 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201406070255.s572trBD025700@svn.freebsd.org> From: Rui Paulo Date: Sat, 7 Jun 2014 02:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267202 - in head/sys/boot/fdt/dts: arm powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2014 02:55:54 -0000 Author: rpaulo Date: Sat Jun 7 02:55:53 2014 New Revision: 267202 URL: http://svnweb.freebsd.org/changeset/base/267202 Log: Mov p2041rdb.dts, p3041ds.dts, and p5020ds.dts to the powerpc directory. Added: head/sys/boot/fdt/dts/powerpc/p2041rdb.dts - copied unchanged from r267196, head/sys/boot/fdt/dts/arm/p2041rdb.dts head/sys/boot/fdt/dts/powerpc/p3041ds.dts - copied unchanged from r267196, head/sys/boot/fdt/dts/arm/p3041ds.dts head/sys/boot/fdt/dts/powerpc/p5020ds.dts - copied unchanged from r267196, head/sys/boot/fdt/dts/arm/p5020ds.dts Deleted: head/sys/boot/fdt/dts/arm/p2041rdb.dts head/sys/boot/fdt/dts/arm/p3041ds.dts head/sys/boot/fdt/dts/arm/p5020ds.dts Copied: head/sys/boot/fdt/dts/powerpc/p2041rdb.dts (from r267196, head/sys/boot/fdt/dts/arm/p2041rdb.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/powerpc/p2041rdb.dts Sat Jun 7 02:55:53 2014 (r267202, copy of r267196, head/sys/boot/fdt/dts/arm/p2041rdb.dts) @@ -0,0 +1,490 @@ +/* + * P2041RDB Device Tree Source + * + * Copyright 2011 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* $FreeBSD$ */ + +/include/ "p2041si.dtsi" + +/ { + model = "fsl,P2041RDB"; + compatible = "fsl,P2041RDB"; + #address-cells = <2>; + #size-cells = <2>; + interrupt-parent = <&mpic>; + + aliases { + phy_rgmii_0 = &phy_rgmii_0; + phy_rgmii_1 = &phy_rgmii_1; + phy_sgmii_2 = &phy_sgmii_2; + phy_sgmii_3 = &phy_sgmii_3; + phy_sgmii_4 = &phy_sgmii_4; + phy_sgmii_1c = &phy_sgmii_1c; + phy_sgmii_1d = &phy_sgmii_1d; + phy_sgmii_1e = &phy_sgmii_1e; + phy_sgmii_1f = &phy_sgmii_1f; + phy_xgmii_2 = &phy_xgmii_2; + }; + + memory { + device_type = "memory"; + reg = <0x00000000 0x00000000 0x00000000 0x80000000>; + }; + + dcsr: dcsr@f00000000 { + ranges = <0x00000000 0xf 0x00000000 0x01008000>; + }; + + bman-portals@ff4000000 { + bman-portal@0 { + cpu-handle = <&cpu0>; + }; + bman-portal@4000 { + cpu-handle = <&cpu1>; + }; + bman-portal@8000 { + cpu-handle = <&cpu2>; + }; + bman-portal@c000 { + cpu-handle = <&cpu3>; + }; + bman-portal@10000 { + }; + bman-portal@14000 { + }; + bman-portal@18000 { + }; + bman-portal@1c000 { + }; + bman-portal@20000 { + }; + bman-portal@24000 { + }; + + buffer-pool@0 { + compatible = "fsl,p2041-bpool", "fsl,bpool"; + fsl,bpid = <0>; + fsl,bpool-cfg = <0 0x100 0 1 0 0x100>; + }; + }; + + qman-portals@ff4200000 { + qportal0: qman-portal@0 { + cpu-handle = <&cpu0>; + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal1: qman-portal@4000 { + cpu-handle = <&cpu1>; + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal2: qman-portal@8000 { + cpu-handle = <&cpu2>; + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal3: qman-portal@c000 { + cpu-handle = <&cpu3>; + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal4: qman-portal@10000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal5: qman-portal@14000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal6: qman-portal@18000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal7: qman-portal@1c000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal8: qman-portal@20000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal9: qman-portal@24000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + }; + + soc: soc@ffe000000 { + spi@110000 { + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spansion,s25sl12801"; + reg = <0>; + spi-max-frequency = <40000000>; /* input clock */ + partition@u-boot { + label = "u-boot"; + reg = <0x00000000 0x00100000>; + read-only; + }; + partition@kernel { + label = "kernel"; + reg = <0x00100000 0x00500000>; + read-only; + }; + partition@dtb { + label = "dtb"; + reg = <0x00600000 0x00100000>; + read-only; + }; + partition@fs { + label = "file system"; + reg = <0x00700000 0x00900000>; + }; + }; + }; + + i2c@118000 { + lm75b@48 { + compatible = "nxp,lm75a"; + reg = <0x48>; + }; + eeprom@50 { + compatible = "at24,24c256"; + reg = <0x50>; + }; + rtc@68 { + compatible = "pericom,pt7c4338"; + reg = <0x68>; + }; + }; + + i2c@118100 { + eeprom@50 { + compatible = "at24,24c256"; + reg = <0x50>; + }; + }; + + usb1: usb@211000 { + dr_mode = "host"; + }; + + pme: pme@316000 { + /* Commented out, use default allocation */ + /* fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ + /* fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ + }; + + qman: qman@318000 { + /* Commented out, use default allocation */ + /* fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ + /* fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ + }; + + bman: bman@31a000 { + /* Same as fsl,qman-*, use default allocation */ + /* fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ + }; + + fman0: fman@400000 { + enet0: ethernet@e0000 { + tbi-handle = <&tbi0>; + phy-handle = <&phy_sgmii_2>; + phy-connection-type = "sgmii"; + }; + + mdio0: mdio@e1120 { + tbi0: tbi-phy@8 { + reg = <0x8>; + device_type = "tbi-phy"; + }; + + phy_rgmii_0: ethernet-phy@0 { + reg = <0x0>; + }; + phy_rgmii_1: ethernet-phy@1 { + reg = <0x1>; + }; + phy_sgmii_2: ethernet-phy@2 { + reg = <0x2>; + }; + phy_sgmii_3: ethernet-phy@3 { + reg = <0x3>; + }; + phy_sgmii_4: ethernet-phy@4 { + reg = <0x4>; + }; + phy_sgmii_1c: ethernet-phy@1c { + reg = <0x1c>; + }; + phy_sgmii_1d: ethernet-phy@1d { + reg = <0x1d>; + }; + phy_sgmii_1e: ethernet-phy@1e { + reg = <0x1e>; + }; + phy_sgmii_1f: ethernet-phy@1f { + reg = <0x1f>; + }; + }; + + enet1: ethernet@e2000 { + tbi-handle = <&tbi1>; + phy-handle = <&phy_sgmii_3>; + phy-connection-type = "sgmii"; + }; + + mdio@e3120 { + tbi1: tbi-phy@8 { + reg = <8>; + device_type = "tbi-phy"; + }; + }; + + enet2: ethernet@e4000 { + tbi-handle = <&tbi2>; + phy-handle = <&phy_sgmii_4>; + phy-connection-type = "sgmii"; + }; + + mdio@e5120 { + tbi2: tbi-phy@8 { + reg = <8>; + device_type = "tbi-phy"; + }; + }; + + enet3: ethernet@e6000 { + tbi-handle = <&tbi3>; + phy-handle = <&phy_rgmii_1>; + phy-connection-type = "rgmii"; + }; + + mdio@e7120 { + tbi3: tbi-phy@8 { + reg = <8>; + device_type = "tbi-phy"; + }; + }; + + enet4: ethernet@e8000 { + tbi-handle = <&tbi4>; + phy-handle = <&phy_rgmii_0>; + phy-connection-type = "rgmii"; + }; + + mdio@e9120 { + tbi4: tbi-phy@8 { + reg = <8>; + device_type = "tbi-phy"; + }; + }; + + enet5: ethernet@f0000 { + /* + * phy-handle will be updated by U-Boot to + * reflect the actual slot the XAUI card is in. + */ + phy-handle = <&phy_xgmii_2>; + phy-connection-type = "xgmii"; + }; + + mdio@f1000 { + /* XAUI card in slot 2 */ + phy_xgmii_2: ethernet-phy@0 { + reg = <0x0>; + }; + }; + }; + }; + + rapidio@ffe0c0000 { + reg = <0xf 0xfe0c0000 0 0x11000>; + + port1 { + ranges = <0 0 0xc 0x20000000 0 0x10000000>; + }; + port2 { + ranges = <0 0 0xc 0x30000000 0 0x10000000>; + }; + }; + + localbus@ffe124000 { + reg = <0xf 0xfe124000 0 0x1000>; + ranges = <0 0 0xf 0xb8000000 0x04000000>; + + flash@0,0 { + compatible = "cfi-flash"; + /* + * Map 64Mb of 128MB NOR flash memory. Since highest + * line of address of NOR flash memory are set by + * FPGA, memory are divided into two pages equal to + * 64MB. One of the pages can be accessed at once. + */ + reg = <0 0 0x04000000>; + bank-width = <2>; + device-width = <2>; + }; + }; + + pci0: pcie@ffe200000 { + reg = <0xf 0xfe200000 0 0x1000>; + ranges = <0x02000000 0 0x80000000 0x0 0x80000000 0x0 0x10000000 + 0x01000000 0 0x00000000 0x0 0xff000000 0x0 0x00010000>; + pcie@0 { + ranges = <0x02000000 0 0x80000000 + 0x02000000 0 0x80000000 + 0 0x10000000 + + 0x01000000 0 0x00000000 + 0x01000000 0 0xff000000 + 0 0x00010000>; + }; + }; + + pci1: pcie@ffe201000 { + reg = <0xf 0xfe201000 0 0x1000>; + ranges = <0x02000000 0x0 0x90000000 0x0 0x90000000 0x0 0x10000000 + 0x01000000 0x0 0x00000000 0x0 0xff010000 0x0 0x00010000>; + pcie@0 { + ranges = <0x02000000 0 0x90000000 + 0x02000000 0 0x90000000 + 0 0x10000000 + + 0x01000000 0 0x00000000 + 0x01000000 0 0xff010000 + 0 0x00010000>; + }; + }; + + pci2: pcie@ffe202000 { + reg = <0xf 0xfe202000 0 0x1000>; + ranges = <0x02000000 0 0xa0000000 0x0 0xa0000000 0 0x10000000 + 0x01000000 0 0x00000000 0x0 0xff020000 0 0x00010000>; + pcie@0 { + ranges = <0x02000000 0 0xa0000000 + 0x02000000 0 0xa0000000 + 0 0x10000000 + + 0x01000000 0 0x00000000 + 0x01000000 0 0xff020000 + 0 0x00010000>; + }; + }; + + fsl,dpaa { + compatible = "fsl,p2041-dpaa", "fsl,dpaa"; + + ethernet@0 { + compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; + fsl,qman-channel = <&qpool1>; + fsl,fman-mac = <&enet0>; + status = "okay"; + }; + ethernet@1 { + compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; + fsl,qman-channel = <&qpool1>; + fsl,fman-mac = <&enet1>; + status = "okay"; + }; + ethernet@2 { + compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; + fsl,qman-channel = <&qpool1>; + fsl,fman-mac = <&enet2>; + status = "okay"; + }; + ethernet@3 { + compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; + fsl,qman-channel = <&qpool1>; + fsl,fman-mac = <&enet3>; + status = "okay"; + }; + ethernet@4 { + compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; + fsl,qman-channel = <&qpool1>; + fsl,fman-mac = <&enet4>; + status = "okay"; + }; + ethernet@5 { + compatible = "fsl,p2041-dpa-ethernet", "fsl,dpa-ethernet"; + fsl,qman-channel = <&qpool1>; + fsl,fman-mac = <&enet5>; + status = "okay"; + }; + }; + + chosen { + stdin = "serial0"; + stdout = "serial0"; + }; +}; Copied: head/sys/boot/fdt/dts/powerpc/p3041ds.dts (from r267196, head/sys/boot/fdt/dts/arm/p3041ds.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/powerpc/p3041ds.dts Sat Jun 7 02:55:53 2014 (r267202, copy of r267196, head/sys/boot/fdt/dts/arm/p3041ds.dts) @@ -0,0 +1,587 @@ +/* + * P3041DS Device Tree Source + * + * Copyright 2010-2011 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* $FreeBSD$ */ + +/include/ "p3041si.dtsi" + +/ { + model = "fsl,P3041DS"; + compatible = "fsl,P3041DS"; + #address-cells = <2>; + #size-cells = <2>; + interrupt-parent = <&mpic>; + + aliases { + phy_rgmii_0 = &phy_rgmii_0; + phy_rgmii_1 = &phy_rgmii_1; + phy_sgmii_1c = &phy_sgmii_1c; + phy_sgmii_1d = &phy_sgmii_1d; + phy_sgmii_1e = &phy_sgmii_1e; + phy_sgmii_1f = &phy_sgmii_1f; + phy_xgmii_1 = &phy_xgmii_1; + phy_xgmii_2 = &phy_xgmii_2; + emi1_rgmii = &hydra_mdio_rgmii; + emi1_sgmii = &hydra_mdio_sgmii; + emi2_xgmii = &hydra_mdio_xgmii; + }; + + memory { + device_type = "memory"; + reg = <0x00000000 0x00000000 0x00000000 0x80000000>; + }; + + dcsr: dcsr@f00000000 { + ranges = <0x00000000 0xf 0x00000000 0x01008000>; + }; + + bman-portals@ff4000000 { + bman-portal@0 { + cpu-handle = <&cpu0>; + }; + bman-portal@4000 { + cpu-handle = <&cpu1>; + }; + bman-portal@8000 { + cpu-handle = <&cpu2>; + }; + bman-portal@c000 { + cpu-handle = <&cpu3>; + }; + bman-portal@10000 { + }; + bman-portal@14000 { + }; + bman-portal@18000 { + }; + bman-portal@1c000 { + }; + bman-portal@20000 { + }; + bman-portal@24000 { + }; + + buffer-pool@0 { + compatible = "fsl,p3041-bpool", "fsl,bpool"; + fsl,bpid = <0>; + fsl,bpool-cfg = <0 0x100 0 1 0 0x100>; + }; + }; + + qman-portals@ff4200000 { + qportal0: qman-portal@0 { + cpu-handle = <&cpu0>; + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal1: qman-portal@4000 { + cpu-handle = <&cpu1>; + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal2: qman-portal@8000 { + cpu-handle = <&cpu2>; + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal3: qman-portal@c000 { + cpu-handle = <&cpu3>; + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal4: qman-portal@10000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal5: qman-portal@14000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal6: qman-portal@18000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal7: qman-portal@1c000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal8: qman-portal@20000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + + qportal9: qman-portal@24000 { + fsl,qman-pool-channels = <&qpool1 &qpool2 &qpool3 + &qpool4 &qpool5 &qpool6 + &qpool7 &qpool8 &qpool9 + &qpool10 &qpool11 &qpool12 + &qpool13 &qpool14 &qpool15>; + }; + }; + + soc: soc@ffe000000 { + spi@110000 { + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spansion,s25sl12801"; + reg = <0>; + spi-max-frequency = <35000000>; /* input clock */ + partition@u-boot { + label = "u-boot"; + reg = <0x00000000 0x00100000>; + read-only; + }; + partition@kernel { + label = "kernel"; + reg = <0x00100000 0x00500000>; + read-only; + }; + partition@dtb { + label = "dtb"; + reg = <0x00600000 0x00100000>; + read-only; + }; + partition@fs { + label = "file system"; + reg = <0x00700000 0x00900000>; + }; + }; + }; + + i2c@118100 { + eeprom@51 { + compatible = "at24,24c256"; + reg = <0x51>; + }; + eeprom@52 { + compatible = "at24,24c256"; + reg = <0x52>; + }; + }; + + i2c@119100 { + rtc@68 { + compatible = "dallas,ds3232"; + reg = <0x68>; + interrupts = <0x1 0x1 0 0>; + }; + }; + + pme: pme@316000 { + /* Commented out, use default allocation */ + /* fsl,pme-pdsr = <0x0 0x23000000 0x0 0x01000000>; */ + /* fsl,pme-sre = <0x0 0x24000000 0x0 0x00a00000>; */ + }; + + qman: qman@318000 { + /* Commented out, use default allocation */ + /* fsl,qman-fqd = <0x0 0x20000000 0x0 0x01000000>; */ + /* fsl,qman-pfdr = <0x0 0x21000000 0x0 0x01000000>; */ + }; + + bman: bman@31a000 { + /* Same as fsl,qman-*, use default allocation */ + /* fsl,bman-fbpr = <0x0 0x22000000 0x0 0x01000000>; */ + }; + + fman0: fman@400000 { + enet0: ethernet@e0000 { + tbi-handle = <&tbi0>; + phy-handle = <&phy_rgmii_0>; + phy-connection-type = "rgmii"; + }; + + mdio0: mdio@e1120 { + tbi0: tbi-phy@8 { + reg = <0x8>; + device_type = "tbi-phy"; + }; + + /* + * Virtual MDIO for the two on-board RGMII + * ports. The fsl,hydra-mdio-muxval property + * is already correct. + */ + hydra_mdio_rgmii: hydra-mdio-rgmii { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,hydra-mdio"; + fsl,mdio-handle = <&mdio0>; + fsl,hydra-mdio-muxval = <0x00>; + status = "disabled"; + + phy_rgmii_0: ethernet-phy@0 { + reg = <0x0>; + }; + phy_rgmii_1: ethernet-phy@1 { + reg = <0x1>; + }; + }; + + /* + * Virtual MDIO for the four-port SGMII card. + * The fsl,hydra-mdio-muxval property will be + * fixed-up by U-Boot based on the slot that + * the SGMII card is in. + * + * Note: we do not support DTSEC5 connected to + * SGMII, so this is the only SGMII node. + */ + hydra_mdio_sgmii: hydra-mdio-sgmii { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,hydra-mdio"; + fsl,mdio-handle = <&mdio0>; + fsl,hydra-mdio-muxval = <0x00>; + status = "disabled"; + + phy_sgmii_1c: ethernet-phy@1c { + reg = <0x1c>; + }; + phy_sgmii_1d: ethernet-phy@1d { + reg = <0x1d>; + }; + phy_sgmii_1e: ethernet-phy@1e { + reg = <0x1e>; + }; + phy_sgmii_1f: ethernet-phy@1f { + reg = <0x1f>; + }; + }; + }; + + enet1: ethernet@e2000 { + tbi-handle = <&tbi1>; + phy-handle = <&phy_sgmii_1d>; + phy-connection-type = "sgmii"; + }; + + mdio@e3120 { + tbi1: tbi-phy@8 { + reg = <8>; + device_type = "tbi-phy"; + }; + }; + + enet2: ethernet@e4000 { + tbi-handle = <&tbi2>; + phy-handle = <&phy_sgmii_1e>; + phy-connection-type = "sgmii"; + }; + + mdio@e5120 { + tbi2: tbi-phy@8 { + reg = <8>; + device_type = "tbi-phy"; + }; + }; + + enet3: ethernet@e6000 { + tbi-handle = <&tbi3>; + phy-handle = <&phy_sgmii_1f>; + phy-connection-type = "sgmii"; + }; + + mdio@e7120 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,fman-tbi"; + reg = <0xe7120 0xee0>; + interrupts = <100 1 0 0>; + + tbi3: tbi-phy@8 { + reg = <8>; + device_type = "tbi-phy"; + }; + }; + + enet4: ethernet@e8000 { + tbi-handle = <&tbi4>; + phy-handle = <&phy_rgmii_1>; + phy-connection-type = "rgmii"; + }; + + mdio@e9120 { + tbi4: tbi-phy@8 { + reg = <8>; + device_type = "tbi-phy"; + }; + }; + + enet5: ethernet@f0000 { + /* + * phy-handle will be updated by U-Boot to + * reflect the actual slot the XAUI card is in. + */ + phy-handle = <&phy_xgmii_1>; + phy-connection-type = "xgmii"; + }; + + /* + * We only support one XAUI card, so the MDIO muxing + * is set by U-Boot, and Linux never touches it. + * Therefore, we don't need a virtual MDIO node. + * However, the phy address depends on the slot, so + * only one of the ethernet-phy nodes below will be + * used. + */ + hydra_mdio_xgmii: mdio@f1000 { + status = "disabled"; + + /* XAUI card in slot 1 */ + phy_xgmii_1: ethernet-phy@4 { + reg = <0x4>; + }; + + /* XAUI card in slot 2 */ + phy_xgmii_2: ethernet-phy@0 { + reg = <0x0>; + }; + }; + }; + }; + + rapidio@ffe0c0000 { + reg = <0xf 0xfe0c0000 0 0x11000>; + + port1 { + ranges = <0 0 0xc 0x20000000 0 0x10000000>; + }; + port2 { + ranges = <0 0 0xc 0x30000000 0 0x10000000>; + }; + }; + + localbus@ffe124000 { + reg = <0xf 0xfe124000 0 0x1000>; + ranges = <0 0 0xf 0xb8000000 0x04000000>; + + flash@0,0 { + compatible = "cfi-flash"; + /* + * Map 64Mb of 128MB NOR flash memory. Since highest + * line of address of NOR flash memory are set by + * FPGA, memory are divided into two pages equal to + * 64MB. One of the pages can be accessed at once. + */ + reg = <0 0 0x04000000>; + bank-width = <2>; + device-width = <2>; + }; + + nand@2,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,elbc-fcm-nand"; + reg = <0x2 0x0 0x40000>; + + partition@0 { + label = "NAND U-Boot Image"; + reg = <0x0 0x02000000>; + read-only; + }; + + partition@2000000 { + label = "NAND Root File System"; + reg = <0x02000000 0x10000000>; + }; + + partition@12000000 { + label = "NAND Compressed RFS Image"; + reg = <0x12000000 0x08000000>; + }; + + partition@1a000000 { + label = "NAND Linux Kernel Image"; + reg = <0x1a000000 0x04000000>; + }; + + partition@1e000000 { + label = "NAND DTB Image"; + reg = <0x1e000000 0x01000000>; + }; + + partition@1f000000 { + label = "NAND Writable User area"; + reg = <0x1f000000 0x21000000>; + }; + }; + + board-control@3,0 { + compatible = "fsl,p3041ds-fpga", "fsl,fpga-ngpixis"; + reg = <3 0 0x30>; + }; + }; + + pci0: pcie@ffe200000 { + reg = <0xf 0xfe200000 0 0x1000>; + ranges = <0x02000000 0 0x80000000 0x0 0x80000000 0x0 0x10000000 + 0x01000000 0 0x00000000 0x0 0xff000000 0x0 0x00010000>; + pcie@0 { + ranges = <0x02000000 0 0x80000000 + 0x02000000 0 0x80000000 + 0 0x10000000 + + 0x01000000 0 0x00000000 + 0x01000000 0 0xff000000 + 0 0x00010000>; + }; + }; + + pci1: pcie@ffe201000 { + reg = <0xf 0xfe201000 0 0x1000>; + ranges = <0x02000000 0x0 0x90000000 0x0 0x90000000 0x0 0x10000000 + 0x01000000 0x0 0x00000000 0x0 0xff010000 0x0 0x00010000>; + pcie@0 { + ranges = <0x02000000 0 0x90000000 + 0x02000000 0 0x90000000 + 0 0x10000000 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Jun 7 07:23:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA83FD79; Sat, 7 Jun 2014 07:23:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96EAE24E3; Sat, 7 Jun 2014 07:23:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s577NI5b056027; Sat, 7 Jun 2014 07:23:18 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s577NIod056025; Sat, 7 Jun 2014 07:23:18 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406070723.s577NIod056025@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 7 Jun 2014 07:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267210 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2014 07:23:18 -0000 Author: hselasky Date: Sat Jun 7 07:23:17 2014 New Revision: 267210 URL: http://svnweb.freebsd.org/changeset/base/267210 Log: Some further DWC OTG improvements for full speed and low speed devices: - Revert r265427. It appears we are halting the DWC OTG host controller schedule if we process events only at every SOF. When doing split transactions we rely on that events are processed quickly and waiting too long might cause data loss. - We are not always able to meet the timing requirements of interrupt endpoint split transactions. Switch from INTERRUPT to CONTROL endpoint type for interrupt endpoint events until further, hence CONTROL endpoint events are more relaxed, reducing the chance of data loss. See comment in code for more in-depth explanation. - Simplify TT scheduling. MFC after: 3 days Modified: head/sys/dev/usb/controller/dwc_otg.c head/sys/dev/usb/controller/dwc_otg.h Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Sat Jun 7 05:14:07 2014 (r267209) +++ head/sys/dev/usb/controller/dwc_otg.c Sat Jun 7 07:23:17 2014 (r267210) @@ -98,6 +98,8 @@ GINTMSK_USBSUSPMSK | \ GINTMSK_IEPINTMSK | \ GINTMSK_SESSREQINTMSK | \ + GINTMSK_RXFLVLMSK | \ + GINTMSK_HCHINTMSK | \ GINTMSK_OTGINTMSK | \ GINTMSK_PRTINTMSK) @@ -239,7 +241,8 @@ dwc_otg_init_fifo(struct dwc_otg_softc * for (x = 0; x != sc->sc_host_ch_max; x++) { /* disable all host interrupts */ - DWC_OTG_WRITE_4(sc, DOTG_HCINTMSK(x), 0); + DWC_OTG_WRITE_4(sc, DOTG_HCINTMSK(x), + HCINT_DEFAULT_MASK); } DWC_OTG_WRITE_4(sc, DOTG_HPTXFSIZ, @@ -256,8 +259,9 @@ dwc_otg_init_fifo(struct dwc_otg_softc * /* store maximum periodic and non-periodic FIFO TX size */ sc->sc_tx_max_size = fifo_size; - /* disable all host channel interrupts */ - DWC_OTG_WRITE_4(sc, DOTG_HAINTMSK, 0); + /* enable all host channel interrupts */ + DWC_OTG_WRITE_4(sc, DOTG_HAINTMSK, + (1U << sc->sc_host_ch_max) - 1U); } if (mode == DWC_MODE_DEVICE) { @@ -568,11 +572,9 @@ dwc_otg_common_rx_ack(struct dwc_otg_sof { DPRINTFN(5, "RX status clear\n"); - if (sc->sc_flags.status_device_mode != 0) { - /* enable RX FIFO level interrupt */ - sc->sc_irq_mask |= GINTMSK_RXFLVLMSK; - DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); - } + /* enable RX FIFO level interrupt */ + sc->sc_irq_mask |= GINTMSK_RXFLVLMSK; + DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); /* clear cached status */ sc->sc_last_rx_status = 0; @@ -607,8 +609,7 @@ dwc_otg_host_channel_alloc(struct dwc_ot /* compute needed TX FIFO size */ if (is_out != 0) { - if (td->ep_type == UE_INTERRUPT || - td->ep_type == UE_ISOCHRONOUS) { + if (td->ep_type == UE_ISOCHRONOUS) { tx_p_size = td->max_packet_size; tx_np_size = 0; if (td->hcsplt != 0 && tx_p_size > HCSPLT_XACTLEN_BURST) @@ -687,7 +688,7 @@ dwc_otg_host_channel_free(struct dwc_otg * after a fixed given amount of time the host channel is no * longer doing any USB traffic: */ - if (td->ep_type == UE_ISOCHRONOUS || td->ep_type == UE_INTERRUPT) { + if (td->ep_type == UE_ISOCHRONOUS) { /* double buffered */ sc->sc_chan_state[x].wait_sof = DWC_OTG_SLOT_IDLE_MAX; } else { @@ -874,10 +875,7 @@ send_pkt: DOTG_DFIFO(td->channel), (uint32_t *)&req, sizeof(req) / 4); /* wait until next slot before trying complete split */ - if (td->ep_type == UE_INTERRUPT || td->ep_type == UE_ISOCHRONOUS) - td->tt_complete_slot = sc->sc_last_frame_num + 2; - else - td->tt_complete_slot = sc->sc_last_frame_num + 1; + td->tt_complete_slot = sc->sc_last_frame_num + 1; /* store number of bytes transmitted */ td->tx_bytes = sizeof(req); @@ -1352,15 +1350,7 @@ receive_pkt: } delta = sc->sc_last_frame_num - td->tt_start_slot; if (delta > DWC_OTG_TT_SLOT_MAX) { - if (td->ep_type == UE_INTERRUPT) { - /* - * Happens from time to time avoid - * posting an error, instead retry - * the start split packet: - */ - td->tt_scheduled = 0; - goto receive_spkt; - } else if (td->ep_type != UE_ISOCHRONOUS) { + if (td->ep_type != UE_ISOCHRONOUS) { /* we missed the service interval */ td->error_any = 1; } @@ -1460,10 +1450,7 @@ receive_spkt: hcchar |= HCCHAR_EPDIR_IN; /* wait until next slot before trying complete split */ - if (td->ep_type == UE_INTERRUPT || td->ep_type == UE_ISOCHRONOUS) - td->tt_complete_slot = sc->sc_last_frame_num + 2; - else - td->tt_complete_slot = sc->sc_last_frame_num + 1; + td->tt_complete_slot = sc->sc_last_frame_num + 1; /* must enable channel before data can be received */ DWC_OTG_WRITE_4(sc, DOTG_HCCHAR(channel), hcchar); @@ -2346,18 +2333,11 @@ dwc_otg_host_channel_disable(struct dwc_ } static uint16_t -dwc_otg_compute_tt_slot(struct dwc_otg_tt_info *pinfo, uint16_t io_bytes) +dwc_otg_compute_isoc_rx_tt_slot(struct dwc_otg_tt_info *pinfo) { - const uint16_t limit = (188 * 5) / 6; /* includes bit-stuffing */ - uint16_t retval = pinfo->slot_index; - - pinfo->bytes_used += io_bytes; - while (pinfo->slot_index < 6 && - pinfo->bytes_used >= limit) { - pinfo->bytes_used -= limit; + if (pinfo->slot_index < DWC_OTG_TT_SLOT_MAX) pinfo->slot_index++; - } - return (retval); + return (pinfo->slot_index); } static uint8_t @@ -2412,11 +2392,17 @@ dwc_otg_update_host_transfer_schedule_lo continue; /* compute slot */ - slot = temp + dwc_otg_compute_tt_slot( - sc->sc_tt_info + td->tt_index, td->remainder); - - /* Start ASAP */ - td->tt_start_slot = slot + 0; + slot = dwc_otg_compute_isoc_rx_tt_slot( + sc->sc_tt_info + td->tt_index); + if (slot > 3) { + /* + * Not enough time to get complete + * split executed. + */ + continue; + } + /* Delayed start */ + td->tt_start_slot = temp + slot; td->tt_scheduled = 1; TAILQ_REMOVE(&sc->sc_bus.intr_q.head, xfer, wait_entry); TAILQ_INSERT_TAIL(&head, xfer, wait_entry); @@ -2439,12 +2425,8 @@ dwc_otg_update_host_transfer_schedule_lo if (td->hcsplt == 0 || td->tt_scheduled != 0) continue; - /* compute slot */ - slot = temp + dwc_otg_compute_tt_slot( - sc->sc_tt_info + td->tt_index, td->remainder); - /* Start ASAP */ - td->tt_start_slot = slot + 0; + td->tt_start_slot = temp; td->tt_scheduled = 1; TAILQ_REMOVE(&sc->sc_bus.intr_q.head, xfer, wait_entry); TAILQ_INSERT_TAIL(&head, xfer, wait_entry); @@ -2469,12 +2451,8 @@ dwc_otg_update_host_transfer_schedule_lo continue; } - /* compute slot */ - slot = temp + dwc_otg_compute_tt_slot(sc->sc_tt_info + td->tt_index, - td->max_packet_size); - /* start ASAP */ - td->tt_start_slot = slot + 0; + td->tt_start_slot = temp; sc->sc_needsof = 1; td->tt_scheduled = 1; TAILQ_REMOVE(&sc->sc_bus.intr_q.head, xfer, wait_entry); @@ -2494,11 +2472,8 @@ dwc_otg_update_host_transfer_schedule_lo if (td->hcsplt == 0 || td->tt_scheduled != 0) continue; - /* compute slot */ - slot = temp + dwc_otg_compute_tt_slot(sc->sc_tt_info + td->tt_index, 0); - /* start ASAP */ - td->tt_start_slot = slot + 0; + td->tt_start_slot = temp; td->tt_scheduled = 1; TAILQ_REMOVE(&sc->sc_bus.intr_q.head, xfer, wait_entry); TAILQ_INSERT_TAIL(&head, xfer, wait_entry); @@ -2518,17 +2493,8 @@ dwc_otg_update_host_transfer_schedule_lo if (td->hcsplt == 0 || td->tt_scheduled != 0) continue; - /* compute slot */ - slot = dwc_otg_compute_tt_slot(sc->sc_tt_info + td->tt_index, 0); - - /* figure out highest slot number */ - if (slot < (temp & 7)) - slot = temp; - else - slot += (temp & ~7); - /* start ASAP */ - td->tt_start_slot = slot + 0; + td->tt_start_slot = temp; td->tt_scheduled = 1; TAILQ_REMOVE(&sc->sc_bus.intr_q.head, xfer, wait_entry); TAILQ_INSERT_TAIL(&head, xfer, wait_entry); @@ -2809,8 +2775,6 @@ dwc_otg_interrupt(void *arg) /* Disable SOF interrupt */ sc->sc_irq_mask &= ~GINTMSK_SOFMSK; - /* Enable RX frame interrupt */ - sc->sc_irq_mask |= GINTMSK_RXFLVLMSK; DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); /* complete root HUB interrupt endpoint */ @@ -2851,7 +2815,7 @@ dwc_otg_interrupt(void *arg) * suspend and RX frame interrupt: */ sc->sc_irq_mask &= ~(GINTMSK_WKUPINTMSK | GINTMSK_SOFMSK); - sc->sc_irq_mask |= (GINTMSK_USBSUSPMSK | GINTMSK_RXFLVLMSK); + sc->sc_irq_mask |= GINTMSK_USBSUSPMSK; DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); /* complete root HUB interrupt endpoint */ @@ -2922,10 +2886,6 @@ dwc_otg_interrupt(void *arg) /* complete root HUB interrupt endpoint */ dwc_otg_root_intr(sc); - /* disable RX FIFO level interrupt */ - sc->sc_irq_mask &= ~GINTMSK_RXFLVLMSK; - DWC_OTG_WRITE_4(sc, DOTG_GINTMSK, sc->sc_irq_mask); - /* update host frame interval */ dwc_otg_update_host_frame_interval(sc); } @@ -3222,9 +3182,26 @@ dwc_otg_setup_standard_chain(struct usb_ (xfer->address << HCCHAR_DEVADDR_SHIFT) | ((xfer->endpointno & UE_ADDR) << HCCHAR_EPNUM_SHIFT) | (xfer->max_packet_size << HCCHAR_MPS_SHIFT) | - (td->ep_type << HCCHAR_EPTYPE_SHIFT) | HCCHAR_CHENA; + /* + * We are not always able to meet the timing + * requirements of the USB interrupt endpoint's + * complete split token, when doing transfers going + * via a transaction translator. Use the CONTROL + * transfer type instead of the INTERRUPT transfer + * type in general, as a means to workaround + * that. This trick should work for both FULL and LOW + * speed USB traffic going through a TT. For non-TT + * traffic it works aswell. The reason for using + * CONTROL type instead of BULK is that some TTs might + * reject LOW speed BULK traffic. + */ + if (td->ep_type == UE_INTERRUPT) + hcchar |= (UE_CONTROL << HCCHAR_EPTYPE_SHIFT); + else + hcchar |= (td->ep_type << HCCHAR_EPTYPE_SHIFT); + if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_LOW) hcchar |= HCCHAR_LSPDDEV; if (UE_GET_DIR(xfer->endpointno) == UE_DIR_IN) @@ -3262,13 +3239,12 @@ dwc_otg_setup_standard_chain(struct usb_ break; case USB_SPEED_HIGH: hcsplt = 0; - if (td->ep_type == UE_ISOCHRONOUS || - td->ep_type == UE_INTERRUPT) { - hcchar |= ((xfer->max_packet_count & 3) - << HCCHAR_MC_SHIFT); - } if (td->ep_type == UE_INTERRUPT) { uint32_t ival; +#if 0 + hcchar |= ((xfer->max_packet_count & 3) + << HCCHAR_MC_SHIFT); +#endif ival = xfer->interval / DWC_OTG_HOST_TIMER_RATE; if (ival == 0) ival = 1; @@ -3277,6 +3253,8 @@ dwc_otg_setup_standard_chain(struct usb_ td->tmr_val = sc->sc_tmr_val + ival; td->tmr_res = ival; } else if (td->ep_type == UE_ISOCHRONOUS) { + hcchar |= ((xfer->max_packet_count & 3) + << HCCHAR_MC_SHIFT); td->tmr_val = 0; td->tmr_res = 1 << usbd_xfer_get_fps_shift(xfer); } else { Modified: head/sys/dev/usb/controller/dwc_otg.h ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.h Sat Jun 7 05:14:07 2014 (r267209) +++ head/sys/dev/usb/controller/dwc_otg.h Sat Jun 7 07:23:17 2014 (r267210) @@ -35,7 +35,7 @@ #define DWC_OTG_MAX_ENDPOINTS 16 #define DWC_OTG_HOST_TIMER_RATE 10 /* ms */ #define DWC_OTG_TT_SLOT_MAX 8 -#define DWC_OTG_SLOT_IDLE_MAX 4 +#define DWC_OTG_SLOT_IDLE_MAX 3 #define DWC_OTG_SLOT_IDLE_MIN 2 #define DWC_OTG_NAK_MAX 8 /* 1 ms */ @@ -93,9 +93,7 @@ struct dwc_otg_td { }; struct dwc_otg_tt_info { - uint16_t bytes_used; uint8_t slot_index; - uint8_t dummy; }; struct dwc_otg_std_temp { From owner-svn-src-head@FreeBSD.ORG Sat Jun 7 10:13:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 553BCC75; Sat, 7 Jun 2014 10:13:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4264720F2; Sat, 7 Jun 2014 10:13:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s57ADkG6032875; Sat, 7 Jun 2014 10:13:46 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s57ADkaD032874; Sat, 7 Jun 2014 10:13:46 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406071013.s57ADkaD032874@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 7 Jun 2014 10:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267211 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2014 10:13:46 -0000 Author: hselasky Date: Sat Jun 7 10:13:45 2014 New Revision: 267211 URL: http://svnweb.freebsd.org/changeset/base/267211 Log: Fix for USB specification compliance. We need to accept both DATA0 and DATA1 for INTERRUPT endpoints. MFC after: 3 days Modified: head/sys/dev/usb/controller/dwc_otg.c Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Sat Jun 7 07:23:17 2014 (r267210) +++ head/sys/dev/usb/controller/dwc_otg.c Sat Jun 7 10:13:45 2014 (r267211) @@ -1263,6 +1263,22 @@ dwc_otg_host_data_rx(struct dwc_otg_soft case DWC_CHAN_ST_WAIT_ANE: if (hcint & (HCINT_RETRY | HCINT_ERRORS)) { + if (td->ep_type == UE_INTERRUPT) { + /* + * The USB specification does not + * mandate a particular data toggle + * value for USB INTERRUPT + * transfers. Switch the data toggle + * value to receive the packet + * correctly: + */ + if (hcint & HCINT_DATATGLERR) { + DPRINTF("Retrying packet due to " + "data toggle error\n"); + td->toggle ^= 1; + goto receive_pkt; + } + } td->did_nak++; td->tt_scheduled = 0; if (td->hcsplt != 0) From owner-svn-src-head@FreeBSD.ORG Sat Jun 7 15:21:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43A62335 for ; Sat, 7 Jun 2014 15:21:52 +0000 (UTC) Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA8662630 for ; Sat, 7 Jun 2014 15:21:51 +0000 (UTC) Received: by mail-pd0-f176.google.com with SMTP id p10so3598966pdj.7 for ; Sat, 07 Jun 2014 08:21:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:content-type:mime-version:subject :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=SRgbpQFxsYAoxG2F6OuL2h+9DWTNEUkTD1qNFoQt/wM=; b=I18b0xn8SaJasMGlFv+zDNcZmc1zByQmnZy5vjXfSKV0EWHSS7/lTVt21AJhQKCMfD CE0jU+U6i/EMem+BfGX7GtuwXgGWViQM/S+tqpAfIdN5UVFc2FDO7acd29pkbSEQA1ST VvzkImvU7DTPhgJl78AvsBPRdD2J1QfedM95Vw8XCsSNrOQ9zwRwL62dkTvw2ciNx4w1 Kz+Vac3UNoMtT6rCuQk9Zfo3QRCD3/sVE+NJrfH/YQCMKn6Lmn89cBL6N5bvGDOnUXI1 uuOU/i7Fl5tX790L28IZpQLdi2+5dnRWS6qqE76WULtqKteCeUZ/vwskdDIN4RDXOj5V jFNg== X-Gm-Message-State: ALoCoQnqrBhWOL7Zl95YyF41zxT/kDtKBqOVrjpkw0WVhhRTtYjfZPkeOOafQLXhmaefN6IIDmBX X-Received: by 10.69.17.66 with SMTP id gc2mr12867369pbd.90.1402154505110; Sat, 07 Jun 2014 08:21:45 -0700 (PDT) Received: from lgmac-cvenus.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id wp3sm49728439pbc.67.2014.06.07.08.21.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 07 Jun 2014 08:21:44 -0700 (PDT) Sender: Warner Losh From: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r266760 - head/contrib/bmake In-Reply-To: <538FE18E.7050101@freebsd.org> Date: Sat, 7 Jun 2014 09:21:42 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <8AF17138-4C5B-4298-829E-CC2B98178DAC@gmail.com> References: <201405271839.s4RIdDq8055387@svn.freebsd.org> <538D1DB7.7010508@FreeBSD.org> <20140603044638.81DF6580A1@chaos.jnpr.net> <20140603063512.GB45150@ivaldir.etoilebsd.net> <538F3918.6040002@FreeBSD.org> <538FE18E.7050101@freebsd.org> To: Julian Elischer X-Mailer: Apple Mail (2.1878.2) Cc: Baptiste Daroussin , src-committers , Eitan Adler , svn-src-all@freebsd.org, "Simon J. Gerraty" , svn-src-head@freebsd.org, "Drewery, Bryan" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2014 15:21:52 -0000 On Jun 4, 2014, at 9:18 PM, Julian Elischer wrote: > On 6/4/14, 11:19 PM, Drewery, Bryan wrote: >> On 6/4/14, 2:26 AM, Eitan Adler wrote: >>> On 2 June 2014 23:35, Baptiste Daroussin wrote: >>>> On Mon, Jun 02, 2014 at 09:46:38PM -0700, Simon J. Gerraty wrote: >>>>>=20 >>>>> On Mon, 2 Jun 2014 19:58:31 -0500, Bryan Drewery writes: >>>>>> Not sure if anyone cares, but this change breaks all ports tree >>>>>> checkouts from before 2014-05-05 on src head with this revision. >>>>>=20 >>>>> Yes, an older ports tree would need an older bmake (or fmake). >>>>> Are we saying ports is *not* ready for that hack to be removed? >>>>>=20 >>>>=20 >>>> IMHO it is, just people has to be aware of that :) >>>=20 >>> ports-announce@ is the correct location for this announcement :) >>>=20 >>=20 >> I think that would just confuse people. I don't think this is worthy = of such a big announcement. I can write up something to current@ and = ports@ though. It's really only an issue if you are trying to use older = ports tree and why would you anyway in most cases? >>=20 > We have a scenario where we check out a ports tree at one revision, = but then need to slide parts of it back and forth to get to a specific = revision of a port that we need. We can not affort to re-verrify every = port revision every month, so it stays at an old revision generally but = individual ports my upgrade if there is a security risk or may remain on = anold revision if a newer version breaks thins for us. (it happens). >=20 > If that breaks we will not be happy I plan on reverting this because it is premature. Too many people have = their own forked ports trees that haven=92t necessarily been updated. = The update is simple, true enough, but it is surprising. There=92s no = harm in leaving that code there for a while longer since it is opt-in = now. I may add a warning to highlight its use... Warner= From owner-svn-src-head@FreeBSD.ORG Sat Jun 7 15:34:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAF1D944; Sat, 7 Jun 2014 15:34:57 +0000 (UTC) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14D942730; Sat, 7 Jun 2014 15:34:56 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id r20so2358506wiv.1 for ; Sat, 07 Jun 2014 08:34:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=mTcwkeYutQVmxHqgLz0f9oZq7Plmc+CRicZcTxUU76Y=; b=PHjPm2mpLDGFJ7PUOC614GkfhbIuCZDxytLYTeFD0jACVxaMu80Dg6aTJOrVD/X0sO +9H7xuGmZgx4b3IxPVPuWPQWMjdztCfsxHSoXVbxOqdvrZkTZ4yICTJ0fPfMKnhFHq8z MJ/E3B7YoYOob5AW4s0vPSLXg/O5YpSrMW6YoVaK+B0KM8yJNUrsuCgO1t247hfusx+1 4IWpgldfPGUhF8HruavvYHyUaH0K0YaDt7PO89AYTJRERtrriOwhEMZ3nto2cQaXiYvT ChORHiFoKH2Glm8YdfrmoVswq69md7jrpSXsOduQqMsZnTHRIzN2f8hkMoHJtz9RhUC9 l+XQ== X-Received: by 10.14.204.73 with SMTP id g49mr2328017eeo.2.1402155295133; Sat, 07 Jun 2014 08:34:55 -0700 (PDT) Received: from localhost (93-77-155-216-ptr.volia-lviv.com. [93.77.155.216]) by mx.google.com with ESMTPSA id x3sm31095207een.17.2014.06.07.08.34.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Jun 2014 08:34:54 -0700 (PDT) Sender: Mikolaj Golub Date: Sat, 7 Jun 2014 15:34:51 +0000 From: Mikolaj Golub To: Hans Petter Selasky Subject: Re: svn commit: r266394 - in head/sys/dev/usb: . controller Message-ID: <20140607153448.GA1566@gmail.com> References: <201405180913.s4I9DT3x044147@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201405180913.s4I9DT3x044147@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2014 15:34:58 -0000 Hi, On Sun, May 18, 2014 at 09:13:29AM +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Sun May 18 09:13:29 2014 > New Revision: 266394 > URL: http://svnweb.freebsd.org/changeset/base/266394 > > Log: > - Add softc pointer argument to FIFO functions as an optimisation. > - Implement support for interrupt filters in the DWC OTG driver, to > reduce the amount of CPU task switching when only feeding the FIFOs. > - Add common spinlock to the USB bus structure. I observe panic on WITNESS enabled kernel: lock (xhci0) spin mutex does not match earlier (sleep mutex) lock. in _mtx_init() usb_bus_mem_alloc_all xchi_init xhci_pci_attach device_attach > > Modified: head/sys/dev/usb/controller/usb_controller.c > ============================================================================== > --- head/sys/dev/usb/controller/usb_controller.c Sun May 18 04:33:24 2014 (r266393) > +++ head/sys/dev/usb/controller/usb_controller.c Sun May 18 09:13:29 2014 (r266394) > @@ -901,6 +901,9 @@ usb_bus_mem_alloc_all(struct usb_bus *bu > mtx_init(&bus->bus_mtx, device_get_nameunit(bus->parent), > NULL, MTX_DEF | MTX_RECURSE); > > + mtx_init(&bus->bus_spin_lock, device_get_nameunit(bus->parent), > + NULL, MTX_SPIN | MTX_RECURSE); > + I think because sleep mutex bus_mtx and spin mutex bus_spin_lock are initilized with the same name here. The pacth below fixes the issue for me. Not sure about its correctnes, did not find quickly a good example in the source. Index: sys/dev/usb/controller/usb_controller.c =================================================================== --- sys/dev/usb/controller/usb_controller.c (revision 267176) +++ sys/dev/usb/controller/usb_controller.c (working copy) @@ -898,10 +898,10 @@ bus->alloc_failed = 0; mtx_init(&bus->bus_mtx, device_get_nameunit(bus->parent), - NULL, MTX_DEF | MTX_RECURSE); + "bus_mtx", MTX_DEF | MTX_RECURSE); mtx_init(&bus->bus_spin_lock, device_get_nameunit(bus->parent), - NULL, MTX_SPIN | MTX_RECURSE); + "bus_spin_lock", MTX_SPIN | MTX_RECURSE); usb_callout_init_mtx(&bus->power_wdog, &bus->bus_mtx, 0); -- Mikolaj Golub From owner-svn-src-head@FreeBSD.ORG Sat Jun 7 15:51:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D50AFDB; Sat, 7 Jun 2014 15:51:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A4B22929; Sat, 7 Jun 2014 15:51:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s57FpU5m082455; Sat, 7 Jun 2014 15:51:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s57FpUfo082454; Sat, 7 Jun 2014 15:51:30 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406071551.s57FpUfo082454@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 7 Jun 2014 15:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267212 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2014 15:51:30 -0000 Author: hselasky Date: Sat Jun 7 15:51:29 2014 New Revision: 267212 URL: http://svnweb.freebsd.org/changeset/base/267212 Log: Make WITNESS happy by giving USB mutexes different names. Reported by: trociny @ MFC after: 3 days Modified: head/sys/dev/usb/controller/usb_controller.c Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Sat Jun 7 10:13:45 2014 (r267211) +++ head/sys/dev/usb/controller/usb_controller.c Sat Jun 7 15:51:29 2014 (r267212) @@ -899,10 +899,10 @@ usb_bus_mem_alloc_all(struct usb_bus *bu bus->alloc_failed = 0; mtx_init(&bus->bus_mtx, device_get_nameunit(bus->parent), - NULL, MTX_DEF | MTX_RECURSE); + "usb_def_mtx", MTX_DEF | MTX_RECURSE); mtx_init(&bus->bus_spin_lock, device_get_nameunit(bus->parent), - NULL, MTX_SPIN | MTX_RECURSE); + "usb_spin_mtx", MTX_SPIN | MTX_RECURSE); usb_callout_init_mtx(&bus->power_wdog, &bus->bus_mtx, 0); From owner-svn-src-head@FreeBSD.ORG Sat Jun 7 15:52:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DC671C1; Sat, 7 Jun 2014 15:52:48 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0046D2941; Sat, 7 Jun 2014 15:52:47 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 985241FE026; Sat, 7 Jun 2014 17:52:46 +0200 (CEST) Message-ID: <5393356C.4050703@selasky.org> Date: Sat, 07 Jun 2014 17:53:16 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Mikolaj Golub Subject: Re: svn commit: r266394 - in head/sys/dev/usb: . controller References: <201405180913.s4I9DT3x044147@svn.freebsd.org> <20140607153448.GA1566@gmail.com> In-Reply-To: <20140607153448.GA1566@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2014 15:52:48 -0000 On 06/07/14 17:34, Mikolaj Golub wrote: > Hi, > > On Sun, May 18, 2014 at 09:13:29AM +0000, Hans Petter Selasky wrote: > Index: sys/dev/usb/controller/usb_controller.c > =================================================================== > --- sys/dev/usb/controller/usb_controller.c (revision 267176) > +++ sys/dev/usb/controller/usb_controller.c (working copy) > @@ -898,10 +898,10 @@ > bus->alloc_failed = 0; > > mtx_init(&bus->bus_mtx, device_get_nameunit(bus->parent), > - NULL, MTX_DEF | MTX_RECURSE); > + "bus_mtx", MTX_DEF | MTX_RECURSE); > > mtx_init(&bus->bus_spin_lock, device_get_nameunit(bus->parent), > - NULL, MTX_SPIN | MTX_RECURSE); > + "bus_spin_lock", MTX_SPIN | MTX_RECURSE); > > usb_callout_init_mtx(&bus->power_wdog, > &bus->bus_mtx, 0); > Fixed in r267212. Thank you! --HPS From owner-svn-src-head@FreeBSD.ORG Sat Jun 7 17:12:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9679B526; Sat, 7 Jun 2014 17:12:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 821B22FC2; Sat, 7 Jun 2014 17:12:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s57HCSff021313; Sat, 7 Jun 2014 17:12:28 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s57HCR70021295; Sat, 7 Jun 2014 17:12:27 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201406071712.s57HCR70021295@svn.freebsd.org> From: Alan Cox Date: Sat, 7 Jun 2014 17:12:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267213 - in head/sys: amd64/amd64 arm/arm i386/i386 vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2014 17:12:28 -0000 Author: alc Date: Sat Jun 7 17:12:26 2014 New Revision: 267213 URL: http://svnweb.freebsd.org/changeset/base/267213 Log: Add a page size field to struct vm_page. Increase the page size field when a partially populated reservation becomes fully populated, and decrease this field when a fully populated reservation becomes partially populated. Use this field to simplify the implementation of pmap_enter_object() on amd64, arm, and i386. On all architectures where we support superpages, the cost of creating a superpage mapping is roughly the same as creating a base page mapping. For example, both kinds of mappings entail the creation of a single PTE and PV entry. With this in mind, use the page size field to make the implementation of vm_map_pmap_enter(..., MAP_PREFAULT_PARTIAL) a little smarter. Previously, if MAP_PREFAULT_PARTIAL was specified to vm_map_pmap_enter(), that function would only map base pages. Now, it will create up to 96 base page or superpage mappings. Reviewed by: kib Sponsored by: EMC / Isilon Storage Division Modified: head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap-v6.c head/sys/i386/i386/pmap.c head/sys/vm/vm_map.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_reserv.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Jun 7 15:51:29 2014 (r267212) +++ head/sys/amd64/amd64/pmap.c Sat Jun 7 17:12:26 2014 (r267213) @@ -4428,9 +4428,7 @@ pmap_enter_object(pmap_t pmap, vm_offset while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { va = start + ptoa(diff); if ((va & PDRMASK) == 0 && va + NBPDR <= end && - (VM_PAGE_TO_PHYS(m) & PDRMASK) == 0 && - pmap_ps_enabled(pmap) && - vm_reserv_level_iffullpop(m) == 0 && + m->psind == 1 && pmap_ps_enabled(pmap) && pmap_enter_pde(pmap, va, m, prot, &lock)) m = &m[NBPDR / PAGE_SIZE - 1]; else Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sat Jun 7 15:51:29 2014 (r267212) +++ head/sys/arm/arm/pmap-v6.c Sat Jun 7 17:12:26 2014 (r267213) @@ -3228,8 +3228,7 @@ pmap_enter_object(pmap_t pmap, vm_offset while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { va = start + ptoa(diff); if ((va & L1_S_OFFSET) == 0 && L2_NEXT_BUCKET(va) <= end && - (VM_PAGE_TO_PHYS(m) & L1_S_OFFSET) == 0 && - sp_enabled && vm_reserv_level_iffullpop(m) == 0 && + m->psind == 1 && sp_enabled && pmap_enter_section(pmap, va, m, prot)) m = &m[L1_S_SIZE / PAGE_SIZE - 1]; else Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Jun 7 15:51:29 2014 (r267212) +++ head/sys/i386/i386/pmap.c Sat Jun 7 17:12:26 2014 (r267213) @@ -3733,8 +3733,7 @@ pmap_enter_object(pmap_t pmap, vm_offset while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { va = start + ptoa(diff); if ((va & PDRMASK) == 0 && va + NBPDR <= end && - (VM_PAGE_TO_PHYS(m) & PDRMASK) == 0 && - pg_ps_enabled && vm_reserv_level_iffullpop(m) == 0 && + m->psind == 1 && pg_ps_enabled && pmap_enter_pde(pmap, va, m, prot)) m = &m[NBPDR / PAGE_SIZE - 1]; else Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sat Jun 7 15:51:29 2014 (r267212) +++ head/sys/vm/vm_map.c Sat Jun 7 17:12:26 2014 (r267213) @@ -1773,20 +1773,22 @@ vm_map_submap( } /* - * The maximum number of pages to map + * The maximum number of pages to map if MAP_PREFAULT_PARTIAL is specified */ #define MAX_INIT_PT 96 /* * vm_map_pmap_enter: * - * Preload read-only mappings for the specified object's resident pages - * into the target map. If "flags" is MAP_PREFAULT_PARTIAL, then only - * the resident pages within the address range [addr, addr + ulmin(size, - * ptoa(MAX_INIT_PT))) are mapped. Otherwise, all resident pages within - * the specified address range are mapped. This eliminates many soft - * faults on process startup and immediately after an mmap(2). Because - * these are speculative mappings, cached pages are not reactivated and + * Preload the specified map's pmap with mappings to the specified + * object's memory-resident pages. No further physical pages are + * allocated, and no further virtual pages are retrieved from secondary + * storage. If the specified flags include MAP_PREFAULT_PARTIAL, then a + * limited number of page mappings are created at the low-end of the + * specified address range. (For this purpose, a superpage mapping + * counts as one page mapping.) Otherwise, all resident pages within + * the specified address range are mapped. Because these mappings are + * being created speculatively, cached pages are not reactivated and * mapped. */ void @@ -1795,7 +1797,7 @@ vm_map_pmap_enter(vm_map_t map, vm_offse { vm_offset_t start; vm_page_t p, p_start; - vm_pindex_t psize, tmpidx; + vm_pindex_t mask, psize, threshold, tmpidx; if ((prot & (VM_PROT_READ | VM_PROT_EXECUTE)) == 0 || object == NULL) return; @@ -1813,8 +1815,6 @@ vm_map_pmap_enter(vm_map_t map, vm_offse } psize = atop(size); - if (psize > MAX_INIT_PT && (flags & MAP_PREFAULT_PARTIAL) != 0) - psize = MAX_INIT_PT; if (psize + pindex > object->size) { if (object->size < pindex) { VM_OBJECT_RUNLOCK(object); @@ -1825,6 +1825,7 @@ vm_map_pmap_enter(vm_map_t map, vm_offse start = 0; p_start = NULL; + threshold = MAX_INIT_PT; p = vm_page_find_least(object, pindex); /* @@ -1839,8 +1840,10 @@ vm_map_pmap_enter(vm_map_t map, vm_offse * don't allow an madvise to blow away our really * free pages allocating pv entries. */ - if ((flags & MAP_PREFAULT_MADVISE) && - vm_cnt.v_free_count < vm_cnt.v_free_reserved) { + if (((flags & MAP_PREFAULT_MADVISE) != 0 && + vm_cnt.v_free_count < vm_cnt.v_free_reserved) || + ((flags & MAP_PREFAULT_PARTIAL) != 0 && + tmpidx >= threshold)) { psize = tmpidx; break; } @@ -1849,6 +1852,16 @@ vm_map_pmap_enter(vm_map_t map, vm_offse start = addr + ptoa(tmpidx); p_start = p; } + /* Jump ahead if a superpage mapping is possible. */ + if (p->psind > 0 && ((addr + ptoa(tmpidx)) & + (pagesizes[p->psind] - 1)) == 0) { + mask = atop(pagesizes[p->psind]) - 1; + if (tmpidx + mask < psize && + vm_page_ps_is_valid(p)) { + p += mask; + threshold += mask; + } + } } else if (p_start != NULL) { pmap_enter_object(map->pmap, start, addr + ptoa(tmpidx), p_start, prot); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Jun 7 15:51:29 2014 (r267212) +++ head/sys/vm/vm_page.c Sat Jun 7 17:12:26 2014 (r267213) @@ -3044,6 +3044,31 @@ vm_page_is_valid(vm_page_t m, int base, } /* + * vm_page_ps_is_valid: + * + * Returns TRUE if the entire (super)page is valid and FALSE otherwise. + */ +boolean_t +vm_page_ps_is_valid(vm_page_t m) +{ + int i, npages; + + VM_OBJECT_ASSERT_LOCKED(m->object); + npages = atop(pagesizes[m->psind]); + + /* + * The physically contiguous pages that make up a superpage, i.e., a + * page with a page size index ("psind") greater than zero, will + * occupy adjacent entries in vm_page_array[]. + */ + for (i = 0; i < npages; i++) { + if (m[i].valid != VM_PAGE_BITS_ALL) + return (FALSE); + } + return (TRUE); +} + +/* * Set the page's dirty bits if the page is modified. */ void Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sat Jun 7 15:51:29 2014 (r267212) +++ head/sys/vm/vm_page.h Sat Jun 7 17:12:26 2014 (r267213) @@ -149,6 +149,7 @@ struct vm_page { uint8_t aflags; /* access is atomic */ uint8_t oflags; /* page VPO_* flags (O) */ uint8_t queue; /* page queue index (P,Q) */ + int8_t psind; /* pagesizes[] index (O) */ int8_t segind; uint8_t order; /* index of the buddy queue */ uint8_t pool; @@ -447,6 +448,7 @@ vm_page_t vm_page_next(vm_page_t m); int vm_page_pa_tryrelock(pmap_t, vm_paddr_t, vm_paddr_t *); struct vm_pagequeue *vm_page_pagequeue(vm_page_t m); vm_page_t vm_page_prev(vm_page_t m); +boolean_t vm_page_ps_is_valid(vm_page_t m); void vm_page_putfake(vm_page_t m); void vm_page_readahead_finish(vm_page_t m); void vm_page_reference(vm_page_t m); Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Sat Jun 7 15:51:29 2014 (r267212) +++ head/sys/vm/vm_reserv.c Sat Jun 7 17:12:26 2014 (r267213) @@ -249,6 +249,11 @@ vm_reserv_depopulate(vm_reserv_t rv, int if (rv->inpartpopq) { TAILQ_REMOVE(&vm_rvq_partpop, rv, partpopq); rv->inpartpopq = FALSE; + } else { + KASSERT(rv->pages->psind == 1, + ("vm_reserv_depopulate: reserv %p is already demoted", + rv)); + rv->pages->psind = 0; } clrbit(rv->popmap, index); rv->popcnt--; @@ -302,6 +307,8 @@ vm_reserv_populate(vm_reserv_t rv, int i index)); KASSERT(rv->popcnt < VM_LEVEL_0_NPAGES, ("vm_reserv_populate: reserv %p is already full", rv)); + KASSERT(rv->pages->psind == 0, + ("vm_reserv_populate: reserv %p is already promoted", rv)); if (rv->inpartpopq) { TAILQ_REMOVE(&vm_rvq_partpop, rv, partpopq); rv->inpartpopq = FALSE; @@ -311,7 +318,8 @@ vm_reserv_populate(vm_reserv_t rv, int i if (rv->popcnt < VM_LEVEL_0_NPAGES) { rv->inpartpopq = TRUE; TAILQ_INSERT_TAIL(&vm_rvq_partpop, rv, partpopq); - } + } else + rv->pages->psind = 1; } /* From owner-svn-src-head@FreeBSD.ORG Sat Jun 7 21:36:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B4E5D4C; Sat, 7 Jun 2014 21:36:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66DF12464; Sat, 7 Jun 2014 21:36:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s57LasSH041947; Sat, 7 Jun 2014 21:36:54 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s57Laqex041934; Sat, 7 Jun 2014 21:36:52 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201406072136.s57Laqex041934@svn.freebsd.org> From: Neel Natu Date: Sat, 7 Jun 2014 21:36:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267216 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm usr.sbin/bhyveload X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2014 21:36:54 -0000 Author: neel Date: Sat Jun 7 21:36:52 2014 New Revision: 267216 URL: http://svnweb.freebsd.org/changeset/base/267216 Log: Add ioctl(VM_REINIT) to reinitialize the virtual machine state maintained by vmm.ko. This allows the virtual machine to be restarted without having to destroy it first. Reviewed by: grehan Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_dev.c head/sys/amd64/vmm/vmm_stat.c head/sys/amd64/vmm/vmm_stat.h head/usr.sbin/bhyveload/bhyveload.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Sat Jun 7 19:42:37 2014 (r267215) +++ head/lib/libvmmapi/vmmapi.c Sat Jun 7 21:36:52 2014 (r267216) @@ -367,6 +367,13 @@ vm_suspend(struct vmctx *ctx, enum vm_su return (ioctl(ctx->fd, VM_SUSPEND, &vmsuspend)); } +int +vm_reinit(struct vmctx *ctx) +{ + + return (ioctl(ctx->fd, VM_REINIT, 0)); +} + static int vm_inject_exception_real(struct vmctx *ctx, int vcpu, int vector, int error_code, int error_code_valid) Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Sat Jun 7 19:42:37 2014 (r267215) +++ head/lib/libvmmapi/vmmapi.h Sat Jun 7 21:36:52 2014 (r267216) @@ -69,6 +69,7 @@ int vm_get_register(struct vmctx *ctx, i int vm_run(struct vmctx *ctx, int vcpu, uint64_t rip, struct vm_exit *ret_vmexit); int vm_suspend(struct vmctx *ctx, enum vm_suspend_how how); +int vm_reinit(struct vmctx *ctx); int vm_apicid2vcpu(struct vmctx *ctx, int apicid); int vm_inject_exception(struct vmctx *ctx, int vcpu, int vec); int vm_inject_exception2(struct vmctx *ctx, int vcpu, int vec, int errcode); Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Sat Jun 7 19:42:37 2014 (r267215) +++ head/sys/amd64/include/vmm.h Sat Jun 7 21:36:52 2014 (r267216) @@ -105,6 +105,7 @@ extern struct vmm_ops vmm_ops_amd; int vm_create(const char *name, struct vm **retvm); void vm_destroy(struct vm *vm); +int vm_reinit(struct vm *vm); const char *vm_name(struct vm *vm); int vm_malloc(struct vm *vm, vm_paddr_t gpa, size_t len); int vm_map_mmio(struct vm *vm, vm_paddr_t gpa, size_t len, vm_paddr_t hpa); Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Sat Jun 7 19:42:37 2014 (r267215) +++ head/sys/amd64/include/vmm_dev.h Sat Jun 7 21:36:52 2014 (r267216) @@ -196,6 +196,7 @@ enum { IOCNUM_SET_CAPABILITY = 2, IOCNUM_GET_CAPABILITY = 3, IOCNUM_SUSPEND = 4, + IOCNUM_REINIT = 5, /* memory apis */ IOCNUM_MAP_MEMORY = 10, @@ -251,6 +252,8 @@ enum { _IOWR('v', IOCNUM_RUN, struct vm_run) #define VM_SUSPEND \ _IOW('v', IOCNUM_SUSPEND, struct vm_suspend) +#define VM_REINIT \ + _IO('v', IOCNUM_REINIT) #define VM_MAP_MEMORY \ _IOWR('v', IOCNUM_MAP_MEMORY, struct vm_memory_segment) #define VM_GET_MEMORY_SEG \ Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Sat Jun 7 19:42:37 2014 (r267215) +++ head/sys/amd64/vmm/vmm.c Sat Jun 7 21:36:52 2014 (r267216) @@ -84,25 +84,31 @@ __FBSDID("$FreeBSD$"); struct vlapic; +/* + * Initialization: + * (a) allocated when vcpu is created + * (i) initialized when vcpu is created and when it is reinitialized + * (o) initialized the first time the vcpu is created + * (x) initialized before use + */ struct vcpu { - int flags; - enum vcpu_state state; - struct mtx mtx; - int hostcpu; /* host cpuid this vcpu last ran on */ - uint64_t guest_msrs[VMM_MSR_NUM]; - struct vlapic *vlapic; - int vcpuid; - struct savefpu *guestfpu; /* guest fpu state */ - uint64_t guest_xcr0; - void *stats; - struct vm_exit exitinfo; - enum x2apic_state x2apic_state; - int nmi_pending; - int extint_pending; - struct vm_exception exception; - int exception_pending; + struct mtx mtx; /* (o) protects 'state' and 'hostcpu' */ + enum vcpu_state state; /* (o) vcpu state */ + int hostcpu; /* (o) vcpu's host cpu */ + struct vlapic *vlapic; /* (i) APIC device model */ + enum x2apic_state x2apic_state; /* (i) APIC mode */ + int nmi_pending; /* (i) NMI pending */ + int extint_pending; /* (i) INTR pending */ + struct vm_exception exception; /* (x) exception collateral */ + int exception_pending; /* (i) exception pending */ + struct savefpu *guestfpu; /* (a,i) guest fpu state */ + uint64_t guest_xcr0; /* (i) guest %xcr0 register */ + void *stats; /* (a,i) statistics */ + uint64_t guest_msrs[VMM_MSR_NUM]; /* (i) emulated MSRs */ + struct vm_exit exitinfo; /* (x) exit reason and collateral */ }; +#define vcpu_lock_initialized(v) mtx_initialized(&((v)->mtx)) #define vcpu_lock_init(v) mtx_init(&((v)->mtx), "vcpu lock", 0, MTX_SPIN) #define vcpu_lock(v) mtx_lock_spin(&((v)->mtx)) #define vcpu_unlock(v) mtx_unlock_spin(&((v)->mtx)) @@ -116,36 +122,33 @@ struct mem_seg { }; #define VM_MAX_MEMORY_SEGMENTS 2 +/* + * Initialization: + * (o) initialized the first time the VM is created + * (i) initialized when VM is created and when it is reinitialized + * (x) initialized before use + */ struct vm { - void *cookie; /* processor-specific data */ - void *iommu; /* iommu-specific data */ - struct vhpet *vhpet; /* virtual HPET */ - struct vioapic *vioapic; /* virtual ioapic */ - struct vatpic *vatpic; /* virtual atpic */ - struct vatpit *vatpit; /* virtual atpit */ - struct vmspace *vmspace; /* guest's address space */ - struct vcpu vcpu[VM_MAXCPU]; - int num_mem_segs; - struct mem_seg mem_segs[VM_MAX_MEMORY_SEGMENTS]; - char name[VM_MAX_NAMELEN]; - - /* - * Set of active vcpus. - * An active vcpu is one that has been started implicitly (BSP) or - * explicitly (AP) by sending it a startup ipi. - */ - volatile cpuset_t active_cpus; - - struct mtx rendezvous_mtx; - cpuset_t rendezvous_req_cpus; - cpuset_t rendezvous_done_cpus; - void *rendezvous_arg; + void *cookie; /* (i) cpu-specific data */ + void *iommu; /* (x) iommu-specific data */ + struct vhpet *vhpet; /* (i) virtual HPET */ + struct vioapic *vioapic; /* (i) virtual ioapic */ + struct vatpic *vatpic; /* (i) virtual atpic */ + struct vatpit *vatpit; /* (i) virtual atpit */ + volatile cpuset_t active_cpus; /* (i) active vcpus */ + int suspend; /* (i) stop VM execution */ + volatile cpuset_t suspended_cpus; /* (i) suspended vcpus */ + volatile cpuset_t halted_cpus; /* (x) cpus in a hard halt */ + cpuset_t rendezvous_req_cpus; /* (x) rendezvous requested */ + cpuset_t rendezvous_done_cpus; /* (x) rendezvous finished */ + void *rendezvous_arg; /* (x) rendezvous func/arg */ vm_rendezvous_func_t rendezvous_func; - - int suspend; - volatile cpuset_t suspended_cpus; - - volatile cpuset_t halted_cpus; + struct mtx rendezvous_mtx; /* (o) rendezvous lock */ + int num_mem_segs; /* (o) guest memory segments */ + struct mem_seg mem_segs[VM_MAX_MEMORY_SEGMENTS]; + struct vmspace *vmspace; /* (o) guest's address space */ + char name[VM_MAX_NAMELEN]; /* (o) virtual machine name */ + struct vcpu vcpu[VM_MAXCPU]; /* (i) guest vcpus */ }; static int vmm_initialized; @@ -206,31 +209,46 @@ SYSCTL_INT(_hw_vmm, OID_AUTO, ipinum, CT "IPI vector used for vcpu notifications"); static void -vcpu_cleanup(struct vm *vm, int i) +vcpu_cleanup(struct vm *vm, int i, bool destroy) { struct vcpu *vcpu = &vm->vcpu[i]; VLAPIC_CLEANUP(vm->cookie, vcpu->vlapic); - vmm_stat_free(vcpu->stats); - fpu_save_area_free(vcpu->guestfpu); + if (destroy) { + vmm_stat_free(vcpu->stats); + fpu_save_area_free(vcpu->guestfpu); + } } static void -vcpu_init(struct vm *vm, uint32_t vcpu_id) +vcpu_init(struct vm *vm, int vcpu_id, bool create) { struct vcpu *vcpu; - + + KASSERT(vcpu_id >= 0 && vcpu_id < VM_MAXCPU, + ("vcpu_init: invalid vcpu %d", vcpu_id)); + vcpu = &vm->vcpu[vcpu_id]; - vcpu_lock_init(vcpu); - vcpu->hostcpu = NOCPU; - vcpu->vcpuid = vcpu_id; + if (create) { + KASSERT(!vcpu_lock_initialized(vcpu), ("vcpu %d already " + "initialized", vcpu_id)); + vcpu_lock_init(vcpu); + vcpu->state = VCPU_IDLE; + vcpu->hostcpu = NOCPU; + vcpu->guestfpu = fpu_save_area_alloc(); + vcpu->stats = vmm_stat_alloc(); + } + vcpu->vlapic = VLAPIC_INIT(vm->cookie, vcpu_id); vm_set_x2apic_state(vm, vcpu_id, X2APIC_DISABLED); + vcpu->nmi_pending = 0; + vcpu->extint_pending = 0; + vcpu->exception_pending = 0; vcpu->guest_xcr0 = XFEATURE_ENABLED_X87; - vcpu->guestfpu = fpu_save_area_alloc(); fpu_save_area_reset(vcpu->guestfpu); - vcpu->stats = vmm_stat_alloc(); + vmm_stat_init(vcpu->stats); + guest_msrs_init(vm, vcpu_id); } struct vm_exit * @@ -335,10 +353,30 @@ static moduledata_t vmm_kmod = { DECLARE_MODULE(vmm, vmm_kmod, SI_SUB_SMP + 1, SI_ORDER_ANY); MODULE_VERSION(vmm, 1); +static void +vm_init(struct vm *vm, bool create) +{ + int i; + + vm->cookie = VMINIT(vm, vmspace_pmap(vm->vmspace)); + vm->iommu = NULL; + vm->vioapic = vioapic_init(vm); + vm->vhpet = vhpet_init(vm); + vm->vatpic = vatpic_init(vm); + vm->vatpit = vatpit_init(vm); + + CPU_ZERO(&vm->active_cpus); + + vm->suspend = 0; + CPU_ZERO(&vm->suspended_cpus); + + for (i = 0; i < VM_MAXCPU; i++) + vcpu_init(vm, i, create); +} + int vm_create(const char *name, struct vm **retvm) { - int i; struct vm *vm; struct vmspace *vmspace; @@ -358,18 +396,11 @@ vm_create(const char *name, struct vm ** vm = malloc(sizeof(struct vm), M_VM, M_WAITOK | M_ZERO); strcpy(vm->name, name); + vm->num_mem_segs = 0; vm->vmspace = vmspace; mtx_init(&vm->rendezvous_mtx, "vm rendezvous lock", 0, MTX_DEF); - vm->cookie = VMINIT(vm, vmspace_pmap(vmspace)); - vm->vioapic = vioapic_init(vm); - vm->vhpet = vhpet_init(vm); - vm->vatpic = vatpic_init(vm); - vm->vatpit = vatpit_init(vm); - for (i = 0; i < VM_MAXCPU; i++) { - vcpu_init(vm, i); - guest_msrs_init(vm, i); - } + vm_init(vm, true); *retvm = vm; return (0); @@ -385,8 +416,8 @@ vm_free_mem_seg(struct vm *vm, struct me bzero(seg, sizeof(*seg)); } -void -vm_destroy(struct vm *vm) +static void +vm_cleanup(struct vm *vm, bool destroy) { int i; @@ -400,21 +431,48 @@ vm_destroy(struct vm *vm) vatpic_cleanup(vm->vatpic); vioapic_cleanup(vm->vioapic); - for (i = 0; i < vm->num_mem_segs; i++) - vm_free_mem_seg(vm, &vm->mem_segs[i]); + for (i = 0; i < VM_MAXCPU; i++) + vcpu_cleanup(vm, i, destroy); - vm->num_mem_segs = 0; + VMCLEANUP(vm->cookie); - for (i = 0; i < VM_MAXCPU; i++) - vcpu_cleanup(vm, i); + if (destroy) { + for (i = 0; i < vm->num_mem_segs; i++) + vm_free_mem_seg(vm, &vm->mem_segs[i]); - VMSPACE_FREE(vm->vmspace); + vm->num_mem_segs = 0; - VMCLEANUP(vm->cookie); + VMSPACE_FREE(vm->vmspace); + vm->vmspace = NULL; + } +} +void +vm_destroy(struct vm *vm) +{ + vm_cleanup(vm, true); free(vm, M_VM); } +int +vm_reinit(struct vm *vm) +{ + int error; + + /* + * A virtual machine can be reset only if all vcpus are suspended. + */ + if (CPU_CMP(&vm->suspended_cpus, &vm->active_cpus) == 0) { + vm_cleanup(vm, false); + vm_init(vm, false); + error = 0; + } else { + error = EBUSY; + } + + return (error); +} + const char * vm_name(struct vm *vm) { Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Sat Jun 7 19:42:37 2014 (r267215) +++ head/sys/amd64/vmm/vmm_dev.c Sat Jun 7 21:36:52 2014 (r267216) @@ -220,6 +220,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c case VM_BIND_PPTDEV: case VM_UNBIND_PPTDEV: case VM_MAP_MEMORY: + case VM_REINIT: /* * ioctls that operate on the entire virtual machine must * prevent all vcpus from running. @@ -253,6 +254,9 @@ vmmdev_ioctl(struct cdev *cdev, u_long c vmsuspend = (struct vm_suspend *)data; error = vm_suspend(sc->vm, vmsuspend->how); break; + case VM_REINIT: + error = vm_reinit(sc->vm); + break; case VM_STAT_DESC: { statdesc = (struct vm_stat_desc *)data; error = vmm_stat_desc_copy(statdesc->index, Modified: head/sys/amd64/vmm/vmm_stat.c ============================================================================== --- head/sys/amd64/vmm/vmm_stat.c Sat Jun 7 19:42:37 2014 (r267215) +++ head/sys/amd64/vmm/vmm_stat.c Sat Jun 7 21:36:52 2014 (r267216) @@ -52,8 +52,10 @@ static struct vmm_stat_type *vsttab[MAX_ static MALLOC_DEFINE(M_VMM_STAT, "vmm stat", "vmm stat"); +#define vst_size ((size_t)vst_num_elems * sizeof(uint64_t)) + void -vmm_stat_init(void *arg) +vmm_stat_register(void *arg) { struct vmm_stat_type *vst = arg; @@ -97,11 +99,15 @@ vmm_stat_copy(struct vm *vm, int vcpu, i void * vmm_stat_alloc(void) { - u_long size; - - size = vst_num_elems * sizeof(uint64_t); - return (malloc(size, M_VMM_STAT, M_ZERO | M_WAITOK)); + return (malloc(vst_size, M_VMM_STAT, M_WAITOK)); +} + +void +vmm_stat_init(void *vp) +{ + + bzero(vp, vst_size); } void Modified: head/sys/amd64/vmm/vmm_stat.h ============================================================================== --- head/sys/amd64/vmm/vmm_stat.h Sat Jun 7 19:42:37 2014 (r267215) +++ head/sys/amd64/vmm/vmm_stat.h Sat Jun 7 21:36:52 2014 (r267216) @@ -49,13 +49,13 @@ struct vmm_stat_type { enum vmm_stat_scope scope; }; -void vmm_stat_init(void *arg); +void vmm_stat_register(void *arg); #define VMM_STAT_DEFINE(type, nelems, desc, scope) \ struct vmm_stat_type type[1] = { \ { -1, nelems, desc, scope } \ }; \ - SYSINIT(type##_stat, SI_SUB_KLD, SI_ORDER_ANY, vmm_stat_init, type) + SYSINIT(type##_stat, SI_SUB_KLD, SI_ORDER_ANY, vmm_stat_register, type) #define VMM_STAT_DECLARE(type) \ extern struct vmm_stat_type type[1] @@ -71,6 +71,7 @@ void vmm_stat_init(void *arg); VMM_STAT_DEFINE(type, nelems, desc, VMM_STAT_SCOPE_ANY) void *vmm_stat_alloc(void); +void vmm_stat_init(void *vp); void vmm_stat_free(void *vp); /* Modified: head/usr.sbin/bhyveload/bhyveload.c ============================================================================== --- head/usr.sbin/bhyveload/bhyveload.c Sat Jun 7 19:42:37 2014 (r267215) +++ head/usr.sbin/bhyveload/bhyveload.c Sat Jun 7 21:36:52 2014 (r267216) @@ -642,7 +642,7 @@ main(int argc, char** argv) void *h; void (*func)(struct loader_callbacks *, void *, int, int); uint64_t mem_size; - int opt, error; + int opt, error, need_reinit; progname = basename(argv[0]); @@ -691,11 +691,14 @@ main(int argc, char** argv) vmname = argv[0]; + need_reinit = 0; error = vm_create(vmname); - if (error != 0 && errno != EEXIST) { - perror("vm_create"); - exit(1); - + if (error) { + if (errno != EEXIST) { + perror("vm_create"); + exit(1); + } + need_reinit = 1; } ctx = vm_open(vmname); @@ -704,6 +707,14 @@ main(int argc, char** argv) exit(1); } + if (need_reinit) { + error = vm_reinit(ctx); + if (error) { + perror("vm_reinit"); + exit(1); + } + } + error = vm_setup_memory(ctx, mem_size, VM_MMAP_ALL); if (error) { perror("vm_setup_memory"); From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 09:08:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3157A3AB; Sun, 8 Jun 2014 09:08:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E3F2219D; Sun, 8 Jun 2014 09:08:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5898ptX053114; Sun, 8 Jun 2014 09:08:51 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5898pkU053113; Sun, 8 Jun 2014 09:08:51 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201406080908.s5898pkU053113@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 8 Jun 2014 09:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267220 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 09:08:52 -0000 Author: ae Date: Sun Jun 8 09:08:51 2014 New Revision: 267220 URL: http://svnweb.freebsd.org/changeset/base/267220 Log: Remove unused variable. Sponsored by: Yandex LLC Modified: head/sys/netinet6/ip6_forward.c Modified: head/sys/netinet6/ip6_forward.c ============================================================================== --- head/sys/netinet6/ip6_forward.c Sun Jun 8 06:35:08 2014 (r267219) +++ head/sys/netinet6/ip6_forward.c Sun Jun 8 09:08:51 2014 (r267220) @@ -104,7 +104,6 @@ ip6_forward(struct mbuf *m, int srcrt) struct in6_addr src_in6, dst_in6, odst; #ifdef IPSEC struct secpolicy *sp = NULL; - int ipsecrt = 0; #endif #ifdef SCTP int sw_csum; @@ -383,11 +382,7 @@ again2: IP6STAT_INC(ip6s_badscope); goto bad; } - if (inzone != outzone -#ifdef IPSEC - && !ipsecrt -#endif - ) { + if (inzone != outzone) { IP6STAT_INC(ip6s_cantforward); IP6STAT_INC(ip6s_badscope); in6_ifstat_inc(rt->rt_ifp, ifs6_in_discard); @@ -477,9 +472,6 @@ again2: * modified by a redirect. */ if (V_ip6_sendredirects && rt->rt_ifp == m->m_pkthdr.rcvif && !srcrt && -#ifdef IPSEC - !ipsecrt && -#endif /* IPSEC */ (rt->rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) == 0) { if ((rt->rt_ifp->if_flags & IFF_POINTOPOINT) != 0) { /* @@ -656,10 +648,6 @@ pass: bad: m_freem(m); out: - if (rt != NULL -#ifdef IPSEC - && !ipsecrt -#endif - ) + if (rt != NULL) RTFREE(rt); } From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 09:40:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1DECB142; Sun, 8 Jun 2014 09:40:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F26F72421; Sun, 8 Jun 2014 09:40:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s589eQv6067926; Sun, 8 Jun 2014 09:40:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s589eQrB067390; Sun, 8 Jun 2014 09:40:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406080940.s589eQrB067390@svn.freebsd.org> From: Alexander Motin Date: Sun, 8 Jun 2014 09:40:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267221 - in head/sys: nfs rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 09:40:27 -0000 Author: mav Date: Sun Jun 8 09:40:26 2014 New Revision: 267221 URL: http://svnweb.freebsd.org/changeset/base/267221 Log: Introduce new per-thread lock to protect the list of requests. This allows to slightly simplify svc_run_internal() code: if we processed all the requests in a queue, then we know that new one will not appear. MFC after: 2 weeks Modified: head/sys/nfs/nfs_fha.c head/sys/rpc/svc.c head/sys/rpc/svc.h Modified: head/sys/nfs/nfs_fha.c ============================================================================== --- head/sys/nfs/nfs_fha.c Sun Jun 8 09:08:51 2014 (r267220) +++ head/sys/nfs/nfs_fha.c Sun Jun 8 09:40:26 2014 (r267221) @@ -288,11 +288,7 @@ fha_hash_entry_add_op(struct fha_hash_en * Get the service thread currently associated with the fhe that is * appropriate to handle this operation. */ -SVCTHREAD * -fha_hash_entry_choose_thread(struct fha_params *softc, - struct fha_hash_entry *fhe, struct fha_info *i, SVCTHREAD *this_thread); - -SVCTHREAD * +static SVCTHREAD * fha_hash_entry_choose_thread(struct fha_params *softc, struct fha_hash_entry *fhe, struct fha_info *i, SVCTHREAD *this_thread) { @@ -428,13 +424,13 @@ fha_assign(SVCTHREAD *this_thread, struc * Grab the pool lock here to not let chosen thread go away before * the new request inserted to its queue while we drop fhe lock. */ - mtx_lock(&(*softc->pool)->sp_lock); + mtx_lock(&thread->st_lock); mtx_unlock(fhe->mtx); return (thread); thist: req->rq_p1 = NULL; - mtx_lock(&(*softc->pool)->sp_lock); + mtx_lock(&this_thread->st_lock); return (this_thread); } Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Sun Jun 8 09:08:51 2014 (r267220) +++ head/sys/rpc/svc.c Sun Jun 8 09:40:26 2014 (r267221) @@ -1070,7 +1070,6 @@ svc_request_space_available(SVCPOOL *poo static void svc_run_internal(SVCPOOL *pool, bool_t ismaster) { - struct svc_reqlist reqs; SVCTHREAD *st, *stpref; SVCXPRT *xprt; enum xprt_stat stat; @@ -1079,11 +1078,11 @@ svc_run_internal(SVCPOOL *pool, bool_t i int error; st = mem_alloc(sizeof(*st)); + mtx_init(&st->st_lock, "st_lock", NULL, MTX_DEF); st->st_pool = pool; st->st_xprt = NULL; STAILQ_INIT(&st->st_reqs); cv_init(&st->st_cond, "rpcsvc"); - STAILQ_INIT(&reqs); mtx_lock(&pool->sp_lock); LIST_INSERT_HEAD(&pool->sp_threads, st, st_link); @@ -1117,7 +1116,7 @@ svc_run_internal(SVCPOOL *pool, bool_t i } xprt = st->st_xprt; - if (!xprt && STAILQ_EMPTY(&st->st_reqs)) { + if (!xprt) { /* * Enforce maxthreads count. */ @@ -1159,8 +1158,7 @@ svc_run_internal(SVCPOOL *pool, bool_t i if (!ismaster && (pool->sp_threadcount > pool->sp_minthreads) - && !st->st_xprt - && STAILQ_EMPTY(&st->st_reqs)) + && !st->st_xprt) break; } else if (error) { mtx_unlock(&pool->sp_lock); @@ -1170,93 +1168,69 @@ svc_run_internal(SVCPOOL *pool, bool_t i } continue; } + mtx_unlock(&pool->sp_lock); - if (xprt) { - /* - * Drain the transport socket and queue up any - * RPCs. - */ - xprt->xp_lastactive = time_uptime; - do { - if (!svc_request_space_available(pool)) - break; - mtx_unlock(&pool->sp_lock); - rqstp = NULL; - stat = svc_getreq(xprt, &rqstp); - if (rqstp) { - svc_change_space_used(pool, rqstp->rq_size); - /* - * See if the application has - * a preference for some other - * thread. - */ - stpref = st; - if (pool->sp_assign) - stpref = pool->sp_assign(st, - rqstp); - else - mtx_lock(&pool->sp_lock); - - rqstp->rq_thread = stpref; + /* + * Drain the transport socket and queue up any RPCs. + */ + xprt->xp_lastactive = time_uptime; + do { + if (!svc_request_space_available(pool)) + break; + rqstp = NULL; + stat = svc_getreq(xprt, &rqstp); + if (rqstp) { + svc_change_space_used(pool, rqstp->rq_size); + /* + * See if the application has a preference + * for some other thread. + */ + if (pool->sp_assign) { + stpref = pool->sp_assign(st, rqstp); STAILQ_INSERT_TAIL(&stpref->st_reqs, rqstp, rq_link); - - /* - * If we assigned the request - * to another thread, make - * sure its awake and continue - * reading from the - * socket. Otherwise, try to - * find some other thread to - * read from the socket and - * execute the request - * immediately. - */ - if (stpref == st) - break; - if (stpref->st_idle) { - LIST_REMOVE(stpref, st_ilink); - stpref->st_idle = FALSE; - cv_signal(&stpref->st_cond); - } + mtx_unlock(&stpref->st_lock); + rqstp->rq_thread = stpref; + if (stpref != st) + rqstp = NULL; } else - mtx_lock(&pool->sp_lock); - } while (stat == XPRT_MOREREQS - && pool->sp_state != SVCPOOL_CLOSING); - - /* - * Move this transport to the end of the - * active list to ensure fairness when - * multiple transports are active. If this was - * the last queued request, svc_getreq will - * end up calling xprt_inactive to remove from - * the active list. - */ - xprt->xp_thread = NULL; - st->st_xprt = NULL; - if (xprt->xp_active) { - if (!svc_request_space_available(pool) || - !xprt_assignthread(xprt)) - TAILQ_INSERT_TAIL(&pool->sp_active, - xprt, xp_alink); + STAILQ_INSERT_TAIL(&st->st_reqs, + rqstp, rq_link); } - STAILQ_CONCAT(&reqs, &st->st_reqs); - mtx_unlock(&pool->sp_lock); - SVC_RELEASE(xprt); - } else { - STAILQ_CONCAT(&reqs, &st->st_reqs); - mtx_unlock(&pool->sp_lock); + } while (rqstp == NULL && stat == XPRT_MOREREQS + && pool->sp_state != SVCPOOL_CLOSING); + + /* + * Move this transport to the end of the active list to + * ensure fairness when multiple transports are active. + * If this was the last queued request, svc_getreq will end + * up calling xprt_inactive to remove from the active list. + */ + mtx_lock(&pool->sp_lock); + xprt->xp_thread = NULL; + st->st_xprt = NULL; + if (xprt->xp_active) { + if (!svc_request_space_available(pool) || + !xprt_assignthread(xprt)) + TAILQ_INSERT_TAIL(&pool->sp_active, + xprt, xp_alink); } + mtx_unlock(&pool->sp_lock); + SVC_RELEASE(xprt); /* * Execute what we have queued. */ sz = 0; - while ((rqstp = STAILQ_FIRST(&reqs)) != NULL) { - STAILQ_REMOVE_HEAD(&reqs, rq_link); + mtx_lock(&st->st_lock); + while ((rqstp = STAILQ_FIRST(&st->st_reqs)) != NULL) { + STAILQ_REMOVE_HEAD(&st->st_reqs, rq_link); + mtx_unlock(&st->st_lock); sz += rqstp->rq_size; svc_executereq(rqstp); + mtx_lock(&st->st_lock); } + mtx_unlock(&st->st_lock); svc_change_space_used(pool, -sz); mtx_lock(&pool->sp_lock); } @@ -1273,6 +1247,7 @@ svc_run_internal(SVCPOOL *pool, bool_t i mtx_unlock(&pool->sp_lock); + mtx_destroy(&st->st_lock); cv_destroy(&st->st_cond); mem_free(st, sizeof(*st)); Modified: head/sys/rpc/svc.h ============================================================================== --- head/sys/rpc/svc.h Sun Jun 8 09:08:51 2014 (r267220) +++ head/sys/rpc/svc.h Sun Jun 8 09:40:26 2014 (r267221) @@ -291,6 +291,7 @@ STAILQ_HEAD(svc_reqlist, svc_req); * thread to read and execute pending RPCs. */ typedef struct __rpc_svcthread { + struct mtx_padalign st_lock; /* protects st_reqs field */ struct __rpc_svcpool *st_pool; SVCXPRT *st_xprt; /* transport we are processing */ struct svc_reqlist st_reqs; /* RPC requests to execute */ From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 10:18:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72106A32; Sun, 8 Jun 2014 10:18:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F1CB26D0; Sun, 8 Jun 2014 10:18:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s58AINLx084923; Sun, 8 Jun 2014 10:18:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s58AIMaO084916; Sun, 8 Jun 2014 10:18:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406081018.s58AIMaO084916@svn.freebsd.org> From: Alexander Motin Date: Sun, 8 Jun 2014 10:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267223 - head/sys/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 10:18:23 -0000 Author: mav Date: Sun Jun 8 10:18:22 2014 New Revision: 267223 URL: http://svnweb.freebsd.org/changeset/base/267223 Log: Remove st_idle variable, duplicating st_xprt. MFC after: 2 weeks Modified: head/sys/rpc/svc.c head/sys/rpc/svc.h Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Sun Jun 8 09:49:42 2014 (r267222) +++ head/sys/rpc/svc.c Sun Jun 8 10:18:22 2014 (r267223) @@ -340,7 +340,6 @@ xprt_assignthread(SVCXPRT *xprt) st = LIST_FIRST(&pool->sp_idlethreads); if (st) { LIST_REMOVE(st, st_ilink); - st->st_idle = FALSE; SVC_ACQUIRE(xprt); xprt->xp_thread = st; st->st_xprt = xprt; @@ -1138,7 +1137,6 @@ svc_run_internal(SVCPOOL *pool, bool_t i } LIST_INSERT_HEAD(&pool->sp_idlethreads, st, st_ilink); - st->st_idle = TRUE; if (ismaster || (!ismaster && pool->sp_threadcount > pool->sp_minthreads)) error = cv_timedwait_sig(&st->st_cond, @@ -1146,10 +1144,8 @@ svc_run_internal(SVCPOOL *pool, bool_t i else error = cv_wait_sig(&st->st_cond, &pool->sp_lock); - if (st->st_idle) { + if (st->st_xprt == NULL) LIST_REMOVE(st, st_ilink); - st->st_idle = FALSE; - } /* * Reduce worker thread count when idle. Modified: head/sys/rpc/svc.h ============================================================================== --- head/sys/rpc/svc.h Sun Jun 8 09:49:42 2014 (r267222) +++ head/sys/rpc/svc.h Sun Jun 8 10:18:22 2014 (r267223) @@ -295,7 +295,6 @@ typedef struct __rpc_svcthread { struct __rpc_svcpool *st_pool; SVCXPRT *st_xprt; /* transport we are processing */ struct svc_reqlist st_reqs; /* RPC requests to execute */ - int st_idle; /* thread is on idle list */ struct cv st_cond; /* sleeping for work */ LIST_ENTRY(__rpc_svcthread) st_link; /* all threads list */ LIST_ENTRY(__rpc_svcthread) st_ilink; /* idle threads list */ From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 10:55:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85A3D17E; Sun, 8 Jun 2014 10:55:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 724B9295B; Sun, 8 Jun 2014 10:55:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s58At7x4002434; Sun, 8 Jun 2014 10:55:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s58At6gC002430; Sun, 8 Jun 2014 10:55:06 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406081055.s58At6gC002430@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 8 Jun 2014 10:55:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267226 - in head/sys: conf kern modules/ufs ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 10:55:07 -0000 Author: kib Date: Sun Jun 8 10:55:06 2014 New Revision: 267226 URL: http://svnweb.freebsd.org/changeset/base/267226 Log: Initialize the pbuf counter for directio using SYSINIT, instead of using a direct hook called from kern_vfs_bio_buffer_alloc(). Mark ffs_rawread.c as requiring both ffs and directio options to be compiled into the kernel. Add ffs_rawread.c to the list of ufs.ko module' sources. In addition to stopping breaking the layering violation, it also allows to link kernel when FFS is configured as module and DIRECTIO is enabled. One consequence of the change is that ffs_rawread.o is always linked into the module regardless of the DIRECTIO option. This is similar to the option QUOTA and ufs_quota.c. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/conf/files head/sys/kern/vfs_bio.c head/sys/modules/ufs/Makefile head/sys/ufs/ffs/ffs_rawread.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jun 8 10:22:03 2014 (r267225) +++ head/sys/conf/files Sun Jun 8 10:55:06 2014 (r267226) @@ -3883,7 +3883,7 @@ ufs/ffs/ffs_subr.c optional ffs ufs/ffs/ffs_tables.c optional ffs ufs/ffs/ffs_vfsops.c optional ffs ufs/ffs/ffs_vnops.c optional ffs -ufs/ffs/ffs_rawread.c optional directio +ufs/ffs/ffs_rawread.c optional ffs directio ufs/ffs/ffs_suspend.c optional ffs ufs/ufs/ufs_acl.c optional ffs ufs/ufs/ufs_bmap.c optional ffs Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sun Jun 8 10:22:03 2014 (r267225) +++ head/sys/kern/vfs_bio.c Sun Jun 8 10:55:06 2014 (r267226) @@ -77,7 +77,6 @@ __FBSDID("$FreeBSD$"); #include #include #include "opt_compat.h" -#include "opt_directio.h" #include "opt_swap.h" static MALLOC_DEFINE(M_BIOBUF, "biobuf", "BIO buffer"); @@ -382,10 +381,6 @@ sysctl_bufspace(SYSCTL_HANDLER_ARGS) } #endif -#ifdef DIRECTIO -extern void ffs_rawread_setup(void); -#endif /* DIRECTIO */ - /* * bqlock: * @@ -770,9 +765,6 @@ kern_vfs_bio_buffer_alloc(caddr_t v, lon if (nswbuf < NSWBUF_MIN) nswbuf = NSWBUF_MIN; #endif -#ifdef DIRECTIO - ffs_rawread_setup(); -#endif /* * Reserve space for the buffer cache buffers Modified: head/sys/modules/ufs/Makefile ============================================================================== --- head/sys/modules/ufs/Makefile Sun Jun 8 10:22:03 2014 (r267225) +++ head/sys/modules/ufs/Makefile Sun Jun 8 10:55:06 2014 (r267226) @@ -6,9 +6,9 @@ KMOD= ufs SRCS= opt_ddb.h opt_directio.h opt_ffs.h opt_quota.h opt_suiddir.h opt_ufs.h \ vnode_if.h ufs_acl.c ufs_bmap.c ufs_dirhash.c ufs_extattr.c \ ufs_gjournal.c ufs_inode.c ufs_lookup.c ufs_quota.c ufs_vfsops.c \ - ufs_vnops.c ffs_alloc.c ffs_balloc.c ffs_inode.c ffs_snapshot.c \ - ffs_softdep.c ffs_subr.c ffs_suspend.c ffs_tables.c ffs_vfsops.c \ - ffs_vnops.c + ufs_vnops.c ffs_alloc.c ffs_balloc.c ffs_inode.c ffs_rawread.c \ + ffs_snapshot.c ffs_softdep.c ffs_subr.c ffs_suspend.c ffs_tables.c \ + ffs_vfsops.c ffs_vnops.c .if !defined(KERNBUILDDIR) CFLAGS+= -DSOFTUPDATES -DUFS_DIRHASH Modified: head/sys/ufs/ffs/ffs_rawread.c ============================================================================== --- head/sys/ufs/ffs/ffs_rawread.c Sun Jun 8 10:22:03 2014 (r267225) +++ head/sys/ufs/ffs/ffs_rawread.c Sun Jun 8 10:55:06 2014 (r267226) @@ -71,8 +71,6 @@ static int ffs_rawread_sync(struct vnode int ffs_rawread(struct vnode *vp, struct uio *uio, int *workdone); -void ffs_rawread_setup(void); - SYSCTL_DECL(_vfs_ffs); static int ffsrawbufcnt = 4; @@ -87,13 +85,13 @@ static int rawreadahead = 1; SYSCTL_INT(_vfs_ffs, OID_AUTO, rawreadahead, CTLFLAG_RW, &rawreadahead, 0, "Flag to enable readahead for long raw reads"); - -void -ffs_rawread_setup(void) +static void +ffs_rawread_setup(void *arg __unused) { + ffsrawbufcnt = (nswbuf > 100 ) ? (nswbuf - (nswbuf >> 4)) : nswbuf - 8; } - +SYSINIT(ffs_raw, SI_SUB_VM_CONF, SI_ORDER_ANY, ffs_rawread_setup, NULL); static int ffs_rawread_sync(struct vnode *vp) From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 10:56:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2037F2C1; Sun, 8 Jun 2014 10:56:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D8302966; Sun, 8 Jun 2014 10:56:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s58AuP0X002641; Sun, 8 Jun 2014 10:56:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s58AuPPS002640; Sun, 8 Jun 2014 10:56:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406081056.s58AuPPS002640@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 8 Jun 2014 10:56:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267227 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 10:56:26 -0000 Author: kib Date: Sun Jun 8 10:56:25 2014 New Revision: 267227 URL: http://svnweb.freebsd.org/changeset/base/267227 Log: Remove write-only local variable. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Sun Jun 8 10:55:06 2014 (r267226) +++ head/sys/kern/sched_ule.c Sun Jun 8 10:56:25 2014 (r267227) @@ -2686,7 +2686,6 @@ sched_throw(struct thread *td) void sched_fork_exit(struct thread *td) { - struct td_sched *ts; struct tdq *tdq; int cpuid; @@ -2696,7 +2695,6 @@ sched_fork_exit(struct thread *td) */ cpuid = PCPU_GET(cpuid); tdq = TDQ_CPU(cpuid); - ts = td->td_sched; if (TD_IS_IDLETHREAD(td)) td->td_lock = TDQ_LOCKPTR(tdq); MPASS(td->td_lock == TDQ_LOCKPTR(tdq)); From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 11:19:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE6286F5; Sun, 8 Jun 2014 11:19:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAF392B1C; Sun, 8 Jun 2014 11:19:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s58BJWH1012455; Sun, 8 Jun 2014 11:19:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s58BJWup012452; Sun, 8 Jun 2014 11:19:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406081119.s58BJWup012452@svn.freebsd.org> From: Alexander Motin Date: Sun, 8 Jun 2014 11:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267228 - head/sys/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 11:19:33 -0000 Author: mav Date: Sun Jun 8 11:19:32 2014 New Revision: 267228 URL: http://svnweb.freebsd.org/changeset/base/267228 Log: Split RPC pool threads into number of smaller semi-isolated groups. Old design with unified thread pool was good from the point of thread utilization. But single pool-wide mutex became huge congestion point for systems with many CPUs. To reduce the congestion create several thread groups within a pool (one group for every 6 CPUs and 12 threads), each group with own mutex. Each connection during its registration is assigned to one of the groups in round-robin fashion. File affinify code may still move requests between the groups, but otherwise groups are self-contained. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/rpc/svc.c head/sys/rpc/svc.h head/sys/rpc/svc_generic.c Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Sun Jun 8 10:56:25 2014 (r267227) +++ head/sys/rpc/svc.c Sun Jun 8 11:19:32 2014 (r267228) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -70,7 +71,7 @@ __FBSDID("$FreeBSD$"); static struct svc_callout *svc_find(SVCPOOL *pool, rpcprog_t, rpcvers_t, char *); -static void svc_new_thread(SVCPOOL *pool); +static void svc_new_thread(SVCGROUP *grp); static void xprt_unregister_locked(SVCXPRT *xprt); static void svc_change_space_used(SVCPOOL *pool, int delta); static bool_t svc_request_space_available(SVCPOOL *pool); @@ -79,11 +80,14 @@ static bool_t svc_request_space_availabl static int svcpool_minthread_sysctl(SYSCTL_HANDLER_ARGS); static int svcpool_maxthread_sysctl(SYSCTL_HANDLER_ARGS); +static int svcpool_threads_sysctl(SYSCTL_HANDLER_ARGS); SVCPOOL* svcpool_create(const char *name, struct sysctl_oid_list *sysctl_base) { SVCPOOL *pool; + SVCGROUP *grp; + int g; pool = malloc(sizeof(SVCPOOL), M_RPC, M_WAITOK|M_ZERO); @@ -91,15 +95,22 @@ svcpool_create(const char *name, struct pool->sp_name = name; pool->sp_state = SVCPOOL_INIT; pool->sp_proc = NULL; - TAILQ_INIT(&pool->sp_xlist); - TAILQ_INIT(&pool->sp_active); TAILQ_INIT(&pool->sp_callouts); TAILQ_INIT(&pool->sp_lcallouts); - LIST_INIT(&pool->sp_threads); - LIST_INIT(&pool->sp_idlethreads); pool->sp_minthreads = 1; pool->sp_maxthreads = 1; - pool->sp_threadcount = 0; + pool->sp_groupcount = 1; + for (g = 0; g < SVC_MAXGROUPS; g++) { + grp = &pool->sp_groups[g]; + mtx_init(&grp->sg_lock, "sg_lock", NULL, MTX_DEF); + grp->sg_pool = pool; + grp->sg_state = SVCPOOL_ACTIVE; + TAILQ_INIT(&grp->sg_xlist); + TAILQ_INIT(&grp->sg_active); + LIST_INIT(&grp->sg_idlethreads); + grp->sg_minthreads = 1; + grp->sg_maxthreads = 1; + } /* * Don't use more than a quarter of mbuf clusters or more than @@ -114,12 +125,19 @@ svcpool_create(const char *name, struct if (sysctl_base) { SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, "minthreads", CTLTYPE_INT | CTLFLAG_RW, - pool, 0, svcpool_minthread_sysctl, "I", ""); + pool, 0, svcpool_minthread_sysctl, "I", + "Minimal number of threads"); SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, "maxthreads", CTLTYPE_INT | CTLFLAG_RW, - pool, 0, svcpool_maxthread_sysctl, "I", ""); + pool, 0, svcpool_maxthread_sysctl, "I", + "Maximal number of threads"); + SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, + "threads", CTLTYPE_INT | CTLFLAG_RD, + pool, 0, svcpool_threads_sysctl, "I", + "Current number of threads"); SYSCTL_ADD_INT(&pool->sp_sysctl, sysctl_base, OID_AUTO, - "threads", CTLFLAG_RD, &pool->sp_threadcount, 0, ""); + "groups", CTLFLAG_RD, &pool->sp_groupcount, 0, + "Number of thread groups"); SYSCTL_ADD_UINT(&pool->sp_sysctl, sysctl_base, OID_AUTO, "request_space_used", CTLFLAG_RD, @@ -158,20 +176,29 @@ svcpool_create(const char *name, struct void svcpool_destroy(SVCPOOL *pool) { + SVCGROUP *grp; SVCXPRT *xprt, *nxprt; struct svc_callout *s; struct svc_loss_callout *sl; struct svcxprt_list cleanup; + int g; TAILQ_INIT(&cleanup); - mtx_lock(&pool->sp_lock); - while (TAILQ_FIRST(&pool->sp_xlist)) { - xprt = TAILQ_FIRST(&pool->sp_xlist); - xprt_unregister_locked(xprt); - TAILQ_INSERT_TAIL(&cleanup, xprt, xp_link); + for (g = 0; g < SVC_MAXGROUPS; g++) { + grp = &pool->sp_groups[g]; + mtx_lock(&grp->sg_lock); + while ((xprt = TAILQ_FIRST(&grp->sg_xlist)) != NULL) { + xprt_unregister_locked(xprt); + TAILQ_INSERT_TAIL(&cleanup, xprt, xp_link); + } + mtx_unlock(&grp->sg_lock); + } + TAILQ_FOREACH_SAFE(xprt, &cleanup, xp_link, nxprt) { + SVC_RELEASE(xprt); } + mtx_lock(&pool->sp_lock); while ((s = TAILQ_FIRST(&pool->sp_callouts)) != NULL) { mtx_unlock(&pool->sp_lock); svc_unreg(pool, s->sc_prog, s->sc_vers); @@ -184,10 +211,10 @@ svcpool_destroy(SVCPOOL *pool) } mtx_unlock(&pool->sp_lock); - TAILQ_FOREACH_SAFE(xprt, &cleanup, xp_link, nxprt) { - SVC_RELEASE(xprt); + for (g = 0; g < SVC_MAXGROUPS; g++) { + grp = &pool->sp_groups[g]; + mtx_destroy(&grp->sg_lock); } - mtx_destroy(&pool->sp_lock); if (pool->sp_rcache) @@ -197,14 +224,23 @@ svcpool_destroy(SVCPOOL *pool) free(pool, M_RPC); } -static bool_t -svcpool_active(SVCPOOL *pool) +/* + * Sysctl handler to get the present thread count on a pool + */ +static int +svcpool_threads_sysctl(SYSCTL_HANDLER_ARGS) { - enum svcpool_state state = pool->sp_state; + SVCPOOL *pool; + int threads, error, g; - if (state == SVCPOOL_INIT || state == SVCPOOL_CLOSING) - return (FALSE); - return (TRUE); + pool = oidp->oid_arg1; + threads = 0; + mtx_lock(&pool->sp_lock); + for (g = 0; g < pool->sp_groupcount; g++) + threads += pool->sp_groups[g].sg_threadcount; + mtx_unlock(&pool->sp_lock); + error = sysctl_handle_int(oidp, &threads, 0, req); + return (error); } /* @@ -214,7 +250,7 @@ static int svcpool_minthread_sysctl(SYSCTL_HANDLER_ARGS) { SVCPOOL *pool; - int newminthreads, error, n; + int newminthreads, error, g; pool = oidp->oid_arg1; newminthreads = pool->sp_minthreads; @@ -223,21 +259,11 @@ svcpool_minthread_sysctl(SYSCTL_HANDLER_ if (newminthreads > pool->sp_maxthreads) return (EINVAL); mtx_lock(&pool->sp_lock); - if (newminthreads > pool->sp_minthreads - && svcpool_active(pool)) { - /* - * If the pool is running and we are - * increasing, create some more threads now. - */ - n = newminthreads - pool->sp_threadcount; - if (n > 0) { - mtx_unlock(&pool->sp_lock); - while (n--) - svc_new_thread(pool); - mtx_lock(&pool->sp_lock); - } - } pool->sp_minthreads = newminthreads; + for (g = 0; g < pool->sp_groupcount; g++) { + pool->sp_groups[g].sg_minthreads = max(1, + pool->sp_minthreads / pool->sp_groupcount); + } mtx_unlock(&pool->sp_lock); } return (error); @@ -250,8 +276,7 @@ static int svcpool_maxthread_sysctl(SYSCTL_HANDLER_ARGS) { SVCPOOL *pool; - SVCTHREAD *st; - int newmaxthreads, error; + int newmaxthreads, error, g; pool = oidp->oid_arg1; newmaxthreads = pool->sp_maxthreads; @@ -260,17 +285,11 @@ svcpool_maxthread_sysctl(SYSCTL_HANDLER_ if (newmaxthreads < pool->sp_minthreads) return (EINVAL); mtx_lock(&pool->sp_lock); - if (newmaxthreads < pool->sp_maxthreads - && svcpool_active(pool)) { - /* - * If the pool is running and we are - * decreasing, wake up some idle threads to - * encourage them to exit. - */ - LIST_FOREACH(st, &pool->sp_idlethreads, st_ilink) - cv_signal(&st->st_cond); - } pool->sp_maxthreads = newmaxthreads; + for (g = 0; g < pool->sp_groupcount; g++) { + pool->sp_groups[g].sg_maxthreads = max(1, + pool->sp_maxthreads / pool->sp_groupcount); + } mtx_unlock(&pool->sp_lock); } return (error); @@ -283,13 +302,17 @@ void xprt_register(SVCXPRT *xprt) { SVCPOOL *pool = xprt->xp_pool; + SVCGROUP *grp; + int g; SVC_ACQUIRE(xprt); - mtx_lock(&pool->sp_lock); + g = atomic_fetchadd_int(&pool->sp_nextgroup, 1) % pool->sp_groupcount; + xprt->xp_group = grp = &pool->sp_groups[g]; + mtx_lock(&grp->sg_lock); xprt->xp_registered = TRUE; xprt->xp_active = FALSE; - TAILQ_INSERT_TAIL(&pool->sp_xlist, xprt, xp_link); - mtx_unlock(&pool->sp_lock); + TAILQ_INSERT_TAIL(&grp->sg_xlist, xprt, xp_link); + mtx_unlock(&grp->sg_lock); } /* @@ -300,29 +323,29 @@ xprt_register(SVCXPRT *xprt) static void xprt_unregister_locked(SVCXPRT *xprt) { - SVCPOOL *pool = xprt->xp_pool; + SVCGROUP *grp = xprt->xp_group; - mtx_assert(&pool->sp_lock, MA_OWNED); + mtx_assert(&grp->sg_lock, MA_OWNED); KASSERT(xprt->xp_registered == TRUE, ("xprt_unregister_locked: not registered")); xprt_inactive_locked(xprt); - TAILQ_REMOVE(&pool->sp_xlist, xprt, xp_link); + TAILQ_REMOVE(&grp->sg_xlist, xprt, xp_link); xprt->xp_registered = FALSE; } void xprt_unregister(SVCXPRT *xprt) { - SVCPOOL *pool = xprt->xp_pool; + SVCGROUP *grp = xprt->xp_group; - mtx_lock(&pool->sp_lock); + mtx_lock(&grp->sg_lock); if (xprt->xp_registered == FALSE) { /* Already unregistered by another thread */ - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); return; } xprt_unregister_locked(xprt); - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); SVC_RELEASE(xprt); } @@ -333,11 +356,11 @@ xprt_unregister(SVCXPRT *xprt) static int xprt_assignthread(SVCXPRT *xprt) { - SVCPOOL *pool = xprt->xp_pool; + SVCGROUP *grp = xprt->xp_group; SVCTHREAD *st; - mtx_assert(&pool->sp_lock, MA_OWNED); - st = LIST_FIRST(&pool->sp_idlethreads); + mtx_assert(&grp->sg_lock, MA_OWNED); + st = LIST_FIRST(&grp->sg_idlethreads); if (st) { LIST_REMOVE(st, st_ilink); SVC_ACQUIRE(xprt); @@ -354,10 +377,10 @@ xprt_assignthread(SVCXPRT *xprt) * from a socket upcall). Don't create more * than one thread per second. */ - if (pool->sp_state == SVCPOOL_ACTIVE - && pool->sp_lastcreatetime < time_uptime - && pool->sp_threadcount < pool->sp_maxthreads) { - pool->sp_state = SVCPOOL_THREADWANTED; + if (grp->sg_state == SVCPOOL_ACTIVE + && grp->sg_lastcreatetime < time_uptime + && grp->sg_threadcount < grp->sg_maxthreads) { + grp->sg_state = SVCPOOL_THREADWANTED; } } return (FALSE); @@ -366,40 +389,40 @@ xprt_assignthread(SVCXPRT *xprt) void xprt_active(SVCXPRT *xprt) { - SVCPOOL *pool = xprt->xp_pool; + SVCGROUP *grp = xprt->xp_group; - mtx_lock(&pool->sp_lock); + mtx_lock(&grp->sg_lock); if (!xprt->xp_registered) { /* * Race with xprt_unregister - we lose. */ - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); return; } if (!xprt->xp_active) { xprt->xp_active = TRUE; if (xprt->xp_thread == NULL) { - if (!svc_request_space_available(pool) || + if (!svc_request_space_available(xprt->xp_pool) || !xprt_assignthread(xprt)) - TAILQ_INSERT_TAIL(&pool->sp_active, xprt, + TAILQ_INSERT_TAIL(&grp->sg_active, xprt, xp_alink); } } - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); } void xprt_inactive_locked(SVCXPRT *xprt) { - SVCPOOL *pool = xprt->xp_pool; + SVCGROUP *grp = xprt->xp_group; - mtx_assert(&pool->sp_lock, MA_OWNED); + mtx_assert(&grp->sg_lock, MA_OWNED); if (xprt->xp_active) { if (xprt->xp_thread == NULL) - TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); + TAILQ_REMOVE(&grp->sg_active, xprt, xp_alink); xprt->xp_active = FALSE; } } @@ -407,11 +430,11 @@ xprt_inactive_locked(SVCXPRT *xprt) void xprt_inactive(SVCXPRT *xprt) { - SVCPOOL *pool = xprt->xp_pool; + SVCGROUP *grp = xprt->xp_group; - mtx_lock(&pool->sp_lock); + mtx_lock(&grp->sg_lock); xprt_inactive_locked(xprt); - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); } /* @@ -991,14 +1014,14 @@ svc_executereq(struct svc_req *rqstp) } static void -svc_checkidle(SVCPOOL *pool) +svc_checkidle(SVCGROUP *grp) { SVCXPRT *xprt, *nxprt; time_t timo; struct svcxprt_list cleanup; TAILQ_INIT(&cleanup); - TAILQ_FOREACH_SAFE(xprt, &pool->sp_xlist, xp_link, nxprt) { + TAILQ_FOREACH_SAFE(xprt, &grp->sg_xlist, xp_link, nxprt) { /* * Only some transports have idle timers. Don't time * something out which is just waking up. @@ -1013,27 +1036,31 @@ svc_checkidle(SVCPOOL *pool) } } - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); TAILQ_FOREACH_SAFE(xprt, &cleanup, xp_link, nxprt) { SVC_RELEASE(xprt); } - mtx_lock(&pool->sp_lock); - + mtx_lock(&grp->sg_lock); } static void svc_assign_waiting_sockets(SVCPOOL *pool) { + SVCGROUP *grp; SVCXPRT *xprt; + int g; - mtx_lock(&pool->sp_lock); - while ((xprt = TAILQ_FIRST(&pool->sp_active)) != NULL) { - if (xprt_assignthread(xprt)) - TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); - else - break; + for (g = 0; g < pool->sp_groupcount; g++) { + grp = &pool->sp_groups[g]; + mtx_lock(&grp->sg_lock); + while ((xprt = TAILQ_FIRST(&grp->sg_active)) != NULL) { + if (xprt_assignthread(xprt)) + TAILQ_REMOVE(&grp->sg_active, xprt, xp_alink); + else + break; + } + mtx_unlock(&grp->sg_lock); } - mtx_unlock(&pool->sp_lock); } static void @@ -1067,8 +1094,9 @@ svc_request_space_available(SVCPOOL *poo } static void -svc_run_internal(SVCPOOL *pool, bool_t ismaster) +svc_run_internal(SVCGROUP *grp, bool_t ismaster) { + SVCPOOL *pool = grp->sg_pool; SVCTHREAD *st, *stpref; SVCXPRT *xprt; enum xprt_stat stat; @@ -1083,35 +1111,34 @@ svc_run_internal(SVCPOOL *pool, bool_t i STAILQ_INIT(&st->st_reqs); cv_init(&st->st_cond, "rpcsvc"); - mtx_lock(&pool->sp_lock); - LIST_INSERT_HEAD(&pool->sp_threads, st, st_link); + mtx_lock(&grp->sg_lock); /* * If we are a new thread which was spawned to cope with * increased load, set the state back to SVCPOOL_ACTIVE. */ - if (pool->sp_state == SVCPOOL_THREADSTARTING) - pool->sp_state = SVCPOOL_ACTIVE; + if (grp->sg_state == SVCPOOL_THREADSTARTING) + grp->sg_state = SVCPOOL_ACTIVE; - while (pool->sp_state != SVCPOOL_CLOSING) { + while (grp->sg_state != SVCPOOL_CLOSING) { /* * Create new thread if requested. */ - if (pool->sp_state == SVCPOOL_THREADWANTED) { - pool->sp_state = SVCPOOL_THREADSTARTING; - pool->sp_lastcreatetime = time_uptime; - mtx_unlock(&pool->sp_lock); - svc_new_thread(pool); - mtx_lock(&pool->sp_lock); + if (grp->sg_state == SVCPOOL_THREADWANTED) { + grp->sg_state = SVCPOOL_THREADSTARTING; + grp->sg_lastcreatetime = time_uptime; + mtx_unlock(&grp->sg_lock); + svc_new_thread(grp); + mtx_lock(&grp->sg_lock); continue; } /* * Check for idle transports once per second. */ - if (time_uptime > pool->sp_lastidlecheck) { - pool->sp_lastidlecheck = time_uptime; - svc_checkidle(pool); + if (time_uptime > grp->sg_lastidlecheck) { + grp->sg_lastidlecheck = time_uptime; + svc_checkidle(grp); } xprt = st->st_xprt; @@ -1119,7 +1146,7 @@ svc_run_internal(SVCPOOL *pool, bool_t i /* * Enforce maxthreads count. */ - if (pool->sp_threadcount > pool->sp_maxthreads) + if (grp->sg_threadcount > grp->sg_maxthreads) break; /* @@ -1128,22 +1155,22 @@ svc_run_internal(SVCPOOL *pool, bool_t i * by a thread. */ if (svc_request_space_available(pool) && - (xprt = TAILQ_FIRST(&pool->sp_active)) != NULL) { - TAILQ_REMOVE(&pool->sp_active, xprt, xp_alink); + (xprt = TAILQ_FIRST(&grp->sg_active)) != NULL) { + TAILQ_REMOVE(&grp->sg_active, xprt, xp_alink); SVC_ACQUIRE(xprt); xprt->xp_thread = st; st->st_xprt = xprt; continue; } - LIST_INSERT_HEAD(&pool->sp_idlethreads, st, st_ilink); + LIST_INSERT_HEAD(&grp->sg_idlethreads, st, st_ilink); if (ismaster || (!ismaster && - pool->sp_threadcount > pool->sp_minthreads)) + grp->sg_threadcount > grp->sg_minthreads)) error = cv_timedwait_sig(&st->st_cond, - &pool->sp_lock, 5 * hz); + &grp->sg_lock, 5 * hz); else error = cv_wait_sig(&st->st_cond, - &pool->sp_lock); + &grp->sg_lock); if (st->st_xprt == NULL) LIST_REMOVE(st, st_ilink); @@ -1152,19 +1179,19 @@ svc_run_internal(SVCPOOL *pool, bool_t i */ if (error == EWOULDBLOCK) { if (!ismaster - && (pool->sp_threadcount - > pool->sp_minthreads) + && (grp->sg_threadcount + > grp->sg_minthreads) && !st->st_xprt) break; } else if (error) { - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); svc_exit(pool); - mtx_lock(&pool->sp_lock); + mtx_lock(&grp->sg_lock); break; } continue; } - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); /* * Drain the transport socket and queue up any RPCs. @@ -1194,7 +1221,7 @@ svc_run_internal(SVCPOOL *pool, bool_t i rqstp, rq_link); } } while (rqstp == NULL && stat == XPRT_MOREREQS - && pool->sp_state != SVCPOOL_CLOSING); + && grp->sg_state != SVCPOOL_CLOSING); /* * Move this transport to the end of the active list to @@ -1202,16 +1229,16 @@ svc_run_internal(SVCPOOL *pool, bool_t i * If this was the last queued request, svc_getreq will end * up calling xprt_inactive to remove from the active list. */ - mtx_lock(&pool->sp_lock); + mtx_lock(&grp->sg_lock); xprt->xp_thread = NULL; st->st_xprt = NULL; if (xprt->xp_active) { if (!svc_request_space_available(pool) || !xprt_assignthread(xprt)) - TAILQ_INSERT_TAIL(&pool->sp_active, + TAILQ_INSERT_TAIL(&grp->sg_active, xprt, xp_alink); } - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); SVC_RELEASE(xprt); /* @@ -1228,7 +1255,7 @@ svc_run_internal(SVCPOOL *pool, bool_t i } mtx_unlock(&st->st_lock); svc_change_space_used(pool, -sz); - mtx_lock(&pool->sp_lock); + mtx_lock(&grp->sg_lock); } if (st->st_xprt) { @@ -1236,46 +1263,43 @@ svc_run_internal(SVCPOOL *pool, bool_t i st->st_xprt = NULL; SVC_RELEASE(xprt); } - KASSERT(STAILQ_EMPTY(&st->st_reqs), ("stray reqs on exit")); - LIST_REMOVE(st, st_link); - pool->sp_threadcount--; - - mtx_unlock(&pool->sp_lock); - mtx_destroy(&st->st_lock); cv_destroy(&st->st_cond); mem_free(st, sizeof(*st)); + grp->sg_threadcount--; if (!ismaster) - wakeup(pool); + wakeup(grp); + mtx_unlock(&grp->sg_lock); } static void svc_thread_start(void *arg) { - svc_run_internal((SVCPOOL *) arg, FALSE); + svc_run_internal((SVCGROUP *) arg, FALSE); kthread_exit(); } static void -svc_new_thread(SVCPOOL *pool) +svc_new_thread(SVCGROUP *grp) { + SVCPOOL *pool = grp->sg_pool; struct thread *td; - pool->sp_threadcount++; - kthread_add(svc_thread_start, pool, - pool->sp_proc, &td, 0, 0, + grp->sg_threadcount++; + kthread_add(svc_thread_start, grp, pool->sp_proc, &td, 0, 0, "%s: service", pool->sp_name); } void svc_run(SVCPOOL *pool) { - int i; + int g, i; struct proc *p; struct thread *td; + SVCGROUP *grp; p = curproc; td = curthread; @@ -1283,35 +1307,56 @@ svc_run(SVCPOOL *pool) "%s: master", pool->sp_name); pool->sp_state = SVCPOOL_ACTIVE; pool->sp_proc = p; - pool->sp_lastcreatetime = time_uptime; - pool->sp_threadcount = 1; - for (i = 1; i < pool->sp_minthreads; i++) { - svc_new_thread(pool); + /* Choose group count based on number of threads and CPUs. */ + pool->sp_groupcount = max(1, min(SVC_MAXGROUPS, + min(pool->sp_maxthreads / 2, mp_ncpus) / 6)); + for (g = 0; g < pool->sp_groupcount; g++) { + grp = &pool->sp_groups[g]; + grp->sg_minthreads = max(1, + pool->sp_minthreads / pool->sp_groupcount); + grp->sg_maxthreads = max(1, + pool->sp_maxthreads / pool->sp_groupcount); + grp->sg_lastcreatetime = time_uptime; + } + + /* Starting threads */ + for (g = 0; g < pool->sp_groupcount; g++) { + grp = &pool->sp_groups[g]; + for (i = ((g == 0) ? 1 : 0); i < grp->sg_minthreads; i++) + svc_new_thread(grp); + } + pool->sp_groups[0].sg_threadcount++; + svc_run_internal(&pool->sp_groups[0], TRUE); + + /* Waiting for threads to stop. */ + for (g = 0; g < pool->sp_groupcount; g++) { + grp = &pool->sp_groups[g]; + mtx_lock(&grp->sg_lock); + while (grp->sg_threadcount > 0) + msleep(grp, &grp->sg_lock, 0, "svcexit", 0); + mtx_unlock(&grp->sg_lock); } - - svc_run_internal(pool, TRUE); - - mtx_lock(&pool->sp_lock); - while (pool->sp_threadcount > 0) - msleep(pool, &pool->sp_lock, 0, "svcexit", 0); - mtx_unlock(&pool->sp_lock); } void svc_exit(SVCPOOL *pool) { + SVCGROUP *grp; SVCTHREAD *st; + int g; - mtx_lock(&pool->sp_lock); - - if (pool->sp_state != SVCPOOL_CLOSING) { - pool->sp_state = SVCPOOL_CLOSING; - LIST_FOREACH(st, &pool->sp_idlethreads, st_ilink) - cv_signal(&st->st_cond); + pool->sp_state = SVCPOOL_CLOSING; + for (g = 0; g < pool->sp_groupcount; g++) { + grp = &pool->sp_groups[g]; + mtx_lock(&grp->sg_lock); + if (grp->sg_state != SVCPOOL_CLOSING) { + grp->sg_state = SVCPOOL_CLOSING; + LIST_FOREACH(st, &grp->sg_idlethreads, st_ilink) + cv_signal(&st->st_cond); + } + mtx_unlock(&grp->sg_lock); } - - mtx_unlock(&pool->sp_lock); } bool_t Modified: head/sys/rpc/svc.h ============================================================================== --- head/sys/rpc/svc.h Sun Jun 8 10:56:25 2014 (r267227) +++ head/sys/rpc/svc.h Sun Jun 8 11:19:32 2014 (r267228) @@ -137,6 +137,7 @@ struct xp_ops2 { #ifdef _KERNEL struct __rpc_svcpool; +struct __rpc_svcgroup; struct __rpc_svcthread; #endif @@ -150,6 +151,7 @@ typedef struct __rpc_svcxprt { volatile u_int xp_refs; struct sx xp_lock; struct __rpc_svcpool *xp_pool; /* owning pool (see below) */ + struct __rpc_svcgroup *xp_group; /* owning group (see below) */ TAILQ_ENTRY(__rpc_svcxprt) xp_link; TAILQ_ENTRY(__rpc_svcxprt) xp_alink; bool_t xp_registered; /* xprt_register has been called */ @@ -245,8 +247,6 @@ struct svc_loss_callout { }; TAILQ_HEAD(svc_loss_callout_list, svc_loss_callout); -struct __rpc_svcthread; - /* * Service request */ @@ -296,7 +296,6 @@ typedef struct __rpc_svcthread { SVCXPRT *st_xprt; /* transport we are processing */ struct svc_reqlist st_reqs; /* RPC requests to execute */ struct cv st_cond; /* sleeping for work */ - LIST_ENTRY(__rpc_svcthread) st_link; /* all threads list */ LIST_ENTRY(__rpc_svcthread) st_ilink; /* idle threads list */ LIST_ENTRY(__rpc_svcthread) st_alink; /* application thread list */ int st_p2; /* application workspace */ @@ -305,6 +304,36 @@ typedef struct __rpc_svcthread { LIST_HEAD(svcthread_list, __rpc_svcthread); /* + * A thread group contain all information needed to assign subset of + * transports to subset of threads. On systems with many CPUs and many + * threads that allows to reduce lock congestion and improve performance. + * Hundreds of threads on dozens of CPUs sharing the single pool lock do + * not scale well otherwise. + */ +TAILQ_HEAD(svcxprt_list, __rpc_svcxprt); +enum svcpool_state { + SVCPOOL_INIT, /* svc_run not called yet */ + SVCPOOL_ACTIVE, /* normal running state */ + SVCPOOL_THREADWANTED, /* new service thread requested */ + SVCPOOL_THREADSTARTING, /* new service thread started */ + SVCPOOL_CLOSING /* svc_exit called */ +}; +typedef struct __rpc_svcgroup { + struct mtx_padalign sg_lock; /* protect the thread/req lists */ + struct __rpc_svcpool *sg_pool; + enum svcpool_state sg_state; /* current pool state */ + struct svcxprt_list sg_xlist; /* all transports in the group */ + struct svcxprt_list sg_active; /* transports needing service */ + struct svcthread_list sg_idlethreads; /* idle service threads */ + + int sg_minthreads; /* minimum service thread count */ + int sg_maxthreads; /* maximum service thread count */ + int sg_threadcount; /* current service thread count */ + time_t sg_lastcreatetime; /* when we last started a thread */ + time_t sg_lastidlecheck; /* when we last checked idle transports */ +} SVCGROUP; + +/* * In the kernel, we can't use global variables to store lists of * transports etc. since otherwise we could not have two unrelated RPC * services running, each on its own thread. We solve this by @@ -316,32 +345,18 @@ LIST_HEAD(svcthread_list, __rpc_svcthrea * this to support something similar to the Solaris multi-threaded RPC * server. */ -TAILQ_HEAD(svcxprt_list, __rpc_svcxprt); -enum svcpool_state { - SVCPOOL_INIT, /* svc_run not called yet */ - SVCPOOL_ACTIVE, /* normal running state */ - SVCPOOL_THREADWANTED, /* new service thread requested */ - SVCPOOL_THREADSTARTING, /* new service thread started */ - SVCPOOL_CLOSING /* svc_exit called */ -}; typedef SVCTHREAD *pool_assign_fn(SVCTHREAD *, struct svc_req *); typedef void pool_done_fn(SVCTHREAD *, struct svc_req *); +#define SVC_MAXGROUPS 16 typedef struct __rpc_svcpool { struct mtx_padalign sp_lock; /* protect the transport lists */ const char *sp_name; /* pool name (e.g. "nfsd", "NLM" */ enum svcpool_state sp_state; /* current pool state */ struct proc *sp_proc; /* process which is in svc_run */ - struct svcxprt_list sp_xlist; /* all transports in the pool */ - struct svcxprt_list sp_active; /* transports needing service */ struct svc_callout_list sp_callouts; /* (prog,vers)->dispatch list */ struct svc_loss_callout_list sp_lcallouts; /* loss->dispatch list */ - struct svcthread_list sp_threads; /* service threads */ - struct svcthread_list sp_idlethreads; /* idle service threads */ int sp_minthreads; /* minimum service thread count */ int sp_maxthreads; /* maximum service thread count */ - int sp_threadcount; /* current service thread count */ - time_t sp_lastcreatetime; /* when we last started a thread */ - time_t sp_lastidlecheck; /* when we last checked idle transports */ /* * Hooks to allow an application to control request to thread @@ -364,6 +379,10 @@ typedef struct __rpc_svcpool { struct replay_cache *sp_rcache; /* optional replay cache */ struct sysctl_ctx_list sp_sysctl; + + int sp_groupcount; /* Number of groups in the pool. */ + int sp_nextgroup; /* Next group to assign port. */ + SVCGROUP sp_groups[SVC_MAXGROUPS]; /* Thread/port groups. */ } SVCPOOL; #else Modified: head/sys/rpc/svc_generic.c ============================================================================== --- head/sys/rpc/svc_generic.c Sun Jun 8 10:56:25 2014 (r267227) +++ head/sys/rpc/svc_generic.c Sun Jun 8 11:19:32 2014 (r267228) @@ -86,7 +86,8 @@ svc_create( rpcvers_t versnum, /* Version number */ const char *nettype) /* Networktype token */ { - int num = 0; + int g, num = 0; + SVCGROUP *grp; SVCXPRT *xprt; struct netconfig *nconf; void *handle; @@ -96,11 +97,14 @@ svc_create( return (0); } while ((nconf = __rpc_getconf(handle)) != NULL) { - mtx_lock(&pool->sp_lock); - TAILQ_FOREACH(xprt, &pool->sp_xlist, xp_link) { - if (strcmp(xprt->xp_netid, nconf->nc_netid) == 0) { + for (g = 0; g < SVC_MAXGROUPS; g++) { + grp = &pool->sp_groups[g]; + mtx_lock(&grp->sg_lock); + TAILQ_FOREACH(xprt, &grp->sg_xlist, xp_link) { + if (strcmp(xprt->xp_netid, nconf->nc_netid)) + continue; /* Found an old one, use it */ - mtx_unlock(&pool->sp_lock); + mtx_unlock(&grp->sg_lock); (void) rpcb_unset(prognum, versnum, nconf); if (svc_reg(xprt, prognum, versnum, dispatch, nconf) == FALSE) { @@ -108,15 +112,15 @@ svc_create( "svc_create: could not register prog %u vers %u on %s\n", (unsigned)prognum, (unsigned)versnum, nconf->nc_netid); - mtx_lock(&pool->sp_lock); + mtx_lock(&grp->sg_lock); } else { num++; - mtx_lock(&pool->sp_lock); + mtx_lock(&grp->sg_lock); break; } } + mtx_unlock(&grp->sg_lock); } - mtx_unlock(&pool->sp_lock); if (xprt == NULL) { /* It was not found. Now create a new one */ xprt = svc_tp_create(pool, dispatch, prognum, versnum, From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 15:38:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D17C834F; Sun, 8 Jun 2014 15:38:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A512C2FD6; Sun, 8 Jun 2014 15:38:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s58Fceik039085; Sun, 8 Jun 2014 15:38:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s58FceEv039084; Sun, 8 Jun 2014 15:38:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406081538.s58FceEv039084@svn.freebsd.org> From: Alexander Motin Date: Sun, 8 Jun 2014 15:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267232 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 15:38:40 -0000 Author: mav Date: Sun Jun 8 15:38:40 2014 New Revision: 267232 URL: http://svnweb.freebsd.org/changeset/base/267232 Log: Use atomics to modify numvnodes variable. This allows to mostly avoid lock usage in getnewvnode_[drop_]reserve(), that reduces number of global vnode_free_list_mtx mutex acquisitions from 4 to 2 per NFS request on ZFS, improving SMP scalability. Reviewed by: kib MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Jun 8 14:02:25 2014 (r267231) +++ head/sys/kern/vfs_subr.c Sun Jun 8 15:38:40 2014 (r267232) @@ -995,14 +995,25 @@ void getnewvnode_reserve(u_int count) { struct thread *td; + long num; td = curthread; + /* First try to be quick and racy. */ + if (numvnodes + count <= desiredvnodes) { + num = atomic_fetchadd_long(&numvnodes, count); + if (num + count <= desiredvnodes) { + td->td_vp_reserv += count; + return; + } else + atomic_subtract_long(&numvnodes, count); + } + mtx_lock(&vnode_free_list_mtx); while (count > 0) { if (getnewvnode_wait(0) == 0) { count--; td->td_vp_reserv++; - numvnodes++; + atomic_add_long(&numvnodes, 1); } } mtx_unlock(&vnode_free_list_mtx); @@ -1014,10 +1025,7 @@ getnewvnode_drop_reserve(void) struct thread *td; td = curthread; - mtx_lock(&vnode_free_list_mtx); - KASSERT(numvnodes >= td->td_vp_reserv, ("reserve too large")); - numvnodes -= td->td_vp_reserv; - mtx_unlock(&vnode_free_list_mtx); + atomic_subtract_long(&numvnodes, td->td_vp_reserv); td->td_vp_reserv = 0; } @@ -1054,7 +1062,7 @@ getnewvnode(const char *tag, struct moun return (error); } #endif - numvnodes++; + atomic_add_long(&numvnodes, 1); mtx_unlock(&vnode_free_list_mtx); alloc: vp = (struct vnode *) uma_zalloc(vnode_zone, M_WAITOK|M_ZERO); @@ -2385,9 +2393,7 @@ vdropl(struct vnode *vp) * The vnode has been marked for destruction, so free it. */ CTR2(KTR_VFS, "%s: destroying the vnode %p", __func__, vp); - mtx_lock(&vnode_free_list_mtx); - numvnodes--; - mtx_unlock(&vnode_free_list_mtx); + atomic_subtract_long(&numvnodes, 1); bo = &vp->v_bufobj; VNASSERT((vp->v_iflag & VI_FREE) == 0, vp, ("cleaned vnode still on the free list.")); From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 17:29:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B00694E3; Sun, 8 Jun 2014 17:29:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 985FD2838; Sun, 8 Jun 2014 17:29:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s58HTqKS006534; Sun, 8 Jun 2014 17:29:52 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s58HTWkc006213; Sun, 8 Jun 2014 17:29:32 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201406081729.s58HTWkc006213@svn.freebsd.org> From: Bryan Drewery Date: Sun, 8 Jun 2014 17:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267233 - in head: . bin/rmail gnu/usr.bin/binutils/addr2line gnu/usr.bin/binutils/nm gnu/usr.bin/binutils/objcopy gnu/usr.bin/binutils/objdump gnu/usr.bin/binutils/readelf gnu/usr.bin/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 17:29:52 -0000 Author: bdrewery Date: Sun Jun 8 17:29:31 2014 New Revision: 267233 URL: http://svnweb.freebsd.org/changeset/base/267233 Log: In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE. This is currently an opt-in build flag. Once ASLR support is ready and stable it should changed to opt-out and be enabled by default along with ASLR. Each application Makefile uses opt-out to ensure that ASLR will be enabled by default in new directories when the system is compiled with PIE/ASLR. [2] Mark known build failures as NO_PIE for now. The only known runtime failure was rtld. [1] http://www.bsdcan.org/2014/schedule/events/452.en.html Submitted by: Shawn Webb Discussed between: des@ and Shawn Webb [2] Added: head/tools/build/options/WITH_PIE (contents, props changed) Modified: head/Makefile.inc1 head/bin/rmail/Makefile head/gnu/usr.bin/binutils/addr2line/Makefile head/gnu/usr.bin/binutils/nm/Makefile head/gnu/usr.bin/binutils/objcopy/Makefile head/gnu/usr.bin/binutils/objdump/Makefile head/gnu/usr.bin/binutils/readelf/Makefile head/gnu/usr.bin/binutils/size/Makefile head/gnu/usr.bin/binutils/strings/Makefile head/gnu/usr.bin/binutils/strip/Makefile head/gnu/usr.bin/gdb/gdb/Makefile head/gnu/usr.bin/gdb/gdbtui/Makefile head/gnu/usr.bin/gdb/kgdb/Makefile head/gnu/usr.bin/groff/src/devices/grodvi/Makefile head/gnu/usr.bin/groff/src/devices/grohtml/Makefile head/gnu/usr.bin/groff/src/devices/grolbp/Makefile head/gnu/usr.bin/groff/src/devices/grolj4/Makefile head/gnu/usr.bin/groff/src/devices/grops/Makefile head/gnu/usr.bin/groff/src/devices/grotty/Makefile head/gnu/usr.bin/groff/src/preproc/eqn/Makefile head/gnu/usr.bin/groff/src/preproc/grn/Makefile head/gnu/usr.bin/groff/src/preproc/html/Makefile head/gnu/usr.bin/groff/src/preproc/pic/Makefile head/gnu/usr.bin/groff/src/preproc/refer/Makefile head/gnu/usr.bin/groff/src/preproc/soelim/Makefile head/gnu/usr.bin/groff/src/preproc/tbl/Makefile head/gnu/usr.bin/groff/src/roff/groff/Makefile head/gnu/usr.bin/groff/src/roff/troff/Makefile head/gnu/usr.bin/groff/src/utils/addftinfo/Makefile head/gnu/usr.bin/groff/src/utils/hpftodit/Makefile head/gnu/usr.bin/groff/src/utils/indxbib/Makefile head/gnu/usr.bin/groff/src/utils/lkbib/Makefile head/gnu/usr.bin/groff/src/utils/lookbib/Makefile head/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile head/gnu/usr.bin/rcs/Makefile.inc head/gnu/usr.bin/texinfo/info/Makefile head/gnu/usr.bin/texinfo/infokey/Makefile head/gnu/usr.bin/texinfo/install-info/Makefile head/gnu/usr.bin/texinfo/makeinfo/Makefile head/gnu/usr.bin/texinfo/texindex/Makefile head/kerberos5/libexec/digest-service/Makefile head/kerberos5/libexec/hprop/Makefile head/kerberos5/libexec/hpropd/Makefile head/kerberos5/libexec/ipropd-master/Makefile head/kerberos5/libexec/ipropd-slave/Makefile head/kerberos5/libexec/kadmind/Makefile head/kerberos5/libexec/kcm/Makefile head/kerberos5/libexec/kdc/Makefile head/kerberos5/libexec/kdigest/Makefile head/kerberos5/libexec/kfd/Makefile head/kerberos5/libexec/kimpersonate/Makefile head/kerberos5/libexec/kpasswdd/Makefile head/kerberos5/tools/asn1_compile/Makefile head/kerberos5/tools/slc/Makefile head/kerberos5/usr.bin/hxtool/Makefile head/kerberos5/usr.bin/kadmin/Makefile head/kerberos5/usr.bin/kcc/Makefile head/kerberos5/usr.bin/kdestroy/Makefile head/kerberos5/usr.bin/kf/Makefile head/kerberos5/usr.bin/kgetcred/Makefile head/kerberos5/usr.bin/kinit/Makefile head/kerberos5/usr.bin/kpasswd/Makefile head/kerberos5/usr.bin/ksu/Makefile head/kerberos5/usr.bin/string2key/Makefile head/kerberos5/usr.bin/verify_krb5_conf/Makefile head/kerberos5/usr.sbin/iprop-log/Makefile head/kerberos5/usr.sbin/kstash/Makefile head/kerberos5/usr.sbin/ktutil/Makefile head/lib/csu/amd64/Makefile head/lib/csu/i386-elf/Makefile head/libexec/mail.local/Makefile head/libexec/rtld-elf/Makefile head/libexec/smrsh/Makefile head/libexec/telnetd/Makefile head/sbin/fsck/Makefile head/sbin/ipf/ipf/Makefile head/sbin/ipf/ipfstat/Makefile head/sbin/ipf/ipftest/Makefile head/sbin/ipf/ipmon/Makefile head/sbin/ipf/ipnat/Makefile head/sbin/ipf/ippool/Makefile head/sbin/ipf/ipresend/Makefile head/sbin/rcorder/Makefile head/share/mk/bsd.opts.mk head/share/mk/bsd.prog.mk head/sys/boot/i386/boot2/Makefile head/sys/boot/i386/btx/btx/Makefile head/sys/boot/i386/btx/btxldr/Makefile head/sys/boot/i386/btx/lib/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/mips/beri/boot2/Makefile head/sys/boot/mips/beri/loader/Makefile head/sys/boot/pc98/boot2/Makefile head/sys/boot/pc98/btx/lib/Makefile head/sys/boot/pc98/loader/Makefile head/sys/boot/sparc64/boot1/Makefile head/sys/boot/sparc64/loader/Makefile head/usr.bin/clang/clang-tblgen/Makefile head/usr.bin/clang/clang.prog.mk head/usr.bin/clang/tblgen/Makefile head/usr.bin/compile_et/Makefile head/usr.bin/mandoc/Makefile head/usr.bin/svn/svn/Makefile head/usr.bin/svn/svnadmin/Makefile head/usr.bin/svn/svndumpfilter/Makefile head/usr.bin/svn/svnlook/Makefile head/usr.bin/svn/svnmucc/Makefile head/usr.bin/svn/svnrdump/Makefile head/usr.bin/svn/svnserve/Makefile head/usr.bin/svn/svnsync/Makefile head/usr.bin/svn/svnversion/Makefile head/usr.bin/telnet/Makefile head/usr.bin/vacation/Makefile head/usr.sbin/amd/amd/Makefile head/usr.sbin/amd/amq/Makefile head/usr.sbin/amd/fixmount/Makefile head/usr.sbin/amd/fsinfo/Makefile head/usr.sbin/amd/hlfsd/Makefile head/usr.sbin/amd/mk-amd-map/Makefile head/usr.sbin/amd/pawd/Makefile head/usr.sbin/amd/wire-test/Makefile head/usr.sbin/btxld/Makefile head/usr.sbin/cron/cron/Makefile head/usr.sbin/cron/crontab/Makefile head/usr.sbin/crunch/crunchgen/Makefile head/usr.sbin/crunch/crunchide/Makefile head/usr.sbin/editmap/Makefile head/usr.sbin/fifolog/fifolog_create/Makefile head/usr.sbin/fifolog/fifolog_reader/Makefile head/usr.sbin/fifolog/fifolog_writer/Makefile head/usr.sbin/ftp-proxy/ftp-proxy/Makefile head/usr.sbin/lpr/chkprintcap/Makefile head/usr.sbin/lpr/lpc/Makefile head/usr.sbin/lpr/lpd/Makefile head/usr.sbin/lpr/lpq/Makefile head/usr.sbin/lpr/lpr/Makefile head/usr.sbin/lpr/lprm/Makefile head/usr.sbin/lpr/pac/Makefile head/usr.sbin/mailstats/Makefile head/usr.sbin/makefs/Makefile head/usr.sbin/makemap/Makefile head/usr.sbin/nmtree/Makefile head/usr.sbin/ntp/ntp-keygen/Makefile head/usr.sbin/ntp/ntpd/Makefile head/usr.sbin/ntp/ntpdate/Makefile head/usr.sbin/ntp/ntpdc/Makefile head/usr.sbin/ntp/ntpq/Makefile head/usr.sbin/ntp/ntptime/Makefile head/usr.sbin/praliases/Makefile head/usr.sbin/sendmail/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Jun 8 15:38:40 2014 (r267232) +++ head/Makefile.inc1 Sun Jun 8 17:29:31 2014 (r267233) @@ -245,7 +245,7 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ DESTDIR= \ BOOTSTRAPPING=${OSRELDATE} \ - SSP_CFLAGS= \ + SSP_CFLAGS= MK_PIE=no \ MK_HTML=no MK_INFO=no NO_LINT=yes MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ @@ -257,7 +257,7 @@ TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ DESTDIR= \ BOOTSTRAPPING=${OSRELDATE} \ - SSP_CFLAGS= \ + SSP_CFLAGS= MK_PIE=no \ -DNO_LINT \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no MK_CLANG_FULL=no MK_LLDB=no MK_TESTS=no @@ -275,7 +275,7 @@ KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOB ${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \ DESTDIR= \ BOOTSTRAPPING=${OSRELDATE} \ - SSP_CFLAGS= \ + SSP_CFLAGS= MK_PIE=no \ MK_HTML=no MK_INFO=no -DNO_LINT MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no Modified: head/bin/rmail/Makefile ============================================================================== --- head/bin/rmail/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/bin/rmail/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -14,6 +14,8 @@ MAN= rmail.8 WARNS?= 2 CFLAGS+=-I${SENDMAIL_DIR}/include -I. +NO_PIE= yes + LIBSMDIR= ${.OBJDIR}/../../lib/libsm LIBSM= ${LIBSMDIR}/libsm.a Modified: head/gnu/usr.bin/binutils/addr2line/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/addr2line/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/binutils/addr2line/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -14,4 +14,6 @@ DPADD+= ${RELTOP}/libbfd/libbfd.a DPADD+= ${RELTOP}/libiberty/libiberty.a LDADD= ${DPADD} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/binutils/nm/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/nm/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/binutils/nm/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -15,4 +15,6 @@ DPADD+= ${RELTOP}/libbfd/libbfd.a DPADD+= ${RELTOP}/libiberty/libiberty.a LDADD= ${DPADD} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/binutils/objcopy/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/objcopy/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/binutils/objcopy/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -14,4 +14,6 @@ DPADD+= ${RELTOP}/libbfd/libbfd.a DPADD+= ${RELTOP}/libiberty/libiberty.a LDADD= ${DPADD} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/binutils/objdump/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/objdump/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/binutils/objdump/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -16,4 +16,6 @@ DPADD+= ${RELTOP}/libbfd/libbfd.a DPADD+= ${RELTOP}/libiberty/libiberty.a LDADD= ${DPADD} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/binutils/readelf/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/readelf/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/binutils/readelf/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -17,4 +17,6 @@ DPADD+= ${RELTOP}/libbfd/libbfd.a DPADD+= ${RELTOP}/libiberty/libiberty.a LDADD= ${DPADD} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/binutils/size/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/size/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/binutils/size/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -14,4 +14,6 @@ DPADD+= ${RELTOP}/libbfd/libbfd.a DPADD+= ${RELTOP}/libiberty/libiberty.a LDADD= ${DPADD} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/binutils/strings/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/strings/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/binutils/strings/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -14,4 +14,6 @@ DPADD+= ${RELTOP}/libbfd/libbfd.a DPADD+= ${RELTOP}/libiberty/libiberty.a LDADD= ${DPADD} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/binutils/strip/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/strip/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/binutils/strip/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -15,4 +15,6 @@ DPADD+= ${RELTOP}/libiberty/libiberty.a LDADD= ${DPADD} INSTALLFLAGS= -S +NO_PIE= yes + .include Modified: head/gnu/usr.bin/gdb/gdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/gdb/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/gdb/gdb/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -14,5 +14,7 @@ LDFLAGS+= -Wl,-E DPADD= ${GDBLIBS} ${BULIBS} ${LIBM} ${LIBREADLINE} ${LIBTERMCAP} ${LIBGNUREGEX} LDADD= ${GDBLIBS} ${BULIBS} -lm -lreadline -ltermcap -lgnuregex +NO_PIE= yes + .include CFLAGS+= -DDEBUGDIR=\"${DEBUGDIR}\" Modified: head/gnu/usr.bin/gdb/gdbtui/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/gdbtui/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/gdb/gdbtui/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -15,4 +15,6 @@ LDFLAGS+= -Wl,-E DPADD= ${GDBLIBS} ${BULIBS} ${LIBM} ${LIBREADLINE} ${LIBTERMCAP} ${LIBGNUREGEX} LDADD= ${GDBLIBS} ${BULIBS} -lm -lreadline -ltermcap -lgnuregex +NO_PIE= yes + .include Modified: head/gnu/usr.bin/gdb/kgdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/gdb/kgdb/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -17,4 +17,6 @@ LDADD= ${GDBLIBS} ${BULIBS} -lkvm${GDB_S CFLAGS+= -Wl,-export-dynamic .endif +NO_PIE= yes + .include Modified: head/gnu/usr.bin/groff/src/devices/grodvi/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/devices/grodvi/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/devices/grodvi/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -6,4 +6,6 @@ DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM} LDADD= ${LIBDRIVER} ${LIBGROFF} -lm CLEANFILES= ${MAN} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/groff/src/devices/grohtml/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/devices/grohtml/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/devices/grohtml/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -6,4 +6,6 @@ DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM} LDADD= ${LIBDRIVER} ${LIBGROFF} -lm MAN= +NO_PIE= yes + .include Modified: head/gnu/usr.bin/groff/src/devices/grolbp/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/devices/grolbp/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/devices/grolbp/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -6,4 +6,6 @@ DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM} LDADD= ${LIBDRIVER} ${LIBGROFF} -lm CLEANFILES= ${MAN} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/groff/src/devices/grolj4/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/devices/grolj4/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/devices/grolj4/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -7,4 +7,6 @@ DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM} LDADD= ${LIBDRIVER} ${LIBGROFF} -lm CLEANFILES= ${MAN} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/groff/src/devices/grops/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/devices/grops/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/devices/grops/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -6,4 +6,6 @@ DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM} LDADD= ${LIBDRIVER} ${LIBGROFF} -lm CLEANFILES= ${MAN} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/groff/src/devices/grotty/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/devices/grotty/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/devices/grotty/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -6,4 +6,6 @@ DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM} LDADD= ${LIBDRIVER} ${LIBGROFF} -lm CLEANFILES= ${MAN} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/groff/src/preproc/eqn/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/preproc/eqn/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/preproc/eqn/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -11,6 +11,8 @@ SCRIPTS= neqn MAN= eqn.1 neqn.1 CLEANFILES= eqn.cpp eqn_tab.h ${SCRIPTS} ${MAN} y.tab.c y.tab.h +NO_PIE= yes + eqn_tab.h: eqn.cpp .include Modified: head/gnu/usr.bin/groff/src/preproc/grn/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/preproc/grn/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/preproc/grn/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -6,4 +6,6 @@ DPADD= ${LIBGROFF} ${LIBM} LDADD= ${LIBGROFF} -lm CLEANFILES= ${MAN} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/groff/src/preproc/html/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/preproc/html/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/preproc/html/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -6,4 +6,6 @@ DPADD= ${LIBGROFF} LDADD= ${LIBGROFF} MAN= +NO_PIE= yes + .include Modified: head/gnu/usr.bin/groff/src/preproc/pic/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/preproc/pic/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/preproc/pic/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -8,6 +8,8 @@ DPADD= ${LIBGROFF} ${LIBM} LDADD= ${LIBGROFF} -lm CLEANFILES= ${MAN} pic.cpp pic_tab.h y.tab.c y.tab.h +NO_PIE= yes + pic_tab.h: pic.cpp .include Modified: head/gnu/usr.bin/groff/src/preproc/refer/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/preproc/refer/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/preproc/refer/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -7,4 +7,6 @@ DPADD= ${LIBBIB} ${LIBGROFF} ${LIBM} LDADD= ${LIBBIB} ${LIBGROFF} -lm CLEANFILES= label.cpp label_tab.h ${MAN} y.tab.c y.tab.h +NO_PIE= yes + .include Modified: head/gnu/usr.bin/groff/src/preproc/soelim/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/preproc/soelim/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/preproc/soelim/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -6,4 +6,6 @@ DPADD= ${LIBGROFF} LDADD= ${LIBGROFF} CLEANFILES= ${MAN} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/groff/src/preproc/tbl/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/preproc/tbl/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/preproc/tbl/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -6,4 +6,6 @@ DPADD= ${LIBGROFF} ${LIBM} LDADD= ${LIBGROFF} -lm CLEANFILES= ${MAN} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/groff/src/roff/groff/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/roff/groff/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/roff/groff/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -6,4 +6,6 @@ DPADD= ${LIBGROFF} ${LIBM} LDADD= ${LIBGROFF} -lm CLEANFILES= ${MAN} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/groff/src/roff/troff/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/roff/troff/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/roff/troff/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -7,6 +7,8 @@ DPADD= ${LIBGROFF} ${LIBM} LDADD= ${LIBGROFF} -lm CLEANFILES= majorminor.cpp ${MAN} +NO_PIE= yes + .include majorminor.cpp: ${GROFF_DIST}/VERSION ${GROFF_DIST}/REVISION Modified: head/gnu/usr.bin/groff/src/utils/addftinfo/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/utils/addftinfo/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/utils/addftinfo/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -6,4 +6,6 @@ DPADD= ${LIBGROFF} LDADD= ${LIBGROFF} CLEANFILES= ${MAN} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/groff/src/utils/hpftodit/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/utils/hpftodit/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/utils/hpftodit/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -6,4 +6,6 @@ DPADD= ${LIBGROFF} ${LIBM} LDADD= ${LIBGROFF} -lm CLEANFILES= ${MAN} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/groff/src/utils/indxbib/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/utils/indxbib/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/utils/indxbib/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -6,6 +6,8 @@ DPADD= ${LIBBIB} ${LIBGROFF} ${LIBM} LDADD= ${LIBBIB} ${LIBGROFF} -lm CLEANFILES= ${MAN} +NO_PIE= yes + beforeinstall: ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ ${DIST_DIR}/eign ${DESTDIR}${SHAREDIR}/dict/ Modified: head/gnu/usr.bin/groff/src/utils/lkbib/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/utils/lkbib/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/utils/lkbib/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -6,4 +6,6 @@ DPADD= ${LIBBIB} ${LIBGROFF} ${LIBM} LDADD= ${LIBBIB} ${LIBGROFF} -lm CLEANFILES= ${MAN} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/groff/src/utils/lookbib/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/utils/lookbib/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/utils/lookbib/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -6,4 +6,6 @@ DPADD= ${LIBBIB} ${LIBGROFF} ${LIBM} LDADD= ${LIBBIB} ${LIBGROFF} -lm CLEANFILES= ${MAN} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile ============================================================================== --- head/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -6,4 +6,6 @@ DPADD= ${LIBGROFF} ${LIBM} LDADD= ${LIBGROFF} -lm CLEANFILES= ${MAN} +NO_PIE= yes + .include Modified: head/gnu/usr.bin/rcs/Makefile.inc ============================================================================== --- head/gnu/usr.bin/rcs/Makefile.inc Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/rcs/Makefile.inc Sun Jun 8 17:29:31 2014 (r267233) @@ -1,3 +1,4 @@ # $FreeBSD$ LIBRCS= ${.OBJDIR}/../lib/librcs.a +NO_PIE= yes Modified: head/gnu/usr.bin/texinfo/info/Makefile ============================================================================== --- head/gnu/usr.bin/texinfo/info/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/texinfo/info/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -13,6 +13,8 @@ CFLAGS+= -DINFODIR=\"${INFODIR}:/usr/loc DPADD= ${LIBTERMCAP} ${LIBTXI} LDADD= -ltermcap ${LIBTXI} +NO_PIE= yes + .include .PATH: ${TXIDIR}/info ${TXIDIR}/doc Modified: head/gnu/usr.bin/texinfo/infokey/Makefile ============================================================================== --- head/gnu/usr.bin/texinfo/infokey/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/texinfo/infokey/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -6,6 +6,8 @@ SRCS= infokey.c key.c DPADD= ${LIBTXI} LDADD= ${LIBTXI} +NO_PIE= yes + .include .PATH: ${TXIDIR}/info ${TXIDIR}/doc Modified: head/gnu/usr.bin/texinfo/install-info/Makefile ============================================================================== --- head/gnu/usr.bin/texinfo/install-info/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/texinfo/install-info/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -5,6 +5,8 @@ PROG= install-info DPADD= ${LIBTXI} LDADD= ${LIBTXI} +NO_PIE= yes + .include .PATH: ${TXIDIR}/util ${TXIDIR}/doc Modified: head/gnu/usr.bin/texinfo/makeinfo/Makefile ============================================================================== --- head/gnu/usr.bin/texinfo/makeinfo/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/texinfo/makeinfo/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -8,6 +8,8 @@ SRCS= cmds.c defun.c files.c float.c foo DPADD= ${LIBTXI} LDADD= ${LIBTXI} +NO_PIE= yes + .include .PATH: $(TXIDIR)/makeinfo $(TXIDIR)/doc Modified: head/gnu/usr.bin/texinfo/texindex/Makefile ============================================================================== --- head/gnu/usr.bin/texinfo/texindex/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/gnu/usr.bin/texinfo/texindex/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -5,6 +5,8 @@ PROG= texindex DPADD= ${LIBTXI} LDADD= ${LIBTXI} +NO_PIE= yes + .include .PATH: ${TXIDIR}/util ${TXIDIR}/doc Modified: head/kerberos5/libexec/digest-service/Makefile ============================================================================== --- head/kerberos5/libexec/digest-service/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/libexec/digest-service/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -14,6 +14,8 @@ LDADD= -lhdb -lkdc -lheimipcs -lkrb5 -lr ${LIBVERS} -lheimntlm USEPRIVATELIB= heimipcs +NO_PIE= yes + .include .PATH: ${KRB5DIR}/kdc Modified: head/kerberos5/libexec/hprop/Makefile ============================================================================== --- head/kerberos5/libexec/hprop/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/libexec/hprop/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -16,6 +16,8 @@ LDADD= -lhdb -lkrb5 -lhx509 -lroken ${LI -lasn1 -lcrypto -lcrypt -lcom_err ${LDAPLDADD} LDFLAGS=${LDAPLDFLAGS} +NO_PIE= yes + .include .PATH: ${KRB5DIR}/kdc Modified: head/kerberos5/libexec/hpropd/Makefile ============================================================================== --- head/kerberos5/libexec/hpropd/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/libexec/hpropd/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -10,6 +10,8 @@ LDADD= -lhdb -lkrb5 -lhx509 -lroken ${LI -lasn1 -lcrypto -lcrypt -lcom_err ${LDAPLDADD} LDFLAGS=${LDAPLDFLAGS} +NO_PIE= yes + .include .PATH: ${KRB5DIR}/kdc Modified: head/kerberos5/libexec/ipropd-master/Makefile ============================================================================== --- head/kerberos5/libexec/ipropd-master/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/libexec/ipropd-master/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -11,6 +11,8 @@ LDADD= -lkadm5srv -lhdb -lkrb5 -lhx509 - -lasn1 -lcrypto -lcrypt -lcom_err ${LDAPLDADD} LDFLAGS=${LDAPLDFLAGS} +NO_PIE= yes + foo:: echo ${LIBHX509} Modified: head/kerberos5/libexec/ipropd-slave/Makefile ============================================================================== --- head/kerberos5/libexec/ipropd-slave/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/libexec/ipropd-slave/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -11,6 +11,8 @@ LDADD= -lkadm5srv -lhdb -lkrb5 -lhx509 - -lasn1 -lcrypto -lcrypt -lcom_err ${LDAPLDADD} LDFLAGS=${LDAPLDFLAGS} +NO_PIE= yes + .include .PATH: ${KRB5DIR}/lib/kadm5 Modified: head/kerberos5/libexec/kadmind/Makefile ============================================================================== --- head/kerberos5/libexec/kadmind/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/libexec/kadmind/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -15,6 +15,8 @@ LDADD= -lkadm5srv -lgssapi -lhdb -lkrb5 -lasn1 ${LIBVERS} -lcrypto -lcrypt ${LDAPLDADD} LDFLAGS=${LDAPLDFLAGS} +NO_PIE= yes + .include .PATH: ${KRB5DIR}/kadmin Modified: head/kerberos5/libexec/kcm/Makefile ============================================================================== --- head/kerberos5/libexec/kcm/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/libexec/kcm/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -26,6 +26,8 @@ LDADD= -lhdb -lkrb5 -lroken -lasn1 -lhei USEPRIVATELIB= heimipcs LDFLAGS=${LDAPLDFLAGS} +NO_PIE= yes + .include .PATH: ${KRB5DIR}/kcm Modified: head/kerberos5/libexec/kdc/Makefile ============================================================================== --- head/kerberos5/libexec/kdc/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/libexec/kdc/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -14,6 +14,8 @@ DPADD= ${LIBKDC} ${LIBHDB} ${LIBKRB5} ${ ${LIBCRYPTO} ${LIBCRYPT} ${LIBVERS} LDADD= -lkdc -lhdb -lkrb5 -lroken -lasn1 -lcrypto -lcrypt ${LIBVERS} +NO_PIE= yes + .include .PATH: ${KRB5DIR}/kdc Modified: head/kerberos5/libexec/kdigest/Makefile ============================================================================== --- head/kerberos5/libexec/kdigest/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/libexec/kdigest/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -13,6 +13,8 @@ SRCS= kdigest.c \ kdigest-commands.c \ kdigest-commands.h +NO_PIE= yes + kdigest-commands.h: kdigest-commands.in ${SLC} ${.ALLSRC:M*.in} Modified: head/kerberos5/libexec/kfd/Makefile ============================================================================== --- head/kerberos5/libexec/kfd/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/libexec/kfd/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -9,6 +9,8 @@ DPADD= ${LIBKRB5} ${LIBROKEN} ${LIBASN1} LDADD= -lkrb5 -lroken -lasn1 -lcrypto -lcrypt \ ${LIBVERS} +NO_PIE= yes + .include .PATH: ${KRB5DIR}/appl/kf Modified: head/kerberos5/libexec/kimpersonate/Makefile ============================================================================== --- head/kerberos5/libexec/kimpersonate/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/libexec/kimpersonate/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -11,6 +11,8 @@ DPADD= ${LIBKAFS5} ${LIBKRB5} ${LIBHEIMN LDADD= -lkafs5 -lkrb5 -lheimntlm -lroken -lasn1 -lcrypto -lcrypt \ ${LIBVERS} +NO_PIE= yes + .include .PATH: ${KRB5DIR}/kuser Modified: head/kerberos5/libexec/kpasswdd/Makefile ============================================================================== --- head/kerberos5/libexec/kpasswdd/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/libexec/kpasswdd/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -9,6 +9,8 @@ LDADD= -lkadm5srv -lhdb -lkrb5 -lhx509 - -lasn1 -lcrypto -lcrypt -lcom_err ${LDAPLDADD} LDFLAGS=${LDAPLDFLAGS} +NO_PIE= yes + .include .PATH: ${KRB5DIR}/kpasswd Modified: head/kerberos5/tools/asn1_compile/Makefile ============================================================================== --- head/kerberos5/tools/asn1_compile/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/tools/asn1_compile/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -27,6 +27,8 @@ CFLAGS+=-I${KRB5DIR}/lib/roken -I${KRB5D CLEANFILES= roken.h lex.c parse.c +NO_PIE= yes + roken.h: make-roken > ${.TARGET} Modified: head/kerberos5/tools/slc/Makefile ============================================================================== --- head/kerberos5/tools/slc/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/tools/slc/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -14,6 +14,8 @@ CFLAGS+=-I${KRB5DIR}/lib/roken -I${KRB5D CLEANFILES= roken.h slc-gram.c slc-lex.c +NO_PIE= yes + roken.h: ${MAKE_ROKEN} > ${.TARGET} Modified: head/kerberos5/usr.bin/hxtool/Makefile ============================================================================== --- head/kerberos5/usr.bin/hxtool/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/usr.bin/hxtool/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -10,6 +10,8 @@ DPADD= ${LIBHX509} ${LIBROKEN} ${LIBASN1 LDADD= -lhx509 -lroken -lasn1 -lcrypto -lcrypt ${LIBSL} ${LIBVERS} -ledit SRCS= hxtool.c hxtool-commands.c hxtool-commands.h +NO_PIE= yes + hxtool-commands.h: hxtool-commands.in ${SLC} ${.ALLSRC:M*.in} Modified: head/kerberos5/usr.bin/kadmin/Makefile ============================================================================== --- head/kerberos5/usr.bin/kadmin/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/usr.bin/kadmin/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -36,6 +36,8 @@ LDADD= -lkadm5clnt -lkadm5srv -lhdb -lkr -ledit -lncurses ${LDAPLDADD} LDFLAGS=${LDAPLDFLAGS} +NO_PIE= yes + .include kadmin-commands.h: ${KRB5DIR}/kadmin/kadmin-commands.in Modified: head/kerberos5/usr.bin/kcc/Makefile ============================================================================== --- head/kerberos5/usr.bin/kcc/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/usr.bin/kcc/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -19,6 +19,8 @@ SRCS= kcc.c \ kswitch.c \ copy_cred_cache.c +NO_PIE= yes + kcc-commands.h: kcc-commands.in ${SLC} ${.ALLSRC:M*.in} Modified: head/kerberos5/usr.bin/kdestroy/Makefile ============================================================================== --- head/kerberos5/usr.bin/kdestroy/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/usr.bin/kdestroy/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -8,6 +8,8 @@ LDADD= -lkafs5 -lkrb5 -lheimntlm -lroken -lasn1 -lcrypto -lcrypt MAN= kdestroy.1 +NO_PIE= yes + .include .PATH: ${KRB5DIR}/kuser Modified: head/kerberos5/usr.bin/kf/Makefile ============================================================================== --- head/kerberos5/usr.bin/kf/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/usr.bin/kf/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -9,6 +9,8 @@ DPADD= ${LIBKRB5} ${LIBROKEN} ${LIBASN1} LDADD= -lkrb5 -lroken -lasn1 -lcrypto -lcrypt \ ${LIBVERS} +NO_PIE= yes + .include .PATH: ${KRB5DIR}/appl/kf Modified: head/kerberos5/usr.bin/kgetcred/Makefile ============================================================================== --- head/kerberos5/usr.bin/kgetcred/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/usr.bin/kgetcred/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -6,6 +6,8 @@ CFLAGS+= -I${KRB5DIR}/lib/asn1 \ DPADD= ${LIBKRB5} ${LIBROKEN} ${LIBASN1} ${LIBCRYPTO} ${LIBCRYPT} ${LIBVERS} LDADD= -lkrb5 -lroken -lasn1 -lcrypto -lcrypt ${LIBVERS} +NO_PIE= yes + .include .PATH: ${KRB5DIR}/kuser Modified: head/kerberos5/usr.bin/kinit/Makefile ============================================================================== --- head/kerberos5/usr.bin/kinit/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/usr.bin/kinit/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -7,6 +7,8 @@ DPADD= ${LIBKAFS5} ${LIBKRB5} ${LIBHEIMN LDADD= -lkafs5 -lkrb5 -lheimntlm -lroken ${LIBVERS} \ -lasn1 -lcrypto -lcrypt -lcom_err +NO_PIE= yes + .include .PATH: ${KRB5DIR}/kuser Modified: head/kerberos5/usr.bin/kpasswd/Makefile ============================================================================== --- head/kerberos5/usr.bin/kpasswd/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/usr.bin/kpasswd/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -7,6 +7,8 @@ DPADD= ${LIBKRB5} ${LIBHX509} ${LIBROKEN LDADD= -lkrb5 -lhx509 -lroken ${LIBVERS} \ -lasn1 -lcrypto -lcrypt -lcom_err +NO_PIE= yes + .include .PATH: ${KRB5DIR}/kpasswd Modified: head/kerberos5/usr.bin/ksu/Makefile ============================================================================== --- head/kerberos5/usr.bin/ksu/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/usr.bin/ksu/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -13,6 +13,8 @@ DPADD= ${LIBKAFS5} ${LIBKRB5} ${LIBHX509 LDADD= -lkafs5 -lkrb5 -lhx509 -lroken ${LIBVERS} \ -lasn1 -lcrypto -lcrypt -lcom_err +NO_PIE= yes + .include .PATH: ${KRB5DIR}/appl/su Modified: head/kerberos5/usr.bin/string2key/Makefile ============================================================================== --- head/kerberos5/usr.bin/string2key/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/usr.bin/string2key/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -11,6 +11,8 @@ DPADD= ${LIBHDB} ${LIBKRB5} ${LIBROKEN} ${LIBCRYPT} ${LIBVERS} LDADD= -lhdb -lkrb5 -lroken -lasn1 -lcrypto -lcrypt ${LIBVERS} +NO_PIE= yes + .include .PATH: ${KRB5DIR}/kdc Modified: head/kerberos5/usr.bin/verify_krb5_conf/Makefile ============================================================================== --- head/kerberos5/usr.bin/verify_krb5_conf/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/usr.bin/verify_krb5_conf/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -8,6 +8,8 @@ DPADD= ${LIBKAFS5} ${LIBKRB5} ${LIBHX509 LDADD= -lkafs5 -lkrb5 -lhx509 -lroken ${LIBVERS} \ -lasn1 -lcrypto -lcrypt -lcom_err +NO_PIE= yes + .include .PATH: ${KRB5DIR}/lib/krb5 Modified: head/kerberos5/usr.sbin/iprop-log/Makefile ============================================================================== --- head/kerberos5/usr.sbin/iprop-log/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/usr.sbin/iprop-log/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -13,6 +13,8 @@ DPADD= ${LIBKADM5SRV} ${LIBHDB} ${LIBKRB LDADD= -lkadm5srv -lhdb -lkrb5 -lasn1 -lcrypto -lcrypt ${LIBSL} -lroken \ ${LIBVERS} -ledit +NO_PIE= yes + iprop-commands.h: iprop-commands.in ${SLC} ${.ALLSRC:M*.in} Modified: head/kerberos5/usr.sbin/kstash/Makefile ============================================================================== --- head/kerberos5/usr.sbin/kstash/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/usr.sbin/kstash/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -10,6 +10,8 @@ LDADD= -lhdb -lkrb5 -lroken ${LIBVERS} \ -lasn1 -lcrypto -lcrypt ${LDAPLDADD} LDFLAGS=${LDAPLDFLAGS} +NO_PIE= yes + .include .PATH: ${KRB5DIR}/kdc Modified: head/kerberos5/usr.sbin/ktutil/Makefile ============================================================================== --- head/kerberos5/usr.sbin/ktutil/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/kerberos5/usr.sbin/ktutil/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -22,6 +22,8 @@ DPADD= ${LIBKADM5CLNT} ${LIBKRB5} ${LIBS LDADD= -lkadm5clnt -lkrb5 ${LIBSL} -lroken ${LIBVERS} \ -lasn1 -lcrypto -lcrypt -ledit +NO_PIE= yes + .include ktutil-commands.h: ${KRB5DIR}/admin/ktutil-commands.in Modified: head/lib/csu/amd64/Makefile ============================================================================== --- head/lib/csu/amd64/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/lib/csu/amd64/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -9,6 +9,8 @@ CFLAGS+= -I${.CURDIR}/../common \ -I${.CURDIR}/../../libc/include CFLAGS+= -fno-omit-frame-pointer +NO_PIE= yes + all: ${OBJS} CLEANFILES= ${OBJS} Modified: head/lib/csu/i386-elf/Makefile ============================================================================== --- head/lib/csu/i386-elf/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/lib/csu/i386-elf/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -13,6 +13,8 @@ CFLAGS+= -I${.CURDIR}/../common \ CLEANFILES= ${FILES} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o CLEANFILES+= crt1_c.s gcrt1_c.s Scrt1_c.s +NO_PIE= yes + # See the comment in lib/csu/common/crtbrand.c for the reason crt1_c.c is not # directly compiled to .o files. Modified: head/libexec/mail.local/Makefile ============================================================================== --- head/libexec/mail.local/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/libexec/mail.local/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -9,6 +9,8 @@ SRCS= mail.local.c MAN= mail.local.8 CFLAGS+=-I${SENDMAIL_DIR}/include -I. +NO_PIE= yes + WARNS?= 2 WFORMAT=0 Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/libexec/rtld-elf/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -78,5 +78,7 @@ beforeinstall: .PATH: ${.CURDIR}/${RTLD_ARCH} +NO_PIE= yes + .include .include Modified: head/libexec/smrsh/Makefile ============================================================================== --- head/libexec/smrsh/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/libexec/smrsh/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -9,6 +9,8 @@ SRCS= smrsh.c MAN= smrsh.8 CFLAGS+=-I${SENDMAIL_DIR}/src -I${SENDMAIL_DIR}/include -I. +NO_PIE= yes + LIBSMDIR= ${.OBJDIR}/../../lib/libsm LIBSM= ${LIBSMDIR}/libsm.a Modified: head/libexec/telnetd/Makefile ============================================================================== --- head/libexec/telnetd/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/libexec/telnetd/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -20,6 +20,8 @@ WFORMAT?= 0 CFLAGS+= -DLINEMODE -DUSE_TERMIO -DDIAGNOSTICS -DOLD_ENVIRON \ -DENV_HACK -DSTREAMSPTY +NO_PIE= yes + .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif Modified: head/sbin/fsck/Makefile ============================================================================== --- head/sbin/fsck/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/sbin/fsck/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -5,4 +5,6 @@ PROG= fsck SRCS= fsck.c fsutil.c preen.c MAN= fsck.8 +NO_PIE= yes + .include Modified: head/sbin/ipf/ipf/Makefile ============================================================================== --- head/sbin/ipf/ipf/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/sbin/ipf/ipf/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -39,4 +39,6 @@ DPADD+= ${LIBPCAP} LDADD+= -lpcap .endif +NO_PIE= yes + .include Modified: head/sbin/ipf/ipfstat/Makefile ============================================================================== --- head/sbin/ipf/ipfstat/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/sbin/ipf/ipfstat/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -8,4 +8,6 @@ MAN= ipfstat.8 DPADD+= ${LIBCURSES} LDADD+= -lcurses +NO_PIE= yes + .include Modified: head/sbin/ipf/ipftest/Makefile ============================================================================== --- head/sbin/ipf/ipftest/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/sbin/ipf/ipftest/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -32,6 +32,8 @@ CLEANFILES+= ipnat.tab.c ipnat.tab.h CLEANFILES+= ippool_y.c ippool_l.c CLEANFILES+= ippool.tab.c ippool.tab.h +NO_PIE= yes + ipnat_y.c: ipnat_y.y ${YACC} -b ipnat -d ${.ALLSRC} sed -e 's/yy/ipnat_yy/g' \ Modified: head/sbin/ipf/ipmon/Makefile ============================================================================== --- head/sbin/ipf/ipmon/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/sbin/ipf/ipmon/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -11,6 +11,8 @@ DPSRCS+= ${GENHDRS} CLEANFILES+= ${GENHDRS} ipmon_y.c ipmon_l.c +NO_PIE= yes + ipmon_y.c: ipmon_y.y ${YACC} -d ${.ALLSRC} sed -e 's/yy/ipmon_yy/g' \ Modified: head/sbin/ipf/ipnat/Makefile ============================================================================== --- head/sbin/ipf/ipnat/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/sbin/ipf/ipnat/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -11,6 +11,8 @@ DPSRCS+= ${GENHDRS} CLEANFILES+= ${GENHDRS} ipnat_y.c ipnat_l.c +NO_PIE= yes + ipnat_y.c: ipnat_y.y ${YACC} -d ${.ALLSRC} sed -e 's/yy/ipnat_yy/g' \ Modified: head/sbin/ipf/ippool/Makefile ============================================================================== --- head/sbin/ipf/ippool/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/sbin/ipf/ippool/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -10,6 +10,8 @@ DPSRCS+= ${GENHDRS} CLEANFILES+= ${GENHDRS} ippool_y.c ippool_l.c +NO_PIE= yes + ippool_y.c: ippool_y.y ${YACC} -d ${.ALLSRC} sed -e 's/yy/ippool_yy/g' \ Modified: head/sbin/ipf/ipresend/Makefile ============================================================================== --- head/sbin/ipf/ipresend/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/sbin/ipf/ipresend/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -4,6 +4,8 @@ PROG= ipresend SRCS= ipresend.c ip.c resend.c sbpf.c sock.c 44arp.c MAN= ipresend.1 +NO_PIE= yes + .PATH: ${.CURDIR}/../../../contrib/ipfilter/ipsend .include Modified: head/sbin/rcorder/Makefile ============================================================================== --- head/sbin/rcorder/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/sbin/rcorder/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -14,6 +14,8 @@ CFLAGS+= -DORDER -I. SRCS+= util.h CLEANFILES+= util.h +NO_PIE= yes + util.h: ln -sf ${.CURDIR}/../../lib/libutil/libutil.h ${.TARGET} Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Sun Jun 8 15:38:40 2014 (r267232) +++ head/share/mk/bsd.opts.mk Sun Jun 8 17:29:31 2014 (r267233) @@ -68,7 +68,8 @@ __DEFAULT_YES_OPTIONS = \ __DEFAULT_NO_OPTIONS = \ CTF \ DEBUG_FILES \ - INSTALL_AS_USER + INSTALL_AS_USER \ + PIE .include Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Sun Jun 8 15:38:40 2014 (r267232) +++ head/share/mk/bsd.prog.mk Sun Jun 8 17:29:31 2014 (r267233) @@ -11,6 +11,18 @@ CFLAGS+=${COPTS} .endif +.if ${MK_PIE} != "no" && (!defined(NO_PIE) || ${NO_PIE} == "no") +.if !defined(RESCUE) && !defined(NO_SHARED) +CFLAGS+= -fPIE -pie +LDFLAGS+= -pie +.elif defined(NO_SHARED) +.if ${NO_SHARED} == "no" || ${NO_SHARED} == "NO" +CFLAGS+= -fPIE -pie +LDFLAGS+= -pie +.endif +.endif +.endif + .if ${MK_ASSERT_DEBUG} == "no" CFLAGS+= -DNDEBUG NO_WERROR= Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/sys/boot/i386/boot2/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -22,6 +22,8 @@ BOOT2_UFS?= UFS1_AND_UFS2 #BOOT2_UFS?= UFS2_ONLY #BOOT2_UFS?= UFS1_ONLY +NO_PIE= yes + CFLAGS= -Os \ -fomit-frame-pointer \ -mrtd \ Modified: head/sys/boot/i386/btx/btx/Makefile ============================================================================== --- head/sys/boot/i386/btx/btx/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/sys/boot/i386/btx/btx/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -5,6 +5,8 @@ INTERNALPROG= MAN= SRCS= btx.S +NO_PIE= yes + .if defined(BOOT_BTX_NOHANG) BOOT_BTX_FLAGS=0x1 .else Modified: head/sys/boot/i386/btx/btxldr/Makefile ============================================================================== --- head/sys/boot/i386/btx/btxldr/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/sys/boot/i386/btx/btxldr/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -5,6 +5,8 @@ INTERNALPROG= MAN= SRCS= btxldr.S +NO_PIE= yes + CFLAGS+=-DLOADER_ADDRESS=${LOADER_ADDRESS} CFLAGS+=-I${.CURDIR}/../../common Modified: head/sys/boot/i386/btx/lib/Makefile ============================================================================== --- head/sys/boot/i386/btx/lib/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/sys/boot/i386/btx/lib/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -7,4 +7,6 @@ SRCS= btxcsu.S btxsys.s btxv86.s CFLAGS+=-I${.CURDIR}/../../common LDFLAGS=-Wl,-r +NO_PIE= yes + .include Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/sys/boot/i386/loader/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -8,6 +8,8 @@ PROG= ${LOADER}.sym INTERNALPROG= NEWVERSWHAT?= "bootstrap loader" x86 +NO_PIE= yes + # architecture-specific loader code SRCS= main.c conf.c vers.c Modified: head/sys/boot/mips/beri/boot2/Makefile ============================================================================== --- head/sys/boot/mips/beri/boot2/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/sys/boot/mips/beri/boot2/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -32,6 +32,8 @@ BINDIR?= /boot INSTALLFLAGS= -b +NO_PIE= yes + LOADERS= flashboot jtagboot FILES= ${LOADERS} ${LOADERS:S/$/.md5/} Modified: head/sys/boot/mips/beri/loader/Makefile ============================================================================== --- head/sys/boot/mips/beri/loader/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/sys/boot/mips/beri/loader/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -36,6 +36,8 @@ PROG?= loader NEWVERSWHAT= "BERI loader" ${MACHINE_CPUARCH} INSTALLFLAGS= -b +NO_PIE= yes + # Architecture-specific loader code SRCS= start.S \ main.c \ Modified: head/sys/boot/pc98/boot2/Makefile ============================================================================== --- head/sys/boot/pc98/boot2/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/sys/boot/pc98/boot2/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -6,6 +6,8 @@ CC:= gcc COMPILER_TYPE:= gcc +NO_PIE= yes + FILES= boot boot1 boot2 NM?= nm Modified: head/sys/boot/pc98/btx/lib/Makefile ============================================================================== --- head/sys/boot/pc98/btx/lib/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/sys/boot/pc98/btx/lib/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -7,4 +7,6 @@ SRCS= btxcsu.S btxsys.s btxv86.s CFLAGS+=-I${.CURDIR}/../../../i386/common LDFLAGS=-Wl,-r +NO_PIE= yes + .include Modified: head/sys/boot/pc98/loader/Makefile ============================================================================== --- head/sys/boot/pc98/loader/Makefile Sun Jun 8 15:38:40 2014 (r267232) +++ head/sys/boot/pc98/loader/Makefile Sun Jun 8 17:29:31 2014 (r267233) @@ -8,6 +8,8 @@ PROG= ${LOADER}.sym INTERNALPROG= NEWVERSWHAT= "bootstrap loader" pc98 +NO_PIE= yes *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 17:33:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE6C7674; Sun, 8 Jun 2014 17:33:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAF3628BB; Sun, 8 Jun 2014 17:33:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s58HXbXt010657; Sun, 8 Jun 2014 17:33:37 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s58HXbLt010656; Sun, 8 Jun 2014 17:33:37 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201406081733.s58HXbLt010656@svn.freebsd.org> From: Bryan Drewery Date: Sun, 8 Jun 2014 17:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267234 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 17:33:38 -0000 Author: bdrewery Date: Sun Jun 8 17:33:37 2014 New Revision: 267234 URL: http://svnweb.freebsd.org/changeset/base/267234 Log: Regen after r267233 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Jun 8 17:29:31 2014 (r267233) +++ head/share/man/man5/src.conf.5 Sun Jun 8 17:33:37 2014 (r267234) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd June 3, 2014 +.Dd June 8, 2014 .Dt SRC.CONF 5 .Os .Sh NAME @@ -883,6 +883,9 @@ When set, it also enforces the following .It .Va WITHOUT_AUTHPF .El +.It Va WITH_PIE +.\" from FreeBSD: head/tools/build/options/WITH_PIE 267233 2014-06-08 17:29:31Z bdrewery +Enable building of Position-Independent Executables (PIEs). .It Va WITHOUT_PKGBOOTSTRAP .\" from FreeBSD: head/tools/build/options/WITHOUT_PKGBOOTSTRAP 258924 2013-12-04 15:58:42Z bdrewery Set to not build @@ -1019,7 +1022,7 @@ Set to not build .Xr telnet 8 and related programs. .It Va WITH_TESTS -.\" from FreeBSD: head/tools/build/options/WITH_TESTS 264408 2014-04-13 11:29:52Z jmmv +.\" from FreeBSD: head/tools/build/options/WITH_TESTS 267033 2014-06-03 22:34:27Z jmmv Set to install the .Fx Test Suite in From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 17:38:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F10B883; Sun, 8 Jun 2014 17:38:56 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4419728F5; Sun, 8 Jun 2014 17:38:56 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 9AB6025D3897; Sun, 8 Jun 2014 17:38:52 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id ACB79C22BD8; Sun, 8 Jun 2014 17:38:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id N4RCD6IT7sYj; Sun, 8 Jun 2014 17:38:50 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (unknown [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 551DBC22B97; Sun, 8 Jun 2014 17:38:49 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r267233 - in head: . bin/rmail gnu/usr.bin/binutils/addr2line gnu/usr.bin/binutils/nm gnu/usr.bin/binutils/objcopy gnu/usr.bin/binutils/objdump gnu/usr.bin/binutils/readelf gnu/usr.bin/... From: "Bjoern A. Zeeb" In-Reply-To: <201406081729.s58HTWkc006213@svn.freebsd.org> Date: Sun, 8 Jun 2014 17:38:49 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <74512A27-DD5F-4D43-BFA1-0AC04E0D08B4@FreeBSD.org> References: <201406081729.s58HTWkc006213@svn.freebsd.org> To: Bryan Drewery X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 17:38:56 -0000 On 08 Jun 2014, at 17:29 , Bryan Drewery wrote: > Author: bdrewery > Date: Sun Jun 8 17:29:31 2014 > New Revision: 267233 > URL: http://svnweb.freebsd.org/changeset/base/267233 >=20 > Log: > In preparation for ASLR [1] support add WITH_PIE to support building = with -fPIE. >=20 > This is currently an opt-in build flag. Once ASLR support is ready = and stable > it should changed to opt-out and be enabled by default along with = ASLR. >=20 > Each application Makefile uses opt-out to ensure that ASLR will be = enabled by > default in new directories when the system is compiled with PIE/ASLR. = [2] >=20 > Mark known build failures as NO_PIE for now. No, no, no, no more NOs! I=92ll leave it to others who understand the current build system in = days when it=92s not broken to fix this entire splattering across all = these Makefiles; we really need a better way for this. =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 18:27:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7EB6AA2; Sun, 8 Jun 2014 18:27:38 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 881942CED; Sun, 8 Jun 2014 18:27:38 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s58IRS1i062468; Sun, 8 Jun 2014 21:27:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s58IRS1i062468 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.8/Submit) id s58IRSsW062467; Sun, 8 Jun 2014 21:27:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 8 Jun 2014 21:27:28 +0300 From: Konstantin Belousov To: Bryan Drewery Subject: Re: svn commit: r267233 - in head: . bin/rmail gnu/usr.bin/binutils/addr2line gnu/usr.bin/binutils/nm gnu/usr.bin/binutils/objcopy gnu/usr.bin/binutils/objdump gnu/usr.bin/binutils/readelf gnu/usr.bin/... Message-ID: <20140608182728.GX3991@kib.kiev.ua> References: <201406081729.s58HTWkc006213@svn.freebsd.org> <74512A27-DD5F-4D43-BFA1-0AC04E0D08B4@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fD6GIi1NIioU6454" Content-Disposition: inline In-Reply-To: <74512A27-DD5F-4D43-BFA1-0AC04E0D08B4@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 18:27:39 -0000 --fD6GIi1NIioU6454 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 08, 2014 at 05:38:49PM +0000, Bjoern A. Zeeb wrote: >=20 > On 08 Jun 2014, at 17:29 , Bryan Drewery wrote: >=20 > > Author: bdrewery > > Date: Sun Jun 8 17:29:31 2014 > > New Revision: 267233 > > URL: http://svnweb.freebsd.org/changeset/base/267233 > >=20 > > Log: > > In preparation for ASLR [1] support add WITH_PIE to support building w= ith -fPIE. > >=20 > > This is currently an opt-in build flag. Once ASLR support is ready and= stable > > it should changed to opt-out and be enabled by default along with ASLR. > >=20 > > Each application Makefile uses opt-out to ensure that ASLR will be ena= bled by > > default in new directories when the system is compiled with PIE/ASLR. = [2] > >=20 > > Mark known build failures as NO_PIE for now. >=20 > No, no, no, no more NOs! >=20 > I?ll leave it to others who understand the current build system in days w= hen it?s not broken to fix this entire splattering across all these Makefil= es; we really need a better way for this. I have no words to express my dissatisfaction with this commit. If change to the build of _some_ usermode binaries require patching of loader', csu and rtld Makefiles, obviously it is done wrong. Why almost half of the binaries require opt-out ? =20 PLEASE REVERT THIS. --fD6GIi1NIioU6454 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJTlKsQAAoJEJDCuSvBvK1B710QAJCZI3sZ8uERnmTGoxlWrAzT 6Ln1ZR98SZnSGQcqWgy4kB4PUGJOCZl2xo6XyoZ9eCz8aaP5UuKV5T/pAvzs0f16 KADTdPQKsRgne8yYCGqhEkseXxySZI7So6CY1Hb9rS+8lWiySYL3q3MPy0Cb0C+k j6J8+qxGFzh/US8iZS4eCuzFwgD78xE2SLWKAdvGJhzhrOym0XrRw7VgFLFVzJ7v WESw44zqdzdpMRsSaOxxC9WgaooUvhXggTQK5elM+SwXcNBd6m2nziOPn+r7FXBI CEigccIxamn7cKWV/MLSs6s9XS6ho7oiLH+kb4Iq10RhdySZ8plESos/FJZpWTXQ 2LhFQYZQh0S84XiDZ52YRjeVxn0LbL1OzS8IYFHVUHBCRcFiDkod0fGmtWaAyL7v 6/TIqEHzfGIEKj2Qz0B4BLrVuox2b4P4MbfPCFWjgAzXpH1zUjiC7a1WloRhn5Vv H0Ji/oGuRgcSqtPhDCZLYWMfMyY1+mKfcEHCyJvfpo/ilP6UG9CqBOFPDFbRz3uH ynM2q0BPtsaqLRBjdBb3XinOIkwLsQFFc9y6H4Rj3Z6v9pqXT+QjsV1qLfSPFHgZ oaquZo6/wif75scIEMUfxKImSzxBt3XsekaYDOOpc8ZI/wQqKNIupBRIdWaLSTL5 UAimP4JBWajZBOO60kPW =pzhD -----END PGP SIGNATURE----- --fD6GIi1NIioU6454-- From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 18:30:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89A3FBF6; Sun, 8 Jun 2014 18:30:45 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 71EFA2CFF; Sun, 8 Jun 2014 18:30:44 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id 8167A1A3C27; Sun, 8 Jun 2014 11:30:38 -0700 (PDT) Message-ID: <5394ABD2.5040009@mu.org> Date: Sun, 08 Jun 2014 11:30:42 -0700 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Konstantin Belousov , Bryan Drewery Subject: Re: svn commit: r267233 - in head: . bin/rmail gnu/usr.bin/binutils/addr2line gnu/usr.bin/binutils/nm gnu/usr.bin/binutils/objcopy gnu/usr.bin/binutils/objdump gnu/usr.bin/binutils/readelf gnu/usr.bin/... References: <201406081729.s58HTWkc006213@svn.freebsd.org> <74512A27-DD5F-4D43-BFA1-0AC04E0D08B4@FreeBSD.org> <20140608182728.GX3991@kib.kiev.ua> In-Reply-To: <20140608182728.GX3991@kib.kiev.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 18:30:45 -0000 On 6/8/14 11:27 AM, Konstantin Belousov wrote: > On Sun, Jun 08, 2014 at 05:38:49PM +0000, Bjoern A. Zeeb wrote: >> On 08 Jun 2014, at 17:29 , Bryan Drewery wrote: >> >>> Author: bdrewery >>> Date: Sun Jun 8 17:29:31 2014 >>> New Revision: 267233 >>> URL: http://svnweb.freebsd.org/changeset/base/267233 >>> >>> Log: >>> In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE. >>> >>> This is currently an opt-in build flag. Once ASLR support is ready and stable >>> it should changed to opt-out and be enabled by default along with ASLR. >>> >>> Each application Makefile uses opt-out to ensure that ASLR will be enabled by >>> default in new directories when the system is compiled with PIE/ASLR. [2] >>> >>> Mark known build failures as NO_PIE for now. >> No, no, no, no more NOs! >> >> I?ll leave it to others who understand the current build system in days when it?s not broken to fix this entire splattering across all these Makefiles; we really need a better way for this. > I have no words to express my dissatisfaction with this commit. > If change to the build of _some_ usermode binaries require patching > of loader', csu and rtld Makefiles, obviously it is done wrong. > > Why almost half of the binaries require opt-out ? > > PLEASE REVERT THIS. Wait. Does this not serve as a useful stake in the ground for people to come in and update things? Instead of asking to back out, shouldn't we be doing an announcement "ok folks, it's now time to fix this!" and move forward? Otherwise we may never get any pie. -Alfred -- Alfred Perlstein From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 18:45:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E64BDE9; Sun, 8 Jun 2014 18:45:01 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 049382E20; Sun, 8 Jun 2014 18:45:00 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s58IipEX065949; Sun, 8 Jun 2014 21:44:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s58IipEX065949 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.8/Submit) id s58IipX7065948; Sun, 8 Jun 2014 21:44:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 8 Jun 2014 21:44:51 +0300 From: Konstantin Belousov To: Alfred Perlstein Subject: Re: svn commit: r267233 - in head: . bin/rmail gnu/usr.bin/binutils/addr2line gnu/usr.bin/binutils/nm gnu/usr.bin/binutils/objcopy gnu/usr.bin/binutils/objdump gnu/usr.bin/binutils/readelf gnu/usr.bin/... Message-ID: <20140608184451.GZ3991@kib.kiev.ua> References: <201406081729.s58HTWkc006213@svn.freebsd.org> <74512A27-DD5F-4D43-BFA1-0AC04E0D08B4@FreeBSD.org> <20140608182728.GX3991@kib.kiev.ua> <5394ABD2.5040009@mu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="S2CovAv8lqFB/Tem" Content-Disposition: inline In-Reply-To: <5394ABD2.5040009@mu.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bryan Drewery X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 18:45:01 -0000 --S2CovAv8lqFB/Tem Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 08, 2014 at 11:30:42AM -0700, Alfred Perlstein wrote: > On 6/8/14 11:27 AM, Konstantin Belousov wrote: > > On Sun, Jun 08, 2014 at 05:38:49PM +0000, Bjoern A. Zeeb wrote: > >> On 08 Jun 2014, at 17:29 , Bryan Drewery wrote: > >> > >>> Author: bdrewery > >>> Date: Sun Jun 8 17:29:31 2014 > >>> New Revision: 267233 > >>> URL: http://svnweb.freebsd.org/changeset/base/267233 > >>> > >>> Log: > >>> In preparation for ASLR [1] support add WITH_PIE to support buildin= g with -fPIE. > >>> > >>> This is currently an opt-in build flag. Once ASLR support is ready = and stable > >>> it should changed to opt-out and be enabled by default along with A= SLR. > >>> > >>> Each application Makefile uses opt-out to ensure that ASLR will be = enabled by > >>> default in new directories when the system is compiled with PIE/ASL= R. [2] > >>> > >>> Mark known build failures as NO_PIE for now. > >> No, no, no, no more NOs! > >> > >> I?ll leave it to others who understand the current build system in day= s when it?s not broken to fix this entire splattering across all these Make= files; we really need a better way for this. > > I have no words to express my dissatisfaction with this commit. > > If change to the build of _some_ usermode binaries require patching > > of loader', csu and rtld Makefiles, obviously it is done wrong. > > > > Why almost half of the binaries require opt-out ? > > > > PLEASE REVERT THIS. > Wait. Does this not serve as a useful stake in the ground for people to= =20 > come in and update things? Instead of asking to back out, shouldn't we= =20 > be doing an announcement "ok folks, it's now time to fix this!" and move= =20 > forward? Otherwise we may never get any pie. Let me reformulate. Somebody commits broken change, despite it was pointed out by many before the commit. From the changes it is obvious that people which proposed it do not understand what they hack on. And then, somebody else must run and 'fix' previously non-broken code. Sure, you get the pie. --S2CovAv8lqFB/Tem Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJTlK8jAAoJEJDCuSvBvK1BpfsP/25JKsv8sycbc1LUys9n5eIW iThp5fE9468Une7DZr1KSnUPu0JQU7dm+hH7Tms6FrhgI29/NqRbAZx9I2RSKLHR FgoQ5cZX+ikuov5uGW0pGypLz4qTQPI7m8viSs5dLUS2CmcqyQhwu+4NYbj/DO73 cET6NmfjeuXwdZjU/bPX+b5Q7/aCCQRHnKtm7wou+W3WXOLgyGm5qlqM+j2/rnQt fSqj2M4dEiqDtX37lr0OIFbcCs+opcySbYhycFSrtwUNK5jVFlcIX1FODq/rMVwq GAxaxiB4EjMSCiBM+Er0A2KRmv8H6nyaDu3rny/8Nw6JsWkUs0tEyxQN2mGwEFtr YsEER60NEjHaXXcZJxkCQfLpdR8+VX66Zf9nKFwCiSJTYd5YEgMyBy3vspWt08ND CcFTG55ezNFNsAqdkHgJxAOCSrCBA8gxwzWhsOOtnkhMVoAMX4QYPSDT4dTQ3eOh rxowwl+hy9fKS5Rb/QBiNjDMFIBgzi4ZqWpAzmRMjh7/EkJr6nd4lHup9pHd/WNp sk3SeOaelXhHrQjToimYv7XV7cxTB51/QwBlByIYR8hpwmoCJFxeH9oRba2Px1cV rIzNkcz9ictlEOouYEno6bZ+MmR84Va7/Fga1cbFIwxPwAFoP4z3fMrY3x8h11xN fLKvZ86lxWFaaGjYmApn =8mU+ -----END PGP SIGNATURE----- --S2CovAv8lqFB/Tem-- From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 19:01:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F6194C2; Sun, 8 Jun 2014 19:01:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BE642F24; Sun, 8 Jun 2014 19:01:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s58J1cbe061477; Sun, 8 Jun 2014 19:01:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s58J1cJg061476; Sun, 8 Jun 2014 19:01:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406081901.s58J1cJg061476@svn.freebsd.org> From: Alexander Motin Date: Sun, 8 Jun 2014 19:01:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267239 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 19:01:38 -0000 Author: mav Date: Sun Jun 8 19:01:37 2014 New Revision: 267239 URL: http://svnweb.freebsd.org/changeset/base/267239 Log: Remove extra branching from r267232. MFC after: 2 weeks Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Jun 8 18:11:53 2014 (r267238) +++ head/sys/kern/vfs_subr.c Sun Jun 8 19:01:37 2014 (r267239) @@ -995,18 +995,14 @@ void getnewvnode_reserve(u_int count) { struct thread *td; - long num; td = curthread; /* First try to be quick and racy. */ - if (numvnodes + count <= desiredvnodes) { - num = atomic_fetchadd_long(&numvnodes, count); - if (num + count <= desiredvnodes) { - td->td_vp_reserv += count; - return; - } else - atomic_subtract_long(&numvnodes, count); - } + if (atomic_fetchadd_long(&numvnodes, count) + count <= desiredvnodes) { + td->td_vp_reserv += count; + return; + } else + atomic_subtract_long(&numvnodes, count); mtx_lock(&vnode_free_list_mtx); while (count > 0) { From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 19:14:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A2DC745; Sun, 8 Jun 2014 19:14:13 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id F40F42072; Sun, 8 Jun 2014 19:14:12 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id 9DC8C1A3C23; Sun, 8 Jun 2014 12:14:11 -0700 (PDT) Message-ID: <5394B607.1000109@mu.org> Date: Sun, 08 Jun 2014 12:14:15 -0700 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r267233 - in head: . bin/rmail gnu/usr.bin/binutils/addr2line gnu/usr.bin/binutils/nm gnu/usr.bin/binutils/objcopy gnu/usr.bin/binutils/objdump gnu/usr.bin/binutils/readelf gnu/usr.bin/... References: <201406081729.s58HTWkc006213@svn.freebsd.org> <74512A27-DD5F-4D43-BFA1-0AC04E0D08B4@FreeBSD.org> <20140608182728.GX3991@kib.kiev.ua> <5394ABD2.5040009@mu.org> <20140608184451.GZ3991@kib.kiev.ua> In-Reply-To: <20140608184451.GZ3991@kib.kiev.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bryan Drewery X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 19:14:13 -0000 On 6/8/14 11:44 AM, Konstantin Belousov wrote: > On Sun, Jun 08, 2014 at 11:30:42AM -0700, Alfred Perlstein wrote: >> On 6/8/14 11:27 AM, Konstantin Belousov wrote: >>> On Sun, Jun 08, 2014 at 05:38:49PM +0000, Bjoern A. Zeeb wrote: >>>> On 08 Jun 2014, at 17:29 , Bryan Drewery wrote: >>>> >>>>> Author: bdrewery >>>>> Date: Sun Jun 8 17:29:31 2014 >>>>> New Revision: 267233 >>>>> URL: http://svnweb.freebsd.org/changeset/base/267233 >>>>> >>>>> Log: >>>>> In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE. >>>>> >>>>> This is currently an opt-in build flag. Once ASLR support is ready and stable >>>>> it should changed to opt-out and be enabled by default along with ASLR. >>>>> >>>>> Each application Makefile uses opt-out to ensure that ASLR will be enabled by >>>>> default in new directories when the system is compiled with PIE/ASLR. [2] >>>>> >>>>> Mark known build failures as NO_PIE for now. >>>> No, no, no, no more NOs! >>>> >>>> I?ll leave it to others who understand the current build system in days when it?s not broken to fix this entire splattering across all these Makefiles; we really need a better way for this. >>> I have no words to express my dissatisfaction with this commit. >>> If change to the build of _some_ usermode binaries require patching >>> of loader', csu and rtld Makefiles, obviously it is done wrong. >>> >>> Why almost half of the binaries require opt-out ? >>> >>> PLEASE REVERT THIS. >> Wait. Does this not serve as a useful stake in the ground for people to >> come in and update things? Instead of asking to back out, shouldn't we >> be doing an announcement "ok folks, it's now time to fix this!" and move >> forward? Otherwise we may never get any pie. > Let me reformulate. > > Somebody commits broken change, despite it was pointed out by many > before the commit. From the changes it is obvious that people which > proposed it do not understand what they hack on. And then, somebody else > must run and 'fix' previously non-broken code. > > Sure, you get the pie. Sure, but hasn't the default stayed unchanged? It seems like you have to enable ASLR first before you see all the breakage. Right now it seems like goal was to document what even compiles versus doesn't compile with ASLR. Afaik there is not setting of ASLR on by default. There has to be a way to call out what works and what doesn't work and form a transition from a world with no ASLR to one with some ASLR and eventually one with almost entirely ASLR coverage. I'm not sure it can be done in one fell swoop. Hooks like this in -current allow for this to be done as a group effort. It would be very unlikely that we retain the semantics all the way until a -stable release. -Alfred -- Alfred Perlstein From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 20:10:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 487C14CB; Sun, 8 Jun 2014 20:10:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 298AD2496; Sun, 8 Jun 2014 20:10:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s58KAUSR002768; Sun, 8 Jun 2014 20:10:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s58KATIT002757; Sun, 8 Jun 2014 20:10:29 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406082010.s58KATIT002757@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 8 Jun 2014 20:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267240 - in head/sys/dev/usb: . controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 20:10:31 -0000 Author: hselasky Date: Sun Jun 8 20:10:29 2014 New Revision: 267240 URL: http://svnweb.freebsd.org/changeset/base/267240 Log: Resolve a deadlock setting the USB configuration index from userspace on USB HUBs by moving the code into the USB explore threads. The deadlock happens because child devices of the USB HUB don't have the expected reference count when called from outside the explore thread. Only the HUB device itself, which the IOCTL interface locks, gets the correct reference count. MFC after: 3 days Modified: head/sys/dev/usb/controller/usb_controller.c head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_hub.h head/sys/dev/usb/usbdi.h Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Sun Jun 8 19:01:37 2014 (r267239) +++ head/sys/dev/usb/controller/usb_controller.c Sun Jun 8 20:10:29 2014 (r267240) @@ -367,7 +367,13 @@ usb_bus_explore(struct usb_proc_msg *pm) if (bus->no_explore != 0) return; - if (udev && udev->hub) { + if (udev != NULL) { + USB_BUS_UNLOCK(bus); + uhub_explore_handle_re_enumerate(udev); + USB_BUS_LOCK(bus); + } + + if (udev != NULL && udev->hub != NULL) { if (bus->do_probe) { bus->do_probe = 0; Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Sun Jun 8 19:01:37 2014 (r267239) +++ head/sys/dev/usb/usb_dev.c Sun Jun 8 20:10:29 2014 (r267240) @@ -1116,9 +1116,14 @@ usb_ioctl(struct cdev *dev, u_long cmd, usb_pause_mtx(NULL, hz / 128); - if (usb_ref_device(cpd, &refs, 1 /* need uref */)) { - err = ENXIO; - goto done; + while (usb_ref_device(cpd, &refs, 1 /* need uref */)) { + if (usb_ref_device(cpd, &refs, 0)) { + /* device no longer exits */ + err = ENXIO; + goto done; + } + usb_unref_device(cpd, &refs); + usb_pause_mtx(NULL, hz / 128); } } Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Sun Jun 8 19:01:37 2014 (r267239) +++ head/sys/dev/usb/usb_device.h Sun Jun 8 20:10:29 2014 (r267240) @@ -228,6 +228,7 @@ struct usb_device { uint8_t address; /* device addess */ uint8_t device_index; /* device index in "bus->devices" */ uint8_t controller_slot_id; /* controller specific value */ + uint8_t next_config_index; /* used by USB_RE_ENUM_SET_CONFIG */ uint8_t curr_config_index; /* current configuration index */ uint8_t curr_config_no; /* current configuration number */ uint8_t depth; /* distance from root HUB */ @@ -241,6 +242,7 @@ struct usb_device { #define USB_RE_ENUM_DONE 0 #define USB_RE_ENUM_START 1 #define USB_RE_ENUM_PWR_OFF 2 +#define USB_RE_ENUM_SET_CONFIG 3 uint8_t ifaces_max; /* number of interfaces present */ uint8_t endpoints_max; /* number of endpoints present */ Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Sun Jun 8 19:01:37 2014 (r267239) +++ head/sys/dev/usb/usb_generic.c Sun Jun 8 20:10:29 2014 (r267240) @@ -616,24 +616,17 @@ ugen_set_config(struct usb_fifo *f, uint /* not possible in device side mode */ return (ENOTTY); } - if (f->udev->curr_config_index == index) { - /* no change needed */ - return (0); - } + /* make sure all FIFO's are gone */ /* else there can be a deadlock */ if (ugen_fs_uninit(f)) { /* ignore any errors */ DPRINTFN(6, "no FIFOs\n"); } - /* change setting - will free generic FIFOs, if any */ - if (usbd_set_config_index(f->udev, index)) { - return (EIO); - } - /* probe and attach */ - if (usb_probe_and_attach(f->udev, USB_IFACE_INDEX_ANY)) { + + if (usbd_start_set_config(f->udev, index) != 0) return (EIO); - } + return (0); } @@ -970,11 +963,6 @@ ugen_re_enumerate(struct usb_fifo *f) DPRINTFN(6, "device mode\n"); return (ENOTTY); } - if (udev->parent_hub == NULL) { - /* the root HUB cannot be re-enumerated */ - DPRINTFN(6, "cannot reset root HUB\n"); - return (EINVAL); - } /* make sure all FIFO's are gone */ /* else there can be a deadlock */ if (ugen_fs_uninit(f)) { Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Sun Jun 8 19:01:37 2014 (r267239) +++ head/sys/dev/usb/usb_hub.c Sun Jun 8 20:10:29 2014 (r267240) @@ -427,6 +427,86 @@ done: return (retval); } +void +uhub_explore_handle_re_enumerate(struct usb_device *child) +{ + uint8_t do_unlock; + usb_error_t err; + + /* check if device should be re-enumerated */ + if (child->flags.usb_mode != USB_MODE_HOST) + return; + + do_unlock = usbd_enum_lock(child); + switch (child->re_enumerate_wait) { + case USB_RE_ENUM_START: + err = usbd_set_config_index(child, + USB_UNCONFIG_INDEX); + if (err != 0) { + DPRINTF("Unconfigure failed: %s: Ignored.\n", + usbd_errstr(err)); + } + if (child->parent_hub == NULL) { + /* the root HUB cannot be re-enumerated */ + DPRINTFN(6, "cannot reset root HUB\n"); + err = 0; + } else { + err = usbd_req_re_enumerate(child, NULL); + } + if (err == 0) + err = usbd_set_config_index(child, 0); + if (err == 0) { + err = usb_probe_and_attach(child, + USB_IFACE_INDEX_ANY); + } + child->re_enumerate_wait = USB_RE_ENUM_DONE; + break; + + case USB_RE_ENUM_PWR_OFF: + /* get the device unconfigured */ + err = usbd_set_config_index(child, + USB_UNCONFIG_INDEX); + if (err) { + DPRINTFN(0, "Could not unconfigure " + "device (ignored)\n"); + } + if (child->parent_hub == NULL) { + /* the root HUB cannot be re-enumerated */ + DPRINTFN(6, "cannot set port feature\n"); + err = 0; + } else { + /* clear port enable */ + err = usbd_req_clear_port_feature(child->parent_hub, + NULL, child->port_no, UHF_PORT_ENABLE); + if (err) { + DPRINTFN(0, "Could not disable port " + "(ignored)\n"); + } + } + child->re_enumerate_wait = USB_RE_ENUM_DONE; + break; + + case USB_RE_ENUM_SET_CONFIG: + err = usbd_set_config_index(child, + child->next_config_index); + if (err != 0) { + DPRINTF("Configure failed: %s: Ignored.\n", + usbd_errstr(err)); + } else { + err = usb_probe_and_attach(child, + USB_IFACE_INDEX_ANY); + } + child->re_enumerate_wait = USB_RE_ENUM_DONE; + break; + + default: + child->re_enumerate_wait = USB_RE_ENUM_DONE; + break; + } + if (do_unlock) + usbd_enum_unlock(child); +} + /*------------------------------------------------------------------------* * uhub_explore_sub - subroutine * @@ -455,59 +535,7 @@ uhub_explore_sub(struct uhub_softc *sc, goto done; } - /* check if device should be re-enumerated */ - - if (child->flags.usb_mode == USB_MODE_HOST) { - uint8_t do_unlock; - - do_unlock = usbd_enum_lock(child); - switch (child->re_enumerate_wait) { - case USB_RE_ENUM_START: - err = usbd_set_config_index(child, - USB_UNCONFIG_INDEX); - if (err != 0) { - DPRINTF("Unconfigure failed: " - "%s: Ignored.\n", - usbd_errstr(err)); - } - err = usbd_req_re_enumerate(child, NULL); - if (err == 0) - err = usbd_set_config_index(child, 0); - if (err == 0) { - err = usb_probe_and_attach(child, - USB_IFACE_INDEX_ANY); - } - child->re_enumerate_wait = USB_RE_ENUM_DONE; - err = 0; - break; - - case USB_RE_ENUM_PWR_OFF: - /* get the device unconfigured */ - err = usbd_set_config_index(child, - USB_UNCONFIG_INDEX); - if (err) { - DPRINTFN(0, "Could not unconfigure " - "device (ignored)\n"); - } - - /* clear port enable */ - err = usbd_req_clear_port_feature(child->parent_hub, - NULL, child->port_no, UHF_PORT_ENABLE); - if (err) { - DPRINTFN(0, "Could not disable port " - "(ignored)\n"); - } - child->re_enumerate_wait = USB_RE_ENUM_DONE; - err = 0; - break; - - default: - child->re_enumerate_wait = USB_RE_ENUM_DONE; - break; - } - if (do_unlock) - usbd_enum_unlock(child); - } + uhub_explore_handle_re_enumerate(child); /* check if probe and attach should be done */ @@ -2799,3 +2827,31 @@ usbd_start_re_enumerate(struct usb_devic usb_needs_explore(udev->bus, 0); } } + +/*-----------------------------------------------------------------------* + * usbd_start_set_config + * + * This function starts setting a USB configuration. This function + * does not need to be called BUS-locked. This function does not wait + * until the set USB configuratino is completed. + *------------------------------------------------------------------------*/ +usb_error_t +usbd_start_set_config(struct usb_device *udev, uint8_t index) +{ + if (udev->re_enumerate_wait == USB_RE_ENUM_DONE) { + if (udev->curr_config_index == index) { + /* no change needed */ + return (0); + } + udev->next_config_index = index; + udev->re_enumerate_wait = USB_RE_ENUM_SET_CONFIG; + usb_needs_explore(udev->bus, 0); + return (0); + } else if (udev->re_enumerate_wait == USB_RE_ENUM_SET_CONFIG) { + if (udev->next_config_index == index) { + /* no change needed */ + return (0); + } + } + return (USB_ERR_PENDING_REQUESTS); +} Modified: head/sys/dev/usb/usb_hub.h ============================================================================== --- head/sys/dev/usb/usb_hub.h Sun Jun 8 19:01:37 2014 (r267239) +++ head/sys/dev/usb/usb_hub.h Sun Jun 8 20:10:29 2014 (r267240) @@ -75,5 +75,6 @@ void usb_bus_power_update(struct usb_bus void usb_bus_powerd(struct usb_bus *bus); void uhub_root_intr(struct usb_bus *, const uint8_t *, uint8_t); usb_error_t uhub_query_info(struct usb_device *, uint8_t *, uint8_t *); +void uhub_explore_handle_re_enumerate(struct usb_device *); #endif /* _USB_HUB_H_ */ Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Sun Jun 8 19:01:37 2014 (r267239) +++ head/sys/dev/usb/usbdi.h Sun Jun 8 20:10:29 2014 (r267240) @@ -586,6 +586,8 @@ void usbd_m_copy_in(struct usb_page_cach void usbd_frame_zero(struct usb_page_cache *cache, usb_frlength_t offset, usb_frlength_t len); void usbd_start_re_enumerate(struct usb_device *udev); +usb_error_t + usbd_start_set_config(struct usb_device *, uint8_t); int usb_fifo_attach(struct usb_device *udev, void *priv_sc, struct mtx *priv_mtx, struct usb_fifo_methods *pm, From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 20:19:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B543940 for ; Sun, 8 Jun 2014 20:19:59 +0000 (UTC) Received: from nm19-vm0.bullet.mail.bf1.yahoo.com (nm19-vm0.bullet.mail.bf1.yahoo.com [98.139.213.162]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCA132554 for ; Sun, 8 Jun 2014 20:19:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1402258395; bh=I/iO/w2ZOgq4rPcFDhNuL81/nd77I+Ust/y0/ncpO10=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:Organization:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=QBoECqJ3sScvUK2A9u35gF88PY4/43xFFVdTLmniLHaPfLwSClx9tXUl8AdM7ysjIaWQlgYKGcQMeTczU2bBIvZ3S8+d9vuYp+sua3Z2PeFZzl4ejVKWa0+AaH3AFQZELNtcs2qmRR9Kb3ULWrgHDoXvxyDGfn90CrJCblYNQ+JaKnbaP/DPTbW+FLU7BZ1jVmN8hFBK/XNNKMo3ZCD6iDM6MR5Lv7AkHd400behxkYCt/Lf2tSCU/YXBkGtC1aMD758wbC9436PNCTjg/uCIXebcAGJhaOD9gfsn3j50/4YXTpTiHTK7shtfWPEABwGRoQBfju6h+f0teocrlwtsg== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=Hv3bwn9OSfxL8R6zGdySZvKpD7/Dme+W9GgrbqLfGNDrqp3hZGm/bRXDnDFYZZ05ArdcURjUKlC3K/gf53bI+/+ujQa9UWzSVIjKCwfoOtHPHlmnBCvxJ1Y0YsRLUhN+iGbBmTxqrEZuOBUfspUfgDW1XgHZUJ7gFfCyvmQO/Vhiisu4MGVydGYizr8sdm+dLYEoZWdzLkcMgWewVahF3/GdVsDJDIZ5raaq8IQHCK4sSjNRzTmputjib39GWRthISwGOo64Am8WpPUNDlwEX36kPzbBS35XPn8xicwOcsLekSlgo2MMRKhnxIwYKKpYpzswSrbbgAkEkUZAsmyDJQ==; Received: from [98.139.212.152] by nm19.bullet.mail.bf1.yahoo.com with NNFMP; 08 Jun 2014 20:13:15 -0000 Received: from [68.142.230.75] by tm9.bullet.mail.bf1.yahoo.com with NNFMP; 08 Jun 2014 20:13:15 -0000 Received: from [127.0.0.1] by smtp232.mail.bf1.yahoo.com with NNFMP; 08 Jun 2014 20:13:15 -0000 X-Yahoo-Newman-Id: 634104.57816.bm@smtp232.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 3T8MNsgVM1nFEDp1W._AwGvYk6zWFReW23z7zMmbiNFgvyd azak8ewj57BGd_OfUFO0Mud8SOxy0z1B92TzNXYTAreOKKe3JtJjDH9MvrrB GjqI8ucLFIlZZ5sJs.SECAjX6h7avFXBExiUaq16RIFEoo54.2phJEn5.JXC zIFjd_L3ZtBycweRjJlz9IGg_kW7ERQVfPzA2PTd8NCLRjZlvIBY4S2mABBv SWC7GTAVfzDuKqQBOMO7qczGhRw_hwxSIqADtliJMpzgm8LqWoJxb1KF4znT A.nHvYdp_i7Sxxv7dvAbZOelIdWZP_yvxqEvWoUV3e31cqSZjMMOVS0n.4YT 5uEDJ93F1opMG66XzO1pZW10xyxOqtbWOiehJxT.PqlJ1vtzyHV8u4coMEmU XW70Sakf3hlWi6jiHecQZpoSRsIqCHgn29YIm8Q2wgpCcMHokLFtFI6L7j50 dEeIOFlO93wks7iUEWr7oW7JC9tmtFeNoXga_1jsEYCqezNmlYO9FSnSB366 3eeirEvCHG9KbtNDXppjbhcIf_e.8FTmtcSTkdPdF6x3w7WE08TVvuGb9vuR 3rswTbtiDa.D.U_0iS8RWFW3V X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain [63.250.193.228]) by smtp232.mail.bf1.yahoo.com with SMTP; 08 Jun 2014 20:13:15 +0000 UTC Message-ID: <5394C3D8.7040800@FreeBSD.org> Date: Sun, 08 Jun 2014 15:13:12 -0500 From: Pedro Giffuni Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Alfred Perlstein , Konstantin Belousov Subject: Re: svn commit: r267233 - in head: . bin/rmail gnu/usr.bin/binutils/addr2line gnu/usr.bin/binutils/nm gnu/usr.bin/binutils/objcopy gnu/usr.bin/binutils/objdump gnu/usr.bin/binutils/readelf gnu/usr.bin/... References: <201406081729.s58HTWkc006213@svn.freebsd.org> <74512A27-DD5F-4D43-BFA1-0AC04E0D08B4@FreeBSD.org> <20140608182728.GX3991@kib.kiev.ua> <5394ABD2.5040009@mu.org> <20140608184451.GZ3991@kib.kiev.ua> <5394B607.1000109@mu.org> In-Reply-To: <5394B607.1000109@mu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bryan Drewery X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 20:19:59 -0000 Hello; El 6/8/2014 2:14 PM, Alfred Perlstein escribió: > On 6/8/14 11:44 AM, Konstantin Belousov wrote: >> On Sun, Jun 08, 2014 at 11:30:42AM -0700, Alfred Perlstein wrote: >>> On 6/8/14 11:27 AM, Konstantin Belousov wrote: >>>> On Sun, Jun 08, 2014 at 05:38:49PM +0000, Bjoern A. Zeeb wrote: >>>>> On 08 Jun 2014, at 17:29 , Bryan Drewery wrote: >>>>> >>>>>> Author: bdrewery >>>>>> Date: Sun Jun 8 17:29:31 2014 >>>>>> New Revision: 267233 >>>>>> URL: http://svnweb.freebsd.org/changeset/base/267233 >>>>>> >>>>>> Log: >>>>>> In preparation for ASLR [1] support add WITH_PIE to support >>>>>> building with -fPIE. >>>>>> >>>>>> This is currently an opt-in build flag. Once ASLR support is >>>>>> ready and stable >>>>>> it should changed to opt-out and be enabled by default along >>>>>> with ASLR. >>>>>> >>>>>> Each application Makefile uses opt-out to ensure that ASLR will >>>>>> be enabled by >>>>>> default in new directories when the system is compiled with >>>>>> PIE/ASLR. [2] >>>>>> >>>>>> Mark known build failures as NO_PIE for now. >>>>> No, no, no, no more NOs! >>>>> >>>>> I?ll leave it to others who understand the current build system in >>>>> days when it?s not broken to fix this entire splattering across all >>>>> these Makefiles; we really need a better way for this. >>>> I have no words to express my dissatisfaction with this commit. >>>> If change to the build of _some_ usermode binaries require patching >>>> of loader', csu and rtld Makefiles, obviously it is done wrong. >>>> >>>> Why almost half of the binaries require opt-out ? >>>> >>>> PLEASE REVERT THIS. >>> Wait. Does this not serve as a useful stake in the ground for people to >>> come in and update things? Instead of asking to back out, shouldn't we >>> be doing an announcement "ok folks, it's now time to fix this!" and move >>> forward? Otherwise we may never get any pie. >> Let me reformulate. >> >> Somebody commits broken change, despite it was pointed out by many >> before the commit. From the changes it is obvious that people which >> proposed it do not understand what they hack on. And then, somebody else >> must run and 'fix' previously non-broken code. >> >> Sure, you get the pie. > Sure, but hasn't the default stayed unchanged? > > It seems like you have to enable ASLR first before you see all the > breakage. Right now it seems like goal was to document what even > compiles versus doesn't compile with ASLR. Afaik there is not setting > of ASLR on by default. > FWIW, and with huge respect to the people working on it, I have come to the conclusion that ASLR is useless. The fact that MS and Apple enable it now by default is not really a point in favor of the technology as the workarounds became popular and finer randomization won't help[1]. I am also worried about the performance: Redhat created PIE but backpedaled when they noticed the performance impact and AFAICT only use PIE in a restricted set of binaries. I would like to see these as an option but I don't think it should ever be made the default. Yes, I am aware these patches don't turn anything by default but I (and probably others) am suspecting such a switch may be thrown upon us without much discussion. > There has to be a way to call out what works and what doesn't work and > form a transition from a world with no ASLR to one with some ASLR and > eventually one with almost entirely ASLR coverage. I'm not sure it can > be done in one fell swoop. Hooks like this in -current allow for this > to be done as a group effort. > > It would be very unlikely that we retain the semantics all the way until > a -stable release. > I am not (yet) criticizing the patches to the build system as I want to preserve my innocence ;) ... but perhaps if the semantics are not finalized this should be done in a branch. It is my opinion that in general we are not using SVN branches as much as we should. Pedro. For reference: [1] http://youtu.be/dkZ9zdSRQYM From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 20:34:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D88E6EB5; Sun, 8 Jun 2014 20:34:10 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id BF1DA26B1; Sun, 8 Jun 2014 20:34:10 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id A52FE1A3C1C; Sun, 8 Jun 2014 13:34:09 -0700 (PDT) Message-ID: <5394C8C5.1090401@mu.org> Date: Sun, 08 Jun 2014 13:34:13 -0700 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Pedro Giffuni , Konstantin Belousov Subject: Re: svn commit: r267233 - in head: . bin/rmail gnu/usr.bin/binutils/addr2line gnu/usr.bin/binutils/nm gnu/usr.bin/binutils/objcopy gnu/usr.bin/binutils/objdump gnu/usr.bin/binutils/readelf gnu/usr.bin/... References: <201406081729.s58HTWkc006213@svn.freebsd.org> <74512A27-DD5F-4D43-BFA1-0AC04E0D08B4@FreeBSD.org> <20140608182728.GX3991@kib.kiev.ua> <5394ABD2.5040009@mu.org> <20140608184451.GZ3991@kib.kiev.ua> <5394B607.1000109@mu.org> <5394C3D8.7040800@FreeBSD.org> In-Reply-To: <5394C3D8.7040800@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bryan Drewery X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 20:34:11 -0000 On 6/8/14 1:13 PM, Pedro Giffuni wrote: > Hello; > > El 6/8/2014 2:14 PM, Alfred Perlstein escribió: >> >> There has to be a way to call out what works and what doesn't work and >> form a transition from a world with no ASLR to one with some ASLR and >> eventually one with almost entirely ASLR coverage. I'm not sure it can >> be done in one fell swoop. Hooks like this in -current allow for this >> to be done as a group effort. >> >> It would be very unlikely that we retain the semantics all the way until >> a -stable release. >> > > I am not (yet) criticizing the patches to the build system as I want > to preserve my innocence ;) ... but perhaps if the semantics are not > finalized this should be done in a branch. It is my opinion that in > general we are not using SVN branches as much as we should. > IMO branching is great for something that causes instability, known performance issues or won't build. This is not the same as "changes build system". Putting things like this on branches is likely a good way to imo kill discussion. Right now we have discussion, it's rather healthy. Let's take a while to think about this before saying this all should be done in a branch. -Alfred From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 20:49:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC1F473B; Sun, 8 Jun 2014 20:49:56 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69ECF27AD; Sun, 8 Jun 2014 20:49:56 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s58KnpLu094225; Sun, 8 Jun 2014 23:49:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s58KnpLu094225 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.8/Submit) id s58KnpWP094224; Sun, 8 Jun 2014 23:49:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 8 Jun 2014 23:49:50 +0300 From: Konstantin Belousov To: Alfred Perlstein Subject: Re: svn commit: r267233 - in head: . bin/rmail gnu/usr.bin/binutils/addr2line gnu/usr.bin/binutils/nm gnu/usr.bin/binutils/objcopy gnu/usr.bin/binutils/objdump gnu/usr.bin/binutils/readelf gnu/usr.bin/... Message-ID: <20140608204950.GC3991@kib.kiev.ua> References: <201406081729.s58HTWkc006213@svn.freebsd.org> <74512A27-DD5F-4D43-BFA1-0AC04E0D08B4@FreeBSD.org> <20140608182728.GX3991@kib.kiev.ua> <5394ABD2.5040009@mu.org> <20140608184451.GZ3991@kib.kiev.ua> <5394B607.1000109@mu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SuZWD+5recMkC1v4" Content-Disposition: inline In-Reply-To: <5394B607.1000109@mu.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bryan Drewery X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 20:49:56 -0000 --SuZWD+5recMkC1v4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 08, 2014 at 12:14:15PM -0700, Alfred Perlstein wrote: > On 6/8/14 11:44 AM, Konstantin Belousov wrote: > > On Sun, Jun 08, 2014 at 11:30:42AM -0700, Alfred Perlstein wrote: > >> On 6/8/14 11:27 AM, Konstantin Belousov wrote: > >>> On Sun, Jun 08, 2014 at 05:38:49PM +0000, Bjoern A. Zeeb wrote: > >>>> On 08 Jun 2014, at 17:29 , Bryan Drewery wrot= e: > >>>> > >>>>> Author: bdrewery > >>>>> Date: Sun Jun 8 17:29:31 2014 > >>>>> New Revision: 267233 > >>>>> URL: http://svnweb.freebsd.org/changeset/base/267233 > >>>>> > >>>>> Log: > >>>>> In preparation for ASLR [1] support add WITH_PIE to support buil= ding with -fPIE. > >>>>> > >>>>> This is currently an opt-in build flag. Once ASLR support is rea= dy and stable > >>>>> it should changed to opt-out and be enabled by default along wit= h ASLR. > >>>>> > >>>>> Each application Makefile uses opt-out to ensure that ASLR will = be enabled by > >>>>> default in new directories when the system is compiled with PIE/= ASLR. [2] > >>>>> > >>>>> Mark known build failures as NO_PIE for now. > >>>> No, no, no, no more NOs! > >>>> > >>>> I?ll leave it to others who understand the current build system in d= ays when it?s not broken to fix this entire splattering across all these Ma= kefiles; we really need a better way for this. > >>> I have no words to express my dissatisfaction with this commit. > >>> If change to the build of _some_ usermode binaries require patching > >>> of loader', csu and rtld Makefiles, obviously it is done wrong. > >>> > >>> Why almost half of the binaries require opt-out ? > >>> > >>> PLEASE REVERT THIS. > >> Wait. Does this not serve as a useful stake in the ground for people = to > >> come in and update things? Instead of asking to back out, shouldn't we > >> be doing an announcement "ok folks, it's now time to fix this!" and mo= ve > >> forward? Otherwise we may never get any pie. > > Let me reformulate. > > > > Somebody commits broken change, despite it was pointed out by many > > before the commit. From the changes it is obvious that people which > > proposed it do not understand what they hack on. And then, somebody else > > must run and 'fix' previously non-broken code. > > > > Sure, you get the pie. > Sure, but hasn't the default stayed unchanged? No, they were changed, in very buggy and unuseful way, which is indicated by the need to modify the Makefiles for the completely unrelated things which I listed before. The change modified the VA layout of all affected binaries, and also added overhead of relocation to the previously fixed-mapped binaries. >=20 > It seems like you have to enable ASLR first before you see all the=20 > breakage. Right now it seems like goal was to document what even=20 > compiles versus doesn't compile with ASLR. Afaik there is not setting=20 > of ASLR on by default. The change of binaries to the shared objects, which was done by the discussing commit, is not about ASLR. It is required to get that snake oil to function, but by itself it is not ASLR. And no, it is not about what works/does not work with ASLR. Seemingly, it is about what the authors were able to mangle, or not able. E.g., FreeBSD cannot execute static 'binaries' compiled with PIE, since our csu does not perform relocations. So whatever is changed by a knob to become static (WITHOUT_SHARED_ROOT or how is it called now) is plain broken after the commit, if the knob is tweaked. Similarly, if something becomes shared-linked by knob (WITHOUT_STATIC_TOOLCHAIN ?) the NO_PIE is not needed. That said, the change is wrong on its principle. >=20 > There has to be a way to call out what works and what doesn't work and=20 > form a transition from a world with no ASLR to one with some ASLR and=20 > eventually one with almost entirely ASLR coverage. I'm not sure it can= =20 > be done in one fell swoop. Hooks like this in -current allow for this=20 > to be done as a group effort. >=20 > It would be very unlikely that we retain the semantics all the way until= =20 > a -stable release. I do not understand this two paragraphs at all. --SuZWD+5recMkC1v4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJTlMxuAAoJEJDCuSvBvK1BDq0QAKilZ+CtzFLJAUnVE/NcNoRO OF3zcbXeLMZtKcYK9zmj5TKVn0woeUFKR2R7Jc+W6Y2Vsusx19PtM/4Zjfe9b/fN rfgcYuSklI7nKgbkwwURp62pJlMONJqiCwNou9iy2hhMW+igWro3C11YjPGMEbm6 8hl3UMiEMtmrpMEz7H/Kecod365Rv6NZcRuJeLfEkB7iFatyse5pTGNg7FJFdYUT CKNxTDDbjnJhd4RBKwbqyFiwa417Vzb44HqHrYQUArNoKkmfoK9n0n4epVGCMoXE RaUPj7PUoRpguTtHawYuNR6LTte6pY9NhBwAfBOEdvPDAdyJ6JlR10HY1X7M0h88 qrQz+XWL4nq/Jml0fruPkOt9doEHYb2O0saxvNfySWWKitngKbEHtOBO8xmdLiLv lfD/U887NSiwm05V9DrQ3wAW/vmI9yE58bHbSnuyd36EWC4pLV2kxWoslHFl524d jxwCxEC730oX14mV10unhO2JUbDBh5Sn+aTv1VOKdMSa8w/z38CdpD8fA2U/jzgB xwFbLL9KJ/XJQzVe9L83blLEGpP5WouHQfaATwoaRl19KF7QIgibx/eSVDuXc2RC i+s9x+2Qda3uyFRB3V3UtAABas5W533KWBJ4KLi57IYgcRWZVVAFza6eIxEXSWz5 TR7+7b6L8thjF64LVcVs =mNXH -----END PGP SIGNATURE----- --SuZWD+5recMkC1v4-- From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 21:18:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15201C63 for ; Sun, 8 Jun 2014 21:18:51 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E587C29BE for ; Sun, 8 Jun 2014 21:18:50 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s58LIoM5061679 for ; Sun, 8 Jun 2014 21:18:50 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s58LIoRM061673 for svn-src-head@freebsd.org; Sun, 8 Jun 2014 21:18:50 GMT (envelope-from bdrewery) Received: (qmail 28431 invoked from network); 8 Jun 2014 16:18:48 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 8 Jun 2014 16:18:48 -0500 Message-ID: <5394D331.80603@FreeBSD.org> Date: Sun, 08 Jun 2014 16:18:41 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 Subject: Re: svn commit: r267233 - in head: . bin/rmail gnu/usr.bin/binutils/addr2line gnu/usr.bin/binutils/nm gnu/usr.bin/binutils/objcopy gnu/usr.bin/binutils/objdump gnu/usr.bin/binutils/readelf gnu/usr.bin/... References: <201406081729.s58HTWkc006213@svn.freebsd.org> <74512A27-DD5F-4D43-BFA1-0AC04E0D08B4@FreeBSD.org> <20140608182728.GX3991@kib.kiev.ua> <5394ABD2.5040009@mu.org> <20140608184451.GZ3991@kib.kiev.ua> In-Reply-To: <20140608184451.GZ3991@kib.kiev.ua> X-Enigmail-Version: 1.6 OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="r25QU50au8l4hKtPvcHnGKfAlC4e81hKq" Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 21:18:51 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --r25QU50au8l4hKtPvcHnGKfAlC4e81hKq Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 6/8/2014 1:44 PM, Konstantin Belousov wrote: > On Sun, Jun 08, 2014 at 11:30:42AM -0700, Alfred Perlstein wrote: >> On 6/8/14 11:27 AM, Konstantin Belousov wrote: >>> On Sun, Jun 08, 2014 at 05:38:49PM +0000, Bjoern A. Zeeb wrote: >>>> On 08 Jun 2014, at 17:29 , Bryan Drewery wrot= e: >>>> >>>>> Author: bdrewery >>>>> Date: Sun Jun 8 17:29:31 2014 >>>>> New Revision: 267233 >>>>> URL: http://svnweb.freebsd.org/changeset/base/267233 >>>>> >>>>> Log: >>>>> In preparation for ASLR [1] support add WITH_PIE to support build= ing with -fPIE. >>>>> >>>>> This is currently an opt-in build flag. Once ASLR support is read= y and stable >>>>> it should changed to opt-out and be enabled by default along with= ASLR. >>>>> >>>>> Each application Makefile uses opt-out to ensure that ASLR will b= e enabled by >>>>> default in new directories when the system is compiled with PIE/A= SLR. [2] >>>>> >>>>> Mark known build failures as NO_PIE for now. >>>> No, no, no, no more NOs! >>>> >>>> I?ll leave it to others who understand the current build system in d= ays when it?s not broken to fix this entire splattering across all these = Makefiles; we really need a better way for this. >>> I have no words to express my dissatisfaction with this commit. >>> If change to the build of _some_ usermode binaries require patching >>> of loader', csu and rtld Makefiles, obviously it is done wrong. >>> >>> Why almost half of the binaries require opt-out ? >>> >>> PLEASE REVERT THIS. >> Wait. Does this not serve as a useful stake in the ground for people = to=20 >> come in and update things? Instead of asking to back out, shouldn't w= e=20 >> be doing an announcement "ok folks, it's now time to fix this!" and mo= ve=20 >> forward? Otherwise we may never get any pie. >=20 > Let me reformulate. >=20 > Somebody commits broken change, despite it was pointed out by many > before the commit. From the changes it is obvious that people which > proposed it do not understand what they hack on. And then, somebody els= e > must run and 'fix' previously non-broken code. >=20 > Sure, you get the pie. >=20 Nothing here is broken by default. Nothing is broken with WITH_PIE enabled either. I will not revert this. It lays groundwork for ASLR support. No one has identified anything actually wrong with this commit. so@ made the call on making this OPT-OUT per Makefile. Not me or Shawn. The ASLR patches have been in public for review for 6 months or more now. You've all had opportunities to weigh in on them. I encourage more review on the ASLR patches themselves as well. The presentation at BSDCan was 100% positive by my account. Whether you think ASLR, or the implementation, is good or not doesn't matter much if you don't participate. We are the last OS to not have it and it does have benefits. --=20 Regards, Bryan Drewery --r25QU50au8l4hKtPvcHnGKfAlC4e81hKq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJTlNM2AAoJEDXXcbtuRpfPK0AH/jQngRW5r4RutgcGlmSmmjnB I2cuhwEnVDR5is3ife1N/Y0DVs0o9zi+s09CrcEVLKOLhzN6pOYSipCedzA8SSj6 4+ajePmXUfXENFZ136uy3TgGN8mMbBkHmR1lYLBQiOSCQw9qU2TX7GrILGbERX45 mVJUIYzw/89cU1l4cjI5ixU5Q8YbTlB+8B5nRQCrvjcLV2s5idXvtDGKDU2mecV4 GoASGwt1yzHOmnuoJe1RZGkYIjIC7Kf4n3XpSq3+weRRvgFNvNtczlwNtpXaiwpO hEryp4Tty+Prb7B9hYN+NTnBdiaEb0FEVLG4bX8Ls8cJT37LETAyqRLP0CgGAUo= =z4va -----END PGP SIGNATURE----- --r25QU50au8l4hKtPvcHnGKfAlC4e81hKq-- From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 21:28:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75A4F276 for ; Sun, 8 Jun 2014 21:28:36 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 558DA2A93 for ; Sun, 8 Jun 2014 21:28:36 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s58LSaLB065163 for ; Sun, 8 Jun 2014 21:28:36 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s58LSaEp065159 for svn-src-head@freebsd.org; Sun, 8 Jun 2014 21:28:36 GMT (envelope-from bdrewery) Received: (qmail 22177 invoked from network); 8 Jun 2014 16:28:34 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 8 Jun 2014 16:28:34 -0500 Message-ID: <5394D580.8060401@FreeBSD.org> Date: Sun, 08 Jun 2014 16:28:32 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r267233 - in head: . bin/rmail gnu/usr.bin/binutils/addr2line gnu/usr.bin/binutils/nm gnu/usr.bin/binutils/objcopy gnu/usr.bin/binutils/objdump gnu/usr.bin/binutils/readelf gnu/usr.bin/... References: <201406081729.s58HTWkc006213@svn.freebsd.org> In-Reply-To: <201406081729.s58HTWkc006213@svn.freebsd.org> X-Enigmail-Version: 1.6 OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ma3edj9oRwA0i5SUWckP43vFDhjtWwPre" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 21:28:36 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ma3edj9oRwA0i5SUWckP43vFDhjtWwPre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 6/8/2014 12:29 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Sun Jun 8 17:29:31 2014 > New Revision: 267233 > URL: http://svnweb.freebsd.org/changeset/base/267233 >=20 > Log: > In preparation for ASLR [1] support add WITH_PIE to support building = with -fPIE. > =20 > This is currently an opt-in build flag. Once ASLR support is ready an= d stable > it should changed to opt-out and be enabled by default along with ASL= R. > =20 > Each application Makefile uses opt-out to ensure that ASLR will be en= abled by > default in new directories when the system is compiled with PIE/ASLR.= [2] > =20 > Mark known build failures as NO_PIE for now. > =20 > The only known runtime failure was rtld. > =20 > [1] http://www.bsdcan.org/2014/schedule/events/452.en.html > Submitted by: Shawn Webb > Discussed between: des@ and Shawn Webb [2] >=20 =2E.. >=20 > Modified: head/share/mk/bsd.opts.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/mk/bsd.opts.mk Sun Jun 8 15:38:40 2014 (r267232) > +++ head/share/mk/bsd.opts.mk Sun Jun 8 17:29:31 2014 (r267233) > @@ -68,7 +68,8 @@ __DEFAULT_YES_OPTIONS =3D \ > __DEFAULT_NO_OPTIONS =3D \ > CTF \ > DEBUG_FILES \ > - INSTALL_AS_USER > + INSTALL_AS_USER \ > + PIE > =20 > .include > =20 In case you missed it. This commit is a NOP. By default PIE is not used. --=20 Regards, Bryan Drewery --ma3edj9oRwA0i5SUWckP43vFDhjtWwPre Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJTlNWBAAoJEDXXcbtuRpfPn2EIAKFnJjwQfja2QtvuBJc7zDSx B3NB2b4bijAp0KCBU2QRkADU5YHc3jNgF26qaXLD3HvlYaSeqhaS7exUkE78qAjQ Xs0L2sDe3aWep8coxp3mWFQlV3+ith+GCGP97JCL5Qkl/f/M3AslVlEespunJLcz rKWjF0xwatRG72Zo9vPhpQc6hIzytg4LQ+BCtxkYnL+QtuG/2x1PN4ySMmjJ7Z+O GohyOQ3icDulCx3l4bu+cfHlKEb/oQMEX6UW3Ky69LEej/1PgsuEupvWCQoy+PRf Hz8mQf7wdiLxf2Y437/6xw6sb394ZYcT8ArozQjTqDD7+nyTr79bZJeCdquYfsc= =qpLq -----END PGP SIGNATURE----- --ma3edj9oRwA0i5SUWckP43vFDhjtWwPre-- From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 21:37:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9A983F1 for ; Sun, 8 Jun 2014 21:37:02 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73A682B2B for ; Sun, 8 Jun 2014 21:37:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s58Lb2P3068615 for ; Sun, 8 Jun 2014 21:37:02 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s58Lb2Zm068606 for svn-src-head@freebsd.org; Sun, 8 Jun 2014 21:37:02 GMT (envelope-from bdrewery) Received: (qmail 99745 invoked from network); 8 Jun 2014 16:37:00 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 8 Jun 2014 16:37:00 -0500 Message-ID: <5394D77A.2070709@FreeBSD.org> Date: Sun, 08 Jun 2014 16:36:58 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Alfred Perlstein , Pedro Giffuni , Konstantin Belousov Subject: Re: svn commit: r267233 - in head: . bin/rmail gnu/usr.bin/binutils/addr2line gnu/usr.bin/binutils/nm gnu/usr.bin/binutils/objcopy gnu/usr.bin/binutils/objdump gnu/usr.bin/binutils/readelf gnu/usr.bin/... References: <201406081729.s58HTWkc006213@svn.freebsd.org> <74512A27-DD5F-4D43-BFA1-0AC04E0D08B4@FreeBSD.org> <20140608182728.GX3991@kib.kiev.ua> <5394ABD2.5040009@mu.org> <20140608184451.GZ3991@kib.kiev.ua> <5394B607.1000109@mu.org> <5394C3D8.7040800@FreeBSD.org> <5394C8C5.1090401@mu.org> In-Reply-To: <5394C8C5.1090401@mu.org> X-Enigmail-Version: 1.6 OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ViqOcF4GSFrGFvbtpNoKCKOqsnd8pHDvo" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 21:37:02 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ViqOcF4GSFrGFvbtpNoKCKOqsnd8pHDvo Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 6/8/2014 3:34 PM, Alfred Perlstein wrote: > On 6/8/14 1:13 PM, Pedro Giffuni wrote: >> Hello; >> >> El 6/8/2014 2:14 PM, Alfred Perlstein escribi=F3: >>> >>> There has to be a way to call out what works and what doesn't work an= d >>> form a transition from a world with no ASLR to one with some ASLR and= >>> eventually one with almost entirely ASLR coverage. I'm not sure it c= an >>> be done in one fell swoop. Hooks like this in -current allow for thi= s >>> to be done as a group effort. >>> >>> It would be very unlikely that we retain the semantics all the way un= til >>> a -stable release. >>> >> >> I am not (yet) criticizing the patches to the build system as I want >> to preserve my innocence ;) ... but perhaps if the semantics are not >> finalized this should be done in a branch. It is my opinion that in >> general we are not using SVN branches as much as we should. >> > IMO branching is great for something that causes instability, known > performance issues or won't build. This is not the same as "changes > build system". >=20 > Putting things like this on branches is likely a good way to imo kill > discussion. >=20 > Right now we have discussion, it's rather healthy. Let's take a while > to think about this before saying this all should be done in a branch. >=20 > -Alfred Yes doing this in a branch would be great if the 2 contributors doing all the work had bits, and if other people critical of their work would be willing to help as well. Alas we don't give bits in these cases so we're stuck with me proxying and them getting little feedback except the big demotivating message from this commit. --=20 Regards, Bryan Drewery --ViqOcF4GSFrGFvbtpNoKCKOqsnd8pHDvo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJTlNd6AAoJEDXXcbtuRpfP34MIALOy5CwSumR8BprsGlfmS0wy PG+Xa4FlgTNPrAINcrV0azQdFC5OfSjia+oP+H5mfgdK3ZNXQ6aWzgcXVDTkCAdW Q/9YBvsUSHyDjnVs6HPszCypubFn3LPqx/2ODsxVjoolhKVgDyI8of2hkJ0DosVz eESl9yujeWRE0+3nJKAuDXm1fisM0MrZ7evik6F0yKutRijnLVed1VPLiGGI3YB8 NaEvDnvWh7VJWZ/w3wnTes7Wq0l7FcewKKu9mC5gpsVlI4Ig1LMUqbQ7E3UxB09+ bbQvcxsI+fbbHL1QPVGCNMdJUVmFUWdmB+K9cZzAh79pMFY1HuOcDvwUqfNYDmA= =prkv -----END PGP SIGNATURE----- --ViqOcF4GSFrGFvbtpNoKCKOqsnd8pHDvo-- From owner-svn-src-head@FreeBSD.ORG Sun Jun 8 21:39:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52246550 for ; Sun, 8 Jun 2014 21:39:51 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D7BC2B3C for ; Sun, 8 Jun 2014 21:39:51 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s58LdoVO068866 for ; Sun, 8 Jun 2014 21:39:50 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s58Ldoka068858 for svn-src-head@freebsd.org; Sun, 8 Jun 2014 21:39:50 GMT (envelope-from bdrewery) Received: (qmail 26613 invoked from network); 8 Jun 2014 16:39:49 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 8 Jun 2014 16:39:49 -0500 Message-ID: <5394D823.60106@FreeBSD.org> Date: Sun, 08 Jun 2014 16:39:47 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Pedro Giffuni , Alfred Perlstein , Konstantin Belousov Subject: Re: svn commit: r267233 - in head: . bin/rmail gnu/usr.bin/binutils/addr2line gnu/usr.bin/binutils/nm gnu/usr.bin/binutils/objcopy gnu/usr.bin/binutils/objdump gnu/usr.bin/binutils/readelf gnu/usr.bin/... References: <201406081729.s58HTWkc006213@svn.freebsd.org> <74512A27-DD5F-4D43-BFA1-0AC04E0D08B4@FreeBSD.org> <20140608182728.GX3991@kib.kiev.ua> <5394ABD2.5040009@mu.org> <20140608184451.GZ3991@kib.kiev.ua> <5394B607.1000109@mu.org> <5394C3D8.7040800@FreeBSD.org> In-Reply-To: <5394C3D8.7040800@FreeBSD.org> X-Enigmail-Version: 1.6 OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XX6dQkPRTwcJmJ15NcOKnMWNuNTPWQ9nb" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 21:39:51 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --XX6dQkPRTwcJmJ15NcOKnMWNuNTPWQ9nb Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 6/8/2014 3:13 PM, Pedro Giffuni wrote: > Hello; >=20 > El 6/8/2014 2:14 PM, Alfred Perlstein escribi=F3: >> On 6/8/14 11:44 AM, Konstantin Belousov wrote: >>> On Sun, Jun 08, 2014 at 11:30:42AM -0700, Alfred Perlstein wrote: >>>> On 6/8/14 11:27 AM, Konstantin Belousov wrote: >>>>> On Sun, Jun 08, 2014 at 05:38:49PM +0000, Bjoern A. Zeeb wrote: >>>>>> On 08 Jun 2014, at 17:29 , Bryan Drewery >>>>>> wrote: >>>>>> >>>>>>> Author: bdrewery >>>>>>> Date: Sun Jun 8 17:29:31 2014 >>>>>>> New Revision: 267233 >>>>>>> URL: http://svnweb.freebsd.org/changeset/base/267233 >>>>>>> >>>>>>> Log: >>>>>>> In preparation for ASLR [1] support add WITH_PIE to support >>>>>>> building with -fPIE. >>>>>>> >>>>>>> This is currently an opt-in build flag. Once ASLR support is >>>>>>> ready and stable >>>>>>> it should changed to opt-out and be enabled by default along >>>>>>> with ASLR. >>>>>>> >>>>>>> Each application Makefile uses opt-out to ensure that ASLR wil= l >>>>>>> be enabled by >>>>>>> default in new directories when the system is compiled with >>>>>>> PIE/ASLR. [2] >>>>>>> >>>>>>> Mark known build failures as NO_PIE for now. >>>>>> No, no, no, no more NOs! >>>>>> >>>>>> I?ll leave it to others who understand the current build system in= >>>>>> days when it?s not broken to fix this entire splattering across al= l >>>>>> these Makefiles; we really need a better way for this. >>>>> I have no words to express my dissatisfaction with this commit. >>>>> If change to the build of _some_ usermode binaries require patching= >>>>> of loader', csu and rtld Makefiles, obviously it is done wrong. >>>>> >>>>> Why almost half of the binaries require opt-out ? >>>>> >>>>> PLEASE REVERT THIS. >>>> Wait. Does this not serve as a useful stake in the ground for >>>> people to >>>> come in and update things? Instead of asking to back out, shouldn't= we >>>> be doing an announcement "ok folks, it's now time to fix this!" and >>>> move >>>> forward? Otherwise we may never get any pie. >>> Let me reformulate. >>> >>> Somebody commits broken change, despite it was pointed out by many >>> before the commit. From the changes it is obvious that people which >>> proposed it do not understand what they hack on. And then, somebody e= lse >>> must run and 'fix' previously non-broken code. >>> >>> Sure, you get the pie. >> Sure, but hasn't the default stayed unchanged? >> >> It seems like you have to enable ASLR first before you see all the >> breakage. Right now it seems like goal was to document what even >> compiles versus doesn't compile with ASLR. Afaik there is not setting= >> of ASLR on by default. >> >=20 > FWIW, and with huge respect to the people working on it, I have come to= > the conclusion that ASLR is useless. The fact that MS and Apple enable > it now by default is not really a point in favor of the technology as > the workarounds became popular and finer randomization won't help[1]. >=20 > I am also worried about the performance: Redhat created PIE but > backpedaled when they noticed the performance impact and AFAICT only us= e > PIE in a restricted set of binaries. >=20 > I would like to see these as an option but I don't think it should ever= > be made the default. Yes, I am aware these patches don't turn anything > by default but I (and probably others) am suspecting such a switch may > be thrown upon us without much discussion. >=20 >=20 >> There has to be a way to call out what works and what doesn't work and= >> form a transition from a world with no ASLR to one with some ASLR and >> eventually one with almost entirely ASLR coverage. I'm not sure it ca= n >> be done in one fell swoop. Hooks like this in -current allow for this= >> to be done as a group effort. >> >> It would be very unlikely that we retain the semantics all the way unt= il >> a -stable release. >> >=20 > I am not (yet) criticizing the patches to the build system as I want to= > preserve my innocence ;) ... but perhaps if the semantics are not > finalized this should be done in a branch. It is my opinion that in > general we are not using SVN branches as much as we should. >=20 > Pedro. >=20 > For reference: >=20 > [1] http://youtu.be/dkZ9zdSRQYM Yes there are performance implications. No, the default of PIE and ASLR won't be done without discussion. --=20 Regards, Bryan Drewery --XX6dQkPRTwcJmJ15NcOKnMWNuNTPWQ9nb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJTlNgjAAoJEDXXcbtuRpfPMf8IAKDs8yr/m+J2CzChPgve4pSX TQMy57Vcd/7y8w4jTYZ6ANXqpg98ZlwDh0PFHZJYqfxnECCvV8iJie5uX7+ogUbs a+wDt58+4MxY6EpYyE7prw6BYJLUTEmHp07yPQjWHRRPydxkkH+kk0uVcfFXefNz sB7hxtg8mA8cIw/wrfuRXZS5rpxl6im5gIww1Yxgq15gyHM61vgVR763b3OugOG3 NSe7FhtbFttD8zBxlGGRC/mAJkUTDWXedTUCmDBbuaVYd6h5pm09ZWDmnRVdsrqs jHSch/3YQWM9NbZiPbFTOHe8PazlpzCC0ohmxDYxYZY5GbemSpN9nAfT1/xJ2J4= =QG+C -----END PGP SIGNATURE----- --XX6dQkPRTwcJmJ15NcOKnMWNuNTPWQ9nb-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 00:15:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8995BDF6; Mon, 9 Jun 2014 00:15:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 779DD264A; Mon, 9 Jun 2014 00:15:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s590FGfB046876; Mon, 9 Jun 2014 00:15:16 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s590FGZT046875; Mon, 9 Jun 2014 00:15:16 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201406090015.s590FGZT046875@svn.freebsd.org> From: Alan Cox Date: Mon, 9 Jun 2014 00:15:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267245 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 00:15:16 -0000 Author: alc Date: Mon Jun 9 00:15:16 2014 New Revision: 267245 URL: http://svnweb.freebsd.org/changeset/base/267245 Log: Refresh a comment. The VM_STACK option was eliminated in r43209. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Sun Jun 8 23:22:25 2014 (r267244) +++ head/sys/kern/kern_exec.c Mon Jun 9 00:15:16 2014 (r267245) @@ -1101,9 +1101,9 @@ exec_new_vmspace(imgp, sv) return (error); #endif - /* vm_ssize and vm_maxsaddr are somewhat antiquated concepts in the - * VM_STACK case, but they are still used to monitor the size of the - * process stack so we can check the stack rlimit. + /* + * vm_ssize and vm_maxsaddr are somewhat antiquated concepts, but they + * are still used to enforce the stack rlimit on the process stack. */ vmspace->vm_ssize = sgrowsiz >> PAGE_SHIFT; vmspace->vm_maxsaddr = (char *)sv->sv_usrstack - ssiz; From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 01:54:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55996F25; Mon, 9 Jun 2014 01:54:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 434A72CCF; Mon, 9 Jun 2014 01:54:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s591s1qg091858; Mon, 9 Jun 2014 01:54:01 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s591s18T091857; Mon, 9 Jun 2014 01:54:01 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201406090154.s591s18T091857@svn.freebsd.org> From: Eitan Adler Date: Mon, 9 Jun 2014 01:54:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267248 - head/usr.sbin/acpi/acpiconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 01:54:01 -0000 Author: eadler Date: Mon Jun 9 01:54:00 2014 New Revision: 267248 URL: http://svnweb.freebsd.org/changeset/base/267248 Log: acpiconf(8): document 'k' option Add missing documentation for the 'k' option based on reading the source code. Modified: head/usr.sbin/acpi/acpiconf/acpiconf.8 Modified: head/usr.sbin/acpi/acpiconf/acpiconf.8 ============================================================================== --- head/usr.sbin/acpi/acpiconf/acpiconf.8 Mon Jun 9 01:39:47 2014 (r267247) +++ head/usr.sbin/acpi/acpiconf/acpiconf.8 Mon Jun 9 01:54:00 2014 (r267248) @@ -37,6 +37,7 @@ .Nm .Op Fl h .Op Fl i Ar batt +.Op Fl k Ar ack .Op Fl s Ar type .Sh DESCRIPTION The @@ -49,6 +50,8 @@ The following command-line options are r Displays a summary of available options. .It Fl i Ar batt Get design information about the specified battery. +.It Fl k Ar ack +Ack or abort a pending suspend request using the argument provided. .It Fl s Ar type Enters the specified sleep mode. Recognized types are From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 02:00:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77DF311B; Mon, 9 Jun 2014 02:00:08 +0000 (UTC) Date: Sun, 8 Jun 2014 22:00:03 -0400 From: Glen Barber To: Eitan Adler Subject: Re: svn commit: r267248 - head/usr.sbin/acpi/acpiconf Message-ID: <20140609020003.GI33882@hub.FreeBSD.org> References: <201406090154.s591s18T091857@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="QHrz2k/ePFTn56xd" Content-Disposition: inline In-Reply-To: <201406090154.s591s18T091857@svn.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 02:00:09 -0000 --QHrz2k/ePFTn56xd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 09, 2014 at 01:54:01AM +0000, Eitan Adler wrote: > Author: eadler > Date: Mon Jun 9 01:54:00 2014 > New Revision: 267248 > URL: http://svnweb.freebsd.org/changeset/base/267248 >=20 > Log: > acpiconf(8): document 'k' option > =20 > Add missing documentation for the 'k' option based on reading the sour= ce > code. >=20 > Modified: > head/usr.sbin/acpi/acpiconf/acpiconf.8 >=20 > Modified: head/usr.sbin/acpi/acpiconf/acpiconf.8 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/acpi/acpiconf/acpiconf.8 Mon Jun 9 01:39:47 2014 (r267= 247) > +++ head/usr.sbin/acpi/acpiconf/acpiconf.8 Mon Jun 9 01:54:00 2014 (r267= 248) > @@ -37,6 +37,7 @@ > .Nm > .Op Fl h > .Op Fl i Ar batt > +.Op Fl k Ar ack > .Op Fl s Ar type > .Sh DESCRIPTION > The > @@ -49,6 +50,8 @@ The following command-line options are r > Displays a summary of available options. > .It Fl i Ar batt > Get design information about the specified battery. > +.It Fl k Ar ack > +Ack or abort a pending suspend request using the argument provided. > .It Fl s Ar type > Enters the specified sleep mode. > Recognized types are =2EDd missed. Glen --QHrz2k/ePFTn56xd Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBCAAGBQJTlRUjAAoJELls3eqvi17Q2gAP/1N+zGSOPaAKdJ41zNIwjoZx SIXfkG/N1wnnuIswidL6ltd3lcNgbaNphsNpuA2ptONf1GZtprXQC4yvr/iRNNEb A5JADO8aWWxYtQfABRhuMQ9xoK9uob5ptzB59WaoelcSLtdDzh5nBt9sqDYRxP/5 HKGBkFrXb3AYw/7CEcn5cytzllBZJK3fG1bamgIfioemQPg1YIWUDV/QGrU0gqXw nWYFprMaLc1H7iiJBdaYuyZ6b4MJsOdaGolzgxRPbYhoKa8ZhDH+EGRdtWQqF7ZO +wdMli6plXb3VujVrAAhZcWC+yh406+7a5RLx0HfSXsVKt+SVfCnyYUylBFrZQNq h9qgxVPuwVKmOSBVciaIwddZzT9TguBq3LheUoRu+khrhaH04v57MI4hBzjLKm1Z 9eEehMysB4Jg9n4ka5YJBUEiWrOOKZZ+iIredCKNQJV4pdwgigoAX5oGszVyIqq1 UHlA3xd3lRzAUbwZlcccR2APifNjPKwLhUeBevcluWSIfwTwqCDNscwB6aoCbi9N yqeAC734P0YSE2xbXBZKsPCI7rswRhSPBRoN9dbHeD4VQzXfg0E6pQolBLmtA150 ObyVvWEGHhWnBuaMJxQKVmiR0+ZsjC9NAmADV0oAMfqb368ulxDcMWjChp9A6zuT rt8YjkS95U9CcHJ3B80C =YP7D -----END PGP SIGNATURE----- --QHrz2k/ePFTn56xd-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 02:13:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECE043D2 for ; Mon, 9 Jun 2014 02:13:05 +0000 (UTC) Received: from nm22-vm1.bullet.mail.bf1.yahoo.com (nm22-vm1.bullet.mail.bf1.yahoo.com [98.139.212.127]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9822E2E1D for ; Mon, 9 Jun 2014 02:13:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1402279977; bh=wFgoeXna4LKHQ1hCW3pHZWOKtXvMIUEq5uWJr30LWyc=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:Organization:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=YLZ69Fm1yhCaaA3KErwQ8HEwChKCkW6hf8q0zS0Xs0+VczfnJNiPPIJBrovMopMzItjbG78XJUDvnKi3VA/uMI60raEJ6xsWfSAGomdrMhj8D4MGFEsKkU6kwxRnvbaswmurymkYFPrfS0F/PsNDBL7lfPE9pfuJOt9Imf/g7cgzYocjjZpJZm5KHUkVDJ49V0neYfy0GKQnFL99PUCk6tHzHNNwaazd/lHUwzOM2D+4uRlMli9IkQLGZjJsu0dmRonEdF0wLKfxXfG7B/5ScfQcz8sCvlB3e2e9gUvKNfcmaUHQwEqSVb4O7ayBh8SJVjyw3aZ1iXw3nLxWEieeOw== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=gt2Uz2dYyRMVc8GNOwFiMEdM91Cb1C/PTDn1VBrKAjysFtjPhZkvfWjynKPZ2VPlV9K43sCqek+gyAy9nift+8YCKramYBHAbiBX1VSEFLWAqYyMPm072Wcnf9fBrlZVkj1pnXKh9pGcVnexXygl+GvtJjrrG/TFV5brceLQttEuH1sHGmOLbOqkFTcmOYJ6yshvMtX8oVVpJejTEF8ou1TSvFm+YzmKB6Nay4HRO4DheAbUtzynpQEz4XcO/GHW79iuXAuDlCmNm6rX/yx1bdqbWRuy5BhjxMkKUT4bPnTm3lSRkX6NUVWvrzgApXXogGux1c7c/30SLN+sYQEwkQ==; Received: from [98.139.215.141] by nm22.bullet.mail.bf1.yahoo.com with NNFMP; 09 Jun 2014 02:12:57 -0000 Received: from [68.142.230.74] by tm12.bullet.mail.bf1.yahoo.com with NNFMP; 09 Jun 2014 02:12:56 -0000 Received: from [127.0.0.1] by smtp231.mail.bf1.yahoo.com with NNFMP; 09 Jun 2014 02:12:56 -0000 X-Yahoo-Newman-Id: 877221.22808.bm@smtp231.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 5OBs58QVM1mp1YSVf_rfA3oMUdR.3ta_19lDG9yagK76_q1 5Cm2IeHE1mTYomiA.YDxg9GBOJERxH8d0igIC7cI7Swx1RqhlHgR6O2tnBLn liQStvAc191m93rjWSg.W.e_XVe7U_yhr3Ynt59P.gaTzDq8miA76gdAxqm5 QDgfs4sVtPSxrG_tUyFny.YKcyxcG7QFVIG.FEGXaPD_k2_FqiHx0txtgMN1 3TCZ.3XXfCWnu1rDqdb4QXCSwHPAAuaOI1fjgWYiU1aPBbqIc1ShDnNo3CLf Arwk5XeQ7KmWmIOv59RBmdrWce6nxRnpVKDHZFuoqEEQMp0BvxTo4V4hor6d ukXLejusnR_Wtf8yeysduOEbvUwwBmDUZ6WnTlx3YykyAyzNLUuAVdjxDC1I 6lp0J3Y55J73lNDsd_VLNRuGnqcmyrUzs5IoI8oRDZwzC_gTnPXummMMh4lu E3QHSzOXsX69RLl2mbaVa7rji0P2wxkWwqJCxwe3NzvxL9eDddNw.8VZBQWS pCsAHZF4cbxd9bjuWlVMf1EGGaNz0Vlpz0aNh.gPG3AGbl3BBQu20YJi85v7 O61y8_MP5oNCyugurNuLhZ7LKoLqcdj2S X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain [98.139.211.125]) by smtp231.mail.bf1.yahoo.com with SMTP; 09 Jun 2014 02:12:56 +0000 UTC Message-ID: <53951828.6030200@FreeBSD.org> Date: Sun, 08 Jun 2014 21:12:56 -0500 From: Pedro Giffuni Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Bryan Drewery , Alfred Perlstein , Konstantin Belousov Subject: Re: svn commit: r267233 - in head: . bin/rmail gnu/usr.bin/binutils/addr2line gnu/usr.bin/binutils/nm gnu/usr.bin/binutils/objcopy gnu/usr.bin/binutils/objdump gnu/usr.bin/binutils/readelf gnu/usr.bin/... References: <201406081729.s58HTWkc006213@svn.freebsd.org> <74512A27-DD5F-4D43-BFA1-0AC04E0D08B4@FreeBSD.org> <20140608182728.GX3991@kib.kiev.ua> <5394ABD2.5040009@mu.org> <20140608184451.GZ3991@kib.kiev.ua> <5394B607.1000109@mu.org> <5394C3D8.7040800@FreeBSD.org> <5394D823.60106@FreeBSD.org> In-Reply-To: <5394D823.60106@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 02:13:06 -0000 El 6/8/2014 4:39 PM, Bryan Drewery escribió: > On 6/8/2014 3:13 PM, Pedro Giffuni wrote: >> Hello; >> >> El 6/8/2014 2:14 PM, Alfred Perlstein escribió: >>> On 6/8/14 11:44 AM, Konstantin Belousov wrote: >>>> On Sun, Jun 08, 2014 at 11:30:42AM -0700, Alfred Perlstein wrote: >>>>> On 6/8/14 11:27 AM, Konstantin Belousov wrote: >>>>>> On Sun, Jun 08, 2014 at 05:38:49PM +0000, Bjoern A. Zeeb wrote: >>>>>>> On 08 Jun 2014, at 17:29 , Bryan Drewery >>>>>>> wrote: >>>>>>> >>>>>>>> Author: bdrewery >>>>>>>> Date: Sun Jun 8 17:29:31 2014 >>>>>>>> New Revision: 267233 >>>>>>>> URL: http://svnweb.freebsd.org/changeset/base/267233 >>>>>>>> >>>>>>>> Log: >>>>>>>> In preparation for ASLR [1] support add WITH_PIE to support >>>>>>>> building with -fPIE. >>>>>>>> >>>>>>>> This is currently an opt-in build flag. Once ASLR support is >>>>>>>> ready and stable >>>>>>>> it should changed to opt-out and be enabled by default along >>>>>>>> with ASLR. >>>>>>>> >>>>>>>> Each application Makefile uses opt-out to ensure that ASLR will >>>>>>>> be enabled by >>>>>>>> default in new directories when the system is compiled with >>>>>>>> PIE/ASLR. [2] >>>>>>>> >>>>>>>> Mark known build failures as NO_PIE for now. >>>>>>> No, no, no, no more NOs! >>>>>>> >>>>>>> I?ll leave it to others who understand the current build system in >>>>>>> days when it?s not broken to fix this entire splattering across all >>>>>>> these Makefiles; we really need a better way for this. >>>>>> I have no words to express my dissatisfaction with this commit. >>>>>> If change to the build of _some_ usermode binaries require patching >>>>>> of loader', csu and rtld Makefiles, obviously it is done wrong. >>>>>> >>>>>> Why almost half of the binaries require opt-out ? >>>>>> >>>>>> PLEASE REVERT THIS. >>>>> Wait. Does this not serve as a useful stake in the ground for >>>>> people to >>>>> come in and update things? Instead of asking to back out, shouldn't we >>>>> be doing an announcement "ok folks, it's now time to fix this!" and >>>>> move >>>>> forward? Otherwise we may never get any pie. >>>> Let me reformulate. >>>> >>>> Somebody commits broken change, despite it was pointed out by many >>>> before the commit. From the changes it is obvious that people which >>>> proposed it do not understand what they hack on. And then, somebody else >>>> must run and 'fix' previously non-broken code. >>>> >>>> Sure, you get the pie. >>> Sure, but hasn't the default stayed unchanged? >>> >>> It seems like you have to enable ASLR first before you see all the >>> breakage. Right now it seems like goal was to document what even >>> compiles versus doesn't compile with ASLR. Afaik there is not setting >>> of ASLR on by default. >>> >> >> FWIW, and with huge respect to the people working on it, I have come to >> the conclusion that ASLR is useless. The fact that MS and Apple enable >> it now by default is not really a point in favor of the technology as >> the workarounds became popular and finer randomization won't help[1]. >> >> I am also worried about the performance: Redhat created PIE but >> backpedaled when they noticed the performance impact and AFAICT only use >> PIE in a restricted set of binaries. >> >> I would like to see these as an option but I don't think it should ever >> be made the default. Yes, I am aware these patches don't turn anything >> by default but I (and probably others) am suspecting such a switch may >> be thrown upon us without much discussion. >> >> >>> There has to be a way to call out what works and what doesn't work and >>> form a transition from a world with no ASLR to one with some ASLR and >>> eventually one with almost entirely ASLR coverage. I'm not sure it can >>> be done in one fell swoop. Hooks like this in -current allow for this >>> to be done as a group effort. >>> >>> It would be very unlikely that we retain the semantics all the way until >>> a -stable release. >>> >> >> I am not (yet) criticizing the patches to the build system as I want to >> preserve my innocence ;) ... but perhaps if the semantics are not >> finalized this should be done in a branch. It is my opinion that in >> general we are not using SVN branches as much as we should. >> >> Pedro. >> >> For reference: >> >> [1] http://youtu.be/dkZ9zdSRQYM > > Yes there are performance implications. No, the default of PIE and ASLR > won't be done without discussion. > Sounds fair enough for me, thanks! For the record, despite my general disagreement around making it default, I do appreciate the enthusiasm with which Shawn and Oliver are taking these security enhancement projects and Bryan's willingness to wear the asbestos pants here. Pedro. From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 02:39:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39490B48; Mon, 9 Jun 2014 02:39:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26D292FBE; Mon, 9 Jun 2014 02:39:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s592d6Ih011004; Mon, 9 Jun 2014 02:39:06 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s592d6rU011003; Mon, 9 Jun 2014 02:39:06 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201406090239.s592d6rU011003@svn.freebsd.org> From: Bryan Venteicher Date: Mon, 9 Jun 2014 02:39:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267252 - head/sys/dev/vmware/vmxnet3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 02:39:06 -0000 Author: bryanv Date: Mon Jun 9 02:39:05 2014 New Revision: 267252 URL: http://svnweb.freebsd.org/changeset/base/267252 Log: Remove an unnecessary variable reassignment And it would be bad if 'm' was different from '*m0' at this point, since we've already populated the SG list. MFC after: 3 days Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmx.c Mon Jun 9 02:33:39 2014 (r267251) +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Mon Jun 9 02:39:05 2014 (r267252) @@ -2757,7 +2757,7 @@ vmxnet3_txq_encap(struct vmxnet3_txqueue } } - txr->vxtxr_txbuf[txr->vxtxr_head].vtxb_m = m = *m0; + txr->vxtxr_txbuf[txr->vxtxr_head].vtxb_m = m; sop = &txr->vxtxr_txd[txr->vxtxr_head]; gen = txr->vxtxr_gen ^ 1; /* Owned by cpu (yet) */ From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 02:45:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5526AE18; Mon, 9 Jun 2014 02:45:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 423A4207A; Mon, 9 Jun 2014 02:45:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s592jsqC015202; Mon, 9 Jun 2014 02:45:54 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s592jspf015201; Mon, 9 Jun 2014 02:45:54 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201406090245.s592jspf015201@svn.freebsd.org> From: Bryan Venteicher Date: Mon, 9 Jun 2014 02:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267253 - head/sys/dev/vmware/vmxnet3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 02:45:54 -0000 Author: bryanv Date: Mon Jun 9 02:45:53 2014 New Revision: 267253 URL: http://svnweb.freebsd.org/changeset/base/267253 Log: Fix TSO support on VMware Fusion Apparently for VMware Fusion (and presumably VMware Workstation/Player since the PR states TSO is broken there too, but I cannot test), the TCP header pseudo checksum calculated should only include the protocol (IPPROTO_TCP) value, not also the lengths as the stack does instead. VMware ESXi seems to ignore whatever value is in the TCP header checksum, and it is a bit surprising there is a different behavior between the VMware products. And it is unfortunate that on ESXi we are forced to do this extra bit of work. PR: kern/185849 MFC after: 3 days Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmx.c Mon Jun 9 02:39:05 2014 (r267252) +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Mon Jun 9 02:45:53 2014 (r267253) @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -2604,6 +2606,12 @@ vmxnet3_txq_offload_ctx(struct vmxnet3_t { struct ether_vlan_header *evh; int offset; +#if defined(INET) + struct ip *ip, iphdr; +#endif +#if defined(INET6) + struct ip6_hdr *ip6, ip6hdr; +#endif evh = mtod(m, struct ether_vlan_header *); if (evh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { @@ -2617,8 +2625,7 @@ vmxnet3_txq_offload_ctx(struct vmxnet3_t switch (*etype) { #if defined(INET) - case ETHERTYPE_IP: { - struct ip *ip, iphdr; + case ETHERTYPE_IP: if (__predict_false(m->m_len < offset + sizeof(struct ip))) { m_copydata(m, offset, sizeof(struct ip), (caddr_t) &iphdr); @@ -2628,10 +2635,16 @@ vmxnet3_txq_offload_ctx(struct vmxnet3_t *proto = ip->ip_p; *start = offset + (ip->ip_hl << 2); break; - } #endif #if defined(INET6) case ETHERTYPE_IPV6: + if (__predict_false(m->m_len < + offset + sizeof(struct ip6_hdr))) { + m_copydata(m, offset, sizeof(struct ip6_hdr), + (caddr_t) &ip6hdr); + ip6 = &ip6hdr; + } else + ip6 = mtodo(m, offset); *proto = -1; *start = ip6_lasthdr(m, offset, IPPROTO_IPV6, proto); /* Assert the network stack sent us a valid packet. */ @@ -2646,6 +2659,7 @@ vmxnet3_txq_offload_ctx(struct vmxnet3_t if (m->m_pkthdr.csum_flags & CSUM_TSO) { struct tcphdr *tcp, tcphdr; + uint16_t sum; if (__predict_false(*proto != IPPROTO_TCP)) { /* Likely failed to correctly parse the mbuf. */ @@ -2654,16 +2668,38 @@ vmxnet3_txq_offload_ctx(struct vmxnet3_t txq->vxtxq_stats.vmtxs_tso++; - /* - * For TSO, the size of the protocol header is also - * included in the descriptor header size. - */ + switch (*etype) { +#if defined(INET) + case ETHERTYPE_IP: + sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, + htons(IPPROTO_TCP)); + break; +#endif +#if defined(INET6) + case ETHERTYPE_IPV6: + sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); + break; +#endif + default: + sum = 0; + break; + } + if (m->m_len < *start + sizeof(struct tcphdr)) { - m_copydata(m, offset, sizeof(struct tcphdr), + m_copyback(m, *start + offsetof(struct tcphdr, th_sum), + sizeof(uint16_t), (caddr_t) &sum); + m_copydata(m, *start, sizeof(struct tcphdr), (caddr_t) &tcphdr); tcp = &tcphdr; - } else + } else { tcp = mtodo(m, *start); + tcp->th_sum = sum; + } + + /* + * For TSO, the size of the protocol header is also + * included in the descriptor header size. + */ *start += (tcp->th_off << 2); } else txq->vxtxq_stats.vmtxs_csum++; From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 03:37:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A9DCE6B; Mon, 9 Jun 2014 03:37:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 579D624ED; Mon, 9 Jun 2014 03:37:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s593bglh040224; Mon, 9 Jun 2014 03:37:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s593bflr040222; Mon, 9 Jun 2014 03:37:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406090337.s593bflr040222@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 9 Jun 2014 03:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267254 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 03:37:42 -0000 Author: kib Date: Mon Jun 9 03:37:41 2014 New Revision: 267254 URL: http://svnweb.freebsd.org/changeset/base/267254 Log: Make mmap(MAP_STACK) search for the available address space, similar to !MAP_STACK mapping requests. For MAP_STACK | MAP_FIXED, clear any mappings which could previously exist in the used range. For this, teach vm_map_find() and vm_map_fixed() to handle MAP_STACK_GROWS_DOWN or _UP cow flags, by calling a new vm_map_stack_locked() helper, which is factored out from vm_map_stack(). The side effect of the change is that MAP_STACK started obeying MAP_ALIGNMENT and MAP_32BIT flags. Reported by: rwatson Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/vm/vm_map.c head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Mon Jun 9 02:45:53 2014 (r267253) +++ head/sys/vm/vm_map.c Mon Jun 9 03:37:41 2014 (r267254) @@ -136,6 +136,9 @@ static void vm_map_entry_dispose(vm_map_ static void vm_map_zdtor(void *mem, int size, void *arg); static void vmspace_zdtor(void *mem, int size, void *arg); #endif +static int vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, + vm_size_t max_ssize, vm_size_t growsize, vm_prot_t prot, vm_prot_t max, + int cow); #define ENTRY_CHARGED(e) ((e)->cred != NULL || \ ((e)->object.vm_object != NULL && (e)->object.vm_object->cred != NULL && \ @@ -1399,11 +1402,19 @@ vm_map_fixed(vm_map_t map, vm_object_t o int result; end = start + length; + KASSERT((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 || + object == NULL, + ("vm_map_fixed: non-NULL backing object for stack")); vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); (void) vm_map_delete(map, start, end); - result = vm_map_insert(map, object, offset, start, end, prot, - max, cow); + if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) != 0) { + result = vm_map_stack_locked(map, start, length, sgrowsiz, + prot, max, cow); + } else { + result = vm_map_insert(map, object, offset, start, end, + prot, max, cow); + } vm_map_unlock(map); return (result); } @@ -1426,6 +1437,9 @@ vm_map_find(vm_map_t map, vm_object_t ob vm_offset_t alignment, initial_addr, start; int result; + KASSERT((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 || + object == NULL, + ("vm_map_find: non-NULL backing object for stack")); if (find_space == VMFS_OPTIMAL_SPACE && (object == NULL || (object->flags & OBJ_COLORED) == 0)) find_space = VMFS_ANY_SPACE; @@ -1467,8 +1481,13 @@ again: start = *addr; } - result = vm_map_insert(map, object, offset, start, start + - length, prot, max, cow); + if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) != 0) { + result = vm_map_stack_locked(map, start, length, + sgrowsiz, prot, max, cow); + } else { + result = vm_map_insert(map, object, offset, start, + start + length, prot, max, cow); + } } while (result == KERN_NO_SPACE && find_space != VMFS_NO_SPACE && find_space != VMFS_ANY_SPACE); vm_map_unlock(map); @@ -3347,11 +3366,43 @@ int vm_map_stack(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, vm_prot_t prot, vm_prot_t max, int cow) { + vm_size_t growsize, init_ssize; + rlim_t lmemlim, vmemlim; + int rv; + + growsize = sgrowsiz; + init_ssize = (max_ssize < growsize) ? max_ssize : growsize; + vm_map_lock(map); + PROC_LOCK(curproc); + lmemlim = lim_cur(curproc, RLIMIT_MEMLOCK); + vmemlim = lim_cur(curproc, RLIMIT_VMEM); + PROC_UNLOCK(curproc); + if (!old_mlock && map->flags & MAP_WIREFUTURE) { + if (ptoa(pmap_wired_count(map->pmap)) + init_ssize > lmemlim) { + rv = KERN_NO_SPACE; + goto out; + } + } + /* If we would blow our VMEM resource limit, no go */ + if (map->size + init_ssize > vmemlim) { + rv = KERN_NO_SPACE; + goto out; + } + rv = vm_map_stack_locked(map, addrbos, max_ssize, sgrowsiz, prot, + max, cow); +out: + vm_map_unlock(map); + return (rv); +} + +static int +vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, + vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) +{ vm_map_entry_t new_entry, prev_entry; vm_offset_t bot, top; - vm_size_t growsize, init_ssize; + vm_size_t init_ssize; int orient, rv; - rlim_t lmemlim, vmemlim; /* * The stack orientation is piggybacked with the cow argument. @@ -3367,34 +3418,11 @@ vm_map_stack(vm_map_t map, vm_offset_t a addrbos + max_ssize < addrbos) return (KERN_NO_SPACE); - growsize = sgrowsiz; init_ssize = (max_ssize < growsize) ? max_ssize : growsize; - PROC_LOCK(curproc); - lmemlim = lim_cur(curproc, RLIMIT_MEMLOCK); - vmemlim = lim_cur(curproc, RLIMIT_VMEM); - PROC_UNLOCK(curproc); - - vm_map_lock(map); - /* If addr is already mapped, no go */ - if (vm_map_lookup_entry(map, addrbos, &prev_entry)) { - vm_map_unlock(map); + if (vm_map_lookup_entry(map, addrbos, &prev_entry)) return (KERN_NO_SPACE); - } - - if (!old_mlock && map->flags & MAP_WIREFUTURE) { - if (ptoa(pmap_wired_count(map->pmap)) + init_ssize > lmemlim) { - vm_map_unlock(map); - return (KERN_NO_SPACE); - } - } - - /* If we would blow our VMEM resource limit, no go */ - if (map->size + init_ssize > vmemlim) { - vm_map_unlock(map); - return (KERN_NO_SPACE); - } /* * If we can't accomodate max_ssize in the current mapping, no go. @@ -3406,10 +3434,8 @@ vm_map_stack(vm_map_t map, vm_offset_t a * grow the stack. */ if ((prev_entry->next != &map->header) && - (prev_entry->next->start < addrbos + max_ssize)) { - vm_map_unlock(map); + (prev_entry->next->start < addrbos + max_ssize)) return (KERN_NO_SPACE); - } /* * We initially map a stack of only init_ssize. We will grow as @@ -3445,7 +3471,6 @@ vm_map_stack(vm_map_t map, vm_offset_t a new_entry->eflags |= MAP_ENTRY_GROWS_UP; } - vm_map_unlock(map); return (rv); } Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Mon Jun 9 02:45:53 2014 (r267253) +++ head/sys/vm/vm_mmap.c Mon Jun 9 03:37:41 2014 (r267254) @@ -1621,11 +1621,13 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, docow |= MAP_INHERIT_SHARE; if (writecounted) docow |= MAP_VN_WRITECOUNT; + if (flags & MAP_STACK) { + if (object != NULL) + return (EINVAL); + docow |= MAP_STACK_GROWS_DOWN; + } - if (flags & MAP_STACK) - rv = vm_map_stack(map, *addr, size, prot, maxprot, - docow | MAP_STACK_GROWS_DOWN); - else if (fitit) { + if (fitit) { if ((flags & MAP_ALIGNMENT_MASK) == MAP_ALIGNED_SUPER) findspace = VMFS_SUPER_SPACE; else if ((flags & MAP_ALIGNMENT_MASK) != 0) @@ -1638,9 +1640,10 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, flags & MAP_32BIT ? MAP_32BIT_MAX_ADDR : #endif 0, findspace, prot, maxprot, docow); - } else + } else { rv = vm_map_fixed(map, object, foff, *addr, size, - prot, maxprot, docow); + prot, maxprot, docow); + } if (rv == KERN_SUCCESS) { /* From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 03:38:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2ABE2FA2; Mon, 9 Jun 2014 03:38:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B6BF24EF; Mon, 9 Jun 2014 03:38:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s593c3Mw040331; Mon, 9 Jun 2014 03:38:03 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s593c331040330; Mon, 9 Jun 2014 03:38:03 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406090338.s593c331040330@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 9 Jun 2014 03:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267255 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 03:38:04 -0000 Author: kib Date: Mon Jun 9 03:38:03 2014 New Revision: 267255 URL: http://svnweb.freebsd.org/changeset/base/267255 Log: Change the nblock mutex, protecting the needsbuffer buffer deficit flags, to rwlock. Lock it in read mode when used from subroutines called from buffer release code paths. The needsbuffer is now updated using atomics, while read lock of nblock prevents loosing the wakeups from bufspacewakeup() and bufcountadd() in getnewbuf_bufd_help(). In several interesting loads, needsbuffer flags are never set, while buffers are reused quickly. This causes brelse() and bqrelse() from different threads to content on the nblock. Now they take nblock in read mode, together with needsbuffer not needing an update, allowing higher parallelism. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Jun 9 03:37:41 2014 (r267254) +++ head/sys/kern/vfs_bio.c Mon Jun 9 03:38:03 2014 (r267255) @@ -254,7 +254,7 @@ static struct mtx_padalign rbreqlock; /* * Lock that protects needsbuffer and the sleeps/wakeups surrounding it. */ -static struct mtx_padalign nblock; +static struct rwlock_padalign nblock; /* * Lock that protects bdirtywait. @@ -299,7 +299,7 @@ static int runningbufreq; * Used in numdirtywakeup(), bufspacewakeup(), bufcountadd(), bwillwrite(), * getnewbuf(), and getblk(). */ -static int needsbuffer; +static volatile int needsbuffer; /* * Synchronization for bwillwrite() waiters. @@ -457,18 +457,27 @@ bdirtyadd(void) static __inline void bufspacewakeup(void) { + int need_wakeup, on; /* * If someone is waiting for BUF space, wake them up. Even * though we haven't freed the kva space yet, the waiting * process will be able to now. */ - mtx_lock(&nblock); - if (needsbuffer & VFS_BIO_NEED_BUFSPACE) { - needsbuffer &= ~VFS_BIO_NEED_BUFSPACE; - wakeup(&needsbuffer); + rw_rlock(&nblock); + for (;;) { + need_wakeup = 0; + on = needsbuffer; + if ((on & VFS_BIO_NEED_BUFSPACE) == 0) + break; + need_wakeup = 1; + if (atomic_cmpset_rel_int(&needsbuffer, on, + on & ~VFS_BIO_NEED_BUFSPACE)) + break; } - mtx_unlock(&nblock); + if (need_wakeup) + wakeup((void *)&needsbuffer); + rw_runlock(&nblock); } /* @@ -528,7 +537,7 @@ runningbufwakeup(struct buf *bp) static __inline void bufcountadd(struct buf *bp) { - int old; + int mask, need_wakeup, old, on; KASSERT((bp->b_flags & B_INFREECNT) == 0, ("buf %p already counted as free", bp)); @@ -536,14 +545,22 @@ bufcountadd(struct buf *bp) old = atomic_fetchadd_int(&numfreebuffers, 1); KASSERT(old >= 0 && old < nbuf, ("numfreebuffers climbed to %d", old + 1)); - mtx_lock(&nblock); - if (needsbuffer) { - needsbuffer &= ~VFS_BIO_NEED_ANY; - if (numfreebuffers >= hifreebuffers) - needsbuffer &= ~VFS_BIO_NEED_FREE; - wakeup(&needsbuffer); + mask = VFS_BIO_NEED_ANY; + if (numfreebuffers >= hifreebuffers) + mask |= VFS_BIO_NEED_FREE; + rw_rlock(&nblock); + for (;;) { + need_wakeup = 0; + on = needsbuffer; + if (on == 0) + break; + need_wakeup = 1; + if (atomic_cmpset_rel_int(&needsbuffer, on, on & ~mask)) + break; } - mtx_unlock(&nblock); + if (need_wakeup) + wakeup((void *)&needsbuffer); + rw_runlock(&nblock); } /* @@ -787,7 +804,7 @@ bufinit(void) mtx_init(&bqclean, "bufq clean lock", NULL, MTX_DEF); mtx_init(&bqdirty, "bufq dirty lock", NULL, MTX_DEF); mtx_init(&rbreqlock, "runningbufspace lock", NULL, MTX_DEF); - mtx_init(&nblock, "needsbuffer lock", NULL, MTX_DEF); + rw_init(&nblock, "needsbuffer lock"); mtx_init(&bdlock, "buffer daemon lock", NULL, MTX_DEF); mtx_init(&bdirtylock, "dirty buf lock", NULL, MTX_DEF); @@ -2085,9 +2102,7 @@ getnewbuf_bufd_help(struct vnode *vp, in waitmsg = "newbuf"; flags = VFS_BIO_NEED_ANY; } - mtx_lock(&nblock); - needsbuffer |= flags; - mtx_unlock(&nblock); + atomic_set_int(&needsbuffer, flags); mtx_unlock(&bqclean); bd_speedup(); /* heeeelp */ @@ -2097,12 +2112,11 @@ getnewbuf_bufd_help(struct vnode *vp, in td = curthread; cnt = 0; wait = MNT_NOWAIT; - mtx_lock(&nblock); - while (needsbuffer & flags) { + rw_wlock(&nblock); + while ((needsbuffer & flags) != 0) { if (vp != NULL && vp->v_type != VCHR && (td->td_pflags & TDP_BUFNEED) == 0) { - mtx_unlock(&nblock); - + rw_wunlock(&nblock); /* * getblk() is called with a vnode locked, and * some majority of the dirty buffers may as @@ -2124,15 +2138,16 @@ getnewbuf_bufd_help(struct vnode *vp, in atomic_add_long(¬bufdflushes, 1); curthread_pflags_restore(norunbuf); } - mtx_lock(&nblock); + rw_wlock(&nblock); if ((needsbuffer & flags) == 0) break; } - if (msleep(&needsbuffer, &nblock, (PRIBIO + 4) | slpflag, - waitmsg, slptimeo)) + error = rw_sleep((void *)&needsbuffer, &nblock, (PRIBIO + 4) | + slpflag, waitmsg, slptimeo); + if (error != 0) break; } - mtx_unlock(&nblock); + rw_wunlock(&nblock); } static void From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 05:51:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D84257BF; Mon, 9 Jun 2014 05:51:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C16CA2E1B; Mon, 9 Jun 2014 05:51:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s595p97X000925; Mon, 9 Jun 2014 05:51:09 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s595owlV000465; Mon, 9 Jun 2014 05:50:58 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201406090550.s595owlV000465@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 9 Jun 2014 05:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267256 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/cms crypt... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 05:51:09 -0000 Author: jkim Date: Mon Jun 9 05:50:57 2014 New Revision: 267256 URL: http://svnweb.freebsd.org/changeset/base/267256 Log: Merge OpenSSL 1.0.1h. Approved by: so (delphij) Added: head/crypto/openssl/ssl/heartbeat_test.c - copied unchanged from r267188, vendor-crypto/openssl/dist/ssl/heartbeat_test.c Modified: head/crypto/openssl/ACKNOWLEDGMENTS head/crypto/openssl/CHANGES head/crypto/openssl/Makefile head/crypto/openssl/NEWS head/crypto/openssl/README head/crypto/openssl/apps/enc.c head/crypto/openssl/apps/ocsp.c head/crypto/openssl/apps/req.c head/crypto/openssl/apps/s_cb.c head/crypto/openssl/apps/s_socket.c head/crypto/openssl/apps/smime.c head/crypto/openssl/crypto/asn1/a_strnid.c head/crypto/openssl/crypto/bio/bss_dgram.c head/crypto/openssl/crypto/bn/bn_mont.c head/crypto/openssl/crypto/cms/cms_env.c head/crypto/openssl/crypto/cms/cms_sd.c head/crypto/openssl/crypto/cms/cms_smime.c head/crypto/openssl/crypto/dso/dso_dlfcn.c head/crypto/openssl/crypto/ec/ec_ameth.c head/crypto/openssl/crypto/ec/ec_asn1.c head/crypto/openssl/crypto/ec/ec_lcl.h head/crypto/openssl/crypto/evp/bio_b64.c head/crypto/openssl/crypto/evp/encode.c head/crypto/openssl/crypto/opensslv.h head/crypto/openssl/crypto/pkcs12/p12_crt.c head/crypto/openssl/crypto/pkcs12/p12_kiss.c head/crypto/openssl/crypto/pkcs7/pk7_doit.c head/crypto/openssl/crypto/pkcs7/pkcs7.h head/crypto/openssl/crypto/pkcs7/pkcs7err.c head/crypto/openssl/crypto/rsa/rsa_ameth.c head/crypto/openssl/crypto/srp/srp_vfy.c head/crypto/openssl/crypto/ts/ts_rsp_verify.c head/crypto/openssl/crypto/x509v3/v3_purp.c head/crypto/openssl/doc/apps/cms.pod head/crypto/openssl/doc/apps/enc.pod head/crypto/openssl/doc/apps/s_server.pod head/crypto/openssl/doc/apps/smime.pod head/crypto/openssl/doc/apps/verify.pod head/crypto/openssl/doc/apps/version.pod head/crypto/openssl/doc/apps/x509v3_config.pod head/crypto/openssl/doc/crypto/CMS_decrypt.pod head/crypto/openssl/doc/crypto/CONF_modules_free.pod head/crypto/openssl/doc/crypto/CONF_modules_load_file.pod head/crypto/openssl/doc/crypto/OPENSSL_config.pod head/crypto/openssl/doc/crypto/X509_NAME_ENTRY_get_object.pod head/crypto/openssl/doc/crypto/X509_STORE_CTX_get_ex_new_index.pod head/crypto/openssl/doc/fingerprints.txt head/crypto/openssl/doc/ssl/SSL_CTX_set_msg_callback.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_options.pod head/crypto/openssl/doc/ssl/SSL_get_peer_cert_chain.pod head/crypto/openssl/engines/ccgost/gost_ameth.c head/crypto/openssl/ssl/Makefile head/crypto/openssl/ssl/d1_both.c head/crypto/openssl/ssl/d1_lib.c head/crypto/openssl/ssl/d1_pkt.c head/crypto/openssl/ssl/d1_srvr.c head/crypto/openssl/ssl/s3_pkt.c head/crypto/openssl/ssl/s3_srvr.c head/crypto/openssl/ssl/ssl.h head/crypto/openssl/ssl/ssl3.h head/crypto/openssl/ssl/ssl_asn1.c head/crypto/openssl/ssl/ssl_err.c head/crypto/openssl/ssl/ssl_lib.c head/crypto/openssl/ssl/t1_enc.c head/crypto/openssl/ssl/t1_lib.c head/secure/lib/libcrypto/Makefile.inc head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_length.3 head/secure/lib/libcrypto/man/ASN1_STRING_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 head/secure/lib/libcrypto/man/BIO_ctrl.3 head/secure/lib/libcrypto/man/BIO_f_base64.3 head/secure/lib/libcrypto/man/BIO_f_buffer.3 head/secure/lib/libcrypto/man/BIO_f_cipher.3 head/secure/lib/libcrypto/man/BIO_f_md.3 head/secure/lib/libcrypto/man/BIO_f_null.3 head/secure/lib/libcrypto/man/BIO_f_ssl.3 head/secure/lib/libcrypto/man/BIO_find_type.3 head/secure/lib/libcrypto/man/BIO_new.3 head/secure/lib/libcrypto/man/BIO_new_CMS.3 head/secure/lib/libcrypto/man/BIO_push.3 head/secure/lib/libcrypto/man/BIO_read.3 head/secure/lib/libcrypto/man/BIO_s_accept.3 head/secure/lib/libcrypto/man/BIO_s_bio.3 head/secure/lib/libcrypto/man/BIO_s_connect.3 head/secure/lib/libcrypto/man/BIO_s_fd.3 head/secure/lib/libcrypto/man/BIO_s_file.3 head/secure/lib/libcrypto/man/BIO_s_mem.3 head/secure/lib/libcrypto/man/BIO_s_null.3 head/secure/lib/libcrypto/man/BIO_s_socket.3 head/secure/lib/libcrypto/man/BIO_set_callback.3 head/secure/lib/libcrypto/man/BIO_should_retry.3 head/secure/lib/libcrypto/man/BN_BLINDING_new.3 head/secure/lib/libcrypto/man/BN_CTX_new.3 head/secure/lib/libcrypto/man/BN_CTX_start.3 head/secure/lib/libcrypto/man/BN_add.3 head/secure/lib/libcrypto/man/BN_add_word.3 head/secure/lib/libcrypto/man/BN_bn2bin.3 head/secure/lib/libcrypto/man/BN_cmp.3 head/secure/lib/libcrypto/man/BN_copy.3 head/secure/lib/libcrypto/man/BN_generate_prime.3 head/secure/lib/libcrypto/man/BN_mod_inverse.3 head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 head/secure/lib/libcrypto/man/BN_new.3 head/secure/lib/libcrypto/man/BN_num_bytes.3 head/secure/lib/libcrypto/man/BN_rand.3 head/secure/lib/libcrypto/man/BN_set_bit.3 head/secure/lib/libcrypto/man/BN_swap.3 head/secure/lib/libcrypto/man/BN_zero.3 head/secure/lib/libcrypto/man/CMS_add0_cert.3 head/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 head/secure/lib/libcrypto/man/CMS_compress.3 head/secure/lib/libcrypto/man/CMS_decrypt.3 head/secure/lib/libcrypto/man/CMS_encrypt.3 head/secure/lib/libcrypto/man/CMS_final.3 head/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 head/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 head/secure/lib/libcrypto/man/CMS_get0_type.3 head/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 head/secure/lib/libcrypto/man/CMS_sign.3 head/secure/lib/libcrypto/man/CMS_sign_add1_signer.3 head/secure/lib/libcrypto/man/CMS_sign_receipt.3 head/secure/lib/libcrypto/man/CMS_uncompress.3 head/secure/lib/libcrypto/man/CMS_verify.3 head/secure/lib/libcrypto/man/CMS_verify_receipt.3 head/secure/lib/libcrypto/man/CONF_modules_free.3 head/secure/lib/libcrypto/man/CONF_modules_load_file.3 head/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 head/secure/lib/libcrypto/man/DH_generate_key.3 head/secure/lib/libcrypto/man/DH_generate_parameters.3 head/secure/lib/libcrypto/man/DH_get_ex_new_index.3 head/secure/lib/libcrypto/man/DH_new.3 head/secure/lib/libcrypto/man/DH_set_method.3 head/secure/lib/libcrypto/man/DH_size.3 head/secure/lib/libcrypto/man/DSA_SIG_new.3 head/secure/lib/libcrypto/man/DSA_do_sign.3 head/secure/lib/libcrypto/man/DSA_dup_DH.3 head/secure/lib/libcrypto/man/DSA_generate_key.3 head/secure/lib/libcrypto/man/DSA_generate_parameters.3 head/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/DSA_new.3 head/secure/lib/libcrypto/man/DSA_set_method.3 head/secure/lib/libcrypto/man/DSA_sign.3 head/secure/lib/libcrypto/man/DSA_size.3 head/secure/lib/libcrypto/man/ERR_GET_LIB.3 head/secure/lib/libcrypto/man/ERR_clear_error.3 head/secure/lib/libcrypto/man/ERR_error_string.3 head/secure/lib/libcrypto/man/ERR_get_error.3 head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 head/secure/lib/libcrypto/man/ERR_load_strings.3 head/secure/lib/libcrypto/man/ERR_print_errors.3 head/secure/lib/libcrypto/man/ERR_put_error.3 head/secure/lib/libcrypto/man/ERR_remove_state.3 head/secure/lib/libcrypto/man/ERR_set_mark.3 head/secure/lib/libcrypto/man/EVP_BytesToKey.3 head/secure/lib/libcrypto/man/EVP_DigestInit.3 head/secure/lib/libcrypto/man/EVP_DigestSignInit.3 head/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 head/secure/lib/libcrypto/man/EVP_EncryptInit.3 head/secure/lib/libcrypto/man/EVP_OpenInit.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 head/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_derive.3 head/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 head/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 head/secure/lib/libcrypto/man/EVP_PKEY_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 head/secure/lib/libcrypto/man/EVP_PKEY_sign.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 head/secure/lib/libcrypto/man/EVP_SealInit.3 head/secure/lib/libcrypto/man/EVP_SignInit.3 head/secure/lib/libcrypto/man/EVP_VerifyInit.3 head/secure/lib/libcrypto/man/OBJ_nid2obj.3 head/secure/lib/libcrypto/man/OPENSSL_Applink.3 head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 head/secure/lib/libcrypto/man/OPENSSL_config.3 head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 head/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 head/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 head/secure/lib/libcrypto/man/PKCS12_create.3 head/secure/lib/libcrypto/man/PKCS12_parse.3 head/secure/lib/libcrypto/man/PKCS7_decrypt.3 head/secure/lib/libcrypto/man/PKCS7_encrypt.3 head/secure/lib/libcrypto/man/PKCS7_sign.3 head/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 head/secure/lib/libcrypto/man/PKCS7_verify.3 head/secure/lib/libcrypto/man/RAND_add.3 head/secure/lib/libcrypto/man/RAND_bytes.3 head/secure/lib/libcrypto/man/RAND_cleanup.3 head/secure/lib/libcrypto/man/RAND_egd.3 head/secure/lib/libcrypto/man/RAND_load_file.3 head/secure/lib/libcrypto/man/RAND_set_rand_method.3 head/secure/lib/libcrypto/man/RSA_blinding_on.3 head/secure/lib/libcrypto/man/RSA_check_key.3 head/secure/lib/libcrypto/man/RSA_generate_key.3 head/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/RSA_new.3 head/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 head/secure/lib/libcrypto/man/RSA_print.3 head/secure/lib/libcrypto/man/RSA_private_encrypt.3 head/secure/lib/libcrypto/man/RSA_public_encrypt.3 head/secure/lib/libcrypto/man/RSA_set_method.3 head/secure/lib/libcrypto/man/RSA_sign.3 head/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 head/secure/lib/libcrypto/man/RSA_size.3 head/secure/lib/libcrypto/man/SMIME_read_CMS.3 head/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 head/secure/lib/libcrypto/man/SMIME_write_CMS.3 head/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 head/secure/lib/libcrypto/man/X509_NAME_print_ex.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 head/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 head/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 head/secure/lib/libcrypto/man/X509_new.3 head/secure/lib/libcrypto/man/X509_verify_cert.3 head/secure/lib/libcrypto/man/bio.3 head/secure/lib/libcrypto/man/blowfish.3 head/secure/lib/libcrypto/man/bn.3 head/secure/lib/libcrypto/man/bn_internal.3 head/secure/lib/libcrypto/man/buffer.3 head/secure/lib/libcrypto/man/crypto.3 head/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 head/secure/lib/libcrypto/man/d2i_DHparams.3 head/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 head/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_X509.3 head/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 head/secure/lib/libcrypto/man/d2i_X509_CRL.3 head/secure/lib/libcrypto/man/d2i_X509_NAME.3 head/secure/lib/libcrypto/man/d2i_X509_REQ.3 head/secure/lib/libcrypto/man/d2i_X509_SIG.3 head/secure/lib/libcrypto/man/des.3 head/secure/lib/libcrypto/man/dh.3 head/secure/lib/libcrypto/man/dsa.3 head/secure/lib/libcrypto/man/ecdsa.3 head/secure/lib/libcrypto/man/engine.3 head/secure/lib/libcrypto/man/err.3 head/secure/lib/libcrypto/man/evp.3 head/secure/lib/libcrypto/man/hmac.3 head/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 head/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 head/secure/lib/libcrypto/man/lh_stats.3 head/secure/lib/libcrypto/man/lhash.3 head/secure/lib/libcrypto/man/md5.3 head/secure/lib/libcrypto/man/mdc2.3 head/secure/lib/libcrypto/man/pem.3 head/secure/lib/libcrypto/man/rand.3 head/secure/lib/libcrypto/man/rc4.3 head/secure/lib/libcrypto/man/ripemd.3 head/secure/lib/libcrypto/man/rsa.3 head/secure/lib/libcrypto/man/sha.3 head/secure/lib/libcrypto/man/threads.3 head/secure/lib/libcrypto/man/ui.3 head/secure/lib/libcrypto/man/ui_compat.3 head/secure/lib/libcrypto/man/x509.3 head/secure/lib/libssl/man/SSL_CIPHER_get_name.3 head/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 head/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 head/secure/lib/libssl/man/SSL_CTX_add_session.3 head/secure/lib/libssl/man/SSL_CTX_ctrl.3 head/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 head/secure/lib/libssl/man/SSL_CTX_free.3 head/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 head/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 head/secure/lib/libssl/man/SSL_CTX_new.3 head/secure/lib/libssl/man/SSL_CTX_sess_number.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 head/secure/lib/libssl/man/SSL_CTX_sessions.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 head/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 head/secure/lib/libssl/man/SSL_CTX_set_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_options.3 head/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 head/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 head/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 head/secure/lib/libssl/man/SSL_CTX_set_timeout.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_verify.3 head/secure/lib/libssl/man/SSL_CTX_use_certificate.3 head/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 head/secure/lib/libssl/man/SSL_SESSION_free.3 head/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_SESSION_get_time.3 head/secure/lib/libssl/man/SSL_accept.3 head/secure/lib/libssl/man/SSL_alert_type_string.3 head/secure/lib/libssl/man/SSL_clear.3 head/secure/lib/libssl/man/SSL_connect.3 head/secure/lib/libssl/man/SSL_do_handshake.3 head/secure/lib/libssl/man/SSL_free.3 head/secure/lib/libssl/man/SSL_get_SSL_CTX.3 head/secure/lib/libssl/man/SSL_get_ciphers.3 head/secure/lib/libssl/man/SSL_get_client_CA_list.3 head/secure/lib/libssl/man/SSL_get_current_cipher.3 head/secure/lib/libssl/man/SSL_get_default_timeout.3 head/secure/lib/libssl/man/SSL_get_error.3 head/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 head/secure/lib/libssl/man/SSL_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_get_fd.3 head/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 head/secure/lib/libssl/man/SSL_get_peer_certificate.3 head/secure/lib/libssl/man/SSL_get_psk_identity.3 head/secure/lib/libssl/man/SSL_get_rbio.3 head/secure/lib/libssl/man/SSL_get_session.3 head/secure/lib/libssl/man/SSL_get_verify_result.3 head/secure/lib/libssl/man/SSL_get_version.3 head/secure/lib/libssl/man/SSL_library_init.3 head/secure/lib/libssl/man/SSL_load_client_CA_file.3 head/secure/lib/libssl/man/SSL_new.3 head/secure/lib/libssl/man/SSL_pending.3 head/secure/lib/libssl/man/SSL_read.3 head/secure/lib/libssl/man/SSL_rstate_string.3 head/secure/lib/libssl/man/SSL_session_reused.3 head/secure/lib/libssl/man/SSL_set_bio.3 head/secure/lib/libssl/man/SSL_set_connect_state.3 head/secure/lib/libssl/man/SSL_set_fd.3 head/secure/lib/libssl/man/SSL_set_session.3 head/secure/lib/libssl/man/SSL_set_shutdown.3 head/secure/lib/libssl/man/SSL_set_verify_result.3 head/secure/lib/libssl/man/SSL_shutdown.3 head/secure/lib/libssl/man/SSL_state_string.3 head/secure/lib/libssl/man/SSL_want.3 head/secure/lib/libssl/man/SSL_write.3 head/secure/lib/libssl/man/d2i_SSL_SESSION.3 head/secure/lib/libssl/man/ssl.3 head/secure/usr.bin/openssl/man/CA.pl.1 head/secure/usr.bin/openssl/man/asn1parse.1 head/secure/usr.bin/openssl/man/ca.1 head/secure/usr.bin/openssl/man/ciphers.1 head/secure/usr.bin/openssl/man/cms.1 head/secure/usr.bin/openssl/man/crl.1 head/secure/usr.bin/openssl/man/crl2pkcs7.1 head/secure/usr.bin/openssl/man/dgst.1 head/secure/usr.bin/openssl/man/dhparam.1 head/secure/usr.bin/openssl/man/dsa.1 head/secure/usr.bin/openssl/man/dsaparam.1 head/secure/usr.bin/openssl/man/ec.1 head/secure/usr.bin/openssl/man/ecparam.1 head/secure/usr.bin/openssl/man/enc.1 head/secure/usr.bin/openssl/man/errstr.1 head/secure/usr.bin/openssl/man/gendsa.1 head/secure/usr.bin/openssl/man/genpkey.1 head/secure/usr.bin/openssl/man/genrsa.1 head/secure/usr.bin/openssl/man/nseq.1 head/secure/usr.bin/openssl/man/ocsp.1 head/secure/usr.bin/openssl/man/openssl.1 head/secure/usr.bin/openssl/man/passwd.1 head/secure/usr.bin/openssl/man/pkcs12.1 head/secure/usr.bin/openssl/man/pkcs7.1 head/secure/usr.bin/openssl/man/pkcs8.1 head/secure/usr.bin/openssl/man/pkey.1 head/secure/usr.bin/openssl/man/pkeyparam.1 head/secure/usr.bin/openssl/man/pkeyutl.1 head/secure/usr.bin/openssl/man/rand.1 head/secure/usr.bin/openssl/man/req.1 head/secure/usr.bin/openssl/man/rsa.1 head/secure/usr.bin/openssl/man/rsautl.1 head/secure/usr.bin/openssl/man/s_client.1 head/secure/usr.bin/openssl/man/s_server.1 head/secure/usr.bin/openssl/man/s_time.1 head/secure/usr.bin/openssl/man/sess_id.1 head/secure/usr.bin/openssl/man/smime.1 head/secure/usr.bin/openssl/man/speed.1 head/secure/usr.bin/openssl/man/spkac.1 head/secure/usr.bin/openssl/man/ts.1 head/secure/usr.bin/openssl/man/tsget.1 head/secure/usr.bin/openssl/man/verify.1 head/secure/usr.bin/openssl/man/version.1 head/secure/usr.bin/openssl/man/x509.1 head/secure/usr.bin/openssl/man/x509v3_config.1 Directory Properties: head/crypto/openssl/ (props changed) Modified: head/crypto/openssl/ACKNOWLEDGMENTS ============================================================================== --- head/crypto/openssl/ACKNOWLEDGMENTS Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/ACKNOWLEDGMENTS Mon Jun 9 05:50:57 2014 (r267256) @@ -10,13 +10,18 @@ OpenSSL project. We would like to identify and thank the following such sponsors for their past or current significant support of the OpenSSL project: +Major support: + + Qualys http://www.qualys.com/ + Very significant support: - OpenGear: www.opengear.com + OpenGear: http://www.opengear.com/ Significant support: - PSW Group: www.psw.net + PSW Group: http://www.psw.net/ + Acano Ltd. http://acano.com/ Please note that we ask permission to identify sponsors and that some sponsors we consider eligible for inclusion here have requested to remain anonymous. Modified: head/crypto/openssl/CHANGES ============================================================================== --- head/crypto/openssl/CHANGES Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/CHANGES Mon Jun 9 05:50:57 2014 (r267256) @@ -2,6 +2,50 @@ OpenSSL CHANGES _______________ + Changes between 1.0.1g and 1.0.1h [5 Jun 2014] + + *) Fix for SSL/TLS MITM flaw. An attacker using a carefully crafted + handshake can force the use of weak keying material in OpenSSL + SSL/TLS clients and servers. + + Thanks to KIKUCHI Masashi (Lepidum Co. Ltd.) for discovering and + researching this issue. (CVE-2014-0224) + [KIKUCHI Masashi, Steve Henson] + + *) Fix DTLS recursion flaw. By sending an invalid DTLS handshake to an + OpenSSL DTLS client the code can be made to recurse eventually crashing + in a DoS attack. + + Thanks to Imre Rad (Search-Lab Ltd.) for discovering this issue. + (CVE-2014-0221) + [Imre Rad, Steve Henson] + + *) Fix DTLS invalid fragment vulnerability. A buffer overrun attack can + be triggered by sending invalid DTLS fragments to an OpenSSL DTLS + client or server. This is potentially exploitable to run arbitrary + code on a vulnerable client or server. + + Thanks to Jüri Aedla for reporting this issue. (CVE-2014-0195) + [Jüri Aedla, Steve Henson] + + *) Fix bug in TLS code where clients enable anonymous ECDH ciphersuites + are subject to a denial of service attack. + + Thanks to Felix Gröbert and Ivan Fratric at Google for discovering + this issue. (CVE-2014-3470) + [Felix Gröbert, Ivan Fratric, Steve Henson] + + *) Harmonize version and its documentation. -f flag is used to display + compilation flags. + [mancha ] + + *) Fix eckey_priv_encode so it immediately returns an error upon a failure + in i2d_ECPrivateKey. + [mancha ] + + *) Fix some double frees. These are not thought to be exploitable. + [mancha ] + Changes between 1.0.1f and 1.0.1g [7 Apr 2014] *) A missing bounds check in the handling of the TLS heartbeat extension Modified: head/crypto/openssl/Makefile ============================================================================== --- head/crypto/openssl/Makefile Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/Makefile Mon Jun 9 05:50:57 2014 (r267256) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.1g +VERSION=1.0.1h MAJOR=1 MINOR=0.1 SHLIB_VERSION_NUMBER=1.0.0 Modified: head/crypto/openssl/NEWS ============================================================================== --- head/crypto/openssl/NEWS Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/NEWS Mon Jun 9 05:50:57 2014 (r267256) @@ -5,6 +5,14 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.1g and OpenSSL 1.0.1h [5 Jun 2014] + + o Fix for CVE-2014-0224 + o Fix for CVE-2014-0221 + o Fix for CVE-2014-0195 + o Fix for CVE-2014-3470 + o Fix for CVE-2010-5298 + Major changes between OpenSSL 1.0.1f and OpenSSL 1.0.1g [7 Apr 2014] o Fix for CVE-2014-0160 Modified: head/crypto/openssl/README ============================================================================== --- head/crypto/openssl/README Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/README Mon Jun 9 05:50:57 2014 (r267256) @@ -1,5 +1,5 @@ - OpenSSL 1.0.1g 7 Apr 2014 + OpenSSL 1.0.1h 5 Jun 2014 Copyright (c) 1998-2011 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: head/crypto/openssl/apps/enc.c ============================================================================== --- head/crypto/openssl/apps/enc.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/apps/enc.c Mon Jun 9 05:50:57 2014 (r267256) @@ -331,6 +331,12 @@ bad: setup_engine(bio_err, engine, 0); #endif + if (cipher && EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) + { + BIO_printf(bio_err, "AEAD ciphers not supported by the enc utility\n"); + goto end; + } + if (md && (dgst=EVP_get_digestbyname(md)) == NULL) { BIO_printf(bio_err,"%s is an unsupported message digest type\n",md); Modified: head/crypto/openssl/apps/ocsp.c ============================================================================== --- head/crypto/openssl/apps/ocsp.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/apps/ocsp.c Mon Jun 9 05:50:57 2014 (r267256) @@ -127,6 +127,7 @@ int MAIN(int argc, char **argv) ENGINE *e = NULL; char **args; char *host = NULL, *port = NULL, *path = "/"; + char *thost = NULL, *tport = NULL, *tpath = NULL; char *reqin = NULL, *respin = NULL; char *reqout = NULL, *respout = NULL; char *signfile = NULL, *keyfile = NULL; @@ -204,6 +205,12 @@ int MAIN(int argc, char **argv) } else if (!strcmp(*args, "-url")) { + if (thost) + OPENSSL_free(thost); + if (tport) + OPENSSL_free(tport); + if (tpath) + OPENSSL_free(tpath); if (args[1]) { args++; @@ -212,6 +219,9 @@ int MAIN(int argc, char **argv) BIO_printf(bio_err, "Error parsing URL\n"); badarg = 1; } + thost = host; + tport = port; + tpath = path; } else badarg = 1; } @@ -920,12 +930,12 @@ end: sk_X509_pop_free(verify_other, X509_free); sk_CONF_VALUE_pop_free(headers, X509V3_conf_free); - if (use_ssl != -1) - { - OPENSSL_free(host); - OPENSSL_free(port); - OPENSSL_free(path); - } + if (thost) + OPENSSL_free(thost); + if (tport) + OPENSSL_free(tport); + if (tpath) + OPENSSL_free(tpath); OPENSSL_EXIT(ret); } Modified: head/crypto/openssl/apps/req.c ============================================================================== --- head/crypto/openssl/apps/req.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/apps/req.c Mon Jun 9 05:50:57 2014 (r267256) @@ -1489,7 +1489,13 @@ start: #ifdef CHARSET_EBCDIC ebcdic2ascii(buf, buf, i); #endif - if(!req_check_len(i, n_min, n_max)) goto start; + if(!req_check_len(i, n_min, n_max)) + { + if (batch || value) + return 0; + goto start; + } + if (!X509_NAME_add_entry_by_NID(n,nid, chtype, (unsigned char *) buf, -1,-1,mval)) goto err; ret=1; @@ -1548,7 +1554,12 @@ start: #ifdef CHARSET_EBCDIC ebcdic2ascii(buf, buf, i); #endif - if(!req_check_len(i, n_min, n_max)) goto start; + if(!req_check_len(i, n_min, n_max)) + { + if (batch || value) + return 0; + goto start; + } if(!X509_REQ_add1_attr_by_NID(req, nid, chtype, (unsigned char *)buf, -1)) { Modified: head/crypto/openssl/apps/s_cb.c ============================================================================== --- head/crypto/openssl/apps/s_cb.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/apps/s_cb.c Mon Jun 9 05:50:57 2014 (r267256) @@ -747,6 +747,10 @@ void MS_CALLBACK tlsext_cb(SSL *s, int c break; #endif + case TLSEXT_TYPE_padding: + extname = "TLS padding"; + break; + default: extname = "unknown"; break; Modified: head/crypto/openssl/apps/s_socket.c ============================================================================== --- head/crypto/openssl/apps/s_socket.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/apps/s_socket.c Mon Jun 9 05:50:57 2014 (r267256) @@ -274,7 +274,7 @@ static int init_client_ip(int *sock, uns { i=0; i=setsockopt(s,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i)); - if (i < 0) { perror("keepalive"); return(0); } + if (i < 0) { closesocket(s); perror("keepalive"); return(0); } } #endif @@ -450,6 +450,7 @@ redoit: if ((*host=(char *)OPENSSL_malloc(strlen(h1->h_name)+1)) == NULL) { perror("OPENSSL_malloc"); + closesocket(ret); return(0); } BUF_strlcpy(*host,h1->h_name,strlen(h1->h_name)+1); @@ -458,11 +459,13 @@ redoit: if (h2 == NULL) { BIO_printf(bio_err,"gethostbyname failure\n"); + closesocket(ret); return(0); } if (h2->h_addrtype != AF_INET) { BIO_printf(bio_err,"gethostbyname addr is not AF_INET\n"); + closesocket(ret); return(0); } } Modified: head/crypto/openssl/apps/smime.c ============================================================================== --- head/crypto/openssl/apps/smime.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/apps/smime.c Mon Jun 9 05:50:57 2014 (r267256) @@ -541,8 +541,8 @@ int MAIN(int argc, char **argv) { if (!cipher) { -#ifndef OPENSSL_NO_RC2 - cipher = EVP_rc2_40_cbc(); +#ifndef OPENSSL_NO_DES + cipher = EVP_des_ede3_cbc(); #else BIO_printf(bio_err, "No cipher selected\n"); goto end; Modified: head/crypto/openssl/crypto/asn1/a_strnid.c ============================================================================== --- head/crypto/openssl/crypto/asn1/a_strnid.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/asn1/a_strnid.c Mon Jun 9 05:50:57 2014 (r267256) @@ -74,7 +74,7 @@ static int sk_table_cmp(const ASN1_STRIN * certain software (e.g. Netscape) has problems with them. */ -static unsigned long global_mask = 0xFFFFFFFFL; +static unsigned long global_mask = B_ASN1_UTF8STRING; void ASN1_STRING_set_default_mask(unsigned long mask) { Modified: head/crypto/openssl/crypto/bio/bss_dgram.c ============================================================================== --- head/crypto/openssl/crypto/bio/bss_dgram.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/bio/bss_dgram.c Mon Jun 9 05:50:57 2014 (r267256) @@ -1333,7 +1333,7 @@ static long dgram_sctp_ctrl(BIO *b, int bio_dgram_sctp_data *data = NULL; socklen_t sockopt_len = 0; struct sctp_authkeyid authkeyid; - struct sctp_authkey *authkey; + struct sctp_authkey *authkey = NULL; data = (bio_dgram_sctp_data *)b->ptr; @@ -1388,6 +1388,11 @@ static long dgram_sctp_ctrl(BIO *b, int /* Add new key */ sockopt_len = sizeof(struct sctp_authkey) + 64 * sizeof(uint8_t); authkey = OPENSSL_malloc(sockopt_len); + if (authkey == NULL) + { + ret = -1; + break; + } memset(authkey, 0x00, sockopt_len); authkey->sca_keynumber = authkeyid.scact_keynumber + 1; #ifndef __FreeBSD__ @@ -1399,6 +1404,8 @@ static long dgram_sctp_ctrl(BIO *b, int memcpy(&authkey->sca_key[0], ptr, 64 * sizeof(uint8_t)); ret = setsockopt(b->num, IPPROTO_SCTP, SCTP_AUTH_KEY, authkey, sockopt_len); + OPENSSL_free(authkey); + authkey = NULL; if (ret < 0) break; /* Reset active key */ Modified: head/crypto/openssl/crypto/bn/bn_mont.c ============================================================================== --- head/crypto/openssl/crypto/bn/bn_mont.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/bn/bn_mont.c Mon Jun 9 05:50:57 2014 (r267256) @@ -478,32 +478,38 @@ BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CT BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock, const BIGNUM *mod, BN_CTX *ctx) { - int got_write_lock = 0; BN_MONT_CTX *ret; CRYPTO_r_lock(lock); - if (!*pmont) + ret = *pmont; + CRYPTO_r_unlock(lock); + if (ret) + return ret; + + /* We don't want to serialise globally while doing our lazy-init math in + * BN_MONT_CTX_set. That punishes threads that are doing independent + * things. Instead, punish the case where more than one thread tries to + * lazy-init the same 'pmont', by having each do the lazy-init math work + * independently and only use the one from the thread that wins the race + * (the losers throw away the work they've done). */ + ret = BN_MONT_CTX_new(); + if (!ret) + return NULL; + if (!BN_MONT_CTX_set(ret, mod, ctx)) { - CRYPTO_r_unlock(lock); - CRYPTO_w_lock(lock); - got_write_lock = 1; + BN_MONT_CTX_free(ret); + return NULL; + } - if (!*pmont) - { - ret = BN_MONT_CTX_new(); - if (ret && !BN_MONT_CTX_set(ret, mod, ctx)) - BN_MONT_CTX_free(ret); - else - *pmont = ret; - } + /* The locked compare-and-set, after the local work is done. */ + CRYPTO_w_lock(lock); + if (*pmont) + { + BN_MONT_CTX_free(ret); + ret = *pmont; } - - ret = *pmont; - - if (got_write_lock) - CRYPTO_w_unlock(lock); else - CRYPTO_r_unlock(lock); - + *pmont = ret; + CRYPTO_w_unlock(lock); return ret; } Modified: head/crypto/openssl/crypto/cms/cms_env.c ============================================================================== --- head/crypto/openssl/crypto/cms/cms_env.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/cms/cms_env.c Mon Jun 9 05:50:57 2014 (r267256) @@ -185,6 +185,8 @@ CMS_RecipientInfo *CMS_add1_recipient_ce if (flags & CMS_USE_KEYID) { ktri->version = 2; + if (env->version < 2) + env->version = 2; type = CMS_RECIPINFO_KEYIDENTIFIER; } else Modified: head/crypto/openssl/crypto/cms/cms_sd.c ============================================================================== --- head/crypto/openssl/crypto/cms/cms_sd.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/cms/cms_sd.c Mon Jun 9 05:50:57 2014 (r267256) @@ -158,8 +158,8 @@ static void cms_sd_set_version(CMS_Signe if (sd->version < 3) sd->version = 3; } - else - sd->version = 1; + else if (si->version < 1) + si->version = 1; } if (sd->version < 1) Modified: head/crypto/openssl/crypto/cms/cms_smime.c ============================================================================== --- head/crypto/openssl/crypto/cms/cms_smime.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/cms/cms_smime.c Mon Jun 9 05:50:57 2014 (r267256) @@ -611,7 +611,7 @@ int CMS_decrypt_set1_pkey(CMS_ContentInf STACK_OF(CMS_RecipientInfo) *ris; CMS_RecipientInfo *ri; int i, r; - int debug = 0; + int debug = 0, ri_match = 0; ris = CMS_get0_RecipientInfos(cms); if (ris) debug = cms->d.envelopedData->encryptedContentInfo->debug; @@ -620,6 +620,7 @@ int CMS_decrypt_set1_pkey(CMS_ContentInf ri = sk_CMS_RecipientInfo_value(ris, i); if (CMS_RecipientInfo_type(ri) != CMS_RECIPINFO_TRANS) continue; + ri_match = 1; /* If we have a cert try matching RecipientInfo * otherwise try them all. */ @@ -655,7 +656,7 @@ int CMS_decrypt_set1_pkey(CMS_ContentInf } } /* If no cert and not debugging always return success */ - if (!cert && !debug) + if (ri_match && !cert && !debug) { ERR_clear_error(); return 1; Modified: head/crypto/openssl/crypto/dso/dso_dlfcn.c ============================================================================== --- head/crypto/openssl/crypto/dso/dso_dlfcn.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/dso/dso_dlfcn.c Mon Jun 9 05:50:57 2014 (r267256) @@ -464,7 +464,7 @@ static int dlfcn_pathbyaddr(void *addr,c return len; } - ERR_add_error_data(4, "dlfcn_pathbyaddr(): ", dlerror()); + ERR_add_error_data(2, "dlfcn_pathbyaddr(): ", dlerror()); #endif return -1; } Modified: head/crypto/openssl/crypto/ec/ec_ameth.c ============================================================================== --- head/crypto/openssl/crypto/ec/ec_ameth.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/ec/ec_ameth.c Mon Jun 9 05:50:57 2014 (r267256) @@ -352,6 +352,7 @@ static int eckey_priv_encode(PKCS8_PRIV_ EC_KEY_set_enc_flags(ec_key, old_flags); OPENSSL_free(ep); ECerr(EC_F_ECKEY_PRIV_ENCODE, ERR_R_EC_LIB); + return 0; } /* restore old encoding flags */ EC_KEY_set_enc_flags(ec_key, old_flags); Modified: head/crypto/openssl/crypto/ec/ec_asn1.c ============================================================================== --- head/crypto/openssl/crypto/ec/ec_asn1.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/ec/ec_asn1.c Mon Jun 9 05:50:57 2014 (r267256) @@ -1435,8 +1435,11 @@ int i2o_ECPublicKey(EC_KEY *a, unsigned *out, buf_len, NULL)) { ECerr(EC_F_I2O_ECPUBLICKEY, ERR_R_EC_LIB); - OPENSSL_free(*out); - *out = NULL; + if (new_buffer) + { + OPENSSL_free(*out); + *out = NULL; + } return 0; } if (!new_buffer) Modified: head/crypto/openssl/crypto/ec/ec_lcl.h ============================================================================== --- head/crypto/openssl/crypto/ec/ec_lcl.h Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/ec/ec_lcl.h Mon Jun 9 05:50:57 2014 (r267256) @@ -404,7 +404,7 @@ int ec_GF2m_simple_mul(const EC_GROUP *g int ec_GF2m_precompute_mult(EC_GROUP *group, BN_CTX *ctx); int ec_GF2m_have_precompute_mult(const EC_GROUP *group); -#ifndef OPENSSL_EC_NISTP_64_GCC_128 +#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 /* method functions in ecp_nistp224.c */ int ec_GFp_nistp224_group_init(EC_GROUP *group); int ec_GFp_nistp224_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *n, BN_CTX *); Modified: head/crypto/openssl/crypto/evp/bio_b64.c ============================================================================== --- head/crypto/openssl/crypto/evp/bio_b64.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/evp/bio_b64.c Mon Jun 9 05:50:57 2014 (r267256) @@ -226,6 +226,7 @@ static int b64_read(BIO *b, char *out, i else if (ctx->start) { q=p=(unsigned char *)ctx->tmp; + num = 0; for (j=0; j v) { rv=-1; goto end; } ret+=(v-eof); } else Modified: head/crypto/openssl/crypto/opensslv.h ============================================================================== --- head/crypto/openssl/crypto/opensslv.h Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/opensslv.h Mon Jun 9 05:50:57 2014 (r267256) @@ -25,11 +25,11 @@ * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -#define OPENSSL_VERSION_NUMBER 0x1000107fL +#define OPENSSL_VERSION_NUMBER 0x1000108fL #ifdef OPENSSL_FIPS -#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1g-fips 7 Apr 2014" +#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1h-fips 5 Jun 2014" #else -#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1g-freebsd 7 Apr 2014" +#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1h-freebsd 5 Jun 2014" #endif #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT Modified: head/crypto/openssl/crypto/pkcs12/p12_crt.c ============================================================================== --- head/crypto/openssl/crypto/pkcs12/p12_crt.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/pkcs12/p12_crt.c Mon Jun 9 05:50:57 2014 (r267256) @@ -96,7 +96,11 @@ PKCS12 *PKCS12_create(char *pass, char * nid_cert = NID_pbe_WithSHA1And3_Key_TripleDES_CBC; else #endif +#ifdef OPENSSL_NO_RC2 + nid_cert = NID_pbe_WithSHA1And3_Key_TripleDES_CBC; +#else nid_cert = NID_pbe_WithSHA1And40BitRC2_CBC; +#endif } if (!nid_key) nid_key = NID_pbe_WithSHA1And3_Key_TripleDES_CBC; @@ -286,7 +290,11 @@ int PKCS12_add_safe(STACK_OF(PKCS7) **ps free_safes = 0; if (nid_safe == 0) +#ifdef OPENSSL_NO_RC2 + nid_safe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC; +#else nid_safe = NID_pbe_WithSHA1And40BitRC2_CBC; +#endif if (nid_safe == -1) p7 = PKCS12_pack_p7data(bags); Modified: head/crypto/openssl/crypto/pkcs12/p12_kiss.c ============================================================================== --- head/crypto/openssl/crypto/pkcs12/p12_kiss.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/pkcs12/p12_kiss.c Mon Jun 9 05:50:57 2014 (r267256) @@ -269,7 +269,7 @@ static int parse_bag(PKCS12_SAFEBAG *bag int len, r; unsigned char *data; len = ASN1_STRING_to_UTF8(&data, fname); - if(len > 0) { + if(len >= 0) { r = X509_alias_set1(x509, data, len); OPENSSL_free(data); if (!r) Modified: head/crypto/openssl/crypto/pkcs7/pk7_doit.c ============================================================================== --- head/crypto/openssl/crypto/pkcs7/pk7_doit.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/pkcs7/pk7_doit.c Mon Jun 9 05:50:57 2014 (r267256) @@ -440,6 +440,11 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKE { case NID_pkcs7_signed: data_body=PKCS7_get_octet_string(p7->d.sign->contents); + if (!PKCS7_is_detached(p7) && data_body == NULL) + { + PKCS7err(PKCS7_F_PKCS7_DATADECODE,PKCS7_R_INVALID_SIGNED_DATA_TYPE); + goto err; + } md_sk=p7->d.sign->md_algs; break; case NID_pkcs7_signedAndEnveloped: @@ -928,6 +933,7 @@ int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_ if (EVP_DigestSignUpdate(&mctx,abuf,alen) <= 0) goto err; OPENSSL_free(abuf); + abuf = NULL; if (EVP_DigestSignFinal(&mctx, NULL, &siglen) <= 0) goto err; abuf = OPENSSL_malloc(siglen); Modified: head/crypto/openssl/crypto/pkcs7/pkcs7.h ============================================================================== --- head/crypto/openssl/crypto/pkcs7/pkcs7.h Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/pkcs7/pkcs7.h Mon Jun 9 05:50:57 2014 (r267256) @@ -453,6 +453,7 @@ void ERR_load_PKCS7_strings(void); #define PKCS7_R_ERROR_SETTING_CIPHER 121 #define PKCS7_R_INVALID_MIME_TYPE 131 #define PKCS7_R_INVALID_NULL_POINTER 143 +#define PKCS7_R_INVALID_SIGNED_DATA_TYPE 155 #define PKCS7_R_MIME_NO_CONTENT_TYPE 132 #define PKCS7_R_MIME_PARSE_ERROR 133 #define PKCS7_R_MIME_SIG_PARSE_ERROR 134 Modified: head/crypto/openssl/crypto/pkcs7/pkcs7err.c ============================================================================== --- head/crypto/openssl/crypto/pkcs7/pkcs7err.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/pkcs7/pkcs7err.c Mon Jun 9 05:50:57 2014 (r267256) @@ -1,6 +1,6 @@ /* crypto/pkcs7/pkcs7err.c */ /* ==================================================================== - * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2014 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -130,6 +130,7 @@ static ERR_STRING_DATA PKCS7_str_reasons {ERR_REASON(PKCS7_R_ERROR_SETTING_CIPHER),"error setting cipher"}, {ERR_REASON(PKCS7_R_INVALID_MIME_TYPE) ,"invalid mime type"}, {ERR_REASON(PKCS7_R_INVALID_NULL_POINTER),"invalid null pointer"}, +{ERR_REASON(PKCS7_R_INVALID_SIGNED_DATA_TYPE),"invalid signed data type"}, {ERR_REASON(PKCS7_R_MIME_NO_CONTENT_TYPE),"mime no content type"}, {ERR_REASON(PKCS7_R_MIME_PARSE_ERROR) ,"mime parse error"}, {ERR_REASON(PKCS7_R_MIME_SIG_PARSE_ERROR),"mime sig parse error"}, Modified: head/crypto/openssl/crypto/rsa/rsa_ameth.c ============================================================================== --- head/crypto/openssl/crypto/rsa/rsa_ameth.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/rsa/rsa_ameth.c Mon Jun 9 05:50:57 2014 (r267256) @@ -358,7 +358,7 @@ static int rsa_pss_param_print(BIO *bp, if (i2a_ASN1_INTEGER(bp, pss->saltLength) <= 0) goto err; } - else if (BIO_puts(bp, "0x14 (default)") <= 0) + else if (BIO_puts(bp, "14 (default)") <= 0) goto err; BIO_puts(bp, "\n"); Modified: head/crypto/openssl/crypto/srp/srp_vfy.c ============================================================================== --- head/crypto/openssl/crypto/srp/srp_vfy.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/srp/srp_vfy.c Mon Jun 9 05:50:57 2014 (r267256) @@ -93,6 +93,9 @@ static int t_fromb64(unsigned char *a, c else a[i] = loc - b64table; ++i; } + /* if nothing valid to process we have a zero length response */ + if (i == 0) + return 0; size = i; i = size - 1; j = size; Modified: head/crypto/openssl/crypto/ts/ts_rsp_verify.c ============================================================================== --- head/crypto/openssl/crypto/ts/ts_rsp_verify.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/ts/ts_rsp_verify.c Mon Jun 9 05:50:57 2014 (r267256) @@ -629,6 +629,7 @@ static int TS_compute_imprint(BIO *data, X509_ALGOR_free(*md_alg); OPENSSL_free(*imprint); *imprint_len = 0; + *imprint = NULL; return 0; } Modified: head/crypto/openssl/crypto/x509v3/v3_purp.c ============================================================================== --- head/crypto/openssl/crypto/x509v3/v3_purp.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/crypto/x509v3/v3_purp.c Mon Jun 9 05:50:57 2014 (r267256) @@ -389,8 +389,8 @@ static void x509v3_cache_extensions(X509 /* Handle proxy certificates */ if((pci=X509_get_ext_d2i(x, NID_proxyCertInfo, NULL, NULL))) { if (x->ex_flags & EXFLAG_CA - || X509_get_ext_by_NID(x, NID_subject_alt_name, 0) >= 0 - || X509_get_ext_by_NID(x, NID_issuer_alt_name, 0) >= 0) { + || X509_get_ext_by_NID(x, NID_subject_alt_name, -1) >= 0 + || X509_get_ext_by_NID(x, NID_issuer_alt_name, -1) >= 0) { x->ex_flags |= EXFLAG_INVALID; } if (pci->pcPathLengthConstraint) { @@ -670,7 +670,7 @@ static int check_purpose_timestamp_sign( return 0; /* Extended Key Usage MUST be critical */ - i_ext = X509_get_ext_by_NID((X509 *) x, NID_ext_key_usage, 0); + i_ext = X509_get_ext_by_NID((X509 *) x, NID_ext_key_usage, -1); if (i_ext >= 0) { X509_EXTENSION *ext = X509_get_ext((X509 *) x, i_ext); Modified: head/crypto/openssl/doc/apps/cms.pod ============================================================================== --- head/crypto/openssl/doc/apps/cms.pod Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/doc/apps/cms.pod Mon Jun 9 05:50:57 2014 (r267256) @@ -90,6 +90,11 @@ decrypt mail using the supplied certific encrypted mail message in MIME format for the input file. The decrypted mail is written to the output file. +=item B<-debug_decrypt> + +this option sets the B flag. This option should be used +with caution: see the notes section below. + =item B<-sign> sign mail using the supplied certificate and private key. Input file is @@ -446,6 +451,16 @@ Streaming is always used for the B<-sign since the content is no longer part of the CMS structure the encoding remains DER. +If the B<-decrypt> option is used without a recipient certificate then an +attempt is made to locate the recipient by trying each potential recipient +in turn using the supplied private key. To thwart the MMA attack +(Bleichenbacher's attack on PKCS #1 v1.5 RSA padding) all recipients are +tried whether they succeed or not and if no recipients match the message +is "decrypted" using a random key which will typically output garbage. +The B<-debug_decrypt> option can be used to disable the MMA attack protection +and return an error if no recipient can be found: this option should be used +with caution. For a fuller description see L). + =head1 EXIT CODES =over 4 Modified: head/crypto/openssl/doc/apps/enc.pod ============================================================================== --- head/crypto/openssl/doc/apps/enc.pod Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/doc/apps/enc.pod Mon Jun 9 05:50:57 2014 (r267256) @@ -215,6 +215,10 @@ unsupported options (for example B program does not support authenticated encryption modes +like CCM and GCM. The utility does not store or retrieve the +authentication tag. + base64 Base 64 Modified: head/crypto/openssl/doc/apps/s_server.pod ============================================================================== --- head/crypto/openssl/doc/apps/s_server.pod Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/doc/apps/s_server.pod Mon Jun 9 05:50:57 2014 (r267256) @@ -44,6 +44,7 @@ B B [B<-no_ssl3>] [B<-no_tls1>] [B<-no_dhe>] +[B<-no_ecdhe>] [B<-bugs>] [B<-hack>] [B<-www>] @@ -131,6 +132,11 @@ a static set of parameters hard coded in if this option is set then no DH parameters will be loaded effectively disabling the ephemeral DH cipher suites. +=item B<-no_ecdhe> + +if this option is set then no ECDH parameters will be loaded effectively +disabling the ephemeral ECDH cipher suites. + =item B<-no_tmp_rsa> certain export cipher suites sometimes use a temporary RSA key, this option Modified: head/crypto/openssl/doc/apps/smime.pod ============================================================================== --- head/crypto/openssl/doc/apps/smime.pod Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/doc/apps/smime.pod Mon Jun 9 05:50:57 2014 (r267256) @@ -159,7 +159,7 @@ EVP_get_cipherbyname() function) can als example B<-aes_128_cbc>. See L|enc(1)> for list of ciphers supported by your version of OpenSSL. -If not specified 40 bit RC2 is used. Only used with B<-encrypt>. +If not specified triple DES is used. Only used with B<-encrypt>. =item B<-nointern> Modified: head/crypto/openssl/doc/apps/verify.pod ============================================================================== --- head/crypto/openssl/doc/apps/verify.pod Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/doc/apps/verify.pod Mon Jun 9 05:50:57 2014 (r267256) @@ -25,6 +25,7 @@ B B [B<-untrusted file>] [B<-help>] [B<-issuer_checks>] +[B<-attime timestamp>] [B<-verbose>] [B<->] [certificates] @@ -80,6 +81,12 @@ rejected. The presence of rejection mess anything is wrong; during the normal verification process, several rejections may take place. +=item B<-attime timestamp> + +Perform validation checks using time specified by B and not +current system time. B is the number of seconds since +01.01.1970 (UNIX time). + =item B<-policy arg> Enable policy processing and add B to the user-initial-policy-set (see @@ -386,7 +393,7 @@ an application specific error. Unused. =head1 BUGS -Although the issuer checks are a considerably improvement over the old technique they still +Although the issuer checks are a considerable improvement over the old technique they still suffer from limitations in the underlying X509_LOOKUP API. One consequence of this is that trusted certificates with matching subject name must either appear in a file (as specified by the B<-CAfile> option) or a directory (as specified by B<-CApath>. If they occur in both then only Modified: head/crypto/openssl/doc/apps/version.pod ============================================================================== --- head/crypto/openssl/doc/apps/version.pod Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/doc/apps/version.pod Mon Jun 9 05:50:57 2014 (r267256) @@ -13,6 +13,7 @@ B [B<-o>] [B<-f>] [B<-p>] +[B<-d>] =head1 DESCRIPTION @@ -38,7 +39,7 @@ the date the current version of OpenSSL option information: various options set when the library was built. -=item B<-c> +=item B<-f> compilation flags. Modified: head/crypto/openssl/doc/apps/x509v3_config.pod ============================================================================== --- head/crypto/openssl/doc/apps/x509v3_config.pod Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/doc/apps/x509v3_config.pod Mon Jun 9 05:50:57 2014 (r267256) @@ -301,7 +301,7 @@ Example: O=Organisation CN=Some Name - + =head2 Certificate Policies. This is a I extension. All the fields of this extension can be set by @@ -390,7 +390,7 @@ Examples: nameConstraints=permitted;email:.somedomain.com nameConstraints=excluded;email:.com -issuingDistributionPoint = idp_section + =head2 OCSP No Check Modified: head/crypto/openssl/doc/crypto/CMS_decrypt.pod ============================================================================== --- head/crypto/openssl/doc/crypto/CMS_decrypt.pod Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/doc/crypto/CMS_decrypt.pod Mon Jun 9 05:50:57 2014 (r267256) @@ -27,7 +27,21 @@ function or errors about unknown algorit Although the recipients certificate is not needed to decrypt the data it is needed to locate the appropriate (of possible several) recipients in the CMS -structure. If B is set to NULL all possible recipients are tried. +structure. + +If B is set to NULL all possible recipients are tried. This case however +is problematic. To thwart the MMA attack (Bleichenbacher's attack on +PKCS #1 v1.5 RSA padding) all recipients are tried whether they succeed or +not. If no recipient succeeds then a random symmetric key is used to decrypt +the content: this will typically output garbage and may (but is not guaranteed +to) ultimately return a padding error only. If CMS_decrypt() just returned an +error when all recipient encrypted keys failed to decrypt an attacker could +use this in a timing attack. If the special flag B is set +then the above behaviour is modified and an error B returned if no +recipient encrypted key can be decrypted B generating a random +content encryption key. Applications should use this flag with +B especially in automated gateways as it can leave them +open to attack. It is possible to determine the correct recipient key by other means (for example looking them up in a database) and setting them in the CMS structure Modified: head/crypto/openssl/doc/crypto/CONF_modules_free.pod ============================================================================== --- head/crypto/openssl/doc/crypto/CONF_modules_free.pod Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/doc/crypto/CONF_modules_free.pod Mon Jun 9 05:50:57 2014 (r267256) @@ -37,7 +37,7 @@ None of the functions return a value. =head1 SEE ALSO L, L, -L +L =head1 HISTORY Modified: head/crypto/openssl/doc/crypto/CONF_modules_load_file.pod ============================================================================== --- head/crypto/openssl/doc/crypto/CONF_modules_load_file.pod Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/doc/crypto/CONF_modules_load_file.pod Mon Jun 9 05:50:57 2014 (r267256) @@ -51,7 +51,7 @@ return value of the failing module (this =head1 SEE ALSO L, L, -L, L +L, L =head1 HISTORY Modified: head/crypto/openssl/doc/crypto/OPENSSL_config.pod ============================================================================== --- head/crypto/openssl/doc/crypto/OPENSSL_config.pod Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/doc/crypto/OPENSSL_config.pod Mon Jun 9 05:50:57 2014 (r267256) @@ -73,7 +73,7 @@ Neither OPENSSL_config() nor OPENSSL_no_ =head1 SEE ALSO L, L, -L +L =head1 HISTORY Modified: head/crypto/openssl/doc/crypto/X509_NAME_ENTRY_get_object.pod ============================================================================== --- head/crypto/openssl/doc/crypto/X509_NAME_ENTRY_get_object.pod Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/doc/crypto/X509_NAME_ENTRY_get_object.pod Mon Jun 9 05:50:57 2014 (r267256) @@ -65,7 +65,7 @@ set first so the relevant field informat =head1 SEE ALSO L, L, -L +L =head1 HISTORY Modified: head/crypto/openssl/doc/crypto/X509_STORE_CTX_get_ex_new_index.pod ============================================================================== --- head/crypto/openssl/doc/crypto/X509_STORE_CTX_get_ex_new_index.pod Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/doc/crypto/X509_STORE_CTX_get_ex_new_index.pod Mon Jun 9 05:50:57 2014 (r267256) @@ -15,7 +15,7 @@ X509_STORE_CTX_get_ex_new_index, X509_ST int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *d, int idx, void *arg); - char *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *d, int idx); + void *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *d, int idx); =head1 DESCRIPTION Modified: head/crypto/openssl/doc/fingerprints.txt ============================================================================== --- head/crypto/openssl/doc/fingerprints.txt Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/doc/fingerprints.txt Mon Jun 9 05:50:57 2014 (r267256) @@ -21,6 +21,13 @@ pub 2048R/F295C759 1998-12-13 Key fingerprint = D0 5D 8C 61 6E 27 E6 60 41 EC B1 B8 D5 7E E5 97 uid Dr S N Henson +pub 4096R/FA40E9E2 2005-03-19 + Key fingerprint = 6260 5AA4 334A F9F0 DDE5 D349 D357 7507 FA40 E9E2 +uid Dr Stephen Henson +uid Dr Stephen Henson +uid Dr Stephen N Henson +sub 4096R/8811F530 2005-03-19 + pub 1024R/49A563D9 1997-02-24 Key fingerprint = 7B 79 19 FA 71 6B 87 25 0E 77 21 E5 52 D9 83 BF uid Mark Cox Modified: head/crypto/openssl/doc/ssl/SSL_CTX_set_msg_callback.pod ============================================================================== --- head/crypto/openssl/doc/ssl/SSL_CTX_set_msg_callback.pod Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/doc/ssl/SSL_CTX_set_msg_callback.pod Mon Jun 9 05:50:57 2014 (r267256) @@ -11,8 +11,8 @@ SSL_CTX_set_msg_callback, SSL_CTX_set_ms void SSL_CTX_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); void SSL_CTX_set_msg_callback_arg(SSL_CTX *ctx, void *arg); - void SSL_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); - void SSL_set_msg_callback_arg(SSL_CTX *ctx, void *arg); + void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); + void SSL_set_msg_callback_arg(SSL *ssl, void *arg); =head1 DESCRIPTION Modified: head/crypto/openssl/doc/ssl/SSL_CTX_set_options.pod ============================================================================== --- head/crypto/openssl/doc/ssl/SSL_CTX_set_options.pod Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/doc/ssl/SSL_CTX_set_options.pod Mon Jun 9 05:50:57 2014 (r267256) @@ -112,6 +112,12 @@ vulnerability affecting CBC ciphers, whi broken SSL implementations. This option has no effect for connections using other ciphers. +=item SSL_OP_TLSEXT_PADDING + +Adds a padding extension to ensure the ClientHello size is never between +256 and 511 bytes in length. This is needed as a workaround for some +implementations. + =item SSL_OP_ALL All of the above bug workarounds. Modified: head/crypto/openssl/doc/ssl/SSL_get_peer_cert_chain.pod ============================================================================== --- head/crypto/openssl/doc/ssl/SSL_get_peer_cert_chain.pod Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/doc/ssl/SSL_get_peer_cert_chain.pod Mon Jun 9 05:50:57 2014 (r267256) @@ -8,11 +8,11 @@ SSL_get_peer_cert_chain - get the X509 c #include - STACKOF(X509) *SSL_get_peer_cert_chain(const SSL *ssl); + STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *ssl); =head1 DESCRIPTION -SSL_get_peer_cert_chain() returns a pointer to STACKOF(X509) certificates +SSL_get_peer_cert_chain() returns a pointer to STACK_OF(X509) certificates forming the certificate chain of the peer. If called on the client side, the stack also contains the peer's certificate; if called on the server side, the peer's certificate must be obtained separately using @@ -24,7 +24,7 @@ If the peer did not present a certificat The peer certificate chain is not necessarily available after reusing a session, in which case a NULL pointer is returned. -The reference count of the STACKOF(X509) object is not incremented. +The reference count of the STACK_OF(X509) object is not incremented. If the corresponding session is freed, the pointer must not be used any longer. @@ -39,7 +39,7 @@ The following return values can occur: No certificate was presented by the peer or no connection was established or the certificate chain is no longer available when a session is reused. -=item Pointer to a STACKOF(X509) +=item Pointer to a STACK_OF(X509) The return value points to the certificate chain presented by the peer. Modified: head/crypto/openssl/engines/ccgost/gost_ameth.c ============================================================================== --- head/crypto/openssl/engines/ccgost/gost_ameth.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/engines/ccgost/gost_ameth.c Mon Jun 9 05:50:57 2014 (r267256) @@ -269,7 +269,7 @@ static int pkey_ctrl_gost(EVP_PKEY *pkey case ASN1_PKEY_CTRL_CMS_ENVELOPE: if (arg1 == 0) { - X509_ALGOR *alg; + X509_ALGOR *alg = NULL; ASN1_STRING * params = encode_gost_algor_params(pkey); if (!params) { Modified: head/crypto/openssl/ssl/Makefile ============================================================================== --- head/crypto/openssl/ssl/Makefile Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/ssl/Makefile Mon Jun 9 05:50:57 2014 (r267256) @@ -15,7 +15,7 @@ KRB5_INCLUDES= CFLAGS= $(INCLUDES) $(CFLAG) GENERAL=Makefile README ssl-lib.com install.com -TEST=ssltest.c +TEST=ssltest.c heartbeat_test.c APPS= LIB=$(TOP)/libssl.a Modified: head/crypto/openssl/ssl/d1_both.c ============================================================================== --- head/crypto/openssl/ssl/d1_both.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/ssl/d1_both.c Mon Jun 9 05:50:57 2014 (r267256) @@ -683,8 +683,8 @@ dtls1_reassemble_fragment(SSL *s, struct item = pitem_new(seq64be, frag); if (item == NULL) { - goto err; i = -1; + goto err; } pqueue_insert(s->d1->buffered_messages, item); Modified: head/crypto/openssl/ssl/d1_lib.c ============================================================================== --- head/crypto/openssl/ssl/d1_lib.c Mon Jun 9 03:38:03 2014 (r267255) +++ head/crypto/openssl/ssl/d1_lib.c Mon Jun 9 05:50:57 2014 (r267256) @@ -176,9 +176,12 @@ static void dtls1_clear_queues(SSL *s) while ( (item = pqueue_pop(s->d1->buffered_app_data.q)) != NULL) { - frag = (hm_fragment *)item->data; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 06:16:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8156FDEE; Mon, 9 Jun 2014 06:16:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F4ED2FC3; Mon, 9 Jun 2014 06:16:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s596GD4W014172; Mon, 9 Jun 2014 06:16:13 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s596GDwk014171; Mon, 9 Jun 2014 06:16:13 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201406090616.s596GDwk014171@svn.freebsd.org> From: Eitan Adler Date: Mon, 9 Jun 2014 06:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267260 - head/usr.sbin/acpi/acpiconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 06:16:13 -0000 Author: eadler Date: Mon Jun 9 06:16:12 2014 New Revision: 267260 URL: http://svnweb.freebsd.org/changeset/base/267260 Log: acpiconf(8): bump .Dd Reported by: gjb Modified: head/usr.sbin/acpi/acpiconf/acpiconf.8 Modified: head/usr.sbin/acpi/acpiconf/acpiconf.8 ============================================================================== --- head/usr.sbin/acpi/acpiconf/acpiconf.8 Mon Jun 9 06:03:38 2014 (r267259) +++ head/usr.sbin/acpi/acpiconf/acpiconf.8 Mon Jun 9 06:16:12 2014 (r267260) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2004 +.Dd June 6, 2014 .Dt ACPICONF 8 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 06:17:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66522F33; Mon, 9 Jun 2014 06:17:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A2F32FCE; Mon, 9 Jun 2014 06:17:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s596H3Mc014326; Mon, 9 Jun 2014 06:17:03 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s596H36Z014325; Mon, 9 Jun 2014 06:17:03 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201406090617.s596H36Z014325@svn.freebsd.org> From: Eitan Adler Date: Mon, 9 Jun 2014 06:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267261 - head/usr.sbin/acpi/acpiconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 06:17:03 -0000 Author: eadler Date: Mon Jun 9 06:17:02 2014 New Revision: 267261 URL: http://svnweb.freebsd.org/changeset/base/267261 Log: acpiconf(8): check the calendar Modified: head/usr.sbin/acpi/acpiconf/acpiconf.8 Modified: head/usr.sbin/acpi/acpiconf/acpiconf.8 ============================================================================== --- head/usr.sbin/acpi/acpiconf/acpiconf.8 Mon Jun 9 06:16:12 2014 (r267260) +++ head/usr.sbin/acpi/acpiconf/acpiconf.8 Mon Jun 9 06:17:02 2014 (r267261) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 6, 2014 +.Dd June 8, 2014 .Dt ACPICONF 8 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 09:10:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C481B31; Mon, 9 Jun 2014 09:10:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A3212EAF; Mon, 9 Jun 2014 09:10:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s599AWIj092761; Mon, 9 Jun 2014 09:10:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s599AW6A092760; Mon, 9 Jun 2014 09:10:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406090910.s599AW6A092760@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 9 Jun 2014 09:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267264 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 09:10:32 -0000 Author: kib Date: Mon Jun 9 09:10:31 2014 New Revision: 267264 URL: http://svnweb.freebsd.org/changeset/base/267264 Log: Devolatile as needed. Sponsored by: The FreeBSD Foundation MFC after: 13 days Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Jun 9 07:21:42 2014 (r267263) +++ head/sys/kern/vfs_bio.c Mon Jun 9 09:10:31 2014 (r267264) @@ -476,7 +476,7 @@ bufspacewakeup(void) break; } if (need_wakeup) - wakeup((void *)&needsbuffer); + wakeup(__DEVOLATILE(void *, &needsbuffer)); rw_runlock(&nblock); } @@ -559,7 +559,7 @@ bufcountadd(struct buf *bp) break; } if (need_wakeup) - wakeup((void *)&needsbuffer); + wakeup(__DEVOLATILE(void *, &needsbuffer)); rw_runlock(&nblock); } @@ -2142,8 +2142,8 @@ getnewbuf_bufd_help(struct vnode *vp, in if ((needsbuffer & flags) == 0) break; } - error = rw_sleep((void *)&needsbuffer, &nblock, (PRIBIO + 4) | - slpflag, waitmsg, slptimeo); + error = rw_sleep(__DEVOLATILE(void *, &needsbuffer), &nblock, + (PRIBIO + 4) | slpflag, waitmsg, slptimeo); if (error != 0) break; } From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 10:39:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DDAA50F; Mon, 9 Jun 2014 10:39:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48C9626D3; Mon, 9 Jun 2014 10:39:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59Adu1M033506; Mon, 9 Jun 2014 10:39:56 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59Adt4H033501; Mon, 9 Jun 2014 10:39:55 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201406091039.s59Adt4H033501@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 9 Jun 2014 10:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267265 - in head: etc/mtree usr.bin/truncate usr.bin/truncate/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 10:39:56 -0000 Author: jilles Date: Mon Jun 9 10:39:55 2014 New Revision: 267265 URL: http://svnweb.freebsd.org/changeset/base/267265 Log: truncate: Detect integer overflow, fix relative sizes, add tests. The change to expand_number (r204654) broke detection of too large sizes and relative sizes ('+'/'-'). Also add some tests. PR: 190735 Submitted by: Kirk Russell MFC after: 1 week Added: head/usr.bin/truncate/tests/ head/usr.bin/truncate/tests/Makefile (contents, props changed) head/usr.bin/truncate/tests/truncate_test.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/truncate/Makefile head/usr.bin/truncate/truncate.c Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Jun 9 09:10:31 2014 (r267264) +++ head/etc/mtree/BSD.tests.dist Mon Jun 9 10:39:55 2014 (r267265) @@ -251,6 +251,8 @@ .. tr .. + truncate + .. uudecode .. uuencode Modified: head/usr.bin/truncate/Makefile ============================================================================== --- head/usr.bin/truncate/Makefile Mon Jun 9 09:10:31 2014 (r267264) +++ head/usr.bin/truncate/Makefile Mon Jun 9 10:39:55 2014 (r267265) @@ -1,7 +1,13 @@ # $FreeBSD$ +.include + PROG= truncate DPADD= ${LIBUTIL} LDADD= -lutil +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/usr.bin/truncate/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/truncate/tests/Makefile Mon Jun 9 10:39:55 2014 (r267265) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/usr.bin/truncate +ATF_TESTS_SH= truncate_test + +.include Added: head/usr.bin/truncate/tests/truncate_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/truncate/tests/truncate_test.sh Mon Jun 9 10:39:55 2014 (r267265) @@ -0,0 +1,402 @@ +# +# Copyright 2014, Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD$ +# + +# Helper function that is always used to create and fill stderr.txt for these +# tests. +_custom_create_file() +{ + # The first argument is a command. + # The second is just a string. + case "${1}" in + creat) > stderr.txt ;; + print) [ "${2}" ] && \ + printf "%s\n" "${2}" >> stderr.txt ;; + esac +} + +# Helper function that create the file stderr.txt that contains the string +# passed in as the first argument. +create_stderr_file() +{ + _custom_create_file creat + _custom_create_file print "${1}" +} + +# Helper function that create the file stderr.txt that contains the expected +# truncate utility usage message. +create_stderr_usage_file() +{ + _custom_create_file creat + _custom_create_file print "${1}" + _custom_create_file print \ + "usage: truncate [-c] -s [+|-]size[K|k|M|m|G|g|T|t] file ..." + _custom_create_file print " truncate [-c] -r rfile file ..." +} + +atf_test_case illegal_option +illegal_option_head() +{ + atf_set "descr" "Verifies that truncate exits >0 when passed an" \ + "invalid command line option" +} +illegal_option_body() +{ + create_stderr_usage_file 'truncate: illegal option -- 7' + + # We expect the error message, with no new files. + atf_check -s not-exit:0 -e file:stderr.txt truncate -7 -s0 output.txt + [ ! -e output.txt ] || atf_fail "output.txt should not exist" +} + +atf_test_case illegal_size +illegal_size_head() +{ + atf_set "descr" "Verifies that truncate exits >0 when passed an" \ + "invalid power of two convention" +} +illegal_size_body() +{ + create_stderr_file "truncate: invalid size argument \`+1L'" + + # We expect the error message, with no new files. + atf_check -s not-exit:0 -e file:stderr.txt truncate -s+1L output.txt + [ ! -e output.txt ] || atf_fail "output.txt should not exist" +} + +atf_test_case too_large_size +too_large_size_head() +{ + atf_set "descr" "Verifies that truncate exits >0 when passed an" \ + "a size that is INT64_MAX < size <= UINT64_MAX" +} +too_large_size_body() +{ + create_stderr_file "truncate: invalid size argument \`8388608t'" + + # We expect the error message, with no new files. + atf_check -s not-exit:0 -e file:stderr.txt \ + truncate -s8388608t output.txt + [ ! -e output.txt ] || atf_fail "output.txt should not exist" +} + +atf_test_case opt_c +opt_c_head() +{ + atf_set "descr" "Verifies that -c prevents creation of new files" +} +opt_c_body() +{ + # No new files and truncate returns 0 as if this is a success. + atf_check truncate -c -s 0 doesnotexist.txt + [ ! -e output.txt ] || atf_fail "doesnotexist.txt should not exist" + > reference + atf_check truncate -c -r reference doesnotexist.txt + [ ! -e output.txt ] || atf_fail "doesnotexist.txt should not exist" + + create_stderr_file + + # The existing file will be altered by truncate. + > exists.txt + atf_check -e file:stderr.txt truncate -c -s1 exists.txt + [ -s exists.txt ] || atf_fail "exists.txt be larger than zero bytes" +} + +atf_test_case opt_rs +opt_rs_head() +{ + atf_set "descr" "Verifies that truncate command line flags" \ + "-s and -r cannot be specifed together" +} +opt_rs_body() +{ + create_stderr_usage_file + + # Force an error due to the use of both -s and -r. + > afile + atf_check -s not-exit:0 -e file:stderr.txt truncate -s0 -r afile afile +} + +atf_test_case no_files +no_files_head() +{ + atf_set "descr" "Verifies that truncate needs a list of files on" \ + "the command line" +} +no_files_body() +{ + create_stderr_usage_file + + # A list of files must be present on the command line. + atf_check -s not-exit:0 -e file:stderr.txt truncate -s1 +} + +atf_test_case bad_refer +bad_refer_head() +{ + atf_set "descr" "Verifies that truncate detects a non-existent" \ + "reference file" +} +bad_refer_body() +{ + create_stderr_file "truncate: afile: No such file or directory" + + # The reference file must exist before you try to use it. + atf_check -s not-exit:0 -e file:stderr.txt truncate -r afile afile + [ ! -e afile ] || atf_fail "afile should not exist" +} + +atf_test_case bad_truncate cleanup +bad_truncate_head() +{ + atf_set "descr" "Verifies that truncate reports an error during" \ + "truncation" +} +bad_truncate_body() +{ + create_stderr_file "truncate: exists.txt: Operation not permitted" + + # Trying to get the ftruncate() call to return -1. + > exists.txt + atf_check chflags uimmutable exists.txt + + atf_check -s not-exit:0 -e file:stderr.txt truncate -s1 exists.txt +} +bad_truncate_cleanup() +{ + chflags 0 exists.txt +} + +atf_test_case new_absolute_grow +new_absolute_grow_head() +{ + atf_set "descr" "Verifies truncate can make and grow a new 1m file" +} +new_absolute_grow_body() +{ + create_stderr_file + + # Create a new file and grow it to 1024 bytes. + atf_check -s exit:0 -e file:stderr.txt truncate -s1k output.txt + atf_check -s exit:1 cmp -s output.txt /dev/zero + eval $(stat -s output.txt) + [ ${st_size} -eq 1024 ] || atf_fail "expected file size of 1k" + + create_stderr_file + + # Grow the existing file to 1M. We are using absolute sizes. + atf_check -s exit:0 -e file:stderr.txt truncate -c -s1M output.txt + atf_check -s exit:1 cmp -s output.txt /dev/zero + eval $(stat -s output.txt) + [ ${st_size} -eq 1048576 ] || atf_fail "expected file size of 1m" +} + +atf_test_case new_absolute_shrink +new_absolute_shrink_head() +{ + atf_set "descr" "Verifies that truncate can make and" \ + "shrink a new 1m file" +} +new_absolute_shrink_body() +{ + create_stderr_file + + # Create a new file and grow it to 1048576 bytes. + atf_check -s exit:0 -e file:stderr.txt truncate -s1M output.txt + atf_check -s exit:1 cmp -s output.txt /dev/zero + eval $(stat -s output.txt) + [ ${st_size} -eq 1048576 ] || atf_fail "expected file size of 1m" + + create_stderr_file + + # Shrink the existing file to 1k. We are using absolute sizes. + atf_check -s exit:0 -e file:stderr.txt truncate -s1k output.txt + atf_check -s exit:1 cmp -s output.txt /dev/zero + eval $(stat -s output.txt) + [ ${st_size} -eq 1024 ] || atf_fail "expected file size of 1k" +} + +atf_test_case new_relative_grow +new_relative_grow_head() +{ + atf_set "descr" "Verifies truncate can make and grow a new 1m file" \ + "using relative sizes" +} +new_relative_grow_body() +{ + create_stderr_file + + # Create a new file and grow it to 1024 bytes. + atf_check -s exit:0 -e file:stderr.txt truncate -s+1k output.txt + atf_check -s exit:1 cmp -s output.txt /dev/zero + eval $(stat -s output.txt) + [ ${st_size} -eq 1024 ] || atf_fail "expected file size of 1k" + + create_stderr_file + + # Grow the existing file to 1M. We are using relative sizes. + atf_check -s exit:0 -e file:stderr.txt truncate -s+1047552 output.txt + atf_check -s exit:1 cmp -s output.txt /dev/zero + eval $(stat -s output.txt) + [ ${st_size} -eq 1048576 ] || atf_fail "expected file size of 1m" +} + +atf_test_case new_relative_shrink +new_relative_shrink_head() +{ + atf_set "descr" "Verifies truncate can make and shrink a new 1m file" \ + "using relative sizes" +} +new_relative_shrink_body() +{ + create_stderr_file + + # Create a new file and grow it to 1049600 bytes. + atf_check -s exit:0 -e file:stderr.txt truncate -s+1049600 output.txt + atf_check -s exit:1 cmp -s output.txt /dev/zero + eval $(stat -s output.txt) + [ ${st_size} -eq 1049600 ] || atf_fail "expected file size of 1m" + + create_stderr_file + + # Shrink the existing file to 1k. We are using relative sizes. + atf_check -s exit:0 -e file:stderr.txt truncate -s-1M output.txt + atf_check -s exit:1 cmp -s output.txt /dev/zero + eval $(stat -s output.txt) + [ ${st_size} -eq 1024 ] || atf_fail "expected file size of 1k" +} + +atf_test_case cannot_open +cannot_open_head() +{ + atf_set "descr" "Verifies truncate handles open failures correctly" \ + "in a list of files" + atf_set "require.user" "unprivileged" +} +cannot_open_body() +{ + # Create three files -- the middle file cannot allow writes. + > before + > 0000 + > after + atf_check chmod 0000 0000 + + create_stderr_file "truncate: 0000: Permission denied" + + # Create a new file and grow it to 1024 bytes. + atf_check -s not-exit:0 -e file:stderr.txt \ + truncate -c -s1k before 0000 after + eval $(stat -s before) + [ ${st_size} -eq 1024 ] || atf_fail "expected file size of 1k" + eval $(stat -s after) + [ ${st_size} -eq 1024 ] || atf_fail "expected file size of 1k" + eval $(stat -s 0000) + [ ${st_size} -eq 0 ] || atf_fail "expected file size of zero" +} + +atf_test_case reference +reference_head() +{ + atf_set "descr" "Verifies that truncate can use a reference file" +} +reference_body() +{ + # Create a 4 byte reference file. + printf "123\n" > reference + eval $(stat -s reference) + [ ${st_size} -eq 4 ] || atf_fail "reference file should be 4 bytes" + + create_stderr_file + + # Create a new file and grow it to 4 bytes. + atf_check -e file:stderr.txt truncate -r reference afile + eval $(stat -s afile) + [ ${st_size} -eq 4 ] || atf_fail "new file should also be 4 bytes" +} + +atf_test_case new_zero +new_zero_head() +{ + atf_set "descr" "Verifies truncate can make and grow zero byte file" +} +new_zero_body() +{ + create_stderr_file + + # Create a new file and grow it to zero bytes. + atf_check -s exit:0 -e file:stderr.txt truncate -s0 output.txt + eval $(stat -s output.txt) + [ ${st_size} -eq 0 ] || atf_fail "expected file size of zero" + + # Pretend to grow the file. + atf_check -s exit:0 -e file:stderr.txt truncate -s+0 output.txt + eval $(stat -s output.txt) + [ ${st_size} -eq 0 ] || atf_fail "expected file size of zero" +} + +atf_test_case negative +negative_head() +{ + atf_set "descr" "Verifies truncate treats negative sizes as zero" +} +negative_body() +{ + # Create a 5 byte file. + printf "abcd\n" > afile + eval $(stat -s afile) + [ ${st_size} -eq 5 ] || atf_fail "afile file should be 5 bytes" + + create_stderr_file + + # Create a new file and do a 100 byte negative relative shrink. + atf_check -e file:stderr.txt truncate -s-100 afile + eval $(stat -s afile) + [ ${st_size} -eq 0 ] || atf_fail "new file should now be zero bytes" +} + +atf_init_test_cases() +{ + atf_add_test_case illegal_option + atf_add_test_case illegal_size + atf_add_test_case too_large_size + atf_add_test_case opt_c + atf_add_test_case opt_rs + atf_add_test_case no_files + atf_add_test_case bad_refer + atf_add_test_case bad_truncate + atf_add_test_case cannot_open + atf_add_test_case new_absolute_grow + atf_add_test_case new_absolute_shrink + atf_add_test_case new_relative_grow + atf_add_test_case new_relative_shrink + atf_add_test_case reference + atf_add_test_case new_zero + atf_add_test_case negative +} Modified: head/usr.bin/truncate/truncate.c ============================================================================== --- head/usr.bin/truncate/truncate.c Mon Jun 9 09:10:31 2014 (r267264) +++ head/usr.bin/truncate/truncate.c Mon Jun 9 10:39:55 2014 (r267265) @@ -54,8 +54,8 @@ main(int argc, char **argv) { struct stat sb; mode_t omode; - off_t oflow, rsize, tsize; - int64_t sz; + off_t oflow, rsize, sz, tsize; + uint64_t usz; int ch, error, fd, oflags; char *fname, *rname; @@ -73,11 +73,13 @@ main(int argc, char **argv) rname = optarg; break; case 's': - if (expand_number(optarg, &sz) == -1) + do_relative = *optarg == '+' || *optarg == '-'; + if (expand_number(do_relative ? optarg + 1 : optarg, + &usz) == -1 || (off_t)usz < 0) errx(EXIT_FAILURE, "invalid size argument `%s'", optarg); - if (*optarg == '+' || *optarg == '-') - do_relative = 1; + + sz = (*optarg == '-') ? -(off_t)usz : (off_t)usz; got_size = 1; break; default: From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 13:04:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8C4D9CC; Mon, 9 Jun 2014 13:04:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4D57228A; Mon, 9 Jun 2014 13:04:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59D4wvv002788; Mon, 9 Jun 2014 13:04:58 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59D4wIx002787; Mon, 9 Jun 2014 13:04:58 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201406091304.s59D4wIx002787@svn.freebsd.org> From: Steven Hartland Date: Mon, 9 Jun 2014 13:04:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267267 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 13:04:58 -0000 Author: smh Date: Mon Jun 9 13:04:58 2014 New Revision: 267267 URL: http://svnweb.freebsd.org/changeset/base/267267 Log: Removed stale comment about multi-vdev root pool config not working MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Jun 9 11:07:50 2014 (r267266) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Jun 9 13:04:58 2014 (r267267) @@ -3923,9 +3923,6 @@ spa_generate_rootconf(const char *name) } } - /* - * Multi-vdev root pool configuration discovery is not supported yet. - */ nchildren = 1; nvlist_lookup_uint64(best_cfg, ZPOOL_CONFIG_VDEV_CHILDREN, &nchildren); holes = NULL; From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 14:36:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E82DDB70; Mon, 9 Jun 2014 14:36:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB0FB2AB2; Mon, 9 Jun 2014 14:36:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59EanG6044948; Mon, 9 Jun 2014 14:36:49 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59EanPI044946; Mon, 9 Jun 2014 14:36:49 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201406091436.s59EanPI044946@svn.freebsd.org> From: Julio Merino Date: Mon, 9 Jun 2014 14:36:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267276 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 14:36:50 -0000 Author: jmmv Date: Mon Jun 9 14:36:49 2014 New Revision: 267276 URL: http://svnweb.freebsd.org/changeset/base/267276 Log: Ensure files are created during the build when using bsd.subdir.mk. When FILES is defined in a Makefile that _also_ includes bsd.subdir.mk, the build of the files (if any) was not properly triggered during the build stage. This was because bsd.files.mk did not define the buildfiles target if it was already defined... and bsd.subdir.mk defined this target on its own, thus causing a conflict. Fix this by unconditionally defining buildfiles from bsd.files.mk; this is safe because nothing else in the tree needs to redefine this and because the target itself contains no commands: all it does is define dependencies. Also ensure that bsd.files.mk is always pulled in by bsd.test.mk regardless of what bsd.prog.mk does. These fixes allow "make installworld" to run cleanly on a system with read-only src and obj trees. This is "make tinderbox" clean. Reviewed by: imp Obtained from: jilles Modified: head/share/mk/bsd.files.mk head/share/mk/bsd.test.mk Modified: head/share/mk/bsd.files.mk ============================================================================== --- head/share/mk/bsd.files.mk Mon Jun 9 14:34:33 2014 (r267275) +++ head/share/mk/bsd.files.mk Mon Jun 9 14:36:49 2014 (r267276) @@ -4,13 +4,14 @@ .error bsd.files.mk cannot be included directly. .endif +.if !target(____) +____: + FILESGROUPS?= FILES -.if !target(buildfiles) .for group in ${FILESGROUPS} buildfiles: ${${group}} .endfor -.endif all: buildfiles @@ -65,3 +66,5 @@ _${group}INS: ${_${group}FILES} realinstall: installfiles .ORDER: beforeinstall installfiles + +.endif # !target(____) Modified: head/share/mk/bsd.test.mk ============================================================================== --- head/share/mk/bsd.test.mk Mon Jun 9 14:34:33 2014 (r267275) +++ head/share/mk/bsd.test.mk Mon Jun 9 14:36:49 2014 (r267276) @@ -82,8 +82,7 @@ test: aftertest .if !empty(PROGS) || !empty(PROGS_CXX) || !empty(SCRIPTS) .include -.elif !empty(FILES) -.include .endif +.include .include From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 15:00:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D05E961; Mon, 9 Jun 2014 15:00:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A1C32D2C; Mon, 9 Jun 2014 15:00:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59F0hrC055858; Mon, 9 Jun 2014 15:00:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59F0hcq055857; Mon, 9 Jun 2014 15:00:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406091500.s59F0hcq055857@svn.freebsd.org> From: Alexander Motin Date: Mon, 9 Jun 2014 15:00:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267278 - head/sys/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 15:00:44 -0000 Author: mav Date: Mon Jun 9 15:00:43 2014 New Revision: 267278 URL: http://svnweb.freebsd.org/changeset/base/267278 Log: Fix race in r267221. MFC after: 2 weeks Modified: head/sys/rpc/svc.c Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Mon Jun 9 14:46:32 2014 (r267277) +++ head/sys/rpc/svc.c Mon Jun 9 15:00:43 2014 (r267278) @@ -1210,15 +1210,17 @@ svc_run_internal(SVCGROUP *grp, bool_t i */ if (pool->sp_assign) { stpref = pool->sp_assign(st, rqstp); + rqstp->rq_thread = stpref; STAILQ_INSERT_TAIL(&stpref->st_reqs, rqstp, rq_link); mtx_unlock(&stpref->st_lock); - rqstp->rq_thread = stpref; if (stpref != st) rqstp = NULL; - } else + } else { + rqstp->rq_thread = st; STAILQ_INSERT_TAIL(&st->st_reqs, rqstp, rq_link); + } } } while (rqstp == NULL && stat == XPRT_MOREREQS && grp->sg_state != SVCPOOL_CLOSING); From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 15:44:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A10DC6EC; Mon, 9 Jun 2014 15:44:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E4DA244C; Mon, 9 Jun 2014 15:44:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59FiVQZ078513; Mon, 9 Jun 2014 15:44:31 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59FiV6W078512; Mon, 9 Jun 2014 15:44:31 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406091544.s59FiV6W078512@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 9 Jun 2014 15:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267283 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 15:44:31 -0000 Author: luigi Date: Mon Jun 9 15:44:31 2014 New Revision: 267283 URL: http://svnweb.freebsd.org/changeset/base/267283 Log: sync the code with the one in stable/10 (wrap the if_t compatibilty function into a __FreeBSD_version conditional block) Modified: head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Mon Jun 9 15:24:45 2014 (r267282) +++ head/sys/dev/netmap/netmap_kern.h Mon Jun 9 15:44:31 2014 (r267283) @@ -62,6 +62,9 @@ #define NM_ATOMIC_TEST_AND_SET(p) (!atomic_cmpset_acq_int((p), 0, 1)) #define NM_ATOMIC_CLEAR(p) atomic_store_rel_int((p), 0) +#if __FreeBSD_version >= 1100005 +struct netmap_adapter *netmap_getna(if_t ifp); +#endif MALLOC_DECLARE(M_NETMAP); @@ -1261,7 +1264,6 @@ void netmap_catch_tx(struct netmap_gener int generic_xmit_frame(struct ifnet *ifp, struct mbuf *m, void *addr, u_int len, u_int ring_nr); int generic_find_num_desc(struct ifnet *ifp, u_int *tx, u_int *rx); void generic_find_num_queues(struct ifnet *ifp, u_int *txq, u_int *rxq); -struct netmap_adapter *netmap_getna(if_t ifp); /* * netmap_mitigation API. This is used by the generic adapter From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 15:46:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2EEA5854; Mon, 9 Jun 2014 15:46:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10FF02460; Mon, 9 Jun 2014 15:46:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59FkBJs078820; Mon, 9 Jun 2014 15:46:11 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59FkBAt078819; Mon, 9 Jun 2014 15:46:11 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406091546.s59FkBAt078819@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 9 Jun 2014 15:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267284 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 15:46:12 -0000 Author: luigi Date: Mon Jun 9 15:46:11 2014 New Revision: 267284 URL: http://svnweb.freebsd.org/changeset/base/267284 Log: Fixes from Fanco Ficthner on transparent mode * The way rings are updated changed with the last API bump. Also sync ->head when moving slots in netmap_sw_to_nic(). * Remove a crashing selrecord() call. * Unclog the logic surrounding netmap_rxsync_from_host(). * Add timestamping to RX host ring. * Remove a couple of obsolete comments. Submitted by: Franco Fichtner MFC after: 3 days Sponsored by: Packetwerk Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Mon Jun 9 15:44:31 2014 (r267283) +++ head/sys/dev/netmap/netmap.c Mon Jun 9 15:46:11 2014 (r267284) @@ -981,7 +981,7 @@ netmap_sw_to_nic(struct netmap_adapter * dst->len = tmp.len; dst->flags = NS_BUF_CHANGED; - rdst->cur = nm_next(dst_cur, dst_lim); + rdst->head = rdst->cur = nm_next(dst_cur, dst_lim); } /* if (sent) XXX txsync ? */ } @@ -1028,11 +1028,6 @@ netmap_txsync_to_host(struct netmap_adap * They have been put in kring->rx_queue by netmap_transmit(). * We protect access to the kring using kring->rx_queue.lock * - * This routine also does the selrecord if called from the poll handler - * (we know because td != NULL). - * - * NOTE: on linux, selrecord() is defined as a macro and uses pwait - * as an additional hidden argument. * returns the number of packets delivered to tx queues in * transparent mode, or a negative value if error */ @@ -1088,10 +1083,6 @@ netmap_rxsync_from_host(struct netmap_ad nm_rxsync_finalize(kring); - /* access copies of cur,tail in the kring */ - if (kring->rcur == kring->rtail && td) /* no bufs available */ - selrecord(td, &kring->si); - mbq_unlock(q); return ret; } @@ -2124,8 +2115,6 @@ do_retry_rx: /* * transparent mode support: collect packets * from the rxring(s). - * XXX NR_FORWARD should only be read on - * physical or NIC ports */ if (netmap_fwd ||kring->ring->flags & NR_FORWARD) { ND(10, "forwarding some buffers up %d to %d", @@ -2152,13 +2141,12 @@ do_retry_rx: /* transparent mode XXX only during first pass ? */ if (na->na_flags & NAF_HOST_RINGS) { kring = &na->rx_rings[na->num_rx_rings]; - if (check_all_rx - && (netmap_fwd || kring->ring->flags & NR_FORWARD)) { - /* XXX fix to use kring fields */ - if (nm_ring_empty(kring->ring)) - send_down = netmap_rxsync_from_host(na, td, dev); - if (!nm_ring_empty(kring->ring)) - revents |= want_rx; + if (netmap_fwd || kring->ring->flags & NR_FORWARD) { + send_down = netmap_rxsync_from_host(na, td, dev); + if (send_down && (netmap_no_timestamp == 0 || + kring->ring->flags & NR_TIMESTAMP)) { + microtime(&kring->ring->ts); + } } } From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 18:09:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06F888F6; Mon, 9 Jun 2014 18:09:18 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3B302167; Mon, 9 Jun 2014 18:09:17 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C4BA9B94A; Mon, 9 Jun 2014 14:09:16 -0400 (EDT) From: John Baldwin To: Eitan Adler Subject: Re: svn commit: r267248 - head/usr.sbin/acpi/acpiconf Date: Mon, 9 Jun 2014 11:43:52 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201406090154.s591s18T091857@svn.freebsd.org> In-Reply-To: <201406090154.s591s18T091857@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201406091143.52910.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 09 Jun 2014 14:09:16 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 18:09:18 -0000 On Sunday, June 08, 2014 9:54:01 pm Eitan Adler wrote: > Author: eadler > Date: Mon Jun 9 01:54:00 2014 > New Revision: 267248 > URL: http://svnweb.freebsd.org/changeset/base/267248 > > Log: > acpiconf(8): document 'k' option > > Add missing documentation for the 'k' option based on reading the source > code. Might want some explicit language to say that users should probably never use this option directly. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 18:15:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95295DC4; Mon, 9 Jun 2014 18:15:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 759E7224F; Mon, 9 Jun 2014 18:15:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59IF6Ux055163; Mon, 9 Jun 2014 18:15:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59IF5LE055157; Mon, 9 Jun 2014 18:15:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406091815.s59IF5LE055157@svn.freebsd.org> From: John Baldwin Date: Mon, 9 Jun 2014 18:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267290 - head/sys/dev/hpt27xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 18:15:06 -0000 Author: jhb Date: Mon Jun 9 18:15:05 2014 New Revision: 267290 URL: http://svnweb.freebsd.org/changeset/base/267290 Log: Make the hpt27xx(4) driver MPSAFE. - Use the existing vbus locks instead of Giant for the CAM sim lock. - Use callout(9) instead of timeout(9). - Mark the interrupt handler as MPSAFE. - Don't attempt to pass data in the softc from probe() to attach(). Reviewed by: Steve Chang Assisted by: delphij Modified: head/sys/dev/hpt27xx/hpt27xx_os_bsd.c head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c head/sys/dev/hpt27xx/os_bsd.h Modified: head/sys/dev/hpt27xx/hpt27xx_os_bsd.c ============================================================================== --- head/sys/dev/hpt27xx/hpt27xx_os_bsd.c Mon Jun 9 17:55:23 2014 (r267289) +++ head/sys/dev/hpt27xx/hpt27xx_os_bsd.c Mon Jun 9 18:15:05 2014 (r267290) @@ -288,9 +288,9 @@ void os_request_timer(void * osext, HPT PVBUS_EXT vbus_ext = osext; HPT_ASSERT(vbus_ext->ext_type==EXT_TYPE_VBUS); - - untimeout(os_timer_for_ldm, vbus_ext, vbus_ext->timer); - vbus_ext->timer = timeout(os_timer_for_ldm, vbus_ext, interval * hz / 1000000); + + callout_reset(&vbus_ext->timer, interval * hz / 1000000, + os_timer_for_ldm, vbus_ext); } HPT_TIME os_query_time(void) Modified: head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c ============================================================================== --- head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Mon Jun 9 17:55:23 2014 (r267289) +++ head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Mon Jun 9 18:15:05 2014 (r267290) @@ -31,12 +31,11 @@ #include #include -static int hpt_probe(device_t dev) +static HIM *hpt_match(device_t dev) { PCI_ID pci_id; HIM *him; int i; - PHBA hba; for (him = him_list; him; him = him->next) { for (i=0; him->get_supported_device_id(i, &pci_id); i++) { @@ -44,18 +43,25 @@ static int hpt_probe(device_t dev) him->get_controller_count(&pci_id,0,0); if ((pci_get_vendor(dev) == pci_id.vid) && (pci_get_device(dev) == pci_id.did)){ - KdPrint(("hpt_probe: adapter at PCI %d:%d:%d, IRQ %d", - pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev), pci_get_irq(dev) - )); - device_set_desc(dev, him->name); - hba = (PHBA)device_get_softc(dev); - memset(hba, 0, sizeof(HBA)); - hba->ext_type = EXT_TYPE_HBA; - hba->ldm_adapter.him = him; - return (BUS_PROBE_DEFAULT); + return (him); } } } + return (NULL); +} + +static int hpt_probe(device_t dev) +{ + HIM *him; + + him = hpt_match(dev); + if (him != NULL) { + KdPrint(("hpt_probe: adapter at PCI %d:%d:%d, IRQ %d", + pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev), pci_get_irq(dev) + )); + device_set_desc(dev, him->name); + return (BUS_PROBE_DEFAULT); + } return (ENXIO); } @@ -63,14 +69,17 @@ static int hpt_probe(device_t dev) static int hpt_attach(device_t dev) { PHBA hba = (PHBA)device_get_softc(dev); - HIM *him = hba->ldm_adapter.him; + HIM *him; PCI_ID pci_id; HPT_UINT size; PVBUS vbus; PVBUS_EXT vbus_ext; KdPrint(("hpt_attach(%d/%d/%d)", pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev))); - + + him = hpt_match(dev); + hba->ext_type = EXT_TYPE_HBA; + hba->ldm_adapter.him = him; #if __FreeBSD_version >=440000 pci_enable_busmaster(dev); #endif @@ -93,7 +102,7 @@ static int hpt_attach(device_t dev) if (!him->create_adapter(&pci_id, hba->pciaddr, hba->ldm_adapter.him_handle, hba)) { free(hba->ldm_adapter.him_handle, M_DEVBUF); - return -1; + return ENXIO; } os_printk("adapter at PCI %d:%d:%d, IRQ %d", @@ -104,7 +113,7 @@ static int hpt_attach(device_t dev) vbus_ext = malloc(sizeof(VBUS_EXT) + size, M_DEVBUF, M_WAITOK); if (!vbus_ext) { free(hba->ldm_adapter.him_handle, M_DEVBUF); - return -1; + return ENXIO; } memset(vbus_ext, 0, sizeof(VBUS_EXT)); vbus_ext->ext_type = EXT_TYPE_VBUS; @@ -119,7 +128,7 @@ static int hpt_attach(device_t dev) vbus_ext->hba_list = hba; break; } - } + } return 0; } @@ -431,8 +440,8 @@ static void os_cmddone(PCOMMAND pCmd) union ccb *ccb = ext->ccb; KdPrint(("os_cmddone(%p, %d)", pCmd, pCmd->Result)); - - untimeout(hpt_timeout, pCmd, ext->timeout_ch); + + callout_stop(&ext->timeout); switch(pCmd->Result) { case RETURN_SUCCESS: @@ -510,7 +519,7 @@ static void hpt_io_dmamap_callback(void BUS_DMASYNC_PREWRITE); } } - ext->timeout_ch = timeout(hpt_timeout, pCmd, HPT_OSM_TIMEOUT); + callout_reset(&ext->timeout, HPT_OSM_TIMEOUT, hpt_timeout, pCmd); ldm_queue_cmd(pCmd); } @@ -727,18 +736,15 @@ static void hpt_action(struct cam_sim *s KdPrint(("hpt_action(fn=%d, id=%d)", ccb->ccb_h.func_code, ccb->ccb_h.target_id)); + hpt_assert_vbus_locked(vbus_ext); switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: - hpt_lock_vbus(vbus_ext); hpt_scsi_io(vbus_ext, ccb); - hpt_unlock_vbus(vbus_ext); return; case XPT_RESET_BUS: - hpt_lock_vbus(vbus_ext); ldm_reset_vbus((PVBUS)vbus_ext->vbus); - hpt_unlock_vbus(vbus_ext); break; case XPT_GET_TRAN_SETTINGS: @@ -801,7 +807,10 @@ static void hpt_pci_intr(void *arg) static void hpt_poll(struct cam_sim *sim) { - hpt_pci_intr(cam_sim_softc(sim)); + PVBUS_EXT vbus_ext = (PVBUS_EXT)cam_sim_softc(sim); + + hpt_assert_vbus_locked(vbus_ext); + ldm_intr((PVBUS)vbus_ext->vbus); } static void hpt_async(void * callback_arg, u_int32_t code, struct cam_path * path, void * arg) @@ -852,7 +861,7 @@ static void hpt_do_ioctl(IOCTL_ARG *ioct { PVBUS vbus; PVBUS_EXT vbus_ext; - + ldm_for_each_vbus(vbus, vbus_ext) { __hpt_do_ioctl(vbus_ext, ioctl_args); if (ioctl_args->result!=HPT_IOCTL_RESULT_WRONG_VBUS) @@ -999,7 +1008,10 @@ static void hpt_final_init(void *dummy) /* initializing hardware */ ldm_for_each_vbus(vbus, vbus_ext) { /* make timer available here */ - callout_handle_init(&vbus_ext->timer); +#if (__FreeBSD_version >= 500000) + mtx_init(&vbus_ext->lock, "hptsleeplock", NULL, MTX_DEF); +#endif + callout_init_mtx(&vbus_ext->timer, &vbus_ext->lock, 0); if (hpt_init_vbus(vbus_ext)) { os_printk("fail to initialize hardware"); break; /* FIXME */ @@ -1011,9 +1023,6 @@ static void hpt_final_init(void *dummy) struct cam_devq *devq; struct ccb_setasync ccb; -#if (__FreeBSD_version >= 500000) - mtx_init(&vbus_ext->lock, "hptsleeplock", NULL, MTX_DEF); -#endif if (bus_dma_tag_create(NULL,/* parent */ 4, /* alignment */ BUS_SPACE_MAXADDR_32BIT+1, /* boundary */ @@ -1047,7 +1056,7 @@ static void hpt_final_init(void *dummy) os_printk("Can't create dma map(%d)", i); return ; } - callout_handle_init(&ext->timeout_ch); + callout_init_mtx(&ext->timeout, &vbus_ext->lock, 0); } if ((devq = cam_simq_alloc(os_max_queue_comm)) == NULL) { @@ -1057,7 +1066,7 @@ static void hpt_final_init(void *dummy) #if __FreeBSD_version > 700025 vbus_ext->sim = cam_sim_alloc(hpt_action, hpt_poll, driver_name, - vbus_ext, unit_number, &Giant, os_max_queue_comm, /*tagged*/8, devq); + vbus_ext, unit_number, &vbus_ext->lock, os_max_queue_comm, /*tagged*/8, devq); #else vbus_ext->sim = cam_sim_alloc(hpt_action, hpt_poll, driver_name, vbus_ext, unit_number, os_max_queue_comm, /*tagged*/8, devq); @@ -1069,11 +1078,13 @@ static void hpt_final_init(void *dummy) return ; } + hpt_lock_vbus(vbus_ext); #if __FreeBSD_version > 700044 if (xpt_bus_register(vbus_ext->sim, NULL, 0) != CAM_SUCCESS) { #else if (xpt_bus_register(vbus_ext->sim, 0) != CAM_SUCCESS) { #endif + hpt_unlock_vbus(vbus_ext); os_printk("xpt_bus_register failed"); cam_sim_free(vbus_ext->sim, /*free devq*/ TRUE); vbus_ext->sim = NULL; @@ -1084,6 +1095,7 @@ static void hpt_final_init(void *dummy) cam_sim_path(vbus_ext->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + hpt_unlock_vbus(vbus_ext); os_printk("xpt_create_path failed"); xpt_bus_deregister(cam_sim_path(vbus_ext->sim)); cam_sim_free(vbus_ext->sim, /*free_devq*/TRUE); @@ -1097,6 +1109,7 @@ static void hpt_final_init(void *dummy) ccb.callback = hpt_async; ccb.callback_arg = vbus_ext; xpt_action((union ccb *)&ccb); + hpt_unlock_vbus(vbus_ext); for (hba = vbus_ext->hba_list; hba; hba = hba->next) { int rid = 0; @@ -1107,7 +1120,7 @@ static void hpt_final_init(void *dummy) return ; } - if (bus_setup_intr(hba->pcidev, hba->irq_res, INTR_TYPE_CAM, + if (bus_setup_intr(hba->pcidev, hba->irq_res, INTR_TYPE_CAM | INTR_MPSAFE, #if __FreeBSD_version > 700025 NULL, hpt_pci_intr, vbus_ext, &hba->irq_handle)) #else @@ -1290,16 +1303,8 @@ static int hpt_ioctl(ioctl_dev_t dev, u_ goto invalid; } -#if (__FreeBSD_version >= 500000) - mtx_lock(&Giant); -#endif - hpt_do_ioctl(&ioctl_args); -#if (__FreeBSD_version >= 500000) - mtx_unlock(&Giant); -#endif - if (ioctl_args.result==HPT_IOCTL_RESULT_OK) { if (piop->nOutBufferSize) { if (copyout(ioctl_args.lpOutBuffer, @@ -1340,8 +1345,6 @@ static int hpt_rescan_bus(void) PVBUS vbus; PVBUS_EXT vbus_ext; - mtx_lock(&Giant); - ldm_for_each_vbus(vbus, vbus_ext) { if ((ccb = xpt_alloc_ccb()) == NULL) { Modified: head/sys/dev/hpt27xx/os_bsd.h ============================================================================== --- head/sys/dev/hpt27xx/os_bsd.h Mon Jun 9 17:55:23 2014 (r267289) +++ head/sys/dev/hpt27xx/os_bsd.h Mon Jun 9 18:15:05 2014 (r267290) @@ -174,7 +174,7 @@ typedef struct _os_cmdext { struct _os_cmdext *next; union ccb *ccb; bus_dmamap_t dma_map; - struct callout_handle timeout_ch; + struct callout timeout; SG psg[os_max_sg_descriptors]; } OS_CMDEXT, *POS_CMDEXT; @@ -200,7 +200,7 @@ typedef struct _vbus_ext { OSM_TASK *tasks; struct task worker; - struct callout_handle timer; + struct callout timer; eventhandler_tag shutdown_eh; @@ -212,6 +212,7 @@ VBUS_EXT, *PVBUS_EXT; #if __FreeBSD_version >= 500000 #define hpt_lock_vbus(vbus_ext) mtx_lock(&(vbus_ext)->lock) #define hpt_unlock_vbus(vbus_ext) mtx_unlock(&(vbus_ext)->lock) +#define hpt_assert_vbus_locked(vbus_ext) mtx_assert(&(vbus_ext)->lock, MA_OWNED) #else static __inline void hpt_lock_vbus(PVBUS_EXT vbus_ext) { From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 18:16:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by hub.freebsd.org (Postfix) with ESMTP id 9AD5DF20; Mon, 9 Jun 2014 18:16:12 +0000 (UTC) Message-ID: <5395F9EC.40607@FreeBSD.org> Date: Mon, 09 Jun 2014 14:16:12 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: John Baldwin , Eitan Adler Subject: Re: svn commit: r267248 - head/usr.sbin/acpi/acpiconf References: <201406090154.s591s18T091857@svn.freebsd.org> <201406091143.52910.jhb@freebsd.org> In-Reply-To: <201406091143.52910.jhb@freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 18:16:13 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2014-06-09 11:43:52 -0400, John Baldwin wrote: > On Sunday, June 08, 2014 9:54:01 pm Eitan Adler wrote: >> Author: eadler Date: Mon Jun 9 01:54:00 2014 New Revision: >> 267248 URL: http://svnweb.freebsd.org/changeset/base/267248 >> >> Log: acpiconf(8): document 'k' option >> >> Add missing documentation for the 'k' option based on reading the >> source code. > > Might want some explicit language to say that users should probably > never use this option directly. +1 Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJTlfnrAAoJEHyflib82/FGrT4H/RNo67h4sh44hyAxX2I+k3J7 NMrk1/7sHA/MdvUZaIu3dgXwNaTt58DvzgUgV40VEu4WqdaJkGGS27bVp/S8R021 XCp28HEbe2jnNH9QNDmh+DxoBuZVXnPPu+Zhk7ESA135aoRuADpGtuhghQVNOhjQ MyxZQ/B+TbJzjMfFl/nKN/WAkj/8JCtRthMCmB5/eHVrjege/PG5FC/0e0TdwgSP DeyOYEyR/HJK0FLf0XR2H/j1BFOTf1XoFzNTt8hIQj4Xk8lJRmnxBD1SrXyvFtDo Riz8naMWhRs8idzqchDxU0xJR5PJEieOpOx6MCxkmBNEIX2aDIjDoqKJM8smRHI= =HAgt -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 19:27:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5997C52D; Mon, 9 Jun 2014 19:27:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 465CA28D5; Mon, 9 Jun 2014 19:27:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59JRmbn086862; Mon, 9 Jun 2014 19:27:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59JRlNI086860; Mon, 9 Jun 2014 19:27:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406091927.s59JRlNI086860@svn.freebsd.org> From: John Baldwin Date: Mon, 9 Jun 2014 19:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267291 - head/sys/libkern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 19:27:48 -0000 Author: jhb Date: Mon Jun 9 19:27:47 2014 New Revision: 267291 URL: http://svnweb.freebsd.org/changeset/base/267291 Log: Use strcasecmp() instead of strcmp() when checking user-supplied encoding names so that encoding names are treated as case-insensitive. This allows the use of 'utf-8' instead of 'UTF-8' for example and matches the behavior of iconv(1). PR: 167977 Submitted by: buganini@gmail.com MFC after: 1 week Modified: head/sys/libkern/iconv.c head/sys/libkern/iconv_ucs.c Modified: head/sys/libkern/iconv.c ============================================================================== --- head/sys/libkern/iconv.c Mon Jun 9 18:15:05 2014 (r267290) +++ head/sys/libkern/iconv.c Mon Jun 9 19:27:47 2014 (r267291) @@ -168,8 +168,8 @@ iconv_lookupcs(const char *to, const cha struct iconv_cspair *csp; TAILQ_FOREACH(csp, &iconv_cslist, cp_link) { - if (strcmp(csp->cp_to, to) == 0 && - strcmp(csp->cp_from, from) == 0) { + if (strcasecmp(csp->cp_to, to) == 0 && + strcasecmp(csp->cp_from, from) == 0) { if (cspp) *cspp = csp; return 0; Modified: head/sys/libkern/iconv_ucs.c ============================================================================== --- head/sys/libkern/iconv_ucs.c Mon Jun 9 18:15:05 2014 (r267290) +++ head/sys/libkern/iconv_ucs.c Mon Jun 9 19:27:47 2014 (r267291) @@ -102,9 +102,9 @@ iconv_ucs_open(struct iconv_converter_cl if (cspf) dp->convtype |= KICONV_UCS_COMBINE; for (i = 0; unicode_family[i].name; i++) { - if (strcmp(from, unicode_family[i].name) == 0) + if (strcasecmp(from, unicode_family[i].name) == 0) dp->convtype |= unicode_family[i].from_flag; - if (strcmp(to, unicode_family[i].name) == 0) + if (strcasecmp(to, unicode_family[i].name) == 0) dp->convtype |= unicode_family[i].to_flag; } if (strcmp(ENCODING_UNICODE, ENCODING_UTF16) == 0) From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 19:29:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B86567DC; Mon, 9 Jun 2014 19:29:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A549928F1; Mon, 9 Jun 2014 19:29:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59JTASD087203; Mon, 9 Jun 2014 19:29:10 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59JTAP2087202; Mon, 9 Jun 2014 19:29:10 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201406091929.s59JTAP2087202@svn.freebsd.org> From: Joel Dahl Date: Mon, 9 Jun 2014 19:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267292 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 19:29:10 -0000 Author: joel (doc committer) Date: Mon Jun 9 19:29:10 2014 New Revision: 267292 URL: http://svnweb.freebsd.org/changeset/base/267292 Log: Remove blank lines. Modified: head/usr.sbin/bhyve/bhyve.8 Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Mon Jun 9 19:27:47 2014 (r267291) +++ head/usr.sbin/bhyve/bhyve.8 Mon Jun 9 19:29:10 2014 (r267292) @@ -59,7 +59,6 @@ exit is detected. .Bl -tag -width 10n .It Fl a The guest's local APIC is configured in xAPIC mode. - The xAPIC mode is the default setting so this option is redundant. It will be deprecated in a future version. .It Fl A @@ -103,7 +102,6 @@ per slot. .Bl -tag -width 10n .It Ar slot .Ar pcislot[:function] - .Ar bus:pcislot:function .Pp The From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 19:36:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15E15D3D; Mon, 9 Jun 2014 19:36:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 027E22A04; Mon, 9 Jun 2014 19:36:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59Ja8KZ091618; Mon, 9 Jun 2014 19:36:08 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59Ja8w0091617; Mon, 9 Jun 2014 19:36:08 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201406091936.s59Ja8w0091617@svn.freebsd.org> From: Joel Dahl Date: Mon, 9 Jun 2014 19:36:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267293 - head/sys/boot/i386/gptboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 19:36:09 -0000 Author: joel (doc committer) Date: Mon Jun 9 19:36:08 2014 New Revision: 267293 URL: http://svnweb.freebsd.org/changeset/base/267293 Log: mdoc: fix AUTHORS section. Modified: head/sys/boot/i386/gptboot/gptboot.8 Modified: head/sys/boot/i386/gptboot/gptboot.8 ============================================================================== --- head/sys/boot/i386/gptboot/gptboot.8 Mon Jun 9 19:29:10 2014 (r267292) +++ head/sys/boot/i386/gptboot/gptboot.8 Mon Jun 9 19:36:08 2014 (r267293) @@ -241,5 +241,5 @@ gpart set -a bootonce -i 2 ada0 .Nm appeared in FreeBSD 7.1. .Sh AUTHORS -.An -This manual page written by Warren Block . +This manual page written by +.An Warren Block Aq wblock@FreeBSD.org . From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 19:55:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4718F5FC; Mon, 9 Jun 2014 19:55:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 340E52BF3; Mon, 9 Jun 2014 19:55:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59Jtp96000815; Mon, 9 Jun 2014 19:55:51 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59JtpL9000814; Mon, 9 Jun 2014 19:55:51 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201406091955.s59JtpL9000814@svn.freebsd.org> From: Tycho Nightingale Date: Mon, 9 Jun 2014 19:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267294 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 19:55:51 -0000 Author: tychon Date: Mon Jun 9 19:55:50 2014 New Revision: 267294 URL: http://svnweb.freebsd.org/changeset/base/267294 Log: r267169 should apply to 64-bit BARs as well. Reviewed by: neel Modified: head/usr.sbin/bhyve/pci_emul.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Mon Jun 9 19:36:08 2014 (r267293) +++ head/usr.sbin/bhyve/pci_emul.c Mon Jun 9 19:55:50 2014 (r267294) @@ -376,7 +376,7 @@ pci_emul_mem_handler(struct vmctx *ctx, offset = addr - pdi->pi_bar[bidx].addr; if (dir == MEM_F_WRITE) { - if (pdi->pi_bar[bidx].type == PCIBAR_MEM32 && size == 8) { + if (size == 8) { (*pe->pe_barwrite)(ctx, vcpu, pdi, bidx, offset, 4, *val & 0xffffffff); (*pe->pe_barwrite)(ctx, vcpu, pdi, bidx, offset + 4, @@ -386,7 +386,7 @@ pci_emul_mem_handler(struct vmctx *ctx, size, *val); } } else { - if (pdi->pi_bar[bidx].type == PCIBAR_MEM32 && size == 8) { + if (size == 8) { *val = (*pe->pe_barread)(ctx, vcpu, pdi, bidx, offset, 4); *val |= (*pe->pe_barread)(ctx, vcpu, pdi, bidx, From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 20:48:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23579E6A; Mon, 9 Jun 2014 20:48:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA38C2101; Mon, 9 Jun 2014 20:48:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59Kmdvc025222; Mon, 9 Jun 2014 20:48:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59Kmd4P025218; Mon, 9 Jun 2014 20:48:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406092048.s59Kmd4P025218@svn.freebsd.org> From: John Baldwin Date: Mon, 9 Jun 2014 20:48:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267297 - in head/sys/modules: agp aic7xxx/ahd bios/smapi sound/driver/maestro X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 20:48:40 -0000 Author: jhb Date: Mon Jun 9 20:48:38 2014 New Revision: 267297 URL: http://svnweb.freebsd.org/changeset/base/267297 Log: Re-enable -Werror for these modules. It is already enabled for the same files when built as part of a kernel. Modified: head/sys/modules/agp/Makefile head/sys/modules/aic7xxx/ahd/Makefile head/sys/modules/bios/smapi/Makefile head/sys/modules/sound/driver/maestro/Makefile Modified: head/sys/modules/agp/Makefile ============================================================================== --- head/sys/modules/agp/Makefile Mon Jun 9 20:42:52 2014 (r267296) +++ head/sys/modules/agp/Makefile Mon Jun 9 20:48:38 2014 (r267297) @@ -20,7 +20,6 @@ SRCS+= agp_apple.c SRCS+= device_if.h bus_if.h agp_if.h pci_if.h SRCS+= opt_agp.h MFILES= kern/device_if.m kern/bus_if.m dev/agp/agp_if.m dev/pci/pci_if.m -WERROR= EXPORT_SYMS= agp_find_device \ agp_state \ Modified: head/sys/modules/aic7xxx/ahd/Makefile ============================================================================== --- head/sys/modules/aic7xxx/ahd/Makefile Mon Jun 9 20:42:52 2014 (r267296) +++ head/sys/modules/aic7xxx/ahd/Makefile Mon Jun 9 20:48:38 2014 (r267297) @@ -4,7 +4,6 @@ .PATH: ${.CURDIR}/../../../dev/aic7xxx KMOD= ahd -WERROR= GENSRCS= aic79xx_seq.h aic79xx_reg.h REG_PRINT_OPT= AHD_REG_PRETTY_PRINT=1 Modified: head/sys/modules/bios/smapi/Makefile ============================================================================== --- head/sys/modules/bios/smapi/Makefile Mon Jun 9 20:42:52 2014 (r267296) +++ head/sys/modules/bios/smapi/Makefile Mon Jun 9 20:48:38 2014 (r267297) @@ -6,7 +6,6 @@ KMOD= smapi SRCS= smapi.c smapi_bios.S \ bus_if.h device_if.h -WERROR= .include Modified: head/sys/modules/sound/driver/maestro/Makefile ============================================================================== --- head/sys/modules/sound/driver/maestro/Makefile Mon Jun 9 20:42:52 2014 (r267296) +++ head/sys/modules/sound/driver/maestro/Makefile Mon Jun 9 20:48:38 2014 (r267297) @@ -5,6 +5,5 @@ KMOD= snd_maestro SRCS= device_if.h bus_if.h pci_if.h SRCS+= maestro.c -WERROR= .include From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 20:49:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B13CFFAB; Mon, 9 Jun 2014 20:49:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 911BD2108; Mon, 9 Jun 2014 20:49:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59KnDBB025358; Mon, 9 Jun 2014 20:49:13 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59KnDWR025357; Mon, 9 Jun 2014 20:49:13 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406092049.s59KnDWR025357@svn.freebsd.org> From: Ed Maste Date: Mon, 9 Jun 2014 20:49:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267298 - head/tools/tools/vt/fontcvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 20:49:13 -0000 Author: emaste Date: Mon Jun 9 20:49:13 2014 New Revision: 267298 URL: http://svnweb.freebsd.org/changeset/base/267298 Log: vt fontcvt: Hide stats by default and improve error handling The font stats are interesting, but rather verbose. Modified: head/tools/tools/vt/fontcvt/fontcvt.c Modified: head/tools/tools/vt/fontcvt/fontcvt.c ============================================================================== --- head/tools/tools/vt/fontcvt/fontcvt.c Mon Jun 9 20:48:38 2014 (r267297) +++ head/tools/tools/vt/fontcvt/fontcvt.c Mon Jun 9 20:49:13 2014 (r267298) @@ -88,8 +88,8 @@ static void usage(void) { - fprintf(stderr, -"usage: fontcvt [-w width] [-h height] normal.bdf [bold.bdf] out.fnt\n"); + errx(1, +"usage: fontcvt [-w width] [-h height] [-v] normal.bdf [bold.bdf] out.fnt\n"); exit(1); } @@ -137,7 +137,7 @@ add_mapping(struct glyph *gl, unsigned i ml = &maps[map_idx]; if (TAILQ_LAST(ml, mapping_list) != NULL && TAILQ_LAST(ml, mapping_list)->m_char >= c) { - fprintf(stderr, "Bad ordering at character %u\n", c); + errx(1, "Bad ordering at character %u\n", c); return (1); } TAILQ_INSERT_TAIL(ml, mp, m_list); @@ -210,8 +210,8 @@ parse_bitmap_line(uint8_t *left, uint8_t unsigned int i, subline; if (dwidth != width && dwidth != width * 2) { - fprintf(stderr, - "Unsupported width %u!\n", dwidth); + errx(1, + "Bitmap with unsupported width %u!\n", dwidth); return (1); } @@ -230,7 +230,7 @@ parse_bitmap_line(uint8_t *left, uint8_t *p++ = subline >> 8; *p = subline; } else { - fprintf(stderr, + errx(1, "Unsupported wbytes %u!\n", wbytes); return (1); } @@ -264,7 +264,7 @@ parse_bdf(FILE *fp, unsigned int map_idx (ln[6] == ' ' || ln[6] == '\0')) { for (i = 0; i < height; i++) { if ((ln = fgetln(fp, &length)) == NULL) { - fprintf(stderr, "Unexpected EOF!\n"); + errx(1, "Unexpected EOF!\n"); return (1); } ln[length - 1] = '\0'; @@ -450,10 +450,47 @@ write_fnt(const char *filename) return (0); } +static void +print_font_info(void) +{ + printf( +"Statistics:\n" +"- glyph_total: %5u\n" +"- glyph_normal: %5u\n" +"- glyph_normal_right: %5u\n" +"- glyph_bold: %5u\n" +"- glyph_bold_right: %5u\n" +"- glyph_unique: %5u\n" +"- glyph_dupe: %5u\n" +"- mapping_total: %5u\n" +"- mapping_normal: %5u\n" +"- mapping_normal_folded: %5u\n" +"- mapping_normal_right: %5u\n" +"- mapping_normal_right_folded: %5u\n" +"- mapping_bold: %5u\n" +"- mapping_bold_folded: %5u\n" +"- mapping_bold_right: %5u\n" +"- mapping_bold_right_folded: %5u\n" +"- mapping_unique: %5u\n" +"- mapping_dupe: %5u\n", + glyph_total, + glyph_count[0], + glyph_count[1], + glyph_count[2], + glyph_count[3], + glyph_unique, glyph_dupe, + mapping_total, + map_count[0], map_folded_count[0], + map_count[1], map_folded_count[1], + map_count[2], map_folded_count[2], + map_count[3], map_folded_count[3], + mapping_unique, mapping_dupe); +} + int main(int argc, char *argv[]) { - int ch; + int ch, val, verbose = 0; assert(sizeof(struct file_header) == 32); assert(sizeof(struct file_mapping) == 8); @@ -461,10 +498,23 @@ main(int argc, char *argv[]) while ((ch = getopt(argc, argv, "h:w:")) != -1) { switch (ch) { case 'h': - height = atoi(optarg); + val = atoi(optarg); + if (val <= 0 || val > 128) { + errx(1, "Invalid height %d", val); + return (1); + } + height = val; + break; + case 'v': + verbose = 1; break; case 'w': - width = atoi(optarg); + val = atoi(optarg); + if (val <= 0 || val > 128) { + errx(1, "Invalid width %d", val); + return (1); + } + width = val; break; case '?': default: @@ -496,39 +546,9 @@ main(int argc, char *argv[]) fold_mappings(3); if (write_fnt(argv[0]) != 0) return (1); - - printf( -"Statistics:\n" -"- glyph_total: %5u\n" -"- glyph_normal: %5u\n" -"- glyph_normal_right: %5u\n" -"- glyph_bold: %5u\n" -"- glyph_bold_right: %5u\n" -"- glyph_unique: %5u\n" -"- glyph_dupe: %5u\n" -"- mapping_total: %5u\n" -"- mapping_normal: %5u\n" -"- mapping_normal_folded: %5u\n" -"- mapping_normal_right: %5u\n" -"- mapping_normal_right_folded: %5u\n" -"- mapping_bold: %5u\n" -"- mapping_bold_folded: %5u\n" -"- mapping_bold_right: %5u\n" -"- mapping_bold_right_folded: %5u\n" -"- mapping_unique: %5u\n" -"- mapping_dupe: %5u\n", - glyph_total, - glyph_count[0], - glyph_count[1], - glyph_count[2], - glyph_count[3], - glyph_unique, glyph_dupe, - mapping_total, - map_count[0], map_folded_count[0], - map_count[1], map_folded_count[1], - map_count[2], map_folded_count[2], - map_count[3], map_folded_count[3], - mapping_unique, mapping_dupe); - + + if (verbose) + print_font_info(); + return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 20:50:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83D8618F; Mon, 9 Jun 2014 20:50:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70A102181; Mon, 9 Jun 2014 20:50:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59Kooum027788; Mon, 9 Jun 2014 20:50:50 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59Kooxl027787; Mon, 9 Jun 2014 20:50:50 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406092050.s59Kooxl027787@svn.freebsd.org> From: Glen Barber Date: Mon, 9 Jun 2014 20:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267299 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 20:50:50 -0000 Author: gjb Date: Mon Jun 9 20:50:49 2014 New Revision: 267299 URL: http://svnweb.freebsd.org/changeset/base/267299 Log: Move the Sendmail update to keep revision numbers incremental. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Jun 9 20:49:13 2014 (r267298) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Jun 9 20:50:49 2014 (r267299) @@ -352,9 +352,6 @@ &man.jemalloc.3; has been updated to version 3.5.0. - Sendmail - has been updated from 8.14.7 to 8.14.9. - bmake has been updated to version 20140101. @@ -370,6 +367,9 @@ LLVM and Clang have been updated to version 3.4. + + Sendmail + has been updated from 8.14.7 to 8.14.9. From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 20:51:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9BD32CA; Mon, 9 Jun 2014 20:51:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6E9B2185; Mon, 9 Jun 2014 20:51:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59Kp9eS027892; Mon, 9 Jun 2014 20:51:09 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59Kp9sE027887; Mon, 9 Jun 2014 20:51:09 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201406092051.s59Kp9sE027887@svn.freebsd.org> From: Neel Natu Date: Mon, 9 Jun 2014 20:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267300 - in head/sys/amd64/vmm: intel io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 20:51:10 -0000 Author: neel Date: Mon Jun 9 20:51:08 2014 New Revision: 267300 URL: http://svnweb.freebsd.org/changeset/base/267300 Log: Add reserved bit checking when doing %CR8 emulation and inject #GP if required. Pointed out by: grehan Reviewed by: tychon Modified: head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/io/vlapic.h Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Mon Jun 9 20:50:49 2014 (r267299) +++ head/sys/amd64/vmm/intel/vmx.c Mon Jun 9 20:51:08 2014 (r267300) @@ -1602,20 +1602,23 @@ vmx_emulate_cr4_access(struct vmx *vmx, static int vmx_emulate_cr8_access(struct vmx *vmx, int vcpu, uint64_t exitqual) { - uint64_t regval; + struct vlapic *vlapic; + uint64_t cr8; + int regnum; /* We only handle mov %cr8 to/from a register at this time. */ if ((exitqual & 0xe0) != 0x00) { return (UNHANDLED); } + vlapic = vm_lapic(vmx->vm, vcpu); + regnum = (exitqual >> 8) & 0xf; if (exitqual & 0x10) { - regval = vlapic_get_tpr(vm_lapic(vmx->vm, vcpu)); - vmx_set_guest_reg(vmx, vcpu, (exitqual >> 8) & 0xf, - regval >> 4); + cr8 = vlapic_get_cr8(vlapic); + vmx_set_guest_reg(vmx, vcpu, regnum, cr8); } else { - regval = vmx_get_guest_reg(vmx, vcpu, (exitqual >> 8) & 0xf); - vlapic_set_tpr(vm_lapic(vmx->vm, vcpu), regval << 4); + cr8 = vmx_get_guest_reg(vmx, vcpu, regnum); + vlapic_set_cr8(vlapic, cr8); } return (HANDLED); Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Mon Jun 9 20:50:49 2014 (r267299) +++ head/sys/amd64/vmm/io/vlapic.c Mon Jun 9 20:51:08 2014 (r267300) @@ -906,6 +906,46 @@ vlapic_calcdest(struct vm *vm, cpuset_t static VMM_STAT_ARRAY(IPIS_SENT, VM_MAXCPU, "ipis sent to vcpu"); +static void +vlapic_set_tpr(struct vlapic *vlapic, uint8_t val) +{ + struct LAPIC *lapic = vlapic->apic_page; + + lapic->tpr = val; + vlapic_update_ppr(vlapic); +} + +static uint8_t +vlapic_get_tpr(struct vlapic *vlapic) +{ + struct LAPIC *lapic = vlapic->apic_page; + + return (lapic->tpr); +} + +void +vlapic_set_cr8(struct vlapic *vlapic, uint64_t val) +{ + uint8_t tpr; + + if (val & ~0xf) { + vm_inject_gp(vlapic->vm, vlapic->vcpuid); + return; + } + + tpr = val << 4; + vlapic_set_tpr(vlapic, tpr); +} + +uint64_t +vlapic_get_cr8(struct vlapic *vlapic) +{ + uint8_t tpr; + + tpr = vlapic_get_tpr(vlapic); + return (tpr >> 4); +} + int vlapic_icrlo_write_handler(struct vlapic *vlapic, bool *retu) { @@ -1610,20 +1650,3 @@ vlapic_set_tmr_level(struct vlapic *vlap VLAPIC_CTR1(vlapic, "vector %d set to level-triggered", vector); vlapic_set_tmr(vlapic, vector, true); } - -void -vlapic_set_tpr(struct vlapic *vlapic, uint8_t val) -{ - struct LAPIC *lapic = vlapic->apic_page; - - lapic->tpr = val; - vlapic_update_ppr(vlapic); -} - -uint8_t -vlapic_get_tpr(struct vlapic *vlapic) -{ - struct LAPIC *lapic = vlapic->apic_page; - - return (lapic->tpr); -} Modified: head/sys/amd64/vmm/io/vlapic.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic.h Mon Jun 9 20:50:49 2014 (r267299) +++ head/sys/amd64/vmm/io/vlapic.h Mon Jun 9 20:51:08 2014 (r267300) @@ -92,8 +92,8 @@ void vlapic_reset_tmr(struct vlapic *vla void vlapic_set_tmr_level(struct vlapic *vlapic, uint32_t dest, bool phys, int delmode, int vector); -void vlapic_set_tpr(struct vlapic *vlapic, uint8_t val); -uint8_t vlapic_get_tpr(struct vlapic *vlapic); +void vlapic_set_cr8(struct vlapic *vlapic, uint64_t val); +uint64_t vlapic_get_cr8(struct vlapic *vlapic); /* APIC write handlers */ void vlapic_id_write_handler(struct vlapic *vlapic); From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 20:52:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6401643A; Mon, 9 Jun 2014 20:52:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44B5821A8; Mon, 9 Jun 2014 20:52:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59KqaCq029030; Mon, 9 Jun 2014 20:52:36 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59Kqaha029029; Mon, 9 Jun 2014 20:52:36 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406092052.s59Kqaha029029@svn.freebsd.org> From: Ed Maste Date: Mon, 9 Jun 2014 20:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267301 - head/tools/tools/vt/fontcvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 20:52:36 -0000 Author: emaste Date: Mon Jun 9 20:52:35 2014 New Revision: 267301 URL: http://svnweb.freebsd.org/changeset/base/267301 Log: vt fontcvt: Speed up bold glyph map deduplication Perform an O(n) deduplication pass over the bold maps at the end, rather than walking the normal map list to look for a duplicate glyph each time a bold mapping entry is added. Sponsored by: The FreeBSD Foundation Modified: head/tools/tools/vt/fontcvt/fontcvt.c Modified: head/tools/tools/vt/fontcvt/fontcvt.c ============================================================================== --- head/tools/tools/vt/fontcvt/fontcvt.c Mon Jun 9 20:51:08 2014 (r267300) +++ head/tools/tools/vt/fontcvt/fontcvt.c Mon Jun 9 20:52:35 2014 (r267301) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -45,7 +46,9 @@ __FBSDID("$FreeBSD$"); #define VFNT_MAPS 4 #define VFNT_MAP_NORMAL 0 +#define VFNT_MAP_NORMAL_RH 1 #define VFNT_MAP_BOLD 2 +#define VFNT_MAP_BOLD_RH 3 static unsigned int width = 8, wbytes, height = 16; @@ -101,34 +104,6 @@ add_mapping(struct glyph *gl, unsigned i mapping_total++; - if (map_idx >= VFNT_MAP_BOLD) { - int found = 0; - unsigned normal_map_idx = map_idx - VFNT_MAP_BOLD; - - TAILQ_FOREACH(mp, &maps[normal_map_idx], m_list) { - if (mp->m_char < c) - continue; - else if (mp->m_char > c) - break; - found = 1; - - /* - * No mapping is needed if it's equal to the - * normal mapping. - */ - if (mp->m_glyph == gl) { - mapping_dupe++; - return (0); - } - } - - if (!found) { - fprintf(stderr, - "Character %u not in normal font!\n", c); - return (1); - } - } - mp = malloc(sizeof *mp); mp->m_char = c; mp->m_glyph = gl; @@ -148,6 +123,33 @@ add_mapping(struct glyph *gl, unsigned i return (0); } +static int +dedup_mapping(unsigned int map_idx) +{ + struct mapping *mp_bold, *mp_normal, *mp_temp; + unsigned normal_map_idx = map_idx - VFNT_MAP_BOLD; + + assert(map_idx == VFNT_MAP_BOLD || map_idx == VFNT_MAP_BOLD_RH); + mp_normal = TAILQ_FIRST(&maps[normal_map_idx]); + TAILQ_FOREACH_SAFE(mp_bold, &maps[map_idx], m_list, mp_temp) { + while (mp_normal->m_char < mp_bold->m_char) + mp_normal = TAILQ_NEXT(mp_normal, m_list); + if (mp_bold->m_char != mp_normal->m_char) { + errx(1, "Character %u not in normal font!\n", + mp_bold->m_char); + return (1); + } + if (mp_bold->m_glyph != mp_normal->m_glyph) + continue; + + /* No mapping is needed if it's equal to the normal mapping. */ + TAILQ_REMOVE(&maps[map_idx], mp_bold, m_list); + free(mp_bold); + mapping_dupe++; + } + return (0); +} + static struct glyph * add_glyph(const uint8_t *bytes, unsigned int map_idx, int fallback) { @@ -540,6 +542,8 @@ main(int argc, char *argv[]) argv++; } number_glyphs(); + dedup_mapping(VFNT_MAP_BOLD); + dedup_mapping(VFNT_MAP_BOLD_RH); fold_mappings(0); fold_mappings(1); fold_mappings(2); From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 20:52:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B456571; Mon, 9 Jun 2014 20:52:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F05C021AA; Mon, 9 Jun 2014 20:52:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59Kqgpj029099; Mon, 9 Jun 2014 20:52:42 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59KqgZr029098; Mon, 9 Jun 2014 20:52:42 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406092052.s59KqgZr029098@svn.freebsd.org> From: Glen Barber Date: Mon, 9 Jun 2014 20:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267302 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 20:52:43 -0000 Author: gjb Date: Mon Jun 9 20:52:42 2014 New Revision: 267302 URL: http://svnweb.freebsd.org/changeset/base/267302 Log: Document r267256, OpenSSL 1.0.1h update. Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Jun 9 20:52:35 2014 (r267301) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Jun 9 20:52:42 2014 (r267302) @@ -370,6 +370,9 @@ Sendmail has been updated from 8.14.7 to 8.14.9. + + OpenSSL has + been updated to version 1.0.1h. From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 21:06:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DFE0D14; Mon, 9 Jun 2014 21:06:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E283622B3; Mon, 9 Jun 2014 21:06:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59L6k46034719; Mon, 9 Jun 2014 21:06:46 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59L6k98034716; Mon, 9 Jun 2014 21:06:46 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406092106.s59L6k98034716@svn.freebsd.org> From: Ed Maste Date: Mon, 9 Jun 2014 21:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267306 - head/share/vt/fonts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 21:06:47 -0000 Author: emaste Date: Mon Jun 9 21:06:46 2014 New Revision: 267306 URL: http://svnweb.freebsd.org/changeset/base/267306 Log: Add vgarom font source These are in 'GNU Unifont' format, and are converted from syscons(4) cp437 fonts. Added: head/share/vt/fonts/vgarom-8x14.hex (contents, props changed) head/share/vt/fonts/vgarom-8x16.hex (contents, props changed) head/share/vt/fonts/vgarom-8x8.hex (contents, props changed) Added: head/share/vt/fonts/vgarom-8x14.hex ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/fonts/vgarom-8x14.hex Mon Jun 9 21:06:46 2014 (r267306) @@ -0,0 +1,259 @@ +# $FreeBSD$ +# Height: 14 +# Width: 8 +0000:0000000000000000000000000000 +0020:0000000000000000000000000000 +0021:0000183C3C3C1818001818000000 +0022:0066666624000000000000000000 +0023:00006C6CFE6C6C6CFE6C6C000000 +0024:18187CC6C2C07C0686C67C181800 +0025:00000000C2C60C183066C6000000 +0026:0000386C6C3876DCCCCC76000000 +0027:0030303060000000000000000000 +0028:00000C183030303030180C000000 +0029:000030180C0C0C0C0C1830000000 +002A:00000000663CFF3C660000000000 +002B:0000000018187E18180000000000 +002C:0000000000000000181818300000 +002D:000000000000FE00000000000000 +002E:0000000000000000001818000000 +002F:000002060C183060C08000000000 +0030:00007CC6CEDEF6E6C6C67C000000 +0031:000018387818181818187E000000 +0032:00007CC6060C183060C6FE000000 +0033:00007CC606063C0606C67C000000 +0034:00000C1C3C6CCCFE0C0C1E000000 +0035:0000FEC0C0C0FC0606C67C000000 +0036:00003860C0C0FCC6C6C67C000000 +0037:0000FEC6060C1830303030000000 +0038:00007CC6C6C67CC6C6C67C000000 +0039:00007CC6C6C67E06060C78000000 +003A:0000001818000000181800000000 +003B:0000001818000000181830000000 +003C:0000060C18306030180C06000000 +003D:00000000007E00007E0000000000 +003E:00006030180C060C183060000000 +003F:00007CC6C60C1818001818000000 +0040:00007CC6C6DEDEDEDCC07C000000 +0041:000010386CC6C6FEC6C6C6000000 +0042:0000FC6666667C666666FC000000 +0043:00003C66C2C0C0C0C2663C000000 +0044:0000F86C66666666666CF8000000 +0045:0000FE66626878686266FE000000 +0046:0000FE66626878686060F0000000 +0047:00003C66C2C0C0DEC6663A000000 +0048:0000C6C6C6C6FEC6C6C6C6000000 +0049:00003C181818181818183C000000 +004A:00001E0C0C0C0C0CCCCC78000000 +004B:0000E6666C6C786C6C66E6000000 +004C:0000F060606060606266FE000000 +004D:0000C6EEFEFED6C6C6C6C6000000 +004E:0000C6E6F6FEDECEC6C6C6000000 +004F:0000386CC6C6C6C6C66C38000000 +0050:0000FC6666667C606060F0000000 +0051:00007CC6C6C6C6D6DE7C0C0E0000 +0052:0000FC6666667C6C6666E6000000 +0053:00007CC6C660380CC6C67C000000 +0054:00007E7E5A18181818183C000000 +0055:0000C6C6C6C6C6C6C6C67C000000 +0056:0000C6C6C6C6C6C66C3810000000 +0057:0000C6C6C6C6D6D6FE7C6C000000 +0058:0000C6C66C3838386CC6C6000000 +0059:0000666666663C1818183C000000 +005A:0000FEC68C183060C2C6FE000000 +005B:00003C303030303030303C000000 +005C:000080C0E070381C0E0602000000 +005D:00003C0C0C0C0C0C0C0C3C000000 +005E:10386CC600000000000000000000 +005F:000000000000000000000000FF00 +0060:3030180000000000000000000000 +0061:0000000000780C7CCCCC76000000 +0062:0000E06060786C6666667C000000 +0063:00000000007CC6C0C0C67C000000 +0064:00001C0C0C3C6CCCCCCC76000000 +0065:00000000007CC6FEC0C67C000000 +0066:0000386C6460F0606060F0000000 +0067:000000000076CCCCCC7C0CCC7800 +0068:0000E060606C76666666E6000000 +0069:000018180038181818183C000000 +006A:00000606000E0606060666663C00 +006B:0000E06060666C786C66E6000000 +006C:000038181818181818183C000000 +006D:0000000000ECFED6D6D6C6000000 +006E:0000000000DC6666666666000000 +006F:00000000007CC6C6C6C67C000000 +0070:0000000000DC6666667C6060F000 +0071:000000000076CCCCCC7C0C0C1E00 +0072:0000000000DC76666060F0000000 +0073:00000000007CC6701CC67C000000 +0074:0000103030FC303030361C000000 +0075:0000000000CCCCCCCCCC76000000 +0076:0000000000666666663C18000000 +0077:0000000000C6C6D6D6FE6C000000 +0078:0000000000C66C38386CC6000000 +0079:0000000000C6C6C6C67E060CF800 +007A:0000000000FECC183066FE000000 +007B:00000E181818701818180E000000 +007C:0000181818180018181818000000 +007D:0000701818180E18181870000000 +007E:000076DC00000000000000000000 +00A0:0000000000000000000000000000 +00A1:000018180018183C3C3C18000000 +00A2:0018183C666060663C1818000000 +00A3:00386C6460F0606060E6FC000000 +00A5:000066663C187E187E1818000000 +00A7:007CC660386CC6C66C380CC67C00 +00AA:003C6C6C3E007E00000000000000 +00AB:00000000366CD86C360000000000 +00AC:000000000000FE06060600000000 +00B0:00386C6C38000000000000000000 +00B1:00000018187E18180000FF000000 +00B2:0070D83060C8F800000000000000 +00B5:00000000666666667C6060C00000 +00B6:00007FDBDBDB7B1B1B1B1B000000 +00B7:0000000000000018000000000000 +00BA:00386C6C38007C00000000000000 +00BB:00000000D86C366CD80000000000 +00BC:00C0C0C6CCD83066CE9E3E060600 +00BD:00C0C0C6CCD83060DC860C183E00 +00BF:0000303000303060C6C67C000000 +00C4:00C6C610386CC6C6FEC6C6000000 +00C5:386C3800386CC6C6FEC6C6000000 +00C6:00003E6CCCCCFECCCCCCCE000000 +00C7:00003C66C2C0C0C2663C0C067C00 +00C9:18306000FE66607C6066FE000000 +00D1:76DC00C6E6F6FEDECEC6C6000000 +00D6:00C6C6386CC6C6C6C66C38000000 +00DC:00C6C600C6C6C6C6C6C67C000000 +00DF:000000007CC6FCC6C6FCC0C04000 +00E0:0060301800780C7CCCCC76000000 +00E1:0018306000780C7CCCCC76000000 +00E2:0010386C00780C7CCCCC76000000 +00E4:0000CCCC00780C7CCCCC76000000 +00E5:00386C3800780C7CCCCC76000000 +00E6:00000000CC76367ED8D86E000000 +00E7:000000003C6660663C0C063C0000 +00E8:00603018007CC6FEC0C67C000000 +00E9:000C1830007CC6FEC0C67C000000 +00EA:0010386C007CC6FEC0C67C000000 +00EB:0000CCCC007CC6FEC0C67C000000 +00EC:006030180038181818183C000000 +00ED:000C18300038181818183C000000 +00EE:00183C660038181818183C000000 +00EF:000066660038181818183C000000 +00F1:000076DC00DC6666666666000000 +00F2:00603018007CC6C6C6C67C000000 +00F3:00183060007CC6C6C6C67C000000 +00F4:0010386C007CC6C6C6C67C000000 +00F6:0000C6C6007CC6C6C6C67C000000 +00F7:0000001818007E00181800000000 +00F9:0060301800CCCCCCCCCC76000000 +00FA:0018306000CCCCCCCCCC76000000 +00FB:003078CC00CCCCCCCCCC76000000 +00FC:0000CCCC00CCCCCCCCCC76000000 +00FF:0000C6C600C6C6C6C67E060C7800 +0192:000E1B1818187E18181818D87000 +0393:0000FEC6C6C0C0C0C0C0C0000000 +0398:0000386CC6C6FEC6C66C38000000 +03A3:0000FEC66030183060C6FE000000 +03A6:00007E183C6666663C187E000000 +03A9:0000386CC6C6C66C6C6CEE000000 +03B1:000000000076DCD8D8DC76000000 +03B4:00001E30180C3E6666663C000000 +03B5:00001C3060607C6060301C000000 +03C0:00000000FE6C6C6C6C6C6C000000 +03C3:00000000007ED8D8D8D870000000 +03C4:0000000076DC1818181818000000 +03C6:000003067EDBDBF37E60C0000000 +2022:0000000000183C3C180000000000 +203C:0000666666666666006666000000 +207F:00D86C6C6C6C6C00000000000000 +20A7:00F8CCCCF8C4CCDECCCCC6000000 +2190:000000003060FE60300000000000 +2191:0000183C7E181818181818000000 +2192:00000000180CFE0C180000000000 +2193:00001818181818187E3C18000000 +2194:00000000286CFE6C280000000000 +2195:0000183C7E1818187E3C18000000 +21A8:0000183C7E1818187E3C187E0000 +2219:0000000000001818000000000000 +221A:000F0C0C0C0C0CEC6C3C1C000000 +221E:00000000007EDBDB7E0000000000 +221F:0000000000C0C0C0FE0000000000 +2229:0000007CC6C6C6C6C6C6C6000000 +2248:0000000076DC0076DC0000000000 +2261:000000FE0000FE0000FE00000000 +2264:00000C18306030180C007E000000 +2265:000030180C060C1830007E000000 +2302:0000000010386CC6C6FE00000000 +2310:000000000000FEC0C0C000000000 +2320:00000E1B1B181818181818181818 +2321:1818181818181818D8D870000000 +2500:00000000000000FF000000000000 +2502:1818181818181818181818181818 +250C:000000000000001F181818181818 +2510:00000000000000F8181818181818 +2514:181818181818181F000000000000 +2518:18181818181818F8000000000000 +251C:181818181818181F181818181818 +2524:18181818181818F8181818181818 +252C:00000000000000FF181818181818 +2534:18181818181818FF000000000000 +253C:18181818181818FF181818181818 +2550:0000000000FF00FF000000000000 +2551:3636363636363636363636363636 +2552:00000000001F181F181818181818 +2553:000000000000003F363636363636 +2554:00000000003F3037363636363636 +2555:0000000000F818F8181818181818 +2556:00000000000000FE363636363636 +2557:0000000000FE06F6363636363636 +2558:18181818181F181F000000000000 +2559:363636363636363F000000000000 +255A:363636363637303F000000000000 +255B:1818181818F818F8000000000000 +255C:36363636363636FE000000000000 +255D:3636363636F606FE000000000000 +255E:18181818181F181F181818181818 +255F:3636363636363637363636363636 +2560:3636363636373037363636363636 +2561:1818181818F818F8181818181818 +2562:36363636363636F6363636363636 +2563:3636363636F606F6363636363636 +2564:0000000000FF00FF181818181818 +2565:00000000000000FF363636363636 +2566:0000000000FF00F7363636363636 +2567:1818181818FF00FF000000000000 +2568:36363636363636FF000000000000 +2569:3636363636F700FF000000000000 +256A:1818181818FF18FF181818181818 +256B:36363636363636FF363636363636 +256C:3636363636F700F7363636363636 +2580:FFFFFFFFFFFFFF00000000000000 +2584:00000000000000FFFFFFFFFFFFFF +2588:FFFFFFFFFFFFFFFFFFFFFFFFFFFF +258C:F0F0F0F0F0F0F0F0F0F0F0F0F0F0 +2590:0F0F0F0F0F0F0F0F0F0F0F0F0F0F +2591:1144114411441144114411441144 +2592:55AA55AA55AA55AA55AA55AA55AA +2593:DD77DD77DD77DD77DD77DD77DD77 +25A0:000000007C7C7C7C7C7C00000000 +25AC:0000000000000000FEFEFE000000 +25B2:0000001038387C7CFEFE00000000 +25BA:000080C0E0F8FEF8E0C080000000 +25BC:000000FEFE7C7C38381000000000 +25C4:000002060E3EFE3E0E0602000000 +25CB:000000003C664242663C00000000 +25D8:FFFFFFFFFFE7C3C3E7FFFFFFFFFF +25D9:FFFFFFFFC399BDBD99C3FFFFFFFF +263A:00007E81A58181BD99817E000000 +263B:00007EFFDBFFFFC3E7FF7E000000 +263C:00001818DB3CE73CDB1818000000 +2640:00003C6666663C187E1818000000 +2642:00001E0E1A3278CCCCCC78000000 +2660:0000183C7EFFFF7E18183C000000 +2663:0000183C3CE7E7E718183C000000 +2665:0000006CFEFEFEFE7C3810000000 +2666:00000010387CFE7C381000000000 +266A:00003F333F30303070F0E0000000 +266C:00007F637F63636367E7E6C00000 Added: head/share/vt/fonts/vgarom-8x16.hex ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/fonts/vgarom-8x16.hex Mon Jun 9 21:06:46 2014 (r267306) @@ -0,0 +1,259 @@ +# $FreeBSD$ +# Height: 16 +# Width: 8 +0000:00000000000000000000000000000000 +0020:00000000000000000000000000000000 +0021:0000183C3C3C18181800181800000000 +0022:00666666240000000000000000000000 +0023:0000006C6CFE6C6C6CFE6C6C00000000 +0024:18187CC6C2C07C060686C67C18180000 +0025:00000000C2C60C183060C68600000000 +0026:0000386C6C3876DCCCCCCC7600000000 +0027:00303030600000000000000000000000 +0028:00000C18303030303030180C00000000 +0029:000030180C0C0C0C0C0C183000000000 +002A:0000000000663CFF3C66000000000000 +002B:000000000018187E1818000000000000 +002C:00000000000000000018181830000000 +002D:00000000000000FE0000000000000000 +002E:00000000000000000000181800000000 +002F:0000000002060C183060C08000000000 +0030:0000386CC6C6D6D6C6C66C3800000000 +0031:00001838781818181818187E00000000 +0032:00007CC6060C183060C0C6FE00000000 +0033:00007CC606063C060606C67C00000000 +0034:00000C1C3C6CCCFE0C0C0C1E00000000 +0035:0000FEC0C0C0FC060606C67C00000000 +0036:00003860C0C0FCC6C6C6C67C00000000 +0037:0000FEC606060C183030303000000000 +0038:00007CC6C6C67CC6C6C6C67C00000000 +0039:00007CC6C6C67E0606060C7800000000 +003A:00000000181800000018180000000000 +003B:00000000181800000018183000000000 +003C:000000060C18306030180C0600000000 +003D:00000000007E00007E00000000000000 +003E:0000006030180C060C18306000000000 +003F:00007CC6C60C18181800181800000000 +0040:0000007CC6C6DEDEDEDCC07C00000000 +0041:000010386CC6C6FEC6C6C6C600000000 +0042:0000FC6666667C66666666FC00000000 +0043:00003C66C2C0C0C0C0C2663C00000000 +0044:0000F86C6666666666666CF800000000 +0045:0000FE6662687868606266FE00000000 +0046:0000FE6662687868606060F000000000 +0047:00003C66C2C0C0DEC6C6663A00000000 +0048:0000C6C6C6C6FEC6C6C6C6C600000000 +0049:00003C18181818181818183C00000000 +004A:00001E0C0C0C0C0CCCCCCC7800000000 +004B:0000E666666C78786C6666E600000000 +004C:0000F06060606060606266FE00000000 +004D:0000C6EEFEFED6C6C6C6C6C600000000 +004E:0000C6E6F6FEDECEC6C6C6C600000000 +004F:00007CC6C6C6C6C6C6C6C67C00000000 +0050:0000FC6666667C60606060F000000000 +0051:00007CC6C6C6C6C6C6D6DE7C0C0E0000 +0052:0000FC6666667C6C666666E600000000 +0053:00007CC6C660380C06C6C67C00000000 +0054:00007E7E5A1818181818183C00000000 +0055:0000C6C6C6C6C6C6C6C6C67C00000000 +0056:0000C6C6C6C6C6C6C66C381000000000 +0057:0000C6C6C6C6D6D6D6FEEE6C00000000 +0058:0000C6C66C7C38387C6CC6C600000000 +0059:0000666666663C181818183C00000000 +005A:0000FEC6860C183060C2C6FE00000000 +005B:00003C30303030303030303C00000000 +005C:00000080C0E070381C0E060200000000 +005D:00003C0C0C0C0C0C0C0C0C3C00000000 +005E:10386CC6000000000000000000000000 +005F:00000000000000000000000000FF0000 +0060:30301800000000000000000000000000 +0061:0000000000780C7CCCCCCC7600000000 +0062:0000E06060786C666666667C00000000 +0063:00000000007CC6C0C0C0C67C00000000 +0064:00001C0C0C3C6CCCCCCCCC7600000000 +0065:00000000007CC6FEC0C0C67C00000000 +0066:0000386C6460F060606060F000000000 +0067:000000000076CCCCCCCCCC7C0CCC7800 +0068:0000E060606C7666666666E600000000 +0069:00001818003818181818183C00000000 +006A:00000606000E06060606060666663C00 +006B:0000E06060666C78786C66E600000000 +006C:00003818181818181818183C00000000 +006D:0000000000ECFED6D6D6D6C600000000 +006E:0000000000DC66666666666600000000 +006F:00000000007CC6C6C6C6C67C00000000 +0070:0000000000DC66666666667C6060F000 +0071:000000000076CCCCCCCCCC7C0C0C1E00 +0072:0000000000DC7666606060F000000000 +0073:00000000007CC660380CC67C00000000 +0074:0000103030FC30303030361C00000000 +0075:0000000000CCCCCCCCCCCC7600000000 +0076:000000000066666666663C1800000000 +0077:0000000000C6C6D6D6D6FE6C00000000 +0078:0000000000C66C3838386CC600000000 +0079:0000000000C6C6C6C6C6C67E060CF800 +007A:0000000000FECC183060C6FE00000000 +007B:00000E18181870181818180E00000000 +007C:00001818181800181818181800000000 +007D:0000701818180E181818187000000000 +007E:000076DC000000000000000000000000 +00A0:00000000000000000000000000000000 +00A1:00001818001818183C3C3C1800000000 +00A2:0018183C66606060663C181800000000 +00A3:00386C6460F060606060E6FC00000000 +00A5:000066663C187E187E18181800000000 +00A7:007CC660386CC6C66C380CC67C000000 +00AA:003C6C6C3E007E000000000000000000 +00AB:0000000000366CD86C36000000000000 +00AC:000000000000FE060606060000000000 +00B0:00386C6C380000000000000000000000 +00B1:0000000018187E18180000FF00000000 +00B2:0070D83060C8F8000000000000000000 +00B5:0000000066666666667C6060C0000000 +00B6:00007FDBDBDB7B1B1B1B1B1B00000000 +00B7:00000000000000001800000000000000 +00BA:00386C6C38007C000000000000000000 +00BB:0000000000D86C366CD8000000000000 +00BC:00C0C0C2C6CC183066CE9E3E06060000 +00BD:00C0C0C2C6CC183060DC860C183E0000 +00BF:0000303000303060C0C6C67C00000000 +00C4:00C60010386CC6C6FEC6C6C600000000 +00C5:386C3800386CC6C6FEC6C6C600000000 +00C6:00003E6CCCCCFECCCCCCCCCE00000000 +00C7:00003C66C2C0C0C0C2663C0C067C0000 +00C9:18306000FE66607C606066FE00000000 +00D1:76DC00C6E6F6FEDECEC6C6C600000000 +00D6:00C6007CC6C6C6C6C6C6C67C00000000 +00DC:00C600C6C6C6C6C6C6C6C67C00000000 +00DF:000078CCCCCCD8CCC6C6C6CC00000000 +00E0:0060301800780C7CCCCCCC7600000000 +00E1:0018306000780C7CCCCCCC7600000000 +00E2:0010386C00780C7CCCCCCC7600000000 +00E4:0000CC0000780C7CCCCCCC7600000000 +00E5:00386C3800780C7CCCCCCC7600000000 +00E6:0000000000CC76367ED8D86E00000000 +00E7:000000003C666060663C0C063C000000 +00E8:00603018007CC6FEC0C0C67C00000000 +00E9:000C1830007CC6FEC0C0C67C00000000 +00EA:0010386C007CC6FEC0C0C67C00000000 +00EB:0000C600007CC6FEC0C0C67C00000000 +00EC:00603018003818181818183C00000000 +00ED:000C1830003818181818183C00000000 +00EE:00183C66003818181818183C00000000 +00EF:00006600003818181818183C00000000 +00F1:000076DC00DC66666666666600000000 +00F2:00603018007CC6C6C6C6C67C00000000 +00F3:00183060007CC6C6C6C6C67C00000000 +00F4:0010386C007CC6C6C6C6C67C00000000 +00F6:0000C600007CC6C6C6C6C67C00000000 +00F7:000000001818007E0018180000000000 +00F9:0060301800CCCCCCCCCCCC7600000000 +00FA:0018306000CCCCCCCCCCCC7600000000 +00FB:003078CC00CCCCCCCCCCCC7600000000 +00FC:0000CC0000CCCCCCCCCCCC7600000000 +00FF:0000C60000C6C6C6C6C6C67E060C7800 +0192:000E1B1818187E1818181818D8700000 +0393:0000FEC6C6C0C0C0C0C0C0C000000000 +0398:000000386CC6C6FEC6C66C3800000000 +03A3:000000FEC66030183060C6FE00000000 +03A6:0000007E183C6666663C187E00000000 +03A9:0000386CC6C6C66C6C6C6CEE00000000 +03B1:000000000076DCD8D8D8DC7600000000 +03B4:00001E30180C3E666666663C00000000 +03B5:00001C3060607C606060301C00000000 +03C0:00000000FE6C6C6C6C6C6C6C00000000 +03C3:00000000007ED8D8D8D8D87000000000 +03C4:0000000076DC18181818181800000000 +03C6:00000003067EDBDBF37E60C000000000 +2022:000000000000183C3C18000000000000 +203C:00006666666666666600666600000000 +207F:00D86C6C6C6C6C000000000000000000 +20A7:00F8CCCCF8C4CCDECCCCCCC600000000 +2190:00000000003060FE6030000000000000 +2191:0000183C7E1818181818181800000000 +2192:0000000000180CFE0C18000000000000 +2193:0000181818181818187E3C1800000000 +2194:0000000000286CFE6C28000000000000 +2195:0000183C7E1818187E3C180000000000 +21A8:0000183C7E1818187E3C187E00000000 +2219:00000000000000181800000000000000 +221A:000F0C0C0C0C0CEC6C6C3C1C00000000 +221E:00000000007EDBDBDB7E000000000000 +221F:000000000000C0C0C0FE000000000000 +2229:0000007CC6C6C6C6C6C6C6C600000000 +2248:000000000076DC0076DC000000000000 +2261:00000000FE0000FE0000FE0000000000 +2264:0000000C18306030180C007E00000000 +2265:00000030180C060C1830007E00000000 +2302:0000000010386CC6C6C6FE0000000000 +2310:000000000000FEC0C0C0C00000000000 +2320:00000E1B1B1818181818181818181818 +2321:1818181818181818D8D8D87000000000 +2500:00000000000000FF0000000000000000 +2502:18181818181818181818181818181818 +250C:000000000000001F1818181818181818 +2510:00000000000000F81818181818181818 +2514:181818181818181F0000000000000000 +2518:18181818181818F80000000000000000 +251C:181818181818181F1818181818181818 +2524:18181818181818F81818181818181818 +252C:00000000000000FF1818181818181818 +2534:18181818181818FF0000000000000000 +253C:18181818181818FF1818181818181818 +2550:0000000000FF00FF0000000000000000 +2551:36363636363636363636363636363636 +2552:00000000001F181F1818181818181818 +2553:000000000000003F3636363636363636 +2554:00000000003F30373636363636363636 +2555:0000000000F818F81818181818181818 +2556:00000000000000FE3636363636363636 +2557:0000000000FE06F63636363636363636 +2558:18181818181F181F0000000000000000 +2559:363636363636363F0000000000000000 +255A:363636363637303F0000000000000000 +255B:1818181818F818F80000000000000000 +255C:36363636363636FE0000000000000000 +255D:3636363636F606FE0000000000000000 +255E:18181818181F181F1818181818181818 +255F:36363636363636373636363636363636 +2560:36363636363730373636363636363636 +2561:1818181818F818F81818181818181818 +2562:36363636363636F63636363636363636 +2563:3636363636F606F63636363636363636 +2564:0000000000FF00FF1818181818181818 +2565:00000000000000FF3636363636363636 +2566:0000000000FF00F73636363636363636 +2567:1818181818FF00FF0000000000000000 +2568:36363636363636FF0000000000000000 +2569:3636363636F700FF0000000000000000 +256A:1818181818FF18FF1818181818181818 +256B:36363636363636FF3636363636363636 +256C:3636363636F700F73636363636363636 +2580:FFFFFFFFFFFFFF000000000000000000 +2584:00000000000000FFFFFFFFFFFFFFFFFF +2588:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +258C:F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 +2590:0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F +2591:11441144114411441144114411441144 +2592:55AA55AA55AA55AA55AA55AA55AA55AA +2593:DD77DD77DD77DD77DD77DD77DD77DD77 +25A0:000000007C7C7C7C7C7C7C0000000000 +25AC:0000000000000000FEFEFEFE00000000 +25B2:000000001038387C7CFEFE0000000000 +25BA:0080C0E0F0F8FEF8F0E0C08000000000 +25BC:00000000FEFE7C7C3838100000000000 +25C4:0002060E1E3EFE3E1E0E060200000000 +25CB:00000000003C664242663C0000000000 +25D8:FFFFFFFFFFFFE7C3C3E7FFFFFFFFFFFF +25D9:FFFFFFFFFFC399BDBD99C3FFFFFFFFFF +263A:00007E81A58181BD9981817E00000000 +263B:00007EFFDBFFFFC3E7FFFF7E00000000 +263C:0000001818DB3CE73CDB181800000000 +2640:00003C666666663C187E181800000000 +2642:00001E0E1A3278CCCCCCCC7800000000 +2660:000000183C7EFFFF7E18183C00000000 +2663:000000183C3CE7E7E718183C00000000 +2665:000000006CFEFEFEFE7C381000000000 +2666:0000000010387CFE7C38100000000000 +266A:00003F333F3030303070F0E000000000 +266C:00007F637F6363636367E7E6C0000000 Added: head/share/vt/fonts/vgarom-8x8.hex ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/fonts/vgarom-8x8.hex Mon Jun 9 21:06:46 2014 (r267306) @@ -0,0 +1,258 @@ +# $FreeBSD$ +# Height: 8 +# Width: 8 +0020:0000000000000000 +0021:3078783030003000 +0022:6C6C6C0000000000 +0023:6C6CFE6CFE6C6C00 +0024:307CC0780CF83000 +0025:00C6CC183066C600 +0026:386C3876DCCC7600 +0027:6060C00000000000 +0028:1830606060301800 +0029:6030181818306000 +002A:00663CFF3C660000 +002B:003030FC30300000 +002C:0000000000303060 +002D:000000FC00000000 +002E:0000000000303000 +002F:060C183060C08000 +0030:7CC6CEDEF6E67C00 +0031:307030303030FC00 +0032:78CC0C3860CCFC00 +0033:78CC0C380CCC7800 +0034:1C3C6CCCFE0C1E00 +0035:FCC0F80C0CCC7800 +0036:3860C0F8CCCC7800 +0037:FCCC0C1830303000 +0038:78CCCC78CCCC7800 +0039:78CCCC7C0C187000 +003A:0030300000303000 +003B:0030300000303060 +003C:183060C060301800 +003D:0000FC0000FC0000 +003E:6030180C18306000 +003F:78CC0C1830003000 +0040:7CC6DEDEDEC07800 +0041:3078CCCCFCCCCC00 +0042:FC66667C6666FC00 +0043:3C66C0C0C0663C00 +0044:F86C6666666CF800 +0045:FE6268786862FE00 +0046:FE6268786860F000 +0047:3C66C0C0CE663E00 +0048:CCCCCCFCCCCCCC00 +0049:7830303030307800 +004A:1E0C0C0CCCCC7800 +004B:E6666C786C66E600 +004C:F06060606266FE00 +004D:C6EEFEFED6C6C600 +004E:C6E6F6DECEC6C600 +004F:386CC6C6C66C3800 +0050:FC66667C6060F000 +0051:78CCCCCCDC781C00 +0052:FC66667C6C66E600 +0053:78CCE0701CCC7800 +0054:FCB4303030307800 +0055:CCCCCCCCCCCCFC00 +0056:CCCCCCCCCC783000 +0057:C6C6C6D6FEEEC600 +0058:C6C66C38386CC600 +0059:CCCCCC7830307800 +005A:FEC68C183266FE00 +005B:7860606060607800 +005C:C06030180C060200 +005D:7818181818187800 +005E:10386CC600000000 +005F:00000000000000FF +0060:3030180000000000 +0061:0000780C7CCC7600 +0062:E060607C6666DC00 +0063:000078CCC0CC7800 +0064:1C0C0C7CCCCC7600 +0065:000078CCFCC07800 +0066:386C60F06060F000 +0067:000076CCCC7C0CF8 +0068:E0606C766666E600 +0069:3000703030307800 +006A:0C000C0C0CCCCC78 +006B:E060666C786CE600 +006C:7030303030307800 +006D:0000CCFEFED6C600 +006E:0000F8CCCCCCCC00 +006F:000078CCCCCC7800 +0070:0000DC66667C60F0 +0071:000076CCCC7C0C1E +0072:0000DC766660F000 +0073:00007CC0780CF800 +0074:10307C3030341800 +0075:0000CCCCCCCC7600 +0076:0000CCCCCC783000 +0077:0000C6D6FEFE6C00 +0078:0000C66C386CC600 +0079:0000CCCCCC7C0CF8 +007A:0000FC983064FC00 +007B:1C3030E030301C00 +007C:1818180018181800 +007D:E030301C3030E000 +007E:76DC000000000000 +00A0:0000000000000000 +00A1:1818001818181800 +00A2:18187EC0C07E1818 +00A3:386C64F060E6FC00 +00A5:CCCC78FC30FC3030 +00A7:3E63386C6C38CC78 +00AA:3C6C6C3E007E0000 +00AB:003366CC66330000 +00AC:000000FC0C0C0000 +00B0:386C6C3800000000 +00B1:3030FC303000FC00 +00B2:7018306078000000 +00B5:00666666667C60C0 +00B6:7FDBDB7B1B1B1B00 +00B7:0000000018000000 +00BA:386C6C38007C0000 +00BB:00CC663366CC0000 +00BC:C3C6CCDB376FCF03 +00BD:C3C6CCDE3366CC0F +00BF:30003060C0CC7800 +00C4:C6386CC6FEC6C600 +00C5:30300078CCFCCC00 +00C6:3E6CCCFECCCCCE00 +00C7:78CCC0CC78180C78 +00C9:1C00FC607860FC00 +00D1:FC00CCECFCDCCC00 +00D6:C3183C66663C1800 +00DC:CC00CCCCCCCC7800 +00DF:0078CCF8CCF8C0C0 +00E0:E000780C7CCC7E00 +00E1:1C00780C7CCC7E00 +00E2:7EC33C063E663F00 +00E4:CC00780C7CCC7E00 +00E5:3030780C7CCC7E00 +00E6:00007F0C7FCC7F00 +00E7:000078C0C0780C38 +00E8:E00078CCFCC07800 +00E9:1C0078CCFCC07800 +00EA:7EC33C667E603C00 +00EB:CC0078CCFCC07800 +00EC:E000703030307800 +00ED:3800703030307800 +00EE:7CC6381818183C00 +00EF:CC00703030307800 +00F1:00F800F8CCCCCC00 +00F2:00E00078CCCC7800 +00F3:001C0078CCCC7800 +00F4:78CC0078CCCC7800 +00F6:00CC0078CCCC7800 +00F7:303000FC00303000 +00F9:00E000CCCCCC7E00 +00FA:001C00CCCCCC7E00 +00FB:78CC00CCCCCC7E00 +00FC:00CC00CCCCCC7E00 +00FF:00CC00CCCC7C0CF8 +0192:0E1B183C1818D870 +0393:00FCCCC0C0C0C000 +0398:386CC6FEC66C3800 +03A3:FCCC603060CCFC00 +03A6:FC3078CCCC7830FC +03A9:386CC6C66C6CEE00 +03B1:000076DCC8DC7600 +03B4:1C30187CCCCC7800 +03B5:3860C0F8C0603800 +03C0:00FE6C6C6C6C6C00 +03C3:00007ED8D8D87000 +03C4:0076DC1818181800 +03C6:060C7EDBDB7E60C0 +2022:0000183C3C180000 +203C:6666666666006600 +207F:786C6C6C6C000000 +20A7:F8CCCCFAC6CFC6C7 +2190:003060FE60300000 +2191:183C7E1818181800 +2192:00180CFE0C180000 +2193:181818187E3C1800 +2194:002466FF66240000 +2195:183C7E18187E3C18 +21A8:183C7E187E3C18FF +2219:0000001818000000 +221A:0F0C0C0CEC6C3C1C +221E:00007EDBDB7E0000 +221F:0000C0C0C0FE0000 +2229:78CCCCCCCCCCCC00 +2248:0076DC0076DC0000 +2261:00FC00FC00FC0000 +2264:183060301800FC00 +2265:603018306000FC00 +2302:0010386CC6C6FE00 +2310:000000FCC0C00000 +2320:0E1B1B1818181818 +2321:1818181818D8D870 +2500:00000000FF000000 +2502:1818181818181818 +250C:000000001F181818 +2510:00000000F8181818 +2514:181818181F000000 +2518:18181818F8000000 +251C:181818181F181818 +2524:18181818F8181818 +252C:00000000FF181818 +2534:18181818FF000000 +253C:18181818FF181818 +2550:0000FF00FF000000 +2551:3636363636363636 +2552:00001F181F181818 +2553:000000003F363636 +2554:00003F3037363636 +2555:0000F818F8181818 +2556:00000000FE363636 +2557:0000FE06F6363636 +2558:18181F181F000000 +2559:363636363F000000 +255A:363637303F000000 +255B:1818F818F8000000 +255C:36363636FE000000 +255D:3636F606FE000000 +255E:18181F181F181818 +255F:3636363637363636 +2560:3636373037363636 +2561:1818F818F8181818 +2562:36363636F6363636 +2563:3636F606F6363636 +2564:0000FF00FF181818 +2565:00000000FF363636 +2566:0000FF00F7363636 +2567:1818FF00FF000000 +2568:36363636FF000000 +2569:3636F700FF000000 +256A:1818FF18FF181818 +256B:36363636FF363636 +256C:3636F700F7363636 +2580:FFFFFFFF00000000 +2584:00000000FFFFFFFF +2588:FFFFFFFFFFFFFFFF +258C:F0F0F0F0F0F0F0F0 +2590:0F0F0F0F0F0F0F0F +2591:2288228822882288 +2592:55AA55AA55AA55AA +2593:DB77DBEEDB77DBEE +25A0:00003C3C3C3C0000 +25AC:000000007E7E7E00 +25B2:00183C7EFFFF0000 +25BA:80E0F8FEF8E08000 +25BC:00FFFF7E3C180000 +25C4:020E3EFE3E0E0200 +25CB:003C664242663C00 +25D8:FFFFE7C3C3E7FFFF +25D9:FFC399BDBD99C3FF +263A:7E81A581BD99817E +263B:7EFFDBFFC3E7FF7E +263C:995A3CE7E73C5A99 +2640:3C6666663C187E18 +2642:0F070F7DCCCCCC78 +2660:1010387CFE7C387C +2663:387C38FEFE7C387C +2665:6CFEFEFE7C381000 +2666:10387CFE7C381000 +266A:3F333F303070F0E0 +266C:7F637F636367E6C0 From owner-svn-src-head@FreeBSD.ORG Mon Jun 9 21:35:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A501524; Mon, 9 Jun 2014 21:35:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 777192521; Mon, 9 Jun 2014 21:35:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s59LZb5e048159; Mon, 9 Jun 2014 21:35:37 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s59LZbK1048157; Mon, 9 Jun 2014 21:35:37 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201406092135.s59LZbK1048157@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 9 Jun 2014 21:35:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267307 - in head/lib/libc: amd64/gen i386/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 21:35:37 -0000 Author: jilles Date: Mon Jun 9 21:35:36 2014 New Revision: 267307 URL: http://svnweb.freebsd.org/changeset/base/267307 Log: siglongjmp(): Preserve floating point exception flags on i386 and amd64. Per POSIX, siglongjmp() shall be equivalent to longjmp() except that it must match sigsetjmp() instead of setjmp() and except for the effect on the signal mask. Therefore, it should preserve the floating point exception flags. This was fixed for longjmp() and _longjmp() in r180080 and r180081 for amd64 and i386 respectively. Modified: head/lib/libc/amd64/gen/sigsetjmp.S head/lib/libc/i386/gen/sigsetjmp.S Modified: head/lib/libc/amd64/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/amd64/gen/sigsetjmp.S Mon Jun 9 21:06:46 2014 (r267306) +++ head/lib/libc/amd64/gen/sigsetjmp.S Mon Jun 9 21:35:36 2014 (r267307) @@ -105,7 +105,6 @@ ENTRY(__siglongjmp) movq 40(%rdx),%r13 movq 48(%rdx),%r14 movq 56(%rdx),%r15 - fninit fldcw 64(%rdx) testq %rax,%rax jnz 1f Modified: head/lib/libc/i386/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/i386/gen/sigsetjmp.S Mon Jun 9 21:06:46 2014 (r267306) +++ head/lib/libc/i386/gen/sigsetjmp.S Mon Jun 9 21:35:36 2014 (r267307) @@ -115,7 +115,6 @@ ENTRY(__siglongjmp) movl 12(%edx),%ebp movl 16(%edx),%esi movl 20(%edx),%edi - fninit fldcw 24(%edx) testl %eax,%eax jnz 1f From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 01:19:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74BC4F3B; Tue, 10 Jun 2014 01:19:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 623292688; Tue, 10 Jun 2014 01:19:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5A1Jnq5050673; Tue, 10 Jun 2014 01:19:49 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5A1JnYg050672; Tue, 10 Jun 2014 01:19:49 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406100119.s5A1JnYg050672@svn.freebsd.org> From: Ed Maste Date: Tue, 10 Jun 2014 01:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267310 - head/sys/dev/vt/hw/vga X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 01:19:49 -0000 Author: emaste Date: Tue Jun 10 01:19:48 2014 New Revision: 267310 URL: http://svnweb.freebsd.org/changeset/base/267310 Log: Correct unicode map for VGA ROM character 0x0e The character is a beamed pair of sixteenth notes, so should be U+266C not U+266B (beamed eighth notes). Modified: head/sys/dev/vt/hw/vga/vga.c Modified: head/sys/dev/vt/hw/vga/vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vga.c Mon Jun 9 23:11:50 2014 (r267309) +++ head/sys/dev/vt/hw/vga/vga.c Tue Jun 10 01:19:48 2014 (r267310) @@ -351,7 +351,8 @@ static const struct unicp437 cp437table[ { 0x263a, 0x01, 0x01 }, { 0x263c, 0x0f, 0x00 }, { 0x2640, 0x0c, 0x00 }, { 0x2642, 0x0b, 0x00 }, { 0x2660, 0x06, 0x00 }, { 0x2663, 0x05, 0x00 }, - { 0x2665, 0x03, 0x01 }, { 0x266a, 0x0d, 0x01 }, + { 0x2665, 0x03, 0x01 }, { 0x266a, 0x0d, 0x00 }, + { 0x266c, 0x0e, 0x00 }, }; static uint8_t From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 01:38:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E07A45F; Tue, 10 Jun 2014 01:38:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B3CB2800; Tue, 10 Jun 2014 01:38:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5A1c3cq059421; Tue, 10 Jun 2014 01:38:03 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5A1c3Ge059420; Tue, 10 Jun 2014 01:38:03 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201406100138.s5A1c3Ge059420@svn.freebsd.org> From: Neel Natu Date: Tue, 10 Jun 2014 01:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267311 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 01:38:03 -0000 Author: neel Date: Tue Jun 10 01:38:02 2014 New Revision: 267311 URL: http://svnweb.freebsd.org/changeset/base/267311 Log: Turn on interrupt window exiting unconditionally when an ExtINT is being injected into the guest. This allows the hypervisor to inject another ExtINT or APIC vector as soon as the guest is able to process interrupts. This change is not to address any correctness issue but to guarantee that any pending APIC vector that was preempted by the ExtINT will be injected as soon as possible. Prior to this change such pending interrupts could be delayed until the next VM exit. Modified: head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Tue Jun 10 01:19:48 2014 (r267310) +++ head/sys/amd64/vmm/intel/vmx.c Tue Jun 10 01:38:02 2014 (r267311) @@ -1311,9 +1311,13 @@ vmx_inject_interrupts(struct vmx *vmx, i * have posted another one. If that is the case, set * the Interrupt Window Exiting execution control so * we can inject that one too. + * + * Also, interrupt window exiting allows us to inject any + * pending APIC vector that was preempted by the ExtINT + * as soon as possible. This applies both for the software + * emulated vlapic and the hardware assisted virtual APIC. */ - if (vm_extint_pending(vmx->vm, vcpu)) - vmx_set_int_window_exiting(vmx, vcpu); + vmx_set_int_window_exiting(vmx, vcpu); } VCPU_CTR1(vmx->vm, vcpu, "Injecting hwintr at vector %d", vector); From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 03:29:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E486C261; Tue, 10 Jun 2014 03:29:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1B3720E6; Tue, 10 Jun 2014 03:29:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5A3TFY5013695; Tue, 10 Jun 2014 03:29:15 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5A3TF7o013694; Tue, 10 Jun 2014 03:29:15 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201406100329.s5A3TF7o013694@svn.freebsd.org> From: Bryan Venteicher Date: Tue, 10 Jun 2014 03:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267313 - head/sys/dev/virtio/block X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 03:29:16 -0000 Author: bryanv Date: Tue Jun 10 03:29:15 2014 New Revision: 267313 URL: http://svnweb.freebsd.org/changeset/base/267313 Log: Always append new bios to the tail of the queue, instead of sorting them MFC after: 1 week Modified: head/sys/dev/virtio/block/virtio_blk.c Modified: head/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Tue Jun 10 03:23:35 2014 (r267312) +++ head/sys/dev/virtio/block/virtio_blk.c Tue Jun 10 03:29:15 2014 (r267313) @@ -577,7 +577,7 @@ vtblk_strategy(struct bio *bp) if (sc->vtblk_flags & VTBLK_FLAG_DETACH) vtblk_finish_bio(bp, ENXIO); else { - bioq_disksort(&sc->vtblk_bioq, bp); + bioq_insert_tail(&sc->vtblk_bioq, bp); if ((sc->vtblk_flags & VTBLK_FLAG_SUSPEND) == 0) vtblk_startio(sc); From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 05:58:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EBE40144; Tue, 10 Jun 2014 05:58:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9B332BA8; Tue, 10 Jun 2014 05:58:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5A5wkDm083712; Tue, 10 Jun 2014 05:58:46 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5A5wkkS083711; Tue, 10 Jun 2014 05:58:46 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201406100558.s5A5wkkS083711@svn.freebsd.org> From: Rui Paulo Date: Tue, 10 Jun 2014 05:58:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267316 - head/usr.bin/dtc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 05:58:47 -0000 Author: rpaulo Date: Tue Jun 10 05:58:46 2014 New Revision: 267316 URL: http://svnweb.freebsd.org/changeset/base/267316 Log: The, currently undocumented, -i option takes an argument. Modified: head/usr.bin/dtc/dtc.cc Modified: head/usr.bin/dtc/dtc.cc ============================================================================== --- head/usr.bin/dtc/dtc.cc Tue Jun 10 04:44:28 2014 (r267315) +++ head/usr.bin/dtc/dtc.cc Tue Jun 10 05:58:46 2014 (r267316) @@ -100,7 +100,7 @@ main(int argc, char **argv) clock_t c0 = clock(); class device_tree tree; fdt::checking::check_manager checks; - const char *options = "hqI:O:o:V:d:R:S:p:b:fisvH:W:E:DP:"; + const char *options = "hqI:O:o:V:d:R:S:p:b:fi:svH:W:E:DP:"; // Don't forget to update the man page if any more options are added. while ((ch = getopt(argc, argv, options)) != -1) From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 06:04:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12D88619; Tue, 10 Jun 2014 06:04:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 009AC2C63; Tue, 10 Jun 2014 06:04:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5A64PeD088036; Tue, 10 Jun 2014 06:04:25 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5A64PSD088035; Tue, 10 Jun 2014 06:04:25 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201406100604.s5A64PSD088035@svn.freebsd.org> From: Rui Paulo Date: Tue, 10 Jun 2014 06:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267317 - head/usr.bin/dtc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 06:04:26 -0000 Author: rpaulo Date: Tue Jun 10 06:04:25 2014 New Revision: 267317 URL: http://svnweb.freebsd.org/changeset/base/267317 Log: dtc: don't crash if the argument is a directory. Modified: head/usr.bin/dtc/fdt.cc Modified: head/usr.bin/dtc/fdt.cc ============================================================================== --- head/usr.bin/dtc/fdt.cc Tue Jun 10 05:58:46 2014 (r267316) +++ head/usr.bin/dtc/fdt.cc Tue Jun 10 06:04:25 2014 (r267317) @@ -42,6 +42,8 @@ #include #include #include +#include +#include #include "dtb.hh" namespace dtc @@ -1078,6 +1080,13 @@ device_tree::buffer_for_file(const char fprintf(stderr, "Unable to open file %s\n", path); return 0; } + struct stat st; + if (fstat(source, &st) == 0 && S_ISDIR(st.st_mode)) + { + fprintf(stderr, "File %s is a directory\n", path); + close(source); + return 0; + } input_buffer *b = new mmap_input_buffer(source); // Keep the buffer that owns the memory around for the lifetime // of this FDT. Ones simply referring to it may have shorter From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 06:16:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E059E06; Tue, 10 Jun 2014 06:16:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C2162D7E; Tue, 10 Jun 2014 06:16:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5A6GYN7093248; Tue, 10 Jun 2014 06:16:34 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5A6GY4Q093247; Tue, 10 Jun 2014 06:16:34 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201406100616.s5A6GY4Q093247@svn.freebsd.org> From: Rui Paulo Date: Tue, 10 Jun 2014 06:16:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267318 - head/usr.bin/dtc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 06:16:35 -0000 Author: rpaulo Date: Tue Jun 10 06:16:34 2014 New Revision: 267318 URL: http://svnweb.freebsd.org/changeset/base/267318 Log: dtc: ignore lines starting with #. This is necessary because we use the C pre-processor to parse #include lines and cpp adds line markings that start with #. Modified: head/usr.bin/dtc/input_buffer.cc Modified: head/usr.bin/dtc/input_buffer.cc ============================================================================== --- head/usr.bin/dtc/input_buffer.cc Tue Jun 10 06:04:25 2014 (r267317) +++ head/usr.bin/dtc/input_buffer.cc Tue Jun 10 06:16:34 2014 (r267318) @@ -151,7 +151,7 @@ input_buffer::next_token() start = cursor; skip_spaces(); // Parse /* comments - if (((*this)[0] == '/') && ((*this)[1] == '*')) + if ((*this)[0] == '/' && (*this)[1] == '*') { // eat the start of the comment ++(*this); @@ -168,13 +168,14 @@ input_buffer::next_token() // Eat the / ++(*this); } - // Parse // comments - if (((*this)[0] == '/') && ((*this)[1] == '/')) + // Parse // comments and # comments + if (((*this)[0] == '/' && (*this)[1] == '/') || + (*this)[0] == '#') { // eat the start of the comment ++(*this); ++(*this); - // Find the ending * of */ + // Find the ending of the line while (**this != '\n') { ++(*this); From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 06:24:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30DE9171; Tue, 10 Jun 2014 06:24:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EEF02E4B; Tue, 10 Jun 2014 06:24:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5A6O1u4097441; Tue, 10 Jun 2014 06:24:01 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5A6O16S097440; Tue, 10 Jun 2014 06:24:01 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201406100624.s5A6O16S097440@svn.freebsd.org> From: Rui Paulo Date: Tue, 10 Jun 2014 06:24:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267319 - head/sys/tools/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 06:24:02 -0000 Author: rpaulo Date: Tue Jun 10 06:24:01 2014 New Revision: 267319 URL: http://svnweb.freebsd.org/changeset/base/267319 Log: Call cpp with -P to avoid printing line markings. Modified: head/sys/tools/fdt/make_dtb.sh Modified: head/sys/tools/fdt/make_dtb.sh ============================================================================== --- head/sys/tools/fdt/make_dtb.sh Tue Jun 10 06:16:34 2014 (r267318) +++ head/sys/tools/fdt/make_dtb.sh Tue Jun 10 06:24:01 2014 (r267319) @@ -15,6 +15,6 @@ fi for d in ${dts}; do dtb=${dtb_path}/`basename $d .dts`.dtb echo "converting $d -> $dtb" - cpp -x assembler-with-cpp -I $S/gnu/dts/include -I $S/boot/fdt/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $d /dev/null | + cpp -P -x assembler-with-cpp -I $S/gnu/dts/include -I $S/boot/fdt/dts/${MACHINE} -I $S/gnu/dts/${MACHINE} -include $d /dev/null | dtc -O dtb -o $dtb -b 0 -p 1024 -i $S/boot/fdt/dts/${MACHINE} -i $S/gnu/dts/${MACHINE} done From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 06:43:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 97097A01; Tue, 10 Jun 2014 06:43:54 +0000 (UTC) Date: Tue, 10 Jun 2014 06:43:54 +0000 From: Alexey Dokuchaev To: John Baldwin Subject: Re: svn commit: r267291 - head/sys/libkern Message-ID: <20140610064354.GB89864@FreeBSD.org> References: <201406091927.s59JRlNI086860@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201406091927.s59JRlNI086860@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 06:43:54 -0000 On Mon, Jun 09, 2014 at 07:27:47PM +0000, John Baldwin wrote: > New Revision: 267291 > URL: http://svnweb.freebsd.org/changeset/base/267291 > > Log: > Use strcasecmp() instead of strcmp() when checking user-supplied encoding > names so that encoding names are treated as case-insensitive. This allows > the use of 'utf-8' instead of 'UTF-8' for example and matches the behavior > of iconv(1). Thanks! Thas had bitten me before; caused me some nasty debugging minutes. > MFC after: 1 week Please MFC to stable/8 as well, thank you. ./danfe From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 08:15:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FC74CC3; Tue, 10 Jun 2014 08:15:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D0C52789; Tue, 10 Jun 2014 08:15:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5A8Ff4Y053445; Tue, 10 Jun 2014 08:15:41 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5A8Ff1j053444; Tue, 10 Jun 2014 08:15:41 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201406100815.s5A8Ff1j053444@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jun 2014 08:15:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267320 - head/usr.sbin/acpi/acpiconf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 08:15:42 -0000 Author: eadler Date: Tue Jun 10 08:15:41 2014 New Revision: 267320 URL: http://svnweb.freebsd.org/changeset/base/267320 Log: acpiconf(8): tell users not to use -k Add language from jhb Requested by: jhb, jkim Modified: head/usr.sbin/acpi/acpiconf/acpiconf.8 Modified: head/usr.sbin/acpi/acpiconf/acpiconf.8 ============================================================================== --- head/usr.sbin/acpi/acpiconf/acpiconf.8 Tue Jun 10 06:24:01 2014 (r267319) +++ head/usr.sbin/acpi/acpiconf/acpiconf.8 Tue Jun 10 08:15:41 2014 (r267320) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2014 +.Dd June 10, 2014 .Dt ACPICONF 8 .Os .Sh NAME @@ -52,6 +52,7 @@ Displays a summary of available options. Get design information about the specified battery. .It Fl k Ar ack Ack or abort a pending suspend request using the argument provided. +.Sy Most users should not use this option directly. .It Fl s Ar type Enters the specified sleep mode. Recognized types are From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 08:16:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01044E13 for ; Tue, 10 Jun 2014 08:16:33 +0000 (UTC) Received: from mail-qg0-x22c.google.com (mail-qg0-x22c.google.com [IPv6:2607:f8b0:400d:c04::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF734279B for ; Tue, 10 Jun 2014 08:16:33 +0000 (UTC) Received: by mail-qg0-f44.google.com with SMTP id i50so10066653qgf.3 for ; Tue, 10 Jun 2014 01:16:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=/Ny5g9yd3YWU2KiZKffcGUXw65RSvKcsSeKFeEg6qUk=; b=Ak3IEyVlCEm1ygrVMaEGCEKrQB6ZgFpYRP3gZjn2tpLb576h40/I0SgHZBvEG6M5S4 mM9c0jkdsnPj5IzZSs+G4iqW6qslvQ7f6WSSf/THkJBHRegUfFLgCxHMhS1nMo98F50A 4t06UOxlMdYA72/yph+HWXYCv5Fhl4yndFPbQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=/Ny5g9yd3YWU2KiZKffcGUXw65RSvKcsSeKFeEg6qUk=; b=R+C96i9CBvABWFpLEDhl36SK+CyJO7cbi07WDrbUcsiGwCvzEjI0Bpx8eKop1U9hKP pq805QXIuJSzhME2iuCEs+bAQ8JzStN51JRpyr5FpPMAjjmVf/cywUusjb0A+Wh7u/JE 9itynQ+RfDWBqgdekw31bSs4cPATv57/cMbUkd0cd3XNkFDEnRMjmaRPRbU1ueYCvDhg Mh1Wt+o40l6moVEThEBE6r3gfNSTvgVQIEwz6Z+KLEuNjKkzmFmqJyH5rXWPGpE1K00G BCPjk5n53MpnP0/LEiDLeCYwnl/9W/kQZsSMod5IPSJslRBzwL18EZQ3jAWv19/ZXLLO jpBw== X-Gm-Message-State: ALoCoQmM8Z6GuLIHHA7zFqxJpAJ3+/faTjhDaXRYj0GGkP7/HKMeK1y0J4Urj+aIw4uEEZpMi+Uk X-Received: by 10.224.135.132 with SMTP id n4mr41243453qat.23.1402388192564; Tue, 10 Jun 2014 01:16:32 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.222.131 with HTTP; Tue, 10 Jun 2014 01:16:02 -0700 (PDT) In-Reply-To: <5395F9EC.40607@FreeBSD.org> References: <201406090154.s591s18T091857@svn.freebsd.org> <201406091143.52910.jhb@freebsd.org> <5395F9EC.40607@FreeBSD.org> From: Eitan Adler Date: Tue, 10 Jun 2014 01:16:02 -0700 X-Google-Sender-Auth: EnUdRrT2svt3EvG9hlHcPDPqdeQ Message-ID: Subject: Re: svn commit: r267248 - head/usr.sbin/acpi/acpiconf To: Jung-uk Kim Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 08:16:34 -0000 On 9 June 2014 11:16, Jung-uk Kim wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 2014-06-09 11:43:52 -0400, John Baldwin wrote: >> On Sunday, June 08, 2014 9:54:01 pm Eitan Adler wrote: >>> Author: eadler Date: Mon Jun 9 01:54:00 2014 New Revision: >>> 267248 URL: http://svnweb.freebsd.org/changeset/base/267248 >>> >>> Log: acpiconf(8): document 'k' option >>> >>> Add missing documentation for the 'k' option based on reading the >>> source code. >> >> Might want some explicit language to say that users should probably >> never use this option directly. > > +1 Done. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 08:20:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D999EFAE; Tue, 10 Jun 2014 08:20:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD2B327C7; Tue, 10 Jun 2014 08:20:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5A8K1hk054248; Tue, 10 Jun 2014 08:20:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5A8K1S3054243; Tue, 10 Jun 2014 08:20:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201406100820.s5A8K1S3054243@svn.freebsd.org> From: Marius Strobl Date: Tue, 10 Jun 2014 08:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267321 - in head/sys/dev/usb: . controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 08:20:01 -0000 Author: marius Date: Tue Jun 10 08:20:00 2014 New Revision: 267321 URL: http://svnweb.freebsd.org/changeset/base/267321 Log: Avoid the USB device disconnected and controller shutdown clutter on system shutdown by putting the former under !rebooting and turning the latter into debug messages. Reviewed by: hps MFC after: 1 week Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: head/sys/dev/usb/controller/usb_controller.c head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Tue Jun 10 08:15:41 2014 (r267320) +++ head/sys/dev/usb/controller/usb_controller.c Tue Jun 10 08:20:00 2014 (r267321) @@ -333,7 +333,7 @@ usb_shutdown(device_t dev) return (0); } - device_printf(bus->bdev, "Controller shutdown\n"); + DPRINTF("%s: Controller shutdown\n", device_get_nameunit(bus->bdev)); USB_BUS_LOCK(bus); usb_proc_msignal(USB_BUS_EXPLORE_PROC(bus), @@ -345,7 +345,8 @@ usb_shutdown(device_t dev) } USB_BUS_UNLOCK(bus); - device_printf(bus->bdev, "Controller shutdown complete\n"); + DPRINTF("%s: Controller shutdown complete\n", + device_get_nameunit(bus->bdev)); return (0); } Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Tue Jun 10 08:15:41 2014 (r267320) +++ head/sys/dev/usb/usb_device.c Tue Jun 10 08:20:00 2014 (r267321) @@ -1124,10 +1124,12 @@ usb_detach_device_sub(struct usb_device */ *ppdev = NULL; - device_printf(dev, "at %s, port %d, addr %d " - "(disconnected)\n", - device_get_nameunit(udev->parent_dev), - udev->port_no, udev->address); + if (!rebooting) { + device_printf(dev, "at %s, port %d, addr %d " + "(disconnected)\n", + device_get_nameunit(udev->parent_dev), + udev->port_no, udev->address); + } if (device_is_attached(dev)) { if (udev->flags.peer_suspended) { @@ -2143,8 +2145,10 @@ usb_free_device(struct usb_device *udev, #endif #if USB_HAVE_UGEN - printf("%s: <%s> at %s (disconnected)\n", udev->ugen_name, - usb_get_manufacturer(udev), device_get_nameunit(bus->bdev)); + if (!rebooting) { + printf("%s: <%s> at %s (disconnected)\n", udev->ugen_name, + usb_get_manufacturer(udev), device_get_nameunit(bus->bdev)); + } /* Destroy UGEN symlink, if any */ if (udev->ugen_symlink) { From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 12:59:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29FB0B35; Tue, 10 Jun 2014 12:59:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1ADE230A; Tue, 10 Jun 2014 12:59:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5ACxu8x091019; Tue, 10 Jun 2014 12:59:56 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5ACxu72091018; Tue, 10 Jun 2014 12:59:56 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406101259.s5ACxu72091018@svn.freebsd.org> From: Ed Maste Date: Tue, 10 Jun 2014 12:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267324 - head/tools/tools/vt/fontcvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 12:59:57 -0000 Author: emaste Date: Tue Jun 10 12:59:56 2014 New Revision: 267324 URL: http://svnweb.freebsd.org/changeset/base/267324 Log: vt fontcvt: handle failure writing output font Modified: head/tools/tools/vt/fontcvt/fontcvt.c Modified: head/tools/tools/vt/fontcvt/fontcvt.c ============================================================================== --- head/tools/tools/vt/fontcvt/fontcvt.c Tue Jun 10 09:36:10 2014 (r267323) +++ head/tools/tools/vt/fontcvt/fontcvt.c Tue Jun 10 12:59:56 2014 (r267324) @@ -354,7 +354,7 @@ number_glyphs(void) gl->g_index = idx++; } -static void +static int write_glyphs(FILE *fp) { struct glyph *gl; @@ -362,8 +362,10 @@ write_glyphs(FILE *fp) for (i = 0; i < VFNT_MAPS; i++) { TAILQ_FOREACH(gl, &glyphs[i], g_list) - fwrite(gl->g_data, wbytes * height, 1, fp); + if (fwrite(gl->g_data, wbytes * height, 1, fp) != 1) + return (1); } + return (0); } static void @@ -390,7 +392,7 @@ struct file_mapping { uint16_t length; } __packed; -static void +static int write_mappings(FILE *fp, unsigned int map_idx) { struct mapping_list *ml = &maps[map_idx]; @@ -405,10 +407,12 @@ write_mappings(FILE *fp, unsigned int ma fm.source = htobe32(mp->m_char); fm.destination = htobe16(mp->m_glyph->g_index); fm.length = htobe16(mp->m_length - 1); - fwrite(&fm, sizeof fm, 1, fp); + if (fwrite(&fm, sizeof fm, 1, fp) != 1) + return (1); } } assert(i == j); + return (0); } struct file_header { @@ -441,13 +445,19 @@ write_fnt(const char *filename) fh.map_count[1] = htobe32(map_folded_count[1]); fh.map_count[2] = htobe32(map_folded_count[2]); fh.map_count[3] = htobe32(map_folded_count[3]); - fwrite(&fh, sizeof fh, 1, fp); + if (fwrite(&fh, sizeof fh, 1, fp) != 1) { + perror(filename); + return (1); + } - write_glyphs(fp); - write_mappings(fp, VFNT_MAP_NORMAL); - write_mappings(fp, 1); - write_mappings(fp, VFNT_MAP_BOLD); - write_mappings(fp, 3); + if (write_glyphs(fp) != 0 || + write_mappings(fp, VFNT_MAP_NORMAL) != 0 || + write_mappings(fp, 1) != 0 || + write_mappings(fp, VFNT_MAP_BOLD) != 0 || + write_mappings(fp, 3) != 0) { + perror(filename); + return (1); + } return (0); } From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 13:57:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A6E3E35; Tue, 10 Jun 2014 13:57:21 +0000 (UTC) Received: from mail-ob0-x236.google.com (mail-ob0-x236.google.com [IPv6:2607:f8b0:4003:c01::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F0CA28BC; Tue, 10 Jun 2014 13:57:21 +0000 (UTC) Received: by mail-ob0-f182.google.com with SMTP id nu7so1507113obb.27 for ; Tue, 10 Jun 2014 06:57:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=AIhsQA/hkQmKksMQF93iMPcU2z97nIHGv+QTwVnc3dI=; b=yHviQVs7CW6Z1WSsqQRDSy8/3F48mJiwY0b90zsg6nNbL/UwuZh8c1L9p4q9O3JhdQ 6Tsdxjm+5eWX72VgKcQwEqTohsI/r/OHd/j6KUdajEogxK0PwZeweYj3sYQpALpEgO76 gSijQIy1M3KH8wOF94Rk3zQ5RhB6DaZrTrTnLOmhXccfJNZyk7G69HSJgO6toyeDcVLN YSLWYUE0/gcY/tnQ9fWeI0/B/8/V/qAyOT8iLkS9/Q2lq2RInK6uI8kyHzvFUcf6C+Ku gErTjChM+O2e0xp1B15EDY8q7CVeyaVyvnZUuiff0r3WxajlGgunDhz3bxkJNR6nXBF9 oblQ== MIME-Version: 1.0 X-Received: by 10.60.74.67 with SMTP id r3mr33788081oev.9.1402408640400; Tue, 10 Jun 2014 06:57:20 -0700 (PDT) Received: by 10.182.142.34 with HTTP; Tue, 10 Jun 2014 06:57:20 -0700 (PDT) In-Reply-To: <201406100616.s5A6GY4Q093247@svn.freebsd.org> References: <201406100616.s5A6GY4Q093247@svn.freebsd.org> Date: Tue, 10 Jun 2014 09:57:20 -0400 Message-ID: Subject: Re: svn commit: r267318 - head/usr.bin/dtc From: Benjamin Kaduk To: Rui Paulo Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 13:57:21 -0000 On Tue, Jun 10, 2014 at 2:16 AM, Rui Paulo wrote: > Author: rpaulo > Date: Tue Jun 10 06:16:34 2014 > New Revision: 267318 > URL: http://svnweb.freebsd.org/changeset/base/267318 > > Log: > dtc: ignore lines starting with #. > > This is necessary because we use the C pre-processor to parse #include > lines > and cpp adds line markings that start with #. > [Obligatory note that cpp is tied to its C compiler and is only obligated to produce output acceptable to that C compiler; such output could be arbitrarily complex.] -Ben From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 15:19:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 586A8F13; Tue, 10 Jun 2014 15:19:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 463EC2174; Tue, 10 Jun 2014 15:19:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5AFJTZv056967; Tue, 10 Jun 2014 15:19:29 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5AFJTbn056966; Tue, 10 Jun 2014 15:19:29 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406101519.s5AFJTbn056966@svn.freebsd.org> From: Glen Barber Date: Tue, 10 Jun 2014 15:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267326 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 15:19:29 -0000 Author: gjb Date: Tue Jun 10 15:19:28 2014 New Revision: 267326 URL: http://svnweb.freebsd.org/changeset/base/267326 Log: Add empty pkg-stage file to CLEANFILES if WITH_DVD=1. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Tue Jun 10 13:57:15 2014 (r267325) +++ head/release/Makefile Tue Jun 10 15:19:28 2014 (r267326) @@ -100,6 +100,9 @@ CLEANFILES= packagesystem *.txz MANIFEST CLEANFILES+= ${I}.xz . endfor .endif +. if defined(WITH_DVD) && !empty(WITH_DVD) +CLEANFILES+= pkg-stage +. endif CLEANDIRS= dist ftp release bootonly dvd beforeclean: chflags -R noschg . From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 15:20:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D7751CF; Tue, 10 Jun 2014 15:20:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B3C62187; Tue, 10 Jun 2014 15:20:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5AFKg31059439; Tue, 10 Jun 2014 15:20:42 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5AFKgN9059438; Tue, 10 Jun 2014 15:20:42 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406101520.s5AFKgN9059438@svn.freebsd.org> From: Glen Barber Date: Tue, 10 Jun 2014 15:20:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267327 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 15:20:42 -0000 Author: gjb Date: Tue Jun 10 15:20:41 2014 New Revision: 267327 URL: http://svnweb.freebsd.org/changeset/base/267327 Log: Fix indentation level. MFC after: 3 days X-MFC-With: r267326 Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Tue Jun 10 15:19:28 2014 (r267326) +++ head/release/Makefile Tue Jun 10 15:20:41 2014 (r267327) @@ -100,9 +100,9 @@ CLEANFILES= packagesystem *.txz MANIFEST CLEANFILES+= ${I}.xz . endfor .endif -. if defined(WITH_DVD) && !empty(WITH_DVD) +.if defined(WITH_DVD) && !empty(WITH_DVD) CLEANFILES+= pkg-stage -. endif +.endif CLEANDIRS= dist ftp release bootonly dvd beforeclean: chflags -R noschg . From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 16:07:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82ADC8E6; Tue, 10 Jun 2014 16:07:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55EFC25E7; Tue, 10 Jun 2014 16:07:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5AG70D7080055; Tue, 10 Jun 2014 16:07:00 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5AG70fN080054; Tue, 10 Jun 2014 16:07:00 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201406101607.s5AG70fN080054@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 10 Jun 2014 16:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267328 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 16:07:00 -0000 Author: luigi Date: Tue Jun 10 16:06:59 2014 New Revision: 267328 URL: http://svnweb.freebsd.org/changeset/base/267328 Log: change the netmap mbuf destructor so the same code works also on FreeBSD 9. For head and 10 this change has no effect, but on stable/9 it would cause panics when using emulated netmap on top of a standard device driver. Modified: head/sys/dev/netmap/netmap_generic.c Modified: head/sys/dev/netmap/netmap_generic.c ============================================================================== --- head/sys/dev/netmap/netmap_generic.c Tue Jun 10 15:20:41 2014 (r267327) +++ head/sys/dev/netmap/netmap_generic.c Tue Jun 10 16:06:59 2014 (r267328) @@ -102,24 +102,30 @@ __FBSDID("$FreeBSD$"); * mbuf wrappers */ -/* mbuf destructor, also need to change the type to EXT_EXTREF, +/* + * mbuf destructor, also need to change the type to EXT_EXTREF, * add an M_NOFREE flag, and then clear the flag and * chain into uma_zfree(zone_pack, mf) * (or reinstall the buffer ?) + * + * On FreeBSD 9 the destructor is called as ext_free(ext_arg1, ext_arg2) + * whereas newer version have ext_free(m, ext_arg1, ext_arg2) + * For compatibility we set ext_arg1 = m on allocation so we have + * the same code on both. */ #define SET_MBUF_DESTRUCTOR(m, fn) do { \ - (m)->m_ext.ext_free = (void *)fn; \ - (m)->m_ext.ext_type = EXT_EXTREF; \ -} while (0) + (m)->m_ext.ext_free = (void *)fn; \ + (m)->m_ext.ext_type = EXT_EXTREF; \ + } while (0) static void -netmap_default_mbuf_destructor(struct mbuf *m) +netmap_default_mbuf_destructor(struct mbuf *m) { - /* restore original mbuf */ - m->m_ext.ext_buf = m->m_data = m->m_ext.ext_arg1; - m->m_ext.ext_arg1 = NULL; + /* restore original data pointer and type */ + m->m_ext.ext_buf = m->m_data = m->m_ext.ext_arg2; m->m_ext.ext_type = EXT_PACKET; m->m_ext.ext_free = NULL; + m->m_ext.ext_arg1 = m->m_ext.ext_arg2 = NULL; if (*(m->m_ext.ref_cnt) == 0) *(m->m_ext.ref_cnt) = 1; uma_zfree(zone_pack, m); @@ -131,7 +137,8 @@ netmap_get_mbuf(int len) struct mbuf *m; m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR | M_NOFREE); if (m) { - m->m_ext.ext_arg1 = m->m_ext.ext_buf; // XXX save + m->m_ext.ext_arg1 = m; /* FreeBSD 9 compat */ + m->m_ext.ext_arg2 = m->m_ext.ext_buf; /* save original */ m->m_ext.ext_free = (void *)netmap_default_mbuf_destructor; m->m_ext.ext_type = EXT_EXTREF; ND(5, "create m %p refcnt %d", m, *m->m_ext.ref_cnt); From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 16:11:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E83A2DE3; Tue, 10 Jun 2014 16:11:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5BFC26B1; Tue, 10 Jun 2014 16:11:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5AGBKLM084064; Tue, 10 Jun 2014 16:11:20 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5AGBKR6084063; Tue, 10 Jun 2014 16:11:20 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201406101611.s5AGBKR6084063@svn.freebsd.org> From: Michael Tuexen Date: Tue, 10 Jun 2014 16:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267329 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 16:11:21 -0000 Author: tuexen Date: Tue Jun 10 16:11:20 2014 New Revision: 267329 URL: http://svnweb.freebsd.org/changeset/base/267329 Log: Add support for the SCTP_LOCAL_TRACE_BUF options. While there, fix some whitespaces. MFC after: 1 week Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Jun 10 16:06:59 2014 (r267328) +++ head/sys/conf/options Tue Jun 10 16:11:20 2014 (r267329) @@ -453,8 +453,9 @@ SCTP_MBCNT_LOGGING opt_sctp.h # Log to K SCTP_PACKET_LOGGING opt_sctp.h # Log to a packet buffer last N packets SCTP_LTRACE_CHUNKS opt_sctp.h # Log to KTR chunks processed SCTP_LTRACE_ERRORS opt_sctp.h # Log to KTR error returns. -SCTP_USE_PERCPU_STAT opt_sctp.h # Use per cpu stats. -SCTP_MCORE_INPUT opt_sctp.h # Have multiple input threads for input mbufs +SCTP_USE_PERCPU_STAT opt_sctp.h # Use per cpu stats. +SCTP_MCORE_INPUT opt_sctp.h # Have multiple input threads for input mbufs +SCTP_LOCAL_TRACE_BUF opt_sctp.h # Use tracebuffer exported via sysctl # # # From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 16:45:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29F0BB14; Tue, 10 Jun 2014 16:45:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16C5929C5; Tue, 10 Jun 2014 16:45:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5AGjw6Y098335; Tue, 10 Jun 2014 16:45:58 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5AGjwPp098332; Tue, 10 Jun 2014 16:45:58 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201406101645.s5AGjwPp098332@svn.freebsd.org> From: Neel Natu Date: Tue, 10 Jun 2014 16:45:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267330 - in head/sys/amd64: include vmm vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 16:45:59 -0000 Author: neel Date: Tue Jun 10 16:45:58 2014 New Revision: 267330 URL: http://svnweb.freebsd.org/changeset/base/267330 Log: Add helper functions to populate VM exit information for rendezvous and astpending exits. This is to reduce code duplication between VT-x and SVM implementations. Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Tue Jun 10 16:11:20 2014 (r267329) +++ head/sys/amd64/include/vmm.h Tue Jun 10 16:45:58 2014 (r267330) @@ -146,6 +146,8 @@ cpuset_t vm_active_cpus(struct vm *vm); cpuset_t vm_suspended_cpus(struct vm *vm); struct vm_exit *vm_exitinfo(struct vm *vm, int vcpuid); void vm_exit_suspended(struct vm *vm, int vcpuid, uint64_t rip); +void vm_exit_rendezvous(struct vm *vm, int vcpuid, uint64_t rip); +void vm_exit_astpending(struct vm *vm, int vcpuid, uint64_t rip); /* * Rendezvous all vcpus specified in 'dest' and execute 'func(arg)'. Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Tue Jun 10 16:11:20 2014 (r267329) +++ head/sys/amd64/vmm/intel/vmx.c Tue Jun 10 16:45:58 2014 (r267330) @@ -2263,32 +2263,7 @@ vmx_exit_process(struct vmx *vmx, int vc return (handled); } -static __inline int -vmx_exit_astpending(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) -{ - - vmexit->rip = vmcs_guest_rip(); - vmexit->inst_length = 0; - vmexit->exitcode = VM_EXITCODE_BOGUS; - vmx_astpending_trace(vmx, vcpu, vmexit->rip); - vmm_stat_incr(vmx->vm, vcpu, VMEXIT_ASTPENDING, 1); - - return (HANDLED); -} - -static __inline int -vmx_exit_rendezvous(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) -{ - - vmexit->rip = vmcs_guest_rip(); - vmexit->inst_length = 0; - vmexit->exitcode = VM_EXITCODE_RENDEZVOUS; - vmm_stat_incr(vmx->vm, vcpu, VMEXIT_RENDEZVOUS, 1); - - return (UNHANDLED); -} - -static __inline int +static __inline void vmx_exit_inst_error(struct vmxctx *vmxctx, int rc, struct vm_exit *vmexit) { @@ -2312,8 +2287,6 @@ vmx_exit_inst_error(struct vmxctx *vmxct default: panic("vm_exit_inst_error: vmx_enter_guest returned %d", rc); } - - return (UNHANDLED); } /* @@ -2386,6 +2359,8 @@ vmx_run(void *arg, int vcpu, register_t vmcs_write(VMCS_GUEST_RIP, startrip); vmx_set_pcpu_defaults(vmx, vcpu, pmap); do { + handled = UNHANDLED; + /* * Interrupts are disabled from this point on until the * guest starts executing. This is done for the following @@ -2408,19 +2383,20 @@ vmx_run(void *arg, int vcpu, register_t if (vcpu_suspended(suspend_cookie)) { enable_intr(); vm_exit_suspended(vmx->vm, vcpu, vmcs_guest_rip()); - handled = UNHANDLED; break; } if (vcpu_rendezvous_pending(rendezvous_cookie)) { enable_intr(); - handled = vmx_exit_rendezvous(vmx, vcpu, vmexit); + vm_exit_rendezvous(vmx->vm, vcpu, vmcs_guest_rip()); break; } if (curthread->td_flags & (TDF_ASTPENDING | TDF_NEEDRESCHED)) { enable_intr(); - handled = vmx_exit_astpending(vmx, vcpu, vmexit); + vm_exit_astpending(vmx->vm, vcpu, vmcs_guest_rip()); + vmx_astpending_trace(vmx, vcpu, vmexit->rip); + handled = HANDLED; break; } @@ -2440,7 +2416,7 @@ vmx_run(void *arg, int vcpu, register_t handled = vmx_exit_process(vmx, vcpu, vmexit); } else { enable_intr(); - handled = vmx_exit_inst_error(vmxctx, rc, vmexit); + vmx_exit_inst_error(vmxctx, rc, vmexit); } launched = 1; vmx_exit_trace(vmx, vcpu, rip, exit_reason, handled); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Tue Jun 10 16:11:20 2014 (r267329) +++ head/sys/amd64/vmm/vmm.c Tue Jun 10 16:45:58 2014 (r267330) @@ -1331,6 +1331,32 @@ vm_exit_suspended(struct vm *vm, int vcp vmexit->u.suspended.how = vm->suspend; } +void +vm_exit_rendezvous(struct vm *vm, int vcpuid, uint64_t rip) +{ + struct vm_exit *vmexit; + + KASSERT(vm->rendezvous_func != NULL, ("rendezvous not in progress")); + + vmexit = vm_exitinfo(vm, vcpuid); + vmexit->rip = rip; + vmexit->inst_length = 0; + vmexit->exitcode = VM_EXITCODE_RENDEZVOUS; + vmm_stat_incr(vm, vcpuid, VMEXIT_RENDEZVOUS, 1); +} + +void +vm_exit_astpending(struct vm *vm, int vcpuid, uint64_t rip) +{ + struct vm_exit *vmexit; + + vmexit = vm_exitinfo(vm, vcpuid); + vmexit->rip = rip; + vmexit->inst_length = 0; + vmexit->exitcode = VM_EXITCODE_BOGUS; + vmm_stat_incr(vm, vcpuid, VMEXIT_ASTPENDING, 1); +} + int vm_run(struct vm *vm, struct vm_run *vmrun) { From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 17:04:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3873B333; Tue, 10 Jun 2014 17:04:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1243C2BA5; Tue, 10 Jun 2014 17:04:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5AH4VgV007395; Tue, 10 Jun 2014 17:04:31 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5AH4Vjm007388; Tue, 10 Jun 2014 17:04:31 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201406101704.s5AH4Vjm007388@svn.freebsd.org> From: Julio Merino Date: Tue, 10 Jun 2014 17:04:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267331 - in head: . etc share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 17:04:32 -0000 Author: jmmv Date: Tue Jun 10 17:04:30 2014 New Revision: 267331 URL: http://svnweb.freebsd.org/changeset/base/267331 Log: Put the test suite in its own tests.txz distribution file. Force all the contents of /usr/tests to go into a separate distribution file so that users of binary releases can easily choose to not install it. To make this possible, we need two fixes: - bsd.subdir.mk needs to properly honor NO_SUBDIR in all cases so that we do not recurse into 'tests' subdirectories when we needn't. Otherwise, we end up with some Kyuafiles in base.txz. - etc/Makefile needs to skip installing tests in its 'distribute' target so that a Kyuafile doesn't leak into base.txz. Approved by: gjb Modified: head/Makefile.inc1 head/etc/Makefile head/share/mk/bsd.subdir.mk head/share/mk/bsd.test.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jun 10 16:45:58 2014 (r267330) +++ head/Makefile.inc1 Tue Jun 10 17:04:30 2014 (r267331) @@ -776,6 +776,9 @@ EXTRA_DISTRIBUTIONS+= games .if defined(LIB32TMP) && ${MK_LIB32} != "no" EXTRA_DISTRIBUTIONS+= lib32 .endif +.if ${MK_TESTS} != "no" +EXTRA_DISTRIBUTIONS+= tests +.endif MTREE_MAGIC?= mtree 2.0 @@ -817,6 +820,10 @@ distributeworld installworld: _installch mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null .endif +.if ${MK_TESTS} != "no" && ${dist} == "tests" + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ + -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null +.endif .if defined(NO_ROOT) ${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \ sed -e 's#^\./#./${dist}/#' >> ${METALOG} Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Tue Jun 10 16:45:58 2014 (r267330) +++ head/etc/Makefile Tue Jun 10 17:04:30 2014 (r267331) @@ -174,7 +174,10 @@ afterinstall: .endif distribute: - ${_+_}cd ${.CURDIR} ; ${MAKE} install DESTDIR=${DISTDIR}/${DISTRIBUTION} + # Avoid installing tests here; "make distribution" will do this and + # correctly place them in the right location. + ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \ + DESTDIR=${DISTDIR}/${DISTRIBUTION} ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION} .include Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Tue Jun 10 16:45:58 2014 (r267330) +++ head/share/mk/bsd.subdir.mk Tue Jun 10 17:04:30 2014 (r267331) @@ -81,6 +81,7 @@ __subdir_targets+= .WAIT .else __subdir_targets+= ${__target}_subdir_${__dir} ${__target}_subdir_${__dir}: .MAKE +.if !defined(NO_SUBDIR) @${_+_}set -e; \ if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ ${ECHODIR} "===> ${DIRPRFX}${__dir}.${MACHINE_ARCH} (${__target:realinstall=install})"; \ @@ -94,6 +95,7 @@ ${__target}_subdir_${__dir}: .MAKE ${MAKE} ${__target:realinstall=install} \ DIRPRFX=${DIRPRFX}$$edir/ .endif +.endif .endfor ${__target}: ${__subdir_targets} .else Modified: head/share/mk/bsd.test.mk ============================================================================== --- head/share/mk/bsd.test.mk Tue Jun 10 16:45:58 2014 (r267330) +++ head/share/mk/bsd.test.mk Tue Jun 10 17:04:30 2014 (r267331) @@ -27,6 +27,15 @@ TESTS_SUBDIRS?= # List of variables to pass to the tests at run-time via the environment. TESTS_ENV?= +# Force all tests in a separate distribution file. +# +# We want this to be the case even when the distribution name is already +# overriden. For example: we want the tests for programs in the 'games' +# distribution to end up in the 'tests' distribution; the test programs +# themselves have all the necessary logic to detect that the games are not +# installed and thus won't cause false negatives. +DISTRIBUTION:= tests + # Ordered list of directories to construct the PATH for the tests. TESTS_PATH+= ${DESTDIR}/bin ${DESTDIR}/sbin \ ${DESTDIR}/usr/bin ${DESTDIR}/usr/sbin From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 17:05:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67A0948C; Tue, 10 Jun 2014 17:05:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 552A52BB5; Tue, 10 Jun 2014 17:05:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5AH5gZo007604; Tue, 10 Jun 2014 17:05:42 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5AH5gt8007603; Tue, 10 Jun 2014 17:05:42 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201406101705.s5AH5gt8007603@svn.freebsd.org> From: Julio Merino Date: Tue, 10 Jun 2014 17:05:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267332 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 17:05:42 -0000 Author: jmmv Date: Tue Jun 10 17:05:41 2014 New Revision: 267332 URL: http://svnweb.freebsd.org/changeset/base/267332 Log: Strip out the test suite from the installation media. This affects the disc1.iso, dvd1.iso and bootonly.iso files. Obtained from: gjb Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Tue Jun 10 17:04:30 2014 (r267331) +++ head/release/Makefile Tue Jun 10 17:05:41 2014 (r267332) @@ -155,7 +155,7 @@ system: packagesystem mkdir -p release cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \ - WITHOUT_PROFILE=1 WITHOUT_SENDMAIL=1 WITHOUT_ATF=1 WITHOUT_LIB32=1 + WITHOUT_PROFILE=1 WITHOUT_SENDMAIL=1 MK_TESTS=no WITHOUT_LIB32=1 # Copy distfiles mkdir -p release/usr/freebsd-dist cp *.txz MANIFEST release/usr/freebsd-dist @@ -180,7 +180,7 @@ bootonly: packagesystem WITHOUT_INSTALLLIB=1 WITHOUT_LIB32=1 WITHOUT_MAIL=1 \ WITHOUT_NCP=1 WITHOUT_TOOLCHAIN=1 WITHOUT_PROFILE=1 \ WITHOUT_INSTALLIB=1 WITHOUT_RESCUE=1 WITHOUT_DICT=1 \ - WITHOUT_KERNEL_SYMBOLS=1 + WITHOUT_KERNEL_SYMBOLS=1 MK_TESTS=no # Copy manifest only (no distfiles) to get checksums mkdir -p bootonly/usr/freebsd-dist cp MANIFEST bootonly/usr/freebsd-dist @@ -199,7 +199,8 @@ dvd: # Install system mkdir -p ${.TARGET} cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ - DESTDIR=${.OBJDIR}/${.TARGET} WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 + DESTDIR=${.OBJDIR}/${.TARGET} WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \ + MK_TESTS=no # Copy distfiles mkdir -p ${.TARGET}/usr/freebsd-dist cp *.txz MANIFEST ${.TARGET}/usr/freebsd-dist From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 17:22:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26982107; Tue, 10 Jun 2014 17:22:24 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id EE3992D89; Tue, 10 Jun 2014 17:22:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 65C1938063; Tue, 10 Jun 2014 12:22:17 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id 35Qm91EbKXtz; Tue, 10 Jun 2014 12:22:17 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id D0E2438067; Tue, 10 Jun 2014 12:22:16 -0500 (CDT) Message-ID: <53973EC7.10306@freebsd.org> Date: Tue, 10 Jun 2014 10:22:15 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Julio Merino , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r267332 - head/release References: <201406101705.s5AH5gt8007603@svn.freebsd.org> In-Reply-To: <201406101705.s5AH5gt8007603@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 17:22:24 -0000 On 06/10/14 10:05, Julio Merino wrote: > Author: jmmv > Date: Tue Jun 10 17:05:41 2014 > New Revision: 267332 > URL: http://svnweb.freebsd.org/changeset/base/267332 > > Log: > Strip out the test suite from the installation media. > > This affects the disc1.iso, dvd1.iso and bootonly.iso files. > > Obtained from: gjb > > Modified: > head/release/Makefile > > Modified: head/release/Makefile > ============================================================================== > --- head/release/Makefile Tue Jun 10 17:04:30 2014 (r267331) > +++ head/release/Makefile Tue Jun 10 17:05:41 2014 (r267332) > @@ -155,7 +155,7 @@ system: packagesystem > mkdir -p release > cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ > DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \ > - WITHOUT_PROFILE=1 WITHOUT_SENDMAIL=1 WITHOUT_ATF=1 WITHOUT_LIB32=1 > + WITHOUT_PROFILE=1 WITHOUT_SENDMAIL=1 MK_TESTS=no WITHOUT_LIB32=1 > # Copy distfiles Shouldn't this be "WITHOUT_TESTS" or the like? I thought we weren't supposed to set MK_* at the command line. -Nathan From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 17:26:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61DDA498; Tue, 10 Jun 2014 17:26:11 +0000 (UTC) Date: Tue, 10 Jun 2014 13:26:07 -0400 From: Glen Barber To: Nathan Whitehorn Subject: Re: svn commit: r267332 - head/release Message-ID: <20140610172607.GS1209@hub.FreeBSD.org> References: <201406101705.s5AH5gt8007603@svn.freebsd.org> <53973EC7.10306@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="o99acAvKqrTZeiCU" Content-Disposition: inline In-Reply-To: <53973EC7.10306@freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Julio Merino , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 17:26:12 -0000 --o99acAvKqrTZeiCU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 10, 2014 at 10:22:15AM -0700, Nathan Whitehorn wrote: > On 06/10/14 10:05, Julio Merino wrote: > >Author: jmmv > >Date: Tue Jun 10 17:05:41 2014 > >New Revision: 267332 > >URL: http://svnweb.freebsd.org/changeset/base/267332 > > > >Log: > > Strip out the test suite from the installation media. > > This affects the disc1.iso, dvd1.iso and bootonly.iso files. > > Obtained from: gjb > > > >Modified: > > head/release/Makefile > > > >Modified: head/release/Makefile > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >--- head/release/Makefile Tue Jun 10 17:04:30 2014 (r267331) > >+++ head/release/Makefile Tue Jun 10 17:05:41 2014 (r267332) > >@@ -155,7 +155,7 @@ system: packagesystem > > mkdir -p release > > cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ > > DESTDIR=3D${.OBJDIR}/release WITHOUT_RESCUE=3D1 WITHOUT_KERNEL_SYMBO= LS=3D1 \ > >- WITHOUT_PROFILE=3D1 WITHOUT_SENDMAIL=3D1 WITHOUT_ATF=3D1 WITHOUT_LIB3= 2=3D1 > >+ WITHOUT_PROFILE=3D1 WITHOUT_SENDMAIL=3D1 MK_TESTS=3Dno WITHOUT_LIB32= =3D1 > > # Copy distfiles >=20 > Shouldn't this be "WITHOUT_TESTS" or the like? I thought we weren't suppo= sed > to set MK_* at the command line. It does not work, or at least last I tried, because you cannot specify WITHOUT_FOO=3D1 if WITH_FOO=3D1 is set. Using MK_FOO=3Dno allows more granular tuning for these cases. Glen --o99acAvKqrTZeiCU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJTlz+vAAoJELls3eqvi17QsW4P/Armr++S5ClVDCZUfUntI7td XdrMhOGiWtaAYwuUiA1k+P4UvjnWvRCykhbnu2fQ98SQvwcrzfdpNRdBB+siuBt4 LB2JVir7e0CQWSiZw4j7mXNPlzt+wT9GUi+bEwVp4bWZDs7JA33/iwuL6lB/S/17 6sqg5Zr760v81gDWjl7V2g2V0De2eYhIpKJ1zCOgx88UhOIUy+bDGCNXOwO4r5gt gjAMCsyzq6hPMAATu5kUtrV59W2lruW2sy9r50meyvuVucySr+03I2CrOHkqmtuu tWHzfPNe17wt73DVv5PkmaD0z9vrMhwM6MmNlYKNnGilDNpwqOJMkJg24OtwxAs+ myqUAFcph/N28FPfs/HyoRwnD9ppr6nYIAA66YMiUYppeQeeALAqA1MBG1a1Et7r 7xi580A40T8HzrHU1MxJWfHpzeE98RxsABHnhUW1LXhmxIAXYWvvKdOKv2srv6b9 HEPaOG0ZzNRDOq3Lsy1S30ZeBZnTPeaicVV/vvlSI34dU/HeT0j7ya9dtmdRmFNw RHZXlm9uKM3HgC+FyHIBYYCuozL3Z/KdyWiKMMCltDzQUoDJvuuW4c6JD0cphQ4v k3TG+lwkftBkmZ9JdxMb4pPH2tekdg1Hq5ozT6qQwagTWY1fyE1eAnZftQ0IzoYQ l8KKHgbU4yC4XX/n8wKG =uG7L -----END PGP SIGNATURE----- --o99acAvKqrTZeiCU-- From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 17:29:29 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44875690; Tue, 10 Jun 2014 17:29:29 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 179852DEF; Tue, 10 Jun 2014 17:29:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 84B1538067; Tue, 10 Jun 2014 12:29:28 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id 0jLQoyIj_fmq; Tue, 10 Jun 2014 12:29:28 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id D66BA38063; Tue, 10 Jun 2014 12:29:27 -0500 (CDT) Message-ID: <53974076.9090003@freebsd.org> Date: Tue, 10 Jun 2014 10:29:26 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Glen Barber Subject: Re: svn commit: r267332 - head/release References: <201406101705.s5AH5gt8007603@svn.freebsd.org> <53973EC7.10306@freebsd.org> <20140610172607.GS1209@hub.FreeBSD.org> In-Reply-To: <20140610172607.GS1209@hub.FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Julio Merino , src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 17:29:29 -0000 On 06/10/14 10:26, Glen Barber wrote: > On Tue, Jun 10, 2014 at 10:22:15AM -0700, Nathan Whitehorn wrote: >> On 06/10/14 10:05, Julio Merino wrote: >>> Author: jmmv >>> Date: Tue Jun 10 17:05:41 2014 >>> New Revision: 267332 >>> URL: http://svnweb.freebsd.org/changeset/base/267332 >>> >>> Log: >>> Strip out the test suite from the installation media. >>> This affects the disc1.iso, dvd1.iso and bootonly.iso files. >>> Obtained from: gjb >>> >>> Modified: >>> head/release/Makefile >>> >>> Modified: head/release/Makefile >>> ============================================================================== >>> --- head/release/Makefile Tue Jun 10 17:04:30 2014 (r267331) >>> +++ head/release/Makefile Tue Jun 10 17:05:41 2014 (r267332) >>> @@ -155,7 +155,7 @@ system: packagesystem >>> mkdir -p release >>> cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ >>> DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \ >>> - WITHOUT_PROFILE=1 WITHOUT_SENDMAIL=1 WITHOUT_ATF=1 WITHOUT_LIB32=1 >>> + WITHOUT_PROFILE=1 WITHOUT_SENDMAIL=1 MK_TESTS=no WITHOUT_LIB32=1 >>> # Copy distfiles >> Shouldn't this be "WITHOUT_TESTS" or the like? I thought we weren't supposed >> to set MK_* at the command line. > It does not work, or at least last I tried, because you cannot specify > WITHOUT_FOO=1 if WITH_FOO=1 is set. Using MK_FOO=no allows more > granular tuning for these cases. > > Glen > Ah, OK. Just wanted to make sure it was deliberate! -Nathan From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 17:54:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F722408; Tue, 10 Jun 2014 17:54:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A76720D1; Tue, 10 Jun 2014 17:54:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5AHsPHS030423; Tue, 10 Jun 2014 17:54:25 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5AHsPb4030422; Tue, 10 Jun 2014 17:54:25 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201406101754.s5AHsPb4030422@svn.freebsd.org> From: Dimitry Andric Date: Tue, 10 Jun 2014 17:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267335 - head/lib/clang X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 17:54:25 -0000 Author: dim Date: Tue Jun 10 17:54:24 2014 New Revision: 267335 URL: http://svnweb.freebsd.org/changeset/base/267335 Log: In some scenarios, when generating llvm/clang .inc.h files, multiple source files could be passed to tblgen or clang-tblgen, leading to a "Too many positional arguments specified" error message. Fix this by replacing the too-generic ${.ALLSRC} sources with explicit paths. Reported by: rysto32@gmail.com, rodrigc MFC after: 3 days Modified: head/lib/clang/clang.build.mk Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Tue Jun 10 17:24:46 2014 (r267334) +++ head/lib/clang/clang.build.mk Tue Jun 10 17:54:24 2014 (r267335) @@ -74,149 +74,160 @@ ${arch:T}Gen${hdr:H:C/$/.inc.h/}: ${LLVM Attrs.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-classes \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrDump.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-dump \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrIdentifierArg.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-identifier-arg-list \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-impl \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrLateParsed.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-late-parsed-list \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-list \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrParsedAttrImpl.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-impl \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrParsedAttrKinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-kinds \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrParsedAttrList.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-parsed-attr-list \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrPCHRead.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-pch-read \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrPCHWrite.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-pch-write \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrSpellings.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-spelling-list \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrSpellingListIndex.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-spelling-index \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrTemplateInstantiate.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-template-instantiate \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td AttrTypeArg.inc.h: ${CLANG_SRCS}/include/clang/Basic/Attr.td ${CLANG_TBLGEN} -gen-clang-attr-type-arg-list \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ - ${.ALLSRC} + ${CLANG_SRCS}/include/clang/Basic/Attr.td CommentCommandInfo.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentCommands.td ${CLANG_TBLGEN} -gen-clang-comment-command-info \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/AST/CommentCommands.td CommentCommandList.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentCommands.td ${CLANG_TBLGEN} -gen-clang-comment-command-list \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/AST/CommentCommands.td CommentHTMLNamedCharacterReferences.inc.h: \ ${CLANG_SRCS}/include/clang/AST/CommentHTMLNamedCharacterReferences.td ${CLANG_TBLGEN} -gen-clang-comment-html-named-character-references \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/AST/CommentHTMLNamedCharacterReferences.td CommentHTMLTags.inc.h: ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td ${CLANG_TBLGEN} -gen-clang-comment-html-tags \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td CommentHTMLTagsProperties.inc.h: \ ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td ${CLANG_TBLGEN} -gen-clang-comment-html-tags-properties \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/AST/CommentHTMLTags.td CommentNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/CommentNodes.td ${CLANG_TBLGEN} -gen-clang-comment-nodes \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/Basic/CommentNodes.td DeclNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/DeclNodes.td ${CLANG_TBLGEN} -gen-clang-decl-nodes \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/Basic/DeclNodes.td StmtNodes.inc.h: ${CLANG_SRCS}/include/clang/Basic/StmtNodes.td ${CLANG_TBLGEN} -gen-clang-stmt-nodes \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/Basic/StmtNodes.td arm_neon.h: ${CLANG_SRCS}/include/clang/Basic/arm_neon.td ${CLANG_TBLGEN} -gen-arm-neon \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/Basic/arm_neon.td arm_neon.inc.h: ${CLANG_SRCS}/include/clang/Basic/arm_neon.td ${CLANG_TBLGEN} -gen-arm-neon-sema \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/Basic/arm_neon.td DiagnosticGroups.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td ${CLANG_TBLGEN} -gen-clang-diag-groups \ -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/\.h$/.d/} \ - -o ${.TARGET} ${.ALLSRC} + -o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td DiagnosticIndexName.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td ${CLANG_TBLGEN} -gen-clang-diags-index-name \ -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/\.h$/.d/} \ - -o ${.TARGET} ${.ALLSRC} + -o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td .for hdr in AST Analysis Comment Common Driver Frontend Lex Parse Sema Serialization Diagnostic${hdr}Kinds.inc.h: ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td ${CLANG_TBLGEN} -gen-clang-diags-defs -clang-component=${hdr} \ -I ${CLANG_SRCS}/include/clang/Basic -d ${.TARGET:C/\.h$/.d/} \ - -o ${.TARGET} ${.ALLSRC} + -o ${.TARGET} ${CLANG_SRCS}/include/clang/Basic/Diagnostic.td .endfor Options.inc.h: ${CLANG_SRCS}/include/clang/Driver/Options.td ${TBLGEN} -gen-opt-parser-defs \ -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/Driver/Options.td CC1AsOptions.inc.h: ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td ${TBLGEN} -gen-opt-parser-defs \ -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \ - -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} ${.ALLSRC} + -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ + ${CLANG_SRCS}/include/clang/Driver/CC1AsOptions.td -Checkers.inc.h: ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td \ - ${CLANG_SRCS}/include/clang/StaticAnalyzer/Checkers/CheckerBase.td +Checkers.inc.h: ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td ${CLANG_TBLGEN} -gen-clang-sa-checkers \ -I ${CLANG_SRCS}/include -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 18:21:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46548F70; Tue, 10 Jun 2014 18:21:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33271235C; Tue, 10 Jun 2014 18:21:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5AILdaW044069; Tue, 10 Jun 2014 18:21:39 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5AILcxp044064; Tue, 10 Jun 2014 18:21:38 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201406101821.s5AILcxp044064@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 10 Jun 2014 18:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267336 - head/sys/netgraph/bluetooth/socket X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 18:21:39 -0000 Author: trociny Date: Tue Jun 10 18:21:37 2014 New Revision: 267336 URL: http://svnweb.freebsd.org/changeset/base/267336 Log: PF_BLUETOOTH protocols: skip initialization of non-virtualized globals for non-default VNET instances. This fixes panic on a vnet initialization when ng_btsocket is loaded. MFC after: 1 week Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c Tue Jun 10 17:54:24 2014 (r267335) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c Tue Jun 10 18:21:37 2014 (r267336) @@ -51,6 +51,9 @@ #include #include #include + +#include + #include #include #include @@ -728,6 +731,10 @@ ng_btsocket_hci_raw_init(void) bitstr_t *f = NULL; int error = 0; + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_hci_raw_node = NULL; ng_btsocket_hci_raw_debug_level = NG_BTSOCKET_WARN_LEVEL; ng_btsocket_hci_raw_ioctl_timeout = 5; Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Tue Jun 10 17:54:24 2014 (r267335) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Tue Jun 10 18:21:37 2014 (r267336) @@ -1813,6 +1813,10 @@ ng_btsocket_l2cap_init(void) { int error = 0; + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_l2cap_node = NULL; ng_btsocket_l2cap_debug_level = NG_BTSOCKET_WARN_LEVEL; Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c Tue Jun 10 17:54:24 2014 (r267335) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c Tue Jun 10 18:21:37 2014 (r267336) @@ -50,6 +50,9 @@ #include #include #include + +#include + #include #include #include @@ -513,6 +516,10 @@ ng_btsocket_l2cap_raw_init(void) { int error = 0; + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_l2cap_raw_node = NULL; ng_btsocket_l2cap_raw_debug_level = NG_BTSOCKET_WARN_LEVEL; ng_btsocket_l2cap_raw_ioctl_timeout = 5; Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Tue Jun 10 17:54:24 2014 (r267335) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Tue Jun 10 18:21:37 2014 (r267336) @@ -328,6 +328,11 @@ ng_btsocket_rfcomm_check_fcs(u_int8_t *d void ng_btsocket_rfcomm_init(void) { + + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_rfcomm_debug_level = NG_BTSOCKET_WARN_LEVEL; ng_btsocket_rfcomm_timo = 60; Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c Tue Jun 10 17:54:24 2014 (r267335) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c Tue Jun 10 18:21:37 2014 (r267336) @@ -1107,6 +1107,10 @@ ng_btsocket_sco_init(void) { int error = 0; + /* Skip initialization of globals for non-default instances. */ + if (!IS_DEFAULT_VNET(curvnet)) + return; + ng_btsocket_sco_node = NULL; ng_btsocket_sco_debug_level = NG_BTSOCKET_WARN_LEVEL; From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 18:29:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE7414E3; Tue, 10 Jun 2014 18:29:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA085243C; Tue, 10 Jun 2014 18:29:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5AITk5u045317; Tue, 10 Jun 2014 18:29:46 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5AITjXP045312; Tue, 10 Jun 2014 18:29:45 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406101829.s5AITjXP045312@svn.freebsd.org> From: Ed Maste Date: Tue, 10 Jun 2014 18:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267337 - in head: tools/tools/vt/fontcvt usr.bin usr.bin/vtfontcvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 18:29:47 -0000 Author: emaste Date: Tue Jun 10 18:29:45 2014 New Revision: 267337 URL: http://svnweb.freebsd.org/changeset/base/267337 Log: vt fontcvt: move to usr.bin/vtfontcvt vtfontcvt is useful for end users to convert arbitrary bitmap fonts for use by vt(4). It can also be used as a build tool, allowing us to keep the source font data in the src tree rather than uuencoded binaries. Reviewed by: ray, wblock (D183) Sponsored by: The FreeBSD Foundation Added: head/usr.bin/vtfontcvt/ head/usr.bin/vtfontcvt/Makefile - copied, changed from r267335, head/tools/tools/vt/fontcvt/Makefile head/usr.bin/vtfontcvt/vtfontcvt.8 (contents, props changed) head/usr.bin/vtfontcvt/vtfontcvt.c - copied, changed from r267335, head/tools/tools/vt/fontcvt/fontcvt.c Deleted: head/tools/tools/vt/fontcvt/Makefile head/tools/tools/vt/fontcvt/fontcvt.c Modified: head/tools/tools/vt/fontcvt/terminus.sh head/usr.bin/Makefile Modified: head/tools/tools/vt/fontcvt/terminus.sh ============================================================================== --- head/tools/tools/vt/fontcvt/terminus.sh Tue Jun 10 18:21:37 2014 (r267336) +++ head/tools/tools/vt/fontcvt/terminus.sh Tue Jun 10 18:29:45 2014 (r267337) @@ -5,7 +5,7 @@ for i in 6:12 8:14 8:16 10:18 10:20 11:2 do C=`echo $i | cut -f 1 -d :` R=`echo $i | cut -f 2 -d :` - ./fontcvt \ + ./vtfontcvt \ -w $C -h $R \ ~/terminus-font-4.36/ter-u${R}n.bdf \ ~/terminus-font-4.36/ter-u${R}b.bdf \ Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Tue Jun 10 18:21:37 2014 (r267336) +++ head/usr.bin/Makefile Tue Jun 10 18:29:45 2014 (r267337) @@ -362,6 +362,10 @@ SUBDIR+= yacc SUBDIR+= vi .endif +.if ${MK_VT_SUPPORT} != "no" +SUBDIR+= vtfontcvt +.endif + .if ${MK_USB} != "no" SUBDIR+= usbhidaction SUBDIR+= usbhidctl Copied and modified: head/usr.bin/vtfontcvt/Makefile (from r267335, head/tools/tools/vt/fontcvt/Makefile) ============================================================================== --- head/tools/tools/vt/fontcvt/Makefile Tue Jun 10 17:54:24 2014 (r267335, copy source) +++ head/usr.bin/vtfontcvt/Makefile Tue Jun 10 18:29:45 2014 (r267337) @@ -1,5 +1,7 @@ -PROG= fontcvt -MAN1= +# $FreeBSD$ + +PROG= vtfontcvt +MAN8= vtfontcvt.8 WARNS?= 6 Added: head/usr.bin/vtfontcvt/vtfontcvt.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/vtfontcvt/vtfontcvt.8 Tue Jun 10 18:29:45 2014 (r267337) @@ -0,0 +1,74 @@ +.\" Copyright (c) 2014 The FreeBSD Foundation. All rights reserved. +.\" +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 9, 2014 +.Dt VTFONTCVT 8 +.Os +.Sh NAME +.Nm vtfontcvt +.Nd "convert font files for use by the video console" +.Sh SYNOPSIS +.Nm +.Op Fl h Ar height +.Op Fl v +.Op Fl w Ar width +.Ar normal_font +.Op Ar bold_font +.Ar output_file +.Sh DESCRIPTION +The +.Nm +utility reads source font files in either BDF or Unifont HEX format and +outputs a binary font file for use by +.Xr vt 4 . +HEX format files must have the file extension +.Pa .hex . +.Pp +The following options are available: +.Bl -tag -width "12345678" +.It Fl h Ar height +Set font height. +The default is 16. +Font height is set automatically for HEX files that have a +.Ql # Height: Ar height +comment before any font data. +.It Fl v +Display verbose statistics about the converted font. +.It Fl w Ar width +Set font width. +The default is 8. +Font width is set automatically for HEX files that have a +.Ql # Width: Ar width +comment before any font data. +.El +.Sh SEE ALSO +.Xr vidcontrol 1 , +.Xr vt 4 +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 11.0 . Copied and modified: head/usr.bin/vtfontcvt/vtfontcvt.c (from r267335, head/tools/tools/vt/fontcvt/fontcvt.c) ============================================================================== --- head/tools/tools/vt/fontcvt/fontcvt.c Tue Jun 10 17:54:24 2014 (r267335, copy source) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Tue Jun 10 18:29:45 2014 (r267337) @@ -92,7 +92,7 @@ usage(void) { errx(1, -"usage: fontcvt [-w width] [-h height] [-v] normal.bdf [bold.bdf] out.fnt\n"); +"usage: vtfontcvt [-w width] [-h height] [-v] normal.bdf [bold.bdf] out.fnt\n"); exit(1); } @@ -239,7 +239,7 @@ parse_bitmap_line(uint8_t *left, uint8_t line >>= width; } - + return (0); } @@ -309,7 +309,7 @@ parse_hex(FILE *fp, unsigned int map_idx dwidth *= 2; /* Double-width character. */ snprintf(fmt_str, sizeof(fmt_str), "%%%ux", chars_per_row); - + for (i = 0; i < height; i++) { sscanf(p, fmt_str, &line); p += chars_per_row; @@ -449,7 +449,7 @@ write_fnt(const char *filename) perror(filename); return (1); } - + if (write_glyphs(fp) != 0 || write_mappings(fp, VFNT_MAP_NORMAL) != 0 || write_mappings(fp, 1) != 0 || @@ -507,7 +507,7 @@ main(int argc, char *argv[]) assert(sizeof(struct file_header) == 32); assert(sizeof(struct file_mapping) == 8); - while ((ch = getopt(argc, argv, "h:w:")) != -1) { + while ((ch = getopt(argc, argv, "h:vw:")) != -1) { switch (ch) { case 'h': val = atoi(optarg); From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 18:46:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CF3CCE5; Tue, 10 Jun 2014 18:46:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DCEB2602; Tue, 10 Jun 2014 18:46:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5AIk0xV054133; Tue, 10 Jun 2014 18:46:00 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5AIk0qb054132; Tue, 10 Jun 2014 18:46:00 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201406101846.s5AIk0qb054132@svn.freebsd.org> From: Tycho Nightingale Date: Tue, 10 Jun 2014 18:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267338 - head/sys/amd64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 18:46:01 -0000 Author: tychon Date: Tue Jun 10 18:46:00 2014 New Revision: 267338 URL: http://svnweb.freebsd.org/changeset/base/267338 Log: Replace enum forward declarations with complete definitions. Reviewed by: neel Modified: head/sys/amd64/include/vmm.h Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Tue Jun 10 18:29:45 2014 (r267337) +++ head/sys/amd64/include/vmm.h Tue Jun 10 18:46:00 2014 (r267338) @@ -37,6 +37,53 @@ enum vm_suspend_how { VM_SUSPEND_LAST }; +/* + * Identifiers for architecturally defined registers. + */ +enum vm_reg_name { + VM_REG_GUEST_RAX, + VM_REG_GUEST_RBX, + VM_REG_GUEST_RCX, + VM_REG_GUEST_RDX, + VM_REG_GUEST_RSI, + VM_REG_GUEST_RDI, + VM_REG_GUEST_RBP, + VM_REG_GUEST_R8, + VM_REG_GUEST_R9, + VM_REG_GUEST_R10, + VM_REG_GUEST_R11, + VM_REG_GUEST_R12, + VM_REG_GUEST_R13, + VM_REG_GUEST_R14, + VM_REG_GUEST_R15, + VM_REG_GUEST_CR0, + VM_REG_GUEST_CR3, + VM_REG_GUEST_CR4, + VM_REG_GUEST_DR7, + VM_REG_GUEST_RSP, + VM_REG_GUEST_RIP, + VM_REG_GUEST_RFLAGS, + VM_REG_GUEST_ES, + VM_REG_GUEST_CS, + VM_REG_GUEST_SS, + VM_REG_GUEST_DS, + VM_REG_GUEST_FS, + VM_REG_GUEST_GS, + VM_REG_GUEST_LDTR, + VM_REG_GUEST_TR, + VM_REG_GUEST_IDTR, + VM_REG_GUEST_GDTR, + VM_REG_GUEST_EFER, + VM_REG_GUEST_CR2, + VM_REG_LAST +}; + +enum x2apic_state { + X2APIC_DISABLED, + X2APIC_ENABLED, + X2APIC_STATE_LAST +}; + #ifdef _KERNEL #define VM_MAX_NAMELEN 32 @@ -54,9 +101,6 @@ struct vmspace; struct vm_object; struct pmap; -enum vm_reg_name; -enum x2apic_state; - typedef int (*vmm_init_func_t)(int ipinum); typedef int (*vmm_cleanup_func_t)(void); typedef void (*vmm_resume_func_t)(void); @@ -250,47 +294,6 @@ enum vm_reg_name vm_segment_name(int seg #define VM_MAXCPU 16 /* maximum virtual cpus */ /* - * Identifiers for architecturally defined registers. - */ -enum vm_reg_name { - VM_REG_GUEST_RAX, - VM_REG_GUEST_RBX, - VM_REG_GUEST_RCX, - VM_REG_GUEST_RDX, - VM_REG_GUEST_RSI, - VM_REG_GUEST_RDI, - VM_REG_GUEST_RBP, - VM_REG_GUEST_R8, - VM_REG_GUEST_R9, - VM_REG_GUEST_R10, - VM_REG_GUEST_R11, - VM_REG_GUEST_R12, - VM_REG_GUEST_R13, - VM_REG_GUEST_R14, - VM_REG_GUEST_R15, - VM_REG_GUEST_CR0, - VM_REG_GUEST_CR3, - VM_REG_GUEST_CR4, - VM_REG_GUEST_DR7, - VM_REG_GUEST_RSP, - VM_REG_GUEST_RIP, - VM_REG_GUEST_RFLAGS, - VM_REG_GUEST_ES, - VM_REG_GUEST_CS, - VM_REG_GUEST_SS, - VM_REG_GUEST_DS, - VM_REG_GUEST_FS, - VM_REG_GUEST_GS, - VM_REG_GUEST_LDTR, - VM_REG_GUEST_TR, - VM_REG_GUEST_IDTR, - VM_REG_GUEST_GDTR, - VM_REG_GUEST_EFER, - VM_REG_GUEST_CR2, - VM_REG_LAST -}; - -/* * Identifiers for optional vmm capabilities */ enum vm_cap_type { @@ -302,12 +305,6 @@ enum vm_cap_type { VM_CAP_MAX }; -enum x2apic_state { - X2APIC_DISABLED, - X2APIC_ENABLED, - X2APIC_STATE_LAST -}; - enum vm_intr_trigger { EDGE_TRIGGER, LEVEL_TRIGGER From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 20:25:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9960E5E1; Tue, 10 Jun 2014 20:25:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A10A2FA1; Tue, 10 Jun 2014 20:25:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5AKPnRX001043; Tue, 10 Jun 2014 20:25:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5AKPkeM001001; Tue, 10 Jun 2014 20:25:46 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406102025.s5AKPkeM001001@svn.freebsd.org> From: John Baldwin Date: Tue, 10 Jun 2014 20:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267340 - in head/sys: arm/versatile dev/advansys dev/an dev/ata dev/buslogic dev/dpt dev/hifn dev/malo dev/mwl dev/safe dev/sym dev/trm dev/tx dev/ubsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 20:25:49 -0000 Author: jhb Date: Tue Jun 10 20:25:45 2014 New Revision: 267340 URL: http://svnweb.freebsd.org/changeset/base/267340 Log: Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases, don't create a map before calling bus_dmamem_alloc() (such maps were leaked). It is believed that the extra destroy of the map was generally harmless since bus_dmamem_alloc() often uses special maps for which bus_dmamap_destroy() is a no-op (e.g. on x86). Reviewed by: scottl Modified: head/sys/arm/versatile/versatile_clcd.c head/sys/dev/advansys/adwcam.c head/sys/dev/an/if_an.c head/sys/dev/ata/ata-dma.c head/sys/dev/buslogic/bt.c head/sys/dev/dpt/dpt_scsi.c head/sys/dev/hifn/hifn7751.c head/sys/dev/malo/if_malo.c head/sys/dev/malo/if_malohal.c head/sys/dev/mwl/if_mwl.c head/sys/dev/mwl/mwlhal.c head/sys/dev/safe/safe.c head/sys/dev/sym/sym_hipd.c head/sys/dev/trm/trm.c head/sys/dev/tx/if_tx.c head/sys/dev/ubsec/ubsec.c Modified: head/sys/arm/versatile/versatile_clcd.c ============================================================================== --- head/sys/arm/versatile/versatile_clcd.c Tue Jun 10 19:00:14 2014 (r267339) +++ head/sys/arm/versatile/versatile_clcd.c Tue Jun 10 20:25:45 2014 (r267340) @@ -363,8 +363,6 @@ versatile_clcdc_attach(device_t dev) fail: if (sc->fb_base) bus_dmamem_free(sc->dma_tag, sc->fb_base, sc->dma_map); - if (sc->dma_map) - bus_dmamap_destroy(sc->dma_tag, sc->dma_map); if (sc->dma_tag) bus_dma_tag_destroy(sc->dma_tag); return (err); Modified: head/sys/dev/advansys/adwcam.c ============================================================================== --- head/sys/dev/advansys/adwcam.c Tue Jun 10 19:00:14 2014 (r267339) +++ head/sys/dev/advansys/adwcam.c Tue Jun 10 20:25:45 2014 (r267340) @@ -777,7 +777,6 @@ adw_free(struct adw_softc *adw) case 7: bus_dmamem_free(adw->acb_dmat, adw->acbs, adw->acb_dmamap); - bus_dmamap_destroy(adw->acb_dmat, adw->acb_dmamap); case 6: bus_dma_tag_destroy(adw->acb_dmat); case 5: @@ -785,7 +784,6 @@ adw_free(struct adw_softc *adw) case 4: bus_dmamem_free(adw->carrier_dmat, adw->carriers, adw->carrier_dmamap); - bus_dmamap_destroy(adw->carrier_dmat, adw->carrier_dmamap); case 3: bus_dma_tag_destroy(adw->carrier_dmat); case 2: Modified: head/sys/dev/an/if_an.c ============================================================================== --- head/sys/dev/an/if_an.c Tue Jun 10 19:00:14 2014 (r267339) +++ head/sys/dev/an/if_an.c Tue Jun 10 20:25:45 2014 (r267340) @@ -483,10 +483,6 @@ an_dma_malloc(struct an_softc *sc, bus_s { int r; - r = bus_dmamap_create(sc->an_dtag, BUS_DMA_NOWAIT, &dma->an_dma_map); - if (r != 0) - goto fail_0; - r = bus_dmamem_alloc(sc->an_dtag, (void**) &dma->an_dma_vaddr, BUS_DMA_NOWAIT, &dma->an_dma_map); if (r != 0) @@ -507,9 +503,6 @@ fail_2: bus_dmamap_unload(sc->an_dtag, dma->an_dma_map); fail_1: bus_dmamem_free(sc->an_dtag, dma->an_dma_vaddr, dma->an_dma_map); -fail_0: - bus_dmamap_destroy(sc->an_dtag, dma->an_dma_map); - dma->an_dma_map = NULL; return (r); } @@ -519,7 +512,6 @@ an_dma_free(struct an_softc *sc, struct bus_dmamap_unload(sc->an_dtag, dma->an_dma_map); bus_dmamem_free(sc->an_dtag, dma->an_dma_vaddr, dma->an_dma_map); dma->an_dma_vaddr = 0; - bus_dmamap_destroy(sc->an_dtag, dma->an_dma_map); } /* Modified: head/sys/dev/ata/ata-dma.c ============================================================================== --- head/sys/dev/ata/ata-dma.c Tue Jun 10 19:00:14 2014 (r267339) +++ head/sys/dev/ata/ata-dma.c Tue Jun 10 20:25:45 2014 (r267340) @@ -224,11 +224,9 @@ ata_dmafree(device_t dev) bus_dmamap_unload(slot->sg_tag, slot->sg_map); slot->sg_bus = 0; } - if (slot->sg_map) { + if (slot->sg) { bus_dmamem_free(slot->sg_tag, slot->sg, slot->sg_map); - bus_dmamap_destroy(slot->sg_tag, slot->sg_map); slot->sg = NULL; - slot->sg_map = NULL; } if (slot->data_map) { bus_dmamap_destroy(slot->data_tag, slot->data_map); Modified: head/sys/dev/buslogic/bt.c ============================================================================== --- head/sys/dev/buslogic/bt.c Tue Jun 10 19:00:14 2014 (r267339) +++ head/sys/dev/buslogic/bt.c Tue Jun 10 20:25:45 2014 (r267340) @@ -246,7 +246,6 @@ bt_free_softc(device_t dev) case 6: bus_dmamem_free(bt->ccb_dmat, bt->bt_ccb_array, bt->ccb_dmamap); - bus_dmamap_destroy(bt->ccb_dmat, bt->ccb_dmamap); /* FALLTHROUGH */ case 5: bus_dma_tag_destroy(bt->ccb_dmat); @@ -257,7 +256,6 @@ bt_free_softc(device_t dev) case 3: bus_dmamem_free(bt->mailbox_dmat, bt->in_boxes, bt->mailbox_dmamap); - bus_dmamap_destroy(bt->mailbox_dmat, bt->mailbox_dmamap); /* FALLTHROUGH */ case 2: bus_dma_tag_destroy(bt->buffer_dmat); Modified: head/sys/dev/dpt/dpt_scsi.c ============================================================================== --- head/sys/dev/dpt/dpt_scsi.c Tue Jun 10 19:00:14 2014 (r267339) +++ head/sys/dev/dpt/dpt_scsi.c Tue Jun 10 20:25:45 2014 (r267340) @@ -1149,7 +1149,6 @@ dpt_free(struct dpt_softc *dpt) case 4: bus_dmamem_free(dpt->dccb_dmat, dpt->dpt_dccbs, dpt->dccb_dmamap); - bus_dmamap_destroy(dpt->dccb_dmat, dpt->dccb_dmamap); case 3: bus_dma_tag_destroy(dpt->dccb_dmat); case 2: Modified: head/sys/dev/hifn/hifn7751.c ============================================================================== --- head/sys/dev/hifn/hifn7751.c Tue Jun 10 19:00:14 2014 (r267339) +++ head/sys/dev/hifn/hifn7751.c Tue Jun 10 20:25:45 2014 (r267340) @@ -463,7 +463,6 @@ hifn_attach(device_t dev) BUS_DMA_NOWAIT)) { device_printf(dev, "cannot load dma map\n"); bus_dmamem_free(sc->sc_dmat, kva, sc->sc_dmamap); - bus_dmamap_destroy(sc->sc_dmat, sc->sc_dmamap); bus_dma_tag_destroy(sc->sc_dmat); goto fail_io1; } @@ -603,7 +602,6 @@ fail_intr2: fail_mem: bus_dmamap_unload(sc->sc_dmat, sc->sc_dmamap); bus_dmamem_free(sc->sc_dmat, sc->sc_dma, sc->sc_dmamap); - bus_dmamap_destroy(sc->sc_dmat, sc->sc_dmamap); bus_dma_tag_destroy(sc->sc_dmat); /* Turn off DMA polling */ @@ -653,7 +651,6 @@ hifn_detach(device_t dev) bus_dmamap_unload(sc->sc_dmat, sc->sc_dmamap); bus_dmamem_free(sc->sc_dmat, sc->sc_dma, sc->sc_dmamap); - bus_dmamap_destroy(sc->sc_dmat, sc->sc_dmamap); bus_dma_tag_destroy(sc->sc_dmat); bus_release_resource(dev, SYS_RES_MEMORY, HIFN_BAR1, sc->sc_bar1res); Modified: head/sys/dev/malo/if_malo.c ============================================================================== --- head/sys/dev/malo/if_malo.c Tue Jun 10 19:00:14 2014 (r267339) +++ head/sys/dev/malo/if_malo.c Tue Jun 10 20:25:45 2014 (r267340) @@ -496,13 +496,6 @@ malo_desc_setup(struct malo_softc *sc, c } /* allocate descriptors */ - error = bus_dmamap_create(dd->dd_dmat, BUS_DMA_NOWAIT, &dd->dd_dmamap); - if (error != 0) { - if_printf(ifp, "unable to create dmamap for %s descriptors, " - "error %u\n", dd->dd_name, error); - goto fail0; - } - error = bus_dmamem_alloc(dd->dd_dmat, (void**) &dd->dd_desc, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &dd->dd_dmamap); if (error != 0) { @@ -530,8 +523,6 @@ malo_desc_setup(struct malo_softc *sc, c fail2: bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); fail1: - bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); -fail0: bus_dma_tag_destroy(dd->dd_dmat); memset(dd, 0, sizeof(*dd)); return error; @@ -632,7 +623,6 @@ malo_desc_cleanup(struct malo_softc *sc, { bus_dmamap_unload(dd->dd_dmat, dd->dd_dmamap); bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); - bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); bus_dma_tag_destroy(dd->dd_dmat); memset(dd, 0, sizeof(*dd)); Modified: head/sys/dev/malo/if_malohal.c ============================================================================== --- head/sys/dev/malo/if_malohal.c Tue Jun 10 19:00:14 2014 (r267339) +++ head/sys/dev/malo/if_malohal.c Tue Jun 10 20:25:45 2014 (r267340) @@ -137,13 +137,6 @@ malo_hal_attach(device_t dev, uint16_t d } /* allocate descriptors */ - error = bus_dmamap_create(mh->mh_dmat, BUS_DMA_NOWAIT, &mh->mh_dmamap); - if (error != 0) { - device_printf(dev, "unable to create dmamap for cmd buffers, " - "error %u\n", error); - goto fail; - } - error = bus_dmamem_alloc(mh->mh_dmat, (void**) &mh->mh_cmdbuf, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &mh->mh_dmamap); @@ -166,13 +159,9 @@ malo_hal_attach(device_t dev, uint16_t d return (mh); fail: - if (mh->mh_dmamap != NULL) { - bus_dmamap_unload(mh->mh_dmat, mh->mh_dmamap); - if (mh->mh_cmdbuf != NULL) - bus_dmamem_free(mh->mh_dmat, mh->mh_cmdbuf, - mh->mh_dmamap); - bus_dmamap_destroy(mh->mh_dmat, mh->mh_dmamap); - } + if (mh->mh_cmdbuf != NULL) + bus_dmamem_free(mh->mh_dmat, mh->mh_cmdbuf, + mh->mh_dmamap); if (mh->mh_dmat) bus_dma_tag_destroy(mh->mh_dmat); free(mh, M_DEVBUF); @@ -592,7 +581,6 @@ malo_hal_detach(struct malo_hal *mh) { bus_dmamem_free(mh->mh_dmat, mh->mh_cmdbuf, mh->mh_dmamap); - bus_dmamap_destroy(mh->mh_dmat, mh->mh_dmamap); bus_dma_tag_destroy(mh->mh_dmat); mtx_destroy(&mh->mh_mtx); free(mh, M_DEVBUF); Modified: head/sys/dev/mwl/if_mwl.c ============================================================================== --- head/sys/dev/mwl/if_mwl.c Tue Jun 10 19:00:14 2014 (r267339) +++ head/sys/dev/mwl/if_mwl.c Tue Jun 10 20:25:45 2014 (r267340) @@ -2041,13 +2041,6 @@ mwl_desc_setup(struct mwl_softc *sc, con } /* allocate descriptors */ - error = bus_dmamap_create(dd->dd_dmat, BUS_DMA_NOWAIT, &dd->dd_dmamap); - if (error != 0) { - if_printf(ifp, "unable to create dmamap for %s descriptors, " - "error %u\n", dd->dd_name, error); - goto fail0; - } - error = bus_dmamem_alloc(dd->dd_dmat, (void**) &dd->dd_desc, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &dd->dd_dmamap); @@ -2077,8 +2070,6 @@ mwl_desc_setup(struct mwl_softc *sc, con fail2: bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); fail1: - bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); -fail0: bus_dma_tag_destroy(dd->dd_dmat); memset(dd, 0, sizeof(*dd)); return error; @@ -2090,7 +2081,6 @@ mwl_desc_cleanup(struct mwl_softc *sc, s { bus_dmamap_unload(dd->dd_dmat, dd->dd_dmamap); bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); - bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); bus_dma_tag_destroy(dd->dd_dmat); memset(dd, 0, sizeof(*dd)); @@ -2229,9 +2219,8 @@ mwl_rxdma_setup(struct mwl_softc *sc) NULL, /* lockfunc */ NULL, /* lockarg */ &sc->sc_rxdmat); - error = bus_dmamap_create(sc->sc_rxdmat, BUS_DMA_NOWAIT, &sc->sc_rxmap); if (error != 0) { - if_printf(ifp, "could not create rx DMA map\n"); + if_printf(ifp, "could not create rx DMA tag\n"); return error; } @@ -2292,16 +2281,14 @@ mwl_rxdma_setup(struct mwl_softc *sc) static void mwl_rxdma_cleanup(struct mwl_softc *sc) { - if (sc->sc_rxmap != NULL) + if (sc->sc_rxmem_paddr != 0) { bus_dmamap_unload(sc->sc_rxdmat, sc->sc_rxmap); + sc->sc_rxmem_paddr = 0; + } if (sc->sc_rxmem != NULL) { bus_dmamem_free(sc->sc_rxdmat, sc->sc_rxmem, sc->sc_rxmap); sc->sc_rxmem = NULL; } - if (sc->sc_rxmap != NULL) { - bus_dmamap_destroy(sc->sc_rxdmat, sc->sc_rxmap); - sc->sc_rxmap = NULL; - } if (sc->sc_rxdma.dd_bufptr != NULL) { free(sc->sc_rxdma.dd_bufptr, M_MWLDEV); sc->sc_rxdma.dd_bufptr = NULL; Modified: head/sys/dev/mwl/mwlhal.c ============================================================================== --- head/sys/dev/mwl/mwlhal.c Tue Jun 10 19:00:14 2014 (r267339) +++ head/sys/dev/mwl/mwlhal.c Tue Jun 10 20:25:45 2014 (r267340) @@ -309,19 +309,12 @@ mwl_hal_attach(device_t dev, uint16_t de NULL, /* lockarg */ &mh->mh_dmat); if (error != 0) { - device_printf(dev, "unable to allocate memory for cmd buffer, " + device_printf(dev, "unable to allocate memory for cmd tag, " "error %u\n", error); goto fail0; } /* allocate descriptors */ - error = bus_dmamap_create(mh->mh_dmat, BUS_DMA_NOWAIT, &mh->mh_dmamap); - if (error != 0) { - device_printf(dev, "unable to create dmamap for cmd buffers, " - "error %u\n", error); - goto fail0; - } - error = bus_dmamem_alloc(mh->mh_dmat, (void**) &mh->mh_cmdbuf, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &mh->mh_dmamap); @@ -365,9 +358,8 @@ mwl_hal_attach(device_t dev, uint16_t de fail2: bus_dmamem_free(mh->mh_dmat, mh->mh_cmdbuf, mh->mh_dmamap); fail1: - bus_dmamap_destroy(mh->mh_dmat, mh->mh_dmamap); -fail0: bus_dma_tag_destroy(mh->mh_dmat); +fail0: mtx_destroy(&mh->mh_mtx); free(mh, M_DEVBUF); return NULL; @@ -379,7 +371,6 @@ mwl_hal_detach(struct mwl_hal *mh0) struct mwl_hal_priv *mh = MWLPRIV(mh0); bus_dmamem_free(mh->mh_dmat, mh->mh_cmdbuf, mh->mh_dmamap); - bus_dmamap_destroy(mh->mh_dmat, mh->mh_dmamap); bus_dma_tag_destroy(mh->mh_dmat); mtx_destroy(&mh->mh_mtx); free(mh, M_DEVBUF); Modified: head/sys/dev/safe/safe.c ============================================================================== --- head/sys/dev/safe/safe.c Tue Jun 10 19:00:14 2014 (r267339) +++ head/sys/dev/safe/safe.c Tue Jun 10 20:25:45 2014 (r267340) @@ -1807,20 +1807,13 @@ safe_dma_malloc( goto fail_0; } - r = bus_dmamap_create(dma->dma_tag, BUS_DMA_NOWAIT, &dma->dma_map); - if (r != 0) { - device_printf(sc->sc_dev, "safe_dma_malloc: " - "bus_dmamap_create failed; error %u\n", r); - goto fail_1; - } - r = bus_dmamem_alloc(dma->dma_tag, (void**) &dma->dma_vaddr, BUS_DMA_NOWAIT, &dma->dma_map); if (r != 0) { device_printf(sc->sc_dev, "safe_dma_malloc: " "bus_dmammem_alloc failed; size %zu, error %u\n", size, r); - goto fail_2; + goto fail_1; } r = bus_dmamap_load(dma->dma_tag, dma->dma_map, dma->dma_vaddr, @@ -1831,21 +1824,18 @@ safe_dma_malloc( if (r != 0) { device_printf(sc->sc_dev, "safe_dma_malloc: " "bus_dmamap_load failed; error %u\n", r); - goto fail_3; + goto fail_2; } dma->dma_size = size; return (0); -fail_3: bus_dmamap_unload(dma->dma_tag, dma->dma_map); fail_2: bus_dmamem_free(dma->dma_tag, dma->dma_vaddr, dma->dma_map); fail_1: - bus_dmamap_destroy(dma->dma_tag, dma->dma_map); bus_dma_tag_destroy(dma->dma_tag); fail_0: - dma->dma_map = NULL; dma->dma_tag = NULL; return (r); } @@ -1855,7 +1845,6 @@ safe_dma_free(struct safe_softc *sc, str { bus_dmamap_unload(dma->dma_tag, dma->dma_map); bus_dmamem_free(dma->dma_tag, dma->dma_vaddr, dma->dma_map); - bus_dmamap_destroy(dma->dma_tag, dma->dma_map); bus_dma_tag_destroy(dma->dma_tag); } Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Tue Jun 10 19:00:14 2014 (r267339) +++ head/sys/dev/sym/sym_hipd.c Tue Jun 10 20:25:45 2014 (r267340) @@ -617,11 +617,8 @@ out_err: bus_dmamap_unload(mp->dmat, vbp->dmamap); if (vaddr) bus_dmamem_free(mp->dmat, vaddr, vbp->dmamap); - if (vbp) { - if (vbp->dmamap) - bus_dmamap_destroy(mp->dmat, vbp->dmamap); + if (vbp) __sym_mfree(&mp0, vbp, sizeof(*vbp), "VTOB"); - } return 0; } @@ -639,7 +636,6 @@ static void ___dma_freep(m_pool_s *mp, m *vbpp = (*vbpp)->next; bus_dmamap_unload(mp->dmat, vbp->dmamap); bus_dmamem_free(mp->dmat, (void *) vbp->vaddr, vbp->dmamap); - bus_dmamap_destroy(mp->dmat, vbp->dmamap); __sym_mfree(&mp0, vbp, sizeof(*vbp), "VTOB"); --mp->nump; } Modified: head/sys/dev/trm/trm.c ============================================================================== --- head/sys/dev/trm/trm.c Tue Jun 10 19:00:14 2014 (r267339) +++ head/sys/dev/trm/trm.c Tue Jun 10 20:25:45 2014 (r267340) @@ -2944,12 +2944,11 @@ trm_destroySRB(PACB pACB) pSRB = pACB->pFreeSRB; while (pSRB) { - if (pSRB->sg_dmamap) { + if (pSRB->SRBSGPhyAddr) bus_dmamap_unload(pACB->sg_dmat, pSRB->sg_dmamap); + if (pSRB->pSRBSGL) bus_dmamem_free(pACB->sg_dmat, pSRB->pSRBSGL, pSRB->sg_dmamap); - bus_dmamap_destroy(pACB->sg_dmat, pSRB->sg_dmamap); - } if (pSRB->dmamap) bus_dmamap_destroy(pACB->buffer_dmat, pSRB->dmamap); pSRB = pSRB->pNextSRB; @@ -3494,7 +3493,6 @@ bad: bus_dmamap_unload(pACB->sense_dmat, pACB->sense_dmamap); bus_dmamem_free(pACB->sense_dmat, pACB->sense_buffers, pACB->sense_dmamap); - bus_dmamap_destroy(pACB->sense_dmat, pACB->sense_dmamap); } if (pACB->sense_dmat) bus_dma_tag_destroy(pACB->sense_dmat); @@ -3502,11 +3500,10 @@ bad: trm_destroySRB(pACB); bus_dma_tag_destroy(pACB->sg_dmat); } - if (pACB->srb_dmamap) { + if (pACB->pFreeSRB) { bus_dmamap_unload(pACB->srb_dmat, pACB->srb_dmamap); bus_dmamem_free(pACB->srb_dmat, pACB->pFreeSRB, pACB->srb_dmamap); - bus_dmamap_destroy(pACB->srb_dmat, pACB->srb_dmamap); } if (pACB->srb_dmat) bus_dma_tag_destroy(pACB->srb_dmat); @@ -3618,19 +3615,17 @@ bad: bus_dma_tag_destroy(pACB->sg_dmat); } - if (pACB->srb_dmamap) { + if (pACB->pFreeSRB) { bus_dmamap_unload(pACB->srb_dmat, pACB->srb_dmamap); bus_dmamem_free(pACB->srb_dmat, pACB->pFreeSRB, pACB->srb_dmamap); - bus_dmamap_destroy(pACB->srb_dmat, pACB->srb_dmamap); } if (pACB->srb_dmat) bus_dma_tag_destroy(pACB->srb_dmat); - if (pACB->sense_dmamap) { + if (pACB->sense_buffers) { bus_dmamap_unload(pACB->sense_dmat, pACB->sense_dmamap); bus_dmamem_free(pACB->sense_dmat, pACB->sense_buffers, pACB->sense_dmamap); - bus_dmamap_destroy(pACB->sense_dmat, pACB->sense_dmamap); } if (pACB->sense_dmat) bus_dma_tag_destroy(pACB->sense_dmat); @@ -3680,12 +3675,10 @@ trm_detach(device_t dev) bus_dmamap_unload(pACB->srb_dmat, pACB->srb_dmamap); bus_dmamem_free(pACB->srb_dmat, pACB->pFreeSRB, pACB->srb_dmamap); - bus_dmamap_destroy(pACB->srb_dmat, pACB->srb_dmamap); bus_dma_tag_destroy(pACB->srb_dmat); bus_dmamap_unload(pACB->sense_dmat, pACB->sense_dmamap); bus_dmamem_free(pACB->sense_dmat, pACB->sense_buffers, pACB->sense_dmamap); - bus_dmamap_destroy(pACB->sense_dmat, pACB->sense_dmamap); bus_dma_tag_destroy(pACB->sense_dmat); bus_dma_tag_destroy(pACB->buffer_dmat); bus_teardown_intr(dev, pACB->irq, pACB->ih); Modified: head/sys/dev/tx/if_tx.c ============================================================================== --- head/sys/dev/tx/if_tx.c Tue Jun 10 19:00:14 2014 (r267339) +++ head/sys/dev/tx/if_tx.c Tue Jun 10 20:25:45 2014 (r267340) @@ -447,17 +447,14 @@ epic_release(epic_softc_t *sc) if (sc->tx_flist) { bus_dmamap_unload(sc->ftag, sc->fmap); bus_dmamem_free(sc->ftag, sc->tx_flist, sc->fmap); - bus_dmamap_destroy(sc->ftag, sc->fmap); } if (sc->tx_desc) { bus_dmamap_unload(sc->ttag, sc->tmap); bus_dmamem_free(sc->ttag, sc->tx_desc, sc->tmap); - bus_dmamap_destroy(sc->ttag, sc->tmap); } if (sc->rx_desc) { bus_dmamap_unload(sc->rtag, sc->rmap); bus_dmamem_free(sc->rtag, sc->rx_desc, sc->rmap); - bus_dmamap_destroy(sc->rtag, sc->rmap); } if (sc->mtag) bus_dma_tag_destroy(sc->mtag); Modified: head/sys/dev/ubsec/ubsec.c ============================================================================== --- head/sys/dev/ubsec/ubsec.c Tue Jun 10 19:00:14 2014 (r267339) +++ head/sys/dev/ubsec/ubsec.c Tue Jun 10 20:25:45 2014 (r267340) @@ -1856,13 +1856,6 @@ ubsec_dma_malloc( if (r != 0) { device_printf(sc->sc_dev, "ubsec_dma_malloc: " "bus_dma_tag_create failed; error %u\n", r); - goto fail_0; - } - - r = bus_dmamap_create(dma->dma_tag, BUS_DMA_NOWAIT, &dma->dma_map); - if (r != 0) { - device_printf(sc->sc_dev, "ubsec_dma_malloc: " - "bus_dmamap_create failed; error %u\n", r); goto fail_1; } @@ -1894,10 +1887,7 @@ fail_3: fail_2: bus_dmamem_free(dma->dma_tag, dma->dma_vaddr, dma->dma_map); fail_1: - bus_dmamap_destroy(dma->dma_tag, dma->dma_map); bus_dma_tag_destroy(dma->dma_tag); -fail_0: - dma->dma_map = NULL; dma->dma_tag = NULL; return (r); } @@ -1907,7 +1897,6 @@ ubsec_dma_free(struct ubsec_softc *sc, s { bus_dmamap_unload(dma->dma_tag, dma->dma_map); bus_dmamem_free(dma->dma_tag, dma->dma_vaddr, dma->dma_map); - bus_dmamap_destroy(dma->dma_tag, dma->dma_map); bus_dma_tag_destroy(dma->dma_tag); } From owner-svn-src-head@FreeBSD.ORG Tue Jun 10 21:40:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70606EB0; Tue, 10 Jun 2014 21:40:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E0E2263B; Tue, 10 Jun 2014 21:40:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5ALeiYm036502; Tue, 10 Jun 2014 21:40:44 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5ALeiSG036501; Tue, 10 Jun 2014 21:40:44 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201406102140.s5ALeiSG036501@svn.freebsd.org> From: Jim Harris Date: Tue, 10 Jun 2014 21:40:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267342 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 21:40:44 -0000 Author: jimharris Date: Tue Jun 10 21:40:43 2014 New Revision: 267342 URL: http://svnweb.freebsd.org/changeset/base/267342 Log: Use bitwise OR instead of logical OR when constructing value for SET_FEATURES/NUMBER_OF_QUEUES command. Sponsored by: Intel MFC after: 3 days Modified: head/sys/dev/nvme/nvme_ctrlr_cmd.c Modified: head/sys/dev/nvme/nvme_ctrlr_cmd.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr_cmd.c Tue Jun 10 21:20:37 2014 (r267341) +++ head/sys/dev/nvme/nvme_ctrlr_cmd.c Tue Jun 10 21:40:43 2014 (r267342) @@ -205,7 +205,7 @@ nvme_ctrlr_cmd_set_num_queues(struct nvm { uint32_t cdw11; - cdw11 = ((num_queues - 1) << 16) || (num_queues - 1); + cdw11 = ((num_queues - 1) << 16) | (num_queues - 1); nvme_ctrlr_cmd_set_feature(ctrlr, NVME_FEAT_NUMBER_OF_QUEUES, cdw11, NULL, 0, cb_fn, cb_arg); } From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 07:25:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B80F0F85; Wed, 11 Jun 2014 07:25:20 +0000 (UTC) Received: from mp2.macomnet.net (unknown [IPv6:2a04:d900:0:102::10:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 971912325; Wed, 11 Jun 2014 07:25:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.14.9/8.14.9) with ESMTP id s5B7PDrI091519; Wed, 11 Jun 2014 11:25:14 +0400 (MSK) (envelope-from maxim.konovalov@gmail.com) Date: Wed, 11 Jun 2014 11:25:13 +0400 (MSK) From: Maxim Konovalov To: Devin Teske Subject: Re: svn commit: r264243 - in head/etc: . rc.d In-Reply-To: <201404072240.s37MeTqo085123@svn.freebsd.org> Message-ID: References: <201404072240.s37MeTqo085123@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, KOT@MATPOCKuH.Ru X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 07:25:20 -0000 Hi Davin, It looks like this change has some issues with the aliases startup configuration, see the following report for more details: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=190880 Would you mind if I assign this ticket to you? On Mon, 7 Apr 2014, 22:40-0000, Devin Teske wrote: > Author: dteske > Date: Mon Apr 7 22:40:29 2014 > New Revision: 264243 > URL: http://svnweb.freebsd.org/changeset/base/264243 > > Log: > Loosen the processing of *_IF_aliasN vars to be less strict. Previously, > the first alias had to be _alias0 and processing stopped at the first non- > defined variable (preventing gaps). Allowing gaps gives the administrator > the ability to group aliases in an adhoc manner and also lifts the > requirement to renumber aliases simply to comment-out an existing one. > Aliases are processed in numerical ascending order. > > Discussed on: -rc > MFC after: 1 week > > Modified: > head/etc/network.subr > head/etc/rc.d/mdconfig > head/etc/rc.d/mdconfig2 > head/etc/rc.subr > > Modified: head/etc/network.subr > ============================================================================== > --- head/etc/network.subr Mon Apr 7 22:37:13 2014 (r264242) > +++ head/etc/network.subr Mon Apr 7 22:40:29 2014 (r264243) > @@ -283,10 +283,8 @@ get_if_var() > fi > > _if=$1 > - _punct=". - / +" > - for _punct_c in $_punct; do > - _if=`ltr ${_if} ${_punct_c} '_'` > - done > + _punct=".-/+" > + ltr ${_if} "${_punct}" '_' _if > _var=$2 > _default=$3 > > @@ -1076,6 +1074,7 @@ ifalias_af_common_handler() > ifalias_af_common() > { > local _ret _if _af _action alias ifconfig_args _aliasn _c _tmpargs _iaf > + local _punct=".-/+" > > _ret=1 > _aliasn= > @@ -1083,10 +1082,14 @@ ifalias_af_common() > _af=$2 > _action=$3 > > + # Normalize $_if before using it in a pattern to list_vars() > + ltr "$_if" "$_punct" "_" _if > + > # ifconfig_IF_aliasN which starts with $_af > - alias=0 > - while : ; do > - ifconfig_args=`get_if_var $_if ifconfig_IF_alias${alias}` > + for alias in `list_vars ifconfig_${_if}_alias[0-9]\* | > + sort_lite -nk1.$((9+${#_if}+7))` > + do > + eval ifconfig_args=\"\$$alias\" > _iaf= > case $ifconfig_args in > inet\ *) _iaf=inet ;; > @@ -1107,15 +1110,15 @@ ifalias_af_common() > warn "\$ifconfig_${_if}_alias${alias} needs " \ > "\"inet\" keyword for an IPv4 address." > esac > - alias=$(($alias + 1)) > done > > # backward compatibility: ipv6_ifconfig_IF_aliasN. > case $_af in > inet6) > - alias=0 > - while : ; do > - ifconfig_args=`get_if_var $_if ipv6_ifconfig_IF_alias${alias}` > + for alias in `list_vars ipv6_ifconfig_${_if}_alias[0-9]\* | > + sort_lite -nk1.$((14+${#_if}+7))` > + do > + eval ifconfig_args=\"\$$alias\" > case ${_action}:"${ifconfig_args}" in > *:"") > break > @@ -1127,7 +1130,6 @@ ifalias_af_common() > "instead." > ;; > esac > - alias=$(($alias + 1)) > done > esac > > > Modified: head/etc/rc.d/mdconfig > ============================================================================== > --- head/etc/rc.d/mdconfig Mon Apr 7 22:37:13 2014 (r264242) > +++ head/etc/rc.d/mdconfig Mon Apr 7 22:40:29 2014 (r264243) > @@ -181,17 +181,14 @@ fi > > load_rc_config $name > > -_mdconfig_unit=0 > if [ -z "${_mdconfig_list}" ]; then > - while :; do > - eval _mdconfig_config=\$mdconfig_md${_mdconfig_unit} > - if [ -z "${_mdconfig_config}" ]; then > - break > - else > - _mdconfig_list="${_mdconfig_list}${_mdconfig_list:+ }md${_mdconfig_unit}" > - _mdconfig_unit=$((${_mdconfig_unit} + 1)) > - fi > + for _mdconfig_config in `list_vars mdconfig_md[0-9]\* | > + sort_lite -nk1.12` > + do > + _mdconfig_unit=${_mdconfig_config#mdconfig_md} > + _mdconfig_list="$_mdconfig_list md$_mdconfig_unit" > done > + _mdconfig_list="${_mdconfig_list# }" > fi > > run_rc_command "${_mdconfig_cmd}" > > Modified: head/etc/rc.d/mdconfig2 > ============================================================================== > --- head/etc/rc.d/mdconfig2 Mon Apr 7 22:37:13 2014 (r264242) > +++ head/etc/rc.d/mdconfig2 Mon Apr 7 22:40:29 2014 (r264243) > @@ -211,17 +211,14 @@ fi > > load_rc_config $name > > -_mdconfig2_unit=0 > if [ -z "${_mdconfig2_list}" ]; then > - while :; do > - eval _mdconfig2_config=\$mdconfig_md${_mdconfig2_unit} > - if [ -z "${_mdconfig2_config}" ]; then > - break > - else > - _mdconfig2_list="${_mdconfig2_list}${_mdconfig2_list:+ }md${_mdconfig2_unit}" > - _mdconfig2_unit=$((${_mdconfig2_unit} + 1)) > - fi > + for _mdconfig2_config in `list_vars mdconfig_md[0-9]\* | > + sort_lite -nk1.12` > + do > + _mdconfig2_unit=${_mdconfig2_config#mdconfig_md} > + _mdconfig2_list="$_mdconfig2_list md$_mdconfig2_unit" > done > + _mdconfig2_list="${_mdconfig2_list# }" > fi > > run_rc_command "${_mdconfig2_cmd}" > > Modified: head/etc/rc.subr > ============================================================================== > --- head/etc/rc.subr Mon Apr 7 22:37:13 2014 (r264242) > +++ head/etc/rc.subr Mon Apr 7 22:40:29 2014 (r264243) > @@ -54,6 +54,20 @@ JID=`$PS -p $$ -o jid=` > # functions > # --------- > > +# list_vars pattern > +# List vars matching pattern. > +# > +list_vars() > +{ > + set | { while read LINE; do > + var="${LINE%%=*}" > + case "$var" in > + "$LINE"|*[!a-zA-Z0-9_]*) continue ;; > + $1) echo $var > + esac > + done; } > +} > + > # set_rcvar_obsolete oldvar [newvar] [msg] > # Define obsolete variable. > # Global variable $rcvars_obsolete is used. > @@ -314,6 +328,246 @@ _find_processes() > eval $_proccheck > } > > +# sort_lite [-b] [-n] [-k POS] [-t SEP] > +# A lite version of sort(1) (supporting a few options) that can be used > +# before the real sort(1) is available (e.g., in scripts that run prior > +# to mountcritremote). Requires only shell built-in functionality. > +# > +sort_lite() > +{ > + local funcname=sort_lite > + local sort_sep="$IFS" sort_ignore_leading_space= > + local sort_field=0 sort_strict_fields= sort_numeric= > + local nitems=0 skip_leading=0 trim= > + > + local OPTIND flag > + while getopts bnk:t: flag; do > + case "$flag" in > + b) sort_ignore_leading_space=1 ;; > + n) sort_numeric=1 sort_ignore_leading_space=1 ;; > + k) sort_field="${OPTARG%%,*}" ;; # only up to first comma > + # NB: Unlike sort(1) only one POS allowed > + t) sort_sep="$OPTARG" > + if [ ${#sort_sep} -gt 1 ]; then > + echo "$funcname: multi-character tab \`$sort_sep'" >&2 > + return 1 > + fi > + sort_strict_fields=1 > + ;; > + \?) return 1 ;; > + esac > + done > + shift $(( $OPTIND - 1 )) > + > + # Create transformation pattern to trim leading text if desired > + case "$sort_field" in > + ""|[!0-9]*|*[!0-9.]*) > + echo "$funcname: invalid sort field \`$sort_field'" >&2 > + return 1 > + ;; > + *.*) > + skip_leading=${sort_field#*.} sort_field=${sort_field%%.*} > + while [ ${skip_leading:-0} -gt 1 ] 2> /dev/null; do > + trim="$trim?" skip_leading=$(( $skip_leading - 1 )) > + done > + esac > + > + # Copy input to series of local numbered variables > + # NB: IFS of NULL preserves leading whitespace > + local LINE > + while IFS= read -r LINE || [ "$LINE" ]; do > + nitems=$(( $nitems + 1 )) > + local src_$nitems="$LINE" > + done > + > + # > + # Sort numbered locals using insertion sort > + # > + local curitem curitem_orig curitem_mod curitem_haskey > + local dest dest_orig dest_mod dest_haskey > + local d gt n > + local i=1 > + while [ $i -le $nitems ]; do > + curitem_haskey=1 # Assume sort field (-k POS) exists > + eval curitem=\"\$src_$i\" > + curitem_mod="$curitem" # for modified comparison > + curitem_orig="$curitem" # for original comparison > + > + # Trim leading whitespace if desired > + if [ "$sort_ignore_leading_space" ]; then > + while case "$curitem_orig" in > + [$IFS]*) : ;; *) false; esac > + do > + curitem_orig="${curitem_orig#?}" > + done > + curitem_mod="$curitem_orig" > + fi > + > + # Shift modified comparison value if sort field (-k POS) is > 1 > + n=$sort_field > + while [ $n -gt 1 ]; do > + case "$curitem_mod" in > + *[$sort_sep]*) > + # Cut text up-to (and incl.) first separator > + curitem_mod="${curitem_mod#*[$sort_sep]}" > + > + # Skip NULLs unless strict field splitting > + [ "$sort_strict_fields" ] || > + [ "${curitem_mod%%[$sort_sep]*}" ] || > + [ $n -eq 2 ] || > + continue > + ;; > + *) > + # Asked for a field that doesn't exist > + curitem_haskey= break > + esac > + n=$(( $n - 1 )) > + done > + > + # Trim trailing words if sort field >= 1 > + [ $sort_field -ge 1 -a "$sort_numeric" ] && > + curitem_mod="${curitem_mod%%[$sort_sep]*}" > + > + # Apply optional trim (-k POS.TRIM) to cut leading characters > + curitem_mod="${curitem_mod#$trim}" > + > + # Determine the type of modified comparison to use initially > + # NB: Prefer numerical if requested but fallback to standard > + case "$curitem_mod" in > + ""|[!0-9]*) # NULL or begins with non-number > + gt=">" > + [ "$sort_numeric" ] && curitem_mod=0 > + ;; > + *) > + if [ "$sort_numeric" ]; then > + gt="-gt" > + curitem_mod="${curitem_mod%%[!0-9]*}" > + # NB: trailing non-digits removed > + # otherwise numeric comparison fails > + else > + gt=">" > + fi > + esac > + > + # If first time through, short-circuit below position-search > + if [ $i -le 1 ]; then > + d=0 > + else > + d=1 > + fi > + > + # > + # Find appropriate element position > + # > + while [ $d -gt 0 ] > + do > + dest_haskey=$curitem_haskey > + eval dest=\"\$dest_$d\" > + dest_mod="$dest" # for modified comparison > + dest_orig="$dest" # for original comparison > + > + # Trim leading whitespace if desired > + if [ "$sort_ignore_leading_space" ]; then > + while case "$dest_orig" in > + [$IFS]*) : ;; *) false; esac > + do > + dest_orig="${dest_orig#?}" > + done > + dest_mod="$dest_orig" > + fi > + > + # Shift modified value if sort field (-k POS) is > 1 > + n=$sort_field > + while [ $n -gt 1 ]; do > + case "$dest_mod" in > + *[$sort_sep]*) > + # Cut text up-to (and incl.) 1st sep > + dest_mod="${dest_mod#*[$sort_sep]}" > + > + # Skip NULLs unless strict fields > + [ "$sort_strict_fields" ] || > + [ "${dest_mod%%[$sort_sep]*}" ] || > + [ $n -eq 2 ] || > + continue > + ;; > + *) > + # Asked for a field that doesn't exist > + dest_haskey= break > + esac > + n=$(( $n - 1 )) > + done > + > + # Trim trailing words if sort field >= 1 > + [ $sort_field -ge 1 -a "$sort_numeric" ] && > + dest_mod="${dest_mod%%[$sort_sep]*}" > + > + # Apply optional trim (-k POS.TRIM), cut leading chars > + dest_mod="${dest_mod#$trim}" > + > + # Determine type of modified comparison to use > + # NB: Prefer numerical if requested, fallback to std > + case "$dest_mod" in > + ""|[!0-9]*) # NULL or begins with non-number > + gt=">" > + [ "$sort_numeric" ] && dest_mod=0 > + ;; > + *) > + if [ "$sort_numeric" ]; then > + gt="-gt" > + dest_mod="${dest_mod%%[!0-9]*}" > + # NB: kill trailing non-digits > + # for numeric comparison safety > + else > + gt=">" > + fi > + esac > + > + # Break if we've found the proper element position > + if [ "$curitem_haskey" -a "$dest_haskey" ]; then > + if [ "$dest_mod" = "$curitem_mod" ]; then > + [ "$dest_orig" ">" "$curitem_orig" ] && > + break > + elif [ "$dest_mod" $gt "$curitem_mod" ] \ > + 2> /dev/null > + then > + break > + fi > + else > + [ "$dest_orig" ">" "$curitem_orig" ] && break > + fi > + > + # Break if we've hit the end > + [ $d -ge $i ] && break > + > + d=$(( $d + 1 )) > + done > + > + # Shift remaining positions forward, making room for new item > + n=$i > + while [ $n -ge $d ]; do > + # Shift destination item forward one placement > + eval dest_$(( $n + 1 ))=\"\$dest_$n\" > + n=$(( $n - 1 )) > + done > + > + # Place the element > + if [ $i -eq 1 ]; then > + local dest_1="$curitem" > + else > + local dest_$d="$curitem" > + fi > + > + i=$(( $i + 1 )) > + done > + > + # Print sorted results > + d=1 > + while [ $d -le $nitems ]; do > + eval echo \"\$dest_$d\" > + d=$(( $d + 1 )) > + done > +} > + > # > # wait_for_pids pid [pid ...] > # spins until none of the pids exist > @@ -1524,19 +1778,20 @@ load_kld() > return 0 > } > > -# ltr str src dst > +# ltr str src dst [var] > # Change every $src in $str to $dst. > # Useful when /usr is not yet mounted and we cannot use tr(1), sed(1) nor > -# awk(1). > +# awk(1). If var is non-NULL, set it to the result. > ltr() > { > - local _str _src _dst _out _com > - _str=$1 > - _src=$2 > - _dst=$3 > + local _str _src _dst _out _com _var > + _str="$1" > + _src="$2" > + _dst="$3" > + _var="$4" > _out="" > > - IFS=${_src} > + local IFS="${_src}" > for _com in ${_str}; do > if [ -z "${_out}" ]; then > _out="${_com}" > @@ -1544,7 +1799,11 @@ ltr() > _out="${_out}${_dst}${_com}" > fi > done > - echo "${_out}" > + if [ -n "${_var}" ]; then > + setvar "${_var}" "${_out}" > + else > + echo "${_out}" > + fi > } > > # Creates a list of providers for GELI encryption. > -- Maxim Konovalov From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 08:14:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9885DD1; Wed, 11 Jun 2014 08:14:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD7142762; Wed, 11 Jun 2014 08:14:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5B8E8R3026339; Wed, 11 Jun 2014 08:14:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5B8E81s026338; Wed, 11 Jun 2014 08:14:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406110814.s5B8E81s026338@svn.freebsd.org> From: Alexander Motin Date: Wed, 11 Jun 2014 08:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267351 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 08:14:08 -0000 Author: mav Date: Wed Jun 11 08:14:08 2014 New Revision: 267351 URL: http://svnweb.freebsd.org/changeset/base/267351 Log: Move root_mount_hold() functionality to separate mutex. It has nothing to share with mutex protecting list of mounted file systems. Modified: head/sys/kern/vfs_mountroot.c Modified: head/sys/kern/vfs_mountroot.c ============================================================================== --- head/sys/kern/vfs_mountroot.c Wed Jun 11 06:45:52 2014 (r267350) +++ head/sys/kern/vfs_mountroot.c Wed Jun 11 08:14:08 2014 (r267351) @@ -97,6 +97,9 @@ struct vnode *rootvnode; char *rootdevnames[2] = {NULL, NULL}; +struct mtx root_holds_mtx; +MTX_SYSINIT(root_holds, &root_holds_mtx, "root_holds", MTX_DEF); + struct root_hold_token { const char *who; LIST_ENTRY(root_hold_token) list; @@ -131,9 +134,9 @@ root_mount_hold(const char *identifier) h = malloc(sizeof *h, M_DEVBUF, M_ZERO | M_WAITOK); h->who = identifier; - mtx_lock(&mountlist_mtx); + mtx_lock(&root_holds_mtx); LIST_INSERT_HEAD(&root_holds, h, list); - mtx_unlock(&mountlist_mtx); + mtx_unlock(&root_holds_mtx); return (h); } @@ -143,10 +146,10 @@ root_mount_rel(struct root_hold_token *h if (h == NULL) return; - mtx_lock(&mountlist_mtx); + mtx_lock(&root_holds_mtx); LIST_REMOVE(h, list); wakeup(&root_holds); - mtx_unlock(&mountlist_mtx); + mtx_unlock(&root_holds_mtx); free(h, M_DEVBUF); } @@ -168,12 +171,12 @@ root_mount_wait(void) */ KASSERT(curthread->td_proc->p_pid != 0, ("root_mount_wait: cannot be called from the swapper thread")); - mtx_lock(&mountlist_mtx); + mtx_lock(&root_holds_mtx); while (!root_mount_complete) { - msleep(&root_mount_complete, &mountlist_mtx, PZERO, "rootwait", + msleep(&root_mount_complete, &root_holds_mtx, PZERO, "rootwait", hz); } - mtx_unlock(&mountlist_mtx); + mtx_unlock(&root_holds_mtx); } static void @@ -908,9 +911,9 @@ vfs_mountroot_wait(void) DROP_GIANT(); g_waitidle(); PICKUP_GIANT(); - mtx_lock(&mountlist_mtx); + mtx_lock(&root_holds_mtx); if (LIST_EMPTY(&root_holds)) { - mtx_unlock(&mountlist_mtx); + mtx_unlock(&root_holds_mtx); break; } if (ppsratecheck(&lastfail, &curfail, 1)) { @@ -919,7 +922,7 @@ vfs_mountroot_wait(void) printf(" %s", h->who); printf("\n"); } - msleep(&root_holds, &mountlist_mtx, PZERO | PDROP, "roothold", + msleep(&root_holds, &root_holds_mtx, PZERO | PDROP, "roothold", hz); } } @@ -979,10 +982,10 @@ vfs_mountroot(void) vref(prison0.pr_root); mtx_unlock(&prison0.pr_mtx); - mtx_lock(&mountlist_mtx); + mtx_lock(&root_holds_mtx); atomic_store_rel_int(&root_mount_complete, 1); wakeup(&root_mount_complete); - mtx_unlock(&mountlist_mtx); + mtx_unlock(&root_holds_mtx); EVENTHANDLER_INVOKE(mountroot); } From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 10:03:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A26A751; Wed, 11 Jun 2014 10:03:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EED0B2481; Wed, 11 Jun 2014 10:03:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BA36UJ079673; Wed, 11 Jun 2014 10:03:06 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BA36gt079670; Wed, 11 Jun 2014 10:03:06 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201406111003.s5BA36gt079670@svn.freebsd.org> From: Ruslan Bukin Date: Wed, 11 Jun 2014 10:03:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267354 - in head/sys/arm: conf freescale/vybrid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 10:03:07 -0000 Author: br Date: Wed Jun 11 10:03:06 2014 New Revision: 267354 URL: http://svnweb.freebsd.org/changeset/base/267354 Log: Add a driver for Serial Peripheral Interface (SPI). Added: head/sys/arm/freescale/vybrid/vf_spi.c (contents, props changed) Modified: head/sys/arm/conf/VYBRID head/sys/arm/freescale/vybrid/files.vybrid Modified: head/sys/arm/conf/VYBRID ============================================================================== --- head/sys/arm/conf/VYBRID Wed Jun 11 09:31:09 2014 (r267353) +++ head/sys/arm/conf/VYBRID Wed Jun 11 10:03:06 2014 (r267354) @@ -141,6 +141,10 @@ device bpf # Berkeley packet filter device sound +# SPI +device spibus +device vf_spi + # Framebuffer device vt device kbdmux Modified: head/sys/arm/freescale/vybrid/files.vybrid ============================================================================== --- head/sys/arm/freescale/vybrid/files.vybrid Wed Jun 11 09:31:09 2014 (r267353) +++ head/sys/arm/freescale/vybrid/files.vybrid Wed Jun 11 10:03:06 2014 (r267354) @@ -31,4 +31,5 @@ arm/freescale/vybrid/vf_ehci.c optiona arm/freescale/vybrid/vf_gpio.c optional gpio arm/freescale/vybrid/vf_uart.c optional uart arm/freescale/vybrid/vf_sai.c optional sound +arm/freescale/vybrid/vf_spi.c optional vf_spi dev/ffec/if_ffec.c optional ffec Added: head/sys/arm/freescale/vybrid/vf_spi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/vybrid/vf_spi.c Wed Jun 11 10:03:06 2014 (r267354) @@ -0,0 +1,293 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Vybrid Family Serial Peripheral Interface (SPI) + * Chapter 47, Vybrid Reference Manual, Rev. 5, 07/2013 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "spibus_if.h" + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#define SPI_FIFO_SIZE 4 + +#define SPI_MCR 0x00 /* Module Configuration */ +#define MCR_MSTR (1 << 31) /* Master/Slave Mode Select */ +#define MCR_CONT_SCKE (1 << 30) /* Continuous SCK Enable */ +#define MCR_FRZ (1 << 27) /* Freeze */ +#define MCR_PCSIS_S 16 /* Peripheral Chip Select */ +#define MCR_PCSIS_M 0x3f +#define MCR_MDIS (1 << 14) /* Module Disable */ +#define MCR_CLR_TXF (1 << 11) /* Clear TX FIFO */ +#define MCR_CLR_RXF (1 << 10) /* Clear RX FIFO */ +#define MCR_HALT (1 << 0) /* Starts and stops SPI transfers */ +#define SPI_TCR 0x08 /* Transfer Count */ +#define SPI_CTAR0 0x0C /* Clock and Transfer Attributes */ +#define SPI_CTAR0_SLAVE 0x0C /* Clock and Transfer Attributes */ +#define SPI_CTAR1 0x10 /* Clock and Transfer Attributes */ +#define SPI_CTAR2 0x14 /* Clock and Transfer Attributes */ +#define SPI_CTAR3 0x18 /* Clock and Transfer Attributes */ +#define CTAR_FMSZ_M 0xf +#define CTAR_FMSZ_S 27 /* Frame Size */ +#define CTAR_FMSZ_8 0x7 /* 8 bits */ +#define CTAR_CPOL (1 << 26) /* Clock Polarity */ +#define CTAR_CPHA (1 << 25) /* Clock Phase */ +#define CTAR_LSBFE (1 << 24) /* Less significant bit first */ +#define CTAR_PCSSCK_M 0x3 +#define CTAR_PCSSCK_S 22 /* PCS to SCK Delay Prescaler */ +#define CTAR_PBR_M 0x3 +#define CTAR_PBR_S 16 /* Baud Rate Prescaler */ +#define CTAR_PBR_7 0x3 /* Divide by 7 */ +#define CTAR_CSSCK_M 0xf +#define CTAR_CSSCK_S 12 /* PCS to SCK Delay Scaler */ +#define CTAR_BR_M 0xf +#define CTAR_BR_S 0 /* Baud Rate Scaler */ +#define SPI_SR 0x2C /* Status Register */ +#define SR_TCF (1 << 31) /* Transfer Complete Flag */ +#define SR_EOQF (1 << 28) /* End of Queue Flag */ +#define SR_TFFF (1 << 25) /* Transmit FIFO Fill Flag */ +#define SR_RFDF (1 << 17) /* Receive FIFO Drain Flag */ +#define SPI_RSER 0x30 /* DMA/Interrupt Select */ +#define RSER_EOQF_RE (1 << 28) /* Finished Request Enable */ +#define SPI_PUSHR 0x34 /* PUSH TX FIFO In Master Mode */ +#define PUSHR_CONT (1 << 31) /* Continuous Peripheral CS */ +#define PUSHR_EOQ (1 << 27) /* End Of Queue */ +#define PUSHR_CTCNT (1 << 26) /* Clear Transfer Counter */ +#define PUSHR_PCS_M 0x3f +#define PUSHR_PCS_S 16 /* Select PCS signals */ + +#define SPI_PUSHR_SLAVE 0x34 /* PUSH TX FIFO Register In Slave Mode */ +#define SPI_POPR 0x38 /* POP RX FIFO Register */ +#define SPI_TXFR0 0x3C /* Transmit FIFO Registers */ +#define SPI_TXFR1 0x40 +#define SPI_TXFR2 0x44 +#define SPI_TXFR3 0x48 +#define SPI_RXFR0 0x7C /* Receive FIFO Registers */ +#define SPI_RXFR1 0x80 +#define SPI_RXFR2 0x84 +#define SPI_RXFR3 0x88 + +struct spi_softc { + struct resource *res[2]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + void *ih; +}; + +static struct resource_spec spi_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static int +spi_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "fsl,mvf600-spi")) + return (ENXIO); + + device_set_desc(dev, "Vybrid Family Serial Peripheral Interface"); + return (BUS_PROBE_DEFAULT); +} + +static int +spi_attach(device_t dev) +{ + struct spi_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + if (bus_alloc_resources(dev, spi_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + reg = READ4(sc, SPI_MCR); + reg |= MCR_MSTR; + reg &= ~(MCR_CONT_SCKE | MCR_MDIS | MCR_FRZ); + reg &= ~(MCR_PCSIS_M << MCR_PCSIS_S); + reg |= (MCR_PCSIS_M << MCR_PCSIS_S); /* PCS Active low */ + reg |= (MCR_CLR_TXF | MCR_CLR_RXF); + WRITE4(sc, SPI_MCR, reg); + + reg = READ4(sc, SPI_RSER); + reg |= RSER_EOQF_RE; + WRITE4(sc, SPI_RSER, reg); + + reg = READ4(sc, SPI_MCR); + reg &= ~MCR_HALT; + WRITE4(sc, SPI_MCR, reg); + + reg = READ4(sc, SPI_CTAR0); + reg &= ~(CTAR_FMSZ_M << CTAR_FMSZ_S); + reg |= (CTAR_FMSZ_8 << CTAR_FMSZ_S); + /* + * TODO: calculate BR + * SCK baud rate = ( fsys / PBR ) * (1 + DBR) / BR + * + * reg &= ~(CTAR_BR_M << CTAR_BR_S); + */ + reg &= ~CTAR_CPOL; /* Polarity */ + reg |= CTAR_CPHA; + /* + * Set LSB (Less significant bit first) + * must be used for some applications, e.g. some LCDs + */ + reg |= CTAR_LSBFE; + WRITE4(sc, SPI_CTAR0, reg); + + reg = READ4(sc, SPI_CTAR0); + reg &= ~(CTAR_PBR_M << CTAR_PBR_S); + reg |= (CTAR_PBR_7 << CTAR_PBR_S); + WRITE4(sc, SPI_CTAR0, reg); + + device_add_child(dev, "spibus", 0); + return (bus_generic_attach(dev)); +} + +static int +spi_txrx(struct spi_softc *sc, uint8_t *out_buf, + uint8_t *in_buf, int bufsz, int cs) +{ + uint32_t reg, wreg; + uint32_t txcnt; + uint32_t i; + + txcnt = 0; + + for (i = 0; i < bufsz; i++) { + txcnt++; + wreg = out_buf[i]; + wreg |= PUSHR_CONT; + wreg |= (cs << PUSHR_PCS_S); + if (i == 0) + wreg |= PUSHR_CTCNT; + if (i == (bufsz - 1) || txcnt == SPI_FIFO_SIZE) + wreg |= PUSHR_EOQ; + WRITE4(sc, SPI_PUSHR, wreg); + + if (i == (bufsz - 1) || txcnt == SPI_FIFO_SIZE) { + txcnt = 0; + + /* Wait last entry in a queue to be transmitted */ + while((READ4(sc, SPI_SR) & SR_EOQF) == 0) + continue; + + reg = READ4(sc, SPI_SR); + reg |= (SR_TCF | SR_EOQF); + WRITE4(sc, SPI_SR, reg); + } + + /* Wait until RX FIFO is empty */ + while((READ4(sc, SPI_SR) & SR_RFDF) == 0) + continue; + + in_buf[i] = READ1(sc, SPI_POPR); + } + + return (0); +} + +static int +spi_transfer(device_t dev, device_t child, struct spi_command *cmd) +{ + struct spi_softc *sc; + uint32_t cs; + + sc = device_get_softc(dev); + + KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, + ("%s: TX/RX command sizes should be equal", __func__)); + KASSERT(cmd->tx_data_sz == cmd->rx_data_sz, + ("%s: TX/RX data sizes should be equal", __func__)); + + /* get the proper chip select */ + spibus_get_cs(child, &cs); + + /* Command */ + spi_txrx(sc, cmd->tx_cmd, cmd->rx_cmd, cmd->tx_cmd_sz, cs); + + /* Data */ + spi_txrx(sc, cmd->tx_data, cmd->rx_data, cmd->tx_data_sz, cs); + + return (0); +} + +static device_method_t spi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, spi_probe), + DEVMETHOD(device_attach, spi_attach), + /* SPI interface */ + DEVMETHOD(spibus_transfer, spi_transfer), + { 0, 0 } +}; + +static driver_t spi_driver = { + "spi", + spi_methods, + sizeof(struct spi_softc), +}; + +static devclass_t spi_devclass; + +DRIVER_MODULE(spi, simplebus, spi_driver, spi_devclass, 0, 0); From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 10:13:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F8B2F88; Wed, 11 Jun 2014 10:13:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D009259B; Wed, 11 Jun 2014 10:13:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BAD861084881; Wed, 11 Jun 2014 10:13:08 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BAD80n084880; Wed, 11 Jun 2014 10:13:08 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201406111013.s5BAD80n084880@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 11 Jun 2014 10:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267355 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 10:13:08 -0000 Author: ae Date: Wed Jun 11 10:13:08 2014 New Revision: 267355 URL: http://svnweb.freebsd.org/changeset/base/267355 Log: Add UUIDs for DragonFlyBSD's partition types. MFC after: 2 weeks Modified: head/sys/sys/gpt.h Modified: head/sys/sys/gpt.h ============================================================================== --- head/sys/sys/gpt.h Wed Jun 11 10:03:06 2014 (r267354) +++ head/sys/sys/gpt.h Wed Jun 11 10:13:08 2014 (r267355) @@ -161,6 +161,25 @@ struct gpt_ent { #define GPT_ENT_TYPE_NETBSD_CGD \ {0x2db519ec,0xb10f,0x11dc,0xb9,0x9b,{0x00,0x19,0xd1,0x87,0x96,0x48}} +#define GPT_ENT_TYPE_DRAGONFLY_LABEL32 \ + {0x9d087404,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_SWAP \ + {0x9d58fdbd,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_UFS1 \ + {0x9d94ce7c,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_VINUM \ + {0x9dd4478f,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_CCD \ + {0xdbd5211b,0x1ca5,0x11dc,0x88,0x17,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_LABEL64 \ + {0x3d48ce54,0x1d16,0x11dc,0x86,0x96,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_LEGACY \ + {0xbd215ab2,0x1d16,0x11dc,0x86,0x96,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_HAMMER \ + {0x61dc63ac,0x6e38,0x11dc,0x85,0x13,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} +#define GPT_ENT_TYPE_DRAGONFLY_HAMMER2 \ + {0x5cbb9ad1,0x862d,0x11dc,0xa9,0x4d,{0x01,0x30,0x1b,0xb8,0xa9,0xf5}} + /* * Boot partition used by GRUB 2. */ From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 10:14:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E1FB1A8; Wed, 11 Jun 2014 10:14:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B45325AB; Wed, 11 Jun 2014 10:14:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BAEfvu085198; Wed, 11 Jun 2014 10:14:41 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BAEf68085197; Wed, 11 Jun 2014 10:14:41 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201406111014.s5BAEf68085197@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 11 Jun 2014 10:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267356 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 10:14:41 -0000 Author: ae Date: Wed Jun 11 10:14:40 2014 New Revision: 267356 URL: http://svnweb.freebsd.org/changeset/base/267356 Log: Add DragonFlyBSD's Hammer FS types and type names. MFC after: 2 weeks Modified: head/sys/sys/disklabel.h Modified: head/sys/sys/disklabel.h ============================================================================== --- head/sys/sys/disklabel.h Wed Jun 11 10:13:08 2014 (r267355) +++ head/sys/sys/disklabel.h Wed Jun 11 10:14:40 2014 (r267356) @@ -229,6 +229,8 @@ static const char *dktypenames[] = { #define FS_NTFS 18 /* Windows/NT file system */ #define FS_CCD 20 /* concatenated disk component */ #define FS_JFS2 21 /* IBM JFS2 */ +#define FS_HAMMER 22 /* DragonFlyBSD Hammer FS */ +#define FS_HAMMER2 23 /* DragonFlyBSD Hammer2 FS */ #define FS_UDF 24 /* UDF */ #define FS_EFS 26 /* SGI's Extent File system */ #define FS_ZFS 27 /* Sun's ZFS */ @@ -258,8 +260,8 @@ static const char *fstypenames[] = { "?", "ccd", "jfs", - "?", - "?", + "HAMMER", + "HAMMER2", "UDF", "?", "EFS", From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 10:19:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 810A1392; Wed, 11 Jun 2014 10:19:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DE5225D6; Wed, 11 Jun 2014 10:19:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BAJCgS085888; Wed, 11 Jun 2014 10:19:12 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BAJBjW085880; Wed, 11 Jun 2014 10:19:11 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201406111019.s5BAJBjW085880@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 11 Jun 2014 10:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267357 - head/sys/geom/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 10:19:12 -0000 Author: ae Date: Wed Jun 11 10:19:11 2014 New Revision: 267357 URL: http://svnweb.freebsd.org/changeset/base/267357 Log: Add aliases for DragonFlyBSD's partition types. MFC after: 2 weeks Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_bsd.c head/sys/geom/part/g_part_gpt.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Wed Jun 11 10:14:40 2014 (r267356) +++ head/sys/geom/part/g_part.c Wed Jun 11 10:19:11 2014 (r267357) @@ -108,6 +108,15 @@ struct g_part_alias_list { { "vmware-vmkdiag", G_PART_ALIAS_VMKDIAG }, { "vmware-reserved", G_PART_ALIAS_VMRESERVED }, { "vmware-vsanhdr", G_PART_ALIAS_VMVSANHDR }, + { "dragonfly-label32", G_PART_ALIAS_DFBSD }, + { "dragonfly-label64", G_PART_ALIAS_DFBSD64 }, + { "dragonfly-swap", G_PART_ALIAS_DFBSD_SWAP }, + { "dragonfly-ufs", G_PART_ALIAS_DFBSD_UFS }, + { "dragonfly-vinum", G_PART_ALIAS_DFBSD_VINUM }, + { "dragonfly-ccd", G_PART_ALIAS_DFBSD_CCD }, + { "dragonfly-legacy", G_PART_ALIAS_DFBSD_LEGACY }, + { "dragonfly-hammer", G_PART_ALIAS_DFBSD_HAMMER }, + { "dragonfly-hammer2", G_PART_ALIAS_DFBSD_HAMMER2 }, }; SYSCTL_DECL(_kern_geom); Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Wed Jun 11 10:14:40 2014 (r267356) +++ head/sys/geom/part/g_part.h Wed Jun 11 10:19:11 2014 (r267357) @@ -75,6 +75,15 @@ enum g_part_alias { G_PART_ALIAS_VMKDIAG, /* A VMware vmkDiagnostic partition entry */ G_PART_ALIAS_VMRESERVED, /* A VMware reserved partition entry */ G_PART_ALIAS_VMVSANHDR, /* A VMware vSAN header partition entry */ + G_PART_ALIAS_DFBSD, /* A DfBSD label32 partition entry */ + G_PART_ALIAS_DFBSD64, /* A DfBSD label64 partition entry */ + G_PART_ALIAS_DFBSD_SWAP, /* A DfBSD swap partition entry */ + G_PART_ALIAS_DFBSD_UFS, /* A DfBSD UFS partition entry */ + G_PART_ALIAS_DFBSD_VINUM, /* A DfBSD Vinum partition entry */ + G_PART_ALIAS_DFBSD_CCD, /* A DfBSD CCD partition entry */ + G_PART_ALIAS_DFBSD_LEGACY, /* A DfBSD legacy partition entry */ + G_PART_ALIAS_DFBSD_HAMMER, /* A DfBSD HAMMER FS partition entry */ + G_PART_ALIAS_DFBSD_HAMMER2, /* A DfBSD HAMMER2 FS partition entry */ /* Keep the following last */ G_PART_ALIAS_COUNT }; Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Wed Jun 11 10:14:40 2014 (r267356) +++ head/sys/geom/part/g_part_bsd.c Wed Jun 11 10:19:11 2014 (r267357) @@ -112,12 +112,26 @@ static struct g_part_scheme g_part_bsd_s }; G_PART_SCHEME_DECLARE(g_part_bsd); +static struct g_part_bsd_alias { + uint8_t type; + int alias; +} bsd_alias_match[] = { + { FS_BSDFFS, G_PART_ALIAS_FREEBSD_UFS }, + { FS_SWAP, G_PART_ALIAS_FREEBSD_SWAP }, + { FS_ZFS, G_PART_ALIAS_FREEBSD_ZFS }, + { FS_VINUM, G_PART_ALIAS_FREEBSD_VINUM }, + { FS_NANDFS, G_PART_ALIAS_FREEBSD_NANDFS }, + { FS_HAMMER, G_PART_ALIAS_DFBSD_HAMMER }, + { FS_HAMMER2, G_PART_ALIAS_DFBSD_HAMMER2 }, +}; + static int bsd_parse_type(const char *type, uint8_t *fstype) { const char *alias; char *endp; long lt; + int i; if (type[0] == '!') { lt = strtol(type + 1, &endp, 0); @@ -126,30 +140,13 @@ bsd_parse_type(const char *type, uint8_t *fstype = (u_int)lt; return (0); } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS); - if (!strcasecmp(type, alias)) { - *fstype = FS_NANDFS; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP); - if (!strcasecmp(type, alias)) { - *fstype = FS_SWAP; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_UFS); - if (!strcasecmp(type, alias)) { - *fstype = FS_BSDFFS; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_VINUM); - if (!strcasecmp(type, alias)) { - *fstype = FS_VINUM; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_ZFS); - if (!strcasecmp(type, alias)) { - *fstype = FS_ZFS; - return (0); + for (i = 0; + i < sizeof(bsd_alias_match) / sizeof(bsd_alias_match[0]); i++) { + alias = g_part_alias_name(bsd_alias_match[i].alias); + if (strcasecmp(type, alias) == 0) { + *fstype = bsd_alias_match[i].type; + return (0); + } } return (EINVAL); } Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Wed Jun 11 10:14:40 2014 (r267356) +++ head/sys/geom/part/g_part_gpt.c Wed Jun 11 10:19:11 2014 (r267357) @@ -181,6 +181,15 @@ static struct uuid gpt_uuid_netbsd_raid static struct uuid gpt_uuid_netbsd_swap = GPT_ENT_TYPE_NETBSD_SWAP; static struct uuid gpt_uuid_mbr = GPT_ENT_TYPE_MBR; static struct uuid gpt_uuid_unused = GPT_ENT_TYPE_UNUSED; +static struct uuid gpt_uuid_dfbsd_swap = GPT_ENT_TYPE_DRAGONFLY_SWAP; +static struct uuid gpt_uuid_dfbsd_ufs1 = GPT_ENT_TYPE_DRAGONFLY_UFS1; +static struct uuid gpt_uuid_dfbsd_vinum = GPT_ENT_TYPE_DRAGONFLY_VINUM; +static struct uuid gpt_uuid_dfbsd_ccd = GPT_ENT_TYPE_DRAGONFLY_CCD; +static struct uuid gpt_uuid_dfbsd_legacy = GPT_ENT_TYPE_DRAGONFLY_LEGACY; +static struct uuid gpt_uuid_dfbsd_hammer = GPT_ENT_TYPE_DRAGONFLY_HAMMER; +static struct uuid gpt_uuid_dfbsd_hammer2 = GPT_ENT_TYPE_DRAGONFLY_HAMMER2; +static struct uuid gpt_uuid_dfbsd_label32 = GPT_ENT_TYPE_DRAGONFLY_LABEL32; +static struct uuid gpt_uuid_dfbsd_label64 = GPT_ENT_TYPE_DRAGONFLY_LABEL64; static struct g_part_uuid_alias { struct uuid *uuid; @@ -222,6 +231,15 @@ static struct g_part_uuid_alias { { &gpt_uuid_netbsd_lfs, G_PART_ALIAS_NETBSD_LFS, 0 }, { &gpt_uuid_netbsd_raid, G_PART_ALIAS_NETBSD_RAID, 0 }, { &gpt_uuid_netbsd_swap, G_PART_ALIAS_NETBSD_SWAP, 0 }, + { &gpt_uuid_dfbsd_swap, G_PART_ALIAS_DFBSD_SWAP, 0 }, + { &gpt_uuid_dfbsd_ufs1, G_PART_ALIAS_DFBSD_UFS, 0 }, + { &gpt_uuid_dfbsd_vinum, G_PART_ALIAS_DFBSD_VINUM, 0 }, + { &gpt_uuid_dfbsd_ccd, G_PART_ALIAS_DFBSD_CCD, 0 }, + { &gpt_uuid_dfbsd_legacy, G_PART_ALIAS_DFBSD_LEGACY, 0 }, + { &gpt_uuid_dfbsd_hammer, G_PART_ALIAS_DFBSD_HAMMER, 0 }, + { &gpt_uuid_dfbsd_hammer2, G_PART_ALIAS_DFBSD_HAMMER2, 0 }, + { &gpt_uuid_dfbsd_label32, G_PART_ALIAS_DFBSD, 0xa5 }, + { &gpt_uuid_dfbsd_label64, G_PART_ALIAS_DFBSD64, 0xa5 }, { NULL, 0, 0 } }; From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 10:23:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB9A1613; Wed, 11 Jun 2014 10:23:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98C6D268C; Wed, 11 Jun 2014 10:23:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BANnx9089714; Wed, 11 Jun 2014 10:23:49 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BANnZB089713; Wed, 11 Jun 2014 10:23:49 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201406111023.s5BANnZB089713@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 11 Jun 2014 10:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267358 - head/sys/geom/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 10:23:49 -0000 Author: ae Date: Wed Jun 11 10:23:49 2014 New Revision: 267358 URL: http://svnweb.freebsd.org/changeset/base/267358 Log: Allow swapping to DragonFlyBSD's swap partition. MFC after: 2 weeks Modified: head/sys/geom/part/g_part_gpt.c Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Wed Jun 11 10:19:11 2014 (r267357) +++ head/sys/geom/part/g_part_gpt.c Wed Jun 11 10:23:49 2014 (r267358) @@ -724,7 +724,8 @@ g_part_gpt_dumpto(struct g_part_table *t entry = (struct g_part_gpt_entry *)baseentry; return ((EQUUID(&entry->ent.ent_type, &gpt_uuid_freebsd_swap) || - EQUUID(&entry->ent.ent_type, &gpt_uuid_linux_swap)) ? 1 : 0); + EQUUID(&entry->ent.ent_type, &gpt_uuid_linux_swap) || + EQUUID(&entry->ent.ent_type, &gpt_uuid_dfbsd_swap)) ? 1 : 0); } static int From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 10:42:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2923896B; Wed, 11 Jun 2014 10:42:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 097DC2805; Wed, 11 Jun 2014 10:42:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BAgaQD098771; Wed, 11 Jun 2014 10:42:36 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BAgZuY098764; Wed, 11 Jun 2014 10:42:35 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201406111042.s5BAgZuY098764@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 11 Jun 2014 10:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267359 - in head: sbin/geom/class/part sys/geom/part sys/modules/geom/geom_part sys/modules/geom/geom_part/geom_part_bsd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 10:42:36 -0000 Author: ae Date: Wed Jun 11 10:42:34 2014 New Revision: 267359 URL: http://svnweb.freebsd.org/changeset/base/267359 Log: Add disklabel64 support to GEOM_PART class. This partitioning scheme is used in DragonFlyBSD. It is similar to BSD disklabel, but has the following improvements: * metadata has own dedicated place and isn't accessible through partitions; * all offsets are 64-bit; * supports 16 partitions by default (has reserved place for more); * has reserved place for backup label (but not yet implemented); * has UUIDs for partitions and partition types; No objections from: geom MFC after: 2 weeks Relnotes: yes Added: head/sys/geom/part/g_part_bsd64.c (contents, props changed) head/sys/modules/geom/geom_part/geom_part_bsd64/ head/sys/modules/geom/geom_part/geom_part_bsd64/Makefile (contents, props changed) Modified: head/sbin/geom/class/part/gpart.8 head/sys/modules/geom/geom_part/Makefile Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Wed Jun 11 10:23:49 2014 (r267358) +++ head/sbin/geom/class/part/gpart.8 Wed Jun 11 10:42:34 2014 (r267359) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 2, 2014 +.Dd June 11, 2014 .Dt GPART 8 .Os .Sh NAME @@ -491,6 +491,12 @@ called Requires the .Cm GEOM_PART_BSD kernel option. +.It Cm BSD64 +64-bit implementation of BSD disklabel used in DragonFlyBSD to subdivide MBR +or GPT partitions. +Requires the +.Cm GEOM_PART_BSD64 +kernel option. .It Cm LDM The Logical Disk Manager is an implementation of volume manager for Microsoft Windows NT. Added: head/sys/geom/part/g_part_bsd64.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/geom/part/g_part_bsd64.c Wed Jun 11 10:42:34 2014 (r267359) @@ -0,0 +1,667 @@ +/*- + * Copyright (c) 2014 Andrey V. Elsukov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "g_part_if.h" + +FEATURE(geom_part_bsd64, "GEOM partitioning class for 64-bit BSD disklabels"); + +/* XXX: move this to sys/disklabel64.h */ +#define DISKMAGIC64 ((uint32_t)0xc4464c59) +#define MAXPARTITIONS64 16 +#define RESPARTITIONS64 32 + +struct disklabel64 { + char d_reserved0[512]; /* reserved or unused */ + u_int32_t d_magic; /* the magic number */ + u_int32_t d_crc; /* crc32() d_magic thru last part */ + u_int32_t d_align; /* partition alignment requirement */ + u_int32_t d_npartitions; /* number of partitions */ + struct uuid d_stor_uuid; /* unique uuid for label */ + + u_int64_t d_total_size; /* total size incl everything (bytes) */ + u_int64_t d_bbase; /* boot area base offset (bytes) */ + /* boot area is pbase - bbase */ + u_int64_t d_pbase; /* first allocatable offset (bytes) */ + u_int64_t d_pstop; /* last allocatable offset+1 (bytes) */ + u_int64_t d_abase; /* location of backup copy if not 0 */ + + u_char d_packname[64]; + u_char d_reserved[64]; + + /* + * Note: offsets are relative to the base of the slice, NOT to + * d_pbase. Unlike 32 bit disklabels the on-disk format for + * a 64 bit disklabel remains slice-relative. + * + * An uninitialized partition has a p_boffset and p_bsize of 0. + * + * If p_fstype is not supported for a live partition it is set + * to FS_OTHER. This is typically the case when the filesystem + * is identified by its uuid. + */ + struct partition64 { /* the partition table */ + u_int64_t p_boffset; /* slice relative offset, in bytes */ + u_int64_t p_bsize; /* size of partition, in bytes */ + u_int8_t p_fstype; + u_int8_t p_unused01; /* reserved, must be 0 */ + u_int8_t p_unused02; /* reserved, must be 0 */ + u_int8_t p_unused03; /* reserved, must be 0 */ + u_int32_t p_unused04; /* reserved, must be 0 */ + u_int32_t p_unused05; /* reserved, must be 0 */ + u_int32_t p_unused06; /* reserved, must be 0 */ + struct uuid p_type_uuid;/* mount type as UUID */ + struct uuid p_stor_uuid;/* unique uuid for storage */ + } d_partitions[MAXPARTITIONS64];/* actually may be more */ +}; + +struct g_part_bsd64_table { + struct g_part_table base; + + uint32_t d_align; + uint64_t d_bbase; + uint64_t d_abase; + struct uuid d_stor_uuid; + char d_reserved0[512]; + u_char d_packname[64]; + u_char d_reserved[64]; +}; + +struct g_part_bsd64_entry { + struct g_part_entry base; + + uint8_t fstype; + struct uuid type_uuid; + struct uuid stor_uuid; +}; + +static int g_part_bsd64_add(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); +static int g_part_bsd64_bootcode(struct g_part_table *, struct g_part_parms *); +static int g_part_bsd64_create(struct g_part_table *, struct g_part_parms *); +static int g_part_bsd64_destroy(struct g_part_table *, struct g_part_parms *); +static void g_part_bsd64_dumpconf(struct g_part_table *, struct g_part_entry *, + struct sbuf *, const char *); +static int g_part_bsd64_dumpto(struct g_part_table *, struct g_part_entry *); +static int g_part_bsd64_modify(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); +static const char *g_part_bsd64_name(struct g_part_table *, struct g_part_entry *, + char *, size_t); +static int g_part_bsd64_probe(struct g_part_table *, struct g_consumer *); +static int g_part_bsd64_read(struct g_part_table *, struct g_consumer *); +static const char *g_part_bsd64_type(struct g_part_table *, struct g_part_entry *, + char *, size_t); +static int g_part_bsd64_write(struct g_part_table *, struct g_consumer *); +static int g_part_bsd64_resize(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); + +static kobj_method_t g_part_bsd64_methods[] = { + KOBJMETHOD(g_part_add, g_part_bsd64_add), + KOBJMETHOD(g_part_bootcode, g_part_bsd64_bootcode), + KOBJMETHOD(g_part_create, g_part_bsd64_create), + KOBJMETHOD(g_part_destroy, g_part_bsd64_destroy), + KOBJMETHOD(g_part_dumpconf, g_part_bsd64_dumpconf), + KOBJMETHOD(g_part_dumpto, g_part_bsd64_dumpto), + KOBJMETHOD(g_part_modify, g_part_bsd64_modify), + KOBJMETHOD(g_part_resize, g_part_bsd64_resize), + KOBJMETHOD(g_part_name, g_part_bsd64_name), + KOBJMETHOD(g_part_probe, g_part_bsd64_probe), + KOBJMETHOD(g_part_read, g_part_bsd64_read), + KOBJMETHOD(g_part_type, g_part_bsd64_type), + KOBJMETHOD(g_part_write, g_part_bsd64_write), + { 0, 0 } +}; + +static struct g_part_scheme g_part_bsd64_scheme = { + "BSD64", + g_part_bsd64_methods, + sizeof(struct g_part_bsd64_table), + .gps_entrysz = sizeof(struct g_part_bsd64_entry), + .gps_minent = MAXPARTITIONS64, + .gps_maxent = MAXPARTITIONS64 +}; +G_PART_SCHEME_DECLARE(g_part_bsd64); + +#define EQUUID(a, b) (memcmp(a, b, sizeof(struct uuid)) == 0) +static struct uuid bsd64_uuid_unused = GPT_ENT_TYPE_UNUSED; +static struct uuid bsd64_uuid_dfbsd_swap = GPT_ENT_TYPE_DRAGONFLY_SWAP; +static struct uuid bsd64_uuid_dfbsd_ufs1 = GPT_ENT_TYPE_DRAGONFLY_UFS1; +static struct uuid bsd64_uuid_dfbsd_vinum = GPT_ENT_TYPE_DRAGONFLY_VINUM; +static struct uuid bsd64_uuid_dfbsd_ccd = GPT_ENT_TYPE_DRAGONFLY_CCD; +static struct uuid bsd64_uuid_dfbsd_legacy = GPT_ENT_TYPE_DRAGONFLY_LEGACY; +static struct uuid bsd64_uuid_dfbsd_hammer = GPT_ENT_TYPE_DRAGONFLY_HAMMER; +static struct uuid bsd64_uuid_dfbsd_hammer2 = GPT_ENT_TYPE_DRAGONFLY_HAMMER2; +static struct uuid bsd64_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; +static struct uuid bsd64_uuid_freebsd_nandfs = GPT_ENT_TYPE_FREEBSD_NANDFS; +static struct uuid bsd64_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP; +static struct uuid bsd64_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; +static struct uuid bsd64_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM; +static struct uuid bsd64_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS; + +struct bsd64_uuid_alias { + struct uuid *uuid; + uint8_t fstype; + int alias; +}; +static struct bsd64_uuid_alias dfbsd_alias_match[] = { + { &bsd64_uuid_dfbsd_swap, FS_SWAP, G_PART_ALIAS_DFBSD_SWAP }, + { &bsd64_uuid_dfbsd_ufs1, FS_BSDFFS, G_PART_ALIAS_DFBSD_UFS }, + { &bsd64_uuid_dfbsd_vinum, FS_VINUM, G_PART_ALIAS_DFBSD_VINUM }, + { &bsd64_uuid_dfbsd_ccd, FS_CCD, G_PART_ALIAS_DFBSD_CCD }, + { &bsd64_uuid_dfbsd_legacy, FS_OTHER, G_PART_ALIAS_DFBSD_LEGACY }, + { &bsd64_uuid_dfbsd_hammer, FS_HAMMER, G_PART_ALIAS_DFBSD_HAMMER }, + { &bsd64_uuid_dfbsd_hammer2, FS_HAMMER2, G_PART_ALIAS_DFBSD_HAMMER2 }, + { NULL, 0, 0} +}; +static struct bsd64_uuid_alias fbsd_alias_match[] = { + { &bsd64_uuid_freebsd_boot, FS_OTHER, G_PART_ALIAS_FREEBSD_BOOT }, + { &bsd64_uuid_freebsd_swap, FS_OTHER, G_PART_ALIAS_FREEBSD_SWAP }, + { &bsd64_uuid_freebsd_ufs, FS_OTHER, G_PART_ALIAS_FREEBSD_UFS }, + { &bsd64_uuid_freebsd_zfs, FS_OTHER, G_PART_ALIAS_FREEBSD_ZFS }, + { &bsd64_uuid_freebsd_vinum, FS_OTHER, G_PART_ALIAS_FREEBSD_VINUM }, + { &bsd64_uuid_freebsd_nandfs, FS_OTHER, G_PART_ALIAS_FREEBSD_NANDFS }, + { NULL, 0, 0} +}; + +static int +bsd64_parse_type(const char *type, struct g_part_bsd64_entry *entry) +{ + struct uuid tmp; + const struct bsd64_uuid_alias *uap; + const char *alias; + char *p; + long lt; + int error; + + if (type[0] == '!') { + if (type[1] == '\0') + return (EINVAL); + lt = strtol(type + 1, &p, 0); + /* The type specified as number */ + if (*p == '\0') { + if (lt <= 0 || lt > 255) + return (EINVAL); + entry->fstype = lt; + entry->type_uuid = bsd64_uuid_unused; + return (0); + } + /* The type specified as uuid */ + error = parse_uuid(type + 1, &tmp); + if (error != 0) + return (error); + if (EQUUID(&tmp, &bsd64_uuid_unused)) + return (EINVAL); + for (uap = &dfbsd_alias_match[0]; uap->uuid != NULL; uap++) { + if (EQUUID(&tmp, uap->uuid)) { + /* Prefer fstype for known uuids */ + entry->type_uuid = bsd64_uuid_unused; + entry->fstype = uap->fstype; + return (0); + } + } + entry->type_uuid = tmp; + entry->fstype = FS_OTHER; + return (0); + } + /* The type specified as symbolic alias name */ + for (uap = &fbsd_alias_match[0]; uap->uuid != NULL; uap++) { + alias = g_part_alias_name(uap->alias); + if (!strcasecmp(type, alias)) { + entry->type_uuid = *uap->uuid; + entry->fstype = uap->fstype; + return (0); + } + } + for (uap = &dfbsd_alias_match[0]; uap->uuid != NULL; uap++) { + alias = g_part_alias_name(uap->alias); + if (!strcasecmp(type, alias)) { + entry->type_uuid = bsd64_uuid_unused; + entry->fstype = uap->fstype; + return (0); + } + } + return (EINVAL); +} + +static int +g_part_bsd64_add(struct g_part_table *basetable, struct g_part_entry *baseentry, + struct g_part_parms *gpp) +{ + struct g_part_bsd64_entry *entry; + + if (gpp->gpp_parms & G_PART_PARM_LABEL) + return (EINVAL); + + entry = (struct g_part_bsd64_entry *)baseentry; + if (bsd64_parse_type(gpp->gpp_type, entry) != 0) + return (EINVAL); + kern_uuidgen(&entry->stor_uuid, 1); + return (0); +} + +static int +g_part_bsd64_bootcode(struct g_part_table *basetable, struct g_part_parms *gpp) +{ + + return (EOPNOTSUPP); +} + +#define PALIGN_SIZE (1024 * 1024) +#define PALIGN_MASK (PALIGN_SIZE - 1) +#define BLKSIZE (4 * 1024) +#define BOOTSIZE (32 * 1024) +#define DALIGN_SIZE (32 * 1024) +static int +g_part_bsd64_create(struct g_part_table *basetable, struct g_part_parms *gpp) +{ + struct g_part_bsd64_table *table; + struct g_part_entry *baseentry; + struct g_provider *pp; + uint64_t blkmask, pbase; + uint32_t blksize, ressize; + + pp = gpp->gpp_provider; + if (pp->mediasize < 2* PALIGN_SIZE) + return (ENOSPC); + + /* + * Use at least 4KB block size. Blksize is stored in the d_align. + * XXX: Actually it is used just for calculate d_bbase and used + * for better alignment in bsdlabel64(8). + */ + blksize = pp->sectorsize < BLKSIZE ? BLKSIZE: pp->sectorsize; + blkmask = blksize - 1; + /* Reserve enough space for RESPARTITIONS64 partitions. */ + ressize = offsetof(struct disklabel64, d_partitions[RESPARTITIONS64]); + ressize = (ressize + blkmask) & ~blkmask; + /* + * Reserve enough space for bootcode and align first allocatable + * offset to PALIGN_SIZE. + * XXX: Currently DragonFlyBSD has 32KB bootcode, but the size could + * be bigger, because it is possible change it (it is equal pbase-bbase) + * in the bsdlabel64(8). + */ + pbase = ressize + ((BOOTSIZE + blkmask) & ~blkmask); + pbase = (pbase + PALIGN_MASK) & ~PALIGN_MASK; + /* + * Take physical offset into account and make first allocatable + * offset 32KB aligned to the start of the physical disk. + * XXX: Actually there are no such restrictions, this is how + * DragonFlyBSD behaves. + */ + pbase += DALIGN_SIZE - pp->stripeoffset % DALIGN_SIZE; + + table = (struct g_part_bsd64_table *)basetable; + table->d_align = blksize; + table->d_bbase = ressize / pp->sectorsize; + table->d_abase = ((pp->mediasize - ressize) & + ~blkmask) / pp->sectorsize; + kern_uuidgen(&table->d_stor_uuid, 1); + basetable->gpt_first = pbase / pp->sectorsize; + basetable->gpt_last = table->d_abase - 1; /* XXX */ + /* + * Create 'c' partition and make it internal, so user will not be + * able use it. + */ + baseentry = g_part_new_entry(basetable, RAW_PART + 1, 0, 0); + baseentry->gpe_internal = 1; + return (0); +} + +static int +g_part_bsd64_destroy(struct g_part_table *basetable, struct g_part_parms *gpp) +{ + struct g_provider *pp; + + pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider; + if (pp->sectorsize > offsetof(struct disklabel64, d_magic)) + basetable->gpt_smhead |= 1; + else + basetable->gpt_smhead |= 3; + return (0); +} + +static void +g_part_bsd64_dumpconf(struct g_part_table *basetable, + struct g_part_entry *baseentry, struct sbuf *sb, const char *indent) +{ + struct g_part_bsd64_table *table; + struct g_part_bsd64_entry *entry; + char buf[sizeof(table->d_packname)]; + + entry = (struct g_part_bsd64_entry *)baseentry; + if (indent == NULL) { + /* conftxt: libdisk compatibility */ + sbuf_printf(sb, " xs BSD64 xt %u", entry->fstype); + } else if (entry != NULL) { + /* confxml: partition entry information */ + sbuf_printf(sb, "%s%u\n", indent, + entry->fstype); + if (!EQUUID(&bsd64_uuid_unused, &entry->type_uuid)) { + sbuf_printf(sb, "%s", indent); + sbuf_printf_uuid(sb, &entry->type_uuid); + sbuf_printf(sb, "\n"); + } + sbuf_printf(sb, "%s", indent); + sbuf_printf_uuid(sb, &entry->stor_uuid); + sbuf_printf(sb, "\n"); + } else { + /* confxml: scheme information */ + table = (struct g_part_bsd64_table *)basetable; + sbuf_printf(sb, "%s%ju\n", indent, + (uintmax_t)table->d_bbase); + if (table->d_abase) + sbuf_printf(sb, "%s%ju\n", + indent, (uintmax_t)table->d_abase); + sbuf_printf(sb, "%s", indent); + sbuf_printf_uuid(sb, &table->d_stor_uuid); + sbuf_printf(sb, "\n"); + sbuf_printf(sb, "%s\n"); + } +} + +static int +g_part_bsd64_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) +{ + struct g_part_bsd64_entry *entry; + + /* Allow dumping to a swap partition. */ + entry = (struct g_part_bsd64_entry *)baseentry; + if (entry->fstype == FS_SWAP || + EQUUID(&entry->type_uuid, &bsd64_uuid_dfbsd_swap) || + EQUUID(&entry->type_uuid, &bsd64_uuid_freebsd_swap)) + return (1); + return (0); +} + +static int +g_part_bsd64_modify(struct g_part_table *basetable, + struct g_part_entry *baseentry, struct g_part_parms *gpp) +{ + struct g_part_bsd64_entry *entry; + + if (gpp->gpp_parms & G_PART_PARM_LABEL) + return (EINVAL); + + entry = (struct g_part_bsd64_entry *)baseentry; + if (gpp->gpp_parms & G_PART_PARM_TYPE) + return (bsd64_parse_type(gpp->gpp_type, entry)); + return (0); +} + +static int +g_part_bsd64_resize(struct g_part_table *basetable, + struct g_part_entry *baseentry, struct g_part_parms *gpp) +{ + struct g_part_bsd64_table *table; + struct g_provider *pp; + + if (baseentry == NULL) { + pp = LIST_FIRST(&basetable->gpt_gp->consumer)->provider; + table = (struct g_part_bsd64_table *)basetable; + table->d_abase = ((pp->mediasize - + table->d_bbase * pp->sectorsize) & ~(table->d_align - 1)) / + pp->sectorsize; + basetable->gpt_last = table->d_abase - 1; + return (0); + } + baseentry->gpe_end = baseentry->gpe_start + gpp->gpp_size - 1; + return (0); +} + +static const char * +g_part_bsd64_name(struct g_part_table *table, struct g_part_entry *baseentry, + char *buf, size_t bufsz) +{ + + snprintf(buf, bufsz, "%c", 'a' + baseentry->gpe_index - 1); + return (buf); +} + +static int +g_part_bsd64_probe(struct g_part_table *table, struct g_consumer *cp) +{ + struct g_provider *pp; + uint32_t v; + int error; + u_char *buf; + + pp = cp->provider; + if (pp->mediasize < 2 * PALIGN_SIZE) + return (ENOSPC); + v = (pp->sectorsize + + offsetof(struct disklabel64, d_magic)) & ~(pp->sectorsize - 1); + buf = g_read_data(cp, 0, v, &error); + if (buf == NULL) + return (error); + v = le32dec(buf + offsetof(struct disklabel64, d_magic)); + g_free(buf); + return (v == DISKMAGIC64 ? G_PART_PROBE_PRI_HIGH: ENXIO); +} + +static int +g_part_bsd64_read(struct g_part_table *basetable, struct g_consumer *cp) +{ + struct g_part_bsd64_table *table; + struct g_part_bsd64_entry *entry; + struct g_part_entry *baseentry; + struct g_provider *pp; + struct disklabel64 *dlp; + uint64_t v64, sz; + uint32_t v32; + int error, index; + u_char *buf; + + pp = cp->provider; + table = (struct g_part_bsd64_table *)basetable; + v32 = (pp->sectorsize + + sizeof(struct disklabel64) - 1) & ~(pp->sectorsize - 1); + buf = g_read_data(cp, 0, v32, &error); + if (buf == NULL) + return (error); + + dlp = (struct disklabel64 *)buf; + basetable->gpt_entries = le32toh(dlp->d_npartitions); + if (basetable->gpt_entries > MAXPARTITIONS64) + goto invalid_label; + v32 = le32toh(dlp->d_crc); + dlp->d_crc = 0; + if (crc32(&dlp->d_magic, offsetof(struct disklabel64, + d_partitions[basetable->gpt_entries]) - + offsetof(struct disklabel64, d_magic)) != v32) + goto invalid_label; + table->d_align = le32toh(dlp->d_align); + if (table->d_align == 0 || (table->d_align & (pp->sectorsize - 1))) + goto invalid_label; + if (le64toh(dlp->d_total_size) > pp->mediasize) + goto invalid_label; + v64 = le64toh(dlp->d_pbase); + if (v64 % pp->sectorsize) + goto invalid_label; + basetable->gpt_first = v64 / pp->sectorsize; + v64 = le64toh(dlp->d_pstop); + if (v64 % pp->sectorsize) + goto invalid_label; + basetable->gpt_last = v64 / pp->sectorsize; + basetable->gpt_isleaf = 1; + v64 = le64toh(dlp->d_bbase); + if (v64 % pp->sectorsize) + goto invalid_label; + table->d_bbase = v64 / pp->sectorsize; + v64 = le64toh(dlp->d_abase); + if (v64 % pp->sectorsize) + goto invalid_label; + table->d_abase = v64 / pp->sectorsize; + le_uuid_dec(&dlp->d_stor_uuid, &table->d_stor_uuid); + for (index = basetable->gpt_entries - 1; index >= 0; index--) { + if (index == RAW_PART) { + /* Skip 'c' partition. */ + baseentry = g_part_new_entry(basetable, + index + 1, 0, 0); + baseentry->gpe_internal = 1; + continue; + } + v64 = le64toh(dlp->d_partitions[index].p_boffset); + sz = le64toh(dlp->d_partitions[index].p_bsize); + if (sz == 0 && v64 == 0) + continue; + if (sz == 0 || (v64 % pp->sectorsize) || (sz % pp->sectorsize)) + goto invalid_label; + baseentry = g_part_new_entry(basetable, index + 1, + v64 / pp->sectorsize, (v64 + sz) / pp->sectorsize - 1); + entry = (struct g_part_bsd64_entry *)baseentry; + le_uuid_dec(&dlp->d_partitions[index].p_type_uuid, + &entry->type_uuid); + le_uuid_dec(&dlp->d_partitions[index].p_stor_uuid, + &entry->stor_uuid); + entry->fstype = dlp->d_partitions[index].p_fstype; + if (index == RAW_PART) + baseentry->gpe_internal = 1; + } + bcopy(dlp->d_reserved0, table->d_reserved0, + sizeof(table->d_reserved0)); + bcopy(dlp->d_packname, table->d_packname, sizeof(table->d_packname)); + bcopy(dlp->d_reserved, table->d_reserved, sizeof(table->d_reserved)); + g_free(buf); + return (0); + +invalid_label: + g_free(buf); + return (EINVAL); +} + +static const char * +g_part_bsd64_type(struct g_part_table *basetable, struct g_part_entry *baseentry, + char *buf, size_t bufsz) +{ + struct g_part_bsd64_entry *entry; + struct bsd64_uuid_alias *uap; + + entry = (struct g_part_bsd64_entry *)baseentry; + if (entry->fstype != FS_OTHER) { + for (uap = &dfbsd_alias_match[0]; uap->uuid != NULL; uap++) + if (uap->fstype == entry->fstype) + return (g_part_alias_name(uap->alias)); + } else { + for (uap = &fbsd_alias_match[0]; uap->uuid != NULL; uap++) + if (EQUUID(uap->uuid, &entry->type_uuid)) + return (g_part_alias_name(uap->alias)); + for (uap = &dfbsd_alias_match[0]; uap->uuid != NULL; uap++) + if (EQUUID(uap->uuid, &entry->type_uuid)) + return (g_part_alias_name(uap->alias)); + } + if (EQUUID(&bsd64_uuid_unused, &entry->type_uuid)) + snprintf(buf, bufsz, "!%d", entry->fstype); + else { + buf[0] = '!'; + snprintf_uuid(buf + 1, bufsz - 1, &entry->type_uuid); + } + return (buf); +} + +static int +g_part_bsd64_write(struct g_part_table *basetable, struct g_consumer *cp) +{ + struct g_provider *pp; + struct g_part_entry *baseentry; + struct g_part_bsd64_entry *entry; + struct g_part_bsd64_table *table; + struct disklabel64 *dlp; + uint32_t v, sz; + int error, index; + + pp = cp->provider; + table = (struct g_part_bsd64_table *)basetable; + sz = (pp->sectorsize + + sizeof(struct disklabel64) - 1) & ~(pp->sectorsize - 1); + dlp = g_malloc(sz, M_WAITOK | M_ZERO); + + memcpy(dlp->d_reserved0, table->d_reserved0, + sizeof(table->d_reserved0)); + memcpy(dlp->d_packname, table->d_packname, sizeof(table->d_packname)); + memcpy(dlp->d_reserved, table->d_reserved, sizeof(table->d_reserved)); + le32enc(&dlp->d_magic, DISKMAGIC64); + le32enc(&dlp->d_align, table->d_align); + le32enc(&dlp->d_npartitions, basetable->gpt_entries); + le_uuid_enc(&dlp->d_stor_uuid, &table->d_stor_uuid); + le64enc(&dlp->d_total_size, pp->mediasize); + le64enc(&dlp->d_bbase, table->d_bbase * pp->sectorsize); + le64enc(&dlp->d_pbase, basetable->gpt_first * pp->sectorsize); + le64enc(&dlp->d_pstop, basetable->gpt_last * pp->sectorsize); + le64enc(&dlp->d_abase, table->d_abase * pp->sectorsize); + + LIST_FOREACH(baseentry, &basetable->gpt_entry, gpe_entry) { + if (baseentry->gpe_deleted) + continue; + index = baseentry->gpe_index - 1; + entry = (struct g_part_bsd64_entry *)baseentry; + if (index == RAW_PART) + continue; + le64enc(&dlp->d_partitions[index].p_boffset, + baseentry->gpe_start * pp->sectorsize); + le64enc(&dlp->d_partitions[index].p_bsize, pp->sectorsize * + (baseentry->gpe_end - baseentry->gpe_start + 1)); + dlp->d_partitions[index].p_fstype = entry->fstype; + le_uuid_enc(&dlp->d_partitions[index].p_type_uuid, + &entry->type_uuid); + le_uuid_enc(&dlp->d_partitions[index].p_stor_uuid, + &entry->stor_uuid); + } + /* Calculate checksum. */ + v = offsetof(struct disklabel64, + d_partitions[basetable->gpt_entries]) - + offsetof(struct disklabel64, d_magic); + le32enc(&dlp->d_crc, crc32(&dlp->d_magic, v)); + error = g_write_data(cp, 0, dlp, sz); + g_free(dlp); + return (error); +} + Modified: head/sys/modules/geom/geom_part/Makefile ============================================================================== --- head/sys/modules/geom/geom_part/Makefile Wed Jun 11 10:23:49 2014 (r267358) +++ head/sys/modules/geom/geom_part/Makefile Wed Jun 11 10:42:34 2014 (r267359) @@ -2,6 +2,7 @@ SUBDIR= geom_part_apm \ geom_part_bsd \ + geom_part_bsd64 \ geom_part_ebr \ geom_part_gpt \ geom_part_ldm \ Added: head/sys/modules/geom/geom_part/geom_part_bsd64/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/geom/geom_part/geom_part_bsd64/Makefile Wed Jun 11 10:42:34 2014 (r267359) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../../geom/part + +KMOD= geom_part_bsd64 +SRCS= g_part_bsd64.c + +SRCS+= bus_if.h device_if.h g_part_if.h + +MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m + +.include From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 10:48:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACFC6BEA; Wed, 11 Jun 2014 10:48:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AC7A283F; Wed, 11 Jun 2014 10:48:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BAmCEM099608; Wed, 11 Jun 2014 10:48:12 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BAmCCQ099605; Wed, 11 Jun 2014 10:48:12 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201406111048.s5BAmCCQ099605@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 11 Jun 2014 10:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267360 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 10:48:12 -0000 Author: ae Date: Wed Jun 11 10:48:11 2014 New Revision: 267360 URL: http://svnweb.freebsd.org/changeset/base/267360 Log: Add disklabel64 support MFC after: 2 weeks Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Jun 11 10:42:34 2014 (r267359) +++ head/sys/conf/NOTES Wed Jun 11 10:48:11 2014 (r267360) @@ -162,6 +162,7 @@ options GEOM_MULTIPATH # Disk multipat options GEOM_NOP # Test class. options GEOM_PART_APM # Apple partitioning options GEOM_PART_BSD # BSD disklabel +options GEOM_PART_BSD64 # BSD disklabel64 options GEOM_PART_EBR # Extended Boot Records options GEOM_PART_EBR_COMPAT # Backward compatible partition names options GEOM_PART_GPT # GPT partitioning Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jun 11 10:42:34 2014 (r267359) +++ head/sys/conf/files Wed Jun 11 10:48:11 2014 (r267360) @@ -2756,6 +2756,7 @@ geom/part/g_part.c standard geom/part/g_part_if.m standard geom/part/g_part_apm.c optional geom_part_apm geom/part/g_part_bsd.c optional geom_part_bsd +geom/part/g_part_bsd64.c optional geom_part_bsd64 geom/part/g_part_ebr.c optional geom_part_ebr geom/part/g_part_gpt.c optional geom_part_gpt geom/part/g_part_ldm.c optional geom_part_ldm Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Jun 11 10:42:34 2014 (r267359) +++ head/sys/conf/options Wed Jun 11 10:48:11 2014 (r267360) @@ -111,6 +111,7 @@ GEOM_MULTIPATH opt_geom.h GEOM_NOP opt_geom.h GEOM_PART_APM opt_geom.h GEOM_PART_BSD opt_geom.h +GEOM_PART_BSD64 opt_geom.h GEOM_PART_EBR opt_geom.h GEOM_PART_EBR_COMPAT opt_geom.h GEOM_PART_GPT opt_geom.h From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 11:27:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F937588; Wed, 11 Jun 2014 11:27:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FF8D2BA0; Wed, 11 Jun 2014 11:27:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BBRji6017875; Wed, 11 Jun 2014 11:27:45 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BBRj5u017874; Wed, 11 Jun 2014 11:27:45 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201406111127.s5BBRj5u017874@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Wed, 11 Jun 2014 11:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267361 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 11:27:45 -0000 Author: melifaro Date: Wed Jun 11 11:27:44 2014 New Revision: 267361 URL: http://svnweb.freebsd.org/changeset/base/267361 Log: Improve logic besides net.bpf.optimize_writers. Direct bpf(4) consumers should now work fine with this tunable turned on. In fact, the only case when optimized_writers can change program behavior is direct bpf(4) consumer setting its read filter to catch-all one. MFC after: 2 weeks Sponsored by: Yandex LLC Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Wed Jun 11 10:48:11 2014 (r267360) +++ head/sys/net/bpf.c Wed Jun 11 11:27:44 2014 (r267361) @@ -643,6 +643,67 @@ bpf_attachd(struct bpf_d *d, struct bpf_ } /* + * Check if we need to upgrade our descriptor @d from write-only mode. + */ +static int +bpf_check_upgrade(u_long cmd, struct bpf_d *d, struct bpf_insn *fcode, int flen) +{ + int is_snap, need_upgrade; + + /* + * Check if we've already upgraded or new filter is empty. + */ + if (d->bd_writer == 0 || fcode == NULL) + return (0); + + need_upgrade = 0; + + /* + * Check if cmd looks like snaplen setting from + * pcap_bpf.c:pcap_open_live(). + * Note we're not checking .k value here: + * while pcap_open_live() definitely sets to to non-zero value, + * we'd prefer to treat k=0 (deny ALL) case the same way: e.g. + * do not consider upgrading immediately + */ + if (cmd == BIOCSETF && flen == 1 && fcode[0].code == (BPF_RET | BPF_K)) + is_snap = 1; + else + is_snap = 0; + + if (is_snap == 0) { + /* + * We're setting first filter and it doesn't look like + * setting snaplen. We're probably using bpf directly. + * Upgrade immediately. + */ + need_upgrade = 1; + } else { + /* + * Do not require upgrade by first BIOCSETF + * (used to set snaplen) by pcap_open_live(). + */ + + if (--d->bd_writer == 0) { + /* + * First snaplen filter has already + * been set. This is probably catch-all + * filter + */ + need_upgrade = 1; + } + } + + CTR5(KTR_NET, + "%s: filter function set by pid %d, " + "bd_writer counter %d, snap %d upgrade %d", + __func__, d->bd_pid, d->bd_writer, + is_snap, need_upgrade); + + return (need_upgrade); +} + +/* * Add d to the list of active bp filters. * Reuqires bpf_attachd() to be called before */ @@ -1802,17 +1863,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro if (cmd == BIOCSETF) reset_d(d); - if (fcode != NULL) { - /* - * Do not require upgrade by first BIOCSETF - * (used to set snaplen) by pcap_open_live(). - */ - if (d->bd_writer != 0 && --d->bd_writer == 0) - need_upgrade = 1; - CTR4(KTR_NET, "%s: filter function set by pid %d, " - "bd_writer counter %d, need_upgrade %d", - __func__, d->bd_pid, d->bd_writer, need_upgrade); - } + need_upgrade = bpf_check_upgrade(cmd, d, fcode, flen); } BPFD_UNLOCK(d); if (d->bd_bif != NULL) @@ -1825,7 +1876,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro #endif /* Move d to active readers list. */ - if (need_upgrade) + if (need_upgrade != 0) bpf_upgraded(d); BPF_UNLOCK(); From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 12:30:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id EEE87847; Wed, 11 Jun 2014 12:30:03 +0000 (UTC) Date: Wed, 11 Jun 2014 12:30:03 +0000 From: Alexey Dokuchaev To: Ed Maste Subject: Re: svn commit: r267337 - in head: tools/tools/vt/fontcvt usr.bin usr.bin/vtfontcvt Message-ID: <20140611123003.GC44238@FreeBSD.org> References: <201406101829.s5AITjXP045312@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201406101829.s5AITjXP045312@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 12:30:04 -0000 On Tue, Jun 10, 2014 at 06:29:45PM +0000, Ed Maste wrote: > New Revision: 267337 > URL: http://svnweb.freebsd.org/changeset/base/267337 > > Log: > vt fontcvt: move to usr.bin/vtfontcvt > > vtfontcvt is useful for end users to convert arbitrary bitmap fonts > for use by vt(4). It can also be used as a build tool, allowing us > to keep the source font data in the src tree rather than uuencoded > binaries. Thank you! I'm not very happy with default font, and would like to make my own one. Having it in the base is appreciated. :) ./danfe From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 12:56:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07D334DF; Wed, 11 Jun 2014 12:56:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E92872435; Wed, 11 Jun 2014 12:56:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BCunCW061073; Wed, 11 Jun 2014 12:56:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BCunam061072; Wed, 11 Jun 2014 12:56:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406111256.s5BCunam061072@svn.freebsd.org> From: Alexander Motin Date: Wed, 11 Jun 2014 12:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267362 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 12:56:50 -0000 Author: mav Date: Wed Jun 11 12:56:49 2014 New Revision: 267362 URL: http://svnweb.freebsd.org/changeset/base/267362 Log: Remove unneeded mountlist_mtx acquisition from sync_fsync(). All struct mount fields accessed by sync_fsync() are protected by MNT_MTX. Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Jun 11 11:27:44 2014 (r267361) +++ head/sys/kern/vfs_subr.c Wed Jun 11 12:56:49 2014 (r267362) @@ -3656,11 +3656,8 @@ sync_fsync(struct vop_fsync_args *ap) * Walk the list of vnodes pushing all that are dirty and * not already on the sync list. */ - mtx_lock(&mountlist_mtx); - if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK) != 0) { - mtx_unlock(&mountlist_mtx); + if (vfs_busy(mp, MBF_NOWAIT) != 0) return (0); - } if (vn_start_write(NULL, &mp, V_NOWAIT) != 0) { vfs_unbusy(mp); return (0); From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 13:48:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C883FA5; Wed, 11 Jun 2014 13:48:33 +0000 (UTC) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A3DA2992; Wed, 11 Jun 2014 13:48:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id s5BDmOdS092920; Wed, 11 Jun 2014 17:48:24 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Wed, 11 Jun 2014 17:48:24 +0400 (MSK) From: Dmitry Morozovsky To: "Andrey V. Elsukov" Subject: Re: svn commit: r267357 - head/sys/geom/part In-Reply-To: <201406111019.s5BAJBjW085880@svn.freebsd.org> Message-ID: References: <201406111019.s5BAJBjW085880@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Wed, 11 Jun 2014 17:48:24 +0400 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 13:48:33 -0000 On Wed, 11 Jun 2014, Andrey V. Elsukov wrote: > Author: ae > Date: Wed Jun 11 10:19:11 2014 > New Revision: 267357 > URL: http://svnweb.freebsd.org/changeset/base/267357 > > Log: > Add aliases for DragonFlyBSD's partition types. These should be documented in sbin/geom/class/part/gpart.8 also. [snip] -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 14:54:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1B83705; Wed, 11 Jun 2014 14:54:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B35620BD; Wed, 11 Jun 2014 14:54:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BEs2fN022974; Wed, 11 Jun 2014 14:54:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BErxFT022932; Wed, 11 Jun 2014 14:53:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406111453.s5BErxFT022932@svn.freebsd.org> From: John Baldwin Date: Wed, 11 Jun 2014 14:53:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267363 - in head/sys: arm/at91 arm/cavium/cns11xx dev/ae dev/age dev/alc dev/ale dev/bfe dev/bge dev/dc dev/jme dev/msk dev/nge dev/re dev/sf dev/sge dev/sis dev/sk dev/ste dev/stge de... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 14:54:02 -0000 Author: jhb Date: Wed Jun 11 14:53:58 2014 New Revision: 267363 URL: http://svnweb.freebsd.org/changeset/base/267363 Log: Fix various NIC drivers to properly cleanup static DMA resources. In particular, don't check the value of the bus_dma map against NULL to determine if either bus_dmamem_alloc() or bus_dmamap_load() succeeded. Instead, assume that bus_dmamap_load() succeeeded (and thus that bus_dmamap_unload() should be called) if the bus address for a resource is non-zero, and assume that bus_dmamem_alloc() succeeded (and thus that bus_dmamem_free() should be called) if the virtual address for a resource is not NULL. In many cases these bugs could result in leaks when a driver was detached. Reviewed by: yongari MFC after: 2 weeks Modified: head/sys/arm/at91/if_macb.c head/sys/arm/cavium/cns11xx/if_ece.c head/sys/dev/ae/if_ae.c head/sys/dev/age/if_age.c head/sys/dev/alc/if_alc.c head/sys/dev/ale/if_ale.c head/sys/dev/bfe/if_bfe.c head/sys/dev/bge/if_bge.c head/sys/dev/dc/if_dc.c head/sys/dev/jme/if_jme.c head/sys/dev/msk/if_msk.c head/sys/dev/nge/if_nge.c head/sys/dev/re/if_re.c head/sys/dev/sf/if_sf.c head/sys/dev/sge/if_sge.c head/sys/dev/sis/if_sis.c head/sys/dev/sk/if_sk.c head/sys/dev/ste/if_ste.c head/sys/dev/stge/if_stge.c head/sys/dev/vge/if_vge.c head/sys/dev/vr/if_vr.c head/sys/dev/vte/if_vte.c head/sys/mips/atheros/if_arge.c head/sys/mips/idt/if_kr.c head/sys/pci/if_rl.c Modified: head/sys/arm/at91/if_macb.c ============================================================================== --- head/sys/arm/at91/if_macb.c Wed Jun 11 12:56:49 2014 (r267362) +++ head/sys/arm/at91/if_macb.c Wed Jun 11 14:53:58 2014 (r267363) @@ -258,14 +258,14 @@ macb_free_desc_dma_tx(struct macb_softc /* TX descriptor ring. */ if (sc->dmatag_data_tx != NULL) { - if (sc->dmamap_ring_tx != NULL) + if (sc->ring_paddr_tx != 0) bus_dmamap_unload(sc->dmatag_data_tx, sc->dmamap_ring_tx); - if (sc->dmamap_ring_tx != NULL && sc->desc_tx != NULL) + if (sc->desc_tx != NULL) bus_dmamem_free(sc->dmatag_data_tx, sc->desc_tx, sc->dmamap_ring_tx); - sc->dmamap_ring_tx = NULL; - sc->dmamap_ring_tx = NULL; + sc->ring_paddr_tx = 0; + sc->desc_tx = NULL; bus_dma_tag_destroy(sc->dmatag_data_tx); sc->dmatag_data_tx = NULL; } @@ -389,15 +389,14 @@ macb_free_desc_dma_rx(struct macb_softc } /* RX descriptor ring. */ if (sc->dmatag_data_rx != NULL) { - if (sc->dmamap_ring_rx != NULL) + if (sc->ring_paddr_rx != 0) bus_dmamap_unload(sc->dmatag_data_rx, sc->dmamap_ring_rx); - if (sc->dmamap_ring_rx != NULL && - sc->desc_rx != NULL) + if (sc->desc_rx != NULL) bus_dmamem_free(sc->dmatag_data_rx, sc->desc_rx, sc->dmamap_ring_rx); + sc->ring_paddr_rx = 0; sc->desc_rx = NULL; - sc->dmamap_ring_rx = NULL; bus_dma_tag_destroy(sc->dmatag_data_rx); sc->dmatag_data_rx = NULL; } Modified: head/sys/arm/cavium/cns11xx/if_ece.c ============================================================================== --- head/sys/arm/cavium/cns11xx/if_ece.c Wed Jun 11 12:56:49 2014 (r267362) +++ head/sys/arm/cavium/cns11xx/if_ece.c Wed Jun 11 14:53:58 2014 (r267363) @@ -565,13 +565,15 @@ ece_free_desc_dma_tx(struct ece_softc *s } } - if (sc->dmamap_ring_tx) { + if (sc->ring_paddr_tx) { bus_dmamap_unload(sc->dmatag_data_tx, sc->dmamap_ring_tx); - if (sc->desc_tx) { - bus_dmamem_free(sc->dmatag_data_tx, - sc->desc_tx, sc->dmamap_ring_tx); - } - sc->dmamap_ring_tx = 0; + sc->ring_paddr_tx = 0; + } + + if (sc->desc_tx) { + bus_dmamem_free(sc->dmatag_data_tx, + sc->desc_tx, sc->dmamap_ring_tx); + sc->desc_tx = NULL; } if (sc->dmatag_data_tx) { @@ -679,18 +681,24 @@ ece_free_desc_dma_rx(struct ece_softc *s for (i = 0; i < ECE_MAX_RX_BUFFERS; i++) { if (sc->rx_desc[i].buff) { m_freem(sc->rx_desc[i].buff); - sc->rx_desc[i].buff= 0; + sc->rx_desc[i].buff = NULL; } } - if (sc->dmatag_data_rx) { + if (sc->ring_paddr_rx) { bus_dmamap_unload(sc->dmatag_data_rx, sc->dmamap_ring_rx); + sc->ring_paddr_rx = 0; + } + + if (sc->desc_rx) { bus_dmamem_free(sc->dmatag_data_rx, sc->desc_rx, sc->dmamap_ring_rx); + sc->desc_rx = NULL; + } + + if (sc->dmatag_data_rx) { bus_dma_tag_destroy(sc->dmatag_data_rx); - sc->dmatag_data_rx = 0; - sc->dmamap_ring_rx = 0; - sc->desc_rx = 0; + sc->dmatag_data_rx = NULL; } if (sc->dmatag_ring_rx) { @@ -699,7 +707,7 @@ ece_free_desc_dma_rx(struct ece_softc *s sc->rx_desc[i].dmamap); bus_dmamap_destroy(sc->dmatag_ring_rx, sc->rx_sparemap); bus_dma_tag_destroy(sc->dmatag_ring_rx); - sc->dmatag_ring_rx = 0; + sc->dmatag_ring_rx = NULL; } } Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Wed Jun 11 12:56:49 2014 (r267362) +++ head/sys/dev/ae/if_ae.c Wed Jun 11 14:53:58 2014 (r267363) @@ -1226,43 +1226,37 @@ ae_dma_free(ae_softc_t *sc) { if (sc->dma_txd_tag != NULL) { - if (sc->dma_txd_map != NULL) { + if (sc->dma_txd_busaddr != 0) bus_dmamap_unload(sc->dma_txd_tag, sc->dma_txd_map); - if (sc->txd_base != NULL) - bus_dmamem_free(sc->dma_txd_tag, sc->txd_base, - sc->dma_txd_map); - - } + if (sc->txd_base != NULL) + bus_dmamem_free(sc->dma_txd_tag, sc->txd_base, + sc->dma_txd_map); bus_dma_tag_destroy(sc->dma_txd_tag); - sc->dma_txd_map = NULL; sc->dma_txd_tag = NULL; sc->txd_base = NULL; + sc->dma_txd_busaddr = 0; } if (sc->dma_txs_tag != NULL) { - if (sc->dma_txs_map != NULL) { + if (sc->dma_txs_busaddr != 0) bus_dmamap_unload(sc->dma_txs_tag, sc->dma_txs_map); - if (sc->txs_base != NULL) - bus_dmamem_free(sc->dma_txs_tag, sc->txs_base, - sc->dma_txs_map); - - } + if (sc->txs_base != NULL) + bus_dmamem_free(sc->dma_txs_tag, sc->txs_base, + sc->dma_txs_map); bus_dma_tag_destroy(sc->dma_txs_tag); - sc->dma_txs_map = NULL; sc->dma_txs_tag = NULL; sc->txs_base = NULL; + sc->dma_txs_busaddr = 0; } if (sc->dma_rxd_tag != NULL) { - if (sc->dma_rxd_map != NULL) { + if (sc->dma_rxd_busaddr != 0) bus_dmamap_unload(sc->dma_rxd_tag, sc->dma_rxd_map); - if (sc->rxd_base_dma != NULL) - bus_dmamem_free(sc->dma_rxd_tag, - sc->rxd_base_dma, sc->dma_rxd_map); - - } + if (sc->rxd_base_dma != NULL) + bus_dmamem_free(sc->dma_rxd_tag, sc->rxd_base_dma, + sc->dma_rxd_map); bus_dma_tag_destroy(sc->dma_rxd_tag); - sc->dma_rxd_map = NULL; sc->dma_rxd_tag = NULL; sc->rxd_base_dma = NULL; + sc->dma_rxd_busaddr = 0; } if (sc->dma_parent_tag != NULL) { bus_dma_tag_destroy(sc->dma_parent_tag); Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Wed Jun 11 12:56:49 2014 (r267362) +++ head/sys/dev/age/if_age.c Wed Jun 11 14:53:58 2014 (r267363) @@ -1229,76 +1229,71 @@ age_dma_free(struct age_softc *sc) } /* Tx ring. */ if (sc->age_cdata.age_tx_ring_tag != NULL) { - if (sc->age_cdata.age_tx_ring_map != NULL) + if (sc->age_rdata.age_tx_ring_paddr != 0) bus_dmamap_unload(sc->age_cdata.age_tx_ring_tag, sc->age_cdata.age_tx_ring_map); - if (sc->age_cdata.age_tx_ring_map != NULL && - sc->age_rdata.age_tx_ring != NULL) + if (sc->age_rdata.age_tx_ring != NULL) bus_dmamem_free(sc->age_cdata.age_tx_ring_tag, sc->age_rdata.age_tx_ring, sc->age_cdata.age_tx_ring_map); + sc->age_rdata.age_tx_ring_paddr = 0; sc->age_rdata.age_tx_ring = NULL; - sc->age_cdata.age_tx_ring_map = NULL; bus_dma_tag_destroy(sc->age_cdata.age_tx_ring_tag); sc->age_cdata.age_tx_ring_tag = NULL; } /* Rx ring. */ if (sc->age_cdata.age_rx_ring_tag != NULL) { - if (sc->age_cdata.age_rx_ring_map != NULL) + if (sc->age_rdata.age_rx_ring_paddr != 0) bus_dmamap_unload(sc->age_cdata.age_rx_ring_tag, sc->age_cdata.age_rx_ring_map); - if (sc->age_cdata.age_rx_ring_map != NULL && - sc->age_rdata.age_rx_ring != NULL) + if (sc->age_rdata.age_rx_ring != NULL) bus_dmamem_free(sc->age_cdata.age_rx_ring_tag, sc->age_rdata.age_rx_ring, sc->age_cdata.age_rx_ring_map); + sc->age_rdata.age_rx_ring_paddr = 0; sc->age_rdata.age_rx_ring = NULL; - sc->age_cdata.age_rx_ring_map = NULL; bus_dma_tag_destroy(sc->age_cdata.age_rx_ring_tag); sc->age_cdata.age_rx_ring_tag = NULL; } /* Rx return ring. */ if (sc->age_cdata.age_rr_ring_tag != NULL) { - if (sc->age_cdata.age_rr_ring_map != NULL) + if (sc->age_rdata.age_rr_ring_paddr != 0) bus_dmamap_unload(sc->age_cdata.age_rr_ring_tag, sc->age_cdata.age_rr_ring_map); - if (sc->age_cdata.age_rr_ring_map != NULL && - sc->age_rdata.age_rr_ring != NULL) + if (sc->age_rdata.age_rr_ring != NULL) bus_dmamem_free(sc->age_cdata.age_rr_ring_tag, sc->age_rdata.age_rr_ring, sc->age_cdata.age_rr_ring_map); + sc->age_rdata.age_rr_ring_paddr = 0; sc->age_rdata.age_rr_ring = NULL; - sc->age_cdata.age_rr_ring_map = NULL; bus_dma_tag_destroy(sc->age_cdata.age_rr_ring_tag); sc->age_cdata.age_rr_ring_tag = NULL; } /* CMB block */ if (sc->age_cdata.age_cmb_block_tag != NULL) { - if (sc->age_cdata.age_cmb_block_map != NULL) + if (sc->age_rdata.age_cmb_block_paddr != 0) bus_dmamap_unload(sc->age_cdata.age_cmb_block_tag, sc->age_cdata.age_cmb_block_map); - if (sc->age_cdata.age_cmb_block_map != NULL && - sc->age_rdata.age_cmb_block != NULL) + if (sc->age_rdata.age_cmb_block != NULL) bus_dmamem_free(sc->age_cdata.age_cmb_block_tag, sc->age_rdata.age_cmb_block, sc->age_cdata.age_cmb_block_map); + sc->age_rdata.age_cmb_block_paddr = 0; sc->age_rdata.age_cmb_block = NULL; - sc->age_cdata.age_cmb_block_map = NULL; bus_dma_tag_destroy(sc->age_cdata.age_cmb_block_tag); sc->age_cdata.age_cmb_block_tag = NULL; } /* SMB block */ if (sc->age_cdata.age_smb_block_tag != NULL) { - if (sc->age_cdata.age_smb_block_map != NULL) + if (sc->age_rdata.age_smb_block_paddr != 0) bus_dmamap_unload(sc->age_cdata.age_smb_block_tag, sc->age_cdata.age_smb_block_map); - if (sc->age_cdata.age_smb_block_map != NULL && - sc->age_rdata.age_smb_block != NULL) + if (sc->age_rdata.age_smb_block != NULL) bus_dmamem_free(sc->age_cdata.age_smb_block_tag, sc->age_rdata.age_smb_block, sc->age_cdata.age_smb_block_map); + sc->age_rdata.age_smb_block_paddr = 0; sc->age_rdata.age_smb_block = NULL; - sc->age_cdata.age_smb_block_map = NULL; bus_dma_tag_destroy(sc->age_cdata.age_smb_block_tag); sc->age_cdata.age_smb_block_tag = NULL; } Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Wed Jun 11 12:56:49 2014 (r267362) +++ head/sys/dev/alc/if_alc.c Wed Jun 11 14:53:58 2014 (r267363) @@ -1735,76 +1735,71 @@ alc_dma_free(struct alc_softc *sc) } /* Tx descriptor ring. */ if (sc->alc_cdata.alc_tx_ring_tag != NULL) { - if (sc->alc_cdata.alc_tx_ring_map != NULL) + if (sc->alc_rdata.alc_tx_ring_paddr != 0) bus_dmamap_unload(sc->alc_cdata.alc_tx_ring_tag, sc->alc_cdata.alc_tx_ring_map); - if (sc->alc_cdata.alc_tx_ring_map != NULL && - sc->alc_rdata.alc_tx_ring != NULL) + if (sc->alc_rdata.alc_tx_ring != NULL) bus_dmamem_free(sc->alc_cdata.alc_tx_ring_tag, sc->alc_rdata.alc_tx_ring, sc->alc_cdata.alc_tx_ring_map); + sc->alc_rdata.alc_tx_ring_paddr = 0; sc->alc_rdata.alc_tx_ring = NULL; - sc->alc_cdata.alc_tx_ring_map = NULL; bus_dma_tag_destroy(sc->alc_cdata.alc_tx_ring_tag); sc->alc_cdata.alc_tx_ring_tag = NULL; } /* Rx ring. */ if (sc->alc_cdata.alc_rx_ring_tag != NULL) { - if (sc->alc_cdata.alc_rx_ring_map != NULL) + if (sc->alc_rdata.alc_rx_ring_paddr != 0) bus_dmamap_unload(sc->alc_cdata.alc_rx_ring_tag, sc->alc_cdata.alc_rx_ring_map); - if (sc->alc_cdata.alc_rx_ring_map != NULL && - sc->alc_rdata.alc_rx_ring != NULL) + if (sc->alc_rdata.alc_rx_ring != NULL) bus_dmamem_free(sc->alc_cdata.alc_rx_ring_tag, sc->alc_rdata.alc_rx_ring, sc->alc_cdata.alc_rx_ring_map); + sc->alc_rdata.alc_rx_ring_paddr = 0; sc->alc_rdata.alc_rx_ring = NULL; - sc->alc_cdata.alc_rx_ring_map = NULL; bus_dma_tag_destroy(sc->alc_cdata.alc_rx_ring_tag); sc->alc_cdata.alc_rx_ring_tag = NULL; } /* Rx return ring. */ if (sc->alc_cdata.alc_rr_ring_tag != NULL) { - if (sc->alc_cdata.alc_rr_ring_map != NULL) + if (sc->alc_rdata.alc_rr_ring_paddr != 0) bus_dmamap_unload(sc->alc_cdata.alc_rr_ring_tag, sc->alc_cdata.alc_rr_ring_map); - if (sc->alc_cdata.alc_rr_ring_map != NULL && - sc->alc_rdata.alc_rr_ring != NULL) + if (sc->alc_rdata.alc_rr_ring != NULL) bus_dmamem_free(sc->alc_cdata.alc_rr_ring_tag, sc->alc_rdata.alc_rr_ring, sc->alc_cdata.alc_rr_ring_map); + sc->alc_rdata.alc_rr_ring_paddr = 0; sc->alc_rdata.alc_rr_ring = NULL; - sc->alc_cdata.alc_rr_ring_map = NULL; bus_dma_tag_destroy(sc->alc_cdata.alc_rr_ring_tag); sc->alc_cdata.alc_rr_ring_tag = NULL; } /* CMB block */ if (sc->alc_cdata.alc_cmb_tag != NULL) { - if (sc->alc_cdata.alc_cmb_map != NULL) + if (sc->alc_rdata.alc_cmb_paddr != 0) bus_dmamap_unload(sc->alc_cdata.alc_cmb_tag, sc->alc_cdata.alc_cmb_map); - if (sc->alc_cdata.alc_cmb_map != NULL && - sc->alc_rdata.alc_cmb != NULL) + if (sc->alc_rdata.alc_cmb != NULL) bus_dmamem_free(sc->alc_cdata.alc_cmb_tag, sc->alc_rdata.alc_cmb, - sc->alc_cdata.alc_cmb_map); + sc->alc_cdata.alc_cmb_map); + sc->alc_rdata.alc_cmb_paddr = 0; sc->alc_rdata.alc_cmb = NULL; - sc->alc_cdata.alc_cmb_map = NULL; bus_dma_tag_destroy(sc->alc_cdata.alc_cmb_tag); sc->alc_cdata.alc_cmb_tag = NULL; } /* SMB block */ if (sc->alc_cdata.alc_smb_tag != NULL) { - if (sc->alc_cdata.alc_smb_map != NULL) + if (sc->alc_rdata.alc_smb_paddr != 0) bus_dmamap_unload(sc->alc_cdata.alc_smb_tag, sc->alc_cdata.alc_smb_map); - if (sc->alc_cdata.alc_smb_map != NULL && - sc->alc_rdata.alc_smb != NULL) + if (sc->alc_rdata.alc_smb != NULL) bus_dmamem_free(sc->alc_cdata.alc_smb_tag, sc->alc_rdata.alc_smb, sc->alc_cdata.alc_smb_map); + sc->alc_rdata.alc_smb_paddr = 0; sc->alc_rdata.alc_smb = NULL; - sc->alc_cdata.alc_smb_map = NULL; bus_dma_tag_destroy(sc->alc_cdata.alc_smb_tag); sc->alc_cdata.alc_smb_tag = NULL; } Modified: head/sys/dev/ale/if_ale.c ============================================================================== --- head/sys/dev/ale/if_ale.c Wed Jun 11 12:56:49 2014 (r267362) +++ head/sys/dev/ale/if_ale.c Wed Jun 11 14:53:58 2014 (r267363) @@ -1330,34 +1330,32 @@ ale_dma_free(struct ale_softc *sc) } /* Tx descriptor ring. */ if (sc->ale_cdata.ale_tx_ring_tag != NULL) { - if (sc->ale_cdata.ale_tx_ring_map != NULL) + if (sc->ale_cdata.ale_tx_ring_paddr != 0) bus_dmamap_unload(sc->ale_cdata.ale_tx_ring_tag, sc->ale_cdata.ale_tx_ring_map); - if (sc->ale_cdata.ale_tx_ring_map != NULL && - sc->ale_cdata.ale_tx_ring != NULL) + if (sc->ale_cdata.ale_tx_ring != NULL) bus_dmamem_free(sc->ale_cdata.ale_tx_ring_tag, sc->ale_cdata.ale_tx_ring, sc->ale_cdata.ale_tx_ring_map); + sc->ale_cdata.ale_tx_ring_paddr = 0; sc->ale_cdata.ale_tx_ring = NULL; - sc->ale_cdata.ale_tx_ring_map = NULL; bus_dma_tag_destroy(sc->ale_cdata.ale_tx_ring_tag); sc->ale_cdata.ale_tx_ring_tag = NULL; } /* Rx page block. */ for (i = 0; i < ALE_RX_PAGES; i++) { if (sc->ale_cdata.ale_rx_page[i].page_tag != NULL) { - if (sc->ale_cdata.ale_rx_page[i].page_map != NULL) + if (sc->ale_cdata.ale_rx_page[i].page_paddr != 0) bus_dmamap_unload( sc->ale_cdata.ale_rx_page[i].page_tag, sc->ale_cdata.ale_rx_page[i].page_map); - if (sc->ale_cdata.ale_rx_page[i].page_map != NULL && - sc->ale_cdata.ale_rx_page[i].page_addr != NULL) + if (sc->ale_cdata.ale_rx_page[i].page_addr != NULL) bus_dmamem_free( sc->ale_cdata.ale_rx_page[i].page_tag, sc->ale_cdata.ale_rx_page[i].page_addr, sc->ale_cdata.ale_rx_page[i].page_map); + sc->ale_cdata.ale_rx_page[i].page_paddr = 0; sc->ale_cdata.ale_rx_page[i].page_addr = NULL; - sc->ale_cdata.ale_rx_page[i].page_map = NULL; bus_dma_tag_destroy( sc->ale_cdata.ale_rx_page[i].page_tag); sc->ale_cdata.ale_rx_page[i].page_tag = NULL; @@ -1366,18 +1364,17 @@ ale_dma_free(struct ale_softc *sc) /* Rx CMB. */ for (i = 0; i < ALE_RX_PAGES; i++) { if (sc->ale_cdata.ale_rx_page[i].cmb_tag != NULL) { - if (sc->ale_cdata.ale_rx_page[i].cmb_map != NULL) + if (sc->ale_cdata.ale_rx_page[i].cmb_paddr != 0) bus_dmamap_unload( sc->ale_cdata.ale_rx_page[i].cmb_tag, sc->ale_cdata.ale_rx_page[i].cmb_map); - if (sc->ale_cdata.ale_rx_page[i].cmb_map != NULL && - sc->ale_cdata.ale_rx_page[i].cmb_addr != NULL) + if (sc->ale_cdata.ale_rx_page[i].cmb_addr != NULL) bus_dmamem_free( sc->ale_cdata.ale_rx_page[i].cmb_tag, sc->ale_cdata.ale_rx_page[i].cmb_addr, sc->ale_cdata.ale_rx_page[i].cmb_map); + sc->ale_cdata.ale_rx_page[i].cmb_paddr = 0; sc->ale_cdata.ale_rx_page[i].cmb_addr = NULL; - sc->ale_cdata.ale_rx_page[i].cmb_map = NULL; bus_dma_tag_destroy( sc->ale_cdata.ale_rx_page[i].cmb_tag); sc->ale_cdata.ale_rx_page[i].cmb_tag = NULL; @@ -1385,16 +1382,15 @@ ale_dma_free(struct ale_softc *sc) } /* Tx CMB. */ if (sc->ale_cdata.ale_tx_cmb_tag != NULL) { - if (sc->ale_cdata.ale_tx_cmb_map != NULL) + if (sc->ale_cdata.ale_tx_cmb_paddr != 0) bus_dmamap_unload(sc->ale_cdata.ale_tx_cmb_tag, sc->ale_cdata.ale_tx_cmb_map); - if (sc->ale_cdata.ale_tx_cmb_map != NULL && - sc->ale_cdata.ale_tx_cmb != NULL) + if (sc->ale_cdata.ale_tx_cmb != NULL) bus_dmamem_free(sc->ale_cdata.ale_tx_cmb_tag, sc->ale_cdata.ale_tx_cmb, sc->ale_cdata.ale_tx_cmb_map); + sc->ale_cdata.ale_tx_cmb_paddr = 0; sc->ale_cdata.ale_tx_cmb = NULL; - sc->ale_cdata.ale_tx_cmb_map = NULL; bus_dma_tag_destroy(sc->ale_cdata.ale_tx_cmb_tag); sc->ale_cdata.ale_tx_cmb_tag = NULL; } Modified: head/sys/dev/bfe/if_bfe.c ============================================================================== --- head/sys/dev/bfe/if_bfe.c Wed Jun 11 12:56:49 2014 (r267362) +++ head/sys/dev/bfe/if_bfe.c Wed Jun 11 14:53:58 2014 (r267363) @@ -364,12 +364,12 @@ bfe_dma_free(struct bfe_softc *sc) /* Tx ring. */ if (sc->bfe_tx_tag != NULL) { - if (sc->bfe_tx_map != NULL) + if (sc->bfe_tx_dma != 0) bus_dmamap_unload(sc->bfe_tx_tag, sc->bfe_tx_map); - if (sc->bfe_tx_map != NULL && sc->bfe_tx_list != NULL) + if (sc->bfe_tx_list != NULL) bus_dmamem_free(sc->bfe_tx_tag, sc->bfe_tx_list, sc->bfe_tx_map); - sc->bfe_tx_map = NULL; + sc->bfe_tx_dma = 0; sc->bfe_tx_list = NULL; bus_dma_tag_destroy(sc->bfe_tx_tag); sc->bfe_tx_tag = NULL; @@ -377,12 +377,12 @@ bfe_dma_free(struct bfe_softc *sc) /* Rx ring. */ if (sc->bfe_rx_tag != NULL) { - if (sc->bfe_rx_map != NULL) + if (sc->bfe_rx_dma != 0) bus_dmamap_unload(sc->bfe_rx_tag, sc->bfe_rx_map); - if (sc->bfe_rx_map != NULL && sc->bfe_rx_list != NULL) + if (sc->bfe_rx_list != NULL) bus_dmamem_free(sc->bfe_rx_tag, sc->bfe_rx_list, sc->bfe_rx_map); - sc->bfe_rx_map = NULL; + sc->bfe_rx_dma = 0; sc->bfe_rx_list = NULL; bus_dma_tag_destroy(sc->bfe_rx_tag); sc->bfe_rx_tag = NULL; Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Wed Jun 11 12:56:49 2014 (r267362) +++ head/sys/dev/bge/if_bge.c Wed Jun 11 14:53:58 2014 (r267363) @@ -2817,10 +2817,10 @@ bge_dma_free(struct bge_softc *sc) bus_dma_tag_destroy(sc->bge_cdata.bge_tx_mtag); /* Destroy standard RX ring. */ - if (sc->bge_cdata.bge_rx_std_ring_map) + if (sc->bge_ldata.bge_rx_std_ring_paddr) bus_dmamap_unload(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map); - if (sc->bge_cdata.bge_rx_std_ring_map && sc->bge_ldata.bge_rx_std_ring) + if (sc->bge_ldata.bge_rx_std_ring) bus_dmamem_free(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_ldata.bge_rx_std_ring, sc->bge_cdata.bge_rx_std_ring_map); @@ -2829,12 +2829,11 @@ bge_dma_free(struct bge_softc *sc) bus_dma_tag_destroy(sc->bge_cdata.bge_rx_std_ring_tag); /* Destroy jumbo RX ring. */ - if (sc->bge_cdata.bge_rx_jumbo_ring_map) + if (sc->bge_ldata.bge_rx_jumbo_ring_paddr) bus_dmamap_unload(sc->bge_cdata.bge_rx_jumbo_ring_tag, sc->bge_cdata.bge_rx_jumbo_ring_map); - if (sc->bge_cdata.bge_rx_jumbo_ring_map && - sc->bge_ldata.bge_rx_jumbo_ring) + if (sc->bge_ldata.bge_rx_jumbo_ring) bus_dmamem_free(sc->bge_cdata.bge_rx_jumbo_ring_tag, sc->bge_ldata.bge_rx_jumbo_ring, sc->bge_cdata.bge_rx_jumbo_ring_map); @@ -2843,12 +2842,11 @@ bge_dma_free(struct bge_softc *sc) bus_dma_tag_destroy(sc->bge_cdata.bge_rx_jumbo_ring_tag); /* Destroy RX return ring. */ - if (sc->bge_cdata.bge_rx_return_ring_map) + if (sc->bge_ldata.bge_rx_return_ring_paddr) bus_dmamap_unload(sc->bge_cdata.bge_rx_return_ring_tag, sc->bge_cdata.bge_rx_return_ring_map); - if (sc->bge_cdata.bge_rx_return_ring_map && - sc->bge_ldata.bge_rx_return_ring) + if (sc->bge_ldata.bge_rx_return_ring) bus_dmamem_free(sc->bge_cdata.bge_rx_return_ring_tag, sc->bge_ldata.bge_rx_return_ring, sc->bge_cdata.bge_rx_return_ring_map); @@ -2857,11 +2855,11 @@ bge_dma_free(struct bge_softc *sc) bus_dma_tag_destroy(sc->bge_cdata.bge_rx_return_ring_tag); /* Destroy TX ring. */ - if (sc->bge_cdata.bge_tx_ring_map) + if (sc->bge_ldata.bge_tx_ring_paddr) bus_dmamap_unload(sc->bge_cdata.bge_tx_ring_tag, sc->bge_cdata.bge_tx_ring_map); - if (sc->bge_cdata.bge_tx_ring_map && sc->bge_ldata.bge_tx_ring) + if (sc->bge_ldata.bge_tx_ring) bus_dmamem_free(sc->bge_cdata.bge_tx_ring_tag, sc->bge_ldata.bge_tx_ring, sc->bge_cdata.bge_tx_ring_map); @@ -2870,11 +2868,11 @@ bge_dma_free(struct bge_softc *sc) bus_dma_tag_destroy(sc->bge_cdata.bge_tx_ring_tag); /* Destroy status block. */ - if (sc->bge_cdata.bge_status_map) + if (sc->bge_ldata.bge_status_block_paddr) bus_dmamap_unload(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map); - if (sc->bge_cdata.bge_status_map && sc->bge_ldata.bge_status_block) + if (sc->bge_ldata.bge_status_block) bus_dmamem_free(sc->bge_cdata.bge_status_tag, sc->bge_ldata.bge_status_block, sc->bge_cdata.bge_status_map); @@ -2883,11 +2881,11 @@ bge_dma_free(struct bge_softc *sc) bus_dma_tag_destroy(sc->bge_cdata.bge_status_tag); /* Destroy statistics block. */ - if (sc->bge_cdata.bge_stats_map) + if (sc->bge_ldata.bge_stats_paddr) bus_dmamap_unload(sc->bge_cdata.bge_stats_tag, sc->bge_cdata.bge_stats_map); - if (sc->bge_cdata.bge_stats_map && sc->bge_ldata.bge_stats) + if (sc->bge_ldata.bge_stats) bus_dmamem_free(sc->bge_cdata.bge_stats_tag, sc->bge_ldata.bge_stats, sc->bge_cdata.bge_stats_map); Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Wed Jun 11 12:56:49 2014 (r267362) +++ head/sys/dev/dc/if_dc.c Wed Jun 11 14:53:58 2014 (r267363) @@ -1982,9 +1982,9 @@ dc_dma_free(struct dc_softc *sc) /* RX descriptor list. */ if (sc->dc_rx_ltag) { - if (sc->dc_rx_lmap != NULL) + if (sc->dc_ldata.dc_rx_list_paddr != 0) bus_dmamap_unload(sc->dc_rx_ltag, sc->dc_rx_lmap); - if (sc->dc_rx_lmap != NULL && sc->dc_ldata.dc_rx_list != NULL) + if (sc->dc_ldata.dc_rx_list != NULL) bus_dmamem_free(sc->dc_rx_ltag, sc->dc_ldata.dc_rx_list, sc->dc_rx_lmap); bus_dma_tag_destroy(sc->dc_rx_ltag); @@ -1992,9 +1992,9 @@ dc_dma_free(struct dc_softc *sc) /* TX descriptor list. */ if (sc->dc_tx_ltag) { - if (sc->dc_tx_lmap != NULL) + if (sc->dc_ldata.dc_tx_list_paddr != 0) bus_dmamap_unload(sc->dc_tx_ltag, sc->dc_tx_lmap); - if (sc->dc_tx_lmap != NULL && sc->dc_ldata.dc_tx_list != NULL) + if (sc->dc_ldata.dc_tx_list != NULL) bus_dmamem_free(sc->dc_tx_ltag, sc->dc_ldata.dc_tx_list, sc->dc_tx_lmap); bus_dma_tag_destroy(sc->dc_tx_ltag); @@ -2002,9 +2002,9 @@ dc_dma_free(struct dc_softc *sc) /* multicast setup frame. */ if (sc->dc_stag) { - if (sc->dc_smap != NULL) + if (sc->dc_saddr != 0) bus_dmamap_unload(sc->dc_stag, sc->dc_smap); - if (sc->dc_smap != NULL && sc->dc_cdata.dc_sbuf != NULL) + if (sc->dc_cdata.dc_sbuf != NULL) bus_dmamem_free(sc->dc_stag, sc->dc_cdata.dc_sbuf, sc->dc_smap); bus_dma_tag_destroy(sc->dc_stag); Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Wed Jun 11 12:56:49 2014 (r267362) +++ head/sys/dev/jme/if_jme.c Wed Jun 11 14:53:58 2014 (r267363) @@ -1408,31 +1408,29 @@ jme_dma_free(struct jme_softc *sc) /* Tx ring */ if (sc->jme_cdata.jme_tx_ring_tag != NULL) { - if (sc->jme_cdata.jme_tx_ring_map) + if (sc->jme_rdata.jme_tx_ring_paddr) bus_dmamap_unload(sc->jme_cdata.jme_tx_ring_tag, sc->jme_cdata.jme_tx_ring_map); - if (sc->jme_cdata.jme_tx_ring_map && - sc->jme_rdata.jme_tx_ring) + if (sc->jme_rdata.jme_tx_ring) bus_dmamem_free(sc->jme_cdata.jme_tx_ring_tag, sc->jme_rdata.jme_tx_ring, sc->jme_cdata.jme_tx_ring_map); sc->jme_rdata.jme_tx_ring = NULL; - sc->jme_cdata.jme_tx_ring_map = NULL; + sc->jme_rdata.jme_tx_ring_paddr = 0; bus_dma_tag_destroy(sc->jme_cdata.jme_tx_ring_tag); sc->jme_cdata.jme_tx_ring_tag = NULL; } /* Rx ring */ if (sc->jme_cdata.jme_rx_ring_tag != NULL) { - if (sc->jme_cdata.jme_rx_ring_map) + if (sc->jme_rdata.jme_rx_ring_paddr) bus_dmamap_unload(sc->jme_cdata.jme_rx_ring_tag, sc->jme_cdata.jme_rx_ring_map); - if (sc->jme_cdata.jme_rx_ring_map && - sc->jme_rdata.jme_rx_ring) + if (sc->jme_rdata.jme_rx_ring) bus_dmamem_free(sc->jme_cdata.jme_rx_ring_tag, sc->jme_rdata.jme_rx_ring, sc->jme_cdata.jme_rx_ring_map); sc->jme_rdata.jme_rx_ring = NULL; - sc->jme_cdata.jme_rx_ring_map = NULL; + sc->jme_rdata.jme_rx_ring_paddr = 0; bus_dma_tag_destroy(sc->jme_cdata.jme_rx_ring_tag); sc->jme_cdata.jme_rx_ring_tag = NULL; } @@ -1470,15 +1468,15 @@ jme_dma_free(struct jme_softc *sc) /* Shared status block. */ if (sc->jme_cdata.jme_ssb_tag != NULL) { - if (sc->jme_cdata.jme_ssb_map) + if (sc->jme_rdata.jme_ssb_block_paddr) bus_dmamap_unload(sc->jme_cdata.jme_ssb_tag, sc->jme_cdata.jme_ssb_map); - if (sc->jme_cdata.jme_ssb_map && sc->jme_rdata.jme_ssb_block) + if (sc->jme_rdata.jme_ssb_block) bus_dmamem_free(sc->jme_cdata.jme_ssb_tag, sc->jme_rdata.jme_ssb_block, sc->jme_cdata.jme_ssb_map); sc->jme_rdata.jme_ssb_block = NULL; - sc->jme_cdata.jme_ssb_map = NULL; + sc->jme_rdata.jme_ssb_block_paddr = 0; bus_dma_tag_destroy(sc->jme_cdata.jme_ssb_tag); sc->jme_cdata.jme_ssb_tag = NULL; } Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Wed Jun 11 12:56:49 2014 (r267362) +++ head/sys/dev/msk/if_msk.c Wed Jun 11 14:53:58 2014 (r267363) @@ -2209,14 +2209,14 @@ msk_status_dma_free(struct msk_softc *sc /* Destroy status block. */ if (sc->msk_stat_tag) { - if (sc->msk_stat_map) { + if (sc->msk_stat_ring_paddr) { bus_dmamap_unload(sc->msk_stat_tag, sc->msk_stat_map); - if (sc->msk_stat_ring) { - bus_dmamem_free(sc->msk_stat_tag, - sc->msk_stat_ring, sc->msk_stat_map); - sc->msk_stat_ring = NULL; - } - sc->msk_stat_map = NULL; + sc->msk_stat_ring_paddr = 0; + } + if (sc->msk_stat_ring) { + bus_dmamem_free(sc->msk_stat_tag, + sc->msk_stat_ring, sc->msk_stat_map); + sc->msk_stat_ring = NULL; } bus_dma_tag_destroy(sc->msk_stat_tag); sc->msk_stat_tag = NULL; @@ -2527,31 +2527,29 @@ msk_txrx_dma_free(struct msk_if_softc *s /* Tx ring. */ if (sc_if->msk_cdata.msk_tx_ring_tag) { - if (sc_if->msk_cdata.msk_tx_ring_map) + if (sc_if->msk_rdata.msk_tx_ring_paddr) bus_dmamap_unload(sc_if->msk_cdata.msk_tx_ring_tag, sc_if->msk_cdata.msk_tx_ring_map); - if (sc_if->msk_cdata.msk_tx_ring_map && - sc_if->msk_rdata.msk_tx_ring) + if (sc_if->msk_rdata.msk_tx_ring) bus_dmamem_free(sc_if->msk_cdata.msk_tx_ring_tag, sc_if->msk_rdata.msk_tx_ring, sc_if->msk_cdata.msk_tx_ring_map); sc_if->msk_rdata.msk_tx_ring = NULL; - sc_if->msk_cdata.msk_tx_ring_map = NULL; + sc_if->msk_rdata.msk_tx_ring_paddr = 0; bus_dma_tag_destroy(sc_if->msk_cdata.msk_tx_ring_tag); sc_if->msk_cdata.msk_tx_ring_tag = NULL; } /* Rx ring. */ if (sc_if->msk_cdata.msk_rx_ring_tag) { - if (sc_if->msk_cdata.msk_rx_ring_map) + if (sc_if->msk_rdata.msk_rx_ring_paddr) bus_dmamap_unload(sc_if->msk_cdata.msk_rx_ring_tag, sc_if->msk_cdata.msk_rx_ring_map); - if (sc_if->msk_cdata.msk_rx_ring_map && - sc_if->msk_rdata.msk_rx_ring) + if (sc_if->msk_rdata.msk_rx_ring) bus_dmamem_free(sc_if->msk_cdata.msk_rx_ring_tag, sc_if->msk_rdata.msk_rx_ring, sc_if->msk_cdata.msk_rx_ring_map); sc_if->msk_rdata.msk_rx_ring = NULL; - sc_if->msk_cdata.msk_rx_ring_map = NULL; + sc_if->msk_rdata.msk_rx_ring_paddr = 0; bus_dma_tag_destroy(sc_if->msk_cdata.msk_rx_ring_tag); sc_if->msk_cdata.msk_rx_ring_tag = NULL; } @@ -2600,16 +2598,15 @@ msk_rx_dma_jfree(struct msk_if_softc *sc /* Jumbo Rx ring. */ if (sc_if->msk_cdata.msk_jumbo_rx_ring_tag) { - if (sc_if->msk_cdata.msk_jumbo_rx_ring_map) + if (sc_if->msk_rdata.msk_jumbo_rx_ring_paddr) bus_dmamap_unload(sc_if->msk_cdata.msk_jumbo_rx_ring_tag, sc_if->msk_cdata.msk_jumbo_rx_ring_map); - if (sc_if->msk_cdata.msk_jumbo_rx_ring_map && - sc_if->msk_rdata.msk_jumbo_rx_ring) + if (sc_if->msk_rdata.msk_jumbo_rx_ring) bus_dmamem_free(sc_if->msk_cdata.msk_jumbo_rx_ring_tag, sc_if->msk_rdata.msk_jumbo_rx_ring, sc_if->msk_cdata.msk_jumbo_rx_ring_map); sc_if->msk_rdata.msk_jumbo_rx_ring = NULL; - sc_if->msk_cdata.msk_jumbo_rx_ring_map = NULL; + sc_if->msk_rdata.msk_jumbo_rx_ring_paddr = 0; bus_dma_tag_destroy(sc_if->msk_cdata.msk_jumbo_rx_ring_tag); sc_if->msk_cdata.msk_jumbo_rx_ring_tag = NULL; } Modified: head/sys/dev/nge/if_nge.c ============================================================================== --- head/sys/dev/nge/if_nge.c Wed Jun 11 12:56:49 2014 (r267362) +++ head/sys/dev/nge/if_nge.c Wed Jun 11 14:53:58 2014 (r267363) @@ -1225,31 +1225,29 @@ nge_dma_free(struct nge_softc *sc) /* Tx ring. */ if (sc->nge_cdata.nge_tx_ring_tag) { - if (sc->nge_cdata.nge_tx_ring_map) + if (sc->nge_rdata.nge_tx_ring_paddr) bus_dmamap_unload(sc->nge_cdata.nge_tx_ring_tag, sc->nge_cdata.nge_tx_ring_map); - if (sc->nge_cdata.nge_tx_ring_map && - sc->nge_rdata.nge_tx_ring) + if (sc->nge_rdata.nge_tx_ring) bus_dmamem_free(sc->nge_cdata.nge_tx_ring_tag, sc->nge_rdata.nge_tx_ring, sc->nge_cdata.nge_tx_ring_map); sc->nge_rdata.nge_tx_ring = NULL; - sc->nge_cdata.nge_tx_ring_map = NULL; + sc->nge_rdata.nge_tx_ring_paddr = 0; bus_dma_tag_destroy(sc->nge_cdata.nge_tx_ring_tag); sc->nge_cdata.nge_tx_ring_tag = NULL; } /* Rx ring. */ if (sc->nge_cdata.nge_rx_ring_tag) { - if (sc->nge_cdata.nge_rx_ring_map) + if (sc->nge_rdata.nge_rx_ring_paddr) bus_dmamap_unload(sc->nge_cdata.nge_rx_ring_tag, sc->nge_cdata.nge_rx_ring_map); - if (sc->nge_cdata.nge_rx_ring_map && - sc->nge_rdata.nge_rx_ring) + if (sc->nge_rdata.nge_rx_ring) bus_dmamem_free(sc->nge_cdata.nge_rx_ring_tag, sc->nge_rdata.nge_rx_ring, sc->nge_cdata.nge_rx_ring_map); sc->nge_rdata.nge_rx_ring = NULL; - sc->nge_cdata.nge_rx_ring_map = NULL; + sc->nge_rdata.nge_rx_ring_paddr = 0; bus_dma_tag_destroy(sc->nge_cdata.nge_rx_ring_tag); sc->nge_cdata.nge_rx_ring_tag = NULL; } Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Wed Jun 11 12:56:49 2014 (r267362) +++ head/sys/dev/re/if_re.c Wed Jun 11 14:53:58 2014 (r267363) @@ -1818,10 +1818,10 @@ re_detach(device_t dev) /* Unload and free the RX DMA ring memory and map */ if (sc->rl_ldata.rl_rx_list_tag) { - if (sc->rl_ldata.rl_rx_list_map) + if (sc->rl_ldata.rl_rx_list_addr) bus_dmamap_unload(sc->rl_ldata.rl_rx_list_tag, sc->rl_ldata.rl_rx_list_map); - if (sc->rl_ldata.rl_rx_list_map && sc->rl_ldata.rl_rx_list) + if (sc->rl_ldata.rl_rx_list) bus_dmamem_free(sc->rl_ldata.rl_rx_list_tag, sc->rl_ldata.rl_rx_list, sc->rl_ldata.rl_rx_list_map); @@ -1831,10 +1831,10 @@ re_detach(device_t dev) /* Unload and free the TX DMA ring memory and map */ if (sc->rl_ldata.rl_tx_list_tag) { - if (sc->rl_ldata.rl_tx_list_map) + if (sc->rl_ldata.rl_tx_list_addr) bus_dmamap_unload(sc->rl_ldata.rl_tx_list_tag, sc->rl_ldata.rl_tx_list_map); - if (sc->rl_ldata.rl_tx_list_map && sc->rl_ldata.rl_tx_list) + if (sc->rl_ldata.rl_tx_list) bus_dmamem_free(sc->rl_ldata.rl_tx_list_tag, sc->rl_ldata.rl_tx_list, sc->rl_ldata.rl_tx_list_map); @@ -1876,10 +1876,10 @@ re_detach(device_t dev) /* Unload and free the stats buffer and map */ if (sc->rl_ldata.rl_stag) { - if (sc->rl_ldata.rl_smap) + if (sc->rl_ldata.rl_stats_addr) bus_dmamap_unload(sc->rl_ldata.rl_stag, sc->rl_ldata.rl_smap); - if (sc->rl_ldata.rl_smap && sc->rl_ldata.rl_stats) + if (sc->rl_ldata.rl_stats) bus_dmamem_free(sc->rl_ldata.rl_stag, sc->rl_ldata.rl_stats, sc->rl_ldata.rl_smap); bus_dma_tag_destroy(sc->rl_ldata.rl_stag); Modified: head/sys/dev/sf/if_sf.c ============================================================================== --- head/sys/dev/sf/if_sf.c Wed Jun 11 12:56:49 2014 (r267362) +++ head/sys/dev/sf/if_sf.c Wed Jun 11 14:53:58 2014 (r267363) @@ -1292,61 +1292,57 @@ sf_dma_free(struct sf_softc *sc) /* Tx ring. */ if (sc->sf_cdata.sf_tx_ring_tag) { - if (sc->sf_cdata.sf_tx_ring_map) + if (sc->sf_rdata.sf_tx_ring_paddr) bus_dmamap_unload(sc->sf_cdata.sf_tx_ring_tag, sc->sf_cdata.sf_tx_ring_map); - if (sc->sf_cdata.sf_tx_ring_map && - sc->sf_rdata.sf_tx_ring) + if (sc->sf_rdata.sf_tx_ring) bus_dmamem_free(sc->sf_cdata.sf_tx_ring_tag, sc->sf_rdata.sf_tx_ring, sc->sf_cdata.sf_tx_ring_map); sc->sf_rdata.sf_tx_ring = NULL; - sc->sf_cdata.sf_tx_ring_map = NULL; + sc->sf_rdata.sf_tx_ring_paddr = 0; bus_dma_tag_destroy(sc->sf_cdata.sf_tx_ring_tag); sc->sf_cdata.sf_tx_ring_tag = NULL; } /* Tx completion ring. */ if (sc->sf_cdata.sf_tx_cring_tag) { - if (sc->sf_cdata.sf_tx_cring_map) + if (sc->sf_rdata.sf_tx_cring_paddr) bus_dmamap_unload(sc->sf_cdata.sf_tx_cring_tag, sc->sf_cdata.sf_tx_cring_map); - if (sc->sf_cdata.sf_tx_cring_map && - sc->sf_rdata.sf_tx_cring) + if (sc->sf_rdata.sf_tx_cring) bus_dmamem_free(sc->sf_cdata.sf_tx_cring_tag, sc->sf_rdata.sf_tx_cring, sc->sf_cdata.sf_tx_cring_map); sc->sf_rdata.sf_tx_cring = NULL; - sc->sf_cdata.sf_tx_cring_map = NULL; + sc->sf_rdata.sf_tx_cring_paddr = 0; bus_dma_tag_destroy(sc->sf_cdata.sf_tx_cring_tag); sc->sf_cdata.sf_tx_cring_tag = NULL; } /* Rx ring. */ if (sc->sf_cdata.sf_rx_ring_tag) { - if (sc->sf_cdata.sf_rx_ring_map) + if (sc->sf_rdata.sf_rx_ring_paddr) bus_dmamap_unload(sc->sf_cdata.sf_rx_ring_tag, sc->sf_cdata.sf_rx_ring_map); - if (sc->sf_cdata.sf_rx_ring_map && - sc->sf_rdata.sf_rx_ring) + if (sc->sf_rdata.sf_rx_ring) bus_dmamem_free(sc->sf_cdata.sf_rx_ring_tag, sc->sf_rdata.sf_rx_ring, sc->sf_cdata.sf_rx_ring_map); sc->sf_rdata.sf_rx_ring = NULL; - sc->sf_cdata.sf_rx_ring_map = NULL; + sc->sf_rdata.sf_rx_ring_paddr = 0; bus_dma_tag_destroy(sc->sf_cdata.sf_rx_ring_tag); sc->sf_cdata.sf_rx_ring_tag = NULL; } /* Rx completion ring. */ if (sc->sf_cdata.sf_rx_cring_tag) { - if (sc->sf_cdata.sf_rx_cring_map) + if (sc->sf_rdata.sf_rx_cring_paddr) bus_dmamap_unload(sc->sf_cdata.sf_rx_cring_tag, sc->sf_cdata.sf_rx_cring_map); - if (sc->sf_cdata.sf_rx_cring_map && - sc->sf_rdata.sf_rx_cring) + if (sc->sf_rdata.sf_rx_cring) bus_dmamem_free(sc->sf_cdata.sf_rx_cring_tag, sc->sf_rdata.sf_rx_cring, sc->sf_cdata.sf_rx_cring_map); sc->sf_rdata.sf_rx_cring = NULL; - sc->sf_cdata.sf_rx_cring_map = NULL; + sc->sf_rdata.sf_rx_cring_paddr = 0; bus_dma_tag_destroy(sc->sf_cdata.sf_rx_cring_tag); sc->sf_cdata.sf_rx_cring_tag = NULL; } Modified: head/sys/dev/sge/if_sge.c ============================================================================== --- head/sys/dev/sge/if_sge.c Wed Jun 11 12:56:49 2014 (r267362) +++ head/sys/dev/sge/if_sge.c Wed Jun 11 14:53:58 2014 (r267363) @@ -916,25 +916,25 @@ sge_dma_free(struct sge_softc *sc) ld = &sc->sge_ldata; /* Rx ring. */ if (cd->sge_rx_tag != NULL) { - if (cd->sge_rx_dmamap != NULL) + if (ld->sge_rx_paddr != 0) bus_dmamap_unload(cd->sge_rx_tag, cd->sge_rx_dmamap); - if (cd->sge_rx_dmamap != NULL && ld->sge_rx_ring != NULL) + if (ld->sge_rx_ring != NULL) bus_dmamem_free(cd->sge_rx_tag, ld->sge_rx_ring, cd->sge_rx_dmamap); ld->sge_rx_ring = NULL; - cd->sge_rx_dmamap = NULL; + ld->sge_rx_paddr = 0; bus_dma_tag_destroy(cd->sge_rx_tag); cd->sge_rx_tag = NULL; } /* Tx ring. */ if (cd->sge_tx_tag != NULL) { - if (cd->sge_tx_dmamap != NULL) + if (ld->sge_tx_paddr != 0) bus_dmamap_unload(cd->sge_tx_tag, cd->sge_tx_dmamap); - if (cd->sge_tx_dmamap != NULL && ld->sge_tx_ring != NULL) + if (ld->sge_tx_ring != NULL) bus_dmamem_free(cd->sge_tx_tag, ld->sge_tx_ring, cd->sge_tx_dmamap); ld->sge_tx_ring = NULL; - cd->sge_tx_dmamap = NULL; + ld->sge_tx_paddr = 0; bus_dma_tag_destroy(cd->sge_tx_tag); cd->sge_tx_tag = NULL; } Modified: head/sys/dev/sis/if_sis.c ============================================================================== --- head/sys/dev/sis/if_sis.c Wed Jun 11 12:56:49 2014 (r267362) +++ head/sys/dev/sis/if_sis.c Wed Jun 11 14:53:58 2014 (r267363) @@ -1329,9 +1329,9 @@ sis_dma_free(struct sis_softc *sc) bus_dma_tag_destroy(sc->sis_tx_tag); /* Destroy RX ring. */ - if (sc->sis_rx_list_map) + if (sc->sis_rx_paddr) bus_dmamap_unload(sc->sis_rx_list_tag, sc->sis_rx_list_map); - if (sc->sis_rx_list_map && sc->sis_rx_list) + if (sc->sis_rx_list) bus_dmamem_free(sc->sis_rx_list_tag, sc->sis_rx_list, sc->sis_rx_list_map); @@ -1339,10 +1339,10 @@ sis_dma_free(struct sis_softc *sc) bus_dma_tag_destroy(sc->sis_rx_list_tag); /* Destroy TX ring. */ - if (sc->sis_tx_list_map) + if (sc->sis_tx_paddr) bus_dmamap_unload(sc->sis_tx_list_tag, sc->sis_tx_list_map); - if (sc->sis_tx_list_map && sc->sis_tx_list) + if (sc->sis_tx_list) bus_dmamem_free(sc->sis_tx_list_tag, sc->sis_tx_list, sc->sis_tx_list_map); Modified: head/sys/dev/sk/if_sk.c ============================================================================== --- head/sys/dev/sk/if_sk.c Wed Jun 11 12:56:49 2014 (r267362) +++ head/sys/dev/sk/if_sk.c Wed Jun 11 14:53:58 2014 (r267363) @@ -2223,31 +2223,29 @@ sk_dma_free(sc_if) /* Tx ring */ if (sc_if->sk_cdata.sk_tx_ring_tag) { - if (sc_if->sk_cdata.sk_tx_ring_map) + if (sc_if->sk_rdata.sk_tx_ring_paddr) bus_dmamap_unload(sc_if->sk_cdata.sk_tx_ring_tag, sc_if->sk_cdata.sk_tx_ring_map); - if (sc_if->sk_cdata.sk_tx_ring_map && - sc_if->sk_rdata.sk_tx_ring) + if (sc_if->sk_rdata.sk_tx_ring) bus_dmamem_free(sc_if->sk_cdata.sk_tx_ring_tag, sc_if->sk_rdata.sk_tx_ring, sc_if->sk_cdata.sk_tx_ring_map); sc_if->sk_rdata.sk_tx_ring = NULL; - sc_if->sk_cdata.sk_tx_ring_map = NULL; + sc_if->sk_rdata.sk_tx_ring_paddr = 0; bus_dma_tag_destroy(sc_if->sk_cdata.sk_tx_ring_tag); sc_if->sk_cdata.sk_tx_ring_tag = NULL; } /* Rx ring */ if (sc_if->sk_cdata.sk_rx_ring_tag) { - if (sc_if->sk_cdata.sk_rx_ring_map) + if (sc_if->sk_rdata.sk_rx_ring_paddr) bus_dmamap_unload(sc_if->sk_cdata.sk_rx_ring_tag, sc_if->sk_cdata.sk_rx_ring_map); - if (sc_if->sk_cdata.sk_rx_ring_map && - sc_if->sk_rdata.sk_rx_ring) + if (sc_if->sk_rdata.sk_rx_ring) bus_dmamem_free(sc_if->sk_cdata.sk_rx_ring_tag, sc_if->sk_rdata.sk_rx_ring, sc_if->sk_cdata.sk_rx_ring_map); sc_if->sk_rdata.sk_rx_ring = NULL; - sc_if->sk_cdata.sk_rx_ring_map = NULL; + sc_if->sk_rdata.sk_rx_ring_paddr = 0; bus_dma_tag_destroy(sc_if->sk_cdata.sk_rx_ring_tag); sc_if->sk_cdata.sk_rx_ring_tag = NULL; } @@ -2298,16 +2296,15 @@ sk_dma_jumbo_free(sc_if) /* jumbo Rx ring */ if (sc_if->sk_cdata.sk_jumbo_rx_ring_tag) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 15:09:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47A79E78; Wed, 11 Jun 2014 15:09:31 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 1A5172244; Wed, 11 Jun 2014 15:09:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 67F163807B; Wed, 11 Jun 2014 10:09:29 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id kkWCXZXSZDLj; Wed, 11 Jun 2014 10:09:29 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id D4A253806F; Wed, 11 Jun 2014 10:09:28 -0500 (CDT) Message-ID: <53987127.1050406@freebsd.org> Date: Wed, 11 Jun 2014 08:09:27 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r267359 - in head: sbin/geom/class/part sys/geom/part sys/modules/geom/geom_part sys/modules/geom/geom_part/geom_part_bsd64 References: <201406111042.s5BAgZuY098764@svn.freebsd.org> In-Reply-To: <201406111042.s5BAgZuY098764@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 15:09:31 -0000 On 06/11/14 03:42, Andrey V. Elsukov wrote: > Author: ae > Date: Wed Jun 11 10:42:34 2014 > New Revision: 267359 > URL: http://svnweb.freebsd.org/changeset/base/267359 > > Log: > Add disklabel64 support to GEOM_PART class. > > This partitioning scheme is used in DragonFlyBSD. It is similar to > BSD disklabel, but has the following improvements: > * metadata has own dedicated place and isn't accessible through partitions; > * all offsets are 64-bit; > * supports 16 partitions by default (has reserved place for more); > * has reserved place for backup label (but not yet implemented); > * has UUIDs for partitions and partition types; > > Is this something worth adding to the installer/sade partition types menu? On the one hand, we support it. On the other hand, it's not bootable on any architecture. So I can't make up my mind. -Nathan From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 16:11:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A080E892; Wed, 11 Jun 2014 16:11:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DAEE288C; Wed, 11 Jun 2014 16:11:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BGBCqA058619; Wed, 11 Jun 2014 16:11:12 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BGBCHU058618; Wed, 11 Jun 2014 16:11:12 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201406111611.s5BGBCHU058618@svn.freebsd.org> From: Alan Cox Date: Wed, 11 Jun 2014 16:11:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267364 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 16:11:12 -0000 Author: alc Date: Wed Jun 11 16:11:12 2014 New Revision: 267364 URL: http://svnweb.freebsd.org/changeset/base/267364 Log: Correct a bug in the management of the population map on big-endian machines. Specifically, there was a mismatch between how the routine allocation and deallocation operations accessed the population map and how the aggressively optimized reservation-breaking operation accessed it. So, problems only occurred when reservations were broken. This change makes the routine operations access the population map in the same way as the reservation breaking operation. This bug was introduced in r259999. PR: 187080 Tested by: jmg (on an "armeb" machine) Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Wed Jun 11 14:53:58 2014 (r267363) +++ head/sys/vm/vm_reserv.c Wed Jun 11 16:11:12 2014 (r267364) @@ -108,6 +108,46 @@ typedef u_long popmap_t; #define NPOPMAP howmany(VM_LEVEL_0_NPAGES, NBPOPMAP) /* + * Clear a bit in the population map. + */ +static __inline void +popmap_clear(popmap_t popmap[], int i) +{ + + popmap[i / NBPOPMAP] &= ~(1UL << (i % NBPOPMAP)); +} + +/* + * Set a bit in the population map. + */ +static __inline void +popmap_set(popmap_t popmap[], int i) +{ + + popmap[i / NBPOPMAP] |= 1UL << (i % NBPOPMAP); +} + +/* + * Is a bit in the population map clear? + */ +static __inline boolean_t +popmap_is_clear(popmap_t popmap[], int i) +{ + + return ((popmap[i / NBPOPMAP] & (1UL << (i % NBPOPMAP))) == 0); +} + +/* + * Is a bit in the population map set? + */ +static __inline boolean_t +popmap_is_set(popmap_t popmap[], int i) +{ + + return ((popmap[i / NBPOPMAP] & (1UL << (i % NBPOPMAP))) != 0); +} + +/* * The reservation structure * * A reservation structure is constructed whenever a large physical page is @@ -241,7 +281,7 @@ vm_reserv_depopulate(vm_reserv_t rv, int mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); KASSERT(rv->object != NULL, ("vm_reserv_depopulate: reserv %p is free", rv)); - KASSERT(isset(rv->popmap, index), + KASSERT(popmap_is_set(rv->popmap, index), ("vm_reserv_depopulate: reserv %p's popmap[%d] is clear", rv, index)); KASSERT(rv->popcnt > 0, @@ -255,7 +295,7 @@ vm_reserv_depopulate(vm_reserv_t rv, int rv)); rv->pages->psind = 0; } - clrbit(rv->popmap, index); + popmap_clear(rv->popmap, index); rv->popcnt--; if (rv->popcnt == 0) { LIST_REMOVE(rv, objq); @@ -302,7 +342,7 @@ vm_reserv_populate(vm_reserv_t rv, int i mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); KASSERT(rv->object != NULL, ("vm_reserv_populate: reserv %p is free", rv)); - KASSERT(isclr(rv->popmap, index), + KASSERT(popmap_is_clear(rv->popmap, index), ("vm_reserv_populate: reserv %p's popmap[%d] is set", rv, index)); KASSERT(rv->popcnt < VM_LEVEL_0_NPAGES, @@ -313,7 +353,7 @@ vm_reserv_populate(vm_reserv_t rv, int i TAILQ_REMOVE(&vm_rvq_partpop, rv, partpopq); rv->inpartpopq = FALSE; } - setbit(rv->popmap, index); + popmap_set(rv->popmap, index); rv->popcnt++; if (rv->popcnt < VM_LEVEL_0_NPAGES) { rv->inpartpopq = TRUE; @@ -503,7 +543,7 @@ found: return (NULL); /* Handle vm_page_rename(m, new_object, ...). */ for (i = 0; i < npages; i++) - if (isset(rv->popmap, index + i)) + if (popmap_is_set(rv->popmap, index + i)) return (NULL); for (i = 0; i < npages; i++) vm_reserv_populate(rv, index + i); @@ -628,7 +668,7 @@ found: index = VM_RESERV_INDEX(object, pindex); m = &rv->pages[index]; /* Handle vm_page_rename(m, new_object, ...). */ - if (isset(rv->popmap, index)) + if (popmap_is_set(rv->popmap, index)) return (NULL); vm_reserv_populate(rv, index); return (m); @@ -662,9 +702,9 @@ vm_reserv_break(vm_reserv_t rv, vm_page_ * to the physical memory allocator. */ i = m - rv->pages; - KASSERT(isclr(rv->popmap, i), + KASSERT(popmap_is_clear(rv->popmap, i), ("vm_reserv_break: reserv %p's popmap is corrupted", rv)); - setbit(rv->popmap, i); + popmap_set(rv->popmap, i); rv->popcnt++; } i = hi = 0; From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 17:03:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8B14BF9; Wed, 11 Jun 2014 17:03:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5E1E2D69; Wed, 11 Jun 2014 17:03:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BH3FQg084853; Wed, 11 Jun 2014 17:03:15 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BH3EUb084843; Wed, 11 Jun 2014 17:03:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406111703.s5BH3EUb084843@svn.freebsd.org> From: John Baldwin Date: Wed, 11 Jun 2014 17:03:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267365 - in head/sys/dev: aha ahb aic7xxx de X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 17:03:16 -0000 Author: jhb Date: Wed Jun 11 17:03:14 2014 New Revision: 267365 URL: http://svnweb.freebsd.org/changeset/base/267365 Log: Fix a few more drivers that were explicitly destroying the bus_dma map created by bus_dmamem_alloc(). Modified: head/sys/dev/aha/aha.c head/sys/dev/ahb/ahb.c head/sys/dev/aic7xxx/aic79xx.c head/sys/dev/aic7xxx/aic7xxx.c head/sys/dev/de/if_de.c Modified: head/sys/dev/aha/aha.c ============================================================================== --- head/sys/dev/aha/aha.c Wed Jun 11 16:11:12 2014 (r267364) +++ head/sys/dev/aha/aha.c Wed Jun 11 17:03:14 2014 (r267365) @@ -209,7 +209,6 @@ aha_free(struct aha_softc *aha) case 6: bus_dmamem_free(aha->ccb_dmat, aha->aha_ccb_array, aha->ccb_dmamap); - bus_dmamap_destroy(aha->ccb_dmat, aha->ccb_dmamap); case 5: bus_dma_tag_destroy(aha->ccb_dmat); case 4: @@ -217,7 +216,6 @@ aha_free(struct aha_softc *aha) case 3: bus_dmamem_free(aha->mailbox_dmat, aha->in_boxes, aha->mailbox_dmamap); - bus_dmamap_destroy(aha->mailbox_dmat, aha->mailbox_dmamap); case 2: bus_dma_tag_destroy(aha->buffer_dmat); case 1: Modified: head/sys/dev/ahb/ahb.c ============================================================================== --- head/sys/dev/ahb/ahb.c Wed Jun 11 16:11:12 2014 (r267364) +++ head/sys/dev/ahb/ahb.c Wed Jun 11 17:03:14 2014 (r267365) @@ -421,7 +421,6 @@ ahbfree(struct ahb_softc *ahb) case 3: bus_dmamem_free(ahb->ecb_dmat, ahb->ecb_array, ahb->ecb_dmamap); - bus_dmamap_destroy(ahb->ecb_dmat, ahb->ecb_dmamap); case 2: bus_dma_tag_destroy(ahb->ecb_dmat); case 1: Modified: head/sys/dev/aic7xxx/aic79xx.c ============================================================================== --- head/sys/dev/aic7xxx/aic79xx.c Wed Jun 11 16:11:12 2014 (r267364) +++ head/sys/dev/aic7xxx/aic79xx.c Wed Jun 11 17:03:14 2014 (r267365) @@ -5413,8 +5413,6 @@ ahd_free(struct ahd_softc *ahd) case 3: aic_dmamem_free(ahd, ahd->shared_data_dmat, ahd->qoutfifo, ahd->shared_data_map.dmamap); - aic_dmamap_destroy(ahd, ahd->shared_data_dmat, - ahd->shared_data_map.dmamap); /* FALLTHROUGH */ case 2: aic_dma_tag_destroy(ahd, ahd->shared_data_dmat); Modified: head/sys/dev/aic7xxx/aic7xxx.c ============================================================================== --- head/sys/dev/aic7xxx/aic7xxx.c Wed Jun 11 16:11:12 2014 (r267364) +++ head/sys/dev/aic7xxx/aic7xxx.c Wed Jun 11 17:03:14 2014 (r267365) @@ -4061,8 +4061,6 @@ ahc_free(struct ahc_softc *ahc) case 3: aic_dmamem_free(ahc, ahc->shared_data_dmat, ahc->qoutfifo, ahc->shared_data_dmamap); - aic_dmamap_destroy(ahc, ahc->shared_data_dmat, - ahc->shared_data_dmamap); /* FALLTHROUGH */ case 2: aic_dma_tag_destroy(ahc, ahc->shared_data_dmat); @@ -4501,8 +4499,6 @@ ahc_fini_scbdata(struct ahc_softc *ahc) case 5: aic_dmamem_free(ahc, scb_data->sense_dmat, scb_data->sense, scb_data->sense_dmamap); - aic_dmamap_destroy(ahc, scb_data->sense_dmat, - scb_data->sense_dmamap); case 4: aic_dma_tag_destroy(ahc, scb_data->sense_dmat); case 3: @@ -4511,8 +4507,6 @@ ahc_fini_scbdata(struct ahc_softc *ahc) case 2: aic_dmamem_free(ahc, scb_data->hscb_dmat, scb_data->hscbs, scb_data->hscb_dmamap); - aic_dmamap_destroy(ahc, scb_data->hscb_dmat, - scb_data->hscb_dmamap); case 1: aic_dma_tag_destroy(ahc, scb_data->hscb_dmat); break; Modified: head/sys/dev/de/if_de.c ============================================================================== --- head/sys/dev/de/if_de.c Wed Jun 11 16:11:12 2014 (r267364) +++ head/sys/dev/de/if_de.c Wed Jun 11 17:03:14 2014 (r267365) @@ -4558,7 +4558,6 @@ tulip_busdma_cleanup(tulip_softc_t * con if (sc->tulip_setupbuf != NULL) { bus_dmamem_free(sc->tulip_setup_tag, sc->tulip_setupbuf, sc->tulip_setup_map); - bus_dmamap_destroy(sc->tulip_setup_tag, sc->tulip_setup_map); sc->tulip_setup_map = NULL; sc->tulip_setupbuf = NULL; } From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 17:19:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3ADFBFA7; Wed, 11 Jun 2014 17:19:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 283FC2E8E; Wed, 11 Jun 2014 17:19:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BHJwWl090629; Wed, 11 Jun 2014 17:19:58 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BHJw3O090628; Wed, 11 Jun 2014 17:19:58 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406111719.s5BHJw3O090628@svn.freebsd.org> From: Ed Maste Date: Wed, 11 Jun 2014 17:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267366 - head/usr.bin/vtfontcvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 17:19:58 -0000 Author: emaste Date: Wed Jun 11 17:19:57 2014 New Revision: 267366 URL: http://svnweb.freebsd.org/changeset/base/267366 Log: Avoid leaking file pointer on error CID: 1222506, 1222505 Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Wed Jun 11 17:03:14 2014 (r267365) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Wed Jun 11 17:19:57 2014 (r267366) @@ -331,6 +331,7 @@ parse_file(const char *filename, unsigne { FILE *fp; size_t len; + int rv; fp = fopen(filename, "r"); if (fp == NULL) { @@ -339,8 +340,11 @@ parse_file(const char *filename, unsigne } len = strlen(filename); if (len > 4 && strcasecmp(filename + len - 4, ".hex") == 0) - return parse_hex(fp, map_idx); - return parse_bdf(fp, map_idx); + rv = parse_hex(fp, map_idx); + else + rv = parse_bdf(fp, map_idx); + fclose(fp); + return (rv); } static void @@ -447,6 +451,7 @@ write_fnt(const char *filename) fh.map_count[3] = htobe32(map_folded_count[3]); if (fwrite(&fh, sizeof fh, 1, fp) != 1) { perror(filename); + fclose(fp); return (1); } @@ -456,9 +461,11 @@ write_fnt(const char *filename) write_mappings(fp, VFNT_MAP_BOLD) != 0 || write_mappings(fp, 3) != 0) { perror(filename); + fclose(fp); return (1); } + fclose(fp); return (0); } From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 18:24:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CCCB9DA; Wed, 11 Jun 2014 18:24:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E5E22563; Wed, 11 Jun 2014 18:24:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BIOrUg022688; Wed, 11 Jun 2014 18:24:53 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BIOqPt022681; Wed, 11 Jun 2014 18:24:52 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201406111824.s5BIOqPt022681@svn.freebsd.org> From: Xin LI Date: Wed, 11 Jun 2014 18:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267368 - in head/sys/dev: hpt27xx hptmv hptrr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 18:24:53 -0000 Author: delphij Date: Wed Jun 11 18:24:51 2014 New Revision: 267368 URL: http://svnweb.freebsd.org/changeset/base/267368 Log: Apply vendor fixes to the High Point drivers: - Don't call xpt_free_path() in os_query_remove_device() and always return TRUE. - Update os_buildsgl() to support build logical SG table which will be used by lower RAID module. - Return CAM_SEL_TIMEOUTstatus for SCSIcommand failed as target missing. Many thanks to HighPoint for providing this driver update. Submitted by: Steve Chang Reviewed by: mav MFC after: 3 days Modified: head/sys/dev/hpt27xx/hpt27xx_os_bsd.c head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c head/sys/dev/hptmv/entry.c head/sys/dev/hptrr/hptrr_os_bsd.c head/sys/dev/hptrr/hptrr_osm_bsd.c Modified: head/sys/dev/hpt27xx/hpt27xx_os_bsd.c ============================================================================== --- head/sys/dev/hpt27xx/hpt27xx_os_bsd.c Wed Jun 11 17:48:07 2014 (r267367) +++ head/sys/dev/hpt27xx/hpt27xx_os_bsd.c Wed Jun 11 18:24:51 2014 (r267368) @@ -324,21 +324,7 @@ int os_revalidate_device(void *osext, in int os_query_remove_device(void *osext, int id) { - PVBUS_EXT vbus_ext = (PVBUS_EXT)osext; - struct cam_periph *periph = NULL; - struct cam_path *path; - int status,retval = 0; - - status = xpt_create_path(&path, NULL, vbus_ext->sim->path_id, id, 0); - if (status == CAM_REQ_CMP) { - if((periph = cam_periph_find(path, "da")) != NULL){ - if(periph->refcount >= 1) - retval = -1; - } - xpt_free_path(path); - } - - return retval; + return 0; } HPT_U8 os_get_vbus_seq(void *osext) Modified: head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c ============================================================================== --- head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Wed Jun 11 17:48:07 2014 (r267367) +++ head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Wed Jun 11 18:24:51 2014 (r267368) @@ -483,6 +483,16 @@ static void os_cmddone(PCOMMAND pCmd) static int os_buildsgl(PCOMMAND pCmd, PSG pSg, int logical) { + POS_CMDEXT ext = (POS_CMDEXT)pCmd->priv; + union ccb *ccb = ext->ccb; + + if (logical) { + os_set_sgptr(pSg, (HPT_U8 *)ccb->csio.data_ptr); + pSg->size = ccb->csio.dxfer_len; + pSg->eot = 1; + return TRUE; + } + /* since we have provided physical sg, nobody will ask us to build physical sg */ HPT_ASSERT(0); return FALSE; @@ -555,7 +565,7 @@ static void hpt_scsi_io(PVBUS_EXT vbus_e vd = ldm_find_target(vbus, ccb->ccb_h.target_id); if (!vd) { - ccb->ccb_h.status = CAM_TID_INVALID; + ccb->ccb_h.status = CAM_SEL_TIMEOUT; xpt_done(ccb); return; } Modified: head/sys/dev/hptmv/entry.c ============================================================================== --- head/sys/dev/hptmv/entry.c Wed Jun 11 17:48:07 2014 (r267367) +++ head/sys/dev/hptmv/entry.c Wed Jun 11 18:24:51 2014 (r267368) @@ -2016,7 +2016,7 @@ hpt_probe(device_t dev) { KdPrintI((CONTROLLER_NAME " found\n")); device_set_desc(dev, CONTROLLER_NAME); - return 0; + return (BUS_PROBE_DEFAULT); } else return(ENXIO); @@ -2623,7 +2623,14 @@ launch_worker_thread(void) int HPTLIBAPI fOsBuildSgl(_VBUS_ARG PCommand pCmd, FPSCAT_GATH pSg, int logical) { - + union ccb *ccb = (union ccb *)pCmd->pOrgCommand; + + if (logical) { + pSg->dSgAddress = (ULONG_PTR)(UCHAR *)ccb->csio.data_ptr; + pSg->wSgSize = ccb->csio.dxfer_len; + pSg->wSgFlag = SG_FLAG_EOT; + return TRUE; + } /* since we have provided physical sg, nobody will ask us to build physical sg */ HPT_ASSERT(0); return FALSE; Modified: head/sys/dev/hptrr/hptrr_os_bsd.c ============================================================================== --- head/sys/dev/hptrr/hptrr_os_bsd.c Wed Jun 11 17:48:07 2014 (r267367) +++ head/sys/dev/hptrr/hptrr_os_bsd.c Wed Jun 11 18:24:51 2014 (r267368) @@ -256,21 +256,7 @@ int os_revalidate_device(void *osext, in int os_query_remove_device(void *osext, int id) { - PVBUS_EXT vbus_ext = (PVBUS_EXT)osext; - struct cam_periph *periph = NULL; - struct cam_path *path; - int status,retval = 0; - - status = xpt_create_path(&path, NULL, vbus_ext->sim->path_id, id, 0); - if (status == CAM_REQ_CMP) { - if((periph = cam_periph_find(path, "da")) != NULL){ - if(periph->refcount >= 1) - retval = -1; - } - xpt_free_path(path); - } - - return retval; + return 0; } HPT_U8 os_get_vbus_seq(void *osext) Modified: head/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- head/sys/dev/hptrr/hptrr_osm_bsd.c Wed Jun 11 17:48:07 2014 (r267367) +++ head/sys/dev/hptrr/hptrr_osm_bsd.c Wed Jun 11 18:24:51 2014 (r267368) @@ -61,7 +61,7 @@ static int hpt_probe(device_t dev) memset(hba, 0, sizeof(HBA)); hba->ext_type = EXT_TYPE_HBA; hba->ldm_adapter.him = him; - return 0; + return (BUS_PROBE_DEFAULT); } } } @@ -482,6 +482,15 @@ static void os_cmddone(PCOMMAND pCmd) static int os_buildsgl(PCOMMAND pCmd, PSG pSg, int logical) { + POS_CMDEXT ext = (POS_CMDEXT)pCmd->priv; + union ccb *ccb = ext->ccb; + + if (logical) { + os_set_sgptr(pSg, (HPT_U8 *)ccb->csio.data_ptr); + pSg->size = ccb->csio.dxfer_len; + pSg->eot = 1; + return TRUE; + } /* since we have provided physical sg, nobody will ask us to build physical sg */ HPT_ASSERT(0); @@ -555,7 +564,7 @@ static void hpt_scsi_io(PVBUS_EXT vbus_e vd = ldm_find_target(vbus, ccb->ccb_h.target_id); if (!vd) { - ccb->ccb_h.status = CAM_TID_INVALID; + ccb->ccb_h.status = CAM_SEL_TIMEOUT; xpt_done(ccb); return; } From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 20:20:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D6AB9E7; Wed, 11 Jun 2014 20:20:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EED782171; Wed, 11 Jun 2014 20:20:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BKKEIx076073; Wed, 11 Jun 2014 20:20:14 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BKKE4p076072; Wed, 11 Jun 2014 20:20:14 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201406112020.s5BKKE4p076072@svn.freebsd.org> From: Baptiste Daroussin Date: Wed, 11 Jun 2014 20:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267371 - head/lib/libfetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 20:20:15 -0000 Author: bapt Date: Wed Jun 11 20:20:14 2014 New Revision: 267371 URL: http://svnweb.freebsd.org/changeset/base/267371 Log: Use Mt macro to properly format mailto links (patch from Franco Fichtner for Dragonfly) Reviewed by: des Approved by: des Obtained from: Dragonfly MFC after: 1 week Modified: head/lib/libfetch/fetch.3 Modified: head/lib/libfetch/fetch.3 ============================================================================== --- head/lib/libfetch/fetch.3 Wed Jun 11 19:27:32 2014 (r267370) +++ head/lib/libfetch/fetch.3 Wed Jun 11 20:20:14 2014 (r267371) @@ -774,27 +774,27 @@ library first appeared in The .Nm fetch library was mostly written by -.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org +.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org with numerous suggestions and contributions from -.An Jordan K. Hubbard Aq jkh@FreeBSD.org , -.An Eugene Skepner Aq eu@qub.com , -.An Hajimu Umemoto Aq ume@FreeBSD.org , -.An Henry Whincup Aq henry@techiebod.com , -.An Jukka A. Ukkonen Aq jau@iki.fi , -.An Jean-Fran\(,cois Dockes Aq jf@dockes.org , -.An Michael Gmelin Aq freebsd@grem.de +.An Jordan K. Hubbard Aq Mt jkh@FreeBSD.org , +.An Eugene Skepner Aq Mt eu@qub.com , +.An Hajimu Umemoto Aq Mt ume@FreeBSD.org , +.An Henry Whincup Aq Mt henry@techiebod.com , +.An Jukka A. Ukkonen Aq Mt jau@iki.fi , +.An Jean-Fran\(,cois Dockes Aq Mt jf@dockes.org , +.An Michael Gmelin Aq Mt freebsd@grem.de and others. It replaces the older .Nm ftpio library written by -.An Poul-Henning Kamp Aq phk@FreeBSD.org +.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org and -.An Jordan K. Hubbard Aq jkh@FreeBSD.org . +.An Jordan K. Hubbard Aq Mt jkh@FreeBSD.org . .Pp This manual page was written by -.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org +.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org and -.An Michael Gmelin Aq freebsd@grem.de . +.An Michael Gmelin Aq Mt freebsd@grem.de . .Sh BUGS Some parts of the library are not yet implemented. The most notable From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 20:22:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 891FDB73; Wed, 11 Jun 2014 20:22:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7678B2205; Wed, 11 Jun 2014 20:22:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BKMFwh079445; Wed, 11 Jun 2014 20:22:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BKMFXb079444; Wed, 11 Jun 2014 20:22:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201406112022.s5BKMFXb079444@svn.freebsd.org> From: Xin LI Date: Wed, 11 Jun 2014 20:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267372 - head/sys/contrib/x86emu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 20:22:15 -0000 Author: delphij Date: Wed Jun 11 20:22:14 2014 New Revision: 267372 URL: http://svnweb.freebsd.org/changeset/base/267372 Log: Fix decoding of MOVSX. Submitted by: Wolf Ramovsky via core (peter) MFC after: 2 weeks Modified: head/sys/contrib/x86emu/x86emu.c Modified: head/sys/contrib/x86emu/x86emu.c ============================================================================== --- head/sys/contrib/x86emu/x86emu.c Wed Jun 11 20:20:14 2014 (r267371) +++ head/sys/contrib/x86emu/x86emu.c Wed Jun 11 20:22:14 2014 (r267372) @@ -5610,6 +5610,7 @@ x86emuOp2_32_movsx_byte_R_RM(struct x86e { uint32_t *destreg; + fetch_decode_modrm(emu); destreg = decode_rh_long_register(emu); *destreg = (int32_t)(int8_t)decode_and_fetch_byte(emu); } From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 20:31:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98DF0EDE; Wed, 11 Jun 2014 20:31:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 862A42279; Wed, 11 Jun 2014 20:31:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BKVfR9081142; Wed, 11 Jun 2014 20:31:41 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BKVfT7081141; Wed, 11 Jun 2014 20:31:41 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201406112031.s5BKVfT7081141@svn.freebsd.org> From: Xin LI Date: Wed, 11 Jun 2014 20:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267373 - head/sys/contrib/x86emu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 20:31:41 -0000 Author: delphij Date: Wed Jun 11 20:31:41 2014 New Revision: 267373 URL: http://svnweb.freebsd.org/changeset/base/267373 Log: Fix decoding of LEA when address-size prefix (67h) is present. This is loosly based on Xorg changeset f57bc0e by Christian Zander. Submitted by: Wolf Ramovsky via core (peter) MFC after: 2 weeks Modified: head/sys/contrib/x86emu/x86emu.c Modified: head/sys/contrib/x86emu/x86emu.c ============================================================================== --- head/sys/contrib/x86emu/x86emu.c Wed Jun 11 20:22:14 2014 (r267372) +++ head/sys/contrib/x86emu/x86emu.c Wed Jun 11 20:31:41 2014 (r267373) @@ -2151,21 +2151,24 @@ x86emuOp_mov_word_RM_SR(struct x86emu *e static void x86emuOp_lea_word_R_M(struct x86emu *emu) { - uint16_t *srcreg; uint32_t destoffset; -/* - * TODO: Need to handle address size prefix! - * - * lea eax,[eax+ebx*2] ?? - */ fetch_decode_modrm(emu); if (emu->cur_mod == 3) x86emu_halt_sys(emu); - srcreg = decode_rh_word_register(emu); destoffset = decode_rl_address(emu); - *srcreg = (uint16_t) destoffset; + if (emu->x86.mode & SYSMODE_PREFIX_ADDR) { + uint32_t *srcreg; + + srcreg = decode_rh_long_register(emu); + *srcreg = (uint32_t) destoffset; + } else { + uint16_t *srcreg; + + srcreg = decode_rh_word_register(emu); + *srcreg = (uint16_t) destoffset; + } } /* From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 20:38:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B81D1343; Wed, 11 Jun 2014 20:38:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A58F0234D; Wed, 11 Jun 2014 20:38:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BKcE4r084724; Wed, 11 Jun 2014 20:38:14 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BKcEiR084723; Wed, 11 Jun 2014 20:38:14 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201406112038.s5BKcEiR084723@svn.freebsd.org> From: Xin LI Date: Wed, 11 Jun 2014 20:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267374 - head/sys/contrib/x86emu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 20:38:14 -0000 Author: delphij Date: Wed Jun 11 20:38:14 2014 New Revision: 267374 URL: http://svnweb.freebsd.org/changeset/base/267374 Log: Fix decoding of near CALL when address-size prefix (67h) is present. Submitted by: Wolf Ramovsky via core (peter) MFC after: 2 weeks Modified: head/sys/contrib/x86emu/x86emu.c Modified: head/sys/contrib/x86emu/x86emu.c ============================================================================== --- head/sys/contrib/x86emu/x86emu.c Wed Jun 11 20:31:41 2014 (r267373) +++ head/sys/contrib/x86emu/x86emu.c Wed Jun 11 20:38:14 2014 (r267374) @@ -3753,12 +3753,19 @@ x86emuOp_out_word_IMM_AX(struct x86emu * static void x86emuOp_call_near_IMM(struct x86emu *emu) { - int16_t ip; - - ip = (int16_t) fetch_word_imm(emu); - ip += (int16_t) emu->x86.R_IP; /* CHECK SIGN */ - push_word(emu, emu->x86.R_IP); - emu->x86.R_IP = ip; + if (emu->x86.mode & SYSMODE_PREFIX_DATA) { + int32_t ip; + ip = (int32_t) fetch_long_imm(emu); + ip += (int32_t) emu->x86.R_EIP; + push_long(emu, emu->x86.R_EIP); + emu->x86.R_EIP = ip; + } else { + int16_t ip; + ip = (int16_t) fetch_word_imm(emu); + ip += (int16_t) emu->x86.R_IP; /* CHECK SIGN */ + push_word(emu, emu->x86.R_IP); + emu->x86.R_IP = ip; + } } /* From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 20:44:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1A5E7E7; Wed, 11 Jun 2014 20:44:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE9D52423; Wed, 11 Jun 2014 20:44:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BKi3vU088817; Wed, 11 Jun 2014 20:44:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BKi3U6088813; Wed, 11 Jun 2014 20:44:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406112044.s5BKi3U6088813@svn.freebsd.org> From: John Baldwin Date: Wed, 11 Jun 2014 20:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267375 - in head/sys/dev: qlxgb qlxgbe qlxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 20:44:03 -0000 Author: jhb Date: Wed Jun 11 20:44:02 2014 New Revision: 267375 URL: http://svnweb.freebsd.org/changeset/base/267375 Log: Unload maps for DMA buffers allocated via bus_dmamem_alloc() before freeing the buffers. Reviewed by: davidcs Modified: head/sys/dev/qlxgb/qla_os.c head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxge/qls_os.c Modified: head/sys/dev/qlxgb/qla_os.c ============================================================================== --- head/sys/dev/qlxgb/qla_os.c Wed Jun 11 20:38:14 2014 (r267374) +++ head/sys/dev/qlxgb/qla_os.c Wed Jun 11 20:44:02 2014 (r267375) @@ -602,6 +602,7 @@ qla_alloc_dmabuf_exit: void qla_free_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf) { + bus_dmamap_unload(dma_buf->dma_tag, dma_buf->dma_map); bus_dmamem_free(dma_buf->dma_tag, dma_buf->dma_b, dma_buf->dma_map); bus_dma_tag_destroy(dma_buf->dma_tag); } Modified: head/sys/dev/qlxgbe/ql_os.c ============================================================================== --- head/sys/dev/qlxgbe/ql_os.c Wed Jun 11 20:38:14 2014 (r267374) +++ head/sys/dev/qlxgbe/ql_os.c Wed Jun 11 20:44:02 2014 (r267375) @@ -681,6 +681,7 @@ ql_alloc_dmabuf_exit: void ql_free_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf) { + bus_dmamap_unload(dma_buf->dma_tag, dma_buf->dma_map); bus_dmamem_free(dma_buf->dma_tag, dma_buf->dma_b, dma_buf->dma_map); bus_dma_tag_destroy(dma_buf->dma_tag); } Modified: head/sys/dev/qlxge/qls_os.c ============================================================================== --- head/sys/dev/qlxge/qls_os.c Wed Jun 11 20:38:14 2014 (r267374) +++ head/sys/dev/qlxge/qls_os.c Wed Jun 11 20:44:02 2014 (r267375) @@ -670,6 +670,7 @@ qls_alloc_dmabuf_exit: void qls_free_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf) { + bus_dmamap_unload(dma_buf->dma_tag, dma_buf->dma_map); bus_dmamem_free(dma_buf->dma_tag, dma_buf->dma_b, dma_buf->dma_map); bus_dma_tag_destroy(dma_buf->dma_tag); } From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 20:44:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D21E792C; Wed, 11 Jun 2014 20:44:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFA1C242B; Wed, 11 Jun 2014 20:44:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BKistj089016; Wed, 11 Jun 2014 20:44:54 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BKis7t089014; Wed, 11 Jun 2014 20:44:54 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201406112044.s5BKis7t089014@svn.freebsd.org> From: Baptiste Daroussin Date: Wed, 11 Jun 2014 20:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267376 - head/lib/libz X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 20:44:54 -0000 Author: bapt Date: Wed Jun 11 20:44:54 2014 New Revision: 267376 URL: http://svnweb.freebsd.org/changeset/base/267376 Log: Add a zlib pkg-config file (more and more ports requires it) Approved by: delphij MFC after: 1 week Added: head/lib/libz/zlib.pc (contents, props changed) Modified: head/lib/libz/Makefile Modified: head/lib/libz/Makefile ============================================================================== --- head/lib/libz/Makefile Wed Jun 11 20:44:02 2014 (r267375) +++ head/lib/libz/Makefile Wed Jun 11 20:44:54 2014 (r267376) @@ -66,6 +66,10 @@ test: example minigzip (export LD_LIBRARY_PATH=. ; \ echo hello world | ./minigzip | ./minigzip -d ) +beforeinstall: + ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${.CURDIR}/zlib.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + .include ## XXX: clang integrated-as doesn't grok .intel_syntax directives yet Added: head/lib/libz/zlib.pc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libz/zlib.pc Wed Jun 11 20:44:54 2014 (r267376) @@ -0,0 +1,14 @@ +# $FreeBSD$ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +sharedlibdir=${libdir} +includedir=${prefix}/include + +Name: zlib +Description: zlib compression library +Version: 1.2.8 + +Requires: +Libs: -L${libdir} -L${sharedlibdir} -lz +Cflags: -I${includedir} From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 20:46:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C699B75; Wed, 11 Jun 2014 20:46:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EA01244F; Wed, 11 Jun 2014 20:46:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BKkNrE089493; Wed, 11 Jun 2014 20:46:23 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BKkNlZ089492; Wed, 11 Jun 2014 20:46:23 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406112046.s5BKkNlZ089492@svn.freebsd.org> From: John Baldwin Date: Wed, 11 Jun 2014 20:46:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267377 - head/sys/dev/bce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 20:46:24 -0000 Author: jhb Date: Wed Jun 11 20:46:23 2014 New Revision: 267377 URL: http://svnweb.freebsd.org/changeset/base/267377 Log: - Unmap static DMA buffers allocated via bus_dmemem_alloc() before freeing them instead of after. - Check the bus address of a static DMA buffer to decide if the associated map should be unloaded. - Don't try to destroy bus dma maps for static DMA buffers. Reviewed by: davidcs Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Wed Jun 11 20:44:54 2014 (r267376) +++ head/sys/dev/bce/if_bce.c Wed Jun 11 20:46:23 2014 (r267377) @@ -3251,6 +3251,13 @@ bce_dma_free(struct bce_softc *sc) DBENTER(BCE_VERBOSE_RESET | BCE_VERBOSE_UNLOAD | BCE_VERBOSE_CTX); /* Free, unmap, and destroy the status block. */ + if (sc->status_block_paddr != 0) { + bus_dmamap_unload( + sc->status_tag, + sc->status_map); + sc->status_block_paddr = 0; + } + if (sc->status_block != NULL) { bus_dmamem_free( sc->status_tag, @@ -3259,15 +3266,6 @@ bce_dma_free(struct bce_softc *sc) sc->status_block = NULL; } - if (sc->status_map != NULL) { - bus_dmamap_unload( - sc->status_tag, - sc->status_map); - bus_dmamap_destroy(sc->status_tag, - sc->status_map); - sc->status_map = NULL; - } - if (sc->status_tag != NULL) { bus_dma_tag_destroy(sc->status_tag); sc->status_tag = NULL; @@ -3275,21 +3273,19 @@ bce_dma_free(struct bce_softc *sc) /* Free, unmap, and destroy the statistics block. */ - if (sc->stats_block != NULL) { - bus_dmamem_free( + if (sc->stats_block_paddr != 0) { + bus_dmamap_unload( sc->stats_tag, - sc->stats_block, sc->stats_map); - sc->stats_block = NULL; + sc->stats_block_paddr = 0; } - if (sc->stats_map != NULL) { - bus_dmamap_unload( + if (sc->stats_block != NULL) { + bus_dmamem_free( sc->stats_tag, + sc->stats_block, sc->stats_map); - bus_dmamap_destroy(sc->stats_tag, - sc->stats_map); - sc->stats_map = NULL; + sc->stats_block = NULL; } if (sc->stats_tag != NULL) { @@ -3301,22 +3297,19 @@ bce_dma_free(struct bce_softc *sc) /* Free, unmap and destroy all context memory pages. */ if (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) { for (i = 0; i < sc->ctx_pages; i++ ) { - if (sc->ctx_block[i] != NULL) { - bus_dmamem_free( + if (sc->ctx_paddr[i] != 0) { + bus_dmamap_unload( sc->ctx_tag, - sc->ctx_block[i], sc->ctx_map[i]); - sc->ctx_block[i] = NULL; + sc->ctx_paddr[i] = 0; } - if (sc->ctx_map[i] != NULL) { - bus_dmamap_unload( - sc->ctx_tag, - sc->ctx_map[i]); - bus_dmamap_destroy( + if (sc->ctx_block[i] != NULL) { + bus_dmamem_free( sc->ctx_tag, + sc->ctx_block[i], sc->ctx_map[i]); - sc->ctx_map[i] = NULL; + sc->ctx_block[i] = NULL; } } @@ -3330,22 +3323,19 @@ bce_dma_free(struct bce_softc *sc) /* Free, unmap and destroy all TX buffer descriptor chain pages. */ for (i = 0; i < sc->tx_pages; i++ ) { - if (sc->tx_bd_chain[i] != NULL) { - bus_dmamem_free( + if (sc->tx_bd_chain_paddr[i] != 0) { + bus_dmamap_unload( sc->tx_bd_chain_tag, - sc->tx_bd_chain[i], sc->tx_bd_chain_map[i]); - sc->tx_bd_chain[i] = NULL; + sc->tx_bd_chain_paddr[i] = 0; } - if (sc->tx_bd_chain_map[i] != NULL) { - bus_dmamap_unload( - sc->tx_bd_chain_tag, - sc->tx_bd_chain_map[i]); - bus_dmamap_destroy( + if (sc->tx_bd_chain[i] != NULL) { + bus_dmamem_free( sc->tx_bd_chain_tag, + sc->tx_bd_chain[i], sc->tx_bd_chain_map[i]); - sc->tx_bd_chain_map[i] = NULL; + sc->tx_bd_chain[i] = NULL; } } @@ -3358,22 +3348,19 @@ bce_dma_free(struct bce_softc *sc) /* Free, unmap and destroy all RX buffer descriptor chain pages. */ for (i = 0; i < sc->rx_pages; i++ ) { - if (sc->rx_bd_chain[i] != NULL) { - bus_dmamem_free( + if (sc->rx_bd_chain_paddr[i] != 0) { + bus_dmamap_unload( sc->rx_bd_chain_tag, - sc->rx_bd_chain[i], sc->rx_bd_chain_map[i]); - sc->rx_bd_chain[i] = NULL; + sc->rx_bd_chain_paddr[i] = 0; } - if (sc->rx_bd_chain_map[i] != NULL) { - bus_dmamap_unload( - sc->rx_bd_chain_tag, - sc->rx_bd_chain_map[i]); - bus_dmamap_destroy( + if (sc->rx_bd_chain[i] != NULL) { + bus_dmamem_free( sc->rx_bd_chain_tag, + sc->rx_bd_chain[i], sc->rx_bd_chain_map[i]); - sc->rx_bd_chain_map[i] = NULL; + sc->rx_bd_chain[i] = NULL; } } @@ -3387,22 +3374,19 @@ bce_dma_free(struct bce_softc *sc) /* Free, unmap and destroy all page buffer descriptor chain pages. */ if (bce_hdr_split == TRUE) { for (i = 0; i < sc->pg_pages; i++ ) { - if (sc->pg_bd_chain[i] != NULL) { - bus_dmamem_free( + if (sc->pg_bd_chain_paddr[i] != 0) { + bus_dmamap_unload( sc->pg_bd_chain_tag, - sc->pg_bd_chain[i], sc->pg_bd_chain_map[i]); - sc->pg_bd_chain[i] = NULL; + sc->pg_bd_chain_paddr[i] = 0; } - if (sc->pg_bd_chain_map[i] != NULL) { - bus_dmamap_unload( - sc->pg_bd_chain_tag, - sc->pg_bd_chain_map[i]); - bus_dmamap_destroy( + if (sc->pg_bd_chain[i] != NULL) { + bus_dmamem_free( sc->pg_bd_chain_tag, + sc->pg_bd_chain[i], sc->pg_bd_chain_map[i]); - sc->pg_bd_chain_map[i] = NULL; + sc->pg_bd_chain[i] = NULL; } } From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 20:48:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D1DDCE0; Wed, 11 Jun 2014 20:48:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AC112465; Wed, 11 Jun 2014 20:48:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5BKmfCb089828; Wed, 11 Jun 2014 20:48:41 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5BKmfKb089827; Wed, 11 Jun 2014 20:48:41 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201406112048.s5BKmfKb089827@svn.freebsd.org> From: Xin LI Date: Wed, 11 Jun 2014 20:48:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267378 - head/lib/libz X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 20:48:41 -0000 Author: delphij Date: Wed Jun 11 20:48:40 2014 New Revision: 267378 URL: http://svnweb.freebsd.org/changeset/base/267378 Log: Fix path for zlib examples, this have no runtime effect and was overlooked when I was doing zlib update. MFC after: 2 weeks Modified: head/lib/libz/Makefile Modified: head/lib/libz/Makefile ============================================================================== --- head/lib/libz/Makefile Wed Jun 11 20:46:23 2014 (r267377) +++ head/lib/libz/Makefile Wed Jun 11 20:48:40 2014 (r267378) @@ -55,6 +55,8 @@ CFLAGS+= -DSYMBOL_VERSIONING INCS= zconf.h zlib.h +.PATH: ${.CURDIR}/test + minigzip: all minigzip.o $(CC) -o minigzip minigzip.o -L. -lz From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 21:37:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A0C9D4; Wed, 11 Jun 2014 21:37:49 +0000 (UTC) Received: from mail-wg0-x22b.google.com (mail-wg0-x22b.google.com [IPv6:2a00:1450:400c:c00::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E17A2A01; Wed, 11 Jun 2014 21:37:48 +0000 (UTC) Received: by mail-wg0-f43.google.com with SMTP id b13so341632wgh.26 for ; Wed, 11 Jun 2014 14:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=p71dunJtguUvf3qIBbDcwHQ/KOQNTjEOd0m89MchECM=; b=Za+Q5a2eVv48z8QSub8vy8Ynd0C24anNa2aCdQ4PBbg35QzH6ksr1kZz4ZqNGj3wUJ DWUA2+HUvIw5csT7+rFtEVs+peY5Uu0hAWjYWxa+k5WzuZJm8P92e3h9o5cDCYxnhfzz cS61+Ei2E0IJHmTGkLz39FXPno1zKCStSmo8u3ZSpobwKlvRxXwrduhzjjOOTC5Oebty zdSmTg++yr/LGMdUak4YxfcERBmaJDzqAgfKggF3bS42H34Tj6YTLhTdVPf/LXefmfgB ttzcWc0wpQeXEcafED1Net7YrgfE61v4sC+hjs6YJRynj205chMGWc0cXaanFXcv5DBP XfOQ== MIME-Version: 1.0 X-Received: by 10.180.91.162 with SMTP id cf2mr459009wib.57.1402522666685; Wed, 11 Jun 2014 14:37:46 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.216.26.193 with HTTP; Wed, 11 Jun 2014 14:37:46 -0700 (PDT) In-Reply-To: <201406112020.s5BKKE4p076072@svn.freebsd.org> References: <201406112020.s5BKKE4p076072@svn.freebsd.org> Date: Thu, 12 Jun 2014 01:37:46 +0400 X-Google-Sender-Auth: irlo1O7vujL_4_BELwdZgUG4V_c Message-ID: Subject: Re: svn commit: r267371 - head/lib/libfetch From: Sergey Kandaurov To: Baptiste Daroussin Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 21:37:49 -0000 On 12 June 2014 00:20, Baptiste Daroussin wrote: > Author: bapt > Date: Wed Jun 11 20:20:14 2014 > New Revision: 267371 > URL: http://svnweb.freebsd.org/changeset/base/267371 > > Log: > Use Mt macro to properly format mailto links (patch from Franco Fichtner for Dragonfly) This doesn't look like a complete change touching fetch.1 and others. The commit log is also a very long line (like this one). The Mt macro is undocumented in the groff documentation (despite, it is used there). -- wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Wed Jun 11 21:43:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 959AF2D4; Wed, 11 Jun 2014 21:43:38 +0000 (UTC) Received: from mail-we0-x231.google.com (mail-we0-x231.google.com [IPv6:2a00:1450:400c:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1AB62ADB; Wed, 11 Jun 2014 21:43:37 +0000 (UTC) Received: by mail-we0-f177.google.com with SMTP id u56so364048wes.22 for ; Wed, 11 Jun 2014 14:43:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=/j5twEfkiFOwNzXwAziVV9iNgk/RPkaa41jKWD5kCPI=; b=vR2I56dlhTnd+Jp/rFKfhL5ghVjwof3g6P7+HFiVGpsv4XpGkz2l1uAqQDRpfexSia F0CmuxSuk/BcBa7zvyZQdFs6tN5Ld4xe2bleOSl/4GDD0dwjii+2XxsC44F91s5xtxp2 2nHskSaUFAstdVIlzTU4IQ6XXkFRXnXqAKzPwNo7c+Biv+9d7n2gH/P03j2QJCo1IWyL QZcSQ5TtREZYMZ0/eZ1dVGTdKfhXhwadzV1nZ6jMEYruXihyjDX8ka4Jighl+JfsWrgD YLpzzCwPugopE5DvDSSfpuobkd+4vEo7jd6bcig6RNdqokiF+YRcoCRWNamt2GMHy+Xa TxjQ== X-Received: by 10.180.210.174 with SMTP id mv14mr528098wic.47.1402523015940; Wed, 11 Jun 2014 14:43:35 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id gd5sm35908359wjb.40.2014.06.11.14.43.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jun 2014 14:43:35 -0700 (PDT) Sender: Baptiste Daroussin Date: Wed, 11 Jun 2014 23:43:32 +0200 From: Baptiste Daroussin To: Sergey Kandaurov Subject: Re: svn commit: r267371 - head/lib/libfetch Message-ID: <20140611214332.GI8662@ivaldir.etoilebsd.net> References: <201406112020.s5BKKE4p076072@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lYetfuAxy9ic4HK3" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jun 2014 21:43:38 -0000 --lYetfuAxy9ic4HK3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 12, 2014 at 01:37:46AM +0400, Sergey Kandaurov wrote: > On 12 June 2014 00:20, Baptiste Daroussin wrote: > > Author: bapt > > Date: Wed Jun 11 20:20:14 2014 > > New Revision: 267371 > > URL: http://svnweb.freebsd.org/changeset/base/267371 > > > > Log: > > Use Mt macro to properly format mailto links (patch from Franco Ficht= ner for Dragonfly) >=20 > This doesn't look like a complete change touching fetch.1 and others. > The commit log is also a very long line (like this one). > The Mt macro is undocumented in the groff documentation (despite, it is u= sed > there). Sorry for the commit line I was just trying to sync changes from Dragonfly touching libfetch so only concerning libfetch.3 The macro is documented in newer version of mandoc/mdocml so will get the documentation when this will be updated. regards, Bapt --lYetfuAxy9ic4HK3 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iEYEARECAAYFAlOYzYQACgkQ8kTtMUmk6Ey82QCcC8Xm3vsWXxNZpQ2RtSXtyiq/ gXAAoIWmvSEenE84K1ipZE9fbzUTitfC =5hkF -----END PGP SIGNATURE----- --lYetfuAxy9ic4HK3-- From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 06:57:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68D0E73F; Thu, 12 Jun 2014 06:57:13 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 29AD6264F; Thu, 12 Jun 2014 06:57:11 +0000 (UTC) Message-ID: <53994F15.1080504@FreeBSD.org> Date: Thu, 12 Jun 2014 10:56:21 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Nathan Whitehorn , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r267359 - in head: sbin/geom/class/part sys/geom/part sys/modules/geom/geom_part sys/modules/geom/geom_part/geom_part_bsd64 References: <201406111042.s5BAgZuY098764@svn.freebsd.org> <53987127.1050406@freebsd.org> In-Reply-To: <53987127.1050406@freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 06:57:13 -0000 On 11.06.2014 19:09, Nathan Whitehorn wrote: >> Add disklabel64 support to GEOM_PART class. >> This partitioning scheme is used in DragonFlyBSD. It is similar to >> BSD disklabel, but has the following improvements: >> * metadata has own dedicated place and isn't accessible through >> partitions; >> * all offsets are 64-bit; >> * supports 16 partitions by default (has reserved place for more); >> * has reserved place for backup label (but not yet implemented); >> * has UUIDs for partitions and partition types; >> > > Is this something worth adding to the installer/sade partition types > menu? On the one hand, we support it. On the other hand, it's not > bootable on any architecture. So I can't make up my mind. Hi, I think it isn't intended for the installer, until we haven't any bootcode. -- WBR, Andrey V. Elsukov From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 07:05:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E5A6902; Thu, 12 Jun 2014 07:05:49 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id E35B728D0; Thu, 12 Jun 2014 07:05:47 +0000 (UTC) Message-ID: <53995119.5040609@FreeBSD.org> Date: Thu, 12 Jun 2014 11:04:57 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Dmitry Morozovsky Subject: Re: svn commit: r267357 - head/sys/geom/part References: <201406111019.s5BAJBjW085880@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 07:05:49 -0000 On 11.06.2014 17:48, Dmitry Morozovsky wrote: > On Wed, 11 Jun 2014, Andrey V. Elsukov wrote: > >> Author: ae >> Date: Wed Jun 11 10:19:11 2014 >> New Revision: 267357 >> URL: http://svnweb.freebsd.org/changeset/base/267357 >> >> Log: >> Add aliases for DragonFlyBSD's partition types. > > These should be documented in sbin/geom/class/part/gpart.8 also. I don't think we should document partition types for all foreign systems. gpart(8) exists only in FreeBSD and it's purpose manage partitions in FreeBSD. We already have a lot of NetBSD's and Apple's aliases that aren't documented, but nobody complained about that. In this case it is mostly cosmetic change. It allows to see aliases in the `gpart show` output. Having a lot of partition types documented can confuse users. IMHO. :) -- WBR, Andrey V. Elsukov From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 08:32:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9ED2DA0E; Thu, 12 Jun 2014 08:32:49 +0000 (UTC) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C3AE2F4D; Thu, 12 Jun 2014 08:32:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id s5C8WiHO008105; Thu, 12 Jun 2014 12:32:44 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Thu, 12 Jun 2014 12:32:44 +0400 (MSK) From: Dmitry Morozovsky To: "Andrey V. Elsukov" Subject: Re: svn commit: r267357 - head/sys/geom/part In-Reply-To: <53995119.5040609@FreeBSD.org> Message-ID: References: <201406111019.s5BAJBjW085880@svn.freebsd.org> <53995119.5040609@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Thu, 12 Jun 2014 12:32:45 +0400 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 08:32:49 -0000 On Thu, 12 Jun 2014, Andrey V. Elsukov wrote: > >> Author: ae > >> Date: Wed Jun 11 10:19:11 2014 > >> New Revision: 267357 > >> URL: http://svnweb.freebsd.org/changeset/base/267357 > >> > >> Log: > >> Add aliases for DragonFlyBSD's partition types. > > > > These should be documented in sbin/geom/class/part/gpart.8 also. > > I don't think we should document partition types for all foreign > systems. gpart(8) exists only in FreeBSD and it's purpose manage > partitions in FreeBSD. We already have a lot of NetBSD's and Apple's > aliases that aren't documented, but nobody complained about that. > > In this case it is mostly cosmetic change. It allows to see aliases in > the `gpart show` output. Having a lot of partition types documented can > confuse users. IMHO. :) I do not have strong opinion about it, but at least jmg@ asked me to document my set of VMware FSes additions ;) -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 11:15:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38621750; Thu, 12 Jun 2014 11:15:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18CA22E9A; Thu, 12 Jun 2014 11:15:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5CBFKrl086185; Thu, 12 Jun 2014 11:15:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CBFJgP086177; Thu, 12 Jun 2014 11:15:19 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406121115.s5CBFJgP086177@svn.freebsd.org> From: John Baldwin Date: Thu, 12 Jun 2014 11:15:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267385 - in head/sys/dev: e1000 i40e ixgb ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 11:15:21 -0000 Author: jhb Date: Thu Jun 12 11:15:19 2014 New Revision: 267385 URL: http://svnweb.freebsd.org/changeset/base/267385 Log: - Don't compare bus_dma map pointers for static DMA allocations against NULL to determine if bus_dmamap_unload() or bus_dmamem_free() should be called. Instead, check the associated bus and virtual addresses. - Don't clear static DMA maps to NULL. Reviewed by: jfv Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_lem.c head/sys/dev/i40e/i40e_osdep.c head/sys/dev/ixgb/if_ixgb.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixv.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Jun 12 09:59:11 2014 (r267384) +++ head/sys/dev/e1000/if_em.c Thu Jun 12 11:15:19 2014 (r267385) @@ -3088,7 +3088,6 @@ fail_2: bus_dmamem_free(dma->dma_tag, dma->dma_vaddr, dma->dma_map); bus_dma_tag_destroy(dma->dma_tag); fail_0: - dma->dma_map = NULL; dma->dma_tag = NULL; return (error); @@ -3099,12 +3098,15 @@ em_dma_free(struct adapter *adapter, str { if (dma->dma_tag == NULL) return; - if (dma->dma_map != NULL) { + if (dma->dma_paddr != 0) { bus_dmamap_sync(dma->dma_tag, dma->dma_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(dma->dma_tag, dma->dma_map); + dma->dma_paddr = 0; + } + if (dma->dma_vaddr != NULL) { bus_dmamem_free(dma->dma_tag, dma->dma_vaddr, dma->dma_map); - dma->dma_map = NULL; + dma->dma_vaddr = NULL; } bus_dma_tag_destroy(dma->dma_tag); dma->dma_tag = NULL; Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Thu Jun 12 09:59:11 2014 (r267384) +++ head/sys/dev/e1000/if_igb.c Thu Jun 12 11:15:19 2014 (r267385) @@ -3259,7 +3259,6 @@ fail_2: bus_dmamem_free(dma->dma_tag, dma->dma_vaddr, dma->dma_map); bus_dma_tag_destroy(dma->dma_tag); fail_0: - dma->dma_map = NULL; dma->dma_tag = NULL; return (error); @@ -3270,12 +3269,15 @@ igb_dma_free(struct adapter *adapter, st { if (dma->dma_tag == NULL) return; - if (dma->dma_map != NULL) { + if (dma->dma_paddr != 0) { bus_dmamap_sync(dma->dma_tag, dma->dma_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(dma->dma_tag, dma->dma_map); + dma->dma_paddr = 0; + } + if (dma->dma_vaddr != NULL) { bus_dmamem_free(dma->dma_tag, dma->dma_vaddr, dma->dma_map); - dma->dma_map = NULL; + dma->dma_vaddr = NULL; } bus_dma_tag_destroy(dma->dma_tag); dma->dma_tag = NULL; Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Thu Jun 12 09:59:11 2014 (r267384) +++ head/sys/dev/e1000/if_lem.c Thu Jun 12 11:15:19 2014 (r267385) @@ -2527,7 +2527,6 @@ fail_2: bus_dmamem_free(dma->dma_tag, dma->dma_vaddr, dma->dma_map); bus_dma_tag_destroy(dma->dma_tag); fail_0: - dma->dma_map = NULL; dma->dma_tag = NULL; return (error); @@ -2538,12 +2537,15 @@ lem_dma_free(struct adapter *adapter, st { if (dma->dma_tag == NULL) return; - if (dma->dma_map != NULL) { + if (dma->dma_paddr != 0) { bus_dmamap_sync(dma->dma_tag, dma->dma_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(dma->dma_tag, dma->dma_map); + dma->dma_paddr = 0; + } + if (dma->dma_vaddr != NULL) { bus_dmamem_free(dma->dma_tag, dma->dma_vaddr, dma->dma_map); - dma->dma_map = NULL; + dma->dma_vaddr = NULL; } bus_dma_tag_destroy(dma->dma_tag); dma->dma_tag = NULL; Modified: head/sys/dev/i40e/i40e_osdep.c ============================================================================== --- head/sys/dev/i40e/i40e_osdep.c Thu Jun 12 09:59:11 2014 (r267384) +++ head/sys/dev/i40e/i40e_osdep.c Thu Jun 12 11:15:19 2014 (r267385) @@ -116,7 +116,6 @@ fail_2: fail_1: bus_dma_tag_destroy(dma->tag); fail_0: - dma->map = NULL; dma->tag = NULL; return (err); } Modified: head/sys/dev/ixgb/if_ixgb.c ============================================================================== --- head/sys/dev/ixgb/if_ixgb.c Thu Jun 12 09:59:11 2014 (r267384) +++ head/sys/dev/ixgb/if_ixgb.c Thu Jun 12 11:15:19 2014 (r267385) @@ -1459,7 +1459,6 @@ fail_2: fail_1: bus_dma_tag_destroy(dma->dma_tag); fail_0: - dma->dma_map = NULL; dma->dma_tag = NULL; return (r); } Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Thu Jun 12 09:59:11 2014 (r267384) +++ head/sys/dev/ixgbe/ixgbe.c Thu Jun 12 11:15:19 2014 (r267385) @@ -2788,7 +2788,6 @@ fail_2: fail_1: bus_dma_tag_destroy(dma->dma_tag); fail_0: - dma->dma_map = NULL; dma->dma_tag = NULL; return (r); } Modified: head/sys/dev/ixgbe/ixv.c ============================================================================== --- head/sys/dev/ixgbe/ixv.c Thu Jun 12 09:59:11 2014 (r267384) +++ head/sys/dev/ixgbe/ixv.c Thu Jun 12 11:15:19 2014 (r267385) @@ -1955,7 +1955,6 @@ fail_2: fail_1: bus_dma_tag_destroy(dma->dma_tag); fail_0: - dma->dma_map = NULL; dma->dma_tag = NULL; return (r); } From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 11:21:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57BFA948; Thu, 12 Jun 2014 11:21:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 447362F60; Thu, 12 Jun 2014 11:21:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5CBLJ20089168; Thu, 12 Jun 2014 11:21:19 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CBLJA5089167; Thu, 12 Jun 2014 11:21:19 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406121121.s5CBLJA5089167@svn.freebsd.org> From: John Baldwin Date: Thu, 12 Jun 2014 11:21:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267386 - head/sys/dev/hpt27xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 11:21:19 -0000 Author: jhb Date: Thu Jun 12 11:21:18 2014 New Revision: 267386 URL: http://svnweb.freebsd.org/changeset/base/267386 Log: Remove some Giant unlocks I missed in r267290. Modified: head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Modified: head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c ============================================================================== --- head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Thu Jun 12 11:15:19 2014 (r267385) +++ head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Thu Jun 12 11:21:18 2014 (r267386) @@ -1358,19 +1358,16 @@ static int hpt_rescan_bus(void) ldm_for_each_vbus(vbus, vbus_ext) { if ((ccb = xpt_alloc_ccb()) == NULL) { - mtx_unlock(&Giant); return(ENOMEM); } if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(vbus_ext->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_free_ccb(ccb); - mtx_unlock(&Giant); return(EIO); } xpt_rescan(ccb); } - mtx_unlock(&Giant); return(0); } From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 11:36:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A68E1D8F; Thu, 12 Jun 2014 11:36:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93B2D20F3; Thu, 12 Jun 2014 11:36:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5CBaM9m095315; Thu, 12 Jun 2014 11:36:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CBaM7Y095314; Thu, 12 Jun 2014 11:36:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406121136.s5CBaM7Y095314@svn.freebsd.org> From: Alexander Motin Date: Thu, 12 Jun 2014 11:36:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267387 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 11:36:22 -0000 Author: mav Date: Thu Jun 12 11:36:22 2014 New Revision: 267387 URL: http://svnweb.freebsd.org/changeset/base/267387 Log: Allocating new bucket for bucket zone, never take it from the zone itself, since it will almost certanly fail. Take next bigger zone instead. This situation should not happen with original bucket zones configuration: "32 Bucket" zone uses "64 Bucket" and vice versa. But if "64 Bucket" zone lock is congested, zone may grow its bucket size and start biting itself. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jun 12 11:21:18 2014 (r267386) +++ head/sys/vm/uma_core.c Thu Jun 12 11:36:22 2014 (r267387) @@ -381,6 +381,8 @@ bucket_alloc(uma_zone_t zone, void *udat if ((uintptr_t)udata & UMA_ZFLAG_CACHEONLY) flags |= M_NOVM; ubz = bucket_zone_lookup(zone->uz_count); + if (ubz->ubz_zone == zone && (ubz + 1)->ubz_entries != 0) + ubz++; bucket = uma_zalloc_arg(ubz->ubz_zone, udata, flags); if (bucket) { #ifdef INVARIANTS From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 11:37:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A24FEFF; Thu, 12 Jun 2014 11:37:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 058592118; Thu, 12 Jun 2014 11:37:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5CBbcG1095509; Thu, 12 Jun 2014 11:37:38 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CBbcmQ095505; Thu, 12 Jun 2014 11:37:38 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201406121137.s5CBbcmQ095505@svn.freebsd.org> From: Ruslan Bukin Date: Thu, 12 Jun 2014 11:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267388 - head/sys/arm/samsung/exynos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 11:37:39 -0000 Author: br Date: Thu Jun 12 11:37:38 2014 New Revision: 267388 URL: http://svnweb.freebsd.org/changeset/base/267388 Log: Add machine-dependent SMP part for Exynos5420 Modified: head/sys/arm/samsung/exynos/exynos5_machdep.c head/sys/arm/samsung/exynos/exynos5_mp.c Modified: head/sys/arm/samsung/exynos/exynos5_machdep.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_machdep.c Thu Jun 12 11:36:22 2014 (r267387) +++ head/sys/arm/samsung/exynos/exynos5_machdep.c Thu Jun 12 11:37:38 2014 (r267388) @@ -74,6 +74,9 @@ int platform_devmap_init(void) { + /* CHIP ID */ + arm_devmap_add_entry(0x10000000, 0x100000); + /* UART */ arm_devmap_add_entry(0x12C00000, 0x100000); Modified: head/sys/arm/samsung/exynos/exynos5_mp.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_mp.c Thu Jun 12 11:36:22 2014 (r267387) +++ head/sys/arm/samsung/exynos/exynos5_mp.c Thu Jun 12 11:37:38 2014 (r267388) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Ruslan Bukin + * Copyright (c) 2013-2014 Ruslan Bukin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,34 @@ __FBSDID("$FreeBSD$"); #include #include -#define EXYNOS_SYSRAM 0x02020000 +#define EXYNOS_CHIPID 0x10000000 + +#define EXYNOS5250_SOC_ID 0x43520000 +#define EXYNOS5420_SOC_ID 0xE5420000 +#define EXYNOS5_SOC_ID_MASK 0xFFFFF000 + +#define EXYNOS_SYSRAM 0x02020000 +#define EXYNOS5420_SYSRAM_NS (EXYNOS_SYSRAM + 0x53000 + 0x1c) + +#define EXYNOS_PMU_BASE 0x10040000 +#define CORE_CONFIG(n) (0x2000 + (0x80 * (n))) +#define CORE_STATUS(n) (CORE_CONFIG(n) + 0x4) +#define CORE_PWR_EN 0x3 + +static int +exynos_get_soc_id(void) +{ + bus_addr_t chipid; + int reg; + + if (bus_space_map(fdtbus_bs_tag, EXYNOS_CHIPID, + 0x1000, 0, &chipid) != 0) + panic("Couldn't map chipid\n"); + reg = bus_space_read_4(fdtbus_bs_tag, chipid, 0x0); + bus_space_unmap(fdtbus_bs_tag, chipid, 0x1000); + + return (reg & EXYNOS5_SOC_ID_MASK); +} void platform_mp_init_secondary(void) @@ -50,27 +77,58 @@ void platform_mp_setmaxid(void) { - mp_maxid = 1; + if (exynos_get_soc_id() == EXYNOS5420_SOC_ID) + mp_ncpus = 4; + else + mp_ncpus = 2; + + mp_maxid = mp_ncpus - 1; } int platform_mp_probe(void) { - mp_ncpus = 2; - return (1); + return (mp_ncpus > 1); } void platform_mp_start_ap(void) { - bus_addr_t sysram; - int err; + bus_addr_t sysram, pmu; + int err, i, j; + int status; + int reg; - err = bus_space_map(fdtbus_bs_tag, EXYNOS_SYSRAM, 0x100, 0, &sysram); + err = bus_space_map(fdtbus_bs_tag, EXYNOS_PMU_BASE, 0x20000, 0, &pmu); + if (err != 0) + panic("Couldn't map pmu\n"); + + if (exynos_get_soc_id() == EXYNOS5420_SOC_ID) + reg = EXYNOS5420_SYSRAM_NS; + else + reg = EXYNOS_SYSRAM; + + err = bus_space_map(fdtbus_bs_tag, reg, 0x100, 0, &sysram); if (err != 0) panic("Couldn't map sysram\n"); + /* Give power to CPUs */ + for (i = 1; i < mp_ncpus; i++) { + bus_space_write_4(fdtbus_bs_tag, pmu, CORE_CONFIG(i), + CORE_PWR_EN); + + for (j = 10; j >= 0; j--) { + status = bus_space_read_4(fdtbus_bs_tag, pmu, + CORE_STATUS(i)); + if ((status & CORE_PWR_EN) == CORE_PWR_EN) + break; + DELAY(10); + if (j == 0) + printf("Can't power on CPU%d\n", i); + } + } + bus_space_write_4(fdtbus_bs_tag, sysram, 0x0, pmap_kextract((vm_offset_t)mpentry)); @@ -79,6 +137,7 @@ platform_mp_start_ap(void) armv7_sev(); bus_space_unmap(fdtbus_bs_tag, sysram, 0x100); + bus_space_unmap(fdtbus_bs_tag, pmu, 0x20000); } void From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 11:41:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A024814A; Thu, 12 Jun 2014 11:41:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D58821B6; Thu, 12 Jun 2014 11:41:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5CBf4UN096951; Thu, 12 Jun 2014 11:41:04 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CBf474096950; Thu, 12 Jun 2014 11:41:04 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201406121141.s5CBf474096950@svn.freebsd.org> From: Ruslan Bukin Date: Thu, 12 Jun 2014 11:41:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267389 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 11:41:04 -0000 Author: br Date: Thu Jun 12 11:41:04 2014 New Revision: 267389 URL: http://svnweb.freebsd.org/changeset/base/267389 Log: Activate IRQ 30 (non-secure private timer IRQ) for case we are running in non-secure state. Modified: head/sys/arm/arm/gic.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Thu Jun 12 11:37:38 2014 (r267388) +++ head/sys/arm/arm/gic.c Thu Jun 12 11:41:04 2014 (r267389) @@ -166,8 +166,9 @@ gic_init_secondary(void) /* Enable interrupt distribution */ gic_d_write_4(GICD_CTLR, 0x01); - /* Activate IRQ 29, ie private timer IRQ*/ + /* Activate IRQ 29-30, ie private timer (secure & non-secure) IRQs */ gic_d_write_4(GICD_ISENABLER(29 >> 5), (1UL << (29 & 0x1F))); + gic_d_write_4(GICD_ISENABLER(30 >> 5), (1UL << (30 & 0x1F))); } static int From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 11:44:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56DE62EC; Thu, 12 Jun 2014 11:44:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 445B321E4; Thu, 12 Jun 2014 11:44:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5CBiRHw099562; Thu, 12 Jun 2014 11:44:27 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CBiQ6m099557; Thu, 12 Jun 2014 11:44:26 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201406121144.s5CBiQ6m099557@svn.freebsd.org> From: Ruslan Bukin Date: Thu, 12 Jun 2014 11:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267390 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 11:44:27 -0000 Author: br Date: Thu Jun 12 11:44:26 2014 New Revision: 267390 URL: http://svnweb.freebsd.org/changeset/base/267390 Log: Enable SMP for both Exynos5 models we support. Modified: head/sys/arm/conf/EXYNOS5.common head/sys/arm/conf/EXYNOS5250 Modified: head/sys/arm/conf/EXYNOS5.common ============================================================================== --- head/sys/arm/conf/EXYNOS5.common Thu Jun 12 11:41:04 2014 (r267389) +++ head/sys/arm/conf/EXYNOS5.common Thu Jun 12 11:44:26 2014 (r267390) @@ -51,6 +51,8 @@ options PREEMPTION options FREEBSD_BOOT_LOADER options VFP # vfp/neon +options SMP + # Debugging makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options BREAK_TO_DEBUGGER Modified: head/sys/arm/conf/EXYNOS5250 ============================================================================== --- head/sys/arm/conf/EXYNOS5250 Thu Jun 12 11:41:04 2014 (r267389) +++ head/sys/arm/conf/EXYNOS5250 Thu Jun 12 11:44:26 2014 (r267390) @@ -21,7 +21,5 @@ ident EXYNOS5250 include "EXYNOS5.common" include "../samsung/exynos/std.exynos5250" -options SMP - #FDT options FDT From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 11:57:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A818A692; Thu, 12 Jun 2014 11:57:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95CBB22E0; Thu, 12 Jun 2014 11:57:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5CBv7pA004606; Thu, 12 Jun 2014 11:57:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CBv711004605; Thu, 12 Jun 2014 11:57:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406121157.s5CBv711004605@svn.freebsd.org> From: Alexander Motin Date: Thu, 12 Jun 2014 11:57:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267391 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 11:57:07 -0000 Author: mav Date: Thu Jun 12 11:57:07 2014 New Revision: 267391 URL: http://svnweb.freebsd.org/changeset/base/267391 Log: Introduce new "256 Bucket" zone to split requests and reduce congestion on "128 Bucket" zone lock. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jun 12 11:44:26 2014 (r267390) +++ head/sys/vm/uma_core.c Thu Jun 12 11:57:07 2014 (r267391) @@ -205,7 +205,7 @@ struct uma_bucket_zone { #define BUCKET_SIZE(n) \ (((sizeof(void *) * (n)) - sizeof(struct uma_bucket)) / sizeof(void *)) -#define BUCKET_MAX BUCKET_SIZE(128) +#define BUCKET_MAX BUCKET_SIZE(256) struct uma_bucket_zone bucket_zones[] = { { NULL, "4 Bucket", BUCKET_SIZE(4), 4096 }, @@ -216,6 +216,7 @@ struct uma_bucket_zone bucket_zones[] = { NULL, "32 Bucket", BUCKET_SIZE(32), 512 }, { NULL, "64 Bucket", BUCKET_SIZE(64), 256 }, { NULL, "128 Bucket", BUCKET_SIZE(128), 128 }, + { NULL, "256 Bucket", BUCKET_SIZE(256), 64 }, { NULL, NULL, 0} }; From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 12:43:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A89A72C6; Thu, 12 Jun 2014 12:43:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BF27274C; Thu, 12 Jun 2014 12:43:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5CChnaS026981; Thu, 12 Jun 2014 12:43:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CChnfg026979; Thu, 12 Jun 2014 12:43:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406121243.s5CChnfg026979@svn.freebsd.org> From: Alexander Motin Date: Thu, 12 Jun 2014 12:43:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267392 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 12:43:49 -0000 Author: mav Date: Thu Jun 12 12:43:48 2014 New Revision: 267392 URL: http://svnweb.freebsd.org/changeset/base/267392 Log: Implement simple direct-mapped cache for popular filesystem identifiers to avoid congestion on global mountlist_mtx mutex in vfs_busyfs(), while traversing through the list of mount points. This change significantly improves NFS server scalability, since it had to do this translation for every request, and the global lock becomes quite congested. This code is more optimized for relatively small number of mount points. On systems with hundreds of active mount points this simple cache may have many collisions. But the original traversal code in that case should also behave much worse, so we are not loosing much. Reviewed by: attilio MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu Jun 12 11:57:07 2014 (r267391) +++ head/sys/kern/vfs_subr.c Thu Jun 12 12:43:48 2014 (r267392) @@ -500,23 +500,53 @@ vfs_getvfs(fsid_t *fsid) /* * Lookup a mount point by filesystem identifier, busying it before * returning. + * + * To avoid congestion on mountlist_mtx, implement simple direct-mapped + * cache for popular filesystem identifiers. The cache is lockess, using + * the fact that struct mount's are never freed. In worst case we may + * get pointer to unmounted or even different filesystem, so we have to + * check what we got, and go slow way if so. */ struct mount * vfs_busyfs(fsid_t *fsid) { +#define FSID_CACHE_SIZE 256 + typedef struct mount * volatile vmp_t; + static vmp_t cache[FSID_CACHE_SIZE]; struct mount *mp; int error; + uint32_t hash; CTR2(KTR_VFS, "%s: fsid %p", __func__, fsid); + hash = fsid->val[0] ^ fsid->val[1]; + hash = (hash >> 16 ^ hash) & (FSID_CACHE_SIZE - 1); + mp = cache[hash]; + if (mp == NULL || + mp->mnt_stat.f_fsid.val[0] != fsid->val[0] || + mp->mnt_stat.f_fsid.val[1] != fsid->val[1]) + goto slow; + if (vfs_busy(mp, 0) != 0) { + cache[hash] = NULL; + goto slow; + } + if (mp->mnt_stat.f_fsid.val[0] == fsid->val[0] && + mp->mnt_stat.f_fsid.val[1] == fsid->val[1]) + return (mp); + else + vfs_unbusy(mp); + +slow: mtx_lock(&mountlist_mtx); TAILQ_FOREACH(mp, &mountlist, mnt_list) { if (mp->mnt_stat.f_fsid.val[0] == fsid->val[0] && mp->mnt_stat.f_fsid.val[1] == fsid->val[1]) { error = vfs_busy(mp, MBF_MNTLSTLOCK); if (error) { + cache[hash] = NULL; mtx_unlock(&mountlist_mtx); return (NULL); } + cache[hash] = mp; return (mp); } } From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 13:33:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4BE9E58E; Thu, 12 Jun 2014 13:33:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38D282C47; Thu, 12 Jun 2014 13:33:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5CDX2cR050320; Thu, 12 Jun 2014 13:33:02 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CDX2b5050319; Thu, 12 Jun 2014 13:33:02 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406121333.s5CDX2b5050319@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 12 Jun 2014 13:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267395 - head/sys/ofed/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 13:33:02 -0000 Author: hselasky Date: Thu Jun 12 13:33:01 2014 New Revision: 267395 URL: http://svnweb.freebsd.org/changeset/base/267395 Log: - Fix out of range shifting bug in bitops.h. - Make code a bit easier to read by adding parenthesis. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/ofed/include/linux/bitops.h Modified: head/sys/ofed/include/linux/bitops.h ============================================================================== --- head/sys/ofed/include/linux/bitops.h Thu Jun 12 13:17:11 2014 (r267394) +++ head/sys/ofed/include/linux/bitops.h Thu Jun 12 13:33:01 2014 (r267395) @@ -286,14 +286,14 @@ bitmap_empty(unsigned long *addr, int si #define NBLONG (NBBY * sizeof(long)) #define set_bit(i, a) \ - atomic_set_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << (i) % NBLONG) + atomic_set_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << ((i) % NBLONG)) #define clear_bit(i, a) \ - atomic_clear_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << (i) % NBLONG) + atomic_clear_long(&((volatile long *)(a))[(i)/NBLONG], 1UL << ((i) % NBLONG)) #define test_bit(i, a) \ !!(atomic_load_acq_long(&((volatile long *)(a))[(i)/NBLONG]) & \ - 1UL << ((i) % NBLONG)) + (1UL << ((i) % NBLONG))) static inline long test_and_clear_bit(long bit, long *var) @@ -302,7 +302,7 @@ test_and_clear_bit(long bit, long *var) var += bit / (sizeof(long) * NBBY); bit %= sizeof(long) * NBBY; - bit = 1 << bit; + bit = (1UL << bit); do { val = *(volatile long *)var; } while (atomic_cmpset_long(var, val, val & ~bit) == 0); @@ -317,7 +317,7 @@ test_and_set_bit(long bit, long *var) var += bit / (sizeof(long) * NBBY); bit %= sizeof(long) * NBBY; - bit = 1 << bit; + bit = (1UL << bit); do { val = *(volatile long *)var; } while (atomic_cmpset_long(var, val, val | bit) == 0); From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 14:20:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E970C4FF; Thu, 12 Jun 2014 14:20:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5EA0228F; Thu, 12 Jun 2014 14:20:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5CEKwp6070576; Thu, 12 Jun 2014 14:20:58 GMT (envelope-from rodrigo@svn.freebsd.org) Received: (from rodrigo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CEKwi4070575; Thu, 12 Jun 2014 14:20:58 GMT (envelope-from rodrigo@svn.freebsd.org) Message-Id: <201406121420.s5CEKwi4070575@svn.freebsd.org> From: Rodrigo Osorio Date: Thu, 12 Jun 2014 14:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267398 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 14:20:59 -0000 Author: rodrigo (ports committer) Date: Thu Jun 12 14:20:58 2014 New Revision: 267398 URL: http://svnweb.freebsd.org/changeset/base/267398 Log: Add myself to the calendar Approved by: bapt (mentor) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Thu Jun 12 13:59:14 2014 (r267397) +++ head/usr.bin/calendar/calendars/calendar.freebsd Thu Jun 12 14:20:58 2014 (r267398) @@ -284,6 +284,7 @@ 09/03 Cheng-Lung Sung born in Taipei, Taiwan, Republic of China, 1977 09/05 Mark Robert Vaughan Murray born in Harare, Mashonaland, Zimbabwe, 1961 09/05 Adrian Harold Chadd born in Perth, Western Australia, Australia, 1979 +09/05 Rodrigo Osorio born in Montevideo, Uruguay, 1975 09/07 Tim Bishop born in Cornwall, United Kingdom, 1978 09/07 Chris Rees born in Kettering, United Kingdom, 1987 09/08 Boris Samorodov born in Krasnodar, Russian Federation, 1963 From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 15:23:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D8FF55C; Thu, 12 Jun 2014 15:23:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A9482845; Thu, 12 Jun 2014 15:23:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5CFNq0V001335; Thu, 12 Jun 2014 15:23:52 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CFNqxA001333; Thu, 12 Jun 2014 15:23:52 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406121523.s5CFNqxA001333@svn.freebsd.org> From: Ed Maste Date: Thu, 12 Jun 2014 15:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267400 - head/share/vt/fonts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 15:23:52 -0000 Author: emaste Date: Thu Jun 12 15:23:51 2014 New Revision: 267400 URL: http://svnweb.freebsd.org/changeset/base/267400 Log: Add thin versions of VGAROM 8x8 and 8x16 fonts for vt(4) These are converted from syscons(4) cp437-thin-8x* fonts. Added: head/share/vt/fonts/vgarom-thin-8x16.hex (contents, props changed) head/share/vt/fonts/vgarom-thin-8x8.hex (contents, props changed) Added: head/share/vt/fonts/vgarom-thin-8x16.hex ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/fonts/vgarom-thin-8x16.hex Thu Jun 12 15:23:51 2014 (r267400) @@ -0,0 +1,259 @@ +# $FreeBSD$ +# Height: 16 +# Width: 8 +0000:00000000000000000000000000000000 +0020:00000000000000000000000000000000 +0021:00001038383810101000101000000000 +0022:00424242420000000000000000000000 +0023:0000004444FE444444FE444400000000 +0024:10107C828240300C0482827C10100000 +0025:00000000008284081020428200000000 +0026:00003844443838474444443B00000000 +0027:00202040000000000000000000000000 +0028:00000408101010101010080400000000 +0029:00002010080808080808102000000000 +002A:00000000002418FF1824000000000000 +002B:000000000010107C1010000000000000 +002C:00000000000000000010101020000000 +002D:00000000000000FE0000000000000000 +002E:00000000000000000000101000000000 +002F:00000000000204081020408000000000 +0030:00003844828292928282443800000000 +0031:00000818380808080808083E00000000 +0032:00007C8202040810204082FE00000000 +0033:00007C8202023C020202827C00000000 +0034:00000C14244484FE0404040E00000000 +0035:0000FE808080FC020202827C00000000 +0036:000038408080FC828282827C00000000 +0037:0000FE82020204081010101000000000 +0038:00007C8282827C828282827C00000000 +0039:00007C8282827E020202047800000000 +003A:00000000101000000010100000000000 +003B:00000000101000000010102000000000 +003C:00000004081020402010080400000000 +003D:00000000007E00007E00000000000000 +003E:00000040201008040810204000000000 +003F:00007C82820204080800080800000000 +0040:0000007C82829E92928C807C00000000 +0041:00001028448282FE8282828200000000 +0042:0000FC4242427C42424242FC00000000 +0043:00003C42828080808082423C00000000 +0044:0000F84442424242424244F800000000 +0045:0000FE4242487848404242FE00000000 +0046:0000FE4242487848404040E000000000 +0047:00003C428280809E8282463A00000000 +0048:000082828282FE828282828200000000 +0049:00003810101010101010103800000000 +004A:00000E04040404048484847800000000 +004B:0000C24242444878444242C200000000 +004C:0000E04040404040404242FE00000000 +004D:000082C6AA9282828282828200000000 +004E:00008282C2A2928A8682828200000000 +004F:00003844828282828282443800000000 +0050:0000FC4242427C40404040E000000000 +0051:00007C828282828282928A7C04020000 +0052:0000FC4242427C44424242C200000000 +0053:00007C828240300C0482827C00000000 +0054:0000FE92921010101010103800000000 +0055:00008282828282828282827C00000000 +0056:00008282828282828244281000000000 +0057:000082828282828292AAC68200000000 +0058:00008282442810284482828200000000 +0059:00008282824438101010103800000000 +005A:0000FE8282041820408282FE00000000 +005B:00003C20202020202020203C00000000 +005C:00000080402010080402010000000000 +005D:00003C04040404040404043C00000000 +005E:10284482000000000000000000000000 +005F:00000000000000000000000000FF0000 +0060:10100800000000000000000000000000 +0061:000000000078047C84848C7600000000 +0062:0000C040407844424242427C00000000 +0063:00000000007C82808080827C00000000 +0064:00000C04043C448484848C7600000000 +0065:00000000007C8282FE80827C00000000 +0066:000038444440E040404040E000000000 +0067:0000000000768C848484847C04847800 +0068:0000C040407C4242424242C200000000 +0069:00001010003010101010103800000000 +006A:00000202000602020202020242423C00 +006B:0000C04040424448784442C200000000 +006C:00003010101010101010103800000000 +006D:0000000000EC92929292929200000000 +006E:0000000000DC62424242424200000000 +006F:00000000007C82828282827C00000000 +0070:0000000000DC62424242427C4040E000 +0071:0000000000768C848484847C04040E00 +0072:0000000000DC6242404040E000000000 +0073:00000000007C82807C02827C00000000 +0074:0000202020F820202020221C00000000 +0075:000000000084848484848C7600000000 +0076:00000000004242424242241800000000 +0077:000000000082828292AAC68200000000 +0078:00000000008244281028448200000000 +0079:00000000008282828282827E02047800 +007A:0000000000FE8408102042FE00000000 +007B:00000E10101060101010100E00000000 +007C:00001010101000101010101000000000 +007D:00007008080806080808087000000000 +007E:000076DC000000000000000000000000 +00A0:00000000000000000000000000000000 +00A1:00001010001010103838381000000000 +00A2:00101038444040404838101000000000 +00A3:0038444440E04040404042FC00000000 +00A5:0000444428107C107C10101000000000 +00A7:007C864038448282443804C27C000000 +00AA:003C44443E007E000000000000000000 +00AB:00000000002448904824000000000000 +00AC:000000000000FE060606060000000000 +00B0:00384444380000000000000000000000 +00B1:0000000010107C10100000FE00000000 +00B2:00708810204878000000000000000000 +00B5:0000000042424242427C4040C0000000 +00B6:00007F89898979090909090900000000 +00B7:00000000000000181800000000000000 +00BA:0038444438007C000000000000000000 +00BB:00000000008844224488000000000000 +00BC:0080808284881020468A123E02020000 +00BD:0080808284881020409C0204081E0000 +00BF:00002020002020408082827C00000000 +00C4:0082001028448282FE82828200000000 +00C5:3844381028448282FE82828200000000 +00C6:00003E448484FE848484848600000000 +00C7:00003C428280808082423C04027C0000 +00C9:081020FE4240407C404042FE00000000 +00D1:76DC0082C2A2928A8682828200000000 +00D6:0082007C828282828282827C00000000 +00DC:00820082828282828282827C00000000 +00DF:000078848484B884828282BC80000000 +00E0:004020100078047C84848C7600000000 +00E1:000810200078047C84848C7600000000 +00E2:001028440078047C84848C7600000000 +00E4:000084840078047C84848C7600000000 +00E5:003844380078047C84848C7600000000 +00E6:00000000008C52327E88986E00000000 +00E7:000000003C424040423C04023C000000 +00E8:00402010007C8282FE80827C00000000 +00E9:00040810007C8282FE80827C00000000 +00EA:00102844007C8282FE80827C00000000 +00EB:00008400007C8282FE80827C00000000 +00EC:00402010001808080808081C00000000 +00ED:00040810001808080808081C00000000 +00EE:00182442001808080808081C00000000 +00EF:00004444001808080808081C00000000 +00F1:000076DC00DC62424242424200000000 +00F2:00402010007C82828282827C00000000 +00F3:00081020007C82828282827C00000000 +00F4:00102844007C82828282827C00000000 +00F6:00004400007C82828282827C00000000 +00F7:000000001010007C0010100000000000 +00F9:004020100084848484848C7600000000 +00FA:000810200084848484848C7600000000 +00FB:003048840084848484848C7600000000 +00FC:000084000084848484848C7600000000 +00FF:00008200000082828282827E02047800 +0192:0006090808083E080808080848300000 +0393:0000FE82828080808080808000000000 +0398:00000038448282FE8282443800000000 +03A3:000000FE82402010204082FE00000000 +03A6:0000007C103844444438107C00000000 +03A9:0000384482828244282828EE00000000 +03B1:00000000006294988898946200000000 +03B4:00001E1008043E424242423C00000000 +03B5:00001C20404078404040201C00000000 +03C0:00000000FE4444444444444400000000 +03C3:00000000007E88888888887000000000 +03C4:0000000072D408080808080800000000 +03C6:00000001027E8991A17E408000000000 +2022:000000000000183C3C18000000000000 +203C:00004242424242424200424200000000 +207F:00D86444444444000000000000000000 +20A7:00F88484F884849E8484848600000000 +2190:00000000002040FE4020000000000000 +2191:000010387C1010101010101000000000 +2192:00000000000804FE0408000000000000 +2193:0000101010101010107C381000000000 +2194:0000000000286CFE6C28000000000000 +2195:000010387C1010107C38100000000000 +21A8:000010387C1010107C38107C00000000 +2219:00000000000000001800000000000000 +221A:000F0808080808E82828281800000000 +221E:00000000007E9999997E000000000000 +221F:000000000000808080FE000000000000 +2229:0000007C828282828282828200000000 +2248:000000000076DC0076DC000000000000 +2261:00000000FE0000FE0000FE0000000000 +2264:00000008102040201008007E00000000 +2265:00000010080402040810007E00000000 +2302:00000000102844828282FE0000000000 +2310:000000000000FEC0C0C0C00000000000 +2320:00000E11111010101010101010101010 +2321:08080808080808080888887070000000 +2500:00000000000000FF0000000000000000 +2502:18181818181818181818181818181818 +250C:000000000000001F1818181818181818 +2510:00000000000000F81818181818181818 +2514:181818181818181F0000000000000000 +2518:18181818181818F80000000000000000 +251C:181818181818181F1818181818181818 +2524:18181818181818F81818181818181818 +252C:00000000000000FF1818181818181818 +2534:18181818181818FF0000000000000000 +253C:18181818181818FF1818181818181818 +2550:0000000000FF00FF0000000000000000 +2551:36363636363636363636363636363636 +2552:00000000001F181F1818181818181818 +2553:000000000000003F3636363636363636 +2554:00000000003F30373636363636363636 +2555:0000000000F818F81818181818181818 +2556:00000000000000FE3636363636363636 +2557:0000000000FE06F63636363636363636 +2558:18181818181F181F0000000000000000 +2559:363636363636363F0000000000000000 +255A:363636363637303F0000000000000000 +255B:1818181818F818F80000000000000000 +255C:36363636363636FE0000000000000000 +255D:3636363636F606FE0000000000000000 +255E:18181818181F181F1818181818181818 +255F:36363636363636373636363636363636 +2560:36363636363730373636363636363636 +2561:1818181818F818F81818181818181818 +2562:36363636363636F63636363636363636 +2563:3636363636F606F63636363636363636 +2564:0000000000FF00FF1818181818181818 +2565:00000000000000FF3636363636363636 +2566:0000000000FF00F73636363636363636 +2567:1818181818FF00FF0000000000000000 +2568:36363636363636FF0000000000000000 +2569:3636363636F700FF0000000000000000 +256A:1818181818FF18FF1818181818181818 +256B:36363636363636FF3636363636363636 +256C:3636363636F700F73636363636363636 +2580:FFFFFFFFFFFFFF000000000000000000 +2584:00000000000000FFFFFFFFFFFFFFFFFF +2588:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +258C:F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 +2590:0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F +2591:11441144114411441144114411441144 +2592:55AA55AA55AA55AA55AA55AA55AA55AA +2593:DD77DD77DD77DD77DD77DD77DD77DD77 +25A0:000000007C7C7C7C7C7C7C0000000000 +25AC:0000000000000000FEFEFEFE00000000 +25B2:000000001038387C7CFEFE0000000000 +25BA:0080C0E0F0F8FEF8F0E0C08000000000 +25BC:00000000FEFE7C7C3838100000000000 +25C4:0002060E1E3EFE3E1E0E060200000000 +25CB:00000000003C664242663C0000000000 +25D8:FFFFFFFFFFFFE7C3C3E7FFFFFFFFFFFF +25D9:FFFFFFFFFFC399BDBD99C3FFFFFFFFFF +263A:00007E81A58181BD9981817E00000000 +263B:00007EFFDBFFFFC3E7FFFF7E00000000 +263C:0000001010D638EE38D6101000000000 +2640:0000384444444438107C101000000000 +2642:00003E0A122278848484847800000000 +2660:000000183C7EFFFF7E18183C00000000 +2663:000000183C3CE7E7E718183C00000000 +2665:000000006CFEFEFEFE7C381000000000 +2666:0000000010387CFE7C38100000000000 +266A:00003F213F2020202060E0C000000000 +266C:00003F213F212121212367E6C0000000 Added: head/share/vt/fonts/vgarom-thin-8x8.hex ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/fonts/vgarom-thin-8x8.hex Thu Jun 12 15:23:51 2014 (r267400) @@ -0,0 +1,258 @@ +# $FreeBSD$ +# Height: 8 +# Width: 8 +0020:0000000000000000 +0021:1038381010001000 +0022:2424240000000000 +0023:2424FF24FF242400 +0024:107C807804F81000 +0025:00C6CC183066C600 +0026:3844385684847600 +0027:2020400000000000 +0028:1020404040201000 +0029:2010080808102000 +002A:004438FE38440000 +002B:001010FE10100000 +002C:0000000000101020 +002D:000000FC00000000 +002E:0000000000101000 +002F:0204081020408000 +0030:7C82868A92A27C00 +0031:1030101010107C00 +0032:788404104084FC00 +0033:7884043804847800 +0034:08182848FE081C00 +0035:FC80F80404847800 +0036:384080F884847800 +0037:FC84081020202000 +0038:7884847884847800 +0039:7884847C04087000 +003A:0010100000101000 +003B:0010100000101020 +003C:1020408040201000 +003D:0000FC0000FC0000 +003E:2010080408102000 +003F:7884040810001000 +0040:7C829E929E807800 +0041:30488484FC848400 +0042:FC42427C4242FC00 +0043:3C42808080423C00 +0044:F84442424244F800 +0045:FE4248784842FE00 +0046:FE4248784840E000 +0047:3C4280808E423E00 +0048:848484FC84848400 +0049:3810101010103800 +004A:0E04040444443800 +004B:C24448704442C200 +004C:E04040404042FE00 +004D:82C6AA9282828200 +004E:82C2A2928A868200 +004F:3844828282443800 +0050:FC42427C4040E000 +0051:3844828282543804 +0052:FC42427C4442C200 +0053:3884807804847400 +0054:FE92101010103800 +0055:848484848484FC00 +0056:8484848484483000 +0057:82828292AAC68200 +0058:8244281028448200 +0059:8244281010103800 +005A:FE8488102242FE00 +005B:7840404040407800 +005C:8040201008040200 +005D:7808080808087800 +005E:1028448200000000 +005F:00000000000000FF +0060:2020100000000000 +0061:000078047C847600 +0062:C0407C424242DC00 +0063:0000788480847800 +0064:0C047C8484847600 +0065:00007884FC807800 +0066:384440E04040E000 +0067:00007684847C04F8 +0068:C0404C624242C200 +0069:1000301010103800 +006A:0400040404848478 +006B:C04042447844C200 +006C:3010101010103800 +006D:0000EC9292928200 +006E:0000F88484848400 +006F:0000788484847800 +0070:0000DC42427C40E0 +0071:00007684847C040E +0072:0000DC624040E000 +0073:00007C807804F800 +0074:10107C1010120C00 +0075:0000848484847600 +0076:0000848484483000 +0077:00008292AAC68200 +0078:0000844830488400 +0079:00008484847C04F8 +007A:0000FC883044FC00 +007B:182020C020201800 +007C:1010100010101000 +007D:6010100C10106000 +007E:6498000000000000 +00A0:0000000000000000 +00A1:1010001038381000 +00A2:10107E80807E1010 +00A3:384444E04082FC00 +00A5:4428107C107C1010 +00A7:3E61384444388C78 +00AA:3C44443A007E0000 +00AB:0022448844220000 +00AC:000000FC0C0C0000 +00B0:3844443800000000 +00B1:2020FC202000FC00 +00B2:3048102078000000 +00B5:00424242427C4080 +00B6:7F92927212121200 +00B7:0000001818000000 +00BA:38444438007C0000 +00BB:0044221122440000 +00BC:4244485365498F01 +00BD:424448566942840F +00BF:2000204080847800 +00C4:82384482FE828200 +00C5:30104482FE828200 +00C6:3F4888FF88888F00 +00C7:7884808478180478 +00C9:0CFC40784040FC00 +00D1:649884A494848400 +00D6:4218244242241800 +00DC:8400848484847800 +00DF:007884F884F88080 +00E0:C00078047C847A00 +00E1:1C0078047C847A00 +00E2:7E813C023E423D00 +00E4:840078047C847A00 +00E5:202078047C847A00 +00E6:000067197F987700 +00E7:0000788080780438 +00E8:60007884FC807800 +00E9:0C007884FC807800 +00EA:7E813C427E403C00 +00EB:84007884FC807800 +00EC:6000301010103800 +00ED:1800301010103800 +00EE:7C82301010103800 +00EF:4800301010103800 +00F1:6498B8C484848400 +00F2:C000788484847800 +00F3:0810788484847800 +00F4:7884788484847800 +00F6:8400788484847800 +00F7:202000F800202000 +00F9:2010424242423C00 +00FA:0810848484847A00 +00FB:7E81424242423C00 +00FC:0084008484847A00 +00FF:84008484847C04F8 +0192:0C12103810109060 +0393:00FC848080808000 +0398:384482FE82443800 +03A3:FC8440204084FC00 +03A6:F8207088887020F8 +03A9:3844828228286C00 +03B1:0000629488946200 +03B4:1C10087C84847800 +03B5:384080F880403800 +03C0:00FE282828282800 +03C3:00007E8888887000 +03C4:0076880808080800 +03C6:02047E89917E4080 +2022:0000183C3C180000 +203C:2424242424002400 +207F:5844444444000000 +20A7:F88484F882878283 +2190:002040FE40200000 +2191:10387C1010101000 +2192:000804FE04080000 +2193:101010107C381000 +2194:002466FF66240000 +2195:10387C10107C3810 +21A8:10387C107C3810FE +2219:0000000018000000 +221A:0704040464241C0C +221E:00007C92927C0000 +221F:0000808080FE0000 +2229:7884848484848400 +2248:0064980064980000 +2261:00FC00FC00FC0000 +2264:102040201000FC00 +2265:402010204000FC00 +2302:001028448282FE00 +2310:000000FCC0C00000 +2320:0E11111010101010 +2321:0808080808888870 +2500:00000000FF000000 +2502:1818181818181818 +250C:000000001F181818 +2510:00000000F8181818 +2514:181818181F000000 +2518:18181818F8000000 +251C:181818181F181818 +2524:18181818F8181818 +252C:00000000FF181818 +2534:18181818FF000000 +253C:18181818FF181818 +2550:0000FF00FF000000 +2551:3636363636363636 +2552:00001F181F181818 +2553:000000003F363636 +2554:00003F3037363636 +2555:0000F818F8181818 +2556:00000000FE363636 +2557:0000FE06F6363636 +2558:18181F181F000000 +2559:363636363F000000 +255A:363637303F000000 +255B:1818F818F8000000 +255C:36363636FE000000 +255D:3636F606FE000000 +255E:18181F181F181818 +255F:3636363637363636 +2560:3636373037363636 +2561:1818F818F8181818 +2562:36363636F6363636 +2563:3636F606F6363636 +2564:0000FF00FF181818 +2565:00000000FF363636 +2566:0000FF00F7363636 +2567:1818FF00FF000000 +2568:36363636FF000000 +2569:3636F700FF000000 +256A:1818FF18FF181818 +256B:36363636FF363636 +256C:3636F700F7363636 +2580:FFFFFFFF00000000 +2584:00000000FFFFFFFF +2588:FFFFFFFFFFFFFFFF +258C:F0F0F0F0F0F0F0F0 +2590:0F0F0F0F0F0F0F0F +2591:2288228822882288 +2592:55AA55AA55AA55AA +2593:77DD77DD77DD77DD +25A0:00003C3C3C3C0000 +25AC:000000007E7E7E00 +25B2:00183C7EFFFF0000 +25BA:80E0F8FEF8E08000 +25BC:00FFFF7E3C180000 +25C4:020E3EFE3E0E0200 +25CB:003C664242663C00 +25D8:FFFFE7C3C3E7FFFF +25D9:FFC399BDBD99C3FF +263A:7E81A581BD99817E +263B:7EFFDBFFC3E7FF7E +263C:995A3CE7E73C5A99 +2640:3E4141413E083E08 +2642:1F03057D84848478 +2660:101038ECFE7C107C +2663:387C38FED610107C +2665:6CFEFEFE7C381000 +2666:10387CFE7C381000 +266A:3F213F20202060C0 +266C:3F213F21212366C0 From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 16:12:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35254A52; Thu, 12 Jun 2014 16:12:00 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E84D32CF0; Thu, 12 Jun 2014 16:11:59 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s5CGBqZi018489 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 Jun 2014 09:11:53 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s5CGBqwf018488; Thu, 12 Jun 2014 09:11:52 -0700 (PDT) (envelope-from jmg) Date: Thu, 12 Jun 2014 09:11:52 -0700 From: John-Mark Gurney To: "Andrey V. Elsukov" Subject: Re: svn commit: r267357 - head/sys/geom/part Message-ID: <20140612161152.GR31367@funkthat.com> References: <201406111019.s5BAJBjW085880@svn.freebsd.org> <53995119.5040609@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53995119.5040609@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 12 Jun 2014 09:11:53 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dmitry Morozovsky X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 16:12:00 -0000 Andrey V. Elsukov wrote this message on Thu, Jun 12, 2014 at 11:04 +0400: > On 11.06.2014 17:48, Dmitry Morozovsky wrote: > > On Wed, 11 Jun 2014, Andrey V. Elsukov wrote: > > > >> Author: ae > >> Date: Wed Jun 11 10:19:11 2014 > >> New Revision: 267357 > >> URL: http://svnweb.freebsd.org/changeset/base/267357 > >> > >> Log: > >> Add aliases for DragonFlyBSD's partition types. > > > > These should be documented in sbin/geom/class/part/gpart.8 also. > > I don't think we should document partition types for all foreign > systems. gpart(8) exists only in FreeBSD and it's purpose manage > partitions in FreeBSD. We already have a lot of NetBSD's and Apple's > aliases that aren't documented, but nobody complained about that. I did... The problem is it's hard for users to complain about stuff not being documented when they don't know to complain about it... I sent direct email to the authors who committed the undocumented work, and one of them (Thanks Dmitry!) did spend the time to fix it... > In this case it is mostly cosmetic change. It allows to see aliases in > the `gpart show` output. Having a lot of partition types documented can > confuse users. IMHO. :) If the user gets confused by this, they probably shouldn't be using the command, or at least reading other docs for help on using them... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 16:31:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28B27340; Thu, 12 Jun 2014 16:31:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15C802E43; Thu, 12 Jun 2014 16:31:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5CGVFJs033298; Thu, 12 Jun 2014 16:31:15 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CGVFm4033297; Thu, 12 Jun 2014 16:31:15 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201406121631.s5CGVFm4033297@svn.freebsd.org> From: John-Mark Gurney Date: Thu, 12 Jun 2014 16:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267408 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 16:31:16 -0000 Author: jmg Date: Thu Jun 12 16:31:15 2014 New Revision: 267408 URL: http://svnweb.freebsd.org/changeset/base/267408 Log: clear the write bit... This allows my AVILA board to survive a portsnap extract, where previously it would panic.. clearly someone who knows pmap should optimize this code per alc's comment... Submitted by: alc MFC after: probably Modified: head/sys/arm/arm/pmap.c Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Thu Jun 12 16:26:26 2014 (r267407) +++ head/sys/arm/arm/pmap.c Thu Jun 12 16:31:15 2014 (r267408) @@ -3034,7 +3034,14 @@ pmap_remove_all(vm_page_t m) if (TAILQ_EMPTY(&m->md.pv_list)) return; rw_wlock(&pvh_global_lock); - pmap_remove_write(m); + + /* + * XXX This call shouldn't exist. Iterating over the PV list twice, + * once in pmap_clearbit() and again below, is both unnecessary and + * inefficient. The below code should itself write back the cache + * entry before it destroys the mapping. + */ + pmap_clearbit(m, PVF_WRITE); curpm = vmspace_pmap(curproc->p_vmspace); while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { if (flush == FALSE && (pv->pv_pmap == curpm || @@ -3043,7 +3050,7 @@ pmap_remove_all(vm_page_t m) PMAP_LOCK(pv->pv_pmap); /* - * Cached contents were written-back in pmap_remove_write(), + * Cached contents were written-back in pmap_clearbit(), * but we still have to invalidate the cache entry to make * sure stale data are not retrieved when another page will be * mapped under this virtual address. From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 16:47:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9B05F9F; Thu, 12 Jun 2014 16:47:01 +0000 (UTC) Received: from pp1.rice.edu (proofpoint1.mail.rice.edu [128.42.201.100]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0A1A2038; Thu, 12 Jun 2014 16:47:01 +0000 (UTC) Received: from pps.filterd (pp1.rice.edu [127.0.0.1]) by pp1.rice.edu (8.14.5/8.14.5) with SMTP id s5CGkblm030652; Thu, 12 Jun 2014 11:46:54 -0500 Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by pp1.rice.edu with ESMTP id 1megfvrqnk-1; Thu, 12 Jun 2014 11:46:53 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id 463C1460221; Thu, 12 Jun 2014 11:46:53 -0500 (CDT) Message-ID: <5399D97C.5090608@rice.edu> Date: Thu, 12 Jun 2014 11:46:52 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: John-Mark Gurney , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r267408 - head/sys/arm/arm References: <201406121631.s5CGVFm4033297@svn.freebsd.org> In-Reply-To: <201406121631.s5CGVFm4033297@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 kscore.compositescore=0 circleOfTrustscore=0 compositescore=0.713890987064109 urlsuspect_oldscore=0.713890987064109 suspectscore=4 recipient_domain_to_sender_totalscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=1 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=0 rbsscore=0.713890987064109 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1406120195 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 16:47:02 -0000 On 06/12/2014 11:31, John-Mark Gurney wrote: > Author: jmg > Date: Thu Jun 12 16:31:15 2014 > New Revision: 267408 > URL: http://svnweb.freebsd.org/changeset/base/267408 > > Log: > clear the write bit... This allows my AVILA board to survive a > portsnap extract, where previously it would panic.. clearly someone > who knows pmap should optimize this code per alc's comment... > > Submitted by: alc > MFC after: probably Yes, 10.x definitely needs this change. I'm less certain about 9.x, but it's not going to break anything if you do commit it to 9.x. > Modified: > head/sys/arm/arm/pmap.c > > Modified: head/sys/arm/arm/pmap.c > ============================================================================== > --- head/sys/arm/arm/pmap.c Thu Jun 12 16:26:26 2014 (r267407) > +++ head/sys/arm/arm/pmap.c Thu Jun 12 16:31:15 2014 (r267408) > @@ -3034,7 +3034,14 @@ pmap_remove_all(vm_page_t m) > if (TAILQ_EMPTY(&m->md.pv_list)) > return; > rw_wlock(&pvh_global_lock); > - pmap_remove_write(m); > + > + /* > + * XXX This call shouldn't exist. Iterating over the PV list twice, > + * once in pmap_clearbit() and again below, is both unnecessary and > + * inefficient. The below code should itself write back the cache > + * entry before it destroys the mapping. > + */ > + pmap_clearbit(m, PVF_WRITE); > curpm = vmspace_pmap(curproc->p_vmspace); > while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { > if (flush == FALSE && (pv->pv_pmap == curpm || > @@ -3043,7 +3050,7 @@ pmap_remove_all(vm_page_t m) > > PMAP_LOCK(pv->pv_pmap); > /* > - * Cached contents were written-back in pmap_remove_write(), > + * Cached contents were written-back in pmap_clearbit(), > * but we still have to invalidate the cache entry to make > * sure stale data are not retrieved when another page will be > * mapped under this virtual address. > > From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 17:19:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B84D527; Thu, 12 Jun 2014 17:19:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 485B12388; Thu, 12 Jun 2014 17:19:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5CHJwGk054705; Thu, 12 Jun 2014 17:19:58 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CHJwmx054704; Thu, 12 Jun 2014 17:19:58 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406121719.s5CHJwmx054704@svn.freebsd.org> From: Glen Barber Date: Thu, 12 Jun 2014 17:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267420 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 17:19:58 -0000 Author: gjb Date: Thu Jun 12 17:19:57 2014 New Revision: 267420 URL: http://svnweb.freebsd.org/changeset/base/267420 Log: Fix a typo in note for r266209, pmcstat(8) Spotted by: emaste Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 12 17:16:29 2014 (r267419) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 12 17:19:57 2014 (r267420) @@ -317,7 +317,7 @@ The &man.pmcstat.8; utility has been updated to include a new flag, -l, which - adds event collection after the specified number of + ends event collection after the specified number of seconds. The default &man.newsyslog.conf.5; now From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 18:31:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D502C00; Thu, 12 Jun 2014 18:31:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4068E2A3D; Thu, 12 Jun 2014 18:31:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5CIVXlj087515; Thu, 12 Jun 2014 18:31:33 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CIVWZd087511; Thu, 12 Jun 2014 18:31:32 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201406121831.s5CIVWZd087511@svn.freebsd.org> From: Ed Maste Date: Thu, 12 Jun 2014 18:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267423 - in head: . share/vt/fonts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 18:31:33 -0000 Author: emaste Date: Thu Jun 12 18:31:32 2014 New Revision: 267423 URL: http://svnweb.freebsd.org/changeset/base/267423 Log: Build vt(4) fonts during buildworld vtfontcvt(8) is now built during buildworld, so can be used as a bootstrap tool to create vt(4) fonts from source .hex or .bdf font files, rather than having uuencoded binary fonts in the tree. Sponsored by: The FreeBSD Foundation Deleted: head/share/vt/fonts/vgarom-8x14.fnt.uu head/share/vt/fonts/vgarom-8x16.fnt.uu head/share/vt/fonts/vgarom-8x8.fnt.uu Modified: head/Makefile.inc1 head/share/vt/fonts/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Jun 12 17:22:04 2014 (r267422) +++ head/Makefile.inc1 Thu Jun 12 18:31:32 2014 (r267423) @@ -1196,6 +1196,10 @@ _gperf= gnu/usr.bin/gperf _groff= gnu/usr.bin/groff .endif +.if ${MK_VT_SUPPORT} != "no" +_vtfontcvt= usr.bin/vtfontcvt +.endif + .if ${BOOTSTRAPPING} < 900002 _sed= usr.bin/sed .endif @@ -1295,7 +1299,8 @@ bootstrap-tools: .MAKE ${_gensnmptree} \ usr.sbin/config \ ${_crunch} \ - ${_nmtree} + ${_nmtree} \ + ${_vtfontcvt} ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_tool} && \ ${MAKE} DIRPRFX=${_tool}/ obj && \ Modified: head/share/vt/fonts/Makefile ============================================================================== --- head/share/vt/fonts/Makefile Thu Jun 12 17:22:04 2014 (r267422) +++ head/share/vt/fonts/Makefile Thu Jun 12 18:31:32 2014 (r267423) @@ -3,13 +3,18 @@ FILES= gallant.fnt \ vgarom-8x8.fnt \ vgarom-8x14.fnt \ - vgarom-8x16.fnt + vgarom-8x16.fnt \ + vgarom-thin-8x8.fnt \ + vgarom-thin-8x16.fnt CLEANFILES+= ${FILES} -.SUFFIXES: .uu -.uu: - uudecode < ${.IMPSRC} +.SUFFIXES: .fnt .fnt.uu .hex +.hex.fnt: + vtfontcvt ${.IMPSRC} ${.TARGET} + +.fnt.uu.fnt: + uudecode -p < ${.IMPSRC} > ${.TARGET} FILESDIR= ${SHAREDIR}/vt/fonts From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 18:54:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8844D4AA; Thu, 12 Jun 2014 18:54:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 754A02CCA; Thu, 12 Jun 2014 18:54:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5CIsrBB000141; Thu, 12 Jun 2014 18:54:53 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CIsrmq000136; Thu, 12 Jun 2014 18:54:53 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201406121854.s5CIsrmq000136@svn.freebsd.org> From: Julio Merino Date: Thu, 12 Jun 2014 18:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267424 - in head: share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 18:54:53 -0000 Author: jmmv Date: Thu Jun 12 18:54:52 2014 New Revision: 267424 URL: http://svnweb.freebsd.org/changeset/base/267424 Log: Enable MK_TESTS by default. This was never intended to be off by default but was done this way because the initial patches broke the build. Things seem stable now (have been so for a while too) and "make tinderbox" is clean so let's try again. Announced in freebsd-current; all reported shortcomings have been addressed. Added: head/tools/build/options/WITHOUT_TESTS - copied, changed from r267422, head/tools/build/options/WITH_TESTS Deleted: head/tools/build/options/WITH_TESTS Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Jun 12 18:31:32 2014 (r267423) +++ head/share/mk/src.opts.mk Thu Jun 12 18:54:52 2014 (r267424) @@ -143,6 +143,7 @@ __DEFAULT_YES_OPTIONS = \ SYSINSTALL \ TCSH \ TELNET \ + TESTS \ TEXTPROC \ UNBOUND \ USB \ @@ -168,7 +169,6 @@ __DEFAULT_NO_OPTIONS = \ SHARED_TOOLCHAIN \ SORT_THREADS \ SVN \ - TESTS \ USB_GADGET_EXAMPLES # Copied and modified: head/tools/build/options/WITHOUT_TESTS (from r267422, head/tools/build/options/WITH_TESTS) ============================================================================== --- head/tools/build/options/WITH_TESTS Thu Jun 12 17:22:04 2014 (r267422, copy source) +++ head/tools/build/options/WITHOUT_TESTS Thu Jun 12 18:54:52 2014 (r267424) @@ -1,8 +1,9 @@ .\" $FreeBSD$ -Set to install the +Set to not build nor install the .Fx Test Suite in .Pa /usr/tests/ . See .Xr tests 7 for more details. +This also disables the build of all test-related dependencies, including ATF. From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 18:59:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A182789; Thu, 12 Jun 2014 18:59:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 872BC2D33; Thu, 12 Jun 2014 18:59:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5CIxP52000954; Thu, 12 Jun 2014 18:59:25 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CIxPnX000953; Thu, 12 Jun 2014 18:59:25 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201406121859.s5CIxPnX000953@svn.freebsd.org> From: Julio Merino Date: Thu, 12 Jun 2014 18:59:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267425 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 18:59:25 -0000 Author: jmmv Date: Thu Jun 12 18:59:25 2014 New Revision: 267425 URL: http://svnweb.freebsd.org/changeset/base/267425 Log: Regen after r267424 to replace WITH_TESTS with WITHOUT_TESTS. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Jun 12 18:54:52 2014 (r267424) +++ head/share/man/man5/src.conf.5 Thu Jun 12 18:59:25 2014 (r267425) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd June 8, 2014 +.Dd June 11, 2014 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1021,15 +1021,16 @@ Set to not build and install Set to not build .Xr telnet 8 and related programs. -.It Va WITH_TESTS -.\" from FreeBSD: head/tools/build/options/WITH_TESTS 267033 2014-06-03 22:34:27Z jmmv -Set to install the +.It Va WITHOUT_TESTS +.\" from FreeBSD: head/tools/build/options/WITHOUT_TESTS 267424 2014-06-12 18:54:52Z jmmv +Set to not build nor install the .Fx Test Suite in .Pa /usr/tests/ . See .Xr tests 7 for more details. +This also disables the build of all test-related dependencies, including ATF. .It Va WITHOUT_TEXTPROC .\" from FreeBSD: head/tools/build/options/WITHOUT_TEXTPROC 183242 2008-09-21 22:02:26Z sam Set to not build From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 19:01:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 20F6991B; Thu, 12 Jun 2014 19:01:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E7F52DD3; Thu, 12 Jun 2014 19:01:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5CJ1wmq004609; Thu, 12 Jun 2014 19:01:58 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CJ1wwJ004606; Thu, 12 Jun 2014 19:01:58 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201406121901.s5CJ1wwJ004606@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 12 Jun 2014 19:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267426 - head/usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 19:01:59 -0000 Author: pfg Date: Thu Jun 12 19:01:57 2014 New Revision: 267426 URL: http://svnweb.freebsd.org/changeset/base/267426 Log: Avoid zeroing during allocation. This change reverts a change from OpenBSD which made use of calloc, and therefore wasted time initializing arrays that will later be realloc'ed. Consistently use FreeBSD's reallocf(). While here also merge the changes from OpenBSD's manpage patch.1 Rev 1.27: "patch was moved from user portability (UP) to base in issue 7 and is no longer optional" MFC after: 1 week Modified: head/usr.bin/patch/patch.1 head/usr.bin/patch/pch.c Modified: head/usr.bin/patch/patch.1 ============================================================================== --- head/usr.bin/patch/patch.1 Thu Jun 12 18:59:25 2014 (r267425) +++ head/usr.bin/patch/patch.1 Thu Jun 12 19:01:57 2014 (r267426) @@ -19,9 +19,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: patch.1,v 1.26 2010/09/03 11:09:29 jmc Exp $ +.\" $OpenBSD: patch.1,v 1.27 2014/04/15 06:26:54 jmc Exp $ .\" $FreeBSD$ -.Dd January 29, 2013 +.Dd June 12, 2014 .Dt PATCH 1 .Os .Sh NAME @@ -639,13 +639,10 @@ The .Nm utility is compliant with the .St -p1003.1-2008 -specification -(except as detailed above for the +specification, +except as detailed above for the .Fl -posix -option), -though the presence of -.Nm -itself is optional. +option. .Pp The flags .Op Fl BCEFfstVvxz Modified: head/usr.bin/patch/pch.c ============================================================================== --- head/usr.bin/patch/pch.c Thu Jun 12 18:59:25 2014 (r267425) +++ head/usr.bin/patch/pch.c Thu Jun 12 19:01:57 2014 (r267426) @@ -132,11 +132,11 @@ void set_hunkmax(void) { if (p_line == NULL) - p_line = calloc((size_t) hunkmax, sizeof(char *)); + p_line = malloc((size_t) hunkmax * sizeof(char *)); if (p_len == NULL) - p_len = calloc((size_t) hunkmax, sizeof(short)); + p_len = malloc((size_t) hunkmax * sizeof(short)); if (p_char == NULL) - p_char = calloc((size_t) hunkmax, sizeof(char)); + p_char = malloc((size_t) hunkmax * sizeof(char)); } /* @@ -155,17 +155,9 @@ grow_hunkmax(void) if (p_line == NULL || p_len == NULL || p_char == NULL) fatal("Internal memory allocation error\n"); - new_p_line = realloc(p_line, new_hunkmax * sizeof(char *)); - if (new_p_line == NULL) - free(p_line); - - new_p_len = realloc(p_len, new_hunkmax * sizeof(short)); - if (new_p_len == NULL) - free(p_len); - - new_p_char = realloc(p_char, new_hunkmax * sizeof(char)); - if (new_p_char == NULL) - free(p_char); + new_p_line = reallocf(p_line, new_hunkmax * sizeof(char *)); + new_p_len = reallocf(p_len, new_hunkmax * sizeof(short)); + new_p_char = reallocf(p_char, new_hunkmax * sizeof(char)); p_char = new_p_char; p_len = new_p_len; From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 21:50:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24A0E630; Thu, 12 Jun 2014 21:50:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 122812CDA; Thu, 12 Jun 2014 21:50:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5CLokll081460; Thu, 12 Jun 2014 21:50:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5CLokrb081459; Thu, 12 Jun 2014 21:50:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406122150.s5CLokrb081459@svn.freebsd.org> From: Alexander Motin Date: Thu, 12 Jun 2014 21:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267429 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 21:50:47 -0000 Author: mav Date: Thu Jun 12 21:50:46 2014 New Revision: 267429 URL: http://svnweb.freebsd.org/changeset/base/267429 Log: Fix some leaks on LUN creation error. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Thu Jun 12 21:36:17 2014 (r267428) +++ head/sys/cam/ctl/ctl_backend_block.c Thu Jun 12 21:50:46 2014 (r267429) @@ -2113,9 +2113,14 @@ ctl_be_block_create(struct ctl_be_block_ bailout_error: req->status = CTL_LUN_ERROR; + if (be_lun->io_taskqueue != NULL) + taskqueue_free(be_lun->io_taskqueue); ctl_be_block_close(be_lun); - - free(be_lun->dev_path, M_CTLBLK); + if (be_lun->dev_path != NULL) + free(be_lun->dev_path, M_CTLBLK); + if (be_lun->lun_zone != NULL) + uma_zdestroy(be_lun->lun_zone); + mtx_destroy(&be_lun->lock); free(be_lun, M_CTLBLK); return (retval); From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 23:46:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0485E4B2; Thu, 12 Jun 2014 23:46:21 +0000 (UTC) Received: from mail-qc0-x22d.google.com (mail-qc0-x22d.google.com [IPv6:2607:f8b0:400d:c01::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 892D326FC; Thu, 12 Jun 2014 23:46:20 +0000 (UTC) Received: by mail-qc0-f173.google.com with SMTP id l6so3123028qcy.4 for ; Thu, 12 Jun 2014 16:46:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ObForiqJSK0fY7TbAMRN5+QBd1/zTPh8IIDeePriojQ=; b=tG3NK5paur0npXFQ6iKftHKZhyH13SWTrN4IkXflcqon/uVuUZ6EdQH2Hp3JOmaDoc VLY1KGHoU+qM5RlguXFJ+/ZWMXJj9mkxCvAVikq1fFpyFjybbVt6v919Qerntm2iyy0d wdN1ViSdEyulH/GiTqf50BJrmzg6x8h2AKLYqJf/KmmTbOi3qfBTfDZhw/I7VHz/UMdn GRghLBpjt/osDuHmNNmpf5v1zGwklfU6iTz5TUuBIf3XrO4wRPM+fz3kdI2nEwALt/wu wdh6OjeXLwcFixAFruL5O/jqRbVZxP2PAmrNUZ3JZbDicnbbqZ/uysWTfmQfDLv2hRPd LMxQ== MIME-Version: 1.0 X-Received: by 10.224.130.136 with SMTP id t8mr68671118qas.49.1402616778980; Thu, 12 Jun 2014 16:46:18 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.43.134 with HTTP; Thu, 12 Jun 2014 16:46:18 -0700 (PDT) In-Reply-To: <201406111611.s5BGBCHU058618@svn.freebsd.org> References: <201406111611.s5BGBCHU058618@svn.freebsd.org> Date: Thu, 12 Jun 2014 18:46:18 -0500 X-Google-Sender-Auth: uHTCQuerV81Awq7hX1G4rBZx9Xs Message-ID: Subject: Re: svn commit: r267364 - head/sys/vm From: Adrian Chadd To: Alan Cox Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 23:46:21 -0000 Hi! Wouldn't this also be fixed if popmap_t was a unsigned char (to match what setbit/clrbit/etc do) and then use the existing macros? Is there any reason popmap_t is not a uchar ? Is it ever accessed as anything other than an array of chars? -a On 11 June 2014 11:11, Alan Cox wrote: > Author: alc > Date: Wed Jun 11 16:11:12 2014 > New Revision: 267364 > URL: http://svnweb.freebsd.org/changeset/base/267364 > > Log: > Correct a bug in the management of the population map on big-endian > machines. Specifically, there was a mismatch between how the routine > allocation and deallocation operations accessed the population map > and how the aggressively optimized reservation-breaking operation > accessed it. So, problems only occurred when reservations were broken. > This change makes the routine operations access the population map in > the same way as the reservation breaking operation. > > This bug was introduced in r259999. > > PR: 187080 > Tested by: jmg (on an "armeb" machine) > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/vm/vm_reserv.c > > Modified: head/sys/vm/vm_reserv.c > ============================================================================== > --- head/sys/vm/vm_reserv.c Wed Jun 11 14:53:58 2014 (r267363) > +++ head/sys/vm/vm_reserv.c Wed Jun 11 16:11:12 2014 (r267364) > @@ -108,6 +108,46 @@ typedef u_long popmap_t; > #define NPOPMAP howmany(VM_LEVEL_0_NPAGES, NBPOPMAP) > > /* > + * Clear a bit in the population map. > + */ > +static __inline void > +popmap_clear(popmap_t popmap[], int i) > +{ > + > + popmap[i / NBPOPMAP] &= ~(1UL << (i % NBPOPMAP)); > +} > + > +/* > + * Set a bit in the population map. > + */ > +static __inline void > +popmap_set(popmap_t popmap[], int i) > +{ > + > + popmap[i / NBPOPMAP] |= 1UL << (i % NBPOPMAP); > +} > + > +/* > + * Is a bit in the population map clear? > + */ > +static __inline boolean_t > +popmap_is_clear(popmap_t popmap[], int i) > +{ > + > + return ((popmap[i / NBPOPMAP] & (1UL << (i % NBPOPMAP))) == 0); > +} > + > +/* > + * Is a bit in the population map set? > + */ > +static __inline boolean_t > +popmap_is_set(popmap_t popmap[], int i) > +{ > + > + return ((popmap[i / NBPOPMAP] & (1UL << (i % NBPOPMAP))) != 0); > +} > + > +/* > * The reservation structure > * > * A reservation structure is constructed whenever a large physical page is > @@ -241,7 +281,7 @@ vm_reserv_depopulate(vm_reserv_t rv, int > mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); > KASSERT(rv->object != NULL, > ("vm_reserv_depopulate: reserv %p is free", rv)); > - KASSERT(isset(rv->popmap, index), > + KASSERT(popmap_is_set(rv->popmap, index), > ("vm_reserv_depopulate: reserv %p's popmap[%d] is clear", rv, > index)); > KASSERT(rv->popcnt > 0, > @@ -255,7 +295,7 @@ vm_reserv_depopulate(vm_reserv_t rv, int > rv)); > rv->pages->psind = 0; > } > - clrbit(rv->popmap, index); > + popmap_clear(rv->popmap, index); > rv->popcnt--; > if (rv->popcnt == 0) { > LIST_REMOVE(rv, objq); > @@ -302,7 +342,7 @@ vm_reserv_populate(vm_reserv_t rv, int i > mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); > KASSERT(rv->object != NULL, > ("vm_reserv_populate: reserv %p is free", rv)); > - KASSERT(isclr(rv->popmap, index), > + KASSERT(popmap_is_clear(rv->popmap, index), > ("vm_reserv_populate: reserv %p's popmap[%d] is set", rv, > index)); > KASSERT(rv->popcnt < VM_LEVEL_0_NPAGES, > @@ -313,7 +353,7 @@ vm_reserv_populate(vm_reserv_t rv, int i > TAILQ_REMOVE(&vm_rvq_partpop, rv, partpopq); > rv->inpartpopq = FALSE; > } > - setbit(rv->popmap, index); > + popmap_set(rv->popmap, index); > rv->popcnt++; > if (rv->popcnt < VM_LEVEL_0_NPAGES) { > rv->inpartpopq = TRUE; > @@ -503,7 +543,7 @@ found: > return (NULL); > /* Handle vm_page_rename(m, new_object, ...). */ > for (i = 0; i < npages; i++) > - if (isset(rv->popmap, index + i)) > + if (popmap_is_set(rv->popmap, index + i)) > return (NULL); > for (i = 0; i < npages; i++) > vm_reserv_populate(rv, index + i); > @@ -628,7 +668,7 @@ found: > index = VM_RESERV_INDEX(object, pindex); > m = &rv->pages[index]; > /* Handle vm_page_rename(m, new_object, ...). */ > - if (isset(rv->popmap, index)) > + if (popmap_is_set(rv->popmap, index)) > return (NULL); > vm_reserv_populate(rv, index); > return (m); > @@ -662,9 +702,9 @@ vm_reserv_break(vm_reserv_t rv, vm_page_ > * to the physical memory allocator. > */ > i = m - rv->pages; > - KASSERT(isclr(rv->popmap, i), > + KASSERT(popmap_is_clear(rv->popmap, i), > ("vm_reserv_break: reserv %p's popmap is corrupted", rv)); > - setbit(rv->popmap, i); > + popmap_set(rv->popmap, i); > rv->popcnt++; > } > i = hi = 0; > From owner-svn-src-head@FreeBSD.ORG Thu Jun 12 23:56:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 349F4389; Thu, 12 Jun 2014 23:56:52 +0000 (UTC) Date: Thu, 12 Jun 2014 19:56:47 -0400 From: Glen Barber To: Julio Merino Subject: Re: svn commit: r267424 - in head: share/mk tools/build/options Message-ID: <20140612235647.GO1248@hub.FreeBSD.org> References: <201406121854.s5CIsrmq000136@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="U+NfgObvpQT1Q9Yq" Content-Disposition: inline In-Reply-To: <201406121854.s5CIsrmq000136@svn.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 23:56:53 -0000 --U+NfgObvpQT1Q9Yq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 12, 2014 at 06:54:53PM +0000, Julio Merino wrote: > Author: jmmv > Date: Thu Jun 12 18:54:52 2014 > New Revision: 267424 > URL: http://svnweb.freebsd.org/changeset/base/267424 >=20 > Log: > Enable MK_TESTS by default. > =20 > This was never intended to be off by default but was done this way > because the initial patches broke the build. Things seem stable now > (have been so for a while too) and "make tinderbox" is clean so let's > try again. > =20 > Announced in freebsd-current; all reported shortcomings have been > addressed. >=20 Unless you do it in the next 5 minutes, I will revert this to shut up the tinderbox mail. Glen --U+NfgObvpQT1Q9Yq Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJTmj4/AAoJELls3eqvi17QoX8QAKCCuFl67Vh3YcoKcCarPz/u j4UZgdRf8JWFDDEoD39OK0YiWauqWb/hiGPJP0UAF0odSroq/vmWlpJwPSiJv8DV bwNH2BxDt18AeLO4PzLS4oOoTSMA0hvUrVKsS6+MURsv8AnfjFJ0yiy7GGLJTUAr 9dBbZpDjWxnsVXmXSyflTj1T9Fcnx2pA51FhrcQxJrSUy1UUhiKwJqc6SjphjtGu vbpMFadgD2+6QqS6G4A5pLuHakLHIbFiImjULJM5MmXJQHcULwS+/gYT9EzvLu1w ZWhjMPGTmSNhQhLnwlxMiu8U7xrbjG1xdqM+WIVIlkukYsIDMJRPlCdeWeciNJ8V RxgYVpqIGmRBer6KMG8hXCKcqB7z5WdYT5w/SyQSPGTjTIoiIvCzf+3Y1GjMdkFx dTSNbpcPKwnlSvBJalSkaGWlN+hzIoylAZz3j1C3K8FtFIIqtzhoDuXhvw8R0RyL T9BCndgz7dyiMIM64beLsjxRzyOuWlM126/ERZ2DC+yGNcFf99C5Al1YkjfgEgOw Z1ZPu3/vJHVRpy7rvQlp/18OX93mvju5j5Abr+7WPeQ6MsIdt2xLiOPU88/gxSW0 MYJbv4y2FrhMgGBOfFRPFcN9kGGWWcKRI/ngstEp7iUkkW35S6uud6JkHfEo5OZy r/m1AjAIC6BJr8H8FZVv =NuBV -----END PGP SIGNATURE----- --U+NfgObvpQT1Q9Yq-- From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 00:05:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E4A9221; Fri, 13 Jun 2014 00:05:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2116D28FA; Fri, 13 Jun 2014 00:05:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5D056P9043995; Fri, 13 Jun 2014 00:05:06 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5D056Wb043991; Fri, 13 Jun 2014 00:05:06 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201406130005.s5D056Wb043991@svn.freebsd.org> From: Glen Barber Date: Fri, 13 Jun 2014 00:05:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267432 - in head: share/man/man5 share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 00:05:07 -0000 Author: gjb Date: Fri Jun 13 00:05:06 2014 New Revision: 267432 URL: http://svnweb.freebsd.org/changeset/base/267432 Log: Revert r267424 and r267425: More exploration will be needed in order to silence the tinderbox mails caused by setting WITH_TESTS=1 by default. Ref: http://tinderbox.freebsd.org/tinderbox-head-build-HEAD-amd64-amd64.full With hat: re Added: head/tools/build/options/WITH_TESTS - copied unchanged from r267423, head/tools/build/options/WITH_TESTS Deleted: head/tools/build/options/WITHOUT_TESTS Modified: head/share/man/man5/src.conf.5 head/share/mk/src.opts.mk Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Jun 12 22:57:55 2014 (r267431) +++ head/share/man/man5/src.conf.5 Fri Jun 13 00:05:06 2014 (r267432) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd June 11, 2014 +.Dd June 8, 2014 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1021,16 +1021,15 @@ Set to not build and install Set to not build .Xr telnet 8 and related programs. -.It Va WITHOUT_TESTS -.\" from FreeBSD: head/tools/build/options/WITHOUT_TESTS 267424 2014-06-12 18:54:52Z jmmv -Set to not build nor install the +.It Va WITH_TESTS +.\" from FreeBSD: head/tools/build/options/WITH_TESTS 267033 2014-06-03 22:34:27Z jmmv +Set to install the .Fx Test Suite in .Pa /usr/tests/ . See .Xr tests 7 for more details. -This also disables the build of all test-related dependencies, including ATF. .It Va WITHOUT_TEXTPROC .\" from FreeBSD: head/tools/build/options/WITHOUT_TEXTPROC 183242 2008-09-21 22:02:26Z sam Set to not build Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Jun 12 22:57:55 2014 (r267431) +++ head/share/mk/src.opts.mk Fri Jun 13 00:05:06 2014 (r267432) @@ -143,7 +143,6 @@ __DEFAULT_YES_OPTIONS = \ SYSINSTALL \ TCSH \ TELNET \ - TESTS \ TEXTPROC \ UNBOUND \ USB \ @@ -169,6 +168,7 @@ __DEFAULT_NO_OPTIONS = \ SHARED_TOOLCHAIN \ SORT_THREADS \ SVN \ + TESTS \ USB_GADGET_EXAMPLES # Copied: head/tools/build/options/WITH_TESTS (from r267423, head/tools/build/options/WITH_TESTS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_TESTS Fri Jun 13 00:05:06 2014 (r267432, copy of r267423, head/tools/build/options/WITH_TESTS) @@ -0,0 +1,8 @@ +.\" $FreeBSD$ +Set to install the +.Fx +Test Suite in +.Pa /usr/tests/ . +See +.Xr tests 7 +for more details. From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 00:20:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DCB7764E; Fri, 13 Jun 2014 00:20:20 +0000 (UTC) Date: Thu, 12 Jun 2014 20:20:17 -0400 From: Glen Barber To: Julio Merino Subject: Re: svn commit: r267424 - in head: share/mk tools/build/options Message-ID: <20140613002017.GP1248@hub.FreeBSD.org> References: <201406121854.s5CIsrmq000136@svn.freebsd.org> <20140612235647.GO1248@hub.FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vIXBmblrD40XNCy4" Content-Disposition: inline In-Reply-To: <20140612235647.GO1248@hub.FreeBSD.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 00:20:21 -0000 --vIXBmblrD40XNCy4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 12, 2014 at 07:56:47PM -0400, Glen Barber wrote: > On Thu, Jun 12, 2014 at 06:54:53PM +0000, Julio Merino wrote: > > Author: jmmv > > Date: Thu Jun 12 18:54:52 2014 > > New Revision: 267424 > > URL: http://svnweb.freebsd.org/changeset/base/267424 > >=20 > > Log: > > Enable MK_TESTS by default. > > =20 > > This was never intended to be off by default but was done this way > > because the initial patches broke the build. Things seem stable now > > (have been so for a while too) and "make tinderbox" is clean so let's > > try again. > > =20 > > Announced in freebsd-current; all reported shortcomings have been > > addressed. > >=20 >=20 > Unless you do it in the next 5 minutes, I will revert this to shut up > the tinderbox mail. >=20 Sorry, had to revert this. The tinderbox is unhappy. Glen --vIXBmblrD40XNCy4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJTmkPBAAoJELls3eqvi17QZmMQAJimY+DDO2+4fS4R5XFzTJvg FerMz5IrrVBc+zwPDYCjZWTFUi2U29xGj9XMjAflXQfo7X5gTw+bXyrVsb5gYovC 3tIGEJOh5i3wWyzr7MS256mRi3YcgcC2heGI0WqjnAAmPvaQw2gCDRJq+O9q94/C a2epoVjioiFIwCXKVOLCii5oWqHb/B39JIkd5VMiaNvy7YAaI4DKD+DoXlCYT9QE HuQ5yx8xS9vWdGfH5F6lG0qO8YtV8XYGx6UVzde22C8Yc9a65iDhFC98u2wnI66z XNakIoWU9JQ3bJtr5MrWMYxd1YHrk3ozRFvp2SlGyECaQr+eUI18PF9MyS281cl0 nnSaxG8ikeaoJWsJg6BVFEJsFLrs98VylLbQh7Yjbr/tkD9Tu0vUTj7DO6wFJhCI ITllpUNBadTZxp2yNA1JlR9KLVq9riwPh9Dqk48P9xZlGWg3VtY6wupsK9f9th8u RzfQBxQ6pSOuxjNNrShSkbsOHVeNYojpjCyXIdvyIPcpeLsavpyEqtqiPWrFnX0P JFLDAa8UrT46g8fMYE18ZI2NhYerbXTvN/1eIV66otgLV2HtS93P3MUOm3vVxkGx uGUEmxXvBUBq+1aQFb03z3yHOhZZSqcihjQw3IUXhOVXk/2z6TNUIqHleghd8hil 0FotnLk+iQXW5HYWNCaR =Mv7/ -----END PGP SIGNATURE----- --vIXBmblrD40XNCy4-- From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 06:44:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0C0E3B9; Fri, 13 Jun 2014 06:44:33 +0000 (UTC) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6479A2764; Fri, 13 Jun 2014 06:44:32 +0000 (UTC) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.14.5/8.14.5) with SMTP id s5D6ekGL019766; Fri, 13 Jun 2014 01:44:30 -0500 Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by pp2.rice.edu with ESMTP id 1mfh28g805-1; Fri, 13 Jun 2014 01:44:29 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id F209B460196; Fri, 13 Jun 2014 01:44:28 -0500 (CDT) Message-ID: <539A9DCB.20205@rice.edu> Date: Fri, 13 Jun 2014 01:44:27 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Adrian Chadd , Alan Cox Subject: Re: svn commit: r267364 - head/sys/vm References: <201406111611.s5BGBCHU058618@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 kscore.compositescore=0 circleOfTrustscore=0 compositescore=0.765433954564634 urlsuspect_oldscore=0.765433954564634 suspectscore=13 recipient_domain_to_sender_totalscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=1 recipient_to_sender_totalscore=0 recipient_domain_to_sender_domain_totalscore=0 rbsscore=0.765433954564634 spamscore=0 recipient_to_sender_domain_totalscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1406130086 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 06:44:33 -0000 On 06/12/2014 18:46, Adrian Chadd wrote: > Hi! > > Wouldn't this also be fixed if popmap_t was a unsigned char (to match > what setbit/clrbit/etc do) and then use the existing macros? > > Is there any reason popmap_t is not a uchar ? Is it ever accessed as > anything other than an array of chars? Yes, there is. Parts of the code that you don't see in the below change make heavy use of ffsl() on the population map. > > > On 11 June 2014 11:11, Alan Cox wrote: >> Author: alc >> Date: Wed Jun 11 16:11:12 2014 >> New Revision: 267364 >> URL: http://svnweb.freebsd.org/changeset/base/267364 >> >> Log: >> Correct a bug in the management of the population map on big-endian >> machines. Specifically, there was a mismatch between how the routine >> allocation and deallocation operations accessed the population map >> and how the aggressively optimized reservation-breaking operation >> accessed it. So, problems only occurred when reservations were broken. >> This change makes the routine operations access the population map in >> the same way as the reservation breaking operation. >> >> This bug was introduced in r259999. >> >> PR: 187080 >> Tested by: jmg (on an "armeb" machine) >> Sponsored by: EMC / Isilon Storage Division >> >> Modified: >> head/sys/vm/vm_reserv.c >> >> Modified: head/sys/vm/vm_reserv.c >> ============================================================================== >> --- head/sys/vm/vm_reserv.c Wed Jun 11 14:53:58 2014 (r267363) >> +++ head/sys/vm/vm_reserv.c Wed Jun 11 16:11:12 2014 (r267364) >> @@ -108,6 +108,46 @@ typedef u_long popmap_t; >> #define NPOPMAP howmany(VM_LEVEL_0_NPAGES, NBPOPMAP) >> >> /* >> + * Clear a bit in the population map. >> + */ >> +static __inline void >> +popmap_clear(popmap_t popmap[], int i) >> +{ >> + >> + popmap[i / NBPOPMAP] &= ~(1UL << (i % NBPOPMAP)); >> +} >> + >> +/* >> + * Set a bit in the population map. >> + */ >> +static __inline void >> +popmap_set(popmap_t popmap[], int i) >> +{ >> + >> + popmap[i / NBPOPMAP] |= 1UL << (i % NBPOPMAP); >> +} >> + >> +/* >> + * Is a bit in the population map clear? >> + */ >> +static __inline boolean_t >> +popmap_is_clear(popmap_t popmap[], int i) >> +{ >> + >> + return ((popmap[i / NBPOPMAP] & (1UL << (i % NBPOPMAP))) == 0); >> +} >> + >> +/* >> + * Is a bit in the population map set? >> + */ >> +static __inline boolean_t >> +popmap_is_set(popmap_t popmap[], int i) >> +{ >> + >> + return ((popmap[i / NBPOPMAP] & (1UL << (i % NBPOPMAP))) != 0); >> +} >> + >> +/* >> * The reservation structure >> * >> * A reservation structure is constructed whenever a large physical page is >> @@ -241,7 +281,7 @@ vm_reserv_depopulate(vm_reserv_t rv, int >> mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); >> KASSERT(rv->object != NULL, >> ("vm_reserv_depopulate: reserv %p is free", rv)); >> - KASSERT(isset(rv->popmap, index), >> + KASSERT(popmap_is_set(rv->popmap, index), >> ("vm_reserv_depopulate: reserv %p's popmap[%d] is clear", rv, >> index)); >> KASSERT(rv->popcnt > 0, >> @@ -255,7 +295,7 @@ vm_reserv_depopulate(vm_reserv_t rv, int >> rv)); >> rv->pages->psind = 0; >> } >> - clrbit(rv->popmap, index); >> + popmap_clear(rv->popmap, index); >> rv->popcnt--; >> if (rv->popcnt == 0) { >> LIST_REMOVE(rv, objq); >> @@ -302,7 +342,7 @@ vm_reserv_populate(vm_reserv_t rv, int i >> mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); >> KASSERT(rv->object != NULL, >> ("vm_reserv_populate: reserv %p is free", rv)); >> - KASSERT(isclr(rv->popmap, index), >> + KASSERT(popmap_is_clear(rv->popmap, index), >> ("vm_reserv_populate: reserv %p's popmap[%d] is set", rv, >> index)); >> KASSERT(rv->popcnt < VM_LEVEL_0_NPAGES, >> @@ -313,7 +353,7 @@ vm_reserv_populate(vm_reserv_t rv, int i >> TAILQ_REMOVE(&vm_rvq_partpop, rv, partpopq); >> rv->inpartpopq = FALSE; >> } >> - setbit(rv->popmap, index); >> + popmap_set(rv->popmap, index); >> rv->popcnt++; >> if (rv->popcnt < VM_LEVEL_0_NPAGES) { >> rv->inpartpopq = TRUE; >> @@ -503,7 +543,7 @@ found: >> return (NULL); >> /* Handle vm_page_rename(m, new_object, ...). */ >> for (i = 0; i < npages; i++) >> - if (isset(rv->popmap, index + i)) >> + if (popmap_is_set(rv->popmap, index + i)) >> return (NULL); >> for (i = 0; i < npages; i++) >> vm_reserv_populate(rv, index + i); >> @@ -628,7 +668,7 @@ found: >> index = VM_RESERV_INDEX(object, pindex); >> m = &rv->pages[index]; >> /* Handle vm_page_rename(m, new_object, ...). */ >> - if (isset(rv->popmap, index)) >> + if (popmap_is_set(rv->popmap, index)) >> return (NULL); >> vm_reserv_populate(rv, index); >> return (m); >> @@ -662,9 +702,9 @@ vm_reserv_break(vm_reserv_t rv, vm_page_ >> * to the physical memory allocator. >> */ >> i = m - rv->pages; >> - KASSERT(isclr(rv->popmap, i), >> + KASSERT(popmap_is_clear(rv->popmap, i), >> ("vm_reserv_break: reserv %p's popmap is corrupted", rv)); >> - setbit(rv->popmap, i); >> + popmap_set(rv->popmap, i); >> rv->popcnt++; >> } >> i = hi = 0; >> > From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 08:26:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DABD3EB; Fri, 13 Jun 2014 08:26:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED4F22F74; Fri, 13 Jun 2014 08:26:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5D8Qr0a071161; Fri, 13 Jun 2014 08:26:53 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5D8Qr0V071160; Fri, 13 Jun 2014 08:26:53 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201406130826.s5D8Qr0V071160@svn.freebsd.org> From: Tijl Coosemans Date: Fri, 13 Jun 2014 08:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267436 - head/lib/libiconv_modules/HZ X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 08:26:54 -0000 Author: tijl Date: Fri Jun 13 08:26:53 2014 New Revision: 267436 URL: http://svnweb.freebsd.org/changeset/base/267436 Log: Replace malloc+memset with calloc. Modified: head/lib/libiconv_modules/HZ/citrus_hz.c Modified: head/lib/libiconv_modules/HZ/citrus_hz.c ============================================================================== --- head/lib/libiconv_modules/HZ/citrus_hz.c Fri Jun 13 07:33:43 2014 (r267435) +++ head/lib/libiconv_modules/HZ/citrus_hz.c Fri Jun 13 08:26:53 2014 (r267436) @@ -532,10 +532,9 @@ _citrus_HZ_parse_graphic(void *context, p = (void **)context; escape = (escape_t *)p[0]; ei = (_HZEncodingInfo *)p[1]; - graphic = malloc(sizeof(*graphic)); + graphic = calloc(1, sizeof(*graphic)); if (graphic == NULL) return (ENOMEM); - memset(graphic, 0, sizeof(*graphic)); if (strcmp("GL", name) == 0) { if (GL(escape) != NULL) goto release; @@ -598,10 +597,9 @@ _citrus_HZ_parse_escape(void *context, c void *p[2]; ei = (_HZEncodingInfo *)context; - escape = malloc(sizeof(*escape)); + escape = calloc(1, sizeof(*escape)); if (escape == NULL) return (EINVAL); - memset(escape, 0, sizeof(*escape)); if (strcmp("0", name) == 0) { escape->set = E0SET(ei); TAILQ_INSERT_TAIL(E0SET(ei), escape, entry); From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 08:28:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2693556; Fri, 13 Jun 2014 08:28:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFFDA2F84; Fri, 13 Jun 2014 08:28:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5D8Spv6071476; Fri, 13 Jun 2014 08:28:51 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5D8Sp7h071474; Fri, 13 Jun 2014 08:28:51 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201406130828.s5D8Sp7h071474@svn.freebsd.org> From: Tijl Coosemans Date: Fri, 13 Jun 2014 08:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267437 - head/lib/libc/iconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 08:28:51 -0000 Author: tijl Date: Fri Jun 13 08:28:51 2014 New Revision: 267437 URL: http://svnweb.freebsd.org/changeset/base/267437 Log: Replace malloc+memset with calloc. Modified: head/lib/libc/iconv/citrus_db_factory.c head/lib/libc/iconv/citrus_iconv.c Modified: head/lib/libc/iconv/citrus_db_factory.c ============================================================================== --- head/lib/libc/iconv/citrus_db_factory.c Fri Jun 13 08:26:53 2014 (r267436) +++ head/lib/libc/iconv/citrus_db_factory.c Fri Jun 13 08:28:51 2014 (r267437) @@ -270,11 +270,9 @@ _citrus_db_factory_serialize(struct _cit return (0); } /* allocate hash table */ - depp = malloc(sizeof(*depp) * df->df_num_entries); + depp = calloc(df->df_num_entries, sizeof(*depp)); if (depp == NULL) return (-1); - for (i = 0; i < df->df_num_entries; i++) - depp[i] = NULL; /* step1: store the entries which are not conflicting */ STAILQ_FOREACH(de, &df->df_entries, de_entry) { Modified: head/lib/libc/iconv/citrus_iconv.c ============================================================================== --- head/lib/libc/iconv/citrus_iconv.c Fri Jun 13 08:26:53 2014 (r267436) +++ head/lib/libc/iconv/citrus_iconv.c Fri Jun 13 08:28:51 2014 (r267437) @@ -344,9 +344,8 @@ const char { char *buf; - if ((buf = malloc((size_t)PATH_MAX)) == NULL) + if ((buf = calloc((size_t)PATH_MAX, sizeof(*buf))) == NULL) return (NULL); - memset((void *)buf, 0, (size_t)PATH_MAX); _citrus_esdb_alias(name, buf, (size_t)PATH_MAX); return (buf); } From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 08:36:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9EEBF964; Fri, 13 Jun 2014 08:36:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CC1B2075; Fri, 13 Jun 2014 08:36:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5D8aA2w075629; Fri, 13 Jun 2014 08:36:10 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5D8aAnQ075628; Fri, 13 Jun 2014 08:36:10 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201406130836.s5D8aAnQ075628@svn.freebsd.org> From: Tijl Coosemans Date: Fri, 13 Jun 2014 08:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267438 - head/lib/libc/iconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 08:36:10 -0000 Author: tijl Date: Fri Jun 13 08:36:10 2014 New Revision: 267438 URL: http://svnweb.freebsd.org/changeset/base/267438 Log: iconv_open: initialise ci_ilseq_invalid field of _citrus_iconv_shared struct after allocation with malloc. iconvlist: reduce a memory leak by copying strings only once. Modified: head/lib/libc/iconv/bsd_iconv.c Modified: head/lib/libc/iconv/bsd_iconv.c ============================================================================== --- head/lib/libc/iconv/bsd_iconv.c Fri Jun 13 08:28:51 2014 (r267437) +++ head/lib/libc/iconv/bsd_iconv.c Fri Jun 13 08:36:10 2014 (r267438) @@ -83,6 +83,7 @@ __bsd___iconv_open(const char *out, cons } handle->cv_shared->ci_discard_ilseq = strcasestr(out, "//IGNORE"); + handle->cv_shared->ci_ilseq_invalid = false; handle->cv_shared->ci_hooks = NULL; return ((iconv_t)(void *)handle); @@ -223,7 +224,7 @@ __bsd_iconvlist(int (*do_one) (unsigned return; } strlcpy(curkey, list[i], slashpos - list[i] + 1); - names[j++] = strdup(curkey); + names[j++] = curkey; for (; (i < sz) && (memcmp(curkey, list[i], strlen(curkey)) == 0); i++) { slashpos = strchr(list[i], '/'); curitem = (char *)malloc(strlen(slashpos) + 1); @@ -235,7 +236,7 @@ __bsd_iconvlist(int (*do_one) (unsigned if (strcmp(curkey, curitem) == 0) { continue; } - names[j++] = strdup(curitem); + names[j++] = curitem; } np = (const char * const *)names; do_one(j, np, data); From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 08:44:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97F04D85; Fri, 13 Jun 2014 08:44:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78FFD212F; Fri, 13 Jun 2014 08:44:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5D8i4YF079770; Fri, 13 Jun 2014 08:44:04 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5D8i4YR079769; Fri, 13 Jun 2014 08:44:04 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201406130844.s5D8i4YR079769@svn.freebsd.org> From: Tijl Coosemans Date: Fri, 13 Jun 2014 08:44:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267439 - head/usr.bin/iconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 08:44:04 -0000 Author: tijl Date: Fri Jun 13 08:44:03 2014 New Revision: 267439 URL: http://svnweb.freebsd.org/changeset/base/267439 Log: - Make invalids variable local to do_conv such that it prints the number of invalid characters of the current file instead of an accumulated value. - Make do_conv return an error when invalid characters have been found. Return EXIT_FAILURE from main if any file contained invalid characters. This matches the behaviour of GNU iconv. - Mark usage with __dead2 attribute. - Make the long_options array const. Modified: head/usr.bin/iconv/iconv.c Modified: head/usr.bin/iconv/iconv.c ============================================================================== --- head/usr.bin/iconv/iconv.c Fri Jun 13 08:36:10 2014 (r267438) +++ head/usr.bin/iconv/iconv.c Fri Jun 13 08:44:03 2014 (r267439) @@ -41,13 +41,11 @@ #include #include -static unsigned long long invalids; +static int do_conv(FILE *, const char *, const char *, bool, bool); +static int do_list(unsigned int, const char * const *, void *); +static void usage(void) __dead2; -static void do_conv(FILE *, const char *, const char *, bool, bool); -static int do_list(unsigned int, const char * const *, void *); -static void usage(void); - -static struct option long_options[] = { +static const struct option long_options[] = { {"from-code", required_argument, NULL, 'f'}, {"list", no_argument, NULL, 'l'}, {"silent", no_argument, NULL, 's'}, @@ -68,12 +66,13 @@ usage(void) #define INBUFSIZE 1024 #define OUTBUFSIZE (INBUFSIZE * 2) -static void +static int do_conv(FILE *fp, const char *from, const char *to, bool silent, bool hide_invalid) { iconv_t cd; char inbuf[INBUFSIZE], outbuf[OUTBUFSIZE], *out; + unsigned long long invalids; const char *in; size_t inbytes, outbytes, ret; @@ -84,8 +83,9 @@ do_conv(FILE *fp, const char *from, cons int arg = 1; if (iconvctl(cd, ICONV_SET_DISCARD_ILSEQ, (void *)&arg) == -1) - err(1, NULL); + err(EXIT_FAILURE, NULL); } + invalids = 0; while ((inbytes = fread(inbuf, 1, INBUFSIZE, fp)) > 0) { in = inbuf; while (inbytes > 0) { @@ -135,6 +135,7 @@ do_conv(FILE *fp, const char *from, cons warnx("warning: invalid characters: %llu", invalids); iconv_close(cd); + return (invalids > 0); } static int @@ -157,7 +158,7 @@ main(int argc, char **argv) { FILE *fp; char *opt_f, *opt_t; - int ch, i; + int ch, i, res; bool opt_c = false, opt_s = false; opt_f = opt_t = strdup(""); @@ -202,18 +203,18 @@ main(int argc, char **argv) if ((strcmp(opt_f, "") == 0) && (strcmp(opt_t, "") == 0)) usage(); if (argc == 0) - do_conv(stdin, opt_f, opt_t, opt_s, opt_c); + res = do_conv(stdin, opt_f, opt_t, opt_s, opt_c); else { + res = 0; for (i = 0; i < argc; i++) { fp = (strcmp(argv[i], "-") != 0) ? fopen(argv[i], "r") : stdin; if (fp == NULL) err(EXIT_FAILURE, "Cannot open `%s'", argv[i]); - do_conv(fp, opt_f, opt_t, opt_s, - opt_c); + res |= do_conv(fp, opt_f, opt_t, opt_s, opt_c); (void)fclose(fp); } } - return (EXIT_SUCCESS); + return (res == 0 ? EXIT_SUCCESS : EXIT_FAILURE); } From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 08:53:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DC422C1; Fri, 13 Jun 2014 08:53:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10D1D221B; Fri, 13 Jun 2014 08:53:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5D8ro5H084167; Fri, 13 Jun 2014 08:53:50 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5D8rowf084163; Fri, 13 Jun 2014 08:53:50 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201406130853.s5D8rowf084163@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 13 Jun 2014 08:53:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267440 - in head: lib share/mk sys/modules sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 08:53:51 -0000 Author: hselasky Date: Fri Jun 13 08:53:49 2014 New Revision: 267440 URL: http://svnweb.freebsd.org/changeset/base/267440 Log: Attach the CUSE library and kernel module to the default FreeBSD builds. Bump the FreeBSD version number. Modified: head/lib/Makefile head/share/mk/src.opts.mk head/sys/modules/Makefile head/sys/sys/param.h Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Fri Jun 13 08:44:03 2014 (r267439) +++ head/lib/Makefile Fri Jun 13 08:53:49 2014 (r267440) @@ -136,6 +136,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ libz \ ${_atf} \ ${_clang} \ + ${_cuse} \ ${_tests} .if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf) @@ -172,6 +173,10 @@ _libcasper= libcasper _clang= clang .endif +.if ${MK_CUSE} != "no" +_cuse= libcuse +.endif + .if ${MK_GPIB} != "no" _libgpib= libgpib .endif Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri Jun 13 08:44:03 2014 (r267439) +++ head/share/mk/src.opts.mk Fri Jun 13 08:53:49 2014 (r267440) @@ -68,6 +68,7 @@ __DEFAULT_YES_OPTIONS = \ CROSS_COMPILER \ CRYPT \ CTM \ + CUSE \ CXX \ DICT \ DMAGENT \ Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Jun 13 08:44:03 2014 (r267439) +++ head/sys/modules/Makefile Fri Jun 13 08:53:49 2014 (r267440) @@ -82,6 +82,7 @@ SUBDIR= \ ${_ct} \ ${_ctau} \ ctl \ + cuse \ ${_cxgb} \ ${_cxgbe} \ ${_cyclic} \ Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Jun 13 08:44:03 2014 (r267439) +++ head/sys/sys/param.h Fri Jun 13 08:53:49 2014 (r267440) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100022 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100023 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 10:08:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E5CF9F4; Fri, 13 Jun 2014 10:08:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41B072834; Fri, 13 Jun 2014 10:08:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5DA8JSE016940; Fri, 13 Jun 2014 10:08:19 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5DA8IgS016938; Fri, 13 Jun 2014 10:08:18 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201406131008.s5DA8IgS016938@svn.freebsd.org> From: Tijl Coosemans Date: Fri, 13 Jun 2014 10:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267441 - in head: include tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 10:08:19 -0000 Author: tijl Date: Fri Jun 13 10:08:18 2014 New Revision: 267441 URL: http://svnweb.freebsd.org/changeset/base/267441 Log: Don't install GSS-API headers when the GSSAPI option has been disabled. Some ports assume GSS-API is supported when they find the headers. PR: 189156 Submitted by: Garrett Cooper Modified: head/include/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Fri Jun 13 08:53:49 2014 (r267440) +++ head/include/Makefile Fri Jun 13 10:08:18 2014 (r267441) @@ -6,11 +6,11 @@ .include CLEANFILES= osreldate.h version vers.c -SUBDIR= arpa gssapi protocols rpcsvc rpc xlocale +SUBDIR= arpa protocols rpcsvc rpc xlocale INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \ db.h \ dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \ - fts.h ftw.h getopt.h glob.h grp.h gssapi.h \ + fts.h ftw.h getopt.h glob.h grp.h \ ieeefp.h ifaddrs.h \ inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \ locale.h malloc.h malloc_np.h memory.h monetary.h mpool.h mqueue.h \ @@ -67,6 +67,11 @@ _dev_powermac_nvram= dev/powermac_nvram _dev_ieee488= dev/ieee488 .endif +.if ${MK_GSSAPI} != "no" +SUBDIR+= gssapi +INCS+= gssapi.h +.endif + .if ${MK_HESIOD} != "no" INCS+= hesiod.h .endif Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jun 13 08:53:49 2014 (r267440) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jun 13 10:08:18 2014 (r267441) @@ -1833,6 +1833,9 @@ OLD_DIRS+=usr/share/tmac .endif .if ${MK_GSSAPI} == no +OLD_FILES+=usr/include/gssapi/gssapi.h +OLD_DIRS+=usr/include/gssapi +OLD_FILES+=usr/include/gssapi.h OLD_FILES+=usr/lib/libgssapi.a OLD_FILES+=usr/lib/libgssapi.so OLD_LIBS+=usr/lib/libgssapi.so.10 From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 14:43:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 643E8A8C; Fri, 13 Jun 2014 14:43:29 +0000 (UTC) Received: from mail-ob0-x22c.google.com (mail-ob0-x22c.google.com [IPv6:2607:f8b0:4003:c01::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0901C230B; Fri, 13 Jun 2014 14:43:28 +0000 (UTC) Received: by mail-ob0-f172.google.com with SMTP id uy5so2953466obc.31 for ; Fri, 13 Jun 2014 07:43:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=VZPTZ1TtXC3UNOWY8ynuyR4LVKitHwWIVrS3suJHj2w=; b=VdPn5JfFJoL6F5r0tBE/4TZmvdrtCxqe/xrjTzanwPMVmrU4N6Z6/dMoxUhCzxVc1F EnASHNdXhiAB3EewpTkh3yvnleBRycZ7zYZPDS+QPNOi3bnC3ERlv/NdOl23yVKvzmWT kZvI/DLQ9w2WXKmtatXIyl3nf7uZ/GFpCr85VPwHFsDhJVlG3i7WXG9+CzSJpY4nV83g jCN9Ht2H+XindWHWtRGiY3lEby3s6BGp8+CX9QIsdqPe5DWIV/H0k3O0iX644qMyGK/5 DMjHOliBhP5uJlFirglLxzJ4c89BgWIU1z7HqUmyrHqal7MOj8wspinciWdCSPDX4KLA wS1g== MIME-Version: 1.0 X-Received: by 10.60.62.174 with SMTP id z14mr3246567oer.61.1402670608304; Fri, 13 Jun 2014 07:43:28 -0700 (PDT) Received: by 10.182.142.34 with HTTP; Fri, 13 Jun 2014 07:43:28 -0700 (PDT) In-Reply-To: <201406131008.s5DA8IgS016938@svn.freebsd.org> References: <201406131008.s5DA8IgS016938@svn.freebsd.org> Date: Fri, 13 Jun 2014 10:43:28 -0400 Message-ID: Subject: Re: svn commit: r267441 - in head: include tools/build/mk From: Benjamin Kaduk To: Tijl Coosemans Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 14:43:29 -0000 On Fri, Jun 13, 2014 at 6:08 AM, Tijl Coosemans wrote: > Author: tijl > Date: Fri Jun 13 10:08:18 2014 > New Revision: 267441 > URL: http://svnweb.freebsd.org/changeset/base/267441 > > Log: > Don't install GSS-API headers when the GSSAPI option has been disabled. > Some ports assume GSS-API is supported when they find the headers. > I am somewhat surprised that MK_GSSAPI=no does not disable the installation of gssapi_krb5.h as well, which currently is controlled by MK_KERBEROS. Does the infrastructure require that we pick one or the other, or could we make it such that disabling either one disables the gssapi_krb5 functionality? -Ben From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 16:23:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AEC47288 for ; Fri, 13 Jun 2014 16:23:33 +0000 (UTC) Received: from mail-ig0-f172.google.com (mail-ig0-f172.google.com [209.85.213.172]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7506A2CDB for ; Fri, 13 Jun 2014 16:23:33 +0000 (UTC) Received: by mail-ig0-f172.google.com with SMTP id l13so716979iga.11 for ; Fri, 13 Jun 2014 09:23:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:content-type:mime-version:subject :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=Dbwi3avKU4RwTkF20UWSO6tSgrs6DkGDdBMNqlJkKs8=; b=kUISHyUU3ojdY/Obsastm29qcnxTWTETaLOfJIhWVKjvNRkEdwHWlKPKkTyMiaYtIh vi/z1pScR7F6f5f9oCTrVZbMvGx/z5deQom3+ocvVylGPA61MMQC+7aJK2oPu9dDhz8F 0sauTteY9lNzjfy0CAU2Is/acfc0VnfUpS1+wcM+QepudOFU+c1ygHECZgapuPmSp2LJ LjZYh6X/x2OdNR9EHO/hwm+UAnZ0dNS3BDb7RCCZm9eI00OS0B0OS6QnP2TZdGvYBzGT /185XW0wSneTYYQZz3GtL6i1obmjqd+Zr4xjUH+WcIMYeE9ACwhAfY2RLbSr6XSjgtzt UIuA== X-Gm-Message-State: ALoCoQlztlmf7AWqeYy223TL24YfNqDu7Kl9w+efptr/GGAvPpj5mmAeUw4r2PvCnKBpzvy7nhR5 X-Received: by 10.43.137.74 with SMTP id in10mr4599225icc.54.1402676612464; Fri, 13 Jun 2014 09:23:32 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id p12sm4234839igx.18.2014.06.13.09.23.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Jun 2014 09:23:31 -0700 (PDT) Sender: Warner Losh From: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r267233 - in head: . bin/rmail gnu/usr.bin/binutils/addr2line gnu/usr.bin/binutils/nm gnu/usr.bin/binutils/objcopy gnu/usr.bin/binutils/objdump gnu/usr.bin/binutils/readelf gnu/usr.bin/... In-Reply-To: <74512A27-DD5F-4D43-BFA1-0AC04E0D08B4@FreeBSD.org> Date: Fri, 13 Jun 2014 10:23:33 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201406081729.s58HTWkc006213@svn.freebsd.org> <74512A27-DD5F-4D43-BFA1-0AC04E0D08B4@FreeBSD.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Bryan Drewery X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 16:23:33 -0000 On Jun 8, 2014, at 11:38 AM, Bjoern A. Zeeb wrote: >=20 > On 08 Jun 2014, at 17:29 , Bryan Drewery wrote: >=20 >> Author: bdrewery >> Date: Sun Jun 8 17:29:31 2014 >> New Revision: 267233 >> URL: http://svnweb.freebsd.org/changeset/base/267233 >>=20 >> Log: >> In preparation for ASLR [1] support add WITH_PIE to support building = with -fPIE. >>=20 >> This is currently an opt-in build flag. Once ASLR support is ready = and stable >> it should changed to opt-out and be enabled by default along with = ASLR. >>=20 >> Each application Makefile uses opt-out to ensure that ASLR will be = enabled by >> default in new directories when the system is compiled with PIE/ASLR. = [2] >>=20 >> Mark known build failures as NO_PIE for now. >=20 > No, no, no, no more NOs! >=20 > I=92ll leave it to others who understand the current build system in = days when it=92s not broken to fix this entire splattering across all = these Makefiles; we really need a better way for this. I told him it was OK to commit this, and I=92d fix it. Warner From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 16:32:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD9F6910 for ; Fri, 13 Jun 2014 16:32:49 +0000 (UTC) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 949092DBF for ; Fri, 13 Jun 2014 16:32:49 +0000 (UTC) Received: by mail-ie0-f182.google.com with SMTP id rp18so2707668iec.27 for ; Fri, 13 Jun 2014 09:32:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:content-type:mime-version:subject :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=COJYekgg0gfqowDv4wcLIeGh/sIpTiARm28cvEgusj4=; b=agS0mvjflmw+zyuXTjvxn6wAbfvoo2JMhIYTcWocziTwXe6zft9uu9yu4TlUbeU6nR IZ1mq2iJnRoF1t0x+d8kBjVPZXOb38VAMtu9X2V4prJE5qHim1Lm+T0m59KDirHWb++0 0+FhvTGdCWKyAMaaMchaw6xJcg0xJk+oHnPqIGjLMYFarxGrsOXuoVYLdDpvrCWZIkwe GfTijn/pkHRO9E7tB8zbZWPQNvp3EcxNmpe+s7eqXYmr0nwudFJ8FPpobiWki/IDN5Qx 9QYNbeYRE4I/S1aokrSwyvNRtqPu4Fk2pW56MzmSYlLEgEwFIZdIcbqyzSltfzSZsgen mVfQ== X-Gm-Message-State: ALoCoQlp3UZ+HTVrzMDCa+MEg1innvs6cFA2j2fMQaLZ6eQErFw/pRS3Sn+hU1oyO69Frgm2/w94 X-Received: by 10.50.18.80 with SMTP id u16mr6295747igd.30.1402677162996; Fri, 13 Jun 2014 09:32:42 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id y15sm4330548igy.2.2014.06.13.09.32.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Jun 2014 09:32:42 -0700 (PDT) Sender: Warner Losh From: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r267318 - head/usr.bin/dtc In-Reply-To: Date: Fri, 13 Jun 2014 10:32:44 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <208E5B83-48DB-478B-A73E-098B8525E18F@gmail.com> References: <201406100616.s5A6GY4Q093247@svn.freebsd.org> To: Benjamin Kaduk X-Mailer: Apple Mail (2.1878.2) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Rui Paulo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 16:32:49 -0000 On Jun 10, 2014, at 7:57 AM, Benjamin Kaduk wrote: > On Tue, Jun 10, 2014 at 2:16 AM, Rui Paulo wrote: > Author: rpaulo > Date: Tue Jun 10 06:16:34 2014 > New Revision: 267318 > URL: http://svnweb.freebsd.org/changeset/base/267318 >=20 > Log: > dtc: ignore lines starting with #. >=20 > This is necessary because we use the C pre-processor to parse = #include lines > and cpp adds line markings that start with #. >=20 > [Obligatory note that cpp is tied to its C compiler and is only = obligated to produce output acceptable to that C compiler; such output = could be arbitrarily complex.] Actually, it isn=92t. cpp has an assembler mode, which is what we and = linux use for dtc. Warner From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 16:34:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64868A82 for ; Fri, 13 Jun 2014 16:34:50 +0000 (UTC) Received: from mail-ie0-f177.google.com (mail-ie0-f177.google.com [209.85.223.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D71C2DDD for ; Fri, 13 Jun 2014 16:34:50 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id tp5so2691502ieb.36 for ; Fri, 13 Jun 2014 09:34:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:content-type:mime-version:subject :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=aUQGo7TlPDQ00TnEuFSndpHM8Y5js15uG71QgSSwGlI=; b=hcAzfiOONr0Jtr2Y5BfCmQyqqNgvt6Ke32lbWoBxT9Zbn0ORA/FUMXtfB2o+uP+cjQ /n1Zst9tTbhFqBRKk1GuYtAgMln2xWBcVcnLslncGgQ7rayXlbcOsSbvewgIir3ZgCH2 aLYzhSpDdc1x0T/tq7ntRRjFNuNoSYsDRzgw7CaODtAzqJSFr6YsRoXeUhitqkf1sMmm ax0hlSxm7+f2d+RKQCcmiTF5D08O/zfCa/ZuF5e4ftWtFS7Qkx9AieTzH+/7O/QqzoMY DQFtYMDlwu1SGxsSr6xKiBawY6i1Ir7FaxBFTHC4kgzAPXrr9CbfWKkYUOH5FmhdvtO7 TyIg== X-Gm-Message-State: ALoCoQm02XPeeSWg8sK3giPrp8ojqobb96yjJZNe4zI8/btdJ4/ynBts77NbHQsh8bXFNEytBpK6 X-Received: by 10.43.160.4 with SMTP id ma4mr4442331icc.83.1402677289182; Fri, 13 Jun 2014 09:34:49 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id b2sm4339516igg.1.2014.06.13.09.34.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Jun 2014 09:34:48 -0700 (PDT) Sender: Warner Losh From: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r267332 - head/release In-Reply-To: <53973EC7.10306@freebsd.org> Date: Fri, 13 Jun 2014 10:34:50 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201406101705.s5AH5gt8007603@svn.freebsd.org> <53973EC7.10306@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Julio Merino , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 16:34:50 -0000 On Jun 10, 2014, at 11:22 AM, Nathan Whitehorn = wrote: > On 06/10/14 10:05, Julio Merino wrote: >> Author: jmmv >> Date: Tue Jun 10 17:05:41 2014 >> New Revision: 267332 >> URL: http://svnweb.freebsd.org/changeset/base/267332 >>=20 >> Log: >> Strip out the test suite from the installation media. >> This affects the disc1.iso, dvd1.iso and bootonly.iso files. >> Obtained from: gjb >>=20 >> Modified: >> head/release/Makefile >>=20 >> Modified: head/release/Makefile >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/release/Makefile Tue Jun 10 17:04:30 2014 = (r267331) >> +++ head/release/Makefile Tue Jun 10 17:05:41 2014 = (r267332) >> @@ -155,7 +155,7 @@ system: packagesystem >> mkdir -p release >> cd ${WORLDDIR} && ${IMAKE} installkernel installworld = distribution \ >> DESTDIR=3D${.OBJDIR}/release WITHOUT_RESCUE=3D1 = WITHOUT_KERNEL_SYMBOLS=3D1 \ >> - WITHOUT_PROFILE=3D1 WITHOUT_SENDMAIL=3D1 WITHOUT_ATF=3D1 = WITHOUT_LIB32=3D1 >> + WITHOUT_PROFILE=3D1 WITHOUT_SENDMAIL=3D1 MK_TESTS=3Dno = WITHOUT_LIB32=3D1 >> # Copy distfiles >=20 > Shouldn't this be "WITHOUT_TESTS" or the like? I thought we weren't = supposed to set MK_* at the command line. We recently started allowing MK_TESTS=3Dno on the command line. In = general, all of those WITHOUT_xxx should become MK_xxx=3Dno in = release/Makefile. Having the MK_xxxx version isolates us further from = (a) the current defaults and (b) config files that turn it to the other = direction. Warner From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 16:49:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B38F4C7; Fri, 13 Jun 2014 16:49:38 +0000 (UTC) Date: Fri, 13 Jun 2014 12:49:34 -0400 From: Glen Barber To: Warner Losh Subject: Re: svn commit: r267332 - head/release Message-ID: <20140613164934.GU1248@hub.FreeBSD.org> References: <201406101705.s5AH5gt8007603@svn.freebsd.org> <53973EC7.10306@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qa1NXTiqN6KSzHv0" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Julio Merino , src-committers@freebsd.org, Nathan Whitehorn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 16:49:39 -0000 --qa1NXTiqN6KSzHv0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 13, 2014 at 10:34:50AM -0600, Warner Losh wrote: >=20 > On Jun 10, 2014, at 11:22 AM, Nathan Whitehorn w= rote: >=20 > > On 06/10/14 10:05, Julio Merino wrote: > >> Author: jmmv > >> Date: Tue Jun 10 17:05:41 2014 > >> New Revision: 267332 > >> URL: http://svnweb.freebsd.org/changeset/base/267332 > >>=20 > >> Log: > >> Strip out the test suite from the installation media. > >> This affects the disc1.iso, dvd1.iso and bootonly.iso files. > >> Obtained from: gjb > >>=20 > >> Modified: > >> head/release/Makefile > >>=20 > >> Modified: head/release/Makefile > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >> --- head/release/Makefile Tue Jun 10 17:04:30 2014 (r267331) > >> +++ head/release/Makefile Tue Jun 10 17:05:41 2014 (r267332) > >> @@ -155,7 +155,7 @@ system: packagesystem > >> mkdir -p release > >> cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ > >> DESTDIR=3D${.OBJDIR}/release WITHOUT_RESCUE=3D1 WITHOUT_KERNEL_SYMB= OLS=3D1 \ > >> - WITHOUT_PROFILE=3D1 WITHOUT_SENDMAIL=3D1 WITHOUT_ATF=3D1 WITHOUT_LI= B32=3D1 > >> + WITHOUT_PROFILE=3D1 WITHOUT_SENDMAIL=3D1 MK_TESTS=3Dno WITHOUT_LIB3= 2=3D1 > >> # Copy distfiles > >=20 > > Shouldn't this be "WITHOUT_TESTS" or the like? I thought we weren't sup= posed to set MK_* at the command line. >=20 > We recently started allowing MK_TESTS=3Dno on the command line. In genera= l, all of those WITHOUT_xxx should become MK_xxx=3Dno in release/Makefile. = Having the MK_xxxx version isolates us further from (a) the current default= s and (b) config files that turn it to the other direction. >=20 The WITH*_FOO -> MK_FOO change is on my TODO this weekend. I want to run at least one full build before committing it. Glen --qa1NXTiqN6KSzHv0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJTmyueAAoJELls3eqvi17QXeUQAKotD9SHVsYKoXGzjWwxVlu9 ebQCy+OC8TppbyJ5bkm+K7sIgryS/X8Iiby1WkT1he1TiTLdU1UY36qjvAEpby+0 kCpkkJMogU9VozwD/+U+zC0LDDWqXE8JZea1H0nppUVsK3JGBSpEvqBa4r50Py2I GELOObjlwmOD6pNt6TsJa91sAv1wpipycO8A8OEeE2wSXD6ARW1WV/tko1tUlgT6 +DEDQLvGj3pkVAHt6gYgfsoK3HNJMzSEJfOV+G71u4cpZ1MsuRzfvVoe3y5QkVQV 7Q8nHrxUlM2sRWdPRsQ7DhS/qBjEwYshUI320PjQ2ZMuJyCoM4YNxyPWavwf1Dm1 THXgW/rRnwSXdoUwrI0Eppaw8YDm6fFM/JzDQ3ri771aW1ejvIlNECLUpVlOLOj5 /UYvcEL/Hd5txVx0fzroTbvPbQmTwSf0bGI4XFK3BAJIn068pS0ExVZ6t8P/8yPE c4guTrVE8ElZPPFqU/Txmmqxfz9Pb5n62bTM0Y3ie94rMP8Igd7tjbnZyq/lbgln ro/a/MtwqfgQXMEu+mcBxI8SQldb3O4/Fa9Xaw1PPWJojgsQkHF0EAJWA0PJaHfl Kj5Ce3iX9I7RsJSBGenw8NmbPrDgJTSNPvST6mwrPImVUHGIw18cloaW3EJXoV1y HxK5cFLu/4aBYP9JGRq2 =ck5c -----END PGP SIGNATURE----- --qa1NXTiqN6KSzHv0-- From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 16:57:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22E36935 for ; Fri, 13 Jun 2014 16:57:23 +0000 (UTC) Received: from mail-ie0-f171.google.com (mail-ie0-f171.google.com [209.85.223.171]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA5F4202F for ; Fri, 13 Jun 2014 16:57:22 +0000 (UTC) Received: by mail-ie0-f171.google.com with SMTP id x19so2728603ier.2 for ; Fri, 13 Jun 2014 09:57:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=Rs9KIJ4Iud2ef9W+hPxHKJNVTvLyaFad1qnm9ZcWXAA=; b=YHObln84T8vxwx75dtWtl0ZlOb/VFA5i7BseVe1Nxp6dxSaFiTbCIqpl7UYcQE5kPe PILFGEMdIF8mScRGT7IYmZJGLLtkyj96R5HXSMOtuhKjCDrieIkEIXhY2zRq+WLaKQIB Uk02lASszTabMUG4cptLRwnwwfKp/IRXYTdYi0xyKZV9mXL6weY7s6u+n8XuuilkpXTg GnbIdsLfISKmwnOnMOUoSIJina6gSzpIlR54EIamm1Oxlqts3xvi626xrLpG/1mDlCGa Q+FXvIK1KXGGMXVGd9rcVFeyA8AnGxMREvxAE+HmTdg9p6yWG+gl76wtNmV4betmzHmU OWfQ== X-Gm-Message-State: ALoCoQkUeMDpkoJWq3hnGSHRs314qaeZq9jpcySVaRWyE7gxGZMK3eqrOkFO3FBc2yQOmswMPR1g X-Received: by 10.42.58.130 with SMTP id i2mr4815083ich.66.1402678642064; Fri, 13 Jun 2014 09:57:22 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id vl10sm4441092igb.16.2014.06.13.09.57.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Jun 2014 09:57:21 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_646603C9-11BA-400F-8CF7-BAE5E0965C3C"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r267332 - head/release From: Warner Losh In-Reply-To: <20140613164934.GU1248@hub.FreeBSD.org> Date: Fri, 13 Jun 2014 10:57:22 -0600 Message-Id: <1EB9FE57-8231-439D-8E91-08452AAB2587@bsdimp.com> References: <201406101705.s5AH5gt8007603@svn.freebsd.org> <53973EC7.10306@freebsd.org> <20140613164934.GU1248@hub.FreeBSD.org> To: Glen Barber X-Mailer: Apple Mail (2.1878.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Julio Merino , src-committers@freebsd.org, Nathan Whitehorn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 16:57:23 -0000 --Apple-Mail=_646603C9-11BA-400F-8CF7-BAE5E0965C3C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Jun 13, 2014, at 10:49 AM, Glen Barber wrote: > On Fri, Jun 13, 2014 at 10:34:50AM -0600, Warner Losh wrote: >>=20 >> On Jun 10, 2014, at 11:22 AM, Nathan Whitehorn = wrote: >>=20 >>> On 06/10/14 10:05, Julio Merino wrote: >>>> Author: jmmv >>>> Date: Tue Jun 10 17:05:41 2014 >>>> New Revision: 267332 >>>> URL: http://svnweb.freebsd.org/changeset/base/267332 >>>>=20 >>>> Log: >>>> Strip out the test suite from the installation media. >>>> This affects the disc1.iso, dvd1.iso and bootonly.iso files. >>>> Obtained from: gjb >>>>=20 >>>> Modified: >>>> head/release/Makefile >>>>=20 >>>> Modified: head/release/Makefile >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/release/Makefile Tue Jun 10 17:04:30 2014 = (r267331) >>>> +++ head/release/Makefile Tue Jun 10 17:05:41 2014 = (r267332) >>>> @@ -155,7 +155,7 @@ system: packagesystem >>>> mkdir -p release >>>> cd ${WORLDDIR} && ${IMAKE} installkernel installworld = distribution \ >>>> DESTDIR=3D${.OBJDIR}/release WITHOUT_RESCUE=3D1 = WITHOUT_KERNEL_SYMBOLS=3D1 \ >>>> - WITHOUT_PROFILE=3D1 WITHOUT_SENDMAIL=3D1 WITHOUT_ATF=3D1 = WITHOUT_LIB32=3D1 >>>> + WITHOUT_PROFILE=3D1 WITHOUT_SENDMAIL=3D1 MK_TESTS=3Dno = WITHOUT_LIB32=3D1 >>>> # Copy distfiles >>>=20 >>> Shouldn't this be "WITHOUT_TESTS" or the like? I thought we weren't = supposed to set MK_* at the command line. >>=20 >> We recently started allowing MK_TESTS=3Dno on the command line. In = general, all of those WITHOUT_xxx should become MK_xxx=3Dno in = release/Makefile. Having the MK_xxxx version isolates us further from = (a) the current defaults and (b) config files that turn it to the other = direction. >>=20 >=20 > The WITH*_FOO -> MK_FOO change is on my TODO this weekend. I want to > run at least one full build before committing it. There=92s no rush. What=92s there now works, except in extreme = circumstances. Testing of this stuff is good. It is way too easy to = think a change is a NOP when in fact it breaks something subtle... Warner --Apple-Mail=_646603C9-11BA-400F-8CF7-BAE5E0965C3C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTmy1yAAoJEGwc0Sh9sBEAqtwP/RYYWS6PSFVJDDTRKAK90sI6 f9LOaAnEedHslzuqF6zWdWFCblmI1zLWijQVAOpUXUriECHRZyD77dNtm6Q2qy60 8GSL6EUZziWSLVWgf7FvTzW3EoGcHctSzCT7xvk+GYHi8GPHaJWrFyYAo7fSTkOG SLk77UUwbfi2vmpO3u2s6P0mSJwurAnhvJU9zbxliQx3u1h1/EQqwFjnn+IM9rHH oPEaJ/yYGS8IE/d+PVfi51kp7ycMtQdVwt5OM75uz4l0+p72+BadXeZnhEUdkACU y56e1tebkofwhmpij1heTsxucqNkL7BsSOeHp0IC+BZwdmG/vtrbSo/UeR3X3uVv 1QohlmDN9fVKnX3nz9Y08w1ovB0LeFKA2V7rhfnYbW4U0hJEk+sp982teR9y8GkN huzzniM+eF9RQBGzT+AUdiJPPnsWw1GqxJIVDlfc4fZwCmuaCaR6rtrGxDqwmuhK x2ftA43iMub4lVEXSYRr6xISrWg7U9xhyl1gk567EBL/ZlOO0NgbloYiLQNhHV37 Zes/zK5q2vaKHdkqSiA0MpM0YzjojZU9AVP6wiIDlo31sxb/Xc6o287Kk2XtJJXQ u96EEd9on3Nk0x8Qqa3sgT/iNtXKLMH56PM0mgVWLPzc4AM5O0s0iqPlihoBe5SF zyh+xAH2kaUh7eOsrRcz =7Z/R -----END PGP SIGNATURE----- --Apple-Mail=_646603C9-11BA-400F-8CF7-BAE5E0965C3C-- From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 18:07:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 687EAD3E; Fri, 13 Jun 2014 18:07:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5585F2663; Fri, 13 Jun 2014 18:07:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5DI7hNg039853; Fri, 13 Jun 2014 18:07:43 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5DI7h8E039852; Fri, 13 Jun 2014 18:07:43 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201406131807.s5DI7h8E039852@svn.freebsd.org> From: Xin LI Date: Fri, 13 Jun 2014 18:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267445 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 18:07:43 -0000 Author: delphij Date: Fri Jun 13 18:07:42 2014 New Revision: 267445 URL: http://svnweb.freebsd.org/changeset/base/267445 Log: Add Jung-uk Kim as co-maintainer of OpenSSL per discussion on -developers and agreed by benl@. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Fri Jun 13 15:04:21 2014 (r267444) +++ head/MAINTAINERS Fri Jun 13 18:07:42 2014 (r267445) @@ -102,7 +102,7 @@ linux emul emulation Please discuss chan bs{diff,patch} cperciva Pre-commit review requested. portsnap cperciva Pre-commit review requested. freebsd-update cperciva Pre-commit review requested. -openssl benl Pre-commit review requested. +openssl benl,jkim Pre-commit review requested. sys/netgraph/bluetooth emax Pre-commit review preferred. lib/libbluetooth emax Pre-commit review preferred. lib/libsdp emax Pre-commit review preferred. From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 18:20:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 989F55DF; Fri, 13 Jun 2014 18:20:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78F3C2809; Fri, 13 Jun 2014 18:20:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5DIKkoh046107; Fri, 13 Jun 2014 18:20:46 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5DIKjEk046100; Fri, 13 Jun 2014 18:20:45 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406131820.s5DIKjEk046100@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jun 2014 18:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267446 - in head/sys/dev: amr drm drm2 isp mlx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 18:20:46 -0000 Author: jhb Date: Fri Jun 13 18:20:44 2014 New Revision: 267446 URL: http://svnweb.freebsd.org/changeset/base/267446 Log: Add missing calls to bus_dmamap_unload() when freeing static DMA allocations. Reviewed by: scottl Modified: head/sys/dev/amr/amr_pci.c head/sys/dev/drm/ati_pcigart.c head/sys/dev/drm/drm_pci.c head/sys/dev/drm2/drm_pci.c head/sys/dev/isp/isp_pci.c head/sys/dev/mlx/mlx.c Modified: head/sys/dev/amr/amr_pci.c ============================================================================== --- head/sys/dev/amr/amr_pci.c Fri Jun 13 18:07:42 2014 (r267445) +++ head/sys/dev/amr/amr_pci.c Fri Jun 13 18:20:44 2014 (r267446) @@ -477,20 +477,25 @@ amr_pci_free(struct amr_softc *sc) bus_dma_tag_destroy(sc->amr_buffer64_dmat); /* free and destroy DMA memory and tag for passthrough pool */ - if (sc->amr_ccb) + if (sc->amr_ccb) { + bus_dmamap_unload(sc->amr_ccb_dmat, sc->amr_ccb_dmamap); bus_dmamem_free(sc->amr_ccb_dmat, sc->amr_ccb, sc->amr_ccb_dmamap); + } if (sc->amr_ccb_dmat) bus_dma_tag_destroy(sc->amr_ccb_dmat); /* free and destroy DMA memory and tag for s/g lists */ - if (sc->amr_sgtable) + if (sc->amr_sgtable) { + bus_dmamap_unload(sc->amr_sg_dmat, sc->amr_sg_dmamap); bus_dmamem_free(sc->amr_sg_dmat, sc->amr_sgtable, sc->amr_sg_dmamap); + } if (sc->amr_sg_dmat) bus_dma_tag_destroy(sc->amr_sg_dmat); /* free and destroy DMA memory and tag for mailbox */ p = (void *)(uintptr_t)(volatile void *)sc->amr_mailbox64; if (sc->amr_mailbox) { + bus_dmamap_unload(sc->amr_mailbox_dmat, sc->amr_mailbox_dmamap); bus_dmamem_free(sc->amr_mailbox_dmat, p, sc->amr_mailbox_dmamap); } if (sc->amr_mailbox_dmat) Modified: head/sys/dev/drm/ati_pcigart.c ============================================================================== --- head/sys/dev/drm/ati_pcigart.c Fri Jun 13 18:07:42 2014 (r267445) +++ head/sys/dev/drm/ati_pcigart.c Fri Jun 13 18:20:44 2014 (r267446) @@ -116,6 +116,7 @@ drm_ati_free_pcigart_table(struct drm_de { struct drm_dma_handle *dmah = gart_info->dmah; + bus_dmamap_unload(dmah->tag, dmah->map); bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); bus_dma_tag_destroy(dmah->tag); free(dmah, DRM_MEM_DMA); Modified: head/sys/dev/drm/drm_pci.c ============================================================================== --- head/sys/dev/drm/drm_pci.c Fri Jun 13 18:07:42 2014 (r267445) +++ head/sys/dev/drm/drm_pci.c Fri Jun 13 18:20:44 2014 (r267446) @@ -119,6 +119,7 @@ drm_pci_free(struct drm_device *dev, drm if (dmah == NULL) return; + bus_dmamap_unload(dmah->tag, dmah->map); bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); bus_dma_tag_destroy(dmah->tag); Modified: head/sys/dev/drm2/drm_pci.c ============================================================================== --- head/sys/dev/drm2/drm_pci.c Fri Jun 13 18:07:42 2014 (r267445) +++ head/sys/dev/drm2/drm_pci.c Fri Jun 13 18:20:44 2014 (r267446) @@ -116,6 +116,7 @@ drm_pci_free(struct drm_device *dev, drm if (dmah == NULL) return; + bus_dmamap_unload(dmah->tag, dmah->map); bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map); bus_dma_tag_destroy(dmah->tag); Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Fri Jun 13 18:07:42 2014 (r267445) +++ head/sys/dev/isp/isp_pci.c Fri Jun 13 18:20:44 2014 (r267446) @@ -1741,6 +1741,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) bad: while (--cmap >= 0) { struct isp_fc *fc = ISP_FC_PC(isp, cmap); + bus_dmamap_unload(fc->tdmat, fc->tdmap); bus_dmamem_free(fc->tdmat, base, fc->tdmap); bus_dma_tag_destroy(fc->tdmat); while (fc->nexus_free_list) { @@ -1749,6 +1750,8 @@ bad: free(n, M_DEVBUF); } } + if (isp->isp_rquest_dma != 0) + bus_dmamap_unload(isp->isp_osinfo.cdmat, isp->isp_osinfo.cdmap); bus_dmamem_free(isp->isp_osinfo.cdmat, base, isp->isp_osinfo.cdmap); bus_dma_tag_destroy(isp->isp_osinfo.cdmat); free(isp->isp_xflist, M_DEVBUF); Modified: head/sys/dev/mlx/mlx.c ============================================================================== --- head/sys/dev/mlx/mlx.c Fri Jun 13 18:07:42 2014 (r267445) +++ head/sys/dev/mlx/mlx.c Fri Jun 13 18:20:44 2014 (r267446) @@ -191,6 +191,8 @@ mlx_free(struct mlx_softc *sc) bus_dma_tag_destroy(sc->mlx_buffer_dmat); /* free and destroy DMA memory and tag for s/g lists */ + if (sc->mlx_sgbusaddr) + bus_dmamap_unload(sc->mlx_sg_dmat, sc->mlx_sg_dmamap); if (sc->mlx_sgtable) bus_dmamem_free(sc->mlx_sg_dmat, sc->mlx_sgtable, sc->mlx_sg_dmamap); if (sc->mlx_sg_dmat) @@ -239,10 +241,15 @@ mlx_sglist_map(struct mlx_softc *sc) debug_called(1); /* destroy any existing mappings */ + if (sc->mlx_sgbusaddr) + bus_dmamap_unload(sc->mlx_sg_dmat, sc->mlx_sg_dmamap); if (sc->mlx_sgtable) bus_dmamem_free(sc->mlx_sg_dmat, sc->mlx_sgtable, sc->mlx_sg_dmamap); if (sc->mlx_sg_dmat) bus_dma_tag_destroy(sc->mlx_sg_dmat); + sc->mlx_sgbusaddr = 0; + sc->mlx_sgtable = NULL; + sc->mlx_sg_dmat = NULL; /* * Create a single tag describing a region large enough to hold all of From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 19:34:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8569C44C; Fri, 13 Jun 2014 19:34:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6711B2E24; Fri, 13 Jun 2014 19:34:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5DJYZOg081733; Fri, 13 Jun 2014 19:34:35 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5DJYZuj081731; Fri, 13 Jun 2014 19:34:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406131934.s5DJYZuj081731@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jun 2014 19:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267448 - head/sys/dev/ubsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 19:34:35 -0000 Author: jhb Date: Fri Jun 13 19:34:34 2014 New Revision: 267448 URL: http://svnweb.freebsd.org/changeset/base/267448 Log: Don't check maps for static DMA allocations against NULL to see if an allocation succeeded. Instead, check the tag against NULL. Modified: head/sys/dev/ubsec/ubsec.c Modified: head/sys/dev/ubsec/ubsec.c ============================================================================== --- head/sys/dev/ubsec/ubsec.c Fri Jun 13 19:10:40 2014 (r267447) +++ head/sys/dev/ubsec/ubsec.c Fri Jun 13 19:34:34 2014 (r267448) @@ -2301,25 +2301,25 @@ ubsec_kprocess_modexp_sw(struct ubsec_so errout: if (me != NULL) { - if (me->me_q.q_mcr.dma_map != NULL) + if (me->me_q.q_mcr.dma_tag != NULL) ubsec_dma_free(sc, &me->me_q.q_mcr); - if (me->me_q.q_ctx.dma_map != NULL) { + if (me->me_q.q_ctx.dma_tag != NULL) { bzero(me->me_q.q_ctx.dma_vaddr, me->me_q.q_ctx.dma_size); ubsec_dma_free(sc, &me->me_q.q_ctx); } - if (me->me_M.dma_map != NULL) { + if (me->me_M.dma_tag != NULL) { bzero(me->me_M.dma_vaddr, me->me_M.dma_size); ubsec_dma_free(sc, &me->me_M); } - if (me->me_E.dma_map != NULL) { + if (me->me_E.dma_tag != NULL) { bzero(me->me_E.dma_vaddr, me->me_E.dma_size); ubsec_dma_free(sc, &me->me_E); } - if (me->me_C.dma_map != NULL) { + if (me->me_C.dma_tag != NULL) { bzero(me->me_C.dma_vaddr, me->me_C.dma_size); ubsec_dma_free(sc, &me->me_C); } - if (me->me_epb.dma_map != NULL) + if (me->me_epb.dma_tag != NULL) ubsec_dma_free(sc, &me->me_epb); free(me, M_DEVBUF); } @@ -2502,25 +2502,25 @@ ubsec_kprocess_modexp_hw(struct ubsec_so errout: if (me != NULL) { - if (me->me_q.q_mcr.dma_map != NULL) + if (me->me_q.q_mcr.dma_tag != NULL) ubsec_dma_free(sc, &me->me_q.q_mcr); - if (me->me_q.q_ctx.dma_map != NULL) { + if (me->me_q.q_ctx.dma_tag != NULL) { bzero(me->me_q.q_ctx.dma_vaddr, me->me_q.q_ctx.dma_size); ubsec_dma_free(sc, &me->me_q.q_ctx); } - if (me->me_M.dma_map != NULL) { + if (me->me_M.dma_tag != NULL) { bzero(me->me_M.dma_vaddr, me->me_M.dma_size); ubsec_dma_free(sc, &me->me_M); } - if (me->me_E.dma_map != NULL) { + if (me->me_E.dma_tag != NULL) { bzero(me->me_E.dma_vaddr, me->me_E.dma_size); ubsec_dma_free(sc, &me->me_E); } - if (me->me_C.dma_map != NULL) { + if (me->me_C.dma_tag != NULL) { bzero(me->me_C.dma_vaddr, me->me_C.dma_size); ubsec_dma_free(sc, &me->me_C); } - if (me->me_epb.dma_map != NULL) + if (me->me_epb.dma_tag != NULL) ubsec_dma_free(sc, &me->me_epb); free(me, M_DEVBUF); } @@ -2696,13 +2696,13 @@ ubsec_kprocess_rsapriv(struct ubsec_soft errout: if (rp != NULL) { - if (rp->rpr_q.q_mcr.dma_map != NULL) + if (rp->rpr_q.q_mcr.dma_tag != NULL) ubsec_dma_free(sc, &rp->rpr_q.q_mcr); - if (rp->rpr_msgin.dma_map != NULL) { + if (rp->rpr_msgin.dma_tag != NULL) { bzero(rp->rpr_msgin.dma_vaddr, rp->rpr_msgin.dma_size); ubsec_dma_free(sc, &rp->rpr_msgin); } - if (rp->rpr_msgout.dma_map != NULL) { + if (rp->rpr_msgout.dma_tag != NULL) { bzero(rp->rpr_msgout.dma_vaddr, rp->rpr_msgout.dma_size); ubsec_dma_free(sc, &rp->rpr_msgout); } From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 19:40:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32FB3766; Fri, 13 Jun 2014 19:40:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FEBF2E77; Fri, 13 Jun 2014 19:40:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5DJe2bA082581; Fri, 13 Jun 2014 19:40:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5DJe2Kp082580; Fri, 13 Jun 2014 19:40:02 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201406131940.s5DJe2Kp082580@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jun 2014 19:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267449 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 19:40:03 -0000 Author: jhb Date: Fri Jun 13 19:40:02 2014 New Revision: 267449 URL: http://svnweb.freebsd.org/changeset/base/267449 Log: - Don't check the dma map address for a static DMA mapping against NULL to determine if the mapping is valid. - Don't explicitly destroy the dmap map for static DMA mappings. Reviewed by: adrian Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Fri Jun 13 19:34:34 2014 (r267448) +++ head/sys/dev/iwn/if_iwn.c Fri Jun 13 19:40:02 2014 (r267449) @@ -1733,16 +1733,12 @@ fail: iwn_dma_contig_free(dma); static void iwn_dma_contig_free(struct iwn_dma_info *dma) { - if (dma->map != NULL) { - if (dma->vaddr != NULL) { - bus_dmamap_sync(dma->tag, dma->map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(dma->tag, dma->map); - bus_dmamem_free(dma->tag, dma->vaddr, dma->map); - dma->vaddr = NULL; - } - bus_dmamap_destroy(dma->tag, dma->map); - dma->map = NULL; + if (dma->vaddr != NULL) { + bus_dmamap_sync(dma->tag, dma->map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(dma->tag, dma->map); + bus_dmamem_free(dma->tag, dma->vaddr, dma->map); + dma->vaddr = NULL; } if (dma->tag != NULL) { bus_dma_tag_destroy(dma->tag); From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 22:33:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45D851F6; Fri, 13 Jun 2014 22:33:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 338422D50; Fri, 13 Jun 2014 22:33:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5DMXgDd063849; Fri, 13 Jun 2014 22:33:42 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5DMXgep063848; Fri, 13 Jun 2014 22:33:42 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201406132233.s5DMXgep063848@svn.freebsd.org> From: Xin LI Date: Fri, 13 Jun 2014 22:33:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267451 - head/sys/dev/mfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 22:33:42 -0000 Author: delphij Date: Fri Jun 13 22:33:41 2014 New Revision: 267451 URL: http://svnweb.freebsd.org/changeset/base/267451 Log: Correct variable for loader tunable variable hw.mfi.mrsas_enable. Submitted by: Sascha Wildner (DragonFly) MFC after: 3 days Modified: head/sys/dev/mfi/mfi_pci.c Modified: head/sys/dev/mfi/mfi_pci.c ============================================================================== --- head/sys/dev/mfi/mfi_pci.c Fri Jun 13 21:30:40 2014 (r267450) +++ head/sys/dev/mfi/mfi_pci.c Fri Jun 13 22:33:41 2014 (r267451) @@ -113,7 +113,7 @@ SYSCTL_INT(_hw_mfi, OID_AUTO, msi, CTLFL "Enable use of MSI interrupts"); static int mfi_mrsas_enable = 0; -TUNABLE_INT("hw.mfi.mrsas_enable", &mfi_msi); +TUNABLE_INT("hw.mfi.mrsas_enable", &mfi_mrsas_enable); SYSCTL_INT(_hw_mfi, OID_AUTO, mrsas_enable, CTLFLAG_RDTUN, &mfi_mrsas_enable, 0, "Allow mrasas to take newer cards"); From owner-svn-src-head@FreeBSD.ORG Fri Jun 13 23:56:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7CD08D2; Fri, 13 Jun 2014 23:56:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9439D23E2; Fri, 13 Jun 2014 23:56:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5DNun14001161; Fri, 13 Jun 2014 23:56:49 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5DNumNj001150; Fri, 13 Jun 2014 23:56:48 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201406132356.s5DNumNj001150@svn.freebsd.org> From: Edwin Groothuis Date: Fri, 13 Jun 2014 23:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267452 - head/contrib/tzdata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 23:56:49 -0000 Author: edwin Date: Fri Jun 13 23:56:47 2014 New Revision: 267452 URL: http://svnweb.freebsd.org/changeset/base/267452 Log: Vendor import of tzdata2014e changes Fix historical data for Egypt. Better prediction for future Egypt / Morocco changes. Update to Cocos / Cook islands. Fix historical data for Russia. Obtained from: ftp://ftp.iana.org/tz/releases/ Modified: head/contrib/tzdata/africa head/contrib/tzdata/australasia head/contrib/tzdata/etcetera head/contrib/tzdata/europe head/contrib/tzdata/factory head/contrib/tzdata/leapseconds head/contrib/tzdata/northamerica head/contrib/tzdata/zone.tab Modified: head/contrib/tzdata/africa ============================================================================== --- head/contrib/tzdata/africa Fri Jun 13 22:33:41 2014 (r267451) +++ head/contrib/tzdata/africa Fri Jun 13 23:56:47 2014 (r267452) @@ -239,13 +239,13 @@ Rule Egypt 1990 1994 - May 1 1:00 1:00 # http://www.worldtimezone.com/dst_news/dst_news_egypt04.html # Rule Egypt 1995 2010 - Apr lastFri 0:00s 1:00 S -Rule Egypt 1995 2005 - Sep lastThu 23:00s 0 - +Rule Egypt 1995 2005 - Sep lastThu 24:00 0 - # From Steffen Thorsen (2006-09-19): # The Egyptian Gazette, issue 41,090 (2006-09-18), page 1, reports: # Egypt will turn back clocks by one hour at the midnight of Thursday # after observing the daylight saving time since May. # http://news.gom.com.eg/gazette/pdf/2006/09/18/01.pdf -Rule Egypt 2006 only - Sep 21 23:00s 0 - +Rule Egypt 2006 only - Sep 21 24:00 0 - # From Dirk Losch (2007-08-14): # I received a mail from an airline which says that the daylight # saving time in Egypt will end in the night of 2007-09-06 to 2007-09-07. @@ -254,7 +254,7 @@ Rule Egypt 2006 only - Sep 21 23:00s 0 - # http://www.timeanddate.com/worldclock/city.html?n=53 # From Steffen Thorsen (2007-09-04): The official information...: # http://www.sis.gov.eg/En/EgyptOnline/Miscellaneous/000002/0207000000000000001580.htm -Rule Egypt 2007 only - Sep Thu>=1 23:00s 0 - +Rule Egypt 2007 only - Sep Thu>=1 24:00 0 - # From Abdelrahman Hassan (2007-09-06): # Due to the Hijri (lunar Islamic calendar) year being 11 days shorter # than the year of the Gregorian calendar, Ramadan shifts earlier each @@ -342,46 +342,77 @@ Rule Egypt 2007 only - Sep Thu>=1 23:00s # From Gunther Vermier (2015-05-13): # our Egypt office confirms that the change will be at 15 May "midnight" (24:00) -# From Paul Eggert (2014-05-13): +# From Imed Chihi (2014-06-04): +# We have finally "located" a precise official reference about the DST changes +# in Egypt. The Ministers Cabinet decision is explained at +# http://www.cabinet.gov.eg/Media/CabinetMeetingsDetails.aspx?id=347 ... +# [T]his (Arabic) site is not accessible outside Egypt, but the page ... +# translates into: "With regard to daylight saving time, it is scheduled to +# take effect at exactly twelve o'clock this evening, Thursday, 15 MAY 2014, +# to be suspended by twelve o'clock on the evening of Thursday, 26 JUN 2014, +# and re-established again at the end of the month of Ramadan, at twelve +# o'clock on the evening of Thursday, 31 JUL 2014." This statement has been +# reproduced by other (more accessible) sites[, e.g.,]... +# http://elgornal.net/news/news.aspx?id=4699258 + +# From Paul Eggert (2014-06-04): # Sarah El Deeb and Lee Keath of AP report that the Egyptian government says # the change is because of blackouts in Cairo, even though Ahram Online (cited -# above) says DST had no affect on electricity consumption. The AP story says -# DST will not be observed during Ramadan. There is no information about when -# DST will end. See: +# above) says DST had no affect on electricity consumption. There is +# no information about when DST will end this fall. See: # http://abcnews.go.com/International/wireStory/el-sissi-pushes-egyptians-line-23614833 # -# For now, guess that later transitions will use 2010's rules, and that -# Egypt will agree with Morocco (see below) about the date Ramadan starts and -# ends, though (unlike Morocco) it will switch at 00:00 standard time. In -# Egypt the spring-forward transitions are removed for 2020-2022, when the -# guessed spring-forward date falls during the estimated Ramadan, and all -# transitions removed for 2023-2038, where the estimated Ramadan falls entirely -# outside the guessed daylight-saving time. Ramadan intrudes on the guessed -# DST starting in 2039, but that's beyond our somewhat-arbitrary cutoff. - -Rule Egypt 2008 only - Aug lastThu 23:00s 0 - -Rule Egypt 2009 only - Aug 20 23:00s 0 - -Rule Egypt 2010 only - Aug 11 0:00 0 - -Rule Egypt 2010 only - Sep 10 0:00 1:00 S -Rule Egypt 2010 only - Sep lastThu 23:00s 0 - +# For now, guess that later spring and fall transitions will use +# 2010's rules, and guess that Egypt will switch to standard time at +# 24:00 the last Thursday before Ramadan, and back to DST at 00:00 the +# first Friday after Ramadan. To implement this, +# transition dates for 2015 through 2037 were determined by running +# the following program under GNU Emacs 24.3, with the results integrated +# by hand into the table below. Ramadan again intrudes on the guessed +# DST starting in 2038, but that's beyond our somewhat-arbitrary cutoff. +# (let ((islamic-year 1436)) +# (while (< islamic-year 1460) +# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) +# (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) +# (friday 5)) +# (while (/= friday (mod a 7)) +# (setq a (1- a))) +# (while (/= friday (mod b 7)) +# (setq b (1+ b))) +# (setq a (1- a)) +# (setq b (1- b)) +# (setq a (calendar-gregorian-from-absolute a)) +# (setq b (calendar-gregorian-from-absolute b)) +# (insert +# (format +# (concat "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t0\t-\n" +# "Rule\tEgypt\t%d\tonly\t-\t%s\t%2d\t24:00\t1:00\tS\n") +# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) +# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) +# (setq islamic-year (+ 1 islamic-year)))) +Rule Egypt 2008 only - Aug lastThu 24:00 0 - +Rule Egypt 2009 only - Aug 20 24:00 0 - +Rule Egypt 2010 only - Aug 10 24:00 0 - +Rule Egypt 2010 only - Sep 9 24:00 1:00 S +Rule Egypt 2010 only - Sep lastThu 24:00 0 - Rule Egypt 2014 only - May 15 24:00 1:00 S -Rule Egypt 2014 only - Jun 29 0:00s 0 - -Rule Egypt 2014 only - Jul 29 0:00s 1:00 S -Rule Egypt 2014 max - Sep lastThu 23:00s 0 - +Rule Egypt 2014 only - Jun 26 24:00 0 - +Rule Egypt 2014 only - Jul 31 24:00 1:00 S +Rule Egypt 2014 max - Sep lastThu 24:00 0 - Rule Egypt 2015 2019 - Apr lastFri 0:00s 1:00 S -Rule Egypt 2015 only - Jun 18 0:00s 0 - -Rule Egypt 2015 only - Jul 18 0:00s 1:00 S -Rule Egypt 2016 only - Jun 7 0:00s 0 - -Rule Egypt 2016 only - Jul 7 0:00s 1:00 S -Rule Egypt 2017 only - May 27 0:00s 0 - -Rule Egypt 2017 only - Jun 26 0:00s 1:00 S -Rule Egypt 2018 only - May 16 0:00s 0 - -Rule Egypt 2018 only - Jun 15 0:00s 1:00 S -Rule Egypt 2019 only - May 6 0:00s 0 - -Rule Egypt 2019 only - Jun 5 0:00s 1:00 S -Rule Egypt 2020 only - May 24 0:00s 1:00 S -Rule Egypt 2021 only - May 13 0:00s 1:00 S -Rule Egypt 2022 only - May 3 0:00s 1:00 S +Rule Egypt 2015 only - Jun 11 24:00 0 - +Rule Egypt 2015 only - Jul 23 24:00 1:00 S +Rule Egypt 2016 only - Jun 2 24:00 0 - +Rule Egypt 2016 only - Jul 7 24:00 1:00 S +Rule Egypt 2017 only - May 25 24:00 0 - +Rule Egypt 2017 only - Jun 29 24:00 1:00 S +Rule Egypt 2018 only - May 10 24:00 0 - +Rule Egypt 2018 only - Jun 14 24:00 1:00 S +Rule Egypt 2019 only - May 2 24:00 0 - +Rule Egypt 2019 only - Jun 6 24:00 1:00 S +Rule Egypt 2020 only - May 28 24:00 1:00 S +Rule Egypt 2021 only - May 13 24:00 1:00 S +Rule Egypt 2022 only - May 5 24:00 1:00 S Rule Egypt 2023 max - Apr lastFri 0:00s 1:00 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -914,39 +945,36 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # From Sebastien Willemijns (2014-03-18): # http://www.afriquinfos.com/articles/2014/3/18/maroc-heure-dete-avancez-tous-horloges-247891.asp -# From Paul Eggert (2014-03-19): -# To estimate what the Moroccan government will do in future years, -# transition dates for 2014 through 2038 were determined by running -# the following program under GNU Emacs 24.3: -# -# (let ((islamic-year 1435)) -# (while (< islamic-year 1461) -# (let ((a -# (calendar-gregorian-from-absolute -# (calendar-islamic-to-absolute (list 9 1 islamic-year)))) -# (b -# (calendar-gregorian-from-absolute -# (calendar-islamic-to-absolute (list 10 1 islamic-year))))) -# (insert -# (format -# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 3:00\t0\t-\n" -# "Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 2:00\t1:00\tS\n") -# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) -# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) +# From Milamber Space Network (2014-06-05): +# The Moroccan government has recently announced that the country will return +# to standard time at 03:00 on Saturday, June 28, 2014 local time.... DST +# will resume again at 02:00 on Saturday, August 2, 2014.... +# http://www.mmsp.gov.ma/fr/actualites.aspx?id=586 + +# From Paul Eggert (2014-06-05): +# For now, guess that later spring and fall transitions will use 2014's rules, +# and guess that Morocco will switch to standard time at 03:00 the last +# Saturday before Ramadan, and back to DST at 02:00 the first Saturday after +# Ramadan. To implement this, transition dates for 2015 through 2037 were +# determined by running the following program under GNU Emacs 24.3, with the +# results integrated by hand into the table below. +# (let ((islamic-year 1436)) +# (while (< islamic-year 1460) +# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) +# (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) +# (saturday 6)) +# (while (/= saturday (mod (setq a (1- a)) 7))) +# (while (/= saturday (mod b 7)) +# (setq b (1+ b))) +# (setq a (calendar-gregorian-from-absolute a)) +# (setq b (calendar-gregorian-from-absolute b)) +# (insert +# (format +# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 3:00\t0\t-\n" +# "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 2:00\t1:00\tS\n") +# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) +# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) # (setq islamic-year (+ 1 islamic-year)))) -# -# with spring-forward transitions removed for 2023-2025, when the -# normal spring-forward date falls during the estimated Ramadan; with -# all transitions removed for 2026-2035, where the estimated Ramadan -# falls entirely outside daylight-saving time; and with fall-back -# transitions removed for 2036-2037, where the normal fall-back -# date falls during the estimated Ramadan. Normally, the table would -# stop after 2037 because 32-bit time_t values roll around early in 2038, -# but that would imply a prediction of perpetual DST after March 2038 -# due to the year-2037 glitches. So, this table instead stops after -# 2038, the first non-glitchy year after the 32-bit rollover. -# An advantage of stopping after 2038 is that it lets zic guess -# TZ='WET0WEST,M3.5.0,M10.5.0/3' for time stamps far in the future. # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -968,46 +996,44 @@ Rule Morocco 1978 only - Aug 4 0:00 0 Rule Morocco 2008 only - Jun 1 0:00 1:00 S Rule Morocco 2008 only - Sep 1 0:00 0 - Rule Morocco 2009 only - Jun 1 0:00 1:00 S -Rule Morocco 2009 only - Aug 21 0:00 0 - +Rule Morocco 2009 only - Aug 21 0:00 0 - Rule Morocco 2010 only - May 2 0:00 1:00 S Rule Morocco 2010 only - Aug 8 0:00 0 - Rule Morocco 2011 only - Apr 3 0:00 1:00 S -Rule Morocco 2011 only - Jul 31 0 0 - -Rule Morocco 2012 2013 - Apr lastSun 2:00 1:00 S -Rule Morocco 2012 only - Sep 30 3:00 0 - -Rule Morocco 2012 only - Jul 20 3:00 0 - -Rule Morocco 2012 only - Aug 20 2:00 1:00 S -Rule Morocco 2013 only - Jul 7 3:00 0 - -Rule Morocco 2013 only - Aug 10 2:00 1:00 S -Rule Morocco 2013 2035 - Oct lastSun 3:00 0 - -Rule Morocco 2014 2022 - Mar lastSun 2:00 1:00 S -Rule Morocco 2014 only - Jun 29 3:00 0 - -Rule Morocco 2014 only - Jul 29 2:00 1:00 S -Rule Morocco 2015 only - Jun 18 3:00 0 - -Rule Morocco 2015 only - Jul 18 2:00 1:00 S -Rule Morocco 2016 only - Jun 7 3:00 0 - -Rule Morocco 2016 only - Jul 7 2:00 1:00 S -Rule Morocco 2017 only - May 27 3:00 0 - -Rule Morocco 2017 only - Jun 26 2:00 1:00 S -Rule Morocco 2018 only - May 16 3:00 0 - -Rule Morocco 2018 only - Jun 15 2:00 1:00 S -Rule Morocco 2019 only - May 6 3:00 0 - -Rule Morocco 2019 only - Jun 5 2:00 1:00 S -Rule Morocco 2020 only - Apr 24 3:00 0 - -Rule Morocco 2020 only - May 24 2:00 1:00 S -Rule Morocco 2021 only - Apr 13 3:00 0 - -Rule Morocco 2021 only - May 13 2:00 1:00 S -Rule Morocco 2022 only - Apr 3 3:00 0 - -Rule Morocco 2022 only - May 3 2:00 1:00 S -Rule Morocco 2023 only - Apr 22 2:00 1:00 S -Rule Morocco 2024 only - Apr 10 2:00 1:00 S -Rule Morocco 2025 only - Mar 31 2:00 1:00 S -Rule Morocco 2026 max - Mar lastSun 2:00 1:00 S -Rule Morocco 2036 only - Oct 21 3:00 0 - -Rule Morocco 2037 only - Oct 11 3:00 0 - -Rule Morocco 2038 only - Sep 30 3:00 0 - -Rule Morocco 2038 only - Oct 30 2:00 1:00 S -Rule Morocco 2038 max - Oct lastSun 3:00 0 - +Rule Morocco 2011 only - Jul 31 0 0 - +Rule Morocco 2012 2013 - Apr lastSun 2:00 1:00 S +Rule Morocco 2012 only - Sep 30 3:00 0 - +Rule Morocco 2012 only - Jul 20 3:00 0 - +Rule Morocco 2012 only - Aug 20 2:00 1:00 S +Rule Morocco 2013 only - Jul 7 3:00 0 - +Rule Morocco 2013 only - Aug 10 2:00 1:00 S +Rule Morocco 2013 max - Oct lastSun 3:00 0 - +Rule Morocco 2014 2022 - Mar lastSun 2:00 1:00 S +Rule Morocco 2014 only - Jun 28 3:00 0 - +Rule Morocco 2014 only - Aug 2 2:00 1:00 S +Rule Morocco 2015 only - Jun 13 3:00 0 - +Rule Morocco 2015 only - Jul 18 2:00 1:00 S +Rule Morocco 2016 only - Jun 4 3:00 0 - +Rule Morocco 2016 only - Jul 9 2:00 1:00 S +Rule Morocco 2017 only - May 20 3:00 0 - +Rule Morocco 2017 only - Jul 1 2:00 1:00 S +Rule Morocco 2018 only - May 12 3:00 0 - +Rule Morocco 2018 only - Jun 16 2:00 1:00 S +Rule Morocco 2019 only - May 4 3:00 0 - +Rule Morocco 2019 only - Jun 8 2:00 1:00 S +Rule Morocco 2020 only - Apr 18 3:00 0 - +Rule Morocco 2020 only - May 30 2:00 1:00 S +Rule Morocco 2021 only - Apr 10 3:00 0 - +Rule Morocco 2021 only - May 15 2:00 1:00 S +Rule Morocco 2022 only - Apr 2 3:00 0 - +Rule Morocco 2022 only - May 7 2:00 1:00 S +Rule Morocco 2023 only - Apr 22 2:00 1:00 S +Rule Morocco 2024 only - Apr 13 2:00 1:00 S +Rule Morocco 2025 only - Apr 5 2:00 1:00 S +Rule Morocco 2026 max - Mar lastSun 2:00 1:00 S +Rule Morocco 2035 only - Oct 27 3:00 0 - +Rule Morocco 2036 only - Oct 18 3:00 0 - +Rule Morocco 2037 only - Oct 10 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 Modified: head/contrib/tzdata/australasia ============================================================================== --- head/contrib/tzdata/australasia Fri Jun 13 22:33:41 2014 (r267451) +++ head/contrib/tzdata/australasia Fri Jun 13 23:56:47 2014 (r267452) @@ -250,24 +250,14 @@ Zone Antarctica/Macquarie 0 - zzz 1899 N Zone Indian/Christmas 7:02:52 - LMT 1895 Feb 7:00 - CXT # Christmas Island Time -# Cook Is -# From Shanks & Pottenger: -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Cook 1978 only - Nov 12 0:00 0:30 HS -Rule Cook 1979 1991 - Mar Sun>=1 0:00 0 - -Rule Cook 1979 1990 - Oct lastSun 0:00 0:30 HS -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Rarotonga -10:39:04 - LMT 1901 # Avarua - -10:30 - CKT 1978 Nov 12 # Cook Is Time - -10:00 Cook CK%sT - -# Cocos +# Cocos (Keeling) Is # These islands were ruled by the Ross family from about 1830 to 1978. # We don't know when standard time was introduced; for now, we guess 1900. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Indian/Cocos 6:27:40 - LMT 1900 6:30 - CCT # Cocos Islands Time + # Fiji # Milne gives 11:55:44 for Suva. @@ -473,7 +463,8 @@ Rule NZ 1934 1940 - Apr lastSun 2:00 0 M Rule NZ 1934 1940 - Sep lastSun 2:00 0:30 S Rule NZ 1946 only - Jan 1 0:00 0 S # Since 1957 Chatham has been 45 minutes ahead of NZ, but there's no -# convenient notation for this so we must duplicate the Rule lines. +# convenient single notation for the date and time of this transition +# so we must duplicate the Rule lines. Rule NZ 1974 only - Nov Sun>=1 2:00s 1:00 D Rule Chatham 1974 only - Nov Sun>=1 2:45s 1:00 D Rule NZ 1975 only - Feb lastSun 2:00s 0 S @@ -511,6 +502,17 @@ Link Pacific/Auckland Antarctica/McMurdo # previously whalers, sealers, pastoralists, and scientific personnel wintered # was probably like Pacific/Auckland +# Cook Is +# From Shanks & Pottenger: +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Cook 1978 only - Nov 12 0:00 0:30 HS +Rule Cook 1979 1991 - Mar Sun>=1 0:00 0 - +Rule Cook 1979 1990 - Oct lastSun 0:00 0:30 HS +# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Zone Pacific/Rarotonga -10:39:04 - LMT 1901 # Avarua + -10:30 - CKT 1978 Nov 12 # Cook Is Time + -10:00 Cook CK%sT + ############################################################################### Modified: head/contrib/tzdata/etcetera ============================================================================== --- head/contrib/tzdata/etcetera Fri Jun 13 22:33:41 2014 (r267451) +++ head/contrib/tzdata/etcetera Fri Jun 13 23:56:47 2014 (r267452) @@ -15,9 +15,9 @@ Zone Etc/UCT 0 - UCT # The following link uses older naming conventions, # but it belongs here, not in the file `backward', -# as functions like gmtime load the "UTC" file to handle leap seconds properly. +# as functions like gmtime load the "GMT" file to handle leap seconds properly. # We want this to work even on installations that omit the other older names. -Link Etc/UTC UTC +Link Etc/GMT GMT Link Etc/UTC Etc/Universal Link Etc/UTC Etc/Zulu Modified: head/contrib/tzdata/europe ============================================================================== --- head/contrib/tzdata/europe Fri Jun 13 22:33:41 2014 (r267451) +++ head/contrib/tzdata/europe Fri Jun 13 23:56:47 2014 (r267452) @@ -6,7 +6,7 @@ # go ahead and edit the file (and please send any changes to # tz@iana.org for general use in the future). -# From Paul Eggert (2006-03-22): +# From Paul Eggert (2014-05-31): # A good source for time zone historical data outside the U.S. is # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). @@ -17,6 +17,9 @@ # published semiannually. Law sent in several helpful summaries # of the IATA's data after 1990. # +# A reliable and entertaining source about time zones is +# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). +# # Except where otherwise noted, Shanks & Pottenger is the source for # entries through 1991, and IATA SSIM is the source for entries afterwards. # @@ -26,9 +29,9 @@ # Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), # which I found in the UCLA library. # -# # William Willett, The Waste of Daylight, 19th edition -# (1914-03) +# +# [PDF] (1914-03) # # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 # . He writes: @@ -58,10 +61,7 @@ # 1:00 CET CEST CEMT Central Europe # 1:00:14 SET Swedish (1879-1899)* # 2:00 EET EEST Eastern Europe -# 3:00 MSK MSD Moscow -# -# A reliable and entertaining source about time zones, especially in Britain, -# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). +# 3:00 MSK MSD MSM* Moscow # From Peter Ilieve (1994-12-04), # The original six [EU members]: Belgium, France, (West) Germany, Italy, @@ -558,11 +558,11 @@ Rule Russia 1917 only - Dec 28 0:00 0 M Rule Russia 1918 only - May 31 22:00 2:00 MDST # Moscow Double Summer Time Rule Russia 1918 only - Sep 16 1:00 1:00 MST Rule Russia 1919 only - May 31 23:00 2:00 MDST -Rule Russia 1919 only - Jul 1 2:00 1:00 S -Rule Russia 1919 only - Aug 16 0:00 0 - -Rule Russia 1921 only - Feb 14 23:00 1:00 S -Rule Russia 1921 only - Mar 20 23:00 2:00 M # Midsummer -Rule Russia 1921 only - Sep 1 0:00 1:00 S +Rule Russia 1919 only - Jul 1 2:00 1:00 MSD +Rule Russia 1919 only - Aug 16 0:00 0 MSK +Rule Russia 1921 only - Feb 14 23:00 1:00 MSD +Rule Russia 1921 only - Mar 20 23:00 2:00 MSM # Midsummer +Rule Russia 1921 only - Sep 1 0:00 1:00 MSD Rule Russia 1921 only - Oct 1 0:00 0 - # Act No.925 of the Council of Ministers of the USSR (1980-10-24): Rule Russia 1981 1984 - Apr 1 0:00 1:00 S @@ -2217,6 +2217,7 @@ Zone Europe/Kaliningrad 1:22:00 - LMT 1 Zone Europe/Moscow 2:30:20 - LMT 1880 2:30 - MMT 1916 Jul 3 # Moscow Mean Time 2:30:48 Russia %s 1919 Jul 1 2:00 + 3:00 Russia %s 1921 Oct 3:00 Russia MSK/MSD 1922 Oct 2:00 - EET 1930 Jun 21 3:00 Russia MSK/MSD 1991 Mar 31 2:00s @@ -2375,7 +2376,7 @@ Zone Asia/Yakutsk 8:38:40 - LMT 1919 De Zone Asia/Vladivostok 8:47:44 - LMT 1922 Nov 15 9:00 - VLAT 1930 Jun 21 # Vladivostok Time 10:00 Russia VLA%sT 1991 Mar 31 2:00s - 9:00 Russia VLA%sST 1992 Jan 19 2:00s + 9:00 Russia VLA%sT 1992 Jan 19 2:00s 10:00 Russia VLA%sT 2011 Mar 27 2:00s 11:00 - VLAT Modified: head/contrib/tzdata/factory ============================================================================== --- head/contrib/tzdata/factory Fri Jun 13 22:33:41 2014 (r267451) +++ head/contrib/tzdata/factory Fri Jun 13 23:56:47 2014 (r267452) @@ -7,4 +7,4 @@ # Also useful for the "comp.sources" version. # Zone NAME GMTOFF RULES FORMAT -Zone Factory 0 - "Local time zone must be set--use tzsetup" +Zone Factory 0 - "Local time zone must be set--see zic manual page" Modified: head/contrib/tzdata/leapseconds ============================================================================== --- head/contrib/tzdata/leapseconds Fri Jun 13 22:33:41 2014 (r267451) +++ head/contrib/tzdata/leapseconds Fri Jun 13 23:56:47 2014 (r267452) @@ -1,14 +1,20 @@ -#